diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..62db1a1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +*.py text eol=lf +*.rst text eol=lf +*.sh text eol=lf +*.cpp text eol=lf +*.hpp text eol=lf +*.patch text eol=lf diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..c6e682c --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: 2bndy5 diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..0d0b1c9 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1 @@ +_extends: .github diff --git a/.github/workflows/binary-builds.yml b/.github/workflows/binary-builds.yml new file mode 100644 index 0000000..ff552a2 --- /dev/null +++ b/.github/workflows/binary-builds.yml @@ -0,0 +1,182 @@ +name: Binary executable builds + +permissions: + contents: read + +on: + push: + branches: [main] + tags: + - v[0-9]+.* + pull_request: + branches: [main] + +env: + CARGO_INCREMENTAL: 0 + CARGO_NET_GIT_FETCH_WITH_CLI: true + CARGO_NET_RETRY: 10 + CARGO_TERM_COLOR: always + RUST_BACKTRACE: 1 + RUSTFLAGS: -D warnings + RUSTUP_MAX_RETRIES: 10 + +defaults: + run: + shell: bash + +jobs: + + create-assets: + name: ${{ matrix.target }} + strategy: + fail-fast: false + matrix: + include: + - target: aarch64-unknown-linux-gnu + os: ubuntu-latest + - target: aarch64-unknown-linux-musl + os: ubuntu-latest + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + - target: x86_64-unknown-linux-musl + os: ubuntu-latest + - target: aarch64-apple-darwin + os: macos-latest + - target: x86_64-apple-darwin + os: macos-latest + - target: x86_64-pc-windows-msvc + os: windows-latest + runs-on: ${{ matrix.os }} + permissions: + contents: write + steps: + - name: Calculate Release Version + id: calc-version + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + short_sha=$(echo "${{ github.sha }}" | awk '{print substr($0,0,5)}') + echo "RELEASE_VERSION=nightly-$(date '+%Y-%m-%d')-$short_sha" >> $GITHUB_OUTPUT + else + echo "RELEASE_VERSION=${{ github.ref_name }}" >> $GITHUB_OUTPUT + fi + + - name: Install native OpenSSL on Linux + if: runner.os == 'Linux' && !(startsWith(matrix.target, 'aarch64') || endsWith(matrix.target, 'musl')) + run: sudo apt-get install -y pkg-config libssl-dev + - name: Install GCC for aarch64 (for cross-compiling openssl) + if: runner.os == 'Linux' && startsWith(matrix.target, 'aarch64') + run: | + if [[ "${{matrix.target}}" == *musl ]]; then + sudo apt-get install musl-dev musl-tools + else + sudo apt-get install gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu + fi + - name: Install musl-gcc (fom compiling OpenSSL) + if: matrix.target == 'x86_64-unknown-linux-musl' + run: sudo apt-get install musl-tools + + - name: Calculate openssl-vendored + shell: bash + id: is-openssl-vendored + run: | + case "${{ matrix.target }}" in + "aarch64-apple-darwin" | "x86_64-apple-darwin" | "aarch64-unknown-linux-gnu" | "aarch64-unknown-linux-musl" | "x86_64-unknown-linux-musl") + echo "enabled=true" >> $GITHUB_OUTPUT + ;; + *) + echo "enabled=false" >> $GITHUB_OUTPUT + ;; + esac + + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + with: + target: ${{ matrix.target }} + + - name: Build (openssl-vendored) + if: steps.is-openssl-vendored.outputs.enabled == 'true' + run: cargo build --release --bin cpp-linter-cli --target ${{ matrix.target }} --features openssl-vendored + - name: Build (no openssl-vendored) + if: steps.is-openssl-vendored.outputs.enabled == 'false' + run: cargo build --release --bin cpp-linter-cli --target ${{ matrix.target }} + + - name: Prepare artifacts [Windows] + shell: bash + if: matrix.os == 'windows-latest' + id: prep-artifacts-windows + run: | + release_dir="cpp-linter-cli-${{ steps.calc-version.outputs.RELEASE_VERSION }}" + artifact_path="cpp-linter-cli-${{ steps.calc-version.outputs.RELEASE_VERSION }}-${{ matrix.target }}.zip" + echo "ARTIFACT_PATH=$artifact_path" >> $GITHUB_OUTPUT + mkdir $release_dir + cp target/${{ matrix.target }}/release/cpp-linter-cli.exe $release_dir/ + cp LICENSE $release_dir/ + 7z a -tzip $artifact_path $release_dir/ + - name: Prepare artifacts [Unix] + shell: bash + id: prep-artifacts-unix + if: matrix.os != 'windows-latest' + run: | + release_dir="cpp-linter-cli-${{ steps.calc-version.outputs.RELEASE_VERSION }}" + artifact_path="cpp-linter-cli-${{ steps.calc-version.outputs.RELEASE_VERSION }}-${{ matrix.target }}.tar.gz" + echo "ARTIFACT_PATH=$artifact_path" >> $GITHUB_OUTPUT + mkdir $release_dir + cp target/${{ matrix.target }}/release/cpp-linter-cli $release_dir/ + cp LICENSE $release_dir + tar -czvf $artifact_path $release_dir/ + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.prep-artifacts-unix.outputs.ARTIFACT_PATH || steps.prep-artifacts-windows.outputs.ARTIFACT_PATH }} + path: ${{ steps.prep-artifacts-unix.outputs.ARTIFACT_PATH || steps.prep-artifacts-windows.outputs.ARTIFACT_PATH }} + if-no-files-found: error + + create-release: + if: startswith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + needs: [create-assets] + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Install Rust + run: rustup update stable --no-self-update + - run: cargo package + - name: Create a Github Release + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + env: + GH_TOKEN: ${{ github.token }} + run: gh release create ${{ github.ref_name }} --generate-notes + - run: cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + + upload-assets: + needs: [create-release] + runs-on: ubuntu-latest + strategy: + matrix: + include: + - target: aarch64-unknown-linux-gnu + - target: aarch64-unknown-linux-musl + - target: x86_64-unknown-linux-gnu + - target: x86_64-unknown-linux-musl + - target: aarch64-apple-darwin + - target: x86_64-apple-darwin + - target: universal-apple-darwin + - target: x86_64-pc-windows-msvc + steps: + - name: Download build asset + uses: actions/download-artifact@v4 + with: + name: cpp-linter-cli-${{ matrix.target }} + path: dist + - name: Upload release assets + env: + GH_TOKEN: ${{ github.token }} + run: gh release upload ${{ github.ref_name }} dist/cpp-linter-cli${{ contains(matrix.target, 'windows') || '.exe' }}%#%cpp-linter-cli_${{ matrix.target }} --clobber diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml new file mode 100644 index 0000000..e81dba9 --- /dev/null +++ b/.github/workflows/build-docs.yml @@ -0,0 +1,33 @@ +name: Docs + +on: [push, workflow_dispatch] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: 3.x + + - name: Install docs dependencies + run: pip install -r docs/requirements.txt + + - name: Build docs + run: sphinx-build docs docs/_build/html + + - name: upload docs build as artifact + uses: actions/upload-artifact@v4 + with: + name: "cpp-linter_docs" + path: ${{ github.workspace }}/docs/_build/html + + - name: upload to github pages + # only publish doc changes from main branch + if: github.ref == 'refs/heads/main' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/_build/html diff --git a/.github/workflows/pre-commit-hooks.yml b/.github/workflows/pre-commit-hooks.yml new file mode 100644 index 0000000..0df1903 --- /dev/null +++ b/.github/workflows/pre-commit-hooks.yml @@ -0,0 +1,17 @@ +name: Pre-commit + +on: + push: + pull_request: + types: opened + +jobs: + check-source-files: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + - run: python3 -m pip install pre-commit + - run: pre-commit run --all-files diff --git a/.github/workflows/python-packaging.yml b/.github/workflows/python-packaging.yml new file mode 100644 index 0000000..7196cc2 --- /dev/null +++ b/.github/workflows/python-packaging.yml @@ -0,0 +1,139 @@ +name: Python packaging + +on: + push: + branches: + - main + - master + tags: + - '*' + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + linux: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + target: [x86_64, x86, aarch64, armv7, s390x, ppc64le] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Calculate openssl-vendored + shell: bash + id: is-openssl-vendored + run: | + if [[ "${{ startsWith(matrix.target, 'x86') }}" == "true" ]]; then + echo "enabled=" >> $GITHUB_OUTPUT + else + echo "enabled=--features openssl-vendored" >> $GITHUB_OUTPUT + fi + + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.target }} + args: --release --out dist --find-interpreter ${{ steps.is-openssl-vendored.outputs.enabled }} + manylinux: auto + before-script-linux: | + case "${{ matrix.target }}" in + "aarch64" | "armv7" | "s390x" | "ppc64le") + # NOTE: pypa/manylinux docker images are Debian based + sudo apt-get update + sudo apt-get install -y pkg-config libssl-dev + ;; + "x86" | "x86_64") + # NOTE: rust-cross/manylinux docker images are CentOS based + yum update -y + yum install -y openssl openssl-devel + ;; + esac + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-linux-${{ matrix.target }} + path: dist/* + + windows: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + target: [x64, x86] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + architecture: ${{ matrix.target }} + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.target }} + args: --release --out dist --find-interpreter + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-windows-${{ matrix.target }} + path: dist/* + + macos: + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + target: [x86_64, aarch64] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.target }} + args: --release --out dist --find-interpreter --features openssl-vendored + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: wheels-macos-${{ matrix.target }} + path: dist/* + + sdist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build sdist + uses: PyO3/maturin-action@v1 + with: + command: sdist + args: --out dist + - name: Upload sdist + uses: actions/upload-artifact@v4 + with: + name: wheels-sdist + path: dist/* + + release: + name: Release + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + needs: [linux, windows, macos, sdist] + steps: + - uses: actions/download-artifact@v4 + with: + path: dist + - name: Publish to PyPI + uses: PyO3/maturin-action@v1 + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + with: + command: upload + args: --non-interactive --skip-existing dist/* diff --git a/.github/workflows/run-dev-tests.yml b/.github/workflows/run-dev-tests.yml new file mode 100644 index 0000000..48da8c6 --- /dev/null +++ b/.github/workflows/run-dev-tests.yml @@ -0,0 +1,116 @@ +name: "Check rust code" + +on: + push: + branches: [main] + paths: + - "**.rs" + - "*.toml" + - ".github/workflows/run-dev-tests.yml" + pull_request: + # types: opened + branches: [main] + paths: + - "**.rs" + - "*.toml" + - ".github/workflows/run-dev-tests.yml" + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + strategy: + fail-fast: false + matrix: + os: ['windows-latest', ubuntu-latest] + version: ['17', '16', '15', '14', '13', '12', '11', '10', '9', '8', '7'] + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - run: rustup component add llvm-tools-preview + + # https://docs.rs/openssl/latest/openssl/#automatic + - name: Install OpenSSL (Linux) + if: runner.os == 'Linux' + run: sudo apt-get install -y pkg-config libssl-dev + - name: Install OpenSSL (MacOS) + if: runner.os == 'macOS' + run: brew install openssl@3 + # - name: Install OpenSSL (Windows) + # if: runner.os == 'Windows' + # run: vcpkg install openssl + + - name: Install cargo-nextest and cargo-llvm-cov + uses: taiki-e/install-action@v2 + with: + tool: cargo-nextest,cargo-llvm-cov,cargo-binstall + + - uses: actions/setup-python@v5 + with: + python-version: 3.x + + # - name: Install workflow deps + # run: python3 -m pip install meson + + # # https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages + # - name: Install ninja (Linux) + # if: runner.os == 'Linux' + # run: sudo apt-get install ninja-build + # - name: Install ninja (Windows) + # if: runner.os == 'Windows' + # run: choco install ninja + + - name: Install Linux clang dependencies + if: runner.os == 'Linux' + shell: bash + run: | + sudo apt-get update + # First try installing from default Ubuntu repositories before trying LLVM script + if ! sudo apt-get install -y clang-format-${{ matrix.version }} clang-tidy-${{ matrix.version }}; then + # This LLVM script will add the relevant LLVM PPA: https://apt.llvm.org/ + wget https://apt.llvm.org/llvm.sh -O ${{ runner.temp }}/llvm_install.sh + chmod +x ${{ runner.temp }}/llvm_install.sh + if sudo ${{ runner.temp }}/llvm_install.sh ${{ matrix.version }}; then + sudo apt-get install -y clang-format-${{ matrix.version }} clang-tidy-${{ matrix.version }} + fi + fi + + - name: Install clang-tools + run: | + python -m pip install clang-tools + clang-tools --install ${{ matrix.version }} + + - name: Collect Coverage (for codecov.io) + if: matrix.version == '16' && runner.os == 'Linux' + env: + CLANG_VERSION: ${{ matrix.version }} + run: cargo llvm-cov --hide-instantiations --lib --codecov --output-path .coverage.json nextest + + - uses: codecov/codecov-action@v3 + if: matrix.version == '16' && runner.os == 'Linux' + with: + token: ${{secrets.CODECOV_TOKEN}} + files: .coverage.json + fail_ci_if_error: true # optional (default = false) + + - name: Install llvm-cov-pretty (HTL report generator) + if: matrix.version != '16' && runner.os != 'Linux' + run: cargo binstall -y llvm-cov-pretty + + - name: Collect Coverage (for HTML report) + if: matrix.version != '16' && runner.os != 'Linux' + env: + CLANG_VERSION: ${{ matrix.version }} + run: | + cargo llvm-cov --hide-instantiations --lib --json --output-path .coverage.json nextest + llvm-cov-pretty .coverage.json + + - name: Upload coverage data + uses: actions/upload-artifact@v4 + if: matrix.version != '16' && runner.os != 'Linux' + with: + name: HTML_report-${{ runner.os }}-clang_v${{ matrix.version }} + path: target/llvm-cov-pretty diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0357bed --- /dev/null +++ b/.gitignore @@ -0,0 +1,199 @@ +# Created by https://www.toptal.com/developers/gitignore/api/rust,python +# Edit at https://www.toptal.com/developers/gitignore?templates=rust,python + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +### Python Patch ### +# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration +poetry.toml + +# ruff +.ruff_cache/ + +# LSP config files +pyrightconfig.json + +### Rust ### +# Generated by Cargo +# will have compiled files and executables +debug/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + +# End of https://www.toptal.com/developers/gitignore/api/rust,python + +# ignore vscode stuff +.vscode/ + + +# ignore generated files +.cpp_linter_cache/ +docs/cli_args.rst diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..da99fca --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,3 @@ +tasks: + - init: pip install -r requirements-dev.txt + command: pre-commit install && maturin develop diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..4fc186d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,40 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: trailing-whitespace + exclude: tests/capture_tools_output/cpp-linter/cpp-linter/test_git_lib.patch + - id: end-of-file-fixer + - id: check-docstring-first + - id: check-added-large-files + args: [--maxkb=9000] + - id: check-yaml + - id: check-toml + - id: requirements-txt-fixer + - id: mixed-line-ending + args: ["--fix=lf"] + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.8 + hooks: + # Run the python linter. + - id: ruff + args: [ --fix ] + # Run the python formatter. + - id: ruff-format + - repo: local + # these hooks require a tools managed by the rustup installer + hooks: + # Run the rust formatter. + # Run the rust linter. + - id: cargo-clippy + name: cargo clippy + description: Lint all rust files with the clippy tool + entry: cargo clippy --allow-staged --allow-dirty --fix + language: rust + pass_filenames: false + - id: cargo-fmt + name: cargo fmt + description: Format all rust files with the rustfmt tool + entry: cargo fmt + language: rust + pass_filenames: false diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..223b784 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,41 @@ +[package] +name = "cpp-linter" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lib] +name = "cpp_linter" +crate-type = ["lib", "cdylib"] + +[[bin]] +name = "cpp-linter-cli" +path = "src/bin.rs" + +[dependencies] +clap = { version = ">=4.4.2" } +git2 = ">=0.18.1" +lenient_semver = "0.4.2" +log = ">=0.4.20" +openssl = { version = "0.10", features = ["vendored"], optional = true } +openssl-probe = { version = "0.1", optional = true } +pyo3 = { version = ">=0.19.2", features = ["extension-module"] } +regex = "1.10.2" +reqwest = { version = "0.11", features = ["blocking", "json"] } +semver = "1.0.20" +serde = { version = "1.0.193", features = ["derive"] } +serde-xml-rs = "0.6.0" +serde_json = "1.0.108" +which = "5.0.0" + +[dev-dependencies] +tempfile = "3.8.1" + +[features] +openssl-vendored = ["dep:openssl", "dep:openssl-probe"] + +[package.metadata.scripts] +run = "cargo run" +check = "cargo check" +build = "cargo build" +release = "cargo build --release" diff --git a/README.md b/README.md index a3c7629..e13453f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,35 @@ -# cpp_linter_rs +# C/C++ Linting Package -A port of the python package `cpp-linter` to rust. +A Python and Rust package for linting C/C++ code with clang-tidy and/or clang-format to collect feedback provided in the form of thread comments, step summary, or file annotations. -> [!CAUTION] -> This project is still experimental and subject to drastic changes. -> Please use the pure python [cpp-linter](https://github.com/cpp-linter/cpp-linter) -> package until this project is ready for deployment. +## Usage + +For usage in a CI workflow, see [the cpp-linter/cpp-linter-action repository](https://github.com/cpp-linter/cpp-linter-action). + +For the description of supported Command Line Interface options, see [the CLI documentation](https://cpp-linter.github.io/cpp-linter/cli_args.html). + +## Have question or feedback? + +To provide feedback (requesting a feature or reporting a bug) please post to [issues](https://github.com/cpp-linter/cpp-linter/issues). + +## License + +The scripts and documentation in this project are released under the [MIT][MIT]. + +Dependencies (that are redistributed by us in binary form) have the following license agreements: + +- [clap](https://crates.io/crates/clap): Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT]. +- [git2](https://crates.io/crates/git2): Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT]. +- [lenient_semver](https://crates.io/crates/lenient_semver): Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT]. +- [log](https://crates.io/crates/log): Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT]. +- [pyo3](https://crates.io/crates/pyo3): Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT]. +- [regex](https://crates.io/crates/regex): Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT]. +- [reqwest](https://crates.io/crates/reqwest): Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT]. +- [semver](https://crates.io/crates/semver): Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT]. +- [serde](https://crates.io/crates/serde): Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT]. +- [serde-xml-rs](https://crates.io/crates/serde-xml-rs): Licensed under [MIT][MIT]. +- [serde_json](https://crates.io/crates/serde_json): Dual-licensed under [Apache 2.0][Apache2] or [MIT][MIT]. +- [which](https://crates.io/crates/which): Licensed under [MIT][MIT]. + +[MIT]: https://choosealicense.com/licenses/mit +[Apache2]: https://github.com/clap-rs/clap/blob/HEAD/LICENSE-APACHE diff --git a/cpp_linter/__init__.py b/cpp_linter/__init__.py new file mode 100644 index 0000000..271a0b3 --- /dev/null +++ b/cpp_linter/__init__.py @@ -0,0 +1,7 @@ +# type: ignore +# ruff: noqa: F405 F403 +from .cpp_linter import * # + +__doc__ = cpp_linter.__doc__ +if hasattr(cpp_linter, "__all__"): + __all__ = cpp_linter.__all__ diff --git a/cpp_linter/entry_point.py b/cpp_linter/entry_point.py new file mode 100644 index 0000000..faf01fe --- /dev/null +++ b/cpp_linter/entry_point.py @@ -0,0 +1,28 @@ +""" +This module is the python frontend of the cpp-linter package written in Rust. +It exposes a single function: `main()`. + +The idea here is that all functionality is implemented in Rust. However, passing +command line arguments is done differently in Python or Rust. + +- In python, the ``sys.argv`` list is passed from the ``cpp_linter.entry_point.main()`` + function to rust via the ``cpp_linter.run.main()`` binding. +- In rust, the ``std::env::args`` is passed to ``run::main()`` in the binary driver + source `bin.rs`. + +This is done because of the way the python entry point is invoked. If ``std::env::args`` +is used instead of python's ``sys.argv``, then the list of strings includes the entry +point alias ("path/to/cpp-linter.exe"). Thus, the parser in `cli.rs` will halt on an +error because it is not configured to handle positional arguments. +""" +import sys + +# Using relative import to load binary lib with same name as root package. +# This is just how pyo3 builds python bindings from rust. +from .cpp_linter import run + + +def main(): + """The main entrypoint for the python frontend. See our rust docs for more info on + the backend (implemented in rust)""" + sys.exit(run.main(sys.argv)) diff --git a/docs/_static/extra_css.css b/docs/_static/extra_css.css new file mode 100644 index 0000000..9a20a75 --- /dev/null +++ b/docs/_static/extra_css.css @@ -0,0 +1,11 @@ +tbody .stub, +thead { + background-color: var(--md-accent-bg-color--light); + color: var(--md-default-bg-color); +} + +.md-header, +.md-tabs, +.md-nav--primary .md-nav__title[for="__drawer"] { + background-color: #4051b5; +} diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico new file mode 100644 index 0000000..c5de55c Binary files /dev/null and b/docs/_static/favicon.ico differ diff --git a/docs/_static/logo.png b/docs/_static/logo.png new file mode 100644 index 0000000..9c3e4db Binary files /dev/null and b/docs/_static/logo.png differ diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..3293f33 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,85 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html +from pathlib import Path +import subprocess +from sphinx.application import Sphinx + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "cpp-linter" +copyright = "2023, Brendan Doherty" +author = "Brendan Doherty" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = [ + "sphinx_immaterial", +] + +templates_path = ["_templates"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "sphinx_immaterial" +html_static_path = ["_static"] +html_logo = "_static/logo.png" +html_favicon = "_static/favicon.ico" +html_css_files = ["extra_css.css"] +html_title = "cpp-linter" + +html_theme_options = { + "repo_url": "https://github.com/2bndy5/cpp_linter_rs", + "repo_name": "cpp_linter_rs", + "palette": [ + { + "media": "(prefers-color-scheme: light)", + "scheme": "default", + "primary": "light-blue", + "accent": "deep-purple", + "toggle": { + "icon": "material/lightbulb-outline", + "name": "Switch to dark mode", + }, + }, + { + "media": "(prefers-color-scheme: dark)", + "scheme": "slate", + "primary": "light-blue", + "accent": "deep-purple", + "toggle": { + "icon": "material/lightbulb", + "name": "Switch to light mode", + }, + }, + ], + "features": [ + "navigation.top", + "navigation.tabs", + "navigation.tabs.sticky", + "toc.sticky", + "toc.follow", + "search.share", + ], +} +object_description_options = [ + ("std:option", dict(include_fields_in_toc=False)), +] + +# -- Parse CLI args from `-h` output ------------------------------------- + + +def setup(app: Sphinx): + """Generate a doc from the executable script's ``--help`` output.""" + + subprocess.run( + ["cargo", "run", "--example", "cli_doc"], + check=True, + cwd=str(Path(__file__).parent.parent), + ) diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..632a6fe --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,48 @@ +C/C++ Linting Package +===================== + +.. image:: https://img.shields.io/github/v/release/cpp-linter/cpp-linter + :alt: Latest Version + :target: https://github.com/cpp-linter/cpp-linter/releases +.. image:: https://img.shields.io/github/license/cpp-linter/cpp-linter?label=license&logo=github + :alt: License + :target: https://github.com/cpp-linter/cpp-linter/blob/main/LICENSE +.. image:: https://codecov.io/gh/cpp-linter/cpp-linter/branch/main/graph/badge.svg?token=0814O9WHQU + :alt: CodeCov + :target: https://codecov.io/gh/cpp-linter/cpp-linter +.. image:: https://github.com/cpp-linter/cpp-linter/actions/workflows/build-docs.yml/badge.svg + :alt: Docs + :target: https://cpp-linter.github.io/cpp-linter +.. image:: https://img.shields.io/pypi/dw/cpp-linter?color=dark-green&label=PyPI%20Downloads&logo=python&logoColor=white + :target: https://pepy.tech/project/cpp-linter + :alt: PyPI - Downloads + +A Python package for linting C/C++ code with clang-tidy and/or clang-format to collect feedback provided in the form of thread comments and/or file annotations. + +Usage +----- + +For usage in a CI workflow, see `the cpp-linter/cpp-linter-action repository `_ + +For the description of supported Command Line Interface options, see `the CLI documentation `_ + +Have question or feedback? +-------------------------- + +To provide feedback (requesting a feature or reporting a bug) please post to `issues `_. + +License +------- + +The scripts and documentation in this project are released under the `MIT License `_. + +.. toctree:: + :maxdepth: 2 + :hidden: + + self + +.. toctree:: + :hidden: + + cli_args diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..d078f24 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1 @@ +sphinx-immaterial diff --git a/examples/cli_doc.rs b/examples/cli_doc.rs new file mode 100644 index 0000000..0d47b13 --- /dev/null +++ b/examples/cli_doc.rs @@ -0,0 +1,43 @@ +use std::{fs::OpenOptions, io::Write}; + +use cpp_linter::cli; + +pub fn main() -> std::io::Result<()> { + let command = cli::get_arg_parser(); + let doc_file = OpenOptions::new() + .truncate(true) + .create(true) + .write(true) + .open("docs/cli_args.rst")?; + let title = "Command Line Interface Options".to_string(); + writeln!(&doc_file, "{}", &title)?; + for _ in title.chars() { + write!(&doc_file, "=")?; + } + write!(&doc_file, "\n\n")?; + for arg in command.get_arguments() { + writeln!( + &doc_file, + ".. std:option:: -{}, --{}\n", + &arg.get_short().unwrap(), + &arg.get_long().unwrap() + )?; + for line in arg.get_long_help().unwrap().to_string().split('\n') { + writeln!(&doc_file, " {}", &line)?; + } + writeln!(&doc_file)?; + let default = arg.get_default_values(); + if !default.is_empty() { + writeln!(&doc_file, " :Default:")?; + if default.len() < 2 { + writeln!(&doc_file, " ``{:?}``", default.first().unwrap())?; + } else { + for val in default { + writeln!(&doc_file, " - ``{:?}``", val)?; + } + } + } + } + println!("docs/cli_args.rst generated!"); + Ok(()) +} diff --git a/examples/diff.rs b/examples/diff.rs new file mode 100644 index 0000000..f1de833 --- /dev/null +++ b/examples/diff.rs @@ -0,0 +1,27 @@ +use cpp_linter::{ + cli::parse_ignore, + git::{get_diff, open_repo, parse_diff}, +}; +use std::error::Error; + +/// An example to show the file names of the diff for either +/// +/// - only last commit +/// - only staged files +pub fn main() -> Result<(), Box> { + let repo = open_repo(".")?; + let diff = get_diff(&repo); + + let extensions = vec!["cpp", "hpp", "rs"]; + let (ignored, not_ignored) = parse_ignore(&Vec::from_iter(["target", ".github"])); + let files = parse_diff(&diff, &extensions, &ignored, ¬_ignored); + + for file in &files { + println!("{}", file.name.to_string_lossy()); + println!("lines with additions: {:?}", file.added_lines); + println!("ranges of added lines: {:?}", file.added_ranges); + println!("ranges of diff hunks: {:?}", file.diff_chunks); + } + println!("found {} files in diff", files.len()); + Ok(()) +} diff --git a/examples/gh_rest_api.rs b/examples/gh_rest_api.rs new file mode 100644 index 0000000..2240e49 --- /dev/null +++ b/examples/gh_rest_api.rs @@ -0,0 +1,29 @@ +use std::env; +use std::error::Error; + +use cpp_linter::cli::parse_ignore; +use cpp_linter::github_api::GithubApiClient; + +// needed to use trait implementations (ie `get_list_of_changed_files()`) +use cpp_linter::rest_api::RestApiClient; + +pub fn main() -> Result<(), Box> { + env::set_var("GITHUB_SHA", "950ff0b690e1903797c303c5fc8d9f3b52f1d3c5"); + env::set_var("GITHUB_REPOSITORY", "cpp-linter/cpp-linter"); + let client_controller = GithubApiClient::new(); + + let extensions = vec!["cpp", "hpp"]; + let (ignored, not_ignored) = parse_ignore(&Vec::from_iter(["target", ".github"])); + + env::set_var("CI", "true"); // needed for get_list_of_changed_files() to use REST API + let files = client_controller.get_list_of_changed_files(&extensions, &ignored, ¬_ignored); + + for file in &files { + println!("{}", file.name.to_string_lossy()); + println!("lines with additions: {:?}", file.added_lines); + println!("ranges of added lines: {:?}", file.added_ranges); + println!("ranges of diff hunks: {:?}", file.diff_chunks); + } + println!("found {} files in diff", files.len()); + Ok(()) +} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3be7fe2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,103 @@ +[build-system] +requires = ["maturin>=1.2,<2.0"] +build-backend = "maturin" + +[project] +name = "cpp-linter" +description = "Run clang-format and clang-tidy on a batch of files." +readme = "README.md" +keywords = ["clang", "clang-tools", "linter", "clang-tidy", "clang-format"] +license = {text = "MIT License"} +requires-python = ">=3.7" +authors = [ + { name = "Brendan Doherty", email = "2bndy5@gmail.com" }, + { name = "Peter Shen", email = "xianpeng.shen@gmail.com" }, +] +dependencies = [ + "requests", + "pyyaml", + "pygit2", +] +classifiers = [ + # https://pypi.org/pypi?%3Aaction=list_classifiers + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: MIT License", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + "Natural Language :: English", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Operating System :: MacOS", + "Programming Language :: Python :: 3", + "Topic :: Software Development :: Build Tools", + "Programming Language :: Rust", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] +dynamic = ["version"] + +[project.scripts] +cpp-linter = "cpp_linter.entry_point:main" + +[project.urls] +source = "https://github.com/cpp-linter/cpp-linter" +tracker = "https://github.com/cpp-linter/cpp-linter/issues" + +# ... other project metadata fields as specified in: +# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/ + +[tool.setuptools] +zip-safe = false +packages = ["cpp_linter"] + +[tool.maturin] +features = ["pyo3/extension-module"] + +[tool.setuptools_scm] +# It would be nice to include the commit hash in the version, but that +# can't be done in a PEP 440-compatible way. +version_scheme= "no-guess-dev" +# Test PyPI does not support local versions. +local_scheme = "no-local-version" +fallback_version = "0.0.0" + +[tool.mypy] +show_error_codes = true +show_column_numbers = true + +[tool.pytest.ini_options] +minversion = "6.0" +addopts = "-vv" +testpaths = ["tests"] + +[tool.coverage] +[tool.coverage.run] +dynamic_context = "test_function" +omit = [ + # don't include tests in coverage + "tests/*", +] + +[tool.coverage.json] +pretty_print = true + +[tool.coverage.html] +show_contexts = true + +[tool.coverage.report] +# Regexes for lines to exclude from consideration +exclude_lines = [ + # Have to re-enable the standard pragma + "pragma: no cover", + # Don\'t complain about missing debug-only code: + "def __repr__", + # the point of unit tests is to test parts of main() + "def main", + # ignore any branch that makes the module executable + 'if __name__ == "__main__"', + # ignore branches specific to type checking + "if TYPE_CHECKING", + # ignore the local secific debug statement related to not having rich installed + "if not FOUND_RICH_LIB", +] diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..46a89df --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,2 @@ +maturin +pre-commit diff --git a/src/bin.rs b/src/bin.rs new file mode 100644 index 0000000..390a2f1 --- /dev/null +++ b/src/bin.rs @@ -0,0 +1,14 @@ +//! This is the cpp_linter package's primary binary executable's source code. +//! +//! Notice how similar this is compared to the python binding's +//! cpp_linter/entry_point.py script. + +use std::env; + +// project specific modules/crates +use cpp_linter::run::main as run_main; + +/// This takes the CLI arguments and passes them to [`cpp_linter::run::main`]. +pub fn main() { + run_main(env::args().collect::>()); +} diff --git a/src/clang_tools/clang_format.rs b/src/clang_tools/clang_format.rs new file mode 100644 index 0000000..cf1b218 --- /dev/null +++ b/src/clang_tools/clang_format.rs @@ -0,0 +1,169 @@ +//! This module holds functionality specific to running clang-format and parsing it's +//! output. + +use std::process::Command; + +// non-std crates +use serde::Deserialize; +use serde_xml_rs::de::Deserializer; + +// project-specific crates/modules +use crate::common_fs::{get_line_cols_from_offset, FileObj}; + +/// A Structure used to deserialize clang-format's XML output. +#[derive(Debug, Deserialize, PartialEq)] +#[serde(rename = "replacements")] +pub struct FormatAdvice { + /// A list of [`Replacement`]s that clang-tidy wants to make. + #[serde(rename = "$value")] + pub replacements: Vec, +} + +/// A single replacement that clang-format wants to make. +#[derive(Debug, Deserialize, PartialEq)] +pub struct Replacement { + /// The byte offset where the replacement will start. + pub offset: usize, + + /// The amount of bytes that will be removed. + pub length: usize, + + /// The bytes (UTF-8 encoded) that will be added at the [`Replacement::offset`] position. + #[serde(rename = "$value")] + pub value: Option, + + /// The line number described by the [`Replacement::offset`]. + /// + /// This value is not provided by the XML output, but we calculate it after + /// deserialization. + pub line: Option, + + /// The column number on the line described by the [`Replacement::offset`]. + /// + /// This value is not provided by the XML output, but we calculate it after + /// deserialization. + pub cols: Option, +} + +/// Run clang-tidy for a specific `file`, then parse and return it's XML output. +pub fn run_clang_format( + cmd: &mut Command, + file: &FileObj, + style: &str, + lines_changed_only: u8, +) -> FormatAdvice { + cmd.args(["--style", style, "--output-replacements-xml"]); + if lines_changed_only > 0 { + let ranges = if lines_changed_only == 2 { + &file.diff_chunks + } else { + &file.added_ranges + }; + for range in ranges { + cmd.arg(format!("--lines={}:{}", range.start(), range.end())); + } + } + cmd.arg(file.name.to_string_lossy().as_ref()); + log::info!( + "Running \"{} {}\"", + cmd.get_program().to_string_lossy(), + cmd.get_args() + .map(|x| x.to_str().unwrap()) + .collect::>() + .join(" ") + ); + let output = cmd.output().unwrap(); + if !output.stderr.is_empty() || !output.status.success() { + log::debug!( + "clang-format raised the follow errors:\n{}", + String::from_utf8(output.stderr).unwrap() + ); + } + // log::debug!( + // "clang-format XML output:\n{}", + // String::from_utf8(output.stdout.clone()).unwrap() + // ); + let xml = String::from_utf8(output.stdout) + .unwrap() + .lines() + .collect::>() + .join(""); + let config = serde_xml_rs::ParserConfig::new() + .trim_whitespace(false) + .whitespace_to_characters(true) + .ignore_root_level_whitespace(true); + let event_reader = serde_xml_rs::EventReader::new_with_config(xml.as_bytes(), config); + let mut format_advice: FormatAdvice = + FormatAdvice::deserialize(&mut Deserializer::new(event_reader)).unwrap_or(FormatAdvice { + replacements: vec![], + }); + if !format_advice.replacements.is_empty() { + for replacement in &mut format_advice.replacements { + let (line_number, columns) = get_line_cols_from_offset(&file.name, replacement.offset); + replacement.line = Some(line_number); + replacement.cols = Some(columns); + } + } + format_advice +} + +#[cfg(test)] +mod tests { + use super::{FormatAdvice, Replacement}; + use serde::Deserialize; + + #[test] + fn parse_xml() { + let xml_raw = r#" + + + + + +"#; + //since whitespace is part of the elements' body, we need to remove the LFs first + let xml = xml_raw.lines().collect::>().join(""); + + let expected = FormatAdvice { + replacements: vec![ + Replacement { + offset: 113, + length: 5, + value: Some(String::from("\n ")), + line: None, + cols: None, + }, + Replacement { + offset: 147, + length: 0, + value: Some(String::from(" ")), + line: None, + cols: None, + }, + Replacement { + offset: 161, + length: 0, + value: None, + line: None, + cols: None, + }, + Replacement { + offset: 165, + length: 19, + value: Some(String::from("\n\n")), + line: None, + cols: None, + }, + ], + }; + let config = serde_xml_rs::ParserConfig::new() + .trim_whitespace(false) + .whitespace_to_characters(true) + .ignore_root_level_whitespace(true); + let event_reader = serde_xml_rs::EventReader::new_with_config(xml.as_bytes(), config); + let document = + FormatAdvice::deserialize(&mut serde_xml_rs::de::Deserializer::new(event_reader)) + .unwrap(); + assert_eq!(expected, document); + } +} diff --git a/src/clang_tools/clang_tidy.rs b/src/clang_tools/clang_tidy.rs new file mode 100644 index 0000000..9d1c6ea --- /dev/null +++ b/src/clang_tools/clang_tidy.rs @@ -0,0 +1,239 @@ +//! This module holds functionality specific to running clang-tidy and parsing it's +//! output. + +use std::{ + env::{consts::OS, current_dir}, + fs, + path::PathBuf, + process::Command, +}; + +// non-std crates +use regex::Regex; +use serde::Deserialize; + +// project-specific modules/crates +use crate::common_fs::{normalize_path, FileObj}; + +/// Used to deserialize a JSON compilation database +#[derive(Deserialize, Debug)] +pub struct CompilationDatabase { + /// A list of [`CompilationUnit`] + units: Vec, +} + +/// Used to deserialize a json compilation database's translation unit. +/// +/// The only purpose this serves is to normalize relative paths for build systems that +/// use/need relative paths (ie ninja). +#[derive(Deserialize, Debug)] +struct CompilationUnit { + /// The directory of the build environment + directory: String, + + /// The file path of the translation unit. + /// + /// Sometimes, this is relative to the build [`CompilationUnit::directory`]. + /// + /// This is typically the path that clang-tidy uses in its stdout (for a dry run). + /// So, having this information helps with matching clang-tidy's stdout with the + /// repository files. + file: String, +} + +/// A structure that represents a single notification parsed from clang-tidy's stdout. +pub struct TidyNotification { + /// The file's path and name (supposedly relative to the repository root folder). + pub filename: String, + + /// The line number from which the notification originated. + pub line: u32, + + /// The column offset on the line from which the notification originated. + pub cols: u32, + + /// The severity (ie error/warning/note) of the [`TidyNotification::diagnostic`] + /// that caused the notification. + pub severity: String, + + /// A helpful message explaining why the notification exists. + pub rationale: String, + + /// The diagnostic name as used when configuring clang-tidy. + pub diagnostic: String, + + /// A code block that points directly to the origin of the notification. + /// + /// Sometimes, this code block doesn't exist. Sometimes, it contains suggested + /// fixes/advice. This information is purely superfluous. + pub suggestion: Vec, +} + +/// Parses clang-tidy stdout. +/// +/// Here it helps to have the JSON database deserialized for normalizing paths present +/// in the notifications. +fn parse_tidy_output( + tidy_stdout: &[u8], + database_json: &Option, +) -> Vec { + let note_header = Regex::new(r"^(.+):(\d+):(\d+):\s(\w+):(.*)\[([a-zA-Z\d\-\.]+)\]$").unwrap(); + let mut notification = None; + let mut result = Vec::new(); + for line in String::from_utf8(tidy_stdout.to_vec()).unwrap().lines() { + if let Some(captured) = note_header.captures(line) { + if let Some(note) = notification { + result.push(note); + } + + // normalize the filename path and try to make it relative to the repo root + let mut filename = PathBuf::from(&captured[1]); + if filename.is_relative() { + // if database was given try to use that first + if let Some(db_json) = &database_json { + let mut found_unit = false; + for unit in &db_json.units { + if unit.file == captured[0] { + filename = + normalize_path(&PathBuf::from_iter([&unit.directory, &unit.file])); + found_unit = true; + break; + } + } + if !found_unit { + // file was not a named unit in the database; + // try to normalize path as if relative to working directory. + // NOTE: This shouldn't happen with a properly formed JSON database + filename = normalize_path(&PathBuf::from_iter([ + ¤t_dir().unwrap(), + &filename, + ])); + } + } else { + // still need to normalize the relative path despite missing database info. + // let's assume the file is relative to current working directory. + filename = + normalize_path(&PathBuf::from_iter([¤t_dir().unwrap(), &filename])); + } + } + assert!(filename.is_absolute()); + if filename.is_absolute() { + filename = filename + .strip_prefix(current_dir().unwrap()) + .expect("cannot determine filename by relative path.") + .to_path_buf(); + } + + notification = Some(TidyNotification { + filename: filename.to_string_lossy().to_string().replace('\\', "/"), + line: captured[2].parse::().unwrap(), + cols: captured[3].parse::().unwrap(), + severity: String::from(&captured[4]), + rationale: String::from(&captured[5]), + diagnostic: String::from(&captured[6]), + suggestion: Vec::new(), + }); + } else if let Some(note) = &mut notification { + // append lines of code that are part of + // the previous line's notification + note.suggestion.push(line.to_string()); + } + } + if let Some(note) = notification { + result.push(note); + } + result +} + +#[cfg(test)] +mod test { + #[test] + fn test_capture() { + let src = "tests/demo/demo.hpp:11:11: warning: use a trailing return type for this function [modernize-use-trailing-return-type]"; + let pat = + regex::Regex::new(r"^(.+):(\d+):(\d+):\s(\w+):(.*)\[([a-zA-Z\d\-\.]+)\]$").unwrap(); + let cap = pat.captures(src).unwrap(); + assert_eq!( + cap.get(0).unwrap().as_str(), + format!( + "{}:{}:{}: {}:{}[{}]", + cap.get(1).unwrap().as_str(), + cap.get(2).unwrap().as_str(), + cap.get(3).unwrap().as_str(), + cap.get(4).unwrap().as_str(), + cap.get(5).unwrap().as_str(), + cap.get(6).unwrap().as_str() + ) + .as_str() + ) + } +} + +/// Run clang-tidy, then parse and return it's output. +pub fn run_clang_tidy( + cmd: &mut Command, + file: &FileObj, + checks: &str, + lines_changed_only: u8, + database: &Option, + extra_args: &Option>, + database_json: &Option, +) -> Vec { + let tidy_yml_output_cache = PathBuf::from(".cpp_linter_cache/clang_tidy_output.yml"); + if !tidy_yml_output_cache.parent().unwrap().exists() { + fs::create_dir_all(tidy_yml_output_cache.parent().unwrap()).unwrap(); + } + fs::write(&tidy_yml_output_cache, b"").unwrap(); + cmd.args(["--export-fixes", &tidy_yml_output_cache.to_string_lossy()]); + if !checks.is_empty() { + cmd.args(["-checks", checks]); + } + if let Some(db) = database { + cmd.args(["-p", &db.to_string_lossy()]); + } + if let Some(extras) = extra_args { + for arg in extras { + cmd.args(["--extra-arg", format!("\"{}\"", arg).as_str()]); + } + } + if lines_changed_only > 0 { + let ranges = if lines_changed_only == 2 { + &file.diff_chunks + } else { + &file.added_ranges + }; + let filter = format!( + "[{{\"name\":{:?},\"lines\":{:?}}}]", + &file + .name + .to_string_lossy() + .replace('/', if OS == "windows" { "\\" } else { "/" }), + ranges + .iter() + .map(|r| [r.start(), r.end()]) + .collect::>() + ); + cmd.args(["--line-filter", filter.as_str()]); + } + cmd.arg(file.name.to_string_lossy().as_ref()); + log::info!( + "Running \"{} {}\"", + cmd.get_program().to_string_lossy(), + cmd.get_args() + .map(|x| x.to_str().unwrap()) + .collect::>() + .join(" ") + ); + let output = cmd.output().unwrap(); + log::debug!( + "Output from clang-tidy:\n{}", + String::from_utf8(output.stdout.to_vec()).unwrap() + ); + if !output.stderr.is_empty() { + log::debug!( + "clang-tidy made the following summary:\n{}", + String::from_utf8(output.stderr).unwrap() + ); + } + parse_tidy_output(&output.stdout, database_json) +} diff --git a/src/clang_tools/mod.rs b/src/clang_tools/mod.rs new file mode 100644 index 0000000..c44adba --- /dev/null +++ b/src/clang_tools/mod.rs @@ -0,0 +1,207 @@ +//! This crate holds the functionality related to running clang-format and/or +//! clang-tidy. + +use std::{env::current_dir, fs, path::PathBuf, process::Command}; + +// non-std crates +use lenient_semver; +use semver::Version; +use which::{which, which_in}; + +// project-specific modules/crates +use super::common_fs::FileObj; +use crate::logger::{end_log_group, start_log_group}; +pub mod clang_format; +use clang_format::{run_clang_format, FormatAdvice}; +pub mod clang_tidy; +use clang_tidy::{run_clang_tidy, CompilationDatabase, TidyNotification}; + +/// Fetch the path to a clang tool by `name` (ie `"clang-tidy"` or `"clang-format"`) and +/// `version`. +/// +/// The specified `version` can be either +/// +/// - a full or partial semantic version specification +/// - a path to a directory containing the executable binary `name`d +/// +/// If the executable is not found using the specified `version`, then the tool is +/// sought only by it's `name`. +/// +/// The only reason this function would return an error is if the specified tool is not +/// installed or present on the system (nor in the `$PATH` environment variable). +pub fn get_clang_tool_exe(name: &str, version: &str) -> Result { + if version.is_empty() { + // The default CLI value is an empty string. + // Thus, we should use whatever is installed and added to $PATH. + if let Ok(cmd) = which(name) { + return Ok(cmd); + } else { + return Err("Could not find clang tool by name"); + } + } + if let Ok(semver) = lenient_semver::parse_into::(version) { + // `version` specified has at least a major version number + if let Ok(cmd) = which(format!("{}-{}", name, semver.major)) { + Ok(cmd) + } else if let Ok(cmd) = which(name) { + // USERS SHOULD MAKE SURE THE PROPER VERSION IS INSTALLED BEFORE USING CPP-LINTER!!! + // This block essentially ignores the version specified as a fail-safe. + // + // On Windows, the version's major number is typically not appended to the name of + // the executable (or symlink for executable), so this is useful in that scenario. + // On Unix systems, this block is not likely reached. Typically, installing clang + // will produce a symlink to the executable with the major version appended to the + // name. + return Ok(cmd); + } else { + return Err("Could not find clang tool by name and version"); + } + } else { + // `version` specified is not a semantic version; treat as path/to/bin + if let Ok(exe_path) = which_in(name, Some(version), current_dir().unwrap()) { + Ok(exe_path) + } else { + Err("Could not find clang tool by path") + } + } +} + +/// Runs clang-tidy and/or clang-format and returns the parsed output from each. +/// +/// The returned list of [`FormatAdvice`] is parallel to the `files` list passed in +/// here. The returned 2D list of [`TidyNotification`] is also parallel on the first +/// dimension. The second dimension is a list of notes specific to a translation unit +/// (each element of `files`). +/// +/// If `tidy_checks` is `"-*"` then clang-tidy is not executed. +/// If `style` is a blank string (`""`), then clang-format is not executed. +pub fn capture_clang_tools_output( + files: &Vec, + version: &str, + tidy_checks: &str, + style: &str, + lines_changed_only: u8, + database: Option, + extra_args: Option>, +) -> (Vec, Vec>) { + // find the executable paths for clang-tidy and/or clang-format and show version + // info as debugging output. + let clang_tidy_command = if tidy_checks != "-*" { + let cmd = get_clang_tool_exe("clang-tidy", version).unwrap(); + log::debug!( + "{} --version\n{}", + &cmd.to_string_lossy(), + String::from_utf8_lossy(&Command::new(&cmd).arg("--version").output().unwrap().stdout) + ); + Some(cmd) + } else { + None + }; + let clang_format_command = if !style.is_empty() { + let cmd = get_clang_tool_exe("clang-format", version).unwrap(); + log::debug!( + "{} --version\n{}", + &cmd.to_string_lossy(), + String::from_utf8_lossy(&Command::new(&cmd).arg("--version").output().unwrap().stdout) + ); + Some(cmd) + } else { + None + }; + + // parse database (if provided) to match filenames when parsing clang-tidy's stdout + let database_json: Option = if let Some(db_path) = &database { + if let Ok(db_str) = fs::read(db_path) { + Some( + serde_json::from_str::( + String::from_utf8(db_str).unwrap().as_str(), + ) + .unwrap(), + ) + } else { + None + } + } else { + None + }; + + // iterate over the discovered files and run the clang tools + let mut all_format_advice: Vec = Vec::with_capacity(files.len()); + let mut all_tidy_advice: Vec> = + Vec::with_capacity(files.len()); + for file in files { + start_log_group(format!("Analyzing {}", file.name.to_string_lossy())); + if let Some(tidy_cmd) = &clang_tidy_command { + all_tidy_advice.push(run_clang_tidy( + &mut Command::new(tidy_cmd), + file, + tidy_checks, + lines_changed_only, + &database, + &extra_args, + &database_json, + )); + } + if let Some(format_cmd) = &clang_format_command { + all_format_advice.push(run_clang_format( + &mut Command::new(format_cmd), + file, + style, + lines_changed_only, + )); + } + end_log_group(); + } + (all_format_advice, all_tidy_advice) +} + +#[cfg(test)] +mod tests { + use std::env; + + use super::get_clang_tool_exe; + + const TOOL_NAME: &str = "clang-format"; + + #[test] + fn get_exe_by_version() { + let clang_version = env::var("CLANG_VERSION").unwrap_or("16".to_string()); + let tool_exe = get_clang_tool_exe(TOOL_NAME, clang_version.as_str()); + println!("tool_exe: {:?}", tool_exe); + assert!(tool_exe.is_ok_and(|val| val + .file_name() + .unwrap() + .to_string_lossy() + .to_string() + .contains(TOOL_NAME))); + } + + #[test] + fn get_exe_by_default() { + let tool_exe = get_clang_tool_exe(TOOL_NAME, ""); + println!("tool_exe: {:?}", tool_exe); + assert!(tool_exe.is_ok_and(|val| val + .file_name() + .unwrap() + .to_string_lossy() + .to_string() + .contains(TOOL_NAME))); + } + + use which::which; + + #[test] + fn get_exe_by_path() { + let clang_version = which(TOOL_NAME).unwrap(); + let bin_path = clang_version.parent().unwrap().to_str().unwrap(); + println!("binary exe path: {bin_path}"); + let tool_exe = get_clang_tool_exe(TOOL_NAME, bin_path); + println!("tool_exe: {:?}", tool_exe); + assert!(tool_exe.is_ok_and(|val| val + .file_name() + .unwrap() + .to_string_lossy() + .to_string() + .contains(TOOL_NAME))); + } +} diff --git a/src/cli.rs b/src/cli.rs new file mode 100644 index 0000000..91ba685 --- /dev/null +++ b/src/cli.rs @@ -0,0 +1,325 @@ +//! This module holds the Command Line Interface design. + +use std::fs; + +// non-std crates +use clap::builder::FalseyValueParser; +use clap::{Arg, ArgAction, Command}; + +/// Builds and returns the Command Line Interface's argument parsing object. +pub fn get_arg_parser() -> Command { + Command::new("cpp-linter") + .arg( + Arg::new("verbosity") + .long("verbosity") + .short('v') + .default_value("info") + .value_parser(["debug", "info"]) + .long_help( + "This controls the action's verbosity in the workflow's logs. +Supported options are defined by the `logging-level `_. +This option does not affect the verbosity of resulting +thread comments or file annotations. +", + ), + ) + .arg( + Arg::new("database") + .long("database") + .short('p') + .long_help( + "The path that is used to read a compile command database. +For example, it can be a CMake build directory in which a file named +compile_commands.json exists (set ``CMAKE_EXPORT_COMPILE_COMMANDS`` to ``ON``). +When no build path is specified, a search for compile_commands.json will be +attempted through all parent paths of the first input file. See +https://clang.llvm.org/docs/HowToSetupToolingForLLVM.html for an +example of setting up Clang Tooling on a source tree.", + )) + .arg( + Arg::new("style") + .short('s') + .long("style") + .default_value("llvm") + .long_help( + "The style rules to use. + +- Set this to ``file`` to have clang-format use the closest relative + .clang-format file. +- Set this to a blank string (``''``) to disable using clang-format + entirely. +", + ), + ) + .arg( + Arg::new("tidy-checks") + .short('c') + .long("tidy-checks") + .default_value( + "boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-*,cppcoreguidelines-*", + ) + .long_help( + "A comma-separated list of globs with optional ``-`` prefix. +Globs are processed in order of appearance in the list. +Globs without ``-`` prefix add checks with matching names to the set, +globs with the ``-`` prefix remove checks with matching names from the set of +enabled checks. This option's value is appended to the value of the 'Checks' +option in a .clang-tidy file (if any). + +- It is possible to disable clang-tidy entirely by setting this option to + ``'-*'``. +- It is also possible to rely solely on a .clang-tidy config file by + specifying this option as a blank string (``''``). + +See also clang-tidy docs for more info. +", + ), + ) + .arg( + Arg::new("version") + .short('V') + .long("version") + .default_value("") + .long_help( + "The desired version of the clang tools to use. Accepted options are +strings which can be 8, 9, 10, 11, 12, 13, 14, 15, 16, 17. + +- Set this option to a blank string (``''``) to use the + platform's default installed version. +- This value can also be a path to where the clang tools are + installed (if using a custom install location). All paths specified + here are converted to absolute. +", + ), + ) + .arg( + Arg::new("extensions") + .short('e') + .long("extensions") + .value_delimiter(',') + .default_value("c,h,C,H,cpp,hpp,cc,hh,c++,h++,cxx,hxx") + .long_help("A comma-separated list of file extensions to analyze. +"), + ) + .arg( + Arg::new("repo-root") + .short('r') + .long("repo-root") + .default_value(".") + .long_help( + "The relative path to the repository root directory. This path is +relative to the runner's ``GITHUB_WORKSPACE`` environment variable (or +the current working directory if not using a CI runner). +", + ), + ) + .arg( + Arg::new("ignore") + .short('i') + .long("ignore") + .value_delimiter('|') + .default_value(".github|target") + .long_help( + "Set this option with path(s) to ignore (or not ignore). + +- In the case of multiple paths, you can use `|` to separate each path. +- There is no need to use ``./`` for each entry; a blank string (``''``) + represents the repo-root path. +- This can also have files, but the file's path (relative to + the :std:option:`--repo-root`) has to be specified with the filename. +- Submodules are automatically ignored. Hidden directories (beginning + with a ``.``) are also ignored automatically. +- Prefix a path with ``!`` to explicitly not ignore it. This can be + applied to a submodule's path (if desired) but not hidden directories. +- Glob patterns are not supported here. All asterisk characters (``*``) + are literal. +", + ), + ) + .arg( + Arg::new("lines-changed-only") + .short('l') + .long("lines-changed-only") + .value_parser(["true", "false", "diff"]) + .default_value("true") + .long_help( + "This controls what part of the files are analyzed. +The following values are accepted: + +- ``false``: All lines in a file are analyzed. +- ``true``: Only lines in the diff that contain additions are analyzed. +- ``diff``: All lines in the diff are analyzed (including unchanged + lines but not subtractions). +", + ), + ) + .arg( + Arg::new("files-changed-only") + .short('f') + .long("files-changed-only") + .default_value("false") + .value_parser(FalseyValueParser::new()) + .long_help( + "Set this option to false to analyze any source files in the repo. +This is automatically enabled if +:std:option:`--lines-changed-only` is enabled. + +.. note:: + The ``GITHUB_TOKEN`` should be supplied when running on a + private repository with this option enabled, otherwise the runner + does not not have the privilege to list the changed files for an event. + + See `Authenticating with the GITHUB_TOKEN + `_ +", + ), + ) + .arg( + Arg::new("extra-arg") + .long("extra-arg") + .short('x') + .action(ArgAction::Append) + .long_help( + "A string of extra arguments passed to clang-tidy for use as +compiler arguments. This can be specified more than once for each +additional argument. Recommend using quotes around the value and +avoid using spaces between name and value (use ``=`` instead): + +.. code-block:: shell + + cpp-linter --extra-arg=\"-std=c++17\" --extra-arg=\"-Wall\"", + ), + ) + .arg( + Arg::new("thread-comments") + .long("thread-comments") + .short('g') + .value_parser(["true", "false", "updated"]) + .default_value("false") + .long_help( + "Set this option to true to enable the use of thread comments as feedback. +Set this to ``update`` to update an existing comment if one exists; +the value 'true' will always delete an old comment and post a new one if necessary. + +.. note:: + To use thread comments, the ``GITHUB_TOKEN`` (provided by + Github to each repository) must be declared as an environment + variable. + + See `Authenticating with the GITHUB_TOKEN + `_ + +.. hint:: + If run on a private repository, then this feature is + disabled because the GitHub REST API behaves + differently for thread comments on a private repository. +", + ), + ) + .arg( + Arg::new("no-lgtm") + .long("no-lgtm") + .short('t') + .value_parser(FalseyValueParser::new()) + .default_value("true") + .long_help( + "Set this option to true or false to enable or disable the use of a +thread comment that basically says 'Looks Good To Me' (when all checks pass). + +.. seealso:: + The :std:option:`--thread-comments` option also notes further implications. +", + ), + ) + .arg( + Arg::new("step-summary") + .long("step-summary") + .short('w') + .value_parser(FalseyValueParser::new()) + .default_value("false") + .long_help( + "Set this option to true or false to enable or disable the use of +a workflow step summary when the run has concluded. +", + ), + ) + .arg( + Arg::new("file-annotations") + .long("file-annotations") + .short('a') + .value_parser(FalseyValueParser::new()) + .default_value("true") + .long_help( + "Set this option to false to disable the use of +file annotations as feedback. +", + ), + ) +} + +/// This will parse the list of paths specified from the CLI using the `--ignore` +/// argument. +/// +/// It returns 2 lists (in order): +/// +/// - `ignored` paths +/// - `not_ignored` paths +/// +/// This function will also read a .gitmodules file located in the working directory. +/// The named submodules' paths will be automatically added to the ignored list, +/// unless the submodule's path is already specified in the not_ignored list. +pub fn parse_ignore(ignore: &[&str]) -> (Vec, Vec) { + let mut ignored = vec![]; + let mut not_ignored = vec![]; + for pattern in ignore { + let as_posix = pattern.replace('\\', "/"); + let mut pat = as_posix.as_str(); + let is_ignored = !pat.starts_with('!'); + if !is_ignored { + pat = &pat[1..]; + } + if pat.starts_with("./") { + pat = &pat[2..]; + } + let is_hidden = pat.starts_with('.'); + if is_hidden || is_ignored { + ignored.push(format!("./{pat}")); + } else { + not_ignored.push(format!("./{pat}")); + } + } + + if let Ok(read_buf) = fs::read_to_string(".gitmodules") { + for line in read_buf.split('\n') { + if line.trim_start().starts_with("path") { + assert!(line.find('=').unwrap() > 0); + let submodule = String::from("./") + line.split('=').last().unwrap().trim(); + log::debug!("Found submodule: {submodule}"); + let mut is_ignored = true; + for pat in ¬_ignored { + if pat == &submodule { + is_ignored = false; + break; + } + } + if is_ignored && !ignored.contains(&submodule) { + ignored.push(submodule); + } + } + } + } + + if !ignored.is_empty() { + log::info!("Ignored:"); + for pattern in &ignored { + log::info!(" {pattern}"); + } + } + if !not_ignored.is_empty() { + log::info!("Not Ignored:"); + for pattern in ¬_ignored { + log::info!(" {pattern}"); + } + } + (ignored, not_ignored) +} diff --git a/src/common_fs.rs b/src/common_fs.rs new file mode 100644 index 0000000..4567de2 --- /dev/null +++ b/src/common_fs.rs @@ -0,0 +1,389 @@ +//! A module to hold all common file system functionality. + +use std::io::Read; +use std::path::{Component, Path}; +use std::{fs, io}; +use std::{ops::RangeInclusive, path::PathBuf}; + +/// A structure to represent a file's path and line changes. +#[derive(Debug)] +pub struct FileObj { + /// The path to the file. + pub name: PathBuf, + + /// The list of lines with additions. + pub added_lines: Vec, + + /// The list of ranges that span only lines with additions. + pub added_ranges: Vec>, + + /// The list of ranges that span the lines present in diff chunks. + pub diff_chunks: Vec>, +} + +impl FileObj { + /// Instantiate a rudimentary object with only file name information. + /// + /// To instantiate an object with line information, use [FileObj::from]. + pub fn new(name: PathBuf) -> Self { + FileObj { + name, + added_lines: Vec::::new(), + added_ranges: Vec::>::new(), + diff_chunks: Vec::>::new(), + } + } + + /// Instantiate an object with file name and changed lines information. + pub fn from( + name: PathBuf, + added_lines: Vec, + diff_chunks: Vec>, + ) -> Self { + let added_ranges = FileObj::consolidate_numbers_to_ranges(&added_lines); + FileObj { + name, + added_lines, + added_ranges, + diff_chunks, + } + } + + /// A helper function to consolidate a [Vec] of line numbers into a + /// [Vec>] in which each range describes the beginning and + /// ending of a group of consecutive line numbers. + fn consolidate_numbers_to_ranges(lines: &Vec) -> Vec> { + let mut range_start = None; + let mut ranges: Vec> = Vec::new(); + for (index, number) in lines.iter().enumerate() { + if index == 0 { + range_start = Some(*number); + } else if number - 1 != lines[index - 1] { + ranges.push(RangeInclusive::new(range_start.unwrap(), lines[index - 1])); + range_start = Some(*number); + } + if index == lines.len() - 1 { + ranges.push(RangeInclusive::new(range_start.unwrap(), *number)); + } + } + ranges + } +} + +/// Describes if a specified `file_name` is contained within the given `set` of paths. +/// +/// The `set` of paths is used as domains, so the specified `file_name` can be a direct +/// or distant descendant of any given paths in the `set`. +pub fn is_file_in_list(file_name: &Path, set: &[String], prompt: String) -> bool { + for pattern in set { + let pat = Path::new(pattern); + if pat.is_file() { + if file_name == pat { + log::debug!( + "{} is {prompt} as specified via {:?}", + file_name.to_string_lossy().replace('\\', "/"), + pat + ); + return true; + } + } else if pat.is_dir() && file_name.starts_with(pat) { + log::debug!( + "{} is {prompt} as specified in domain {:?}", + file_name.to_string_lossy().replace('\\', "/"), + pat + ); + return true; + } + // else file doesn't exist; return false + } + false +} + +/// A helper function that checks if `entry` satisfies the following conditions (in +/// ordered priority): +/// +/// - Does `entry`'s path use at least 1 of the listed file `extensions`? (takes +/// precedence) +/// - Is `entry` *not* specified in list of `ignored` paths? +/// - Is `entry` specified in the list of explicitly `not_ignored` paths? (supersedes +/// specified `ignored` paths) +pub fn is_source_or_ignored( + entry: &Path, + extensions: &[&str], + ignored: &[String], + not_ignored: &[String], +) -> bool { + let extension = entry.extension(); + if extension.is_none() { + return false; + } + let mut is_ignored = true; + for ext in extensions { + if ext == &extension.unwrap().to_os_string().into_string().unwrap() { + is_ignored = false; + break; + } + } + if !is_ignored { + log::debug!( + "{} is a source file", + entry.to_string_lossy().replace('\\', "/") + ); + let is_in_ignored = is_file_in_list(entry, ignored, String::from("ignored")); + let is_in_not_ignored = is_file_in_list(entry, not_ignored, String::from("not ignored")); + if !is_in_ignored || is_in_not_ignored { + return true; + } + } + false +} + +/// Walks a given `root_path` recursively and returns a [`Vec`] that +/// +/// - uses at least 1 of the `extensions` +/// - is not specified in the given list of `ignored` paths +/// - is specified in the given list `not_ignored` paths (which supersedes `ignored` paths) +pub fn list_source_files( + extensions: &[&str], + ignored: &[String], + not_ignored: &[String], + root_path: &str, +) -> Vec { + let mut files: Vec = Vec::new(); + let entries = fs::read_dir(root_path) + .expect("repo root-path should exist") + .map(|res| res.map(|e| e.path())) + .collect::, io::Error>>() + .unwrap(); + for entry in entries { + if entry.is_dir() { + let mut is_hidden = false; + let parent = entry.components().last().expect("parent not known"); + if parent.as_os_str().to_str().unwrap().starts_with('.') { + is_hidden = true; + } + if !is_hidden { + files.extend(list_source_files( + extensions, + ignored, + not_ignored, + &entry.into_os_string().into_string().unwrap(), + )); + } + } else { + let is_valid_src = is_source_or_ignored(&entry, extensions, ignored, not_ignored); + if is_valid_src { + files.push(FileObj::new( + entry.clone().strip_prefix("./").unwrap().to_path_buf(), + )); + } + } + } + files +} + +/// Gets the line and column number from a given `offset` (of bytes) for given +/// `file_path`. +/// +/// This computes the line and column numbers from a buffer of bytes read from the +/// `file_path`. In non-UTF-8 encoded files, this does not guarantee that a word +/// boundary exists at the returned column number. However, the `offset` given to this +/// function is expected to originate from diagnostic information provided by +/// clang-format or clang-tidy. +pub fn get_line_cols_from_offset(file_path: &PathBuf, offset: usize) -> (usize, usize) { + let mut file_buf = vec![0; offset]; + fs::File::open(file_path) + .unwrap() + .read_exact(&mut file_buf) + .unwrap(); + let lines = file_buf.split(|byte| byte == &b'\n'); + let line_count = lines.clone().count(); + let column_count = lines.last().unwrap_or(&[]).len() + 1; // +1 because not a 0 based count + (line_count, column_count) +} + +/// This was copied from [cargo source code](https://github.com/rust-lang/cargo/blob/fede83ccf973457de319ba6fa0e36ead454d2e20/src/cargo/util/paths.rs#L61). +/// +/// NOTE: Rust [std::path] crate has no native functionality equivalent to this. +pub fn normalize_path(path: &Path) -> PathBuf { + let mut components = path.components().peekable(); + let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() { + components.next(); + PathBuf::from(c.as_os_str()) + } else { + PathBuf::new() + }; + + for component in components { + match component { + Component::Prefix(..) => unreachable!(), + Component::RootDir => { + ret.push(component.as_os_str()); + } + Component::CurDir => {} + Component::ParentDir => { + ret.pop(); + } + Component::Normal(c) => { + ret.push(c); + } + } + } + ret +} + +#[cfg(test)] +mod test { + + // *********************** tests for normalized paths + use super::{list_source_files, normalize_path}; + use std::env::current_dir; + use std::path::PathBuf; + + #[test] + fn normalize_redirects() { + let mut src = current_dir().unwrap(); + src.push(".."); + src.push( + current_dir() + .unwrap() + .strip_prefix(current_dir().unwrap().parent().unwrap()) + .unwrap(), + ); + println!("relative path = {}", src.to_str().unwrap()); + assert_eq!(normalize_path(&src), current_dir().unwrap()); + } + + #[test] + fn normalize_no_root() { + let src = PathBuf::from("../cpp_linter_rs"); + let mut cur_dir = current_dir().unwrap(); + cur_dir = cur_dir + .strip_prefix(current_dir().unwrap().parent().unwrap()) + .unwrap() + .to_path_buf(); + println!("relative path = {}", src.to_str().unwrap()); + assert_eq!(normalize_path(&src), cur_dir); + } + + #[test] + fn normalize_current_redirect() { + let src = PathBuf::from("tests/./ignored_paths"); + println!("relative path = {}", src.to_str().unwrap()); + assert_eq!(normalize_path(&src), PathBuf::from("tests/ignored_paths")); + } + + // ************* tests for ignored paths + use crate::cli::{get_arg_parser, parse_ignore}; + use crate::common_fs::is_file_in_list; + use std::env::set_current_dir; + + fn setup_ignore(input: &str) -> (Vec, Vec) { + let arg_parser = get_arg_parser(); + let args = arg_parser.get_matches_from(vec!["cpp-linter", "-i", input]); + let ignore_arg = args + .get_many::("ignore") + .unwrap() + .map(|s| s.as_str()) + .collect::>(); + let (ignored, not_ignored) = parse_ignore(&ignore_arg); + println!("ignored = {:?}", ignored); + println!("not ignored = {:?}", not_ignored); + (ignored, not_ignored) + } + + #[test] + fn ignore_src() { + let (ignored, not_ignored) = setup_ignore("src"); + assert!(is_file_in_list( + &PathBuf::from("./src/lib.rs"), + &ignored, + "ignored".to_string() + )); + assert!(!is_file_in_list( + &PathBuf::from("./src/lib.rs"), + ¬_ignored, + "not_ignored".to_string() + )); + } + + #[test] + fn ignore_root() { + let (ignored, not_ignored) = setup_ignore("!src/lib.rs|./"); + assert!(is_file_in_list( + &PathBuf::from("./cargo.toml"), + &ignored, + "ignored".to_string() + )); + assert!(is_file_in_list( + &PathBuf::from("./src/lib.rs"), + ¬_ignored, + "not_ignored".to_string() + )); + } + + #[test] + fn ignore_root_implicit() { + let (ignored, not_ignored) = setup_ignore("!src|"); + assert!(is_file_in_list( + &PathBuf::from("./cargo.toml"), + &ignored, + "ignored".to_string() + )); + assert!(is_file_in_list( + &PathBuf::from("./src/lib.rs"), + ¬_ignored, + "not_ignored".to_string() + )); + } + + #[test] + fn ignore_submodules() { + set_current_dir("tests/ignored_paths").unwrap(); + let (ignored, not_ignored) = setup_ignore("!pybind11"); + + // using Vec::contains() because these files don't actually exist in project files + for ignored_submodule in ["./RF24", "./RF24Network", "./RF24Mesh"] { + assert!(ignored.contains(&ignored_submodule.to_string())); + assert!(!is_file_in_list( + &PathBuf::from(ignored_submodule.to_string() + "/some_src.cpp"), + &ignored, + "ignored".to_string() + )); + } + assert!(not_ignored.contains(&"./pybind11".to_string())); + assert!(!is_file_in_list( + &PathBuf::from("./pybind11/some_src.cpp"), + ¬_ignored, + "not ignored".to_string() + )); + } + + #[test] + fn walk_dir_recursively() { + let (ignored, not_ignored) = setup_ignore("target"); + let extensions = vec!["cpp", "hpp"]; + let files = list_source_files(&extensions, &ignored, ¬_ignored, "."); + assert!(!files.is_empty()); + for file in files { + assert!(extensions.contains( + &file + .name + .extension() + .unwrap_or_default() + .to_string_lossy() + .to_string() + .as_str() + )); + } + } + + use super::get_line_cols_from_offset; + #[test] + fn translate_byte_offset() { + let (lines, cols) = get_line_cols_from_offset(&PathBuf::from("tests/demo/demo.cpp"), 144); + println!("lines: {lines}, cols: {cols}"); + assert_eq!(lines, 13); + assert_eq!(cols, 5); + } +} diff --git a/src/git.rs b/src/git.rs new file mode 100644 index 0000000..641875c --- /dev/null +++ b/src/git.rs @@ -0,0 +1,473 @@ +//! This module is primarily used to parse diff blobs. +//! +//! It can also be used (locally) to get a list of files changes from either the last +//! commit or the next commit's staging area. +//! +//! This also includes a private module that is used as a fallback (brute force) +//! mechanism when parsing diffs fail using libgit2. NOTE: parsing a diff from a buffer +//! (str or bytes) only happens in CI or when libgit2 cannot be used to initialize a +//! repository. + +use std::{ops::RangeInclusive, path::PathBuf}; + +// non-std crates +use git2::{Diff, Error, Patch, Repository}; + +// project specific modules/crates +use crate::common_fs::{is_source_or_ignored, FileObj}; + +/// This (re-)initializes the repository located in the specified `path`. +/// +/// This is actually not used in CI for file permissions and ownership reasons. +/// Rather this is only (supposed to be) used when executed on a local developer +/// machine. +pub fn open_repo(path: &str) -> Result { + Repository::open(PathBuf::from(path).as_path()) +} + +/// Fetches the SHA1 of the commit for the specified [`git2::Repository`]. +/// +/// The optionally specified `depth` can be used to traverse the tree a number of times +/// since the current `"HEAD"`. +fn get_sha(repo: &Repository, depth: Option) -> Result, Error> { + match depth { + Some(int) => repo.revparse_single(format!("HEAD~{}", int).as_str()), + None => repo.revparse_single("HEAD"), + } +} + +/// Fetch the [`git2::Diff`] about a given [`git2::Repository`]. +/// +/// This is actually not used in CI for file permissions and ownership reasons. +/// Rather this is only (supposed to be) used when executed on a local developer +/// machine. +/// +/// If there are files staged for a commit, then the resulting [`Diff`] will describe +/// the staged changes. However, if there are no staged changes, then the last commit's +/// [`Diff`] is returned. +pub fn get_diff(repo: &Repository) -> git2::Diff { + let head = get_sha(repo, None).unwrap().peel_to_tree().unwrap(); + let mut has_staged_files = false; + for entry in repo.statuses(None).unwrap().iter() { + if entry.status().bits() + & (git2::Status::INDEX_NEW.bits() + | git2::Status::INDEX_MODIFIED.bits() + | git2::Status::INDEX_RENAMED.bits()) + > 0 + { + has_staged_files = true; + break; + } + } + + if has_staged_files { + // get diff for staged files only + repo.diff_tree_to_index(Some(&head), None, None) + .expect("Could not get diff for current changes in local repo index") + } else { + // get diff for last commit only + let base = get_sha(repo, Some(1)).unwrap().peel_to_tree().unwrap(); + repo.diff_tree_to_tree(Some(&base), Some(&head), None) + .expect("could not get diff for last commit") + } +} + +/// Parses a patch for a single file in a diff. +/// +/// Returns the list of line numbers that have additions and the ranges spanning each +/// chunk present in the `patch`. +fn parse_patch(patch: &Patch) -> (Vec, Vec>) { + let mut additions = Vec::new(); + let mut diff_hunks = Vec::new(); + for hunk_idx in 0..patch.num_hunks() { + let (hunk, line_count) = patch.hunk(hunk_idx).unwrap(); + diff_hunks.push(RangeInclusive::new( + hunk.new_start(), + hunk.new_start() + hunk.new_lines(), + )); + for line in 0..line_count { + let diff_line = patch.line_in_hunk(hunk_idx, line).unwrap(); + if diff_line.origin_value() == git2::DiffLineType::Addition { + additions.push(diff_line.new_lineno().unwrap()); + } + } + } + (additions, diff_hunks) +} + +/// Parses a given [`git2::Diff`] and returns a list of [`FileObj`]s. +/// +/// The specified list of `extensions`, `ignored` and `not_ignored` files are used as +/// filters to expedite the process and only focus on the data cpp_linter can use. +pub fn parse_diff( + diff: &git2::Diff, + extensions: &[&str], + ignored: &[String], + not_ignored: &[String], +) -> Vec { + let mut files: Vec = Vec::new(); + for file_idx in 0..diff.deltas().count() { + let diff_delta = diff.get_delta(file_idx).unwrap(); + let file_path = diff_delta.new_file().path().unwrap().to_path_buf(); + if [ + git2::Delta::Added, + git2::Delta::Modified, + git2::Delta::Renamed, + ] + .contains(&diff_delta.status()) + && is_source_or_ignored(&file_path, extensions, ignored, not_ignored) + { + let (added_lines, diff_chunks) = + parse_patch(&Patch::from_diff(diff, file_idx).unwrap().unwrap()); + files.push(FileObj::from(file_path, added_lines, diff_chunks)); + } + } + files +} + +/// Same as [`parse_diff`] but takes a buffer of bytes instead of a [`git2::Diff`]. +/// +/// In the case that libgit2 fails to parse the buffer of bytes, a private algorithm is +/// used. In such a case, brute force parsing the diff as a string can be costly. So, a +/// log warning and error are output when this occurs. Please report this instance for +/// troubleshooting/diagnosis as this likely means the diff is malformed or there is a +/// bug in libgit2 source. +pub fn parse_diff_from_buf( + buff: &[u8], + extensions: &[&str], + ignored: &[String], + not_ignored: &[String], +) -> Vec { + if let Ok(diff_obj) = &Diff::from_buffer(buff) { + parse_diff(diff_obj, extensions, ignored, not_ignored) + } else { + log::warn!("libgit2 failed to parse the diff"); + brute_force_parse_diff::parse_diff( + &String::from_utf8_lossy(buff), + extensions, + ignored, + not_ignored, + ) + } +} + +mod brute_force_parse_diff { + //! A private module to house the brute force algorithms of parsing a diff as a string. + //! This module is only intended as a fall back mechanism when [super::parse_diff_from_buf] + //! fails to use libgit2 C bindings. + //! + //! Since this is a fail safe, there are log messages that indicate when it is used. + //! Any instance where this mechanism is used should be reported as it is likely a bug + //! in libgit2 source. + + use regex::Regex; + use std::{ops::RangeInclusive, path::PathBuf}; + + use crate::common_fs::{is_source_or_ignored, FileObj}; + + fn get_filename_from_front_matter(front_matter: &str) -> Option<&str> { + let diff_file_name = Regex::new(r"(?m)^\+\+\+\sb?/(.*)$").unwrap(); + let diff_renamed_file = Regex::new(r"(?m)^rename to (.*)$").unwrap(); + let diff_binary_file = Regex::new(r"(?m)^Binary\sfiles\s").unwrap(); + if let Some(captures) = diff_file_name.captures(front_matter) { + return Some(captures.get(1).unwrap().as_str()); + } + if front_matter.trim_start().starts_with("similarity") { + if let Some(captures) = diff_renamed_file.captures(front_matter) { + return Some(captures.get(1).unwrap().as_str()); + } + } + if diff_binary_file.is_match(front_matter) { + log::warn!("Unrecognized diff starting with:\n{}", front_matter); + } + None + } + + /// A regex pattern used in multiple functions + static HUNK_INFO_PATTERN: &str = r"(?m)@@\s\-\d+,\d+\s\+(\d+,\d+)\s@@"; + + /// Parses a single file's patch containing one or more hunks + /// Returns a 3-item tuple: + /// - the line numbers that contain additions + /// - the ranges of lines that span each hunk + fn parse_patch(patch: &str) -> (Vec, Vec>) { + let mut diff_chunks = Vec::new(); + let mut additions = Vec::new(); + + let hunk_info = Regex::new(HUNK_INFO_PATTERN).unwrap(); + if let Some(hunk_headers) = hunk_info.captures(patch) { + for (index, (hunk, header)) in + hunk_info.split(patch).zip(hunk_headers.iter()).enumerate() + { + if index == 0 { + continue; // we don't need the whole match, just the capture groups + } + let new_range: Vec = header + .unwrap() + .as_str() + .split(',') + .take(2) + .map(|val| val.parse::().unwrap()) + .collect(); + let start_line = new_range[0]; + let end_range = new_range[1]; + let mut line_numb_in_diff = start_line; + diff_chunks.push(RangeInclusive::new(start_line, start_line + end_range)); + for (line_index, line) in hunk.split('\n').enumerate() { + if line.starts_with('+') { + additions.push(line_numb_in_diff); + } + if line_index > 0 && !line.starts_with('-') { + line_numb_in_diff += 1; + } + } + } + } + (additions, diff_chunks) + } + + pub fn parse_diff( + diff: &str, + extensions: &[&str], + ignored: &[String], + not_ignored: &[String], + ) -> Vec { + log::error!("Using brute force diff parsing!"); + let mut results = Vec::new(); + let diff_file_delimiter = Regex::new(r"(?m)^diff --git a/.*$").unwrap(); + let hunk_info = Regex::new(HUNK_INFO_PATTERN).unwrap(); + + let file_diffs = diff_file_delimiter.split(diff); + for file_diff in file_diffs { + if file_diff.is_empty() || file_diff.starts_with("deleted file") { + continue; + } + if let Some(first_hunk) = hunk_info.find(file_diff) { + let front_matter = &file_diff[..first_hunk.start()]; + if let Some(file_name) = get_filename_from_front_matter(front_matter) { + let file_path = PathBuf::from(file_name); + if is_source_or_ignored(&file_path, extensions, ignored, not_ignored) { + let (added_lines, diff_chunks) = + parse_patch(&file_diff[first_hunk.start()..]); + results.push(FileObj::from(file_path, added_lines, diff_chunks)); + } + } + } else { + // file has no changed content. moving on + continue; + } + } + results + } + + // ******************* UNIT TESTS *********************** + #[cfg(test)] + mod test { + + use super::parse_diff; + use crate::{common_fs::FileObj, git::parse_diff_from_buf, logger}; + + static RENAMED_DIFF: &str = r"diff --git a/tests/demo/some source.cpp b/tests/demo/some source.cpp +similarity index 100% +rename from /tests/demo/some source.cpp +rename to /tests/demo/some source.cpp\n"; + + static RENAMED_DIFF_WITH_CHANGES: &str = r#"diff --git a/tests/demo/some source.cpp b/tests/demo/some source.cpp +similarity index 99% +rename from /tests/demo/some source.cpp +rename to /tests/demo/some source.cpp +@@ -3,7 +3,7 @@ +\n \n \n-#include "iomanip" ++#include \n \n \n \n"#; + + #[test] + fn parse_renamed_diff() { + let diff_buf = RENAMED_DIFF.as_bytes(); + let files = parse_diff_from_buf(diff_buf, &[&String::from("cpp")], &[], &[]); + assert!(files.is_empty()); + } + + #[test] + fn parse_renamed_diff_with_patch() { + let diff_buf = RENAMED_DIFF_WITH_CHANGES.as_bytes(); + let files = parse_diff_from_buf(diff_buf, &[&String::from("cpp")], &[], &[]); + assert!(!files.is_empty()); + } + + /// Used to parse the same string buffer using both libgit2 and brute force regex. + /// Returns 2 vectors of [FileObj] that should be equivalent. + fn setup_parsed(buf: &str, extensions: &[&str]) -> (Vec, Vec) { + logger::init().unwrap_or_default(); + ( + parse_diff_from_buf(buf.as_bytes(), extensions, &[], &[]), + parse_diff(buf, extensions, &[], &[]), + ) + } + + fn assert_files_eq(files_from_a: &Vec, files_from_b: &Vec) { + assert_eq!(files_from_a.len(), files_from_b.len()); + for (a, b) in files_from_a.iter().zip(files_from_b) { + assert_eq!(a.name, b.name); + assert_eq!(a.added_lines, b.added_lines); + assert_eq!(a.added_ranges, b.added_ranges); + assert_eq!(a.diff_chunks, b.diff_chunks); + } + } + + #[test] + fn parse_typical_diff() { + let diff_buf = "diff --git a/path/for/Some file.cpp b/path/to/Some file.cpp\n\ + --- a/path/for/Some file.cpp\n\ + +++ b/path/to/Some file.cpp\n\ + @@ -3,7 +3,7 @@\n \n \n \n\ + -#include \n\ + +#include \n \n \n \n"; + + let (files_from_buf, files_from_str) = setup_parsed(diff_buf, &[&String::from("cpp")]); + assert!(!files_from_buf.is_empty()); + assert_files_eq(&files_from_buf, &files_from_str); + } + + #[test] + fn parse_binary_diff() { + let diff_buf = "diff --git a/some picture.png b/some picture.png\n\ + new file mode 100644\n\ + Binary files /dev/null and b/some picture.png differ\n"; + + let (files_from_buf, files_from_str) = setup_parsed(diff_buf, &[&String::from("png")]); + assert!(files_from_buf.is_empty()); + assert_files_eq(&files_from_buf, &files_from_str); + } + } +} + +#[cfg(test)] +mod test { + use std::{ + env::{self, current_dir, set_current_dir}, + fs::read, + }; + + use git2::build::CheckoutBuilder; + use git2::{ApplyLocation, Diff, IndexAddOption, Repository}; + + // used to setup a testing stage + fn clone_repo(url: &str, sha: &str, path: &str, patch_path: Option<&str>) { + let repo = Repository::clone(url, path).unwrap(); + let commit = repo.revparse_single(sha).unwrap(); + repo.checkout_tree( + &commit, + Some(CheckoutBuilder::new().force().recreate_missing(true)), + ) + .unwrap(); + repo.set_head_detached(commit.id()).unwrap(); + if let Some(patch) = patch_path { + let diff = Diff::from_buffer(&read(patch).unwrap()).unwrap(); + repo.apply(&diff, ApplyLocation::Both, None).unwrap(); + let mut index = repo.index().unwrap(); + index + .add_all(["tests/demo/demo.*"], IndexAddOption::DEFAULT, None) + .unwrap(); + index.write().unwrap(); + } + } + + use tempfile::{tempdir, TempDir}; + + use crate::{cli::parse_ignore, github_api::GithubApiClient, rest_api::RestApiClient}; + + fn get_temp_dir() -> TempDir { + let tmp = tempdir().unwrap(); + println!("Using temp folder at {:?}", tmp.path()); + tmp + } + + fn checkout_cpp_linter_py_repo( + sha: &str, + extensions: &[&str], + tmp: &TempDir, + patch_path: Option<&str>, + ) -> Vec { + let url = "https://github.com/cpp-linter/cpp-linter"; + clone_repo( + url, + sha, + tmp.path().as_os_str().to_str().unwrap(), + patch_path, + ); + let rest_api_client = GithubApiClient::new(); + let (ignored, not_ignored) = parse_ignore(&["target"]); + set_current_dir(tmp).unwrap(); + env::set_var("CI", "false"); // avoid use of REST API when testing in CI + rest_api_client.get_list_of_changed_files(extensions, &ignored, ¬_ignored) + } + + #[test] + fn with_no_changed_sources() { + // commit with no modified C/C++ sources + let sha = "0c236809891000b16952576dc34de082d7a40bf3"; + let cur_dir = current_dir().unwrap(); + let tmp = get_temp_dir(); + let extensions = vec!["cpp", "hpp"]; + let files = checkout_cpp_linter_py_repo(sha, &extensions, &tmp, None); + println!("files = {:?}", files); + assert!(files.is_empty()); + set_current_dir(cur_dir).unwrap(); // prep to delete temp_folder + drop(tmp); // delete temp_folder + } + + #[test] + fn with_changed_sources() { + // commit with modified C/C++ sources + let sha = "950ff0b690e1903797c303c5fc8d9f3b52f1d3c5"; + let cur_dir = current_dir().unwrap(); + let tmp = get_temp_dir(); + let extensions = vec!["cpp", "hpp"]; + let files = checkout_cpp_linter_py_repo(sha, &extensions, &tmp, None); + println!("files = {:?}", files); + assert!(files.len() >= 2); + for file in files { + assert!(extensions.contains( + &file + .name + .extension() + .unwrap() + .to_string_lossy() + .to_string() + .as_str() + )); + } + set_current_dir(cur_dir).unwrap(); // prep to delete temp_folder + drop(tmp); // delete temp_folder + } + + #[test] + fn with_staged_changed_sources() { + // commit with no modified C/C++ sources + let sha = "0c236809891000b16952576dc34de082d7a40bf3"; + let cur_dir = current_dir().unwrap(); + let tmp = get_temp_dir(); + let extensions = vec!["cpp", "hpp"]; + let files = checkout_cpp_linter_py_repo( + sha, + &extensions, + &tmp, + Some("tests/capture_tools_output/cpp-linter/cpp-linter/test_git_lib.patch"), + ); + println!("files = {:?}", files); + assert!(!files.is_empty()); + for file in files { + assert!(extensions.contains( + &file + .name + .extension() + .unwrap() + .to_string_lossy() + .to_string() + .as_str() + )); + } + set_current_dir(cur_dir).unwrap(); // prep to delete temp_folder + drop(tmp); // delete temp_folder + } +} diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..1c98b3d --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,32 @@ +#![doc(html_logo_url = "https://github.com/cpp-linter/cpp-linter/raw/main/docs/_static/logo.png")] +#![doc( + html_favicon_url = "https://github.com/cpp-linter/cpp-linter/raw/main/docs/_static/favicon.ico" +)] +//! The root module for the cpp_linter package when compiled as a library. +//! This module mainly holds the declarations of this package's other modules. +//! +//! The python binding is also defined here, and it is exposed in python as +//! `cpp_linter.cpp_linter` in the python path. + +use pyo3::prelude::*; + +// project specific modules/crates +pub mod clang_tools; +pub mod cli; +pub mod common_fs; +pub mod git; +pub mod rest_api; +pub use rest_api::github_api; +pub mod logger; +pub mod run; + +/// The python binding for the cpp_linter package. It only exposes a submodule named +/// ``cpp_linter.run`` whose only exposed function is used as the entrypoint script. +/// See the pure python sources in this repo's cpp_linter folder (located at repo root). +#[pymodule] +fn cpp_linter(_py: Python, m: &PyModule) -> PyResult<()> { + let run_submodule = PyModule::new(_py, "run")?; + run_submodule.add_function(wrap_pyfunction!(run::main, m)?)?; + m.add_submodule(run_submodule)?; + Ok(()) +} diff --git a/src/logger.rs b/src/logger.rs new file mode 100644 index 0000000..8426c27 --- /dev/null +++ b/src/logger.rs @@ -0,0 +1,58 @@ +//! A module to initialize and customize the logger object used in (most) stdout. + +// non-std crates +use log::{Level, LevelFilter, Metadata, Record, SetLoggerError}; + +struct SimpleLogger; + +impl log::Log for SimpleLogger { + fn enabled(&self, metadata: &Metadata) -> bool { + metadata.level() <= Level::Debug + } + + fn log(&self, record: &Record) { + if self.enabled(record.metadata()) { + println!("{}: {}", record.level(), record.args()); + } + } + + fn flush(&self) {} +} + +/// A private constant to manage the application's logger object. +static LOGGER: SimpleLogger = SimpleLogger; + +/// A function to initialize the private `LOGGER`. +/// +/// The logging level defaults to [`LevelFilter::Info`]. +/// Returns a [`SetLoggerError`] if the `LOGGER` is already initialized. +pub fn init() -> Result<(), SetLoggerError> { + log::set_logger(&LOGGER).map(|()| log::set_max_level(LevelFilter::Info)) +} + +/// This prints a line to indicate the beginning of a related group of log statements. +/// +/// This function may or may not get moved to [crate::rest_api::RestApiClient] trait +/// if/when platforms other than GitHub are supported. +pub fn start_log_group(name: String) { + println!("::group::{}", name); +} + +/// This prints a line to indicate the ending of a related group of log statements. +/// +/// This function may or may not get moved to [crate::rest_api::RestApiClient] trait +/// if/when platforms other than GitHub are supported. +pub fn end_log_group() { + println!("::endgroup::"); +} + +#[cfg(test)] +mod tests { + use super::{end_log_group, start_log_group}; + + #[test] + fn issue_log_grouping_stdout() { + start_log_group(String::from("a dumb test")); + end_log_group(); + } +} diff --git a/src/rest_api/github_api.rs b/src/rest_api/github_api.rs new file mode 100644 index 0000000..2eec07a --- /dev/null +++ b/src/rest_api/github_api.rs @@ -0,0 +1,484 @@ +//! This module holds functionality specific to using Github's REST API. + +use std::collections::HashMap; +use std::env; +use std::fs::OpenOptions; +use std::io::{Read, Write}; + +// non-std crates +use reqwest::blocking::Client; +use reqwest::header::{HeaderMap, HeaderValue}; +use reqwest::Method; +use serde::Deserialize; +use serde_json; + +// project specific modules/crates +use crate::clang_tools::{clang_format::FormatAdvice, clang_tidy::TidyNotification}; +use crate::common_fs::FileObj; +use crate::git::{get_diff, open_repo, parse_diff, parse_diff_from_buf}; + +use super::RestApiClient; + +/// A structure to work with Github REST API. +pub struct GithubApiClient { + /// The HTTP request client to be used for all REST API calls. + client: Client, + + /// The CI run's event payload from the webhook that triggered the workflow. + event_payload: Option, + + /// The name of the event that was triggered when running cpp_linter. + pub event_name: String, + + /// The value of the `GITHUB_API_URL` environment variable. + api_url: String, + + /// The value of the `GITHUB_REPOSITORY` environment variable. + repo: Option, + + /// The value of the `GITHUB_SHA` environment variable. + sha: Option, + + /// The value of the `ACTIONS_STEP_DEBUG` environment variable. + pub debug_enabled: bool, +} + +impl Default for GithubApiClient { + fn default() -> Self { + Self::new() + } +} + +impl GithubApiClient { + pub fn new() -> Self { + GithubApiClient { + client: reqwest::blocking::Client::new(), + event_payload: { + let event_payload_path = env::var("GITHUB_EVENT_PATH"); + if event_payload_path.is_ok() { + let file_buf = &mut String::new(); + OpenOptions::new() + .read(true) + .open(event_payload_path.unwrap()) + .unwrap() + .read_to_string(file_buf) + .unwrap(); + Some(serde_json::from_str(file_buf.as_str()).unwrap()) + } else { + None + } + }, + event_name: env::var("GITHUB_EVENT_NAME").unwrap_or(String::from("default")), + api_url: env::var("GITHUB_API_URL").unwrap_or(String::from("https://api.github.com")), + repo: if let Ok(val) = env::var("GITHUB_REPOSITORY") { + Some(val) + } else { + None + }, + sha: if let Ok(val) = env::var("GITHUB_SHA") { + Some(val) + } else { + None + }, + debug_enabled: match env::var("ACTIONS_STEP_DEBUG") { + Ok(val) => val == "true", + Err(_) => false, + }, + } + } +} + +// implement the RestApiClient trait for the GithubApiClient +impl RestApiClient for GithubApiClient { + fn set_exit_code( + &self, + checks_failed: i32, + format_checks_failed: Option, + tidy_checks_failed: Option, + ) -> i32 { + if let Ok(gh_out) = env::var("GITHUB_OUTPUT") { + let mut gh_out_file = OpenOptions::new() + .append(true) + .open(gh_out) + .expect("GITHUB_OUTPUT file could not be opened"); + if let Err(e) = writeln!( + gh_out_file, + "checks-failed={}\nformat-checks-failed={}\ntidy-checks-failed={}", + checks_failed, + format_checks_failed.unwrap_or(0), + tidy_checks_failed.unwrap_or(0), + ) { + panic!("Could not write to GITHUB_OUTPUT file: {}", e); + } + } + checks_failed + } + + fn make_headers(&self, use_diff: Option) -> HeaderMap { + let gh_token = env::var("GITHUB_TOKEN"); + let mut headers = HeaderMap::new(); + let return_fmt = "application/vnd.github.".to_owned() + + if use_diff.is_some_and(|val| val) { + "diff" + } else { + "text+json" + }; + headers.insert("Accept", return_fmt.parse().unwrap()); + let user_agent = + "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0"; + headers.insert("User-Agent", user_agent.parse().unwrap()); + if let Ok(token) = gh_token { + headers.insert("Authorization", token.parse().unwrap()); + } + headers + } + + fn get_list_of_changed_files( + &self, + extensions: &[&str], + ignored: &[String], + not_ignored: &[String], + ) -> Vec { + if env::var("CI").is_ok_and(|val| val.as_str() == "true") + && self.repo.is_some() + && self.sha.is_some() + { + // get diff from Github REST API + let url = format!( + "{}/repos/{}/{}", + self.api_url, + self.repo.as_ref().unwrap(), + if self.event_name == "pull_request" { + let pr_number = &self.event_payload.as_ref().unwrap()["number"]; + format!("pulls/{}", &pr_number) + } else { + format!("commits/{}", self.sha.as_ref().unwrap()) + } + ); + let response = self + .client + .get(url) + .headers(self.make_headers(Some(true))) + .send() + .unwrap() + .bytes() + .unwrap(); + + parse_diff_from_buf(&response, extensions, ignored, not_ignored) + } else { + // get diff from libgit2 API + let repo = open_repo(".") + .expect("Please ensure the repository is checked out before running cpp-linter."); + let list = parse_diff(&get_diff(&repo), extensions, ignored, not_ignored); + list + } + } + + fn post_feedback( + &self, + files: &[FileObj], + format_advice: &[FormatAdvice], + tidy_advice: &[Vec], + thread_comments: &str, + no_lgtm: bool, + step_summary: bool, + file_annotations: bool, + style: &str, + lines_changed_only: u8, + ) { + let (comment, format_checks_failed, tidy_checks_failed) = + self.make_comment(files, format_advice, tidy_advice); + if thread_comments != "false" { + // post thread comment for PR or push event + if let Some(repo) = &self.repo { + let is_pr = self.event_name == "pull_request"; + let base_url = format!("{}/repos/{}/", &self.api_url, &repo); + let comments_url = if is_pr { + format!( + "{base_url}issues/{}", + &self.event_payload.as_ref().unwrap()["number"] + ) + } else { + format!("{base_url}/commits/{}", &self.sha.as_ref().unwrap()) + }; + + // get count of comments + let request = self + .client + .get(&comments_url) + .headers(self.make_headers(None)) + .send(); + if let Ok(response) = request { + let json = response.json::().unwrap(); + let count = if is_pr { + json["comments"].as_u64().unwrap() + } else { + json["commit"]["comment_count"].as_u64().unwrap() + }; + let user_id: u64 = 41898282; + self.update_comment( + &format!("{}/comments", &comments_url), + &comment, + count, + user_id, + no_lgtm, + format_checks_failed + tidy_checks_failed == 0, + thread_comments == "update", + ); + } else { + let error = request.unwrap_err(); + if let Some(status) = error.status() { + log::error!( + "Could not get comment count. Got response {:?} from {comments_url}", + status + ); + } else { + log::error!("attempt GET comment count failed"); + } + } + } + } + if file_annotations { + self.post_annotations(files, format_advice, tidy_advice, style, lines_changed_only); + } + if step_summary { + self.post_step_summary(&comment); + } + self.set_exit_code( + format_checks_failed + tidy_checks_failed, + Some(format_checks_failed), + Some(tidy_checks_failed), + ); + } +} + +impl GithubApiClient { + fn post_step_summary(&self, comment: &String) { + if let Ok(gh_out) = env::var("GITHUB_STEP_SUMMARY") { + let mut gh_out_file = OpenOptions::new() + .append(true) + .open(gh_out) + .expect("GITHUB_STEP_SUMMARY file could not be opened"); + if let Err(e) = writeln!(gh_out_file, "\n{}\n", comment,) { + panic!("Could not write to GITHUB_STEP_SUMMARY file: {}", e); + } + } + } + + fn post_annotations( + &self, + files: &[FileObj], + format_advice: &[FormatAdvice], + tidy_advice: &[Vec], + style: &str, + lines_changed_only: u8, + ) { + if !format_advice.is_empty() { + // formalize the style guide name + let style_guide = + if ["google", "chromium", "microsoft", "mozilla", "webkit"].contains(&style) { + // capitalize the first letter + let mut char_iter = style.chars(); + match char_iter.next() { + None => String::new(), + Some(f) => f.to_uppercase().collect::() + char_iter.as_str(), + } + } else if style == "llvm" || style == "gnu" { + style.to_ascii_uppercase() + } else { + String::from("Custom") + }; + + // iterate over clang-format and post applicable annotations (according to line filtering) + for (index, advice) in format_advice.iter().enumerate() { + // get the ranges of lines for the corresponding file + let ranges = if lines_changed_only == 0 { + None + } else if lines_changed_only == 1 { + Some(&files[index].added_ranges) + } else { + Some(&files[index].diff_chunks) + }; + + // assemble a list of line numbers (as strings) + let mut lines: Vec = Vec::new(); + for replacement in &advice.replacements { + if let Some(line_int) = replacement.line { + if !lines.contains(&line_int) { + if let Some(line_ranges) = ranges { + for line_range in line_ranges { + if line_range.contains(&line_int.try_into().unwrap()) { + lines.push(line_int); + break; + } + } + } else { + lines.push(line_int); + } + } + } + } + // post annotation if any applicable lines were format + if !lines.is_empty() { + println!( + "::notice file={name},title=Run clang-format on {name}::File {name} does not conform to {style_guide} style guidelines. (lines {line_set})", + name = &files[index].name.to_string_lossy().replace('\\', "/"), + line_set = lines.iter().map(|val| val.to_string()).collect::>().join(","), + ); + } + } + } // end format_advice iterations + + // iterate over clang-tidy advice and post annotations + // The tidy_advice vector is parallel to the files vector; meaning it serves as a file filterer. + // lines are already filter as specified to clang-tidy CLI. + for (index, advice) in tidy_advice.iter().enumerate() { + for note in advice { + if note.filename == files[index].name.to_string_lossy().replace('\\', "/") { + println!( + "::{severity} file={file},line={line},title={file}:{line}:{cols} [{diag}]::{info}", + severity = if note.severity == *"note" { "notice".to_string() } else {note.severity.clone()}, + file = note.filename, + line = note.line, + cols = note.cols, + diag = note.diagnostic, + info = note.rationale, + ); + } + } + } + } + + /// update existing comment or remove old comment(s) and post a new comment + #[allow(clippy::too_many_arguments)] + fn update_comment( + &self, + url: &String, + comment: &String, + count: u64, + user_id: u64, + no_lgtm: bool, + is_lgtm: bool, + update_only: bool, + ) { + let comment_url = + self.remove_bot_comments(url, user_id, count, !update_only || (is_lgtm && no_lgtm)); + #[allow(clippy::nonminimal_bool)] // an inaccurate assessment + if (is_lgtm && !no_lgtm) || !is_lgtm { + let payload = HashMap::from([("body", comment)]); + log::debug!("payload body:\n{:?}", payload); + let req_meth = if comment_url.is_some() { + Method::PATCH + } else { + Method::POST + }; + if let Ok(response) = self + .client + .request( + req_meth.clone(), + if let Some(_url) = comment_url { + _url + } else { + url.to_string() + }, + ) + .headers(self.make_headers(None)) + .json(&payload) + .send() + { + log::info!( + "Got {} response from {:?}ing comment", + response.status(), + req_meth, + ); + } + } + } + + fn remove_bot_comments( + &self, + url: &String, + count: u64, + user_id: u64, + delete: bool, + ) -> Option { + let mut page = 1; + let mut comment_url = None; + let mut total = count; + while total > 0 { + let request = self.client.get(format!("{url}/?page={page}")).send(); + if request.is_err() { + log::error!("Failed to get list of existing comments"); + return None; + } else if let Ok(response) = request { + let payload: JsonCommentsPayload = response.json().unwrap(); + let mut comment_count = 0; + for comment in payload.comments { + if comment.body.starts_with("") + && comment.user.id == user_id + { + log::debug!( + "comment id {} from user {} ({})", + comment.id, + comment.user.login, + comment.user.id, + ); + #[allow(clippy::nonminimal_bool)] // an inaccurate assessment + if delete || (!delete && comment_url.is_none()) { + // if not updating: remove all outdated comments + // if updating: remove all outdated comments except the last one + + // use last saved comment_url (if not None) or current comment url + let del_url = if let Some(last_url) = &comment_url { + last_url + } else { + &comment.url + }; + if let Ok(response) = self + .client + .delete(del_url) + .headers(self.make_headers(None)) + .send() + { + log::info!( + "Got {} from DELETE {}", + response.status(), + del_url.strip_prefix(&self.api_url).unwrap(), + ) + } else { + log::error!("Unable to remove old bot comment"); + return None; // exit early as this is most likely due to rate limit. + } + } + if !delete { + comment_url = Some(comment.url) + } + } + comment_count += 1; + } + total -= comment_count; + page += 1; + } + } + comment_url + } +} + +#[derive(Debug, Deserialize, PartialEq)] +struct JsonCommentsPayload { + comments: Vec, +} + +#[derive(Debug, Deserialize, PartialEq, Clone)] +struct Comment { + pub id: i64, + pub url: String, + pub body: String, + pub user: User, +} + +#[derive(Debug, Deserialize, PartialEq, Clone)] +struct User { + pub login: String, + pub id: u64, +} diff --git a/src/rest_api/mod.rs b/src/rest_api/mod.rs new file mode 100644 index 0000000..de3bf55 --- /dev/null +++ b/src/rest_api/mod.rs @@ -0,0 +1,144 @@ +//! This crate is the home of functionality that uses the REST API of various git-based +//! servers. +//! +//! Currently, only Github is supported. + +use std::path::PathBuf; + +// non-std crates +use reqwest::header::{HeaderMap, HeaderValue}; + +// project specific modules/crates +pub mod github_api; +use crate::clang_tools::{clang_format::FormatAdvice, clang_tidy::TidyNotification}; +use crate::common_fs::FileObj; + +/// A custom trait that templates necessary functionality with a Git server's REST API. +pub trait RestApiClient { + /// A way to set output variables specific to cpp_linter executions in CI. + fn set_exit_code( + &self, + checks_failed: i32, + format_checks_failed: Option, + tidy_checks_failed: Option, + ) -> i32; + + /// A convenience method to create the headers attached to all REST API calls. + /// + /// If an authentication token is provided, this method shall include the relative + /// information in the returned [HeaderMap]. + fn make_headers(&self, use_diff: Option) -> HeaderMap; + + /// A way to get the list of changed files using REST API calls. It is this method's + /// job to parse diff blobs and return a list of changed files. + /// + /// The context of the file changes are subject to the type of event in which + /// cpp_linter package is used. + fn get_list_of_changed_files( + &self, + extensions: &[&str], + ignored: &[String], + not_ignored: &[String], + ) -> Vec; + + /// Makes a comment in MarkDown syntax based on the concerns in `format_advice` and + /// `tidy_advice` about the given set of `files`. + /// + /// This method has a default definition and should not need to be redefined by + /// implementors. + /// + /// Returns the markdown comment as a string as well as the total count of + /// `format_checks_failed` and `tidy_checks_failed` (in respective order). + fn make_comment( + &self, + files: &[FileObj], + format_advice: &[FormatAdvice], + tidy_advice: &[Vec], + ) -> (String, i32, i32) { + let mut comment = String::from("\n# Cpp-Linter Report "); + let mut format_checks_failed = 0; + let mut tidy_checks_failed = 0; + let mut format_comment = String::new(); + for (index, fmt_advice) in format_advice.iter().enumerate() { + if !fmt_advice.replacements.is_empty() { + format_comment.push_str( + &format!( + "- {}\n", + files[index].name.to_string_lossy().replace('\\', "/") + ) + .to_string(), + ); + format_checks_failed += 1; + } + } + + let mut tidy_comment = String::new(); + for (index, tidy_notes) in tidy_advice.iter().enumerate() { + for tidy_note in tidy_notes { + let file_path = PathBuf::from(&tidy_note.filename); + if file_path == files[index].name { + tidy_comment.push_str(&format!("- {}\n\n", tidy_note.filename)); + tidy_comment.push_str(&format!( + " {filename}:{line}:{cols}: {severity}: [{diagnostic}]\n > {rationale}\n{concerned_code}", + filename = tidy_note.filename, + line = tidy_note.line, + cols = tidy_note.cols, + severity = tidy_note.severity, + diagnostic = tidy_note.diagnostic, + rationale = tidy_note.rationale, + concerned_code = if tidy_note.suggestion.is_empty() {String::from("")} else { + format!("\n ```{ext}\n {suggestion}\n ```\n", + ext = file_path.extension().expect("file extension was not determined").to_string_lossy(), + suggestion = tidy_note.suggestion.join("\n "), + ).to_string() + }, + ).to_string()); + tidy_checks_failed += 1; + } + } + } + if format_checks_failed > 0 || tidy_checks_failed > 0 { + comment.push_str(":warning:\nSome files did not pass the configured checks!\n"); + if format_checks_failed > 0 { + comment.push_str(&format!("\n
clang-format reports: {} file(s) not formatted\n\n{}\n
", format_checks_failed, &format_comment)); + } + if tidy_checks_failed > 0 { + comment.push_str(&format!("\n
clang-tidy reports: {} concern(s)\n\n{}\n
", tidy_checks_failed, tidy_comment)); + } + } else { + comment.push_str(":heavy_check_mark:\nNo problems need attention."); + } + comment.push_str("\n\nHave any feedback or feature suggestions? [Share it here.](https://github.com/cpp-linter/cpp-linter-action/issues)"); + log::info!("{format_checks_failed} clang-format-checks-failed"); + log::info!("{tidy_checks_failed} clang-tidy-checks-failed"); + log::info!( + "{} checks-failed", + format_checks_failed + tidy_checks_failed + ); + (comment, format_checks_failed, tidy_checks_failed) + } + + /// A way to post feedback in the form of `thread_comments`, `file_annotations`, and + /// `step_summary`. + /// + /// The given `files` should've been gathered from `get_list_of_changed_files()` or + /// `list_source_files()`. + /// + /// The `format_advice` and `tidy_advice` should be a result of parsing output from + /// clang-format and clang-tidy (see `capture_clang_tools_output()`). + /// + /// All other parameters correspond to CLI arguments. + #[allow(clippy::too_many_arguments)] + fn post_feedback( + &self, + files: &[FileObj], + format_advice: &[FormatAdvice], + tidy_advice: &[Vec], + thread_comments: &str, + no_lgtm: bool, + step_summary: bool, + file_annotations: bool, + style: &str, + lines_changed_only: u8, + ); +} diff --git a/src/run.rs b/src/run.rs new file mode 100644 index 0000000..b3c576b --- /dev/null +++ b/src/run.rs @@ -0,0 +1,148 @@ +//! This module is the native backend of the cpp-linter package written in Rust. +//! +//! In python, this module is exposed as `cpp_linter.run` that has 1 function exposed: +//! [`main()`]. + +use std::env; +use std::path::{Path, PathBuf}; + +// non-std crates +use log::{set_max_level, LevelFilter}; +#[cfg(features = "openssl-vendored")] +use openssl_probe; +use pyo3::prelude::*; + +// project specific modules/crates +use crate::clang_tools::capture_clang_tools_output; +use crate::cli::{get_arg_parser, parse_ignore}; +use crate::common_fs::{list_source_files, FileObj}; +use crate::github_api::GithubApiClient; +use crate::logger::{self, end_log_group, start_log_group}; +use crate::rest_api::RestApiClient; + +#[cfg(features = "openssl-vendored")] +fn probe_ssl_certs() { + openssl_probe::init_ssl_cert_env_vars(); +} + +#[cfg(not(openssl_probe))] +fn probe_ssl_certs() {} + +/// This is the backend entry point for console applications. +/// +/// The idea here is that all functionality is implemented in Rust. However, passing +/// command line arguments is done differently in Python or Rust. +/// +/// - In python, the `sys.argv` list is passed from the `cpp_linter.entry_point` script +/// to `run.main()`. +/// - In rust, the [`std::env::args`] is passed to `run::main()` in the binary driver +/// source `bin.rs`. +/// +/// This is done because of the way the python entry point is invoked. If [`std::env::args`] +/// is used instead of python's `sys.argv`, then the list of strings includes the entry point +/// alias ("path/to/cpp-linter.exe"). Thus, the parser in [`crate::cli`] will halt on an error +/// because it is not configured to handle positional arguments. +#[pyfunction] +pub fn main(args: Vec) -> i32 { + probe_ssl_certs(); + + let arg_parser = get_arg_parser(); + let args = arg_parser.get_matches_from(args); + + logger::init().unwrap(); + + let root_path = args.get_one::("repo-root").unwrap(); + if root_path != &String::from(".") { + env::set_current_dir(Path::new(root_path)).unwrap(); + } + + let database_path = if let Some(database) = args.get_one::("database") { + if !database.is_empty() { + Some(PathBuf::from(database).canonicalize().unwrap()) + } else { + None + } + } else { + None + }; + + let rest_api_client = GithubApiClient::new(); + let verbosity = args.get_one::("verbosity").unwrap().as_str() == "debug"; + set_max_level(if verbosity || rest_api_client.debug_enabled { + LevelFilter::Debug + } else { + LevelFilter::Info + }); + log::info!("Processing event {}", rest_api_client.event_name); + + let extensions = args + .get_many::("extensions") + .unwrap() + .map(|s| s.as_str()) + .collect::>(); + let ignore = args + .get_many::("ignore") + .unwrap() + .map(|s| s.as_str()) + .collect::>(); + let (ignored, not_ignored) = parse_ignore(&ignore); + + let lines_changed_only = match args + .get_one::("lines-changed-only") + .unwrap() + .as_str() + { + "false" => 0, + "true" => 1, + "diff" => 2, + _ => unreachable!(), + }; + let files_changed_only = args.get_flag("files-changed-only"); + + start_log_group(String::from("Get list of specified source files")); + let files: Vec = if lines_changed_only != 0 || files_changed_only { + // parse_diff(github_rest_api_payload) + rest_api_client.get_list_of_changed_files(&extensions, &ignored, ¬_ignored) + } else { + // walk the folder and look for files with specified extensions according to ignore values. + list_source_files(&extensions, &ignored, ¬_ignored, ".") + }; + log::info!("Giving attention to the following files:"); + for file in &files { + log::info!(" ./{}", file.name.to_string_lossy().replace('\\', "/")); + } + end_log_group(); + + let style = args.get_one::("style").unwrap(); + let (format_advice, tidy_advice) = capture_clang_tools_output( + &files, + args.get_one::("version").unwrap(), + args.get_one::("tidy-checks").unwrap(), + style, + lines_changed_only, + database_path, + if let Ok(extra_args) = args.try_get_many::("extra-arg") { + extra_args.map(|extras| extras.map(|val| val.as_str()).collect()) + } else { + None + }, + ); + start_log_group(String::from("Posting feedback")); + let no_lgtm = args.get_flag("no-lgtm"); + let step_summary = args.get_flag("step-summary"); + let thread_comments = args.get_one::("thread-comments").unwrap(); + let file_annotations = args.get_flag("file-annotations"); + rest_api_client.post_feedback( + &files, + &format_advice, + &tidy_advice, + thread_comments, + no_lgtm, + step_summary, + file_annotations, + style, + lines_changed_only, + ); + end_log_group(); + 0 +} diff --git a/tests/capture_tools_output/chocolate-doom/chocolate-doom/.clang-format b/tests/capture_tools_output/chocolate-doom/chocolate-doom/.clang-format new file mode 100644 index 0000000..6997192 --- /dev/null +++ b/tests/capture_tools_output/chocolate-doom/chocolate-doom/.clang-format @@ -0,0 +1,148 @@ +--- +Language: Cpp +# BasedOnStyle: LLVM +AccessModifierOffset: -2 +AlignAfterOpenBracket: Align +AlignConsecutiveMacros: true +AlignConsecutiveAssignments: false +AlignConsecutiveBitFields: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Right +AlignOperands: Align +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortEnumsOnASingleLine: true +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortLambdasOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: MultiLine +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterCaseLabel: false + AfterClass: true + AfterControlStatement: Always + AfterEnum: true + AfterFunction: true + AfterNamespace: true + AfterObjCDeclaration: false + AfterStruct: true + AfterUnion: true + AfterExternBlock: false + BeforeCatch: false + BeforeElse: true + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Custom +BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeColon +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 80 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DeriveLineEnding: true +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + Priority: 2 + SortPriority: 0 + - Regex: '^(<|"(gtest|gmock|isl|json)/)' + Priority: 3 + SortPriority: 0 + - Regex: '.*' + Priority: 1 + SortPriority: 0 +IncludeIsMainRegex: '(Test)?$' +IncludeIsMainSourceRegex: '' +IndentCaseLabels: false +IndentCaseBlocks: false +IndentGotoLabels: true +IndentPPDirectives: None +IndentExternBlock: AfterExternBlock +IndentWidth: 4 +IndentWrappedFunctionNames: false +InsertTrailingCommas: None +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: true +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: None +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 2 +ObjCBreakBeforeNestedBlockParam: true +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerAlignment: Right +ReflowComments: false +SortIncludes: false +SortUsingDeclarations: true +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInConditionalStatement: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +SpaceBeforeSquareBrackets: false +Standard: Latest +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 8 +UseCRLF: false +UseTab: Never +WhitespaceSensitiveMacros: + - STRINGIZE + - PP_STRINGIZE + - BOOST_PP_STRINGIZE +... diff --git a/tests/capture_tools_output/chocolate-doom/chocolate-doom/.clang-tidy b/tests/capture_tools_output/chocolate-doom/chocolate-doom/.clang-tidy new file mode 100644 index 0000000..19dc3ea --- /dev/null +++ b/tests/capture_tools_output/chocolate-doom/chocolate-doom/.clang-tidy @@ -0,0 +1,349 @@ +--- +Checks: 'clang-diagnostic-*,clang-analyzer-*,-boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-*,cppcoreguidelines-*,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers' +WarningsAsErrors: '' +HeaderFilterRegex: '' +AnalyzeTemporaryDtors: false +FormatStyle: none +User: ytreh +CheckOptions: + - key: modernize-replace-auto-ptr.IncludeStyle + value: llvm + - key: cppcoreguidelines-no-malloc.Reallocations + value: '::realloc' + - key: cppcoreguidelines-owning-memory.LegacyResourceConsumers + value: '::free;::realloc;::freopen;::fclose' + - key: readability-static-accessed-through-instance.NameSpecifierNestingThreshold + value: '3' + - key: readability-function-size.VariableThreshold + value: '4294967295' + - key: modernize-use-auto.MinTypeNameLength + value: '5' + - key: bugprone-reserved-identifier.Invert + value: 'false' + - key: performance-move-const-arg.CheckTriviallyCopyableMove + value: 'true' + - key: cert-dcl16-c.NewSuffixes + value: 'L;LL;LU;LLU' + - key: bugprone-narrowing-conversions.WarnOnFloatingPointNarrowingConversion + value: 'true' + - key: readability-identifier-naming.GetConfigPerFile + value: 'true' + - key: bugprone-narrowing-conversions.PedanticMode + value: 'false' + - key: readability-inconsistent-declaration-parameter-name.Strict + value: 'false' + - key: cppcoreguidelines-macro-usage.CheckCapsOnly + value: 'false' + - key: bugprone-unused-return-value.CheckedFunctions + value: '::std::async;::std::launder;::std::remove;::std::remove_if;::std::unique;::std::unique_ptr::release;::std::basic_string::empty;::std::vector::empty;::std::back_inserter;::std::distance;::std::find;::std::find_if;::std::inserter;::std::lower_bound;::std::make_pair;::std::map::count;::std::map::find;::std::map::lower_bound;::std::multimap::equal_range;::std::multimap::upper_bound;::std::set::count;::std::set::find;::std::setfill;::std::setprecision;::std::setw;::std::upper_bound;::std::vector::at;::bsearch;::ferror;::feof;::isalnum;::isalpha;::isblank;::iscntrl;::isdigit;::isgraph;::islower;::isprint;::ispunct;::isspace;::isupper;::iswalnum;::iswprint;::iswspace;::isxdigit;::memchr;::memcmp;::strcmp;::strcoll;::strncmp;::strpbrk;::strrchr;::strspn;::strstr;::wcscmp;::access;::bind;::connect;::difftime;::dlsym;::fnmatch;::getaddrinfo;::getopt;::htonl;::htons;::iconv_open;::inet_addr;::isascii;::isatty;::mmap;::newlocale;::openat;::pathconf;::pthread_equal;::pthread_getspecific;::pthread_mutex_trylock;::readdir;::readlink;::recvmsg;::regexec;::scandir;::semget;::setjmp;::shm_open;::shmget;::sigismember;::strcasecmp;::strsignal;::ttyname' + - key: modernize-use-default-member-init.UseAssignment + value: 'false' + - key: readability-function-size.NestingThreshold + value: '4294967295' + - key: modernize-use-override.AllowOverrideAndFinal + value: 'false' + - key: readability-function-size.ParameterThreshold + value: '4294967295' + - key: modernize-pass-by-value.ValuesOnly + value: 'false' + - key: modernize-loop-convert.IncludeStyle + value: llvm + - key: cert-str34-c.DiagnoseSignedUnsignedCharComparisons + value: '0' + - key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison + value: 'false' + - key: cppcoreguidelines-explicit-virtual-functions.AllowOverrideAndFinal + value: 'false' + - key: readability-redundant-smartptr-get.IgnoreMacros + value: 'true' + - key: readability-identifier-naming.AggressiveDependentMemberLookup + value: 'false' + - key: bugprone-suspicious-string-compare.WarnOnImplicitComparison + value: 'true' + - key: modernize-use-emplace.TupleTypes + value: '::std::pair;::std::tuple' + - key: modernize-use-emplace.TupleMakeFunctions + value: '::std::make_pair;::std::make_tuple' + - key: cppcoreguidelines-owning-memory.LegacyResourceProducers + value: '::malloc;::aligned_alloc;::realloc;::calloc;::fopen;::freopen;::tmpfile' + - key: bugprone-argument-comment.CommentNullPtrs + value: '0' + - key: bugprone-argument-comment.StrictMode + value: '0' + - key: cppcoreguidelines-init-variables.IncludeStyle + value: llvm + - key: modernize-use-nodiscard.ReplacementString + value: '[[nodiscard]]' + - key: modernize-loop-convert.MakeReverseRangeHeader + value: '' + - key: modernize-replace-random-shuffle.IncludeStyle + value: llvm + - key: cppcoreguidelines-narrowing-conversions.WarnOnFloatingPointNarrowingConversion + value: 'true' + - key: modernize-use-bool-literals.IgnoreMacros + value: 'true' + - key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField + value: 'true' + - key: google-readability-namespace-comments.ShortNamespaceLines + value: '10' + - key: bugprone-suspicious-string-compare.StringCompareLikeFunctions + value: '' + - key: modernize-avoid-bind.PermissiveParameterList + value: 'false' + - key: modernize-use-override.FinalSpelling + value: final + - key: performance-move-constructor-init.IncludeStyle + value: llvm + - key: modernize-loop-convert.UseCxx20ReverseRanges + value: 'true' + - key: modernize-use-noexcept.ReplacementString + value: '' + - key: modernize-use-using.IgnoreMacros + value: 'true' + - key: performance-type-promotion-in-math-fn.IncludeStyle + value: llvm + - key: cppcoreguidelines-explicit-virtual-functions.FinalSpelling + value: final + - key: modernize-loop-convert.NamingStyle + value: CamelCase + - key: bugprone-suspicious-include.ImplementationFileExtensions + value: 'c;cc;cpp;cxx' + - key: cppcoreguidelines-pro-type-member-init.UseAssignment + value: 'false' + - key: modernize-loop-convert.MakeReverseRangeFunction + value: '' + - key: bugprone-suspicious-include.HeaderFileExtensions + value: ';h;hh;hpp;hxx' + - key: performance-no-automatic-move.AllowedTypes + value: '' + - key: performance-for-range-copy.WarnOnAllAutoCopies + value: 'false' + - key: bugprone-argument-comment.CommentIntegerLiterals + value: '0' + - key: bugprone-suspicious-missing-comma.SizeThreshold + value: '5' + - key: readability-inconsistent-declaration-parameter-name.IgnoreMacros + value: 'true' + - key: readability-identifier-naming.IgnoreFailedSplit + value: 'false' + - key: modernize-pass-by-value.IncludeStyle + value: llvm + - key: bugprone-sizeof-expression.WarnOnSizeOfThis + value: 'true' + - key: readability-qualified-auto.AddConstToQualified + value: 'true' + - key: bugprone-string-constructor.WarnOnLargeLength + value: 'true' + - key: bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit + value: '16' + - key: readability-simplify-boolean-expr.ChainedConditionalReturn + value: 'false' + - key: cppcoreguidelines-explicit-virtual-functions.OverrideSpelling + value: override + - key: readability-else-after-return.WarnOnConditionVariables + value: 'true' + - key: readability-uppercase-literal-suffix.IgnoreMacros + value: 'true' + - key: modernize-use-nullptr.NullMacros + value: 'NULL' + - key: modernize-make-shared.IgnoreMacros + value: 'true' + - key: bugprone-dynamic-static-initializers.HeaderFileExtensions + value: ';h;hh;hpp;hxx' + - key: bugprone-suspicious-enum-usage.StrictMode + value: 'false' + - key: performance-unnecessary-copy-initialization.AllowedTypes + value: '' + - key: bugprone-suspicious-missing-comma.MaxConcatenatedTokens + value: '5' + - key: modernize-use-transparent-functors.SafeMode + value: 'false' + - key: cppcoreguidelines-macro-usage.AllowedRegexp + value: '^DEBUG_*' + - key: modernize-make-shared.IgnoreDefaultInitialization + value: 'true' + - key: bugprone-argument-comment.CommentCharacterLiterals + value: '0' + - key: cppcoreguidelines-narrowing-conversions.PedanticMode + value: 'false' + - key: bugprone-not-null-terminated-result.WantToUseSafeFunctions + value: 'true' + - key: modernize-make-shared.IncludeStyle + value: llvm + - key: bugprone-string-constructor.LargeLengthThreshold + value: '8388608' + - key: readability-simplify-boolean-expr.ChainedConditionalAssignment + value: 'false' + - key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions + value: 'false' + - key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField + value: '0' + - key: bugprone-exception-escape.FunctionsThatShouldNotThrow + value: '' + - key: bugprone-signed-char-misuse.CharTypdefsToIgnore + value: '' + - key: performance-inefficient-vector-operation.EnableProto + value: 'false' + - key: modernize-loop-convert.MaxCopySize + value: '16' + - key: bugprone-argument-comment.CommentFloatLiterals + value: '0' + - key: readability-function-size.LineThreshold + value: '4294967295' + - key: portability-simd-intrinsics.Suggest + value: 'false' + - key: modernize-make-shared.MakeSmartPtrFunction + value: 'std::make_shared' + - key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors + value: 'true' + - key: cppcoreguidelines-pro-bounds-constant-array-index.GslHeader + value: '' + - key: modernize-make-unique.IgnoreMacros + value: 'true' + - key: modernize-make-shared.MakeSmartPtrFunctionHeader + value: '' + - key: performance-for-range-copy.AllowedTypes + value: '' + - key: modernize-use-override.IgnoreDestructors + value: 'false' + - key: bugprone-sizeof-expression.WarnOnSizeOfConstant + value: 'true' + - key: readability-redundant-string-init.StringNames + value: '::std::basic_string_view;::std::basic_string' + - key: modernize-make-unique.IgnoreDefaultInitialization + value: 'true' + - key: modernize-use-emplace.ContainersWithPushBack + value: '::std::vector;::std::list;::std::deque' + - key: modernize-make-unique.IncludeStyle + value: llvm + - key: readability-braces-around-statements.ShortStatementLines + value: '0' + - key: bugprone-argument-comment.CommentUserDefinedLiterals + value: '0' + - key: bugprone-argument-comment.CommentBoolLiterals + value: '0' + - key: modernize-use-override.OverrideSpelling + value: override + - key: performance-inefficient-string-concatenation.StrictMode + value: 'false' + - key: readability-implicit-bool-conversion.AllowPointerConditions + value: 'false' + - key: readability-redundant-declaration.IgnoreMacros + value: 'true' + - key: google-readability-braces-around-statements.ShortStatementLines + value: '1' + - key: modernize-make-unique.MakeSmartPtrFunction + value: 'std::make_unique' + - key: cppcoreguidelines-pro-type-member-init.IgnoreArrays + value: 'false' + - key: readability-else-after-return.WarnOnUnfixable + value: 'true' + - key: bugprone-reserved-identifier.AllowedIdentifiers + value: '' + - key: modernize-use-emplace.IgnoreImplicitConstructors + value: 'false' + - key: modernize-make-unique.MakeSmartPtrFunctionHeader + value: '' + - key: portability-restrict-system-includes.Includes + value: '*' + - key: modernize-use-equals-delete.IgnoreMacros + value: 'true' + - key: cppcoreguidelines-pro-bounds-constant-array-index.IncludeStyle + value: llvm + - key: cppcoreguidelines-macro-usage.IgnoreCommandLineMacros + value: 'true' + - key: bugprone-misplaced-widening-cast.CheckImplicitCasts + value: 'false' + - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnorePublicMemberVariables + value: 'false' + - key: modernize-loop-convert.MinConfidence + value: reasonable + - key: performance-unnecessary-value-param.AllowedTypes + value: '' + - key: bugprone-suspicious-missing-comma.RatioThreshold + value: '0.200000' + - key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctionsWhenCopyIsDeleted + value: 'false' + - key: readability-uppercase-literal-suffix.NewSuffixes + value: '' + - key: google-readability-namespace-comments.SpacesBeforeComments + value: '2' + - key: readability-function-cognitive-complexity.Threshold + value: '25' + - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic + value: 'true' + - key: bugprone-argument-comment.IgnoreSingleArgument + value: '0' + - key: cppcoreguidelines-no-malloc.Allocations + value: '::malloc;::calloc' + - key: modernize-use-noexcept.UseNoexceptFalse + value: 'true' + - key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression + value: 'false' + - key: performance-faster-string-find.StringLikeClasses + value: '::std::basic_string;::std::basic_string_view' + - key: bugprone-assert-side-effect.CheckFunctionCalls + value: 'false' + - key: readability-function-size.BranchThreshold + value: '4294967295' + - key: bugprone-string-constructor.StringNames + value: '::std::basic_string;::std::basic_string_view' + - key: bugprone-assert-side-effect.AssertMacros + value: assert + - key: bugprone-exception-escape.IgnoredExceptions + value: '' + - key: readability-function-size.StatementThreshold + value: '800' + - key: modernize-use-default-member-init.IgnoreMacros + value: 'true' + - key: llvm-qualified-auto.AddConstToQualified + value: '0' + - key: bugprone-argument-comment.CommentStringLiterals + value: '0' + - key: readability-identifier-naming.IgnoreMainLikeFunctions + value: 'false' + - key: bugprone-signed-char-misuse.DiagnoseSignedUnsignedCharComparisons + value: 'true' + - key: readability-implicit-bool-conversion.AllowIntegerConditions + value: 'false' + - key: cppcoreguidelines-init-variables.MathHeader + value: '' + - key: google-readability-function-size.StatementThreshold + value: '800' + - key: llvm-else-after-return.WarnOnConditionVariables + value: '0' + - key: bugprone-sizeof-expression.WarnOnSizeOfCompareToConstant + value: 'true' + - key: bugprone-reserved-identifier.AggressiveDependentMemberLookup + value: 'false' + - key: modernize-raw-string-literal.DelimiterStem + value: lit + - key: modernize-use-equals-default.IgnoreMacros + value: 'true' + - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor + value: 'false' + - key: modernize-raw-string-literal.ReplaceShorterLiterals + value: 'false' + - key: modernize-use-emplace.SmartPointers + value: '::std::shared_ptr;::std::unique_ptr;::std::auto_ptr;::std::weak_ptr' + - key: cppcoreguidelines-no-malloc.Deallocations + value: '::free' + - key: modernize-use-auto.RemoveStars + value: 'false' + - key: bugprone-dangling-handle.HandleClasses + value: 'std::basic_string_view;std::experimental::basic_string_view' + - key: performance-inefficient-vector-operation.VectorLikeClasses + value: '::std::vector' + - key: portability-simd-intrinsics.Std + value: '' + - key: performance-unnecessary-value-param.IncludeStyle + value: llvm + - key: readability-redundant-member-init.IgnoreBaseInCopyConstructors + value: 'false' + - key: modernize-replace-disallow-copy-and-assign-macro.MacroName + value: DISALLOW_COPY_AND_ASSIGN + - key: llvm-else-after-return.WarnOnUnfixable + value: '0' + - key: readability-simplify-subscript-expr.Types + value: '::std::basic_string;::std::basic_string_view;::std::vector;::std::array' +... diff --git a/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83.diff b/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83.diff new file mode 100644 index 0000000..1339c3c --- /dev/null +++ b/tests/capture_tools_output/chocolate-doom/chocolate-doom/67715d6e2725322e6132e9ff99b9a2a3f3b10c83.diff @@ -0,0 +1,593 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b73c7984c1..7f1eed09c6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -28,9 +28,21 @@ else() + "-Wredundant-decls") + endif() + ++option(ENABLE_SDL2_NET "Enable SDL2_net" On) ++option(ENABLE_SDL2_MIXER "Enable SDL2_mixer" On) ++ + find_package(SDL2 2.0.7) +-find_package(SDL2_mixer 2.0.2) +-find_package(SDL2_net 2.0.0) ++if(ENABLE_SDL2_MIXER) ++ find_package(SDL2_mixer 2.0.2) ++else() ++ add_compile_definitions(DISABLE_SDL2MIXER=1) ++endif() ++ ++if(ENABLE_SDL2_NET) ++ find_package(SDL2_net 2.0.0) ++else() ++ add_compile_definitions(DISABLE_SDL2NET=1) ++endif() + + # Check for libsamplerate. + find_package(samplerate) +diff --git a/configure.ac b/configure.ac +index 8ef1d65ad3..fd5d8bcecd 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -32,8 +32,23 @@ then + fi + + PKG_CHECK_MODULES(SDL, [sdl2 >= 2.0.7]) +-PKG_CHECK_MODULES(SDLMIXER, [SDL2_mixer >= 2.0.2]) +-PKG_CHECK_MODULES(SDLNET, [SDL2_net >= 2.0.0]) ++# Check for SDL2_mixer ++AC_ARG_ENABLE([sdl2mixer], ++AS_HELP_STRING([--disable-sdl2mixer], [Disable SDL2_mixer support]) ++) ++AS_IF([test "x$enable_sdl2mixer" != xno], [ ++ PKG_CHECK_MODULES(SDLMIXER, [SDL2_mixer >= 2.0.2])], [ ++ AC_DEFINE([DISABLE_SDL2MIXER], [1], [SDL2_mixer disabled]) ++]) ++ ++# Check for networking ++AC_ARG_ENABLE([sdl2net], ++AS_HELP_STRING([--disable-sdl2net], [Disable SDL2_net support]) ++) ++AS_IF([test "x$enable_sdl2net" != xno], [ ++ PKG_CHECK_MODULES(SDLNET, [SDL2_net >= 2.0.0])], [ ++ AC_DEFINE([DISABLE_SDL2NET], [1], [SDL2_net disabled]) ++]) + + # Check for bash-completion. + AC_ARG_ENABLE([bash-completion], +diff --git a/opl/CMakeLists.txt b/opl/CMakeLists.txt +index f88a12a155..151f7617dd 100644 +--- a/opl/CMakeLists.txt ++++ b/opl/CMakeLists.txt +@@ -12,4 +12,7 @@ add_library(opl STATIC + target_include_directories(opl + INTERFACE "." + PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../") +-target_link_libraries(opl SDL2::mixer) ++target_link_libraries(opl SDL2::SDL2) ++if(ENABLE_SDL2_mixer) ++ target_link_libraries(opl SDL2::mixer) ++endif() +diff --git a/opl/opl.c b/opl/opl.c +index a1aa1d95c7..8486dcab67 100644 +--- a/opl/opl.c ++++ b/opl/opl.c +@@ -50,7 +50,9 @@ static opl_driver_t *drivers[] = + #ifdef _WIN32 + &opl_win32_driver, + #endif ++#ifndef DISABLE_SDL2MIXER + &opl_sdl_driver, ++#endif // DISABLE_SDL2MIXER + NULL + }; + +diff --git a/opl/opl_sdl.c b/opl/opl_sdl.c +index fc71be318b..7d531ae43f 100644 +--- a/opl/opl_sdl.c ++++ b/opl/opl_sdl.c +@@ -33,6 +33,10 @@ + + #include "opl_queue.h" + ++ ++#ifndef DISABLE_SDL2MIXER ++ ++ + #define MAX_SOUND_SLICE_TIME 100 /* ms */ + + typedef struct +@@ -511,3 +515,5 @@ opl_driver_t opl_sdl_driver = + OPL_SDL_AdjustCallbacks, + }; + ++ ++#endif // DISABLE_SDL2MIXER +diff --git a/pcsound/CMakeLists.txt b/pcsound/CMakeLists.txt +index 7988b8bdf6..9924263aea 100644 +--- a/pcsound/CMakeLists.txt ++++ b/pcsound/CMakeLists.txt +@@ -8,4 +8,7 @@ add_library(pcsound STATIC + target_include_directories(pcsound + INTERFACE "." + PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../") +-target_link_libraries(pcsound SDL2::mixer) ++target_link_libraries(pcsound SDL2::SDL2) ++if(ENABLE_SDL2_mixer) ++ target_link_libraries(pcsound SDL2::mixer) ++endif() +diff --git a/pcsound/pcsound.c b/pcsound/pcsound.c +index c4dd97009a..4695c3780d 100644 +--- a/pcsound/pcsound.c ++++ b/pcsound/pcsound.c +@@ -56,7 +56,9 @@ static pcsound_driver_t *drivers[] = + #ifdef _WIN32 + &pcsound_win32_driver, + #endif ++#ifndef DISABLE_SDL2MIXER + &pcsound_sdl_driver, ++#endif // DISABLE_SDL2MIXER + NULL, + }; + +diff --git a/pcsound/pcsound_sdl.c b/pcsound/pcsound_sdl.c +index c25ac7f9ca..4f413fed46 100644 +--- a/pcsound/pcsound_sdl.c ++++ b/pcsound/pcsound_sdl.c +@@ -24,6 +24,10 @@ + #include "pcsound.h" + #include "pcsound_internal.h" + ++ ++#ifndef DISABLE_SDL2MIXER ++ ++ + #define MAX_SOUND_SLICE_TIME 70 /* ms */ + #define SQUARE_WAVE_AMP 0x2000 + +@@ -248,3 +252,5 @@ pcsound_driver_t pcsound_sdl_driver = + PCSound_SDL_Shutdown, + }; + ++ ++#endif // DISABLE_SDL2MIXER +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index b498ed29e9..bbb877641f 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -32,7 +32,10 @@ set(DEDSERV_FILES + add_executable("${PROGRAM_PREFIX}server" WIN32 ${COMMON_SOURCE_FILES} ${DEDSERV_FILES}) + target_include_directories("${PROGRAM_PREFIX}server" + PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../") +-target_link_libraries("${PROGRAM_PREFIX}server" SDL2::SDL2main SDL2::net) ++target_link_libraries("${PROGRAM_PREFIX}server" SDL2::SDL2main SDL2::SDL2) ++if(ENABLE_SDL2_NET) ++ target_link_libraries("${PROGRAM_PREFIX}server" SDL2::net) ++endif() + + # Source files used by the game binaries (chocolate-doom, etc.) + +@@ -121,7 +124,13 @@ set(DEHACKED_SOURCE_FILES + set(SOURCE_FILES ${COMMON_SOURCE_FILES} ${GAME_SOURCE_FILES}) + set(SOURCE_FILES_WITH_DEH ${SOURCE_FILES} ${DEHACKED_SOURCE_FILES}) + +-set(EXTRA_LIBS SDL2::SDL2main SDL2::SDL2 SDL2::mixer SDL2::net textscreen pcsound opl) ++set(EXTRA_LIBS SDL2::SDL2main SDL2::SDL2 textscreen pcsound opl) ++if(ENABLE_SDL2_MIXER) ++ list(APPEND EXTRA_LIBS SDL2::mixer) ++endif() ++if(ENABLE_SDL2_NET) ++ list(APPEND EXTRA_LIBS SDL2::net) ++endif() + if(SAMPLERATE_FOUND) + list(APPEND EXTRA_LIBS samplerate::samplerate) + endif() +@@ -213,7 +222,13 @@ endif() + + target_include_directories("${PROGRAM_PREFIX}setup" + PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../") +-target_link_libraries("${PROGRAM_PREFIX}setup" SDL2::SDL2main SDL2::SDL2 SDL2::mixer SDL2::net setup textscreen) ++target_link_libraries("${PROGRAM_PREFIX}setup" SDL2::SDL2main SDL2::SDL2 setup textscreen) ++if(ENABLE_SDL2_mixer) ++ target_link_libraries("${PROGRAM_PREFIX}setup" SDL2::mixer) ++endif() ++if(ENABLE_SDL2_NET) ++ target_link_libraries("${PROGRAM_PREFIX}setup" SDL2::net) ++endif() + + if(MSVC) + set_target_properties("${PROGRAM_PREFIX}setup" PROPERTIES +diff --git a/src/doom/CMakeLists.txt b/src/doom/CMakeLists.txt +index 0310910af4..82b114b417 100644 +--- a/src/doom/CMakeLists.txt ++++ b/src/doom/CMakeLists.txt +@@ -68,4 +68,10 @@ add_library(doom STATIC + wi_stuff.c wi_stuff.h) + + target_include_directories(doom PRIVATE "../" "${CMAKE_CURRENT_BINARY_DIR}/../../") +-target_link_libraries(doom SDL2::SDL2 SDL2::mixer SDL2::net) ++target_link_libraries(doom SDL2::SDL2) ++if(ENABLE_SDL2_mixer) ++ target_link_libraries(doom SDL2::mixer) ++endif() ++if(ENABLE_SDL2_NET) ++ target_link_libraries(doom SDL2::net) ++endif() +diff --git a/src/heretic/CMakeLists.txt b/src/heretic/CMakeLists.txt +index 9f12bde0e4..1ea060bfdb 100644 +--- a/src/heretic/CMakeLists.txt ++++ b/src/heretic/CMakeLists.txt +@@ -54,4 +54,10 @@ add_library(heretic STATIC + s_sound.c s_sound.h) + + target_include_directories(heretic PRIVATE "../" "${CMAKE_CURRENT_BINARY_DIR}/../../") +-target_link_libraries(heretic textscreen SDL2::SDL2 SDL2::mixer SDL2::net) ++target_link_libraries(heretic textscreen SDL2::SDL2) ++if(ENABLE_SDL2_mixer) ++ target_link_libraries(heretic SDL2::mixer) ++endif() ++if(ENABLE_SDL2_NET) ++ target_link_libraries(heretic SDL2::net) ++endif() +diff --git a/src/hexen/CMakeLists.txt b/src/hexen/CMakeLists.txt +index 6b4beed224..0dbd170bfd 100644 +--- a/src/hexen/CMakeLists.txt ++++ b/src/hexen/CMakeLists.txt +@@ -55,4 +55,10 @@ add_library(hexen STATIC + xddefs.h) + + target_include_directories(hexen PRIVATE "../" "${CMAKE_CURRENT_BINARY_DIR}/../../") +-target_link_libraries(hexen SDL2::SDL2 SDL2::mixer SDL2::net) ++target_link_libraries(hexen SDL2::SDL2) ++if(ENABLE_SDL2_mixer) ++ target_link_libraries(hexen SDL2::mixer) ++endif() ++if(ENABLE_SDL2_NET) ++ target_link_libraries(hexen SDL2::net) ++endif() +diff --git a/src/i_musicpack.c b/src/i_musicpack.c +index da1b88f336..f2f6214669 100644 +--- a/src/i_musicpack.c ++++ b/src/i_musicpack.c +@@ -44,6 +44,13 @@ + #include "w_wad.h" + #include "z_zone.h" + ++ ++char *music_pack_path = ""; ++ ++ ++#ifndef DISABLE_SDL2MIXER ++ ++ + #define MID_HEADER_MAGIC "MThd" + #define MUS_HEADER_MAGIC "MUS\x1a" + +@@ -99,7 +106,6 @@ static boolean music_initialized = false; + + static boolean sdl_was_initialized = false; + +-char *music_pack_path = ""; + + // If true, we are playing a substitute digital track rather than in-WAD + // MIDI/MUS track, and file_metadata contains loop metadata. +@@ -1375,3 +1381,83 @@ music_module_t music_pack_module = + I_MP_PollMusic, + }; + ++ ++#else // DISABLE_SDL2MIXER ++ ++ ++static boolean I_NULL_InitMusic(void) ++{ ++ return false; ++} ++ ++ ++static void I_NULL_ShutdownMusic(void) ++{ ++} ++ ++ ++static void I_NULL_SetMusicVolume(int volume) ++{ ++} ++ ++ ++static void I_NULL_PauseSong(void) ++{ ++} ++ ++ ++static void I_NULL_ResumeSong(void) ++{ ++} ++ ++ ++static void *I_NULL_RegisterSong(void *data, int len) ++{ ++ return NULL; ++} ++ ++ ++static void I_NULL_UnRegisterSong(void *handle) ++{ ++} ++ ++ ++static void I_NULL_PlaySong(void *handle, boolean looping) ++{ ++} ++ ++ ++static void I_NULL_StopSong(void) ++{ ++} ++ ++ ++static boolean I_NULL_MusicIsPlaying(void) ++{ ++ return false; ++} ++ ++ ++static void I_NULL_PollMusic(void) ++{ ++} ++ ++music_module_t music_pack_module = ++{ ++ NULL, ++ 0, ++ I_NULL_InitMusic, ++ I_NULL_ShutdownMusic, ++ I_NULL_SetMusicVolume, ++ I_NULL_PauseSong, ++ I_NULL_ResumeSong, ++ I_NULL_RegisterSong, ++ I_NULL_UnRegisterSong, ++ I_NULL_PlaySong, ++ I_NULL_StopSong, ++ I_NULL_MusicIsPlaying, ++ I_NULL_PollMusic, ++}; ++ ++ ++#endif // DISABLE_SDL2MIXER +diff --git a/src/i_sdlmusic.c b/src/i_sdlmusic.c +index 277576a812..d840714101 100644 +--- a/src/i_sdlmusic.c ++++ b/src/i_sdlmusic.c +@@ -44,19 +44,6 @@ + #include "w_wad.h" + #include "z_zone.h" + +-#define MAXMIDLENGTH (96 * 1024) +- +-static boolean music_initialized = false; +- +-// If this is true, this module initialized SDL sound and has the +-// responsibility to shut it down +- +-static boolean sdl_was_initialized = false; +- +-static boolean win_midi_stream_opened = false; +- +-static boolean musicpaused = false; +-static int current_music_volume; + + char *fluidsynth_sf_path = ""; + char *timidity_cfg_path = ""; +@@ -138,6 +125,25 @@ void I_InitTimidityConfig(void) + } + } + ++ ++#ifndef DISABLE_SDL2MIXER ++ ++ ++#define MAXMIDLENGTH (96 * 1024) ++ ++static boolean music_initialized = false; ++ ++// If this is true, this module initialized SDL sound and has the ++// responsibility to shut it down ++ ++static boolean sdl_was_initialized = false; ++ ++static boolean win_midi_stream_opened = false; ++ ++static boolean musicpaused = false; ++static int current_music_volume; ++ ++ + // Remove the temporary config file generated by I_InitTimidityConfig(). + + static void RemoveTimidityConfig(void) +@@ -588,3 +594,5 @@ music_module_t music_sdl_module = + NULL, // Poll + }; + ++ ++#endif // DISABLE_SDL2MIXER +diff --git a/src/i_sdlsound.c b/src/i_sdlsound.c +index a28e06bb1b..2d3186e864 100644 +--- a/src/i_sdlsound.c ++++ b/src/i_sdlsound.c +@@ -41,6 +41,21 @@ + + #include "doomtype.h" + ++ ++int use_libsamplerate = 0; ++ ++// Scale factor used when converting libsamplerate floating point numbers ++// to integers. Too high means the sounds can clip; too low means they ++// will be too quiet. This is an amount that should avoid clipping most ++// of the time: with all the Doom IWAD sound effects, at least. If a PWAD ++// is used, clipping might occur. ++ ++float libsamplerate_scale = 0.65f; ++ ++ ++#ifndef DISABLE_SDL2MIXER ++ ++ + #define LOW_PASS_FILTER + //#define DEBUG_DUMP_WAVS + #define NUM_CHANNELS 16 +@@ -77,15 +92,6 @@ static allocated_sound_t *allocated_sounds_head = NULL; + static allocated_sound_t *allocated_sounds_tail = NULL; + static int allocated_sounds_size = 0; + +-int use_libsamplerate = 0; +- +-// Scale factor used when converting libsamplerate floating point numbers +-// to integers. Too high means the sounds can clip; too low means they +-// will be too quiet. This is an amount that should avoid clipping most +-// of the time: with all the Doom IWAD sound effects, at least. If a PWAD +-// is used, clipping might occur. +- +-float libsamplerate_scale = 0.65f; + + // Hook a sound into the linked list at the head. + +@@ -1135,3 +1141,5 @@ sound_module_t sound_sdl_module = + I_SDL_PrecacheSounds, + }; + ++ ++#endif // DISABLE_SDL2MIXER +diff --git a/src/i_sound.c b/src/i_sound.c +index 29f4f695b3..66fc39e8e5 100644 +--- a/src/i_sound.c ++++ b/src/i_sound.c +@@ -99,7 +99,9 @@ static int snd_mport = 0; + + static sound_module_t *sound_modules[] = + { ++#ifndef DISABLE_SDL2MIXER + &sound_sdl_module, ++#endif // DISABLE_SDL2MIXER + &sound_pcsound_module, + NULL, + }; +@@ -108,7 +110,9 @@ static sound_module_t *sound_modules[] = + + static music_module_t *music_modules[] = + { ++#ifndef DISABLE_SDL2MIXER + &music_sdl_module, ++#endif // DISABLE_SDL2MIXER + &music_opl_module, + NULL, + }; +diff --git a/src/net_sdl.c b/src/net_sdl.c +index c9b3e81f36..2965f42340 100644 +--- a/src/net_sdl.c ++++ b/src/net_sdl.c +@@ -33,6 +33,10 @@ + // NETWORKING + // + ++ ++#ifndef DISABLE_SDL2NET ++ ++ + #include + + #define DEFAULT_PORT 2342 +@@ -376,3 +380,62 @@ net_module_t net_sdl_module = + NET_SDL_ResolveAddress, + }; + ++ ++#else // DISABLE_SDL2NET ++ ++// no-op implementation ++ ++ ++static boolean NET_NULL_InitClient(void) ++{ ++ return false; ++} ++ ++ ++static boolean NET_NULL_InitServer(void) ++{ ++ return false; ++} ++ ++ ++static void NET_NULL_SendPacket(net_addr_t *addr, net_packet_t *packet) ++{ ++} ++ ++ ++static boolean NET_NULL_RecvPacket(net_addr_t **addr, net_packet_t **packet) ++{ ++ return false; ++} ++ ++ ++static void NET_NULL_AddrToString(net_addr_t *addr, char *buffer, int buffer_len) ++{ ++ ++} ++ ++ ++static void NET_NULL_FreeAddress(net_addr_t *addr) ++{ ++} ++ ++ ++net_addr_t *NET_NULL_ResolveAddress(const char *address) ++{ ++ return NULL; ++} ++ ++ ++net_module_t net_sdl_module = ++{ ++ NET_NULL_InitClient, ++ NET_NULL_InitServer, ++ NET_NULL_SendPacket, ++ NET_NULL_RecvPacket, ++ NET_NULL_AddrToString, ++ NET_NULL_FreeAddress, ++ NET_NULL_ResolveAddress, ++}; ++ ++ ++#endif // DISABLE_SDL2NET +diff --git a/src/setup/CMakeLists.txt b/src/setup/CMakeLists.txt +index 4c27a07ce5..90df211416 100644 +--- a/src/setup/CMakeLists.txt ++++ b/src/setup/CMakeLists.txt +@@ -15,4 +15,7 @@ add_library(setup STATIC + txt_mouseinput.c txt_mouseinput.h) + + target_include_directories(setup PRIVATE "../" "${CMAKE_CURRENT_BINARY_DIR}/../../") +-target_link_libraries(setup textscreen SDL2::SDL2 SDL2::mixer) ++target_link_libraries(setup textscreen SDL2::SDL2) ++if(ENABLE_SDL2_mixer) ++ target_link_libraries(setup SDL2::mixer) ++endif() +diff --git a/src/strife/CMakeLists.txt b/src/strife/CMakeLists.txt +index 06b17a6bd7..37b17ade98 100644 +--- a/src/strife/CMakeLists.txt ++++ b/src/strife/CMakeLists.txt +@@ -70,4 +70,10 @@ set(STRIFE_SOURCES + add_library(strife STATIC ${STRIFE_SOURCES}) + + target_include_directories(strife PRIVATE "../" "../../win32/" "${CMAKE_CURRENT_BINARY_DIR}/../../") +-target_link_libraries(strife textscreen SDL2::SDL2 SDL2::mixer SDL2::net) ++target_link_libraries(strife textscreen SDL2::SDL2) ++if(ENABLE_SDL2_mixer) ++ target_link_libraries(strife SDL2::mixer) ++endif() ++if(ENABLE_SDL2_NET) ++ target_link_libraries(strife SDL2::net) ++endif() diff --git a/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d.diff b/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d.diff new file mode 100644 index 0000000..6185435 --- /dev/null +++ b/tests/capture_tools_output/chocolate-doom/chocolate-doom/71091562db5b0e7853d08ffa2f110af49cc3bc0d.diff @@ -0,0 +1,107 @@ +diff --git a/src/hexen/info.c b/src/hexen/info.c +index e0dbf5004..e88433a4c 100644 +--- a/src/hexen/info.c ++++ b/src/hexen/info.c +@@ -143,7 +143,6 @@ void A_ShedShard(mobj_t *actor); + void A_AddPlayerCorpse(mobj_t *actor); + void A_SkullPop(mobj_t *actor); + void A_FreezeDeath(mobj_t *actor); +-void A_FreezeDeathChunks(mobj_t *actor); + void A_CheckBurnGone(mobj_t *actor); + void A_CheckSkullFloor(mobj_t *actor); + void A_CheckSkullDone(mobj_t *actor); +@@ -180,7 +179,6 @@ void A_WraithMissile(mobj_t *actor); + void A_WraithFX2(mobj_t *actor); + void A_MinotaurFade1(mobj_t *actor); + void A_MinotaurFade2(mobj_t *actor); +-void A_MinotaurLook(mobj_t *actor); + void A_MinotaurChase(mobj_t *actor); + void A_MinotaurRoam(mobj_t *actor); + void A_MinotaurAtk1(mobj_t *actor); +@@ -250,14 +248,7 @@ void A_FastChase(mobj_t *actor); + void A_FighterAttack(mobj_t *actor); + void A_ClericAttack(mobj_t *actor); + void A_MageAttack(mobj_t *actor); +-void A_SorcSpinBalls(mobj_t *actor); +-void A_SpeedBalls(mobj_t *actor); +-void A_SpawnFizzle(mobj_t *actor); +-void A_SorcBossAttack(mobj_t *actor); +-void A_SorcBallOrbit(mobj_t *actor); + void A_SorcBallPop(mobj_t *actor); +-void A_BounceCheck(mobj_t *actor); +-void A_SorcFX1Seek(mobj_t *actor); + void A_SorcFX2Split(mobj_t *actor); + void A_SorcFX2Orbit(mobj_t *actor); + void A_SorcererBishopEntry(mobj_t *actor); +diff --git a/src/hexen/p_enemy.c b/src/hexen/p_enemy.c +index 080476ad8..c5a4ee694 100644 +--- a/src/hexen/p_enemy.c ++++ b/src/hexen/p_enemy.c +@@ -1102,7 +1102,6 @@ void A_MinotaurFade2(mobj_t * actor) + // + //---------------------------------------------------------------------------- + +-void A_MinotaurLook(mobj_t * actor); + + // Check the age of the minotaur and stomp it after MAULATORTICS of time + // have passed. Returns false if killed. +@@ -3854,8 +3853,6 @@ void A_IceGuyMissilePuff(mobj_t * actor) + + void A_IceGuyDie(mobj_t * actor) + { +- void A_FreezeDeathChunks(mobj_t * actor); +- + actor->momx = 0; + actor->momy = 0; + actor->momz = 0; +@@ -3932,22 +3929,6 @@ void A_IceGuyMissileExplode(mobj_t * actor) + #define BALL2_ANGLEOFFSET (ANG_MAX/3) + #define BALL3_ANGLEOFFSET ((ANG_MAX/3)*2) + +-void A_SorcBallOrbit(mobj_t * actor); +-void A_SorcSpinBalls(mobj_t * actor); +-void A_SpeedBalls(mobj_t * actor); +-void A_SlowBalls(mobj_t * actor); +-void A_StopBalls(mobj_t * actor); +-void A_AccelBalls(mobj_t * actor); +-void A_DecelBalls(mobj_t * actor); +-void A_SorcBossAttack(mobj_t * actor); +-void A_SpawnFizzle(mobj_t * actor); +-void A_CastSorcererSpell(mobj_t * actor); +-void A_SorcUpdateBallAngle(mobj_t * actor); +-void A_BounceCheck(mobj_t * actor); +-void A_SorcFX1Seek(mobj_t * actor); +-void A_SorcOffense1(mobj_t * actor); +-void A_SorcOffense2(mobj_t * actor); +- + + // Spawn spinning balls above head - actor is sorcerer + void A_SorcSpinBalls(mobj_t * actor) +diff --git a/src/hexen/p_local.h b/src/hexen/p_local.h +index 158556c41..f7bcf5735 100644 +--- a/src/hexen/p_local.h ++++ b/src/hexen/p_local.h +@@ -194,6 +194,23 @@ void A_Explode(mobj_t *actor); + void A_CHolyAttack3(mobj_t *actor); + void A_FSwordAttack2(mobj_t *actor); + void A_MStaffAttack2(mobj_t *actor); ++void A_FreezeDeathChunks(mobj_t *actor); ++void A_SorcBallOrbit(mobj_t *actor); ++void A_SorcSpinBalls(mobj_t *actor); ++void A_SpeedBalls(mobj_t *actor); ++void A_SlowBalls(mobj_t *actor); ++void A_StopBalls(mobj_t *actor); ++void A_AccelBalls(mobj_t *actor); ++void A_DecelBalls(mobj_t *actor); ++void A_SorcBossAttack(mobj_t *actor); ++void A_SpawnFizzle(mobj_t *actor); ++void A_CastSorcererSpell(mobj_t *actor); ++void A_SorcUpdateBallAngle(mobj_t *actor); ++void A_BounceCheck(mobj_t *actor); ++void A_SorcFX1Seek(mobj_t *actor); ++void A_SorcOffense1(mobj_t *actor); ++void A_SorcOffense2(mobj_t *actor); ++void A_MinotaurLook(mobj_t *actor); + + + // ***** P_MAPUTL ***** diff --git a/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_67715d-0.json b/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_67715d-0.json new file mode 100644 index 0000000..366dbd9 --- /dev/null +++ b/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_67715d-0.json @@ -0,0 +1,239 @@ +[ + { + "filename": "opl/opl.c", + "line_filter": { + "diff_chunks": [ + [ + 50, + 59 + ] + ], + "lines_added": [ + [ + 53, + 54 + ], + [ + 55, + 56 + ] + ] + } + }, + { + "filename": "opl/opl_sdl.c", + "line_filter": { + "diff_chunks": [ + [ + 33, + 43 + ], + [ + 515, + 520 + ] + ], + "lines_added": [ + [ + 36, + 40 + ], + [ + 518, + 520 + ] + ] + } + }, + { + "filename": "pcsound/pcsound.c", + "line_filter": { + "diff_chunks": [ + [ + 56, + 65 + ] + ], + "lines_added": [ + [ + 59, + 60 + ], + [ + 61, + 62 + ] + ] + } + }, + { + "filename": "pcsound/pcsound_sdl.c", + "line_filter": { + "diff_chunks": [ + [ + 24, + 34 + ], + [ + 252, + 257 + ] + ], + "lines_added": [ + [ + 27, + 31 + ], + [ + 255, + 257 + ] + ] + } + }, + { + "filename": "src/i_musicpack.c", + "line_filter": { + "diff_chunks": [ + [ + 44, + 57 + ], + [ + 106, + 112 + ], + [ + 1381, + 1464 + ] + ], + "lines_added": [ + [ + 47, + 54 + ], + [ + 1384, + 1464 + ] + ] + } + }, + { + "filename": "src/i_sdlmusic.c", + "line_filter": { + "diff_chunks": [ + [ + 44, + 50 + ], + [ + 125, + 150 + ], + [ + 594, + 599 + ] + ], + "lines_added": [ + [ + 128, + 147 + ], + [ + 597, + 599 + ] + ] + } + }, + { + "filename": "src/i_sdlsound.c", + "line_filter": { + "diff_chunks": [ + [ + 41, + 62 + ], + [ + 92, + 98 + ], + [ + 1141, + 1146 + ] + ], + "lines_added": [ + [ + 44, + 59 + ], + [ + 1144, + 1146 + ] + ] + } + }, + { + "filename": "src/i_sound.c", + "line_filter": { + "diff_chunks": [ + [ + 99, + 108 + ], + [ + 110, + 119 + ] + ], + "lines_added": [ + [ + 102, + 103 + ], + [ + 104, + 105 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ] + ] + } + }, + { + "filename": "src/net_sdl.c", + "line_filter": { + "diff_chunks": [ + [ + 33, + 43 + ], + [ + 380, + 442 + ] + ], + "lines_added": [ + [ + 36, + 40 + ], + [ + 383, + 442 + ] + ] + } + } +] diff --git a/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_67715d-1.json b/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_67715d-1.json new file mode 100644 index 0000000..366dbd9 --- /dev/null +++ b/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_67715d-1.json @@ -0,0 +1,239 @@ +[ + { + "filename": "opl/opl.c", + "line_filter": { + "diff_chunks": [ + [ + 50, + 59 + ] + ], + "lines_added": [ + [ + 53, + 54 + ], + [ + 55, + 56 + ] + ] + } + }, + { + "filename": "opl/opl_sdl.c", + "line_filter": { + "diff_chunks": [ + [ + 33, + 43 + ], + [ + 515, + 520 + ] + ], + "lines_added": [ + [ + 36, + 40 + ], + [ + 518, + 520 + ] + ] + } + }, + { + "filename": "pcsound/pcsound.c", + "line_filter": { + "diff_chunks": [ + [ + 56, + 65 + ] + ], + "lines_added": [ + [ + 59, + 60 + ], + [ + 61, + 62 + ] + ] + } + }, + { + "filename": "pcsound/pcsound_sdl.c", + "line_filter": { + "diff_chunks": [ + [ + 24, + 34 + ], + [ + 252, + 257 + ] + ], + "lines_added": [ + [ + 27, + 31 + ], + [ + 255, + 257 + ] + ] + } + }, + { + "filename": "src/i_musicpack.c", + "line_filter": { + "diff_chunks": [ + [ + 44, + 57 + ], + [ + 106, + 112 + ], + [ + 1381, + 1464 + ] + ], + "lines_added": [ + [ + 47, + 54 + ], + [ + 1384, + 1464 + ] + ] + } + }, + { + "filename": "src/i_sdlmusic.c", + "line_filter": { + "diff_chunks": [ + [ + 44, + 50 + ], + [ + 125, + 150 + ], + [ + 594, + 599 + ] + ], + "lines_added": [ + [ + 128, + 147 + ], + [ + 597, + 599 + ] + ] + } + }, + { + "filename": "src/i_sdlsound.c", + "line_filter": { + "diff_chunks": [ + [ + 41, + 62 + ], + [ + 92, + 98 + ], + [ + 1141, + 1146 + ] + ], + "lines_added": [ + [ + 44, + 59 + ], + [ + 1144, + 1146 + ] + ] + } + }, + { + "filename": "src/i_sound.c", + "line_filter": { + "diff_chunks": [ + [ + 99, + 108 + ], + [ + 110, + 119 + ] + ], + "lines_added": [ + [ + 102, + 103 + ], + [ + 104, + 105 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ] + ] + } + }, + { + "filename": "src/net_sdl.c", + "line_filter": { + "diff_chunks": [ + [ + 33, + 43 + ], + [ + 380, + 442 + ] + ], + "lines_added": [ + [ + 36, + 40 + ], + [ + 383, + 442 + ] + ] + } + } +] diff --git a/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_67715d-2.json b/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_67715d-2.json new file mode 100644 index 0000000..366dbd9 --- /dev/null +++ b/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_67715d-2.json @@ -0,0 +1,239 @@ +[ + { + "filename": "opl/opl.c", + "line_filter": { + "diff_chunks": [ + [ + 50, + 59 + ] + ], + "lines_added": [ + [ + 53, + 54 + ], + [ + 55, + 56 + ] + ] + } + }, + { + "filename": "opl/opl_sdl.c", + "line_filter": { + "diff_chunks": [ + [ + 33, + 43 + ], + [ + 515, + 520 + ] + ], + "lines_added": [ + [ + 36, + 40 + ], + [ + 518, + 520 + ] + ] + } + }, + { + "filename": "pcsound/pcsound.c", + "line_filter": { + "diff_chunks": [ + [ + 56, + 65 + ] + ], + "lines_added": [ + [ + 59, + 60 + ], + [ + 61, + 62 + ] + ] + } + }, + { + "filename": "pcsound/pcsound_sdl.c", + "line_filter": { + "diff_chunks": [ + [ + 24, + 34 + ], + [ + 252, + 257 + ] + ], + "lines_added": [ + [ + 27, + 31 + ], + [ + 255, + 257 + ] + ] + } + }, + { + "filename": "src/i_musicpack.c", + "line_filter": { + "diff_chunks": [ + [ + 44, + 57 + ], + [ + 106, + 112 + ], + [ + 1381, + 1464 + ] + ], + "lines_added": [ + [ + 47, + 54 + ], + [ + 1384, + 1464 + ] + ] + } + }, + { + "filename": "src/i_sdlmusic.c", + "line_filter": { + "diff_chunks": [ + [ + 44, + 50 + ], + [ + 125, + 150 + ], + [ + 594, + 599 + ] + ], + "lines_added": [ + [ + 128, + 147 + ], + [ + 597, + 599 + ] + ] + } + }, + { + "filename": "src/i_sdlsound.c", + "line_filter": { + "diff_chunks": [ + [ + 41, + 62 + ], + [ + 92, + 98 + ], + [ + 1141, + 1146 + ] + ], + "lines_added": [ + [ + 44, + 59 + ], + [ + 1144, + 1146 + ] + ] + } + }, + { + "filename": "src/i_sound.c", + "line_filter": { + "diff_chunks": [ + [ + 99, + 108 + ], + [ + 110, + 119 + ] + ], + "lines_added": [ + [ + 102, + 103 + ], + [ + 104, + 105 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ] + ] + } + }, + { + "filename": "src/net_sdl.c", + "line_filter": { + "diff_chunks": [ + [ + 33, + 43 + ], + [ + 380, + 442 + ] + ], + "lines_added": [ + [ + 36, + 40 + ], + [ + 383, + 442 + ] + ] + } + } +] diff --git a/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_710915-0.json b/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_710915-0.json new file mode 100644 index 0000000..3f52f6c --- /dev/null +++ b/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_710915-0.json @@ -0,0 +1,59 @@ +[ + { + "filename": "src/hexen/info.c", + "line_filter": { + "diff_chunks": [ + [ + 143, + 149 + ], + [ + 179, + 185 + ], + [ + 248, + 255 + ] + ], + "lines_added": [] + } + }, + { + "filename": "src/hexen/p_enemy.c", + "line_filter": { + "diff_chunks": [ + [ + 1102, + 1108 + ], + [ + 3853, + 3859 + ], + [ + 3929, + 3935 + ] + ], + "lines_added": [] + } + }, + { + "filename": "src/hexen/p_local.h", + "line_filter": { + "diff_chunks": [ + [ + 194, + 217 + ] + ], + "lines_added": [ + [ + 197, + 214 + ] + ] + } + } +] diff --git a/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_710915-1.json b/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_710915-1.json new file mode 100644 index 0000000..3f52f6c --- /dev/null +++ b/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_710915-1.json @@ -0,0 +1,59 @@ +[ + { + "filename": "src/hexen/info.c", + "line_filter": { + "diff_chunks": [ + [ + 143, + 149 + ], + [ + 179, + 185 + ], + [ + 248, + 255 + ] + ], + "lines_added": [] + } + }, + { + "filename": "src/hexen/p_enemy.c", + "line_filter": { + "diff_chunks": [ + [ + 1102, + 1108 + ], + [ + 3853, + 3859 + ], + [ + 3929, + 3935 + ] + ], + "lines_added": [] + } + }, + { + "filename": "src/hexen/p_local.h", + "line_filter": { + "diff_chunks": [ + [ + 194, + 217 + ] + ], + "lines_added": [ + [ + 197, + 214 + ] + ] + } + } +] diff --git a/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_710915-2.json b/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_710915-2.json new file mode 100644 index 0000000..d3f1dcc --- /dev/null +++ b/tests/capture_tools_output/chocolate-doom/chocolate-doom/expected-result_710915-2.json @@ -0,0 +1,19 @@ +[ + { + "filename": "src/hexen/p_local.h", + "line_filter": { + "diff_chunks": [ + [ + 194, + 217 + ] + ], + "lines_added": [ + [ + 197, + 214 + ] + ] + } + } +] diff --git a/tests/capture_tools_output/cpp-linter/cpp-linter/950ff0b690e1903797c303c5fc8d9f3b52f1d3c5.diff b/tests/capture_tools_output/cpp-linter/cpp-linter/950ff0b690e1903797c303c5fc8d9f3b52f1d3c5.diff new file mode 100644 index 0000000..6544d4c --- /dev/null +++ b/tests/capture_tools_output/cpp-linter/cpp-linter/950ff0b690e1903797c303c5fc8d9f3b52f1d3c5.diff @@ -0,0 +1,5208 @@ +diff --git a/.gitattributes b/.gitattributes +new file mode 100644 +index 0000000..f7c5d6a +--- /dev/null ++++ b/.gitattributes +@@ -0,0 +1,10 @@ ++# Set the default behavior, in case people don't have core.autocrlf set. ++* text=auto ++ ++# Explicitly declare text files you want to always be normalized and converted ++# to native line endings on checkout. ++*.py text eol=lf ++*.rst text eol=lf ++*.sh text eol=lf ++*.cpp text eol=lf ++*.hpp text eol=lf +diff --git a/.github/stale.yml b/.github/stale.yml +new file mode 100644 +index 0000000..0d0b1c9 +--- /dev/null ++++ b/.github/stale.yml +@@ -0,0 +1 @@ ++_extends: .github +diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml +new file mode 100644 +index 0000000..33f08a3 +--- /dev/null ++++ b/.github/workflows/build-docs.yml +@@ -0,0 +1,33 @@ ++name: Docs ++ ++on: [push, workflow_dispatch] ++ ++jobs: ++ build: ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@v3 ++ ++ - uses: actions/setup-python@v4 ++ with: ++ python-version: 3.x ++ ++ - name: Install docs dependencies ++ run: pip install . -r docs/requirements.txt ++ ++ - name: Build docs ++ run: sphinx-build docs docs/_build/html ++ ++ - name: Deploy to gh-pages ++ uses: actions/upload-artifact@v3 ++ with: ++ name: "cpp-linter_docs" ++ path: ${{ github.workspace }}/docs/_build/html ++ ++ - name: upload to github pages ++ # only publish doc changes from main branch ++ if: github.ref == 'refs/heads/main' ++ uses: peaceiris/actions-gh-pages@v3 ++ with: ++ github_token: ${{ secrets.GITHUB_TOKEN }} ++ publish_dir: ./docs/_build/html +diff --git a/.github/workflows/pre-commit-hooks.yml b/.github/workflows/pre-commit-hooks.yml +new file mode 100644 +index 0000000..e9426fc +--- /dev/null ++++ b/.github/workflows/pre-commit-hooks.yml +@@ -0,0 +1,17 @@ ++name: Pre-commit ++ ++on: ++ push: ++ pull_request: ++ types: opened ++ ++jobs: ++ check-source-files: ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@v3 ++ - uses: actions/setup-python@v4 ++ with: ++ python-version: '3.x' ++ - run: python3 -m pip install pre-commit ++ - run: pre-commit run --all-files +diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml +new file mode 100644 +index 0000000..278717b +--- /dev/null ++++ b/.github/workflows/publish-pypi.yml +@@ -0,0 +1,51 @@ ++# This workflow will upload a Python Package using Twine when a release is created ++# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries ++ ++# This workflow uses actions that are not certified by GitHub. ++# They are provided by a third-party and are governed by ++# separate terms of service, privacy policy, and support ++# documentation. ++ ++name: Upload Python Package ++ ++on: ++ release: ++ branches: [master] ++ types: [published] ++ workflow_dispatch: ++ ++permissions: ++ contents: read ++ ++jobs: ++ deploy: ++ ++ runs-on: ubuntu-latest ++ ++ steps: ++ - uses: actions/checkout@v3 ++ # use fetch --all for setuptools_scm to work ++ with: ++ fetch-depth: 0 ++ - name: Set up Python ++ uses: actions/setup-python@v4 ++ with: ++ python-version: '3.x' ++ - name: Install dependencies ++ run: python -m pip install --upgrade pip twine ++ - name: Build wheel ++ run: python -m pip wheel -w dist --no-deps . ++ - name: Check distribution ++ run: twine check dist/* ++ - name: Publish package (to TestPyPI) ++ if: github.event_name == 'workflow_dispatch' && github.repository == 'cpp-linter/cpp-linter' ++ env: ++ TWINE_USERNAME: __token__ ++ TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }} ++ run: twine upload --repository testpypi dist/* ++ - name: Publish package (to PyPI) ++ if: github.event_name != 'workflow_dispatch' && github.repository == 'cpp-linter/cpp-linter' ++ env: ++ TWINE_USERNAME: __token__ ++ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} ++ run: twine upload dist/* +diff --git a/.github/workflows/run-dev-tests.yml b/.github/workflows/run-dev-tests.yml +new file mode 100644 +index 0000000..6c2dd88 +--- /dev/null ++++ b/.github/workflows/run-dev-tests.yml +@@ -0,0 +1,111 @@ ++name: "Check python code" ++ ++on: ++ push: ++ paths: ++ - "**.py" ++ - pyproject.toml ++ - ".github/workflows/run-dev-tests.yml" ++ pull_request: ++ types: opened ++ paths: ++ - "**.py" ++ - "**requirements*.txt" ++ - pyproject.toml ++ - ".github/workflows/run-dev-tests.yml" ++ ++jobs: ++ build: ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@v3 ++ - uses: actions/setup-python@v4 ++ with: ++ python-version: '3.x' ++ - name: Build wheel ++ run: python3 -m pip wheel --no-deps -w dist . ++ - name: Upload wheel as artifact ++ uses: actions/upload-artifact@v3 ++ with: ++ name: cpp-linter_wheel ++ path: ${{ github.workspace }}/dist/*.whl ++ ++ test: ++ needs: [build] ++ strategy: ++ fail-fast: false ++ matrix: ++ py: ['3.7', '3.8', '3.9', '3.10'] ++ os: ['windows-latest', ubuntu-latest] ++ version: ['13', '12', '11', '10', '9', '8', '7'] ++ include: ++ - tools_dir: 'N/A' ++ - os: 'windows-latest' ++ version: '10' ++ tools_dir: temp ++ - os: 'windows-latest' ++ version: '10' ++ tools_dir: temp ++ - os: 'windows-latest' ++ version: '11' ++ tools_dir: temp ++ - os: 'windows-latest' ++ version: '12' ++ tools_dir: temp ++ - os: 'ubuntu-latest' ++ version: '13' ++ tools_dir: temp ++ # - version: '14' ++ # tools_dir: temp ++ - version: '7' ++ tools_dir: temp ++ - version: '8' ++ tools_dir: temp ++ - version: '9' ++ tools_dir: temp ++ ++ runs-on: ${{ matrix.os }} ++ steps: ++ - uses: actions/checkout@v3 ++ ++ - uses: actions/setup-python@v4 ++ with: ++ python-version: ${{ matrix.py }} ++ ++ - name: download wheel artifact ++ uses: actions/download-artifact@v3 ++ with: ++ name: cpp-linter_wheel ++ path: dist ++ ++ - name: Install workflow deps ++ # using a wildcard as filename on Windows requires a bash shell ++ shell: bash ++ run: python3 -m pip install pytest coverage[toml] dist/*.whl ++ ++ - name: Install clang-tools ++ if: matrix.tools_dir == 'temp' ++ run: | ++ python -m pip install clang-tools ++ clang-tools --install ${{ matrix.version }} --directory ${{ runner.temp }}/clang-tools ++ ++ - name: Collect Coverage (native clang install) ++ if: matrix.tools_dir == 'N/A' ++ env: ++ CLANG_VERSION: ${{ matrix.version }} ++ run: coverage run -m pytest ++ ++ - name: Collect Coverage (non-native clang install) ++ if: matrix.tools_dir == 'temp' ++ env: ++ CLANG_VERSION: ${{ runner.temp }}/clang-tools ++ run: coverage run -m pytest ++ ++ - run: coverage report && coverage xml ++ ++ - uses: codecov/codecov-action@v3 ++ if: matrix.os == 'ubuntu-latest' && matrix.version == '12' && matrix.py == '3.10' ++ with: ++ files: ./coverage.xml ++ fail_ci_if_error: true # optional (default = false) ++ verbose: true # optional (default = false) +diff --git a/.gitignore b/.gitignore +new file mode 100644 +index 0000000..3065187 +--- /dev/null ++++ b/.gitignore +@@ -0,0 +1,188 @@ ++# local demo specific ++.changed_files.json ++clang_format*.txt ++clang_tidy*.txt ++act.exe ++clang_tidy_output.yml ++clang_format_output.xml ++event_payload.json ++comments.json ++ ++#### ignores for Python ++# Byte-compiled / optimized / DLL files ++__pycache__/ ++*.py[cod] ++*$py.class ++ ++# Distribution / packaging ++.Python ++build/ ++develop-eggs/ ++dist/ ++downloads/ ++eggs/ ++.eggs/ ++lib/ ++lib64/ ++parts/ ++sdist/ ++var/ ++wheels/ ++pip-wheel-metadata/ ++share/python-wheels/ ++*.egg-info/ ++.installed.cfg ++*.egg ++MANIFEST ++ ++# PyInstaller ++# Usually these files are written by a python script from a template ++# before PyInstaller builds the exe, so as to inject date/other infos into it. ++*.manifest ++*.spec ++ ++# Installer logs ++pip-log.txt ++pip-delete-this-directory.txt ++ ++# Unit test / coverage reports ++htmlcov/ ++.tox/ ++.nox/ ++.coverage ++.coverage.* ++.cache ++nosetests.xml ++coverage.xml ++*.cover ++*.py,cover ++.hypothesis/ ++.pytest_cache/ ++tests/*/test*.json ++tests/**/*.c ++ ++# Translations ++*.mo ++*.pot ++ ++# Django stuff: ++*.log ++local_settings.py ++db.sqlite3 ++db.sqlite3-journal ++ ++# Flask stuff: ++instance/ ++.webassets-cache ++ ++# Scrapy stuff: ++.scrapy ++ ++# Sphinx documentation ++docs/_build/ ++ ++# PyBuilder ++target/ ++ ++# Jupyter Notebook ++.ipynb_checkpoints ++ ++# IPython ++profile_default/ ++ipython_config.py ++ ++# pyenv ++.python-version ++ ++# pipenv ++# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. ++# However, in case of collaboration, if having platform-specific dependencies or dependencies ++# having no cross-platform support, pipenv may install dependencies that don't work, or not ++# install all needed dependencies. ++#Pipfile.lock ++ ++# PEP 582; used by e.g. github.com/David-OConnor/pyflow ++__pypackages__/ ++ ++# Celery stuff ++celerybeat-schedule ++celerybeat.pid ++ ++# SageMath parsed files ++*.sage.py ++ ++# Environments ++.env ++.venv ++env/ ++venv/ ++ENV/ ++env.bak/ ++venv.bak/ ++ ++# Spyder project settings ++.spyderproject ++.spyproject ++ ++# Rope project settings ++.ropeproject ++ ++# mkdocs documentation ++/site ++ ++# mypy ++.mypy_cache/ ++.dmypy.json ++dmypy.json ++ ++# Pyre type checker ++.pyre/ ++ ++# exclude local VSCode's settings folder ++.vscode/ ++ ++#### ignores for C++ ++# Prerequisites ++*.d ++ ++# Compiled Object files ++*.slo ++*.lo ++*.o ++*.obj ++ ++# Precompiled Headers ++*.gch ++*.pch ++ ++# Compiled Dynamic libraries ++*.so ++*.dylib ++*.dll ++ ++# Fortran module files ++*.mod ++*.smod ++ ++# Compiled Static libraries ++*.lai ++*.la ++*.a ++*.lib ++ ++# Executables ++*.exe ++*.out ++*.app ++ ++# Cmake build-in-source generated stuff ++CMakeUserPresets.json ++CMakeCache.txt ++CPackConfig.cmake ++CPackSourceConfig.cmake ++CMakeFiles ++cmake_install.cmake ++ ++ ++# generated doc pages ++docs/cli_args.rst +diff --git a/.gitpod.yml b/.gitpod.yml +new file mode 100644 +index 0000000..c21ea2f +--- /dev/null ++++ b/.gitpod.yml +@@ -0,0 +1,2 @@ ++tasks: ++ - init: pip install -r requirements.txt +diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml +new file mode 100644 +index 0000000..4ccf7ab +--- /dev/null ++++ b/.pre-commit-config.yaml +@@ -0,0 +1,38 @@ ++repos: ++ - repo: https://github.com/pre-commit/pre-commit-hooks ++ rev: v4.3.0 ++ hooks: ++ - id: trailing-whitespace ++ - id: end-of-file-fixer ++ - id: check-docstring-first ++ - id: check-added-large-files ++ - id: check-yaml ++ - id: check-toml ++ - id: requirements-txt-fixer ++ - id: mixed-line-ending ++ args: ["--fix=lf"] ++ - repo: https://github.com/python/black ++ rev: '22.6.0' ++ hooks: ++ - id: black ++ args: ["--diff"] ++ - repo: https://github.com/pycqa/pylint ++ rev: v2.14.5 ++ hooks: ++ - id: pylint ++ name: pylint (action code) ++ types: [python] ++ exclude: "^(docs/|tests/|setup.py$)" ++ additional_dependencies: [pyyaml, requests] ++ - repo: local ++ # this is a "local" hook to run mypy (see https://pre-commit.com/#repository-local-hooks) ++ # because the mypy project doesn't seem to be compatible with pre-commit hooks ++ hooks: ++ - id: mypy ++ name: mypy ++ description: type checking with mypy tool ++ language: python ++ types: [python] ++ entry: mypy ++ exclude: "^(docs/|setup.py$)" ++ additional_dependencies: [mypy, types-pyyaml, types-requests, rich, requests, pytest, pyyaml, '.'] +diff --git a/README.rst b/README.rst +new file mode 100644 +index 0000000..c0b5ae3 +--- /dev/null ++++ b/README.rst +@@ -0,0 +1,34 @@ ++C/C++ Linting Package ++===================== ++ ++.. image:: https://img.shields.io/github/v/release/cpp-linter/cpp-linter?style=plastic ++ :alt: Latest Version ++ :target: https://github.com/cpp-linter/cpp-linter/releases ++.. image:: https://img.shields.io/github/license/cpp-linter/cpp-linter?label=license&logo=github&style=plastic ++ :alt: License ++ :target: https://github.com/cpp-linter/cpp-linter/blob/main/LICENSE ++.. image:: https://codecov.io/gh/cpp-linter/cpp-linter/branch/main/graph/badge.svg?token=0814O9WHQU ++ :alt: CodeCov ++ :target: https://codecov.io/gh/cpp-linter/cpp-linter ++.. image:: https://github.com/cpp-linter/cpp-linter/actions/workflows/build-docs.yml/badge.svg ++ :alt: Docs ++ :target: https://cpp-linter.github.io/cpp-linter ++ ++A Python package for linting C/C++ code with clang-tidy and/or clang-format to collect feedback provided in the form of thread comments and/or file annotations. ++ ++Usage ++----- ++ ++For usage in a CI workflow, see `the cpp-linter/cpp-linter-action repository `_ ++ ++For the description of supported Command Line Interface options, see `the CLI documentation `_ ++ ++Have question or feedback? ++-------------------------- ++ ++To provide feedback (requesting a feature or reporting a bug) please post to `issues `_. ++ ++License ++------- ++ ++The scripts and documentation in this project are released under the `MIT License `_. +diff --git a/cpp_linter/__init__.py b/cpp_linter/__init__.py +new file mode 100644 +index 0000000..5921623 +--- /dev/null ++++ b/cpp_linter/__init__.py +@@ -0,0 +1,157 @@ ++"""The Base module of the :mod:`cpp_linter` package. This holds the objects shared by ++multiple modules.""" ++import os ++from pathlib import Path ++import platform ++import logging ++from typing import TYPE_CHECKING, List, Dict, Tuple, Any ++from requests import Response ++ ++if TYPE_CHECKING: # Used to avoid circular imports ++ from cpp_linter.clang_format_xml import XMLFixit ++ from cpp_linter.clang_tidy_yml import YMLFixit ++ from cpp_linter.clang_tidy import TidyNotification ++ ++FOUND_RICH_LIB = False ++try: ++ from rich.logging import RichHandler ++ ++ FOUND_RICH_LIB = True ++ ++ logging.basicConfig( ++ format="%(name)s: %(message)s", ++ handlers=[RichHandler(show_time=False)], ++ ) ++ ++except ImportError: # pragma: no cover ++ logging.basicConfig() ++ ++#: The logging.Logger object used for outputting data. ++logger = logging.getLogger("CPP Linter") ++if not FOUND_RICH_LIB: ++ logger.debug("rich module not found") ++ ++# global constant variables ++IS_ON_RUNNER = bool(os.getenv("CI")) ++GITHUB_SHA = os.getenv("GITHUB_SHA", "") ++GITHUB_TOKEN = os.getenv("GITHUB_TOKEN", os.getenv("GIT_REST_API", "")) ++API_HEADERS = { ++ "Accept": "application/vnd.github.v3.text+json", ++} ++if GITHUB_TOKEN: ++ API_HEADERS["Authorization"] = f"token {GITHUB_TOKEN}" ++IS_ON_WINDOWS = platform.system().lower() == "windows" ++ ++ ++class Globals: ++ """Global variables for re-use (non-constant).""" ++ ++ PAYLOAD_TIDY: str = "" ++ """The accumulated output of clang-tidy (gets appended to OUTPUT)""" ++ OUTPUT: str = "" ++ """The accumulated body of the resulting comment that gets posted.""" ++ FILES: List[Dict[str, Any]] = [] ++ """The responding payload containing info about changed files.""" ++ EVENT_PAYLOAD: Dict[str, Any] = {} ++ """The parsed JSON of the event payload.""" ++ response_buffer: Response = Response() ++ """A shared response object for `requests` module.""" ++ ++ ++class GlobalParser: ++ """Global variables specific to output parsers. Each element in each of the ++ following attributes represents a clang-tool's output for 1 source file. ++ """ ++ ++ tidy_notes = [] # type: List[TidyNotification] ++ """This can only be a `list` of type ++ :class:`~cpp_linter.clang_tidy.TidyNotification`.""" ++ tidy_advice = [] # type: List[YMLFixit] ++ """This can only be a `list` of type :class:`~cpp_linter.clang_tidy_yml.YMLFixit`. ++ """ ++ format_advice = [] # type: List[XMLFixit] ++ """This can only be a `list` of type :class:`~cpp_linter.clang_format_xml.XMLFixit`. ++ """ ++ ++ ++def get_line_cnt_from_cols(file_path: str, offset: int) -> Tuple[int, int]: ++ """Gets a line count and columns offset from a file's absolute offset. ++ ++ :param file_path: Path to file. ++ :param offset: The byte offset to translate ++ ++ :returns: ++ A `tuple` of 2 `int` numbers: ++ ++ - Index 0 is the line number for the given offset. ++ - Index 1 is the column number for the given offset on the line. ++ """ ++ # logger.debug("Getting line count from %s at offset %d", file_path, offset) ++ contents = Path(file_path).read_bytes()[:offset] ++ return (contents.count(b"\n") + 1, offset - contents.rfind(b"\n")) ++ ++ ++def range_of_changed_lines( ++ file_obj: Dict[str, Any], lines_changed_only: int ++) -> List[int]: ++ """Assemble a list of lines changed. ++ ++ :param file_obj: The file's JSON object. ++ :param lines_changed_only: A flag to indicate the focus of certain lines. ++ ++ - ``0``: focuses on all lines in file. ++ - ``1``: focuses on any lines shown in the event's diff (may include ++ unchanged lines). ++ - ``2``: focuses strictly on lines in the diff that contain additions. ++ :returns: ++ A list of line numbers for which to give attention. ++ """ ++ if lines_changed_only: ++ ranges = file_obj["line_filter"][ ++ "diff_chunks" if lines_changed_only == 1 else "lines_added" ++ ] ++ return [l for r in ranges for l in range(r[0], r[1])] ++ return [] ++ ++ ++def log_response_msg() -> bool: ++ """Output the response buffer's message on a failed request. ++ ++ :returns: ++ A bool describing if response's status code was less than 400. ++ """ ++ if Globals.response_buffer.status_code >= 400: ++ logger.error( ++ "response returned %d message: %s", ++ Globals.response_buffer.status_code, ++ Globals.response_buffer.text, ++ ) ++ return False ++ return True ++ ++ ++def assemble_version_exec(tool_name: str, specified_version: str) -> str: ++ """Assembles the command to the executable of the given clang tool based on given ++ version information. ++ ++ :param tool_name: The name of the clang tool to be executed. ++ :param specified_version: The version number or the installed path to a version of ++ the tool's executable. ++ """ ++ suffix = ".exe" if IS_ON_WINDOWS else "" ++ if specified_version.isdigit(): # version info is not a path ++ # let's assume the exe is in the PATH env var ++ if IS_ON_WINDOWS: ++ # installs don't usually append version number to exe name on Windows ++ return f"{tool_name}{suffix}" # omit version number ++ return f"{tool_name}-{specified_version}{suffix}" ++ version_path = Path(specified_version).resolve() # make absolute ++ for path in [ ++ # if installed via KyleMayes/install-llvm-action using the `directory` option ++ version_path / "bin" / (tool_name + suffix), ++ # if installed via clang-tools-pip pkg using the `-d` option ++ version_path / (tool_name + suffix), ++ ]: ++ if path.exists(): ++ return str(path) ++ return tool_name + suffix +diff --git a/cpp_linter/clang_format_xml.py b/cpp_linter/clang_format_xml.py +new file mode 100644 +index 0000000..0554264 +--- /dev/null ++++ b/cpp_linter/clang_format_xml.py +@@ -0,0 +1,137 @@ ++"""Parse output from clang-format's XML suggestions.""" ++from pathlib import PurePath ++from typing import List, Optional ++import xml.etree.ElementTree as ET ++from . import GlobalParser, get_line_cnt_from_cols ++ ++ ++class FormatReplacement: ++ """An object representing a single replacement. ++ ++ :param cols: The columns number of where the suggestion starts on the line ++ :param null_len: The number of bytes removed by suggestion ++ :param text: The `bytearray` of the suggestion ++ """ ++ ++ def __init__(self, cols: int, null_len: int, text: str) -> None: ++ #: The columns number of where the suggestion starts on the line ++ self.cols = cols ++ #: The number of bytes removed by suggestion ++ self.null_len = null_len ++ #: The `bytearray` of the suggestion ++ self.text = text ++ ++ def __repr__(self) -> str: ++ return ( ++ f"" ++ ) ++ ++ ++class FormatReplacementLine: ++ """An object that represents a replacement(s) for a single line. ++ ++ :param line_numb: The line number of about the replacements ++ """ ++ ++ def __init__(self, line_numb: int): ++ #: The line number of where the suggestion starts ++ self.line = line_numb ++ ++ #: A list of `FormatReplacement` object(s) representing suggestions. ++ self.replacements: List[FormatReplacement] = [] ++ ++ def __repr__(self): ++ return ( ++ f"" ++ ) ++ ++ ++class XMLFixit: ++ """A single object to represent each suggestion. ++ ++ :param filename: The source file's name for which the contents of the xml ++ file exported by clang-tidy. ++ """ ++ ++ def __init__(self, filename: str): ++ """ """ ++ #: The source file that the suggestion concerns. ++ self.filename = PurePath(filename).as_posix() ++ ++ self.replaced_lines: List[FormatReplacementLine] = [] ++ """A list of `FormatReplacementLine` representing replacement(s) ++ on a single line.""" ++ ++ def __repr__(self) -> str: ++ return ( ++ f"" ++ ) ++ ++ def log_command(self, style: str, line_filter: List[int]) -> Optional[str]: ++ """Output a notification as a github log command. ++ ++ .. seealso:: ++ ++ - `An error message `_ ++ - `A warning message `_ ++ - `A notice message `_ ++ ++ :param style: The chosen code style guidelines. ++ :param line_filter: A list of lines numbers used to narrow notifications. ++ """ ++ if style not in ("llvm", "google", "webkit", "mozilla", "gnu"): ++ # potentially the style parameter could be a str of JSON/YML syntax ++ style = "Custom" ++ else: ++ if style.startswith("llvm") or style.startswith("gnu"): ++ style = style.upper() ++ else: ++ style = style.title() ++ line_list = [] ++ for fix in self.replaced_lines: ++ if not line_filter or (line_filter and fix.line in line_filter): ++ line_list.append(str(fix.line)) ++ if not line_list: ++ return None ++ return ( ++ "::notice file={name},title=Run clang-format on {name}::" ++ "File {name} (lines {lines}): Code does not conform to {style_guide} " ++ "style guidelines.".format( ++ name=self.filename, ++ lines=", ".join(line_list), ++ style_guide=style, ++ ) ++ ) ++ ++ ++def parse_format_replacements_xml(src_filename: str): ++ """Parse XML output of replacements from clang-format. Output is saved to ++ :attr:`~cpp_linter.GlobalParser.format_advice`. ++ ++ :param src_filename: The source file's name for which the contents of the xml ++ file exported by clang-tidy. ++ """ ++ tree = ET.parse("clang_format_output.xml") ++ fixit = XMLFixit(src_filename) ++ for child in tree.getroot(): ++ if child.tag == "replacement": ++ offset = int(child.attrib["offset"]) ++ line, cols = get_line_cnt_from_cols(src_filename, offset) ++ null_len = int(child.attrib["length"]) ++ text = "" if child.text is None else child.text ++ fix = FormatReplacement(cols, null_len, text) ++ if not fixit.replaced_lines or ( ++ fixit.replaced_lines and line != fixit.replaced_lines[-1].line ++ ): ++ line_fix = FormatReplacementLine(line) ++ line_fix.replacements.append(fix) ++ fixit.replaced_lines.append(line_fix) ++ elif fixit.replaced_lines and line == fixit.replaced_lines[-1].line: ++ fixit.replaced_lines[-1].replacements.append(fix) ++ GlobalParser.format_advice.append(fixit) +diff --git a/cpp_linter/clang_tidy.py b/cpp_linter/clang_tidy.py +new file mode 100644 +index 0000000..11c1ae8 +--- /dev/null ++++ b/cpp_linter/clang_tidy.py +@@ -0,0 +1,116 @@ ++"""Parse output from clang-tidy's stdout""" ++from pathlib import Path, PurePath ++import re ++from typing import Tuple, Union, List, cast ++from . import GlobalParser ++ ++NOTE_HEADER = re.compile(r"^(.*):(\d+):(\d+):\s(\w+):(.*)\[(.*)\]$") ++ ++ ++class TidyNotification: ++ """Create a object that decodes info from the clang-tidy output's initial line that ++ details a specific notification. ++ ++ :param notification_line: The first line in the notification parsed into a ++ `tuple` of `str` that represent the different components of the ++ notification's details. ++ """ ++ ++ def __init__( ++ self, ++ notification_line: Tuple[str, Union[int, str], Union[int, str], str, str, str], ++ ): ++ # logger.debug("Creating tidy note from line %s", notification_line) ++ ( ++ self.filename, ++ self.line, ++ #: The columns of the line that triggered the notification. ++ self.cols, ++ self.note_type, ++ self.note_info, ++ #: The clang-tidy check that enabled the notification. ++ self.diagnostic, ++ ) = notification_line ++ ++ #: The rationale of the notification. ++ self.note_info = self.note_info.strip() ++ #: The priority level of notification (warning/error). ++ self.note_type = self.note_type.strip() ++ #: The line number of the source file. ++ self.line = int(self.line) ++ self.cols = int(self.cols) ++ #: The source filename concerning the notification. ++ self.filename = ( ++ PurePath(self.filename).as_posix().replace(Path.cwd().as_posix(), "") ++ ) ++ #: A `list` of lines for the code-block in the notification. ++ self.fixit_lines: List[str] = [] ++ ++ def __repr__(self) -> str: ++ concerned_code = "" ++ if self.fixit_lines: ++ if not self.fixit_lines[-1].endswith("\n"): ++ # some notifications' code-blocks don't end in a LF ++ self.fixit_lines[-1] += "\n" # and they should for us ++ concerned_code = "```{}\n{}```\n".format( ++ PurePath(self.filename).suffix.lstrip("."), ++ "\n".join(self.fixit_lines), ++ ) ++ return ( ++ "
\n{}:{}:{}: {}: [{}]" ++ "\n\n> {}\n

\n\n{}

\n
\n\n".format( ++ self.filename, ++ self.line, ++ self.cols, ++ self.note_type, ++ self.diagnostic, ++ self.note_info, ++ concerned_code, ++ ) ++ ) ++ ++ def log_command(self) -> str: ++ """Output the notification as a github log command. ++ ++ .. seealso:: ++ ++ - `An error message `_ ++ - `A warning message `_ ++ - `A notice message `_ ++ """ ++ filename = self.filename.replace("\\", "/") ++ return ( ++ "::{} file={file},line={line},title={file}:{line}:{cols} [{diag}]::" ++ "{info}".format( ++ "notice" if self.note_type.startswith("note") else self.note_type, ++ file=filename, ++ line=self.line, ++ cols=self.cols, ++ diag=self.diagnostic, ++ info=self.note_info, ++ ) ++ ) ++ ++ ++def parse_tidy_output() -> None: ++ """Parse clang-tidy output in a file created from stdout. The results are ++ saved to :attr:`~cpp_linter.GlobalParser.tidy_notes`.""" ++ notification = None ++ tidy_out = Path("clang_tidy_report.txt").read_text(encoding="utf-8") ++ for line in tidy_out.splitlines(): ++ match = re.match(NOTE_HEADER, line) ++ if match is not None: ++ notification = TidyNotification( ++ cast( ++ Tuple[str, Union[int, str], Union[int, str], str, str, str], ++ match.groups(), ++ ) ++ ) ++ GlobalParser.tidy_notes.append(notification) ++ elif notification is not None: ++ # append lines of code that are part of ++ # the previous line's notification ++ notification.fixit_lines.append(line) +diff --git a/cpp_linter/clang_tidy_yml.py b/cpp_linter/clang_tidy_yml.py +new file mode 100644 +index 0000000..21b38a0 +--- /dev/null ++++ b/cpp_linter/clang_tidy_yml.py +@@ -0,0 +1,120 @@ ++"""Parse output from clang-tidy's YML format""" ++from pathlib import Path, PurePath ++from typing import List, cast, Dict, Any ++import yaml ++from . import GlobalParser, get_line_cnt_from_cols, logger ++ ++ ++CWD_HEADER_GUARD = bytes( ++ "_".join([p.upper().replace("-", "_") for p in Path.cwd().parts]), encoding="utf-8" ++) #: The constant used to trim absolute paths from header guard suggestions. ++ ++ ++class TidyDiagnostic: ++ """Create an object that represents a diagnostic output found in the ++ YAML exported from clang-tidy. ++ ++ :param diagnostic_name: The name of the check that got triggered. ++ """ ++ ++ def __init__(self, diagnostic_name: str): ++ #: The diagnostic name ++ self.name = diagnostic_name ++ #: The diagnostic message ++ self.message = "" ++ #: The line number that triggered the diagnostic ++ self.line = 0 ++ #: The columns of the `line` that triggered the diagnostic ++ self.cols = 0 ++ #: The number of bytes replaced by suggestions ++ self.null_len = 0 ++ #: The `list` of `TidyReplacement` objects. ++ self.replacements: List["TidyReplacement"] = [] ++ ++ def __repr__(self): ++ """A str representation of all attributes.""" ++ return ( ++ f"" ++ ) ++ ++ ++class TidyReplacement: ++ """Create an object representing a clang-tidy suggested replacement. ++ ++ :param line_cnt: The replacement content's starting line ++ :param cols: The replacement content's starting columns ++ :param length: The number of bytes discarded from `cols` ++ """ ++ ++ def __init__(self, line_cnt: int, cols: int, length: int): ++ #: The replacement content's starting line ++ self.line = line_cnt ++ #: The replacement content's starting columns ++ self.cols = cols ++ #: The number of bytes discarded from `cols` ++ self.null_len = length ++ #: The replacement content's text. ++ self.text: bytes = b"" ++ ++ def __repr__(self) -> str: ++ return ( ++ f"" ++ ) ++ ++ ++class YMLFixit: ++ """A single object to represent each suggestion. ++ ++ :param filename: The source file's name (with path) concerning the suggestion. ++ """ ++ ++ def __init__(self, filename: str) -> None: ++ #: The source file's name concerning the suggestion. ++ self.filename = PurePath(filename).relative_to(Path.cwd()).as_posix() ++ #: The `list` of `TidyDiagnostic` objects. ++ self.diagnostics: List[TidyDiagnostic] = [] ++ ++ def __repr__(self) -> str: ++ return ( ++ f"" ++ ) ++ ++ ++def parse_tidy_suggestions_yml(): ++ """Read a YAML file from clang-tidy and create a list of suggestions from it. ++ Output is saved to :attr:`~cpp_linter.GlobalParser.tidy_advice`. ++ """ ++ yml_file = Path("clang_tidy_output.yml").read_text(encoding="utf-8") ++ yml = yaml.safe_load(yml_file) ++ fixit = YMLFixit(yml["MainSourceFile"]) ++ ++ for diag_results in yml["Diagnostics"]: ++ diag = TidyDiagnostic(diag_results["DiagnosticName"]) ++ if "DiagnosticMessage" in cast(Dict[str, Any], diag_results).keys(): ++ msg = diag_results["DiagnosticMessage"]["Message"] ++ offset = diag_results["DiagnosticMessage"]["FileOffset"] ++ replacements = diag_results["DiagnosticMessage"]["Replacements"] ++ else: # prior to clang-tidy v9, the YML output was structured differently ++ msg = diag_results["Message"] ++ offset = diag_results["FileOffset"] ++ replacements = diag_results["Replacements"] ++ diag.message = msg ++ diag.line, diag.cols = get_line_cnt_from_cols(yml["MainSourceFile"], offset) ++ for replacement in [] if replacements is None else replacements: ++ line_cnt, cols = get_line_cnt_from_cols( ++ yml["MainSourceFile"], replacement["Offset"] ++ ) ++ fix = TidyReplacement(line_cnt, cols, replacement["Length"]) ++ fix.text = bytes(replacement["ReplacementText"], encoding="utf-8") ++ if fix.text.startswith(b"header is missing header guard"): ++ logger.debug( ++ "filtering header guard suggestion (making relative to repo root)" ++ ) ++ fix.text = fix.text.replace(CWD_HEADER_GUARD, b"") ++ diag.replacements.append(fix) ++ fixit.diagnostics.append(diag) ++ # filter out absolute header guards ++ GlobalParser.tidy_advice.append(fixit) +diff --git a/cpp_linter/run.py b/cpp_linter/run.py +new file mode 100644 +index 0000000..d98281e +--- /dev/null ++++ b/cpp_linter/run.py +@@ -0,0 +1,984 @@ ++"""Run clang-tidy and clang-format on a list of changed files provided by GitHub's ++REST API. If executed from command-line, then `main()` is the entrypoint. ++ ++.. seealso:: ++ ++ - `github rest API reference for pulls ++ `_ ++ - `github rest API reference for repos ++ `_ ++ - `github rest API reference for issues ++ `_ ++""" ++import subprocess ++from pathlib import Path, PurePath ++import os ++import sys ++import argparse ++import configparser ++import json ++from typing import cast, List, Dict, Any, Tuple ++import requests ++from . import ( ++ Globals, ++ GlobalParser, ++ logging, ++ logger, ++ GITHUB_TOKEN, ++ GITHUB_SHA, ++ API_HEADERS, ++ IS_ON_RUNNER, ++ log_response_msg, ++ range_of_changed_lines, ++ assemble_version_exec, ++) ++from .clang_tidy_yml import parse_tidy_suggestions_yml ++from .clang_format_xml import parse_format_replacements_xml ++from .clang_tidy import parse_tidy_output, TidyNotification ++from .thread_comments import remove_bot_comments, list_diff_comments # , get_review_id ++ ++ ++# global constant variables ++GITHUB_EVENT_PATH = os.getenv("GITHUB_EVENT_PATH", "") ++GITHUB_API_URL = os.getenv("GITHUB_API_URL", "https://api.github.com") ++GITHUB_REPOSITORY = os.getenv("GITHUB_REPOSITORY", "") ++GITHUB_EVENT_NAME = os.getenv("GITHUB_EVENT_NAME", "unknown") ++GITHUB_WORKSPACE = os.getenv("GITHUB_WORKSPACE", "") ++IS_USING_DOCKER = os.getenv("USING_CLANG_TOOLS_DOCKER", os.getenv("CLANG_VERSIONS")) ++RUNNER_WORKSPACE = "/github/workspace" if IS_USING_DOCKER else GITHUB_WORKSPACE ++ ++# setup CLI args ++cli_arg_parser = argparse.ArgumentParser( ++ description=__doc__[: __doc__.find("If executed from")], ++ formatter_class=argparse.RawTextHelpFormatter, ++) ++arg = cli_arg_parser.add_argument( ++ "-v", ++ "--verbosity", ++ type=int, ++ default=10, ++ help="""This controls the action's verbosity in the workflow's logs. ++Supported options are defined by the `logging-level `_. ++This option does not affect the verbosity of resulting ++thread comments or file annotations. ++ ++Defaults to level ``%(default)s`` (aka """, ++) ++assert arg.help is not None ++arg.help += f"``logging.{logging.getLevelName(arg.default)}``)." ++cli_arg_parser.add_argument( ++ "-p", ++ "--database", ++ default="", ++ help="""The path that is used to read a compile command database. ++For example, it can be a CMake build directory in which a file named ++compile_commands.json exists (set ``CMAKE_EXPORT_COMPILE_COMMANDS`` to ``ON``). ++When no build path is specified, a search for compile_commands.json will be ++attempted through all parent paths of the first input file. See ++https://clang.llvm.org/docs/HowToSetupToolingForLLVM.html for an ++example of setting up Clang Tooling on a source tree.""", ++) ++cli_arg_parser.add_argument( ++ "-s", ++ "--style", ++ default="llvm", ++ help="""The style rules to use (defaults to ``%(default)s``). ++ ++- Set this to ``file`` to have clang-format use the closest relative ++ .clang-format file. ++- Set this to a blank string (``""``) to disable using clang-format ++ entirely.""", ++) ++cli_arg_parser.add_argument( ++ "-c", ++ "--tidy-checks", ++ default="boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*," ++ "clang-analyzer-*,cppcoreguidelines-*", ++ help="""A comma-separated list of globs with optional ``-`` prefix. ++Globs are processed in order of appearance in the list. ++Globs without ``-`` prefix add checks with matching names to the set, ++globs with the ``-`` prefix remove checks with matching names from the set of ++enabled checks. This option's value is appended to the value of the 'Checks' ++option in a .clang-tidy file (if any). ++ ++- It is possible to disable clang-tidy entirely by setting this option to ``'-*'``. ++- It is also possible to rely solely on a .clang-tidy config file by ++ specifying this option as a blank string (``''``). ++ ++The defaults is:: ++ ++ %(default)s ++ ++See also clang-tidy docs for more info.""", ++) ++arg = cli_arg_parser.add_argument( ++ "-V", ++ "--version", ++ default="", ++ help="""The desired version of the clang tools to use. Accepted options are ++strings which can be 8, 9, 10, 11, 12, 13, 14. ++ ++- Set this option to a blank string (``''``) to use the ++ platform's default installed version. ++- This value can also be a path to where the clang tools are ++ installed (if using a custom install location). All paths specified ++ here are converted to absolute. ++ ++Default is """ ++) ++assert arg.help is not None ++arg.help += "a blank string." if not arg.default else f"``{arg.default}``." ++arg = cli_arg_parser.add_argument( ++ "-e", ++ "--extensions", ++ default=["c", "h", "C", "H", "cpp", "hpp", "cc", "hh", "c++", "h++", "cxx", "hxx"], ++ type=lambda i: [ext.strip().lstrip(".") for ext in i.split(",")], ++ help="""The file extensions to analyze. ++This comma-separated string defaults to:: ++ ++ """, ++) ++assert arg.help is not None ++arg.help += ",".join(arg.default) + "\n" ++cli_arg_parser.add_argument( ++ "-r", ++ "--repo-root", ++ default=".", ++ help="""The relative path to the repository root directory. This path is ++relative to the runner's ``GITHUB_WORKSPACE`` environment variable (or ++the current working directory if not using a CI runner). ++ ++The default value is ``%(default)s``""", ++) ++cli_arg_parser.add_argument( ++ "-i", ++ "--ignore", ++ default=".github", ++ help="""Set this option with path(s) to ignore (or not ignore). ++ ++- In the case of multiple paths, you can use ``|`` to separate each path. ++- There is no need to use ``./`` for each entry; a blank string (``''``) ++ represents the repo-root path. ++- This can also have files, but the file's path (relative to ++ the :cli-opt:`repo-root`) has to be specified with the filename. ++- Submodules are automatically ignored. Hidden directories (beginning ++ with a ``.``) are also ignored automatically. ++- Prefix a path with ``!`` to explicitly not ignore it. This can be ++ applied to a submodule's path (if desired) but not hidden directories. ++- Glob patterns are not supported here. All asterisk characters (``*``) ++ are literal.""", ++) ++arg = cli_arg_parser.add_argument( ++ "-l", ++ "--lines-changed-only", ++ default=0, ++ type=lambda a: 2 if a.lower() == "true" else (1 if a.lower() == "diff" else 0), ++ help="""This controls what part of the files are analyzed. ++The following values are accepted: ++ ++- false: All lines in a file are analyzed. ++- true: Only lines in the diff that contain additions are analyzed. ++- diff: All lines in the diff are analyzed (including unchanged ++ lines but not subtractions). ++ ++Defaults to """, ++) ++assert arg.help is not None ++arg.help += f"``{str(bool(arg.default)).lower()}``." ++cli_arg_parser.add_argument( ++ "-f", ++ "--files-changed-only", ++ default="false", ++ type=lambda input: input.lower() == "true", ++ help="""Set this option to false to analyze any source files in the repo. ++This is automatically enabled if ++:cli-opt:`lines-changed-only` is enabled. ++ ++.. note:: ++ The ``GITHUB_TOKEN`` should be supplied when running on a ++ private repository with this option enabled, otherwise the runner ++ does not not have the privilege to list the changed files for an event. ++ ++ See `Authenticating with the GITHUB_TOKEN ++ `_ ++ ++Defaults to ``%(default)s``.""", ++) ++cli_arg_parser.add_argument( ++ "-t", ++ "--thread-comments", ++ default="false", ++ type=lambda input: input.lower() == "true", ++ help="""Set this option to false to disable the use of ++thread comments as feedback. ++ ++.. note:: ++ To use thread comments, the ``GITHUB_TOKEN`` (provided by ++ Github to each repository) must be declared as an environment ++ variable. ++ ++ See `Authenticating with the GITHUB_TOKEN ++ `_ ++ ++.. hint:: ++ If run on a private repository, then this feature is ++ disabled because the GitHub REST API behaves ++ differently for thread comments on a private repository. ++ ++Defaults to ``%(default)s``.""", ++) ++cli_arg_parser.add_argument( ++ "-a", ++ "--file-annotations", ++ default="true", ++ type=lambda input: input.lower() == "true", ++ help="""Set this option to false to disable the use of ++file annotations as feedback. ++ ++Defaults to ``%(default)s``.""", ++) ++ ++ ++def set_exit_code(override: int = None) -> int: ++ """Set the action's exit code. ++ ++ :param override: The number to use when overriding the action's logic. ++ ++ :returns: ++ The exit code that was used. If the ``override`` parameter was not passed, ++ then this value will describe (like a bool value) if any checks failed. ++ """ ++ exit_code = override if override is not None else bool(Globals.OUTPUT) ++ print(f"::set-output name=checks-failed::{exit_code}") ++ return exit_code ++ ++ ++# setup a separate logger for using github log commands ++log_commander = logging.getLogger("LOG COMMANDER") # create a child of our logger obj ++log_commander.setLevel(logging.DEBUG) # be sure that log commands are output ++console_handler = logging.StreamHandler() # Create special stdout stream handler ++console_handler.setFormatter(logging.Formatter("%(message)s")) # no formatted log cmds ++log_commander.addHandler(console_handler) # Use special handler for log_commander ++log_commander.propagate = False ++ ++ ++def start_log_group(name: str) -> None: ++ """Begin a collapsable group of log statements. ++ ++ :param name: The name of the collapsable group ++ """ ++ log_commander.fatal("::group::%s", name) ++ ++ ++def end_log_group() -> None: ++ """End a collapsable group of log statements.""" ++ log_commander.fatal("::endgroup::") ++ ++ ++def is_file_in_list(paths: List[str], file_name: str, prompt: str) -> bool: ++ """Determine if a file is specified in a list of paths and/or filenames. ++ ++ :param paths: A list of specified paths to compare with. This list can contain a ++ specified file, but the file's path must be included as part of the ++ filename. ++ :param file_name: The file's path & name being sought in the ``paths`` list. ++ :param prompt: A debugging prompt to use when the path is found in the list. ++ ++ :returns: ++ ++ - True if ``file_name`` is in the ``paths`` list. ++ - False if ``file_name`` is not in the ``paths`` list. ++ """ ++ for path in paths: ++ result = os.path.commonpath( ++ [PurePath(path).as_posix(), PurePath(file_name).as_posix()] ++ ) ++ if result == path: ++ logger.debug( ++ '"./%s" is %s as specified in the domain "./%s"', ++ file_name, ++ prompt, ++ path, ++ ) ++ return True ++ return False ++ ++ ++def get_list_of_changed_files() -> None: ++ """Fetch the JSON payload of the event's changed files. Sets the ++ :attr:`~cpp_linter.Globals.FILES` attribute.""" ++ start_log_group("Get list of specified source files") ++ files_link = f"{GITHUB_API_URL}/repos/{GITHUB_REPOSITORY}/" ++ if GITHUB_EVENT_NAME == "pull_request": ++ files_link += f"pulls/{Globals.EVENT_PAYLOAD['number']}/files" ++ else: ++ if GITHUB_EVENT_NAME != "push": ++ logger.warning( ++ "Triggered on unsupported event '%s'. Behaving like a push event.", ++ GITHUB_EVENT_NAME, ++ ) ++ files_link += f"commits/{GITHUB_SHA}" ++ logger.info("Fetching files list from url: %s", files_link) ++ Globals.response_buffer = requests.get(files_link, headers=API_HEADERS) ++ log_response_msg() ++ if GITHUB_EVENT_NAME == "pull_request": ++ Globals.FILES = Globals.response_buffer.json() ++ else: ++ Globals.FILES = Globals.response_buffer.json()["files"] ++ ++ ++def consolidate_list_to_ranges(just_numbers: List[int]) -> List[List[int]]: ++ """A helper function to `filter_out_non_source_files()` that is only used when ++ extracting the lines from a diff that contain additions.""" ++ result: List[List[int]] = [] ++ for i, n in enumerate(just_numbers): ++ if not i: ++ result.append([n]) ++ elif n - 1 != just_numbers[i - 1]: ++ result[-1].append(just_numbers[i - 1] + 1) ++ result.append([n]) ++ if i == len(just_numbers) - 1: ++ result[-1].append(n + 1) ++ return result ++ ++ ++def filter_out_non_source_files( ++ ext_list: List[str], ++ ignored: List[str], ++ not_ignored: List[str], ++) -> bool: ++ """Exclude undesired files (specified by user input 'extensions'). This filter ++ applies to the event's :attr:`~cpp_linter.Globals.FILES` attribute. ++ ++ :param ext_list: A list of file extensions that are to be examined. ++ :param ignored: A list of paths to explicitly ignore. ++ :param not_ignored: A list of paths to explicitly not ignore. ++ ++ :returns: ++ True if there are files to check. False will invoke a early exit (in ++ `main()`) when no files to be checked. ++ """ ++ files = [] ++ for file in Globals.FILES: ++ if ( ++ PurePath(file["filename"]).suffix.lstrip(".") in ext_list ++ and not file["status"].endswith("removed") ++ and ( ++ not is_file_in_list(ignored, file["filename"], "ignored") ++ or is_file_in_list(not_ignored, file["filename"], "not ignored") ++ ) ++ ): ++ if "patch" in file.keys(): ++ # get diff details for the file's changes ++ # ranges is a list of start/end line numbers shown in the diff ++ ranges: List[List[int]] = [] ++ # additions is a list line numbers in the diff containing additions ++ additions: List[int] = [] ++ line_numb_in_diff: int = 0 ++ for line in cast(str, file["patch"]).splitlines(): ++ if line.startswith("+"): ++ additions.append(line_numb_in_diff) ++ if line.startswith("@@ -"): ++ hunk = line[line.find(" +") + 2 : line.find(" @@")].split(",") ++ start_line, hunk_length = [int(x) for x in hunk] ++ ranges.append([start_line, hunk_length + start_line]) ++ line_numb_in_diff = start_line ++ elif not line.startswith("-"): ++ line_numb_in_diff += 1 ++ file["line_filter"] = dict( ++ diff_chunks=ranges, ++ lines_added=consolidate_list_to_ranges(additions), ++ ) ++ files.append(file) ++ ++ if files: ++ logger.info( ++ "Giving attention to the following files:\n\t%s", ++ "\n\t".join([f["filename"] for f in files]), ++ ) ++ Globals.FILES = files ++ if not IS_ON_RUNNER: # if not executed on a github runner ++ # dump altered json of changed files ++ Path(".changed_files.json").write_text( ++ json.dumps(Globals.FILES, indent=2), ++ encoding="utf-8", ++ ) ++ else: ++ logger.info("No source files need checking!") ++ return False ++ return True ++ ++ ++def verify_files_are_present() -> None: ++ """Download the files if not present. ++ ++ .. hint:: ++ This function assumes the working directory is the root of the invoking ++ repository. If files are not found, then they are downloaded to the working ++ directory. This is bad for files with the same name from different folders. ++ """ ++ for file in Globals.FILES: ++ file_name = Path(file["filename"]) ++ if not file_name.exists(): ++ logger.warning("Could not find %s! Did you checkout the repo?", file_name) ++ logger.info("Downloading file from url: %s", file["raw_url"]) ++ Globals.response_buffer = requests.get(file["raw_url"]) ++ # retain the repo's original structure ++ Path.mkdir(file_name.parent, parents=True, exist_ok=True) ++ file_name.write_text(Globals.response_buffer.text, encoding="utf-8") ++ ++ ++def list_source_files( ++ ext_list: List[str], ignored_paths: List[str], not_ignored: List[str] ++) -> bool: ++ """Make a list of source files to be checked. The resulting list is stored in ++ :attr:`~cpp_linter.Globals.FILES`. ++ ++ :param ext_list: A list of file extensions that should by attended. ++ :param ignored_paths: A list of paths to explicitly ignore. ++ :param not_ignored: A list of paths to explicitly not ignore. ++ ++ :returns: ++ True if there are files to check. False will invoke a early exit (in ++ `main()` when no files to be checked. ++ """ ++ start_log_group("Get list of specified source files") ++ ++ root_path = Path(".") ++ for ext in ext_list: ++ for rel_path in root_path.rglob(f"*.{ext}"): ++ for parent in rel_path.parts[:-1]: ++ if parent.startswith("."): ++ break ++ else: ++ file_path = rel_path.as_posix() ++ logger.debug('"./%s" is a source code file', file_path) ++ if not is_file_in_list( ++ ignored_paths, file_path, "ignored" ++ ) or is_file_in_list(not_ignored, file_path, "not ignored"): ++ Globals.FILES.append(dict(filename=file_path)) ++ ++ if Globals.FILES: ++ logger.info( ++ "Giving attention to the following files:\n\t%s", ++ "\n\t".join([f["filename"] for f in Globals.FILES]), ++ ) ++ else: ++ logger.info("No source files found.") # this might need to be warning ++ return False ++ return True ++ ++ ++def run_clang_tidy( ++ filename: str, ++ file_obj: Dict[str, Any], ++ version: str, ++ checks: str, ++ lines_changed_only: int, ++ database: str, ++ repo_root: str, ++) -> None: ++ """Run clang-tidy on a certain file. ++ ++ :param filename: The name of the local file to run clang-tidy on. ++ :param file_obj: JSON info about the file. ++ :param version: The version of clang-tidy to run. ++ :param checks: The `str` of comma-separated regulate expressions that describe ++ the desired clang-tidy checks to be enabled/configured. ++ :param lines_changed_only: A flag that forces focus on only changes in the event's ++ diff info. ++ :param database: The path to the compilation database. ++ :param repo_root: The path to the repository root folder. ++ """ ++ if checks == "-*": # if all checks are disabled, then clang-tidy is skipped ++ # clear the clang-tidy output file and exit function ++ Path("clang_tidy_report.txt").write_bytes(b"") ++ return ++ filename = PurePath(filename).as_posix() ++ cmds = [ ++ assemble_version_exec("clang-tidy", version), ++ "--export-fixes=clang_tidy_output.yml", ++ ] ++ if checks: ++ cmds.append(f"-checks={checks}") ++ if database: ++ cmds.append("-p") ++ if not PurePath(database).is_absolute(): ++ database = str(Path(RUNNER_WORKSPACE, repo_root, database).resolve()) ++ cmds.append(database) ++ if lines_changed_only: ++ ranges = "diff_chunks" if lines_changed_only == 1 else "lines_added" ++ line_ranges = dict(name=filename, lines=file_obj["line_filter"][ranges]) ++ logger.info("line_filter = %s", json.dumps([line_ranges])) ++ cmds.append(f"--line-filter={json.dumps([line_ranges])}") ++ cmds.append(filename) ++ # clear yml file's content before running clang-tidy ++ Path("clang_tidy_output.yml").write_bytes(b"") ++ logger.info('Running "%s"', " ".join(cmds)) ++ results = subprocess.run(cmds, capture_output=True) ++ Path("clang_tidy_report.txt").write_bytes(results.stdout) ++ logger.debug("Output from clang-tidy:\n%s", results.stdout.decode()) ++ if Path("clang_tidy_output.yml").stat().st_size: ++ parse_tidy_suggestions_yml() # get clang-tidy fixes from yml ++ if results.stderr: ++ logger.debug( ++ "clang-tidy made the following summary:\n%s", results.stderr.decode() ++ ) ++ ++ ++def run_clang_format( ++ filename: str, ++ file_obj: Dict[str, Any], ++ version: str, ++ style: str, ++ lines_changed_only: int, ++) -> None: ++ """Run clang-format on a certain file ++ ++ :param filename: The name of the local file to run clang-format on. ++ :param file_obj: JSON info about the file. ++ :param version: The version of clang-format to run. ++ :param style: The clang-format style rules to adhere. Set this to 'file' to ++ use the relative-most .clang-format configuration file. ++ :param lines_changed_only: A flag that forces focus on only changes in the event's ++ diff info. ++ """ ++ if not style: # if `style` == "" ++ Path("clang_format_output.xml").write_bytes(b"") ++ return # clear any previous output and exit ++ cmds = [ ++ assemble_version_exec("clang-format", version), ++ f"-style={style}", ++ "--output-replacements-xml", ++ ] ++ if lines_changed_only: ++ ranges = "diff_chunks" if lines_changed_only == 1 else "lines_added" ++ for line_range in file_obj["line_filter"][ranges]: ++ cmds.append(f"--lines={line_range[0]}:{line_range[1]}") ++ cmds.append(PurePath(filename).as_posix()) ++ logger.info('Running "%s"', " ".join(cmds)) ++ results = subprocess.run(cmds, capture_output=True) ++ Path("clang_format_output.xml").write_bytes(results.stdout) ++ if results.returncode: ++ logger.debug( ++ "%s raised the following error(s):\n%s", cmds[0], results.stderr.decode() ++ ) ++ ++ ++def create_comment_body( ++ filename: str, ++ file_obj: Dict[str, Any], ++ lines_changed_only: int, ++ tidy_notes: List[TidyNotification], ++): ++ """Create the content for a thread comment about a certain file. ++ This is a helper function to `capture_clang_tools_output()`. ++ ++ :param filename: The file's name (& path). ++ :param file_obj: The file's JSON `dict`. ++ :param lines_changed_only: A flag used to filter the comment based on line changes. ++ :param tidy_notes: A list of cached notifications from clang-tidy. This is used to ++ avoid duplicated content in comment, and it is later used again by ++ `make_annotations()` after `capture_clang_tools_output()` is finished. ++ """ ++ ranges = range_of_changed_lines(file_obj, lines_changed_only) ++ if Path("clang_tidy_report.txt").stat().st_size: ++ parse_tidy_output() # get clang-tidy fixes from stdout ++ comment_output = "" ++ if Globals.PAYLOAD_TIDY: ++ Globals.PAYLOAD_TIDY += "
" ++ for fix in GlobalParser.tidy_notes: ++ if lines_changed_only and fix.line not in ranges: ++ continue ++ comment_output += repr(fix) ++ tidy_notes.append(fix) ++ if comment_output: ++ Globals.PAYLOAD_TIDY += f"
{filename}
\n" ++ Globals.PAYLOAD_TIDY += comment_output ++ GlobalParser.tidy_notes.clear() # empty list to avoid duplicated output ++ ++ if Path("clang_format_output.xml").stat().st_size: ++ parse_format_replacements_xml(PurePath(filename).as_posix()) ++ if GlobalParser.format_advice and GlobalParser.format_advice[-1].replaced_lines: ++ should_comment = lines_changed_only == 0 ++ if not should_comment: ++ for line in [ ++ replacement.line ++ for replacement in GlobalParser.format_advice[-1].replaced_lines ++ ]: ++ if line in ranges: ++ should_comment = True ++ break ++ if should_comment: ++ if not Globals.OUTPUT: ++ Globals.OUTPUT = "\n## :scroll: " ++ Globals.OUTPUT += "Run `clang-format` on the following files\n" ++ Globals.OUTPUT += f"- [ ] {file_obj['filename']}\n" ++ ++ ++def capture_clang_tools_output( ++ version: str, ++ checks: str, ++ style: str, ++ lines_changed_only: int, ++ database: str, ++ repo_root: str, ++): ++ """Execute and capture all output from clang-tidy and clang-format. This aggregates ++ results in the :attr:`~cpp_linter.Globals.OUTPUT`. ++ ++ :param version: The version of clang-tidy to run. ++ :param checks: The `str` of comma-separated regulate expressions that describe ++ the desired clang-tidy checks to be enabled/configured. ++ :param style: The clang-format style rules to adhere. Set this to 'file' to ++ use the relative-most .clang-format configuration file. ++ :param lines_changed_only: A flag that forces focus on only changes in the event's ++ diff info. ++ :param database: The path to the compilation database. ++ :param repo_root: The path to the repository root folder. ++ """ ++ # temporary cache of parsed notifications for use in log commands ++ tidy_notes: List[TidyNotification] = [] ++ for file in Globals.FILES: ++ filename = cast(str, file["filename"]) ++ start_log_group(f"Performing checkup on {filename}") ++ run_clang_tidy( ++ filename, file, version, checks, lines_changed_only, database, repo_root ++ ) ++ run_clang_format(filename, file, version, style, lines_changed_only) ++ end_log_group() ++ ++ create_comment_body(filename, file, lines_changed_only, tidy_notes) ++ ++ if Globals.PAYLOAD_TIDY: ++ if not Globals.OUTPUT: ++ Globals.OUTPUT = "\n" ++ else: ++ Globals.OUTPUT += "\n---\n" ++ Globals.OUTPUT += "## :speech_balloon: Output from `clang-tidy`\n" ++ Globals.OUTPUT += Globals.PAYLOAD_TIDY ++ GlobalParser.tidy_notes = tidy_notes[:] # restore cache of notifications ++ ++ ++def post_push_comment(base_url: str, user_id: int) -> bool: ++ """POST action's results for a push event. ++ ++ :param base_url: The root of the url used to interact with the REST API via ++ `requests`. ++ :param user_id: The user's account ID number. ++ ++ :returns: ++ A bool describing if the linter checks passed. This is used as the action's ++ output value (a soft exit code). ++ """ ++ comments_url = base_url + f"commits/{GITHUB_SHA}/comments" ++ remove_bot_comments(comments_url, user_id) ++ ++ if Globals.OUTPUT: # diff comments are not supported for push events (yet) ++ payload = json.dumps({"body": Globals.OUTPUT}) ++ logger.debug("payload body:\n%s", json.dumps({"body": Globals.OUTPUT})) ++ Globals.response_buffer = requests.post( ++ comments_url, headers=API_HEADERS, data=payload ++ ) ++ logger.info( ++ "Got %d response from POSTing comment", Globals.response_buffer.status_code ++ ) ++ log_response_msg() ++ return bool(Globals.OUTPUT) ++ ++ ++def post_diff_comments(base_url: str, user_id: int) -> bool: ++ """Post comments inside a unified diff (only PRs are supported). ++ ++ :param base_url: The root of the url used to interact with the REST API via ++ `requests`. ++ :param user_id: The user's account ID number. ++ ++ :returns: ++ A bool describing if the linter checks passed. This is used as the action's ++ output value (a soft exit code). ++ """ ++ comments_url = base_url + "pulls/comments/" # for use with comment_id ++ payload = list_diff_comments(2) # only focus on additions in diff ++ logger.info("Posting %d comments", len(payload)) ++ ++ # uncomment the next 3 lines for debug output without posting a comment ++ # for i, comment in enumerate(payload): ++ # logger.debug("comments %d: %s", i, json.dumps(comment, indent=2)) ++ # return ++ ++ # get existing review comments ++ reviews_url = base_url + f'pulls/{Globals.EVENT_PAYLOAD["number"]}/' ++ Globals.response_buffer = requests.get(reviews_url + "comments") ++ existing_comments = json.loads(Globals.response_buffer.text) ++ # filter out comments not made by our bot ++ for index, comment in enumerate(existing_comments): ++ if not comment["body"].startswith(""): ++ del existing_comments[index] ++ ++ # conditionally post comments in the diff ++ for i, body in enumerate(payload): ++ # check if comment is already there ++ already_posted = False ++ comment_id = None ++ for comment in existing_comments: ++ if ( ++ int(comment["user"]["id"]) == user_id ++ and comment["line"] == body["line"] ++ and comment["path"] == body["path"] ++ ): ++ already_posted = True ++ if comment["body"] != body["body"]: ++ comment_id = str(comment["id"]) # use this to update comment ++ else: ++ break ++ if already_posted and comment_id is None: ++ logger.info("comment %d already posted", i) ++ continue # don't bother re-posting the same comment ++ ++ # update ot create a review comment (in the diff) ++ logger.debug("Payload %d body = %s", i, json.dumps(body)) ++ if comment_id is not None: ++ Globals.response_buffer = requests.patch( ++ comments_url + comment_id, ++ headers=API_HEADERS, ++ data=json.dumps({"body": body["body"]}), ++ ) ++ logger.info( ++ "Got %d from PATCHing comment %d (%d)", ++ Globals.response_buffer.status_code, ++ i, ++ comment_id, ++ ) ++ log_response_msg() ++ else: ++ Globals.response_buffer = requests.post( ++ reviews_url + "comments", headers=API_HEADERS, data=json.dumps(body) ++ ) ++ logger.info( ++ "Got %d from POSTing review comment %d", ++ Globals.response_buffer.status_code, ++ i, ++ ) ++ log_response_msg() ++ return bool(payload) ++ ++ ++def post_pr_comment(base_url: str, user_id: int) -> bool: ++ """POST action's results for a push event. ++ ++ :param base_url: The root of the url used to interact with the REST API via ++ `requests`. ++ :param user_id: The user's account ID number. ++ ++ :returns: ++ A bool describing if the linter checks passed. This is used as the action's ++ output value (a soft exit code). ++ """ ++ comments_url = base_url + f'issues/{Globals.EVENT_PAYLOAD["number"]}/comments' ++ remove_bot_comments(comments_url, user_id) ++ payload = "" ++ if Globals.OUTPUT: ++ payload = json.dumps({"body": Globals.OUTPUT}) ++ logger.debug( ++ "payload body:\n%s", json.dumps({"body": Globals.OUTPUT}, indent=2) ++ ) ++ Globals.response_buffer = requests.post( ++ comments_url, headers=API_HEADERS, data=payload ++ ) ++ logger.info("Got %d from POSTing comment", Globals.response_buffer.status_code) ++ log_response_msg() ++ return bool(payload) ++ ++ ++def post_results(use_diff_comments: bool, user_id: int = 41898282): ++ """Post action's results using REST API. ++ ++ :param use_diff_comments: This flag enables making/updating comments in the PR's ++ diff info. ++ :param user_id: The user's account ID number. Defaults to the generic bot's ID. ++ """ ++ if not GITHUB_TOKEN: ++ logger.error("The GITHUB_TOKEN is required!") ++ sys.exit(set_exit_code(1)) ++ ++ base_url = f"{GITHUB_API_URL}/repos/{GITHUB_REPOSITORY}/" ++ checks_passed = True ++ if GITHUB_EVENT_NAME == "pull_request": ++ checks_passed = post_pr_comment(base_url, user_id) ++ if use_diff_comments: ++ checks_passed = post_diff_comments(base_url, user_id) ++ elif GITHUB_EVENT_NAME == "push": ++ checks_passed = post_push_comment(base_url, user_id) ++ set_exit_code(1 if checks_passed else 0) ++ ++ ++def make_annotations( ++ style: str, file_annotations: bool, lines_changed_only: int ++) -> bool: ++ """Use github log commands to make annotations from clang-format and ++ clang-tidy output. ++ ++ :param style: The chosen code style guidelines. The value 'file' is replaced with ++ 'custom style'. ++ ++ :returns: ++ A boolean describing if any annotations were made. ++ """ ++ count = 0 ++ files = ( ++ Globals.FILES ++ if GITHUB_EVENT_NAME == "pull_request" or isinstance(Globals.FILES, list) ++ else cast(Dict[str, Any], Globals.FILES)["files"] ++ ) ++ for advice, file in zip(GlobalParser.format_advice, files): ++ line_filter = range_of_changed_lines(file, lines_changed_only) ++ if advice.replaced_lines: ++ if file_annotations: ++ output = advice.log_command(style, line_filter) ++ if output is not None: ++ log_commander.info(output) ++ count += 1 ++ for note in GlobalParser.tidy_notes: ++ if lines_changed_only: ++ filename = note.filename.replace("\\", "/") ++ line_filter = [] ++ for file in files: ++ if filename == file["filename"]: ++ line_filter = range_of_changed_lines(file, lines_changed_only) ++ break ++ else: ++ continue ++ if note.line in line_filter: ++ count += 1 ++ log_commander.info(note.log_command()) ++ else: ++ count += 1 ++ log_commander.info(note.log_command()) ++ logger.info("Created %d annotations", count) ++ return bool(count) ++ ++ ++def parse_ignore_option(paths: str) -> Tuple[List[str], List[str]]: ++ """Parse a given string of paths (separated by a ``|``) into ``ignored`` and ++ ``not_ignored`` lists of strings. ++ ++ :param paths: This argument conforms to the input value of CLI arg ++ :cli-opt:`ignore`. ++ ++ :returns: ++ Returns a tuple of lists in which each list is a set of strings. ++ ++ - index 0 is the ``ignored`` list ++ - index 1 is the ``not_ignored`` list ++ """ ++ ignored, not_ignored = ([], []) ++ ++ for path in paths.split("|"): ++ is_included = path.startswith("!") ++ if path.startswith("!./" if is_included else "./"): ++ path = path.replace("./", "", 1) # relative dir is assumed ++ path = path.strip() # strip leading/trailing spaces ++ if is_included: ++ not_ignored.append(path[1:]) # strip leading `!` ++ else: ++ ignored.append(path) ++ ++ # auto detect submodules ++ gitmodules = Path(".gitmodules") ++ if gitmodules.exists(): ++ submodules = configparser.ConfigParser() ++ submodules.read(gitmodules.resolve().as_posix()) ++ for module in submodules.sections(): ++ path = submodules[module]["path"] ++ if path not in not_ignored: ++ logger.info("Appending submodule to ignored paths: %s", path) ++ ignored.append(path) ++ ++ if ignored: ++ logger.info( ++ "Ignoring the following paths/files:\n\t./%s", ++ "\n\t./".join(f for f in ignored), ++ ) ++ if not_ignored: ++ logger.info( ++ "Not ignoring the following paths/files:\n\t./%s", ++ "\n\t./".join(f for f in not_ignored), ++ ) ++ return (ignored, not_ignored) ++ ++ ++def main(): ++ """The main script.""" ++ ++ # The parsed CLI args ++ args = cli_arg_parser.parse_args() ++ ++ # force files-changed-only to reflect value of lines-changed-only ++ if args.lines_changed_only: ++ args.files_changed_only = True ++ ++ # set logging verbosity ++ logger.setLevel(int(args.verbosity)) ++ ++ # prepare ignored paths list ++ ignored, not_ignored = parse_ignore_option(args.ignore) ++ ++ logger.info("processing %s event", GITHUB_EVENT_NAME) ++ ++ # change working directory ++ os.chdir(args.repo_root) ++ ++ if GITHUB_EVENT_PATH: ++ # load event's json info about the workflow run ++ Globals.EVENT_PAYLOAD = json.loads( ++ Path(GITHUB_EVENT_PATH).read_text(encoding="utf-8") ++ ) ++ if logger.getEffectiveLevel() <= logging.DEBUG: ++ start_log_group("Event json from the runner") ++ logger.debug(json.dumps(Globals.EVENT_PAYLOAD)) ++ end_log_group() ++ ++ exit_early = False ++ if args.files_changed_only: ++ get_list_of_changed_files() ++ exit_early = not filter_out_non_source_files( ++ args.extensions, ++ ignored, ++ not_ignored, ++ ) ++ if not exit_early: ++ verify_files_are_present() ++ else: ++ exit_early = not list_source_files(args.extensions, ignored, not_ignored) ++ end_log_group() ++ if exit_early: ++ sys.exit(set_exit_code(0)) ++ ++ capture_clang_tools_output( ++ args.version, ++ args.tidy_checks, ++ args.style, ++ args.lines_changed_only, ++ args.database, ++ args.repo_root, ++ ) ++ ++ start_log_group("Posting comment(s)") ++ thread_comments_allowed = True ++ if GITHUB_EVENT_PATH and "private" in Globals.EVENT_PAYLOAD["repository"]: ++ thread_comments_allowed = ( ++ Globals.EVENT_PAYLOAD["repository"]["private"] is not True ++ ) ++ if args.thread_comments and thread_comments_allowed: ++ post_results(False) # False is hard-coded to disable diff comments. ++ set_exit_code( ++ int( ++ make_annotations(args.style, args.file_annotations, args.lines_changed_only) ++ ) ++ ) ++ end_log_group() ++ ++ ++if __name__ == "__main__": ++ main() +diff --git a/cpp_linter/thread_comments.py b/cpp_linter/thread_comments.py +new file mode 100644 +index 0000000..1d0699a +--- /dev/null ++++ b/cpp_linter/thread_comments.py +@@ -0,0 +1,269 @@ ++"""A module to house the various functions for traversing/adjusting comments""" ++from typing import Union, cast, List, Optional, Dict, Any ++import json ++from pathlib import Path ++import requests ++from . import ( ++ Globals, ++ GlobalParser, ++ logger, ++ API_HEADERS, ++ GITHUB_SHA, ++ log_response_msg, ++ range_of_changed_lines, ++) ++ ++ ++def remove_bot_comments(comments_url: str, user_id: int): ++ """Traverse the list of comments made by a specific user ++ and remove all. ++ ++ :param comments_url: The URL used to fetch the comments. ++ :param user_id: The user's account id number. ++ """ ++ logger.info("comments_url: %s", comments_url) ++ Globals.response_buffer = requests.get(comments_url) ++ if not log_response_msg(): ++ return # error getting comments for the thread; stop here ++ comments = Globals.response_buffer.json() ++ for comment in comments: ++ # only search for comments from the user's ID and ++ # whose comment body begins with a specific html comment ++ if ( ++ int(comment["user"]["id"]) == user_id ++ # the specific html comment is our action's name ++ and comment["body"].startswith("") ++ ): ++ # remove other outdated comments but don't remove the last comment ++ Globals.response_buffer = requests.delete( ++ comment["url"], ++ headers=API_HEADERS, ++ ) ++ logger.info( ++ "Got %d from DELETE %s", ++ Globals.response_buffer.status_code, ++ comment["url"][comment["url"].find(".com") + 4 :], ++ ) ++ log_response_msg() ++ logger.debug( ++ "comment id %d from user %s (%d)", ++ comment["id"], ++ comment["user"]["login"], ++ comment["user"]["id"], ++ ) ++ with open("comments.json", "w", encoding="utf-8") as json_comments: ++ json.dump(comments, json_comments, indent=4) ++ ++ ++def aggregate_tidy_advice(lines_changed_only: int) -> List[Dict[str, Any]]: ++ """Aggregate a list of json contents representing advice from clang-tidy ++ suggestions. ++ ++ :param lines_changed_only: A flag indicating the focus of the advice that ++ should be headed. ++ """ ++ results = [] ++ for fixit, file in zip(GlobalParser.tidy_advice, Globals.FILES): ++ for diag in fixit.diagnostics: ++ ranges = range_of_changed_lines(file, lines_changed_only) ++ if lines_changed_only and diag.line not in ranges: ++ continue ++ ++ # base body of comment ++ body = "\n## :speech_balloon: Clang-tidy\n**" ++ body += diag.name + "**\n>" + diag.message ++ ++ # get original code ++ filename = Path(cast(str, file["filename"])) ++ # the list of lines in a file ++ lines = filename.read_text(encoding="utf-8").splitlines() ++ ++ # aggregate clang-tidy advice ++ suggestion = "\n```suggestion\n" ++ is_multiline_fix = False ++ fix_lines: List[int] = [] # a list of line numbers for the suggested fixes ++ line = "" # the line that concerns the fix/comment ++ for i, tidy_fix in enumerate(diag.replacements): ++ line = lines[tidy_fix.line - 1] ++ if not fix_lines: ++ fix_lines.append(tidy_fix.line) ++ elif tidy_fix.line not in fix_lines: ++ is_multiline_fix = True ++ break ++ if i: # if this isn't the first tidy_fix for the same line ++ last_fix = diag.replacements[i - 1] ++ suggestion += ( ++ line[last_fix.cols + last_fix.null_len - 1 : tidy_fix.cols - 1] ++ + tidy_fix.text.decode() ++ ) ++ else: ++ suggestion += line[: tidy_fix.cols - 1] + tidy_fix.text.decode() ++ if not is_multiline_fix and diag.replacements: ++ # complete suggestion with original src code and closing md fence ++ last_fix = diag.replacements[len(diag.replacements) - 1] ++ suggestion += line[last_fix.cols + last_fix.null_len - 1 : -1] + "\n```" ++ body += suggestion ++ ++ results.append( ++ dict( ++ body=body, ++ commit_id=GITHUB_SHA, ++ line=diag.line, ++ path=fixit.filename, ++ side="RIGHT", ++ ) ++ ) ++ return results ++ ++ ++def aggregate_format_advice(lines_changed_only: int) -> List[Dict[str, Any]]: ++ """Aggregate a list of json contents representing advice from clang-format ++ suggestions.""" ++ results = [] ++ for fmt_advice, file in zip(GlobalParser.format_advice, Globals.FILES): ++ ++ # get original code ++ filename = Path(file["filename"]) ++ # the list of lines from the src file ++ lines = filename.read_text(encoding="utf-8").splitlines() ++ ++ # aggregate clang-format suggestion ++ line = "" # the line that concerns the fix ++ for fixed_line in fmt_advice.replaced_lines: ++ # clang-format can include advice that starts/ends outside the diff's domain ++ ranges = range_of_changed_lines(file, lines_changed_only) ++ if lines_changed_only and fixed_line.line not in ranges: ++ continue # line is out of scope for diff, so skip this fix ++ ++ # assemble the suggestion ++ body = "## :scroll: clang-format advice\n```suggestion\n" ++ line = lines[fixed_line.line - 1] ++ # logger.debug("%d >>> %s", fixed_line.line, line[:-1]) ++ for fix_index, line_fix in enumerate(fixed_line.replacements): ++ # logger.debug( ++ # "%s >>> %s", repr(line_fix), line_fix.text.encode("utf-8") ++ # ) ++ if fix_index: ++ last_fix = fixed_line.replacements[fix_index - 1] ++ body += line[ ++ last_fix.cols + last_fix.null_len - 1 : line_fix.cols - 1 ++ ] ++ body += line_fix.text ++ else: ++ body += line[: line_fix.cols - 1] + line_fix.text ++ # complete suggestion with original src code and closing md fence ++ last_fix = fixed_line.replacements[-1] ++ body += line[last_fix.cols + last_fix.null_len - 1 : -1] + "\n```" ++ # logger.debug("body <<< %s", body) ++ ++ # create a suggestion from clang-format advice ++ results.append( ++ dict( ++ body=body, ++ commit_id=GITHUB_SHA, ++ line=fixed_line.line, ++ path=fmt_advice.filename, ++ side="RIGHT", ++ ) ++ ) ++ return results ++ ++ ++def concatenate_comments( ++ tidy_advice: list, format_advice: list ++) -> List[Dict[str, Union[str, int]]]: ++ """Concatenate comments made to the same line of the same file. ++ ++ :param tidy_advice: Pass the output from `aggregate_tidy_advice()` here. ++ :param format_advice: Pass the output from `aggregate_format_advice()` here. ++ """ ++ # traverse comments from clang-format ++ for index, comment_body in enumerate(format_advice): ++ # check for comments from clang-tidy on the same line ++ comment_index = None ++ for i, payload in enumerate(tidy_advice): ++ if ( ++ payload["line"] == comment_body["line"] ++ and payload["path"] == comment_body["path"] ++ ): ++ comment_index = i # mark this comment for concatenation ++ break ++ if comment_index is not None: ++ # append clang-format advice to clang-tidy output/suggestion ++ tidy_advice[comment_index]["body"] += "\n" + comment_body["body"] ++ del format_advice[index] # remove duplicate comment ++ return tidy_advice + format_advice ++ ++ ++def list_diff_comments(lines_changed_only: int) -> List[Dict[str, Union[str, int]]]: ++ """Aggregate list of comments for use in the event's diff. This function assumes ++ that the CLI option ``--lines_changed_only`` is set to True. ++ ++ :param lines_changed_only: A flag indicating the focus of the advice that ++ should be headed. ++ ++ :returns: ++ A list of comments (each element as json content). ++ """ ++ return concatenate_comments( ++ aggregate_tidy_advice(lines_changed_only), ++ aggregate_format_advice(lines_changed_only), ++ ) ++ ++ ++def get_review_id(reviews_url: str, user_id: int) -> Optional[int]: ++ """Dismiss all stale reviews (only the ones made by our bot). ++ ++ :param reviews_url: The URL used to fetch the review comments. ++ :param user_id: The user's account id number. ++ ++ :returns: ++ The ID number of the review created by the action's generic bot. ++ """ ++ logger.info(" review_url: %s", reviews_url) ++ Globals.response_buffer = requests.get(reviews_url) ++ review_id = find_review(json.loads(Globals.response_buffer.text), user_id) ++ if review_id is None: # create a PR review ++ Globals.response_buffer = requests.post( ++ reviews_url, ++ headers=API_HEADERS, ++ data=json.dumps( ++ { ++ "body": "\n" ++ "CPP Linter Action found no problems", ++ "event": "COMMENTED", ++ } ++ ), ++ ) ++ logger.info( ++ "Got %d from POSTing new(/temp) PR review", ++ Globals.response_buffer.status_code, ++ ) ++ Globals.response_buffer = requests.get(reviews_url) ++ if Globals.response_buffer.status_code != 200 and log_response_msg(): ++ raise RuntimeError("could not create a review for comments") ++ reviews = json.loads(Globals.response_buffer.text) ++ reviews.reverse() # traverse the list in reverse ++ review_id = find_review(reviews, user_id) ++ return review_id ++ ++ ++def find_review(reviews: dict, user_id: int) -> Optional[int]: ++ """Find a review created by a certain user ID. ++ ++ :param reviews: the JSON object fetched via GIT REST API. ++ :param user_id: The user account's ID number ++ ++ :returns: ++ An ID that corresponds to the specified ``user_id``. ++ """ ++ review_id = None ++ for review in reviews: ++ if int(review["user"]["id"]) == user_id and review["body"].startswith( ++ "" ++ ): ++ review_id = int(review["id"]) ++ break # there will only be 1 review from this action, so break when found ++ ++ logger.info(" review_id: %d", review_id) ++ return review_id +diff --git a/docs/API-Reference/cpp_linter.clang_format_xml.rst b/docs/API-Reference/cpp_linter.clang_format_xml.rst +new file mode 100644 +index 0000000..6011fdf +--- /dev/null ++++ b/docs/API-Reference/cpp_linter.clang_format_xml.rst +@@ -0,0 +1,10 @@ ++clang_format_xml module ++======================= ++ ++.. admonition:: Info ++ :class: info ++ ++ This API is experimental and not actually used in production. ++ ++.. automodule:: cpp_linter.clang_format_xml ++ :members: +diff --git a/docs/API-Reference/cpp_linter.clang_tidy.rst b/docs/API-Reference/cpp_linter.clang_tidy.rst +new file mode 100644 +index 0000000..9aecade +--- /dev/null ++++ b/docs/API-Reference/cpp_linter.clang_tidy.rst +@@ -0,0 +1,5 @@ ++clang_tidy module ++================= ++ ++.. automodule:: cpp_linter.clang_tidy ++ :members: +diff --git a/docs/API-Reference/cpp_linter.clang_tidy_yml.rst b/docs/API-Reference/cpp_linter.clang_tidy_yml.rst +new file mode 100644 +index 0000000..695a7d0 +--- /dev/null ++++ b/docs/API-Reference/cpp_linter.clang_tidy_yml.rst +@@ -0,0 +1,10 @@ ++clang_tidy_yml module ++===================== ++ ++.. admonition:: Info ++ :class: info ++ ++ This API is experimental and not actually used in production. ++ ++.. automodule:: cpp_linter.clang_tidy_yml ++ :members: +diff --git a/docs/API-Reference/cpp_linter.rst b/docs/API-Reference/cpp_linter.rst +new file mode 100644 +index 0000000..a2ba1f3 +--- /dev/null ++++ b/docs/API-Reference/cpp_linter.rst +@@ -0,0 +1,5 @@ ++Base module ++=========== ++ ++.. automodule:: cpp_linter ++ :members: +diff --git a/docs/API-Reference/cpp_linter.run.rst b/docs/API-Reference/cpp_linter.run.rst +new file mode 100644 +index 0000000..b2c8159 +--- /dev/null ++++ b/docs/API-Reference/cpp_linter.run.rst +@@ -0,0 +1,5 @@ ++Run module ++========== ++ ++.. automodule:: cpp_linter.run ++ :members: +diff --git a/docs/API-Reference/cpp_linter.thread_comments.rst b/docs/API-Reference/cpp_linter.thread_comments.rst +new file mode 100644 +index 0000000..ceb3005 +--- /dev/null ++++ b/docs/API-Reference/cpp_linter.thread_comments.rst +@@ -0,0 +1,5 @@ ++thread_comments module ++====================== ++ ++.. automodule:: cpp_linter.thread_comments ++ :members: +diff --git a/docs/_static/extra_css.css b/docs/_static/extra_css.css +new file mode 100644 +index 0000000..8e2a15e +--- /dev/null ++++ b/docs/_static/extra_css.css +@@ -0,0 +1,10 @@ ++tbody .stub, ++thead { ++ background-color: var(--md-accent-bg-color--light); ++ color: var(--md-default-bg-color); ++} ++ ++.md-header, ++.md-nav--primary .md-nav__title[for="__drawer"] { ++ background-color: #4051b5; ++} +diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico +new file mode 100644 +index 0000000..c5de55c +Binary files /dev/null and b/docs/_static/favicon.ico differ +diff --git a/docs/_static/logo.png b/docs/_static/logo.png +new file mode 100644 +index 0000000..9c3e4db +Binary files /dev/null and b/docs/_static/logo.png differ +diff --git a/docs/building_docs.rst b/docs/building_docs.rst +new file mode 100644 +index 0000000..069f108 +--- /dev/null ++++ b/docs/building_docs.rst +@@ -0,0 +1,21 @@ ++How to build the docs ++===================== ++ ++From the root directory of the repository, do the following to steps ++ ++1. Install docs' dependencies ++ ++ .. code-block:: text ++ ++ pip install -r docs/requirements.txt ++ ++ On Linux, you may need to use ``pip3`` instead. ++ ++2. Build the docs ++ ++ .. code-block:: text ++ ++ sphinx-build docs docs/_build/html ++ ++ Browse the files in docs/_build/html with your internet browser to see the rendered ++ output. +diff --git a/docs/conf.py b/docs/conf.py +new file mode 100644 +index 0000000..b6d772e +--- /dev/null ++++ b/docs/conf.py +@@ -0,0 +1,138 @@ ++# pylint: disable=all ++# Configuration file for the Sphinx documentation builder. ++# ++# For the full list of built-in configuration values, see the documentation: ++# https://www.sphinx-doc.org/en/master/usage/configuration.html ++ ++import re ++from pathlib import Path ++import io ++from docutils.nodes import Node ++from sphinx import addnodes ++from sphinx.application import Sphinx ++from sphinx.environment import BuildEnvironment ++from cpp_linter.run import cli_arg_parser ++ ++# -- Project information ----------------------------------------------------- ++# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information ++project = "cpp-linter" ++copyright = "2022, 2bndy5" ++author = "2bndy5" ++release = "2.0.0" ++ ++# -- General configuration --------------------------------------------------- ++# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration ++extensions = [ ++ "sphinx_immaterial", ++ "sphinx.ext.autodoc", ++ "sphinx.ext.intersphinx", ++ "sphinx.ext.viewcode", ++] ++ ++intersphinx_mapping = { ++ "python": ("https://docs.python.org/3", None), ++ "requests": ("https://requests.readthedocs.io/en/latest/", None), ++} ++ ++templates_path = ["_templates"] ++exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] ++ ++default_role = "any" ++ ++# -- Options for HTML output ------------------------------------------------- ++# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output ++ ++html_theme = "sphinx_immaterial" ++html_static_path = ["_static"] ++html_logo = "_static/logo.png" ++html_favicon = "_static/favicon.ico" ++html_css_files = ["extra_css.css"] ++html_title = "cpp-linter" ++ ++html_theme_options = { ++ "repo_url": "https://github.com/cpp-linter/cpp-linter", ++ "repo_name": "cpp-linter", ++ "repo_type": "github", ++ "palette": [ ++ { ++ "media": "(prefers-color-scheme: light)", ++ "scheme": "default", ++ "primary": "light-blue", ++ "accent": "deep-purple", ++ "toggle": { ++ "icon": "material/lightbulb-outline", ++ "name": "Switch to dark mode", ++ }, ++ }, ++ { ++ "media": "(prefers-color-scheme: dark)", ++ "scheme": "slate", ++ "primary": "light-blue", ++ "accent": "deep-purple", ++ "toggle": { ++ "icon": "material/lightbulb", ++ "name": "Switch to light mode", ++ }, ++ }, ++ ], ++ "features": [ ++ "navigation.top", ++ "navigation.tabs", ++ "navigation.tabs.sticky", ++ "toc.sticky", ++ "toc.follow", ++ "search.share", ++ ], ++} ++ ++object_description_options = [ ++ ("py:parameter", dict(include_in_toc=False)), ++] ++ ++# -- Parse CLI args from `-h` output ------------------------------------- ++ ++ ++def parse_cli_option(env: BuildEnvironment, sig: str, sig_node: Node): ++ """parse the given signature of a CLI option and ++ return the docutil nodes accordingly.""" ++ opt_names = sig.split(", ") ++ sig_node["is_multiline"] = True ++ for i, opt_name in enumerate(opt_names): ++ name = addnodes.desc_signature_line("", "--" if i else opt_name) ++ if not i: ++ name["add_permalink"] = True ++ else: ++ name += addnodes.desc_name(opt_name, opt_name.lstrip("-")) ++ sig_node += name ++ # print(sig_node.pformat()) ++ return opt_names[-1].lstrip("-") ++ ++ ++def setup(app: Sphinx): ++ """Generate a doc from the executable script's ``--help`` output.""" ++ app.add_object_type( ++ "cli-opt", ++ "cli-opt", ++ objname="Command Line Interface option", ++ indextemplate="pair: %s; Command Line Interface option", ++ parse_node=parse_cli_option, ++ ) ++ ++ with io.StringIO() as help_out: ++ cli_arg_parser.print_help(help_out) ++ output = help_out.getvalue() ++ first_line = re.search(r"^options:\s*\n", output, re.MULTILINE) ++ if first_line is None: ++ raise OSError("unrecognized output from `cpp-linter -h`") ++ output = output[first_line.end(0) :] ++ doc = "Command Line Interface Options\n==============================\n\n" ++ CLI_OPT_NAME = re.compile(r"^\s*(\-\w)\s?[A-Z_]*,\s(\-\-.*?)\s") ++ for line in output.splitlines(): ++ match = CLI_OPT_NAME.search(line) ++ if match is not None: ++ # print(match.groups()) ++ doc += "\n.. cli-opt:: " + ", ".join(match.groups()) + "\n\n" ++ doc += line + "\n" ++ cli_doc = Path(app.srcdir, "cli_args.rst") ++ cli_doc.unlink(missing_ok=True) ++ cli_doc.write_text(doc) +diff --git a/docs/index.rst b/docs/index.rst +new file mode 100644 +index 0000000..f723b71 +--- /dev/null ++++ b/docs/index.rst +@@ -0,0 +1,29 @@ ++.. include:: ../README.rst ++ ++.. toctree:: ++ :hidden: ++ ++ self ++ building_docs ++ ++.. toctree:: ++ :hidden: ++ ++ cli_args ++ ++.. toctree:: ++ :hidden: ++ :caption: API Reference ++ ++ API-Reference/cpp_linter ++ API-Reference/cpp_linter.run ++ API-Reference/cpp_linter.clang_tidy ++ API-Reference/cpp_linter.clang_tidy_yml ++ API-Reference/cpp_linter.clang_format_xml ++ API-Reference/cpp_linter.thread_comments ++ ++Indices and tables ++================== ++ ++* :ref:`genindex` ++* :ref:`modindex` +diff --git a/docs/requirements.txt b/docs/requirements.txt +new file mode 100644 +index 0000000..d078f24 +--- /dev/null ++++ b/docs/requirements.txt +@@ -0,0 +1 @@ ++sphinx-immaterial +diff --git a/pyproject.toml b/pyproject.toml +new file mode 100644 +index 0000000..981b64c +--- /dev/null ++++ b/pyproject.toml +@@ -0,0 +1,616 @@ ++[build-system] ++requires = ["setuptools>=45", "setuptools-scm"] ++build-backend = "setuptools.build_meta" ++ ++[project] ++name = "cpp-linter" ++description = "Run clang-format and clang-tidy on a batch of files." ++readme = "README.md" ++keywords = ["clang", "clang-tools", "linter", "clang-tidy", "clang-format"] ++license = {text = "MIT License"} ++authors = [ ++ { name = "Brendan Doherty", email = "2bndy5@gmail.com" }, ++ { name = "Peter Shen", email = "xianpeng.shen@gmail.com" }, ++] ++dependencies = [ ++ "requests", ++ "pyyaml", ++] ++classifiers = [ ++ # https://pypi.org/pypi?%3Aaction=list_classifiers ++ "Development Status :: 5 - Production/Stable", ++ "License :: OSI Approved :: MIT License", ++ "Intended Audience :: Developers", ++ "Intended Audience :: System Administrators", ++ "Intended Audience :: Information Technology", ++ "Natural Language :: English", ++ "Operating System :: Microsoft :: Windows", ++ "Operating System :: POSIX :: Linux", ++ "Operating System :: MacOS", ++ "Programming Language :: Python :: 3", ++ "Topic :: Software Development :: Build Tools", ++] ++dynamic = ["version"] ++ ++[project.scripts] ++cpp-linter = "cpp_linter.run:main" ++ ++[project.urls] ++source = "https://github.com/cpp-linter/cpp-linter" ++tracker = "https://github.com/cpp-linter/cpp-linter/issues" ++ ++# ... other project metadata fields as specified in: ++# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/ ++ ++[tool.setuptools] ++zip-safe = false ++packages = ["cpp_linter"] ++ ++[tool.setuptools_scm] ++# It would be nice to include the commit hash in the version, but that ++# can't be done in a PEP 440-compatible way. ++version_scheme= "no-guess-dev" ++# Test PyPI does not support local versions. ++local_scheme = "no-local-version" ++fallback_version = "0.0.0" ++ ++[tool.mypy] ++show_error_codes = true ++show_column_numbers = true ++ ++[tool.pytest.ini_options] ++minversion = "6.0" ++addopts = "-vv" ++testpaths = ["tests"] ++ ++[tool.coverage] ++[tool.coverage.run] ++dynamic_context = "test_function" ++omit = [ ++ # don't include tests in coverage ++ "tests/*", ++] ++ ++[tool.coverage.json] ++pretty_print = true ++ ++[tool.coverage.html] ++show_contexts = true ++ ++[tool.coverage.report] ++# Regexes for lines to exclude from consideration ++exclude_lines = [ ++ # Have to re-enable the standard pragma ++ "pragma: no cover", ++ # Don\'t complain about missing debug-only code: ++ "def __repr__", ++ # the point of unit tests is to test parts of main() ++ "def main", ++ # ignore any branch that makes the module executable ++ 'if __name__ == "__main__"', ++ # ignore branches specific to type checking ++ "if TYPE_CHECKING", ++ # ignore the local secific debug statement related to not having rich installed ++ "if not FOUND_RICH_LIB", ++] ++ ++[tool.pylint.main] ++# Analyse import fallback blocks. This can be used to support both Python 2 and 3 ++# compatible code, which means that the block might have code that exists only in ++# one or another interpreter, leading to false positives when analysed. ++# analyse-fallback-blocks = ++ ++# Always return a 0 (non-error) status code, even if lint errors are found. This ++# is primarily useful in continuous integration scripts. ++# exit-zero = ++ ++# A comma-separated list of package or module names from where C extensions may ++# be loaded. Extensions are loading into the active Python interpreter and may ++# run arbitrary code. ++# extension-pkg-allow-list = ++ ++# A comma-separated list of package or module names from where C extensions may ++# be loaded. Extensions are loading into the active Python interpreter and may ++# run arbitrary code. (This is an alternative name to extension-pkg-allow-list ++# for backward compatibility.) ++# extension-pkg-whitelist = ++ ++# Return non-zero exit code if any of these messages/categories are detected, ++# even if score is above --fail-under value. Syntax same as enable. Messages ++# specified are enabled, while categories only check already-enabled messages. ++# fail-on = ++ ++# Specify a score threshold to be exceeded before program exits with error. ++fail-under = 10 ++ ++# Interpret the stdin as a python script, whose filename needs to be passed as ++# the module_or_package argument. ++# from-stdin = ++ ++# Files or directories to be skipped. They should be base names, not paths. ++ignore = ["CVS"] ++ ++# Add files or directories matching the regex patterns to the ignore-list. The ++# regex matches against paths and can be in Posix or Windows format. ++# ignore-paths = ++ ++# Files or directories matching the regex patterns are skipped. The regex matches ++# against base names, not paths. The default value ignores Emacs file locks ++# ignore-patterns = ++ ++# List of module names for which member attributes should not be checked (useful ++# for modules/projects where namespaces are manipulated during runtime and thus ++# existing member attributes cannot be deduced by static analysis). It supports ++# qualified module names, as well as Unix pattern matching. ++# ignored-modules = ++ ++# Python code to execute, usually for sys.path manipulation such as ++# pygtk.require(). ++# init-hook = ++ ++# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the ++# number of processors available to use. ++jobs = 2 ++ ++# Control the amount of potential inferred values when inferring a single object. ++# This can help the performance when dealing with large functions or complex, ++# nested conditions. ++limit-inference-results = 100 ++ ++# List of plugins (as comma separated values of python module names) to load, ++# usually to register additional checkers. ++# load-plugins = ++ ++# Pickle collected data for later comparisons. ++persistent = true ++ ++# Minimum Python version to use for version dependent checks. Will default to the ++# version used to run pylint. ++py-version = "3.10" ++ ++# Discover python modules and packages in the file system subtree. ++# recursive = ++ ++# When enabled, pylint would attempt to guess common misconfiguration and emit ++# user-friendly hints instead of false-positive error messages. ++suggestion-mode = true ++ ++# Allow loading of arbitrary C extensions. Extensions are imported into the ++# active Python interpreter and may run arbitrary code. ++# unsafe-load-any-extension = ++ ++[tool.pylint.basic] ++# Naming style matching correct argument names. ++argument-naming-style = "snake_case" ++ ++# Regular expression matching correct argument names. Overrides argument-naming- ++# style. If left empty, argument names will be checked with the set naming style. ++argument-rgx = "(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$" ++ ++# Naming style matching correct attribute names. ++attr-naming-style = "snake_case" ++ ++# Regular expression matching correct attribute names. Overrides attr-naming- ++# style. If left empty, attribute names will be checked with the set naming ++# style. ++attr-rgx = "(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$" ++ ++# Bad variable names which should always be refused, separated by a comma. ++bad-names = ["foo", "bar", "baz", "toto", "tutu", "tata"] ++ ++# Bad variable names regexes, separated by a comma. If names match any regex, ++# they will always be refused ++# bad-names-rgxs = ++ ++# Naming style matching correct class attribute names. ++class-attribute-naming-style = "any" ++ ++# Regular expression matching correct class attribute names. Overrides class- ++# attribute-naming-style. If left empty, class attribute names will be checked ++# with the set naming style. ++class-attribute-rgx = "([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$" ++ ++# Naming style matching correct class constant names. ++class-const-naming-style = "UPPER_CASE" ++ ++# Regular expression matching correct class constant names. Overrides class- ++# const-naming-style. If left empty, class constant names will be checked with ++# the set naming style. ++# class-const-rgx = ++ ++# Naming style matching correct class names. ++class-naming-style = "PascalCase" ++ ++# Regular expression matching correct class names. Overrides class-naming-style. ++# If left empty, class names will be checked with the set naming style. ++class-rgx = "[A-Z_][a-zA-Z0-9_]+$" ++ ++# Naming style matching correct constant names. ++const-naming-style = "UPPER_CASE" ++ ++# Regular expression matching correct constant names. Overrides const-naming- ++# style. If left empty, constant names will be checked with the set naming style. ++const-rgx = "(([A-Z_][A-Z0-9_]*)|(__.*__))$" ++ ++# Minimum line length for functions/classes that require docstrings, shorter ones ++# are exempt. ++docstring-min-length = -1 ++ ++# Naming style matching correct function names. ++function-naming-style = "snake_case" ++ ++# Regular expression matching correct function names. Overrides function-naming- ++# style. If left empty, function names will be checked with the set naming style. ++function-rgx = "(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$" ++ ++# Good variable names which should always be accepted, separated by a comma. ++good-names = ["r", "g", "b", "w", "i", "j", "k", "n", "x", "y", "z", "ex", "ok", "Run", "_"] ++ ++# Good variable names regexes, separated by a comma. If names match any regex, ++# they will always be accepted ++# good-names-rgxs = ++ ++# Include a hint for the correct naming format with invalid-name. ++# include-naming-hint = ++ ++# Naming style matching correct inline iteration names. ++inlinevar-naming-style = "any" ++ ++# Regular expression matching correct inline iteration names. Overrides ++# inlinevar-naming-style. If left empty, inline iteration names will be checked ++# with the set naming style. ++inlinevar-rgx = "[A-Za-z_][A-Za-z0-9_]*$" ++ ++# Naming style matching correct method names. ++method-naming-style = "snake_case" ++ ++# Regular expression matching correct method names. Overrides method-naming- ++# style. If left empty, method names will be checked with the set naming style. ++method-rgx = "(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$" ++ ++# Naming style matching correct module names. ++module-naming-style = "snake_case" ++ ++# Regular expression matching correct module names. Overrides module-naming- ++# style. If left empty, module names will be checked with the set naming style. ++module-rgx = "(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$" ++ ++# Colon-delimited sets of names that determine each other's naming style when the ++# name regexes allow several styles. ++# name-group = ++ ++# Regular expression which should only match function or class names that do not ++# require a docstring. ++no-docstring-rgx = "^_" ++ ++# List of decorators that produce properties, such as abc.abstractproperty. Add ++# to this list to register other decorators that produce valid properties. These ++# decorators are taken in consideration only for invalid-name. ++property-classes = ["abc.abstractproperty"] ++ ++# Regular expression matching correct type variable names. If left empty, type ++# variable names will be checked with the set naming style. ++# typevar-rgx = ++ ++# Naming style matching correct variable names. ++variable-naming-style = "snake_case" ++ ++# Regular expression matching correct variable names. Overrides variable-naming- ++# style. If left empty, variable names will be checked with the set naming style. ++variable-rgx = "(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$" ++ ++[tool.pylint.classes] ++# Warn about protected attribute access inside special methods ++# check-protected-access-in-special-methods = ++ ++# List of method names used to declare (i.e. assign) instance attributes. ++defining-attr-methods = ["__init__", "__new__", "setUp"] ++ ++# List of member names, which should be excluded from the protected access ++# warning. ++exclude-protected = ["_asdict", "_fields", "_replace", "_source", "_make"] ++ ++# List of valid names for the first argument in a class method. ++valid-classmethod-first-arg = ["cls"] ++ ++# List of valid names for the first argument in a metaclass class method. ++valid-metaclass-classmethod-first-arg = ["mcs"] ++ ++[tool.pylint.design] ++# List of regular expressions of class ancestor names to ignore when counting ++# public methods (see R0903) ++# exclude-too-few-public-methods = ++ ++# List of qualified class names to ignore when counting class parents (see R0901) ++# ignored-parents = ++ ++# Maximum number of arguments for function / method. ++max-args = 8 ++ ++# Maximum number of attributes for a class (see R0902). ++max-attributes = 11 ++ ++# Maximum number of boolean expressions in an if statement (see R0916). ++max-bool-expr = 5 ++ ++# Maximum number of branch for function / method body. ++max-branches = 12 ++ ++# Maximum number of locals for function / method body. ++max-locals = 18 ++ ++# Maximum number of parents for a class (see R0901). ++max-parents = 7 ++ ++# Maximum number of public methods for a class (see R0904). ++max-public-methods = 20 ++ ++# Maximum number of return / yield for function / method body. ++max-returns = 6 ++ ++# Maximum number of statements in function / method body. ++max-statements = 50 ++ ++# Minimum number of public methods for a class (see R0903). ++min-public-methods = 1 ++ ++[tool.pylint.exceptions] ++# Exceptions that will emit a warning when caught. ++overgeneral-exceptions = ["Exception"] ++ ++[tool.pylint.format] ++# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. ++expected-line-ending-format = "LF" ++ ++# Regexp for a line that is allowed to be longer than the limit. ++ignore-long-lines = "^\\s*(# )??$" ++ ++# Number of spaces of indent required inside a hanging or continued line. ++indent-after-paren = 4 ++ ++# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 ++# tab). ++indent-string = " " ++ ++# Maximum number of characters on a single line. ++max-line-length = 88 ++ ++# Maximum number of lines in a module. ++max-module-lines = 1000 ++ ++# Allow the body of a class to be on the same line as the declaration if body ++# contains single statement. ++# single-line-class-stmt = ++ ++# Allow the body of an if to be on the same line as the test if there is no else. ++# single-line-if-stmt = ++ ++[tool.pylint.imports] ++# List of modules that can be imported at any level, not just the top level one. ++# allow-any-import-level = ++ ++# Allow wildcard imports from modules that define __all__. ++# allow-wildcard-with-all = ++ ++# Deprecated modules which should not be used, separated by a comma. ++deprecated-modules = ["optparse", "tkinter.tix"] ++ ++# Output a graph (.gv or any supported image format) of external dependencies to ++# the given file (report RP0402 must not be disabled). ++# ext-import-graph = ++ ++# Output a graph (.gv or any supported image format) of all (i.e. internal and ++# external) dependencies to the given file (report RP0402 must not be disabled). ++# import-graph = ++ ++# Output a graph (.gv or any supported image format) of internal dependencies to ++# the given file (report RP0402 must not be disabled). ++# int-import-graph = ++ ++# Force import order to recognize a module as part of the standard compatibility ++# libraries. ++# known-standard-library = ++ ++# Force import order to recognize a module as part of a third party library. ++known-third-party = ["enchant"] ++ ++# Couples of modules and preferred modules, separated by a comma. ++# preferred-modules = ++ ++[tool.pylint.logging] ++# The type of string formatting that logging methods do. `old` means using % ++# formatting, `new` is for `{}` formatting. ++logging-format-style = "old" ++ ++# Logging modules to check that the string format arguments are in logging ++# function parameter format. ++logging-modules = ["logging"] ++ ++[tool.pylint."messages control"] ++# Only show warnings with the listed confidence levels. Leave empty to show all. ++# Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, UNDEFINED. ++confidence = ["HIGH", "CONTROL_FLOW", "INFERENCE", "INFERENCE_FAILURE", "UNDEFINED"] ++ ++# Disable the message, report, category or checker with the given id(s). You can ++# either give multiple identifiers separated by comma (,) or put this option ++# multiple times (only on the command line, not in the configuration file where ++# it should appear only once). You can also use "--disable=all" to disable ++# everything first and then re-enable specific checks. For example, if you want ++# to run only the similarities checker, you can use "--disable=all ++# --enable=similarities". If you want to run only the classes checker, but have ++# no Warning level messages displayed, use "--disable=all --enable=classes ++# --disable=W". ++disable = ["raw-checker-failed", "bad-inline-option", "locally-disabled", "file-ignored", "suppressed-message", "useless-suppression", "deprecated-pragma", "use-symbolic-message-instead", "invalid-sequence-index", "anomalous-backslash-in-string", "too-few-public-methods", "consider-using-f-string", "subprocess-run-check"] ++ ++# Enable the message, report, category or checker with the given id(s). You can ++# either give multiple identifier separated by comma (,) or put this option ++# multiple time (only on the command line, not in the configuration file where it ++# should appear only once). See also the "--disable" option for examples. ++enable = ["c-extension-no-member"] ++ ++[tool.pylint.miscellaneous] ++# List of note tags to take in consideration, separated by a comma. ++notes = ["FIXME", "XXX"] ++ ++# Regular expression of note tags to take in consideration. ++# notes-rgx = ++ ++[tool.pylint.refactoring] ++# Maximum number of nested blocks for function / method body ++max-nested-blocks = 5 ++ ++# Complete name of functions that never returns. When checking for inconsistent- ++# return-statements if a never returning function is called then it will be ++# considered as an explicit return statement and no message will be printed. ++never-returning-functions = ["sys.exit", "argparse.parse_error"] ++ ++[tool.pylint.reports] ++# Python expression which should return a score less than or equal to 10. You ++# have access to the variables 'fatal', 'error', 'warning', 'refactor', ++# 'convention', and 'info' which contain the number of messages in each category, ++# as well as 'statement' which is the total number of statements analyzed. This ++# score is used by the global evaluation report (RP0004). ++evaluation = "10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)" ++ ++# Template used to display messages. This is a python new-style format string ++# used to format the message information. See doc for all details. ++# msg-template = ++ ++# Set the output format. Available formats are text, parseable, colorized, json ++# and msvs (visual studio). You can also give a reporter class, e.g. ++# mypackage.mymodule.MyReporterClass. ++# output-format = ++ ++# Tells whether to display a full report or only the messages. ++# reports = ++ ++# Activate the evaluation score. ++score = true ++ ++[tool.pylint.similarities] ++# Comments are removed from the similarity computation ++ignore-comments = true ++ ++# Docstrings are removed from the similarity computation ++ignore-docstrings = true ++ ++# Imports are removed from the similarity computation ++# ignore-imports = ++ ++# Signatures are removed from the similarity computation ++ignore-signatures = true ++ ++# Minimum lines number of a similarity. ++min-similarity-lines = 4 ++ ++[tool.pylint.spelling] ++# Limits count of emitted suggestions for spelling mistakes. ++max-spelling-suggestions = 4 ++ ++# Spelling dictionary name. Available dictionaries: none. To make it work, ++# install the 'python-enchant' package. ++# spelling-dict = ++ ++# List of comma separated words that should be considered directives if they ++# appear at the beginning of a comment and should not be checked. ++spelling-ignore-comment-directives = "fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:" ++ ++# List of comma separated words that should not be checked. ++# spelling-ignore-words = ++ ++# A path to a file that contains the private dictionary; one word per line. ++# spelling-private-dict-file = ++ ++# Tells whether to store unknown words to the private dictionary (see the ++# --spelling-private-dict-file option) instead of raising a message. ++# spelling-store-unknown-words = ++ ++[tool.pylint.string] ++# This flag controls whether inconsistent-quotes generates a warning when the ++# character used as a quote delimiter is used inconsistently within a module. ++# check-quote-consistency = ++ ++# This flag controls whether the implicit-str-concat should generate a warning on ++# implicit string concatenation in sequences defined over several lines. ++# check-str-concat-over-line-jumps = ++ ++[tool.pylint.typecheck] ++# List of decorators that produce context managers, such as ++# contextlib.contextmanager. Add to this list to register other decorators that ++# produce valid context managers. ++contextmanager-decorators = ["contextlib.contextmanager"] ++ ++# List of members which are set dynamically and missed by pylint inference ++# system, and so shouldn't trigger E1101 when accessed. Python regular ++# expressions are accepted. ++# generated-members = ++ ++# Tells whether missing members accessed in mixin class should be ignored. A ++# class is considered mixin if its name matches the mixin-class-rgx option. ++# Tells whether to warn about missing members when the owner of the attribute is ++# inferred to be None. ++ignore-none = true ++ ++# This flag controls whether pylint should warn about no-member and similar ++# checks whenever an opaque object is returned when inferring. The inference can ++# return multiple potential results while evaluating a Python object, but some ++# branches might not be evaluated, which results in partial inference. In that ++# case, it might be useful to still emit no-member and other checks for the rest ++# of the inferred objects. ++ignore-on-opaque-inference = true ++ ++# List of symbolic message names to ignore for Mixin members. ++ignored-checks-for-mixins = ["no-member", "not-async-context-manager", "not-context-manager", "attribute-defined-outside-init"] ++ ++# List of class names for which member attributes should not be checked (useful ++# for classes with dynamically set attributes). This supports the use of ++# qualified names. ++ignored-classes = ["optparse.Values", "thread._local", "_thread._local"] ++ ++# Show a hint with possible names when a member name was not found. The aspect of ++# finding the hint is based on edit distance. ++missing-member-hint = true ++ ++# The minimum edit distance a name should have in order to be considered a ++# similar match for a missing member name. ++missing-member-hint-distance = 1 ++ ++# The total number of similar names that should be taken in consideration when ++# showing a hint for a missing member. ++missing-member-max-choices = 1 ++ ++# Regex pattern to define which classes are considered mixins. ++mixin-class-rgx = ".*[Mm]ixin" ++ ++# List of decorators that change the signature of a decorated function. ++# signature-mutators = ++ ++[tool.pylint.variables] ++# List of additional names supposed to be defined in builtins. Remember that you ++# should avoid defining new builtins when possible. ++# additional-builtins = ++ ++# Tells whether unused global variables should be treated as a violation. ++allow-global-unused-variables = true ++ ++# List of names allowed to shadow builtins ++# allowed-redefined-builtins = ++ ++# List of strings which can identify a callback function by name. A callback name ++# must start or end with one of those strings. ++callbacks = ["cb_", "_cb", "_callback"] ++ ++# A regular expression matching the name of dummy variables (i.e. expected to not ++# be used). ++dummy-variables-rgx = "_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_" ++ ++# Argument names that match this expression will be ignored. Default to name with ++# leading underscore. ++ignored-argument-names = "_.*|^ignored_|^unused_" ++ ++# Tells whether we should check for unused import in __init__ files. ++# init-import = ++ ++# List of qualified module names which can have objects that can redefine ++# builtins. ++redefining-builtins-modules = ["six.moves", "future.builtins"] +diff --git a/requirements-dev.txt b/requirements-dev.txt +new file mode 100644 +index 0000000..fe21d76 +--- /dev/null ++++ b/requirements-dev.txt +@@ -0,0 +1,7 @@ ++coverage[toml] ++mypy ++pylint ++pytest ++rich ++types-PyYAML ++types-requests +diff --git a/requirements.txt b/requirements.txt +new file mode 100644 +index 0000000..1c6d8b4 +--- /dev/null ++++ b/requirements.txt +@@ -0,0 +1,2 @@ ++pyyaml ++requests +diff --git a/setup.py b/setup.py +new file mode 100644 +index 0000000..1698e52 +--- /dev/null ++++ b/setup.py +@@ -0,0 +1,11 @@ ++#!/usr/bin/env python ++"""Bootstrapper for docker's ENTRYPOINT executable. ++ ++Since using setup.py is no longer std convention, ++all install information is located in pyproject.toml ++""" ++ ++import setuptools ++ ++ ++setuptools.setup() +diff --git a/tests/capture_tools_output/.clang-format b/tests/capture_tools_output/.clang-format +new file mode 100644 +index 0000000..6997192 +--- /dev/null ++++ b/tests/capture_tools_output/.clang-format +@@ -0,0 +1,148 @@ ++--- ++Language: Cpp ++# BasedOnStyle: LLVM ++AccessModifierOffset: -2 ++AlignAfterOpenBracket: Align ++AlignConsecutiveMacros: true ++AlignConsecutiveAssignments: false ++AlignConsecutiveBitFields: false ++AlignConsecutiveDeclarations: false ++AlignEscapedNewlines: Right ++AlignOperands: Align ++AlignTrailingComments: true ++AllowAllArgumentsOnNextLine: true ++AllowAllConstructorInitializersOnNextLine: true ++AllowAllParametersOfDeclarationOnNextLine: true ++AllowShortEnumsOnASingleLine: true ++AllowShortBlocksOnASingleLine: Never ++AllowShortCaseLabelsOnASingleLine: false ++AllowShortFunctionsOnASingleLine: None ++AllowShortLambdasOnASingleLine: All ++AllowShortIfStatementsOnASingleLine: Never ++AllowShortLoopsOnASingleLine: false ++AlwaysBreakAfterDefinitionReturnType: None ++AlwaysBreakAfterReturnType: None ++AlwaysBreakBeforeMultilineStrings: false ++AlwaysBreakTemplateDeclarations: MultiLine ++BinPackArguments: true ++BinPackParameters: true ++BraceWrapping: ++ AfterCaseLabel: false ++ AfterClass: true ++ AfterControlStatement: Always ++ AfterEnum: true ++ AfterFunction: true ++ AfterNamespace: true ++ AfterObjCDeclaration: false ++ AfterStruct: true ++ AfterUnion: true ++ AfterExternBlock: false ++ BeforeCatch: false ++ BeforeElse: true ++ BeforeLambdaBody: false ++ BeforeWhile: false ++ IndentBraces: false ++ SplitEmptyFunction: true ++ SplitEmptyRecord: true ++ SplitEmptyNamespace: true ++BreakBeforeBinaryOperators: None ++BreakBeforeBraces: Custom ++BreakBeforeInheritanceComma: false ++BreakInheritanceList: BeforeColon ++BreakBeforeTernaryOperators: true ++BreakConstructorInitializersBeforeComma: false ++BreakConstructorInitializers: BeforeColon ++BreakAfterJavaFieldAnnotations: false ++BreakStringLiterals: true ++ColumnLimit: 80 ++CommentPragmas: '^ IWYU pragma:' ++CompactNamespaces: false ++ConstructorInitializerAllOnOneLineOrOnePerLine: false ++ConstructorInitializerIndentWidth: 4 ++ContinuationIndentWidth: 4 ++Cpp11BracedListStyle: true ++DeriveLineEnding: true ++DerivePointerAlignment: false ++DisableFormat: false ++ExperimentalAutoDetectBinPacking: false ++FixNamespaceComments: true ++ForEachMacros: ++ - foreach ++ - Q_FOREACH ++ - BOOST_FOREACH ++IncludeBlocks: Preserve ++IncludeCategories: ++ - Regex: '^"(llvm|llvm-c|clang|clang-c)/' ++ Priority: 2 ++ SortPriority: 0 ++ - Regex: '^(<|"(gtest|gmock|isl|json)/)' ++ Priority: 3 ++ SortPriority: 0 ++ - Regex: '.*' ++ Priority: 1 ++ SortPriority: 0 ++IncludeIsMainRegex: '(Test)?$' ++IncludeIsMainSourceRegex: '' ++IndentCaseLabels: false ++IndentCaseBlocks: false ++IndentGotoLabels: true ++IndentPPDirectives: None ++IndentExternBlock: AfterExternBlock ++IndentWidth: 4 ++IndentWrappedFunctionNames: false ++InsertTrailingCommas: None ++JavaScriptQuotes: Leave ++JavaScriptWrapImports: true ++KeepEmptyLinesAtTheStartOfBlocks: true ++MacroBlockBegin: '' ++MacroBlockEnd: '' ++MaxEmptyLinesToKeep: 2 ++NamespaceIndentation: None ++ObjCBinPackProtocolList: Auto ++ObjCBlockIndentWidth: 2 ++ObjCBreakBeforeNestedBlockParam: true ++ObjCSpaceAfterProperty: false ++ObjCSpaceBeforeProtocolList: true ++PenaltyBreakAssignment: 2 ++PenaltyBreakBeforeFirstCallParameter: 19 ++PenaltyBreakComment: 300 ++PenaltyBreakFirstLessLess: 120 ++PenaltyBreakString: 1000 ++PenaltyBreakTemplateDeclaration: 10 ++PenaltyExcessCharacter: 1000000 ++PenaltyReturnTypeOnItsOwnLine: 60 ++PointerAlignment: Right ++ReflowComments: false ++SortIncludes: false ++SortUsingDeclarations: true ++SpaceAfterCStyleCast: false ++SpaceAfterLogicalNot: false ++SpaceAfterTemplateKeyword: true ++SpaceBeforeAssignmentOperators: true ++SpaceBeforeCpp11BracedList: false ++SpaceBeforeCtorInitializerColon: true ++SpaceBeforeInheritanceColon: true ++SpaceBeforeParens: ControlStatements ++SpaceBeforeRangeBasedForLoopColon: true ++SpaceInEmptyBlock: false ++SpaceInEmptyParentheses: false ++SpacesBeforeTrailingComments: 1 ++SpacesInAngles: false ++SpacesInConditionalStatement: false ++SpacesInContainerLiterals: true ++SpacesInCStyleCastParentheses: false ++SpacesInParentheses: false ++SpacesInSquareBrackets: false ++SpaceBeforeSquareBrackets: false ++Standard: Latest ++StatementMacros: ++ - Q_UNUSED ++ - QT_REQUIRE_VERSION ++TabWidth: 8 ++UseCRLF: false ++UseTab: Never ++WhitespaceSensitiveMacros: ++ - STRINGIZE ++ - PP_STRINGIZE ++ - BOOST_PP_STRINGIZE ++... +diff --git a/tests/capture_tools_output/.clang-tidy b/tests/capture_tools_output/.clang-tidy +new file mode 100644 +index 0000000..19dc3ea +--- /dev/null ++++ b/tests/capture_tools_output/.clang-tidy +@@ -0,0 +1,349 @@ ++--- ++Checks: 'clang-diagnostic-*,clang-analyzer-*,-boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-*,cppcoreguidelines-*,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers' ++WarningsAsErrors: '' ++HeaderFilterRegex: '' ++AnalyzeTemporaryDtors: false ++FormatStyle: none ++User: ytreh ++CheckOptions: ++ - key: modernize-replace-auto-ptr.IncludeStyle ++ value: llvm ++ - key: cppcoreguidelines-no-malloc.Reallocations ++ value: '::realloc' ++ - key: cppcoreguidelines-owning-memory.LegacyResourceConsumers ++ value: '::free;::realloc;::freopen;::fclose' ++ - key: readability-static-accessed-through-instance.NameSpecifierNestingThreshold ++ value: '3' ++ - key: readability-function-size.VariableThreshold ++ value: '4294967295' ++ - key: modernize-use-auto.MinTypeNameLength ++ value: '5' ++ - key: bugprone-reserved-identifier.Invert ++ value: 'false' ++ - key: performance-move-const-arg.CheckTriviallyCopyableMove ++ value: 'true' ++ - key: cert-dcl16-c.NewSuffixes ++ value: 'L;LL;LU;LLU' ++ - key: bugprone-narrowing-conversions.WarnOnFloatingPointNarrowingConversion ++ value: 'true' ++ - key: readability-identifier-naming.GetConfigPerFile ++ value: 'true' ++ - key: bugprone-narrowing-conversions.PedanticMode ++ value: 'false' ++ - key: readability-inconsistent-declaration-parameter-name.Strict ++ value: 'false' ++ - key: cppcoreguidelines-macro-usage.CheckCapsOnly ++ value: 'false' ++ - key: bugprone-unused-return-value.CheckedFunctions ++ value: '::std::async;::std::launder;::std::remove;::std::remove_if;::std::unique;::std::unique_ptr::release;::std::basic_string::empty;::std::vector::empty;::std::back_inserter;::std::distance;::std::find;::std::find_if;::std::inserter;::std::lower_bound;::std::make_pair;::std::map::count;::std::map::find;::std::map::lower_bound;::std::multimap::equal_range;::std::multimap::upper_bound;::std::set::count;::std::set::find;::std::setfill;::std::setprecision;::std::setw;::std::upper_bound;::std::vector::at;::bsearch;::ferror;::feof;::isalnum;::isalpha;::isblank;::iscntrl;::isdigit;::isgraph;::islower;::isprint;::ispunct;::isspace;::isupper;::iswalnum;::iswprint;::iswspace;::isxdigit;::memchr;::memcmp;::strcmp;::strcoll;::strncmp;::strpbrk;::strrchr;::strspn;::strstr;::wcscmp;::access;::bind;::connect;::difftime;::dlsym;::fnmatch;::getaddrinfo;::getopt;::htonl;::htons;::iconv_open;::inet_addr;::isascii;::isatty;::mmap;::newlocale;::openat;::pathconf;::pthread_equal;::pthread_getspecific;::pthread_mutex_trylock;::readdir;::readlink;::recvmsg;::regexec;::scandir;::semget;::setjmp;::shm_open;::shmget;::sigismember;::strcasecmp;::strsignal;::ttyname' ++ - key: modernize-use-default-member-init.UseAssignment ++ value: 'false' ++ - key: readability-function-size.NestingThreshold ++ value: '4294967295' ++ - key: modernize-use-override.AllowOverrideAndFinal ++ value: 'false' ++ - key: readability-function-size.ParameterThreshold ++ value: '4294967295' ++ - key: modernize-pass-by-value.ValuesOnly ++ value: 'false' ++ - key: modernize-loop-convert.IncludeStyle ++ value: llvm ++ - key: cert-str34-c.DiagnoseSignedUnsignedCharComparisons ++ value: '0' ++ - key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison ++ value: 'false' ++ - key: cppcoreguidelines-explicit-virtual-functions.AllowOverrideAndFinal ++ value: 'false' ++ - key: readability-redundant-smartptr-get.IgnoreMacros ++ value: 'true' ++ - key: readability-identifier-naming.AggressiveDependentMemberLookup ++ value: 'false' ++ - key: bugprone-suspicious-string-compare.WarnOnImplicitComparison ++ value: 'true' ++ - key: modernize-use-emplace.TupleTypes ++ value: '::std::pair;::std::tuple' ++ - key: modernize-use-emplace.TupleMakeFunctions ++ value: '::std::make_pair;::std::make_tuple' ++ - key: cppcoreguidelines-owning-memory.LegacyResourceProducers ++ value: '::malloc;::aligned_alloc;::realloc;::calloc;::fopen;::freopen;::tmpfile' ++ - key: bugprone-argument-comment.CommentNullPtrs ++ value: '0' ++ - key: bugprone-argument-comment.StrictMode ++ value: '0' ++ - key: cppcoreguidelines-init-variables.IncludeStyle ++ value: llvm ++ - key: modernize-use-nodiscard.ReplacementString ++ value: '[[nodiscard]]' ++ - key: modernize-loop-convert.MakeReverseRangeHeader ++ value: '' ++ - key: modernize-replace-random-shuffle.IncludeStyle ++ value: llvm ++ - key: cppcoreguidelines-narrowing-conversions.WarnOnFloatingPointNarrowingConversion ++ value: 'true' ++ - key: modernize-use-bool-literals.IgnoreMacros ++ value: 'true' ++ - key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField ++ value: 'true' ++ - key: google-readability-namespace-comments.ShortNamespaceLines ++ value: '10' ++ - key: bugprone-suspicious-string-compare.StringCompareLikeFunctions ++ value: '' ++ - key: modernize-avoid-bind.PermissiveParameterList ++ value: 'false' ++ - key: modernize-use-override.FinalSpelling ++ value: final ++ - key: performance-move-constructor-init.IncludeStyle ++ value: llvm ++ - key: modernize-loop-convert.UseCxx20ReverseRanges ++ value: 'true' ++ - key: modernize-use-noexcept.ReplacementString ++ value: '' ++ - key: modernize-use-using.IgnoreMacros ++ value: 'true' ++ - key: performance-type-promotion-in-math-fn.IncludeStyle ++ value: llvm ++ - key: cppcoreguidelines-explicit-virtual-functions.FinalSpelling ++ value: final ++ - key: modernize-loop-convert.NamingStyle ++ value: CamelCase ++ - key: bugprone-suspicious-include.ImplementationFileExtensions ++ value: 'c;cc;cpp;cxx' ++ - key: cppcoreguidelines-pro-type-member-init.UseAssignment ++ value: 'false' ++ - key: modernize-loop-convert.MakeReverseRangeFunction ++ value: '' ++ - key: bugprone-suspicious-include.HeaderFileExtensions ++ value: ';h;hh;hpp;hxx' ++ - key: performance-no-automatic-move.AllowedTypes ++ value: '' ++ - key: performance-for-range-copy.WarnOnAllAutoCopies ++ value: 'false' ++ - key: bugprone-argument-comment.CommentIntegerLiterals ++ value: '0' ++ - key: bugprone-suspicious-missing-comma.SizeThreshold ++ value: '5' ++ - key: readability-inconsistent-declaration-parameter-name.IgnoreMacros ++ value: 'true' ++ - key: readability-identifier-naming.IgnoreFailedSplit ++ value: 'false' ++ - key: modernize-pass-by-value.IncludeStyle ++ value: llvm ++ - key: bugprone-sizeof-expression.WarnOnSizeOfThis ++ value: 'true' ++ - key: readability-qualified-auto.AddConstToQualified ++ value: 'true' ++ - key: bugprone-string-constructor.WarnOnLargeLength ++ value: 'true' ++ - key: bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit ++ value: '16' ++ - key: readability-simplify-boolean-expr.ChainedConditionalReturn ++ value: 'false' ++ - key: cppcoreguidelines-explicit-virtual-functions.OverrideSpelling ++ value: override ++ - key: readability-else-after-return.WarnOnConditionVariables ++ value: 'true' ++ - key: readability-uppercase-literal-suffix.IgnoreMacros ++ value: 'true' ++ - key: modernize-use-nullptr.NullMacros ++ value: 'NULL' ++ - key: modernize-make-shared.IgnoreMacros ++ value: 'true' ++ - key: bugprone-dynamic-static-initializers.HeaderFileExtensions ++ value: ';h;hh;hpp;hxx' ++ - key: bugprone-suspicious-enum-usage.StrictMode ++ value: 'false' ++ - key: performance-unnecessary-copy-initialization.AllowedTypes ++ value: '' ++ - key: bugprone-suspicious-missing-comma.MaxConcatenatedTokens ++ value: '5' ++ - key: modernize-use-transparent-functors.SafeMode ++ value: 'false' ++ - key: cppcoreguidelines-macro-usage.AllowedRegexp ++ value: '^DEBUG_*' ++ - key: modernize-make-shared.IgnoreDefaultInitialization ++ value: 'true' ++ - key: bugprone-argument-comment.CommentCharacterLiterals ++ value: '0' ++ - key: cppcoreguidelines-narrowing-conversions.PedanticMode ++ value: 'false' ++ - key: bugprone-not-null-terminated-result.WantToUseSafeFunctions ++ value: 'true' ++ - key: modernize-make-shared.IncludeStyle ++ value: llvm ++ - key: bugprone-string-constructor.LargeLengthThreshold ++ value: '8388608' ++ - key: readability-simplify-boolean-expr.ChainedConditionalAssignment ++ value: 'false' ++ - key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions ++ value: 'false' ++ - key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField ++ value: '0' ++ - key: bugprone-exception-escape.FunctionsThatShouldNotThrow ++ value: '' ++ - key: bugprone-signed-char-misuse.CharTypdefsToIgnore ++ value: '' ++ - key: performance-inefficient-vector-operation.EnableProto ++ value: 'false' ++ - key: modernize-loop-convert.MaxCopySize ++ value: '16' ++ - key: bugprone-argument-comment.CommentFloatLiterals ++ value: '0' ++ - key: readability-function-size.LineThreshold ++ value: '4294967295' ++ - key: portability-simd-intrinsics.Suggest ++ value: 'false' ++ - key: modernize-make-shared.MakeSmartPtrFunction ++ value: 'std::make_shared' ++ - key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors ++ value: 'true' ++ - key: cppcoreguidelines-pro-bounds-constant-array-index.GslHeader ++ value: '' ++ - key: modernize-make-unique.IgnoreMacros ++ value: 'true' ++ - key: modernize-make-shared.MakeSmartPtrFunctionHeader ++ value: '' ++ - key: performance-for-range-copy.AllowedTypes ++ value: '' ++ - key: modernize-use-override.IgnoreDestructors ++ value: 'false' ++ - key: bugprone-sizeof-expression.WarnOnSizeOfConstant ++ value: 'true' ++ - key: readability-redundant-string-init.StringNames ++ value: '::std::basic_string_view;::std::basic_string' ++ - key: modernize-make-unique.IgnoreDefaultInitialization ++ value: 'true' ++ - key: modernize-use-emplace.ContainersWithPushBack ++ value: '::std::vector;::std::list;::std::deque' ++ - key: modernize-make-unique.IncludeStyle ++ value: llvm ++ - key: readability-braces-around-statements.ShortStatementLines ++ value: '0' ++ - key: bugprone-argument-comment.CommentUserDefinedLiterals ++ value: '0' ++ - key: bugprone-argument-comment.CommentBoolLiterals ++ value: '0' ++ - key: modernize-use-override.OverrideSpelling ++ value: override ++ - key: performance-inefficient-string-concatenation.StrictMode ++ value: 'false' ++ - key: readability-implicit-bool-conversion.AllowPointerConditions ++ value: 'false' ++ - key: readability-redundant-declaration.IgnoreMacros ++ value: 'true' ++ - key: google-readability-braces-around-statements.ShortStatementLines ++ value: '1' ++ - key: modernize-make-unique.MakeSmartPtrFunction ++ value: 'std::make_unique' ++ - key: cppcoreguidelines-pro-type-member-init.IgnoreArrays ++ value: 'false' ++ - key: readability-else-after-return.WarnOnUnfixable ++ value: 'true' ++ - key: bugprone-reserved-identifier.AllowedIdentifiers ++ value: '' ++ - key: modernize-use-emplace.IgnoreImplicitConstructors ++ value: 'false' ++ - key: modernize-make-unique.MakeSmartPtrFunctionHeader ++ value: '' ++ - key: portability-restrict-system-includes.Includes ++ value: '*' ++ - key: modernize-use-equals-delete.IgnoreMacros ++ value: 'true' ++ - key: cppcoreguidelines-pro-bounds-constant-array-index.IncludeStyle ++ value: llvm ++ - key: cppcoreguidelines-macro-usage.IgnoreCommandLineMacros ++ value: 'true' ++ - key: bugprone-misplaced-widening-cast.CheckImplicitCasts ++ value: 'false' ++ - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnorePublicMemberVariables ++ value: 'false' ++ - key: modernize-loop-convert.MinConfidence ++ value: reasonable ++ - key: performance-unnecessary-value-param.AllowedTypes ++ value: '' ++ - key: bugprone-suspicious-missing-comma.RatioThreshold ++ value: '0.200000' ++ - key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctionsWhenCopyIsDeleted ++ value: 'false' ++ - key: readability-uppercase-literal-suffix.NewSuffixes ++ value: '' ++ - key: google-readability-namespace-comments.SpacesBeforeComments ++ value: '2' ++ - key: readability-function-cognitive-complexity.Threshold ++ value: '25' ++ - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic ++ value: 'true' ++ - key: bugprone-argument-comment.IgnoreSingleArgument ++ value: '0' ++ - key: cppcoreguidelines-no-malloc.Allocations ++ value: '::malloc;::calloc' ++ - key: modernize-use-noexcept.UseNoexceptFalse ++ value: 'true' ++ - key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression ++ value: 'false' ++ - key: performance-faster-string-find.StringLikeClasses ++ value: '::std::basic_string;::std::basic_string_view' ++ - key: bugprone-assert-side-effect.CheckFunctionCalls ++ value: 'false' ++ - key: readability-function-size.BranchThreshold ++ value: '4294967295' ++ - key: bugprone-string-constructor.StringNames ++ value: '::std::basic_string;::std::basic_string_view' ++ - key: bugprone-assert-side-effect.AssertMacros ++ value: assert ++ - key: bugprone-exception-escape.IgnoredExceptions ++ value: '' ++ - key: readability-function-size.StatementThreshold ++ value: '800' ++ - key: modernize-use-default-member-init.IgnoreMacros ++ value: 'true' ++ - key: llvm-qualified-auto.AddConstToQualified ++ value: '0' ++ - key: bugprone-argument-comment.CommentStringLiterals ++ value: '0' ++ - key: readability-identifier-naming.IgnoreMainLikeFunctions ++ value: 'false' ++ - key: bugprone-signed-char-misuse.DiagnoseSignedUnsignedCharComparisons ++ value: 'true' ++ - key: readability-implicit-bool-conversion.AllowIntegerConditions ++ value: 'false' ++ - key: cppcoreguidelines-init-variables.MathHeader ++ value: '' ++ - key: google-readability-function-size.StatementThreshold ++ value: '800' ++ - key: llvm-else-after-return.WarnOnConditionVariables ++ value: '0' ++ - key: bugprone-sizeof-expression.WarnOnSizeOfCompareToConstant ++ value: 'true' ++ - key: bugprone-reserved-identifier.AggressiveDependentMemberLookup ++ value: 'false' ++ - key: modernize-raw-string-literal.DelimiterStem ++ value: lit ++ - key: modernize-use-equals-default.IgnoreMacros ++ value: 'true' ++ - key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor ++ value: 'false' ++ - key: modernize-raw-string-literal.ReplaceShorterLiterals ++ value: 'false' ++ - key: modernize-use-emplace.SmartPointers ++ value: '::std::shared_ptr;::std::unique_ptr;::std::auto_ptr;::std::weak_ptr' ++ - key: cppcoreguidelines-no-malloc.Deallocations ++ value: '::free' ++ - key: modernize-use-auto.RemoveStars ++ value: 'false' ++ - key: bugprone-dangling-handle.HandleClasses ++ value: 'std::basic_string_view;std::experimental::basic_string_view' ++ - key: performance-inefficient-vector-operation.VectorLikeClasses ++ value: '::std::vector' ++ - key: portability-simd-intrinsics.Std ++ value: '' ++ - key: performance-unnecessary-value-param.IncludeStyle ++ value: llvm ++ - key: readability-redundant-member-init.IgnoreBaseInCopyConstructors ++ value: 'false' ++ - key: modernize-replace-disallow-copy-and-assign-macro.MacroName ++ value: DISALLOW_COPY_AND_ASSIGN ++ - key: llvm-else-after-return.WarnOnUnfixable ++ value: '0' ++ - key: readability-simplify-subscript-expr.Types ++ value: '::std::basic_string;::std::basic_string_view;::std::vector;::std::array' ++... +diff --git a/tests/capture_tools_output/event_files.json b/tests/capture_tools_output/event_files.json +new file mode 100644 +index 0000000..ba8947a +--- /dev/null ++++ b/tests/capture_tools_output/event_files.json +@@ -0,0 +1,230 @@ ++[ ++ { ++ "sha": "7f1eed09c6c07682738de7b5141fd151d16cf368", ++ "filename": "CMakeLists.txt", ++ "status": "modified", ++ "additions": 14, ++ "deletions": 2, ++ "changes": 16, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/CMakeLists.txt", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/CMakeLists.txt", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/CMakeLists.txt?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -28,9 +28,21 @@ else()\n \"-Wredundant-decls\")\n endif()\n \n+option(ENABLE_SDL2_NET \"Enable SDL2_net\" On)\n+option(ENABLE_SDL2_MIXER \"Enable SDL2_mixer\" On)\n+\n find_package(SDL2 2.0.7)\n-find_package(SDL2_mixer 2.0.2)\n-find_package(SDL2_net 2.0.0)\n+if(ENABLE_SDL2_MIXER)\n+ find_package(SDL2_mixer 2.0.2)\n+else()\n+ add_compile_definitions(DISABLE_SDL2MIXER=1)\n+endif()\n+\n+if(ENABLE_SDL2_NET)\n+ find_package(SDL2_net 2.0.0)\n+else()\n+ add_compile_definitions(DISABLE_SDL2NET=1)\n+endif()\n \n # Check for libsamplerate.\n find_package(samplerate)" ++ }, ++ { ++ "sha": "fd5d8bcecd8a6edb6d77c8686ae32a995b571066", ++ "filename": "configure.ac", ++ "status": "modified", ++ "additions": 17, ++ "deletions": 2, ++ "changes": 19, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/configure.ac", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/configure.ac", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/configure.ac?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -32,8 +32,23 @@ then\n fi\n \n PKG_CHECK_MODULES(SDL, [sdl2 >= 2.0.7])\n-PKG_CHECK_MODULES(SDLMIXER, [SDL2_mixer >= 2.0.2])\n-PKG_CHECK_MODULES(SDLNET, [SDL2_net >= 2.0.0])\n+# Check for SDL2_mixer\n+AC_ARG_ENABLE([sdl2mixer],\n+AS_HELP_STRING([--disable-sdl2mixer], [Disable SDL2_mixer support])\n+)\n+AS_IF([test \"x$enable_sdl2mixer\" != xno], [\n+ PKG_CHECK_MODULES(SDLMIXER, [SDL2_mixer >= 2.0.2])], [\n+ AC_DEFINE([DISABLE_SDL2MIXER], [1], [SDL2_mixer disabled])\n+])\n+\n+# Check for networking\n+AC_ARG_ENABLE([sdl2net],\n+AS_HELP_STRING([--disable-sdl2net], [Disable SDL2_net support])\n+)\n+AS_IF([test \"x$enable_sdl2net\" != xno], [\n+ PKG_CHECK_MODULES(SDLNET, [SDL2_net >= 2.0.0])], [\n+ AC_DEFINE([DISABLE_SDL2NET], [1], [SDL2_net disabled])\n+])\n \n # Check for bash-completion.\n AC_ARG_ENABLE([bash-completion]," ++ }, ++ { ++ "sha": "151f7617dde7d1216f7212b45bb5aeb7661bc86b", ++ "filename": "opl/CMakeLists.txt", ++ "status": "modified", ++ "additions": 4, ++ "deletions": 1, ++ "changes": 5, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/opl%2FCMakeLists.txt", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/opl%2FCMakeLists.txt", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/opl%2FCMakeLists.txt?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -12,4 +12,7 @@ add_library(opl STATIC\n target_include_directories(opl\n INTERFACE \".\"\n PRIVATE \"${CMAKE_CURRENT_BINARY_DIR}/../\")\n-target_link_libraries(opl SDL2::mixer)\n+target_link_libraries(opl SDL2::SDL2)\n+if(ENABLE_SDL2_mixer)\n+ target_link_libraries(opl SDL2::mixer)\n+endif()" ++ }, ++ { ++ "sha": "46e082cf77c5e60affc7689f7357c926fc00cda3", ++ "filename": "opl/opl.c", ++ "status": "modified", ++ "additions": 2, ++ "deletions": 0, ++ "changes": 2, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/opl%2Fopl.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/opl%2Fopl.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/opl%2Fopl.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -50,7 +50,9 @@ static opl_driver_t *drivers[] =\n #ifdef _WIN32\n &opl_win32_driver,\n #endif\n+#ifndef DISABLE_SDL2MIXER\n &opl_sdl_driver,\n+#endif // DISABLE_SDL2MIXER\n NULL\n };\n " ++ }, ++ { ++ "sha": "6bd4e7e1f3374e289d3dc19972dcb1d5379d6b03", ++ "filename": "opl/opl_sdl.c", ++ "status": "modified", ++ "additions": 6, ++ "deletions": 0, ++ "changes": 6, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/opl%2Fopl_sdl.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/opl%2Fopl_sdl.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/opl%2Fopl_sdl.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -33,6 +33,10 @@\n \n #include \"opl_queue.h\"\n \n+\n+#ifndef DISABLE_SDL2MIXER\n+\n+\n #define MAX_SOUND_SLICE_TIME 100 /* ms */\n \n typedef struct\n@@ -511,3 +515,5 @@ opl_driver_t opl_sdl_driver =\n OPL_SDL_AdjustCallbacks,\n };\n \n+\n+#endif // DISABLE_SDL2MIXER" ++ }, ++ { ++ "sha": "9924263aea24261091948e455dfd2521787a04c4", ++ "filename": "pcsound/CMakeLists.txt", ++ "status": "modified", ++ "additions": 4, ++ "deletions": 1, ++ "changes": 5, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/pcsound%2FCMakeLists.txt", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/pcsound%2FCMakeLists.txt", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/pcsound%2FCMakeLists.txt?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -8,4 +8,7 @@ add_library(pcsound STATIC\n target_include_directories(pcsound\n INTERFACE \".\"\n PRIVATE \"${CMAKE_CURRENT_BINARY_DIR}/../\")\n-target_link_libraries(pcsound SDL2::mixer)\n+target_link_libraries(pcsound SDL2::SDL2)\n+if(ENABLE_SDL2_mixer)\n+ target_link_libraries(pcsound SDL2::mixer)\n+endif()" ++ }, ++ { ++ "sha": "58f9b75c2affd5f1dd990aaedab79d834575bf83", ++ "filename": "pcsound/pcsound.c", ++ "status": "modified", ++ "additions": 2, ++ "deletions": 0, ++ "changes": 2, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/pcsound%2Fpcsound.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/pcsound%2Fpcsound.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/pcsound%2Fpcsound.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -56,7 +56,9 @@ static pcsound_driver_t *drivers[] =\n #ifdef _WIN32\n &pcsound_win32_driver,\n #endif\n+#ifndef DISABLE_SDL2MIXER\n &pcsound_sdl_driver,\n+#endif // DISABLE_SDL2MIXER\n NULL,\n };\n " ++ }, ++ { ++ "sha": "e77c7b0d29de1b0c665686004dfda311c9d96719", ++ "filename": "pcsound/pcsound_sdl.c", ++ "status": "modified", ++ "additions": 6, ++ "deletions": 0, ++ "changes": 6, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/pcsound%2Fpcsound_sdl.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/pcsound%2Fpcsound_sdl.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/pcsound%2Fpcsound_sdl.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -24,6 +24,10 @@\n #include \"pcsound.h\"\n #include \"pcsound_internal.h\"\n \n+\n+#ifndef DISABLE_SDL2MIXER\n+\n+\n #define MAX_SOUND_SLICE_TIME 70 /* ms */\n #define SQUARE_WAVE_AMP 0x2000\n \n@@ -248,3 +252,5 @@ pcsound_driver_t pcsound_sdl_driver =\n PCSound_SDL_Shutdown,\n };\n \n+\n+#endif // DISABLE_SDL2MIXER" ++ }, ++ { ++ "sha": "bbb877641f2a8de6e6eb7dad5b8c866e147faf7d", ++ "filename": "src/CMakeLists.txt", ++ "status": "modified", ++ "additions": 18, ++ "deletions": 3, ++ "changes": 21, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2FCMakeLists.txt", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2FCMakeLists.txt", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2FCMakeLists.txt?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -32,7 +32,10 @@ set(DEDSERV_FILES\n add_executable(\"${PROGRAM_PREFIX}server\" WIN32 ${COMMON_SOURCE_FILES} ${DEDSERV_FILES})\n target_include_directories(\"${PROGRAM_PREFIX}server\"\n PRIVATE \"${CMAKE_CURRENT_BINARY_DIR}/../\")\n-target_link_libraries(\"${PROGRAM_PREFIX}server\" SDL2::SDL2main SDL2::net)\n+target_link_libraries(\"${PROGRAM_PREFIX}server\" SDL2::SDL2main SDL2::SDL2)\n+if(ENABLE_SDL2_NET)\n+ target_link_libraries(\"${PROGRAM_PREFIX}server\" SDL2::net)\n+endif()\n \n # Source files used by the game binaries (chocolate-doom, etc.)\n \n@@ -121,7 +124,13 @@ set(DEHACKED_SOURCE_FILES\n set(SOURCE_FILES ${COMMON_SOURCE_FILES} ${GAME_SOURCE_FILES})\n set(SOURCE_FILES_WITH_DEH ${SOURCE_FILES} ${DEHACKED_SOURCE_FILES})\n \n-set(EXTRA_LIBS SDL2::SDL2main SDL2::SDL2 SDL2::mixer SDL2::net textscreen pcsound opl)\n+set(EXTRA_LIBS SDL2::SDL2main SDL2::SDL2 textscreen pcsound opl)\n+if(ENABLE_SDL2_MIXER)\n+ list(APPEND EXTRA_LIBS SDL2::mixer)\n+endif()\n+if(ENABLE_SDL2_NET)\n+ list(APPEND EXTRA_LIBS SDL2::net)\n+endif()\n if(SAMPLERATE_FOUND)\n list(APPEND EXTRA_LIBS samplerate::samplerate)\n endif()\n@@ -213,7 +222,13 @@ endif()\n \n target_include_directories(\"${PROGRAM_PREFIX}setup\"\n PRIVATE \"${CMAKE_CURRENT_BINARY_DIR}/../\")\n-target_link_libraries(\"${PROGRAM_PREFIX}setup\" SDL2::SDL2main SDL2::SDL2 SDL2::mixer SDL2::net setup textscreen)\n+target_link_libraries(\"${PROGRAM_PREFIX}setup\" SDL2::SDL2main SDL2::SDL2 setup textscreen)\n+if(ENABLE_SDL2_mixer)\n+ target_link_libraries(\"${PROGRAM_PREFIX}setup\" SDL2::mixer)\n+endif()\n+if(ENABLE_SDL2_NET)\n+ target_link_libraries(\"${PROGRAM_PREFIX}setup\" SDL2::net)\n+endif()\n \n if(MSVC)\n set_target_properties(\"${PROGRAM_PREFIX}setup\" PROPERTIES" ++ }, ++ { ++ "sha": "82b114b4178595085c6745bc70a570922415be1f", ++ "filename": "src/doom/CMakeLists.txt", ++ "status": "modified", ++ "additions": 7, ++ "deletions": 1, ++ "changes": 8, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fdoom%2FCMakeLists.txt", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fdoom%2FCMakeLists.txt", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2Fdoom%2FCMakeLists.txt?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -68,4 +68,10 @@ add_library(doom STATIC\n wi_stuff.c wi_stuff.h)\n \n target_include_directories(doom PRIVATE \"../\" \"${CMAKE_CURRENT_BINARY_DIR}/../../\")\n-target_link_libraries(doom SDL2::SDL2 SDL2::mixer SDL2::net)\n+target_link_libraries(doom SDL2::SDL2)\n+if(ENABLE_SDL2_mixer)\n+ target_link_libraries(doom SDL2::mixer)\n+endif()\n+if(ENABLE_SDL2_NET)\n+ target_link_libraries(doom SDL2::net)\n+endif()" ++ }, ++ { ++ "sha": "1ea060bfdb8b3147e36b3431fee27934c8a93b34", ++ "filename": "src/heretic/CMakeLists.txt", ++ "status": "modified", ++ "additions": 7, ++ "deletions": 1, ++ "changes": 8, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fheretic%2FCMakeLists.txt", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fheretic%2FCMakeLists.txt", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2Fheretic%2FCMakeLists.txt?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -54,4 +54,10 @@ add_library(heretic STATIC\n s_sound.c s_sound.h)\n \n target_include_directories(heretic PRIVATE \"../\" \"${CMAKE_CURRENT_BINARY_DIR}/../../\")\n-target_link_libraries(heretic textscreen SDL2::SDL2 SDL2::mixer SDL2::net)\n+target_link_libraries(heretic textscreen SDL2::SDL2)\n+if(ENABLE_SDL2_mixer)\n+ target_link_libraries(heretic SDL2::mixer)\n+endif()\n+if(ENABLE_SDL2_NET)\n+ target_link_libraries(heretic SDL2::net)\n+endif()" ++ }, ++ { ++ "sha": "0dbd170bfdb06c8209ec654d4d5377e334be886e", ++ "filename": "src/hexen/CMakeLists.txt", ++ "status": "modified", ++ "additions": 7, ++ "deletions": 1, ++ "changes": 8, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fhexen%2FCMakeLists.txt", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fhexen%2FCMakeLists.txt", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2Fhexen%2FCMakeLists.txt?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -55,4 +55,10 @@ add_library(hexen STATIC\n xddefs.h)\n \n target_include_directories(hexen PRIVATE \"../\" \"${CMAKE_CURRENT_BINARY_DIR}/../../\")\n-target_link_libraries(hexen SDL2::SDL2 SDL2::mixer SDL2::net)\n+target_link_libraries(hexen SDL2::SDL2)\n+if(ENABLE_SDL2_mixer)\n+ target_link_libraries(hexen SDL2::mixer)\n+endif()\n+if(ENABLE_SDL2_NET)\n+ target_link_libraries(hexen SDL2::net)\n+endif()" ++ }, ++ { ++ "sha": "3facce6f01d02c5e8eef3088fa60576b9e949829", ++ "filename": "src/i_musicpack.c", ++ "status": "modified", ++ "additions": 87, ++ "deletions": 1, ++ "changes": 88, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_musicpack.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_musicpack.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2Fi_musicpack.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -44,6 +44,13 @@\n #include \"w_wad.h\"\n #include \"z_zone.h\"\n \n+\n+char *music_pack_path = \"\";\n+\n+\n+#ifndef DISABLE_SDL2MIXER\n+\n+\n #define MID_HEADER_MAGIC \"MThd\"\n #define MUS_HEADER_MAGIC \"MUS\\x1a\"\n \n@@ -99,7 +106,6 @@ static boolean music_initialized = false;\n \n static boolean sdl_was_initialized = false;\n \n-char *music_pack_path = \"\";\n \n // If true, we are playing a substitute digital track rather than in-WAD\n // MIDI/MUS track, and file_metadata contains loop metadata.\n@@ -1375,3 +1381,83 @@ music_module_t music_pack_module =\n I_MP_PollMusic,\n };\n \n+\n+#else // DISABLE_SDL2MIXER\n+\n+\n+static boolean I_NULL_InitMusic(void)\n+{\n+ return false;\n+}\n+\n+\n+static void I_NULL_ShutdownMusic(void)\n+{\n+}\n+\n+\n+static void I_NULL_SetMusicVolume(int volume)\n+{\n+}\n+\n+\n+static void I_NULL_PauseSong(void)\n+{\n+}\n+\n+\n+static void I_NULL_ResumeSong(void)\n+{\n+}\n+\n+\n+static void *I_NULL_RegisterSong(void *data, int len)\n+{\n+ return NULL;\n+}\n+\n+\n+static void I_NULL_UnRegisterSong(void *handle)\n+{\n+}\n+\n+\n+static void I_NULL_PlaySong(void *handle, boolean looping)\n+{\n+}\n+\n+\n+static void I_NULL_StopSong(void)\n+{\n+}\n+\n+\n+static boolean I_NULL_MusicIsPlaying(void)\n+{\n+ return false;\n+}\n+\n+\n+static void I_NULL_PollMusic(void)\n+{\n+}\n+\n+music_module_t music_pack_module =\n+{\n+ NULL,\n+ 0,\n+ I_NULL_InitMusic,\n+ I_NULL_ShutdownMusic,\n+ I_NULL_SetMusicVolume,\n+ I_NULL_PauseSong,\n+ I_NULL_ResumeSong,\n+ I_NULL_RegisterSong,\n+ I_NULL_UnRegisterSong,\n+ I_NULL_PlaySong,\n+ I_NULL_StopSong,\n+ I_NULL_MusicIsPlaying,\n+ I_NULL_PollMusic,\n+};\n+\n+\n+#endif // DISABLE_SDL2MIXER" ++ }, ++ { ++ "sha": "48fedfbd7608ad8c6575a4bd82a5e1cb3646e071", ++ "filename": "src/i_sdlmusic.c", ++ "status": "modified", ++ "additions": 21, ++ "deletions": 13, ++ "changes": 34, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_sdlmusic.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_sdlmusic.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2Fi_sdlmusic.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -44,19 +44,6 @@\n #include \"w_wad.h\"\n #include \"z_zone.h\"\n \n-#define MAXMIDLENGTH (96 * 1024)\n-\n-static boolean music_initialized = false;\n-\n-// If this is true, this module initialized SDL sound and has the \n-// responsibility to shut it down\n-\n-static boolean sdl_was_initialized = false;\n-\n-static boolean win_midi_stream_opened = false;\n-\n-static boolean musicpaused = false;\n-static int current_music_volume;\n \n char *fluidsynth_sf_path = \"\";\n char *timidity_cfg_path = \"\";\n@@ -138,6 +125,25 @@ void I_InitTimidityConfig(void)\n }\n }\n \n+\n+#ifndef DISABLE_SDL2MIXER\n+\n+\n+#define MAXMIDLENGTH (96 * 1024)\n+\n+static boolean music_initialized = false;\n+\n+// If this is true, this module initialized SDL sound and has the\n+// responsibility to shut it down\n+\n+static boolean sdl_was_initialized = false;\n+\n+static boolean win_midi_stream_opened = false;\n+\n+static boolean musicpaused = false;\n+static int current_music_volume;\n+\n+\n // Remove the temporary config file generated by I_InitTimidityConfig().\n \n static void RemoveTimidityConfig(void)\n@@ -588,3 +594,5 @@ music_module_t music_sdl_module =\n NULL, // Poll\n };\n \n+\n+#endif // DISABLE_SDL2MIXER" ++ }, ++ { ++ "sha": "7f2a26096b218c5323f5dc569c6f70ab399782bf", ++ "filename": "src/i_sdlsound.c", ++ "status": "modified", ++ "additions": 17, ++ "deletions": 9, ++ "changes": 26, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_sdlsound.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_sdlsound.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2Fi_sdlsound.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -41,6 +41,21 @@\n \n #include \"doomtype.h\"\n \n+\n+int use_libsamplerate = 0;\n+\n+// Scale factor used when converting libsamplerate floating point numbers\n+// to integers. Too high means the sounds can clip; too low means they\n+// will be too quiet. This is an amount that should avoid clipping most\n+// of the time: with all the Doom IWAD sound effects, at least. If a PWAD\n+// is used, clipping might occur.\n+\n+float libsamplerate_scale = 0.65f;\n+\n+\n+#ifndef DISABLE_SDL2MIXER\n+\n+\n #define LOW_PASS_FILTER\n //#define DEBUG_DUMP_WAVS\n #define NUM_CHANNELS 16\n@@ -77,15 +92,6 @@ static allocated_sound_t *allocated_sounds_head = NULL;\n static allocated_sound_t *allocated_sounds_tail = NULL;\n static int allocated_sounds_size = 0;\n \n-int use_libsamplerate = 0;\n-\n-// Scale factor used when converting libsamplerate floating point numbers\n-// to integers. Too high means the sounds can clip; too low means they\n-// will be too quiet. This is an amount that should avoid clipping most\n-// of the time: with all the Doom IWAD sound effects, at least. If a PWAD\n-// is used, clipping might occur.\n-\n-float libsamplerate_scale = 0.65f;\n \n // Hook a sound into the linked list at the head.\n \n@@ -1135,3 +1141,5 @@ sound_module_t sound_sdl_module =\n I_SDL_PrecacheSounds,\n };\n \n+\n+#endif // DISABLE_SDL2MIXER" ++ }, ++ { ++ "sha": "9cf1fd95db13504ffc6f98ead8c9150f03db72aa", ++ "filename": "src/i_sound.c", ++ "status": "modified", ++ "additions": 4, ++ "deletions": 0, ++ "changes": 4, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_sound.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_sound.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2Fi_sound.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -99,7 +99,9 @@ static int snd_mport = 0;\n \n static sound_module_t *sound_modules[] = \n {\n+#ifndef DISABLE_SDL2MIXER\n &sound_sdl_module,\n+#endif // DISABLE_SDL2MIXER\n &sound_pcsound_module,\n NULL,\n };\n@@ -108,7 +110,9 @@ static sound_module_t *sound_modules[] =\n \n static music_module_t *music_modules[] =\n {\n+#ifndef DISABLE_SDL2MIXER\n &music_sdl_module,\n+#endif // DISABLE_SDL2MIXER\n &music_opl_module,\n NULL,\n };" ++ }, ++ { ++ "sha": "c1f701c0b9f653eb3a36b71627747a6eda963d8f", ++ "filename": "src/net_sdl.c", ++ "status": "modified", ++ "additions": 63, ++ "deletions": 0, ++ "changes": 63, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fnet_sdl.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fnet_sdl.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2Fnet_sdl.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -33,6 +33,10 @@\n // NETWORKING\n //\n \n+\n+#ifndef DISABLE_SDL2NET\n+\n+\n #include \n \n #define DEFAULT_PORT 2342\n@@ -376,3 +380,62 @@ net_module_t net_sdl_module =\n NET_SDL_ResolveAddress,\n };\n \n+\n+#else // DISABLE_SDL2NET\n+\n+// no-op implementation\n+\n+\n+static boolean NET_NULL_InitClient(void)\n+{\n+ return false;\n+}\n+\n+\n+static boolean NET_NULL_InitServer(void)\n+{\n+ return false;\n+}\n+\n+\n+static void NET_NULL_SendPacket(net_addr_t *addr, net_packet_t *packet)\n+{\n+}\n+\n+\n+static boolean NET_NULL_RecvPacket(net_addr_t **addr, net_packet_t **packet)\n+{\n+ return false;\n+}\n+\n+\n+static void NET_NULL_AddrToString(net_addr_t *addr, char *buffer, int buffer_len)\n+{\n+\n+}\n+\n+\n+static void NET_NULL_FreeAddress(net_addr_t *addr)\n+{\n+}\n+\n+\n+net_addr_t *NET_NULL_ResolveAddress(const char *address)\n+{\n+ return NULL;\n+}\n+\n+\n+net_module_t net_sdl_module =\n+{\n+ NET_NULL_InitClient,\n+ NET_NULL_InitServer,\n+ NET_NULL_SendPacket,\n+ NET_NULL_RecvPacket,\n+ NET_NULL_AddrToString,\n+ NET_NULL_FreeAddress,\n+ NET_NULL_ResolveAddress,\n+};\n+\n+\n+#endif // DISABLE_SDL2NET" ++ }, ++ { ++ "sha": "90df2114163152ff732a9ba4a8bc18ef3d45d1bd", ++ "filename": "src/setup/CMakeLists.txt", ++ "status": "modified", ++ "additions": 4, ++ "deletions": 1, ++ "changes": 5, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fsetup%2FCMakeLists.txt", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fsetup%2FCMakeLists.txt", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2Fsetup%2FCMakeLists.txt?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -15,4 +15,7 @@ add_library(setup STATIC\n txt_mouseinput.c txt_mouseinput.h)\n \n target_include_directories(setup PRIVATE \"../\" \"${CMAKE_CURRENT_BINARY_DIR}/../../\")\n-target_link_libraries(setup textscreen SDL2::SDL2 SDL2::mixer)\n+target_link_libraries(setup textscreen SDL2::SDL2)\n+if(ENABLE_SDL2_mixer)\n+ target_link_libraries(setup SDL2::mixer)\n+endif()" ++ }, ++ { ++ "sha": "37b17ade983155369c0897c0935d40dfeb2048c7", ++ "filename": "src/strife/CMakeLists.txt", ++ "status": "modified", ++ "additions": 7, ++ "deletions": 1, ++ "changes": 8, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fstrife%2FCMakeLists.txt", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fstrife%2FCMakeLists.txt", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2Fstrife%2FCMakeLists.txt?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -70,4 +70,10 @@ set(STRIFE_SOURCES\n add_library(strife STATIC ${STRIFE_SOURCES})\n \n target_include_directories(strife PRIVATE \"../\" \"../../win32/\" \"${CMAKE_CURRENT_BINARY_DIR}/../../\")\n-target_link_libraries(strife textscreen SDL2::SDL2 SDL2::mixer SDL2::net)\n+target_link_libraries(strife textscreen SDL2::SDL2)\n+if(ENABLE_SDL2_mixer)\n+ target_link_libraries(strife SDL2::mixer)\n+endif()\n+if(ENABLE_SDL2_NET)\n+ target_link_libraries(strife SDL2::net)\n+endif()" ++ } ++] +diff --git a/tests/capture_tools_output/expected_result.json b/tests/capture_tools_output/expected_result.json +new file mode 100644 +index 0000000..0912b96 +--- /dev/null ++++ b/tests/capture_tools_output/expected_result.json +@@ -0,0 +1,320 @@ ++[ ++ { ++ "sha": "46e082cf77c5e60affc7689f7357c926fc00cda3", ++ "filename": "opl/opl.c", ++ "status": "modified", ++ "additions": 2, ++ "deletions": 0, ++ "changes": 2, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/opl%2Fopl.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/opl%2Fopl.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/opl%2Fopl.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -50,7 +50,9 @@ static opl_driver_t *drivers[] =\n #ifdef _WIN32\n &opl_win32_driver,\n #endif\n+#ifndef DISABLE_SDL2MIXER\n &opl_sdl_driver,\n+#endif // DISABLE_SDL2MIXER\n NULL\n };\n ", ++ "line_filter": { ++ "diff_chunks": [ ++ [ ++ 50, ++ 59 ++ ] ++ ], ++ "lines_added": [ ++ [ ++ 53, ++ 54 ++ ], ++ [ ++ 55, ++ 56 ++ ] ++ ] ++ } ++ }, ++ { ++ "sha": "6bd4e7e1f3374e289d3dc19972dcb1d5379d6b03", ++ "filename": "opl/opl_sdl.c", ++ "status": "modified", ++ "additions": 6, ++ "deletions": 0, ++ "changes": 6, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/opl%2Fopl_sdl.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/opl%2Fopl_sdl.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/opl%2Fopl_sdl.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -33,6 +33,10 @@\n \n #include \"opl_queue.h\"\n \n+\n+#ifndef DISABLE_SDL2MIXER\n+\n+\n #define MAX_SOUND_SLICE_TIME 100 /* ms */\n \n typedef struct\n@@ -511,3 +515,5 @@ opl_driver_t opl_sdl_driver =\n OPL_SDL_AdjustCallbacks,\n };\n \n+\n+#endif // DISABLE_SDL2MIXER", ++ "line_filter": { ++ "diff_chunks": [ ++ [ ++ 33, ++ 43 ++ ], ++ [ ++ 515, ++ 520 ++ ] ++ ], ++ "lines_added": [ ++ [ ++ 36, ++ 40 ++ ], ++ [ ++ 518, ++ 520 ++ ] ++ ] ++ } ++ }, ++ { ++ "sha": "58f9b75c2affd5f1dd990aaedab79d834575bf83", ++ "filename": "pcsound/pcsound.c", ++ "status": "modified", ++ "additions": 2, ++ "deletions": 0, ++ "changes": 2, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/pcsound%2Fpcsound.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/pcsound%2Fpcsound.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/pcsound%2Fpcsound.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -56,7 +56,9 @@ static pcsound_driver_t *drivers[] =\n #ifdef _WIN32\n &pcsound_win32_driver,\n #endif\n+#ifndef DISABLE_SDL2MIXER\n &pcsound_sdl_driver,\n+#endif // DISABLE_SDL2MIXER\n NULL,\n };\n ", ++ "line_filter": { ++ "diff_chunks": [ ++ [ ++ 56, ++ 65 ++ ] ++ ], ++ "lines_added": [ ++ [ ++ 59, ++ 60 ++ ], ++ [ ++ 61, ++ 62 ++ ] ++ ] ++ } ++ }, ++ { ++ "sha": "e77c7b0d29de1b0c665686004dfda311c9d96719", ++ "filename": "pcsound/pcsound_sdl.c", ++ "status": "modified", ++ "additions": 6, ++ "deletions": 0, ++ "changes": 6, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/pcsound%2Fpcsound_sdl.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/pcsound%2Fpcsound_sdl.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/pcsound%2Fpcsound_sdl.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -24,6 +24,10 @@\n #include \"pcsound.h\"\n #include \"pcsound_internal.h\"\n \n+\n+#ifndef DISABLE_SDL2MIXER\n+\n+\n #define MAX_SOUND_SLICE_TIME 70 /* ms */\n #define SQUARE_WAVE_AMP 0x2000\n \n@@ -248,3 +252,5 @@ pcsound_driver_t pcsound_sdl_driver =\n PCSound_SDL_Shutdown,\n };\n \n+\n+#endif // DISABLE_SDL2MIXER", ++ "line_filter": { ++ "diff_chunks": [ ++ [ ++ 24, ++ 34 ++ ], ++ [ ++ 252, ++ 257 ++ ] ++ ], ++ "lines_added": [ ++ [ ++ 27, ++ 31 ++ ], ++ [ ++ 255, ++ 257 ++ ] ++ ] ++ } ++ }, ++ { ++ "sha": "3facce6f01d02c5e8eef3088fa60576b9e949829", ++ "filename": "src/i_musicpack.c", ++ "status": "modified", ++ "additions": 87, ++ "deletions": 1, ++ "changes": 88, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_musicpack.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_musicpack.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2Fi_musicpack.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -44,6 +44,13 @@\n #include \"w_wad.h\"\n #include \"z_zone.h\"\n \n+\n+char *music_pack_path = \"\";\n+\n+\n+#ifndef DISABLE_SDL2MIXER\n+\n+\n #define MID_HEADER_MAGIC \"MThd\"\n #define MUS_HEADER_MAGIC \"MUS\\x1a\"\n \n@@ -99,7 +106,6 @@ static boolean music_initialized = false;\n \n static boolean sdl_was_initialized = false;\n \n-char *music_pack_path = \"\";\n \n // If true, we are playing a substitute digital track rather than in-WAD\n // MIDI/MUS track, and file_metadata contains loop metadata.\n@@ -1375,3 +1381,83 @@ music_module_t music_pack_module =\n I_MP_PollMusic,\n };\n \n+\n+#else // DISABLE_SDL2MIXER\n+\n+\n+static boolean I_NULL_InitMusic(void)\n+{\n+ return false;\n+}\n+\n+\n+static void I_NULL_ShutdownMusic(void)\n+{\n+}\n+\n+\n+static void I_NULL_SetMusicVolume(int volume)\n+{\n+}\n+\n+\n+static void I_NULL_PauseSong(void)\n+{\n+}\n+\n+\n+static void I_NULL_ResumeSong(void)\n+{\n+}\n+\n+\n+static void *I_NULL_RegisterSong(void *data, int len)\n+{\n+ return NULL;\n+}\n+\n+\n+static void I_NULL_UnRegisterSong(void *handle)\n+{\n+}\n+\n+\n+static void I_NULL_PlaySong(void *handle, boolean looping)\n+{\n+}\n+\n+\n+static void I_NULL_StopSong(void)\n+{\n+}\n+\n+\n+static boolean I_NULL_MusicIsPlaying(void)\n+{\n+ return false;\n+}\n+\n+\n+static void I_NULL_PollMusic(void)\n+{\n+}\n+\n+music_module_t music_pack_module =\n+{\n+ NULL,\n+ 0,\n+ I_NULL_InitMusic,\n+ I_NULL_ShutdownMusic,\n+ I_NULL_SetMusicVolume,\n+ I_NULL_PauseSong,\n+ I_NULL_ResumeSong,\n+ I_NULL_RegisterSong,\n+ I_NULL_UnRegisterSong,\n+ I_NULL_PlaySong,\n+ I_NULL_StopSong,\n+ I_NULL_MusicIsPlaying,\n+ I_NULL_PollMusic,\n+};\n+\n+\n+#endif // DISABLE_SDL2MIXER", ++ "line_filter": { ++ "diff_chunks": [ ++ [ ++ 44, ++ 57 ++ ], ++ [ ++ 106, ++ 112 ++ ], ++ [ ++ 1381, ++ 1464 ++ ] ++ ], ++ "lines_added": [ ++ [ ++ 47, ++ 54 ++ ], ++ [ ++ 1384, ++ 1464 ++ ] ++ ] ++ } ++ }, ++ { ++ "sha": "48fedfbd7608ad8c6575a4bd82a5e1cb3646e071", ++ "filename": "src/i_sdlmusic.c", ++ "status": "modified", ++ "additions": 21, ++ "deletions": 13, ++ "changes": 34, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_sdlmusic.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_sdlmusic.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2Fi_sdlmusic.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -44,19 +44,6 @@\n #include \"w_wad.h\"\n #include \"z_zone.h\"\n \n-#define MAXMIDLENGTH (96 * 1024)\n-\n-static boolean music_initialized = false;\n-\n-// If this is true, this module initialized SDL sound and has the \n-// responsibility to shut it down\n-\n-static boolean sdl_was_initialized = false;\n-\n-static boolean win_midi_stream_opened = false;\n-\n-static boolean musicpaused = false;\n-static int current_music_volume;\n \n char *fluidsynth_sf_path = \"\";\n char *timidity_cfg_path = \"\";\n@@ -138,6 +125,25 @@ void I_InitTimidityConfig(void)\n }\n }\n \n+\n+#ifndef DISABLE_SDL2MIXER\n+\n+\n+#define MAXMIDLENGTH (96 * 1024)\n+\n+static boolean music_initialized = false;\n+\n+// If this is true, this module initialized SDL sound and has the\n+// responsibility to shut it down\n+\n+static boolean sdl_was_initialized = false;\n+\n+static boolean win_midi_stream_opened = false;\n+\n+static boolean musicpaused = false;\n+static int current_music_volume;\n+\n+\n // Remove the temporary config file generated by I_InitTimidityConfig().\n \n static void RemoveTimidityConfig(void)\n@@ -588,3 +594,5 @@ music_module_t music_sdl_module =\n NULL, // Poll\n };\n \n+\n+#endif // DISABLE_SDL2MIXER", ++ "line_filter": { ++ "diff_chunks": [ ++ [ ++ 44, ++ 50 ++ ], ++ [ ++ 125, ++ 150 ++ ], ++ [ ++ 594, ++ 599 ++ ] ++ ], ++ "lines_added": [ ++ [ ++ 128, ++ 147 ++ ], ++ [ ++ 597, ++ 599 ++ ] ++ ] ++ } ++ }, ++ { ++ "sha": "7f2a26096b218c5323f5dc569c6f70ab399782bf", ++ "filename": "src/i_sdlsound.c", ++ "status": "modified", ++ "additions": 17, ++ "deletions": 9, ++ "changes": 26, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_sdlsound.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_sdlsound.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2Fi_sdlsound.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -41,6 +41,21 @@\n \n #include \"doomtype.h\"\n \n+\n+int use_libsamplerate = 0;\n+\n+// Scale factor used when converting libsamplerate floating point numbers\n+// to integers. Too high means the sounds can clip; too low means they\n+// will be too quiet. This is an amount that should avoid clipping most\n+// of the time: with all the Doom IWAD sound effects, at least. If a PWAD\n+// is used, clipping might occur.\n+\n+float libsamplerate_scale = 0.65f;\n+\n+\n+#ifndef DISABLE_SDL2MIXER\n+\n+\n #define LOW_PASS_FILTER\n //#define DEBUG_DUMP_WAVS\n #define NUM_CHANNELS 16\n@@ -77,15 +92,6 @@ static allocated_sound_t *allocated_sounds_head = NULL;\n static allocated_sound_t *allocated_sounds_tail = NULL;\n static int allocated_sounds_size = 0;\n \n-int use_libsamplerate = 0;\n-\n-// Scale factor used when converting libsamplerate floating point numbers\n-// to integers. Too high means the sounds can clip; too low means they\n-// will be too quiet. This is an amount that should avoid clipping most\n-// of the time: with all the Doom IWAD sound effects, at least. If a PWAD\n-// is used, clipping might occur.\n-\n-float libsamplerate_scale = 0.65f;\n \n // Hook a sound into the linked list at the head.\n \n@@ -1135,3 +1141,5 @@ sound_module_t sound_sdl_module =\n I_SDL_PrecacheSounds,\n };\n \n+\n+#endif // DISABLE_SDL2MIXER", ++ "line_filter": { ++ "diff_chunks": [ ++ [ ++ 41, ++ 62 ++ ], ++ [ ++ 92, ++ 98 ++ ], ++ [ ++ 1141, ++ 1146 ++ ] ++ ], ++ "lines_added": [ ++ [ ++ 44, ++ 59 ++ ], ++ [ ++ 1144, ++ 1146 ++ ] ++ ] ++ } ++ }, ++ { ++ "sha": "9cf1fd95db13504ffc6f98ead8c9150f03db72aa", ++ "filename": "src/i_sound.c", ++ "status": "modified", ++ "additions": 4, ++ "deletions": 0, ++ "changes": 4, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_sound.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fi_sound.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2Fi_sound.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -99,7 +99,9 @@ static int snd_mport = 0;\n \n static sound_module_t *sound_modules[] = \n {\n+#ifndef DISABLE_SDL2MIXER\n &sound_sdl_module,\n+#endif // DISABLE_SDL2MIXER\n &sound_pcsound_module,\n NULL,\n };\n@@ -108,7 +110,9 @@ static sound_module_t *sound_modules[] =\n \n static music_module_t *music_modules[] =\n {\n+#ifndef DISABLE_SDL2MIXER\n &music_sdl_module,\n+#endif // DISABLE_SDL2MIXER\n &music_opl_module,\n NULL,\n };", ++ "line_filter": { ++ "diff_chunks": [ ++ [ ++ 99, ++ 108 ++ ], ++ [ ++ 110, ++ 119 ++ ] ++ ], ++ "lines_added": [ ++ [ ++ 102, ++ 103 ++ ], ++ [ ++ 104, ++ 105 ++ ], ++ [ ++ 113, ++ 114 ++ ], ++ [ ++ 115, ++ 116 ++ ] ++ ] ++ } ++ }, ++ { ++ "sha": "c1f701c0b9f653eb3a36b71627747a6eda963d8f", ++ "filename": "src/net_sdl.c", ++ "status": "modified", ++ "additions": 63, ++ "deletions": 0, ++ "changes": 63, ++ "blob_url": "https://github.com/chocolate-doom/chocolate-doom/blob/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fnet_sdl.c", ++ "raw_url": "https://github.com/chocolate-doom/chocolate-doom/raw/3c35acde7d398c32f6fad50fa902de391f573ffa/src%2Fnet_sdl.c", ++ "contents_url": "https://api.github.com/repos/chocolate-doom/chocolate-doom/contents/src%2Fnet_sdl.c?ref=3c35acde7d398c32f6fad50fa902de391f573ffa", ++ "patch": "@@ -33,6 +33,10 @@\n // NETWORKING\n //\n \n+\n+#ifndef DISABLE_SDL2NET\n+\n+\n #include \n \n #define DEFAULT_PORT 2342\n@@ -376,3 +380,62 @@ net_module_t net_sdl_module =\n NET_SDL_ResolveAddress,\n };\n \n+\n+#else // DISABLE_SDL2NET\n+\n+// no-op implementation\n+\n+\n+static boolean NET_NULL_InitClient(void)\n+{\n+ return false;\n+}\n+\n+\n+static boolean NET_NULL_InitServer(void)\n+{\n+ return false;\n+}\n+\n+\n+static void NET_NULL_SendPacket(net_addr_t *addr, net_packet_t *packet)\n+{\n+}\n+\n+\n+static boolean NET_NULL_RecvPacket(net_addr_t **addr, net_packet_t **packet)\n+{\n+ return false;\n+}\n+\n+\n+static void NET_NULL_AddrToString(net_addr_t *addr, char *buffer, int buffer_len)\n+{\n+\n+}\n+\n+\n+static void NET_NULL_FreeAddress(net_addr_t *addr)\n+{\n+}\n+\n+\n+net_addr_t *NET_NULL_ResolveAddress(const char *address)\n+{\n+ return NULL;\n+}\n+\n+\n+net_module_t net_sdl_module =\n+{\n+ NET_NULL_InitClient,\n+ NET_NULL_InitServer,\n+ NET_NULL_SendPacket,\n+ NET_NULL_RecvPacket,\n+ NET_NULL_AddrToString,\n+ NET_NULL_FreeAddress,\n+ NET_NULL_ResolveAddress,\n+};\n+\n+\n+#endif // DISABLE_SDL2NET", ++ "line_filter": { ++ "diff_chunks": [ ++ [ ++ 33, ++ 43 ++ ], ++ [ ++ 380, ++ 442 ++ ] ++ ], ++ "lines_added": [ ++ [ ++ 36, ++ 40 ++ ], ++ [ ++ 383, ++ 442 ++ ] ++ ] ++ } ++ } ++] +diff --git a/tests/capture_tools_output/test_database_path.py b/tests/capture_tools_output/test_database_path.py +new file mode 100644 +index 0000000..3bafa66 +--- /dev/null ++++ b/tests/capture_tools_output/test_database_path.py +@@ -0,0 +1,59 @@ ++"""Tests specific to specifying the compilation database path.""" ++from typing import List ++from pathlib import Path, PurePath ++import logging ++import re ++import pytest ++from cpp_linter import logger ++import cpp_linter.run ++from cpp_linter.run import run_clang_tidy ++ ++CLANG_TIDY_COMMAND = re.compile(r"\"clang-tidy(.*)(?:\")") ++ ++ABS_DB_PATH = str(Path("tests/demo").resolve()) ++ ++ ++@pytest.mark.parametrize( ++ "database,expected_args", ++ [ ++ # implicit path to the compilation database ++ ("", []), ++ # explicit relative path to the compilation database ++ ("../../demo", ["-p", ABS_DB_PATH]), ++ # explicit absolute path to the compilation database ++ (ABS_DB_PATH, ["-p", ABS_DB_PATH]), ++ ], ++ ids=["implicit path", "relative path", "absolute path"], ++) ++def test_db_detection( ++ caplog: pytest.LogCaptureFixture, ++ monkeypatch: pytest.MonkeyPatch, ++ pytestconfig: pytest.Config, ++ database: str, ++ expected_args: List[str], ++): ++ """test clang-tidy using a implicit path to the compilation database.""" ++ monkeypatch.chdir(PurePath(__file__).parent.as_posix()) ++ demo_src = "../demo/demo.cpp" ++ rel_root = str(Path(*Path(__file__).parts[-2:])) ++ cpp_linter.run.RUNNER_WORKSPACE = ( ++ Path(pytestconfig.rootpath, "tests").resolve().as_posix() ++ ) ++ caplog.set_level(logging.DEBUG, logger=logger.name) ++ run_clang_tidy( ++ filename=(demo_src), ++ file_obj={}, # only used when filtering lines ++ version="", ++ checks="", # let clang-tidy use a .clang-tidy config file ++ lines_changed_only=0, # analyze complete file ++ database=database, ++ repo_root=rel_root, ++ ) ++ matched_args = [] ++ for record in caplog.records: ++ msg_match = CLANG_TIDY_COMMAND.search(record.message) ++ if msg_match is not None: ++ matched_args = msg_match.group(0)[:-1].split()[2:] ++ assert "Error while trying to load a compilation database" not in record.message ++ expected_args.append(demo_src) ++ assert matched_args == expected_args +diff --git a/tests/capture_tools_output/test_tools_output.py b/tests/capture_tools_output/test_tools_output.py +new file mode 100644 +index 0000000..c7467fa +--- /dev/null ++++ b/tests/capture_tools_output/test_tools_output.py +@@ -0,0 +1,207 @@ ++"""Various tests related to the ``lines_changed_only`` option.""" ++import os ++import logging ++from typing import Dict, Any, cast, List, Optional ++from pathlib import Path ++import json ++import re ++import pytest ++import cpp_linter ++from cpp_linter.run import ( ++ filter_out_non_source_files, ++ verify_files_are_present, ++ capture_clang_tools_output, ++ make_annotations, ++ log_commander, ++) ++from cpp_linter.thread_comments import list_diff_comments ++ ++CLANG_VERSION = os.getenv("CLANG_VERSION", "12") ++ ++ ++@pytest.mark.parametrize( ++ "extensions", [(["c"]), pytest.param(["h"], marks=pytest.mark.xfail)] ++) ++def test_lines_changed_only( ++ monkeypatch: pytest.MonkeyPatch, ++ caplog: pytest.LogCaptureFixture, ++ extensions: List[str], ++): ++ """Test for lines changes in diff. ++ ++ This checks for ++ 1. ranges of diff chunks. ++ 2. ranges of lines in diff that only contain additions. ++ """ ++ monkeypatch.chdir(str(Path(__file__).parent)) ++ caplog.set_level(logging.DEBUG, logger=cpp_linter.logger.name) ++ cpp_linter.Globals.FILES = json.loads( ++ Path("event_files.json").read_text(encoding="utf-8") ++ ) ++ if filter_out_non_source_files( ++ ext_list=extensions, ++ ignored=[".github"], ++ not_ignored=[], ++ ): ++ test_result = Path("expected_result.json").read_text(encoding="utf-8") ++ for file, result in zip( ++ cpp_linter.Globals.FILES, ++ json.loads(test_result), ++ ): ++ expected = result["line_filter"]["diff_chunks"] ++ assert file["line_filter"]["diff_chunks"] == expected ++ expected = result["line_filter"]["lines_added"] ++ assert file["line_filter"]["lines_added"] == expected ++ else: ++ raise RuntimeError("test failed to find files") ++ ++ ++TEST_REPO = re.compile(r".*github.com/(?:\w|\-|_)+/((?:\w|\-|_)+)/.*") ++ ++ ++@pytest.fixture(autouse=True) ++def setup_test_repo(monkeypatch: pytest.MonkeyPatch) -> None: ++ """Setup a test repo to run the rest of the tests in this module.""" ++ test_root = Path(__file__).parent ++ cpp_linter.Globals.FILES = json.loads( ++ Path(test_root / "expected_result.json").read_text(encoding="utf-8") ++ ) ++ # flush output from any previous tests ++ cpp_linter.Globals.OUTPUT = "" ++ cpp_linter.GlobalParser.format_advice = [] ++ cpp_linter.GlobalParser.tidy_notes = [] ++ cpp_linter.GlobalParser.tidy_advice = [] ++ ++ repo_root = TEST_REPO.sub("\\1", cpp_linter.Globals.FILES[0]["blob_url"]) ++ return_path = test_root / repo_root ++ if not return_path.exists(): ++ return_path.mkdir() ++ monkeypatch.chdir(str(return_path)) ++ verify_files_are_present() ++ ++ ++def match_file_json(filename: str) -> Optional[Dict[str, Any]]: ++ """A helper function to match a given filename with a file's JSON object.""" ++ for file in cpp_linter.Globals.FILES: ++ if file["filename"] == filename: ++ return file ++ print("file", filename, "not found in expected_result.json") ++ return None ++ ++ ++RECORD_FILE = re.compile(r".*file=(.*?),.*") ++FORMAT_RECORD = re.compile(r"Run clang-format on ") ++FORMAT_RECORD_LINES = re.compile(r".*\(lines (.*)\).*") ++TIDY_RECORD = re.compile(r":\d+:\d+ \[.*\]::") ++TIDY_RECORD_LINE = re.compile(r".*,line=(\d+).*") ++ ++ ++@pytest.mark.parametrize( ++ "lines_changed_only", [0, 1, 2], ids=["all lines", "only diff", "only added"] ++) ++@pytest.mark.parametrize("style", ["file", "llvm", "google"]) ++def test_format_annotations( ++ caplog: pytest.LogCaptureFixture, ++ lines_changed_only: int, ++ style: str, ++): ++ """Test clang-format annotations.""" ++ capture_clang_tools_output( ++ version=CLANG_VERSION, ++ checks="-*", # disable clang-tidy output ++ style=style, ++ lines_changed_only=lines_changed_only, ++ database="", ++ repo_root="", ++ ) ++ assert "Output from `clang-tidy`" not in cpp_linter.Globals.OUTPUT ++ caplog.set_level(logging.INFO, logger=log_commander.name) ++ log_commander.propagate = True ++ make_annotations( ++ style=style, file_annotations=True, lines_changed_only=lines_changed_only ++ ) ++ for message in [r.message for r in caplog.records if r.levelno == logging.INFO]: ++ if FORMAT_RECORD.search(message) is not None: ++ lines = [ ++ int(l.strip()) ++ for l in FORMAT_RECORD_LINES.sub("\\1", message).split(",") ++ ] ++ file = match_file_json(RECORD_FILE.sub("\\1", message).replace("\\", "/")) ++ if file is None: ++ continue ++ ranges = cpp_linter.range_of_changed_lines(file, lines_changed_only) ++ if ranges: # an empty list if lines_changed_only == 0 ++ for line in lines: ++ assert line in ranges ++ else: ++ raise RuntimeWarning(f"unrecognized record: {message}") ++ ++ ++@pytest.mark.parametrize( ++ "lines_changed_only", [0, 1, 2], ids=["all lines", "only diff", "only added"] ++) ++@pytest.mark.parametrize( ++ "checks", ++ [ ++ "", ++ "boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*," ++ "clang-analyzer-*,cppcoreguidelines-*", ++ ], ++ ids=["config file", "action defaults"], ++) ++def test_tidy_annotations( ++ caplog: pytest.LogCaptureFixture, ++ lines_changed_only: int, ++ checks: str, ++): ++ """Test clang-tidy annotations.""" ++ capture_clang_tools_output( ++ version=CLANG_VERSION, ++ checks=checks, ++ style="", # disable clang-format output ++ lines_changed_only=lines_changed_only, ++ database="", ++ repo_root="", ++ ) ++ assert "Run `clang-format` on the following files" not in cpp_linter.Globals.OUTPUT ++ caplog.set_level(logging.INFO, logger=log_commander.name) ++ log_commander.propagate = True ++ make_annotations( ++ style="", file_annotations=True, lines_changed_only=lines_changed_only ++ ) ++ for message in [r.message for r in caplog.records if r.levelno == logging.INFO]: ++ if TIDY_RECORD.search(message) is not None: ++ line = int(TIDY_RECORD_LINE.sub("\\1", message)) ++ file = match_file_json(RECORD_FILE.sub("\\1", message).replace("\\", "/")) ++ if file is None: ++ continue ++ ranges = cpp_linter.range_of_changed_lines(file, lines_changed_only) ++ if ranges: # an empty list if lines_changed_only == 0 ++ assert line in ranges ++ else: ++ raise RuntimeWarning(f"unrecognized record: {message}") ++ ++ ++@pytest.mark.parametrize("lines_changed_only", [1, 2], ids=["only diff", "only added"]) ++def test_diff_comment(lines_changed_only: int): ++ """Tests code that isn't actually used (yet) for posting ++ comments (not annotations) in the event's diff. ++ ++ Remember, diff comments should only focus on lines in the diff.""" ++ capture_clang_tools_output( ++ version=CLANG_VERSION, ++ checks="", ++ style="file", ++ lines_changed_only=lines_changed_only, ++ database="", ++ repo_root="", ++ ) ++ diff_comments = list_diff_comments(lines_changed_only) ++ # output = Path(__file__).parent / "diff_comments.json" ++ # output.write_text(json.dumps(diff_comments, indent=2), encoding="utf-8") ++ for comment in diff_comments: ++ file = match_file_json(cast(str, comment["path"])) ++ if file is None: ++ continue ++ ranges = cpp_linter.range_of_changed_lines(file, lines_changed_only) ++ assert comment["line"] in ranges +diff --git a/tests/demo/.clang-format b/tests/demo/.clang-format +new file mode 100644 +index 0000000..1dd236c +--- /dev/null ++++ b/tests/demo/.clang-format +@@ -0,0 +1,3 @@ ++--- ++Language: Cpp ++BasedOnStyle: WebKit +diff --git a/tests/demo/.clang-tidy b/tests/demo/.clang-tidy +new file mode 100644 +index 0000000..d3865ad +--- /dev/null ++++ b/tests/demo/.clang-tidy +@@ -0,0 +1,186 @@ ++--- ++Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,performance-*,bugprone-*,clang-analyzer-*,mpi-*,misc-*,readability-*' ++WarningsAsErrors: '' ++HeaderFilterRegex: '' ++AnalyzeTemporaryDtors: false ++FormatStyle: 'file' ++CheckOptions: ++ - key: bugprone-argument-comment.CommentBoolLiterals ++ value: '0' ++ - key: bugprone-argument-comment.CommentCharacterLiterals ++ value: '0' ++ - key: bugprone-argument-comment.CommentFloatLiterals ++ value: '0' ++ - key: bugprone-argument-comment.CommentIntegerLiterals ++ value: '0' ++ - key: bugprone-argument-comment.CommentNullPtrs ++ value: '0' ++ - key: bugprone-argument-comment.CommentStringLiterals ++ value: '0' ++ - key: bugprone-argument-comment.CommentUserDefinedLiterals ++ value: '0' ++ - key: bugprone-argument-comment.IgnoreSingleArgument ++ value: '0' ++ - key: bugprone-argument-comment.StrictMode ++ value: '0' ++ - key: bugprone-assert-side-effect.AssertMacros ++ value: assert ++ - key: bugprone-assert-side-effect.CheckFunctionCalls ++ value: '0' ++ - key: bugprone-dangling-handle.HandleClasses ++ value: 'std::basic_string_view;std::experimental::basic_string_view' ++ - key: bugprone-dynamic-static-initializers.HeaderFileExtensions ++ value: ',h,hh,hpp,hxx' ++ - key: bugprone-exception-escape.FunctionsThatShouldNotThrow ++ value: '' ++ - key: bugprone-exception-escape.IgnoredExceptions ++ value: '' ++ - key: bugprone-misplaced-widening-cast.CheckImplicitCasts ++ value: '0' ++ - key: bugprone-not-null-terminated-result.WantToUseSafeFunctions ++ value: '1' ++ - key: bugprone-signed-char-misuse.CharTypdefsToIgnore ++ value: '' ++ - key: bugprone-sizeof-expression.WarnOnSizeOfCompareToConstant ++ value: '1' ++ - key: bugprone-sizeof-expression.WarnOnSizeOfConstant ++ value: '1' ++ - key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression ++ value: '0' ++ - key: bugprone-sizeof-expression.WarnOnSizeOfThis ++ value: '1' ++ - key: bugprone-string-constructor.LargeLengthThreshold ++ value: '8388608' ++ - key: bugprone-string-constructor.WarnOnLargeLength ++ value: '1' ++ - key: bugprone-suspicious-enum-usage.StrictMode ++ value: '0' ++ - key: bugprone-suspicious-missing-comma.MaxConcatenatedTokens ++ value: '5' ++ - key: bugprone-suspicious-missing-comma.RatioThreshold ++ value: '0.200000' ++ - key: bugprone-suspicious-missing-comma.SizeThreshold ++ value: '5' ++ - key: bugprone-suspicious-string-compare.StringCompareLikeFunctions ++ value: '' ++ - key: bugprone-suspicious-string-compare.WarnOnImplicitComparison ++ value: '1' ++ - key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison ++ value: '0' ++ - key: bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit ++ value: '16' ++ - key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField ++ value: '1' ++ - key: bugprone-unused-return-value.CheckedFunctions ++ value: '::std::async;::std::launder;::std::remove;::std::remove_if;::std::unique;::std::unique_ptr::release;::std::basic_string::empty;::std::vector::empty' ++ - key: cert-dcl16-c.NewSuffixes ++ value: 'L;LL;LU;LLU' ++ - key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField ++ value: '0' ++ - key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors ++ value: '1' ++ - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic ++ value: '1' ++ - key: google-readability-braces-around-statements.ShortStatementLines ++ value: '1' ++ - key: google-readability-function-size.StatementThreshold ++ value: '800' ++ - key: google-readability-namespace-comments.ShortNamespaceLines ++ value: '10' ++ - key: google-readability-namespace-comments.SpacesBeforeComments ++ value: '2' ++ - key: misc-definitions-in-headers.HeaderFileExtensions ++ value: ',h,hh,hpp,hxx' ++ - key: misc-definitions-in-headers.UseHeaderFileExtension ++ value: '1' ++ - key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries ++ value: '1' ++ - key: misc-unused-parameters.StrictMode ++ value: '0' ++ - key: modernize-loop-convert.MaxCopySize ++ value: '16' ++ - key: modernize-loop-convert.MinConfidence ++ value: reasonable ++ - key: modernize-loop-convert.NamingStyle ++ value: CamelCase ++ - key: modernize-pass-by-value.IncludeStyle ++ value: llvm ++ - key: modernize-replace-auto-ptr.IncludeStyle ++ value: llvm ++ - key: modernize-use-nullptr.NullMacros ++ value: 'NULL' ++ - key: performance-faster-string-find.StringLikeClasses ++ value: 'std::basic_string' ++ - key: performance-for-range-copy.AllowedTypes ++ value: '' ++ - key: performance-for-range-copy.WarnOnAllAutoCopies ++ value: '0' ++ - key: performance-inefficient-string-concatenation.StrictMode ++ value: '0' ++ - key: performance-inefficient-vector-operation.EnableProto ++ value: '0' ++ - key: performance-inefficient-vector-operation.VectorLikeClasses ++ value: '::std::vector' ++ - key: performance-move-const-arg.CheckTriviallyCopyableMove ++ value: '1' ++ - key: performance-move-constructor-init.IncludeStyle ++ value: llvm ++ - key: performance-no-automatic-move.AllowedTypes ++ value: '' ++ - key: performance-type-promotion-in-math-fn.IncludeStyle ++ value: llvm ++ - key: performance-unnecessary-copy-initialization.AllowedTypes ++ value: '' ++ - key: performance-unnecessary-value-param.AllowedTypes ++ value: '' ++ - key: performance-unnecessary-value-param.IncludeStyle ++ value: llvm ++ - key: readability-braces-around-statements.ShortStatementLines ++ value: '0' ++ - key: readability-else-after-return.WarnOnUnfixable ++ value: '1' ++ - key: readability-function-size.BranchThreshold ++ value: '4294967295' ++ - key: readability-function-size.LineThreshold ++ value: '4294967295' ++ - key: readability-function-size.NestingThreshold ++ value: '4294967295' ++ - key: readability-function-size.ParameterThreshold ++ value: '4294967295' ++ - key: readability-function-size.StatementThreshold ++ value: '800' ++ - key: readability-function-size.VariableThreshold ++ value: '4294967295' ++ - key: readability-identifier-naming.IgnoreFailedSplit ++ value: '0' ++ - key: readability-implicit-bool-conversion.AllowIntegerConditions ++ value: '0' ++ - key: readability-implicit-bool-conversion.AllowPointerConditions ++ value: '0' ++ - key: readability-inconsistent-declaration-parameter-name.IgnoreMacros ++ value: '1' ++ - key: readability-inconsistent-declaration-parameter-name.Strict ++ value: '0' ++ - key: readability-magic-numbers.IgnoredFloatingPointValues ++ value: '1.0;100.0;' ++ - key: readability-magic-numbers.IgnoredIntegerValues ++ value: '1;2;3;4;' ++ - key: readability-redundant-member-init.IgnoreBaseInCopyConstructors ++ value: '0' ++ - key: readability-redundant-smartptr-get.IgnoreMacros ++ value: '1' ++ - key: readability-redundant-string-init.StringNames ++ value: '::std::basic_string' ++ - key: readability-simplify-boolean-expr.ChainedConditionalAssignment ++ value: '0' ++ - key: readability-simplify-boolean-expr.ChainedConditionalReturn ++ value: '0' ++ - key: readability-simplify-subscript-expr.Types ++ value: '::std::basic_string;::std::basic_string_view;::std::vector;::std::array' ++ - key: readability-static-accessed-through-instance.NameSpecifierNestingThreshold ++ value: '3' ++ - key: readability-uppercase-literal-suffix.IgnoreMacros ++ value: '1' ++ - key: readability-uppercase-literal-suffix.NewSuffixes ++ value: '' ++... +diff --git a/tests/demo/compile_flags.txt b/tests/demo/compile_flags.txt +new file mode 100644 +index 0000000..03e4446 +--- /dev/null ++++ b/tests/demo/compile_flags.txt +@@ -0,0 +1,2 @@ ++-Wall ++-Werror +diff --git a/tests/demo/demo.cpp b/tests/demo/demo.cpp +new file mode 100644 +index 0000000..1bf553e +--- /dev/null ++++ b/tests/demo/demo.cpp +@@ -0,0 +1,18 @@ ++/** This is a very ugly test code (doomed to fail linting) */ ++#include "demo.hpp" ++#include ++ ++ ++ ++ ++int main(){ ++ ++ for (;;) break; ++ ++ ++ printf("Hello world!\n"); ++ ++ ++ ++ ++ return 0;} +diff --git a/tests/demo/demo.hpp b/tests/demo/demo.hpp +new file mode 100644 +index 0000000..f93d012 +--- /dev/null ++++ b/tests/demo/demo.hpp +@@ -0,0 +1,36 @@ ++#pragma once ++ ++ ++ ++class Dummy { ++ char* useless; ++ int numb; ++ Dummy() :numb(0), useless("\0"){} ++ ++ public: ++ void *not_useful(char *str){useless = str;} ++}; ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++struct LongDiff ++{ ++ ++ long diff; ++ ++}; +diff --git a/tests/ignored_paths/.gitmodules b/tests/ignored_paths/.gitmodules +new file mode 100644 +index 0000000..3696a31 +--- /dev/null ++++ b/tests/ignored_paths/.gitmodules +@@ -0,0 +1,12 @@ ++[submodule "RF24"] ++ path = RF24 ++ url = https://github.com/nRF24/RF24.git ++[submodule "RF24Network"] ++ path = RF24Network ++ url = https://github.com/nRF24/RF24Network.git ++[submodule "RF24Mesh"] ++ path = RF24Mesh ++ url = https://github.com/nRF24/RF24Mesh.git ++[submodule "pybind11"] ++ path = pybind11 ++ url = https://github.com/pybind/pybind11.git +diff --git a/tests/ignored_paths/test_ignored_paths.py b/tests/ignored_paths/test_ignored_paths.py +new file mode 100644 +index 0000000..b27d3b8 +--- /dev/null ++++ b/tests/ignored_paths/test_ignored_paths.py +@@ -0,0 +1,32 @@ ++"""Tests that focus on the ``ignore`` option's parsing.""" ++from pathlib import Path ++from typing import List ++import pytest ++from cpp_linter.run import parse_ignore_option, is_file_in_list ++ ++ ++@pytest.mark.parametrize( ++ "user_in,is_ignored,is_not_ignored,expected", ++ [ ++ ("src", "src", "src", [True, False]), ++ ("!src|./", "", "src", [True, True]), ++ ], ++) ++def test_ignore( ++ user_in: str, is_ignored: str, is_not_ignored: str, expected: List[bool] ++): ++ """test ignoring of a specified path.""" ++ ignored, not_ignored = parse_ignore_option(user_in) ++ assert expected == [ ++ is_file_in_list(ignored, is_ignored, "ignored"), ++ is_file_in_list(not_ignored, is_not_ignored, "not ignored"), ++ ] ++ ++ ++def test_ignore_submodule(monkeypatch: pytest.MonkeyPatch): ++ """test auto detection of submodules and ignore the paths appropriately.""" ++ monkeypatch.chdir(str(Path(__file__).parent)) ++ ignored, not_ignored = parse_ignore_option("!pybind11") ++ for ignored_submodule in ["RF24", "RF24Network", "RF24Mesh"]: ++ assert ignored_submodule in ignored ++ assert "pybind11" in not_ignored +diff --git a/tests/test_cli_args.py b/tests/test_cli_args.py +new file mode 100644 +index 0000000..4015877 +--- /dev/null ++++ b/tests/test_cli_args.py +@@ -0,0 +1,75 @@ ++"""Tests related parsing input from CLI arguments.""" ++from typing import List, Union ++import pytest ++from cpp_linter.run import cli_arg_parser ++ ++ ++class Args: ++ """A pseudo namespace declaration. Each attribute is initialized with the ++ corresponding CLI arg's default value.""" ++ ++ verbosity: int = 10 ++ database: str = "" ++ style: str = "llvm" ++ tidy_checks: str = ( ++ "boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*," ++ "clang-analyzer-*,cppcoreguidelines-*" ++ ) ++ version: str = "" ++ extensions: List[str] = [ ++ "c", ++ "h", ++ "C", ++ "H", ++ "cpp", ++ "hpp", ++ "cc", ++ "hh", ++ "c++", ++ "h++", ++ "cxx", ++ "hxx", ++ ] ++ repo_root: str = "." ++ ignore: str = ".github" ++ lines_changed_only: int = 0 ++ files_changed_only: bool = False ++ thread_comments: bool = False ++ file_annotations: bool = True ++ ++ ++def test_defaults(): ++ """test default values""" ++ args = cli_arg_parser.parse_args("") ++ for key in args.__dict__.keys(): ++ assert args.__dict__[key] == getattr(Args, key) ++ ++ ++@pytest.mark.parametrize( ++ "arg_name,arg_value,attr_name,attr_value", ++ [ ++ ("verbosity", "20", "verbosity", 20), ++ ("database", "build", "database", "build"), ++ ("style", "file", "style", "file"), ++ ("tidy-checks", "-*", "tidy_checks", "-*"), ++ ("version", "14", "version", "14"), ++ ("extensions", ".cpp, .h", "extensions", ["cpp", "h"]), ++ ("extensions", "cxx,.hpp", "extensions", ["cxx", "hpp"]), ++ ("repo-root", "src", "repo_root", "src"), ++ ("ignore", "!src|", "ignore", "!src|"), ++ ("lines-changed-only", "True", "lines_changed_only", 2), ++ ("lines-changed-only", "difF", "lines_changed_only", 1), ++ ("files-changed-only", "True", "files_changed_only", True), ++ ("thread-comments", "True", "thread_comments", True), ++ ("file-annotations", "False", "file_annotations", False), ++ ], ++) ++def test_arg_parser( ++ arg_name: str, ++ arg_value: str, ++ attr_name: str, ++ attr_value: Union[int, str, List[str], bool], ++): ++ """parameterized test of specific args compared to their parsed value""" ++ args = cli_arg_parser.parse_args([f"--{arg_name}={arg_value}"]) ++ assert getattr(args, attr_name) == attr_value +diff --git a/tests/test_misc.py b/tests/test_misc.py +new file mode 100644 +index 0000000..ce7bd26 +--- /dev/null ++++ b/tests/test_misc.py +@@ -0,0 +1,104 @@ ++"""Tests that complete coverage that aren't prone to failure.""" ++import logging ++from pathlib import Path ++from typing import List ++import pytest ++import requests ++import cpp_linter ++import cpp_linter.run ++from cpp_linter import Globals, log_response_msg, get_line_cnt_from_cols ++from cpp_linter.run import ( ++ log_commander, ++ start_log_group, ++ end_log_group, ++ set_exit_code, ++ list_source_files, ++ get_list_of_changed_files, ++) ++ ++ ++def test_exit_override(): ++ """Test exit code that indicates if action encountered lining errors.""" ++ assert 1 == set_exit_code(1) ++ ++ ++def test_exit_implicit(): ++ """Test the exit code issued when a thread comment is to be made.""" ++ Globals.OUTPUT = "TEST" # fake content for a thread comment ++ assert 1 == set_exit_code() ++ ++ ++# see https://github.com/pytest-dev/pytest/issues/5997 ++def test_end_group(caplog: pytest.LogCaptureFixture): ++ """Test the output that concludes a group of runner logs.""" ++ caplog.set_level(logging.INFO, logger=log_commander.name) ++ log_commander.propagate = True ++ end_log_group() ++ messages = caplog.messages ++ assert "::endgroup::" in messages ++ ++ ++# see https://github.com/pytest-dev/pytest/issues/5997 ++def test_start_group(caplog: pytest.LogCaptureFixture): ++ """Test the output that begins a group of runner logs.""" ++ caplog.set_level(logging.INFO, logger=log_commander.name) ++ log_commander.propagate = True ++ start_log_group("TEST") ++ messages = caplog.messages ++ assert "::group::TEST" in messages ++ ++ ++@pytest.mark.parametrize( ++ "url", ++ [ ++ ("https://api.github.com/users/cpp-linter/starred"), ++ pytest.param(("https://github.com/cpp-linter/repo"), marks=pytest.mark.xfail), ++ ], ++) ++def test_response_logs(url: str): ++ """Test the log output for a requests.response buffer.""" ++ Globals.response_buffer = requests.get(url) ++ assert log_response_msg() ++ ++ ++@pytest.mark.parametrize( ++ "extensions", ++ [ ++ (["cpp", "hpp"]), ++ pytest.param(["cxx", "h"], marks=pytest.mark.xfail), ++ ], ++) ++def test_list_src_files( ++ monkeypatch: pytest.MonkeyPatch, ++ caplog: pytest.LogCaptureFixture, ++ extensions: List[str], ++): ++ """List the source files in the demo folder of this repo.""" ++ Globals.FILES = [] ++ monkeypatch.chdir(Path(__file__).parent.parent.as_posix()) ++ caplog.set_level(logging.DEBUG, logger=cpp_linter.logger.name) ++ assert list_source_files(ext_list=extensions, ignored_paths=[], not_ignored=[]) ++ ++ ++def test_get_changed_files(caplog: pytest.LogCaptureFixture): ++ """test getting a list of changed files for an event. ++ ++ This is expected to fail if a github token not supplied as an env var. ++ We don't need to supply one for this test because the tested code will ++ execute anyway. ++ """ ++ caplog.set_level(logging.DEBUG, logger=cpp_linter.logger.name) ++ cpp_linter.run.GITHUB_REPOSITORY = "cpp-linter/test-cpp-linter-action" ++ cpp_linter.run.GITHUB_SHA = "76adde5367196cd57da5bef49a4f09af6175fd3f" ++ cpp_linter.run.GITHUB_EVENT_NAME = "push" ++ get_list_of_changed_files() ++ # pylint: disable=no-member ++ assert Globals.FILES ++ # pylint: enable=no-member ++ ++ ++@pytest.mark.parametrize("line,cols,offset", [(13, 5, 144), (19, 1, 189)]) ++def test_file_offset_translation(line: int, cols: int, offset: int): ++ """Validate output from ``get_line_cnt_from_cols()``""" ++ test_file = str(Path("tests/demo/demo.cpp").resolve()) ++ assert (line, cols) == get_line_cnt_from_cols(test_file, offset) diff --git a/tests/capture_tools_output/cpp-linter/cpp-linter/test_git_lib.patch b/tests/capture_tools_output/cpp-linter/cpp-linter/test_git_lib.patch new file mode 100644 index 0000000..9cf91f0 --- /dev/null +++ b/tests/capture_tools_output/cpp-linter/cpp-linter/test_git_lib.patch @@ -0,0 +1,32 @@ +diff --git a/tests/demo/demo.cpp b/tests/demo/demo.cpp +--- a/tests/demo/demo.cpp ++++ b/tests/demo/demo.cpp +@@ -7,7 +7,7 @@ + + int main(){ + +- for (;;) break; ++ for (;;) break; + + + printf("Hello world!\n"); +diff --git a/tests/demo/demo.hpp b/tests/demo/demo.hpp +--- a/tests/demo/demo.hpp ++++ b/tests/demo/demo.hpp +@@ -8,7 +8,7 @@ class Dummy { + Dummy() :numb(0), useless("\0"){} + + public: +- void *not_useful(char *str){useless = str;} ++ void *not_useful(char *str) {useless = str;} + }; + + +diff --git a/tests/demo/.clang-format b/tests/demo/.clang-format +deleted file mode 100644 +--- a/tests/demo/.clang-format ++++ /dev/null +@@ -1,3 +0,0 @@ +---- +-Language: Cpp +-BasedOnStyle: WebKit diff --git a/tests/capture_tools_output/libvips/libvips/.clang-format b/tests/capture_tools_output/libvips/libvips/.clang-format new file mode 100644 index 0000000..7b684b5 --- /dev/null +++ b/tests/capture_tools_output/libvips/libvips/.clang-format @@ -0,0 +1,20 @@ +BasedOnStyle: GNU +AccessModifierOffset: -4 +AlignAfterOpenBracket: DontAlign +AlignEscapedNewlines: DontAlign +AlignOperands: DontAlign +AllowAllArgumentsOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Stroustrup +IndentWidth: 4 +SortIncludes: Never +SpaceAfterCStyleCast: true +SpaceBeforeParens: ControlStatements +TabWidth: 4 +UseTab: Always +# Our column limit is actually 80, but setting that results in clang-format +# making a lot of dubious hanging-indent choices; disable it and assume the +# developer will line wrap appropriately. clang-format will still check +# existing hanging indents. +ColumnLimit: 0 diff --git a/tests/capture_tools_output/libvips/libvips/.clang-tidy b/tests/capture_tools_output/libvips/libvips/.clang-tidy new file mode 100644 index 0000000..e292a3e --- /dev/null +++ b/tests/capture_tools_output/libvips/libvips/.clang-tidy @@ -0,0 +1,4 @@ +--- +# this repo doesn't use clang-tidy +# the purpose of this test is to a large diff with many changes. +Checks: '-*' diff --git a/tests/capture_tools_output/libvips/libvips/expected-result_fe82be-0.json b/tests/capture_tools_output/libvips/libvips/expected-result_fe82be-0.json new file mode 100644 index 0000000..9969e56 --- /dev/null +++ b/tests/capture_tools_output/libvips/libvips/expected-result_fe82be-0.json @@ -0,0 +1,171577 @@ +[ + { + "filename": "cplusplus/include/vips/VConnection8.h", + "line_filter": { + "diff_chunks": [ + [ + 2, + 30 + ], + [ + 36, + 132 + ], + [ + 133, + 141 + ] + ], + "lines_added": [ + [ + 5, + 21 + ], + [ + 26, + 27 + ], + [ + 39, + 40 + ], + [ + 45, + 46 + ], + [ + 50, + 51 + ], + [ + 57, + 59 + ], + [ + 63, + 65 + ], + [ + 69, + 71 + ], + [ + 75, + 77 + ], + [ + 82, + 84 + ], + [ + 86, + 87 + ], + [ + 91, + 92 + ], + [ + 97, + 98 + ], + [ + 103, + 104 + ], + [ + 108, + 109 + ], + [ + 113, + 114 + ], + [ + 116, + 118 + ], + [ + 122, + 123 + ], + [ + 128, + 129 + ], + [ + 136, + 137 + ] + ] + } + }, + { + "filename": "cplusplus/include/vips/VError8.h", + "line_filter": { + "diff_chunks": [ + [ + 2, + 33 + ], + [ + 39, + 46 + ], + [ + 49, + 78 + ] + ], + "lines_added": [ + [ + 5, + 21 + ], + [ + 26, + 27 + ], + [ + 42, + 43 + ], + [ + 52, + 53 + ], + [ + 54, + 55 + ], + [ + 58, + 59 + ], + [ + 65, + 70 + ], + [ + 74, + 75 + ] + ] + } + }, + { + "filename": "cplusplus/include/vips/VImage8.h", + "line_filter": { + "diff_chunks": [ + [ + 2, + 30 + ], + [ + 43, + 54 + ], + [ + 64, + 74 + ], + [ + 76, + 148 + ], + [ + 149, + 164 + ], + [ + 168, + 188 + ], + [ + 218, + 229 + ], + [ + 232, + 249 + ], + [ + 259, + 293 + ], + [ + 295, + 302 + ], + [ + 303, + 310 + ], + [ + 311, + 318 + ], + [ + 319, + 421 + ], + [ + 423, + 516 + ], + [ + 518, + 525 + ], + [ + 527, + 534 + ], + [ + 536, + 574 + ], + [ + 575, + 585 + ], + [ + 586, + 597 + ], + [ + 599, + 608 + ], + [ + 610, + 629 + ], + [ + 630, + 640 + ], + [ + 643, + 749 + ], + [ + 750, + 765 + ], + [ + 768, + 800 + ], + [ + 801, + 810 + ], + [ + 812, + 858 + ], + [ + 860, + 868 + ], + [ + 870, + 879 + ], + [ + 881, + 890 + ], + [ + 891, + 916 + ], + [ + 919, + 983 + ], + [ + 990, + 1012 + ], + [ + 1013, + 1020 + ], + [ + 1028, + 1059 + ], + [ + 1065, + 1078 + ], + [ + 1079, + 1089 + ], + [ + 1091, + 1100 + ], + [ + 1102, + 1262 + ], + [ + 1264, + 1274 + ], + [ + 1276, + 1286 + ], + [ + 1288, + 1883 + ], + [ + 1885, + 6045 + ] + ], + "lines_added": [ + [ + 5, + 21 + ], + [ + 26, + 27 + ], + [ + 46, + 51 + ], + [ + 67, + 68 + ], + [ + 70, + 71 + ], + [ + 79, + 80 + ], + [ + 82, + 84 + ], + [ + 86, + 92 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 109, + 111 + ], + [ + 113, + 116 + ], + [ + 117, + 119 + ], + [ + 122, + 124 + ], + [ + 126, + 129 + ], + [ + 131, + 135 + ], + [ + 137, + 142 + ], + [ + 144, + 145 + ], + [ + 152, + 154 + ], + [ + 156, + 161 + ], + [ + 171, + 173 + ], + [ + 174, + 175 + ], + [ + 180, + 182 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 235, + 236 + ], + [ + 237, + 238 + ], + [ + 240, + 241 + ], + [ + 245, + 246 + ], + [ + 262, + 263 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 275, + 276 + ], + [ + 281, + 282 + ], + [ + 284, + 285 + ], + [ + 289, + 290 + ], + [ + 298, + 299 + ], + [ + 306, + 307 + ], + [ + 314, + 315 + ], + [ + 322, + 323 + ], + [ + 326, + 327 + ], + [ + 331, + 332 + ], + [ + 337, + 338 + ], + [ + 343, + 344 + ], + [ + 349, + 350 + ], + [ + 352, + 353 + ], + [ + 355, + 356 + ], + [ + 361, + 362 + ], + [ + 368, + 369 + ], + [ + 374, + 376 + ], + [ + 381, + 383 + ], + [ + 386, + 387 + ], + [ + 392, + 393 + ], + [ + 397, + 398 + ], + [ + 400, + 401 + ], + [ + 405, + 406 + ], + [ + 407, + 408 + ], + [ + 410, + 411 + ], + [ + 417, + 418 + ], + [ + 426, + 427 + ], + [ + 429, + 430 + ], + [ + 435, + 436 + ], + [ + 438, + 439 + ], + [ + 444, + 445 + ], + [ + 447, + 448 + ], + [ + 453, + 454 + ], + [ + 456, + 457 + ], + [ + 462, + 463 + ], + [ + 465, + 466 + ], + [ + 471, + 472 + ], + [ + 474, + 475 + ], + [ + 481, + 482 + ], + [ + 484, + 485 + ], + [ + 491, + 492 + ], + [ + 494, + 495 + ], + [ + 500, + 501 + ], + [ + 503, + 504 + ], + [ + 509, + 510 + ], + [ + 512, + 513 + ], + [ + 521, + 522 + ], + [ + 530, + 531 + ], + [ + 539, + 540 + ], + [ + 543, + 545 + ], + [ + 549, + 550 + ], + [ + 555, + 556 + ], + [ + 561, + 562 + ], + [ + 567, + 569 + ], + [ + 570, + 571 + ], + [ + 578, + 580 + ], + [ + 581, + 582 + ], + [ + 589, + 591 + ], + [ + 592, + 594 + ], + [ + 602, + 603 + ], + [ + 604, + 605 + ], + [ + 613, + 614 + ], + [ + 615, + 617 + ], + [ + 622, + 624 + ], + [ + 625, + 626 + ], + [ + 633, + 635 + ], + [ + 636, + 637 + ], + [ + 646, + 649 + ], + [ + 650, + 652 + ], + [ + 658, + 660 + ], + [ + 661, + 662 + ], + [ + 665, + 666 + ], + [ + 669, + 671 + ], + [ + 674, + 676 + ], + [ + 677, + 678 + ], + [ + 682, + 683 + ], + [ + 687, + 688 + ], + [ + 689, + 692 + ], + [ + 695, + 696 + ], + [ + 699, + 701 + ], + [ + 705, + 708 + ], + [ + 709, + 710 + ], + [ + 711, + 712 + ], + [ + 716, + 717 + ], + [ + 721, + 722 + ], + [ + 723, + 726 + ], + [ + 729, + 730 + ], + [ + 734, + 735 + ], + [ + 739, + 742 + ], + [ + 743, + 744 + ], + [ + 745, + 746 + ], + [ + 753, + 755 + ], + [ + 758, + 760 + ], + [ + 761, + 762 + ], + [ + 771, + 772 + ], + [ + 773, + 774 + ], + [ + 775, + 777 + ], + [ + 778, + 779 + ], + [ + 782, + 783 + ], + [ + 788, + 789 + ], + [ + 790, + 791 + ], + [ + 792, + 795 + ], + [ + 796, + 797 + ], + [ + 804, + 805 + ], + [ + 806, + 807 + ], + [ + 815, + 816 + ], + [ + 822, + 825 + ], + [ + 829, + 831 + ], + [ + 836, + 837 + ], + [ + 839, + 840 + ], + [ + 846, + 848 + ], + [ + 851, + 853 + ], + [ + 854, + 855 + ], + [ + 863, + 865 + ], + [ + 873, + 876 + ], + [ + 884, + 887 + ], + [ + 894, + 897 + ], + [ + 902, + 905 + ], + [ + 908, + 911 + ], + [ + 912, + 913 + ], + [ + 922, + 925 + ], + [ + 931, + 932 + ], + [ + 937, + 939 + ], + [ + 942, + 945 + ], + [ + 946, + 947 + ], + [ + 953, + 955 + ], + [ + 960, + 962 + ], + [ + 965, + 968 + ], + [ + 969, + 970 + ], + [ + 976, + 978 + ], + [ + 979, + 980 + ], + [ + 993, + 995 + ], + [ + 999, + 1001 + ], + [ + 1002, + 1003 + ], + [ + 1008, + 1009 + ], + [ + 1016, + 1017 + ], + [ + 1031, + 1033 + ], + [ + 1035, + 1036 + ], + [ + 1040, + 1042 + ], + [ + 1047, + 1048 + ], + [ + 1051, + 1054 + ], + [ + 1055, + 1056 + ], + [ + 1068, + 1069 + ], + [ + 1074, + 1075 + ], + [ + 1082, + 1083 + ], + [ + 1084, + 1086 + ], + [ + 1094, + 1095 + ], + [ + 1096, + 1097 + ], + [ + 1105, + 1106 + ], + [ + 1107, + 1108 + ], + [ + 1111, + 1112 + ], + [ + 1113, + 1114 + ], + [ + 1118, + 1119 + ], + [ + 1125, + 1126 + ], + [ + 1127, + 1128 + ], + [ + 1131, + 1132 + ], + [ + 1135, + 1136 + ], + [ + 1137, + 1138 + ], + [ + 1143, + 1145 + ], + [ + 1149, + 1150 + ], + [ + 1154, + 1155 + ], + [ + 1159, + 1161 + ], + [ + 1162, + 1163 + ], + [ + 1168, + 1170 + ], + [ + 1171, + 1172 + ], + [ + 1177, + 1179 + ], + [ + 1180, + 1181 + ], + [ + 1186, + 1188 + ], + [ + 1189, + 1190 + ], + [ + 1195, + 1197 + ], + [ + 1198, + 1199 + ], + [ + 1203, + 1204 + ], + [ + 1206, + 1208 + ], + [ + 1209, + 1211 + ], + [ + 1215, + 1216 + ], + [ + 1218, + 1220 + ], + [ + 1221, + 1223 + ], + [ + 1228, + 1230 + ], + [ + 1231, + 1232 + ], + [ + 1237, + 1239 + ], + [ + 1240, + 1241 + ], + [ + 1246, + 1248 + ], + [ + 1249, + 1250 + ], + [ + 1255, + 1257 + ], + [ + 1258, + 1259 + ], + [ + 1267, + 1269 + ], + [ + 1270, + 1271 + ], + [ + 1279, + 1281 + ], + [ + 1282, + 1283 + ], + [ + 1291, + 1293 + ], + [ + 1294, + 1295 + ], + [ + 1300, + 1302 + ], + [ + 1303, + 1304 + ], + [ + 1309, + 1311 + ], + [ + 1312, + 1313 + ], + [ + 1318, + 1320 + ], + [ + 1321, + 1322 + ], + [ + 1327, + 1329 + ], + [ + 1330, + 1331 + ], + [ + 1336, + 1338 + ], + [ + 1339, + 1340 + ], + [ + 1345, + 1347 + ], + [ + 1348, + 1349 + ], + [ + 1354, + 1356 + ], + [ + 1357, + 1358 + ], + [ + 1363, + 1365 + ], + [ + 1366, + 1367 + ], + [ + 1372, + 1374 + ], + [ + 1375, + 1376 + ], + [ + 1381, + 1383 + ], + [ + 1384, + 1385 + ], + [ + 1390, + 1392 + ], + [ + 1393, + 1394 + ], + [ + 1399, + 1401 + ], + [ + 1402, + 1403 + ], + [ + 1408, + 1410 + ], + [ + 1411, + 1412 + ], + [ + 1417, + 1419 + ], + [ + 1420, + 1421 + ], + [ + 1426, + 1428 + ], + [ + 1429, + 1430 + ], + [ + 1435, + 1437 + ], + [ + 1438, + 1439 + ], + [ + 1444, + 1446 + ], + [ + 1447, + 1448 + ], + [ + 1451, + 1452 + ], + [ + 1453, + 1455 + ], + [ + 1456, + 1457 + ], + [ + 1460, + 1461 + ], + [ + 1462, + 1464 + ], + [ + 1465, + 1466 + ], + [ + 1471, + 1473 + ], + [ + 1474, + 1475 + ], + [ + 1480, + 1482 + ], + [ + 1483, + 1484 + ], + [ + 1489, + 1491 + ], + [ + 1492, + 1493 + ], + [ + 1498, + 1500 + ], + [ + 1501, + 1503 + ], + [ + 1508, + 1510 + ], + [ + 1511, + 1513 + ], + [ + 1518, + 1520 + ], + [ + 1521, + 1522 + ], + [ + 1527, + 1529 + ], + [ + 1530, + 1532 + ], + [ + 1537, + 1539 + ], + [ + 1540, + 1542 + ], + [ + 1543, + 1544 + ], + [ + 1547, + 1549 + ], + [ + 1550, + 1551 + ], + [ + 1556, + 1558 + ], + [ + 1559, + 1561 + ], + [ + 1566, + 1568 + ], + [ + 1569, + 1571 + ], + [ + 1577, + 1580 + ], + [ + 1581, + 1582 + ], + [ + 1588, + 1591 + ], + [ + 1592, + 1593 + ], + [ + 1599, + 1602 + ], + [ + 1603, + 1605 + ], + [ + 1611, + 1613 + ], + [ + 1614, + 1615 + ], + [ + 1621, + 1623 + ], + [ + 1624, + 1625 + ], + [ + 1631, + 1633 + ], + [ + 1634, + 1636 + ], + [ + 1640, + 1880 + ], + [ + 1888, + 1889 + ], + [ + 1892, + 1894 + ], + [ + 1895, + 1901 + ], + [ + 1902, + 1908 + ], + [ + 1909, + 1915 + ], + [ + 1916, + 1922 + ], + [ + 1923, + 1929 + ], + [ + 1930, + 1936 + ], + [ + 1937, + 1943 + ], + [ + 1944, + 1950 + ], + [ + 1951, + 1961 + ], + [ + 1962, + 1968 + ], + [ + 1969, + 1975 + ], + [ + 1976, + 1982 + ], + [ + 1983, + 1989 + ], + [ + 1990, + 1996 + ], + [ + 1997, + 2003 + ], + [ + 2004, + 2014 + ], + [ + 2015, + 2021 + ], + [ + 2022, + 2028 + ], + [ + 2029, + 2035 + ], + [ + 2036, + 2042 + ], + [ + 2043, + 2050 + ], + [ + 2051, + 2070 + ], + [ + 2071, + 2084 + ], + [ + 2085, + 2102 + ], + [ + 2103, + 2109 + ], + [ + 2110, + 2116 + ], + [ + 2117, + 2124 + ], + [ + 2125, + 2135 + ], + [ + 2136, + 2143 + ], + [ + 2144, + 2151 + ], + [ + 2152, + 2158 + ], + [ + 2159, + 2170 + ], + [ + 2171, + 2181 + ], + [ + 2182, + 2194 + ], + [ + 2195, + 2203 + ], + [ + 2204, + 2212 + ], + [ + 2213, + 2219 + ], + [ + 2220, + 2226 + ], + [ + 2227, + 2239 + ], + [ + 2240, + 2251 + ], + [ + 2252, + 2259 + ], + [ + 2260, + 2271 + ], + [ + 2272, + 2283 + ], + [ + 2284, + 2300 + ], + [ + 2301, + 2308 + ], + [ + 2309, + 2317 + ], + [ + 2318, + 2325 + ], + [ + 2326, + 2333 + ], + [ + 2334, + 2349 + ], + [ + 2350, + 2365 + ], + [ + 2366, + 2379 + ], + [ + 2380, + 2392 + ], + [ + 2393, + 2404 + ], + [ + 2405, + 2412 + ], + [ + 2413, + 2420 + ], + [ + 2421, + 2434 + ], + [ + 2435, + 2454 + ], + [ + 2455, + 2462 + ], + [ + 2463, + 2473 + ], + [ + 2474, + 2491 + ], + [ + 2492, + 2509 + ], + [ + 2510, + 2523 + ], + [ + 2524, + 2537 + ], + [ + 2538, + 2545 + ], + [ + 2546, + 2553 + ], + [ + 2554, + 2561 + ], + [ + 2562, + 2568 + ], + [ + 2569, + 2576 + ], + [ + 2577, + 2590 + ], + [ + 2591, + 2604 + ], + [ + 2605, + 2617 + ], + [ + 2618, + 2628 + ], + [ + 2629, + 2638 + ], + [ + 2639, + 2653 + ], + [ + 2654, + 2663 + ], + [ + 2664, + 2690 + ], + [ + 2691, + 2717 + ], + [ + 2718, + 2744 + ], + [ + 2745, + 2760 + ], + [ + 2761, + 2771 + ], + [ + 2772, + 2783 + ], + [ + 2784, + 2797 + ], + [ + 2798, + 2804 + ], + [ + 2805, + 2812 + ], + [ + 2813, + 2819 + ], + [ + 2820, + 2834 + ], + [ + 2835, + 2848 + ], + [ + 2849, + 2862 + ], + [ + 2863, + 2875 + ], + [ + 2876, + 2887 + ], + [ + 2888, + 2895 + ], + [ + 2896, + 2902 + ], + [ + 2903, + 2912 + ], + [ + 2913, + 2920 + ], + [ + 2921, + 2927 + ], + [ + 2928, + 2938 + ], + [ + 2939, + 2951 + ], + [ + 2952, + 2965 + ], + [ + 2966, + 2980 + ], + [ + 2981, + 2989 + ], + [ + 2990, + 3005 + ], + [ + 3006, + 3021 + ], + [ + 3022, + 3037 + ], + [ + 3038, + 3056 + ], + [ + 3057, + 3075 + ], + [ + 3076, + 3094 + ], + [ + 3095, + 3106 + ], + [ + 3107, + 3121 + ], + [ + 3122, + 3134 + ], + [ + 3135, + 3144 + ], + [ + 3145, + 3162 + ], + [ + 3163, + 3180 + ], + [ + 3181, + 3198 + ], + [ + 3199, + 3217 + ], + [ + 3218, + 3236 + ], + [ + 3237, + 3255 + ], + [ + 3256, + 3262 + ], + [ + 3263, + 3269 + ], + [ + 3270, + 3280 + ], + [ + 3281, + 3291 + ], + [ + 3292, + 3303 + ], + [ + 3304, + 3314 + ], + [ + 3315, + 3321 + ], + [ + 3322, + 3334 + ], + [ + 3335, + 3342 + ], + [ + 3343, + 3349 + ], + [ + 3350, + 3356 + ], + [ + 3357, + 3369 + ], + [ + 3370, + 3381 + ], + [ + 3382, + 3396 + ], + [ + 3397, + 3411 + ], + [ + 3412, + 3428 + ], + [ + 3429, + 3441 + ], + [ + 3442, + 3454 + ], + [ + 3455, + 3469 + ], + [ + 3470, + 3476 + ], + [ + 3477, + 3487 + ], + [ + 3488, + 3498 + ], + [ + 3499, + 3514 + ], + [ + 3515, + 3529 + ], + [ + 3530, + 3544 + ], + [ + 3545, + 3559 + ], + [ + 3560, + 3577 + ], + [ + 3578, + 3595 + ], + [ + 3596, + 3613 + ], + [ + 3614, + 3629 + ], + [ + 3630, + 3645 + ], + [ + 3646, + 3661 + ], + [ + 3662, + 3684 + ], + [ + 3685, + 3707 + ], + [ + 3708, + 3729 + ], + [ + 3730, + 3752 + ], + [ + 3753, + 3766 + ], + [ + 3767, + 3780 + ], + [ + 3781, + 3794 + ], + [ + 3795, + 3812 + ], + [ + 3813, + 3830 + ], + [ + 3831, + 3848 + ], + [ + 3849, + 3855 + ], + [ + 3856, + 3868 + ], + [ + 3869, + 3882 + ], + [ + 3883, + 3896 + ], + [ + 3897, + 3913 + ], + [ + 3914, + 3930 + ], + [ + 3931, + 3948 + ], + [ + 3949, + 3966 + ], + [ + 3967, + 3981 + ], + [ + 3982, + 3993 + ], + [ + 3994, + 4012 + ], + [ + 4013, + 4033 + ], + [ + 4034, + 4053 + ], + [ + 4054, + 4070 + ], + [ + 4071, + 4088 + ], + [ + 4089, + 4108 + ], + [ + 4109, + 4127 + ], + [ + 4128, + 4144 + ], + [ + 4145, + 4163 + ], + [ + 4164, + 4181 + ], + [ + 4182, + 4204 + ], + [ + 4205, + 4212 + ], + [ + 4213, + 4221 + ], + [ + 4222, + 4230 + ], + [ + 4231, + 4244 + ], + [ + 4245, + 4251 + ], + [ + 4252, + 4265 + ], + [ + 4266, + 4279 + ], + [ + 4280, + 4291 + ], + [ + 4292, + 4304 + ], + [ + 4305, + 4317 + ], + [ + 4318, + 4328 + ], + [ + 4329, + 4344 + ], + [ + 4345, + 4359 + ], + [ + 4360, + 4370 + ], + [ + 4371, + 4379 + ], + [ + 4380, + 4399 + ], + [ + 4400, + 4435 + ], + [ + 4436, + 4443 + ], + [ + 4444, + 4457 + ], + [ + 4458, + 4471 + ], + [ + 4472, + 4484 + ], + [ + 4485, + 4498 + ], + [ + 4499, + 4516 + ], + [ + 4517, + 4534 + ], + [ + 4535, + 4554 + ], + [ + 4555, + 4574 + ], + [ + 4575, + 4594 + ], + [ + 4595, + 4602 + ], + [ + 4603, + 4617 + ], + [ + 4618, + 4625 + ], + [ + 4626, + 4640 + ], + [ + 4641, + 4655 + ], + [ + 4656, + 4670 + ], + [ + 4671, + 4692 + ], + [ + 4693, + 4714 + ], + [ + 4715, + 4736 + ], + [ + 4737, + 4750 + ], + [ + 4751, + 4764 + ], + [ + 4765, + 4780 + ], + [ + 4781, + 4796 + ], + [ + 4797, + 4807 + ], + [ + 4808, + 4815 + ], + [ + 4816, + 4823 + ], + [ + 4824, + 4831 + ], + [ + 4832, + 4843 + ], + [ + 4844, + 4850 + ], + [ + 4851, + 4864 + ], + [ + 4865, + 4878 + ], + [ + 4879, + 4892 + ], + [ + 4893, + 4905 + ], + [ + 4906, + 4918 + ], + [ + 4919, + 4931 + ], + [ + 4932, + 4941 + ], + [ + 4942, + 4961 + ], + [ + 4962, + 4974 + ], + [ + 4975, + 4987 + ], + [ + 4988, + 4995 + ], + [ + 4996, + 5009 + ], + [ + 5010, + 5022 + ], + [ + 5023, + 5035 + ], + [ + 5036, + 5044 + ], + [ + 5045, + 5053 + ], + [ + 5054, + 5061 + ], + [ + 5062, + 5069 + ], + [ + 5070, + 5078 + ], + [ + 5079, + 5092 + ], + [ + 5093, + 5100 + ], + [ + 5101, + 5111 + ], + [ + 5112, + 5128 + ], + [ + 5129, + 5136 + ], + [ + 5137, + 5143 + ], + [ + 5144, + 5150 + ], + [ + 5151, + 5161 + ], + [ + 5162, + 5168 + ], + [ + 5169, + 5179 + ], + [ + 5180, + 5191 + ], + [ + 5192, + 5202 + ], + [ + 5203, + 5218 + ], + [ + 5219, + 5231 + ], + [ + 5232, + 5243 + ], + [ + 5244, + 5255 + ], + [ + 5256, + 5262 + ], + [ + 5263, + 5280 + ], + [ + 5281, + 5295 + ], + [ + 5296, + 5308 + ], + [ + 5309, + 5315 + ], + [ + 5316, + 5323 + ], + [ + 5324, + 5330 + ], + [ + 5331, + 5337 + ], + [ + 5338, + 5353 + ], + [ + 5354, + 5366 + ], + [ + 5367, + 5374 + ], + [ + 5375, + 5382 + ], + [ + 5383, + 5399 + ], + [ + 5400, + 5416 + ], + [ + 5417, + 5433 + ], + [ + 5434, + 5441 + ], + [ + 5442, + 5454 + ], + [ + 5455, + 5474 + ], + [ + 5475, + 5495 + ], + [ + 5496, + 5517 + ], + [ + 5518, + 5537 + ], + [ + 5538, + 5559 + ], + [ + 5560, + 5577 + ], + [ + 5578, + 5595 + ], + [ + 5596, + 5613 + ], + [ + 5614, + 5647 + ], + [ + 5648, + 5681 + ], + [ + 5682, + 5715 + ], + [ + 5716, + 5731 + ], + [ + 5732, + 5751 + ], + [ + 5752, + 5762 + ], + [ + 5763, + 5774 + ], + [ + 5775, + 5788 + ], + [ + 5789, + 5802 + ], + [ + 5803, + 5815 + ], + [ + 5816, + 5828 + ], + [ + 5829, + 5845 + ], + [ + 5846, + 5862 + ], + [ + 5863, + 5879 + ], + [ + 5880, + 5904 + ], + [ + 5905, + 5929 + ], + [ + 5930, + 5954 + ], + [ + 5955, + 5979 + ], + [ + 5980, + 5993 + ], + [ + 5994, + 6005 + ], + [ + 6006, + 6020 + ], + [ + 6021, + 6042 + ] + ] + } + }, + { + "filename": "cplusplus/include/vips/VInterpolate8.h", + "line_filter": { + "diff_chunks": [ + [ + 2, + 30 + ], + [ + 34, + 63 + ], + [ + 64, + 72 + ] + ], + "lines_added": [ + [ + 5, + 21 + ], + [ + 26, + 27 + ], + [ + 37, + 38 + ], + [ + 42, + 43 + ], + [ + 45, + 46 + ], + [ + 52, + 53 + ], + [ + 59, + 60 + ], + [ + 67, + 68 + ] + ] + } + }, + { + "filename": "cplusplus/include/vips/VRegion8.h", + "line_filter": { + "diff_chunks": [ + [ + 2, + 30 + ], + [ + 37, + 51 + ], + [ + 52, + 59 + ], + [ + 67, + 76 + ], + [ + 77, + 88 + ], + [ + 99, + 124 + ], + [ + 126, + 151 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 7, + 11 + ], + [ + 12, + 16 + ], + [ + 17, + 21 + ], + [ + 26, + 27 + ], + [ + 40, + 41 + ], + [ + 47, + 48 + ], + [ + 55, + 56 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 80, + 81 + ], + [ + 84, + 85 + ], + [ + 102, + 103 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 129, + 130 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ] + ] + } + }, + { + "filename": "examples/annotate-animated.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 28 + ], + [ + 32, + 106 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 17, + 18 + ], + [ + 20, + 21 + ], + [ + 22, + 23 + ], + [ + 24, + 25 + ], + [ + 35, + 39 + ], + [ + 42, + 47 + ], + [ + 49, + 51 + ], + [ + 54, + 58 + ], + [ + 61, + 65 + ], + [ + 66, + 67 + ], + [ + 69, + 71 + ], + [ + 76, + 78 + ], + [ + 79, + 81 + ], + [ + 82, + 86 + ], + [ + 87, + 92 + ], + [ + 93, + 95 + ], + [ + 97, + 100 + ], + [ + 102, + 103 + ], + [ + 104, + 105 + ] + ] + } + }, + { + "filename": "examples/new-from-buffer.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 8, + 55 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 11, + 13 + ], + [ + 18, + 20 + ], + [ + 21, + 23 + ], + [ + 24, + 26 + ], + [ + 27, + 28 + ], + [ + 32, + 33 + ], + [ + 34, + 38 + ], + [ + 39, + 44 + ], + [ + 45, + 47 + ], + [ + 49, + 50 + ], + [ + 53, + 54 + ] + ] + } + }, + { + "filename": "examples/progress-cancel.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 78 + ] + ], + "lines_added": [ + [ + 12, + 14 + ], + [ + 15, + 16 + ], + [ + 18, + 20 + ], + [ + 21, + 22 + ], + [ + 23, + 26 + ], + [ + 29, + 31 + ], + [ + 32, + 34 + ], + [ + 36, + 38 + ], + [ + 44, + 46 + ], + [ + 47, + 49 + ], + [ + 50, + 54 + ], + [ + 55, + 57 + ], + [ + 58, + 65 + ], + [ + 67, + 70 + ], + [ + 71, + 75 + ] + ] + } + }, + { + "filename": "examples/use-vips-func.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 44 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 14 + ], + [ + 15, + 17 + ], + [ + 18, + 20 + ], + [ + 21, + 23 + ], + [ + 24, + 25 + ], + [ + 26, + 28 + ], + [ + 29, + 30 + ], + [ + 31, + 34 + ], + [ + 35, + 36 + ], + [ + 37, + 39 + ], + [ + 40, + 43 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/abs.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 26, + 61 + ], + [ + 78, + 245 + ], + [ + 267, + 317 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 29, + 30 + ], + [ + 36, + 37 + ], + [ + 38, + 42 + ], + [ + 43, + 47 + ], + [ + 48, + 52 + ], + [ + 57, + 58 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 95 + ], + [ + 96, + 98 + ], + [ + 99, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 105 + ], + [ + 108, + 109 + ], + [ + 114, + 115 + ], + [ + 116, + 119 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 128, + 137 + ], + [ + 140, + 149 + ], + [ + 155, + 166 + ], + [ + 169, + 193 + ], + [ + 194, + 195 + ], + [ + 199, + 201 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 209, + 211 + ], + [ + 213, + 216 + ], + [ + 217, + 218 + ], + [ + 220, + 242 + ], + [ + 270, + 271 + ], + [ + 273, + 274 + ], + [ + 276, + 277 + ], + [ + 281, + 282 + ], + [ + 285, + 286 + ], + [ + 289, + 290 + ], + [ + 295, + 300 + ], + [ + 306, + 307 + ], + [ + 311, + 314 + ], + [ + 315, + 316 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/add.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 42, + 70 + ], + [ + 87, + 149 + ], + [ + 171, + 215 + ], + [ + 276, + 290 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 45, + 46 + ], + [ + 47, + 51 + ], + [ + 52, + 56 + ], + [ + 57, + 61 + ], + [ + 66, + 67 + ], + [ + 90, + 91 + ], + [ + 92, + 101 + ], + [ + 103, + 104 + ], + [ + 109, + 111 + ], + [ + 114, + 115 + ], + [ + 117, + 146 + ], + [ + 174, + 175 + ], + [ + 177, + 178 + ], + [ + 180, + 181 + ], + [ + 184, + 185 + ], + [ + 188, + 189 + ], + [ + 194, + 196 + ], + [ + 199, + 200 + ], + [ + 204, + 206 + ], + [ + 209, + 212 + ], + [ + 279, + 280 + ], + [ + 284, + 287 + ], + [ + 288, + 289 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/arithmetic.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 55, + 62 + ], + [ + 63, + 88 + ], + [ + 97, + 106 + ], + [ + 255, + 269 + ], + [ + 281, + 429 + ], + [ + 431, + 469 + ], + [ + 470, + 488 + ], + [ + 489, + 507 + ], + [ + 508, + 521 + ], + [ + 533, + 560 + ], + [ + 561, + 569 + ], + [ + 570, + 651 + ], + [ + 653, + 775 + ], + [ + 778, + 830 + ], + [ + 831, + 877 + ], + [ + 887, + 914 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 31 + ], + [ + 36, + 37 + ], + [ + 58, + 59 + ], + [ + 66, + 68 + ], + [ + 70, + 72 + ], + [ + 75, + 77 + ], + [ + 82, + 85 + ], + [ + 100, + 103 + ], + [ + 258, + 262 + ], + [ + 265, + 266 + ], + [ + 284, + 291 + ], + [ + 296, + 297 + ], + [ + 298, + 303 + ], + [ + 304, + 305 + ], + [ + 306, + 311 + ], + [ + 312, + 313 + ], + [ + 314, + 316 + ], + [ + 319, + 320 + ], + [ + 324, + 325 + ], + [ + 327, + 329 + ], + [ + 330, + 332 + ], + [ + 336, + 337 + ], + [ + 339, + 341 + ], + [ + 343, + 344 + ], + [ + 347, + 348 + ], + [ + 353, + 354 + ], + [ + 357, + 360 + ], + [ + 362, + 365 + ], + [ + 369, + 370 + ], + [ + 372, + 375 + ], + [ + 377, + 378 + ], + [ + 383, + 384 + ], + [ + 389, + 394 + ], + [ + 395, + 399 + ], + [ + 401, + 404 + ], + [ + 405, + 407 + ], + [ + 408, + 409 + ], + [ + 411, + 412 + ], + [ + 418, + 420 + ], + [ + 425, + 426 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 444, + 447 + ], + [ + 450, + 451 + ], + [ + 453, + 455 + ], + [ + 456, + 457 + ], + [ + 460, + 461 + ], + [ + 464, + 466 + ], + [ + 473, + 475 + ], + [ + 479, + 480 + ], + [ + 483, + 485 + ], + [ + 492, + 494 + ], + [ + 498, + 499 + ], + [ + 502, + 504 + ], + [ + 511, + 513 + ], + [ + 517, + 518 + ], + [ + 536, + 537 + ], + [ + 540, + 541 + ], + [ + 543, + 546 + ], + [ + 548, + 549 + ], + [ + 550, + 551 + ], + [ + 552, + 553 + ], + [ + 556, + 557 + ], + [ + 564, + 566 + ], + [ + 573, + 574 + ], + [ + 578, + 581 + ], + [ + 585, + 589 + ], + [ + 594, + 597 + ], + [ + 599, + 600 + ], + [ + 603, + 605 + ], + [ + 608, + 611 + ], + [ + 617, + 622 + ], + [ + 623, + 624 + ], + [ + 625, + 626 + ], + [ + 627, + 629 + ], + [ + 630, + 633 + ], + [ + 635, + 636 + ], + [ + 637, + 638 + ], + [ + 639, + 640 + ], + [ + 643, + 644 + ], + [ + 645, + 648 + ], + [ + 656, + 659 + ], + [ + 661, + 663 + ], + [ + 664, + 665 + ], + [ + 666, + 674 + ], + [ + 677, + 680 + ], + [ + 683, + 688 + ], + [ + 693, + 696 + ], + [ + 698, + 699 + ], + [ + 701, + 702 + ], + [ + 704, + 710 + ], + [ + 711, + 712 + ], + [ + 715, + 716 + ], + [ + 717, + 720 + ], + [ + 725, + 726 + ], + [ + 730, + 735 + ], + [ + 738, + 739 + ], + [ + 744, + 747 + ], + [ + 748, + 749 + ], + [ + 753, + 755 + ], + [ + 758, + 759 + ], + [ + 760, + 763 + ], + [ + 766, + 767 + ], + [ + 768, + 772 + ], + [ + 781, + 782 + ], + [ + 783, + 785 + ], + [ + 788, + 789 + ], + [ + 794, + 795 + ], + [ + 796, + 797 + ], + [ + 798, + 801 + ], + [ + 802, + 803 + ], + [ + 806, + 807 + ], + [ + 810, + 811 + ], + [ + 812, + 815 + ], + [ + 821, + 827 + ], + [ + 834, + 835 + ], + [ + 836, + 874 + ], + [ + 890, + 897 + ], + [ + 901, + 902 + ], + [ + 903, + 913 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/avg.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 18, + 25 + ], + [ + 38, + 66 + ], + [ + 86, + 169 + ], + [ + 171, + 259 + ], + [ + 260, + 274 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 21, + 22 + ], + [ + 41, + 42 + ], + [ + 43, + 47 + ], + [ + 48, + 57 + ], + [ + 62, + 63 + ], + [ + 89, + 90 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 100, + 102 + ], + [ + 103, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 111 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 125, + 126 + ], + [ + 132, + 133 + ], + [ + 134, + 135 + ], + [ + 139, + 146 + ], + [ + 147, + 158 + ], + [ + 162, + 164 + ], + [ + 165, + 166 + ], + [ + 174, + 175 + ], + [ + 176, + 209 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 228, + 229 + ], + [ + 235, + 238 + ], + [ + 239, + 241 + ], + [ + 244, + 245 + ], + [ + 254, + 256 + ], + [ + 263, + 264 + ], + [ + 268, + 271 + ], + [ + 272, + 273 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/binary.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 52, + 113 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 29 + ], + [ + 34, + 35 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 60, + 62 + ], + [ + 64, + 65 + ], + [ + 68, + 72 + ], + [ + 73, + 75 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 82, + 84 + ], + [ + 89, + 90 + ], + [ + 95, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 104 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/binary.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 40, + 56 + ], + [ + 63, + 73 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 43, + 53 + ], + [ + 66, + 67 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/boolean.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 22, + 29 + ], + [ + 35, + 63 + ], + [ + 87, + 234 + ], + [ + 248, + 255 + ], + [ + 256, + 299 + ], + [ + 303, + 310 + ], + [ + 312, + 325 + ], + [ + 326, + 343 + ], + [ + 352, + 369 + ], + [ + 378, + 395 + ], + [ + 404, + 421 + ], + [ + 430, + 447 + ], + [ + 456, + 473 + ], + [ + 477, + 527 + ], + [ + 529, + 554 + ], + [ + 556, + 614 + ], + [ + 622, + 633 + ], + [ + 636, + 653 + ], + [ + 665, + 683 + ], + [ + 695, + 713 + ], + [ + 725, + 743 + ], + [ + 755, + 772 + ], + [ + 784, + 801 + ], + [ + 802, + 809 + ], + [ + 813, + 837 + ], + [ + 841, + 865 + ], + [ + 869, + 893 + ], + [ + 897, + 921 + ], + [ + 925, + 949 + ], + [ + 953, + 968 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 25, + 26 + ], + [ + 38, + 39 + ], + [ + 40, + 44 + ], + [ + 45, + 49 + ], + [ + 50, + 54 + ], + [ + 59, + 60 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 104 + ], + [ + 105, + 107 + ], + [ + 108, + 109 + ], + [ + 111, + 120 + ], + [ + 121, + 130 + ], + [ + 131, + 158 + ], + [ + 160, + 171 + ], + [ + 173, + 175 + ], + [ + 178, + 179 + ], + [ + 182, + 185 + ], + [ + 187, + 189 + ], + [ + 191, + 193 + ], + [ + 197, + 202 + ], + [ + 203, + 205 + ], + [ + 206, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 214 + ], + [ + 215, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 227 + ], + [ + 229, + 231 + ], + [ + 251, + 252 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 269, + 270 + ], + [ + 274, + 275 + ], + [ + 276, + 279 + ], + [ + 280, + 283 + ], + [ + 286, + 287 + ], + [ + 291, + 293 + ], + [ + 294, + 296 + ], + [ + 306, + 307 + ], + [ + 315, + 317 + ], + [ + 320, + 322 + ], + [ + 329, + 331 + ], + [ + 335, + 338 + ], + [ + 339, + 340 + ], + [ + 355, + 356 + ], + [ + 360, + 364 + ], + [ + 365, + 366 + ], + [ + 381, + 382 + ], + [ + 386, + 390 + ], + [ + 391, + 392 + ], + [ + 407, + 408 + ], + [ + 412, + 416 + ], + [ + 417, + 418 + ], + [ + 433, + 434 + ], + [ + 438, + 442 + ], + [ + 443, + 444 + ], + [ + 459, + 460 + ], + [ + 464, + 468 + ], + [ + 469, + 470 + ], + [ + 480, + 482 + ], + [ + 484, + 485 + ], + [ + 486, + 487 + ], + [ + 489, + 492 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 499, + 509 + ], + [ + 510, + 520 + ], + [ + 522, + 524 + ], + [ + 532, + 535 + ], + [ + 537, + 539 + ], + [ + 541, + 543 + ], + [ + 545, + 547 + ], + [ + 549, + 551 + ], + [ + 559, + 560 + ], + [ + 561, + 562 + ], + [ + 563, + 564 + ], + [ + 569, + 571 + ], + [ + 575, + 576 + ], + [ + 577, + 580 + ], + [ + 581, + 584 + ], + [ + 587, + 588 + ], + [ + 592, + 594 + ], + [ + 596, + 597 + ], + [ + 600, + 601 + ], + [ + 602, + 603 + ], + [ + 605, + 607 + ], + [ + 608, + 609 + ], + [ + 610, + 611 + ], + [ + 625, + 626 + ], + [ + 627, + 630 + ], + [ + 639, + 641 + ], + [ + 645, + 648 + ], + [ + 649, + 650 + ], + [ + 668, + 670 + ], + [ + 674, + 678 + ], + [ + 679, + 680 + ], + [ + 698, + 700 + ], + [ + 704, + 708 + ], + [ + 709, + 710 + ], + [ + 728, + 730 + ], + [ + 734, + 738 + ], + [ + 739, + 740 + ], + [ + 758, + 759 + ], + [ + 763, + 767 + ], + [ + 768, + 769 + ], + [ + 787, + 788 + ], + [ + 792, + 796 + ], + [ + 797, + 798 + ], + [ + 805, + 806 + ], + [ + 816, + 818 + ], + [ + 822, + 825 + ], + [ + 826, + 827 + ], + [ + 833, + 834 + ], + [ + 844, + 845 + ], + [ + 849, + 853 + ], + [ + 854, + 855 + ], + [ + 861, + 862 + ], + [ + 872, + 873 + ], + [ + 877, + 881 + ], + [ + 882, + 883 + ], + [ + 889, + 890 + ], + [ + 900, + 901 + ], + [ + 905, + 909 + ], + [ + 910, + 911 + ], + [ + 917, + 918 + ], + [ + 928, + 929 + ], + [ + 933, + 937 + ], + [ + 938, + 939 + ], + [ + 945, + 946 + ], + [ + 956, + 957 + ], + [ + 961, + 965 + ], + [ + 966, + 967 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/complex.c", + "line_filter": { + "diff_chunks": [ + [ + 27, + 55 + ], + [ + 79, + 167 + ], + [ + 168, + 241 + ], + [ + 260, + 301 + ], + [ + 306, + 328 + ], + [ + 335, + 351 + ], + [ + 358, + 374 + ], + [ + 381, + 397 + ], + [ + 402, + 547 + ], + [ + 567, + 609 + ], + [ + 615, + 638 + ], + [ + 641, + 664 + ], + [ + 669, + 780 + ], + [ + 799, + 842 + ], + [ + 845, + 871 + ], + [ + 878, + 895 + ], + [ + 902, + 1000 + ], + [ + 1009, + 1016 + ], + [ + 1018, + 1059 + ], + [ + 1061, + 1075 + ] + ], + "lines_added": [ + [ + 30, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 46 + ], + [ + 51, + 52 + ], + [ + 82, + 95 + ], + [ + 96, + 108 + ], + [ + 109, + 111 + ], + [ + 112, + 114 + ], + [ + 115, + 117 + ], + [ + 118, + 120 + ], + [ + 121, + 123 + ], + [ + 124, + 126 + ], + [ + 127, + 129 + ], + [ + 130, + 132 + ], + [ + 133, + 135 + ], + [ + 136, + 138 + ], + [ + 139, + 142 + ], + [ + 144, + 145 + ], + [ + 147, + 148 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 159, + 160 + ], + [ + 163, + 164 + ], + [ + 171, + 173 + ], + [ + 175, + 177 + ], + [ + 178, + 179 + ], + [ + 181, + 193 + ], + [ + 194, + 217 + ], + [ + 219, + 221 + ], + [ + 224, + 225 + ], + [ + 228, + 238 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 273, + 275 + ], + [ + 278, + 279 + ], + [ + 280, + 283 + ], + [ + 284, + 286 + ], + [ + 289, + 290 + ], + [ + 294, + 296 + ], + [ + 297, + 298 + ], + [ + 309, + 311 + ], + [ + 315, + 316 + ], + [ + 320, + 323 + ], + [ + 324, + 325 + ], + [ + 338, + 339 + ], + [ + 343, + 346 + ], + [ + 347, + 348 + ], + [ + 361, + 362 + ], + [ + 366, + 369 + ], + [ + 370, + 371 + ], + [ + 384, + 385 + ], + [ + 389, + 392 + ], + [ + 393, + 394 + ], + [ + 405, + 419 + ], + [ + 420, + 434 + ], + [ + 435, + 437 + ], + [ + 438, + 440 + ], + [ + 441, + 443 + ], + [ + 444, + 446 + ], + [ + 447, + 449 + ], + [ + 450, + 452 + ], + [ + 453, + 455 + ], + [ + 456, + 458 + ], + [ + 459, + 461 + ], + [ + 462, + 464 + ], + [ + 465, + 468 + ], + [ + 470, + 471 + ], + [ + 472, + 474 + ], + [ + 476, + 477 + ], + [ + 483, + 497 + ], + [ + 500, + 528 + ], + [ + 532, + 534 + ], + [ + 537, + 538 + ], + [ + 541, + 544 + ], + [ + 570, + 571 + ], + [ + 572, + 573 + ], + [ + 574, + 575 + ], + [ + 580, + 582 + ], + [ + 585, + 586 + ], + [ + 587, + 590 + ], + [ + 591, + 594 + ], + [ + 597, + 598 + ], + [ + 602, + 604 + ], + [ + 605, + 606 + ], + [ + 618, + 620 + ], + [ + 624, + 626 + ], + [ + 630, + 633 + ], + [ + 634, + 635 + ], + [ + 644, + 645 + ], + [ + 650, + 651 + ], + [ + 655, + 659 + ], + [ + 660, + 661 + ], + [ + 672, + 673 + ], + [ + 675, + 676 + ], + [ + 680, + 684 + ], + [ + 685, + 687 + ], + [ + 688, + 689 + ], + [ + 691, + 700 + ], + [ + 701, + 712 + ], + [ + 713, + 715 + ], + [ + 716, + 718 + ], + [ + 719, + 721 + ], + [ + 722, + 724 + ], + [ + 725, + 727 + ], + [ + 728, + 730 + ], + [ + 731, + 733 + ], + [ + 734, + 736 + ], + [ + 737, + 739 + ], + [ + 740, + 742 + ], + [ + 743, + 746 + ], + [ + 748, + 749 + ], + [ + 750, + 754 + ], + [ + 755, + 759 + ], + [ + 761, + 763 + ], + [ + 766, + 767 + ], + [ + 770, + 777 + ], + [ + 802, + 803 + ], + [ + 804, + 805 + ], + [ + 806, + 807 + ], + [ + 812, + 813 + ], + [ + 817, + 819 + ], + [ + 820, + 823 + ], + [ + 824, + 827 + ], + [ + 830, + 831 + ], + [ + 835, + 837 + ], + [ + 838, + 839 + ], + [ + 848, + 849 + ], + [ + 851, + 852 + ], + [ + 857, + 859 + ], + [ + 863, + 866 + ], + [ + 867, + 868 + ], + [ + 881, + 882 + ], + [ + 886, + 890 + ], + [ + 891, + 892 + ], + [ + 905, + 906 + ], + [ + 910, + 914 + ], + [ + 915, + 916 + ], + [ + 921, + 922 + ], + [ + 924, + 925 + ], + [ + 926, + 927 + ], + [ + 929, + 935 + ], + [ + 936, + 938 + ], + [ + 939, + 940 + ], + [ + 942, + 955 + ], + [ + 957, + 959 + ], + [ + 961, + 962 + ], + [ + 965, + 966 + ], + [ + 967, + 995 + ], + [ + 996, + 997 + ], + [ + 1012, + 1013 + ], + [ + 1021, + 1022 + ], + [ + 1024, + 1025 + ], + [ + 1027, + 1029 + ], + [ + 1033, + 1035 + ], + [ + 1038, + 1039 + ], + [ + 1044, + 1046 + ], + [ + 1049, + 1052 + ], + [ + 1054, + 1056 + ], + [ + 1064, + 1065 + ], + [ + 1069, + 1072 + ], + [ + 1073, + 1074 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/deviate.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 19, + 26 + ], + [ + 35, + 63 + ], + [ + 84, + 146 + ], + [ + 147, + 175 + ], + [ + 178, + 250 + ], + [ + 253, + 262 + ], + [ + 264, + 278 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 22, + 23 + ], + [ + 38, + 39 + ], + [ + 40, + 44 + ], + [ + 45, + 54 + ], + [ + 59, + 60 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 92, + 94 + ], + [ + 99, + 102 + ], + [ + 103, + 105 + ], + [ + 107, + 110 + ], + [ + 116, + 120 + ], + [ + 123, + 126 + ], + [ + 127, + 128 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 142, + 143 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 155, + 166 + ], + [ + 168, + 170 + ], + [ + 171, + 172 + ], + [ + 181, + 182 + ], + [ + 183, + 210 + ], + [ + 216, + 217 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 230, + 231 + ], + [ + 237, + 240 + ], + [ + 241, + 243 + ], + [ + 246, + 247 + ], + [ + 256, + 259 + ], + [ + 267, + 268 + ], + [ + 272, + 275 + ], + [ + 276, + 277 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/divide.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 25, + 34 + ], + [ + 37, + 65 + ], + [ + 82, + 221 + ], + [ + 230, + 237 + ], + [ + 239, + 267 + ], + [ + 270, + 284 + ], + [ + 342, + 356 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 28, + 29 + ], + [ + 30, + 31 + ], + [ + 40, + 41 + ], + [ + 42, + 46 + ], + [ + 47, + 51 + ], + [ + 52, + 56 + ], + [ + 61, + 62 + ], + [ + 85, + 86 + ], + [ + 92, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 154 + ], + [ + 155, + 156 + ], + [ + 161, + 170 + ], + [ + 172, + 174 + ], + [ + 176, + 177 + ], + [ + 180, + 181 + ], + [ + 182, + 216 + ], + [ + 217, + 218 + ], + [ + 233, + 234 + ], + [ + 242, + 243 + ], + [ + 245, + 246 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 256, + 257 + ], + [ + 262, + 264 + ], + [ + 273, + 275 + ], + [ + 278, + 281 + ], + [ + 345, + 346 + ], + [ + 350, + 353 + ], + [ + 354, + 355 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/find_trim.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 37 + ], + [ + 64, + 77 + ], + [ + 83, + 172 + ], + [ + 174, + 239 + ], + [ + 249, + 258 + ], + [ + 261, + 290 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 28 + ], + [ + 33, + 34 + ], + [ + 67, + 68 + ], + [ + 70, + 71 + ], + [ + 73, + 74 + ], + [ + 86, + 88 + ], + [ + 89, + 90 + ], + [ + 92, + 98 + ], + [ + 100, + 101 + ], + [ + 103, + 108 + ], + [ + 113, + 118 + ], + [ + 124, + 130 + ], + [ + 132, + 133 + ], + [ + 134, + 136 + ], + [ + 139, + 146 + ], + [ + 149, + 158 + ], + [ + 160, + 163 + ], + [ + 164, + 165 + ], + [ + 168, + 169 + ], + [ + 177, + 178 + ], + [ + 180, + 181 + ], + [ + 182, + 185 + ], + [ + 186, + 187 + ], + [ + 188, + 191 + ], + [ + 192, + 194 + ], + [ + 195, + 198 + ], + [ + 199, + 201 + ], + [ + 202, + 205 + ], + [ + 206, + 208 + ], + [ + 209, + 212 + ], + [ + 213, + 215 + ], + [ + 216, + 219 + ], + [ + 220, + 222 + ], + [ + 223, + 226 + ], + [ + 227, + 229 + ], + [ + 232, + 233 + ], + [ + 235, + 236 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ], + [ + 264, + 265 + ], + [ + 268, + 269 + ], + [ + 270, + 271 + ], + [ + 277, + 279 + ], + [ + 283, + 287 + ], + [ + 288, + 289 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/getpoint.c", + "line_filter": { + "diff_chunks": [ + [ + 27, + 55 + ], + [ + 83, + 133 + ], + [ + 135, + 174 + ], + [ + 180, + 187 + ], + [ + 191, + 220 + ] + ], + "lines_added": [ + [ + 30, + 46 + ], + [ + 51, + 52 + ], + [ + 86, + 87 + ], + [ + 89, + 90 + ], + [ + 92, + 93 + ], + [ + 97, + 99 + ], + [ + 102, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 114 + ], + [ + 115, + 118 + ], + [ + 119, + 121 + ], + [ + 122, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 138, + 139 + ], + [ + 141, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 153 + ], + [ + 154, + 157 + ], + [ + 158, + 160 + ], + [ + 161, + 164 + ], + [ + 165, + 167 + ], + [ + 170, + 171 + ], + [ + 183, + 184 + ], + [ + 194, + 195 + ], + [ + 201, + 204 + ], + [ + 205, + 207 + ], + [ + 208, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hist_find.c", + "line_filter": { + "diff_chunks": [ + [ + 32, + 60 + ], + [ + 71, + 82 + ], + [ + 91, + 98 + ], + [ + 102, + 131 + ], + [ + 132, + 389 + ], + [ + 391, + 398 + ], + [ + 407, + 424 + ], + [ + 425, + 447 + ], + [ + 456, + 464 + ], + [ + 467, + 481 + ] + ], + "lines_added": [ + [ + 35, + 51 + ], + [ + 56, + 57 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 94, + 95 + ], + [ + 105, + 106 + ], + [ + 110, + 111 + ], + [ + 114, + 115 + ], + [ + 119, + 122 + ], + [ + 123, + 128 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 141, + 143 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 152, + 155 + ], + [ + 159, + 162 + ], + [ + 167, + 169 + ], + [ + 172, + 179 + ], + [ + 182, + 202 + ], + [ + 203, + 204 + ], + [ + 205, + 207 + ], + [ + 208, + 209 + ], + [ + 214, + 215 + ], + [ + 220, + 230 + ], + [ + 235, + 236 + ], + [ + 239, + 240 + ], + [ + 243, + 245 + ], + [ + 248, + 264 + ], + [ + 265, + 267 + ], + [ + 270, + 271 + ], + [ + 273, + 274 + ], + [ + 276, + 289 + ], + [ + 290, + 291 + ], + [ + 294, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 320 + ], + [ + 323, + 338 + ], + [ + 339, + 340 + ], + [ + 342, + 344 + ], + [ + 347, + 348 + ], + [ + 352, + 354 + ], + [ + 355, + 357 + ], + [ + 358, + 359 + ], + [ + 363, + 365 + ], + [ + 366, + 367 + ], + [ + 372, + 374 + ], + [ + 375, + 377 + ], + [ + 378, + 379 + ], + [ + 382, + 384 + ], + [ + 385, + 386 + ], + [ + 394, + 395 + ], + [ + 410, + 411 + ], + [ + 414, + 415 + ], + [ + 420, + 421 + ], + [ + 428, + 440 + ], + [ + 443, + 444 + ], + [ + 459, + 461 + ], + [ + 470, + 471 + ], + [ + 475, + 478 + ], + [ + 479, + 480 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hist_find_indexed.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 57, + 69 + ], + [ + 72, + 79 + ], + [ + 80, + 89 + ], + [ + 90, + 125 + ], + [ + 134, + 243 + ], + [ + 244, + 264 + ], + [ + 267, + 337 + ], + [ + 343, + 381 + ], + [ + 382, + 413 + ], + [ + 417, + 491 + ], + [ + 504, + 519 + ], + [ + 522, + 536 + ] + ], + "lines_added": [ + [ + 15, + 31 + ], + [ + 36, + 37 + ], + [ + 60, + 61 + ], + [ + 62, + 66 + ], + [ + 75, + 76 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 93, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 101 + ], + [ + 103, + 105 + ], + [ + 108, + 109 + ], + [ + 113, + 117 + ], + [ + 118, + 120 + ], + [ + 121, + 122 + ], + [ + 137, + 138 + ], + [ + 139, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 147 + ], + [ + 153, + 165 + ], + [ + 169, + 172 + ], + [ + 173, + 175 + ], + [ + 176, + 177 + ], + [ + 178, + 186 + ], + [ + 187, + 190 + ], + [ + 191, + 192 + ], + [ + 195, + 196 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 208 + ], + [ + 209, + 228 + ], + [ + 229, + 230 + ], + [ + 234, + 235 + ], + [ + 238, + 240 + ], + [ + 247, + 248 + ], + [ + 253, + 259 + ], + [ + 260, + 261 + ], + [ + 270, + 271 + ], + [ + 272, + 273 + ], + [ + 277, + 296 + ], + [ + 297, + 298 + ], + [ + 301, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 334 + ], + [ + 346, + 368 + ], + [ + 369, + 370 + ], + [ + 373, + 376 + ], + [ + 377, + 378 + ], + [ + 385, + 410 + ], + [ + 420, + 422 + ], + [ + 424, + 426 + ], + [ + 430, + 431 + ], + [ + 435, + 437 + ], + [ + 438, + 439 + ], + [ + 443, + 444 + ], + [ + 445, + 446 + ], + [ + 449, + 450 + ], + [ + 453, + 454 + ], + [ + 459, + 460 + ], + [ + 466, + 484 + ], + [ + 487, + 488 + ], + [ + 507, + 509 + ], + [ + 510, + 511 + ], + [ + 515, + 516 + ], + [ + 525, + 526 + ], + [ + 530, + 533 + ], + [ + 534, + 535 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hist_find_ndim.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 42 + ], + [ + 59, + 66 + ], + [ + 79, + 99 + ], + [ + 103, + 281 + ], + [ + 291, + 308 + ], + [ + 309, + 331 + ], + [ + 342, + 349 + ], + [ + 352, + 366 + ] + ], + "lines_added": [ + [ + 3, + 5 + ], + [ + 11, + 12 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 62, + 63 + ], + [ + 82, + 83 + ], + [ + 88, + 89 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 106, + 108 + ], + [ + 111, + 126 + ], + [ + 129, + 130 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 145, + 147 + ], + [ + 148, + 152 + ], + [ + 154, + 155 + ], + [ + 156, + 161 + ], + [ + 167, + 169 + ], + [ + 170, + 176 + ], + [ + 177, + 179 + ], + [ + 180, + 183 + ], + [ + 184, + 187 + ], + [ + 189, + 191 + ], + [ + 193, + 194 + ], + [ + 197, + 198 + ], + [ + 203, + 205 + ], + [ + 206, + 207 + ], + [ + 212, + 213 + ], + [ + 216, + 217 + ], + [ + 220, + 225 + ], + [ + 227, + 228 + ], + [ + 233, + 234 + ], + [ + 236, + 247 + ], + [ + 249, + 251 + ], + [ + 257, + 258 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 271 + ], + [ + 274, + 275 + ], + [ + 277, + 278 + ], + [ + 294, + 295 + ], + [ + 298, + 299 + ], + [ + 304, + 305 + ], + [ + 312, + 324 + ], + [ + 327, + 328 + ], + [ + 345, + 346 + ], + [ + 355, + 356 + ], + [ + 360, + 363 + ], + [ + 364, + 365 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hough.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 43, + 151 + ], + [ + 157, + 174 + ], + [ + 175, + 189 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 46, + 47 + ], + [ + 49, + 50 + ], + [ + 51, + 53 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 58, + 64 + ], + [ + 66, + 67 + ], + [ + 70, + 71 + ], + [ + 72, + 74 + ], + [ + 76, + 77 + ], + [ + 81, + 84 + ], + [ + 85, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 93 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 106, + 108 + ], + [ + 109, + 110 + ], + [ + 115, + 116 + ], + [ + 120, + 125 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 133, + 135 + ], + [ + 137, + 138 + ], + [ + 143, + 146 + ], + [ + 147, + 148 + ], + [ + 160, + 161 + ], + [ + 164, + 165 + ], + [ + 170, + 171 + ], + [ + 178, + 183 + ], + [ + 186, + 187 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hough.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 39, + 73 + ], + [ + 76, + 88 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 54 + ], + [ + 59, + 63 + ], + [ + 69, + 70 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hough_circle.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 66, + 79 + ], + [ + 87, + 178 + ], + [ + 181, + 220 + ], + [ + 223, + 263 + ], + [ + 272, + 282 + ], + [ + 292, + 306 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 69, + 70 + ], + [ + 75, + 76 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 101 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 113, + 117 + ], + [ + 123, + 125 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 132, + 133 + ], + [ + 136, + 137 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 147, + 150 + ], + [ + 151, + 152 + ], + [ + 154, + 157 + ], + [ + 158, + 160 + ], + [ + 161, + 163 + ], + [ + 169, + 172 + ], + [ + 173, + 175 + ], + [ + 184, + 185 + ], + [ + 186, + 188 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 204, + 206 + ], + [ + 208, + 209 + ], + [ + 210, + 212 + ], + [ + 216, + 217 + ], + [ + 226, + 227 + ], + [ + 232, + 252 + ], + [ + 255, + 256 + ], + [ + 257, + 260 + ], + [ + 275, + 276 + ], + [ + 278, + 279 + ], + [ + 295, + 296 + ], + [ + 300, + 303 + ], + [ + 304, + 305 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hough_line.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 49, + 56 + ], + [ + 62, + 113 + ], + [ + 115, + 134 + ], + [ + 137, + 166 + ], + [ + 178, + 203 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 52, + 53 + ], + [ + 65, + 66 + ], + [ + 68, + 69 + ], + [ + 75, + 77 + ], + [ + 80, + 82 + ], + [ + 83, + 85 + ], + [ + 86, + 87 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 118, + 119 + ], + [ + 123, + 125 + ], + [ + 130, + 131 + ], + [ + 140, + 141 + ], + [ + 146, + 159 + ], + [ + 162, + 163 + ], + [ + 181, + 183 + ], + [ + 185, + 186 + ], + [ + 192, + 193 + ], + [ + 197, + 200 + ], + [ + 201, + 202 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/invert.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 49 + ], + [ + 66, + 148 + ], + [ + 169, + 190 + ], + [ + 195, + 202 + ], + [ + 204, + 218 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 24, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 40 + ], + [ + 45, + 46 + ], + [ + 69, + 70 + ], + [ + 71, + 79 + ], + [ + 80, + 88 + ], + [ + 89, + 102 + ], + [ + 104, + 106 + ], + [ + 108, + 109 + ], + [ + 112, + 145 + ], + [ + 172, + 173 + ], + [ + 175, + 176 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 198, + 199 + ], + [ + 207, + 208 + ], + [ + 212, + 215 + ], + [ + 216, + 217 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/linear.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 17 + ], + [ + 49, + 77 + ], + [ + 113, + 126 + ], + [ + 129, + 416 + ], + [ + 433, + 500 + ], + [ + 512, + 523 + ], + [ + 526, + 543 + ], + [ + 551, + 572 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 6, + 7 + ], + [ + 13, + 14 + ], + [ + 52, + 53 + ], + [ + 54, + 58 + ], + [ + 59, + 63 + ], + [ + 64, + 68 + ], + [ + 73, + 74 + ], + [ + 116, + 117 + ], + [ + 119, + 120 + ], + [ + 121, + 123 + ], + [ + 132, + 137 + ], + [ + 139, + 141 + ], + [ + 144, + 152 + ], + [ + 157, + 158 + ], + [ + 162, + 164 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 176, + 178 + ], + [ + 182, + 183 + ], + [ + 188, + 190 + ], + [ + 191, + 193 + ], + [ + 194, + 195 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 207, + 208 + ], + [ + 210, + 212 + ], + [ + 213, + 214 + ], + [ + 218, + 229 + ], + [ + 232, + 241 + ], + [ + 242, + 251 + ], + [ + 252, + 253 + ], + [ + 254, + 267 + ], + [ + 271, + 285 + ], + [ + 288, + 300 + ], + [ + 301, + 310 + ], + [ + 311, + 312 + ], + [ + 313, + 326 + ], + [ + 330, + 332 + ], + [ + 335, + 337 + ], + [ + 341, + 373 + ], + [ + 378, + 409 + ], + [ + 436, + 437 + ], + [ + 438, + 439 + ], + [ + 440, + 441 + ], + [ + 446, + 447 + ], + [ + 451, + 452 + ], + [ + 453, + 456 + ], + [ + 457, + 459 + ], + [ + 460, + 463 + ], + [ + 464, + 466 + ], + [ + 467, + 470 + ], + [ + 471, + 473 + ], + [ + 476, + 477 + ], + [ + 481, + 483 + ], + [ + 488, + 490 + ], + [ + 491, + 492 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 515, + 516 + ], + [ + 517, + 520 + ], + [ + 529, + 531 + ], + [ + 535, + 538 + ], + [ + 539, + 540 + ], + [ + 554, + 555 + ], + [ + 561, + 562 + ], + [ + 566, + 569 + ], + [ + 570, + 571 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/math.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 29, + 57 + ], + [ + 80, + 233 + ], + [ + 252, + 292 + ], + [ + 295, + 305 + ], + [ + 307, + 323 + ], + [ + 330, + 346 + ], + [ + 353, + 369 + ], + [ + 376, + 392 + ], + [ + 399, + 415 + ], + [ + 422, + 438 + ], + [ + 445, + 461 + ], + [ + 468, + 484 + ], + [ + 491, + 507 + ], + [ + 514, + 530 + ], + [ + 537, + 553 + ], + [ + 560, + 576 + ], + [ + 583, + 599 + ], + [ + 606, + 622 + ], + [ + 629, + 645 + ], + [ + 652, + 668 + ], + [ + 675, + 689 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 32, + 33 + ], + [ + 34, + 38 + ], + [ + 39, + 43 + ], + [ + 44, + 48 + ], + [ + 53, + 54 + ], + [ + 83, + 84 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 91, + 94 + ], + [ + 95, + 97 + ], + [ + 98, + 99 + ], + [ + 101, + 109 + ], + [ + 110, + 112 + ], + [ + 113, + 115 + ], + [ + 116, + 118 + ], + [ + 119, + 121 + ], + [ + 122, + 124 + ], + [ + 125, + 127 + ], + [ + 128, + 130 + ], + [ + 131, + 133 + ], + [ + 134, + 137 + ], + [ + 139, + 140 + ], + [ + 144, + 147 + ], + [ + 148, + 151 + ], + [ + 155, + 161 + ], + [ + 164, + 165 + ], + [ + 168, + 170 + ], + [ + 172, + 174 + ], + [ + 177, + 178 + ], + [ + 181, + 230 + ], + [ + 255, + 256 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 265, + 266 + ], + [ + 270, + 271 + ], + [ + 272, + 275 + ], + [ + 276, + 278 + ], + [ + 281, + 282 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 298, + 299 + ], + [ + 300, + 302 + ], + [ + 310, + 311 + ], + [ + 315, + 318 + ], + [ + 319, + 320 + ], + [ + 333, + 334 + ], + [ + 338, + 341 + ], + [ + 342, + 343 + ], + [ + 356, + 357 + ], + [ + 361, + 364 + ], + [ + 365, + 366 + ], + [ + 379, + 380 + ], + [ + 384, + 387 + ], + [ + 388, + 389 + ], + [ + 402, + 403 + ], + [ + 407, + 410 + ], + [ + 411, + 412 + ], + [ + 425, + 426 + ], + [ + 430, + 433 + ], + [ + 434, + 435 + ], + [ + 448, + 449 + ], + [ + 453, + 456 + ], + [ + 457, + 458 + ], + [ + 471, + 472 + ], + [ + 476, + 479 + ], + [ + 480, + 481 + ], + [ + 494, + 495 + ], + [ + 499, + 502 + ], + [ + 503, + 504 + ], + [ + 517, + 518 + ], + [ + 522, + 525 + ], + [ + 526, + 527 + ], + [ + 540, + 541 + ], + [ + 545, + 548 + ], + [ + 549, + 550 + ], + [ + 563, + 564 + ], + [ + 568, + 571 + ], + [ + 572, + 573 + ], + [ + 586, + 587 + ], + [ + 591, + 594 + ], + [ + 595, + 596 + ], + [ + 609, + 610 + ], + [ + 614, + 617 + ], + [ + 618, + 619 + ], + [ + 632, + 633 + ], + [ + 637, + 640 + ], + [ + 641, + 642 + ], + [ + 655, + 656 + ], + [ + 660, + 663 + ], + [ + 664, + 665 + ], + [ + 678, + 679 + ], + [ + 683, + 686 + ], + [ + 687, + 688 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/math2.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 30, + 58 + ], + [ + 82, + 213 + ], + [ + 230, + 271 + ], + [ + 276, + 299 + ], + [ + 301, + 318 + ], + [ + 327, + 343 + ], + [ + 352, + 368 + ], + [ + 377, + 395 + ], + [ + 398, + 437 + ], + [ + 439, + 515 + ], + [ + 520, + 538 + ], + [ + 541, + 558 + ], + [ + 568, + 585 + ], + [ + 595, + 612 + ], + [ + 622, + 639 + ], + [ + 640, + 673 + ], + [ + 675, + 699 + ], + [ + 701, + 725 + ], + [ + 727, + 742 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 44 + ], + [ + 45, + 49 + ], + [ + 54, + 55 + ], + [ + 85, + 86 + ], + [ + 88, + 89 + ], + [ + 90, + 91 + ], + [ + 93, + 99 + ], + [ + 100, + 102 + ], + [ + 103, + 104 + ], + [ + 106, + 118 + ], + [ + 119, + 121 + ], + [ + 122, + 124 + ], + [ + 125, + 127 + ], + [ + 128, + 130 + ], + [ + 131, + 133 + ], + [ + 134, + 136 + ], + [ + 137, + 139 + ], + [ + 140, + 143 + ], + [ + 145, + 158 + ], + [ + 160, + 176 + ], + [ + 177, + 185 + ], + [ + 187, + 189 + ], + [ + 192, + 193 + ], + [ + 196, + 206 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 233, + 234 + ], + [ + 235, + 236 + ], + [ + 237, + 238 + ], + [ + 243, + 244 + ], + [ + 248, + 249 + ], + [ + 250, + 253 + ], + [ + 254, + 256 + ], + [ + 259, + 260 + ], + [ + 264, + 266 + ], + [ + 267, + 268 + ], + [ + 279, + 280 + ], + [ + 283, + 284 + ], + [ + 289, + 291 + ], + [ + 294, + 296 + ], + [ + 304, + 306 + ], + [ + 310, + 313 + ], + [ + 314, + 315 + ], + [ + 330, + 331 + ], + [ + 335, + 338 + ], + [ + 339, + 340 + ], + [ + 355, + 356 + ], + [ + 360, + 363 + ], + [ + 364, + 365 + ], + [ + 380, + 381 + ], + [ + 385, + 388 + ], + [ + 389, + 390 + ], + [ + 401, + 403 + ], + [ + 405, + 406 + ], + [ + 407, + 408 + ], + [ + 410, + 413 + ], + [ + 414, + 416 + ], + [ + 417, + 418 + ], + [ + 420, + 430 + ], + [ + 432, + 434 + ], + [ + 442, + 445 + ], + [ + 447, + 449 + ], + [ + 451, + 453 + ], + [ + 455, + 456 + ], + [ + 458, + 459 + ], + [ + 462, + 463 + ], + [ + 464, + 465 + ], + [ + 466, + 467 + ], + [ + 472, + 474 + ], + [ + 478, + 479 + ], + [ + 480, + 483 + ], + [ + 484, + 486 + ], + [ + 489, + 490 + ], + [ + 494, + 496 + ], + [ + 498, + 499 + ], + [ + 502, + 503 + ], + [ + 504, + 505 + ], + [ + 507, + 508 + ], + [ + 509, + 510 + ], + [ + 511, + 512 + ], + [ + 523, + 526 + ], + [ + 529, + 530 + ], + [ + 532, + 535 + ], + [ + 544, + 546 + ], + [ + 550, + 553 + ], + [ + 554, + 555 + ], + [ + 571, + 572 + ], + [ + 576, + 580 + ], + [ + 581, + 582 + ], + [ + 598, + 599 + ], + [ + 603, + 607 + ], + [ + 608, + 609 + ], + [ + 625, + 626 + ], + [ + 630, + 634 + ], + [ + 635, + 636 + ], + [ + 643, + 644 + ], + [ + 646, + 647 + ], + [ + 652, + 654 + ], + [ + 658, + 661 + ], + [ + 662, + 663 + ], + [ + 669, + 670 + ], + [ + 678, + 679 + ], + [ + 683, + 687 + ], + [ + 688, + 689 + ], + [ + 695, + 696 + ], + [ + 704, + 705 + ], + [ + 709, + 713 + ], + [ + 714, + 715 + ], + [ + 721, + 722 + ], + [ + 730, + 731 + ], + [ + 735, + 739 + ], + [ + 740, + 741 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/max.c", + "line_filter": { + "diff_chunks": [ + [ + 29, + 57 + ], + [ + 112, + 119 + ], + [ + 125, + 173 + ], + [ + 179, + 186 + ], + [ + 193, + 301 + ], + [ + 304, + 506 + ], + [ + 519, + 559 + ] + ], + "lines_added": [ + [ + 32, + 48 + ], + [ + 53, + 54 + ], + [ + 115, + 116 + ], + [ + 128, + 129 + ], + [ + 134, + 137 + ], + [ + 142, + 143 + ], + [ + 148, + 150 + ], + [ + 152, + 154 + ], + [ + 156, + 158 + ], + [ + 162, + 163 + ], + [ + 164, + 166 + ], + [ + 169, + 170 + ], + [ + 182, + 183 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 205, + 206 + ], + [ + 207, + 209 + ], + [ + 212, + 214 + ], + [ + 216, + 218 + ], + [ + 223, + 224 + ], + [ + 228, + 231 + ], + [ + 235, + 236 + ], + [ + 242, + 243 + ], + [ + 244, + 247 + ], + [ + 250, + 260 + ], + [ + 262, + 263 + ], + [ + 268, + 269 + ], + [ + 272, + 274 + ], + [ + 275, + 276 + ], + [ + 281, + 282 + ], + [ + 288, + 291 + ], + [ + 292, + 293 + ], + [ + 294, + 295 + ], + [ + 297, + 298 + ], + [ + 307, + 325 + ], + [ + 327, + 328 + ], + [ + 332, + 333 + ], + [ + 334, + 350 + ], + [ + 353, + 365 + ], + [ + 366, + 379 + ], + [ + 383, + 385 + ], + [ + 387, + 388 + ], + [ + 392, + 418 + ], + [ + 420, + 422 + ], + [ + 423, + 425 + ], + [ + 426, + 427 + ], + [ + 430, + 431 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 444, + 445 + ], + [ + 451, + 454 + ], + [ + 455, + 457 + ], + [ + 458, + 461 + ], + [ + 462, + 464 + ], + [ + 465, + 468 + ], + [ + 469, + 471 + ], + [ + 472, + 475 + ], + [ + 476, + 478 + ], + [ + 479, + 482 + ], + [ + 483, + 485 + ], + [ + 486, + 489 + ], + [ + 490, + 492 + ], + [ + 493, + 496 + ], + [ + 497, + 499 + ], + [ + 502, + 503 + ], + [ + 522, + 523 + ], + [ + 524, + 527 + ], + [ + 529, + 532 + ], + [ + 537, + 538 + ], + [ + 541, + 542 + ], + [ + 548, + 549 + ], + [ + 553, + 556 + ], + [ + 557, + 558 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/measure.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 27, + 55 + ], + [ + 85, + 97 + ], + [ + 101, + 126 + ], + [ + 131, + 185 + ], + [ + 187, + 254 + ], + [ + 268, + 279 + ], + [ + 281, + 295 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 30, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 46 + ], + [ + 51, + 52 + ], + [ + 88, + 89 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 104, + 106 + ], + [ + 107, + 110 + ], + [ + 111, + 112 + ], + [ + 113, + 116 + ], + [ + 119, + 123 + ], + [ + 134, + 136 + ], + [ + 141, + 144 + ], + [ + 147, + 159 + ], + [ + 162, + 168 + ], + [ + 169, + 170 + ], + [ + 171, + 173 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 190, + 192 + ], + [ + 194, + 197 + ], + [ + 198, + 199 + ], + [ + 200, + 205 + ], + [ + 206, + 209 + ], + [ + 210, + 212 + ], + [ + 213, + 216 + ], + [ + 217, + 219 + ], + [ + 220, + 223 + ], + [ + 224, + 226 + ], + [ + 227, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 237 + ], + [ + 238, + 240 + ], + [ + 241, + 244 + ], + [ + 245, + 247 + ], + [ + 250, + 251 + ], + [ + 271, + 272 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 284, + 285 + ], + [ + 289, + 292 + ], + [ + 293, + 294 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/min.c", + "line_filter": { + "diff_chunks": [ + [ + 29, + 57 + ], + [ + 112, + 119 + ], + [ + 125, + 173 + ], + [ + 179, + 186 + ], + [ + 193, + 301 + ], + [ + 304, + 506 + ], + [ + 519, + 560 + ] + ], + "lines_added": [ + [ + 32, + 48 + ], + [ + 53, + 54 + ], + [ + 115, + 116 + ], + [ + 128, + 129 + ], + [ + 134, + 137 + ], + [ + 142, + 143 + ], + [ + 148, + 150 + ], + [ + 152, + 154 + ], + [ + 156, + 158 + ], + [ + 162, + 163 + ], + [ + 164, + 166 + ], + [ + 169, + 170 + ], + [ + 182, + 183 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 205, + 206 + ], + [ + 207, + 209 + ], + [ + 212, + 214 + ], + [ + 216, + 218 + ], + [ + 223, + 224 + ], + [ + 228, + 231 + ], + [ + 235, + 236 + ], + [ + 242, + 243 + ], + [ + 244, + 247 + ], + [ + 250, + 252 + ], + [ + 253, + 260 + ], + [ + 262, + 263 + ], + [ + 268, + 269 + ], + [ + 272, + 274 + ], + [ + 275, + 276 + ], + [ + 281, + 282 + ], + [ + 288, + 291 + ], + [ + 292, + 293 + ], + [ + 294, + 295 + ], + [ + 297, + 298 + ], + [ + 307, + 325 + ], + [ + 327, + 328 + ], + [ + 332, + 333 + ], + [ + 334, + 350 + ], + [ + 353, + 365 + ], + [ + 366, + 379 + ], + [ + 383, + 385 + ], + [ + 387, + 388 + ], + [ + 392, + 418 + ], + [ + 420, + 422 + ], + [ + 423, + 425 + ], + [ + 426, + 427 + ], + [ + 430, + 431 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 444, + 445 + ], + [ + 451, + 454 + ], + [ + 455, + 457 + ], + [ + 458, + 461 + ], + [ + 462, + 464 + ], + [ + 465, + 468 + ], + [ + 469, + 471 + ], + [ + 472, + 475 + ], + [ + 476, + 478 + ], + [ + 479, + 482 + ], + [ + 483, + 485 + ], + [ + 486, + 489 + ], + [ + 490, + 492 + ], + [ + 493, + 496 + ], + [ + 497, + 499 + ], + [ + 502, + 503 + ], + [ + 522, + 523 + ], + [ + 524, + 527 + ], + [ + 529, + 532 + ], + [ + 538, + 539 + ], + [ + 542, + 543 + ], + [ + 549, + 550 + ], + [ + 554, + 557 + ], + [ + 558, + 559 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/multiply.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 31, + 59 + ], + [ + 76, + 168 + ], + [ + 177, + 184 + ], + [ + 186, + 207 + ], + [ + 211, + 230 + ], + [ + 288, + 302 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 34, + 35 + ], + [ + 36, + 40 + ], + [ + 41, + 45 + ], + [ + 46, + 50 + ], + [ + 55, + 56 + ], + [ + 79, + 80 + ], + [ + 83, + 104 + ], + [ + 107, + 116 + ], + [ + 118, + 120 + ], + [ + 122, + 123 + ], + [ + 126, + 127 + ], + [ + 128, + 163 + ], + [ + 164, + 165 + ], + [ + 180, + 181 + ], + [ + 189, + 190 + ], + [ + 192, + 193 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 203, + 204 + ], + [ + 214, + 215 + ], + [ + 219, + 221 + ], + [ + 224, + 227 + ], + [ + 291, + 292 + ], + [ + 296, + 299 + ], + [ + 300, + 301 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/nary.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 48, + 99 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 51, + 52 + ], + [ + 54, + 55 + ], + [ + 56, + 58 + ], + [ + 59, + 60 + ], + [ + 64, + 66 + ], + [ + 67, + 68 + ], + [ + 71, + 72 + ], + [ + 73, + 75 + ], + [ + 80, + 81 + ], + [ + 86, + 89 + ], + [ + 90, + 92 + ], + [ + 95, + 96 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/nary.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 40, + 56 + ], + [ + 62, + 72 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 43, + 53 + ], + [ + 65, + 66 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/parithmetic.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 39, + 62 + ], + [ + 104, + 123 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 42, + 54 + ], + [ + 57, + 59 + ], + [ + 107, + 108 + ], + [ + 109, + 117 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/profile.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 16, + 44 + ], + [ + 76, + 318 + ], + [ + 322, + 331 + ], + [ + 332, + 346 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 35 + ], + [ + 40, + 41 + ], + [ + 79, + 81 + ], + [ + 86, + 87 + ], + [ + 89, + 90 + ], + [ + 91, + 93 + ], + [ + 95, + 111 + ], + [ + 114, + 115 + ], + [ + 116, + 118 + ], + [ + 122, + 125 + ], + [ + 126, + 127 + ], + [ + 129, + 130 + ], + [ + 134, + 136 + ], + [ + 139, + 144 + ], + [ + 145, + 146 + ], + [ + 148, + 149 + ], + [ + 151, + 159 + ], + [ + 160, + 161 + ], + [ + 163, + 164 + ], + [ + 166, + 167 + ], + [ + 172, + 174 + ], + [ + 175, + 176 + ], + [ + 180, + 181 + ], + [ + 184, + 199 + ], + [ + 200, + 203 + ], + [ + 204, + 205 + ], + [ + 209, + 211 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 242, + 243 + ], + [ + 246, + 247 + ], + [ + 253, + 254 + ], + [ + 259, + 260 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 268, + 270 + ], + [ + 271, + 273 + ], + [ + 276, + 278 + ], + [ + 279, + 280 + ], + [ + 283, + 284 + ], + [ + 287, + 288 + ], + [ + 293, + 294 + ], + [ + 300, + 311 + ], + [ + 314, + 315 + ], + [ + 325, + 328 + ], + [ + 335, + 336 + ], + [ + 340, + 343 + ], + [ + 344, + 345 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/project.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 70, + 84 + ], + [ + 92, + 277 + ], + [ + 279, + 302 + ], + [ + 304, + 349 + ], + [ + 364, + 378 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 73, + 75 + ], + [ + 80, + 81 + ], + [ + 95, + 96 + ], + [ + 97, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 111 + ], + [ + 112, + 114 + ], + [ + 115, + 116 + ], + [ + 119, + 120 + ], + [ + 121, + 123 + ], + [ + 127, + 130 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 139, + 141 + ], + [ + 144, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 158, + 166 + ], + [ + 167, + 168 + ], + [ + 173, + 174 + ], + [ + 179, + 181 + ], + [ + 182, + 183 + ], + [ + 187, + 203 + ], + [ + 204, + 205 + ], + [ + 209, + 211 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 242, + 243 + ], + [ + 246, + 247 + ], + [ + 253, + 254 + ], + [ + 256, + 266 + ], + [ + 270, + 271 + ], + [ + 273, + 274 + ], + [ + 282, + 283 + ], + [ + 284, + 287 + ], + [ + 290, + 293 + ], + [ + 296, + 299 + ], + [ + 307, + 309 + ], + [ + 310, + 311 + ], + [ + 314, + 315 + ], + [ + 318, + 319 + ], + [ + 324, + 325 + ], + [ + 331, + 342 + ], + [ + 345, + 346 + ], + [ + 367, + 368 + ], + [ + 372, + 375 + ], + [ + 376, + 377 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/relational.c", + "line_filter": { + "diff_chunks": [ + [ + 29, + 64 + ], + [ + 87, + 170 + ], + [ + 174, + 205 + ], + [ + 225, + 268 + ], + [ + 272, + 316 + ], + [ + 325, + 342 + ], + [ + 351, + 368 + ], + [ + 377, + 394 + ], + [ + 403, + 420 + ], + [ + 429, + 446 + ], + [ + 455, + 472 + ], + [ + 476, + 586 + ], + [ + 589, + 647 + ], + [ + 655, + 666 + ], + [ + 669, + 686 + ], + [ + 696, + 713 + ], + [ + 723, + 741 + ], + [ + 751, + 768 + ], + [ + 778, + 795 + ], + [ + 805, + 822 + ], + [ + 832, + 849 + ], + [ + 850, + 857 + ], + [ + 861, + 885 + ], + [ + 887, + 911 + ], + [ + 913, + 937 + ], + [ + 939, + 963 + ], + [ + 965, + 989 + ], + [ + 991, + 1015 + ], + [ + 1017, + 1032 + ] + ], + "lines_added": [ + [ + 32, + 33 + ], + [ + 39, + 40 + ], + [ + 41, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 55 + ], + [ + 60, + 61 + ], + [ + 90, + 91 + ], + [ + 92, + 101 + ], + [ + 102, + 115 + ], + [ + 116, + 149 + ], + [ + 151, + 152 + ], + [ + 153, + 159 + ], + [ + 161, + 163 + ], + [ + 166, + 167 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 187, + 190 + ], + [ + 193, + 194 + ], + [ + 196, + 198 + ], + [ + 200, + 202 + ], + [ + 228, + 229 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 238, + 239 + ], + [ + 242, + 244 + ], + [ + 245, + 248 + ], + [ + 249, + 252 + ], + [ + 255, + 256 + ], + [ + 260, + 262 + ], + [ + 263, + 265 + ], + [ + 275, + 276 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 284, + 286 + ], + [ + 289, + 291 + ], + [ + 294, + 296 + ], + [ + 302, + 304 + ], + [ + 308, + 311 + ], + [ + 312, + 313 + ], + [ + 328, + 329 + ], + [ + 333, + 337 + ], + [ + 338, + 339 + ], + [ + 354, + 355 + ], + [ + 359, + 363 + ], + [ + 364, + 365 + ], + [ + 380, + 381 + ], + [ + 385, + 389 + ], + [ + 390, + 391 + ], + [ + 406, + 407 + ], + [ + 411, + 415 + ], + [ + 416, + 417 + ], + [ + 432, + 433 + ], + [ + 437, + 441 + ], + [ + 442, + 443 + ], + [ + 458, + 459 + ], + [ + 463, + 467 + ], + [ + 468, + 469 + ], + [ + 479, + 491 + ], + [ + 492, + 501 + ], + [ + 502, + 515 + ], + [ + 516, + 517 + ], + [ + 519, + 521 + ], + [ + 527, + 528 + ], + [ + 531, + 532 + ], + [ + 533, + 535 + ], + [ + 537, + 538 + ], + [ + 542, + 544 + ], + [ + 546, + 547 + ], + [ + 551, + 553 + ], + [ + 555, + 556 + ], + [ + 560, + 562 + ], + [ + 564, + 565 + ], + [ + 569, + 571 + ], + [ + 573, + 574 + ], + [ + 578, + 580 + ], + [ + 582, + 583 + ], + [ + 592, + 593 + ], + [ + 594, + 595 + ], + [ + 596, + 597 + ], + [ + 602, + 604 + ], + [ + 607, + 609 + ], + [ + 610, + 613 + ], + [ + 614, + 617 + ], + [ + 620, + 621 + ], + [ + 625, + 627 + ], + [ + 629, + 630 + ], + [ + 633, + 634 + ], + [ + 635, + 636 + ], + [ + 638, + 640 + ], + [ + 641, + 642 + ], + [ + 643, + 644 + ], + [ + 658, + 659 + ], + [ + 660, + 663 + ], + [ + 672, + 674 + ], + [ + 678, + 681 + ], + [ + 682, + 683 + ], + [ + 699, + 700 + ], + [ + 704, + 708 + ], + [ + 709, + 710 + ], + [ + 726, + 728 + ], + [ + 732, + 736 + ], + [ + 737, + 738 + ], + [ + 754, + 755 + ], + [ + 759, + 763 + ], + [ + 764, + 765 + ], + [ + 781, + 782 + ], + [ + 786, + 790 + ], + [ + 791, + 792 + ], + [ + 808, + 809 + ], + [ + 813, + 817 + ], + [ + 818, + 819 + ], + [ + 835, + 836 + ], + [ + 840, + 844 + ], + [ + 845, + 846 + ], + [ + 853, + 854 + ], + [ + 864, + 866 + ], + [ + 870, + 873 + ], + [ + 874, + 875 + ], + [ + 881, + 882 + ], + [ + 890, + 891 + ], + [ + 895, + 899 + ], + [ + 900, + 901 + ], + [ + 907, + 908 + ], + [ + 916, + 917 + ], + [ + 921, + 925 + ], + [ + 926, + 927 + ], + [ + 933, + 934 + ], + [ + 942, + 943 + ], + [ + 947, + 951 + ], + [ + 952, + 953 + ], + [ + 959, + 960 + ], + [ + 968, + 969 + ], + [ + 973, + 977 + ], + [ + 978, + 979 + ], + [ + 985, + 986 + ], + [ + 994, + 995 + ], + [ + 999, + 1003 + ], + [ + 1004, + 1005 + ], + [ + 1011, + 1012 + ], + [ + 1020, + 1021 + ], + [ + 1025, + 1029 + ], + [ + 1030, + 1031 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/remainder.c", + "line_filter": { + "diff_chunks": [ + [ + 22, + 50 + ], + [ + 68, + 161 + ], + [ + 178, + 206 + ], + [ + 210, + 231 + ], + [ + 233, + 306 + ], + [ + 307, + 389 + ], + [ + 393, + 409 + ], + [ + 412, + 448 + ], + [ + 451, + 465 + ] + ], + "lines_added": [ + [ + 25, + 26 + ], + [ + 27, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 41 + ], + [ + 46, + 47 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 79, + 85 + ], + [ + 86, + 88 + ], + [ + 89, + 90 + ], + [ + 94, + 103 + ], + [ + 106, + 119 + ], + [ + 121, + 123 + ], + [ + 125, + 126 + ], + [ + 129, + 156 + ], + [ + 157, + 158 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 191, + 193 + ], + [ + 197, + 199 + ], + [ + 202, + 203 + ], + [ + 213, + 215 + ], + [ + 221, + 223 + ], + [ + 226, + 228 + ], + [ + 236, + 237 + ], + [ + 241, + 244 + ], + [ + 245, + 246 + ], + [ + 251, + 253 + ], + [ + 255, + 256 + ], + [ + 257, + 258 + ], + [ + 260, + 263 + ], + [ + 264, + 266 + ], + [ + 267, + 268 + ], + [ + 272, + 282 + ], + [ + 285, + 299 + ], + [ + 301, + 303 + ], + [ + 310, + 337 + ], + [ + 338, + 339 + ], + [ + 342, + 343 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 352, + 355 + ], + [ + 359, + 360 + ], + [ + 363, + 364 + ], + [ + 368, + 370 + ], + [ + 372, + 373 + ], + [ + 376, + 377 + ], + [ + 378, + 379 + ], + [ + 381, + 382 + ], + [ + 383, + 384 + ], + [ + 385, + 386 + ], + [ + 396, + 401 + ], + [ + 403, + 406 + ], + [ + 415, + 417 + ], + [ + 421, + 424 + ], + [ + 425, + 426 + ], + [ + 432, + 433 + ], + [ + 435, + 440 + ], + [ + 442, + 445 + ], + [ + 454, + 455 + ], + [ + 459, + 462 + ], + [ + 463, + 464 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/round.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 41 + ], + [ + 64, + 145 + ], + [ + 160, + 201 + ], + [ + 206, + 214 + ], + [ + 217, + 233 + ], + [ + 235, + 257 + ], + [ + 259, + 281 + ], + [ + 283, + 303 + ] + ], + "lines_added": [ + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 32 + ], + [ + 37, + 38 + ], + [ + 67, + 68 + ], + [ + 70, + 71 + ], + [ + 77, + 80 + ], + [ + 81, + 83 + ], + [ + 84, + 85 + ], + [ + 87, + 113 + ], + [ + 115, + 117 + ], + [ + 123, + 125 + ], + [ + 128, + 142 + ], + [ + 163, + 164 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 173, + 174 + ], + [ + 178, + 179 + ], + [ + 180, + 183 + ], + [ + 184, + 186 + ], + [ + 189, + 190 + ], + [ + 194, + 196 + ], + [ + 197, + 198 + ], + [ + 209, + 211 + ], + [ + 220, + 221 + ], + [ + 225, + 228 + ], + [ + 229, + 230 + ], + [ + 238, + 240 + ], + [ + 244, + 245 + ], + [ + 249, + 252 + ], + [ + 253, + 254 + ], + [ + 262, + 264 + ], + [ + 268, + 269 + ], + [ + 273, + 276 + ], + [ + 277, + 278 + ], + [ + 286, + 288 + ], + [ + 292, + 293 + ], + [ + 297, + 300 + ], + [ + 301, + 302 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/sign.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 55, + 146 + ], + [ + 165, + 186 + ], + [ + 199, + 213 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 29 + ], + [ + 34, + 35 + ], + [ + 58, + 83 + ], + [ + 84, + 85 + ], + [ + 86, + 103 + ], + [ + 105, + 107 + ], + [ + 108, + 110 + ], + [ + 112, + 143 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 202, + 203 + ], + [ + 207, + 210 + ], + [ + 211, + 212 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/statistic.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 54, + 177 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 29 + ], + [ + 34, + 35 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 62, + 64 + ], + [ + 65, + 66 + ], + [ + 69, + 71 + ], + [ + 72, + 74 + ], + [ + 76, + 77 + ], + [ + 81, + 83 + ], + [ + 84, + 89 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 115 + ], + [ + 117, + 120 + ], + [ + 122, + 124 + ], + [ + 127, + 129 + ], + [ + 133, + 137 + ], + [ + 140, + 146 + ], + [ + 147, + 148 + ], + [ + 151, + 152 + ], + [ + 153, + 156 + ], + [ + 161, + 162 + ], + [ + 166, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/statistic.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 65 + ], + [ + 67, + 74 + ], + [ + 77, + 84 + ], + [ + 86, + 94 + ], + [ + 95, + 102 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 58, + 62 + ], + [ + 70, + 71 + ], + [ + 80, + 81 + ], + [ + 89, + 91 + ], + [ + 98, + 99 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/stats.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 26 + ], + [ + 31, + 59 + ], + [ + 79, + 91 + ], + [ + 103, + 152 + ], + [ + 155, + 214 + ], + [ + 218, + 451 + ], + [ + 455, + 487 + ] + ], + "lines_added": [ + [ + 20, + 21 + ], + [ + 22, + 23 + ], + [ + 34, + 35 + ], + [ + 36, + 40 + ], + [ + 41, + 50 + ], + [ + 55, + 56 + ], + [ + 82, + 83 + ], + [ + 87, + 88 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 116, + 118 + ], + [ + 119, + 121 + ], + [ + 122, + 125 + ], + [ + 127, + 129 + ], + [ + 130, + 133 + ], + [ + 134, + 137 + ], + [ + 139, + 141 + ], + [ + 142, + 143 + ], + [ + 148, + 149 + ], + [ + 158, + 160 + ], + [ + 162, + 165 + ], + [ + 168, + 171 + ], + [ + 172, + 173 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 186, + 190 + ], + [ + 193, + 194 + ], + [ + 199, + 203 + ], + [ + 204, + 205 + ], + [ + 210, + 211 + ], + [ + 221, + 223 + ], + [ + 224, + 225 + ], + [ + 227, + 228 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 236, + 240 + ], + [ + 243, + 244 + ], + [ + 249, + 268 + ], + [ + 269, + 275 + ], + [ + 276, + 297 + ], + [ + 298, + 307 + ], + [ + 308, + 311 + ], + [ + 314, + 333 + ], + [ + 334, + 340 + ], + [ + 341, + 362 + ], + [ + 363, + 372 + ], + [ + 373, + 376 + ], + [ + 380, + 382 + ], + [ + 383, + 384 + ], + [ + 388, + 415 + ], + [ + 418, + 419 + ], + [ + 422, + 423 + ], + [ + 426, + 427 + ], + [ + 432, + 433 + ], + [ + 439, + 444 + ], + [ + 447, + 448 + ], + [ + 458, + 461 + ], + [ + 462, + 463 + ], + [ + 465, + 466 + ], + [ + 468, + 470 + ], + [ + 476, + 477 + ], + [ + 481, + 484 + ], + [ + 485, + 486 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/subtract.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 35, + 63 + ], + [ + 80, + 147 + ], + [ + 165, + 209 + ], + [ + 267, + 281 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 38, + 39 + ], + [ + 40, + 44 + ], + [ + 45, + 49 + ], + [ + 50, + 54 + ], + [ + 59, + 60 + ], + [ + 83, + 84 + ], + [ + 85, + 94 + ], + [ + 96, + 98 + ], + [ + 103, + 105 + ], + [ + 108, + 109 + ], + [ + 110, + 139 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 188, + 190 + ], + [ + 193, + 194 + ], + [ + 198, + 200 + ], + [ + 203, + 206 + ], + [ + 270, + 271 + ], + [ + 275, + 278 + ], + [ + 279, + 280 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/sum.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 120 + ], + [ + 140, + 175 + ], + [ + 178, + 197 + ], + [ + 255, + 269 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 70 + ], + [ + 72, + 73 + ], + [ + 75, + 76 + ], + [ + 79, + 81 + ], + [ + 85, + 86 + ], + [ + 88, + 117 + ], + [ + 143, + 144 + ], + [ + 146, + 147 + ], + [ + 149, + 150 + ], + [ + 153, + 154 + ], + [ + 157, + 158 + ], + [ + 162, + 163 + ], + [ + 164, + 165 + ], + [ + 167, + 170 + ], + [ + 171, + 172 + ], + [ + 181, + 182 + ], + [ + 187, + 188 + ], + [ + 191, + 194 + ], + [ + 258, + 259 + ], + [ + 263, + 266 + ], + [ + 267, + 268 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/unary.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 48, + 99 + ], + [ + 102, + 118 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 51, + 52 + ], + [ + 54, + 55 + ], + [ + 56, + 58 + ], + [ + 60, + 61 + ], + [ + 62, + 64 + ], + [ + 65, + 67 + ], + [ + 68, + 69 + ], + [ + 72, + 73 + ], + [ + 74, + 76 + ], + [ + 81, + 82 + ], + [ + 87, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/unary.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 54 + ], + [ + 58, + 70 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 51 + ], + [ + 61, + 62 + ], + [ + 63, + 64 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/unaryconst.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 50, + 63 + ], + [ + 64, + 81 + ], + [ + 87, + 153 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 32, + 33 + ], + [ + 53, + 54 + ], + [ + 56, + 57 + ], + [ + 58, + 60 + ], + [ + 67, + 71 + ], + [ + 73, + 78 + ], + [ + 90, + 93 + ], + [ + 99, + 106 + ], + [ + 107, + 110 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 115, + 117 + ], + [ + 122, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 131, + 132 + ], + [ + 138, + 139 + ], + [ + 141, + 144 + ], + [ + 145, + 147 + ], + [ + 150, + 151 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/unaryconst.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 76, + 86 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 79, + 80 + ] + ] + } + }, + { + "filename": "libvips/colour/CMYK2XYZ.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 58, + 132 + ], + [ + 137, + 151 + ], + [ + 164, + 190 + ], + [ + 205, + 227 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 61, + 62 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 71, + 72 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 80, + 81 + ], + [ + 82, + 84 + ], + [ + 86, + 87 + ], + [ + 88, + 94 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 109, + 110 + ], + [ + 114, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 140, + 141 + ], + [ + 147, + 148 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 177, + 179 + ], + [ + 183, + 184 + ], + [ + 185, + 187 + ], + [ + 208, + 209 + ], + [ + 210, + 211 + ], + [ + 216, + 217 + ], + [ + 221, + 224 + ], + [ + 225, + 226 + ] + ] + } + }, + { + "filename": "libvips/colour/HSV2sRGB.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 46, + 97 + ], + [ + 103, + 125 + ], + [ + 139, + 146 + ], + [ + 147, + 161 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 52, + 53 + ], + [ + 54, + 56 + ], + [ + 62, + 63 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 73, + 75 + ], + [ + 78, + 80 + ], + [ + 83, + 85 + ], + [ + 88, + 90 + ], + [ + 93, + 94 + ], + [ + 106, + 107 + ], + [ + 109, + 110 + ], + [ + 112, + 113 + ], + [ + 118, + 119 + ], + [ + 120, + 122 + ], + [ + 142, + 143 + ], + [ + 150, + 151 + ], + [ + 155, + 158 + ], + [ + 159, + 160 + ] + ] + } + }, + { + "filename": "libvips/colour/LCh2Lab.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 43 + ], + [ + 55, + 62 + ], + [ + 67, + 90 + ], + [ + 91, + 98 + ], + [ + 102, + 123 + ], + [ + 132, + 146 + ] + ], + "lines_added": [ + [ + 18, + 34 + ], + [ + 39, + 40 + ], + [ + 58, + 59 + ], + [ + 70, + 71 + ], + [ + 72, + 74 + ], + [ + 79, + 83 + ], + [ + 86, + 87 + ], + [ + 94, + 95 + ], + [ + 105, + 106 + ], + [ + 108, + 109 + ], + [ + 111, + 112 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 135, + 136 + ], + [ + 140, + 143 + ], + [ + 144, + 145 + ] + ] + } + }, + { + "filename": "libvips/colour/LCh2UCS.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 51, + 63 + ], + [ + 74, + 82 + ], + [ + 87, + 103 + ], + [ + 108, + 123 + ], + [ + 129, + 156 + ], + [ + 164, + 218 + ], + [ + 226, + 252 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 54, + 55 + ], + [ + 59, + 60 + ], + [ + 77, + 79 + ], + [ + 90, + 92 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 111, + 113 + ], + [ + 115, + 117 + ], + [ + 119, + 120 + ], + [ + 132, + 134 + ], + [ + 138, + 139 + ], + [ + 145, + 146 + ], + [ + 152, + 153 + ], + [ + 167, + 169 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 177, + 178 + ], + [ + 184, + 185 + ], + [ + 191, + 194 + ], + [ + 200, + 201 + ], + [ + 203, + 204 + ], + [ + 206, + 207 + ], + [ + 212, + 213 + ], + [ + 214, + 215 + ], + [ + 229, + 230 + ], + [ + 234, + 235 + ], + [ + 236, + 237 + ], + [ + 241, + 242 + ], + [ + 246, + 249 + ], + [ + 250, + 251 + ] + ] + } + }, + { + "filename": "libvips/colour/Lab2LCh.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 49, + 115 + ], + [ + 116, + 124 + ], + [ + 128, + 149 + ], + [ + 158, + 172 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 52, + 53 + ], + [ + 59, + 60 + ], + [ + 62, + 63 + ], + [ + 68, + 70 + ], + [ + 71, + 72 + ], + [ + 77, + 78 + ], + [ + 79, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 104, + 105 + ], + [ + 106, + 108 + ], + [ + 111, + 112 + ], + [ + 119, + 121 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 137, + 138 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 161, + 162 + ], + [ + 166, + 169 + ], + [ + 170, + 171 + ] + ] + } + }, + { + "filename": "libvips/colour/Lab2LabQ.c", + "line_filter": { + "diff_chunks": [ + [ + 35, + 63 + ], + [ + 75, + 82 + ], + [ + 83, + 121 + ], + [ + 122, + 150 + ], + [ + 168, + 182 + ] + ], + "lines_added": [ + [ + 38, + 54 + ], + [ + 59, + 60 + ], + [ + 78, + 79 + ], + [ + 86, + 87 + ], + [ + 88, + 90 + ], + [ + 93, + 94 + ], + [ + 98, + 99 + ], + [ + 100, + 114 + ], + [ + 117, + 118 + ], + [ + 125, + 126 + ], + [ + 127, + 128 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 137, + 138 + ], + [ + 143, + 144 + ], + [ + 145, + 147 + ], + [ + 171, + 172 + ], + [ + 176, + 179 + ], + [ + 180, + 181 + ] + ] + } + }, + { + "filename": "libvips/colour/Lab2LabS.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 51, + 67 + ], + [ + 71, + 93 + ], + [ + 110, + 124 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 59, + 61 + ], + [ + 63, + 64 + ], + [ + 74, + 75 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 86, + 87 + ], + [ + 88, + 90 + ], + [ + 113, + 114 + ], + [ + 118, + 121 + ], + [ + 122, + 123 + ] + ] + } + }, + { + "filename": "libvips/colour/Lab2XYZ.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 64, + 71 + ], + [ + 78, + 93 + ], + [ + 96, + 109 + ], + [ + 111, + 129 + ], + [ + 131, + 138 + ], + [ + 143, + 197 + ], + [ + 209, + 231 + ], + [ + 237, + 253 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 67, + 68 + ], + [ + 81, + 82 + ], + [ + 84, + 86 + ], + [ + 89, + 90 + ], + [ + 99, + 100 + ], + [ + 105, + 106 + ], + [ + 114, + 115 + ], + [ + 117, + 119 + ], + [ + 122, + 124 + ], + [ + 125, + 126 + ], + [ + 134, + 135 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 151, + 155 + ], + [ + 160, + 162 + ], + [ + 163, + 164 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 177, + 178 + ], + [ + 182, + 185 + ], + [ + 186, + 188 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 212, + 213 + ], + [ + 218, + 219 + ], + [ + 223, + 226 + ], + [ + 227, + 228 + ], + [ + 240, + 241 + ], + [ + 244, + 245 + ], + [ + 251, + 252 + ] + ] + } + }, + { + "filename": "libvips/colour/LabQ2Lab.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 17 + ], + [ + 22, + 50 + ], + [ + 62, + 69 + ], + [ + 72, + 109 + ], + [ + 110, + 138 + ], + [ + 154, + 168 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 25, + 26 + ], + [ + 27, + 31 + ], + [ + 32, + 41 + ], + [ + 46, + 47 + ], + [ + 65, + 66 + ], + [ + 75, + 76 + ], + [ + 77, + 79 + ], + [ + 81, + 83 + ], + [ + 86, + 87 + ], + [ + 93, + 94 + ], + [ + 99, + 100 + ], + [ + 104, + 106 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ], + [ + 119, + 120 + ], + [ + 122, + 123 + ], + [ + 125, + 126 + ], + [ + 131, + 132 + ], + [ + 133, + 135 + ], + [ + 157, + 158 + ], + [ + 162, + 165 + ], + [ + 166, + 167 + ] + ] + } + }, + { + "filename": "libvips/colour/LabQ2LabS.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 53, + 74 + ], + [ + 95, + 117 + ], + [ + 133, + 147 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 56, + 57 + ], + [ + 61, + 62 + ], + [ + 63, + 65 + ], + [ + 70, + 71 + ], + [ + 98, + 99 + ], + [ + 101, + 102 + ], + [ + 104, + 105 + ], + [ + 110, + 111 + ], + [ + 112, + 114 + ], + [ + 136, + 137 + ], + [ + 141, + 144 + ], + [ + 145, + 146 + ] + ] + } + }, + { + "filename": "libvips/colour/LabQ2sRGB.c", + "line_filter": { + "diff_chunks": [ + [ + 28, + 59 + ], + [ + 60, + 67 + ], + [ + 69, + 78 + ], + [ + 81, + 88 + ], + [ + 93, + 100 + ], + [ + 101, + 147 + ], + [ + 148, + 210 + ], + [ + 225, + 238 + ], + [ + 248, + 273 + ], + [ + 279, + 308 + ], + [ + 312, + 368 + ], + [ + 378, + 388 + ], + [ + 393, + 478 + ], + [ + 481, + 503 + ], + [ + 504, + 542 + ], + [ + 558, + 572 + ] + ], + "lines_added": [ + [ + 31, + 47 + ], + [ + 52, + 53 + ], + [ + 55, + 56 + ], + [ + 63, + 64 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 84, + 85 + ], + [ + 96, + 97 + ], + [ + 104, + 105 + ], + [ + 109, + 111 + ], + [ + 115, + 116 + ], + [ + 118, + 119 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 129, + 131 + ], + [ + 134, + 135 + ], + [ + 138, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ], + [ + 157, + 158 + ], + [ + 162, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 194, + 195 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 228, + 229 + ], + [ + 234, + 235 + ], + [ + 251, + 252 + ], + [ + 253, + 256 + ], + [ + 257, + 259 + ], + [ + 260, + 261 + ], + [ + 266, + 270 + ], + [ + 282, + 283 + ], + [ + 284, + 288 + ], + [ + 289, + 290 + ], + [ + 294, + 305 + ], + [ + 315, + 316 + ], + [ + 318, + 319 + ], + [ + 321, + 322 + ], + [ + 324, + 325 + ], + [ + 327, + 328 + ], + [ + 330, + 331 + ], + [ + 332, + 334 + ], + [ + 335, + 337 + ], + [ + 339, + 341 + ], + [ + 344, + 345 + ], + [ + 348, + 350 + ], + [ + 353, + 355 + ], + [ + 357, + 358 + ], + [ + 363, + 365 + ], + [ + 381, + 383 + ], + [ + 384, + 385 + ], + [ + 396, + 397 + ], + [ + 399, + 400 + ], + [ + 401, + 403 + ], + [ + 404, + 406 + ], + [ + 408, + 409 + ], + [ + 412, + 413 + ], + [ + 416, + 417 + ], + [ + 420, + 421 + ], + [ + 423, + 424 + ], + [ + 426, + 427 + ], + [ + 428, + 429 + ], + [ + 431, + 457 + ], + [ + 460, + 461 + ], + [ + 464, + 465 + ], + [ + 470, + 472 + ], + [ + 474, + 475 + ], + [ + 484, + 486 + ], + [ + 487, + 490 + ], + [ + 495, + 498 + ], + [ + 499, + 500 + ], + [ + 507, + 510 + ], + [ + 513, + 517 + ], + [ + 518, + 520 + ], + [ + 523, + 524 + ], + [ + 526, + 527 + ], + [ + 529, + 530 + ], + [ + 535, + 536 + ], + [ + 537, + 539 + ], + [ + 561, + 562 + ], + [ + 566, + 569 + ], + [ + 570, + 571 + ] + ] + } + }, + { + "filename": "libvips/colour/LabS2Lab.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 8, + 36 + ], + [ + 47, + 65 + ], + [ + 69, + 91 + ], + [ + 108, + 122 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 27 + ], + [ + 32, + 33 + ], + [ + 50, + 51 + ], + [ + 55, + 56 + ], + [ + 61, + 62 + ], + [ + 72, + 73 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 84, + 85 + ], + [ + 86, + 88 + ], + [ + 111, + 112 + ], + [ + 116, + 119 + ], + [ + 120, + 121 + ] + ] + } + }, + { + "filename": "libvips/colour/LabS2LabQ.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 58, + 102 + ], + [ + 118, + 140 + ], + [ + 158, + 172 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 61, + 62 + ], + [ + 66, + 67 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 86, + 87 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 127, + 128 + ], + [ + 133, + 134 + ], + [ + 135, + 137 + ], + [ + 161, + 162 + ], + [ + 166, + 169 + ], + [ + 170, + 171 + ] + ] + } + }, + { + "filename": "libvips/colour/UCS2LCh.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 43 + ], + [ + 61, + 137 + ], + [ + 145, + 182 + ], + [ + 190, + 256 + ], + [ + 262, + 283 + ], + [ + 290, + 309 + ] + ], + "lines_added": [ + [ + 18, + 34 + ], + [ + 39, + 40 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 74, + 76 + ], + [ + 77, + 78 + ], + [ + 82, + 83 + ], + [ + 85, + 86 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 98, + 100 + ], + [ + 101, + 102 + ], + [ + 106, + 107 + ], + [ + 109, + 110 + ], + [ + 114, + 115 + ], + [ + 117, + 118 + ], + [ + 122, + 125 + ], + [ + 126, + 128 + ], + [ + 130, + 131 + ], + [ + 133, + 134 + ], + [ + 148, + 150 + ], + [ + 152, + 154 + ], + [ + 155, + 157 + ], + [ + 163, + 164 + ], + [ + 170, + 172 + ], + [ + 174, + 176 + ], + [ + 177, + 179 + ], + [ + 193, + 195 + ], + [ + 201, + 202 + ], + [ + 203, + 205 + ], + [ + 206, + 208 + ], + [ + 211, + 213 + ], + [ + 217, + 218 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 236, + 237 + ], + [ + 243, + 244 + ], + [ + 250, + 253 + ], + [ + 265, + 266 + ], + [ + 268, + 269 + ], + [ + 271, + 272 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 293, + 294 + ], + [ + 298, + 299 + ], + [ + 303, + 306 + ], + [ + 307, + 308 + ] + ] + } + }, + { + "filename": "libvips/colour/XYZ2CMYK.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 60, + 133 + ], + [ + 138, + 145 + ], + [ + 147, + 154 + ], + [ + 155, + 175 + ], + [ + 177, + 203 + ], + [ + 218, + 240 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 63, + 64 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 83, + 85 + ], + [ + 87, + 88 + ], + [ + 89, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 105 + ], + [ + 110, + 111 + ], + [ + 115, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 141, + 142 + ], + [ + 150, + 151 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 168, + 172 + ], + [ + 180, + 181 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 190, + 192 + ], + [ + 196, + 197 + ], + [ + 198, + 200 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 229, + 230 + ], + [ + 234, + 237 + ], + [ + 238, + 239 + ] + ] + } + }, + { + "filename": "libvips/colour/XYZ2Lab.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 23, + 51 + ], + [ + 62, + 69 + ], + [ + 74, + 81 + ], + [ + 88, + 120 + ], + [ + 126, + 141 + ], + [ + 146, + 153 + ], + [ + 154, + 161 + ], + [ + 163, + 170 + ], + [ + 182, + 251 + ], + [ + 264, + 283 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 26, + 27 + ], + [ + 28, + 32 + ], + [ + 33, + 42 + ], + [ + 47, + 48 + ], + [ + 65, + 66 + ], + [ + 77, + 78 + ], + [ + 91, + 92 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 101, + 102 + ], + [ + 103, + 105 + ], + [ + 107, + 108 + ], + [ + 111, + 113 + ], + [ + 116, + 117 + ], + [ + 129, + 130 + ], + [ + 133, + 134 + ], + [ + 137, + 138 + ], + [ + 149, + 150 + ], + [ + 157, + 158 + ], + [ + 166, + 167 + ], + [ + 185, + 186 + ], + [ + 189, + 190 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 205, + 209 + ], + [ + 214, + 216 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 231, + 232 + ], + [ + 236, + 239 + ], + [ + 240, + 242 + ], + [ + 245, + 246 + ], + [ + 247, + 248 + ], + [ + 267, + 268 + ], + [ + 272, + 273 + ], + [ + 277, + 280 + ], + [ + 281, + 282 + ] + ] + } + }, + { + "filename": "libvips/colour/XYZ2Yxy.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 12, + 40 + ], + [ + 52, + 69 + ], + [ + 72, + 79 + ], + [ + 83, + 104 + ], + [ + 113, + 127 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 60, + 62 + ], + [ + 65, + 66 + ], + [ + 75, + 76 + ], + [ + 86, + 87 + ], + [ + 89, + 90 + ], + [ + 92, + 93 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 116, + 117 + ], + [ + 121, + 124 + ], + [ + 125, + 126 + ] + ] + } + }, + { + "filename": "libvips/colour/XYZ2scRGB.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 10, + 38 + ], + [ + 50, + 83 + ], + [ + 85, + 92 + ], + [ + 96, + 117 + ], + [ + 126, + 140 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 29 + ], + [ + 34, + 35 + ], + [ + 53, + 54 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 72, + 73 + ], + [ + 74, + 76 + ], + [ + 79, + 80 + ], + [ + 88, + 89 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 105, + 106 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 129, + 130 + ], + [ + 134, + 137 + ], + [ + 138, + 139 + ] + ] + } + }, + { + "filename": "libvips/colour/Yxy2XYZ.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 14, + 42 + ], + [ + 54, + 79 + ], + [ + 94, + 115 + ], + [ + 124, + 138 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 62, + 64 + ], + [ + 67, + 68 + ], + [ + 74, + 76 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 127, + 128 + ], + [ + 132, + 135 + ], + [ + 136, + 137 + ] + ] + } + }, + { + "filename": "libvips/colour/colour.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 53, + 61 + ], + [ + 66, + 91 + ], + [ + 97, + 110 + ], + [ + 112, + 136 + ], + [ + 138, + 157 + ], + [ + 216, + 368 + ], + [ + 370, + 425 + ], + [ + 427, + 492 + ], + [ + 496, + 511 + ], + [ + 512, + 702 + ], + [ + 707, + 752 + ], + [ + 768, + 787 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 56, + 58 + ], + [ + 69, + 72 + ], + [ + 73, + 75 + ], + [ + 80, + 82 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 100, + 102 + ], + [ + 106, + 107 + ], + [ + 115, + 116 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 126, + 127 + ], + [ + 132, + 133 + ], + [ + 141, + 144 + ], + [ + 147, + 148 + ], + [ + 152, + 154 + ], + [ + 219, + 220 + ], + [ + 226, + 228 + ], + [ + 230, + 233 + ], + [ + 237, + 243 + ], + [ + 244, + 246 + ], + [ + 247, + 248 + ], + [ + 249, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 268, + 270 + ], + [ + 272, + 273 + ], + [ + 278, + 281 + ], + [ + 283, + 285 + ], + [ + 286, + 290 + ], + [ + 291, + 294 + ], + [ + 298, + 299 + ], + [ + 301, + 303 + ], + [ + 307, + 321 + ], + [ + 324, + 325 + ], + [ + 327, + 333 + ], + [ + 339, + 343 + ], + [ + 349, + 352 + ], + [ + 353, + 358 + ], + [ + 361, + 362 + ], + [ + 363, + 365 + ], + [ + 373, + 377 + ], + [ + 379, + 384 + ], + [ + 385, + 387 + ], + [ + 392, + 393 + ], + [ + 394, + 395 + ], + [ + 398, + 399 + ], + [ + 400, + 403 + ], + [ + 408, + 409 + ], + [ + 413, + 418 + ], + [ + 421, + 422 + ], + [ + 430, + 432 + ], + [ + 434, + 435 + ], + [ + 436, + 439 + ], + [ + 442, + 446 + ], + [ + 449, + 450 + ], + [ + 452, + 453 + ], + [ + 459, + 461 + ], + [ + 462, + 463 + ], + [ + 466, + 467 + ], + [ + 468, + 470 + ], + [ + 475, + 476 + ], + [ + 478, + 483 + ], + [ + 486, + 487 + ], + [ + 488, + 489 + ], + [ + 499, + 500 + ], + [ + 502, + 503 + ], + [ + 504, + 508 + ], + [ + 515, + 516 + ], + [ + 517, + 520 + ], + [ + 523, + 527 + ], + [ + 528, + 529 + ], + [ + 531, + 534 + ], + [ + 537, + 538 + ], + [ + 540, + 544 + ], + [ + 548, + 549 + ], + [ + 552, + 554 + ], + [ + 555, + 556 + ], + [ + 559, + 560 + ], + [ + 561, + 563 + ], + [ + 568, + 569 + ], + [ + 571, + 576 + ], + [ + 579, + 580 + ], + [ + 586, + 588 + ], + [ + 590, + 591 + ], + [ + 592, + 594 + ], + [ + 599, + 600 + ], + [ + 604, + 607 + ], + [ + 610, + 613 + ], + [ + 616, + 617 + ], + [ + 620, + 625 + ], + [ + 628, + 633 + ], + [ + 638, + 642 + ], + [ + 645, + 649 + ], + [ + 652, + 654 + ], + [ + 658, + 659 + ], + [ + 663, + 665 + ], + [ + 666, + 667 + ], + [ + 670, + 671 + ], + [ + 672, + 674 + ], + [ + 679, + 680 + ], + [ + 682, + 693 + ], + [ + 696, + 697 + ], + [ + 698, + 699 + ], + [ + 710, + 711 + ], + [ + 712, + 741 + ], + [ + 742, + 745 + ], + [ + 746, + 749 + ], + [ + 771, + 773 + ], + [ + 777, + 778 + ], + [ + 783, + 786 + ] + ] + } + }, + { + "filename": "libvips/colour/colourspace.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 24 + ], + [ + 25, + 53 + ], + [ + 69, + 84 + ], + [ + 85, + 112 + ], + [ + 113, + 193 + ], + [ + 241, + 251 + ], + [ + 256, + 265 + ], + [ + 268, + 279 + ], + [ + 280, + 294 + ], + [ + 296, + 314 + ], + [ + 321, + 419 + ], + [ + 424, + 436 + ], + [ + 437, + 454 + ], + [ + 459, + 588 + ], + [ + 599, + 606 + ], + [ + 611, + 626 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 20, + 21 + ], + [ + 28, + 29 + ], + [ + 30, + 34 + ], + [ + 35, + 44 + ], + [ + 49, + 50 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 80, + 81 + ], + [ + 88, + 89 + ], + [ + 90, + 94 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 102, + 106 + ], + [ + 108, + 109 + ], + [ + 116, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 136 + ], + [ + 138, + 139 + ], + [ + 140, + 143 + ], + [ + 145, + 147 + ], + [ + 149, + 150 + ], + [ + 153, + 154 + ], + [ + 160, + 162 + ], + [ + 163, + 164 + ], + [ + 167, + 168 + ], + [ + 169, + 172 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 180, + 183 + ], + [ + 185, + 186 + ], + [ + 188, + 190 + ], + [ + 244, + 245 + ], + [ + 246, + 248 + ], + [ + 259, + 262 + ], + [ + 271, + 276 + ], + [ + 283, + 291 + ], + [ + 299, + 304 + ], + [ + 310, + 311 + ], + [ + 324, + 325 + ], + [ + 326, + 328 + ], + [ + 330, + 332 + ], + [ + 336, + 340 + ], + [ + 343, + 344 + ], + [ + 349, + 354 + ], + [ + 357, + 358 + ], + [ + 359, + 361 + ], + [ + 364, + 368 + ], + [ + 372, + 373 + ], + [ + 376, + 382 + ], + [ + 384, + 387 + ], + [ + 388, + 389 + ], + [ + 391, + 396 + ], + [ + 399, + 400 + ], + [ + 401, + 403 + ], + [ + 408, + 409 + ], + [ + 413, + 414 + ], + [ + 415, + 416 + ], + [ + 427, + 428 + ], + [ + 432, + 433 + ], + [ + 440, + 442 + ], + [ + 444, + 447 + ], + [ + 448, + 449 + ], + [ + 462, + 463 + ], + [ + 465, + 466 + ], + [ + 467, + 468 + ], + [ + 471, + 475 + ], + [ + 480, + 482 + ], + [ + 488, + 492 + ], + [ + 494, + 495 + ], + [ + 497, + 498 + ], + [ + 502, + 503 + ], + [ + 507, + 509 + ], + [ + 510, + 511 + ], + [ + 513, + 516 + ], + [ + 517, + 525 + ], + [ + 527, + 530 + ], + [ + 533, + 536 + ], + [ + 537, + 538 + ], + [ + 541, + 542 + ], + [ + 543, + 546 + ], + [ + 551, + 552 + ], + [ + 556, + 559 + ], + [ + 560, + 561 + ], + [ + 562, + 567 + ], + [ + 568, + 581 + ], + [ + 584, + 585 + ], + [ + 602, + 603 + ], + [ + 614, + 616 + ], + [ + 620, + 623 + ], + [ + 624, + 625 + ] + ] + } + }, + { + "filename": "libvips/colour/dE00.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 51, + 58 + ], + [ + 62, + 172 + ], + [ + 181, + 188 + ], + [ + 197, + 211 + ], + [ + 212, + 221 + ], + [ + 222, + 243 + ], + [ + 253, + 267 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 54, + 55 + ], + [ + 65, + 68 + ], + [ + 72, + 75 + ], + [ + 76, + 105 + ], + [ + 108, + 110 + ], + [ + 115, + 116 + ], + [ + 122, + 124 + ], + [ + 128, + 130 + ], + [ + 135, + 136 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 152 + ], + [ + 156, + 157 + ], + [ + 162, + 163 + ], + [ + 168, + 169 + ], + [ + 184, + 185 + ], + [ + 200, + 201 + ], + [ + 206, + 208 + ], + [ + 215, + 218 + ], + [ + 225, + 226 + ], + [ + 228, + 229 + ], + [ + 231, + 232 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 256, + 257 + ], + [ + 261, + 264 + ], + [ + 265, + 266 + ] + ] + } + }, + { + "filename": "libvips/colour/dE76.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 12, + 40 + ], + [ + 56, + 63 + ], + [ + 70, + 103 + ], + [ + 104, + 125 + ], + [ + 135, + 149 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 59, + 60 + ], + [ + 73, + 74 + ], + [ + 79, + 80 + ], + [ + 85, + 87 + ], + [ + 88, + 91 + ], + [ + 94, + 95 + ], + [ + 99, + 100 + ], + [ + 107, + 108 + ], + [ + 110, + 111 + ], + [ + 113, + 114 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 138, + 139 + ], + [ + 143, + 146 + ], + [ + 147, + 148 + ] + ] + } + }, + { + "filename": "libvips/colour/dECMC.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 49, + 73 + ], + [ + 79, + 86 + ], + [ + 90, + 104 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 52, + 53 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 62 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 82, + 83 + ], + [ + 93, + 94 + ], + [ + 98, + 101 + ], + [ + 102, + 103 + ] + ] + } + }, + { + "filename": "libvips/colour/float2rad.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 12, + 47 + ], + [ + 116, + 174 + ], + [ + 176, + 215 + ], + [ + 233, + 247 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 42, + 44 + ], + [ + 119, + 128 + ], + [ + 129, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 142, + 171 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 187, + 189 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 201, + 203 + ], + [ + 208, + 209 + ], + [ + 210, + 212 + ], + [ + 236, + 237 + ], + [ + 241, + 244 + ], + [ + 245, + 246 + ] + ] + } + }, + { + "filename": "libvips/colour/icc_transform.c", + "line_filter": { + "diff_chunks": [ + [ + 41, + 48 + ], + [ + 49, + 84 + ], + [ + 108, + 115 + ], + [ + 118, + 156 + ], + [ + 171, + 316 + ], + [ + 323, + 377 + ], + [ + 394, + 424 + ], + [ + 425, + 465 + ], + [ + 478, + 531 + ], + [ + 534, + 620 + ], + [ + 631, + 693 + ], + [ + 694, + 729 + ], + [ + 739, + 769 + ], + [ + 770, + 828 + ], + [ + 835, + 889 + ], + [ + 895, + 907 + ], + [ + 909, + 982 + ], + [ + 984, + 1017 + ], + [ + 1025, + 1033 + ], + [ + 1040, + 1094 + ], + [ + 1102, + 1203 + ], + [ + 1214, + 1221 + ], + [ + 1225, + 1322 + ], + [ + 1323, + 1348 + ], + [ + 1361, + 1380 + ], + [ + 1381, + 1397 + ], + [ + 1407, + 1419 + ], + [ + 1420, + 1436 + ], + [ + 1458, + 1492 + ] + ], + "lines_added": [ + [ + 44, + 45 + ], + [ + 52, + 53 + ], + [ + 54, + 58 + ], + [ + 59, + 68 + ], + [ + 73, + 74 + ], + [ + 80, + 81 + ], + [ + 111, + 112 + ], + [ + 121, + 123 + ], + [ + 129, + 130 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 140, + 152 + ], + [ + 174, + 175 + ], + [ + 180, + 181 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 190, + 193 + ], + [ + 194, + 196 + ], + [ + 199, + 201 + ], + [ + 204, + 205 + ], + [ + 210, + 211 + ], + [ + 212, + 214 + ], + [ + 219, + 223 + ], + [ + 226, + 242 + ], + [ + 245, + 246 + ], + [ + 247, + 248 + ], + [ + 249, + 252 + ], + [ + 253, + 254 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 266, + 271 + ], + [ + 273, + 284 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 290, + 294 + ], + [ + 297, + 301 + ], + [ + 305, + 306 + ], + [ + 312, + 313 + ], + [ + 326, + 335 + ], + [ + 338, + 340 + ], + [ + 343, + 346 + ], + [ + 347, + 353 + ], + [ + 355, + 356 + ], + [ + 357, + 358 + ], + [ + 359, + 365 + ], + [ + 368, + 374 + ], + [ + 397, + 399 + ], + [ + 400, + 404 + ], + [ + 407, + 409 + ], + [ + 410, + 411 + ], + [ + 414, + 415 + ], + [ + 416, + 421 + ], + [ + 428, + 429 + ], + [ + 431, + 436 + ], + [ + 437, + 439 + ], + [ + 440, + 441 + ], + [ + 446, + 447 + ], + [ + 451, + 455 + ], + [ + 456, + 457 + ], + [ + 461, + 462 + ], + [ + 481, + 487 + ], + [ + 489, + 495 + ], + [ + 498, + 502 + ], + [ + 503, + 504 + ], + [ + 505, + 508 + ], + [ + 509, + 520 + ], + [ + 521, + 525 + ], + [ + 526, + 528 + ], + [ + 537, + 539 + ], + [ + 543, + 544 + ], + [ + 546, + 550 + ], + [ + 552, + 556 + ], + [ + 559, + 560 + ], + [ + 562, + 573 + ], + [ + 577, + 578 + ], + [ + 579, + 583 + ], + [ + 585, + 591 + ], + [ + 593, + 594 + ], + [ + 596, + 597 + ], + [ + 601, + 603 + ], + [ + 604, + 605 + ], + [ + 607, + 610 + ], + [ + 613, + 614 + ], + [ + 616, + 617 + ], + [ + 634, + 636 + ], + [ + 637, + 638 + ], + [ + 644, + 649 + ], + [ + 653, + 654 + ], + [ + 655, + 661 + ], + [ + 666, + 674 + ], + [ + 677, + 681 + ], + [ + 683, + 684 + ], + [ + 687, + 688 + ], + [ + 689, + 690 + ], + [ + 697, + 698 + ], + [ + 700, + 703 + ], + [ + 704, + 706 + ], + [ + 707, + 710 + ], + [ + 711, + 713 + ], + [ + 714, + 717 + ], + [ + 718, + 720 + ], + [ + 721, + 722 + ], + [ + 725, + 726 + ], + [ + 742, + 743 + ], + [ + 745, + 746 + ], + [ + 751, + 754 + ], + [ + 755, + 756 + ], + [ + 757, + 758 + ], + [ + 759, + 760 + ], + [ + 761, + 762 + ], + [ + 764, + 766 + ], + [ + 773, + 775 + ], + [ + 778, + 781 + ], + [ + 783, + 784 + ], + [ + 786, + 788 + ], + [ + 791, + 795 + ], + [ + 796, + 799 + ], + [ + 805, + 807 + ], + [ + 810, + 814 + ], + [ + 815, + 818 + ], + [ + 823, + 825 + ], + [ + 838, + 840 + ], + [ + 841, + 842 + ], + [ + 843, + 845 + ], + [ + 846, + 847 + ], + [ + 848, + 849 + ], + [ + 854, + 855 + ], + [ + 856, + 857 + ], + [ + 858, + 859 + ], + [ + 864, + 865 + ], + [ + 869, + 875 + ], + [ + 876, + 882 + ], + [ + 885, + 886 + ], + [ + 898, + 899 + ], + [ + 901, + 902 + ], + [ + 903, + 904 + ], + [ + 912, + 913 + ], + [ + 914, + 916 + ], + [ + 917, + 918 + ], + [ + 919, + 920 + ], + [ + 921, + 922 + ], + [ + 923, + 924 + ], + [ + 926, + 929 + ], + [ + 930, + 935 + ], + [ + 938, + 943 + ], + [ + 945, + 947 + ], + [ + 948, + 949 + ], + [ + 954, + 956 + ], + [ + 959, + 960 + ], + [ + 964, + 965 + ], + [ + 966, + 967 + ], + [ + 969, + 970 + ], + [ + 971, + 972 + ], + [ + 973, + 974 + ], + [ + 975, + 976 + ], + [ + 978, + 979 + ], + [ + 987, + 988 + ], + [ + 991, + 993 + ], + [ + 996, + 997 + ], + [ + 1001, + 1002 + ], + [ + 1003, + 1004 + ], + [ + 1006, + 1007 + ], + [ + 1008, + 1009 + ], + [ + 1011, + 1012 + ], + [ + 1013, + 1014 + ], + [ + 1028, + 1030 + ], + [ + 1043, + 1045 + ], + [ + 1046, + 1048 + ], + [ + 1049, + 1050 + ], + [ + 1051, + 1052 + ], + [ + 1054, + 1055 + ], + [ + 1059, + 1060 + ], + [ + 1061, + 1062 + ], + [ + 1063, + 1064 + ], + [ + 1069, + 1070 + ], + [ + 1074, + 1087 + ], + [ + 1090, + 1091 + ], + [ + 1105, + 1106 + ], + [ + 1108, + 1109 + ], + [ + 1110, + 1111 + ], + [ + 1115, + 1118 + ], + [ + 1119, + 1123 + ], + [ + 1126, + 1129 + ], + [ + 1130, + 1133 + ], + [ + 1135, + 1137 + ], + [ + 1138, + 1139 + ], + [ + 1144, + 1146 + ], + [ + 1149, + 1150 + ], + [ + 1153, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1157, + 1158 + ], + [ + 1163, + 1165 + ], + [ + 1169, + 1175 + ], + [ + 1176, + 1196 + ], + [ + 1199, + 1200 + ], + [ + 1217, + 1218 + ], + [ + 1228, + 1231 + ], + [ + 1232, + 1233 + ], + [ + 1235, + 1236 + ], + [ + 1238, + 1242 + ], + [ + 1248, + 1249 + ], + [ + 1252, + 1254 + ], + [ + 1256, + 1259 + ], + [ + 1262, + 1263 + ], + [ + 1269, + 1270 + ], + [ + 1272, + 1275 + ], + [ + 1276, + 1277 + ], + [ + 1281, + 1282 + ], + [ + 1287, + 1289 + ], + [ + 1291, + 1292 + ], + [ + 1293, + 1295 + ], + [ + 1296, + 1297 + ], + [ + 1299, + 1300 + ], + [ + 1302, + 1314 + ], + [ + 1316, + 1317 + ], + [ + 1318, + 1319 + ], + [ + 1326, + 1327 + ], + [ + 1328, + 1329 + ], + [ + 1332, + 1333 + ], + [ + 1334, + 1336 + ], + [ + 1337, + 1338 + ], + [ + 1341, + 1343 + ], + [ + 1344, + 1345 + ], + [ + 1364, + 1365 + ], + [ + 1368, + 1369 + ], + [ + 1372, + 1373 + ], + [ + 1376, + 1377 + ], + [ + 1384, + 1385 + ], + [ + 1389, + 1392 + ], + [ + 1393, + 1394 + ], + [ + 1410, + 1411 + ], + [ + 1412, + 1416 + ], + [ + 1423, + 1424 + ], + [ + 1428, + 1431 + ], + [ + 1432, + 1433 + ], + [ + 1461, + 1462 + ], + [ + 1465, + 1466 + ], + [ + 1471, + 1472 + ], + [ + 1473, + 1474 + ], + [ + 1479, + 1481 + ], + [ + 1485, + 1489 + ], + [ + 1490, + 1491 + ] + ] + } + }, + { + "filename": "libvips/colour/pcolour.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 66 + ], + [ + 68, + 75 + ], + [ + 93, + 118 + ], + [ + 125, + 150 + ], + [ + 163, + 188 + ], + [ + 200, + 210 + ], + [ + 211, + 229 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 56, + 58 + ], + [ + 62, + 63 + ], + [ + 71, + 72 + ], + [ + 96, + 97 + ], + [ + 102, + 114 + ], + [ + 128, + 129 + ], + [ + 134, + 146 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 172, + 184 + ], + [ + 203, + 204 + ], + [ + 205, + 207 + ], + [ + 214, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 223 + ] + ] + } + }, + { + "filename": "libvips/colour/profile_load.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 56, + 181 + ], + [ + 192, + 235 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 59, + 60 + ], + [ + 62, + 63 + ], + [ + 67, + 69 + ], + [ + 75, + 78 + ], + [ + 79, + 80 + ], + [ + 83, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 94 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 108, + 109 + ], + [ + 110, + 112 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ], + [ + 117, + 122 + ], + [ + 123, + 126 + ], + [ + 128, + 129 + ], + [ + 130, + 132 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 148, + 149 + ], + [ + 151, + 164 + ], + [ + 167, + 168 + ], + [ + 172, + 173 + ], + [ + 177, + 178 + ], + [ + 195, + 196 + ], + [ + 200, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 208 + ], + [ + 210, + 211 + ], + [ + 214, + 216 + ], + [ + 217, + 218 + ], + [ + 220, + 224 + ], + [ + 225, + 227 + ], + [ + 228, + 230 + ], + [ + 233, + 234 + ] + ] + } + }, + { + "filename": "libvips/colour/profiles.h", + "line_filter": { + "diff_chunks": [ + [ + 10, + 13 + ] + ], + "lines_added": [] + } + }, + { + "filename": "libvips/colour/rad2float.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 12, + 47 + ], + [ + 116, + 153 + ], + [ + 156, + 194 + ], + [ + 210, + 224 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 42, + 44 + ], + [ + 119, + 128 + ], + [ + 129, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 145, + 146 + ], + [ + 147, + 150 + ], + [ + 159, + 160 + ], + [ + 162, + 163 + ], + [ + 169, + 171 + ], + [ + 174, + 175 + ], + [ + 177, + 178 + ], + [ + 180, + 182 + ], + [ + 187, + 188 + ], + [ + 189, + 191 + ], + [ + 213, + 214 + ], + [ + 218, + 221 + ], + [ + 222, + 223 + ] + ] + } + }, + { + "filename": "libvips/colour/sRGB2HSV.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 45, + 120 + ], + [ + 124, + 146 + ], + [ + 160, + 167 + ], + [ + 168, + 182 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 48, + 49 + ], + [ + 51, + 52 + ], + [ + 58, + 59 + ], + [ + 64, + 66 + ], + [ + 72, + 73 + ], + [ + 77, + 78 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 90, + 91 + ], + [ + 95, + 96 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 127, + 128 + ], + [ + 130, + 131 + ], + [ + 133, + 134 + ], + [ + 139, + 140 + ], + [ + 141, + 143 + ], + [ + 163, + 164 + ], + [ + 171, + 172 + ], + [ + 176, + 179 + ], + [ + 180, + 181 + ] + ] + } + }, + { + "filename": "libvips/colour/sRGB2scRGB.c", + "line_filter": { + "diff_chunks": [ + [ + 23, + 51 + ], + [ + 69, + 91 + ], + [ + 93, + 101 + ], + [ + 105, + 112 + ], + [ + 113, + 120 + ], + [ + 124, + 137 + ], + [ + 139, + 147 + ], + [ + 151, + 158 + ], + [ + 159, + 166 + ], + [ + 168, + 299 + ], + [ + 304, + 312 + ], + [ + 313, + 327 + ] + ], + "lines_added": [ + [ + 26, + 42 + ], + [ + 47, + 48 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 81, + 83 + ], + [ + 86, + 88 + ], + [ + 96, + 98 + ], + [ + 108, + 109 + ], + [ + 116, + 117 + ], + [ + 127, + 129 + ], + [ + 132, + 134 + ], + [ + 142, + 144 + ], + [ + 154, + 155 + ], + [ + 162, + 163 + ], + [ + 171, + 173 + ], + [ + 175, + 176 + ], + [ + 180, + 182 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 188, + 190 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 199, + 201 + ], + [ + 202, + 203 + ], + [ + 204, + 206 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 220, + 221 + ], + [ + 226, + 228 + ], + [ + 230, + 237 + ], + [ + 240, + 241 + ], + [ + 245, + 249 + ], + [ + 253, + 258 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 268, + 269 + ], + [ + 270, + 271 + ], + [ + 276, + 277 + ], + [ + 281, + 292 + ], + [ + 295, + 296 + ], + [ + 307, + 309 + ], + [ + 316, + 317 + ], + [ + 321, + 324 + ], + [ + 325, + 326 + ] + ] + } + }, + { + "filename": "libvips/colour/scRGB2BW.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 57, + 82 + ], + [ + 83, + 111 + ], + [ + 112, + 181 + ], + [ + 186, + 261 + ], + [ + 271, + 293 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 61 + ], + [ + 65, + 67 + ], + [ + 70, + 71 + ], + [ + 76, + 77 + ], + [ + 78, + 79 + ], + [ + 86, + 88 + ], + [ + 94, + 96 + ], + [ + 99, + 100 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 115, + 117 + ], + [ + 123, + 125 + ], + [ + 128, + 129 + ], + [ + 133, + 135 + ], + [ + 136, + 137 + ], + [ + 138, + 143 + ], + [ + 144, + 147 + ], + [ + 148, + 150 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 160, + 161 + ], + [ + 163, + 164 + ], + [ + 165, + 166 + ], + [ + 168, + 169 + ], + [ + 170, + 172 + ], + [ + 174, + 176 + ], + [ + 177, + 178 + ], + [ + 189, + 192 + ], + [ + 194, + 196 + ], + [ + 199, + 203 + ], + [ + 208, + 213 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 231, + 232 + ], + [ + 236, + 254 + ], + [ + 257, + 258 + ], + [ + 274, + 276 + ], + [ + 282, + 283 + ], + [ + 287, + 290 + ], + [ + 291, + 292 + ] + ] + } + }, + { + "filename": "libvips/colour/scRGB2XYZ.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 12, + 40 + ], + [ + 52, + 69 + ], + [ + 71, + 78 + ], + [ + 81, + 102 + ], + [ + 111, + 125 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 60, + 62 + ], + [ + 65, + 66 + ], + [ + 74, + 75 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 96, + 97 + ], + [ + 98, + 99 + ], + [ + 114, + 115 + ], + [ + 119, + 122 + ], + [ + 123, + 124 + ] + ] + } + }, + { + "filename": "libvips/colour/scRGB2sRGB.c", + "line_filter": { + "diff_chunks": [ + [ + 31, + 59 + ], + [ + 82, + 106 + ], + [ + 109, + 136 + ], + [ + 139, + 208 + ], + [ + 213, + 287 + ], + [ + 297, + 319 + ] + ], + "lines_added": [ + [ + 34, + 50 + ], + [ + 55, + 56 + ], + [ + 85, + 86 + ], + [ + 90, + 92 + ], + [ + 95, + 96 + ], + [ + 102, + 103 + ], + [ + 112, + 114 + ], + [ + 120, + 122 + ], + [ + 125, + 126 + ], + [ + 132, + 133 + ], + [ + 142, + 144 + ], + [ + 150, + 152 + ], + [ + 155, + 156 + ], + [ + 160, + 162 + ], + [ + 163, + 164 + ], + [ + 165, + 170 + ], + [ + 171, + 174 + ], + [ + 175, + 177 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 195, + 196 + ], + [ + 197, + 199 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 216, + 219 + ], + [ + 221, + 223 + ], + [ + 226, + 230 + ], + [ + 234, + 239 + ], + [ + 241, + 242 + ], + [ + 243, + 244 + ], + [ + 247, + 248 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ], + [ + 257, + 258 + ], + [ + 262, + 280 + ], + [ + 283, + 284 + ], + [ + 300, + 302 + ], + [ + 308, + 309 + ], + [ + 313, + 316 + ], + [ + 317, + 318 + ] + ] + } + }, + { + "filename": "libvips/conversion/arrayjoin.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 74, + 126 + ], + [ + 129, + 153 + ], + [ + 162, + 230 + ], + [ + 235, + 274 + ], + [ + 285, + 292 + ], + [ + 306, + 430 + ], + [ + 448, + 473 + ], + [ + 477, + 491 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 77, + 78 + ], + [ + 80, + 82 + ], + [ + 85, + 87 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 100 + ], + [ + 104, + 105 + ], + [ + 108, + 111 + ], + [ + 113, + 114 + ], + [ + 116, + 120 + ], + [ + 122, + 123 + ], + [ + 132, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 150 + ], + [ + 165, + 167 + ], + [ + 168, + 169 + ], + [ + 171, + 173 + ], + [ + 176, + 179 + ], + [ + 184, + 188 + ], + [ + 194, + 196 + ], + [ + 197, + 198 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 209, + 210 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 220, + 221 + ], + [ + 225, + 227 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 246, + 248 + ], + [ + 253, + 255 + ], + [ + 260, + 262 + ], + [ + 265, + 266 + ], + [ + 270, + 271 + ], + [ + 288, + 289 + ], + [ + 309, + 314 + ], + [ + 316, + 319 + ], + [ + 323, + 327 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 334, + 337 + ], + [ + 338, + 339 + ], + [ + 344, + 345 + ], + [ + 349, + 352 + ], + [ + 353, + 355 + ], + [ + 356, + 359 + ], + [ + 360, + 362 + ], + [ + 363, + 366 + ], + [ + 367, + 369 + ], + [ + 370, + 373 + ], + [ + 374, + 376 + ], + [ + 377, + 380 + ], + [ + 381, + 383 + ], + [ + 384, + 387 + ], + [ + 388, + 390 + ], + [ + 391, + 394 + ], + [ + 395, + 397 + ], + [ + 398, + 401 + ], + [ + 402, + 404 + ], + [ + 407, + 408 + ], + [ + 411, + 413 + ], + [ + 417, + 418 + ], + [ + 419, + 420 + ], + [ + 422, + 425 + ], + [ + 426, + 427 + ], + [ + 451, + 453 + ], + [ + 457, + 458 + ], + [ + 459, + 460 + ], + [ + 463, + 465 + ], + [ + 468, + 470 + ], + [ + 480, + 481 + ], + [ + 485, + 488 + ], + [ + 489, + 490 + ] + ] + } + }, + { + "filename": "libvips/conversion/autorot.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 44 + ], + [ + 68, + 89 + ], + [ + 94, + 123 + ], + [ + 157, + 232 + ], + [ + 240, + 266 + ] + ], + "lines_added": [ + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 35 + ], + [ + 40, + 41 + ], + [ + 71, + 72 + ], + [ + 74, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 82, + 83 + ], + [ + 85, + 86 + ], + [ + 97, + 98 + ], + [ + 99, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 112 + ], + [ + 119, + 120 + ], + [ + 162, + 163 + ], + [ + 165, + 166 + ], + [ + 167, + 170 + ], + [ + 173, + 176 + ], + [ + 181, + 183 + ], + [ + 185, + 186 + ], + [ + 187, + 189 + ], + [ + 190, + 191 + ], + [ + 194, + 195 + ], + [ + 196, + 198 + ], + [ + 203, + 204 + ], + [ + 206, + 209 + ], + [ + 210, + 211 + ], + [ + 212, + 215 + ], + [ + 216, + 218 + ], + [ + 219, + 222 + ], + [ + 223, + 225 + ], + [ + 228, + 229 + ], + [ + 243, + 244 + ], + [ + 245, + 248 + ], + [ + 249, + 250 + ], + [ + 255, + 256 + ], + [ + 260, + 263 + ], + [ + 264, + 265 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandary.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 32, + 60 + ], + [ + 77, + 108 + ], + [ + 109, + 117 + ], + [ + 119, + 267 + ], + [ + 269, + 284 + ], + [ + 285, + 292 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 80, + 81 + ], + [ + 83, + 84 + ], + [ + 87, + 88 + ], + [ + 90, + 93 + ], + [ + 95, + 97 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 112, + 114 + ], + [ + 122, + 123 + ], + [ + 127, + 130 + ], + [ + 134, + 138 + ], + [ + 143, + 146 + ], + [ + 150, + 154 + ], + [ + 156, + 157 + ], + [ + 160, + 161 + ], + [ + 164, + 166 + ], + [ + 170, + 174 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 181 + ], + [ + 182, + 185 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 199 + ], + [ + 205, + 207 + ], + [ + 208, + 212 + ], + [ + 214, + 217 + ], + [ + 218, + 224 + ], + [ + 226, + 229 + ], + [ + 231, + 233 + ], + [ + 235, + 239 + ], + [ + 240, + 241 + ], + [ + 244, + 245 + ], + [ + 246, + 249 + ], + [ + 250, + 251 + ], + [ + 256, + 257 + ], + [ + 263, + 264 + ], + [ + 272, + 273 + ], + [ + 274, + 276 + ], + [ + 277, + 281 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandary.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 73, + 81 + ], + [ + 103, + 121 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 76, + 78 + ], + [ + 106, + 107 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandbool.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 58, + 171 + ], + [ + 173, + 190 + ], + [ + 204, + 211 + ], + [ + 212, + 260 + ], + [ + 267, + 300 + ], + [ + 308, + 324 + ], + [ + 332, + 348 + ], + [ + 356, + 370 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 61, + 62 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 72, + 79 + ], + [ + 81, + 84 + ], + [ + 88, + 90 + ], + [ + 94, + 96 + ], + [ + 97, + 98 + ], + [ + 100, + 127 + ], + [ + 129, + 130 + ], + [ + 131, + 164 + ], + [ + 166, + 168 + ], + [ + 176, + 179 + ], + [ + 181, + 183 + ], + [ + 185, + 187 + ], + [ + 207, + 208 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 219, + 220 + ], + [ + 225, + 226 + ], + [ + 231, + 234 + ], + [ + 235, + 236 + ], + [ + 237, + 240 + ], + [ + 241, + 244 + ], + [ + 247, + 248 + ], + [ + 253, + 255 + ], + [ + 256, + 257 + ], + [ + 270, + 271 + ], + [ + 276, + 277 + ], + [ + 279, + 280 + ], + [ + 286, + 288 + ], + [ + 292, + 295 + ], + [ + 296, + 297 + ], + [ + 311, + 312 + ], + [ + 316, + 319 + ], + [ + 320, + 321 + ], + [ + 335, + 336 + ], + [ + 340, + 343 + ], + [ + 344, + 345 + ], + [ + 359, + 360 + ], + [ + 364, + 367 + ], + [ + 368, + 369 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandfold.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 8, + 36 + ], + [ + 66, + 83 + ], + [ + 85, + 178 + ], + [ + 188, + 212 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 27 + ], + [ + 32, + 33 + ], + [ + 69, + 70 + ], + [ + 72, + 74 + ], + [ + 78, + 80 + ], + [ + 88, + 90 + ], + [ + 91, + 95 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 112, + 114 + ], + [ + 115, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 124 + ], + [ + 126, + 129 + ], + [ + 133, + 137 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 144, + 147 + ], + [ + 148, + 149 + ], + [ + 154, + 155 + ], + [ + 159, + 162 + ], + [ + 163, + 164 + ], + [ + 165, + 168 + ], + [ + 169, + 171 + ], + [ + 174, + 175 + ], + [ + 191, + 192 + ], + [ + 194, + 195 + ], + [ + 201, + 202 + ], + [ + 206, + 209 + ], + [ + 210, + 211 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandjoin.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 30, + 58 + ], + [ + 85, + 96 + ], + [ + 97, + 124 + ], + [ + 129, + 206 + ], + [ + 209, + 227 + ], + [ + 228, + 244 + ], + [ + 252, + 259 + ], + [ + 261, + 272 + ], + [ + 284, + 305 + ], + [ + 307, + 325 + ], + [ + 326, + 337 + ], + [ + 341, + 355 + ], + [ + 357, + 448 + ], + [ + 452, + 475 + ], + [ + 483, + 499 + ], + [ + 508, + 525 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 49 + ], + [ + 54, + 55 + ], + [ + 88, + 89 + ], + [ + 91, + 93 + ], + [ + 100, + 101 + ], + [ + 107, + 108 + ], + [ + 110, + 111 + ], + [ + 112, + 114 + ], + [ + 119, + 121 + ], + [ + 132, + 133 + ], + [ + 137, + 139 + ], + [ + 140, + 142 + ], + [ + 146, + 149 + ], + [ + 153, + 155 + ], + [ + 156, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 165 + ], + [ + 166, + 167 + ], + [ + 172, + 173 + ], + [ + 177, + 180 + ], + [ + 181, + 183 + ], + [ + 186, + 187 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 198, + 201 + ], + [ + 202, + 203 + ], + [ + 212, + 213 + ], + [ + 217, + 218 + ], + [ + 222, + 224 + ], + [ + 231, + 232 + ], + [ + 236, + 239 + ], + [ + 240, + 241 + ], + [ + 255, + 256 + ], + [ + 264, + 267 + ], + [ + 268, + 269 + ], + [ + 287, + 288 + ], + [ + 290, + 291 + ], + [ + 294, + 295 + ], + [ + 296, + 297 + ], + [ + 300, + 302 + ], + [ + 310, + 311 + ], + [ + 314, + 315 + ], + [ + 318, + 319 + ], + [ + 320, + 322 + ], + [ + 329, + 331 + ], + [ + 333, + 334 + ], + [ + 344, + 346 + ], + [ + 351, + 352 + ], + [ + 360, + 361 + ], + [ + 362, + 363 + ], + [ + 366, + 368 + ], + [ + 371, + 372 + ], + [ + 373, + 376 + ], + [ + 381, + 385 + ], + [ + 387, + 389 + ], + [ + 390, + 391 + ], + [ + 394, + 395 + ], + [ + 396, + 399 + ], + [ + 400, + 401 + ], + [ + 407, + 408 + ], + [ + 412, + 415 + ], + [ + 416, + 417 + ], + [ + 418, + 421 + ], + [ + 422, + 424 + ], + [ + 427, + 428 + ], + [ + 434, + 436 + ], + [ + 437, + 438 + ], + [ + 440, + 443 + ], + [ + 444, + 445 + ], + [ + 455, + 456 + ], + [ + 462, + 463 + ], + [ + 467, + 470 + ], + [ + 471, + 472 + ], + [ + 486, + 487 + ], + [ + 491, + 494 + ], + [ + 495, + 496 + ], + [ + 511, + 512 + ], + [ + 516, + 518 + ], + [ + 520, + 522 + ], + [ + 523, + 524 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandmean.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 41 + ], + [ + 64, + 169 + ], + [ + 170, + 177 + ], + [ + 178, + 221 + ], + [ + 224, + 232 + ], + [ + 234, + 248 + ] + ], + "lines_added": [ + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 32 + ], + [ + 37, + 38 + ], + [ + 67, + 68 + ], + [ + 71, + 86 + ], + [ + 89, + 104 + ], + [ + 107, + 122 + ], + [ + 124, + 126 + ], + [ + 130, + 132 + ], + [ + 135, + 160 + ], + [ + 161, + 163 + ], + [ + 164, + 166 + ], + [ + 173, + 174 + ], + [ + 181, + 184 + ], + [ + 187, + 189 + ], + [ + 190, + 191 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 198, + 199 + ], + [ + 204, + 205 + ], + [ + 209, + 212 + ], + [ + 213, + 214 + ], + [ + 217, + 218 + ], + [ + 227, + 229 + ], + [ + 237, + 238 + ], + [ + 242, + 245 + ], + [ + 246, + 247 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandrank.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 63, + 180 + ], + [ + 181, + 273 + ], + [ + 274, + 290 + ], + [ + 297, + 316 + ], + [ + 319, + 333 + ] + ], + "lines_added": [ + [ + 15, + 31 + ], + [ + 36, + 37 + ], + [ + 66, + 67 + ], + [ + 71, + 72 + ], + [ + 75, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 132 + ], + [ + 133, + 162 + ], + [ + 164, + 165 + ], + [ + 170, + 172 + ], + [ + 176, + 177 + ], + [ + 184, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 201, + 204 + ], + [ + 207, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 218, + 220 + ], + [ + 225, + 227 + ], + [ + 229, + 231 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 238, + 241 + ], + [ + 242, + 243 + ], + [ + 248, + 249 + ], + [ + 253, + 256 + ], + [ + 257, + 259 + ], + [ + 260, + 263 + ], + [ + 264, + 266 + ], + [ + 269, + 270 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 282, + 285 + ], + [ + 286, + 287 + ], + [ + 300, + 302 + ], + [ + 303, + 305 + ], + [ + 306, + 307 + ], + [ + 312, + 313 + ], + [ + 322, + 323 + ], + [ + 327, + 330 + ], + [ + 331, + 332 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandunfold.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 8, + 36 + ], + [ + 66, + 85 + ], + [ + 87, + 181 + ], + [ + 191, + 200 + ], + [ + 201, + 215 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 27 + ], + [ + 32, + 33 + ], + [ + 69, + 70 + ], + [ + 72, + 74 + ], + [ + 79, + 82 + ], + [ + 90, + 92 + ], + [ + 93, + 96 + ], + [ + 97, + 98 + ], + [ + 102, + 103 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ], + [ + 111, + 113 + ], + [ + 115, + 117 + ], + [ + 118, + 120 + ], + [ + 121, + 122 + ], + [ + 123, + 127 + ], + [ + 129, + 132 + ], + [ + 136, + 140 + ], + [ + 141, + 142 + ], + [ + 145, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 152 + ], + [ + 157, + 158 + ], + [ + 162, + 165 + ], + [ + 166, + 167 + ], + [ + 168, + 171 + ], + [ + 172, + 174 + ], + [ + 177, + 178 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 204, + 205 + ], + [ + 209, + 212 + ], + [ + 213, + 214 + ] + ] + } + }, + { + "filename": "libvips/conversion/byteswap.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 64, + 217 + ], + [ + 220, + 252 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 67, + 68 + ], + [ + 72, + 74 + ], + [ + 76, + 77 + ], + [ + 78, + 79 + ], + [ + 80, + 82 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 97 + ], + [ + 102, + 103 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 112 + ], + [ + 114, + 115 + ], + [ + 117, + 127 + ], + [ + 132, + 134 + ], + [ + 137, + 138 + ], + [ + 142, + 143 + ], + [ + 144, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 160, + 161 + ], + [ + 163, + 165 + ], + [ + 168, + 171 + ], + [ + 172, + 174 + ], + [ + 175, + 178 + ], + [ + 179, + 183 + ], + [ + 184, + 185 + ], + [ + 188, + 189 + ], + [ + 190, + 193 + ], + [ + 194, + 195 + ], + [ + 200, + 201 + ], + [ + 205, + 208 + ], + [ + 209, + 210 + ], + [ + 213, + 214 + ], + [ + 223, + 224 + ], + [ + 230, + 231 + ], + [ + 235, + 238 + ], + [ + 239, + 240 + ], + [ + 245, + 246 + ], + [ + 247, + 249 + ], + [ + 250, + 251 + ] + ] + } + }, + { + "filename": "libvips/conversion/cache.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 54, + 133 + ], + [ + 148, + 182 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 57, + 58 + ], + [ + 64, + 65 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 72, + 73 + ], + [ + 74, + 76 + ], + [ + 77, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 88, + 90 + ], + [ + 91, + 92 + ], + [ + 97, + 98 + ], + [ + 100, + 103 + ], + [ + 104, + 105 + ], + [ + 106, + 109 + ], + [ + 110, + 112 + ], + [ + 113, + 116 + ], + [ + 117, + 119 + ], + [ + 120, + 123 + ], + [ + 124, + 126 + ], + [ + 129, + 130 + ], + [ + 151, + 153 + ], + [ + 155, + 156 + ], + [ + 158, + 159 + ], + [ + 164, + 165 + ], + [ + 171, + 172 + ], + [ + 176, + 179 + ], + [ + 180, + 181 + ] + ] + } + }, + { + "filename": "libvips/conversion/cast.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 9 + ], + [ + 60, + 88 + ], + [ + 116, + 561 + ], + [ + 571, + 583 + ], + [ + 584, + 600 + ], + [ + 602, + 623 + ], + [ + 625, + 646 + ], + [ + 648, + 669 + ], + [ + 671, + 692 + ], + [ + 694, + 715 + ], + [ + 717, + 738 + ], + [ + 740, + 761 + ], + [ + 763, + 784 + ], + [ + 786, + 807 + ], + [ + 809, + 828 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 63, + 64 + ], + [ + 65, + 69 + ], + [ + 70, + 79 + ], + [ + 84, + 85 + ], + [ + 119, + 120 + ], + [ + 123, + 127 + ], + [ + 128, + 129 + ], + [ + 130, + 132 + ], + [ + 138, + 149 + ], + [ + 153, + 164 + ], + [ + 165, + 177 + ], + [ + 182, + 193 + ], + [ + 194, + 195 + ], + [ + 196, + 211 + ], + [ + 212, + 225 + ], + [ + 231, + 239 + ], + [ + 245, + 255 + ], + [ + 258, + 266 + ], + [ + 269, + 279 + ], + [ + 282, + 293 + ], + [ + 296, + 308 + ], + [ + 309, + 356 + ], + [ + 358, + 359 + ], + [ + 363, + 365 + ], + [ + 368, + 451 + ], + [ + 453, + 454 + ], + [ + 455, + 456 + ], + [ + 459, + 460 + ], + [ + 461, + 462 + ], + [ + 463, + 465 + ], + [ + 466, + 467 + ], + [ + 468, + 470 + ], + [ + 471, + 472 + ], + [ + 475, + 477 + ], + [ + 478, + 481 + ], + [ + 483, + 485 + ], + [ + 487, + 493 + ], + [ + 496, + 499 + ], + [ + 502, + 506 + ], + [ + 507, + 508 + ], + [ + 511, + 512 + ], + [ + 513, + 516 + ], + [ + 517, + 518 + ], + [ + 523, + 524 + ], + [ + 528, + 531 + ], + [ + 532, + 533 + ], + [ + 534, + 537 + ], + [ + 538, + 540 + ], + [ + 541, + 544 + ], + [ + 545, + 547 + ], + [ + 550, + 551 + ], + [ + 555, + 556 + ], + [ + 557, + 558 + ], + [ + 574, + 575 + ], + [ + 579, + 580 + ], + [ + 587, + 588 + ], + [ + 592, + 595 + ], + [ + 596, + 597 + ], + [ + 605, + 606 + ], + [ + 610, + 611 + ], + [ + 615, + 618 + ], + [ + 619, + 620 + ], + [ + 628, + 629 + ], + [ + 633, + 634 + ], + [ + 638, + 641 + ], + [ + 642, + 643 + ], + [ + 651, + 652 + ], + [ + 656, + 657 + ], + [ + 661, + 664 + ], + [ + 665, + 666 + ], + [ + 674, + 675 + ], + [ + 679, + 680 + ], + [ + 684, + 687 + ], + [ + 688, + 689 + ], + [ + 697, + 698 + ], + [ + 702, + 703 + ], + [ + 707, + 710 + ], + [ + 711, + 712 + ], + [ + 720, + 721 + ], + [ + 725, + 726 + ], + [ + 730, + 733 + ], + [ + 734, + 735 + ], + [ + 743, + 744 + ], + [ + 748, + 749 + ], + [ + 753, + 756 + ], + [ + 757, + 758 + ], + [ + 766, + 767 + ], + [ + 771, + 772 + ], + [ + 776, + 779 + ], + [ + 780, + 781 + ], + [ + 789, + 790 + ], + [ + 794, + 795 + ], + [ + 799, + 802 + ], + [ + 803, + 804 + ], + [ + 812, + 813 + ], + [ + 817, + 818 + ], + [ + 822, + 825 + ], + [ + 826, + 827 + ] + ] + } + }, + { + "filename": "libvips/conversion/conversion.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 49, + 56 + ], + [ + 84, + 120 + ], + [ + 168, + 175 + ], + [ + 178, + 185 + ], + [ + 192, + 199 + ], + [ + 206, + 213 + ], + [ + 222, + 229 + ], + [ + 239, + 255 + ], + [ + 260, + 267 + ], + [ + 272, + 281 + ], + [ + 288, + 356 + ], + [ + 357, + 419 + ], + [ + 433, + 460 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 52, + 53 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 96, + 99 + ], + [ + 101, + 103 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 171, + 172 + ], + [ + 181, + 182 + ], + [ + 195, + 196 + ], + [ + 209, + 210 + ], + [ + 225, + 226 + ], + [ + 242, + 243 + ], + [ + 248, + 249 + ], + [ + 251, + 252 + ], + [ + 263, + 264 + ], + [ + 275, + 276 + ], + [ + 277, + 278 + ], + [ + 291, + 292 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 305, + 306 + ], + [ + 310, + 311 + ], + [ + 313, + 314 + ], + [ + 315, + 316 + ], + [ + 318, + 321 + ], + [ + 323, + 324 + ], + [ + 325, + 327 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 334, + 336 + ], + [ + 341, + 342 + ], + [ + 344, + 349 + ], + [ + 352, + 353 + ], + [ + 360, + 361 + ], + [ + 362, + 410 + ], + [ + 412, + 416 + ], + [ + 436, + 459 + ] + ] + } + }, + { + "filename": "libvips/conversion/copy.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 10 + ], + [ + 58, + 86 + ], + [ + 119, + 126 + ], + [ + 128, + 169 + ], + [ + 170, + 189 + ], + [ + 191, + 361 + ], + [ + 379, + 386 + ], + [ + 387, + 408 + ], + [ + 410, + 421 + ], + [ + 423, + 444 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 6, + 7 + ], + [ + 61, + 62 + ], + [ + 63, + 67 + ], + [ + 68, + 77 + ], + [ + 82, + 83 + ], + [ + 122, + 123 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 137, + 138 + ], + [ + 139, + 142 + ], + [ + 143, + 144 + ], + [ + 149, + 153 + ], + [ + 154, + 158 + ], + [ + 159, + 160 + ], + [ + 162, + 163 + ], + [ + 164, + 166 + ], + [ + 173, + 175 + ], + [ + 176, + 178 + ], + [ + 179, + 182 + ], + [ + 183, + 186 + ], + [ + 194, + 195 + ], + [ + 201, + 204 + ], + [ + 205, + 210 + ], + [ + 211, + 214 + ], + [ + 216, + 218 + ], + [ + 219, + 223 + ], + [ + 225, + 228 + ], + [ + 233, + 239 + ], + [ + 241, + 245 + ], + [ + 246, + 247 + ], + [ + 250, + 251 + ], + [ + 252, + 255 + ], + [ + 256, + 257 + ], + [ + 262, + 263 + ], + [ + 268, + 270 + ], + [ + 272, + 275 + ], + [ + 276, + 277 + ], + [ + 278, + 281 + ], + [ + 282, + 284 + ], + [ + 285, + 288 + ], + [ + 289, + 291 + ], + [ + 292, + 295 + ], + [ + 296, + 298 + ], + [ + 299, + 302 + ], + [ + 303, + 305 + ], + [ + 306, + 309 + ], + [ + 310, + 312 + ], + [ + 313, + 316 + ], + [ + 317, + 319 + ], + [ + 320, + 323 + ], + [ + 324, + 326 + ], + [ + 327, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 337 + ], + [ + 338, + 340 + ], + [ + 341, + 344 + ], + [ + 345, + 347 + ], + [ + 348, + 351 + ], + [ + 352, + 354 + ], + [ + 357, + 358 + ], + [ + 382, + 383 + ], + [ + 390, + 391 + ], + [ + 395, + 396 + ], + [ + 400, + 403 + ], + [ + 404, + 405 + ], + [ + 413, + 415 + ], + [ + 417, + 418 + ], + [ + 426, + 427 + ], + [ + 430, + 432 + ], + [ + 433, + 439 + ], + [ + 442, + 443 + ] + ] + } + }, + { + "filename": "libvips/conversion/embed.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 13 + ], + [ + 31, + 59 + ], + [ + 92, + 102 + ], + [ + 110, + 140 + ], + [ + 141, + 151 + ], + [ + 152, + 192 + ], + [ + 194, + 237 + ], + [ + 240, + 322 + ], + [ + 323, + 401 + ], + [ + 404, + 450 + ], + [ + 461, + 477 + ], + [ + 481, + 505 + ], + [ + 506, + 535 + ], + [ + 536, + 603 + ], + [ + 611, + 621 + ], + [ + 624, + 668 + ], + [ + 680, + 708 + ], + [ + 715, + 734 + ], + [ + 775, + 816 + ], + [ + 828, + 855 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 9, + 10 + ], + [ + 34, + 35 + ], + [ + 36, + 40 + ], + [ + 41, + 50 + ], + [ + 55, + 56 + ], + [ + 95, + 96 + ], + [ + 97, + 99 + ], + [ + 113, + 114 + ], + [ + 120, + 122 + ], + [ + 128, + 130 + ], + [ + 135, + 137 + ], + [ + 144, + 145 + ], + [ + 146, + 148 + ], + [ + 155, + 156 + ], + [ + 162, + 164 + ], + [ + 165, + 166 + ], + [ + 169, + 171 + ], + [ + 174, + 176 + ], + [ + 179, + 181 + ], + [ + 182, + 183 + ], + [ + 188, + 189 + ], + [ + 197, + 200 + ], + [ + 206, + 207 + ], + [ + 209, + 212 + ], + [ + 218, + 221 + ], + [ + 224, + 225 + ], + [ + 228, + 230 + ], + [ + 233, + 234 + ], + [ + 243, + 244 + ], + [ + 249, + 252 + ], + [ + 253, + 254 + ], + [ + 256, + 257 + ], + [ + 259, + 261 + ], + [ + 265, + 268 + ], + [ + 272, + 273 + ], + [ + 275, + 276 + ], + [ + 279, + 282 + ], + [ + 283, + 284 + ], + [ + 288, + 289 + ], + [ + 292, + 294 + ], + [ + 295, + 296 + ], + [ + 302, + 303 + ], + [ + 306, + 310 + ], + [ + 315, + 319 + ], + [ + 326, + 331 + ], + [ + 333, + 335 + ], + [ + 340, + 341 + ], + [ + 344, + 345 + ], + [ + 348, + 349 + ], + [ + 350, + 352 + ], + [ + 353, + 354 + ], + [ + 357, + 359 + ], + [ + 362, + 381 + ], + [ + 384, + 386 + ], + [ + 387, + 394 + ], + [ + 395, + 398 + ], + [ + 407, + 408 + ], + [ + 410, + 418 + ], + [ + 421, + 426 + ], + [ + 430, + 432 + ], + [ + 433, + 436 + ], + [ + 442, + 443 + ], + [ + 444, + 447 + ], + [ + 464, + 465 + ], + [ + 466, + 468 + ], + [ + 470, + 474 + ], + [ + 484, + 485 + ], + [ + 486, + 488 + ], + [ + 490, + 492 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 501, + 502 + ], + [ + 509, + 510 + ], + [ + 511, + 513 + ], + [ + 515, + 521 + ], + [ + 523, + 524 + ], + [ + 525, + 527 + ], + [ + 528, + 532 + ], + [ + 539, + 540 + ], + [ + 543, + 544 + ], + [ + 545, + 547 + ], + [ + 548, + 549 + ], + [ + 554, + 555 + ], + [ + 560, + 563 + ], + [ + 564, + 565 + ], + [ + 566, + 569 + ], + [ + 570, + 572 + ], + [ + 573, + 576 + ], + [ + 577, + 579 + ], + [ + 580, + 583 + ], + [ + 584, + 586 + ], + [ + 587, + 590 + ], + [ + 591, + 593 + ], + [ + 596, + 597 + ], + [ + 599, + 600 + ], + [ + 614, + 615 + ], + [ + 617, + 618 + ], + [ + 627, + 629 + ], + [ + 630, + 631 + ], + [ + 634, + 635 + ], + [ + 636, + 638 + ], + [ + 639, + 640 + ], + [ + 645, + 646 + ], + [ + 648, + 651 + ], + [ + 652, + 654 + ], + [ + 655, + 658 + ], + [ + 659, + 661 + ], + [ + 664, + 665 + ], + [ + 683, + 685 + ], + [ + 687, + 688 + ], + [ + 690, + 691 + ], + [ + 694, + 696 + ], + [ + 700, + 703 + ], + [ + 704, + 705 + ], + [ + 718, + 719 + ], + [ + 721, + 722 + ], + [ + 726, + 731 + ], + [ + 781, + 783 + ], + [ + 784, + 785 + ], + [ + 788, + 789 + ], + [ + 790, + 792 + ], + [ + 793, + 794 + ], + [ + 799, + 801 + ], + [ + 803, + 806 + ], + [ + 807, + 809 + ], + [ + 812, + 813 + ], + [ + 831, + 833 + ], + [ + 835, + 836 + ], + [ + 838, + 839 + ], + [ + 842, + 844 + ], + [ + 848, + 852 + ], + [ + 853, + 854 + ] + ] + } + }, + { + "filename": "libvips/conversion/extract.c", + "line_filter": { + "diff_chunks": [ + [ + 41, + 69 + ], + [ + 103, + 116 + ], + [ + 121, + 240 + ], + [ + 250, + 299 + ], + [ + 305, + 330 + ], + [ + 339, + 366 + ], + [ + 368, + 447 + ], + [ + 459, + 477 + ] + ], + "lines_added": [ + [ + 44, + 60 + ], + [ + 65, + 66 + ], + [ + 106, + 107 + ], + [ + 111, + 113 + ], + [ + 124, + 126 + ], + [ + 129, + 133 + ], + [ + 136, + 137 + ], + [ + 138, + 140 + ], + [ + 142, + 144 + ], + [ + 145, + 146 + ], + [ + 148, + 151 + ], + [ + 153, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 165 + ], + [ + 166, + 170 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 180 + ], + [ + 181, + 182 + ], + [ + 187, + 188 + ], + [ + 192, + 195 + ], + [ + 196, + 197 + ], + [ + 198, + 201 + ], + [ + 202, + 204 + ], + [ + 205, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 215 + ], + [ + 216, + 218 + ], + [ + 219, + 222 + ], + [ + 223, + 225 + ], + [ + 229, + 230 + ], + [ + 231, + 232 + ], + [ + 236, + 237 + ], + [ + 253, + 254 + ], + [ + 257, + 259 + ], + [ + 263, + 267 + ], + [ + 268, + 269 + ], + [ + 275, + 276 + ], + [ + 279, + 285 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ], + [ + 292, + 293 + ], + [ + 295, + 296 + ], + [ + 308, + 309 + ], + [ + 311, + 312 + ], + [ + 315, + 317 + ], + [ + 321, + 325 + ], + [ + 326, + 327 + ], + [ + 342, + 343 + ], + [ + 345, + 347 + ], + [ + 352, + 355 + ], + [ + 361, + 363 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 377, + 379 + ], + [ + 380, + 381 + ], + [ + 386, + 390 + ], + [ + 392, + 395 + ], + [ + 397, + 399 + ], + [ + 400, + 401 + ], + [ + 404, + 405 + ], + [ + 406, + 409 + ], + [ + 410, + 411 + ], + [ + 416, + 417 + ], + [ + 421, + 424 + ], + [ + 425, + 426 + ], + [ + 427, + 430 + ], + [ + 431, + 433 + ], + [ + 434, + 437 + ], + [ + 438, + 440 + ], + [ + 443, + 444 + ], + [ + 462, + 463 + ], + [ + 466, + 467 + ], + [ + 471, + 474 + ], + [ + 475, + 476 + ] + ] + } + }, + { + "filename": "libvips/conversion/falsecolour.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 48 + ], + [ + 66, + 73 + ], + [ + 330, + 401 + ], + [ + 404, + 418 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 69, + 70 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 337, + 338 + ], + [ + 339, + 341 + ], + [ + 342, + 348 + ], + [ + 353, + 361 + ], + [ + 364, + 365 + ], + [ + 366, + 369 + ], + [ + 374, + 375 + ], + [ + 379, + 382 + ], + [ + 383, + 384 + ], + [ + 387, + 388 + ], + [ + 393, + 394 + ], + [ + 397, + 398 + ], + [ + 407, + 408 + ], + [ + 412, + 415 + ], + [ + 416, + 417 + ] + ] + } + }, + { + "filename": "libvips/conversion/flatten.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 15, + 43 + ], + [ + 81, + 449 + ], + [ + 453, + 474 + ], + [ + 476, + 490 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 18, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 34 + ], + [ + 39, + 40 + ], + [ + 84, + 85 + ], + [ + 88, + 104 + ], + [ + 108, + 124 + ], + [ + 127, + 145 + ], + [ + 146, + 166 + ], + [ + 168, + 170 + ], + [ + 173, + 174 + ], + [ + 175, + 176 + ], + [ + 180, + 182 + ], + [ + 183, + 186 + ], + [ + 187, + 191 + ], + [ + 192, + 195 + ], + [ + 196, + 199 + ], + [ + 200, + 203 + ], + [ + 204, + 207 + ], + [ + 208, + 211 + ], + [ + 212, + 215 + ], + [ + 216, + 219 + ], + [ + 220, + 225 + ], + [ + 227, + 228 + ], + [ + 233, + 235 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 245, + 247 + ], + [ + 248, + 251 + ], + [ + 252, + 256 + ], + [ + 257, + 260 + ], + [ + 261, + 264 + ], + [ + 265, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 280 + ], + [ + 281, + 284 + ], + [ + 285, + 290 + ], + [ + 292, + 293 + ], + [ + 296, + 297 + ], + [ + 298, + 300 + ], + [ + 301, + 302 + ], + [ + 308, + 310 + ], + [ + 311, + 312 + ], + [ + 313, + 316 + ], + [ + 319, + 321 + ], + [ + 322, + 324 + ], + [ + 328, + 331 + ], + [ + 334, + 335 + ], + [ + 340, + 343 + ], + [ + 344, + 346 + ], + [ + 350, + 353 + ], + [ + 358, + 361 + ], + [ + 362, + 363 + ], + [ + 368, + 373 + ], + [ + 378, + 387 + ], + [ + 390, + 393 + ], + [ + 396, + 398 + ], + [ + 399, + 400 + ], + [ + 403, + 404 + ], + [ + 405, + 408 + ], + [ + 409, + 410 + ], + [ + 415, + 416 + ], + [ + 420, + 423 + ], + [ + 424, + 425 + ], + [ + 426, + 429 + ], + [ + 430, + 432 + ], + [ + 433, + 436 + ], + [ + 437, + 439 + ], + [ + 442, + 443 + ], + [ + 444, + 446 + ], + [ + 456, + 457 + ], + [ + 460, + 461 + ], + [ + 464, + 465 + ], + [ + 466, + 467 + ], + [ + 470, + 471 + ], + [ + 479, + 480 + ], + [ + 484, + 487 + ], + [ + 488, + 489 + ] + ] + } + }, + { + "filename": "libvips/conversion/flip.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 15 + ], + [ + 21, + 49 + ], + [ + 80, + 101 + ], + [ + 106, + 139 + ], + [ + 142, + 149 + ], + [ + 155, + 178 + ], + [ + 181, + 209 + ], + [ + 213, + 258 + ], + [ + 269, + 283 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 24, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 40 + ], + [ + 45, + 46 + ], + [ + 83, + 84 + ], + [ + 86, + 88 + ], + [ + 90, + 91 + ], + [ + 97, + 98 + ], + [ + 109, + 111 + ], + [ + 114, + 119 + ], + [ + 120, + 122 + ], + [ + 127, + 128 + ], + [ + 131, + 133 + ], + [ + 135, + 136 + ], + [ + 145, + 146 + ], + [ + 158, + 159 + ], + [ + 162, + 164 + ], + [ + 167, + 170 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 184, + 185 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 195, + 197 + ], + [ + 198, + 200 + ], + [ + 201, + 204 + ], + [ + 205, + 206 + ], + [ + 216, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 229 + ], + [ + 230, + 231 + ], + [ + 236, + 237 + ], + [ + 239, + 242 + ], + [ + 243, + 244 + ], + [ + 245, + 248 + ], + [ + 249, + 251 + ], + [ + 254, + 255 + ], + [ + 272, + 273 + ], + [ + 277, + 280 + ], + [ + 281, + 282 + ] + ] + } + }, + { + "filename": "libvips/conversion/gamma.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 8 + ], + [ + 19, + 47 + ], + [ + 64, + 71 + ], + [ + 82, + 167 + ], + [ + 169, + 190 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 22, + 28 + ], + [ + 29, + 33 + ], + [ + 34, + 38 + ], + [ + 43, + 44 + ], + [ + 67, + 68 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 93, + 95 + ], + [ + 96, + 99 + ], + [ + 100, + 103 + ], + [ + 104, + 113 + ], + [ + 114, + 123 + ], + [ + 126, + 127 + ], + [ + 128, + 131 + ], + [ + 136, + 137 + ], + [ + 141, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 153 + ], + [ + 156, + 157 + ], + [ + 163, + 164 + ], + [ + 172, + 173 + ], + [ + 179, + 180 + ], + [ + 184, + 187 + ], + [ + 188, + 189 + ] + ] + } + }, + { + "filename": "libvips/conversion/grid.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 63, + 78 + ], + [ + 92, + 99 + ], + [ + 102, + 117 + ], + [ + 124, + 133 + ], + [ + 137, + 231 + ], + [ + 240, + 247 + ], + [ + 250, + 273 + ] + ], + "lines_added": [ + [ + 15, + 31 + ], + [ + 36, + 37 + ], + [ + 66, + 67 + ], + [ + 69, + 71 + ], + [ + 74, + 75 + ], + [ + 95, + 96 + ], + [ + 105, + 108 + ], + [ + 109, + 110 + ], + [ + 112, + 114 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 140, + 143 + ], + [ + 145, + 146 + ], + [ + 149, + 150 + ], + [ + 151, + 153 + ], + [ + 155, + 157 + ], + [ + 158, + 161 + ], + [ + 162, + 167 + ], + [ + 171, + 174 + ], + [ + 177, + 181 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 188, + 190 + ], + [ + 195, + 196 + ], + [ + 198, + 201 + ], + [ + 202, + 203 + ], + [ + 204, + 207 + ], + [ + 208, + 210 + ], + [ + 211, + 214 + ], + [ + 215, + 217 + ], + [ + 218, + 221 + ], + [ + 222, + 224 + ], + [ + 227, + 228 + ], + [ + 243, + 244 + ], + [ + 253, + 254 + ], + [ + 260, + 262 + ], + [ + 266, + 270 + ], + [ + 271, + 272 + ] + ] + } + }, + { + "filename": "libvips/conversion/ifthenelse.c", + "line_filter": { + "diff_chunks": [ + [ + 29, + 57 + ], + [ + 88, + 227 + ], + [ + 230, + 275 + ], + [ + 276, + 290 + ], + [ + 291, + 370 + ], + [ + 373, + 470 + ], + [ + 478, + 557 + ], + [ + 566, + 578 + ], + [ + 590, + 605 + ] + ], + "lines_added": [ + [ + 32, + 48 + ], + [ + 53, + 54 + ], + [ + 91, + 106 + ], + [ + 107, + 119 + ], + [ + 120, + 121 + ], + [ + 122, + 135 + ], + [ + 136, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 164 + ], + [ + 165, + 179 + ], + [ + 180, + 181 + ], + [ + 185, + 188 + ], + [ + 193, + 224 + ], + [ + 233, + 236 + ], + [ + 241, + 272 + ], + [ + 279, + 281 + ], + [ + 283, + 284 + ], + [ + 286, + 287 + ], + [ + 294, + 296 + ], + [ + 300, + 304 + ], + [ + 306, + 307 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 318, + 321 + ], + [ + 322, + 323 + ], + [ + 325, + 328 + ], + [ + 330, + 331 + ], + [ + 336, + 349 + ], + [ + 350, + 352 + ], + [ + 355, + 356 + ], + [ + 359, + 361 + ], + [ + 363, + 364 + ], + [ + 366, + 367 + ], + [ + 376, + 377 + ], + [ + 379, + 380 + ], + [ + 385, + 386 + ], + [ + 389, + 391 + ], + [ + 395, + 399 + ], + [ + 400, + 401 + ], + [ + 405, + 406 + ], + [ + 409, + 410 + ], + [ + 412, + 415 + ], + [ + 416, + 417 + ], + [ + 419, + 422 + ], + [ + 424, + 425 + ], + [ + 427, + 440 + ], + [ + 442, + 443 + ], + [ + 447, + 448 + ], + [ + 451, + 452 + ], + [ + 453, + 455 + ], + [ + 456, + 457 + ], + [ + 458, + 462 + ], + [ + 465, + 467 + ], + [ + 481, + 484 + ], + [ + 487, + 490 + ], + [ + 493, + 494 + ], + [ + 496, + 498 + ], + [ + 499, + 502 + ], + [ + 503, + 507 + ], + [ + 508, + 509 + ], + [ + 512, + 513 + ], + [ + 514, + 516 + ], + [ + 517, + 518 + ], + [ + 523, + 524 + ], + [ + 526, + 529 + ], + [ + 530, + 531 + ], + [ + 532, + 535 + ], + [ + 536, + 537 + ], + [ + 538, + 541 + ], + [ + 542, + 543 + ], + [ + 544, + 547 + ], + [ + 548, + 550 + ], + [ + 553, + 554 + ], + [ + 569, + 570 + ], + [ + 574, + 575 + ], + [ + 593, + 595 + ], + [ + 599, + 602 + ], + [ + 603, + 604 + ] + ] + } + }, + { + "filename": "libvips/conversion/insert.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 34, + 62 + ], + [ + 103, + 110 + ], + [ + 113, + 127 + ], + [ + 129, + 161 + ], + [ + 162, + 257 + ], + [ + 258, + 392 + ], + [ + 393, + 404 + ], + [ + 409, + 420 + ], + [ + 424, + 516 + ], + [ + 526, + 549 + ], + [ + 550, + 565 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 37, + 38 + ], + [ + 39, + 43 + ], + [ + 44, + 53 + ], + [ + 58, + 59 + ], + [ + 106, + 107 + ], + [ + 116, + 117 + ], + [ + 123, + 124 + ], + [ + 132, + 134 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 143, + 144 + ], + [ + 149, + 150 + ], + [ + 156, + 158 + ], + [ + 165, + 168 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 177, + 180 + ], + [ + 186, + 187 + ], + [ + 190, + 191 + ], + [ + 193, + 196 + ], + [ + 197, + 199 + ], + [ + 201, + 204 + ], + [ + 206, + 209 + ], + [ + 210, + 211 + ], + [ + 214, + 218 + ], + [ + 222, + 226 + ], + [ + 229, + 231 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 240, + 241 + ], + [ + 244, + 247 + ], + [ + 250, + 251 + ], + [ + 252, + 254 + ], + [ + 261, + 262 + ], + [ + 264, + 266 + ], + [ + 270, + 274 + ], + [ + 277, + 283 + ], + [ + 287, + 288 + ], + [ + 289, + 293 + ], + [ + 296, + 297 + ], + [ + 298, + 303 + ], + [ + 306, + 310 + ], + [ + 312, + 313 + ], + [ + 315, + 328 + ], + [ + 330, + 331 + ], + [ + 332, + 333 + ], + [ + 336, + 337 + ], + [ + 338, + 339 + ], + [ + 342, + 343 + ], + [ + 345, + 347 + ], + [ + 348, + 349 + ], + [ + 352, + 353 + ], + [ + 354, + 357 + ], + [ + 358, + 360 + ], + [ + 361, + 362 + ], + [ + 365, + 366 + ], + [ + 367, + 369 + ], + [ + 370, + 371 + ], + [ + 372, + 374 + ], + [ + 375, + 383 + ], + [ + 386, + 389 + ], + [ + 396, + 399 + ], + [ + 400, + 401 + ], + [ + 412, + 413 + ], + [ + 415, + 417 + ], + [ + 427, + 428 + ], + [ + 433, + 438 + ], + [ + 439, + 443 + ], + [ + 444, + 445 + ], + [ + 448, + 449 + ], + [ + 450, + 453 + ], + [ + 454, + 455 + ], + [ + 460, + 462 + ], + [ + 466, + 469 + ], + [ + 470, + 471 + ], + [ + 472, + 475 + ], + [ + 476, + 477 + ], + [ + 478, + 481 + ], + [ + 482, + 484 + ], + [ + 485, + 488 + ], + [ + 489, + 491 + ], + [ + 492, + 495 + ], + [ + 496, + 498 + ], + [ + 499, + 502 + ], + [ + 503, + 505 + ], + [ + 508, + 509 + ], + [ + 512, + 513 + ], + [ + 529, + 530 + ], + [ + 532, + 533 + ], + [ + 534, + 535 + ], + [ + 537, + 538 + ], + [ + 539, + 541 + ], + [ + 544, + 546 + ], + [ + 553, + 555 + ], + [ + 559, + 562 + ], + [ + 563, + 564 + ] + ] + } + }, + { + "filename": "libvips/conversion/join.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 21 + ], + [ + 27, + 55 + ], + [ + 87, + 117 + ], + [ + 132, + 139 + ], + [ + 155, + 184 + ], + [ + 191, + 301 + ], + [ + 306, + 313 + ], + [ + 320, + 334 + ], + [ + 338, + 353 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 30, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 46 + ], + [ + 51, + 52 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 101, + 103 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 135, + 136 + ], + [ + 158, + 163 + ], + [ + 164, + 165 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 177, + 178 + ], + [ + 179, + 181 + ], + [ + 194, + 195 + ], + [ + 197, + 202 + ], + [ + 203, + 204 + ], + [ + 209, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 224 + ], + [ + 225, + 226 + ], + [ + 231, + 232 + ], + [ + 236, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 245 + ], + [ + 246, + 247 + ], + [ + 248, + 251 + ], + [ + 252, + 254 + ], + [ + 255, + 258 + ], + [ + 259, + 261 + ], + [ + 262, + 265 + ], + [ + 266, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 275 + ], + [ + 276, + 279 + ], + [ + 280, + 282 + ], + [ + 285, + 286 + ], + [ + 289, + 291 + ], + [ + 296, + 298 + ], + [ + 309, + 310 + ], + [ + 323, + 326 + ], + [ + 329, + 331 + ], + [ + 341, + 343 + ], + [ + 347, + 350 + ], + [ + 351, + 352 + ] + ] + } + }, + { + "filename": "libvips/conversion/msb.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 48 + ], + [ + 62, + 69 + ], + [ + 80, + 114 + ], + [ + 116, + 137 + ], + [ + 138, + 260 + ], + [ + 271, + 294 + ] + ], + "lines_added": [ + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 34 + ], + [ + 35, + 39 + ], + [ + 44, + 45 + ], + [ + 65, + 66 + ], + [ + 83, + 84 + ], + [ + 86, + 87 + ], + [ + 91, + 92 + ], + [ + 94, + 95 + ], + [ + 99, + 101 + ], + [ + 102, + 105 + ], + [ + 106, + 108 + ], + [ + 110, + 111 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 130, + 131 + ], + [ + 133, + 134 + ], + [ + 141, + 142 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 153, + 155 + ], + [ + 156, + 159 + ], + [ + 162, + 163 + ], + [ + 164, + 167 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 179, + 181 + ], + [ + 187, + 189 + ], + [ + 190, + 192 + ], + [ + 194, + 198 + ], + [ + 199, + 201 + ], + [ + 202, + 205 + ], + [ + 206, + 207 + ], + [ + 208, + 209 + ], + [ + 212, + 213 + ], + [ + 217, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 230 + ], + [ + 235, + 237 + ], + [ + 241, + 244 + ], + [ + 245, + 246 + ], + [ + 247, + 250 + ], + [ + 251, + 253 + ], + [ + 256, + 257 + ], + [ + 274, + 275 + ], + [ + 279, + 280 + ], + [ + 283, + 284 + ], + [ + 288, + 291 + ], + [ + 292, + 293 + ] + ] + } + }, + { + "filename": "libvips/conversion/pconversion.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 66, + 76 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 69, + 70 + ] + ] + } + }, + { + "filename": "libvips/conversion/premultiply.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 41 + ], + [ + 69, + 280 + ], + [ + 288, + 307 + ], + [ + 309, + 316 + ], + [ + 318, + 332 + ] + ], + "lines_added": [ + [ + 16, + 32 + ], + [ + 37, + 38 + ], + [ + 72, + 73 + ], + [ + 76, + 94 + ], + [ + 97, + 116 + ], + [ + 117, + 126 + ], + [ + 128, + 130 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 141, + 143 + ], + [ + 144, + 147 + ], + [ + 148, + 152 + ], + [ + 153, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 164 + ], + [ + 165, + 168 + ], + [ + 169, + 172 + ], + [ + 173, + 176 + ], + [ + 177, + 180 + ], + [ + 181, + 186 + ], + [ + 188, + 189 + ], + [ + 192, + 193 + ], + [ + 194, + 196 + ], + [ + 197, + 198 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 206, + 209 + ], + [ + 212, + 214 + ], + [ + 215, + 217 + ], + [ + 218, + 221 + ], + [ + 225, + 228 + ], + [ + 230, + 231 + ], + [ + 235, + 239 + ], + [ + 240, + 241 + ], + [ + 244, + 245 + ], + [ + 246, + 249 + ], + [ + 250, + 251 + ], + [ + 256, + 257 + ], + [ + 261, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 270 + ], + [ + 271, + 273 + ], + [ + 276, + 277 + ], + [ + 291, + 292 + ], + [ + 296, + 298 + ], + [ + 301, + 304 + ], + [ + 312, + 313 + ], + [ + 321, + 322 + ], + [ + 326, + 329 + ], + [ + 330, + 331 + ] + ] + } + }, + { + "filename": "libvips/conversion/recomb.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 60, + 67 + ], + [ + 68, + 106 + ], + [ + 109, + 252 + ], + [ + 259, + 273 + ] + ], + "lines_added": [ + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 35, + 36 + ], + [ + 63, + 64 + ], + [ + 71, + 72 + ], + [ + 75, + 97 + ], + [ + 98, + 99 + ], + [ + 101, + 103 + ], + [ + 112, + 146 + ], + [ + 152, + 153 + ], + [ + 156, + 157 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 165, + 185 + ], + [ + 187, + 190 + ], + [ + 191, + 194 + ], + [ + 196, + 197 + ], + [ + 199, + 203 + ], + [ + 204, + 205 + ], + [ + 208, + 209 + ], + [ + 210, + 211 + ], + [ + 212, + 213 + ], + [ + 218, + 219 + ], + [ + 223, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 234 + ], + [ + 237, + 238 + ], + [ + 241, + 242 + ], + [ + 248, + 249 + ], + [ + 262, + 263 + ], + [ + 267, + 270 + ], + [ + 271, + 272 + ] + ] + } + }, + { + "filename": "libvips/conversion/replicate.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 12, + 40 + ], + [ + 70, + 85 + ], + [ + 99, + 106 + ], + [ + 107, + 124 + ], + [ + 130, + 221 + ], + [ + 233, + 247 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 73, + 74 + ], + [ + 76, + 78 + ], + [ + 81, + 82 + ], + [ + 102, + 103 + ], + [ + 110, + 112 + ], + [ + 113, + 115 + ], + [ + 116, + 117 + ], + [ + 119, + 121 + ], + [ + 133, + 134 + ], + [ + 140, + 141 + ], + [ + 144, + 148 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 159, + 161 + ], + [ + 162, + 164 + ], + [ + 165, + 168 + ], + [ + 172, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 183, + 185 + ], + [ + 186, + 187 + ], + [ + 192, + 193 + ], + [ + 195, + 198 + ], + [ + 199, + 200 + ], + [ + 201, + 204 + ], + [ + 205, + 207 + ], + [ + 208, + 211 + ], + [ + 212, + 214 + ], + [ + 217, + 218 + ], + [ + 236, + 237 + ], + [ + 241, + 244 + ], + [ + 245, + 246 + ] + ] + } + }, + { + "filename": "libvips/conversion/rot.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 9 + ], + [ + 28, + 62 + ], + [ + 93, + 111 + ], + [ + 124, + 153 + ], + [ + 154, + 173 + ], + [ + 186, + 216 + ], + [ + 217, + 236 + ], + [ + 249, + 278 + ], + [ + 279, + 312 + ], + [ + 336, + 388 + ], + [ + 393, + 417 + ], + [ + 426, + 442 + ], + [ + 451, + 467 + ], + [ + 476, + 490 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 31, + 32 + ], + [ + 37, + 38 + ], + [ + 39, + 43 + ], + [ + 44, + 53 + ], + [ + 58, + 59 + ], + [ + 96, + 97 + ], + [ + 99, + 101 + ], + [ + 107, + 108 + ], + [ + 127, + 130 + ], + [ + 132, + 134 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 144, + 147 + ], + [ + 148, + 150 + ], + [ + 157, + 158 + ], + [ + 161, + 163 + ], + [ + 169, + 170 + ], + [ + 189, + 191 + ], + [ + 194, + 195 + ], + [ + 198, + 199 + ], + [ + 201, + 202 + ], + [ + 205, + 208 + ], + [ + 211, + 213 + ], + [ + 220, + 221 + ], + [ + 224, + 226 + ], + [ + 232, + 233 + ], + [ + 252, + 255 + ], + [ + 257, + 259 + ], + [ + 262, + 263 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 282, + 283 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 294, + 296 + ], + [ + 297, + 299 + ], + [ + 300, + 302 + ], + [ + 303, + 304 + ], + [ + 305, + 307 + ], + [ + 308, + 309 + ], + [ + 339, + 343 + ], + [ + 344, + 345 + ], + [ + 348, + 349 + ], + [ + 350, + 352 + ], + [ + 353, + 354 + ], + [ + 359, + 360 + ], + [ + 362, + 365 + ], + [ + 366, + 367 + ], + [ + 368, + 371 + ], + [ + 372, + 374 + ], + [ + 377, + 378 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 396, + 398 + ], + [ + 404, + 405 + ], + [ + 409, + 412 + ], + [ + 413, + 414 + ], + [ + 429, + 430 + ], + [ + 434, + 437 + ], + [ + 438, + 439 + ], + [ + 454, + 455 + ], + [ + 459, + 462 + ], + [ + 463, + 464 + ], + [ + 479, + 480 + ], + [ + 484, + 487 + ], + [ + 488, + 489 + ] + ] + } + }, + { + "filename": "libvips/conversion/rot45.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 46 + ], + [ + 77, + 121 + ], + [ + 123, + 242 + ], + [ + 243, + 286 + ], + [ + 295, + 319 + ] + ], + "lines_added": [ + [ + 16, + 17 + ], + [ + 21, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 37 + ], + [ + 42, + 43 + ], + [ + 80, + 81 + ], + [ + 82, + 91 + ], + [ + 92, + 95 + ], + [ + 96, + 98 + ], + [ + 99, + 101 + ], + [ + 105, + 106 + ], + [ + 107, + 110 + ], + [ + 114, + 118 + ], + [ + 126, + 127 + ], + [ + 131, + 133 + ], + [ + 135, + 136 + ], + [ + 139, + 141 + ], + [ + 144, + 146 + ], + [ + 149, + 151 + ], + [ + 154, + 156 + ], + [ + 157, + 158 + ], + [ + 159, + 161 + ], + [ + 162, + 163 + ], + [ + 164, + 166 + ], + [ + 169, + 171 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 179, + 180 + ], + [ + 183, + 184 + ], + [ + 185, + 187 + ], + [ + 188, + 189 + ], + [ + 192, + 194 + ], + [ + 195, + 197 + ], + [ + 198, + 200 + ], + [ + 201, + 203 + ], + [ + 206, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 246, + 248 + ], + [ + 249, + 250 + ], + [ + 253, + 254 + ], + [ + 255, + 257 + ], + [ + 258, + 259 + ], + [ + 264, + 265 + ], + [ + 267, + 270 + ], + [ + 271, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 279 + ], + [ + 282, + 283 + ], + [ + 298, + 299 + ], + [ + 301, + 302 + ], + [ + 308, + 309 + ], + [ + 313, + 316 + ], + [ + 317, + 318 + ] + ] + } + }, + { + "filename": "libvips/conversion/scale.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 9 + ], + [ + 22, + 56 + ], + [ + 78, + 126 + ], + [ + 128, + 180 + ], + [ + 193, + 200 + ], + [ + 201, + 215 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 25, + 27 + ], + [ + 31, + 32 + ], + [ + 33, + 37 + ], + [ + 38, + 47 + ], + [ + 52, + 53 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 93, + 95 + ], + [ + 96, + 100 + ], + [ + 101, + 102 + ], + [ + 104, + 109 + ], + [ + 110, + 112 + ], + [ + 113, + 116 + ], + [ + 118, + 123 + ], + [ + 131, + 136 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 144, + 146 + ], + [ + 151, + 152 + ], + [ + 154, + 157 + ], + [ + 158, + 159 + ], + [ + 160, + 163 + ], + [ + 164, + 166 + ], + [ + 167, + 170 + ], + [ + 171, + 173 + ], + [ + 176, + 177 + ], + [ + 196, + 197 + ], + [ + 204, + 205 + ], + [ + 209, + 212 + ], + [ + 213, + 214 + ] + ] + } + }, + { + "filename": "libvips/conversion/sequential.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 8 + ], + [ + 29, + 57 + ], + [ + 99, + 199 + ], + [ + 202, + 273 + ], + [ + 286, + 294 + ], + [ + 297, + 311 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 4, + 5 + ], + [ + 32, + 33 + ], + [ + 34, + 38 + ], + [ + 39, + 48 + ], + [ + 53, + 54 + ], + [ + 102, + 103 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 115, + 117 + ], + [ + 119, + 120 + ], + [ + 122, + 126 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 131, + 132 + ], + [ + 135, + 138 + ], + [ + 140, + 144 + ], + [ + 148, + 152 + ], + [ + 157, + 158 + ], + [ + 159, + 161 + ], + [ + 163, + 164 + ], + [ + 169, + 171 + ], + [ + 172, + 174 + ], + [ + 176, + 178 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 192, + 193 + ], + [ + 194, + 196 + ], + [ + 205, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 229 + ], + [ + 230, + 231 + ], + [ + 237, + 238 + ], + [ + 240, + 243 + ], + [ + 244, + 245 + ], + [ + 246, + 249 + ], + [ + 250, + 252 + ], + [ + 253, + 256 + ], + [ + 257, + 259 + ], + [ + 260, + 263 + ], + [ + 264, + 266 + ], + [ + 269, + 270 + ], + [ + 289, + 291 + ], + [ + 300, + 301 + ], + [ + 305, + 308 + ], + [ + 309, + 310 + ] + ] + } + }, + { + "filename": "libvips/conversion/smartcrop.c", + "line_filter": { + "diff_chunks": [ + [ + 18, + 46 + ], + [ + 75, + 104 + ], + [ + 111, + 210 + ], + [ + 217, + 287 + ], + [ + 289, + 347 + ], + [ + 353, + 366 + ], + [ + 384, + 444 + ], + [ + 454, + 461 + ], + [ + 463, + 481 + ] + ], + "lines_added": [ + [ + 21, + 37 + ], + [ + 42, + 43 + ], + [ + 78, + 79 + ], + [ + 81, + 83 + ], + [ + 84, + 86 + ], + [ + 87, + 91 + ], + [ + 92, + 93 + ], + [ + 96, + 97 + ], + [ + 99, + 101 + ], + [ + 114, + 117 + ], + [ + 118, + 119 + ], + [ + 121, + 129 + ], + [ + 132, + 136 + ], + [ + 137, + 141 + ], + [ + 143, + 144 + ], + [ + 147, + 148 + ], + [ + 151, + 155 + ], + [ + 156, + 160 + ], + [ + 162, + 163 + ], + [ + 167, + 168 + ], + [ + 173, + 174 + ], + [ + 175, + 178 + ], + [ + 181, + 184 + ], + [ + 185, + 188 + ], + [ + 189, + 192 + ], + [ + 193, + 194 + ], + [ + 197, + 199 + ], + [ + 202, + 204 + ], + [ + 205, + 207 + ], + [ + 220, + 228 + ], + [ + 231, + 236 + ], + [ + 239, + 242 + ], + [ + 243, + 244 + ], + [ + 245, + 247 + ], + [ + 248, + 252 + ], + [ + 255, + 256 + ], + [ + 258, + 260 + ], + [ + 263, + 265 + ], + [ + 268, + 269 + ], + [ + 272, + 276 + ], + [ + 279, + 284 + ], + [ + 292, + 296 + ], + [ + 299, + 307 + ], + [ + 310, + 311 + ], + [ + 312, + 314 + ], + [ + 315, + 316 + ], + [ + 321, + 323 + ], + [ + 324, + 325 + ], + [ + 326, + 329 + ], + [ + 335, + 336 + ], + [ + 337, + 340 + ], + [ + 343, + 344 + ], + [ + 356, + 358 + ], + [ + 361, + 363 + ], + [ + 387, + 392 + ], + [ + 393, + 394 + ], + [ + 397, + 398 + ], + [ + 399, + 401 + ], + [ + 402, + 403 + ], + [ + 408, + 409 + ], + [ + 411, + 414 + ], + [ + 415, + 416 + ], + [ + 417, + 420 + ], + [ + 421, + 423 + ], + [ + 424, + 427 + ], + [ + 428, + 430 + ], + [ + 431, + 434 + ], + [ + 435, + 437 + ], + [ + 440, + 441 + ], + [ + 457, + 458 + ], + [ + 466, + 467 + ], + [ + 470, + 471 + ], + [ + 475, + 478 + ], + [ + 479, + 480 + ] + ] + } + }, + { + "filename": "libvips/conversion/subsample.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 60, + 67 + ], + [ + 68, + 96 + ], + [ + 98, + 116 + ], + [ + 120, + 134 + ], + [ + 136, + 160 + ], + [ + 161, + 223 + ], + [ + 224, + 301 + ], + [ + 317, + 339 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 63, + 64 + ], + [ + 71, + 72 + ], + [ + 77, + 78 + ], + [ + 81, + 83 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 93 + ], + [ + 101, + 103 + ], + [ + 107, + 108 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 123, + 125 + ], + [ + 128, + 131 + ], + [ + 139, + 140 + ], + [ + 145, + 147 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 156, + 157 + ], + [ + 164, + 166 + ], + [ + 170, + 171 + ], + [ + 177, + 179 + ], + [ + 182, + 184 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 197 + ], + [ + 201, + 203 + ], + [ + 204, + 206 + ], + [ + 207, + 213 + ], + [ + 217, + 220 + ], + [ + 227, + 232 + ], + [ + 234, + 236 + ], + [ + 237, + 239 + ], + [ + 240, + 241 + ], + [ + 243, + 247 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 254, + 256 + ], + [ + 261, + 262 + ], + [ + 268, + 271 + ], + [ + 272, + 273 + ], + [ + 274, + 277 + ], + [ + 278, + 280 + ], + [ + 281, + 284 + ], + [ + 285, + 287 + ], + [ + 288, + 291 + ], + [ + 292, + 294 + ], + [ + 297, + 298 + ], + [ + 320, + 321 + ], + [ + 324, + 325 + ], + [ + 328, + 329 + ], + [ + 333, + 336 + ], + [ + 337, + 338 + ] + ] + } + }, + { + "filename": "libvips/conversion/switch.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 55, + 111 + ], + [ + 114, + 227 + ], + [ + 230, + 243 + ], + [ + 245, + 259 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 58, + 59 + ], + [ + 60, + 63 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 74, + 76 + ], + [ + 77, + 79 + ], + [ + 80, + 83 + ], + [ + 85, + 91 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 117, + 118 + ], + [ + 119, + 121 + ], + [ + 125, + 131 + ], + [ + 133, + 137 + ], + [ + 140, + 143 + ], + [ + 147, + 150 + ], + [ + 154, + 157 + ], + [ + 159, + 163 + ], + [ + 165, + 168 + ], + [ + 169, + 173 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 180, + 183 + ], + [ + 188, + 190 + ], + [ + 194, + 197 + ], + [ + 198, + 206 + ], + [ + 209, + 210 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 219, + 222 + ], + [ + 223, + 224 + ], + [ + 233, + 236 + ], + [ + 239, + 240 + ], + [ + 248, + 249 + ], + [ + 253, + 256 + ], + [ + 257, + 258 + ] + ] + } + }, + { + "filename": "libvips/conversion/tilecache.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 39, + 67 + ], + [ + 86, + 93 + ], + [ + 103, + 128 + ], + [ + 129, + 208 + ], + [ + 211, + 241 + ], + [ + 243, + 486 + ], + [ + 491, + 502 + ], + [ + 506, + 560 + ], + [ + 570, + 619 + ], + [ + 621, + 665 + ], + [ + 666, + 706 + ], + [ + 707, + 735 + ], + [ + 739, + 829 + ], + [ + 842, + 859 + ], + [ + 870, + 886 + ], + [ + 889, + 927 + ], + [ + 928, + 1001 + ], + [ + 1011, + 1028 + ], + [ + 1031, + 1050 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 42, + 43 + ], + [ + 44, + 48 + ], + [ + 49, + 58 + ], + [ + 63, + 64 + ], + [ + 89, + 90 + ], + [ + 106, + 107 + ], + [ + 111, + 112 + ], + [ + 117, + 118 + ], + [ + 124, + 125 + ], + [ + 132, + 137 + ], + [ + 141, + 143 + ], + [ + 147, + 148 + ], + [ + 153, + 154 + ], + [ + 157, + 158 + ], + [ + 161, + 164 + ], + [ + 165, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 179, + 180 + ], + [ + 186, + 187 + ], + [ + 188, + 190 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 203, + 205 + ], + [ + 214, + 217 + ], + [ + 219, + 222 + ], + [ + 224, + 225 + ], + [ + 226, + 229 + ], + [ + 231, + 232 + ], + [ + 237, + 238 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 257, + 259 + ], + [ + 265, + 266 + ], + [ + 270, + 271 + ], + [ + 272, + 273 + ], + [ + 275, + 276 + ], + [ + 279, + 280 + ], + [ + 285, + 290 + ], + [ + 294, + 303 + ], + [ + 308, + 311 + ], + [ + 315, + 316 + ], + [ + 318, + 319 + ], + [ + 322, + 324 + ], + [ + 325, + 326 + ], + [ + 328, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 335 + ], + [ + 337, + 339 + ], + [ + 342, + 343 + ], + [ + 346, + 347 + ], + [ + 348, + 349 + ], + [ + 350, + 351 + ], + [ + 354, + 356 + ], + [ + 357, + 358 + ], + [ + 361, + 362 + ], + [ + 363, + 364 + ], + [ + 366, + 367 + ], + [ + 368, + 370 + ], + [ + 371, + 372 + ], + [ + 373, + 375 + ], + [ + 376, + 379 + ], + [ + 380, + 381 + ], + [ + 384, + 385 + ], + [ + 386, + 389 + ], + [ + 390, + 391 + ], + [ + 397, + 398 + ], + [ + 402, + 405 + ], + [ + 406, + 407 + ], + [ + 408, + 411 + ], + [ + 412, + 414 + ], + [ + 415, + 418 + ], + [ + 419, + 421 + ], + [ + 422, + 425 + ], + [ + 426, + 428 + ], + [ + 429, + 432 + ], + [ + 433, + 435 + ], + [ + 438, + 439 + ], + [ + 445, + 446 + ], + [ + 449, + 450 + ], + [ + 452, + 454 + ], + [ + 455, + 456 + ], + [ + 459, + 460 + ], + [ + 463, + 465 + ], + [ + 468, + 471 + ], + [ + 473, + 474 + ], + [ + 476, + 477 + ], + [ + 478, + 479 + ], + [ + 482, + 483 + ], + [ + 494, + 496 + ], + [ + 498, + 499 + ], + [ + 509, + 510 + ], + [ + 512, + 513 + ], + [ + 514, + 515 + ], + [ + 518, + 519 + ], + [ + 522, + 523 + ], + [ + 524, + 525 + ], + [ + 529, + 530 + ], + [ + 533, + 534 + ], + [ + 535, + 537 + ], + [ + 538, + 539 + ], + [ + 543, + 544 + ], + [ + 547, + 549 + ], + [ + 550, + 551 + ], + [ + 556, + 557 + ], + [ + 573, + 578 + ], + [ + 580, + 581 + ], + [ + 585, + 586 + ], + [ + 587, + 590 + ], + [ + 592, + 593 + ], + [ + 596, + 597 + ], + [ + 602, + 605 + ], + [ + 610, + 612 + ], + [ + 615, + 616 + ], + [ + 624, + 625 + ], + [ + 626, + 627 + ], + [ + 628, + 629 + ], + [ + 630, + 633 + ], + [ + 636, + 637 + ], + [ + 638, + 639 + ], + [ + 641, + 643 + ], + [ + 645, + 646 + ], + [ + 649, + 650 + ], + [ + 652, + 655 + ], + [ + 656, + 657 + ], + [ + 660, + 662 + ], + [ + 669, + 670 + ], + [ + 672, + 673 + ], + [ + 675, + 678 + ], + [ + 683, + 685 + ], + [ + 689, + 694 + ], + [ + 695, + 698 + ], + [ + 699, + 700 + ], + [ + 701, + 703 + ], + [ + 710, + 711 + ], + [ + 712, + 714 + ], + [ + 715, + 717 + ], + [ + 718, + 720 + ], + [ + 721, + 722 + ], + [ + 728, + 729 + ], + [ + 731, + 732 + ], + [ + 742, + 745 + ], + [ + 747, + 748 + ], + [ + 750, + 751 + ], + [ + 752, + 753 + ], + [ + 754, + 755 + ], + [ + 756, + 757 + ], + [ + 758, + 759 + ], + [ + 762, + 763 + ], + [ + 764, + 765 + ], + [ + 768, + 769 + ], + [ + 770, + 771 + ], + [ + 774, + 775 + ], + [ + 776, + 778 + ], + [ + 779, + 781 + ], + [ + 782, + 785 + ], + [ + 786, + 790 + ], + [ + 791, + 792 + ], + [ + 795, + 796 + ], + [ + 797, + 799 + ], + [ + 800, + 801 + ], + [ + 806, + 807 + ], + [ + 809, + 812 + ], + [ + 813, + 815 + ], + [ + 816, + 819 + ], + [ + 820, + 822 + ], + [ + 825, + 826 + ], + [ + 845, + 847 + ], + [ + 848, + 849 + ], + [ + 850, + 852 + ], + [ + 854, + 856 + ], + [ + 873, + 874 + ], + [ + 878, + 881 + ], + [ + 882, + 883 + ], + [ + 892, + 893 + ], + [ + 895, + 897 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 904, + 905 + ], + [ + 908, + 910 + ], + [ + 911, + 913 + ], + [ + 915, + 916 + ], + [ + 917, + 918 + ], + [ + 921, + 922 + ], + [ + 923, + 924 + ], + [ + 931, + 932 + ], + [ + 933, + 934 + ], + [ + 936, + 938 + ], + [ + 941, + 943 + ], + [ + 946, + 947 + ], + [ + 953, + 982 + ], + [ + 985, + 986 + ], + [ + 987, + 988 + ], + [ + 989, + 990 + ], + [ + 992, + 993 + ], + [ + 997, + 998 + ], + [ + 1014, + 1015 + ], + [ + 1017, + 1018 + ], + [ + 1019, + 1021 + ], + [ + 1023, + 1025 + ], + [ + 1034, + 1035 + ], + [ + 1039, + 1040 + ], + [ + 1044, + 1047 + ], + [ + 1048, + 1049 + ] + ] + } + }, + { + "filename": "libvips/conversion/transpose3d.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 55, + 81 + ], + [ + 99, + 185 + ], + [ + 192, + 225 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 58, + 59 + ], + [ + 61, + 63 + ], + [ + 67, + 68 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 102, + 104 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 114 + ], + [ + 118, + 120 + ], + [ + 123, + 126 + ], + [ + 127, + 131 + ], + [ + 133, + 137 + ], + [ + 139, + 144 + ], + [ + 145, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 156, + 158 + ], + [ + 163, + 164 + ], + [ + 166, + 169 + ], + [ + 170, + 171 + ], + [ + 172, + 175 + ], + [ + 176, + 178 + ], + [ + 181, + 182 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 204, + 205 + ], + [ + 207, + 208 + ], + [ + 214, + 215 + ], + [ + 219, + 222 + ], + [ + 223, + 224 + ] + ] + } + }, + { + "filename": "libvips/conversion/unpremultiply.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 43 + ], + [ + 72, + 349 + ], + [ + 358, + 379 + ], + [ + 381, + 388 + ], + [ + 390, + 404 + ] + ], + "lines_added": [ + [ + 18, + 34 + ], + [ + 39, + 40 + ], + [ + 75, + 76 + ], + [ + 80, + 99 + ], + [ + 102, + 120 + ], + [ + 121, + 130 + ], + [ + 134, + 153 + ], + [ + 154, + 172 + ], + [ + 173, + 182 + ], + [ + 184, + 186 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 198, + 200 + ], + [ + 201, + 204 + ], + [ + 205, + 209 + ], + [ + 210, + 213 + ], + [ + 214, + 217 + ], + [ + 218, + 221 + ], + [ + 222, + 225 + ], + [ + 226, + 229 + ], + [ + 230, + 233 + ], + [ + 234, + 237 + ], + [ + 238, + 243 + ], + [ + 245, + 246 + ], + [ + 249, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 255 + ], + [ + 258, + 260 + ], + [ + 261, + 262 + ], + [ + 263, + 266 + ], + [ + 269, + 271 + ], + [ + 272, + 274 + ], + [ + 275, + 278 + ], + [ + 282, + 285 + ], + [ + 287, + 288 + ], + [ + 289, + 290 + ], + [ + 292, + 293 + ], + [ + 297, + 301 + ], + [ + 302, + 303 + ], + [ + 306, + 307 + ], + [ + 308, + 311 + ], + [ + 312, + 313 + ], + [ + 318, + 319 + ], + [ + 323, + 326 + ], + [ + 327, + 328 + ], + [ + 329, + 332 + ], + [ + 333, + 335 + ], + [ + 336, + 339 + ], + [ + 340, + 342 + ], + [ + 345, + 346 + ], + [ + 361, + 363 + ], + [ + 366, + 368 + ], + [ + 374, + 376 + ], + [ + 384, + 385 + ], + [ + 393, + 394 + ], + [ + 398, + 401 + ], + [ + 402, + 403 + ] + ] + } + }, + { + "filename": "libvips/conversion/wrap.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 13 + ], + [ + 14, + 42 + ], + [ + 60, + 140 + ], + [ + 150, + 171 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 28 + ], + [ + 29, + 33 + ], + [ + 38, + 39 + ], + [ + 63, + 64 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 75, + 77 + ], + [ + 78, + 79 + ], + [ + 80, + 81 + ], + [ + 86, + 94 + ], + [ + 98, + 99 + ], + [ + 102, + 103 + ], + [ + 104, + 106 + ], + [ + 111, + 112 + ], + [ + 114, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 123 + ], + [ + 124, + 126 + ], + [ + 127, + 130 + ], + [ + 131, + 133 + ], + [ + 136, + 137 + ], + [ + 153, + 154 + ], + [ + 160, + 161 + ], + [ + 165, + 168 + ], + [ + 169, + 170 + ] + ] + } + }, + { + "filename": "libvips/conversion/zoom.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 20 + ], + [ + 27, + 60 + ], + [ + 78, + 101 + ], + [ + 108, + 135 + ], + [ + 140, + 148 + ], + [ + 150, + 161 + ], + [ + 168, + 187 + ], + [ + 190, + 207 + ], + [ + 210, + 218 + ], + [ + 228, + 243 + ], + [ + 244, + 397 + ], + [ + 406, + 424 + ] + ], + "lines_added": [ + [ + 16, + 17 + ], + [ + 30, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 46 + ], + [ + 51, + 52 + ], + [ + 55, + 57 + ], + [ + 81, + 82 + ], + [ + 88, + 89 + ], + [ + 93, + 95 + ], + [ + 96, + 98 + ], + [ + 111, + 112 + ], + [ + 115, + 116 + ], + [ + 119, + 122 + ], + [ + 127, + 128 + ], + [ + 130, + 132 + ], + [ + 143, + 145 + ], + [ + 153, + 155 + ], + [ + 156, + 158 + ], + [ + 171, + 172 + ], + [ + 177, + 178 + ], + [ + 181, + 184 + ], + [ + 193, + 194 + ], + [ + 196, + 197 + ], + [ + 203, + 204 + ], + [ + 213, + 215 + ], + [ + 231, + 232 + ], + [ + 238, + 240 + ], + [ + 247, + 249 + ], + [ + 254, + 258 + ], + [ + 264, + 267 + ], + [ + 269, + 273 + ], + [ + 279, + 281 + ], + [ + 285, + 286 + ], + [ + 288, + 291 + ], + [ + 293, + 296 + ], + [ + 298, + 301 + ], + [ + 303, + 305 + ], + [ + 306, + 307 + ], + [ + 310, + 311 + ], + [ + 312, + 314 + ], + [ + 316, + 321 + ], + [ + 324, + 329 + ], + [ + 330, + 333 + ], + [ + 334, + 337 + ], + [ + 341, + 344 + ], + [ + 347, + 351 + ], + [ + 352, + 353 + ], + [ + 356, + 357 + ], + [ + 358, + 361 + ], + [ + 366, + 367 + ], + [ + 371, + 374 + ], + [ + 375, + 376 + ], + [ + 377, + 380 + ], + [ + 381, + 383 + ], + [ + 384, + 387 + ], + [ + 388, + 390 + ], + [ + 393, + 394 + ], + [ + 409, + 410 + ], + [ + 413, + 414 + ], + [ + 418, + 421 + ], + [ + 422, + 423 + ] + ] + } + }, + { + "filename": "libvips/convolution/canny.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 49, + 57 + ], + [ + 59, + 296 + ], + [ + 298, + 311 + ], + [ + 324, + 477 + ], + [ + 488, + 519 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 52, + 54 + ], + [ + 62, + 63 + ], + [ + 68, + 69 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 88, + 93 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 104, + 106 + ], + [ + 111, + 128 + ], + [ + 129, + 130 + ], + [ + 132, + 133 + ], + [ + 134, + 154 + ], + [ + 155, + 156 + ], + [ + 158, + 160 + ], + [ + 162, + 163 + ], + [ + 165, + 166 + ], + [ + 167, + 169 + ], + [ + 170, + 177 + ], + [ + 178, + 179 + ], + [ + 184, + 185 + ], + [ + 188, + 189 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 204, + 205 + ], + [ + 208, + 209 + ], + [ + 211, + 212 + ], + [ + 216, + 217 + ], + [ + 223, + 224 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 233, + 236 + ], + [ + 238, + 242 + ], + [ + 243, + 244 + ], + [ + 246, + 279 + ], + [ + 280, + 281 + ], + [ + 283, + 285 + ], + [ + 287, + 288 + ], + [ + 292, + 293 + ], + [ + 301, + 303 + ], + [ + 306, + 308 + ], + [ + 327, + 332 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 343, + 344 + ], + [ + 347, + 348 + ], + [ + 351, + 352 + ], + [ + 358, + 359 + ], + [ + 361, + 364 + ], + [ + 368, + 372 + ], + [ + 373, + 374 + ], + [ + 377, + 378 + ], + [ + 380, + 381 + ], + [ + 384, + 386 + ], + [ + 389, + 393 + ], + [ + 395, + 397 + ], + [ + 403, + 405 + ], + [ + 410, + 414 + ], + [ + 415, + 417 + ], + [ + 419, + 420 + ], + [ + 421, + 423 + ], + [ + 424, + 425 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 432, + 433 + ], + [ + 438, + 439 + ], + [ + 443, + 446 + ], + [ + 447, + 448 + ], + [ + 449, + 454 + ], + [ + 455, + 458 + ], + [ + 459, + 461 + ], + [ + 462, + 468 + ], + [ + 471, + 472 + ], + [ + 473, + 474 + ], + [ + 491, + 492 + ], + [ + 497, + 499 + ], + [ + 500, + 502 + ], + [ + 504, + 505 + ], + [ + 507, + 509 + ], + [ + 513, + 516 + ], + [ + 517, + 518 + ] + ] + } + }, + { + "filename": "libvips/convolution/compass.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 11, + 39 + ], + [ + 50, + 135 + ], + [ + 140, + 210 + ], + [ + 237, + 252 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 30 + ], + [ + 35, + 36 + ], + [ + 53, + 59 + ], + [ + 63, + 64 + ], + [ + 66, + 67 + ], + [ + 73, + 74 + ], + [ + 78, + 79 + ], + [ + 80, + 82 + ], + [ + 83, + 91 + ], + [ + 93, + 104 + ], + [ + 108, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 118 + ], + [ + 122, + 126 + ], + [ + 130, + 132 + ], + [ + 143, + 145 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 159, + 160 + ], + [ + 162, + 203 + ], + [ + 206, + 207 + ], + [ + 240, + 242 + ], + [ + 246, + 249 + ], + [ + 250, + 251 + ] + ] + } + }, + { + "filename": "libvips/convolution/conv.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 9, + 37 + ], + [ + 49, + 160 + ], + [ + 173, + 180 + ], + [ + 182, + 215 + ], + [ + 219, + 234 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 28 + ], + [ + 33, + 34 + ], + [ + 52, + 55 + ], + [ + 59, + 60 + ], + [ + 62, + 63 + ], + [ + 66, + 67 + ], + [ + 70, + 72 + ], + [ + 73, + 74 + ], + [ + 79, + 81 + ], + [ + 84, + 86 + ], + [ + 88, + 89 + ], + [ + 90, + 93 + ], + [ + 96, + 99 + ], + [ + 102, + 108 + ], + [ + 114, + 116 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 124 + ], + [ + 130, + 131 + ], + [ + 133, + 153 + ], + [ + 156, + 157 + ], + [ + 176, + 177 + ], + [ + 185, + 186 + ], + [ + 187, + 189 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 195, + 197 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 205, + 208 + ], + [ + 211, + 212 + ], + [ + 222, + 224 + ], + [ + 228, + 231 + ], + [ + 232, + 233 + ] + ] + } + }, + { + "filename": "libvips/convolution/conva.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 13, + 41 + ], + [ + 44, + 51 + ], + [ + 70, + 80 + ], + [ + 102, + 109 + ], + [ + 115, + 122 + ], + [ + 141, + 148 + ], + [ + 162, + 169 + ], + [ + 188, + 195 + ], + [ + 202, + 232 + ], + [ + 233, + 313 + ], + [ + 319, + 350 + ], + [ + 355, + 430 + ], + [ + 431, + 447 + ], + [ + 449, + 461 + ], + [ + 463, + 477 + ], + [ + 478, + 504 + ], + [ + 507, + 571 + ], + [ + 572, + 653 + ], + [ + 657, + 670 + ], + [ + 675, + 730 + ], + [ + 732, + 768 + ], + [ + 769, + 877 + ], + [ + 879, + 890 + ], + [ + 895, + 966 + ], + [ + 967, + 1107 + ], + [ + 1110, + 1121 + ], + [ + 1126, + 1324 + ], + [ + 1333, + 1350 + ], + [ + 1354, + 1369 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 7, + 8 + ], + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 32 + ], + [ + 37, + 38 + ], + [ + 47, + 48 + ], + [ + 73, + 74 + ], + [ + 75, + 77 + ], + [ + 105, + 106 + ], + [ + 118, + 119 + ], + [ + 144, + 145 + ], + [ + 165, + 166 + ], + [ + 191, + 192 + ], + [ + 205, + 206 + ], + [ + 210, + 211 + ], + [ + 212, + 214 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 226, + 227 + ], + [ + 228, + 229 + ], + [ + 236, + 239 + ], + [ + 242, + 245 + ], + [ + 248, + 249 + ], + [ + 253, + 254 + ], + [ + 257, + 260 + ], + [ + 262, + 265 + ], + [ + 266, + 268 + ], + [ + 270, + 273 + ], + [ + 274, + 275 + ], + [ + 276, + 278 + ], + [ + 282, + 283 + ], + [ + 286, + 299 + ], + [ + 305, + 306 + ], + [ + 309, + 310 + ], + [ + 322, + 325 + ], + [ + 327, + 329 + ], + [ + 335, + 336 + ], + [ + 337, + 338 + ], + [ + 340, + 342 + ], + [ + 346, + 347 + ], + [ + 358, + 359 + ], + [ + 365, + 366 + ], + [ + 368, + 370 + ], + [ + 372, + 377 + ], + [ + 381, + 386 + ], + [ + 391, + 395 + ], + [ + 399, + 402 + ], + [ + 404, + 405 + ], + [ + 410, + 411 + ], + [ + 412, + 413 + ], + [ + 414, + 416 + ], + [ + 422, + 423 + ], + [ + 426, + 427 + ], + [ + 434, + 435 + ], + [ + 436, + 437 + ], + [ + 442, + 444 + ], + [ + 452, + 453 + ], + [ + 457, + 458 + ], + [ + 466, + 467 + ], + [ + 473, + 474 + ], + [ + 481, + 483 + ], + [ + 485, + 486 + ], + [ + 488, + 489 + ], + [ + 491, + 493 + ], + [ + 499, + 501 + ], + [ + 510, + 511 + ], + [ + 516, + 517 + ], + [ + 523, + 524 + ], + [ + 526, + 527 + ], + [ + 531, + 532 + ], + [ + 534, + 535 + ], + [ + 540, + 541 + ], + [ + 543, + 544 + ], + [ + 546, + 547 + ], + [ + 551, + 552 + ], + [ + 558, + 559 + ], + [ + 562, + 563 + ], + [ + 566, + 568 + ], + [ + 575, + 577 + ], + [ + 579, + 581 + ], + [ + 584, + 586 + ], + [ + 591, + 592 + ], + [ + 596, + 598 + ], + [ + 599, + 601 + ], + [ + 602, + 603 + ], + [ + 606, + 607 + ], + [ + 610, + 611 + ], + [ + 614, + 616 + ], + [ + 618, + 619 + ], + [ + 624, + 630 + ], + [ + 634, + 635 + ], + [ + 638, + 640 + ], + [ + 644, + 646 + ], + [ + 649, + 650 + ], + [ + 660, + 662 + ], + [ + 663, + 664 + ], + [ + 665, + 667 + ], + [ + 678, + 679 + ], + [ + 684, + 685 + ], + [ + 686, + 687 + ], + [ + 688, + 689 + ], + [ + 690, + 692 + ], + [ + 697, + 699 + ], + [ + 702, + 706 + ], + [ + 710, + 711 + ], + [ + 714, + 715 + ], + [ + 721, + 722 + ], + [ + 725, + 727 + ], + [ + 735, + 738 + ], + [ + 744, + 746 + ], + [ + 747, + 748 + ], + [ + 752, + 754 + ], + [ + 759, + 762 + ], + [ + 764, + 765 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ], + [ + 776, + 777 + ], + [ + 779, + 780 + ], + [ + 781, + 782 + ], + [ + 784, + 785 + ], + [ + 790, + 791 + ], + [ + 794, + 795 + ], + [ + 796, + 797 + ], + [ + 802, + 803 + ], + [ + 809, + 810 + ], + [ + 811, + 812 + ], + [ + 815, + 817 + ], + [ + 818, + 820 + ], + [ + 821, + 823 + ], + [ + 824, + 825 + ], + [ + 827, + 828 + ], + [ + 834, + 852 + ], + [ + 855, + 865 + ], + [ + 867, + 868 + ], + [ + 872, + 874 + ], + [ + 882, + 883 + ], + [ + 886, + 887 + ], + [ + 898, + 900 + ], + [ + 901, + 905 + ], + [ + 906, + 907 + ], + [ + 908, + 909 + ], + [ + 911, + 912 + ], + [ + 917, + 922 + ], + [ + 923, + 924 + ], + [ + 926, + 929 + ], + [ + 930, + 931 + ], + [ + 933, + 935 + ], + [ + 937, + 939 + ], + [ + 941, + 943 + ], + [ + 945, + 947 + ], + [ + 949, + 951 + ], + [ + 953, + 955 + ], + [ + 957, + 959 + ], + [ + 961, + 963 + ], + [ + 970, + 971 + ], + [ + 974, + 975 + ], + [ + 976, + 977 + ], + [ + 981, + 985 + ], + [ + 987, + 991 + ], + [ + 996, + 1007 + ], + [ + 1009, + 1074 + ], + [ + 1076, + 1078 + ], + [ + 1080, + 1095 + ], + [ + 1097, + 1098 + ], + [ + 1099, + 1100 + ], + [ + 1102, + 1104 + ], + [ + 1113, + 1114 + ], + [ + 1117, + 1118 + ], + [ + 1129, + 1131 + ], + [ + 1132, + 1136 + ], + [ + 1137, + 1138 + ], + [ + 1139, + 1140 + ], + [ + 1142, + 1144 + ], + [ + 1145, + 1146 + ], + [ + 1150, + 1155 + ], + [ + 1156, + 1158 + ], + [ + 1160, + 1164 + ], + [ + 1165, + 1167 + ], + [ + 1169, + 1172 + ], + [ + 1174, + 1176 + ], + [ + 1178, + 1180 + ], + [ + 1182, + 1184 + ], + [ + 1186, + 1188 + ], + [ + 1190, + 1192 + ], + [ + 1194, + 1196 + ], + [ + 1198, + 1200 + ], + [ + 1206, + 1207 + ], + [ + 1210, + 1211 + ], + [ + 1212, + 1213 + ], + [ + 1218, + 1222 + ], + [ + 1224, + 1228 + ], + [ + 1232, + 1236 + ], + [ + 1237, + 1238 + ], + [ + 1241, + 1242 + ], + [ + 1245, + 1246 + ], + [ + 1249, + 1251 + ], + [ + 1254, + 1257 + ], + [ + 1259, + 1261 + ], + [ + 1265, + 1267 + ], + [ + 1268, + 1274 + ], + [ + 1276, + 1281 + ], + [ + 1285, + 1286 + ], + [ + 1289, + 1290 + ], + [ + 1291, + 1292 + ], + [ + 1298, + 1299 + ], + [ + 1301, + 1314 + ], + [ + 1317, + 1318 + ], + [ + 1319, + 1321 + ], + [ + 1336, + 1338 + ], + [ + 1339, + 1341 + ], + [ + 1346, + 1347 + ], + [ + 1357, + 1359 + ], + [ + 1363, + 1366 + ], + [ + 1367, + 1368 + ] + ] + } + }, + { + "filename": "libvips/convolution/convasep.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 13, + 41 + ], + [ + 44, + 51 + ], + [ + 53, + 69 + ], + [ + 96, + 108 + ], + [ + 113, + 121 + ], + [ + 132, + 172 + ], + [ + 177, + 195 + ], + [ + 197, + 214 + ], + [ + 225, + 262 + ], + [ + 268, + 277 + ], + [ + 282, + 290 + ], + [ + 291, + 311 + ], + [ + 312, + 337 + ], + [ + 338, + 551 + ], + [ + 553, + 564 + ], + [ + 569, + 631 + ], + [ + 632, + 727 + ], + [ + 729, + 740 + ], + [ + 745, + 828 + ], + [ + 830, + 928 + ], + [ + 936, + 973 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 7, + 8 + ], + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 32 + ], + [ + 37, + 38 + ], + [ + 47, + 48 + ], + [ + 56, + 57 + ], + [ + 61, + 62 + ], + [ + 64, + 66 + ], + [ + 99, + 100 + ], + [ + 101, + 103 + ], + [ + 104, + 105 + ], + [ + 116, + 118 + ], + [ + 135, + 136 + ], + [ + 138, + 139 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 151, + 154 + ], + [ + 157, + 158 + ], + [ + 163, + 164 + ], + [ + 166, + 169 + ], + [ + 180, + 183 + ], + [ + 188, + 190 + ], + [ + 191, + 192 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 205, + 206 + ], + [ + 210, + 211 + ], + [ + 228, + 229 + ], + [ + 232, + 237 + ], + [ + 240, + 243 + ], + [ + 247, + 250 + ], + [ + 255, + 259 + ], + [ + 271, + 274 + ], + [ + 285, + 287 + ], + [ + 294, + 297 + ], + [ + 303, + 304 + ], + [ + 306, + 308 + ], + [ + 315, + 319 + ], + [ + 321, + 323 + ], + [ + 324, + 325 + ], + [ + 326, + 327 + ], + [ + 328, + 331 + ], + [ + 333, + 334 + ], + [ + 341, + 342 + ], + [ + 343, + 344 + ], + [ + 349, + 351 + ], + [ + 352, + 353 + ], + [ + 358, + 359 + ], + [ + 362, + 367 + ], + [ + 368, + 369 + ], + [ + 374, + 375 + ], + [ + 381, + 383 + ], + [ + 387, + 390 + ], + [ + 392, + 394 + ], + [ + 395, + 396 + ], + [ + 398, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 452 + ], + [ + 457, + 469 + ], + [ + 470, + 474 + ], + [ + 476, + 480 + ], + [ + 481, + 482 + ], + [ + 484, + 498 + ], + [ + 499, + 500 + ], + [ + 501, + 513 + ], + [ + 514, + 518 + ], + [ + 520, + 524 + ], + [ + 527, + 540 + ], + [ + 541, + 542 + ], + [ + 546, + 548 + ], + [ + 556, + 557 + ], + [ + 560, + 561 + ], + [ + 572, + 574 + ], + [ + 578, + 582 + ], + [ + 583, + 584 + ], + [ + 585, + 586 + ], + [ + 588, + 589 + ], + [ + 594, + 598 + ], + [ + 600, + 602 + ], + [ + 604, + 606 + ], + [ + 608, + 610 + ], + [ + 612, + 614 + ], + [ + 616, + 618 + ], + [ + 620, + 623 + ], + [ + 625, + 628 + ], + [ + 635, + 636 + ], + [ + 638, + 650 + ], + [ + 651, + 655 + ], + [ + 659, + 660 + ], + [ + 662, + 677 + ], + [ + 678, + 679 + ], + [ + 680, + 692 + ], + [ + 693, + 697 + ], + [ + 702, + 715 + ], + [ + 716, + 717 + ], + [ + 722, + 724 + ], + [ + 732, + 733 + ], + [ + 736, + 737 + ], + [ + 748, + 750 + ], + [ + 754, + 757 + ], + [ + 758, + 759 + ], + [ + 760, + 761 + ], + [ + 763, + 764 + ], + [ + 769, + 772 + ], + [ + 774, + 776 + ], + [ + 778, + 780 + ], + [ + 782, + 784 + ], + [ + 786, + 788 + ], + [ + 790, + 792 + ], + [ + 794, + 797 + ], + [ + 799, + 802 + ], + [ + 808, + 809 + ], + [ + 812, + 814 + ], + [ + 815, + 816 + ], + [ + 819, + 823 + ], + [ + 824, + 825 + ], + [ + 833, + 838 + ], + [ + 840, + 843 + ], + [ + 844, + 845 + ], + [ + 847, + 849 + ], + [ + 850, + 851 + ], + [ + 853, + 854 + ], + [ + 857, + 859 + ], + [ + 860, + 862 + ], + [ + 865, + 868 + ], + [ + 871, + 873 + ], + [ + 874, + 880 + ], + [ + 882, + 889 + ], + [ + 893, + 895 + ], + [ + 896, + 897 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 909, + 911 + ], + [ + 913, + 919 + ], + [ + 922, + 923 + ], + [ + 924, + 925 + ], + [ + 939, + 941 + ], + [ + 942, + 945 + ], + [ + 950, + 951 + ], + [ + 954, + 956 + ], + [ + 961, + 963 + ], + [ + 967, + 970 + ], + [ + 971, + 972 + ] + ] + } + }, + { + "filename": "libvips/convolution/convf.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 31 + ], + [ + 55, + 83 + ], + [ + 99, + 200 + ], + [ + 204, + 267 + ], + [ + 268, + 287 + ], + [ + 289, + 316 + ], + [ + 318, + 325 + ], + [ + 326, + 344 + ], + [ + 345, + 382 + ], + [ + 386, + 416 + ] + ], + "lines_added": [ + [ + 19, + 20 + ], + [ + 22, + 23 + ], + [ + 27, + 28 + ], + [ + 58, + 59 + ], + [ + 60, + 64 + ], + [ + 65, + 74 + ], + [ + 79, + 80 + ], + [ + 102, + 104 + ], + [ + 108, + 109 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 130, + 131 + ], + [ + 136, + 137 + ], + [ + 142, + 144 + ], + [ + 149, + 153 + ], + [ + 155, + 156 + ], + [ + 158, + 176 + ], + [ + 180, + 181 + ], + [ + 186, + 187 + ], + [ + 189, + 190 + ], + [ + 191, + 192 + ], + [ + 194, + 197 + ], + [ + 207, + 209 + ], + [ + 210, + 211 + ], + [ + 213, + 215 + ], + [ + 216, + 217 + ], + [ + 221, + 225 + ], + [ + 228, + 229 + ], + [ + 230, + 234 + ], + [ + 236, + 238 + ], + [ + 240, + 242 + ], + [ + 244, + 246 + ], + [ + 248, + 250 + ], + [ + 252, + 254 + ], + [ + 256, + 259 + ], + [ + 261, + 264 + ], + [ + 271, + 272 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 279, + 280 + ], + [ + 283, + 284 + ], + [ + 292, + 294 + ], + [ + 296, + 297 + ], + [ + 301, + 303 + ], + [ + 305, + 308 + ], + [ + 311, + 313 + ], + [ + 321, + 322 + ], + [ + 329, + 336 + ], + [ + 337, + 341 + ], + [ + 348, + 349 + ], + [ + 353, + 356 + ], + [ + 360, + 361 + ], + [ + 364, + 365 + ], + [ + 369, + 370 + ], + [ + 374, + 375 + ], + [ + 376, + 379 + ], + [ + 389, + 390 + ], + [ + 394, + 395 + ], + [ + 396, + 397 + ], + [ + 398, + 399 + ], + [ + 404, + 406 + ], + [ + 410, + 413 + ], + [ + 414, + 415 + ] + ] + } + }, + { + "filename": "libvips/convolution/convi.c", + "line_filter": { + "diff_chunks": [ + [ + 30, + 42 + ], + [ + 75, + 114 + ], + [ + 131, + 160 + ], + [ + 166, + 255 + ], + [ + 257, + 306 + ], + [ + 308, + 343 + ], + [ + 348, + 392 + ], + [ + 393, + 487 + ], + [ + 488, + 495 + ], + [ + 497, + 505 + ], + [ + 507, + 693 + ], + [ + 697, + 760 + ], + [ + 761, + 772 + ], + [ + 774, + 781 + ], + [ + 783, + 794 + ], + [ + 801, + 843 + ], + [ + 845, + 852 + ], + [ + 855, + 895 + ], + [ + 897, + 1014 + ], + [ + 1015, + 1073 + ], + [ + 1074, + 1109 + ], + [ + 1112, + 1132 + ], + [ + 1133, + 1148 + ] + ], + "lines_added": [ + [ + 33, + 34 + ], + [ + 38, + 39 + ], + [ + 78, + 79 + ], + [ + 85, + 86 + ], + [ + 87, + 91 + ], + [ + 92, + 101 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 134, + 135 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 150, + 151 + ], + [ + 156, + 157 + ], + [ + 169, + 170 + ], + [ + 174, + 176 + ], + [ + 180, + 181 + ], + [ + 186, + 187 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 193, + 194 + ], + [ + 200, + 201 + ], + [ + 204, + 206 + ], + [ + 207, + 208 + ], + [ + 211, + 212 + ], + [ + 216, + 219 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 229, + 230 + ], + [ + 233, + 237 + ], + [ + 238, + 239 + ], + [ + 244, + 245 + ], + [ + 250, + 252 + ], + [ + 260, + 261 + ], + [ + 264, + 268 + ], + [ + 273, + 281 + ], + [ + 284, + 285 + ], + [ + 287, + 293 + ], + [ + 295, + 296 + ], + [ + 302, + 303 + ], + [ + 311, + 312 + ], + [ + 314, + 315 + ], + [ + 318, + 319 + ], + [ + 322, + 325 + ], + [ + 327, + 329 + ], + [ + 330, + 331 + ], + [ + 333, + 335 + ], + [ + 336, + 338 + ], + [ + 339, + 340 + ], + [ + 351, + 352 + ], + [ + 356, + 357 + ], + [ + 360, + 362 + ], + [ + 363, + 366 + ], + [ + 371, + 372 + ], + [ + 373, + 375 + ], + [ + 378, + 382 + ], + [ + 384, + 385 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 396, + 397 + ], + [ + 398, + 400 + ], + [ + 402, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 410 + ], + [ + 414, + 415 + ], + [ + 418, + 419 + ], + [ + 424, + 425 + ], + [ + 426, + 427 + ], + [ + 428, + 429 + ], + [ + 432, + 433 + ], + [ + 434, + 436 + ], + [ + 437, + 439 + ], + [ + 440, + 441 + ], + [ + 442, + 444 + ], + [ + 445, + 446 + ], + [ + 449, + 450 + ], + [ + 456, + 457 + ], + [ + 459, + 461 + ], + [ + 467, + 469 + ], + [ + 471, + 472 + ], + [ + 475, + 477 + ], + [ + 478, + 479 + ], + [ + 482, + 484 + ], + [ + 491, + 492 + ], + [ + 500, + 502 + ], + [ + 510, + 517 + ], + [ + 518, + 519 + ], + [ + 520, + 522 + ], + [ + 524, + 534 + ], + [ + 539, + 541 + ], + [ + 542, + 548 + ], + [ + 549, + 550 + ], + [ + 553, + 554 + ], + [ + 556, + 559 + ], + [ + 561, + 563 + ], + [ + 566, + 567 + ], + [ + 568, + 569 + ], + [ + 570, + 571 + ], + [ + 575, + 597 + ], + [ + 600, + 620 + ], + [ + 623, + 666 + ], + [ + 670, + 672 + ], + [ + 677, + 678 + ], + [ + 679, + 680 + ], + [ + 682, + 683 + ], + [ + 684, + 685 + ], + [ + 687, + 690 + ], + [ + 700, + 702 + ], + [ + 703, + 704 + ], + [ + 706, + 708 + ], + [ + 709, + 710 + ], + [ + 714, + 718 + ], + [ + 721, + 722 + ], + [ + 723, + 727 + ], + [ + 729, + 731 + ], + [ + 733, + 735 + ], + [ + 737, + 739 + ], + [ + 741, + 743 + ], + [ + 745, + 747 + ], + [ + 749, + 752 + ], + [ + 754, + 757 + ], + [ + 764, + 765 + ], + [ + 766, + 767 + ], + [ + 768, + 769 + ], + [ + 777, + 778 + ], + [ + 786, + 791 + ], + [ + 804, + 816 + ], + [ + 817, + 818 + ], + [ + 823, + 826 + ], + [ + 828, + 829 + ], + [ + 830, + 832 + ], + [ + 834, + 836 + ], + [ + 837, + 838 + ], + [ + 839, + 840 + ], + [ + 848, + 849 + ], + [ + 858, + 860 + ], + [ + 863, + 867 + ], + [ + 868, + 871 + ], + [ + 873, + 883 + ], + [ + 888, + 890 + ], + [ + 891, + 892 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 905, + 906 + ], + [ + 907, + 911 + ], + [ + 917, + 921 + ], + [ + 922, + 923 + ], + [ + 924, + 928 + ], + [ + 932, + 944 + ], + [ + 949, + 966 + ], + [ + 967, + 968 + ], + [ + 969, + 974 + ], + [ + 975, + 979 + ], + [ + 981, + 982 + ], + [ + 985, + 986 + ], + [ + 989, + 990 + ], + [ + 995, + 996 + ], + [ + 997, + 999 + ], + [ + 1004, + 1011 + ], + [ + 1018, + 1022 + ], + [ + 1023, + 1024 + ], + [ + 1026, + 1027 + ], + [ + 1031, + 1033 + ], + [ + 1036, + 1038 + ], + [ + 1040, + 1045 + ], + [ + 1046, + 1047 + ], + [ + 1049, + 1051 + ], + [ + 1056, + 1057 + ], + [ + 1059, + 1060 + ], + [ + 1066, + 1070 + ], + [ + 1077, + 1080 + ], + [ + 1084, + 1085 + ], + [ + 1088, + 1089 + ], + [ + 1090, + 1091 + ], + [ + 1096, + 1097 + ], + [ + 1101, + 1102 + ], + [ + 1103, + 1106 + ], + [ + 1115, + 1117 + ], + [ + 1119, + 1120 + ], + [ + 1125, + 1126 + ], + [ + 1128, + 1129 + ], + [ + 1136, + 1138 + ], + [ + 1142, + 1145 + ], + [ + 1146, + 1147 + ] + ] + } + }, + { + "filename": "libvips/convolution/convolution.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 51, + 58 + ], + [ + 62, + 78 + ], + [ + 80, + 124 + ], + [ + 125, + 152 + ], + [ + 153, + 186 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 32, + 33 + ], + [ + 54, + 55 + ], + [ + 65, + 66 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 83, + 85 + ], + [ + 87, + 88 + ], + [ + 89, + 92 + ], + [ + 94, + 97 + ], + [ + 99, + 101 + ], + [ + 102, + 104 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 115 + ], + [ + 120, + 121 + ], + [ + 128, + 131 + ], + [ + 132, + 133 + ], + [ + 134, + 139 + ], + [ + 140, + 145 + ], + [ + 148, + 149 + ], + [ + 156, + 157 + ], + [ + 158, + 185 + ] + ] + } + }, + { + "filename": "libvips/convolution/convsep.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 9, + 37 + ], + [ + 48, + 156 + ], + [ + 172, + 181 + ], + [ + 182, + 197 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 28 + ], + [ + 33, + 34 + ], + [ + 51, + 54 + ], + [ + 58, + 59 + ], + [ + 61, + 62 + ], + [ + 63, + 64 + ], + [ + 66, + 68 + ], + [ + 71, + 72 + ], + [ + 73, + 75 + ], + [ + 76, + 78 + ], + [ + 81, + 86 + ], + [ + 88, + 89 + ], + [ + 91, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 102 + ], + [ + 105, + 107 + ], + [ + 110, + 112 + ], + [ + 113, + 114 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 126, + 127 + ], + [ + 129, + 149 + ], + [ + 152, + 153 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 185, + 187 + ], + [ + 191, + 194 + ], + [ + 195, + 196 + ] + ] + } + }, + { + "filename": "libvips/convolution/correlation.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 45, + 63 + ], + [ + 67, + 172 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 48, + 50 + ], + [ + 52, + 54 + ], + [ + 57, + 60 + ], + [ + 70, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 79, + 80 + ], + [ + 81, + 83 + ], + [ + 84, + 85 + ], + [ + 86, + 88 + ], + [ + 91, + 102 + ], + [ + 106, + 107 + ], + [ + 111, + 115 + ], + [ + 117, + 118 + ], + [ + 119, + 131 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ], + [ + 144, + 145 + ], + [ + 149, + 152 + ], + [ + 153, + 154 + ], + [ + 155, + 160 + ], + [ + 161, + 166 + ], + [ + 169, + 170 + ] + ] + } + }, + { + "filename": "libvips/convolution/correlation.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 72, + 95 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 75, + 76 + ], + [ + 81, + 82 + ], + [ + 83, + 85 + ], + [ + 88, + 89 + ] + ] + } + }, + { + "filename": "libvips/convolution/fastcor.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 19 + ], + [ + 28, + 56 + ], + [ + 69, + 189 + ], + [ + 198, + 205 + ], + [ + 207, + 227 + ], + [ + 234, + 253 + ], + [ + 254, + 269 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 31, + 32 + ], + [ + 33, + 37 + ], + [ + 38, + 47 + ], + [ + 52, + 53 + ], + [ + 72, + 98 + ], + [ + 99, + 101 + ], + [ + 102, + 129 + ], + [ + 130, + 132 + ], + [ + 133, + 135 + ], + [ + 137, + 139 + ], + [ + 142, + 145 + ], + [ + 148, + 152 + ], + [ + 153, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 164 + ], + [ + 165, + 168 + ], + [ + 169, + 172 + ], + [ + 173, + 177 + ], + [ + 178, + 181 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 201, + 202 + ], + [ + 210, + 211 + ], + [ + 213, + 214 + ], + [ + 216, + 217 + ], + [ + 223, + 224 + ], + [ + 237, + 238 + ], + [ + 240, + 242 + ], + [ + 243, + 245 + ], + [ + 249, + 250 + ], + [ + 257, + 259 + ], + [ + 263, + 266 + ], + [ + 267, + 268 + ] + ] + } + }, + { + "filename": "libvips/convolution/gaussblur.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 11, + 39 + ], + [ + 57, + 174 + ], + [ + 184, + 205 + ] + ], + "lines_added": [ + [ + 1, + 3 + ], + [ + 14, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 35, + 36 + ], + [ + 60, + 63 + ], + [ + 68, + 69 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 76, + 78 + ], + [ + 82, + 85 + ], + [ + 87, + 93 + ], + [ + 95, + 97 + ], + [ + 99, + 100 + ], + [ + 101, + 105 + ], + [ + 107, + 108 + ], + [ + 109, + 111 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 126, + 127 + ], + [ + 131, + 134 + ], + [ + 135, + 136 + ], + [ + 137, + 142 + ], + [ + 143, + 146 + ], + [ + 147, + 149 + ], + [ + 150, + 153 + ], + [ + 154, + 156 + ], + [ + 157, + 163 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 193, + 195 + ], + [ + 199, + 202 + ], + [ + 203, + 204 + ] + ] + } + }, + { + "filename": "libvips/convolution/pconvolution.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 71, + 81 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 74, + 75 + ] + ] + } + }, + { + "filename": "libvips/convolution/sharpen.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 9 + ], + [ + 22, + 29 + ], + [ + 45, + 73 + ], + [ + 91, + 98 + ], + [ + 100, + 107 + ], + [ + 110, + 143 + ], + [ + 148, + 391 + ], + [ + 404, + 411 + ], + [ + 415, + 427 + ], + [ + 443, + 472 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 5, + 6 + ], + [ + 25, + 26 + ], + [ + 48, + 54 + ], + [ + 55, + 59 + ], + [ + 60, + 64 + ], + [ + 69, + 70 + ], + [ + 94, + 95 + ], + [ + 103, + 104 + ], + [ + 113, + 114 + ], + [ + 116, + 118 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 126, + 128 + ], + [ + 129, + 130 + ], + [ + 131, + 138 + ], + [ + 139, + 140 + ], + [ + 151, + 153 + ], + [ + 155, + 157 + ], + [ + 158, + 159 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 175, + 177 + ], + [ + 182, + 183 + ], + [ + 184, + 186 + ], + [ + 190, + 192 + ], + [ + 194, + 195 + ], + [ + 197, + 199 + ], + [ + 201, + 205 + ], + [ + 206, + 208 + ], + [ + 209, + 214 + ], + [ + 216, + 218 + ], + [ + 222, + 224 + ], + [ + 225, + 226 + ], + [ + 231, + 232 + ], + [ + 236, + 237 + ], + [ + 240, + 241 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 251, + 252 + ], + [ + 255, + 265 + ], + [ + 269, + 272 + ], + [ + 273, + 275 + ], + [ + 277, + 280 + ], + [ + 281, + 285 + ], + [ + 286, + 287 + ], + [ + 290, + 294 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 305, + 306 + ], + [ + 311, + 312 + ], + [ + 316, + 319 + ], + [ + 320, + 321 + ], + [ + 322, + 327 + ], + [ + 328, + 331 + ], + [ + 332, + 334 + ], + [ + 335, + 338 + ], + [ + 339, + 341 + ], + [ + 342, + 345 + ], + [ + 346, + 348 + ], + [ + 349, + 352 + ], + [ + 353, + 355 + ], + [ + 356, + 359 + ], + [ + 360, + 362 + ], + [ + 363, + 366 + ], + [ + 367, + 369 + ], + [ + 372, + 375 + ], + [ + 376, + 378 + ], + [ + 381, + 382 + ], + [ + 385, + 388 + ], + [ + 407, + 408 + ], + [ + 418, + 419 + ], + [ + 420, + 422 + ], + [ + 423, + 424 + ], + [ + 446, + 448 + ], + [ + 449, + 454 + ], + [ + 457, + 458 + ], + [ + 460, + 462 + ], + [ + 466, + 469 + ], + [ + 470, + 471 + ] + ] + } + }, + { + "filename": "libvips/convolution/sobel.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 59, + 109 + ], + [ + 110, + 228 + ], + [ + 234, + 252 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 62, + 63 + ], + [ + 65, + 67 + ], + [ + 69, + 70 + ], + [ + 74, + 76 + ], + [ + 77, + 84 + ], + [ + 85, + 86 + ], + [ + 88, + 89 + ], + [ + 94, + 95 + ], + [ + 100, + 101 + ], + [ + 102, + 104 + ], + [ + 105, + 106 + ], + [ + 113, + 126 + ], + [ + 127, + 129 + ], + [ + 130, + 131 + ], + [ + 135, + 138 + ], + [ + 139, + 143 + ], + [ + 144, + 145 + ], + [ + 150, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 156 + ], + [ + 157, + 165 + ], + [ + 166, + 171 + ], + [ + 172, + 173 + ], + [ + 174, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 185, + 188 + ], + [ + 190, + 192 + ], + [ + 194, + 195 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 207, + 208 + ], + [ + 210, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 221 + ], + [ + 224, + 225 + ], + [ + 237, + 238 + ], + [ + 240, + 242 + ], + [ + 246, + 249 + ], + [ + 250, + 251 + ] + ] + } + }, + { + "filename": "libvips/convolution/spcor.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 18 + ], + [ + 42, + 70 + ], + [ + 87, + 216 + ], + [ + 218, + 266 + ], + [ + 271, + 280 + ], + [ + 306, + 319 + ], + [ + 320, + 327 + ], + [ + 338, + 346 + ], + [ + 352, + 363 + ], + [ + 367, + 382 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 14, + 15 + ], + [ + 45, + 46 + ], + [ + 47, + 51 + ], + [ + 52, + 61 + ], + [ + 66, + 67 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 106, + 114 + ], + [ + 117, + 119 + ], + [ + 122, + 131 + ], + [ + 132, + 136 + ], + [ + 139, + 147 + ], + [ + 148, + 149 + ], + [ + 151, + 152 + ], + [ + 154, + 170 + ], + [ + 171, + 202 + ], + [ + 204, + 206 + ], + [ + 210, + 213 + ], + [ + 221, + 224 + ], + [ + 225, + 228 + ], + [ + 229, + 233 + ], + [ + 235, + 237 + ], + [ + 239, + 241 + ], + [ + 243, + 245 + ], + [ + 247, + 250 + ], + [ + 251, + 254 + ], + [ + 255, + 259 + ], + [ + 260, + 263 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 309, + 310 + ], + [ + 312, + 313 + ], + [ + 315, + 316 + ], + [ + 323, + 324 + ], + [ + 341, + 343 + ], + [ + 355, + 356 + ], + [ + 358, + 360 + ], + [ + 370, + 372 + ], + [ + 376, + 379 + ], + [ + 380, + 381 + ] + ] + } + }, + { + "filename": "libvips/create/black.c", + "line_filter": { + "diff_chunks": [ + [ + 22, + 50 + ], + [ + 77, + 166 + ], + [ + 182, + 196 + ] + ], + "lines_added": [ + [ + 25, + 41 + ], + [ + 46, + 47 + ], + [ + 80, + 81 + ], + [ + 83, + 85 + ], + [ + 86, + 88 + ], + [ + 89, + 93 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 105, + 107 + ], + [ + 108, + 110 + ], + [ + 111, + 116 + ], + [ + 117, + 120 + ], + [ + 121, + 122 + ], + [ + 125, + 126 + ], + [ + 127, + 129 + ], + [ + 130, + 131 + ], + [ + 136, + 137 + ], + [ + 139, + 142 + ], + [ + 143, + 145 + ], + [ + 146, + 149 + ], + [ + 150, + 152 + ], + [ + 153, + 156 + ], + [ + 157, + 159 + ], + [ + 162, + 163 + ], + [ + 185, + 186 + ], + [ + 190, + 193 + ], + [ + 194, + 195 + ] + ] + } + }, + { + "filename": "libvips/create/buildlut.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 20, + 48 + ], + [ + 67, + 189 + ], + [ + 195, + 212 + ], + [ + 215, + 274 + ], + [ + 279, + 286 + ], + [ + 296, + 303 + ], + [ + 328, + 336 + ], + [ + 338, + 352 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 70, + 71 + ], + [ + 76, + 80 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 91, + 94 + ], + [ + 95, + 96 + ], + [ + 101, + 102 + ], + [ + 108, + 114 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 126, + 130 + ], + [ + 132, + 136 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 148, + 151 + ], + [ + 153, + 157 + ], + [ + 158, + 161 + ], + [ + 164, + 166 + ], + [ + 168, + 170 + ], + [ + 172, + 173 + ], + [ + 174, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 198, + 202 + ], + [ + 207, + 209 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 224, + 226 + ], + [ + 228, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 237 + ], + [ + 238, + 244 + ], + [ + 245, + 246 + ], + [ + 249, + 250 + ], + [ + 251, + 253 + ], + [ + 259, + 260 + ], + [ + 262, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 271 + ], + [ + 282, + 283 + ], + [ + 299, + 300 + ], + [ + 331, + 333 + ], + [ + 341, + 342 + ], + [ + 346, + 349 + ], + [ + 350, + 351 + ] + ] + } + }, + { + "filename": "libvips/create/create.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 58 + ], + [ + 63, + 74 + ], + [ + 77, + 189 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 66, + 67 + ], + [ + 70, + 71 + ], + [ + 80, + 81 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 88, + 91 + ], + [ + 93, + 94 + ], + [ + 95, + 97 + ], + [ + 98, + 99 + ], + [ + 102, + 103 + ], + [ + 104, + 106 + ], + [ + 111, + 112 + ], + [ + 114, + 119 + ], + [ + 122, + 123 + ], + [ + 127, + 128 + ], + [ + 129, + 133 + ], + [ + 134, + 135 + ], + [ + 136, + 158 + ], + [ + 162, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 188 + ] + ] + } + }, + { + "filename": "libvips/create/eye.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 45 + ], + [ + 70, + 124 + ], + [ + 130, + 155 + ] + ], + "lines_added": [ + [ + 20, + 36 + ], + [ + 41, + 42 + ], + [ + 73, + 74 + ], + [ + 76, + 77 + ], + [ + 82, + 84 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 94, + 97 + ], + [ + 102, + 104 + ], + [ + 107, + 110 + ], + [ + 111, + 113 + ], + [ + 116, + 117 + ], + [ + 133, + 135 + ], + [ + 137, + 138 + ], + [ + 144, + 145 + ], + [ + 149, + 152 + ], + [ + 153, + 154 + ] + ] + } + }, + { + "filename": "libvips/create/fractsurf.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 62, + 133 + ], + [ + 138, + 145 + ], + [ + 146, + 162 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 65, + 66 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 74, + 76 + ], + [ + 77, + 78 + ], + [ + 80, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 95 + ], + [ + 100, + 101 + ], + [ + 103, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 113 + ], + [ + 114, + 116 + ], + [ + 117, + 120 + ], + [ + 121, + 123 + ], + [ + 126, + 127 + ], + [ + 128, + 130 + ], + [ + 141, + 142 + ], + [ + 149, + 151 + ], + [ + 155, + 159 + ], + [ + 160, + 161 + ] + ] + } + }, + { + "filename": "libvips/create/gaussmat.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 21 + ], + [ + 25, + 53 + ], + [ + 75, + 83 + ], + [ + 85, + 225 + ], + [ + 237, + 246 + ], + [ + 250, + 260 + ], + [ + 262, + 276 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 28, + 29 + ], + [ + 30, + 34 + ], + [ + 35, + 44 + ], + [ + 49, + 50 + ], + [ + 78, + 80 + ], + [ + 88, + 89 + ], + [ + 95, + 96 + ], + [ + 97, + 99 + ], + [ + 100, + 102 + ], + [ + 104, + 106 + ], + [ + 107, + 109 + ], + [ + 114, + 117 + ], + [ + 119, + 120 + ], + [ + 122, + 124 + ], + [ + 125, + 126 + ], + [ + 128, + 131 + ], + [ + 132, + 134 + ], + [ + 135, + 138 + ], + [ + 139, + 143 + ], + [ + 145, + 147 + ], + [ + 150, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 165, + 167 + ], + [ + 168, + 169 + ], + [ + 172, + 173 + ], + [ + 174, + 176 + ], + [ + 181, + 182 + ], + [ + 184, + 187 + ], + [ + 188, + 190 + ], + [ + 191, + 194 + ], + [ + 195, + 197 + ], + [ + 198, + 201 + ], + [ + 202, + 204 + ], + [ + 205, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 218 + ], + [ + 221, + 222 + ], + [ + 240, + 243 + ], + [ + 253, + 254 + ], + [ + 255, + 257 + ], + [ + 265, + 266 + ], + [ + 270, + 273 + ], + [ + 274, + 275 + ] + ] + } + }, + { + "filename": "libvips/create/gaussnoise.c", + "line_filter": { + "diff_chunks": [ + [ + 30, + 58 + ], + [ + 83, + 211 + ], + [ + 220, + 227 + ], + [ + 228, + 242 + ] + ], + "lines_added": [ + [ + 33, + 49 + ], + [ + 54, + 55 + ], + [ + 86, + 87 + ], + [ + 89, + 91 + ], + [ + 93, + 94 + ], + [ + 97, + 100 + ], + [ + 103, + 104 + ], + [ + 109, + 111 + ], + [ + 113, + 115 + ], + [ + 118, + 119 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 132, + 134 + ], + [ + 135, + 136 + ], + [ + 138, + 139 + ], + [ + 140, + 144 + ], + [ + 145, + 146 + ], + [ + 149, + 150 + ], + [ + 151, + 153 + ], + [ + 159, + 160 + ], + [ + 166, + 169 + ], + [ + 170, + 172 + ], + [ + 173, + 176 + ], + [ + 177, + 179 + ], + [ + 180, + 183 + ], + [ + 184, + 186 + ], + [ + 187, + 190 + ], + [ + 191, + 193 + ], + [ + 194, + 197 + ], + [ + 198, + 200 + ], + [ + 203, + 204 + ], + [ + 207, + 208 + ], + [ + 223, + 224 + ], + [ + 231, + 232 + ], + [ + 236, + 239 + ], + [ + 240, + 241 + ] + ] + } + }, + { + "filename": "libvips/create/grey.c", + "line_filter": { + "diff_chunks": [ + [ + 24, + 52 + ], + [ + 71, + 101 + ], + [ + 113, + 134 + ] + ], + "lines_added": [ + [ + 27, + 43 + ], + [ + 48, + 49 + ], + [ + 74, + 75 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 83, + 84 + ], + [ + 85, + 87 + ], + [ + 89, + 90 + ], + [ + 92, + 94 + ], + [ + 97, + 98 + ], + [ + 116, + 117 + ], + [ + 123, + 124 + ], + [ + 128, + 131 + ], + [ + 132, + 133 + ] + ] + } + }, + { + "filename": "libvips/create/identity.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 18, + 46 + ], + [ + 67, + 169 + ], + [ + 182, + 211 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 21, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 37 + ], + [ + 42, + 43 + ], + [ + 70, + 83 + ], + [ + 85, + 87 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 97 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 111, + 113 + ], + [ + 114, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 131, + 133 + ], + [ + 138, + 140 + ], + [ + 142, + 145 + ], + [ + 146, + 148 + ], + [ + 149, + 152 + ], + [ + 153, + 155 + ], + [ + 156, + 159 + ], + [ + 160, + 162 + ], + [ + 165, + 166 + ], + [ + 185, + 186 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 193, + 194 + ], + [ + 200, + 201 + ], + [ + 205, + 208 + ], + [ + 209, + 210 + ] + ] + } + }, + { + "filename": "libvips/create/invertlut.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 44 + ], + [ + 71, + 179 + ], + [ + 181, + 188 + ], + [ + 191, + 198 + ], + [ + 200, + 207 + ], + [ + 213, + 220 + ], + [ + 224, + 234 + ], + [ + 241, + 307 + ], + [ + 364, + 378 + ] + ], + "lines_added": [ + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 35 + ], + [ + 40, + 41 + ], + [ + 74, + 75 + ], + [ + 76, + 78 + ], + [ + 82, + 83 + ], + [ + 85, + 86 + ], + [ + 89, + 92 + ], + [ + 93, + 94 + ], + [ + 99, + 100 + ], + [ + 106, + 112 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 126 + ], + [ + 127, + 131 + ], + [ + 133, + 136 + ], + [ + 137, + 141 + ], + [ + 144, + 153 + ], + [ + 157, + 158 + ], + [ + 160, + 163 + ], + [ + 164, + 166 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 184, + 185 + ], + [ + 194, + 195 + ], + [ + 203, + 204 + ], + [ + 216, + 217 + ], + [ + 227, + 229 + ], + [ + 230, + 231 + ], + [ + 244, + 245 + ], + [ + 248, + 249 + ], + [ + 250, + 252 + ], + [ + 254, + 256 + ], + [ + 257, + 259 + ], + [ + 260, + 263 + ], + [ + 264, + 266 + ], + [ + 267, + 270 + ], + [ + 271, + 272 + ], + [ + 275, + 276 + ], + [ + 277, + 279 + ], + [ + 285, + 286 + ], + [ + 288, + 291 + ], + [ + 292, + 293 + ], + [ + 294, + 297 + ], + [ + 298, + 300 + ], + [ + 303, + 304 + ], + [ + 367, + 368 + ], + [ + 372, + 375 + ], + [ + 376, + 377 + ] + ] + } + }, + { + "filename": "libvips/create/logmat.c", + "line_filter": { + "diff_chunks": [ + [ + 21, + 49 + ], + [ + 71, + 79 + ], + [ + 81, + 241 + ], + [ + 253, + 283 + ], + [ + 285, + 299 + ] + ], + "lines_added": [ + [ + 24, + 40 + ], + [ + 45, + 46 + ], + [ + 74, + 76 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 89, + 91 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 96, + 98 + ], + [ + 99, + 101 + ], + [ + 106, + 109 + ], + [ + 111, + 114 + ], + [ + 115, + 117 + ], + [ + 120, + 121 + ], + [ + 127, + 128 + ], + [ + 132, + 135 + ], + [ + 137, + 138 + ], + [ + 140, + 142 + ], + [ + 146, + 149 + ], + [ + 152, + 153 + ], + [ + 154, + 157 + ], + [ + 158, + 162 + ], + [ + 164, + 166 + ], + [ + 171, + 172 + ], + [ + 173, + 175 + ], + [ + 176, + 178 + ], + [ + 181, + 183 + ], + [ + 184, + 185 + ], + [ + 188, + 189 + ], + [ + 190, + 192 + ], + [ + 197, + 198 + ], + [ + 200, + 203 + ], + [ + 204, + 206 + ], + [ + 207, + 210 + ], + [ + 211, + 213 + ], + [ + 214, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 224 + ], + [ + 225, + 227 + ], + [ + 228, + 234 + ], + [ + 237, + 238 + ], + [ + 256, + 261 + ], + [ + 263, + 264 + ], + [ + 267, + 268 + ], + [ + 270, + 271 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 278, + 280 + ], + [ + 288, + 289 + ], + [ + 293, + 296 + ], + [ + 297, + 298 + ] + ] + } + }, + { + "filename": "libvips/create/mask.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 75 + ], + [ + 76, + 85 + ], + [ + 88, + 147 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 59, + 61 + ], + [ + 64, + 66 + ], + [ + 71, + 72 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 91, + 92 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 109 + ], + [ + 114, + 115 + ], + [ + 117, + 119 + ], + [ + 121, + 124 + ], + [ + 125, + 127 + ], + [ + 128, + 131 + ], + [ + 132, + 134 + ], + [ + 135, + 138 + ], + [ + 139, + 141 + ], + [ + 144, + 145 + ] + ] + } + }, + { + "filename": "libvips/create/mask_butterworth.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 62 + ], + [ + 66, + 117 + ], + [ + 139, + 163 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 56 + ], + [ + 58, + 59 + ], + [ + 69, + 71 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 78, + 81 + ], + [ + 86, + 87 + ], + [ + 90, + 93 + ], + [ + 94, + 96 + ], + [ + 97, + 100 + ], + [ + 101, + 103 + ], + [ + 104, + 107 + ], + [ + 108, + 110 + ], + [ + 113, + 114 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 149, + 151 + ], + [ + 155, + 160 + ], + [ + 161, + 162 + ] + ] + } + }, + { + "filename": "libvips/create/mask_butterworth_band.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 64, + 78 + ], + [ + 83, + 152 + ], + [ + 160, + 167 + ], + [ + 173, + 204 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 67, + 69 + ], + [ + 71, + 73 + ], + [ + 74, + 75 + ], + [ + 86, + 87 + ], + [ + 91, + 92 + ], + [ + 95, + 97 + ], + [ + 98, + 101 + ], + [ + 106, + 107 + ], + [ + 110, + 113 + ], + [ + 114, + 116 + ], + [ + 117, + 120 + ], + [ + 121, + 123 + ], + [ + 124, + 127 + ], + [ + 128, + 130 + ], + [ + 131, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 141 + ], + [ + 142, + 144 + ], + [ + 147, + 149 + ], + [ + 163, + 164 + ], + [ + 176, + 178 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 188, + 191 + ], + [ + 195, + 201 + ], + [ + 202, + 203 + ] + ] + } + }, + { + "filename": "libvips/create/mask_butterworth_ring.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 60, + 76 + ], + [ + 79, + 118 + ], + [ + 134, + 165 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 65 + ], + [ + 67, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 82, + 84 + ], + [ + 85, + 86 + ], + [ + 89, + 91 + ], + [ + 92, + 95 + ], + [ + 100, + 101 + ], + [ + 104, + 107 + ], + [ + 108, + 110 + ], + [ + 113, + 115 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 150, + 153 + ], + [ + 157, + 162 + ], + [ + 163, + 164 + ] + ] + } + }, + { + "filename": "libvips/create/mask_fractal.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 60, + 105 + ], + [ + 119, + 142 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 65 + ], + [ + 67, + 68 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 80, + 83 + ], + [ + 88, + 89 + ], + [ + 92, + 95 + ], + [ + 96, + 98 + ], + [ + 101, + 102 + ], + [ + 122, + 123 + ], + [ + 129, + 131 + ], + [ + 135, + 139 + ], + [ + 140, + 141 + ] + ] + } + }, + { + "filename": "libvips/create/mask_gaussian.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 105 + ], + [ + 123, + 144 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 71, + 72 + ], + [ + 73, + 76 + ], + [ + 81, + 82 + ], + [ + 85, + 88 + ], + [ + 89, + 91 + ], + [ + 92, + 95 + ], + [ + 96, + 98 + ], + [ + 101, + 102 + ], + [ + 126, + 127 + ], + [ + 131, + 133 + ], + [ + 137, + 141 + ], + [ + 142, + 143 + ] + ] + } + }, + { + "filename": "libvips/create/mask_gaussian_band.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 63, + 73 + ], + [ + 75, + 139 + ], + [ + 145, + 152 + ], + [ + 158, + 185 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 78, + 79 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 96 + ], + [ + 101, + 102 + ], + [ + 105, + 108 + ], + [ + 109, + 111 + ], + [ + 112, + 115 + ], + [ + 116, + 118 + ], + [ + 119, + 122 + ], + [ + 123, + 125 + ], + [ + 126, + 129 + ], + [ + 130, + 132 + ], + [ + 135, + 136 + ], + [ + 148, + 149 + ], + [ + 161, + 163 + ], + [ + 165, + 166 + ], + [ + 170, + 173 + ], + [ + 177, + 182 + ], + [ + 183, + 184 + ] + ] + } + }, + { + "filename": "libvips/create/mask_gaussian_ring.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 60, + 74 + ], + [ + 75, + 113 + ], + [ + 128, + 155 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 65 + ], + [ + 67, + 68 + ], + [ + 70, + 71 + ], + [ + 78, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 88, + 91 + ], + [ + 96, + 97 + ], + [ + 100, + 103 + ], + [ + 104, + 106 + ], + [ + 109, + 110 + ], + [ + 131, + 132 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 140, + 143 + ], + [ + 147, + 152 + ], + [ + 153, + 154 + ] + ] + } + }, + { + "filename": "libvips/create/mask_ideal.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 61 + ], + [ + 62, + 96 + ], + [ + 113, + 157 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 65, + 66 + ], + [ + 69, + 70 + ], + [ + 71, + 74 + ], + [ + 79, + 80 + ], + [ + 83, + 86 + ], + [ + 87, + 89 + ], + [ + 92, + 93 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 123, + 124 + ], + [ + 126, + 128 + ], + [ + 130, + 131 + ], + [ + 135, + 140 + ], + [ + 144, + 146 + ], + [ + 150, + 154 + ], + [ + 155, + 156 + ] + ] + } + }, + { + "filename": "libvips/create/mask_ideal_band.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 62, + 73 + ], + [ + 76, + 124 + ], + [ + 141, + 167 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 65, + 67 + ], + [ + 69, + 70 + ], + [ + 79, + 80 + ], + [ + 83, + 84 + ], + [ + 85, + 88 + ], + [ + 93, + 94 + ], + [ + 97, + 100 + ], + [ + 101, + 103 + ], + [ + 104, + 107 + ], + [ + 108, + 110 + ], + [ + 111, + 114 + ], + [ + 115, + 117 + ], + [ + 120, + 121 + ], + [ + 144, + 147 + ], + [ + 153, + 156 + ], + [ + 160, + 164 + ], + [ + 165, + 166 + ] + ] + } + }, + { + "filename": "libvips/create/mask_ideal_ring.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 60, + 71 + ], + [ + 76, + 110 + ], + [ + 124, + 149 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 65 + ], + [ + 67, + 68 + ], + [ + 79, + 80 + ], + [ + 83, + 84 + ], + [ + 85, + 88 + ], + [ + 93, + 94 + ], + [ + 97, + 100 + ], + [ + 101, + 103 + ], + [ + 106, + 107 + ], + [ + 127, + 129 + ], + [ + 131, + 132 + ], + [ + 136, + 138 + ], + [ + 142, + 146 + ], + [ + 147, + 148 + ] + ] + } + }, + { + "filename": "libvips/create/pcreate.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 55 + ], + [ + 64, + 74 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 51 + ], + [ + 67, + 68 + ] + ] + } + }, + { + "filename": "libvips/create/perlin.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 69, + 76 + ], + [ + 92, + 108 + ], + [ + 118, + 131 + ], + [ + 134, + 208 + ], + [ + 216, + 334 + ], + [ + 354, + 376 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 72, + 73 + ], + [ + 95, + 96 + ], + [ + 98, + 100 + ], + [ + 103, + 105 + ], + [ + 121, + 122 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 127, + 128 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 147, + 148 + ], + [ + 153, + 155 + ], + [ + 160, + 161 + ], + [ + 167, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 176 + ], + [ + 178, + 179 + ], + [ + 183, + 186 + ], + [ + 188, + 189 + ], + [ + 194, + 196 + ], + [ + 201, + 205 + ], + [ + 219, + 220 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 235, + 237 + ], + [ + 240, + 242 + ], + [ + 243, + 245 + ], + [ + 247, + 248 + ], + [ + 249, + 250 + ], + [ + 251, + 259 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 269, + 271 + ], + [ + 273, + 274 + ], + [ + 277, + 278 + ], + [ + 279, + 281 + ], + [ + 284, + 285 + ], + [ + 290, + 291 + ], + [ + 293, + 296 + ], + [ + 297, + 299 + ], + [ + 300, + 303 + ], + [ + 304, + 306 + ], + [ + 307, + 310 + ], + [ + 311, + 313 + ], + [ + 314, + 317 + ], + [ + 318, + 320 + ], + [ + 321, + 324 + ], + [ + 325, + 327 + ], + [ + 330, + 331 + ], + [ + 357, + 359 + ], + [ + 365, + 366 + ], + [ + 370, + 373 + ], + [ + 374, + 375 + ] + ] + } + }, + { + "filename": "libvips/create/pmask.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 42, + 61 + ], + [ + 68, + 94 + ], + [ + 98, + 120 + ], + [ + 126, + 148 + ], + [ + 153, + 160 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 45, + 57 + ], + [ + 71, + 72 + ], + [ + 75, + 76 + ], + [ + 78, + 90 + ], + [ + 101, + 102 + ], + [ + 104, + 116 + ], + [ + 129, + 130 + ], + [ + 132, + 144 + ], + [ + 156, + 157 + ] + ] + } + }, + { + "filename": "libvips/create/point.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 49, + 112 + ], + [ + 113, + 166 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 52, + 53 + ], + [ + 55, + 57 + ], + [ + 59, + 61 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 68, + 70 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 78, + 82 + ], + [ + 85, + 87 + ], + [ + 89, + 90 + ], + [ + 92, + 97 + ], + [ + 99, + 100 + ], + [ + 104, + 109 + ], + [ + 116, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 127 + ], + [ + 132, + 133 + ], + [ + 135, + 138 + ], + [ + 140, + 143 + ], + [ + 144, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 153 + ], + [ + 154, + 157 + ], + [ + 158, + 160 + ], + [ + 163, + 164 + ] + ] + } + }, + { + "filename": "libvips/create/point.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 55 + ], + [ + 63, + 77 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 51 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 73, + 74 + ] + ] + } + }, + { + "filename": "libvips/create/sines.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 16, + 44 + ], + [ + 74, + 145 + ], + [ + 158, + 165 + ], + [ + 168, + 189 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 35 + ], + [ + 40, + 41 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 84, + 85 + ], + [ + 88, + 89 + ], + [ + 90, + 91 + ], + [ + 96, + 98 + ], + [ + 99, + 104 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 115 + ], + [ + 120, + 121 + ], + [ + 125, + 128 + ], + [ + 129, + 131 + ], + [ + 132, + 135 + ], + [ + 136, + 138 + ], + [ + 141, + 142 + ], + [ + 161, + 162 + ], + [ + 171, + 174 + ], + [ + 178, + 179 + ], + [ + 183, + 186 + ], + [ + 187, + 188 + ] + ] + } + }, + { + "filename": "libvips/create/text.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 29 + ], + [ + 41, + 69 + ], + [ + 117, + 128 + ], + [ + 129, + 149 + ], + [ + 150, + 168 + ], + [ + 178, + 187 + ], + [ + 203, + 267 + ], + [ + 282, + 308 + ], + [ + 311, + 323 + ], + [ + 328, + 350 + ], + [ + 353, + 379 + ], + [ + 380, + 638 + ], + [ + 651, + 658 + ], + [ + 673, + 699 + ], + [ + 706, + 720 + ] + ], + "lines_added": [ + [ + 15, + 17 + ], + [ + 22, + 24 + ], + [ + 25, + 26 + ], + [ + 44, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 55 + ], + [ + 56, + 60 + ], + [ + 65, + 66 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 132, + 133 + ], + [ + 136, + 138 + ], + [ + 139, + 140 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 153, + 155 + ], + [ + 156, + 160 + ], + [ + 161, + 163 + ], + [ + 164, + 165 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 206, + 207 + ], + [ + 208, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 220, + 222 + ], + [ + 223, + 229 + ], + [ + 230, + 232 + ], + [ + 238, + 244 + ], + [ + 246, + 247 + ], + [ + 252, + 253 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 263, + 264 + ], + [ + 285, + 288 + ], + [ + 290, + 293 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 304, + 305 + ], + [ + 314, + 316 + ], + [ + 319, + 320 + ], + [ + 331, + 333 + ], + [ + 337, + 339 + ], + [ + 340, + 342 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 356, + 357 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 363, + 364 + ], + [ + 366, + 367 + ], + [ + 370, + 371 + ], + [ + 372, + 374 + ], + [ + 375, + 376 + ], + [ + 383, + 385 + ], + [ + 386, + 390 + ], + [ + 394, + 395 + ], + [ + 396, + 397 + ], + [ + 398, + 401 + ], + [ + 403, + 405 + ], + [ + 408, + 413 + ], + [ + 414, + 415 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 423, + 427 + ], + [ + 429, + 430 + ], + [ + 431, + 432 + ], + [ + 434, + 438 + ], + [ + 442, + 444 + ], + [ + 445, + 449 + ], + [ + 452, + 455 + ], + [ + 456, + 457 + ], + [ + 460, + 463 + ], + [ + 464, + 466 + ], + [ + 468, + 476 + ], + [ + 478, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 487, + 488 + ], + [ + 490, + 491 + ], + [ + 493, + 498 + ], + [ + 502, + 504 + ], + [ + 505, + 507 + ], + [ + 510, + 512 + ], + [ + 513, + 514 + ], + [ + 517, + 518 + ], + [ + 519, + 520 + ], + [ + 522, + 523 + ], + [ + 526, + 527 + ], + [ + 528, + 530 + ], + [ + 533, + 534 + ], + [ + 540, + 541 + ], + [ + 543, + 546 + ], + [ + 547, + 549 + ], + [ + 550, + 553 + ], + [ + 554, + 556 + ], + [ + 557, + 560 + ], + [ + 561, + 563 + ], + [ + 564, + 567 + ], + [ + 568, + 570 + ], + [ + 571, + 574 + ], + [ + 575, + 577 + ], + [ + 578, + 581 + ], + [ + 582, + 584 + ], + [ + 585, + 588 + ], + [ + 589, + 591 + ], + [ + 592, + 595 + ], + [ + 596, + 598 + ], + [ + 599, + 602 + ], + [ + 603, + 605 + ], + [ + 606, + 609 + ], + [ + 610, + 612 + ], + [ + 613, + 616 + ], + [ + 617, + 619 + ], + [ + 620, + 623 + ], + [ + 624, + 626 + ], + [ + 629, + 630 + ], + [ + 634, + 635 + ], + [ + 654, + 655 + ], + [ + 676, + 678 + ], + [ + 679, + 680 + ], + [ + 683, + 684 + ], + [ + 685, + 686 + ], + [ + 688, + 690 + ], + [ + 692, + 693 + ], + [ + 695, + 696 + ], + [ + 709, + 710 + ], + [ + 714, + 717 + ], + [ + 718, + 719 + ] + ] + } + }, + { + "filename": "libvips/create/tonelut.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 19, + 47 + ], + [ + 63, + 70 + ], + [ + 78, + 181 + ], + [ + 184, + 197 + ], + [ + 198, + 321 + ], + [ + 325, + 353 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 22, + 23 + ], + [ + 24, + 28 + ], + [ + 29, + 38 + ], + [ + 43, + 44 + ], + [ + 66, + 67 + ], + [ + 81, + 82 + ], + [ + 86, + 87 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 108, + 109 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 130, + 131 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 146, + 147 + ], + [ + 152, + 153 + ], + [ + 156, + 162 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 170, + 171 + ], + [ + 173, + 175 + ], + [ + 176, + 178 + ], + [ + 187, + 190 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 201, + 209 + ], + [ + 212, + 213 + ], + [ + 214, + 216 + ], + [ + 221, + 222 + ], + [ + 224, + 227 + ], + [ + 228, + 230 + ], + [ + 231, + 234 + ], + [ + 235, + 237 + ], + [ + 238, + 241 + ], + [ + 242, + 244 + ], + [ + 245, + 248 + ], + [ + 249, + 251 + ], + [ + 252, + 255 + ], + [ + 256, + 258 + ], + [ + 259, + 262 + ], + [ + 263, + 265 + ], + [ + 266, + 269 + ], + [ + 270, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 279 + ], + [ + 280, + 283 + ], + [ + 284, + 286 + ], + [ + 287, + 290 + ], + [ + 291, + 293 + ], + [ + 296, + 297 + ], + [ + 298, + 308 + ], + [ + 312, + 313 + ], + [ + 317, + 318 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 335, + 337 + ], + [ + 342, + 343 + ], + [ + 347, + 350 + ], + [ + 351, + 352 + ] + ] + } + }, + { + "filename": "libvips/create/worley.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 71, + 78 + ], + [ + 107, + 123 + ], + [ + 133, + 210 + ], + [ + 211, + 341 + ], + [ + 365, + 379 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 74, + 75 + ], + [ + 110, + 111 + ], + [ + 113, + 115 + ], + [ + 118, + 120 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 156, + 160 + ], + [ + 162, + 165 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 187, + 189 + ], + [ + 194, + 195 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 214, + 215 + ], + [ + 217, + 221 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 232 + ], + [ + 234, + 235 + ], + [ + 239, + 241 + ], + [ + 242, + 243 + ], + [ + 246, + 250 + ], + [ + 254, + 256 + ], + [ + 259, + 260 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 268, + 270 + ], + [ + 273, + 275 + ], + [ + 276, + 278 + ], + [ + 280, + 281 + ], + [ + 282, + 283 + ], + [ + 284, + 292 + ], + [ + 295, + 296 + ], + [ + 297, + 299 + ], + [ + 304, + 305 + ], + [ + 307, + 310 + ], + [ + 311, + 313 + ], + [ + 314, + 317 + ], + [ + 318, + 320 + ], + [ + 321, + 324 + ], + [ + 325, + 327 + ], + [ + 328, + 331 + ], + [ + 332, + 334 + ], + [ + 337, + 338 + ], + [ + 368, + 369 + ], + [ + 373, + 376 + ], + [ + 377, + 378 + ] + ] + } + }, + { + "filename": "libvips/create/xyz.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 10, + 38 + ], + [ + 69, + 231 + ], + [ + 249, + 277 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 29 + ], + [ + 34, + 35 + ], + [ + 72, + 73 + ], + [ + 75, + 77 + ], + [ + 79, + 80 + ], + [ + 82, + 84 + ], + [ + 87, + 90 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 124, + 126 + ], + [ + 131, + 133 + ], + [ + 134, + 141 + ], + [ + 143, + 144 + ], + [ + 146, + 147 + ], + [ + 149, + 150 + ], + [ + 154, + 158 + ], + [ + 161, + 163 + ], + [ + 165, + 170 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 179 + ], + [ + 180, + 181 + ], + [ + 186, + 188 + ], + [ + 190, + 193 + ], + [ + 194, + 196 + ], + [ + 197, + 200 + ], + [ + 201, + 203 + ], + [ + 204, + 207 + ], + [ + 208, + 210 + ], + [ + 211, + 214 + ], + [ + 215, + 217 + ], + [ + 218, + 221 + ], + [ + 222, + 224 + ], + [ + 227, + 228 + ], + [ + 252, + 253 + ], + [ + 255, + 256 + ], + [ + 259, + 260 + ], + [ + 266, + 267 + ], + [ + 271, + 274 + ], + [ + 275, + 276 + ] + ] + } + }, + { + "filename": "libvips/create/zone.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 45 + ], + [ + 64, + 74 + ], + [ + 77, + 100 + ], + [ + 108, + 131 + ] + ], + "lines_added": [ + [ + 20, + 36 + ], + [ + 41, + 42 + ], + [ + 67, + 68 + ], + [ + 70, + 71 + ], + [ + 80, + 81 + ], + [ + 84, + 85 + ], + [ + 86, + 88 + ], + [ + 90, + 91 + ], + [ + 96, + 97 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 120, + 121 + ], + [ + 125, + 128 + ], + [ + 129, + 130 + ] + ] + } + }, + { + "filename": "libvips/deprecated/arith_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 182 + ], + [ + 185, + 881 + ], + [ + 886, + 1219 + ], + [ + 1224, + 1233 + ], + [ + 1270, + 1276 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 48 + ], + [ + 53, + 56 + ], + [ + 61, + 63 + ], + [ + 68, + 71 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 86, + 87 + ], + [ + 88, + 92 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 105, + 111 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 124, + 130 + ], + [ + 135, + 136 + ], + [ + 139, + 141 + ], + [ + 143, + 144 + ], + [ + 147, + 148 + ], + [ + 149, + 155 + ], + [ + 160, + 166 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 178, + 179 + ], + [ + 188, + 189 + ], + [ + 195, + 200 + ], + [ + 205, + 206 + ], + [ + 207, + 208 + ], + [ + 213, + 219 + ], + [ + 224, + 225 + ], + [ + 228, + 230 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 238, + 244 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ], + [ + 255, + 256 + ], + [ + 257, + 263 + ], + [ + 268, + 269 + ], + [ + 270, + 271 + ], + [ + 274, + 275 + ], + [ + 276, + 282 + ], + [ + 287, + 290 + ], + [ + 295, + 296 + ], + [ + 299, + 300 + ], + [ + 303, + 304 + ], + [ + 305, + 311 + ], + [ + 316, + 319 + ], + [ + 324, + 325 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 334, + 340 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 351, + 352 + ], + [ + 353, + 359 + ], + [ + 364, + 365 + ], + [ + 366, + 367 + ], + [ + 370, + 371 + ], + [ + 372, + 378 + ], + [ + 383, + 387 + ], + [ + 392, + 393 + ], + [ + 397, + 398 + ], + [ + 401, + 402 + ], + [ + 403, + 409 + ], + [ + 414, + 418 + ], + [ + 423, + 424 + ], + [ + 428, + 432 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 440, + 442 + ], + [ + 443, + 446 + ], + [ + 451, + 452 + ], + [ + 453, + 454 + ], + [ + 457, + 458 + ], + [ + 459, + 465 + ], + [ + 470, + 471 + ], + [ + 472, + 473 + ], + [ + 476, + 477 + ], + [ + 478, + 484 + ], + [ + 489, + 490 + ], + [ + 491, + 492 + ], + [ + 495, + 496 + ], + [ + 497, + 503 + ], + [ + 508, + 509 + ], + [ + 510, + 511 + ], + [ + 514, + 515 + ], + [ + 516, + 522 + ], + [ + 527, + 528 + ], + [ + 529, + 530 + ], + [ + 533, + 534 + ], + [ + 535, + 541 + ], + [ + 546, + 547 + ], + [ + 548, + 549 + ], + [ + 552, + 553 + ], + [ + 554, + 560 + ], + [ + 565, + 566 + ], + [ + 567, + 568 + ], + [ + 571, + 572 + ], + [ + 573, + 579 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 590, + 591 + ], + [ + 592, + 598 + ], + [ + 603, + 604 + ], + [ + 605, + 606 + ], + [ + 609, + 610 + ], + [ + 611, + 617 + ], + [ + 622, + 623 + ], + [ + 624, + 625 + ], + [ + 628, + 629 + ], + [ + 630, + 636 + ], + [ + 641, + 642 + ], + [ + 643, + 644 + ], + [ + 647, + 648 + ], + [ + 649, + 655 + ], + [ + 660, + 661 + ], + [ + 662, + 663 + ], + [ + 666, + 667 + ], + [ + 668, + 674 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 685, + 686 + ], + [ + 687, + 693 + ], + [ + 698, + 699 + ], + [ + 702, + 704 + ], + [ + 706, + 707 + ], + [ + 710, + 711 + ], + [ + 712, + 718 + ], + [ + 723, + 725 + ], + [ + 730, + 731 + ], + [ + 735, + 737 + ], + [ + 741, + 742 + ], + [ + 745, + 746 + ], + [ + 747, + 753 + ], + [ + 758, + 762 + ], + [ + 767, + 768 + ], + [ + 769, + 770 + ], + [ + 775, + 781 + ], + [ + 786, + 791 + ], + [ + 796, + 797 + ], + [ + 798, + 814 + ], + [ + 819, + 825 + ], + [ + 830, + 831 + ], + [ + 832, + 848 + ], + [ + 853, + 859 + ], + [ + 864, + 872 + ], + [ + 877, + 878 + ], + [ + 889, + 893 + ], + [ + 895, + 896 + ], + [ + 901, + 907 + ], + [ + 912, + 913 + ], + [ + 916, + 918 + ], + [ + 920, + 921 + ], + [ + 924, + 925 + ], + [ + 926, + 932 + ], + [ + 937, + 938 + ], + [ + 942, + 944 + ], + [ + 948, + 949 + ], + [ + 952, + 953 + ], + [ + 954, + 960 + ], + [ + 965, + 966 + ], + [ + 967, + 968 + ], + [ + 971, + 972 + ], + [ + 973, + 979 + ], + [ + 984, + 985 + ], + [ + 988, + 989 + ], + [ + 994, + 997 + ], + [ + 1000, + 1001 + ], + [ + 1002, + 1008 + ], + [ + 1013, + 1014 + ], + [ + 1017, + 1018 + ], + [ + 1023, + 1026 + ], + [ + 1029, + 1030 + ], + [ + 1031, + 1038 + ], + [ + 1043, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1049, + 1050 + ], + [ + 1051, + 1057 + ], + [ + 1062, + 1063 + ], + [ + 1066, + 1067 + ], + [ + 1070, + 1071 + ], + [ + 1072, + 1078 + ], + [ + 1083, + 1084 + ], + [ + 1087, + 1088 + ], + [ + 1091, + 1092 + ], + [ + 1093, + 1099 + ], + [ + 1104, + 1106 + ], + [ + 1111, + 1112 + ], + [ + 1115, + 1117 + ], + [ + 1118, + 1119 + ], + [ + 1122, + 1123 + ], + [ + 1124, + 1130 + ], + [ + 1135, + 1136 + ], + [ + 1137, + 1138 + ], + [ + 1141, + 1142 + ], + [ + 1143, + 1149 + ], + [ + 1154, + 1157 + ], + [ + 1162, + 1163 + ], + [ + 1165, + 1184 + ], + [ + 1189, + 1190 + ], + [ + 1191, + 1197 + ], + [ + 1202, + 1203 + ], + [ + 1204, + 1205 + ], + [ + 1208, + 1209 + ], + [ + 1210, + 1216 + ], + [ + 1227, + 1230 + ], + [ + 1273, + 1274 + ] + ] + } + }, + { + "filename": "libvips/deprecated/cimg_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 39, + 152 + ], + [ + 157, + 163 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 42, + 43 + ], + [ + 44, + 52 + ], + [ + 53, + 68 + ], + [ + 71, + 84 + ], + [ + 87, + 93 + ], + [ + 96, + 97 + ], + [ + 98, + 107 + ], + [ + 108, + 123 + ], + [ + 126, + 140 + ], + [ + 143, + 149 + ], + [ + 160, + 161 + ] + ] + } + }, + { + "filename": "libvips/deprecated/colour_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 950 + ], + [ + 951, + 968 + ], + [ + 1016, + 1022 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 48 + ], + [ + 53, + 56 + ], + [ + 61, + 62 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 69, + 75 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 88, + 94 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 107, + 113 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 126, + 132 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 143, + 144 + ], + [ + 145, + 151 + ], + [ + 156, + 157 + ], + [ + 158, + 159 + ], + [ + 162, + 163 + ], + [ + 164, + 170 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 183, + 189 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 202, + 208 + ], + [ + 211, + 212 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 233 + ], + [ + 236, + 237 + ], + [ + 240, + 242 + ], + [ + 245, + 250 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 257, + 262 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 273, + 276 + ], + [ + 279, + 280 + ], + [ + 281, + 288 + ], + [ + 291, + 292 + ], + [ + 295, + 297 + ], + [ + 300, + 304 + ], + [ + 307, + 308 + ], + [ + 309, + 316 + ], + [ + 319, + 320 + ], + [ + 324, + 326 + ], + [ + 329, + 334 + ], + [ + 337, + 338 + ], + [ + 339, + 346 + ], + [ + 349, + 350 + ], + [ + 351, + 352 + ], + [ + 355, + 358 + ], + [ + 361, + 362 + ], + [ + 363, + 370 + ], + [ + 373, + 374 + ], + [ + 379, + 380 + ], + [ + 383, + 388 + ], + [ + 391, + 392 + ], + [ + 393, + 394 + ], + [ + 395, + 400 + ], + [ + 405, + 406 + ], + [ + 407, + 408 + ], + [ + 411, + 412 + ], + [ + 413, + 419 + ], + [ + 424, + 425 + ], + [ + 426, + 427 + ], + [ + 430, + 431 + ], + [ + 432, + 438 + ], + [ + 443, + 444 + ], + [ + 445, + 446 + ], + [ + 449, + 450 + ], + [ + 451, + 457 + ], + [ + 462, + 463 + ], + [ + 464, + 465 + ], + [ + 468, + 469 + ], + [ + 470, + 476 + ], + [ + 481, + 482 + ], + [ + 483, + 484 + ], + [ + 487, + 488 + ], + [ + 489, + 495 + ], + [ + 500, + 501 + ], + [ + 502, + 503 + ], + [ + 506, + 507 + ], + [ + 508, + 514 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 525, + 526 + ], + [ + 527, + 533 + ], + [ + 538, + 539 + ], + [ + 540, + 541 + ], + [ + 544, + 545 + ], + [ + 546, + 552 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ], + [ + 563, + 564 + ], + [ + 565, + 571 + ], + [ + 576, + 577 + ], + [ + 578, + 579 + ], + [ + 582, + 583 + ], + [ + 584, + 590 + ], + [ + 595, + 596 + ], + [ + 597, + 598 + ], + [ + 601, + 602 + ], + [ + 603, + 609 + ], + [ + 614, + 615 + ], + [ + 616, + 617 + ], + [ + 620, + 621 + ], + [ + 622, + 628 + ], + [ + 633, + 634 + ], + [ + 635, + 636 + ], + [ + 639, + 640 + ], + [ + 641, + 647 + ], + [ + 652, + 653 + ], + [ + 654, + 655 + ], + [ + 658, + 659 + ], + [ + 660, + 666 + ], + [ + 669, + 670 + ], + [ + 675, + 676 + ], + [ + 679, + 680 + ], + [ + 681, + 688 + ], + [ + 693, + 694 + ], + [ + 695, + 696 + ], + [ + 699, + 700 + ], + [ + 701, + 707 + ], + [ + 712, + 715 + ], + [ + 720, + 721 + ], + [ + 722, + 723 + ], + [ + 726, + 727 + ], + [ + 728, + 734 + ], + [ + 739, + 740 + ], + [ + 741, + 742 + ], + [ + 745, + 746 + ], + [ + 747, + 753 + ], + [ + 758, + 759 + ], + [ + 760, + 761 + ], + [ + 764, + 765 + ], + [ + 766, + 772 + ], + [ + 777, + 778 + ], + [ + 779, + 780 + ], + [ + 783, + 784 + ], + [ + 785, + 786 + ], + [ + 787, + 791 + ], + [ + 796, + 797 + ], + [ + 798, + 799 + ], + [ + 802, + 803 + ], + [ + 804, + 805 + ], + [ + 806, + 810 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 821, + 822 + ], + [ + 823, + 824 + ], + [ + 825, + 829 + ], + [ + 834, + 835 + ], + [ + 836, + 837 + ], + [ + 840, + 841 + ], + [ + 842, + 843 + ], + [ + 844, + 848 + ], + [ + 853, + 857 + ], + [ + 862, + 863 + ], + [ + 864, + 865 + ], + [ + 868, + 869 + ], + [ + 870, + 871 + ], + [ + 872, + 876 + ], + [ + 881, + 882 + ], + [ + 883, + 884 + ], + [ + 887, + 888 + ], + [ + 889, + 890 + ], + [ + 891, + 895 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 906, + 907 + ], + [ + 908, + 914 + ], + [ + 919, + 920 + ], + [ + 921, + 922 + ], + [ + 925, + 926 + ], + [ + 927, + 933 + ], + [ + 936, + 943 + ], + [ + 946, + 947 + ], + [ + 954, + 956 + ], + [ + 959, + 965 + ], + [ + 1019, + 1020 + ] + ] + } + }, + { + "filename": "libvips/deprecated/conver_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 39, + 74 + ], + [ + 78, + 201 + ], + [ + 202, + 335 + ], + [ + 337, + 620 + ], + [ + 621, + 734 + ], + [ + 737, + 1270 + ], + [ + 1271, + 1289 + ], + [ + 1317, + 1325 + ], + [ + 1339, + 1345 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 42, + 43 + ], + [ + 48, + 50 + ], + [ + 51, + 52 + ], + [ + 55, + 58 + ], + [ + 62, + 67 + ], + [ + 70, + 71 + ], + [ + 81, + 85 + ], + [ + 87, + 92 + ], + [ + 94, + 95 + ], + [ + 98, + 104 + ], + [ + 107, + 113 + ], + [ + 116, + 117 + ], + [ + 123, + 125 + ], + [ + 126, + 127 + ], + [ + 130, + 134 + ], + [ + 137, + 143 + ], + [ + 148, + 153 + ], + [ + 158, + 159 + ], + [ + 165, + 169 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 177, + 180 + ], + [ + 185, + 192 + ], + [ + 197, + 198 + ], + [ + 205, + 207 + ], + [ + 212, + 218 + ], + [ + 223, + 229 + ], + [ + 234, + 235 + ], + [ + 241, + 242 + ], + [ + 247, + 253 + ], + [ + 258, + 262 + ], + [ + 267, + 268 + ], + [ + 272, + 273 + ], + [ + 278, + 284 + ], + [ + 289, + 292 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 307, + 313 + ], + [ + 318, + 326 + ], + [ + 331, + 332 + ], + [ + 340, + 342 + ], + [ + 347, + 353 + ], + [ + 358, + 360 + ], + [ + 365, + 368 + ], + [ + 373, + 374 + ], + [ + 375, + 376 + ], + [ + 381, + 387 + ], + [ + 390, + 392 + ], + [ + 395, + 396 + ], + [ + 399, + 400 + ], + [ + 403, + 409 + ], + [ + 414, + 420 + ], + [ + 425, + 426 + ], + [ + 431, + 432 + ], + [ + 437, + 443 + ], + [ + 448, + 452 + ], + [ + 457, + 458 + ], + [ + 463, + 464 + ], + [ + 469, + 475 + ], + [ + 480, + 483 + ], + [ + 488, + 489 + ], + [ + 492, + 493 + ], + [ + 498, + 504 + ], + [ + 509, + 510 + ], + [ + 511, + 512 + ], + [ + 517, + 518 + ], + [ + 519, + 523 + ], + [ + 528, + 529 + ], + [ + 530, + 531 + ], + [ + 536, + 537 + ], + [ + 538, + 542 + ], + [ + 547, + 548 + ], + [ + 549, + 550 + ], + [ + 555, + 556 + ], + [ + 557, + 561 + ], + [ + 566, + 567 + ], + [ + 568, + 569 + ], + [ + 574, + 575 + ], + [ + 576, + 580 + ], + [ + 585, + 586 + ], + [ + 587, + 588 + ], + [ + 593, + 594 + ], + [ + 595, + 599 + ], + [ + 604, + 611 + ], + [ + 616, + 617 + ], + [ + 624, + 626 + ], + [ + 631, + 632 + ], + [ + 637, + 638 + ], + [ + 639, + 642 + ], + [ + 647, + 651 + ], + [ + 656, + 657 + ], + [ + 661, + 662 + ], + [ + 667, + 668 + ], + [ + 673, + 674 + ], + [ + 675, + 678 + ], + [ + 683, + 688 + ], + [ + 693, + 694 + ], + [ + 699, + 701 + ], + [ + 706, + 707 + ], + [ + 712, + 713 + ], + [ + 714, + 717 + ], + [ + 722, + 723 + ], + [ + 724, + 725 + ], + [ + 730, + 731 + ], + [ + 740, + 743 + ], + [ + 748, + 749 + ], + [ + 750, + 751 + ], + [ + 756, + 757 + ], + [ + 762, + 763 + ], + [ + 764, + 767 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ], + [ + 780, + 781 + ], + [ + 786, + 787 + ], + [ + 788, + 791 + ], + [ + 796, + 797 + ], + [ + 798, + 799 + ], + [ + 804, + 805 + ], + [ + 806, + 810 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 823, + 824 + ], + [ + 825, + 829 + ], + [ + 834, + 835 + ], + [ + 836, + 837 + ], + [ + 842, + 843 + ], + [ + 844, + 848 + ], + [ + 853, + 858 + ], + [ + 863, + 864 + ], + [ + 868, + 869 + ], + [ + 874, + 875 + ], + [ + 876, + 880 + ], + [ + 885, + 890 + ], + [ + 895, + 896 + ], + [ + 900, + 904 + ], + [ + 906, + 908 + ], + [ + 909, + 910 + ], + [ + 913, + 914 + ], + [ + 915, + 916 + ], + [ + 917, + 921 + ], + [ + 926, + 927 + ], + [ + 931, + 932 + ], + [ + 937, + 938 + ], + [ + 939, + 943 + ], + [ + 948, + 949 + ], + [ + 950, + 951 + ], + [ + 956, + 957 + ], + [ + 958, + 962 + ], + [ + 967, + 968 + ], + [ + 969, + 970 + ], + [ + 975, + 976 + ], + [ + 977, + 981 + ], + [ + 986, + 987 + ], + [ + 988, + 989 + ], + [ + 994, + 995 + ], + [ + 996, + 1000 + ], + [ + 1005, + 1006 + ], + [ + 1007, + 1008 + ], + [ + 1013, + 1014 + ], + [ + 1015, + 1019 + ], + [ + 1024, + 1025 + ], + [ + 1026, + 1027 + ], + [ + 1032, + 1033 + ], + [ + 1034, + 1038 + ], + [ + 1043, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1051, + 1052 + ], + [ + 1053, + 1057 + ], + [ + 1062, + 1063 + ], + [ + 1064, + 1065 + ], + [ + 1070, + 1071 + ], + [ + 1072, + 1076 + ], + [ + 1081, + 1086 + ], + [ + 1091, + 1092 + ], + [ + 1097, + 1098 + ], + [ + 1103, + 1104 + ], + [ + 1105, + 1109 + ], + [ + 1114, + 1118 + ], + [ + 1123, + 1124 + ], + [ + 1128, + 1129 + ], + [ + 1134, + 1135 + ], + [ + 1136, + 1140 + ], + [ + 1145, + 1149 + ], + [ + 1154, + 1155 + ], + [ + 1159, + 1160 + ], + [ + 1165, + 1166 + ], + [ + 1167, + 1171 + ], + [ + 1176, + 1177 + ], + [ + 1178, + 1179 + ], + [ + 1184, + 1190 + ], + [ + 1195, + 1198 + ], + [ + 1203, + 1204 + ], + [ + 1205, + 1208 + ], + [ + 1209, + 1210 + ], + [ + 1215, + 1221 + ], + [ + 1226, + 1230 + ], + [ + 1235, + 1236 + ], + [ + 1237, + 1238 + ], + [ + 1243, + 1249 + ], + [ + 1254, + 1261 + ], + [ + 1266, + 1267 + ], + [ + 1274, + 1275 + ], + [ + 1278, + 1279 + ], + [ + 1280, + 1286 + ], + [ + 1320, + 1322 + ], + [ + 1342, + 1343 + ] + ] + } + }, + { + "filename": "libvips/deprecated/convol_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 139 + ], + [ + 141, + 481 + ], + [ + 490, + 500 + ], + [ + 503, + 509 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 48 + ], + [ + 53, + 56 + ], + [ + 61, + 64 + ], + [ + 69, + 70 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 85 + ], + [ + 90, + 94 + ], + [ + 99, + 100 + ], + [ + 104, + 106 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 113, + 117 + ], + [ + 122, + 130 + ], + [ + 135, + 136 + ], + [ + 144, + 145 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 152, + 156 + ], + [ + 161, + 164 + ], + [ + 169, + 172 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 189, + 193 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 208, + 209 + ], + [ + 210, + 214 + ], + [ + 219, + 220 + ], + [ + 223, + 224 + ], + [ + 227, + 228 + ], + [ + 229, + 230 + ], + [ + 231, + 235 + ], + [ + 240, + 241 + ], + [ + 244, + 245 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 252, + 256 + ], + [ + 261, + 262 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 273, + 277 + ], + [ + 282, + 283 + ], + [ + 284, + 285 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ], + [ + 292, + 296 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 307, + 308 + ], + [ + 309, + 310 + ], + [ + 311, + 315 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 326, + 327 + ], + [ + 328, + 329 + ], + [ + 330, + 334 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 349, + 353 + ], + [ + 358, + 359 + ], + [ + 362, + 363 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 370, + 374 + ], + [ + 379, + 380 + ], + [ + 383, + 384 + ], + [ + 387, + 388 + ], + [ + 389, + 390 + ], + [ + 391, + 395 + ], + [ + 400, + 401 + ], + [ + 402, + 403 + ], + [ + 406, + 407 + ], + [ + 408, + 409 + ], + [ + 410, + 414 + ], + [ + 419, + 424 + ], + [ + 429, + 430 + ], + [ + 435, + 436 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 443, + 447 + ], + [ + 452, + 456 + ], + [ + 461, + 462 + ], + [ + 466, + 467 + ], + [ + 470, + 471 + ], + [ + 472, + 473 + ], + [ + 474, + 478 + ], + [ + 493, + 494 + ], + [ + 495, + 497 + ], + [ + 506, + 507 + ] + ] + } + }, + { + "filename": "libvips/deprecated/cooc_funcs.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 14 + ], + [ + 35, + 68 + ], + [ + 77, + 85 + ], + [ + 90, + 157 + ], + [ + 162, + 447 + ] + ], + "lines_added": [ + [ + 9, + 11 + ], + [ + 38, + 39 + ], + [ + 43, + 44 + ], + [ + 45, + 49 + ], + [ + 50, + 59 + ], + [ + 64, + 65 + ], + [ + 80, + 82 + ], + [ + 93, + 102 + ], + [ + 103, + 104 + ], + [ + 109, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 123, + 126 + ], + [ + 132, + 133 + ], + [ + 136, + 137 + ], + [ + 140, + 145 + ], + [ + 146, + 150 + ], + [ + 152, + 154 + ], + [ + 165, + 174 + ], + [ + 175, + 176 + ], + [ + 180, + 188 + ], + [ + 189, + 190 + ], + [ + 191, + 192 + ], + [ + 194, + 197 + ], + [ + 201, + 202 + ], + [ + 205, + 206 + ], + [ + 209, + 214 + ], + [ + 215, + 219 + ], + [ + 223, + 226 + ], + [ + 228, + 235 + ], + [ + 239, + 241 + ], + [ + 245, + 247 + ], + [ + 248, + 253 + ], + [ + 254, + 256 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 263, + 265 + ], + [ + 269, + 271 + ], + [ + 272, + 277 + ], + [ + 278, + 280 + ], + [ + 282, + 284 + ], + [ + 287, + 288 + ], + [ + 290, + 291 + ], + [ + 296, + 297 + ], + [ + 301, + 303 + ], + [ + 304, + 305 + ], + [ + 306, + 312 + ], + [ + 313, + 314 + ], + [ + 315, + 319 + ], + [ + 320, + 321 + ], + [ + 326, + 328 + ], + [ + 333, + 337 + ], + [ + 339, + 355 + ], + [ + 357, + 359 + ], + [ + 360, + 362 + ], + [ + 363, + 365 + ], + [ + 367, + 369 + ], + [ + 372, + 374 + ], + [ + 377, + 378 + ], + [ + 380, + 381 + ], + [ + 383, + 385 + ], + [ + 387, + 388 + ], + [ + 389, + 390 + ], + [ + 392, + 393 + ], + [ + 396, + 401 + ], + [ + 402, + 405 + ], + [ + 407, + 409 + ], + [ + 412, + 413 + ], + [ + 416, + 418 + ], + [ + 419, + 425 + ], + [ + 428, + 429 + ], + [ + 431, + 433 + ], + [ + 434, + 435 + ], + [ + 436, + 437 + ], + [ + 438, + 440 + ], + [ + 442, + 443 + ], + [ + 444, + 446 + ] + ] + } + }, + { + "filename": "libvips/deprecated/deprecated_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 42, + 208 + ], + [ + 210, + 317 + ], + [ + 323, + 397 + ], + [ + 401, + 786 + ], + [ + 787, + 822 + ], + [ + 823, + 1092 + ], + [ + 1094, + 1291 + ], + [ + 1294, + 1332 + ], + [ + 1335, + 1374 + ], + [ + 1376, + 2236 + ], + [ + 2271, + 2278 + ], + [ + 2325, + 2331 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 22 + ], + [ + 27, + 28 + ], + [ + 45, + 47 + ], + [ + 50, + 53 + ], + [ + 56, + 57 + ], + [ + 58, + 59 + ], + [ + 62, + 63 + ], + [ + 64, + 68 + ], + [ + 73, + 76 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 89, + 90 + ], + [ + 91, + 95 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 108, + 109 + ], + [ + 110, + 114 + ], + [ + 119, + 123 + ], + [ + 128, + 136 + ], + [ + 141, + 144 + ], + [ + 149, + 154 + ], + [ + 159, + 162 + ], + [ + 167, + 170 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 183, + 189 + ], + [ + 194, + 199 + ], + [ + 204, + 205 + ], + [ + 213, + 214 + ], + [ + 217, + 218 + ], + [ + 219, + 225 + ], + [ + 230, + 236 + ], + [ + 241, + 242 + ], + [ + 247, + 248 + ], + [ + 251, + 252 + ], + [ + 253, + 259 + ], + [ + 264, + 269 + ], + [ + 274, + 275 + ], + [ + 279, + 280 + ], + [ + 283, + 284 + ], + [ + 285, + 291 + ], + [ + 296, + 308 + ], + [ + 313, + 314 + ], + [ + 326, + 327 + ], + [ + 330, + 331 + ], + [ + 332, + 333 + ], + [ + 334, + 338 + ], + [ + 343, + 349 + ], + [ + 354, + 355 + ], + [ + 361, + 362 + ], + [ + 365, + 366 + ], + [ + 367, + 368 + ], + [ + 369, + 373 + ], + [ + 378, + 388 + ], + [ + 393, + 394 + ], + [ + 404, + 406 + ], + [ + 409, + 410 + ], + [ + 411, + 412 + ], + [ + 413, + 417 + ], + [ + 420, + 421 + ], + [ + 424, + 426 + ], + [ + 429, + 433 + ], + [ + 436, + 437 + ], + [ + 438, + 445 + ], + [ + 450, + 453 + ], + [ + 458, + 459 + ], + [ + 464, + 465 + ], + [ + 468, + 469 + ], + [ + 470, + 471 + ], + [ + 472, + 476 + ], + [ + 479, + 480 + ], + [ + 484, + 487 + ], + [ + 488, + 489 + ], + [ + 492, + 494 + ], + [ + 497, + 498 + ], + [ + 499, + 503 + ], + [ + 508, + 509 + ], + [ + 510, + 511 + ], + [ + 516, + 517 + ], + [ + 518, + 522 + ], + [ + 527, + 528 + ], + [ + 529, + 530 + ], + [ + 535, + 536 + ], + [ + 537, + 541 + ], + [ + 546, + 547 + ], + [ + 548, + 549 + ], + [ + 554, + 555 + ], + [ + 556, + 560 + ], + [ + 565, + 566 + ], + [ + 567, + 568 + ], + [ + 573, + 574 + ], + [ + 575, + 579 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 592, + 593 + ], + [ + 594, + 598 + ], + [ + 603, + 604 + ], + [ + 605, + 606 + ], + [ + 611, + 612 + ], + [ + 613, + 617 + ], + [ + 622, + 623 + ], + [ + 624, + 625 + ], + [ + 630, + 631 + ], + [ + 632, + 636 + ], + [ + 641, + 642 + ], + [ + 643, + 644 + ], + [ + 649, + 650 + ], + [ + 651, + 655 + ], + [ + 660, + 661 + ], + [ + 662, + 663 + ], + [ + 668, + 669 + ], + [ + 670, + 674 + ], + [ + 679, + 682 + ], + [ + 687, + 688 + ], + [ + 691, + 692 + ], + [ + 697, + 698 + ], + [ + 699, + 703 + ], + [ + 708, + 712 + ], + [ + 717, + 718 + ], + [ + 722, + 723 + ], + [ + 728, + 729 + ], + [ + 730, + 734 + ], + [ + 739, + 744 + ], + [ + 749, + 750 + ], + [ + 755, + 756 + ], + [ + 759, + 760 + ], + [ + 761, + 762 + ], + [ + 763, + 767 + ], + [ + 772, + 777 + ], + [ + 782, + 783 + ], + [ + 790, + 791 + ], + [ + 796, + 802 + ], + [ + 807, + 813 + ], + [ + 818, + 819 + ], + [ + 826, + 827 + ], + [ + 830, + 831 + ], + [ + 832, + 833 + ], + [ + 834, + 838 + ], + [ + 843, + 847 + ], + [ + 852, + 853 + ], + [ + 857, + 858 + ], + [ + 861, + 862 + ], + [ + 863, + 864 + ], + [ + 865, + 869 + ], + [ + 874, + 879 + ], + [ + 884, + 885 + ], + [ + 889, + 893 + ], + [ + 895, + 897 + ], + [ + 898, + 899 + ], + [ + 902, + 903 + ], + [ + 904, + 905 + ], + [ + 906, + 910 + ], + [ + 915, + 916 + ], + [ + 917, + 918 + ], + [ + 921, + 922 + ], + [ + 923, + 924 + ], + [ + 925, + 929 + ], + [ + 934, + 935 + ], + [ + 936, + 937 + ], + [ + 940, + 941 + ], + [ + 942, + 943 + ], + [ + 944, + 948 + ], + [ + 953, + 954 + ], + [ + 955, + 956 + ], + [ + 959, + 960 + ], + [ + 961, + 962 + ], + [ + 963, + 967 + ], + [ + 972, + 973 + ], + [ + 976, + 977 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 984, + 988 + ], + [ + 993, + 994 + ], + [ + 997, + 998 + ], + [ + 1001, + 1002 + ], + [ + 1003, + 1004 + ], + [ + 1005, + 1009 + ], + [ + 1014, + 1015 + ], + [ + 1018, + 1019 + ], + [ + 1022, + 1023 + ], + [ + 1024, + 1025 + ], + [ + 1026, + 1030 + ], + [ + 1035, + 1036 + ], + [ + 1039, + 1040 + ], + [ + 1043, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1047, + 1051 + ], + [ + 1056, + 1060 + ], + [ + 1065, + 1066 + ], + [ + 1070, + 1072 + ], + [ + 1075, + 1076 + ], + [ + 1077, + 1078 + ], + [ + 1079, + 1083 + ], + [ + 1088, + 1089 + ], + [ + 1097, + 1098 + ], + [ + 1101, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1105, + 1109 + ], + [ + 1114, + 1115 + ], + [ + 1119, + 1120 + ], + [ + 1123, + 1124 + ], + [ + 1125, + 1126 + ], + [ + 1127, + 1131 + ], + [ + 1136, + 1137 + ], + [ + 1142, + 1143 + ], + [ + 1146, + 1147 + ], + [ + 1148, + 1149 + ], + [ + 1150, + 1154 + ], + [ + 1159, + 1160 + ], + [ + 1163, + 1164 + ], + [ + 1167, + 1168 + ], + [ + 1169, + 1170 + ], + [ + 1171, + 1175 + ], + [ + 1180, + 1181 + ], + [ + 1184, + 1185 + ], + [ + 1188, + 1189 + ], + [ + 1190, + 1191 + ], + [ + 1192, + 1196 + ], + [ + 1201, + 1202 + ], + [ + 1205, + 1206 + ], + [ + 1209, + 1210 + ], + [ + 1211, + 1212 + ], + [ + 1213, + 1217 + ], + [ + 1222, + 1223 + ], + [ + 1226, + 1227 + ], + [ + 1230, + 1231 + ], + [ + 1232, + 1233 + ], + [ + 1234, + 1238 + ], + [ + 1243, + 1248 + ], + [ + 1253, + 1254 + ], + [ + 1260, + 1261 + ], + [ + 1264, + 1265 + ], + [ + 1266, + 1267 + ], + [ + 1268, + 1272 + ], + [ + 1277, + 1282 + ], + [ + 1287, + 1288 + ], + [ + 1297, + 1300 + ], + [ + 1301, + 1302 + ], + [ + 1305, + 1306 + ], + [ + 1307, + 1308 + ], + [ + 1309, + 1313 + ], + [ + 1318, + 1323 + ], + [ + 1328, + 1329 + ], + [ + 1338, + 1341 + ], + [ + 1342, + 1343 + ], + [ + 1346, + 1347 + ], + [ + 1348, + 1349 + ], + [ + 1350, + 1354 + ], + [ + 1359, + 1365 + ], + [ + 1370, + 1371 + ], + [ + 1379, + 1381 + ], + [ + 1384, + 1385 + ], + [ + 1386, + 1387 + ], + [ + 1388, + 1392 + ], + [ + 1397, + 1401 + ], + [ + 1406, + 1407 + ], + [ + 1411, + 1412 + ], + [ + 1415, + 1416 + ], + [ + 1417, + 1418 + ], + [ + 1419, + 1423 + ], + [ + 1428, + 1429 + ], + [ + 1432, + 1433 + ], + [ + 1436, + 1439 + ], + [ + 1442, + 1449 + ], + [ + 1454, + 1456 + ], + [ + 1461, + 1462 + ], + [ + 1465, + 1466 + ], + [ + 1471, + 1472 + ], + [ + 1473, + 1477 + ], + [ + 1482, + 1484 + ], + [ + 1489, + 1490 + ], + [ + 1493, + 1495 + ], + [ + 1496, + 1497 + ], + [ + 1502, + 1503 + ], + [ + 1504, + 1508 + ], + [ + 1513, + 1516 + ], + [ + 1521, + 1524 + ], + [ + 1529, + 1532 + ], + [ + 1537, + 1538 + ], + [ + 1539, + 1540 + ], + [ + 1543, + 1544 + ], + [ + 1545, + 1551 + ], + [ + 1556, + 1557 + ], + [ + 1560, + 1561 + ], + [ + 1564, + 1565 + ], + [ + 1566, + 1567 + ], + [ + 1568, + 1572 + ], + [ + 1577, + 1578 + ], + [ + 1581, + 1582 + ], + [ + 1585, + 1586 + ], + [ + 1587, + 1588 + ], + [ + 1589, + 1593 + ], + [ + 1598, + 1599 + ], + [ + 1600, + 1601 + ], + [ + 1604, + 1605 + ], + [ + 1606, + 1608 + ], + [ + 1609, + 1612 + ], + [ + 1617, + 1618 + ], + [ + 1621, + 1622 + ], + [ + 1625, + 1626 + ], + [ + 1627, + 1628 + ], + [ + 1629, + 1633 + ], + [ + 1638, + 1639 + ], + [ + 1642, + 1643 + ], + [ + 1646, + 1647 + ], + [ + 1648, + 1649 + ], + [ + 1650, + 1654 + ], + [ + 1659, + 1660 + ], + [ + 1661, + 1662 + ], + [ + 1665, + 1666 + ], + [ + 1667, + 1673 + ], + [ + 1678, + 1679 + ], + [ + 1682, + 1683 + ], + [ + 1686, + 1687 + ], + [ + 1688, + 1689 + ], + [ + 1690, + 1694 + ], + [ + 1699, + 1700 + ], + [ + 1703, + 1704 + ], + [ + 1707, + 1708 + ], + [ + 1709, + 1710 + ], + [ + 1711, + 1715 + ], + [ + 1720, + 1721 + ], + [ + 1724, + 1725 + ], + [ + 1728, + 1729 + ], + [ + 1730, + 1731 + ], + [ + 1732, + 1736 + ], + [ + 1741, + 1742 + ], + [ + 1745, + 1746 + ], + [ + 1749, + 1750 + ], + [ + 1751, + 1752 + ], + [ + 1753, + 1757 + ], + [ + 1762, + 1763 + ], + [ + 1766, + 1767 + ], + [ + 1770, + 1771 + ], + [ + 1772, + 1773 + ], + [ + 1774, + 1778 + ], + [ + 1783, + 1784 + ], + [ + 1787, + 1788 + ], + [ + 1791, + 1792 + ], + [ + 1793, + 1794 + ], + [ + 1795, + 1799 + ], + [ + 1804, + 1805 + ], + [ + 1806, + 1807 + ], + [ + 1810, + 1811 + ], + [ + 1812, + 1818 + ], + [ + 1823, + 1824 + ], + [ + 1827, + 1828 + ], + [ + 1831, + 1832 + ], + [ + 1833, + 1839 + ], + [ + 1844, + 1845 + ], + [ + 1848, + 1849 + ], + [ + 1852, + 1853 + ], + [ + 1854, + 1860 + ], + [ + 1865, + 1866 + ], + [ + 1867, + 1868 + ], + [ + 1871, + 1872 + ], + [ + 1873, + 1879 + ], + [ + 1884, + 1885 + ], + [ + 1888, + 1889 + ], + [ + 1892, + 1893 + ], + [ + 1894, + 1900 + ], + [ + 1905, + 1906 + ], + [ + 1909, + 1910 + ], + [ + 1913, + 1914 + ], + [ + 1915, + 1921 + ], + [ + 1926, + 1927 + ], + [ + 1928, + 1929 + ], + [ + 1932, + 1933 + ], + [ + 1934, + 1940 + ], + [ + 1945, + 1946 + ], + [ + 1949, + 1950 + ], + [ + 1953, + 1954 + ], + [ + 1955, + 1961 + ], + [ + 1966, + 1967 + ], + [ + 1970, + 1971 + ], + [ + 1974, + 1975 + ], + [ + 1976, + 1982 + ], + [ + 1987, + 1988 + ], + [ + 1989, + 1990 + ], + [ + 1993, + 1994 + ], + [ + 1995, + 2001 + ], + [ + 2006, + 2007 + ], + [ + 2010, + 2011 + ], + [ + 2014, + 2015 + ], + [ + 2016, + 2022 + ], + [ + 2027, + 2028 + ], + [ + 2031, + 2032 + ], + [ + 2035, + 2036 + ], + [ + 2037, + 2043 + ], + [ + 2048, + 2049 + ], + [ + 2050, + 2051 + ], + [ + 2054, + 2055 + ], + [ + 2056, + 2057 + ], + [ + 2058, + 2062 + ], + [ + 2067, + 2068 + ], + [ + 2071, + 2072 + ], + [ + 2075, + 2076 + ], + [ + 2077, + 2078 + ], + [ + 2079, + 2083 + ], + [ + 2088, + 2089 + ], + [ + 2092, + 2093 + ], + [ + 2096, + 2097 + ], + [ + 2098, + 2099 + ], + [ + 2100, + 2104 + ], + [ + 2109, + 2110 + ], + [ + 2111, + 2112 + ], + [ + 2115, + 2116 + ], + [ + 2117, + 2118 + ], + [ + 2119, + 2123 + ], + [ + 2128, + 2129 + ], + [ + 2132, + 2133 + ], + [ + 2136, + 2137 + ], + [ + 2138, + 2139 + ], + [ + 2140, + 2144 + ], + [ + 2149, + 2150 + ], + [ + 2153, + 2154 + ], + [ + 2157, + 2158 + ], + [ + 2159, + 2160 + ], + [ + 2161, + 2165 + ], + [ + 2170, + 2174 + ], + [ + 2179, + 2180 + ], + [ + 2181, + 2182 + ], + [ + 2185, + 2186 + ], + [ + 2187, + 2188 + ], + [ + 2190, + 2193 + ], + [ + 2198, + 2199 + ], + [ + 2200, + 2201 + ], + [ + 2204, + 2205 + ], + [ + 2206, + 2207 + ], + [ + 2209, + 2212 + ], + [ + 2217, + 2218 + ], + [ + 2219, + 2220 + ], + [ + 2223, + 2224 + ], + [ + 2225, + 2231 + ], + [ + 2274, + 2275 + ], + [ + 2328, + 2329 + ] + ] + } + }, + { + "filename": "libvips/deprecated/dispatch_types.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 50, + 57 + ], + [ + 58, + 354 + ], + [ + 355, + 637 + ], + [ + 638, + 725 + ], + [ + 728, + 799 + ], + [ + 800, + 837 + ] + ], + "lines_added": [ + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 30 + ], + [ + 35, + 36 + ], + [ + 53, + 54 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 71, + 75 + ], + [ + 81, + 86 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ], + [ + 101, + 106 + ], + [ + 111, + 112 + ], + [ + 115, + 116 + ], + [ + 121, + 126 + ], + [ + 131, + 132 + ], + [ + 135, + 136 + ], + [ + 141, + 146 + ], + [ + 151, + 152 + ], + [ + 155, + 156 + ], + [ + 158, + 161 + ], + [ + 164, + 165 + ], + [ + 169, + 170 + ], + [ + 175, + 176 + ], + [ + 182, + 184 + ], + [ + 185, + 188 + ], + [ + 193, + 194 + ], + [ + 196, + 200 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 210, + 213 + ], + [ + 214, + 215 + ], + [ + 220, + 221 + ], + [ + 226, + 228 + ], + [ + 230, + 231 + ], + [ + 236, + 237 + ], + [ + 240, + 244 + ], + [ + 245, + 246 + ], + [ + 248, + 249 + ], + [ + 251, + 252 + ], + [ + 255, + 259 + ], + [ + 260, + 261 + ], + [ + 266, + 267 + ], + [ + 270, + 272 + ], + [ + 273, + 274 + ], + [ + 279, + 280 + ], + [ + 283, + 285 + ], + [ + 286, + 287 + ], + [ + 292, + 293 + ], + [ + 296, + 299 + ], + [ + 304, + 305 + ], + [ + 308, + 311 + ], + [ + 316, + 321 + ], + [ + 327, + 328 + ], + [ + 329, + 331 + ], + [ + 336, + 341 + ], + [ + 347, + 348 + ], + [ + 349, + 351 + ], + [ + 358, + 359 + ], + [ + 360, + 362 + ], + [ + 367, + 368 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 379, + 384 + ], + [ + 389, + 390 + ], + [ + 393, + 395 + ], + [ + 399, + 400 + ], + [ + 405, + 406 + ], + [ + 412, + 414 + ], + [ + 415, + 418 + ], + [ + 421, + 428 + ], + [ + 431, + 432 + ], + [ + 433, + 434 + ], + [ + 439, + 444 + ], + [ + 449, + 450 + ], + [ + 454, + 457 + ], + [ + 458, + 459 + ], + [ + 464, + 469 + ], + [ + 474, + 475 + ], + [ + 478, + 480 + ], + [ + 484, + 485 + ], + [ + 490, + 491 + ], + [ + 497, + 499 + ], + [ + 500, + 503 + ], + [ + 506, + 508 + ], + [ + 509, + 518 + ], + [ + 522, + 523 + ], + [ + 524, + 525 + ], + [ + 530, + 535 + ], + [ + 540, + 541 + ], + [ + 545, + 548 + ], + [ + 549, + 550 + ], + [ + 555, + 560 + ], + [ + 565, + 566 + ], + [ + 569, + 572 + ], + [ + 574, + 575 + ], + [ + 580, + 585 + ], + [ + 590, + 591 + ], + [ + 592, + 594 + ], + [ + 595, + 596 + ], + [ + 601, + 606 + ], + [ + 611, + 612 + ], + [ + 613, + 616 + ], + [ + 621, + 626 + ], + [ + 631, + 634 + ], + [ + 641, + 646 + ], + [ + 651, + 652 + ], + [ + 655, + 656 + ], + [ + 657, + 658 + ], + [ + 663, + 664 + ], + [ + 667, + 668 + ], + [ + 669, + 670 + ], + [ + 675, + 676 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 687, + 688 + ], + [ + 691, + 692 + ], + [ + 693, + 694 + ], + [ + 699, + 700 + ], + [ + 705, + 706 + ], + [ + 707, + 710 + ], + [ + 711, + 713 + ], + [ + 714, + 715 + ], + [ + 716, + 719 + ], + [ + 721, + 722 + ], + [ + 731, + 732 + ], + [ + 735, + 737 + ], + [ + 738, + 739 + ], + [ + 742, + 743 + ], + [ + 749, + 751 + ], + [ + 752, + 753 + ], + [ + 758, + 763 + ], + [ + 766, + 767 + ], + [ + 771, + 774 + ], + [ + 775, + 776 + ], + [ + 781, + 782 + ], + [ + 785, + 786 + ], + [ + 787, + 788 + ], + [ + 791, + 796 + ], + [ + 803, + 804 + ], + [ + 805, + 807 + ], + [ + 809, + 810 + ], + [ + 811, + 816 + ], + [ + 819, + 820 + ], + [ + 823, + 824 + ], + [ + 825, + 826 + ], + [ + 827, + 828 + ], + [ + 831, + 836 + ] + ] + } + }, + { + "filename": "libvips/deprecated/fits.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 46, + 80 + ], + [ + 84, + 97 + ], + [ + 99, + 107 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 49, + 50 + ], + [ + 53, + 58 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 67, + 69 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 87, + 88 + ], + [ + 93, + 94 + ], + [ + 102, + 103 + ], + [ + 106, + 107 + ] + ] + } + }, + { + "filename": "libvips/deprecated/format.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 39, + 64 + ], + [ + 67, + 74 + ], + [ + 78, + 144 + ], + [ + 146, + 153 + ], + [ + 155, + 169 + ], + [ + 171, + 225 + ], + [ + 227, + 246 + ], + [ + 251, + 330 + ], + [ + 337, + 381 + ], + [ + 388, + 409 + ], + [ + 417, + 432 + ], + [ + 440, + 453 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 42, + 43 + ], + [ + 47, + 48 + ], + [ + 49, + 50 + ], + [ + 52, + 53 + ], + [ + 54, + 55 + ], + [ + 58, + 59 + ], + [ + 60, + 61 + ], + [ + 70, + 71 + ], + [ + 81, + 82 + ], + [ + 87, + 89 + ], + [ + 90, + 93 + ], + [ + 94, + 95 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 111 + ], + [ + 113, + 118 + ], + [ + 119, + 120 + ], + [ + 122, + 132 + ], + [ + 135, + 136 + ], + [ + 140, + 141 + ], + [ + 149, + 150 + ], + [ + 158, + 159 + ], + [ + 163, + 164 + ], + [ + 165, + 166 + ], + [ + 174, + 175 + ], + [ + 178, + 181 + ], + [ + 183, + 186 + ], + [ + 188, + 189 + ], + [ + 191, + 192 + ], + [ + 195, + 196 + ], + [ + 199, + 202 + ], + [ + 203, + 204 + ], + [ + 207, + 208 + ], + [ + 214, + 216 + ], + [ + 217, + 219 + ], + [ + 221, + 222 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 242, + 243 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 263, + 264 + ], + [ + 265, + 269 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 280, + 281 + ], + [ + 287, + 288 + ], + [ + 291, + 292 + ], + [ + 295, + 296 + ], + [ + 300, + 301 + ], + [ + 304, + 305 + ], + [ + 307, + 308 + ], + [ + 309, + 310 + ], + [ + 316, + 318 + ], + [ + 319, + 322 + ], + [ + 323, + 325 + ], + [ + 326, + 327 + ], + [ + 340, + 341 + ], + [ + 346, + 347 + ], + [ + 349, + 350 + ], + [ + 351, + 354 + ], + [ + 356, + 362 + ], + [ + 364, + 365 + ], + [ + 371, + 372 + ], + [ + 373, + 376 + ], + [ + 377, + 378 + ], + [ + 391, + 392 + ], + [ + 395, + 401 + ], + [ + 402, + 403 + ], + [ + 405, + 406 + ], + [ + 420, + 421 + ], + [ + 424, + 427 + ], + [ + 428, + 429 + ], + [ + 443, + 444 + ], + [ + 447, + 450 + ], + [ + 451, + 452 + ] + ] + } + }, + { + "filename": "libvips/deprecated/format_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 39, + 443 + ], + [ + 464, + 470 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 42, + 43 + ], + [ + 47, + 49 + ], + [ + 50, + 51 + ], + [ + 54, + 56 + ], + [ + 59, + 65 + ], + [ + 68, + 69 + ], + [ + 73, + 75 + ], + [ + 76, + 77 + ], + [ + 80, + 82 + ], + [ + 85, + 91 + ], + [ + 94, + 95 + ], + [ + 99, + 101 + ], + [ + 102, + 103 + ], + [ + 106, + 108 + ], + [ + 111, + 117 + ], + [ + 120, + 121 + ], + [ + 125, + 127 + ], + [ + 128, + 129 + ], + [ + 132, + 134 + ], + [ + 137, + 138 + ], + [ + 139, + 143 + ], + [ + 148, + 150 + ], + [ + 155, + 156 + ], + [ + 157, + 158 + ], + [ + 163, + 164 + ], + [ + 166, + 169 + ], + [ + 174, + 176 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 189, + 190 + ], + [ + 192, + 195 + ], + [ + 200, + 202 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 215, + 216 + ], + [ + 218, + 221 + ], + [ + 226, + 228 + ], + [ + 233, + 234 + ], + [ + 235, + 236 + ], + [ + 241, + 242 + ], + [ + 244, + 247 + ], + [ + 252, + 254 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 267, + 269 + ], + [ + 270, + 273 + ], + [ + 278, + 280 + ], + [ + 285, + 286 + ], + [ + 287, + 288 + ], + [ + 293, + 294 + ], + [ + 296, + 299 + ], + [ + 302, + 303 + ], + [ + 304, + 306 + ], + [ + 307, + 308 + ], + [ + 311, + 313 + ], + [ + 316, + 322 + ], + [ + 325, + 326 + ], + [ + 327, + 329 + ], + [ + 330, + 331 + ], + [ + 334, + 336 + ], + [ + 339, + 345 + ], + [ + 348, + 349 + ], + [ + 350, + 352 + ], + [ + 353, + 354 + ], + [ + 357, + 359 + ], + [ + 362, + 368 + ], + [ + 371, + 372 + ], + [ + 373, + 375 + ], + [ + 376, + 377 + ], + [ + 380, + 382 + ], + [ + 385, + 391 + ], + [ + 394, + 395 + ], + [ + 396, + 398 + ], + [ + 399, + 400 + ], + [ + 403, + 405 + ], + [ + 408, + 414 + ], + [ + 417, + 418 + ], + [ + 422, + 424 + ], + [ + 425, + 426 + ], + [ + 429, + 431 + ], + [ + 434, + 440 + ], + [ + 467, + 468 + ] + ] + } + }, + { + "filename": "libvips/deprecated/freq_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 46, + 82 + ], + [ + 86, + 124 + ], + [ + 126, + 316 + ], + [ + 331, + 337 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 49, + 51 + ], + [ + 56, + 59 + ], + [ + 64, + 73 + ], + [ + 78, + 79 + ], + [ + 89, + 91 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 98, + 102 + ], + [ + 107, + 115 + ], + [ + 120, + 121 + ], + [ + 129, + 131 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 138, + 142 + ], + [ + 147, + 150 + ], + [ + 155, + 156 + ], + [ + 160, + 161 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 168, + 172 + ], + [ + 177, + 180 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 195, + 199 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 218 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 229, + 230 + ], + [ + 231, + 232 + ], + [ + 233, + 237 + ], + [ + 242, + 243 + ], + [ + 244, + 245 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 252, + 256 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 271, + 275 + ], + [ + 280, + 281 + ], + [ + 282, + 283 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 290, + 294 + ], + [ + 299, + 300 + ], + [ + 301, + 302 + ], + [ + 305, + 306 + ], + [ + 307, + 308 + ], + [ + 309, + 313 + ], + [ + 334, + 335 + ] + ] + } + }, + { + "filename": "libvips/deprecated/glds_funcs.c", + "line_filter": { + "diff_chunks": [ + [ + 37, + 65 + ], + [ + 76, + 85 + ], + [ + 89, + 256 + ] + ], + "lines_added": [ + [ + 40, + 56 + ], + [ + 61, + 62 + ], + [ + 79, + 82 + ], + [ + 92, + 93 + ], + [ + 94, + 98 + ], + [ + 99, + 103 + ], + [ + 105, + 107 + ], + [ + 112, + 113 + ], + [ + 114, + 120 + ], + [ + 121, + 123 + ], + [ + 124, + 125 + ], + [ + 127, + 129 + ], + [ + 133, + 134 + ], + [ + 138, + 146 + ], + [ + 150, + 152 + ], + [ + 154, + 155 + ], + [ + 156, + 158 + ], + [ + 159, + 164 + ], + [ + 165, + 167 + ], + [ + 168, + 170 + ], + [ + 171, + 172 + ], + [ + 176, + 178 + ], + [ + 180, + 181 + ], + [ + 182, + 184 + ], + [ + 185, + 190 + ], + [ + 191, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 203, + 205 + ], + [ + 207, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 217 + ], + [ + 218, + 223 + ], + [ + 224, + 228 + ], + [ + 232, + 234 + ], + [ + 236, + 237 + ], + [ + 238, + 240 + ], + [ + 241, + 246 + ], + [ + 247, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 255 + ] + ] + } + }, + { + "filename": "libvips/deprecated/hist_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 489 + ], + [ + 491, + 587 + ], + [ + 591, + 631 + ], + [ + 637, + 675 + ], + [ + 677, + 779 + ], + [ + 810, + 816 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 48 + ], + [ + 53, + 56 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 69, + 70 + ], + [ + 71, + 77 + ], + [ + 82, + 85 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 106 + ], + [ + 109, + 112 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 131 + ], + [ + 136, + 137 + ], + [ + 140, + 141 + ], + [ + 144, + 145 + ], + [ + 146, + 152 + ], + [ + 157, + 158 + ], + [ + 159, + 160 + ], + [ + 163, + 164 + ], + [ + 165, + 171 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 184, + 190 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 201, + 202 + ], + [ + 203, + 209 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 224, + 230 + ], + [ + 235, + 236 + ], + [ + 239, + 240 + ], + [ + 245, + 248 + ], + [ + 251, + 252 + ], + [ + 253, + 259 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 271 + ], + [ + 272, + 278 + ], + [ + 283, + 286 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 301, + 305 + ], + [ + 310, + 311 + ], + [ + 312, + 313 + ], + [ + 316, + 317 + ], + [ + 318, + 319 + ], + [ + 320, + 324 + ], + [ + 329, + 331 + ], + [ + 336, + 337 + ], + [ + 340, + 341 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 348, + 352 + ], + [ + 357, + 360 + ], + [ + 365, + 366 + ], + [ + 370, + 371 + ], + [ + 374, + 375 + ], + [ + 376, + 377 + ], + [ + 378, + 382 + ], + [ + 387, + 391 + ], + [ + 396, + 397 + ], + [ + 401, + 402 + ], + [ + 405, + 406 + ], + [ + 407, + 408 + ], + [ + 409, + 413 + ], + [ + 418, + 421 + ], + [ + 426, + 427 + ], + [ + 428, + 429 + ], + [ + 432, + 433 + ], + [ + 434, + 435 + ], + [ + 436, + 440 + ], + [ + 445, + 446 + ], + [ + 447, + 448 + ], + [ + 453, + 456 + ], + [ + 459, + 460 + ], + [ + 461, + 467 + ], + [ + 472, + 480 + ], + [ + 485, + 486 + ], + [ + 494, + 495 + ], + [ + 498, + 499 + ], + [ + 500, + 501 + ], + [ + 502, + 506 + ], + [ + 511, + 513 + ], + [ + 518, + 519 + ], + [ + 522, + 523 + ], + [ + 526, + 527 + ], + [ + 528, + 529 + ], + [ + 530, + 534 + ], + [ + 539, + 542 + ], + [ + 547, + 548 + ], + [ + 552, + 553 + ], + [ + 556, + 557 + ], + [ + 558, + 559 + ], + [ + 560, + 564 + ], + [ + 569, + 578 + ], + [ + 583, + 584 + ], + [ + 594, + 595 + ], + [ + 598, + 599 + ], + [ + 600, + 601 + ], + [ + 602, + 606 + ], + [ + 611, + 622 + ], + [ + 627, + 628 + ], + [ + 640, + 642 + ], + [ + 645, + 646 + ], + [ + 647, + 648 + ], + [ + 649, + 653 + ], + [ + 658, + 666 + ], + [ + 671, + 672 + ], + [ + 680, + 681 + ], + [ + 684, + 685 + ], + [ + 686, + 687 + ], + [ + 688, + 692 + ], + [ + 697, + 699 + ], + [ + 704, + 705 + ], + [ + 708, + 709 + ], + [ + 712, + 713 + ], + [ + 714, + 715 + ], + [ + 716, + 720 + ], + [ + 725, + 728 + ], + [ + 733, + 734 + ], + [ + 735, + 736 + ], + [ + 739, + 740 + ], + [ + 741, + 742 + ], + [ + 743, + 747 + ], + [ + 752, + 755 + ], + [ + 760, + 761 + ], + [ + 764, + 765 + ], + [ + 768, + 769 + ], + [ + 770, + 771 + ], + [ + 772, + 776 + ], + [ + 813, + 814 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_align_bands.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 47, + 100 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 32, + 33 + ], + [ + 50, + 51 + ], + [ + 53, + 54 + ], + [ + 58, + 61 + ], + [ + 62, + 98 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_analyze2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 44, + 76 + ], + [ + 78, + 91 + ], + [ + 93, + 101 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 47, + 48 + ], + [ + 49, + 51 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 60, + 61 + ], + [ + 64, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 81, + 82 + ], + [ + 87, + 88 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_benchmark.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 57, + 70 + ], + [ + 81, + 88 + ], + [ + 106, + 138 + ], + [ + 145, + 152 + ], + [ + 155, + 163 + ], + [ + 166, + 173 + ], + [ + 175, + 238 + ], + [ + 253, + 283 + ], + [ + 292, + 304 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 66, + 67 + ], + [ + 84, + 85 + ], + [ + 109, + 110 + ], + [ + 114, + 115 + ], + [ + 118, + 121 + ], + [ + 125, + 126 + ], + [ + 128, + 129 + ], + [ + 134, + 135 + ], + [ + 148, + 149 + ], + [ + 158, + 160 + ], + [ + 169, + 170 + ], + [ + 178, + 179 + ], + [ + 181, + 182 + ], + [ + 183, + 185 + ], + [ + 186, + 187 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 197, + 199 + ], + [ + 202, + 203 + ], + [ + 204, + 206 + ], + [ + 209, + 211 + ], + [ + 214, + 221 + ], + [ + 224, + 226 + ], + [ + 229, + 230 + ], + [ + 233, + 235 + ], + [ + 256, + 257 + ], + [ + 260, + 261 + ], + [ + 263, + 267 + ], + [ + 273, + 274 + ], + [ + 275, + 278 + ], + [ + 279, + 280 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 299, + 303 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_bernd.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 8 + ], + [ + 18, + 46 + ], + [ + 55, + 94 + ] + ], + "lines_added": [ + [ + 3, + 5 + ], + [ + 21, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 37 + ], + [ + 42, + 43 + ], + [ + 58, + 59 + ], + [ + 64, + 68 + ], + [ + 69, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 79, + 80 + ], + [ + 83, + 89 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_clamp.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 52, + 126 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 55, + 75 + ], + [ + 76, + 108 + ], + [ + 110, + 118 + ], + [ + 120, + 123 + ], + [ + 124, + 125 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_cmulnorm.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 16, + 44 + ], + [ + 60, + 84 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 35 + ], + [ + 40, + 41 + ], + [ + 63, + 64 + ], + [ + 65, + 66 + ], + [ + 72, + 74 + ], + [ + 77, + 83 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_convsub.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 49 + ], + [ + 59, + 358 + ] + ], + "lines_added": [ + [ + 19, + 20 + ], + [ + 24, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 40 + ], + [ + 45, + 46 + ], + [ + 62, + 64 + ], + [ + 66, + 68 + ], + [ + 73, + 74 + ], + [ + 76, + 82 + ], + [ + 87, + 89 + ], + [ + 91, + 92 + ], + [ + 96, + 100 + ], + [ + 103, + 105 + ], + [ + 107, + 109 + ], + [ + 113, + 116 + ], + [ + 118, + 123 + ], + [ + 124, + 131 + ], + [ + 133, + 134 + ], + [ + 136, + 137 + ], + [ + 138, + 140 + ], + [ + 143, + 144 + ], + [ + 145, + 150 + ], + [ + 151, + 152 + ], + [ + 154, + 156 + ], + [ + 161, + 163 + ], + [ + 166, + 167 + ], + [ + 169, + 171 + ], + [ + 172, + 174 + ], + [ + 179, + 184 + ], + [ + 185, + 192 + ], + [ + 193, + 194 + ], + [ + 195, + 199 + ], + [ + 202, + 203 + ], + [ + 204, + 209 + ], + [ + 212, + 213 + ], + [ + 214, + 219 + ], + [ + 221, + 223 + ], + [ + 224, + 225 + ], + [ + 226, + 229 + ], + [ + 230, + 232 + ], + [ + 233, + 234 + ], + [ + 235, + 239 + ], + [ + 240, + 246 + ], + [ + 247, + 248 + ], + [ + 252, + 255 + ], + [ + 257, + 260 + ], + [ + 261, + 262 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 268, + 272 + ], + [ + 273, + 280 + ], + [ + 281, + 288 + ], + [ + 289, + 290 + ], + [ + 291, + 293 + ], + [ + 294, + 295 + ], + [ + 296, + 299 + ], + [ + 301, + 303 + ], + [ + 305, + 307 + ], + [ + 308, + 310 + ], + [ + 312, + 323 + ], + [ + 324, + 325 + ], + [ + 327, + 341 + ], + [ + 342, + 357 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_csv2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 48, + 55 + ], + [ + 65, + 98 + ], + [ + 102, + 115 + ], + [ + 116, + 124 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 51, + 52 + ], + [ + 68, + 69 + ], + [ + 70, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 79 + ], + [ + 81, + 91 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 105, + 106 + ], + [ + 111, + 112 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_debugim.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 24, + 52 + ], + [ + 59, + 160 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 27, + 28 + ], + [ + 29, + 33 + ], + [ + 34, + 43 + ], + [ + 48, + 49 + ], + [ + 62, + 64 + ], + [ + 65, + 71 + ], + [ + 75, + 77 + ], + [ + 78, + 83 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 90, + 92 + ], + [ + 93, + 98 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 105, + 107 + ], + [ + 108, + 114 + ], + [ + 116, + 117 + ], + [ + 120, + 159 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_dif_std.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 48, + 95 + ], + [ + 96, + 140 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 51, + 54 + ], + [ + 57, + 58 + ], + [ + 62, + 64 + ], + [ + 65, + 67 + ], + [ + 69, + 73 + ], + [ + 74, + 75 + ], + [ + 77, + 78 + ], + [ + 80, + 83 + ], + [ + 87, + 88 + ], + [ + 90, + 92 + ], + [ + 99, + 101 + ], + [ + 102, + 110 + ], + [ + 112, + 119 + ], + [ + 121, + 122 + ], + [ + 124, + 126 + ], + [ + 128, + 129 + ], + [ + 130, + 134 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_exr2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 53, + 94 + ], + [ + 96, + 109 + ], + [ + 111, + 119 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 56, + 57 + ], + [ + 59, + 60 + ], + [ + 61, + 63 + ], + [ + 64, + 65 + ], + [ + 71, + 72 + ], + [ + 76, + 77 + ], + [ + 78, + 80 + ], + [ + 83, + 84 + ], + [ + 88, + 89 + ], + [ + 90, + 91 + ], + [ + 99, + 100 + ], + [ + 105, + 106 + ], + [ + 114, + 115 + ], + [ + 118, + 119 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_fav4.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 32 + ], + [ + 48, + 98 + ] + ], + "lines_added": [ + [ + 7, + 23 + ], + [ + 28, + 29 + ], + [ + 51, + 52 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 59, + 60 + ], + [ + 62, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 97 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_freq_mask.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 39 + ], + [ + 51, + 240 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 30 + ], + [ + 35, + 36 + ], + [ + 54, + 56 + ], + [ + 60, + 65 + ], + [ + 68, + 69 + ], + [ + 70, + 73 + ], + [ + 76, + 80 + ], + [ + 83, + 86 + ], + [ + 89, + 93 + ], + [ + 96, + 99 + ], + [ + 102, + 106 + ], + [ + 109, + 112 + ], + [ + 115, + 119 + ], + [ + 122, + 125 + ], + [ + 128, + 132 + ], + [ + 135, + 138 + ], + [ + 141, + 145 + ], + [ + 148, + 151 + ], + [ + 154, + 157 + ], + [ + 160, + 164 + ], + [ + 167, + 170 + ], + [ + 173, + 177 + ], + [ + 180, + 183 + ], + [ + 186, + 190 + ], + [ + 193, + 195 + ], + [ + 197, + 200 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 206, + 208 + ], + [ + 209, + 210 + ], + [ + 212, + 214 + ], + [ + 217, + 221 + ], + [ + 222, + 224 + ], + [ + 225, + 226 + ], + [ + 229, + 230 + ], + [ + 233, + 237 + ], + [ + 238, + 239 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_gadd.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 17, + 50 + ], + [ + 70, + 130 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 7, + 8 + ], + [ + 20, + 21 + ], + [ + 25, + 26 + ], + [ + 27, + 31 + ], + [ + 32, + 41 + ], + [ + 46, + 47 + ], + [ + 73, + 75 + ], + [ + 80, + 114 + ], + [ + 115, + 116 + ], + [ + 118, + 121 + ], + [ + 123, + 127 + ], + [ + 128, + 129 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_gaddim.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 12 + ], + [ + 23, + 51 + ], + [ + 64, + 311 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 8, + 9 + ], + [ + 26, + 27 + ], + [ + 28, + 32 + ], + [ + 33, + 42 + ], + [ + 47, + 48 + ], + [ + 67, + 95 + ], + [ + 96, + 113 + ], + [ + 115, + 148 + ], + [ + 155, + 157 + ], + [ + 159, + 160 + ], + [ + 165, + 166 + ], + [ + 167, + 230 + ], + [ + 232, + 237 + ], + [ + 239, + 243 + ], + [ + 244, + 253 + ], + [ + 254, + 255 + ], + [ + 257, + 270 + ], + [ + 273, + 283 + ], + [ + 284, + 285 + ], + [ + 286, + 294 + ], + [ + 295, + 306 + ], + [ + 307, + 308 + ], + [ + 309, + 310 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_gfadd.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 24 + ], + [ + 26, + 54 + ], + [ + 65, + 467 + ] + ], + "lines_added": [ + [ + 20, + 21 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 68, + 87 + ], + [ + 89, + 186 + ], + [ + 192, + 194 + ], + [ + 200, + 278 + ], + [ + 279, + 284 + ], + [ + 285, + 318 + ], + [ + 321, + 353 + ], + [ + 354, + 356 + ], + [ + 358, + 374 + ], + [ + 376, + 382 + ], + [ + 383, + 385 + ], + [ + 387, + 393 + ], + [ + 394, + 396 + ], + [ + 398, + 404 + ], + [ + 405, + 407 + ], + [ + 409, + 415 + ], + [ + 416, + 418 + ], + [ + 420, + 424 + ], + [ + 425, + 426 + ], + [ + 427, + 447 + ], + [ + 450, + 453 + ], + [ + 455, + 464 + ], + [ + 465, + 466 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_gradcor.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 42 + ], + [ + 46, + 79 + ], + [ + 80, + 123 + ], + [ + 132, + 145 + ], + [ + 146, + 170 + ], + [ + 186, + 234 + ], + [ + 235, + 251 + ], + [ + 264, + 313 + ], + [ + 314, + 585 + ] + ], + "lines_added": [ + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 35, + 36 + ], + [ + 50, + 76 + ], + [ + 83, + 86 + ], + [ + 88, + 120 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 149, + 151 + ], + [ + 153, + 154 + ], + [ + 155, + 162 + ], + [ + 166, + 167 + ], + [ + 189, + 192 + ], + [ + 194, + 196 + ], + [ + 197, + 203 + ], + [ + 204, + 206 + ], + [ + 207, + 209 + ], + [ + 210, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 216 + ], + [ + 217, + 219 + ], + [ + 220, + 222 + ], + [ + 223, + 225 + ], + [ + 226, + 228 + ], + [ + 229, + 231 + ], + [ + 238, + 241 + ], + [ + 242, + 245 + ], + [ + 267, + 270 + ], + [ + 272, + 274 + ], + [ + 275, + 279 + ], + [ + 280, + 282 + ], + [ + 283, + 285 + ], + [ + 286, + 288 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 293, + 295 + ], + [ + 296, + 298 + ], + [ + 299, + 301 + ], + [ + 302, + 304 + ], + [ + 305, + 307 + ], + [ + 308, + 310 + ], + [ + 317, + 320 + ], + [ + 321, + 324 + ], + [ + 327, + 330 + ], + [ + 331, + 346 + ], + [ + 348, + 351 + ], + [ + 352, + 363 + ], + [ + 365, + 368 + ], + [ + 369, + 501 + ], + [ + 503, + 582 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_jpeg2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 52, + 59 + ], + [ + 68, + 94 + ], + [ + 96, + 182 + ], + [ + 186, + 199 + ], + [ + 202, + 210 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 55, + 56 + ], + [ + 71, + 72 + ], + [ + 75, + 83 + ], + [ + 85, + 87 + ], + [ + 89, + 91 + ], + [ + 99, + 100 + ], + [ + 106, + 107 + ], + [ + 108, + 111 + ], + [ + 114, + 125 + ], + [ + 127, + 129 + ], + [ + 130, + 131 + ], + [ + 133, + 134 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 151, + 152 + ], + [ + 155, + 156 + ], + [ + 159, + 164 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 189, + 190 + ], + [ + 195, + 196 + ], + [ + 205, + 206 + ], + [ + 209, + 210 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_lab_morph.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 49, + 78 + ], + [ + 82, + 92 + ], + [ + 96, + 123 + ], + [ + 128, + 140 + ], + [ + 142, + 154 + ], + [ + 156, + 198 + ], + [ + 208, + 215 + ], + [ + 247, + 255 + ], + [ + 258, + 265 + ], + [ + 266, + 273 + ], + [ + 277, + 310 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 52, + 53 + ], + [ + 54, + 55 + ], + [ + 58, + 63 + ], + [ + 64, + 66 + ], + [ + 68, + 71 + ], + [ + 72, + 73 + ], + [ + 85, + 86 + ], + [ + 87, + 89 + ], + [ + 99, + 103 + ], + [ + 104, + 114 + ], + [ + 119, + 120 + ], + [ + 131, + 135 + ], + [ + 136, + 137 + ], + [ + 145, + 149 + ], + [ + 150, + 151 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 165, + 166 + ], + [ + 169, + 170 + ], + [ + 173, + 195 + ], + [ + 211, + 212 + ], + [ + 250, + 252 + ], + [ + 261, + 262 + ], + [ + 269, + 270 + ], + [ + 280, + 284 + ], + [ + 287, + 290 + ], + [ + 292, + 298 + ], + [ + 299, + 300 + ], + [ + 302, + 306 + ], + [ + 307, + 309 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_line.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 45 + ], + [ + 54, + 153 + ] + ], + "lines_added": [ + [ + 20, + 36 + ], + [ + 41, + 42 + ], + [ + 57, + 59 + ], + [ + 60, + 61 + ], + [ + 63, + 104 + ], + [ + 105, + 109 + ], + [ + 111, + 118 + ], + [ + 119, + 123 + ], + [ + 125, + 134 + ], + [ + 136, + 145 + ], + [ + 147, + 152 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_linreg.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 45 + ], + [ + 51, + 435 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 28 + ], + [ + 29, + 33 + ], + [ + 38, + 39 + ], + [ + 54, + 60 + ], + [ + 63, + 133 + ], + [ + 138, + 139 + ], + [ + 143, + 146 + ], + [ + 147, + 238 + ], + [ + 241, + 245 + ], + [ + 246, + 247 + ], + [ + 248, + 250 + ], + [ + 251, + 252 + ], + [ + 253, + 255 + ], + [ + 256, + 259 + ], + [ + 260, + 266 + ], + [ + 267, + 272 + ], + [ + 273, + 274 + ], + [ + 276, + 435 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_litecor.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 9, + 16 + ], + [ + 32, + 60 + ], + [ + 73, + 82 + ], + [ + 86, + 142 + ], + [ + 144, + 212 + ], + [ + 217, + 281 + ], + [ + 283, + 314 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 12, + 13 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 76, + 79 + ], + [ + 89, + 90 + ], + [ + 91, + 94 + ], + [ + 96, + 97 + ], + [ + 98, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 108 + ], + [ + 109, + 110 + ], + [ + 111, + 113 + ], + [ + 118, + 119 + ], + [ + 123, + 124 + ], + [ + 126, + 127 + ], + [ + 128, + 132 + ], + [ + 136, + 139 + ], + [ + 147, + 150 + ], + [ + 151, + 153 + ], + [ + 156, + 159 + ], + [ + 162, + 165 + ], + [ + 166, + 168 + ], + [ + 169, + 170 + ], + [ + 172, + 176 + ], + [ + 177, + 179 + ], + [ + 182, + 185 + ], + [ + 188, + 191 + ], + [ + 192, + 194 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 206, + 209 + ], + [ + 220, + 221 + ], + [ + 222, + 225 + ], + [ + 227, + 228 + ], + [ + 229, + 231 + ], + [ + 233, + 234 + ], + [ + 235, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 244 + ], + [ + 245, + 246 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 253, + 258 + ], + [ + 264, + 267 + ], + [ + 270, + 272 + ], + [ + 274, + 276 + ], + [ + 277, + 278 + ], + [ + 286, + 295 + ], + [ + 296, + 300 + ], + [ + 302, + 303 + ], + [ + 304, + 308 + ], + [ + 310, + 312 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_magick2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 46, + 70 + ], + [ + 74, + 87 + ], + [ + 93, + 121 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 49, + 50 + ], + [ + 54, + 55 + ], + [ + 56, + 58 + ], + [ + 59, + 60 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 77, + 78 + ], + [ + 83, + 84 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 111, + 116 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_mask2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 59, + 122 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 62, + 63 + ], + [ + 69, + 73 + ], + [ + 77, + 85 + ], + [ + 88, + 90 + ], + [ + 93, + 94 + ], + [ + 96, + 97 + ], + [ + 99, + 101 + ], + [ + 103, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 115, + 119 + ], + [ + 120, + 121 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_matcat.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 58, + 65 + ], + [ + 66, + 76 + ], + [ + 77, + 93 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 61, + 62 + ], + [ + 69, + 73 + ], + [ + 80, + 82 + ], + [ + 85, + 87 + ], + [ + 88, + 90 + ], + [ + 91, + 92 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_matinv.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 44 + ], + [ + 54, + 76 + ], + [ + 81, + 98 + ], + [ + 100, + 218 + ], + [ + 230, + 237 + ], + [ + 238, + 280 + ], + [ + 286, + 293 + ], + [ + 295, + 337 + ], + [ + 339, + 346 + ], + [ + 348, + 388 + ], + [ + 389, + 518 + ] + ], + "lines_added": [ + [ + 19, + 35 + ], + [ + 40, + 41 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 65, + 67 + ], + [ + 68, + 73 + ], + [ + 84, + 86 + ], + [ + 87, + 88 + ], + [ + 94, + 95 + ], + [ + 103, + 107 + ], + [ + 109, + 215 + ], + [ + 233, + 234 + ], + [ + 241, + 246 + ], + [ + 247, + 277 + ], + [ + 289, + 290 + ], + [ + 298, + 302 + ], + [ + 304, + 334 + ], + [ + 342, + 343 + ], + [ + 351, + 354 + ], + [ + 355, + 385 + ], + [ + 392, + 397 + ], + [ + 398, + 401 + ], + [ + 402, + 404 + ], + [ + 405, + 406 + ], + [ + 407, + 410 + ], + [ + 411, + 412 + ], + [ + 413, + 414 + ], + [ + 418, + 423 + ], + [ + 424, + 426 + ], + [ + 427, + 429 + ], + [ + 430, + 431 + ], + [ + 432, + 434 + ], + [ + 435, + 436 + ], + [ + 437, + 438 + ], + [ + 439, + 443 + ], + [ + 444, + 448 + ], + [ + 453, + 513 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_matmul.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 45, + 52 + ], + [ + 59, + 67 + ], + [ + 69, + 101 + ], + [ + 106, + 111 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 48, + 49 + ], + [ + 62, + 64 + ], + [ + 72, + 75 + ], + [ + 79, + 81 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 97, + 98 + ], + [ + 109, + 110 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_mattrn.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 43, + 50 + ], + [ + 54, + 70 + ], + [ + 72, + 82 + ], + [ + 83, + 88 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 46, + 47 + ], + [ + 57, + 59 + ], + [ + 65, + 67 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 86, + 87 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_maxpos_avg.c", + "line_filter": { + "diff_chunks": [ + [ + 23, + 51 + ], + [ + 80, + 218 + ], + [ + 223, + 278 + ], + [ + 279, + 286 + ], + [ + 287, + 329 + ] + ], + "lines_added": [ + [ + 26, + 42 + ], + [ + 47, + 48 + ], + [ + 83, + 84 + ], + [ + 88, + 90 + ], + [ + 92, + 93 + ], + [ + 98, + 99 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 109, + 110 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 122, + 143 + ], + [ + 144, + 147 + ], + [ + 150, + 173 + ], + [ + 174, + 177 + ], + [ + 180, + 205 + ], + [ + 206, + 207 + ], + [ + 211, + 212 + ], + [ + 214, + 215 + ], + [ + 226, + 263 + ], + [ + 264, + 265 + ], + [ + 271, + 272 + ], + [ + 274, + 275 + ], + [ + 282, + 283 + ], + [ + 290, + 291 + ], + [ + 294, + 297 + ], + [ + 298, + 300 + ], + [ + 302, + 305 + ], + [ + 306, + 307 + ], + [ + 310, + 311 + ], + [ + 314, + 316 + ], + [ + 317, + 319 + ], + [ + 320, + 322 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_maxpos_subpel.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 44, + 58 + ], + [ + 88, + 170 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 29 + ], + [ + 34, + 35 + ], + [ + 47, + 49 + ], + [ + 53, + 55 + ], + [ + 91, + 94 + ], + [ + 96, + 169 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_measure.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 26, + 54 + ], + [ + 65, + 75 + ], + [ + 88, + 107 + ], + [ + 110, + 131 + ], + [ + 132, + 143 + ], + [ + 144, + 237 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 68, + 72 + ], + [ + 91, + 92 + ], + [ + 94, + 99 + ], + [ + 103, + 104 + ], + [ + 113, + 114 + ], + [ + 116, + 119 + ], + [ + 121, + 126 + ], + [ + 127, + 128 + ], + [ + 135, + 140 + ], + [ + 147, + 148 + ], + [ + 151, + 156 + ], + [ + 158, + 161 + ], + [ + 164, + 165 + ], + [ + 168, + 171 + ], + [ + 176, + 178 + ], + [ + 181, + 185 + ], + [ + 187, + 188 + ], + [ + 191, + 195 + ], + [ + 201, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 215 + ], + [ + 217, + 220 + ], + [ + 221, + 231 + ], + [ + 232, + 233 + ], + [ + 234, + 235 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_nifti2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 101 + ], + [ + 103, + 116 + ], + [ + 119, + 127 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 58, + 63 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 69, + 75 + ], + [ + 78, + 79 + ], + [ + 83, + 84 + ], + [ + 85, + 87 + ], + [ + 90, + 91 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 106, + 107 + ], + [ + 112, + 113 + ], + [ + 122, + 123 + ], + [ + 126, + 127 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_openslide2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 55, + 62 + ], + [ + 65, + 132 + ], + [ + 134, + 147 + ], + [ + 150, + 158 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 58, + 59 + ], + [ + 68, + 69 + ], + [ + 72, + 78 + ], + [ + 80, + 81 + ], + [ + 83, + 91 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 97, + 105 + ], + [ + 109, + 110 + ], + [ + 114, + 115 + ], + [ + 116, + 118 + ], + [ + 121, + 122 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 137, + 138 + ], + [ + 143, + 144 + ], + [ + 153, + 154 + ], + [ + 157, + 158 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_png2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 49, + 78 + ], + [ + 80, + 93 + ], + [ + 95, + 103 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 52, + 53 + ], + [ + 58, + 59 + ], + [ + 60, + 65 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 83, + 84 + ], + [ + 89, + 90 + ], + [ + 98, + 99 + ], + [ + 102, + 103 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_point_bilinear.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 63, + 100 + ], + [ + 105, + 120 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 31 + ], + [ + 36, + 37 + ], + [ + 66, + 69 + ], + [ + 73, + 79 + ], + [ + 81, + 86 + ], + [ + 88, + 93 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 108, + 109 + ], + [ + 114, + 116 + ], + [ + 117, + 119 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_ppm2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 40, + 72 + ], + [ + 76, + 89 + ], + [ + 92, + 100 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 43, + 44 + ], + [ + 47, + 52 + ], + [ + 53, + 54 + ], + [ + 55, + 56 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 67, + 69 + ], + [ + 79, + 80 + ], + [ + 85, + 86 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_print.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 42, + 51 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 45, + 46 + ], + [ + 47, + 48 + ], + [ + 49, + 50 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_printlines.c", + "line_filter": { + "diff_chunks": [ + [ + 21, + 49 + ], + [ + 56, + 172 + ] + ], + "lines_added": [ + [ + 24, + 40 + ], + [ + 45, + 46 + ], + [ + 59, + 60 + ], + [ + 62, + 95 + ], + [ + 96, + 101 + ], + [ + 102, + 105 + ], + [ + 109, + 111 + ], + [ + 112, + 114 + ], + [ + 115, + 116 + ], + [ + 117, + 119 + ], + [ + 123, + 124 + ], + [ + 126, + 128 + ], + [ + 129, + 131 + ], + [ + 132, + 133 + ], + [ + 134, + 136 + ], + [ + 140, + 141 + ], + [ + 143, + 145 + ], + [ + 146, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 154 + ], + [ + 155, + 156 + ], + [ + 158, + 159 + ], + [ + 160, + 162 + ], + [ + 163, + 168 + ], + [ + 170, + 171 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_resize_linear.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 41 + ], + [ + 52, + 206 + ] + ], + "lines_added": [ + [ + 16, + 32 + ], + [ + 37, + 38 + ], + [ + 55, + 59 + ], + [ + 64, + 68 + ], + [ + 71, + 73 + ], + [ + 76, + 79 + ], + [ + 82, + 84 + ], + [ + 87, + 90 + ], + [ + 93, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 104, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 113 + ], + [ + 114, + 116 + ], + [ + 117, + 119 + ], + [ + 120, + 125 + ], + [ + 126, + 129 + ], + [ + 130, + 132 + ], + [ + 136, + 203 + ], + [ + 204, + 205 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_setbox.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 43 + ], + [ + 50, + 58 + ] + ], + "lines_added": [ + [ + 18, + 34 + ], + [ + 39, + 40 + ], + [ + 53, + 55 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_simcontr.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 63, + 138 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 66, + 68 + ], + [ + 72, + 90 + ], + [ + 92, + 94 + ], + [ + 95, + 98 + ], + [ + 99, + 101 + ], + [ + 102, + 118 + ], + [ + 119, + 125 + ], + [ + 126, + 132 + ], + [ + 133, + 137 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_slice.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 48 + ], + [ + 61, + 170 + ] + ], + "lines_added": [ + [ + 18, + 19 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 64, + 65 + ], + [ + 67, + 88 + ], + [ + 91, + 92 + ], + [ + 94, + 95 + ], + [ + 96, + 98 + ], + [ + 100, + 115 + ], + [ + 116, + 130 + ], + [ + 131, + 134 + ], + [ + 136, + 150 + ], + [ + 151, + 157 + ], + [ + 159, + 162 + ], + [ + 164, + 166 + ], + [ + 168, + 169 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_spatres.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 45 + ], + [ + 54, + 148 + ] + ], + "lines_added": [ + [ + 20, + 36 + ], + [ + 41, + 42 + ], + [ + 57, + 59 + ], + [ + 60, + 62 + ], + [ + 68, + 73 + ], + [ + 74, + 78 + ], + [ + 80, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 105 + ], + [ + 107, + 110 + ], + [ + 114, + 115 + ], + [ + 117, + 118 + ], + [ + 120, + 121 + ], + [ + 123, + 125 + ], + [ + 128, + 130 + ], + [ + 131, + 133 + ], + [ + 134, + 135 + ], + [ + 137, + 147 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_stretch3.c", + "line_filter": { + "diff_chunks": [ + [ + 27, + 55 + ], + [ + 70, + 78 + ], + [ + 84, + 127 + ], + [ + 128, + 148 + ], + [ + 149, + 156 + ], + [ + 164, + 172 + ], + [ + 175, + 202 + ], + [ + 203, + 296 + ], + [ + 299, + 317 + ], + [ + 318, + 327 + ] + ], + "lines_added": [ + [ + 30, + 46 + ], + [ + 51, + 52 + ], + [ + 73, + 75 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 97, + 98 + ], + [ + 103, + 105 + ], + [ + 106, + 110 + ], + [ + 111, + 114 + ], + [ + 116, + 117 + ], + [ + 122, + 124 + ], + [ + 131, + 134 + ], + [ + 135, + 136 + ], + [ + 141, + 145 + ], + [ + 152, + 153 + ], + [ + 167, + 169 + ], + [ + 178, + 187 + ], + [ + 193, + 195 + ], + [ + 198, + 199 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 214, + 217 + ], + [ + 219, + 223 + ], + [ + 224, + 225 + ], + [ + 231, + 232 + ], + [ + 234, + 236 + ], + [ + 239, + 241 + ], + [ + 244, + 246 + ], + [ + 249, + 250 + ], + [ + 253, + 255 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 265, + 267 + ], + [ + 268, + 277 + ], + [ + 278, + 280 + ], + [ + 281, + 282 + ], + [ + 283, + 287 + ], + [ + 288, + 290 + ], + [ + 291, + 293 + ], + [ + 302, + 314 + ], + [ + 321, + 324 + ], + [ + 325, + 326 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_thresh.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 45 + ], + [ + 57, + 148 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 20, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 36 + ], + [ + 41, + 42 + ], + [ + 60, + 84 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 92, + 101 + ], + [ + 103, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 111 + ], + [ + 112, + 115 + ], + [ + 117, + 135 + ], + [ + 137, + 140 + ], + [ + 142, + 144 + ], + [ + 146, + 147 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_tiff2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 39 + ], + [ + 54, + 112 + ], + [ + 114, + 134 + ], + [ + 138, + 205 + ], + [ + 207, + 220 + ], + [ + 224, + 232 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 35, + 36 + ], + [ + 57, + 58 + ], + [ + 62, + 66 + ], + [ + 67, + 68 + ], + [ + 71, + 73 + ], + [ + 76, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 89, + 91 + ], + [ + 94, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 108, + 109 + ], + [ + 117, + 118 + ], + [ + 122, + 124 + ], + [ + 125, + 127 + ], + [ + 130, + 131 + ], + [ + 141, + 142 + ], + [ + 143, + 147 + ], + [ + 149, + 152 + ], + [ + 154, + 156 + ], + [ + 158, + 160 + ], + [ + 161, + 162 + ], + [ + 164, + 165 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 187, + 188 + ], + [ + 189, + 191 + ], + [ + 194, + 195 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 210, + 211 + ], + [ + 216, + 217 + ], + [ + 227, + 228 + ], + [ + 231, + 232 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_video_test.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 47, + 59 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 50, + 51 + ], + [ + 52, + 55 + ], + [ + 57, + 58 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2csv.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 39, + 47 + ], + [ + 50, + 65 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 44 + ], + [ + 53, + 54 + ], + [ + 55, + 57 + ], + [ + 60, + 62 + ], + [ + 63, + 64 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2dz.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 48, + 55 + ], + [ + 56, + 69 + ], + [ + 70, + 130 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 51, + 52 + ], + [ + 59, + 60 + ], + [ + 63, + 64 + ], + [ + 65, + 66 + ], + [ + 73, + 75 + ], + [ + 76, + 77 + ], + [ + 78, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 88 + ], + [ + 91, + 102 + ], + [ + 105, + 107 + ], + [ + 110, + 114 + ], + [ + 117, + 129 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2jpeg.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 50, + 59 + ], + [ + 67, + 113 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 53, + 54 + ], + [ + 55, + 56 + ], + [ + 70, + 72 + ], + [ + 73, + 76 + ], + [ + 77, + 79 + ], + [ + 81, + 85 + ], + [ + 87, + 89 + ], + [ + 92, + 93 + ], + [ + 96, + 101 + ], + [ + 102, + 103 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2mask.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 14 + ], + [ + 15, + 43 + ], + [ + 53, + 60 + ], + [ + 69, + 146 + ], + [ + 151, + 199 + ], + [ + 205, + 247 + ] + ], + "lines_added": [ + [ + 10, + 11 + ], + [ + 18, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 34 + ], + [ + 39, + 40 + ], + [ + 56, + 57 + ], + [ + 72, + 73 + ], + [ + 79, + 80 + ], + [ + 82, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 96, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 108, + 109 + ], + [ + 113, + 116 + ], + [ + 118, + 121 + ], + [ + 126, + 128 + ], + [ + 132, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 154, + 155 + ], + [ + 157, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 171, + 174 + ], + [ + 175, + 176 + ], + [ + 179, + 180 + ], + [ + 183, + 184 + ], + [ + 188, + 191 + ], + [ + 194, + 196 + ], + [ + 208, + 210 + ], + [ + 211, + 212 + ], + [ + 213, + 217 + ], + [ + 220, + 221 + ], + [ + 223, + 224 + ], + [ + 225, + 227 + ], + [ + 228, + 229 + ], + [ + 234, + 236 + ], + [ + 239, + 240 + ], + [ + 241, + 243 + ], + [ + 245, + 246 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2png.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 50, + 60 + ], + [ + 63, + 96 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 53, + 54 + ], + [ + 55, + 57 + ], + [ + 66, + 68 + ], + [ + 71, + 75 + ], + [ + 76, + 78 + ], + [ + 81, + 83 + ], + [ + 84, + 89 + ], + [ + 90, + 93 + ], + [ + 94, + 95 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2ppm.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 42, + 49 + ], + [ + 54, + 73 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 45, + 46 + ], + [ + 57, + 60 + ], + [ + 61, + 62 + ], + [ + 64, + 68 + ], + [ + 71, + 72 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2tiff.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 48, + 208 + ], + [ + 211, + 252 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 51, + 52 + ], + [ + 58, + 59 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 68, + 69 + ], + [ + 73, + 75 + ], + [ + 76, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 86, + 87 + ], + [ + 89, + 94 + ], + [ + 98, + 99 + ], + [ + 101, + 102 + ], + [ + 104, + 109 + ], + [ + 113, + 114 + ], + [ + 116, + 122 + ], + [ + 125, + 131 + ], + [ + 134, + 136 + ], + [ + 138, + 144 + ], + [ + 147, + 148 + ], + [ + 150, + 155 + ], + [ + 158, + 160 + ], + [ + 161, + 162 + ], + [ + 164, + 169 + ], + [ + 172, + 174 + ], + [ + 175, + 176 + ], + [ + 178, + 183 + ], + [ + 186, + 188 + ], + [ + 189, + 190 + ], + [ + 192, + 197 + ], + [ + 199, + 205 + ], + [ + 214, + 215 + ], + [ + 221, + 223 + ], + [ + 224, + 225 + ], + [ + 227, + 231 + ], + [ + 233, + 251 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2webp.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 28 + ], + [ + 44, + 54 + ], + [ + 55, + 71 + ] + ], + "lines_added": [ + [ + 3, + 19 + ], + [ + 24, + 25 + ], + [ + 47, + 48 + ], + [ + 49, + 51 + ], + [ + 58, + 60 + ], + [ + 63, + 67 + ], + [ + 68, + 70 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_webp2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 28 + ], + [ + 43, + 113 + ], + [ + 115, + 128 + ], + [ + 131, + 141 + ] + ], + "lines_added": [ + [ + 3, + 19 + ], + [ + 24, + 25 + ], + [ + 46, + 47 + ], + [ + 51, + 52 + ], + [ + 54, + 69 + ], + [ + 70, + 72 + ], + [ + 73, + 74 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 87, + 92 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 107, + 108 + ], + [ + 109, + 110 + ], + [ + 118, + 119 + ], + [ + 124, + 125 + ], + [ + 134, + 135 + ], + [ + 138, + 139 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_zerox.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 17, + 45 + ], + [ + 53, + 132 + ], + [ + 133, + 196 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 20, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 36 + ], + [ + 41, + 42 + ], + [ + 56, + 70 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 92, + 93 + ], + [ + 98, + 121 + ], + [ + 123, + 124 + ], + [ + 127, + 129 + ], + [ + 136, + 137 + ], + [ + 141, + 142 + ], + [ + 148, + 150 + ], + [ + 153, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 167 + ], + [ + 169, + 170 + ], + [ + 173, + 175 + ], + [ + 180, + 182 + ], + [ + 185, + 188 + ], + [ + 191, + 193 + ], + [ + 194, + 195 + ] + ] + } + }, + { + "filename": "libvips/deprecated/inplace_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 44, + 209 + ], + [ + 212, + 249 + ], + [ + 251, + 288 + ], + [ + 290, + 328 + ], + [ + 329, + 362 + ], + [ + 364, + 401 + ], + [ + 403, + 444 + ], + [ + 448, + 486 + ], + [ + 487, + 523 + ], + [ + 528, + 567 + ], + [ + 571, + 593 + ], + [ + 610, + 616 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 47, + 48 + ], + [ + 53, + 59 + ], + [ + 61, + 65 + ], + [ + 66, + 67 + ], + [ + 70, + 71 + ], + [ + 75, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 110 + ], + [ + 112, + 113 + ], + [ + 115, + 116 + ], + [ + 121, + 125 + ], + [ + 130, + 131 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 147 + ], + [ + 152, + 160 + ], + [ + 165, + 166 + ], + [ + 172, + 175 + ], + [ + 177, + 179 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 186, + 190 + ], + [ + 195, + 200 + ], + [ + 205, + 206 + ], + [ + 215, + 218 + ], + [ + 219, + 220 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 231 + ], + [ + 236, + 240 + ], + [ + 245, + 246 + ], + [ + 254, + 257 + ], + [ + 258, + 259 + ], + [ + 262, + 263 + ], + [ + 264, + 265 + ], + [ + 266, + 270 + ], + [ + 275, + 279 + ], + [ + 284, + 285 + ], + [ + 293, + 296 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 305, + 309 + ], + [ + 314, + 319 + ], + [ + 324, + 325 + ], + [ + 332, + 333 + ], + [ + 336, + 337 + ], + [ + 338, + 339 + ], + [ + 340, + 344 + ], + [ + 349, + 353 + ], + [ + 358, + 359 + ], + [ + 367, + 370 + ], + [ + 371, + 372 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 379, + 383 + ], + [ + 388, + 392 + ], + [ + 397, + 398 + ], + [ + 406, + 410 + ], + [ + 412, + 413 + ], + [ + 416, + 417 + ], + [ + 418, + 419 + ], + [ + 420, + 424 + ], + [ + 429, + 435 + ], + [ + 440, + 441 + ], + [ + 451, + 454 + ], + [ + 455, + 456 + ], + [ + 459, + 460 + ], + [ + 461, + 462 + ], + [ + 463, + 467 + ], + [ + 472, + 477 + ], + [ + 482, + 483 + ], + [ + 490, + 491 + ], + [ + 494, + 495 + ], + [ + 496, + 497 + ], + [ + 498, + 502 + ], + [ + 507, + 514 + ], + [ + 519, + 520 + ], + [ + 531, + 534 + ], + [ + 535, + 536 + ], + [ + 539, + 540 + ], + [ + 541, + 542 + ], + [ + 543, + 547 + ], + [ + 552, + 558 + ], + [ + 563, + 564 + ], + [ + 574, + 577 + ], + [ + 578, + 579 + ], + [ + 582, + 583 + ], + [ + 584, + 585 + ], + [ + 586, + 590 + ], + [ + 613, + 614 + ] + ] + } + }, + { + "filename": "libvips/deprecated/lazy.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 60 + ], + [ + 63, + 111 + ], + [ + 113, + 136 + ], + [ + 140, + 242 + ], + [ + 246, + 295 + ], + [ + 298, + 331 + ], + [ + 332, + 342 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 66, + 69 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 78, + 81 + ], + [ + 84, + 86 + ], + [ + 89, + 91 + ], + [ + 93, + 94 + ], + [ + 96, + 97 + ], + [ + 98, + 99 + ], + [ + 102, + 103 + ], + [ + 107, + 108 + ], + [ + 116, + 118 + ], + [ + 119, + 121 + ], + [ + 122, + 123 + ], + [ + 125, + 126 + ], + [ + 132, + 133 + ], + [ + 143, + 146 + ], + [ + 147, + 150 + ], + [ + 153, + 156 + ], + [ + 157, + 158 + ], + [ + 164, + 165 + ], + [ + 168, + 174 + ], + [ + 177, + 178 + ], + [ + 183, + 185 + ], + [ + 188, + 189 + ], + [ + 190, + 194 + ], + [ + 195, + 199 + ], + [ + 200, + 201 + ], + [ + 207, + 209 + ], + [ + 212, + 213 + ], + [ + 216, + 218 + ], + [ + 219, + 221 + ], + [ + 222, + 223 + ], + [ + 225, + 230 + ], + [ + 231, + 234 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 249, + 250 + ], + [ + 252, + 253 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 264, + 266 + ], + [ + 269, + 270 + ], + [ + 273, + 274 + ], + [ + 275, + 278 + ], + [ + 281, + 282 + ], + [ + 285, + 287 + ], + [ + 288, + 289 + ], + [ + 291, + 292 + ], + [ + 301, + 305 + ], + [ + 310, + 311 + ], + [ + 312, + 313 + ], + [ + 317, + 318 + ], + [ + 321, + 323 + ], + [ + 324, + 325 + ], + [ + 327, + 328 + ], + [ + 335, + 340 + ] + ] + } + }, + { + "filename": "libvips/deprecated/mask_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 574 + ], + [ + 579, + 589 + ], + [ + 598, + 604 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 48 + ], + [ + 53, + 56 + ], + [ + 61, + 62 + ], + [ + 66, + 69 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 78, + 82 + ], + [ + 87, + 88 + ], + [ + 92, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 108 + ], + [ + 113, + 114 + ], + [ + 119, + 122 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 131, + 135 + ], + [ + 140, + 141 + ], + [ + 146, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 158, + 162 + ], + [ + 167, + 169 + ], + [ + 174, + 175 + ], + [ + 178, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 189, + 193 + ], + [ + 198, + 201 + ], + [ + 206, + 207 + ], + [ + 212, + 217 + ], + [ + 220, + 221 + ], + [ + 222, + 223 + ], + [ + 224, + 228 + ], + [ + 233, + 234 + ], + [ + 239, + 244 + ], + [ + 247, + 248 + ], + [ + 249, + 250 + ], + [ + 251, + 255 + ], + [ + 260, + 263 + ], + [ + 268, + 269 + ], + [ + 274, + 279 + ], + [ + 282, + 283 + ], + [ + 284, + 285 + ], + [ + 286, + 290 + ], + [ + 295, + 296 + ], + [ + 301, + 306 + ], + [ + 309, + 310 + ], + [ + 311, + 312 + ], + [ + 313, + 317 + ], + [ + 322, + 325 + ], + [ + 330, + 331 + ], + [ + 336, + 339 + ], + [ + 340, + 341 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 348, + 352 + ], + [ + 357, + 360 + ], + [ + 365, + 366 + ], + [ + 371, + 374 + ], + [ + 375, + 376 + ], + [ + 379, + 380 + ], + [ + 381, + 382 + ], + [ + 383, + 387 + ], + [ + 390, + 392 + ], + [ + 395, + 397 + ], + [ + 402, + 403 + ], + [ + 407, + 409 + ], + [ + 410, + 411 + ], + [ + 414, + 415 + ], + [ + 416, + 417 + ], + [ + 418, + 422 + ], + [ + 427, + 428 + ], + [ + 432, + 434 + ], + [ + 435, + 436 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 443, + 447 + ], + [ + 452, + 453 + ], + [ + 457, + 459 + ], + [ + 460, + 461 + ], + [ + 464, + 465 + ], + [ + 466, + 467 + ], + [ + 468, + 472 + ], + [ + 477, + 478 + ], + [ + 482, + 484 + ], + [ + 485, + 486 + ], + [ + 489, + 490 + ], + [ + 491, + 492 + ], + [ + 493, + 497 + ], + [ + 500, + 501 + ], + [ + 502, + 504 + ], + [ + 507, + 508 + ], + [ + 509, + 511 + ], + [ + 514, + 515 + ], + [ + 516, + 518 + ], + [ + 521, + 522 + ], + [ + 523, + 525 + ], + [ + 528, + 530 + ], + [ + 533, + 535 + ], + [ + 538, + 544 + ], + [ + 547, + 553 + ], + [ + 556, + 562 + ], + [ + 565, + 571 + ], + [ + 582, + 586 + ], + [ + 601, + 602 + ] + ] + } + }, + { + "filename": "libvips/deprecated/matalloc.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 22 + ], + [ + 25, + 42 + ], + [ + 58, + 128 + ], + [ + 137, + 229 + ] + ], + "lines_added": [ + [ + 18, + 19 + ], + [ + 28, + 29 + ], + [ + 33, + 34 + ], + [ + 38, + 39 + ], + [ + 61, + 62 + ], + [ + 63, + 64 + ], + [ + 65, + 66 + ], + [ + 68, + 70 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 80, + 82 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 92, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 100 + ], + [ + 101, + 102 + ], + [ + 104, + 106 + ], + [ + 107, + 108 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 140, + 142 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 151, + 153 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 160, + 162 + ], + [ + 165, + 168 + ], + [ + 170, + 172 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 181, + 183 + ], + [ + 184, + 185 + ], + [ + 186, + 187 + ], + [ + 190, + 192 + ], + [ + 195, + 198 + ], + [ + 200, + 202 + ], + [ + 206, + 207 + ], + [ + 208, + 209 + ], + [ + 211, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 220, + 222 + ], + [ + 225, + 228 + ] + ] + } + }, + { + "filename": "libvips/deprecated/matlab.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 40, + 65 + ], + [ + 67, + 80 + ], + [ + 82, + 90 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 43, + 44 + ], + [ + 47, + 52 + ], + [ + 53, + 54 + ], + [ + 55, + 56 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 70, + 71 + ], + [ + 76, + 77 + ], + [ + 85, + 86 + ], + [ + 89, + 90 + ] + ] + } + }, + { + "filename": "libvips/deprecated/morph_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 292 + ], + [ + 306, + 312 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 49 + ], + [ + 54, + 55 + ], + [ + 58, + 59 + ], + [ + 62, + 63 + ], + [ + 64, + 70 + ], + [ + 75, + 78 + ], + [ + 83, + 84 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 99 + ], + [ + 104, + 105 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 116, + 120 + ], + [ + 125, + 128 + ], + [ + 133, + 134 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 150 + ], + [ + 155, + 160 + ], + [ + 165, + 166 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 183 + ], + [ + 188, + 191 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 208, + 212 + ], + [ + 215, + 217 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 228, + 234 + ], + [ + 237, + 240 + ], + [ + 243, + 244 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 254, + 258 + ], + [ + 263, + 266 + ], + [ + 271, + 272 + ], + [ + 277, + 278 + ], + [ + 281, + 282 + ], + [ + 283, + 284 + ], + [ + 285, + 289 + ], + [ + 309, + 310 + ] + ] + } + }, + { + "filename": "libvips/deprecated/mosaicing_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 45, + 118 + ], + [ + 122, + 139 + ], + [ + 146, + 193 + ], + [ + 205, + 249 + ], + [ + 253, + 270 + ], + [ + 277, + 295 + ], + [ + 307, + 374 + ], + [ + 379, + 428 + ], + [ + 433, + 486 + ], + [ + 490, + 534 + ], + [ + 540, + 583 + ], + [ + 588, + 732 + ], + [ + 737, + 744 + ], + [ + 749, + 755 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 48, + 54 + ], + [ + 59, + 71 + ], + [ + 76, + 88 + ], + [ + 93, + 109 + ], + [ + 114, + 115 + ], + [ + 125, + 128 + ], + [ + 129, + 130 + ], + [ + 135, + 136 + ], + [ + 149, + 153 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 160, + 166 + ], + [ + 169, + 184 + ], + [ + 189, + 190 + ], + [ + 208, + 213 + ], + [ + 214, + 216 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 223, + 229 + ], + [ + 232, + 233 + ], + [ + 234, + 240 + ], + [ + 245, + 246 + ], + [ + 256, + 259 + ], + [ + 260, + 261 + ], + [ + 266, + 267 + ], + [ + 280, + 284 + ], + [ + 285, + 286 + ], + [ + 291, + 292 + ], + [ + 310, + 315 + ], + [ + 316, + 318 + ], + [ + 319, + 320 + ], + [ + 323, + 324 + ], + [ + 325, + 331 + ], + [ + 334, + 335 + ], + [ + 336, + 342 + ], + [ + 345, + 346 + ], + [ + 347, + 353 + ], + [ + 358, + 359 + ], + [ + 364, + 365 + ], + [ + 370, + 371 + ], + [ + 382, + 385 + ], + [ + 388, + 389 + ], + [ + 390, + 396 + ], + [ + 399, + 400 + ], + [ + 401, + 407 + ], + [ + 412, + 413 + ], + [ + 418, + 419 + ], + [ + 424, + 425 + ], + [ + 436, + 439 + ], + [ + 442, + 443 + ], + [ + 444, + 450 + ], + [ + 453, + 454 + ], + [ + 455, + 461 + ], + [ + 466, + 477 + ], + [ + 482, + 483 + ], + [ + 493, + 496 + ], + [ + 499, + 500 + ], + [ + 501, + 502 + ], + [ + 503, + 507 + ], + [ + 512, + 525 + ], + [ + 530, + 531 + ], + [ + 543, + 545 + ], + [ + 546, + 547 + ], + [ + 550, + 551 + ], + [ + 552, + 553 + ], + [ + 554, + 558 + ], + [ + 563, + 574 + ], + [ + 579, + 580 + ], + [ + 591, + 593 + ], + [ + 596, + 597 + ], + [ + 598, + 599 + ], + [ + 600, + 604 + ], + [ + 609, + 612 + ], + [ + 617, + 618 + ], + [ + 621, + 622 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 630, + 633 + ], + [ + 638, + 639 + ], + [ + 642, + 643 + ], + [ + 646, + 647 + ], + [ + 648, + 649 + ], + [ + 651, + 654 + ], + [ + 659, + 663 + ], + [ + 668, + 669 + ], + [ + 670, + 671 + ], + [ + 674, + 675 + ], + [ + 676, + 677 + ], + [ + 678, + 682 + ], + [ + 684, + 688 + ], + [ + 690, + 693 + ], + [ + 695, + 702 + ], + [ + 704, + 708 + ], + [ + 710, + 714 + ], + [ + 716, + 723 + ], + [ + 728, + 729 + ], + [ + 740, + 741 + ], + [ + 752, + 753 + ] + ] + } + }, + { + "filename": "libvips/deprecated/other_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 344 + ], + [ + 360, + 366 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 51 + ], + [ + 56, + 57 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 71, + 75 + ], + [ + 80, + 84 + ], + [ + 89, + 90 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 107 + ], + [ + 112, + 113 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 126, + 130 + ], + [ + 135, + 137 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 154, + 158 + ], + [ + 163, + 164 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 175, + 179 + ], + [ + 184, + 186 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 197, + 198 + ], + [ + 199, + 200 + ], + [ + 201, + 205 + ], + [ + 210, + 212 + ], + [ + 217, + 218 + ], + [ + 219, + 220 + ], + [ + 221, + 223 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 232, + 238 + ], + [ + 243, + 246 + ], + [ + 251, + 252 + ], + [ + 255, + 256 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 263, + 267 + ], + [ + 272, + 275 + ], + [ + 280, + 281 + ], + [ + 285, + 286 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 293, + 297 + ], + [ + 302, + 303 + ], + [ + 307, + 308 + ], + [ + 311, + 312 + ], + [ + 313, + 314 + ], + [ + 315, + 319 + ], + [ + 324, + 325 + ], + [ + 329, + 330 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 337, + 341 + ], + [ + 363, + 364 + ] + ] + } + }, + { + "filename": "libvips/deprecated/package.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 84, + 541 + ], + [ + 542, + 568 + ], + [ + 588, + 595 + ], + [ + 618, + 627 + ], + [ + 630, + 734 + ], + [ + 735, + 812 + ], + [ + 813, + 1011 + ], + [ + 1013, + 1148 + ], + [ + 1154, + 1197 + ], + [ + 1198, + 1225 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 87, + 90 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 118 + ], + [ + 123, + 126 + ], + [ + 131, + 132 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 154 + ], + [ + 159, + 162 + ], + [ + 167, + 168 + ], + [ + 169, + 171 + ], + [ + 174, + 175 + ], + [ + 176, + 182 + ], + [ + 187, + 190 + ], + [ + 195, + 196 + ], + [ + 199, + 201 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 208, + 214 + ], + [ + 219, + 222 + ], + [ + 227, + 228 + ], + [ + 229, + 231 + ], + [ + 234, + 235 + ], + [ + 236, + 242 + ], + [ + 247, + 250 + ], + [ + 255, + 256 + ], + [ + 262, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 271 + ], + [ + 272, + 278 + ], + [ + 283, + 285 + ], + [ + 290, + 291 + ], + [ + 295, + 298 + ], + [ + 299, + 300 + ], + [ + 303, + 304 + ], + [ + 305, + 311 + ], + [ + 316, + 318 + ], + [ + 323, + 324 + ], + [ + 330, + 332 + ], + [ + 333, + 334 + ], + [ + 337, + 338 + ], + [ + 339, + 345 + ], + [ + 350, + 351 + ], + [ + 356, + 357 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 364, + 365 + ], + [ + 366, + 372 + ], + [ + 377, + 378 + ], + [ + 383, + 384 + ], + [ + 385, + 387 + ], + [ + 388, + 389 + ], + [ + 392, + 393 + ], + [ + 394, + 400 + ], + [ + 405, + 407 + ], + [ + 412, + 413 + ], + [ + 417, + 418 + ], + [ + 419, + 421 + ], + [ + 424, + 425 + ], + [ + 428, + 429 + ], + [ + 430, + 436 + ], + [ + 441, + 442 + ], + [ + 447, + 448 + ], + [ + 453, + 454 + ], + [ + 457, + 458 + ], + [ + 459, + 465 + ], + [ + 470, + 475 + ], + [ + 480, + 481 + ], + [ + 486, + 488 + ], + [ + 491, + 492 + ], + [ + 493, + 499 + ], + [ + 502, + 503 + ], + [ + 508, + 510 + ], + [ + 513, + 514 + ], + [ + 515, + 521 + ], + [ + 526, + 532 + ], + [ + 537, + 538 + ], + [ + 545, + 549 + ], + [ + 550, + 552 + ], + [ + 553, + 554 + ], + [ + 557, + 558 + ], + [ + 559, + 565 + ], + [ + 591, + 592 + ], + [ + 621, + 624 + ], + [ + 633, + 634 + ], + [ + 637, + 643 + ], + [ + 647, + 648 + ], + [ + 649, + 650 + ], + [ + 651, + 652 + ], + [ + 653, + 654 + ], + [ + 660, + 661 + ], + [ + 666, + 667 + ], + [ + 669, + 673 + ], + [ + 677, + 678 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 685, + 690 + ], + [ + 691, + 692 + ], + [ + 698, + 708 + ], + [ + 712, + 717 + ], + [ + 718, + 719 + ], + [ + 722, + 723 + ], + [ + 725, + 729 + ], + [ + 730, + 731 + ], + [ + 738, + 739 + ], + [ + 741, + 744 + ], + [ + 745, + 746 + ], + [ + 749, + 751 + ], + [ + 752, + 755 + ], + [ + 757, + 758 + ], + [ + 760, + 761 + ], + [ + 763, + 764 + ], + [ + 765, + 768 + ], + [ + 770, + 773 + ], + [ + 774, + 776 + ], + [ + 777, + 779 + ], + [ + 781, + 782 + ], + [ + 788, + 789 + ], + [ + 791, + 794 + ], + [ + 796, + 797 + ], + [ + 803, + 804 + ], + [ + 805, + 807 + ], + [ + 808, + 809 + ], + [ + 816, + 817 + ], + [ + 819, + 822 + ], + [ + 827, + 828 + ], + [ + 830, + 833 + ], + [ + 835, + 836 + ], + [ + 841, + 842 + ], + [ + 845, + 848 + ], + [ + 849, + 850 + ], + [ + 855, + 856 + ], + [ + 857, + 859 + ], + [ + 860, + 863 + ], + [ + 865, + 866 + ], + [ + 871, + 872 + ], + [ + 873, + 875 + ], + [ + 876, + 877 + ], + [ + 882, + 883 + ], + [ + 884, + 886 + ], + [ + 887, + 890 + ], + [ + 892, + 893 + ], + [ + 898, + 899 + ], + [ + 900, + 902 + ], + [ + 903, + 904 + ], + [ + 909, + 910 + ], + [ + 911, + 913 + ], + [ + 914, + 918 + ], + [ + 920, + 921 + ], + [ + 926, + 927 + ], + [ + 933, + 935 + ], + [ + 937, + 939 + ], + [ + 945, + 946 + ], + [ + 951, + 952 + ], + [ + 958, + 959 + ], + [ + 963, + 964 + ], + [ + 966, + 968 + ], + [ + 970, + 972 + ], + [ + 976, + 977 + ], + [ + 979, + 980 + ], + [ + 985, + 986 + ], + [ + 992, + 994 + ], + [ + 997, + 1000 + ], + [ + 1001, + 1002 + ], + [ + 1007, + 1008 + ], + [ + 1016, + 1017 + ], + [ + 1023, + 1028 + ], + [ + 1033, + 1035 + ], + [ + 1039, + 1041 + ], + [ + 1046, + 1049 + ], + [ + 1051, + 1052 + ], + [ + 1057, + 1058 + ], + [ + 1061, + 1066 + ], + [ + 1068, + 1069 + ], + [ + 1072, + 1073 + ], + [ + 1076, + 1077 + ], + [ + 1079, + 1083 + ], + [ + 1084, + 1085 + ], + [ + 1088, + 1092 + ], + [ + 1096, + 1097 + ], + [ + 1102, + 1103 + ], + [ + 1109, + 1113 + ], + [ + 1114, + 1115 + ], + [ + 1120, + 1121 + ], + [ + 1127, + 1132 + ], + [ + 1133, + 1134 + ], + [ + 1139, + 1140 + ], + [ + 1143, + 1145 + ], + [ + 1157, + 1158 + ], + [ + 1160, + 1161 + ], + [ + 1163, + 1167 + ], + [ + 1172, + 1174 + ], + [ + 1177, + 1179 + ], + [ + 1182, + 1184 + ], + [ + 1187, + 1188 + ], + [ + 1193, + 1194 + ], + [ + 1201, + 1203 + ], + [ + 1206, + 1208 + ], + [ + 1210, + 1215 + ], + [ + 1219, + 1222 + ], + [ + 1223, + 1224 + ] + ] + } + }, + { + "filename": "libvips/deprecated/radiance.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 40, + 71 + ], + [ + 73, + 86 + ], + [ + 88, + 96 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 43, + 44 + ], + [ + 47, + 52 + ], + [ + 53, + 54 + ], + [ + 55, + 56 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 76, + 77 + ], + [ + 82, + 83 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ] + ] + } + }, + { + "filename": "libvips/deprecated/raw.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 44, + 70 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 47, + 49 + ], + [ + 52, + 59 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ] + ] + } + }, + { + "filename": "libvips/deprecated/rename.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 41, + 422 + ], + [ + 426, + 433 + ], + [ + 436, + 456 + ], + [ + 457, + 575 + ], + [ + 579, + 653 + ], + [ + 672, + 727 + ], + [ + 729, + 802 + ], + [ + 805, + 822 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 44, + 46 + ], + [ + 47, + 48 + ], + [ + 50, + 52 + ], + [ + 53, + 54 + ], + [ + 56, + 58 + ], + [ + 59, + 60 + ], + [ + 62, + 64 + ], + [ + 65, + 66 + ], + [ + 68, + 70 + ], + [ + 71, + 72 + ], + [ + 74, + 76 + ], + [ + 77, + 78 + ], + [ + 80, + 82 + ], + [ + 83, + 84 + ], + [ + 86, + 89 + ], + [ + 91, + 94 + ], + [ + 96, + 100 + ], + [ + 103, + 104 + ], + [ + 107, + 110 + ], + [ + 112, + 115 + ], + [ + 117, + 120 + ], + [ + 122, + 124 + ], + [ + 127, + 130 + ], + [ + 132, + 136 + ], + [ + 137, + 141 + ], + [ + 143, + 147 + ], + [ + 148, + 152 + ], + [ + 154, + 157 + ], + [ + 158, + 161 + ], + [ + 164, + 166 + ], + [ + 167, + 168 + ], + [ + 172, + 173 + ], + [ + 176, + 180 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 190, + 191 + ], + [ + 193, + 195 + ], + [ + 197, + 198 + ], + [ + 199, + 201 + ], + [ + 202, + 203 + ], + [ + 206, + 209 + ], + [ + 210, + 214 + ], + [ + 217, + 218 + ], + [ + 219, + 220 + ], + [ + 223, + 228 + ], + [ + 230, + 232 + ], + [ + 233, + 234 + ], + [ + 236, + 238 + ], + [ + 239, + 240 + ], + [ + 243, + 244 + ], + [ + 245, + 246 + ], + [ + 248, + 250 + ], + [ + 251, + 252 + ], + [ + 255, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 270 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 279, + 282 + ], + [ + 285, + 286 + ], + [ + 287, + 288 + ], + [ + 290, + 292 + ], + [ + 293, + 294 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 303, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 310 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 317, + 318 + ], + [ + 321, + 322 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ], + [ + 329, + 330 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 351, + 352 + ], + [ + 353, + 354 + ], + [ + 357, + 358 + ], + [ + 359, + 360 + ], + [ + 361, + 362 + ], + [ + 364, + 365 + ], + [ + 367, + 368 + ], + [ + 370, + 371 + ], + [ + 373, + 376 + ], + [ + 382, + 393 + ], + [ + 395, + 397 + ], + [ + 400, + 401 + ], + [ + 404, + 405 + ], + [ + 406, + 407 + ], + [ + 408, + 409 + ], + [ + 412, + 414 + ], + [ + 415, + 416 + ], + [ + 417, + 419 + ], + [ + 429, + 430 + ], + [ + 439, + 441 + ], + [ + 444, + 449 + ], + [ + 452, + 453 + ], + [ + 460, + 461 + ], + [ + 464, + 469 + ], + [ + 470, + 471 + ], + [ + 474, + 475 + ], + [ + 478, + 483 + ], + [ + 484, + 485 + ], + [ + 488, + 490 + ], + [ + 493, + 498 + ], + [ + 499, + 500 + ], + [ + 503, + 504 + ], + [ + 505, + 507 + ], + [ + 510, + 511 + ], + [ + 512, + 513 + ], + [ + 515, + 517 + ], + [ + 518, + 519 + ], + [ + 521, + 525 + ], + [ + 526, + 528 + ], + [ + 531, + 532 + ], + [ + 535, + 541 + ], + [ + 542, + 543 + ], + [ + 544, + 545 + ], + [ + 547, + 549 + ], + [ + 550, + 551 + ], + [ + 553, + 555 + ], + [ + 556, + 557 + ], + [ + 562, + 564 + ], + [ + 568, + 569 + ], + [ + 570, + 572 + ], + [ + 582, + 583 + ], + [ + 584, + 585 + ], + [ + 588, + 590 + ], + [ + 594, + 597 + ], + [ + 600, + 602 + ], + [ + 603, + 605 + ], + [ + 606, + 608 + ], + [ + 611, + 614 + ], + [ + 618, + 622 + ], + [ + 623, + 626 + ], + [ + 627, + 630 + ], + [ + 631, + 634 + ], + [ + 635, + 638 + ], + [ + 639, + 642 + ], + [ + 643, + 646 + ], + [ + 647, + 650 + ], + [ + 675, + 677 + ], + [ + 679, + 680 + ], + [ + 683, + 684 + ], + [ + 685, + 687 + ], + [ + 689, + 691 + ], + [ + 692, + 693 + ], + [ + 695, + 697 + ], + [ + 698, + 699 + ], + [ + 701, + 704 + ], + [ + 705, + 706 + ], + [ + 709, + 710 + ], + [ + 711, + 712 + ], + [ + 715, + 716 + ], + [ + 717, + 718 + ], + [ + 721, + 722 + ], + [ + 723, + 724 + ], + [ + 732, + 733 + ], + [ + 736, + 737 + ], + [ + 740, + 742 + ], + [ + 743, + 746 + ], + [ + 749, + 760 + ], + [ + 763, + 765 + ], + [ + 768, + 785 + ], + [ + 787, + 789 + ], + [ + 791, + 794 + ], + [ + 796, + 799 + ], + [ + 808, + 809 + ], + [ + 810, + 811 + ], + [ + 816, + 817 + ], + [ + 818, + 819 + ], + [ + 820, + 821 + ] + ] + } + }, + { + "filename": "libvips/deprecated/resample_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 45, + 107 + ], + [ + 112, + 153 + ], + [ + 154, + 235 + ], + [ + 245, + 251 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 48, + 53 + ], + [ + 58, + 59 + ], + [ + 60, + 65 + ], + [ + 66, + 67 + ], + [ + 72, + 78 + ], + [ + 83, + 96 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 115, + 117 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 128 + ], + [ + 133, + 142 + ], + [ + 147, + 148 + ], + [ + 149, + 150 + ], + [ + 157, + 159 + ], + [ + 162, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 170 + ], + [ + 175, + 179 + ], + [ + 184, + 185 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 201 + ], + [ + 206, + 210 + ], + [ + 215, + 216 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 228, + 232 + ], + [ + 248, + 249 + ] + ] + } + }, + { + "filename": "libvips/deprecated/rotmask.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 44 + ], + [ + 59, + 156 + ] + ], + "lines_added": [ + [ + 19, + 35 + ], + [ + 40, + 41 + ], + [ + 62, + 63 + ], + [ + 67, + 68 + ], + [ + 74, + 84 + ], + [ + 85, + 86 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 100, + 108 + ], + [ + 109, + 110 + ], + [ + 114, + 115 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 129, + 131 + ], + [ + 134, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ] + ] + } + }, + { + "filename": "libvips/deprecated/rw_mask.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 21 + ], + [ + 43, + 50 + ], + [ + 58, + 86 + ], + [ + 106, + 117 + ], + [ + 128, + 138 + ], + [ + 156, + 172 + ], + [ + 180, + 196 + ], + [ + 198, + 227 + ], + [ + 228, + 247 + ], + [ + 257, + 279 + ], + [ + 281, + 310 + ], + [ + 311, + 330 + ], + [ + 340, + 421 + ], + [ + 423, + 430 + ], + [ + 433, + 451 + ], + [ + 457, + 464 + ], + [ + 466, + 503 + ], + [ + 514, + 562 + ], + [ + 570, + 619 + ], + [ + 620, + 650 + ], + [ + 658, + 681 + ], + [ + 688, + 707 + ], + [ + 719, + 741 + ], + [ + 749, + 798 + ], + [ + 806, + 842 + ], + [ + 848, + 863 + ], + [ + 871, + 913 + ], + [ + 920, + 987 + ], + [ + 992, + 1011 + ], + [ + 1016, + 1035 + ], + [ + 1045, + 1063 + ], + [ + 1072, + 1088 + ] + ], + "lines_added": [ + [ + 14, + 15 + ], + [ + 17, + 18 + ], + [ + 46, + 47 + ], + [ + 61, + 62 + ], + [ + 63, + 67 + ], + [ + 68, + 77 + ], + [ + 82, + 83 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 159, + 163 + ], + [ + 164, + 167 + ], + [ + 168, + 169 + ], + [ + 183, + 184 + ], + [ + 185, + 187 + ], + [ + 188, + 191 + ], + [ + 192, + 193 + ], + [ + 201, + 202 + ], + [ + 208, + 210 + ], + [ + 215, + 218 + ], + [ + 222, + 224 + ], + [ + 231, + 234 + ], + [ + 235, + 239 + ], + [ + 240, + 241 + ], + [ + 243, + 244 + ], + [ + 260, + 261 + ], + [ + 267, + 269 + ], + [ + 270, + 274 + ], + [ + 275, + 276 + ], + [ + 284, + 285 + ], + [ + 291, + 293 + ], + [ + 298, + 301 + ], + [ + 305, + 307 + ], + [ + 314, + 317 + ], + [ + 318, + 322 + ], + [ + 323, + 324 + ], + [ + 326, + 327 + ], + [ + 343, + 345 + ], + [ + 350, + 352 + ], + [ + 353, + 357 + ], + [ + 358, + 359 + ], + [ + 361, + 362 + ], + [ + 364, + 365 + ], + [ + 366, + 369 + ], + [ + 371, + 372 + ], + [ + 377, + 378 + ], + [ + 384, + 386 + ], + [ + 387, + 389 + ], + [ + 394, + 403 + ], + [ + 404, + 408 + ], + [ + 409, + 413 + ], + [ + 417, + 418 + ], + [ + 426, + 427 + ], + [ + 436, + 437 + ], + [ + 441, + 443 + ], + [ + 447, + 448 + ], + [ + 460, + 461 + ], + [ + 469, + 471 + ], + [ + 472, + 475 + ], + [ + 477, + 480 + ], + [ + 484, + 485 + ], + [ + 487, + 491 + ], + [ + 493, + 496 + ], + [ + 497, + 498 + ], + [ + 499, + 500 + ], + [ + 517, + 518 + ], + [ + 523, + 525 + ], + [ + 526, + 531 + ], + [ + 532, + 533 + ], + [ + 535, + 539 + ], + [ + 540, + 542 + ], + [ + 543, + 544 + ], + [ + 546, + 550 + ], + [ + 553, + 554 + ], + [ + 556, + 557 + ], + [ + 558, + 559 + ], + [ + 573, + 574 + ], + [ + 578, + 579 + ], + [ + 582, + 585 + ], + [ + 589, + 591 + ], + [ + 595, + 597 + ], + [ + 603, + 605 + ], + [ + 608, + 609 + ], + [ + 610, + 611 + ], + [ + 613, + 614 + ], + [ + 615, + 616 + ], + [ + 623, + 624 + ], + [ + 630, + 631 + ], + [ + 637, + 640 + ], + [ + 641, + 645 + ], + [ + 646, + 647 + ], + [ + 661, + 662 + ], + [ + 668, + 671 + ], + [ + 672, + 673 + ], + [ + 677, + 678 + ], + [ + 691, + 694 + ], + [ + 699, + 701 + ], + [ + 703, + 704 + ], + [ + 722, + 723 + ], + [ + 727, + 730 + ], + [ + 731, + 732 + ], + [ + 734, + 735 + ], + [ + 737, + 738 + ], + [ + 752, + 753 + ], + [ + 757, + 760 + ], + [ + 761, + 762 + ], + [ + 764, + 765 + ], + [ + 767, + 768 + ], + [ + 772, + 774 + ], + [ + 777, + 781 + ], + [ + 782, + 783 + ], + [ + 784, + 785 + ], + [ + 787, + 789 + ], + [ + 792, + 793 + ], + [ + 794, + 795 + ], + [ + 809, + 811 + ], + [ + 815, + 818 + ], + [ + 819, + 822 + ], + [ + 823, + 826 + ], + [ + 827, + 830 + ], + [ + 831, + 834 + ], + [ + 836, + 837 + ], + [ + 838, + 839 + ], + [ + 851, + 853 + ], + [ + 854, + 857 + ], + [ + 859, + 860 + ], + [ + 874, + 876 + ], + [ + 880, + 883 + ], + [ + 884, + 887 + ], + [ + 888, + 893 + ], + [ + 894, + 895 + ], + [ + 896, + 900 + ], + [ + 902, + 905 + ], + [ + 907, + 908 + ], + [ + 909, + 910 + ], + [ + 923, + 925 + ], + [ + 926, + 929 + ], + [ + 931, + 932 + ], + [ + 937, + 940 + ], + [ + 943, + 945 + ], + [ + 950, + 953 + ], + [ + 956, + 958 + ], + [ + 963, + 966 + ], + [ + 969, + 971 + ], + [ + 976, + 979 + ], + [ + 982, + 984 + ], + [ + 995, + 997 + ], + [ + 998, + 999 + ], + [ + 1000, + 1002 + ], + [ + 1003, + 1006 + ], + [ + 1007, + 1008 + ], + [ + 1019, + 1021 + ], + [ + 1022, + 1023 + ], + [ + 1024, + 1026 + ], + [ + 1027, + 1030 + ], + [ + 1031, + 1032 + ], + [ + 1048, + 1049 + ], + [ + 1050, + 1052 + ], + [ + 1053, + 1057 + ], + [ + 1059, + 1060 + ], + [ + 1075, + 1076 + ], + [ + 1077, + 1079 + ], + [ + 1080, + 1084 + ], + [ + 1086, + 1087 + ] + ] + } + }, + { + "filename": "libvips/deprecated/tone.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 45 + ], + [ + 61, + 68 + ], + [ + 71, + 133 + ], + [ + 141, + 189 + ] + ], + "lines_added": [ + [ + 20, + 36 + ], + [ + 41, + 42 + ], + [ + 64, + 65 + ], + [ + 74, + 75 + ], + [ + 78, + 81 + ], + [ + 84, + 87 + ], + [ + 93, + 98 + ], + [ + 102, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 110 + ], + [ + 116, + 119 + ], + [ + 120, + 121 + ], + [ + 122, + 124 + ], + [ + 128, + 130 + ], + [ + 144, + 148 + ], + [ + 149, + 150 + ], + [ + 155, + 157 + ], + [ + 160, + 163 + ], + [ + 169, + 173 + ], + [ + 174, + 177 + ], + [ + 178, + 181 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ] + ] + } + }, + { + "filename": "libvips/deprecated/video_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 45 + ], + [ + 49, + 122 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 42 + ], + [ + 52, + 53 + ], + [ + 54, + 65 + ], + [ + 68, + 76 + ], + [ + 79, + 85 + ], + [ + 88, + 89 + ], + [ + 90, + 93 + ], + [ + 94, + 95 + ], + [ + 98, + 101 + ], + [ + 104, + 110 + ], + [ + 113, + 115 + ], + [ + 118, + 121 + ] + ] + } + }, + { + "filename": "libvips/deprecated/vips7compat.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 73, + 165 + ], + [ + 170, + 182 + ], + [ + 183, + 238 + ], + [ + 239, + 300 + ], + [ + 301, + 377 + ], + [ + 380, + 490 + ], + [ + 492, + 583 + ], + [ + 585, + 606 + ], + [ + 608, + 678 + ], + [ + 681, + 688 + ], + [ + 691, + 769 + ], + [ + 770, + 855 + ], + [ + 868, + 935 + ], + [ + 938, + 993 + ], + [ + 995, + 3466 + ], + [ + 3468, + 3911 + ], + [ + 3916, + 4593 + ], + [ + 4595, + 4712 + ], + [ + 4728, + 4740 + ], + [ + 4750, + 4989 + ], + [ + 4993, + 5010 + ], + [ + 5012, + 5096 + ], + [ + 5098, + 5127 + ], + [ + 5129, + 5551 + ], + [ + 5552, + 5593 + ], + [ + 5600, + 5618 + ], + [ + 5619, + 5821 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 4, + 5 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 86 + ], + [ + 87, + 89 + ], + [ + 92, + 94 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 109, + 110 + ], + [ + 115, + 117 + ], + [ + 121, + 122 + ], + [ + 123, + 128 + ], + [ + 130, + 131 + ], + [ + 137, + 138 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 147, + 148 + ], + [ + 154, + 155 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 173, + 174 + ], + [ + 177, + 179 + ], + [ + 186, + 187 + ], + [ + 190, + 191 + ], + [ + 195, + 196 + ], + [ + 197, + 199 + ], + [ + 201, + 202 + ], + [ + 208, + 209 + ], + [ + 212, + 213 + ], + [ + 214, + 219 + ], + [ + 224, + 225 + ], + [ + 229, + 233 + ], + [ + 234, + 235 + ], + [ + 242, + 243 + ], + [ + 244, + 246 + ], + [ + 247, + 249 + ], + [ + 250, + 252 + ], + [ + 256, + 258 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 267, + 279 + ], + [ + 280, + 284 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 296, + 297 + ], + [ + 304, + 307 + ], + [ + 309, + 310 + ], + [ + 313, + 314 + ], + [ + 317, + 318 + ], + [ + 324, + 328 + ], + [ + 329, + 332 + ], + [ + 333, + 336 + ], + [ + 338, + 340 + ], + [ + 342, + 343 + ], + [ + 348, + 350 + ], + [ + 353, + 356 + ], + [ + 357, + 358 + ], + [ + 363, + 364 + ], + [ + 365, + 366 + ], + [ + 369, + 372 + ], + [ + 373, + 374 + ], + [ + 383, + 384 + ], + [ + 385, + 387 + ], + [ + 389, + 392 + ], + [ + 395, + 396 + ], + [ + 399, + 401 + ], + [ + 402, + 403 + ], + [ + 406, + 407 + ], + [ + 408, + 410 + ], + [ + 412, + 415 + ], + [ + 418, + 419 + ], + [ + 422, + 424 + ], + [ + 425, + 426 + ], + [ + 432, + 434 + ], + [ + 437, + 447 + ], + [ + 449, + 450 + ], + [ + 456, + 458 + ], + [ + 461, + 464 + ], + [ + 465, + 466 + ], + [ + 469, + 470 + ], + [ + 471, + 472 + ], + [ + 473, + 474 + ], + [ + 479, + 480 + ], + [ + 484, + 485 + ], + [ + 486, + 487 + ], + [ + 495, + 496 + ], + [ + 497, + 498 + ], + [ + 503, + 528 + ], + [ + 532, + 559 + ], + [ + 563, + 572 + ], + [ + 577, + 580 + ], + [ + 588, + 595 + ], + [ + 600, + 603 + ], + [ + 611, + 612 + ], + [ + 617, + 622 + ], + [ + 623, + 626 + ], + [ + 627, + 628 + ], + [ + 630, + 655 + ], + [ + 658, + 668 + ], + [ + 673, + 675 + ], + [ + 684, + 685 + ], + [ + 694, + 699 + ], + [ + 700, + 701 + ], + [ + 704, + 705 + ], + [ + 710, + 711 + ], + [ + 715, + 717 + ], + [ + 720, + 723 + ], + [ + 725, + 726 + ], + [ + 731, + 732 + ], + [ + 736, + 737 + ], + [ + 738, + 740 + ], + [ + 743, + 744 + ], + [ + 747, + 748 + ], + [ + 754, + 755 + ], + [ + 756, + 759 + ], + [ + 763, + 766 + ], + [ + 773, + 778 + ], + [ + 782, + 784 + ], + [ + 789, + 792 + ], + [ + 795, + 799 + ], + [ + 800, + 801 + ], + [ + 804, + 805 + ], + [ + 806, + 807 + ], + [ + 810, + 811 + ], + [ + 817, + 818 + ], + [ + 821, + 823 + ], + [ + 824, + 826 + ], + [ + 829, + 830 + ], + [ + 831, + 833 + ], + [ + 836, + 838 + ], + [ + 842, + 843 + ], + [ + 846, + 849 + ], + [ + 850, + 852 + ], + [ + 871, + 878 + ], + [ + 883, + 884 + ], + [ + 885, + 887 + ], + [ + 889, + 891 + ], + [ + 892, + 893 + ], + [ + 894, + 895 + ], + [ + 896, + 898 + ], + [ + 900, + 902 + ], + [ + 903, + 904 + ], + [ + 905, + 906 + ], + [ + 908, + 909 + ], + [ + 912, + 913 + ], + [ + 917, + 918 + ], + [ + 920, + 922 + ], + [ + 923, + 926 + ], + [ + 927, + 928 + ], + [ + 931, + 932 + ], + [ + 941, + 942 + ], + [ + 947, + 948 + ], + [ + 952, + 957 + ], + [ + 958, + 961 + ], + [ + 963, + 964 + ], + [ + 966, + 967 + ], + [ + 970, + 971 + ], + [ + 975, + 976 + ], + [ + 978, + 983 + ], + [ + 984, + 985 + ], + [ + 988, + 990 + ], + [ + 998, + 1000 + ], + [ + 1001, + 1002 + ], + [ + 1005, + 1007 + ], + [ + 1013, + 1014 + ], + [ + 1015, + 1019 + ], + [ + 1022, + 1023 + ], + [ + 1026, + 1027 + ], + [ + 1030, + 1034 + ], + [ + 1037, + 1042 + ], + [ + 1045, + 1047 + ], + [ + 1050, + 1055 + ], + [ + 1056, + 1057 + ], + [ + 1058, + 1059 + ], + [ + 1061, + 1063 + ], + [ + 1066, + 1071 + ], + [ + 1072, + 1073 + ], + [ + 1074, + 1075 + ], + [ + 1077, + 1079 + ], + [ + 1082, + 1087 + ], + [ + 1088, + 1089 + ], + [ + 1090, + 1091 + ], + [ + 1093, + 1095 + ], + [ + 1098, + 1103 + ], + [ + 1104, + 1105 + ], + [ + 1106, + 1107 + ], + [ + 1110, + 1111 + ], + [ + 1112, + 1113 + ], + [ + 1116, + 1117 + ], + [ + 1118, + 1119 + ], + [ + 1121, + 1123 + ], + [ + 1124, + 1125 + ], + [ + 1126, + 1128 + ], + [ + 1131, + 1132 + ], + [ + 1133, + 1134 + ], + [ + 1137, + 1138 + ], + [ + 1139, + 1140 + ], + [ + 1143, + 1144 + ], + [ + 1145, + 1146 + ], + [ + 1149, + 1150 + ], + [ + 1151, + 1152 + ], + [ + 1156, + 1157 + ], + [ + 1158, + 1161 + ], + [ + 1162, + 1170 + ], + [ + 1171, + 1172 + ], + [ + 1173, + 1174 + ], + [ + 1177, + 1178 + ], + [ + 1179, + 1182 + ], + [ + 1183, + 1191 + ], + [ + 1192, + 1193 + ], + [ + 1196, + 1197 + ], + [ + 1198, + 1199 + ], + [ + 1201, + 1204 + ], + [ + 1207, + 1218 + ], + [ + 1219, + 1220 + ], + [ + 1221, + 1222 + ], + [ + 1224, + 1227 + ], + [ + 1230, + 1239 + ], + [ + 1240, + 1241 + ], + [ + 1242, + 1243 + ], + [ + 1246, + 1247 + ], + [ + 1248, + 1249 + ], + [ + 1252, + 1253 + ], + [ + 1256, + 1261 + ], + [ + 1262, + 1263 + ], + [ + 1264, + 1265 + ], + [ + 1268, + 1269 + ], + [ + 1270, + 1273 + ], + [ + 1274, + 1275 + ], + [ + 1278, + 1279 + ], + [ + 1280, + 1282 + ], + [ + 1283, + 1284 + ], + [ + 1287, + 1288 + ], + [ + 1291, + 1298 + ], + [ + 1299, + 1300 + ], + [ + 1301, + 1302 + ], + [ + 1304, + 1306 + ], + [ + 1309, + 1314 + ], + [ + 1315, + 1316 + ], + [ + 1317, + 1318 + ], + [ + 1320, + 1322 + ], + [ + 1325, + 1330 + ], + [ + 1331, + 1332 + ], + [ + 1333, + 1334 + ], + [ + 1336, + 1338 + ], + [ + 1341, + 1346 + ], + [ + 1347, + 1348 + ], + [ + 1349, + 1350 + ], + [ + 1352, + 1354 + ], + [ + 1357, + 1362 + ], + [ + 1363, + 1364 + ], + [ + 1365, + 1366 + ], + [ + 1368, + 1370 + ], + [ + 1373, + 1378 + ], + [ + 1379, + 1380 + ], + [ + 1381, + 1382 + ], + [ + 1384, + 1386 + ], + [ + 1389, + 1396 + ], + [ + 1397, + 1398 + ], + [ + 1399, + 1400 + ], + [ + 1402, + 1404 + ], + [ + 1407, + 1412 + ], + [ + 1413, + 1414 + ], + [ + 1415, + 1416 + ], + [ + 1418, + 1420 + ], + [ + 1423, + 1429 + ], + [ + 1430, + 1431 + ], + [ + 1432, + 1433 + ], + [ + 1435, + 1437 + ], + [ + 1440, + 1446 + ], + [ + 1447, + 1448 + ], + [ + 1449, + 1450 + ], + [ + 1453, + 1455 + ], + [ + 1458, + 1464 + ], + [ + 1465, + 1466 + ], + [ + 1467, + 1468 + ], + [ + 1470, + 1472 + ], + [ + 1475, + 1482 + ], + [ + 1483, + 1484 + ], + [ + 1485, + 1486 + ], + [ + 1488, + 1490 + ], + [ + 1491, + 1492 + ], + [ + 1495, + 1497 + ], + [ + 1500, + 1503 + ], + [ + 1504, + 1509 + ], + [ + 1510, + 1511 + ], + [ + 1512, + 1515 + ], + [ + 1516, + 1517 + ], + [ + 1518, + 1519 + ], + [ + 1521, + 1523 + ], + [ + 1526, + 1532 + ], + [ + 1533, + 1534 + ], + [ + 1535, + 1536 + ], + [ + 1538, + 1540 + ], + [ + 1543, + 1549 + ], + [ + 1550, + 1551 + ], + [ + 1552, + 1553 + ], + [ + 1555, + 1557 + ], + [ + 1560, + 1561 + ], + [ + 1562, + 1563 + ], + [ + 1565, + 1567 + ], + [ + 1570, + 1576 + ], + [ + 1577, + 1578 + ], + [ + 1579, + 1580 + ], + [ + 1582, + 1584 + ], + [ + 1587, + 1593 + ], + [ + 1594, + 1595 + ], + [ + 1596, + 1597 + ], + [ + 1600, + 1601 + ], + [ + 1604, + 1611 + ], + [ + 1612, + 1613 + ], + [ + 1614, + 1615 + ], + [ + 1618, + 1619 + ], + [ + 1620, + 1621 + ], + [ + 1623, + 1625 + ], + [ + 1628, + 1634 + ], + [ + 1635, + 1636 + ], + [ + 1637, + 1638 + ], + [ + 1640, + 1642 + ], + [ + 1645, + 1651 + ], + [ + 1652, + 1653 + ], + [ + 1654, + 1655 + ], + [ + 1657, + 1659 + ], + [ + 1662, + 1668 + ], + [ + 1669, + 1670 + ], + [ + 1671, + 1672 + ], + [ + 1674, + 1676 + ], + [ + 1679, + 1685 + ], + [ + 1686, + 1687 + ], + [ + 1688, + 1689 + ], + [ + 1691, + 1693 + ], + [ + 1696, + 1702 + ], + [ + 1703, + 1704 + ], + [ + 1705, + 1706 + ], + [ + 1708, + 1710 + ], + [ + 1713, + 1719 + ], + [ + 1720, + 1721 + ], + [ + 1722, + 1723 + ], + [ + 1725, + 1727 + ], + [ + 1730, + 1737 + ], + [ + 1738, + 1739 + ], + [ + 1740, + 1741 + ], + [ + 1743, + 1745 + ], + [ + 1748, + 1757 + ], + [ + 1758, + 1759 + ], + [ + 1760, + 1761 + ], + [ + 1763, + 1765 + ], + [ + 1768, + 1775 + ], + [ + 1776, + 1777 + ], + [ + 1778, + 1779 + ], + [ + 1781, + 1783 + ], + [ + 1786, + 1794 + ], + [ + 1795, + 1796 + ], + [ + 1797, + 1798 + ], + [ + 1800, + 1802 + ], + [ + 1805, + 1810 + ], + [ + 1811, + 1812 + ], + [ + 1813, + 1814 + ], + [ + 1816, + 1818 + ], + [ + 1821, + 1826 + ], + [ + 1827, + 1828 + ], + [ + 1829, + 1830 + ], + [ + 1832, + 1834 + ], + [ + 1837, + 1842 + ], + [ + 1843, + 1844 + ], + [ + 1845, + 1846 + ], + [ + 1848, + 1850 + ], + [ + 1853, + 1858 + ], + [ + 1859, + 1860 + ], + [ + 1861, + 1862 + ], + [ + 1865, + 1866 + ], + [ + 1869, + 1874 + ], + [ + 1875, + 1876 + ], + [ + 1877, + 1878 + ], + [ + 1881, + 1882 + ], + [ + 1885, + 1892 + ], + [ + 1893, + 1894 + ], + [ + 1895, + 1896 + ], + [ + 1899, + 1900 + ], + [ + 1903, + 1908 + ], + [ + 1909, + 1910 + ], + [ + 1911, + 1912 + ], + [ + 1914, + 1916 + ], + [ + 1919, + 1927 + ], + [ + 1928, + 1929 + ], + [ + 1930, + 1931 + ], + [ + 1933, + 1936 + ], + [ + 1939, + 1949 + ], + [ + 1950, + 1951 + ], + [ + 1952, + 1953 + ], + [ + 1955, + 1957 + ], + [ + 1962, + 1963 + ], + [ + 1966, + 1973 + ], + [ + 1975, + 1976 + ], + [ + 1977, + 1978 + ], + [ + 1980, + 1981 + ], + [ + 1984, + 1985 + ], + [ + 1986, + 1987 + ], + [ + 1990, + 1991 + ], + [ + 1992, + 1993 + ], + [ + 1996, + 1997 + ], + [ + 1998, + 2007 + ], + [ + 2009, + 2010 + ], + [ + 2011, + 2012 + ], + [ + 2014, + 2015 + ], + [ + 2016, + 2017 + ], + [ + 2020, + 2021 + ], + [ + 2024, + 2029 + ], + [ + 2030, + 2031 + ], + [ + 2032, + 2033 + ], + [ + 2036, + 2037 + ], + [ + 2038, + 2039 + ], + [ + 2041, + 2043 + ], + [ + 2046, + 2051 + ], + [ + 2052, + 2053 + ], + [ + 2054, + 2055 + ], + [ + 2057, + 2059 + ], + [ + 2062, + 2067 + ], + [ + 2068, + 2069 + ], + [ + 2070, + 2071 + ], + [ + 2073, + 2075 + ], + [ + 2078, + 2083 + ], + [ + 2084, + 2085 + ], + [ + 2086, + 2087 + ], + [ + 2090, + 2091 + ], + [ + 2094, + 2100 + ], + [ + 2101, + 2102 + ], + [ + 2103, + 2104 + ], + [ + 2106, + 2108 + ], + [ + 2109, + 2110 + ], + [ + 2112, + 2114 + ], + [ + 2115, + 2116 + ], + [ + 2118, + 2120 + ], + [ + 2121, + 2122 + ], + [ + 2124, + 2126 + ], + [ + 2127, + 2128 + ], + [ + 2130, + 2132 + ], + [ + 2133, + 2134 + ], + [ + 2136, + 2138 + ], + [ + 2139, + 2140 + ], + [ + 2142, + 2144 + ], + [ + 2145, + 2146 + ], + [ + 2148, + 2150 + ], + [ + 2151, + 2152 + ], + [ + 2154, + 2156 + ], + [ + 2157, + 2158 + ], + [ + 2160, + 2162 + ], + [ + 2163, + 2164 + ], + [ + 2167, + 2168 + ], + [ + 2172, + 2178 + ], + [ + 2179, + 2180 + ], + [ + 2181, + 2182 + ], + [ + 2185, + 2186 + ], + [ + 2190, + 2197 + ], + [ + 2198, + 2199 + ], + [ + 2200, + 2201 + ], + [ + 2204, + 2205 + ], + [ + 2209, + 2217 + ], + [ + 2218, + 2219 + ], + [ + 2220, + 2221 + ], + [ + 2224, + 2225 + ], + [ + 2229, + 2234 + ], + [ + 2235, + 2236 + ], + [ + 2237, + 2238 + ], + [ + 2241, + 2242 + ], + [ + 2246, + 2253 + ], + [ + 2254, + 2255 + ], + [ + 2256, + 2257 + ], + [ + 2260, + 2261 + ], + [ + 2265, + 2270 + ], + [ + 2271, + 2272 + ], + [ + 2273, + 2274 + ], + [ + 2277, + 2278 + ], + [ + 2282, + 2289 + ], + [ + 2290, + 2291 + ], + [ + 2292, + 2293 + ], + [ + 2295, + 2297 + ], + [ + 2300, + 2307 + ], + [ + 2308, + 2312 + ], + [ + 2313, + 2314 + ], + [ + 2315, + 2316 + ], + [ + 2318, + 2320 + ], + [ + 2323, + 2333 + ], + [ + 2334, + 2338 + ], + [ + 2339, + 2340 + ], + [ + 2341, + 2342 + ], + [ + 2344, + 2346 + ], + [ + 2349, + 2359 + ], + [ + 2360, + 2364 + ], + [ + 2365, + 2366 + ], + [ + 2367, + 2368 + ], + [ + 2371, + 2372 + ], + [ + 2375, + 2386 + ], + [ + 2387, + 2391 + ], + [ + 2392, + 2393 + ], + [ + 2394, + 2395 + ], + [ + 2398, + 2399 + ], + [ + 2400, + 2402 + ], + [ + 2404, + 2406 + ], + [ + 2409, + 2417 + ], + [ + 2418, + 2422 + ], + [ + 2423, + 2424 + ], + [ + 2425, + 2426 + ], + [ + 2429, + 2430 + ], + [ + 2431, + 2433 + ], + [ + 2435, + 2437 + ], + [ + 2440, + 2446 + ], + [ + 2447, + 2451 + ], + [ + 2452, + 2453 + ], + [ + 2454, + 2455 + ], + [ + 2457, + 2459 + ], + [ + 2462, + 2469 + ], + [ + 2470, + 2474 + ], + [ + 2475, + 2476 + ], + [ + 2477, + 2478 + ], + [ + 2481, + 2482 + ], + [ + 2483, + 2485 + ], + [ + 2487, + 2489 + ], + [ + 2492, + 2499 + ], + [ + 2500, + 2504 + ], + [ + 2505, + 2506 + ], + [ + 2507, + 2508 + ], + [ + 2510, + 2512 + ], + [ + 2515, + 2523 + ], + [ + 2524, + 2528 + ], + [ + 2529, + 2530 + ], + [ + 2531, + 2532 + ], + [ + 2534, + 2537 + ], + [ + 2540, + 2549 + ], + [ + 2550, + 2554 + ], + [ + 2555, + 2556 + ], + [ + 2557, + 2558 + ], + [ + 2561, + 2562 + ], + [ + 2563, + 2565 + ], + [ + 2568, + 2569 + ], + [ + 2572, + 2576 + ], + [ + 2577, + 2578 + ], + [ + 2581, + 2582 + ], + [ + 2583, + 2585 + ], + [ + 2588, + 2589 + ], + [ + 2590, + 2591 + ], + [ + 2593, + 2594 + ], + [ + 2595, + 2598 + ], + [ + 2601, + 2604 + ], + [ + 2605, + 2608 + ], + [ + 2609, + 2610 + ], + [ + 2611, + 2613 + ], + [ + 2614, + 2619 + ], + [ + 2620, + 2624 + ], + [ + 2625, + 2626 + ], + [ + 2629, + 2630 + ], + [ + 2631, + 2633 + ], + [ + 2636, + 2637 + ], + [ + 2640, + 2645 + ], + [ + 2646, + 2647 + ], + [ + 2648, + 2649 + ], + [ + 2652, + 2653 + ], + [ + 2654, + 2656 + ], + [ + 2659, + 2660 + ], + [ + 2663, + 2668 + ], + [ + 2669, + 2670 + ], + [ + 2671, + 2672 + ], + [ + 2675, + 2679 + ], + [ + 2680, + 2682 + ], + [ + 2684, + 2685 + ], + [ + 2686, + 2700 + ], + [ + 2703, + 2704 + ], + [ + 2707, + 2713 + ], + [ + 2714, + 2715 + ], + [ + 2716, + 2717 + ], + [ + 2719, + 2721 + ], + [ + 2722, + 2723 + ], + [ + 2725, + 2727 + ], + [ + 2728, + 2729 + ], + [ + 2731, + 2733 + ], + [ + 2734, + 2735 + ], + [ + 2737, + 2740 + ], + [ + 2743, + 2749 + ], + [ + 2750, + 2751 + ], + [ + 2752, + 2753 + ], + [ + 2755, + 2757 + ], + [ + 2758, + 2760 + ], + [ + 2762, + 2764 + ], + [ + 2765, + 2767 + ], + [ + 2769, + 2771 + ], + [ + 2772, + 2774 + ], + [ + 2776, + 2778 + ], + [ + 2779, + 2781 + ], + [ + 2783, + 2785 + ], + [ + 2786, + 2788 + ], + [ + 2790, + 2792 + ], + [ + 2793, + 2795 + ], + [ + 2797, + 2800 + ], + [ + 2803, + 2809 + ], + [ + 2810, + 2811 + ], + [ + 2812, + 2813 + ], + [ + 2815, + 2817 + ], + [ + 2818, + 2820 + ], + [ + 2822, + 2824 + ], + [ + 2825, + 2827 + ], + [ + 2829, + 2831 + ], + [ + 2832, + 2834 + ], + [ + 2836, + 2838 + ], + [ + 2839, + 2841 + ], + [ + 2843, + 2845 + ], + [ + 2846, + 2848 + ], + [ + 2850, + 2852 + ], + [ + 2853, + 2855 + ], + [ + 2857, + 2859 + ], + [ + 2860, + 2861 + ], + [ + 2864, + 2865 + ], + [ + 2866, + 2867 + ], + [ + 2870, + 2871 + ], + [ + 2872, + 2873 + ], + [ + 2876, + 2877 + ], + [ + 2878, + 2879 + ], + [ + 2882, + 2883 + ], + [ + 2884, + 2885 + ], + [ + 2888, + 2889 + ], + [ + 2890, + 2891 + ], + [ + 2893, + 2895 + ], + [ + 2898, + 2904 + ], + [ + 2905, + 2906 + ], + [ + 2907, + 2908 + ], + [ + 2910, + 2912 + ], + [ + 2915, + 2921 + ], + [ + 2922, + 2923 + ], + [ + 2924, + 2925 + ], + [ + 2927, + 2929 + ], + [ + 2930, + 2931 + ], + [ + 2933, + 2936 + ], + [ + 2939, + 2945 + ], + [ + 2946, + 2947 + ], + [ + 2948, + 2949 + ], + [ + 2951, + 2953 + ], + [ + 2954, + 2955 + ], + [ + 2957, + 2959 + ], + [ + 2960, + 2961 + ], + [ + 2963, + 2965 + ], + [ + 2966, + 2967 + ], + [ + 2969, + 2972 + ], + [ + 2975, + 2981 + ], + [ + 2982, + 2983 + ], + [ + 2984, + 2985 + ], + [ + 2987, + 2989 + ], + [ + 2990, + 2992 + ], + [ + 2994, + 2996 + ], + [ + 2997, + 2999 + ], + [ + 3001, + 3003 + ], + [ + 3004, + 3006 + ], + [ + 3008, + 3010 + ], + [ + 3011, + 3013 + ], + [ + 3015, + 3017 + ], + [ + 3018, + 3020 + ], + [ + 3022, + 3024 + ], + [ + 3025, + 3026 + ], + [ + 3028, + 3030 + ], + [ + 3031, + 3032 + ], + [ + 3034, + 3036 + ], + [ + 3037, + 3038 + ], + [ + 3040, + 3042 + ], + [ + 3045, + 3046 + ], + [ + 3048, + 3050 + ], + [ + 3053, + 3054 + ], + [ + 3056, + 3059 + ], + [ + 3062, + 3068 + ], + [ + 3069, + 3070 + ], + [ + 3071, + 3072 + ], + [ + 3074, + 3076 + ], + [ + 3077, + 3078 + ], + [ + 3080, + 3082 + ], + [ + 3083, + 3084 + ], + [ + 3086, + 3088 + ], + [ + 3089, + 3090 + ], + [ + 3092, + 3094 + ], + [ + 3095, + 3096 + ], + [ + 3098, + 3100 + ], + [ + 3103, + 3109 + ], + [ + 3110, + 3111 + ], + [ + 3112, + 3113 + ], + [ + 3115, + 3117 + ], + [ + 3120, + 3127 + ], + [ + 3128, + 3129 + ], + [ + 3130, + 3131 + ], + [ + 3134, + 3135 + ], + [ + 3138, + 3144 + ], + [ + 3145, + 3146 + ], + [ + 3147, + 3148 + ], + [ + 3150, + 3152 + ], + [ + 3153, + 3154 + ], + [ + 3156, + 3158 + ], + [ + 3159, + 3160 + ], + [ + 3163, + 3164 + ], + [ + 3167, + 3173 + ], + [ + 3174, + 3175 + ], + [ + 3176, + 3177 + ], + [ + 3179, + 3181 + ], + [ + 3182, + 3183 + ], + [ + 3185, + 3187 + ], + [ + 3188, + 3189 + ], + [ + 3191, + 3193 + ], + [ + 3196, + 3201 + ], + [ + 3202, + 3203 + ], + [ + 3204, + 3205 + ], + [ + 3208, + 3210 + ], + [ + 3211, + 3213 + ], + [ + 3216, + 3217 + ], + [ + 3220, + 3221 + ], + [ + 3224, + 3225 + ], + [ + 3228, + 3233 + ], + [ + 3234, + 3235 + ], + [ + 3236, + 3237 + ], + [ + 3240, + 3241 + ], + [ + 3244, + 3252 + ], + [ + 3253, + 3254 + ], + [ + 3255, + 3256 + ], + [ + 3259, + 3260 + ], + [ + 3263, + 3270 + ], + [ + 3271, + 3272 + ], + [ + 3273, + 3274 + ], + [ + 3277, + 3278 + ], + [ + 3281, + 3288 + ], + [ + 3289, + 3290 + ], + [ + 3291, + 3292 + ], + [ + 3295, + 3296 + ], + [ + 3299, + 3305 + ], + [ + 3306, + 3307 + ], + [ + 3308, + 3309 + ], + [ + 3312, + 3313 + ], + [ + 3318, + 3324 + ], + [ + 3325, + 3329 + ], + [ + 3330, + 3331 + ], + [ + 3332, + 3333 + ], + [ + 3336, + 3337 + ], + [ + 3342, + 3349 + ], + [ + 3350, + 3354 + ], + [ + 3355, + 3356 + ], + [ + 3357, + 3358 + ], + [ + 3360, + 3362 + ], + [ + 3364, + 3366 + ], + [ + 3369, + 3393 + ], + [ + 3394, + 3396 + ], + [ + 3399, + 3404 + ], + [ + 3405, + 3406 + ], + [ + 3409, + 3411 + ], + [ + 3412, + 3414 + ], + [ + 3415, + 3419 + ], + [ + 3420, + 3421 + ], + [ + 3423, + 3425 + ], + [ + 3429, + 3433 + ], + [ + 3434, + 3435 + ], + [ + 3436, + 3439 + ], + [ + 3440, + 3441 + ], + [ + 3442, + 3443 + ], + [ + 3445, + 3447 + ], + [ + 3450, + 3455 + ], + [ + 3456, + 3457 + ], + [ + 3458, + 3459 + ], + [ + 3461, + 3463 + ], + [ + 3471, + 3475 + ], + [ + 3476, + 3477 + ], + [ + 3478, + 3481 + ], + [ + 3482, + 3483 + ], + [ + 3484, + 3485 + ], + [ + 3487, + 3489 + ], + [ + 3492, + 3497 + ], + [ + 3498, + 3499 + ], + [ + 3500, + 3501 + ], + [ + 3503, + 3505 + ], + [ + 3508, + 3513 + ], + [ + 3514, + 3515 + ], + [ + 3516, + 3517 + ], + [ + 3519, + 3521 + ], + [ + 3524, + 3529 + ], + [ + 3530, + 3531 + ], + [ + 3532, + 3533 + ], + [ + 3535, + 3537 + ], + [ + 3540, + 3545 + ], + [ + 3546, + 3547 + ], + [ + 3548, + 3549 + ], + [ + 3551, + 3553 + ], + [ + 3556, + 3561 + ], + [ + 3562, + 3563 + ], + [ + 3564, + 3565 + ], + [ + 3567, + 3569 + ], + [ + 3572, + 3577 + ], + [ + 3578, + 3579 + ], + [ + 3580, + 3581 + ], + [ + 3583, + 3585 + ], + [ + 3588, + 3593 + ], + [ + 3594, + 3595 + ], + [ + 3596, + 3597 + ], + [ + 3599, + 3601 + ], + [ + 3604, + 3609 + ], + [ + 3610, + 3611 + ], + [ + 3612, + 3613 + ], + [ + 3615, + 3617 + ], + [ + 3620, + 3625 + ], + [ + 3626, + 3627 + ], + [ + 3628, + 3629 + ], + [ + 3631, + 3633 + ], + [ + 3636, + 3641 + ], + [ + 3642, + 3643 + ], + [ + 3644, + 3645 + ], + [ + 3647, + 3649 + ], + [ + 3652, + 3657 + ], + [ + 3658, + 3659 + ], + [ + 3660, + 3661 + ], + [ + 3663, + 3665 + ], + [ + 3668, + 3673 + ], + [ + 3674, + 3675 + ], + [ + 3676, + 3677 + ], + [ + 3679, + 3681 + ], + [ + 3684, + 3689 + ], + [ + 3690, + 3691 + ], + [ + 3692, + 3693 + ], + [ + 3695, + 3697 + ], + [ + 3700, + 3705 + ], + [ + 3706, + 3707 + ], + [ + 3708, + 3709 + ], + [ + 3711, + 3713 + ], + [ + 3716, + 3721 + ], + [ + 3722, + 3723 + ], + [ + 3724, + 3725 + ], + [ + 3727, + 3730 + ], + [ + 3732, + 3736 + ], + [ + 3737, + 3738 + ], + [ + 3740, + 3744 + ], + [ + 3746, + 3753 + ], + [ + 3754, + 3755 + ], + [ + 3757, + 3759 + ], + [ + 3762, + 3767 + ], + [ + 3768, + 3769 + ], + [ + 3771, + 3773 + ], + [ + 3776, + 3782 + ], + [ + 3784, + 3786 + ], + [ + 3787, + 3789 + ], + [ + 3790, + 3794 + ], + [ + 3795, + 3796 + ], + [ + 3798, + 3800 + ], + [ + 3801, + 3803 + ], + [ + 3804, + 3808 + ], + [ + 3809, + 3810 + ], + [ + 3812, + 3814 + ], + [ + 3817, + 3822 + ], + [ + 3823, + 3824 + ], + [ + 3825, + 3826 + ], + [ + 3828, + 3830 + ], + [ + 3832, + 3833 + ], + [ + 3836, + 3844 + ], + [ + 3845, + 3846 + ], + [ + 3847, + 3848 + ], + [ + 3850, + 3853 + ], + [ + 3856, + 3864 + ], + [ + 3865, + 3866 + ], + [ + 3867, + 3868 + ], + [ + 3870, + 3872 + ], + [ + 3875, + 3883 + ], + [ + 3884, + 3885 + ], + [ + 3886, + 3887 + ], + [ + 3889, + 3892 + ], + [ + 3895, + 3904 + ], + [ + 3905, + 3906 + ], + [ + 3907, + 3908 + ], + [ + 3919, + 3922 + ], + [ + 3924, + 3928 + ], + [ + 3929, + 3930 + ], + [ + 3932, + 3935 + ], + [ + 3937, + 3941 + ], + [ + 3942, + 3943 + ], + [ + 3945, + 3948 + ], + [ + 3950, + 3954 + ], + [ + 3955, + 3956 + ], + [ + 3958, + 3960 + ], + [ + 3963, + 3967 + ], + [ + 3968, + 3969 + ], + [ + 3971, + 3974 + ], + [ + 3976, + 3980 + ], + [ + 3981, + 3982 + ], + [ + 3984, + 3987 + ], + [ + 3989, + 3994 + ], + [ + 3995, + 3996 + ], + [ + 3998, + 4000 + ], + [ + 4003, + 4009 + ], + [ + 4010, + 4011 + ], + [ + 4012, + 4013 + ], + [ + 4015, + 4017 + ], + [ + 4020, + 4026 + ], + [ + 4027, + 4028 + ], + [ + 4029, + 4030 + ], + [ + 4032, + 4034 + ], + [ + 4037, + 4043 + ], + [ + 4044, + 4045 + ], + [ + 4046, + 4047 + ], + [ + 4050, + 4051 + ], + [ + 4054, + 4059 + ], + [ + 4060, + 4061 + ], + [ + 4062, + 4063 + ], + [ + 4065, + 4067 + ], + [ + 4070, + 4076 + ], + [ + 4077, + 4078 + ], + [ + 4079, + 4080 + ], + [ + 4082, + 4084 + ], + [ + 4090, + 4097 + ], + [ + 4098, + 4101 + ], + [ + 4102, + 4105 + ], + [ + 4106, + 4107 + ], + [ + 4109, + 4111 + ], + [ + 4117, + 4124 + ], + [ + 4125, + 4128 + ], + [ + 4129, + 4132 + ], + [ + 4133, + 4134 + ], + [ + 4136, + 4138 + ], + [ + 4141, + 4143 + ], + [ + 4144, + 4147 + ], + [ + 4148, + 4149 + ], + [ + 4150, + 4151 + ], + [ + 4153, + 4155 + ], + [ + 4158, + 4160 + ], + [ + 4161, + 4164 + ], + [ + 4165, + 4166 + ], + [ + 4167, + 4168 + ], + [ + 4171, + 4172 + ], + [ + 4175, + 4177 + ], + [ + 4178, + 4179 + ], + [ + 4180, + 4181 + ], + [ + 4183, + 4185 + ], + [ + 4188, + 4190 + ], + [ + 4191, + 4194 + ], + [ + 4195, + 4196 + ], + [ + 4197, + 4198 + ], + [ + 4200, + 4202 + ], + [ + 4205, + 4207 + ], + [ + 4208, + 4211 + ], + [ + 4212, + 4213 + ], + [ + 4214, + 4215 + ], + [ + 4217, + 4219 + ], + [ + 4222, + 4226 + ], + [ + 4227, + 4228 + ], + [ + 4230, + 4232 + ], + [ + 4235, + 4237 + ], + [ + 4238, + 4241 + ], + [ + 4242, + 4243 + ], + [ + 4244, + 4245 + ], + [ + 4247, + 4249 + ], + [ + 4252, + 4256 + ], + [ + 4257, + 4258 + ], + [ + 4260, + 4262 + ], + [ + 4265, + 4269 + ], + [ + 4270, + 4273 + ], + [ + 4274, + 4275 + ], + [ + 4276, + 4277 + ], + [ + 4279, + 4283 + ], + [ + 4286, + 4293 + ], + [ + 4294, + 4297 + ], + [ + 4298, + 4299 + ], + [ + 4300, + 4301 + ], + [ + 4303, + 4305 + ], + [ + 4308, + 4310 + ], + [ + 4311, + 4314 + ], + [ + 4315, + 4316 + ], + [ + 4317, + 4318 + ], + [ + 4320, + 4322 + ], + [ + 4325, + 4329 + ], + [ + 4330, + 4333 + ], + [ + 4334, + 4335 + ], + [ + 4336, + 4337 + ], + [ + 4339, + 4341 + ], + [ + 4344, + 4346 + ], + [ + 4347, + 4350 + ], + [ + 4351, + 4352 + ], + [ + 4353, + 4354 + ], + [ + 4356, + 4358 + ], + [ + 4361, + 4363 + ], + [ + 4364, + 4368 + ], + [ + 4369, + 4370 + ], + [ + 4371, + 4374 + ], + [ + 4375, + 4376 + ], + [ + 4377, + 4378 + ], + [ + 4380, + 4382 + ], + [ + 4386, + 4389 + ], + [ + 4390, + 4391 + ], + [ + 4394, + 4395 + ], + [ + 4397, + 4400 + ], + [ + 4401, + 4402 + ], + [ + 4403, + 4406 + ], + [ + 4407, + 4408 + ], + [ + 4409, + 4410 + ], + [ + 4413, + 4414 + ], + [ + 4417, + 4420 + ], + [ + 4421, + 4425 + ], + [ + 4426, + 4427 + ], + [ + 4428, + 4431 + ], + [ + 4432, + 4433 + ], + [ + 4434, + 4435 + ], + [ + 4438, + 4439 + ], + [ + 4440, + 4441 + ], + [ + 4444, + 4445 + ], + [ + 4448, + 4451 + ], + [ + 4452, + 4456 + ], + [ + 4457, + 4458 + ], + [ + 4459, + 4462 + ], + [ + 4463, + 4464 + ], + [ + 4465, + 4466 + ], + [ + 4469, + 4470 + ], + [ + 4471, + 4472 + ], + [ + 4475, + 4476 + ], + [ + 4477, + 4479 + ], + [ + 4480, + 4481 + ], + [ + 4484, + 4485 + ], + [ + 4488, + 4489 + ], + [ + 4490, + 4491 + ], + [ + 4493, + 4495 + ], + [ + 4498, + 4504 + ], + [ + 4505, + 4506 + ], + [ + 4509, + 4510 + ], + [ + 4513, + 4515 + ], + [ + 4516, + 4519 + ], + [ + 4520, + 4521 + ], + [ + 4522, + 4523 + ], + [ + 4525, + 4527 + ], + [ + 4532, + 4535 + ], + [ + 4536, + 4541 + ], + [ + 4542, + 4544 + ], + [ + 4545, + 4546 + ], + [ + 4547, + 4548 + ], + [ + 4550, + 4552 + ], + [ + 4553, + 4554 + ], + [ + 4556, + 4558 + ], + [ + 4561, + 4563 + ], + [ + 4564, + 4567 + ], + [ + 4568, + 4569 + ], + [ + 4570, + 4571 + ], + [ + 4573, + 4575 + ], + [ + 4578, + 4582 + ], + [ + 4583, + 4586 + ], + [ + 4587, + 4588 + ], + [ + 4589, + 4590 + ], + [ + 4598, + 4599 + ], + [ + 4603, + 4604 + ], + [ + 4606, + 4607 + ], + [ + 4609, + 4611 + ], + [ + 4614, + 4622 + ], + [ + 4623, + 4626 + ], + [ + 4627, + 4628 + ], + [ + 4629, + 4630 + ], + [ + 4633, + 4634 + ], + [ + 4636, + 4638 + ], + [ + 4641, + 4650 + ], + [ + 4651, + 4654 + ], + [ + 4655, + 4656 + ], + [ + 4657, + 4658 + ], + [ + 4660, + 4663 + ], + [ + 4664, + 4666 + ], + [ + 4670, + 4671 + ], + [ + 4672, + 4673 + ], + [ + 4679, + 4690 + ], + [ + 4692, + 4696 + ], + [ + 4699, + 4701 + ], + [ + 4702, + 4703 + ], + [ + 4705, + 4709 + ], + [ + 4731, + 4732 + ], + [ + 4734, + 4737 + ], + [ + 4753, + 4754 + ], + [ + 4755, + 4756 + ], + [ + 4760, + 4762 + ], + [ + 4763, + 4765 + ], + [ + 4768, + 4769 + ], + [ + 4772, + 4777 + ], + [ + 4778, + 4779 + ], + [ + 4780, + 4781 + ], + [ + 4784, + 4787 + ], + [ + 4788, + 4791 + ], + [ + 4793, + 4795 + ], + [ + 4798, + 4800 + ], + [ + 4801, + 4804 + ], + [ + 4805, + 4806 + ], + [ + 4807, + 4808 + ], + [ + 4810, + 4812 + ], + [ + 4815, + 4817 + ], + [ + 4818, + 4821 + ], + [ + 4822, + 4823 + ], + [ + 4824, + 4825 + ], + [ + 4827, + 4829 + ], + [ + 4832, + 4836 + ], + [ + 4837, + 4840 + ], + [ + 4841, + 4842 + ], + [ + 4843, + 4844 + ], + [ + 4846, + 4848 + ], + [ + 4851, + 4853 + ], + [ + 4854, + 4857 + ], + [ + 4858, + 4859 + ], + [ + 4860, + 4861 + ], + [ + 4863, + 4865 + ], + [ + 4868, + 4873 + ], + [ + 4874, + 4875 + ], + [ + 4876, + 4877 + ], + [ + 4879, + 4881 + ], + [ + 4884, + 4889 + ], + [ + 4890, + 4891 + ], + [ + 4892, + 4893 + ], + [ + 4895, + 4897 + ], + [ + 4900, + 4902 + ], + [ + 4903, + 4906 + ], + [ + 4907, + 4908 + ], + [ + 4909, + 4910 + ], + [ + 4912, + 4914 + ], + [ + 4915, + 4918 + ], + [ + 4921, + 4922 + ], + [ + 4925, + 4927 + ], + [ + 4928, + 4931 + ], + [ + 4932, + 4933 + ], + [ + 4934, + 4935 + ], + [ + 4937, + 4939 + ], + [ + 4942, + 4944 + ], + [ + 4945, + 4948 + ], + [ + 4949, + 4950 + ], + [ + 4951, + 4952 + ], + [ + 4955, + 4956 + ], + [ + 4957, + 4959 + ], + [ + 4962, + 4964 + ], + [ + 4968, + 4970 + ], + [ + 4971, + 4972 + ], + [ + 4973, + 4974 + ], + [ + 4976, + 4978 + ], + [ + 4982, + 4984 + ], + [ + 4985, + 4986 + ], + [ + 4996, + 4997 + ], + [ + 5000, + 5001 + ], + [ + 5003, + 5007 + ], + [ + 5015, + 5019 + ], + [ + 5022, + 5023 + ], + [ + 5026, + 5027 + ], + [ + 5030, + 5031 + ], + [ + 5032, + 5033 + ], + [ + 5036, + 5038 + ], + [ + 5042, + 5044 + ], + [ + 5045, + 5048 + ], + [ + 5051, + 5052 + ], + [ + 5056, + 5058 + ], + [ + 5059, + 5060 + ], + [ + 5063, + 5064 + ], + [ + 5065, + 5066 + ], + [ + 5069, + 5070 + ], + [ + 5075, + 5077 + ], + [ + 5078, + 5082 + ], + [ + 5084, + 5085 + ], + [ + 5086, + 5087 + ], + [ + 5088, + 5089 + ], + [ + 5092, + 5093 + ], + [ + 5101, + 5103 + ], + [ + 5104, + 5111 + ], + [ + 5112, + 5117 + ], + [ + 5119, + 5120 + ], + [ + 5123, + 5124 + ], + [ + 5132, + 5134 + ], + [ + 5135, + 5143 + ], + [ + 5144, + 5149 + ], + [ + 5151, + 5152 + ], + [ + 5155, + 5157 + ], + [ + 5163, + 5172 + ], + [ + 5173, + 5179 + ], + [ + 5180, + 5181 + ], + [ + 5184, + 5186 + ], + [ + 5190, + 5195 + ], + [ + 5196, + 5201 + ], + [ + 5202, + 5205 + ], + [ + 5210, + 5212 + ], + [ + 5218, + 5221 + ], + [ + 5222, + 5226 + ], + [ + 5228, + 5229 + ], + [ + 5232, + 5234 + ], + [ + 5235, + 5236 + ], + [ + 5239, + 5246 + ], + [ + 5247, + 5250 + ], + [ + 5251, + 5252 + ], + [ + 5253, + 5254 + ], + [ + 5257, + 5261 + ], + [ + 5263, + 5267 + ], + [ + 5268, + 5271 + ], + [ + 5272, + 5273 + ], + [ + 5274, + 5275 + ], + [ + 5278, + 5279 + ], + [ + 5282, + 5287 + ], + [ + 5288, + 5291 + ], + [ + 5292, + 5293 + ], + [ + 5294, + 5295 + ], + [ + 5297, + 5299 + ], + [ + 5302, + 5304 + ], + [ + 5305, + 5308 + ], + [ + 5309, + 5310 + ], + [ + 5311, + 5312 + ], + [ + 5315, + 5316 + ], + [ + 5319, + 5323 + ], + [ + 5324, + 5327 + ], + [ + 5328, + 5329 + ], + [ + 5330, + 5331 + ], + [ + 5334, + 5335 + ], + [ + 5338, + 5340 + ], + [ + 5341, + 5344 + ], + [ + 5345, + 5346 + ], + [ + 5347, + 5348 + ], + [ + 5351, + 5352 + ], + [ + 5354, + 5355 + ], + [ + 5356, + 5357 + ], + [ + 5360, + 5370 + ], + [ + 5371, + 5372 + ], + [ + 5373, + 5374 + ], + [ + 5377, + 5378 + ], + [ + 5379, + 5380 + ], + [ + 5383, + 5385 + ], + [ + 5387, + 5398 + ], + [ + 5399, + 5400 + ], + [ + 5401, + 5402 + ], + [ + 5405, + 5406 + ], + [ + 5408, + 5409 + ], + [ + 5410, + 5411 + ], + [ + 5414, + 5424 + ], + [ + 5425, + 5426 + ], + [ + 5427, + 5428 + ], + [ + 5431, + 5432 + ], + [ + 5433, + 5434 + ], + [ + 5437, + 5439 + ], + [ + 5441, + 5452 + ], + [ + 5453, + 5454 + ], + [ + 5455, + 5456 + ], + [ + 5459, + 5460 + ], + [ + 5462, + 5463 + ], + [ + 5464, + 5466 + ], + [ + 5469, + 5471 + ], + [ + 5474, + 5481 + ], + [ + 5482, + 5483 + ], + [ + 5484, + 5485 + ], + [ + 5488, + 5490 + ], + [ + 5491, + 5492 + ], + [ + 5495, + 5503 + ], + [ + 5504, + 5505 + ], + [ + 5506, + 5507 + ], + [ + 5510, + 5512 + ], + [ + 5515, + 5522 + ], + [ + 5523, + 5524 + ], + [ + 5525, + 5526 + ], + [ + 5529, + 5531 + ], + [ + 5532, + 5533 + ], + [ + 5536, + 5544 + ], + [ + 5545, + 5546 + ], + [ + 5547, + 5548 + ], + [ + 5555, + 5556 + ], + [ + 5562, + 5564 + ], + [ + 5568, + 5574 + ], + [ + 5577, + 5582 + ], + [ + 5585, + 5588 + ], + [ + 5589, + 5590 + ], + [ + 5603, + 5604 + ], + [ + 5608, + 5610 + ], + [ + 5613, + 5615 + ], + [ + 5622, + 5623 + ], + [ + 5628, + 5630 + ], + [ + 5633, + 5636 + ], + [ + 5637, + 5640 + ], + [ + 5641, + 5643 + ], + [ + 5644, + 5645 + ], + [ + 5650, + 5651 + ], + [ + 5652, + 5653 + ], + [ + 5656, + 5657 + ], + [ + 5661, + 5662 + ], + [ + 5663, + 5665 + ], + [ + 5666, + 5667 + ], + [ + 5670, + 5671 + ], + [ + 5672, + 5681 + ], + [ + 5683, + 5684 + ], + [ + 5687, + 5688 + ], + [ + 5689, + 5698 + ], + [ + 5700, + 5701 + ], + [ + 5704, + 5705 + ], + [ + 5706, + 5712 + ], + [ + 5714, + 5715 + ], + [ + 5718, + 5719 + ], + [ + 5722, + 5727 + ], + [ + 5729, + 5730 + ], + [ + 5736, + 5737 + ], + [ + 5738, + 5740 + ], + [ + 5746, + 5747 + ], + [ + 5748, + 5750 + ], + [ + 5754, + 5755 + ], + [ + 5759, + 5768 + ], + [ + 5771, + 5774 + ], + [ + 5775, + 5776 + ], + [ + 5777, + 5780 + ], + [ + 5781, + 5785 + ], + [ + 5787, + 5789 + ], + [ + 5790, + 5795 + ], + [ + 5796, + 5801 + ], + [ + 5803, + 5804 + ], + [ + 5809, + 5810 + ], + [ + 5811, + 5812 + ], + [ + 5817, + 5818 + ], + [ + 5819, + 5820 + ] + ] + } + }, + { + "filename": "libvips/draw/draw.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 45, + 52 + ], + [ + 53, + 63 + ], + [ + 68, + 83 + ], + [ + 84, + 158 + ], + [ + 161, + 164 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 48, + 49 + ], + [ + 56, + 57 + ], + [ + 59, + 60 + ], + [ + 71, + 73 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 87, + 88 + ], + [ + 92, + 93 + ], + [ + 95, + 96 + ], + [ + 97, + 99 + ], + [ + 101, + 104 + ], + [ + 106, + 108 + ], + [ + 109, + 112 + ], + [ + 113, + 115 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 125 + ], + [ + 130, + 131 + ], + [ + 133, + 138 + ], + [ + 141, + 142 + ], + [ + 146, + 147 + ], + [ + 148, + 155 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_circle.c", + "line_filter": { + "diff_chunks": [ + [ + 23, + 51 + ], + [ + 73, + 99 + ], + [ + 100, + 188 + ], + [ + 189, + 284 + ], + [ + 297, + 321 + ], + [ + 330, + 355 + ] + ], + "lines_added": [ + [ + 26, + 42 + ], + [ + 47, + 48 + ], + [ + 76, + 77 + ], + [ + 78, + 79 + ], + [ + 81, + 83 + ], + [ + 89, + 94 + ], + [ + 95, + 96 + ], + [ + 103, + 108 + ], + [ + 112, + 113 + ], + [ + 114, + 117 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 128, + 131 + ], + [ + 132, + 140 + ], + [ + 145, + 148 + ], + [ + 149, + 151 + ], + [ + 155, + 158 + ], + [ + 159, + 161 + ], + [ + 166, + 167 + ], + [ + 168, + 170 + ], + [ + 171, + 173 + ], + [ + 174, + 176 + ], + [ + 177, + 179 + ], + [ + 180, + 181 + ], + [ + 183, + 185 + ], + [ + 192, + 193 + ], + [ + 194, + 196 + ], + [ + 200, + 202 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 223, + 225 + ], + [ + 230, + 231 + ], + [ + 233, + 236 + ], + [ + 237, + 239 + ], + [ + 240, + 243 + ], + [ + 244, + 246 + ], + [ + 247, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 257 + ], + [ + 258, + 260 + ], + [ + 263, + 264 + ], + [ + 269, + 271 + ], + [ + 275, + 279 + ], + [ + 280, + 281 + ], + [ + 300, + 301 + ], + [ + 307, + 309 + ], + [ + 313, + 316 + ], + [ + 317, + 318 + ], + [ + 333, + 334 + ], + [ + 340, + 342 + ], + [ + 347, + 348 + ], + [ + 349, + 352 + ], + [ + 353, + 354 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_flood.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 10 + ], + [ + 36, + 64 + ], + [ + 75, + 89 + ], + [ + 103, + 110 + ], + [ + 114, + 121 + ], + [ + 144, + 151 + ], + [ + 153, + 185 + ], + [ + 187, + 206 + ], + [ + 213, + 336 + ], + [ + 340, + 371 + ], + [ + 372, + 444 + ], + [ + 451, + 459 + ], + [ + 460, + 626 + ], + [ + 633, + 691 + ], + [ + 712, + 743 + ], + [ + 756, + 780 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 6, + 7 + ], + [ + 39, + 40 + ], + [ + 41, + 45 + ], + [ + 46, + 55 + ], + [ + 60, + 61 + ], + [ + 78, + 79 + ], + [ + 85, + 86 + ], + [ + 106, + 107 + ], + [ + 117, + 118 + ], + [ + 147, + 148 + ], + [ + 156, + 157 + ], + [ + 161, + 162 + ], + [ + 165, + 166 + ], + [ + 169, + 170 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 190, + 191 + ], + [ + 194, + 203 + ], + [ + 216, + 217 + ], + [ + 221, + 222 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 228, + 230 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 244, + 246 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 264, + 266 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 276, + 278 + ], + [ + 279, + 281 + ], + [ + 282, + 284 + ], + [ + 285, + 286 + ], + [ + 288, + 290 + ], + [ + 294, + 295 + ], + [ + 297, + 299 + ], + [ + 304, + 308 + ], + [ + 313, + 315 + ], + [ + 316, + 318 + ], + [ + 323, + 324 + ], + [ + 328, + 330 + ], + [ + 331, + 333 + ], + [ + 343, + 344 + ], + [ + 345, + 349 + ], + [ + 351, + 352 + ], + [ + 355, + 356 + ], + [ + 360, + 362 + ], + [ + 363, + 368 + ], + [ + 375, + 378 + ], + [ + 379, + 380 + ], + [ + 383, + 384 + ], + [ + 389, + 400 + ], + [ + 402, + 403 + ], + [ + 408, + 409 + ], + [ + 414, + 415 + ], + [ + 420, + 423 + ], + [ + 424, + 425 + ], + [ + 427, + 428 + ], + [ + 430, + 432 + ], + [ + 436, + 437 + ], + [ + 439, + 441 + ], + [ + 454, + 456 + ], + [ + 463, + 464 + ], + [ + 466, + 467 + ], + [ + 468, + 471 + ], + [ + 473, + 475 + ], + [ + 476, + 478 + ], + [ + 481, + 482 + ], + [ + 485, + 486 + ], + [ + 487, + 492 + ], + [ + 495, + 496 + ], + [ + 497, + 498 + ], + [ + 499, + 500 + ], + [ + 505, + 506 + ], + [ + 508, + 516 + ], + [ + 518, + 521 + ], + [ + 523, + 525 + ], + [ + 527, + 528 + ], + [ + 531, + 532 + ], + [ + 533, + 538 + ], + [ + 539, + 540 + ], + [ + 542, + 545 + ], + [ + 547, + 548 + ], + [ + 549, + 550 + ], + [ + 553, + 554 + ], + [ + 555, + 557 + ], + [ + 562, + 563 + ], + [ + 565, + 568 + ], + [ + 569, + 571 + ], + [ + 572, + 575 + ], + [ + 576, + 578 + ], + [ + 579, + 582 + ], + [ + 583, + 584 + ], + [ + 585, + 588 + ], + [ + 589, + 591 + ], + [ + 592, + 595 + ], + [ + 596, + 598 + ], + [ + 599, + 602 + ], + [ + 603, + 605 + ], + [ + 606, + 609 + ], + [ + 610, + 612 + ], + [ + 613, + 616 + ], + [ + 617, + 619 + ], + [ + 622, + 623 + ], + [ + 636, + 637 + ], + [ + 639, + 641 + ], + [ + 642, + 653 + ], + [ + 656, + 657 + ], + [ + 658, + 659 + ], + [ + 660, + 661 + ], + [ + 666, + 670 + ], + [ + 671, + 672 + ], + [ + 673, + 674 + ], + [ + 677, + 679 + ], + [ + 683, + 686 + ], + [ + 687, + 688 + ], + [ + 715, + 716 + ], + [ + 717, + 718 + ], + [ + 720, + 721 + ], + [ + 722, + 723 + ], + [ + 729, + 731 + ], + [ + 735, + 738 + ], + [ + 739, + 740 + ], + [ + 759, + 760 + ], + [ + 766, + 767 + ], + [ + 772, + 773 + ], + [ + 774, + 777 + ], + [ + 778, + 779 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_image.c", + "line_filter": { + "diff_chunks": [ + [ + 32, + 60 + ], + [ + 80, + 160 + ], + [ + 161, + 204 + ], + [ + 212, + 301 + ], + [ + 309, + 338 + ] + ], + "lines_added": [ + [ + 35, + 51 + ], + [ + 56, + 57 + ], + [ + 83, + 84 + ], + [ + 90, + 107 + ], + [ + 108, + 116 + ], + [ + 118, + 120 + ], + [ + 123, + 125 + ], + [ + 128, + 157 + ], + [ + 164, + 165 + ], + [ + 166, + 168 + ], + [ + 169, + 170 + ], + [ + 173, + 174 + ], + [ + 176, + 178 + ], + [ + 179, + 185 + ], + [ + 186, + 188 + ], + [ + 189, + 192 + ], + [ + 196, + 201 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 221, + 223 + ], + [ + 224, + 229 + ], + [ + 230, + 232 + ], + [ + 233, + 236 + ], + [ + 239, + 241 + ], + [ + 247, + 249 + ], + [ + 252, + 253 + ], + [ + 256, + 257 + ], + [ + 258, + 260 + ], + [ + 265, + 266 + ], + [ + 268, + 271 + ], + [ + 272, + 273 + ], + [ + 274, + 277 + ], + [ + 278, + 280 + ], + [ + 281, + 284 + ], + [ + 285, + 287 + ], + [ + 288, + 291 + ], + [ + 292, + 294 + ], + [ + 297, + 298 + ], + [ + 312, + 313 + ], + [ + 314, + 315 + ], + [ + 319, + 321 + ], + [ + 327, + 328 + ], + [ + 332, + 335 + ], + [ + 336, + 337 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_line.c", + "line_filter": { + "diff_chunks": [ + [ + 26, + 54 + ], + [ + 77, + 90 + ], + [ + 91, + 208 + ], + [ + 212, + 333 + ], + [ + 340, + 366 + ], + [ + 372, + 397 + ] + ], + "lines_added": [ + [ + 29, + 45 + ], + [ + 50, + 51 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 85, + 87 + ], + [ + 94, + 95 + ], + [ + 96, + 99 + ], + [ + 102, + 104 + ], + [ + 105, + 107 + ], + [ + 109, + 111 + ], + [ + 116, + 117 + ], + [ + 121, + 124 + ], + [ + 126, + 127 + ], + [ + 129, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 137 + ], + [ + 140, + 142 + ], + [ + 144, + 146 + ], + [ + 147, + 149 + ], + [ + 151, + 153 + ], + [ + 154, + 156 + ], + [ + 158, + 160 + ], + [ + 162, + 163 + ], + [ + 168, + 170 + ], + [ + 172, + 174 + ], + [ + 176, + 177 + ], + [ + 182, + 184 + ], + [ + 186, + 188 + ], + [ + 190, + 191 + ], + [ + 196, + 198 + ], + [ + 200, + 202 + ], + [ + 204, + 205 + ], + [ + 215, + 216 + ], + [ + 217, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 235, + 237 + ], + [ + 240, + 241 + ], + [ + 242, + 244 + ], + [ + 248, + 250 + ], + [ + 251, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 257, + 259 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 280, + 281 + ], + [ + 283, + 286 + ], + [ + 287, + 289 + ], + [ + 290, + 293 + ], + [ + 294, + 296 + ], + [ + 297, + 300 + ], + [ + 301, + 303 + ], + [ + 304, + 307 + ], + [ + 308, + 310 + ], + [ + 313, + 314 + ], + [ + 318, + 320 + ], + [ + 324, + 328 + ], + [ + 329, + 330 + ], + [ + 343, + 344 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 352, + 354 + ], + [ + 358, + 361 + ], + [ + 362, + 363 + ], + [ + 375, + 376 + ], + [ + 382, + 384 + ], + [ + 389, + 390 + ], + [ + 391, + 394 + ], + [ + 395, + 396 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_mask.c", + "line_filter": { + "diff_chunks": [ + [ + 24, + 52 + ], + [ + 80, + 237 + ], + [ + 239, + 261 + ], + [ + 266, + 273 + ], + [ + 274, + 370 + ], + [ + 378, + 405 + ], + [ + 410, + 435 + ] + ], + "lines_added": [ + [ + 27, + 43 + ], + [ + 48, + 49 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 89, + 102 + ], + [ + 105, + 118 + ], + [ + 121, + 138 + ], + [ + 140, + 142 + ], + [ + 145, + 146 + ], + [ + 150, + 152 + ], + [ + 153, + 160 + ], + [ + 161, + 164 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 172, + 174 + ], + [ + 177, + 178 + ], + [ + 181, + 186 + ], + [ + 187, + 190 + ], + [ + 192, + 194 + ], + [ + 196, + 198 + ], + [ + 200, + 202 + ], + [ + 204, + 206 + ], + [ + 208, + 210 + ], + [ + 212, + 214 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 229, + 230 + ], + [ + 233, + 234 + ], + [ + 242, + 244 + ], + [ + 250, + 258 + ], + [ + 269, + 270 + ], + [ + 277, + 279 + ], + [ + 280, + 283 + ], + [ + 286, + 289 + ], + [ + 295, + 296 + ], + [ + 299, + 300 + ], + [ + 301, + 303 + ], + [ + 305, + 307 + ], + [ + 308, + 311 + ], + [ + 312, + 313 + ], + [ + 316, + 317 + ], + [ + 318, + 320 + ], + [ + 325, + 326 + ], + [ + 328, + 331 + ], + [ + 332, + 333 + ], + [ + 334, + 337 + ], + [ + 338, + 340 + ], + [ + 341, + 344 + ], + [ + 345, + 347 + ], + [ + 350, + 351 + ], + [ + 355, + 357 + ], + [ + 361, + 365 + ], + [ + 366, + 367 + ], + [ + 381, + 383 + ], + [ + 384, + 385 + ], + [ + 391, + 393 + ], + [ + 397, + 400 + ], + [ + 401, + 402 + ], + [ + 413, + 414 + ], + [ + 420, + 422 + ], + [ + 427, + 428 + ], + [ + 429, + 432 + ], + [ + 433, + 434 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_rect.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 17, + 51 + ], + [ + 71, + 94 + ], + [ + 95, + 124 + ], + [ + 127, + 138 + ], + [ + 141, + 230 + ], + [ + 249, + 267 + ], + [ + 277, + 305 + ], + [ + 317, + 333 + ], + [ + 337, + 361 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 20, + 21 + ], + [ + 26, + 27 + ], + [ + 28, + 32 + ], + [ + 33, + 42 + ], + [ + 47, + 48 + ], + [ + 74, + 75 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 86, + 87 + ], + [ + 88, + 91 + ], + [ + 98, + 99 + ], + [ + 101, + 103 + ], + [ + 106, + 107 + ], + [ + 108, + 121 + ], + [ + 130, + 131 + ], + [ + 132, + 135 + ], + [ + 144, + 146 + ], + [ + 150, + 152 + ], + [ + 156, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 164 + ], + [ + 169, + 170 + ], + [ + 172, + 175 + ], + [ + 176, + 178 + ], + [ + 179, + 182 + ], + [ + 183, + 185 + ], + [ + 186, + 189 + ], + [ + 190, + 192 + ], + [ + 193, + 196 + ], + [ + 197, + 199 + ], + [ + 200, + 203 + ], + [ + 204, + 206 + ], + [ + 209, + 210 + ], + [ + 214, + 217 + ], + [ + 221, + 225 + ], + [ + 226, + 227 + ], + [ + 252, + 254 + ], + [ + 258, + 262 + ], + [ + 263, + 264 + ], + [ + 280, + 281 + ], + [ + 287, + 289 + ], + [ + 294, + 295 + ], + [ + 296, + 300 + ], + [ + 301, + 302 + ], + [ + 320, + 321 + ], + [ + 325, + 328 + ], + [ + 329, + 330 + ], + [ + 340, + 341 + ], + [ + 347, + 348 + ], + [ + 353, + 354 + ], + [ + 355, + 358 + ], + [ + 359, + 360 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_smudge.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 24, + 52 + ], + [ + 77, + 92 + ], + [ + 94, + 110 + ], + [ + 116, + 248 + ], + [ + 255, + 278 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 27, + 28 + ], + [ + 29, + 33 + ], + [ + 34, + 43 + ], + [ + 48, + 49 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 85, + 86 + ], + [ + 87, + 89 + ], + [ + 97, + 100 + ], + [ + 105, + 107 + ], + [ + 119, + 120 + ], + [ + 121, + 124 + ], + [ + 125, + 127 + ], + [ + 130, + 132 + ], + [ + 134, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 142 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 149 + ], + [ + 150, + 151 + ], + [ + 153, + 155 + ], + [ + 156, + 157 + ], + [ + 162, + 193 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 204, + 206 + ], + [ + 211, + 212 + ], + [ + 214, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 224 + ], + [ + 225, + 227 + ], + [ + 228, + 231 + ], + [ + 232, + 234 + ], + [ + 235, + 238 + ], + [ + 239, + 241 + ], + [ + 244, + 245 + ], + [ + 258, + 259 + ], + [ + 265, + 267 + ], + [ + 271, + 275 + ], + [ + 276, + 277 + ] + ] + } + }, + { + "filename": "libvips/draw/drawink.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 45, + 110 + ], + [ + 111, + 138 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 48, + 49 + ], + [ + 51, + 52 + ], + [ + 53, + 56 + ], + [ + 58, + 61 + ], + [ + 63, + 65 + ], + [ + 66, + 72 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 79, + 81 + ], + [ + 86, + 87 + ], + [ + 89, + 92 + ], + [ + 93, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 106, + 107 + ], + [ + 114, + 129 + ], + [ + 131, + 133 + ], + [ + 136, + 137 + ] + ] + } + }, + { + "filename": "libvips/draw/drawink.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 67, + 126 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 70, + 71 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 89, + 91 + ], + [ + 94, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 115, + 117 + ], + [ + 119, + 120 + ], + [ + 122, + 123 + ] + ] + } + }, + { + "filename": "libvips/draw/pdraw.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 69 + ], + [ + 73, + 80 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 51 + ], + [ + 58, + 59 + ], + [ + 65, + 66 + ], + [ + 76, + 77 + ] + ] + } + }, + { + "filename": "libvips/foreign/analyze2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 16, + 44 + ], + [ + 71, + 234 + ], + [ + 235, + 289 + ], + [ + 293, + 339 + ], + [ + 345, + 374 + ], + [ + 375, + 387 + ], + [ + 417, + 477 + ], + [ + 480, + 487 + ], + [ + 490, + 521 + ], + [ + 523, + 596 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 19, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 35 + ], + [ + 40, + 41 + ], + [ + 74, + 75 + ], + [ + 81, + 82 + ], + [ + 83, + 85 + ], + [ + 88, + 216 + ], + [ + 220, + 221 + ], + [ + 225, + 226 + ], + [ + 229, + 231 + ], + [ + 238, + 239 + ], + [ + 243, + 244 + ], + [ + 245, + 247 + ], + [ + 251, + 253 + ], + [ + 255, + 256 + ], + [ + 260, + 261 + ], + [ + 264, + 266 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 273, + 274 + ], + [ + 277, + 278 + ], + [ + 280, + 282 + ], + [ + 285, + 286 + ], + [ + 296, + 297 + ], + [ + 301, + 303 + ], + [ + 304, + 309 + ], + [ + 313, + 314 + ], + [ + 315, + 316 + ], + [ + 318, + 319 + ], + [ + 321, + 322 + ], + [ + 324, + 325 + ], + [ + 326, + 329 + ], + [ + 332, + 336 + ], + [ + 348, + 353 + ], + [ + 355, + 356 + ], + [ + 361, + 363 + ], + [ + 366, + 371 + ], + [ + 378, + 379 + ], + [ + 383, + 384 + ], + [ + 420, + 423 + ], + [ + 426, + 430 + ], + [ + 432, + 433 + ], + [ + 436, + 437 + ], + [ + 440, + 442 + ], + [ + 443, + 445 + ], + [ + 446, + 449 + ], + [ + 452, + 455 + ], + [ + 458, + 461 + ], + [ + 463, + 467 + ], + [ + 470, + 474 + ], + [ + 483, + 484 + ], + [ + 493, + 496 + ], + [ + 498, + 499 + ], + [ + 500, + 502 + ], + [ + 504, + 505 + ], + [ + 508, + 509 + ], + [ + 511, + 512 + ], + [ + 513, + 514 + ], + [ + 517, + 518 + ], + [ + 526, + 529 + ], + [ + 531, + 532 + ], + [ + 534, + 537 + ], + [ + 539, + 544 + ], + [ + 545, + 546 + ], + [ + 547, + 549 + ], + [ + 550, + 551 + ], + [ + 554, + 555 + ], + [ + 560, + 562 + ], + [ + 566, + 570 + ], + [ + 571, + 572 + ], + [ + 574, + 575 + ], + [ + 577, + 582 + ], + [ + 584, + 589 + ], + [ + 590, + 591 + ], + [ + 592, + 593 + ] + ] + } + }, + { + "filename": "libvips/foreign/analyzeload.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 57, + 116 + ], + [ + 117, + 126 + ], + [ + 131, + 153 + ], + [ + 171, + 185 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 61 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 78, + 79 + ], + [ + 82, + 83 + ], + [ + 86, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ], + [ + 99, + 101 + ], + [ + 102, + 103 + ], + [ + 108, + 109 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 134, + 135 + ], + [ + 140, + 146 + ], + [ + 149, + 150 + ], + [ + 174, + 175 + ], + [ + 179, + 182 + ], + [ + 183, + 184 + ] + ] + } + }, + { + "filename": "libvips/foreign/cairo.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 40, + 95 + ], + [ + 97, + 129 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 43, + 44 + ], + [ + 47, + 49 + ], + [ + 51, + 52 + ], + [ + 53, + 56 + ], + [ + 57, + 69 + ], + [ + 75, + 76 + ], + [ + 79, + 81 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 116 + ], + [ + 117, + 118 + ], + [ + 119, + 125 + ], + [ + 126, + 128 + ] + ] + } + }, + { + "filename": "libvips/foreign/cgifsave.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 57, + 66 + ], + [ + 90, + 97 + ], + [ + 102, + 110 + ], + [ + 113, + 120 + ], + [ + 128, + 135 + ], + [ + 141, + 203 + ], + [ + 205, + 217 + ], + [ + 223, + 250 + ], + [ + 251, + 270 + ], + [ + 273, + 296 + ], + [ + 299, + 326 + ], + [ + 331, + 387 + ], + [ + 390, + 402 + ], + [ + 406, + 426 + ], + [ + 430, + 440 + ], + [ + 445, + 453 + ], + [ + 456, + 464 + ], + [ + 466, + 520 + ], + [ + 522, + 543 + ], + [ + 544, + 559 + ], + [ + 560, + 665 + ], + [ + 667, + 694 + ], + [ + 695, + 724 + ], + [ + 726, + 767 + ], + [ + 775, + 784 + ], + [ + 787, + 794 + ], + [ + 795, + 853 + ], + [ + 866, + 896 + ], + [ + 898, + 914 + ], + [ + 918, + 946 + ], + [ + 948, + 964 + ], + [ + 968, + 1004 + ], + [ + 1006, + 1022 + ], + [ + 1067, + 1083 + ], + [ + 1108, + 1115 + ], + [ + 1116, + 1139 + ], + [ + 1159, + 1173 + ] + ], + "lines_added": [ + [ + 10, + 11 + ], + [ + 12, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 26 + ], + [ + 30, + 32 + ], + [ + 60, + 63 + ], + [ + 93, + 94 + ], + [ + 105, + 107 + ], + [ + 116, + 117 + ], + [ + 131, + 132 + ], + [ + 144, + 146 + ], + [ + 148, + 149 + ], + [ + 152, + 154 + ], + [ + 155, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 162 + ], + [ + 163, + 166 + ], + [ + 167, + 168 + ], + [ + 170, + 172 + ], + [ + 173, + 174 + ], + [ + 175, + 177 + ], + [ + 179, + 180 + ], + [ + 186, + 188 + ], + [ + 193, + 194 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 208, + 209 + ], + [ + 213, + 214 + ], + [ + 226, + 228 + ], + [ + 233, + 235 + ], + [ + 237, + 238 + ], + [ + 240, + 242 + ], + [ + 245, + 247 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 266, + 267 + ], + [ + 276, + 277 + ], + [ + 282, + 284 + ], + [ + 285, + 287 + ], + [ + 290, + 291 + ], + [ + 292, + 293 + ], + [ + 302, + 303 + ], + [ + 304, + 305 + ], + [ + 306, + 307 + ], + [ + 310, + 314 + ], + [ + 318, + 319 + ], + [ + 320, + 323 + ], + [ + 334, + 344 + ], + [ + 346, + 359 + ], + [ + 362, + 365 + ], + [ + 366, + 370 + ], + [ + 374, + 375 + ], + [ + 378, + 381 + ], + [ + 382, + 384 + ], + [ + 393, + 396 + ], + [ + 397, + 399 + ], + [ + 409, + 410 + ], + [ + 415, + 416 + ], + [ + 417, + 418 + ], + [ + 422, + 423 + ], + [ + 433, + 435 + ], + [ + 436, + 437 + ], + [ + 448, + 450 + ], + [ + 459, + 461 + ], + [ + 469, + 471 + ], + [ + 472, + 474 + ], + [ + 476, + 479 + ], + [ + 485, + 486 + ], + [ + 490, + 492 + ], + [ + 495, + 501 + ], + [ + 503, + 504 + ], + [ + 507, + 508 + ], + [ + 509, + 511 + ], + [ + 512, + 514 + ], + [ + 516, + 517 + ], + [ + 525, + 526 + ], + [ + 531, + 533 + ], + [ + 536, + 537 + ], + [ + 539, + 540 + ], + [ + 547, + 549 + ], + [ + 551, + 554 + ], + [ + 555, + 556 + ], + [ + 563, + 564 + ], + [ + 566, + 570 + ], + [ + 573, + 574 + ], + [ + 580, + 582 + ], + [ + 584, + 586 + ], + [ + 592, + 593 + ], + [ + 594, + 595 + ], + [ + 601, + 602 + ], + [ + 604, + 605 + ], + [ + 606, + 607 + ], + [ + 609, + 612 + ], + [ + 613, + 618 + ], + [ + 619, + 622 + ], + [ + 625, + 627 + ], + [ + 628, + 629 + ], + [ + 632, + 633 + ], + [ + 636, + 637 + ], + [ + 638, + 639 + ], + [ + 640, + 642 + ], + [ + 647, + 650 + ], + [ + 655, + 660 + ], + [ + 661, + 662 + ], + [ + 670, + 675 + ], + [ + 679, + 681 + ], + [ + 684, + 686 + ], + [ + 689, + 691 + ], + [ + 698, + 702 + ], + [ + 706, + 716 + ], + [ + 719, + 721 + ], + [ + 729, + 731 + ], + [ + 732, + 740 + ], + [ + 742, + 743 + ], + [ + 748, + 751 + ], + [ + 752, + 753 + ], + [ + 754, + 757 + ], + [ + 758, + 759 + ], + [ + 760, + 762 + ], + [ + 763, + 764 + ], + [ + 778, + 779 + ], + [ + 780, + 781 + ], + [ + 790, + 791 + ], + [ + 798, + 801 + ], + [ + 802, + 804 + ], + [ + 805, + 808 + ], + [ + 809, + 811 + ], + [ + 812, + 815 + ], + [ + 816, + 818 + ], + [ + 819, + 822 + ], + [ + 823, + 825 + ], + [ + 826, + 829 + ], + [ + 830, + 832 + ], + [ + 833, + 836 + ], + [ + 837, + 839 + ], + [ + 840, + 843 + ], + [ + 844, + 846 + ], + [ + 849, + 850 + ], + [ + 869, + 871 + ], + [ + 873, + 874 + ], + [ + 876, + 877 + ], + [ + 880, + 881 + ], + [ + 882, + 884 + ], + [ + 885, + 886 + ], + [ + 889, + 891 + ], + [ + 892, + 893 + ], + [ + 901, + 904 + ], + [ + 905, + 907 + ], + [ + 910, + 911 + ], + [ + 921, + 923 + ], + [ + 925, + 926 + ], + [ + 930, + 932 + ], + [ + 933, + 935 + ], + [ + 936, + 937 + ], + [ + 940, + 941 + ], + [ + 942, + 943 + ], + [ + 951, + 954 + ], + [ + 955, + 957 + ], + [ + 960, + 961 + ], + [ + 971, + 973 + ], + [ + 975, + 976 + ], + [ + 978, + 979 + ], + [ + 983, + 985 + ], + [ + 986, + 988 + ], + [ + 989, + 992 + ], + [ + 993, + 994 + ], + [ + 997, + 999 + ], + [ + 1000, + 1001 + ], + [ + 1009, + 1012 + ], + [ + 1013, + 1015 + ], + [ + 1018, + 1019 + ], + [ + 1070, + 1071 + ], + [ + 1075, + 1078 + ], + [ + 1079, + 1080 + ], + [ + 1111, + 1112 + ], + [ + 1119, + 1122 + ], + [ + 1123, + 1126 + ], + [ + 1129, + 1130 + ], + [ + 1132, + 1133 + ], + [ + 1135, + 1136 + ], + [ + 1162, + 1163 + ], + [ + 1167, + 1170 + ], + [ + 1171, + 1172 + ] + ] + } + }, + { + "filename": "libvips/foreign/csvload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 98, + 139 + ], + [ + 140, + 179 + ], + [ + 180, + 214 + ], + [ + 218, + 229 + ], + [ + 231, + 266 + ], + [ + 270, + 277 + ], + [ + 278, + 325 + ], + [ + 329, + 346 + ], + [ + 348, + 388 + ], + [ + 390, + 419 + ], + [ + 421, + 449 + ], + [ + 450, + 475 + ], + [ + 476, + 486 + ], + [ + 488, + 529 + ], + [ + 536, + 566 + ], + [ + 568, + 577 + ], + [ + 583, + 602 + ], + [ + 608, + 650 + ], + [ + 656, + 672 + ], + [ + 683, + 709 + ], + [ + 713, + 729 + ], + [ + 739, + 760 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 101, + 103 + ], + [ + 105, + 106 + ], + [ + 109, + 112 + ], + [ + 113, + 114 + ], + [ + 117, + 118 + ], + [ + 124, + 126 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 143, + 145 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 159, + 161 + ], + [ + 162, + 163 + ], + [ + 165, + 169 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 175, + 176 + ], + [ + 183, + 185 + ], + [ + 186, + 187 + ], + [ + 189, + 190 + ], + [ + 193, + 196 + ], + [ + 197, + 199 + ], + [ + 200, + 202 + ], + [ + 203, + 204 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 234, + 237 + ], + [ + 238, + 239 + ], + [ + 241, + 242 + ], + [ + 244, + 246 + ], + [ + 249, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 255 + ], + [ + 259, + 260 + ], + [ + 262, + 263 + ], + [ + 273, + 274 + ], + [ + 281, + 285 + ], + [ + 286, + 289 + ], + [ + 290, + 291 + ], + [ + 293, + 296 + ], + [ + 297, + 299 + ], + [ + 301, + 303 + ], + [ + 305, + 309 + ], + [ + 310, + 311 + ], + [ + 312, + 314 + ], + [ + 315, + 316 + ], + [ + 319, + 320 + ], + [ + 321, + 322 + ], + [ + 332, + 335 + ], + [ + 338, + 343 + ], + [ + 351, + 354 + ], + [ + 356, + 358 + ], + [ + 361, + 363 + ], + [ + 364, + 365 + ], + [ + 367, + 374 + ], + [ + 375, + 377 + ], + [ + 378, + 379 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 393, + 396 + ], + [ + 399, + 404 + ], + [ + 406, + 413 + ], + [ + 415, + 416 + ], + [ + 424, + 425 + ], + [ + 426, + 427 + ], + [ + 430, + 436 + ], + [ + 437, + 442 + ], + [ + 444, + 446 + ], + [ + 453, + 455 + ], + [ + 458, + 461 + ], + [ + 463, + 464 + ], + [ + 467, + 468 + ], + [ + 469, + 470 + ], + [ + 471, + 472 + ], + [ + 479, + 480 + ], + [ + 482, + 483 + ], + [ + 491, + 494 + ], + [ + 495, + 497 + ], + [ + 498, + 501 + ], + [ + 502, + 504 + ], + [ + 505, + 508 + ], + [ + 509, + 511 + ], + [ + 512, + 515 + ], + [ + 516, + 518 + ], + [ + 521, + 522 + ], + [ + 524, + 526 + ], + [ + 539, + 541 + ], + [ + 543, + 544 + ], + [ + 545, + 546 + ], + [ + 549, + 550 + ], + [ + 554, + 558 + ], + [ + 559, + 561 + ], + [ + 562, + 563 + ], + [ + 571, + 572 + ], + [ + 573, + 574 + ], + [ + 586, + 587 + ], + [ + 589, + 592 + ], + [ + 593, + 595 + ], + [ + 598, + 599 + ], + [ + 611, + 613 + ], + [ + 615, + 616 + ], + [ + 620, + 621 + ], + [ + 622, + 623 + ], + [ + 625, + 627 + ], + [ + 628, + 629 + ], + [ + 632, + 633 + ], + [ + 638, + 639 + ], + [ + 642, + 643 + ], + [ + 644, + 645 + ], + [ + 646, + 647 + ], + [ + 659, + 665 + ], + [ + 668, + 669 + ], + [ + 686, + 687 + ], + [ + 688, + 689 + ], + [ + 690, + 691 + ], + [ + 695, + 696 + ], + [ + 698, + 699 + ], + [ + 701, + 702 + ], + [ + 705, + 706 + ], + [ + 716, + 717 + ], + [ + 721, + 724 + ], + [ + 725, + 726 + ], + [ + 742, + 743 + ], + [ + 749, + 750 + ], + [ + 754, + 757 + ], + [ + 758, + 759 + ] + ] + } + }, + { + "filename": "libvips/foreign/csvsave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 61, + 198 + ], + [ + 200, + 209 + ], + [ + 212, + 267 + ], + [ + 269, + 285 + ], + [ + 290, + 317 + ], + [ + 319, + 341 + ], + [ + 344, + 355 + ], + [ + 356, + 377 + ], + [ + 385, + 399 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 64, + 66 + ], + [ + 68, + 69 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 77, + 87 + ], + [ + 88, + 100 + ], + [ + 101, + 119 + ], + [ + 121, + 122 + ], + [ + 128, + 164 + ], + [ + 167, + 169 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 179, + 180 + ], + [ + 181, + 183 + ], + [ + 184, + 187 + ], + [ + 188, + 190 + ], + [ + 191, + 193 + ], + [ + 194, + 195 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 215, + 216 + ], + [ + 222, + 225 + ], + [ + 226, + 228 + ], + [ + 231, + 232 + ], + [ + 233, + 234 + ], + [ + 239, + 240 + ], + [ + 244, + 246 + ], + [ + 248, + 249 + ], + [ + 253, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 272, + 278 + ], + [ + 281, + 282 + ], + [ + 293, + 295 + ], + [ + 297, + 298 + ], + [ + 302, + 305 + ], + [ + 307, + 308 + ], + [ + 311, + 312 + ], + [ + 313, + 314 + ], + [ + 322, + 328 + ], + [ + 331, + 332 + ], + [ + 337, + 338 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 351, + 352 + ], + [ + 359, + 360 + ], + [ + 364, + 367 + ], + [ + 368, + 369 + ], + [ + 373, + 374 + ], + [ + 388, + 389 + ], + [ + 393, + 396 + ], + [ + 397, + 398 + ] + ] + } + }, + { + "filename": "libvips/foreign/dbh.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 20, + 91 + ], + [ + 95, + 106 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 23, + 44 + ], + [ + 45, + 61 + ], + [ + 62, + 81 + ], + [ + 82, + 88 + ], + [ + 98, + 106 + ] + ] + } + }, + { + "filename": "libvips/foreign/dzsave.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 12 + ], + [ + 16, + 23 + ], + [ + 54, + 65 + ], + [ + 100, + 128 + ], + [ + 129, + 138 + ], + [ + 139, + 165 + ], + [ + 195, + 315 + ], + [ + 325, + 406 + ], + [ + 412, + 428 + ], + [ + 438, + 445 + ], + [ + 453, + 460 + ], + [ + 465, + 525 + ], + [ + 529, + 590 + ], + [ + 591, + 603 + ], + [ + 609, + 660 + ], + [ + 665, + 673 + ], + [ + 680, + 687 + ], + [ + 690, + 708 + ], + [ + 723, + 730 + ], + [ + 731, + 749 + ], + [ + 761, + 775 + ], + [ + 777, + 802 + ], + [ + 804, + 816 + ], + [ + 819, + 839 + ], + [ + 842, + 860 + ], + [ + 863, + 978 + ], + [ + 979, + 1000 + ], + [ + 1004, + 1031 + ], + [ + 1035, + 1049 + ], + [ + 1052, + 1059 + ], + [ + 1063, + 1091 + ], + [ + 1092, + 1171 + ], + [ + 1174, + 1226 + ], + [ + 1227, + 1260 + ], + [ + 1262, + 1412 + ], + [ + 1421, + 1428 + ], + [ + 1429, + 1548 + ], + [ + 1567, + 1590 + ], + [ + 1593, + 1600 + ], + [ + 1602, + 1622 + ], + [ + 1629, + 1669 + ], + [ + 1670, + 1713 + ], + [ + 1718, + 1759 + ], + [ + 1763, + 1791 + ], + [ + 1792, + 1824 + ], + [ + 1826, + 1954 + ], + [ + 1956, + 1988 + ], + [ + 1990, + 2016 + ], + [ + 2021, + 2049 + ], + [ + 2051, + 2058 + ], + [ + 2062, + 2073 + ], + [ + 2075, + 2093 + ], + [ + 2094, + 2101 + ], + [ + 2103, + 2124 + ], + [ + 2129, + 2208 + ], + [ + 2211, + 2236 + ], + [ + 2237, + 2247 + ], + [ + 2252, + 2382 + ], + [ + 2385, + 2528 + ], + [ + 2529, + 2630 + ], + [ + 2647, + 2656 + ], + [ + 2659, + 2666 + ], + [ + 2668, + 2815 + ], + [ + 2817, + 2870 + ], + [ + 2877, + 2929 + ], + [ + 2934, + 2987 + ], + [ + 2993, + 3013 + ], + [ + 3020, + 3038 + ], + [ + 3044, + 3051 + ], + [ + 3058, + 3094 + ], + [ + 3096, + 3108 + ], + [ + 3110, + 3120 + ], + [ + 3124, + 3160 + ], + [ + 3161, + 3173 + ], + [ + 3182, + 3196 + ] + ], + "lines_added": [ + [ + 6, + 9 + ], + [ + 19, + 20 + ], + [ + 57, + 58 + ], + [ + 61, + 62 + ], + [ + 103, + 104 + ], + [ + 105, + 109 + ], + [ + 110, + 119 + ], + [ + 124, + 125 + ], + [ + 132, + 135 + ], + [ + 142, + 143 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 150, + 151 + ], + [ + 156, + 159 + ], + [ + 161, + 162 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 205, + 206 + ], + [ + 208, + 209 + ], + [ + 211, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 218, + 220 + ], + [ + 221, + 223 + ], + [ + 224, + 225 + ], + [ + 228, + 229 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 234, + 235 + ], + [ + 238, + 240 + ], + [ + 241, + 242 + ], + [ + 243, + 245 + ], + [ + 246, + 247 + ], + [ + 250, + 251 + ], + [ + 255, + 256 + ], + [ + 260, + 270 + ], + [ + 274, + 277 + ], + [ + 280, + 281 + ], + [ + 285, + 286 + ], + [ + 290, + 291 + ], + [ + 292, + 294 + ], + [ + 295, + 296 + ], + [ + 297, + 300 + ], + [ + 303, + 304 + ], + [ + 307, + 308 + ], + [ + 309, + 310 + ], + [ + 311, + 312 + ], + [ + 328, + 329 + ], + [ + 331, + 332 + ], + [ + 333, + 334 + ], + [ + 337, + 338 + ], + [ + 341, + 342 + ], + [ + 343, + 344 + ], + [ + 347, + 349 + ], + [ + 352, + 353 + ], + [ + 354, + 360 + ], + [ + 362, + 366 + ], + [ + 367, + 368 + ], + [ + 371, + 372 + ], + [ + 374, + 375 + ], + [ + 378, + 379 + ], + [ + 380, + 383 + ], + [ + 384, + 387 + ], + [ + 388, + 389 + ], + [ + 392, + 393 + ], + [ + 398, + 399 + ], + [ + 400, + 403 + ], + [ + 415, + 416 + ], + [ + 420, + 423 + ], + [ + 424, + 425 + ], + [ + 441, + 442 + ], + [ + 456, + 457 + ], + [ + 468, + 469 + ], + [ + 470, + 471 + ], + [ + 473, + 474 + ], + [ + 477, + 478 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 487, + 493 + ], + [ + 495, + 496 + ], + [ + 498, + 504 + ], + [ + 506, + 507 + ], + [ + 509, + 512 + ], + [ + 513, + 514 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 532, + 533 + ], + [ + 536, + 537 + ], + [ + 538, + 540 + ], + [ + 541, + 542 + ], + [ + 547, + 548 + ], + [ + 549, + 552 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ], + [ + 561, + 562 + ], + [ + 564, + 565 + ], + [ + 571, + 574 + ], + [ + 576, + 577 + ], + [ + 578, + 581 + ], + [ + 582, + 583 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 594, + 595 + ], + [ + 599, + 600 + ], + [ + 612, + 614 + ], + [ + 615, + 619 + ], + [ + 620, + 622 + ], + [ + 623, + 624 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 629, + 630 + ], + [ + 632, + 633 + ], + [ + 637, + 639 + ], + [ + 643, + 644 + ], + [ + 650, + 651 + ], + [ + 653, + 655 + ], + [ + 656, + 657 + ], + [ + 668, + 670 + ], + [ + 683, + 684 + ], + [ + 693, + 694 + ], + [ + 697, + 699 + ], + [ + 700, + 702 + ], + [ + 703, + 705 + ], + [ + 726, + 727 + ], + [ + 734, + 735 + ], + [ + 740, + 743 + ], + [ + 745, + 746 + ], + [ + 764, + 765 + ], + [ + 771, + 772 + ], + [ + 780, + 781 + ], + [ + 782, + 783 + ], + [ + 784, + 785 + ], + [ + 786, + 787 + ], + [ + 791, + 792 + ], + [ + 798, + 799 + ], + [ + 811, + 813 + ], + [ + 822, + 823 + ], + [ + 824, + 825 + ], + [ + 827, + 828 + ], + [ + 830, + 831 + ], + [ + 835, + 836 + ], + [ + 845, + 846 + ], + [ + 848, + 849 + ], + [ + 853, + 855 + ], + [ + 856, + 857 + ], + [ + 866, + 868 + ], + [ + 872, + 878 + ], + [ + 879, + 880 + ], + [ + 883, + 884 + ], + [ + 885, + 891 + ], + [ + 892, + 893 + ], + [ + 897, + 898 + ], + [ + 900, + 901 + ], + [ + 903, + 905 + ], + [ + 906, + 909 + ], + [ + 911, + 912 + ], + [ + 913, + 915 + ], + [ + 916, + 919 + ], + [ + 923, + 924 + ], + [ + 925, + 926 + ], + [ + 927, + 928 + ], + [ + 933, + 934 + ], + [ + 935, + 938 + ], + [ + 939, + 940 + ], + [ + 943, + 944 + ], + [ + 947, + 948 + ], + [ + 949, + 952 + ], + [ + 953, + 957 + ], + [ + 958, + 959 + ], + [ + 961, + 962 + ], + [ + 964, + 965 + ], + [ + 967, + 969 + ], + [ + 970, + 972 + ], + [ + 974, + 975 + ], + [ + 982, + 983 + ], + [ + 984, + 985 + ], + [ + 987, + 988 + ], + [ + 993, + 994 + ], + [ + 996, + 997 + ], + [ + 1007, + 1011 + ], + [ + 1015, + 1017 + ], + [ + 1021, + 1023 + ], + [ + 1024, + 1025 + ], + [ + 1026, + 1028 + ], + [ + 1038, + 1039 + ], + [ + 1040, + 1043 + ], + [ + 1045, + 1046 + ], + [ + 1055, + 1056 + ], + [ + 1066, + 1068 + ], + [ + 1072, + 1073 + ], + [ + 1078, + 1079 + ], + [ + 1080, + 1081 + ], + [ + 1083, + 1088 + ], + [ + 1095, + 1106 + ], + [ + 1108, + 1109 + ], + [ + 1112, + 1113 + ], + [ + 1118, + 1120 + ], + [ + 1121, + 1123 + ], + [ + 1125, + 1138 + ], + [ + 1139, + 1141 + ], + [ + 1142, + 1143 + ], + [ + 1146, + 1147 + ], + [ + 1150, + 1151 + ], + [ + 1152, + 1155 + ], + [ + 1158, + 1159 + ], + [ + 1160, + 1162 + ], + [ + 1163, + 1164 + ], + [ + 1167, + 1168 + ], + [ + 1177, + 1178 + ], + [ + 1183, + 1185 + ], + [ + 1186, + 1188 + ], + [ + 1189, + 1193 + ], + [ + 1194, + 1198 + ], + [ + 1199, + 1201 + ], + [ + 1203, + 1204 + ], + [ + 1205, + 1208 + ], + [ + 1209, + 1210 + ], + [ + 1212, + 1213 + ], + [ + 1214, + 1215 + ], + [ + 1216, + 1217 + ], + [ + 1222, + 1223 + ], + [ + 1230, + 1231 + ], + [ + 1235, + 1236 + ], + [ + 1237, + 1239 + ], + [ + 1240, + 1244 + ], + [ + 1245, + 1246 + ], + [ + 1247, + 1248 + ], + [ + 1249, + 1250 + ], + [ + 1252, + 1254 + ], + [ + 1256, + 1257 + ], + [ + 1265, + 1266 + ], + [ + 1267, + 1269 + ], + [ + 1270, + 1271 + ], + [ + 1273, + 1274 + ], + [ + 1277, + 1278 + ], + [ + 1281, + 1282 + ], + [ + 1288, + 1289 + ], + [ + 1295, + 1296 + ], + [ + 1298, + 1299 + ], + [ + 1300, + 1302 + ], + [ + 1303, + 1307 + ], + [ + 1309, + 1310 + ], + [ + 1313, + 1315 + ], + [ + 1316, + 1317 + ], + [ + 1318, + 1321 + ], + [ + 1322, + 1324 + ], + [ + 1325, + 1327 + ], + [ + 1328, + 1329 + ], + [ + 1332, + 1333 + ], + [ + 1339, + 1341 + ], + [ + 1345, + 1348 + ], + [ + 1349, + 1350 + ], + [ + 1351, + 1354 + ], + [ + 1355, + 1356 + ], + [ + 1357, + 1358 + ], + [ + 1361, + 1363 + ], + [ + 1369, + 1370 + ], + [ + 1372, + 1373 + ], + [ + 1374, + 1375 + ], + [ + 1376, + 1378 + ], + [ + 1381, + 1384 + ], + [ + 1386, + 1387 + ], + [ + 1388, + 1390 + ], + [ + 1393, + 1395 + ], + [ + 1398, + 1407 + ], + [ + 1408, + 1409 + ], + [ + 1424, + 1425 + ], + [ + 1432, + 1438 + ], + [ + 1439, + 1440 + ], + [ + 1441, + 1443 + ], + [ + 1444, + 1445 + ], + [ + 1446, + 1448 + ], + [ + 1449, + 1450 + ], + [ + 1453, + 1454 + ], + [ + 1460, + 1462 + ], + [ + 1463, + 1467 + ], + [ + 1468, + 1469 + ], + [ + 1470, + 1471 + ], + [ + 1474, + 1476 + ], + [ + 1479, + 1480 + ], + [ + 1486, + 1487 + ], + [ + 1490, + 1491 + ], + [ + 1493, + 1495 + ], + [ + 1496, + 1498 + ], + [ + 1499, + 1502 + ], + [ + 1503, + 1504 + ], + [ + 1506, + 1507 + ], + [ + 1508, + 1509 + ], + [ + 1511, + 1512 + ], + [ + 1515, + 1516 + ], + [ + 1519, + 1521 + ], + [ + 1522, + 1523 + ], + [ + 1528, + 1529 + ], + [ + 1532, + 1533 + ], + [ + 1538, + 1539 + ], + [ + 1540, + 1541 + ], + [ + 1544, + 1545 + ], + [ + 1570, + 1571 + ], + [ + 1572, + 1573 + ], + [ + 1574, + 1580 + ], + [ + 1585, + 1587 + ], + [ + 1596, + 1597 + ], + [ + 1605, + 1606 + ], + [ + 1612, + 1613 + ], + [ + 1615, + 1616 + ], + [ + 1618, + 1619 + ], + [ + 1632, + 1633 + ], + [ + 1634, + 1635 + ], + [ + 1640, + 1641 + ], + [ + 1646, + 1647 + ], + [ + 1651, + 1652 + ], + [ + 1658, + 1659 + ], + [ + 1660, + 1663 + ], + [ + 1664, + 1666 + ], + [ + 1673, + 1674 + ], + [ + 1677, + 1678 + ], + [ + 1679, + 1680 + ], + [ + 1686, + 1689 + ], + [ + 1694, + 1695 + ], + [ + 1699, + 1703 + ], + [ + 1704, + 1705 + ], + [ + 1709, + 1710 + ], + [ + 1721, + 1736 + ], + [ + 1740, + 1742 + ], + [ + 1743, + 1744 + ], + [ + 1746, + 1748 + ], + [ + 1751, + 1754 + ], + [ + 1755, + 1756 + ], + [ + 1766, + 1767 + ], + [ + 1769, + 1770 + ], + [ + 1772, + 1774 + ], + [ + 1779, + 1780 + ], + [ + 1781, + 1782 + ], + [ + 1787, + 1788 + ], + [ + 1795, + 1798 + ], + [ + 1800, + 1802 + ], + [ + 1803, + 1808 + ], + [ + 1814, + 1815 + ], + [ + 1816, + 1817 + ], + [ + 1820, + 1821 + ], + [ + 1829, + 1830 + ], + [ + 1832, + 1833 + ], + [ + 1835, + 1840 + ], + [ + 1841, + 1843 + ], + [ + 1844, + 1846 + ], + [ + 1851, + 1852 + ], + [ + 1853, + 1856 + ], + [ + 1858, + 1859 + ], + [ + 1862, + 1863 + ], + [ + 1866, + 1870 + ], + [ + 1871, + 1874 + ], + [ + 1876, + 1879 + ], + [ + 1881, + 1882 + ], + [ + 1886, + 1892 + ], + [ + 1893, + 1894 + ], + [ + 1900, + 1901 + ], + [ + 1902, + 1904 + ], + [ + 1905, + 1906 + ], + [ + 1907, + 1908 + ], + [ + 1909, + 1912 + ], + [ + 1913, + 1914 + ], + [ + 1916, + 1918 + ], + [ + 1920, + 1921 + ], + [ + 1923, + 1924 + ], + [ + 1926, + 1927 + ], + [ + 1929, + 1930 + ], + [ + 1934, + 1935 + ], + [ + 1937, + 1943 + ], + [ + 1944, + 1945 + ], + [ + 1947, + 1948 + ], + [ + 1950, + 1951 + ], + [ + 1959, + 1960 + ], + [ + 1965, + 1966 + ], + [ + 1967, + 1969 + ], + [ + 1974, + 1977 + ], + [ + 1979, + 1980 + ], + [ + 1984, + 1985 + ], + [ + 1993, + 1994 + ], + [ + 1996, + 1998 + ], + [ + 2000, + 2002 + ], + [ + 2006, + 2007 + ], + [ + 2012, + 2013 + ], + [ + 2024, + 2026 + ], + [ + 2031, + 2032 + ], + [ + 2036, + 2037 + ], + [ + 2043, + 2044 + ], + [ + 2045, + 2046 + ], + [ + 2054, + 2055 + ], + [ + 2065, + 2066 + ], + [ + 2068, + 2070 + ], + [ + 2078, + 2082 + ], + [ + 2085, + 2086 + ], + [ + 2088, + 2090 + ], + [ + 2097, + 2098 + ], + [ + 2106, + 2108 + ], + [ + 2110, + 2112 + ], + [ + 2113, + 2116 + ], + [ + 2117, + 2118 + ], + [ + 2119, + 2121 + ], + [ + 2132, + 2133 + ], + [ + 2134, + 2135 + ], + [ + 2138, + 2142 + ], + [ + 2145, + 2146 + ], + [ + 2148, + 2149 + ], + [ + 2151, + 2157 + ], + [ + 2159, + 2162 + ], + [ + 2165, + 2168 + ], + [ + 2170, + 2171 + ], + [ + 2177, + 2178 + ], + [ + 2179, + 2182 + ], + [ + 2183, + 2186 + ], + [ + 2187, + 2188 + ], + [ + 2191, + 2192 + ], + [ + 2194, + 2195 + ], + [ + 2200, + 2202 + ], + [ + 2204, + 2205 + ], + [ + 2214, + 2215 + ], + [ + 2218, + 2219 + ], + [ + 2220, + 2221 + ], + [ + 2222, + 2223 + ], + [ + 2227, + 2228 + ], + [ + 2231, + 2233 + ], + [ + 2240, + 2244 + ], + [ + 2255, + 2256 + ], + [ + 2257, + 2258 + ], + [ + 2260, + 2262 + ], + [ + 2264, + 2265 + ], + [ + 2268, + 2269 + ], + [ + 2272, + 2273 + ], + [ + 2274, + 2275 + ], + [ + 2279, + 2280 + ], + [ + 2282, + 2284 + ], + [ + 2285, + 2287 + ], + [ + 2291, + 2294 + ], + [ + 2299, + 2302 + ], + [ + 2307, + 2309 + ], + [ + 2313, + 2314 + ], + [ + 2315, + 2316 + ], + [ + 2322, + 2325 + ], + [ + 2328, + 2329 + ], + [ + 2330, + 2332 + ], + [ + 2337, + 2340 + ], + [ + 2345, + 2347 + ], + [ + 2349, + 2351 + ], + [ + 2352, + 2354 + ], + [ + 2357, + 2359 + ], + [ + 2360, + 2362 + ], + [ + 2363, + 2366 + ], + [ + 2369, + 2375 + ], + [ + 2378, + 2379 + ], + [ + 2388, + 2390 + ], + [ + 2395, + 2399 + ], + [ + 2402, + 2404 + ], + [ + 2409, + 2415 + ], + [ + 2416, + 2417 + ], + [ + 2420, + 2422 + ], + [ + 2426, + 2434 + ], + [ + 2439, + 2441 + ], + [ + 2442, + 2448 + ], + [ + 2449, + 2453 + ], + [ + 2457, + 2458 + ], + [ + 2460, + 2461 + ], + [ + 2463, + 2466 + ], + [ + 2467, + 2468 + ], + [ + 2474, + 2477 + ], + [ + 2482, + 2485 + ], + [ + 2486, + 2488 + ], + [ + 2489, + 2490 + ], + [ + 2493, + 2495 + ], + [ + 2499, + 2501 + ], + [ + 2504, + 2506 + ], + [ + 2508, + 2511 + ], + [ + 2512, + 2514 + ], + [ + 2515, + 2518 + ], + [ + 2519, + 2522 + ], + [ + 2524, + 2525 + ], + [ + 2532, + 2536 + ], + [ + 2540, + 2541 + ], + [ + 2542, + 2546 + ], + [ + 2549, + 2550 + ], + [ + 2551, + 2552 + ], + [ + 2553, + 2555 + ], + [ + 2557, + 2561 + ], + [ + 2565, + 2566 + ], + [ + 2569, + 2571 + ], + [ + 2576, + 2578 + ], + [ + 2579, + 2580 + ], + [ + 2581, + 2583 + ], + [ + 2586, + 2588 + ], + [ + 2591, + 2593 + ], + [ + 2597, + 2599 + ], + [ + 2605, + 2607 + ], + [ + 2608, + 2611 + ], + [ + 2612, + 2615 + ], + [ + 2618, + 2621 + ], + [ + 2624, + 2625 + ], + [ + 2626, + 2627 + ], + [ + 2650, + 2651 + ], + [ + 2652, + 2653 + ], + [ + 2662, + 2663 + ], + [ + 2671, + 2674 + ], + [ + 2675, + 2677 + ], + [ + 2678, + 2681 + ], + [ + 2682, + 2684 + ], + [ + 2685, + 2688 + ], + [ + 2689, + 2691 + ], + [ + 2692, + 2695 + ], + [ + 2696, + 2698 + ], + [ + 2699, + 2702 + ], + [ + 2703, + 2705 + ], + [ + 2706, + 2709 + ], + [ + 2710, + 2712 + ], + [ + 2713, + 2716 + ], + [ + 2717, + 2719 + ], + [ + 2720, + 2723 + ], + [ + 2724, + 2726 + ], + [ + 2727, + 2730 + ], + [ + 2731, + 2733 + ], + [ + 2734, + 2737 + ], + [ + 2738, + 2740 + ], + [ + 2741, + 2744 + ], + [ + 2745, + 2747 + ], + [ + 2748, + 2751 + ], + [ + 2752, + 2754 + ], + [ + 2755, + 2758 + ], + [ + 2759, + 2761 + ], + [ + 2762, + 2765 + ], + [ + 2766, + 2768 + ], + [ + 2772, + 2775 + ], + [ + 2776, + 2778 + ], + [ + 2779, + 2782 + ], + [ + 2783, + 2785 + ], + [ + 2786, + 2789 + ], + [ + 2790, + 2792 + ], + [ + 2793, + 2796 + ], + [ + 2797, + 2799 + ], + [ + 2802, + 2803 + ], + [ + 2804, + 2806 + ], + [ + 2809, + 2812 + ], + [ + 2820, + 2821 + ], + [ + 2826, + 2828 + ], + [ + 2830, + 2831 + ], + [ + 2836, + 2837 + ], + [ + 2838, + 2840 + ], + [ + 2841, + 2842 + ], + [ + 2845, + 2846 + ], + [ + 2847, + 2848 + ], + [ + 2854, + 2855 + ], + [ + 2857, + 2863 + ], + [ + 2866, + 2867 + ], + [ + 2880, + 2881 + ], + [ + 2886, + 2888 + ], + [ + 2890, + 2891 + ], + [ + 2897, + 2899 + ], + [ + 2900, + 2901 + ], + [ + 2904, + 2905 + ], + [ + 2906, + 2907 + ], + [ + 2913, + 2914 + ], + [ + 2916, + 2922 + ], + [ + 2925, + 2926 + ], + [ + 2937, + 2939 + ], + [ + 2941, + 2942 + ], + [ + 2948, + 2950 + ], + [ + 2951, + 2953 + ], + [ + 2954, + 2957 + ], + [ + 2958, + 2959 + ], + [ + 2962, + 2963 + ], + [ + 2964, + 2965 + ], + [ + 2971, + 2972 + ], + [ + 2974, + 2980 + ], + [ + 2983, + 2984 + ], + [ + 2996, + 2998 + ], + [ + 3004, + 3007 + ], + [ + 3009, + 3010 + ], + [ + 3023, + 3024 + ], + [ + 3026, + 3030 + ], + [ + 3031, + 3032 + ], + [ + 3034, + 3035 + ], + [ + 3047, + 3048 + ], + [ + 3061, + 3064 + ], + [ + 3066, + 3067 + ], + [ + 3069, + 3071 + ], + [ + 3076, + 3077 + ], + [ + 3081, + 3084 + ], + [ + 3085, + 3086 + ], + [ + 3090, + 3091 + ], + [ + 3099, + 3102 + ], + [ + 3104, + 3105 + ], + [ + 3113, + 3114 + ], + [ + 3116, + 3117 + ], + [ + 3127, + 3128 + ], + [ + 3133, + 3134 + ], + [ + 3135, + 3138 + ], + [ + 3139, + 3142 + ], + [ + 3145, + 3146 + ], + [ + 3148, + 3149 + ], + [ + 3151, + 3152 + ], + [ + 3156, + 3157 + ], + [ + 3164, + 3167 + ], + [ + 3169, + 3170 + ], + [ + 3185, + 3186 + ], + [ + 3190, + 3193 + ], + [ + 3194, + 3195 + ] + ] + } + }, + { + "filename": "libvips/foreign/exif.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 45 + ], + [ + 82, + 288 + ], + [ + 290, + 297 + ], + [ + 298, + 346 + ], + [ + 353, + 425 + ], + [ + 429, + 453 + ], + [ + 457, + 465 + ], + [ + 466, + 505 + ], + [ + 506, + 574 + ], + [ + 575, + 607 + ], + [ + 610, + 617 + ], + [ + 622, + 651 + ], + [ + 652, + 693 + ], + [ + 696, + 704 + ], + [ + 706, + 772 + ], + [ + 774, + 789 + ], + [ + 795, + 827 + ], + [ + 829, + 869 + ], + [ + 873, + 989 + ], + [ + 990, + 1018 + ], + [ + 1028, + 1211 + ], + [ + 1213, + 1251 + ], + [ + 1255, + 1310 + ], + [ + 1311, + 1393 + ], + [ + 1396, + 1491 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 20, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 36 + ], + [ + 41, + 42 + ], + [ + 85, + 86 + ], + [ + 91, + 109 + ], + [ + 112, + 113 + ], + [ + 116, + 124 + ], + [ + 127, + 128 + ], + [ + 131, + 133 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 143, + 146 + ], + [ + 147, + 148 + ], + [ + 150, + 151 + ], + [ + 152, + 154 + ], + [ + 157, + 161 + ], + [ + 163, + 164 + ], + [ + 170, + 173 + ], + [ + 174, + 177 + ], + [ + 179, + 182 + ], + [ + 184, + 186 + ], + [ + 188, + 199 + ], + [ + 202, + 204 + ], + [ + 205, + 206 + ], + [ + 209, + 214 + ], + [ + 216, + 219 + ], + [ + 220, + 221 + ], + [ + 222, + 223 + ], + [ + 226, + 228 + ], + [ + 229, + 231 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 243, + 245 + ], + [ + 246, + 248 + ], + [ + 251, + 252 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 262 + ], + [ + 267, + 269 + ], + [ + 273, + 275 + ], + [ + 280, + 281 + ], + [ + 284, + 285 + ], + [ + 293, + 294 + ], + [ + 301, + 302 + ], + [ + 305, + 306 + ], + [ + 307, + 308 + ], + [ + 309, + 310 + ], + [ + 311, + 316 + ], + [ + 318, + 324 + ], + [ + 326, + 332 + ], + [ + 334, + 337 + ], + [ + 338, + 341 + ], + [ + 342, + 343 + ], + [ + 356, + 357 + ], + [ + 358, + 360 + ], + [ + 361, + 363 + ], + [ + 366, + 367 + ], + [ + 370, + 371 + ], + [ + 372, + 373 + ], + [ + 374, + 375 + ], + [ + 377, + 380 + ], + [ + 383, + 385 + ], + [ + 388, + 389 + ], + [ + 390, + 392 + ], + [ + 395, + 396 + ], + [ + 399, + 402 + ], + [ + 403, + 404 + ], + [ + 407, + 408 + ], + [ + 411, + 414 + ], + [ + 415, + 416 + ], + [ + 421, + 422 + ], + [ + 432, + 436 + ], + [ + 440, + 442 + ], + [ + 444, + 447 + ], + [ + 449, + 450 + ], + [ + 460, + 462 + ], + [ + 469, + 471 + ], + [ + 474, + 476 + ], + [ + 479, + 482 + ], + [ + 486, + 488 + ], + [ + 489, + 490 + ], + [ + 495, + 496 + ], + [ + 497, + 498 + ], + [ + 501, + 502 + ], + [ + 509, + 515 + ], + [ + 517, + 519 + ], + [ + 521, + 522 + ], + [ + 525, + 526 + ], + [ + 527, + 531 + ], + [ + 536, + 537 + ], + [ + 542, + 544 + ], + [ + 545, + 547 + ], + [ + 548, + 549 + ], + [ + 551, + 552 + ], + [ + 553, + 556 + ], + [ + 558, + 561 + ], + [ + 562, + 563 + ], + [ + 565, + 566 + ], + [ + 569, + 571 + ], + [ + 578, + 580 + ], + [ + 585, + 586 + ], + [ + 589, + 600 + ], + [ + 603, + 604 + ], + [ + 613, + 614 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 629, + 630 + ], + [ + 635, + 636 + ], + [ + 637, + 639 + ], + [ + 640, + 641 + ], + [ + 646, + 648 + ], + [ + 655, + 658 + ], + [ + 663, + 664 + ], + [ + 667, + 669 + ], + [ + 670, + 671 + ], + [ + 673, + 674 + ], + [ + 675, + 678 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 684, + 685 + ], + [ + 686, + 688 + ], + [ + 689, + 690 + ], + [ + 699, + 701 + ], + [ + 709, + 712 + ], + [ + 717, + 718 + ], + [ + 721, + 723 + ], + [ + 724, + 725 + ], + [ + 727, + 729 + ], + [ + 733, + 735 + ], + [ + 736, + 739 + ], + [ + 740, + 741 + ], + [ + 743, + 744 + ], + [ + 746, + 748 + ], + [ + 752, + 754 + ], + [ + 755, + 757 + ], + [ + 758, + 759 + ], + [ + 763, + 765 + ], + [ + 768, + 769 + ], + [ + 777, + 778 + ], + [ + 779, + 780 + ], + [ + 783, + 784 + ], + [ + 785, + 786 + ], + [ + 798, + 799 + ], + [ + 801, + 802 + ], + [ + 803, + 804 + ], + [ + 807, + 808 + ], + [ + 809, + 812 + ], + [ + 813, + 814 + ], + [ + 816, + 817 + ], + [ + 819, + 820 + ], + [ + 823, + 824 + ], + [ + 832, + 833 + ], + [ + 835, + 839 + ], + [ + 840, + 841 + ], + [ + 844, + 845 + ], + [ + 850, + 851 + ], + [ + 855, + 856 + ], + [ + 857, + 861 + ], + [ + 862, + 863 + ], + [ + 865, + 866 + ], + [ + 876, + 878 + ], + [ + 883, + 884 + ], + [ + 887, + 889 + ], + [ + 891, + 892 + ], + [ + 894, + 898 + ], + [ + 899, + 900 + ], + [ + 906, + 908 + ], + [ + 913, + 914 + ], + [ + 917, + 919 + ], + [ + 923, + 927 + ], + [ + 928, + 929 + ], + [ + 934, + 936 + ], + [ + 941, + 942 + ], + [ + 943, + 944 + ], + [ + 947, + 950 + ], + [ + 951, + 953 + ], + [ + 958, + 959 + ], + [ + 962, + 964 + ], + [ + 970, + 973 + ], + [ + 977, + 983 + ], + [ + 984, + 986 + ], + [ + 993, + 994 + ], + [ + 999, + 1001 + ], + [ + 1005, + 1009 + ], + [ + 1010, + 1011 + ], + [ + 1014, + 1015 + ], + [ + 1031, + 1033 + ], + [ + 1038, + 1046 + ], + [ + 1048, + 1049 + ], + [ + 1051, + 1052 + ], + [ + 1053, + 1055 + ], + [ + 1056, + 1060 + ], + [ + 1061, + 1062 + ], + [ + 1064, + 1065 + ], + [ + 1067, + 1068 + ], + [ + 1074, + 1076 + ], + [ + 1078, + 1079 + ], + [ + 1080, + 1082 + ], + [ + 1083, + 1084 + ], + [ + 1086, + 1087 + ], + [ + 1089, + 1090 + ], + [ + 1096, + 1097 + ], + [ + 1098, + 1100 + ], + [ + 1104, + 1105 + ], + [ + 1106, + 1107 + ], + [ + 1110, + 1113 + ], + [ + 1117, + 1121 + ], + [ + 1125, + 1126 + ], + [ + 1131, + 1132 + ], + [ + 1133, + 1134 + ], + [ + 1136, + 1137 + ], + [ + 1142, + 1143 + ], + [ + 1144, + 1145 + ], + [ + 1147, + 1148 + ], + [ + 1152, + 1153 + ], + [ + 1155, + 1156 + ], + [ + 1161, + 1162 + ], + [ + 1164, + 1166 + ], + [ + 1169, + 1172 + ], + [ + 1173, + 1175 + ], + [ + 1176, + 1177 + ], + [ + 1179, + 1182 + ], + [ + 1185, + 1188 + ], + [ + 1189, + 1190 + ], + [ + 1191, + 1192 + ], + [ + 1196, + 1199 + ], + [ + 1200, + 1201 + ], + [ + 1202, + 1203 + ], + [ + 1206, + 1208 + ], + [ + 1216, + 1218 + ], + [ + 1221, + 1224 + ], + [ + 1226, + 1228 + ], + [ + 1229, + 1230 + ], + [ + 1231, + 1234 + ], + [ + 1239, + 1243 + ], + [ + 1245, + 1246 + ], + [ + 1247, + 1248 + ], + [ + 1258, + 1259 + ], + [ + 1262, + 1263 + ], + [ + 1267, + 1268 + ], + [ + 1270, + 1273 + ], + [ + 1277, + 1278 + ], + [ + 1280, + 1282 + ], + [ + 1287, + 1289 + ], + [ + 1294, + 1297 + ], + [ + 1298, + 1299 + ], + [ + 1301, + 1305 + ], + [ + 1306, + 1307 + ], + [ + 1314, + 1317 + ], + [ + 1321, + 1322 + ], + [ + 1324, + 1328 + ], + [ + 1329, + 1332 + ], + [ + 1333, + 1335 + ], + [ + 1337, + 1338 + ], + [ + 1339, + 1340 + ], + [ + 1343, + 1344 + ], + [ + 1347, + 1352 + ], + [ + 1355, + 1356 + ], + [ + 1359, + 1360 + ], + [ + 1366, + 1368 + ], + [ + 1373, + 1374 + ], + [ + 1376, + 1379 + ], + [ + 1383, + 1384 + ], + [ + 1389, + 1390 + ], + [ + 1399, + 1403 + ], + [ + 1404, + 1406 + ], + [ + 1407, + 1408 + ], + [ + 1410, + 1414 + ], + [ + 1419, + 1420 + ], + [ + 1423, + 1424 + ], + [ + 1427, + 1430 + ], + [ + 1434, + 1437 + ], + [ + 1441, + 1444 + ], + [ + 1448, + 1451 + ], + [ + 1456, + 1461 + ], + [ + 1465, + 1466 + ], + [ + 1468, + 1470 + ], + [ + 1471, + 1472 + ], + [ + 1473, + 1474 + ], + [ + 1479, + 1480 + ], + [ + 1481, + 1482 + ], + [ + 1485, + 1486 + ], + [ + 1487, + 1488 + ] + ] + } + }, + { + "filename": "libvips/foreign/fits.c", + "line_filter": { + "diff_chunks": [ + [ + 18, + 25 + ], + [ + 28, + 37 + ], + [ + 40, + 68 + ], + [ + 90, + 101 + ], + [ + 120, + 127 + ], + [ + 130, + 199 + ], + [ + 200, + 216 + ], + [ + 225, + 269 + ], + [ + 273, + 285 + ], + [ + 292, + 324 + ], + [ + 325, + 402 + ], + [ + 405, + 458 + ], + [ + 460, + 602 + ], + [ + 613, + 621 + ], + [ + 625, + 658 + ], + [ + 664, + 737 + ], + [ + 742, + 778 + ] + ], + "lines_added": [ + [ + 21, + 22 + ], + [ + 31, + 32 + ], + [ + 33, + 34 + ], + [ + 43, + 44 + ], + [ + 45, + 49 + ], + [ + 50, + 59 + ], + [ + 64, + 65 + ], + [ + 93, + 94 + ], + [ + 97, + 98 + ], + [ + 123, + 124 + ], + [ + 133, + 134 + ], + [ + 137, + 139 + ], + [ + 144, + 145 + ], + [ + 146, + 148 + ], + [ + 149, + 150 + ], + [ + 154, + 156 + ], + [ + 160, + 161 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 175, + 177 + ], + [ + 178, + 179 + ], + [ + 183, + 185 + ], + [ + 187, + 191 + ], + [ + 195, + 196 + ], + [ + 203, + 208 + ], + [ + 212, + 213 + ], + [ + 228, + 233 + ], + [ + 235, + 236 + ], + [ + 238, + 243 + ], + [ + 247, + 248 + ], + [ + 251, + 254 + ], + [ + 257, + 261 + ], + [ + 265, + 266 + ], + [ + 276, + 282 + ], + [ + 295, + 297 + ], + [ + 302, + 304 + ], + [ + 305, + 309 + ], + [ + 313, + 315 + ], + [ + 319, + 321 + ], + [ + 328, + 332 + ], + [ + 333, + 337 + ], + [ + 341, + 344 + ], + [ + 347, + 350 + ], + [ + 352, + 353 + ], + [ + 356, + 359 + ], + [ + 361, + 363 + ], + [ + 369, + 371 + ], + [ + 373, + 374 + ], + [ + 377, + 378 + ], + [ + 381, + 382 + ], + [ + 383, + 385 + ], + [ + 386, + 389 + ], + [ + 391, + 392 + ], + [ + 393, + 394 + ], + [ + 397, + 399 + ], + [ + 408, + 413 + ], + [ + 414, + 415 + ], + [ + 417, + 418 + ], + [ + 420, + 430 + ], + [ + 432, + 433 + ], + [ + 434, + 435 + ], + [ + 436, + 437 + ], + [ + 439, + 440 + ], + [ + 444, + 445 + ], + [ + 450, + 451 + ], + [ + 454, + 455 + ], + [ + 463, + 465 + ], + [ + 469, + 472 + ], + [ + 473, + 474 + ], + [ + 475, + 477 + ], + [ + 481, + 482 + ], + [ + 487, + 488 + ], + [ + 489, + 490 + ], + [ + 493, + 494 + ], + [ + 498, + 502 + ], + [ + 504, + 507 + ], + [ + 510, + 511 + ], + [ + 512, + 513 + ], + [ + 516, + 517 + ], + [ + 520, + 527 + ], + [ + 529, + 530 + ], + [ + 533, + 534 + ], + [ + 538, + 539 + ], + [ + 542, + 544 + ], + [ + 545, + 547 + ], + [ + 549, + 550 + ], + [ + 551, + 552 + ], + [ + 553, + 554 + ], + [ + 557, + 558 + ], + [ + 564, + 567 + ], + [ + 571, + 573 + ], + [ + 574, + 576 + ], + [ + 579, + 582 + ], + [ + 587, + 588 + ], + [ + 589, + 594 + ], + [ + 598, + 599 + ], + [ + 616, + 618 + ], + [ + 628, + 630 + ], + [ + 631, + 632 + ], + [ + 634, + 635 + ], + [ + 638, + 641 + ], + [ + 642, + 644 + ], + [ + 645, + 648 + ], + [ + 650, + 651 + ], + [ + 654, + 655 + ], + [ + 667, + 669 + ], + [ + 670, + 674 + ], + [ + 679, + 683 + ], + [ + 685, + 689 + ], + [ + 691, + 694 + ], + [ + 695, + 696 + ], + [ + 699, + 700 + ], + [ + 703, + 705 + ], + [ + 711, + 714 + ], + [ + 719, + 722 + ], + [ + 723, + 724 + ], + [ + 730, + 732 + ], + [ + 733, + 734 + ], + [ + 745, + 750 + ], + [ + 754, + 755 + ], + [ + 758, + 759 + ], + [ + 762, + 763 + ], + [ + 764, + 766 + ], + [ + 767, + 771 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ] + ] + } + }, + { + "filename": "libvips/foreign/fitsload.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 67, + 178 + ], + [ + 180, + 187 + ], + [ + 192, + 208 + ], + [ + 210, + 245 + ], + [ + 247, + 270 + ], + [ + 278, + 348 + ], + [ + 353, + 366 + ], + [ + 368, + 384 + ], + [ + 386, + 405 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 70, + 72 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 80, + 81 + ], + [ + 84, + 85 + ], + [ + 86, + 88 + ], + [ + 93, + 95 + ], + [ + 98, + 103 + ], + [ + 108, + 110 + ], + [ + 111, + 112 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 132, + 136 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 145, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 157, + 159 + ], + [ + 161, + 165 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 183, + 184 + ], + [ + 195, + 196 + ], + [ + 204, + 205 + ], + [ + 213, + 214 + ], + [ + 219, + 221 + ], + [ + 223, + 224 + ], + [ + 228, + 231 + ], + [ + 232, + 234 + ], + [ + 235, + 236 + ], + [ + 239, + 240 + ], + [ + 241, + 242 + ], + [ + 250, + 251 + ], + [ + 257, + 263 + ], + [ + 266, + 267 + ], + [ + 281, + 283 + ], + [ + 285, + 286 + ], + [ + 288, + 289 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 296, + 298 + ], + [ + 299, + 300 + ], + [ + 303, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 312 + ], + [ + 315, + 317 + ], + [ + 318, + 319 + ], + [ + 320, + 321 + ], + [ + 327, + 328 + ], + [ + 332, + 333 + ], + [ + 335, + 341 + ], + [ + 344, + 345 + ], + [ + 356, + 357 + ], + [ + 359, + 360 + ], + [ + 361, + 363 + ], + [ + 371, + 372 + ], + [ + 376, + 379 + ], + [ + 380, + 381 + ], + [ + 389, + 390 + ], + [ + 394, + 395 + ], + [ + 399, + 402 + ], + [ + 403, + 404 + ] + ] + } + }, + { + "filename": "libvips/foreign/fitssave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 58, + 99 + ], + [ + 114, + 125 + ], + [ + 126, + 133 + ], + [ + 139, + 155 + ], + [ + 156, + 164 + ], + [ + 167, + 181 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 61, + 62 + ], + [ + 67, + 69 + ], + [ + 71, + 72 + ], + [ + 75, + 77 + ], + [ + 78, + 80 + ], + [ + 83, + 85 + ], + [ + 90, + 94 + ], + [ + 95, + 96 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 129, + 130 + ], + [ + 142, + 148 + ], + [ + 151, + 152 + ], + [ + 159, + 161 + ], + [ + 170, + 171 + ], + [ + 175, + 178 + ], + [ + 179, + 180 + ] + ] + } + }, + { + "filename": "libvips/foreign/foreign.c", + "line_filter": { + "diff_chunks": [ + [ + 30, + 58 + ], + [ + 81, + 122 + ], + [ + 124, + 131 + ], + [ + 132, + 191 + ], + [ + 192, + 232 + ], + [ + 233, + 265 + ], + [ + 266, + 301 + ], + [ + 303, + 315 + ], + [ + 317, + 328 + ], + [ + 331, + 409 + ], + [ + 413, + 420 + ], + [ + 424, + 543 + ], + [ + 544, + 601 + ], + [ + 602, + 705 + ], + [ + 707, + 741 + ], + [ + 747, + 767 + ], + [ + 775, + 794 + ], + [ + 801, + 820 + ], + [ + 821, + 1102 + ], + [ + 1104, + 1158 + ], + [ + 1163, + 1231 + ], + [ + 1241, + 1343 + ], + [ + 1345, + 1503 + ], + [ + 1505, + 1515 + ], + [ + 1518, + 1560 + ], + [ + 1569, + 1578 + ], + [ + 1579, + 1615 + ], + [ + 1619, + 1630 + ], + [ + 1631, + 1732 + ], + [ + 1745, + 1754 + ], + [ + 1761, + 1772 + ], + [ + 1775, + 1854 + ], + [ + 1855, + 1966 + ], + [ + 1967, + 2009 + ], + [ + 2010, + 2067 + ], + [ + 2068, + 2100 + ], + [ + 2112, + 2128 + ], + [ + 2138, + 2154 + ], + [ + 2164, + 2182 + ], + [ + 2183, + 2198 + ], + [ + 2207, + 2236 + ], + [ + 2241, + 2248 + ], + [ + 2266, + 2287 + ], + [ + 2294, + 2301 + ], + [ + 2305, + 2341 + ], + [ + 2354, + 2370 + ], + [ + 2372, + 2379 + ], + [ + 2382, + 2398 + ], + [ + 2401, + 2413 + ], + [ + 2414, + 2429 + ], + [ + 2431, + 2458 + ], + [ + 2462, + 2479 + ], + [ + 2482, + 2503 + ], + [ + 2516, + 2552 + ], + [ + 2564, + 2580 + ], + [ + 2591, + 2598 + ], + [ + 2601, + 2620 + ], + [ + 2623, + 2639 + ], + [ + 2651, + 2668 + ], + [ + 2669, + 2684 + ], + [ + 2694, + 2717 + ], + [ + 2754, + 2770 + ], + [ + 2779, + 3031 + ], + [ + 3034, + 3099 + ], + [ + 3117, + 3151 + ] + ], + "lines_added": [ + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 44 + ], + [ + 45, + 49 + ], + [ + 54, + 55 + ], + [ + 84, + 85 + ], + [ + 88, + 89 + ], + [ + 95, + 96 + ], + [ + 100, + 101 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 113, + 115 + ], + [ + 118, + 119 + ], + [ + 127, + 128 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 142 + ], + [ + 143, + 144 + ], + [ + 148, + 149 + ], + [ + 154, + 155 + ], + [ + 157, + 158 + ], + [ + 162, + 163 + ], + [ + 165, + 166 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 181, + 182 + ], + [ + 184, + 185 + ], + [ + 187, + 188 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 210, + 212 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 224, + 225 + ], + [ + 228, + 229 + ], + [ + 236, + 238 + ], + [ + 240, + 241 + ], + [ + 242, + 244 + ], + [ + 245, + 246 + ], + [ + 251, + 252 + ], + [ + 255, + 256 + ], + [ + 258, + 259 + ], + [ + 261, + 262 + ], + [ + 269, + 270 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 278, + 279 + ], + [ + 280, + 281 + ], + [ + 282, + 284 + ], + [ + 286, + 287 + ], + [ + 289, + 292 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 306, + 307 + ], + [ + 308, + 309 + ], + [ + 311, + 312 + ], + [ + 320, + 321 + ], + [ + 324, + 325 + ], + [ + 334, + 335 + ], + [ + 337, + 338 + ], + [ + 339, + 342 + ], + [ + 343, + 344 + ], + [ + 345, + 346 + ], + [ + 348, + 353 + ], + [ + 354, + 355 + ], + [ + 357, + 358 + ], + [ + 359, + 363 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 375, + 376 + ], + [ + 380, + 381 + ], + [ + 384, + 385 + ], + [ + 389, + 390 + ], + [ + 393, + 396 + ], + [ + 397, + 398 + ], + [ + 399, + 400 + ], + [ + 403, + 404 + ], + [ + 405, + 406 + ], + [ + 416, + 417 + ], + [ + 427, + 428 + ], + [ + 433, + 435 + ], + [ + 436, + 437 + ], + [ + 438, + 440 + ], + [ + 441, + 444 + ], + [ + 445, + 447 + ], + [ + 449, + 450 + ], + [ + 451, + 452 + ], + [ + 453, + 454 + ], + [ + 459, + 460 + ], + [ + 462, + 463 + ], + [ + 464, + 465 + ], + [ + 466, + 467 + ], + [ + 468, + 469 + ], + [ + 472, + 493 + ], + [ + 496, + 497 + ], + [ + 503, + 505 + ], + [ + 506, + 508 + ], + [ + 511, + 514 + ], + [ + 516, + 518 + ], + [ + 523, + 526 + ], + [ + 528, + 529 + ], + [ + 531, + 534 + ], + [ + 535, + 538 + ], + [ + 539, + 540 + ], + [ + 547, + 548 + ], + [ + 554, + 555 + ], + [ + 560, + 561 + ], + [ + 564, + 568 + ], + [ + 569, + 573 + ], + [ + 575, + 582 + ], + [ + 585, + 587 + ], + [ + 589, + 590 + ], + [ + 593, + 594 + ], + [ + 597, + 598 + ], + [ + 605, + 608 + ], + [ + 609, + 613 + ], + [ + 614, + 615 + ], + [ + 620, + 622 + ], + [ + 623, + 624 + ], + [ + 627, + 629 + ], + [ + 630, + 633 + ], + [ + 635, + 637 + ], + [ + 638, + 639 + ], + [ + 643, + 644 + ], + [ + 649, + 650 + ], + [ + 654, + 655 + ], + [ + 658, + 659 + ], + [ + 662, + 669 + ], + [ + 671, + 672 + ], + [ + 677, + 678 + ], + [ + 679, + 682 + ], + [ + 685, + 687 + ], + [ + 688, + 689 + ], + [ + 692, + 693 + ], + [ + 694, + 696 + ], + [ + 697, + 700 + ], + [ + 701, + 702 + ], + [ + 710, + 711 + ], + [ + 715, + 716 + ], + [ + 719, + 720 + ], + [ + 723, + 730 + ], + [ + 734, + 736 + ], + [ + 737, + 738 + ], + [ + 750, + 752 + ], + [ + 756, + 762 + ], + [ + 763, + 764 + ], + [ + 778, + 779 + ], + [ + 783, + 789 + ], + [ + 790, + 791 + ], + [ + 804, + 805 + ], + [ + 809, + 815 + ], + [ + 816, + 817 + ], + [ + 824, + 825 + ], + [ + 829, + 831 + ], + [ + 834, + 837 + ], + [ + 838, + 840 + ], + [ + 842, + 843 + ], + [ + 846, + 847 + ], + [ + 852, + 856 + ], + [ + 857, + 859 + ], + [ + 860, + 861 + ], + [ + 862, + 863 + ], + [ + 866, + 867 + ], + [ + 869, + 870 + ], + [ + 874, + 875 + ], + [ + 877, + 878 + ], + [ + 879, + 880 + ], + [ + 882, + 883 + ], + [ + 887, + 888 + ], + [ + 889, + 890 + ], + [ + 892, + 893 + ], + [ + 898, + 900 + ], + [ + 901, + 902 + ], + [ + 904, + 905 + ], + [ + 907, + 908 + ], + [ + 910, + 911 + ], + [ + 912, + 913 + ], + [ + 915, + 916 + ], + [ + 919, + 920 + ], + [ + 924, + 925 + ], + [ + 930, + 931 + ], + [ + 932, + 933 + ], + [ + 936, + 940 + ], + [ + 942, + 943 + ], + [ + 949, + 950 + ], + [ + 951, + 953 + ], + [ + 956, + 958 + ], + [ + 959, + 962 + ], + [ + 964, + 965 + ], + [ + 968, + 969 + ], + [ + 975, + 976 + ], + [ + 979, + 981 + ], + [ + 986, + 987 + ], + [ + 993, + 997 + ], + [ + 999, + 1000 + ], + [ + 1005, + 1008 + ], + [ + 1010, + 1011 + ], + [ + 1016, + 1018 + ], + [ + 1021, + 1022 + ], + [ + 1023, + 1027 + ], + [ + 1028, + 1032 + ], + [ + 1033, + 1034 + ], + [ + 1037, + 1038 + ], + [ + 1039, + 1042 + ], + [ + 1046, + 1047 + ], + [ + 1050, + 1058 + ], + [ + 1061, + 1062 + ], + [ + 1067, + 1069 + ], + [ + 1073, + 1076 + ], + [ + 1077, + 1079 + ], + [ + 1080, + 1084 + ], + [ + 1085, + 1086 + ], + [ + 1087, + 1089 + ], + [ + 1091, + 1092 + ], + [ + 1096, + 1099 + ], + [ + 1107, + 1108 + ], + [ + 1109, + 1110 + ], + [ + 1115, + 1117 + ], + [ + 1118, + 1119 + ], + [ + 1121, + 1127 + ], + [ + 1131, + 1133 + ], + [ + 1134, + 1135 + ], + [ + 1137, + 1139 + ], + [ + 1140, + 1141 + ], + [ + 1144, + 1146 + ], + [ + 1148, + 1149 + ], + [ + 1152, + 1153 + ], + [ + 1154, + 1155 + ], + [ + 1166, + 1167 + ], + [ + 1170, + 1175 + ], + [ + 1176, + 1179 + ], + [ + 1180, + 1182 + ], + [ + 1183, + 1186 + ], + [ + 1187, + 1189 + ], + [ + 1190, + 1193 + ], + [ + 1194, + 1196 + ], + [ + 1197, + 1200 + ], + [ + 1201, + 1203 + ], + [ + 1204, + 1207 + ], + [ + 1208, + 1210 + ], + [ + 1211, + 1214 + ], + [ + 1215, + 1217 + ], + [ + 1218, + 1221 + ], + [ + 1222, + 1224 + ], + [ + 1227, + 1228 + ], + [ + 1244, + 1245 + ], + [ + 1247, + 1250 + ], + [ + 1252, + 1253 + ], + [ + 1254, + 1255 + ], + [ + 1257, + 1258 + ], + [ + 1260, + 1263 + ], + [ + 1269, + 1270 + ], + [ + 1272, + 1273 + ], + [ + 1274, + 1275 + ], + [ + 1276, + 1277 + ], + [ + 1278, + 1279 + ], + [ + 1282, + 1283 + ], + [ + 1284, + 1285 + ], + [ + 1286, + 1287 + ], + [ + 1288, + 1290 + ], + [ + 1293, + 1294 + ], + [ + 1299, + 1303 + ], + [ + 1304, + 1306 + ], + [ + 1307, + 1308 + ], + [ + 1309, + 1310 + ], + [ + 1312, + 1313 + ], + [ + 1315, + 1316 + ], + [ + 1317, + 1318 + ], + [ + 1321, + 1322 + ], + [ + 1323, + 1324 + ], + [ + 1326, + 1328 + ], + [ + 1329, + 1330 + ], + [ + 1332, + 1333 + ], + [ + 1335, + 1338 + ], + [ + 1339, + 1340 + ], + [ + 1348, + 1349 + ], + [ + 1351, + 1354 + ], + [ + 1355, + 1356 + ], + [ + 1361, + 1362 + ], + [ + 1363, + 1364 + ], + [ + 1366, + 1369 + ], + [ + 1370, + 1371 + ], + [ + 1375, + 1376 + ], + [ + 1377, + 1380 + ], + [ + 1382, + 1386 + ], + [ + 1387, + 1388 + ], + [ + 1394, + 1395 + ], + [ + 1396, + 1397 + ], + [ + 1399, + 1401 + ], + [ + 1403, + 1410 + ], + [ + 1411, + 1412 + ], + [ + 1417, + 1418 + ], + [ + 1420, + 1421 + ], + [ + 1426, + 1427 + ], + [ + 1428, + 1431 + ], + [ + 1435, + 1436 + ], + [ + 1437, + 1438 + ], + [ + 1442, + 1445 + ], + [ + 1446, + 1447 + ], + [ + 1451, + 1453 + ], + [ + 1454, + 1455 + ], + [ + 1456, + 1457 + ], + [ + 1461, + 1462 + ], + [ + 1463, + 1464 + ], + [ + 1468, + 1471 + ], + [ + 1472, + 1473 + ], + [ + 1478, + 1479 + ], + [ + 1480, + 1481 + ], + [ + 1485, + 1488 + ], + [ + 1489, + 1491 + ], + [ + 1493, + 1498 + ], + [ + 1499, + 1500 + ], + [ + 1508, + 1509 + ], + [ + 1510, + 1512 + ], + [ + 1521, + 1526 + ], + [ + 1527, + 1528 + ], + [ + 1531, + 1532 + ], + [ + 1533, + 1536 + ], + [ + 1538, + 1543 + ], + [ + 1544, + 1545 + ], + [ + 1548, + 1550 + ], + [ + 1552, + 1555 + ], + [ + 1556, + 1557 + ], + [ + 1572, + 1575 + ], + [ + 1582, + 1583 + ], + [ + 1585, + 1588 + ], + [ + 1589, + 1590 + ], + [ + 1596, + 1599 + ], + [ + 1600, + 1601 + ], + [ + 1604, + 1605 + ], + [ + 1607, + 1610 + ], + [ + 1611, + 1612 + ], + [ + 1622, + 1625 + ], + [ + 1626, + 1627 + ], + [ + 1634, + 1635 + ], + [ + 1638, + 1639 + ], + [ + 1641, + 1644 + ], + [ + 1645, + 1646 + ], + [ + 1649, + 1650 + ], + [ + 1652, + 1655 + ], + [ + 1656, + 1657 + ], + [ + 1661, + 1662 + ], + [ + 1663, + 1664 + ], + [ + 1666, + 1667 + ], + [ + 1670, + 1673 + ], + [ + 1675, + 1678 + ], + [ + 1679, + 1680 + ], + [ + 1683, + 1684 + ], + [ + 1689, + 1690 + ], + [ + 1693, + 1694 + ], + [ + 1695, + 1696 + ], + [ + 1697, + 1700 + ], + [ + 1702, + 1706 + ], + [ + 1707, + 1708 + ], + [ + 1710, + 1713 + ], + [ + 1714, + 1715 + ], + [ + 1717, + 1719 + ], + [ + 1721, + 1722 + ], + [ + 1725, + 1727 + ], + [ + 1728, + 1729 + ], + [ + 1748, + 1749 + ], + [ + 1750, + 1751 + ], + [ + 1764, + 1765 + ], + [ + 1766, + 1769 + ], + [ + 1778, + 1779 + ], + [ + 1784, + 1785 + ], + [ + 1786, + 1789 + ], + [ + 1790, + 1791 + ], + [ + 1792, + 1795 + ], + [ + 1796, + 1798 + ], + [ + 1799, + 1802 + ], + [ + 1803, + 1805 + ], + [ + 1806, + 1809 + ], + [ + 1810, + 1812 + ], + [ + 1815, + 1816 + ], + [ + 1817, + 1818 + ], + [ + 1820, + 1821 + ], + [ + 1823, + 1825 + ], + [ + 1826, + 1828 + ], + [ + 1831, + 1832 + ], + [ + 1834, + 1836 + ], + [ + 1839, + 1842 + ], + [ + 1846, + 1849 + ], + [ + 1850, + 1851 + ], + [ + 1858, + 1859 + ], + [ + 1865, + 1866 + ], + [ + 1871, + 1872 + ], + [ + 1873, + 1879 + ], + [ + 1880, + 1881 + ], + [ + 1883, + 1884 + ], + [ + 1887, + 1889 + ], + [ + 1890, + 1891 + ], + [ + 1895, + 1897 + ], + [ + 1899, + 1900 + ], + [ + 1903, + 1905 + ], + [ + 1906, + 1907 + ], + [ + 1911, + 1914 + ], + [ + 1917, + 1918 + ], + [ + 1923, + 1924 + ], + [ + 1925, + 1927 + ], + [ + 1932, + 1934 + ], + [ + 1935, + 1937 + ], + [ + 1943, + 1944 + ], + [ + 1945, + 1947 + ], + [ + 1948, + 1949 + ], + [ + 1950, + 1951 + ], + [ + 1952, + 1954 + ], + [ + 1955, + 1956 + ], + [ + 1962, + 1963 + ], + [ + 1970, + 1971 + ], + [ + 1972, + 1974 + ], + [ + 1975, + 1979 + ], + [ + 1980, + 1981 + ], + [ + 1986, + 1988 + ], + [ + 1989, + 1991 + ], + [ + 1992, + 1993 + ], + [ + 1995, + 1998 + ], + [ + 1999, + 2000 + ], + [ + 2001, + 2004 + ], + [ + 2005, + 2006 + ], + [ + 2013, + 2014 + ], + [ + 2020, + 2021 + ], + [ + 2026, + 2027 + ], + [ + 2028, + 2034 + ], + [ + 2035, + 2036 + ], + [ + 2038, + 2039 + ], + [ + 2044, + 2046 + ], + [ + 2047, + 2049 + ], + [ + 2050, + 2051 + ], + [ + 2053, + 2056 + ], + [ + 2057, + 2058 + ], + [ + 2059, + 2062 + ], + [ + 2063, + 2064 + ], + [ + 2071, + 2072 + ], + [ + 2078, + 2079 + ], + [ + 2084, + 2085 + ], + [ + 2086, + 2092 + ], + [ + 2093, + 2094 + ], + [ + 2096, + 2097 + ], + [ + 2115, + 2116 + ], + [ + 2121, + 2122 + ], + [ + 2124, + 2125 + ], + [ + 2141, + 2142 + ], + [ + 2146, + 2149 + ], + [ + 2150, + 2151 + ], + [ + 2167, + 2169 + ], + [ + 2170, + 2172 + ], + [ + 2178, + 2179 + ], + [ + 2186, + 2187 + ], + [ + 2188, + 2191 + ], + [ + 2192, + 2193 + ], + [ + 2194, + 2195 + ], + [ + 2210, + 2211 + ], + [ + 2217, + 2218 + ], + [ + 2222, + 2225 + ], + [ + 2226, + 2227 + ], + [ + 2231, + 2233 + ], + [ + 2244, + 2245 + ], + [ + 2269, + 2270 + ], + [ + 2274, + 2277 + ], + [ + 2278, + 2279 + ], + [ + 2283, + 2284 + ], + [ + 2297, + 2298 + ], + [ + 2308, + 2309 + ], + [ + 2314, + 2315 + ], + [ + 2316, + 2319 + ], + [ + 2320, + 2323 + ], + [ + 2326, + 2327 + ], + [ + 2329, + 2330 + ], + [ + 2332, + 2333 + ], + [ + 2337, + 2338 + ], + [ + 2357, + 2358 + ], + [ + 2362, + 2365 + ], + [ + 2366, + 2367 + ], + [ + 2375, + 2376 + ], + [ + 2385, + 2386 + ], + [ + 2390, + 2393 + ], + [ + 2394, + 2395 + ], + [ + 2404, + 2405 + ], + [ + 2409, + 2410 + ], + [ + 2417, + 2418 + ], + [ + 2419, + 2422 + ], + [ + 2423, + 2424 + ], + [ + 2425, + 2426 + ], + [ + 2434, + 2435 + ], + [ + 2439, + 2440 + ], + [ + 2444, + 2447 + ], + [ + 2448, + 2449 + ], + [ + 2453, + 2455 + ], + [ + 2465, + 2466 + ], + [ + 2470, + 2471 + ], + [ + 2473, + 2474 + ], + [ + 2475, + 2476 + ], + [ + 2485, + 2486 + ], + [ + 2490, + 2493 + ], + [ + 2494, + 2495 + ], + [ + 2499, + 2500 + ], + [ + 2519, + 2520 + ], + [ + 2525, + 2526 + ], + [ + 2527, + 2530 + ], + [ + 2531, + 2534 + ], + [ + 2537, + 2538 + ], + [ + 2540, + 2541 + ], + [ + 2543, + 2544 + ], + [ + 2548, + 2549 + ], + [ + 2567, + 2568 + ], + [ + 2572, + 2575 + ], + [ + 2576, + 2577 + ], + [ + 2594, + 2595 + ], + [ + 2604, + 2605 + ], + [ + 2610, + 2611 + ], + [ + 2616, + 2617 + ], + [ + 2626, + 2627 + ], + [ + 2631, + 2634 + ], + [ + 2635, + 2636 + ], + [ + 2654, + 2655 + ], + [ + 2656, + 2658 + ], + [ + 2664, + 2665 + ], + [ + 2672, + 2673 + ], + [ + 2674, + 2677 + ], + [ + 2678, + 2679 + ], + [ + 2680, + 2681 + ], + [ + 2697, + 2698 + ], + [ + 2704, + 2705 + ], + [ + 2709, + 2712 + ], + [ + 2713, + 2714 + ], + [ + 2757, + 2758 + ], + [ + 2762, + 2765 + ], + [ + 2766, + 2767 + ], + [ + 2782, + 2783 + ], + [ + 2787, + 2788 + ], + [ + 2792, + 2795 + ], + [ + 2796, + 2797 + ], + [ + 2803, + 2964 + ], + [ + 2966, + 2967 + ], + [ + 2970, + 2977 + ], + [ + 2980, + 2986 + ], + [ + 2989, + 2992 + ], + [ + 2995, + 2998 + ], + [ + 3001, + 3004 + ], + [ + 3007, + 3013 + ], + [ + 3016, + 3022 + ], + [ + 3026, + 3028 + ], + [ + 3037, + 3040 + ], + [ + 3043, + 3049 + ], + [ + 3052, + 3058 + ], + [ + 3061, + 3062 + ], + [ + 3065, + 3072 + ], + [ + 3075, + 3081 + ], + [ + 3085, + 3091 + ], + [ + 3094, + 3096 + ], + [ + 3120, + 3123 + ], + [ + 3126, + 3127 + ], + [ + 3130, + 3133 + ], + [ + 3136, + 3139 + ], + [ + 3142, + 3145 + ], + [ + 3148, + 3150 + ] + ] + } + }, + { + "filename": "libvips/foreign/heifload.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 12 + ], + [ + 30, + 58 + ], + [ + 91, + 102 + ], + [ + 105, + 124 + ], + [ + 157, + 164 + ], + [ + 171, + 182 + ], + [ + 214, + 225 + ], + [ + 226, + 296 + ], + [ + 301, + 346 + ], + [ + 350, + 446 + ], + [ + 451, + 462 + ], + [ + 470, + 535 + ], + [ + 538, + 555 + ], + [ + 562, + 641 + ], + [ + 642, + 668 + ], + [ + 671, + 696 + ], + [ + 697, + 850 + ], + [ + 869, + 887 + ], + [ + 888, + 993 + ], + [ + 996, + 1048 + ], + [ + 1050, + 1146 + ], + [ + 1147, + 1160 + ], + [ + 1163, + 1178 + ], + [ + 1179, + 1186 + ], + [ + 1188, + 1235 + ], + [ + 1243, + 1259 + ], + [ + 1267, + 1306 + ], + [ + 1311, + 1327 + ], + [ + 1335, + 1378 + ], + [ + 1384, + 1400 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 49 + ], + [ + 54, + 55 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 108, + 121 + ], + [ + 160, + 161 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 217, + 218 + ], + [ + 219, + 222 + ], + [ + 229, + 231 + ], + [ + 233, + 234 + ], + [ + 238, + 246 + ], + [ + 249, + 250 + ], + [ + 254, + 255 + ], + [ + 257, + 260 + ], + [ + 261, + 262 + ], + [ + 266, + 268 + ], + [ + 269, + 274 + ], + [ + 277, + 279 + ], + [ + 280, + 281 + ], + [ + 284, + 293 + ], + [ + 304, + 305 + ], + [ + 306, + 313 + ], + [ + 316, + 321 + ], + [ + 322, + 325 + ], + [ + 327, + 328 + ], + [ + 331, + 332 + ], + [ + 335, + 336 + ], + [ + 338, + 339 + ], + [ + 342, + 343 + ], + [ + 353, + 354 + ], + [ + 356, + 360 + ], + [ + 361, + 366 + ], + [ + 369, + 371 + ], + [ + 372, + 374 + ], + [ + 375, + 380 + ], + [ + 382, + 385 + ], + [ + 386, + 387 + ], + [ + 388, + 391 + ], + [ + 392, + 394 + ], + [ + 396, + 399 + ], + [ + 401, + 402 + ], + [ + 404, + 405 + ], + [ + 411, + 413 + ], + [ + 414, + 415 + ], + [ + 416, + 417 + ], + [ + 420, + 422 + ], + [ + 424, + 426 + ], + [ + 429, + 434 + ], + [ + 436, + 439 + ], + [ + 442, + 443 + ], + [ + 454, + 455 + ], + [ + 458, + 459 + ], + [ + 473, + 474 + ], + [ + 476, + 478 + ], + [ + 481, + 485 + ], + [ + 487, + 488 + ], + [ + 489, + 491 + ], + [ + 495, + 497 + ], + [ + 501, + 508 + ], + [ + 513, + 514 + ], + [ + 516, + 517 + ], + [ + 518, + 525 + ], + [ + 530, + 532 + ], + [ + 541, + 544 + ], + [ + 545, + 547 + ], + [ + 548, + 549 + ], + [ + 550, + 552 + ], + [ + 565, + 566 + ], + [ + 568, + 570 + ], + [ + 572, + 596 + ], + [ + 601, + 605 + ], + [ + 608, + 615 + ], + [ + 618, + 619 + ], + [ + 621, + 623 + ], + [ + 624, + 626 + ], + [ + 629, + 631 + ], + [ + 635, + 638 + ], + [ + 645, + 655 + ], + [ + 658, + 661 + ], + [ + 662, + 663 + ], + [ + 664, + 665 + ], + [ + 674, + 675 + ], + [ + 676, + 682 + ], + [ + 683, + 685 + ], + [ + 686, + 687 + ], + [ + 690, + 691 + ], + [ + 692, + 693 + ], + [ + 700, + 701 + ], + [ + 703, + 707 + ], + [ + 710, + 714 + ], + [ + 715, + 717 + ], + [ + 722, + 724 + ], + [ + 726, + 727 + ], + [ + 728, + 729 + ], + [ + 730, + 733 + ], + [ + 736, + 737 + ], + [ + 742, + 744 + ], + [ + 745, + 749 + ], + [ + 750, + 753 + ], + [ + 754, + 755 + ], + [ + 757, + 762 + ], + [ + 764, + 772 + ], + [ + 778, + 789 + ], + [ + 791, + 802 + ], + [ + 806, + 828 + ], + [ + 829, + 832 + ], + [ + 836, + 838 + ], + [ + 839, + 840 + ], + [ + 841, + 842 + ], + [ + 846, + 847 + ], + [ + 872, + 875 + ], + [ + 877, + 884 + ], + [ + 891, + 892 + ], + [ + 893, + 896 + ], + [ + 897, + 898 + ], + [ + 900, + 902 + ], + [ + 903, + 904 + ], + [ + 908, + 910 + ], + [ + 912, + 914 + ], + [ + 919, + 920 + ], + [ + 922, + 923 + ], + [ + 924, + 926 + ], + [ + 927, + 928 + ], + [ + 930, + 933 + ], + [ + 935, + 943 + ], + [ + 946, + 947 + ], + [ + 950, + 955 + ], + [ + 960, + 965 + ], + [ + 967, + 972 + ], + [ + 975, + 978 + ], + [ + 981, + 982 + ], + [ + 983, + 984 + ], + [ + 988, + 990 + ], + [ + 999, + 1000 + ], + [ + 1003, + 1004 + ], + [ + 1005, + 1006 + ], + [ + 1009, + 1010 + ], + [ + 1013, + 1015 + ], + [ + 1017, + 1018 + ], + [ + 1021, + 1023 + ], + [ + 1026, + 1028 + ], + [ + 1029, + 1034 + ], + [ + 1035, + 1037 + ], + [ + 1038, + 1039 + ], + [ + 1042, + 1043 + ], + [ + 1044, + 1045 + ], + [ + 1053, + 1054 + ], + [ + 1060, + 1063 + ], + [ + 1064, + 1066 + ], + [ + 1067, + 1070 + ], + [ + 1071, + 1073 + ], + [ + 1074, + 1077 + ], + [ + 1078, + 1080 + ], + [ + 1081, + 1084 + ], + [ + 1085, + 1087 + ], + [ + 1088, + 1091 + ], + [ + 1092, + 1094 + ], + [ + 1097, + 1098 + ], + [ + 1101, + 1102 + ], + [ + 1104, + 1105 + ], + [ + 1106, + 1107 + ], + [ + 1110, + 1111 + ], + [ + 1114, + 1115 + ], + [ + 1117, + 1120 + ], + [ + 1125, + 1126 + ], + [ + 1129, + 1130 + ], + [ + 1135, + 1136 + ], + [ + 1141, + 1143 + ], + [ + 1150, + 1151 + ], + [ + 1152, + 1155 + ], + [ + 1156, + 1157 + ], + [ + 1166, + 1167 + ], + [ + 1170, + 1171 + ], + [ + 1174, + 1175 + ], + [ + 1182, + 1183 + ], + [ + 1191, + 1192 + ], + [ + 1197, + 1199 + ], + [ + 1201, + 1202 + ], + [ + 1206, + 1210 + ], + [ + 1211, + 1213 + ], + [ + 1214, + 1215 + ], + [ + 1218, + 1219 + ], + [ + 1222, + 1224 + ], + [ + 1225, + 1226 + ], + [ + 1229, + 1230 + ], + [ + 1231, + 1232 + ], + [ + 1246, + 1252 + ], + [ + 1255, + 1256 + ], + [ + 1270, + 1272 + ], + [ + 1274, + 1275 + ], + [ + 1277, + 1278 + ], + [ + 1280, + 1285 + ], + [ + 1286, + 1288 + ], + [ + 1289, + 1290 + ], + [ + 1293, + 1294 + ], + [ + 1295, + 1296 + ], + [ + 1299, + 1301 + ], + [ + 1302, + 1303 + ], + [ + 1314, + 1320 + ], + [ + 1323, + 1324 + ], + [ + 1338, + 1340 + ], + [ + 1342, + 1343 + ], + [ + 1345, + 1346 + ], + [ + 1348, + 1349 + ], + [ + 1350, + 1351 + ], + [ + 1353, + 1355 + ], + [ + 1356, + 1357 + ], + [ + 1360, + 1361 + ], + [ + 1364, + 1366 + ], + [ + 1369, + 1371 + ], + [ + 1372, + 1373 + ], + [ + 1374, + 1375 + ], + [ + 1387, + 1393 + ], + [ + 1396, + 1397 + ] + ] + } + }, + { + "filename": "libvips/foreign/heifsave.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 48 + ], + [ + 79, + 86 + ], + [ + 120, + 127 + ], + [ + 137, + 173 + ], + [ + 175, + 219 + ], + [ + 220, + 322 + ], + [ + 324, + 344 + ], + [ + 345, + 363 + ], + [ + 367, + 438 + ], + [ + 440, + 581 + ], + [ + 589, + 598 + ], + [ + 600, + 666 + ], + [ + 678, + 715 + ], + [ + 720, + 736 + ], + [ + 744, + 780 + ], + [ + 785, + 801 + ], + [ + 806, + 838 + ], + [ + 843, + 878 + ], + [ + 881, + 888 + ] + ], + "lines_added": [ + [ + 23, + 39 + ], + [ + 44, + 45 + ], + [ + 82, + 83 + ], + [ + 123, + 124 + ], + [ + 140, + 142 + ], + [ + 143, + 145 + ], + [ + 147, + 148 + ], + [ + 151, + 157 + ], + [ + 158, + 159 + ], + [ + 161, + 164 + ], + [ + 168, + 170 + ], + [ + 178, + 179 + ], + [ + 185, + 187 + ], + [ + 188, + 191 + ], + [ + 195, + 197 + ], + [ + 199, + 202 + ], + [ + 203, + 208 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 223, + 225 + ], + [ + 229, + 230 + ], + [ + 232, + 235 + ], + [ + 238, + 243 + ], + [ + 248, + 249 + ], + [ + 252, + 254 + ], + [ + 255, + 256 + ], + [ + 258, + 260 + ], + [ + 262, + 266 + ], + [ + 268, + 269 + ], + [ + 270, + 273 + ], + [ + 275, + 276 + ], + [ + 278, + 281 + ], + [ + 282, + 288 + ], + [ + 292, + 295 + ], + [ + 296, + 297 + ], + [ + 298, + 299 + ], + [ + 302, + 304 + ], + [ + 307, + 309 + ], + [ + 311, + 314 + ], + [ + 318, + 319 + ], + [ + 327, + 329 + ], + [ + 330, + 338 + ], + [ + 340, + 341 + ], + [ + 348, + 350 + ], + [ + 352, + 357 + ], + [ + 359, + 360 + ], + [ + 370, + 371 + ], + [ + 372, + 375 + ], + [ + 377, + 378 + ], + [ + 381, + 383 + ], + [ + 389, + 390 + ], + [ + 392, + 393 + ], + [ + 395, + 396 + ], + [ + 400, + 401 + ], + [ + 403, + 406 + ], + [ + 407, + 408 + ], + [ + 410, + 413 + ], + [ + 415, + 416 + ], + [ + 418, + 421 + ], + [ + 427, + 428 + ], + [ + 430, + 431 + ], + [ + 434, + 435 + ], + [ + 443, + 445 + ], + [ + 449, + 451 + ], + [ + 455, + 457 + ], + [ + 459, + 460 + ], + [ + 462, + 480 + ], + [ + 482, + 486 + ], + [ + 488, + 492 + ], + [ + 494, + 500 + ], + [ + 503, + 513 + ], + [ + 515, + 516 + ], + [ + 520, + 521 + ], + [ + 523, + 524 + ], + [ + 527, + 531 + ], + [ + 532, + 540 + ], + [ + 542, + 548 + ], + [ + 551, + 552 + ], + [ + 554, + 556 + ], + [ + 557, + 558 + ], + [ + 559, + 562 + ], + [ + 568, + 572 + ], + [ + 574, + 576 + ], + [ + 577, + 578 + ], + [ + 592, + 593 + ], + [ + 594, + 595 + ], + [ + 603, + 604 + ], + [ + 609, + 612 + ], + [ + 613, + 615 + ], + [ + 616, + 619 + ], + [ + 620, + 622 + ], + [ + 623, + 626 + ], + [ + 627, + 629 + ], + [ + 630, + 633 + ], + [ + 634, + 635 + ], + [ + 636, + 637 + ], + [ + 638, + 641 + ], + [ + 642, + 644 + ], + [ + 645, + 648 + ], + [ + 649, + 650 + ], + [ + 651, + 652 + ], + [ + 653, + 656 + ], + [ + 657, + 659 + ], + [ + 662, + 663 + ], + [ + 681, + 682 + ], + [ + 687, + 689 + ], + [ + 691, + 692 + ], + [ + 696, + 698 + ], + [ + 699, + 700 + ], + [ + 702, + 704 + ], + [ + 705, + 706 + ], + [ + 709, + 710 + ], + [ + 711, + 712 + ], + [ + 723, + 729 + ], + [ + 732, + 733 + ], + [ + 747, + 749 + ], + [ + 751, + 752 + ], + [ + 754, + 755 + ], + [ + 759, + 761 + ], + [ + 762, + 764 + ], + [ + 765, + 768 + ], + [ + 769, + 770 + ], + [ + 773, + 775 + ], + [ + 776, + 777 + ], + [ + 788, + 794 + ], + [ + 797, + 798 + ], + [ + 809, + 811 + ], + [ + 813, + 814 + ], + [ + 816, + 817 + ], + [ + 819, + 820 + ], + [ + 821, + 822 + ], + [ + 824, + 826 + ], + [ + 827, + 828 + ], + [ + 831, + 833 + ], + [ + 834, + 835 + ], + [ + 846, + 852 + ], + [ + 855, + 856 + ], + [ + 862, + 864 + ], + [ + 866, + 868 + ], + [ + 874, + 875 + ], + [ + 884, + 885 + ] + ] + } + }, + { + "filename": "libvips/foreign/jp2kload.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 77, + 89 + ], + [ + 100, + 233 + ], + [ + 237, + 377 + ], + [ + 378, + 406 + ], + [ + 409, + 424 + ], + [ + 429, + 601 + ], + [ + 602, + 658 + ], + [ + 664, + 699 + ], + [ + 700, + 720 + ], + [ + 722, + 765 + ], + [ + 768, + 779 + ], + [ + 783, + 799 + ], + [ + 807, + 856 + ], + [ + 857, + 867 + ], + [ + 869, + 888 + ], + [ + 890, + 897 + ], + [ + 906, + 917 + ], + [ + 919, + 946 + ], + [ + 954, + 1034 + ], + [ + 1035, + 1042 + ], + [ + 1046, + 1062 + ], + [ + 1064, + 1116 + ], + [ + 1124, + 1140 + ], + [ + 1148, + 1195 + ], + [ + 1200, + 1216 + ], + [ + 1224, + 1260 + ], + [ + 1266, + 1344 + ], + [ + 1348, + 1441 + ], + [ + 1452, + 1459 + ], + [ + 1468, + 1484 + ], + [ + 1492, + 1499 + ], + [ + 1500, + 1507 + ], + [ + 1508, + 1523 + ], + [ + 1530, + 1549 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 80, + 83 + ], + [ + 84, + 86 + ], + [ + 103, + 105 + ], + [ + 107, + 108 + ], + [ + 112, + 113 + ], + [ + 119, + 120 + ], + [ + 124, + 130 + ], + [ + 131, + 132 + ], + [ + 135, + 136 + ], + [ + 137, + 139 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 153, + 154 + ], + [ + 155, + 156 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 163, + 164 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 174, + 175 + ], + [ + 180, + 182 + ], + [ + 183, + 184 + ], + [ + 187, + 197 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 211, + 214 + ], + [ + 217, + 223 + ], + [ + 226, + 228 + ], + [ + 229, + 230 + ], + [ + 240, + 241 + ], + [ + 244, + 246 + ], + [ + 250, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 268, + 269 + ], + [ + 273, + 275 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 285, + 287 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 295, + 297 + ], + [ + 299, + 300 + ], + [ + 302, + 303 + ], + [ + 305, + 306 + ], + [ + 310, + 312 + ], + [ + 313, + 319 + ], + [ + 323, + 324 + ], + [ + 325, + 332 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 341, + 343 + ], + [ + 345, + 355 + ], + [ + 357, + 367 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 381, + 382 + ], + [ + 383, + 384 + ], + [ + 388, + 389 + ], + [ + 393, + 394 + ], + [ + 398, + 399 + ], + [ + 402, + 403 + ], + [ + 412, + 414 + ], + [ + 415, + 416 + ], + [ + 418, + 419 + ], + [ + 420, + 421 + ], + [ + 432, + 436 + ], + [ + 440, + 442 + ], + [ + 443, + 446 + ], + [ + 450, + 458 + ], + [ + 459, + 460 + ], + [ + 461, + 462 + ], + [ + 463, + 467 + ], + [ + 468, + 469 + ], + [ + 472, + 473 + ], + [ + 474, + 475 + ], + [ + 481, + 482 + ], + [ + 484, + 488 + ], + [ + 489, + 490 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 498, + 502 + ], + [ + 504, + 505 + ], + [ + 509, + 513 + ], + [ + 514, + 518 + ], + [ + 520, + 521 + ], + [ + 523, + 524 + ], + [ + 528, + 532 + ], + [ + 534, + 539 + ], + [ + 544, + 545 + ], + [ + 547, + 548 + ], + [ + 551, + 553 + ], + [ + 554, + 556 + ], + [ + 557, + 558 + ], + [ + 560, + 571 + ], + [ + 572, + 585 + ], + [ + 586, + 587 + ], + [ + 589, + 590 + ], + [ + 595, + 598 + ], + [ + 605, + 608 + ], + [ + 610, + 611 + ], + [ + 613, + 614 + ], + [ + 617, + 619 + ], + [ + 621, + 622 + ], + [ + 626, + 627 + ], + [ + 631, + 632 + ], + [ + 638, + 639 + ], + [ + 641, + 642 + ], + [ + 644, + 645 + ], + [ + 649, + 650 + ], + [ + 654, + 655 + ], + [ + 667, + 690 + ], + [ + 694, + 696 + ], + [ + 703, + 704 + ], + [ + 706, + 707 + ], + [ + 711, + 712 + ], + [ + 716, + 717 + ], + [ + 725, + 732 + ], + [ + 737, + 739 + ], + [ + 741, + 742 + ], + [ + 743, + 744 + ], + [ + 748, + 749 + ], + [ + 751, + 752 + ], + [ + 756, + 757 + ], + [ + 761, + 762 + ], + [ + 771, + 772 + ], + [ + 774, + 776 + ], + [ + 786, + 789 + ], + [ + 794, + 796 + ], + [ + 810, + 811 + ], + [ + 812, + 816 + ], + [ + 817, + 819 + ], + [ + 820, + 821 + ], + [ + 822, + 824 + ], + [ + 825, + 827 + ], + [ + 828, + 831 + ], + [ + 832, + 834 + ], + [ + 839, + 842 + ], + [ + 843, + 844 + ], + [ + 847, + 848 + ], + [ + 851, + 853 + ], + [ + 860, + 864 + ], + [ + 872, + 875 + ], + [ + 880, + 882 + ], + [ + 884, + 885 + ], + [ + 893, + 894 + ], + [ + 909, + 910 + ], + [ + 911, + 914 + ], + [ + 922, + 923 + ], + [ + 924, + 925 + ], + [ + 926, + 929 + ], + [ + 930, + 931 + ], + [ + 934, + 935 + ], + [ + 936, + 940 + ], + [ + 941, + 943 + ], + [ + 957, + 960 + ], + [ + 961, + 962 + ], + [ + 965, + 966 + ], + [ + 968, + 970 + ], + [ + 976, + 977 + ], + [ + 980, + 982 + ], + [ + 985, + 987 + ], + [ + 989, + 991 + ], + [ + 993, + 997 + ], + [ + 1001, + 1002 + ], + [ + 1003, + 1007 + ], + [ + 1009, + 1010 + ], + [ + 1012, + 1018 + ], + [ + 1019, + 1021 + ], + [ + 1022, + 1023 + ], + [ + 1026, + 1027 + ], + [ + 1028, + 1029 + ], + [ + 1030, + 1031 + ], + [ + 1038, + 1039 + ], + [ + 1049, + 1052 + ], + [ + 1053, + 1055 + ], + [ + 1058, + 1059 + ], + [ + 1067, + 1068 + ], + [ + 1073, + 1075 + ], + [ + 1077, + 1078 + ], + [ + 1082, + 1085 + ], + [ + 1086, + 1088 + ], + [ + 1089, + 1090 + ], + [ + 1092, + 1093 + ], + [ + 1095, + 1096 + ], + [ + 1100, + 1104 + ], + [ + 1105, + 1106 + ], + [ + 1109, + 1111 + ], + [ + 1112, + 1113 + ], + [ + 1127, + 1133 + ], + [ + 1136, + 1137 + ], + [ + 1151, + 1153 + ], + [ + 1155, + 1156 + ], + [ + 1158, + 1159 + ], + [ + 1161, + 1166 + ], + [ + 1167, + 1169 + ], + [ + 1170, + 1171 + ], + [ + 1174, + 1175 + ], + [ + 1179, + 1183 + ], + [ + 1184, + 1185 + ], + [ + 1188, + 1190 + ], + [ + 1191, + 1192 + ], + [ + 1203, + 1209 + ], + [ + 1212, + 1213 + ], + [ + 1227, + 1229 + ], + [ + 1231, + 1232 + ], + [ + 1234, + 1235 + ], + [ + 1237, + 1238 + ], + [ + 1239, + 1240 + ], + [ + 1242, + 1246 + ], + [ + 1247, + 1248 + ], + [ + 1251, + 1253 + ], + [ + 1254, + 1255 + ], + [ + 1256, + 1257 + ], + [ + 1269, + 1275 + ], + [ + 1278, + 1280 + ], + [ + 1283, + 1285 + ], + [ + 1289, + 1290 + ], + [ + 1293, + 1295 + ], + [ + 1299, + 1300 + ], + [ + 1303, + 1305 + ], + [ + 1307, + 1308 + ], + [ + 1310, + 1311 + ], + [ + 1315, + 1317 + ], + [ + 1321, + 1322 + ], + [ + 1323, + 1327 + ], + [ + 1329, + 1330 + ], + [ + 1331, + 1332 + ], + [ + 1335, + 1339 + ], + [ + 1340, + 1341 + ], + [ + 1351, + 1354 + ], + [ + 1360, + 1375 + ], + [ + 1377, + 1378 + ], + [ + 1379, + 1383 + ], + [ + 1385, + 1390 + ], + [ + 1395, + 1396 + ], + [ + 1398, + 1400 + ], + [ + 1403, + 1404 + ], + [ + 1406, + 1408 + ], + [ + 1409, + 1410 + ], + [ + 1411, + 1415 + ], + [ + 1416, + 1418 + ], + [ + 1422, + 1423 + ], + [ + 1424, + 1425 + ], + [ + 1430, + 1434 + ], + [ + 1435, + 1438 + ], + [ + 1455, + 1456 + ], + [ + 1471, + 1472 + ], + [ + 1476, + 1479 + ], + [ + 1480, + 1481 + ], + [ + 1495, + 1496 + ], + [ + 1503, + 1504 + ], + [ + 1511, + 1512 + ], + [ + 1513, + 1516 + ], + [ + 1517, + 1518 + ], + [ + 1519, + 1520 + ], + [ + 1533, + 1534 + ], + [ + 1538, + 1539 + ], + [ + 1543, + 1546 + ], + [ + 1547, + 1548 + ] + ] + } + }, + { + "filename": "libvips/foreign/jp2ksave.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 118, + 267 + ], + [ + 268, + 294 + ], + [ + 302, + 399 + ], + [ + 405, + 456 + ], + [ + 461, + 505 + ], + [ + 507, + 554 + ], + [ + 557, + 582 + ], + [ + 585, + 634 + ], + [ + 639, + 674 + ], + [ + 676, + 688 + ], + [ + 705, + 712 + ], + [ + 728, + 735 + ], + [ + 736, + 756 + ], + [ + 759, + 769 + ], + [ + 788, + 795 + ], + [ + 797, + 806 + ], + [ + 807, + 832 + ], + [ + 842, + 859 + ], + [ + 867, + 927 + ], + [ + 929, + 956 + ], + [ + 959, + 1011 + ], + [ + 1027, + 1055 + ], + [ + 1057, + 1073 + ], + [ + 1081, + 1092 + ], + [ + 1093, + 1117 + ], + [ + 1119, + 1135 + ], + [ + 1140, + 1172 + ], + [ + 1174, + 1197 + ], + [ + 1200, + 1217 + ], + [ + 1218, + 1258 + ], + [ + 1268, + 1304 + ], + [ + 1309, + 1321 + ], + [ + 1325, + 1335 + ], + [ + 1341, + 1352 + ], + [ + 1354, + 1435 + ], + [ + 1471, + 1487 + ], + [ + 1505, + 1512 + ], + [ + 1513, + 1536 + ], + [ + 1553, + 1567 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 121, + 123 + ], + [ + 125, + 126 + ], + [ + 129, + 132 + ], + [ + 133, + 135 + ], + [ + 136, + 138 + ], + [ + 139, + 140 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 158, + 160 + ], + [ + 161, + 162 + ], + [ + 164, + 166 + ], + [ + 167, + 168 + ], + [ + 169, + 171 + ], + [ + 172, + 173 + ], + [ + 178, + 179 + ], + [ + 184, + 196 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 207, + 208 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 223, + 224 + ], + [ + 225, + 231 + ], + [ + 235, + 258 + ], + [ + 262, + 264 + ], + [ + 271, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 278 + ], + [ + 280, + 281 + ], + [ + 285, + 286 + ], + [ + 290, + 291 + ], + [ + 305, + 317 + ], + [ + 319, + 340 + ], + [ + 342, + 344 + ], + [ + 346, + 348 + ], + [ + 354, + 355 + ], + [ + 361, + 362 + ], + [ + 363, + 365 + ], + [ + 366, + 367 + ], + [ + 368, + 370 + ], + [ + 373, + 374 + ], + [ + 375, + 376 + ], + [ + 379, + 380 + ], + [ + 383, + 384 + ], + [ + 387, + 388 + ], + [ + 391, + 392 + ], + [ + 395, + 396 + ], + [ + 408, + 418 + ], + [ + 420, + 422 + ], + [ + 424, + 425 + ], + [ + 431, + 434 + ], + [ + 435, + 436 + ], + [ + 439, + 440 + ], + [ + 442, + 443 + ], + [ + 447, + 448 + ], + [ + 452, + 453 + ], + [ + 464, + 465 + ], + [ + 467, + 468 + ], + [ + 473, + 474 + ], + [ + 480, + 481 + ], + [ + 482, + 484 + ], + [ + 488, + 489 + ], + [ + 492, + 493 + ], + [ + 496, + 497 + ], + [ + 501, + 502 + ], + [ + 510, + 511 + ], + [ + 512, + 515 + ], + [ + 516, + 518 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 523, + 524 + ], + [ + 526, + 527 + ], + [ + 529, + 533 + ], + [ + 535, + 536 + ], + [ + 539, + 541 + ], + [ + 546, + 548 + ], + [ + 550, + 551 + ], + [ + 560, + 561 + ], + [ + 564, + 566 + ], + [ + 570, + 572 + ], + [ + 577, + 579 + ], + [ + 588, + 589 + ], + [ + 592, + 593 + ], + [ + 595, + 597 + ], + [ + 599, + 600 + ], + [ + 604, + 606 + ], + [ + 612, + 613 + ], + [ + 614, + 615 + ], + [ + 619, + 621 + ], + [ + 622, + 629 + ], + [ + 630, + 631 + ], + [ + 642, + 643 + ], + [ + 644, + 647 + ], + [ + 651, + 652 + ], + [ + 653, + 654 + ], + [ + 655, + 658 + ], + [ + 660, + 661 + ], + [ + 664, + 665 + ], + [ + 668, + 669 + ], + [ + 670, + 671 + ], + [ + 679, + 681 + ], + [ + 684, + 685 + ], + [ + 708, + 709 + ], + [ + 731, + 732 + ], + [ + 739, + 740 + ], + [ + 742, + 744 + ], + [ + 749, + 750 + ], + [ + 752, + 753 + ], + [ + 762, + 764 + ], + [ + 765, + 766 + ], + [ + 791, + 792 + ], + [ + 800, + 801 + ], + [ + 802, + 803 + ], + [ + 810, + 812 + ], + [ + 816, + 820 + ], + [ + 822, + 823 + ], + [ + 828, + 829 + ], + [ + 845, + 846 + ], + [ + 850, + 851 + ], + [ + 854, + 856 + ], + [ + 870, + 874 + ], + [ + 875, + 877 + ], + [ + 882, + 886 + ], + [ + 890, + 896 + ], + [ + 897, + 898 + ], + [ + 899, + 901 + ], + [ + 902, + 904 + ], + [ + 908, + 909 + ], + [ + 910, + 912 + ], + [ + 915, + 918 + ], + [ + 922, + 924 + ], + [ + 932, + 934 + ], + [ + 937, + 940 + ], + [ + 941, + 942 + ], + [ + 943, + 945 + ], + [ + 946, + 947 + ], + [ + 950, + 951 + ], + [ + 952, + 953 + ], + [ + 962, + 963 + ], + [ + 969, + 972 + ], + [ + 973, + 975 + ], + [ + 976, + 979 + ], + [ + 980, + 982 + ], + [ + 983, + 986 + ], + [ + 987, + 989 + ], + [ + 990, + 993 + ], + [ + 994, + 995 + ], + [ + 996, + 997 + ], + [ + 998, + 1001 + ], + [ + 1002, + 1004 + ], + [ + 1007, + 1008 + ], + [ + 1030, + 1032 + ], + [ + 1034, + 1035 + ], + [ + 1039, + 1041 + ], + [ + 1042, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1049, + 1050 + ], + [ + 1051, + 1052 + ], + [ + 1060, + 1063 + ], + [ + 1064, + 1066 + ], + [ + 1069, + 1070 + ], + [ + 1084, + 1086 + ], + [ + 1088, + 1089 + ], + [ + 1096, + 1098 + ], + [ + 1099, + 1101 + ], + [ + 1102, + 1105 + ], + [ + 1106, + 1107 + ], + [ + 1111, + 1112 + ], + [ + 1113, + 1114 + ], + [ + 1122, + 1125 + ], + [ + 1126, + 1128 + ], + [ + 1131, + 1132 + ], + [ + 1143, + 1145 + ], + [ + 1147, + 1148 + ], + [ + 1153, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1158, + 1160 + ], + [ + 1161, + 1162 + ], + [ + 1166, + 1167 + ], + [ + 1168, + 1169 + ], + [ + 1177, + 1180 + ], + [ + 1181, + 1183 + ], + [ + 1186, + 1187 + ], + [ + 1193, + 1194 + ], + [ + 1203, + 1205 + ], + [ + 1207, + 1209 + ], + [ + 1213, + 1214 + ], + [ + 1221, + 1222 + ], + [ + 1223, + 1224 + ], + [ + 1225, + 1226 + ], + [ + 1227, + 1229 + ], + [ + 1232, + 1233 + ], + [ + 1234, + 1235 + ], + [ + 1238, + 1239 + ], + [ + 1242, + 1243 + ], + [ + 1246, + 1247 + ], + [ + 1250, + 1251 + ], + [ + 1254, + 1255 + ], + [ + 1271, + 1273 + ], + [ + 1279, + 1282 + ], + [ + 1283, + 1284 + ], + [ + 1285, + 1286 + ], + [ + 1287, + 1288 + ], + [ + 1290, + 1291 + ], + [ + 1295, + 1296 + ], + [ + 1300, + 1301 + ], + [ + 1312, + 1313 + ], + [ + 1314, + 1318 + ], + [ + 1328, + 1329 + ], + [ + 1331, + 1332 + ], + [ + 1344, + 1345 + ], + [ + 1348, + 1349 + ], + [ + 1357, + 1361 + ], + [ + 1365, + 1370 + ], + [ + 1372, + 1380 + ], + [ + 1382, + 1383 + ], + [ + 1384, + 1387 + ], + [ + 1390, + 1392 + ], + [ + 1393, + 1394 + ], + [ + 1395, + 1397 + ], + [ + 1398, + 1401 + ], + [ + 1403, + 1407 + ], + [ + 1409, + 1412 + ], + [ + 1414, + 1415 + ], + [ + 1416, + 1417 + ], + [ + 1418, + 1419 + ], + [ + 1424, + 1425 + ], + [ + 1427, + 1428 + ], + [ + 1429, + 1432 + ], + [ + 1474, + 1475 + ], + [ + 1479, + 1482 + ], + [ + 1483, + 1484 + ], + [ + 1508, + 1509 + ], + [ + 1516, + 1519 + ], + [ + 1520, + 1523 + ], + [ + 1526, + 1527 + ], + [ + 1529, + 1530 + ], + [ + 1532, + 1533 + ], + [ + 1556, + 1557 + ], + [ + 1561, + 1564 + ], + [ + 1565, + 1566 + ] + ] + } + }, + { + "filename": "libvips/foreign/jpeg.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 42, + 50 + ], + [ + 71, + 83 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 45, + 47 + ], + [ + 74, + 76 + ], + [ + 78, + 80 + ] + ] + } + }, + { + "filename": "libvips/foreign/jpeg2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 38, + 45 + ], + [ + 62, + 73 + ], + [ + 91, + 98 + ], + [ + 109, + 146 + ], + [ + 170, + 177 + ], + [ + 181, + 188 + ], + [ + 228, + 235 + ], + [ + 242, + 249 + ], + [ + 252, + 291 + ], + [ + 295, + 367 + ], + [ + 372, + 415 + ], + [ + 416, + 444 + ], + [ + 445, + 504 + ], + [ + 509, + 516 + ], + [ + 524, + 540 + ], + [ + 553, + 563 + ], + [ + 564, + 580 + ], + [ + 582, + 590 + ], + [ + 591, + 630 + ], + [ + 636, + 701 + ], + [ + 703, + 722 + ], + [ + 735, + 757 + ], + [ + 759, + 797 + ], + [ + 798, + 974 + ], + [ + 976, + 1034 + ] + ], + "lines_added": [ + [ + 41, + 42 + ], + [ + 65, + 66 + ], + [ + 69, + 70 + ], + [ + 94, + 95 + ], + [ + 112, + 113 + ], + [ + 115, + 116 + ], + [ + 121, + 122 + ], + [ + 123, + 127 + ], + [ + 128, + 137 + ], + [ + 142, + 143 + ], + [ + 173, + 174 + ], + [ + 184, + 185 + ], + [ + 231, + 232 + ], + [ + 245, + 246 + ], + [ + 255, + 257 + ], + [ + 261, + 267 + ], + [ + 268, + 269 + ], + [ + 274, + 275 + ], + [ + 278, + 279 + ], + [ + 282, + 283 + ], + [ + 285, + 286 + ], + [ + 287, + 288 + ], + [ + 298, + 299 + ], + [ + 302, + 304 + ], + [ + 306, + 308 + ], + [ + 309, + 312 + ], + [ + 318, + 320 + ], + [ + 324, + 325 + ], + [ + 328, + 329 + ], + [ + 330, + 331 + ], + [ + 334, + 335 + ], + [ + 341, + 342 + ], + [ + 343, + 348 + ], + [ + 349, + 350 + ], + [ + 352, + 353 + ], + [ + 358, + 359 + ], + [ + 360, + 364 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 379, + 380 + ], + [ + 381, + 382 + ], + [ + 385, + 386 + ], + [ + 387, + 388 + ], + [ + 391, + 392 + ], + [ + 393, + 394 + ], + [ + 397, + 400 + ], + [ + 403, + 405 + ], + [ + 408, + 409 + ], + [ + 411, + 412 + ], + [ + 419, + 420 + ], + [ + 424, + 426 + ], + [ + 427, + 428 + ], + [ + 429, + 433 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 440, + 441 + ], + [ + 448, + 449 + ], + [ + 452, + 453 + ], + [ + 456, + 457 + ], + [ + 458, + 459 + ], + [ + 461, + 462 + ], + [ + 465, + 467 + ], + [ + 469, + 470 + ], + [ + 471, + 472 + ], + [ + 474, + 475 + ], + [ + 479, + 480 + ], + [ + 484, + 487 + ], + [ + 493, + 495 + ], + [ + 496, + 498 + ], + [ + 499, + 501 + ], + [ + 512, + 513 + ], + [ + 527, + 528 + ], + [ + 530, + 531 + ], + [ + 533, + 534 + ], + [ + 536, + 537 + ], + [ + 556, + 558 + ], + [ + 559, + 560 + ], + [ + 567, + 571 + ], + [ + 575, + 577 + ], + [ + 585, + 587 + ], + [ + 594, + 596 + ], + [ + 599, + 600 + ], + [ + 604, + 606 + ], + [ + 611, + 612 + ], + [ + 616, + 617 + ], + [ + 618, + 620 + ], + [ + 621, + 623 + ], + [ + 626, + 627 + ], + [ + 639, + 641 + ], + [ + 644, + 646 + ], + [ + 647, + 649 + ], + [ + 652, + 653 + ], + [ + 654, + 663 + ], + [ + 665, + 666 + ], + [ + 669, + 680 + ], + [ + 686, + 689 + ], + [ + 694, + 696 + ], + [ + 697, + 698 + ], + [ + 706, + 711 + ], + [ + 716, + 719 + ], + [ + 738, + 741 + ], + [ + 742, + 745 + ], + [ + 751, + 754 + ], + [ + 762, + 763 + ], + [ + 764, + 765 + ], + [ + 769, + 771 + ], + [ + 773, + 775 + ], + [ + 777, + 779 + ], + [ + 782, + 784 + ], + [ + 786, + 787 + ], + [ + 790, + 792 + ], + [ + 793, + 794 + ], + [ + 801, + 803 + ], + [ + 805, + 806 + ], + [ + 810, + 813 + ], + [ + 816, + 817 + ], + [ + 821, + 822 + ], + [ + 826, + 830 + ], + [ + 831, + 832 + ], + [ + 837, + 839 + ], + [ + 841, + 842 + ], + [ + 844, + 845 + ], + [ + 847, + 850 + ], + [ + 855, + 856 + ], + [ + 858, + 859 + ], + [ + 861, + 863 + ], + [ + 864, + 865 + ], + [ + 866, + 867 + ], + [ + 869, + 870 + ], + [ + 873, + 874 + ], + [ + 876, + 877 + ], + [ + 878, + 879 + ], + [ + 884, + 885 + ], + [ + 887, + 889 + ], + [ + 895, + 897 + ], + [ + 899, + 901 + ], + [ + 904, + 906 + ], + [ + 907, + 908 + ], + [ + 910, + 911 + ], + [ + 916, + 920 + ], + [ + 921, + 925 + ], + [ + 927, + 929 + ], + [ + 932, + 935 + ], + [ + 938, + 940 + ], + [ + 941, + 942 + ], + [ + 945, + 946 + ], + [ + 950, + 954 + ], + [ + 956, + 958 + ], + [ + 959, + 964 + ], + [ + 968, + 971 + ], + [ + 979, + 983 + ], + [ + 986, + 988 + ], + [ + 990, + 991 + ], + [ + 994, + 997 + ], + [ + 1000, + 1003 + ], + [ + 1007, + 1009 + ], + [ + 1010, + 1013 + ], + [ + 1014, + 1016 + ], + [ + 1017, + 1018 + ], + [ + 1021, + 1022 + ], + [ + 1025, + 1029 + ], + [ + 1030, + 1031 + ] + ] + } + }, + { + "filename": "libvips/foreign/jpegload.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 90, + 171 + ], + [ + 174, + 217 + ], + [ + 224, + 337 + ], + [ + 339, + 362 + ], + [ + 368, + 415 + ], + [ + 416, + 437 + ], + [ + 446, + 474 + ], + [ + 478, + 493 + ], + [ + 494, + 503 + ], + [ + 504, + 520 + ], + [ + 527, + 548 + ], + [ + 549, + 564 + ], + [ + 570, + 595 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 93, + 95 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 111, + 118 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 143, + 147 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 156, + 160 + ], + [ + 161, + 162 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 177, + 178 + ], + [ + 184, + 185 + ], + [ + 190, + 193 + ], + [ + 194, + 196 + ], + [ + 197, + 200 + ], + [ + 201, + 203 + ], + [ + 204, + 207 + ], + [ + 208, + 210 + ], + [ + 213, + 214 + ], + [ + 227, + 229 + ], + [ + 231, + 232 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 242, + 244 + ], + [ + 245, + 246 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ], + [ + 255, + 257 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 267, + 268 + ], + [ + 274, + 280 + ], + [ + 283, + 284 + ], + [ + 290, + 291 + ], + [ + 296, + 298 + ], + [ + 300, + 301 + ], + [ + 305, + 309 + ], + [ + 310, + 312 + ], + [ + 313, + 314 + ], + [ + 317, + 318 + ], + [ + 322, + 326 + ], + [ + 327, + 328 + ], + [ + 331, + 332 + ], + [ + 333, + 334 + ], + [ + 342, + 343 + ], + [ + 349, + 355 + ], + [ + 358, + 359 + ], + [ + 371, + 373 + ], + [ + 375, + 376 + ], + [ + 378, + 379 + ], + [ + 381, + 386 + ], + [ + 387, + 389 + ], + [ + 390, + 391 + ], + [ + 394, + 395 + ], + [ + 399, + 403 + ], + [ + 404, + 405 + ], + [ + 408, + 410 + ], + [ + 411, + 412 + ], + [ + 419, + 420 + ], + [ + 424, + 430 + ], + [ + 433, + 434 + ], + [ + 449, + 450 + ], + [ + 451, + 452 + ], + [ + 454, + 456 + ], + [ + 461, + 462 + ], + [ + 463, + 464 + ], + [ + 465, + 467 + ], + [ + 470, + 471 + ], + [ + 481, + 485 + ], + [ + 489, + 490 + ], + [ + 497, + 498 + ], + [ + 499, + 500 + ], + [ + 507, + 508 + ], + [ + 512, + 515 + ], + [ + 516, + 517 + ], + [ + 530, + 531 + ], + [ + 534, + 535 + ], + [ + 536, + 538 + ], + [ + 544, + 545 + ], + [ + 552, + 553 + ], + [ + 554, + 557 + ], + [ + 558, + 559 + ], + [ + 560, + 561 + ], + [ + 573, + 574 + ], + [ + 577, + 578 + ], + [ + 584, + 585 + ], + [ + 589, + 592 + ], + [ + 593, + 594 + ] + ] + } + }, + { + "filename": "libvips/foreign/jpegsave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 90, + 97 + ], + [ + 111, + 119 + ], + [ + 124, + 150 + ], + [ + 152, + 159 + ], + [ + 162, + 249 + ], + [ + 257, + 312 + ], + [ + 314, + 331 + ], + [ + 332, + 380 + ], + [ + 388, + 457 + ], + [ + 461, + 472 + ], + [ + 475, + 525 + ], + [ + 526, + 534 + ], + [ + 549, + 570 + ], + [ + 592, + 603 + ], + [ + 610, + 617 + ], + [ + 619, + 656 + ], + [ + 674, + 695 + ], + [ + 707, + 714 + ], + [ + 718, + 754 + ], + [ + 771, + 785 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 93, + 94 + ], + [ + 114, + 116 + ], + [ + 127, + 128 + ], + [ + 131, + 133 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 144, + 145 + ], + [ + 146, + 147 + ], + [ + 155, + 156 + ], + [ + 165, + 168 + ], + [ + 169, + 171 + ], + [ + 172, + 175 + ], + [ + 176, + 178 + ], + [ + 179, + 182 + ], + [ + 183, + 185 + ], + [ + 186, + 189 + ], + [ + 190, + 192 + ], + [ + 193, + 196 + ], + [ + 197, + 199 + ], + [ + 200, + 203 + ], + [ + 204, + 206 + ], + [ + 207, + 210 + ], + [ + 211, + 213 + ], + [ + 214, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 224 + ], + [ + 225, + 227 + ], + [ + 228, + 231 + ], + [ + 232, + 233 + ], + [ + 234, + 235 + ], + [ + 236, + 239 + ], + [ + 240, + 242 + ], + [ + 245, + 246 + ], + [ + 260, + 262 + ], + [ + 264, + 265 + ], + [ + 268, + 269 + ], + [ + 271, + 273 + ], + [ + 274, + 281 + ], + [ + 282, + 283 + ], + [ + 286, + 288 + ], + [ + 289, + 290 + ], + [ + 296, + 297 + ], + [ + 299, + 305 + ], + [ + 308, + 309 + ], + [ + 317, + 318 + ], + [ + 323, + 325 + ], + [ + 327, + 328 + ], + [ + 335, + 348 + ], + [ + 349, + 350 + ], + [ + 351, + 352 + ], + [ + 355, + 356 + ], + [ + 357, + 358 + ], + [ + 364, + 365 + ], + [ + 367, + 373 + ], + [ + 376, + 377 + ], + [ + 391, + 393 + ], + [ + 395, + 396 + ], + [ + 399, + 400 + ], + [ + 405, + 419 + ], + [ + 421, + 424 + ], + [ + 425, + 426 + ], + [ + 427, + 428 + ], + [ + 431, + 433 + ], + [ + 434, + 435 + ], + [ + 441, + 442 + ], + [ + 444, + 450 + ], + [ + 453, + 454 + ], + [ + 464, + 466 + ], + [ + 468, + 469 + ], + [ + 478, + 492 + ], + [ + 494, + 495 + ], + [ + 496, + 502 + ], + [ + 503, + 504 + ], + [ + 505, + 506 + ], + [ + 507, + 508 + ], + [ + 511, + 512 + ], + [ + 516, + 517 + ], + [ + 521, + 522 + ], + [ + 529, + 531 + ], + [ + 552, + 554 + ], + [ + 555, + 556 + ], + [ + 560, + 561 + ], + [ + 564, + 565 + ], + [ + 566, + 567 + ], + [ + 595, + 596 + ], + [ + 597, + 598 + ], + [ + 599, + 600 + ], + [ + 613, + 614 + ], + [ + 622, + 624 + ], + [ + 628, + 629 + ], + [ + 631, + 632 + ], + [ + 638, + 639 + ], + [ + 643, + 646 + ], + [ + 647, + 648 + ], + [ + 652, + 653 + ], + [ + 677, + 678 + ], + [ + 682, + 685 + ], + [ + 686, + 687 + ], + [ + 691, + 692 + ], + [ + 710, + 711 + ], + [ + 721, + 722 + ], + [ + 727, + 728 + ], + [ + 729, + 732 + ], + [ + 733, + 736 + ], + [ + 739, + 740 + ], + [ + 742, + 743 + ], + [ + 745, + 746 + ], + [ + 750, + 751 + ], + [ + 774, + 775 + ], + [ + 779, + 782 + ], + [ + 783, + 784 + ] + ] + } + }, + { + "filename": "libvips/foreign/jxlload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 66, + 73 + ], + [ + 116, + 410 + ], + [ + 420, + 429 + ], + [ + 438, + 445 + ], + [ + 462, + 551 + ], + [ + 552, + 680 + ], + [ + 685, + 705 + ], + [ + 706, + 713 + ], + [ + 717, + 727 + ], + [ + 729, + 780 + ], + [ + 788, + 804 + ], + [ + 812, + 858 + ], + [ + 863, + 879 + ], + [ + 887, + 922 + ], + [ + 928, + 944 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 69, + 70 + ], + [ + 119, + 121 + ], + [ + 123, + 124 + ], + [ + 128, + 129 + ], + [ + 131, + 135 + ], + [ + 136, + 137 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 155, + 156 + ], + [ + 158, + 161 + ], + [ + 162, + 167 + ], + [ + 169, + 171 + ], + [ + 172, + 173 + ], + [ + 176, + 177 + ], + [ + 181, + 184 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 195 + ], + [ + 199, + 201 + ], + [ + 203, + 204 + ], + [ + 205, + 207 + ], + [ + 208, + 209 + ], + [ + 211, + 213 + ], + [ + 216, + 218 + ], + [ + 220, + 221 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 230 + ], + [ + 233, + 234 + ], + [ + 237, + 238 + ], + [ + 241, + 242 + ], + [ + 245, + 246 + ], + [ + 249, + 250 + ], + [ + 253, + 254 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 273, + 274 + ], + [ + 277, + 278 + ], + [ + 281, + 282 + ], + [ + 285, + 286 + ], + [ + 289, + 290 + ], + [ + 295, + 296 + ], + [ + 297, + 328 + ], + [ + 331, + 332 + ], + [ + 333, + 338 + ], + [ + 340, + 342 + ], + [ + 344, + 346 + ], + [ + 349, + 350 + ], + [ + 352, + 356 + ], + [ + 359, + 361 + ], + [ + 365, + 366 + ], + [ + 368, + 370 + ], + [ + 373, + 374 + ], + [ + 376, + 381 + ], + [ + 384, + 386 + ], + [ + 388, + 389 + ], + [ + 392, + 393 + ], + [ + 394, + 395 + ], + [ + 399, + 404 + ], + [ + 406, + 407 + ], + [ + 423, + 424 + ], + [ + 425, + 426 + ], + [ + 441, + 442 + ], + [ + 465, + 468 + ], + [ + 469, + 471 + ], + [ + 473, + 481 + ], + [ + 485, + 487 + ], + [ + 488, + 489 + ], + [ + 492, + 493 + ], + [ + 499, + 500 + ], + [ + 502, + 504 + ], + [ + 505, + 512 + ], + [ + 514, + 518 + ], + [ + 522, + 534 + ], + [ + 536, + 537 + ], + [ + 541, + 543 + ], + [ + 544, + 546 + ], + [ + 547, + 548 + ], + [ + 555, + 556 + ], + [ + 561, + 568 + ], + [ + 571, + 574 + ], + [ + 575, + 586 + ], + [ + 592, + 596 + ], + [ + 597, + 599 + ], + [ + 600, + 602 + ], + [ + 603, + 604 + ], + [ + 607, + 608 + ], + [ + 609, + 610 + ], + [ + 611, + 613 + ], + [ + 618, + 619 + ], + [ + 622, + 624 + ], + [ + 628, + 637 + ], + [ + 639, + 643 + ], + [ + 647, + 663 + ], + [ + 664, + 669 + ], + [ + 670, + 677 + ], + [ + 688, + 689 + ], + [ + 690, + 692 + ], + [ + 693, + 694 + ], + [ + 697, + 698 + ], + [ + 699, + 700 + ], + [ + 701, + 702 + ], + [ + 709, + 710 + ], + [ + 723, + 724 + ], + [ + 732, + 733 + ], + [ + 738, + 740 + ], + [ + 742, + 743 + ], + [ + 747, + 750 + ], + [ + 751, + 753 + ], + [ + 754, + 755 + ], + [ + 757, + 758 + ], + [ + 760, + 761 + ], + [ + 765, + 769 + ], + [ + 770, + 771 + ], + [ + 774, + 775 + ], + [ + 776, + 777 + ], + [ + 791, + 797 + ], + [ + 800, + 801 + ], + [ + 815, + 817 + ], + [ + 819, + 820 + ], + [ + 822, + 823 + ], + [ + 825, + 830 + ], + [ + 831, + 833 + ], + [ + 834, + 835 + ], + [ + 838, + 839 + ], + [ + 843, + 847 + ], + [ + 848, + 849 + ], + [ + 852, + 853 + ], + [ + 854, + 855 + ], + [ + 866, + 872 + ], + [ + 875, + 876 + ], + [ + 890, + 892 + ], + [ + 894, + 895 + ], + [ + 897, + 898 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 905, + 909 + ], + [ + 910, + 911 + ], + [ + 914, + 915 + ], + [ + 916, + 917 + ], + [ + 918, + 919 + ], + [ + 931, + 937 + ], + [ + 940, + 941 + ] + ] + } + }, + { + "filename": "libvips/foreign/jxlsave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 104, + 263 + ], + [ + 264, + 285 + ], + [ + 302, + 309 + ], + [ + 317, + 325 + ], + [ + 326, + 335 + ], + [ + 336, + 347 + ], + [ + 349, + 444 + ], + [ + 445, + 476 + ], + [ + 486, + 497 + ], + [ + 499, + 506 + ], + [ + 514, + 558 + ], + [ + 565, + 599 + ], + [ + 601, + 617 + ], + [ + 625, + 661 + ], + [ + 663, + 679 + ], + [ + 684, + 716 + ], + [ + 718, + 734 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 107, + 109 + ], + [ + 111, + 112 + ], + [ + 115, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 134, + 135 + ], + [ + 136, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 178 + ], + [ + 180, + 182 + ], + [ + 184, + 186 + ], + [ + 189, + 190 + ], + [ + 192, + 195 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 225, + 226 + ], + [ + 229, + 230 + ], + [ + 236, + 238 + ], + [ + 243, + 245 + ], + [ + 248, + 249 + ], + [ + 251, + 254 + ], + [ + 255, + 260 + ], + [ + 267, + 268 + ], + [ + 269, + 271 + ], + [ + 275, + 277 + ], + [ + 279, + 280 + ], + [ + 281, + 282 + ], + [ + 305, + 306 + ], + [ + 320, + 322 + ], + [ + 329, + 330 + ], + [ + 331, + 332 + ], + [ + 339, + 340 + ], + [ + 342, + 344 + ], + [ + 352, + 355 + ], + [ + 359, + 360 + ], + [ + 363, + 366 + ], + [ + 368, + 369 + ], + [ + 370, + 375 + ], + [ + 381, + 382 + ], + [ + 383, + 384 + ], + [ + 386, + 388 + ], + [ + 391, + 392 + ], + [ + 394, + 396 + ], + [ + 398, + 403 + ], + [ + 409, + 411 + ], + [ + 412, + 419 + ], + [ + 421, + 428 + ], + [ + 430, + 435 + ], + [ + 440, + 441 + ], + [ + 448, + 451 + ], + [ + 453, + 457 + ], + [ + 460, + 462 + ], + [ + 463, + 464 + ], + [ + 465, + 466 + ], + [ + 467, + 468 + ], + [ + 469, + 471 + ], + [ + 472, + 473 + ], + [ + 489, + 490 + ], + [ + 491, + 492 + ], + [ + 493, + 494 + ], + [ + 502, + 503 + ], + [ + 517, + 520 + ], + [ + 521, + 523 + ], + [ + 524, + 527 + ], + [ + 528, + 530 + ], + [ + 531, + 534 + ], + [ + 535, + 537 + ], + [ + 538, + 541 + ], + [ + 542, + 544 + ], + [ + 545, + 548 + ], + [ + 549, + 551 + ], + [ + 554, + 555 + ], + [ + 568, + 569 + ], + [ + 574, + 576 + ], + [ + 578, + 579 + ], + [ + 583, + 585 + ], + [ + 586, + 588 + ], + [ + 589, + 590 + ], + [ + 593, + 594 + ], + [ + 595, + 596 + ], + [ + 604, + 610 + ], + [ + 613, + 614 + ], + [ + 628, + 630 + ], + [ + 632, + 633 + ], + [ + 635, + 636 + ], + [ + 640, + 642 + ], + [ + 643, + 645 + ], + [ + 646, + 649 + ], + [ + 650, + 651 + ], + [ + 654, + 656 + ], + [ + 657, + 658 + ], + [ + 666, + 672 + ], + [ + 675, + 676 + ], + [ + 687, + 689 + ], + [ + 691, + 692 + ], + [ + 694, + 695 + ], + [ + 697, + 698 + ], + [ + 699, + 700 + ], + [ + 702, + 704 + ], + [ + 705, + 706 + ], + [ + 709, + 711 + ], + [ + 712, + 713 + ], + [ + 721, + 727 + ], + [ + 730, + 731 + ] + ] + } + }, + { + "filename": "libvips/foreign/magick.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 10, + 38 + ], + [ + 52, + 65 + ], + [ + 73, + 129 + ], + [ + 130, + 236 + ], + [ + 240, + 281 + ], + [ + 282, + 303 + ], + [ + 304, + 351 + ], + [ + 353, + 470 + ], + [ + 471, + 508 + ], + [ + 509, + 554 + ], + [ + 557, + 565 + ], + [ + 568, + 606 + ], + [ + 607, + 643 + ], + [ + 644, + 661 + ], + [ + 676, + 684 + ], + [ + 708, + 816 + ], + [ + 818, + 873 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 29 + ], + [ + 34, + 35 + ], + [ + 55, + 56 + ], + [ + 61, + 62 + ], + [ + 76, + 77 + ], + [ + 78, + 79 + ], + [ + 82, + 84 + ], + [ + 85, + 87 + ], + [ + 90, + 92 + ], + [ + 93, + 96 + ], + [ + 97, + 104 + ], + [ + 105, + 106 + ], + [ + 109, + 111 + ], + [ + 114, + 116 + ], + [ + 119, + 120 + ], + [ + 124, + 126 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 139, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 148 + ], + [ + 149, + 150 + ], + [ + 153, + 154 + ], + [ + 155, + 156 + ], + [ + 157, + 159 + ], + [ + 162, + 164 + ], + [ + 165, + 166 + ], + [ + 169, + 171 + ], + [ + 172, + 173 + ], + [ + 176, + 179 + ], + [ + 183, + 186 + ], + [ + 187, + 188 + ], + [ + 191, + 192 + ], + [ + 195, + 197 + ], + [ + 202, + 207 + ], + [ + 209, + 210 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 232, + 233 + ], + [ + 243, + 245 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 254, + 256 + ], + [ + 259, + 260 + ], + [ + 266, + 268 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 277, + 278 + ], + [ + 285, + 287 + ], + [ + 290, + 292 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 307, + 308 + ], + [ + 312, + 313 + ], + [ + 316, + 317 + ], + [ + 321, + 323 + ], + [ + 326, + 327 + ], + [ + 330, + 331 + ], + [ + 335, + 337 + ], + [ + 339, + 340 + ], + [ + 343, + 345 + ], + [ + 346, + 348 + ], + [ + 356, + 357 + ], + [ + 361, + 362 + ], + [ + 363, + 364 + ], + [ + 366, + 369 + ], + [ + 372, + 374 + ], + [ + 375, + 379 + ], + [ + 382, + 385 + ], + [ + 387, + 389 + ], + [ + 391, + 393 + ], + [ + 395, + 397 + ], + [ + 399, + 401 + ], + [ + 403, + 405 + ], + [ + 411, + 412 + ], + [ + 414, + 415 + ], + [ + 416, + 417 + ], + [ + 418, + 419 + ], + [ + 423, + 425 + ], + [ + 427, + 428 + ], + [ + 429, + 430 + ], + [ + 434, + 436 + ], + [ + 439, + 442 + ], + [ + 446, + 447 + ], + [ + 448, + 449 + ], + [ + 455, + 460 + ], + [ + 462, + 463 + ], + [ + 466, + 467 + ], + [ + 474, + 476 + ], + [ + 478, + 483 + ], + [ + 484, + 495 + ], + [ + 496, + 497 + ], + [ + 500, + 501 + ], + [ + 504, + 505 + ], + [ + 512, + 513 + ], + [ + 515, + 517 + ], + [ + 519, + 520 + ], + [ + 523, + 524 + ], + [ + 528, + 530 + ], + [ + 532, + 535 + ], + [ + 540, + 541 + ], + [ + 543, + 544 + ], + [ + 548, + 549 + ], + [ + 550, + 551 + ], + [ + 560, + 562 + ], + [ + 571, + 572 + ], + [ + 576, + 577 + ], + [ + 578, + 579 + ], + [ + 581, + 582 + ], + [ + 586, + 589 + ], + [ + 594, + 596 + ], + [ + 599, + 603 + ], + [ + 610, + 611 + ], + [ + 617, + 619 + ], + [ + 620, + 623 + ], + [ + 626, + 628 + ], + [ + 632, + 634 + ], + [ + 637, + 638 + ], + [ + 639, + 640 + ], + [ + 647, + 649 + ], + [ + 651, + 652 + ], + [ + 657, + 658 + ], + [ + 679, + 681 + ], + [ + 711, + 712 + ], + [ + 715, + 718 + ], + [ + 719, + 720 + ], + [ + 723, + 735 + ], + [ + 739, + 740 + ], + [ + 744, + 745 + ], + [ + 747, + 751 + ], + [ + 754, + 755 + ], + [ + 759, + 760 + ], + [ + 762, + 763 + ], + [ + 766, + 767 + ], + [ + 770, + 771 + ], + [ + 776, + 778 + ], + [ + 782, + 792 + ], + [ + 793, + 794 + ], + [ + 795, + 797 + ], + [ + 798, + 800 + ], + [ + 801, + 802 + ], + [ + 807, + 808 + ], + [ + 809, + 811 + ], + [ + 812, + 813 + ], + [ + 821, + 823 + ], + [ + 825, + 826 + ], + [ + 829, + 840 + ], + [ + 841, + 847 + ], + [ + 848, + 851 + ], + [ + 852, + 853 + ], + [ + 858, + 860 + ], + [ + 865, + 868 + ], + [ + 869, + 870 + ] + ] + } + }, + { + "filename": "libvips/foreign/magick.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 37 + ], + [ + 42, + 96 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 33, + 34 + ], + [ + 45, + 52 + ], + [ + 53, + 94 + ] + ] + } + }, + { + "filename": "libvips/foreign/magick2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 16, + 23 + ], + [ + 25, + 32 + ], + [ + 41, + 53 + ], + [ + 72, + 100 + ], + [ + 126, + 139 + ], + [ + 141, + 148 + ], + [ + 168, + 202 + ], + [ + 204, + 287 + ], + [ + 300, + 316 + ], + [ + 319, + 392 + ], + [ + 393, + 400 + ], + [ + 404, + 416 + ], + [ + 430, + 521 + ], + [ + 522, + 561 + ], + [ + 562, + 640 + ], + [ + 643, + 662 + ], + [ + 665, + 684 + ], + [ + 687, + 706 + ], + [ + 712, + 751 + ], + [ + 753, + 950 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 19, + 20 + ], + [ + 28, + 29 + ], + [ + 44, + 45 + ], + [ + 49, + 50 + ], + [ + 75, + 76 + ], + [ + 77, + 81 + ], + [ + 82, + 91 + ], + [ + 96, + 97 + ], + [ + 129, + 130 + ], + [ + 135, + 136 + ], + [ + 144, + 145 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 177, + 183 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 196, + 199 + ], + [ + 207, + 208 + ], + [ + 210, + 213 + ], + [ + 219, + 221 + ], + [ + 227, + 228 + ], + [ + 229, + 231 + ], + [ + 232, + 235 + ], + [ + 238, + 242 + ], + [ + 245, + 246 + ], + [ + 249, + 250 + ], + [ + 254, + 256 + ], + [ + 257, + 260 + ], + [ + 262, + 263 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 272, + 273 + ], + [ + 274, + 275 + ], + [ + 281, + 284 + ], + [ + 303, + 306 + ], + [ + 308, + 309 + ], + [ + 312, + 313 + ], + [ + 322, + 338 + ], + [ + 343, + 345 + ], + [ + 349, + 354 + ], + [ + 356, + 357 + ], + [ + 359, + 360 + ], + [ + 364, + 365 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 375, + 377 + ], + [ + 380, + 384 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 396, + 397 + ], + [ + 407, + 410 + ], + [ + 412, + 413 + ], + [ + 433, + 435 + ], + [ + 438, + 440 + ], + [ + 442, + 444 + ], + [ + 445, + 456 + ], + [ + 458, + 460 + ], + [ + 461, + 467 + ], + [ + 468, + 471 + ], + [ + 473, + 475 + ], + [ + 476, + 483 + ], + [ + 484, + 487 + ], + [ + 488, + 489 + ], + [ + 490, + 495 + ], + [ + 498, + 499 + ], + [ + 502, + 503 + ], + [ + 504, + 507 + ], + [ + 508, + 509 + ], + [ + 510, + 512 + ], + [ + 513, + 518 + ], + [ + 525, + 526 + ], + [ + 531, + 532 + ], + [ + 534, + 536 + ], + [ + 539, + 541 + ], + [ + 542, + 543 + ], + [ + 544, + 545 + ], + [ + 547, + 549 + ], + [ + 552, + 553 + ], + [ + 554, + 556 + ], + [ + 557, + 558 + ], + [ + 565, + 575 + ], + [ + 576, + 587 + ], + [ + 588, + 600 + ], + [ + 601, + 614 + ], + [ + 616, + 617 + ], + [ + 620, + 621 + ], + [ + 624, + 637 + ], + [ + 646, + 647 + ], + [ + 648, + 659 + ], + [ + 668, + 681 + ], + [ + 690, + 691 + ], + [ + 692, + 703 + ], + [ + 715, + 716 + ], + [ + 720, + 722 + ], + [ + 723, + 724 + ], + [ + 725, + 726 + ], + [ + 732, + 733 + ], + [ + 734, + 736 + ], + [ + 739, + 740 + ], + [ + 744, + 745 + ], + [ + 747, + 748 + ], + [ + 756, + 757 + ], + [ + 760, + 762 + ], + [ + 767, + 768 + ], + [ + 774, + 775 + ], + [ + 776, + 778 + ], + [ + 779, + 780 + ], + [ + 781, + 786 + ], + [ + 788, + 790 + ], + [ + 792, + 793 + ], + [ + 796, + 798 + ], + [ + 802, + 803 + ], + [ + 805, + 807 + ], + [ + 809, + 810 + ], + [ + 812, + 818 + ], + [ + 820, + 825 + ], + [ + 826, + 827 + ], + [ + 830, + 832 + ], + [ + 836, + 837 + ], + [ + 839, + 841 + ], + [ + 843, + 844 + ], + [ + 848, + 849 + ], + [ + 850, + 856 + ], + [ + 858, + 860 + ], + [ + 861, + 865 + ], + [ + 869, + 870 + ], + [ + 871, + 872 + ], + [ + 875, + 877 + ], + [ + 881, + 882 + ], + [ + 884, + 886 + ], + [ + 888, + 889 + ], + [ + 891, + 897 + ], + [ + 899, + 904 + ], + [ + 905, + 906 + ], + [ + 909, + 911 + ], + [ + 915, + 916 + ], + [ + 918, + 920 + ], + [ + 922, + 923 + ], + [ + 926, + 928 + ], + [ + 929, + 935 + ], + [ + 937, + 939 + ], + [ + 940, + 944 + ], + [ + 946, + 947 + ] + ] + } + }, + { + "filename": "libvips/foreign/magick6load.c", + "line_filter": { + "diff_chunks": [ + [ + 18, + 46 + ], + [ + 74, + 109 + ], + [ + 110, + 119 + ], + [ + 126, + 167 + ], + [ + 168, + 227 + ], + [ + 228, + 250 + ], + [ + 256, + 302 + ], + [ + 303, + 325 + ] + ], + "lines_added": [ + [ + 21, + 37 + ], + [ + 42, + 43 + ], + [ + 77, + 80 + ], + [ + 85, + 87 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ], + [ + 129, + 130 + ], + [ + 133, + 136 + ], + [ + 137, + 139 + ], + [ + 140, + 143 + ], + [ + 144, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 153 + ], + [ + 154, + 157 + ], + [ + 158, + 160 + ], + [ + 163, + 164 + ], + [ + 171, + 172 + ], + [ + 177, + 179 + ], + [ + 181, + 182 + ], + [ + 188, + 190 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 203, + 204 + ], + [ + 206, + 207 + ], + [ + 209, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 220, + 222 + ], + [ + 223, + 224 + ], + [ + 231, + 232 + ], + [ + 237, + 243 + ], + [ + 246, + 247 + ], + [ + 259, + 261 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 279, + 280 + ], + [ + 282, + 283 + ], + [ + 285, + 290 + ], + [ + 291, + 292 + ], + [ + 295, + 297 + ], + [ + 298, + 299 + ], + [ + 306, + 307 + ], + [ + 312, + 318 + ], + [ + 321, + 322 + ] + ] + } + }, + { + "filename": "libvips/foreign/magick7load.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 71, + 80 + ], + [ + 85, + 93 + ], + [ + 96, + 108 + ], + [ + 114, + 222 + ], + [ + 230, + 237 + ], + [ + 243, + 346 + ], + [ + 348, + 358 + ], + [ + 365, + 422 + ], + [ + 424, + 456 + ], + [ + 457, + 498 + ], + [ + 499, + 506 + ], + [ + 510, + 533 + ], + [ + 541, + 602 + ], + [ + 603, + 634 + ], + [ + 636, + 712 + ], + [ + 713, + 724 + ], + [ + 725, + 840 + ], + [ + 841, + 862 + ], + [ + 868, + 922 + ], + [ + 923, + 944 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 74, + 77 + ], + [ + 88, + 90 + ], + [ + 99, + 101 + ], + [ + 104, + 105 + ], + [ + 117, + 135 + ], + [ + 138, + 139 + ], + [ + 141, + 164 + ], + [ + 167, + 191 + ], + [ + 193, + 200 + ], + [ + 201, + 203 + ], + [ + 205, + 209 + ], + [ + 212, + 213 + ], + [ + 218, + 219 + ], + [ + 233, + 234 + ], + [ + 246, + 249 + ], + [ + 251, + 253 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 276, + 277 + ], + [ + 279, + 281 + ], + [ + 282, + 290 + ], + [ + 293, + 294 + ], + [ + 298, + 299 + ], + [ + 303, + 304 + ], + [ + 307, + 309 + ], + [ + 310, + 311 + ], + [ + 315, + 316 + ], + [ + 319, + 320 + ], + [ + 324, + 326 + ], + [ + 327, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 335 + ], + [ + 338, + 339 + ], + [ + 340, + 341 + ], + [ + 342, + 343 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 368, + 369 + ], + [ + 372, + 375 + ], + [ + 376, + 378 + ], + [ + 379, + 382 + ], + [ + 383, + 385 + ], + [ + 386, + 389 + ], + [ + 390, + 392 + ], + [ + 393, + 396 + ], + [ + 397, + 399 + ], + [ + 402, + 403 + ], + [ + 408, + 409 + ], + [ + 410, + 411 + ], + [ + 412, + 415 + ], + [ + 418, + 419 + ], + [ + 427, + 429 + ], + [ + 430, + 431 + ], + [ + 432, + 433 + ], + [ + 434, + 435 + ], + [ + 438, + 440 + ], + [ + 441, + 442 + ], + [ + 447, + 453 + ], + [ + 460, + 462 + ], + [ + 466, + 471 + ], + [ + 474, + 475 + ], + [ + 477, + 478 + ], + [ + 479, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 484 + ], + [ + 486, + 490 + ], + [ + 492, + 493 + ], + [ + 494, + 495 + ], + [ + 502, + 503 + ], + [ + 513, + 517 + ], + [ + 519, + 520 + ], + [ + 523, + 524 + ], + [ + 529, + 530 + ], + [ + 544, + 546 + ], + [ + 549, + 551 + ], + [ + 552, + 553 + ], + [ + 555, + 559 + ], + [ + 560, + 562 + ], + [ + 566, + 568 + ], + [ + 569, + 575 + ], + [ + 576, + 577 + ], + [ + 578, + 579 + ], + [ + 583, + 584 + ], + [ + 588, + 590 + ], + [ + 591, + 593 + ], + [ + 594, + 599 + ], + [ + 606, + 607 + ], + [ + 612, + 613 + ], + [ + 615, + 617 + ], + [ + 620, + 622 + ], + [ + 625, + 626 + ], + [ + 627, + 629 + ], + [ + 630, + 631 + ], + [ + 639, + 655 + ], + [ + 656, + 657 + ], + [ + 659, + 661 + ], + [ + 663, + 664 + ], + [ + 668, + 669 + ], + [ + 674, + 676 + ], + [ + 677, + 678 + ], + [ + 679, + 682 + ], + [ + 683, + 684 + ], + [ + 685, + 686 + ], + [ + 692, + 693 + ], + [ + 694, + 695 + ], + [ + 696, + 697 + ], + [ + 700, + 701 + ], + [ + 704, + 705 + ], + [ + 708, + 709 + ], + [ + 716, + 717 + ], + [ + 720, + 721 + ], + [ + 728, + 729 + ], + [ + 731, + 734 + ], + [ + 737, + 741 + ], + [ + 742, + 743 + ], + [ + 744, + 745 + ], + [ + 749, + 756 + ], + [ + 761, + 763 + ], + [ + 765, + 769 + ], + [ + 770, + 771 + ], + [ + 776, + 777 + ], + [ + 782, + 784 + ], + [ + 786, + 787 + ], + [ + 793, + 795 + ], + [ + 798, + 799 + ], + [ + 804, + 805 + ], + [ + 807, + 809 + ], + [ + 810, + 811 + ], + [ + 815, + 816 + ], + [ + 818, + 822 + ], + [ + 824, + 826 + ], + [ + 827, + 828 + ], + [ + 829, + 830 + ], + [ + 833, + 835 + ], + [ + 836, + 837 + ], + [ + 844, + 845 + ], + [ + 849, + 855 + ], + [ + 858, + 859 + ], + [ + 871, + 873 + ], + [ + 875, + 876 + ], + [ + 877, + 879 + ], + [ + 882, + 883 + ], + [ + 885, + 886 + ], + [ + 889, + 890 + ], + [ + 895, + 896 + ], + [ + 898, + 901 + ], + [ + 902, + 906 + ], + [ + 908, + 910 + ], + [ + 911, + 912 + ], + [ + 915, + 917 + ], + [ + 918, + 919 + ], + [ + 926, + 927 + ], + [ + 931, + 937 + ], + [ + 940, + 941 + ] + ] + } + }, + { + "filename": "libvips/foreign/magickload.c", + "line_filter": { + "diff_chunks": [ + [ + 18, + 46 + ], + [ + 73, + 80 + ], + [ + 90, + 98 + ], + [ + 99, + 115 + ], + [ + 125, + 142 + ], + [ + 143, + 156 + ] + ], + "lines_added": [ + [ + 21, + 37 + ], + [ + 42, + 43 + ], + [ + 76, + 77 + ], + [ + 93, + 95 + ], + [ + 102, + 103 + ], + [ + 107, + 110 + ], + [ + 111, + 112 + ], + [ + 128, + 129 + ], + [ + 130, + 132 + ], + [ + 138, + 139 + ], + [ + 146, + 147 + ], + [ + 148, + 151 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ] + ] + } + }, + { + "filename": "libvips/foreign/magicksave.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 9, + 16 + ], + [ + 18, + 46 + ], + [ + 56, + 64 + ], + [ + 92, + 113 + ], + [ + 119, + 126 + ], + [ + 130, + 159 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 12, + 13 + ], + [ + 21, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 37 + ], + [ + 42, + 43 + ], + [ + 59, + 61 + ], + [ + 95, + 96 + ], + [ + 100, + 103 + ], + [ + 104, + 105 + ], + [ + 109, + 110 + ], + [ + 122, + 123 + ], + [ + 133, + 134 + ], + [ + 139, + 140 + ], + [ + 141, + 144 + ], + [ + 145, + 148 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ], + [ + 157, + 158 + ] + ] + } + }, + { + "filename": "libvips/foreign/matlab.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 41 + ], + [ + 46, + 53 + ], + [ + 86, + 146 + ], + [ + 157, + 194 + ], + [ + 199, + 293 + ], + [ + 295, + 339 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 12 + ], + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 32 + ], + [ + 37, + 38 + ], + [ + 49, + 50 + ], + [ + 89, + 90 + ], + [ + 91, + 94 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 103, + 105 + ], + [ + 106, + 107 + ], + [ + 111, + 116 + ], + [ + 118, + 125 + ], + [ + 128, + 132 + ], + [ + 136, + 137 + ], + [ + 139, + 140 + ], + [ + 142, + 143 + ], + [ + 160, + 162 + ], + [ + 163, + 178 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 190, + 191 + ], + [ + 202, + 205 + ], + [ + 207, + 209 + ], + [ + 210, + 214 + ], + [ + 216, + 217 + ], + [ + 218, + 222 + ], + [ + 223, + 227 + ], + [ + 228, + 229 + ], + [ + 232, + 233 + ], + [ + 237, + 238 + ], + [ + 240, + 245 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 256, + 257 + ], + [ + 261, + 262 + ], + [ + 263, + 267 + ], + [ + 272, + 275 + ], + [ + 276, + 277 + ], + [ + 282, + 283 + ], + [ + 285, + 286 + ], + [ + 289, + 290 + ], + [ + 298, + 300 + ], + [ + 302, + 303 + ], + [ + 306, + 307 + ], + [ + 311, + 312 + ], + [ + 314, + 320 + ], + [ + 321, + 322 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ], + [ + 331, + 334 + ], + [ + 335, + 336 + ] + ] + } + }, + { + "filename": "libvips/foreign/matload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 59, + 118 + ], + [ + 119, + 126 + ], + [ + 128, + 150 + ], + [ + 155, + 181 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 62, + 63 + ], + [ + 68, + 70 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 90, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 103, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 122, + 123 + ], + [ + 131, + 132 + ], + [ + 137, + 143 + ], + [ + 146, + 147 + ], + [ + 158, + 159 + ], + [ + 163, + 164 + ], + [ + 170, + 171 + ], + [ + 175, + 178 + ], + [ + 179, + 180 + ] + ] + } + }, + { + "filename": "libvips/foreign/matrixload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 71, + 175 + ], + [ + 181, + 286 + ], + [ + 294, + 324 + ], + [ + 326, + 333 + ], + [ + 336, + 359 + ], + [ + 366, + 385 + ], + [ + 391, + 420 + ], + [ + 424, + 450 + ], + [ + 456, + 472 + ], + [ + 478, + 496 + ], + [ + 502, + 518 + ], + [ + 520, + 541 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 74, + 76 + ], + [ + 78, + 79 + ], + [ + 82, + 85 + ], + [ + 86, + 87 + ], + [ + 90, + 91 + ], + [ + 94, + 96 + ], + [ + 97, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 115, + 117 + ], + [ + 122, + 130 + ], + [ + 132, + 133 + ], + [ + 134, + 135 + ], + [ + 136, + 139 + ], + [ + 141, + 145 + ], + [ + 151, + 152 + ], + [ + 153, + 158 + ], + [ + 159, + 162 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 184, + 212 + ], + [ + 215, + 216 + ], + [ + 218, + 219 + ], + [ + 222, + 229 + ], + [ + 230, + 231 + ], + [ + 234, + 245 + ], + [ + 247, + 248 + ], + [ + 249, + 253 + ], + [ + 255, + 258 + ], + [ + 260, + 261 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 273, + 274 + ], + [ + 282, + 283 + ], + [ + 297, + 299 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 307, + 308 + ], + [ + 312, + 316 + ], + [ + 317, + 319 + ], + [ + 320, + 321 + ], + [ + 329, + 330 + ], + [ + 339, + 341 + ], + [ + 344, + 346 + ], + [ + 348, + 349 + ], + [ + 352, + 354 + ], + [ + 355, + 356 + ], + [ + 369, + 370 + ], + [ + 372, + 375 + ], + [ + 376, + 378 + ], + [ + 381, + 382 + ], + [ + 394, + 396 + ], + [ + 398, + 399 + ], + [ + 401, + 402 + ], + [ + 404, + 405 + ], + [ + 406, + 407 + ], + [ + 409, + 411 + ], + [ + 412, + 413 + ], + [ + 416, + 417 + ], + [ + 427, + 431 + ], + [ + 433, + 435 + ], + [ + 437, + 438 + ], + [ + 441, + 443 + ], + [ + 444, + 445 + ], + [ + 446, + 447 + ], + [ + 459, + 465 + ], + [ + 468, + 469 + ], + [ + 481, + 482 + ], + [ + 486, + 488 + ], + [ + 492, + 493 + ], + [ + 505, + 506 + ], + [ + 510, + 513 + ], + [ + 514, + 515 + ], + [ + 523, + 524 + ], + [ + 530, + 531 + ], + [ + 535, + 538 + ], + [ + 539, + 540 + ] + ] + } + }, + { + "filename": "libvips/foreign/matrixsave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 61, + 142 + ], + [ + 153, + 160 + ], + [ + 162, + 171 + ], + [ + 172, + 223 + ], + [ + 225, + 241 + ], + [ + 246, + 277 + ], + [ + 279, + 295 + ], + [ + 299, + 340 + ], + [ + 345, + 366 + ], + [ + 370, + 391 + ], + [ + 395, + 409 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 64, + 66 + ], + [ + 68, + 69 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 84, + 87 + ], + [ + 88, + 89 + ], + [ + 90, + 93 + ], + [ + 94, + 97 + ], + [ + 98, + 100 + ], + [ + 102, + 103 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 115, + 117 + ], + [ + 118, + 121 + ], + [ + 122, + 130 + ], + [ + 131, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 156, + 157 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 175, + 176 + ], + [ + 185, + 186 + ], + [ + 192, + 193 + ], + [ + 197, + 199 + ], + [ + 201, + 202 + ], + [ + 206, + 209 + ], + [ + 210, + 213 + ], + [ + 216, + 218 + ], + [ + 219, + 220 + ], + [ + 228, + 234 + ], + [ + 237, + 238 + ], + [ + 249, + 251 + ], + [ + 253, + 254 + ], + [ + 256, + 257 + ], + [ + 259, + 262 + ], + [ + 264, + 267 + ], + [ + 270, + 272 + ], + [ + 273, + 274 + ], + [ + 282, + 288 + ], + [ + 291, + 292 + ], + [ + 302, + 304 + ], + [ + 306, + 307 + ], + [ + 310, + 312 + ], + [ + 313, + 315 + ], + [ + 316, + 317 + ], + [ + 320, + 321 + ], + [ + 325, + 326 + ], + [ + 330, + 331 + ], + [ + 336, + 337 + ], + [ + 348, + 349 + ], + [ + 353, + 356 + ], + [ + 357, + 358 + ], + [ + 362, + 363 + ], + [ + 373, + 374 + ], + [ + 378, + 381 + ], + [ + 382, + 383 + ], + [ + 387, + 388 + ], + [ + 398, + 399 + ], + [ + 403, + 406 + ], + [ + 407, + 408 + ] + ] + } + }, + { + "filename": "libvips/foreign/niftiload.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 42, + 54 + ], + [ + 87, + 94 + ], + [ + 95, + 144 + ], + [ + 145, + 152 + ], + [ + 163, + 190 + ], + [ + 198, + 389 + ], + [ + 393, + 422 + ], + [ + 425, + 473 + ], + [ + 474, + 525 + ], + [ + 529, + 587 + ], + [ + 589, + 596 + ], + [ + 606, + 613 + ], + [ + 615, + 657 + ], + [ + 660, + 697 + ], + [ + 699, + 722 + ], + [ + 730, + 803 + ], + [ + 808, + 815 + ], + [ + 817, + 833 + ], + [ + 835, + 854 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 45, + 46 + ], + [ + 50, + 51 + ], + [ + 90, + 91 + ], + [ + 98, + 100 + ], + [ + 102, + 103 + ], + [ + 106, + 109 + ], + [ + 110, + 111 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 122, + 124 + ], + [ + 127, + 132 + ], + [ + 134, + 135 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 148, + 149 + ], + [ + 166, + 167 + ], + [ + 170, + 173 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 182, + 185 + ], + [ + 186, + 187 + ], + [ + 201, + 318 + ], + [ + 321, + 322 + ], + [ + 326, + 327 + ], + [ + 329, + 333 + ], + [ + 334, + 336 + ], + [ + 338, + 339 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 356, + 357 + ], + [ + 360, + 362 + ], + [ + 366, + 368 + ], + [ + 370, + 371 + ], + [ + 374, + 377 + ], + [ + 378, + 379 + ], + [ + 382, + 384 + ], + [ + 385, + 386 + ], + [ + 396, + 402 + ], + [ + 403, + 408 + ], + [ + 414, + 419 + ], + [ + 428, + 433 + ], + [ + 434, + 437 + ], + [ + 439, + 444 + ], + [ + 446, + 447 + ], + [ + 448, + 449 + ], + [ + 455, + 458 + ], + [ + 459, + 462 + ], + [ + 463, + 465 + ], + [ + 468, + 470 + ], + [ + 477, + 481 + ], + [ + 483, + 486 + ], + [ + 487, + 492 + ], + [ + 495, + 497 + ], + [ + 501, + 505 + ], + [ + 506, + 507 + ], + [ + 509, + 511 + ], + [ + 513, + 514 + ], + [ + 515, + 516 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 532, + 536 + ], + [ + 538, + 541 + ], + [ + 543, + 544 + ], + [ + 545, + 546 + ], + [ + 549, + 550 + ], + [ + 551, + 552 + ], + [ + 555, + 556 + ], + [ + 558, + 559 + ], + [ + 560, + 564 + ], + [ + 566, + 571 + ], + [ + 572, + 574 + ], + [ + 575, + 576 + ], + [ + 579, + 580 + ], + [ + 581, + 582 + ], + [ + 583, + 584 + ], + [ + 592, + 593 + ], + [ + 609, + 610 + ], + [ + 618, + 619 + ], + [ + 624, + 626 + ], + [ + 628, + 629 + ], + [ + 633, + 637 + ], + [ + 638, + 640 + ], + [ + 641, + 642 + ], + [ + 644, + 650 + ], + [ + 653, + 654 + ], + [ + 663, + 665 + ], + [ + 666, + 670 + ], + [ + 671, + 672 + ], + [ + 673, + 674 + ], + [ + 675, + 676 + ], + [ + 680, + 685 + ], + [ + 686, + 687 + ], + [ + 690, + 692 + ], + [ + 693, + 694 + ], + [ + 702, + 703 + ], + [ + 709, + 715 + ], + [ + 718, + 719 + ], + [ + 733, + 735 + ], + [ + 737, + 738 + ], + [ + 740, + 741 + ], + [ + 743, + 744 + ], + [ + 745, + 746 + ], + [ + 748, + 752 + ], + [ + 753, + 754 + ], + [ + 757, + 758 + ], + [ + 759, + 760 + ], + [ + 763, + 766 + ], + [ + 769, + 771 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ], + [ + 781, + 782 + ], + [ + 786, + 787 + ], + [ + 789, + 795 + ], + [ + 798, + 800 + ], + [ + 811, + 812 + ], + [ + 820, + 821 + ], + [ + 825, + 828 + ], + [ + 829, + 830 + ], + [ + 838, + 839 + ], + [ + 843, + 844 + ], + [ + 848, + 851 + ], + [ + 852, + 853 + ] + ] + } + }, + { + "filename": "libvips/foreign/niftisave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 60, + 67 + ], + [ + 68, + 94 + ], + [ + 95, + 155 + ], + [ + 159, + 238 + ], + [ + 240, + 277 + ], + [ + 280, + 396 + ], + [ + 411, + 422 + ], + [ + 424, + 431 + ], + [ + 437, + 453 + ], + [ + 454, + 465 + ], + [ + 467, + 481 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 63, + 64 + ], + [ + 71, + 73 + ], + [ + 75, + 76 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 87, + 89 + ], + [ + 90, + 91 + ], + [ + 98, + 99 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 112, + 117 + ], + [ + 119, + 124 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 131, + 134 + ], + [ + 137, + 139 + ], + [ + 145, + 147 + ], + [ + 151, + 152 + ], + [ + 162, + 164 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 173, + 175 + ], + [ + 176, + 178 + ], + [ + 183, + 184 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 194, + 195 + ], + [ + 198, + 199 + ], + [ + 202, + 204 + ], + [ + 208, + 210 + ], + [ + 216, + 217 + ], + [ + 220, + 225 + ], + [ + 229, + 230 + ], + [ + 233, + 235 + ], + [ + 243, + 245 + ], + [ + 249, + 253 + ], + [ + 255, + 257 + ], + [ + 258, + 262 + ], + [ + 264, + 265 + ], + [ + 270, + 272 + ], + [ + 273, + 274 + ], + [ + 283, + 284 + ], + [ + 289, + 292 + ], + [ + 294, + 295 + ], + [ + 296, + 297 + ], + [ + 300, + 301 + ], + [ + 306, + 311 + ], + [ + 312, + 317 + ], + [ + 319, + 324 + ], + [ + 326, + 328 + ], + [ + 332, + 335 + ], + [ + 338, + 341 + ], + [ + 342, + 343 + ], + [ + 346, + 347 + ], + [ + 348, + 349 + ], + [ + 352, + 354 + ], + [ + 355, + 356 + ], + [ + 361, + 364 + ], + [ + 366, + 368 + ], + [ + 373, + 377 + ], + [ + 379, + 382 + ], + [ + 385, + 386 + ], + [ + 390, + 391 + ], + [ + 392, + 393 + ], + [ + 414, + 415 + ], + [ + 416, + 417 + ], + [ + 418, + 419 + ], + [ + 427, + 428 + ], + [ + 440, + 446 + ], + [ + 449, + 450 + ], + [ + 457, + 459 + ], + [ + 461, + 462 + ], + [ + 470, + 471 + ], + [ + 475, + 478 + ], + [ + 479, + 480 + ] + ] + } + }, + { + "filename": "libvips/foreign/nsgifload.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 38 + ], + [ + 74, + 93 + ], + [ + 116, + 123 + ], + [ + 142, + 250 + ], + [ + 251, + 332 + ], + [ + 337, + 346 + ], + [ + 347, + 468 + ], + [ + 470, + 504 + ], + [ + 508, + 574 + ], + [ + 577, + 640 + ], + [ + 643, + 660 + ], + [ + 667, + 697 + ], + [ + 699, + 723 + ], + [ + 725, + 748 + ], + [ + 756, + 803 + ], + [ + 804, + 825 + ], + [ + 833, + 890 + ], + [ + 920, + 936 + ], + [ + 955, + 962 + ], + [ + 963, + 978 + ], + [ + 993, + 1007 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 29 + ], + [ + 34, + 35 + ], + [ + 77, + 90 + ], + [ + 119, + 120 + ], + [ + 145, + 147 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 157, + 158 + ], + [ + 161, + 162 + ], + [ + 163, + 165 + ], + [ + 166, + 168 + ], + [ + 169, + 170 + ], + [ + 173, + 174 + ], + [ + 175, + 176 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 189, + 190 + ], + [ + 193, + 195 + ], + [ + 196, + 197 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 219 + ], + [ + 222, + 223 + ], + [ + 227, + 239 + ], + [ + 245, + 247 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 262 + ], + [ + 266, + 272 + ], + [ + 273, + 275 + ], + [ + 281, + 282 + ], + [ + 283, + 285 + ], + [ + 291, + 293 + ], + [ + 296, + 297 + ], + [ + 301, + 305 + ], + [ + 307, + 308 + ], + [ + 313, + 315 + ], + [ + 318, + 322 + ], + [ + 325, + 327 + ], + [ + 328, + 329 + ], + [ + 340, + 341 + ], + [ + 342, + 343 + ], + [ + 350, + 351 + ], + [ + 355, + 358 + ], + [ + 360, + 361 + ], + [ + 363, + 366 + ], + [ + 367, + 370 + ], + [ + 372, + 373 + ], + [ + 379, + 382 + ], + [ + 384, + 385 + ], + [ + 391, + 392 + ], + [ + 393, + 394 + ], + [ + 395, + 396 + ], + [ + 397, + 400 + ], + [ + 404, + 405 + ], + [ + 407, + 409 + ], + [ + 410, + 411 + ], + [ + 415, + 416 + ], + [ + 418, + 419 + ], + [ + 420, + 423 + ], + [ + 427, + 432 + ], + [ + 434, + 438 + ], + [ + 444, + 445 + ], + [ + 446, + 447 + ], + [ + 450, + 452 + ], + [ + 453, + 454 + ], + [ + 459, + 462 + ], + [ + 464, + 465 + ], + [ + 473, + 484 + ], + [ + 487, + 488 + ], + [ + 493, + 497 + ], + [ + 500, + 501 + ], + [ + 511, + 512 + ], + [ + 515, + 516 + ], + [ + 522, + 525 + ], + [ + 527, + 533 + ], + [ + 535, + 536 + ], + [ + 539, + 540 + ], + [ + 543, + 544 + ], + [ + 545, + 546 + ], + [ + 550, + 552 + ], + [ + 555, + 565 + ], + [ + 568, + 569 + ], + [ + 570, + 571 + ], + [ + 580, + 581 + ], + [ + 586, + 587 + ], + [ + 592, + 595 + ], + [ + 596, + 598 + ], + [ + 599, + 602 + ], + [ + 603, + 605 + ], + [ + 608, + 609 + ], + [ + 612, + 613 + ], + [ + 615, + 619 + ], + [ + 621, + 622 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 629, + 630 + ], + [ + 632, + 634 + ], + [ + 635, + 637 + ], + [ + 646, + 647 + ], + [ + 651, + 652 + ], + [ + 653, + 654 + ], + [ + 655, + 657 + ], + [ + 670, + 671 + ], + [ + 676, + 678 + ], + [ + 680, + 681 + ], + [ + 685, + 689 + ], + [ + 690, + 692 + ], + [ + 693, + 694 + ], + [ + 702, + 703 + ], + [ + 707, + 711 + ], + [ + 712, + 713 + ], + [ + 716, + 718 + ], + [ + 719, + 720 + ], + [ + 728, + 729 + ], + [ + 735, + 741 + ], + [ + 744, + 745 + ], + [ + 759, + 761 + ], + [ + 763, + 764 + ], + [ + 766, + 767 + ], + [ + 769, + 774 + ], + [ + 775, + 777 + ], + [ + 778, + 779 + ], + [ + 782, + 783 + ], + [ + 787, + 791 + ], + [ + 792, + 793 + ], + [ + 796, + 798 + ], + [ + 799, + 800 + ], + [ + 807, + 808 + ], + [ + 812, + 818 + ], + [ + 821, + 822 + ], + [ + 836, + 838 + ], + [ + 840, + 841 + ], + [ + 843, + 844 + ], + [ + 846, + 847 + ], + [ + 848, + 849 + ], + [ + 851, + 853 + ], + [ + 854, + 855 + ], + [ + 858, + 860 + ], + [ + 861, + 862 + ], + [ + 863, + 864 + ], + [ + 870, + 871 + ], + [ + 877, + 883 + ], + [ + 886, + 887 + ], + [ + 923, + 924 + ], + [ + 928, + 931 + ], + [ + 932, + 933 + ], + [ + 958, + 959 + ], + [ + 966, + 967 + ], + [ + 968, + 971 + ], + [ + 972, + 973 + ], + [ + 974, + 975 + ], + [ + 996, + 997 + ], + [ + 1001, + 1004 + ], + [ + 1005, + 1006 + ] + ] + } + }, + { + "filename": "libvips/foreign/openexr2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 25, + 37 + ], + [ + 43, + 71 + ], + [ + 107, + 276 + ], + [ + 293, + 326 + ], + [ + 328, + 374 + ], + [ + 375, + 401 + ], + [ + 406, + 451 + ] + ], + "lines_added": [ + [ + 28, + 30 + ], + [ + 33, + 34 + ], + [ + 46, + 47 + ], + [ + 48, + 52 + ], + [ + 53, + 62 + ], + [ + 67, + 68 + ], + [ + 110, + 111 + ], + [ + 114, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 131, + 133 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 152, + 155 + ], + [ + 158, + 161 + ], + [ + 164, + 165 + ], + [ + 168, + 170 + ], + [ + 171, + 172 + ], + [ + 176, + 178 + ], + [ + 179, + 180 + ], + [ + 182, + 186 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 205, + 207 + ], + [ + 208, + 209 + ], + [ + 210, + 211 + ], + [ + 216, + 217 + ], + [ + 220, + 221 + ], + [ + 222, + 224 + ], + [ + 226, + 234 + ], + [ + 239, + 240 + ], + [ + 243, + 244 + ], + [ + 247, + 251 + ], + [ + 252, + 253 + ], + [ + 258, + 259 + ], + [ + 263, + 266 + ], + [ + 267, + 268 + ], + [ + 271, + 273 + ], + [ + 296, + 298 + ], + [ + 302, + 308 + ], + [ + 309, + 310 + ], + [ + 313, + 315 + ], + [ + 317, + 319 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 331, + 332 + ], + [ + 335, + 336 + ], + [ + 339, + 341 + ], + [ + 343, + 345 + ], + [ + 348, + 350 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 359, + 360 + ], + [ + 363, + 364 + ], + [ + 367, + 369 + ], + [ + 370, + 371 + ], + [ + 378, + 396 + ], + [ + 397, + 398 + ], + [ + 409, + 412 + ], + [ + 413, + 414 + ], + [ + 415, + 416 + ], + [ + 418, + 421 + ], + [ + 422, + 423 + ], + [ + 424, + 426 + ], + [ + 427, + 428 + ], + [ + 430, + 432 + ], + [ + 436, + 437 + ], + [ + 439, + 442 + ], + [ + 444, + 445 + ], + [ + 447, + 448 + ] + ] + } + }, + { + "filename": "libvips/foreign/openexrload.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 57, + 125 + ], + [ + 126, + 133 + ], + [ + 139, + 161 + ], + [ + 166, + 173 + ], + [ + 180, + 194 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 61 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 82, + 83 + ], + [ + 86, + 88 + ], + [ + 91, + 92 + ], + [ + 95, + 97 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 108, + 110 + ], + [ + 111, + 112 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 129, + 130 + ], + [ + 142, + 143 + ], + [ + 148, + 154 + ], + [ + 157, + 158 + ], + [ + 169, + 170 + ], + [ + 183, + 184 + ], + [ + 188, + 191 + ], + [ + 192, + 193 + ] + ] + } + }, + { + "filename": "libvips/foreign/openslideload.c", + "line_filter": { + "diff_chunks": [ + [ + 44, + 51 + ], + [ + 59, + 81 + ], + [ + 114, + 121 + ], + [ + 130, + 274 + ], + [ + 276, + 286 + ], + [ + 291, + 312 + ], + [ + 323, + 525 + ], + [ + 532, + 578 + ], + [ + 583, + 656 + ], + [ + 658, + 803 + ], + [ + 818, + 825 + ], + [ + 826, + 965 + ], + [ + 967, + 974 + ], + [ + 979, + 1039 + ], + [ + 1041, + 1091 + ], + [ + 1093, + 1116 + ], + [ + 1124, + 1172 + ], + [ + 1173, + 1196 + ] + ], + "lines_added": [ + [ + 47, + 48 + ], + [ + 62, + 63 + ], + [ + 64, + 68 + ], + [ + 69, + 73 + ], + [ + 74, + 78 + ], + [ + 117, + 118 + ], + [ + 133, + 134 + ], + [ + 139, + 140 + ], + [ + 145, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 156, + 157 + ], + [ + 158, + 159 + ], + [ + 165, + 167 + ], + [ + 170, + 172 + ], + [ + 174, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 184, + 185 + ], + [ + 186, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 201 + ], + [ + 202, + 204 + ], + [ + 205, + 206 + ], + [ + 209, + 210 + ], + [ + 212, + 215 + ], + [ + 218, + 222 + ], + [ + 227, + 233 + ], + [ + 235, + 236 + ], + [ + 239, + 242 + ], + [ + 245, + 251 + ], + [ + 253, + 259 + ], + [ + 261, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 271 + ], + [ + 279, + 280 + ], + [ + 282, + 283 + ], + [ + 294, + 295 + ], + [ + 296, + 297 + ], + [ + 300, + 302 + ], + [ + 304, + 305 + ], + [ + 306, + 309 + ], + [ + 326, + 327 + ], + [ + 330, + 331 + ], + [ + 333, + 337 + ], + [ + 341, + 342 + ], + [ + 343, + 405 + ], + [ + 408, + 409 + ], + [ + 410, + 411 + ], + [ + 412, + 415 + ], + [ + 416, + 417 + ], + [ + 418, + 421 + ], + [ + 422, + 425 + ], + [ + 426, + 427 + ], + [ + 429, + 430 + ], + [ + 435, + 436 + ], + [ + 437, + 439 + ], + [ + 440, + 441 + ], + [ + 444, + 445 + ], + [ + 449, + 450 + ], + [ + 454, + 459 + ], + [ + 461, + 466 + ], + [ + 468, + 473 + ], + [ + 475, + 488 + ], + [ + 492, + 494 + ], + [ + 495, + 500 + ], + [ + 504, + 517 + ], + [ + 518, + 522 + ], + [ + 535, + 537 + ], + [ + 540, + 541 + ], + [ + 543, + 544 + ], + [ + 550, + 553 + ], + [ + 556, + 566 + ], + [ + 567, + 572 + ], + [ + 574, + 575 + ], + [ + 586, + 588 + ], + [ + 589, + 591 + ], + [ + 594, + 596 + ], + [ + 597, + 601 + ], + [ + 604, + 608 + ], + [ + 609, + 612 + ], + [ + 613, + 614 + ], + [ + 617, + 620 + ], + [ + 623, + 627 + ], + [ + 628, + 629 + ], + [ + 635, + 636 + ], + [ + 639, + 640 + ], + [ + 641, + 644 + ], + [ + 645, + 646 + ], + [ + 649, + 651 + ], + [ + 652, + 653 + ], + [ + 661, + 663 + ], + [ + 667, + 689 + ], + [ + 690, + 692 + ], + [ + 693, + 694 + ], + [ + 696, + 697 + ], + [ + 702, + 707 + ], + [ + 709, + 714 + ], + [ + 715, + 716 + ], + [ + 719, + 720 + ], + [ + 721, + 722 + ], + [ + 723, + 724 + ], + [ + 725, + 726 + ], + [ + 729, + 730 + ], + [ + 731, + 732 + ], + [ + 737, + 739 + ], + [ + 740, + 743 + ], + [ + 745, + 746 + ], + [ + 747, + 753 + ], + [ + 754, + 755 + ], + [ + 758, + 762 + ], + [ + 763, + 769 + ], + [ + 770, + 771 + ], + [ + 772, + 773 + ], + [ + 776, + 778 + ], + [ + 782, + 784 + ], + [ + 785, + 788 + ], + [ + 789, + 792 + ], + [ + 793, + 798 + ], + [ + 799, + 800 + ], + [ + 821, + 822 + ], + [ + 829, + 831 + ], + [ + 837, + 839 + ], + [ + 841, + 842 + ], + [ + 843, + 844 + ], + [ + 846, + 847 + ], + [ + 848, + 849 + ], + [ + 852, + 853 + ], + [ + 854, + 856 + ], + [ + 861, + 864 + ], + [ + 867, + 872 + ], + [ + 877, + 879 + ], + [ + 880, + 881 + ], + [ + 884, + 885 + ], + [ + 889, + 890 + ], + [ + 893, + 894 + ], + [ + 899, + 900 + ], + [ + 902, + 903 + ], + [ + 906, + 907 + ], + [ + 911, + 915 + ], + [ + 916, + 917 + ], + [ + 920, + 921 + ], + [ + 924, + 929 + ], + [ + 930, + 931 + ], + [ + 932, + 933 + ], + [ + 936, + 937 + ], + [ + 940, + 946 + ], + [ + 948, + 951 + ], + [ + 953, + 954 + ], + [ + 957, + 958 + ], + [ + 959, + 960 + ], + [ + 961, + 962 + ], + [ + 970, + 971 + ], + [ + 982, + 983 + ], + [ + 987, + 988 + ], + [ + 992, + 993 + ], + [ + 998, + 1001 + ], + [ + 1002, + 1004 + ], + [ + 1005, + 1008 + ], + [ + 1009, + 1015 + ], + [ + 1016, + 1018 + ], + [ + 1019, + 1022 + ], + [ + 1023, + 1025 + ], + [ + 1026, + 1032 + ], + [ + 1035, + 1036 + ], + [ + 1044, + 1045 + ], + [ + 1050, + 1052 + ], + [ + 1054, + 1055 + ], + [ + 1056, + 1057 + ], + [ + 1058, + 1059 + ], + [ + 1061, + 1065 + ], + [ + 1066, + 1068 + ], + [ + 1069, + 1070 + ], + [ + 1073, + 1080 + ], + [ + 1084, + 1086 + ], + [ + 1087, + 1088 + ], + [ + 1096, + 1097 + ], + [ + 1103, + 1109 + ], + [ + 1112, + 1113 + ], + [ + 1127, + 1130 + ], + [ + 1132, + 1133 + ], + [ + 1134, + 1135 + ], + [ + 1136, + 1137 + ], + [ + 1139, + 1140 + ], + [ + 1141, + 1142 + ], + [ + 1144, + 1148 + ], + [ + 1149, + 1150 + ], + [ + 1153, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1159, + 1162 + ], + [ + 1165, + 1167 + ], + [ + 1168, + 1169 + ], + [ + 1176, + 1177 + ], + [ + 1179, + 1180 + ], + [ + 1182, + 1188 + ], + [ + 1191, + 1193 + ] + ] + } + }, + { + "filename": "libvips/foreign/pdfiumload.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 52 + ], + [ + 53, + 60 + ], + [ + 67, + 86 + ], + [ + 121, + 128 + ], + [ + 144, + 151 + ], + [ + 162, + 170 + ], + [ + 178, + 219 + ], + [ + 221, + 365 + ], + [ + 370, + 501 + ], + [ + 504, + 547 + ], + [ + 548, + 600 + ], + [ + 601, + 742 + ], + [ + 743, + 768 + ], + [ + 770, + 824 + ], + [ + 826, + 833 + ], + [ + 834, + 850 + ], + [ + 858, + 887 + ], + [ + 888, + 909 + ], + [ + 915, + 980 + ] + ], + "lines_added": [ + [ + 23, + 39 + ], + [ + 44, + 45 + ], + [ + 48, + 49 + ], + [ + 56, + 57 + ], + [ + 70, + 80 + ], + [ + 82, + 83 + ], + [ + 124, + 125 + ], + [ + 147, + 148 + ], + [ + 165, + 167 + ], + [ + 181, + 182 + ], + [ + 185, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 200 + ], + [ + 201, + 202 + ], + [ + 205, + 206 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 232, + 234 + ], + [ + 239, + 242 + ], + [ + 243, + 245 + ], + [ + 246, + 247 + ], + [ + 249, + 252 + ], + [ + 256, + 257 + ], + [ + 260, + 261 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 276, + 285 + ], + [ + 290, + 291 + ], + [ + 292, + 295 + ], + [ + 296, + 301 + ], + [ + 303, + 304 + ], + [ + 306, + 308 + ], + [ + 309, + 310 + ], + [ + 313, + 314 + ], + [ + 318, + 319 + ], + [ + 322, + 323 + ], + [ + 324, + 325 + ], + [ + 328, + 329 + ], + [ + 330, + 332 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 342, + 344 + ], + [ + 345, + 348 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 360, + 362 + ], + [ + 373, + 374 + ], + [ + 376, + 377 + ], + [ + 382, + 383 + ], + [ + 387, + 389 + ], + [ + 392, + 394 + ], + [ + 395, + 396 + ], + [ + 397, + 399 + ], + [ + 404, + 406 + ], + [ + 410, + 415 + ], + [ + 419, + 420 + ], + [ + 425, + 427 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 434, + 435 + ], + [ + 436, + 437 + ], + [ + 443, + 444 + ], + [ + 446, + 449 + ], + [ + 452, + 453 + ], + [ + 455, + 456 + ], + [ + 457, + 460 + ], + [ + 464, + 466 + ], + [ + 472, + 475 + ], + [ + 481, + 485 + ], + [ + 488, + 489 + ], + [ + 491, + 495 + ], + [ + 497, + 498 + ], + [ + 507, + 509 + ], + [ + 514, + 517 + ], + [ + 518, + 519 + ], + [ + 522, + 530 + ], + [ + 533, + 534 + ], + [ + 535, + 536 + ], + [ + 539, + 541 + ], + [ + 543, + 544 + ], + [ + 551, + 553 + ], + [ + 556, + 557 + ], + [ + 559, + 561 + ], + [ + 563, + 565 + ], + [ + 568, + 569 + ], + [ + 570, + 572 + ], + [ + 573, + 574 + ], + [ + 577, + 580 + ], + [ + 583, + 584 + ], + [ + 586, + 588 + ], + [ + 590, + 591 + ], + [ + 592, + 593 + ], + [ + 594, + 595 + ], + [ + 596, + 597 + ], + [ + 604, + 608 + ], + [ + 609, + 610 + ], + [ + 613, + 614 + ], + [ + 616, + 618 + ], + [ + 620, + 621 + ], + [ + 625, + 626 + ], + [ + 629, + 631 + ], + [ + 632, + 636 + ], + [ + 638, + 639 + ], + [ + 640, + 650 + ], + [ + 653, + 654 + ], + [ + 660, + 661 + ], + [ + 664, + 665 + ], + [ + 668, + 669 + ], + [ + 672, + 673 + ], + [ + 679, + 680 + ], + [ + 682, + 683 + ], + [ + 688, + 691 + ], + [ + 692, + 694 + ], + [ + 695, + 698 + ], + [ + 699, + 701 + ], + [ + 702, + 705 + ], + [ + 706, + 708 + ], + [ + 709, + 712 + ], + [ + 713, + 715 + ], + [ + 716, + 719 + ], + [ + 720, + 722 + ], + [ + 723, + 726 + ], + [ + 727, + 729 + ], + [ + 732, + 733 + ], + [ + 738, + 739 + ], + [ + 746, + 747 + ], + [ + 752, + 754 + ], + [ + 756, + 757 + ], + [ + 760, + 761 + ], + [ + 762, + 765 + ], + [ + 773, + 774 + ], + [ + 779, + 780 + ], + [ + 782, + 785 + ], + [ + 786, + 787 + ], + [ + 790, + 791 + ], + [ + 794, + 796 + ], + [ + 798, + 800 + ], + [ + 801, + 802 + ], + [ + 805, + 806 + ], + [ + 809, + 812 + ], + [ + 813, + 814 + ], + [ + 817, + 819 + ], + [ + 820, + 821 + ], + [ + 829, + 830 + ], + [ + 837, + 843 + ], + [ + 846, + 847 + ], + [ + 861, + 863 + ], + [ + 865, + 866 + ], + [ + 870, + 875 + ], + [ + 876, + 877 + ], + [ + 880, + 882 + ], + [ + 883, + 884 + ], + [ + 891, + 892 + ], + [ + 896, + 902 + ], + [ + 905, + 906 + ], + [ + 918, + 920 + ], + [ + 922, + 923 + ], + [ + 927, + 928 + ], + [ + 929, + 930 + ], + [ + 932, + 933 + ], + [ + 936, + 937 + ], + [ + 940, + 942 + ], + [ + 944, + 945 + ], + [ + 948, + 950 + ], + [ + 951, + 952 + ], + [ + 953, + 954 + ], + [ + 960, + 961 + ], + [ + 967, + 973 + ], + [ + 976, + 977 + ] + ] + } + }, + { + "filename": "libvips/foreign/pforeign.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 37, + 56 + ], + [ + 62, + 128 + ], + [ + 130, + 173 + ], + [ + 180, + 216 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 40, + 43 + ], + [ + 49, + 50 + ], + [ + 51, + 53 + ], + [ + 65, + 66 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 78 + ], + [ + 81, + 84 + ], + [ + 87, + 94 + ], + [ + 97, + 101 + ], + [ + 104, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 114 + ], + [ + 115, + 119 + ], + [ + 122, + 125 + ], + [ + 133, + 138 + ], + [ + 139, + 140 + ], + [ + 145, + 147 + ], + [ + 150, + 163 + ], + [ + 165, + 166 + ], + [ + 169, + 170 + ], + [ + 183, + 184 + ], + [ + 185, + 189 + ], + [ + 192, + 194 + ], + [ + 195, + 198 + ], + [ + 202, + 203 + ], + [ + 205, + 206 + ], + [ + 208, + 210 + ], + [ + 212, + 213 + ] + ] + } + }, + { + "filename": "libvips/foreign/pngload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 69, + 151 + ], + [ + 154, + 182 + ], + [ + 190, + 251 + ], + [ + 253, + 302 + ], + [ + 304, + 327 + ], + [ + 335, + 380 + ], + [ + 381, + 402 + ], + [ + 421, + 429 + ], + [ + 430, + 446 + ], + [ + 456, + 471 + ], + [ + 472, + 487 + ], + [ + 494, + 515 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 72, + 74 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 91, + 92 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 108, + 109 + ], + [ + 113, + 117 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 126, + 128 + ], + [ + 129, + 130 + ], + [ + 133, + 134 + ], + [ + 137, + 140 + ], + [ + 141, + 142 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 157, + 158 + ], + [ + 163, + 164 + ], + [ + 169, + 172 + ], + [ + 173, + 175 + ], + [ + 178, + 179 + ], + [ + 193, + 195 + ], + [ + 197, + 198 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 209 + ], + [ + 210, + 211 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 220, + 221 + ], + [ + 222, + 223 + ], + [ + 224, + 225 + ], + [ + 231, + 232 + ], + [ + 238, + 244 + ], + [ + 247, + 248 + ], + [ + 256, + 257 + ], + [ + 262, + 264 + ], + [ + 266, + 267 + ], + [ + 271, + 274 + ], + [ + 275, + 277 + ], + [ + 278, + 279 + ], + [ + 282, + 283 + ], + [ + 287, + 291 + ], + [ + 292, + 293 + ], + [ + 296, + 297 + ], + [ + 298, + 299 + ], + [ + 307, + 308 + ], + [ + 314, + 320 + ], + [ + 323, + 324 + ], + [ + 338, + 340 + ], + [ + 342, + 343 + ], + [ + 347, + 352 + ], + [ + 353, + 355 + ], + [ + 356, + 357 + ], + [ + 360, + 361 + ], + [ + 365, + 369 + ], + [ + 370, + 371 + ], + [ + 374, + 375 + ], + [ + 376, + 377 + ], + [ + 384, + 385 + ], + [ + 389, + 395 + ], + [ + 398, + 399 + ], + [ + 424, + 426 + ], + [ + 433, + 434 + ], + [ + 438, + 441 + ], + [ + 442, + 443 + ], + [ + 459, + 461 + ], + [ + 467, + 468 + ], + [ + 475, + 476 + ], + [ + 477, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 484 + ], + [ + 497, + 498 + ], + [ + 504, + 505 + ], + [ + 509, + 512 + ], + [ + 513, + 514 + ] + ] + } + }, + { + "filename": "libvips/foreign/pngsave.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 83, + 170 + ], + [ + 188, + 197 + ], + [ + 200, + 207 + ], + [ + 208, + 288 + ], + [ + 298, + 397 + ], + [ + 402, + 455 + ], + [ + 456, + 464 + ], + [ + 467, + 474 + ], + [ + 476, + 492 + ], + [ + 497, + 504 + ], + [ + 515, + 536 + ], + [ + 541, + 553 + ], + [ + 557, + 593 + ], + [ + 597, + 604 + ], + [ + 609, + 623 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 86, + 88 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 107, + 109 + ], + [ + 111, + 112 + ], + [ + 115, + 121 + ], + [ + 125, + 127 + ], + [ + 130, + 131 + ], + [ + 133, + 136 + ], + [ + 137, + 138 + ], + [ + 144, + 146 + ], + [ + 150, + 151 + ], + [ + 153, + 159 + ], + [ + 161, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 203, + 204 + ], + [ + 211, + 214 + ], + [ + 215, + 217 + ], + [ + 218, + 221 + ], + [ + 222, + 224 + ], + [ + 225, + 228 + ], + [ + 229, + 231 + ], + [ + 232, + 235 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 240, + 243 + ], + [ + 244, + 246 + ], + [ + 247, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 257 + ], + [ + 258, + 260 + ], + [ + 261, + 264 + ], + [ + 265, + 267 + ], + [ + 268, + 271 + ], + [ + 272, + 274 + ], + [ + 275, + 278 + ], + [ + 279, + 281 + ], + [ + 284, + 285 + ], + [ + 301, + 303 + ], + [ + 305, + 306 + ], + [ + 311, + 312 + ], + [ + 313, + 315 + ], + [ + 316, + 317 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 329, + 330 + ], + [ + 332, + 338 + ], + [ + 341, + 342 + ], + [ + 348, + 349 + ], + [ + 353, + 355 + ], + [ + 357, + 358 + ], + [ + 362, + 364 + ], + [ + 365, + 367 + ], + [ + 368, + 369 + ], + [ + 372, + 373 + ], + [ + 374, + 375 + ], + [ + 381, + 382 + ], + [ + 384, + 390 + ], + [ + 393, + 394 + ], + [ + 405, + 407 + ], + [ + 409, + 410 + ], + [ + 416, + 418 + ], + [ + 419, + 421 + ], + [ + 422, + 425 + ], + [ + 426, + 427 + ], + [ + 430, + 431 + ], + [ + 432, + 433 + ], + [ + 439, + 440 + ], + [ + 442, + 448 + ], + [ + 451, + 452 + ], + [ + 459, + 461 + ], + [ + 470, + 471 + ], + [ + 479, + 480 + ], + [ + 485, + 487 + ], + [ + 488, + 489 + ], + [ + 500, + 501 + ], + [ + 518, + 519 + ], + [ + 523, + 526 + ], + [ + 527, + 528 + ], + [ + 532, + 533 + ], + [ + 544, + 545 + ], + [ + 549, + 550 + ], + [ + 560, + 561 + ], + [ + 566, + 567 + ], + [ + 568, + 571 + ], + [ + 572, + 575 + ], + [ + 578, + 579 + ], + [ + 581, + 582 + ], + [ + 584, + 585 + ], + [ + 589, + 590 + ], + [ + 600, + 601 + ], + [ + 612, + 613 + ], + [ + 617, + 620 + ], + [ + 621, + 622 + ] + ] + } + }, + { + "filename": "libvips/foreign/popplerload.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 18 + ], + [ + 26, + 54 + ], + [ + 76, + 83 + ], + [ + 85, + 104 + ], + [ + 114, + 121 + ], + [ + 144, + 151 + ], + [ + 165, + 257 + ], + [ + 263, + 295 + ], + [ + 296, + 369 + ], + [ + 372, + 420 + ], + [ + 421, + 472 + ], + [ + 473, + 527 + ], + [ + 528, + 598 + ], + [ + 599, + 606 + ], + [ + 607, + 637 + ], + [ + 639, + 708 + ], + [ + 711, + 718 + ], + [ + 719, + 735 + ], + [ + 743, + 772 + ], + [ + 773, + 794 + ], + [ + 800, + 865 + ] + ], + "lines_added": [ + [ + 14, + 15 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 79, + 80 + ], + [ + 88, + 101 + ], + [ + 117, + 118 + ], + [ + 147, + 148 + ], + [ + 168, + 170 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 176, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 191, + 193 + ], + [ + 196, + 202 + ], + [ + 204, + 206 + ], + [ + 207, + 208 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 230 + ], + [ + 231, + 232 + ], + [ + 235, + 236 + ], + [ + 238, + 243 + ], + [ + 247, + 248 + ], + [ + 253, + 254 + ], + [ + 266, + 267 + ], + [ + 269, + 270 + ], + [ + 275, + 276 + ], + [ + 280, + 282 + ], + [ + 283, + 285 + ], + [ + 289, + 292 + ], + [ + 299, + 301 + ], + [ + 302, + 303 + ], + [ + 304, + 308 + ], + [ + 309, + 310 + ], + [ + 313, + 314 + ], + [ + 315, + 317 + ], + [ + 322, + 323 + ], + [ + 325, + 326 + ], + [ + 329, + 330 + ], + [ + 332, + 333 + ], + [ + 334, + 337 + ], + [ + 341, + 343 + ], + [ + 349, + 350 + ], + [ + 353, + 356 + ], + [ + 362, + 364 + ], + [ + 365, + 366 + ], + [ + 375, + 377 + ], + [ + 382, + 385 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 390, + 395 + ], + [ + 398, + 399 + ], + [ + 400, + 401 + ], + [ + 402, + 403 + ], + [ + 406, + 407 + ], + [ + 408, + 409 + ], + [ + 412, + 414 + ], + [ + 415, + 417 + ], + [ + 424, + 426 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 433, + 434 + ], + [ + 436, + 438 + ], + [ + 440, + 442 + ], + [ + 446, + 447 + ], + [ + 448, + 455 + ], + [ + 456, + 460 + ], + [ + 461, + 462 + ], + [ + 464, + 467 + ], + [ + 468, + 469 + ], + [ + 476, + 480 + ], + [ + 481, + 482 + ], + [ + 485, + 486 + ], + [ + 487, + 490 + ], + [ + 492, + 493 + ], + [ + 497, + 498 + ], + [ + 501, + 503 + ], + [ + 504, + 508 + ], + [ + 511, + 514 + ], + [ + 515, + 516 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 523, + 524 + ], + [ + 531, + 532 + ], + [ + 538, + 539 + ], + [ + 544, + 547 + ], + [ + 548, + 550 + ], + [ + 551, + 554 + ], + [ + 555, + 557 + ], + [ + 558, + 561 + ], + [ + 562, + 564 + ], + [ + 565, + 568 + ], + [ + 569, + 571 + ], + [ + 572, + 575 + ], + [ + 576, + 578 + ], + [ + 579, + 582 + ], + [ + 583, + 585 + ], + [ + 588, + 589 + ], + [ + 594, + 595 + ], + [ + 602, + 603 + ], + [ + 610, + 612 + ], + [ + 614, + 615 + ], + [ + 616, + 617 + ], + [ + 619, + 620 + ], + [ + 621, + 622 + ], + [ + 625, + 626 + ], + [ + 629, + 630 + ], + [ + 631, + 634 + ], + [ + 642, + 643 + ], + [ + 644, + 645 + ], + [ + 648, + 649 + ], + [ + 651, + 652 + ], + [ + 657, + 662 + ], + [ + 663, + 664 + ], + [ + 665, + 668 + ], + [ + 670, + 671 + ], + [ + 674, + 675 + ], + [ + 678, + 680 + ], + [ + 682, + 684 + ], + [ + 685, + 686 + ], + [ + 689, + 690 + ], + [ + 693, + 696 + ], + [ + 697, + 698 + ], + [ + 701, + 703 + ], + [ + 704, + 705 + ], + [ + 714, + 715 + ], + [ + 722, + 728 + ], + [ + 731, + 732 + ], + [ + 746, + 748 + ], + [ + 750, + 751 + ], + [ + 752, + 753 + ], + [ + 755, + 760 + ], + [ + 761, + 762 + ], + [ + 765, + 767 + ], + [ + 768, + 769 + ], + [ + 776, + 777 + ], + [ + 781, + 787 + ], + [ + 790, + 791 + ], + [ + 803, + 805 + ], + [ + 807, + 808 + ], + [ + 809, + 810 + ], + [ + 812, + 813 + ], + [ + 814, + 815 + ], + [ + 817, + 818 + ], + [ + 821, + 822 + ], + [ + 825, + 827 + ], + [ + 829, + 830 + ], + [ + 833, + 835 + ], + [ + 836, + 837 + ], + [ + 838, + 839 + ], + [ + 845, + 846 + ], + [ + 852, + 858 + ], + [ + 861, + 862 + ] + ] + } + }, + { + "filename": "libvips/foreign/ppmload.c", + "line_filter": { + "diff_chunks": [ + [ + 36, + 43 + ], + [ + 49, + 77 + ], + [ + 112, + 122 + ], + [ + 123, + 149 + ], + [ + 151, + 237 + ], + [ + 247, + 267 + ], + [ + 273, + 308 + ], + [ + 309, + 325 + ], + [ + 329, + 337 + ], + [ + 344, + 388 + ], + [ + 393, + 471 + ], + [ + 472, + 528 + ], + [ + 529, + 579 + ], + [ + 580, + 625 + ], + [ + 631, + 743 + ], + [ + 745, + 752 + ], + [ + 761, + 771 + ], + [ + 778, + 821 + ], + [ + 822, + 843 + ], + [ + 849, + 881 + ], + [ + 887, + 903 + ], + [ + 908, + 918 + ], + [ + 919, + 935 + ], + [ + 945, + 966 + ] + ], + "lines_added": [ + [ + 39, + 40 + ], + [ + 52, + 53 + ], + [ + 54, + 58 + ], + [ + 59, + 68 + ], + [ + 73, + 74 + ], + [ + 115, + 117 + ], + [ + 118, + 119 + ], + [ + 126, + 128 + ], + [ + 132, + 140 + ], + [ + 144, + 146 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 161, + 164 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 174, + 177 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 184, + 185 + ], + [ + 188, + 191 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 205, + 206 + ], + [ + 208, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 219, + 221 + ], + [ + 222, + 224 + ], + [ + 225, + 226 + ], + [ + 231, + 232 + ], + [ + 233, + 234 + ], + [ + 250, + 252 + ], + [ + 255, + 257 + ], + [ + 258, + 260 + ], + [ + 261, + 264 + ], + [ + 276, + 279 + ], + [ + 282, + 287 + ], + [ + 293, + 295 + ], + [ + 299, + 300 + ], + [ + 302, + 303 + ], + [ + 304, + 305 + ], + [ + 312, + 317 + ], + [ + 321, + 322 + ], + [ + 332, + 334 + ], + [ + 347, + 349 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 363, + 378 + ], + [ + 380, + 381 + ], + [ + 384, + 385 + ], + [ + 396, + 402 + ], + [ + 406, + 407 + ], + [ + 410, + 412 + ], + [ + 415, + 419 + ], + [ + 420, + 422 + ], + [ + 423, + 424 + ], + [ + 426, + 428 + ], + [ + 432, + 433 + ], + [ + 434, + 437 + ], + [ + 438, + 439 + ], + [ + 440, + 441 + ], + [ + 443, + 445 + ], + [ + 449, + 450 + ], + [ + 453, + 456 + ], + [ + 457, + 458 + ], + [ + 459, + 460 + ], + [ + 461, + 462 + ], + [ + 467, + 468 + ], + [ + 475, + 476 + ], + [ + 478, + 484 + ], + [ + 485, + 486 + ], + [ + 487, + 490 + ], + [ + 491, + 492 + ], + [ + 493, + 494 + ], + [ + 497, + 499 + ], + [ + 500, + 501 + ], + [ + 502, + 503 + ], + [ + 504, + 505 + ], + [ + 508, + 510 + ], + [ + 514, + 515 + ], + [ + 517, + 525 + ], + [ + 532, + 533 + ], + [ + 536, + 538 + ], + [ + 539, + 540 + ], + [ + 545, + 547 + ], + [ + 548, + 549 + ], + [ + 551, + 553 + ], + [ + 554, + 555 + ], + [ + 561, + 562 + ], + [ + 565, + 567 + ], + [ + 568, + 569 + ], + [ + 574, + 576 + ], + [ + 583, + 586 + ], + [ + 587, + 588 + ], + [ + 591, + 592 + ], + [ + 595, + 597 + ], + [ + 598, + 599 + ], + [ + 605, + 607 + ], + [ + 608, + 609 + ], + [ + 611, + 615 + ], + [ + 616, + 617 + ], + [ + 620, + 622 + ], + [ + 634, + 635 + ], + [ + 638, + 639 + ], + [ + 640, + 642 + ], + [ + 648, + 649 + ], + [ + 650, + 651 + ], + [ + 655, + 656 + ], + [ + 658, + 659 + ], + [ + 660, + 661 + ], + [ + 662, + 663 + ], + [ + 667, + 668 + ], + [ + 669, + 670 + ], + [ + 676, + 677 + ], + [ + 682, + 687 + ], + [ + 688, + 689 + ], + [ + 692, + 693 + ], + [ + 695, + 697 + ], + [ + 698, + 701 + ], + [ + 704, + 709 + ], + [ + 711, + 713 + ], + [ + 716, + 718 + ], + [ + 722, + 723 + ], + [ + 724, + 727 + ], + [ + 728, + 730 + ], + [ + 731, + 732 + ], + [ + 735, + 736 + ], + [ + 737, + 738 + ], + [ + 739, + 740 + ], + [ + 748, + 749 + ], + [ + 767, + 768 + ], + [ + 781, + 783 + ], + [ + 785, + 786 + ], + [ + 790, + 794 + ], + [ + 795, + 796 + ], + [ + 799, + 800 + ], + [ + 804, + 807 + ], + [ + 808, + 810 + ], + [ + 811, + 812 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 825, + 826 + ], + [ + 830, + 836 + ], + [ + 839, + 840 + ], + [ + 852, + 854 + ], + [ + 856, + 857 + ], + [ + 861, + 862 + ], + [ + 863, + 864 + ], + [ + 866, + 868 + ], + [ + 869, + 870 + ], + [ + 873, + 874 + ], + [ + 875, + 876 + ], + [ + 877, + 878 + ], + [ + 890, + 896 + ], + [ + 899, + 900 + ], + [ + 911, + 912 + ], + [ + 914, + 915 + ], + [ + 922, + 923 + ], + [ + 927, + 930 + ], + [ + 931, + 932 + ], + [ + 948, + 949 + ], + [ + 955, + 956 + ], + [ + 960, + 963 + ], + [ + 964, + 965 + ] + ] + } + }, + { + "filename": "libvips/foreign/ppmsave.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 48 + ], + [ + 68, + 75 + ], + [ + 87, + 129 + ], + [ + 130, + 171 + ], + [ + 172, + 186 + ], + [ + 188, + 225 + ], + [ + 226, + 234 + ], + [ + 241, + 263 + ], + [ + 273, + 427 + ], + [ + 442, + 451 + ], + [ + 453, + 497 + ], + [ + 498, + 538 + ], + [ + 539, + 560 + ], + [ + 565, + 596 + ], + [ + 601, + 636 + ], + [ + 639, + 646 + ], + [ + 649, + 668 + ], + [ + 671, + 678 + ], + [ + 681, + 700 + ], + [ + 703, + 710 + ], + [ + 713, + 732 + ], + [ + 735, + 742 + ], + [ + 746, + 753 + ], + [ + 757, + 772 + ], + [ + 776, + 797 + ], + [ + 807, + 821 + ] + ], + "lines_added": [ + [ + 23, + 39 + ], + [ + 44, + 45 + ], + [ + 71, + 72 + ], + [ + 90, + 92 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 106 + ], + [ + 111, + 113 + ], + [ + 114, + 116 + ], + [ + 119, + 121 + ], + [ + 124, + 126 + ], + [ + 133, + 135 + ], + [ + 136, + 137 + ], + [ + 140, + 142 + ], + [ + 145, + 147 + ], + [ + 148, + 150 + ], + [ + 151, + 152 + ], + [ + 155, + 157 + ], + [ + 158, + 161 + ], + [ + 162, + 163 + ], + [ + 166, + 168 + ], + [ + 175, + 177 + ], + [ + 180, + 183 + ], + [ + 191, + 194 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 206, + 208 + ], + [ + 209, + 211 + ], + [ + 213, + 214 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 229, + 231 + ], + [ + 244, + 245 + ], + [ + 246, + 247 + ], + [ + 252, + 253 + ], + [ + 259, + 260 + ], + [ + 276, + 278 + ], + [ + 280, + 284 + ], + [ + 287, + 288 + ], + [ + 289, + 290 + ], + [ + 292, + 297 + ], + [ + 298, + 302 + ], + [ + 305, + 306 + ], + [ + 307, + 314 + ], + [ + 317, + 319 + ], + [ + 320, + 322 + ], + [ + 323, + 326 + ], + [ + 327, + 329 + ], + [ + 330, + 333 + ], + [ + 334, + 336 + ], + [ + 337, + 339 + ], + [ + 340, + 342 + ], + [ + 346, + 348 + ], + [ + 349, + 352 + ], + [ + 353, + 355 + ], + [ + 356, + 358 + ], + [ + 359, + 361 + ], + [ + 364, + 366 + ], + [ + 369, + 371 + ], + [ + 373, + 374 + ], + [ + 378, + 381 + ], + [ + 383, + 384 + ], + [ + 387, + 391 + ], + [ + 396, + 398 + ], + [ + 399, + 400 + ], + [ + 403, + 404 + ], + [ + 405, + 406 + ], + [ + 408, + 410 + ], + [ + 414, + 415 + ], + [ + 417, + 419 + ], + [ + 420, + 422 + ], + [ + 423, + 424 + ], + [ + 445, + 446 + ], + [ + 447, + 448 + ], + [ + 456, + 457 + ], + [ + 462, + 465 + ], + [ + 466, + 469 + ], + [ + 470, + 473 + ], + [ + 474, + 476 + ], + [ + 477, + 480 + ], + [ + 481, + 483 + ], + [ + 484, + 487 + ], + [ + 488, + 490 + ], + [ + 493, + 494 + ], + [ + 501, + 502 + ], + [ + 506, + 508 + ], + [ + 510, + 511 + ], + [ + 515, + 518 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 523, + 524 + ], + [ + 525, + 526 + ], + [ + 528, + 529 + ], + [ + 532, + 533 + ], + [ + 534, + 535 + ], + [ + 542, + 543 + ], + [ + 547, + 553 + ], + [ + 556, + 557 + ], + [ + 568, + 570 + ], + [ + 572, + 573 + ], + [ + 575, + 576 + ], + [ + 578, + 581 + ], + [ + 583, + 586 + ], + [ + 589, + 591 + ], + [ + 592, + 593 + ], + [ + 604, + 610 + ], + [ + 613, + 614 + ], + [ + 620, + 622 + ], + [ + 624, + 626 + ], + [ + 632, + 633 + ], + [ + 642, + 643 + ], + [ + 652, + 654 + ], + [ + 656, + 658 + ], + [ + 664, + 665 + ], + [ + 674, + 675 + ], + [ + 684, + 686 + ], + [ + 688, + 690 + ], + [ + 696, + 697 + ], + [ + 706, + 707 + ], + [ + 716, + 718 + ], + [ + 720, + 722 + ], + [ + 728, + 729 + ], + [ + 738, + 739 + ], + [ + 749, + 750 + ], + [ + 760, + 762 + ], + [ + 764, + 765 + ], + [ + 768, + 769 + ], + [ + 779, + 780 + ], + [ + 784, + 787 + ], + [ + 788, + 789 + ], + [ + 793, + 794 + ], + [ + 810, + 811 + ], + [ + 815, + 818 + ], + [ + 819, + 820 + ] + ] + } + }, + { + "filename": "libvips/foreign/quantise.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 56, + 99 + ], + [ + 103, + 123 + ], + [ + 124, + 182 + ], + [ + 187, + 200 + ], + [ + 201, + 208 + ], + [ + 209, + 279 + ], + [ + 295, + 324 + ], + [ + 325, + 445 + ], + [ + 448, + 475 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 77, + 79 + ], + [ + 80, + 81 + ], + [ + 84, + 86 + ], + [ + 87, + 88 + ], + [ + 94, + 96 + ], + [ + 106, + 108 + ], + [ + 110, + 111 + ], + [ + 116, + 120 + ], + [ + 127, + 129 + ], + [ + 130, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 143, + 145 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 156, + 158 + ], + [ + 160, + 161 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 204, + 205 + ], + [ + 212, + 214 + ], + [ + 218, + 219 + ], + [ + 222, + 224 + ], + [ + 225, + 226 + ], + [ + 230, + 232 + ], + [ + 236, + 238 + ], + [ + 241, + 243 + ], + [ + 244, + 245 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 298, + 299 + ], + [ + 302, + 305 + ], + [ + 306, + 308 + ], + [ + 309, + 310 + ], + [ + 313, + 314 + ], + [ + 315, + 316 + ], + [ + 320, + 321 + ], + [ + 328, + 330 + ], + [ + 331, + 332 + ], + [ + 335, + 336 + ], + [ + 338, + 339 + ], + [ + 345, + 346 + ], + [ + 348, + 350 + ], + [ + 351, + 352 + ], + [ + 353, + 358 + ], + [ + 362, + 363 + ], + [ + 365, + 369 + ], + [ + 374, + 377 + ], + [ + 382, + 385 + ], + [ + 386, + 388 + ], + [ + 394, + 406 + ], + [ + 408, + 409 + ], + [ + 411, + 412 + ], + [ + 413, + 414 + ], + [ + 415, + 418 + ], + [ + 420, + 426 + ], + [ + 428, + 429 + ], + [ + 431, + 432 + ], + [ + 433, + 434 + ], + [ + 435, + 438 + ], + [ + 440, + 442 + ], + [ + 451, + 452 + ], + [ + 453, + 454 + ], + [ + 455, + 456 + ], + [ + 457, + 458 + ], + [ + 463, + 464 + ], + [ + 466, + 467 + ], + [ + 468, + 470 + ], + [ + 471, + 472 + ] + ] + } + }, + { + "filename": "libvips/foreign/quantise.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 60, + 91 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 63, + 82 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ] + ] + } + }, + { + "filename": "libvips/foreign/radiance.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 16, + 23 + ], + [ + 33, + 61 + ], + [ + 70, + 78 + ], + [ + 176, + 362 + ], + [ + 363, + 474 + ], + [ + 475, + 575 + ], + [ + 577, + 586 + ], + [ + 587, + 735 + ], + [ + 748, + 755 + ], + [ + 756, + 800 + ], + [ + 805, + 849 + ], + [ + 855, + 862 + ], + [ + 863, + 1004 + ], + [ + 1016, + 1046 + ], + [ + 1051, + 1100 + ], + [ + 1105, + 1218 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 19, + 20 + ], + [ + 36, + 37 + ], + [ + 38, + 42 + ], + [ + 43, + 52 + ], + [ + 57, + 58 + ], + [ + 73, + 75 + ], + [ + 179, + 188 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 195, + 196 + ], + [ + 197, + 199 + ], + [ + 200, + 201 + ], + [ + 202, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 217, + 226 + ], + [ + 227, + 235 + ], + [ + 237, + 265 + ], + [ + 270, + 275 + ], + [ + 276, + 284 + ], + [ + 285, + 286 + ], + [ + 289, + 359 + ], + [ + 366, + 370 + ], + [ + 371, + 374 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 379, + 380 + ], + [ + 382, + 384 + ], + [ + 386, + 389 + ], + [ + 390, + 394 + ], + [ + 395, + 398 + ], + [ + 399, + 400 + ], + [ + 401, + 403 + ], + [ + 405, + 408 + ], + [ + 409, + 411 + ], + [ + 412, + 416 + ], + [ + 417, + 420 + ], + [ + 421, + 426 + ], + [ + 427, + 433 + ], + [ + 436, + 437 + ], + [ + 439, + 441 + ], + [ + 443, + 444 + ], + [ + 446, + 449 + ], + [ + 450, + 451 + ], + [ + 452, + 454 + ], + [ + 456, + 459 + ], + [ + 462, + 465 + ], + [ + 466, + 468 + ], + [ + 470, + 471 + ], + [ + 478, + 479 + ], + [ + 480, + 491 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 499, + 500 + ], + [ + 501, + 502 + ], + [ + 503, + 515 + ], + [ + 517, + 518 + ], + [ + 519, + 520 + ], + [ + 523, + 524 + ], + [ + 526, + 527 + ], + [ + 528, + 529 + ], + [ + 531, + 534 + ], + [ + 538, + 541 + ], + [ + 543, + 544 + ], + [ + 549, + 550 + ], + [ + 555, + 563 + ], + [ + 564, + 565 + ], + [ + 566, + 567 + ], + [ + 569, + 572 + ], + [ + 580, + 583 + ], + [ + 590, + 591 + ], + [ + 596, + 597 + ], + [ + 602, + 624 + ], + [ + 626, + 628 + ], + [ + 631, + 633 + ], + [ + 634, + 635 + ], + [ + 636, + 637 + ], + [ + 638, + 641 + ], + [ + 643, + 644 + ], + [ + 646, + 648 + ], + [ + 649, + 650 + ], + [ + 651, + 656 + ], + [ + 659, + 660 + ], + [ + 664, + 665 + ], + [ + 669, + 671 + ], + [ + 674, + 679 + ], + [ + 682, + 686 + ], + [ + 687, + 689 + ], + [ + 694, + 695 + ], + [ + 697, + 704 + ], + [ + 706, + 707 + ], + [ + 711, + 712 + ], + [ + 713, + 716 + ], + [ + 719, + 722 + ], + [ + 727, + 732 + ], + [ + 751, + 752 + ], + [ + 759, + 763 + ], + [ + 764, + 765 + ], + [ + 768, + 769 + ], + [ + 770, + 771 + ], + [ + 774, + 775 + ], + [ + 776, + 778 + ], + [ + 781, + 782 + ], + [ + 786, + 788 + ], + [ + 789, + 791 + ], + [ + 792, + 793 + ], + [ + 794, + 795 + ], + [ + 796, + 797 + ], + [ + 808, + 812 + ], + [ + 813, + 814 + ], + [ + 817, + 818 + ], + [ + 819, + 822 + ], + [ + 823, + 825 + ], + [ + 826, + 827 + ], + [ + 830, + 832 + ], + [ + 834, + 836 + ], + [ + 837, + 839 + ], + [ + 841, + 842 + ], + [ + 845, + 846 + ], + [ + 858, + 859 + ], + [ + 866, + 873 + ], + [ + 875, + 876 + ], + [ + 877, + 878 + ], + [ + 882, + 885 + ], + [ + 886, + 890 + ], + [ + 892, + 893 + ], + [ + 895, + 896 + ], + [ + 897, + 900 + ], + [ + 901, + 903 + ], + [ + 904, + 905 + ], + [ + 906, + 907 + ], + [ + 908, + 911 + ], + [ + 912, + 913 + ], + [ + 914, + 918 + ], + [ + 919, + 920 + ], + [ + 923, + 924 + ], + [ + 927, + 932 + ], + [ + 933, + 934 + ], + [ + 937, + 939 + ], + [ + 940, + 942 + ], + [ + 946, + 948 + ], + [ + 950, + 951 + ], + [ + 952, + 955 + ], + [ + 956, + 961 + ], + [ + 964, + 965 + ], + [ + 966, + 967 + ], + [ + 970, + 971 + ], + [ + 972, + 974 + ], + [ + 978, + 980 + ], + [ + 982, + 984 + ], + [ + 986, + 988 + ], + [ + 989, + 996 + ], + [ + 997, + 999 + ], + [ + 1000, + 1001 + ], + [ + 1019, + 1020 + ], + [ + 1021, + 1023 + ], + [ + 1024, + 1025 + ], + [ + 1028, + 1029 + ], + [ + 1033, + 1035 + ], + [ + 1038, + 1039 + ], + [ + 1040, + 1041 + ], + [ + 1042, + 1043 + ], + [ + 1054, + 1057 + ], + [ + 1059, + 1060 + ], + [ + 1063, + 1064 + ], + [ + 1069, + 1071 + ], + [ + 1072, + 1075 + ], + [ + 1076, + 1079 + ], + [ + 1080, + 1084 + ], + [ + 1085, + 1089 + ], + [ + 1091, + 1094 + ], + [ + 1095, + 1097 + ], + [ + 1108, + 1109 + ], + [ + 1110, + 1134 + ], + [ + 1139, + 1140 + ], + [ + 1141, + 1143 + ], + [ + 1145, + 1148 + ], + [ + 1154, + 1155 + ], + [ + 1156, + 1158 + ], + [ + 1160, + 1161 + ], + [ + 1164, + 1165 + ], + [ + 1169, + 1171 + ], + [ + 1172, + 1174 + ], + [ + 1176, + 1177 + ], + [ + 1180, + 1181 + ], + [ + 1182, + 1184 + ], + [ + 1185, + 1186 + ], + [ + 1189, + 1190 + ], + [ + 1194, + 1195 + ], + [ + 1197, + 1202 + ], + [ + 1203, + 1207 + ], + [ + 1209, + 1211 + ], + [ + 1212, + 1213 + ], + [ + 1214, + 1215 + ] + ] + } + }, + { + "filename": "libvips/foreign/radload.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 63, + 129 + ], + [ + 132, + 147 + ], + [ + 155, + 216 + ], + [ + 218, + 267 + ], + [ + 269, + 292 + ], + [ + 300, + 345 + ], + [ + 346, + 367 + ], + [ + 372, + 407 + ], + [ + 412, + 427 + ], + [ + 428, + 443 + ], + [ + 445, + 466 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 96, + 98 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 107, + 109 + ], + [ + 110, + 111 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 125, + 126 + ], + [ + 135, + 136 + ], + [ + 143, + 144 + ], + [ + 158, + 160 + ], + [ + 162, + 163 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 172, + 174 + ], + [ + 175, + 176 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 196, + 197 + ], + [ + 203, + 209 + ], + [ + 212, + 213 + ], + [ + 221, + 222 + ], + [ + 227, + 229 + ], + [ + 231, + 232 + ], + [ + 236, + 239 + ], + [ + 240, + 242 + ], + [ + 243, + 244 + ], + [ + 247, + 248 + ], + [ + 252, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 272, + 273 + ], + [ + 279, + 285 + ], + [ + 288, + 289 + ], + [ + 303, + 305 + ], + [ + 307, + 308 + ], + [ + 312, + 317 + ], + [ + 318, + 320 + ], + [ + 321, + 322 + ], + [ + 325, + 326 + ], + [ + 330, + 334 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 349, + 350 + ], + [ + 354, + 360 + ], + [ + 363, + 364 + ], + [ + 375, + 376 + ], + [ + 379, + 382 + ], + [ + 384, + 385 + ], + [ + 387, + 388 + ], + [ + 394, + 395 + ], + [ + 399, + 402 + ], + [ + 403, + 404 + ], + [ + 415, + 417 + ], + [ + 423, + 424 + ], + [ + 431, + 432 + ], + [ + 433, + 436 + ], + [ + 437, + 438 + ], + [ + 439, + 440 + ], + [ + 448, + 449 + ], + [ + 455, + 456 + ], + [ + 460, + 463 + ], + [ + 464, + 465 + ] + ] + } + }, + { + "filename": "libvips/foreign/radsave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 60, + 68 + ], + [ + 82, + 96 + ], + [ + 97, + 166 + ], + [ + 171, + 218 + ], + [ + 223, + 283 + ], + [ + 284, + 323 + ], + [ + 327, + 363 + ], + [ + 367, + 381 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 63, + 65 + ], + [ + 85, + 86 + ], + [ + 92, + 93 + ], + [ + 103, + 104 + ], + [ + 110, + 111 + ], + [ + 115, + 117 + ], + [ + 119, + 120 + ], + [ + 126, + 128 + ], + [ + 129, + 134 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 150, + 151 + ], + [ + 153, + 159 + ], + [ + 162, + 163 + ], + [ + 174, + 176 + ], + [ + 178, + 179 + ], + [ + 183, + 185 + ], + [ + 186, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 202, + 203 + ], + [ + 205, + 211 + ], + [ + 214, + 215 + ], + [ + 226, + 228 + ], + [ + 230, + 231 + ], + [ + 237, + 239 + ], + [ + 240, + 242 + ], + [ + 243, + 246 + ], + [ + 248, + 251 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 267, + 268 + ], + [ + 270, + 276 + ], + [ + 279, + 280 + ], + [ + 287, + 288 + ], + [ + 293, + 294 + ], + [ + 300, + 301 + ], + [ + 305, + 308 + ], + [ + 309, + 310 + ], + [ + 314, + 315 + ], + [ + 319, + 320 + ], + [ + 330, + 331 + ], + [ + 336, + 337 + ], + [ + 338, + 341 + ], + [ + 342, + 345 + ], + [ + 348, + 349 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 359, + 360 + ], + [ + 370, + 371 + ], + [ + 375, + 378 + ], + [ + 379, + 380 + ] + ] + } + }, + { + "filename": "libvips/foreign/rawload.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 61, + 124 + ], + [ + 128, + 193 + ], + [ + 207, + 238 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 64, + 66 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 87, + 100 + ], + [ + 101, + 102 + ], + [ + 104, + 105 + ], + [ + 106, + 109 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 138, + 144 + ], + [ + 145, + 148 + ], + [ + 149, + 151 + ], + [ + 152, + 155 + ], + [ + 156, + 158 + ], + [ + 159, + 162 + ], + [ + 163, + 165 + ], + [ + 166, + 169 + ], + [ + 170, + 172 + ], + [ + 173, + 176 + ], + [ + 177, + 179 + ], + [ + 180, + 183 + ], + [ + 184, + 186 + ], + [ + 189, + 190 + ], + [ + 210, + 212 + ], + [ + 218, + 219 + ], + [ + 225, + 227 + ], + [ + 231, + 235 + ], + [ + 236, + 237 + ] + ] + } + }, + { + "filename": "libvips/foreign/rawsave.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 75, + 128 + ], + [ + 130, + 139 + ], + [ + 142, + 192 + ], + [ + 199, + 248 + ], + [ + 250, + 279 + ], + [ + 284, + 298 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 78, + 80 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 97, + 105 + ], + [ + 107, + 108 + ], + [ + 111, + 112 + ], + [ + 116, + 118 + ], + [ + 119, + 123 + ], + [ + 124, + 125 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 145, + 146 + ], + [ + 152, + 158 + ], + [ + 161, + 162 + ], + [ + 167, + 168 + ], + [ + 172, + 173 + ], + [ + 179, + 180 + ], + [ + 184, + 187 + ], + [ + 188, + 189 + ], + [ + 202, + 204 + ], + [ + 206, + 207 + ], + [ + 211, + 219 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 230, + 232 + ], + [ + 233, + 237 + ], + [ + 238, + 239 + ], + [ + 242, + 243 + ], + [ + 244, + 245 + ], + [ + 253, + 254 + ], + [ + 260, + 266 + ], + [ + 269, + 270 + ], + [ + 275, + 276 + ], + [ + 287, + 288 + ], + [ + 292, + 295 + ], + [ + 296, + 297 + ] + ] + } + }, + { + "filename": "libvips/foreign/spngload.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 80, + 208 + ], + [ + 214, + 293 + ], + [ + 310, + 328 + ], + [ + 331, + 344 + ], + [ + 345, + 405 + ], + [ + 406, + 413 + ], + [ + 416, + 648 + ], + [ + 651, + 679 + ], + [ + 687, + 756 + ], + [ + 758, + 809 + ], + [ + 811, + 834 + ], + [ + 842, + 887 + ], + [ + 888, + 909 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 83, + 85 + ], + [ + 87, + 88 + ], + [ + 91, + 93 + ], + [ + 94, + 95 + ], + [ + 97, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 106, + 111 + ], + [ + 116, + 117 + ], + [ + 120, + 121 + ], + [ + 126, + 135 + ], + [ + 136, + 137 + ], + [ + 139, + 140 + ], + [ + 144, + 145 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 156, + 157 + ], + [ + 161, + 165 + ], + [ + 166, + 167 + ], + [ + 173, + 175 + ], + [ + 177, + 179 + ], + [ + 181, + 182 + ], + [ + 188, + 190 + ], + [ + 191, + 192 + ], + [ + 197, + 198 + ], + [ + 199, + 200 + ], + [ + 204, + 205 + ], + [ + 217, + 218 + ], + [ + 220, + 222 + ], + [ + 224, + 225 + ], + [ + 226, + 228 + ], + [ + 229, + 231 + ], + [ + 232, + 234 + ], + [ + 235, + 238 + ], + [ + 239, + 240 + ], + [ + 245, + 249 + ], + [ + 252, + 255 + ], + [ + 257, + 258 + ], + [ + 260, + 262 + ], + [ + 265, + 268 + ], + [ + 271, + 274 + ], + [ + 277, + 279 + ], + [ + 280, + 285 + ], + [ + 289, + 290 + ], + [ + 313, + 316 + ], + [ + 318, + 319 + ], + [ + 322, + 323 + ], + [ + 324, + 325 + ], + [ + 334, + 335 + ], + [ + 336, + 338 + ], + [ + 340, + 341 + ], + [ + 348, + 353 + ], + [ + 355, + 362 + ], + [ + 365, + 366 + ], + [ + 367, + 370 + ], + [ + 371, + 372 + ], + [ + 375, + 376 + ], + [ + 378, + 381 + ], + [ + 383, + 386 + ], + [ + 388, + 391 + ], + [ + 394, + 396 + ], + [ + 400, + 402 + ], + [ + 409, + 410 + ], + [ + 419, + 420 + ], + [ + 424, + 426 + ], + [ + 432, + 437 + ], + [ + 441, + 443 + ], + [ + 445, + 446 + ], + [ + 448, + 450 + ], + [ + 451, + 452 + ], + [ + 454, + 456 + ], + [ + 457, + 458 + ], + [ + 460, + 461 + ], + [ + 462, + 464 + ], + [ + 465, + 466 + ], + [ + 470, + 471 + ], + [ + 472, + 474 + ], + [ + 475, + 476 + ], + [ + 479, + 480 + ], + [ + 481, + 482 + ], + [ + 485, + 487 + ], + [ + 488, + 490 + ], + [ + 491, + 492 + ], + [ + 497, + 500 + ], + [ + 505, + 508 + ], + [ + 512, + 513 + ], + [ + 517, + 521 + ], + [ + 523, + 525 + ], + [ + 527, + 534 + ], + [ + 535, + 536 + ], + [ + 538, + 543 + ], + [ + 545, + 547 + ], + [ + 548, + 549 + ], + [ + 550, + 554 + ], + [ + 560, + 561 + ], + [ + 564, + 565 + ], + [ + 566, + 567 + ], + [ + 568, + 570 + ], + [ + 574, + 576 + ], + [ + 581, + 583 + ], + [ + 586, + 597 + ], + [ + 601, + 602 + ], + [ + 603, + 605 + ], + [ + 609, + 611 + ], + [ + 616, + 621 + ], + [ + 625, + 636 + ], + [ + 638, + 639 + ], + [ + 642, + 643 + ], + [ + 644, + 645 + ], + [ + 654, + 655 + ], + [ + 660, + 661 + ], + [ + 666, + 669 + ], + [ + 670, + 672 + ], + [ + 675, + 676 + ], + [ + 690, + 692 + ], + [ + 694, + 695 + ], + [ + 699, + 700 + ], + [ + 701, + 702 + ], + [ + 704, + 706 + ], + [ + 707, + 708 + ], + [ + 711, + 712 + ], + [ + 717, + 720 + ], + [ + 721, + 722 + ], + [ + 725, + 726 + ], + [ + 727, + 728 + ], + [ + 729, + 730 + ], + [ + 736, + 737 + ], + [ + 743, + 749 + ], + [ + 752, + 753 + ], + [ + 761, + 762 + ], + [ + 767, + 769 + ], + [ + 771, + 772 + ], + [ + 776, + 779 + ], + [ + 780, + 782 + ], + [ + 783, + 784 + ], + [ + 787, + 788 + ], + [ + 792, + 796 + ], + [ + 797, + 798 + ], + [ + 803, + 804 + ], + [ + 805, + 806 + ], + [ + 814, + 815 + ], + [ + 821, + 827 + ], + [ + 830, + 831 + ], + [ + 845, + 847 + ], + [ + 849, + 850 + ], + [ + 854, + 859 + ], + [ + 860, + 862 + ], + [ + 863, + 864 + ], + [ + 867, + 868 + ], + [ + 872, + 876 + ], + [ + 877, + 878 + ], + [ + 881, + 882 + ], + [ + 883, + 884 + ], + [ + 891, + 892 + ], + [ + 896, + 902 + ], + [ + 905, + 906 + ] + ] + } + }, + { + "filename": "libvips/foreign/spngsave.c", + "line_filter": { + "diff_chunks": [ + [ + 18, + 46 + ], + [ + 100, + 180 + ], + [ + 181, + 386 + ], + [ + 388, + 469 + ], + [ + 471, + 493 + ], + [ + 496, + 519 + ], + [ + 520, + 550 + ], + [ + 552, + 655 + ], + [ + 663, + 672 + ], + [ + 675, + 682 + ], + [ + 683, + 763 + ], + [ + 773, + 873 + ], + [ + 878, + 932 + ] + ], + "lines_added": [ + [ + 21, + 37 + ], + [ + 42, + 43 + ], + [ + 103, + 105 + ], + [ + 107, + 108 + ], + [ + 113, + 116 + ], + [ + 117, + 118 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 127, + 128 + ], + [ + 131, + 133 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 140, + 142 + ], + [ + 143, + 146 + ], + [ + 149, + 151 + ], + [ + 154, + 155 + ], + [ + 159, + 161 + ], + [ + 162, + 167 + ], + [ + 169, + 170 + ], + [ + 172, + 173 + ], + [ + 176, + 177 + ], + [ + 184, + 185 + ], + [ + 187, + 190 + ], + [ + 191, + 193 + ], + [ + 195, + 198 + ], + [ + 200, + 202 + ], + [ + 204, + 205 + ], + [ + 206, + 208 + ], + [ + 210, + 211 + ], + [ + 214, + 217 + ], + [ + 219, + 222 + ], + [ + 224, + 226 + ], + [ + 229, + 230 + ], + [ + 232, + 233 + ], + [ + 237, + 240 + ], + [ + 245, + 249 + ], + [ + 251, + 252 + ], + [ + 254, + 258 + ], + [ + 261, + 263 + ], + [ + 267, + 268 + ], + [ + 270, + 272 + ], + [ + 273, + 276 + ], + [ + 281, + 282 + ], + [ + 283, + 285 + ], + [ + 286, + 287 + ], + [ + 292, + 294 + ], + [ + 295, + 296 + ], + [ + 298, + 300 + ], + [ + 301, + 304 + ], + [ + 306, + 309 + ], + [ + 310, + 317 + ], + [ + 318, + 320 + ], + [ + 322, + 325 + ], + [ + 328, + 330 + ], + [ + 331, + 332 + ], + [ + 335, + 337 + ], + [ + 339, + 340 + ], + [ + 346, + 349 + ], + [ + 350, + 351 + ], + [ + 354, + 356 + ], + [ + 357, + 360 + ], + [ + 364, + 365 + ], + [ + 370, + 374 + ], + [ + 376, + 377 + ], + [ + 380, + 381 + ], + [ + 382, + 383 + ], + [ + 391, + 392 + ], + [ + 393, + 397 + ], + [ + 403, + 404 + ], + [ + 409, + 410 + ], + [ + 416, + 418 + ], + [ + 421, + 423 + ], + [ + 428, + 429 + ], + [ + 431, + 434 + ], + [ + 439, + 442 + ], + [ + 444, + 450 + ], + [ + 454, + 457 + ], + [ + 460, + 463 + ], + [ + 465, + 466 + ], + [ + 474, + 481 + ], + [ + 485, + 486 + ], + [ + 487, + 490 + ], + [ + 499, + 501 + ], + [ + 505, + 509 + ], + [ + 511, + 512 + ], + [ + 513, + 516 + ], + [ + 523, + 525 + ], + [ + 526, + 529 + ], + [ + 531, + 532 + ], + [ + 535, + 539 + ], + [ + 541, + 542 + ], + [ + 544, + 547 + ], + [ + 555, + 557 + ], + [ + 559, + 561 + ], + [ + 562, + 565 + ], + [ + 569, + 571 + ], + [ + 572, + 576 + ], + [ + 579, + 582 + ], + [ + 584, + 586 + ], + [ + 587, + 588 + ], + [ + 591, + 592 + ], + [ + 598, + 600 + ], + [ + 602, + 603 + ], + [ + 606, + 612 + ], + [ + 616, + 618 + ], + [ + 621, + 622 + ], + [ + 624, + 627 + ], + [ + 628, + 629 + ], + [ + 635, + 637 + ], + [ + 641, + 642 + ], + [ + 644, + 647 + ], + [ + 649, + 650 + ], + [ + 651, + 652 + ], + [ + 666, + 667 + ], + [ + 668, + 669 + ], + [ + 678, + 679 + ], + [ + 686, + 689 + ], + [ + 690, + 692 + ], + [ + 693, + 696 + ], + [ + 697, + 699 + ], + [ + 700, + 703 + ], + [ + 704, + 706 + ], + [ + 707, + 710 + ], + [ + 711, + 712 + ], + [ + 713, + 714 + ], + [ + 715, + 718 + ], + [ + 719, + 721 + ], + [ + 722, + 725 + ], + [ + 726, + 728 + ], + [ + 729, + 732 + ], + [ + 733, + 735 + ], + [ + 736, + 739 + ], + [ + 740, + 742 + ], + [ + 743, + 746 + ], + [ + 747, + 749 + ], + [ + 750, + 753 + ], + [ + 754, + 756 + ], + [ + 759, + 760 + ], + [ + 776, + 778 + ], + [ + 780, + 781 + ], + [ + 783, + 784 + ], + [ + 787, + 788 + ], + [ + 789, + 791 + ], + [ + 792, + 793 + ], + [ + 796, + 797 + ], + [ + 798, + 799 + ], + [ + 805, + 806 + ], + [ + 808, + 814 + ], + [ + 817, + 818 + ], + [ + 824, + 825 + ], + [ + 829, + 831 + ], + [ + 833, + 834 + ], + [ + 838, + 840 + ], + [ + 841, + 843 + ], + [ + 844, + 845 + ], + [ + 848, + 849 + ], + [ + 850, + 851 + ], + [ + 857, + 858 + ], + [ + 860, + 866 + ], + [ + 869, + 870 + ], + [ + 881, + 883 + ], + [ + 885, + 886 + ], + [ + 888, + 889 + ], + [ + 893, + 895 + ], + [ + 896, + 898 + ], + [ + 899, + 902 + ], + [ + 903, + 904 + ], + [ + 907, + 908 + ], + [ + 909, + 910 + ], + [ + 916, + 917 + ], + [ + 919, + 925 + ], + [ + 928, + 929 + ] + ] + } + }, + { + "filename": "libvips/foreign/svgload.c", + "line_filter": { + "diff_chunks": [ + [ + 21, + 28 + ], + [ + 32, + 60 + ], + [ + 81, + 88 + ], + [ + 125, + 231 + ], + [ + 245, + 254 + ], + [ + 259, + 281 + ], + [ + 295, + 339 + ], + [ + 341, + 386 + ], + [ + 387, + 405 + ], + [ + 407, + 472 + ], + [ + 473, + 515 + ], + [ + 517, + 683 + ], + [ + 685, + 692 + ], + [ + 696, + 731 + ], + [ + 742, + 769 + ], + [ + 770, + 817 + ], + [ + 818, + 834 + ], + [ + 836, + 864 + ], + [ + 867, + 891 + ], + [ + 893, + 903 + ], + [ + 911, + 927 + ], + [ + 935, + 949 + ], + [ + 950, + 974 + ], + [ + 979, + 995 + ], + [ + 1010, + 1017 + ], + [ + 1023, + 1039 + ], + [ + 1049, + 1066 + ], + [ + 1067, + 1082 + ], + [ + 1098, + 1105 + ], + [ + 1106, + 1121 + ], + [ + 1123, + 1144 + ] + ], + "lines_added": [ + [ + 24, + 25 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 84, + 85 + ], + [ + 128, + 130 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 145, + 146 + ], + [ + 150, + 151 + ], + [ + 154, + 156 + ], + [ + 157, + 159 + ], + [ + 162, + 167 + ], + [ + 169, + 172 + ], + [ + 176, + 181 + ], + [ + 182, + 183 + ], + [ + 184, + 186 + ], + [ + 187, + 189 + ], + [ + 191, + 214 + ], + [ + 216, + 218 + ], + [ + 219, + 222 + ], + [ + 227, + 228 + ], + [ + 248, + 251 + ], + [ + 262, + 264 + ], + [ + 267, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 278 + ], + [ + 298, + 299 + ], + [ + 300, + 302 + ], + [ + 303, + 304 + ], + [ + 307, + 308 + ], + [ + 311, + 312 + ], + [ + 313, + 314 + ], + [ + 317, + 318 + ], + [ + 321, + 322 + ], + [ + 325, + 326 + ], + [ + 327, + 328 + ], + [ + 330, + 331 + ], + [ + 335, + 336 + ], + [ + 344, + 383 + ], + [ + 390, + 392 + ], + [ + 393, + 394 + ], + [ + 398, + 399 + ], + [ + 400, + 402 + ], + [ + 410, + 411 + ], + [ + 413, + 414 + ], + [ + 415, + 418 + ], + [ + 420, + 422 + ], + [ + 426, + 428 + ], + [ + 431, + 432 + ], + [ + 434, + 435 + ], + [ + 437, + 438 + ], + [ + 441, + 443 + ], + [ + 445, + 447 + ], + [ + 448, + 450 + ], + [ + 452, + 454 + ], + [ + 456, + 457 + ], + [ + 462, + 465 + ], + [ + 467, + 469 + ], + [ + 476, + 478 + ], + [ + 479, + 483 + ], + [ + 488, + 492 + ], + [ + 497, + 498 + ], + [ + 501, + 503 + ], + [ + 509, + 512 + ], + [ + 520, + 522 + ], + [ + 523, + 524 + ], + [ + 527, + 528 + ], + [ + 533, + 535 + ], + [ + 540, + 541 + ], + [ + 543, + 544 + ], + [ + 547, + 549 + ], + [ + 550, + 551 + ], + [ + 554, + 555 + ], + [ + 558, + 559 + ], + [ + 562, + 564 + ], + [ + 566, + 568 + ], + [ + 574, + 576 + ], + [ + 577, + 578 + ], + [ + 582, + 583 + ], + [ + 584, + 591 + ], + [ + 595, + 596 + ], + [ + 597, + 600 + ], + [ + 601, + 618 + ], + [ + 619, + 621 + ], + [ + 624, + 627 + ], + [ + 628, + 634 + ], + [ + 636, + 637 + ], + [ + 642, + 646 + ], + [ + 647, + 648 + ], + [ + 651, + 652 + ], + [ + 654, + 656 + ], + [ + 659, + 664 + ], + [ + 667, + 670 + ], + [ + 671, + 672 + ], + [ + 675, + 676 + ], + [ + 677, + 678 + ], + [ + 679, + 680 + ], + [ + 688, + 689 + ], + [ + 699, + 700 + ], + [ + 704, + 707 + ], + [ + 708, + 710 + ], + [ + 711, + 714 + ], + [ + 715, + 717 + ], + [ + 718, + 721 + ], + [ + 722, + 724 + ], + [ + 727, + 728 + ], + [ + 745, + 747 + ], + [ + 749, + 750 + ], + [ + 754, + 757 + ], + [ + 758, + 759 + ], + [ + 762, + 763 + ], + [ + 765, + 766 + ], + [ + 773, + 775 + ], + [ + 776, + 782 + ], + [ + 783, + 784 + ], + [ + 785, + 786 + ], + [ + 789, + 790 + ], + [ + 793, + 797 + ], + [ + 798, + 799 + ], + [ + 802, + 803 + ], + [ + 804, + 805 + ], + [ + 806, + 807 + ], + [ + 813, + 814 + ], + [ + 821, + 827 + ], + [ + 830, + 831 + ], + [ + 839, + 840 + ], + [ + 845, + 847 + ], + [ + 849, + 850 + ], + [ + 854, + 857 + ], + [ + 860, + 861 + ], + [ + 870, + 876 + ], + [ + 877, + 878 + ], + [ + 879, + 880 + ], + [ + 881, + 882 + ], + [ + 886, + 888 + ], + [ + 896, + 898 + ], + [ + 899, + 900 + ], + [ + 914, + 920 + ], + [ + 923, + 924 + ], + [ + 938, + 940 + ], + [ + 942, + 943 + ], + [ + 945, + 946 + ], + [ + 953, + 960 + ], + [ + 961, + 962 + ], + [ + 963, + 964 + ], + [ + 967, + 969 + ], + [ + 970, + 971 + ], + [ + 982, + 988 + ], + [ + 991, + 992 + ], + [ + 1013, + 1014 + ], + [ + 1026, + 1027 + ], + [ + 1031, + 1034 + ], + [ + 1035, + 1036 + ], + [ + 1052, + 1053 + ], + [ + 1054, + 1056 + ], + [ + 1062, + 1063 + ], + [ + 1070, + 1071 + ], + [ + 1072, + 1075 + ], + [ + 1076, + 1077 + ], + [ + 1078, + 1079 + ], + [ + 1101, + 1102 + ], + [ + 1109, + 1110 + ], + [ + 1111, + 1114 + ], + [ + 1115, + 1116 + ], + [ + 1117, + 1118 + ], + [ + 1126, + 1127 + ], + [ + 1133, + 1134 + ], + [ + 1138, + 1141 + ], + [ + 1142, + 1143 + ] + ] + } + }, + { + "filename": "libvips/foreign/tiff.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 63, + 156 + ], + [ + 157, + 200 + ], + [ + 202, + 263 + ], + [ + 264, + 295 + ] + ], + "lines_added": [ + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 28 + ], + [ + 33, + 34 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 82, + 84 + ], + [ + 87, + 88 + ], + [ + 89, + 91 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 127, + 128 + ], + [ + 131, + 132 + ], + [ + 133, + 134 + ], + [ + 140, + 141 + ], + [ + 144, + 145 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 160, + 161 + ], + [ + 165, + 166 + ], + [ + 168, + 170 + ], + [ + 172, + 173 + ], + [ + 174, + 176 + ], + [ + 178, + 190 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 205, + 206 + ], + [ + 209, + 210 + ], + [ + 213, + 214 + ], + [ + 217, + 219 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 228, + 229 + ], + [ + 232, + 233 + ], + [ + 236, + 238 + ], + [ + 239, + 240 + ], + [ + 243, + 244 + ], + [ + 247, + 248 + ], + [ + 251, + 252 + ], + [ + 255, + 256 + ], + [ + 259, + 260 + ], + [ + 267, + 268 + ], + [ + 274, + 275 + ], + [ + 277, + 289 + ], + [ + 291, + 292 + ] + ] + } + }, + { + "filename": "libvips/foreign/tiff.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 37, + 47 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 40, + 41 + ], + [ + 42, + 44 + ] + ] + } + }, + { + "filename": "libvips/foreign/tiff2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 106, + 113 + ], + [ + 140, + 147 + ], + [ + 156, + 163 + ], + [ + 168, + 175 + ], + [ + 184, + 191 + ], + [ + 195, + 202 + ], + [ + 215, + 247 + ], + [ + 283, + 290 + ], + [ + 302, + 312 + ], + [ + 318, + 325 + ], + [ + 362, + 370 + ], + [ + 377, + 387 + ], + [ + 405, + 421 + ], + [ + 426, + 488 + ], + [ + 490, + 498 + ], + [ + 499, + 513 + ], + [ + 520, + 602 + ], + [ + 603, + 610 + ], + [ + 614, + 732 + ], + [ + 734, + 754 + ], + [ + 755, + 916 + ], + [ + 923, + 952 + ], + [ + 955, + 969 + ], + [ + 973, + 985 + ], + [ + 987, + 1016 + ], + [ + 1020, + 1063 + ], + [ + 1067, + 1284 + ], + [ + 1286, + 1320 + ], + [ + 1335, + 1343 + ], + [ + 1348, + 1358 + ], + [ + 1363, + 1371 + ], + [ + 1373, + 1389 + ], + [ + 1390, + 1400 + ], + [ + 1402, + 1421 + ], + [ + 1426, + 1436 + ], + [ + 1438, + 1456 + ], + [ + 1458, + 1482 + ], + [ + 1483, + 1504 + ], + [ + 1507, + 1516 + ], + [ + 1519, + 1610 + ], + [ + 1616, + 1776 + ], + [ + 1779, + 1795 + ], + [ + 1797, + 1840 + ], + [ + 1847, + 1988 + ], + [ + 1989, + 2145 + ], + [ + 2147, + 2190 + ], + [ + 2194, + 2205 + ], + [ + 2207, + 2214 + ], + [ + 2220, + 2231 + ], + [ + 2237, + 2244 + ], + [ + 2245, + 2272 + ], + [ + 2277, + 2291 + ], + [ + 2298, + 2497 + ], + [ + 2498, + 2537 + ], + [ + 2539, + 2557 + ], + [ + 2564, + 2571 + ], + [ + 2582, + 2615 + ], + [ + 2618, + 2643 + ], + [ + 2644, + 2696 + ], + [ + 2697, + 2709 + ], + [ + 2712, + 2730 + ], + [ + 2733, + 2773 + ], + [ + 2775, + 2806 + ], + [ + 2807, + 2995 + ], + [ + 3007, + 3017 + ], + [ + 3018, + 3042 + ], + [ + 3046, + 3155 + ], + [ + 3157, + 3262 + ] + ], + "lines_added": [ + [ + 109, + 110 + ], + [ + 143, + 144 + ], + [ + 159, + 160 + ], + [ + 171, + 172 + ], + [ + 187, + 188 + ], + [ + 198, + 199 + ], + [ + 218, + 219 + ], + [ + 220, + 224 + ], + [ + 225, + 234 + ], + [ + 239, + 240 + ], + [ + 243, + 244 + ], + [ + 286, + 287 + ], + [ + 305, + 307 + ], + [ + 308, + 309 + ], + [ + 321, + 322 + ], + [ + 365, + 367 + ], + [ + 380, + 384 + ], + [ + 408, + 409 + ], + [ + 410, + 411 + ], + [ + 416, + 418 + ], + [ + 429, + 430 + ], + [ + 433, + 437 + ], + [ + 439, + 440 + ], + [ + 442, + 443 + ], + [ + 446, + 450 + ], + [ + 454, + 455 + ], + [ + 460, + 461 + ], + [ + 464, + 468 + ], + [ + 472, + 473 + ], + [ + 476, + 477 + ], + [ + 481, + 485 + ], + [ + 493, + 495 + ], + [ + 502, + 504 + ], + [ + 507, + 510 + ], + [ + 523, + 524 + ], + [ + 527, + 528 + ], + [ + 534, + 535 + ], + [ + 537, + 538 + ], + [ + 543, + 544 + ], + [ + 547, + 548 + ], + [ + 554, + 556 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ], + [ + 565, + 566 + ], + [ + 567, + 570 + ], + [ + 573, + 574 + ], + [ + 575, + 576 + ], + [ + 579, + 580 + ], + [ + 584, + 587 + ], + [ + 590, + 592 + ], + [ + 595, + 597 + ], + [ + 598, + 599 + ], + [ + 606, + 607 + ], + [ + 617, + 621 + ], + [ + 622, + 627 + ], + [ + 632, + 637 + ], + [ + 639, + 641 + ], + [ + 642, + 643 + ], + [ + 646, + 647 + ], + [ + 651, + 652 + ], + [ + 654, + 660 + ], + [ + 661, + 665 + ], + [ + 667, + 668 + ], + [ + 673, + 674 + ], + [ + 677, + 680 + ], + [ + 683, + 687 + ], + [ + 690, + 691 + ], + [ + 692, + 693 + ], + [ + 694, + 696 + ], + [ + 698, + 702 + ], + [ + 704, + 705 + ], + [ + 708, + 713 + ], + [ + 715, + 719 + ], + [ + 720, + 722 + ], + [ + 724, + 729 + ], + [ + 737, + 738 + ], + [ + 740, + 741 + ], + [ + 744, + 745 + ], + [ + 748, + 749 + ], + [ + 750, + 751 + ], + [ + 758, + 759 + ], + [ + 761, + 762 + ], + [ + 765, + 766 + ], + [ + 767, + 771 + ], + [ + 773, + 774 + ], + [ + 779, + 780 + ], + [ + 781, + 786 + ], + [ + 788, + 789 + ], + [ + 791, + 792 + ], + [ + 794, + 795 + ], + [ + 796, + 801 + ], + [ + 803, + 804 + ], + [ + 807, + 815 + ], + [ + 817, + 818 + ], + [ + 821, + 822 + ], + [ + 823, + 827 + ], + [ + 829, + 830 + ], + [ + 833, + 844 + ], + [ + 846, + 847 + ], + [ + 850, + 851 + ], + [ + 855, + 856 + ], + [ + 860, + 864 + ], + [ + 867, + 871 + ], + [ + 874, + 880 + ], + [ + 883, + 887 + ], + [ + 890, + 892 + ], + [ + 898, + 899 + ], + [ + 900, + 901 + ], + [ + 906, + 907 + ], + [ + 912, + 913 + ], + [ + 926, + 927 + ], + [ + 928, + 932 + ], + [ + 933, + 937 + ], + [ + 940, + 941 + ], + [ + 947, + 949 + ], + [ + 958, + 959 + ], + [ + 965, + 966 + ], + [ + 976, + 977 + ], + [ + 978, + 982 + ], + [ + 990, + 991 + ], + [ + 996, + 997 + ], + [ + 1003, + 1004 + ], + [ + 1007, + 1008 + ], + [ + 1012, + 1013 + ], + [ + 1023, + 1024 + ], + [ + 1025, + 1029 + ], + [ + 1030, + 1034 + ], + [ + 1037, + 1038 + ], + [ + 1043, + 1044 + ], + [ + 1050, + 1051 + ], + [ + 1054, + 1055 + ], + [ + 1059, + 1060 + ], + [ + 1070, + 1071 + ], + [ + 1072, + 1075 + ], + [ + 1076, + 1080 + ], + [ + 1083, + 1084 + ], + [ + 1089, + 1117 + ], + [ + 1120, + 1126 + ], + [ + 1129, + 1137 + ], + [ + 1138, + 1139 + ], + [ + 1140, + 1146 + ], + [ + 1147, + 1150 + ], + [ + 1151, + 1152 + ], + [ + 1154, + 1155 + ], + [ + 1156, + 1159 + ], + [ + 1160, + 1164 + ], + [ + 1167, + 1168 + ], + [ + 1170, + 1171 + ], + [ + 1173, + 1174 + ], + [ + 1175, + 1178 + ], + [ + 1179, + 1183 + ], + [ + 1186, + 1187 + ], + [ + 1189, + 1190 + ], + [ + 1192, + 1193 + ], + [ + 1194, + 1197 + ], + [ + 1198, + 1202 + ], + [ + 1205, + 1206 + ], + [ + 1208, + 1209 + ], + [ + 1210, + 1230 + ], + [ + 1234, + 1236 + ], + [ + 1238, + 1239 + ], + [ + 1240, + 1241 + ], + [ + 1244, + 1245 + ], + [ + 1246, + 1247 + ], + [ + 1250, + 1251 + ], + [ + 1252, + 1253 + ], + [ + 1256, + 1257 + ], + [ + 1260, + 1261 + ], + [ + 1264, + 1265 + ], + [ + 1268, + 1269 + ], + [ + 1272, + 1273 + ], + [ + 1276, + 1277 + ], + [ + 1280, + 1281 + ], + [ + 1289, + 1290 + ], + [ + 1292, + 1293 + ], + [ + 1294, + 1297 + ], + [ + 1298, + 1303 + ], + [ + 1304, + 1306 + ], + [ + 1307, + 1308 + ], + [ + 1311, + 1313 + ], + [ + 1316, + 1317 + ], + [ + 1338, + 1340 + ], + [ + 1351, + 1352 + ], + [ + 1354, + 1355 + ], + [ + 1366, + 1368 + ], + [ + 1376, + 1378 + ], + [ + 1384, + 1386 + ], + [ + 1393, + 1394 + ], + [ + 1396, + 1397 + ], + [ + 1405, + 1407 + ], + [ + 1408, + 1410 + ], + [ + 1413, + 1414 + ], + [ + 1416, + 1418 + ], + [ + 1429, + 1430 + ], + [ + 1432, + 1433 + ], + [ + 1441, + 1443 + ], + [ + 1444, + 1446 + ], + [ + 1449, + 1450 + ], + [ + 1452, + 1453 + ], + [ + 1461, + 1464 + ], + [ + 1466, + 1471 + ], + [ + 1474, + 1479 + ], + [ + 1486, + 1490 + ], + [ + 1491, + 1493 + ], + [ + 1498, + 1499 + ], + [ + 1500, + 1501 + ], + [ + 1510, + 1513 + ], + [ + 1522, + 1524 + ], + [ + 1525, + 1527 + ], + [ + 1528, + 1532 + ], + [ + 1533, + 1534 + ], + [ + 1536, + 1539 + ], + [ + 1540, + 1541 + ], + [ + 1544, + 1545 + ], + [ + 1546, + 1547 + ], + [ + 1548, + 1549 + ], + [ + 1551, + 1552 + ], + [ + 1553, + 1554 + ], + [ + 1559, + 1560 + ], + [ + 1562, + 1563 + ], + [ + 1564, + 1565 + ], + [ + 1571, + 1572 + ], + [ + 1574, + 1575 + ], + [ + 1578, + 1580 + ], + [ + 1581, + 1586 + ], + [ + 1587, + 1588 + ], + [ + 1589, + 1593 + ], + [ + 1594, + 1595 + ], + [ + 1596, + 1597 + ], + [ + 1598, + 1599 + ], + [ + 1600, + 1604 + ], + [ + 1605, + 1607 + ], + [ + 1619, + 1620 + ], + [ + 1622, + 1623 + ], + [ + 1628, + 1629 + ], + [ + 1631, + 1632 + ], + [ + 1635, + 1639 + ], + [ + 1640, + 1641 + ], + [ + 1642, + 1644 + ], + [ + 1646, + 1648 + ], + [ + 1649, + 1651 + ], + [ + 1652, + 1658 + ], + [ + 1659, + 1660 + ], + [ + 1662, + 1664 + ], + [ + 1665, + 1666 + ], + [ + 1669, + 1670 + ], + [ + 1672, + 1673 + ], + [ + 1677, + 1678 + ], + [ + 1679, + 1681 + ], + [ + 1685, + 1687 + ], + [ + 1688, + 1691 + ], + [ + 1692, + 1695 + ], + [ + 1696, + 1697 + ], + [ + 1701, + 1703 + ], + [ + 1706, + 1710 + ], + [ + 1713, + 1717 + ], + [ + 1720, + 1724 + ], + [ + 1725, + 1726 + ], + [ + 1728, + 1729 + ], + [ + 1733, + 1737 + ], + [ + 1738, + 1741 + ], + [ + 1742, + 1744 + ], + [ + 1748, + 1750 + ], + [ + 1751, + 1757 + ], + [ + 1758, + 1759 + ], + [ + 1764, + 1765 + ], + [ + 1766, + 1768 + ], + [ + 1772, + 1773 + ], + [ + 1782, + 1783 + ], + [ + 1785, + 1786 + ], + [ + 1787, + 1789 + ], + [ + 1790, + 1792 + ], + [ + 1800, + 1801 + ], + [ + 1802, + 1805 + ], + [ + 1807, + 1808 + ], + [ + 1811, + 1813 + ], + [ + 1814, + 1816 + ], + [ + 1818, + 1820 + ], + [ + 1821, + 1824 + ], + [ + 1825, + 1830 + ], + [ + 1831, + 1835 + ], + [ + 1836, + 1837 + ], + [ + 1850, + 1852 + ], + [ + 1853, + 1854 + ], + [ + 1855, + 1867 + ], + [ + 1868, + 1871 + ], + [ + 1874, + 1876 + ], + [ + 1877, + 1881 + ], + [ + 1882, + 1890 + ], + [ + 1893, + 1902 + ], + [ + 1904, + 1906 + ], + [ + 1908, + 1978 + ], + [ + 1981, + 1982 + ], + [ + 1983, + 1985 + ], + [ + 1992, + 1993 + ], + [ + 1994, + 1996 + ], + [ + 1997, + 1998 + ], + [ + 2000, + 2001 + ], + [ + 2006, + 2027 + ], + [ + 2028, + 2029 + ], + [ + 2031, + 2034 + ], + [ + 2035, + 2036 + ], + [ + 2037, + 2038 + ], + [ + 2042, + 2059 + ], + [ + 2061, + 2065 + ], + [ + 2067, + 2071 + ], + [ + 2072, + 2073 + ], + [ + 2079, + 2080 + ], + [ + 2081, + 2082 + ], + [ + 2083, + 2084 + ], + [ + 2086, + 2089 + ], + [ + 2091, + 2094 + ], + [ + 2096, + 2104 + ], + [ + 2105, + 2112 + ], + [ + 2113, + 2114 + ], + [ + 2115, + 2122 + ], + [ + 2123, + 2126 + ], + [ + 2127, + 2130 + ], + [ + 2132, + 2137 + ], + [ + 2138, + 2142 + ], + [ + 2150, + 2152 + ], + [ + 2153, + 2154 + ], + [ + 2160, + 2165 + ], + [ + 2167, + 2168 + ], + [ + 2172, + 2176 + ], + [ + 2177, + 2178 + ], + [ + 2183, + 2185 + ], + [ + 2186, + 2187 + ], + [ + 2197, + 2198 + ], + [ + 2201, + 2202 + ], + [ + 2210, + 2211 + ], + [ + 2223, + 2226 + ], + [ + 2227, + 2228 + ], + [ + 2240, + 2241 + ], + [ + 2248, + 2249 + ], + [ + 2255, + 2256 + ], + [ + 2257, + 2258 + ], + [ + 2260, + 2261 + ], + [ + 2262, + 2266 + ], + [ + 2267, + 2269 + ], + [ + 2280, + 2281 + ], + [ + 2286, + 2288 + ], + [ + 2301, + 2304 + ], + [ + 2306, + 2307 + ], + [ + 2309, + 2310 + ], + [ + 2312, + 2313 + ], + [ + 2319, + 2321 + ], + [ + 2325, + 2326 + ], + [ + 2327, + 2330 + ], + [ + 2332, + 2333 + ], + [ + 2334, + 2335 + ], + [ + 2338, + 2339 + ], + [ + 2340, + 2341 + ], + [ + 2342, + 2344 + ], + [ + 2345, + 2346 + ], + [ + 2351, + 2352 + ], + [ + 2353, + 2354 + ], + [ + 2356, + 2358 + ], + [ + 2359, + 2363 + ], + [ + 2364, + 2365 + ], + [ + 2368, + 2369 + ], + [ + 2371, + 2372 + ], + [ + 2378, + 2379 + ], + [ + 2382, + 2384 + ], + [ + 2388, + 2389 + ], + [ + 2393, + 2397 + ], + [ + 2401, + 2402 + ], + [ + 2403, + 2405 + ], + [ + 2409, + 2412 + ], + [ + 2413, + 2417 + ], + [ + 2421, + 2429 + ], + [ + 2433, + 2436 + ], + [ + 2440, + 2444 + ], + [ + 2447, + 2449 + ], + [ + 2450, + 2451 + ], + [ + 2453, + 2454 + ], + [ + 2459, + 2461 + ], + [ + 2467, + 2469 + ], + [ + 2470, + 2471 + ], + [ + 2474, + 2476 + ], + [ + 2477, + 2478 + ], + [ + 2481, + 2482 + ], + [ + 2485, + 2489 + ], + [ + 2492, + 2494 + ], + [ + 2501, + 2504 + ], + [ + 2506, + 2507 + ], + [ + 2510, + 2512 + ], + [ + 2518, + 2519 + ], + [ + 2523, + 2526 + ], + [ + 2531, + 2534 + ], + [ + 2542, + 2548 + ], + [ + 2550, + 2551 + ], + [ + 2553, + 2554 + ], + [ + 2567, + 2568 + ], + [ + 2585, + 2586 + ], + [ + 2588, + 2590 + ], + [ + 2593, + 2594 + ], + [ + 2595, + 2596 + ], + [ + 2597, + 2598 + ], + [ + 2603, + 2604 + ], + [ + 2605, + 2612 + ], + [ + 2621, + 2627 + ], + [ + 2631, + 2632 + ], + [ + 2633, + 2637 + ], + [ + 2639, + 2640 + ], + [ + 2647, + 2648 + ], + [ + 2649, + 2650 + ], + [ + 2655, + 2656 + ], + [ + 2659, + 2660 + ], + [ + 2661, + 2663 + ], + [ + 2668, + 2669 + ], + [ + 2672, + 2674 + ], + [ + 2678, + 2679 + ], + [ + 2683, + 2686 + ], + [ + 2687, + 2688 + ], + [ + 2689, + 2693 + ], + [ + 2700, + 2701 + ], + [ + 2702, + 2706 + ], + [ + 2715, + 2716 + ], + [ + 2717, + 2719 + ], + [ + 2722, + 2723 + ], + [ + 2725, + 2727 + ], + [ + 2736, + 2739 + ], + [ + 2740, + 2745 + ], + [ + 2746, + 2749 + ], + [ + 2753, + 2757 + ], + [ + 2760, + 2762 + ], + [ + 2763, + 2764 + ], + [ + 2769, + 2770 + ], + [ + 2778, + 2794 + ], + [ + 2797, + 2799 + ], + [ + 2800, + 2803 + ], + [ + 2810, + 2811 + ], + [ + 2816, + 2818 + ], + [ + 2824, + 2842 + ], + [ + 2847, + 2848 + ], + [ + 2852, + 2853 + ], + [ + 2855, + 2859 + ], + [ + 2861, + 2868 + ], + [ + 2870, + 2872 + ], + [ + 2873, + 2876 + ], + [ + 2877, + 2881 + ], + [ + 2885, + 2887 + ], + [ + 2889, + 2891 + ], + [ + 2893, + 2898 + ], + [ + 2901, + 2902 + ], + [ + 2904, + 2918 + ], + [ + 2920, + 2926 + ], + [ + 2928, + 2932 + ], + [ + 2936, + 2937 + ], + [ + 2939, + 2943 + ], + [ + 2945, + 2947 + ], + [ + 2949, + 2953 + ], + [ + 2958, + 2959 + ], + [ + 2961, + 2965 + ], + [ + 2969, + 2972 + ], + [ + 2976, + 2982 + ], + [ + 2984, + 2992 + ], + [ + 3010, + 3011 + ], + [ + 3012, + 3014 + ], + [ + 3021, + 3024 + ], + [ + 3027, + 3029 + ], + [ + 3033, + 3039 + ], + [ + 3049, + 3051 + ], + [ + 3053, + 3056 + ], + [ + 3060, + 3065 + ], + [ + 3071, + 3072 + ], + [ + 3075, + 3076 + ], + [ + 3077, + 3078 + ], + [ + 3081, + 3082 + ], + [ + 3087, + 3089 + ], + [ + 3090, + 3094 + ], + [ + 3096, + 3097 + ], + [ + 3098, + 3100 + ], + [ + 3102, + 3103 + ], + [ + 3106, + 3107 + ], + [ + 3109, + 3112 + ], + [ + 3114, + 3115 + ], + [ + 3116, + 3120 + ], + [ + 3121, + 3122 + ], + [ + 3123, + 3126 + ], + [ + 3127, + 3128 + ], + [ + 3129, + 3130 + ], + [ + 3131, + 3132 + ], + [ + 3134, + 3135 + ], + [ + 3138, + 3141 + ], + [ + 3143, + 3146 + ], + [ + 3147, + 3152 + ], + [ + 3160, + 3161 + ], + [ + 3163, + 3164 + ], + [ + 3166, + 3167 + ], + [ + 3173, + 3174 + ], + [ + 3175, + 3176 + ], + [ + 3178, + 3179 + ], + [ + 3180, + 3181 + ], + [ + 3182, + 3183 + ], + [ + 3186, + 3187 + ], + [ + 3188, + 3189 + ], + [ + 3192, + 3193 + ], + [ + 3194, + 3195 + ], + [ + 3198, + 3200 + ], + [ + 3205, + 3209 + ], + [ + 3210, + 3212 + ], + [ + 3213, + 3217 + ], + [ + 3222, + 3223 + ], + [ + 3224, + 3225 + ], + [ + 3228, + 3230 + ], + [ + 3234, + 3235 + ], + [ + 3239, + 3243 + ], + [ + 3244, + 3247 + ], + [ + 3249, + 3251 + ], + [ + 3256, + 3257 + ], + [ + 3258, + 3259 + ] + ] + } + }, + { + "filename": "libvips/foreign/tiffload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 61, + 72 + ], + [ + 81, + 166 + ], + [ + 176, + 229 + ], + [ + 236, + 299 + ], + [ + 301, + 353 + ], + [ + 355, + 378 + ], + [ + 386, + 433 + ], + [ + 434, + 455 + ], + [ + 464, + 496 + ], + [ + 503, + 510 + ], + [ + 511, + 527 + ], + [ + 534, + 556 + ], + [ + 557, + 572 + ], + [ + 578, + 603 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 64, + 65 + ], + [ + 68, + 69 + ], + [ + 84, + 86 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 103, + 104 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 117, + 121 + ], + [ + 122, + 123 + ], + [ + 126, + 127 + ], + [ + 130, + 131 + ], + [ + 134, + 135 + ], + [ + 138, + 142 + ], + [ + 143, + 144 + ], + [ + 147, + 148 + ], + [ + 151, + 155 + ], + [ + 156, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 179, + 180 + ], + [ + 185, + 186 + ], + [ + 191, + 194 + ], + [ + 195, + 197 + ], + [ + 198, + 201 + ], + [ + 202, + 204 + ], + [ + 205, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 215 + ], + [ + 216, + 218 + ], + [ + 221, + 222 + ], + [ + 223, + 226 + ], + [ + 239, + 241 + ], + [ + 243, + 244 + ], + [ + 246, + 247 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 269 + ], + [ + 270, + 271 + ], + [ + 272, + 273 + ], + [ + 279, + 280 + ], + [ + 286, + 292 + ], + [ + 295, + 296 + ], + [ + 304, + 305 + ], + [ + 310, + 312 + ], + [ + 314, + 315 + ], + [ + 319, + 323 + ], + [ + 324, + 326 + ], + [ + 327, + 328 + ], + [ + 331, + 332 + ], + [ + 336, + 340 + ], + [ + 341, + 342 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 358, + 359 + ], + [ + 365, + 371 + ], + [ + 374, + 375 + ], + [ + 389, + 391 + ], + [ + 393, + 394 + ], + [ + 396, + 397 + ], + [ + 399, + 404 + ], + [ + 405, + 407 + ], + [ + 408, + 409 + ], + [ + 412, + 413 + ], + [ + 417, + 421 + ], + [ + 422, + 423 + ], + [ + 426, + 428 + ], + [ + 429, + 430 + ], + [ + 437, + 438 + ], + [ + 442, + 448 + ], + [ + 451, + 452 + ], + [ + 467, + 468 + ], + [ + 471, + 473 + ], + [ + 476, + 477 + ], + [ + 480, + 482 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 487, + 489 + ], + [ + 492, + 493 + ], + [ + 506, + 507 + ], + [ + 514, + 515 + ], + [ + 519, + 522 + ], + [ + 523, + 524 + ], + [ + 537, + 538 + ], + [ + 542, + 543 + ], + [ + 544, + 546 + ], + [ + 552, + 553 + ], + [ + 560, + 561 + ], + [ + 562, + 565 + ], + [ + 566, + 567 + ], + [ + 568, + 569 + ], + [ + 581, + 582 + ], + [ + 585, + 586 + ], + [ + 592, + 593 + ], + [ + 597, + 600 + ], + [ + 601, + 602 + ] + ] + } + }, + { + "filename": "libvips/foreign/tiffsave.c", + "line_filter": { + "diff_chunks": [ + [ + 34, + 62 + ], + [ + 94, + 101 + ], + [ + 119, + 136 + ], + [ + 142, + 151 + ], + [ + 155, + 185 + ], + [ + 188, + 245 + ], + [ + 248, + 255 + ], + [ + 256, + 428 + ], + [ + 434, + 441 + ], + [ + 446, + 547 + ], + [ + 552, + 607 + ], + [ + 608, + 616 + ], + [ + 640, + 657 + ], + [ + 660, + 674 + ], + [ + 696, + 711 + ], + [ + 715, + 728 + ], + [ + 733, + 754 + ], + [ + 776, + 783 + ], + [ + 787, + 818 + ], + [ + 851, + 865 + ] + ], + "lines_added": [ + [ + 37, + 53 + ], + [ + 58, + 59 + ], + [ + 97, + 98 + ], + [ + 122, + 124 + ], + [ + 126, + 127 + ], + [ + 130, + 131 + ], + [ + 132, + 133 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 158, + 160 + ], + [ + 164, + 168 + ], + [ + 169, + 171 + ], + [ + 173, + 175 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 191, + 197 + ], + [ + 199, + 200 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 211, + 236 + ], + [ + 239, + 240 + ], + [ + 241, + 242 + ], + [ + 251, + 252 + ], + [ + 259, + 262 + ], + [ + 263, + 266 + ], + [ + 267, + 270 + ], + [ + 271, + 273 + ], + [ + 274, + 277 + ], + [ + 278, + 281 + ], + [ + 282, + 285 + ], + [ + 286, + 288 + ], + [ + 289, + 292 + ], + [ + 293, + 295 + ], + [ + 296, + 299 + ], + [ + 300, + 302 + ], + [ + 303, + 306 + ], + [ + 307, + 309 + ], + [ + 310, + 313 + ], + [ + 314, + 316 + ], + [ + 317, + 320 + ], + [ + 321, + 323 + ], + [ + 324, + 327 + ], + [ + 328, + 330 + ], + [ + 331, + 334 + ], + [ + 335, + 337 + ], + [ + 338, + 341 + ], + [ + 342, + 344 + ], + [ + 345, + 348 + ], + [ + 349, + 351 + ], + [ + 352, + 355 + ], + [ + 356, + 358 + ], + [ + 359, + 362 + ], + [ + 363, + 365 + ], + [ + 366, + 369 + ], + [ + 370, + 372 + ], + [ + 373, + 376 + ], + [ + 377, + 379 + ], + [ + 380, + 383 + ], + [ + 384, + 386 + ], + [ + 387, + 390 + ], + [ + 391, + 393 + ], + [ + 394, + 397 + ], + [ + 398, + 400 + ], + [ + 401, + 404 + ], + [ + 405, + 411 + ], + [ + 412, + 414 + ], + [ + 415, + 421 + ], + [ + 424, + 425 + ], + [ + 437, + 438 + ], + [ + 449, + 451 + ], + [ + 453, + 454 + ], + [ + 456, + 457 + ], + [ + 460, + 461 + ], + [ + 462, + 464 + ], + [ + 465, + 466 + ], + [ + 469, + 471 + ], + [ + 472, + 473 + ], + [ + 479, + 480 + ], + [ + 482, + 488 + ], + [ + 491, + 492 + ], + [ + 498, + 499 + ], + [ + 503, + 505 + ], + [ + 507, + 508 + ], + [ + 512, + 514 + ], + [ + 515, + 517 + ], + [ + 518, + 519 + ], + [ + 522, + 523 + ], + [ + 524, + 525 + ], + [ + 531, + 532 + ], + [ + 534, + 540 + ], + [ + 543, + 544 + ], + [ + 555, + 557 + ], + [ + 559, + 560 + ], + [ + 562, + 563 + ], + [ + 567, + 569 + ], + [ + 570, + 572 + ], + [ + 573, + 576 + ], + [ + 577, + 578 + ], + [ + 581, + 583 + ], + [ + 584, + 585 + ], + [ + 591, + 592 + ], + [ + 594, + 600 + ], + [ + 603, + 604 + ], + [ + 611, + 613 + ], + [ + 643, + 644 + ], + [ + 646, + 647 + ], + [ + 648, + 651 + ], + [ + 653, + 654 + ], + [ + 663, + 665 + ], + [ + 667, + 669 + ], + [ + 670, + 671 + ], + [ + 699, + 704 + ], + [ + 707, + 708 + ], + [ + 718, + 719 + ], + [ + 720, + 721 + ], + [ + 724, + 725 + ], + [ + 736, + 737 + ], + [ + 741, + 744 + ], + [ + 745, + 746 + ], + [ + 750, + 751 + ], + [ + 779, + 780 + ], + [ + 790, + 791 + ], + [ + 796, + 797 + ], + [ + 798, + 801 + ], + [ + 802, + 805 + ], + [ + 808, + 809 + ], + [ + 811, + 812 + ], + [ + 814, + 815 + ], + [ + 854, + 855 + ], + [ + 859, + 862 + ], + [ + 863, + 864 + ] + ] + } + }, + { + "filename": "libvips/foreign/vips2jpeg.c", + "line_filter": { + "diff_chunks": [ + [ + 45, + 58 + ], + [ + 70, + 77 + ], + [ + 98, + 132 + ], + [ + 154, + 205 + ], + [ + 206, + 239 + ], + [ + 242, + 347 + ], + [ + 355, + 423 + ], + [ + 425, + 454 + ], + [ + 455, + 464 + ], + [ + 468, + 546 + ], + [ + 550, + 703 + ], + [ + 707, + 765 + ], + [ + 780, + 808 + ], + [ + 812, + 840 + ], + [ + 844, + 890 + ] + ], + "lines_added": [ + [ + 48, + 49 + ], + [ + 54, + 55 + ], + [ + 73, + 74 + ], + [ + 101, + 102 + ], + [ + 107, + 108 + ], + [ + 109, + 113 + ], + [ + 114, + 123 + ], + [ + 128, + 129 + ], + [ + 157, + 161 + ], + [ + 165, + 166 + ], + [ + 169, + 171 + ], + [ + 173, + 174 + ], + [ + 180, + 181 + ], + [ + 185, + 186 + ], + [ + 190, + 192 + ], + [ + 197, + 198 + ], + [ + 201, + 202 + ], + [ + 209, + 210 + ], + [ + 215, + 216 + ], + [ + 217, + 221 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 232 + ], + [ + 235, + 236 + ], + [ + 245, + 248 + ], + [ + 250, + 251 + ], + [ + 254, + 255 + ], + [ + 259, + 263 + ], + [ + 268, + 269 + ], + [ + 273, + 277 + ], + [ + 279, + 281 + ], + [ + 283, + 286 + ], + [ + 288, + 289 + ], + [ + 294, + 295 + ], + [ + 300, + 305 + ], + [ + 306, + 310 + ], + [ + 314, + 315 + ], + [ + 317, + 320 + ], + [ + 325, + 331 + ], + [ + 332, + 333 + ], + [ + 334, + 335 + ], + [ + 338, + 339 + ], + [ + 340, + 342 + ], + [ + 343, + 344 + ], + [ + 358, + 361 + ], + [ + 362, + 412 + ], + [ + 418, + 420 + ], + [ + 428, + 432 + ], + [ + 433, + 434 + ], + [ + 437, + 438 + ], + [ + 439, + 441 + ], + [ + 444, + 446 + ], + [ + 449, + 451 + ], + [ + 458, + 461 + ], + [ + 471, + 472 + ], + [ + 475, + 477 + ], + [ + 478, + 479 + ], + [ + 480, + 481 + ], + [ + 482, + 483 + ], + [ + 485, + 488 + ], + [ + 490, + 491 + ], + [ + 493, + 494 + ], + [ + 497, + 498 + ], + [ + 502, + 506 + ], + [ + 508, + 510 + ], + [ + 512, + 513 + ], + [ + 516, + 517 + ], + [ + 521, + 524 + ], + [ + 527, + 529 + ], + [ + 530, + 531 + ], + [ + 532, + 533 + ], + [ + 538, + 540 + ], + [ + 542, + 543 + ], + [ + 553, + 558 + ], + [ + 559, + 563 + ], + [ + 566, + 568 + ], + [ + 569, + 571 + ], + [ + 574, + 576 + ], + [ + 578, + 579 + ], + [ + 580, + 581 + ], + [ + 582, + 583 + ], + [ + 586, + 587 + ], + [ + 590, + 592 + ], + [ + 596, + 599 + ], + [ + 603, + 604 + ], + [ + 605, + 606 + ], + [ + 611, + 612 + ], + [ + 615, + 616 + ], + [ + 618, + 623 + ], + [ + 625, + 627 + ], + [ + 629, + 630 + ], + [ + 632, + 640 + ], + [ + 642, + 643 + ], + [ + 645, + 654 + ], + [ + 655, + 658 + ], + [ + 662, + 667 + ], + [ + 668, + 670 + ], + [ + 672, + 673 + ], + [ + 675, + 683 + ], + [ + 687, + 688 + ], + [ + 691, + 693 + ], + [ + 694, + 695 + ], + [ + 696, + 697 + ], + [ + 699, + 700 + ], + [ + 710, + 712 + ], + [ + 718, + 719 + ], + [ + 722, + 723 + ], + [ + 726, + 735 + ], + [ + 736, + 739 + ], + [ + 741, + 744 + ], + [ + 749, + 751 + ], + [ + 754, + 756 + ], + [ + 759, + 760 + ], + [ + 761, + 762 + ], + [ + 783, + 784 + ], + [ + 787, + 788 + ], + [ + 791, + 794 + ], + [ + 798, + 799 + ], + [ + 804, + 805 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 819, + 822 + ], + [ + 823, + 825 + ], + [ + 830, + 831 + ], + [ + 834, + 837 + ], + [ + 847, + 849 + ], + [ + 853, + 854 + ], + [ + 857, + 859 + ], + [ + 861, + 863 + ], + [ + 865, + 866 + ], + [ + 867, + 868 + ], + [ + 869, + 870 + ], + [ + 873, + 874 + ], + [ + 877, + 883 + ], + [ + 884, + 885 + ], + [ + 886, + 887 + ] + ] + } + }, + { + "filename": "libvips/foreign/vips2magick.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 9, + 16 + ], + [ + 20, + 48 + ], + [ + 66, + 73 + ], + [ + 93, + 127 + ], + [ + 129, + 141 + ], + [ + 143, + 173 + ], + [ + 175, + 237 + ], + [ + 239, + 290 + ], + [ + 292, + 301 + ], + [ + 316, + 435 + ], + [ + 449, + 458 + ], + [ + 462, + 469 + ], + [ + 479, + 529 + ], + [ + 535, + 591 + ], + [ + 599, + 681 + ], + [ + 684, + 714 + ], + [ + 717, + 747 + ], + [ + 750, + 780 + ], + [ + 783, + 795 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 12, + 13 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 69, + 70 + ], + [ + 96, + 98 + ], + [ + 100, + 101 + ], + [ + 105, + 106 + ], + [ + 108, + 114 + ], + [ + 115, + 116 + ], + [ + 121, + 122 + ], + [ + 123, + 124 + ], + [ + 132, + 133 + ], + [ + 134, + 138 + ], + [ + 146, + 151 + ], + [ + 152, + 153 + ], + [ + 156, + 160 + ], + [ + 165, + 166 + ], + [ + 167, + 170 + ], + [ + 178, + 180 + ], + [ + 185, + 186 + ], + [ + 188, + 190 + ], + [ + 193, + 196 + ], + [ + 202, + 206 + ], + [ + 209, + 211 + ], + [ + 217, + 218 + ], + [ + 219, + 222 + ], + [ + 226, + 227 + ], + [ + 229, + 231 + ], + [ + 233, + 234 + ], + [ + 242, + 257 + ], + [ + 261, + 264 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 282, + 283 + ], + [ + 285, + 287 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 319, + 322 + ], + [ + 324, + 325 + ], + [ + 326, + 327 + ], + [ + 330, + 331 + ], + [ + 334, + 335 + ], + [ + 338, + 340 + ], + [ + 341, + 342 + ], + [ + 345, + 346 + ], + [ + 349, + 352 + ], + [ + 354, + 361 + ], + [ + 362, + 365 + ], + [ + 367, + 368 + ], + [ + 370, + 371 + ], + [ + 375, + 381 + ], + [ + 383, + 386 + ], + [ + 387, + 393 + ], + [ + 394, + 395 + ], + [ + 398, + 404 + ], + [ + 405, + 406 + ], + [ + 408, + 409 + ], + [ + 413, + 421 + ], + [ + 424, + 425 + ], + [ + 431, + 432 + ], + [ + 452, + 453 + ], + [ + 454, + 455 + ], + [ + 465, + 466 + ], + [ + 482, + 485 + ], + [ + 486, + 488 + ], + [ + 489, + 492 + ], + [ + 493, + 495 + ], + [ + 496, + 499 + ], + [ + 500, + 502 + ], + [ + 503, + 506 + ], + [ + 507, + 514 + ], + [ + 515, + 516 + ], + [ + 520, + 521 + ], + [ + 525, + 526 + ], + [ + 538, + 540 + ], + [ + 542, + 543 + ], + [ + 544, + 545 + ], + [ + 548, + 549 + ], + [ + 550, + 552 + ], + [ + 553, + 557 + ], + [ + 558, + 559 + ], + [ + 561, + 562 + ], + [ + 566, + 567 + ], + [ + 568, + 569 + ], + [ + 575, + 576 + ], + [ + 578, + 581 + ], + [ + 582, + 584 + ], + [ + 587, + 588 + ], + [ + 602, + 604 + ], + [ + 606, + 607 + ], + [ + 608, + 609 + ], + [ + 610, + 611 + ], + [ + 617, + 619 + ], + [ + 620, + 624 + ], + [ + 625, + 626 + ], + [ + 628, + 631 + ], + [ + 632, + 633 + ], + [ + 636, + 638 + ], + [ + 639, + 640 + ], + [ + 646, + 647 + ], + [ + 649, + 652 + ], + [ + 653, + 655 + ], + [ + 658, + 659 + ], + [ + 665, + 667 + ], + [ + 669, + 671 + ], + [ + 677, + 678 + ], + [ + 687, + 688 + ], + [ + 691, + 692 + ], + [ + 697, + 700 + ], + [ + 703, + 704 + ], + [ + 710, + 711 + ], + [ + 720, + 722 + ], + [ + 725, + 726 + ], + [ + 731, + 733 + ], + [ + 735, + 737 + ], + [ + 743, + 744 + ], + [ + 753, + 754 + ], + [ + 757, + 758 + ], + [ + 763, + 766 + ], + [ + 769, + 770 + ], + [ + 776, + 777 + ], + [ + 786, + 788 + ], + [ + 791, + 792 + ] + ] + } + }, + { + "filename": "libvips/foreign/vips2tiff.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 14 + ], + [ + 69, + 76 + ], + [ + 80, + 91 + ], + [ + 95, + 102 + ], + [ + 169, + 177 + ], + [ + 208, + 240 + ], + [ + 293, + 311 + ], + [ + 312, + 333 + ], + [ + 336, + 368 + ], + [ + 378, + 385 + ], + [ + 386, + 448 + ], + [ + 458, + 471 + ], + [ + 472, + 482 + ], + [ + 500, + 719 + ], + [ + 724, + 1012 + ], + [ + 1013, + 1083 + ], + [ + 1089, + 1112 + ], + [ + 1114, + 1121 + ], + [ + 1136, + 1166 + ], + [ + 1168, + 1198 + ], + [ + 1201, + 1292 + ], + [ + 1300, + 1307 + ], + [ + 1309, + 1329 + ], + [ + 1332, + 1401 + ], + [ + 1405, + 1426 + ], + [ + 1430, + 1451 + ], + [ + 1455, + 1463 + ], + [ + 1467, + 1497 + ], + [ + 1499, + 1506 + ], + [ + 1512, + 1536 + ], + [ + 1538, + 1545 + ], + [ + 1555, + 1569 + ], + [ + 1571, + 1673 + ], + [ + 1678, + 1694 + ], + [ + 1696, + 1703 + ], + [ + 1707, + 1718 + ], + [ + 1720, + 1738 + ], + [ + 1739, + 1746 + ], + [ + 1748, + 1769 + ], + [ + 1774, + 1830 + ], + [ + 1834, + 1841 + ], + [ + 1844, + 1866 + ], + [ + 1867, + 1950 + ], + [ + 1953, + 2201 + ], + [ + 2213, + 2251 + ], + [ + 2254, + 2289 + ] + ], + "lines_added": [ + [ + 10, + 11 + ], + [ + 72, + 73 + ], + [ + 83, + 84 + ], + [ + 87, + 88 + ], + [ + 98, + 99 + ], + [ + 172, + 174 + ], + [ + 211, + 212 + ], + [ + 213, + 217 + ], + [ + 218, + 227 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 296, + 297 + ], + [ + 302, + 305 + ], + [ + 307, + 308 + ], + [ + 315, + 316 + ], + [ + 319, + 321 + ], + [ + 322, + 324 + ], + [ + 329, + 330 + ], + [ + 339, + 359 + ], + [ + 360, + 365 + ], + [ + 381, + 382 + ], + [ + 389, + 390 + ], + [ + 393, + 395 + ], + [ + 396, + 397 + ], + [ + 398, + 399 + ], + [ + 400, + 401 + ], + [ + 403, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 410 + ], + [ + 415, + 416 + ], + [ + 420, + 423 + ], + [ + 425, + 426 + ], + [ + 428, + 429 + ], + [ + 432, + 434 + ], + [ + 435, + 437 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 444, + 445 + ], + [ + 461, + 462 + ], + [ + 463, + 464 + ], + [ + 465, + 468 + ], + [ + 475, + 476 + ], + [ + 478, + 479 + ], + [ + 503, + 509 + ], + [ + 513, + 514 + ], + [ + 515, + 518 + ], + [ + 519, + 523 + ], + [ + 524, + 525 + ], + [ + 528, + 529 + ], + [ + 533, + 539 + ], + [ + 541, + 542 + ], + [ + 544, + 545 + ], + [ + 548, + 549 + ], + [ + 553, + 558 + ], + [ + 562, + 564 + ], + [ + 570, + 571 + ], + [ + 573, + 574 + ], + [ + 576, + 577 + ], + [ + 580, + 581 + ], + [ + 585, + 591 + ], + [ + 593, + 594 + ], + [ + 596, + 597 + ], + [ + 603, + 604 + ], + [ + 605, + 606 + ], + [ + 608, + 612 + ], + [ + 616, + 623 + ], + [ + 626, + 627 + ], + [ + 629, + 630 + ], + [ + 632, + 633 + ], + [ + 635, + 636 + ], + [ + 640, + 641 + ], + [ + 643, + 645 + ], + [ + 649, + 654 + ], + [ + 655, + 657 + ], + [ + 659, + 662 + ], + [ + 663, + 668 + ], + [ + 671, + 675 + ], + [ + 676, + 678 + ], + [ + 684, + 702 + ], + [ + 705, + 709 + ], + [ + 710, + 716 + ], + [ + 727, + 731 + ], + [ + 732, + 733 + ], + [ + 734, + 735 + ], + [ + 737, + 738 + ], + [ + 740, + 742 + ], + [ + 745, + 746 + ], + [ + 751, + 753 + ], + [ + 754, + 758 + ], + [ + 760, + 762 + ], + [ + 763, + 764 + ], + [ + 766, + 767 + ], + [ + 769, + 770 + ], + [ + 775, + 777 + ], + [ + 781, + 782 + ], + [ + 788, + 791 + ], + [ + 796, + 797 + ], + [ + 801, + 805 + ], + [ + 807, + 808 + ], + [ + 812, + 815 + ], + [ + 817, + 818 + ], + [ + 819, + 820 + ], + [ + 822, + 824 + ], + [ + 826, + 827 + ], + [ + 828, + 830 + ], + [ + 836, + 838 + ], + [ + 840, + 841 + ], + [ + 842, + 843 + ], + [ + 844, + 845 + ], + [ + 846, + 847 + ], + [ + 848, + 849 + ], + [ + 851, + 852 + ], + [ + 855, + 856 + ], + [ + 859, + 860 + ], + [ + 861, + 863 + ], + [ + 868, + 869 + ], + [ + 870, + 872 + ], + [ + 876, + 877 + ], + [ + 880, + 881 + ], + [ + 884, + 885 + ], + [ + 886, + 888 + ], + [ + 889, + 892 + ], + [ + 895, + 897 + ], + [ + 901, + 903 + ], + [ + 904, + 908 + ], + [ + 910, + 912 + ], + [ + 913, + 915 + ], + [ + 917, + 921 + ], + [ + 922, + 926 + ], + [ + 928, + 929 + ], + [ + 934, + 935 + ], + [ + 938, + 942 + ], + [ + 947, + 948 + ], + [ + 949, + 951 + ], + [ + 952, + 953 + ], + [ + 956, + 957 + ], + [ + 962, + 964 + ], + [ + 965, + 969 + ], + [ + 972, + 973 + ], + [ + 974, + 975 + ], + [ + 976, + 977 + ], + [ + 978, + 979 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 984, + 985 + ], + [ + 986, + 987 + ], + [ + 989, + 990 + ], + [ + 991, + 992 + ], + [ + 994, + 996 + ], + [ + 997, + 998 + ], + [ + 1002, + 1003 + ], + [ + 1004, + 1005 + ], + [ + 1006, + 1007 + ], + [ + 1008, + 1009 + ], + [ + 1016, + 1017 + ], + [ + 1022, + 1023 + ], + [ + 1028, + 1029 + ], + [ + 1030, + 1033 + ], + [ + 1037, + 1039 + ], + [ + 1041, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1050, + 1053 + ], + [ + 1054, + 1055 + ], + [ + 1060, + 1061 + ], + [ + 1063, + 1067 + ], + [ + 1068, + 1069 + ], + [ + 1074, + 1075 + ], + [ + 1078, + 1080 + ], + [ + 1092, + 1093 + ], + [ + 1094, + 1095 + ], + [ + 1097, + 1098 + ], + [ + 1101, + 1103 + ], + [ + 1108, + 1109 + ], + [ + 1117, + 1118 + ], + [ + 1139, + 1142 + ], + [ + 1146, + 1147 + ], + [ + 1151, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1157, + 1163 + ], + [ + 1171, + 1172 + ], + [ + 1176, + 1177 + ], + [ + 1181, + 1183 + ], + [ + 1185, + 1186 + ], + [ + 1187, + 1195 + ], + [ + 1204, + 1206 + ], + [ + 1211, + 1218 + ], + [ + 1223, + 1229 + ], + [ + 1235, + 1236 + ], + [ + 1237, + 1242 + ], + [ + 1245, + 1249 + ], + [ + 1251, + 1252 + ], + [ + 1254, + 1261 + ], + [ + 1266, + 1267 + ], + [ + 1268, + 1274 + ], + [ + 1275, + 1276 + ], + [ + 1278, + 1279 + ], + [ + 1284, + 1285 + ], + [ + 1288, + 1289 + ], + [ + 1303, + 1304 + ], + [ + 1312, + 1313 + ], + [ + 1315, + 1316 + ], + [ + 1319, + 1320 + ], + [ + 1321, + 1322 + ], + [ + 1325, + 1326 + ], + [ + 1335, + 1336 + ], + [ + 1337, + 1357 + ], + [ + 1363, + 1364 + ], + [ + 1368, + 1369 + ], + [ + 1370, + 1371 + ], + [ + 1373, + 1374 + ], + [ + 1377, + 1378 + ], + [ + 1381, + 1382 + ], + [ + 1385, + 1386 + ], + [ + 1389, + 1390 + ], + [ + 1393, + 1394 + ], + [ + 1397, + 1398 + ], + [ + 1408, + 1409 + ], + [ + 1415, + 1416 + ], + [ + 1418, + 1421 + ], + [ + 1422, + 1423 + ], + [ + 1433, + 1434 + ], + [ + 1440, + 1441 + ], + [ + 1443, + 1446 + ], + [ + 1447, + 1448 + ], + [ + 1458, + 1460 + ], + [ + 1470, + 1490 + ], + [ + 1491, + 1494 + ], + [ + 1502, + 1503 + ], + [ + 1515, + 1516 + ], + [ + 1522, + 1523 + ], + [ + 1525, + 1526 + ], + [ + 1527, + 1528 + ], + [ + 1530, + 1533 + ], + [ + 1541, + 1542 + ], + [ + 1558, + 1559 + ], + [ + 1562, + 1563 + ], + [ + 1564, + 1566 + ], + [ + 1574, + 1577 + ], + [ + 1579, + 1580 + ], + [ + 1581, + 1582 + ], + [ + 1583, + 1585 + ], + [ + 1586, + 1592 + ], + [ + 1597, + 1605 + ], + [ + 1609, + 1610 + ], + [ + 1615, + 1616 + ], + [ + 1619, + 1620 + ], + [ + 1624, + 1626 + ], + [ + 1628, + 1630 + ], + [ + 1633, + 1635 + ], + [ + 1637, + 1640 + ], + [ + 1642, + 1644 + ], + [ + 1646, + 1648 + ], + [ + 1650, + 1653 + ], + [ + 1656, + 1658 + ], + [ + 1660, + 1661 + ], + [ + 1663, + 1664 + ], + [ + 1669, + 1670 + ], + [ + 1681, + 1682 + ], + [ + 1688, + 1689 + ], + [ + 1690, + 1691 + ], + [ + 1699, + 1700 + ], + [ + 1710, + 1711 + ], + [ + 1713, + 1715 + ], + [ + 1723, + 1727 + ], + [ + 1730, + 1731 + ], + [ + 1733, + 1735 + ], + [ + 1742, + 1743 + ], + [ + 1751, + 1753 + ], + [ + 1754, + 1757 + ], + [ + 1758, + 1761 + ], + [ + 1762, + 1763 + ], + [ + 1764, + 1766 + ], + [ + 1777, + 1778 + ], + [ + 1779, + 1780 + ], + [ + 1782, + 1783 + ], + [ + 1785, + 1791 + ], + [ + 1793, + 1796 + ], + [ + 1799, + 1802 + ], + [ + 1804, + 1805 + ], + [ + 1807, + 1808 + ], + [ + 1811, + 1812 + ], + [ + 1813, + 1814 + ], + [ + 1817, + 1820 + ], + [ + 1824, + 1825 + ], + [ + 1826, + 1827 + ], + [ + 1837, + 1838 + ], + [ + 1847, + 1848 + ], + [ + 1851, + 1852 + ], + [ + 1856, + 1857 + ], + [ + 1861, + 1863 + ], + [ + 1870, + 1874 + ], + [ + 1877, + 1878 + ], + [ + 1882, + 1885 + ], + [ + 1887, + 1888 + ], + [ + 1889, + 1890 + ], + [ + 1895, + 1899 + ], + [ + 1901, + 1902 + ], + [ + 1906, + 1907 + ], + [ + 1908, + 1909 + ], + [ + 1911, + 1914 + ], + [ + 1916, + 1917 + ], + [ + 1919, + 1925 + ], + [ + 1928, + 1933 + ], + [ + 1937, + 1938 + ], + [ + 1939, + 1940 + ], + [ + 1942, + 1943 + ], + [ + 1946, + 1947 + ], + [ + 1956, + 1978 + ], + [ + 1982, + 1984 + ], + [ + 1987, + 1990 + ], + [ + 1991, + 1996 + ], + [ + 2001, + 2003 + ], + [ + 2009, + 2012 + ], + [ + 2013, + 2018 + ], + [ + 2021, + 2025 + ], + [ + 2028, + 2040 + ], + [ + 2045, + 2046 + ], + [ + 2050, + 2051 + ], + [ + 2053, + 2057 + ], + [ + 2061, + 2062 + ], + [ + 2064, + 2067 + ], + [ + 2068, + 2071 + ], + [ + 2073, + 2074 + ], + [ + 2075, + 2078 + ], + [ + 2080, + 2081 + ], + [ + 2082, + 2084 + ], + [ + 2086, + 2087 + ], + [ + 2090, + 2091 + ], + [ + 2093, + 2094 + ], + [ + 2096, + 2097 + ], + [ + 2099, + 2101 + ], + [ + 2104, + 2106 + ], + [ + 2110, + 2111 + ], + [ + 2115, + 2116 + ], + [ + 2118, + 2119 + ], + [ + 2121, + 2135 + ], + [ + 2138, + 2139 + ], + [ + 2142, + 2143 + ], + [ + 2145, + 2146 + ], + [ + 2148, + 2150 + ], + [ + 2153, + 2154 + ], + [ + 2156, + 2158 + ], + [ + 2160, + 2161 + ], + [ + 2164, + 2166 + ], + [ + 2169, + 2171 + ], + [ + 2172, + 2173 + ], + [ + 2179, + 2180 + ], + [ + 2186, + 2187 + ], + [ + 2188, + 2189 + ], + [ + 2193, + 2195 + ], + [ + 2197, + 2198 + ], + [ + 2216, + 2217 + ], + [ + 2220, + 2223 + ], + [ + 2226, + 2228 + ], + [ + 2231, + 2234 + ], + [ + 2240, + 2241 + ], + [ + 2242, + 2243 + ], + [ + 2245, + 2248 + ], + [ + 2257, + 2258 + ], + [ + 2259, + 2260 + ], + [ + 2264, + 2265 + ], + [ + 2270, + 2281 + ], + [ + 2283, + 2284 + ], + [ + 2285, + 2286 + ] + ] + } + }, + { + "filename": "libvips/foreign/vipsload.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 56, + 158 + ], + [ + 162, + 176 + ], + [ + 182, + 219 + ], + [ + 221, + 244 + ], + [ + 250, + 319 + ], + [ + 322, + 345 + ], + [ + 347, + 366 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 59, + 61 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 73, + 74 + ], + [ + 80, + 82 + ], + [ + 84, + 85 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 96, + 97 + ], + [ + 101, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 120, + 125 + ], + [ + 127, + 129 + ], + [ + 131, + 132 + ], + [ + 133, + 136 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 154, + 155 + ], + [ + 165, + 166 + ], + [ + 172, + 173 + ], + [ + 185, + 187 + ], + [ + 189, + 190 + ], + [ + 194, + 197 + ], + [ + 198, + 200 + ], + [ + 201, + 202 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 224, + 225 + ], + [ + 231, + 237 + ], + [ + 240, + 241 + ], + [ + 253, + 255 + ], + [ + 257, + 258 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 268, + 270 + ], + [ + 271, + 272 + ], + [ + 275, + 276 + ], + [ + 277, + 278 + ], + [ + 281, + 284 + ], + [ + 287, + 288 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 298, + 299 + ], + [ + 303, + 304 + ], + [ + 306, + 312 + ], + [ + 315, + 316 + ], + [ + 325, + 326 + ], + [ + 332, + 333 + ], + [ + 337, + 340 + ], + [ + 341, + 342 + ], + [ + 350, + 351 + ], + [ + 355, + 356 + ], + [ + 360, + 363 + ], + [ + 364, + 365 + ] + ] + } + }, + { + "filename": "libvips/foreign/vipspng.c", + "line_filter": { + "diff_chunks": [ + [ + 51, + 61 + ], + [ + 84, + 119 + ], + [ + 150, + 178 + ], + [ + 203, + 263 + ], + [ + 265, + 278 + ], + [ + 283, + 397 + ], + [ + 403, + 410 + ], + [ + 415, + 465 + ], + [ + 466, + 483 + ], + [ + 485, + 514 + ], + [ + 516, + 533 + ], + [ + 534, + 550 + ], + [ + 552, + 842 + ], + [ + 843, + 857 + ], + [ + 867, + 916 + ], + [ + 917, + 946 + ], + [ + 947, + 981 + ], + [ + 983, + 1027 + ], + [ + 1028, + 1230 + ], + [ + 1231, + 1354 + ] + ], + "lines_added": [ + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 87, + 88 + ], + [ + 94, + 95 + ], + [ + 96, + 100 + ], + [ + 101, + 110 + ], + [ + 115, + 116 + ], + [ + 153, + 154 + ], + [ + 156, + 157 + ], + [ + 159, + 160 + ], + [ + 164, + 165 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 206, + 207 + ], + [ + 212, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 229 + ], + [ + 232, + 233 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 243, + 244 + ], + [ + 246, + 247 + ], + [ + 249, + 253 + ], + [ + 258, + 260 + ], + [ + 268, + 270 + ], + [ + 273, + 275 + ], + [ + 286, + 287 + ], + [ + 288, + 292 + ], + [ + 293, + 297 + ], + [ + 298, + 301 + ], + [ + 302, + 304 + ], + [ + 310, + 311 + ], + [ + 317, + 319 + ], + [ + 323, + 324 + ], + [ + 325, + 328 + ], + [ + 331, + 333 + ], + [ + 334, + 336 + ], + [ + 339, + 340 + ], + [ + 342, + 343 + ], + [ + 345, + 346 + ], + [ + 350, + 351 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 363, + 364 + ], + [ + 367, + 368 + ], + [ + 374, + 376 + ], + [ + 377, + 378 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 387, + 388 + ], + [ + 393, + 394 + ], + [ + 406, + 407 + ], + [ + 418, + 419 + ], + [ + 422, + 424 + ], + [ + 425, + 426 + ], + [ + 427, + 428 + ], + [ + 434, + 437 + ], + [ + 439, + 442 + ], + [ + 444, + 447 + ], + [ + 450, + 452 + ], + [ + 454, + 456 + ], + [ + 461, + 462 + ], + [ + 469, + 471 + ], + [ + 474, + 476 + ], + [ + 478, + 480 + ], + [ + 488, + 491 + ], + [ + 495, + 498 + ], + [ + 499, + 500 + ], + [ + 504, + 506 + ], + [ + 510, + 511 + ], + [ + 519, + 520 + ], + [ + 522, + 524 + ], + [ + 525, + 527 + ], + [ + 528, + 530 + ], + [ + 537, + 539 + ], + [ + 540, + 543 + ], + [ + 545, + 547 + ], + [ + 555, + 556 + ], + [ + 560, + 566 + ], + [ + 570, + 572 + ], + [ + 573, + 575 + ], + [ + 580, + 584 + ], + [ + 587, + 588 + ], + [ + 590, + 593 + ], + [ + 597, + 599 + ], + [ + 600, + 602 + ], + [ + 603, + 635 + ], + [ + 636, + 640 + ], + [ + 644, + 647 + ], + [ + 648, + 652 + ], + [ + 654, + 655 + ], + [ + 660, + 661 + ], + [ + 665, + 666 + ], + [ + 668, + 670 + ], + [ + 671, + 673 + ], + [ + 674, + 678 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 683, + 684 + ], + [ + 687, + 689 + ], + [ + 690, + 691 + ], + [ + 696, + 698 + ], + [ + 703, + 706 + ], + [ + 710, + 711 + ], + [ + 715, + 719 + ], + [ + 721, + 723 + ], + [ + 726, + 731 + ], + [ + 732, + 733 + ], + [ + 735, + 741 + ], + [ + 747, + 751 + ], + [ + 757, + 758 + ], + [ + 761, + 762 + ], + [ + 763, + 766 + ], + [ + 767, + 769 + ], + [ + 772, + 776 + ], + [ + 779, + 788 + ], + [ + 790, + 791 + ], + [ + 794, + 795 + ], + [ + 798, + 801 + ], + [ + 802, + 803 + ], + [ + 806, + 808 + ], + [ + 811, + 814 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 821, + 823 + ], + [ + 826, + 830 + ], + [ + 831, + 832 + ], + [ + 838, + 839 + ], + [ + 846, + 849 + ], + [ + 850, + 852 + ], + [ + 853, + 854 + ], + [ + 870, + 871 + ], + [ + 873, + 874 + ], + [ + 876, + 881 + ], + [ + 884, + 885 + ], + [ + 886, + 887 + ], + [ + 888, + 890 + ], + [ + 893, + 894 + ], + [ + 897, + 899 + ], + [ + 903, + 904 + ], + [ + 906, + 913 + ], + [ + 920, + 922 + ], + [ + 924, + 925 + ], + [ + 928, + 931 + ], + [ + 933, + 936 + ], + [ + 938, + 939 + ], + [ + 942, + 943 + ], + [ + 950, + 953 + ], + [ + 954, + 955 + ], + [ + 956, + 958 + ], + [ + 959, + 960 + ], + [ + 961, + 962 + ], + [ + 963, + 964 + ], + [ + 965, + 966 + ], + [ + 969, + 971 + ], + [ + 977, + 978 + ], + [ + 986, + 987 + ], + [ + 990, + 992 + ], + [ + 995, + 996 + ], + [ + 1000, + 1002 + ], + [ + 1003, + 1008 + ], + [ + 1010, + 1011 + ], + [ + 1013, + 1014 + ], + [ + 1019, + 1020 + ], + [ + 1023, + 1024 + ], + [ + 1031, + 1035 + ], + [ + 1038, + 1040 + ], + [ + 1043, + 1044 + ], + [ + 1045, + 1048 + ], + [ + 1051, + 1053 + ], + [ + 1054, + 1059 + ], + [ + 1063, + 1064 + ], + [ + 1067, + 1068 + ], + [ + 1069, + 1082 + ], + [ + 1084, + 1087 + ], + [ + 1092, + 1093 + ], + [ + 1095, + 1098 + ], + [ + 1104, + 1105 + ], + [ + 1106, + 1109 + ], + [ + 1112, + 1115 + ], + [ + 1118, + 1120 + ], + [ + 1122, + 1125 + ], + [ + 1126, + 1127 + ], + [ + 1129, + 1132 + ], + [ + 1134, + 1137 + ], + [ + 1138, + 1139 + ], + [ + 1141, + 1142 + ], + [ + 1145, + 1148 + ], + [ + 1150, + 1153 + ], + [ + 1159, + 1160 + ], + [ + 1162, + 1163 + ], + [ + 1168, + 1171 + ], + [ + 1175, + 1177 + ], + [ + 1179, + 1180 + ], + [ + 1184, + 1185 + ], + [ + 1187, + 1196 + ], + [ + 1199, + 1200 + ], + [ + 1203, + 1207 + ], + [ + 1210, + 1212 + ], + [ + 1216, + 1218 + ], + [ + 1221, + 1223 + ], + [ + 1226, + 1227 + ], + [ + 1234, + 1237 + ], + [ + 1240, + 1241 + ], + [ + 1242, + 1246 + ], + [ + 1247, + 1250 + ], + [ + 1256, + 1257 + ], + [ + 1259, + 1261 + ], + [ + 1265, + 1267 + ], + [ + 1268, + 1271 + ], + [ + 1272, + 1274 + ], + [ + 1275, + 1277 + ], + [ + 1279, + 1281 + ], + [ + 1282, + 1283 + ], + [ + 1284, + 1285 + ], + [ + 1290, + 1291 + ], + [ + 1295, + 1298 + ], + [ + 1301, + 1302 + ], + [ + 1303, + 1305 + ], + [ + 1310, + 1313 + ], + [ + 1316, + 1318 + ], + [ + 1319, + 1320 + ], + [ + 1321, + 1322 + ], + [ + 1325, + 1326 + ], + [ + 1329, + 1330 + ], + [ + 1333, + 1335 + ], + [ + 1336, + 1343 + ], + [ + 1345, + 1346 + ], + [ + 1347, + 1349 + ], + [ + 1350, + 1351 + ] + ] + } + }, + { + "filename": "libvips/foreign/vipssave.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 57, + 88 + ], + [ + 90, + 106 + ], + [ + 107, + 122 + ], + [ + 123, + 134 + ], + [ + 135, + 153 + ], + [ + 158, + 205 + ], + [ + 211, + 267 + ], + [ + 270, + 291 + ], + [ + 293, + 307 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 60, + 62 + ], + [ + 64, + 65 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 80, + 82 + ], + [ + 83, + 85 + ], + [ + 93, + 98 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 110, + 113 + ], + [ + 115, + 117 + ], + [ + 118, + 119 + ], + [ + 126, + 127 + ], + [ + 130, + 131 + ], + [ + 138, + 139 + ], + [ + 144, + 145 + ], + [ + 149, + 150 + ], + [ + 161, + 163 + ], + [ + 165, + 166 + ], + [ + 170, + 172 + ], + [ + 173, + 175 + ], + [ + 176, + 177 + ], + [ + 180, + 181 + ], + [ + 182, + 183 + ], + [ + 189, + 190 + ], + [ + 192, + 198 + ], + [ + 201, + 202 + ], + [ + 214, + 216 + ], + [ + 218, + 219 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 229 + ], + [ + 230, + 231 + ], + [ + 234, + 236 + ], + [ + 237, + 238 + ], + [ + 244, + 245 + ], + [ + 247, + 253 + ], + [ + 256, + 257 + ], + [ + 262, + 264 + ], + [ + 273, + 274 + ], + [ + 278, + 281 + ], + [ + 282, + 283 + ], + [ + 287, + 288 + ], + [ + 296, + 297 + ], + [ + 301, + 304 + ], + [ + 305, + 306 + ] + ] + } + }, + { + "filename": "libvips/foreign/webp2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 23, + 30 + ], + [ + 32, + 60 + ], + [ + 112, + 119 + ], + [ + 160, + 208 + ], + [ + 211, + 232 + ], + [ + 233, + 252 + ], + [ + 253, + 366 + ], + [ + 372, + 390 + ], + [ + 393, + 413 + ], + [ + 415, + 472 + ], + [ + 473, + 531 + ], + [ + 537, + 566 + ], + [ + 567, + 679 + ], + [ + 681, + 738 + ], + [ + 740, + 762 + ], + [ + 764, + 773 + ], + [ + 776, + 828 + ] + ], + "lines_added": [ + [ + 26, + 27 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 115, + 116 + ], + [ + 163, + 164 + ], + [ + 165, + 168 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 185, + 186 + ], + [ + 188, + 189 + ], + [ + 191, + 192 + ], + [ + 196, + 197 + ], + [ + 201, + 205 + ], + [ + 214, + 215 + ], + [ + 217, + 218 + ], + [ + 220, + 221 + ], + [ + 227, + 229 + ], + [ + 236, + 237 + ], + [ + 241, + 245 + ], + [ + 248, + 249 + ], + [ + 256, + 257 + ], + [ + 258, + 259 + ], + [ + 260, + 262 + ], + [ + 263, + 264 + ], + [ + 266, + 267 + ], + [ + 269, + 272 + ], + [ + 273, + 274 + ], + [ + 279, + 281 + ], + [ + 284, + 285 + ], + [ + 288, + 289 + ], + [ + 290, + 292 + ], + [ + 295, + 297 + ], + [ + 298, + 300 + ], + [ + 303, + 305 + ], + [ + 307, + 309 + ], + [ + 310, + 312 + ], + [ + 317, + 318 + ], + [ + 323, + 327 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 334, + 338 + ], + [ + 339, + 342 + ], + [ + 343, + 344 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 353, + 354 + ], + [ + 357, + 359 + ], + [ + 362, + 363 + ], + [ + 375, + 377 + ], + [ + 378, + 379 + ], + [ + 382, + 385 + ], + [ + 386, + 387 + ], + [ + 396, + 397 + ], + [ + 399, + 400 + ], + [ + 404, + 407 + ], + [ + 409, + 410 + ], + [ + 418, + 422 + ], + [ + 423, + 424 + ], + [ + 427, + 430 + ], + [ + 432, + 435 + ], + [ + 437, + 438 + ], + [ + 444, + 446 + ], + [ + 447, + 448 + ], + [ + 450, + 453 + ], + [ + 456, + 458 + ], + [ + 459, + 460 + ], + [ + 463, + 464 + ], + [ + 466, + 467 + ], + [ + 468, + 469 + ], + [ + 476, + 478 + ], + [ + 479, + 480 + ], + [ + 481, + 483 + ], + [ + 486, + 488 + ], + [ + 490, + 491 + ], + [ + 492, + 493 + ], + [ + 495, + 496 + ], + [ + 497, + 501 + ], + [ + 506, + 507 + ], + [ + 511, + 513 + ], + [ + 515, + 519 + ], + [ + 521, + 522 + ], + [ + 525, + 528 + ], + [ + 540, + 541 + ], + [ + 547, + 550 + ], + [ + 552, + 553 + ], + [ + 556, + 557 + ], + [ + 559, + 563 + ], + [ + 570, + 572 + ], + [ + 574, + 579 + ], + [ + 580, + 581 + ], + [ + 585, + 595 + ], + [ + 597, + 598 + ], + [ + 604, + 606 + ], + [ + 610, + 611 + ], + [ + 614, + 615 + ], + [ + 618, + 623 + ], + [ + 625, + 629 + ], + [ + 631, + 632 + ], + [ + 634, + 638 + ], + [ + 640, + 641 + ], + [ + 644, + 645 + ], + [ + 650, + 651 + ], + [ + 657, + 661 + ], + [ + 664, + 667 + ], + [ + 668, + 669 + ], + [ + 674, + 676 + ], + [ + 684, + 693 + ], + [ + 694, + 699 + ], + [ + 700, + 701 + ], + [ + 703, + 707 + ], + [ + 710, + 712 + ], + [ + 713, + 714 + ], + [ + 715, + 716 + ], + [ + 717, + 718 + ], + [ + 719, + 724 + ], + [ + 727, + 728 + ], + [ + 731, + 733 + ], + [ + 734, + 735 + ], + [ + 743, + 744 + ], + [ + 746, + 747 + ], + [ + 748, + 751 + ], + [ + 755, + 759 + ], + [ + 767, + 770 + ], + [ + 779, + 780 + ], + [ + 783, + 784 + ], + [ + 785, + 787 + ], + [ + 789, + 791 + ], + [ + 792, + 797 + ], + [ + 798, + 799 + ], + [ + 802, + 804 + ], + [ + 807, + 810 + ], + [ + 811, + 812 + ], + [ + 815, + 817 + ], + [ + 820, + 823 + ], + [ + 824, + 825 + ] + ] + } + }, + { + "filename": "libvips/foreign/webpload.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 72, + 79 + ], + [ + 81, + 158 + ], + [ + 161, + 211 + ], + [ + 220, + 277 + ], + [ + 279, + 331 + ], + [ + 333, + 356 + ], + [ + 364, + 411 + ], + [ + 412, + 433 + ], + [ + 444, + 480 + ], + [ + 490, + 507 + ], + [ + 508, + 523 + ], + [ + 531, + 552 + ] + ], + "lines_added": [ + [ + 15, + 31 + ], + [ + 36, + 37 + ], + [ + 75, + 76 + ], + [ + 84, + 86 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 104, + 107 + ], + [ + 109, + 111 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 132, + 135 + ], + [ + 136, + 137 + ], + [ + 140, + 141 + ], + [ + 144, + 147 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ], + [ + 164, + 165 + ], + [ + 171, + 172 + ], + [ + 177, + 180 + ], + [ + 181, + 183 + ], + [ + 184, + 187 + ], + [ + 188, + 190 + ], + [ + 191, + 194 + ], + [ + 195, + 197 + ], + [ + 198, + 201 + ], + [ + 202, + 204 + ], + [ + 207, + 208 + ], + [ + 223, + 225 + ], + [ + 227, + 228 + ], + [ + 230, + 231 + ], + [ + 233, + 234 + ], + [ + 235, + 236 + ], + [ + 238, + 240 + ], + [ + 241, + 242 + ], + [ + 245, + 247 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 257, + 258 + ], + [ + 262, + 263 + ], + [ + 264, + 270 + ], + [ + 273, + 274 + ], + [ + 282, + 283 + ], + [ + 288, + 290 + ], + [ + 292, + 293 + ], + [ + 297, + 301 + ], + [ + 302, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 310 + ], + [ + 314, + 318 + ], + [ + 319, + 320 + ], + [ + 325, + 326 + ], + [ + 327, + 328 + ], + [ + 336, + 337 + ], + [ + 343, + 349 + ], + [ + 352, + 353 + ], + [ + 367, + 369 + ], + [ + 371, + 372 + ], + [ + 374, + 375 + ], + [ + 377, + 382 + ], + [ + 383, + 385 + ], + [ + 386, + 387 + ], + [ + 390, + 391 + ], + [ + 395, + 399 + ], + [ + 400, + 401 + ], + [ + 404, + 406 + ], + [ + 407, + 408 + ], + [ + 415, + 416 + ], + [ + 418, + 419 + ], + [ + 420, + 426 + ], + [ + 429, + 430 + ], + [ + 447, + 448 + ], + [ + 453, + 454 + ], + [ + 460, + 461 + ], + [ + 467, + 468 + ], + [ + 472, + 475 + ], + [ + 476, + 477 + ], + [ + 493, + 494 + ], + [ + 495, + 497 + ], + [ + 503, + 504 + ], + [ + 511, + 512 + ], + [ + 513, + 516 + ], + [ + 517, + 518 + ], + [ + 519, + 520 + ], + [ + 534, + 535 + ], + [ + 541, + 542 + ], + [ + 546, + 549 + ], + [ + 550, + 551 + ] + ] + } + }, + { + "filename": "libvips/foreign/webpsave.c", + "line_filter": { + "diff_chunks": [ + [ + 36, + 64 + ], + [ + 86, + 94 + ], + [ + 191, + 227 + ], + [ + 232, + 438 + ], + [ + 440, + 573 + ], + [ + 574, + 721 + ], + [ + 729, + 738 + ], + [ + 741, + 748 + ], + [ + 749, + 850 + ], + [ + 863, + 893 + ], + [ + 895, + 911 + ], + [ + 915, + 943 + ], + [ + 945, + 961 + ], + [ + 965, + 976 + ], + [ + 977, + 1001 + ], + [ + 1003, + 1019 + ], + [ + 1023, + 1034 + ], + [ + 1035, + 1075 + ], + [ + 1143, + 1159 + ], + [ + 1189, + 1196 + ], + [ + 1197, + 1220 + ], + [ + 1244, + 1260 + ], + [ + 1285, + 1299 + ] + ], + "lines_added": [ + [ + 39, + 40 + ], + [ + 41, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 55 + ], + [ + 60, + 61 + ], + [ + 89, + 91 + ], + [ + 194, + 196 + ], + [ + 198, + 199 + ], + [ + 200, + 204 + ], + [ + 207, + 208 + ], + [ + 211, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 224 + ], + [ + 235, + 236 + ], + [ + 241, + 243 + ], + [ + 245, + 246 + ], + [ + 247, + 249 + ], + [ + 253, + 254 + ], + [ + 258, + 263 + ], + [ + 265, + 266 + ], + [ + 271, + 272 + ], + [ + 274, + 275 + ], + [ + 276, + 279 + ], + [ + 282, + 289 + ], + [ + 292, + 294 + ], + [ + 301, + 306 + ], + [ + 309, + 310 + ], + [ + 311, + 312 + ], + [ + 318, + 319 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 326, + 330 + ], + [ + 335, + 338 + ], + [ + 344, + 345 + ], + [ + 348, + 349 + ], + [ + 350, + 351 + ], + [ + 352, + 353 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 362, + 363 + ], + [ + 369, + 371 + ], + [ + 374, + 375 + ], + [ + 378, + 380 + ], + [ + 382, + 384 + ], + [ + 385, + 386 + ], + [ + 391, + 393 + ], + [ + 399, + 404 + ], + [ + 406, + 407 + ], + [ + 410, + 411 + ], + [ + 414, + 415 + ], + [ + 418, + 419 + ], + [ + 422, + 427 + ], + [ + 430, + 431 + ], + [ + 434, + 435 + ], + [ + 443, + 446 + ], + [ + 448, + 449 + ], + [ + 451, + 453 + ], + [ + 454, + 455 + ], + [ + 458, + 459 + ], + [ + 461, + 463 + ], + [ + 464, + 465 + ], + [ + 469, + 470 + ], + [ + 473, + 475 + ], + [ + 478, + 481 + ], + [ + 482, + 484 + ], + [ + 486, + 489 + ], + [ + 493, + 494 + ], + [ + 497, + 498 + ], + [ + 501, + 503 + ], + [ + 505, + 511 + ], + [ + 517, + 523 + ], + [ + 529, + 530 + ], + [ + 531, + 532 + ], + [ + 533, + 534 + ], + [ + 536, + 540 + ], + [ + 542, + 543 + ], + [ + 546, + 548 + ], + [ + 550, + 551 + ], + [ + 554, + 558 + ], + [ + 564, + 570 + ], + [ + 577, + 581 + ], + [ + 583, + 584 + ], + [ + 585, + 589 + ], + [ + 594, + 595 + ], + [ + 597, + 599 + ], + [ + 601, + 602 + ], + [ + 605, + 607 + ], + [ + 611, + 616 + ], + [ + 618, + 622 + ], + [ + 627, + 630 + ], + [ + 635, + 636 + ], + [ + 639, + 640 + ], + [ + 646, + 648 + ], + [ + 649, + 654 + ], + [ + 659, + 662 + ], + [ + 667, + 672 + ], + [ + 676, + 678 + ], + [ + 682, + 683 + ], + [ + 687, + 690 + ], + [ + 691, + 694 + ], + [ + 697, + 700 + ], + [ + 701, + 704 + ], + [ + 706, + 710 + ], + [ + 712, + 714 + ], + [ + 715, + 716 + ], + [ + 717, + 718 + ], + [ + 732, + 733 + ], + [ + 734, + 735 + ], + [ + 744, + 745 + ], + [ + 752, + 755 + ], + [ + 756, + 758 + ], + [ + 759, + 762 + ], + [ + 763, + 765 + ], + [ + 766, + 769 + ], + [ + 770, + 771 + ], + [ + 772, + 773 + ], + [ + 774, + 777 + ], + [ + 778, + 780 + ], + [ + 781, + 784 + ], + [ + 785, + 787 + ], + [ + 788, + 791 + ], + [ + 792, + 794 + ], + [ + 795, + 798 + ], + [ + 799, + 801 + ], + [ + 802, + 805 + ], + [ + 806, + 808 + ], + [ + 809, + 812 + ], + [ + 813, + 815 + ], + [ + 816, + 819 + ], + [ + 820, + 822 + ], + [ + 823, + 826 + ], + [ + 827, + 829 + ], + [ + 830, + 833 + ], + [ + 834, + 836 + ], + [ + 837, + 840 + ], + [ + 841, + 843 + ], + [ + 846, + 847 + ], + [ + 866, + 868 + ], + [ + 870, + 871 + ], + [ + 877, + 878 + ], + [ + 879, + 881 + ], + [ + 882, + 883 + ], + [ + 887, + 888 + ], + [ + 889, + 890 + ], + [ + 898, + 901 + ], + [ + 902, + 904 + ], + [ + 907, + 908 + ], + [ + 918, + 920 + ], + [ + 922, + 923 + ], + [ + 927, + 929 + ], + [ + 930, + 932 + ], + [ + 933, + 934 + ], + [ + 937, + 938 + ], + [ + 939, + 940 + ], + [ + 948, + 951 + ], + [ + 952, + 954 + ], + [ + 957, + 958 + ], + [ + 968, + 970 + ], + [ + 972, + 973 + ], + [ + 980, + 982 + ], + [ + 983, + 985 + ], + [ + 986, + 989 + ], + [ + 990, + 991 + ], + [ + 995, + 996 + ], + [ + 997, + 998 + ], + [ + 1006, + 1009 + ], + [ + 1010, + 1012 + ], + [ + 1015, + 1016 + ], + [ + 1026, + 1028 + ], + [ + 1030, + 1031 + ], + [ + 1038, + 1040 + ], + [ + 1041, + 1043 + ], + [ + 1044, + 1048 + ], + [ + 1049, + 1054 + ], + [ + 1055, + 1056 + ], + [ + 1057, + 1058 + ], + [ + 1061, + 1062 + ], + [ + 1066, + 1067 + ], + [ + 1071, + 1072 + ], + [ + 1146, + 1147 + ], + [ + 1151, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1192, + 1193 + ], + [ + 1200, + 1203 + ], + [ + 1204, + 1207 + ], + [ + 1210, + 1211 + ], + [ + 1213, + 1214 + ], + [ + 1216, + 1217 + ], + [ + 1247, + 1248 + ], + [ + 1252, + 1255 + ], + [ + 1256, + 1257 + ], + [ + 1288, + 1289 + ], + [ + 1293, + 1296 + ], + [ + 1297, + 1298 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/freqfilt.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 60, + 115 + ], + [ + 118, + 127 + ], + [ + 130, + 180 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 64 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 71, + 74 + ], + [ + 76, + 77 + ], + [ + 78, + 80 + ], + [ + 81, + 82 + ], + [ + 85, + 86 + ], + [ + 87, + 89 + ], + [ + 94, + 95 + ], + [ + 97, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 108 + ], + [ + 111, + 112 + ], + [ + 121, + 124 + ], + [ + 133, + 136 + ], + [ + 137, + 141 + ], + [ + 144, + 146 + ], + [ + 147, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 156 + ], + [ + 162, + 163 + ], + [ + 165, + 167 + ], + [ + 168, + 171 + ], + [ + 173, + 175 + ], + [ + 176, + 179 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/freqmult.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 63, + 96 + ], + [ + 97, + 147 + ], + [ + 156, + 170 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 77, + 79 + ], + [ + 82, + 86 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 100, + 106 + ], + [ + 107, + 108 + ], + [ + 110, + 112 + ], + [ + 113, + 114 + ], + [ + 117, + 118 + ], + [ + 119, + 121 + ], + [ + 126, + 127 + ], + [ + 129, + 132 + ], + [ + 133, + 134 + ], + [ + 137, + 138 + ], + [ + 143, + 144 + ], + [ + 159, + 160 + ], + [ + 164, + 167 + ], + [ + 168, + 169 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/fwfft.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 41, + 69 + ], + [ + 89, + 106 + ], + [ + 109, + 341 + ], + [ + 342, + 349 + ], + [ + 356, + 370 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 44, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 60 + ], + [ + 65, + 66 + ], + [ + 92, + 93 + ], + [ + 96, + 98 + ], + [ + 100, + 103 + ], + [ + 112, + 115 + ], + [ + 119, + 122 + ], + [ + 127, + 139 + ], + [ + 141, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 147 + ], + [ + 149, + 151 + ], + [ + 153, + 155 + ], + [ + 156, + 158 + ], + [ + 163, + 164 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 179, + 181 + ], + [ + 182, + 184 + ], + [ + 186, + 187 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 204, + 206 + ], + [ + 208, + 209 + ], + [ + 213, + 215 + ], + [ + 217, + 219 + ], + [ + 225, + 228 + ], + [ + 232, + 235 + ], + [ + 238, + 241 + ], + [ + 244, + 252 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 262, + 264 + ], + [ + 266, + 268 + ], + [ + 272, + 274 + ], + [ + 277, + 278 + ], + [ + 284, + 286 + ], + [ + 288, + 289 + ], + [ + 292, + 293 + ], + [ + 294, + 295 + ], + [ + 296, + 297 + ], + [ + 300, + 302 + ], + [ + 303, + 304 + ], + [ + 305, + 308 + ], + [ + 309, + 313 + ], + [ + 315, + 318 + ], + [ + 320, + 322 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ], + [ + 329, + 330 + ], + [ + 332, + 333 + ], + [ + 337, + 338 + ], + [ + 345, + 346 + ], + [ + 359, + 360 + ], + [ + 364, + 367 + ], + [ + 368, + 369 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/invfft.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 30, + 58 + ], + [ + 80, + 145 + ], + [ + 150, + 170 + ], + [ + 174, + 267 + ], + [ + 268, + 275 + ], + [ + 287, + 301 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 49 + ], + [ + 54, + 55 + ], + [ + 83, + 84 + ], + [ + 87, + 89 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 97, + 100 + ], + [ + 104, + 107 + ], + [ + 111, + 122 + ], + [ + 124, + 126 + ], + [ + 127, + 128 + ], + [ + 131, + 132 + ], + [ + 136, + 138 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 153, + 156 + ], + [ + 159, + 162 + ], + [ + 163, + 165 + ], + [ + 166, + 167 + ], + [ + 177, + 179 + ], + [ + 181, + 183 + ], + [ + 187, + 196 + ], + [ + 198, + 200 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 217 + ], + [ + 218, + 219 + ], + [ + 220, + 223 + ], + [ + 224, + 228 + ], + [ + 230, + 233 + ], + [ + 235, + 239 + ], + [ + 242, + 243 + ], + [ + 244, + 246 + ], + [ + 251, + 252 + ], + [ + 254, + 257 + ], + [ + 258, + 260 + ], + [ + 263, + 264 + ], + [ + 271, + 272 + ], + [ + 290, + 291 + ], + [ + 295, + 298 + ], + [ + 299, + 300 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/pfreqfilt.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 65, + 80 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 74 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/phasecor.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 41 + ], + [ + 57, + 122 + ], + [ + 129, + 148 + ] + ], + "lines_added": [ + [ + 16, + 32 + ], + [ + 37, + 38 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 71, + 73 + ], + [ + 77, + 80 + ], + [ + 83, + 86 + ], + [ + 89, + 93 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 102 + ], + [ + 107, + 108 + ], + [ + 110, + 113 + ], + [ + 114, + 115 + ], + [ + 118, + 119 + ], + [ + 132, + 133 + ], + [ + 137, + 138 + ], + [ + 142, + 145 + ], + [ + 146, + 147 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/spectrum.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 9 + ], + [ + 20, + 48 + ], + [ + 59, + 115 + ], + [ + 122, + 136 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 62, + 63 + ], + [ + 65, + 66 + ], + [ + 67, + 69 + ], + [ + 72, + 74 + ], + [ + 77, + 80 + ], + [ + 83, + 87 + ], + [ + 88, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 105, + 106 + ], + [ + 111, + 112 + ], + [ + 125, + 126 + ], + [ + 130, + 133 + ], + [ + 134, + 135 + ] + ] + } + }, + { + "filename": "libvips/histogram/case.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 55, + 97 + ], + [ + 98, + 127 + ], + [ + 128, + 148 + ], + [ + 151, + 192 + ], + [ + 194, + 278 + ], + [ + 285, + 294 + ], + [ + 298, + 312 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 58, + 59 + ], + [ + 60, + 63 + ], + [ + 66, + 67 + ], + [ + 70, + 72 + ], + [ + 75, + 76 + ], + [ + 79, + 81 + ], + [ + 82, + 84 + ], + [ + 88, + 94 + ], + [ + 101, + 107 + ], + [ + 109, + 114 + ], + [ + 117, + 120 + ], + [ + 123, + 124 + ], + [ + 131, + 133 + ], + [ + 136, + 137 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 154, + 155 + ], + [ + 156, + 158 + ], + [ + 160, + 166 + ], + [ + 167, + 171 + ], + [ + 175, + 177 + ], + [ + 179, + 183 + ], + [ + 186, + 189 + ], + [ + 197, + 203 + ], + [ + 205, + 208 + ], + [ + 213, + 217 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 224, + 227 + ], + [ + 232, + 234 + ], + [ + 238, + 241 + ], + [ + 242, + 243 + ], + [ + 244, + 247 + ], + [ + 248, + 256 + ], + [ + 259, + 260 + ], + [ + 264, + 266 + ], + [ + 267, + 268 + ], + [ + 270, + 273 + ], + [ + 274, + 275 + ], + [ + 288, + 291 + ], + [ + 301, + 302 + ], + [ + 306, + 309 + ], + [ + 310, + 311 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_cum.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 54 + ], + [ + 66, + 132 + ], + [ + 147, + 167 + ], + [ + 170, + 191 + ] + ], + "lines_added": [ + [ + 23, + 24 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 69, + 83 + ], + [ + 84, + 85 + ], + [ + 87, + 89 + ], + [ + 90, + 93 + ], + [ + 95, + 127 + ], + [ + 128, + 129 + ], + [ + 150, + 151 + ], + [ + 153, + 154 + ], + [ + 156, + 157 + ], + [ + 163, + 164 + ], + [ + 173, + 174 + ], + [ + 179, + 181 + ], + [ + 185, + 188 + ], + [ + 189, + 190 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_entropy.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 8 + ], + [ + 9, + 37 + ], + [ + 44, + 51 + ], + [ + 54, + 135 + ], + [ + 142, + 157 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 28 + ], + [ + 33, + 34 + ], + [ + 47, + 48 + ], + [ + 57, + 59 + ], + [ + 61, + 62 + ], + [ + 63, + 66 + ], + [ + 67, + 69 + ], + [ + 70, + 72 + ], + [ + 73, + 75 + ], + [ + 80, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 107, + 108 + ], + [ + 110, + 113 + ], + [ + 114, + 115 + ], + [ + 116, + 119 + ], + [ + 120, + 122 + ], + [ + 125, + 126 + ], + [ + 131, + 132 + ], + [ + 145, + 147 + ], + [ + 151, + 154 + ], + [ + 155, + 156 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_equal.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 13, + 20 + ], + [ + 21, + 49 + ], + [ + 55, + 62 + ], + [ + 68, + 138 + ], + [ + 148, + 169 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 16, + 17 + ], + [ + 24, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 40 + ], + [ + 45, + 46 + ], + [ + 58, + 59 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 76, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 83 + ], + [ + 87, + 88 + ], + [ + 89, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 110, + 111 + ], + [ + 113, + 116 + ], + [ + 117, + 131 + ], + [ + 134, + 135 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 157, + 159 + ], + [ + 163, + 166 + ], + [ + 167, + 168 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_ismonotonic.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 53, + 60 + ], + [ + 63, + 136 + ], + [ + 143, + 158 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 56, + 57 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 72, + 75 + ], + [ + 76, + 77 + ], + [ + 78, + 80 + ], + [ + 81, + 83 + ], + [ + 84, + 89 + ], + [ + 92, + 93 + ], + [ + 94, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 114, + 115 + ], + [ + 117, + 120 + ], + [ + 121, + 129 + ], + [ + 132, + 133 + ], + [ + 146, + 148 + ], + [ + 152, + 155 + ], + [ + 156, + 157 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_local.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 31, + 59 + ], + [ + 83, + 95 + ], + [ + 96, + 196 + ], + [ + 197, + 208 + ], + [ + 210, + 219 + ], + [ + 220, + 239 + ], + [ + 244, + 251 + ], + [ + 254, + 269 + ], + [ + 275, + 399 + ], + [ + 409, + 416 + ], + [ + 423, + 438 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 7, + 8 + ], + [ + 34, + 35 + ], + [ + 36, + 40 + ], + [ + 41, + 50 + ], + [ + 55, + 56 + ], + [ + 86, + 87 + ], + [ + 91, + 92 + ], + [ + 99, + 100 + ], + [ + 104, + 108 + ], + [ + 109, + 111 + ], + [ + 112, + 114 + ], + [ + 115, + 116 + ], + [ + 119, + 120 + ], + [ + 126, + 128 + ], + [ + 131, + 135 + ], + [ + 137, + 142 + ], + [ + 143, + 144 + ], + [ + 147, + 149 + ], + [ + 153, + 155 + ], + [ + 160, + 161 + ], + [ + 166, + 170 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 177, + 181 + ], + [ + 182, + 183 + ], + [ + 185, + 186 + ], + [ + 187, + 189 + ], + [ + 190, + 193 + ], + [ + 200, + 202 + ], + [ + 204, + 205 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 223, + 226 + ], + [ + 229, + 230 + ], + [ + 233, + 236 + ], + [ + 247, + 248 + ], + [ + 257, + 258 + ], + [ + 260, + 262 + ], + [ + 265, + 266 + ], + [ + 278, + 279 + ], + [ + 282, + 283 + ], + [ + 284, + 285 + ], + [ + 286, + 287 + ], + [ + 290, + 292 + ], + [ + 293, + 294 + ], + [ + 295, + 298 + ], + [ + 299, + 301 + ], + [ + 302, + 306 + ], + [ + 308, + 309 + ], + [ + 310, + 316 + ], + [ + 318, + 319 + ], + [ + 323, + 326 + ], + [ + 329, + 335 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 355, + 356 + ], + [ + 360, + 363 + ], + [ + 364, + 365 + ], + [ + 366, + 371 + ], + [ + 372, + 375 + ], + [ + 376, + 378 + ], + [ + 379, + 382 + ], + [ + 383, + 385 + ], + [ + 386, + 389 + ], + [ + 390, + 392 + ], + [ + 395, + 396 + ], + [ + 412, + 413 + ], + [ + 426, + 428 + ], + [ + 432, + 435 + ], + [ + 436, + 437 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_match.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 19 + ], + [ + 20, + 48 + ], + [ + 72, + 86 + ], + [ + 88, + 206 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 75, + 76 + ], + [ + 78, + 80 + ], + [ + 81, + 83 + ], + [ + 91, + 92 + ], + [ + 97, + 98 + ], + [ + 100, + 102 + ], + [ + 104, + 105 + ], + [ + 107, + 108 + ], + [ + 110, + 111 + ], + [ + 115, + 116 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 132, + 136 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 144, + 145 + ], + [ + 146, + 149 + ], + [ + 154, + 155 + ], + [ + 157, + 158 + ], + [ + 160, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 181, + 182 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 194, + 196 + ], + [ + 200, + 203 + ], + [ + 204, + 205 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_norm.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 54 + ], + [ + 69, + 158 + ], + [ + 160, + 168 + ], + [ + 169, + 184 + ] + ], + "lines_added": [ + [ + 23, + 24 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 72, + 73 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 81, + 82 + ], + [ + 86, + 87 + ], + [ + 88, + 90 + ], + [ + 93, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 105 + ], + [ + 108, + 110 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 120, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 130, + 131 + ], + [ + 137, + 138 + ], + [ + 140, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 151 + ], + [ + 154, + 155 + ], + [ + 163, + 165 + ], + [ + 172, + 174 + ], + [ + 178, + 181 + ], + [ + 182, + 183 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_plot.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 23 + ], + [ + 32, + 60 + ], + [ + 79, + 294 + ], + [ + 304, + 350 + ], + [ + 353, + 383 + ] + ], + "lines_added": [ + [ + 19, + 20 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 82, + 95 + ], + [ + 99, + 101 + ], + [ + 103, + 104 + ], + [ + 106, + 108 + ], + [ + 112, + 141 + ], + [ + 143, + 144 + ], + [ + 147, + 148 + ], + [ + 150, + 161 + ], + [ + 165, + 167 + ], + [ + 169, + 170 + ], + [ + 172, + 174 + ], + [ + 175, + 176 + ], + [ + 180, + 209 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 230, + 231 + ], + [ + 232, + 234 + ], + [ + 237, + 241 + ], + [ + 242, + 245 + ], + [ + 248, + 251 + ], + [ + 254, + 255 + ], + [ + 260, + 264 + ], + [ + 265, + 268 + ], + [ + 272, + 274 + ], + [ + 277, + 281 + ], + [ + 283, + 284 + ], + [ + 287, + 288 + ], + [ + 290, + 291 + ], + [ + 307, + 317 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 329, + 330 + ], + [ + 332, + 335 + ], + [ + 336, + 337 + ], + [ + 338, + 343 + ], + [ + 346, + 347 + ], + [ + 356, + 357 + ], + [ + 359, + 362 + ], + [ + 366, + 367 + ], + [ + 371, + 373 + ], + [ + 377, + 380 + ], + [ + 381, + 382 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_unary.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 50, + 98 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 53, + 54 + ], + [ + 56, + 57 + ], + [ + 58, + 60 + ], + [ + 62, + 63 + ], + [ + 65, + 67 + ], + [ + 68, + 70 + ], + [ + 71, + 72 + ], + [ + 75, + 76 + ], + [ + 77, + 79 + ], + [ + 84, + 85 + ], + [ + 87, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_unary.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 64, + 74 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 67, + 68 + ] + ] + } + }, + { + "filename": "libvips/histogram/histogram.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 56, + 73 + ], + [ + 74, + 120 + ], + [ + 121, + 227 + ], + [ + 228, + 243 + ], + [ + 247, + 267 + ], + [ + 273, + 278 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 59, + 62 + ], + [ + 64, + 65 + ], + [ + 66, + 70 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 82, + 83 + ], + [ + 87, + 88 + ], + [ + 89, + 93 + ], + [ + 94, + 100 + ], + [ + 102, + 106 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 114, + 117 + ], + [ + 124, + 126 + ], + [ + 129, + 132 + ], + [ + 134, + 136 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 143, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 155 + ], + [ + 159, + 164 + ], + [ + 166, + 168 + ], + [ + 170, + 178 + ], + [ + 181, + 187 + ], + [ + 188, + 189 + ], + [ + 194, + 195 + ], + [ + 196, + 198 + ], + [ + 201, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 209 + ], + [ + 210, + 211 + ], + [ + 214, + 215 + ], + [ + 216, + 218 + ], + [ + 223, + 224 + ], + [ + 231, + 236 + ], + [ + 239, + 240 + ], + [ + 250, + 251 + ], + [ + 252, + 264 + ], + [ + 276, + 277 + ] + ] + } + }, + { + "filename": "libvips/histogram/maplut.c", + "line_filter": { + "diff_chunks": [ + [ + 37, + 65 + ], + [ + 79, + 424 + ], + [ + 426, + 508 + ], + [ + 510, + 519 + ], + [ + 521, + 528 + ], + [ + 529, + 761 + ], + [ + 770, + 791 + ], + [ + 796, + 810 + ] + ], + "lines_added": [ + [ + 40, + 56 + ], + [ + 61, + 62 + ], + [ + 82, + 83 + ], + [ + 84, + 91 + ], + [ + 96, + 97 + ], + [ + 99, + 101 + ], + [ + 106, + 108 + ], + [ + 109, + 111 + ], + [ + 116, + 118 + ], + [ + 123, + 124 + ], + [ + 128, + 130 + ], + [ + 136, + 138 + ], + [ + 139, + 140 + ], + [ + 144, + 157 + ], + [ + 158, + 159 + ], + [ + 162, + 179 + ], + [ + 181, + 182 + ], + [ + 183, + 202 + ], + [ + 205, + 206 + ], + [ + 207, + 229 + ], + [ + 232, + 233 + ], + [ + 236, + 248 + ], + [ + 251, + 266 + ], + [ + 267, + 268 + ], + [ + 272, + 289 + ], + [ + 291, + 292 + ], + [ + 293, + 312 + ], + [ + 314, + 315 + ], + [ + 318, + 332 + ], + [ + 333, + 334 + ], + [ + 337, + 353 + ], + [ + 355, + 356 + ], + [ + 359, + 377 + ], + [ + 379, + 380 + ], + [ + 383, + 404 + ], + [ + 406, + 407 + ], + [ + 410, + 421 + ], + [ + 429, + 431 + ], + [ + 432, + 437 + ], + [ + 438, + 440 + ], + [ + 441, + 443 + ], + [ + 444, + 446 + ], + [ + 447, + 449 + ], + [ + 450, + 452 + ], + [ + 453, + 455 + ], + [ + 456, + 458 + ], + [ + 459, + 461 + ], + [ + 467, + 470 + ], + [ + 475, + 476 + ], + [ + 478, + 481 + ], + [ + 484, + 486 + ], + [ + 487, + 488 + ], + [ + 490, + 494 + ], + [ + 496, + 497 + ], + [ + 498, + 499 + ], + [ + 504, + 505 + ], + [ + 513, + 514 + ], + [ + 515, + 516 + ], + [ + 524, + 525 + ], + [ + 532, + 550 + ], + [ + 551, + 552 + ], + [ + 553, + 554 + ], + [ + 555, + 574 + ], + [ + 576, + 579 + ], + [ + 581, + 582 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 588, + 589 + ], + [ + 594, + 595 + ], + [ + 596, + 598 + ], + [ + 602, + 605 + ], + [ + 608, + 610 + ], + [ + 612, + 616 + ], + [ + 617, + 620 + ], + [ + 625, + 626 + ], + [ + 632, + 633 + ], + [ + 635, + 639 + ], + [ + 643, + 645 + ], + [ + 647, + 648 + ], + [ + 652, + 653 + ], + [ + 654, + 656 + ], + [ + 662, + 668 + ], + [ + 671, + 675 + ], + [ + 676, + 704 + ], + [ + 706, + 710 + ], + [ + 711, + 712 + ], + [ + 715, + 716 + ], + [ + 717, + 720 + ], + [ + 725, + 726 + ], + [ + 730, + 733 + ], + [ + 734, + 735 + ], + [ + 736, + 741 + ], + [ + 742, + 745 + ], + [ + 746, + 747 + ], + [ + 748, + 751 + ], + [ + 752, + 754 + ], + [ + 757, + 758 + ], + [ + 773, + 774 + ], + [ + 775, + 776 + ], + [ + 778, + 779 + ], + [ + 781, + 782 + ], + [ + 783, + 788 + ], + [ + 799, + 800 + ], + [ + 804, + 807 + ], + [ + 808, + 809 + ] + ] + } + }, + { + "filename": "libvips/histogram/percent.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 54, + 61 + ], + [ + 65, + 134 + ], + [ + 138, + 145 + ], + [ + 148, + 170 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 57, + 58 + ], + [ + 68, + 69 + ], + [ + 71, + 72 + ], + [ + 73, + 75 + ], + [ + 78, + 80 + ], + [ + 81, + 89 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 96, + 97 + ], + [ + 98, + 99 + ], + [ + 105, + 106 + ], + [ + 108, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 127 + ], + [ + 130, + 131 + ], + [ + 141, + 142 + ], + [ + 151, + 152 + ], + [ + 158, + 160 + ], + [ + 164, + 167 + ], + [ + 168, + 169 + ] + ] + } + }, + { + "filename": "libvips/histogram/phistogram.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 40, + 84 + ], + [ + 89, + 99 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 43, + 55 + ], + [ + 59, + 61 + ], + [ + 67, + 68 + ], + [ + 74, + 75 + ], + [ + 80, + 81 + ], + [ + 92, + 93 + ] + ] + } + }, + { + "filename": "libvips/histogram/stdif.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 15, + 56 + ], + [ + 84, + 111 + ], + [ + 112, + 129 + ], + [ + 139, + 154 + ], + [ + 160, + 196 + ], + [ + 207, + 355 + ], + [ + 374, + 396 + ], + [ + 397, + 420 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 7, + 8 + ], + [ + 18, + 19 + ], + [ + 24, + 25 + ], + [ + 31, + 32 + ], + [ + 33, + 37 + ], + [ + 38, + 47 + ], + [ + 52, + 53 + ], + [ + 87, + 88 + ], + [ + 94, + 96 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 107, + 108 + ], + [ + 115, + 117 + ], + [ + 118, + 119 + ], + [ + 121, + 122 + ], + [ + 124, + 126 + ], + [ + 142, + 145 + ], + [ + 147, + 148 + ], + [ + 149, + 151 + ], + [ + 163, + 165 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 177 + ], + [ + 180, + 181 + ], + [ + 182, + 183 + ], + [ + 187, + 189 + ], + [ + 192, + 193 + ], + [ + 210, + 211 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 222, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 238 + ], + [ + 239, + 242 + ], + [ + 244, + 245 + ], + [ + 246, + 252 + ], + [ + 254, + 255 + ], + [ + 259, + 262 + ], + [ + 265, + 271 + ], + [ + 275, + 276 + ], + [ + 277, + 278 + ], + [ + 281, + 282 + ], + [ + 283, + 284 + ], + [ + 290, + 291 + ], + [ + 293, + 296 + ], + [ + 297, + 298 + ], + [ + 299, + 304 + ], + [ + 307, + 310 + ], + [ + 311, + 313 + ], + [ + 314, + 317 + ], + [ + 318, + 320 + ], + [ + 321, + 324 + ], + [ + 325, + 327 + ], + [ + 328, + 331 + ], + [ + 332, + 334 + ], + [ + 335, + 338 + ], + [ + 339, + 341 + ], + [ + 342, + 345 + ], + [ + 346, + 348 + ], + [ + 351, + 352 + ], + [ + 377, + 380 + ], + [ + 385, + 386 + ], + [ + 390, + 393 + ], + [ + 400, + 402 + ], + [ + 408, + 410 + ], + [ + 414, + 417 + ], + [ + 418, + 419 + ] + ] + } + }, + { + "filename": "libvips/include/vips/almostdeprecated.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 7, + 35 + ], + [ + 54, + 112 + ], + [ + 121, + 130 + ], + [ + 133, + 222 + ], + [ + 223, + 407 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 10, + 11 + ], + [ + 12, + 16 + ], + [ + 17, + 26 + ], + [ + 31, + 32 + ], + [ + 57, + 58 + ], + [ + 62, + 64 + ], + [ + 67, + 68 + ], + [ + 69, + 71 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 90, + 95 + ], + [ + 97, + 102 + ], + [ + 104, + 109 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 136, + 138 + ], + [ + 139, + 140 + ], + [ + 141, + 143 + ], + [ + 144, + 146 + ], + [ + 147, + 149 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 163, + 164 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 176, + 177 + ], + [ + 180, + 181 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 187, + 189 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 199, + 201 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 208, + 209 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 218, + 219 + ], + [ + 226, + 227 + ], + [ + 231, + 232 + ], + [ + 233, + 234 + ], + [ + 235, + 236 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 241, + 242 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 250, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 260, + 262 + ], + [ + 266, + 267 + ], + [ + 268, + 269 + ], + [ + 270, + 271 + ], + [ + 272, + 273 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 278, + 279 + ], + [ + 280, + 281 + ], + [ + 282, + 283 + ], + [ + 285, + 286 + ], + [ + 287, + 288 + ], + [ + 290, + 291 + ], + [ + 293, + 294 + ], + [ + 296, + 297 + ], + [ + 299, + 300 + ], + [ + 302, + 303 + ], + [ + 304, + 305 + ], + [ + 306, + 307 + ], + [ + 308, + 309 + ], + [ + 310, + 311 + ], + [ + 312, + 313 + ], + [ + 314, + 315 + ], + [ + 316, + 317 + ], + [ + 318, + 319 + ], + [ + 320, + 322 + ], + [ + 324, + 326 + ], + [ + 327, + 328 + ], + [ + 330, + 331 + ], + [ + 332, + 333 + ], + [ + 334, + 335 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 343, + 344 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 350, + 351 + ], + [ + 352, + 353 + ], + [ + 354, + 356 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 362, + 364 + ], + [ + 366, + 367 + ], + [ + 368, + 371 + ], + [ + 373, + 374 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 380, + 381 + ], + [ + 382, + 383 + ], + [ + 385, + 387 + ], + [ + 388, + 389 + ], + [ + 390, + 391 + ], + [ + 392, + 394 + ], + [ + 395, + 396 + ], + [ + 398, + 399 + ], + [ + 403, + 404 + ] + ] + } + }, + { + "filename": "libvips/include/vips/arithmetic.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 41, + 48 + ], + [ + 49, + 57 + ], + [ + 82, + 93 + ], + [ + 97, + 104 + ], + [ + 112, + 119 + ], + [ + 133, + 140 + ], + [ + 152, + 159 + ], + [ + 167, + 174 + ], + [ + 178, + 185 + ], + [ + 192, + 568 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 44, + 45 + ], + [ + 52, + 54 + ], + [ + 85, + 86 + ], + [ + 88, + 90 + ], + [ + 100, + 101 + ], + [ + 115, + 116 + ], + [ + 136, + 137 + ], + [ + 155, + 156 + ], + [ + 170, + 171 + ], + [ + 181, + 182 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 201, + 202 + ], + [ + 204, + 205 + ], + [ + 207, + 208 + ], + [ + 210, + 212 + ], + [ + 214, + 215 + ], + [ + 217, + 218 + ], + [ + 220, + 222 + ], + [ + 224, + 226 + ], + [ + 228, + 229 + ], + [ + 231, + 232 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 240, + 241 + ], + [ + 243, + 244 + ], + [ + 246, + 247 + ], + [ + 250, + 252 + ], + [ + 254, + 255 + ], + [ + 257, + 258 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 266, + 267 + ], + [ + 269, + 270 + ], + [ + 272, + 273 + ], + [ + 275, + 276 + ], + [ + 278, + 279 + ], + [ + 281, + 282 + ], + [ + 284, + 285 + ], + [ + 287, + 288 + ], + [ + 290, + 291 + ], + [ + 293, + 294 + ], + [ + 296, + 297 + ], + [ + 299, + 300 + ], + [ + 303, + 305 + ], + [ + 307, + 308 + ], + [ + 310, + 311 + ], + [ + 313, + 314 + ], + [ + 317, + 319 + ], + [ + 321, + 322 + ], + [ + 325, + 327 + ], + [ + 329, + 330 + ], + [ + 332, + 333 + ], + [ + 336, + 337 + ], + [ + 340, + 342 + ], + [ + 344, + 345 + ], + [ + 347, + 348 + ], + [ + 350, + 351 + ], + [ + 353, + 354 + ], + [ + 356, + 357 + ], + [ + 359, + 360 + ], + [ + 362, + 364 + ], + [ + 366, + 368 + ], + [ + 370, + 372 + ], + [ + 374, + 376 + ], + [ + 378, + 380 + ], + [ + 382, + 384 + ], + [ + 386, + 388 + ], + [ + 390, + 392 + ], + [ + 394, + 395 + ], + [ + 397, + 398 + ], + [ + 400, + 401 + ], + [ + 403, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 410 + ], + [ + 413, + 415 + ], + [ + 417, + 418 + ], + [ + 420, + 421 + ], + [ + 423, + 424 + ], + [ + 426, + 427 + ], + [ + 429, + 430 + ], + [ + 433, + 435 + ], + [ + 437, + 439 + ], + [ + 441, + 443 + ], + [ + 445, + 447 + ], + [ + 449, + 451 + ], + [ + 453, + 455 + ], + [ + 457, + 459 + ], + [ + 461, + 462 + ], + [ + 464, + 465 + ], + [ + 467, + 468 + ], + [ + 470, + 471 + ], + [ + 473, + 474 + ], + [ + 477, + 479 + ], + [ + 481, + 482 + ], + [ + 484, + 485 + ], + [ + 487, + 488 + ], + [ + 490, + 492 + ], + [ + 494, + 496 + ], + [ + 498, + 500 + ], + [ + 502, + 504 + ], + [ + 506, + 508 + ], + [ + 510, + 511 + ], + [ + 513, + 514 + ], + [ + 516, + 517 + ], + [ + 520, + 521 + ], + [ + 523, + 524 + ], + [ + 526, + 527 + ], + [ + 529, + 530 + ], + [ + 532, + 533 + ], + [ + 535, + 536 + ], + [ + 538, + 540 + ], + [ + 542, + 543 + ], + [ + 545, + 546 + ], + [ + 548, + 549 + ], + [ + 551, + 553 + ], + [ + 555, + 556 + ], + [ + 558, + 559 + ], + [ + 561, + 562 + ], + [ + 564, + 565 + ] + ] + } + }, + { + "filename": "libvips/include/vips/basic.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 37, + 46 + ], + [ + 49, + 60 + ], + [ + 70, + 86 + ], + [ + 91, + 110 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 40, + 41 + ], + [ + 42, + 43 + ], + [ + 52, + 54 + ], + [ + 55, + 57 + ], + [ + 73, + 74 + ], + [ + 77, + 83 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ] + ] + } + }, + { + "filename": "libvips/include/vips/buf.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 39, + 47 + ], + [ + 48, + 118 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 42, + 44 + ], + [ + 51, + 63 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 87 + ], + [ + 88, + 89 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ] + ] + } + }, + { + "filename": "libvips/include/vips/colour.h", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 108, + 304 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 111, + 112 + ], + [ + 113, + 115 + ], + [ + 118, + 119 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 127, + 128 + ], + [ + 130, + 131 + ], + [ + 133, + 134 + ], + [ + 136, + 137 + ], + [ + 139, + 140 + ], + [ + 142, + 143 + ], + [ + 145, + 146 + ], + [ + 148, + 149 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 164, + 165 + ], + [ + 167, + 168 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 180, + 181 + ], + [ + 183, + 184 + ], + [ + 186, + 187 + ], + [ + 189, + 190 + ], + [ + 192, + 193 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 209, + 210 + ], + [ + 211, + 213 + ], + [ + 215, + 216 + ], + [ + 218, + 219 + ], + [ + 221, + 223 + ], + [ + 224, + 226 + ], + [ + 228, + 229 + ], + [ + 231, + 232 + ], + [ + 234, + 235 + ], + [ + 238, + 240 + ], + [ + 241, + 243 + ], + [ + 244, + 245 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 251, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 264, + 265 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 271, + 273 + ], + [ + 274, + 276 + ], + [ + 278, + 280 + ], + [ + 281, + 283 + ], + [ + 285, + 287 + ], + [ + 288, + 290 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 296, + 298 + ], + [ + 299, + 301 + ] + ] + } + }, + { + "filename": "libvips/include/vips/connection.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 44, + 65 + ], + [ + 68, + 88 + ], + [ + 91, + 121 + ], + [ + 126, + 133 + ], + [ + 140, + 147 + ], + [ + 151, + 158 + ], + [ + 160, + 172 + ], + [ + 177, + 184 + ], + [ + 185, + 191 + ], + [ + 199, + 206 + ], + [ + 210, + 278 + ], + [ + 288, + 322 + ], + [ + 334, + 360 + ], + [ + 375, + 403 + ], + [ + 411, + 418 + ], + [ + 435, + 441 + ], + [ + 445, + 459 + ], + [ + 463, + 538 + ], + [ + 545, + 563 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 47, + 62 + ], + [ + 71, + 72 + ], + [ + 75, + 76 + ], + [ + 79, + 80 + ], + [ + 82, + 83 + ], + [ + 84, + 85 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 105, + 118 + ], + [ + 129, + 130 + ], + [ + 143, + 144 + ], + [ + 154, + 155 + ], + [ + 163, + 164 + ], + [ + 168, + 169 + ], + [ + 180, + 181 + ], + [ + 202, + 203 + ], + [ + 213, + 214 + ], + [ + 218, + 219 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 230 + ], + [ + 231, + 232 + ], + [ + 234, + 235 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 244, + 245 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 252, + 253 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 262, + 275 + ], + [ + 291, + 293 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 301, + 302 + ], + [ + 306, + 319 + ], + [ + 337, + 338 + ], + [ + 339, + 340 + ], + [ + 344, + 357 + ], + [ + 378, + 379 + ], + [ + 381, + 394 + ], + [ + 399, + 400 + ], + [ + 414, + 415 + ], + [ + 448, + 449 + ], + [ + 452, + 453 + ], + [ + 455, + 456 + ], + [ + 466, + 467 + ], + [ + 470, + 471 + ], + [ + 475, + 476 + ], + [ + 480, + 481 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 487, + 488 + ], + [ + 489, + 490 + ], + [ + 491, + 492 + ], + [ + 493, + 494 + ], + [ + 495, + 496 + ], + [ + 497, + 498 + ], + [ + 499, + 500 + ], + [ + 501, + 502 + ], + [ + 503, + 504 + ], + [ + 506, + 509 + ], + [ + 510, + 511 + ], + [ + 512, + 514 + ], + [ + 515, + 516 + ], + [ + 518, + 531 + ], + [ + 534, + 535 + ], + [ + 548, + 553 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ] + ] + } + }, + { + "filename": "libvips/include/vips/conversion.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 135, + 354 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 138, + 139 + ], + [ + 141, + 142 + ], + [ + 144, + 145 + ], + [ + 147, + 148 + ], + [ + 150, + 151 + ], + [ + 153, + 154 + ], + [ + 157, + 159 + ], + [ + 161, + 163 + ], + [ + 165, + 166 + ], + [ + 168, + 170 + ], + [ + 172, + 174 + ], + [ + 176, + 177 + ], + [ + 179, + 181 + ], + [ + 183, + 185 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 193, + 194 + ], + [ + 196, + 198 + ], + [ + 200, + 201 + ], + [ + 203, + 204 + ], + [ + 206, + 207 + ], + [ + 209, + 210 + ], + [ + 212, + 213 + ], + [ + 215, + 216 + ], + [ + 218, + 219 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 226, + 227 + ], + [ + 229, + 230 + ], + [ + 233, + 234 + ], + [ + 236, + 237 + ], + [ + 239, + 240 + ], + [ + 242, + 243 + ], + [ + 245, + 246 + ], + [ + 248, + 249 + ], + [ + 251, + 252 + ], + [ + 254, + 255 + ], + [ + 257, + 258 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 266, + 267 + ], + [ + 269, + 270 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 279, + 280 + ], + [ + 282, + 283 + ], + [ + 285, + 286 + ], + [ + 288, + 289 + ], + [ + 291, + 292 + ], + [ + 294, + 295 + ], + [ + 298, + 300 + ], + [ + 302, + 303 + ], + [ + 305, + 306 + ], + [ + 308, + 309 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 319, + 321 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ], + [ + 330, + 331 + ], + [ + 333, + 334 + ], + [ + 336, + 337 + ], + [ + 339, + 340 + ], + [ + 342, + 344 + ], + [ + 347, + 348 + ], + [ + 350, + 351 + ] + ] + } + }, + { + "filename": "libvips/include/vips/convolution.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 46, + 92 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 49, + 50 + ], + [ + 52, + 53 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 62 + ], + [ + 64, + 65 + ], + [ + 68, + 69 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 81, + 82 + ], + [ + 85, + 86 + ], + [ + 88, + 89 + ] + ] + } + }, + { + "filename": "libvips/include/vips/create.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 47, + 158 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 50, + 51 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 97, + 99 + ], + [ + 101, + 103 + ], + [ + 105, + 108 + ], + [ + 110, + 113 + ], + [ + 115, + 119 + ], + [ + 121, + 125 + ], + [ + 127, + 129 + ], + [ + 131, + 134 + ], + [ + 136, + 139 + ], + [ + 141, + 143 + ], + [ + 146, + 148 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ] + ] + } + }, + { + "filename": "libvips/include/vips/dbuf.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 59, + 101 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 62, + 63 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 79 + ], + [ + 80, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ] + ] + } + }, + { + "filename": "libvips/include/vips/debug.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 103 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 45 + ], + [ + 46, + 52 + ], + [ + 55, + 61 + ], + [ + 62, + 68 + ], + [ + 71, + 77 + ], + [ + 78, + 84 + ], + [ + 87, + 93 + ], + [ + 94, + 100 + ] + ] + } + }, + { + "filename": "libvips/include/vips/deprecated.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 50, + 121 + ], + [ + 125, + 150 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 53, + 60 + ], + [ + 62, + 74 + ], + [ + 77, + 91 + ], + [ + 92, + 105 + ], + [ + 106, + 114 + ], + [ + 115, + 118 + ], + [ + 128, + 129 + ], + [ + 131, + 133 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 147 + ] + ] + } + }, + { + "filename": "libvips/include/vips/dispatch.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 45, + 122 + ], + [ + 125, + 155 + ], + [ + 157, + 186 + ], + [ + 219, + 386 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 48, + 62 + ], + [ + 64, + 65 + ], + [ + 69, + 71 + ], + [ + 73, + 77 + ], + [ + 80, + 84 + ], + [ + 90, + 92 + ], + [ + 96, + 101 + ], + [ + 103, + 104 + ], + [ + 106, + 107 + ], + [ + 111, + 114 + ], + [ + 118, + 119 + ], + [ + 128, + 133 + ], + [ + 138, + 144 + ], + [ + 149, + 152 + ], + [ + 160, + 162 + ], + [ + 167, + 169 + ], + [ + 174, + 176 + ], + [ + 181, + 183 + ], + [ + 222, + 231 + ], + [ + 234, + 341 + ], + [ + 345, + 346 + ], + [ + 347, + 349 + ], + [ + 353, + 354 + ], + [ + 358, + 359 + ], + [ + 363, + 364 + ], + [ + 365, + 366 + ], + [ + 367, + 368 + ], + [ + 372, + 373 + ], + [ + 374, + 375 + ], + [ + 379, + 380 + ], + [ + 382, + 383 + ] + ] + } + }, + { + "filename": "libvips/include/vips/draw.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 46, + 110 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 49, + 50 + ], + [ + 52, + 54 + ], + [ + 56, + 58 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 71, + 73 + ], + [ + 75, + 77 + ], + [ + 80, + 82 + ], + [ + 84, + 86 + ], + [ + 89, + 91 + ], + [ + 93, + 95 + ], + [ + 98, + 99 + ], + [ + 101, + 102 + ], + [ + 105, + 107 + ] + ] + } + }, + { + "filename": "libvips/include/vips/error.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 140 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 40 + ], + [ + 41, + 42 + ], + [ + 43, + 44 + ], + [ + 46, + 47 + ], + [ + 48, + 49 + ], + [ + 51, + 53 + ], + [ + 54, + 55 + ], + [ + 56, + 58 + ], + [ + 59, + 61 + ], + [ + 62, + 63 + ], + [ + 64, + 65 + ], + [ + 67, + 69 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 130, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 137 + ] + ] + } + }, + { + "filename": "libvips/include/vips/foreign.h", + "line_filter": { + "diff_chunks": [ + [ + 4, + 32 + ], + [ + 42, + 61 + ], + [ + 91, + 123 + ], + [ + 129, + 158 + ], + [ + 198, + 267 + ], + [ + 269, + 314 + ], + [ + 343, + 350 + ], + [ + 363, + 380 + ], + [ + 391, + 423 + ], + [ + 452, + 478 + ], + [ + 496, + 522 + ], + [ + 583, + 673 + ], + [ + 691, + 713 + ], + [ + 741, + 890 + ], + [ + 894, + 901 + ], + [ + 936, + 949 + ], + [ + 952, + 959 + ] + ], + "lines_added": [ + [ + 7, + 23 + ], + [ + 28, + 29 + ], + [ + 45, + 58 + ], + [ + 94, + 96 + ], + [ + 97, + 98 + ], + [ + 103, + 108 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 117, + 120 + ], + [ + 132, + 145 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 211, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 226, + 228 + ], + [ + 232, + 233 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 247, + 248 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ], + [ + 257, + 259 + ], + [ + 263, + 264 + ], + [ + 272, + 273 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 279, + 280 + ], + [ + 281, + 282 + ], + [ + 283, + 285 + ], + [ + 286, + 288 + ], + [ + 290, + 291 + ], + [ + 293, + 308 + ], + [ + 310, + 311 + ], + [ + 346, + 347 + ], + [ + 366, + 368 + ], + [ + 374, + 377 + ], + [ + 394, + 395 + ], + [ + 396, + 397 + ], + [ + 398, + 399 + ], + [ + 400, + 401 + ], + [ + 403, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 410 + ], + [ + 412, + 413 + ], + [ + 416, + 417 + ], + [ + 419, + 420 + ], + [ + 455, + 456 + ], + [ + 458, + 459 + ], + [ + 461, + 462 + ], + [ + 465, + 466 + ], + [ + 468, + 469 + ], + [ + 471, + 472 + ], + [ + 474, + 475 + ], + [ + 499, + 500 + ], + [ + 502, + 503 + ], + [ + 505, + 506 + ], + [ + 509, + 510 + ], + [ + 512, + 513 + ], + [ + 515, + 516 + ], + [ + 518, + 519 + ], + [ + 586, + 587 + ], + [ + 589, + 590 + ], + [ + 592, + 593 + ], + [ + 595, + 596 + ], + [ + 598, + 599 + ], + [ + 601, + 602 + ], + [ + 605, + 606 + ], + [ + 609, + 610 + ], + [ + 612, + 613 + ], + [ + 616, + 617 + ], + [ + 620, + 622 + ], + [ + 624, + 625 + ], + [ + 627, + 628 + ], + [ + 631, + 632 + ], + [ + 634, + 635 + ], + [ + 637, + 638 + ], + [ + 640, + 641 + ], + [ + 644, + 645 + ], + [ + 647, + 648 + ], + [ + 650, + 651 + ], + [ + 653, + 654 + ], + [ + 656, + 657 + ], + [ + 660, + 661 + ], + [ + 663, + 664 + ], + [ + 666, + 667 + ], + [ + 669, + 670 + ], + [ + 694, + 695 + ], + [ + 697, + 698 + ], + [ + 700, + 701 + ], + [ + 703, + 704 + ], + [ + 706, + 707 + ], + [ + 709, + 710 + ], + [ + 744, + 745 + ], + [ + 747, + 748 + ], + [ + 750, + 751 + ], + [ + 753, + 754 + ], + [ + 757, + 758 + ], + [ + 761, + 762 + ], + [ + 764, + 765 + ], + [ + 767, + 768 + ], + [ + 770, + 771 + ], + [ + 773, + 774 + ], + [ + 776, + 777 + ], + [ + 780, + 781 + ], + [ + 783, + 784 + ], + [ + 786, + 787 + ], + [ + 790, + 791 + ], + [ + 793, + 794 + ], + [ + 796, + 797 + ], + [ + 799, + 800 + ], + [ + 803, + 804 + ], + [ + 806, + 807 + ], + [ + 809, + 810 + ], + [ + 813, + 814 + ], + [ + 816, + 817 + ], + [ + 819, + 820 + ], + [ + 823, + 824 + ], + [ + 826, + 827 + ], + [ + 829, + 830 + ], + [ + 832, + 833 + ], + [ + 835, + 836 + ], + [ + 838, + 839 + ], + [ + 842, + 843 + ], + [ + 845, + 846 + ], + [ + 848, + 849 + ], + [ + 852, + 853 + ], + [ + 855, + 856 + ], + [ + 858, + 859 + ], + [ + 861, + 862 + ], + [ + 864, + 865 + ], + [ + 867, + 868 + ], + [ + 871, + 872 + ], + [ + 874, + 875 + ], + [ + 877, + 878 + ], + [ + 880, + 881 + ], + [ + 883, + 884 + ], + [ + 886, + 887 + ], + [ + 897, + 898 + ], + [ + 939, + 940 + ], + [ + 942, + 943 + ], + [ + 945, + 946 + ], + [ + 955, + 956 + ] + ] + } + }, + { + "filename": "libvips/include/vips/format.h", + "line_filter": { + "diff_chunks": [ + [ + 4, + 32 + ], + [ + 37, + 63 + ], + [ + 74, + 97 + ], + [ + 105, + 133 + ] + ], + "lines_added": [ + [ + 7, + 23 + ], + [ + 28, + 29 + ], + [ + 40, + 55 + ], + [ + 57, + 60 + ], + [ + 77, + 78 + ], + [ + 81, + 82 + ], + [ + 85, + 86 + ], + [ + 89, + 90 + ], + [ + 93, + 94 + ], + [ + 108, + 109 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 121, + 123 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ] + ] + } + }, + { + "filename": "libvips/include/vips/freqfilt.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 39, + 61 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 43 + ], + [ + 45, + 46 + ], + [ + 49, + 50 + ], + [ + 53, + 54 + ], + [ + 57, + 58 + ] + ] + } + }, + { + "filename": "libvips/include/vips/gate.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 37, + 88 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 40, + 71 + ], + [ + 75, + 76 + ], + [ + 77, + 80 + ], + [ + 81, + 83 + ], + [ + 84, + 85 + ] + ] + } + }, + { + "filename": "libvips/include/vips/generate.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 37, + 89 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 40, + 41 + ], + [ + 42, + 43 + ], + [ + 45, + 46 + ], + [ + 47, + 48 + ], + [ + 49, + 50 + ], + [ + 52, + 53 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 59, + 60 + ], + [ + 62, + 63 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 82, + 84 + ], + [ + 85, + 86 + ] + ] + } + }, + { + "filename": "libvips/include/vips/header.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 80, + 87 + ], + [ + 105, + 120 + ], + [ + 130, + 137 + ], + [ + 139, + 153 + ], + [ + 165, + 310 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 83, + 84 + ], + [ + 108, + 109 + ], + [ + 115, + 117 + ], + [ + 133, + 134 + ], + [ + 142, + 143 + ], + [ + 149, + 150 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 219, + 220 + ], + [ + 222, + 227 + ], + [ + 229, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 236 + ], + [ + 237, + 238 + ], + [ + 239, + 242 + ], + [ + 243, + 244 + ], + [ + 245, + 246 + ], + [ + 248, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 257 + ], + [ + 258, + 260 + ], + [ + 261, + 263 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 269, + 271 + ], + [ + 272, + 273 + ], + [ + 274, + 276 + ], + [ + 277, + 279 + ], + [ + 280, + 281 + ], + [ + 282, + 284 + ], + [ + 285, + 286 + ], + [ + 287, + 289 + ], + [ + 290, + 292 + ], + [ + 293, + 295 + ], + [ + 296, + 298 + ], + [ + 300, + 302 + ], + [ + 303, + 305 + ], + [ + 306, + 307 + ] + ] + } + }, + { + "filename": "libvips/include/vips/histogram.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 39, + 82 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 43 + ], + [ + 45, + 46 + ], + [ + 48, + 49 + ], + [ + 51, + 52 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 73, + 74 + ], + [ + 77, + 79 + ] + ] + } + }, + { + "filename": "libvips/include/vips/image.h", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 47, + 55 + ], + [ + 64, + 90 + ], + [ + 140, + 181 + ], + [ + 187, + 213 + ], + [ + 217, + 225 + ], + [ + 232, + 261 + ], + [ + 271, + 278 + ], + [ + 328, + 365 + ], + [ + 373, + 603 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 50, + 52 + ], + [ + 67, + 69 + ], + [ + 71, + 72 + ], + [ + 78, + 87 + ], + [ + 143, + 147 + ], + [ + 153, + 154 + ], + [ + 156, + 162 + ], + [ + 165, + 178 + ], + [ + 190, + 193 + ], + [ + 194, + 199 + ], + [ + 200, + 202 + ], + [ + 203, + 204 + ], + [ + 209, + 210 + ], + [ + 220, + 222 + ], + [ + 235, + 241 + ], + [ + 242, + 243 + ], + [ + 248, + 249 + ], + [ + 250, + 253 + ], + [ + 256, + 258 + ], + [ + 274, + 275 + ], + [ + 331, + 332 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 341, + 343 + ], + [ + 346, + 347 + ], + [ + 348, + 350 + ], + [ + 351, + 352 + ], + [ + 353, + 354 + ], + [ + 357, + 358 + ], + [ + 361, + 362 + ], + [ + 376, + 377 + ], + [ + 378, + 385 + ], + [ + 386, + 387 + ], + [ + 392, + 411 + ], + [ + 412, + 413 + ], + [ + 414, + 416 + ], + [ + 419, + 425 + ], + [ + 426, + 428 + ], + [ + 431, + 432 + ], + [ + 434, + 435 + ], + [ + 437, + 438 + ], + [ + 440, + 441 + ], + [ + 443, + 444 + ], + [ + 445, + 446 + ], + [ + 447, + 448 + ], + [ + 450, + 451 + ], + [ + 452, + 453 + ], + [ + 455, + 456 + ], + [ + 457, + 458 + ], + [ + 459, + 460 + ], + [ + 461, + 462 + ], + [ + 464, + 465 + ], + [ + 466, + 468 + ], + [ + 469, + 471 + ], + [ + 472, + 474 + ], + [ + 475, + 477 + ], + [ + 479, + 481 + ], + [ + 482, + 483 + ], + [ + 484, + 485 + ], + [ + 486, + 488 + ], + [ + 489, + 491 + ], + [ + 492, + 494 + ], + [ + 495, + 496 + ], + [ + 498, + 500 + ], + [ + 501, + 502 + ], + [ + 503, + 504 + ], + [ + 506, + 507 + ], + [ + 508, + 509 + ], + [ + 511, + 513 + ], + [ + 515, + 517 + ], + [ + 519, + 520 + ], + [ + 522, + 524 + ], + [ + 525, + 526 + ], + [ + 527, + 528 + ], + [ + 530, + 531 + ], + [ + 532, + 533 + ], + [ + 534, + 535 + ], + [ + 536, + 537 + ], + [ + 539, + 540 + ], + [ + 541, + 542 + ], + [ + 543, + 544 + ], + [ + 545, + 546 + ], + [ + 547, + 548 + ], + [ + 549, + 550 + ], + [ + 552, + 553 + ], + [ + 555, + 556 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ], + [ + 561, + 562 + ], + [ + 563, + 564 + ], + [ + 566, + 567 + ], + [ + 572, + 573 + ], + [ + 574, + 575 + ], + [ + 576, + 578 + ], + [ + 579, + 580 + ], + [ + 581, + 583 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 588, + 589 + ], + [ + 593, + 595 + ], + [ + 596, + 597 + ], + [ + 599, + 600 + ] + ] + } + }, + { + "filename": "libvips/include/vips/inlines.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 38 + ], + [ + 46, + 67 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 34, + 35 + ], + [ + 49, + 51 + ], + [ + 52, + 54 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 63, + 64 + ] + ] + } + }, + { + "filename": "libvips/include/vips/internal.h", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 42, + 76 + ], + [ + 78, + 87 + ], + [ + 89, + 113 + ], + [ + 131, + 390 + ] + ], + "lines_added": [ + [ + 10, + 11 + ], + [ + 12, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 26 + ], + [ + 31, + 32 + ], + [ + 45, + 55 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 92, + 94 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 110 + ], + [ + 134, + 135 + ], + [ + 138, + 140 + ], + [ + 146, + 151 + ], + [ + 152, + 153 + ], + [ + 154, + 157 + ], + [ + 160, + 162 + ], + [ + 168, + 169 + ], + [ + 175, + 176 + ], + [ + 177, + 180 + ], + [ + 181, + 184 + ], + [ + 190, + 191 + ], + [ + 197, + 198 + ], + [ + 204, + 205 + ], + [ + 206, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 213 + ], + [ + 216, + 217 + ], + [ + 220, + 221 + ], + [ + 224, + 226 + ], + [ + 229, + 230 + ], + [ + 233, + 235 + ], + [ + 238, + 242 + ], + [ + 248, + 249 + ], + [ + 250, + 255 + ], + [ + 256, + 262 + ], + [ + 265, + 268 + ], + [ + 271, + 273 + ], + [ + 274, + 278 + ], + [ + 279, + 283 + ], + [ + 284, + 288 + ], + [ + 289, + 291 + ], + [ + 294, + 295 + ], + [ + 298, + 313 + ], + [ + 316, + 317 + ], + [ + 318, + 321 + ], + [ + 322, + 323 + ], + [ + 324, + 325 + ], + [ + 329, + 330 + ], + [ + 331, + 335 + ], + [ + 340, + 341 + ], + [ + 344, + 347 + ], + [ + 349, + 350 + ], + [ + 351, + 352 + ], + [ + 353, + 354 + ], + [ + 355, + 356 + ], + [ + 358, + 359 + ], + [ + 360, + 363 + ], + [ + 366, + 368 + ], + [ + 369, + 370 + ], + [ + 371, + 372 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 381, + 382 + ], + [ + 383, + 384 + ], + [ + 386, + 387 + ] + ] + } + }, + { + "filename": "libvips/include/vips/interpolate.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 62 + ], + [ + 66, + 74 + ], + [ + 79, + 86 + ], + [ + 88, + 95 + ], + [ + 97, + 111 + ], + [ + 123, + 141 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 59 + ], + [ + 69, + 71 + ], + [ + 82, + 83 + ], + [ + 91, + 92 + ], + [ + 100, + 102 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 134, + 135 + ] + ] + } + }, + { + "filename": "libvips/include/vips/mask.h", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 59, + 161 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 62, + 63 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 105, + 107 + ], + [ + 108, + 110 + ], + [ + 111, + 113 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 129, + 130 + ], + [ + 131, + 132 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 138, + 139 + ], + [ + 140, + 142 + ], + [ + 143, + 144 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 155, + 156 + ], + [ + 157, + 158 + ] + ] + } + }, + { + "filename": "libvips/include/vips/memory.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 37, + 99 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 40, + 73 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 84, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ] + ] + } + }, + { + "filename": "libvips/include/vips/morphology.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 45, + 70 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 48, + 50 + ], + [ + 52, + 54 + ], + [ + 56, + 57 + ], + [ + 59, + 61 + ], + [ + 63, + 64 + ], + [ + 66, + 67 + ] + ] + } + }, + { + "filename": "libvips/include/vips/mosaicing.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 39, + 78 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 44 + ], + [ + 46, + 48 + ], + [ + 51, + 55 + ], + [ + 58, + 61 + ], + [ + 64, + 65 + ], + [ + 67, + 69 + ], + [ + 72, + 73 + ] + ] + } + }, + { + "filename": "libvips/include/vips/object.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 43, + 61 + ], + [ + 85, + 271 + ], + [ + 279, + 287 + ], + [ + 303, + 310 + ], + [ + 317, + 379 + ], + [ + 386, + 393 + ], + [ + 394, + 448 + ], + [ + 466, + 473 + ], + [ + 476, + 482 + ], + [ + 484, + 533 + ], + [ + 537, + 549 + ], + [ + 553, + 563 + ], + [ + 566, + 579 + ], + [ + 584, + 634 + ], + [ + 635, + 724 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 46, + 54 + ], + [ + 55, + 56 + ], + [ + 57, + 58 + ], + [ + 88, + 89 + ], + [ + 95, + 97 + ], + [ + 100, + 101 + ], + [ + 104, + 106 + ], + [ + 109, + 263 + ], + [ + 267, + 268 + ], + [ + 282, + 284 + ], + [ + 306, + 307 + ], + [ + 320, + 326 + ], + [ + 327, + 329 + ], + [ + 330, + 333 + ], + [ + 334, + 335 + ], + [ + 336, + 338 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 348, + 350 + ], + [ + 351, + 352 + ], + [ + 357, + 376 + ], + [ + 389, + 390 + ], + [ + 397, + 398 + ], + [ + 399, + 404 + ], + [ + 405, + 407 + ], + [ + 409, + 412 + ], + [ + 414, + 417 + ], + [ + 419, + 421 + ], + [ + 422, + 424 + ], + [ + 425, + 426 + ], + [ + 429, + 430 + ], + [ + 432, + 433 + ], + [ + 435, + 445 + ], + [ + 469, + 470 + ], + [ + 487, + 488 + ], + [ + 489, + 490 + ], + [ + 491, + 492 + ], + [ + 496, + 497 + ], + [ + 500, + 501 + ], + [ + 502, + 503 + ], + [ + 506, + 507 + ], + [ + 508, + 509 + ], + [ + 511, + 512 + ], + [ + 516, + 517 + ], + [ + 520, + 521 + ], + [ + 524, + 525 + ], + [ + 529, + 530 + ], + [ + 540, + 541 + ], + [ + 543, + 544 + ], + [ + 545, + 546 + ], + [ + 556, + 557 + ], + [ + 559, + 560 + ], + [ + 569, + 570 + ], + [ + 575, + 576 + ], + [ + 587, + 588 + ], + [ + 593, + 597 + ], + [ + 600, + 601 + ], + [ + 602, + 604 + ], + [ + 605, + 607 + ], + [ + 609, + 610 + ], + [ + 611, + 612 + ], + [ + 614, + 615 + ], + [ + 616, + 617 + ], + [ + 618, + 619 + ], + [ + 621, + 622 + ], + [ + 623, + 624 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 630, + 631 + ], + [ + 638, + 641 + ], + [ + 642, + 644 + ], + [ + 645, + 647 + ], + [ + 648, + 650 + ], + [ + 651, + 652 + ], + [ + 653, + 654 + ], + [ + 655, + 657 + ], + [ + 659, + 660 + ], + [ + 661, + 662 + ], + [ + 664, + 665 + ], + [ + 667, + 669 + ], + [ + 670, + 671 + ], + [ + 673, + 674 + ], + [ + 675, + 678 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 683, + 684 + ], + [ + 685, + 686 + ], + [ + 687, + 688 + ], + [ + 690, + 691 + ], + [ + 692, + 694 + ], + [ + 696, + 697 + ], + [ + 699, + 702 + ], + [ + 704, + 705 + ], + [ + 706, + 707 + ], + [ + 708, + 709 + ], + [ + 711, + 712 + ], + [ + 714, + 715 + ], + [ + 717, + 718 + ] + ] + } + }, + { + "filename": "libvips/include/vips/operation.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 52, + 73 + ], + [ + 87, + 104 + ], + [ + 106, + 180 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 55, + 70 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 100, + 101 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 126, + 127 + ], + [ + 128, + 130 + ], + [ + 132, + 133 + ], + [ + 134, + 135 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 155, + 156 + ], + [ + 157, + 158 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 163, + 164 + ], + [ + 165, + 166 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ] + ] + } + }, + { + "filename": "libvips/include/vips/private.h", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 42, + 54 + ], + [ + 60, + 91 + ], + [ + 92, + 141 + ], + [ + 143, + 156 + ], + [ + 163, + 191 + ], + [ + 192, + 225 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 27 + ], + [ + 32, + 33 + ], + [ + 45, + 46 + ], + [ + 50, + 51 + ], + [ + 63, + 65 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 70, + 72 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 82, + 84 + ], + [ + 87, + 88 + ], + [ + 95, + 97 + ], + [ + 99, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 109, + 117 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 130, + 131 + ], + [ + 132, + 134 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 146, + 150 + ], + [ + 152, + 153 + ], + [ + 166, + 168 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 175, + 177 + ], + [ + 178, + 180 + ], + [ + 184, + 185 + ], + [ + 187, + 188 + ], + [ + 195, + 197 + ], + [ + 202, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 208 + ], + [ + 210, + 211 + ], + [ + 214, + 215 + ], + [ + 221, + 222 + ] + ] + } + }, + { + "filename": "libvips/include/vips/rect.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 51, + 78 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 58, + 59 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 64, + 65 + ], + [ + 66, + 68 + ], + [ + 69, + 71 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ] + ] + } + }, + { + "filename": "libvips/include/vips/region.h", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 48, + 67 + ], + [ + 93, + 109 + ], + [ + 120, + 127 + ], + [ + 134, + 235 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 32, + 33 + ], + [ + 51, + 64 + ], + [ + 96, + 98 + ], + [ + 102, + 106 + ], + [ + 123, + 124 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 146 + ], + [ + 147, + 148 + ], + [ + 149, + 150 + ], + [ + 152, + 153 + ], + [ + 154, + 156 + ], + [ + 157, + 158 + ], + [ + 159, + 161 + ], + [ + 162, + 164 + ], + [ + 165, + 167 + ], + [ + 169, + 170 + ], + [ + 171, + 173 + ], + [ + 175, + 177 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 183, + 184 + ], + [ + 189, + 190 + ], + [ + 191, + 192 + ], + [ + 194, + 204 + ], + [ + 208, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 229 + ], + [ + 231, + 232 + ] + ] + } + }, + { + "filename": "libvips/include/vips/resample.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 57, + 120 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 62 + ], + [ + 64, + 65 + ], + [ + 67, + 68 + ], + [ + 71, + 73 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 82, + 83 + ], + [ + 85, + 87 + ], + [ + 89, + 90 + ], + [ + 92, + 94 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 103, + 105 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ] + ] + } + }, + { + "filename": "libvips/include/vips/sbuf.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 42, + 66 + ], + [ + 96, + 137 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 45, + 58 + ], + [ + 62, + 63 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 105, + 106 + ], + [ + 108, + 111 + ], + [ + 112, + 118 + ], + [ + 120, + 125 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 131, + 132 + ], + [ + 133, + 134 + ] + ] + } + }, + { + "filename": "libvips/include/vips/semaphore.h", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 56, + 73 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 63, + 64 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ] + ] + } + }, + { + "filename": "libvips/include/vips/thread.h", + "line_filter": { + "diff_chunks": [ + [ + 4, + 32 + ], + [ + 40, + 72 + ] + ], + "lines_added": [ + [ + 7, + 23 + ], + [ + 28, + 29 + ], + [ + 43, + 44 + ], + [ + 45, + 46 + ], + [ + 50, + 51 + ], + [ + 52, + 53 + ], + [ + 57, + 58 + ], + [ + 59, + 60 + ], + [ + 62, + 63 + ], + [ + 65, + 69 + ] + ] + } + }, + { + "filename": "libvips/include/vips/threadpool.h", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 51, + 75 + ], + [ + 79, + 88 + ], + [ + 94, + 101 + ], + [ + 110, + 117 + ], + [ + 118, + 157 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 59, + 72 + ], + [ + 82, + 83 + ], + [ + 84, + 85 + ], + [ + 97, + 98 + ], + [ + 113, + 114 + ], + [ + 121, + 122 + ], + [ + 125, + 126 + ], + [ + 128, + 129 + ], + [ + 131, + 133 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 142, + 143 + ], + [ + 145, + 148 + ], + [ + 150, + 151 + ], + [ + 152, + 154 + ] + ] + } + }, + { + "filename": "libvips/include/vips/transform.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 42, + 52 + ], + [ + 54, + 87 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 45, + 47 + ], + [ + 48, + 49 + ], + [ + 57, + 58 + ], + [ + 61, + 62 + ], + [ + 64, + 84 + ] + ] + } + }, + { + "filename": "libvips/include/vips/type.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 53, + 66 + ], + [ + 68, + 83 + ], + [ + 94, + 130 + ], + [ + 132, + 139 + ], + [ + 152, + 166 + ], + [ + 170, + 190 + ], + [ + 194, + 210 + ], + [ + 214, + 230 + ], + [ + 234, + 241 + ], + [ + 245, + 301 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 56, + 57 + ], + [ + 62, + 63 + ], + [ + 71, + 72 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 112 + ], + [ + 114, + 124 + ], + [ + 125, + 127 + ], + [ + 135, + 136 + ], + [ + 155, + 156 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 173, + 174 + ], + [ + 178, + 180 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 185, + 187 + ], + [ + 197, + 198 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 217, + 218 + ], + [ + 222, + 223 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 237, + 238 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 257, + 259 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 266, + 267 + ], + [ + 268, + 270 + ], + [ + 271, + 272 + ], + [ + 274, + 276 + ], + [ + 277, + 279 + ], + [ + 281, + 282 + ], + [ + 283, + 284 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 295, + 298 + ] + ] + } + }, + { + "filename": "libvips/include/vips/util.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 7, + 35 + ], + [ + 46, + 250 + ], + [ + 251, + 372 + ], + [ + 374, + 381 + ], + [ + 383, + 439 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 10, + 11 + ], + [ + 12, + 16 + ], + [ + 17, + 26 + ], + [ + 31, + 32 + ], + [ + 49, + 50 + ], + [ + 51, + 53 + ], + [ + 54, + 56 + ], + [ + 57, + 59 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 68, + 76 + ], + [ + 77, + 85 + ], + [ + 89, + 96 + ], + [ + 100, + 101 + ], + [ + 102, + 104 + ], + [ + 107, + 118 + ], + [ + 121, + 163 + ], + [ + 165, + 166 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 178, + 247 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 269, + 271 + ], + [ + 272, + 274 + ], + [ + 275, + 276 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 282, + 284 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ], + [ + 292, + 293 + ], + [ + 294, + 295 + ], + [ + 296, + 297 + ], + [ + 298, + 299 + ], + [ + 301, + 302 + ], + [ + 303, + 305 + ], + [ + 307, + 308 + ], + [ + 310, + 311 + ], + [ + 314, + 315 + ], + [ + 319, + 322 + ], + [ + 323, + 327 + ], + [ + 330, + 334 + ], + [ + 337, + 340 + ], + [ + 341, + 346 + ], + [ + 347, + 348 + ], + [ + 351, + 353 + ], + [ + 354, + 356 + ], + [ + 357, + 359 + ], + [ + 360, + 362 + ], + [ + 363, + 365 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 377, + 378 + ], + [ + 386, + 387 + ], + [ + 393, + 404 + ], + [ + 407, + 409 + ], + [ + 411, + 412 + ], + [ + 413, + 414 + ], + [ + 418, + 419 + ], + [ + 420, + 422 + ], + [ + 424, + 425 + ], + [ + 426, + 428 + ], + [ + 429, + 431 + ], + [ + 432, + 433 + ], + [ + 435, + 436 + ] + ] + } + }, + { + "filename": "libvips/include/vips/vector.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 59, + 66 + ], + [ + 67, + 74 + ], + [ + 81, + 88 + ], + [ + 92, + 101 + ], + [ + 117, + 181 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 62, + 63 + ], + [ + 70, + 71 + ], + [ + 84, + 85 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 132, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 148 + ], + [ + 149, + 151 + ], + [ + 152, + 153 + ], + [ + 155, + 156 + ], + [ + 158, + 159 + ], + [ + 161, + 163 + ], + [ + 164, + 166 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 177, + 178 + ] + ] + } + }, + { + "filename": "libvips/include/vips/video.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 39, + 50 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 43 + ], + [ + 44, + 45 + ], + [ + 46, + 47 + ] + ] + } + }, + { + "filename": "libvips/include/vips/vips.h", + "line_filter": { + "diff_chunks": [ + [ + 52, + 80 + ], + [ + 145, + 193 + ] + ], + "lines_added": [ + [ + 55, + 71 + ], + [ + 76, + 77 + ], + [ + 148, + 160 + ], + [ + 162, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ] + ] + } + }, + { + "filename": "libvips/include/vips/vips7compat.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 43, + 90 + ], + [ + 213, + 284 + ], + [ + 291, + 298 + ], + [ + 299, + 379 + ], + [ + 396, + 408 + ], + [ + 412, + 546 + ], + [ + 553, + 581 + ], + [ + 655, + 1062 + ], + [ + 1063, + 1177 + ], + [ + 1182, + 1579 + ], + [ + 1581, + 1590 + ], + [ + 1612, + 1659 + ], + [ + 1668, + 1671 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 46, + 47 + ], + [ + 48, + 51 + ], + [ + 52, + 55 + ], + [ + 56, + 59 + ], + [ + 60, + 63 + ], + [ + 64, + 67 + ], + [ + 68, + 71 + ], + [ + 72, + 75 + ], + [ + 76, + 79 + ], + [ + 80, + 83 + ], + [ + 84, + 87 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 221, + 223 + ], + [ + 229, + 233 + ], + [ + 236, + 237 + ], + [ + 241, + 242 + ], + [ + 246, + 247 + ], + [ + 251, + 252 + ], + [ + 256, + 257 + ], + [ + 261, + 262 + ], + [ + 266, + 267 + ], + [ + 268, + 270 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 276, + 277 + ], + [ + 280, + 281 + ], + [ + 294, + 295 + ], + [ + 302, + 303 + ], + [ + 305, + 306 + ], + [ + 308, + 310 + ], + [ + 311, + 313 + ], + [ + 317, + 319 + ], + [ + 320, + 341 + ], + [ + 342, + 344 + ], + [ + 345, + 347 + ], + [ + 349, + 350 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 362, + 363 + ], + [ + 364, + 365 + ], + [ + 367, + 368 + ], + [ + 369, + 370 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 375, + 376 + ], + [ + 399, + 400 + ], + [ + 402, + 403 + ], + [ + 404, + 405 + ], + [ + 415, + 426 + ], + [ + 430, + 457 + ], + [ + 458, + 462 + ], + [ + 464, + 465 + ], + [ + 467, + 505 + ], + [ + 510, + 512 + ], + [ + 513, + 515 + ], + [ + 516, + 518 + ], + [ + 519, + 521 + ], + [ + 522, + 524 + ], + [ + 525, + 527 + ], + [ + 528, + 535 + ], + [ + 541, + 543 + ], + [ + 556, + 557 + ], + [ + 558, + 559 + ], + [ + 563, + 564 + ], + [ + 568, + 569 + ], + [ + 570, + 571 + ], + [ + 572, + 573 + ], + [ + 574, + 575 + ], + [ + 576, + 578 + ], + [ + 658, + 659 + ], + [ + 660, + 661 + ], + [ + 662, + 663 + ], + [ + 664, + 665 + ], + [ + 666, + 667 + ], + [ + 668, + 669 + ], + [ + 670, + 671 + ], + [ + 672, + 673 + ], + [ + 674, + 675 + ], + [ + 676, + 677 + ], + [ + 678, + 679 + ], + [ + 680, + 681 + ], + [ + 682, + 683 + ], + [ + 684, + 685 + ], + [ + 686, + 687 + ], + [ + 688, + 689 + ], + [ + 690, + 694 + ], + [ + 696, + 697 + ], + [ + 698, + 699 + ], + [ + 700, + 701 + ], + [ + 702, + 703 + ], + [ + 704, + 705 + ], + [ + 706, + 707 + ], + [ + 708, + 709 + ], + [ + 710, + 711 + ], + [ + 712, + 713 + ], + [ + 714, + 715 + ], + [ + 717, + 718 + ], + [ + 719, + 720 + ], + [ + 721, + 722 + ], + [ + 724, + 725 + ], + [ + 726, + 727 + ], + [ + 728, + 729 + ], + [ + 730, + 731 + ], + [ + 732, + 733 + ], + [ + 734, + 735 + ], + [ + 737, + 738 + ], + [ + 739, + 740 + ], + [ + 741, + 742 + ], + [ + 743, + 744 + ], + [ + 745, + 746 + ], + [ + 747, + 748 + ], + [ + 749, + 750 + ], + [ + 751, + 752 + ], + [ + 753, + 754 + ], + [ + 756, + 757 + ], + [ + 758, + 759 + ], + [ + 760, + 761 + ], + [ + 762, + 763 + ], + [ + 765, + 766 + ], + [ + 767, + 768 + ], + [ + 769, + 770 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ], + [ + 776, + 777 + ], + [ + 778, + 779 + ], + [ + 781, + 782 + ], + [ + 783, + 784 + ], + [ + 785, + 786 + ], + [ + 787, + 788 + ], + [ + 789, + 790 + ], + [ + 791, + 792 + ], + [ + 793, + 794 + ], + [ + 795, + 796 + ], + [ + 797, + 798 + ], + [ + 799, + 800 + ], + [ + 801, + 802 + ], + [ + 803, + 804 + ], + [ + 806, + 807 + ], + [ + 808, + 809 + ], + [ + 811, + 812 + ], + [ + 814, + 815 + ], + [ + 817, + 818 + ], + [ + 820, + 822 + ], + [ + 823, + 825 + ], + [ + 827, + 828 + ], + [ + 829, + 832 + ], + [ + 833, + 835 + ], + [ + 836, + 838 + ], + [ + 839, + 840 + ], + [ + 841, + 842 + ], + [ + 843, + 844 + ], + [ + 845, + 847 + ], + [ + 848, + 849 + ], + [ + 850, + 851 + ], + [ + 852, + 853 + ], + [ + 854, + 855 + ], + [ + 856, + 857 + ], + [ + 858, + 859 + ], + [ + 860, + 862 + ], + [ + 863, + 864 + ], + [ + 865, + 866 + ], + [ + 867, + 869 + ], + [ + 870, + 871 + ], + [ + 872, + 873 + ], + [ + 874, + 875 + ], + [ + 876, + 877 + ], + [ + 878, + 879 + ], + [ + 880, + 881 + ], + [ + 882, + 883 + ], + [ + 884, + 885 + ], + [ + 886, + 887 + ], + [ + 888, + 889 + ], + [ + 890, + 891 + ], + [ + 892, + 893 + ], + [ + 894, + 895 + ], + [ + 896, + 897 + ], + [ + 898, + 899 + ], + [ + 901, + 902 + ], + [ + 903, + 905 + ], + [ + 906, + 907 + ], + [ + 908, + 909 + ], + [ + 910, + 911 + ], + [ + 912, + 913 + ], + [ + 914, + 916 + ], + [ + 917, + 919 + ], + [ + 920, + 921 + ], + [ + 922, + 923 + ], + [ + 924, + 926 + ], + [ + 927, + 928 + ], + [ + 929, + 930 + ], + [ + 931, + 932 + ], + [ + 933, + 934 + ], + [ + 936, + 937 + ], + [ + 939, + 940 + ], + [ + 941, + 942 + ], + [ + 943, + 944 + ], + [ + 946, + 947 + ], + [ + 948, + 951 + ], + [ + 953, + 954 + ], + [ + 955, + 956 + ], + [ + 957, + 958 + ], + [ + 959, + 960 + ], + [ + 961, + 962 + ], + [ + 964, + 965 + ], + [ + 966, + 967 + ], + [ + 968, + 969 + ], + [ + 971, + 972 + ], + [ + 973, + 974 + ], + [ + 976, + 977 + ], + [ + 978, + 979 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 985, + 986 + ], + [ + 987, + 988 + ], + [ + 990, + 991 + ], + [ + 993, + 994 + ], + [ + 995, + 996 + ], + [ + 998, + 1000 + ], + [ + 1002, + 1003 + ], + [ + 1004, + 1005 + ], + [ + 1006, + 1008 + ], + [ + 1009, + 1011 + ], + [ + 1012, + 1014 + ], + [ + 1016, + 1017 + ], + [ + 1018, + 1019 + ], + [ + 1020, + 1021 + ], + [ + 1022, + 1024 + ], + [ + 1025, + 1026 + ], + [ + 1027, + 1028 + ], + [ + 1029, + 1030 + ], + [ + 1031, + 1032 + ], + [ + 1033, + 1034 + ], + [ + 1035, + 1036 + ], + [ + 1037, + 1038 + ], + [ + 1039, + 1040 + ], + [ + 1041, + 1042 + ], + [ + 1043, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1047, + 1048 + ], + [ + 1049, + 1050 + ], + [ + 1051, + 1052 + ], + [ + 1053, + 1054 + ], + [ + 1056, + 1057 + ], + [ + 1058, + 1059 + ], + [ + 1066, + 1067 + ], + [ + 1068, + 1069 + ], + [ + 1071, + 1072 + ], + [ + 1073, + 1074 + ], + [ + 1080, + 1081 + ], + [ + 1083, + 1084 + ], + [ + 1088, + 1090 + ], + [ + 1091, + 1092 + ], + [ + 1093, + 1095 + ], + [ + 1096, + 1097 + ], + [ + 1099, + 1100 + ], + [ + 1101, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1105, + 1106 + ], + [ + 1107, + 1108 + ], + [ + 1110, + 1111 + ], + [ + 1112, + 1113 + ], + [ + 1114, + 1115 + ], + [ + 1116, + 1117 + ], + [ + 1119, + 1120 + ], + [ + 1122, + 1123 + ], + [ + 1127, + 1128 + ], + [ + 1130, + 1131 + ], + [ + 1132, + 1133 + ], + [ + 1134, + 1135 + ], + [ + 1136, + 1137 + ], + [ + 1138, + 1139 + ], + [ + 1140, + 1141 + ], + [ + 1142, + 1143 + ], + [ + 1144, + 1145 + ], + [ + 1146, + 1147 + ], + [ + 1148, + 1149 + ], + [ + 1150, + 1151 + ], + [ + 1152, + 1153 + ], + [ + 1154, + 1155 + ], + [ + 1156, + 1157 + ], + [ + 1158, + 1159 + ], + [ + 1160, + 1162 + ], + [ + 1163, + 1164 + ], + [ + 1165, + 1166 + ], + [ + 1167, + 1168 + ], + [ + 1170, + 1172 + ], + [ + 1173, + 1174 + ], + [ + 1185, + 1186 + ], + [ + 1187, + 1188 + ], + [ + 1190, + 1192 + ], + [ + 1193, + 1194 + ], + [ + 1195, + 1196 + ], + [ + 1198, + 1200 + ], + [ + 1202, + 1203 + ], + [ + 1204, + 1205 + ], + [ + 1207, + 1208 + ], + [ + 1209, + 1210 + ], + [ + 1211, + 1212 + ], + [ + 1214, + 1215 + ], + [ + 1217, + 1219 + ], + [ + 1220, + 1222 + ], + [ + 1224, + 1225 + ], + [ + 1226, + 1227 + ], + [ + 1229, + 1230 + ], + [ + 1231, + 1232 + ], + [ + 1233, + 1234 + ], + [ + 1236, + 1240 + ], + [ + 1242, + 1264 + ], + [ + 1268, + 1287 + ], + [ + 1291, + 1292 + ], + [ + 1293, + 1295 + ], + [ + 1297, + 1298 + ], + [ + 1299, + 1300 + ], + [ + 1301, + 1302 + ], + [ + 1304, + 1305 + ], + [ + 1306, + 1307 + ], + [ + 1308, + 1309 + ], + [ + 1310, + 1311 + ], + [ + 1313, + 1314 + ], + [ + 1315, + 1316 + ], + [ + 1317, + 1318 + ], + [ + 1319, + 1320 + ], + [ + 1322, + 1323 + ], + [ + 1324, + 1325 + ], + [ + 1327, + 1329 + ], + [ + 1331, + 1333 + ], + [ + 1334, + 1335 + ], + [ + 1336, + 1338 + ], + [ + 1339, + 1341 + ], + [ + 1343, + 1346 + ], + [ + 1347, + 1349 + ], + [ + 1350, + 1352 + ], + [ + 1354, + 1355 + ], + [ + 1357, + 1358 + ], + [ + 1359, + 1361 + ], + [ + 1362, + 1364 + ], + [ + 1366, + 1367 + ], + [ + 1368, + 1369 + ], + [ + 1371, + 1373 + ], + [ + 1375, + 1376 + ], + [ + 1377, + 1378 + ], + [ + 1379, + 1380 + ], + [ + 1381, + 1382 + ], + [ + 1383, + 1384 + ], + [ + 1385, + 1386 + ], + [ + 1388, + 1389 + ], + [ + 1390, + 1391 + ], + [ + 1392, + 1393 + ], + [ + 1395, + 1396 + ], + [ + 1398, + 1399 + ], + [ + 1400, + 1401 + ], + [ + 1403, + 1405 + ], + [ + 1407, + 1409 + ], + [ + 1410, + 1411 + ], + [ + 1413, + 1414 + ], + [ + 1415, + 1417 + ], + [ + 1418, + 1419 + ], + [ + 1421, + 1422 + ], + [ + 1424, + 1425 + ], + [ + 1429, + 1430 + ], + [ + 1431, + 1432 + ], + [ + 1433, + 1434 + ], + [ + 1437, + 1438 + ], + [ + 1439, + 1440 + ], + [ + 1441, + 1442 + ], + [ + 1444, + 1445 + ], + [ + 1446, + 1447 + ], + [ + 1452, + 1453 + ], + [ + 1455, + 1456 + ], + [ + 1458, + 1459 + ], + [ + 1461, + 1462 + ], + [ + 1463, + 1464 + ], + [ + 1465, + 1467 + ], + [ + 1468, + 1469 + ], + [ + 1473, + 1474 + ], + [ + 1475, + 1477 + ], + [ + 1478, + 1479 + ], + [ + 1480, + 1481 + ], + [ + 1482, + 1484 + ], + [ + 1486, + 1487 + ], + [ + 1488, + 1489 + ], + [ + 1490, + 1492 + ], + [ + 1494, + 1495 + ], + [ + 1496, + 1498 + ], + [ + 1500, + 1501 + ], + [ + 1503, + 1504 + ], + [ + 1505, + 1506 + ], + [ + 1508, + 1509 + ], + [ + 1511, + 1512 + ], + [ + 1513, + 1514 + ], + [ + 1516, + 1517 + ], + [ + 1518, + 1519 + ], + [ + 1520, + 1522 + ], + [ + 1524, + 1525 + ], + [ + 1526, + 1527 + ], + [ + 1529, + 1531 + ], + [ + 1532, + 1533 + ], + [ + 1535, + 1536 + ], + [ + 1538, + 1539 + ], + [ + 1540, + 1541 + ], + [ + 1543, + 1544 + ], + [ + 1545, + 1546 + ], + [ + 1548, + 1549 + ], + [ + 1550, + 1556 + ], + [ + 1557, + 1558 + ], + [ + 1559, + 1562 + ], + [ + 1564, + 1576 + ], + [ + 1584, + 1585 + ], + [ + 1586, + 1587 + ], + [ + 1615, + 1616 + ], + [ + 1618, + 1619 + ], + [ + 1620, + 1621 + ], + [ + 1623, + 1627 + ], + [ + 1629, + 1630 + ], + [ + 1631, + 1632 + ], + [ + 1633, + 1634 + ], + [ + 1636, + 1637 + ], + [ + 1641, + 1642 + ], + [ + 1644, + 1646 + ], + [ + 1647, + 1649 + ], + [ + 1650, + 1652 + ], + [ + 1653, + 1654 + ], + [ + 1655, + 1656 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/buf.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 52, + 60 + ], + [ + 73, + 80 + ], + [ + 92, + 105 + ], + [ + 109, + 121 + ], + [ + 125, + 141 + ], + [ + 144, + 160 + ], + [ + 170, + 188 + ], + [ + 193, + 218 + ], + [ + 221, + 233 + ], + [ + 234, + 244 + ], + [ + 249, + 276 + ], + [ + 277, + 284 + ], + [ + 286, + 304 + ], + [ + 305, + 319 + ], + [ + 320, + 339 + ], + [ + 342, + 383 + ], + [ + 385, + 405 + ], + [ + 412, + 439 + ], + [ + 442, + 481 + ], + [ + 484, + 500 + ], + [ + 505, + 520 + ], + [ + 521, + 648 + ], + [ + 651, + 666 + ], + [ + 669, + 701 + ], + [ + 702, + 734 + ], + [ + 735, + 754 + ], + [ + 757, + 766 + ], + [ + 769, + 778 + ], + [ + 781, + 788 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 55, + 57 + ], + [ + 76, + 77 + ], + [ + 95, + 96 + ], + [ + 101, + 102 + ], + [ + 112, + 113 + ], + [ + 117, + 118 + ], + [ + 128, + 129 + ], + [ + 130, + 132 + ], + [ + 134, + 135 + ], + [ + 137, + 138 + ], + [ + 147, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 156, + 157 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 181, + 182 + ], + [ + 183, + 185 + ], + [ + 196, + 197 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 208 + ], + [ + 214, + 215 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 229, + 230 + ], + [ + 237, + 238 + ], + [ + 239, + 241 + ], + [ + 252, + 253 + ], + [ + 256, + 257 + ], + [ + 263, + 267 + ], + [ + 270, + 273 + ], + [ + 280, + 281 + ], + [ + 289, + 290 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 300, + 301 + ], + [ + 308, + 310 + ], + [ + 313, + 314 + ], + [ + 315, + 316 + ], + [ + 323, + 325 + ], + [ + 328, + 329 + ], + [ + 335, + 336 + ], + [ + 345, + 346 + ], + [ + 349, + 350 + ], + [ + 351, + 353 + ], + [ + 355, + 358 + ], + [ + 359, + 360 + ], + [ + 364, + 366 + ], + [ + 367, + 368 + ], + [ + 371, + 373 + ], + [ + 376, + 377 + ], + [ + 379, + 380 + ], + [ + 388, + 389 + ], + [ + 392, + 393 + ], + [ + 394, + 399 + ], + [ + 401, + 402 + ], + [ + 415, + 416 + ], + [ + 420, + 422 + ], + [ + 425, + 427 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 432, + 433 + ], + [ + 435, + 436 + ], + [ + 445, + 446 + ], + [ + 449, + 450 + ], + [ + 454, + 457 + ], + [ + 458, + 459 + ], + [ + 465, + 466 + ], + [ + 467, + 468 + ], + [ + 471, + 472 + ], + [ + 475, + 476 + ], + [ + 477, + 478 + ], + [ + 487, + 488 + ], + [ + 491, + 492 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 508, + 509 + ], + [ + 513, + 514 + ], + [ + 515, + 517 + ], + [ + 524, + 526 + ], + [ + 528, + 529 + ], + [ + 531, + 533 + ], + [ + 534, + 535 + ], + [ + 536, + 537 + ], + [ + 539, + 542 + ], + [ + 545, + 546 + ], + [ + 548, + 550 + ], + [ + 554, + 556 + ], + [ + 560, + 562 + ], + [ + 566, + 568 + ], + [ + 572, + 574 + ], + [ + 577, + 579 + ], + [ + 583, + 584 + ], + [ + 585, + 588 + ], + [ + 592, + 593 + ], + [ + 595, + 596 + ], + [ + 601, + 603 + ], + [ + 605, + 606 + ], + [ + 610, + 613 + ], + [ + 615, + 616 + ], + [ + 620, + 623 + ], + [ + 625, + 626 + ], + [ + 630, + 633 + ], + [ + 635, + 636 + ], + [ + 640, + 645 + ], + [ + 654, + 655 + ], + [ + 657, + 660 + ], + [ + 662, + 663 + ], + [ + 672, + 673 + ], + [ + 676, + 677 + ], + [ + 678, + 679 + ], + [ + 681, + 682 + ], + [ + 685, + 686 + ], + [ + 689, + 690 + ], + [ + 693, + 694 + ], + [ + 697, + 698 + ], + [ + 705, + 706 + ], + [ + 708, + 709 + ], + [ + 711, + 714 + ], + [ + 720, + 722 + ], + [ + 723, + 724 + ], + [ + 726, + 727 + ], + [ + 730, + 731 + ], + [ + 738, + 739 + ], + [ + 740, + 741 + ], + [ + 743, + 744 + ], + [ + 747, + 748 + ], + [ + 750, + 751 + ], + [ + 760, + 761 + ], + [ + 762, + 763 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ], + [ + 784, + 785 + ], + [ + 786, + 787 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/buffer.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 8, + 15 + ], + [ + 18, + 25 + ], + [ + 29, + 57 + ], + [ + 79, + 279 + ], + [ + 281, + 418 + ], + [ + 421, + 520 + ], + [ + 522, + 690 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 11, + 12 + ], + [ + 21, + 22 + ], + [ + 32, + 33 + ], + [ + 34, + 38 + ], + [ + 39, + 48 + ], + [ + 53, + 54 + ], + [ + 82, + 83 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 95, + 96 + ], + [ + 97, + 107 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 115, + 117 + ], + [ + 118, + 120 + ], + [ + 122, + 124 + ], + [ + 127, + 128 + ], + [ + 129, + 132 + ], + [ + 133, + 135 + ], + [ + 138, + 139 + ], + [ + 141, + 143 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 156, + 157 + ], + [ + 158, + 166 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 177, + 178 + ], + [ + 181, + 185 + ], + [ + 188, + 194 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 213 + ], + [ + 216, + 217 + ], + [ + 221, + 222 + ], + [ + 223, + 225 + ], + [ + 227, + 228 + ], + [ + 230, + 231 + ], + [ + 235, + 244 + ], + [ + 249, + 250 + ], + [ + 252, + 254 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 271, + 272 + ], + [ + 275, + 276 + ], + [ + 284, + 293 + ], + [ + 295, + 296 + ], + [ + 299, + 300 + ], + [ + 303, + 307 + ], + [ + 309, + 310 + ], + [ + 315, + 316 + ], + [ + 319, + 320 + ], + [ + 321, + 323 + ], + [ + 324, + 325 + ], + [ + 326, + 327 + ], + [ + 329, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 335 + ], + [ + 336, + 337 + ], + [ + 342, + 343 + ], + [ + 347, + 352 + ], + [ + 354, + 355 + ], + [ + 359, + 360 + ], + [ + 364, + 366 + ], + [ + 370, + 374 + ], + [ + 378, + 379 + ], + [ + 381, + 385 + ], + [ + 389, + 390 + ], + [ + 392, + 393 + ], + [ + 394, + 395 + ], + [ + 398, + 401 + ], + [ + 403, + 408 + ], + [ + 409, + 410 + ], + [ + 413, + 415 + ], + [ + 424, + 425 + ], + [ + 427, + 432 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 442, + 444 + ], + [ + 446, + 447 + ], + [ + 450, + 453 + ], + [ + 454, + 457 + ], + [ + 462, + 464 + ], + [ + 468, + 469 + ], + [ + 473, + 474 + ], + [ + 475, + 477 + ], + [ + 480, + 481 + ], + [ + 482, + 484 + ], + [ + 485, + 488 + ], + [ + 490, + 491 + ], + [ + 496, + 497 + ], + [ + 501, + 503 + ], + [ + 504, + 506 + ], + [ + 507, + 510 + ], + [ + 516, + 517 + ], + [ + 525, + 529 + ], + [ + 532, + 535 + ], + [ + 537, + 538 + ], + [ + 541, + 542 + ], + [ + 544, + 545 + ], + [ + 551, + 553 + ], + [ + 555, + 556 + ], + [ + 559, + 560 + ], + [ + 561, + 562 + ], + [ + 565, + 566 + ], + [ + 568, + 569 + ], + [ + 572, + 576 + ], + [ + 577, + 578 + ], + [ + 580, + 581 + ], + [ + 584, + 585 + ], + [ + 588, + 589 + ], + [ + 591, + 592 + ], + [ + 595, + 597 + ], + [ + 598, + 599 + ], + [ + 605, + 606 + ], + [ + 609, + 611 + ], + [ + 614, + 617 + ], + [ + 620, + 623 + ], + [ + 627, + 632 + ], + [ + 634, + 635 + ], + [ + 639, + 642 + ], + [ + 643, + 644 + ], + [ + 647, + 648 + ], + [ + 652, + 654 + ], + [ + 655, + 656 + ], + [ + 661, + 662 + ], + [ + 663, + 665 + ], + [ + 668, + 670 + ], + [ + 672, + 673 + ], + [ + 676, + 677 + ], + [ + 681, + 682 + ], + [ + 685, + 688 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/cache.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 73, + 83 + ], + [ + 132, + 377 + ], + [ + 380, + 498 + ], + [ + 501, + 657 + ], + [ + 658, + 693 + ], + [ + 696, + 881 + ], + [ + 884, + 928 + ], + [ + 937, + 968 + ], + [ + 969, + 988 + ], + [ + 990, + 1027 + ], + [ + 1029, + 1043 + ], + [ + 1045, + 1063 + ], + [ + 1066, + 1076 + ], + [ + 1081, + 1108 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 135, + 136 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 148, + 170 + ], + [ + 171, + 173 + ], + [ + 174, + 175 + ], + [ + 176, + 178 + ], + [ + 179, + 180 + ], + [ + 181, + 183 + ], + [ + 184, + 185 + ], + [ + 186, + 188 + ], + [ + 189, + 190 + ], + [ + 191, + 193 + ], + [ + 194, + 195 + ], + [ + 196, + 198 + ], + [ + 199, + 200 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 209 + ], + [ + 214, + 216 + ], + [ + 217, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 231, + 233 + ], + [ + 235, + 237 + ], + [ + 238, + 241 + ], + [ + 242, + 244 + ], + [ + 249, + 294 + ], + [ + 295, + 296 + ], + [ + 297, + 306 + ], + [ + 307, + 309 + ], + [ + 315, + 318 + ], + [ + 319, + 326 + ], + [ + 327, + 329 + ], + [ + 330, + 331 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 343, + 344 + ], + [ + 345, + 356 + ], + [ + 358, + 359 + ], + [ + 364, + 365 + ], + [ + 366, + 367 + ], + [ + 371, + 374 + ], + [ + 383, + 384 + ], + [ + 387, + 388 + ], + [ + 391, + 392 + ], + [ + 395, + 403 + ], + [ + 408, + 409 + ], + [ + 410, + 412 + ], + [ + 416, + 418 + ], + [ + 421, + 422 + ], + [ + 423, + 430 + ], + [ + 433, + 434 + ], + [ + 438, + 440 + ], + [ + 441, + 443 + ], + [ + 444, + 449 + ], + [ + 450, + 451 + ], + [ + 454, + 455 + ], + [ + 458, + 461 + ], + [ + 462, + 463 + ], + [ + 466, + 467 + ], + [ + 470, + 471 + ], + [ + 474, + 475 + ], + [ + 479, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 489, + 490 + ], + [ + 491, + 495 + ], + [ + 504, + 505 + ], + [ + 506, + 507 + ], + [ + 510, + 511 + ], + [ + 514, + 515 + ], + [ + 518, + 519 + ], + [ + 520, + 521 + ], + [ + 523, + 524 + ], + [ + 528, + 530 + ], + [ + 534, + 536 + ], + [ + 538, + 539 + ], + [ + 542, + 543 + ], + [ + 545, + 547 + ], + [ + 549, + 552 + ], + [ + 557, + 558 + ], + [ + 560, + 561 + ], + [ + 563, + 565 + ], + [ + 567, + 568 + ], + [ + 569, + 571 + ], + [ + 574, + 576 + ], + [ + 577, + 578 + ], + [ + 581, + 582 + ], + [ + 585, + 586 + ], + [ + 587, + 588 + ], + [ + 590, + 591 + ], + [ + 595, + 597 + ], + [ + 599, + 600 + ], + [ + 603, + 604 + ], + [ + 606, + 607 + ], + [ + 613, + 614 + ], + [ + 617, + 619 + ], + [ + 621, + 622 + ], + [ + 624, + 626 + ], + [ + 628, + 632 + ], + [ + 635, + 637 + ], + [ + 639, + 641 + ], + [ + 647, + 648 + ], + [ + 649, + 650 + ], + [ + 652, + 654 + ], + [ + 661, + 663 + ], + [ + 667, + 669 + ], + [ + 672, + 673 + ], + [ + 674, + 675 + ], + [ + 680, + 681 + ], + [ + 684, + 688 + ], + [ + 689, + 690 + ], + [ + 699, + 700 + ], + [ + 702, + 703 + ], + [ + 705, + 706 + ], + [ + 707, + 708 + ], + [ + 710, + 711 + ], + [ + 717, + 719 + ], + [ + 720, + 721 + ], + [ + 723, + 724 + ], + [ + 727, + 729 + ], + [ + 730, + 732 + ], + [ + 735, + 736 + ], + [ + 740, + 741 + ], + [ + 745, + 747 + ], + [ + 748, + 750 + ], + [ + 751, + 752 + ], + [ + 757, + 758 + ], + [ + 761, + 762 + ], + [ + 763, + 768 + ], + [ + 769, + 771 + ], + [ + 773, + 774 + ], + [ + 776, + 777 + ], + [ + 783, + 784 + ], + [ + 789, + 790 + ], + [ + 794, + 796 + ], + [ + 798, + 800 + ], + [ + 802, + 803 + ], + [ + 806, + 810 + ], + [ + 812, + 813 + ], + [ + 816, + 820 + ], + [ + 823, + 824 + ], + [ + 827, + 828 + ], + [ + 830, + 831 + ], + [ + 833, + 834 + ], + [ + 840, + 841 + ], + [ + 843, + 844 + ], + [ + 845, + 846 + ], + [ + 847, + 848 + ], + [ + 850, + 852 + ], + [ + 854, + 855 + ], + [ + 858, + 861 + ], + [ + 865, + 868 + ], + [ + 869, + 871 + ], + [ + 873, + 875 + ], + [ + 877, + 878 + ], + [ + 887, + 888 + ], + [ + 894, + 895 + ], + [ + 898, + 899 + ], + [ + 901, + 903 + ], + [ + 905, + 906 + ], + [ + 907, + 908 + ], + [ + 910, + 911 + ], + [ + 915, + 916 + ], + [ + 918, + 920 + ], + [ + 921, + 922 + ], + [ + 924, + 925 + ], + [ + 940, + 941 + ], + [ + 946, + 947 + ], + [ + 948, + 950 + ], + [ + 951, + 952 + ], + [ + 954, + 955 + ], + [ + 961, + 962 + ], + [ + 964, + 965 + ], + [ + 972, + 973 + ], + [ + 979, + 980 + ], + [ + 981, + 982 + ], + [ + 984, + 985 + ], + [ + 993, + 994 + ], + [ + 998, + 999 + ], + [ + 1000, + 1001 + ], + [ + 1006, + 1007 + ], + [ + 1011, + 1012 + ], + [ + 1015, + 1016 + ], + [ + 1018, + 1020 + ], + [ + 1021, + 1022 + ], + [ + 1023, + 1024 + ], + [ + 1032, + 1033 + ], + [ + 1037, + 1038 + ], + [ + 1039, + 1040 + ], + [ + 1048, + 1051 + ], + [ + 1052, + 1053 + ], + [ + 1057, + 1058 + ], + [ + 1059, + 1060 + ], + [ + 1069, + 1070 + ], + [ + 1072, + 1073 + ], + [ + 1084, + 1085 + ], + [ + 1087, + 1088 + ], + [ + 1094, + 1095 + ], + [ + 1101, + 1102 + ], + [ + 1104, + 1105 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/connection.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 59, + 172 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 62, + 63 + ], + [ + 66, + 68 + ], + [ + 69, + 71 + ], + [ + 73, + 74 + ], + [ + 80, + 82 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 92, + 95 + ], + [ + 97, + 100 + ], + [ + 104, + 107 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 125, + 128 + ], + [ + 129, + 131 + ], + [ + 132, + 135 + ], + [ + 136, + 138 + ], + [ + 141, + 142 + ], + [ + 148, + 150 + ], + [ + 155, + 156 + ], + [ + 157, + 158 + ], + [ + 160, + 162 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/dbuf.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 48, + 55 + ], + [ + 59, + 90 + ], + [ + 92, + 105 + ], + [ + 113, + 128 + ], + [ + 131, + 158 + ], + [ + 160, + 181 + ], + [ + 183, + 214 + ], + [ + 216, + 267 + ], + [ + 271, + 278 + ], + [ + 284, + 295 + ], + [ + 298, + 358 + ], + [ + 363, + 372 + ], + [ + 375, + 394 + ], + [ + 399, + 425 + ], + [ + 429, + 446 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 51, + 52 + ], + [ + 62, + 63 + ], + [ + 65, + 66 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 76, + 80 + ], + [ + 86, + 87 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 116, + 117 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 134, + 135 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 147, + 148 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ], + [ + 163, + 165 + ], + [ + 168, + 169 + ], + [ + 170, + 172 + ], + [ + 173, + 174 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 186, + 188 + ], + [ + 191, + 192 + ], + [ + 196, + 199 + ], + [ + 200, + 203 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 226, + 227 + ], + [ + 230, + 232 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 243, + 245 + ], + [ + 246, + 249 + ], + [ + 250, + 253 + ], + [ + 254, + 257 + ], + [ + 258, + 261 + ], + [ + 263, + 264 + ], + [ + 274, + 275 + ], + [ + 287, + 288 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 301, + 303 + ], + [ + 305, + 306 + ], + [ + 309, + 310 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 319, + 320 + ], + [ + 323, + 325 + ], + [ + 328, + 331 + ], + [ + 335, + 341 + ], + [ + 344, + 345 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 378, + 380 + ], + [ + 383, + 384 + ], + [ + 385, + 387 + ], + [ + 390, + 391 + ], + [ + 402, + 403 + ], + [ + 407, + 408 + ], + [ + 411, + 412 + ], + [ + 415, + 416 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 432, + 433 + ], + [ + 437, + 438 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 444, + 445 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/error.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 20, + 48 + ], + [ + 76, + 83 + ], + [ + 109, + 119 + ], + [ + 132, + 139 + ], + [ + 142, + 172 + ], + [ + 175, + 210 + ], + [ + 212, + 223 + ], + [ + 225, + 264 + ], + [ + 266, + 284 + ], + [ + 290, + 329 + ], + [ + 335, + 348 + ], + [ + 356, + 379 + ], + [ + 380, + 422 + ], + [ + 423, + 452 + ], + [ + 453, + 460 + ], + [ + 462, + 476 + ], + [ + 486, + 504 + ], + [ + 505, + 512 + ], + [ + 514, + 532 + ], + [ + 543, + 558 + ], + [ + 568, + 582 + ], + [ + 593, + 607 + ], + [ + 617, + 632 + ], + [ + 634, + 641 + ], + [ + 643, + 658 + ], + [ + 670, + 687 + ], + [ + 699, + 713 + ], + [ + 723, + 737 + ], + [ + 747, + 761 + ], + [ + 763, + 770 + ], + [ + 772, + 788 + ], + [ + 799, + 815 + ], + [ + 825, + 839 + ], + [ + 849, + 864 + ], + [ + 874, + 893 + ], + [ + 903, + 919 + ], + [ + 928, + 946 + ], + [ + 955, + 973 + ], + [ + 984, + 999 + ], + [ + 1000, + 1007 + ], + [ + 1009, + 1025 + ], + [ + 1036, + 1051 + ], + [ + 1054, + 1061 + ], + [ + 1063, + 1079 + ], + [ + 1090, + 1105 + ], + [ + 1116, + 1131 + ], + [ + 1133, + 1154 + ], + [ + 1165, + 1200 + ], + [ + 1202, + 1239 + ], + [ + 1241, + 1279 + ], + [ + 1283, + 1300 + ], + [ + 1310, + 1324 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 79, + 80 + ], + [ + 112, + 113 + ], + [ + 115, + 116 + ], + [ + 135, + 136 + ], + [ + 145, + 146 + ], + [ + 147, + 149 + ], + [ + 150, + 151 + ], + [ + 156, + 157 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 163, + 165 + ], + [ + 168, + 169 + ], + [ + 178, + 179 + ], + [ + 182, + 185 + ], + [ + 186, + 187 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 197, + 198 + ], + [ + 201, + 205 + ], + [ + 206, + 207 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 228, + 230 + ], + [ + 232, + 243 + ], + [ + 245, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 257 + ], + [ + 260, + 261 + ], + [ + 269, + 272 + ], + [ + 274, + 277 + ], + [ + 280, + 281 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ], + [ + 298, + 312 + ], + [ + 313, + 316 + ], + [ + 317, + 321 + ], + [ + 325, + 326 + ], + [ + 338, + 339 + ], + [ + 342, + 345 + ], + [ + 359, + 360 + ], + [ + 363, + 365 + ], + [ + 368, + 371 + ], + [ + 372, + 373 + ], + [ + 383, + 384 + ], + [ + 386, + 387 + ], + [ + 388, + 392 + ], + [ + 397, + 398 + ], + [ + 404, + 406 + ], + [ + 407, + 410 + ], + [ + 413, + 414 + ], + [ + 418, + 419 + ], + [ + 426, + 430 + ], + [ + 432, + 433 + ], + [ + 434, + 437 + ], + [ + 438, + 439 + ], + [ + 441, + 442 + ], + [ + 445, + 446 + ], + [ + 448, + 449 + ], + [ + 456, + 457 + ], + [ + 465, + 466 + ], + [ + 467, + 470 + ], + [ + 472, + 473 + ], + [ + 489, + 490 + ], + [ + 493, + 498 + ], + [ + 500, + 501 + ], + [ + 508, + 509 + ], + [ + 517, + 518 + ], + [ + 521, + 522 + ], + [ + 523, + 526 + ], + [ + 528, + 529 + ], + [ + 546, + 547 + ], + [ + 548, + 552 + ], + [ + 554, + 555 + ], + [ + 571, + 572 + ], + [ + 573, + 576 + ], + [ + 578, + 579 + ], + [ + 596, + 597 + ], + [ + 598, + 601 + ], + [ + 603, + 604 + ], + [ + 620, + 621 + ], + [ + 622, + 626 + ], + [ + 628, + 629 + ], + [ + 637, + 638 + ], + [ + 646, + 647 + ], + [ + 648, + 652 + ], + [ + 654, + 655 + ], + [ + 673, + 674 + ], + [ + 675, + 681 + ], + [ + 683, + 684 + ], + [ + 702, + 703 + ], + [ + 704, + 707 + ], + [ + 709, + 710 + ], + [ + 726, + 727 + ], + [ + 728, + 731 + ], + [ + 733, + 734 + ], + [ + 750, + 751 + ], + [ + 752, + 755 + ], + [ + 757, + 758 + ], + [ + 766, + 767 + ], + [ + 775, + 776 + ], + [ + 777, + 782 + ], + [ + 784, + 785 + ], + [ + 802, + 803 + ], + [ + 804, + 809 + ], + [ + 811, + 812 + ], + [ + 828, + 829 + ], + [ + 830, + 833 + ], + [ + 835, + 836 + ], + [ + 852, + 853 + ], + [ + 854, + 858 + ], + [ + 860, + 861 + ], + [ + 877, + 878 + ], + [ + 879, + 880 + ], + [ + 882, + 887 + ], + [ + 889, + 890 + ], + [ + 906, + 907 + ], + [ + 908, + 913 + ], + [ + 915, + 916 + ], + [ + 931, + 932 + ], + [ + 933, + 934 + ], + [ + 935, + 940 + ], + [ + 942, + 943 + ], + [ + 958, + 959 + ], + [ + 960, + 961 + ], + [ + 963, + 967 + ], + [ + 969, + 970 + ], + [ + 987, + 988 + ], + [ + 989, + 993 + ], + [ + 995, + 996 + ], + [ + 1003, + 1004 + ], + [ + 1012, + 1013 + ], + [ + 1014, + 1019 + ], + [ + 1021, + 1022 + ], + [ + 1039, + 1040 + ], + [ + 1041, + 1045 + ], + [ + 1047, + 1048 + ], + [ + 1057, + 1058 + ], + [ + 1066, + 1067 + ], + [ + 1068, + 1073 + ], + [ + 1075, + 1076 + ], + [ + 1093, + 1094 + ], + [ + 1095, + 1099 + ], + [ + 1101, + 1102 + ], + [ + 1119, + 1120 + ], + [ + 1121, + 1125 + ], + [ + 1127, + 1128 + ], + [ + 1136, + 1137 + ], + [ + 1143, + 1144 + ], + [ + 1145, + 1148 + ], + [ + 1150, + 1151 + ], + [ + 1168, + 1169 + ], + [ + 1172, + 1183 + ], + [ + 1184, + 1187 + ], + [ + 1188, + 1189 + ], + [ + 1194, + 1195 + ], + [ + 1196, + 1197 + ], + [ + 1205, + 1206 + ], + [ + 1207, + 1212 + ], + [ + 1213, + 1218 + ], + [ + 1220, + 1221 + ], + [ + 1223, + 1225 + ], + [ + 1226, + 1227 + ], + [ + 1231, + 1232 + ], + [ + 1235, + 1236 + ], + [ + 1244, + 1245 + ], + [ + 1250, + 1254 + ], + [ + 1255, + 1259 + ], + [ + 1261, + 1266 + ], + [ + 1267, + 1268 + ], + [ + 1269, + 1270 + ], + [ + 1275, + 1276 + ], + [ + 1286, + 1287 + ], + [ + 1288, + 1294 + ], + [ + 1296, + 1297 + ], + [ + 1313, + 1314 + ], + [ + 1315, + 1320 + ], + [ + 1322, + 1323 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/gate.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 49, + 63 + ], + [ + 64, + 73 + ], + [ + 76, + 376 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 52, + 53 + ], + [ + 59, + 60 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 79, + 80 + ], + [ + 85, + 87 + ], + [ + 93, + 94 + ], + [ + 96, + 97 + ], + [ + 102, + 103 + ], + [ + 106, + 111 + ], + [ + 114, + 115 + ], + [ + 116, + 123 + ], + [ + 127, + 128 + ], + [ + 132, + 133 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 148 + ], + [ + 151, + 152 + ], + [ + 154, + 158 + ], + [ + 159, + 160 + ], + [ + 163, + 164 + ], + [ + 165, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 175 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 182, + 185 + ], + [ + 188, + 189 + ], + [ + 190, + 192 + ], + [ + 195, + 196 + ], + [ + 200, + 201 + ], + [ + 204, + 205 + ], + [ + 206, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 217, + 219 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 234 + ], + [ + 235, + 236 + ], + [ + 239, + 240 + ], + [ + 245, + 246 + ], + [ + 247, + 248 + ], + [ + 249, + 256 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 271, + 272 + ], + [ + 275, + 276 + ], + [ + 277, + 280 + ], + [ + 281, + 283 + ], + [ + 287, + 288 + ], + [ + 291, + 292 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 308, + 313 + ], + [ + 315, + 317 + ], + [ + 320, + 321 + ], + [ + 325, + 326 + ], + [ + 329, + 330 + ], + [ + 331, + 332 + ], + [ + 336, + 341 + ], + [ + 343, + 345 + ], + [ + 348, + 349 + ], + [ + 355, + 356 + ], + [ + 359, + 360 + ], + [ + 362, + 364 + ], + [ + 366, + 367 + ], + [ + 370, + 373 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/generate.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 57, + 85 + ], + [ + 115, + 126 + ], + [ + 129, + 198 + ], + [ + 203, + 240 + ], + [ + 245, + 252 + ], + [ + 259, + 300 + ], + [ + 305, + 336 + ], + [ + 338, + 348 + ], + [ + 349, + 360 + ], + [ + 363, + 378 + ], + [ + 381, + 431 + ], + [ + 438, + 449 + ], + [ + 456, + 469 + ], + [ + 471, + 496 + ], + [ + 498, + 511 + ], + [ + 513, + 537 + ], + [ + 546, + 553 + ], + [ + 554, + 579 + ], + [ + 598, + 605 + ], + [ + 622, + 646 + ], + [ + 653, + 781 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 60, + 66 + ], + [ + 67, + 71 + ], + [ + 72, + 76 + ], + [ + 81, + 82 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 132, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 142 + ], + [ + 145, + 147 + ], + [ + 151, + 152 + ], + [ + 153, + 155 + ], + [ + 156, + 158 + ], + [ + 159, + 163 + ], + [ + 166, + 168 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 176, + 177 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 186, + 190 + ], + [ + 191, + 193 + ], + [ + 194, + 195 + ], + [ + 206, + 207 + ], + [ + 212, + 214 + ], + [ + 216, + 218 + ], + [ + 219, + 221 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 228, + 229 + ], + [ + 231, + 233 + ], + [ + 235, + 237 + ], + [ + 248, + 249 + ], + [ + 262, + 263 + ], + [ + 267, + 268 + ], + [ + 269, + 271 + ], + [ + 272, + 273 + ], + [ + 274, + 275 + ], + [ + 276, + 279 + ], + [ + 280, + 281 + ], + [ + 286, + 289 + ], + [ + 295, + 297 + ], + [ + 308, + 311 + ], + [ + 315, + 325 + ], + [ + 329, + 333 + ], + [ + 341, + 342 + ], + [ + 344, + 345 + ], + [ + 352, + 353 + ], + [ + 356, + 357 + ], + [ + 366, + 367 + ], + [ + 372, + 375 + ], + [ + 384, + 385 + ], + [ + 386, + 389 + ], + [ + 390, + 392 + ], + [ + 393, + 394 + ], + [ + 400, + 401 + ], + [ + 406, + 408 + ], + [ + 413, + 417 + ], + [ + 418, + 421 + ], + [ + 427, + 428 + ], + [ + 441, + 442 + ], + [ + 445, + 446 + ], + [ + 459, + 460 + ], + [ + 463, + 464 + ], + [ + 465, + 466 + ], + [ + 474, + 475 + ], + [ + 480, + 481 + ], + [ + 484, + 485 + ], + [ + 487, + 490 + ], + [ + 492, + 493 + ], + [ + 501, + 502 + ], + [ + 507, + 508 + ], + [ + 516, + 517 + ], + [ + 521, + 523 + ], + [ + 526, + 530 + ], + [ + 533, + 534 + ], + [ + 549, + 550 + ], + [ + 557, + 559 + ], + [ + 560, + 561 + ], + [ + 564, + 566 + ], + [ + 569, + 573 + ], + [ + 575, + 576 + ], + [ + 601, + 602 + ], + [ + 625, + 626 + ], + [ + 631, + 632 + ], + [ + 634, + 637 + ], + [ + 640, + 641 + ], + [ + 642, + 643 + ], + [ + 656, + 657 + ], + [ + 659, + 660 + ], + [ + 662, + 663 + ], + [ + 667, + 668 + ], + [ + 672, + 673 + ], + [ + 674, + 675 + ], + [ + 676, + 677 + ], + [ + 678, + 679 + ], + [ + 680, + 682 + ], + [ + 683, + 687 + ], + [ + 692, + 756 + ], + [ + 759, + 761 + ], + [ + 764, + 780 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/ginputsource.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 33 + ], + [ + 51, + 61 + ], + [ + 62, + 250 + ], + [ + 253, + 263 + ], + [ + 266, + 281 + ], + [ + 288, + 297 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 54, + 55 + ], + [ + 56, + 58 + ], + [ + 65, + 67 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 81, + 83 + ], + [ + 84, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 115, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 127, + 129 + ], + [ + 130, + 131 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 148, + 150 + ], + [ + 151, + 152 + ], + [ + 153, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 164 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 176, + 178 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 188, + 190 + ], + [ + 191, + 192 + ], + [ + 195, + 196 + ], + [ + 197, + 199 + ], + [ + 200, + 202 + ], + [ + 203, + 205 + ], + [ + 206, + 207 + ], + [ + 210, + 212 + ], + [ + 213, + 214 + ], + [ + 217, + 218 + ], + [ + 219, + 221 + ], + [ + 222, + 225 + ], + [ + 226, + 229 + ], + [ + 231, + 232 + ], + [ + 235, + 237 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 246, + 247 + ], + [ + 256, + 257 + ], + [ + 258, + 260 + ], + [ + 269, + 274 + ], + [ + 277, + 278 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/header.c", + "line_filter": { + "diff_chunks": [ + [ + 42, + 70 + ], + [ + 100, + 109 + ], + [ + 112, + 120 + ], + [ + 130, + 138 + ], + [ + 139, + 146 + ], + [ + 155, + 211 + ], + [ + 213, + 225 + ], + [ + 230, + 327 + ], + [ + 329, + 376 + ], + [ + 380, + 389 + ], + [ + 392, + 401 + ], + [ + 404, + 413 + ], + [ + 416, + 425 + ], + [ + 428, + 465 + ], + [ + 469, + 540 + ], + [ + 541, + 551 + ], + [ + 554, + 563 + ], + [ + 569, + 656 + ], + [ + 663, + 670 + ], + [ + 671, + 689 + ], + [ + 690, + 775 + ], + [ + 776, + 810 + ], + [ + 813, + 822 + ], + [ + 825, + 834 + ], + [ + 838, + 847 + ], + [ + 848, + 904 + ], + [ + 910, + 929 + ], + [ + 938, + 955 + ], + [ + 961, + 979 + ], + [ + 985, + 1026 + ], + [ + 1031, + 1043 + ], + [ + 1048, + 1067 + ], + [ + 1084, + 1162 + ], + [ + 1175, + 1182 + ], + [ + 1183, + 1205 + ], + [ + 1223, + 1233 + ], + [ + 1235, + 1287 + ], + [ + 1289, + 1300 + ], + [ + 1307, + 1316 + ], + [ + 1324, + 1375 + ], + [ + 1377, + 1419 + ], + [ + 1428, + 1454 + ], + [ + 1459, + 1476 + ], + [ + 1478, + 1486 + ], + [ + 1489, + 1568 + ], + [ + 1577, + 1615 + ], + [ + 1627, + 1648 + ], + [ + 1650, + 1675 + ], + [ + 1676, + 1714 + ], + [ + 1716, + 1852 + ], + [ + 1858, + 1965 + ], + [ + 1966, + 2018 + ], + [ + 2020, + 2074 + ], + [ + 2075, + 2114 + ], + [ + 2115, + 2132 + ], + [ + 2133, + 2156 + ], + [ + 2165, + 2172 + ], + [ + 2175, + 2216 + ], + [ + 2227, + 2252 + ], + [ + 2257, + 2264 + ], + [ + 2265, + 2284 + ] + ], + "lines_added": [ + [ + 45, + 46 + ], + [ + 47, + 51 + ], + [ + 52, + 61 + ], + [ + 66, + 67 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 115, + 117 + ], + [ + 133, + 135 + ], + [ + 142, + 143 + ], + [ + 158, + 170 + ], + [ + 176, + 187 + ], + [ + 190, + 191 + ], + [ + 192, + 194 + ], + [ + 198, + 208 + ], + [ + 216, + 218 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 233, + 235 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 245, + 246 + ], + [ + 249, + 252 + ], + [ + 253, + 256 + ], + [ + 257, + 260 + ], + [ + 261, + 262 + ], + [ + 265, + 266 + ], + [ + 267, + 270 + ], + [ + 271, + 274 + ], + [ + 275, + 278 + ], + [ + 281, + 282 + ], + [ + 283, + 288 + ], + [ + 292, + 293 + ], + [ + 295, + 297 + ], + [ + 298, + 303 + ], + [ + 305, + 308 + ], + [ + 309, + 312 + ], + [ + 315, + 316 + ], + [ + 319, + 320 + ], + [ + 322, + 324 + ], + [ + 332, + 334 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 341, + 343 + ], + [ + 345, + 347 + ], + [ + 348, + 352 + ], + [ + 354, + 355 + ], + [ + 360, + 361 + ], + [ + 362, + 364 + ], + [ + 367, + 368 + ], + [ + 369, + 373 + ], + [ + 383, + 384 + ], + [ + 385, + 386 + ], + [ + 395, + 396 + ], + [ + 397, + 398 + ], + [ + 407, + 408 + ], + [ + 409, + 410 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 431, + 432 + ], + [ + 433, + 434 + ], + [ + 435, + 436 + ], + [ + 438, + 439 + ], + [ + 441, + 442 + ], + [ + 444, + 445 + ], + [ + 447, + 448 + ], + [ + 450, + 451 + ], + [ + 454, + 455 + ], + [ + 458, + 459 + ], + [ + 461, + 462 + ], + [ + 472, + 473 + ], + [ + 477, + 478 + ], + [ + 483, + 484 + ], + [ + 485, + 489 + ], + [ + 492, + 495 + ], + [ + 500, + 502 + ], + [ + 505, + 512 + ], + [ + 515, + 517 + ], + [ + 522, + 523 + ], + [ + 526, + 527 + ], + [ + 530, + 532 + ], + [ + 535, + 537 + ], + [ + 544, + 545 + ], + [ + 547, + 548 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ], + [ + 572, + 573 + ], + [ + 574, + 575 + ], + [ + 580, + 581 + ], + [ + 582, + 583 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 591, + 592 + ], + [ + 596, + 597 + ], + [ + 599, + 600 + ], + [ + 603, + 604 + ], + [ + 606, + 607 + ], + [ + 610, + 611 + ], + [ + 612, + 613 + ], + [ + 615, + 616 + ], + [ + 619, + 620 + ], + [ + 622, + 623 + ], + [ + 626, + 627 + ], + [ + 629, + 630 + ], + [ + 634, + 635 + ], + [ + 637, + 638 + ], + [ + 641, + 642 + ], + [ + 644, + 645 + ], + [ + 649, + 650 + ], + [ + 652, + 653 + ], + [ + 666, + 667 + ], + [ + 674, + 675 + ], + [ + 680, + 681 + ], + [ + 685, + 686 + ], + [ + 693, + 694 + ], + [ + 698, + 699 + ], + [ + 704, + 705 + ], + [ + 710, + 712 + ], + [ + 715, + 717 + ], + [ + 720, + 728 + ], + [ + 731, + 733 + ], + [ + 735, + 737 + ], + [ + 740, + 742 + ], + [ + 745, + 747 + ], + [ + 750, + 751 + ], + [ + 753, + 756 + ], + [ + 759, + 762 + ], + [ + 765, + 767 + ], + [ + 770, + 772 + ], + [ + 779, + 781 + ], + [ + 782, + 783 + ], + [ + 789, + 790 + ], + [ + 792, + 793 + ], + [ + 794, + 795 + ], + [ + 801, + 802 + ], + [ + 804, + 805 + ], + [ + 806, + 807 + ], + [ + 816, + 817 + ], + [ + 818, + 819 + ], + [ + 828, + 829 + ], + [ + 830, + 831 + ], + [ + 841, + 842 + ], + [ + 843, + 844 + ], + [ + 851, + 852 + ], + [ + 856, + 857 + ], + [ + 858, + 859 + ], + [ + 865, + 867 + ], + [ + 871, + 872 + ], + [ + 876, + 878 + ], + [ + 879, + 880 + ], + [ + 886, + 888 + ], + [ + 892, + 893 + ], + [ + 897, + 899 + ], + [ + 900, + 901 + ], + [ + 913, + 914 + ], + [ + 917, + 920 + ], + [ + 922, + 924 + ], + [ + 925, + 926 + ], + [ + 941, + 942 + ], + [ + 945, + 947 + ], + [ + 948, + 950 + ], + [ + 951, + 952 + ], + [ + 964, + 965 + ], + [ + 966, + 967 + ], + [ + 968, + 971 + ], + [ + 972, + 974 + ], + [ + 975, + 976 + ], + [ + 988, + 989 + ], + [ + 992, + 994 + ], + [ + 995, + 997 + ], + [ + 998, + 999 + ], + [ + 1005, + 1006 + ], + [ + 1011, + 1012 + ], + [ + 1015, + 1018 + ], + [ + 1019, + 1021 + ], + [ + 1022, + 1023 + ], + [ + 1034, + 1035 + ], + [ + 1036, + 1037 + ], + [ + 1038, + 1040 + ], + [ + 1051, + 1052 + ], + [ + 1058, + 1059 + ], + [ + 1060, + 1062 + ], + [ + 1063, + 1064 + ], + [ + 1087, + 1093 + ], + [ + 1094, + 1095 + ], + [ + 1099, + 1100 + ], + [ + 1103, + 1105 + ], + [ + 1108, + 1109 + ], + [ + 1111, + 1113 + ], + [ + 1114, + 1119 + ], + [ + 1121, + 1122 + ], + [ + 1124, + 1125 + ], + [ + 1127, + 1128 + ], + [ + 1130, + 1131 + ], + [ + 1133, + 1134 + ], + [ + 1135, + 1136 + ], + [ + 1139, + 1144 + ], + [ + 1146, + 1147 + ], + [ + 1152, + 1154 + ], + [ + 1158, + 1159 + ], + [ + 1178, + 1179 + ], + [ + 1186, + 1187 + ], + [ + 1188, + 1191 + ], + [ + 1194, + 1197 + ], + [ + 1198, + 1199 + ], + [ + 1201, + 1202 + ], + [ + 1226, + 1227 + ], + [ + 1228, + 1230 + ], + [ + 1238, + 1242 + ], + [ + 1243, + 1244 + ], + [ + 1249, + 1252 + ], + [ + 1254, + 1255 + ], + [ + 1262, + 1263 + ], + [ + 1264, + 1265 + ], + [ + 1269, + 1279 + ], + [ + 1280, + 1282 + ], + [ + 1283, + 1284 + ], + [ + 1292, + 1293 + ], + [ + 1296, + 1297 + ], + [ + 1310, + 1311 + ], + [ + 1312, + 1313 + ], + [ + 1327, + 1328 + ], + [ + 1332, + 1334 + ], + [ + 1335, + 1336 + ], + [ + 1338, + 1340 + ], + [ + 1341, + 1345 + ], + [ + 1348, + 1349 + ], + [ + 1351, + 1353 + ], + [ + 1354, + 1358 + ], + [ + 1361, + 1365 + ], + [ + 1366, + 1367 + ], + [ + 1369, + 1370 + ], + [ + 1371, + 1372 + ], + [ + 1380, + 1381 + ], + [ + 1387, + 1389 + ], + [ + 1393, + 1394 + ], + [ + 1395, + 1396 + ], + [ + 1398, + 1400 + ], + [ + 1402, + 1403 + ], + [ + 1405, + 1407 + ], + [ + 1409, + 1412 + ], + [ + 1413, + 1414 + ], + [ + 1415, + 1416 + ], + [ + 1431, + 1432 + ], + [ + 1437, + 1439 + ], + [ + 1441, + 1443 + ], + [ + 1445, + 1448 + ], + [ + 1450, + 1451 + ], + [ + 1462, + 1463 + ], + [ + 1468, + 1471 + ], + [ + 1472, + 1473 + ], + [ + 1481, + 1483 + ], + [ + 1492, + 1493 + ], + [ + 1498, + 1499 + ], + [ + 1501, + 1504 + ], + [ + 1505, + 1507 + ], + [ + 1509, + 1513 + ], + [ + 1514, + 1515 + ], + [ + 1518, + 1519 + ], + [ + 1524, + 1525 + ], + [ + 1528, + 1529 + ], + [ + 1532, + 1533 + ], + [ + 1535, + 1536 + ], + [ + 1542, + 1543 + ], + [ + 1549, + 1550 + ], + [ + 1551, + 1553 + ], + [ + 1559, + 1561 + ], + [ + 1562, + 1563 + ], + [ + 1564, + 1565 + ], + [ + 1580, + 1582 + ], + [ + 1585, + 1588 + ], + [ + 1591, + 1593 + ], + [ + 1594, + 1595 + ], + [ + 1596, + 1602 + ], + [ + 1603, + 1606 + ], + [ + 1607, + 1608 + ], + [ + 1609, + 1610 + ], + [ + 1611, + 1612 + ], + [ + 1630, + 1632 + ], + [ + 1635, + 1639 + ], + [ + 1641, + 1642 + ], + [ + 1644, + 1645 + ], + [ + 1653, + 1654 + ], + [ + 1660, + 1662 + ], + [ + 1665, + 1669 + ], + [ + 1671, + 1672 + ], + [ + 1679, + 1680 + ], + [ + 1685, + 1687 + ], + [ + 1692, + 1693 + ], + [ + 1694, + 1695 + ], + [ + 1697, + 1698 + ], + [ + 1701, + 1702 + ], + [ + 1703, + 1704 + ], + [ + 1706, + 1708 + ], + [ + 1710, + 1711 + ], + [ + 1719, + 1720 + ], + [ + 1723, + 1724 + ], + [ + 1728, + 1730 + ], + [ + 1733, + 1737 + ], + [ + 1739, + 1740 + ], + [ + 1742, + 1743 + ], + [ + 1748, + 1749 + ], + [ + 1750, + 1751 + ], + [ + 1757, + 1758 + ], + [ + 1761, + 1765 + ], + [ + 1766, + 1767 + ], + [ + 1769, + 1770 + ], + [ + 1775, + 1776 + ], + [ + 1782, + 1783 + ], + [ + 1786, + 1790 + ], + [ + 1792, + 1793 + ], + [ + 1798, + 1799 + ], + [ + 1800, + 1801 + ], + [ + 1807, + 1808 + ], + [ + 1811, + 1815 + ], + [ + 1816, + 1817 + ], + [ + 1819, + 1820 + ], + [ + 1825, + 1826 + ], + [ + 1832, + 1833 + ], + [ + 1836, + 1840 + ], + [ + 1842, + 1843 + ], + [ + 1848, + 1849 + ], + [ + 1861, + 1863 + ], + [ + 1866, + 1868 + ], + [ + 1869, + 1870 + ], + [ + 1872, + 1873 + ], + [ + 1875, + 1877 + ], + [ + 1879, + 1881 + ], + [ + 1882, + 1884 + ], + [ + 1885, + 1886 + ], + [ + 1888, + 1889 + ], + [ + 1890, + 1891 + ], + [ + 1893, + 1894 + ], + [ + 1899, + 1900 + ], + [ + 1906, + 1907 + ], + [ + 1910, + 1914 + ], + [ + 1916, + 1917 + ], + [ + 1922, + 1923 + ], + [ + 1926, + 1928 + ], + [ + 1934, + 1936 + ], + [ + 1940, + 1942 + ], + [ + 1946, + 1948 + ], + [ + 1950, + 1955 + ], + [ + 1956, + 1958 + ], + [ + 1959, + 1960 + ], + [ + 1961, + 1962 + ], + [ + 1969, + 1970 + ], + [ + 1972, + 1973 + ], + [ + 1976, + 1978 + ], + [ + 1981, + 1982 + ], + [ + 1983, + 1984 + ], + [ + 1986, + 1987 + ], + [ + 1992, + 1993 + ], + [ + 1996, + 1997 + ], + [ + 2003, + 2006 + ], + [ + 2009, + 2013 + ], + [ + 2014, + 2015 + ], + [ + 2023, + 2024 + ], + [ + 2028, + 2030 + ], + [ + 2033, + 2037 + ], + [ + 2039, + 2040 + ], + [ + 2046, + 2047 + ], + [ + 2052, + 2053 + ], + [ + 2059, + 2062 + ], + [ + 2065, + 2069 + ], + [ + 2070, + 2071 + ], + [ + 2078, + 2079 + ], + [ + 2080, + 2081 + ], + [ + 2086, + 2088 + ], + [ + 2091, + 2095 + ], + [ + 2097, + 2098 + ], + [ + 2104, + 2105 + ], + [ + 2110, + 2111 + ], + [ + 2118, + 2120 + ], + [ + 2123, + 2127 + ], + [ + 2128, + 2129 + ], + [ + 2136, + 2137 + ], + [ + 2138, + 2139 + ], + [ + 2144, + 2146 + ], + [ + 2149, + 2153 + ], + [ + 2168, + 2169 + ], + [ + 2178, + 2179 + ], + [ + 2184, + 2186 + ], + [ + 2189, + 2190 + ], + [ + 2192, + 2196 + ], + [ + 2199, + 2202 + ], + [ + 2204, + 2207 + ], + [ + 2209, + 2211 + ], + [ + 2212, + 2213 + ], + [ + 2230, + 2234 + ], + [ + 2236, + 2237 + ], + [ + 2238, + 2239 + ], + [ + 2240, + 2243 + ], + [ + 2245, + 2247 + ], + [ + 2248, + 2249 + ], + [ + 2260, + 2261 + ], + [ + 2268, + 2269 + ], + [ + 2270, + 2272 + ], + [ + 2273, + 2274 + ], + [ + 2279, + 2280 + ], + [ + 2281, + 2282 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/image.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 24, + 52 + ], + [ + 74, + 120 + ], + [ + 130, + 143 + ], + [ + 151, + 204 + ], + [ + 205, + 217 + ], + [ + 227, + 245 + ], + [ + 251, + 287 + ], + [ + 335, + 351 + ], + [ + 354, + 381 + ], + [ + 382, + 389 + ], + [ + 393, + 400 + ], + [ + 404, + 446 + ], + [ + 449, + 469 + ], + [ + 471, + 514 + ], + [ + 516, + 528 + ], + [ + 533, + 553 + ], + [ + 555, + 737 + ], + [ + 742, + 786 + ], + [ + 790, + 829 + ], + [ + 832, + 1001 + ], + [ + 1003, + 1069 + ], + [ + 1075, + 1082 + ], + [ + 1091, + 1098 + ], + [ + 1101, + 1217 + ], + [ + 1224, + 1240 + ], + [ + 1241, + 1303 + ], + [ + 1306, + 1343 + ], + [ + 1349, + 1395 + ], + [ + 1397, + 1404 + ], + [ + 1407, + 1435 + ], + [ + 1437, + 1459 + ], + [ + 1466, + 1610 + ], + [ + 1612, + 1633 + ], + [ + 1637, + 1651 + ], + [ + 1652, + 1671 + ], + [ + 1673, + 1689 + ], + [ + 1691, + 1788 + ], + [ + 1789, + 1798 + ], + [ + 1799, + 1822 + ], + [ + 1823, + 1846 + ], + [ + 1850, + 1891 + ], + [ + 1896, + 1923 + ], + [ + 1927, + 1955 + ], + [ + 1956, + 1965 + ], + [ + 1972, + 1979 + ], + [ + 1980, + 2008 + ], + [ + 2025, + 2034 + ], + [ + 2035, + 2052 + ], + [ + 2053, + 2082 + ], + [ + 2087, + 2123 + ], + [ + 2126, + 2136 + ], + [ + 2137, + 2152 + ], + [ + 2155, + 2180 + ], + [ + 2182, + 2205 + ], + [ + 2208, + 2268 + ], + [ + 2274, + 2295 + ], + [ + 2296, + 2314 + ], + [ + 2318, + 2332 + ], + [ + 2333, + 2348 + ], + [ + 2356, + 2386 + ], + [ + 2395, + 2406 + ], + [ + 2417, + 2461 + ], + [ + 2471, + 2480 + ], + [ + 2490, + 2505 + ], + [ + 2507, + 2524 + ], + [ + 2526, + 2548 + ], + [ + 2549, + 2611 + ], + [ + 2620, + 2645 + ], + [ + 2648, + 2664 + ], + [ + 2667, + 2685 + ], + [ + 2691, + 2755 + ], + [ + 2757, + 2824 + ], + [ + 2825, + 2843 + ], + [ + 2844, + 2863 + ], + [ + 2864, + 2908 + ], + [ + 2909, + 2944 + ], + [ + 2952, + 2969 + ], + [ + 2971, + 2983 + ], + [ + 2993, + 3015 + ], + [ + 3017, + 3059 + ], + [ + 3062, + 3075 + ], + [ + 3076, + 3099 + ], + [ + 3105, + 3121 + ], + [ + 3123, + 3130 + ], + [ + 3132, + 3187 + ], + [ + 3198, + 3283 + ], + [ + 3284, + 3326 + ], + [ + 3335, + 3342 + ], + [ + 3345, + 3356 + ], + [ + 3357, + 3383 + ], + [ + 3384, + 3425 + ], + [ + 3431, + 3448 + ], + [ + 3449, + 3464 + ], + [ + 3470, + 3492 + ], + [ + 3495, + 3532 + ], + [ + 3537, + 3544 + ], + [ + 3547, + 3574 + ], + [ + 3576, + 3592 + ], + [ + 3596, + 3627 + ], + [ + 3628, + 3652 + ], + [ + 3659, + 3669 + ], + [ + 3677, + 3695 + ], + [ + 3702, + 3731 + ], + [ + 3734, + 3746 + ], + [ + 3749, + 3775 + ], + [ + 3779, + 3805 + ], + [ + 3809, + 3821 + ], + [ + 3824, + 3835 + ], + [ + 3839, + 3851 + ], + [ + 3853, + 3865 + ], + [ + 3869, + 3881 + ], + [ + 3883, + 3895 + ], + [ + 3901, + 3926 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 27, + 33 + ], + [ + 34, + 38 + ], + [ + 39, + 43 + ], + [ + 48, + 49 + ], + [ + 77, + 79 + ], + [ + 80, + 81 + ], + [ + 87, + 88 + ], + [ + 92, + 113 + ], + [ + 115, + 117 + ], + [ + 133, + 134 + ], + [ + 139, + 140 + ], + [ + 154, + 155 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 165, + 166 + ], + [ + 168, + 169 + ], + [ + 175, + 177 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 184, + 186 + ], + [ + 188, + 189 + ], + [ + 191, + 195 + ], + [ + 197, + 198 + ], + [ + 200, + 201 + ], + [ + 208, + 209 + ], + [ + 213, + 214 + ], + [ + 230, + 231 + ], + [ + 236, + 237 + ], + [ + 241, + 242 + ], + [ + 254, + 255 + ], + [ + 261, + 262 + ], + [ + 266, + 267 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 278, + 280 + ], + [ + 283, + 284 + ], + [ + 338, + 339 + ], + [ + 342, + 343 + ], + [ + 347, + 348 + ], + [ + 357, + 358 + ], + [ + 360, + 361 + ], + [ + 364, + 365 + ], + [ + 369, + 370 + ], + [ + 372, + 378 + ], + [ + 385, + 386 + ], + [ + 396, + 397 + ], + [ + 407, + 408 + ], + [ + 413, + 414 + ], + [ + 415, + 417 + ], + [ + 418, + 422 + ], + [ + 427, + 428 + ], + [ + 429, + 430 + ], + [ + 431, + 432 + ], + [ + 436, + 437 + ], + [ + 440, + 441 + ], + [ + 442, + 443 + ], + [ + 452, + 453 + ], + [ + 454, + 457 + ], + [ + 461, + 466 + ], + [ + 474, + 475 + ], + [ + 476, + 477 + ], + [ + 478, + 481 + ], + [ + 482, + 483 + ], + [ + 486, + 487 + ], + [ + 488, + 489 + ], + [ + 490, + 491 + ], + [ + 493, + 507 + ], + [ + 510, + 511 + ], + [ + 519, + 520 + ], + [ + 522, + 523 + ], + [ + 524, + 525 + ], + [ + 536, + 538 + ], + [ + 539, + 542 + ], + [ + 545, + 546 + ], + [ + 549, + 550 + ], + [ + 558, + 560 + ], + [ + 562, + 563 + ], + [ + 564, + 565 + ], + [ + 568, + 569 + ], + [ + 570, + 571 + ], + [ + 572, + 573 + ], + [ + 575, + 577 + ], + [ + 578, + 580 + ], + [ + 583, + 584 + ], + [ + 587, + 590 + ], + [ + 591, + 592 + ], + [ + 595, + 596 + ], + [ + 597, + 598 + ], + [ + 599, + 611 + ], + [ + 612, + 614 + ], + [ + 615, + 616 + ], + [ + 617, + 618 + ], + [ + 619, + 620 + ], + [ + 621, + 622 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 630, + 643 + ], + [ + 645, + 648 + ], + [ + 650, + 653 + ], + [ + 654, + 655 + ], + [ + 658, + 659 + ], + [ + 660, + 663 + ], + [ + 664, + 665 + ], + [ + 668, + 669 + ], + [ + 670, + 671 + ], + [ + 674, + 675 + ], + [ + 676, + 677 + ], + [ + 680, + 681 + ], + [ + 682, + 688 + ], + [ + 690, + 691 + ], + [ + 694, + 700 + ], + [ + 704, + 705 + ], + [ + 706, + 712 + ], + [ + 713, + 714 + ], + [ + 715, + 716 + ], + [ + 719, + 720 + ], + [ + 721, + 722 + ], + [ + 727, + 729 + ], + [ + 730, + 731 + ], + [ + 732, + 734 + ], + [ + 745, + 746 + ], + [ + 747, + 748 + ], + [ + 751, + 752 + ], + [ + 755, + 756 + ], + [ + 757, + 759 + ], + [ + 763, + 767 + ], + [ + 770, + 772 + ], + [ + 775, + 776 + ], + [ + 777, + 783 + ], + [ + 793, + 794 + ], + [ + 797, + 800 + ], + [ + 805, + 806 + ], + [ + 807, + 809 + ], + [ + 810, + 811 + ], + [ + 812, + 813 + ], + [ + 816, + 817 + ], + [ + 818, + 824 + ], + [ + 825, + 826 + ], + [ + 835, + 836 + ], + [ + 837, + 838 + ], + [ + 844, + 845 + ], + [ + 846, + 848 + ], + [ + 851, + 853 + ], + [ + 856, + 858 + ], + [ + 861, + 863 + ], + [ + 865, + 866 + ], + [ + 868, + 870 + ], + [ + 872, + 873 + ], + [ + 878, + 881 + ], + [ + 882, + 885 + ], + [ + 886, + 887 + ], + [ + 889, + 892 + ], + [ + 893, + 894 + ], + [ + 899, + 904 + ], + [ + 906, + 908 + ], + [ + 911, + 914 + ], + [ + 915, + 916 + ], + [ + 918, + 919 + ], + [ + 920, + 921 + ], + [ + 926, + 927 + ], + [ + 928, + 930 + ], + [ + 932, + 933 + ], + [ + 935, + 936 + ], + [ + 939, + 942 + ], + [ + 943, + 944 + ], + [ + 945, + 946 + ], + [ + 948, + 949 + ], + [ + 950, + 951 + ], + [ + 952, + 953 + ], + [ + 955, + 957 + ], + [ + 960, + 961 + ], + [ + 962, + 963 + ], + [ + 964, + 965 + ], + [ + 967, + 968 + ], + [ + 970, + 972 + ], + [ + 975, + 976 + ], + [ + 977, + 982 + ], + [ + 987, + 990 + ], + [ + 993, + 994 + ], + [ + 995, + 996 + ], + [ + 997, + 998 + ], + [ + 1006, + 1007 + ], + [ + 1008, + 1010 + ], + [ + 1011, + 1012 + ], + [ + 1013, + 1014 + ], + [ + 1017, + 1018 + ], + [ + 1019, + 1020 + ], + [ + 1021, + 1022 + ], + [ + 1024, + 1026 + ], + [ + 1027, + 1028 + ], + [ + 1029, + 1030 + ], + [ + 1031, + 1032 + ], + [ + 1033, + 1034 + ], + [ + 1035, + 1037 + ], + [ + 1038, + 1039 + ], + [ + 1041, + 1043 + ], + [ + 1044, + 1045 + ], + [ + 1047, + 1049 + ], + [ + 1050, + 1051 + ], + [ + 1054, + 1056 + ], + [ + 1060, + 1061 + ], + [ + 1062, + 1064 + ], + [ + 1065, + 1066 + ], + [ + 1078, + 1079 + ], + [ + 1094, + 1095 + ], + [ + 1104, + 1107 + ], + [ + 1108, + 1110 + ], + [ + 1111, + 1114 + ], + [ + 1115, + 1117 + ], + [ + 1118, + 1121 + ], + [ + 1122, + 1124 + ], + [ + 1125, + 1128 + ], + [ + 1129, + 1131 + ], + [ + 1132, + 1135 + ], + [ + 1136, + 1138 + ], + [ + 1139, + 1142 + ], + [ + 1143, + 1145 + ], + [ + 1146, + 1149 + ], + [ + 1150, + 1152 + ], + [ + 1153, + 1156 + ], + [ + 1157, + 1159 + ], + [ + 1160, + 1163 + ], + [ + 1164, + 1166 + ], + [ + 1167, + 1170 + ], + [ + 1171, + 1198 + ], + [ + 1199, + 1214 + ], + [ + 1227, + 1228 + ], + [ + 1229, + 1231 + ], + [ + 1232, + 1233 + ], + [ + 1236, + 1237 + ], + [ + 1244, + 1245 + ], + [ + 1251, + 1252 + ], + [ + 1253, + 1255 + ], + [ + 1256, + 1257 + ], + [ + 1260, + 1261 + ], + [ + 1267, + 1268 + ], + [ + 1271, + 1272 + ], + [ + 1273, + 1275 + ], + [ + 1276, + 1277 + ], + [ + 1280, + 1281 + ], + [ + 1287, + 1288 + ], + [ + 1290, + 1291 + ], + [ + 1292, + 1294 + ], + [ + 1295, + 1296 + ], + [ + 1299, + 1300 + ], + [ + 1309, + 1311 + ], + [ + 1312, + 1313 + ], + [ + 1315, + 1316 + ], + [ + 1322, + 1323 + ], + [ + 1325, + 1327 + ], + [ + 1328, + 1329 + ], + [ + 1331, + 1332 + ], + [ + 1337, + 1338 + ], + [ + 1339, + 1340 + ], + [ + 1352, + 1353 + ], + [ + 1357, + 1358 + ], + [ + 1360, + 1362 + ], + [ + 1366, + 1367 + ], + [ + 1370, + 1371 + ], + [ + 1373, + 1374 + ], + [ + 1375, + 1376 + ], + [ + 1379, + 1380 + ], + [ + 1381, + 1382 + ], + [ + 1383, + 1384 + ], + [ + 1387, + 1388 + ], + [ + 1389, + 1390 + ], + [ + 1391, + 1392 + ], + [ + 1400, + 1401 + ], + [ + 1410, + 1411 + ], + [ + 1412, + 1413 + ], + [ + 1414, + 1416 + ], + [ + 1419, + 1420 + ], + [ + 1421, + 1422 + ], + [ + 1423, + 1424 + ], + [ + 1427, + 1428 + ], + [ + 1429, + 1430 + ], + [ + 1431, + 1432 + ], + [ + 1440, + 1441 + ], + [ + 1444, + 1446 + ], + [ + 1450, + 1451 + ], + [ + 1452, + 1454 + ], + [ + 1455, + 1456 + ], + [ + 1469, + 1470 + ], + [ + 1471, + 1472 + ], + [ + 1477, + 1478 + ], + [ + 1481, + 1482 + ], + [ + 1483, + 1486 + ], + [ + 1492, + 1493 + ], + [ + 1495, + 1496 + ], + [ + 1498, + 1499 + ], + [ + 1502, + 1503 + ], + [ + 1506, + 1507 + ], + [ + 1510, + 1511 + ], + [ + 1512, + 1513 + ], + [ + 1514, + 1515 + ], + [ + 1521, + 1522 + ], + [ + 1526, + 1527 + ], + [ + 1528, + 1530 + ], + [ + 1531, + 1533 + ], + [ + 1534, + 1535 + ], + [ + 1537, + 1538 + ], + [ + 1540, + 1541 + ], + [ + 1542, + 1546 + ], + [ + 1552, + 1553 + ], + [ + 1554, + 1557 + ], + [ + 1558, + 1560 + ], + [ + 1561, + 1562 + ], + [ + 1567, + 1570 + ], + [ + 1571, + 1575 + ], + [ + 1579, + 1580 + ], + [ + 1581, + 1583 + ], + [ + 1585, + 1586 + ], + [ + 1587, + 1589 + ], + [ + 1593, + 1594 + ], + [ + 1599, + 1602 + ], + [ + 1603, + 1607 + ], + [ + 1615, + 1616 + ], + [ + 1621, + 1622 + ], + [ + 1623, + 1627 + ], + [ + 1629, + 1630 + ], + [ + 1640, + 1641 + ], + [ + 1644, + 1645 + ], + [ + 1647, + 1648 + ], + [ + 1655, + 1660 + ], + [ + 1664, + 1665 + ], + [ + 1667, + 1668 + ], + [ + 1676, + 1677 + ], + [ + 1681, + 1682 + ], + [ + 1683, + 1686 + ], + [ + 1694, + 1695 + ], + [ + 1698, + 1699 + ], + [ + 1700, + 1701 + ], + [ + 1706, + 1707 + ], + [ + 1708, + 1709 + ], + [ + 1710, + 1711 + ], + [ + 1712, + 1713 + ], + [ + 1717, + 1718 + ], + [ + 1724, + 1725 + ], + [ + 1726, + 1728 + ], + [ + 1730, + 1734 + ], + [ + 1736, + 1737 + ], + [ + 1740, + 1741 + ], + [ + 1744, + 1746 + ], + [ + 1749, + 1751 + ], + [ + 1753, + 1757 + ], + [ + 1759, + 1760 + ], + [ + 1766, + 1767 + ], + [ + 1773, + 1774 + ], + [ + 1777, + 1779 + ], + [ + 1784, + 1785 + ], + [ + 1792, + 1793 + ], + [ + 1794, + 1795 + ], + [ + 1802, + 1803 + ], + [ + 1804, + 1805 + ], + [ + 1811, + 1812 + ], + [ + 1816, + 1817 + ], + [ + 1818, + 1819 + ], + [ + 1826, + 1827 + ], + [ + 1828, + 1829 + ], + [ + 1835, + 1836 + ], + [ + 1840, + 1841 + ], + [ + 1842, + 1843 + ], + [ + 1853, + 1854 + ], + [ + 1857, + 1858 + ], + [ + 1861, + 1863 + ], + [ + 1865, + 1866 + ], + [ + 1867, + 1868 + ], + [ + 1873, + 1875 + ], + [ + 1878, + 1879 + ], + [ + 1880, + 1883 + ], + [ + 1887, + 1888 + ], + [ + 1899, + 1900 + ], + [ + 1906, + 1907 + ], + [ + 1908, + 1912 + ], + [ + 1913, + 1914 + ], + [ + 1919, + 1920 + ], + [ + 1930, + 1931 + ], + [ + 1932, + 1934 + ], + [ + 1935, + 1939 + ], + [ + 1940, + 1942 + ], + [ + 1943, + 1944 + ], + [ + 1950, + 1952 + ], + [ + 1959, + 1960 + ], + [ + 1961, + 1962 + ], + [ + 1975, + 1976 + ], + [ + 1983, + 1985 + ], + [ + 1990, + 1992 + ], + [ + 1998, + 2002 + ], + [ + 2004, + 2005 + ], + [ + 2028, + 2029 + ], + [ + 2030, + 2031 + ], + [ + 2038, + 2040 + ], + [ + 2045, + 2046 + ], + [ + 2047, + 2049 + ], + [ + 2056, + 2060 + ], + [ + 2062, + 2070 + ], + [ + 2072, + 2073 + ], + [ + 2076, + 2077 + ], + [ + 2078, + 2079 + ], + [ + 2090, + 2093 + ], + [ + 2099, + 2101 + ], + [ + 2107, + 2114 + ], + [ + 2116, + 2118 + ], + [ + 2119, + 2120 + ], + [ + 2129, + 2131 + ], + [ + 2132, + 2133 + ], + [ + 2140, + 2141 + ], + [ + 2147, + 2149 + ], + [ + 2158, + 2161 + ], + [ + 2164, + 2165 + ], + [ + 2166, + 2170 + ], + [ + 2171, + 2172 + ], + [ + 2173, + 2175 + ], + [ + 2176, + 2177 + ], + [ + 2185, + 2187 + ], + [ + 2190, + 2191 + ], + [ + 2197, + 2199 + ], + [ + 2200, + 2202 + ], + [ + 2211, + 2212 + ], + [ + 2214, + 2219 + ], + [ + 2220, + 2221 + ], + [ + 2223, + 2225 + ], + [ + 2226, + 2230 + ], + [ + 2231, + 2232 + ], + [ + 2238, + 2240 + ], + [ + 2241, + 2246 + ], + [ + 2248, + 2252 + ], + [ + 2253, + 2254 + ], + [ + 2256, + 2258 + ], + [ + 2261, + 2263 + ], + [ + 2264, + 2265 + ], + [ + 2277, + 2278 + ], + [ + 2280, + 2281 + ], + [ + 2284, + 2285 + ], + [ + 2290, + 2292 + ], + [ + 2299, + 2303 + ], + [ + 2305, + 2308 + ], + [ + 2310, + 2311 + ], + [ + 2321, + 2322 + ], + [ + 2324, + 2325 + ], + [ + 2328, + 2329 + ], + [ + 2336, + 2337 + ], + [ + 2338, + 2343 + ], + [ + 2344, + 2345 + ], + [ + 2359, + 2361 + ], + [ + 2366, + 2371 + ], + [ + 2375, + 2376 + ], + [ + 2378, + 2381 + ], + [ + 2382, + 2383 + ], + [ + 2398, + 2400 + ], + [ + 2401, + 2403 + ], + [ + 2420, + 2421 + ], + [ + 2423, + 2424 + ], + [ + 2429, + 2432 + ], + [ + 2433, + 2434 + ], + [ + 2436, + 2442 + ], + [ + 2447, + 2450 + ], + [ + 2453, + 2454 + ], + [ + 2455, + 2456 + ], + [ + 2457, + 2458 + ], + [ + 2474, + 2475 + ], + [ + 2476, + 2477 + ], + [ + 2493, + 2494 + ], + [ + 2495, + 2497 + ], + [ + 2499, + 2502 + ], + [ + 2510, + 2511 + ], + [ + 2515, + 2516 + ], + [ + 2520, + 2521 + ], + [ + 2529, + 2530 + ], + [ + 2531, + 2532 + ], + [ + 2533, + 2535 + ], + [ + 2536, + 2538 + ], + [ + 2540, + 2541 + ], + [ + 2544, + 2545 + ], + [ + 2552, + 2553 + ], + [ + 2558, + 2559 + ], + [ + 2565, + 2566 + ], + [ + 2572, + 2574 + ], + [ + 2575, + 2578 + ], + [ + 2580, + 2581 + ], + [ + 2582, + 2583 + ], + [ + 2584, + 2585 + ], + [ + 2588, + 2590 + ], + [ + 2592, + 2593 + ], + [ + 2598, + 2599 + ], + [ + 2603, + 2606 + ], + [ + 2607, + 2608 + ], + [ + 2623, + 2624 + ], + [ + 2628, + 2629 + ], + [ + 2630, + 2635 + ], + [ + 2637, + 2642 + ], + [ + 2651, + 2653 + ], + [ + 2655, + 2658 + ], + [ + 2660, + 2661 + ], + [ + 2670, + 2671 + ], + [ + 2674, + 2675 + ], + [ + 2681, + 2682 + ], + [ + 2694, + 2695 + ], + [ + 2697, + 2698 + ], + [ + 2700, + 2701 + ], + [ + 2703, + 2705 + ], + [ + 2706, + 2710 + ], + [ + 2711, + 2712 + ], + [ + 2713, + 2718 + ], + [ + 2720, + 2721 + ], + [ + 2722, + 2723 + ], + [ + 2728, + 2729 + ], + [ + 2733, + 2734 + ], + [ + 2737, + 2738 + ], + [ + 2742, + 2743 + ], + [ + 2749, + 2752 + ], + [ + 2760, + 2761 + ], + [ + 2763, + 2764 + ], + [ + 2766, + 2767 + ], + [ + 2769, + 2771 + ], + [ + 2772, + 2776 + ], + [ + 2777, + 2780 + ], + [ + 2782, + 2784 + ], + [ + 2785, + 2787 + ], + [ + 2788, + 2792 + ], + [ + 2793, + 2795 + ], + [ + 2797, + 2798 + ], + [ + 2800, + 2801 + ], + [ + 2803, + 2807 + ], + [ + 2808, + 2810 + ], + [ + 2811, + 2812 + ], + [ + 2814, + 2815 + ], + [ + 2820, + 2821 + ], + [ + 2828, + 2829 + ], + [ + 2831, + 2832 + ], + [ + 2838, + 2840 + ], + [ + 2847, + 2850 + ], + [ + 2851, + 2855 + ], + [ + 2856, + 2858 + ], + [ + 2859, + 2860 + ], + [ + 2867, + 2868 + ], + [ + 2869, + 2870 + ], + [ + 2876, + 2877 + ], + [ + 2882, + 2890 + ], + [ + 2892, + 2898 + ], + [ + 2899, + 2900 + ], + [ + 2901, + 2902 + ], + [ + 2904, + 2905 + ], + [ + 2912, + 2914 + ], + [ + 2916, + 2917 + ], + [ + 2918, + 2919 + ], + [ + 2923, + 2924 + ], + [ + 2927, + 2934 + ], + [ + 2936, + 2938 + ], + [ + 2940, + 2941 + ], + [ + 2955, + 2957 + ], + [ + 2959, + 2960 + ], + [ + 2961, + 2962 + ], + [ + 2965, + 2966 + ], + [ + 2974, + 2975 + ], + [ + 2976, + 2977 + ], + [ + 2979, + 2980 + ], + [ + 2996, + 2997 + ], + [ + 2998, + 3005 + ], + [ + 3007, + 3009 + ], + [ + 3011, + 3012 + ], + [ + 3020, + 3021 + ], + [ + 3023, + 3027 + ], + [ + 3028, + 3029 + ], + [ + 3035, + 3036 + ], + [ + 3037, + 3039 + ], + [ + 3040, + 3041 + ], + [ + 3045, + 3046 + ], + [ + 3051, + 3052 + ], + [ + 3054, + 3056 + ], + [ + 3065, + 3067 + ], + [ + 3068, + 3070 + ], + [ + 3071, + 3072 + ], + [ + 3079, + 3081 + ], + [ + 3085, + 3086 + ], + [ + 3092, + 3093 + ], + [ + 3095, + 3096 + ], + [ + 3108, + 3109 + ], + [ + 3111, + 3112 + ], + [ + 3117, + 3118 + ], + [ + 3126, + 3127 + ], + [ + 3135, + 3136 + ], + [ + 3137, + 3138 + ], + [ + 3139, + 3144 + ], + [ + 3149, + 3155 + ], + [ + 3159, + 3160 + ], + [ + 3165, + 3169 + ], + [ + 3173, + 3175 + ], + [ + 3179, + 3181 + ], + [ + 3183, + 3184 + ], + [ + 3201, + 3204 + ], + [ + 3207, + 3210 + ], + [ + 3211, + 3212 + ], + [ + 3214, + 3217 + ], + [ + 3221, + 3222 + ], + [ + 3224, + 3226 + ], + [ + 3231, + 3233 + ], + [ + 3236, + 3241 + ], + [ + 3245, + 3248 + ], + [ + 3251, + 3255 + ], + [ + 3257, + 3258 + ], + [ + 3263, + 3264 + ], + [ + 3267, + 3268 + ], + [ + 3270, + 3272 + ], + [ + 3273, + 3274 + ], + [ + 3276, + 3277 + ], + [ + 3279, + 3280 + ], + [ + 3287, + 3288 + ], + [ + 3289, + 3290 + ], + [ + 3296, + 3297 + ], + [ + 3298, + 3304 + ], + [ + 3307, + 3308 + ], + [ + 3309, + 3310 + ], + [ + 3311, + 3312 + ], + [ + 3314, + 3315 + ], + [ + 3317, + 3318 + ], + [ + 3319, + 3320 + ], + [ + 3322, + 3323 + ], + [ + 3338, + 3339 + ], + [ + 3348, + 3349 + ], + [ + 3352, + 3353 + ], + [ + 3360, + 3361 + ], + [ + 3367, + 3370 + ], + [ + 3374, + 3377 + ], + [ + 3379, + 3380 + ], + [ + 3387, + 3390 + ], + [ + 3396, + 3397 + ], + [ + 3402, + 3404 + ], + [ + 3406, + 3407 + ], + [ + 3409, + 3412 + ], + [ + 3413, + 3414 + ], + [ + 3418, + 3422 + ], + [ + 3434, + 3437 + ], + [ + 3438, + 3439 + ], + [ + 3442, + 3445 + ], + [ + 3452, + 3453 + ], + [ + 3457, + 3458 + ], + [ + 3460, + 3461 + ], + [ + 3473, + 3475 + ], + [ + 3480, + 3483 + ], + [ + 3486, + 3489 + ], + [ + 3498, + 3501 + ], + [ + 3505, + 3508 + ], + [ + 3510, + 3511 + ], + [ + 3513, + 3515 + ], + [ + 3517, + 3520 + ], + [ + 3521, + 3522 + ], + [ + 3525, + 3529 + ], + [ + 3540, + 3541 + ], + [ + 3550, + 3553 + ], + [ + 3555, + 3556 + ], + [ + 3557, + 3558 + ], + [ + 3563, + 3564 + ], + [ + 3566, + 3567 + ], + [ + 3570, + 3571 + ], + [ + 3579, + 3580 + ], + [ + 3583, + 3585 + ], + [ + 3588, + 3589 + ], + [ + 3599, + 3601 + ], + [ + 3605, + 3608 + ], + [ + 3610, + 3611 + ], + [ + 3613, + 3614 + ], + [ + 3615, + 3616 + ], + [ + 3622, + 3624 + ], + [ + 3631, + 3632 + ], + [ + 3633, + 3634 + ], + [ + 3636, + 3638 + ], + [ + 3640, + 3641 + ], + [ + 3645, + 3649 + ], + [ + 3662, + 3666 + ], + [ + 3680, + 3682 + ], + [ + 3686, + 3689 + ], + [ + 3691, + 3692 + ], + [ + 3705, + 3707 + ], + [ + 3709, + 3711 + ], + [ + 3713, + 3714 + ], + [ + 3715, + 3719 + ], + [ + 3724, + 3728 + ], + [ + 3737, + 3740 + ], + [ + 3742, + 3743 + ], + [ + 3752, + 3753 + ], + [ + 3754, + 3755 + ], + [ + 3761, + 3762 + ], + [ + 3764, + 3765 + ], + [ + 3766, + 3768 + ], + [ + 3771, + 3772 + ], + [ + 3782, + 3783 + ], + [ + 3784, + 3785 + ], + [ + 3788, + 3789 + ], + [ + 3794, + 3795 + ], + [ + 3796, + 3799 + ], + [ + 3801, + 3802 + ], + [ + 3812, + 3813 + ], + [ + 3814, + 3815 + ], + [ + 3817, + 3818 + ], + [ + 3827, + 3828 + ], + [ + 3831, + 3832 + ], + [ + 3842, + 3843 + ], + [ + 3844, + 3845 + ], + [ + 3846, + 3848 + ], + [ + 3856, + 3859 + ], + [ + 3861, + 3862 + ], + [ + 3872, + 3873 + ], + [ + 3874, + 3875 + ], + [ + 3876, + 3878 + ], + [ + 3886, + 3889 + ], + [ + 3891, + 3892 + ], + [ + 3904, + 3905 + ], + [ + 3906, + 3907 + ], + [ + 3912, + 3913 + ], + [ + 3914, + 3915 + ], + [ + 3917, + 3923 + ], + [ + 3924, + 3925 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/init.c", + "line_filter": { + "diff_chunks": [ + [ + 38, + 66 + ], + [ + 118, + 125 + ], + [ + 142, + 149 + ], + [ + 152, + 166 + ], + [ + 169, + 187 + ], + [ + 189, + 215 + ], + [ + 216, + 223 + ], + [ + 246, + 253 + ], + [ + 257, + 333 + ], + [ + 334, + 384 + ], + [ + 388, + 414 + ], + [ + 415, + 449 + ], + [ + 458, + 563 + ], + [ + 565, + 577 + ], + [ + 601, + 641 + ], + [ + 651, + 659 + ], + [ + 660, + 719 + ], + [ + 722, + 745 + ], + [ + 749, + 762 + ], + [ + 763, + 790 + ], + [ + 791, + 944 + ], + [ + 950, + 1235 + ], + [ + 1240, + 1249 + ], + [ + 1252, + 1288 + ], + [ + 1292, + 1323 + ], + [ + 1324, + 1339 + ] + ], + "lines_added": [ + [ + 41, + 57 + ], + [ + 62, + 63 + ], + [ + 121, + 122 + ], + [ + 145, + 146 + ], + [ + 155, + 156 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 172, + 173 + ], + [ + 176, + 177 + ], + [ + 180, + 182 + ], + [ + 183, + 184 + ], + [ + 192, + 195 + ], + [ + 197, + 198 + ], + [ + 202, + 203 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 219, + 220 + ], + [ + 249, + 250 + ], + [ + 260, + 261 + ], + [ + 262, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 282, + 283 + ], + [ + 284, + 287 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ], + [ + 294, + 296 + ], + [ + 297, + 298 + ], + [ + 299, + 303 + ], + [ + 309, + 312 + ], + [ + 313, + 314 + ], + [ + 320, + 323 + ], + [ + 329, + 330 + ], + [ + 337, + 338 + ], + [ + 339, + 342 + ], + [ + 345, + 352 + ], + [ + 357, + 358 + ], + [ + 361, + 362 + ], + [ + 363, + 367 + ], + [ + 369, + 371 + ], + [ + 372, + 373 + ], + [ + 377, + 378 + ], + [ + 380, + 381 + ], + [ + 391, + 392 + ], + [ + 393, + 398 + ], + [ + 400, + 403 + ], + [ + 404, + 408 + ], + [ + 410, + 411 + ], + [ + 418, + 419 + ], + [ + 425, + 426 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 435, + 436 + ], + [ + 437, + 446 + ], + [ + 461, + 462 + ], + [ + 464, + 466 + ], + [ + 469, + 470 + ], + [ + 476, + 479 + ], + [ + 480, + 481 + ], + [ + 482, + 483 + ], + [ + 486, + 497 + ], + [ + 503, + 504 + ], + [ + 505, + 506 + ], + [ + 508, + 509 + ], + [ + 514, + 515 + ], + [ + 517, + 519 + ], + [ + 521, + 522 + ], + [ + 524, + 525 + ], + [ + 527, + 529 + ], + [ + 530, + 531 + ], + [ + 534, + 535 + ], + [ + 536, + 538 + ], + [ + 539, + 540 + ], + [ + 541, + 546 + ], + [ + 547, + 551 + ], + [ + 555, + 558 + ], + [ + 559, + 560 + ], + [ + 568, + 574 + ], + [ + 604, + 605 + ], + [ + 608, + 609 + ], + [ + 614, + 616 + ], + [ + 620, + 622 + ], + [ + 623, + 625 + ], + [ + 627, + 630 + ], + [ + 636, + 638 + ], + [ + 654, + 656 + ], + [ + 663, + 664 + ], + [ + 665, + 666 + ], + [ + 667, + 668 + ], + [ + 670, + 672 + ], + [ + 675, + 677 + ], + [ + 680, + 681 + ], + [ + 682, + 683 + ], + [ + 688, + 689 + ], + [ + 694, + 695 + ], + [ + 699, + 700 + ], + [ + 705, + 706 + ], + [ + 708, + 709 + ], + [ + 711, + 713 + ], + [ + 715, + 716 + ], + [ + 725, + 726 + ], + [ + 731, + 732 + ], + [ + 733, + 734 + ], + [ + 738, + 739 + ], + [ + 741, + 742 + ], + [ + 752, + 755 + ], + [ + 756, + 759 + ], + [ + 766, + 767 + ], + [ + 773, + 776 + ], + [ + 781, + 782 + ], + [ + 786, + 787 + ], + [ + 794, + 796 + ], + [ + 799, + 800 + ], + [ + 803, + 805 + ], + [ + 806, + 807 + ], + [ + 808, + 809 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 821, + 823 + ], + [ + 824, + 825 + ], + [ + 826, + 827 + ], + [ + 830, + 832 + ], + [ + 833, + 834 + ], + [ + 835, + 836 + ], + [ + 839, + 841 + ], + [ + 842, + 843 + ], + [ + 844, + 845 + ], + [ + 848, + 850 + ], + [ + 851, + 852 + ], + [ + 853, + 854 + ], + [ + 857, + 859 + ], + [ + 860, + 861 + ], + [ + 862, + 863 + ], + [ + 866, + 867 + ], + [ + 868, + 903 + ], + [ + 904, + 906 + ], + [ + 907, + 909 + ], + [ + 910, + 926 + ], + [ + 930, + 931 + ], + [ + 933, + 934 + ], + [ + 935, + 936 + ], + [ + 938, + 939 + ], + [ + 940, + 941 + ], + [ + 953, + 954 + ], + [ + 959, + 960 + ], + [ + 963, + 965 + ], + [ + 967, + 970 + ], + [ + 972, + 973 + ], + [ + 978, + 982 + ], + [ + 985, + 996 + ], + [ + 999, + 1002 + ], + [ + 1003, + 1004 + ], + [ + 1005, + 1006 + ], + [ + 1011, + 1012 + ], + [ + 1016, + 1018 + ], + [ + 1022, + 1024 + ], + [ + 1025, + 1027 + ], + [ + 1028, + 1031 + ], + [ + 1034, + 1035 + ], + [ + 1040, + 1041 + ], + [ + 1042, + 1043 + ], + [ + 1046, + 1048 + ], + [ + 1049, + 1050 + ], + [ + 1052, + 1054 + ], + [ + 1055, + 1064 + ], + [ + 1066, + 1068 + ], + [ + 1069, + 1070 + ], + [ + 1075, + 1076 + ], + [ + 1082, + 1088 + ], + [ + 1092, + 1094 + ], + [ + 1096, + 1100 + ], + [ + 1104, + 1107 + ], + [ + 1108, + 1109 + ], + [ + 1110, + 1111 + ], + [ + 1112, + 1114 + ], + [ + 1118, + 1122 + ], + [ + 1123, + 1126 + ], + [ + 1127, + 1130 + ], + [ + 1136, + 1137 + ], + [ + 1139, + 1140 + ], + [ + 1144, + 1148 + ], + [ + 1149, + 1150 + ], + [ + 1153, + 1154 + ], + [ + 1159, + 1160 + ], + [ + 1161, + 1162 + ], + [ + 1165, + 1167 + ], + [ + 1170, + 1173 + ], + [ + 1174, + 1178 + ], + [ + 1180, + 1181 + ], + [ + 1182, + 1183 + ], + [ + 1185, + 1186 + ], + [ + 1190, + 1195 + ], + [ + 1196, + 1197 + ], + [ + 1200, + 1201 + ], + [ + 1206, + 1207 + ], + [ + 1208, + 1209 + ], + [ + 1213, + 1215 + ], + [ + 1217, + 1218 + ], + [ + 1224, + 1225 + ], + [ + 1226, + 1228 + ], + [ + 1229, + 1230 + ], + [ + 1231, + 1232 + ], + [ + 1243, + 1244 + ], + [ + 1245, + 1246 + ], + [ + 1255, + 1257 + ], + [ + 1261, + 1262 + ], + [ + 1263, + 1264 + ], + [ + 1265, + 1266 + ], + [ + 1268, + 1269 + ], + [ + 1271, + 1272 + ], + [ + 1274, + 1275 + ], + [ + 1277, + 1278 + ], + [ + 1280, + 1281 + ], + [ + 1283, + 1285 + ], + [ + 1295, + 1296 + ], + [ + 1297, + 1299 + ], + [ + 1300, + 1301 + ], + [ + 1304, + 1305 + ], + [ + 1306, + 1307 + ], + [ + 1308, + 1311 + ], + [ + 1312, + 1313 + ], + [ + 1315, + 1316 + ], + [ + 1319, + 1320 + ], + [ + 1327, + 1328 + ], + [ + 1334, + 1335 + ], + [ + 1336, + 1338 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/mapfile.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 26, + 58 + ], + [ + 92, + 407 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 54, + 55 + ], + [ + 95, + 96 + ], + [ + 102, + 104 + ], + [ + 105, + 140 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 151, + 153 + ], + [ + 156, + 204 + ], + [ + 206, + 209 + ], + [ + 210, + 214 + ], + [ + 215, + 216 + ], + [ + 217, + 221 + ], + [ + 222, + 223 + ], + [ + 225, + 239 + ], + [ + 242, + 243 + ], + [ + 246, + 247 + ], + [ + 249, + 253 + ], + [ + 254, + 259 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 271, + 272 + ], + [ + 276, + 281 + ], + [ + 282, + 286 + ], + [ + 288, + 292 + ], + [ + 294, + 296 + ], + [ + 299, + 300 + ], + [ + 305, + 306 + ], + [ + 310, + 311 + ], + [ + 315, + 320 + ], + [ + 322, + 326 + ], + [ + 328, + 330 + ], + [ + 333, + 334 + ], + [ + 336, + 338 + ], + [ + 340, + 341 + ], + [ + 345, + 346 + ], + [ + 349, + 379 + ], + [ + 380, + 392 + ], + [ + 397, + 401 + ], + [ + 402, + 403 + ], + [ + 405, + 406 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/memory.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 24 + ], + [ + 26, + 54 + ], + [ + 87, + 94 + ], + [ + 105, + 112 + ], + [ + 120, + 129 + ], + [ + 137, + 146 + ], + [ + 148, + 157 + ], + [ + 158, + 169 + ], + [ + 170, + 189 + ], + [ + 191, + 220 + ], + [ + 221, + 234 + ], + [ + 235, + 277 + ], + [ + 278, + 287 + ], + [ + 290, + 341 + ], + [ + 357, + 383 + ], + [ + 395, + 423 + ], + [ + 429, + 517 + ] + ], + "lines_added": [ + [ + 19, + 21 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 90, + 91 + ], + [ + 108, + 109 + ], + [ + 123, + 126 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 161, + 163 + ], + [ + 165, + 166 + ], + [ + 173, + 174 + ], + [ + 177, + 178 + ], + [ + 179, + 182 + ], + [ + 185, + 186 + ], + [ + 194, + 195 + ], + [ + 197, + 198 + ], + [ + 204, + 205 + ], + [ + 208, + 209 + ], + [ + 210, + 214 + ], + [ + 216, + 217 + ], + [ + 224, + 225 + ], + [ + 230, + 231 + ], + [ + 238, + 239 + ], + [ + 241, + 242 + ], + [ + 244, + 248 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 264, + 265 + ], + [ + 268, + 269 + ], + [ + 272, + 274 + ], + [ + 281, + 282 + ], + [ + 283, + 284 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 305, + 306 + ], + [ + 310, + 315 + ], + [ + 316, + 317 + ], + [ + 319, + 320 + ], + [ + 321, + 323 + ], + [ + 325, + 326 + ], + [ + 330, + 331 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 337, + 338 + ], + [ + 360, + 361 + ], + [ + 364, + 366 + ], + [ + 367, + 368 + ], + [ + 369, + 370 + ], + [ + 373, + 375 + ], + [ + 377, + 378 + ], + [ + 379, + 380 + ], + [ + 398, + 399 + ], + [ + 402, + 403 + ], + [ + 406, + 408 + ], + [ + 411, + 413 + ], + [ + 415, + 416 + ], + [ + 417, + 418 + ], + [ + 419, + 420 + ], + [ + 432, + 433 + ], + [ + 436, + 437 + ], + [ + 438, + 439 + ], + [ + 442, + 443 + ], + [ + 444, + 445 + ], + [ + 450, + 451 + ], + [ + 457, + 458 + ], + [ + 461, + 462 + ], + [ + 463, + 464 + ], + [ + 467, + 468 + ], + [ + 469, + 470 + ], + [ + 475, + 476 + ], + [ + 480, + 481 + ], + [ + 484, + 485 + ], + [ + 486, + 487 + ], + [ + 490, + 491 + ], + [ + 492, + 493 + ], + [ + 498, + 499 + ], + [ + 503, + 504 + ], + [ + 507, + 508 + ], + [ + 509, + 510 + ], + [ + 513, + 514 + ], + [ + 515, + 516 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/object.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 69, + 85 + ], + [ + 92, + 105 + ], + [ + 111, + 123 + ], + [ + 124, + 142 + ], + [ + 143, + 150 + ], + [ + 156, + 169 + ], + [ + 171, + 178 + ], + [ + 192, + 208 + ], + [ + 220, + 227 + ], + [ + 229, + 237 + ], + [ + 239, + 379 + ], + [ + 380, + 390 + ], + [ + 391, + 403 + ], + [ + 404, + 418 + ], + [ + 422, + 495 + ], + [ + 498, + 542 + ], + [ + 543, + 577 + ], + [ + 581, + 621 + ], + [ + 623, + 682 + ], + [ + 684, + 739 + ], + [ + 742, + 758 + ], + [ + 767, + 807 + ], + [ + 809, + 830 + ], + [ + 832, + 853 + ], + [ + 855, + 910 + ], + [ + 913, + 1078 + ], + [ + 1079, + 1160 + ], + [ + 1163, + 1328 + ], + [ + 1332, + 1436 + ], + [ + 1439, + 1526 + ], + [ + 1528, + 1535 + ], + [ + 1536, + 1580 + ], + [ + 1592, + 1639 + ], + [ + 1641, + 1754 + ], + [ + 1755, + 1876 + ], + [ + 1879, + 1897 + ], + [ + 1898, + 1971 + ], + [ + 1973, + 2208 + ], + [ + 2210, + 2307 + ], + [ + 2309, + 2330 + ], + [ + 2341, + 2374 + ], + [ + 2383, + 2408 + ], + [ + 2414, + 2447 + ], + [ + 2460, + 2490 + ], + [ + 2492, + 2578 + ], + [ + 2581, + 2704 + ], + [ + 2705, + 2730 + ], + [ + 2734, + 2745 + ], + [ + 2748, + 2761 + ], + [ + 2766, + 2780 + ], + [ + 2784, + 2810 + ], + [ + 2812, + 2903 + ], + [ + 2908, + 2927 + ], + [ + 2933, + 2979 + ], + [ + 2980, + 2998 + ], + [ + 3001, + 3063 + ], + [ + 3065, + 3083 + ], + [ + 3086, + 3093 + ], + [ + 3094, + 3101 + ], + [ + 3107, + 3184 + ], + [ + 3185, + 3257 + ], + [ + 3260, + 3291 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 32, + 33 + ], + [ + 72, + 73 + ], + [ + 76, + 78 + ], + [ + 81, + 82 + ], + [ + 95, + 96 + ], + [ + 100, + 102 + ], + [ + 114, + 116 + ], + [ + 119, + 120 + ], + [ + 127, + 128 + ], + [ + 132, + 133 + ], + [ + 138, + 139 + ], + [ + 146, + 147 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 165, + 166 + ], + [ + 174, + 175 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 201, + 205 + ], + [ + 223, + 224 + ], + [ + 232, + 234 + ], + [ + 242, + 243 + ], + [ + 248, + 249 + ], + [ + 253, + 256 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 273 + ], + [ + 275, + 276 + ], + [ + 280, + 281 + ], + [ + 282, + 283 + ], + [ + 286, + 289 + ], + [ + 291, + 292 + ], + [ + 296, + 297 + ], + [ + 298, + 299 + ], + [ + 302, + 305 + ], + [ + 307, + 308 + ], + [ + 312, + 313 + ], + [ + 315, + 316 + ], + [ + 317, + 318 + ], + [ + 322, + 336 + ], + [ + 339, + 343 + ], + [ + 346, + 347 + ], + [ + 350, + 351 + ], + [ + 352, + 353 + ], + [ + 356, + 357 + ], + [ + 362, + 365 + ], + [ + 367, + 369 + ], + [ + 374, + 376 + ], + [ + 383, + 385 + ], + [ + 386, + 387 + ], + [ + 394, + 395 + ], + [ + 397, + 398 + ], + [ + 399, + 400 + ], + [ + 407, + 408 + ], + [ + 410, + 411 + ], + [ + 412, + 413 + ], + [ + 414, + 415 + ], + [ + 425, + 426 + ], + [ + 427, + 428 + ], + [ + 429, + 430 + ], + [ + 433, + 434 + ], + [ + 436, + 437 + ], + [ + 438, + 440 + ], + [ + 443, + 444 + ], + [ + 446, + 447 + ], + [ + 448, + 450 + ], + [ + 453, + 454 + ], + [ + 456, + 457 + ], + [ + 458, + 460 + ], + [ + 463, + 464 + ], + [ + 465, + 466 + ], + [ + 469, + 470 + ], + [ + 473, + 474 + ], + [ + 475, + 477 + ], + [ + 478, + 479 + ], + [ + 481, + 487 + ], + [ + 488, + 489 + ], + [ + 491, + 492 + ], + [ + 501, + 502 + ], + [ + 503, + 504 + ], + [ + 505, + 506 + ], + [ + 512, + 513 + ], + [ + 517, + 518 + ], + [ + 521, + 523 + ], + [ + 524, + 528 + ], + [ + 531, + 534 + ], + [ + 535, + 539 + ], + [ + 546, + 547 + ], + [ + 548, + 550 + ], + [ + 553, + 554 + ], + [ + 557, + 560 + ], + [ + 561, + 562 + ], + [ + 565, + 566 + ], + [ + 567, + 568 + ], + [ + 571, + 572 + ], + [ + 573, + 574 + ], + [ + 584, + 585 + ], + [ + 590, + 592 + ], + [ + 596, + 597 + ], + [ + 598, + 601 + ], + [ + 605, + 606 + ], + [ + 607, + 611 + ], + [ + 612, + 614 + ], + [ + 615, + 616 + ], + [ + 617, + 618 + ], + [ + 626, + 628 + ], + [ + 629, + 636 + ], + [ + 639, + 642 + ], + [ + 644, + 645 + ], + [ + 651, + 652 + ], + [ + 658, + 659 + ], + [ + 661, + 662 + ], + [ + 663, + 664 + ], + [ + 666, + 667 + ], + [ + 671, + 674 + ], + [ + 676, + 677 + ], + [ + 678, + 679 + ], + [ + 687, + 688 + ], + [ + 689, + 690 + ], + [ + 691, + 694 + ], + [ + 696, + 697 + ], + [ + 698, + 699 + ], + [ + 705, + 708 + ], + [ + 709, + 712 + ], + [ + 714, + 715 + ], + [ + 717, + 718 + ], + [ + 719, + 720 + ], + [ + 726, + 729 + ], + [ + 732, + 736 + ], + [ + 745, + 747 + ], + [ + 750, + 751 + ], + [ + 752, + 755 + ], + [ + 770, + 771 + ], + [ + 773, + 774 + ], + [ + 775, + 776 + ], + [ + 777, + 782 + ], + [ + 784, + 790 + ], + [ + 792, + 797 + ], + [ + 799, + 800 + ], + [ + 803, + 804 + ], + [ + 812, + 813 + ], + [ + 818, + 821 + ], + [ + 822, + 823 + ], + [ + 826, + 827 + ], + [ + 835, + 836 + ], + [ + 841, + 844 + ], + [ + 845, + 846 + ], + [ + 849, + 850 + ], + [ + 858, + 859 + ], + [ + 864, + 867 + ], + [ + 868, + 869 + ], + [ + 872, + 873 + ], + [ + 876, + 878 + ], + [ + 879, + 880 + ], + [ + 881, + 883 + ], + [ + 884, + 890 + ], + [ + 894, + 895 + ], + [ + 896, + 897 + ], + [ + 898, + 904 + ], + [ + 906, + 907 + ], + [ + 916, + 917 + ], + [ + 919, + 920 + ], + [ + 921, + 923 + ], + [ + 924, + 926 + ], + [ + 927, + 930 + ], + [ + 932, + 935 + ], + [ + 937, + 938 + ], + [ + 942, + 943 + ], + [ + 944, + 945 + ], + [ + 950, + 951 + ], + [ + 953, + 956 + ], + [ + 958, + 959 + ], + [ + 964, + 965 + ], + [ + 967, + 968 + ], + [ + 969, + 971 + ], + [ + 972, + 973 + ], + [ + 974, + 977 + ], + [ + 979, + 982 + ], + [ + 984, + 985 + ], + [ + 991, + 992 + ], + [ + 994, + 997 + ], + [ + 999, + 1000 + ], + [ + 1003, + 1004 + ], + [ + 1005, + 1006 + ], + [ + 1008, + 1011 + ], + [ + 1017, + 1019 + ], + [ + 1020, + 1021 + ], + [ + 1022, + 1023 + ], + [ + 1025, + 1026 + ], + [ + 1027, + 1028 + ], + [ + 1029, + 1030 + ], + [ + 1031, + 1032 + ], + [ + 1033, + 1034 + ], + [ + 1035, + 1036 + ], + [ + 1039, + 1040 + ], + [ + 1041, + 1042 + ], + [ + 1044, + 1047 + ], + [ + 1053, + 1056 + ], + [ + 1057, + 1058 + ], + [ + 1061, + 1063 + ], + [ + 1067, + 1070 + ], + [ + 1073, + 1075 + ], + [ + 1082, + 1085 + ], + [ + 1091, + 1093 + ], + [ + 1094, + 1095 + ], + [ + 1096, + 1097 + ], + [ + 1098, + 1100 + ], + [ + 1101, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1105, + 1106 + ], + [ + 1108, + 1110 + ], + [ + 1111, + 1117 + ], + [ + 1121, + 1122 + ], + [ + 1123, + 1124 + ], + [ + 1125, + 1131 + ], + [ + 1135, + 1136 + ], + [ + 1139, + 1143 + ], + [ + 1145, + 1149 + ], + [ + 1150, + 1152 + ], + [ + 1154, + 1157 + ], + [ + 1166, + 1167 + ], + [ + 1168, + 1180 + ], + [ + 1181, + 1182 + ], + [ + 1187, + 1189 + ], + [ + 1190, + 1192 + ], + [ + 1193, + 1194 + ], + [ + 1195, + 1196 + ], + [ + 1197, + 1198 + ], + [ + 1200, + 1203 + ], + [ + 1207, + 1209 + ], + [ + 1210, + 1214 + ], + [ + 1216, + 1218 + ], + [ + 1222, + 1223 + ], + [ + 1224, + 1226 + ], + [ + 1227, + 1229 + ], + [ + 1234, + 1235 + ], + [ + 1236, + 1238 + ], + [ + 1239, + 1241 + ], + [ + 1247, + 1250 + ], + [ + 1251, + 1254 + ], + [ + 1255, + 1258 + ], + [ + 1259, + 1261 + ], + [ + 1262, + 1265 + ], + [ + 1266, + 1267 + ], + [ + 1268, + 1271 + ], + [ + 1272, + 1273 + ], + [ + 1274, + 1277 + ], + [ + 1278, + 1279 + ], + [ + 1280, + 1283 + ], + [ + 1284, + 1285 + ], + [ + 1286, + 1289 + ], + [ + 1290, + 1291 + ], + [ + 1292, + 1295 + ], + [ + 1296, + 1297 + ], + [ + 1298, + 1301 + ], + [ + 1302, + 1303 + ], + [ + 1304, + 1307 + ], + [ + 1308, + 1311 + ], + [ + 1317, + 1318 + ], + [ + 1320, + 1321 + ], + [ + 1322, + 1325 + ], + [ + 1335, + 1337 + ], + [ + 1338, + 1340 + ], + [ + 1341, + 1342 + ], + [ + 1343, + 1344 + ], + [ + 1345, + 1346 + ], + [ + 1347, + 1348 + ], + [ + 1353, + 1354 + ], + [ + 1357, + 1360 + ], + [ + 1361, + 1362 + ], + [ + 1363, + 1366 + ], + [ + 1367, + 1368 + ], + [ + 1369, + 1372 + ], + [ + 1373, + 1374 + ], + [ + 1375, + 1378 + ], + [ + 1379, + 1380 + ], + [ + 1381, + 1384 + ], + [ + 1385, + 1386 + ], + [ + 1387, + 1390 + ], + [ + 1391, + 1392 + ], + [ + 1393, + 1396 + ], + [ + 1397, + 1398 + ], + [ + 1399, + 1402 + ], + [ + 1403, + 1404 + ], + [ + 1405, + 1408 + ], + [ + 1409, + 1410 + ], + [ + 1411, + 1414 + ], + [ + 1418, + 1419 + ], + [ + 1421, + 1422 + ], + [ + 1423, + 1426 + ], + [ + 1430, + 1431 + ], + [ + 1432, + 1433 + ], + [ + 1442, + 1445 + ], + [ + 1447, + 1448 + ], + [ + 1453, + 1454 + ], + [ + 1455, + 1456 + ], + [ + 1457, + 1458 + ], + [ + 1461, + 1463 + ], + [ + 1464, + 1465 + ], + [ + 1468, + 1469 + ], + [ + 1471, + 1474 + ], + [ + 1476, + 1477 + ], + [ + 1478, + 1479 + ], + [ + 1482, + 1483 + ], + [ + 1484, + 1489 + ], + [ + 1492, + 1493 + ], + [ + 1497, + 1498 + ], + [ + 1499, + 1503 + ], + [ + 1504, + 1506 + ], + [ + 1509, + 1510 + ], + [ + 1514, + 1515 + ], + [ + 1517, + 1520 + ], + [ + 1522, + 1523 + ], + [ + 1531, + 1532 + ], + [ + 1539, + 1543 + ], + [ + 1545, + 1546 + ], + [ + 1548, + 1550 + ], + [ + 1551, + 1552 + ], + [ + 1555, + 1556 + ], + [ + 1559, + 1560 + ], + [ + 1561, + 1563 + ], + [ + 1566, + 1567 + ], + [ + 1568, + 1569 + ], + [ + 1574, + 1577 + ], + [ + 1595, + 1596 + ], + [ + 1600, + 1601 + ], + [ + 1605, + 1607 + ], + [ + 1608, + 1611 + ], + [ + 1612, + 1614 + ], + [ + 1615, + 1618 + ], + [ + 1619, + 1621 + ], + [ + 1627, + 1628 + ], + [ + 1629, + 1631 + ], + [ + 1632, + 1633 + ], + [ + 1635, + 1636 + ], + [ + 1644, + 1646 + ], + [ + 1647, + 1648 + ], + [ + 1650, + 1651 + ], + [ + 1657, + 1658 + ], + [ + 1659, + 1661 + ], + [ + 1662, + 1663 + ], + [ + 1665, + 1666 + ], + [ + 1671, + 1673 + ], + [ + 1674, + 1676 + ], + [ + 1677, + 1678 + ], + [ + 1680, + 1681 + ], + [ + 1684, + 1685 + ], + [ + 1687, + 1690 + ], + [ + 1692, + 1695 + ], + [ + 1698, + 1699 + ], + [ + 1701, + 1702 + ], + [ + 1703, + 1709 + ], + [ + 1712, + 1713 + ], + [ + 1717, + 1718 + ], + [ + 1723, + 1725 + ], + [ + 1726, + 1727 + ], + [ + 1732, + 1733 + ], + [ + 1734, + 1736 + ], + [ + 1740, + 1741 + ], + [ + 1744, + 1745 + ], + [ + 1748, + 1749 + ], + [ + 1750, + 1751 + ], + [ + 1758, + 1760 + ], + [ + 1764, + 1766 + ], + [ + 1767, + 1769 + ], + [ + 1771, + 1775 + ], + [ + 1777, + 1778 + ], + [ + 1780, + 1782 + ], + [ + 1784, + 1785 + ], + [ + 1786, + 1797 + ], + [ + 1802, + 1810 + ], + [ + 1812, + 1813 + ], + [ + 1814, + 1818 + ], + [ + 1819, + 1820 + ], + [ + 1822, + 1837 + ], + [ + 1840, + 1841 + ], + [ + 1844, + 1845 + ], + [ + 1846, + 1847 + ], + [ + 1852, + 1854 + ], + [ + 1856, + 1859 + ], + [ + 1860, + 1862 + ], + [ + 1863, + 1864 + ], + [ + 1869, + 1871 + ], + [ + 1872, + 1873 + ], + [ + 1882, + 1884 + ], + [ + 1885, + 1888 + ], + [ + 1889, + 1890 + ], + [ + 1891, + 1892 + ], + [ + 1893, + 1894 + ], + [ + 1901, + 1904 + ], + [ + 1905, + 1908 + ], + [ + 1910, + 1911 + ], + [ + 1912, + 1915 + ], + [ + 1916, + 1917 + ], + [ + 1918, + 1919 + ], + [ + 1921, + 1930 + ], + [ + 1931, + 1932 + ], + [ + 1934, + 1938 + ], + [ + 1940, + 1942 + ], + [ + 1946, + 1947 + ], + [ + 1948, + 1949 + ], + [ + 1951, + 1954 + ], + [ + 1956, + 1961 + ], + [ + 1965, + 1966 + ], + [ + 1967, + 1968 + ], + [ + 1976, + 1979 + ], + [ + 1982, + 1985 + ], + [ + 1986, + 1987 + ], + [ + 1989, + 1990 + ], + [ + 1991, + 1994 + ], + [ + 1995, + 1997 + ], + [ + 2001, + 2002 + ], + [ + 2003, + 2005 + ], + [ + 2007, + 2010 + ], + [ + 2012, + 2015 + ], + [ + 2019, + 2022 + ], + [ + 2024, + 2026 + ], + [ + 2029, + 2030 + ], + [ + 2031, + 2032 + ], + [ + 2035, + 2039 + ], + [ + 2041, + 2043 + ], + [ + 2044, + 2045 + ], + [ + 2047, + 2050 + ], + [ + 2052, + 2056 + ], + [ + 2058, + 2060 + ], + [ + 2061, + 2062 + ], + [ + 2066, + 2069 + ], + [ + 2071, + 2075 + ], + [ + 2077, + 2079 + ], + [ + 2080, + 2081 + ], + [ + 2083, + 2086 + ], + [ + 2088, + 2092 + ], + [ + 2094, + 2096 + ], + [ + 2097, + 2098 + ], + [ + 2100, + 2103 + ], + [ + 2105, + 2108 + ], + [ + 2109, + 2111 + ], + [ + 2112, + 2114 + ], + [ + 2117, + 2120 + ], + [ + 2122, + 2128 + ], + [ + 2130, + 2132 + ], + [ + 2134, + 2137 + ], + [ + 2139, + 2141 + ], + [ + 2143, + 2145 + ], + [ + 2146, + 2147 + ], + [ + 2153, + 2154 + ], + [ + 2160, + 2161 + ], + [ + 2163, + 2166 + ], + [ + 2167, + 2168 + ], + [ + 2171, + 2172 + ], + [ + 2173, + 2178 + ], + [ + 2180, + 2186 + ], + [ + 2188, + 2189 + ], + [ + 2192, + 2193 + ], + [ + 2196, + 2197 + ], + [ + 2203, + 2205 + ], + [ + 2213, + 2215 + ], + [ + 2217, + 2220 + ], + [ + 2221, + 2222 + ], + [ + 2223, + 2224 + ], + [ + 2225, + 2226 + ], + [ + 2230, + 2231 + ], + [ + 2232, + 2233 + ], + [ + 2235, + 2243 + ], + [ + 2244, + 2246 + ], + [ + 2250, + 2254 + ], + [ + 2255, + 2256 + ], + [ + 2258, + 2261 + ], + [ + 2263, + 2267 + ], + [ + 2268, + 2269 + ], + [ + 2272, + 2273 + ], + [ + 2274, + 2276 + ], + [ + 2278, + 2279 + ], + [ + 2282, + 2283 + ], + [ + 2286, + 2287 + ], + [ + 2288, + 2289 + ], + [ + 2291, + 2293 + ], + [ + 2294, + 2295 + ], + [ + 2300, + 2301 + ], + [ + 2302, + 2304 + ], + [ + 2312, + 2313 + ], + [ + 2316, + 2317 + ], + [ + 2321, + 2322 + ], + [ + 2326, + 2327 + ], + [ + 2344, + 2346 + ], + [ + 2347, + 2349 + ], + [ + 2353, + 2358 + ], + [ + 2360, + 2362 + ], + [ + 2363, + 2364 + ], + [ + 2365, + 2366 + ], + [ + 2367, + 2368 + ], + [ + 2370, + 2371 + ], + [ + 2386, + 2387 + ], + [ + 2392, + 2393 + ], + [ + 2394, + 2397 + ], + [ + 2399, + 2402 + ], + [ + 2404, + 2405 + ], + [ + 2417, + 2418 + ], + [ + 2421, + 2422 + ], + [ + 2423, + 2424 + ], + [ + 2428, + 2429 + ], + [ + 2430, + 2433 + ], + [ + 2434, + 2435 + ], + [ + 2436, + 2437 + ], + [ + 2438, + 2439 + ], + [ + 2443, + 2444 + ], + [ + 2463, + 2464 + ], + [ + 2468, + 2469 + ], + [ + 2473, + 2476 + ], + [ + 2477, + 2478 + ], + [ + 2481, + 2482 + ], + [ + 2484, + 2485 + ], + [ + 2486, + 2487 + ], + [ + 2495, + 2498 + ], + [ + 2499, + 2501 + ], + [ + 2502, + 2504 + ], + [ + 2505, + 2510 + ], + [ + 2515, + 2529 + ], + [ + 2530, + 2534 + ], + [ + 2536, + 2537 + ], + [ + 2540, + 2542 + ], + [ + 2543, + 2547 + ], + [ + 2549, + 2552 + ], + [ + 2554, + 2555 + ], + [ + 2556, + 2560 + ], + [ + 2561, + 2565 + ], + [ + 2568, + 2572 + ], + [ + 2574, + 2575 + ], + [ + 2584, + 2585 + ], + [ + 2586, + 2587 + ], + [ + 2589, + 2590 + ], + [ + 2594, + 2595 + ], + [ + 2601, + 2602 + ], + [ + 2606, + 2609 + ], + [ + 2610, + 2611 + ], + [ + 2612, + 2613 + ], + [ + 2616, + 2617 + ], + [ + 2622, + 2624 + ], + [ + 2628, + 2630 + ], + [ + 2631, + 2634 + ], + [ + 2637, + 2641 + ], + [ + 2643, + 2644 + ], + [ + 2647, + 2648 + ], + [ + 2651, + 2652 + ], + [ + 2656, + 2659 + ], + [ + 2662, + 2663 + ], + [ + 2665, + 2666 + ], + [ + 2668, + 2669 + ], + [ + 2672, + 2673 + ], + [ + 2676, + 2677 + ], + [ + 2681, + 2685 + ], + [ + 2688, + 2689 + ], + [ + 2691, + 2694 + ], + [ + 2696, + 2697 + ], + [ + 2700, + 2701 + ], + [ + 2708, + 2709 + ], + [ + 2710, + 2711 + ], + [ + 2714, + 2715 + ], + [ + 2719, + 2720 + ], + [ + 2721, + 2727 + ], + [ + 2737, + 2739 + ], + [ + 2740, + 2742 + ], + [ + 2751, + 2752 + ], + [ + 2757, + 2758 + ], + [ + 2769, + 2774 + ], + [ + 2776, + 2777 + ], + [ + 2787, + 2788 + ], + [ + 2793, + 2794 + ], + [ + 2800, + 2801 + ], + [ + 2802, + 2805 + ], + [ + 2806, + 2807 + ], + [ + 2815, + 2817 + ], + [ + 2822, + 2823 + ], + [ + 2826, + 2829 + ], + [ + 2830, + 2831 + ], + [ + 2834, + 2835 + ], + [ + 2840, + 2842 + ], + [ + 2847, + 2848 + ], + [ + 2853, + 2854 + ], + [ + 2857, + 2860 + ], + [ + 2862, + 2865 + ], + [ + 2866, + 2867 + ], + [ + 2872, + 2873 + ], + [ + 2877, + 2879 + ], + [ + 2881, + 2882 + ], + [ + 2885, + 2886 + ], + [ + 2887, + 2889 + ], + [ + 2892, + 2894 + ], + [ + 2895, + 2896 + ], + [ + 2899, + 2900 + ], + [ + 2911, + 2912 + ], + [ + 2918, + 2922 + ], + [ + 2923, + 2924 + ], + [ + 2936, + 2937 + ], + [ + 2938, + 2939 + ], + [ + 2941, + 2943 + ], + [ + 2947, + 2948 + ], + [ + 2950, + 2951 + ], + [ + 2954, + 2955 + ], + [ + 2957, + 2958 + ], + [ + 2961, + 2962 + ], + [ + 2965, + 2967 + ], + [ + 2968, + 2970 + ], + [ + 2971, + 2974 + ], + [ + 2975, + 2976 + ], + [ + 2983, + 2985 + ], + [ + 2987, + 2988 + ], + [ + 2994, + 2995 + ], + [ + 3004, + 3005 + ], + [ + 3006, + 3009 + ], + [ + 3013, + 3016 + ], + [ + 3017, + 3018 + ], + [ + 3022, + 3024 + ], + [ + 3025, + 3026 + ], + [ + 3028, + 3029 + ], + [ + 3035, + 3036 + ], + [ + 3037, + 3038 + ], + [ + 3040, + 3041 + ], + [ + 3045, + 3050 + ], + [ + 3051, + 3052 + ], + [ + 3057, + 3058 + ], + [ + 3059, + 3060 + ], + [ + 3068, + 3069 + ], + [ + 3072, + 3074 + ], + [ + 3075, + 3077 + ], + [ + 3079, + 3080 + ], + [ + 3089, + 3090 + ], + [ + 3097, + 3098 + ], + [ + 3110, + 3111 + ], + [ + 3114, + 3115 + ], + [ + 3116, + 3117 + ], + [ + 3119, + 3120 + ], + [ + 3121, + 3123 + ], + [ + 3124, + 3125 + ], + [ + 3127, + 3129 + ], + [ + 3134, + 3135 + ], + [ + 3136, + 3137 + ], + [ + 3139, + 3140 + ], + [ + 3143, + 3144 + ], + [ + 3148, + 3150 + ], + [ + 3151, + 3152 + ], + [ + 3155, + 3156 + ], + [ + 3157, + 3158 + ], + [ + 3160, + 3161 + ], + [ + 3162, + 3168 + ], + [ + 3169, + 3173 + ], + [ + 3176, + 3177 + ], + [ + 3180, + 3181 + ], + [ + 3188, + 3193 + ], + [ + 3194, + 3197 + ], + [ + 3199, + 3200 + ], + [ + 3203, + 3204 + ], + [ + 3210, + 3211 + ], + [ + 3212, + 3213 + ], + [ + 3214, + 3215 + ], + [ + 3218, + 3219 + ], + [ + 3220, + 3222 + ], + [ + 3225, + 3226 + ], + [ + 3229, + 3230 + ], + [ + 3231, + 3234 + ], + [ + 3236, + 3238 + ], + [ + 3242, + 3244 + ], + [ + 3246, + 3247 + ], + [ + 3253, + 3254 + ], + [ + 3263, + 3264 + ], + [ + 3265, + 3267 + ], + [ + 3273, + 3274 + ], + [ + 3277, + 3279 + ], + [ + 3282, + 3283 + ], + [ + 3284, + 3285 + ], + [ + 3286, + 3288 + ], + [ + 3289, + 3290 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/operation.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 62, + 71 + ], + [ + 75, + 82 + ], + [ + 91, + 98 + ], + [ + 100, + 118 + ], + [ + 156, + 172 + ], + [ + 178, + 185 + ], + [ + 191, + 205 + ], + [ + 208, + 247 + ], + [ + 258, + 422 + ], + [ + 423, + 432 + ], + [ + 434, + 443 + ], + [ + 444, + 597 + ], + [ + 599, + 621 + ], + [ + 627, + 638 + ], + [ + 641, + 665 + ], + [ + 666, + 681 + ], + [ + 682, + 705 + ], + [ + 707, + 788 + ], + [ + 794, + 897 + ], + [ + 900, + 975 + ], + [ + 978, + 989 + ], + [ + 995, + 1107 + ], + [ + 1111, + 1119 + ], + [ + 1120, + 1146 + ], + [ + 1147, + 1276 + ], + [ + 1282, + 1371 + ], + [ + 1375, + 1397 + ], + [ + 1398, + 1465 + ], + [ + 1477, + 1490 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 78, + 79 + ], + [ + 94, + 95 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 159, + 160 + ], + [ + 165, + 166 + ], + [ + 168, + 169 + ], + [ + 181, + 182 + ], + [ + 194, + 195 + ], + [ + 199, + 202 + ], + [ + 211, + 212 + ], + [ + 214, + 215 + ], + [ + 220, + 221 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 231 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 243, + 244 + ], + [ + 261, + 262 + ], + [ + 264, + 268 + ], + [ + 273, + 274 + ], + [ + 275, + 278 + ], + [ + 279, + 281 + ], + [ + 282, + 284 + ], + [ + 285, + 288 + ], + [ + 289, + 290 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ], + [ + 299, + 301 + ], + [ + 304, + 305 + ], + [ + 308, + 309 + ], + [ + 311, + 312 + ], + [ + 313, + 320 + ], + [ + 323, + 327 + ], + [ + 329, + 330 + ], + [ + 331, + 332 + ], + [ + 334, + 338 + ], + [ + 339, + 340 + ], + [ + 342, + 350 + ], + [ + 351, + 352 + ], + [ + 354, + 362 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 370, + 384 + ], + [ + 386, + 390 + ], + [ + 395, + 396 + ], + [ + 399, + 400 + ], + [ + 401, + 402 + ], + [ + 405, + 407 + ], + [ + 410, + 411 + ], + [ + 415, + 419 + ], + [ + 426, + 429 + ], + [ + 437, + 440 + ], + [ + 447, + 450 + ], + [ + 453, + 454 + ], + [ + 456, + 463 + ], + [ + 465, + 466 + ], + [ + 470, + 471 + ], + [ + 473, + 474 + ], + [ + 477, + 491 + ], + [ + 494, + 495 + ], + [ + 496, + 498 + ], + [ + 499, + 504 + ], + [ + 505, + 506 + ], + [ + 509, + 510 + ], + [ + 513, + 514 + ], + [ + 517, + 518 + ], + [ + 520, + 522 + ], + [ + 523, + 526 + ], + [ + 527, + 530 + ], + [ + 532, + 538 + ], + [ + 540, + 541 + ], + [ + 544, + 545 + ], + [ + 546, + 547 + ], + [ + 549, + 552 + ], + [ + 554, + 558 + ], + [ + 560, + 562 + ], + [ + 563, + 564 + ], + [ + 567, + 568 + ], + [ + 569, + 571 + ], + [ + 572, + 575 + ], + [ + 576, + 577 + ], + [ + 578, + 579 + ], + [ + 582, + 583 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 590, + 591 + ], + [ + 592, + 594 + ], + [ + 602, + 603 + ], + [ + 607, + 609 + ], + [ + 610, + 611 + ], + [ + 613, + 614 + ], + [ + 617, + 618 + ], + [ + 630, + 631 + ], + [ + 632, + 633 + ], + [ + 634, + 635 + ], + [ + 644, + 645 + ], + [ + 647, + 648 + ], + [ + 649, + 651 + ], + [ + 654, + 655 + ], + [ + 657, + 659 + ], + [ + 661, + 662 + ], + [ + 669, + 670 + ], + [ + 671, + 673 + ], + [ + 674, + 675 + ], + [ + 677, + 678 + ], + [ + 685, + 689 + ], + [ + 691, + 695 + ], + [ + 697, + 698 + ], + [ + 699, + 700 + ], + [ + 701, + 702 + ], + [ + 710, + 711 + ], + [ + 714, + 715 + ], + [ + 716, + 717 + ], + [ + 718, + 720 + ], + [ + 721, + 724 + ], + [ + 725, + 726 + ], + [ + 730, + 733 + ], + [ + 738, + 742 + ], + [ + 745, + 747 + ], + [ + 748, + 749 + ], + [ + 751, + 753 + ], + [ + 757, + 759 + ], + [ + 760, + 761 + ], + [ + 764, + 765 + ], + [ + 766, + 767 + ], + [ + 768, + 770 + ], + [ + 771, + 776 + ], + [ + 777, + 778 + ], + [ + 779, + 780 + ], + [ + 783, + 785 + ], + [ + 797, + 799 + ], + [ + 804, + 805 + ], + [ + 808, + 809 + ], + [ + 813, + 815 + ], + [ + 816, + 817 + ], + [ + 820, + 821 + ], + [ + 824, + 825 + ], + [ + 826, + 827 + ], + [ + 831, + 832 + ], + [ + 833, + 836 + ], + [ + 837, + 838 + ], + [ + 843, + 844 + ], + [ + 849, + 851 + ], + [ + 855, + 859 + ], + [ + 860, + 862 + ], + [ + 864, + 865 + ], + [ + 868, + 869 + ], + [ + 875, + 876 + ], + [ + 882, + 883 + ], + [ + 884, + 886 + ], + [ + 892, + 894 + ], + [ + 903, + 909 + ], + [ + 910, + 912 + ], + [ + 915, + 917 + ], + [ + 920, + 928 + ], + [ + 931, + 933 + ], + [ + 937, + 939 + ], + [ + 940, + 942 + ], + [ + 946, + 951 + ], + [ + 952, + 953 + ], + [ + 955, + 956 + ], + [ + 959, + 962 + ], + [ + 963, + 964 + ], + [ + 966, + 967 + ], + [ + 969, + 970 + ], + [ + 971, + 972 + ], + [ + 981, + 982 + ], + [ + 983, + 984 + ], + [ + 985, + 986 + ], + [ + 998, + 999 + ], + [ + 1005, + 1006 + ], + [ + 1012, + 1014 + ], + [ + 1015, + 1016 + ], + [ + 1020, + 1021 + ], + [ + 1022, + 1023 + ], + [ + 1024, + 1027 + ], + [ + 1028, + 1029 + ], + [ + 1030, + 1033 + ], + [ + 1034, + 1036 + ], + [ + 1039, + 1041 + ], + [ + 1044, + 1045 + ], + [ + 1046, + 1047 + ], + [ + 1048, + 1050 + ], + [ + 1051, + 1052 + ], + [ + 1055, + 1056 + ], + [ + 1060, + 1064 + ], + [ + 1065, + 1066 + ], + [ + 1069, + 1071 + ], + [ + 1075, + 1079 + ], + [ + 1080, + 1081 + ], + [ + 1084, + 1085 + ], + [ + 1088, + 1089 + ], + [ + 1095, + 1096 + ], + [ + 1097, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1114, + 1116 + ], + [ + 1123, + 1124 + ], + [ + 1126, + 1129 + ], + [ + 1130, + 1131 + ], + [ + 1134, + 1135 + ], + [ + 1136, + 1138 + ], + [ + 1141, + 1143 + ], + [ + 1150, + 1152 + ], + [ + 1155, + 1156 + ], + [ + 1158, + 1166 + ], + [ + 1170, + 1176 + ], + [ + 1179, + 1195 + ], + [ + 1197, + 1198 + ], + [ + 1203, + 1204 + ], + [ + 1205, + 1212 + ], + [ + 1214, + 1215 + ], + [ + 1218, + 1219 + ], + [ + 1222, + 1223 + ], + [ + 1226, + 1227 + ], + [ + 1228, + 1232 + ], + [ + 1235, + 1236 + ], + [ + 1239, + 1240 + ], + [ + 1245, + 1246 + ], + [ + 1247, + 1248 + ], + [ + 1252, + 1255 + ], + [ + 1260, + 1261 + ], + [ + 1262, + 1263 + ], + [ + 1265, + 1266 + ], + [ + 1269, + 1270 + ], + [ + 1271, + 1273 + ], + [ + 1285, + 1286 + ], + [ + 1287, + 1292 + ], + [ + 1294, + 1295 + ], + [ + 1298, + 1299 + ], + [ + 1302, + 1303 + ], + [ + 1308, + 1309 + ], + [ + 1310, + 1312 + ], + [ + 1313, + 1314 + ], + [ + 1316, + 1320 + ], + [ + 1323, + 1325 + ], + [ + 1329, + 1330 + ], + [ + 1333, + 1334 + ], + [ + 1337, + 1338 + ], + [ + 1343, + 1344 + ], + [ + 1345, + 1347 + ], + [ + 1348, + 1350 + ], + [ + 1353, + 1357 + ], + [ + 1361, + 1364 + ], + [ + 1367, + 1368 + ], + [ + 1378, + 1379 + ], + [ + 1382, + 1383 + ], + [ + 1385, + 1394 + ], + [ + 1401, + 1404 + ], + [ + 1409, + 1413 + ], + [ + 1418, + 1420 + ], + [ + 1423, + 1426 + ], + [ + 1429, + 1432 + ], + [ + 1433, + 1434 + ], + [ + 1437, + 1438 + ], + [ + 1439, + 1440 + ], + [ + 1442, + 1446 + ], + [ + 1448, + 1449 + ], + [ + 1453, + 1454 + ], + [ + 1456, + 1457 + ], + [ + 1458, + 1459 + ], + [ + 1461, + 1462 + ], + [ + 1480, + 1481 + ], + [ + 1484, + 1489 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/rect.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 62, + 88 + ], + [ + 93, + 102 + ], + [ + 103, + 120 + ], + [ + 121, + 136 + ], + [ + 142, + 155 + ], + [ + 159, + 167 + ], + [ + 171, + 190 + ], + [ + 195, + 221 + ], + [ + 232, + 247 + ], + [ + 251, + 264 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 29 + ], + [ + 34, + 35 + ], + [ + 65, + 66 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 79, + 82 + ], + [ + 84, + 85 + ], + [ + 96, + 99 + ], + [ + 106, + 107 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 116, + 117 + ], + [ + 124, + 125 + ], + [ + 129, + 133 + ], + [ + 145, + 146 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 162, + 164 + ], + [ + 174, + 175 + ], + [ + 179, + 187 + ], + [ + 198, + 199 + ], + [ + 203, + 206 + ], + [ + 207, + 208 + ], + [ + 210, + 218 + ], + [ + 235, + 236 + ], + [ + 239, + 241 + ], + [ + 243, + 244 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 261 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/region.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 46, + 53 + ], + [ + 55, + 88 + ], + [ + 109, + 116 + ], + [ + 136, + 143 + ], + [ + 168, + 177 + ], + [ + 182, + 193 + ], + [ + 195, + 374 + ], + [ + 376, + 418 + ], + [ + 419, + 475 + ], + [ + 479, + 495 + ], + [ + 496, + 530 + ], + [ + 537, + 556 + ], + [ + 557, + 604 + ], + [ + 605, + 619 + ], + [ + 621, + 628 + ], + [ + 629, + 666 + ], + [ + 667, + 684 + ], + [ + 688, + 695 + ], + [ + 697, + 712 + ], + [ + 715, + 733 + ], + [ + 742, + 749 + ], + [ + 754, + 769 + ], + [ + 773, + 796 + ], + [ + 797, + 819 + ], + [ + 829, + 836 + ], + [ + 843, + 905 + ], + [ + 906, + 919 + ], + [ + 920, + 959 + ], + [ + 961, + 969 + ], + [ + 975, + 982 + ], + [ + 984, + 999 + ], + [ + 1000, + 1021 + ], + [ + 1029, + 1044 + ], + [ + 1049, + 1063 + ], + [ + 1065, + 1072 + ], + [ + 1074, + 1140 + ], + [ + 1147, + 1185 + ], + [ + 1188, + 1236 + ], + [ + 1247, + 1274 + ], + [ + 1279, + 1543 + ], + [ + 1555, + 1588 + ], + [ + 1599, + 1671 + ], + [ + 1673, + 1699 + ], + [ + 1703, + 1767 + ], + [ + 1768, + 1783 + ], + [ + 1784, + 1792 + ], + [ + 1794, + 1825 + ], + [ + 1827, + 1840 + ], + [ + 1845, + 1872 + ], + [ + 1874, + 1883 + ], + [ + 1885, + 1936 + ], + [ + 1946, + 1954 + ], + [ + 1957, + 1965 + ], + [ + 1968, + 1997 + ], + [ + 2000, + 2010 + ], + [ + 2012, + 2024 + ], + [ + 2026, + 2087 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 49, + 50 + ], + [ + 58, + 64 + ], + [ + 65, + 69 + ], + [ + 70, + 74 + ], + [ + 79, + 80 + ], + [ + 84, + 85 + ], + [ + 112, + 113 + ], + [ + 139, + 140 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 185, + 186 + ], + [ + 189, + 190 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 207, + 208 + ], + [ + 210, + 213 + ], + [ + 216, + 219 + ], + [ + 221, + 222 + ], + [ + 227, + 228 + ], + [ + 231, + 233 + ], + [ + 234, + 235 + ], + [ + 236, + 237 + ], + [ + 238, + 240 + ], + [ + 241, + 244 + ], + [ + 245, + 248 + ], + [ + 250, + 253 + ], + [ + 254, + 255 + ], + [ + 257, + 258 + ], + [ + 260, + 261 + ], + [ + 264, + 265 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 276, + 277 + ], + [ + 281, + 287 + ], + [ + 290, + 291 + ], + [ + 292, + 293 + ], + [ + 296, + 299 + ], + [ + 301, + 302 + ], + [ + 303, + 306 + ], + [ + 309, + 311 + ], + [ + 312, + 313 + ], + [ + 314, + 315 + ], + [ + 316, + 317 + ], + [ + 318, + 319 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 326, + 327 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 334, + 352 + ], + [ + 355, + 356 + ], + [ + 357, + 358 + ], + [ + 359, + 365 + ], + [ + 366, + 369 + ], + [ + 370, + 371 + ], + [ + 379, + 380 + ], + [ + 384, + 385 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 390, + 392 + ], + [ + 393, + 396 + ], + [ + 398, + 400 + ], + [ + 404, + 405 + ], + [ + 408, + 409 + ], + [ + 410, + 415 + ], + [ + 422, + 423 + ], + [ + 424, + 425 + ], + [ + 426, + 427 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 433, + 435 + ], + [ + 436, + 437 + ], + [ + 440, + 441 + ], + [ + 442, + 443 + ], + [ + 445, + 446 + ], + [ + 447, + 449 + ], + [ + 450, + 451 + ], + [ + 454, + 455 + ], + [ + 456, + 457 + ], + [ + 458, + 459 + ], + [ + 460, + 461 + ], + [ + 462, + 463 + ], + [ + 464, + 465 + ], + [ + 468, + 469 + ], + [ + 470, + 472 + ], + [ + 482, + 483 + ], + [ + 487, + 492 + ], + [ + 499, + 500 + ], + [ + 505, + 506 + ], + [ + 512, + 515 + ], + [ + 516, + 517 + ], + [ + 519, + 522 + ], + [ + 524, + 525 + ], + [ + 526, + 527 + ], + [ + 540, + 541 + ], + [ + 545, + 546 + ], + [ + 552, + 553 + ], + [ + 560, + 561 + ], + [ + 564, + 568 + ], + [ + 570, + 571 + ], + [ + 577, + 579 + ], + [ + 581, + 583 + ], + [ + 585, + 586 + ], + [ + 588, + 591 + ], + [ + 596, + 597 + ], + [ + 600, + 601 + ], + [ + 608, + 611 + ], + [ + 615, + 616 + ], + [ + 624, + 625 + ], + [ + 632, + 633 + ], + [ + 634, + 638 + ], + [ + 641, + 642 + ], + [ + 643, + 644 + ], + [ + 646, + 647 + ], + [ + 652, + 654 + ], + [ + 656, + 657 + ], + [ + 660, + 663 + ], + [ + 670, + 671 + ], + [ + 674, + 675 + ], + [ + 676, + 678 + ], + [ + 680, + 681 + ], + [ + 691, + 692 + ], + [ + 700, + 702 + ], + [ + 707, + 709 + ], + [ + 718, + 722 + ], + [ + 723, + 728 + ], + [ + 729, + 730 + ], + [ + 745, + 746 + ], + [ + 757, + 761 + ], + [ + 765, + 766 + ], + [ + 776, + 780 + ], + [ + 784, + 786 + ], + [ + 789, + 790 + ], + [ + 792, + 793 + ], + [ + 800, + 801 + ], + [ + 804, + 805 + ], + [ + 811, + 812 + ], + [ + 813, + 816 + ], + [ + 832, + 833 + ], + [ + 846, + 850 + ], + [ + 855, + 856 + ], + [ + 859, + 861 + ], + [ + 862, + 864 + ], + [ + 865, + 866 + ], + [ + 867, + 868 + ], + [ + 871, + 872 + ], + [ + 876, + 878 + ], + [ + 881, + 884 + ], + [ + 887, + 889 + ], + [ + 891, + 892 + ], + [ + 894, + 902 + ], + [ + 909, + 911 + ], + [ + 913, + 914 + ], + [ + 915, + 916 + ], + [ + 923, + 924 + ], + [ + 927, + 932 + ], + [ + 934, + 937 + ], + [ + 941, + 945 + ], + [ + 947, + 948 + ], + [ + 950, + 951 + ], + [ + 955, + 956 + ], + [ + 964, + 966 + ], + [ + 978, + 979 + ], + [ + 987, + 988 + ], + [ + 991, + 994 + ], + [ + 995, + 996 + ], + [ + 1003, + 1004 + ], + [ + 1006, + 1007 + ], + [ + 1009, + 1010 + ], + [ + 1016, + 1018 + ], + [ + 1032, + 1033 + ], + [ + 1034, + 1035 + ], + [ + 1039, + 1041 + ], + [ + 1052, + 1054 + ], + [ + 1055, + 1060 + ], + [ + 1068, + 1069 + ], + [ + 1077, + 1078 + ], + [ + 1081, + 1082 + ], + [ + 1085, + 1087 + ], + [ + 1089, + 1090 + ], + [ + 1093, + 1094 + ], + [ + 1096, + 1099 + ], + [ + 1100, + 1102 + ], + [ + 1108, + 1109 + ], + [ + 1113, + 1115 + ], + [ + 1116, + 1117 + ], + [ + 1120, + 1125 + ], + [ + 1128, + 1129 + ], + [ + 1132, + 1133 + ], + [ + 1134, + 1135 + ], + [ + 1136, + 1137 + ], + [ + 1150, + 1152 + ], + [ + 1155, + 1158 + ], + [ + 1159, + 1160 + ], + [ + 1162, + 1163 + ], + [ + 1169, + 1171 + ], + [ + 1174, + 1177 + ], + [ + 1178, + 1179 + ], + [ + 1181, + 1182 + ], + [ + 1191, + 1193 + ], + [ + 1194, + 1196 + ], + [ + 1200, + 1205 + ], + [ + 1208, + 1209 + ], + [ + 1210, + 1212 + ], + [ + 1213, + 1215 + ], + [ + 1216, + 1218 + ], + [ + 1219, + 1221 + ], + [ + 1222, + 1224 + ], + [ + 1225, + 1227 + ], + [ + 1228, + 1230 + ], + [ + 1231, + 1233 + ], + [ + 1250, + 1269 + ], + [ + 1270, + 1271 + ], + [ + 1282, + 1306 + ], + [ + 1307, + 1308 + ], + [ + 1309, + 1326 + ], + [ + 1327, + 1328 + ], + [ + 1329, + 1346 + ], + [ + 1347, + 1348 + ], + [ + 1349, + 1362 + ], + [ + 1363, + 1410 + ], + [ + 1411, + 1412 + ], + [ + 1413, + 1418 + ], + [ + 1422, + 1424 + ], + [ + 1425, + 1429 + ], + [ + 1430, + 1433 + ], + [ + 1434, + 1437 + ], + [ + 1438, + 1441 + ], + [ + 1442, + 1445 + ], + [ + 1446, + 1449 + ], + [ + 1450, + 1452 + ], + [ + 1457, + 1492 + ], + [ + 1493, + 1494 + ], + [ + 1499, + 1501 + ], + [ + 1502, + 1503 + ], + [ + 1507, + 1512 + ], + [ + 1515, + 1540 + ], + [ + 1558, + 1559 + ], + [ + 1563, + 1565 + ], + [ + 1568, + 1570 + ], + [ + 1571, + 1575 + ], + [ + 1576, + 1578 + ], + [ + 1579, + 1580 + ], + [ + 1582, + 1583 + ], + [ + 1584, + 1585 + ], + [ + 1602, + 1603 + ], + [ + 1604, + 1606 + ], + [ + 1608, + 1609 + ], + [ + 1611, + 1612 + ], + [ + 1617, + 1621 + ], + [ + 1625, + 1631 + ], + [ + 1633, + 1634 + ], + [ + 1636, + 1637 + ], + [ + 1641, + 1643 + ], + [ + 1645, + 1647 + ], + [ + 1649, + 1650 + ], + [ + 1652, + 1653 + ], + [ + 1658, + 1660 + ], + [ + 1664, + 1665 + ], + [ + 1666, + 1668 + ], + [ + 1676, + 1685 + ], + [ + 1687, + 1690 + ], + [ + 1692, + 1693 + ], + [ + 1694, + 1696 + ], + [ + 1706, + 1708 + ], + [ + 1712, + 1716 + ], + [ + 1720, + 1721 + ], + [ + 1722, + 1723 + ], + [ + 1729, + 1731 + ], + [ + 1735, + 1739 + ], + [ + 1741, + 1743 + ], + [ + 1746, + 1747 + ], + [ + 1750, + 1752 + ], + [ + 1757, + 1759 + ], + [ + 1760, + 1761 + ], + [ + 1763, + 1764 + ], + [ + 1771, + 1772 + ], + [ + 1773, + 1775 + ], + [ + 1776, + 1777 + ], + [ + 1778, + 1780 + ], + [ + 1787, + 1789 + ], + [ + 1797, + 1799 + ], + [ + 1802, + 1803 + ], + [ + 1804, + 1808 + ], + [ + 1810, + 1812 + ], + [ + 1818, + 1819 + ], + [ + 1820, + 1822 + ], + [ + 1830, + 1834 + ], + [ + 1836, + 1837 + ], + [ + 1848, + 1852 + ], + [ + 1855, + 1858 + ], + [ + 1862, + 1863 + ], + [ + 1865, + 1866 + ], + [ + 1867, + 1869 + ], + [ + 1877, + 1880 + ], + [ + 1888, + 1892 + ], + [ + 1894, + 1897 + ], + [ + 1902, + 1906 + ], + [ + 1911, + 1913 + ], + [ + 1917, + 1918 + ], + [ + 1923, + 1924 + ], + [ + 1925, + 1928 + ], + [ + 1929, + 1930 + ], + [ + 1932, + 1933 + ], + [ + 1949, + 1951 + ], + [ + 1960, + 1962 + ], + [ + 1971, + 1975 + ], + [ + 1976, + 1980 + ], + [ + 1981, + 1982 + ], + [ + 1983, + 1985 + ], + [ + 1990, + 1991 + ], + [ + 1993, + 1994 + ], + [ + 2003, + 2004 + ], + [ + 2005, + 2007 + ], + [ + 2015, + 2016 + ], + [ + 2017, + 2019 + ], + [ + 2020, + 2021 + ], + [ + 2029, + 2030 + ], + [ + 2033, + 2035 + ], + [ + 2041, + 2042 + ], + [ + 2044, + 2045 + ], + [ + 2046, + 2048 + ], + [ + 2049, + 2050 + ], + [ + 2052, + 2053 + ], + [ + 2056, + 2057 + ], + [ + 2060, + 2061 + ], + [ + 2062, + 2067 + ], + [ + 2072, + 2073 + ], + [ + 2075, + 2083 + ], + [ + 2084, + 2085 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/reorder.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 56, + 63 + ], + [ + 66, + 76 + ], + [ + 78, + 147 + ], + [ + 150, + 224 + ], + [ + 228, + 286 + ], + [ + 289, + 314 + ], + [ + 320, + 348 + ], + [ + 352, + 359 + ], + [ + 360, + 387 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 59, + 60 + ], + [ + 69, + 70 + ], + [ + 72, + 73 + ], + [ + 81, + 82 + ], + [ + 85, + 86 + ], + [ + 89, + 100 + ], + [ + 102, + 109 + ], + [ + 114, + 115 + ], + [ + 120, + 125 + ], + [ + 128, + 129 + ], + [ + 130, + 132 + ], + [ + 135, + 136 + ], + [ + 139, + 144 + ], + [ + 153, + 155 + ], + [ + 156, + 157 + ], + [ + 160, + 161 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 178, + 180 + ], + [ + 185, + 187 + ], + [ + 188, + 189 + ], + [ + 191, + 194 + ], + [ + 196, + 198 + ], + [ + 201, + 202 + ], + [ + 207, + 208 + ], + [ + 210, + 216 + ], + [ + 217, + 219 + ], + [ + 220, + 221 + ], + [ + 231, + 233 + ], + [ + 237, + 238 + ], + [ + 239, + 244 + ], + [ + 249, + 251 + ], + [ + 254, + 255 + ], + [ + 259, + 261 + ], + [ + 263, + 264 + ], + [ + 269, + 270 + ], + [ + 275, + 276 + ], + [ + 280, + 281 + ], + [ + 282, + 283 + ], + [ + 292, + 297 + ], + [ + 300, + 301 + ], + [ + 307, + 308 + ], + [ + 310, + 311 + ], + [ + 323, + 324 + ], + [ + 330, + 331 + ], + [ + 332, + 333 + ], + [ + 336, + 338 + ], + [ + 339, + 342 + ], + [ + 344, + 345 + ], + [ + 355, + 356 + ], + [ + 363, + 364 + ], + [ + 365, + 366 + ], + [ + 369, + 370 + ], + [ + 374, + 375 + ], + [ + 376, + 378 + ], + [ + 381, + 382 + ], + [ + 383, + 386 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sbuf.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 59, + 66 + ], + [ + 67, + 100 + ], + [ + 104, + 131 + ], + [ + 135, + 147 + ], + [ + 148, + 207 + ], + [ + 211, + 226 + ], + [ + 229, + 236 + ], + [ + 243, + 285 + ], + [ + 286, + 307 + ], + [ + 310, + 317 + ], + [ + 324, + 331 + ], + [ + 334, + 360 + ], + [ + 362, + 401 + ], + [ + 406, + 417 + ], + [ + 418, + 454 + ], + [ + 455, + 505 + ], + [ + 512, + 538 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 62, + 63 + ], + [ + 70, + 71 + ], + [ + 73, + 74 + ], + [ + 76, + 77 + ], + [ + 78, + 80 + ], + [ + 85, + 93 + ], + [ + 96, + 97 + ], + [ + 107, + 108 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 122, + 125 + ], + [ + 127, + 128 + ], + [ + 138, + 139 + ], + [ + 142, + 144 + ], + [ + 151, + 152 + ], + [ + 155, + 156 + ], + [ + 159, + 160 + ], + [ + 161, + 165 + ], + [ + 168, + 170 + ], + [ + 174, + 175 + ], + [ + 181, + 182 + ], + [ + 188, + 189 + ], + [ + 190, + 193 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 203, + 204 + ], + [ + 214, + 215 + ], + [ + 220, + 221 + ], + [ + 222, + 223 + ], + [ + 232, + 233 + ], + [ + 246, + 247 + ], + [ + 248, + 253 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 265, + 267 + ], + [ + 268, + 270 + ], + [ + 273, + 282 + ], + [ + 289, + 290 + ], + [ + 292, + 293 + ], + [ + 297, + 298 + ], + [ + 303, + 304 + ], + [ + 313, + 314 + ], + [ + 327, + 328 + ], + [ + 337, + 338 + ], + [ + 343, + 344 + ], + [ + 349, + 350 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 365, + 368 + ], + [ + 369, + 371 + ], + [ + 372, + 373 + ], + [ + 375, + 378 + ], + [ + 381, + 385 + ], + [ + 388, + 389 + ], + [ + 390, + 391 + ], + [ + 397, + 398 + ], + [ + 409, + 410 + ], + [ + 413, + 414 + ], + [ + 421, + 423 + ], + [ + 425, + 426 + ], + [ + 430, + 434 + ], + [ + 439, + 440 + ], + [ + 441, + 443 + ], + [ + 444, + 445 + ], + [ + 446, + 447 + ], + [ + 448, + 449 + ], + [ + 450, + 451 + ], + [ + 458, + 459 + ], + [ + 461, + 462 + ], + [ + 467, + 468 + ], + [ + 469, + 470 + ], + [ + 475, + 476 + ], + [ + 480, + 484 + ], + [ + 490, + 493 + ], + [ + 498, + 500 + ], + [ + 501, + 502 + ], + [ + 515, + 517 + ], + [ + 521, + 522 + ], + [ + 525, + 527 + ], + [ + 528, + 531 + ], + [ + 532, + 533 + ], + [ + 534, + 535 + ], + [ + 536, + 537 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/semaphore.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 12, + 44 + ], + [ + 55, + 62 + ], + [ + 64, + 147 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 40, + 41 + ], + [ + 58, + 59 + ], + [ + 67, + 68 + ], + [ + 69, + 71 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 81, + 82 + ], + [ + 88, + 90 + ], + [ + 91, + 93 + ], + [ + 95, + 99 + ], + [ + 101, + 102 + ], + [ + 107, + 108 + ], + [ + 109, + 110 + ], + [ + 115, + 116 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 123, + 125 + ], + [ + 128, + 129 + ], + [ + 131, + 133 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sink.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 50, + 67 + ], + [ + 82, + 89 + ], + [ + 96, + 112 + ], + [ + 114, + 146 + ], + [ + 155, + 172 + ], + [ + 174, + 212 + ], + [ + 219, + 237 + ], + [ + 240, + 390 + ], + [ + 395, + 414 + ], + [ + 415, + 448 + ], + [ + 455, + 467 + ], + [ + 468, + 493 + ], + [ + 494, + 517 + ], + [ + 522, + 529 + ], + [ + 535, + 545 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 53, + 54 + ], + [ + 57, + 58 + ], + [ + 62, + 64 + ], + [ + 85, + 86 + ], + [ + 99, + 100 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 117, + 118 + ], + [ + 120, + 121 + ], + [ + 122, + 124 + ], + [ + 127, + 128 + ], + [ + 131, + 133 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 141, + 143 + ], + [ + 158, + 159 + ], + [ + 163, + 164 + ], + [ + 168, + 169 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 189, + 192 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 202, + 204 + ], + [ + 207, + 209 + ], + [ + 222, + 223 + ], + [ + 228, + 230 + ], + [ + 233, + 234 + ], + [ + 243, + 244 + ], + [ + 246, + 247 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 258, + 259 + ], + [ + 261, + 265 + ], + [ + 270, + 271 + ], + [ + 274, + 275 + ], + [ + 279, + 281 + ], + [ + 282, + 283 + ], + [ + 288, + 289 + ], + [ + 290, + 292 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ], + [ + 298, + 302 + ], + [ + 305, + 306 + ], + [ + 309, + 310 + ], + [ + 314, + 317 + ], + [ + 318, + 321 + ], + [ + 324, + 325 + ], + [ + 326, + 328 + ], + [ + 333, + 334 + ], + [ + 337, + 338 + ], + [ + 344, + 345 + ], + [ + 346, + 349 + ], + [ + 352, + 353 + ], + [ + 354, + 357 + ], + [ + 360, + 361 + ], + [ + 362, + 363 + ], + [ + 365, + 366 + ], + [ + 371, + 374 + ], + [ + 379, + 381 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 386, + 387 + ], + [ + 398, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 411 + ], + [ + 418, + 422 + ], + [ + 425, + 426 + ], + [ + 427, + 428 + ], + [ + 430, + 432 + ], + [ + 435, + 436 + ], + [ + 440, + 443 + ], + [ + 444, + 445 + ], + [ + 458, + 459 + ], + [ + 462, + 464 + ], + [ + 471, + 472 + ], + [ + 474, + 475 + ], + [ + 479, + 480 + ], + [ + 484, + 488 + ], + [ + 489, + 490 + ], + [ + 497, + 498 + ], + [ + 499, + 501 + ], + [ + 502, + 506 + ], + [ + 507, + 508 + ], + [ + 509, + 510 + ], + [ + 511, + 512 + ], + [ + 513, + 514 + ], + [ + 525, + 526 + ], + [ + 538, + 539 + ], + [ + 540, + 541 + ], + [ + 542, + 544 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sink.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 65, + 75 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 68, + 72 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sinkdisc.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 13, + 41 + ], + [ + 70, + 85 + ], + [ + 94, + 102 + ], + [ + 104, + 111 + ], + [ + 112, + 286 + ], + [ + 294, + 316 + ], + [ + 318, + 376 + ], + [ + 389, + 409 + ], + [ + 412, + 464 + ], + [ + 466, + 473 + ], + [ + 487, + 542 + ] + ], + "lines_added": [ + [ + 1, + 3 + ], + [ + 16, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 32 + ], + [ + 37, + 38 + ], + [ + 73, + 82 + ], + [ + 97, + 99 + ], + [ + 107, + 108 + ], + [ + 115, + 116 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 133, + 134 + ], + [ + 135, + 138 + ], + [ + 141, + 142 + ], + [ + 143, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 154, + 162 + ], + [ + 165, + 166 + ], + [ + 169, + 171 + ], + [ + 172, + 173 + ], + [ + 174, + 176 + ], + [ + 177, + 178 + ], + [ + 183, + 184 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 197, + 198 + ], + [ + 199, + 200 + ], + [ + 203, + 204 + ], + [ + 208, + 209 + ], + [ + 212, + 213 + ], + [ + 216, + 218 + ], + [ + 220, + 224 + ], + [ + 228, + 231 + ], + [ + 235, + 236 + ], + [ + 239, + 243 + ], + [ + 247, + 248 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 257, + 258 + ], + [ + 260, + 262 + ], + [ + 265, + 269 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 281, + 283 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 311 + ], + [ + 312, + 313 + ], + [ + 321, + 322 + ], + [ + 323, + 324 + ], + [ + 330, + 331 + ], + [ + 332, + 333 + ], + [ + 335, + 336 + ], + [ + 339, + 343 + ], + [ + 344, + 345 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 359, + 362 + ], + [ + 365, + 366 + ], + [ + 369, + 371 + ], + [ + 372, + 373 + ], + [ + 392, + 393 + ], + [ + 398, + 402 + ], + [ + 405, + 406 + ], + [ + 415, + 416 + ], + [ + 421, + 422 + ], + [ + 427, + 430 + ], + [ + 431, + 433 + ], + [ + 434, + 436 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 445, + 447 + ], + [ + 448, + 449 + ], + [ + 450, + 452 + ], + [ + 457, + 458 + ], + [ + 459, + 461 + ], + [ + 469, + 470 + ], + [ + 490, + 491 + ], + [ + 492, + 493 + ], + [ + 499, + 500 + ], + [ + 504, + 505 + ], + [ + 506, + 507 + ], + [ + 509, + 518 + ], + [ + 521, + 522 + ], + [ + 523, + 525 + ], + [ + 531, + 533 + ], + [ + 534, + 535 + ], + [ + 536, + 537 + ], + [ + 538, + 539 + ], + [ + 540, + 541 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sinkmemory.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 12, + 40 + ], + [ + 57, + 70 + ], + [ + 72, + 79 + ], + [ + 89, + 96 + ], + [ + 97, + 152 + ], + [ + 161, + 178 + ], + [ + 180, + 218 + ], + [ + 225, + 243 + ], + [ + 246, + 259 + ], + [ + 260, + 296 + ], + [ + 298, + 313 + ], + [ + 321, + 354 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 15, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 31 + ], + [ + 36, + 37 + ], + [ + 60, + 61 + ], + [ + 65, + 67 + ], + [ + 75, + 76 + ], + [ + 92, + 93 + ], + [ + 100, + 102 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 118, + 119 + ], + [ + 120, + 123 + ], + [ + 126, + 127 + ], + [ + 128, + 130 + ], + [ + 133, + 134 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 147, + 149 + ], + [ + 164, + 165 + ], + [ + 169, + 170 + ], + [ + 174, + 175 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 188, + 189 + ], + [ + 192, + 193 + ], + [ + 195, + 198 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 208, + 210 + ], + [ + 213, + 215 + ], + [ + 228, + 229 + ], + [ + 234, + 236 + ], + [ + 239, + 240 + ], + [ + 249, + 250 + ], + [ + 255, + 256 + ], + [ + 263, + 265 + ], + [ + 266, + 268 + ], + [ + 269, + 271 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 280, + 281 + ], + [ + 282, + 285 + ], + [ + 288, + 289 + ], + [ + 292, + 293 + ], + [ + 301, + 307 + ], + [ + 309, + 310 + ], + [ + 324, + 325 + ], + [ + 329, + 331 + ], + [ + 332, + 333 + ], + [ + 335, + 342 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 348, + 349 + ], + [ + 350, + 351 + ], + [ + 352, + 353 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sinkscreen.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 14, + 42 + ], + [ + 77, + 90 + ], + [ + 95, + 102 + ], + [ + 107, + 114 + ], + [ + 116, + 145 + ], + [ + 165, + 175 + ], + [ + 181, + 328 + ], + [ + 329, + 566 + ], + [ + 581, + 588 + ], + [ + 589, + 627 + ], + [ + 632, + 877 + ], + [ + 885, + 906 + ], + [ + 908, + 930 + ], + [ + 937, + 951 + ], + [ + 954, + 1070 + ], + [ + 1081, + 1109 + ], + [ + 1111, + 1150 + ], + [ + 1151, + 1197 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 80, + 81 + ], + [ + 86, + 87 + ], + [ + 98, + 99 + ], + [ + 110, + 111 + ], + [ + 119, + 123 + ], + [ + 124, + 127 + ], + [ + 129, + 130 + ], + [ + 131, + 132 + ], + [ + 135, + 138 + ], + [ + 141, + 142 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 184, + 185 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 206, + 207 + ], + [ + 208, + 211 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 231 + ], + [ + 232, + 233 + ], + [ + 235, + 238 + ], + [ + 239, + 241 + ], + [ + 244, + 245 + ], + [ + 246, + 248 + ], + [ + 249, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 265, + 266 + ], + [ + 271, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 279 + ], + [ + 280, + 281 + ], + [ + 283, + 284 + ], + [ + 287, + 288 + ], + [ + 291, + 294 + ], + [ + 295, + 297 + ], + [ + 299, + 300 + ], + [ + 302, + 304 + ], + [ + 305, + 306 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 319, + 321 + ], + [ + 324, + 325 + ], + [ + 332, + 333 + ], + [ + 336, + 337 + ], + [ + 339, + 342 + ], + [ + 344, + 347 + ], + [ + 349, + 350 + ], + [ + 355, + 356 + ], + [ + 359, + 362 + ], + [ + 366, + 367 + ], + [ + 372, + 373 + ], + [ + 376, + 378 + ], + [ + 379, + 381 + ], + [ + 383, + 384 + ], + [ + 386, + 388 + ], + [ + 393, + 394 + ], + [ + 395, + 398 + ], + [ + 401, + 402 + ], + [ + 404, + 405 + ], + [ + 406, + 407 + ], + [ + 409, + 411 + ], + [ + 416, + 417 + ], + [ + 418, + 420 + ], + [ + 421, + 427 + ], + [ + 430, + 433 + ], + [ + 434, + 435 + ], + [ + 437, + 438 + ], + [ + 442, + 443 + ], + [ + 446, + 448 + ], + [ + 449, + 450 + ], + [ + 456, + 457 + ], + [ + 458, + 459 + ], + [ + 460, + 461 + ], + [ + 463, + 464 + ], + [ + 465, + 467 + ], + [ + 470, + 472 + ], + [ + 473, + 474 + ], + [ + 479, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 489 + ], + [ + 493, + 494 + ], + [ + 497, + 498 + ], + [ + 501, + 502 + ], + [ + 508, + 509 + ], + [ + 512, + 513 + ], + [ + 517, + 519 + ], + [ + 522, + 523 + ], + [ + 524, + 525 + ], + [ + 526, + 528 + ], + [ + 533, + 534 + ], + [ + 535, + 536 + ], + [ + 538, + 539 + ], + [ + 543, + 546 + ], + [ + 547, + 548 + ], + [ + 554, + 556 + ], + [ + 559, + 560 + ], + [ + 561, + 563 + ], + [ + 584, + 585 + ], + [ + 592, + 594 + ], + [ + 595, + 599 + ], + [ + 601, + 602 + ], + [ + 607, + 608 + ], + [ + 613, + 614 + ], + [ + 617, + 618 + ], + [ + 622, + 624 + ], + [ + 635, + 638 + ], + [ + 640, + 641 + ], + [ + 643, + 644 + ], + [ + 649, + 650 + ], + [ + 651, + 652 + ], + [ + 657, + 658 + ], + [ + 661, + 662 + ], + [ + 666, + 667 + ], + [ + 669, + 672 + ], + [ + 673, + 674 + ], + [ + 679, + 680 + ], + [ + 683, + 684 + ], + [ + 685, + 688 + ], + [ + 689, + 691 + ], + [ + 697, + 698 + ], + [ + 703, + 704 + ], + [ + 706, + 707 + ], + [ + 709, + 710 + ], + [ + 713, + 715 + ], + [ + 717, + 718 + ], + [ + 719, + 721 + ], + [ + 724, + 726 + ], + [ + 728, + 730 + ], + [ + 732, + 735 + ], + [ + 740, + 741 + ], + [ + 742, + 745 + ], + [ + 746, + 747 + ], + [ + 752, + 754 + ], + [ + 755, + 757 + ], + [ + 763, + 764 + ], + [ + 768, + 770 + ], + [ + 771, + 775 + ], + [ + 777, + 778 + ], + [ + 784, + 785 + ], + [ + 788, + 790 + ], + [ + 791, + 792 + ], + [ + 795, + 797 + ], + [ + 798, + 799 + ], + [ + 800, + 803 + ], + [ + 805, + 807 + ], + [ + 808, + 809 + ], + [ + 810, + 811 + ], + [ + 813, + 815 + ], + [ + 816, + 821 + ], + [ + 823, + 824 + ], + [ + 825, + 826 + ], + [ + 828, + 829 + ], + [ + 834, + 835 + ], + [ + 840, + 842 + ], + [ + 844, + 845 + ], + [ + 846, + 848 + ], + [ + 851, + 854 + ], + [ + 855, + 859 + ], + [ + 860, + 861 + ], + [ + 864, + 867 + ], + [ + 873, + 874 + ], + [ + 888, + 891 + ], + [ + 892, + 893 + ], + [ + 894, + 895 + ], + [ + 896, + 897 + ], + [ + 901, + 903 + ], + [ + 911, + 914 + ], + [ + 915, + 916 + ], + [ + 918, + 919 + ], + [ + 920, + 921 + ], + [ + 926, + 927 + ], + [ + 940, + 943 + ], + [ + 944, + 945 + ], + [ + 946, + 948 + ], + [ + 957, + 958 + ], + [ + 959, + 963 + ], + [ + 966, + 967 + ], + [ + 969, + 970 + ], + [ + 971, + 972 + ], + [ + 974, + 975 + ], + [ + 977, + 978 + ], + [ + 983, + 984 + ], + [ + 985, + 986 + ], + [ + 987, + 988 + ], + [ + 990, + 991 + ], + [ + 996, + 997 + ], + [ + 998, + 999 + ], + [ + 1001, + 1002 + ], + [ + 1003, + 1004 + ], + [ + 1009, + 1010 + ], + [ + 1013, + 1016 + ], + [ + 1019, + 1028 + ], + [ + 1029, + 1031 + ], + [ + 1034, + 1035 + ], + [ + 1040, + 1041 + ], + [ + 1046, + 1047 + ], + [ + 1048, + 1049 + ], + [ + 1052, + 1053 + ], + [ + 1054, + 1056 + ], + [ + 1058, + 1059 + ], + [ + 1063, + 1065 + ], + [ + 1066, + 1067 + ], + [ + 1084, + 1085 + ], + [ + 1088, + 1089 + ], + [ + 1092, + 1093 + ], + [ + 1097, + 1098 + ], + [ + 1100, + 1101 + ], + [ + 1105, + 1106 + ], + [ + 1114, + 1115 + ], + [ + 1120, + 1123 + ], + [ + 1124, + 1125 + ], + [ + 1130, + 1131 + ], + [ + 1132, + 1136 + ], + [ + 1138, + 1142 + ], + [ + 1143, + 1147 + ], + [ + 1154, + 1157 + ], + [ + 1158, + 1159 + ], + [ + 1160, + 1167 + ], + [ + 1168, + 1169 + ], + [ + 1172, + 1173 + ], + [ + 1179, + 1181 + ], + [ + 1185, + 1187 + ], + [ + 1188, + 1191 + ], + [ + 1192, + 1193 + ], + [ + 1195, + 1196 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/source.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 18, + 46 + ], + [ + 79, + 86 + ], + [ + 98, + 222 + ], + [ + 224, + 388 + ], + [ + 392, + 428 + ], + [ + 436, + 490 + ], + [ + 495, + 532 + ], + [ + 533, + 566 + ], + [ + 571, + 594 + ], + [ + 602, + 639 + ], + [ + 640, + 695 + ], + [ + 698, + 743 + ], + [ + 747, + 754 + ], + [ + 755, + 807 + ], + [ + 810, + 861 + ], + [ + 865, + 892 + ], + [ + 893, + 960 + ], + [ + 969, + 1000 + ], + [ + 1006, + 1026 + ], + [ + 1035, + 1052 + ], + [ + 1056, + 1063 + ], + [ + 1064, + 1117 + ], + [ + 1123, + 1146 + ], + [ + 1154, + 1177 + ], + [ + 1184, + 1196 + ], + [ + 1202, + 1253 + ], + [ + 1254, + 1279 + ], + [ + 1280, + 1364 + ], + [ + 1367, + 1386 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 21, + 27 + ], + [ + 28, + 32 + ], + [ + 33, + 37 + ], + [ + 42, + 43 + ], + [ + 82, + 83 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ], + [ + 114, + 115 + ], + [ + 119, + 120 + ], + [ + 121, + 123 + ], + [ + 126, + 127 + ], + [ + 133, + 135 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 142, + 144 + ], + [ + 149, + 150 + ], + [ + 154, + 155 + ], + [ + 159, + 160 + ], + [ + 162, + 164 + ], + [ + 167, + 168 + ], + [ + 169, + 172 + ], + [ + 173, + 174 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 183, + 184 + ], + [ + 187, + 189 + ], + [ + 193, + 195 + ], + [ + 198, + 199 + ], + [ + 200, + 202 + ], + [ + 204, + 206 + ], + [ + 210, + 214 + ], + [ + 218, + 219 + ], + [ + 227, + 229 + ], + [ + 231, + 232 + ], + [ + 234, + 238 + ], + [ + 243, + 246 + ], + [ + 251, + 252 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 266, + 270 + ], + [ + 273, + 274 + ], + [ + 277, + 278 + ], + [ + 279, + 281 + ], + [ + 282, + 283 + ], + [ + 284, + 286 + ], + [ + 287, + 292 + ], + [ + 296, + 299 + ], + [ + 300, + 302 + ], + [ + 308, + 309 + ], + [ + 312, + 313 + ], + [ + 315, + 317 + ], + [ + 318, + 319 + ], + [ + 321, + 322 + ], + [ + 325, + 326 + ], + [ + 327, + 328 + ], + [ + 331, + 332 + ], + [ + 333, + 336 + ], + [ + 337, + 338 + ], + [ + 341, + 342 + ], + [ + 343, + 344 + ], + [ + 345, + 346 + ], + [ + 350, + 353 + ], + [ + 354, + 355 + ], + [ + 358, + 359 + ], + [ + 360, + 362 + ], + [ + 368, + 369 + ], + [ + 375, + 381 + ], + [ + 384, + 385 + ], + [ + 395, + 397 + ], + [ + 401, + 402 + ], + [ + 405, + 407 + ], + [ + 408, + 409 + ], + [ + 410, + 411 + ], + [ + 412, + 415 + ], + [ + 417, + 418 + ], + [ + 419, + 420 + ], + [ + 424, + 425 + ], + [ + 439, + 440 + ], + [ + 443, + 445 + ], + [ + 446, + 447 + ], + [ + 448, + 449 + ], + [ + 450, + 453 + ], + [ + 455, + 456 + ], + [ + 457, + 458 + ], + [ + 464, + 465 + ], + [ + 469, + 470 + ], + [ + 473, + 474 + ], + [ + 475, + 476 + ], + [ + 477, + 478 + ], + [ + 479, + 482 + ], + [ + 484, + 485 + ], + [ + 486, + 487 + ], + [ + 498, + 499 + ], + [ + 500, + 501 + ], + [ + 504, + 505 + ], + [ + 508, + 510 + ], + [ + 511, + 514 + ], + [ + 515, + 516 + ], + [ + 518, + 521 + ], + [ + 523, + 526 + ], + [ + 528, + 529 + ], + [ + 536, + 537 + ], + [ + 538, + 539 + ], + [ + 543, + 544 + ], + [ + 548, + 551 + ], + [ + 554, + 555 + ], + [ + 556, + 557 + ], + [ + 558, + 559 + ], + [ + 560, + 561 + ], + [ + 562, + 563 + ], + [ + 574, + 575 + ], + [ + 578, + 579 + ], + [ + 580, + 581 + ], + [ + 582, + 586 + ], + [ + 588, + 589 + ], + [ + 590, + 591 + ], + [ + 605, + 606 + ], + [ + 607, + 608 + ], + [ + 609, + 610 + ], + [ + 611, + 612 + ], + [ + 613, + 614 + ], + [ + 616, + 617 + ], + [ + 618, + 619 + ], + [ + 620, + 621 + ], + [ + 623, + 624 + ], + [ + 628, + 629 + ], + [ + 635, + 636 + ], + [ + 643, + 644 + ], + [ + 645, + 646 + ], + [ + 647, + 648 + ], + [ + 649, + 650 + ], + [ + 653, + 654 + ], + [ + 655, + 656 + ], + [ + 658, + 664 + ], + [ + 669, + 671 + ], + [ + 674, + 681 + ], + [ + 684, + 685 + ], + [ + 691, + 692 + ], + [ + 701, + 702 + ], + [ + 703, + 704 + ], + [ + 705, + 706 + ], + [ + 707, + 708 + ], + [ + 710, + 711 + ], + [ + 712, + 713 + ], + [ + 717, + 718 + ], + [ + 719, + 720 + ], + [ + 721, + 722 + ], + [ + 726, + 727 + ], + [ + 728, + 740 + ], + [ + 750, + 751 + ], + [ + 758, + 759 + ], + [ + 760, + 761 + ], + [ + 764, + 765 + ], + [ + 766, + 767 + ], + [ + 768, + 771 + ], + [ + 774, + 775 + ], + [ + 777, + 779 + ], + [ + 780, + 783 + ], + [ + 787, + 788 + ], + [ + 789, + 790 + ], + [ + 792, + 804 + ], + [ + 813, + 814 + ], + [ + 815, + 817 + ], + [ + 820, + 821 + ], + [ + 823, + 833 + ], + [ + 835, + 836 + ], + [ + 838, + 839 + ], + [ + 841, + 844 + ], + [ + 850, + 851 + ], + [ + 852, + 853 + ], + [ + 854, + 855 + ], + [ + 857, + 858 + ], + [ + 868, + 869 + ], + [ + 870, + 871 + ], + [ + 877, + 879 + ], + [ + 880, + 882 + ], + [ + 884, + 887 + ], + [ + 888, + 889 + ], + [ + 896, + 897 + ], + [ + 902, + 903 + ], + [ + 908, + 909 + ], + [ + 910, + 913 + ], + [ + 916, + 917 + ], + [ + 920, + 921 + ], + [ + 923, + 924 + ], + [ + 929, + 930 + ], + [ + 931, + 935 + ], + [ + 936, + 938 + ], + [ + 943, + 944 + ], + [ + 947, + 948 + ], + [ + 950, + 955 + ], + [ + 956, + 957 + ], + [ + 972, + 973 + ], + [ + 974, + 975 + ], + [ + 978, + 979 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 984, + 986 + ], + [ + 987, + 990 + ], + [ + 996, + 997 + ], + [ + 1009, + 1011 + ], + [ + 1012, + 1015 + ], + [ + 1019, + 1023 + ], + [ + 1038, + 1040 + ], + [ + 1041, + 1044 + ], + [ + 1047, + 1049 + ], + [ + 1059, + 1060 + ], + [ + 1067, + 1068 + ], + [ + 1069, + 1070 + ], + [ + 1071, + 1072 + ], + [ + 1073, + 1076 + ], + [ + 1080, + 1083 + ], + [ + 1087, + 1088 + ], + [ + 1089, + 1091 + ], + [ + 1094, + 1097 + ], + [ + 1098, + 1099 + ], + [ + 1101, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1107, + 1108 + ], + [ + 1109, + 1110 + ], + [ + 1111, + 1112 + ], + [ + 1113, + 1114 + ], + [ + 1126, + 1127 + ], + [ + 1132, + 1136 + ], + [ + 1139, + 1141 + ], + [ + 1142, + 1143 + ], + [ + 1157, + 1158 + ], + [ + 1159, + 1161 + ], + [ + 1164, + 1167 + ], + [ + 1168, + 1171 + ], + [ + 1172, + 1174 + ], + [ + 1187, + 1189 + ], + [ + 1191, + 1193 + ], + [ + 1205, + 1207 + ], + [ + 1212, + 1214 + ], + [ + 1217, + 1219 + ], + [ + 1224, + 1227 + ], + [ + 1230, + 1236 + ], + [ + 1240, + 1241 + ], + [ + 1242, + 1243 + ], + [ + 1249, + 1250 + ], + [ + 1257, + 1258 + ], + [ + 1259, + 1260 + ], + [ + 1261, + 1262 + ], + [ + 1263, + 1266 + ], + [ + 1270, + 1271 + ], + [ + 1273, + 1274 + ], + [ + 1275, + 1276 + ], + [ + 1283, + 1284 + ], + [ + 1289, + 1290 + ], + [ + 1294, + 1295 + ], + [ + 1296, + 1298 + ], + [ + 1299, + 1302 + ], + [ + 1303, + 1304 + ], + [ + 1307, + 1308 + ], + [ + 1312, + 1314 + ], + [ + 1320, + 1322 + ], + [ + 1326, + 1327 + ], + [ + 1328, + 1329 + ], + [ + 1330, + 1333 + ], + [ + 1334, + 1335 + ], + [ + 1336, + 1337 + ], + [ + 1338, + 1339 + ], + [ + 1341, + 1346 + ], + [ + 1352, + 1353 + ], + [ + 1356, + 1357 + ], + [ + 1360, + 1361 + ], + [ + 1370, + 1371 + ], + [ + 1375, + 1377 + ], + [ + 1378, + 1383 + ], + [ + 1384, + 1385 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sourcecustom.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 57, + 165 + ], + [ + 176, + 190 + ], + [ + 198, + 216 + ], + [ + 221, + 240 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 65, + 67 + ], + [ + 73, + 75 + ], + [ + 78, + 79 + ], + [ + 84, + 86 + ], + [ + 87, + 89 + ], + [ + 90, + 91 + ], + [ + 94, + 96 + ], + [ + 101, + 102 + ], + [ + 105, + 111 + ], + [ + 114, + 116 + ], + [ + 117, + 118 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 125, + 129 + ], + [ + 130, + 132 + ], + [ + 133, + 134 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 155, + 156 + ], + [ + 157, + 159 + ], + [ + 161, + 162 + ], + [ + 179, + 181 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 208, + 209 + ], + [ + 212, + 213 + ], + [ + 224, + 225 + ], + [ + 228, + 229 + ], + [ + 231, + 232 + ], + [ + 233, + 236 + ], + [ + 238, + 239 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sourceginput.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 54, + 69 + ], + [ + 71, + 239 + ], + [ + 245, + 266 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 57, + 59 + ], + [ + 65, + 66 + ], + [ + 74, + 75 + ], + [ + 76, + 79 + ], + [ + 81, + 82 + ], + [ + 83, + 85 + ], + [ + 86, + 87 + ], + [ + 91, + 97 + ], + [ + 100, + 120 + ], + [ + 123, + 125 + ], + [ + 126, + 128 + ], + [ + 129, + 132 + ], + [ + 133, + 134 + ], + [ + 137, + 139 + ], + [ + 140, + 142 + ], + [ + 146, + 148 + ], + [ + 151, + 156 + ], + [ + 158, + 159 + ], + [ + 160, + 161 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 178, + 179 + ], + [ + 180, + 183 + ], + [ + 187, + 190 + ], + [ + 191, + 196 + ], + [ + 198, + 199 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 209, + 210 + ], + [ + 211, + 214 + ], + [ + 219, + 220 + ], + [ + 226, + 232 + ], + [ + 235, + 236 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 259, + 262 + ], + [ + 264, + 265 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/system.c", + "line_filter": { + "diff_chunks": [ + [ + 26, + 54 + ], + [ + 97, + 129 + ], + [ + 135, + 322 + ], + [ + 332, + 364 + ], + [ + 368, + 394 + ] + ], + "lines_added": [ + [ + 29, + 45 + ], + [ + 50, + 51 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 110, + 113 + ], + [ + 116, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 138, + 140 + ], + [ + 142, + 143 + ], + [ + 145, + 147 + ], + [ + 148, + 160 + ], + [ + 165, + 166 + ], + [ + 169, + 175 + ], + [ + 177, + 186 + ], + [ + 187, + 192 + ], + [ + 198, + 209 + ], + [ + 210, + 216 + ], + [ + 217, + 223 + ], + [ + 224, + 226 + ], + [ + 227, + 228 + ], + [ + 230, + 234 + ], + [ + 235, + 238 + ], + [ + 240, + 242 + ], + [ + 243, + 245 + ], + [ + 246, + 251 + ], + [ + 253, + 254 + ], + [ + 257, + 258 + ], + [ + 259, + 262 + ], + [ + 268, + 269 + ], + [ + 271, + 272 + ], + [ + 275, + 278 + ], + [ + 279, + 291 + ], + [ + 292, + 294 + ], + [ + 295, + 298 + ], + [ + 299, + 301 + ], + [ + 302, + 305 + ], + [ + 306, + 308 + ], + [ + 309, + 312 + ], + [ + 313, + 315 + ], + [ + 318, + 319 + ], + [ + 335, + 337 + ], + [ + 339, + 340 + ], + [ + 342, + 343 + ], + [ + 345, + 346 + ], + [ + 347, + 351 + ], + [ + 353, + 354 + ], + [ + 357, + 358 + ], + [ + 360, + 361 + ], + [ + 371, + 375 + ], + [ + 380, + 381 + ], + [ + 383, + 384 + ], + [ + 388, + 391 + ], + [ + 392, + 393 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/target.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 10, + 38 + ], + [ + 67, + 194 + ], + [ + 201, + 281 + ], + [ + 284, + 312 + ], + [ + 321, + 372 + ], + [ + 379, + 401 + ], + [ + 409, + 497 + ], + [ + 499, + 531 + ], + [ + 534, + 541 + ], + [ + 545, + 561 + ], + [ + 565, + 595 + ], + [ + 598, + 643 + ], + [ + 648, + 661 + ], + [ + 663, + 707 + ], + [ + 708, + 719 + ], + [ + 726, + 743 + ], + [ + 745, + 759 + ], + [ + 761, + 791 + ], + [ + 793, + 843 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 13, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 29 + ], + [ + 34, + 35 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 83 + ], + [ + 86, + 88 + ], + [ + 91, + 94 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 111, + 116 + ], + [ + 118, + 119 + ], + [ + 125, + 131 + ], + [ + 136, + 138 + ], + [ + 144, + 145 + ], + [ + 147, + 150 + ], + [ + 151, + 152 + ], + [ + 154, + 156 + ], + [ + 157, + 158 + ], + [ + 161, + 162 + ], + [ + 163, + 166 + ], + [ + 167, + 169 + ], + [ + 173, + 174 + ], + [ + 175, + 176 + ], + [ + 178, + 180 + ], + [ + 181, + 183 + ], + [ + 186, + 188 + ], + [ + 189, + 191 + ], + [ + 204, + 206 + ], + [ + 208, + 211 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 220, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 230 + ], + [ + 231, + 236 + ], + [ + 239, + 240 + ], + [ + 242, + 245 + ], + [ + 247, + 248 + ], + [ + 249, + 250 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 268 + ], + [ + 269, + 271 + ], + [ + 277, + 278 + ], + [ + 287, + 290 + ], + [ + 291, + 293 + ], + [ + 297, + 303 + ], + [ + 306, + 307 + ], + [ + 308, + 309 + ], + [ + 324, + 325 + ], + [ + 328, + 330 + ], + [ + 331, + 332 + ], + [ + 333, + 334 + ], + [ + 335, + 338 + ], + [ + 340, + 341 + ], + [ + 345, + 346 + ], + [ + 352, + 353 + ], + [ + 356, + 358 + ], + [ + 359, + 360 + ], + [ + 361, + 362 + ], + [ + 363, + 366 + ], + [ + 368, + 369 + ], + [ + 382, + 383 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 390, + 391 + ], + [ + 392, + 395 + ], + [ + 397, + 398 + ], + [ + 412, + 413 + ], + [ + 416, + 417 + ], + [ + 418, + 419 + ], + [ + 422, + 428 + ], + [ + 429, + 433 + ], + [ + 434, + 435 + ], + [ + 441, + 442 + ], + [ + 445, + 447 + ], + [ + 448, + 449 + ], + [ + 450, + 451 + ], + [ + 452, + 454 + ], + [ + 455, + 456 + ], + [ + 458, + 459 + ], + [ + 460, + 461 + ], + [ + 463, + 469 + ], + [ + 475, + 476 + ], + [ + 479, + 480 + ], + [ + 481, + 483 + ], + [ + 484, + 485 + ], + [ + 486, + 490 + ], + [ + 493, + 494 + ], + [ + 502, + 503 + ], + [ + 507, + 508 + ], + [ + 509, + 510 + ], + [ + 511, + 514 + ], + [ + 515, + 516 + ], + [ + 518, + 520 + ], + [ + 522, + 524 + ], + [ + 527, + 528 + ], + [ + 537, + 538 + ], + [ + 548, + 549 + ], + [ + 550, + 551 + ], + [ + 552, + 553 + ], + [ + 554, + 556 + ], + [ + 557, + 558 + ], + [ + 568, + 569 + ], + [ + 574, + 575 + ], + [ + 576, + 577 + ], + [ + 580, + 582 + ], + [ + 583, + 585 + ], + [ + 586, + 587 + ], + [ + 588, + 590 + ], + [ + 591, + 592 + ], + [ + 601, + 602 + ], + [ + 608, + 609 + ], + [ + 610, + 611 + ], + [ + 612, + 613 + ], + [ + 614, + 616 + ], + [ + 617, + 619 + ], + [ + 622, + 623 + ], + [ + 627, + 628 + ], + [ + 629, + 631 + ], + [ + 633, + 635 + ], + [ + 639, + 640 + ], + [ + 651, + 652 + ], + [ + 653, + 654 + ], + [ + 657, + 658 + ], + [ + 666, + 667 + ], + [ + 669, + 670 + ], + [ + 673, + 674 + ], + [ + 677, + 678 + ], + [ + 679, + 682 + ], + [ + 684, + 685 + ], + [ + 687, + 688 + ], + [ + 689, + 690 + ], + [ + 694, + 695 + ], + [ + 696, + 698 + ], + [ + 699, + 700 + ], + [ + 703, + 704 + ], + [ + 711, + 712 + ], + [ + 713, + 714 + ], + [ + 715, + 716 + ], + [ + 729, + 730 + ], + [ + 731, + 732 + ], + [ + 733, + 736 + ], + [ + 739, + 740 + ], + [ + 748, + 749 + ], + [ + 752, + 753 + ], + [ + 754, + 756 + ], + [ + 764, + 766 + ], + [ + 769, + 770 + ], + [ + 775, + 778 + ], + [ + 779, + 780 + ], + [ + 781, + 782 + ], + [ + 783, + 784 + ], + [ + 787, + 788 + ], + [ + 796, + 797 + ], + [ + 798, + 799 + ], + [ + 803, + 804 + ], + [ + 807, + 809 + ], + [ + 811, + 812 + ], + [ + 814, + 815 + ], + [ + 816, + 817 + ], + [ + 820, + 823 + ], + [ + 824, + 827 + ], + [ + 828, + 831 + ], + [ + 832, + 835 + ], + [ + 836, + 839 + ], + [ + 841, + 842 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/targetcustom.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 57, + 234 + ], + [ + 247, + 265 + ], + [ + 272, + 286 + ], + [ + 294, + 308 + ], + [ + 312, + 325 + ], + [ + 326, + 343 + ], + [ + 348, + 367 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 65, + 70 + ], + [ + 76, + 78 + ], + [ + 81, + 82 + ], + [ + 87, + 89 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 106, + 108 + ], + [ + 109, + 111 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 122, + 123 + ], + [ + 126, + 132 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 141, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 150 + ], + [ + 151, + 153 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 162, + 163 + ], + [ + 168, + 170 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 183, + 185 + ], + [ + 186, + 187 + ], + [ + 188, + 189 + ], + [ + 192, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 226, + 228 + ], + [ + 230, + 231 + ], + [ + 250, + 251 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 275, + 277 + ], + [ + 278, + 279 + ], + [ + 282, + 283 + ], + [ + 297, + 299 + ], + [ + 300, + 301 + ], + [ + 304, + 305 + ], + [ + 315, + 317 + ], + [ + 318, + 319 + ], + [ + 321, + 322 + ], + [ + 329, + 331 + ], + [ + 332, + 333 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 351, + 352 + ], + [ + 355, + 356 + ], + [ + 357, + 359 + ], + [ + 360, + 363 + ], + [ + 365, + 366 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/thread.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 82, + 210 + ], + [ + 212, + 238 + ], + [ + 242, + 277 + ], + [ + 278, + 285 + ], + [ + 286, + 312 + ], + [ + 313, + 338 + ], + [ + 341, + 348 + ], + [ + 353, + 360 + ], + [ + 362, + 391 + ], + [ + 396, + 403 + ], + [ + 413, + 420 + ], + [ + 430, + 460 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 94, + 95 + ], + [ + 98, + 100 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 107, + 109 + ], + [ + 112, + 113 + ], + [ + 116, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 127 + ], + [ + 130, + 132 + ], + [ + 133, + 134 + ], + [ + 136, + 137 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 164, + 165 + ], + [ + 169, + 170 + ], + [ + 171, + 173 + ], + [ + 174, + 177 + ], + [ + 178, + 180 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 190, + 191 + ], + [ + 192, + 194 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 206, + 207 + ], + [ + 215, + 219 + ], + [ + 220, + 224 + ], + [ + 225, + 230 + ], + [ + 231, + 235 + ], + [ + 245, + 251 + ], + [ + 252, + 253 + ], + [ + 254, + 270 + ], + [ + 273, + 274 + ], + [ + 281, + 282 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 295, + 297 + ], + [ + 298, + 299 + ], + [ + 301, + 304 + ], + [ + 305, + 306 + ], + [ + 308, + 309 + ], + [ + 316, + 317 + ], + [ + 318, + 320 + ], + [ + 325, + 326 + ], + [ + 329, + 330 + ], + [ + 331, + 332 + ], + [ + 334, + 335 + ], + [ + 344, + 345 + ], + [ + 356, + 357 + ], + [ + 365, + 366 + ], + [ + 367, + 368 + ], + [ + 373, + 375 + ], + [ + 378, + 379 + ], + [ + 383, + 384 + ], + [ + 386, + 388 + ], + [ + 399, + 400 + ], + [ + 416, + 417 + ], + [ + 433, + 436 + ], + [ + 437, + 440 + ], + [ + 443, + 444 + ], + [ + 445, + 448 + ], + [ + 451, + 452 + ], + [ + 453, + 454 + ], + [ + 457, + 458 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/threadpool.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 22, + 59 + ], + [ + 80, + 87 + ], + [ + 112, + 143 + ], + [ + 151, + 206 + ], + [ + 207, + 233 + ], + [ + 245, + 264 + ], + [ + 275, + 282 + ], + [ + 288, + 308 + ], + [ + 311, + 384 + ], + [ + 386, + 495 + ], + [ + 498, + 538 + ], + [ + 562, + 571 + ], + [ + 586, + 593 + ], + [ + 625, + 636 + ], + [ + 637, + 657 + ], + [ + 660, + 708 + ], + [ + 717, + 726 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 25, + 26 + ], + [ + 30, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 46 + ], + [ + 51, + 52 + ], + [ + 55, + 56 + ], + [ + 83, + 84 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 121, + 123 + ], + [ + 126, + 127 + ], + [ + 133, + 134 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 159, + 160 + ], + [ + 162, + 163 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 178, + 180 + ], + [ + 181, + 184 + ], + [ + 187, + 188 + ], + [ + 189, + 191 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 210, + 211 + ], + [ + 215, + 216 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 228, + 230 + ], + [ + 248, + 249 + ], + [ + 250, + 252 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 278, + 279 + ], + [ + 291, + 292 + ], + [ + 295, + 296 + ], + [ + 297, + 300 + ], + [ + 301, + 303 + ], + [ + 304, + 305 + ], + [ + 314, + 315 + ], + [ + 318, + 319 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 326, + 327 + ], + [ + 328, + 329 + ], + [ + 334, + 335 + ], + [ + 339, + 340 + ], + [ + 343, + 344 + ], + [ + 346, + 347 + ], + [ + 349, + 350 + ], + [ + 352, + 353 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 364, + 365 + ], + [ + 366, + 368 + ], + [ + 369, + 370 + ], + [ + 371, + 372 + ], + [ + 373, + 376 + ], + [ + 380, + 381 + ], + [ + 389, + 390 + ], + [ + 394, + 395 + ], + [ + 396, + 397 + ], + [ + 398, + 399 + ], + [ + 401, + 402 + ], + [ + 403, + 411 + ], + [ + 412, + 413 + ], + [ + 417, + 418 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 423, + 425 + ], + [ + 428, + 429 + ], + [ + 434, + 435 + ], + [ + 438, + 440 + ], + [ + 444, + 445 + ], + [ + 448, + 452 + ], + [ + 456, + 457 + ], + [ + 458, + 459 + ], + [ + 462, + 463 + ], + [ + 464, + 465 + ], + [ + 466, + 471 + ], + [ + 474, + 475 + ], + [ + 476, + 478 + ], + [ + 482, + 483 + ], + [ + 484, + 488 + ], + [ + 491, + 492 + ], + [ + 501, + 503 + ], + [ + 508, + 510 + ], + [ + 514, + 515 + ], + [ + 519, + 521 + ], + [ + 522, + 524 + ], + [ + 525, + 526 + ], + [ + 528, + 529 + ], + [ + 530, + 533 + ], + [ + 534, + 535 + ], + [ + 565, + 566 + ], + [ + 567, + 568 + ], + [ + 589, + 590 + ], + [ + 628, + 629 + ], + [ + 630, + 633 + ], + [ + 640, + 643 + ], + [ + 644, + 646 + ], + [ + 647, + 648 + ], + [ + 652, + 654 + ], + [ + 663, + 667 + ], + [ + 669, + 670 + ], + [ + 672, + 673 + ], + [ + 674, + 675 + ], + [ + 676, + 678 + ], + [ + 680, + 682 + ], + [ + 684, + 686 + ], + [ + 688, + 692 + ], + [ + 693, + 697 + ], + [ + 699, + 705 + ], + [ + 720, + 721 + ], + [ + 722, + 723 + ], + [ + 724, + 725 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/threadset.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 60, + 67 + ], + [ + 84, + 91 + ], + [ + 95, + 122 + ], + [ + 129, + 190 + ], + [ + 195, + 226 + ], + [ + 233, + 241 + ], + [ + 242, + 264 + ], + [ + 265, + 298 + ], + [ + 299, + 332 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 64 + ], + [ + 87, + 88 + ], + [ + 98, + 99 + ], + [ + 103, + 104 + ], + [ + 106, + 109 + ], + [ + 113, + 115 + ], + [ + 118, + 119 + ], + [ + 132, + 135 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 147, + 148 + ], + [ + 151, + 156 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 163, + 167 + ], + [ + 168, + 169 + ], + [ + 171, + 173 + ], + [ + 174, + 178 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 206, + 208 + ], + [ + 210, + 213 + ], + [ + 215, + 216 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 236, + 238 + ], + [ + 245, + 247 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 254, + 256 + ], + [ + 259, + 261 + ], + [ + 268, + 269 + ], + [ + 270, + 271 + ], + [ + 276, + 277 + ], + [ + 281, + 283 + ], + [ + 284, + 285 + ], + [ + 286, + 288 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 294, + 295 + ], + [ + 302, + 303 + ], + [ + 304, + 305 + ], + [ + 308, + 309 + ], + [ + 312, + 314 + ], + [ + 315, + 316 + ], + [ + 317, + 318 + ], + [ + 319, + 320 + ], + [ + 322, + 323 + ], + [ + 325, + 328 + ], + [ + 329, + 331 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/type.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 13, + 41 + ], + [ + 63, + 70 + ], + [ + 73, + 80 + ], + [ + 96, + 191 + ], + [ + 192, + 240 + ], + [ + 246, + 253 + ], + [ + 255, + 266 + ], + [ + 268, + 314 + ], + [ + 324, + 357 + ], + [ + 361, + 388 + ], + [ + 392, + 507 + ], + [ + 508, + 565 + ], + [ + 567, + 587 + ], + [ + 589, + 633 + ], + [ + 637, + 702 + ], + [ + 713, + 807 + ], + [ + 816, + 832 + ], + [ + 841, + 863 + ], + [ + 864, + 927 + ], + [ + 928, + 1050 + ], + [ + 1059, + 1075 + ], + [ + 1084, + 1106 + ], + [ + 1107, + 1155 + ], + [ + 1156, + 1267 + ], + [ + 1269, + 1305 + ], + [ + 1307, + 1350 + ], + [ + 1355, + 1398 + ], + [ + 1400, + 1409 + ], + [ + 1410, + 1417 + ], + [ + 1420, + 1429 + ], + [ + 1430, + 1449 + ], + [ + 1450, + 1512 + ], + [ + 1517, + 1531 + ], + [ + 1534, + 1567 + ], + [ + 1570, + 1587 + ], + [ + 1589, + 1630 + ], + [ + 1632, + 1650 + ], + [ + 1662, + 1708 + ], + [ + 1718, + 1752 + ], + [ + 1761, + 1769 + ], + [ + 1770, + 1789 + ], + [ + 1795, + 1830 + ], + [ + 1836, + 1871 + ], + [ + 1877, + 1909 + ], + [ + 1915, + 1949 + ], + [ + 1953, + 1973 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 32 + ], + [ + 37, + 38 + ], + [ + 66, + 67 + ], + [ + 76, + 77 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 132, + 134 + ], + [ + 135, + 136 + ], + [ + 141, + 142 + ], + [ + 145, + 149 + ], + [ + 151, + 152 + ], + [ + 157, + 158 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 166, + 167 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 183, + 184 + ], + [ + 185, + 188 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 199, + 200 + ], + [ + 204, + 205 + ], + [ + 207, + 211 + ], + [ + 213, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 220, + 221 + ], + [ + 222, + 226 + ], + [ + 229, + 233 + ], + [ + 236, + 237 + ], + [ + 249, + 250 + ], + [ + 258, + 259 + ], + [ + 262, + 263 + ], + [ + 271, + 275 + ], + [ + 278, + 283 + ], + [ + 285, + 286 + ], + [ + 289, + 290 + ], + [ + 295, + 297 + ], + [ + 298, + 302 + ], + [ + 303, + 305 + ], + [ + 310, + 311 + ], + [ + 327, + 328 + ], + [ + 332, + 334 + ], + [ + 339, + 340 + ], + [ + 343, + 344 + ], + [ + 347, + 350 + ], + [ + 353, + 354 + ], + [ + 364, + 365 + ], + [ + 371, + 372 + ], + [ + 376, + 379 + ], + [ + 380, + 381 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 395, + 396 + ], + [ + 402, + 404 + ], + [ + 405, + 407 + ], + [ + 408, + 409 + ], + [ + 410, + 411 + ], + [ + 412, + 413 + ], + [ + 414, + 415 + ], + [ + 417, + 418 + ], + [ + 423, + 424 + ], + [ + 428, + 432 + ], + [ + 435, + 436 + ], + [ + 439, + 445 + ], + [ + 447, + 448 + ], + [ + 453, + 454 + ], + [ + 455, + 457 + ], + [ + 460, + 461 + ], + [ + 462, + 464 + ], + [ + 467, + 468 + ], + [ + 473, + 476 + ], + [ + 479, + 480 + ], + [ + 481, + 484 + ], + [ + 487, + 488 + ], + [ + 493, + 496 + ], + [ + 499, + 500 + ], + [ + 501, + 504 + ], + [ + 511, + 512 + ], + [ + 515, + 519 + ], + [ + 521, + 522 + ], + [ + 527, + 528 + ], + [ + 529, + 531 + ], + [ + 534, + 535 + ], + [ + 536, + 538 + ], + [ + 543, + 544 + ], + [ + 545, + 547 + ], + [ + 550, + 551 + ], + [ + 552, + 554 + ], + [ + 557, + 558 + ], + [ + 561, + 562 + ], + [ + 570, + 571 + ], + [ + 574, + 575 + ], + [ + 577, + 578 + ], + [ + 581, + 582 + ], + [ + 583, + 584 + ], + [ + 592, + 593 + ], + [ + 596, + 597 + ], + [ + 599, + 600 + ], + [ + 601, + 602 + ], + [ + 603, + 604 + ], + [ + 607, + 608 + ], + [ + 611, + 623 + ], + [ + 625, + 626 + ], + [ + 629, + 630 + ], + [ + 640, + 641 + ], + [ + 646, + 647 + ], + [ + 650, + 651 + ], + [ + 653, + 654 + ], + [ + 657, + 658 + ], + [ + 662, + 663 + ], + [ + 669, + 670 + ], + [ + 671, + 672 + ], + [ + 674, + 677 + ], + [ + 679, + 680 + ], + [ + 683, + 684 + ], + [ + 687, + 689 + ], + [ + 691, + 692 + ], + [ + 695, + 696 + ], + [ + 697, + 699 + ], + [ + 716, + 718 + ], + [ + 719, + 720 + ], + [ + 721, + 722 + ], + [ + 723, + 724 + ], + [ + 729, + 730 + ], + [ + 735, + 736 + ], + [ + 741, + 746 + ], + [ + 750, + 751 + ], + [ + 756, + 760 + ], + [ + 765, + 766 + ], + [ + 769, + 770 + ], + [ + 775, + 779 + ], + [ + 783, + 784 + ], + [ + 787, + 788 + ], + [ + 791, + 801 + ], + [ + 803, + 804 + ], + [ + 819, + 820 + ], + [ + 824, + 827 + ], + [ + 828, + 829 + ], + [ + 844, + 845 + ], + [ + 851, + 853 + ], + [ + 854, + 858 + ], + [ + 859, + 860 + ], + [ + 867, + 868 + ], + [ + 872, + 873 + ], + [ + 874, + 875 + ], + [ + 876, + 877 + ], + [ + 878, + 879 + ], + [ + 881, + 882 + ], + [ + 885, + 886 + ], + [ + 891, + 892 + ], + [ + 894, + 897 + ], + [ + 899, + 900 + ], + [ + 901, + 902 + ], + [ + 905, + 906 + ], + [ + 909, + 910 + ], + [ + 911, + 912 + ], + [ + 913, + 915 + ], + [ + 916, + 917 + ], + [ + 923, + 924 + ], + [ + 931, + 932 + ], + [ + 938, + 939 + ], + [ + 941, + 942 + ], + [ + 944, + 945 + ], + [ + 946, + 948 + ], + [ + 949, + 950 + ], + [ + 952, + 954 + ], + [ + 956, + 961 + ], + [ + 967, + 968 + ], + [ + 971, + 972 + ], + [ + 975, + 976 + ], + [ + 977, + 979 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 988, + 989 + ], + [ + 992, + 995 + ], + [ + 998, + 999 + ], + [ + 1002, + 1005 + ], + [ + 1008, + 1009 + ], + [ + 1011, + 1012 + ], + [ + 1015, + 1018 + ], + [ + 1022, + 1023 + ], + [ + 1026, + 1044 + ], + [ + 1046, + 1047 + ], + [ + 1062, + 1063 + ], + [ + 1067, + 1070 + ], + [ + 1071, + 1072 + ], + [ + 1087, + 1088 + ], + [ + 1094, + 1096 + ], + [ + 1097, + 1101 + ], + [ + 1102, + 1103 + ], + [ + 1110, + 1111 + ], + [ + 1115, + 1116 + ], + [ + 1117, + 1118 + ], + [ + 1119, + 1120 + ], + [ + 1121, + 1122 + ], + [ + 1124, + 1125 + ], + [ + 1128, + 1129 + ], + [ + 1134, + 1135 + ], + [ + 1137, + 1140 + ], + [ + 1142, + 1143 + ], + [ + 1144, + 1145 + ], + [ + 1151, + 1152 + ], + [ + 1159, + 1160 + ], + [ + 1165, + 1166 + ], + [ + 1168, + 1169 + ], + [ + 1171, + 1172 + ], + [ + 1173, + 1175 + ], + [ + 1176, + 1177 + ], + [ + 1179, + 1181 + ], + [ + 1183, + 1187 + ], + [ + 1193, + 1194 + ], + [ + 1199, + 1200 + ], + [ + 1203, + 1206 + ], + [ + 1209, + 1210 + ], + [ + 1213, + 1216 + ], + [ + 1219, + 1220 + ], + [ + 1222, + 1223 + ], + [ + 1226, + 1229 + ], + [ + 1232, + 1233 + ], + [ + 1235, + 1236 + ], + [ + 1237, + 1238 + ], + [ + 1241, + 1242 + ], + [ + 1245, + 1261 + ], + [ + 1263, + 1264 + ], + [ + 1272, + 1273 + ], + [ + 1274, + 1275 + ], + [ + 1279, + 1280 + ], + [ + 1286, + 1287 + ], + [ + 1292, + 1293 + ], + [ + 1295, + 1299 + ], + [ + 1301, + 1302 + ], + [ + 1310, + 1311 + ], + [ + 1312, + 1313 + ], + [ + 1317, + 1318 + ], + [ + 1324, + 1325 + ], + [ + 1331, + 1332 + ], + [ + 1334, + 1339 + ], + [ + 1340, + 1341 + ], + [ + 1342, + 1343 + ], + [ + 1346, + 1347 + ], + [ + 1358, + 1359 + ], + [ + 1361, + 1362 + ], + [ + 1364, + 1365 + ], + [ + 1366, + 1367 + ], + [ + 1369, + 1370 + ], + [ + 1371, + 1372 + ], + [ + 1374, + 1381 + ], + [ + 1386, + 1387 + ], + [ + 1388, + 1389 + ], + [ + 1394, + 1395 + ], + [ + 1403, + 1404 + ], + [ + 1405, + 1406 + ], + [ + 1413, + 1414 + ], + [ + 1423, + 1424 + ], + [ + 1425, + 1426 + ], + [ + 1433, + 1434 + ], + [ + 1436, + 1441 + ], + [ + 1443, + 1444 + ], + [ + 1445, + 1446 + ], + [ + 1453, + 1454 + ], + [ + 1458, + 1459 + ], + [ + 1460, + 1461 + ], + [ + 1462, + 1463 + ], + [ + 1464, + 1465 + ], + [ + 1467, + 1468 + ], + [ + 1471, + 1472 + ], + [ + 1474, + 1475 + ], + [ + 1476, + 1477 + ], + [ + 1481, + 1482 + ], + [ + 1484, + 1486 + ], + [ + 1489, + 1490 + ], + [ + 1491, + 1493 + ], + [ + 1496, + 1497 + ], + [ + 1500, + 1506 + ], + [ + 1508, + 1509 + ], + [ + 1520, + 1521 + ], + [ + 1524, + 1528 + ], + [ + 1537, + 1538 + ], + [ + 1540, + 1541 + ], + [ + 1544, + 1545 + ], + [ + 1546, + 1547 + ], + [ + 1549, + 1550 + ], + [ + 1555, + 1556 + ], + [ + 1558, + 1559 + ], + [ + 1560, + 1561 + ], + [ + 1563, + 1564 + ], + [ + 1573, + 1574 + ], + [ + 1575, + 1576 + ], + [ + 1577, + 1578 + ], + [ + 1580, + 1581 + ], + [ + 1583, + 1584 + ], + [ + 1592, + 1593 + ], + [ + 1597, + 1598 + ], + [ + 1599, + 1604 + ], + [ + 1606, + 1607 + ], + [ + 1613, + 1614 + ], + [ + 1616, + 1617 + ], + [ + 1618, + 1619 + ], + [ + 1621, + 1622 + ], + [ + 1626, + 1627 + ], + [ + 1635, + 1636 + ], + [ + 1639, + 1640 + ], + [ + 1641, + 1644 + ], + [ + 1646, + 1647 + ], + [ + 1665, + 1667 + ], + [ + 1670, + 1671 + ], + [ + 1672, + 1675 + ], + [ + 1677, + 1678 + ], + [ + 1684, + 1685 + ], + [ + 1686, + 1687 + ], + [ + 1693, + 1694 + ], + [ + 1697, + 1698 + ], + [ + 1699, + 1702 + ], + [ + 1704, + 1705 + ], + [ + 1721, + 1722 + ], + [ + 1723, + 1724 + ], + [ + 1727, + 1728 + ], + [ + 1729, + 1732 + ], + [ + 1733, + 1734 + ], + [ + 1735, + 1736 + ], + [ + 1739, + 1740 + ], + [ + 1743, + 1746 + ], + [ + 1748, + 1749 + ], + [ + 1764, + 1766 + ], + [ + 1773, + 1776 + ], + [ + 1777, + 1778 + ], + [ + 1779, + 1780 + ], + [ + 1782, + 1783 + ], + [ + 1785, + 1786 + ], + [ + 1798, + 1799 + ], + [ + 1800, + 1801 + ], + [ + 1803, + 1804 + ], + [ + 1807, + 1808 + ], + [ + 1809, + 1810 + ], + [ + 1814, + 1815 + ], + [ + 1816, + 1817 + ], + [ + 1818, + 1819 + ], + [ + 1821, + 1823 + ], + [ + 1826, + 1827 + ], + [ + 1839, + 1840 + ], + [ + 1841, + 1842 + ], + [ + 1844, + 1845 + ], + [ + 1848, + 1849 + ], + [ + 1850, + 1851 + ], + [ + 1855, + 1856 + ], + [ + 1857, + 1858 + ], + [ + 1859, + 1860 + ], + [ + 1862, + 1864 + ], + [ + 1867, + 1868 + ], + [ + 1880, + 1881 + ], + [ + 1882, + 1883 + ], + [ + 1885, + 1886 + ], + [ + 1888, + 1889 + ], + [ + 1890, + 1891 + ], + [ + 1895, + 1896 + ], + [ + 1899, + 1900 + ], + [ + 1901, + 1903 + ], + [ + 1905, + 1906 + ], + [ + 1918, + 1919 + ], + [ + 1920, + 1921 + ], + [ + 1923, + 1924 + ], + [ + 1926, + 1927 + ], + [ + 1928, + 1929 + ], + [ + 1933, + 1934 + ], + [ + 1937, + 1940 + ], + [ + 1945, + 1946 + ], + [ + 1956, + 1959 + ], + [ + 1960, + 1972 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/util.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 66, + 169 + ], + [ + 170, + 187 + ], + [ + 189, + 220 + ], + [ + 224, + 239 + ], + [ + 241, + 250 + ], + [ + 251, + 334 + ], + [ + 336, + 361 + ], + [ + 363, + 370 + ], + [ + 375, + 382 + ], + [ + 404, + 467 + ], + [ + 469, + 509 + ], + [ + 511, + 587 + ], + [ + 589, + 669 + ], + [ + 673, + 759 + ], + [ + 767, + 867 + ], + [ + 869, + 1022 + ], + [ + 1025, + 1103 + ], + [ + 1107, + 1262 + ], + [ + 1264, + 1280 + ], + [ + 1305, + 1332 + ], + [ + 1337, + 1355 + ], + [ + 1356, + 1398 + ], + [ + 1400, + 1430 + ], + [ + 1435, + 1468 + ], + [ + 1477, + 1492 + ], + [ + 1494, + 1555 + ], + [ + 1558, + 1631 + ], + [ + 1632, + 1694 + ], + [ + 1696, + 1703 + ], + [ + 1711, + 1841 + ], + [ + 1842, + 1865 + ], + [ + 1866, + 1901 + ], + [ + 1902, + 2076 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 69, + 70 + ], + [ + 74, + 75 + ], + [ + 76, + 79 + ], + [ + 84, + 88 + ], + [ + 93, + 94 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 111, + 112 + ], + [ + 117, + 119 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 130 + ], + [ + 135, + 136 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 148 + ], + [ + 149, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 158 + ], + [ + 159, + 160 + ], + [ + 165, + 166 + ], + [ + 173, + 175 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 183, + 184 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 198, + 199 + ], + [ + 204, + 205 + ], + [ + 206, + 208 + ], + [ + 211, + 212 + ], + [ + 213, + 215 + ], + [ + 216, + 217 + ], + [ + 227, + 228 + ], + [ + 229, + 230 + ], + [ + 235, + 236 + ], + [ + 244, + 245 + ], + [ + 246, + 247 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 258, + 259 + ], + [ + 260, + 264 + ], + [ + 265, + 266 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 277, + 282 + ], + [ + 284, + 285 + ], + [ + 287, + 291 + ], + [ + 292, + 294 + ], + [ + 295, + 296 + ], + [ + 298, + 299 + ], + [ + 301, + 305 + ], + [ + 306, + 308 + ], + [ + 309, + 310 + ], + [ + 313, + 314 + ], + [ + 316, + 317 + ], + [ + 320, + 323 + ], + [ + 327, + 329 + ], + [ + 330, + 331 + ], + [ + 339, + 340 + ], + [ + 345, + 347 + ], + [ + 349, + 351 + ], + [ + 355, + 356 + ], + [ + 357, + 358 + ], + [ + 366, + 367 + ], + [ + 378, + 379 + ], + [ + 407, + 408 + ], + [ + 409, + 411 + ], + [ + 412, + 417 + ], + [ + 418, + 421 + ], + [ + 424, + 426 + ], + [ + 427, + 428 + ], + [ + 429, + 441 + ], + [ + 445, + 447 + ], + [ + 453, + 454 + ], + [ + 459, + 460 + ], + [ + 462, + 464 + ], + [ + 472, + 485 + ], + [ + 489, + 490 + ], + [ + 494, + 497 + ], + [ + 498, + 499 + ], + [ + 505, + 506 + ], + [ + 514, + 515 + ], + [ + 518, + 519 + ], + [ + 522, + 524 + ], + [ + 528, + 529 + ], + [ + 530, + 531 + ], + [ + 536, + 537 + ], + [ + 541, + 543 + ], + [ + 545, + 546 + ], + [ + 547, + 550 + ], + [ + 552, + 553 + ], + [ + 558, + 559 + ], + [ + 561, + 562 + ], + [ + 563, + 567 + ], + [ + 571, + 572 + ], + [ + 573, + 574 + ], + [ + 577, + 579 + ], + [ + 583, + 584 + ], + [ + 592, + 593 + ], + [ + 595, + 596 + ], + [ + 597, + 600 + ], + [ + 606, + 607 + ], + [ + 613, + 614 + ], + [ + 615, + 616 + ], + [ + 618, + 619 + ], + [ + 621, + 624 + ], + [ + 626, + 627 + ], + [ + 629, + 631 + ], + [ + 632, + 633 + ], + [ + 638, + 639 + ], + [ + 642, + 643 + ], + [ + 645, + 648 + ], + [ + 650, + 651 + ], + [ + 655, + 657 + ], + [ + 661, + 664 + ], + [ + 665, + 666 + ], + [ + 676, + 678 + ], + [ + 683, + 684 + ], + [ + 687, + 688 + ], + [ + 691, + 693 + ], + [ + 694, + 696 + ], + [ + 698, + 701 + ], + [ + 702, + 704 + ], + [ + 706, + 708 + ], + [ + 709, + 710 + ], + [ + 713, + 714 + ], + [ + 719, + 720 + ], + [ + 723, + 724 + ], + [ + 727, + 732 + ], + [ + 734, + 735 + ], + [ + 740, + 741 + ], + [ + 742, + 743 + ], + [ + 744, + 745 + ], + [ + 746, + 748 + ], + [ + 750, + 754 + ], + [ + 755, + 756 + ], + [ + 770, + 776 + ], + [ + 781, + 784 + ], + [ + 785, + 786 + ], + [ + 788, + 789 + ], + [ + 792, + 793 + ], + [ + 794, + 804 + ], + [ + 809, + 810 + ], + [ + 812, + 813 + ], + [ + 819, + 821 + ], + [ + 825, + 830 + ], + [ + 831, + 832 + ], + [ + 833, + 834 + ], + [ + 839, + 840 + ], + [ + 843, + 845 + ], + [ + 846, + 851 + ], + [ + 853, + 854 + ], + [ + 856, + 858 + ], + [ + 863, + 864 + ], + [ + 872, + 876 + ], + [ + 877, + 878 + ], + [ + 881, + 882 + ], + [ + 884, + 885 + ], + [ + 887, + 888 + ], + [ + 891, + 896 + ], + [ + 900, + 901 + ], + [ + 906, + 907 + ], + [ + 910, + 912 + ], + [ + 913, + 914 + ], + [ + 917, + 918 + ], + [ + 921, + 923 + ], + [ + 924, + 925 + ], + [ + 928, + 929 + ], + [ + 930, + 932 + ], + [ + 935, + 936 + ], + [ + 939, + 941 + ], + [ + 942, + 943 + ], + [ + 948, + 949 + ], + [ + 950, + 952 + ], + [ + 957, + 958 + ], + [ + 964, + 967 + ], + [ + 968, + 969 + ], + [ + 970, + 971 + ], + [ + 973, + 975 + ], + [ + 978, + 979 + ], + [ + 985, + 986 + ], + [ + 988, + 989 + ], + [ + 990, + 991 + ], + [ + 993, + 995 + ], + [ + 996, + 997 + ], + [ + 999, + 1001 + ], + [ + 1004, + 1007 + ], + [ + 1009, + 1010 + ], + [ + 1011, + 1012 + ], + [ + 1018, + 1019 + ], + [ + 1028, + 1029 + ], + [ + 1032, + 1033 + ], + [ + 1036, + 1037 + ], + [ + 1040, + 1042 + ], + [ + 1045, + 1046 + ], + [ + 1049, + 1051 + ], + [ + 1053, + 1054 + ], + [ + 1057, + 1058 + ], + [ + 1059, + 1060 + ], + [ + 1063, + 1064 + ], + [ + 1065, + 1066 + ], + [ + 1069, + 1070 + ], + [ + 1074, + 1077 + ], + [ + 1078, + 1079 + ], + [ + 1080, + 1081 + ], + [ + 1083, + 1084 + ], + [ + 1089, + 1090 + ], + [ + 1093, + 1097 + ], + [ + 1099, + 1100 + ], + [ + 1110, + 1111 + ], + [ + 1113, + 1123 + ], + [ + 1124, + 1129 + ], + [ + 1132, + 1133 + ], + [ + 1138, + 1139 + ], + [ + 1140, + 1143 + ], + [ + 1144, + 1147 + ], + [ + 1148, + 1149 + ], + [ + 1150, + 1151 + ], + [ + 1152, + 1153 + ], + [ + 1158, + 1159 + ], + [ + 1160, + 1163 + ], + [ + 1164, + 1167 + ], + [ + 1168, + 1169 + ], + [ + 1170, + 1171 + ], + [ + 1172, + 1173 + ], + [ + 1178, + 1179 + ], + [ + 1180, + 1193 + ], + [ + 1194, + 1195 + ], + [ + 1196, + 1197 + ], + [ + 1202, + 1203 + ], + [ + 1204, + 1217 + ], + [ + 1218, + 1219 + ], + [ + 1220, + 1221 + ], + [ + 1223, + 1224 + ], + [ + 1226, + 1227 + ], + [ + 1228, + 1233 + ], + [ + 1235, + 1236 + ], + [ + 1241, + 1242 + ], + [ + 1245, + 1246 + ], + [ + 1249, + 1250 + ], + [ + 1251, + 1252 + ], + [ + 1253, + 1254 + ], + [ + 1258, + 1259 + ], + [ + 1267, + 1269 + ], + [ + 1272, + 1275 + ], + [ + 1276, + 1277 + ], + [ + 1308, + 1309 + ], + [ + 1311, + 1312 + ], + [ + 1315, + 1317 + ], + [ + 1319, + 1320 + ], + [ + 1322, + 1323 + ], + [ + 1328, + 1329 + ], + [ + 1340, + 1341 + ], + [ + 1342, + 1344 + ], + [ + 1350, + 1352 + ], + [ + 1359, + 1360 + ], + [ + 1365, + 1367 + ], + [ + 1368, + 1372 + ], + [ + 1374, + 1375 + ], + [ + 1380, + 1382 + ], + [ + 1385, + 1392 + ], + [ + 1394, + 1395 + ], + [ + 1403, + 1405 + ], + [ + 1408, + 1410 + ], + [ + 1411, + 1412 + ], + [ + 1413, + 1415 + ], + [ + 1418, + 1419 + ], + [ + 1422, + 1425 + ], + [ + 1426, + 1427 + ], + [ + 1438, + 1439 + ], + [ + 1440, + 1442 + ], + [ + 1444, + 1445 + ], + [ + 1450, + 1452 + ], + [ + 1455, + 1462 + ], + [ + 1464, + 1465 + ], + [ + 1480, + 1481 + ], + [ + 1484, + 1485 + ], + [ + 1488, + 1489 + ], + [ + 1497, + 1502 + ], + [ + 1506, + 1508 + ], + [ + 1511, + 1514 + ], + [ + 1516, + 1518 + ], + [ + 1519, + 1520 + ], + [ + 1522, + 1523 + ], + [ + 1528, + 1530 + ], + [ + 1533, + 1534 + ], + [ + 1538, + 1539 + ], + [ + 1541, + 1542 + ], + [ + 1545, + 1548 + ], + [ + 1551, + 1552 + ], + [ + 1561, + 1562 + ], + [ + 1567, + 1569 + ], + [ + 1573, + 1574 + ], + [ + 1576, + 1577 + ], + [ + 1578, + 1579 + ], + [ + 1584, + 1585 + ], + [ + 1587, + 1588 + ], + [ + 1589, + 1590 + ], + [ + 1595, + 1596 + ], + [ + 1599, + 1600 + ], + [ + 1603, + 1604 + ], + [ + 1608, + 1611 + ], + [ + 1613, + 1614 + ], + [ + 1618, + 1619 + ], + [ + 1621, + 1622 + ], + [ + 1624, + 1625 + ], + [ + 1627, + 1628 + ], + [ + 1635, + 1636 + ], + [ + 1637, + 1641 + ], + [ + 1643, + 1644 + ], + [ + 1647, + 1648 + ], + [ + 1651, + 1652 + ], + [ + 1654, + 1656 + ], + [ + 1658, + 1660 + ], + [ + 1661, + 1663 + ], + [ + 1665, + 1691 + ], + [ + 1699, + 1700 + ], + [ + 1714, + 1716 + ], + [ + 1717, + 1718 + ], + [ + 1720, + 1722 + ], + [ + 1726, + 1727 + ], + [ + 1728, + 1730 + ], + [ + 1731, + 1732 + ], + [ + 1737, + 1738 + ], + [ + 1741, + 1743 + ], + [ + 1744, + 1745 + ], + [ + 1748, + 1749 + ], + [ + 1752, + 1754 + ], + [ + 1755, + 1756 + ], + [ + 1759, + 1760 + ], + [ + 1766, + 1767 + ], + [ + 1768, + 1771 + ], + [ + 1772, + 1773 + ], + [ + 1774, + 1778 + ], + [ + 1781, + 1785 + ], + [ + 1787, + 1790 + ], + [ + 1791, + 1792 + ], + [ + 1795, + 1796 + ], + [ + 1802, + 1803 + ], + [ + 1804, + 1807 + ], + [ + 1808, + 1809 + ], + [ + 1810, + 1814 + ], + [ + 1815, + 1819 + ], + [ + 1821, + 1824 + ], + [ + 1825, + 1826 + ], + [ + 1828, + 1829 + ], + [ + 1834, + 1835 + ], + [ + 1836, + 1838 + ], + [ + 1845, + 1846 + ], + [ + 1850, + 1852 + ], + [ + 1854, + 1855 + ], + [ + 1856, + 1857 + ], + [ + 1859, + 1862 + ], + [ + 1869, + 1872 + ], + [ + 1877, + 1879 + ], + [ + 1884, + 1886 + ], + [ + 1887, + 1890 + ], + [ + 1891, + 1892 + ], + [ + 1897, + 1898 + ], + [ + 1905, + 1906 + ], + [ + 1909, + 1911 + ], + [ + 1913, + 1914 + ], + [ + 1915, + 1916 + ], + [ + 1921, + 1923 + ], + [ + 1924, + 1925 + ], + [ + 1926, + 1930 + ], + [ + 1931, + 1932 + ], + [ + 1935, + 1936 + ], + [ + 1940, + 1941 + ], + [ + 1942, + 1943 + ], + [ + 1946, + 1947 + ], + [ + 1953, + 1954 + ], + [ + 1959, + 1961 + ], + [ + 1963, + 1966 + ], + [ + 1967, + 1968 + ], + [ + 1972, + 1973 + ], + [ + 1976, + 1977 + ], + [ + 1980, + 1982 + ], + [ + 1988, + 1989 + ], + [ + 1990, + 1991 + ], + [ + 1993, + 1994 + ], + [ + 1999, + 2000 + ], + [ + 2004, + 2008 + ], + [ + 2010, + 2011 + ], + [ + 2014, + 2015 + ], + [ + 2018, + 2020 + ], + [ + 2023, + 2024 + ], + [ + 2027, + 2030 + ], + [ + 2031, + 2038 + ], + [ + 2039, + 2042 + ], + [ + 2044, + 2045 + ], + [ + 2051, + 2052 + ], + [ + 2057, + 2059 + ], + [ + 2061, + 2063 + ], + [ + 2064, + 2066 + ], + [ + 2070, + 2073 + ], + [ + 2074, + 2075 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/vector.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 40 + ], + [ + 70, + 93 + ], + [ + 94, + 111 + ], + [ + 112, + 140 + ], + [ + 141, + 168 + ], + [ + 170, + 177 + ], + [ + 182, + 189 + ], + [ + 191, + 297 + ], + [ + 300, + 392 + ], + [ + 394, + 545 + ], + [ + 549, + 558 + ], + [ + 564, + 589 + ], + [ + 592, + 599 + ], + [ + 601, + 613 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 34, + 35 + ], + [ + 36, + 37 + ], + [ + 73, + 74 + ], + [ + 77, + 80 + ], + [ + 84, + 86 + ], + [ + 89, + 90 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 115, + 117 + ], + [ + 119, + 122 + ], + [ + 125, + 127 + ], + [ + 132, + 133 + ], + [ + 136, + 137 + ], + [ + 144, + 146 + ], + [ + 147, + 148 + ], + [ + 149, + 151 + ], + [ + 154, + 155 + ], + [ + 161, + 163 + ], + [ + 164, + 165 + ], + [ + 173, + 174 + ], + [ + 185, + 186 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 198, + 199 + ], + [ + 201, + 204 + ], + [ + 208, + 209 + ], + [ + 213, + 215 + ], + [ + 216, + 217 + ], + [ + 220, + 223 + ], + [ + 227, + 228 + ], + [ + 232, + 235 + ], + [ + 236, + 237 + ], + [ + 241, + 242 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 253, + 254 + ], + [ + 260, + 262 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 269 + ], + [ + 270, + 273 + ], + [ + 279, + 281 + ], + [ + 283, + 284 + ], + [ + 285, + 286 + ], + [ + 288, + 291 + ], + [ + 292, + 294 + ], + [ + 303, + 304 + ], + [ + 308, + 309 + ], + [ + 310, + 312 + ], + [ + 314, + 316 + ], + [ + 318, + 319 + ], + [ + 322, + 323 + ], + [ + 326, + 327 + ], + [ + 329, + 330 + ], + [ + 331, + 333 + ], + [ + 335, + 337 + ], + [ + 343, + 344 + ], + [ + 348, + 349 + ], + [ + 350, + 353 + ], + [ + 355, + 357 + ], + [ + 359, + 360 + ], + [ + 363, + 364 + ], + [ + 367, + 368 + ], + [ + 372, + 373 + ], + [ + 374, + 375 + ], + [ + 376, + 378 + ], + [ + 380, + 381 + ], + [ + 384, + 385 + ], + [ + 388, + 389 + ], + [ + 397, + 399 + ], + [ + 403, + 405 + ], + [ + 406, + 407 + ], + [ + 408, + 410 + ], + [ + 411, + 412 + ], + [ + 414, + 416 + ], + [ + 417, + 418 + ], + [ + 421, + 422 + ], + [ + 428, + 431 + ], + [ + 433, + 434 + ], + [ + 435, + 436 + ], + [ + 437, + 438 + ], + [ + 440, + 441 + ], + [ + 446, + 447 + ], + [ + 450, + 451 + ], + [ + 454, + 457 + ], + [ + 458, + 471 + ], + [ + 474, + 475 + ], + [ + 479, + 481 + ], + [ + 485, + 486 + ], + [ + 488, + 490 + ], + [ + 494, + 495 + ], + [ + 497, + 499 + ], + [ + 503, + 505 + ], + [ + 507, + 509 + ], + [ + 512, + 515 + ], + [ + 518, + 519 + ], + [ + 522, + 523 + ], + [ + 526, + 527 + ], + [ + 529, + 530 + ], + [ + 533, + 535 + ], + [ + 541, + 542 + ], + [ + 552, + 553 + ], + [ + 554, + 555 + ], + [ + 567, + 569 + ], + [ + 571, + 572 + ], + [ + 574, + 575 + ], + [ + 576, + 577 + ], + [ + 578, + 579 + ], + [ + 581, + 584 + ], + [ + 585, + 586 + ], + [ + 595, + 596 + ], + [ + 604, + 605 + ], + [ + 606, + 607 + ], + [ + 609, + 610 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 13, + 20 + ], + [ + 31, + 59 + ], + [ + 110, + 117 + ], + [ + 120, + 173 + ], + [ + 174, + 182 + ], + [ + 184, + 202 + ], + [ + 203, + 230 + ], + [ + 231, + 246 + ], + [ + 247, + 293 + ], + [ + 294, + 419 + ], + [ + 421, + 545 + ], + [ + 548, + 580 + ], + [ + 598, + 640 + ], + [ + 642, + 869 + ], + [ + 870, + 955 + ], + [ + 957, + 1019 + ], + [ + 1026, + 1059 + ], + [ + 1062, + 1099 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 16, + 17 + ], + [ + 34, + 40 + ], + [ + 41, + 45 + ], + [ + 46, + 50 + ], + [ + 55, + 56 + ], + [ + 113, + 114 + ], + [ + 123, + 124 + ], + [ + 126, + 127 + ], + [ + 130, + 131 + ], + [ + 134, + 135 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 143, + 144 + ], + [ + 147, + 149 + ], + [ + 151, + 153 + ], + [ + 155, + 161 + ], + [ + 163, + 164 + ], + [ + 166, + 167 + ], + [ + 169, + 170 + ], + [ + 177, + 179 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 192, + 196 + ], + [ + 197, + 199 + ], + [ + 206, + 207 + ], + [ + 208, + 210 + ], + [ + 214, + 217 + ], + [ + 219, + 224 + ], + [ + 226, + 227 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 242, + 243 + ], + [ + 250, + 251 + ], + [ + 256, + 257 + ], + [ + 261, + 263 + ], + [ + 268, + 269 + ], + [ + 273, + 275 + ], + [ + 280, + 281 + ], + [ + 284, + 288 + ], + [ + 289, + 290 + ], + [ + 297, + 298 + ], + [ + 301, + 315 + ], + [ + 318, + 319 + ], + [ + 325, + 328 + ], + [ + 332, + 334 + ], + [ + 335, + 340 + ], + [ + 342, + 343 + ], + [ + 345, + 346 + ], + [ + 347, + 351 + ], + [ + 356, + 357 + ], + [ + 361, + 363 + ], + [ + 365, + 366 + ], + [ + 367, + 371 + ], + [ + 374, + 378 + ], + [ + 379, + 383 + ], + [ + 385, + 386 + ], + [ + 392, + 393 + ], + [ + 394, + 397 + ], + [ + 402, + 407 + ], + [ + 411, + 416 + ], + [ + 424, + 425 + ], + [ + 428, + 429 + ], + [ + 433, + 434 + ], + [ + 439, + 440 + ], + [ + 446, + 448 + ], + [ + 450, + 455 + ], + [ + 460, + 461 + ], + [ + 464, + 467 + ], + [ + 469, + 470 + ], + [ + 475, + 476 + ], + [ + 479, + 487 + ], + [ + 490, + 491 + ], + [ + 496, + 497 + ], + [ + 500, + 502 + ], + [ + 503, + 504 + ], + [ + 509, + 510 + ], + [ + 514, + 521 + ], + [ + 522, + 527 + ], + [ + 530, + 533 + ], + [ + 535, + 536 + ], + [ + 539, + 540 + ], + [ + 541, + 542 + ], + [ + 551, + 555 + ], + [ + 556, + 561 + ], + [ + 565, + 567 + ], + [ + 570, + 573 + ], + [ + 574, + 575 + ], + [ + 576, + 577 + ], + [ + 601, + 602 + ], + [ + 605, + 607 + ], + [ + 612, + 615 + ], + [ + 617, + 623 + ], + [ + 625, + 628 + ], + [ + 629, + 630 + ], + [ + 631, + 637 + ], + [ + 645, + 646 + ], + [ + 652, + 653 + ], + [ + 656, + 658 + ], + [ + 661, + 663 + ], + [ + 664, + 666 + ], + [ + 668, + 669 + ], + [ + 672, + 673 + ], + [ + 677, + 679 + ], + [ + 680, + 686 + ], + [ + 688, + 691 + ], + [ + 692, + 693 + ], + [ + 696, + 697 + ], + [ + 701, + 702 + ], + [ + 704, + 710 + ], + [ + 712, + 713 + ], + [ + 716, + 723 + ], + [ + 729, + 730 + ], + [ + 734, + 735 + ], + [ + 737, + 738 + ], + [ + 743, + 745 + ], + [ + 749, + 751 + ], + [ + 752, + 753 + ], + [ + 755, + 756 + ], + [ + 757, + 758 + ], + [ + 759, + 762 + ], + [ + 763, + 768 + ], + [ + 770, + 772 + ], + [ + 773, + 774 + ], + [ + 777, + 778 + ], + [ + 782, + 788 + ], + [ + 790, + 795 + ], + [ + 797, + 799 + ], + [ + 801, + 802 + ], + [ + 807, + 808 + ], + [ + 812, + 814 + ], + [ + 815, + 818 + ], + [ + 822, + 823 + ], + [ + 824, + 825 + ], + [ + 828, + 830 + ], + [ + 831, + 833 + ], + [ + 835, + 840 + ], + [ + 843, + 844 + ], + [ + 845, + 854 + ], + [ + 856, + 857 + ], + [ + 859, + 860 + ], + [ + 865, + 866 + ], + [ + 873, + 886 + ], + [ + 888, + 890 + ], + [ + 891, + 895 + ], + [ + 897, + 899 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 904, + 905 + ], + [ + 908, + 910 + ], + [ + 912, + 913 + ], + [ + 916, + 918 + ], + [ + 919, + 921 + ], + [ + 923, + 928 + ], + [ + 929, + 942 + ], + [ + 944, + 945 + ], + [ + 951, + 952 + ], + [ + 960, + 973 + ], + [ + 975, + 977 + ], + [ + 978, + 979 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 987, + 989 + ], + [ + 992, + 994 + ], + [ + 995, + 997 + ], + [ + 998, + 1002 + ], + [ + 1004, + 1005 + ], + [ + 1007, + 1008 + ], + [ + 1009, + 1010 + ], + [ + 1015, + 1016 + ], + [ + 1029, + 1033 + ], + [ + 1035, + 1043 + ], + [ + 1047, + 1048 + ], + [ + 1049, + 1052 + ], + [ + 1053, + 1056 + ], + [ + 1065, + 1068 + ], + [ + 1071, + 1072 + ], + [ + 1074, + 1076 + ], + [ + 1077, + 1079 + ], + [ + 1083, + 1086 + ], + [ + 1090, + 1091 + ], + [ + 1092, + 1095 + ], + [ + 1097, + 1098 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/window.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 8, + 36 + ], + [ + 84, + 103 + ], + [ + 104, + 217 + ], + [ + 218, + 229 + ], + [ + 230, + 249 + ], + [ + 256, + 282 + ], + [ + 284, + 304 + ], + [ + 308, + 423 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 27 + ], + [ + 32, + 33 + ], + [ + 87, + 88 + ], + [ + 91, + 94 + ], + [ + 96, + 97 + ], + [ + 98, + 100 + ], + [ + 107, + 108 + ], + [ + 111, + 112 + ], + [ + 115, + 116 + ], + [ + 118, + 122 + ], + [ + 124, + 126 + ], + [ + 127, + 129 + ], + [ + 132, + 133 + ], + [ + 134, + 135 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 145, + 147 + ], + [ + 149, + 150 + ], + [ + 153, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 175, + 179 + ], + [ + 182, + 183 + ], + [ + 187, + 188 + ], + [ + 191, + 192 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 203, + 204 + ], + [ + 207, + 208 + ], + [ + 213, + 214 + ], + [ + 221, + 222 + ], + [ + 223, + 226 + ], + [ + 233, + 238 + ], + [ + 240, + 242 + ], + [ + 243, + 246 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 268 + ], + [ + 273, + 274 + ], + [ + 277, + 279 + ], + [ + 287, + 288 + ], + [ + 289, + 292 + ], + [ + 296, + 298 + ], + [ + 300, + 301 + ], + [ + 311, + 312 + ], + [ + 313, + 316 + ], + [ + 317, + 318 + ], + [ + 323, + 324 + ], + [ + 330, + 332 + ], + [ + 333, + 334 + ], + [ + 337, + 340 + ], + [ + 343, + 344 + ], + [ + 346, + 347 + ], + [ + 349, + 350 + ], + [ + 355, + 356 + ], + [ + 357, + 359 + ], + [ + 360, + 361 + ], + [ + 364, + 369 + ], + [ + 370, + 371 + ], + [ + 373, + 374 + ], + [ + 375, + 376 + ], + [ + 381, + 382 + ], + [ + 386, + 388 + ], + [ + 389, + 390 + ], + [ + 392, + 393 + ], + [ + 395, + 397 + ], + [ + 399, + 401 + ], + [ + 402, + 405 + ], + [ + 407, + 408 + ], + [ + 409, + 410 + ], + [ + 413, + 414 + ], + [ + 415, + 422 + ] + ] + } + }, + { + "filename": "libvips/module/heif.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 52, + 86 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 68 + ], + [ + 70, + 73 + ], + [ + 76, + 80 + ], + [ + 82, + 83 + ] + ] + } + }, + { + "filename": "libvips/module/jxl.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 52, + 79 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 76 + ] + ] + } + }, + { + "filename": "libvips/module/magick.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 47, + 72 + ], + [ + 86, + 93 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 50, + 51 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 69 + ], + [ + 89, + 90 + ] + ] + } + }, + { + "filename": "libvips/module/openslide.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 52, + 71 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 63 + ], + [ + 67, + 68 + ] + ] + } + }, + { + "filename": "libvips/module/poppler.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 52, + 73 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 64 + ], + [ + 65, + 68 + ], + [ + 69, + 70 + ] + ] + } + }, + { + "filename": "libvips/morphology/countlines.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 16, + 44 + ], + [ + 69, + 158 + ], + [ + 174, + 189 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 7, + 8 + ], + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 35 + ], + [ + 40, + 41 + ], + [ + 72, + 73 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 84, + 86 + ], + [ + 91, + 92 + ], + [ + 93, + 96 + ], + [ + 97, + 101 + ], + [ + 104, + 107 + ], + [ + 108, + 112 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 126, + 128 + ], + [ + 129, + 130 + ], + [ + 135, + 136 + ], + [ + 138, + 141 + ], + [ + 142, + 144 + ], + [ + 145, + 148 + ], + [ + 149, + 151 + ], + [ + 154, + 155 + ], + [ + 177, + 179 + ], + [ + 183, + 186 + ], + [ + 187, + 188 + ] + ] + } + }, + { + "filename": "libvips/morphology/labelregions.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 49, + 98 + ], + [ + 100, + 142 + ], + [ + 169, + 183 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 52, + 53 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 64, + 65 + ], + [ + 71, + 73 + ], + [ + 77, + 78 + ], + [ + 79, + 84 + ], + [ + 87, + 90 + ], + [ + 92, + 95 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 111, + 112 + ], + [ + 113, + 115 + ], + [ + 120, + 121 + ], + [ + 123, + 126 + ], + [ + 127, + 128 + ], + [ + 129, + 132 + ], + [ + 133, + 135 + ], + [ + 138, + 139 + ], + [ + 172, + 173 + ], + [ + 177, + 180 + ], + [ + 181, + 182 + ] + ] + } + }, + { + "filename": "libvips/morphology/morph.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 15, + 28 + ], + [ + 30, + 58 + ], + [ + 77, + 102 + ], + [ + 111, + 145 + ], + [ + 146, + 203 + ], + [ + 210, + 262 + ], + [ + 267, + 389 + ], + [ + 390, + 412 + ], + [ + 415, + 426 + ], + [ + 432, + 462 + ], + [ + 463, + 472 + ], + [ + 475, + 494 + ], + [ + 496, + 506 + ], + [ + 508, + 523 + ], + [ + 526, + 537 + ], + [ + 543, + 573 + ], + [ + 574, + 583 + ], + [ + 586, + 605 + ], + [ + 606, + 615 + ], + [ + 616, + 638 + ], + [ + 643, + 700 + ], + [ + 701, + 756 + ], + [ + 757, + 781 + ], + [ + 782, + 804 + ], + [ + 806, + 838 + ], + [ + 846, + 853 + ], + [ + 855, + 877 + ], + [ + 878, + 894 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 18, + 19 + ], + [ + 24, + 25 + ], + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 49 + ], + [ + 54, + 55 + ], + [ + 80, + 81 + ], + [ + 83, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 93, + 94 + ], + [ + 98, + 99 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 120, + 121 + ], + [ + 126, + 127 + ], + [ + 132, + 133 + ], + [ + 134, + 138 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 149, + 150 + ], + [ + 153, + 155 + ], + [ + 159, + 160 + ], + [ + 164, + 167 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 177, + 178 + ], + [ + 181, + 184 + ], + [ + 185, + 186 + ], + [ + 191, + 192 + ], + [ + 198, + 200 + ], + [ + 213, + 214 + ], + [ + 217, + 219 + ], + [ + 220, + 224 + ], + [ + 228, + 238 + ], + [ + 241, + 242 + ], + [ + 244, + 249 + ], + [ + 251, + 252 + ], + [ + 258, + 259 + ], + [ + 270, + 271 + ], + [ + 274, + 276 + ], + [ + 277, + 279 + ], + [ + 281, + 283 + ], + [ + 284, + 287 + ], + [ + 288, + 289 + ], + [ + 291, + 292 + ], + [ + 293, + 295 + ], + [ + 297, + 298 + ], + [ + 303, + 304 + ], + [ + 308, + 309 + ], + [ + 312, + 315 + ], + [ + 317, + 318 + ], + [ + 322, + 326 + ], + [ + 328, + 329 + ], + [ + 331, + 332 + ], + [ + 333, + 335 + ], + [ + 337, + 338 + ], + [ + 340, + 341 + ], + [ + 346, + 347 + ], + [ + 348, + 350 + ], + [ + 352, + 354 + ], + [ + 356, + 357 + ], + [ + 362, + 363 + ], + [ + 368, + 369 + ], + [ + 373, + 375 + ], + [ + 377, + 378 + ], + [ + 379, + 380 + ], + [ + 384, + 386 + ], + [ + 393, + 395 + ], + [ + 397, + 398 + ], + [ + 401, + 402 + ], + [ + 407, + 409 + ], + [ + 418, + 419 + ], + [ + 421, + 423 + ], + [ + 435, + 437 + ], + [ + 439, + 441 + ], + [ + 446, + 448 + ], + [ + 451, + 454 + ], + [ + 456, + 459 + ], + [ + 466, + 469 + ], + [ + 478, + 481 + ], + [ + 484, + 485 + ], + [ + 488, + 491 + ], + [ + 499, + 503 + ], + [ + 511, + 513 + ], + [ + 518, + 520 + ], + [ + 529, + 530 + ], + [ + 532, + 534 + ], + [ + 546, + 548 + ], + [ + 550, + 552 + ], + [ + 557, + 559 + ], + [ + 562, + 565 + ], + [ + 567, + 570 + ], + [ + 577, + 580 + ], + [ + 589, + 592 + ], + [ + 595, + 596 + ], + [ + 599, + 602 + ], + [ + 609, + 612 + ], + [ + 619, + 621 + ], + [ + 626, + 628 + ], + [ + 633, + 635 + ], + [ + 646, + 648 + ], + [ + 650, + 652 + ], + [ + 654, + 657 + ], + [ + 658, + 659 + ], + [ + 660, + 662 + ], + [ + 667, + 670 + ], + [ + 672, + 678 + ], + [ + 679, + 680 + ], + [ + 683, + 684 + ], + [ + 685, + 686 + ], + [ + 687, + 688 + ], + [ + 691, + 692 + ], + [ + 693, + 694 + ], + [ + 696, + 697 + ], + [ + 704, + 706 + ], + [ + 711, + 713 + ], + [ + 715, + 717 + ], + [ + 720, + 727 + ], + [ + 730, + 732 + ], + [ + 736, + 738 + ], + [ + 740, + 743 + ], + [ + 744, + 746 + ], + [ + 747, + 753 + ], + [ + 760, + 762 + ], + [ + 765, + 767 + ], + [ + 768, + 769 + ], + [ + 771, + 772 + ], + [ + 774, + 778 + ], + [ + 785, + 788 + ], + [ + 792, + 793 + ], + [ + 794, + 795 + ], + [ + 798, + 799 + ], + [ + 800, + 801 + ], + [ + 809, + 810 + ], + [ + 812, + 831 + ], + [ + 834, + 835 + ], + [ + 849, + 850 + ], + [ + 858, + 859 + ], + [ + 860, + 863 + ], + [ + 864, + 865 + ], + [ + 868, + 870 + ], + [ + 872, + 874 + ], + [ + 881, + 884 + ], + [ + 888, + 891 + ], + [ + 892, + 893 + ] + ] + } + }, + { + "filename": "libvips/morphology/morphology.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 49, + 58 + ], + [ + 68, + 78 + ], + [ + 80, + 92 + ], + [ + 99, + 132 + ], + [ + 133, + 150 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 52, + 53 + ], + [ + 54, + 55 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 83, + 84 + ], + [ + 88, + 89 + ], + [ + 102, + 104 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 115, + 116 + ], + [ + 120, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 136, + 137 + ], + [ + 138, + 149 + ] + ] + } + }, + { + "filename": "libvips/morphology/nearest.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 78, + 105 + ], + [ + 107, + 191 + ], + [ + 192, + 254 + ], + [ + 260, + 333 + ], + [ + 341, + 348 + ], + [ + 355, + 369 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 89, + 92 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 102 + ], + [ + 110, + 112 + ], + [ + 117, + 118 + ], + [ + 122, + 123 + ], + [ + 125, + 126 + ], + [ + 127, + 130 + ], + [ + 131, + 136 + ], + [ + 142, + 143 + ], + [ + 147, + 149 + ], + [ + 150, + 151 + ], + [ + 153, + 154 + ], + [ + 156, + 158 + ], + [ + 161, + 163 + ], + [ + 166, + 168 + ], + [ + 169, + 170 + ], + [ + 172, + 175 + ], + [ + 176, + 179 + ], + [ + 181, + 183 + ], + [ + 187, + 188 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 203, + 206 + ], + [ + 207, + 209 + ], + [ + 210, + 211 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 220, + 221 + ], + [ + 225, + 227 + ], + [ + 228, + 230 + ], + [ + 233, + 236 + ], + [ + 238, + 242 + ], + [ + 244, + 245 + ], + [ + 247, + 251 + ], + [ + 263, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 280, + 283 + ], + [ + 286, + 289 + ], + [ + 290, + 292 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 303, + 305 + ], + [ + 311, + 313 + ], + [ + 315, + 318 + ], + [ + 319, + 320 + ], + [ + 321, + 324 + ], + [ + 325, + 326 + ], + [ + 329, + 330 + ], + [ + 344, + 345 + ], + [ + 358, + 359 + ], + [ + 363, + 366 + ], + [ + 367, + 368 + ] + ] + } + }, + { + "filename": "libvips/morphology/pmorphology.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 58, + 64 + ], + [ + 65, + 75 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 68, + 69 + ] + ] + } + }, + { + "filename": "libvips/morphology/rank.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 20 + ], + [ + 32, + 60 + ], + [ + 81, + 88 + ], + [ + 89, + 96 + ], + [ + 106, + 204 + ], + [ + 205, + 235 + ], + [ + 243, + 439 + ], + [ + 447, + 596 + ], + [ + 606, + 644 + ], + [ + 656, + 671 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 9, + 10 + ], + [ + 16, + 17 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 84, + 85 + ], + [ + 92, + 93 + ], + [ + 109, + 110 + ], + [ + 114, + 116 + ], + [ + 117, + 119 + ], + [ + 121, + 123 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 130, + 131 + ], + [ + 136, + 138 + ], + [ + 142, + 147 + ], + [ + 149, + 150 + ], + [ + 152, + 156 + ], + [ + 158, + 163 + ], + [ + 166, + 167 + ], + [ + 172, + 174 + ], + [ + 176, + 178 + ], + [ + 182, + 186 + ], + [ + 187, + 188 + ], + [ + 191, + 192 + ], + [ + 195, + 197 + ], + [ + 198, + 201 + ], + [ + 208, + 210 + ], + [ + 213, + 214 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 226, + 228 + ], + [ + 231, + 232 + ], + [ + 246, + 262 + ], + [ + 263, + 287 + ], + [ + 288, + 328 + ], + [ + 330, + 332 + ], + [ + 333, + 334 + ], + [ + 337, + 358 + ], + [ + 359, + 361 + ], + [ + 362, + 363 + ], + [ + 366, + 387 + ], + [ + 388, + 390 + ], + [ + 391, + 392 + ], + [ + 393, + 420 + ], + [ + 422, + 423 + ], + [ + 425, + 427 + ], + [ + 428, + 429 + ], + [ + 434, + 436 + ], + [ + 450, + 466 + ], + [ + 469, + 470 + ], + [ + 471, + 473 + ], + [ + 474, + 475 + ], + [ + 478, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 485 + ], + [ + 487, + 493 + ], + [ + 495, + 498 + ], + [ + 502, + 504 + ], + [ + 506, + 507 + ], + [ + 508, + 509 + ], + [ + 510, + 511 + ], + [ + 514, + 515 + ], + [ + 516, + 522 + ], + [ + 524, + 525 + ], + [ + 529, + 532 + ], + [ + 535, + 541 + ], + [ + 545, + 546 + ], + [ + 547, + 548 + ], + [ + 551, + 552 + ], + [ + 553, + 554 + ], + [ + 560, + 561 + ], + [ + 563, + 568 + ], + [ + 569, + 572 + ], + [ + 573, + 575 + ], + [ + 576, + 579 + ], + [ + 580, + 582 + ], + [ + 583, + 586 + ], + [ + 587, + 589 + ], + [ + 592, + 593 + ], + [ + 609, + 611 + ], + [ + 613, + 616 + ], + [ + 622, + 623 + ], + [ + 629, + 632 + ], + [ + 636, + 639 + ], + [ + 640, + 641 + ], + [ + 659, + 660 + ], + [ + 664, + 668 + ], + [ + 669, + 670 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/chkpair.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 21, + 49 + ], + [ + 67, + 79 + ], + [ + 84, + 109 + ], + [ + 114, + 121 + ], + [ + 124, + 142 + ], + [ + 143, + 189 + ], + [ + 193, + 220 + ], + [ + 223, + 234 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 24, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 40 + ], + [ + 45, + 46 + ], + [ + 70, + 71 + ], + [ + 75, + 76 + ], + [ + 87, + 88 + ], + [ + 92, + 94 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 105, + 106 + ], + [ + 117, + 118 + ], + [ + 127, + 128 + ], + [ + 131, + 139 + ], + [ + 146, + 150 + ], + [ + 153, + 157 + ], + [ + 163, + 166 + ], + [ + 170, + 173 + ], + [ + 174, + 175 + ], + [ + 181, + 182 + ], + [ + 184, + 186 + ], + [ + 196, + 202 + ], + [ + 203, + 206 + ], + [ + 208, + 209 + ], + [ + 211, + 217 + ], + [ + 226, + 227 + ], + [ + 228, + 229 + ], + [ + 232, + 233 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/global_balance.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 8 + ], + [ + 64, + 92 + ], + [ + 134, + 237 + ], + [ + 238, + 250 + ], + [ + 255, + 317 + ], + [ + 320, + 426 + ], + [ + 431, + 501 + ], + [ + 519, + 532 + ], + [ + 537, + 561 + ], + [ + 565, + 593 + ], + [ + 598, + 633 + ], + [ + 640, + 812 + ], + [ + 813, + 878 + ], + [ + 880, + 924 + ], + [ + 925, + 946 + ], + [ + 947, + 966 + ], + [ + 967, + 994 + ], + [ + 995, + 1122 + ], + [ + 1135, + 1228 + ], + [ + 1229, + 1316 + ], + [ + 1321, + 1388 + ], + [ + 1389, + 1463 + ], + [ + 1464, + 1514 + ], + [ + 1516, + 1547 + ], + [ + 1552, + 1568 + ], + [ + 1569, + 1863 + ], + [ + 1872, + 1948 + ], + [ + 1951, + 1964 + ], + [ + 1971, + 1981 + ], + [ + 1985, + 2000 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 67, + 73 + ], + [ + 74, + 78 + ], + [ + 79, + 83 + ], + [ + 88, + 89 + ], + [ + 137, + 138 + ], + [ + 142, + 143 + ], + [ + 145, + 146 + ], + [ + 150, + 153 + ], + [ + 159, + 162 + ], + [ + 164, + 165 + ], + [ + 170, + 171 + ], + [ + 175, + 176 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 182, + 185 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 198, + 199 + ], + [ + 204, + 205 + ], + [ + 208, + 209 + ], + [ + 210, + 211 + ], + [ + 213, + 214 + ], + [ + 219, + 220 + ], + [ + 221, + 223 + ], + [ + 226, + 228 + ], + [ + 233, + 234 + ], + [ + 241, + 243 + ], + [ + 246, + 247 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 266, + 267 + ], + [ + 268, + 269 + ], + [ + 270, + 272 + ], + [ + 278, + 279 + ], + [ + 281, + 282 + ], + [ + 285, + 286 + ], + [ + 289, + 291 + ], + [ + 295, + 297 + ], + [ + 299, + 301 + ], + [ + 306, + 307 + ], + [ + 308, + 309 + ], + [ + 311, + 314 + ], + [ + 323, + 325 + ], + [ + 326, + 327 + ], + [ + 329, + 330 + ], + [ + 335, + 336 + ], + [ + 337, + 339 + ], + [ + 340, + 341 + ], + [ + 346, + 347 + ], + [ + 348, + 350 + ], + [ + 356, + 357 + ], + [ + 360, + 363 + ], + [ + 364, + 365 + ], + [ + 367, + 368 + ], + [ + 370, + 371 + ], + [ + 374, + 380 + ], + [ + 385, + 387 + ], + [ + 389, + 390 + ], + [ + 395, + 396 + ], + [ + 397, + 399 + ], + [ + 401, + 402 + ], + [ + 405, + 406 + ], + [ + 409, + 410 + ], + [ + 416, + 418 + ], + [ + 422, + 423 + ], + [ + 434, + 435 + ], + [ + 439, + 440 + ], + [ + 444, + 445 + ], + [ + 451, + 452 + ], + [ + 455, + 456 + ], + [ + 457, + 459 + ], + [ + 460, + 464 + ], + [ + 469, + 472 + ], + [ + 475, + 477 + ], + [ + 478, + 479 + ], + [ + 482, + 483 + ], + [ + 486, + 489 + ], + [ + 494, + 498 + ], + [ + 522, + 525 + ], + [ + 528, + 529 + ], + [ + 540, + 543 + ], + [ + 544, + 545 + ], + [ + 550, + 551 + ], + [ + 554, + 558 + ], + [ + 568, + 569 + ], + [ + 570, + 571 + ], + [ + 576, + 577 + ], + [ + 581, + 582 + ], + [ + 586, + 587 + ], + [ + 588, + 590 + ], + [ + 601, + 607 + ], + [ + 609, + 617 + ], + [ + 619, + 620 + ], + [ + 624, + 627 + ], + [ + 628, + 630 + ], + [ + 643, + 649 + ], + [ + 651, + 661 + ], + [ + 663, + 664 + ], + [ + 668, + 671 + ], + [ + 672, + 673 + ], + [ + 679, + 685 + ], + [ + 687, + 691 + ], + [ + 693, + 694 + ], + [ + 699, + 700 + ], + [ + 701, + 702 + ], + [ + 703, + 704 + ], + [ + 705, + 707 + ], + [ + 712, + 713 + ], + [ + 714, + 716 + ], + [ + 717, + 718 + ], + [ + 723, + 724 + ], + [ + 729, + 731 + ], + [ + 734, + 736 + ], + [ + 739, + 744 + ], + [ + 750, + 754 + ], + [ + 756, + 757 + ], + [ + 762, + 763 + ], + [ + 766, + 767 + ], + [ + 769, + 770 + ], + [ + 771, + 773 + ], + [ + 777, + 779 + ], + [ + 780, + 781 + ], + [ + 786, + 787 + ], + [ + 788, + 789 + ], + [ + 793, + 794 + ], + [ + 800, + 801 + ], + [ + 802, + 804 + ], + [ + 807, + 809 + ], + [ + 816, + 817 + ], + [ + 818, + 820 + ], + [ + 821, + 822 + ], + [ + 828, + 829 + ], + [ + 830, + 831 + ], + [ + 833, + 834 + ], + [ + 836, + 837 + ], + [ + 843, + 844 + ], + [ + 847, + 849 + ], + [ + 854, + 855 + ], + [ + 856, + 869 + ], + [ + 871, + 872 + ], + [ + 874, + 875 + ], + [ + 883, + 884 + ], + [ + 885, + 886 + ], + [ + 887, + 888 + ], + [ + 892, + 895 + ], + [ + 897, + 904 + ], + [ + 907, + 910 + ], + [ + 913, + 915 + ], + [ + 918, + 919 + ], + [ + 920, + 921 + ], + [ + 928, + 929 + ], + [ + 930, + 934 + ], + [ + 936, + 938 + ], + [ + 939, + 943 + ], + [ + 950, + 951 + ], + [ + 953, + 960 + ], + [ + 962, + 963 + ], + [ + 970, + 971 + ], + [ + 972, + 975 + ], + [ + 977, + 978 + ], + [ + 984, + 986 + ], + [ + 988, + 991 + ], + [ + 998, + 999 + ], + [ + 1001, + 1009 + ], + [ + 1011, + 1012 + ], + [ + 1018, + 1019 + ], + [ + 1020, + 1022 + ], + [ + 1028, + 1031 + ], + [ + 1032, + 1045 + ], + [ + 1050, + 1051 + ], + [ + 1054, + 1057 + ], + [ + 1058, + 1059 + ], + [ + 1065, + 1067 + ], + [ + 1068, + 1070 + ], + [ + 1075, + 1082 + ], + [ + 1085, + 1087 + ], + [ + 1090, + 1092 + ], + [ + 1095, + 1097 + ], + [ + 1101, + 1102 + ], + [ + 1104, + 1106 + ], + [ + 1108, + 1109 + ], + [ + 1114, + 1115 + ], + [ + 1117, + 1119 + ], + [ + 1138, + 1141 + ], + [ + 1144, + 1152 + ], + [ + 1157, + 1158 + ], + [ + 1159, + 1161 + ], + [ + 1162, + 1163 + ], + [ + 1168, + 1169 + ], + [ + 1175, + 1177 + ], + [ + 1180, + 1184 + ], + [ + 1187, + 1188 + ], + [ + 1190, + 1191 + ], + [ + 1192, + 1193 + ], + [ + 1195, + 1198 + ], + [ + 1201, + 1203 + ], + [ + 1204, + 1205 + ], + [ + 1207, + 1209 + ], + [ + 1213, + 1215 + ], + [ + 1216, + 1220 + ], + [ + 1221, + 1222 + ], + [ + 1224, + 1225 + ], + [ + 1232, + 1233 + ], + [ + 1234, + 1235 + ], + [ + 1237, + 1241 + ], + [ + 1242, + 1244 + ], + [ + 1245, + 1247 + ], + [ + 1248, + 1250 + ], + [ + 1255, + 1260 + ], + [ + 1265, + 1266 + ], + [ + 1267, + 1269 + ], + [ + 1270, + 1272 + ], + [ + 1275, + 1276 + ], + [ + 1281, + 1282 + ], + [ + 1283, + 1285 + ], + [ + 1286, + 1288 + ], + [ + 1291, + 1292 + ], + [ + 1297, + 1298 + ], + [ + 1299, + 1302 + ], + [ + 1303, + 1307 + ], + [ + 1312, + 1313 + ], + [ + 1324, + 1325 + ], + [ + 1330, + 1331 + ], + [ + 1332, + 1336 + ], + [ + 1341, + 1342 + ], + [ + 1345, + 1346 + ], + [ + 1348, + 1360 + ], + [ + 1365, + 1368 + ], + [ + 1370, + 1371 + ], + [ + 1372, + 1373 + ], + [ + 1374, + 1379 + ], + [ + 1381, + 1385 + ], + [ + 1392, + 1394 + ], + [ + 1400, + 1401 + ], + [ + 1405, + 1406 + ], + [ + 1407, + 1408 + ], + [ + 1410, + 1411 + ], + [ + 1413, + 1414 + ], + [ + 1416, + 1417 + ], + [ + 1422, + 1423 + ], + [ + 1425, + 1438 + ], + [ + 1439, + 1440 + ], + [ + 1445, + 1454 + ], + [ + 1456, + 1460 + ], + [ + 1467, + 1470 + ], + [ + 1476, + 1479 + ], + [ + 1483, + 1484 + ], + [ + 1487, + 1488 + ], + [ + 1491, + 1492 + ], + [ + 1497, + 1499 + ], + [ + 1502, + 1505 + ], + [ + 1506, + 1507 + ], + [ + 1510, + 1511 + ], + [ + 1519, + 1522 + ], + [ + 1526, + 1528 + ], + [ + 1531, + 1533 + ], + [ + 1534, + 1536 + ], + [ + 1537, + 1538 + ], + [ + 1543, + 1544 + ], + [ + 1555, + 1556 + ], + [ + 1561, + 1562 + ], + [ + 1563, + 1565 + ], + [ + 1572, + 1575 + ], + [ + 1576, + 1577 + ], + [ + 1579, + 1581 + ], + [ + 1585, + 1591 + ], + [ + 1594, + 1598 + ], + [ + 1603, + 1604 + ], + [ + 1606, + 1607 + ], + [ + 1612, + 1615 + ], + [ + 1616, + 1620 + ], + [ + 1622, + 1626 + ], + [ + 1628, + 1629 + ], + [ + 1634, + 1635 + ], + [ + 1637, + 1638 + ], + [ + 1641, + 1642 + ], + [ + 1643, + 1644 + ], + [ + 1650, + 1658 + ], + [ + 1659, + 1660 + ], + [ + 1662, + 1666 + ], + [ + 1669, + 1671 + ], + [ + 1672, + 1673 + ], + [ + 1678, + 1679 + ], + [ + 1680, + 1681 + ], + [ + 1683, + 1687 + ], + [ + 1688, + 1690 + ], + [ + 1694, + 1695 + ], + [ + 1698, + 1699 + ], + [ + 1700, + 1702 + ], + [ + 1705, + 1706 + ], + [ + 1711, + 1712 + ], + [ + 1715, + 1717 + ], + [ + 1718, + 1720 + ], + [ + 1721, + 1727 + ], + [ + 1731, + 1734 + ], + [ + 1737, + 1739 + ], + [ + 1740, + 1741 + ], + [ + 1742, + 1744 + ], + [ + 1748, + 1750 + ], + [ + 1754, + 1760 + ], + [ + 1762, + 1763 + ], + [ + 1769, + 1770 + ], + [ + 1775, + 1776 + ], + [ + 1779, + 1780 + ], + [ + 1784, + 1785 + ], + [ + 1786, + 1789 + ], + [ + 1792, + 1800 + ], + [ + 1805, + 1808 + ], + [ + 1811, + 1812 + ], + [ + 1813, + 1814 + ], + [ + 1819, + 1820 + ], + [ + 1824, + 1826 + ], + [ + 1829, + 1830 + ], + [ + 1834, + 1837 + ], + [ + 1840, + 1847 + ], + [ + 1852, + 1854 + ], + [ + 1857, + 1858 + ], + [ + 1859, + 1860 + ], + [ + 1875, + 1876 + ], + [ + 1878, + 1879 + ], + [ + 1885, + 1886 + ], + [ + 1887, + 1889 + ], + [ + 1890, + 1894 + ], + [ + 1895, + 1899 + ], + [ + 1900, + 1901 + ], + [ + 1904, + 1905 + ], + [ + 1906, + 1907 + ], + [ + 1913, + 1914 + ], + [ + 1916, + 1931 + ], + [ + 1932, + 1934 + ], + [ + 1935, + 1938 + ], + [ + 1939, + 1941 + ], + [ + 1944, + 1945 + ], + [ + 1954, + 1955 + ], + [ + 1960, + 1961 + ], + [ + 1974, + 1976 + ], + [ + 1977, + 1978 + ], + [ + 1988, + 1990 + ], + [ + 1994, + 1997 + ], + [ + 1998, + 1999 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/global_balance.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 42, + 85 + ], + [ + 88, + 104 + ], + [ + 106, + 128 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 45, + 46 + ], + [ + 50, + 56 + ], + [ + 62, + 67 + ], + [ + 72, + 76 + ], + [ + 81, + 82 + ], + [ + 91, + 94 + ], + [ + 100, + 101 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 113, + 116 + ], + [ + 117, + 120 + ], + [ + 122, + 128 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_avgdxdy.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 13 + ], + [ + 18, + 46 + ], + [ + 55, + 83 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 21, + 27 + ], + [ + 28, + 32 + ], + [ + 33, + 37 + ], + [ + 42, + 43 + ], + [ + 58, + 60 + ], + [ + 64, + 67 + ], + [ + 73, + 74 + ], + [ + 78, + 80 + ], + [ + 81, + 82 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_clinear.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 16 + ], + [ + 25, + 53 + ], + [ + 63, + 71 + ], + [ + 87, + 101 + ], + [ + 107, + 173 + ], + [ + 175, + 180 + ] + ], + "lines_added": [ + [ + 12, + 13 + ], + [ + 28, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 44 + ], + [ + 49, + 50 + ], + [ + 66, + 68 + ], + [ + 90, + 95 + ], + [ + 97, + 98 + ], + [ + 110, + 114 + ], + [ + 115, + 119 + ], + [ + 120, + 124 + ], + [ + 125, + 129 + ], + [ + 135, + 140 + ], + [ + 142, + 146 + ], + [ + 147, + 152 + ], + [ + 154, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 164 + ], + [ + 166, + 167 + ], + [ + 169, + 170 + ], + [ + 178, + 179 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_improve.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 16 + ], + [ + 21, + 49 + ], + [ + 60, + 67 + ], + [ + 73, + 80 + ], + [ + 94, + 126 + ], + [ + 133, + 140 + ], + [ + 147, + 161 + ], + [ + 163, + 189 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 7, + 8 + ], + [ + 12, + 13 + ], + [ + 24, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 40 + ], + [ + 45, + 46 + ], + [ + 63, + 64 + ], + [ + 76, + 77 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 108, + 114 + ], + [ + 117, + 118 + ], + [ + 120, + 123 + ], + [ + 136, + 137 + ], + [ + 150, + 152 + ], + [ + 153, + 154 + ], + [ + 156, + 158 + ], + [ + 166, + 168 + ], + [ + 170, + 171 + ], + [ + 175, + 177 + ], + [ + 180, + 181 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_initialize.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 28 + ], + [ + 37, + 47 + ], + [ + 59, + 97 + ], + [ + 98, + 103 + ] + ], + "lines_added": [ + [ + 3, + 19 + ], + [ + 24, + 25 + ], + [ + 40, + 42 + ], + [ + 43, + 44 + ], + [ + 62, + 64 + ], + [ + 70, + 72 + ], + [ + 77, + 80 + ], + [ + 84, + 85 + ], + [ + 89, + 90 + ], + [ + 92, + 94 + ], + [ + 101, + 102 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_lrcalcon.c", + "line_filter": { + "diff_chunks": [ + [ + 24, + 33 + ], + [ + 44, + 51 + ], + [ + 53, + 81 + ], + [ + 102, + 109 + ], + [ + 114, + 140 + ], + [ + 144, + 188 + ], + [ + 201, + 237 + ], + [ + 240, + 272 + ], + [ + 284, + 295 + ], + [ + 298, + 319 + ] + ], + "lines_added": [ + [ + 27, + 28 + ], + [ + 29, + 30 + ], + [ + 47, + 48 + ], + [ + 56, + 57 + ], + [ + 58, + 62 + ], + [ + 63, + 72 + ], + [ + 77, + 78 + ], + [ + 105, + 106 + ], + [ + 117, + 121 + ], + [ + 123, + 124 + ], + [ + 128, + 129 + ], + [ + 133, + 134 + ], + [ + 135, + 137 + ], + [ + 147, + 149 + ], + [ + 151, + 152 + ], + [ + 155, + 156 + ], + [ + 162, + 163 + ], + [ + 168, + 169 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 178, + 180 + ], + [ + 181, + 183 + ], + [ + 184, + 185 + ], + [ + 204, + 208 + ], + [ + 211, + 212 + ], + [ + 213, + 215 + ], + [ + 218, + 220 + ], + [ + 225, + 226 + ], + [ + 232, + 234 + ], + [ + 243, + 249 + ], + [ + 253, + 254 + ], + [ + 257, + 258 + ], + [ + 262, + 263 + ], + [ + 264, + 265 + ], + [ + 267, + 269 + ], + [ + 287, + 292 + ], + [ + 301, + 302 + ], + [ + 307, + 318 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_tbcalcon.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 28 + ], + [ + 41, + 69 + ], + [ + 79, + 87 + ], + [ + 99, + 110 + ], + [ + 112, + 137 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 24, + 25 + ], + [ + 44, + 50 + ], + [ + 51, + 55 + ], + [ + 56, + 60 + ], + [ + 65, + 66 + ], + [ + 82, + 84 + ], + [ + 102, + 107 + ], + [ + 115, + 116 + ], + [ + 118, + 121 + ], + [ + 125, + 136 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/lrmerge.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 89, + 117 + ], + [ + 143, + 327 + ], + [ + 332, + 357 + ], + [ + 372, + 412 + ], + [ + 415, + 423 + ], + [ + 425, + 587 + ], + [ + 591, + 599 + ], + [ + 608, + 677 + ], + [ + 680, + 688 + ], + [ + 697, + 714 + ], + [ + 720, + 794 + ], + [ + 798, + 827 + ], + [ + 837, + 881 + ], + [ + 884, + 892 + ], + [ + 899, + 927 + ], + [ + 931, + 957 + ], + [ + 961, + 1025 + ], + [ + 1030, + 1072 + ], + [ + 1073, + 1191 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 92, + 93 + ], + [ + 94, + 98 + ], + [ + 99, + 108 + ], + [ + 113, + 114 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 156, + 158 + ], + [ + 161, + 169 + ], + [ + 171, + 172 + ], + [ + 177, + 178 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 192, + 193 + ], + [ + 197, + 205 + ], + [ + 206, + 237 + ], + [ + 239, + 241 + ], + [ + 247, + 248 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 262, + 263 + ], + [ + 267, + 275 + ], + [ + 276, + 307 + ], + [ + 309, + 311 + ], + [ + 317, + 318 + ], + [ + 323, + 324 + ], + [ + 335, + 336 + ], + [ + 340, + 341 + ], + [ + 344, + 345 + ], + [ + 349, + 350 + ], + [ + 352, + 354 + ], + [ + 375, + 380 + ], + [ + 384, + 388 + ], + [ + 392, + 394 + ], + [ + 400, + 401 + ], + [ + 403, + 409 + ], + [ + 418, + 420 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 435, + 446 + ], + [ + 449, + 473 + ], + [ + 474, + 513 + ], + [ + 516, + 540 + ], + [ + 541, + 579 + ], + [ + 583, + 584 + ], + [ + 594, + 596 + ], + [ + 611, + 614 + ], + [ + 617, + 622 + ], + [ + 628, + 653 + ], + [ + 654, + 656 + ], + [ + 657, + 659 + ], + [ + 662, + 663 + ], + [ + 666, + 667 + ], + [ + 672, + 674 + ], + [ + 683, + 685 + ], + [ + 700, + 703 + ], + [ + 706, + 711 + ], + [ + 723, + 725 + ], + [ + 728, + 729 + ], + [ + 732, + 733 + ], + [ + 735, + 736 + ], + [ + 739, + 740 + ], + [ + 741, + 742 + ], + [ + 748, + 751 + ], + [ + 753, + 754 + ], + [ + 756, + 757 + ], + [ + 763, + 769 + ], + [ + 772, + 787 + ], + [ + 789, + 791 + ], + [ + 801, + 805 + ], + [ + 806, + 807 + ], + [ + 808, + 812 + ], + [ + 813, + 814 + ], + [ + 815, + 819 + ], + [ + 823, + 824 + ], + [ + 840, + 841 + ], + [ + 844, + 845 + ], + [ + 848, + 853 + ], + [ + 857, + 859 + ], + [ + 860, + 861 + ], + [ + 866, + 868 + ], + [ + 869, + 870 + ], + [ + 871, + 874 + ], + [ + 877, + 878 + ], + [ + 887, + 889 + ], + [ + 902, + 907 + ], + [ + 913, + 914 + ], + [ + 916, + 918 + ], + [ + 923, + 924 + ], + [ + 934, + 936 + ], + [ + 939, + 941 + ], + [ + 942, + 943 + ], + [ + 945, + 947 + ], + [ + 952, + 954 + ], + [ + 964, + 966 + ], + [ + 967, + 968 + ], + [ + 974, + 976 + ], + [ + 979, + 980 + ], + [ + 982, + 983 + ], + [ + 984, + 986 + ], + [ + 987, + 988 + ], + [ + 990, + 993 + ], + [ + 994, + 997 + ], + [ + 999, + 1003 + ], + [ + 1009, + 1022 + ], + [ + 1033, + 1036 + ], + [ + 1038, + 1039 + ], + [ + 1045, + 1046 + ], + [ + 1049, + 1055 + ], + [ + 1056, + 1057 + ], + [ + 1062, + 1063 + ], + [ + 1067, + 1069 + ], + [ + 1076, + 1077 + ], + [ + 1079, + 1086 + ], + [ + 1089, + 1091 + ], + [ + 1092, + 1095 + ], + [ + 1097, + 1098 + ], + [ + 1101, + 1103 + ], + [ + 1107, + 1112 + ], + [ + 1114, + 1115 + ], + [ + 1118, + 1119 + ], + [ + 1123, + 1130 + ], + [ + 1131, + 1132 + ], + [ + 1136, + 1137 + ], + [ + 1139, + 1141 + ], + [ + 1142, + 1145 + ], + [ + 1151, + 1155 + ], + [ + 1156, + 1157 + ], + [ + 1160, + 1161 + ], + [ + 1164, + 1167 + ], + [ + 1168, + 1169 + ], + [ + 1171, + 1172 + ], + [ + 1175, + 1176 + ], + [ + 1181, + 1182 + ], + [ + 1188, + 1190 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/lrmosaic.c", + "line_filter": { + "diff_chunks": [ + [ + 31, + 59 + ], + [ + 75, + 89 + ], + [ + 91, + 114 + ], + [ + 117, + 127 + ], + [ + 136, + 179 + ], + [ + 181, + 193 + ], + [ + 198, + 231 + ], + [ + 238, + 253 + ], + [ + 257, + 285 + ] + ], + "lines_added": [ + [ + 34, + 50 + ], + [ + 55, + 56 + ], + [ + 78, + 79 + ], + [ + 85, + 86 + ], + [ + 94, + 98 + ], + [ + 101, + 105 + ], + [ + 107, + 108 + ], + [ + 110, + 111 + ], + [ + 120, + 124 + ], + [ + 139, + 145 + ], + [ + 149, + 162 + ], + [ + 163, + 169 + ], + [ + 171, + 173 + ], + [ + 175, + 176 + ], + [ + 184, + 185 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 201, + 202 + ], + [ + 203, + 206 + ], + [ + 209, + 212 + ], + [ + 215, + 217 + ], + [ + 218, + 219 + ], + [ + 220, + 223 + ], + [ + 226, + 228 + ], + [ + 241, + 242 + ], + [ + 244, + 248 + ], + [ + 249, + 250 + ], + [ + 260, + 268 + ], + [ + 269, + 270 + ], + [ + 273, + 280 + ], + [ + 281, + 282 + ], + [ + 283, + 284 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/match.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 44, + 86 + ], + [ + 105, + 115 + ], + [ + 116, + 147 + ], + [ + 148, + 302 + ], + [ + 316, + 352 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 47, + 51 + ], + [ + 52, + 61 + ], + [ + 63, + 67 + ], + [ + 69, + 77 + ], + [ + 78, + 81 + ], + [ + 82, + 83 + ], + [ + 108, + 109 + ], + [ + 111, + 112 + ], + [ + 119, + 120 + ], + [ + 121, + 123 + ], + [ + 124, + 126 + ], + [ + 127, + 128 + ], + [ + 131, + 136 + ], + [ + 139, + 144 + ], + [ + 151, + 155 + ], + [ + 158, + 170 + ], + [ + 171, + 172 + ], + [ + 173, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 192, + 193 + ], + [ + 195, + 204 + ], + [ + 205, + 212 + ], + [ + 213, + 216 + ], + [ + 217, + 219 + ], + [ + 220, + 223 + ], + [ + 224, + 226 + ], + [ + 227, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 237 + ], + [ + 238, + 240 + ], + [ + 241, + 244 + ], + [ + 245, + 247 + ], + [ + 248, + 251 + ], + [ + 252, + 254 + ], + [ + 255, + 258 + ], + [ + 259, + 261 + ], + [ + 262, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 275 + ], + [ + 276, + 279 + ], + [ + 280, + 282 + ], + [ + 283, + 289 + ], + [ + 290, + 295 + ], + [ + 298, + 299 + ], + [ + 319, + 320 + ], + [ + 324, + 325 + ], + [ + 329, + 330 + ], + [ + 331, + 332 + ], + [ + 338, + 341 + ], + [ + 345, + 349 + ], + [ + 350, + 351 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/matrixinvert.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 66, + 92 + ], + [ + 96, + 160 + ], + [ + 161, + 202 + ], + [ + 203, + 218 + ], + [ + 225, + 232 + ], + [ + 233, + 448 + ], + [ + 459, + 473 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 69, + 70 + ], + [ + 72, + 73 + ], + [ + 76, + 78 + ], + [ + 79, + 80 + ], + [ + 82, + 83 + ], + [ + 88, + 89 + ], + [ + 99, + 101 + ], + [ + 102, + 103 + ], + [ + 109, + 110 + ], + [ + 115, + 116 + ], + [ + 120, + 123 + ], + [ + 125, + 128 + ], + [ + 131, + 133 + ], + [ + 134, + 135 + ], + [ + 137, + 139 + ], + [ + 141, + 142 + ], + [ + 145, + 150 + ], + [ + 156, + 157 + ], + [ + 164, + 167 + ], + [ + 169, + 170 + ], + [ + 172, + 174 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 185, + 186 + ], + [ + 187, + 191 + ], + [ + 193, + 194 + ], + [ + 195, + 199 + ], + [ + 206, + 207 + ], + [ + 209, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 215 + ], + [ + 228, + 229 + ], + [ + 236, + 237 + ], + [ + 240, + 243 + ], + [ + 245, + 247 + ], + [ + 248, + 249 + ], + [ + 253, + 255 + ], + [ + 257, + 258 + ], + [ + 259, + 261 + ], + [ + 262, + 263 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 276, + 278 + ], + [ + 279, + 281 + ], + [ + 282, + 284 + ], + [ + 288, + 290 + ], + [ + 291, + 293 + ], + [ + 295, + 296 + ], + [ + 299, + 300 + ], + [ + 301, + 302 + ], + [ + 305, + 308 + ], + [ + 309, + 310 + ], + [ + 311, + 314 + ], + [ + 316, + 318 + ], + [ + 319, + 322 + ], + [ + 325, + 326 + ], + [ + 327, + 330 + ], + [ + 333, + 338 + ], + [ + 339, + 340 + ], + [ + 343, + 346 + ], + [ + 347, + 348 + ], + [ + 349, + 352 + ], + [ + 356, + 368 + ], + [ + 374, + 376 + ], + [ + 378, + 379 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 387, + 389 + ], + [ + 390, + 392 + ], + [ + 393, + 396 + ], + [ + 398, + 401 + ], + [ + 402, + 403 + ], + [ + 404, + 407 + ], + [ + 409, + 411 + ], + [ + 413, + 414 + ], + [ + 417, + 418 + ], + [ + 419, + 421 + ], + [ + 427, + 428 + ], + [ + 430, + 433 + ], + [ + 434, + 435 + ], + [ + 436, + 441 + ], + [ + 444, + 445 + ], + [ + 462, + 463 + ], + [ + 467, + 470 + ], + [ + 471, + 472 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/merge.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 58, + 171 + ], + [ + 178, + 208 + ], + [ + 211, + 228 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 61, + 62 + ], + [ + 64, + 65 + ], + [ + 68, + 69 + ], + [ + 70, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 78 + ], + [ + 81, + 84 + ], + [ + 90, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 114, + 115 + ], + [ + 119, + 122 + ], + [ + 123, + 124 + ], + [ + 125, + 128 + ], + [ + 129, + 130 + ], + [ + 131, + 143 + ], + [ + 144, + 164 + ], + [ + 167, + 168 + ], + [ + 181, + 182 + ], + [ + 184, + 185 + ], + [ + 189, + 191 + ], + [ + 194, + 196 + ], + [ + 200, + 201 + ], + [ + 203, + 205 + ], + [ + 214, + 217 + ], + [ + 221, + 225 + ], + [ + 226, + 227 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/mosaic.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 72, + 82 + ], + [ + 87, + 130 + ], + [ + 139, + 307 + ], + [ + 319, + 331 + ], + [ + 336, + 354 + ], + [ + 356, + 373 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 90, + 91 + ], + [ + 92, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 102, + 111 + ], + [ + 112, + 113 + ], + [ + 116, + 125 + ], + [ + 126, + 127 + ], + [ + 142, + 144 + ], + [ + 145, + 148 + ], + [ + 149, + 159 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 175, + 176 + ], + [ + 178, + 206 + ], + [ + 207, + 209 + ], + [ + 210, + 213 + ], + [ + 214, + 216 + ], + [ + 217, + 220 + ], + [ + 221, + 223 + ], + [ + 224, + 227 + ], + [ + 228, + 230 + ], + [ + 231, + 234 + ], + [ + 235, + 237 + ], + [ + 238, + 241 + ], + [ + 242, + 244 + ], + [ + 245, + 248 + ], + [ + 249, + 251 + ], + [ + 252, + 255 + ], + [ + 256, + 258 + ], + [ + 259, + 262 + ], + [ + 263, + 265 + ], + [ + 266, + 269 + ], + [ + 270, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 279 + ], + [ + 280, + 283 + ], + [ + 284, + 286 + ], + [ + 287, + 290 + ], + [ + 291, + 293 + ], + [ + 294, + 297 + ], + [ + 298, + 300 + ], + [ + 303, + 304 + ], + [ + 322, + 323 + ], + [ + 327, + 328 + ], + [ + 339, + 340 + ], + [ + 341, + 344 + ], + [ + 347, + 348 + ], + [ + 350, + 351 + ], + [ + 359, + 362 + ], + [ + 366, + 370 + ], + [ + 371, + 372 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/mosaic1.c", + "line_filter": { + "diff_chunks": [ + [ + 21, + 49 + ], + [ + 69, + 80 + ], + [ + 87, + 117 + ], + [ + 118, + 165 + ], + [ + 166, + 237 + ], + [ + 244, + 305 + ], + [ + 310, + 331 + ], + [ + 332, + 345 + ], + [ + 350, + 382 + ], + [ + 384, + 416 + ], + [ + 439, + 623 + ], + [ + 638, + 677 + ], + [ + 678, + 696 + ] + ], + "lines_added": [ + [ + 24, + 40 + ], + [ + 45, + 46 + ], + [ + 72, + 73 + ], + [ + 74, + 77 + ], + [ + 90, + 93 + ], + [ + 94, + 96 + ], + [ + 97, + 98 + ], + [ + 102, + 104 + ], + [ + 108, + 110 + ], + [ + 112, + 114 + ], + [ + 121, + 123 + ], + [ + 126, + 129 + ], + [ + 133, + 151 + ], + [ + 156, + 158 + ], + [ + 161, + 162 + ], + [ + 169, + 171 + ], + [ + 174, + 177 + ], + [ + 181, + 199 + ], + [ + 204, + 206 + ], + [ + 207, + 209 + ], + [ + 213, + 216 + ], + [ + 219, + 221 + ], + [ + 222, + 223 + ], + [ + 228, + 230 + ], + [ + 232, + 234 + ], + [ + 247, + 248 + ], + [ + 251, + 254 + ], + [ + 257, + 258 + ], + [ + 259, + 262 + ], + [ + 265, + 266 + ], + [ + 272, + 276 + ], + [ + 279, + 281 + ], + [ + 283, + 284 + ], + [ + 286, + 294 + ], + [ + 296, + 297 + ], + [ + 298, + 300 + ], + [ + 301, + 302 + ], + [ + 313, + 315 + ], + [ + 318, + 321 + ], + [ + 324, + 326 + ], + [ + 327, + 328 + ], + [ + 335, + 336 + ], + [ + 337, + 338 + ], + [ + 340, + 342 + ], + [ + 353, + 354 + ], + [ + 360, + 364 + ], + [ + 369, + 377 + ], + [ + 378, + 379 + ], + [ + 387, + 393 + ], + [ + 398, + 400 + ], + [ + 401, + 405 + ], + [ + 408, + 411 + ], + [ + 412, + 413 + ], + [ + 442, + 443 + ], + [ + 445, + 446 + ], + [ + 451, + 452 + ], + [ + 453, + 455 + ], + [ + 456, + 458 + ], + [ + 459, + 460 + ], + [ + 461, + 469 + ], + [ + 471, + 477 + ], + [ + 479, + 480 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 492, + 493 + ], + [ + 495, + 523 + ], + [ + 524, + 526 + ], + [ + 527, + 530 + ], + [ + 531, + 533 + ], + [ + 534, + 537 + ], + [ + 538, + 540 + ], + [ + 541, + 544 + ], + [ + 545, + 547 + ], + [ + 548, + 551 + ], + [ + 552, + 554 + ], + [ + 555, + 558 + ], + [ + 559, + 561 + ], + [ + 562, + 565 + ], + [ + 566, + 568 + ], + [ + 569, + 572 + ], + [ + 573, + 575 + ], + [ + 576, + 579 + ], + [ + 580, + 582 + ], + [ + 583, + 586 + ], + [ + 587, + 589 + ], + [ + 590, + 593 + ], + [ + 594, + 600 + ], + [ + 601, + 602 + ], + [ + 603, + 609 + ], + [ + 610, + 616 + ], + [ + 619, + 620 + ], + [ + 641, + 642 + ], + [ + 646, + 647 + ], + [ + 648, + 649 + ], + [ + 650, + 651 + ], + [ + 655, + 656 + ], + [ + 657, + 658 + ], + [ + 660, + 662 + ], + [ + 667, + 669 + ], + [ + 672, + 674 + ], + [ + 681, + 685 + ], + [ + 689, + 693 + ], + [ + 694, + 695 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/mosaicing.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 32 + ], + [ + 45, + 52 + ], + [ + 63, + 79 + ], + [ + 89, + 108 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 9, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 23 + ], + [ + 28, + 29 + ], + [ + 48, + 49 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 75, + 76 + ], + [ + 92, + 93 + ], + [ + 94, + 104 + ], + [ + 105, + 107 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/pmosaicing.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 9 + ], + [ + 11, + 39 + ], + [ + 42, + 49 + ], + [ + 51, + 64 + ], + [ + 71, + 89 + ], + [ + 93, + 103 + ], + [ + 107, + 202 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 5, + 6 + ], + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 35, + 36 + ], + [ + 45, + 46 + ], + [ + 54, + 56 + ], + [ + 60, + 61 + ], + [ + 74, + 76 + ], + [ + 77, + 78 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 96, + 97 + ], + [ + 99, + 100 + ], + [ + 110, + 111 + ], + [ + 112, + 114 + ], + [ + 115, + 116 + ], + [ + 117, + 125 + ], + [ + 126, + 130 + ], + [ + 131, + 137 + ], + [ + 138, + 140 + ], + [ + 142, + 151 + ], + [ + 152, + 153 + ], + [ + 155, + 156 + ], + [ + 162, + 163 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 176, + 189 + ], + [ + 191, + 195 + ], + [ + 197, + 199 + ], + [ + 201, + 202 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/remosaic.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 73, + 83 + ], + [ + 85, + 196 + ], + [ + 216, + 232 + ] + ], + "lines_added": [ + [ + 15, + 31 + ], + [ + 36, + 37 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 88, + 92 + ], + [ + 97, + 99 + ], + [ + 101, + 105 + ], + [ + 108, + 110 + ], + [ + 112, + 114 + ], + [ + 115, + 121 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 133, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 141 + ], + [ + 142, + 147 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ], + [ + 161, + 162 + ], + [ + 164, + 167 + ], + [ + 168, + 169 + ], + [ + 170, + 179 + ], + [ + 180, + 182 + ], + [ + 183, + 189 + ], + [ + 192, + 193 + ], + [ + 219, + 222 + ], + [ + 226, + 229 + ], + [ + 230, + 231 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/tbmerge.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 17 + ], + [ + 77, + 105 + ], + [ + 121, + 278 + ], + [ + 283, + 308 + ], + [ + 325, + 355 + ], + [ + 358, + 366 + ], + [ + 368, + 518 + ], + [ + 522, + 530 + ], + [ + 539, + 606 + ], + [ + 609, + 617 + ], + [ + 626, + 643 + ], + [ + 648, + 683 + ], + [ + 686, + 694 + ], + [ + 702, + 767 + ] + ], + "lines_added": [ + [ + 1, + 3 + ], + [ + 6, + 7 + ], + [ + 10, + 11 + ], + [ + 13, + 14 + ], + [ + 80, + 86 + ], + [ + 87, + 91 + ], + [ + 92, + 96 + ], + [ + 101, + 102 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 134, + 135 + ], + [ + 139, + 148 + ], + [ + 149, + 153 + ], + [ + 154, + 185 + ], + [ + 187, + 189 + ], + [ + 193, + 194 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 209, + 210 + ], + [ + 214, + 223 + ], + [ + 224, + 228 + ], + [ + 229, + 260 + ], + [ + 262, + 264 + ], + [ + 268, + 269 + ], + [ + 274, + 275 + ], + [ + 286, + 287 + ], + [ + 291, + 292 + ], + [ + 295, + 296 + ], + [ + 300, + 301 + ], + [ + 303, + 305 + ], + [ + 328, + 332 + ], + [ + 336, + 337 + ], + [ + 343, + 344 + ], + [ + 346, + 352 + ], + [ + 361, + 363 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 378, + 389 + ], + [ + 392, + 418 + ], + [ + 419, + 451 + ], + [ + 454, + 507 + ], + [ + 508, + 510 + ], + [ + 514, + 515 + ], + [ + 525, + 527 + ], + [ + 542, + 545 + ], + [ + 548, + 553 + ], + [ + 558, + 583 + ], + [ + 584, + 586 + ], + [ + 587, + 589 + ], + [ + 591, + 593 + ], + [ + 596, + 597 + ], + [ + 602, + 603 + ], + [ + 612, + 614 + ], + [ + 629, + 632 + ], + [ + 635, + 640 + ], + [ + 651, + 653 + ], + [ + 656, + 657 + ], + [ + 660, + 661 + ], + [ + 663, + 664 + ], + [ + 669, + 670 + ], + [ + 671, + 672 + ], + [ + 673, + 676 + ], + [ + 679, + 680 + ], + [ + 689, + 691 + ], + [ + 705, + 709 + ], + [ + 715, + 716 + ], + [ + 719, + 722 + ], + [ + 724, + 725 + ], + [ + 728, + 729 + ], + [ + 733, + 740 + ], + [ + 741, + 742 + ], + [ + 746, + 747 + ], + [ + 749, + 751 + ], + [ + 752, + 755 + ], + [ + 761, + 764 + ], + [ + 765, + 766 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/tbmosaic.c", + "line_filter": { + "diff_chunks": [ + [ + 31, + 59 + ], + [ + 69, + 98 + ], + [ + 107, + 150 + ], + [ + 152, + 164 + ], + [ + 169, + 202 + ], + [ + 209, + 224 + ], + [ + 228, + 256 + ] + ], + "lines_added": [ + [ + 34, + 50 + ], + [ + 55, + 56 + ], + [ + 72, + 76 + ], + [ + 78, + 79 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 91, + 95 + ], + [ + 110, + 116 + ], + [ + 120, + 133 + ], + [ + 134, + 140 + ], + [ + 142, + 144 + ], + [ + 146, + 147 + ], + [ + 155, + 156 + ], + [ + 158, + 159 + ], + [ + 160, + 161 + ], + [ + 172, + 173 + ], + [ + 174, + 177 + ], + [ + 180, + 183 + ], + [ + 186, + 188 + ], + [ + 189, + 190 + ], + [ + 191, + 194 + ], + [ + 197, + 199 + ], + [ + 212, + 213 + ], + [ + 215, + 217 + ], + [ + 218, + 219 + ], + [ + 220, + 221 + ], + [ + 231, + 239 + ], + [ + 240, + 241 + ], + [ + 244, + 251 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ] + ] + } + }, + { + "filename": "libvips/resample/affine.c", + "line_filter": { + "diff_chunks": [ + [ + 45, + 56 + ], + [ + 87, + 122 + ], + [ + 176, + 251 + ], + [ + 254, + 272 + ], + [ + 275, + 282 + ], + [ + 286, + 317 + ], + [ + 338, + 386 + ], + [ + 389, + 412 + ], + [ + 415, + 447 + ], + [ + 455, + 527 + ], + [ + 529, + 544 + ], + [ + 550, + 595 + ], + [ + 597, + 706 + ], + [ + 720, + 728 + ], + [ + 731, + 783 + ] + ], + "lines_added": [ + [ + 48, + 49 + ], + [ + 52, + 53 + ], + [ + 90, + 91 + ], + [ + 97, + 98 + ], + [ + 99, + 103 + ], + [ + 104, + 113 + ], + [ + 118, + 119 + ], + [ + 179, + 180 + ], + [ + 184, + 185 + ], + [ + 187, + 188 + ], + [ + 191, + 192 + ], + [ + 193, + 196 + ], + [ + 201, + 202 + ], + [ + 208, + 209 + ], + [ + 213, + 214 + ], + [ + 218, + 224 + ], + [ + 227, + 228 + ], + [ + 229, + 230 + ], + [ + 231, + 232 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 242, + 244 + ], + [ + 247, + 248 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 264, + 265 + ], + [ + 268, + 269 + ], + [ + 278, + 279 + ], + [ + 289, + 290 + ], + [ + 292, + 294 + ], + [ + 297, + 298 + ], + [ + 300, + 303 + ], + [ + 304, + 306 + ], + [ + 307, + 308 + ], + [ + 311, + 312 + ], + [ + 313, + 314 + ], + [ + 341, + 342 + ], + [ + 346, + 347 + ], + [ + 351, + 352 + ], + [ + 353, + 355 + ], + [ + 356, + 358 + ], + [ + 361, + 362 + ], + [ + 364, + 365 + ], + [ + 368, + 369 + ], + [ + 370, + 373 + ], + [ + 374, + 376 + ], + [ + 377, + 378 + ], + [ + 382, + 383 + ], + [ + 392, + 393 + ], + [ + 394, + 395 + ], + [ + 396, + 397 + ], + [ + 400, + 401 + ], + [ + 402, + 404 + ], + [ + 405, + 406 + ], + [ + 408, + 409 + ], + [ + 418, + 420 + ], + [ + 421, + 430 + ], + [ + 431, + 432 + ], + [ + 433, + 435 + ], + [ + 441, + 444 + ], + [ + 458, + 460 + ], + [ + 463, + 464 + ], + [ + 465, + 466 + ], + [ + 472, + 473 + ], + [ + 474, + 475 + ], + [ + 477, + 478 + ], + [ + 479, + 480 + ], + [ + 483, + 486 + ], + [ + 489, + 491 + ], + [ + 497, + 498 + ], + [ + 499, + 504 + ], + [ + 506, + 508 + ], + [ + 513, + 514 + ], + [ + 516, + 524 + ], + [ + 532, + 534 + ], + [ + 537, + 541 + ], + [ + 553, + 558 + ], + [ + 559, + 560 + ], + [ + 562, + 566 + ], + [ + 569, + 571 + ], + [ + 576, + 584 + ], + [ + 588, + 592 + ], + [ + 600, + 604 + ], + [ + 607, + 609 + ], + [ + 610, + 611 + ], + [ + 614, + 615 + ], + [ + 616, + 618 + ], + [ + 619, + 620 + ], + [ + 625, + 626 + ], + [ + 628, + 631 + ], + [ + 632, + 638 + ], + [ + 639, + 640 + ], + [ + 641, + 644 + ], + [ + 645, + 647 + ], + [ + 648, + 651 + ], + [ + 652, + 654 + ], + [ + 655, + 658 + ], + [ + 659, + 661 + ], + [ + 662, + 665 + ], + [ + 666, + 668 + ], + [ + 669, + 672 + ], + [ + 673, + 675 + ], + [ + 676, + 679 + ], + [ + 680, + 682 + ], + [ + 683, + 686 + ], + [ + 687, + 689 + ], + [ + 690, + 696 + ], + [ + 699, + 700 + ], + [ + 702, + 703 + ], + [ + 723, + 725 + ], + [ + 734, + 737 + ], + [ + 742, + 744 + ], + [ + 746, + 748 + ], + [ + 750, + 751 + ], + [ + 756, + 757 + ], + [ + 759, + 760 + ], + [ + 766, + 768 + ], + [ + 773, + 774 + ], + [ + 775, + 778 + ], + [ + 779, + 780 + ], + [ + 781, + 782 + ] + ] + } + }, + { + "filename": "libvips/resample/interpolate.c", + "line_filter": { + "diff_chunks": [ + [ + 22, + 50 + ], + [ + 72, + 79 + ], + [ + 99, + 106 + ], + [ + 108, + 115 + ], + [ + 123, + 181 + ], + [ + 182, + 189 + ], + [ + 192, + 207 + ], + [ + 215, + 232 + ], + [ + 235, + 284 + ], + [ + 290, + 297 + ], + [ + 303, + 634 + ], + [ + 650, + 665 + ] + ], + "lines_added": [ + [ + 25, + 26 + ], + [ + 27, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 41 + ], + [ + 46, + 47 + ], + [ + 75, + 76 + ], + [ + 102, + 103 + ], + [ + 111, + 112 + ], + [ + 126, + 127 + ], + [ + 132, + 133 + ], + [ + 134, + 136 + ], + [ + 137, + 138 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 158, + 161 + ], + [ + 162, + 164 + ], + [ + 167, + 168 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 177, + 178 + ], + [ + 185, + 186 + ], + [ + 195, + 196 + ], + [ + 198, + 200 + ], + [ + 203, + 204 + ], + [ + 218, + 220 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 228, + 229 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 244, + 245 + ], + [ + 247, + 248 + ], + [ + 251, + 252 + ], + [ + 256, + 257 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 278, + 279 + ], + [ + 280, + 281 + ], + [ + 293, + 294 + ], + [ + 306, + 307 + ], + [ + 313, + 326 + ], + [ + 332, + 334 + ], + [ + 336, + 338 + ], + [ + 339, + 340 + ], + [ + 344, + 346 + ], + [ + 349, + 350 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 358, + 359 + ], + [ + 361, + 362 + ], + [ + 368, + 369 + ], + [ + 371, + 373 + ], + [ + 377, + 378 + ], + [ + 379, + 381 + ], + [ + 386, + 387 + ], + [ + 392, + 393 + ], + [ + 396, + 397 + ], + [ + 398, + 399 + ], + [ + 401, + 402 + ], + [ + 408, + 421 + ], + [ + 425, + 427 + ], + [ + 433, + 441 + ], + [ + 444, + 466 + ], + [ + 467, + 473 + ], + [ + 474, + 475 + ], + [ + 478, + 500 + ], + [ + 502, + 503 + ], + [ + 504, + 541 + ], + [ + 543, + 545 + ], + [ + 548, + 550 + ], + [ + 551, + 552 + ], + [ + 556, + 560 + ], + [ + 563, + 567 + ], + [ + 568, + 569 + ], + [ + 572, + 573 + ], + [ + 574, + 575 + ], + [ + 579, + 580 + ], + [ + 586, + 587 + ], + [ + 589, + 591 + ], + [ + 595, + 596 + ], + [ + 597, + 599 + ], + [ + 604, + 605 + ], + [ + 610, + 611 + ], + [ + 614, + 615 + ], + [ + 616, + 617 + ], + [ + 619, + 620 + ], + [ + 625, + 626 + ], + [ + 627, + 631 + ], + [ + 653, + 654 + ], + [ + 657, + 661 + ], + [ + 663, + 664 + ] + ] + } + }, + { + "filename": "libvips/resample/mapim.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 44 + ], + [ + 94, + 150 + ], + [ + 157, + 200 + ], + [ + 204, + 222 + ], + [ + 225, + 351 + ], + [ + 362, + 441 + ], + [ + 445, + 494 + ], + [ + 500, + 516 + ], + [ + 517, + 598 + ], + [ + 604, + 612 + ], + [ + 617, + 658 + ] + ], + "lines_added": [ + [ + 19, + 35 + ], + [ + 40, + 41 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 115 + ], + [ + 116, + 117 + ], + [ + 118, + 135 + ], + [ + 136, + 142 + ], + [ + 146, + 147 + ], + [ + 160, + 197 + ], + [ + 207, + 211 + ], + [ + 215, + 219 + ], + [ + 228, + 248 + ], + [ + 249, + 250 + ], + [ + 253, + 275 + ], + [ + 276, + 277 + ], + [ + 280, + 304 + ], + [ + 305, + 306 + ], + [ + 308, + 309 + ], + [ + 310, + 311 + ], + [ + 313, + 314 + ], + [ + 315, + 322 + ], + [ + 327, + 328 + ], + [ + 329, + 331 + ], + [ + 334, + 335 + ], + [ + 340, + 342 + ], + [ + 343, + 344 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 365, + 366 + ], + [ + 368, + 370 + ], + [ + 373, + 374 + ], + [ + 376, + 379 + ], + [ + 380, + 382 + ], + [ + 383, + 384 + ], + [ + 387, + 420 + ], + [ + 426, + 427 + ], + [ + 428, + 429 + ], + [ + 432, + 433 + ], + [ + 434, + 436 + ], + [ + 437, + 438 + ], + [ + 448, + 450 + ], + [ + 451, + 454 + ], + [ + 457, + 459 + ], + [ + 461, + 464 + ], + [ + 468, + 469 + ], + [ + 473, + 481 + ], + [ + 483, + 485 + ], + [ + 487, + 491 + ], + [ + 503, + 508 + ], + [ + 510, + 513 + ], + [ + 520, + 524 + ], + [ + 527, + 531 + ], + [ + 534, + 536 + ], + [ + 537, + 538 + ], + [ + 541, + 542 + ], + [ + 543, + 545 + ], + [ + 546, + 547 + ], + [ + 552, + 553 + ], + [ + 555, + 564 + ], + [ + 565, + 566 + ], + [ + 567, + 570 + ], + [ + 571, + 573 + ], + [ + 574, + 577 + ], + [ + 578, + 580 + ], + [ + 581, + 587 + ], + [ + 590, + 591 + ], + [ + 592, + 593 + ], + [ + 594, + 595 + ], + [ + 607, + 609 + ], + [ + 620, + 621 + ], + [ + 622, + 623 + ], + [ + 624, + 625 + ], + [ + 626, + 627 + ], + [ + 628, + 630 + ], + [ + 634, + 635 + ], + [ + 637, + 638 + ], + [ + 639, + 640 + ], + [ + 641, + 642 + ], + [ + 647, + 648 + ], + [ + 652, + 655 + ], + [ + 656, + 657 + ] + ] + } + }, + { + "filename": "libvips/resample/presample.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 55 + ], + [ + 63, + 81 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 51 + ], + [ + 66, + 67 + ], + [ + 72, + 75 + ] + ] + } + }, + { + "filename": "libvips/resample/quadratic.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 64, + 74 + ], + [ + 102, + 154 + ], + [ + 155, + 165 + ], + [ + 166, + 174 + ], + [ + 175, + 245 + ], + [ + 246, + 363 + ], + [ + 371, + 392 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 67, + 71 + ], + [ + 105, + 106 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 118, + 120 + ], + [ + 123, + 126 + ], + [ + 128, + 129 + ], + [ + 132, + 133 + ], + [ + 134, + 135 + ], + [ + 141, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 151 + ], + [ + 158, + 160 + ], + [ + 161, + 162 + ], + [ + 169, + 171 + ], + [ + 178, + 179 + ], + [ + 184, + 185 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 203, + 205 + ], + [ + 209, + 210 + ], + [ + 211, + 216 + ], + [ + 218, + 221 + ], + [ + 227, + 228 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 240, + 242 + ], + [ + 249, + 251 + ], + [ + 255, + 258 + ], + [ + 261, + 275 + ], + [ + 277, + 279 + ], + [ + 281, + 283 + ], + [ + 285, + 287 + ], + [ + 290, + 295 + ], + [ + 296, + 298 + ], + [ + 299, + 301 + ], + [ + 302, + 303 + ], + [ + 304, + 311 + ], + [ + 313, + 318 + ], + [ + 320, + 324 + ], + [ + 325, + 326 + ], + [ + 329, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 335 + ], + [ + 341, + 343 + ], + [ + 345, + 348 + ], + [ + 349, + 350 + ], + [ + 351, + 354 + ], + [ + 355, + 356 + ], + [ + 359, + 360 + ], + [ + 374, + 375 + ], + [ + 381, + 382 + ], + [ + 386, + 389 + ], + [ + 390, + 391 + ] + ] + } + }, + { + "filename": "libvips/resample/reduce.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 10 + ], + [ + 14, + 42 + ], + [ + 59, + 74 + ], + [ + 94, + 104 + ], + [ + 125, + 135 + ], + [ + 138, + 147 + ], + [ + 154, + 261 + ], + [ + 273, + 280 + ], + [ + 282, + 307 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 6, + 7 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 62, + 63 + ], + [ + 64, + 66 + ], + [ + 70, + 71 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 128, + 129 + ], + [ + 131, + 132 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 157, + 158 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 164, + 172 + ], + [ + 173, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 190 + ], + [ + 191, + 192 + ], + [ + 197, + 198 + ], + [ + 202, + 205 + ], + [ + 206, + 208 + ], + [ + 209, + 212 + ], + [ + 213, + 215 + ], + [ + 216, + 219 + ], + [ + 220, + 222 + ], + [ + 223, + 226 + ], + [ + 227, + 229 + ], + [ + 230, + 231 + ], + [ + 232, + 235 + ], + [ + 236, + 238 + ], + [ + 239, + 242 + ], + [ + 243, + 245 + ], + [ + 248, + 251 + ], + [ + 252, + 254 + ], + [ + 257, + 258 + ], + [ + 276, + 277 + ], + [ + 285, + 286 + ], + [ + 288, + 289 + ], + [ + 295, + 297 + ], + [ + 301, + 304 + ], + [ + 305, + 306 + ] + ] + } + }, + { + "filename": "libvips/resample/resample.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 61, + 68 + ], + [ + 72, + 81 + ], + [ + 82, + 96 + ], + [ + 102, + 157 + ], + [ + 158, + 197 + ] + ], + "lines_added": [ + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 28 + ], + [ + 33, + 34 + ], + [ + 64, + 65 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 85, + 86 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 105, + 106 + ], + [ + 108, + 109 + ], + [ + 110, + 111 + ], + [ + 113, + 116 + ], + [ + 118, + 119 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 129, + 131 + ], + [ + 136, + 137 + ], + [ + 139, + 142 + ], + [ + 143, + 144 + ], + [ + 145, + 150 + ], + [ + 153, + 154 + ], + [ + 161, + 162 + ], + [ + 163, + 196 + ] + ] + } + }, + { + "filename": "libvips/resample/resize.c", + "line_filter": { + "diff_chunks": [ + [ + 22, + 29 + ], + [ + 30, + 37 + ], + [ + 41, + 69 + ], + [ + 108, + 144 + ], + [ + 145, + 202 + ], + [ + 205, + 395 + ], + [ + 404, + 414 + ], + [ + 416, + 423 + ], + [ + 432, + 439 + ], + [ + 442, + 457 + ] + ], + "lines_added": [ + [ + 25, + 26 + ], + [ + 33, + 34 + ], + [ + 44, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 60 + ], + [ + 65, + 66 + ], + [ + 111, + 112 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 130, + 131 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 148, + 150 + ], + [ + 156, + 157 + ], + [ + 163, + 165 + ], + [ + 167, + 168 + ], + [ + 173, + 176 + ], + [ + 178, + 187 + ], + [ + 189, + 191 + ], + [ + 192, + 199 + ], + [ + 208, + 210 + ], + [ + 213, + 220 + ], + [ + 223, + 230 + ], + [ + 235, + 239 + ], + [ + 244, + 246 + ], + [ + 249, + 252 + ], + [ + 253, + 256 + ], + [ + 258, + 261 + ], + [ + 263, + 275 + ], + [ + 277, + 287 + ], + [ + 289, + 299 + ], + [ + 303, + 305 + ], + [ + 306, + 307 + ], + [ + 310, + 311 + ], + [ + 312, + 315 + ], + [ + 316, + 317 + ], + [ + 322, + 323 + ], + [ + 327, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 337 + ], + [ + 338, + 340 + ], + [ + 341, + 344 + ], + [ + 345, + 347 + ], + [ + 348, + 351 + ], + [ + 352, + 354 + ], + [ + 356, + 357 + ], + [ + 358, + 361 + ], + [ + 362, + 364 + ], + [ + 365, + 368 + ], + [ + 369, + 371 + ], + [ + 374, + 379 + ], + [ + 382, + 385 + ], + [ + 386, + 388 + ], + [ + 391, + 392 + ], + [ + 407, + 408 + ], + [ + 410, + 411 + ], + [ + 419, + 420 + ], + [ + 435, + 436 + ], + [ + 445, + 447 + ], + [ + 451, + 454 + ], + [ + 455, + 456 + ] + ] + } + }, + { + "filename": "libvips/resample/shrink.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 13 + ], + [ + 16, + 44 + ], + [ + 63, + 137 + ], + [ + 138, + 184 + ], + [ + 196, + 224 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 35 + ], + [ + 40, + 41 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 74, + 75 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 83 + ], + [ + 87, + 89 + ], + [ + 93, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 101 + ], + [ + 102, + 105 + ], + [ + 107, + 115 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 126 + ], + [ + 127, + 128 + ], + [ + 133, + 134 + ], + [ + 141, + 144 + ], + [ + 145, + 147 + ], + [ + 148, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 158 + ], + [ + 159, + 161 + ], + [ + 162, + 163 + ], + [ + 164, + 167 + ], + [ + 168, + 170 + ], + [ + 171, + 174 + ], + [ + 175, + 177 + ], + [ + 180, + 181 + ], + [ + 199, + 200 + ], + [ + 202, + 203 + ], + [ + 205, + 206 + ], + [ + 212, + 214 + ], + [ + 218, + 221 + ], + [ + 222, + 223 + ] + ] + } + }, + { + "filename": "libvips/resample/shrinkh.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 12 + ], + [ + 14, + 42 + ], + [ + 61, + 225 + ], + [ + 226, + 289 + ], + [ + 290, + 361 + ], + [ + 370, + 397 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 64, + 66 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 96 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 117 + ], + [ + 118, + 119 + ], + [ + 123, + 125 + ], + [ + 126, + 132 + ], + [ + 136, + 138 + ], + [ + 144, + 145 + ], + [ + 146, + 148 + ], + [ + 149, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 157 + ], + [ + 160, + 187 + ], + [ + 189, + 190 + ], + [ + 194, + 196 + ], + [ + 199, + 200 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 213, + 214 + ], + [ + 217, + 219 + ], + [ + 221, + 222 + ], + [ + 229, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 235 + ], + [ + 236, + 238 + ], + [ + 239, + 240 + ], + [ + 242, + 243 + ], + [ + 244, + 245 + ], + [ + 248, + 249 + ], + [ + 250, + 252 + ], + [ + 253, + 255 + ], + [ + 258, + 260 + ], + [ + 261, + 262 + ], + [ + 263, + 267 + ], + [ + 269, + 271 + ], + [ + 275, + 281 + ], + [ + 283, + 286 + ], + [ + 293, + 298 + ], + [ + 301, + 304 + ], + [ + 306, + 310 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 317, + 320 + ], + [ + 321, + 322 + ], + [ + 327, + 328 + ], + [ + 332, + 335 + ], + [ + 336, + 338 + ], + [ + 339, + 342 + ], + [ + 343, + 345 + ], + [ + 346, + 347 + ], + [ + 348, + 351 + ], + [ + 352, + 354 + ], + [ + 357, + 358 + ], + [ + 373, + 374 + ], + [ + 376, + 377 + ], + [ + 379, + 380 + ], + [ + 386, + 387 + ], + [ + 391, + 394 + ], + [ + 395, + 396 + ] + ] + } + }, + { + "filename": "libvips/resample/shrinkv.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 12 + ], + [ + 42, + 49 + ], + [ + 53, + 81 + ], + [ + 101, + 116 + ], + [ + 122, + 319 + ], + [ + 320, + 401 + ], + [ + 402, + 425 + ], + [ + 430, + 498 + ], + [ + 507, + 534 + ] + ], + "lines_added": [ + [ + 7, + 9 + ], + [ + 45, + 46 + ], + [ + 56, + 57 + ], + [ + 58, + 62 + ], + [ + 63, + 72 + ], + [ + 77, + 78 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 112, + 113 + ], + [ + 125, + 126 + ], + [ + 129, + 132 + ], + [ + 133, + 134 + ], + [ + 139, + 140 + ], + [ + 145, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ], + [ + 157, + 165 + ], + [ + 166, + 167 + ], + [ + 169, + 171 + ], + [ + 172, + 176 + ], + [ + 179, + 211 + ], + [ + 213, + 214 + ], + [ + 217, + 218 + ], + [ + 219, + 229 + ], + [ + 230, + 240 + ], + [ + 242, + 244 + ], + [ + 245, + 249 + ], + [ + 252, + 254 + ], + [ + 255, + 257 + ], + [ + 258, + 260 + ], + [ + 261, + 284 + ], + [ + 286, + 287 + ], + [ + 291, + 293 + ], + [ + 297, + 298 + ], + [ + 302, + 303 + ], + [ + 304, + 305 + ], + [ + 308, + 310 + ], + [ + 312, + 314 + ], + [ + 315, + 316 + ], + [ + 323, + 324 + ], + [ + 325, + 327 + ], + [ + 328, + 329 + ], + [ + 330, + 332 + ], + [ + 333, + 334 + ], + [ + 336, + 337 + ], + [ + 338, + 340 + ], + [ + 341, + 342 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 350, + 351 + ], + [ + 352, + 354 + ], + [ + 355, + 357 + ], + [ + 360, + 362 + ], + [ + 363, + 364 + ], + [ + 365, + 369 + ], + [ + 371, + 373 + ], + [ + 377, + 383 + ], + [ + 387, + 390 + ], + [ + 392, + 393 + ], + [ + 395, + 398 + ], + [ + 405, + 410 + ], + [ + 413, + 416 + ], + [ + 418, + 422 + ], + [ + 433, + 434 + ], + [ + 435, + 437 + ], + [ + 438, + 442 + ], + [ + 445, + 447 + ], + [ + 448, + 449 + ], + [ + 452, + 453 + ], + [ + 454, + 457 + ], + [ + 458, + 459 + ], + [ + 464, + 465 + ], + [ + 469, + 472 + ], + [ + 473, + 475 + ], + [ + 476, + 479 + ], + [ + 480, + 482 + ], + [ + 483, + 484 + ], + [ + 485, + 488 + ], + [ + 489, + 491 + ], + [ + 494, + 495 + ], + [ + 510, + 511 + ], + [ + 513, + 514 + ], + [ + 516, + 517 + ], + [ + 523, + 524 + ], + [ + 528, + 531 + ], + [ + 532, + 533 + ] + ] + } + }, + { + "filename": "libvips/resample/similarity.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 76, + 219 + ], + [ + 227, + 234 + ], + [ + 236, + 289 + ], + [ + 296, + 303 + ], + [ + 305, + 326 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 79, + 81 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 87, + 91 + ], + [ + 94, + 96 + ], + [ + 97, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 111 + ], + [ + 114, + 115 + ], + [ + 116, + 118 + ], + [ + 123, + 124 + ], + [ + 126, + 129 + ], + [ + 130, + 131 + ], + [ + 132, + 135 + ], + [ + 136, + 138 + ], + [ + 139, + 142 + ], + [ + 143, + 145 + ], + [ + 146, + 149 + ], + [ + 150, + 152 + ], + [ + 153, + 156 + ], + [ + 157, + 159 + ], + [ + 160, + 166 + ], + [ + 169, + 170 + ], + [ + 171, + 179 + ], + [ + 184, + 186 + ], + [ + 188, + 189 + ], + [ + 190, + 192 + ], + [ + 197, + 198 + ], + [ + 199, + 202 + ], + [ + 203, + 205 + ], + [ + 206, + 209 + ], + [ + 210, + 212 + ], + [ + 215, + 216 + ], + [ + 230, + 231 + ], + [ + 239, + 240 + ], + [ + 246, + 247 + ], + [ + 251, + 254 + ], + [ + 255, + 256 + ], + [ + 261, + 262 + ], + [ + 264, + 265 + ], + [ + 266, + 268 + ], + [ + 273, + 275 + ], + [ + 276, + 279 + ], + [ + 280, + 282 + ], + [ + 285, + 286 + ], + [ + 299, + 300 + ], + [ + 308, + 309 + ], + [ + 315, + 316 + ], + [ + 320, + 323 + ], + [ + 324, + 325 + ] + ] + } + }, + { + "filename": "libvips/resample/templates.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 32, + 62 + ], + [ + 69, + 77 + ], + [ + 78, + 85 + ], + [ + 86, + 100 + ], + [ + 101, + 108 + ], + [ + 109, + 129 + ], + [ + 130, + 137 + ], + [ + 139, + 307 + ], + [ + 312, + 394 + ], + [ + 397, + 455 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 35, + 37 + ], + [ + 40, + 41 + ], + [ + 43, + 45 + ], + [ + 46, + 47 + ], + [ + 50, + 51 + ], + [ + 53, + 55 + ], + [ + 58, + 59 + ], + [ + 72, + 74 + ], + [ + 81, + 82 + ], + [ + 89, + 90 + ], + [ + 95, + 97 + ], + [ + 104, + 105 + ], + [ + 112, + 113 + ], + [ + 118, + 119 + ], + [ + 124, + 126 + ], + [ + 133, + 134 + ], + [ + 142, + 143 + ], + [ + 149, + 150 + ], + [ + 153, + 154 + ], + [ + 158, + 160 + ], + [ + 164, + 165 + ], + [ + 171, + 172 + ], + [ + 175, + 177 + ], + [ + 180, + 182 + ], + [ + 185, + 187 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 204, + 205 + ], + [ + 209, + 211 + ], + [ + 215, + 216 + ], + [ + 222, + 223 + ], + [ + 226, + 228 + ], + [ + 231, + 233 + ], + [ + 236, + 238 + ], + [ + 241, + 242 + ], + [ + 243, + 244 + ], + [ + 247, + 248 + ], + [ + 250, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 259 + ], + [ + 263, + 265 + ], + [ + 269, + 270 + ], + [ + 271, + 281 + ], + [ + 287, + 288 + ], + [ + 294, + 297 + ], + [ + 299, + 300 + ], + [ + 303, + 304 + ], + [ + 315, + 317 + ], + [ + 320, + 321 + ], + [ + 324, + 325 + ], + [ + 327, + 328 + ], + [ + 332, + 334 + ], + [ + 339, + 340 + ], + [ + 345, + 346 + ], + [ + 352, + 354 + ], + [ + 357, + 358 + ], + [ + 361, + 362 + ], + [ + 364, + 365 + ], + [ + 366, + 367 + ], + [ + 372, + 373 + ], + [ + 374, + 378 + ], + [ + 379, + 384 + ], + [ + 390, + 391 + ], + [ + 400, + 401 + ], + [ + 402, + 404 + ], + [ + 407, + 408 + ], + [ + 411, + 412 + ], + [ + 414, + 415 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 423, + 424 + ], + [ + 426, + 428 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 443, + 444 + ], + [ + 447, + 449 + ], + [ + 453, + 454 + ] + ] + } + }, + { + "filename": "libvips/resample/thumbnail.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 22 + ], + [ + 41, + 69 + ], + [ + 83, + 101 + ], + [ + 120, + 135 + ], + [ + 156, + 303 + ], + [ + 306, + 345 + ], + [ + 347, + 358 + ], + [ + 361, + 417 + ], + [ + 418, + 580 + ], + [ + 581, + 589 + ], + [ + 590, + 655 + ], + [ + 665, + 678 + ], + [ + 679, + 738 + ], + [ + 741, + 758 + ], + [ + 761, + 793 + ], + [ + 801, + 892 + ], + [ + 895, + 965 + ], + [ + 966, + 1072 + ], + [ + 1077, + 1221 + ], + [ + 1241, + 1253 + ], + [ + 1255, + 1281 + ], + [ + 1288, + 1304 + ], + [ + 1309, + 1469 + ], + [ + 1496, + 1503 + ], + [ + 1504, + 1519 + ], + [ + 1524, + 1683 + ], + [ + 1709, + 1725 + ], + [ + 1729, + 1742 + ], + [ + 1743, + 1799 + ], + [ + 1815, + 1822 + ], + [ + 1827, + 1841 + ] + ], + "lines_added": [ + [ + 18, + 19 + ], + [ + 44, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 55 + ], + [ + 56, + 60 + ], + [ + 65, + 66 + ], + [ + 86, + 97 + ], + [ + 123, + 124 + ], + [ + 127, + 132 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 177, + 180 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 189, + 192 + ], + [ + 194, + 195 + ], + [ + 201, + 202 + ], + [ + 205, + 208 + ], + [ + 209, + 210 + ], + [ + 213, + 214 + ], + [ + 217, + 222 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 230, + 231 + ], + [ + 235, + 236 + ], + [ + 239, + 241 + ], + [ + 243, + 244 + ], + [ + 246, + 248 + ], + [ + 249, + 252 + ], + [ + 253, + 254 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 274, + 275 + ], + [ + 277, + 278 + ], + [ + 284, + 285 + ], + [ + 288, + 289 + ], + [ + 295, + 297 + ], + [ + 298, + 300 + ], + [ + 309, + 312 + ], + [ + 318, + 319 + ], + [ + 321, + 322 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ], + [ + 330, + 331 + ], + [ + 337, + 338 + ], + [ + 341, + 342 + ], + [ + 350, + 352 + ], + [ + 353, + 355 + ], + [ + 364, + 367 + ], + [ + 372, + 373 + ], + [ + 374, + 375 + ], + [ + 378, + 380 + ], + [ + 381, + 382 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 395, + 396 + ], + [ + 399, + 401 + ], + [ + 402, + 403 + ], + [ + 404, + 405 + ], + [ + 407, + 409 + ], + [ + 413, + 414 + ], + [ + 421, + 423 + ], + [ + 428, + 429 + ], + [ + 434, + 436 + ], + [ + 441, + 444 + ], + [ + 445, + 448 + ], + [ + 452, + 454 + ], + [ + 460, + 462 + ], + [ + 467, + 469 + ], + [ + 470, + 471 + ], + [ + 472, + 473 + ], + [ + 478, + 480 + ], + [ + 481, + 483 + ], + [ + 487, + 489 + ], + [ + 492, + 494 + ], + [ + 497, + 505 + ], + [ + 510, + 512 + ], + [ + 515, + 517 + ], + [ + 518, + 523 + ], + [ + 524, + 525 + ], + [ + 527, + 528 + ], + [ + 529, + 530 + ], + [ + 533, + 534 + ], + [ + 535, + 536 + ], + [ + 540, + 545 + ], + [ + 547, + 548 + ], + [ + 549, + 550 + ], + [ + 554, + 555 + ], + [ + 556, + 557 + ], + [ + 560, + 561 + ], + [ + 562, + 563 + ], + [ + 569, + 571 + ], + [ + 574, + 575 + ], + [ + 576, + 577 + ], + [ + 584, + 586 + ], + [ + 593, + 604 + ], + [ + 605, + 609 + ], + [ + 612, + 613 + ], + [ + 614, + 620 + ], + [ + 624, + 625 + ], + [ + 629, + 633 + ], + [ + 637, + 638 + ], + [ + 639, + 641 + ], + [ + 642, + 643 + ], + [ + 644, + 645 + ], + [ + 648, + 649 + ], + [ + 650, + 652 + ], + [ + 668, + 671 + ], + [ + 673, + 675 + ], + [ + 682, + 683 + ], + [ + 685, + 686 + ], + [ + 690, + 692 + ], + [ + 696, + 697 + ], + [ + 700, + 702 + ], + [ + 705, + 707 + ], + [ + 710, + 712 + ], + [ + 714, + 716 + ], + [ + 718, + 719 + ], + [ + 720, + 735 + ], + [ + 744, + 755 + ], + [ + 764, + 775 + ], + [ + 780, + 782 + ], + [ + 786, + 790 + ], + [ + 804, + 808 + ], + [ + 810, + 812 + ], + [ + 815, + 819 + ], + [ + 821, + 826 + ], + [ + 832, + 835 + ], + [ + 836, + 838 + ], + [ + 840, + 842 + ], + [ + 846, + 847 + ], + [ + 851, + 857 + ], + [ + 859, + 860 + ], + [ + 865, + 875 + ], + [ + 879, + 886 + ], + [ + 887, + 889 + ], + [ + 898, + 909 + ], + [ + 912, + 916 + ], + [ + 918, + 921 + ], + [ + 926, + 927 + ], + [ + 930, + 932 + ], + [ + 933, + 934 + ], + [ + 939, + 942 + ], + [ + 943, + 945 + ], + [ + 948, + 949 + ], + [ + 950, + 952 + ], + [ + 953, + 954 + ], + [ + 957, + 958 + ], + [ + 959, + 962 + ], + [ + 969, + 970 + ], + [ + 972, + 973 + ], + [ + 977, + 982 + ], + [ + 983, + 986 + ], + [ + 987, + 989 + ], + [ + 990, + 993 + ], + [ + 994, + 996 + ], + [ + 997, + 1000 + ], + [ + 1001, + 1003 + ], + [ + 1004, + 1007 + ], + [ + 1008, + 1010 + ], + [ + 1011, + 1014 + ], + [ + 1015, + 1017 + ], + [ + 1018, + 1021 + ], + [ + 1022, + 1024 + ], + [ + 1025, + 1028 + ], + [ + 1029, + 1031 + ], + [ + 1032, + 1035 + ], + [ + 1036, + 1038 + ], + [ + 1039, + 1042 + ], + [ + 1043, + 1045 + ], + [ + 1046, + 1049 + ], + [ + 1050, + 1052 + ], + [ + 1053, + 1054 + ], + [ + 1059, + 1062 + ], + [ + 1063, + 1065 + ], + [ + 1068, + 1069 + ], + [ + 1080, + 1081 + ], + [ + 1085, + 1087 + ], + [ + 1091, + 1092 + ], + [ + 1097, + 1098 + ], + [ + 1099, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1105, + 1106 + ], + [ + 1107, + 1108 + ], + [ + 1110, + 1111 + ], + [ + 1113, + 1114 + ], + [ + 1117, + 1119 + ], + [ + 1122, + 1123 + ], + [ + 1124, + 1127 + ], + [ + 1130, + 1131 + ], + [ + 1132, + 1136 + ], + [ + 1139, + 1140 + ], + [ + 1141, + 1142 + ], + [ + 1144, + 1146 + ], + [ + 1149, + 1150 + ], + [ + 1151, + 1152 + ], + [ + 1153, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1159, + 1161 + ], + [ + 1164, + 1167 + ], + [ + 1170, + 1171 + ], + [ + 1172, + 1173 + ], + [ + 1175, + 1176 + ], + [ + 1177, + 1179 + ], + [ + 1182, + 1183 + ], + [ + 1185, + 1186 + ], + [ + 1188, + 1189 + ], + [ + 1193, + 1194 + ], + [ + 1195, + 1198 + ], + [ + 1203, + 1204 + ], + [ + 1208, + 1214 + ], + [ + 1217, + 1218 + ], + [ + 1244, + 1245 + ], + [ + 1246, + 1247 + ], + [ + 1249, + 1250 + ], + [ + 1258, + 1259 + ], + [ + 1261, + 1262 + ], + [ + 1263, + 1264 + ], + [ + 1269, + 1270 + ], + [ + 1274, + 1278 + ], + [ + 1291, + 1292 + ], + [ + 1296, + 1299 + ], + [ + 1300, + 1301 + ], + [ + 1312, + 1314 + ], + [ + 1318, + 1319 + ], + [ + 1324, + 1325 + ], + [ + 1326, + 1332 + ], + [ + 1333, + 1334 + ], + [ + 1335, + 1336 + ], + [ + 1337, + 1338 + ], + [ + 1340, + 1341 + ], + [ + 1343, + 1344 + ], + [ + 1347, + 1350 + ], + [ + 1353, + 1354 + ], + [ + 1355, + 1359 + ], + [ + 1362, + 1363 + ], + [ + 1364, + 1369 + ], + [ + 1372, + 1373 + ], + [ + 1374, + 1375 + ], + [ + 1377, + 1380 + ], + [ + 1383, + 1384 + ], + [ + 1385, + 1387 + ], + [ + 1389, + 1390 + ], + [ + 1391, + 1392 + ], + [ + 1395, + 1398 + ], + [ + 1401, + 1405 + ], + [ + 1408, + 1409 + ], + [ + 1410, + 1412 + ], + [ + 1414, + 1415 + ], + [ + 1416, + 1419 + ], + [ + 1422, + 1423 + ], + [ + 1425, + 1427 + ], + [ + 1429, + 1430 + ], + [ + 1434, + 1435 + ], + [ + 1436, + 1439 + ], + [ + 1444, + 1445 + ], + [ + 1449, + 1455 + ], + [ + 1456, + 1459 + ], + [ + 1460, + 1462 + ], + [ + 1465, + 1466 + ], + [ + 1499, + 1500 + ], + [ + 1507, + 1508 + ], + [ + 1509, + 1512 + ], + [ + 1513, + 1514 + ], + [ + 1515, + 1516 + ], + [ + 1527, + 1529 + ], + [ + 1533, + 1534 + ], + [ + 1539, + 1540 + ], + [ + 1541, + 1546 + ], + [ + 1547, + 1548 + ], + [ + 1549, + 1550 + ], + [ + 1551, + 1552 + ], + [ + 1554, + 1555 + ], + [ + 1557, + 1558 + ], + [ + 1561, + 1564 + ], + [ + 1567, + 1568 + ], + [ + 1569, + 1573 + ], + [ + 1576, + 1577 + ], + [ + 1578, + 1583 + ], + [ + 1586, + 1587 + ], + [ + 1588, + 1589 + ], + [ + 1591, + 1594 + ], + [ + 1597, + 1598 + ], + [ + 1599, + 1601 + ], + [ + 1603, + 1604 + ], + [ + 1605, + 1606 + ], + [ + 1609, + 1612 + ], + [ + 1615, + 1619 + ], + [ + 1622, + 1623 + ], + [ + 1624, + 1626 + ], + [ + 1628, + 1629 + ], + [ + 1630, + 1633 + ], + [ + 1636, + 1637 + ], + [ + 1639, + 1641 + ], + [ + 1643, + 1644 + ], + [ + 1648, + 1649 + ], + [ + 1650, + 1653 + ], + [ + 1658, + 1659 + ], + [ + 1663, + 1669 + ], + [ + 1670, + 1673 + ], + [ + 1674, + 1676 + ], + [ + 1679, + 1680 + ], + [ + 1712, + 1713 + ], + [ + 1717, + 1720 + ], + [ + 1721, + 1722 + ], + [ + 1732, + 1734 + ], + [ + 1738, + 1739 + ], + [ + 1746, + 1747 + ], + [ + 1748, + 1749 + ], + [ + 1754, + 1755 + ], + [ + 1757, + 1759 + ], + [ + 1763, + 1765 + ], + [ + 1766, + 1767 + ], + [ + 1768, + 1769 + ], + [ + 1772, + 1773 + ], + [ + 1774, + 1777 + ], + [ + 1782, + 1783 + ], + [ + 1787, + 1790 + ], + [ + 1791, + 1792 + ], + [ + 1795, + 1796 + ], + [ + 1818, + 1819 + ], + [ + 1830, + 1831 + ], + [ + 1835, + 1838 + ], + [ + 1839, + 1840 + ] + ] + } + }, + { + "filename": "libvips/resample/transform.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 43, + 65 + ], + [ + 68, + 81 + ], + [ + 84, + 91 + ], + [ + 93, + 121 + ], + [ + 126, + 164 + ], + [ + 166, + 178 + ], + [ + 180, + 197 + ], + [ + 198, + 253 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 46, + 47 + ], + [ + 53, + 54 + ], + [ + 57, + 58 + ], + [ + 59, + 62 + ], + [ + 71, + 72 + ], + [ + 77, + 78 + ], + [ + 87, + 88 + ], + [ + 96, + 97 + ], + [ + 102, + 103 + ], + [ + 104, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 111 + ], + [ + 116, + 118 + ], + [ + 129, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 137 + ], + [ + 138, + 140 + ], + [ + 143, + 145 + ], + [ + 148, + 153 + ], + [ + 155, + 156 + ], + [ + 158, + 161 + ], + [ + 169, + 170 + ], + [ + 172, + 175 + ], + [ + 183, + 185 + ], + [ + 189, + 192 + ], + [ + 193, + 194 + ], + [ + 201, + 209 + ], + [ + 213, + 222 + ], + [ + 228, + 231 + ], + [ + 232, + 233 + ], + [ + 235, + 236 + ], + [ + 239, + 242 + ], + [ + 243, + 244 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ] + ] + } + }, + { + "filename": "test/test_connections.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 47 + ], + [ + 48, + 55 + ], + [ + 62, + 80 + ], + [ + 81, + 105 + ], + [ + 106, + 160 + ] + ], + "lines_added": [ + [ + 12, + 14 + ], + [ + 19, + 20 + ], + [ + 24, + 26 + ], + [ + 27, + 29 + ], + [ + 34, + 36 + ], + [ + 38, + 39 + ], + [ + 42, + 44 + ], + [ + 51, + 52 + ], + [ + 65, + 67 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 75, + 77 + ], + [ + 84, + 85 + ], + [ + 86, + 87 + ], + [ + 90, + 91 + ], + [ + 96, + 97 + ], + [ + 101, + 102 + ], + [ + 109, + 111 + ], + [ + 112, + 114 + ], + [ + 120, + 123 + ], + [ + 125, + 129 + ], + [ + 130, + 135 + ], + [ + 139, + 142 + ], + [ + 144, + 148 + ], + [ + 149, + 152 + ], + [ + 153, + 157 + ], + [ + 158, + 159 + ] + ] + } + }, + { + "filename": "test/test_descriptors.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 36 + ], + [ + 37, + 55 + ], + [ + 56, + 108 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 20, + 22 + ], + [ + 23, + 24 + ], + [ + 26, + 27 + ], + [ + 28, + 29 + ], + [ + 32, + 33 + ], + [ + 40, + 42 + ], + [ + 43, + 45 + ], + [ + 46, + 49 + ], + [ + 51, + 52 + ], + [ + 59, + 69 + ], + [ + 73, + 81 + ], + [ + 85, + 93 + ], + [ + 96, + 100 + ], + [ + 102, + 105 + ], + [ + 106, + 107 + ] + ] + } + }, + { + "filename": "tools/vips.c", + "line_filter": { + "diff_chunks": [ + [ + 51, + 79 + ], + [ + 108, + 535 + ], + [ + 543, + 598 + ], + [ + 599, + 608 + ], + [ + 609, + 631 + ], + [ + 639, + 660 + ], + [ + 663, + 763 + ], + [ + 765, + 786 + ], + [ + 789, + 805 + ], + [ + 809, + 823 + ], + [ + 824, + 853 + ], + [ + 855, + 896 + ] + ], + "lines_added": [ + [ + 54, + 70 + ], + [ + 75, + 76 + ], + [ + 111, + 112 + ], + [ + 113, + 115 + ], + [ + 118, + 124 + ], + [ + 125, + 129 + ], + [ + 130, + 131 + ], + [ + 134, + 135 + ], + [ + 140, + 143 + ], + [ + 144, + 145 + ], + [ + 148, + 150 + ], + [ + 153, + 159 + ], + [ + 160, + 164 + ], + [ + 165, + 166 + ], + [ + 168, + 170 + ], + [ + 172, + 173 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 180, + 186 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 199, + 202 + ], + [ + 205, + 207 + ], + [ + 210, + 212 + ], + [ + 214, + 215 + ], + [ + 218, + 220 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 227, + 231 + ], + [ + 233, + 234 + ], + [ + 235, + 238 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 245, + 246 + ], + [ + 247, + 248 + ], + [ + 250, + 251 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 262 + ], + [ + 265, + 279 + ], + [ + 281, + 283 + ], + [ + 285, + 286 + ], + [ + 289, + 302 + ], + [ + 306, + 307 + ], + [ + 311, + 312 + ], + [ + 316, + 319 + ], + [ + 320, + 321 + ], + [ + 326, + 327 + ], + [ + 331, + 332 + ], + [ + 334, + 336 + ], + [ + 338, + 340 + ], + [ + 342, + 343 + ], + [ + 344, + 347 + ], + [ + 349, + 350 + ], + [ + 353, + 354 + ], + [ + 355, + 358 + ], + [ + 361, + 362 + ], + [ + 363, + 366 + ], + [ + 370, + 371 + ], + [ + 373, + 376 + ], + [ + 377, + 378 + ], + [ + 379, + 385 + ], + [ + 388, + 390 + ], + [ + 391, + 392 + ], + [ + 395, + 396 + ], + [ + 402, + 403 + ], + [ + 406, + 410 + ], + [ + 411, + 412 + ], + [ + 417, + 418 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 427, + 428 + ], + [ + 431, + 434 + ], + [ + 435, + 436 + ], + [ + 440, + 441 + ], + [ + 444, + 445 + ], + [ + 447, + 448 + ], + [ + 454, + 455 + ], + [ + 457, + 458 + ], + [ + 461, + 465 + ], + [ + 468, + 471 + ], + [ + 474, + 479 + ], + [ + 482, + 489 + ], + [ + 493, + 497 + ], + [ + 500, + 503 + ], + [ + 504, + 507 + ], + [ + 508, + 511 + ], + [ + 512, + 515 + ], + [ + 516, + 517 + ], + [ + 518, + 519 + ], + [ + 523, + 524 + ], + [ + 525, + 526 + ], + [ + 531, + 532 + ], + [ + 546, + 547 + ], + [ + 548, + 549 + ], + [ + 552, + 553 + ], + [ + 555, + 556 + ], + [ + 560, + 561 + ], + [ + 563, + 564 + ], + [ + 568, + 571 + ], + [ + 573, + 576 + ], + [ + 578, + 581 + ], + [ + 583, + 586 + ], + [ + 588, + 589 + ], + [ + 594, + 595 + ], + [ + 602, + 605 + ], + [ + 612, + 613 + ], + [ + 616, + 620 + ], + [ + 621, + 622 + ], + [ + 624, + 625 + ], + [ + 627, + 628 + ], + [ + 642, + 644 + ], + [ + 646, + 647 + ], + [ + 648, + 649 + ], + [ + 650, + 652 + ], + [ + 653, + 657 + ], + [ + 666, + 667 + ], + [ + 673, + 674 + ], + [ + 676, + 678 + ], + [ + 684, + 689 + ], + [ + 693, + 694 + ], + [ + 697, + 698 + ], + [ + 700, + 703 + ], + [ + 704, + 705 + ], + [ + 710, + 711 + ], + [ + 713, + 716 + ], + [ + 718, + 721 + ], + [ + 723, + 724 + ], + [ + 729, + 730 + ], + [ + 732, + 733 + ], + [ + 735, + 738 + ], + [ + 740, + 744 + ], + [ + 746, + 749 + ], + [ + 752, + 754 + ], + [ + 758, + 760 + ], + [ + 768, + 769 + ], + [ + 771, + 773 + ], + [ + 774, + 775 + ], + [ + 776, + 778 + ], + [ + 782, + 783 + ], + [ + 792, + 799 + ], + [ + 800, + 802 + ], + [ + 812, + 818 + ], + [ + 819, + 820 + ], + [ + 827, + 829 + ], + [ + 834, + 850 + ], + [ + 858, + 859 + ], + [ + 860, + 861 + ], + [ + 863, + 865 + ], + [ + 871, + 873 + ], + [ + 875, + 878 + ], + [ + 883, + 885 + ], + [ + 886, + 887 + ], + [ + 889, + 890 + ], + [ + 894, + 895 + ] + ] + } + }, + { + "filename": "tools/vipsedit.c", + "line_filter": { + "diff_chunks": [ + [ + 22, + 50 + ], + [ + 84, + 137 + ], + [ + 138, + 159 + ], + [ + 161, + 303 + ] + ], + "lines_added": [ + [ + 25, + 41 + ], + [ + 46, + 47 + ], + [ + 87, + 119 + ], + [ + 123, + 124 + ], + [ + 127, + 130 + ], + [ + 133, + 134 + ], + [ + 141, + 143 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 149, + 151 + ], + [ + 152, + 156 + ], + [ + 164, + 171 + ], + [ + 173, + 176 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 186, + 187 + ], + [ + 189, + 191 + ], + [ + 192, + 195 + ], + [ + 196, + 197 + ], + [ + 199, + 201 + ], + [ + 202, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 213 + ], + [ + 215, + 218 + ], + [ + 219, + 226 + ], + [ + 228, + 231 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 242, + 246 + ], + [ + 249, + 250 + ], + [ + 252, + 255 + ], + [ + 258, + 274 + ], + [ + 277, + 279 + ], + [ + 280, + 281 + ], + [ + 283, + 284 + ], + [ + 286, + 289 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 296, + 297 + ], + [ + 301, + 302 + ] + ] + } + }, + { + "filename": "tools/vipsheader.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 23, + 30 + ], + [ + 44, + 72 + ], + [ + 87, + 174 + ], + [ + 175, + 196 + ], + [ + 198, + 275 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 26, + 27 + ], + [ + 47, + 48 + ], + [ + 49, + 53 + ], + [ + 54, + 63 + ], + [ + 68, + 69 + ], + [ + 90, + 95 + ], + [ + 96, + 98 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 111, + 112 + ], + [ + 115, + 116 + ], + [ + 117, + 120 + ], + [ + 121, + 122 + ], + [ + 123, + 125 + ], + [ + 126, + 127 + ], + [ + 132, + 133 + ], + [ + 134, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 142 + ], + [ + 143, + 145 + ], + [ + 148, + 153 + ], + [ + 155, + 157 + ], + [ + 160, + 164 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 178, + 180 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 186, + 188 + ], + [ + 189, + 193 + ], + [ + 201, + 207 + ], + [ + 209, + 212 + ], + [ + 214, + 217 + ], + [ + 219, + 220 + ], + [ + 222, + 223 + ], + [ + 224, + 226 + ], + [ + 229, + 230 + ], + [ + 232, + 233 + ], + [ + 234, + 236 + ], + [ + 238, + 246 + ], + [ + 248, + 250 + ], + [ + 255, + 257 + ], + [ + 261, + 263 + ], + [ + 268, + 269 + ], + [ + 273, + 274 + ] + ] + } + }, + { + "filename": "tools/vipsthumbnail.c", + "line_filter": { + "diff_chunks": [ + [ + 95, + 102 + ], + [ + 151, + 283 + ], + [ + 285, + 387 + ], + [ + 392, + 399 + ], + [ + 400, + 490 + ], + [ + 491, + 512 + ], + [ + 514, + 569 + ], + [ + 571, + 587 + ] + ], + "lines_added": [ + [ + 98, + 99 + ], + [ + 154, + 223 + ], + [ + 229, + 230 + ], + [ + 232, + 233 + ], + [ + 239, + 240 + ], + [ + 243, + 244 + ], + [ + 246, + 247 + ], + [ + 249, + 251 + ], + [ + 255, + 257 + ], + [ + 260, + 263 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 279, + 280 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ], + [ + 293, + 296 + ], + [ + 300, + 301 + ], + [ + 303, + 306 + ], + [ + 309, + 311 + ], + [ + 313, + 330 + ], + [ + 331, + 332 + ], + [ + 334, + 345 + ], + [ + 348, + 349 + ], + [ + 352, + 354 + ], + [ + 356, + 358 + ], + [ + 359, + 364 + ], + [ + 366, + 367 + ], + [ + 369, + 372 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 383, + 384 + ], + [ + 395, + 396 + ], + [ + 403, + 404 + ], + [ + 405, + 406 + ], + [ + 407, + 409 + ], + [ + 410, + 411 + ], + [ + 414, + 415 + ], + [ + 416, + 417 + ], + [ + 419, + 420 + ], + [ + 423, + 424 + ], + [ + 426, + 427 + ], + [ + 428, + 430 + ], + [ + 431, + 432 + ], + [ + 437, + 438 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 443, + 444 + ], + [ + 445, + 450 + ], + [ + 455, + 456 + ], + [ + 461, + 463 + ], + [ + 464, + 465 + ], + [ + 468, + 469 + ], + [ + 471, + 477 + ], + [ + 478, + 480 + ], + [ + 482, + 483 + ], + [ + 486, + 487 + ], + [ + 494, + 496 + ], + [ + 498, + 499 + ], + [ + 500, + 501 + ], + [ + 502, + 504 + ], + [ + 505, + 509 + ], + [ + 517, + 518 + ], + [ + 519, + 524 + ], + [ + 526, + 529 + ], + [ + 531, + 534 + ], + [ + 536, + 537 + ], + [ + 539, + 540 + ], + [ + 541, + 543 + ], + [ + 544, + 547 + ], + [ + 549, + 553 + ], + [ + 557, + 558 + ], + [ + 560, + 561 + ], + [ + 562, + 566 + ], + [ + 574, + 575 + ], + [ + 580, + 581 + ], + [ + 585, + 586 + ] + ] + } + } +] diff --git a/tests/capture_tools_output/libvips/libvips/expected-result_fe82be-1.json b/tests/capture_tools_output/libvips/libvips/expected-result_fe82be-1.json new file mode 100644 index 0000000..9969e56 --- /dev/null +++ b/tests/capture_tools_output/libvips/libvips/expected-result_fe82be-1.json @@ -0,0 +1,171577 @@ +[ + { + "filename": "cplusplus/include/vips/VConnection8.h", + "line_filter": { + "diff_chunks": [ + [ + 2, + 30 + ], + [ + 36, + 132 + ], + [ + 133, + 141 + ] + ], + "lines_added": [ + [ + 5, + 21 + ], + [ + 26, + 27 + ], + [ + 39, + 40 + ], + [ + 45, + 46 + ], + [ + 50, + 51 + ], + [ + 57, + 59 + ], + [ + 63, + 65 + ], + [ + 69, + 71 + ], + [ + 75, + 77 + ], + [ + 82, + 84 + ], + [ + 86, + 87 + ], + [ + 91, + 92 + ], + [ + 97, + 98 + ], + [ + 103, + 104 + ], + [ + 108, + 109 + ], + [ + 113, + 114 + ], + [ + 116, + 118 + ], + [ + 122, + 123 + ], + [ + 128, + 129 + ], + [ + 136, + 137 + ] + ] + } + }, + { + "filename": "cplusplus/include/vips/VError8.h", + "line_filter": { + "diff_chunks": [ + [ + 2, + 33 + ], + [ + 39, + 46 + ], + [ + 49, + 78 + ] + ], + "lines_added": [ + [ + 5, + 21 + ], + [ + 26, + 27 + ], + [ + 42, + 43 + ], + [ + 52, + 53 + ], + [ + 54, + 55 + ], + [ + 58, + 59 + ], + [ + 65, + 70 + ], + [ + 74, + 75 + ] + ] + } + }, + { + "filename": "cplusplus/include/vips/VImage8.h", + "line_filter": { + "diff_chunks": [ + [ + 2, + 30 + ], + [ + 43, + 54 + ], + [ + 64, + 74 + ], + [ + 76, + 148 + ], + [ + 149, + 164 + ], + [ + 168, + 188 + ], + [ + 218, + 229 + ], + [ + 232, + 249 + ], + [ + 259, + 293 + ], + [ + 295, + 302 + ], + [ + 303, + 310 + ], + [ + 311, + 318 + ], + [ + 319, + 421 + ], + [ + 423, + 516 + ], + [ + 518, + 525 + ], + [ + 527, + 534 + ], + [ + 536, + 574 + ], + [ + 575, + 585 + ], + [ + 586, + 597 + ], + [ + 599, + 608 + ], + [ + 610, + 629 + ], + [ + 630, + 640 + ], + [ + 643, + 749 + ], + [ + 750, + 765 + ], + [ + 768, + 800 + ], + [ + 801, + 810 + ], + [ + 812, + 858 + ], + [ + 860, + 868 + ], + [ + 870, + 879 + ], + [ + 881, + 890 + ], + [ + 891, + 916 + ], + [ + 919, + 983 + ], + [ + 990, + 1012 + ], + [ + 1013, + 1020 + ], + [ + 1028, + 1059 + ], + [ + 1065, + 1078 + ], + [ + 1079, + 1089 + ], + [ + 1091, + 1100 + ], + [ + 1102, + 1262 + ], + [ + 1264, + 1274 + ], + [ + 1276, + 1286 + ], + [ + 1288, + 1883 + ], + [ + 1885, + 6045 + ] + ], + "lines_added": [ + [ + 5, + 21 + ], + [ + 26, + 27 + ], + [ + 46, + 51 + ], + [ + 67, + 68 + ], + [ + 70, + 71 + ], + [ + 79, + 80 + ], + [ + 82, + 84 + ], + [ + 86, + 92 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 109, + 111 + ], + [ + 113, + 116 + ], + [ + 117, + 119 + ], + [ + 122, + 124 + ], + [ + 126, + 129 + ], + [ + 131, + 135 + ], + [ + 137, + 142 + ], + [ + 144, + 145 + ], + [ + 152, + 154 + ], + [ + 156, + 161 + ], + [ + 171, + 173 + ], + [ + 174, + 175 + ], + [ + 180, + 182 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 235, + 236 + ], + [ + 237, + 238 + ], + [ + 240, + 241 + ], + [ + 245, + 246 + ], + [ + 262, + 263 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 275, + 276 + ], + [ + 281, + 282 + ], + [ + 284, + 285 + ], + [ + 289, + 290 + ], + [ + 298, + 299 + ], + [ + 306, + 307 + ], + [ + 314, + 315 + ], + [ + 322, + 323 + ], + [ + 326, + 327 + ], + [ + 331, + 332 + ], + [ + 337, + 338 + ], + [ + 343, + 344 + ], + [ + 349, + 350 + ], + [ + 352, + 353 + ], + [ + 355, + 356 + ], + [ + 361, + 362 + ], + [ + 368, + 369 + ], + [ + 374, + 376 + ], + [ + 381, + 383 + ], + [ + 386, + 387 + ], + [ + 392, + 393 + ], + [ + 397, + 398 + ], + [ + 400, + 401 + ], + [ + 405, + 406 + ], + [ + 407, + 408 + ], + [ + 410, + 411 + ], + [ + 417, + 418 + ], + [ + 426, + 427 + ], + [ + 429, + 430 + ], + [ + 435, + 436 + ], + [ + 438, + 439 + ], + [ + 444, + 445 + ], + [ + 447, + 448 + ], + [ + 453, + 454 + ], + [ + 456, + 457 + ], + [ + 462, + 463 + ], + [ + 465, + 466 + ], + [ + 471, + 472 + ], + [ + 474, + 475 + ], + [ + 481, + 482 + ], + [ + 484, + 485 + ], + [ + 491, + 492 + ], + [ + 494, + 495 + ], + [ + 500, + 501 + ], + [ + 503, + 504 + ], + [ + 509, + 510 + ], + [ + 512, + 513 + ], + [ + 521, + 522 + ], + [ + 530, + 531 + ], + [ + 539, + 540 + ], + [ + 543, + 545 + ], + [ + 549, + 550 + ], + [ + 555, + 556 + ], + [ + 561, + 562 + ], + [ + 567, + 569 + ], + [ + 570, + 571 + ], + [ + 578, + 580 + ], + [ + 581, + 582 + ], + [ + 589, + 591 + ], + [ + 592, + 594 + ], + [ + 602, + 603 + ], + [ + 604, + 605 + ], + [ + 613, + 614 + ], + [ + 615, + 617 + ], + [ + 622, + 624 + ], + [ + 625, + 626 + ], + [ + 633, + 635 + ], + [ + 636, + 637 + ], + [ + 646, + 649 + ], + [ + 650, + 652 + ], + [ + 658, + 660 + ], + [ + 661, + 662 + ], + [ + 665, + 666 + ], + [ + 669, + 671 + ], + [ + 674, + 676 + ], + [ + 677, + 678 + ], + [ + 682, + 683 + ], + [ + 687, + 688 + ], + [ + 689, + 692 + ], + [ + 695, + 696 + ], + [ + 699, + 701 + ], + [ + 705, + 708 + ], + [ + 709, + 710 + ], + [ + 711, + 712 + ], + [ + 716, + 717 + ], + [ + 721, + 722 + ], + [ + 723, + 726 + ], + [ + 729, + 730 + ], + [ + 734, + 735 + ], + [ + 739, + 742 + ], + [ + 743, + 744 + ], + [ + 745, + 746 + ], + [ + 753, + 755 + ], + [ + 758, + 760 + ], + [ + 761, + 762 + ], + [ + 771, + 772 + ], + [ + 773, + 774 + ], + [ + 775, + 777 + ], + [ + 778, + 779 + ], + [ + 782, + 783 + ], + [ + 788, + 789 + ], + [ + 790, + 791 + ], + [ + 792, + 795 + ], + [ + 796, + 797 + ], + [ + 804, + 805 + ], + [ + 806, + 807 + ], + [ + 815, + 816 + ], + [ + 822, + 825 + ], + [ + 829, + 831 + ], + [ + 836, + 837 + ], + [ + 839, + 840 + ], + [ + 846, + 848 + ], + [ + 851, + 853 + ], + [ + 854, + 855 + ], + [ + 863, + 865 + ], + [ + 873, + 876 + ], + [ + 884, + 887 + ], + [ + 894, + 897 + ], + [ + 902, + 905 + ], + [ + 908, + 911 + ], + [ + 912, + 913 + ], + [ + 922, + 925 + ], + [ + 931, + 932 + ], + [ + 937, + 939 + ], + [ + 942, + 945 + ], + [ + 946, + 947 + ], + [ + 953, + 955 + ], + [ + 960, + 962 + ], + [ + 965, + 968 + ], + [ + 969, + 970 + ], + [ + 976, + 978 + ], + [ + 979, + 980 + ], + [ + 993, + 995 + ], + [ + 999, + 1001 + ], + [ + 1002, + 1003 + ], + [ + 1008, + 1009 + ], + [ + 1016, + 1017 + ], + [ + 1031, + 1033 + ], + [ + 1035, + 1036 + ], + [ + 1040, + 1042 + ], + [ + 1047, + 1048 + ], + [ + 1051, + 1054 + ], + [ + 1055, + 1056 + ], + [ + 1068, + 1069 + ], + [ + 1074, + 1075 + ], + [ + 1082, + 1083 + ], + [ + 1084, + 1086 + ], + [ + 1094, + 1095 + ], + [ + 1096, + 1097 + ], + [ + 1105, + 1106 + ], + [ + 1107, + 1108 + ], + [ + 1111, + 1112 + ], + [ + 1113, + 1114 + ], + [ + 1118, + 1119 + ], + [ + 1125, + 1126 + ], + [ + 1127, + 1128 + ], + [ + 1131, + 1132 + ], + [ + 1135, + 1136 + ], + [ + 1137, + 1138 + ], + [ + 1143, + 1145 + ], + [ + 1149, + 1150 + ], + [ + 1154, + 1155 + ], + [ + 1159, + 1161 + ], + [ + 1162, + 1163 + ], + [ + 1168, + 1170 + ], + [ + 1171, + 1172 + ], + [ + 1177, + 1179 + ], + [ + 1180, + 1181 + ], + [ + 1186, + 1188 + ], + [ + 1189, + 1190 + ], + [ + 1195, + 1197 + ], + [ + 1198, + 1199 + ], + [ + 1203, + 1204 + ], + [ + 1206, + 1208 + ], + [ + 1209, + 1211 + ], + [ + 1215, + 1216 + ], + [ + 1218, + 1220 + ], + [ + 1221, + 1223 + ], + [ + 1228, + 1230 + ], + [ + 1231, + 1232 + ], + [ + 1237, + 1239 + ], + [ + 1240, + 1241 + ], + [ + 1246, + 1248 + ], + [ + 1249, + 1250 + ], + [ + 1255, + 1257 + ], + [ + 1258, + 1259 + ], + [ + 1267, + 1269 + ], + [ + 1270, + 1271 + ], + [ + 1279, + 1281 + ], + [ + 1282, + 1283 + ], + [ + 1291, + 1293 + ], + [ + 1294, + 1295 + ], + [ + 1300, + 1302 + ], + [ + 1303, + 1304 + ], + [ + 1309, + 1311 + ], + [ + 1312, + 1313 + ], + [ + 1318, + 1320 + ], + [ + 1321, + 1322 + ], + [ + 1327, + 1329 + ], + [ + 1330, + 1331 + ], + [ + 1336, + 1338 + ], + [ + 1339, + 1340 + ], + [ + 1345, + 1347 + ], + [ + 1348, + 1349 + ], + [ + 1354, + 1356 + ], + [ + 1357, + 1358 + ], + [ + 1363, + 1365 + ], + [ + 1366, + 1367 + ], + [ + 1372, + 1374 + ], + [ + 1375, + 1376 + ], + [ + 1381, + 1383 + ], + [ + 1384, + 1385 + ], + [ + 1390, + 1392 + ], + [ + 1393, + 1394 + ], + [ + 1399, + 1401 + ], + [ + 1402, + 1403 + ], + [ + 1408, + 1410 + ], + [ + 1411, + 1412 + ], + [ + 1417, + 1419 + ], + [ + 1420, + 1421 + ], + [ + 1426, + 1428 + ], + [ + 1429, + 1430 + ], + [ + 1435, + 1437 + ], + [ + 1438, + 1439 + ], + [ + 1444, + 1446 + ], + [ + 1447, + 1448 + ], + [ + 1451, + 1452 + ], + [ + 1453, + 1455 + ], + [ + 1456, + 1457 + ], + [ + 1460, + 1461 + ], + [ + 1462, + 1464 + ], + [ + 1465, + 1466 + ], + [ + 1471, + 1473 + ], + [ + 1474, + 1475 + ], + [ + 1480, + 1482 + ], + [ + 1483, + 1484 + ], + [ + 1489, + 1491 + ], + [ + 1492, + 1493 + ], + [ + 1498, + 1500 + ], + [ + 1501, + 1503 + ], + [ + 1508, + 1510 + ], + [ + 1511, + 1513 + ], + [ + 1518, + 1520 + ], + [ + 1521, + 1522 + ], + [ + 1527, + 1529 + ], + [ + 1530, + 1532 + ], + [ + 1537, + 1539 + ], + [ + 1540, + 1542 + ], + [ + 1543, + 1544 + ], + [ + 1547, + 1549 + ], + [ + 1550, + 1551 + ], + [ + 1556, + 1558 + ], + [ + 1559, + 1561 + ], + [ + 1566, + 1568 + ], + [ + 1569, + 1571 + ], + [ + 1577, + 1580 + ], + [ + 1581, + 1582 + ], + [ + 1588, + 1591 + ], + [ + 1592, + 1593 + ], + [ + 1599, + 1602 + ], + [ + 1603, + 1605 + ], + [ + 1611, + 1613 + ], + [ + 1614, + 1615 + ], + [ + 1621, + 1623 + ], + [ + 1624, + 1625 + ], + [ + 1631, + 1633 + ], + [ + 1634, + 1636 + ], + [ + 1640, + 1880 + ], + [ + 1888, + 1889 + ], + [ + 1892, + 1894 + ], + [ + 1895, + 1901 + ], + [ + 1902, + 1908 + ], + [ + 1909, + 1915 + ], + [ + 1916, + 1922 + ], + [ + 1923, + 1929 + ], + [ + 1930, + 1936 + ], + [ + 1937, + 1943 + ], + [ + 1944, + 1950 + ], + [ + 1951, + 1961 + ], + [ + 1962, + 1968 + ], + [ + 1969, + 1975 + ], + [ + 1976, + 1982 + ], + [ + 1983, + 1989 + ], + [ + 1990, + 1996 + ], + [ + 1997, + 2003 + ], + [ + 2004, + 2014 + ], + [ + 2015, + 2021 + ], + [ + 2022, + 2028 + ], + [ + 2029, + 2035 + ], + [ + 2036, + 2042 + ], + [ + 2043, + 2050 + ], + [ + 2051, + 2070 + ], + [ + 2071, + 2084 + ], + [ + 2085, + 2102 + ], + [ + 2103, + 2109 + ], + [ + 2110, + 2116 + ], + [ + 2117, + 2124 + ], + [ + 2125, + 2135 + ], + [ + 2136, + 2143 + ], + [ + 2144, + 2151 + ], + [ + 2152, + 2158 + ], + [ + 2159, + 2170 + ], + [ + 2171, + 2181 + ], + [ + 2182, + 2194 + ], + [ + 2195, + 2203 + ], + [ + 2204, + 2212 + ], + [ + 2213, + 2219 + ], + [ + 2220, + 2226 + ], + [ + 2227, + 2239 + ], + [ + 2240, + 2251 + ], + [ + 2252, + 2259 + ], + [ + 2260, + 2271 + ], + [ + 2272, + 2283 + ], + [ + 2284, + 2300 + ], + [ + 2301, + 2308 + ], + [ + 2309, + 2317 + ], + [ + 2318, + 2325 + ], + [ + 2326, + 2333 + ], + [ + 2334, + 2349 + ], + [ + 2350, + 2365 + ], + [ + 2366, + 2379 + ], + [ + 2380, + 2392 + ], + [ + 2393, + 2404 + ], + [ + 2405, + 2412 + ], + [ + 2413, + 2420 + ], + [ + 2421, + 2434 + ], + [ + 2435, + 2454 + ], + [ + 2455, + 2462 + ], + [ + 2463, + 2473 + ], + [ + 2474, + 2491 + ], + [ + 2492, + 2509 + ], + [ + 2510, + 2523 + ], + [ + 2524, + 2537 + ], + [ + 2538, + 2545 + ], + [ + 2546, + 2553 + ], + [ + 2554, + 2561 + ], + [ + 2562, + 2568 + ], + [ + 2569, + 2576 + ], + [ + 2577, + 2590 + ], + [ + 2591, + 2604 + ], + [ + 2605, + 2617 + ], + [ + 2618, + 2628 + ], + [ + 2629, + 2638 + ], + [ + 2639, + 2653 + ], + [ + 2654, + 2663 + ], + [ + 2664, + 2690 + ], + [ + 2691, + 2717 + ], + [ + 2718, + 2744 + ], + [ + 2745, + 2760 + ], + [ + 2761, + 2771 + ], + [ + 2772, + 2783 + ], + [ + 2784, + 2797 + ], + [ + 2798, + 2804 + ], + [ + 2805, + 2812 + ], + [ + 2813, + 2819 + ], + [ + 2820, + 2834 + ], + [ + 2835, + 2848 + ], + [ + 2849, + 2862 + ], + [ + 2863, + 2875 + ], + [ + 2876, + 2887 + ], + [ + 2888, + 2895 + ], + [ + 2896, + 2902 + ], + [ + 2903, + 2912 + ], + [ + 2913, + 2920 + ], + [ + 2921, + 2927 + ], + [ + 2928, + 2938 + ], + [ + 2939, + 2951 + ], + [ + 2952, + 2965 + ], + [ + 2966, + 2980 + ], + [ + 2981, + 2989 + ], + [ + 2990, + 3005 + ], + [ + 3006, + 3021 + ], + [ + 3022, + 3037 + ], + [ + 3038, + 3056 + ], + [ + 3057, + 3075 + ], + [ + 3076, + 3094 + ], + [ + 3095, + 3106 + ], + [ + 3107, + 3121 + ], + [ + 3122, + 3134 + ], + [ + 3135, + 3144 + ], + [ + 3145, + 3162 + ], + [ + 3163, + 3180 + ], + [ + 3181, + 3198 + ], + [ + 3199, + 3217 + ], + [ + 3218, + 3236 + ], + [ + 3237, + 3255 + ], + [ + 3256, + 3262 + ], + [ + 3263, + 3269 + ], + [ + 3270, + 3280 + ], + [ + 3281, + 3291 + ], + [ + 3292, + 3303 + ], + [ + 3304, + 3314 + ], + [ + 3315, + 3321 + ], + [ + 3322, + 3334 + ], + [ + 3335, + 3342 + ], + [ + 3343, + 3349 + ], + [ + 3350, + 3356 + ], + [ + 3357, + 3369 + ], + [ + 3370, + 3381 + ], + [ + 3382, + 3396 + ], + [ + 3397, + 3411 + ], + [ + 3412, + 3428 + ], + [ + 3429, + 3441 + ], + [ + 3442, + 3454 + ], + [ + 3455, + 3469 + ], + [ + 3470, + 3476 + ], + [ + 3477, + 3487 + ], + [ + 3488, + 3498 + ], + [ + 3499, + 3514 + ], + [ + 3515, + 3529 + ], + [ + 3530, + 3544 + ], + [ + 3545, + 3559 + ], + [ + 3560, + 3577 + ], + [ + 3578, + 3595 + ], + [ + 3596, + 3613 + ], + [ + 3614, + 3629 + ], + [ + 3630, + 3645 + ], + [ + 3646, + 3661 + ], + [ + 3662, + 3684 + ], + [ + 3685, + 3707 + ], + [ + 3708, + 3729 + ], + [ + 3730, + 3752 + ], + [ + 3753, + 3766 + ], + [ + 3767, + 3780 + ], + [ + 3781, + 3794 + ], + [ + 3795, + 3812 + ], + [ + 3813, + 3830 + ], + [ + 3831, + 3848 + ], + [ + 3849, + 3855 + ], + [ + 3856, + 3868 + ], + [ + 3869, + 3882 + ], + [ + 3883, + 3896 + ], + [ + 3897, + 3913 + ], + [ + 3914, + 3930 + ], + [ + 3931, + 3948 + ], + [ + 3949, + 3966 + ], + [ + 3967, + 3981 + ], + [ + 3982, + 3993 + ], + [ + 3994, + 4012 + ], + [ + 4013, + 4033 + ], + [ + 4034, + 4053 + ], + [ + 4054, + 4070 + ], + [ + 4071, + 4088 + ], + [ + 4089, + 4108 + ], + [ + 4109, + 4127 + ], + [ + 4128, + 4144 + ], + [ + 4145, + 4163 + ], + [ + 4164, + 4181 + ], + [ + 4182, + 4204 + ], + [ + 4205, + 4212 + ], + [ + 4213, + 4221 + ], + [ + 4222, + 4230 + ], + [ + 4231, + 4244 + ], + [ + 4245, + 4251 + ], + [ + 4252, + 4265 + ], + [ + 4266, + 4279 + ], + [ + 4280, + 4291 + ], + [ + 4292, + 4304 + ], + [ + 4305, + 4317 + ], + [ + 4318, + 4328 + ], + [ + 4329, + 4344 + ], + [ + 4345, + 4359 + ], + [ + 4360, + 4370 + ], + [ + 4371, + 4379 + ], + [ + 4380, + 4399 + ], + [ + 4400, + 4435 + ], + [ + 4436, + 4443 + ], + [ + 4444, + 4457 + ], + [ + 4458, + 4471 + ], + [ + 4472, + 4484 + ], + [ + 4485, + 4498 + ], + [ + 4499, + 4516 + ], + [ + 4517, + 4534 + ], + [ + 4535, + 4554 + ], + [ + 4555, + 4574 + ], + [ + 4575, + 4594 + ], + [ + 4595, + 4602 + ], + [ + 4603, + 4617 + ], + [ + 4618, + 4625 + ], + [ + 4626, + 4640 + ], + [ + 4641, + 4655 + ], + [ + 4656, + 4670 + ], + [ + 4671, + 4692 + ], + [ + 4693, + 4714 + ], + [ + 4715, + 4736 + ], + [ + 4737, + 4750 + ], + [ + 4751, + 4764 + ], + [ + 4765, + 4780 + ], + [ + 4781, + 4796 + ], + [ + 4797, + 4807 + ], + [ + 4808, + 4815 + ], + [ + 4816, + 4823 + ], + [ + 4824, + 4831 + ], + [ + 4832, + 4843 + ], + [ + 4844, + 4850 + ], + [ + 4851, + 4864 + ], + [ + 4865, + 4878 + ], + [ + 4879, + 4892 + ], + [ + 4893, + 4905 + ], + [ + 4906, + 4918 + ], + [ + 4919, + 4931 + ], + [ + 4932, + 4941 + ], + [ + 4942, + 4961 + ], + [ + 4962, + 4974 + ], + [ + 4975, + 4987 + ], + [ + 4988, + 4995 + ], + [ + 4996, + 5009 + ], + [ + 5010, + 5022 + ], + [ + 5023, + 5035 + ], + [ + 5036, + 5044 + ], + [ + 5045, + 5053 + ], + [ + 5054, + 5061 + ], + [ + 5062, + 5069 + ], + [ + 5070, + 5078 + ], + [ + 5079, + 5092 + ], + [ + 5093, + 5100 + ], + [ + 5101, + 5111 + ], + [ + 5112, + 5128 + ], + [ + 5129, + 5136 + ], + [ + 5137, + 5143 + ], + [ + 5144, + 5150 + ], + [ + 5151, + 5161 + ], + [ + 5162, + 5168 + ], + [ + 5169, + 5179 + ], + [ + 5180, + 5191 + ], + [ + 5192, + 5202 + ], + [ + 5203, + 5218 + ], + [ + 5219, + 5231 + ], + [ + 5232, + 5243 + ], + [ + 5244, + 5255 + ], + [ + 5256, + 5262 + ], + [ + 5263, + 5280 + ], + [ + 5281, + 5295 + ], + [ + 5296, + 5308 + ], + [ + 5309, + 5315 + ], + [ + 5316, + 5323 + ], + [ + 5324, + 5330 + ], + [ + 5331, + 5337 + ], + [ + 5338, + 5353 + ], + [ + 5354, + 5366 + ], + [ + 5367, + 5374 + ], + [ + 5375, + 5382 + ], + [ + 5383, + 5399 + ], + [ + 5400, + 5416 + ], + [ + 5417, + 5433 + ], + [ + 5434, + 5441 + ], + [ + 5442, + 5454 + ], + [ + 5455, + 5474 + ], + [ + 5475, + 5495 + ], + [ + 5496, + 5517 + ], + [ + 5518, + 5537 + ], + [ + 5538, + 5559 + ], + [ + 5560, + 5577 + ], + [ + 5578, + 5595 + ], + [ + 5596, + 5613 + ], + [ + 5614, + 5647 + ], + [ + 5648, + 5681 + ], + [ + 5682, + 5715 + ], + [ + 5716, + 5731 + ], + [ + 5732, + 5751 + ], + [ + 5752, + 5762 + ], + [ + 5763, + 5774 + ], + [ + 5775, + 5788 + ], + [ + 5789, + 5802 + ], + [ + 5803, + 5815 + ], + [ + 5816, + 5828 + ], + [ + 5829, + 5845 + ], + [ + 5846, + 5862 + ], + [ + 5863, + 5879 + ], + [ + 5880, + 5904 + ], + [ + 5905, + 5929 + ], + [ + 5930, + 5954 + ], + [ + 5955, + 5979 + ], + [ + 5980, + 5993 + ], + [ + 5994, + 6005 + ], + [ + 6006, + 6020 + ], + [ + 6021, + 6042 + ] + ] + } + }, + { + "filename": "cplusplus/include/vips/VInterpolate8.h", + "line_filter": { + "diff_chunks": [ + [ + 2, + 30 + ], + [ + 34, + 63 + ], + [ + 64, + 72 + ] + ], + "lines_added": [ + [ + 5, + 21 + ], + [ + 26, + 27 + ], + [ + 37, + 38 + ], + [ + 42, + 43 + ], + [ + 45, + 46 + ], + [ + 52, + 53 + ], + [ + 59, + 60 + ], + [ + 67, + 68 + ] + ] + } + }, + { + "filename": "cplusplus/include/vips/VRegion8.h", + "line_filter": { + "diff_chunks": [ + [ + 2, + 30 + ], + [ + 37, + 51 + ], + [ + 52, + 59 + ], + [ + 67, + 76 + ], + [ + 77, + 88 + ], + [ + 99, + 124 + ], + [ + 126, + 151 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 7, + 11 + ], + [ + 12, + 16 + ], + [ + 17, + 21 + ], + [ + 26, + 27 + ], + [ + 40, + 41 + ], + [ + 47, + 48 + ], + [ + 55, + 56 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 80, + 81 + ], + [ + 84, + 85 + ], + [ + 102, + 103 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 129, + 130 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ] + ] + } + }, + { + "filename": "examples/annotate-animated.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 28 + ], + [ + 32, + 106 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 17, + 18 + ], + [ + 20, + 21 + ], + [ + 22, + 23 + ], + [ + 24, + 25 + ], + [ + 35, + 39 + ], + [ + 42, + 47 + ], + [ + 49, + 51 + ], + [ + 54, + 58 + ], + [ + 61, + 65 + ], + [ + 66, + 67 + ], + [ + 69, + 71 + ], + [ + 76, + 78 + ], + [ + 79, + 81 + ], + [ + 82, + 86 + ], + [ + 87, + 92 + ], + [ + 93, + 95 + ], + [ + 97, + 100 + ], + [ + 102, + 103 + ], + [ + 104, + 105 + ] + ] + } + }, + { + "filename": "examples/new-from-buffer.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 8, + 55 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 11, + 13 + ], + [ + 18, + 20 + ], + [ + 21, + 23 + ], + [ + 24, + 26 + ], + [ + 27, + 28 + ], + [ + 32, + 33 + ], + [ + 34, + 38 + ], + [ + 39, + 44 + ], + [ + 45, + 47 + ], + [ + 49, + 50 + ], + [ + 53, + 54 + ] + ] + } + }, + { + "filename": "examples/progress-cancel.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 78 + ] + ], + "lines_added": [ + [ + 12, + 14 + ], + [ + 15, + 16 + ], + [ + 18, + 20 + ], + [ + 21, + 22 + ], + [ + 23, + 26 + ], + [ + 29, + 31 + ], + [ + 32, + 34 + ], + [ + 36, + 38 + ], + [ + 44, + 46 + ], + [ + 47, + 49 + ], + [ + 50, + 54 + ], + [ + 55, + 57 + ], + [ + 58, + 65 + ], + [ + 67, + 70 + ], + [ + 71, + 75 + ] + ] + } + }, + { + "filename": "examples/use-vips-func.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 44 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 14 + ], + [ + 15, + 17 + ], + [ + 18, + 20 + ], + [ + 21, + 23 + ], + [ + 24, + 25 + ], + [ + 26, + 28 + ], + [ + 29, + 30 + ], + [ + 31, + 34 + ], + [ + 35, + 36 + ], + [ + 37, + 39 + ], + [ + 40, + 43 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/abs.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 26, + 61 + ], + [ + 78, + 245 + ], + [ + 267, + 317 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 29, + 30 + ], + [ + 36, + 37 + ], + [ + 38, + 42 + ], + [ + 43, + 47 + ], + [ + 48, + 52 + ], + [ + 57, + 58 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 95 + ], + [ + 96, + 98 + ], + [ + 99, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 105 + ], + [ + 108, + 109 + ], + [ + 114, + 115 + ], + [ + 116, + 119 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 128, + 137 + ], + [ + 140, + 149 + ], + [ + 155, + 166 + ], + [ + 169, + 193 + ], + [ + 194, + 195 + ], + [ + 199, + 201 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 209, + 211 + ], + [ + 213, + 216 + ], + [ + 217, + 218 + ], + [ + 220, + 242 + ], + [ + 270, + 271 + ], + [ + 273, + 274 + ], + [ + 276, + 277 + ], + [ + 281, + 282 + ], + [ + 285, + 286 + ], + [ + 289, + 290 + ], + [ + 295, + 300 + ], + [ + 306, + 307 + ], + [ + 311, + 314 + ], + [ + 315, + 316 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/add.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 42, + 70 + ], + [ + 87, + 149 + ], + [ + 171, + 215 + ], + [ + 276, + 290 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 45, + 46 + ], + [ + 47, + 51 + ], + [ + 52, + 56 + ], + [ + 57, + 61 + ], + [ + 66, + 67 + ], + [ + 90, + 91 + ], + [ + 92, + 101 + ], + [ + 103, + 104 + ], + [ + 109, + 111 + ], + [ + 114, + 115 + ], + [ + 117, + 146 + ], + [ + 174, + 175 + ], + [ + 177, + 178 + ], + [ + 180, + 181 + ], + [ + 184, + 185 + ], + [ + 188, + 189 + ], + [ + 194, + 196 + ], + [ + 199, + 200 + ], + [ + 204, + 206 + ], + [ + 209, + 212 + ], + [ + 279, + 280 + ], + [ + 284, + 287 + ], + [ + 288, + 289 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/arithmetic.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 55, + 62 + ], + [ + 63, + 88 + ], + [ + 97, + 106 + ], + [ + 255, + 269 + ], + [ + 281, + 429 + ], + [ + 431, + 469 + ], + [ + 470, + 488 + ], + [ + 489, + 507 + ], + [ + 508, + 521 + ], + [ + 533, + 560 + ], + [ + 561, + 569 + ], + [ + 570, + 651 + ], + [ + 653, + 775 + ], + [ + 778, + 830 + ], + [ + 831, + 877 + ], + [ + 887, + 914 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 31 + ], + [ + 36, + 37 + ], + [ + 58, + 59 + ], + [ + 66, + 68 + ], + [ + 70, + 72 + ], + [ + 75, + 77 + ], + [ + 82, + 85 + ], + [ + 100, + 103 + ], + [ + 258, + 262 + ], + [ + 265, + 266 + ], + [ + 284, + 291 + ], + [ + 296, + 297 + ], + [ + 298, + 303 + ], + [ + 304, + 305 + ], + [ + 306, + 311 + ], + [ + 312, + 313 + ], + [ + 314, + 316 + ], + [ + 319, + 320 + ], + [ + 324, + 325 + ], + [ + 327, + 329 + ], + [ + 330, + 332 + ], + [ + 336, + 337 + ], + [ + 339, + 341 + ], + [ + 343, + 344 + ], + [ + 347, + 348 + ], + [ + 353, + 354 + ], + [ + 357, + 360 + ], + [ + 362, + 365 + ], + [ + 369, + 370 + ], + [ + 372, + 375 + ], + [ + 377, + 378 + ], + [ + 383, + 384 + ], + [ + 389, + 394 + ], + [ + 395, + 399 + ], + [ + 401, + 404 + ], + [ + 405, + 407 + ], + [ + 408, + 409 + ], + [ + 411, + 412 + ], + [ + 418, + 420 + ], + [ + 425, + 426 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 444, + 447 + ], + [ + 450, + 451 + ], + [ + 453, + 455 + ], + [ + 456, + 457 + ], + [ + 460, + 461 + ], + [ + 464, + 466 + ], + [ + 473, + 475 + ], + [ + 479, + 480 + ], + [ + 483, + 485 + ], + [ + 492, + 494 + ], + [ + 498, + 499 + ], + [ + 502, + 504 + ], + [ + 511, + 513 + ], + [ + 517, + 518 + ], + [ + 536, + 537 + ], + [ + 540, + 541 + ], + [ + 543, + 546 + ], + [ + 548, + 549 + ], + [ + 550, + 551 + ], + [ + 552, + 553 + ], + [ + 556, + 557 + ], + [ + 564, + 566 + ], + [ + 573, + 574 + ], + [ + 578, + 581 + ], + [ + 585, + 589 + ], + [ + 594, + 597 + ], + [ + 599, + 600 + ], + [ + 603, + 605 + ], + [ + 608, + 611 + ], + [ + 617, + 622 + ], + [ + 623, + 624 + ], + [ + 625, + 626 + ], + [ + 627, + 629 + ], + [ + 630, + 633 + ], + [ + 635, + 636 + ], + [ + 637, + 638 + ], + [ + 639, + 640 + ], + [ + 643, + 644 + ], + [ + 645, + 648 + ], + [ + 656, + 659 + ], + [ + 661, + 663 + ], + [ + 664, + 665 + ], + [ + 666, + 674 + ], + [ + 677, + 680 + ], + [ + 683, + 688 + ], + [ + 693, + 696 + ], + [ + 698, + 699 + ], + [ + 701, + 702 + ], + [ + 704, + 710 + ], + [ + 711, + 712 + ], + [ + 715, + 716 + ], + [ + 717, + 720 + ], + [ + 725, + 726 + ], + [ + 730, + 735 + ], + [ + 738, + 739 + ], + [ + 744, + 747 + ], + [ + 748, + 749 + ], + [ + 753, + 755 + ], + [ + 758, + 759 + ], + [ + 760, + 763 + ], + [ + 766, + 767 + ], + [ + 768, + 772 + ], + [ + 781, + 782 + ], + [ + 783, + 785 + ], + [ + 788, + 789 + ], + [ + 794, + 795 + ], + [ + 796, + 797 + ], + [ + 798, + 801 + ], + [ + 802, + 803 + ], + [ + 806, + 807 + ], + [ + 810, + 811 + ], + [ + 812, + 815 + ], + [ + 821, + 827 + ], + [ + 834, + 835 + ], + [ + 836, + 874 + ], + [ + 890, + 897 + ], + [ + 901, + 902 + ], + [ + 903, + 913 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/avg.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 18, + 25 + ], + [ + 38, + 66 + ], + [ + 86, + 169 + ], + [ + 171, + 259 + ], + [ + 260, + 274 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 21, + 22 + ], + [ + 41, + 42 + ], + [ + 43, + 47 + ], + [ + 48, + 57 + ], + [ + 62, + 63 + ], + [ + 89, + 90 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 100, + 102 + ], + [ + 103, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 111 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 125, + 126 + ], + [ + 132, + 133 + ], + [ + 134, + 135 + ], + [ + 139, + 146 + ], + [ + 147, + 158 + ], + [ + 162, + 164 + ], + [ + 165, + 166 + ], + [ + 174, + 175 + ], + [ + 176, + 209 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 228, + 229 + ], + [ + 235, + 238 + ], + [ + 239, + 241 + ], + [ + 244, + 245 + ], + [ + 254, + 256 + ], + [ + 263, + 264 + ], + [ + 268, + 271 + ], + [ + 272, + 273 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/binary.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 52, + 113 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 29 + ], + [ + 34, + 35 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 60, + 62 + ], + [ + 64, + 65 + ], + [ + 68, + 72 + ], + [ + 73, + 75 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 82, + 84 + ], + [ + 89, + 90 + ], + [ + 95, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 104 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/binary.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 40, + 56 + ], + [ + 63, + 73 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 43, + 53 + ], + [ + 66, + 67 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/boolean.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 22, + 29 + ], + [ + 35, + 63 + ], + [ + 87, + 234 + ], + [ + 248, + 255 + ], + [ + 256, + 299 + ], + [ + 303, + 310 + ], + [ + 312, + 325 + ], + [ + 326, + 343 + ], + [ + 352, + 369 + ], + [ + 378, + 395 + ], + [ + 404, + 421 + ], + [ + 430, + 447 + ], + [ + 456, + 473 + ], + [ + 477, + 527 + ], + [ + 529, + 554 + ], + [ + 556, + 614 + ], + [ + 622, + 633 + ], + [ + 636, + 653 + ], + [ + 665, + 683 + ], + [ + 695, + 713 + ], + [ + 725, + 743 + ], + [ + 755, + 772 + ], + [ + 784, + 801 + ], + [ + 802, + 809 + ], + [ + 813, + 837 + ], + [ + 841, + 865 + ], + [ + 869, + 893 + ], + [ + 897, + 921 + ], + [ + 925, + 949 + ], + [ + 953, + 968 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 25, + 26 + ], + [ + 38, + 39 + ], + [ + 40, + 44 + ], + [ + 45, + 49 + ], + [ + 50, + 54 + ], + [ + 59, + 60 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 104 + ], + [ + 105, + 107 + ], + [ + 108, + 109 + ], + [ + 111, + 120 + ], + [ + 121, + 130 + ], + [ + 131, + 158 + ], + [ + 160, + 171 + ], + [ + 173, + 175 + ], + [ + 178, + 179 + ], + [ + 182, + 185 + ], + [ + 187, + 189 + ], + [ + 191, + 193 + ], + [ + 197, + 202 + ], + [ + 203, + 205 + ], + [ + 206, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 214 + ], + [ + 215, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 227 + ], + [ + 229, + 231 + ], + [ + 251, + 252 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 269, + 270 + ], + [ + 274, + 275 + ], + [ + 276, + 279 + ], + [ + 280, + 283 + ], + [ + 286, + 287 + ], + [ + 291, + 293 + ], + [ + 294, + 296 + ], + [ + 306, + 307 + ], + [ + 315, + 317 + ], + [ + 320, + 322 + ], + [ + 329, + 331 + ], + [ + 335, + 338 + ], + [ + 339, + 340 + ], + [ + 355, + 356 + ], + [ + 360, + 364 + ], + [ + 365, + 366 + ], + [ + 381, + 382 + ], + [ + 386, + 390 + ], + [ + 391, + 392 + ], + [ + 407, + 408 + ], + [ + 412, + 416 + ], + [ + 417, + 418 + ], + [ + 433, + 434 + ], + [ + 438, + 442 + ], + [ + 443, + 444 + ], + [ + 459, + 460 + ], + [ + 464, + 468 + ], + [ + 469, + 470 + ], + [ + 480, + 482 + ], + [ + 484, + 485 + ], + [ + 486, + 487 + ], + [ + 489, + 492 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 499, + 509 + ], + [ + 510, + 520 + ], + [ + 522, + 524 + ], + [ + 532, + 535 + ], + [ + 537, + 539 + ], + [ + 541, + 543 + ], + [ + 545, + 547 + ], + [ + 549, + 551 + ], + [ + 559, + 560 + ], + [ + 561, + 562 + ], + [ + 563, + 564 + ], + [ + 569, + 571 + ], + [ + 575, + 576 + ], + [ + 577, + 580 + ], + [ + 581, + 584 + ], + [ + 587, + 588 + ], + [ + 592, + 594 + ], + [ + 596, + 597 + ], + [ + 600, + 601 + ], + [ + 602, + 603 + ], + [ + 605, + 607 + ], + [ + 608, + 609 + ], + [ + 610, + 611 + ], + [ + 625, + 626 + ], + [ + 627, + 630 + ], + [ + 639, + 641 + ], + [ + 645, + 648 + ], + [ + 649, + 650 + ], + [ + 668, + 670 + ], + [ + 674, + 678 + ], + [ + 679, + 680 + ], + [ + 698, + 700 + ], + [ + 704, + 708 + ], + [ + 709, + 710 + ], + [ + 728, + 730 + ], + [ + 734, + 738 + ], + [ + 739, + 740 + ], + [ + 758, + 759 + ], + [ + 763, + 767 + ], + [ + 768, + 769 + ], + [ + 787, + 788 + ], + [ + 792, + 796 + ], + [ + 797, + 798 + ], + [ + 805, + 806 + ], + [ + 816, + 818 + ], + [ + 822, + 825 + ], + [ + 826, + 827 + ], + [ + 833, + 834 + ], + [ + 844, + 845 + ], + [ + 849, + 853 + ], + [ + 854, + 855 + ], + [ + 861, + 862 + ], + [ + 872, + 873 + ], + [ + 877, + 881 + ], + [ + 882, + 883 + ], + [ + 889, + 890 + ], + [ + 900, + 901 + ], + [ + 905, + 909 + ], + [ + 910, + 911 + ], + [ + 917, + 918 + ], + [ + 928, + 929 + ], + [ + 933, + 937 + ], + [ + 938, + 939 + ], + [ + 945, + 946 + ], + [ + 956, + 957 + ], + [ + 961, + 965 + ], + [ + 966, + 967 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/complex.c", + "line_filter": { + "diff_chunks": [ + [ + 27, + 55 + ], + [ + 79, + 167 + ], + [ + 168, + 241 + ], + [ + 260, + 301 + ], + [ + 306, + 328 + ], + [ + 335, + 351 + ], + [ + 358, + 374 + ], + [ + 381, + 397 + ], + [ + 402, + 547 + ], + [ + 567, + 609 + ], + [ + 615, + 638 + ], + [ + 641, + 664 + ], + [ + 669, + 780 + ], + [ + 799, + 842 + ], + [ + 845, + 871 + ], + [ + 878, + 895 + ], + [ + 902, + 1000 + ], + [ + 1009, + 1016 + ], + [ + 1018, + 1059 + ], + [ + 1061, + 1075 + ] + ], + "lines_added": [ + [ + 30, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 46 + ], + [ + 51, + 52 + ], + [ + 82, + 95 + ], + [ + 96, + 108 + ], + [ + 109, + 111 + ], + [ + 112, + 114 + ], + [ + 115, + 117 + ], + [ + 118, + 120 + ], + [ + 121, + 123 + ], + [ + 124, + 126 + ], + [ + 127, + 129 + ], + [ + 130, + 132 + ], + [ + 133, + 135 + ], + [ + 136, + 138 + ], + [ + 139, + 142 + ], + [ + 144, + 145 + ], + [ + 147, + 148 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 159, + 160 + ], + [ + 163, + 164 + ], + [ + 171, + 173 + ], + [ + 175, + 177 + ], + [ + 178, + 179 + ], + [ + 181, + 193 + ], + [ + 194, + 217 + ], + [ + 219, + 221 + ], + [ + 224, + 225 + ], + [ + 228, + 238 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 273, + 275 + ], + [ + 278, + 279 + ], + [ + 280, + 283 + ], + [ + 284, + 286 + ], + [ + 289, + 290 + ], + [ + 294, + 296 + ], + [ + 297, + 298 + ], + [ + 309, + 311 + ], + [ + 315, + 316 + ], + [ + 320, + 323 + ], + [ + 324, + 325 + ], + [ + 338, + 339 + ], + [ + 343, + 346 + ], + [ + 347, + 348 + ], + [ + 361, + 362 + ], + [ + 366, + 369 + ], + [ + 370, + 371 + ], + [ + 384, + 385 + ], + [ + 389, + 392 + ], + [ + 393, + 394 + ], + [ + 405, + 419 + ], + [ + 420, + 434 + ], + [ + 435, + 437 + ], + [ + 438, + 440 + ], + [ + 441, + 443 + ], + [ + 444, + 446 + ], + [ + 447, + 449 + ], + [ + 450, + 452 + ], + [ + 453, + 455 + ], + [ + 456, + 458 + ], + [ + 459, + 461 + ], + [ + 462, + 464 + ], + [ + 465, + 468 + ], + [ + 470, + 471 + ], + [ + 472, + 474 + ], + [ + 476, + 477 + ], + [ + 483, + 497 + ], + [ + 500, + 528 + ], + [ + 532, + 534 + ], + [ + 537, + 538 + ], + [ + 541, + 544 + ], + [ + 570, + 571 + ], + [ + 572, + 573 + ], + [ + 574, + 575 + ], + [ + 580, + 582 + ], + [ + 585, + 586 + ], + [ + 587, + 590 + ], + [ + 591, + 594 + ], + [ + 597, + 598 + ], + [ + 602, + 604 + ], + [ + 605, + 606 + ], + [ + 618, + 620 + ], + [ + 624, + 626 + ], + [ + 630, + 633 + ], + [ + 634, + 635 + ], + [ + 644, + 645 + ], + [ + 650, + 651 + ], + [ + 655, + 659 + ], + [ + 660, + 661 + ], + [ + 672, + 673 + ], + [ + 675, + 676 + ], + [ + 680, + 684 + ], + [ + 685, + 687 + ], + [ + 688, + 689 + ], + [ + 691, + 700 + ], + [ + 701, + 712 + ], + [ + 713, + 715 + ], + [ + 716, + 718 + ], + [ + 719, + 721 + ], + [ + 722, + 724 + ], + [ + 725, + 727 + ], + [ + 728, + 730 + ], + [ + 731, + 733 + ], + [ + 734, + 736 + ], + [ + 737, + 739 + ], + [ + 740, + 742 + ], + [ + 743, + 746 + ], + [ + 748, + 749 + ], + [ + 750, + 754 + ], + [ + 755, + 759 + ], + [ + 761, + 763 + ], + [ + 766, + 767 + ], + [ + 770, + 777 + ], + [ + 802, + 803 + ], + [ + 804, + 805 + ], + [ + 806, + 807 + ], + [ + 812, + 813 + ], + [ + 817, + 819 + ], + [ + 820, + 823 + ], + [ + 824, + 827 + ], + [ + 830, + 831 + ], + [ + 835, + 837 + ], + [ + 838, + 839 + ], + [ + 848, + 849 + ], + [ + 851, + 852 + ], + [ + 857, + 859 + ], + [ + 863, + 866 + ], + [ + 867, + 868 + ], + [ + 881, + 882 + ], + [ + 886, + 890 + ], + [ + 891, + 892 + ], + [ + 905, + 906 + ], + [ + 910, + 914 + ], + [ + 915, + 916 + ], + [ + 921, + 922 + ], + [ + 924, + 925 + ], + [ + 926, + 927 + ], + [ + 929, + 935 + ], + [ + 936, + 938 + ], + [ + 939, + 940 + ], + [ + 942, + 955 + ], + [ + 957, + 959 + ], + [ + 961, + 962 + ], + [ + 965, + 966 + ], + [ + 967, + 995 + ], + [ + 996, + 997 + ], + [ + 1012, + 1013 + ], + [ + 1021, + 1022 + ], + [ + 1024, + 1025 + ], + [ + 1027, + 1029 + ], + [ + 1033, + 1035 + ], + [ + 1038, + 1039 + ], + [ + 1044, + 1046 + ], + [ + 1049, + 1052 + ], + [ + 1054, + 1056 + ], + [ + 1064, + 1065 + ], + [ + 1069, + 1072 + ], + [ + 1073, + 1074 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/deviate.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 19, + 26 + ], + [ + 35, + 63 + ], + [ + 84, + 146 + ], + [ + 147, + 175 + ], + [ + 178, + 250 + ], + [ + 253, + 262 + ], + [ + 264, + 278 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 22, + 23 + ], + [ + 38, + 39 + ], + [ + 40, + 44 + ], + [ + 45, + 54 + ], + [ + 59, + 60 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 92, + 94 + ], + [ + 99, + 102 + ], + [ + 103, + 105 + ], + [ + 107, + 110 + ], + [ + 116, + 120 + ], + [ + 123, + 126 + ], + [ + 127, + 128 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 142, + 143 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 155, + 166 + ], + [ + 168, + 170 + ], + [ + 171, + 172 + ], + [ + 181, + 182 + ], + [ + 183, + 210 + ], + [ + 216, + 217 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 230, + 231 + ], + [ + 237, + 240 + ], + [ + 241, + 243 + ], + [ + 246, + 247 + ], + [ + 256, + 259 + ], + [ + 267, + 268 + ], + [ + 272, + 275 + ], + [ + 276, + 277 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/divide.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 25, + 34 + ], + [ + 37, + 65 + ], + [ + 82, + 221 + ], + [ + 230, + 237 + ], + [ + 239, + 267 + ], + [ + 270, + 284 + ], + [ + 342, + 356 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 28, + 29 + ], + [ + 30, + 31 + ], + [ + 40, + 41 + ], + [ + 42, + 46 + ], + [ + 47, + 51 + ], + [ + 52, + 56 + ], + [ + 61, + 62 + ], + [ + 85, + 86 + ], + [ + 92, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 154 + ], + [ + 155, + 156 + ], + [ + 161, + 170 + ], + [ + 172, + 174 + ], + [ + 176, + 177 + ], + [ + 180, + 181 + ], + [ + 182, + 216 + ], + [ + 217, + 218 + ], + [ + 233, + 234 + ], + [ + 242, + 243 + ], + [ + 245, + 246 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 256, + 257 + ], + [ + 262, + 264 + ], + [ + 273, + 275 + ], + [ + 278, + 281 + ], + [ + 345, + 346 + ], + [ + 350, + 353 + ], + [ + 354, + 355 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/find_trim.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 37 + ], + [ + 64, + 77 + ], + [ + 83, + 172 + ], + [ + 174, + 239 + ], + [ + 249, + 258 + ], + [ + 261, + 290 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 28 + ], + [ + 33, + 34 + ], + [ + 67, + 68 + ], + [ + 70, + 71 + ], + [ + 73, + 74 + ], + [ + 86, + 88 + ], + [ + 89, + 90 + ], + [ + 92, + 98 + ], + [ + 100, + 101 + ], + [ + 103, + 108 + ], + [ + 113, + 118 + ], + [ + 124, + 130 + ], + [ + 132, + 133 + ], + [ + 134, + 136 + ], + [ + 139, + 146 + ], + [ + 149, + 158 + ], + [ + 160, + 163 + ], + [ + 164, + 165 + ], + [ + 168, + 169 + ], + [ + 177, + 178 + ], + [ + 180, + 181 + ], + [ + 182, + 185 + ], + [ + 186, + 187 + ], + [ + 188, + 191 + ], + [ + 192, + 194 + ], + [ + 195, + 198 + ], + [ + 199, + 201 + ], + [ + 202, + 205 + ], + [ + 206, + 208 + ], + [ + 209, + 212 + ], + [ + 213, + 215 + ], + [ + 216, + 219 + ], + [ + 220, + 222 + ], + [ + 223, + 226 + ], + [ + 227, + 229 + ], + [ + 232, + 233 + ], + [ + 235, + 236 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ], + [ + 264, + 265 + ], + [ + 268, + 269 + ], + [ + 270, + 271 + ], + [ + 277, + 279 + ], + [ + 283, + 287 + ], + [ + 288, + 289 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/getpoint.c", + "line_filter": { + "diff_chunks": [ + [ + 27, + 55 + ], + [ + 83, + 133 + ], + [ + 135, + 174 + ], + [ + 180, + 187 + ], + [ + 191, + 220 + ] + ], + "lines_added": [ + [ + 30, + 46 + ], + [ + 51, + 52 + ], + [ + 86, + 87 + ], + [ + 89, + 90 + ], + [ + 92, + 93 + ], + [ + 97, + 99 + ], + [ + 102, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 114 + ], + [ + 115, + 118 + ], + [ + 119, + 121 + ], + [ + 122, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 138, + 139 + ], + [ + 141, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 153 + ], + [ + 154, + 157 + ], + [ + 158, + 160 + ], + [ + 161, + 164 + ], + [ + 165, + 167 + ], + [ + 170, + 171 + ], + [ + 183, + 184 + ], + [ + 194, + 195 + ], + [ + 201, + 204 + ], + [ + 205, + 207 + ], + [ + 208, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hist_find.c", + "line_filter": { + "diff_chunks": [ + [ + 32, + 60 + ], + [ + 71, + 82 + ], + [ + 91, + 98 + ], + [ + 102, + 131 + ], + [ + 132, + 389 + ], + [ + 391, + 398 + ], + [ + 407, + 424 + ], + [ + 425, + 447 + ], + [ + 456, + 464 + ], + [ + 467, + 481 + ] + ], + "lines_added": [ + [ + 35, + 51 + ], + [ + 56, + 57 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 94, + 95 + ], + [ + 105, + 106 + ], + [ + 110, + 111 + ], + [ + 114, + 115 + ], + [ + 119, + 122 + ], + [ + 123, + 128 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 141, + 143 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 152, + 155 + ], + [ + 159, + 162 + ], + [ + 167, + 169 + ], + [ + 172, + 179 + ], + [ + 182, + 202 + ], + [ + 203, + 204 + ], + [ + 205, + 207 + ], + [ + 208, + 209 + ], + [ + 214, + 215 + ], + [ + 220, + 230 + ], + [ + 235, + 236 + ], + [ + 239, + 240 + ], + [ + 243, + 245 + ], + [ + 248, + 264 + ], + [ + 265, + 267 + ], + [ + 270, + 271 + ], + [ + 273, + 274 + ], + [ + 276, + 289 + ], + [ + 290, + 291 + ], + [ + 294, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 320 + ], + [ + 323, + 338 + ], + [ + 339, + 340 + ], + [ + 342, + 344 + ], + [ + 347, + 348 + ], + [ + 352, + 354 + ], + [ + 355, + 357 + ], + [ + 358, + 359 + ], + [ + 363, + 365 + ], + [ + 366, + 367 + ], + [ + 372, + 374 + ], + [ + 375, + 377 + ], + [ + 378, + 379 + ], + [ + 382, + 384 + ], + [ + 385, + 386 + ], + [ + 394, + 395 + ], + [ + 410, + 411 + ], + [ + 414, + 415 + ], + [ + 420, + 421 + ], + [ + 428, + 440 + ], + [ + 443, + 444 + ], + [ + 459, + 461 + ], + [ + 470, + 471 + ], + [ + 475, + 478 + ], + [ + 479, + 480 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hist_find_indexed.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 57, + 69 + ], + [ + 72, + 79 + ], + [ + 80, + 89 + ], + [ + 90, + 125 + ], + [ + 134, + 243 + ], + [ + 244, + 264 + ], + [ + 267, + 337 + ], + [ + 343, + 381 + ], + [ + 382, + 413 + ], + [ + 417, + 491 + ], + [ + 504, + 519 + ], + [ + 522, + 536 + ] + ], + "lines_added": [ + [ + 15, + 31 + ], + [ + 36, + 37 + ], + [ + 60, + 61 + ], + [ + 62, + 66 + ], + [ + 75, + 76 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 93, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 101 + ], + [ + 103, + 105 + ], + [ + 108, + 109 + ], + [ + 113, + 117 + ], + [ + 118, + 120 + ], + [ + 121, + 122 + ], + [ + 137, + 138 + ], + [ + 139, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 147 + ], + [ + 153, + 165 + ], + [ + 169, + 172 + ], + [ + 173, + 175 + ], + [ + 176, + 177 + ], + [ + 178, + 186 + ], + [ + 187, + 190 + ], + [ + 191, + 192 + ], + [ + 195, + 196 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 208 + ], + [ + 209, + 228 + ], + [ + 229, + 230 + ], + [ + 234, + 235 + ], + [ + 238, + 240 + ], + [ + 247, + 248 + ], + [ + 253, + 259 + ], + [ + 260, + 261 + ], + [ + 270, + 271 + ], + [ + 272, + 273 + ], + [ + 277, + 296 + ], + [ + 297, + 298 + ], + [ + 301, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 334 + ], + [ + 346, + 368 + ], + [ + 369, + 370 + ], + [ + 373, + 376 + ], + [ + 377, + 378 + ], + [ + 385, + 410 + ], + [ + 420, + 422 + ], + [ + 424, + 426 + ], + [ + 430, + 431 + ], + [ + 435, + 437 + ], + [ + 438, + 439 + ], + [ + 443, + 444 + ], + [ + 445, + 446 + ], + [ + 449, + 450 + ], + [ + 453, + 454 + ], + [ + 459, + 460 + ], + [ + 466, + 484 + ], + [ + 487, + 488 + ], + [ + 507, + 509 + ], + [ + 510, + 511 + ], + [ + 515, + 516 + ], + [ + 525, + 526 + ], + [ + 530, + 533 + ], + [ + 534, + 535 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hist_find_ndim.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 42 + ], + [ + 59, + 66 + ], + [ + 79, + 99 + ], + [ + 103, + 281 + ], + [ + 291, + 308 + ], + [ + 309, + 331 + ], + [ + 342, + 349 + ], + [ + 352, + 366 + ] + ], + "lines_added": [ + [ + 3, + 5 + ], + [ + 11, + 12 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 62, + 63 + ], + [ + 82, + 83 + ], + [ + 88, + 89 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 106, + 108 + ], + [ + 111, + 126 + ], + [ + 129, + 130 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 145, + 147 + ], + [ + 148, + 152 + ], + [ + 154, + 155 + ], + [ + 156, + 161 + ], + [ + 167, + 169 + ], + [ + 170, + 176 + ], + [ + 177, + 179 + ], + [ + 180, + 183 + ], + [ + 184, + 187 + ], + [ + 189, + 191 + ], + [ + 193, + 194 + ], + [ + 197, + 198 + ], + [ + 203, + 205 + ], + [ + 206, + 207 + ], + [ + 212, + 213 + ], + [ + 216, + 217 + ], + [ + 220, + 225 + ], + [ + 227, + 228 + ], + [ + 233, + 234 + ], + [ + 236, + 247 + ], + [ + 249, + 251 + ], + [ + 257, + 258 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 271 + ], + [ + 274, + 275 + ], + [ + 277, + 278 + ], + [ + 294, + 295 + ], + [ + 298, + 299 + ], + [ + 304, + 305 + ], + [ + 312, + 324 + ], + [ + 327, + 328 + ], + [ + 345, + 346 + ], + [ + 355, + 356 + ], + [ + 360, + 363 + ], + [ + 364, + 365 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hough.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 43, + 151 + ], + [ + 157, + 174 + ], + [ + 175, + 189 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 46, + 47 + ], + [ + 49, + 50 + ], + [ + 51, + 53 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 58, + 64 + ], + [ + 66, + 67 + ], + [ + 70, + 71 + ], + [ + 72, + 74 + ], + [ + 76, + 77 + ], + [ + 81, + 84 + ], + [ + 85, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 93 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 106, + 108 + ], + [ + 109, + 110 + ], + [ + 115, + 116 + ], + [ + 120, + 125 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 133, + 135 + ], + [ + 137, + 138 + ], + [ + 143, + 146 + ], + [ + 147, + 148 + ], + [ + 160, + 161 + ], + [ + 164, + 165 + ], + [ + 170, + 171 + ], + [ + 178, + 183 + ], + [ + 186, + 187 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hough.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 39, + 73 + ], + [ + 76, + 88 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 54 + ], + [ + 59, + 63 + ], + [ + 69, + 70 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hough_circle.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 66, + 79 + ], + [ + 87, + 178 + ], + [ + 181, + 220 + ], + [ + 223, + 263 + ], + [ + 272, + 282 + ], + [ + 292, + 306 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 69, + 70 + ], + [ + 75, + 76 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 101 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 113, + 117 + ], + [ + 123, + 125 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 132, + 133 + ], + [ + 136, + 137 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 147, + 150 + ], + [ + 151, + 152 + ], + [ + 154, + 157 + ], + [ + 158, + 160 + ], + [ + 161, + 163 + ], + [ + 169, + 172 + ], + [ + 173, + 175 + ], + [ + 184, + 185 + ], + [ + 186, + 188 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 204, + 206 + ], + [ + 208, + 209 + ], + [ + 210, + 212 + ], + [ + 216, + 217 + ], + [ + 226, + 227 + ], + [ + 232, + 252 + ], + [ + 255, + 256 + ], + [ + 257, + 260 + ], + [ + 275, + 276 + ], + [ + 278, + 279 + ], + [ + 295, + 296 + ], + [ + 300, + 303 + ], + [ + 304, + 305 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hough_line.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 49, + 56 + ], + [ + 62, + 113 + ], + [ + 115, + 134 + ], + [ + 137, + 166 + ], + [ + 178, + 203 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 52, + 53 + ], + [ + 65, + 66 + ], + [ + 68, + 69 + ], + [ + 75, + 77 + ], + [ + 80, + 82 + ], + [ + 83, + 85 + ], + [ + 86, + 87 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 118, + 119 + ], + [ + 123, + 125 + ], + [ + 130, + 131 + ], + [ + 140, + 141 + ], + [ + 146, + 159 + ], + [ + 162, + 163 + ], + [ + 181, + 183 + ], + [ + 185, + 186 + ], + [ + 192, + 193 + ], + [ + 197, + 200 + ], + [ + 201, + 202 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/invert.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 49 + ], + [ + 66, + 148 + ], + [ + 169, + 190 + ], + [ + 195, + 202 + ], + [ + 204, + 218 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 24, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 40 + ], + [ + 45, + 46 + ], + [ + 69, + 70 + ], + [ + 71, + 79 + ], + [ + 80, + 88 + ], + [ + 89, + 102 + ], + [ + 104, + 106 + ], + [ + 108, + 109 + ], + [ + 112, + 145 + ], + [ + 172, + 173 + ], + [ + 175, + 176 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 198, + 199 + ], + [ + 207, + 208 + ], + [ + 212, + 215 + ], + [ + 216, + 217 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/linear.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 17 + ], + [ + 49, + 77 + ], + [ + 113, + 126 + ], + [ + 129, + 416 + ], + [ + 433, + 500 + ], + [ + 512, + 523 + ], + [ + 526, + 543 + ], + [ + 551, + 572 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 6, + 7 + ], + [ + 13, + 14 + ], + [ + 52, + 53 + ], + [ + 54, + 58 + ], + [ + 59, + 63 + ], + [ + 64, + 68 + ], + [ + 73, + 74 + ], + [ + 116, + 117 + ], + [ + 119, + 120 + ], + [ + 121, + 123 + ], + [ + 132, + 137 + ], + [ + 139, + 141 + ], + [ + 144, + 152 + ], + [ + 157, + 158 + ], + [ + 162, + 164 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 176, + 178 + ], + [ + 182, + 183 + ], + [ + 188, + 190 + ], + [ + 191, + 193 + ], + [ + 194, + 195 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 207, + 208 + ], + [ + 210, + 212 + ], + [ + 213, + 214 + ], + [ + 218, + 229 + ], + [ + 232, + 241 + ], + [ + 242, + 251 + ], + [ + 252, + 253 + ], + [ + 254, + 267 + ], + [ + 271, + 285 + ], + [ + 288, + 300 + ], + [ + 301, + 310 + ], + [ + 311, + 312 + ], + [ + 313, + 326 + ], + [ + 330, + 332 + ], + [ + 335, + 337 + ], + [ + 341, + 373 + ], + [ + 378, + 409 + ], + [ + 436, + 437 + ], + [ + 438, + 439 + ], + [ + 440, + 441 + ], + [ + 446, + 447 + ], + [ + 451, + 452 + ], + [ + 453, + 456 + ], + [ + 457, + 459 + ], + [ + 460, + 463 + ], + [ + 464, + 466 + ], + [ + 467, + 470 + ], + [ + 471, + 473 + ], + [ + 476, + 477 + ], + [ + 481, + 483 + ], + [ + 488, + 490 + ], + [ + 491, + 492 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 515, + 516 + ], + [ + 517, + 520 + ], + [ + 529, + 531 + ], + [ + 535, + 538 + ], + [ + 539, + 540 + ], + [ + 554, + 555 + ], + [ + 561, + 562 + ], + [ + 566, + 569 + ], + [ + 570, + 571 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/math.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 29, + 57 + ], + [ + 80, + 233 + ], + [ + 252, + 292 + ], + [ + 295, + 305 + ], + [ + 307, + 323 + ], + [ + 330, + 346 + ], + [ + 353, + 369 + ], + [ + 376, + 392 + ], + [ + 399, + 415 + ], + [ + 422, + 438 + ], + [ + 445, + 461 + ], + [ + 468, + 484 + ], + [ + 491, + 507 + ], + [ + 514, + 530 + ], + [ + 537, + 553 + ], + [ + 560, + 576 + ], + [ + 583, + 599 + ], + [ + 606, + 622 + ], + [ + 629, + 645 + ], + [ + 652, + 668 + ], + [ + 675, + 689 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 32, + 33 + ], + [ + 34, + 38 + ], + [ + 39, + 43 + ], + [ + 44, + 48 + ], + [ + 53, + 54 + ], + [ + 83, + 84 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 91, + 94 + ], + [ + 95, + 97 + ], + [ + 98, + 99 + ], + [ + 101, + 109 + ], + [ + 110, + 112 + ], + [ + 113, + 115 + ], + [ + 116, + 118 + ], + [ + 119, + 121 + ], + [ + 122, + 124 + ], + [ + 125, + 127 + ], + [ + 128, + 130 + ], + [ + 131, + 133 + ], + [ + 134, + 137 + ], + [ + 139, + 140 + ], + [ + 144, + 147 + ], + [ + 148, + 151 + ], + [ + 155, + 161 + ], + [ + 164, + 165 + ], + [ + 168, + 170 + ], + [ + 172, + 174 + ], + [ + 177, + 178 + ], + [ + 181, + 230 + ], + [ + 255, + 256 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 265, + 266 + ], + [ + 270, + 271 + ], + [ + 272, + 275 + ], + [ + 276, + 278 + ], + [ + 281, + 282 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 298, + 299 + ], + [ + 300, + 302 + ], + [ + 310, + 311 + ], + [ + 315, + 318 + ], + [ + 319, + 320 + ], + [ + 333, + 334 + ], + [ + 338, + 341 + ], + [ + 342, + 343 + ], + [ + 356, + 357 + ], + [ + 361, + 364 + ], + [ + 365, + 366 + ], + [ + 379, + 380 + ], + [ + 384, + 387 + ], + [ + 388, + 389 + ], + [ + 402, + 403 + ], + [ + 407, + 410 + ], + [ + 411, + 412 + ], + [ + 425, + 426 + ], + [ + 430, + 433 + ], + [ + 434, + 435 + ], + [ + 448, + 449 + ], + [ + 453, + 456 + ], + [ + 457, + 458 + ], + [ + 471, + 472 + ], + [ + 476, + 479 + ], + [ + 480, + 481 + ], + [ + 494, + 495 + ], + [ + 499, + 502 + ], + [ + 503, + 504 + ], + [ + 517, + 518 + ], + [ + 522, + 525 + ], + [ + 526, + 527 + ], + [ + 540, + 541 + ], + [ + 545, + 548 + ], + [ + 549, + 550 + ], + [ + 563, + 564 + ], + [ + 568, + 571 + ], + [ + 572, + 573 + ], + [ + 586, + 587 + ], + [ + 591, + 594 + ], + [ + 595, + 596 + ], + [ + 609, + 610 + ], + [ + 614, + 617 + ], + [ + 618, + 619 + ], + [ + 632, + 633 + ], + [ + 637, + 640 + ], + [ + 641, + 642 + ], + [ + 655, + 656 + ], + [ + 660, + 663 + ], + [ + 664, + 665 + ], + [ + 678, + 679 + ], + [ + 683, + 686 + ], + [ + 687, + 688 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/math2.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 30, + 58 + ], + [ + 82, + 213 + ], + [ + 230, + 271 + ], + [ + 276, + 299 + ], + [ + 301, + 318 + ], + [ + 327, + 343 + ], + [ + 352, + 368 + ], + [ + 377, + 395 + ], + [ + 398, + 437 + ], + [ + 439, + 515 + ], + [ + 520, + 538 + ], + [ + 541, + 558 + ], + [ + 568, + 585 + ], + [ + 595, + 612 + ], + [ + 622, + 639 + ], + [ + 640, + 673 + ], + [ + 675, + 699 + ], + [ + 701, + 725 + ], + [ + 727, + 742 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 44 + ], + [ + 45, + 49 + ], + [ + 54, + 55 + ], + [ + 85, + 86 + ], + [ + 88, + 89 + ], + [ + 90, + 91 + ], + [ + 93, + 99 + ], + [ + 100, + 102 + ], + [ + 103, + 104 + ], + [ + 106, + 118 + ], + [ + 119, + 121 + ], + [ + 122, + 124 + ], + [ + 125, + 127 + ], + [ + 128, + 130 + ], + [ + 131, + 133 + ], + [ + 134, + 136 + ], + [ + 137, + 139 + ], + [ + 140, + 143 + ], + [ + 145, + 158 + ], + [ + 160, + 176 + ], + [ + 177, + 185 + ], + [ + 187, + 189 + ], + [ + 192, + 193 + ], + [ + 196, + 206 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 233, + 234 + ], + [ + 235, + 236 + ], + [ + 237, + 238 + ], + [ + 243, + 244 + ], + [ + 248, + 249 + ], + [ + 250, + 253 + ], + [ + 254, + 256 + ], + [ + 259, + 260 + ], + [ + 264, + 266 + ], + [ + 267, + 268 + ], + [ + 279, + 280 + ], + [ + 283, + 284 + ], + [ + 289, + 291 + ], + [ + 294, + 296 + ], + [ + 304, + 306 + ], + [ + 310, + 313 + ], + [ + 314, + 315 + ], + [ + 330, + 331 + ], + [ + 335, + 338 + ], + [ + 339, + 340 + ], + [ + 355, + 356 + ], + [ + 360, + 363 + ], + [ + 364, + 365 + ], + [ + 380, + 381 + ], + [ + 385, + 388 + ], + [ + 389, + 390 + ], + [ + 401, + 403 + ], + [ + 405, + 406 + ], + [ + 407, + 408 + ], + [ + 410, + 413 + ], + [ + 414, + 416 + ], + [ + 417, + 418 + ], + [ + 420, + 430 + ], + [ + 432, + 434 + ], + [ + 442, + 445 + ], + [ + 447, + 449 + ], + [ + 451, + 453 + ], + [ + 455, + 456 + ], + [ + 458, + 459 + ], + [ + 462, + 463 + ], + [ + 464, + 465 + ], + [ + 466, + 467 + ], + [ + 472, + 474 + ], + [ + 478, + 479 + ], + [ + 480, + 483 + ], + [ + 484, + 486 + ], + [ + 489, + 490 + ], + [ + 494, + 496 + ], + [ + 498, + 499 + ], + [ + 502, + 503 + ], + [ + 504, + 505 + ], + [ + 507, + 508 + ], + [ + 509, + 510 + ], + [ + 511, + 512 + ], + [ + 523, + 526 + ], + [ + 529, + 530 + ], + [ + 532, + 535 + ], + [ + 544, + 546 + ], + [ + 550, + 553 + ], + [ + 554, + 555 + ], + [ + 571, + 572 + ], + [ + 576, + 580 + ], + [ + 581, + 582 + ], + [ + 598, + 599 + ], + [ + 603, + 607 + ], + [ + 608, + 609 + ], + [ + 625, + 626 + ], + [ + 630, + 634 + ], + [ + 635, + 636 + ], + [ + 643, + 644 + ], + [ + 646, + 647 + ], + [ + 652, + 654 + ], + [ + 658, + 661 + ], + [ + 662, + 663 + ], + [ + 669, + 670 + ], + [ + 678, + 679 + ], + [ + 683, + 687 + ], + [ + 688, + 689 + ], + [ + 695, + 696 + ], + [ + 704, + 705 + ], + [ + 709, + 713 + ], + [ + 714, + 715 + ], + [ + 721, + 722 + ], + [ + 730, + 731 + ], + [ + 735, + 739 + ], + [ + 740, + 741 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/max.c", + "line_filter": { + "diff_chunks": [ + [ + 29, + 57 + ], + [ + 112, + 119 + ], + [ + 125, + 173 + ], + [ + 179, + 186 + ], + [ + 193, + 301 + ], + [ + 304, + 506 + ], + [ + 519, + 559 + ] + ], + "lines_added": [ + [ + 32, + 48 + ], + [ + 53, + 54 + ], + [ + 115, + 116 + ], + [ + 128, + 129 + ], + [ + 134, + 137 + ], + [ + 142, + 143 + ], + [ + 148, + 150 + ], + [ + 152, + 154 + ], + [ + 156, + 158 + ], + [ + 162, + 163 + ], + [ + 164, + 166 + ], + [ + 169, + 170 + ], + [ + 182, + 183 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 205, + 206 + ], + [ + 207, + 209 + ], + [ + 212, + 214 + ], + [ + 216, + 218 + ], + [ + 223, + 224 + ], + [ + 228, + 231 + ], + [ + 235, + 236 + ], + [ + 242, + 243 + ], + [ + 244, + 247 + ], + [ + 250, + 260 + ], + [ + 262, + 263 + ], + [ + 268, + 269 + ], + [ + 272, + 274 + ], + [ + 275, + 276 + ], + [ + 281, + 282 + ], + [ + 288, + 291 + ], + [ + 292, + 293 + ], + [ + 294, + 295 + ], + [ + 297, + 298 + ], + [ + 307, + 325 + ], + [ + 327, + 328 + ], + [ + 332, + 333 + ], + [ + 334, + 350 + ], + [ + 353, + 365 + ], + [ + 366, + 379 + ], + [ + 383, + 385 + ], + [ + 387, + 388 + ], + [ + 392, + 418 + ], + [ + 420, + 422 + ], + [ + 423, + 425 + ], + [ + 426, + 427 + ], + [ + 430, + 431 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 444, + 445 + ], + [ + 451, + 454 + ], + [ + 455, + 457 + ], + [ + 458, + 461 + ], + [ + 462, + 464 + ], + [ + 465, + 468 + ], + [ + 469, + 471 + ], + [ + 472, + 475 + ], + [ + 476, + 478 + ], + [ + 479, + 482 + ], + [ + 483, + 485 + ], + [ + 486, + 489 + ], + [ + 490, + 492 + ], + [ + 493, + 496 + ], + [ + 497, + 499 + ], + [ + 502, + 503 + ], + [ + 522, + 523 + ], + [ + 524, + 527 + ], + [ + 529, + 532 + ], + [ + 537, + 538 + ], + [ + 541, + 542 + ], + [ + 548, + 549 + ], + [ + 553, + 556 + ], + [ + 557, + 558 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/measure.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 27, + 55 + ], + [ + 85, + 97 + ], + [ + 101, + 126 + ], + [ + 131, + 185 + ], + [ + 187, + 254 + ], + [ + 268, + 279 + ], + [ + 281, + 295 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 30, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 46 + ], + [ + 51, + 52 + ], + [ + 88, + 89 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 104, + 106 + ], + [ + 107, + 110 + ], + [ + 111, + 112 + ], + [ + 113, + 116 + ], + [ + 119, + 123 + ], + [ + 134, + 136 + ], + [ + 141, + 144 + ], + [ + 147, + 159 + ], + [ + 162, + 168 + ], + [ + 169, + 170 + ], + [ + 171, + 173 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 190, + 192 + ], + [ + 194, + 197 + ], + [ + 198, + 199 + ], + [ + 200, + 205 + ], + [ + 206, + 209 + ], + [ + 210, + 212 + ], + [ + 213, + 216 + ], + [ + 217, + 219 + ], + [ + 220, + 223 + ], + [ + 224, + 226 + ], + [ + 227, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 237 + ], + [ + 238, + 240 + ], + [ + 241, + 244 + ], + [ + 245, + 247 + ], + [ + 250, + 251 + ], + [ + 271, + 272 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 284, + 285 + ], + [ + 289, + 292 + ], + [ + 293, + 294 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/min.c", + "line_filter": { + "diff_chunks": [ + [ + 29, + 57 + ], + [ + 112, + 119 + ], + [ + 125, + 173 + ], + [ + 179, + 186 + ], + [ + 193, + 301 + ], + [ + 304, + 506 + ], + [ + 519, + 560 + ] + ], + "lines_added": [ + [ + 32, + 48 + ], + [ + 53, + 54 + ], + [ + 115, + 116 + ], + [ + 128, + 129 + ], + [ + 134, + 137 + ], + [ + 142, + 143 + ], + [ + 148, + 150 + ], + [ + 152, + 154 + ], + [ + 156, + 158 + ], + [ + 162, + 163 + ], + [ + 164, + 166 + ], + [ + 169, + 170 + ], + [ + 182, + 183 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 205, + 206 + ], + [ + 207, + 209 + ], + [ + 212, + 214 + ], + [ + 216, + 218 + ], + [ + 223, + 224 + ], + [ + 228, + 231 + ], + [ + 235, + 236 + ], + [ + 242, + 243 + ], + [ + 244, + 247 + ], + [ + 250, + 252 + ], + [ + 253, + 260 + ], + [ + 262, + 263 + ], + [ + 268, + 269 + ], + [ + 272, + 274 + ], + [ + 275, + 276 + ], + [ + 281, + 282 + ], + [ + 288, + 291 + ], + [ + 292, + 293 + ], + [ + 294, + 295 + ], + [ + 297, + 298 + ], + [ + 307, + 325 + ], + [ + 327, + 328 + ], + [ + 332, + 333 + ], + [ + 334, + 350 + ], + [ + 353, + 365 + ], + [ + 366, + 379 + ], + [ + 383, + 385 + ], + [ + 387, + 388 + ], + [ + 392, + 418 + ], + [ + 420, + 422 + ], + [ + 423, + 425 + ], + [ + 426, + 427 + ], + [ + 430, + 431 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 444, + 445 + ], + [ + 451, + 454 + ], + [ + 455, + 457 + ], + [ + 458, + 461 + ], + [ + 462, + 464 + ], + [ + 465, + 468 + ], + [ + 469, + 471 + ], + [ + 472, + 475 + ], + [ + 476, + 478 + ], + [ + 479, + 482 + ], + [ + 483, + 485 + ], + [ + 486, + 489 + ], + [ + 490, + 492 + ], + [ + 493, + 496 + ], + [ + 497, + 499 + ], + [ + 502, + 503 + ], + [ + 522, + 523 + ], + [ + 524, + 527 + ], + [ + 529, + 532 + ], + [ + 538, + 539 + ], + [ + 542, + 543 + ], + [ + 549, + 550 + ], + [ + 554, + 557 + ], + [ + 558, + 559 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/multiply.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 31, + 59 + ], + [ + 76, + 168 + ], + [ + 177, + 184 + ], + [ + 186, + 207 + ], + [ + 211, + 230 + ], + [ + 288, + 302 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 34, + 35 + ], + [ + 36, + 40 + ], + [ + 41, + 45 + ], + [ + 46, + 50 + ], + [ + 55, + 56 + ], + [ + 79, + 80 + ], + [ + 83, + 104 + ], + [ + 107, + 116 + ], + [ + 118, + 120 + ], + [ + 122, + 123 + ], + [ + 126, + 127 + ], + [ + 128, + 163 + ], + [ + 164, + 165 + ], + [ + 180, + 181 + ], + [ + 189, + 190 + ], + [ + 192, + 193 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 203, + 204 + ], + [ + 214, + 215 + ], + [ + 219, + 221 + ], + [ + 224, + 227 + ], + [ + 291, + 292 + ], + [ + 296, + 299 + ], + [ + 300, + 301 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/nary.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 48, + 99 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 51, + 52 + ], + [ + 54, + 55 + ], + [ + 56, + 58 + ], + [ + 59, + 60 + ], + [ + 64, + 66 + ], + [ + 67, + 68 + ], + [ + 71, + 72 + ], + [ + 73, + 75 + ], + [ + 80, + 81 + ], + [ + 86, + 89 + ], + [ + 90, + 92 + ], + [ + 95, + 96 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/nary.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 40, + 56 + ], + [ + 62, + 72 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 43, + 53 + ], + [ + 65, + 66 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/parithmetic.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 39, + 62 + ], + [ + 104, + 123 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 42, + 54 + ], + [ + 57, + 59 + ], + [ + 107, + 108 + ], + [ + 109, + 117 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/profile.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 16, + 44 + ], + [ + 76, + 318 + ], + [ + 322, + 331 + ], + [ + 332, + 346 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 35 + ], + [ + 40, + 41 + ], + [ + 79, + 81 + ], + [ + 86, + 87 + ], + [ + 89, + 90 + ], + [ + 91, + 93 + ], + [ + 95, + 111 + ], + [ + 114, + 115 + ], + [ + 116, + 118 + ], + [ + 122, + 125 + ], + [ + 126, + 127 + ], + [ + 129, + 130 + ], + [ + 134, + 136 + ], + [ + 139, + 144 + ], + [ + 145, + 146 + ], + [ + 148, + 149 + ], + [ + 151, + 159 + ], + [ + 160, + 161 + ], + [ + 163, + 164 + ], + [ + 166, + 167 + ], + [ + 172, + 174 + ], + [ + 175, + 176 + ], + [ + 180, + 181 + ], + [ + 184, + 199 + ], + [ + 200, + 203 + ], + [ + 204, + 205 + ], + [ + 209, + 211 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 242, + 243 + ], + [ + 246, + 247 + ], + [ + 253, + 254 + ], + [ + 259, + 260 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 268, + 270 + ], + [ + 271, + 273 + ], + [ + 276, + 278 + ], + [ + 279, + 280 + ], + [ + 283, + 284 + ], + [ + 287, + 288 + ], + [ + 293, + 294 + ], + [ + 300, + 311 + ], + [ + 314, + 315 + ], + [ + 325, + 328 + ], + [ + 335, + 336 + ], + [ + 340, + 343 + ], + [ + 344, + 345 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/project.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 70, + 84 + ], + [ + 92, + 277 + ], + [ + 279, + 302 + ], + [ + 304, + 349 + ], + [ + 364, + 378 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 73, + 75 + ], + [ + 80, + 81 + ], + [ + 95, + 96 + ], + [ + 97, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 111 + ], + [ + 112, + 114 + ], + [ + 115, + 116 + ], + [ + 119, + 120 + ], + [ + 121, + 123 + ], + [ + 127, + 130 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 139, + 141 + ], + [ + 144, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 158, + 166 + ], + [ + 167, + 168 + ], + [ + 173, + 174 + ], + [ + 179, + 181 + ], + [ + 182, + 183 + ], + [ + 187, + 203 + ], + [ + 204, + 205 + ], + [ + 209, + 211 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 242, + 243 + ], + [ + 246, + 247 + ], + [ + 253, + 254 + ], + [ + 256, + 266 + ], + [ + 270, + 271 + ], + [ + 273, + 274 + ], + [ + 282, + 283 + ], + [ + 284, + 287 + ], + [ + 290, + 293 + ], + [ + 296, + 299 + ], + [ + 307, + 309 + ], + [ + 310, + 311 + ], + [ + 314, + 315 + ], + [ + 318, + 319 + ], + [ + 324, + 325 + ], + [ + 331, + 342 + ], + [ + 345, + 346 + ], + [ + 367, + 368 + ], + [ + 372, + 375 + ], + [ + 376, + 377 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/relational.c", + "line_filter": { + "diff_chunks": [ + [ + 29, + 64 + ], + [ + 87, + 170 + ], + [ + 174, + 205 + ], + [ + 225, + 268 + ], + [ + 272, + 316 + ], + [ + 325, + 342 + ], + [ + 351, + 368 + ], + [ + 377, + 394 + ], + [ + 403, + 420 + ], + [ + 429, + 446 + ], + [ + 455, + 472 + ], + [ + 476, + 586 + ], + [ + 589, + 647 + ], + [ + 655, + 666 + ], + [ + 669, + 686 + ], + [ + 696, + 713 + ], + [ + 723, + 741 + ], + [ + 751, + 768 + ], + [ + 778, + 795 + ], + [ + 805, + 822 + ], + [ + 832, + 849 + ], + [ + 850, + 857 + ], + [ + 861, + 885 + ], + [ + 887, + 911 + ], + [ + 913, + 937 + ], + [ + 939, + 963 + ], + [ + 965, + 989 + ], + [ + 991, + 1015 + ], + [ + 1017, + 1032 + ] + ], + "lines_added": [ + [ + 32, + 33 + ], + [ + 39, + 40 + ], + [ + 41, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 55 + ], + [ + 60, + 61 + ], + [ + 90, + 91 + ], + [ + 92, + 101 + ], + [ + 102, + 115 + ], + [ + 116, + 149 + ], + [ + 151, + 152 + ], + [ + 153, + 159 + ], + [ + 161, + 163 + ], + [ + 166, + 167 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 187, + 190 + ], + [ + 193, + 194 + ], + [ + 196, + 198 + ], + [ + 200, + 202 + ], + [ + 228, + 229 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 238, + 239 + ], + [ + 242, + 244 + ], + [ + 245, + 248 + ], + [ + 249, + 252 + ], + [ + 255, + 256 + ], + [ + 260, + 262 + ], + [ + 263, + 265 + ], + [ + 275, + 276 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 284, + 286 + ], + [ + 289, + 291 + ], + [ + 294, + 296 + ], + [ + 302, + 304 + ], + [ + 308, + 311 + ], + [ + 312, + 313 + ], + [ + 328, + 329 + ], + [ + 333, + 337 + ], + [ + 338, + 339 + ], + [ + 354, + 355 + ], + [ + 359, + 363 + ], + [ + 364, + 365 + ], + [ + 380, + 381 + ], + [ + 385, + 389 + ], + [ + 390, + 391 + ], + [ + 406, + 407 + ], + [ + 411, + 415 + ], + [ + 416, + 417 + ], + [ + 432, + 433 + ], + [ + 437, + 441 + ], + [ + 442, + 443 + ], + [ + 458, + 459 + ], + [ + 463, + 467 + ], + [ + 468, + 469 + ], + [ + 479, + 491 + ], + [ + 492, + 501 + ], + [ + 502, + 515 + ], + [ + 516, + 517 + ], + [ + 519, + 521 + ], + [ + 527, + 528 + ], + [ + 531, + 532 + ], + [ + 533, + 535 + ], + [ + 537, + 538 + ], + [ + 542, + 544 + ], + [ + 546, + 547 + ], + [ + 551, + 553 + ], + [ + 555, + 556 + ], + [ + 560, + 562 + ], + [ + 564, + 565 + ], + [ + 569, + 571 + ], + [ + 573, + 574 + ], + [ + 578, + 580 + ], + [ + 582, + 583 + ], + [ + 592, + 593 + ], + [ + 594, + 595 + ], + [ + 596, + 597 + ], + [ + 602, + 604 + ], + [ + 607, + 609 + ], + [ + 610, + 613 + ], + [ + 614, + 617 + ], + [ + 620, + 621 + ], + [ + 625, + 627 + ], + [ + 629, + 630 + ], + [ + 633, + 634 + ], + [ + 635, + 636 + ], + [ + 638, + 640 + ], + [ + 641, + 642 + ], + [ + 643, + 644 + ], + [ + 658, + 659 + ], + [ + 660, + 663 + ], + [ + 672, + 674 + ], + [ + 678, + 681 + ], + [ + 682, + 683 + ], + [ + 699, + 700 + ], + [ + 704, + 708 + ], + [ + 709, + 710 + ], + [ + 726, + 728 + ], + [ + 732, + 736 + ], + [ + 737, + 738 + ], + [ + 754, + 755 + ], + [ + 759, + 763 + ], + [ + 764, + 765 + ], + [ + 781, + 782 + ], + [ + 786, + 790 + ], + [ + 791, + 792 + ], + [ + 808, + 809 + ], + [ + 813, + 817 + ], + [ + 818, + 819 + ], + [ + 835, + 836 + ], + [ + 840, + 844 + ], + [ + 845, + 846 + ], + [ + 853, + 854 + ], + [ + 864, + 866 + ], + [ + 870, + 873 + ], + [ + 874, + 875 + ], + [ + 881, + 882 + ], + [ + 890, + 891 + ], + [ + 895, + 899 + ], + [ + 900, + 901 + ], + [ + 907, + 908 + ], + [ + 916, + 917 + ], + [ + 921, + 925 + ], + [ + 926, + 927 + ], + [ + 933, + 934 + ], + [ + 942, + 943 + ], + [ + 947, + 951 + ], + [ + 952, + 953 + ], + [ + 959, + 960 + ], + [ + 968, + 969 + ], + [ + 973, + 977 + ], + [ + 978, + 979 + ], + [ + 985, + 986 + ], + [ + 994, + 995 + ], + [ + 999, + 1003 + ], + [ + 1004, + 1005 + ], + [ + 1011, + 1012 + ], + [ + 1020, + 1021 + ], + [ + 1025, + 1029 + ], + [ + 1030, + 1031 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/remainder.c", + "line_filter": { + "diff_chunks": [ + [ + 22, + 50 + ], + [ + 68, + 161 + ], + [ + 178, + 206 + ], + [ + 210, + 231 + ], + [ + 233, + 306 + ], + [ + 307, + 389 + ], + [ + 393, + 409 + ], + [ + 412, + 448 + ], + [ + 451, + 465 + ] + ], + "lines_added": [ + [ + 25, + 26 + ], + [ + 27, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 41 + ], + [ + 46, + 47 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 79, + 85 + ], + [ + 86, + 88 + ], + [ + 89, + 90 + ], + [ + 94, + 103 + ], + [ + 106, + 119 + ], + [ + 121, + 123 + ], + [ + 125, + 126 + ], + [ + 129, + 156 + ], + [ + 157, + 158 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 191, + 193 + ], + [ + 197, + 199 + ], + [ + 202, + 203 + ], + [ + 213, + 215 + ], + [ + 221, + 223 + ], + [ + 226, + 228 + ], + [ + 236, + 237 + ], + [ + 241, + 244 + ], + [ + 245, + 246 + ], + [ + 251, + 253 + ], + [ + 255, + 256 + ], + [ + 257, + 258 + ], + [ + 260, + 263 + ], + [ + 264, + 266 + ], + [ + 267, + 268 + ], + [ + 272, + 282 + ], + [ + 285, + 299 + ], + [ + 301, + 303 + ], + [ + 310, + 337 + ], + [ + 338, + 339 + ], + [ + 342, + 343 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 352, + 355 + ], + [ + 359, + 360 + ], + [ + 363, + 364 + ], + [ + 368, + 370 + ], + [ + 372, + 373 + ], + [ + 376, + 377 + ], + [ + 378, + 379 + ], + [ + 381, + 382 + ], + [ + 383, + 384 + ], + [ + 385, + 386 + ], + [ + 396, + 401 + ], + [ + 403, + 406 + ], + [ + 415, + 417 + ], + [ + 421, + 424 + ], + [ + 425, + 426 + ], + [ + 432, + 433 + ], + [ + 435, + 440 + ], + [ + 442, + 445 + ], + [ + 454, + 455 + ], + [ + 459, + 462 + ], + [ + 463, + 464 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/round.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 41 + ], + [ + 64, + 145 + ], + [ + 160, + 201 + ], + [ + 206, + 214 + ], + [ + 217, + 233 + ], + [ + 235, + 257 + ], + [ + 259, + 281 + ], + [ + 283, + 303 + ] + ], + "lines_added": [ + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 32 + ], + [ + 37, + 38 + ], + [ + 67, + 68 + ], + [ + 70, + 71 + ], + [ + 77, + 80 + ], + [ + 81, + 83 + ], + [ + 84, + 85 + ], + [ + 87, + 113 + ], + [ + 115, + 117 + ], + [ + 123, + 125 + ], + [ + 128, + 142 + ], + [ + 163, + 164 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 173, + 174 + ], + [ + 178, + 179 + ], + [ + 180, + 183 + ], + [ + 184, + 186 + ], + [ + 189, + 190 + ], + [ + 194, + 196 + ], + [ + 197, + 198 + ], + [ + 209, + 211 + ], + [ + 220, + 221 + ], + [ + 225, + 228 + ], + [ + 229, + 230 + ], + [ + 238, + 240 + ], + [ + 244, + 245 + ], + [ + 249, + 252 + ], + [ + 253, + 254 + ], + [ + 262, + 264 + ], + [ + 268, + 269 + ], + [ + 273, + 276 + ], + [ + 277, + 278 + ], + [ + 286, + 288 + ], + [ + 292, + 293 + ], + [ + 297, + 300 + ], + [ + 301, + 302 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/sign.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 55, + 146 + ], + [ + 165, + 186 + ], + [ + 199, + 213 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 29 + ], + [ + 34, + 35 + ], + [ + 58, + 83 + ], + [ + 84, + 85 + ], + [ + 86, + 103 + ], + [ + 105, + 107 + ], + [ + 108, + 110 + ], + [ + 112, + 143 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 202, + 203 + ], + [ + 207, + 210 + ], + [ + 211, + 212 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/statistic.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 54, + 177 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 29 + ], + [ + 34, + 35 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 62, + 64 + ], + [ + 65, + 66 + ], + [ + 69, + 71 + ], + [ + 72, + 74 + ], + [ + 76, + 77 + ], + [ + 81, + 83 + ], + [ + 84, + 89 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 115 + ], + [ + 117, + 120 + ], + [ + 122, + 124 + ], + [ + 127, + 129 + ], + [ + 133, + 137 + ], + [ + 140, + 146 + ], + [ + 147, + 148 + ], + [ + 151, + 152 + ], + [ + 153, + 156 + ], + [ + 161, + 162 + ], + [ + 166, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/statistic.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 65 + ], + [ + 67, + 74 + ], + [ + 77, + 84 + ], + [ + 86, + 94 + ], + [ + 95, + 102 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 58, + 62 + ], + [ + 70, + 71 + ], + [ + 80, + 81 + ], + [ + 89, + 91 + ], + [ + 98, + 99 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/stats.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 26 + ], + [ + 31, + 59 + ], + [ + 79, + 91 + ], + [ + 103, + 152 + ], + [ + 155, + 214 + ], + [ + 218, + 451 + ], + [ + 455, + 487 + ] + ], + "lines_added": [ + [ + 20, + 21 + ], + [ + 22, + 23 + ], + [ + 34, + 35 + ], + [ + 36, + 40 + ], + [ + 41, + 50 + ], + [ + 55, + 56 + ], + [ + 82, + 83 + ], + [ + 87, + 88 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 116, + 118 + ], + [ + 119, + 121 + ], + [ + 122, + 125 + ], + [ + 127, + 129 + ], + [ + 130, + 133 + ], + [ + 134, + 137 + ], + [ + 139, + 141 + ], + [ + 142, + 143 + ], + [ + 148, + 149 + ], + [ + 158, + 160 + ], + [ + 162, + 165 + ], + [ + 168, + 171 + ], + [ + 172, + 173 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 186, + 190 + ], + [ + 193, + 194 + ], + [ + 199, + 203 + ], + [ + 204, + 205 + ], + [ + 210, + 211 + ], + [ + 221, + 223 + ], + [ + 224, + 225 + ], + [ + 227, + 228 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 236, + 240 + ], + [ + 243, + 244 + ], + [ + 249, + 268 + ], + [ + 269, + 275 + ], + [ + 276, + 297 + ], + [ + 298, + 307 + ], + [ + 308, + 311 + ], + [ + 314, + 333 + ], + [ + 334, + 340 + ], + [ + 341, + 362 + ], + [ + 363, + 372 + ], + [ + 373, + 376 + ], + [ + 380, + 382 + ], + [ + 383, + 384 + ], + [ + 388, + 415 + ], + [ + 418, + 419 + ], + [ + 422, + 423 + ], + [ + 426, + 427 + ], + [ + 432, + 433 + ], + [ + 439, + 444 + ], + [ + 447, + 448 + ], + [ + 458, + 461 + ], + [ + 462, + 463 + ], + [ + 465, + 466 + ], + [ + 468, + 470 + ], + [ + 476, + 477 + ], + [ + 481, + 484 + ], + [ + 485, + 486 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/subtract.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 35, + 63 + ], + [ + 80, + 147 + ], + [ + 165, + 209 + ], + [ + 267, + 281 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 38, + 39 + ], + [ + 40, + 44 + ], + [ + 45, + 49 + ], + [ + 50, + 54 + ], + [ + 59, + 60 + ], + [ + 83, + 84 + ], + [ + 85, + 94 + ], + [ + 96, + 98 + ], + [ + 103, + 105 + ], + [ + 108, + 109 + ], + [ + 110, + 139 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 188, + 190 + ], + [ + 193, + 194 + ], + [ + 198, + 200 + ], + [ + 203, + 206 + ], + [ + 270, + 271 + ], + [ + 275, + 278 + ], + [ + 279, + 280 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/sum.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 120 + ], + [ + 140, + 175 + ], + [ + 178, + 197 + ], + [ + 255, + 269 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 70 + ], + [ + 72, + 73 + ], + [ + 75, + 76 + ], + [ + 79, + 81 + ], + [ + 85, + 86 + ], + [ + 88, + 117 + ], + [ + 143, + 144 + ], + [ + 146, + 147 + ], + [ + 149, + 150 + ], + [ + 153, + 154 + ], + [ + 157, + 158 + ], + [ + 162, + 163 + ], + [ + 164, + 165 + ], + [ + 167, + 170 + ], + [ + 171, + 172 + ], + [ + 181, + 182 + ], + [ + 187, + 188 + ], + [ + 191, + 194 + ], + [ + 258, + 259 + ], + [ + 263, + 266 + ], + [ + 267, + 268 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/unary.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 48, + 99 + ], + [ + 102, + 118 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 51, + 52 + ], + [ + 54, + 55 + ], + [ + 56, + 58 + ], + [ + 60, + 61 + ], + [ + 62, + 64 + ], + [ + 65, + 67 + ], + [ + 68, + 69 + ], + [ + 72, + 73 + ], + [ + 74, + 76 + ], + [ + 81, + 82 + ], + [ + 87, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/unary.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 54 + ], + [ + 58, + 70 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 51 + ], + [ + 61, + 62 + ], + [ + 63, + 64 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/unaryconst.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 50, + 63 + ], + [ + 64, + 81 + ], + [ + 87, + 153 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 32, + 33 + ], + [ + 53, + 54 + ], + [ + 56, + 57 + ], + [ + 58, + 60 + ], + [ + 67, + 71 + ], + [ + 73, + 78 + ], + [ + 90, + 93 + ], + [ + 99, + 106 + ], + [ + 107, + 110 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 115, + 117 + ], + [ + 122, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 131, + 132 + ], + [ + 138, + 139 + ], + [ + 141, + 144 + ], + [ + 145, + 147 + ], + [ + 150, + 151 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/unaryconst.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 76, + 86 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 79, + 80 + ] + ] + } + }, + { + "filename": "libvips/colour/CMYK2XYZ.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 58, + 132 + ], + [ + 137, + 151 + ], + [ + 164, + 190 + ], + [ + 205, + 227 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 61, + 62 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 71, + 72 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 80, + 81 + ], + [ + 82, + 84 + ], + [ + 86, + 87 + ], + [ + 88, + 94 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 109, + 110 + ], + [ + 114, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 140, + 141 + ], + [ + 147, + 148 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 177, + 179 + ], + [ + 183, + 184 + ], + [ + 185, + 187 + ], + [ + 208, + 209 + ], + [ + 210, + 211 + ], + [ + 216, + 217 + ], + [ + 221, + 224 + ], + [ + 225, + 226 + ] + ] + } + }, + { + "filename": "libvips/colour/HSV2sRGB.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 46, + 97 + ], + [ + 103, + 125 + ], + [ + 139, + 146 + ], + [ + 147, + 161 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 52, + 53 + ], + [ + 54, + 56 + ], + [ + 62, + 63 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 73, + 75 + ], + [ + 78, + 80 + ], + [ + 83, + 85 + ], + [ + 88, + 90 + ], + [ + 93, + 94 + ], + [ + 106, + 107 + ], + [ + 109, + 110 + ], + [ + 112, + 113 + ], + [ + 118, + 119 + ], + [ + 120, + 122 + ], + [ + 142, + 143 + ], + [ + 150, + 151 + ], + [ + 155, + 158 + ], + [ + 159, + 160 + ] + ] + } + }, + { + "filename": "libvips/colour/LCh2Lab.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 43 + ], + [ + 55, + 62 + ], + [ + 67, + 90 + ], + [ + 91, + 98 + ], + [ + 102, + 123 + ], + [ + 132, + 146 + ] + ], + "lines_added": [ + [ + 18, + 34 + ], + [ + 39, + 40 + ], + [ + 58, + 59 + ], + [ + 70, + 71 + ], + [ + 72, + 74 + ], + [ + 79, + 83 + ], + [ + 86, + 87 + ], + [ + 94, + 95 + ], + [ + 105, + 106 + ], + [ + 108, + 109 + ], + [ + 111, + 112 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 135, + 136 + ], + [ + 140, + 143 + ], + [ + 144, + 145 + ] + ] + } + }, + { + "filename": "libvips/colour/LCh2UCS.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 51, + 63 + ], + [ + 74, + 82 + ], + [ + 87, + 103 + ], + [ + 108, + 123 + ], + [ + 129, + 156 + ], + [ + 164, + 218 + ], + [ + 226, + 252 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 54, + 55 + ], + [ + 59, + 60 + ], + [ + 77, + 79 + ], + [ + 90, + 92 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 111, + 113 + ], + [ + 115, + 117 + ], + [ + 119, + 120 + ], + [ + 132, + 134 + ], + [ + 138, + 139 + ], + [ + 145, + 146 + ], + [ + 152, + 153 + ], + [ + 167, + 169 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 177, + 178 + ], + [ + 184, + 185 + ], + [ + 191, + 194 + ], + [ + 200, + 201 + ], + [ + 203, + 204 + ], + [ + 206, + 207 + ], + [ + 212, + 213 + ], + [ + 214, + 215 + ], + [ + 229, + 230 + ], + [ + 234, + 235 + ], + [ + 236, + 237 + ], + [ + 241, + 242 + ], + [ + 246, + 249 + ], + [ + 250, + 251 + ] + ] + } + }, + { + "filename": "libvips/colour/Lab2LCh.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 49, + 115 + ], + [ + 116, + 124 + ], + [ + 128, + 149 + ], + [ + 158, + 172 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 52, + 53 + ], + [ + 59, + 60 + ], + [ + 62, + 63 + ], + [ + 68, + 70 + ], + [ + 71, + 72 + ], + [ + 77, + 78 + ], + [ + 79, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 104, + 105 + ], + [ + 106, + 108 + ], + [ + 111, + 112 + ], + [ + 119, + 121 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 137, + 138 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 161, + 162 + ], + [ + 166, + 169 + ], + [ + 170, + 171 + ] + ] + } + }, + { + "filename": "libvips/colour/Lab2LabQ.c", + "line_filter": { + "diff_chunks": [ + [ + 35, + 63 + ], + [ + 75, + 82 + ], + [ + 83, + 121 + ], + [ + 122, + 150 + ], + [ + 168, + 182 + ] + ], + "lines_added": [ + [ + 38, + 54 + ], + [ + 59, + 60 + ], + [ + 78, + 79 + ], + [ + 86, + 87 + ], + [ + 88, + 90 + ], + [ + 93, + 94 + ], + [ + 98, + 99 + ], + [ + 100, + 114 + ], + [ + 117, + 118 + ], + [ + 125, + 126 + ], + [ + 127, + 128 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 137, + 138 + ], + [ + 143, + 144 + ], + [ + 145, + 147 + ], + [ + 171, + 172 + ], + [ + 176, + 179 + ], + [ + 180, + 181 + ] + ] + } + }, + { + "filename": "libvips/colour/Lab2LabS.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 51, + 67 + ], + [ + 71, + 93 + ], + [ + 110, + 124 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 59, + 61 + ], + [ + 63, + 64 + ], + [ + 74, + 75 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 86, + 87 + ], + [ + 88, + 90 + ], + [ + 113, + 114 + ], + [ + 118, + 121 + ], + [ + 122, + 123 + ] + ] + } + }, + { + "filename": "libvips/colour/Lab2XYZ.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 64, + 71 + ], + [ + 78, + 93 + ], + [ + 96, + 109 + ], + [ + 111, + 129 + ], + [ + 131, + 138 + ], + [ + 143, + 197 + ], + [ + 209, + 231 + ], + [ + 237, + 253 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 67, + 68 + ], + [ + 81, + 82 + ], + [ + 84, + 86 + ], + [ + 89, + 90 + ], + [ + 99, + 100 + ], + [ + 105, + 106 + ], + [ + 114, + 115 + ], + [ + 117, + 119 + ], + [ + 122, + 124 + ], + [ + 125, + 126 + ], + [ + 134, + 135 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 151, + 155 + ], + [ + 160, + 162 + ], + [ + 163, + 164 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 177, + 178 + ], + [ + 182, + 185 + ], + [ + 186, + 188 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 212, + 213 + ], + [ + 218, + 219 + ], + [ + 223, + 226 + ], + [ + 227, + 228 + ], + [ + 240, + 241 + ], + [ + 244, + 245 + ], + [ + 251, + 252 + ] + ] + } + }, + { + "filename": "libvips/colour/LabQ2Lab.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 17 + ], + [ + 22, + 50 + ], + [ + 62, + 69 + ], + [ + 72, + 109 + ], + [ + 110, + 138 + ], + [ + 154, + 168 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 25, + 26 + ], + [ + 27, + 31 + ], + [ + 32, + 41 + ], + [ + 46, + 47 + ], + [ + 65, + 66 + ], + [ + 75, + 76 + ], + [ + 77, + 79 + ], + [ + 81, + 83 + ], + [ + 86, + 87 + ], + [ + 93, + 94 + ], + [ + 99, + 100 + ], + [ + 104, + 106 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ], + [ + 119, + 120 + ], + [ + 122, + 123 + ], + [ + 125, + 126 + ], + [ + 131, + 132 + ], + [ + 133, + 135 + ], + [ + 157, + 158 + ], + [ + 162, + 165 + ], + [ + 166, + 167 + ] + ] + } + }, + { + "filename": "libvips/colour/LabQ2LabS.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 53, + 74 + ], + [ + 95, + 117 + ], + [ + 133, + 147 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 56, + 57 + ], + [ + 61, + 62 + ], + [ + 63, + 65 + ], + [ + 70, + 71 + ], + [ + 98, + 99 + ], + [ + 101, + 102 + ], + [ + 104, + 105 + ], + [ + 110, + 111 + ], + [ + 112, + 114 + ], + [ + 136, + 137 + ], + [ + 141, + 144 + ], + [ + 145, + 146 + ] + ] + } + }, + { + "filename": "libvips/colour/LabQ2sRGB.c", + "line_filter": { + "diff_chunks": [ + [ + 28, + 59 + ], + [ + 60, + 67 + ], + [ + 69, + 78 + ], + [ + 81, + 88 + ], + [ + 93, + 100 + ], + [ + 101, + 147 + ], + [ + 148, + 210 + ], + [ + 225, + 238 + ], + [ + 248, + 273 + ], + [ + 279, + 308 + ], + [ + 312, + 368 + ], + [ + 378, + 388 + ], + [ + 393, + 478 + ], + [ + 481, + 503 + ], + [ + 504, + 542 + ], + [ + 558, + 572 + ] + ], + "lines_added": [ + [ + 31, + 47 + ], + [ + 52, + 53 + ], + [ + 55, + 56 + ], + [ + 63, + 64 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 84, + 85 + ], + [ + 96, + 97 + ], + [ + 104, + 105 + ], + [ + 109, + 111 + ], + [ + 115, + 116 + ], + [ + 118, + 119 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 129, + 131 + ], + [ + 134, + 135 + ], + [ + 138, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ], + [ + 157, + 158 + ], + [ + 162, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 194, + 195 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 228, + 229 + ], + [ + 234, + 235 + ], + [ + 251, + 252 + ], + [ + 253, + 256 + ], + [ + 257, + 259 + ], + [ + 260, + 261 + ], + [ + 266, + 270 + ], + [ + 282, + 283 + ], + [ + 284, + 288 + ], + [ + 289, + 290 + ], + [ + 294, + 305 + ], + [ + 315, + 316 + ], + [ + 318, + 319 + ], + [ + 321, + 322 + ], + [ + 324, + 325 + ], + [ + 327, + 328 + ], + [ + 330, + 331 + ], + [ + 332, + 334 + ], + [ + 335, + 337 + ], + [ + 339, + 341 + ], + [ + 344, + 345 + ], + [ + 348, + 350 + ], + [ + 353, + 355 + ], + [ + 357, + 358 + ], + [ + 363, + 365 + ], + [ + 381, + 383 + ], + [ + 384, + 385 + ], + [ + 396, + 397 + ], + [ + 399, + 400 + ], + [ + 401, + 403 + ], + [ + 404, + 406 + ], + [ + 408, + 409 + ], + [ + 412, + 413 + ], + [ + 416, + 417 + ], + [ + 420, + 421 + ], + [ + 423, + 424 + ], + [ + 426, + 427 + ], + [ + 428, + 429 + ], + [ + 431, + 457 + ], + [ + 460, + 461 + ], + [ + 464, + 465 + ], + [ + 470, + 472 + ], + [ + 474, + 475 + ], + [ + 484, + 486 + ], + [ + 487, + 490 + ], + [ + 495, + 498 + ], + [ + 499, + 500 + ], + [ + 507, + 510 + ], + [ + 513, + 517 + ], + [ + 518, + 520 + ], + [ + 523, + 524 + ], + [ + 526, + 527 + ], + [ + 529, + 530 + ], + [ + 535, + 536 + ], + [ + 537, + 539 + ], + [ + 561, + 562 + ], + [ + 566, + 569 + ], + [ + 570, + 571 + ] + ] + } + }, + { + "filename": "libvips/colour/LabS2Lab.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 8, + 36 + ], + [ + 47, + 65 + ], + [ + 69, + 91 + ], + [ + 108, + 122 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 27 + ], + [ + 32, + 33 + ], + [ + 50, + 51 + ], + [ + 55, + 56 + ], + [ + 61, + 62 + ], + [ + 72, + 73 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 84, + 85 + ], + [ + 86, + 88 + ], + [ + 111, + 112 + ], + [ + 116, + 119 + ], + [ + 120, + 121 + ] + ] + } + }, + { + "filename": "libvips/colour/LabS2LabQ.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 58, + 102 + ], + [ + 118, + 140 + ], + [ + 158, + 172 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 61, + 62 + ], + [ + 66, + 67 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 86, + 87 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 127, + 128 + ], + [ + 133, + 134 + ], + [ + 135, + 137 + ], + [ + 161, + 162 + ], + [ + 166, + 169 + ], + [ + 170, + 171 + ] + ] + } + }, + { + "filename": "libvips/colour/UCS2LCh.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 43 + ], + [ + 61, + 137 + ], + [ + 145, + 182 + ], + [ + 190, + 256 + ], + [ + 262, + 283 + ], + [ + 290, + 309 + ] + ], + "lines_added": [ + [ + 18, + 34 + ], + [ + 39, + 40 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 74, + 76 + ], + [ + 77, + 78 + ], + [ + 82, + 83 + ], + [ + 85, + 86 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 98, + 100 + ], + [ + 101, + 102 + ], + [ + 106, + 107 + ], + [ + 109, + 110 + ], + [ + 114, + 115 + ], + [ + 117, + 118 + ], + [ + 122, + 125 + ], + [ + 126, + 128 + ], + [ + 130, + 131 + ], + [ + 133, + 134 + ], + [ + 148, + 150 + ], + [ + 152, + 154 + ], + [ + 155, + 157 + ], + [ + 163, + 164 + ], + [ + 170, + 172 + ], + [ + 174, + 176 + ], + [ + 177, + 179 + ], + [ + 193, + 195 + ], + [ + 201, + 202 + ], + [ + 203, + 205 + ], + [ + 206, + 208 + ], + [ + 211, + 213 + ], + [ + 217, + 218 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 236, + 237 + ], + [ + 243, + 244 + ], + [ + 250, + 253 + ], + [ + 265, + 266 + ], + [ + 268, + 269 + ], + [ + 271, + 272 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 293, + 294 + ], + [ + 298, + 299 + ], + [ + 303, + 306 + ], + [ + 307, + 308 + ] + ] + } + }, + { + "filename": "libvips/colour/XYZ2CMYK.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 60, + 133 + ], + [ + 138, + 145 + ], + [ + 147, + 154 + ], + [ + 155, + 175 + ], + [ + 177, + 203 + ], + [ + 218, + 240 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 63, + 64 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 83, + 85 + ], + [ + 87, + 88 + ], + [ + 89, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 105 + ], + [ + 110, + 111 + ], + [ + 115, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 141, + 142 + ], + [ + 150, + 151 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 168, + 172 + ], + [ + 180, + 181 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 190, + 192 + ], + [ + 196, + 197 + ], + [ + 198, + 200 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 229, + 230 + ], + [ + 234, + 237 + ], + [ + 238, + 239 + ] + ] + } + }, + { + "filename": "libvips/colour/XYZ2Lab.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 23, + 51 + ], + [ + 62, + 69 + ], + [ + 74, + 81 + ], + [ + 88, + 120 + ], + [ + 126, + 141 + ], + [ + 146, + 153 + ], + [ + 154, + 161 + ], + [ + 163, + 170 + ], + [ + 182, + 251 + ], + [ + 264, + 283 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 26, + 27 + ], + [ + 28, + 32 + ], + [ + 33, + 42 + ], + [ + 47, + 48 + ], + [ + 65, + 66 + ], + [ + 77, + 78 + ], + [ + 91, + 92 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 101, + 102 + ], + [ + 103, + 105 + ], + [ + 107, + 108 + ], + [ + 111, + 113 + ], + [ + 116, + 117 + ], + [ + 129, + 130 + ], + [ + 133, + 134 + ], + [ + 137, + 138 + ], + [ + 149, + 150 + ], + [ + 157, + 158 + ], + [ + 166, + 167 + ], + [ + 185, + 186 + ], + [ + 189, + 190 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 205, + 209 + ], + [ + 214, + 216 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 231, + 232 + ], + [ + 236, + 239 + ], + [ + 240, + 242 + ], + [ + 245, + 246 + ], + [ + 247, + 248 + ], + [ + 267, + 268 + ], + [ + 272, + 273 + ], + [ + 277, + 280 + ], + [ + 281, + 282 + ] + ] + } + }, + { + "filename": "libvips/colour/XYZ2Yxy.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 12, + 40 + ], + [ + 52, + 69 + ], + [ + 72, + 79 + ], + [ + 83, + 104 + ], + [ + 113, + 127 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 60, + 62 + ], + [ + 65, + 66 + ], + [ + 75, + 76 + ], + [ + 86, + 87 + ], + [ + 89, + 90 + ], + [ + 92, + 93 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 116, + 117 + ], + [ + 121, + 124 + ], + [ + 125, + 126 + ] + ] + } + }, + { + "filename": "libvips/colour/XYZ2scRGB.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 10, + 38 + ], + [ + 50, + 83 + ], + [ + 85, + 92 + ], + [ + 96, + 117 + ], + [ + 126, + 140 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 29 + ], + [ + 34, + 35 + ], + [ + 53, + 54 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 72, + 73 + ], + [ + 74, + 76 + ], + [ + 79, + 80 + ], + [ + 88, + 89 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 105, + 106 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 129, + 130 + ], + [ + 134, + 137 + ], + [ + 138, + 139 + ] + ] + } + }, + { + "filename": "libvips/colour/Yxy2XYZ.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 14, + 42 + ], + [ + 54, + 79 + ], + [ + 94, + 115 + ], + [ + 124, + 138 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 62, + 64 + ], + [ + 67, + 68 + ], + [ + 74, + 76 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 127, + 128 + ], + [ + 132, + 135 + ], + [ + 136, + 137 + ] + ] + } + }, + { + "filename": "libvips/colour/colour.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 53, + 61 + ], + [ + 66, + 91 + ], + [ + 97, + 110 + ], + [ + 112, + 136 + ], + [ + 138, + 157 + ], + [ + 216, + 368 + ], + [ + 370, + 425 + ], + [ + 427, + 492 + ], + [ + 496, + 511 + ], + [ + 512, + 702 + ], + [ + 707, + 752 + ], + [ + 768, + 787 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 56, + 58 + ], + [ + 69, + 72 + ], + [ + 73, + 75 + ], + [ + 80, + 82 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 100, + 102 + ], + [ + 106, + 107 + ], + [ + 115, + 116 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 126, + 127 + ], + [ + 132, + 133 + ], + [ + 141, + 144 + ], + [ + 147, + 148 + ], + [ + 152, + 154 + ], + [ + 219, + 220 + ], + [ + 226, + 228 + ], + [ + 230, + 233 + ], + [ + 237, + 243 + ], + [ + 244, + 246 + ], + [ + 247, + 248 + ], + [ + 249, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 268, + 270 + ], + [ + 272, + 273 + ], + [ + 278, + 281 + ], + [ + 283, + 285 + ], + [ + 286, + 290 + ], + [ + 291, + 294 + ], + [ + 298, + 299 + ], + [ + 301, + 303 + ], + [ + 307, + 321 + ], + [ + 324, + 325 + ], + [ + 327, + 333 + ], + [ + 339, + 343 + ], + [ + 349, + 352 + ], + [ + 353, + 358 + ], + [ + 361, + 362 + ], + [ + 363, + 365 + ], + [ + 373, + 377 + ], + [ + 379, + 384 + ], + [ + 385, + 387 + ], + [ + 392, + 393 + ], + [ + 394, + 395 + ], + [ + 398, + 399 + ], + [ + 400, + 403 + ], + [ + 408, + 409 + ], + [ + 413, + 418 + ], + [ + 421, + 422 + ], + [ + 430, + 432 + ], + [ + 434, + 435 + ], + [ + 436, + 439 + ], + [ + 442, + 446 + ], + [ + 449, + 450 + ], + [ + 452, + 453 + ], + [ + 459, + 461 + ], + [ + 462, + 463 + ], + [ + 466, + 467 + ], + [ + 468, + 470 + ], + [ + 475, + 476 + ], + [ + 478, + 483 + ], + [ + 486, + 487 + ], + [ + 488, + 489 + ], + [ + 499, + 500 + ], + [ + 502, + 503 + ], + [ + 504, + 508 + ], + [ + 515, + 516 + ], + [ + 517, + 520 + ], + [ + 523, + 527 + ], + [ + 528, + 529 + ], + [ + 531, + 534 + ], + [ + 537, + 538 + ], + [ + 540, + 544 + ], + [ + 548, + 549 + ], + [ + 552, + 554 + ], + [ + 555, + 556 + ], + [ + 559, + 560 + ], + [ + 561, + 563 + ], + [ + 568, + 569 + ], + [ + 571, + 576 + ], + [ + 579, + 580 + ], + [ + 586, + 588 + ], + [ + 590, + 591 + ], + [ + 592, + 594 + ], + [ + 599, + 600 + ], + [ + 604, + 607 + ], + [ + 610, + 613 + ], + [ + 616, + 617 + ], + [ + 620, + 625 + ], + [ + 628, + 633 + ], + [ + 638, + 642 + ], + [ + 645, + 649 + ], + [ + 652, + 654 + ], + [ + 658, + 659 + ], + [ + 663, + 665 + ], + [ + 666, + 667 + ], + [ + 670, + 671 + ], + [ + 672, + 674 + ], + [ + 679, + 680 + ], + [ + 682, + 693 + ], + [ + 696, + 697 + ], + [ + 698, + 699 + ], + [ + 710, + 711 + ], + [ + 712, + 741 + ], + [ + 742, + 745 + ], + [ + 746, + 749 + ], + [ + 771, + 773 + ], + [ + 777, + 778 + ], + [ + 783, + 786 + ] + ] + } + }, + { + "filename": "libvips/colour/colourspace.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 24 + ], + [ + 25, + 53 + ], + [ + 69, + 84 + ], + [ + 85, + 112 + ], + [ + 113, + 193 + ], + [ + 241, + 251 + ], + [ + 256, + 265 + ], + [ + 268, + 279 + ], + [ + 280, + 294 + ], + [ + 296, + 314 + ], + [ + 321, + 419 + ], + [ + 424, + 436 + ], + [ + 437, + 454 + ], + [ + 459, + 588 + ], + [ + 599, + 606 + ], + [ + 611, + 626 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 20, + 21 + ], + [ + 28, + 29 + ], + [ + 30, + 34 + ], + [ + 35, + 44 + ], + [ + 49, + 50 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 80, + 81 + ], + [ + 88, + 89 + ], + [ + 90, + 94 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 102, + 106 + ], + [ + 108, + 109 + ], + [ + 116, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 136 + ], + [ + 138, + 139 + ], + [ + 140, + 143 + ], + [ + 145, + 147 + ], + [ + 149, + 150 + ], + [ + 153, + 154 + ], + [ + 160, + 162 + ], + [ + 163, + 164 + ], + [ + 167, + 168 + ], + [ + 169, + 172 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 180, + 183 + ], + [ + 185, + 186 + ], + [ + 188, + 190 + ], + [ + 244, + 245 + ], + [ + 246, + 248 + ], + [ + 259, + 262 + ], + [ + 271, + 276 + ], + [ + 283, + 291 + ], + [ + 299, + 304 + ], + [ + 310, + 311 + ], + [ + 324, + 325 + ], + [ + 326, + 328 + ], + [ + 330, + 332 + ], + [ + 336, + 340 + ], + [ + 343, + 344 + ], + [ + 349, + 354 + ], + [ + 357, + 358 + ], + [ + 359, + 361 + ], + [ + 364, + 368 + ], + [ + 372, + 373 + ], + [ + 376, + 382 + ], + [ + 384, + 387 + ], + [ + 388, + 389 + ], + [ + 391, + 396 + ], + [ + 399, + 400 + ], + [ + 401, + 403 + ], + [ + 408, + 409 + ], + [ + 413, + 414 + ], + [ + 415, + 416 + ], + [ + 427, + 428 + ], + [ + 432, + 433 + ], + [ + 440, + 442 + ], + [ + 444, + 447 + ], + [ + 448, + 449 + ], + [ + 462, + 463 + ], + [ + 465, + 466 + ], + [ + 467, + 468 + ], + [ + 471, + 475 + ], + [ + 480, + 482 + ], + [ + 488, + 492 + ], + [ + 494, + 495 + ], + [ + 497, + 498 + ], + [ + 502, + 503 + ], + [ + 507, + 509 + ], + [ + 510, + 511 + ], + [ + 513, + 516 + ], + [ + 517, + 525 + ], + [ + 527, + 530 + ], + [ + 533, + 536 + ], + [ + 537, + 538 + ], + [ + 541, + 542 + ], + [ + 543, + 546 + ], + [ + 551, + 552 + ], + [ + 556, + 559 + ], + [ + 560, + 561 + ], + [ + 562, + 567 + ], + [ + 568, + 581 + ], + [ + 584, + 585 + ], + [ + 602, + 603 + ], + [ + 614, + 616 + ], + [ + 620, + 623 + ], + [ + 624, + 625 + ] + ] + } + }, + { + "filename": "libvips/colour/dE00.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 51, + 58 + ], + [ + 62, + 172 + ], + [ + 181, + 188 + ], + [ + 197, + 211 + ], + [ + 212, + 221 + ], + [ + 222, + 243 + ], + [ + 253, + 267 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 54, + 55 + ], + [ + 65, + 68 + ], + [ + 72, + 75 + ], + [ + 76, + 105 + ], + [ + 108, + 110 + ], + [ + 115, + 116 + ], + [ + 122, + 124 + ], + [ + 128, + 130 + ], + [ + 135, + 136 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 152 + ], + [ + 156, + 157 + ], + [ + 162, + 163 + ], + [ + 168, + 169 + ], + [ + 184, + 185 + ], + [ + 200, + 201 + ], + [ + 206, + 208 + ], + [ + 215, + 218 + ], + [ + 225, + 226 + ], + [ + 228, + 229 + ], + [ + 231, + 232 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 256, + 257 + ], + [ + 261, + 264 + ], + [ + 265, + 266 + ] + ] + } + }, + { + "filename": "libvips/colour/dE76.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 12, + 40 + ], + [ + 56, + 63 + ], + [ + 70, + 103 + ], + [ + 104, + 125 + ], + [ + 135, + 149 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 59, + 60 + ], + [ + 73, + 74 + ], + [ + 79, + 80 + ], + [ + 85, + 87 + ], + [ + 88, + 91 + ], + [ + 94, + 95 + ], + [ + 99, + 100 + ], + [ + 107, + 108 + ], + [ + 110, + 111 + ], + [ + 113, + 114 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 138, + 139 + ], + [ + 143, + 146 + ], + [ + 147, + 148 + ] + ] + } + }, + { + "filename": "libvips/colour/dECMC.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 49, + 73 + ], + [ + 79, + 86 + ], + [ + 90, + 104 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 52, + 53 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 62 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 82, + 83 + ], + [ + 93, + 94 + ], + [ + 98, + 101 + ], + [ + 102, + 103 + ] + ] + } + }, + { + "filename": "libvips/colour/float2rad.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 12, + 47 + ], + [ + 116, + 174 + ], + [ + 176, + 215 + ], + [ + 233, + 247 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 42, + 44 + ], + [ + 119, + 128 + ], + [ + 129, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 142, + 171 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 187, + 189 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 201, + 203 + ], + [ + 208, + 209 + ], + [ + 210, + 212 + ], + [ + 236, + 237 + ], + [ + 241, + 244 + ], + [ + 245, + 246 + ] + ] + } + }, + { + "filename": "libvips/colour/icc_transform.c", + "line_filter": { + "diff_chunks": [ + [ + 41, + 48 + ], + [ + 49, + 84 + ], + [ + 108, + 115 + ], + [ + 118, + 156 + ], + [ + 171, + 316 + ], + [ + 323, + 377 + ], + [ + 394, + 424 + ], + [ + 425, + 465 + ], + [ + 478, + 531 + ], + [ + 534, + 620 + ], + [ + 631, + 693 + ], + [ + 694, + 729 + ], + [ + 739, + 769 + ], + [ + 770, + 828 + ], + [ + 835, + 889 + ], + [ + 895, + 907 + ], + [ + 909, + 982 + ], + [ + 984, + 1017 + ], + [ + 1025, + 1033 + ], + [ + 1040, + 1094 + ], + [ + 1102, + 1203 + ], + [ + 1214, + 1221 + ], + [ + 1225, + 1322 + ], + [ + 1323, + 1348 + ], + [ + 1361, + 1380 + ], + [ + 1381, + 1397 + ], + [ + 1407, + 1419 + ], + [ + 1420, + 1436 + ], + [ + 1458, + 1492 + ] + ], + "lines_added": [ + [ + 44, + 45 + ], + [ + 52, + 53 + ], + [ + 54, + 58 + ], + [ + 59, + 68 + ], + [ + 73, + 74 + ], + [ + 80, + 81 + ], + [ + 111, + 112 + ], + [ + 121, + 123 + ], + [ + 129, + 130 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 140, + 152 + ], + [ + 174, + 175 + ], + [ + 180, + 181 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 190, + 193 + ], + [ + 194, + 196 + ], + [ + 199, + 201 + ], + [ + 204, + 205 + ], + [ + 210, + 211 + ], + [ + 212, + 214 + ], + [ + 219, + 223 + ], + [ + 226, + 242 + ], + [ + 245, + 246 + ], + [ + 247, + 248 + ], + [ + 249, + 252 + ], + [ + 253, + 254 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 266, + 271 + ], + [ + 273, + 284 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 290, + 294 + ], + [ + 297, + 301 + ], + [ + 305, + 306 + ], + [ + 312, + 313 + ], + [ + 326, + 335 + ], + [ + 338, + 340 + ], + [ + 343, + 346 + ], + [ + 347, + 353 + ], + [ + 355, + 356 + ], + [ + 357, + 358 + ], + [ + 359, + 365 + ], + [ + 368, + 374 + ], + [ + 397, + 399 + ], + [ + 400, + 404 + ], + [ + 407, + 409 + ], + [ + 410, + 411 + ], + [ + 414, + 415 + ], + [ + 416, + 421 + ], + [ + 428, + 429 + ], + [ + 431, + 436 + ], + [ + 437, + 439 + ], + [ + 440, + 441 + ], + [ + 446, + 447 + ], + [ + 451, + 455 + ], + [ + 456, + 457 + ], + [ + 461, + 462 + ], + [ + 481, + 487 + ], + [ + 489, + 495 + ], + [ + 498, + 502 + ], + [ + 503, + 504 + ], + [ + 505, + 508 + ], + [ + 509, + 520 + ], + [ + 521, + 525 + ], + [ + 526, + 528 + ], + [ + 537, + 539 + ], + [ + 543, + 544 + ], + [ + 546, + 550 + ], + [ + 552, + 556 + ], + [ + 559, + 560 + ], + [ + 562, + 573 + ], + [ + 577, + 578 + ], + [ + 579, + 583 + ], + [ + 585, + 591 + ], + [ + 593, + 594 + ], + [ + 596, + 597 + ], + [ + 601, + 603 + ], + [ + 604, + 605 + ], + [ + 607, + 610 + ], + [ + 613, + 614 + ], + [ + 616, + 617 + ], + [ + 634, + 636 + ], + [ + 637, + 638 + ], + [ + 644, + 649 + ], + [ + 653, + 654 + ], + [ + 655, + 661 + ], + [ + 666, + 674 + ], + [ + 677, + 681 + ], + [ + 683, + 684 + ], + [ + 687, + 688 + ], + [ + 689, + 690 + ], + [ + 697, + 698 + ], + [ + 700, + 703 + ], + [ + 704, + 706 + ], + [ + 707, + 710 + ], + [ + 711, + 713 + ], + [ + 714, + 717 + ], + [ + 718, + 720 + ], + [ + 721, + 722 + ], + [ + 725, + 726 + ], + [ + 742, + 743 + ], + [ + 745, + 746 + ], + [ + 751, + 754 + ], + [ + 755, + 756 + ], + [ + 757, + 758 + ], + [ + 759, + 760 + ], + [ + 761, + 762 + ], + [ + 764, + 766 + ], + [ + 773, + 775 + ], + [ + 778, + 781 + ], + [ + 783, + 784 + ], + [ + 786, + 788 + ], + [ + 791, + 795 + ], + [ + 796, + 799 + ], + [ + 805, + 807 + ], + [ + 810, + 814 + ], + [ + 815, + 818 + ], + [ + 823, + 825 + ], + [ + 838, + 840 + ], + [ + 841, + 842 + ], + [ + 843, + 845 + ], + [ + 846, + 847 + ], + [ + 848, + 849 + ], + [ + 854, + 855 + ], + [ + 856, + 857 + ], + [ + 858, + 859 + ], + [ + 864, + 865 + ], + [ + 869, + 875 + ], + [ + 876, + 882 + ], + [ + 885, + 886 + ], + [ + 898, + 899 + ], + [ + 901, + 902 + ], + [ + 903, + 904 + ], + [ + 912, + 913 + ], + [ + 914, + 916 + ], + [ + 917, + 918 + ], + [ + 919, + 920 + ], + [ + 921, + 922 + ], + [ + 923, + 924 + ], + [ + 926, + 929 + ], + [ + 930, + 935 + ], + [ + 938, + 943 + ], + [ + 945, + 947 + ], + [ + 948, + 949 + ], + [ + 954, + 956 + ], + [ + 959, + 960 + ], + [ + 964, + 965 + ], + [ + 966, + 967 + ], + [ + 969, + 970 + ], + [ + 971, + 972 + ], + [ + 973, + 974 + ], + [ + 975, + 976 + ], + [ + 978, + 979 + ], + [ + 987, + 988 + ], + [ + 991, + 993 + ], + [ + 996, + 997 + ], + [ + 1001, + 1002 + ], + [ + 1003, + 1004 + ], + [ + 1006, + 1007 + ], + [ + 1008, + 1009 + ], + [ + 1011, + 1012 + ], + [ + 1013, + 1014 + ], + [ + 1028, + 1030 + ], + [ + 1043, + 1045 + ], + [ + 1046, + 1048 + ], + [ + 1049, + 1050 + ], + [ + 1051, + 1052 + ], + [ + 1054, + 1055 + ], + [ + 1059, + 1060 + ], + [ + 1061, + 1062 + ], + [ + 1063, + 1064 + ], + [ + 1069, + 1070 + ], + [ + 1074, + 1087 + ], + [ + 1090, + 1091 + ], + [ + 1105, + 1106 + ], + [ + 1108, + 1109 + ], + [ + 1110, + 1111 + ], + [ + 1115, + 1118 + ], + [ + 1119, + 1123 + ], + [ + 1126, + 1129 + ], + [ + 1130, + 1133 + ], + [ + 1135, + 1137 + ], + [ + 1138, + 1139 + ], + [ + 1144, + 1146 + ], + [ + 1149, + 1150 + ], + [ + 1153, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1157, + 1158 + ], + [ + 1163, + 1165 + ], + [ + 1169, + 1175 + ], + [ + 1176, + 1196 + ], + [ + 1199, + 1200 + ], + [ + 1217, + 1218 + ], + [ + 1228, + 1231 + ], + [ + 1232, + 1233 + ], + [ + 1235, + 1236 + ], + [ + 1238, + 1242 + ], + [ + 1248, + 1249 + ], + [ + 1252, + 1254 + ], + [ + 1256, + 1259 + ], + [ + 1262, + 1263 + ], + [ + 1269, + 1270 + ], + [ + 1272, + 1275 + ], + [ + 1276, + 1277 + ], + [ + 1281, + 1282 + ], + [ + 1287, + 1289 + ], + [ + 1291, + 1292 + ], + [ + 1293, + 1295 + ], + [ + 1296, + 1297 + ], + [ + 1299, + 1300 + ], + [ + 1302, + 1314 + ], + [ + 1316, + 1317 + ], + [ + 1318, + 1319 + ], + [ + 1326, + 1327 + ], + [ + 1328, + 1329 + ], + [ + 1332, + 1333 + ], + [ + 1334, + 1336 + ], + [ + 1337, + 1338 + ], + [ + 1341, + 1343 + ], + [ + 1344, + 1345 + ], + [ + 1364, + 1365 + ], + [ + 1368, + 1369 + ], + [ + 1372, + 1373 + ], + [ + 1376, + 1377 + ], + [ + 1384, + 1385 + ], + [ + 1389, + 1392 + ], + [ + 1393, + 1394 + ], + [ + 1410, + 1411 + ], + [ + 1412, + 1416 + ], + [ + 1423, + 1424 + ], + [ + 1428, + 1431 + ], + [ + 1432, + 1433 + ], + [ + 1461, + 1462 + ], + [ + 1465, + 1466 + ], + [ + 1471, + 1472 + ], + [ + 1473, + 1474 + ], + [ + 1479, + 1481 + ], + [ + 1485, + 1489 + ], + [ + 1490, + 1491 + ] + ] + } + }, + { + "filename": "libvips/colour/pcolour.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 66 + ], + [ + 68, + 75 + ], + [ + 93, + 118 + ], + [ + 125, + 150 + ], + [ + 163, + 188 + ], + [ + 200, + 210 + ], + [ + 211, + 229 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 56, + 58 + ], + [ + 62, + 63 + ], + [ + 71, + 72 + ], + [ + 96, + 97 + ], + [ + 102, + 114 + ], + [ + 128, + 129 + ], + [ + 134, + 146 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 172, + 184 + ], + [ + 203, + 204 + ], + [ + 205, + 207 + ], + [ + 214, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 223 + ] + ] + } + }, + { + "filename": "libvips/colour/profile_load.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 56, + 181 + ], + [ + 192, + 235 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 59, + 60 + ], + [ + 62, + 63 + ], + [ + 67, + 69 + ], + [ + 75, + 78 + ], + [ + 79, + 80 + ], + [ + 83, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 94 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 108, + 109 + ], + [ + 110, + 112 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ], + [ + 117, + 122 + ], + [ + 123, + 126 + ], + [ + 128, + 129 + ], + [ + 130, + 132 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 148, + 149 + ], + [ + 151, + 164 + ], + [ + 167, + 168 + ], + [ + 172, + 173 + ], + [ + 177, + 178 + ], + [ + 195, + 196 + ], + [ + 200, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 208 + ], + [ + 210, + 211 + ], + [ + 214, + 216 + ], + [ + 217, + 218 + ], + [ + 220, + 224 + ], + [ + 225, + 227 + ], + [ + 228, + 230 + ], + [ + 233, + 234 + ] + ] + } + }, + { + "filename": "libvips/colour/profiles.h", + "line_filter": { + "diff_chunks": [ + [ + 10, + 13 + ] + ], + "lines_added": [] + } + }, + { + "filename": "libvips/colour/rad2float.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 12, + 47 + ], + [ + 116, + 153 + ], + [ + 156, + 194 + ], + [ + 210, + 224 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 42, + 44 + ], + [ + 119, + 128 + ], + [ + 129, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 145, + 146 + ], + [ + 147, + 150 + ], + [ + 159, + 160 + ], + [ + 162, + 163 + ], + [ + 169, + 171 + ], + [ + 174, + 175 + ], + [ + 177, + 178 + ], + [ + 180, + 182 + ], + [ + 187, + 188 + ], + [ + 189, + 191 + ], + [ + 213, + 214 + ], + [ + 218, + 221 + ], + [ + 222, + 223 + ] + ] + } + }, + { + "filename": "libvips/colour/sRGB2HSV.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 45, + 120 + ], + [ + 124, + 146 + ], + [ + 160, + 167 + ], + [ + 168, + 182 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 48, + 49 + ], + [ + 51, + 52 + ], + [ + 58, + 59 + ], + [ + 64, + 66 + ], + [ + 72, + 73 + ], + [ + 77, + 78 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 90, + 91 + ], + [ + 95, + 96 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 127, + 128 + ], + [ + 130, + 131 + ], + [ + 133, + 134 + ], + [ + 139, + 140 + ], + [ + 141, + 143 + ], + [ + 163, + 164 + ], + [ + 171, + 172 + ], + [ + 176, + 179 + ], + [ + 180, + 181 + ] + ] + } + }, + { + "filename": "libvips/colour/sRGB2scRGB.c", + "line_filter": { + "diff_chunks": [ + [ + 23, + 51 + ], + [ + 69, + 91 + ], + [ + 93, + 101 + ], + [ + 105, + 112 + ], + [ + 113, + 120 + ], + [ + 124, + 137 + ], + [ + 139, + 147 + ], + [ + 151, + 158 + ], + [ + 159, + 166 + ], + [ + 168, + 299 + ], + [ + 304, + 312 + ], + [ + 313, + 327 + ] + ], + "lines_added": [ + [ + 26, + 42 + ], + [ + 47, + 48 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 81, + 83 + ], + [ + 86, + 88 + ], + [ + 96, + 98 + ], + [ + 108, + 109 + ], + [ + 116, + 117 + ], + [ + 127, + 129 + ], + [ + 132, + 134 + ], + [ + 142, + 144 + ], + [ + 154, + 155 + ], + [ + 162, + 163 + ], + [ + 171, + 173 + ], + [ + 175, + 176 + ], + [ + 180, + 182 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 188, + 190 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 199, + 201 + ], + [ + 202, + 203 + ], + [ + 204, + 206 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 220, + 221 + ], + [ + 226, + 228 + ], + [ + 230, + 237 + ], + [ + 240, + 241 + ], + [ + 245, + 249 + ], + [ + 253, + 258 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 268, + 269 + ], + [ + 270, + 271 + ], + [ + 276, + 277 + ], + [ + 281, + 292 + ], + [ + 295, + 296 + ], + [ + 307, + 309 + ], + [ + 316, + 317 + ], + [ + 321, + 324 + ], + [ + 325, + 326 + ] + ] + } + }, + { + "filename": "libvips/colour/scRGB2BW.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 57, + 82 + ], + [ + 83, + 111 + ], + [ + 112, + 181 + ], + [ + 186, + 261 + ], + [ + 271, + 293 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 61 + ], + [ + 65, + 67 + ], + [ + 70, + 71 + ], + [ + 76, + 77 + ], + [ + 78, + 79 + ], + [ + 86, + 88 + ], + [ + 94, + 96 + ], + [ + 99, + 100 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 115, + 117 + ], + [ + 123, + 125 + ], + [ + 128, + 129 + ], + [ + 133, + 135 + ], + [ + 136, + 137 + ], + [ + 138, + 143 + ], + [ + 144, + 147 + ], + [ + 148, + 150 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 160, + 161 + ], + [ + 163, + 164 + ], + [ + 165, + 166 + ], + [ + 168, + 169 + ], + [ + 170, + 172 + ], + [ + 174, + 176 + ], + [ + 177, + 178 + ], + [ + 189, + 192 + ], + [ + 194, + 196 + ], + [ + 199, + 203 + ], + [ + 208, + 213 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 231, + 232 + ], + [ + 236, + 254 + ], + [ + 257, + 258 + ], + [ + 274, + 276 + ], + [ + 282, + 283 + ], + [ + 287, + 290 + ], + [ + 291, + 292 + ] + ] + } + }, + { + "filename": "libvips/colour/scRGB2XYZ.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 12, + 40 + ], + [ + 52, + 69 + ], + [ + 71, + 78 + ], + [ + 81, + 102 + ], + [ + 111, + 125 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 60, + 62 + ], + [ + 65, + 66 + ], + [ + 74, + 75 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 96, + 97 + ], + [ + 98, + 99 + ], + [ + 114, + 115 + ], + [ + 119, + 122 + ], + [ + 123, + 124 + ] + ] + } + }, + { + "filename": "libvips/colour/scRGB2sRGB.c", + "line_filter": { + "diff_chunks": [ + [ + 31, + 59 + ], + [ + 82, + 106 + ], + [ + 109, + 136 + ], + [ + 139, + 208 + ], + [ + 213, + 287 + ], + [ + 297, + 319 + ] + ], + "lines_added": [ + [ + 34, + 50 + ], + [ + 55, + 56 + ], + [ + 85, + 86 + ], + [ + 90, + 92 + ], + [ + 95, + 96 + ], + [ + 102, + 103 + ], + [ + 112, + 114 + ], + [ + 120, + 122 + ], + [ + 125, + 126 + ], + [ + 132, + 133 + ], + [ + 142, + 144 + ], + [ + 150, + 152 + ], + [ + 155, + 156 + ], + [ + 160, + 162 + ], + [ + 163, + 164 + ], + [ + 165, + 170 + ], + [ + 171, + 174 + ], + [ + 175, + 177 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 195, + 196 + ], + [ + 197, + 199 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 216, + 219 + ], + [ + 221, + 223 + ], + [ + 226, + 230 + ], + [ + 234, + 239 + ], + [ + 241, + 242 + ], + [ + 243, + 244 + ], + [ + 247, + 248 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ], + [ + 257, + 258 + ], + [ + 262, + 280 + ], + [ + 283, + 284 + ], + [ + 300, + 302 + ], + [ + 308, + 309 + ], + [ + 313, + 316 + ], + [ + 317, + 318 + ] + ] + } + }, + { + "filename": "libvips/conversion/arrayjoin.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 74, + 126 + ], + [ + 129, + 153 + ], + [ + 162, + 230 + ], + [ + 235, + 274 + ], + [ + 285, + 292 + ], + [ + 306, + 430 + ], + [ + 448, + 473 + ], + [ + 477, + 491 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 77, + 78 + ], + [ + 80, + 82 + ], + [ + 85, + 87 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 100 + ], + [ + 104, + 105 + ], + [ + 108, + 111 + ], + [ + 113, + 114 + ], + [ + 116, + 120 + ], + [ + 122, + 123 + ], + [ + 132, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 150 + ], + [ + 165, + 167 + ], + [ + 168, + 169 + ], + [ + 171, + 173 + ], + [ + 176, + 179 + ], + [ + 184, + 188 + ], + [ + 194, + 196 + ], + [ + 197, + 198 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 209, + 210 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 220, + 221 + ], + [ + 225, + 227 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 246, + 248 + ], + [ + 253, + 255 + ], + [ + 260, + 262 + ], + [ + 265, + 266 + ], + [ + 270, + 271 + ], + [ + 288, + 289 + ], + [ + 309, + 314 + ], + [ + 316, + 319 + ], + [ + 323, + 327 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 334, + 337 + ], + [ + 338, + 339 + ], + [ + 344, + 345 + ], + [ + 349, + 352 + ], + [ + 353, + 355 + ], + [ + 356, + 359 + ], + [ + 360, + 362 + ], + [ + 363, + 366 + ], + [ + 367, + 369 + ], + [ + 370, + 373 + ], + [ + 374, + 376 + ], + [ + 377, + 380 + ], + [ + 381, + 383 + ], + [ + 384, + 387 + ], + [ + 388, + 390 + ], + [ + 391, + 394 + ], + [ + 395, + 397 + ], + [ + 398, + 401 + ], + [ + 402, + 404 + ], + [ + 407, + 408 + ], + [ + 411, + 413 + ], + [ + 417, + 418 + ], + [ + 419, + 420 + ], + [ + 422, + 425 + ], + [ + 426, + 427 + ], + [ + 451, + 453 + ], + [ + 457, + 458 + ], + [ + 459, + 460 + ], + [ + 463, + 465 + ], + [ + 468, + 470 + ], + [ + 480, + 481 + ], + [ + 485, + 488 + ], + [ + 489, + 490 + ] + ] + } + }, + { + "filename": "libvips/conversion/autorot.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 44 + ], + [ + 68, + 89 + ], + [ + 94, + 123 + ], + [ + 157, + 232 + ], + [ + 240, + 266 + ] + ], + "lines_added": [ + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 35 + ], + [ + 40, + 41 + ], + [ + 71, + 72 + ], + [ + 74, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 82, + 83 + ], + [ + 85, + 86 + ], + [ + 97, + 98 + ], + [ + 99, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 112 + ], + [ + 119, + 120 + ], + [ + 162, + 163 + ], + [ + 165, + 166 + ], + [ + 167, + 170 + ], + [ + 173, + 176 + ], + [ + 181, + 183 + ], + [ + 185, + 186 + ], + [ + 187, + 189 + ], + [ + 190, + 191 + ], + [ + 194, + 195 + ], + [ + 196, + 198 + ], + [ + 203, + 204 + ], + [ + 206, + 209 + ], + [ + 210, + 211 + ], + [ + 212, + 215 + ], + [ + 216, + 218 + ], + [ + 219, + 222 + ], + [ + 223, + 225 + ], + [ + 228, + 229 + ], + [ + 243, + 244 + ], + [ + 245, + 248 + ], + [ + 249, + 250 + ], + [ + 255, + 256 + ], + [ + 260, + 263 + ], + [ + 264, + 265 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandary.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 32, + 60 + ], + [ + 77, + 108 + ], + [ + 109, + 117 + ], + [ + 119, + 267 + ], + [ + 269, + 284 + ], + [ + 285, + 292 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 80, + 81 + ], + [ + 83, + 84 + ], + [ + 87, + 88 + ], + [ + 90, + 93 + ], + [ + 95, + 97 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 112, + 114 + ], + [ + 122, + 123 + ], + [ + 127, + 130 + ], + [ + 134, + 138 + ], + [ + 143, + 146 + ], + [ + 150, + 154 + ], + [ + 156, + 157 + ], + [ + 160, + 161 + ], + [ + 164, + 166 + ], + [ + 170, + 174 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 181 + ], + [ + 182, + 185 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 199 + ], + [ + 205, + 207 + ], + [ + 208, + 212 + ], + [ + 214, + 217 + ], + [ + 218, + 224 + ], + [ + 226, + 229 + ], + [ + 231, + 233 + ], + [ + 235, + 239 + ], + [ + 240, + 241 + ], + [ + 244, + 245 + ], + [ + 246, + 249 + ], + [ + 250, + 251 + ], + [ + 256, + 257 + ], + [ + 263, + 264 + ], + [ + 272, + 273 + ], + [ + 274, + 276 + ], + [ + 277, + 281 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandary.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 73, + 81 + ], + [ + 103, + 121 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 76, + 78 + ], + [ + 106, + 107 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandbool.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 58, + 171 + ], + [ + 173, + 190 + ], + [ + 204, + 211 + ], + [ + 212, + 260 + ], + [ + 267, + 300 + ], + [ + 308, + 324 + ], + [ + 332, + 348 + ], + [ + 356, + 370 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 61, + 62 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 72, + 79 + ], + [ + 81, + 84 + ], + [ + 88, + 90 + ], + [ + 94, + 96 + ], + [ + 97, + 98 + ], + [ + 100, + 127 + ], + [ + 129, + 130 + ], + [ + 131, + 164 + ], + [ + 166, + 168 + ], + [ + 176, + 179 + ], + [ + 181, + 183 + ], + [ + 185, + 187 + ], + [ + 207, + 208 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 219, + 220 + ], + [ + 225, + 226 + ], + [ + 231, + 234 + ], + [ + 235, + 236 + ], + [ + 237, + 240 + ], + [ + 241, + 244 + ], + [ + 247, + 248 + ], + [ + 253, + 255 + ], + [ + 256, + 257 + ], + [ + 270, + 271 + ], + [ + 276, + 277 + ], + [ + 279, + 280 + ], + [ + 286, + 288 + ], + [ + 292, + 295 + ], + [ + 296, + 297 + ], + [ + 311, + 312 + ], + [ + 316, + 319 + ], + [ + 320, + 321 + ], + [ + 335, + 336 + ], + [ + 340, + 343 + ], + [ + 344, + 345 + ], + [ + 359, + 360 + ], + [ + 364, + 367 + ], + [ + 368, + 369 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandfold.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 8, + 36 + ], + [ + 66, + 83 + ], + [ + 85, + 178 + ], + [ + 188, + 212 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 27 + ], + [ + 32, + 33 + ], + [ + 69, + 70 + ], + [ + 72, + 74 + ], + [ + 78, + 80 + ], + [ + 88, + 90 + ], + [ + 91, + 95 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 112, + 114 + ], + [ + 115, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 124 + ], + [ + 126, + 129 + ], + [ + 133, + 137 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 144, + 147 + ], + [ + 148, + 149 + ], + [ + 154, + 155 + ], + [ + 159, + 162 + ], + [ + 163, + 164 + ], + [ + 165, + 168 + ], + [ + 169, + 171 + ], + [ + 174, + 175 + ], + [ + 191, + 192 + ], + [ + 194, + 195 + ], + [ + 201, + 202 + ], + [ + 206, + 209 + ], + [ + 210, + 211 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandjoin.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 30, + 58 + ], + [ + 85, + 96 + ], + [ + 97, + 124 + ], + [ + 129, + 206 + ], + [ + 209, + 227 + ], + [ + 228, + 244 + ], + [ + 252, + 259 + ], + [ + 261, + 272 + ], + [ + 284, + 305 + ], + [ + 307, + 325 + ], + [ + 326, + 337 + ], + [ + 341, + 355 + ], + [ + 357, + 448 + ], + [ + 452, + 475 + ], + [ + 483, + 499 + ], + [ + 508, + 525 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 49 + ], + [ + 54, + 55 + ], + [ + 88, + 89 + ], + [ + 91, + 93 + ], + [ + 100, + 101 + ], + [ + 107, + 108 + ], + [ + 110, + 111 + ], + [ + 112, + 114 + ], + [ + 119, + 121 + ], + [ + 132, + 133 + ], + [ + 137, + 139 + ], + [ + 140, + 142 + ], + [ + 146, + 149 + ], + [ + 153, + 155 + ], + [ + 156, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 165 + ], + [ + 166, + 167 + ], + [ + 172, + 173 + ], + [ + 177, + 180 + ], + [ + 181, + 183 + ], + [ + 186, + 187 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 198, + 201 + ], + [ + 202, + 203 + ], + [ + 212, + 213 + ], + [ + 217, + 218 + ], + [ + 222, + 224 + ], + [ + 231, + 232 + ], + [ + 236, + 239 + ], + [ + 240, + 241 + ], + [ + 255, + 256 + ], + [ + 264, + 267 + ], + [ + 268, + 269 + ], + [ + 287, + 288 + ], + [ + 290, + 291 + ], + [ + 294, + 295 + ], + [ + 296, + 297 + ], + [ + 300, + 302 + ], + [ + 310, + 311 + ], + [ + 314, + 315 + ], + [ + 318, + 319 + ], + [ + 320, + 322 + ], + [ + 329, + 331 + ], + [ + 333, + 334 + ], + [ + 344, + 346 + ], + [ + 351, + 352 + ], + [ + 360, + 361 + ], + [ + 362, + 363 + ], + [ + 366, + 368 + ], + [ + 371, + 372 + ], + [ + 373, + 376 + ], + [ + 381, + 385 + ], + [ + 387, + 389 + ], + [ + 390, + 391 + ], + [ + 394, + 395 + ], + [ + 396, + 399 + ], + [ + 400, + 401 + ], + [ + 407, + 408 + ], + [ + 412, + 415 + ], + [ + 416, + 417 + ], + [ + 418, + 421 + ], + [ + 422, + 424 + ], + [ + 427, + 428 + ], + [ + 434, + 436 + ], + [ + 437, + 438 + ], + [ + 440, + 443 + ], + [ + 444, + 445 + ], + [ + 455, + 456 + ], + [ + 462, + 463 + ], + [ + 467, + 470 + ], + [ + 471, + 472 + ], + [ + 486, + 487 + ], + [ + 491, + 494 + ], + [ + 495, + 496 + ], + [ + 511, + 512 + ], + [ + 516, + 518 + ], + [ + 520, + 522 + ], + [ + 523, + 524 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandmean.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 41 + ], + [ + 64, + 169 + ], + [ + 170, + 177 + ], + [ + 178, + 221 + ], + [ + 224, + 232 + ], + [ + 234, + 248 + ] + ], + "lines_added": [ + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 32 + ], + [ + 37, + 38 + ], + [ + 67, + 68 + ], + [ + 71, + 86 + ], + [ + 89, + 104 + ], + [ + 107, + 122 + ], + [ + 124, + 126 + ], + [ + 130, + 132 + ], + [ + 135, + 160 + ], + [ + 161, + 163 + ], + [ + 164, + 166 + ], + [ + 173, + 174 + ], + [ + 181, + 184 + ], + [ + 187, + 189 + ], + [ + 190, + 191 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 198, + 199 + ], + [ + 204, + 205 + ], + [ + 209, + 212 + ], + [ + 213, + 214 + ], + [ + 217, + 218 + ], + [ + 227, + 229 + ], + [ + 237, + 238 + ], + [ + 242, + 245 + ], + [ + 246, + 247 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandrank.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 63, + 180 + ], + [ + 181, + 273 + ], + [ + 274, + 290 + ], + [ + 297, + 316 + ], + [ + 319, + 333 + ] + ], + "lines_added": [ + [ + 15, + 31 + ], + [ + 36, + 37 + ], + [ + 66, + 67 + ], + [ + 71, + 72 + ], + [ + 75, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 132 + ], + [ + 133, + 162 + ], + [ + 164, + 165 + ], + [ + 170, + 172 + ], + [ + 176, + 177 + ], + [ + 184, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 201, + 204 + ], + [ + 207, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 218, + 220 + ], + [ + 225, + 227 + ], + [ + 229, + 231 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 238, + 241 + ], + [ + 242, + 243 + ], + [ + 248, + 249 + ], + [ + 253, + 256 + ], + [ + 257, + 259 + ], + [ + 260, + 263 + ], + [ + 264, + 266 + ], + [ + 269, + 270 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 282, + 285 + ], + [ + 286, + 287 + ], + [ + 300, + 302 + ], + [ + 303, + 305 + ], + [ + 306, + 307 + ], + [ + 312, + 313 + ], + [ + 322, + 323 + ], + [ + 327, + 330 + ], + [ + 331, + 332 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandunfold.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 8, + 36 + ], + [ + 66, + 85 + ], + [ + 87, + 181 + ], + [ + 191, + 200 + ], + [ + 201, + 215 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 27 + ], + [ + 32, + 33 + ], + [ + 69, + 70 + ], + [ + 72, + 74 + ], + [ + 79, + 82 + ], + [ + 90, + 92 + ], + [ + 93, + 96 + ], + [ + 97, + 98 + ], + [ + 102, + 103 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ], + [ + 111, + 113 + ], + [ + 115, + 117 + ], + [ + 118, + 120 + ], + [ + 121, + 122 + ], + [ + 123, + 127 + ], + [ + 129, + 132 + ], + [ + 136, + 140 + ], + [ + 141, + 142 + ], + [ + 145, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 152 + ], + [ + 157, + 158 + ], + [ + 162, + 165 + ], + [ + 166, + 167 + ], + [ + 168, + 171 + ], + [ + 172, + 174 + ], + [ + 177, + 178 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 204, + 205 + ], + [ + 209, + 212 + ], + [ + 213, + 214 + ] + ] + } + }, + { + "filename": "libvips/conversion/byteswap.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 64, + 217 + ], + [ + 220, + 252 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 67, + 68 + ], + [ + 72, + 74 + ], + [ + 76, + 77 + ], + [ + 78, + 79 + ], + [ + 80, + 82 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 97 + ], + [ + 102, + 103 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 112 + ], + [ + 114, + 115 + ], + [ + 117, + 127 + ], + [ + 132, + 134 + ], + [ + 137, + 138 + ], + [ + 142, + 143 + ], + [ + 144, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 160, + 161 + ], + [ + 163, + 165 + ], + [ + 168, + 171 + ], + [ + 172, + 174 + ], + [ + 175, + 178 + ], + [ + 179, + 183 + ], + [ + 184, + 185 + ], + [ + 188, + 189 + ], + [ + 190, + 193 + ], + [ + 194, + 195 + ], + [ + 200, + 201 + ], + [ + 205, + 208 + ], + [ + 209, + 210 + ], + [ + 213, + 214 + ], + [ + 223, + 224 + ], + [ + 230, + 231 + ], + [ + 235, + 238 + ], + [ + 239, + 240 + ], + [ + 245, + 246 + ], + [ + 247, + 249 + ], + [ + 250, + 251 + ] + ] + } + }, + { + "filename": "libvips/conversion/cache.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 54, + 133 + ], + [ + 148, + 182 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 57, + 58 + ], + [ + 64, + 65 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 72, + 73 + ], + [ + 74, + 76 + ], + [ + 77, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 88, + 90 + ], + [ + 91, + 92 + ], + [ + 97, + 98 + ], + [ + 100, + 103 + ], + [ + 104, + 105 + ], + [ + 106, + 109 + ], + [ + 110, + 112 + ], + [ + 113, + 116 + ], + [ + 117, + 119 + ], + [ + 120, + 123 + ], + [ + 124, + 126 + ], + [ + 129, + 130 + ], + [ + 151, + 153 + ], + [ + 155, + 156 + ], + [ + 158, + 159 + ], + [ + 164, + 165 + ], + [ + 171, + 172 + ], + [ + 176, + 179 + ], + [ + 180, + 181 + ] + ] + } + }, + { + "filename": "libvips/conversion/cast.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 9 + ], + [ + 60, + 88 + ], + [ + 116, + 561 + ], + [ + 571, + 583 + ], + [ + 584, + 600 + ], + [ + 602, + 623 + ], + [ + 625, + 646 + ], + [ + 648, + 669 + ], + [ + 671, + 692 + ], + [ + 694, + 715 + ], + [ + 717, + 738 + ], + [ + 740, + 761 + ], + [ + 763, + 784 + ], + [ + 786, + 807 + ], + [ + 809, + 828 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 63, + 64 + ], + [ + 65, + 69 + ], + [ + 70, + 79 + ], + [ + 84, + 85 + ], + [ + 119, + 120 + ], + [ + 123, + 127 + ], + [ + 128, + 129 + ], + [ + 130, + 132 + ], + [ + 138, + 149 + ], + [ + 153, + 164 + ], + [ + 165, + 177 + ], + [ + 182, + 193 + ], + [ + 194, + 195 + ], + [ + 196, + 211 + ], + [ + 212, + 225 + ], + [ + 231, + 239 + ], + [ + 245, + 255 + ], + [ + 258, + 266 + ], + [ + 269, + 279 + ], + [ + 282, + 293 + ], + [ + 296, + 308 + ], + [ + 309, + 356 + ], + [ + 358, + 359 + ], + [ + 363, + 365 + ], + [ + 368, + 451 + ], + [ + 453, + 454 + ], + [ + 455, + 456 + ], + [ + 459, + 460 + ], + [ + 461, + 462 + ], + [ + 463, + 465 + ], + [ + 466, + 467 + ], + [ + 468, + 470 + ], + [ + 471, + 472 + ], + [ + 475, + 477 + ], + [ + 478, + 481 + ], + [ + 483, + 485 + ], + [ + 487, + 493 + ], + [ + 496, + 499 + ], + [ + 502, + 506 + ], + [ + 507, + 508 + ], + [ + 511, + 512 + ], + [ + 513, + 516 + ], + [ + 517, + 518 + ], + [ + 523, + 524 + ], + [ + 528, + 531 + ], + [ + 532, + 533 + ], + [ + 534, + 537 + ], + [ + 538, + 540 + ], + [ + 541, + 544 + ], + [ + 545, + 547 + ], + [ + 550, + 551 + ], + [ + 555, + 556 + ], + [ + 557, + 558 + ], + [ + 574, + 575 + ], + [ + 579, + 580 + ], + [ + 587, + 588 + ], + [ + 592, + 595 + ], + [ + 596, + 597 + ], + [ + 605, + 606 + ], + [ + 610, + 611 + ], + [ + 615, + 618 + ], + [ + 619, + 620 + ], + [ + 628, + 629 + ], + [ + 633, + 634 + ], + [ + 638, + 641 + ], + [ + 642, + 643 + ], + [ + 651, + 652 + ], + [ + 656, + 657 + ], + [ + 661, + 664 + ], + [ + 665, + 666 + ], + [ + 674, + 675 + ], + [ + 679, + 680 + ], + [ + 684, + 687 + ], + [ + 688, + 689 + ], + [ + 697, + 698 + ], + [ + 702, + 703 + ], + [ + 707, + 710 + ], + [ + 711, + 712 + ], + [ + 720, + 721 + ], + [ + 725, + 726 + ], + [ + 730, + 733 + ], + [ + 734, + 735 + ], + [ + 743, + 744 + ], + [ + 748, + 749 + ], + [ + 753, + 756 + ], + [ + 757, + 758 + ], + [ + 766, + 767 + ], + [ + 771, + 772 + ], + [ + 776, + 779 + ], + [ + 780, + 781 + ], + [ + 789, + 790 + ], + [ + 794, + 795 + ], + [ + 799, + 802 + ], + [ + 803, + 804 + ], + [ + 812, + 813 + ], + [ + 817, + 818 + ], + [ + 822, + 825 + ], + [ + 826, + 827 + ] + ] + } + }, + { + "filename": "libvips/conversion/conversion.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 49, + 56 + ], + [ + 84, + 120 + ], + [ + 168, + 175 + ], + [ + 178, + 185 + ], + [ + 192, + 199 + ], + [ + 206, + 213 + ], + [ + 222, + 229 + ], + [ + 239, + 255 + ], + [ + 260, + 267 + ], + [ + 272, + 281 + ], + [ + 288, + 356 + ], + [ + 357, + 419 + ], + [ + 433, + 460 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 52, + 53 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 96, + 99 + ], + [ + 101, + 103 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 171, + 172 + ], + [ + 181, + 182 + ], + [ + 195, + 196 + ], + [ + 209, + 210 + ], + [ + 225, + 226 + ], + [ + 242, + 243 + ], + [ + 248, + 249 + ], + [ + 251, + 252 + ], + [ + 263, + 264 + ], + [ + 275, + 276 + ], + [ + 277, + 278 + ], + [ + 291, + 292 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 305, + 306 + ], + [ + 310, + 311 + ], + [ + 313, + 314 + ], + [ + 315, + 316 + ], + [ + 318, + 321 + ], + [ + 323, + 324 + ], + [ + 325, + 327 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 334, + 336 + ], + [ + 341, + 342 + ], + [ + 344, + 349 + ], + [ + 352, + 353 + ], + [ + 360, + 361 + ], + [ + 362, + 410 + ], + [ + 412, + 416 + ], + [ + 436, + 459 + ] + ] + } + }, + { + "filename": "libvips/conversion/copy.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 10 + ], + [ + 58, + 86 + ], + [ + 119, + 126 + ], + [ + 128, + 169 + ], + [ + 170, + 189 + ], + [ + 191, + 361 + ], + [ + 379, + 386 + ], + [ + 387, + 408 + ], + [ + 410, + 421 + ], + [ + 423, + 444 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 6, + 7 + ], + [ + 61, + 62 + ], + [ + 63, + 67 + ], + [ + 68, + 77 + ], + [ + 82, + 83 + ], + [ + 122, + 123 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 137, + 138 + ], + [ + 139, + 142 + ], + [ + 143, + 144 + ], + [ + 149, + 153 + ], + [ + 154, + 158 + ], + [ + 159, + 160 + ], + [ + 162, + 163 + ], + [ + 164, + 166 + ], + [ + 173, + 175 + ], + [ + 176, + 178 + ], + [ + 179, + 182 + ], + [ + 183, + 186 + ], + [ + 194, + 195 + ], + [ + 201, + 204 + ], + [ + 205, + 210 + ], + [ + 211, + 214 + ], + [ + 216, + 218 + ], + [ + 219, + 223 + ], + [ + 225, + 228 + ], + [ + 233, + 239 + ], + [ + 241, + 245 + ], + [ + 246, + 247 + ], + [ + 250, + 251 + ], + [ + 252, + 255 + ], + [ + 256, + 257 + ], + [ + 262, + 263 + ], + [ + 268, + 270 + ], + [ + 272, + 275 + ], + [ + 276, + 277 + ], + [ + 278, + 281 + ], + [ + 282, + 284 + ], + [ + 285, + 288 + ], + [ + 289, + 291 + ], + [ + 292, + 295 + ], + [ + 296, + 298 + ], + [ + 299, + 302 + ], + [ + 303, + 305 + ], + [ + 306, + 309 + ], + [ + 310, + 312 + ], + [ + 313, + 316 + ], + [ + 317, + 319 + ], + [ + 320, + 323 + ], + [ + 324, + 326 + ], + [ + 327, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 337 + ], + [ + 338, + 340 + ], + [ + 341, + 344 + ], + [ + 345, + 347 + ], + [ + 348, + 351 + ], + [ + 352, + 354 + ], + [ + 357, + 358 + ], + [ + 382, + 383 + ], + [ + 390, + 391 + ], + [ + 395, + 396 + ], + [ + 400, + 403 + ], + [ + 404, + 405 + ], + [ + 413, + 415 + ], + [ + 417, + 418 + ], + [ + 426, + 427 + ], + [ + 430, + 432 + ], + [ + 433, + 439 + ], + [ + 442, + 443 + ] + ] + } + }, + { + "filename": "libvips/conversion/embed.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 13 + ], + [ + 31, + 59 + ], + [ + 92, + 102 + ], + [ + 110, + 140 + ], + [ + 141, + 151 + ], + [ + 152, + 192 + ], + [ + 194, + 237 + ], + [ + 240, + 322 + ], + [ + 323, + 401 + ], + [ + 404, + 450 + ], + [ + 461, + 477 + ], + [ + 481, + 505 + ], + [ + 506, + 535 + ], + [ + 536, + 603 + ], + [ + 611, + 621 + ], + [ + 624, + 668 + ], + [ + 680, + 708 + ], + [ + 715, + 734 + ], + [ + 775, + 816 + ], + [ + 828, + 855 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 9, + 10 + ], + [ + 34, + 35 + ], + [ + 36, + 40 + ], + [ + 41, + 50 + ], + [ + 55, + 56 + ], + [ + 95, + 96 + ], + [ + 97, + 99 + ], + [ + 113, + 114 + ], + [ + 120, + 122 + ], + [ + 128, + 130 + ], + [ + 135, + 137 + ], + [ + 144, + 145 + ], + [ + 146, + 148 + ], + [ + 155, + 156 + ], + [ + 162, + 164 + ], + [ + 165, + 166 + ], + [ + 169, + 171 + ], + [ + 174, + 176 + ], + [ + 179, + 181 + ], + [ + 182, + 183 + ], + [ + 188, + 189 + ], + [ + 197, + 200 + ], + [ + 206, + 207 + ], + [ + 209, + 212 + ], + [ + 218, + 221 + ], + [ + 224, + 225 + ], + [ + 228, + 230 + ], + [ + 233, + 234 + ], + [ + 243, + 244 + ], + [ + 249, + 252 + ], + [ + 253, + 254 + ], + [ + 256, + 257 + ], + [ + 259, + 261 + ], + [ + 265, + 268 + ], + [ + 272, + 273 + ], + [ + 275, + 276 + ], + [ + 279, + 282 + ], + [ + 283, + 284 + ], + [ + 288, + 289 + ], + [ + 292, + 294 + ], + [ + 295, + 296 + ], + [ + 302, + 303 + ], + [ + 306, + 310 + ], + [ + 315, + 319 + ], + [ + 326, + 331 + ], + [ + 333, + 335 + ], + [ + 340, + 341 + ], + [ + 344, + 345 + ], + [ + 348, + 349 + ], + [ + 350, + 352 + ], + [ + 353, + 354 + ], + [ + 357, + 359 + ], + [ + 362, + 381 + ], + [ + 384, + 386 + ], + [ + 387, + 394 + ], + [ + 395, + 398 + ], + [ + 407, + 408 + ], + [ + 410, + 418 + ], + [ + 421, + 426 + ], + [ + 430, + 432 + ], + [ + 433, + 436 + ], + [ + 442, + 443 + ], + [ + 444, + 447 + ], + [ + 464, + 465 + ], + [ + 466, + 468 + ], + [ + 470, + 474 + ], + [ + 484, + 485 + ], + [ + 486, + 488 + ], + [ + 490, + 492 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 501, + 502 + ], + [ + 509, + 510 + ], + [ + 511, + 513 + ], + [ + 515, + 521 + ], + [ + 523, + 524 + ], + [ + 525, + 527 + ], + [ + 528, + 532 + ], + [ + 539, + 540 + ], + [ + 543, + 544 + ], + [ + 545, + 547 + ], + [ + 548, + 549 + ], + [ + 554, + 555 + ], + [ + 560, + 563 + ], + [ + 564, + 565 + ], + [ + 566, + 569 + ], + [ + 570, + 572 + ], + [ + 573, + 576 + ], + [ + 577, + 579 + ], + [ + 580, + 583 + ], + [ + 584, + 586 + ], + [ + 587, + 590 + ], + [ + 591, + 593 + ], + [ + 596, + 597 + ], + [ + 599, + 600 + ], + [ + 614, + 615 + ], + [ + 617, + 618 + ], + [ + 627, + 629 + ], + [ + 630, + 631 + ], + [ + 634, + 635 + ], + [ + 636, + 638 + ], + [ + 639, + 640 + ], + [ + 645, + 646 + ], + [ + 648, + 651 + ], + [ + 652, + 654 + ], + [ + 655, + 658 + ], + [ + 659, + 661 + ], + [ + 664, + 665 + ], + [ + 683, + 685 + ], + [ + 687, + 688 + ], + [ + 690, + 691 + ], + [ + 694, + 696 + ], + [ + 700, + 703 + ], + [ + 704, + 705 + ], + [ + 718, + 719 + ], + [ + 721, + 722 + ], + [ + 726, + 731 + ], + [ + 781, + 783 + ], + [ + 784, + 785 + ], + [ + 788, + 789 + ], + [ + 790, + 792 + ], + [ + 793, + 794 + ], + [ + 799, + 801 + ], + [ + 803, + 806 + ], + [ + 807, + 809 + ], + [ + 812, + 813 + ], + [ + 831, + 833 + ], + [ + 835, + 836 + ], + [ + 838, + 839 + ], + [ + 842, + 844 + ], + [ + 848, + 852 + ], + [ + 853, + 854 + ] + ] + } + }, + { + "filename": "libvips/conversion/extract.c", + "line_filter": { + "diff_chunks": [ + [ + 41, + 69 + ], + [ + 103, + 116 + ], + [ + 121, + 240 + ], + [ + 250, + 299 + ], + [ + 305, + 330 + ], + [ + 339, + 366 + ], + [ + 368, + 447 + ], + [ + 459, + 477 + ] + ], + "lines_added": [ + [ + 44, + 60 + ], + [ + 65, + 66 + ], + [ + 106, + 107 + ], + [ + 111, + 113 + ], + [ + 124, + 126 + ], + [ + 129, + 133 + ], + [ + 136, + 137 + ], + [ + 138, + 140 + ], + [ + 142, + 144 + ], + [ + 145, + 146 + ], + [ + 148, + 151 + ], + [ + 153, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 165 + ], + [ + 166, + 170 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 180 + ], + [ + 181, + 182 + ], + [ + 187, + 188 + ], + [ + 192, + 195 + ], + [ + 196, + 197 + ], + [ + 198, + 201 + ], + [ + 202, + 204 + ], + [ + 205, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 215 + ], + [ + 216, + 218 + ], + [ + 219, + 222 + ], + [ + 223, + 225 + ], + [ + 229, + 230 + ], + [ + 231, + 232 + ], + [ + 236, + 237 + ], + [ + 253, + 254 + ], + [ + 257, + 259 + ], + [ + 263, + 267 + ], + [ + 268, + 269 + ], + [ + 275, + 276 + ], + [ + 279, + 285 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ], + [ + 292, + 293 + ], + [ + 295, + 296 + ], + [ + 308, + 309 + ], + [ + 311, + 312 + ], + [ + 315, + 317 + ], + [ + 321, + 325 + ], + [ + 326, + 327 + ], + [ + 342, + 343 + ], + [ + 345, + 347 + ], + [ + 352, + 355 + ], + [ + 361, + 363 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 377, + 379 + ], + [ + 380, + 381 + ], + [ + 386, + 390 + ], + [ + 392, + 395 + ], + [ + 397, + 399 + ], + [ + 400, + 401 + ], + [ + 404, + 405 + ], + [ + 406, + 409 + ], + [ + 410, + 411 + ], + [ + 416, + 417 + ], + [ + 421, + 424 + ], + [ + 425, + 426 + ], + [ + 427, + 430 + ], + [ + 431, + 433 + ], + [ + 434, + 437 + ], + [ + 438, + 440 + ], + [ + 443, + 444 + ], + [ + 462, + 463 + ], + [ + 466, + 467 + ], + [ + 471, + 474 + ], + [ + 475, + 476 + ] + ] + } + }, + { + "filename": "libvips/conversion/falsecolour.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 48 + ], + [ + 66, + 73 + ], + [ + 330, + 401 + ], + [ + 404, + 418 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 69, + 70 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 337, + 338 + ], + [ + 339, + 341 + ], + [ + 342, + 348 + ], + [ + 353, + 361 + ], + [ + 364, + 365 + ], + [ + 366, + 369 + ], + [ + 374, + 375 + ], + [ + 379, + 382 + ], + [ + 383, + 384 + ], + [ + 387, + 388 + ], + [ + 393, + 394 + ], + [ + 397, + 398 + ], + [ + 407, + 408 + ], + [ + 412, + 415 + ], + [ + 416, + 417 + ] + ] + } + }, + { + "filename": "libvips/conversion/flatten.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 15, + 43 + ], + [ + 81, + 449 + ], + [ + 453, + 474 + ], + [ + 476, + 490 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 18, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 34 + ], + [ + 39, + 40 + ], + [ + 84, + 85 + ], + [ + 88, + 104 + ], + [ + 108, + 124 + ], + [ + 127, + 145 + ], + [ + 146, + 166 + ], + [ + 168, + 170 + ], + [ + 173, + 174 + ], + [ + 175, + 176 + ], + [ + 180, + 182 + ], + [ + 183, + 186 + ], + [ + 187, + 191 + ], + [ + 192, + 195 + ], + [ + 196, + 199 + ], + [ + 200, + 203 + ], + [ + 204, + 207 + ], + [ + 208, + 211 + ], + [ + 212, + 215 + ], + [ + 216, + 219 + ], + [ + 220, + 225 + ], + [ + 227, + 228 + ], + [ + 233, + 235 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 245, + 247 + ], + [ + 248, + 251 + ], + [ + 252, + 256 + ], + [ + 257, + 260 + ], + [ + 261, + 264 + ], + [ + 265, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 280 + ], + [ + 281, + 284 + ], + [ + 285, + 290 + ], + [ + 292, + 293 + ], + [ + 296, + 297 + ], + [ + 298, + 300 + ], + [ + 301, + 302 + ], + [ + 308, + 310 + ], + [ + 311, + 312 + ], + [ + 313, + 316 + ], + [ + 319, + 321 + ], + [ + 322, + 324 + ], + [ + 328, + 331 + ], + [ + 334, + 335 + ], + [ + 340, + 343 + ], + [ + 344, + 346 + ], + [ + 350, + 353 + ], + [ + 358, + 361 + ], + [ + 362, + 363 + ], + [ + 368, + 373 + ], + [ + 378, + 387 + ], + [ + 390, + 393 + ], + [ + 396, + 398 + ], + [ + 399, + 400 + ], + [ + 403, + 404 + ], + [ + 405, + 408 + ], + [ + 409, + 410 + ], + [ + 415, + 416 + ], + [ + 420, + 423 + ], + [ + 424, + 425 + ], + [ + 426, + 429 + ], + [ + 430, + 432 + ], + [ + 433, + 436 + ], + [ + 437, + 439 + ], + [ + 442, + 443 + ], + [ + 444, + 446 + ], + [ + 456, + 457 + ], + [ + 460, + 461 + ], + [ + 464, + 465 + ], + [ + 466, + 467 + ], + [ + 470, + 471 + ], + [ + 479, + 480 + ], + [ + 484, + 487 + ], + [ + 488, + 489 + ] + ] + } + }, + { + "filename": "libvips/conversion/flip.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 15 + ], + [ + 21, + 49 + ], + [ + 80, + 101 + ], + [ + 106, + 139 + ], + [ + 142, + 149 + ], + [ + 155, + 178 + ], + [ + 181, + 209 + ], + [ + 213, + 258 + ], + [ + 269, + 283 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 24, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 40 + ], + [ + 45, + 46 + ], + [ + 83, + 84 + ], + [ + 86, + 88 + ], + [ + 90, + 91 + ], + [ + 97, + 98 + ], + [ + 109, + 111 + ], + [ + 114, + 119 + ], + [ + 120, + 122 + ], + [ + 127, + 128 + ], + [ + 131, + 133 + ], + [ + 135, + 136 + ], + [ + 145, + 146 + ], + [ + 158, + 159 + ], + [ + 162, + 164 + ], + [ + 167, + 170 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 184, + 185 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 195, + 197 + ], + [ + 198, + 200 + ], + [ + 201, + 204 + ], + [ + 205, + 206 + ], + [ + 216, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 229 + ], + [ + 230, + 231 + ], + [ + 236, + 237 + ], + [ + 239, + 242 + ], + [ + 243, + 244 + ], + [ + 245, + 248 + ], + [ + 249, + 251 + ], + [ + 254, + 255 + ], + [ + 272, + 273 + ], + [ + 277, + 280 + ], + [ + 281, + 282 + ] + ] + } + }, + { + "filename": "libvips/conversion/gamma.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 8 + ], + [ + 19, + 47 + ], + [ + 64, + 71 + ], + [ + 82, + 167 + ], + [ + 169, + 190 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 22, + 28 + ], + [ + 29, + 33 + ], + [ + 34, + 38 + ], + [ + 43, + 44 + ], + [ + 67, + 68 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 93, + 95 + ], + [ + 96, + 99 + ], + [ + 100, + 103 + ], + [ + 104, + 113 + ], + [ + 114, + 123 + ], + [ + 126, + 127 + ], + [ + 128, + 131 + ], + [ + 136, + 137 + ], + [ + 141, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 153 + ], + [ + 156, + 157 + ], + [ + 163, + 164 + ], + [ + 172, + 173 + ], + [ + 179, + 180 + ], + [ + 184, + 187 + ], + [ + 188, + 189 + ] + ] + } + }, + { + "filename": "libvips/conversion/grid.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 63, + 78 + ], + [ + 92, + 99 + ], + [ + 102, + 117 + ], + [ + 124, + 133 + ], + [ + 137, + 231 + ], + [ + 240, + 247 + ], + [ + 250, + 273 + ] + ], + "lines_added": [ + [ + 15, + 31 + ], + [ + 36, + 37 + ], + [ + 66, + 67 + ], + [ + 69, + 71 + ], + [ + 74, + 75 + ], + [ + 95, + 96 + ], + [ + 105, + 108 + ], + [ + 109, + 110 + ], + [ + 112, + 114 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 140, + 143 + ], + [ + 145, + 146 + ], + [ + 149, + 150 + ], + [ + 151, + 153 + ], + [ + 155, + 157 + ], + [ + 158, + 161 + ], + [ + 162, + 167 + ], + [ + 171, + 174 + ], + [ + 177, + 181 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 188, + 190 + ], + [ + 195, + 196 + ], + [ + 198, + 201 + ], + [ + 202, + 203 + ], + [ + 204, + 207 + ], + [ + 208, + 210 + ], + [ + 211, + 214 + ], + [ + 215, + 217 + ], + [ + 218, + 221 + ], + [ + 222, + 224 + ], + [ + 227, + 228 + ], + [ + 243, + 244 + ], + [ + 253, + 254 + ], + [ + 260, + 262 + ], + [ + 266, + 270 + ], + [ + 271, + 272 + ] + ] + } + }, + { + "filename": "libvips/conversion/ifthenelse.c", + "line_filter": { + "diff_chunks": [ + [ + 29, + 57 + ], + [ + 88, + 227 + ], + [ + 230, + 275 + ], + [ + 276, + 290 + ], + [ + 291, + 370 + ], + [ + 373, + 470 + ], + [ + 478, + 557 + ], + [ + 566, + 578 + ], + [ + 590, + 605 + ] + ], + "lines_added": [ + [ + 32, + 48 + ], + [ + 53, + 54 + ], + [ + 91, + 106 + ], + [ + 107, + 119 + ], + [ + 120, + 121 + ], + [ + 122, + 135 + ], + [ + 136, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 164 + ], + [ + 165, + 179 + ], + [ + 180, + 181 + ], + [ + 185, + 188 + ], + [ + 193, + 224 + ], + [ + 233, + 236 + ], + [ + 241, + 272 + ], + [ + 279, + 281 + ], + [ + 283, + 284 + ], + [ + 286, + 287 + ], + [ + 294, + 296 + ], + [ + 300, + 304 + ], + [ + 306, + 307 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 318, + 321 + ], + [ + 322, + 323 + ], + [ + 325, + 328 + ], + [ + 330, + 331 + ], + [ + 336, + 349 + ], + [ + 350, + 352 + ], + [ + 355, + 356 + ], + [ + 359, + 361 + ], + [ + 363, + 364 + ], + [ + 366, + 367 + ], + [ + 376, + 377 + ], + [ + 379, + 380 + ], + [ + 385, + 386 + ], + [ + 389, + 391 + ], + [ + 395, + 399 + ], + [ + 400, + 401 + ], + [ + 405, + 406 + ], + [ + 409, + 410 + ], + [ + 412, + 415 + ], + [ + 416, + 417 + ], + [ + 419, + 422 + ], + [ + 424, + 425 + ], + [ + 427, + 440 + ], + [ + 442, + 443 + ], + [ + 447, + 448 + ], + [ + 451, + 452 + ], + [ + 453, + 455 + ], + [ + 456, + 457 + ], + [ + 458, + 462 + ], + [ + 465, + 467 + ], + [ + 481, + 484 + ], + [ + 487, + 490 + ], + [ + 493, + 494 + ], + [ + 496, + 498 + ], + [ + 499, + 502 + ], + [ + 503, + 507 + ], + [ + 508, + 509 + ], + [ + 512, + 513 + ], + [ + 514, + 516 + ], + [ + 517, + 518 + ], + [ + 523, + 524 + ], + [ + 526, + 529 + ], + [ + 530, + 531 + ], + [ + 532, + 535 + ], + [ + 536, + 537 + ], + [ + 538, + 541 + ], + [ + 542, + 543 + ], + [ + 544, + 547 + ], + [ + 548, + 550 + ], + [ + 553, + 554 + ], + [ + 569, + 570 + ], + [ + 574, + 575 + ], + [ + 593, + 595 + ], + [ + 599, + 602 + ], + [ + 603, + 604 + ] + ] + } + }, + { + "filename": "libvips/conversion/insert.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 34, + 62 + ], + [ + 103, + 110 + ], + [ + 113, + 127 + ], + [ + 129, + 161 + ], + [ + 162, + 257 + ], + [ + 258, + 392 + ], + [ + 393, + 404 + ], + [ + 409, + 420 + ], + [ + 424, + 516 + ], + [ + 526, + 549 + ], + [ + 550, + 565 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 37, + 38 + ], + [ + 39, + 43 + ], + [ + 44, + 53 + ], + [ + 58, + 59 + ], + [ + 106, + 107 + ], + [ + 116, + 117 + ], + [ + 123, + 124 + ], + [ + 132, + 134 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 143, + 144 + ], + [ + 149, + 150 + ], + [ + 156, + 158 + ], + [ + 165, + 168 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 177, + 180 + ], + [ + 186, + 187 + ], + [ + 190, + 191 + ], + [ + 193, + 196 + ], + [ + 197, + 199 + ], + [ + 201, + 204 + ], + [ + 206, + 209 + ], + [ + 210, + 211 + ], + [ + 214, + 218 + ], + [ + 222, + 226 + ], + [ + 229, + 231 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 240, + 241 + ], + [ + 244, + 247 + ], + [ + 250, + 251 + ], + [ + 252, + 254 + ], + [ + 261, + 262 + ], + [ + 264, + 266 + ], + [ + 270, + 274 + ], + [ + 277, + 283 + ], + [ + 287, + 288 + ], + [ + 289, + 293 + ], + [ + 296, + 297 + ], + [ + 298, + 303 + ], + [ + 306, + 310 + ], + [ + 312, + 313 + ], + [ + 315, + 328 + ], + [ + 330, + 331 + ], + [ + 332, + 333 + ], + [ + 336, + 337 + ], + [ + 338, + 339 + ], + [ + 342, + 343 + ], + [ + 345, + 347 + ], + [ + 348, + 349 + ], + [ + 352, + 353 + ], + [ + 354, + 357 + ], + [ + 358, + 360 + ], + [ + 361, + 362 + ], + [ + 365, + 366 + ], + [ + 367, + 369 + ], + [ + 370, + 371 + ], + [ + 372, + 374 + ], + [ + 375, + 383 + ], + [ + 386, + 389 + ], + [ + 396, + 399 + ], + [ + 400, + 401 + ], + [ + 412, + 413 + ], + [ + 415, + 417 + ], + [ + 427, + 428 + ], + [ + 433, + 438 + ], + [ + 439, + 443 + ], + [ + 444, + 445 + ], + [ + 448, + 449 + ], + [ + 450, + 453 + ], + [ + 454, + 455 + ], + [ + 460, + 462 + ], + [ + 466, + 469 + ], + [ + 470, + 471 + ], + [ + 472, + 475 + ], + [ + 476, + 477 + ], + [ + 478, + 481 + ], + [ + 482, + 484 + ], + [ + 485, + 488 + ], + [ + 489, + 491 + ], + [ + 492, + 495 + ], + [ + 496, + 498 + ], + [ + 499, + 502 + ], + [ + 503, + 505 + ], + [ + 508, + 509 + ], + [ + 512, + 513 + ], + [ + 529, + 530 + ], + [ + 532, + 533 + ], + [ + 534, + 535 + ], + [ + 537, + 538 + ], + [ + 539, + 541 + ], + [ + 544, + 546 + ], + [ + 553, + 555 + ], + [ + 559, + 562 + ], + [ + 563, + 564 + ] + ] + } + }, + { + "filename": "libvips/conversion/join.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 21 + ], + [ + 27, + 55 + ], + [ + 87, + 117 + ], + [ + 132, + 139 + ], + [ + 155, + 184 + ], + [ + 191, + 301 + ], + [ + 306, + 313 + ], + [ + 320, + 334 + ], + [ + 338, + 353 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 30, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 46 + ], + [ + 51, + 52 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 101, + 103 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 135, + 136 + ], + [ + 158, + 163 + ], + [ + 164, + 165 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 177, + 178 + ], + [ + 179, + 181 + ], + [ + 194, + 195 + ], + [ + 197, + 202 + ], + [ + 203, + 204 + ], + [ + 209, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 224 + ], + [ + 225, + 226 + ], + [ + 231, + 232 + ], + [ + 236, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 245 + ], + [ + 246, + 247 + ], + [ + 248, + 251 + ], + [ + 252, + 254 + ], + [ + 255, + 258 + ], + [ + 259, + 261 + ], + [ + 262, + 265 + ], + [ + 266, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 275 + ], + [ + 276, + 279 + ], + [ + 280, + 282 + ], + [ + 285, + 286 + ], + [ + 289, + 291 + ], + [ + 296, + 298 + ], + [ + 309, + 310 + ], + [ + 323, + 326 + ], + [ + 329, + 331 + ], + [ + 341, + 343 + ], + [ + 347, + 350 + ], + [ + 351, + 352 + ] + ] + } + }, + { + "filename": "libvips/conversion/msb.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 48 + ], + [ + 62, + 69 + ], + [ + 80, + 114 + ], + [ + 116, + 137 + ], + [ + 138, + 260 + ], + [ + 271, + 294 + ] + ], + "lines_added": [ + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 34 + ], + [ + 35, + 39 + ], + [ + 44, + 45 + ], + [ + 65, + 66 + ], + [ + 83, + 84 + ], + [ + 86, + 87 + ], + [ + 91, + 92 + ], + [ + 94, + 95 + ], + [ + 99, + 101 + ], + [ + 102, + 105 + ], + [ + 106, + 108 + ], + [ + 110, + 111 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 130, + 131 + ], + [ + 133, + 134 + ], + [ + 141, + 142 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 153, + 155 + ], + [ + 156, + 159 + ], + [ + 162, + 163 + ], + [ + 164, + 167 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 179, + 181 + ], + [ + 187, + 189 + ], + [ + 190, + 192 + ], + [ + 194, + 198 + ], + [ + 199, + 201 + ], + [ + 202, + 205 + ], + [ + 206, + 207 + ], + [ + 208, + 209 + ], + [ + 212, + 213 + ], + [ + 217, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 230 + ], + [ + 235, + 237 + ], + [ + 241, + 244 + ], + [ + 245, + 246 + ], + [ + 247, + 250 + ], + [ + 251, + 253 + ], + [ + 256, + 257 + ], + [ + 274, + 275 + ], + [ + 279, + 280 + ], + [ + 283, + 284 + ], + [ + 288, + 291 + ], + [ + 292, + 293 + ] + ] + } + }, + { + "filename": "libvips/conversion/pconversion.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 66, + 76 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 69, + 70 + ] + ] + } + }, + { + "filename": "libvips/conversion/premultiply.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 41 + ], + [ + 69, + 280 + ], + [ + 288, + 307 + ], + [ + 309, + 316 + ], + [ + 318, + 332 + ] + ], + "lines_added": [ + [ + 16, + 32 + ], + [ + 37, + 38 + ], + [ + 72, + 73 + ], + [ + 76, + 94 + ], + [ + 97, + 116 + ], + [ + 117, + 126 + ], + [ + 128, + 130 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 141, + 143 + ], + [ + 144, + 147 + ], + [ + 148, + 152 + ], + [ + 153, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 164 + ], + [ + 165, + 168 + ], + [ + 169, + 172 + ], + [ + 173, + 176 + ], + [ + 177, + 180 + ], + [ + 181, + 186 + ], + [ + 188, + 189 + ], + [ + 192, + 193 + ], + [ + 194, + 196 + ], + [ + 197, + 198 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 206, + 209 + ], + [ + 212, + 214 + ], + [ + 215, + 217 + ], + [ + 218, + 221 + ], + [ + 225, + 228 + ], + [ + 230, + 231 + ], + [ + 235, + 239 + ], + [ + 240, + 241 + ], + [ + 244, + 245 + ], + [ + 246, + 249 + ], + [ + 250, + 251 + ], + [ + 256, + 257 + ], + [ + 261, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 270 + ], + [ + 271, + 273 + ], + [ + 276, + 277 + ], + [ + 291, + 292 + ], + [ + 296, + 298 + ], + [ + 301, + 304 + ], + [ + 312, + 313 + ], + [ + 321, + 322 + ], + [ + 326, + 329 + ], + [ + 330, + 331 + ] + ] + } + }, + { + "filename": "libvips/conversion/recomb.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 60, + 67 + ], + [ + 68, + 106 + ], + [ + 109, + 252 + ], + [ + 259, + 273 + ] + ], + "lines_added": [ + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 35, + 36 + ], + [ + 63, + 64 + ], + [ + 71, + 72 + ], + [ + 75, + 97 + ], + [ + 98, + 99 + ], + [ + 101, + 103 + ], + [ + 112, + 146 + ], + [ + 152, + 153 + ], + [ + 156, + 157 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 165, + 185 + ], + [ + 187, + 190 + ], + [ + 191, + 194 + ], + [ + 196, + 197 + ], + [ + 199, + 203 + ], + [ + 204, + 205 + ], + [ + 208, + 209 + ], + [ + 210, + 211 + ], + [ + 212, + 213 + ], + [ + 218, + 219 + ], + [ + 223, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 234 + ], + [ + 237, + 238 + ], + [ + 241, + 242 + ], + [ + 248, + 249 + ], + [ + 262, + 263 + ], + [ + 267, + 270 + ], + [ + 271, + 272 + ] + ] + } + }, + { + "filename": "libvips/conversion/replicate.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 12, + 40 + ], + [ + 70, + 85 + ], + [ + 99, + 106 + ], + [ + 107, + 124 + ], + [ + 130, + 221 + ], + [ + 233, + 247 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 73, + 74 + ], + [ + 76, + 78 + ], + [ + 81, + 82 + ], + [ + 102, + 103 + ], + [ + 110, + 112 + ], + [ + 113, + 115 + ], + [ + 116, + 117 + ], + [ + 119, + 121 + ], + [ + 133, + 134 + ], + [ + 140, + 141 + ], + [ + 144, + 148 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 159, + 161 + ], + [ + 162, + 164 + ], + [ + 165, + 168 + ], + [ + 172, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 183, + 185 + ], + [ + 186, + 187 + ], + [ + 192, + 193 + ], + [ + 195, + 198 + ], + [ + 199, + 200 + ], + [ + 201, + 204 + ], + [ + 205, + 207 + ], + [ + 208, + 211 + ], + [ + 212, + 214 + ], + [ + 217, + 218 + ], + [ + 236, + 237 + ], + [ + 241, + 244 + ], + [ + 245, + 246 + ] + ] + } + }, + { + "filename": "libvips/conversion/rot.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 9 + ], + [ + 28, + 62 + ], + [ + 93, + 111 + ], + [ + 124, + 153 + ], + [ + 154, + 173 + ], + [ + 186, + 216 + ], + [ + 217, + 236 + ], + [ + 249, + 278 + ], + [ + 279, + 312 + ], + [ + 336, + 388 + ], + [ + 393, + 417 + ], + [ + 426, + 442 + ], + [ + 451, + 467 + ], + [ + 476, + 490 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 31, + 32 + ], + [ + 37, + 38 + ], + [ + 39, + 43 + ], + [ + 44, + 53 + ], + [ + 58, + 59 + ], + [ + 96, + 97 + ], + [ + 99, + 101 + ], + [ + 107, + 108 + ], + [ + 127, + 130 + ], + [ + 132, + 134 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 144, + 147 + ], + [ + 148, + 150 + ], + [ + 157, + 158 + ], + [ + 161, + 163 + ], + [ + 169, + 170 + ], + [ + 189, + 191 + ], + [ + 194, + 195 + ], + [ + 198, + 199 + ], + [ + 201, + 202 + ], + [ + 205, + 208 + ], + [ + 211, + 213 + ], + [ + 220, + 221 + ], + [ + 224, + 226 + ], + [ + 232, + 233 + ], + [ + 252, + 255 + ], + [ + 257, + 259 + ], + [ + 262, + 263 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 282, + 283 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 294, + 296 + ], + [ + 297, + 299 + ], + [ + 300, + 302 + ], + [ + 303, + 304 + ], + [ + 305, + 307 + ], + [ + 308, + 309 + ], + [ + 339, + 343 + ], + [ + 344, + 345 + ], + [ + 348, + 349 + ], + [ + 350, + 352 + ], + [ + 353, + 354 + ], + [ + 359, + 360 + ], + [ + 362, + 365 + ], + [ + 366, + 367 + ], + [ + 368, + 371 + ], + [ + 372, + 374 + ], + [ + 377, + 378 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 396, + 398 + ], + [ + 404, + 405 + ], + [ + 409, + 412 + ], + [ + 413, + 414 + ], + [ + 429, + 430 + ], + [ + 434, + 437 + ], + [ + 438, + 439 + ], + [ + 454, + 455 + ], + [ + 459, + 462 + ], + [ + 463, + 464 + ], + [ + 479, + 480 + ], + [ + 484, + 487 + ], + [ + 488, + 489 + ] + ] + } + }, + { + "filename": "libvips/conversion/rot45.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 46 + ], + [ + 77, + 121 + ], + [ + 123, + 242 + ], + [ + 243, + 286 + ], + [ + 295, + 319 + ] + ], + "lines_added": [ + [ + 16, + 17 + ], + [ + 21, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 37 + ], + [ + 42, + 43 + ], + [ + 80, + 81 + ], + [ + 82, + 91 + ], + [ + 92, + 95 + ], + [ + 96, + 98 + ], + [ + 99, + 101 + ], + [ + 105, + 106 + ], + [ + 107, + 110 + ], + [ + 114, + 118 + ], + [ + 126, + 127 + ], + [ + 131, + 133 + ], + [ + 135, + 136 + ], + [ + 139, + 141 + ], + [ + 144, + 146 + ], + [ + 149, + 151 + ], + [ + 154, + 156 + ], + [ + 157, + 158 + ], + [ + 159, + 161 + ], + [ + 162, + 163 + ], + [ + 164, + 166 + ], + [ + 169, + 171 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 179, + 180 + ], + [ + 183, + 184 + ], + [ + 185, + 187 + ], + [ + 188, + 189 + ], + [ + 192, + 194 + ], + [ + 195, + 197 + ], + [ + 198, + 200 + ], + [ + 201, + 203 + ], + [ + 206, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 246, + 248 + ], + [ + 249, + 250 + ], + [ + 253, + 254 + ], + [ + 255, + 257 + ], + [ + 258, + 259 + ], + [ + 264, + 265 + ], + [ + 267, + 270 + ], + [ + 271, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 279 + ], + [ + 282, + 283 + ], + [ + 298, + 299 + ], + [ + 301, + 302 + ], + [ + 308, + 309 + ], + [ + 313, + 316 + ], + [ + 317, + 318 + ] + ] + } + }, + { + "filename": "libvips/conversion/scale.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 9 + ], + [ + 22, + 56 + ], + [ + 78, + 126 + ], + [ + 128, + 180 + ], + [ + 193, + 200 + ], + [ + 201, + 215 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 25, + 27 + ], + [ + 31, + 32 + ], + [ + 33, + 37 + ], + [ + 38, + 47 + ], + [ + 52, + 53 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 93, + 95 + ], + [ + 96, + 100 + ], + [ + 101, + 102 + ], + [ + 104, + 109 + ], + [ + 110, + 112 + ], + [ + 113, + 116 + ], + [ + 118, + 123 + ], + [ + 131, + 136 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 144, + 146 + ], + [ + 151, + 152 + ], + [ + 154, + 157 + ], + [ + 158, + 159 + ], + [ + 160, + 163 + ], + [ + 164, + 166 + ], + [ + 167, + 170 + ], + [ + 171, + 173 + ], + [ + 176, + 177 + ], + [ + 196, + 197 + ], + [ + 204, + 205 + ], + [ + 209, + 212 + ], + [ + 213, + 214 + ] + ] + } + }, + { + "filename": "libvips/conversion/sequential.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 8 + ], + [ + 29, + 57 + ], + [ + 99, + 199 + ], + [ + 202, + 273 + ], + [ + 286, + 294 + ], + [ + 297, + 311 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 4, + 5 + ], + [ + 32, + 33 + ], + [ + 34, + 38 + ], + [ + 39, + 48 + ], + [ + 53, + 54 + ], + [ + 102, + 103 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 115, + 117 + ], + [ + 119, + 120 + ], + [ + 122, + 126 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 131, + 132 + ], + [ + 135, + 138 + ], + [ + 140, + 144 + ], + [ + 148, + 152 + ], + [ + 157, + 158 + ], + [ + 159, + 161 + ], + [ + 163, + 164 + ], + [ + 169, + 171 + ], + [ + 172, + 174 + ], + [ + 176, + 178 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 192, + 193 + ], + [ + 194, + 196 + ], + [ + 205, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 229 + ], + [ + 230, + 231 + ], + [ + 237, + 238 + ], + [ + 240, + 243 + ], + [ + 244, + 245 + ], + [ + 246, + 249 + ], + [ + 250, + 252 + ], + [ + 253, + 256 + ], + [ + 257, + 259 + ], + [ + 260, + 263 + ], + [ + 264, + 266 + ], + [ + 269, + 270 + ], + [ + 289, + 291 + ], + [ + 300, + 301 + ], + [ + 305, + 308 + ], + [ + 309, + 310 + ] + ] + } + }, + { + "filename": "libvips/conversion/smartcrop.c", + "line_filter": { + "diff_chunks": [ + [ + 18, + 46 + ], + [ + 75, + 104 + ], + [ + 111, + 210 + ], + [ + 217, + 287 + ], + [ + 289, + 347 + ], + [ + 353, + 366 + ], + [ + 384, + 444 + ], + [ + 454, + 461 + ], + [ + 463, + 481 + ] + ], + "lines_added": [ + [ + 21, + 37 + ], + [ + 42, + 43 + ], + [ + 78, + 79 + ], + [ + 81, + 83 + ], + [ + 84, + 86 + ], + [ + 87, + 91 + ], + [ + 92, + 93 + ], + [ + 96, + 97 + ], + [ + 99, + 101 + ], + [ + 114, + 117 + ], + [ + 118, + 119 + ], + [ + 121, + 129 + ], + [ + 132, + 136 + ], + [ + 137, + 141 + ], + [ + 143, + 144 + ], + [ + 147, + 148 + ], + [ + 151, + 155 + ], + [ + 156, + 160 + ], + [ + 162, + 163 + ], + [ + 167, + 168 + ], + [ + 173, + 174 + ], + [ + 175, + 178 + ], + [ + 181, + 184 + ], + [ + 185, + 188 + ], + [ + 189, + 192 + ], + [ + 193, + 194 + ], + [ + 197, + 199 + ], + [ + 202, + 204 + ], + [ + 205, + 207 + ], + [ + 220, + 228 + ], + [ + 231, + 236 + ], + [ + 239, + 242 + ], + [ + 243, + 244 + ], + [ + 245, + 247 + ], + [ + 248, + 252 + ], + [ + 255, + 256 + ], + [ + 258, + 260 + ], + [ + 263, + 265 + ], + [ + 268, + 269 + ], + [ + 272, + 276 + ], + [ + 279, + 284 + ], + [ + 292, + 296 + ], + [ + 299, + 307 + ], + [ + 310, + 311 + ], + [ + 312, + 314 + ], + [ + 315, + 316 + ], + [ + 321, + 323 + ], + [ + 324, + 325 + ], + [ + 326, + 329 + ], + [ + 335, + 336 + ], + [ + 337, + 340 + ], + [ + 343, + 344 + ], + [ + 356, + 358 + ], + [ + 361, + 363 + ], + [ + 387, + 392 + ], + [ + 393, + 394 + ], + [ + 397, + 398 + ], + [ + 399, + 401 + ], + [ + 402, + 403 + ], + [ + 408, + 409 + ], + [ + 411, + 414 + ], + [ + 415, + 416 + ], + [ + 417, + 420 + ], + [ + 421, + 423 + ], + [ + 424, + 427 + ], + [ + 428, + 430 + ], + [ + 431, + 434 + ], + [ + 435, + 437 + ], + [ + 440, + 441 + ], + [ + 457, + 458 + ], + [ + 466, + 467 + ], + [ + 470, + 471 + ], + [ + 475, + 478 + ], + [ + 479, + 480 + ] + ] + } + }, + { + "filename": "libvips/conversion/subsample.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 60, + 67 + ], + [ + 68, + 96 + ], + [ + 98, + 116 + ], + [ + 120, + 134 + ], + [ + 136, + 160 + ], + [ + 161, + 223 + ], + [ + 224, + 301 + ], + [ + 317, + 339 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 63, + 64 + ], + [ + 71, + 72 + ], + [ + 77, + 78 + ], + [ + 81, + 83 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 93 + ], + [ + 101, + 103 + ], + [ + 107, + 108 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 123, + 125 + ], + [ + 128, + 131 + ], + [ + 139, + 140 + ], + [ + 145, + 147 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 156, + 157 + ], + [ + 164, + 166 + ], + [ + 170, + 171 + ], + [ + 177, + 179 + ], + [ + 182, + 184 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 197 + ], + [ + 201, + 203 + ], + [ + 204, + 206 + ], + [ + 207, + 213 + ], + [ + 217, + 220 + ], + [ + 227, + 232 + ], + [ + 234, + 236 + ], + [ + 237, + 239 + ], + [ + 240, + 241 + ], + [ + 243, + 247 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 254, + 256 + ], + [ + 261, + 262 + ], + [ + 268, + 271 + ], + [ + 272, + 273 + ], + [ + 274, + 277 + ], + [ + 278, + 280 + ], + [ + 281, + 284 + ], + [ + 285, + 287 + ], + [ + 288, + 291 + ], + [ + 292, + 294 + ], + [ + 297, + 298 + ], + [ + 320, + 321 + ], + [ + 324, + 325 + ], + [ + 328, + 329 + ], + [ + 333, + 336 + ], + [ + 337, + 338 + ] + ] + } + }, + { + "filename": "libvips/conversion/switch.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 55, + 111 + ], + [ + 114, + 227 + ], + [ + 230, + 243 + ], + [ + 245, + 259 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 58, + 59 + ], + [ + 60, + 63 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 74, + 76 + ], + [ + 77, + 79 + ], + [ + 80, + 83 + ], + [ + 85, + 91 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 117, + 118 + ], + [ + 119, + 121 + ], + [ + 125, + 131 + ], + [ + 133, + 137 + ], + [ + 140, + 143 + ], + [ + 147, + 150 + ], + [ + 154, + 157 + ], + [ + 159, + 163 + ], + [ + 165, + 168 + ], + [ + 169, + 173 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 180, + 183 + ], + [ + 188, + 190 + ], + [ + 194, + 197 + ], + [ + 198, + 206 + ], + [ + 209, + 210 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 219, + 222 + ], + [ + 223, + 224 + ], + [ + 233, + 236 + ], + [ + 239, + 240 + ], + [ + 248, + 249 + ], + [ + 253, + 256 + ], + [ + 257, + 258 + ] + ] + } + }, + { + "filename": "libvips/conversion/tilecache.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 39, + 67 + ], + [ + 86, + 93 + ], + [ + 103, + 128 + ], + [ + 129, + 208 + ], + [ + 211, + 241 + ], + [ + 243, + 486 + ], + [ + 491, + 502 + ], + [ + 506, + 560 + ], + [ + 570, + 619 + ], + [ + 621, + 665 + ], + [ + 666, + 706 + ], + [ + 707, + 735 + ], + [ + 739, + 829 + ], + [ + 842, + 859 + ], + [ + 870, + 886 + ], + [ + 889, + 927 + ], + [ + 928, + 1001 + ], + [ + 1011, + 1028 + ], + [ + 1031, + 1050 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 42, + 43 + ], + [ + 44, + 48 + ], + [ + 49, + 58 + ], + [ + 63, + 64 + ], + [ + 89, + 90 + ], + [ + 106, + 107 + ], + [ + 111, + 112 + ], + [ + 117, + 118 + ], + [ + 124, + 125 + ], + [ + 132, + 137 + ], + [ + 141, + 143 + ], + [ + 147, + 148 + ], + [ + 153, + 154 + ], + [ + 157, + 158 + ], + [ + 161, + 164 + ], + [ + 165, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 179, + 180 + ], + [ + 186, + 187 + ], + [ + 188, + 190 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 203, + 205 + ], + [ + 214, + 217 + ], + [ + 219, + 222 + ], + [ + 224, + 225 + ], + [ + 226, + 229 + ], + [ + 231, + 232 + ], + [ + 237, + 238 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 257, + 259 + ], + [ + 265, + 266 + ], + [ + 270, + 271 + ], + [ + 272, + 273 + ], + [ + 275, + 276 + ], + [ + 279, + 280 + ], + [ + 285, + 290 + ], + [ + 294, + 303 + ], + [ + 308, + 311 + ], + [ + 315, + 316 + ], + [ + 318, + 319 + ], + [ + 322, + 324 + ], + [ + 325, + 326 + ], + [ + 328, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 335 + ], + [ + 337, + 339 + ], + [ + 342, + 343 + ], + [ + 346, + 347 + ], + [ + 348, + 349 + ], + [ + 350, + 351 + ], + [ + 354, + 356 + ], + [ + 357, + 358 + ], + [ + 361, + 362 + ], + [ + 363, + 364 + ], + [ + 366, + 367 + ], + [ + 368, + 370 + ], + [ + 371, + 372 + ], + [ + 373, + 375 + ], + [ + 376, + 379 + ], + [ + 380, + 381 + ], + [ + 384, + 385 + ], + [ + 386, + 389 + ], + [ + 390, + 391 + ], + [ + 397, + 398 + ], + [ + 402, + 405 + ], + [ + 406, + 407 + ], + [ + 408, + 411 + ], + [ + 412, + 414 + ], + [ + 415, + 418 + ], + [ + 419, + 421 + ], + [ + 422, + 425 + ], + [ + 426, + 428 + ], + [ + 429, + 432 + ], + [ + 433, + 435 + ], + [ + 438, + 439 + ], + [ + 445, + 446 + ], + [ + 449, + 450 + ], + [ + 452, + 454 + ], + [ + 455, + 456 + ], + [ + 459, + 460 + ], + [ + 463, + 465 + ], + [ + 468, + 471 + ], + [ + 473, + 474 + ], + [ + 476, + 477 + ], + [ + 478, + 479 + ], + [ + 482, + 483 + ], + [ + 494, + 496 + ], + [ + 498, + 499 + ], + [ + 509, + 510 + ], + [ + 512, + 513 + ], + [ + 514, + 515 + ], + [ + 518, + 519 + ], + [ + 522, + 523 + ], + [ + 524, + 525 + ], + [ + 529, + 530 + ], + [ + 533, + 534 + ], + [ + 535, + 537 + ], + [ + 538, + 539 + ], + [ + 543, + 544 + ], + [ + 547, + 549 + ], + [ + 550, + 551 + ], + [ + 556, + 557 + ], + [ + 573, + 578 + ], + [ + 580, + 581 + ], + [ + 585, + 586 + ], + [ + 587, + 590 + ], + [ + 592, + 593 + ], + [ + 596, + 597 + ], + [ + 602, + 605 + ], + [ + 610, + 612 + ], + [ + 615, + 616 + ], + [ + 624, + 625 + ], + [ + 626, + 627 + ], + [ + 628, + 629 + ], + [ + 630, + 633 + ], + [ + 636, + 637 + ], + [ + 638, + 639 + ], + [ + 641, + 643 + ], + [ + 645, + 646 + ], + [ + 649, + 650 + ], + [ + 652, + 655 + ], + [ + 656, + 657 + ], + [ + 660, + 662 + ], + [ + 669, + 670 + ], + [ + 672, + 673 + ], + [ + 675, + 678 + ], + [ + 683, + 685 + ], + [ + 689, + 694 + ], + [ + 695, + 698 + ], + [ + 699, + 700 + ], + [ + 701, + 703 + ], + [ + 710, + 711 + ], + [ + 712, + 714 + ], + [ + 715, + 717 + ], + [ + 718, + 720 + ], + [ + 721, + 722 + ], + [ + 728, + 729 + ], + [ + 731, + 732 + ], + [ + 742, + 745 + ], + [ + 747, + 748 + ], + [ + 750, + 751 + ], + [ + 752, + 753 + ], + [ + 754, + 755 + ], + [ + 756, + 757 + ], + [ + 758, + 759 + ], + [ + 762, + 763 + ], + [ + 764, + 765 + ], + [ + 768, + 769 + ], + [ + 770, + 771 + ], + [ + 774, + 775 + ], + [ + 776, + 778 + ], + [ + 779, + 781 + ], + [ + 782, + 785 + ], + [ + 786, + 790 + ], + [ + 791, + 792 + ], + [ + 795, + 796 + ], + [ + 797, + 799 + ], + [ + 800, + 801 + ], + [ + 806, + 807 + ], + [ + 809, + 812 + ], + [ + 813, + 815 + ], + [ + 816, + 819 + ], + [ + 820, + 822 + ], + [ + 825, + 826 + ], + [ + 845, + 847 + ], + [ + 848, + 849 + ], + [ + 850, + 852 + ], + [ + 854, + 856 + ], + [ + 873, + 874 + ], + [ + 878, + 881 + ], + [ + 882, + 883 + ], + [ + 892, + 893 + ], + [ + 895, + 897 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 904, + 905 + ], + [ + 908, + 910 + ], + [ + 911, + 913 + ], + [ + 915, + 916 + ], + [ + 917, + 918 + ], + [ + 921, + 922 + ], + [ + 923, + 924 + ], + [ + 931, + 932 + ], + [ + 933, + 934 + ], + [ + 936, + 938 + ], + [ + 941, + 943 + ], + [ + 946, + 947 + ], + [ + 953, + 982 + ], + [ + 985, + 986 + ], + [ + 987, + 988 + ], + [ + 989, + 990 + ], + [ + 992, + 993 + ], + [ + 997, + 998 + ], + [ + 1014, + 1015 + ], + [ + 1017, + 1018 + ], + [ + 1019, + 1021 + ], + [ + 1023, + 1025 + ], + [ + 1034, + 1035 + ], + [ + 1039, + 1040 + ], + [ + 1044, + 1047 + ], + [ + 1048, + 1049 + ] + ] + } + }, + { + "filename": "libvips/conversion/transpose3d.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 55, + 81 + ], + [ + 99, + 185 + ], + [ + 192, + 225 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 58, + 59 + ], + [ + 61, + 63 + ], + [ + 67, + 68 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 102, + 104 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 114 + ], + [ + 118, + 120 + ], + [ + 123, + 126 + ], + [ + 127, + 131 + ], + [ + 133, + 137 + ], + [ + 139, + 144 + ], + [ + 145, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 156, + 158 + ], + [ + 163, + 164 + ], + [ + 166, + 169 + ], + [ + 170, + 171 + ], + [ + 172, + 175 + ], + [ + 176, + 178 + ], + [ + 181, + 182 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 204, + 205 + ], + [ + 207, + 208 + ], + [ + 214, + 215 + ], + [ + 219, + 222 + ], + [ + 223, + 224 + ] + ] + } + }, + { + "filename": "libvips/conversion/unpremultiply.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 43 + ], + [ + 72, + 349 + ], + [ + 358, + 379 + ], + [ + 381, + 388 + ], + [ + 390, + 404 + ] + ], + "lines_added": [ + [ + 18, + 34 + ], + [ + 39, + 40 + ], + [ + 75, + 76 + ], + [ + 80, + 99 + ], + [ + 102, + 120 + ], + [ + 121, + 130 + ], + [ + 134, + 153 + ], + [ + 154, + 172 + ], + [ + 173, + 182 + ], + [ + 184, + 186 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 198, + 200 + ], + [ + 201, + 204 + ], + [ + 205, + 209 + ], + [ + 210, + 213 + ], + [ + 214, + 217 + ], + [ + 218, + 221 + ], + [ + 222, + 225 + ], + [ + 226, + 229 + ], + [ + 230, + 233 + ], + [ + 234, + 237 + ], + [ + 238, + 243 + ], + [ + 245, + 246 + ], + [ + 249, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 255 + ], + [ + 258, + 260 + ], + [ + 261, + 262 + ], + [ + 263, + 266 + ], + [ + 269, + 271 + ], + [ + 272, + 274 + ], + [ + 275, + 278 + ], + [ + 282, + 285 + ], + [ + 287, + 288 + ], + [ + 289, + 290 + ], + [ + 292, + 293 + ], + [ + 297, + 301 + ], + [ + 302, + 303 + ], + [ + 306, + 307 + ], + [ + 308, + 311 + ], + [ + 312, + 313 + ], + [ + 318, + 319 + ], + [ + 323, + 326 + ], + [ + 327, + 328 + ], + [ + 329, + 332 + ], + [ + 333, + 335 + ], + [ + 336, + 339 + ], + [ + 340, + 342 + ], + [ + 345, + 346 + ], + [ + 361, + 363 + ], + [ + 366, + 368 + ], + [ + 374, + 376 + ], + [ + 384, + 385 + ], + [ + 393, + 394 + ], + [ + 398, + 401 + ], + [ + 402, + 403 + ] + ] + } + }, + { + "filename": "libvips/conversion/wrap.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 13 + ], + [ + 14, + 42 + ], + [ + 60, + 140 + ], + [ + 150, + 171 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 28 + ], + [ + 29, + 33 + ], + [ + 38, + 39 + ], + [ + 63, + 64 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 75, + 77 + ], + [ + 78, + 79 + ], + [ + 80, + 81 + ], + [ + 86, + 94 + ], + [ + 98, + 99 + ], + [ + 102, + 103 + ], + [ + 104, + 106 + ], + [ + 111, + 112 + ], + [ + 114, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 123 + ], + [ + 124, + 126 + ], + [ + 127, + 130 + ], + [ + 131, + 133 + ], + [ + 136, + 137 + ], + [ + 153, + 154 + ], + [ + 160, + 161 + ], + [ + 165, + 168 + ], + [ + 169, + 170 + ] + ] + } + }, + { + "filename": "libvips/conversion/zoom.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 20 + ], + [ + 27, + 60 + ], + [ + 78, + 101 + ], + [ + 108, + 135 + ], + [ + 140, + 148 + ], + [ + 150, + 161 + ], + [ + 168, + 187 + ], + [ + 190, + 207 + ], + [ + 210, + 218 + ], + [ + 228, + 243 + ], + [ + 244, + 397 + ], + [ + 406, + 424 + ] + ], + "lines_added": [ + [ + 16, + 17 + ], + [ + 30, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 46 + ], + [ + 51, + 52 + ], + [ + 55, + 57 + ], + [ + 81, + 82 + ], + [ + 88, + 89 + ], + [ + 93, + 95 + ], + [ + 96, + 98 + ], + [ + 111, + 112 + ], + [ + 115, + 116 + ], + [ + 119, + 122 + ], + [ + 127, + 128 + ], + [ + 130, + 132 + ], + [ + 143, + 145 + ], + [ + 153, + 155 + ], + [ + 156, + 158 + ], + [ + 171, + 172 + ], + [ + 177, + 178 + ], + [ + 181, + 184 + ], + [ + 193, + 194 + ], + [ + 196, + 197 + ], + [ + 203, + 204 + ], + [ + 213, + 215 + ], + [ + 231, + 232 + ], + [ + 238, + 240 + ], + [ + 247, + 249 + ], + [ + 254, + 258 + ], + [ + 264, + 267 + ], + [ + 269, + 273 + ], + [ + 279, + 281 + ], + [ + 285, + 286 + ], + [ + 288, + 291 + ], + [ + 293, + 296 + ], + [ + 298, + 301 + ], + [ + 303, + 305 + ], + [ + 306, + 307 + ], + [ + 310, + 311 + ], + [ + 312, + 314 + ], + [ + 316, + 321 + ], + [ + 324, + 329 + ], + [ + 330, + 333 + ], + [ + 334, + 337 + ], + [ + 341, + 344 + ], + [ + 347, + 351 + ], + [ + 352, + 353 + ], + [ + 356, + 357 + ], + [ + 358, + 361 + ], + [ + 366, + 367 + ], + [ + 371, + 374 + ], + [ + 375, + 376 + ], + [ + 377, + 380 + ], + [ + 381, + 383 + ], + [ + 384, + 387 + ], + [ + 388, + 390 + ], + [ + 393, + 394 + ], + [ + 409, + 410 + ], + [ + 413, + 414 + ], + [ + 418, + 421 + ], + [ + 422, + 423 + ] + ] + } + }, + { + "filename": "libvips/convolution/canny.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 49, + 57 + ], + [ + 59, + 296 + ], + [ + 298, + 311 + ], + [ + 324, + 477 + ], + [ + 488, + 519 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 52, + 54 + ], + [ + 62, + 63 + ], + [ + 68, + 69 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 88, + 93 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 104, + 106 + ], + [ + 111, + 128 + ], + [ + 129, + 130 + ], + [ + 132, + 133 + ], + [ + 134, + 154 + ], + [ + 155, + 156 + ], + [ + 158, + 160 + ], + [ + 162, + 163 + ], + [ + 165, + 166 + ], + [ + 167, + 169 + ], + [ + 170, + 177 + ], + [ + 178, + 179 + ], + [ + 184, + 185 + ], + [ + 188, + 189 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 204, + 205 + ], + [ + 208, + 209 + ], + [ + 211, + 212 + ], + [ + 216, + 217 + ], + [ + 223, + 224 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 233, + 236 + ], + [ + 238, + 242 + ], + [ + 243, + 244 + ], + [ + 246, + 279 + ], + [ + 280, + 281 + ], + [ + 283, + 285 + ], + [ + 287, + 288 + ], + [ + 292, + 293 + ], + [ + 301, + 303 + ], + [ + 306, + 308 + ], + [ + 327, + 332 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 343, + 344 + ], + [ + 347, + 348 + ], + [ + 351, + 352 + ], + [ + 358, + 359 + ], + [ + 361, + 364 + ], + [ + 368, + 372 + ], + [ + 373, + 374 + ], + [ + 377, + 378 + ], + [ + 380, + 381 + ], + [ + 384, + 386 + ], + [ + 389, + 393 + ], + [ + 395, + 397 + ], + [ + 403, + 405 + ], + [ + 410, + 414 + ], + [ + 415, + 417 + ], + [ + 419, + 420 + ], + [ + 421, + 423 + ], + [ + 424, + 425 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 432, + 433 + ], + [ + 438, + 439 + ], + [ + 443, + 446 + ], + [ + 447, + 448 + ], + [ + 449, + 454 + ], + [ + 455, + 458 + ], + [ + 459, + 461 + ], + [ + 462, + 468 + ], + [ + 471, + 472 + ], + [ + 473, + 474 + ], + [ + 491, + 492 + ], + [ + 497, + 499 + ], + [ + 500, + 502 + ], + [ + 504, + 505 + ], + [ + 507, + 509 + ], + [ + 513, + 516 + ], + [ + 517, + 518 + ] + ] + } + }, + { + "filename": "libvips/convolution/compass.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 11, + 39 + ], + [ + 50, + 135 + ], + [ + 140, + 210 + ], + [ + 237, + 252 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 30 + ], + [ + 35, + 36 + ], + [ + 53, + 59 + ], + [ + 63, + 64 + ], + [ + 66, + 67 + ], + [ + 73, + 74 + ], + [ + 78, + 79 + ], + [ + 80, + 82 + ], + [ + 83, + 91 + ], + [ + 93, + 104 + ], + [ + 108, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 118 + ], + [ + 122, + 126 + ], + [ + 130, + 132 + ], + [ + 143, + 145 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 159, + 160 + ], + [ + 162, + 203 + ], + [ + 206, + 207 + ], + [ + 240, + 242 + ], + [ + 246, + 249 + ], + [ + 250, + 251 + ] + ] + } + }, + { + "filename": "libvips/convolution/conv.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 9, + 37 + ], + [ + 49, + 160 + ], + [ + 173, + 180 + ], + [ + 182, + 215 + ], + [ + 219, + 234 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 28 + ], + [ + 33, + 34 + ], + [ + 52, + 55 + ], + [ + 59, + 60 + ], + [ + 62, + 63 + ], + [ + 66, + 67 + ], + [ + 70, + 72 + ], + [ + 73, + 74 + ], + [ + 79, + 81 + ], + [ + 84, + 86 + ], + [ + 88, + 89 + ], + [ + 90, + 93 + ], + [ + 96, + 99 + ], + [ + 102, + 108 + ], + [ + 114, + 116 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 124 + ], + [ + 130, + 131 + ], + [ + 133, + 153 + ], + [ + 156, + 157 + ], + [ + 176, + 177 + ], + [ + 185, + 186 + ], + [ + 187, + 189 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 195, + 197 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 205, + 208 + ], + [ + 211, + 212 + ], + [ + 222, + 224 + ], + [ + 228, + 231 + ], + [ + 232, + 233 + ] + ] + } + }, + { + "filename": "libvips/convolution/conva.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 13, + 41 + ], + [ + 44, + 51 + ], + [ + 70, + 80 + ], + [ + 102, + 109 + ], + [ + 115, + 122 + ], + [ + 141, + 148 + ], + [ + 162, + 169 + ], + [ + 188, + 195 + ], + [ + 202, + 232 + ], + [ + 233, + 313 + ], + [ + 319, + 350 + ], + [ + 355, + 430 + ], + [ + 431, + 447 + ], + [ + 449, + 461 + ], + [ + 463, + 477 + ], + [ + 478, + 504 + ], + [ + 507, + 571 + ], + [ + 572, + 653 + ], + [ + 657, + 670 + ], + [ + 675, + 730 + ], + [ + 732, + 768 + ], + [ + 769, + 877 + ], + [ + 879, + 890 + ], + [ + 895, + 966 + ], + [ + 967, + 1107 + ], + [ + 1110, + 1121 + ], + [ + 1126, + 1324 + ], + [ + 1333, + 1350 + ], + [ + 1354, + 1369 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 7, + 8 + ], + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 32 + ], + [ + 37, + 38 + ], + [ + 47, + 48 + ], + [ + 73, + 74 + ], + [ + 75, + 77 + ], + [ + 105, + 106 + ], + [ + 118, + 119 + ], + [ + 144, + 145 + ], + [ + 165, + 166 + ], + [ + 191, + 192 + ], + [ + 205, + 206 + ], + [ + 210, + 211 + ], + [ + 212, + 214 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 226, + 227 + ], + [ + 228, + 229 + ], + [ + 236, + 239 + ], + [ + 242, + 245 + ], + [ + 248, + 249 + ], + [ + 253, + 254 + ], + [ + 257, + 260 + ], + [ + 262, + 265 + ], + [ + 266, + 268 + ], + [ + 270, + 273 + ], + [ + 274, + 275 + ], + [ + 276, + 278 + ], + [ + 282, + 283 + ], + [ + 286, + 299 + ], + [ + 305, + 306 + ], + [ + 309, + 310 + ], + [ + 322, + 325 + ], + [ + 327, + 329 + ], + [ + 335, + 336 + ], + [ + 337, + 338 + ], + [ + 340, + 342 + ], + [ + 346, + 347 + ], + [ + 358, + 359 + ], + [ + 365, + 366 + ], + [ + 368, + 370 + ], + [ + 372, + 377 + ], + [ + 381, + 386 + ], + [ + 391, + 395 + ], + [ + 399, + 402 + ], + [ + 404, + 405 + ], + [ + 410, + 411 + ], + [ + 412, + 413 + ], + [ + 414, + 416 + ], + [ + 422, + 423 + ], + [ + 426, + 427 + ], + [ + 434, + 435 + ], + [ + 436, + 437 + ], + [ + 442, + 444 + ], + [ + 452, + 453 + ], + [ + 457, + 458 + ], + [ + 466, + 467 + ], + [ + 473, + 474 + ], + [ + 481, + 483 + ], + [ + 485, + 486 + ], + [ + 488, + 489 + ], + [ + 491, + 493 + ], + [ + 499, + 501 + ], + [ + 510, + 511 + ], + [ + 516, + 517 + ], + [ + 523, + 524 + ], + [ + 526, + 527 + ], + [ + 531, + 532 + ], + [ + 534, + 535 + ], + [ + 540, + 541 + ], + [ + 543, + 544 + ], + [ + 546, + 547 + ], + [ + 551, + 552 + ], + [ + 558, + 559 + ], + [ + 562, + 563 + ], + [ + 566, + 568 + ], + [ + 575, + 577 + ], + [ + 579, + 581 + ], + [ + 584, + 586 + ], + [ + 591, + 592 + ], + [ + 596, + 598 + ], + [ + 599, + 601 + ], + [ + 602, + 603 + ], + [ + 606, + 607 + ], + [ + 610, + 611 + ], + [ + 614, + 616 + ], + [ + 618, + 619 + ], + [ + 624, + 630 + ], + [ + 634, + 635 + ], + [ + 638, + 640 + ], + [ + 644, + 646 + ], + [ + 649, + 650 + ], + [ + 660, + 662 + ], + [ + 663, + 664 + ], + [ + 665, + 667 + ], + [ + 678, + 679 + ], + [ + 684, + 685 + ], + [ + 686, + 687 + ], + [ + 688, + 689 + ], + [ + 690, + 692 + ], + [ + 697, + 699 + ], + [ + 702, + 706 + ], + [ + 710, + 711 + ], + [ + 714, + 715 + ], + [ + 721, + 722 + ], + [ + 725, + 727 + ], + [ + 735, + 738 + ], + [ + 744, + 746 + ], + [ + 747, + 748 + ], + [ + 752, + 754 + ], + [ + 759, + 762 + ], + [ + 764, + 765 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ], + [ + 776, + 777 + ], + [ + 779, + 780 + ], + [ + 781, + 782 + ], + [ + 784, + 785 + ], + [ + 790, + 791 + ], + [ + 794, + 795 + ], + [ + 796, + 797 + ], + [ + 802, + 803 + ], + [ + 809, + 810 + ], + [ + 811, + 812 + ], + [ + 815, + 817 + ], + [ + 818, + 820 + ], + [ + 821, + 823 + ], + [ + 824, + 825 + ], + [ + 827, + 828 + ], + [ + 834, + 852 + ], + [ + 855, + 865 + ], + [ + 867, + 868 + ], + [ + 872, + 874 + ], + [ + 882, + 883 + ], + [ + 886, + 887 + ], + [ + 898, + 900 + ], + [ + 901, + 905 + ], + [ + 906, + 907 + ], + [ + 908, + 909 + ], + [ + 911, + 912 + ], + [ + 917, + 922 + ], + [ + 923, + 924 + ], + [ + 926, + 929 + ], + [ + 930, + 931 + ], + [ + 933, + 935 + ], + [ + 937, + 939 + ], + [ + 941, + 943 + ], + [ + 945, + 947 + ], + [ + 949, + 951 + ], + [ + 953, + 955 + ], + [ + 957, + 959 + ], + [ + 961, + 963 + ], + [ + 970, + 971 + ], + [ + 974, + 975 + ], + [ + 976, + 977 + ], + [ + 981, + 985 + ], + [ + 987, + 991 + ], + [ + 996, + 1007 + ], + [ + 1009, + 1074 + ], + [ + 1076, + 1078 + ], + [ + 1080, + 1095 + ], + [ + 1097, + 1098 + ], + [ + 1099, + 1100 + ], + [ + 1102, + 1104 + ], + [ + 1113, + 1114 + ], + [ + 1117, + 1118 + ], + [ + 1129, + 1131 + ], + [ + 1132, + 1136 + ], + [ + 1137, + 1138 + ], + [ + 1139, + 1140 + ], + [ + 1142, + 1144 + ], + [ + 1145, + 1146 + ], + [ + 1150, + 1155 + ], + [ + 1156, + 1158 + ], + [ + 1160, + 1164 + ], + [ + 1165, + 1167 + ], + [ + 1169, + 1172 + ], + [ + 1174, + 1176 + ], + [ + 1178, + 1180 + ], + [ + 1182, + 1184 + ], + [ + 1186, + 1188 + ], + [ + 1190, + 1192 + ], + [ + 1194, + 1196 + ], + [ + 1198, + 1200 + ], + [ + 1206, + 1207 + ], + [ + 1210, + 1211 + ], + [ + 1212, + 1213 + ], + [ + 1218, + 1222 + ], + [ + 1224, + 1228 + ], + [ + 1232, + 1236 + ], + [ + 1237, + 1238 + ], + [ + 1241, + 1242 + ], + [ + 1245, + 1246 + ], + [ + 1249, + 1251 + ], + [ + 1254, + 1257 + ], + [ + 1259, + 1261 + ], + [ + 1265, + 1267 + ], + [ + 1268, + 1274 + ], + [ + 1276, + 1281 + ], + [ + 1285, + 1286 + ], + [ + 1289, + 1290 + ], + [ + 1291, + 1292 + ], + [ + 1298, + 1299 + ], + [ + 1301, + 1314 + ], + [ + 1317, + 1318 + ], + [ + 1319, + 1321 + ], + [ + 1336, + 1338 + ], + [ + 1339, + 1341 + ], + [ + 1346, + 1347 + ], + [ + 1357, + 1359 + ], + [ + 1363, + 1366 + ], + [ + 1367, + 1368 + ] + ] + } + }, + { + "filename": "libvips/convolution/convasep.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 13, + 41 + ], + [ + 44, + 51 + ], + [ + 53, + 69 + ], + [ + 96, + 108 + ], + [ + 113, + 121 + ], + [ + 132, + 172 + ], + [ + 177, + 195 + ], + [ + 197, + 214 + ], + [ + 225, + 262 + ], + [ + 268, + 277 + ], + [ + 282, + 290 + ], + [ + 291, + 311 + ], + [ + 312, + 337 + ], + [ + 338, + 551 + ], + [ + 553, + 564 + ], + [ + 569, + 631 + ], + [ + 632, + 727 + ], + [ + 729, + 740 + ], + [ + 745, + 828 + ], + [ + 830, + 928 + ], + [ + 936, + 973 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 7, + 8 + ], + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 32 + ], + [ + 37, + 38 + ], + [ + 47, + 48 + ], + [ + 56, + 57 + ], + [ + 61, + 62 + ], + [ + 64, + 66 + ], + [ + 99, + 100 + ], + [ + 101, + 103 + ], + [ + 104, + 105 + ], + [ + 116, + 118 + ], + [ + 135, + 136 + ], + [ + 138, + 139 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 151, + 154 + ], + [ + 157, + 158 + ], + [ + 163, + 164 + ], + [ + 166, + 169 + ], + [ + 180, + 183 + ], + [ + 188, + 190 + ], + [ + 191, + 192 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 205, + 206 + ], + [ + 210, + 211 + ], + [ + 228, + 229 + ], + [ + 232, + 237 + ], + [ + 240, + 243 + ], + [ + 247, + 250 + ], + [ + 255, + 259 + ], + [ + 271, + 274 + ], + [ + 285, + 287 + ], + [ + 294, + 297 + ], + [ + 303, + 304 + ], + [ + 306, + 308 + ], + [ + 315, + 319 + ], + [ + 321, + 323 + ], + [ + 324, + 325 + ], + [ + 326, + 327 + ], + [ + 328, + 331 + ], + [ + 333, + 334 + ], + [ + 341, + 342 + ], + [ + 343, + 344 + ], + [ + 349, + 351 + ], + [ + 352, + 353 + ], + [ + 358, + 359 + ], + [ + 362, + 367 + ], + [ + 368, + 369 + ], + [ + 374, + 375 + ], + [ + 381, + 383 + ], + [ + 387, + 390 + ], + [ + 392, + 394 + ], + [ + 395, + 396 + ], + [ + 398, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 452 + ], + [ + 457, + 469 + ], + [ + 470, + 474 + ], + [ + 476, + 480 + ], + [ + 481, + 482 + ], + [ + 484, + 498 + ], + [ + 499, + 500 + ], + [ + 501, + 513 + ], + [ + 514, + 518 + ], + [ + 520, + 524 + ], + [ + 527, + 540 + ], + [ + 541, + 542 + ], + [ + 546, + 548 + ], + [ + 556, + 557 + ], + [ + 560, + 561 + ], + [ + 572, + 574 + ], + [ + 578, + 582 + ], + [ + 583, + 584 + ], + [ + 585, + 586 + ], + [ + 588, + 589 + ], + [ + 594, + 598 + ], + [ + 600, + 602 + ], + [ + 604, + 606 + ], + [ + 608, + 610 + ], + [ + 612, + 614 + ], + [ + 616, + 618 + ], + [ + 620, + 623 + ], + [ + 625, + 628 + ], + [ + 635, + 636 + ], + [ + 638, + 650 + ], + [ + 651, + 655 + ], + [ + 659, + 660 + ], + [ + 662, + 677 + ], + [ + 678, + 679 + ], + [ + 680, + 692 + ], + [ + 693, + 697 + ], + [ + 702, + 715 + ], + [ + 716, + 717 + ], + [ + 722, + 724 + ], + [ + 732, + 733 + ], + [ + 736, + 737 + ], + [ + 748, + 750 + ], + [ + 754, + 757 + ], + [ + 758, + 759 + ], + [ + 760, + 761 + ], + [ + 763, + 764 + ], + [ + 769, + 772 + ], + [ + 774, + 776 + ], + [ + 778, + 780 + ], + [ + 782, + 784 + ], + [ + 786, + 788 + ], + [ + 790, + 792 + ], + [ + 794, + 797 + ], + [ + 799, + 802 + ], + [ + 808, + 809 + ], + [ + 812, + 814 + ], + [ + 815, + 816 + ], + [ + 819, + 823 + ], + [ + 824, + 825 + ], + [ + 833, + 838 + ], + [ + 840, + 843 + ], + [ + 844, + 845 + ], + [ + 847, + 849 + ], + [ + 850, + 851 + ], + [ + 853, + 854 + ], + [ + 857, + 859 + ], + [ + 860, + 862 + ], + [ + 865, + 868 + ], + [ + 871, + 873 + ], + [ + 874, + 880 + ], + [ + 882, + 889 + ], + [ + 893, + 895 + ], + [ + 896, + 897 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 909, + 911 + ], + [ + 913, + 919 + ], + [ + 922, + 923 + ], + [ + 924, + 925 + ], + [ + 939, + 941 + ], + [ + 942, + 945 + ], + [ + 950, + 951 + ], + [ + 954, + 956 + ], + [ + 961, + 963 + ], + [ + 967, + 970 + ], + [ + 971, + 972 + ] + ] + } + }, + { + "filename": "libvips/convolution/convf.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 31 + ], + [ + 55, + 83 + ], + [ + 99, + 200 + ], + [ + 204, + 267 + ], + [ + 268, + 287 + ], + [ + 289, + 316 + ], + [ + 318, + 325 + ], + [ + 326, + 344 + ], + [ + 345, + 382 + ], + [ + 386, + 416 + ] + ], + "lines_added": [ + [ + 19, + 20 + ], + [ + 22, + 23 + ], + [ + 27, + 28 + ], + [ + 58, + 59 + ], + [ + 60, + 64 + ], + [ + 65, + 74 + ], + [ + 79, + 80 + ], + [ + 102, + 104 + ], + [ + 108, + 109 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 130, + 131 + ], + [ + 136, + 137 + ], + [ + 142, + 144 + ], + [ + 149, + 153 + ], + [ + 155, + 156 + ], + [ + 158, + 176 + ], + [ + 180, + 181 + ], + [ + 186, + 187 + ], + [ + 189, + 190 + ], + [ + 191, + 192 + ], + [ + 194, + 197 + ], + [ + 207, + 209 + ], + [ + 210, + 211 + ], + [ + 213, + 215 + ], + [ + 216, + 217 + ], + [ + 221, + 225 + ], + [ + 228, + 229 + ], + [ + 230, + 234 + ], + [ + 236, + 238 + ], + [ + 240, + 242 + ], + [ + 244, + 246 + ], + [ + 248, + 250 + ], + [ + 252, + 254 + ], + [ + 256, + 259 + ], + [ + 261, + 264 + ], + [ + 271, + 272 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 279, + 280 + ], + [ + 283, + 284 + ], + [ + 292, + 294 + ], + [ + 296, + 297 + ], + [ + 301, + 303 + ], + [ + 305, + 308 + ], + [ + 311, + 313 + ], + [ + 321, + 322 + ], + [ + 329, + 336 + ], + [ + 337, + 341 + ], + [ + 348, + 349 + ], + [ + 353, + 356 + ], + [ + 360, + 361 + ], + [ + 364, + 365 + ], + [ + 369, + 370 + ], + [ + 374, + 375 + ], + [ + 376, + 379 + ], + [ + 389, + 390 + ], + [ + 394, + 395 + ], + [ + 396, + 397 + ], + [ + 398, + 399 + ], + [ + 404, + 406 + ], + [ + 410, + 413 + ], + [ + 414, + 415 + ] + ] + } + }, + { + "filename": "libvips/convolution/convi.c", + "line_filter": { + "diff_chunks": [ + [ + 30, + 42 + ], + [ + 75, + 114 + ], + [ + 131, + 160 + ], + [ + 166, + 255 + ], + [ + 257, + 306 + ], + [ + 308, + 343 + ], + [ + 348, + 392 + ], + [ + 393, + 487 + ], + [ + 488, + 495 + ], + [ + 497, + 505 + ], + [ + 507, + 693 + ], + [ + 697, + 760 + ], + [ + 761, + 772 + ], + [ + 774, + 781 + ], + [ + 783, + 794 + ], + [ + 801, + 843 + ], + [ + 845, + 852 + ], + [ + 855, + 895 + ], + [ + 897, + 1014 + ], + [ + 1015, + 1073 + ], + [ + 1074, + 1109 + ], + [ + 1112, + 1132 + ], + [ + 1133, + 1148 + ] + ], + "lines_added": [ + [ + 33, + 34 + ], + [ + 38, + 39 + ], + [ + 78, + 79 + ], + [ + 85, + 86 + ], + [ + 87, + 91 + ], + [ + 92, + 101 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 134, + 135 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 150, + 151 + ], + [ + 156, + 157 + ], + [ + 169, + 170 + ], + [ + 174, + 176 + ], + [ + 180, + 181 + ], + [ + 186, + 187 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 193, + 194 + ], + [ + 200, + 201 + ], + [ + 204, + 206 + ], + [ + 207, + 208 + ], + [ + 211, + 212 + ], + [ + 216, + 219 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 229, + 230 + ], + [ + 233, + 237 + ], + [ + 238, + 239 + ], + [ + 244, + 245 + ], + [ + 250, + 252 + ], + [ + 260, + 261 + ], + [ + 264, + 268 + ], + [ + 273, + 281 + ], + [ + 284, + 285 + ], + [ + 287, + 293 + ], + [ + 295, + 296 + ], + [ + 302, + 303 + ], + [ + 311, + 312 + ], + [ + 314, + 315 + ], + [ + 318, + 319 + ], + [ + 322, + 325 + ], + [ + 327, + 329 + ], + [ + 330, + 331 + ], + [ + 333, + 335 + ], + [ + 336, + 338 + ], + [ + 339, + 340 + ], + [ + 351, + 352 + ], + [ + 356, + 357 + ], + [ + 360, + 362 + ], + [ + 363, + 366 + ], + [ + 371, + 372 + ], + [ + 373, + 375 + ], + [ + 378, + 382 + ], + [ + 384, + 385 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 396, + 397 + ], + [ + 398, + 400 + ], + [ + 402, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 410 + ], + [ + 414, + 415 + ], + [ + 418, + 419 + ], + [ + 424, + 425 + ], + [ + 426, + 427 + ], + [ + 428, + 429 + ], + [ + 432, + 433 + ], + [ + 434, + 436 + ], + [ + 437, + 439 + ], + [ + 440, + 441 + ], + [ + 442, + 444 + ], + [ + 445, + 446 + ], + [ + 449, + 450 + ], + [ + 456, + 457 + ], + [ + 459, + 461 + ], + [ + 467, + 469 + ], + [ + 471, + 472 + ], + [ + 475, + 477 + ], + [ + 478, + 479 + ], + [ + 482, + 484 + ], + [ + 491, + 492 + ], + [ + 500, + 502 + ], + [ + 510, + 517 + ], + [ + 518, + 519 + ], + [ + 520, + 522 + ], + [ + 524, + 534 + ], + [ + 539, + 541 + ], + [ + 542, + 548 + ], + [ + 549, + 550 + ], + [ + 553, + 554 + ], + [ + 556, + 559 + ], + [ + 561, + 563 + ], + [ + 566, + 567 + ], + [ + 568, + 569 + ], + [ + 570, + 571 + ], + [ + 575, + 597 + ], + [ + 600, + 620 + ], + [ + 623, + 666 + ], + [ + 670, + 672 + ], + [ + 677, + 678 + ], + [ + 679, + 680 + ], + [ + 682, + 683 + ], + [ + 684, + 685 + ], + [ + 687, + 690 + ], + [ + 700, + 702 + ], + [ + 703, + 704 + ], + [ + 706, + 708 + ], + [ + 709, + 710 + ], + [ + 714, + 718 + ], + [ + 721, + 722 + ], + [ + 723, + 727 + ], + [ + 729, + 731 + ], + [ + 733, + 735 + ], + [ + 737, + 739 + ], + [ + 741, + 743 + ], + [ + 745, + 747 + ], + [ + 749, + 752 + ], + [ + 754, + 757 + ], + [ + 764, + 765 + ], + [ + 766, + 767 + ], + [ + 768, + 769 + ], + [ + 777, + 778 + ], + [ + 786, + 791 + ], + [ + 804, + 816 + ], + [ + 817, + 818 + ], + [ + 823, + 826 + ], + [ + 828, + 829 + ], + [ + 830, + 832 + ], + [ + 834, + 836 + ], + [ + 837, + 838 + ], + [ + 839, + 840 + ], + [ + 848, + 849 + ], + [ + 858, + 860 + ], + [ + 863, + 867 + ], + [ + 868, + 871 + ], + [ + 873, + 883 + ], + [ + 888, + 890 + ], + [ + 891, + 892 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 905, + 906 + ], + [ + 907, + 911 + ], + [ + 917, + 921 + ], + [ + 922, + 923 + ], + [ + 924, + 928 + ], + [ + 932, + 944 + ], + [ + 949, + 966 + ], + [ + 967, + 968 + ], + [ + 969, + 974 + ], + [ + 975, + 979 + ], + [ + 981, + 982 + ], + [ + 985, + 986 + ], + [ + 989, + 990 + ], + [ + 995, + 996 + ], + [ + 997, + 999 + ], + [ + 1004, + 1011 + ], + [ + 1018, + 1022 + ], + [ + 1023, + 1024 + ], + [ + 1026, + 1027 + ], + [ + 1031, + 1033 + ], + [ + 1036, + 1038 + ], + [ + 1040, + 1045 + ], + [ + 1046, + 1047 + ], + [ + 1049, + 1051 + ], + [ + 1056, + 1057 + ], + [ + 1059, + 1060 + ], + [ + 1066, + 1070 + ], + [ + 1077, + 1080 + ], + [ + 1084, + 1085 + ], + [ + 1088, + 1089 + ], + [ + 1090, + 1091 + ], + [ + 1096, + 1097 + ], + [ + 1101, + 1102 + ], + [ + 1103, + 1106 + ], + [ + 1115, + 1117 + ], + [ + 1119, + 1120 + ], + [ + 1125, + 1126 + ], + [ + 1128, + 1129 + ], + [ + 1136, + 1138 + ], + [ + 1142, + 1145 + ], + [ + 1146, + 1147 + ] + ] + } + }, + { + "filename": "libvips/convolution/convolution.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 51, + 58 + ], + [ + 62, + 78 + ], + [ + 80, + 124 + ], + [ + 125, + 152 + ], + [ + 153, + 186 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 32, + 33 + ], + [ + 54, + 55 + ], + [ + 65, + 66 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 83, + 85 + ], + [ + 87, + 88 + ], + [ + 89, + 92 + ], + [ + 94, + 97 + ], + [ + 99, + 101 + ], + [ + 102, + 104 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 115 + ], + [ + 120, + 121 + ], + [ + 128, + 131 + ], + [ + 132, + 133 + ], + [ + 134, + 139 + ], + [ + 140, + 145 + ], + [ + 148, + 149 + ], + [ + 156, + 157 + ], + [ + 158, + 185 + ] + ] + } + }, + { + "filename": "libvips/convolution/convsep.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 9, + 37 + ], + [ + 48, + 156 + ], + [ + 172, + 181 + ], + [ + 182, + 197 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 28 + ], + [ + 33, + 34 + ], + [ + 51, + 54 + ], + [ + 58, + 59 + ], + [ + 61, + 62 + ], + [ + 63, + 64 + ], + [ + 66, + 68 + ], + [ + 71, + 72 + ], + [ + 73, + 75 + ], + [ + 76, + 78 + ], + [ + 81, + 86 + ], + [ + 88, + 89 + ], + [ + 91, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 102 + ], + [ + 105, + 107 + ], + [ + 110, + 112 + ], + [ + 113, + 114 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 126, + 127 + ], + [ + 129, + 149 + ], + [ + 152, + 153 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 185, + 187 + ], + [ + 191, + 194 + ], + [ + 195, + 196 + ] + ] + } + }, + { + "filename": "libvips/convolution/correlation.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 45, + 63 + ], + [ + 67, + 172 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 48, + 50 + ], + [ + 52, + 54 + ], + [ + 57, + 60 + ], + [ + 70, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 79, + 80 + ], + [ + 81, + 83 + ], + [ + 84, + 85 + ], + [ + 86, + 88 + ], + [ + 91, + 102 + ], + [ + 106, + 107 + ], + [ + 111, + 115 + ], + [ + 117, + 118 + ], + [ + 119, + 131 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ], + [ + 144, + 145 + ], + [ + 149, + 152 + ], + [ + 153, + 154 + ], + [ + 155, + 160 + ], + [ + 161, + 166 + ], + [ + 169, + 170 + ] + ] + } + }, + { + "filename": "libvips/convolution/correlation.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 72, + 95 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 75, + 76 + ], + [ + 81, + 82 + ], + [ + 83, + 85 + ], + [ + 88, + 89 + ] + ] + } + }, + { + "filename": "libvips/convolution/fastcor.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 19 + ], + [ + 28, + 56 + ], + [ + 69, + 189 + ], + [ + 198, + 205 + ], + [ + 207, + 227 + ], + [ + 234, + 253 + ], + [ + 254, + 269 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 31, + 32 + ], + [ + 33, + 37 + ], + [ + 38, + 47 + ], + [ + 52, + 53 + ], + [ + 72, + 98 + ], + [ + 99, + 101 + ], + [ + 102, + 129 + ], + [ + 130, + 132 + ], + [ + 133, + 135 + ], + [ + 137, + 139 + ], + [ + 142, + 145 + ], + [ + 148, + 152 + ], + [ + 153, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 164 + ], + [ + 165, + 168 + ], + [ + 169, + 172 + ], + [ + 173, + 177 + ], + [ + 178, + 181 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 201, + 202 + ], + [ + 210, + 211 + ], + [ + 213, + 214 + ], + [ + 216, + 217 + ], + [ + 223, + 224 + ], + [ + 237, + 238 + ], + [ + 240, + 242 + ], + [ + 243, + 245 + ], + [ + 249, + 250 + ], + [ + 257, + 259 + ], + [ + 263, + 266 + ], + [ + 267, + 268 + ] + ] + } + }, + { + "filename": "libvips/convolution/gaussblur.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 11, + 39 + ], + [ + 57, + 174 + ], + [ + 184, + 205 + ] + ], + "lines_added": [ + [ + 1, + 3 + ], + [ + 14, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 35, + 36 + ], + [ + 60, + 63 + ], + [ + 68, + 69 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 76, + 78 + ], + [ + 82, + 85 + ], + [ + 87, + 93 + ], + [ + 95, + 97 + ], + [ + 99, + 100 + ], + [ + 101, + 105 + ], + [ + 107, + 108 + ], + [ + 109, + 111 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 126, + 127 + ], + [ + 131, + 134 + ], + [ + 135, + 136 + ], + [ + 137, + 142 + ], + [ + 143, + 146 + ], + [ + 147, + 149 + ], + [ + 150, + 153 + ], + [ + 154, + 156 + ], + [ + 157, + 163 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 193, + 195 + ], + [ + 199, + 202 + ], + [ + 203, + 204 + ] + ] + } + }, + { + "filename": "libvips/convolution/pconvolution.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 71, + 81 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 74, + 75 + ] + ] + } + }, + { + "filename": "libvips/convolution/sharpen.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 9 + ], + [ + 22, + 29 + ], + [ + 45, + 73 + ], + [ + 91, + 98 + ], + [ + 100, + 107 + ], + [ + 110, + 143 + ], + [ + 148, + 391 + ], + [ + 404, + 411 + ], + [ + 415, + 427 + ], + [ + 443, + 472 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 5, + 6 + ], + [ + 25, + 26 + ], + [ + 48, + 54 + ], + [ + 55, + 59 + ], + [ + 60, + 64 + ], + [ + 69, + 70 + ], + [ + 94, + 95 + ], + [ + 103, + 104 + ], + [ + 113, + 114 + ], + [ + 116, + 118 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 126, + 128 + ], + [ + 129, + 130 + ], + [ + 131, + 138 + ], + [ + 139, + 140 + ], + [ + 151, + 153 + ], + [ + 155, + 157 + ], + [ + 158, + 159 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 175, + 177 + ], + [ + 182, + 183 + ], + [ + 184, + 186 + ], + [ + 190, + 192 + ], + [ + 194, + 195 + ], + [ + 197, + 199 + ], + [ + 201, + 205 + ], + [ + 206, + 208 + ], + [ + 209, + 214 + ], + [ + 216, + 218 + ], + [ + 222, + 224 + ], + [ + 225, + 226 + ], + [ + 231, + 232 + ], + [ + 236, + 237 + ], + [ + 240, + 241 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 251, + 252 + ], + [ + 255, + 265 + ], + [ + 269, + 272 + ], + [ + 273, + 275 + ], + [ + 277, + 280 + ], + [ + 281, + 285 + ], + [ + 286, + 287 + ], + [ + 290, + 294 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 305, + 306 + ], + [ + 311, + 312 + ], + [ + 316, + 319 + ], + [ + 320, + 321 + ], + [ + 322, + 327 + ], + [ + 328, + 331 + ], + [ + 332, + 334 + ], + [ + 335, + 338 + ], + [ + 339, + 341 + ], + [ + 342, + 345 + ], + [ + 346, + 348 + ], + [ + 349, + 352 + ], + [ + 353, + 355 + ], + [ + 356, + 359 + ], + [ + 360, + 362 + ], + [ + 363, + 366 + ], + [ + 367, + 369 + ], + [ + 372, + 375 + ], + [ + 376, + 378 + ], + [ + 381, + 382 + ], + [ + 385, + 388 + ], + [ + 407, + 408 + ], + [ + 418, + 419 + ], + [ + 420, + 422 + ], + [ + 423, + 424 + ], + [ + 446, + 448 + ], + [ + 449, + 454 + ], + [ + 457, + 458 + ], + [ + 460, + 462 + ], + [ + 466, + 469 + ], + [ + 470, + 471 + ] + ] + } + }, + { + "filename": "libvips/convolution/sobel.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 59, + 109 + ], + [ + 110, + 228 + ], + [ + 234, + 252 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 62, + 63 + ], + [ + 65, + 67 + ], + [ + 69, + 70 + ], + [ + 74, + 76 + ], + [ + 77, + 84 + ], + [ + 85, + 86 + ], + [ + 88, + 89 + ], + [ + 94, + 95 + ], + [ + 100, + 101 + ], + [ + 102, + 104 + ], + [ + 105, + 106 + ], + [ + 113, + 126 + ], + [ + 127, + 129 + ], + [ + 130, + 131 + ], + [ + 135, + 138 + ], + [ + 139, + 143 + ], + [ + 144, + 145 + ], + [ + 150, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 156 + ], + [ + 157, + 165 + ], + [ + 166, + 171 + ], + [ + 172, + 173 + ], + [ + 174, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 185, + 188 + ], + [ + 190, + 192 + ], + [ + 194, + 195 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 207, + 208 + ], + [ + 210, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 221 + ], + [ + 224, + 225 + ], + [ + 237, + 238 + ], + [ + 240, + 242 + ], + [ + 246, + 249 + ], + [ + 250, + 251 + ] + ] + } + }, + { + "filename": "libvips/convolution/spcor.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 18 + ], + [ + 42, + 70 + ], + [ + 87, + 216 + ], + [ + 218, + 266 + ], + [ + 271, + 280 + ], + [ + 306, + 319 + ], + [ + 320, + 327 + ], + [ + 338, + 346 + ], + [ + 352, + 363 + ], + [ + 367, + 382 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 14, + 15 + ], + [ + 45, + 46 + ], + [ + 47, + 51 + ], + [ + 52, + 61 + ], + [ + 66, + 67 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 106, + 114 + ], + [ + 117, + 119 + ], + [ + 122, + 131 + ], + [ + 132, + 136 + ], + [ + 139, + 147 + ], + [ + 148, + 149 + ], + [ + 151, + 152 + ], + [ + 154, + 170 + ], + [ + 171, + 202 + ], + [ + 204, + 206 + ], + [ + 210, + 213 + ], + [ + 221, + 224 + ], + [ + 225, + 228 + ], + [ + 229, + 233 + ], + [ + 235, + 237 + ], + [ + 239, + 241 + ], + [ + 243, + 245 + ], + [ + 247, + 250 + ], + [ + 251, + 254 + ], + [ + 255, + 259 + ], + [ + 260, + 263 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 309, + 310 + ], + [ + 312, + 313 + ], + [ + 315, + 316 + ], + [ + 323, + 324 + ], + [ + 341, + 343 + ], + [ + 355, + 356 + ], + [ + 358, + 360 + ], + [ + 370, + 372 + ], + [ + 376, + 379 + ], + [ + 380, + 381 + ] + ] + } + }, + { + "filename": "libvips/create/black.c", + "line_filter": { + "diff_chunks": [ + [ + 22, + 50 + ], + [ + 77, + 166 + ], + [ + 182, + 196 + ] + ], + "lines_added": [ + [ + 25, + 41 + ], + [ + 46, + 47 + ], + [ + 80, + 81 + ], + [ + 83, + 85 + ], + [ + 86, + 88 + ], + [ + 89, + 93 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 105, + 107 + ], + [ + 108, + 110 + ], + [ + 111, + 116 + ], + [ + 117, + 120 + ], + [ + 121, + 122 + ], + [ + 125, + 126 + ], + [ + 127, + 129 + ], + [ + 130, + 131 + ], + [ + 136, + 137 + ], + [ + 139, + 142 + ], + [ + 143, + 145 + ], + [ + 146, + 149 + ], + [ + 150, + 152 + ], + [ + 153, + 156 + ], + [ + 157, + 159 + ], + [ + 162, + 163 + ], + [ + 185, + 186 + ], + [ + 190, + 193 + ], + [ + 194, + 195 + ] + ] + } + }, + { + "filename": "libvips/create/buildlut.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 20, + 48 + ], + [ + 67, + 189 + ], + [ + 195, + 212 + ], + [ + 215, + 274 + ], + [ + 279, + 286 + ], + [ + 296, + 303 + ], + [ + 328, + 336 + ], + [ + 338, + 352 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 70, + 71 + ], + [ + 76, + 80 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 91, + 94 + ], + [ + 95, + 96 + ], + [ + 101, + 102 + ], + [ + 108, + 114 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 126, + 130 + ], + [ + 132, + 136 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 148, + 151 + ], + [ + 153, + 157 + ], + [ + 158, + 161 + ], + [ + 164, + 166 + ], + [ + 168, + 170 + ], + [ + 172, + 173 + ], + [ + 174, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 198, + 202 + ], + [ + 207, + 209 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 224, + 226 + ], + [ + 228, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 237 + ], + [ + 238, + 244 + ], + [ + 245, + 246 + ], + [ + 249, + 250 + ], + [ + 251, + 253 + ], + [ + 259, + 260 + ], + [ + 262, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 271 + ], + [ + 282, + 283 + ], + [ + 299, + 300 + ], + [ + 331, + 333 + ], + [ + 341, + 342 + ], + [ + 346, + 349 + ], + [ + 350, + 351 + ] + ] + } + }, + { + "filename": "libvips/create/create.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 58 + ], + [ + 63, + 74 + ], + [ + 77, + 189 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 66, + 67 + ], + [ + 70, + 71 + ], + [ + 80, + 81 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 88, + 91 + ], + [ + 93, + 94 + ], + [ + 95, + 97 + ], + [ + 98, + 99 + ], + [ + 102, + 103 + ], + [ + 104, + 106 + ], + [ + 111, + 112 + ], + [ + 114, + 119 + ], + [ + 122, + 123 + ], + [ + 127, + 128 + ], + [ + 129, + 133 + ], + [ + 134, + 135 + ], + [ + 136, + 158 + ], + [ + 162, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 188 + ] + ] + } + }, + { + "filename": "libvips/create/eye.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 45 + ], + [ + 70, + 124 + ], + [ + 130, + 155 + ] + ], + "lines_added": [ + [ + 20, + 36 + ], + [ + 41, + 42 + ], + [ + 73, + 74 + ], + [ + 76, + 77 + ], + [ + 82, + 84 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 94, + 97 + ], + [ + 102, + 104 + ], + [ + 107, + 110 + ], + [ + 111, + 113 + ], + [ + 116, + 117 + ], + [ + 133, + 135 + ], + [ + 137, + 138 + ], + [ + 144, + 145 + ], + [ + 149, + 152 + ], + [ + 153, + 154 + ] + ] + } + }, + { + "filename": "libvips/create/fractsurf.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 62, + 133 + ], + [ + 138, + 145 + ], + [ + 146, + 162 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 65, + 66 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 74, + 76 + ], + [ + 77, + 78 + ], + [ + 80, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 95 + ], + [ + 100, + 101 + ], + [ + 103, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 113 + ], + [ + 114, + 116 + ], + [ + 117, + 120 + ], + [ + 121, + 123 + ], + [ + 126, + 127 + ], + [ + 128, + 130 + ], + [ + 141, + 142 + ], + [ + 149, + 151 + ], + [ + 155, + 159 + ], + [ + 160, + 161 + ] + ] + } + }, + { + "filename": "libvips/create/gaussmat.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 21 + ], + [ + 25, + 53 + ], + [ + 75, + 83 + ], + [ + 85, + 225 + ], + [ + 237, + 246 + ], + [ + 250, + 260 + ], + [ + 262, + 276 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 28, + 29 + ], + [ + 30, + 34 + ], + [ + 35, + 44 + ], + [ + 49, + 50 + ], + [ + 78, + 80 + ], + [ + 88, + 89 + ], + [ + 95, + 96 + ], + [ + 97, + 99 + ], + [ + 100, + 102 + ], + [ + 104, + 106 + ], + [ + 107, + 109 + ], + [ + 114, + 117 + ], + [ + 119, + 120 + ], + [ + 122, + 124 + ], + [ + 125, + 126 + ], + [ + 128, + 131 + ], + [ + 132, + 134 + ], + [ + 135, + 138 + ], + [ + 139, + 143 + ], + [ + 145, + 147 + ], + [ + 150, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 165, + 167 + ], + [ + 168, + 169 + ], + [ + 172, + 173 + ], + [ + 174, + 176 + ], + [ + 181, + 182 + ], + [ + 184, + 187 + ], + [ + 188, + 190 + ], + [ + 191, + 194 + ], + [ + 195, + 197 + ], + [ + 198, + 201 + ], + [ + 202, + 204 + ], + [ + 205, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 218 + ], + [ + 221, + 222 + ], + [ + 240, + 243 + ], + [ + 253, + 254 + ], + [ + 255, + 257 + ], + [ + 265, + 266 + ], + [ + 270, + 273 + ], + [ + 274, + 275 + ] + ] + } + }, + { + "filename": "libvips/create/gaussnoise.c", + "line_filter": { + "diff_chunks": [ + [ + 30, + 58 + ], + [ + 83, + 211 + ], + [ + 220, + 227 + ], + [ + 228, + 242 + ] + ], + "lines_added": [ + [ + 33, + 49 + ], + [ + 54, + 55 + ], + [ + 86, + 87 + ], + [ + 89, + 91 + ], + [ + 93, + 94 + ], + [ + 97, + 100 + ], + [ + 103, + 104 + ], + [ + 109, + 111 + ], + [ + 113, + 115 + ], + [ + 118, + 119 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 132, + 134 + ], + [ + 135, + 136 + ], + [ + 138, + 139 + ], + [ + 140, + 144 + ], + [ + 145, + 146 + ], + [ + 149, + 150 + ], + [ + 151, + 153 + ], + [ + 159, + 160 + ], + [ + 166, + 169 + ], + [ + 170, + 172 + ], + [ + 173, + 176 + ], + [ + 177, + 179 + ], + [ + 180, + 183 + ], + [ + 184, + 186 + ], + [ + 187, + 190 + ], + [ + 191, + 193 + ], + [ + 194, + 197 + ], + [ + 198, + 200 + ], + [ + 203, + 204 + ], + [ + 207, + 208 + ], + [ + 223, + 224 + ], + [ + 231, + 232 + ], + [ + 236, + 239 + ], + [ + 240, + 241 + ] + ] + } + }, + { + "filename": "libvips/create/grey.c", + "line_filter": { + "diff_chunks": [ + [ + 24, + 52 + ], + [ + 71, + 101 + ], + [ + 113, + 134 + ] + ], + "lines_added": [ + [ + 27, + 43 + ], + [ + 48, + 49 + ], + [ + 74, + 75 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 83, + 84 + ], + [ + 85, + 87 + ], + [ + 89, + 90 + ], + [ + 92, + 94 + ], + [ + 97, + 98 + ], + [ + 116, + 117 + ], + [ + 123, + 124 + ], + [ + 128, + 131 + ], + [ + 132, + 133 + ] + ] + } + }, + { + "filename": "libvips/create/identity.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 18, + 46 + ], + [ + 67, + 169 + ], + [ + 182, + 211 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 21, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 37 + ], + [ + 42, + 43 + ], + [ + 70, + 83 + ], + [ + 85, + 87 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 97 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 111, + 113 + ], + [ + 114, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 131, + 133 + ], + [ + 138, + 140 + ], + [ + 142, + 145 + ], + [ + 146, + 148 + ], + [ + 149, + 152 + ], + [ + 153, + 155 + ], + [ + 156, + 159 + ], + [ + 160, + 162 + ], + [ + 165, + 166 + ], + [ + 185, + 186 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 193, + 194 + ], + [ + 200, + 201 + ], + [ + 205, + 208 + ], + [ + 209, + 210 + ] + ] + } + }, + { + "filename": "libvips/create/invertlut.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 44 + ], + [ + 71, + 179 + ], + [ + 181, + 188 + ], + [ + 191, + 198 + ], + [ + 200, + 207 + ], + [ + 213, + 220 + ], + [ + 224, + 234 + ], + [ + 241, + 307 + ], + [ + 364, + 378 + ] + ], + "lines_added": [ + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 35 + ], + [ + 40, + 41 + ], + [ + 74, + 75 + ], + [ + 76, + 78 + ], + [ + 82, + 83 + ], + [ + 85, + 86 + ], + [ + 89, + 92 + ], + [ + 93, + 94 + ], + [ + 99, + 100 + ], + [ + 106, + 112 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 126 + ], + [ + 127, + 131 + ], + [ + 133, + 136 + ], + [ + 137, + 141 + ], + [ + 144, + 153 + ], + [ + 157, + 158 + ], + [ + 160, + 163 + ], + [ + 164, + 166 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 184, + 185 + ], + [ + 194, + 195 + ], + [ + 203, + 204 + ], + [ + 216, + 217 + ], + [ + 227, + 229 + ], + [ + 230, + 231 + ], + [ + 244, + 245 + ], + [ + 248, + 249 + ], + [ + 250, + 252 + ], + [ + 254, + 256 + ], + [ + 257, + 259 + ], + [ + 260, + 263 + ], + [ + 264, + 266 + ], + [ + 267, + 270 + ], + [ + 271, + 272 + ], + [ + 275, + 276 + ], + [ + 277, + 279 + ], + [ + 285, + 286 + ], + [ + 288, + 291 + ], + [ + 292, + 293 + ], + [ + 294, + 297 + ], + [ + 298, + 300 + ], + [ + 303, + 304 + ], + [ + 367, + 368 + ], + [ + 372, + 375 + ], + [ + 376, + 377 + ] + ] + } + }, + { + "filename": "libvips/create/logmat.c", + "line_filter": { + "diff_chunks": [ + [ + 21, + 49 + ], + [ + 71, + 79 + ], + [ + 81, + 241 + ], + [ + 253, + 283 + ], + [ + 285, + 299 + ] + ], + "lines_added": [ + [ + 24, + 40 + ], + [ + 45, + 46 + ], + [ + 74, + 76 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 89, + 91 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 96, + 98 + ], + [ + 99, + 101 + ], + [ + 106, + 109 + ], + [ + 111, + 114 + ], + [ + 115, + 117 + ], + [ + 120, + 121 + ], + [ + 127, + 128 + ], + [ + 132, + 135 + ], + [ + 137, + 138 + ], + [ + 140, + 142 + ], + [ + 146, + 149 + ], + [ + 152, + 153 + ], + [ + 154, + 157 + ], + [ + 158, + 162 + ], + [ + 164, + 166 + ], + [ + 171, + 172 + ], + [ + 173, + 175 + ], + [ + 176, + 178 + ], + [ + 181, + 183 + ], + [ + 184, + 185 + ], + [ + 188, + 189 + ], + [ + 190, + 192 + ], + [ + 197, + 198 + ], + [ + 200, + 203 + ], + [ + 204, + 206 + ], + [ + 207, + 210 + ], + [ + 211, + 213 + ], + [ + 214, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 224 + ], + [ + 225, + 227 + ], + [ + 228, + 234 + ], + [ + 237, + 238 + ], + [ + 256, + 261 + ], + [ + 263, + 264 + ], + [ + 267, + 268 + ], + [ + 270, + 271 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 278, + 280 + ], + [ + 288, + 289 + ], + [ + 293, + 296 + ], + [ + 297, + 298 + ] + ] + } + }, + { + "filename": "libvips/create/mask.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 75 + ], + [ + 76, + 85 + ], + [ + 88, + 147 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 59, + 61 + ], + [ + 64, + 66 + ], + [ + 71, + 72 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 91, + 92 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 109 + ], + [ + 114, + 115 + ], + [ + 117, + 119 + ], + [ + 121, + 124 + ], + [ + 125, + 127 + ], + [ + 128, + 131 + ], + [ + 132, + 134 + ], + [ + 135, + 138 + ], + [ + 139, + 141 + ], + [ + 144, + 145 + ] + ] + } + }, + { + "filename": "libvips/create/mask_butterworth.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 62 + ], + [ + 66, + 117 + ], + [ + 139, + 163 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 56 + ], + [ + 58, + 59 + ], + [ + 69, + 71 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 78, + 81 + ], + [ + 86, + 87 + ], + [ + 90, + 93 + ], + [ + 94, + 96 + ], + [ + 97, + 100 + ], + [ + 101, + 103 + ], + [ + 104, + 107 + ], + [ + 108, + 110 + ], + [ + 113, + 114 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 149, + 151 + ], + [ + 155, + 160 + ], + [ + 161, + 162 + ] + ] + } + }, + { + "filename": "libvips/create/mask_butterworth_band.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 64, + 78 + ], + [ + 83, + 152 + ], + [ + 160, + 167 + ], + [ + 173, + 204 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 67, + 69 + ], + [ + 71, + 73 + ], + [ + 74, + 75 + ], + [ + 86, + 87 + ], + [ + 91, + 92 + ], + [ + 95, + 97 + ], + [ + 98, + 101 + ], + [ + 106, + 107 + ], + [ + 110, + 113 + ], + [ + 114, + 116 + ], + [ + 117, + 120 + ], + [ + 121, + 123 + ], + [ + 124, + 127 + ], + [ + 128, + 130 + ], + [ + 131, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 141 + ], + [ + 142, + 144 + ], + [ + 147, + 149 + ], + [ + 163, + 164 + ], + [ + 176, + 178 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 188, + 191 + ], + [ + 195, + 201 + ], + [ + 202, + 203 + ] + ] + } + }, + { + "filename": "libvips/create/mask_butterworth_ring.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 60, + 76 + ], + [ + 79, + 118 + ], + [ + 134, + 165 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 65 + ], + [ + 67, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 82, + 84 + ], + [ + 85, + 86 + ], + [ + 89, + 91 + ], + [ + 92, + 95 + ], + [ + 100, + 101 + ], + [ + 104, + 107 + ], + [ + 108, + 110 + ], + [ + 113, + 115 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 150, + 153 + ], + [ + 157, + 162 + ], + [ + 163, + 164 + ] + ] + } + }, + { + "filename": "libvips/create/mask_fractal.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 60, + 105 + ], + [ + 119, + 142 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 65 + ], + [ + 67, + 68 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 80, + 83 + ], + [ + 88, + 89 + ], + [ + 92, + 95 + ], + [ + 96, + 98 + ], + [ + 101, + 102 + ], + [ + 122, + 123 + ], + [ + 129, + 131 + ], + [ + 135, + 139 + ], + [ + 140, + 141 + ] + ] + } + }, + { + "filename": "libvips/create/mask_gaussian.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 105 + ], + [ + 123, + 144 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 71, + 72 + ], + [ + 73, + 76 + ], + [ + 81, + 82 + ], + [ + 85, + 88 + ], + [ + 89, + 91 + ], + [ + 92, + 95 + ], + [ + 96, + 98 + ], + [ + 101, + 102 + ], + [ + 126, + 127 + ], + [ + 131, + 133 + ], + [ + 137, + 141 + ], + [ + 142, + 143 + ] + ] + } + }, + { + "filename": "libvips/create/mask_gaussian_band.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 63, + 73 + ], + [ + 75, + 139 + ], + [ + 145, + 152 + ], + [ + 158, + 185 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 78, + 79 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 96 + ], + [ + 101, + 102 + ], + [ + 105, + 108 + ], + [ + 109, + 111 + ], + [ + 112, + 115 + ], + [ + 116, + 118 + ], + [ + 119, + 122 + ], + [ + 123, + 125 + ], + [ + 126, + 129 + ], + [ + 130, + 132 + ], + [ + 135, + 136 + ], + [ + 148, + 149 + ], + [ + 161, + 163 + ], + [ + 165, + 166 + ], + [ + 170, + 173 + ], + [ + 177, + 182 + ], + [ + 183, + 184 + ] + ] + } + }, + { + "filename": "libvips/create/mask_gaussian_ring.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 60, + 74 + ], + [ + 75, + 113 + ], + [ + 128, + 155 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 65 + ], + [ + 67, + 68 + ], + [ + 70, + 71 + ], + [ + 78, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 88, + 91 + ], + [ + 96, + 97 + ], + [ + 100, + 103 + ], + [ + 104, + 106 + ], + [ + 109, + 110 + ], + [ + 131, + 132 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 140, + 143 + ], + [ + 147, + 152 + ], + [ + 153, + 154 + ] + ] + } + }, + { + "filename": "libvips/create/mask_ideal.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 61 + ], + [ + 62, + 96 + ], + [ + 113, + 157 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 65, + 66 + ], + [ + 69, + 70 + ], + [ + 71, + 74 + ], + [ + 79, + 80 + ], + [ + 83, + 86 + ], + [ + 87, + 89 + ], + [ + 92, + 93 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 123, + 124 + ], + [ + 126, + 128 + ], + [ + 130, + 131 + ], + [ + 135, + 140 + ], + [ + 144, + 146 + ], + [ + 150, + 154 + ], + [ + 155, + 156 + ] + ] + } + }, + { + "filename": "libvips/create/mask_ideal_band.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 62, + 73 + ], + [ + 76, + 124 + ], + [ + 141, + 167 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 65, + 67 + ], + [ + 69, + 70 + ], + [ + 79, + 80 + ], + [ + 83, + 84 + ], + [ + 85, + 88 + ], + [ + 93, + 94 + ], + [ + 97, + 100 + ], + [ + 101, + 103 + ], + [ + 104, + 107 + ], + [ + 108, + 110 + ], + [ + 111, + 114 + ], + [ + 115, + 117 + ], + [ + 120, + 121 + ], + [ + 144, + 147 + ], + [ + 153, + 156 + ], + [ + 160, + 164 + ], + [ + 165, + 166 + ] + ] + } + }, + { + "filename": "libvips/create/mask_ideal_ring.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 60, + 71 + ], + [ + 76, + 110 + ], + [ + 124, + 149 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 65 + ], + [ + 67, + 68 + ], + [ + 79, + 80 + ], + [ + 83, + 84 + ], + [ + 85, + 88 + ], + [ + 93, + 94 + ], + [ + 97, + 100 + ], + [ + 101, + 103 + ], + [ + 106, + 107 + ], + [ + 127, + 129 + ], + [ + 131, + 132 + ], + [ + 136, + 138 + ], + [ + 142, + 146 + ], + [ + 147, + 148 + ] + ] + } + }, + { + "filename": "libvips/create/pcreate.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 55 + ], + [ + 64, + 74 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 51 + ], + [ + 67, + 68 + ] + ] + } + }, + { + "filename": "libvips/create/perlin.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 69, + 76 + ], + [ + 92, + 108 + ], + [ + 118, + 131 + ], + [ + 134, + 208 + ], + [ + 216, + 334 + ], + [ + 354, + 376 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 72, + 73 + ], + [ + 95, + 96 + ], + [ + 98, + 100 + ], + [ + 103, + 105 + ], + [ + 121, + 122 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 127, + 128 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 147, + 148 + ], + [ + 153, + 155 + ], + [ + 160, + 161 + ], + [ + 167, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 176 + ], + [ + 178, + 179 + ], + [ + 183, + 186 + ], + [ + 188, + 189 + ], + [ + 194, + 196 + ], + [ + 201, + 205 + ], + [ + 219, + 220 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 235, + 237 + ], + [ + 240, + 242 + ], + [ + 243, + 245 + ], + [ + 247, + 248 + ], + [ + 249, + 250 + ], + [ + 251, + 259 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 269, + 271 + ], + [ + 273, + 274 + ], + [ + 277, + 278 + ], + [ + 279, + 281 + ], + [ + 284, + 285 + ], + [ + 290, + 291 + ], + [ + 293, + 296 + ], + [ + 297, + 299 + ], + [ + 300, + 303 + ], + [ + 304, + 306 + ], + [ + 307, + 310 + ], + [ + 311, + 313 + ], + [ + 314, + 317 + ], + [ + 318, + 320 + ], + [ + 321, + 324 + ], + [ + 325, + 327 + ], + [ + 330, + 331 + ], + [ + 357, + 359 + ], + [ + 365, + 366 + ], + [ + 370, + 373 + ], + [ + 374, + 375 + ] + ] + } + }, + { + "filename": "libvips/create/pmask.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 42, + 61 + ], + [ + 68, + 94 + ], + [ + 98, + 120 + ], + [ + 126, + 148 + ], + [ + 153, + 160 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 45, + 57 + ], + [ + 71, + 72 + ], + [ + 75, + 76 + ], + [ + 78, + 90 + ], + [ + 101, + 102 + ], + [ + 104, + 116 + ], + [ + 129, + 130 + ], + [ + 132, + 144 + ], + [ + 156, + 157 + ] + ] + } + }, + { + "filename": "libvips/create/point.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 49, + 112 + ], + [ + 113, + 166 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 52, + 53 + ], + [ + 55, + 57 + ], + [ + 59, + 61 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 68, + 70 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 78, + 82 + ], + [ + 85, + 87 + ], + [ + 89, + 90 + ], + [ + 92, + 97 + ], + [ + 99, + 100 + ], + [ + 104, + 109 + ], + [ + 116, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 127 + ], + [ + 132, + 133 + ], + [ + 135, + 138 + ], + [ + 140, + 143 + ], + [ + 144, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 153 + ], + [ + 154, + 157 + ], + [ + 158, + 160 + ], + [ + 163, + 164 + ] + ] + } + }, + { + "filename": "libvips/create/point.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 55 + ], + [ + 63, + 77 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 51 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 73, + 74 + ] + ] + } + }, + { + "filename": "libvips/create/sines.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 16, + 44 + ], + [ + 74, + 145 + ], + [ + 158, + 165 + ], + [ + 168, + 189 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 35 + ], + [ + 40, + 41 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 84, + 85 + ], + [ + 88, + 89 + ], + [ + 90, + 91 + ], + [ + 96, + 98 + ], + [ + 99, + 104 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 115 + ], + [ + 120, + 121 + ], + [ + 125, + 128 + ], + [ + 129, + 131 + ], + [ + 132, + 135 + ], + [ + 136, + 138 + ], + [ + 141, + 142 + ], + [ + 161, + 162 + ], + [ + 171, + 174 + ], + [ + 178, + 179 + ], + [ + 183, + 186 + ], + [ + 187, + 188 + ] + ] + } + }, + { + "filename": "libvips/create/text.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 29 + ], + [ + 41, + 69 + ], + [ + 117, + 128 + ], + [ + 129, + 149 + ], + [ + 150, + 168 + ], + [ + 178, + 187 + ], + [ + 203, + 267 + ], + [ + 282, + 308 + ], + [ + 311, + 323 + ], + [ + 328, + 350 + ], + [ + 353, + 379 + ], + [ + 380, + 638 + ], + [ + 651, + 658 + ], + [ + 673, + 699 + ], + [ + 706, + 720 + ] + ], + "lines_added": [ + [ + 15, + 17 + ], + [ + 22, + 24 + ], + [ + 25, + 26 + ], + [ + 44, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 55 + ], + [ + 56, + 60 + ], + [ + 65, + 66 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 132, + 133 + ], + [ + 136, + 138 + ], + [ + 139, + 140 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 153, + 155 + ], + [ + 156, + 160 + ], + [ + 161, + 163 + ], + [ + 164, + 165 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 206, + 207 + ], + [ + 208, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 220, + 222 + ], + [ + 223, + 229 + ], + [ + 230, + 232 + ], + [ + 238, + 244 + ], + [ + 246, + 247 + ], + [ + 252, + 253 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 263, + 264 + ], + [ + 285, + 288 + ], + [ + 290, + 293 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 304, + 305 + ], + [ + 314, + 316 + ], + [ + 319, + 320 + ], + [ + 331, + 333 + ], + [ + 337, + 339 + ], + [ + 340, + 342 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 356, + 357 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 363, + 364 + ], + [ + 366, + 367 + ], + [ + 370, + 371 + ], + [ + 372, + 374 + ], + [ + 375, + 376 + ], + [ + 383, + 385 + ], + [ + 386, + 390 + ], + [ + 394, + 395 + ], + [ + 396, + 397 + ], + [ + 398, + 401 + ], + [ + 403, + 405 + ], + [ + 408, + 413 + ], + [ + 414, + 415 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 423, + 427 + ], + [ + 429, + 430 + ], + [ + 431, + 432 + ], + [ + 434, + 438 + ], + [ + 442, + 444 + ], + [ + 445, + 449 + ], + [ + 452, + 455 + ], + [ + 456, + 457 + ], + [ + 460, + 463 + ], + [ + 464, + 466 + ], + [ + 468, + 476 + ], + [ + 478, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 487, + 488 + ], + [ + 490, + 491 + ], + [ + 493, + 498 + ], + [ + 502, + 504 + ], + [ + 505, + 507 + ], + [ + 510, + 512 + ], + [ + 513, + 514 + ], + [ + 517, + 518 + ], + [ + 519, + 520 + ], + [ + 522, + 523 + ], + [ + 526, + 527 + ], + [ + 528, + 530 + ], + [ + 533, + 534 + ], + [ + 540, + 541 + ], + [ + 543, + 546 + ], + [ + 547, + 549 + ], + [ + 550, + 553 + ], + [ + 554, + 556 + ], + [ + 557, + 560 + ], + [ + 561, + 563 + ], + [ + 564, + 567 + ], + [ + 568, + 570 + ], + [ + 571, + 574 + ], + [ + 575, + 577 + ], + [ + 578, + 581 + ], + [ + 582, + 584 + ], + [ + 585, + 588 + ], + [ + 589, + 591 + ], + [ + 592, + 595 + ], + [ + 596, + 598 + ], + [ + 599, + 602 + ], + [ + 603, + 605 + ], + [ + 606, + 609 + ], + [ + 610, + 612 + ], + [ + 613, + 616 + ], + [ + 617, + 619 + ], + [ + 620, + 623 + ], + [ + 624, + 626 + ], + [ + 629, + 630 + ], + [ + 634, + 635 + ], + [ + 654, + 655 + ], + [ + 676, + 678 + ], + [ + 679, + 680 + ], + [ + 683, + 684 + ], + [ + 685, + 686 + ], + [ + 688, + 690 + ], + [ + 692, + 693 + ], + [ + 695, + 696 + ], + [ + 709, + 710 + ], + [ + 714, + 717 + ], + [ + 718, + 719 + ] + ] + } + }, + { + "filename": "libvips/create/tonelut.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 19, + 47 + ], + [ + 63, + 70 + ], + [ + 78, + 181 + ], + [ + 184, + 197 + ], + [ + 198, + 321 + ], + [ + 325, + 353 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 22, + 23 + ], + [ + 24, + 28 + ], + [ + 29, + 38 + ], + [ + 43, + 44 + ], + [ + 66, + 67 + ], + [ + 81, + 82 + ], + [ + 86, + 87 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 108, + 109 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 130, + 131 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 146, + 147 + ], + [ + 152, + 153 + ], + [ + 156, + 162 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 170, + 171 + ], + [ + 173, + 175 + ], + [ + 176, + 178 + ], + [ + 187, + 190 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 201, + 209 + ], + [ + 212, + 213 + ], + [ + 214, + 216 + ], + [ + 221, + 222 + ], + [ + 224, + 227 + ], + [ + 228, + 230 + ], + [ + 231, + 234 + ], + [ + 235, + 237 + ], + [ + 238, + 241 + ], + [ + 242, + 244 + ], + [ + 245, + 248 + ], + [ + 249, + 251 + ], + [ + 252, + 255 + ], + [ + 256, + 258 + ], + [ + 259, + 262 + ], + [ + 263, + 265 + ], + [ + 266, + 269 + ], + [ + 270, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 279 + ], + [ + 280, + 283 + ], + [ + 284, + 286 + ], + [ + 287, + 290 + ], + [ + 291, + 293 + ], + [ + 296, + 297 + ], + [ + 298, + 308 + ], + [ + 312, + 313 + ], + [ + 317, + 318 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 335, + 337 + ], + [ + 342, + 343 + ], + [ + 347, + 350 + ], + [ + 351, + 352 + ] + ] + } + }, + { + "filename": "libvips/create/worley.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 71, + 78 + ], + [ + 107, + 123 + ], + [ + 133, + 210 + ], + [ + 211, + 341 + ], + [ + 365, + 379 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 74, + 75 + ], + [ + 110, + 111 + ], + [ + 113, + 115 + ], + [ + 118, + 120 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 156, + 160 + ], + [ + 162, + 165 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 187, + 189 + ], + [ + 194, + 195 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 214, + 215 + ], + [ + 217, + 221 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 232 + ], + [ + 234, + 235 + ], + [ + 239, + 241 + ], + [ + 242, + 243 + ], + [ + 246, + 250 + ], + [ + 254, + 256 + ], + [ + 259, + 260 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 268, + 270 + ], + [ + 273, + 275 + ], + [ + 276, + 278 + ], + [ + 280, + 281 + ], + [ + 282, + 283 + ], + [ + 284, + 292 + ], + [ + 295, + 296 + ], + [ + 297, + 299 + ], + [ + 304, + 305 + ], + [ + 307, + 310 + ], + [ + 311, + 313 + ], + [ + 314, + 317 + ], + [ + 318, + 320 + ], + [ + 321, + 324 + ], + [ + 325, + 327 + ], + [ + 328, + 331 + ], + [ + 332, + 334 + ], + [ + 337, + 338 + ], + [ + 368, + 369 + ], + [ + 373, + 376 + ], + [ + 377, + 378 + ] + ] + } + }, + { + "filename": "libvips/create/xyz.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 10, + 38 + ], + [ + 69, + 231 + ], + [ + 249, + 277 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 29 + ], + [ + 34, + 35 + ], + [ + 72, + 73 + ], + [ + 75, + 77 + ], + [ + 79, + 80 + ], + [ + 82, + 84 + ], + [ + 87, + 90 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 124, + 126 + ], + [ + 131, + 133 + ], + [ + 134, + 141 + ], + [ + 143, + 144 + ], + [ + 146, + 147 + ], + [ + 149, + 150 + ], + [ + 154, + 158 + ], + [ + 161, + 163 + ], + [ + 165, + 170 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 179 + ], + [ + 180, + 181 + ], + [ + 186, + 188 + ], + [ + 190, + 193 + ], + [ + 194, + 196 + ], + [ + 197, + 200 + ], + [ + 201, + 203 + ], + [ + 204, + 207 + ], + [ + 208, + 210 + ], + [ + 211, + 214 + ], + [ + 215, + 217 + ], + [ + 218, + 221 + ], + [ + 222, + 224 + ], + [ + 227, + 228 + ], + [ + 252, + 253 + ], + [ + 255, + 256 + ], + [ + 259, + 260 + ], + [ + 266, + 267 + ], + [ + 271, + 274 + ], + [ + 275, + 276 + ] + ] + } + }, + { + "filename": "libvips/create/zone.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 45 + ], + [ + 64, + 74 + ], + [ + 77, + 100 + ], + [ + 108, + 131 + ] + ], + "lines_added": [ + [ + 20, + 36 + ], + [ + 41, + 42 + ], + [ + 67, + 68 + ], + [ + 70, + 71 + ], + [ + 80, + 81 + ], + [ + 84, + 85 + ], + [ + 86, + 88 + ], + [ + 90, + 91 + ], + [ + 96, + 97 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 120, + 121 + ], + [ + 125, + 128 + ], + [ + 129, + 130 + ] + ] + } + }, + { + "filename": "libvips/deprecated/arith_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 182 + ], + [ + 185, + 881 + ], + [ + 886, + 1219 + ], + [ + 1224, + 1233 + ], + [ + 1270, + 1276 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 48 + ], + [ + 53, + 56 + ], + [ + 61, + 63 + ], + [ + 68, + 71 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 86, + 87 + ], + [ + 88, + 92 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 105, + 111 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 124, + 130 + ], + [ + 135, + 136 + ], + [ + 139, + 141 + ], + [ + 143, + 144 + ], + [ + 147, + 148 + ], + [ + 149, + 155 + ], + [ + 160, + 166 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 178, + 179 + ], + [ + 188, + 189 + ], + [ + 195, + 200 + ], + [ + 205, + 206 + ], + [ + 207, + 208 + ], + [ + 213, + 219 + ], + [ + 224, + 225 + ], + [ + 228, + 230 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 238, + 244 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ], + [ + 255, + 256 + ], + [ + 257, + 263 + ], + [ + 268, + 269 + ], + [ + 270, + 271 + ], + [ + 274, + 275 + ], + [ + 276, + 282 + ], + [ + 287, + 290 + ], + [ + 295, + 296 + ], + [ + 299, + 300 + ], + [ + 303, + 304 + ], + [ + 305, + 311 + ], + [ + 316, + 319 + ], + [ + 324, + 325 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 334, + 340 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 351, + 352 + ], + [ + 353, + 359 + ], + [ + 364, + 365 + ], + [ + 366, + 367 + ], + [ + 370, + 371 + ], + [ + 372, + 378 + ], + [ + 383, + 387 + ], + [ + 392, + 393 + ], + [ + 397, + 398 + ], + [ + 401, + 402 + ], + [ + 403, + 409 + ], + [ + 414, + 418 + ], + [ + 423, + 424 + ], + [ + 428, + 432 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 440, + 442 + ], + [ + 443, + 446 + ], + [ + 451, + 452 + ], + [ + 453, + 454 + ], + [ + 457, + 458 + ], + [ + 459, + 465 + ], + [ + 470, + 471 + ], + [ + 472, + 473 + ], + [ + 476, + 477 + ], + [ + 478, + 484 + ], + [ + 489, + 490 + ], + [ + 491, + 492 + ], + [ + 495, + 496 + ], + [ + 497, + 503 + ], + [ + 508, + 509 + ], + [ + 510, + 511 + ], + [ + 514, + 515 + ], + [ + 516, + 522 + ], + [ + 527, + 528 + ], + [ + 529, + 530 + ], + [ + 533, + 534 + ], + [ + 535, + 541 + ], + [ + 546, + 547 + ], + [ + 548, + 549 + ], + [ + 552, + 553 + ], + [ + 554, + 560 + ], + [ + 565, + 566 + ], + [ + 567, + 568 + ], + [ + 571, + 572 + ], + [ + 573, + 579 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 590, + 591 + ], + [ + 592, + 598 + ], + [ + 603, + 604 + ], + [ + 605, + 606 + ], + [ + 609, + 610 + ], + [ + 611, + 617 + ], + [ + 622, + 623 + ], + [ + 624, + 625 + ], + [ + 628, + 629 + ], + [ + 630, + 636 + ], + [ + 641, + 642 + ], + [ + 643, + 644 + ], + [ + 647, + 648 + ], + [ + 649, + 655 + ], + [ + 660, + 661 + ], + [ + 662, + 663 + ], + [ + 666, + 667 + ], + [ + 668, + 674 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 685, + 686 + ], + [ + 687, + 693 + ], + [ + 698, + 699 + ], + [ + 702, + 704 + ], + [ + 706, + 707 + ], + [ + 710, + 711 + ], + [ + 712, + 718 + ], + [ + 723, + 725 + ], + [ + 730, + 731 + ], + [ + 735, + 737 + ], + [ + 741, + 742 + ], + [ + 745, + 746 + ], + [ + 747, + 753 + ], + [ + 758, + 762 + ], + [ + 767, + 768 + ], + [ + 769, + 770 + ], + [ + 775, + 781 + ], + [ + 786, + 791 + ], + [ + 796, + 797 + ], + [ + 798, + 814 + ], + [ + 819, + 825 + ], + [ + 830, + 831 + ], + [ + 832, + 848 + ], + [ + 853, + 859 + ], + [ + 864, + 872 + ], + [ + 877, + 878 + ], + [ + 889, + 893 + ], + [ + 895, + 896 + ], + [ + 901, + 907 + ], + [ + 912, + 913 + ], + [ + 916, + 918 + ], + [ + 920, + 921 + ], + [ + 924, + 925 + ], + [ + 926, + 932 + ], + [ + 937, + 938 + ], + [ + 942, + 944 + ], + [ + 948, + 949 + ], + [ + 952, + 953 + ], + [ + 954, + 960 + ], + [ + 965, + 966 + ], + [ + 967, + 968 + ], + [ + 971, + 972 + ], + [ + 973, + 979 + ], + [ + 984, + 985 + ], + [ + 988, + 989 + ], + [ + 994, + 997 + ], + [ + 1000, + 1001 + ], + [ + 1002, + 1008 + ], + [ + 1013, + 1014 + ], + [ + 1017, + 1018 + ], + [ + 1023, + 1026 + ], + [ + 1029, + 1030 + ], + [ + 1031, + 1038 + ], + [ + 1043, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1049, + 1050 + ], + [ + 1051, + 1057 + ], + [ + 1062, + 1063 + ], + [ + 1066, + 1067 + ], + [ + 1070, + 1071 + ], + [ + 1072, + 1078 + ], + [ + 1083, + 1084 + ], + [ + 1087, + 1088 + ], + [ + 1091, + 1092 + ], + [ + 1093, + 1099 + ], + [ + 1104, + 1106 + ], + [ + 1111, + 1112 + ], + [ + 1115, + 1117 + ], + [ + 1118, + 1119 + ], + [ + 1122, + 1123 + ], + [ + 1124, + 1130 + ], + [ + 1135, + 1136 + ], + [ + 1137, + 1138 + ], + [ + 1141, + 1142 + ], + [ + 1143, + 1149 + ], + [ + 1154, + 1157 + ], + [ + 1162, + 1163 + ], + [ + 1165, + 1184 + ], + [ + 1189, + 1190 + ], + [ + 1191, + 1197 + ], + [ + 1202, + 1203 + ], + [ + 1204, + 1205 + ], + [ + 1208, + 1209 + ], + [ + 1210, + 1216 + ], + [ + 1227, + 1230 + ], + [ + 1273, + 1274 + ] + ] + } + }, + { + "filename": "libvips/deprecated/cimg_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 39, + 152 + ], + [ + 157, + 163 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 42, + 43 + ], + [ + 44, + 52 + ], + [ + 53, + 68 + ], + [ + 71, + 84 + ], + [ + 87, + 93 + ], + [ + 96, + 97 + ], + [ + 98, + 107 + ], + [ + 108, + 123 + ], + [ + 126, + 140 + ], + [ + 143, + 149 + ], + [ + 160, + 161 + ] + ] + } + }, + { + "filename": "libvips/deprecated/colour_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 950 + ], + [ + 951, + 968 + ], + [ + 1016, + 1022 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 48 + ], + [ + 53, + 56 + ], + [ + 61, + 62 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 69, + 75 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 88, + 94 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 107, + 113 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 126, + 132 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 143, + 144 + ], + [ + 145, + 151 + ], + [ + 156, + 157 + ], + [ + 158, + 159 + ], + [ + 162, + 163 + ], + [ + 164, + 170 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 183, + 189 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 202, + 208 + ], + [ + 211, + 212 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 233 + ], + [ + 236, + 237 + ], + [ + 240, + 242 + ], + [ + 245, + 250 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 257, + 262 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 273, + 276 + ], + [ + 279, + 280 + ], + [ + 281, + 288 + ], + [ + 291, + 292 + ], + [ + 295, + 297 + ], + [ + 300, + 304 + ], + [ + 307, + 308 + ], + [ + 309, + 316 + ], + [ + 319, + 320 + ], + [ + 324, + 326 + ], + [ + 329, + 334 + ], + [ + 337, + 338 + ], + [ + 339, + 346 + ], + [ + 349, + 350 + ], + [ + 351, + 352 + ], + [ + 355, + 358 + ], + [ + 361, + 362 + ], + [ + 363, + 370 + ], + [ + 373, + 374 + ], + [ + 379, + 380 + ], + [ + 383, + 388 + ], + [ + 391, + 392 + ], + [ + 393, + 394 + ], + [ + 395, + 400 + ], + [ + 405, + 406 + ], + [ + 407, + 408 + ], + [ + 411, + 412 + ], + [ + 413, + 419 + ], + [ + 424, + 425 + ], + [ + 426, + 427 + ], + [ + 430, + 431 + ], + [ + 432, + 438 + ], + [ + 443, + 444 + ], + [ + 445, + 446 + ], + [ + 449, + 450 + ], + [ + 451, + 457 + ], + [ + 462, + 463 + ], + [ + 464, + 465 + ], + [ + 468, + 469 + ], + [ + 470, + 476 + ], + [ + 481, + 482 + ], + [ + 483, + 484 + ], + [ + 487, + 488 + ], + [ + 489, + 495 + ], + [ + 500, + 501 + ], + [ + 502, + 503 + ], + [ + 506, + 507 + ], + [ + 508, + 514 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 525, + 526 + ], + [ + 527, + 533 + ], + [ + 538, + 539 + ], + [ + 540, + 541 + ], + [ + 544, + 545 + ], + [ + 546, + 552 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ], + [ + 563, + 564 + ], + [ + 565, + 571 + ], + [ + 576, + 577 + ], + [ + 578, + 579 + ], + [ + 582, + 583 + ], + [ + 584, + 590 + ], + [ + 595, + 596 + ], + [ + 597, + 598 + ], + [ + 601, + 602 + ], + [ + 603, + 609 + ], + [ + 614, + 615 + ], + [ + 616, + 617 + ], + [ + 620, + 621 + ], + [ + 622, + 628 + ], + [ + 633, + 634 + ], + [ + 635, + 636 + ], + [ + 639, + 640 + ], + [ + 641, + 647 + ], + [ + 652, + 653 + ], + [ + 654, + 655 + ], + [ + 658, + 659 + ], + [ + 660, + 666 + ], + [ + 669, + 670 + ], + [ + 675, + 676 + ], + [ + 679, + 680 + ], + [ + 681, + 688 + ], + [ + 693, + 694 + ], + [ + 695, + 696 + ], + [ + 699, + 700 + ], + [ + 701, + 707 + ], + [ + 712, + 715 + ], + [ + 720, + 721 + ], + [ + 722, + 723 + ], + [ + 726, + 727 + ], + [ + 728, + 734 + ], + [ + 739, + 740 + ], + [ + 741, + 742 + ], + [ + 745, + 746 + ], + [ + 747, + 753 + ], + [ + 758, + 759 + ], + [ + 760, + 761 + ], + [ + 764, + 765 + ], + [ + 766, + 772 + ], + [ + 777, + 778 + ], + [ + 779, + 780 + ], + [ + 783, + 784 + ], + [ + 785, + 786 + ], + [ + 787, + 791 + ], + [ + 796, + 797 + ], + [ + 798, + 799 + ], + [ + 802, + 803 + ], + [ + 804, + 805 + ], + [ + 806, + 810 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 821, + 822 + ], + [ + 823, + 824 + ], + [ + 825, + 829 + ], + [ + 834, + 835 + ], + [ + 836, + 837 + ], + [ + 840, + 841 + ], + [ + 842, + 843 + ], + [ + 844, + 848 + ], + [ + 853, + 857 + ], + [ + 862, + 863 + ], + [ + 864, + 865 + ], + [ + 868, + 869 + ], + [ + 870, + 871 + ], + [ + 872, + 876 + ], + [ + 881, + 882 + ], + [ + 883, + 884 + ], + [ + 887, + 888 + ], + [ + 889, + 890 + ], + [ + 891, + 895 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 906, + 907 + ], + [ + 908, + 914 + ], + [ + 919, + 920 + ], + [ + 921, + 922 + ], + [ + 925, + 926 + ], + [ + 927, + 933 + ], + [ + 936, + 943 + ], + [ + 946, + 947 + ], + [ + 954, + 956 + ], + [ + 959, + 965 + ], + [ + 1019, + 1020 + ] + ] + } + }, + { + "filename": "libvips/deprecated/conver_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 39, + 74 + ], + [ + 78, + 201 + ], + [ + 202, + 335 + ], + [ + 337, + 620 + ], + [ + 621, + 734 + ], + [ + 737, + 1270 + ], + [ + 1271, + 1289 + ], + [ + 1317, + 1325 + ], + [ + 1339, + 1345 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 42, + 43 + ], + [ + 48, + 50 + ], + [ + 51, + 52 + ], + [ + 55, + 58 + ], + [ + 62, + 67 + ], + [ + 70, + 71 + ], + [ + 81, + 85 + ], + [ + 87, + 92 + ], + [ + 94, + 95 + ], + [ + 98, + 104 + ], + [ + 107, + 113 + ], + [ + 116, + 117 + ], + [ + 123, + 125 + ], + [ + 126, + 127 + ], + [ + 130, + 134 + ], + [ + 137, + 143 + ], + [ + 148, + 153 + ], + [ + 158, + 159 + ], + [ + 165, + 169 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 177, + 180 + ], + [ + 185, + 192 + ], + [ + 197, + 198 + ], + [ + 205, + 207 + ], + [ + 212, + 218 + ], + [ + 223, + 229 + ], + [ + 234, + 235 + ], + [ + 241, + 242 + ], + [ + 247, + 253 + ], + [ + 258, + 262 + ], + [ + 267, + 268 + ], + [ + 272, + 273 + ], + [ + 278, + 284 + ], + [ + 289, + 292 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 307, + 313 + ], + [ + 318, + 326 + ], + [ + 331, + 332 + ], + [ + 340, + 342 + ], + [ + 347, + 353 + ], + [ + 358, + 360 + ], + [ + 365, + 368 + ], + [ + 373, + 374 + ], + [ + 375, + 376 + ], + [ + 381, + 387 + ], + [ + 390, + 392 + ], + [ + 395, + 396 + ], + [ + 399, + 400 + ], + [ + 403, + 409 + ], + [ + 414, + 420 + ], + [ + 425, + 426 + ], + [ + 431, + 432 + ], + [ + 437, + 443 + ], + [ + 448, + 452 + ], + [ + 457, + 458 + ], + [ + 463, + 464 + ], + [ + 469, + 475 + ], + [ + 480, + 483 + ], + [ + 488, + 489 + ], + [ + 492, + 493 + ], + [ + 498, + 504 + ], + [ + 509, + 510 + ], + [ + 511, + 512 + ], + [ + 517, + 518 + ], + [ + 519, + 523 + ], + [ + 528, + 529 + ], + [ + 530, + 531 + ], + [ + 536, + 537 + ], + [ + 538, + 542 + ], + [ + 547, + 548 + ], + [ + 549, + 550 + ], + [ + 555, + 556 + ], + [ + 557, + 561 + ], + [ + 566, + 567 + ], + [ + 568, + 569 + ], + [ + 574, + 575 + ], + [ + 576, + 580 + ], + [ + 585, + 586 + ], + [ + 587, + 588 + ], + [ + 593, + 594 + ], + [ + 595, + 599 + ], + [ + 604, + 611 + ], + [ + 616, + 617 + ], + [ + 624, + 626 + ], + [ + 631, + 632 + ], + [ + 637, + 638 + ], + [ + 639, + 642 + ], + [ + 647, + 651 + ], + [ + 656, + 657 + ], + [ + 661, + 662 + ], + [ + 667, + 668 + ], + [ + 673, + 674 + ], + [ + 675, + 678 + ], + [ + 683, + 688 + ], + [ + 693, + 694 + ], + [ + 699, + 701 + ], + [ + 706, + 707 + ], + [ + 712, + 713 + ], + [ + 714, + 717 + ], + [ + 722, + 723 + ], + [ + 724, + 725 + ], + [ + 730, + 731 + ], + [ + 740, + 743 + ], + [ + 748, + 749 + ], + [ + 750, + 751 + ], + [ + 756, + 757 + ], + [ + 762, + 763 + ], + [ + 764, + 767 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ], + [ + 780, + 781 + ], + [ + 786, + 787 + ], + [ + 788, + 791 + ], + [ + 796, + 797 + ], + [ + 798, + 799 + ], + [ + 804, + 805 + ], + [ + 806, + 810 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 823, + 824 + ], + [ + 825, + 829 + ], + [ + 834, + 835 + ], + [ + 836, + 837 + ], + [ + 842, + 843 + ], + [ + 844, + 848 + ], + [ + 853, + 858 + ], + [ + 863, + 864 + ], + [ + 868, + 869 + ], + [ + 874, + 875 + ], + [ + 876, + 880 + ], + [ + 885, + 890 + ], + [ + 895, + 896 + ], + [ + 900, + 904 + ], + [ + 906, + 908 + ], + [ + 909, + 910 + ], + [ + 913, + 914 + ], + [ + 915, + 916 + ], + [ + 917, + 921 + ], + [ + 926, + 927 + ], + [ + 931, + 932 + ], + [ + 937, + 938 + ], + [ + 939, + 943 + ], + [ + 948, + 949 + ], + [ + 950, + 951 + ], + [ + 956, + 957 + ], + [ + 958, + 962 + ], + [ + 967, + 968 + ], + [ + 969, + 970 + ], + [ + 975, + 976 + ], + [ + 977, + 981 + ], + [ + 986, + 987 + ], + [ + 988, + 989 + ], + [ + 994, + 995 + ], + [ + 996, + 1000 + ], + [ + 1005, + 1006 + ], + [ + 1007, + 1008 + ], + [ + 1013, + 1014 + ], + [ + 1015, + 1019 + ], + [ + 1024, + 1025 + ], + [ + 1026, + 1027 + ], + [ + 1032, + 1033 + ], + [ + 1034, + 1038 + ], + [ + 1043, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1051, + 1052 + ], + [ + 1053, + 1057 + ], + [ + 1062, + 1063 + ], + [ + 1064, + 1065 + ], + [ + 1070, + 1071 + ], + [ + 1072, + 1076 + ], + [ + 1081, + 1086 + ], + [ + 1091, + 1092 + ], + [ + 1097, + 1098 + ], + [ + 1103, + 1104 + ], + [ + 1105, + 1109 + ], + [ + 1114, + 1118 + ], + [ + 1123, + 1124 + ], + [ + 1128, + 1129 + ], + [ + 1134, + 1135 + ], + [ + 1136, + 1140 + ], + [ + 1145, + 1149 + ], + [ + 1154, + 1155 + ], + [ + 1159, + 1160 + ], + [ + 1165, + 1166 + ], + [ + 1167, + 1171 + ], + [ + 1176, + 1177 + ], + [ + 1178, + 1179 + ], + [ + 1184, + 1190 + ], + [ + 1195, + 1198 + ], + [ + 1203, + 1204 + ], + [ + 1205, + 1208 + ], + [ + 1209, + 1210 + ], + [ + 1215, + 1221 + ], + [ + 1226, + 1230 + ], + [ + 1235, + 1236 + ], + [ + 1237, + 1238 + ], + [ + 1243, + 1249 + ], + [ + 1254, + 1261 + ], + [ + 1266, + 1267 + ], + [ + 1274, + 1275 + ], + [ + 1278, + 1279 + ], + [ + 1280, + 1286 + ], + [ + 1320, + 1322 + ], + [ + 1342, + 1343 + ] + ] + } + }, + { + "filename": "libvips/deprecated/convol_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 139 + ], + [ + 141, + 481 + ], + [ + 490, + 500 + ], + [ + 503, + 509 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 48 + ], + [ + 53, + 56 + ], + [ + 61, + 64 + ], + [ + 69, + 70 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 85 + ], + [ + 90, + 94 + ], + [ + 99, + 100 + ], + [ + 104, + 106 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 113, + 117 + ], + [ + 122, + 130 + ], + [ + 135, + 136 + ], + [ + 144, + 145 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 152, + 156 + ], + [ + 161, + 164 + ], + [ + 169, + 172 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 189, + 193 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 208, + 209 + ], + [ + 210, + 214 + ], + [ + 219, + 220 + ], + [ + 223, + 224 + ], + [ + 227, + 228 + ], + [ + 229, + 230 + ], + [ + 231, + 235 + ], + [ + 240, + 241 + ], + [ + 244, + 245 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 252, + 256 + ], + [ + 261, + 262 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 273, + 277 + ], + [ + 282, + 283 + ], + [ + 284, + 285 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ], + [ + 292, + 296 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 307, + 308 + ], + [ + 309, + 310 + ], + [ + 311, + 315 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 326, + 327 + ], + [ + 328, + 329 + ], + [ + 330, + 334 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 349, + 353 + ], + [ + 358, + 359 + ], + [ + 362, + 363 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 370, + 374 + ], + [ + 379, + 380 + ], + [ + 383, + 384 + ], + [ + 387, + 388 + ], + [ + 389, + 390 + ], + [ + 391, + 395 + ], + [ + 400, + 401 + ], + [ + 402, + 403 + ], + [ + 406, + 407 + ], + [ + 408, + 409 + ], + [ + 410, + 414 + ], + [ + 419, + 424 + ], + [ + 429, + 430 + ], + [ + 435, + 436 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 443, + 447 + ], + [ + 452, + 456 + ], + [ + 461, + 462 + ], + [ + 466, + 467 + ], + [ + 470, + 471 + ], + [ + 472, + 473 + ], + [ + 474, + 478 + ], + [ + 493, + 494 + ], + [ + 495, + 497 + ], + [ + 506, + 507 + ] + ] + } + }, + { + "filename": "libvips/deprecated/cooc_funcs.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 14 + ], + [ + 35, + 68 + ], + [ + 77, + 85 + ], + [ + 90, + 157 + ], + [ + 162, + 447 + ] + ], + "lines_added": [ + [ + 9, + 11 + ], + [ + 38, + 39 + ], + [ + 43, + 44 + ], + [ + 45, + 49 + ], + [ + 50, + 59 + ], + [ + 64, + 65 + ], + [ + 80, + 82 + ], + [ + 93, + 102 + ], + [ + 103, + 104 + ], + [ + 109, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 123, + 126 + ], + [ + 132, + 133 + ], + [ + 136, + 137 + ], + [ + 140, + 145 + ], + [ + 146, + 150 + ], + [ + 152, + 154 + ], + [ + 165, + 174 + ], + [ + 175, + 176 + ], + [ + 180, + 188 + ], + [ + 189, + 190 + ], + [ + 191, + 192 + ], + [ + 194, + 197 + ], + [ + 201, + 202 + ], + [ + 205, + 206 + ], + [ + 209, + 214 + ], + [ + 215, + 219 + ], + [ + 223, + 226 + ], + [ + 228, + 235 + ], + [ + 239, + 241 + ], + [ + 245, + 247 + ], + [ + 248, + 253 + ], + [ + 254, + 256 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 263, + 265 + ], + [ + 269, + 271 + ], + [ + 272, + 277 + ], + [ + 278, + 280 + ], + [ + 282, + 284 + ], + [ + 287, + 288 + ], + [ + 290, + 291 + ], + [ + 296, + 297 + ], + [ + 301, + 303 + ], + [ + 304, + 305 + ], + [ + 306, + 312 + ], + [ + 313, + 314 + ], + [ + 315, + 319 + ], + [ + 320, + 321 + ], + [ + 326, + 328 + ], + [ + 333, + 337 + ], + [ + 339, + 355 + ], + [ + 357, + 359 + ], + [ + 360, + 362 + ], + [ + 363, + 365 + ], + [ + 367, + 369 + ], + [ + 372, + 374 + ], + [ + 377, + 378 + ], + [ + 380, + 381 + ], + [ + 383, + 385 + ], + [ + 387, + 388 + ], + [ + 389, + 390 + ], + [ + 392, + 393 + ], + [ + 396, + 401 + ], + [ + 402, + 405 + ], + [ + 407, + 409 + ], + [ + 412, + 413 + ], + [ + 416, + 418 + ], + [ + 419, + 425 + ], + [ + 428, + 429 + ], + [ + 431, + 433 + ], + [ + 434, + 435 + ], + [ + 436, + 437 + ], + [ + 438, + 440 + ], + [ + 442, + 443 + ], + [ + 444, + 446 + ] + ] + } + }, + { + "filename": "libvips/deprecated/deprecated_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 42, + 208 + ], + [ + 210, + 317 + ], + [ + 323, + 397 + ], + [ + 401, + 786 + ], + [ + 787, + 822 + ], + [ + 823, + 1092 + ], + [ + 1094, + 1291 + ], + [ + 1294, + 1332 + ], + [ + 1335, + 1374 + ], + [ + 1376, + 2236 + ], + [ + 2271, + 2278 + ], + [ + 2325, + 2331 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 22 + ], + [ + 27, + 28 + ], + [ + 45, + 47 + ], + [ + 50, + 53 + ], + [ + 56, + 57 + ], + [ + 58, + 59 + ], + [ + 62, + 63 + ], + [ + 64, + 68 + ], + [ + 73, + 76 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 89, + 90 + ], + [ + 91, + 95 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 108, + 109 + ], + [ + 110, + 114 + ], + [ + 119, + 123 + ], + [ + 128, + 136 + ], + [ + 141, + 144 + ], + [ + 149, + 154 + ], + [ + 159, + 162 + ], + [ + 167, + 170 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 183, + 189 + ], + [ + 194, + 199 + ], + [ + 204, + 205 + ], + [ + 213, + 214 + ], + [ + 217, + 218 + ], + [ + 219, + 225 + ], + [ + 230, + 236 + ], + [ + 241, + 242 + ], + [ + 247, + 248 + ], + [ + 251, + 252 + ], + [ + 253, + 259 + ], + [ + 264, + 269 + ], + [ + 274, + 275 + ], + [ + 279, + 280 + ], + [ + 283, + 284 + ], + [ + 285, + 291 + ], + [ + 296, + 308 + ], + [ + 313, + 314 + ], + [ + 326, + 327 + ], + [ + 330, + 331 + ], + [ + 332, + 333 + ], + [ + 334, + 338 + ], + [ + 343, + 349 + ], + [ + 354, + 355 + ], + [ + 361, + 362 + ], + [ + 365, + 366 + ], + [ + 367, + 368 + ], + [ + 369, + 373 + ], + [ + 378, + 388 + ], + [ + 393, + 394 + ], + [ + 404, + 406 + ], + [ + 409, + 410 + ], + [ + 411, + 412 + ], + [ + 413, + 417 + ], + [ + 420, + 421 + ], + [ + 424, + 426 + ], + [ + 429, + 433 + ], + [ + 436, + 437 + ], + [ + 438, + 445 + ], + [ + 450, + 453 + ], + [ + 458, + 459 + ], + [ + 464, + 465 + ], + [ + 468, + 469 + ], + [ + 470, + 471 + ], + [ + 472, + 476 + ], + [ + 479, + 480 + ], + [ + 484, + 487 + ], + [ + 488, + 489 + ], + [ + 492, + 494 + ], + [ + 497, + 498 + ], + [ + 499, + 503 + ], + [ + 508, + 509 + ], + [ + 510, + 511 + ], + [ + 516, + 517 + ], + [ + 518, + 522 + ], + [ + 527, + 528 + ], + [ + 529, + 530 + ], + [ + 535, + 536 + ], + [ + 537, + 541 + ], + [ + 546, + 547 + ], + [ + 548, + 549 + ], + [ + 554, + 555 + ], + [ + 556, + 560 + ], + [ + 565, + 566 + ], + [ + 567, + 568 + ], + [ + 573, + 574 + ], + [ + 575, + 579 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 592, + 593 + ], + [ + 594, + 598 + ], + [ + 603, + 604 + ], + [ + 605, + 606 + ], + [ + 611, + 612 + ], + [ + 613, + 617 + ], + [ + 622, + 623 + ], + [ + 624, + 625 + ], + [ + 630, + 631 + ], + [ + 632, + 636 + ], + [ + 641, + 642 + ], + [ + 643, + 644 + ], + [ + 649, + 650 + ], + [ + 651, + 655 + ], + [ + 660, + 661 + ], + [ + 662, + 663 + ], + [ + 668, + 669 + ], + [ + 670, + 674 + ], + [ + 679, + 682 + ], + [ + 687, + 688 + ], + [ + 691, + 692 + ], + [ + 697, + 698 + ], + [ + 699, + 703 + ], + [ + 708, + 712 + ], + [ + 717, + 718 + ], + [ + 722, + 723 + ], + [ + 728, + 729 + ], + [ + 730, + 734 + ], + [ + 739, + 744 + ], + [ + 749, + 750 + ], + [ + 755, + 756 + ], + [ + 759, + 760 + ], + [ + 761, + 762 + ], + [ + 763, + 767 + ], + [ + 772, + 777 + ], + [ + 782, + 783 + ], + [ + 790, + 791 + ], + [ + 796, + 802 + ], + [ + 807, + 813 + ], + [ + 818, + 819 + ], + [ + 826, + 827 + ], + [ + 830, + 831 + ], + [ + 832, + 833 + ], + [ + 834, + 838 + ], + [ + 843, + 847 + ], + [ + 852, + 853 + ], + [ + 857, + 858 + ], + [ + 861, + 862 + ], + [ + 863, + 864 + ], + [ + 865, + 869 + ], + [ + 874, + 879 + ], + [ + 884, + 885 + ], + [ + 889, + 893 + ], + [ + 895, + 897 + ], + [ + 898, + 899 + ], + [ + 902, + 903 + ], + [ + 904, + 905 + ], + [ + 906, + 910 + ], + [ + 915, + 916 + ], + [ + 917, + 918 + ], + [ + 921, + 922 + ], + [ + 923, + 924 + ], + [ + 925, + 929 + ], + [ + 934, + 935 + ], + [ + 936, + 937 + ], + [ + 940, + 941 + ], + [ + 942, + 943 + ], + [ + 944, + 948 + ], + [ + 953, + 954 + ], + [ + 955, + 956 + ], + [ + 959, + 960 + ], + [ + 961, + 962 + ], + [ + 963, + 967 + ], + [ + 972, + 973 + ], + [ + 976, + 977 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 984, + 988 + ], + [ + 993, + 994 + ], + [ + 997, + 998 + ], + [ + 1001, + 1002 + ], + [ + 1003, + 1004 + ], + [ + 1005, + 1009 + ], + [ + 1014, + 1015 + ], + [ + 1018, + 1019 + ], + [ + 1022, + 1023 + ], + [ + 1024, + 1025 + ], + [ + 1026, + 1030 + ], + [ + 1035, + 1036 + ], + [ + 1039, + 1040 + ], + [ + 1043, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1047, + 1051 + ], + [ + 1056, + 1060 + ], + [ + 1065, + 1066 + ], + [ + 1070, + 1072 + ], + [ + 1075, + 1076 + ], + [ + 1077, + 1078 + ], + [ + 1079, + 1083 + ], + [ + 1088, + 1089 + ], + [ + 1097, + 1098 + ], + [ + 1101, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1105, + 1109 + ], + [ + 1114, + 1115 + ], + [ + 1119, + 1120 + ], + [ + 1123, + 1124 + ], + [ + 1125, + 1126 + ], + [ + 1127, + 1131 + ], + [ + 1136, + 1137 + ], + [ + 1142, + 1143 + ], + [ + 1146, + 1147 + ], + [ + 1148, + 1149 + ], + [ + 1150, + 1154 + ], + [ + 1159, + 1160 + ], + [ + 1163, + 1164 + ], + [ + 1167, + 1168 + ], + [ + 1169, + 1170 + ], + [ + 1171, + 1175 + ], + [ + 1180, + 1181 + ], + [ + 1184, + 1185 + ], + [ + 1188, + 1189 + ], + [ + 1190, + 1191 + ], + [ + 1192, + 1196 + ], + [ + 1201, + 1202 + ], + [ + 1205, + 1206 + ], + [ + 1209, + 1210 + ], + [ + 1211, + 1212 + ], + [ + 1213, + 1217 + ], + [ + 1222, + 1223 + ], + [ + 1226, + 1227 + ], + [ + 1230, + 1231 + ], + [ + 1232, + 1233 + ], + [ + 1234, + 1238 + ], + [ + 1243, + 1248 + ], + [ + 1253, + 1254 + ], + [ + 1260, + 1261 + ], + [ + 1264, + 1265 + ], + [ + 1266, + 1267 + ], + [ + 1268, + 1272 + ], + [ + 1277, + 1282 + ], + [ + 1287, + 1288 + ], + [ + 1297, + 1300 + ], + [ + 1301, + 1302 + ], + [ + 1305, + 1306 + ], + [ + 1307, + 1308 + ], + [ + 1309, + 1313 + ], + [ + 1318, + 1323 + ], + [ + 1328, + 1329 + ], + [ + 1338, + 1341 + ], + [ + 1342, + 1343 + ], + [ + 1346, + 1347 + ], + [ + 1348, + 1349 + ], + [ + 1350, + 1354 + ], + [ + 1359, + 1365 + ], + [ + 1370, + 1371 + ], + [ + 1379, + 1381 + ], + [ + 1384, + 1385 + ], + [ + 1386, + 1387 + ], + [ + 1388, + 1392 + ], + [ + 1397, + 1401 + ], + [ + 1406, + 1407 + ], + [ + 1411, + 1412 + ], + [ + 1415, + 1416 + ], + [ + 1417, + 1418 + ], + [ + 1419, + 1423 + ], + [ + 1428, + 1429 + ], + [ + 1432, + 1433 + ], + [ + 1436, + 1439 + ], + [ + 1442, + 1449 + ], + [ + 1454, + 1456 + ], + [ + 1461, + 1462 + ], + [ + 1465, + 1466 + ], + [ + 1471, + 1472 + ], + [ + 1473, + 1477 + ], + [ + 1482, + 1484 + ], + [ + 1489, + 1490 + ], + [ + 1493, + 1495 + ], + [ + 1496, + 1497 + ], + [ + 1502, + 1503 + ], + [ + 1504, + 1508 + ], + [ + 1513, + 1516 + ], + [ + 1521, + 1524 + ], + [ + 1529, + 1532 + ], + [ + 1537, + 1538 + ], + [ + 1539, + 1540 + ], + [ + 1543, + 1544 + ], + [ + 1545, + 1551 + ], + [ + 1556, + 1557 + ], + [ + 1560, + 1561 + ], + [ + 1564, + 1565 + ], + [ + 1566, + 1567 + ], + [ + 1568, + 1572 + ], + [ + 1577, + 1578 + ], + [ + 1581, + 1582 + ], + [ + 1585, + 1586 + ], + [ + 1587, + 1588 + ], + [ + 1589, + 1593 + ], + [ + 1598, + 1599 + ], + [ + 1600, + 1601 + ], + [ + 1604, + 1605 + ], + [ + 1606, + 1608 + ], + [ + 1609, + 1612 + ], + [ + 1617, + 1618 + ], + [ + 1621, + 1622 + ], + [ + 1625, + 1626 + ], + [ + 1627, + 1628 + ], + [ + 1629, + 1633 + ], + [ + 1638, + 1639 + ], + [ + 1642, + 1643 + ], + [ + 1646, + 1647 + ], + [ + 1648, + 1649 + ], + [ + 1650, + 1654 + ], + [ + 1659, + 1660 + ], + [ + 1661, + 1662 + ], + [ + 1665, + 1666 + ], + [ + 1667, + 1673 + ], + [ + 1678, + 1679 + ], + [ + 1682, + 1683 + ], + [ + 1686, + 1687 + ], + [ + 1688, + 1689 + ], + [ + 1690, + 1694 + ], + [ + 1699, + 1700 + ], + [ + 1703, + 1704 + ], + [ + 1707, + 1708 + ], + [ + 1709, + 1710 + ], + [ + 1711, + 1715 + ], + [ + 1720, + 1721 + ], + [ + 1724, + 1725 + ], + [ + 1728, + 1729 + ], + [ + 1730, + 1731 + ], + [ + 1732, + 1736 + ], + [ + 1741, + 1742 + ], + [ + 1745, + 1746 + ], + [ + 1749, + 1750 + ], + [ + 1751, + 1752 + ], + [ + 1753, + 1757 + ], + [ + 1762, + 1763 + ], + [ + 1766, + 1767 + ], + [ + 1770, + 1771 + ], + [ + 1772, + 1773 + ], + [ + 1774, + 1778 + ], + [ + 1783, + 1784 + ], + [ + 1787, + 1788 + ], + [ + 1791, + 1792 + ], + [ + 1793, + 1794 + ], + [ + 1795, + 1799 + ], + [ + 1804, + 1805 + ], + [ + 1806, + 1807 + ], + [ + 1810, + 1811 + ], + [ + 1812, + 1818 + ], + [ + 1823, + 1824 + ], + [ + 1827, + 1828 + ], + [ + 1831, + 1832 + ], + [ + 1833, + 1839 + ], + [ + 1844, + 1845 + ], + [ + 1848, + 1849 + ], + [ + 1852, + 1853 + ], + [ + 1854, + 1860 + ], + [ + 1865, + 1866 + ], + [ + 1867, + 1868 + ], + [ + 1871, + 1872 + ], + [ + 1873, + 1879 + ], + [ + 1884, + 1885 + ], + [ + 1888, + 1889 + ], + [ + 1892, + 1893 + ], + [ + 1894, + 1900 + ], + [ + 1905, + 1906 + ], + [ + 1909, + 1910 + ], + [ + 1913, + 1914 + ], + [ + 1915, + 1921 + ], + [ + 1926, + 1927 + ], + [ + 1928, + 1929 + ], + [ + 1932, + 1933 + ], + [ + 1934, + 1940 + ], + [ + 1945, + 1946 + ], + [ + 1949, + 1950 + ], + [ + 1953, + 1954 + ], + [ + 1955, + 1961 + ], + [ + 1966, + 1967 + ], + [ + 1970, + 1971 + ], + [ + 1974, + 1975 + ], + [ + 1976, + 1982 + ], + [ + 1987, + 1988 + ], + [ + 1989, + 1990 + ], + [ + 1993, + 1994 + ], + [ + 1995, + 2001 + ], + [ + 2006, + 2007 + ], + [ + 2010, + 2011 + ], + [ + 2014, + 2015 + ], + [ + 2016, + 2022 + ], + [ + 2027, + 2028 + ], + [ + 2031, + 2032 + ], + [ + 2035, + 2036 + ], + [ + 2037, + 2043 + ], + [ + 2048, + 2049 + ], + [ + 2050, + 2051 + ], + [ + 2054, + 2055 + ], + [ + 2056, + 2057 + ], + [ + 2058, + 2062 + ], + [ + 2067, + 2068 + ], + [ + 2071, + 2072 + ], + [ + 2075, + 2076 + ], + [ + 2077, + 2078 + ], + [ + 2079, + 2083 + ], + [ + 2088, + 2089 + ], + [ + 2092, + 2093 + ], + [ + 2096, + 2097 + ], + [ + 2098, + 2099 + ], + [ + 2100, + 2104 + ], + [ + 2109, + 2110 + ], + [ + 2111, + 2112 + ], + [ + 2115, + 2116 + ], + [ + 2117, + 2118 + ], + [ + 2119, + 2123 + ], + [ + 2128, + 2129 + ], + [ + 2132, + 2133 + ], + [ + 2136, + 2137 + ], + [ + 2138, + 2139 + ], + [ + 2140, + 2144 + ], + [ + 2149, + 2150 + ], + [ + 2153, + 2154 + ], + [ + 2157, + 2158 + ], + [ + 2159, + 2160 + ], + [ + 2161, + 2165 + ], + [ + 2170, + 2174 + ], + [ + 2179, + 2180 + ], + [ + 2181, + 2182 + ], + [ + 2185, + 2186 + ], + [ + 2187, + 2188 + ], + [ + 2190, + 2193 + ], + [ + 2198, + 2199 + ], + [ + 2200, + 2201 + ], + [ + 2204, + 2205 + ], + [ + 2206, + 2207 + ], + [ + 2209, + 2212 + ], + [ + 2217, + 2218 + ], + [ + 2219, + 2220 + ], + [ + 2223, + 2224 + ], + [ + 2225, + 2231 + ], + [ + 2274, + 2275 + ], + [ + 2328, + 2329 + ] + ] + } + }, + { + "filename": "libvips/deprecated/dispatch_types.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 50, + 57 + ], + [ + 58, + 354 + ], + [ + 355, + 637 + ], + [ + 638, + 725 + ], + [ + 728, + 799 + ], + [ + 800, + 837 + ] + ], + "lines_added": [ + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 30 + ], + [ + 35, + 36 + ], + [ + 53, + 54 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 71, + 75 + ], + [ + 81, + 86 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ], + [ + 101, + 106 + ], + [ + 111, + 112 + ], + [ + 115, + 116 + ], + [ + 121, + 126 + ], + [ + 131, + 132 + ], + [ + 135, + 136 + ], + [ + 141, + 146 + ], + [ + 151, + 152 + ], + [ + 155, + 156 + ], + [ + 158, + 161 + ], + [ + 164, + 165 + ], + [ + 169, + 170 + ], + [ + 175, + 176 + ], + [ + 182, + 184 + ], + [ + 185, + 188 + ], + [ + 193, + 194 + ], + [ + 196, + 200 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 210, + 213 + ], + [ + 214, + 215 + ], + [ + 220, + 221 + ], + [ + 226, + 228 + ], + [ + 230, + 231 + ], + [ + 236, + 237 + ], + [ + 240, + 244 + ], + [ + 245, + 246 + ], + [ + 248, + 249 + ], + [ + 251, + 252 + ], + [ + 255, + 259 + ], + [ + 260, + 261 + ], + [ + 266, + 267 + ], + [ + 270, + 272 + ], + [ + 273, + 274 + ], + [ + 279, + 280 + ], + [ + 283, + 285 + ], + [ + 286, + 287 + ], + [ + 292, + 293 + ], + [ + 296, + 299 + ], + [ + 304, + 305 + ], + [ + 308, + 311 + ], + [ + 316, + 321 + ], + [ + 327, + 328 + ], + [ + 329, + 331 + ], + [ + 336, + 341 + ], + [ + 347, + 348 + ], + [ + 349, + 351 + ], + [ + 358, + 359 + ], + [ + 360, + 362 + ], + [ + 367, + 368 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 379, + 384 + ], + [ + 389, + 390 + ], + [ + 393, + 395 + ], + [ + 399, + 400 + ], + [ + 405, + 406 + ], + [ + 412, + 414 + ], + [ + 415, + 418 + ], + [ + 421, + 428 + ], + [ + 431, + 432 + ], + [ + 433, + 434 + ], + [ + 439, + 444 + ], + [ + 449, + 450 + ], + [ + 454, + 457 + ], + [ + 458, + 459 + ], + [ + 464, + 469 + ], + [ + 474, + 475 + ], + [ + 478, + 480 + ], + [ + 484, + 485 + ], + [ + 490, + 491 + ], + [ + 497, + 499 + ], + [ + 500, + 503 + ], + [ + 506, + 508 + ], + [ + 509, + 518 + ], + [ + 522, + 523 + ], + [ + 524, + 525 + ], + [ + 530, + 535 + ], + [ + 540, + 541 + ], + [ + 545, + 548 + ], + [ + 549, + 550 + ], + [ + 555, + 560 + ], + [ + 565, + 566 + ], + [ + 569, + 572 + ], + [ + 574, + 575 + ], + [ + 580, + 585 + ], + [ + 590, + 591 + ], + [ + 592, + 594 + ], + [ + 595, + 596 + ], + [ + 601, + 606 + ], + [ + 611, + 612 + ], + [ + 613, + 616 + ], + [ + 621, + 626 + ], + [ + 631, + 634 + ], + [ + 641, + 646 + ], + [ + 651, + 652 + ], + [ + 655, + 656 + ], + [ + 657, + 658 + ], + [ + 663, + 664 + ], + [ + 667, + 668 + ], + [ + 669, + 670 + ], + [ + 675, + 676 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 687, + 688 + ], + [ + 691, + 692 + ], + [ + 693, + 694 + ], + [ + 699, + 700 + ], + [ + 705, + 706 + ], + [ + 707, + 710 + ], + [ + 711, + 713 + ], + [ + 714, + 715 + ], + [ + 716, + 719 + ], + [ + 721, + 722 + ], + [ + 731, + 732 + ], + [ + 735, + 737 + ], + [ + 738, + 739 + ], + [ + 742, + 743 + ], + [ + 749, + 751 + ], + [ + 752, + 753 + ], + [ + 758, + 763 + ], + [ + 766, + 767 + ], + [ + 771, + 774 + ], + [ + 775, + 776 + ], + [ + 781, + 782 + ], + [ + 785, + 786 + ], + [ + 787, + 788 + ], + [ + 791, + 796 + ], + [ + 803, + 804 + ], + [ + 805, + 807 + ], + [ + 809, + 810 + ], + [ + 811, + 816 + ], + [ + 819, + 820 + ], + [ + 823, + 824 + ], + [ + 825, + 826 + ], + [ + 827, + 828 + ], + [ + 831, + 836 + ] + ] + } + }, + { + "filename": "libvips/deprecated/fits.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 46, + 80 + ], + [ + 84, + 97 + ], + [ + 99, + 107 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 49, + 50 + ], + [ + 53, + 58 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 67, + 69 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 87, + 88 + ], + [ + 93, + 94 + ], + [ + 102, + 103 + ], + [ + 106, + 107 + ] + ] + } + }, + { + "filename": "libvips/deprecated/format.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 39, + 64 + ], + [ + 67, + 74 + ], + [ + 78, + 144 + ], + [ + 146, + 153 + ], + [ + 155, + 169 + ], + [ + 171, + 225 + ], + [ + 227, + 246 + ], + [ + 251, + 330 + ], + [ + 337, + 381 + ], + [ + 388, + 409 + ], + [ + 417, + 432 + ], + [ + 440, + 453 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 42, + 43 + ], + [ + 47, + 48 + ], + [ + 49, + 50 + ], + [ + 52, + 53 + ], + [ + 54, + 55 + ], + [ + 58, + 59 + ], + [ + 60, + 61 + ], + [ + 70, + 71 + ], + [ + 81, + 82 + ], + [ + 87, + 89 + ], + [ + 90, + 93 + ], + [ + 94, + 95 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 111 + ], + [ + 113, + 118 + ], + [ + 119, + 120 + ], + [ + 122, + 132 + ], + [ + 135, + 136 + ], + [ + 140, + 141 + ], + [ + 149, + 150 + ], + [ + 158, + 159 + ], + [ + 163, + 164 + ], + [ + 165, + 166 + ], + [ + 174, + 175 + ], + [ + 178, + 181 + ], + [ + 183, + 186 + ], + [ + 188, + 189 + ], + [ + 191, + 192 + ], + [ + 195, + 196 + ], + [ + 199, + 202 + ], + [ + 203, + 204 + ], + [ + 207, + 208 + ], + [ + 214, + 216 + ], + [ + 217, + 219 + ], + [ + 221, + 222 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 242, + 243 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 263, + 264 + ], + [ + 265, + 269 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 280, + 281 + ], + [ + 287, + 288 + ], + [ + 291, + 292 + ], + [ + 295, + 296 + ], + [ + 300, + 301 + ], + [ + 304, + 305 + ], + [ + 307, + 308 + ], + [ + 309, + 310 + ], + [ + 316, + 318 + ], + [ + 319, + 322 + ], + [ + 323, + 325 + ], + [ + 326, + 327 + ], + [ + 340, + 341 + ], + [ + 346, + 347 + ], + [ + 349, + 350 + ], + [ + 351, + 354 + ], + [ + 356, + 362 + ], + [ + 364, + 365 + ], + [ + 371, + 372 + ], + [ + 373, + 376 + ], + [ + 377, + 378 + ], + [ + 391, + 392 + ], + [ + 395, + 401 + ], + [ + 402, + 403 + ], + [ + 405, + 406 + ], + [ + 420, + 421 + ], + [ + 424, + 427 + ], + [ + 428, + 429 + ], + [ + 443, + 444 + ], + [ + 447, + 450 + ], + [ + 451, + 452 + ] + ] + } + }, + { + "filename": "libvips/deprecated/format_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 39, + 443 + ], + [ + 464, + 470 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 42, + 43 + ], + [ + 47, + 49 + ], + [ + 50, + 51 + ], + [ + 54, + 56 + ], + [ + 59, + 65 + ], + [ + 68, + 69 + ], + [ + 73, + 75 + ], + [ + 76, + 77 + ], + [ + 80, + 82 + ], + [ + 85, + 91 + ], + [ + 94, + 95 + ], + [ + 99, + 101 + ], + [ + 102, + 103 + ], + [ + 106, + 108 + ], + [ + 111, + 117 + ], + [ + 120, + 121 + ], + [ + 125, + 127 + ], + [ + 128, + 129 + ], + [ + 132, + 134 + ], + [ + 137, + 138 + ], + [ + 139, + 143 + ], + [ + 148, + 150 + ], + [ + 155, + 156 + ], + [ + 157, + 158 + ], + [ + 163, + 164 + ], + [ + 166, + 169 + ], + [ + 174, + 176 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 189, + 190 + ], + [ + 192, + 195 + ], + [ + 200, + 202 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 215, + 216 + ], + [ + 218, + 221 + ], + [ + 226, + 228 + ], + [ + 233, + 234 + ], + [ + 235, + 236 + ], + [ + 241, + 242 + ], + [ + 244, + 247 + ], + [ + 252, + 254 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 267, + 269 + ], + [ + 270, + 273 + ], + [ + 278, + 280 + ], + [ + 285, + 286 + ], + [ + 287, + 288 + ], + [ + 293, + 294 + ], + [ + 296, + 299 + ], + [ + 302, + 303 + ], + [ + 304, + 306 + ], + [ + 307, + 308 + ], + [ + 311, + 313 + ], + [ + 316, + 322 + ], + [ + 325, + 326 + ], + [ + 327, + 329 + ], + [ + 330, + 331 + ], + [ + 334, + 336 + ], + [ + 339, + 345 + ], + [ + 348, + 349 + ], + [ + 350, + 352 + ], + [ + 353, + 354 + ], + [ + 357, + 359 + ], + [ + 362, + 368 + ], + [ + 371, + 372 + ], + [ + 373, + 375 + ], + [ + 376, + 377 + ], + [ + 380, + 382 + ], + [ + 385, + 391 + ], + [ + 394, + 395 + ], + [ + 396, + 398 + ], + [ + 399, + 400 + ], + [ + 403, + 405 + ], + [ + 408, + 414 + ], + [ + 417, + 418 + ], + [ + 422, + 424 + ], + [ + 425, + 426 + ], + [ + 429, + 431 + ], + [ + 434, + 440 + ], + [ + 467, + 468 + ] + ] + } + }, + { + "filename": "libvips/deprecated/freq_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 46, + 82 + ], + [ + 86, + 124 + ], + [ + 126, + 316 + ], + [ + 331, + 337 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 49, + 51 + ], + [ + 56, + 59 + ], + [ + 64, + 73 + ], + [ + 78, + 79 + ], + [ + 89, + 91 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 98, + 102 + ], + [ + 107, + 115 + ], + [ + 120, + 121 + ], + [ + 129, + 131 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 138, + 142 + ], + [ + 147, + 150 + ], + [ + 155, + 156 + ], + [ + 160, + 161 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 168, + 172 + ], + [ + 177, + 180 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 195, + 199 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 218 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 229, + 230 + ], + [ + 231, + 232 + ], + [ + 233, + 237 + ], + [ + 242, + 243 + ], + [ + 244, + 245 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 252, + 256 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 271, + 275 + ], + [ + 280, + 281 + ], + [ + 282, + 283 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 290, + 294 + ], + [ + 299, + 300 + ], + [ + 301, + 302 + ], + [ + 305, + 306 + ], + [ + 307, + 308 + ], + [ + 309, + 313 + ], + [ + 334, + 335 + ] + ] + } + }, + { + "filename": "libvips/deprecated/glds_funcs.c", + "line_filter": { + "diff_chunks": [ + [ + 37, + 65 + ], + [ + 76, + 85 + ], + [ + 89, + 256 + ] + ], + "lines_added": [ + [ + 40, + 56 + ], + [ + 61, + 62 + ], + [ + 79, + 82 + ], + [ + 92, + 93 + ], + [ + 94, + 98 + ], + [ + 99, + 103 + ], + [ + 105, + 107 + ], + [ + 112, + 113 + ], + [ + 114, + 120 + ], + [ + 121, + 123 + ], + [ + 124, + 125 + ], + [ + 127, + 129 + ], + [ + 133, + 134 + ], + [ + 138, + 146 + ], + [ + 150, + 152 + ], + [ + 154, + 155 + ], + [ + 156, + 158 + ], + [ + 159, + 164 + ], + [ + 165, + 167 + ], + [ + 168, + 170 + ], + [ + 171, + 172 + ], + [ + 176, + 178 + ], + [ + 180, + 181 + ], + [ + 182, + 184 + ], + [ + 185, + 190 + ], + [ + 191, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 203, + 205 + ], + [ + 207, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 217 + ], + [ + 218, + 223 + ], + [ + 224, + 228 + ], + [ + 232, + 234 + ], + [ + 236, + 237 + ], + [ + 238, + 240 + ], + [ + 241, + 246 + ], + [ + 247, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 255 + ] + ] + } + }, + { + "filename": "libvips/deprecated/hist_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 489 + ], + [ + 491, + 587 + ], + [ + 591, + 631 + ], + [ + 637, + 675 + ], + [ + 677, + 779 + ], + [ + 810, + 816 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 48 + ], + [ + 53, + 56 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 69, + 70 + ], + [ + 71, + 77 + ], + [ + 82, + 85 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 106 + ], + [ + 109, + 112 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 131 + ], + [ + 136, + 137 + ], + [ + 140, + 141 + ], + [ + 144, + 145 + ], + [ + 146, + 152 + ], + [ + 157, + 158 + ], + [ + 159, + 160 + ], + [ + 163, + 164 + ], + [ + 165, + 171 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 184, + 190 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 201, + 202 + ], + [ + 203, + 209 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 224, + 230 + ], + [ + 235, + 236 + ], + [ + 239, + 240 + ], + [ + 245, + 248 + ], + [ + 251, + 252 + ], + [ + 253, + 259 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 271 + ], + [ + 272, + 278 + ], + [ + 283, + 286 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 301, + 305 + ], + [ + 310, + 311 + ], + [ + 312, + 313 + ], + [ + 316, + 317 + ], + [ + 318, + 319 + ], + [ + 320, + 324 + ], + [ + 329, + 331 + ], + [ + 336, + 337 + ], + [ + 340, + 341 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 348, + 352 + ], + [ + 357, + 360 + ], + [ + 365, + 366 + ], + [ + 370, + 371 + ], + [ + 374, + 375 + ], + [ + 376, + 377 + ], + [ + 378, + 382 + ], + [ + 387, + 391 + ], + [ + 396, + 397 + ], + [ + 401, + 402 + ], + [ + 405, + 406 + ], + [ + 407, + 408 + ], + [ + 409, + 413 + ], + [ + 418, + 421 + ], + [ + 426, + 427 + ], + [ + 428, + 429 + ], + [ + 432, + 433 + ], + [ + 434, + 435 + ], + [ + 436, + 440 + ], + [ + 445, + 446 + ], + [ + 447, + 448 + ], + [ + 453, + 456 + ], + [ + 459, + 460 + ], + [ + 461, + 467 + ], + [ + 472, + 480 + ], + [ + 485, + 486 + ], + [ + 494, + 495 + ], + [ + 498, + 499 + ], + [ + 500, + 501 + ], + [ + 502, + 506 + ], + [ + 511, + 513 + ], + [ + 518, + 519 + ], + [ + 522, + 523 + ], + [ + 526, + 527 + ], + [ + 528, + 529 + ], + [ + 530, + 534 + ], + [ + 539, + 542 + ], + [ + 547, + 548 + ], + [ + 552, + 553 + ], + [ + 556, + 557 + ], + [ + 558, + 559 + ], + [ + 560, + 564 + ], + [ + 569, + 578 + ], + [ + 583, + 584 + ], + [ + 594, + 595 + ], + [ + 598, + 599 + ], + [ + 600, + 601 + ], + [ + 602, + 606 + ], + [ + 611, + 622 + ], + [ + 627, + 628 + ], + [ + 640, + 642 + ], + [ + 645, + 646 + ], + [ + 647, + 648 + ], + [ + 649, + 653 + ], + [ + 658, + 666 + ], + [ + 671, + 672 + ], + [ + 680, + 681 + ], + [ + 684, + 685 + ], + [ + 686, + 687 + ], + [ + 688, + 692 + ], + [ + 697, + 699 + ], + [ + 704, + 705 + ], + [ + 708, + 709 + ], + [ + 712, + 713 + ], + [ + 714, + 715 + ], + [ + 716, + 720 + ], + [ + 725, + 728 + ], + [ + 733, + 734 + ], + [ + 735, + 736 + ], + [ + 739, + 740 + ], + [ + 741, + 742 + ], + [ + 743, + 747 + ], + [ + 752, + 755 + ], + [ + 760, + 761 + ], + [ + 764, + 765 + ], + [ + 768, + 769 + ], + [ + 770, + 771 + ], + [ + 772, + 776 + ], + [ + 813, + 814 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_align_bands.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 47, + 100 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 32, + 33 + ], + [ + 50, + 51 + ], + [ + 53, + 54 + ], + [ + 58, + 61 + ], + [ + 62, + 98 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_analyze2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 44, + 76 + ], + [ + 78, + 91 + ], + [ + 93, + 101 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 47, + 48 + ], + [ + 49, + 51 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 60, + 61 + ], + [ + 64, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 81, + 82 + ], + [ + 87, + 88 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_benchmark.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 57, + 70 + ], + [ + 81, + 88 + ], + [ + 106, + 138 + ], + [ + 145, + 152 + ], + [ + 155, + 163 + ], + [ + 166, + 173 + ], + [ + 175, + 238 + ], + [ + 253, + 283 + ], + [ + 292, + 304 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 66, + 67 + ], + [ + 84, + 85 + ], + [ + 109, + 110 + ], + [ + 114, + 115 + ], + [ + 118, + 121 + ], + [ + 125, + 126 + ], + [ + 128, + 129 + ], + [ + 134, + 135 + ], + [ + 148, + 149 + ], + [ + 158, + 160 + ], + [ + 169, + 170 + ], + [ + 178, + 179 + ], + [ + 181, + 182 + ], + [ + 183, + 185 + ], + [ + 186, + 187 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 197, + 199 + ], + [ + 202, + 203 + ], + [ + 204, + 206 + ], + [ + 209, + 211 + ], + [ + 214, + 221 + ], + [ + 224, + 226 + ], + [ + 229, + 230 + ], + [ + 233, + 235 + ], + [ + 256, + 257 + ], + [ + 260, + 261 + ], + [ + 263, + 267 + ], + [ + 273, + 274 + ], + [ + 275, + 278 + ], + [ + 279, + 280 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 299, + 303 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_bernd.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 8 + ], + [ + 18, + 46 + ], + [ + 55, + 94 + ] + ], + "lines_added": [ + [ + 3, + 5 + ], + [ + 21, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 37 + ], + [ + 42, + 43 + ], + [ + 58, + 59 + ], + [ + 64, + 68 + ], + [ + 69, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 79, + 80 + ], + [ + 83, + 89 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_clamp.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 52, + 126 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 55, + 75 + ], + [ + 76, + 108 + ], + [ + 110, + 118 + ], + [ + 120, + 123 + ], + [ + 124, + 125 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_cmulnorm.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 16, + 44 + ], + [ + 60, + 84 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 35 + ], + [ + 40, + 41 + ], + [ + 63, + 64 + ], + [ + 65, + 66 + ], + [ + 72, + 74 + ], + [ + 77, + 83 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_convsub.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 49 + ], + [ + 59, + 358 + ] + ], + "lines_added": [ + [ + 19, + 20 + ], + [ + 24, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 40 + ], + [ + 45, + 46 + ], + [ + 62, + 64 + ], + [ + 66, + 68 + ], + [ + 73, + 74 + ], + [ + 76, + 82 + ], + [ + 87, + 89 + ], + [ + 91, + 92 + ], + [ + 96, + 100 + ], + [ + 103, + 105 + ], + [ + 107, + 109 + ], + [ + 113, + 116 + ], + [ + 118, + 123 + ], + [ + 124, + 131 + ], + [ + 133, + 134 + ], + [ + 136, + 137 + ], + [ + 138, + 140 + ], + [ + 143, + 144 + ], + [ + 145, + 150 + ], + [ + 151, + 152 + ], + [ + 154, + 156 + ], + [ + 161, + 163 + ], + [ + 166, + 167 + ], + [ + 169, + 171 + ], + [ + 172, + 174 + ], + [ + 179, + 184 + ], + [ + 185, + 192 + ], + [ + 193, + 194 + ], + [ + 195, + 199 + ], + [ + 202, + 203 + ], + [ + 204, + 209 + ], + [ + 212, + 213 + ], + [ + 214, + 219 + ], + [ + 221, + 223 + ], + [ + 224, + 225 + ], + [ + 226, + 229 + ], + [ + 230, + 232 + ], + [ + 233, + 234 + ], + [ + 235, + 239 + ], + [ + 240, + 246 + ], + [ + 247, + 248 + ], + [ + 252, + 255 + ], + [ + 257, + 260 + ], + [ + 261, + 262 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 268, + 272 + ], + [ + 273, + 280 + ], + [ + 281, + 288 + ], + [ + 289, + 290 + ], + [ + 291, + 293 + ], + [ + 294, + 295 + ], + [ + 296, + 299 + ], + [ + 301, + 303 + ], + [ + 305, + 307 + ], + [ + 308, + 310 + ], + [ + 312, + 323 + ], + [ + 324, + 325 + ], + [ + 327, + 341 + ], + [ + 342, + 357 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_csv2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 48, + 55 + ], + [ + 65, + 98 + ], + [ + 102, + 115 + ], + [ + 116, + 124 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 51, + 52 + ], + [ + 68, + 69 + ], + [ + 70, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 79 + ], + [ + 81, + 91 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 105, + 106 + ], + [ + 111, + 112 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_debugim.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 24, + 52 + ], + [ + 59, + 160 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 27, + 28 + ], + [ + 29, + 33 + ], + [ + 34, + 43 + ], + [ + 48, + 49 + ], + [ + 62, + 64 + ], + [ + 65, + 71 + ], + [ + 75, + 77 + ], + [ + 78, + 83 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 90, + 92 + ], + [ + 93, + 98 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 105, + 107 + ], + [ + 108, + 114 + ], + [ + 116, + 117 + ], + [ + 120, + 159 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_dif_std.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 48, + 95 + ], + [ + 96, + 140 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 51, + 54 + ], + [ + 57, + 58 + ], + [ + 62, + 64 + ], + [ + 65, + 67 + ], + [ + 69, + 73 + ], + [ + 74, + 75 + ], + [ + 77, + 78 + ], + [ + 80, + 83 + ], + [ + 87, + 88 + ], + [ + 90, + 92 + ], + [ + 99, + 101 + ], + [ + 102, + 110 + ], + [ + 112, + 119 + ], + [ + 121, + 122 + ], + [ + 124, + 126 + ], + [ + 128, + 129 + ], + [ + 130, + 134 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_exr2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 53, + 94 + ], + [ + 96, + 109 + ], + [ + 111, + 119 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 56, + 57 + ], + [ + 59, + 60 + ], + [ + 61, + 63 + ], + [ + 64, + 65 + ], + [ + 71, + 72 + ], + [ + 76, + 77 + ], + [ + 78, + 80 + ], + [ + 83, + 84 + ], + [ + 88, + 89 + ], + [ + 90, + 91 + ], + [ + 99, + 100 + ], + [ + 105, + 106 + ], + [ + 114, + 115 + ], + [ + 118, + 119 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_fav4.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 32 + ], + [ + 48, + 98 + ] + ], + "lines_added": [ + [ + 7, + 23 + ], + [ + 28, + 29 + ], + [ + 51, + 52 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 59, + 60 + ], + [ + 62, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 97 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_freq_mask.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 39 + ], + [ + 51, + 240 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 30 + ], + [ + 35, + 36 + ], + [ + 54, + 56 + ], + [ + 60, + 65 + ], + [ + 68, + 69 + ], + [ + 70, + 73 + ], + [ + 76, + 80 + ], + [ + 83, + 86 + ], + [ + 89, + 93 + ], + [ + 96, + 99 + ], + [ + 102, + 106 + ], + [ + 109, + 112 + ], + [ + 115, + 119 + ], + [ + 122, + 125 + ], + [ + 128, + 132 + ], + [ + 135, + 138 + ], + [ + 141, + 145 + ], + [ + 148, + 151 + ], + [ + 154, + 157 + ], + [ + 160, + 164 + ], + [ + 167, + 170 + ], + [ + 173, + 177 + ], + [ + 180, + 183 + ], + [ + 186, + 190 + ], + [ + 193, + 195 + ], + [ + 197, + 200 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 206, + 208 + ], + [ + 209, + 210 + ], + [ + 212, + 214 + ], + [ + 217, + 221 + ], + [ + 222, + 224 + ], + [ + 225, + 226 + ], + [ + 229, + 230 + ], + [ + 233, + 237 + ], + [ + 238, + 239 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_gadd.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 17, + 50 + ], + [ + 70, + 130 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 7, + 8 + ], + [ + 20, + 21 + ], + [ + 25, + 26 + ], + [ + 27, + 31 + ], + [ + 32, + 41 + ], + [ + 46, + 47 + ], + [ + 73, + 75 + ], + [ + 80, + 114 + ], + [ + 115, + 116 + ], + [ + 118, + 121 + ], + [ + 123, + 127 + ], + [ + 128, + 129 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_gaddim.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 12 + ], + [ + 23, + 51 + ], + [ + 64, + 311 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 8, + 9 + ], + [ + 26, + 27 + ], + [ + 28, + 32 + ], + [ + 33, + 42 + ], + [ + 47, + 48 + ], + [ + 67, + 95 + ], + [ + 96, + 113 + ], + [ + 115, + 148 + ], + [ + 155, + 157 + ], + [ + 159, + 160 + ], + [ + 165, + 166 + ], + [ + 167, + 230 + ], + [ + 232, + 237 + ], + [ + 239, + 243 + ], + [ + 244, + 253 + ], + [ + 254, + 255 + ], + [ + 257, + 270 + ], + [ + 273, + 283 + ], + [ + 284, + 285 + ], + [ + 286, + 294 + ], + [ + 295, + 306 + ], + [ + 307, + 308 + ], + [ + 309, + 310 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_gfadd.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 24 + ], + [ + 26, + 54 + ], + [ + 65, + 467 + ] + ], + "lines_added": [ + [ + 20, + 21 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 68, + 87 + ], + [ + 89, + 186 + ], + [ + 192, + 194 + ], + [ + 200, + 278 + ], + [ + 279, + 284 + ], + [ + 285, + 318 + ], + [ + 321, + 353 + ], + [ + 354, + 356 + ], + [ + 358, + 374 + ], + [ + 376, + 382 + ], + [ + 383, + 385 + ], + [ + 387, + 393 + ], + [ + 394, + 396 + ], + [ + 398, + 404 + ], + [ + 405, + 407 + ], + [ + 409, + 415 + ], + [ + 416, + 418 + ], + [ + 420, + 424 + ], + [ + 425, + 426 + ], + [ + 427, + 447 + ], + [ + 450, + 453 + ], + [ + 455, + 464 + ], + [ + 465, + 466 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_gradcor.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 42 + ], + [ + 46, + 79 + ], + [ + 80, + 123 + ], + [ + 132, + 145 + ], + [ + 146, + 170 + ], + [ + 186, + 234 + ], + [ + 235, + 251 + ], + [ + 264, + 313 + ], + [ + 314, + 585 + ] + ], + "lines_added": [ + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 35, + 36 + ], + [ + 50, + 76 + ], + [ + 83, + 86 + ], + [ + 88, + 120 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 149, + 151 + ], + [ + 153, + 154 + ], + [ + 155, + 162 + ], + [ + 166, + 167 + ], + [ + 189, + 192 + ], + [ + 194, + 196 + ], + [ + 197, + 203 + ], + [ + 204, + 206 + ], + [ + 207, + 209 + ], + [ + 210, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 216 + ], + [ + 217, + 219 + ], + [ + 220, + 222 + ], + [ + 223, + 225 + ], + [ + 226, + 228 + ], + [ + 229, + 231 + ], + [ + 238, + 241 + ], + [ + 242, + 245 + ], + [ + 267, + 270 + ], + [ + 272, + 274 + ], + [ + 275, + 279 + ], + [ + 280, + 282 + ], + [ + 283, + 285 + ], + [ + 286, + 288 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 293, + 295 + ], + [ + 296, + 298 + ], + [ + 299, + 301 + ], + [ + 302, + 304 + ], + [ + 305, + 307 + ], + [ + 308, + 310 + ], + [ + 317, + 320 + ], + [ + 321, + 324 + ], + [ + 327, + 330 + ], + [ + 331, + 346 + ], + [ + 348, + 351 + ], + [ + 352, + 363 + ], + [ + 365, + 368 + ], + [ + 369, + 501 + ], + [ + 503, + 582 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_jpeg2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 52, + 59 + ], + [ + 68, + 94 + ], + [ + 96, + 182 + ], + [ + 186, + 199 + ], + [ + 202, + 210 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 55, + 56 + ], + [ + 71, + 72 + ], + [ + 75, + 83 + ], + [ + 85, + 87 + ], + [ + 89, + 91 + ], + [ + 99, + 100 + ], + [ + 106, + 107 + ], + [ + 108, + 111 + ], + [ + 114, + 125 + ], + [ + 127, + 129 + ], + [ + 130, + 131 + ], + [ + 133, + 134 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 151, + 152 + ], + [ + 155, + 156 + ], + [ + 159, + 164 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 189, + 190 + ], + [ + 195, + 196 + ], + [ + 205, + 206 + ], + [ + 209, + 210 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_lab_morph.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 49, + 78 + ], + [ + 82, + 92 + ], + [ + 96, + 123 + ], + [ + 128, + 140 + ], + [ + 142, + 154 + ], + [ + 156, + 198 + ], + [ + 208, + 215 + ], + [ + 247, + 255 + ], + [ + 258, + 265 + ], + [ + 266, + 273 + ], + [ + 277, + 310 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 52, + 53 + ], + [ + 54, + 55 + ], + [ + 58, + 63 + ], + [ + 64, + 66 + ], + [ + 68, + 71 + ], + [ + 72, + 73 + ], + [ + 85, + 86 + ], + [ + 87, + 89 + ], + [ + 99, + 103 + ], + [ + 104, + 114 + ], + [ + 119, + 120 + ], + [ + 131, + 135 + ], + [ + 136, + 137 + ], + [ + 145, + 149 + ], + [ + 150, + 151 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 165, + 166 + ], + [ + 169, + 170 + ], + [ + 173, + 195 + ], + [ + 211, + 212 + ], + [ + 250, + 252 + ], + [ + 261, + 262 + ], + [ + 269, + 270 + ], + [ + 280, + 284 + ], + [ + 287, + 290 + ], + [ + 292, + 298 + ], + [ + 299, + 300 + ], + [ + 302, + 306 + ], + [ + 307, + 309 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_line.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 45 + ], + [ + 54, + 153 + ] + ], + "lines_added": [ + [ + 20, + 36 + ], + [ + 41, + 42 + ], + [ + 57, + 59 + ], + [ + 60, + 61 + ], + [ + 63, + 104 + ], + [ + 105, + 109 + ], + [ + 111, + 118 + ], + [ + 119, + 123 + ], + [ + 125, + 134 + ], + [ + 136, + 145 + ], + [ + 147, + 152 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_linreg.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 45 + ], + [ + 51, + 435 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 28 + ], + [ + 29, + 33 + ], + [ + 38, + 39 + ], + [ + 54, + 60 + ], + [ + 63, + 133 + ], + [ + 138, + 139 + ], + [ + 143, + 146 + ], + [ + 147, + 238 + ], + [ + 241, + 245 + ], + [ + 246, + 247 + ], + [ + 248, + 250 + ], + [ + 251, + 252 + ], + [ + 253, + 255 + ], + [ + 256, + 259 + ], + [ + 260, + 266 + ], + [ + 267, + 272 + ], + [ + 273, + 274 + ], + [ + 276, + 435 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_litecor.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 9, + 16 + ], + [ + 32, + 60 + ], + [ + 73, + 82 + ], + [ + 86, + 142 + ], + [ + 144, + 212 + ], + [ + 217, + 281 + ], + [ + 283, + 314 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 12, + 13 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 76, + 79 + ], + [ + 89, + 90 + ], + [ + 91, + 94 + ], + [ + 96, + 97 + ], + [ + 98, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 108 + ], + [ + 109, + 110 + ], + [ + 111, + 113 + ], + [ + 118, + 119 + ], + [ + 123, + 124 + ], + [ + 126, + 127 + ], + [ + 128, + 132 + ], + [ + 136, + 139 + ], + [ + 147, + 150 + ], + [ + 151, + 153 + ], + [ + 156, + 159 + ], + [ + 162, + 165 + ], + [ + 166, + 168 + ], + [ + 169, + 170 + ], + [ + 172, + 176 + ], + [ + 177, + 179 + ], + [ + 182, + 185 + ], + [ + 188, + 191 + ], + [ + 192, + 194 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 206, + 209 + ], + [ + 220, + 221 + ], + [ + 222, + 225 + ], + [ + 227, + 228 + ], + [ + 229, + 231 + ], + [ + 233, + 234 + ], + [ + 235, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 244 + ], + [ + 245, + 246 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 253, + 258 + ], + [ + 264, + 267 + ], + [ + 270, + 272 + ], + [ + 274, + 276 + ], + [ + 277, + 278 + ], + [ + 286, + 295 + ], + [ + 296, + 300 + ], + [ + 302, + 303 + ], + [ + 304, + 308 + ], + [ + 310, + 312 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_magick2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 46, + 70 + ], + [ + 74, + 87 + ], + [ + 93, + 121 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 49, + 50 + ], + [ + 54, + 55 + ], + [ + 56, + 58 + ], + [ + 59, + 60 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 77, + 78 + ], + [ + 83, + 84 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 111, + 116 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_mask2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 59, + 122 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 62, + 63 + ], + [ + 69, + 73 + ], + [ + 77, + 85 + ], + [ + 88, + 90 + ], + [ + 93, + 94 + ], + [ + 96, + 97 + ], + [ + 99, + 101 + ], + [ + 103, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 115, + 119 + ], + [ + 120, + 121 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_matcat.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 58, + 65 + ], + [ + 66, + 76 + ], + [ + 77, + 93 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 61, + 62 + ], + [ + 69, + 73 + ], + [ + 80, + 82 + ], + [ + 85, + 87 + ], + [ + 88, + 90 + ], + [ + 91, + 92 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_matinv.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 44 + ], + [ + 54, + 76 + ], + [ + 81, + 98 + ], + [ + 100, + 218 + ], + [ + 230, + 237 + ], + [ + 238, + 280 + ], + [ + 286, + 293 + ], + [ + 295, + 337 + ], + [ + 339, + 346 + ], + [ + 348, + 388 + ], + [ + 389, + 518 + ] + ], + "lines_added": [ + [ + 19, + 35 + ], + [ + 40, + 41 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 65, + 67 + ], + [ + 68, + 73 + ], + [ + 84, + 86 + ], + [ + 87, + 88 + ], + [ + 94, + 95 + ], + [ + 103, + 107 + ], + [ + 109, + 215 + ], + [ + 233, + 234 + ], + [ + 241, + 246 + ], + [ + 247, + 277 + ], + [ + 289, + 290 + ], + [ + 298, + 302 + ], + [ + 304, + 334 + ], + [ + 342, + 343 + ], + [ + 351, + 354 + ], + [ + 355, + 385 + ], + [ + 392, + 397 + ], + [ + 398, + 401 + ], + [ + 402, + 404 + ], + [ + 405, + 406 + ], + [ + 407, + 410 + ], + [ + 411, + 412 + ], + [ + 413, + 414 + ], + [ + 418, + 423 + ], + [ + 424, + 426 + ], + [ + 427, + 429 + ], + [ + 430, + 431 + ], + [ + 432, + 434 + ], + [ + 435, + 436 + ], + [ + 437, + 438 + ], + [ + 439, + 443 + ], + [ + 444, + 448 + ], + [ + 453, + 513 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_matmul.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 45, + 52 + ], + [ + 59, + 67 + ], + [ + 69, + 101 + ], + [ + 106, + 111 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 48, + 49 + ], + [ + 62, + 64 + ], + [ + 72, + 75 + ], + [ + 79, + 81 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 97, + 98 + ], + [ + 109, + 110 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_mattrn.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 43, + 50 + ], + [ + 54, + 70 + ], + [ + 72, + 82 + ], + [ + 83, + 88 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 46, + 47 + ], + [ + 57, + 59 + ], + [ + 65, + 67 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 86, + 87 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_maxpos_avg.c", + "line_filter": { + "diff_chunks": [ + [ + 23, + 51 + ], + [ + 80, + 218 + ], + [ + 223, + 278 + ], + [ + 279, + 286 + ], + [ + 287, + 329 + ] + ], + "lines_added": [ + [ + 26, + 42 + ], + [ + 47, + 48 + ], + [ + 83, + 84 + ], + [ + 88, + 90 + ], + [ + 92, + 93 + ], + [ + 98, + 99 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 109, + 110 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 122, + 143 + ], + [ + 144, + 147 + ], + [ + 150, + 173 + ], + [ + 174, + 177 + ], + [ + 180, + 205 + ], + [ + 206, + 207 + ], + [ + 211, + 212 + ], + [ + 214, + 215 + ], + [ + 226, + 263 + ], + [ + 264, + 265 + ], + [ + 271, + 272 + ], + [ + 274, + 275 + ], + [ + 282, + 283 + ], + [ + 290, + 291 + ], + [ + 294, + 297 + ], + [ + 298, + 300 + ], + [ + 302, + 305 + ], + [ + 306, + 307 + ], + [ + 310, + 311 + ], + [ + 314, + 316 + ], + [ + 317, + 319 + ], + [ + 320, + 322 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_maxpos_subpel.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 44, + 58 + ], + [ + 88, + 170 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 29 + ], + [ + 34, + 35 + ], + [ + 47, + 49 + ], + [ + 53, + 55 + ], + [ + 91, + 94 + ], + [ + 96, + 169 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_measure.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 26, + 54 + ], + [ + 65, + 75 + ], + [ + 88, + 107 + ], + [ + 110, + 131 + ], + [ + 132, + 143 + ], + [ + 144, + 237 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 68, + 72 + ], + [ + 91, + 92 + ], + [ + 94, + 99 + ], + [ + 103, + 104 + ], + [ + 113, + 114 + ], + [ + 116, + 119 + ], + [ + 121, + 126 + ], + [ + 127, + 128 + ], + [ + 135, + 140 + ], + [ + 147, + 148 + ], + [ + 151, + 156 + ], + [ + 158, + 161 + ], + [ + 164, + 165 + ], + [ + 168, + 171 + ], + [ + 176, + 178 + ], + [ + 181, + 185 + ], + [ + 187, + 188 + ], + [ + 191, + 195 + ], + [ + 201, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 215 + ], + [ + 217, + 220 + ], + [ + 221, + 231 + ], + [ + 232, + 233 + ], + [ + 234, + 235 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_nifti2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 101 + ], + [ + 103, + 116 + ], + [ + 119, + 127 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 58, + 63 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 69, + 75 + ], + [ + 78, + 79 + ], + [ + 83, + 84 + ], + [ + 85, + 87 + ], + [ + 90, + 91 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 106, + 107 + ], + [ + 112, + 113 + ], + [ + 122, + 123 + ], + [ + 126, + 127 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_openslide2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 55, + 62 + ], + [ + 65, + 132 + ], + [ + 134, + 147 + ], + [ + 150, + 158 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 58, + 59 + ], + [ + 68, + 69 + ], + [ + 72, + 78 + ], + [ + 80, + 81 + ], + [ + 83, + 91 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 97, + 105 + ], + [ + 109, + 110 + ], + [ + 114, + 115 + ], + [ + 116, + 118 + ], + [ + 121, + 122 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 137, + 138 + ], + [ + 143, + 144 + ], + [ + 153, + 154 + ], + [ + 157, + 158 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_png2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 49, + 78 + ], + [ + 80, + 93 + ], + [ + 95, + 103 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 52, + 53 + ], + [ + 58, + 59 + ], + [ + 60, + 65 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 83, + 84 + ], + [ + 89, + 90 + ], + [ + 98, + 99 + ], + [ + 102, + 103 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_point_bilinear.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 63, + 100 + ], + [ + 105, + 120 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 31 + ], + [ + 36, + 37 + ], + [ + 66, + 69 + ], + [ + 73, + 79 + ], + [ + 81, + 86 + ], + [ + 88, + 93 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 108, + 109 + ], + [ + 114, + 116 + ], + [ + 117, + 119 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_ppm2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 40, + 72 + ], + [ + 76, + 89 + ], + [ + 92, + 100 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 43, + 44 + ], + [ + 47, + 52 + ], + [ + 53, + 54 + ], + [ + 55, + 56 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 67, + 69 + ], + [ + 79, + 80 + ], + [ + 85, + 86 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_print.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 42, + 51 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 45, + 46 + ], + [ + 47, + 48 + ], + [ + 49, + 50 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_printlines.c", + "line_filter": { + "diff_chunks": [ + [ + 21, + 49 + ], + [ + 56, + 172 + ] + ], + "lines_added": [ + [ + 24, + 40 + ], + [ + 45, + 46 + ], + [ + 59, + 60 + ], + [ + 62, + 95 + ], + [ + 96, + 101 + ], + [ + 102, + 105 + ], + [ + 109, + 111 + ], + [ + 112, + 114 + ], + [ + 115, + 116 + ], + [ + 117, + 119 + ], + [ + 123, + 124 + ], + [ + 126, + 128 + ], + [ + 129, + 131 + ], + [ + 132, + 133 + ], + [ + 134, + 136 + ], + [ + 140, + 141 + ], + [ + 143, + 145 + ], + [ + 146, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 154 + ], + [ + 155, + 156 + ], + [ + 158, + 159 + ], + [ + 160, + 162 + ], + [ + 163, + 168 + ], + [ + 170, + 171 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_resize_linear.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 41 + ], + [ + 52, + 206 + ] + ], + "lines_added": [ + [ + 16, + 32 + ], + [ + 37, + 38 + ], + [ + 55, + 59 + ], + [ + 64, + 68 + ], + [ + 71, + 73 + ], + [ + 76, + 79 + ], + [ + 82, + 84 + ], + [ + 87, + 90 + ], + [ + 93, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 104, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 113 + ], + [ + 114, + 116 + ], + [ + 117, + 119 + ], + [ + 120, + 125 + ], + [ + 126, + 129 + ], + [ + 130, + 132 + ], + [ + 136, + 203 + ], + [ + 204, + 205 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_setbox.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 43 + ], + [ + 50, + 58 + ] + ], + "lines_added": [ + [ + 18, + 34 + ], + [ + 39, + 40 + ], + [ + 53, + 55 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_simcontr.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 63, + 138 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 66, + 68 + ], + [ + 72, + 90 + ], + [ + 92, + 94 + ], + [ + 95, + 98 + ], + [ + 99, + 101 + ], + [ + 102, + 118 + ], + [ + 119, + 125 + ], + [ + 126, + 132 + ], + [ + 133, + 137 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_slice.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 48 + ], + [ + 61, + 170 + ] + ], + "lines_added": [ + [ + 18, + 19 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 64, + 65 + ], + [ + 67, + 88 + ], + [ + 91, + 92 + ], + [ + 94, + 95 + ], + [ + 96, + 98 + ], + [ + 100, + 115 + ], + [ + 116, + 130 + ], + [ + 131, + 134 + ], + [ + 136, + 150 + ], + [ + 151, + 157 + ], + [ + 159, + 162 + ], + [ + 164, + 166 + ], + [ + 168, + 169 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_spatres.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 45 + ], + [ + 54, + 148 + ] + ], + "lines_added": [ + [ + 20, + 36 + ], + [ + 41, + 42 + ], + [ + 57, + 59 + ], + [ + 60, + 62 + ], + [ + 68, + 73 + ], + [ + 74, + 78 + ], + [ + 80, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 105 + ], + [ + 107, + 110 + ], + [ + 114, + 115 + ], + [ + 117, + 118 + ], + [ + 120, + 121 + ], + [ + 123, + 125 + ], + [ + 128, + 130 + ], + [ + 131, + 133 + ], + [ + 134, + 135 + ], + [ + 137, + 147 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_stretch3.c", + "line_filter": { + "diff_chunks": [ + [ + 27, + 55 + ], + [ + 70, + 78 + ], + [ + 84, + 127 + ], + [ + 128, + 148 + ], + [ + 149, + 156 + ], + [ + 164, + 172 + ], + [ + 175, + 202 + ], + [ + 203, + 296 + ], + [ + 299, + 317 + ], + [ + 318, + 327 + ] + ], + "lines_added": [ + [ + 30, + 46 + ], + [ + 51, + 52 + ], + [ + 73, + 75 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 97, + 98 + ], + [ + 103, + 105 + ], + [ + 106, + 110 + ], + [ + 111, + 114 + ], + [ + 116, + 117 + ], + [ + 122, + 124 + ], + [ + 131, + 134 + ], + [ + 135, + 136 + ], + [ + 141, + 145 + ], + [ + 152, + 153 + ], + [ + 167, + 169 + ], + [ + 178, + 187 + ], + [ + 193, + 195 + ], + [ + 198, + 199 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 214, + 217 + ], + [ + 219, + 223 + ], + [ + 224, + 225 + ], + [ + 231, + 232 + ], + [ + 234, + 236 + ], + [ + 239, + 241 + ], + [ + 244, + 246 + ], + [ + 249, + 250 + ], + [ + 253, + 255 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 265, + 267 + ], + [ + 268, + 277 + ], + [ + 278, + 280 + ], + [ + 281, + 282 + ], + [ + 283, + 287 + ], + [ + 288, + 290 + ], + [ + 291, + 293 + ], + [ + 302, + 314 + ], + [ + 321, + 324 + ], + [ + 325, + 326 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_thresh.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 45 + ], + [ + 57, + 148 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 20, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 36 + ], + [ + 41, + 42 + ], + [ + 60, + 84 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 92, + 101 + ], + [ + 103, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 111 + ], + [ + 112, + 115 + ], + [ + 117, + 135 + ], + [ + 137, + 140 + ], + [ + 142, + 144 + ], + [ + 146, + 147 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_tiff2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 39 + ], + [ + 54, + 112 + ], + [ + 114, + 134 + ], + [ + 138, + 205 + ], + [ + 207, + 220 + ], + [ + 224, + 232 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 35, + 36 + ], + [ + 57, + 58 + ], + [ + 62, + 66 + ], + [ + 67, + 68 + ], + [ + 71, + 73 + ], + [ + 76, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 89, + 91 + ], + [ + 94, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 108, + 109 + ], + [ + 117, + 118 + ], + [ + 122, + 124 + ], + [ + 125, + 127 + ], + [ + 130, + 131 + ], + [ + 141, + 142 + ], + [ + 143, + 147 + ], + [ + 149, + 152 + ], + [ + 154, + 156 + ], + [ + 158, + 160 + ], + [ + 161, + 162 + ], + [ + 164, + 165 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 187, + 188 + ], + [ + 189, + 191 + ], + [ + 194, + 195 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 210, + 211 + ], + [ + 216, + 217 + ], + [ + 227, + 228 + ], + [ + 231, + 232 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_video_test.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 47, + 59 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 50, + 51 + ], + [ + 52, + 55 + ], + [ + 57, + 58 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2csv.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 39, + 47 + ], + [ + 50, + 65 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 44 + ], + [ + 53, + 54 + ], + [ + 55, + 57 + ], + [ + 60, + 62 + ], + [ + 63, + 64 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2dz.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 48, + 55 + ], + [ + 56, + 69 + ], + [ + 70, + 130 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 51, + 52 + ], + [ + 59, + 60 + ], + [ + 63, + 64 + ], + [ + 65, + 66 + ], + [ + 73, + 75 + ], + [ + 76, + 77 + ], + [ + 78, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 88 + ], + [ + 91, + 102 + ], + [ + 105, + 107 + ], + [ + 110, + 114 + ], + [ + 117, + 129 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2jpeg.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 50, + 59 + ], + [ + 67, + 113 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 53, + 54 + ], + [ + 55, + 56 + ], + [ + 70, + 72 + ], + [ + 73, + 76 + ], + [ + 77, + 79 + ], + [ + 81, + 85 + ], + [ + 87, + 89 + ], + [ + 92, + 93 + ], + [ + 96, + 101 + ], + [ + 102, + 103 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2mask.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 14 + ], + [ + 15, + 43 + ], + [ + 53, + 60 + ], + [ + 69, + 146 + ], + [ + 151, + 199 + ], + [ + 205, + 247 + ] + ], + "lines_added": [ + [ + 10, + 11 + ], + [ + 18, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 34 + ], + [ + 39, + 40 + ], + [ + 56, + 57 + ], + [ + 72, + 73 + ], + [ + 79, + 80 + ], + [ + 82, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 96, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 108, + 109 + ], + [ + 113, + 116 + ], + [ + 118, + 121 + ], + [ + 126, + 128 + ], + [ + 132, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 154, + 155 + ], + [ + 157, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 171, + 174 + ], + [ + 175, + 176 + ], + [ + 179, + 180 + ], + [ + 183, + 184 + ], + [ + 188, + 191 + ], + [ + 194, + 196 + ], + [ + 208, + 210 + ], + [ + 211, + 212 + ], + [ + 213, + 217 + ], + [ + 220, + 221 + ], + [ + 223, + 224 + ], + [ + 225, + 227 + ], + [ + 228, + 229 + ], + [ + 234, + 236 + ], + [ + 239, + 240 + ], + [ + 241, + 243 + ], + [ + 245, + 246 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2png.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 50, + 60 + ], + [ + 63, + 96 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 53, + 54 + ], + [ + 55, + 57 + ], + [ + 66, + 68 + ], + [ + 71, + 75 + ], + [ + 76, + 78 + ], + [ + 81, + 83 + ], + [ + 84, + 89 + ], + [ + 90, + 93 + ], + [ + 94, + 95 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2ppm.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 42, + 49 + ], + [ + 54, + 73 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 45, + 46 + ], + [ + 57, + 60 + ], + [ + 61, + 62 + ], + [ + 64, + 68 + ], + [ + 71, + 72 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2tiff.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 48, + 208 + ], + [ + 211, + 252 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 51, + 52 + ], + [ + 58, + 59 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 68, + 69 + ], + [ + 73, + 75 + ], + [ + 76, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 86, + 87 + ], + [ + 89, + 94 + ], + [ + 98, + 99 + ], + [ + 101, + 102 + ], + [ + 104, + 109 + ], + [ + 113, + 114 + ], + [ + 116, + 122 + ], + [ + 125, + 131 + ], + [ + 134, + 136 + ], + [ + 138, + 144 + ], + [ + 147, + 148 + ], + [ + 150, + 155 + ], + [ + 158, + 160 + ], + [ + 161, + 162 + ], + [ + 164, + 169 + ], + [ + 172, + 174 + ], + [ + 175, + 176 + ], + [ + 178, + 183 + ], + [ + 186, + 188 + ], + [ + 189, + 190 + ], + [ + 192, + 197 + ], + [ + 199, + 205 + ], + [ + 214, + 215 + ], + [ + 221, + 223 + ], + [ + 224, + 225 + ], + [ + 227, + 231 + ], + [ + 233, + 251 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2webp.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 28 + ], + [ + 44, + 54 + ], + [ + 55, + 71 + ] + ], + "lines_added": [ + [ + 3, + 19 + ], + [ + 24, + 25 + ], + [ + 47, + 48 + ], + [ + 49, + 51 + ], + [ + 58, + 60 + ], + [ + 63, + 67 + ], + [ + 68, + 70 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_webp2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 28 + ], + [ + 43, + 113 + ], + [ + 115, + 128 + ], + [ + 131, + 141 + ] + ], + "lines_added": [ + [ + 3, + 19 + ], + [ + 24, + 25 + ], + [ + 46, + 47 + ], + [ + 51, + 52 + ], + [ + 54, + 69 + ], + [ + 70, + 72 + ], + [ + 73, + 74 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 87, + 92 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 107, + 108 + ], + [ + 109, + 110 + ], + [ + 118, + 119 + ], + [ + 124, + 125 + ], + [ + 134, + 135 + ], + [ + 138, + 139 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_zerox.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 17, + 45 + ], + [ + 53, + 132 + ], + [ + 133, + 196 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 20, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 36 + ], + [ + 41, + 42 + ], + [ + 56, + 70 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 92, + 93 + ], + [ + 98, + 121 + ], + [ + 123, + 124 + ], + [ + 127, + 129 + ], + [ + 136, + 137 + ], + [ + 141, + 142 + ], + [ + 148, + 150 + ], + [ + 153, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 167 + ], + [ + 169, + 170 + ], + [ + 173, + 175 + ], + [ + 180, + 182 + ], + [ + 185, + 188 + ], + [ + 191, + 193 + ], + [ + 194, + 195 + ] + ] + } + }, + { + "filename": "libvips/deprecated/inplace_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 44, + 209 + ], + [ + 212, + 249 + ], + [ + 251, + 288 + ], + [ + 290, + 328 + ], + [ + 329, + 362 + ], + [ + 364, + 401 + ], + [ + 403, + 444 + ], + [ + 448, + 486 + ], + [ + 487, + 523 + ], + [ + 528, + 567 + ], + [ + 571, + 593 + ], + [ + 610, + 616 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 47, + 48 + ], + [ + 53, + 59 + ], + [ + 61, + 65 + ], + [ + 66, + 67 + ], + [ + 70, + 71 + ], + [ + 75, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 110 + ], + [ + 112, + 113 + ], + [ + 115, + 116 + ], + [ + 121, + 125 + ], + [ + 130, + 131 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 147 + ], + [ + 152, + 160 + ], + [ + 165, + 166 + ], + [ + 172, + 175 + ], + [ + 177, + 179 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 186, + 190 + ], + [ + 195, + 200 + ], + [ + 205, + 206 + ], + [ + 215, + 218 + ], + [ + 219, + 220 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 231 + ], + [ + 236, + 240 + ], + [ + 245, + 246 + ], + [ + 254, + 257 + ], + [ + 258, + 259 + ], + [ + 262, + 263 + ], + [ + 264, + 265 + ], + [ + 266, + 270 + ], + [ + 275, + 279 + ], + [ + 284, + 285 + ], + [ + 293, + 296 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 305, + 309 + ], + [ + 314, + 319 + ], + [ + 324, + 325 + ], + [ + 332, + 333 + ], + [ + 336, + 337 + ], + [ + 338, + 339 + ], + [ + 340, + 344 + ], + [ + 349, + 353 + ], + [ + 358, + 359 + ], + [ + 367, + 370 + ], + [ + 371, + 372 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 379, + 383 + ], + [ + 388, + 392 + ], + [ + 397, + 398 + ], + [ + 406, + 410 + ], + [ + 412, + 413 + ], + [ + 416, + 417 + ], + [ + 418, + 419 + ], + [ + 420, + 424 + ], + [ + 429, + 435 + ], + [ + 440, + 441 + ], + [ + 451, + 454 + ], + [ + 455, + 456 + ], + [ + 459, + 460 + ], + [ + 461, + 462 + ], + [ + 463, + 467 + ], + [ + 472, + 477 + ], + [ + 482, + 483 + ], + [ + 490, + 491 + ], + [ + 494, + 495 + ], + [ + 496, + 497 + ], + [ + 498, + 502 + ], + [ + 507, + 514 + ], + [ + 519, + 520 + ], + [ + 531, + 534 + ], + [ + 535, + 536 + ], + [ + 539, + 540 + ], + [ + 541, + 542 + ], + [ + 543, + 547 + ], + [ + 552, + 558 + ], + [ + 563, + 564 + ], + [ + 574, + 577 + ], + [ + 578, + 579 + ], + [ + 582, + 583 + ], + [ + 584, + 585 + ], + [ + 586, + 590 + ], + [ + 613, + 614 + ] + ] + } + }, + { + "filename": "libvips/deprecated/lazy.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 60 + ], + [ + 63, + 111 + ], + [ + 113, + 136 + ], + [ + 140, + 242 + ], + [ + 246, + 295 + ], + [ + 298, + 331 + ], + [ + 332, + 342 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 66, + 69 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 78, + 81 + ], + [ + 84, + 86 + ], + [ + 89, + 91 + ], + [ + 93, + 94 + ], + [ + 96, + 97 + ], + [ + 98, + 99 + ], + [ + 102, + 103 + ], + [ + 107, + 108 + ], + [ + 116, + 118 + ], + [ + 119, + 121 + ], + [ + 122, + 123 + ], + [ + 125, + 126 + ], + [ + 132, + 133 + ], + [ + 143, + 146 + ], + [ + 147, + 150 + ], + [ + 153, + 156 + ], + [ + 157, + 158 + ], + [ + 164, + 165 + ], + [ + 168, + 174 + ], + [ + 177, + 178 + ], + [ + 183, + 185 + ], + [ + 188, + 189 + ], + [ + 190, + 194 + ], + [ + 195, + 199 + ], + [ + 200, + 201 + ], + [ + 207, + 209 + ], + [ + 212, + 213 + ], + [ + 216, + 218 + ], + [ + 219, + 221 + ], + [ + 222, + 223 + ], + [ + 225, + 230 + ], + [ + 231, + 234 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 249, + 250 + ], + [ + 252, + 253 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 264, + 266 + ], + [ + 269, + 270 + ], + [ + 273, + 274 + ], + [ + 275, + 278 + ], + [ + 281, + 282 + ], + [ + 285, + 287 + ], + [ + 288, + 289 + ], + [ + 291, + 292 + ], + [ + 301, + 305 + ], + [ + 310, + 311 + ], + [ + 312, + 313 + ], + [ + 317, + 318 + ], + [ + 321, + 323 + ], + [ + 324, + 325 + ], + [ + 327, + 328 + ], + [ + 335, + 340 + ] + ] + } + }, + { + "filename": "libvips/deprecated/mask_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 574 + ], + [ + 579, + 589 + ], + [ + 598, + 604 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 48 + ], + [ + 53, + 56 + ], + [ + 61, + 62 + ], + [ + 66, + 69 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 78, + 82 + ], + [ + 87, + 88 + ], + [ + 92, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 108 + ], + [ + 113, + 114 + ], + [ + 119, + 122 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 131, + 135 + ], + [ + 140, + 141 + ], + [ + 146, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 158, + 162 + ], + [ + 167, + 169 + ], + [ + 174, + 175 + ], + [ + 178, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 189, + 193 + ], + [ + 198, + 201 + ], + [ + 206, + 207 + ], + [ + 212, + 217 + ], + [ + 220, + 221 + ], + [ + 222, + 223 + ], + [ + 224, + 228 + ], + [ + 233, + 234 + ], + [ + 239, + 244 + ], + [ + 247, + 248 + ], + [ + 249, + 250 + ], + [ + 251, + 255 + ], + [ + 260, + 263 + ], + [ + 268, + 269 + ], + [ + 274, + 279 + ], + [ + 282, + 283 + ], + [ + 284, + 285 + ], + [ + 286, + 290 + ], + [ + 295, + 296 + ], + [ + 301, + 306 + ], + [ + 309, + 310 + ], + [ + 311, + 312 + ], + [ + 313, + 317 + ], + [ + 322, + 325 + ], + [ + 330, + 331 + ], + [ + 336, + 339 + ], + [ + 340, + 341 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 348, + 352 + ], + [ + 357, + 360 + ], + [ + 365, + 366 + ], + [ + 371, + 374 + ], + [ + 375, + 376 + ], + [ + 379, + 380 + ], + [ + 381, + 382 + ], + [ + 383, + 387 + ], + [ + 390, + 392 + ], + [ + 395, + 397 + ], + [ + 402, + 403 + ], + [ + 407, + 409 + ], + [ + 410, + 411 + ], + [ + 414, + 415 + ], + [ + 416, + 417 + ], + [ + 418, + 422 + ], + [ + 427, + 428 + ], + [ + 432, + 434 + ], + [ + 435, + 436 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 443, + 447 + ], + [ + 452, + 453 + ], + [ + 457, + 459 + ], + [ + 460, + 461 + ], + [ + 464, + 465 + ], + [ + 466, + 467 + ], + [ + 468, + 472 + ], + [ + 477, + 478 + ], + [ + 482, + 484 + ], + [ + 485, + 486 + ], + [ + 489, + 490 + ], + [ + 491, + 492 + ], + [ + 493, + 497 + ], + [ + 500, + 501 + ], + [ + 502, + 504 + ], + [ + 507, + 508 + ], + [ + 509, + 511 + ], + [ + 514, + 515 + ], + [ + 516, + 518 + ], + [ + 521, + 522 + ], + [ + 523, + 525 + ], + [ + 528, + 530 + ], + [ + 533, + 535 + ], + [ + 538, + 544 + ], + [ + 547, + 553 + ], + [ + 556, + 562 + ], + [ + 565, + 571 + ], + [ + 582, + 586 + ], + [ + 601, + 602 + ] + ] + } + }, + { + "filename": "libvips/deprecated/matalloc.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 22 + ], + [ + 25, + 42 + ], + [ + 58, + 128 + ], + [ + 137, + 229 + ] + ], + "lines_added": [ + [ + 18, + 19 + ], + [ + 28, + 29 + ], + [ + 33, + 34 + ], + [ + 38, + 39 + ], + [ + 61, + 62 + ], + [ + 63, + 64 + ], + [ + 65, + 66 + ], + [ + 68, + 70 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 80, + 82 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 92, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 100 + ], + [ + 101, + 102 + ], + [ + 104, + 106 + ], + [ + 107, + 108 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 140, + 142 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 151, + 153 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 160, + 162 + ], + [ + 165, + 168 + ], + [ + 170, + 172 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 181, + 183 + ], + [ + 184, + 185 + ], + [ + 186, + 187 + ], + [ + 190, + 192 + ], + [ + 195, + 198 + ], + [ + 200, + 202 + ], + [ + 206, + 207 + ], + [ + 208, + 209 + ], + [ + 211, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 220, + 222 + ], + [ + 225, + 228 + ] + ] + } + }, + { + "filename": "libvips/deprecated/matlab.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 40, + 65 + ], + [ + 67, + 80 + ], + [ + 82, + 90 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 43, + 44 + ], + [ + 47, + 52 + ], + [ + 53, + 54 + ], + [ + 55, + 56 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 70, + 71 + ], + [ + 76, + 77 + ], + [ + 85, + 86 + ], + [ + 89, + 90 + ] + ] + } + }, + { + "filename": "libvips/deprecated/morph_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 292 + ], + [ + 306, + 312 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 49 + ], + [ + 54, + 55 + ], + [ + 58, + 59 + ], + [ + 62, + 63 + ], + [ + 64, + 70 + ], + [ + 75, + 78 + ], + [ + 83, + 84 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 99 + ], + [ + 104, + 105 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 116, + 120 + ], + [ + 125, + 128 + ], + [ + 133, + 134 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 150 + ], + [ + 155, + 160 + ], + [ + 165, + 166 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 183 + ], + [ + 188, + 191 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 208, + 212 + ], + [ + 215, + 217 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 228, + 234 + ], + [ + 237, + 240 + ], + [ + 243, + 244 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 254, + 258 + ], + [ + 263, + 266 + ], + [ + 271, + 272 + ], + [ + 277, + 278 + ], + [ + 281, + 282 + ], + [ + 283, + 284 + ], + [ + 285, + 289 + ], + [ + 309, + 310 + ] + ] + } + }, + { + "filename": "libvips/deprecated/mosaicing_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 45, + 118 + ], + [ + 122, + 139 + ], + [ + 146, + 193 + ], + [ + 205, + 249 + ], + [ + 253, + 270 + ], + [ + 277, + 295 + ], + [ + 307, + 374 + ], + [ + 379, + 428 + ], + [ + 433, + 486 + ], + [ + 490, + 534 + ], + [ + 540, + 583 + ], + [ + 588, + 732 + ], + [ + 737, + 744 + ], + [ + 749, + 755 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 48, + 54 + ], + [ + 59, + 71 + ], + [ + 76, + 88 + ], + [ + 93, + 109 + ], + [ + 114, + 115 + ], + [ + 125, + 128 + ], + [ + 129, + 130 + ], + [ + 135, + 136 + ], + [ + 149, + 153 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 160, + 166 + ], + [ + 169, + 184 + ], + [ + 189, + 190 + ], + [ + 208, + 213 + ], + [ + 214, + 216 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 223, + 229 + ], + [ + 232, + 233 + ], + [ + 234, + 240 + ], + [ + 245, + 246 + ], + [ + 256, + 259 + ], + [ + 260, + 261 + ], + [ + 266, + 267 + ], + [ + 280, + 284 + ], + [ + 285, + 286 + ], + [ + 291, + 292 + ], + [ + 310, + 315 + ], + [ + 316, + 318 + ], + [ + 319, + 320 + ], + [ + 323, + 324 + ], + [ + 325, + 331 + ], + [ + 334, + 335 + ], + [ + 336, + 342 + ], + [ + 345, + 346 + ], + [ + 347, + 353 + ], + [ + 358, + 359 + ], + [ + 364, + 365 + ], + [ + 370, + 371 + ], + [ + 382, + 385 + ], + [ + 388, + 389 + ], + [ + 390, + 396 + ], + [ + 399, + 400 + ], + [ + 401, + 407 + ], + [ + 412, + 413 + ], + [ + 418, + 419 + ], + [ + 424, + 425 + ], + [ + 436, + 439 + ], + [ + 442, + 443 + ], + [ + 444, + 450 + ], + [ + 453, + 454 + ], + [ + 455, + 461 + ], + [ + 466, + 477 + ], + [ + 482, + 483 + ], + [ + 493, + 496 + ], + [ + 499, + 500 + ], + [ + 501, + 502 + ], + [ + 503, + 507 + ], + [ + 512, + 525 + ], + [ + 530, + 531 + ], + [ + 543, + 545 + ], + [ + 546, + 547 + ], + [ + 550, + 551 + ], + [ + 552, + 553 + ], + [ + 554, + 558 + ], + [ + 563, + 574 + ], + [ + 579, + 580 + ], + [ + 591, + 593 + ], + [ + 596, + 597 + ], + [ + 598, + 599 + ], + [ + 600, + 604 + ], + [ + 609, + 612 + ], + [ + 617, + 618 + ], + [ + 621, + 622 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 630, + 633 + ], + [ + 638, + 639 + ], + [ + 642, + 643 + ], + [ + 646, + 647 + ], + [ + 648, + 649 + ], + [ + 651, + 654 + ], + [ + 659, + 663 + ], + [ + 668, + 669 + ], + [ + 670, + 671 + ], + [ + 674, + 675 + ], + [ + 676, + 677 + ], + [ + 678, + 682 + ], + [ + 684, + 688 + ], + [ + 690, + 693 + ], + [ + 695, + 702 + ], + [ + 704, + 708 + ], + [ + 710, + 714 + ], + [ + 716, + 723 + ], + [ + 728, + 729 + ], + [ + 740, + 741 + ], + [ + 752, + 753 + ] + ] + } + }, + { + "filename": "libvips/deprecated/other_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 344 + ], + [ + 360, + 366 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 51 + ], + [ + 56, + 57 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 71, + 75 + ], + [ + 80, + 84 + ], + [ + 89, + 90 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 107 + ], + [ + 112, + 113 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 126, + 130 + ], + [ + 135, + 137 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 154, + 158 + ], + [ + 163, + 164 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 175, + 179 + ], + [ + 184, + 186 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 197, + 198 + ], + [ + 199, + 200 + ], + [ + 201, + 205 + ], + [ + 210, + 212 + ], + [ + 217, + 218 + ], + [ + 219, + 220 + ], + [ + 221, + 223 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 232, + 238 + ], + [ + 243, + 246 + ], + [ + 251, + 252 + ], + [ + 255, + 256 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 263, + 267 + ], + [ + 272, + 275 + ], + [ + 280, + 281 + ], + [ + 285, + 286 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 293, + 297 + ], + [ + 302, + 303 + ], + [ + 307, + 308 + ], + [ + 311, + 312 + ], + [ + 313, + 314 + ], + [ + 315, + 319 + ], + [ + 324, + 325 + ], + [ + 329, + 330 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 337, + 341 + ], + [ + 363, + 364 + ] + ] + } + }, + { + "filename": "libvips/deprecated/package.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 84, + 541 + ], + [ + 542, + 568 + ], + [ + 588, + 595 + ], + [ + 618, + 627 + ], + [ + 630, + 734 + ], + [ + 735, + 812 + ], + [ + 813, + 1011 + ], + [ + 1013, + 1148 + ], + [ + 1154, + 1197 + ], + [ + 1198, + 1225 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 87, + 90 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 118 + ], + [ + 123, + 126 + ], + [ + 131, + 132 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 154 + ], + [ + 159, + 162 + ], + [ + 167, + 168 + ], + [ + 169, + 171 + ], + [ + 174, + 175 + ], + [ + 176, + 182 + ], + [ + 187, + 190 + ], + [ + 195, + 196 + ], + [ + 199, + 201 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 208, + 214 + ], + [ + 219, + 222 + ], + [ + 227, + 228 + ], + [ + 229, + 231 + ], + [ + 234, + 235 + ], + [ + 236, + 242 + ], + [ + 247, + 250 + ], + [ + 255, + 256 + ], + [ + 262, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 271 + ], + [ + 272, + 278 + ], + [ + 283, + 285 + ], + [ + 290, + 291 + ], + [ + 295, + 298 + ], + [ + 299, + 300 + ], + [ + 303, + 304 + ], + [ + 305, + 311 + ], + [ + 316, + 318 + ], + [ + 323, + 324 + ], + [ + 330, + 332 + ], + [ + 333, + 334 + ], + [ + 337, + 338 + ], + [ + 339, + 345 + ], + [ + 350, + 351 + ], + [ + 356, + 357 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 364, + 365 + ], + [ + 366, + 372 + ], + [ + 377, + 378 + ], + [ + 383, + 384 + ], + [ + 385, + 387 + ], + [ + 388, + 389 + ], + [ + 392, + 393 + ], + [ + 394, + 400 + ], + [ + 405, + 407 + ], + [ + 412, + 413 + ], + [ + 417, + 418 + ], + [ + 419, + 421 + ], + [ + 424, + 425 + ], + [ + 428, + 429 + ], + [ + 430, + 436 + ], + [ + 441, + 442 + ], + [ + 447, + 448 + ], + [ + 453, + 454 + ], + [ + 457, + 458 + ], + [ + 459, + 465 + ], + [ + 470, + 475 + ], + [ + 480, + 481 + ], + [ + 486, + 488 + ], + [ + 491, + 492 + ], + [ + 493, + 499 + ], + [ + 502, + 503 + ], + [ + 508, + 510 + ], + [ + 513, + 514 + ], + [ + 515, + 521 + ], + [ + 526, + 532 + ], + [ + 537, + 538 + ], + [ + 545, + 549 + ], + [ + 550, + 552 + ], + [ + 553, + 554 + ], + [ + 557, + 558 + ], + [ + 559, + 565 + ], + [ + 591, + 592 + ], + [ + 621, + 624 + ], + [ + 633, + 634 + ], + [ + 637, + 643 + ], + [ + 647, + 648 + ], + [ + 649, + 650 + ], + [ + 651, + 652 + ], + [ + 653, + 654 + ], + [ + 660, + 661 + ], + [ + 666, + 667 + ], + [ + 669, + 673 + ], + [ + 677, + 678 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 685, + 690 + ], + [ + 691, + 692 + ], + [ + 698, + 708 + ], + [ + 712, + 717 + ], + [ + 718, + 719 + ], + [ + 722, + 723 + ], + [ + 725, + 729 + ], + [ + 730, + 731 + ], + [ + 738, + 739 + ], + [ + 741, + 744 + ], + [ + 745, + 746 + ], + [ + 749, + 751 + ], + [ + 752, + 755 + ], + [ + 757, + 758 + ], + [ + 760, + 761 + ], + [ + 763, + 764 + ], + [ + 765, + 768 + ], + [ + 770, + 773 + ], + [ + 774, + 776 + ], + [ + 777, + 779 + ], + [ + 781, + 782 + ], + [ + 788, + 789 + ], + [ + 791, + 794 + ], + [ + 796, + 797 + ], + [ + 803, + 804 + ], + [ + 805, + 807 + ], + [ + 808, + 809 + ], + [ + 816, + 817 + ], + [ + 819, + 822 + ], + [ + 827, + 828 + ], + [ + 830, + 833 + ], + [ + 835, + 836 + ], + [ + 841, + 842 + ], + [ + 845, + 848 + ], + [ + 849, + 850 + ], + [ + 855, + 856 + ], + [ + 857, + 859 + ], + [ + 860, + 863 + ], + [ + 865, + 866 + ], + [ + 871, + 872 + ], + [ + 873, + 875 + ], + [ + 876, + 877 + ], + [ + 882, + 883 + ], + [ + 884, + 886 + ], + [ + 887, + 890 + ], + [ + 892, + 893 + ], + [ + 898, + 899 + ], + [ + 900, + 902 + ], + [ + 903, + 904 + ], + [ + 909, + 910 + ], + [ + 911, + 913 + ], + [ + 914, + 918 + ], + [ + 920, + 921 + ], + [ + 926, + 927 + ], + [ + 933, + 935 + ], + [ + 937, + 939 + ], + [ + 945, + 946 + ], + [ + 951, + 952 + ], + [ + 958, + 959 + ], + [ + 963, + 964 + ], + [ + 966, + 968 + ], + [ + 970, + 972 + ], + [ + 976, + 977 + ], + [ + 979, + 980 + ], + [ + 985, + 986 + ], + [ + 992, + 994 + ], + [ + 997, + 1000 + ], + [ + 1001, + 1002 + ], + [ + 1007, + 1008 + ], + [ + 1016, + 1017 + ], + [ + 1023, + 1028 + ], + [ + 1033, + 1035 + ], + [ + 1039, + 1041 + ], + [ + 1046, + 1049 + ], + [ + 1051, + 1052 + ], + [ + 1057, + 1058 + ], + [ + 1061, + 1066 + ], + [ + 1068, + 1069 + ], + [ + 1072, + 1073 + ], + [ + 1076, + 1077 + ], + [ + 1079, + 1083 + ], + [ + 1084, + 1085 + ], + [ + 1088, + 1092 + ], + [ + 1096, + 1097 + ], + [ + 1102, + 1103 + ], + [ + 1109, + 1113 + ], + [ + 1114, + 1115 + ], + [ + 1120, + 1121 + ], + [ + 1127, + 1132 + ], + [ + 1133, + 1134 + ], + [ + 1139, + 1140 + ], + [ + 1143, + 1145 + ], + [ + 1157, + 1158 + ], + [ + 1160, + 1161 + ], + [ + 1163, + 1167 + ], + [ + 1172, + 1174 + ], + [ + 1177, + 1179 + ], + [ + 1182, + 1184 + ], + [ + 1187, + 1188 + ], + [ + 1193, + 1194 + ], + [ + 1201, + 1203 + ], + [ + 1206, + 1208 + ], + [ + 1210, + 1215 + ], + [ + 1219, + 1222 + ], + [ + 1223, + 1224 + ] + ] + } + }, + { + "filename": "libvips/deprecated/radiance.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 40, + 71 + ], + [ + 73, + 86 + ], + [ + 88, + 96 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 43, + 44 + ], + [ + 47, + 52 + ], + [ + 53, + 54 + ], + [ + 55, + 56 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 76, + 77 + ], + [ + 82, + 83 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ] + ] + } + }, + { + "filename": "libvips/deprecated/raw.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 44, + 70 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 47, + 49 + ], + [ + 52, + 59 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ] + ] + } + }, + { + "filename": "libvips/deprecated/rename.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 41, + 422 + ], + [ + 426, + 433 + ], + [ + 436, + 456 + ], + [ + 457, + 575 + ], + [ + 579, + 653 + ], + [ + 672, + 727 + ], + [ + 729, + 802 + ], + [ + 805, + 822 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 44, + 46 + ], + [ + 47, + 48 + ], + [ + 50, + 52 + ], + [ + 53, + 54 + ], + [ + 56, + 58 + ], + [ + 59, + 60 + ], + [ + 62, + 64 + ], + [ + 65, + 66 + ], + [ + 68, + 70 + ], + [ + 71, + 72 + ], + [ + 74, + 76 + ], + [ + 77, + 78 + ], + [ + 80, + 82 + ], + [ + 83, + 84 + ], + [ + 86, + 89 + ], + [ + 91, + 94 + ], + [ + 96, + 100 + ], + [ + 103, + 104 + ], + [ + 107, + 110 + ], + [ + 112, + 115 + ], + [ + 117, + 120 + ], + [ + 122, + 124 + ], + [ + 127, + 130 + ], + [ + 132, + 136 + ], + [ + 137, + 141 + ], + [ + 143, + 147 + ], + [ + 148, + 152 + ], + [ + 154, + 157 + ], + [ + 158, + 161 + ], + [ + 164, + 166 + ], + [ + 167, + 168 + ], + [ + 172, + 173 + ], + [ + 176, + 180 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 190, + 191 + ], + [ + 193, + 195 + ], + [ + 197, + 198 + ], + [ + 199, + 201 + ], + [ + 202, + 203 + ], + [ + 206, + 209 + ], + [ + 210, + 214 + ], + [ + 217, + 218 + ], + [ + 219, + 220 + ], + [ + 223, + 228 + ], + [ + 230, + 232 + ], + [ + 233, + 234 + ], + [ + 236, + 238 + ], + [ + 239, + 240 + ], + [ + 243, + 244 + ], + [ + 245, + 246 + ], + [ + 248, + 250 + ], + [ + 251, + 252 + ], + [ + 255, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 270 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 279, + 282 + ], + [ + 285, + 286 + ], + [ + 287, + 288 + ], + [ + 290, + 292 + ], + [ + 293, + 294 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 303, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 310 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 317, + 318 + ], + [ + 321, + 322 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ], + [ + 329, + 330 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 351, + 352 + ], + [ + 353, + 354 + ], + [ + 357, + 358 + ], + [ + 359, + 360 + ], + [ + 361, + 362 + ], + [ + 364, + 365 + ], + [ + 367, + 368 + ], + [ + 370, + 371 + ], + [ + 373, + 376 + ], + [ + 382, + 393 + ], + [ + 395, + 397 + ], + [ + 400, + 401 + ], + [ + 404, + 405 + ], + [ + 406, + 407 + ], + [ + 408, + 409 + ], + [ + 412, + 414 + ], + [ + 415, + 416 + ], + [ + 417, + 419 + ], + [ + 429, + 430 + ], + [ + 439, + 441 + ], + [ + 444, + 449 + ], + [ + 452, + 453 + ], + [ + 460, + 461 + ], + [ + 464, + 469 + ], + [ + 470, + 471 + ], + [ + 474, + 475 + ], + [ + 478, + 483 + ], + [ + 484, + 485 + ], + [ + 488, + 490 + ], + [ + 493, + 498 + ], + [ + 499, + 500 + ], + [ + 503, + 504 + ], + [ + 505, + 507 + ], + [ + 510, + 511 + ], + [ + 512, + 513 + ], + [ + 515, + 517 + ], + [ + 518, + 519 + ], + [ + 521, + 525 + ], + [ + 526, + 528 + ], + [ + 531, + 532 + ], + [ + 535, + 541 + ], + [ + 542, + 543 + ], + [ + 544, + 545 + ], + [ + 547, + 549 + ], + [ + 550, + 551 + ], + [ + 553, + 555 + ], + [ + 556, + 557 + ], + [ + 562, + 564 + ], + [ + 568, + 569 + ], + [ + 570, + 572 + ], + [ + 582, + 583 + ], + [ + 584, + 585 + ], + [ + 588, + 590 + ], + [ + 594, + 597 + ], + [ + 600, + 602 + ], + [ + 603, + 605 + ], + [ + 606, + 608 + ], + [ + 611, + 614 + ], + [ + 618, + 622 + ], + [ + 623, + 626 + ], + [ + 627, + 630 + ], + [ + 631, + 634 + ], + [ + 635, + 638 + ], + [ + 639, + 642 + ], + [ + 643, + 646 + ], + [ + 647, + 650 + ], + [ + 675, + 677 + ], + [ + 679, + 680 + ], + [ + 683, + 684 + ], + [ + 685, + 687 + ], + [ + 689, + 691 + ], + [ + 692, + 693 + ], + [ + 695, + 697 + ], + [ + 698, + 699 + ], + [ + 701, + 704 + ], + [ + 705, + 706 + ], + [ + 709, + 710 + ], + [ + 711, + 712 + ], + [ + 715, + 716 + ], + [ + 717, + 718 + ], + [ + 721, + 722 + ], + [ + 723, + 724 + ], + [ + 732, + 733 + ], + [ + 736, + 737 + ], + [ + 740, + 742 + ], + [ + 743, + 746 + ], + [ + 749, + 760 + ], + [ + 763, + 765 + ], + [ + 768, + 785 + ], + [ + 787, + 789 + ], + [ + 791, + 794 + ], + [ + 796, + 799 + ], + [ + 808, + 809 + ], + [ + 810, + 811 + ], + [ + 816, + 817 + ], + [ + 818, + 819 + ], + [ + 820, + 821 + ] + ] + } + }, + { + "filename": "libvips/deprecated/resample_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 45, + 107 + ], + [ + 112, + 153 + ], + [ + 154, + 235 + ], + [ + 245, + 251 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 48, + 53 + ], + [ + 58, + 59 + ], + [ + 60, + 65 + ], + [ + 66, + 67 + ], + [ + 72, + 78 + ], + [ + 83, + 96 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 115, + 117 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 128 + ], + [ + 133, + 142 + ], + [ + 147, + 148 + ], + [ + 149, + 150 + ], + [ + 157, + 159 + ], + [ + 162, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 170 + ], + [ + 175, + 179 + ], + [ + 184, + 185 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 201 + ], + [ + 206, + 210 + ], + [ + 215, + 216 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 228, + 232 + ], + [ + 248, + 249 + ] + ] + } + }, + { + "filename": "libvips/deprecated/rotmask.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 44 + ], + [ + 59, + 156 + ] + ], + "lines_added": [ + [ + 19, + 35 + ], + [ + 40, + 41 + ], + [ + 62, + 63 + ], + [ + 67, + 68 + ], + [ + 74, + 84 + ], + [ + 85, + 86 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 100, + 108 + ], + [ + 109, + 110 + ], + [ + 114, + 115 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 129, + 131 + ], + [ + 134, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ] + ] + } + }, + { + "filename": "libvips/deprecated/rw_mask.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 21 + ], + [ + 43, + 50 + ], + [ + 58, + 86 + ], + [ + 106, + 117 + ], + [ + 128, + 138 + ], + [ + 156, + 172 + ], + [ + 180, + 196 + ], + [ + 198, + 227 + ], + [ + 228, + 247 + ], + [ + 257, + 279 + ], + [ + 281, + 310 + ], + [ + 311, + 330 + ], + [ + 340, + 421 + ], + [ + 423, + 430 + ], + [ + 433, + 451 + ], + [ + 457, + 464 + ], + [ + 466, + 503 + ], + [ + 514, + 562 + ], + [ + 570, + 619 + ], + [ + 620, + 650 + ], + [ + 658, + 681 + ], + [ + 688, + 707 + ], + [ + 719, + 741 + ], + [ + 749, + 798 + ], + [ + 806, + 842 + ], + [ + 848, + 863 + ], + [ + 871, + 913 + ], + [ + 920, + 987 + ], + [ + 992, + 1011 + ], + [ + 1016, + 1035 + ], + [ + 1045, + 1063 + ], + [ + 1072, + 1088 + ] + ], + "lines_added": [ + [ + 14, + 15 + ], + [ + 17, + 18 + ], + [ + 46, + 47 + ], + [ + 61, + 62 + ], + [ + 63, + 67 + ], + [ + 68, + 77 + ], + [ + 82, + 83 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 159, + 163 + ], + [ + 164, + 167 + ], + [ + 168, + 169 + ], + [ + 183, + 184 + ], + [ + 185, + 187 + ], + [ + 188, + 191 + ], + [ + 192, + 193 + ], + [ + 201, + 202 + ], + [ + 208, + 210 + ], + [ + 215, + 218 + ], + [ + 222, + 224 + ], + [ + 231, + 234 + ], + [ + 235, + 239 + ], + [ + 240, + 241 + ], + [ + 243, + 244 + ], + [ + 260, + 261 + ], + [ + 267, + 269 + ], + [ + 270, + 274 + ], + [ + 275, + 276 + ], + [ + 284, + 285 + ], + [ + 291, + 293 + ], + [ + 298, + 301 + ], + [ + 305, + 307 + ], + [ + 314, + 317 + ], + [ + 318, + 322 + ], + [ + 323, + 324 + ], + [ + 326, + 327 + ], + [ + 343, + 345 + ], + [ + 350, + 352 + ], + [ + 353, + 357 + ], + [ + 358, + 359 + ], + [ + 361, + 362 + ], + [ + 364, + 365 + ], + [ + 366, + 369 + ], + [ + 371, + 372 + ], + [ + 377, + 378 + ], + [ + 384, + 386 + ], + [ + 387, + 389 + ], + [ + 394, + 403 + ], + [ + 404, + 408 + ], + [ + 409, + 413 + ], + [ + 417, + 418 + ], + [ + 426, + 427 + ], + [ + 436, + 437 + ], + [ + 441, + 443 + ], + [ + 447, + 448 + ], + [ + 460, + 461 + ], + [ + 469, + 471 + ], + [ + 472, + 475 + ], + [ + 477, + 480 + ], + [ + 484, + 485 + ], + [ + 487, + 491 + ], + [ + 493, + 496 + ], + [ + 497, + 498 + ], + [ + 499, + 500 + ], + [ + 517, + 518 + ], + [ + 523, + 525 + ], + [ + 526, + 531 + ], + [ + 532, + 533 + ], + [ + 535, + 539 + ], + [ + 540, + 542 + ], + [ + 543, + 544 + ], + [ + 546, + 550 + ], + [ + 553, + 554 + ], + [ + 556, + 557 + ], + [ + 558, + 559 + ], + [ + 573, + 574 + ], + [ + 578, + 579 + ], + [ + 582, + 585 + ], + [ + 589, + 591 + ], + [ + 595, + 597 + ], + [ + 603, + 605 + ], + [ + 608, + 609 + ], + [ + 610, + 611 + ], + [ + 613, + 614 + ], + [ + 615, + 616 + ], + [ + 623, + 624 + ], + [ + 630, + 631 + ], + [ + 637, + 640 + ], + [ + 641, + 645 + ], + [ + 646, + 647 + ], + [ + 661, + 662 + ], + [ + 668, + 671 + ], + [ + 672, + 673 + ], + [ + 677, + 678 + ], + [ + 691, + 694 + ], + [ + 699, + 701 + ], + [ + 703, + 704 + ], + [ + 722, + 723 + ], + [ + 727, + 730 + ], + [ + 731, + 732 + ], + [ + 734, + 735 + ], + [ + 737, + 738 + ], + [ + 752, + 753 + ], + [ + 757, + 760 + ], + [ + 761, + 762 + ], + [ + 764, + 765 + ], + [ + 767, + 768 + ], + [ + 772, + 774 + ], + [ + 777, + 781 + ], + [ + 782, + 783 + ], + [ + 784, + 785 + ], + [ + 787, + 789 + ], + [ + 792, + 793 + ], + [ + 794, + 795 + ], + [ + 809, + 811 + ], + [ + 815, + 818 + ], + [ + 819, + 822 + ], + [ + 823, + 826 + ], + [ + 827, + 830 + ], + [ + 831, + 834 + ], + [ + 836, + 837 + ], + [ + 838, + 839 + ], + [ + 851, + 853 + ], + [ + 854, + 857 + ], + [ + 859, + 860 + ], + [ + 874, + 876 + ], + [ + 880, + 883 + ], + [ + 884, + 887 + ], + [ + 888, + 893 + ], + [ + 894, + 895 + ], + [ + 896, + 900 + ], + [ + 902, + 905 + ], + [ + 907, + 908 + ], + [ + 909, + 910 + ], + [ + 923, + 925 + ], + [ + 926, + 929 + ], + [ + 931, + 932 + ], + [ + 937, + 940 + ], + [ + 943, + 945 + ], + [ + 950, + 953 + ], + [ + 956, + 958 + ], + [ + 963, + 966 + ], + [ + 969, + 971 + ], + [ + 976, + 979 + ], + [ + 982, + 984 + ], + [ + 995, + 997 + ], + [ + 998, + 999 + ], + [ + 1000, + 1002 + ], + [ + 1003, + 1006 + ], + [ + 1007, + 1008 + ], + [ + 1019, + 1021 + ], + [ + 1022, + 1023 + ], + [ + 1024, + 1026 + ], + [ + 1027, + 1030 + ], + [ + 1031, + 1032 + ], + [ + 1048, + 1049 + ], + [ + 1050, + 1052 + ], + [ + 1053, + 1057 + ], + [ + 1059, + 1060 + ], + [ + 1075, + 1076 + ], + [ + 1077, + 1079 + ], + [ + 1080, + 1084 + ], + [ + 1086, + 1087 + ] + ] + } + }, + { + "filename": "libvips/deprecated/tone.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 45 + ], + [ + 61, + 68 + ], + [ + 71, + 133 + ], + [ + 141, + 189 + ] + ], + "lines_added": [ + [ + 20, + 36 + ], + [ + 41, + 42 + ], + [ + 64, + 65 + ], + [ + 74, + 75 + ], + [ + 78, + 81 + ], + [ + 84, + 87 + ], + [ + 93, + 98 + ], + [ + 102, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 110 + ], + [ + 116, + 119 + ], + [ + 120, + 121 + ], + [ + 122, + 124 + ], + [ + 128, + 130 + ], + [ + 144, + 148 + ], + [ + 149, + 150 + ], + [ + 155, + 157 + ], + [ + 160, + 163 + ], + [ + 169, + 173 + ], + [ + 174, + 177 + ], + [ + 178, + 181 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ] + ] + } + }, + { + "filename": "libvips/deprecated/video_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 45 + ], + [ + 49, + 122 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 42 + ], + [ + 52, + 53 + ], + [ + 54, + 65 + ], + [ + 68, + 76 + ], + [ + 79, + 85 + ], + [ + 88, + 89 + ], + [ + 90, + 93 + ], + [ + 94, + 95 + ], + [ + 98, + 101 + ], + [ + 104, + 110 + ], + [ + 113, + 115 + ], + [ + 118, + 121 + ] + ] + } + }, + { + "filename": "libvips/deprecated/vips7compat.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 73, + 165 + ], + [ + 170, + 182 + ], + [ + 183, + 238 + ], + [ + 239, + 300 + ], + [ + 301, + 377 + ], + [ + 380, + 490 + ], + [ + 492, + 583 + ], + [ + 585, + 606 + ], + [ + 608, + 678 + ], + [ + 681, + 688 + ], + [ + 691, + 769 + ], + [ + 770, + 855 + ], + [ + 868, + 935 + ], + [ + 938, + 993 + ], + [ + 995, + 3466 + ], + [ + 3468, + 3911 + ], + [ + 3916, + 4593 + ], + [ + 4595, + 4712 + ], + [ + 4728, + 4740 + ], + [ + 4750, + 4989 + ], + [ + 4993, + 5010 + ], + [ + 5012, + 5096 + ], + [ + 5098, + 5127 + ], + [ + 5129, + 5551 + ], + [ + 5552, + 5593 + ], + [ + 5600, + 5618 + ], + [ + 5619, + 5821 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 4, + 5 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 86 + ], + [ + 87, + 89 + ], + [ + 92, + 94 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 109, + 110 + ], + [ + 115, + 117 + ], + [ + 121, + 122 + ], + [ + 123, + 128 + ], + [ + 130, + 131 + ], + [ + 137, + 138 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 147, + 148 + ], + [ + 154, + 155 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 173, + 174 + ], + [ + 177, + 179 + ], + [ + 186, + 187 + ], + [ + 190, + 191 + ], + [ + 195, + 196 + ], + [ + 197, + 199 + ], + [ + 201, + 202 + ], + [ + 208, + 209 + ], + [ + 212, + 213 + ], + [ + 214, + 219 + ], + [ + 224, + 225 + ], + [ + 229, + 233 + ], + [ + 234, + 235 + ], + [ + 242, + 243 + ], + [ + 244, + 246 + ], + [ + 247, + 249 + ], + [ + 250, + 252 + ], + [ + 256, + 258 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 267, + 279 + ], + [ + 280, + 284 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 296, + 297 + ], + [ + 304, + 307 + ], + [ + 309, + 310 + ], + [ + 313, + 314 + ], + [ + 317, + 318 + ], + [ + 324, + 328 + ], + [ + 329, + 332 + ], + [ + 333, + 336 + ], + [ + 338, + 340 + ], + [ + 342, + 343 + ], + [ + 348, + 350 + ], + [ + 353, + 356 + ], + [ + 357, + 358 + ], + [ + 363, + 364 + ], + [ + 365, + 366 + ], + [ + 369, + 372 + ], + [ + 373, + 374 + ], + [ + 383, + 384 + ], + [ + 385, + 387 + ], + [ + 389, + 392 + ], + [ + 395, + 396 + ], + [ + 399, + 401 + ], + [ + 402, + 403 + ], + [ + 406, + 407 + ], + [ + 408, + 410 + ], + [ + 412, + 415 + ], + [ + 418, + 419 + ], + [ + 422, + 424 + ], + [ + 425, + 426 + ], + [ + 432, + 434 + ], + [ + 437, + 447 + ], + [ + 449, + 450 + ], + [ + 456, + 458 + ], + [ + 461, + 464 + ], + [ + 465, + 466 + ], + [ + 469, + 470 + ], + [ + 471, + 472 + ], + [ + 473, + 474 + ], + [ + 479, + 480 + ], + [ + 484, + 485 + ], + [ + 486, + 487 + ], + [ + 495, + 496 + ], + [ + 497, + 498 + ], + [ + 503, + 528 + ], + [ + 532, + 559 + ], + [ + 563, + 572 + ], + [ + 577, + 580 + ], + [ + 588, + 595 + ], + [ + 600, + 603 + ], + [ + 611, + 612 + ], + [ + 617, + 622 + ], + [ + 623, + 626 + ], + [ + 627, + 628 + ], + [ + 630, + 655 + ], + [ + 658, + 668 + ], + [ + 673, + 675 + ], + [ + 684, + 685 + ], + [ + 694, + 699 + ], + [ + 700, + 701 + ], + [ + 704, + 705 + ], + [ + 710, + 711 + ], + [ + 715, + 717 + ], + [ + 720, + 723 + ], + [ + 725, + 726 + ], + [ + 731, + 732 + ], + [ + 736, + 737 + ], + [ + 738, + 740 + ], + [ + 743, + 744 + ], + [ + 747, + 748 + ], + [ + 754, + 755 + ], + [ + 756, + 759 + ], + [ + 763, + 766 + ], + [ + 773, + 778 + ], + [ + 782, + 784 + ], + [ + 789, + 792 + ], + [ + 795, + 799 + ], + [ + 800, + 801 + ], + [ + 804, + 805 + ], + [ + 806, + 807 + ], + [ + 810, + 811 + ], + [ + 817, + 818 + ], + [ + 821, + 823 + ], + [ + 824, + 826 + ], + [ + 829, + 830 + ], + [ + 831, + 833 + ], + [ + 836, + 838 + ], + [ + 842, + 843 + ], + [ + 846, + 849 + ], + [ + 850, + 852 + ], + [ + 871, + 878 + ], + [ + 883, + 884 + ], + [ + 885, + 887 + ], + [ + 889, + 891 + ], + [ + 892, + 893 + ], + [ + 894, + 895 + ], + [ + 896, + 898 + ], + [ + 900, + 902 + ], + [ + 903, + 904 + ], + [ + 905, + 906 + ], + [ + 908, + 909 + ], + [ + 912, + 913 + ], + [ + 917, + 918 + ], + [ + 920, + 922 + ], + [ + 923, + 926 + ], + [ + 927, + 928 + ], + [ + 931, + 932 + ], + [ + 941, + 942 + ], + [ + 947, + 948 + ], + [ + 952, + 957 + ], + [ + 958, + 961 + ], + [ + 963, + 964 + ], + [ + 966, + 967 + ], + [ + 970, + 971 + ], + [ + 975, + 976 + ], + [ + 978, + 983 + ], + [ + 984, + 985 + ], + [ + 988, + 990 + ], + [ + 998, + 1000 + ], + [ + 1001, + 1002 + ], + [ + 1005, + 1007 + ], + [ + 1013, + 1014 + ], + [ + 1015, + 1019 + ], + [ + 1022, + 1023 + ], + [ + 1026, + 1027 + ], + [ + 1030, + 1034 + ], + [ + 1037, + 1042 + ], + [ + 1045, + 1047 + ], + [ + 1050, + 1055 + ], + [ + 1056, + 1057 + ], + [ + 1058, + 1059 + ], + [ + 1061, + 1063 + ], + [ + 1066, + 1071 + ], + [ + 1072, + 1073 + ], + [ + 1074, + 1075 + ], + [ + 1077, + 1079 + ], + [ + 1082, + 1087 + ], + [ + 1088, + 1089 + ], + [ + 1090, + 1091 + ], + [ + 1093, + 1095 + ], + [ + 1098, + 1103 + ], + [ + 1104, + 1105 + ], + [ + 1106, + 1107 + ], + [ + 1110, + 1111 + ], + [ + 1112, + 1113 + ], + [ + 1116, + 1117 + ], + [ + 1118, + 1119 + ], + [ + 1121, + 1123 + ], + [ + 1124, + 1125 + ], + [ + 1126, + 1128 + ], + [ + 1131, + 1132 + ], + [ + 1133, + 1134 + ], + [ + 1137, + 1138 + ], + [ + 1139, + 1140 + ], + [ + 1143, + 1144 + ], + [ + 1145, + 1146 + ], + [ + 1149, + 1150 + ], + [ + 1151, + 1152 + ], + [ + 1156, + 1157 + ], + [ + 1158, + 1161 + ], + [ + 1162, + 1170 + ], + [ + 1171, + 1172 + ], + [ + 1173, + 1174 + ], + [ + 1177, + 1178 + ], + [ + 1179, + 1182 + ], + [ + 1183, + 1191 + ], + [ + 1192, + 1193 + ], + [ + 1196, + 1197 + ], + [ + 1198, + 1199 + ], + [ + 1201, + 1204 + ], + [ + 1207, + 1218 + ], + [ + 1219, + 1220 + ], + [ + 1221, + 1222 + ], + [ + 1224, + 1227 + ], + [ + 1230, + 1239 + ], + [ + 1240, + 1241 + ], + [ + 1242, + 1243 + ], + [ + 1246, + 1247 + ], + [ + 1248, + 1249 + ], + [ + 1252, + 1253 + ], + [ + 1256, + 1261 + ], + [ + 1262, + 1263 + ], + [ + 1264, + 1265 + ], + [ + 1268, + 1269 + ], + [ + 1270, + 1273 + ], + [ + 1274, + 1275 + ], + [ + 1278, + 1279 + ], + [ + 1280, + 1282 + ], + [ + 1283, + 1284 + ], + [ + 1287, + 1288 + ], + [ + 1291, + 1298 + ], + [ + 1299, + 1300 + ], + [ + 1301, + 1302 + ], + [ + 1304, + 1306 + ], + [ + 1309, + 1314 + ], + [ + 1315, + 1316 + ], + [ + 1317, + 1318 + ], + [ + 1320, + 1322 + ], + [ + 1325, + 1330 + ], + [ + 1331, + 1332 + ], + [ + 1333, + 1334 + ], + [ + 1336, + 1338 + ], + [ + 1341, + 1346 + ], + [ + 1347, + 1348 + ], + [ + 1349, + 1350 + ], + [ + 1352, + 1354 + ], + [ + 1357, + 1362 + ], + [ + 1363, + 1364 + ], + [ + 1365, + 1366 + ], + [ + 1368, + 1370 + ], + [ + 1373, + 1378 + ], + [ + 1379, + 1380 + ], + [ + 1381, + 1382 + ], + [ + 1384, + 1386 + ], + [ + 1389, + 1396 + ], + [ + 1397, + 1398 + ], + [ + 1399, + 1400 + ], + [ + 1402, + 1404 + ], + [ + 1407, + 1412 + ], + [ + 1413, + 1414 + ], + [ + 1415, + 1416 + ], + [ + 1418, + 1420 + ], + [ + 1423, + 1429 + ], + [ + 1430, + 1431 + ], + [ + 1432, + 1433 + ], + [ + 1435, + 1437 + ], + [ + 1440, + 1446 + ], + [ + 1447, + 1448 + ], + [ + 1449, + 1450 + ], + [ + 1453, + 1455 + ], + [ + 1458, + 1464 + ], + [ + 1465, + 1466 + ], + [ + 1467, + 1468 + ], + [ + 1470, + 1472 + ], + [ + 1475, + 1482 + ], + [ + 1483, + 1484 + ], + [ + 1485, + 1486 + ], + [ + 1488, + 1490 + ], + [ + 1491, + 1492 + ], + [ + 1495, + 1497 + ], + [ + 1500, + 1503 + ], + [ + 1504, + 1509 + ], + [ + 1510, + 1511 + ], + [ + 1512, + 1515 + ], + [ + 1516, + 1517 + ], + [ + 1518, + 1519 + ], + [ + 1521, + 1523 + ], + [ + 1526, + 1532 + ], + [ + 1533, + 1534 + ], + [ + 1535, + 1536 + ], + [ + 1538, + 1540 + ], + [ + 1543, + 1549 + ], + [ + 1550, + 1551 + ], + [ + 1552, + 1553 + ], + [ + 1555, + 1557 + ], + [ + 1560, + 1561 + ], + [ + 1562, + 1563 + ], + [ + 1565, + 1567 + ], + [ + 1570, + 1576 + ], + [ + 1577, + 1578 + ], + [ + 1579, + 1580 + ], + [ + 1582, + 1584 + ], + [ + 1587, + 1593 + ], + [ + 1594, + 1595 + ], + [ + 1596, + 1597 + ], + [ + 1600, + 1601 + ], + [ + 1604, + 1611 + ], + [ + 1612, + 1613 + ], + [ + 1614, + 1615 + ], + [ + 1618, + 1619 + ], + [ + 1620, + 1621 + ], + [ + 1623, + 1625 + ], + [ + 1628, + 1634 + ], + [ + 1635, + 1636 + ], + [ + 1637, + 1638 + ], + [ + 1640, + 1642 + ], + [ + 1645, + 1651 + ], + [ + 1652, + 1653 + ], + [ + 1654, + 1655 + ], + [ + 1657, + 1659 + ], + [ + 1662, + 1668 + ], + [ + 1669, + 1670 + ], + [ + 1671, + 1672 + ], + [ + 1674, + 1676 + ], + [ + 1679, + 1685 + ], + [ + 1686, + 1687 + ], + [ + 1688, + 1689 + ], + [ + 1691, + 1693 + ], + [ + 1696, + 1702 + ], + [ + 1703, + 1704 + ], + [ + 1705, + 1706 + ], + [ + 1708, + 1710 + ], + [ + 1713, + 1719 + ], + [ + 1720, + 1721 + ], + [ + 1722, + 1723 + ], + [ + 1725, + 1727 + ], + [ + 1730, + 1737 + ], + [ + 1738, + 1739 + ], + [ + 1740, + 1741 + ], + [ + 1743, + 1745 + ], + [ + 1748, + 1757 + ], + [ + 1758, + 1759 + ], + [ + 1760, + 1761 + ], + [ + 1763, + 1765 + ], + [ + 1768, + 1775 + ], + [ + 1776, + 1777 + ], + [ + 1778, + 1779 + ], + [ + 1781, + 1783 + ], + [ + 1786, + 1794 + ], + [ + 1795, + 1796 + ], + [ + 1797, + 1798 + ], + [ + 1800, + 1802 + ], + [ + 1805, + 1810 + ], + [ + 1811, + 1812 + ], + [ + 1813, + 1814 + ], + [ + 1816, + 1818 + ], + [ + 1821, + 1826 + ], + [ + 1827, + 1828 + ], + [ + 1829, + 1830 + ], + [ + 1832, + 1834 + ], + [ + 1837, + 1842 + ], + [ + 1843, + 1844 + ], + [ + 1845, + 1846 + ], + [ + 1848, + 1850 + ], + [ + 1853, + 1858 + ], + [ + 1859, + 1860 + ], + [ + 1861, + 1862 + ], + [ + 1865, + 1866 + ], + [ + 1869, + 1874 + ], + [ + 1875, + 1876 + ], + [ + 1877, + 1878 + ], + [ + 1881, + 1882 + ], + [ + 1885, + 1892 + ], + [ + 1893, + 1894 + ], + [ + 1895, + 1896 + ], + [ + 1899, + 1900 + ], + [ + 1903, + 1908 + ], + [ + 1909, + 1910 + ], + [ + 1911, + 1912 + ], + [ + 1914, + 1916 + ], + [ + 1919, + 1927 + ], + [ + 1928, + 1929 + ], + [ + 1930, + 1931 + ], + [ + 1933, + 1936 + ], + [ + 1939, + 1949 + ], + [ + 1950, + 1951 + ], + [ + 1952, + 1953 + ], + [ + 1955, + 1957 + ], + [ + 1962, + 1963 + ], + [ + 1966, + 1973 + ], + [ + 1975, + 1976 + ], + [ + 1977, + 1978 + ], + [ + 1980, + 1981 + ], + [ + 1984, + 1985 + ], + [ + 1986, + 1987 + ], + [ + 1990, + 1991 + ], + [ + 1992, + 1993 + ], + [ + 1996, + 1997 + ], + [ + 1998, + 2007 + ], + [ + 2009, + 2010 + ], + [ + 2011, + 2012 + ], + [ + 2014, + 2015 + ], + [ + 2016, + 2017 + ], + [ + 2020, + 2021 + ], + [ + 2024, + 2029 + ], + [ + 2030, + 2031 + ], + [ + 2032, + 2033 + ], + [ + 2036, + 2037 + ], + [ + 2038, + 2039 + ], + [ + 2041, + 2043 + ], + [ + 2046, + 2051 + ], + [ + 2052, + 2053 + ], + [ + 2054, + 2055 + ], + [ + 2057, + 2059 + ], + [ + 2062, + 2067 + ], + [ + 2068, + 2069 + ], + [ + 2070, + 2071 + ], + [ + 2073, + 2075 + ], + [ + 2078, + 2083 + ], + [ + 2084, + 2085 + ], + [ + 2086, + 2087 + ], + [ + 2090, + 2091 + ], + [ + 2094, + 2100 + ], + [ + 2101, + 2102 + ], + [ + 2103, + 2104 + ], + [ + 2106, + 2108 + ], + [ + 2109, + 2110 + ], + [ + 2112, + 2114 + ], + [ + 2115, + 2116 + ], + [ + 2118, + 2120 + ], + [ + 2121, + 2122 + ], + [ + 2124, + 2126 + ], + [ + 2127, + 2128 + ], + [ + 2130, + 2132 + ], + [ + 2133, + 2134 + ], + [ + 2136, + 2138 + ], + [ + 2139, + 2140 + ], + [ + 2142, + 2144 + ], + [ + 2145, + 2146 + ], + [ + 2148, + 2150 + ], + [ + 2151, + 2152 + ], + [ + 2154, + 2156 + ], + [ + 2157, + 2158 + ], + [ + 2160, + 2162 + ], + [ + 2163, + 2164 + ], + [ + 2167, + 2168 + ], + [ + 2172, + 2178 + ], + [ + 2179, + 2180 + ], + [ + 2181, + 2182 + ], + [ + 2185, + 2186 + ], + [ + 2190, + 2197 + ], + [ + 2198, + 2199 + ], + [ + 2200, + 2201 + ], + [ + 2204, + 2205 + ], + [ + 2209, + 2217 + ], + [ + 2218, + 2219 + ], + [ + 2220, + 2221 + ], + [ + 2224, + 2225 + ], + [ + 2229, + 2234 + ], + [ + 2235, + 2236 + ], + [ + 2237, + 2238 + ], + [ + 2241, + 2242 + ], + [ + 2246, + 2253 + ], + [ + 2254, + 2255 + ], + [ + 2256, + 2257 + ], + [ + 2260, + 2261 + ], + [ + 2265, + 2270 + ], + [ + 2271, + 2272 + ], + [ + 2273, + 2274 + ], + [ + 2277, + 2278 + ], + [ + 2282, + 2289 + ], + [ + 2290, + 2291 + ], + [ + 2292, + 2293 + ], + [ + 2295, + 2297 + ], + [ + 2300, + 2307 + ], + [ + 2308, + 2312 + ], + [ + 2313, + 2314 + ], + [ + 2315, + 2316 + ], + [ + 2318, + 2320 + ], + [ + 2323, + 2333 + ], + [ + 2334, + 2338 + ], + [ + 2339, + 2340 + ], + [ + 2341, + 2342 + ], + [ + 2344, + 2346 + ], + [ + 2349, + 2359 + ], + [ + 2360, + 2364 + ], + [ + 2365, + 2366 + ], + [ + 2367, + 2368 + ], + [ + 2371, + 2372 + ], + [ + 2375, + 2386 + ], + [ + 2387, + 2391 + ], + [ + 2392, + 2393 + ], + [ + 2394, + 2395 + ], + [ + 2398, + 2399 + ], + [ + 2400, + 2402 + ], + [ + 2404, + 2406 + ], + [ + 2409, + 2417 + ], + [ + 2418, + 2422 + ], + [ + 2423, + 2424 + ], + [ + 2425, + 2426 + ], + [ + 2429, + 2430 + ], + [ + 2431, + 2433 + ], + [ + 2435, + 2437 + ], + [ + 2440, + 2446 + ], + [ + 2447, + 2451 + ], + [ + 2452, + 2453 + ], + [ + 2454, + 2455 + ], + [ + 2457, + 2459 + ], + [ + 2462, + 2469 + ], + [ + 2470, + 2474 + ], + [ + 2475, + 2476 + ], + [ + 2477, + 2478 + ], + [ + 2481, + 2482 + ], + [ + 2483, + 2485 + ], + [ + 2487, + 2489 + ], + [ + 2492, + 2499 + ], + [ + 2500, + 2504 + ], + [ + 2505, + 2506 + ], + [ + 2507, + 2508 + ], + [ + 2510, + 2512 + ], + [ + 2515, + 2523 + ], + [ + 2524, + 2528 + ], + [ + 2529, + 2530 + ], + [ + 2531, + 2532 + ], + [ + 2534, + 2537 + ], + [ + 2540, + 2549 + ], + [ + 2550, + 2554 + ], + [ + 2555, + 2556 + ], + [ + 2557, + 2558 + ], + [ + 2561, + 2562 + ], + [ + 2563, + 2565 + ], + [ + 2568, + 2569 + ], + [ + 2572, + 2576 + ], + [ + 2577, + 2578 + ], + [ + 2581, + 2582 + ], + [ + 2583, + 2585 + ], + [ + 2588, + 2589 + ], + [ + 2590, + 2591 + ], + [ + 2593, + 2594 + ], + [ + 2595, + 2598 + ], + [ + 2601, + 2604 + ], + [ + 2605, + 2608 + ], + [ + 2609, + 2610 + ], + [ + 2611, + 2613 + ], + [ + 2614, + 2619 + ], + [ + 2620, + 2624 + ], + [ + 2625, + 2626 + ], + [ + 2629, + 2630 + ], + [ + 2631, + 2633 + ], + [ + 2636, + 2637 + ], + [ + 2640, + 2645 + ], + [ + 2646, + 2647 + ], + [ + 2648, + 2649 + ], + [ + 2652, + 2653 + ], + [ + 2654, + 2656 + ], + [ + 2659, + 2660 + ], + [ + 2663, + 2668 + ], + [ + 2669, + 2670 + ], + [ + 2671, + 2672 + ], + [ + 2675, + 2679 + ], + [ + 2680, + 2682 + ], + [ + 2684, + 2685 + ], + [ + 2686, + 2700 + ], + [ + 2703, + 2704 + ], + [ + 2707, + 2713 + ], + [ + 2714, + 2715 + ], + [ + 2716, + 2717 + ], + [ + 2719, + 2721 + ], + [ + 2722, + 2723 + ], + [ + 2725, + 2727 + ], + [ + 2728, + 2729 + ], + [ + 2731, + 2733 + ], + [ + 2734, + 2735 + ], + [ + 2737, + 2740 + ], + [ + 2743, + 2749 + ], + [ + 2750, + 2751 + ], + [ + 2752, + 2753 + ], + [ + 2755, + 2757 + ], + [ + 2758, + 2760 + ], + [ + 2762, + 2764 + ], + [ + 2765, + 2767 + ], + [ + 2769, + 2771 + ], + [ + 2772, + 2774 + ], + [ + 2776, + 2778 + ], + [ + 2779, + 2781 + ], + [ + 2783, + 2785 + ], + [ + 2786, + 2788 + ], + [ + 2790, + 2792 + ], + [ + 2793, + 2795 + ], + [ + 2797, + 2800 + ], + [ + 2803, + 2809 + ], + [ + 2810, + 2811 + ], + [ + 2812, + 2813 + ], + [ + 2815, + 2817 + ], + [ + 2818, + 2820 + ], + [ + 2822, + 2824 + ], + [ + 2825, + 2827 + ], + [ + 2829, + 2831 + ], + [ + 2832, + 2834 + ], + [ + 2836, + 2838 + ], + [ + 2839, + 2841 + ], + [ + 2843, + 2845 + ], + [ + 2846, + 2848 + ], + [ + 2850, + 2852 + ], + [ + 2853, + 2855 + ], + [ + 2857, + 2859 + ], + [ + 2860, + 2861 + ], + [ + 2864, + 2865 + ], + [ + 2866, + 2867 + ], + [ + 2870, + 2871 + ], + [ + 2872, + 2873 + ], + [ + 2876, + 2877 + ], + [ + 2878, + 2879 + ], + [ + 2882, + 2883 + ], + [ + 2884, + 2885 + ], + [ + 2888, + 2889 + ], + [ + 2890, + 2891 + ], + [ + 2893, + 2895 + ], + [ + 2898, + 2904 + ], + [ + 2905, + 2906 + ], + [ + 2907, + 2908 + ], + [ + 2910, + 2912 + ], + [ + 2915, + 2921 + ], + [ + 2922, + 2923 + ], + [ + 2924, + 2925 + ], + [ + 2927, + 2929 + ], + [ + 2930, + 2931 + ], + [ + 2933, + 2936 + ], + [ + 2939, + 2945 + ], + [ + 2946, + 2947 + ], + [ + 2948, + 2949 + ], + [ + 2951, + 2953 + ], + [ + 2954, + 2955 + ], + [ + 2957, + 2959 + ], + [ + 2960, + 2961 + ], + [ + 2963, + 2965 + ], + [ + 2966, + 2967 + ], + [ + 2969, + 2972 + ], + [ + 2975, + 2981 + ], + [ + 2982, + 2983 + ], + [ + 2984, + 2985 + ], + [ + 2987, + 2989 + ], + [ + 2990, + 2992 + ], + [ + 2994, + 2996 + ], + [ + 2997, + 2999 + ], + [ + 3001, + 3003 + ], + [ + 3004, + 3006 + ], + [ + 3008, + 3010 + ], + [ + 3011, + 3013 + ], + [ + 3015, + 3017 + ], + [ + 3018, + 3020 + ], + [ + 3022, + 3024 + ], + [ + 3025, + 3026 + ], + [ + 3028, + 3030 + ], + [ + 3031, + 3032 + ], + [ + 3034, + 3036 + ], + [ + 3037, + 3038 + ], + [ + 3040, + 3042 + ], + [ + 3045, + 3046 + ], + [ + 3048, + 3050 + ], + [ + 3053, + 3054 + ], + [ + 3056, + 3059 + ], + [ + 3062, + 3068 + ], + [ + 3069, + 3070 + ], + [ + 3071, + 3072 + ], + [ + 3074, + 3076 + ], + [ + 3077, + 3078 + ], + [ + 3080, + 3082 + ], + [ + 3083, + 3084 + ], + [ + 3086, + 3088 + ], + [ + 3089, + 3090 + ], + [ + 3092, + 3094 + ], + [ + 3095, + 3096 + ], + [ + 3098, + 3100 + ], + [ + 3103, + 3109 + ], + [ + 3110, + 3111 + ], + [ + 3112, + 3113 + ], + [ + 3115, + 3117 + ], + [ + 3120, + 3127 + ], + [ + 3128, + 3129 + ], + [ + 3130, + 3131 + ], + [ + 3134, + 3135 + ], + [ + 3138, + 3144 + ], + [ + 3145, + 3146 + ], + [ + 3147, + 3148 + ], + [ + 3150, + 3152 + ], + [ + 3153, + 3154 + ], + [ + 3156, + 3158 + ], + [ + 3159, + 3160 + ], + [ + 3163, + 3164 + ], + [ + 3167, + 3173 + ], + [ + 3174, + 3175 + ], + [ + 3176, + 3177 + ], + [ + 3179, + 3181 + ], + [ + 3182, + 3183 + ], + [ + 3185, + 3187 + ], + [ + 3188, + 3189 + ], + [ + 3191, + 3193 + ], + [ + 3196, + 3201 + ], + [ + 3202, + 3203 + ], + [ + 3204, + 3205 + ], + [ + 3208, + 3210 + ], + [ + 3211, + 3213 + ], + [ + 3216, + 3217 + ], + [ + 3220, + 3221 + ], + [ + 3224, + 3225 + ], + [ + 3228, + 3233 + ], + [ + 3234, + 3235 + ], + [ + 3236, + 3237 + ], + [ + 3240, + 3241 + ], + [ + 3244, + 3252 + ], + [ + 3253, + 3254 + ], + [ + 3255, + 3256 + ], + [ + 3259, + 3260 + ], + [ + 3263, + 3270 + ], + [ + 3271, + 3272 + ], + [ + 3273, + 3274 + ], + [ + 3277, + 3278 + ], + [ + 3281, + 3288 + ], + [ + 3289, + 3290 + ], + [ + 3291, + 3292 + ], + [ + 3295, + 3296 + ], + [ + 3299, + 3305 + ], + [ + 3306, + 3307 + ], + [ + 3308, + 3309 + ], + [ + 3312, + 3313 + ], + [ + 3318, + 3324 + ], + [ + 3325, + 3329 + ], + [ + 3330, + 3331 + ], + [ + 3332, + 3333 + ], + [ + 3336, + 3337 + ], + [ + 3342, + 3349 + ], + [ + 3350, + 3354 + ], + [ + 3355, + 3356 + ], + [ + 3357, + 3358 + ], + [ + 3360, + 3362 + ], + [ + 3364, + 3366 + ], + [ + 3369, + 3393 + ], + [ + 3394, + 3396 + ], + [ + 3399, + 3404 + ], + [ + 3405, + 3406 + ], + [ + 3409, + 3411 + ], + [ + 3412, + 3414 + ], + [ + 3415, + 3419 + ], + [ + 3420, + 3421 + ], + [ + 3423, + 3425 + ], + [ + 3429, + 3433 + ], + [ + 3434, + 3435 + ], + [ + 3436, + 3439 + ], + [ + 3440, + 3441 + ], + [ + 3442, + 3443 + ], + [ + 3445, + 3447 + ], + [ + 3450, + 3455 + ], + [ + 3456, + 3457 + ], + [ + 3458, + 3459 + ], + [ + 3461, + 3463 + ], + [ + 3471, + 3475 + ], + [ + 3476, + 3477 + ], + [ + 3478, + 3481 + ], + [ + 3482, + 3483 + ], + [ + 3484, + 3485 + ], + [ + 3487, + 3489 + ], + [ + 3492, + 3497 + ], + [ + 3498, + 3499 + ], + [ + 3500, + 3501 + ], + [ + 3503, + 3505 + ], + [ + 3508, + 3513 + ], + [ + 3514, + 3515 + ], + [ + 3516, + 3517 + ], + [ + 3519, + 3521 + ], + [ + 3524, + 3529 + ], + [ + 3530, + 3531 + ], + [ + 3532, + 3533 + ], + [ + 3535, + 3537 + ], + [ + 3540, + 3545 + ], + [ + 3546, + 3547 + ], + [ + 3548, + 3549 + ], + [ + 3551, + 3553 + ], + [ + 3556, + 3561 + ], + [ + 3562, + 3563 + ], + [ + 3564, + 3565 + ], + [ + 3567, + 3569 + ], + [ + 3572, + 3577 + ], + [ + 3578, + 3579 + ], + [ + 3580, + 3581 + ], + [ + 3583, + 3585 + ], + [ + 3588, + 3593 + ], + [ + 3594, + 3595 + ], + [ + 3596, + 3597 + ], + [ + 3599, + 3601 + ], + [ + 3604, + 3609 + ], + [ + 3610, + 3611 + ], + [ + 3612, + 3613 + ], + [ + 3615, + 3617 + ], + [ + 3620, + 3625 + ], + [ + 3626, + 3627 + ], + [ + 3628, + 3629 + ], + [ + 3631, + 3633 + ], + [ + 3636, + 3641 + ], + [ + 3642, + 3643 + ], + [ + 3644, + 3645 + ], + [ + 3647, + 3649 + ], + [ + 3652, + 3657 + ], + [ + 3658, + 3659 + ], + [ + 3660, + 3661 + ], + [ + 3663, + 3665 + ], + [ + 3668, + 3673 + ], + [ + 3674, + 3675 + ], + [ + 3676, + 3677 + ], + [ + 3679, + 3681 + ], + [ + 3684, + 3689 + ], + [ + 3690, + 3691 + ], + [ + 3692, + 3693 + ], + [ + 3695, + 3697 + ], + [ + 3700, + 3705 + ], + [ + 3706, + 3707 + ], + [ + 3708, + 3709 + ], + [ + 3711, + 3713 + ], + [ + 3716, + 3721 + ], + [ + 3722, + 3723 + ], + [ + 3724, + 3725 + ], + [ + 3727, + 3730 + ], + [ + 3732, + 3736 + ], + [ + 3737, + 3738 + ], + [ + 3740, + 3744 + ], + [ + 3746, + 3753 + ], + [ + 3754, + 3755 + ], + [ + 3757, + 3759 + ], + [ + 3762, + 3767 + ], + [ + 3768, + 3769 + ], + [ + 3771, + 3773 + ], + [ + 3776, + 3782 + ], + [ + 3784, + 3786 + ], + [ + 3787, + 3789 + ], + [ + 3790, + 3794 + ], + [ + 3795, + 3796 + ], + [ + 3798, + 3800 + ], + [ + 3801, + 3803 + ], + [ + 3804, + 3808 + ], + [ + 3809, + 3810 + ], + [ + 3812, + 3814 + ], + [ + 3817, + 3822 + ], + [ + 3823, + 3824 + ], + [ + 3825, + 3826 + ], + [ + 3828, + 3830 + ], + [ + 3832, + 3833 + ], + [ + 3836, + 3844 + ], + [ + 3845, + 3846 + ], + [ + 3847, + 3848 + ], + [ + 3850, + 3853 + ], + [ + 3856, + 3864 + ], + [ + 3865, + 3866 + ], + [ + 3867, + 3868 + ], + [ + 3870, + 3872 + ], + [ + 3875, + 3883 + ], + [ + 3884, + 3885 + ], + [ + 3886, + 3887 + ], + [ + 3889, + 3892 + ], + [ + 3895, + 3904 + ], + [ + 3905, + 3906 + ], + [ + 3907, + 3908 + ], + [ + 3919, + 3922 + ], + [ + 3924, + 3928 + ], + [ + 3929, + 3930 + ], + [ + 3932, + 3935 + ], + [ + 3937, + 3941 + ], + [ + 3942, + 3943 + ], + [ + 3945, + 3948 + ], + [ + 3950, + 3954 + ], + [ + 3955, + 3956 + ], + [ + 3958, + 3960 + ], + [ + 3963, + 3967 + ], + [ + 3968, + 3969 + ], + [ + 3971, + 3974 + ], + [ + 3976, + 3980 + ], + [ + 3981, + 3982 + ], + [ + 3984, + 3987 + ], + [ + 3989, + 3994 + ], + [ + 3995, + 3996 + ], + [ + 3998, + 4000 + ], + [ + 4003, + 4009 + ], + [ + 4010, + 4011 + ], + [ + 4012, + 4013 + ], + [ + 4015, + 4017 + ], + [ + 4020, + 4026 + ], + [ + 4027, + 4028 + ], + [ + 4029, + 4030 + ], + [ + 4032, + 4034 + ], + [ + 4037, + 4043 + ], + [ + 4044, + 4045 + ], + [ + 4046, + 4047 + ], + [ + 4050, + 4051 + ], + [ + 4054, + 4059 + ], + [ + 4060, + 4061 + ], + [ + 4062, + 4063 + ], + [ + 4065, + 4067 + ], + [ + 4070, + 4076 + ], + [ + 4077, + 4078 + ], + [ + 4079, + 4080 + ], + [ + 4082, + 4084 + ], + [ + 4090, + 4097 + ], + [ + 4098, + 4101 + ], + [ + 4102, + 4105 + ], + [ + 4106, + 4107 + ], + [ + 4109, + 4111 + ], + [ + 4117, + 4124 + ], + [ + 4125, + 4128 + ], + [ + 4129, + 4132 + ], + [ + 4133, + 4134 + ], + [ + 4136, + 4138 + ], + [ + 4141, + 4143 + ], + [ + 4144, + 4147 + ], + [ + 4148, + 4149 + ], + [ + 4150, + 4151 + ], + [ + 4153, + 4155 + ], + [ + 4158, + 4160 + ], + [ + 4161, + 4164 + ], + [ + 4165, + 4166 + ], + [ + 4167, + 4168 + ], + [ + 4171, + 4172 + ], + [ + 4175, + 4177 + ], + [ + 4178, + 4179 + ], + [ + 4180, + 4181 + ], + [ + 4183, + 4185 + ], + [ + 4188, + 4190 + ], + [ + 4191, + 4194 + ], + [ + 4195, + 4196 + ], + [ + 4197, + 4198 + ], + [ + 4200, + 4202 + ], + [ + 4205, + 4207 + ], + [ + 4208, + 4211 + ], + [ + 4212, + 4213 + ], + [ + 4214, + 4215 + ], + [ + 4217, + 4219 + ], + [ + 4222, + 4226 + ], + [ + 4227, + 4228 + ], + [ + 4230, + 4232 + ], + [ + 4235, + 4237 + ], + [ + 4238, + 4241 + ], + [ + 4242, + 4243 + ], + [ + 4244, + 4245 + ], + [ + 4247, + 4249 + ], + [ + 4252, + 4256 + ], + [ + 4257, + 4258 + ], + [ + 4260, + 4262 + ], + [ + 4265, + 4269 + ], + [ + 4270, + 4273 + ], + [ + 4274, + 4275 + ], + [ + 4276, + 4277 + ], + [ + 4279, + 4283 + ], + [ + 4286, + 4293 + ], + [ + 4294, + 4297 + ], + [ + 4298, + 4299 + ], + [ + 4300, + 4301 + ], + [ + 4303, + 4305 + ], + [ + 4308, + 4310 + ], + [ + 4311, + 4314 + ], + [ + 4315, + 4316 + ], + [ + 4317, + 4318 + ], + [ + 4320, + 4322 + ], + [ + 4325, + 4329 + ], + [ + 4330, + 4333 + ], + [ + 4334, + 4335 + ], + [ + 4336, + 4337 + ], + [ + 4339, + 4341 + ], + [ + 4344, + 4346 + ], + [ + 4347, + 4350 + ], + [ + 4351, + 4352 + ], + [ + 4353, + 4354 + ], + [ + 4356, + 4358 + ], + [ + 4361, + 4363 + ], + [ + 4364, + 4368 + ], + [ + 4369, + 4370 + ], + [ + 4371, + 4374 + ], + [ + 4375, + 4376 + ], + [ + 4377, + 4378 + ], + [ + 4380, + 4382 + ], + [ + 4386, + 4389 + ], + [ + 4390, + 4391 + ], + [ + 4394, + 4395 + ], + [ + 4397, + 4400 + ], + [ + 4401, + 4402 + ], + [ + 4403, + 4406 + ], + [ + 4407, + 4408 + ], + [ + 4409, + 4410 + ], + [ + 4413, + 4414 + ], + [ + 4417, + 4420 + ], + [ + 4421, + 4425 + ], + [ + 4426, + 4427 + ], + [ + 4428, + 4431 + ], + [ + 4432, + 4433 + ], + [ + 4434, + 4435 + ], + [ + 4438, + 4439 + ], + [ + 4440, + 4441 + ], + [ + 4444, + 4445 + ], + [ + 4448, + 4451 + ], + [ + 4452, + 4456 + ], + [ + 4457, + 4458 + ], + [ + 4459, + 4462 + ], + [ + 4463, + 4464 + ], + [ + 4465, + 4466 + ], + [ + 4469, + 4470 + ], + [ + 4471, + 4472 + ], + [ + 4475, + 4476 + ], + [ + 4477, + 4479 + ], + [ + 4480, + 4481 + ], + [ + 4484, + 4485 + ], + [ + 4488, + 4489 + ], + [ + 4490, + 4491 + ], + [ + 4493, + 4495 + ], + [ + 4498, + 4504 + ], + [ + 4505, + 4506 + ], + [ + 4509, + 4510 + ], + [ + 4513, + 4515 + ], + [ + 4516, + 4519 + ], + [ + 4520, + 4521 + ], + [ + 4522, + 4523 + ], + [ + 4525, + 4527 + ], + [ + 4532, + 4535 + ], + [ + 4536, + 4541 + ], + [ + 4542, + 4544 + ], + [ + 4545, + 4546 + ], + [ + 4547, + 4548 + ], + [ + 4550, + 4552 + ], + [ + 4553, + 4554 + ], + [ + 4556, + 4558 + ], + [ + 4561, + 4563 + ], + [ + 4564, + 4567 + ], + [ + 4568, + 4569 + ], + [ + 4570, + 4571 + ], + [ + 4573, + 4575 + ], + [ + 4578, + 4582 + ], + [ + 4583, + 4586 + ], + [ + 4587, + 4588 + ], + [ + 4589, + 4590 + ], + [ + 4598, + 4599 + ], + [ + 4603, + 4604 + ], + [ + 4606, + 4607 + ], + [ + 4609, + 4611 + ], + [ + 4614, + 4622 + ], + [ + 4623, + 4626 + ], + [ + 4627, + 4628 + ], + [ + 4629, + 4630 + ], + [ + 4633, + 4634 + ], + [ + 4636, + 4638 + ], + [ + 4641, + 4650 + ], + [ + 4651, + 4654 + ], + [ + 4655, + 4656 + ], + [ + 4657, + 4658 + ], + [ + 4660, + 4663 + ], + [ + 4664, + 4666 + ], + [ + 4670, + 4671 + ], + [ + 4672, + 4673 + ], + [ + 4679, + 4690 + ], + [ + 4692, + 4696 + ], + [ + 4699, + 4701 + ], + [ + 4702, + 4703 + ], + [ + 4705, + 4709 + ], + [ + 4731, + 4732 + ], + [ + 4734, + 4737 + ], + [ + 4753, + 4754 + ], + [ + 4755, + 4756 + ], + [ + 4760, + 4762 + ], + [ + 4763, + 4765 + ], + [ + 4768, + 4769 + ], + [ + 4772, + 4777 + ], + [ + 4778, + 4779 + ], + [ + 4780, + 4781 + ], + [ + 4784, + 4787 + ], + [ + 4788, + 4791 + ], + [ + 4793, + 4795 + ], + [ + 4798, + 4800 + ], + [ + 4801, + 4804 + ], + [ + 4805, + 4806 + ], + [ + 4807, + 4808 + ], + [ + 4810, + 4812 + ], + [ + 4815, + 4817 + ], + [ + 4818, + 4821 + ], + [ + 4822, + 4823 + ], + [ + 4824, + 4825 + ], + [ + 4827, + 4829 + ], + [ + 4832, + 4836 + ], + [ + 4837, + 4840 + ], + [ + 4841, + 4842 + ], + [ + 4843, + 4844 + ], + [ + 4846, + 4848 + ], + [ + 4851, + 4853 + ], + [ + 4854, + 4857 + ], + [ + 4858, + 4859 + ], + [ + 4860, + 4861 + ], + [ + 4863, + 4865 + ], + [ + 4868, + 4873 + ], + [ + 4874, + 4875 + ], + [ + 4876, + 4877 + ], + [ + 4879, + 4881 + ], + [ + 4884, + 4889 + ], + [ + 4890, + 4891 + ], + [ + 4892, + 4893 + ], + [ + 4895, + 4897 + ], + [ + 4900, + 4902 + ], + [ + 4903, + 4906 + ], + [ + 4907, + 4908 + ], + [ + 4909, + 4910 + ], + [ + 4912, + 4914 + ], + [ + 4915, + 4918 + ], + [ + 4921, + 4922 + ], + [ + 4925, + 4927 + ], + [ + 4928, + 4931 + ], + [ + 4932, + 4933 + ], + [ + 4934, + 4935 + ], + [ + 4937, + 4939 + ], + [ + 4942, + 4944 + ], + [ + 4945, + 4948 + ], + [ + 4949, + 4950 + ], + [ + 4951, + 4952 + ], + [ + 4955, + 4956 + ], + [ + 4957, + 4959 + ], + [ + 4962, + 4964 + ], + [ + 4968, + 4970 + ], + [ + 4971, + 4972 + ], + [ + 4973, + 4974 + ], + [ + 4976, + 4978 + ], + [ + 4982, + 4984 + ], + [ + 4985, + 4986 + ], + [ + 4996, + 4997 + ], + [ + 5000, + 5001 + ], + [ + 5003, + 5007 + ], + [ + 5015, + 5019 + ], + [ + 5022, + 5023 + ], + [ + 5026, + 5027 + ], + [ + 5030, + 5031 + ], + [ + 5032, + 5033 + ], + [ + 5036, + 5038 + ], + [ + 5042, + 5044 + ], + [ + 5045, + 5048 + ], + [ + 5051, + 5052 + ], + [ + 5056, + 5058 + ], + [ + 5059, + 5060 + ], + [ + 5063, + 5064 + ], + [ + 5065, + 5066 + ], + [ + 5069, + 5070 + ], + [ + 5075, + 5077 + ], + [ + 5078, + 5082 + ], + [ + 5084, + 5085 + ], + [ + 5086, + 5087 + ], + [ + 5088, + 5089 + ], + [ + 5092, + 5093 + ], + [ + 5101, + 5103 + ], + [ + 5104, + 5111 + ], + [ + 5112, + 5117 + ], + [ + 5119, + 5120 + ], + [ + 5123, + 5124 + ], + [ + 5132, + 5134 + ], + [ + 5135, + 5143 + ], + [ + 5144, + 5149 + ], + [ + 5151, + 5152 + ], + [ + 5155, + 5157 + ], + [ + 5163, + 5172 + ], + [ + 5173, + 5179 + ], + [ + 5180, + 5181 + ], + [ + 5184, + 5186 + ], + [ + 5190, + 5195 + ], + [ + 5196, + 5201 + ], + [ + 5202, + 5205 + ], + [ + 5210, + 5212 + ], + [ + 5218, + 5221 + ], + [ + 5222, + 5226 + ], + [ + 5228, + 5229 + ], + [ + 5232, + 5234 + ], + [ + 5235, + 5236 + ], + [ + 5239, + 5246 + ], + [ + 5247, + 5250 + ], + [ + 5251, + 5252 + ], + [ + 5253, + 5254 + ], + [ + 5257, + 5261 + ], + [ + 5263, + 5267 + ], + [ + 5268, + 5271 + ], + [ + 5272, + 5273 + ], + [ + 5274, + 5275 + ], + [ + 5278, + 5279 + ], + [ + 5282, + 5287 + ], + [ + 5288, + 5291 + ], + [ + 5292, + 5293 + ], + [ + 5294, + 5295 + ], + [ + 5297, + 5299 + ], + [ + 5302, + 5304 + ], + [ + 5305, + 5308 + ], + [ + 5309, + 5310 + ], + [ + 5311, + 5312 + ], + [ + 5315, + 5316 + ], + [ + 5319, + 5323 + ], + [ + 5324, + 5327 + ], + [ + 5328, + 5329 + ], + [ + 5330, + 5331 + ], + [ + 5334, + 5335 + ], + [ + 5338, + 5340 + ], + [ + 5341, + 5344 + ], + [ + 5345, + 5346 + ], + [ + 5347, + 5348 + ], + [ + 5351, + 5352 + ], + [ + 5354, + 5355 + ], + [ + 5356, + 5357 + ], + [ + 5360, + 5370 + ], + [ + 5371, + 5372 + ], + [ + 5373, + 5374 + ], + [ + 5377, + 5378 + ], + [ + 5379, + 5380 + ], + [ + 5383, + 5385 + ], + [ + 5387, + 5398 + ], + [ + 5399, + 5400 + ], + [ + 5401, + 5402 + ], + [ + 5405, + 5406 + ], + [ + 5408, + 5409 + ], + [ + 5410, + 5411 + ], + [ + 5414, + 5424 + ], + [ + 5425, + 5426 + ], + [ + 5427, + 5428 + ], + [ + 5431, + 5432 + ], + [ + 5433, + 5434 + ], + [ + 5437, + 5439 + ], + [ + 5441, + 5452 + ], + [ + 5453, + 5454 + ], + [ + 5455, + 5456 + ], + [ + 5459, + 5460 + ], + [ + 5462, + 5463 + ], + [ + 5464, + 5466 + ], + [ + 5469, + 5471 + ], + [ + 5474, + 5481 + ], + [ + 5482, + 5483 + ], + [ + 5484, + 5485 + ], + [ + 5488, + 5490 + ], + [ + 5491, + 5492 + ], + [ + 5495, + 5503 + ], + [ + 5504, + 5505 + ], + [ + 5506, + 5507 + ], + [ + 5510, + 5512 + ], + [ + 5515, + 5522 + ], + [ + 5523, + 5524 + ], + [ + 5525, + 5526 + ], + [ + 5529, + 5531 + ], + [ + 5532, + 5533 + ], + [ + 5536, + 5544 + ], + [ + 5545, + 5546 + ], + [ + 5547, + 5548 + ], + [ + 5555, + 5556 + ], + [ + 5562, + 5564 + ], + [ + 5568, + 5574 + ], + [ + 5577, + 5582 + ], + [ + 5585, + 5588 + ], + [ + 5589, + 5590 + ], + [ + 5603, + 5604 + ], + [ + 5608, + 5610 + ], + [ + 5613, + 5615 + ], + [ + 5622, + 5623 + ], + [ + 5628, + 5630 + ], + [ + 5633, + 5636 + ], + [ + 5637, + 5640 + ], + [ + 5641, + 5643 + ], + [ + 5644, + 5645 + ], + [ + 5650, + 5651 + ], + [ + 5652, + 5653 + ], + [ + 5656, + 5657 + ], + [ + 5661, + 5662 + ], + [ + 5663, + 5665 + ], + [ + 5666, + 5667 + ], + [ + 5670, + 5671 + ], + [ + 5672, + 5681 + ], + [ + 5683, + 5684 + ], + [ + 5687, + 5688 + ], + [ + 5689, + 5698 + ], + [ + 5700, + 5701 + ], + [ + 5704, + 5705 + ], + [ + 5706, + 5712 + ], + [ + 5714, + 5715 + ], + [ + 5718, + 5719 + ], + [ + 5722, + 5727 + ], + [ + 5729, + 5730 + ], + [ + 5736, + 5737 + ], + [ + 5738, + 5740 + ], + [ + 5746, + 5747 + ], + [ + 5748, + 5750 + ], + [ + 5754, + 5755 + ], + [ + 5759, + 5768 + ], + [ + 5771, + 5774 + ], + [ + 5775, + 5776 + ], + [ + 5777, + 5780 + ], + [ + 5781, + 5785 + ], + [ + 5787, + 5789 + ], + [ + 5790, + 5795 + ], + [ + 5796, + 5801 + ], + [ + 5803, + 5804 + ], + [ + 5809, + 5810 + ], + [ + 5811, + 5812 + ], + [ + 5817, + 5818 + ], + [ + 5819, + 5820 + ] + ] + } + }, + { + "filename": "libvips/draw/draw.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 45, + 52 + ], + [ + 53, + 63 + ], + [ + 68, + 83 + ], + [ + 84, + 158 + ], + [ + 161, + 164 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 48, + 49 + ], + [ + 56, + 57 + ], + [ + 59, + 60 + ], + [ + 71, + 73 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 87, + 88 + ], + [ + 92, + 93 + ], + [ + 95, + 96 + ], + [ + 97, + 99 + ], + [ + 101, + 104 + ], + [ + 106, + 108 + ], + [ + 109, + 112 + ], + [ + 113, + 115 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 125 + ], + [ + 130, + 131 + ], + [ + 133, + 138 + ], + [ + 141, + 142 + ], + [ + 146, + 147 + ], + [ + 148, + 155 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_circle.c", + "line_filter": { + "diff_chunks": [ + [ + 23, + 51 + ], + [ + 73, + 99 + ], + [ + 100, + 188 + ], + [ + 189, + 284 + ], + [ + 297, + 321 + ], + [ + 330, + 355 + ] + ], + "lines_added": [ + [ + 26, + 42 + ], + [ + 47, + 48 + ], + [ + 76, + 77 + ], + [ + 78, + 79 + ], + [ + 81, + 83 + ], + [ + 89, + 94 + ], + [ + 95, + 96 + ], + [ + 103, + 108 + ], + [ + 112, + 113 + ], + [ + 114, + 117 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 128, + 131 + ], + [ + 132, + 140 + ], + [ + 145, + 148 + ], + [ + 149, + 151 + ], + [ + 155, + 158 + ], + [ + 159, + 161 + ], + [ + 166, + 167 + ], + [ + 168, + 170 + ], + [ + 171, + 173 + ], + [ + 174, + 176 + ], + [ + 177, + 179 + ], + [ + 180, + 181 + ], + [ + 183, + 185 + ], + [ + 192, + 193 + ], + [ + 194, + 196 + ], + [ + 200, + 202 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 223, + 225 + ], + [ + 230, + 231 + ], + [ + 233, + 236 + ], + [ + 237, + 239 + ], + [ + 240, + 243 + ], + [ + 244, + 246 + ], + [ + 247, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 257 + ], + [ + 258, + 260 + ], + [ + 263, + 264 + ], + [ + 269, + 271 + ], + [ + 275, + 279 + ], + [ + 280, + 281 + ], + [ + 300, + 301 + ], + [ + 307, + 309 + ], + [ + 313, + 316 + ], + [ + 317, + 318 + ], + [ + 333, + 334 + ], + [ + 340, + 342 + ], + [ + 347, + 348 + ], + [ + 349, + 352 + ], + [ + 353, + 354 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_flood.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 10 + ], + [ + 36, + 64 + ], + [ + 75, + 89 + ], + [ + 103, + 110 + ], + [ + 114, + 121 + ], + [ + 144, + 151 + ], + [ + 153, + 185 + ], + [ + 187, + 206 + ], + [ + 213, + 336 + ], + [ + 340, + 371 + ], + [ + 372, + 444 + ], + [ + 451, + 459 + ], + [ + 460, + 626 + ], + [ + 633, + 691 + ], + [ + 712, + 743 + ], + [ + 756, + 780 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 6, + 7 + ], + [ + 39, + 40 + ], + [ + 41, + 45 + ], + [ + 46, + 55 + ], + [ + 60, + 61 + ], + [ + 78, + 79 + ], + [ + 85, + 86 + ], + [ + 106, + 107 + ], + [ + 117, + 118 + ], + [ + 147, + 148 + ], + [ + 156, + 157 + ], + [ + 161, + 162 + ], + [ + 165, + 166 + ], + [ + 169, + 170 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 190, + 191 + ], + [ + 194, + 203 + ], + [ + 216, + 217 + ], + [ + 221, + 222 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 228, + 230 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 244, + 246 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 264, + 266 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 276, + 278 + ], + [ + 279, + 281 + ], + [ + 282, + 284 + ], + [ + 285, + 286 + ], + [ + 288, + 290 + ], + [ + 294, + 295 + ], + [ + 297, + 299 + ], + [ + 304, + 308 + ], + [ + 313, + 315 + ], + [ + 316, + 318 + ], + [ + 323, + 324 + ], + [ + 328, + 330 + ], + [ + 331, + 333 + ], + [ + 343, + 344 + ], + [ + 345, + 349 + ], + [ + 351, + 352 + ], + [ + 355, + 356 + ], + [ + 360, + 362 + ], + [ + 363, + 368 + ], + [ + 375, + 378 + ], + [ + 379, + 380 + ], + [ + 383, + 384 + ], + [ + 389, + 400 + ], + [ + 402, + 403 + ], + [ + 408, + 409 + ], + [ + 414, + 415 + ], + [ + 420, + 423 + ], + [ + 424, + 425 + ], + [ + 427, + 428 + ], + [ + 430, + 432 + ], + [ + 436, + 437 + ], + [ + 439, + 441 + ], + [ + 454, + 456 + ], + [ + 463, + 464 + ], + [ + 466, + 467 + ], + [ + 468, + 471 + ], + [ + 473, + 475 + ], + [ + 476, + 478 + ], + [ + 481, + 482 + ], + [ + 485, + 486 + ], + [ + 487, + 492 + ], + [ + 495, + 496 + ], + [ + 497, + 498 + ], + [ + 499, + 500 + ], + [ + 505, + 506 + ], + [ + 508, + 516 + ], + [ + 518, + 521 + ], + [ + 523, + 525 + ], + [ + 527, + 528 + ], + [ + 531, + 532 + ], + [ + 533, + 538 + ], + [ + 539, + 540 + ], + [ + 542, + 545 + ], + [ + 547, + 548 + ], + [ + 549, + 550 + ], + [ + 553, + 554 + ], + [ + 555, + 557 + ], + [ + 562, + 563 + ], + [ + 565, + 568 + ], + [ + 569, + 571 + ], + [ + 572, + 575 + ], + [ + 576, + 578 + ], + [ + 579, + 582 + ], + [ + 583, + 584 + ], + [ + 585, + 588 + ], + [ + 589, + 591 + ], + [ + 592, + 595 + ], + [ + 596, + 598 + ], + [ + 599, + 602 + ], + [ + 603, + 605 + ], + [ + 606, + 609 + ], + [ + 610, + 612 + ], + [ + 613, + 616 + ], + [ + 617, + 619 + ], + [ + 622, + 623 + ], + [ + 636, + 637 + ], + [ + 639, + 641 + ], + [ + 642, + 653 + ], + [ + 656, + 657 + ], + [ + 658, + 659 + ], + [ + 660, + 661 + ], + [ + 666, + 670 + ], + [ + 671, + 672 + ], + [ + 673, + 674 + ], + [ + 677, + 679 + ], + [ + 683, + 686 + ], + [ + 687, + 688 + ], + [ + 715, + 716 + ], + [ + 717, + 718 + ], + [ + 720, + 721 + ], + [ + 722, + 723 + ], + [ + 729, + 731 + ], + [ + 735, + 738 + ], + [ + 739, + 740 + ], + [ + 759, + 760 + ], + [ + 766, + 767 + ], + [ + 772, + 773 + ], + [ + 774, + 777 + ], + [ + 778, + 779 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_image.c", + "line_filter": { + "diff_chunks": [ + [ + 32, + 60 + ], + [ + 80, + 160 + ], + [ + 161, + 204 + ], + [ + 212, + 301 + ], + [ + 309, + 338 + ] + ], + "lines_added": [ + [ + 35, + 51 + ], + [ + 56, + 57 + ], + [ + 83, + 84 + ], + [ + 90, + 107 + ], + [ + 108, + 116 + ], + [ + 118, + 120 + ], + [ + 123, + 125 + ], + [ + 128, + 157 + ], + [ + 164, + 165 + ], + [ + 166, + 168 + ], + [ + 169, + 170 + ], + [ + 173, + 174 + ], + [ + 176, + 178 + ], + [ + 179, + 185 + ], + [ + 186, + 188 + ], + [ + 189, + 192 + ], + [ + 196, + 201 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 221, + 223 + ], + [ + 224, + 229 + ], + [ + 230, + 232 + ], + [ + 233, + 236 + ], + [ + 239, + 241 + ], + [ + 247, + 249 + ], + [ + 252, + 253 + ], + [ + 256, + 257 + ], + [ + 258, + 260 + ], + [ + 265, + 266 + ], + [ + 268, + 271 + ], + [ + 272, + 273 + ], + [ + 274, + 277 + ], + [ + 278, + 280 + ], + [ + 281, + 284 + ], + [ + 285, + 287 + ], + [ + 288, + 291 + ], + [ + 292, + 294 + ], + [ + 297, + 298 + ], + [ + 312, + 313 + ], + [ + 314, + 315 + ], + [ + 319, + 321 + ], + [ + 327, + 328 + ], + [ + 332, + 335 + ], + [ + 336, + 337 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_line.c", + "line_filter": { + "diff_chunks": [ + [ + 26, + 54 + ], + [ + 77, + 90 + ], + [ + 91, + 208 + ], + [ + 212, + 333 + ], + [ + 340, + 366 + ], + [ + 372, + 397 + ] + ], + "lines_added": [ + [ + 29, + 45 + ], + [ + 50, + 51 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 85, + 87 + ], + [ + 94, + 95 + ], + [ + 96, + 99 + ], + [ + 102, + 104 + ], + [ + 105, + 107 + ], + [ + 109, + 111 + ], + [ + 116, + 117 + ], + [ + 121, + 124 + ], + [ + 126, + 127 + ], + [ + 129, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 137 + ], + [ + 140, + 142 + ], + [ + 144, + 146 + ], + [ + 147, + 149 + ], + [ + 151, + 153 + ], + [ + 154, + 156 + ], + [ + 158, + 160 + ], + [ + 162, + 163 + ], + [ + 168, + 170 + ], + [ + 172, + 174 + ], + [ + 176, + 177 + ], + [ + 182, + 184 + ], + [ + 186, + 188 + ], + [ + 190, + 191 + ], + [ + 196, + 198 + ], + [ + 200, + 202 + ], + [ + 204, + 205 + ], + [ + 215, + 216 + ], + [ + 217, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 235, + 237 + ], + [ + 240, + 241 + ], + [ + 242, + 244 + ], + [ + 248, + 250 + ], + [ + 251, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 257, + 259 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 280, + 281 + ], + [ + 283, + 286 + ], + [ + 287, + 289 + ], + [ + 290, + 293 + ], + [ + 294, + 296 + ], + [ + 297, + 300 + ], + [ + 301, + 303 + ], + [ + 304, + 307 + ], + [ + 308, + 310 + ], + [ + 313, + 314 + ], + [ + 318, + 320 + ], + [ + 324, + 328 + ], + [ + 329, + 330 + ], + [ + 343, + 344 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 352, + 354 + ], + [ + 358, + 361 + ], + [ + 362, + 363 + ], + [ + 375, + 376 + ], + [ + 382, + 384 + ], + [ + 389, + 390 + ], + [ + 391, + 394 + ], + [ + 395, + 396 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_mask.c", + "line_filter": { + "diff_chunks": [ + [ + 24, + 52 + ], + [ + 80, + 237 + ], + [ + 239, + 261 + ], + [ + 266, + 273 + ], + [ + 274, + 370 + ], + [ + 378, + 405 + ], + [ + 410, + 435 + ] + ], + "lines_added": [ + [ + 27, + 43 + ], + [ + 48, + 49 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 89, + 102 + ], + [ + 105, + 118 + ], + [ + 121, + 138 + ], + [ + 140, + 142 + ], + [ + 145, + 146 + ], + [ + 150, + 152 + ], + [ + 153, + 160 + ], + [ + 161, + 164 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 172, + 174 + ], + [ + 177, + 178 + ], + [ + 181, + 186 + ], + [ + 187, + 190 + ], + [ + 192, + 194 + ], + [ + 196, + 198 + ], + [ + 200, + 202 + ], + [ + 204, + 206 + ], + [ + 208, + 210 + ], + [ + 212, + 214 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 229, + 230 + ], + [ + 233, + 234 + ], + [ + 242, + 244 + ], + [ + 250, + 258 + ], + [ + 269, + 270 + ], + [ + 277, + 279 + ], + [ + 280, + 283 + ], + [ + 286, + 289 + ], + [ + 295, + 296 + ], + [ + 299, + 300 + ], + [ + 301, + 303 + ], + [ + 305, + 307 + ], + [ + 308, + 311 + ], + [ + 312, + 313 + ], + [ + 316, + 317 + ], + [ + 318, + 320 + ], + [ + 325, + 326 + ], + [ + 328, + 331 + ], + [ + 332, + 333 + ], + [ + 334, + 337 + ], + [ + 338, + 340 + ], + [ + 341, + 344 + ], + [ + 345, + 347 + ], + [ + 350, + 351 + ], + [ + 355, + 357 + ], + [ + 361, + 365 + ], + [ + 366, + 367 + ], + [ + 381, + 383 + ], + [ + 384, + 385 + ], + [ + 391, + 393 + ], + [ + 397, + 400 + ], + [ + 401, + 402 + ], + [ + 413, + 414 + ], + [ + 420, + 422 + ], + [ + 427, + 428 + ], + [ + 429, + 432 + ], + [ + 433, + 434 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_rect.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 17, + 51 + ], + [ + 71, + 94 + ], + [ + 95, + 124 + ], + [ + 127, + 138 + ], + [ + 141, + 230 + ], + [ + 249, + 267 + ], + [ + 277, + 305 + ], + [ + 317, + 333 + ], + [ + 337, + 361 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 20, + 21 + ], + [ + 26, + 27 + ], + [ + 28, + 32 + ], + [ + 33, + 42 + ], + [ + 47, + 48 + ], + [ + 74, + 75 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 86, + 87 + ], + [ + 88, + 91 + ], + [ + 98, + 99 + ], + [ + 101, + 103 + ], + [ + 106, + 107 + ], + [ + 108, + 121 + ], + [ + 130, + 131 + ], + [ + 132, + 135 + ], + [ + 144, + 146 + ], + [ + 150, + 152 + ], + [ + 156, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 164 + ], + [ + 169, + 170 + ], + [ + 172, + 175 + ], + [ + 176, + 178 + ], + [ + 179, + 182 + ], + [ + 183, + 185 + ], + [ + 186, + 189 + ], + [ + 190, + 192 + ], + [ + 193, + 196 + ], + [ + 197, + 199 + ], + [ + 200, + 203 + ], + [ + 204, + 206 + ], + [ + 209, + 210 + ], + [ + 214, + 217 + ], + [ + 221, + 225 + ], + [ + 226, + 227 + ], + [ + 252, + 254 + ], + [ + 258, + 262 + ], + [ + 263, + 264 + ], + [ + 280, + 281 + ], + [ + 287, + 289 + ], + [ + 294, + 295 + ], + [ + 296, + 300 + ], + [ + 301, + 302 + ], + [ + 320, + 321 + ], + [ + 325, + 328 + ], + [ + 329, + 330 + ], + [ + 340, + 341 + ], + [ + 347, + 348 + ], + [ + 353, + 354 + ], + [ + 355, + 358 + ], + [ + 359, + 360 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_smudge.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 24, + 52 + ], + [ + 77, + 92 + ], + [ + 94, + 110 + ], + [ + 116, + 248 + ], + [ + 255, + 278 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 27, + 28 + ], + [ + 29, + 33 + ], + [ + 34, + 43 + ], + [ + 48, + 49 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 85, + 86 + ], + [ + 87, + 89 + ], + [ + 97, + 100 + ], + [ + 105, + 107 + ], + [ + 119, + 120 + ], + [ + 121, + 124 + ], + [ + 125, + 127 + ], + [ + 130, + 132 + ], + [ + 134, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 142 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 149 + ], + [ + 150, + 151 + ], + [ + 153, + 155 + ], + [ + 156, + 157 + ], + [ + 162, + 193 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 204, + 206 + ], + [ + 211, + 212 + ], + [ + 214, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 224 + ], + [ + 225, + 227 + ], + [ + 228, + 231 + ], + [ + 232, + 234 + ], + [ + 235, + 238 + ], + [ + 239, + 241 + ], + [ + 244, + 245 + ], + [ + 258, + 259 + ], + [ + 265, + 267 + ], + [ + 271, + 275 + ], + [ + 276, + 277 + ] + ] + } + }, + { + "filename": "libvips/draw/drawink.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 45, + 110 + ], + [ + 111, + 138 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 48, + 49 + ], + [ + 51, + 52 + ], + [ + 53, + 56 + ], + [ + 58, + 61 + ], + [ + 63, + 65 + ], + [ + 66, + 72 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 79, + 81 + ], + [ + 86, + 87 + ], + [ + 89, + 92 + ], + [ + 93, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 106, + 107 + ], + [ + 114, + 129 + ], + [ + 131, + 133 + ], + [ + 136, + 137 + ] + ] + } + }, + { + "filename": "libvips/draw/drawink.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 67, + 126 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 70, + 71 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 89, + 91 + ], + [ + 94, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 115, + 117 + ], + [ + 119, + 120 + ], + [ + 122, + 123 + ] + ] + } + }, + { + "filename": "libvips/draw/pdraw.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 69 + ], + [ + 73, + 80 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 51 + ], + [ + 58, + 59 + ], + [ + 65, + 66 + ], + [ + 76, + 77 + ] + ] + } + }, + { + "filename": "libvips/foreign/analyze2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 16, + 44 + ], + [ + 71, + 234 + ], + [ + 235, + 289 + ], + [ + 293, + 339 + ], + [ + 345, + 374 + ], + [ + 375, + 387 + ], + [ + 417, + 477 + ], + [ + 480, + 487 + ], + [ + 490, + 521 + ], + [ + 523, + 596 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 19, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 35 + ], + [ + 40, + 41 + ], + [ + 74, + 75 + ], + [ + 81, + 82 + ], + [ + 83, + 85 + ], + [ + 88, + 216 + ], + [ + 220, + 221 + ], + [ + 225, + 226 + ], + [ + 229, + 231 + ], + [ + 238, + 239 + ], + [ + 243, + 244 + ], + [ + 245, + 247 + ], + [ + 251, + 253 + ], + [ + 255, + 256 + ], + [ + 260, + 261 + ], + [ + 264, + 266 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 273, + 274 + ], + [ + 277, + 278 + ], + [ + 280, + 282 + ], + [ + 285, + 286 + ], + [ + 296, + 297 + ], + [ + 301, + 303 + ], + [ + 304, + 309 + ], + [ + 313, + 314 + ], + [ + 315, + 316 + ], + [ + 318, + 319 + ], + [ + 321, + 322 + ], + [ + 324, + 325 + ], + [ + 326, + 329 + ], + [ + 332, + 336 + ], + [ + 348, + 353 + ], + [ + 355, + 356 + ], + [ + 361, + 363 + ], + [ + 366, + 371 + ], + [ + 378, + 379 + ], + [ + 383, + 384 + ], + [ + 420, + 423 + ], + [ + 426, + 430 + ], + [ + 432, + 433 + ], + [ + 436, + 437 + ], + [ + 440, + 442 + ], + [ + 443, + 445 + ], + [ + 446, + 449 + ], + [ + 452, + 455 + ], + [ + 458, + 461 + ], + [ + 463, + 467 + ], + [ + 470, + 474 + ], + [ + 483, + 484 + ], + [ + 493, + 496 + ], + [ + 498, + 499 + ], + [ + 500, + 502 + ], + [ + 504, + 505 + ], + [ + 508, + 509 + ], + [ + 511, + 512 + ], + [ + 513, + 514 + ], + [ + 517, + 518 + ], + [ + 526, + 529 + ], + [ + 531, + 532 + ], + [ + 534, + 537 + ], + [ + 539, + 544 + ], + [ + 545, + 546 + ], + [ + 547, + 549 + ], + [ + 550, + 551 + ], + [ + 554, + 555 + ], + [ + 560, + 562 + ], + [ + 566, + 570 + ], + [ + 571, + 572 + ], + [ + 574, + 575 + ], + [ + 577, + 582 + ], + [ + 584, + 589 + ], + [ + 590, + 591 + ], + [ + 592, + 593 + ] + ] + } + }, + { + "filename": "libvips/foreign/analyzeload.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 57, + 116 + ], + [ + 117, + 126 + ], + [ + 131, + 153 + ], + [ + 171, + 185 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 61 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 78, + 79 + ], + [ + 82, + 83 + ], + [ + 86, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ], + [ + 99, + 101 + ], + [ + 102, + 103 + ], + [ + 108, + 109 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 134, + 135 + ], + [ + 140, + 146 + ], + [ + 149, + 150 + ], + [ + 174, + 175 + ], + [ + 179, + 182 + ], + [ + 183, + 184 + ] + ] + } + }, + { + "filename": "libvips/foreign/cairo.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 40, + 95 + ], + [ + 97, + 129 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 43, + 44 + ], + [ + 47, + 49 + ], + [ + 51, + 52 + ], + [ + 53, + 56 + ], + [ + 57, + 69 + ], + [ + 75, + 76 + ], + [ + 79, + 81 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 116 + ], + [ + 117, + 118 + ], + [ + 119, + 125 + ], + [ + 126, + 128 + ] + ] + } + }, + { + "filename": "libvips/foreign/cgifsave.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 57, + 66 + ], + [ + 90, + 97 + ], + [ + 102, + 110 + ], + [ + 113, + 120 + ], + [ + 128, + 135 + ], + [ + 141, + 203 + ], + [ + 205, + 217 + ], + [ + 223, + 250 + ], + [ + 251, + 270 + ], + [ + 273, + 296 + ], + [ + 299, + 326 + ], + [ + 331, + 387 + ], + [ + 390, + 402 + ], + [ + 406, + 426 + ], + [ + 430, + 440 + ], + [ + 445, + 453 + ], + [ + 456, + 464 + ], + [ + 466, + 520 + ], + [ + 522, + 543 + ], + [ + 544, + 559 + ], + [ + 560, + 665 + ], + [ + 667, + 694 + ], + [ + 695, + 724 + ], + [ + 726, + 767 + ], + [ + 775, + 784 + ], + [ + 787, + 794 + ], + [ + 795, + 853 + ], + [ + 866, + 896 + ], + [ + 898, + 914 + ], + [ + 918, + 946 + ], + [ + 948, + 964 + ], + [ + 968, + 1004 + ], + [ + 1006, + 1022 + ], + [ + 1067, + 1083 + ], + [ + 1108, + 1115 + ], + [ + 1116, + 1139 + ], + [ + 1159, + 1173 + ] + ], + "lines_added": [ + [ + 10, + 11 + ], + [ + 12, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 26 + ], + [ + 30, + 32 + ], + [ + 60, + 63 + ], + [ + 93, + 94 + ], + [ + 105, + 107 + ], + [ + 116, + 117 + ], + [ + 131, + 132 + ], + [ + 144, + 146 + ], + [ + 148, + 149 + ], + [ + 152, + 154 + ], + [ + 155, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 162 + ], + [ + 163, + 166 + ], + [ + 167, + 168 + ], + [ + 170, + 172 + ], + [ + 173, + 174 + ], + [ + 175, + 177 + ], + [ + 179, + 180 + ], + [ + 186, + 188 + ], + [ + 193, + 194 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 208, + 209 + ], + [ + 213, + 214 + ], + [ + 226, + 228 + ], + [ + 233, + 235 + ], + [ + 237, + 238 + ], + [ + 240, + 242 + ], + [ + 245, + 247 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 266, + 267 + ], + [ + 276, + 277 + ], + [ + 282, + 284 + ], + [ + 285, + 287 + ], + [ + 290, + 291 + ], + [ + 292, + 293 + ], + [ + 302, + 303 + ], + [ + 304, + 305 + ], + [ + 306, + 307 + ], + [ + 310, + 314 + ], + [ + 318, + 319 + ], + [ + 320, + 323 + ], + [ + 334, + 344 + ], + [ + 346, + 359 + ], + [ + 362, + 365 + ], + [ + 366, + 370 + ], + [ + 374, + 375 + ], + [ + 378, + 381 + ], + [ + 382, + 384 + ], + [ + 393, + 396 + ], + [ + 397, + 399 + ], + [ + 409, + 410 + ], + [ + 415, + 416 + ], + [ + 417, + 418 + ], + [ + 422, + 423 + ], + [ + 433, + 435 + ], + [ + 436, + 437 + ], + [ + 448, + 450 + ], + [ + 459, + 461 + ], + [ + 469, + 471 + ], + [ + 472, + 474 + ], + [ + 476, + 479 + ], + [ + 485, + 486 + ], + [ + 490, + 492 + ], + [ + 495, + 501 + ], + [ + 503, + 504 + ], + [ + 507, + 508 + ], + [ + 509, + 511 + ], + [ + 512, + 514 + ], + [ + 516, + 517 + ], + [ + 525, + 526 + ], + [ + 531, + 533 + ], + [ + 536, + 537 + ], + [ + 539, + 540 + ], + [ + 547, + 549 + ], + [ + 551, + 554 + ], + [ + 555, + 556 + ], + [ + 563, + 564 + ], + [ + 566, + 570 + ], + [ + 573, + 574 + ], + [ + 580, + 582 + ], + [ + 584, + 586 + ], + [ + 592, + 593 + ], + [ + 594, + 595 + ], + [ + 601, + 602 + ], + [ + 604, + 605 + ], + [ + 606, + 607 + ], + [ + 609, + 612 + ], + [ + 613, + 618 + ], + [ + 619, + 622 + ], + [ + 625, + 627 + ], + [ + 628, + 629 + ], + [ + 632, + 633 + ], + [ + 636, + 637 + ], + [ + 638, + 639 + ], + [ + 640, + 642 + ], + [ + 647, + 650 + ], + [ + 655, + 660 + ], + [ + 661, + 662 + ], + [ + 670, + 675 + ], + [ + 679, + 681 + ], + [ + 684, + 686 + ], + [ + 689, + 691 + ], + [ + 698, + 702 + ], + [ + 706, + 716 + ], + [ + 719, + 721 + ], + [ + 729, + 731 + ], + [ + 732, + 740 + ], + [ + 742, + 743 + ], + [ + 748, + 751 + ], + [ + 752, + 753 + ], + [ + 754, + 757 + ], + [ + 758, + 759 + ], + [ + 760, + 762 + ], + [ + 763, + 764 + ], + [ + 778, + 779 + ], + [ + 780, + 781 + ], + [ + 790, + 791 + ], + [ + 798, + 801 + ], + [ + 802, + 804 + ], + [ + 805, + 808 + ], + [ + 809, + 811 + ], + [ + 812, + 815 + ], + [ + 816, + 818 + ], + [ + 819, + 822 + ], + [ + 823, + 825 + ], + [ + 826, + 829 + ], + [ + 830, + 832 + ], + [ + 833, + 836 + ], + [ + 837, + 839 + ], + [ + 840, + 843 + ], + [ + 844, + 846 + ], + [ + 849, + 850 + ], + [ + 869, + 871 + ], + [ + 873, + 874 + ], + [ + 876, + 877 + ], + [ + 880, + 881 + ], + [ + 882, + 884 + ], + [ + 885, + 886 + ], + [ + 889, + 891 + ], + [ + 892, + 893 + ], + [ + 901, + 904 + ], + [ + 905, + 907 + ], + [ + 910, + 911 + ], + [ + 921, + 923 + ], + [ + 925, + 926 + ], + [ + 930, + 932 + ], + [ + 933, + 935 + ], + [ + 936, + 937 + ], + [ + 940, + 941 + ], + [ + 942, + 943 + ], + [ + 951, + 954 + ], + [ + 955, + 957 + ], + [ + 960, + 961 + ], + [ + 971, + 973 + ], + [ + 975, + 976 + ], + [ + 978, + 979 + ], + [ + 983, + 985 + ], + [ + 986, + 988 + ], + [ + 989, + 992 + ], + [ + 993, + 994 + ], + [ + 997, + 999 + ], + [ + 1000, + 1001 + ], + [ + 1009, + 1012 + ], + [ + 1013, + 1015 + ], + [ + 1018, + 1019 + ], + [ + 1070, + 1071 + ], + [ + 1075, + 1078 + ], + [ + 1079, + 1080 + ], + [ + 1111, + 1112 + ], + [ + 1119, + 1122 + ], + [ + 1123, + 1126 + ], + [ + 1129, + 1130 + ], + [ + 1132, + 1133 + ], + [ + 1135, + 1136 + ], + [ + 1162, + 1163 + ], + [ + 1167, + 1170 + ], + [ + 1171, + 1172 + ] + ] + } + }, + { + "filename": "libvips/foreign/csvload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 98, + 139 + ], + [ + 140, + 179 + ], + [ + 180, + 214 + ], + [ + 218, + 229 + ], + [ + 231, + 266 + ], + [ + 270, + 277 + ], + [ + 278, + 325 + ], + [ + 329, + 346 + ], + [ + 348, + 388 + ], + [ + 390, + 419 + ], + [ + 421, + 449 + ], + [ + 450, + 475 + ], + [ + 476, + 486 + ], + [ + 488, + 529 + ], + [ + 536, + 566 + ], + [ + 568, + 577 + ], + [ + 583, + 602 + ], + [ + 608, + 650 + ], + [ + 656, + 672 + ], + [ + 683, + 709 + ], + [ + 713, + 729 + ], + [ + 739, + 760 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 101, + 103 + ], + [ + 105, + 106 + ], + [ + 109, + 112 + ], + [ + 113, + 114 + ], + [ + 117, + 118 + ], + [ + 124, + 126 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 143, + 145 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 159, + 161 + ], + [ + 162, + 163 + ], + [ + 165, + 169 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 175, + 176 + ], + [ + 183, + 185 + ], + [ + 186, + 187 + ], + [ + 189, + 190 + ], + [ + 193, + 196 + ], + [ + 197, + 199 + ], + [ + 200, + 202 + ], + [ + 203, + 204 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 234, + 237 + ], + [ + 238, + 239 + ], + [ + 241, + 242 + ], + [ + 244, + 246 + ], + [ + 249, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 255 + ], + [ + 259, + 260 + ], + [ + 262, + 263 + ], + [ + 273, + 274 + ], + [ + 281, + 285 + ], + [ + 286, + 289 + ], + [ + 290, + 291 + ], + [ + 293, + 296 + ], + [ + 297, + 299 + ], + [ + 301, + 303 + ], + [ + 305, + 309 + ], + [ + 310, + 311 + ], + [ + 312, + 314 + ], + [ + 315, + 316 + ], + [ + 319, + 320 + ], + [ + 321, + 322 + ], + [ + 332, + 335 + ], + [ + 338, + 343 + ], + [ + 351, + 354 + ], + [ + 356, + 358 + ], + [ + 361, + 363 + ], + [ + 364, + 365 + ], + [ + 367, + 374 + ], + [ + 375, + 377 + ], + [ + 378, + 379 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 393, + 396 + ], + [ + 399, + 404 + ], + [ + 406, + 413 + ], + [ + 415, + 416 + ], + [ + 424, + 425 + ], + [ + 426, + 427 + ], + [ + 430, + 436 + ], + [ + 437, + 442 + ], + [ + 444, + 446 + ], + [ + 453, + 455 + ], + [ + 458, + 461 + ], + [ + 463, + 464 + ], + [ + 467, + 468 + ], + [ + 469, + 470 + ], + [ + 471, + 472 + ], + [ + 479, + 480 + ], + [ + 482, + 483 + ], + [ + 491, + 494 + ], + [ + 495, + 497 + ], + [ + 498, + 501 + ], + [ + 502, + 504 + ], + [ + 505, + 508 + ], + [ + 509, + 511 + ], + [ + 512, + 515 + ], + [ + 516, + 518 + ], + [ + 521, + 522 + ], + [ + 524, + 526 + ], + [ + 539, + 541 + ], + [ + 543, + 544 + ], + [ + 545, + 546 + ], + [ + 549, + 550 + ], + [ + 554, + 558 + ], + [ + 559, + 561 + ], + [ + 562, + 563 + ], + [ + 571, + 572 + ], + [ + 573, + 574 + ], + [ + 586, + 587 + ], + [ + 589, + 592 + ], + [ + 593, + 595 + ], + [ + 598, + 599 + ], + [ + 611, + 613 + ], + [ + 615, + 616 + ], + [ + 620, + 621 + ], + [ + 622, + 623 + ], + [ + 625, + 627 + ], + [ + 628, + 629 + ], + [ + 632, + 633 + ], + [ + 638, + 639 + ], + [ + 642, + 643 + ], + [ + 644, + 645 + ], + [ + 646, + 647 + ], + [ + 659, + 665 + ], + [ + 668, + 669 + ], + [ + 686, + 687 + ], + [ + 688, + 689 + ], + [ + 690, + 691 + ], + [ + 695, + 696 + ], + [ + 698, + 699 + ], + [ + 701, + 702 + ], + [ + 705, + 706 + ], + [ + 716, + 717 + ], + [ + 721, + 724 + ], + [ + 725, + 726 + ], + [ + 742, + 743 + ], + [ + 749, + 750 + ], + [ + 754, + 757 + ], + [ + 758, + 759 + ] + ] + } + }, + { + "filename": "libvips/foreign/csvsave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 61, + 198 + ], + [ + 200, + 209 + ], + [ + 212, + 267 + ], + [ + 269, + 285 + ], + [ + 290, + 317 + ], + [ + 319, + 341 + ], + [ + 344, + 355 + ], + [ + 356, + 377 + ], + [ + 385, + 399 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 64, + 66 + ], + [ + 68, + 69 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 77, + 87 + ], + [ + 88, + 100 + ], + [ + 101, + 119 + ], + [ + 121, + 122 + ], + [ + 128, + 164 + ], + [ + 167, + 169 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 179, + 180 + ], + [ + 181, + 183 + ], + [ + 184, + 187 + ], + [ + 188, + 190 + ], + [ + 191, + 193 + ], + [ + 194, + 195 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 215, + 216 + ], + [ + 222, + 225 + ], + [ + 226, + 228 + ], + [ + 231, + 232 + ], + [ + 233, + 234 + ], + [ + 239, + 240 + ], + [ + 244, + 246 + ], + [ + 248, + 249 + ], + [ + 253, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 272, + 278 + ], + [ + 281, + 282 + ], + [ + 293, + 295 + ], + [ + 297, + 298 + ], + [ + 302, + 305 + ], + [ + 307, + 308 + ], + [ + 311, + 312 + ], + [ + 313, + 314 + ], + [ + 322, + 328 + ], + [ + 331, + 332 + ], + [ + 337, + 338 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 351, + 352 + ], + [ + 359, + 360 + ], + [ + 364, + 367 + ], + [ + 368, + 369 + ], + [ + 373, + 374 + ], + [ + 388, + 389 + ], + [ + 393, + 396 + ], + [ + 397, + 398 + ] + ] + } + }, + { + "filename": "libvips/foreign/dbh.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 20, + 91 + ], + [ + 95, + 106 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 23, + 44 + ], + [ + 45, + 61 + ], + [ + 62, + 81 + ], + [ + 82, + 88 + ], + [ + 98, + 106 + ] + ] + } + }, + { + "filename": "libvips/foreign/dzsave.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 12 + ], + [ + 16, + 23 + ], + [ + 54, + 65 + ], + [ + 100, + 128 + ], + [ + 129, + 138 + ], + [ + 139, + 165 + ], + [ + 195, + 315 + ], + [ + 325, + 406 + ], + [ + 412, + 428 + ], + [ + 438, + 445 + ], + [ + 453, + 460 + ], + [ + 465, + 525 + ], + [ + 529, + 590 + ], + [ + 591, + 603 + ], + [ + 609, + 660 + ], + [ + 665, + 673 + ], + [ + 680, + 687 + ], + [ + 690, + 708 + ], + [ + 723, + 730 + ], + [ + 731, + 749 + ], + [ + 761, + 775 + ], + [ + 777, + 802 + ], + [ + 804, + 816 + ], + [ + 819, + 839 + ], + [ + 842, + 860 + ], + [ + 863, + 978 + ], + [ + 979, + 1000 + ], + [ + 1004, + 1031 + ], + [ + 1035, + 1049 + ], + [ + 1052, + 1059 + ], + [ + 1063, + 1091 + ], + [ + 1092, + 1171 + ], + [ + 1174, + 1226 + ], + [ + 1227, + 1260 + ], + [ + 1262, + 1412 + ], + [ + 1421, + 1428 + ], + [ + 1429, + 1548 + ], + [ + 1567, + 1590 + ], + [ + 1593, + 1600 + ], + [ + 1602, + 1622 + ], + [ + 1629, + 1669 + ], + [ + 1670, + 1713 + ], + [ + 1718, + 1759 + ], + [ + 1763, + 1791 + ], + [ + 1792, + 1824 + ], + [ + 1826, + 1954 + ], + [ + 1956, + 1988 + ], + [ + 1990, + 2016 + ], + [ + 2021, + 2049 + ], + [ + 2051, + 2058 + ], + [ + 2062, + 2073 + ], + [ + 2075, + 2093 + ], + [ + 2094, + 2101 + ], + [ + 2103, + 2124 + ], + [ + 2129, + 2208 + ], + [ + 2211, + 2236 + ], + [ + 2237, + 2247 + ], + [ + 2252, + 2382 + ], + [ + 2385, + 2528 + ], + [ + 2529, + 2630 + ], + [ + 2647, + 2656 + ], + [ + 2659, + 2666 + ], + [ + 2668, + 2815 + ], + [ + 2817, + 2870 + ], + [ + 2877, + 2929 + ], + [ + 2934, + 2987 + ], + [ + 2993, + 3013 + ], + [ + 3020, + 3038 + ], + [ + 3044, + 3051 + ], + [ + 3058, + 3094 + ], + [ + 3096, + 3108 + ], + [ + 3110, + 3120 + ], + [ + 3124, + 3160 + ], + [ + 3161, + 3173 + ], + [ + 3182, + 3196 + ] + ], + "lines_added": [ + [ + 6, + 9 + ], + [ + 19, + 20 + ], + [ + 57, + 58 + ], + [ + 61, + 62 + ], + [ + 103, + 104 + ], + [ + 105, + 109 + ], + [ + 110, + 119 + ], + [ + 124, + 125 + ], + [ + 132, + 135 + ], + [ + 142, + 143 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 150, + 151 + ], + [ + 156, + 159 + ], + [ + 161, + 162 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 205, + 206 + ], + [ + 208, + 209 + ], + [ + 211, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 218, + 220 + ], + [ + 221, + 223 + ], + [ + 224, + 225 + ], + [ + 228, + 229 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 234, + 235 + ], + [ + 238, + 240 + ], + [ + 241, + 242 + ], + [ + 243, + 245 + ], + [ + 246, + 247 + ], + [ + 250, + 251 + ], + [ + 255, + 256 + ], + [ + 260, + 270 + ], + [ + 274, + 277 + ], + [ + 280, + 281 + ], + [ + 285, + 286 + ], + [ + 290, + 291 + ], + [ + 292, + 294 + ], + [ + 295, + 296 + ], + [ + 297, + 300 + ], + [ + 303, + 304 + ], + [ + 307, + 308 + ], + [ + 309, + 310 + ], + [ + 311, + 312 + ], + [ + 328, + 329 + ], + [ + 331, + 332 + ], + [ + 333, + 334 + ], + [ + 337, + 338 + ], + [ + 341, + 342 + ], + [ + 343, + 344 + ], + [ + 347, + 349 + ], + [ + 352, + 353 + ], + [ + 354, + 360 + ], + [ + 362, + 366 + ], + [ + 367, + 368 + ], + [ + 371, + 372 + ], + [ + 374, + 375 + ], + [ + 378, + 379 + ], + [ + 380, + 383 + ], + [ + 384, + 387 + ], + [ + 388, + 389 + ], + [ + 392, + 393 + ], + [ + 398, + 399 + ], + [ + 400, + 403 + ], + [ + 415, + 416 + ], + [ + 420, + 423 + ], + [ + 424, + 425 + ], + [ + 441, + 442 + ], + [ + 456, + 457 + ], + [ + 468, + 469 + ], + [ + 470, + 471 + ], + [ + 473, + 474 + ], + [ + 477, + 478 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 487, + 493 + ], + [ + 495, + 496 + ], + [ + 498, + 504 + ], + [ + 506, + 507 + ], + [ + 509, + 512 + ], + [ + 513, + 514 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 532, + 533 + ], + [ + 536, + 537 + ], + [ + 538, + 540 + ], + [ + 541, + 542 + ], + [ + 547, + 548 + ], + [ + 549, + 552 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ], + [ + 561, + 562 + ], + [ + 564, + 565 + ], + [ + 571, + 574 + ], + [ + 576, + 577 + ], + [ + 578, + 581 + ], + [ + 582, + 583 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 594, + 595 + ], + [ + 599, + 600 + ], + [ + 612, + 614 + ], + [ + 615, + 619 + ], + [ + 620, + 622 + ], + [ + 623, + 624 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 629, + 630 + ], + [ + 632, + 633 + ], + [ + 637, + 639 + ], + [ + 643, + 644 + ], + [ + 650, + 651 + ], + [ + 653, + 655 + ], + [ + 656, + 657 + ], + [ + 668, + 670 + ], + [ + 683, + 684 + ], + [ + 693, + 694 + ], + [ + 697, + 699 + ], + [ + 700, + 702 + ], + [ + 703, + 705 + ], + [ + 726, + 727 + ], + [ + 734, + 735 + ], + [ + 740, + 743 + ], + [ + 745, + 746 + ], + [ + 764, + 765 + ], + [ + 771, + 772 + ], + [ + 780, + 781 + ], + [ + 782, + 783 + ], + [ + 784, + 785 + ], + [ + 786, + 787 + ], + [ + 791, + 792 + ], + [ + 798, + 799 + ], + [ + 811, + 813 + ], + [ + 822, + 823 + ], + [ + 824, + 825 + ], + [ + 827, + 828 + ], + [ + 830, + 831 + ], + [ + 835, + 836 + ], + [ + 845, + 846 + ], + [ + 848, + 849 + ], + [ + 853, + 855 + ], + [ + 856, + 857 + ], + [ + 866, + 868 + ], + [ + 872, + 878 + ], + [ + 879, + 880 + ], + [ + 883, + 884 + ], + [ + 885, + 891 + ], + [ + 892, + 893 + ], + [ + 897, + 898 + ], + [ + 900, + 901 + ], + [ + 903, + 905 + ], + [ + 906, + 909 + ], + [ + 911, + 912 + ], + [ + 913, + 915 + ], + [ + 916, + 919 + ], + [ + 923, + 924 + ], + [ + 925, + 926 + ], + [ + 927, + 928 + ], + [ + 933, + 934 + ], + [ + 935, + 938 + ], + [ + 939, + 940 + ], + [ + 943, + 944 + ], + [ + 947, + 948 + ], + [ + 949, + 952 + ], + [ + 953, + 957 + ], + [ + 958, + 959 + ], + [ + 961, + 962 + ], + [ + 964, + 965 + ], + [ + 967, + 969 + ], + [ + 970, + 972 + ], + [ + 974, + 975 + ], + [ + 982, + 983 + ], + [ + 984, + 985 + ], + [ + 987, + 988 + ], + [ + 993, + 994 + ], + [ + 996, + 997 + ], + [ + 1007, + 1011 + ], + [ + 1015, + 1017 + ], + [ + 1021, + 1023 + ], + [ + 1024, + 1025 + ], + [ + 1026, + 1028 + ], + [ + 1038, + 1039 + ], + [ + 1040, + 1043 + ], + [ + 1045, + 1046 + ], + [ + 1055, + 1056 + ], + [ + 1066, + 1068 + ], + [ + 1072, + 1073 + ], + [ + 1078, + 1079 + ], + [ + 1080, + 1081 + ], + [ + 1083, + 1088 + ], + [ + 1095, + 1106 + ], + [ + 1108, + 1109 + ], + [ + 1112, + 1113 + ], + [ + 1118, + 1120 + ], + [ + 1121, + 1123 + ], + [ + 1125, + 1138 + ], + [ + 1139, + 1141 + ], + [ + 1142, + 1143 + ], + [ + 1146, + 1147 + ], + [ + 1150, + 1151 + ], + [ + 1152, + 1155 + ], + [ + 1158, + 1159 + ], + [ + 1160, + 1162 + ], + [ + 1163, + 1164 + ], + [ + 1167, + 1168 + ], + [ + 1177, + 1178 + ], + [ + 1183, + 1185 + ], + [ + 1186, + 1188 + ], + [ + 1189, + 1193 + ], + [ + 1194, + 1198 + ], + [ + 1199, + 1201 + ], + [ + 1203, + 1204 + ], + [ + 1205, + 1208 + ], + [ + 1209, + 1210 + ], + [ + 1212, + 1213 + ], + [ + 1214, + 1215 + ], + [ + 1216, + 1217 + ], + [ + 1222, + 1223 + ], + [ + 1230, + 1231 + ], + [ + 1235, + 1236 + ], + [ + 1237, + 1239 + ], + [ + 1240, + 1244 + ], + [ + 1245, + 1246 + ], + [ + 1247, + 1248 + ], + [ + 1249, + 1250 + ], + [ + 1252, + 1254 + ], + [ + 1256, + 1257 + ], + [ + 1265, + 1266 + ], + [ + 1267, + 1269 + ], + [ + 1270, + 1271 + ], + [ + 1273, + 1274 + ], + [ + 1277, + 1278 + ], + [ + 1281, + 1282 + ], + [ + 1288, + 1289 + ], + [ + 1295, + 1296 + ], + [ + 1298, + 1299 + ], + [ + 1300, + 1302 + ], + [ + 1303, + 1307 + ], + [ + 1309, + 1310 + ], + [ + 1313, + 1315 + ], + [ + 1316, + 1317 + ], + [ + 1318, + 1321 + ], + [ + 1322, + 1324 + ], + [ + 1325, + 1327 + ], + [ + 1328, + 1329 + ], + [ + 1332, + 1333 + ], + [ + 1339, + 1341 + ], + [ + 1345, + 1348 + ], + [ + 1349, + 1350 + ], + [ + 1351, + 1354 + ], + [ + 1355, + 1356 + ], + [ + 1357, + 1358 + ], + [ + 1361, + 1363 + ], + [ + 1369, + 1370 + ], + [ + 1372, + 1373 + ], + [ + 1374, + 1375 + ], + [ + 1376, + 1378 + ], + [ + 1381, + 1384 + ], + [ + 1386, + 1387 + ], + [ + 1388, + 1390 + ], + [ + 1393, + 1395 + ], + [ + 1398, + 1407 + ], + [ + 1408, + 1409 + ], + [ + 1424, + 1425 + ], + [ + 1432, + 1438 + ], + [ + 1439, + 1440 + ], + [ + 1441, + 1443 + ], + [ + 1444, + 1445 + ], + [ + 1446, + 1448 + ], + [ + 1449, + 1450 + ], + [ + 1453, + 1454 + ], + [ + 1460, + 1462 + ], + [ + 1463, + 1467 + ], + [ + 1468, + 1469 + ], + [ + 1470, + 1471 + ], + [ + 1474, + 1476 + ], + [ + 1479, + 1480 + ], + [ + 1486, + 1487 + ], + [ + 1490, + 1491 + ], + [ + 1493, + 1495 + ], + [ + 1496, + 1498 + ], + [ + 1499, + 1502 + ], + [ + 1503, + 1504 + ], + [ + 1506, + 1507 + ], + [ + 1508, + 1509 + ], + [ + 1511, + 1512 + ], + [ + 1515, + 1516 + ], + [ + 1519, + 1521 + ], + [ + 1522, + 1523 + ], + [ + 1528, + 1529 + ], + [ + 1532, + 1533 + ], + [ + 1538, + 1539 + ], + [ + 1540, + 1541 + ], + [ + 1544, + 1545 + ], + [ + 1570, + 1571 + ], + [ + 1572, + 1573 + ], + [ + 1574, + 1580 + ], + [ + 1585, + 1587 + ], + [ + 1596, + 1597 + ], + [ + 1605, + 1606 + ], + [ + 1612, + 1613 + ], + [ + 1615, + 1616 + ], + [ + 1618, + 1619 + ], + [ + 1632, + 1633 + ], + [ + 1634, + 1635 + ], + [ + 1640, + 1641 + ], + [ + 1646, + 1647 + ], + [ + 1651, + 1652 + ], + [ + 1658, + 1659 + ], + [ + 1660, + 1663 + ], + [ + 1664, + 1666 + ], + [ + 1673, + 1674 + ], + [ + 1677, + 1678 + ], + [ + 1679, + 1680 + ], + [ + 1686, + 1689 + ], + [ + 1694, + 1695 + ], + [ + 1699, + 1703 + ], + [ + 1704, + 1705 + ], + [ + 1709, + 1710 + ], + [ + 1721, + 1736 + ], + [ + 1740, + 1742 + ], + [ + 1743, + 1744 + ], + [ + 1746, + 1748 + ], + [ + 1751, + 1754 + ], + [ + 1755, + 1756 + ], + [ + 1766, + 1767 + ], + [ + 1769, + 1770 + ], + [ + 1772, + 1774 + ], + [ + 1779, + 1780 + ], + [ + 1781, + 1782 + ], + [ + 1787, + 1788 + ], + [ + 1795, + 1798 + ], + [ + 1800, + 1802 + ], + [ + 1803, + 1808 + ], + [ + 1814, + 1815 + ], + [ + 1816, + 1817 + ], + [ + 1820, + 1821 + ], + [ + 1829, + 1830 + ], + [ + 1832, + 1833 + ], + [ + 1835, + 1840 + ], + [ + 1841, + 1843 + ], + [ + 1844, + 1846 + ], + [ + 1851, + 1852 + ], + [ + 1853, + 1856 + ], + [ + 1858, + 1859 + ], + [ + 1862, + 1863 + ], + [ + 1866, + 1870 + ], + [ + 1871, + 1874 + ], + [ + 1876, + 1879 + ], + [ + 1881, + 1882 + ], + [ + 1886, + 1892 + ], + [ + 1893, + 1894 + ], + [ + 1900, + 1901 + ], + [ + 1902, + 1904 + ], + [ + 1905, + 1906 + ], + [ + 1907, + 1908 + ], + [ + 1909, + 1912 + ], + [ + 1913, + 1914 + ], + [ + 1916, + 1918 + ], + [ + 1920, + 1921 + ], + [ + 1923, + 1924 + ], + [ + 1926, + 1927 + ], + [ + 1929, + 1930 + ], + [ + 1934, + 1935 + ], + [ + 1937, + 1943 + ], + [ + 1944, + 1945 + ], + [ + 1947, + 1948 + ], + [ + 1950, + 1951 + ], + [ + 1959, + 1960 + ], + [ + 1965, + 1966 + ], + [ + 1967, + 1969 + ], + [ + 1974, + 1977 + ], + [ + 1979, + 1980 + ], + [ + 1984, + 1985 + ], + [ + 1993, + 1994 + ], + [ + 1996, + 1998 + ], + [ + 2000, + 2002 + ], + [ + 2006, + 2007 + ], + [ + 2012, + 2013 + ], + [ + 2024, + 2026 + ], + [ + 2031, + 2032 + ], + [ + 2036, + 2037 + ], + [ + 2043, + 2044 + ], + [ + 2045, + 2046 + ], + [ + 2054, + 2055 + ], + [ + 2065, + 2066 + ], + [ + 2068, + 2070 + ], + [ + 2078, + 2082 + ], + [ + 2085, + 2086 + ], + [ + 2088, + 2090 + ], + [ + 2097, + 2098 + ], + [ + 2106, + 2108 + ], + [ + 2110, + 2112 + ], + [ + 2113, + 2116 + ], + [ + 2117, + 2118 + ], + [ + 2119, + 2121 + ], + [ + 2132, + 2133 + ], + [ + 2134, + 2135 + ], + [ + 2138, + 2142 + ], + [ + 2145, + 2146 + ], + [ + 2148, + 2149 + ], + [ + 2151, + 2157 + ], + [ + 2159, + 2162 + ], + [ + 2165, + 2168 + ], + [ + 2170, + 2171 + ], + [ + 2177, + 2178 + ], + [ + 2179, + 2182 + ], + [ + 2183, + 2186 + ], + [ + 2187, + 2188 + ], + [ + 2191, + 2192 + ], + [ + 2194, + 2195 + ], + [ + 2200, + 2202 + ], + [ + 2204, + 2205 + ], + [ + 2214, + 2215 + ], + [ + 2218, + 2219 + ], + [ + 2220, + 2221 + ], + [ + 2222, + 2223 + ], + [ + 2227, + 2228 + ], + [ + 2231, + 2233 + ], + [ + 2240, + 2244 + ], + [ + 2255, + 2256 + ], + [ + 2257, + 2258 + ], + [ + 2260, + 2262 + ], + [ + 2264, + 2265 + ], + [ + 2268, + 2269 + ], + [ + 2272, + 2273 + ], + [ + 2274, + 2275 + ], + [ + 2279, + 2280 + ], + [ + 2282, + 2284 + ], + [ + 2285, + 2287 + ], + [ + 2291, + 2294 + ], + [ + 2299, + 2302 + ], + [ + 2307, + 2309 + ], + [ + 2313, + 2314 + ], + [ + 2315, + 2316 + ], + [ + 2322, + 2325 + ], + [ + 2328, + 2329 + ], + [ + 2330, + 2332 + ], + [ + 2337, + 2340 + ], + [ + 2345, + 2347 + ], + [ + 2349, + 2351 + ], + [ + 2352, + 2354 + ], + [ + 2357, + 2359 + ], + [ + 2360, + 2362 + ], + [ + 2363, + 2366 + ], + [ + 2369, + 2375 + ], + [ + 2378, + 2379 + ], + [ + 2388, + 2390 + ], + [ + 2395, + 2399 + ], + [ + 2402, + 2404 + ], + [ + 2409, + 2415 + ], + [ + 2416, + 2417 + ], + [ + 2420, + 2422 + ], + [ + 2426, + 2434 + ], + [ + 2439, + 2441 + ], + [ + 2442, + 2448 + ], + [ + 2449, + 2453 + ], + [ + 2457, + 2458 + ], + [ + 2460, + 2461 + ], + [ + 2463, + 2466 + ], + [ + 2467, + 2468 + ], + [ + 2474, + 2477 + ], + [ + 2482, + 2485 + ], + [ + 2486, + 2488 + ], + [ + 2489, + 2490 + ], + [ + 2493, + 2495 + ], + [ + 2499, + 2501 + ], + [ + 2504, + 2506 + ], + [ + 2508, + 2511 + ], + [ + 2512, + 2514 + ], + [ + 2515, + 2518 + ], + [ + 2519, + 2522 + ], + [ + 2524, + 2525 + ], + [ + 2532, + 2536 + ], + [ + 2540, + 2541 + ], + [ + 2542, + 2546 + ], + [ + 2549, + 2550 + ], + [ + 2551, + 2552 + ], + [ + 2553, + 2555 + ], + [ + 2557, + 2561 + ], + [ + 2565, + 2566 + ], + [ + 2569, + 2571 + ], + [ + 2576, + 2578 + ], + [ + 2579, + 2580 + ], + [ + 2581, + 2583 + ], + [ + 2586, + 2588 + ], + [ + 2591, + 2593 + ], + [ + 2597, + 2599 + ], + [ + 2605, + 2607 + ], + [ + 2608, + 2611 + ], + [ + 2612, + 2615 + ], + [ + 2618, + 2621 + ], + [ + 2624, + 2625 + ], + [ + 2626, + 2627 + ], + [ + 2650, + 2651 + ], + [ + 2652, + 2653 + ], + [ + 2662, + 2663 + ], + [ + 2671, + 2674 + ], + [ + 2675, + 2677 + ], + [ + 2678, + 2681 + ], + [ + 2682, + 2684 + ], + [ + 2685, + 2688 + ], + [ + 2689, + 2691 + ], + [ + 2692, + 2695 + ], + [ + 2696, + 2698 + ], + [ + 2699, + 2702 + ], + [ + 2703, + 2705 + ], + [ + 2706, + 2709 + ], + [ + 2710, + 2712 + ], + [ + 2713, + 2716 + ], + [ + 2717, + 2719 + ], + [ + 2720, + 2723 + ], + [ + 2724, + 2726 + ], + [ + 2727, + 2730 + ], + [ + 2731, + 2733 + ], + [ + 2734, + 2737 + ], + [ + 2738, + 2740 + ], + [ + 2741, + 2744 + ], + [ + 2745, + 2747 + ], + [ + 2748, + 2751 + ], + [ + 2752, + 2754 + ], + [ + 2755, + 2758 + ], + [ + 2759, + 2761 + ], + [ + 2762, + 2765 + ], + [ + 2766, + 2768 + ], + [ + 2772, + 2775 + ], + [ + 2776, + 2778 + ], + [ + 2779, + 2782 + ], + [ + 2783, + 2785 + ], + [ + 2786, + 2789 + ], + [ + 2790, + 2792 + ], + [ + 2793, + 2796 + ], + [ + 2797, + 2799 + ], + [ + 2802, + 2803 + ], + [ + 2804, + 2806 + ], + [ + 2809, + 2812 + ], + [ + 2820, + 2821 + ], + [ + 2826, + 2828 + ], + [ + 2830, + 2831 + ], + [ + 2836, + 2837 + ], + [ + 2838, + 2840 + ], + [ + 2841, + 2842 + ], + [ + 2845, + 2846 + ], + [ + 2847, + 2848 + ], + [ + 2854, + 2855 + ], + [ + 2857, + 2863 + ], + [ + 2866, + 2867 + ], + [ + 2880, + 2881 + ], + [ + 2886, + 2888 + ], + [ + 2890, + 2891 + ], + [ + 2897, + 2899 + ], + [ + 2900, + 2901 + ], + [ + 2904, + 2905 + ], + [ + 2906, + 2907 + ], + [ + 2913, + 2914 + ], + [ + 2916, + 2922 + ], + [ + 2925, + 2926 + ], + [ + 2937, + 2939 + ], + [ + 2941, + 2942 + ], + [ + 2948, + 2950 + ], + [ + 2951, + 2953 + ], + [ + 2954, + 2957 + ], + [ + 2958, + 2959 + ], + [ + 2962, + 2963 + ], + [ + 2964, + 2965 + ], + [ + 2971, + 2972 + ], + [ + 2974, + 2980 + ], + [ + 2983, + 2984 + ], + [ + 2996, + 2998 + ], + [ + 3004, + 3007 + ], + [ + 3009, + 3010 + ], + [ + 3023, + 3024 + ], + [ + 3026, + 3030 + ], + [ + 3031, + 3032 + ], + [ + 3034, + 3035 + ], + [ + 3047, + 3048 + ], + [ + 3061, + 3064 + ], + [ + 3066, + 3067 + ], + [ + 3069, + 3071 + ], + [ + 3076, + 3077 + ], + [ + 3081, + 3084 + ], + [ + 3085, + 3086 + ], + [ + 3090, + 3091 + ], + [ + 3099, + 3102 + ], + [ + 3104, + 3105 + ], + [ + 3113, + 3114 + ], + [ + 3116, + 3117 + ], + [ + 3127, + 3128 + ], + [ + 3133, + 3134 + ], + [ + 3135, + 3138 + ], + [ + 3139, + 3142 + ], + [ + 3145, + 3146 + ], + [ + 3148, + 3149 + ], + [ + 3151, + 3152 + ], + [ + 3156, + 3157 + ], + [ + 3164, + 3167 + ], + [ + 3169, + 3170 + ], + [ + 3185, + 3186 + ], + [ + 3190, + 3193 + ], + [ + 3194, + 3195 + ] + ] + } + }, + { + "filename": "libvips/foreign/exif.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 45 + ], + [ + 82, + 288 + ], + [ + 290, + 297 + ], + [ + 298, + 346 + ], + [ + 353, + 425 + ], + [ + 429, + 453 + ], + [ + 457, + 465 + ], + [ + 466, + 505 + ], + [ + 506, + 574 + ], + [ + 575, + 607 + ], + [ + 610, + 617 + ], + [ + 622, + 651 + ], + [ + 652, + 693 + ], + [ + 696, + 704 + ], + [ + 706, + 772 + ], + [ + 774, + 789 + ], + [ + 795, + 827 + ], + [ + 829, + 869 + ], + [ + 873, + 989 + ], + [ + 990, + 1018 + ], + [ + 1028, + 1211 + ], + [ + 1213, + 1251 + ], + [ + 1255, + 1310 + ], + [ + 1311, + 1393 + ], + [ + 1396, + 1491 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 20, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 36 + ], + [ + 41, + 42 + ], + [ + 85, + 86 + ], + [ + 91, + 109 + ], + [ + 112, + 113 + ], + [ + 116, + 124 + ], + [ + 127, + 128 + ], + [ + 131, + 133 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 143, + 146 + ], + [ + 147, + 148 + ], + [ + 150, + 151 + ], + [ + 152, + 154 + ], + [ + 157, + 161 + ], + [ + 163, + 164 + ], + [ + 170, + 173 + ], + [ + 174, + 177 + ], + [ + 179, + 182 + ], + [ + 184, + 186 + ], + [ + 188, + 199 + ], + [ + 202, + 204 + ], + [ + 205, + 206 + ], + [ + 209, + 214 + ], + [ + 216, + 219 + ], + [ + 220, + 221 + ], + [ + 222, + 223 + ], + [ + 226, + 228 + ], + [ + 229, + 231 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 243, + 245 + ], + [ + 246, + 248 + ], + [ + 251, + 252 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 262 + ], + [ + 267, + 269 + ], + [ + 273, + 275 + ], + [ + 280, + 281 + ], + [ + 284, + 285 + ], + [ + 293, + 294 + ], + [ + 301, + 302 + ], + [ + 305, + 306 + ], + [ + 307, + 308 + ], + [ + 309, + 310 + ], + [ + 311, + 316 + ], + [ + 318, + 324 + ], + [ + 326, + 332 + ], + [ + 334, + 337 + ], + [ + 338, + 341 + ], + [ + 342, + 343 + ], + [ + 356, + 357 + ], + [ + 358, + 360 + ], + [ + 361, + 363 + ], + [ + 366, + 367 + ], + [ + 370, + 371 + ], + [ + 372, + 373 + ], + [ + 374, + 375 + ], + [ + 377, + 380 + ], + [ + 383, + 385 + ], + [ + 388, + 389 + ], + [ + 390, + 392 + ], + [ + 395, + 396 + ], + [ + 399, + 402 + ], + [ + 403, + 404 + ], + [ + 407, + 408 + ], + [ + 411, + 414 + ], + [ + 415, + 416 + ], + [ + 421, + 422 + ], + [ + 432, + 436 + ], + [ + 440, + 442 + ], + [ + 444, + 447 + ], + [ + 449, + 450 + ], + [ + 460, + 462 + ], + [ + 469, + 471 + ], + [ + 474, + 476 + ], + [ + 479, + 482 + ], + [ + 486, + 488 + ], + [ + 489, + 490 + ], + [ + 495, + 496 + ], + [ + 497, + 498 + ], + [ + 501, + 502 + ], + [ + 509, + 515 + ], + [ + 517, + 519 + ], + [ + 521, + 522 + ], + [ + 525, + 526 + ], + [ + 527, + 531 + ], + [ + 536, + 537 + ], + [ + 542, + 544 + ], + [ + 545, + 547 + ], + [ + 548, + 549 + ], + [ + 551, + 552 + ], + [ + 553, + 556 + ], + [ + 558, + 561 + ], + [ + 562, + 563 + ], + [ + 565, + 566 + ], + [ + 569, + 571 + ], + [ + 578, + 580 + ], + [ + 585, + 586 + ], + [ + 589, + 600 + ], + [ + 603, + 604 + ], + [ + 613, + 614 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 629, + 630 + ], + [ + 635, + 636 + ], + [ + 637, + 639 + ], + [ + 640, + 641 + ], + [ + 646, + 648 + ], + [ + 655, + 658 + ], + [ + 663, + 664 + ], + [ + 667, + 669 + ], + [ + 670, + 671 + ], + [ + 673, + 674 + ], + [ + 675, + 678 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 684, + 685 + ], + [ + 686, + 688 + ], + [ + 689, + 690 + ], + [ + 699, + 701 + ], + [ + 709, + 712 + ], + [ + 717, + 718 + ], + [ + 721, + 723 + ], + [ + 724, + 725 + ], + [ + 727, + 729 + ], + [ + 733, + 735 + ], + [ + 736, + 739 + ], + [ + 740, + 741 + ], + [ + 743, + 744 + ], + [ + 746, + 748 + ], + [ + 752, + 754 + ], + [ + 755, + 757 + ], + [ + 758, + 759 + ], + [ + 763, + 765 + ], + [ + 768, + 769 + ], + [ + 777, + 778 + ], + [ + 779, + 780 + ], + [ + 783, + 784 + ], + [ + 785, + 786 + ], + [ + 798, + 799 + ], + [ + 801, + 802 + ], + [ + 803, + 804 + ], + [ + 807, + 808 + ], + [ + 809, + 812 + ], + [ + 813, + 814 + ], + [ + 816, + 817 + ], + [ + 819, + 820 + ], + [ + 823, + 824 + ], + [ + 832, + 833 + ], + [ + 835, + 839 + ], + [ + 840, + 841 + ], + [ + 844, + 845 + ], + [ + 850, + 851 + ], + [ + 855, + 856 + ], + [ + 857, + 861 + ], + [ + 862, + 863 + ], + [ + 865, + 866 + ], + [ + 876, + 878 + ], + [ + 883, + 884 + ], + [ + 887, + 889 + ], + [ + 891, + 892 + ], + [ + 894, + 898 + ], + [ + 899, + 900 + ], + [ + 906, + 908 + ], + [ + 913, + 914 + ], + [ + 917, + 919 + ], + [ + 923, + 927 + ], + [ + 928, + 929 + ], + [ + 934, + 936 + ], + [ + 941, + 942 + ], + [ + 943, + 944 + ], + [ + 947, + 950 + ], + [ + 951, + 953 + ], + [ + 958, + 959 + ], + [ + 962, + 964 + ], + [ + 970, + 973 + ], + [ + 977, + 983 + ], + [ + 984, + 986 + ], + [ + 993, + 994 + ], + [ + 999, + 1001 + ], + [ + 1005, + 1009 + ], + [ + 1010, + 1011 + ], + [ + 1014, + 1015 + ], + [ + 1031, + 1033 + ], + [ + 1038, + 1046 + ], + [ + 1048, + 1049 + ], + [ + 1051, + 1052 + ], + [ + 1053, + 1055 + ], + [ + 1056, + 1060 + ], + [ + 1061, + 1062 + ], + [ + 1064, + 1065 + ], + [ + 1067, + 1068 + ], + [ + 1074, + 1076 + ], + [ + 1078, + 1079 + ], + [ + 1080, + 1082 + ], + [ + 1083, + 1084 + ], + [ + 1086, + 1087 + ], + [ + 1089, + 1090 + ], + [ + 1096, + 1097 + ], + [ + 1098, + 1100 + ], + [ + 1104, + 1105 + ], + [ + 1106, + 1107 + ], + [ + 1110, + 1113 + ], + [ + 1117, + 1121 + ], + [ + 1125, + 1126 + ], + [ + 1131, + 1132 + ], + [ + 1133, + 1134 + ], + [ + 1136, + 1137 + ], + [ + 1142, + 1143 + ], + [ + 1144, + 1145 + ], + [ + 1147, + 1148 + ], + [ + 1152, + 1153 + ], + [ + 1155, + 1156 + ], + [ + 1161, + 1162 + ], + [ + 1164, + 1166 + ], + [ + 1169, + 1172 + ], + [ + 1173, + 1175 + ], + [ + 1176, + 1177 + ], + [ + 1179, + 1182 + ], + [ + 1185, + 1188 + ], + [ + 1189, + 1190 + ], + [ + 1191, + 1192 + ], + [ + 1196, + 1199 + ], + [ + 1200, + 1201 + ], + [ + 1202, + 1203 + ], + [ + 1206, + 1208 + ], + [ + 1216, + 1218 + ], + [ + 1221, + 1224 + ], + [ + 1226, + 1228 + ], + [ + 1229, + 1230 + ], + [ + 1231, + 1234 + ], + [ + 1239, + 1243 + ], + [ + 1245, + 1246 + ], + [ + 1247, + 1248 + ], + [ + 1258, + 1259 + ], + [ + 1262, + 1263 + ], + [ + 1267, + 1268 + ], + [ + 1270, + 1273 + ], + [ + 1277, + 1278 + ], + [ + 1280, + 1282 + ], + [ + 1287, + 1289 + ], + [ + 1294, + 1297 + ], + [ + 1298, + 1299 + ], + [ + 1301, + 1305 + ], + [ + 1306, + 1307 + ], + [ + 1314, + 1317 + ], + [ + 1321, + 1322 + ], + [ + 1324, + 1328 + ], + [ + 1329, + 1332 + ], + [ + 1333, + 1335 + ], + [ + 1337, + 1338 + ], + [ + 1339, + 1340 + ], + [ + 1343, + 1344 + ], + [ + 1347, + 1352 + ], + [ + 1355, + 1356 + ], + [ + 1359, + 1360 + ], + [ + 1366, + 1368 + ], + [ + 1373, + 1374 + ], + [ + 1376, + 1379 + ], + [ + 1383, + 1384 + ], + [ + 1389, + 1390 + ], + [ + 1399, + 1403 + ], + [ + 1404, + 1406 + ], + [ + 1407, + 1408 + ], + [ + 1410, + 1414 + ], + [ + 1419, + 1420 + ], + [ + 1423, + 1424 + ], + [ + 1427, + 1430 + ], + [ + 1434, + 1437 + ], + [ + 1441, + 1444 + ], + [ + 1448, + 1451 + ], + [ + 1456, + 1461 + ], + [ + 1465, + 1466 + ], + [ + 1468, + 1470 + ], + [ + 1471, + 1472 + ], + [ + 1473, + 1474 + ], + [ + 1479, + 1480 + ], + [ + 1481, + 1482 + ], + [ + 1485, + 1486 + ], + [ + 1487, + 1488 + ] + ] + } + }, + { + "filename": "libvips/foreign/fits.c", + "line_filter": { + "diff_chunks": [ + [ + 18, + 25 + ], + [ + 28, + 37 + ], + [ + 40, + 68 + ], + [ + 90, + 101 + ], + [ + 120, + 127 + ], + [ + 130, + 199 + ], + [ + 200, + 216 + ], + [ + 225, + 269 + ], + [ + 273, + 285 + ], + [ + 292, + 324 + ], + [ + 325, + 402 + ], + [ + 405, + 458 + ], + [ + 460, + 602 + ], + [ + 613, + 621 + ], + [ + 625, + 658 + ], + [ + 664, + 737 + ], + [ + 742, + 778 + ] + ], + "lines_added": [ + [ + 21, + 22 + ], + [ + 31, + 32 + ], + [ + 33, + 34 + ], + [ + 43, + 44 + ], + [ + 45, + 49 + ], + [ + 50, + 59 + ], + [ + 64, + 65 + ], + [ + 93, + 94 + ], + [ + 97, + 98 + ], + [ + 123, + 124 + ], + [ + 133, + 134 + ], + [ + 137, + 139 + ], + [ + 144, + 145 + ], + [ + 146, + 148 + ], + [ + 149, + 150 + ], + [ + 154, + 156 + ], + [ + 160, + 161 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 175, + 177 + ], + [ + 178, + 179 + ], + [ + 183, + 185 + ], + [ + 187, + 191 + ], + [ + 195, + 196 + ], + [ + 203, + 208 + ], + [ + 212, + 213 + ], + [ + 228, + 233 + ], + [ + 235, + 236 + ], + [ + 238, + 243 + ], + [ + 247, + 248 + ], + [ + 251, + 254 + ], + [ + 257, + 261 + ], + [ + 265, + 266 + ], + [ + 276, + 282 + ], + [ + 295, + 297 + ], + [ + 302, + 304 + ], + [ + 305, + 309 + ], + [ + 313, + 315 + ], + [ + 319, + 321 + ], + [ + 328, + 332 + ], + [ + 333, + 337 + ], + [ + 341, + 344 + ], + [ + 347, + 350 + ], + [ + 352, + 353 + ], + [ + 356, + 359 + ], + [ + 361, + 363 + ], + [ + 369, + 371 + ], + [ + 373, + 374 + ], + [ + 377, + 378 + ], + [ + 381, + 382 + ], + [ + 383, + 385 + ], + [ + 386, + 389 + ], + [ + 391, + 392 + ], + [ + 393, + 394 + ], + [ + 397, + 399 + ], + [ + 408, + 413 + ], + [ + 414, + 415 + ], + [ + 417, + 418 + ], + [ + 420, + 430 + ], + [ + 432, + 433 + ], + [ + 434, + 435 + ], + [ + 436, + 437 + ], + [ + 439, + 440 + ], + [ + 444, + 445 + ], + [ + 450, + 451 + ], + [ + 454, + 455 + ], + [ + 463, + 465 + ], + [ + 469, + 472 + ], + [ + 473, + 474 + ], + [ + 475, + 477 + ], + [ + 481, + 482 + ], + [ + 487, + 488 + ], + [ + 489, + 490 + ], + [ + 493, + 494 + ], + [ + 498, + 502 + ], + [ + 504, + 507 + ], + [ + 510, + 511 + ], + [ + 512, + 513 + ], + [ + 516, + 517 + ], + [ + 520, + 527 + ], + [ + 529, + 530 + ], + [ + 533, + 534 + ], + [ + 538, + 539 + ], + [ + 542, + 544 + ], + [ + 545, + 547 + ], + [ + 549, + 550 + ], + [ + 551, + 552 + ], + [ + 553, + 554 + ], + [ + 557, + 558 + ], + [ + 564, + 567 + ], + [ + 571, + 573 + ], + [ + 574, + 576 + ], + [ + 579, + 582 + ], + [ + 587, + 588 + ], + [ + 589, + 594 + ], + [ + 598, + 599 + ], + [ + 616, + 618 + ], + [ + 628, + 630 + ], + [ + 631, + 632 + ], + [ + 634, + 635 + ], + [ + 638, + 641 + ], + [ + 642, + 644 + ], + [ + 645, + 648 + ], + [ + 650, + 651 + ], + [ + 654, + 655 + ], + [ + 667, + 669 + ], + [ + 670, + 674 + ], + [ + 679, + 683 + ], + [ + 685, + 689 + ], + [ + 691, + 694 + ], + [ + 695, + 696 + ], + [ + 699, + 700 + ], + [ + 703, + 705 + ], + [ + 711, + 714 + ], + [ + 719, + 722 + ], + [ + 723, + 724 + ], + [ + 730, + 732 + ], + [ + 733, + 734 + ], + [ + 745, + 750 + ], + [ + 754, + 755 + ], + [ + 758, + 759 + ], + [ + 762, + 763 + ], + [ + 764, + 766 + ], + [ + 767, + 771 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ] + ] + } + }, + { + "filename": "libvips/foreign/fitsload.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 67, + 178 + ], + [ + 180, + 187 + ], + [ + 192, + 208 + ], + [ + 210, + 245 + ], + [ + 247, + 270 + ], + [ + 278, + 348 + ], + [ + 353, + 366 + ], + [ + 368, + 384 + ], + [ + 386, + 405 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 70, + 72 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 80, + 81 + ], + [ + 84, + 85 + ], + [ + 86, + 88 + ], + [ + 93, + 95 + ], + [ + 98, + 103 + ], + [ + 108, + 110 + ], + [ + 111, + 112 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 132, + 136 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 145, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 157, + 159 + ], + [ + 161, + 165 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 183, + 184 + ], + [ + 195, + 196 + ], + [ + 204, + 205 + ], + [ + 213, + 214 + ], + [ + 219, + 221 + ], + [ + 223, + 224 + ], + [ + 228, + 231 + ], + [ + 232, + 234 + ], + [ + 235, + 236 + ], + [ + 239, + 240 + ], + [ + 241, + 242 + ], + [ + 250, + 251 + ], + [ + 257, + 263 + ], + [ + 266, + 267 + ], + [ + 281, + 283 + ], + [ + 285, + 286 + ], + [ + 288, + 289 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 296, + 298 + ], + [ + 299, + 300 + ], + [ + 303, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 312 + ], + [ + 315, + 317 + ], + [ + 318, + 319 + ], + [ + 320, + 321 + ], + [ + 327, + 328 + ], + [ + 332, + 333 + ], + [ + 335, + 341 + ], + [ + 344, + 345 + ], + [ + 356, + 357 + ], + [ + 359, + 360 + ], + [ + 361, + 363 + ], + [ + 371, + 372 + ], + [ + 376, + 379 + ], + [ + 380, + 381 + ], + [ + 389, + 390 + ], + [ + 394, + 395 + ], + [ + 399, + 402 + ], + [ + 403, + 404 + ] + ] + } + }, + { + "filename": "libvips/foreign/fitssave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 58, + 99 + ], + [ + 114, + 125 + ], + [ + 126, + 133 + ], + [ + 139, + 155 + ], + [ + 156, + 164 + ], + [ + 167, + 181 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 61, + 62 + ], + [ + 67, + 69 + ], + [ + 71, + 72 + ], + [ + 75, + 77 + ], + [ + 78, + 80 + ], + [ + 83, + 85 + ], + [ + 90, + 94 + ], + [ + 95, + 96 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 129, + 130 + ], + [ + 142, + 148 + ], + [ + 151, + 152 + ], + [ + 159, + 161 + ], + [ + 170, + 171 + ], + [ + 175, + 178 + ], + [ + 179, + 180 + ] + ] + } + }, + { + "filename": "libvips/foreign/foreign.c", + "line_filter": { + "diff_chunks": [ + [ + 30, + 58 + ], + [ + 81, + 122 + ], + [ + 124, + 131 + ], + [ + 132, + 191 + ], + [ + 192, + 232 + ], + [ + 233, + 265 + ], + [ + 266, + 301 + ], + [ + 303, + 315 + ], + [ + 317, + 328 + ], + [ + 331, + 409 + ], + [ + 413, + 420 + ], + [ + 424, + 543 + ], + [ + 544, + 601 + ], + [ + 602, + 705 + ], + [ + 707, + 741 + ], + [ + 747, + 767 + ], + [ + 775, + 794 + ], + [ + 801, + 820 + ], + [ + 821, + 1102 + ], + [ + 1104, + 1158 + ], + [ + 1163, + 1231 + ], + [ + 1241, + 1343 + ], + [ + 1345, + 1503 + ], + [ + 1505, + 1515 + ], + [ + 1518, + 1560 + ], + [ + 1569, + 1578 + ], + [ + 1579, + 1615 + ], + [ + 1619, + 1630 + ], + [ + 1631, + 1732 + ], + [ + 1745, + 1754 + ], + [ + 1761, + 1772 + ], + [ + 1775, + 1854 + ], + [ + 1855, + 1966 + ], + [ + 1967, + 2009 + ], + [ + 2010, + 2067 + ], + [ + 2068, + 2100 + ], + [ + 2112, + 2128 + ], + [ + 2138, + 2154 + ], + [ + 2164, + 2182 + ], + [ + 2183, + 2198 + ], + [ + 2207, + 2236 + ], + [ + 2241, + 2248 + ], + [ + 2266, + 2287 + ], + [ + 2294, + 2301 + ], + [ + 2305, + 2341 + ], + [ + 2354, + 2370 + ], + [ + 2372, + 2379 + ], + [ + 2382, + 2398 + ], + [ + 2401, + 2413 + ], + [ + 2414, + 2429 + ], + [ + 2431, + 2458 + ], + [ + 2462, + 2479 + ], + [ + 2482, + 2503 + ], + [ + 2516, + 2552 + ], + [ + 2564, + 2580 + ], + [ + 2591, + 2598 + ], + [ + 2601, + 2620 + ], + [ + 2623, + 2639 + ], + [ + 2651, + 2668 + ], + [ + 2669, + 2684 + ], + [ + 2694, + 2717 + ], + [ + 2754, + 2770 + ], + [ + 2779, + 3031 + ], + [ + 3034, + 3099 + ], + [ + 3117, + 3151 + ] + ], + "lines_added": [ + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 44 + ], + [ + 45, + 49 + ], + [ + 54, + 55 + ], + [ + 84, + 85 + ], + [ + 88, + 89 + ], + [ + 95, + 96 + ], + [ + 100, + 101 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 113, + 115 + ], + [ + 118, + 119 + ], + [ + 127, + 128 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 142 + ], + [ + 143, + 144 + ], + [ + 148, + 149 + ], + [ + 154, + 155 + ], + [ + 157, + 158 + ], + [ + 162, + 163 + ], + [ + 165, + 166 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 181, + 182 + ], + [ + 184, + 185 + ], + [ + 187, + 188 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 210, + 212 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 224, + 225 + ], + [ + 228, + 229 + ], + [ + 236, + 238 + ], + [ + 240, + 241 + ], + [ + 242, + 244 + ], + [ + 245, + 246 + ], + [ + 251, + 252 + ], + [ + 255, + 256 + ], + [ + 258, + 259 + ], + [ + 261, + 262 + ], + [ + 269, + 270 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 278, + 279 + ], + [ + 280, + 281 + ], + [ + 282, + 284 + ], + [ + 286, + 287 + ], + [ + 289, + 292 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 306, + 307 + ], + [ + 308, + 309 + ], + [ + 311, + 312 + ], + [ + 320, + 321 + ], + [ + 324, + 325 + ], + [ + 334, + 335 + ], + [ + 337, + 338 + ], + [ + 339, + 342 + ], + [ + 343, + 344 + ], + [ + 345, + 346 + ], + [ + 348, + 353 + ], + [ + 354, + 355 + ], + [ + 357, + 358 + ], + [ + 359, + 363 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 375, + 376 + ], + [ + 380, + 381 + ], + [ + 384, + 385 + ], + [ + 389, + 390 + ], + [ + 393, + 396 + ], + [ + 397, + 398 + ], + [ + 399, + 400 + ], + [ + 403, + 404 + ], + [ + 405, + 406 + ], + [ + 416, + 417 + ], + [ + 427, + 428 + ], + [ + 433, + 435 + ], + [ + 436, + 437 + ], + [ + 438, + 440 + ], + [ + 441, + 444 + ], + [ + 445, + 447 + ], + [ + 449, + 450 + ], + [ + 451, + 452 + ], + [ + 453, + 454 + ], + [ + 459, + 460 + ], + [ + 462, + 463 + ], + [ + 464, + 465 + ], + [ + 466, + 467 + ], + [ + 468, + 469 + ], + [ + 472, + 493 + ], + [ + 496, + 497 + ], + [ + 503, + 505 + ], + [ + 506, + 508 + ], + [ + 511, + 514 + ], + [ + 516, + 518 + ], + [ + 523, + 526 + ], + [ + 528, + 529 + ], + [ + 531, + 534 + ], + [ + 535, + 538 + ], + [ + 539, + 540 + ], + [ + 547, + 548 + ], + [ + 554, + 555 + ], + [ + 560, + 561 + ], + [ + 564, + 568 + ], + [ + 569, + 573 + ], + [ + 575, + 582 + ], + [ + 585, + 587 + ], + [ + 589, + 590 + ], + [ + 593, + 594 + ], + [ + 597, + 598 + ], + [ + 605, + 608 + ], + [ + 609, + 613 + ], + [ + 614, + 615 + ], + [ + 620, + 622 + ], + [ + 623, + 624 + ], + [ + 627, + 629 + ], + [ + 630, + 633 + ], + [ + 635, + 637 + ], + [ + 638, + 639 + ], + [ + 643, + 644 + ], + [ + 649, + 650 + ], + [ + 654, + 655 + ], + [ + 658, + 659 + ], + [ + 662, + 669 + ], + [ + 671, + 672 + ], + [ + 677, + 678 + ], + [ + 679, + 682 + ], + [ + 685, + 687 + ], + [ + 688, + 689 + ], + [ + 692, + 693 + ], + [ + 694, + 696 + ], + [ + 697, + 700 + ], + [ + 701, + 702 + ], + [ + 710, + 711 + ], + [ + 715, + 716 + ], + [ + 719, + 720 + ], + [ + 723, + 730 + ], + [ + 734, + 736 + ], + [ + 737, + 738 + ], + [ + 750, + 752 + ], + [ + 756, + 762 + ], + [ + 763, + 764 + ], + [ + 778, + 779 + ], + [ + 783, + 789 + ], + [ + 790, + 791 + ], + [ + 804, + 805 + ], + [ + 809, + 815 + ], + [ + 816, + 817 + ], + [ + 824, + 825 + ], + [ + 829, + 831 + ], + [ + 834, + 837 + ], + [ + 838, + 840 + ], + [ + 842, + 843 + ], + [ + 846, + 847 + ], + [ + 852, + 856 + ], + [ + 857, + 859 + ], + [ + 860, + 861 + ], + [ + 862, + 863 + ], + [ + 866, + 867 + ], + [ + 869, + 870 + ], + [ + 874, + 875 + ], + [ + 877, + 878 + ], + [ + 879, + 880 + ], + [ + 882, + 883 + ], + [ + 887, + 888 + ], + [ + 889, + 890 + ], + [ + 892, + 893 + ], + [ + 898, + 900 + ], + [ + 901, + 902 + ], + [ + 904, + 905 + ], + [ + 907, + 908 + ], + [ + 910, + 911 + ], + [ + 912, + 913 + ], + [ + 915, + 916 + ], + [ + 919, + 920 + ], + [ + 924, + 925 + ], + [ + 930, + 931 + ], + [ + 932, + 933 + ], + [ + 936, + 940 + ], + [ + 942, + 943 + ], + [ + 949, + 950 + ], + [ + 951, + 953 + ], + [ + 956, + 958 + ], + [ + 959, + 962 + ], + [ + 964, + 965 + ], + [ + 968, + 969 + ], + [ + 975, + 976 + ], + [ + 979, + 981 + ], + [ + 986, + 987 + ], + [ + 993, + 997 + ], + [ + 999, + 1000 + ], + [ + 1005, + 1008 + ], + [ + 1010, + 1011 + ], + [ + 1016, + 1018 + ], + [ + 1021, + 1022 + ], + [ + 1023, + 1027 + ], + [ + 1028, + 1032 + ], + [ + 1033, + 1034 + ], + [ + 1037, + 1038 + ], + [ + 1039, + 1042 + ], + [ + 1046, + 1047 + ], + [ + 1050, + 1058 + ], + [ + 1061, + 1062 + ], + [ + 1067, + 1069 + ], + [ + 1073, + 1076 + ], + [ + 1077, + 1079 + ], + [ + 1080, + 1084 + ], + [ + 1085, + 1086 + ], + [ + 1087, + 1089 + ], + [ + 1091, + 1092 + ], + [ + 1096, + 1099 + ], + [ + 1107, + 1108 + ], + [ + 1109, + 1110 + ], + [ + 1115, + 1117 + ], + [ + 1118, + 1119 + ], + [ + 1121, + 1127 + ], + [ + 1131, + 1133 + ], + [ + 1134, + 1135 + ], + [ + 1137, + 1139 + ], + [ + 1140, + 1141 + ], + [ + 1144, + 1146 + ], + [ + 1148, + 1149 + ], + [ + 1152, + 1153 + ], + [ + 1154, + 1155 + ], + [ + 1166, + 1167 + ], + [ + 1170, + 1175 + ], + [ + 1176, + 1179 + ], + [ + 1180, + 1182 + ], + [ + 1183, + 1186 + ], + [ + 1187, + 1189 + ], + [ + 1190, + 1193 + ], + [ + 1194, + 1196 + ], + [ + 1197, + 1200 + ], + [ + 1201, + 1203 + ], + [ + 1204, + 1207 + ], + [ + 1208, + 1210 + ], + [ + 1211, + 1214 + ], + [ + 1215, + 1217 + ], + [ + 1218, + 1221 + ], + [ + 1222, + 1224 + ], + [ + 1227, + 1228 + ], + [ + 1244, + 1245 + ], + [ + 1247, + 1250 + ], + [ + 1252, + 1253 + ], + [ + 1254, + 1255 + ], + [ + 1257, + 1258 + ], + [ + 1260, + 1263 + ], + [ + 1269, + 1270 + ], + [ + 1272, + 1273 + ], + [ + 1274, + 1275 + ], + [ + 1276, + 1277 + ], + [ + 1278, + 1279 + ], + [ + 1282, + 1283 + ], + [ + 1284, + 1285 + ], + [ + 1286, + 1287 + ], + [ + 1288, + 1290 + ], + [ + 1293, + 1294 + ], + [ + 1299, + 1303 + ], + [ + 1304, + 1306 + ], + [ + 1307, + 1308 + ], + [ + 1309, + 1310 + ], + [ + 1312, + 1313 + ], + [ + 1315, + 1316 + ], + [ + 1317, + 1318 + ], + [ + 1321, + 1322 + ], + [ + 1323, + 1324 + ], + [ + 1326, + 1328 + ], + [ + 1329, + 1330 + ], + [ + 1332, + 1333 + ], + [ + 1335, + 1338 + ], + [ + 1339, + 1340 + ], + [ + 1348, + 1349 + ], + [ + 1351, + 1354 + ], + [ + 1355, + 1356 + ], + [ + 1361, + 1362 + ], + [ + 1363, + 1364 + ], + [ + 1366, + 1369 + ], + [ + 1370, + 1371 + ], + [ + 1375, + 1376 + ], + [ + 1377, + 1380 + ], + [ + 1382, + 1386 + ], + [ + 1387, + 1388 + ], + [ + 1394, + 1395 + ], + [ + 1396, + 1397 + ], + [ + 1399, + 1401 + ], + [ + 1403, + 1410 + ], + [ + 1411, + 1412 + ], + [ + 1417, + 1418 + ], + [ + 1420, + 1421 + ], + [ + 1426, + 1427 + ], + [ + 1428, + 1431 + ], + [ + 1435, + 1436 + ], + [ + 1437, + 1438 + ], + [ + 1442, + 1445 + ], + [ + 1446, + 1447 + ], + [ + 1451, + 1453 + ], + [ + 1454, + 1455 + ], + [ + 1456, + 1457 + ], + [ + 1461, + 1462 + ], + [ + 1463, + 1464 + ], + [ + 1468, + 1471 + ], + [ + 1472, + 1473 + ], + [ + 1478, + 1479 + ], + [ + 1480, + 1481 + ], + [ + 1485, + 1488 + ], + [ + 1489, + 1491 + ], + [ + 1493, + 1498 + ], + [ + 1499, + 1500 + ], + [ + 1508, + 1509 + ], + [ + 1510, + 1512 + ], + [ + 1521, + 1526 + ], + [ + 1527, + 1528 + ], + [ + 1531, + 1532 + ], + [ + 1533, + 1536 + ], + [ + 1538, + 1543 + ], + [ + 1544, + 1545 + ], + [ + 1548, + 1550 + ], + [ + 1552, + 1555 + ], + [ + 1556, + 1557 + ], + [ + 1572, + 1575 + ], + [ + 1582, + 1583 + ], + [ + 1585, + 1588 + ], + [ + 1589, + 1590 + ], + [ + 1596, + 1599 + ], + [ + 1600, + 1601 + ], + [ + 1604, + 1605 + ], + [ + 1607, + 1610 + ], + [ + 1611, + 1612 + ], + [ + 1622, + 1625 + ], + [ + 1626, + 1627 + ], + [ + 1634, + 1635 + ], + [ + 1638, + 1639 + ], + [ + 1641, + 1644 + ], + [ + 1645, + 1646 + ], + [ + 1649, + 1650 + ], + [ + 1652, + 1655 + ], + [ + 1656, + 1657 + ], + [ + 1661, + 1662 + ], + [ + 1663, + 1664 + ], + [ + 1666, + 1667 + ], + [ + 1670, + 1673 + ], + [ + 1675, + 1678 + ], + [ + 1679, + 1680 + ], + [ + 1683, + 1684 + ], + [ + 1689, + 1690 + ], + [ + 1693, + 1694 + ], + [ + 1695, + 1696 + ], + [ + 1697, + 1700 + ], + [ + 1702, + 1706 + ], + [ + 1707, + 1708 + ], + [ + 1710, + 1713 + ], + [ + 1714, + 1715 + ], + [ + 1717, + 1719 + ], + [ + 1721, + 1722 + ], + [ + 1725, + 1727 + ], + [ + 1728, + 1729 + ], + [ + 1748, + 1749 + ], + [ + 1750, + 1751 + ], + [ + 1764, + 1765 + ], + [ + 1766, + 1769 + ], + [ + 1778, + 1779 + ], + [ + 1784, + 1785 + ], + [ + 1786, + 1789 + ], + [ + 1790, + 1791 + ], + [ + 1792, + 1795 + ], + [ + 1796, + 1798 + ], + [ + 1799, + 1802 + ], + [ + 1803, + 1805 + ], + [ + 1806, + 1809 + ], + [ + 1810, + 1812 + ], + [ + 1815, + 1816 + ], + [ + 1817, + 1818 + ], + [ + 1820, + 1821 + ], + [ + 1823, + 1825 + ], + [ + 1826, + 1828 + ], + [ + 1831, + 1832 + ], + [ + 1834, + 1836 + ], + [ + 1839, + 1842 + ], + [ + 1846, + 1849 + ], + [ + 1850, + 1851 + ], + [ + 1858, + 1859 + ], + [ + 1865, + 1866 + ], + [ + 1871, + 1872 + ], + [ + 1873, + 1879 + ], + [ + 1880, + 1881 + ], + [ + 1883, + 1884 + ], + [ + 1887, + 1889 + ], + [ + 1890, + 1891 + ], + [ + 1895, + 1897 + ], + [ + 1899, + 1900 + ], + [ + 1903, + 1905 + ], + [ + 1906, + 1907 + ], + [ + 1911, + 1914 + ], + [ + 1917, + 1918 + ], + [ + 1923, + 1924 + ], + [ + 1925, + 1927 + ], + [ + 1932, + 1934 + ], + [ + 1935, + 1937 + ], + [ + 1943, + 1944 + ], + [ + 1945, + 1947 + ], + [ + 1948, + 1949 + ], + [ + 1950, + 1951 + ], + [ + 1952, + 1954 + ], + [ + 1955, + 1956 + ], + [ + 1962, + 1963 + ], + [ + 1970, + 1971 + ], + [ + 1972, + 1974 + ], + [ + 1975, + 1979 + ], + [ + 1980, + 1981 + ], + [ + 1986, + 1988 + ], + [ + 1989, + 1991 + ], + [ + 1992, + 1993 + ], + [ + 1995, + 1998 + ], + [ + 1999, + 2000 + ], + [ + 2001, + 2004 + ], + [ + 2005, + 2006 + ], + [ + 2013, + 2014 + ], + [ + 2020, + 2021 + ], + [ + 2026, + 2027 + ], + [ + 2028, + 2034 + ], + [ + 2035, + 2036 + ], + [ + 2038, + 2039 + ], + [ + 2044, + 2046 + ], + [ + 2047, + 2049 + ], + [ + 2050, + 2051 + ], + [ + 2053, + 2056 + ], + [ + 2057, + 2058 + ], + [ + 2059, + 2062 + ], + [ + 2063, + 2064 + ], + [ + 2071, + 2072 + ], + [ + 2078, + 2079 + ], + [ + 2084, + 2085 + ], + [ + 2086, + 2092 + ], + [ + 2093, + 2094 + ], + [ + 2096, + 2097 + ], + [ + 2115, + 2116 + ], + [ + 2121, + 2122 + ], + [ + 2124, + 2125 + ], + [ + 2141, + 2142 + ], + [ + 2146, + 2149 + ], + [ + 2150, + 2151 + ], + [ + 2167, + 2169 + ], + [ + 2170, + 2172 + ], + [ + 2178, + 2179 + ], + [ + 2186, + 2187 + ], + [ + 2188, + 2191 + ], + [ + 2192, + 2193 + ], + [ + 2194, + 2195 + ], + [ + 2210, + 2211 + ], + [ + 2217, + 2218 + ], + [ + 2222, + 2225 + ], + [ + 2226, + 2227 + ], + [ + 2231, + 2233 + ], + [ + 2244, + 2245 + ], + [ + 2269, + 2270 + ], + [ + 2274, + 2277 + ], + [ + 2278, + 2279 + ], + [ + 2283, + 2284 + ], + [ + 2297, + 2298 + ], + [ + 2308, + 2309 + ], + [ + 2314, + 2315 + ], + [ + 2316, + 2319 + ], + [ + 2320, + 2323 + ], + [ + 2326, + 2327 + ], + [ + 2329, + 2330 + ], + [ + 2332, + 2333 + ], + [ + 2337, + 2338 + ], + [ + 2357, + 2358 + ], + [ + 2362, + 2365 + ], + [ + 2366, + 2367 + ], + [ + 2375, + 2376 + ], + [ + 2385, + 2386 + ], + [ + 2390, + 2393 + ], + [ + 2394, + 2395 + ], + [ + 2404, + 2405 + ], + [ + 2409, + 2410 + ], + [ + 2417, + 2418 + ], + [ + 2419, + 2422 + ], + [ + 2423, + 2424 + ], + [ + 2425, + 2426 + ], + [ + 2434, + 2435 + ], + [ + 2439, + 2440 + ], + [ + 2444, + 2447 + ], + [ + 2448, + 2449 + ], + [ + 2453, + 2455 + ], + [ + 2465, + 2466 + ], + [ + 2470, + 2471 + ], + [ + 2473, + 2474 + ], + [ + 2475, + 2476 + ], + [ + 2485, + 2486 + ], + [ + 2490, + 2493 + ], + [ + 2494, + 2495 + ], + [ + 2499, + 2500 + ], + [ + 2519, + 2520 + ], + [ + 2525, + 2526 + ], + [ + 2527, + 2530 + ], + [ + 2531, + 2534 + ], + [ + 2537, + 2538 + ], + [ + 2540, + 2541 + ], + [ + 2543, + 2544 + ], + [ + 2548, + 2549 + ], + [ + 2567, + 2568 + ], + [ + 2572, + 2575 + ], + [ + 2576, + 2577 + ], + [ + 2594, + 2595 + ], + [ + 2604, + 2605 + ], + [ + 2610, + 2611 + ], + [ + 2616, + 2617 + ], + [ + 2626, + 2627 + ], + [ + 2631, + 2634 + ], + [ + 2635, + 2636 + ], + [ + 2654, + 2655 + ], + [ + 2656, + 2658 + ], + [ + 2664, + 2665 + ], + [ + 2672, + 2673 + ], + [ + 2674, + 2677 + ], + [ + 2678, + 2679 + ], + [ + 2680, + 2681 + ], + [ + 2697, + 2698 + ], + [ + 2704, + 2705 + ], + [ + 2709, + 2712 + ], + [ + 2713, + 2714 + ], + [ + 2757, + 2758 + ], + [ + 2762, + 2765 + ], + [ + 2766, + 2767 + ], + [ + 2782, + 2783 + ], + [ + 2787, + 2788 + ], + [ + 2792, + 2795 + ], + [ + 2796, + 2797 + ], + [ + 2803, + 2964 + ], + [ + 2966, + 2967 + ], + [ + 2970, + 2977 + ], + [ + 2980, + 2986 + ], + [ + 2989, + 2992 + ], + [ + 2995, + 2998 + ], + [ + 3001, + 3004 + ], + [ + 3007, + 3013 + ], + [ + 3016, + 3022 + ], + [ + 3026, + 3028 + ], + [ + 3037, + 3040 + ], + [ + 3043, + 3049 + ], + [ + 3052, + 3058 + ], + [ + 3061, + 3062 + ], + [ + 3065, + 3072 + ], + [ + 3075, + 3081 + ], + [ + 3085, + 3091 + ], + [ + 3094, + 3096 + ], + [ + 3120, + 3123 + ], + [ + 3126, + 3127 + ], + [ + 3130, + 3133 + ], + [ + 3136, + 3139 + ], + [ + 3142, + 3145 + ], + [ + 3148, + 3150 + ] + ] + } + }, + { + "filename": "libvips/foreign/heifload.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 12 + ], + [ + 30, + 58 + ], + [ + 91, + 102 + ], + [ + 105, + 124 + ], + [ + 157, + 164 + ], + [ + 171, + 182 + ], + [ + 214, + 225 + ], + [ + 226, + 296 + ], + [ + 301, + 346 + ], + [ + 350, + 446 + ], + [ + 451, + 462 + ], + [ + 470, + 535 + ], + [ + 538, + 555 + ], + [ + 562, + 641 + ], + [ + 642, + 668 + ], + [ + 671, + 696 + ], + [ + 697, + 850 + ], + [ + 869, + 887 + ], + [ + 888, + 993 + ], + [ + 996, + 1048 + ], + [ + 1050, + 1146 + ], + [ + 1147, + 1160 + ], + [ + 1163, + 1178 + ], + [ + 1179, + 1186 + ], + [ + 1188, + 1235 + ], + [ + 1243, + 1259 + ], + [ + 1267, + 1306 + ], + [ + 1311, + 1327 + ], + [ + 1335, + 1378 + ], + [ + 1384, + 1400 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 49 + ], + [ + 54, + 55 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 108, + 121 + ], + [ + 160, + 161 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 217, + 218 + ], + [ + 219, + 222 + ], + [ + 229, + 231 + ], + [ + 233, + 234 + ], + [ + 238, + 246 + ], + [ + 249, + 250 + ], + [ + 254, + 255 + ], + [ + 257, + 260 + ], + [ + 261, + 262 + ], + [ + 266, + 268 + ], + [ + 269, + 274 + ], + [ + 277, + 279 + ], + [ + 280, + 281 + ], + [ + 284, + 293 + ], + [ + 304, + 305 + ], + [ + 306, + 313 + ], + [ + 316, + 321 + ], + [ + 322, + 325 + ], + [ + 327, + 328 + ], + [ + 331, + 332 + ], + [ + 335, + 336 + ], + [ + 338, + 339 + ], + [ + 342, + 343 + ], + [ + 353, + 354 + ], + [ + 356, + 360 + ], + [ + 361, + 366 + ], + [ + 369, + 371 + ], + [ + 372, + 374 + ], + [ + 375, + 380 + ], + [ + 382, + 385 + ], + [ + 386, + 387 + ], + [ + 388, + 391 + ], + [ + 392, + 394 + ], + [ + 396, + 399 + ], + [ + 401, + 402 + ], + [ + 404, + 405 + ], + [ + 411, + 413 + ], + [ + 414, + 415 + ], + [ + 416, + 417 + ], + [ + 420, + 422 + ], + [ + 424, + 426 + ], + [ + 429, + 434 + ], + [ + 436, + 439 + ], + [ + 442, + 443 + ], + [ + 454, + 455 + ], + [ + 458, + 459 + ], + [ + 473, + 474 + ], + [ + 476, + 478 + ], + [ + 481, + 485 + ], + [ + 487, + 488 + ], + [ + 489, + 491 + ], + [ + 495, + 497 + ], + [ + 501, + 508 + ], + [ + 513, + 514 + ], + [ + 516, + 517 + ], + [ + 518, + 525 + ], + [ + 530, + 532 + ], + [ + 541, + 544 + ], + [ + 545, + 547 + ], + [ + 548, + 549 + ], + [ + 550, + 552 + ], + [ + 565, + 566 + ], + [ + 568, + 570 + ], + [ + 572, + 596 + ], + [ + 601, + 605 + ], + [ + 608, + 615 + ], + [ + 618, + 619 + ], + [ + 621, + 623 + ], + [ + 624, + 626 + ], + [ + 629, + 631 + ], + [ + 635, + 638 + ], + [ + 645, + 655 + ], + [ + 658, + 661 + ], + [ + 662, + 663 + ], + [ + 664, + 665 + ], + [ + 674, + 675 + ], + [ + 676, + 682 + ], + [ + 683, + 685 + ], + [ + 686, + 687 + ], + [ + 690, + 691 + ], + [ + 692, + 693 + ], + [ + 700, + 701 + ], + [ + 703, + 707 + ], + [ + 710, + 714 + ], + [ + 715, + 717 + ], + [ + 722, + 724 + ], + [ + 726, + 727 + ], + [ + 728, + 729 + ], + [ + 730, + 733 + ], + [ + 736, + 737 + ], + [ + 742, + 744 + ], + [ + 745, + 749 + ], + [ + 750, + 753 + ], + [ + 754, + 755 + ], + [ + 757, + 762 + ], + [ + 764, + 772 + ], + [ + 778, + 789 + ], + [ + 791, + 802 + ], + [ + 806, + 828 + ], + [ + 829, + 832 + ], + [ + 836, + 838 + ], + [ + 839, + 840 + ], + [ + 841, + 842 + ], + [ + 846, + 847 + ], + [ + 872, + 875 + ], + [ + 877, + 884 + ], + [ + 891, + 892 + ], + [ + 893, + 896 + ], + [ + 897, + 898 + ], + [ + 900, + 902 + ], + [ + 903, + 904 + ], + [ + 908, + 910 + ], + [ + 912, + 914 + ], + [ + 919, + 920 + ], + [ + 922, + 923 + ], + [ + 924, + 926 + ], + [ + 927, + 928 + ], + [ + 930, + 933 + ], + [ + 935, + 943 + ], + [ + 946, + 947 + ], + [ + 950, + 955 + ], + [ + 960, + 965 + ], + [ + 967, + 972 + ], + [ + 975, + 978 + ], + [ + 981, + 982 + ], + [ + 983, + 984 + ], + [ + 988, + 990 + ], + [ + 999, + 1000 + ], + [ + 1003, + 1004 + ], + [ + 1005, + 1006 + ], + [ + 1009, + 1010 + ], + [ + 1013, + 1015 + ], + [ + 1017, + 1018 + ], + [ + 1021, + 1023 + ], + [ + 1026, + 1028 + ], + [ + 1029, + 1034 + ], + [ + 1035, + 1037 + ], + [ + 1038, + 1039 + ], + [ + 1042, + 1043 + ], + [ + 1044, + 1045 + ], + [ + 1053, + 1054 + ], + [ + 1060, + 1063 + ], + [ + 1064, + 1066 + ], + [ + 1067, + 1070 + ], + [ + 1071, + 1073 + ], + [ + 1074, + 1077 + ], + [ + 1078, + 1080 + ], + [ + 1081, + 1084 + ], + [ + 1085, + 1087 + ], + [ + 1088, + 1091 + ], + [ + 1092, + 1094 + ], + [ + 1097, + 1098 + ], + [ + 1101, + 1102 + ], + [ + 1104, + 1105 + ], + [ + 1106, + 1107 + ], + [ + 1110, + 1111 + ], + [ + 1114, + 1115 + ], + [ + 1117, + 1120 + ], + [ + 1125, + 1126 + ], + [ + 1129, + 1130 + ], + [ + 1135, + 1136 + ], + [ + 1141, + 1143 + ], + [ + 1150, + 1151 + ], + [ + 1152, + 1155 + ], + [ + 1156, + 1157 + ], + [ + 1166, + 1167 + ], + [ + 1170, + 1171 + ], + [ + 1174, + 1175 + ], + [ + 1182, + 1183 + ], + [ + 1191, + 1192 + ], + [ + 1197, + 1199 + ], + [ + 1201, + 1202 + ], + [ + 1206, + 1210 + ], + [ + 1211, + 1213 + ], + [ + 1214, + 1215 + ], + [ + 1218, + 1219 + ], + [ + 1222, + 1224 + ], + [ + 1225, + 1226 + ], + [ + 1229, + 1230 + ], + [ + 1231, + 1232 + ], + [ + 1246, + 1252 + ], + [ + 1255, + 1256 + ], + [ + 1270, + 1272 + ], + [ + 1274, + 1275 + ], + [ + 1277, + 1278 + ], + [ + 1280, + 1285 + ], + [ + 1286, + 1288 + ], + [ + 1289, + 1290 + ], + [ + 1293, + 1294 + ], + [ + 1295, + 1296 + ], + [ + 1299, + 1301 + ], + [ + 1302, + 1303 + ], + [ + 1314, + 1320 + ], + [ + 1323, + 1324 + ], + [ + 1338, + 1340 + ], + [ + 1342, + 1343 + ], + [ + 1345, + 1346 + ], + [ + 1348, + 1349 + ], + [ + 1350, + 1351 + ], + [ + 1353, + 1355 + ], + [ + 1356, + 1357 + ], + [ + 1360, + 1361 + ], + [ + 1364, + 1366 + ], + [ + 1369, + 1371 + ], + [ + 1372, + 1373 + ], + [ + 1374, + 1375 + ], + [ + 1387, + 1393 + ], + [ + 1396, + 1397 + ] + ] + } + }, + { + "filename": "libvips/foreign/heifsave.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 48 + ], + [ + 79, + 86 + ], + [ + 120, + 127 + ], + [ + 137, + 173 + ], + [ + 175, + 219 + ], + [ + 220, + 322 + ], + [ + 324, + 344 + ], + [ + 345, + 363 + ], + [ + 367, + 438 + ], + [ + 440, + 581 + ], + [ + 589, + 598 + ], + [ + 600, + 666 + ], + [ + 678, + 715 + ], + [ + 720, + 736 + ], + [ + 744, + 780 + ], + [ + 785, + 801 + ], + [ + 806, + 838 + ], + [ + 843, + 878 + ], + [ + 881, + 888 + ] + ], + "lines_added": [ + [ + 23, + 39 + ], + [ + 44, + 45 + ], + [ + 82, + 83 + ], + [ + 123, + 124 + ], + [ + 140, + 142 + ], + [ + 143, + 145 + ], + [ + 147, + 148 + ], + [ + 151, + 157 + ], + [ + 158, + 159 + ], + [ + 161, + 164 + ], + [ + 168, + 170 + ], + [ + 178, + 179 + ], + [ + 185, + 187 + ], + [ + 188, + 191 + ], + [ + 195, + 197 + ], + [ + 199, + 202 + ], + [ + 203, + 208 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 223, + 225 + ], + [ + 229, + 230 + ], + [ + 232, + 235 + ], + [ + 238, + 243 + ], + [ + 248, + 249 + ], + [ + 252, + 254 + ], + [ + 255, + 256 + ], + [ + 258, + 260 + ], + [ + 262, + 266 + ], + [ + 268, + 269 + ], + [ + 270, + 273 + ], + [ + 275, + 276 + ], + [ + 278, + 281 + ], + [ + 282, + 288 + ], + [ + 292, + 295 + ], + [ + 296, + 297 + ], + [ + 298, + 299 + ], + [ + 302, + 304 + ], + [ + 307, + 309 + ], + [ + 311, + 314 + ], + [ + 318, + 319 + ], + [ + 327, + 329 + ], + [ + 330, + 338 + ], + [ + 340, + 341 + ], + [ + 348, + 350 + ], + [ + 352, + 357 + ], + [ + 359, + 360 + ], + [ + 370, + 371 + ], + [ + 372, + 375 + ], + [ + 377, + 378 + ], + [ + 381, + 383 + ], + [ + 389, + 390 + ], + [ + 392, + 393 + ], + [ + 395, + 396 + ], + [ + 400, + 401 + ], + [ + 403, + 406 + ], + [ + 407, + 408 + ], + [ + 410, + 413 + ], + [ + 415, + 416 + ], + [ + 418, + 421 + ], + [ + 427, + 428 + ], + [ + 430, + 431 + ], + [ + 434, + 435 + ], + [ + 443, + 445 + ], + [ + 449, + 451 + ], + [ + 455, + 457 + ], + [ + 459, + 460 + ], + [ + 462, + 480 + ], + [ + 482, + 486 + ], + [ + 488, + 492 + ], + [ + 494, + 500 + ], + [ + 503, + 513 + ], + [ + 515, + 516 + ], + [ + 520, + 521 + ], + [ + 523, + 524 + ], + [ + 527, + 531 + ], + [ + 532, + 540 + ], + [ + 542, + 548 + ], + [ + 551, + 552 + ], + [ + 554, + 556 + ], + [ + 557, + 558 + ], + [ + 559, + 562 + ], + [ + 568, + 572 + ], + [ + 574, + 576 + ], + [ + 577, + 578 + ], + [ + 592, + 593 + ], + [ + 594, + 595 + ], + [ + 603, + 604 + ], + [ + 609, + 612 + ], + [ + 613, + 615 + ], + [ + 616, + 619 + ], + [ + 620, + 622 + ], + [ + 623, + 626 + ], + [ + 627, + 629 + ], + [ + 630, + 633 + ], + [ + 634, + 635 + ], + [ + 636, + 637 + ], + [ + 638, + 641 + ], + [ + 642, + 644 + ], + [ + 645, + 648 + ], + [ + 649, + 650 + ], + [ + 651, + 652 + ], + [ + 653, + 656 + ], + [ + 657, + 659 + ], + [ + 662, + 663 + ], + [ + 681, + 682 + ], + [ + 687, + 689 + ], + [ + 691, + 692 + ], + [ + 696, + 698 + ], + [ + 699, + 700 + ], + [ + 702, + 704 + ], + [ + 705, + 706 + ], + [ + 709, + 710 + ], + [ + 711, + 712 + ], + [ + 723, + 729 + ], + [ + 732, + 733 + ], + [ + 747, + 749 + ], + [ + 751, + 752 + ], + [ + 754, + 755 + ], + [ + 759, + 761 + ], + [ + 762, + 764 + ], + [ + 765, + 768 + ], + [ + 769, + 770 + ], + [ + 773, + 775 + ], + [ + 776, + 777 + ], + [ + 788, + 794 + ], + [ + 797, + 798 + ], + [ + 809, + 811 + ], + [ + 813, + 814 + ], + [ + 816, + 817 + ], + [ + 819, + 820 + ], + [ + 821, + 822 + ], + [ + 824, + 826 + ], + [ + 827, + 828 + ], + [ + 831, + 833 + ], + [ + 834, + 835 + ], + [ + 846, + 852 + ], + [ + 855, + 856 + ], + [ + 862, + 864 + ], + [ + 866, + 868 + ], + [ + 874, + 875 + ], + [ + 884, + 885 + ] + ] + } + }, + { + "filename": "libvips/foreign/jp2kload.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 77, + 89 + ], + [ + 100, + 233 + ], + [ + 237, + 377 + ], + [ + 378, + 406 + ], + [ + 409, + 424 + ], + [ + 429, + 601 + ], + [ + 602, + 658 + ], + [ + 664, + 699 + ], + [ + 700, + 720 + ], + [ + 722, + 765 + ], + [ + 768, + 779 + ], + [ + 783, + 799 + ], + [ + 807, + 856 + ], + [ + 857, + 867 + ], + [ + 869, + 888 + ], + [ + 890, + 897 + ], + [ + 906, + 917 + ], + [ + 919, + 946 + ], + [ + 954, + 1034 + ], + [ + 1035, + 1042 + ], + [ + 1046, + 1062 + ], + [ + 1064, + 1116 + ], + [ + 1124, + 1140 + ], + [ + 1148, + 1195 + ], + [ + 1200, + 1216 + ], + [ + 1224, + 1260 + ], + [ + 1266, + 1344 + ], + [ + 1348, + 1441 + ], + [ + 1452, + 1459 + ], + [ + 1468, + 1484 + ], + [ + 1492, + 1499 + ], + [ + 1500, + 1507 + ], + [ + 1508, + 1523 + ], + [ + 1530, + 1549 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 80, + 83 + ], + [ + 84, + 86 + ], + [ + 103, + 105 + ], + [ + 107, + 108 + ], + [ + 112, + 113 + ], + [ + 119, + 120 + ], + [ + 124, + 130 + ], + [ + 131, + 132 + ], + [ + 135, + 136 + ], + [ + 137, + 139 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 153, + 154 + ], + [ + 155, + 156 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 163, + 164 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 174, + 175 + ], + [ + 180, + 182 + ], + [ + 183, + 184 + ], + [ + 187, + 197 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 211, + 214 + ], + [ + 217, + 223 + ], + [ + 226, + 228 + ], + [ + 229, + 230 + ], + [ + 240, + 241 + ], + [ + 244, + 246 + ], + [ + 250, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 268, + 269 + ], + [ + 273, + 275 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 285, + 287 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 295, + 297 + ], + [ + 299, + 300 + ], + [ + 302, + 303 + ], + [ + 305, + 306 + ], + [ + 310, + 312 + ], + [ + 313, + 319 + ], + [ + 323, + 324 + ], + [ + 325, + 332 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 341, + 343 + ], + [ + 345, + 355 + ], + [ + 357, + 367 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 381, + 382 + ], + [ + 383, + 384 + ], + [ + 388, + 389 + ], + [ + 393, + 394 + ], + [ + 398, + 399 + ], + [ + 402, + 403 + ], + [ + 412, + 414 + ], + [ + 415, + 416 + ], + [ + 418, + 419 + ], + [ + 420, + 421 + ], + [ + 432, + 436 + ], + [ + 440, + 442 + ], + [ + 443, + 446 + ], + [ + 450, + 458 + ], + [ + 459, + 460 + ], + [ + 461, + 462 + ], + [ + 463, + 467 + ], + [ + 468, + 469 + ], + [ + 472, + 473 + ], + [ + 474, + 475 + ], + [ + 481, + 482 + ], + [ + 484, + 488 + ], + [ + 489, + 490 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 498, + 502 + ], + [ + 504, + 505 + ], + [ + 509, + 513 + ], + [ + 514, + 518 + ], + [ + 520, + 521 + ], + [ + 523, + 524 + ], + [ + 528, + 532 + ], + [ + 534, + 539 + ], + [ + 544, + 545 + ], + [ + 547, + 548 + ], + [ + 551, + 553 + ], + [ + 554, + 556 + ], + [ + 557, + 558 + ], + [ + 560, + 571 + ], + [ + 572, + 585 + ], + [ + 586, + 587 + ], + [ + 589, + 590 + ], + [ + 595, + 598 + ], + [ + 605, + 608 + ], + [ + 610, + 611 + ], + [ + 613, + 614 + ], + [ + 617, + 619 + ], + [ + 621, + 622 + ], + [ + 626, + 627 + ], + [ + 631, + 632 + ], + [ + 638, + 639 + ], + [ + 641, + 642 + ], + [ + 644, + 645 + ], + [ + 649, + 650 + ], + [ + 654, + 655 + ], + [ + 667, + 690 + ], + [ + 694, + 696 + ], + [ + 703, + 704 + ], + [ + 706, + 707 + ], + [ + 711, + 712 + ], + [ + 716, + 717 + ], + [ + 725, + 732 + ], + [ + 737, + 739 + ], + [ + 741, + 742 + ], + [ + 743, + 744 + ], + [ + 748, + 749 + ], + [ + 751, + 752 + ], + [ + 756, + 757 + ], + [ + 761, + 762 + ], + [ + 771, + 772 + ], + [ + 774, + 776 + ], + [ + 786, + 789 + ], + [ + 794, + 796 + ], + [ + 810, + 811 + ], + [ + 812, + 816 + ], + [ + 817, + 819 + ], + [ + 820, + 821 + ], + [ + 822, + 824 + ], + [ + 825, + 827 + ], + [ + 828, + 831 + ], + [ + 832, + 834 + ], + [ + 839, + 842 + ], + [ + 843, + 844 + ], + [ + 847, + 848 + ], + [ + 851, + 853 + ], + [ + 860, + 864 + ], + [ + 872, + 875 + ], + [ + 880, + 882 + ], + [ + 884, + 885 + ], + [ + 893, + 894 + ], + [ + 909, + 910 + ], + [ + 911, + 914 + ], + [ + 922, + 923 + ], + [ + 924, + 925 + ], + [ + 926, + 929 + ], + [ + 930, + 931 + ], + [ + 934, + 935 + ], + [ + 936, + 940 + ], + [ + 941, + 943 + ], + [ + 957, + 960 + ], + [ + 961, + 962 + ], + [ + 965, + 966 + ], + [ + 968, + 970 + ], + [ + 976, + 977 + ], + [ + 980, + 982 + ], + [ + 985, + 987 + ], + [ + 989, + 991 + ], + [ + 993, + 997 + ], + [ + 1001, + 1002 + ], + [ + 1003, + 1007 + ], + [ + 1009, + 1010 + ], + [ + 1012, + 1018 + ], + [ + 1019, + 1021 + ], + [ + 1022, + 1023 + ], + [ + 1026, + 1027 + ], + [ + 1028, + 1029 + ], + [ + 1030, + 1031 + ], + [ + 1038, + 1039 + ], + [ + 1049, + 1052 + ], + [ + 1053, + 1055 + ], + [ + 1058, + 1059 + ], + [ + 1067, + 1068 + ], + [ + 1073, + 1075 + ], + [ + 1077, + 1078 + ], + [ + 1082, + 1085 + ], + [ + 1086, + 1088 + ], + [ + 1089, + 1090 + ], + [ + 1092, + 1093 + ], + [ + 1095, + 1096 + ], + [ + 1100, + 1104 + ], + [ + 1105, + 1106 + ], + [ + 1109, + 1111 + ], + [ + 1112, + 1113 + ], + [ + 1127, + 1133 + ], + [ + 1136, + 1137 + ], + [ + 1151, + 1153 + ], + [ + 1155, + 1156 + ], + [ + 1158, + 1159 + ], + [ + 1161, + 1166 + ], + [ + 1167, + 1169 + ], + [ + 1170, + 1171 + ], + [ + 1174, + 1175 + ], + [ + 1179, + 1183 + ], + [ + 1184, + 1185 + ], + [ + 1188, + 1190 + ], + [ + 1191, + 1192 + ], + [ + 1203, + 1209 + ], + [ + 1212, + 1213 + ], + [ + 1227, + 1229 + ], + [ + 1231, + 1232 + ], + [ + 1234, + 1235 + ], + [ + 1237, + 1238 + ], + [ + 1239, + 1240 + ], + [ + 1242, + 1246 + ], + [ + 1247, + 1248 + ], + [ + 1251, + 1253 + ], + [ + 1254, + 1255 + ], + [ + 1256, + 1257 + ], + [ + 1269, + 1275 + ], + [ + 1278, + 1280 + ], + [ + 1283, + 1285 + ], + [ + 1289, + 1290 + ], + [ + 1293, + 1295 + ], + [ + 1299, + 1300 + ], + [ + 1303, + 1305 + ], + [ + 1307, + 1308 + ], + [ + 1310, + 1311 + ], + [ + 1315, + 1317 + ], + [ + 1321, + 1322 + ], + [ + 1323, + 1327 + ], + [ + 1329, + 1330 + ], + [ + 1331, + 1332 + ], + [ + 1335, + 1339 + ], + [ + 1340, + 1341 + ], + [ + 1351, + 1354 + ], + [ + 1360, + 1375 + ], + [ + 1377, + 1378 + ], + [ + 1379, + 1383 + ], + [ + 1385, + 1390 + ], + [ + 1395, + 1396 + ], + [ + 1398, + 1400 + ], + [ + 1403, + 1404 + ], + [ + 1406, + 1408 + ], + [ + 1409, + 1410 + ], + [ + 1411, + 1415 + ], + [ + 1416, + 1418 + ], + [ + 1422, + 1423 + ], + [ + 1424, + 1425 + ], + [ + 1430, + 1434 + ], + [ + 1435, + 1438 + ], + [ + 1455, + 1456 + ], + [ + 1471, + 1472 + ], + [ + 1476, + 1479 + ], + [ + 1480, + 1481 + ], + [ + 1495, + 1496 + ], + [ + 1503, + 1504 + ], + [ + 1511, + 1512 + ], + [ + 1513, + 1516 + ], + [ + 1517, + 1518 + ], + [ + 1519, + 1520 + ], + [ + 1533, + 1534 + ], + [ + 1538, + 1539 + ], + [ + 1543, + 1546 + ], + [ + 1547, + 1548 + ] + ] + } + }, + { + "filename": "libvips/foreign/jp2ksave.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 118, + 267 + ], + [ + 268, + 294 + ], + [ + 302, + 399 + ], + [ + 405, + 456 + ], + [ + 461, + 505 + ], + [ + 507, + 554 + ], + [ + 557, + 582 + ], + [ + 585, + 634 + ], + [ + 639, + 674 + ], + [ + 676, + 688 + ], + [ + 705, + 712 + ], + [ + 728, + 735 + ], + [ + 736, + 756 + ], + [ + 759, + 769 + ], + [ + 788, + 795 + ], + [ + 797, + 806 + ], + [ + 807, + 832 + ], + [ + 842, + 859 + ], + [ + 867, + 927 + ], + [ + 929, + 956 + ], + [ + 959, + 1011 + ], + [ + 1027, + 1055 + ], + [ + 1057, + 1073 + ], + [ + 1081, + 1092 + ], + [ + 1093, + 1117 + ], + [ + 1119, + 1135 + ], + [ + 1140, + 1172 + ], + [ + 1174, + 1197 + ], + [ + 1200, + 1217 + ], + [ + 1218, + 1258 + ], + [ + 1268, + 1304 + ], + [ + 1309, + 1321 + ], + [ + 1325, + 1335 + ], + [ + 1341, + 1352 + ], + [ + 1354, + 1435 + ], + [ + 1471, + 1487 + ], + [ + 1505, + 1512 + ], + [ + 1513, + 1536 + ], + [ + 1553, + 1567 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 121, + 123 + ], + [ + 125, + 126 + ], + [ + 129, + 132 + ], + [ + 133, + 135 + ], + [ + 136, + 138 + ], + [ + 139, + 140 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 158, + 160 + ], + [ + 161, + 162 + ], + [ + 164, + 166 + ], + [ + 167, + 168 + ], + [ + 169, + 171 + ], + [ + 172, + 173 + ], + [ + 178, + 179 + ], + [ + 184, + 196 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 207, + 208 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 223, + 224 + ], + [ + 225, + 231 + ], + [ + 235, + 258 + ], + [ + 262, + 264 + ], + [ + 271, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 278 + ], + [ + 280, + 281 + ], + [ + 285, + 286 + ], + [ + 290, + 291 + ], + [ + 305, + 317 + ], + [ + 319, + 340 + ], + [ + 342, + 344 + ], + [ + 346, + 348 + ], + [ + 354, + 355 + ], + [ + 361, + 362 + ], + [ + 363, + 365 + ], + [ + 366, + 367 + ], + [ + 368, + 370 + ], + [ + 373, + 374 + ], + [ + 375, + 376 + ], + [ + 379, + 380 + ], + [ + 383, + 384 + ], + [ + 387, + 388 + ], + [ + 391, + 392 + ], + [ + 395, + 396 + ], + [ + 408, + 418 + ], + [ + 420, + 422 + ], + [ + 424, + 425 + ], + [ + 431, + 434 + ], + [ + 435, + 436 + ], + [ + 439, + 440 + ], + [ + 442, + 443 + ], + [ + 447, + 448 + ], + [ + 452, + 453 + ], + [ + 464, + 465 + ], + [ + 467, + 468 + ], + [ + 473, + 474 + ], + [ + 480, + 481 + ], + [ + 482, + 484 + ], + [ + 488, + 489 + ], + [ + 492, + 493 + ], + [ + 496, + 497 + ], + [ + 501, + 502 + ], + [ + 510, + 511 + ], + [ + 512, + 515 + ], + [ + 516, + 518 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 523, + 524 + ], + [ + 526, + 527 + ], + [ + 529, + 533 + ], + [ + 535, + 536 + ], + [ + 539, + 541 + ], + [ + 546, + 548 + ], + [ + 550, + 551 + ], + [ + 560, + 561 + ], + [ + 564, + 566 + ], + [ + 570, + 572 + ], + [ + 577, + 579 + ], + [ + 588, + 589 + ], + [ + 592, + 593 + ], + [ + 595, + 597 + ], + [ + 599, + 600 + ], + [ + 604, + 606 + ], + [ + 612, + 613 + ], + [ + 614, + 615 + ], + [ + 619, + 621 + ], + [ + 622, + 629 + ], + [ + 630, + 631 + ], + [ + 642, + 643 + ], + [ + 644, + 647 + ], + [ + 651, + 652 + ], + [ + 653, + 654 + ], + [ + 655, + 658 + ], + [ + 660, + 661 + ], + [ + 664, + 665 + ], + [ + 668, + 669 + ], + [ + 670, + 671 + ], + [ + 679, + 681 + ], + [ + 684, + 685 + ], + [ + 708, + 709 + ], + [ + 731, + 732 + ], + [ + 739, + 740 + ], + [ + 742, + 744 + ], + [ + 749, + 750 + ], + [ + 752, + 753 + ], + [ + 762, + 764 + ], + [ + 765, + 766 + ], + [ + 791, + 792 + ], + [ + 800, + 801 + ], + [ + 802, + 803 + ], + [ + 810, + 812 + ], + [ + 816, + 820 + ], + [ + 822, + 823 + ], + [ + 828, + 829 + ], + [ + 845, + 846 + ], + [ + 850, + 851 + ], + [ + 854, + 856 + ], + [ + 870, + 874 + ], + [ + 875, + 877 + ], + [ + 882, + 886 + ], + [ + 890, + 896 + ], + [ + 897, + 898 + ], + [ + 899, + 901 + ], + [ + 902, + 904 + ], + [ + 908, + 909 + ], + [ + 910, + 912 + ], + [ + 915, + 918 + ], + [ + 922, + 924 + ], + [ + 932, + 934 + ], + [ + 937, + 940 + ], + [ + 941, + 942 + ], + [ + 943, + 945 + ], + [ + 946, + 947 + ], + [ + 950, + 951 + ], + [ + 952, + 953 + ], + [ + 962, + 963 + ], + [ + 969, + 972 + ], + [ + 973, + 975 + ], + [ + 976, + 979 + ], + [ + 980, + 982 + ], + [ + 983, + 986 + ], + [ + 987, + 989 + ], + [ + 990, + 993 + ], + [ + 994, + 995 + ], + [ + 996, + 997 + ], + [ + 998, + 1001 + ], + [ + 1002, + 1004 + ], + [ + 1007, + 1008 + ], + [ + 1030, + 1032 + ], + [ + 1034, + 1035 + ], + [ + 1039, + 1041 + ], + [ + 1042, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1049, + 1050 + ], + [ + 1051, + 1052 + ], + [ + 1060, + 1063 + ], + [ + 1064, + 1066 + ], + [ + 1069, + 1070 + ], + [ + 1084, + 1086 + ], + [ + 1088, + 1089 + ], + [ + 1096, + 1098 + ], + [ + 1099, + 1101 + ], + [ + 1102, + 1105 + ], + [ + 1106, + 1107 + ], + [ + 1111, + 1112 + ], + [ + 1113, + 1114 + ], + [ + 1122, + 1125 + ], + [ + 1126, + 1128 + ], + [ + 1131, + 1132 + ], + [ + 1143, + 1145 + ], + [ + 1147, + 1148 + ], + [ + 1153, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1158, + 1160 + ], + [ + 1161, + 1162 + ], + [ + 1166, + 1167 + ], + [ + 1168, + 1169 + ], + [ + 1177, + 1180 + ], + [ + 1181, + 1183 + ], + [ + 1186, + 1187 + ], + [ + 1193, + 1194 + ], + [ + 1203, + 1205 + ], + [ + 1207, + 1209 + ], + [ + 1213, + 1214 + ], + [ + 1221, + 1222 + ], + [ + 1223, + 1224 + ], + [ + 1225, + 1226 + ], + [ + 1227, + 1229 + ], + [ + 1232, + 1233 + ], + [ + 1234, + 1235 + ], + [ + 1238, + 1239 + ], + [ + 1242, + 1243 + ], + [ + 1246, + 1247 + ], + [ + 1250, + 1251 + ], + [ + 1254, + 1255 + ], + [ + 1271, + 1273 + ], + [ + 1279, + 1282 + ], + [ + 1283, + 1284 + ], + [ + 1285, + 1286 + ], + [ + 1287, + 1288 + ], + [ + 1290, + 1291 + ], + [ + 1295, + 1296 + ], + [ + 1300, + 1301 + ], + [ + 1312, + 1313 + ], + [ + 1314, + 1318 + ], + [ + 1328, + 1329 + ], + [ + 1331, + 1332 + ], + [ + 1344, + 1345 + ], + [ + 1348, + 1349 + ], + [ + 1357, + 1361 + ], + [ + 1365, + 1370 + ], + [ + 1372, + 1380 + ], + [ + 1382, + 1383 + ], + [ + 1384, + 1387 + ], + [ + 1390, + 1392 + ], + [ + 1393, + 1394 + ], + [ + 1395, + 1397 + ], + [ + 1398, + 1401 + ], + [ + 1403, + 1407 + ], + [ + 1409, + 1412 + ], + [ + 1414, + 1415 + ], + [ + 1416, + 1417 + ], + [ + 1418, + 1419 + ], + [ + 1424, + 1425 + ], + [ + 1427, + 1428 + ], + [ + 1429, + 1432 + ], + [ + 1474, + 1475 + ], + [ + 1479, + 1482 + ], + [ + 1483, + 1484 + ], + [ + 1508, + 1509 + ], + [ + 1516, + 1519 + ], + [ + 1520, + 1523 + ], + [ + 1526, + 1527 + ], + [ + 1529, + 1530 + ], + [ + 1532, + 1533 + ], + [ + 1556, + 1557 + ], + [ + 1561, + 1564 + ], + [ + 1565, + 1566 + ] + ] + } + }, + { + "filename": "libvips/foreign/jpeg.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 42, + 50 + ], + [ + 71, + 83 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 45, + 47 + ], + [ + 74, + 76 + ], + [ + 78, + 80 + ] + ] + } + }, + { + "filename": "libvips/foreign/jpeg2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 38, + 45 + ], + [ + 62, + 73 + ], + [ + 91, + 98 + ], + [ + 109, + 146 + ], + [ + 170, + 177 + ], + [ + 181, + 188 + ], + [ + 228, + 235 + ], + [ + 242, + 249 + ], + [ + 252, + 291 + ], + [ + 295, + 367 + ], + [ + 372, + 415 + ], + [ + 416, + 444 + ], + [ + 445, + 504 + ], + [ + 509, + 516 + ], + [ + 524, + 540 + ], + [ + 553, + 563 + ], + [ + 564, + 580 + ], + [ + 582, + 590 + ], + [ + 591, + 630 + ], + [ + 636, + 701 + ], + [ + 703, + 722 + ], + [ + 735, + 757 + ], + [ + 759, + 797 + ], + [ + 798, + 974 + ], + [ + 976, + 1034 + ] + ], + "lines_added": [ + [ + 41, + 42 + ], + [ + 65, + 66 + ], + [ + 69, + 70 + ], + [ + 94, + 95 + ], + [ + 112, + 113 + ], + [ + 115, + 116 + ], + [ + 121, + 122 + ], + [ + 123, + 127 + ], + [ + 128, + 137 + ], + [ + 142, + 143 + ], + [ + 173, + 174 + ], + [ + 184, + 185 + ], + [ + 231, + 232 + ], + [ + 245, + 246 + ], + [ + 255, + 257 + ], + [ + 261, + 267 + ], + [ + 268, + 269 + ], + [ + 274, + 275 + ], + [ + 278, + 279 + ], + [ + 282, + 283 + ], + [ + 285, + 286 + ], + [ + 287, + 288 + ], + [ + 298, + 299 + ], + [ + 302, + 304 + ], + [ + 306, + 308 + ], + [ + 309, + 312 + ], + [ + 318, + 320 + ], + [ + 324, + 325 + ], + [ + 328, + 329 + ], + [ + 330, + 331 + ], + [ + 334, + 335 + ], + [ + 341, + 342 + ], + [ + 343, + 348 + ], + [ + 349, + 350 + ], + [ + 352, + 353 + ], + [ + 358, + 359 + ], + [ + 360, + 364 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 379, + 380 + ], + [ + 381, + 382 + ], + [ + 385, + 386 + ], + [ + 387, + 388 + ], + [ + 391, + 392 + ], + [ + 393, + 394 + ], + [ + 397, + 400 + ], + [ + 403, + 405 + ], + [ + 408, + 409 + ], + [ + 411, + 412 + ], + [ + 419, + 420 + ], + [ + 424, + 426 + ], + [ + 427, + 428 + ], + [ + 429, + 433 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 440, + 441 + ], + [ + 448, + 449 + ], + [ + 452, + 453 + ], + [ + 456, + 457 + ], + [ + 458, + 459 + ], + [ + 461, + 462 + ], + [ + 465, + 467 + ], + [ + 469, + 470 + ], + [ + 471, + 472 + ], + [ + 474, + 475 + ], + [ + 479, + 480 + ], + [ + 484, + 487 + ], + [ + 493, + 495 + ], + [ + 496, + 498 + ], + [ + 499, + 501 + ], + [ + 512, + 513 + ], + [ + 527, + 528 + ], + [ + 530, + 531 + ], + [ + 533, + 534 + ], + [ + 536, + 537 + ], + [ + 556, + 558 + ], + [ + 559, + 560 + ], + [ + 567, + 571 + ], + [ + 575, + 577 + ], + [ + 585, + 587 + ], + [ + 594, + 596 + ], + [ + 599, + 600 + ], + [ + 604, + 606 + ], + [ + 611, + 612 + ], + [ + 616, + 617 + ], + [ + 618, + 620 + ], + [ + 621, + 623 + ], + [ + 626, + 627 + ], + [ + 639, + 641 + ], + [ + 644, + 646 + ], + [ + 647, + 649 + ], + [ + 652, + 653 + ], + [ + 654, + 663 + ], + [ + 665, + 666 + ], + [ + 669, + 680 + ], + [ + 686, + 689 + ], + [ + 694, + 696 + ], + [ + 697, + 698 + ], + [ + 706, + 711 + ], + [ + 716, + 719 + ], + [ + 738, + 741 + ], + [ + 742, + 745 + ], + [ + 751, + 754 + ], + [ + 762, + 763 + ], + [ + 764, + 765 + ], + [ + 769, + 771 + ], + [ + 773, + 775 + ], + [ + 777, + 779 + ], + [ + 782, + 784 + ], + [ + 786, + 787 + ], + [ + 790, + 792 + ], + [ + 793, + 794 + ], + [ + 801, + 803 + ], + [ + 805, + 806 + ], + [ + 810, + 813 + ], + [ + 816, + 817 + ], + [ + 821, + 822 + ], + [ + 826, + 830 + ], + [ + 831, + 832 + ], + [ + 837, + 839 + ], + [ + 841, + 842 + ], + [ + 844, + 845 + ], + [ + 847, + 850 + ], + [ + 855, + 856 + ], + [ + 858, + 859 + ], + [ + 861, + 863 + ], + [ + 864, + 865 + ], + [ + 866, + 867 + ], + [ + 869, + 870 + ], + [ + 873, + 874 + ], + [ + 876, + 877 + ], + [ + 878, + 879 + ], + [ + 884, + 885 + ], + [ + 887, + 889 + ], + [ + 895, + 897 + ], + [ + 899, + 901 + ], + [ + 904, + 906 + ], + [ + 907, + 908 + ], + [ + 910, + 911 + ], + [ + 916, + 920 + ], + [ + 921, + 925 + ], + [ + 927, + 929 + ], + [ + 932, + 935 + ], + [ + 938, + 940 + ], + [ + 941, + 942 + ], + [ + 945, + 946 + ], + [ + 950, + 954 + ], + [ + 956, + 958 + ], + [ + 959, + 964 + ], + [ + 968, + 971 + ], + [ + 979, + 983 + ], + [ + 986, + 988 + ], + [ + 990, + 991 + ], + [ + 994, + 997 + ], + [ + 1000, + 1003 + ], + [ + 1007, + 1009 + ], + [ + 1010, + 1013 + ], + [ + 1014, + 1016 + ], + [ + 1017, + 1018 + ], + [ + 1021, + 1022 + ], + [ + 1025, + 1029 + ], + [ + 1030, + 1031 + ] + ] + } + }, + { + "filename": "libvips/foreign/jpegload.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 90, + 171 + ], + [ + 174, + 217 + ], + [ + 224, + 337 + ], + [ + 339, + 362 + ], + [ + 368, + 415 + ], + [ + 416, + 437 + ], + [ + 446, + 474 + ], + [ + 478, + 493 + ], + [ + 494, + 503 + ], + [ + 504, + 520 + ], + [ + 527, + 548 + ], + [ + 549, + 564 + ], + [ + 570, + 595 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 93, + 95 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 111, + 118 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 143, + 147 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 156, + 160 + ], + [ + 161, + 162 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 177, + 178 + ], + [ + 184, + 185 + ], + [ + 190, + 193 + ], + [ + 194, + 196 + ], + [ + 197, + 200 + ], + [ + 201, + 203 + ], + [ + 204, + 207 + ], + [ + 208, + 210 + ], + [ + 213, + 214 + ], + [ + 227, + 229 + ], + [ + 231, + 232 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 242, + 244 + ], + [ + 245, + 246 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ], + [ + 255, + 257 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 267, + 268 + ], + [ + 274, + 280 + ], + [ + 283, + 284 + ], + [ + 290, + 291 + ], + [ + 296, + 298 + ], + [ + 300, + 301 + ], + [ + 305, + 309 + ], + [ + 310, + 312 + ], + [ + 313, + 314 + ], + [ + 317, + 318 + ], + [ + 322, + 326 + ], + [ + 327, + 328 + ], + [ + 331, + 332 + ], + [ + 333, + 334 + ], + [ + 342, + 343 + ], + [ + 349, + 355 + ], + [ + 358, + 359 + ], + [ + 371, + 373 + ], + [ + 375, + 376 + ], + [ + 378, + 379 + ], + [ + 381, + 386 + ], + [ + 387, + 389 + ], + [ + 390, + 391 + ], + [ + 394, + 395 + ], + [ + 399, + 403 + ], + [ + 404, + 405 + ], + [ + 408, + 410 + ], + [ + 411, + 412 + ], + [ + 419, + 420 + ], + [ + 424, + 430 + ], + [ + 433, + 434 + ], + [ + 449, + 450 + ], + [ + 451, + 452 + ], + [ + 454, + 456 + ], + [ + 461, + 462 + ], + [ + 463, + 464 + ], + [ + 465, + 467 + ], + [ + 470, + 471 + ], + [ + 481, + 485 + ], + [ + 489, + 490 + ], + [ + 497, + 498 + ], + [ + 499, + 500 + ], + [ + 507, + 508 + ], + [ + 512, + 515 + ], + [ + 516, + 517 + ], + [ + 530, + 531 + ], + [ + 534, + 535 + ], + [ + 536, + 538 + ], + [ + 544, + 545 + ], + [ + 552, + 553 + ], + [ + 554, + 557 + ], + [ + 558, + 559 + ], + [ + 560, + 561 + ], + [ + 573, + 574 + ], + [ + 577, + 578 + ], + [ + 584, + 585 + ], + [ + 589, + 592 + ], + [ + 593, + 594 + ] + ] + } + }, + { + "filename": "libvips/foreign/jpegsave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 90, + 97 + ], + [ + 111, + 119 + ], + [ + 124, + 150 + ], + [ + 152, + 159 + ], + [ + 162, + 249 + ], + [ + 257, + 312 + ], + [ + 314, + 331 + ], + [ + 332, + 380 + ], + [ + 388, + 457 + ], + [ + 461, + 472 + ], + [ + 475, + 525 + ], + [ + 526, + 534 + ], + [ + 549, + 570 + ], + [ + 592, + 603 + ], + [ + 610, + 617 + ], + [ + 619, + 656 + ], + [ + 674, + 695 + ], + [ + 707, + 714 + ], + [ + 718, + 754 + ], + [ + 771, + 785 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 93, + 94 + ], + [ + 114, + 116 + ], + [ + 127, + 128 + ], + [ + 131, + 133 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 144, + 145 + ], + [ + 146, + 147 + ], + [ + 155, + 156 + ], + [ + 165, + 168 + ], + [ + 169, + 171 + ], + [ + 172, + 175 + ], + [ + 176, + 178 + ], + [ + 179, + 182 + ], + [ + 183, + 185 + ], + [ + 186, + 189 + ], + [ + 190, + 192 + ], + [ + 193, + 196 + ], + [ + 197, + 199 + ], + [ + 200, + 203 + ], + [ + 204, + 206 + ], + [ + 207, + 210 + ], + [ + 211, + 213 + ], + [ + 214, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 224 + ], + [ + 225, + 227 + ], + [ + 228, + 231 + ], + [ + 232, + 233 + ], + [ + 234, + 235 + ], + [ + 236, + 239 + ], + [ + 240, + 242 + ], + [ + 245, + 246 + ], + [ + 260, + 262 + ], + [ + 264, + 265 + ], + [ + 268, + 269 + ], + [ + 271, + 273 + ], + [ + 274, + 281 + ], + [ + 282, + 283 + ], + [ + 286, + 288 + ], + [ + 289, + 290 + ], + [ + 296, + 297 + ], + [ + 299, + 305 + ], + [ + 308, + 309 + ], + [ + 317, + 318 + ], + [ + 323, + 325 + ], + [ + 327, + 328 + ], + [ + 335, + 348 + ], + [ + 349, + 350 + ], + [ + 351, + 352 + ], + [ + 355, + 356 + ], + [ + 357, + 358 + ], + [ + 364, + 365 + ], + [ + 367, + 373 + ], + [ + 376, + 377 + ], + [ + 391, + 393 + ], + [ + 395, + 396 + ], + [ + 399, + 400 + ], + [ + 405, + 419 + ], + [ + 421, + 424 + ], + [ + 425, + 426 + ], + [ + 427, + 428 + ], + [ + 431, + 433 + ], + [ + 434, + 435 + ], + [ + 441, + 442 + ], + [ + 444, + 450 + ], + [ + 453, + 454 + ], + [ + 464, + 466 + ], + [ + 468, + 469 + ], + [ + 478, + 492 + ], + [ + 494, + 495 + ], + [ + 496, + 502 + ], + [ + 503, + 504 + ], + [ + 505, + 506 + ], + [ + 507, + 508 + ], + [ + 511, + 512 + ], + [ + 516, + 517 + ], + [ + 521, + 522 + ], + [ + 529, + 531 + ], + [ + 552, + 554 + ], + [ + 555, + 556 + ], + [ + 560, + 561 + ], + [ + 564, + 565 + ], + [ + 566, + 567 + ], + [ + 595, + 596 + ], + [ + 597, + 598 + ], + [ + 599, + 600 + ], + [ + 613, + 614 + ], + [ + 622, + 624 + ], + [ + 628, + 629 + ], + [ + 631, + 632 + ], + [ + 638, + 639 + ], + [ + 643, + 646 + ], + [ + 647, + 648 + ], + [ + 652, + 653 + ], + [ + 677, + 678 + ], + [ + 682, + 685 + ], + [ + 686, + 687 + ], + [ + 691, + 692 + ], + [ + 710, + 711 + ], + [ + 721, + 722 + ], + [ + 727, + 728 + ], + [ + 729, + 732 + ], + [ + 733, + 736 + ], + [ + 739, + 740 + ], + [ + 742, + 743 + ], + [ + 745, + 746 + ], + [ + 750, + 751 + ], + [ + 774, + 775 + ], + [ + 779, + 782 + ], + [ + 783, + 784 + ] + ] + } + }, + { + "filename": "libvips/foreign/jxlload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 66, + 73 + ], + [ + 116, + 410 + ], + [ + 420, + 429 + ], + [ + 438, + 445 + ], + [ + 462, + 551 + ], + [ + 552, + 680 + ], + [ + 685, + 705 + ], + [ + 706, + 713 + ], + [ + 717, + 727 + ], + [ + 729, + 780 + ], + [ + 788, + 804 + ], + [ + 812, + 858 + ], + [ + 863, + 879 + ], + [ + 887, + 922 + ], + [ + 928, + 944 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 69, + 70 + ], + [ + 119, + 121 + ], + [ + 123, + 124 + ], + [ + 128, + 129 + ], + [ + 131, + 135 + ], + [ + 136, + 137 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 155, + 156 + ], + [ + 158, + 161 + ], + [ + 162, + 167 + ], + [ + 169, + 171 + ], + [ + 172, + 173 + ], + [ + 176, + 177 + ], + [ + 181, + 184 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 195 + ], + [ + 199, + 201 + ], + [ + 203, + 204 + ], + [ + 205, + 207 + ], + [ + 208, + 209 + ], + [ + 211, + 213 + ], + [ + 216, + 218 + ], + [ + 220, + 221 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 230 + ], + [ + 233, + 234 + ], + [ + 237, + 238 + ], + [ + 241, + 242 + ], + [ + 245, + 246 + ], + [ + 249, + 250 + ], + [ + 253, + 254 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 273, + 274 + ], + [ + 277, + 278 + ], + [ + 281, + 282 + ], + [ + 285, + 286 + ], + [ + 289, + 290 + ], + [ + 295, + 296 + ], + [ + 297, + 328 + ], + [ + 331, + 332 + ], + [ + 333, + 338 + ], + [ + 340, + 342 + ], + [ + 344, + 346 + ], + [ + 349, + 350 + ], + [ + 352, + 356 + ], + [ + 359, + 361 + ], + [ + 365, + 366 + ], + [ + 368, + 370 + ], + [ + 373, + 374 + ], + [ + 376, + 381 + ], + [ + 384, + 386 + ], + [ + 388, + 389 + ], + [ + 392, + 393 + ], + [ + 394, + 395 + ], + [ + 399, + 404 + ], + [ + 406, + 407 + ], + [ + 423, + 424 + ], + [ + 425, + 426 + ], + [ + 441, + 442 + ], + [ + 465, + 468 + ], + [ + 469, + 471 + ], + [ + 473, + 481 + ], + [ + 485, + 487 + ], + [ + 488, + 489 + ], + [ + 492, + 493 + ], + [ + 499, + 500 + ], + [ + 502, + 504 + ], + [ + 505, + 512 + ], + [ + 514, + 518 + ], + [ + 522, + 534 + ], + [ + 536, + 537 + ], + [ + 541, + 543 + ], + [ + 544, + 546 + ], + [ + 547, + 548 + ], + [ + 555, + 556 + ], + [ + 561, + 568 + ], + [ + 571, + 574 + ], + [ + 575, + 586 + ], + [ + 592, + 596 + ], + [ + 597, + 599 + ], + [ + 600, + 602 + ], + [ + 603, + 604 + ], + [ + 607, + 608 + ], + [ + 609, + 610 + ], + [ + 611, + 613 + ], + [ + 618, + 619 + ], + [ + 622, + 624 + ], + [ + 628, + 637 + ], + [ + 639, + 643 + ], + [ + 647, + 663 + ], + [ + 664, + 669 + ], + [ + 670, + 677 + ], + [ + 688, + 689 + ], + [ + 690, + 692 + ], + [ + 693, + 694 + ], + [ + 697, + 698 + ], + [ + 699, + 700 + ], + [ + 701, + 702 + ], + [ + 709, + 710 + ], + [ + 723, + 724 + ], + [ + 732, + 733 + ], + [ + 738, + 740 + ], + [ + 742, + 743 + ], + [ + 747, + 750 + ], + [ + 751, + 753 + ], + [ + 754, + 755 + ], + [ + 757, + 758 + ], + [ + 760, + 761 + ], + [ + 765, + 769 + ], + [ + 770, + 771 + ], + [ + 774, + 775 + ], + [ + 776, + 777 + ], + [ + 791, + 797 + ], + [ + 800, + 801 + ], + [ + 815, + 817 + ], + [ + 819, + 820 + ], + [ + 822, + 823 + ], + [ + 825, + 830 + ], + [ + 831, + 833 + ], + [ + 834, + 835 + ], + [ + 838, + 839 + ], + [ + 843, + 847 + ], + [ + 848, + 849 + ], + [ + 852, + 853 + ], + [ + 854, + 855 + ], + [ + 866, + 872 + ], + [ + 875, + 876 + ], + [ + 890, + 892 + ], + [ + 894, + 895 + ], + [ + 897, + 898 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 905, + 909 + ], + [ + 910, + 911 + ], + [ + 914, + 915 + ], + [ + 916, + 917 + ], + [ + 918, + 919 + ], + [ + 931, + 937 + ], + [ + 940, + 941 + ] + ] + } + }, + { + "filename": "libvips/foreign/jxlsave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 104, + 263 + ], + [ + 264, + 285 + ], + [ + 302, + 309 + ], + [ + 317, + 325 + ], + [ + 326, + 335 + ], + [ + 336, + 347 + ], + [ + 349, + 444 + ], + [ + 445, + 476 + ], + [ + 486, + 497 + ], + [ + 499, + 506 + ], + [ + 514, + 558 + ], + [ + 565, + 599 + ], + [ + 601, + 617 + ], + [ + 625, + 661 + ], + [ + 663, + 679 + ], + [ + 684, + 716 + ], + [ + 718, + 734 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 107, + 109 + ], + [ + 111, + 112 + ], + [ + 115, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 134, + 135 + ], + [ + 136, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 178 + ], + [ + 180, + 182 + ], + [ + 184, + 186 + ], + [ + 189, + 190 + ], + [ + 192, + 195 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 225, + 226 + ], + [ + 229, + 230 + ], + [ + 236, + 238 + ], + [ + 243, + 245 + ], + [ + 248, + 249 + ], + [ + 251, + 254 + ], + [ + 255, + 260 + ], + [ + 267, + 268 + ], + [ + 269, + 271 + ], + [ + 275, + 277 + ], + [ + 279, + 280 + ], + [ + 281, + 282 + ], + [ + 305, + 306 + ], + [ + 320, + 322 + ], + [ + 329, + 330 + ], + [ + 331, + 332 + ], + [ + 339, + 340 + ], + [ + 342, + 344 + ], + [ + 352, + 355 + ], + [ + 359, + 360 + ], + [ + 363, + 366 + ], + [ + 368, + 369 + ], + [ + 370, + 375 + ], + [ + 381, + 382 + ], + [ + 383, + 384 + ], + [ + 386, + 388 + ], + [ + 391, + 392 + ], + [ + 394, + 396 + ], + [ + 398, + 403 + ], + [ + 409, + 411 + ], + [ + 412, + 419 + ], + [ + 421, + 428 + ], + [ + 430, + 435 + ], + [ + 440, + 441 + ], + [ + 448, + 451 + ], + [ + 453, + 457 + ], + [ + 460, + 462 + ], + [ + 463, + 464 + ], + [ + 465, + 466 + ], + [ + 467, + 468 + ], + [ + 469, + 471 + ], + [ + 472, + 473 + ], + [ + 489, + 490 + ], + [ + 491, + 492 + ], + [ + 493, + 494 + ], + [ + 502, + 503 + ], + [ + 517, + 520 + ], + [ + 521, + 523 + ], + [ + 524, + 527 + ], + [ + 528, + 530 + ], + [ + 531, + 534 + ], + [ + 535, + 537 + ], + [ + 538, + 541 + ], + [ + 542, + 544 + ], + [ + 545, + 548 + ], + [ + 549, + 551 + ], + [ + 554, + 555 + ], + [ + 568, + 569 + ], + [ + 574, + 576 + ], + [ + 578, + 579 + ], + [ + 583, + 585 + ], + [ + 586, + 588 + ], + [ + 589, + 590 + ], + [ + 593, + 594 + ], + [ + 595, + 596 + ], + [ + 604, + 610 + ], + [ + 613, + 614 + ], + [ + 628, + 630 + ], + [ + 632, + 633 + ], + [ + 635, + 636 + ], + [ + 640, + 642 + ], + [ + 643, + 645 + ], + [ + 646, + 649 + ], + [ + 650, + 651 + ], + [ + 654, + 656 + ], + [ + 657, + 658 + ], + [ + 666, + 672 + ], + [ + 675, + 676 + ], + [ + 687, + 689 + ], + [ + 691, + 692 + ], + [ + 694, + 695 + ], + [ + 697, + 698 + ], + [ + 699, + 700 + ], + [ + 702, + 704 + ], + [ + 705, + 706 + ], + [ + 709, + 711 + ], + [ + 712, + 713 + ], + [ + 721, + 727 + ], + [ + 730, + 731 + ] + ] + } + }, + { + "filename": "libvips/foreign/magick.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 10, + 38 + ], + [ + 52, + 65 + ], + [ + 73, + 129 + ], + [ + 130, + 236 + ], + [ + 240, + 281 + ], + [ + 282, + 303 + ], + [ + 304, + 351 + ], + [ + 353, + 470 + ], + [ + 471, + 508 + ], + [ + 509, + 554 + ], + [ + 557, + 565 + ], + [ + 568, + 606 + ], + [ + 607, + 643 + ], + [ + 644, + 661 + ], + [ + 676, + 684 + ], + [ + 708, + 816 + ], + [ + 818, + 873 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 29 + ], + [ + 34, + 35 + ], + [ + 55, + 56 + ], + [ + 61, + 62 + ], + [ + 76, + 77 + ], + [ + 78, + 79 + ], + [ + 82, + 84 + ], + [ + 85, + 87 + ], + [ + 90, + 92 + ], + [ + 93, + 96 + ], + [ + 97, + 104 + ], + [ + 105, + 106 + ], + [ + 109, + 111 + ], + [ + 114, + 116 + ], + [ + 119, + 120 + ], + [ + 124, + 126 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 139, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 148 + ], + [ + 149, + 150 + ], + [ + 153, + 154 + ], + [ + 155, + 156 + ], + [ + 157, + 159 + ], + [ + 162, + 164 + ], + [ + 165, + 166 + ], + [ + 169, + 171 + ], + [ + 172, + 173 + ], + [ + 176, + 179 + ], + [ + 183, + 186 + ], + [ + 187, + 188 + ], + [ + 191, + 192 + ], + [ + 195, + 197 + ], + [ + 202, + 207 + ], + [ + 209, + 210 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 232, + 233 + ], + [ + 243, + 245 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 254, + 256 + ], + [ + 259, + 260 + ], + [ + 266, + 268 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 277, + 278 + ], + [ + 285, + 287 + ], + [ + 290, + 292 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 307, + 308 + ], + [ + 312, + 313 + ], + [ + 316, + 317 + ], + [ + 321, + 323 + ], + [ + 326, + 327 + ], + [ + 330, + 331 + ], + [ + 335, + 337 + ], + [ + 339, + 340 + ], + [ + 343, + 345 + ], + [ + 346, + 348 + ], + [ + 356, + 357 + ], + [ + 361, + 362 + ], + [ + 363, + 364 + ], + [ + 366, + 369 + ], + [ + 372, + 374 + ], + [ + 375, + 379 + ], + [ + 382, + 385 + ], + [ + 387, + 389 + ], + [ + 391, + 393 + ], + [ + 395, + 397 + ], + [ + 399, + 401 + ], + [ + 403, + 405 + ], + [ + 411, + 412 + ], + [ + 414, + 415 + ], + [ + 416, + 417 + ], + [ + 418, + 419 + ], + [ + 423, + 425 + ], + [ + 427, + 428 + ], + [ + 429, + 430 + ], + [ + 434, + 436 + ], + [ + 439, + 442 + ], + [ + 446, + 447 + ], + [ + 448, + 449 + ], + [ + 455, + 460 + ], + [ + 462, + 463 + ], + [ + 466, + 467 + ], + [ + 474, + 476 + ], + [ + 478, + 483 + ], + [ + 484, + 495 + ], + [ + 496, + 497 + ], + [ + 500, + 501 + ], + [ + 504, + 505 + ], + [ + 512, + 513 + ], + [ + 515, + 517 + ], + [ + 519, + 520 + ], + [ + 523, + 524 + ], + [ + 528, + 530 + ], + [ + 532, + 535 + ], + [ + 540, + 541 + ], + [ + 543, + 544 + ], + [ + 548, + 549 + ], + [ + 550, + 551 + ], + [ + 560, + 562 + ], + [ + 571, + 572 + ], + [ + 576, + 577 + ], + [ + 578, + 579 + ], + [ + 581, + 582 + ], + [ + 586, + 589 + ], + [ + 594, + 596 + ], + [ + 599, + 603 + ], + [ + 610, + 611 + ], + [ + 617, + 619 + ], + [ + 620, + 623 + ], + [ + 626, + 628 + ], + [ + 632, + 634 + ], + [ + 637, + 638 + ], + [ + 639, + 640 + ], + [ + 647, + 649 + ], + [ + 651, + 652 + ], + [ + 657, + 658 + ], + [ + 679, + 681 + ], + [ + 711, + 712 + ], + [ + 715, + 718 + ], + [ + 719, + 720 + ], + [ + 723, + 735 + ], + [ + 739, + 740 + ], + [ + 744, + 745 + ], + [ + 747, + 751 + ], + [ + 754, + 755 + ], + [ + 759, + 760 + ], + [ + 762, + 763 + ], + [ + 766, + 767 + ], + [ + 770, + 771 + ], + [ + 776, + 778 + ], + [ + 782, + 792 + ], + [ + 793, + 794 + ], + [ + 795, + 797 + ], + [ + 798, + 800 + ], + [ + 801, + 802 + ], + [ + 807, + 808 + ], + [ + 809, + 811 + ], + [ + 812, + 813 + ], + [ + 821, + 823 + ], + [ + 825, + 826 + ], + [ + 829, + 840 + ], + [ + 841, + 847 + ], + [ + 848, + 851 + ], + [ + 852, + 853 + ], + [ + 858, + 860 + ], + [ + 865, + 868 + ], + [ + 869, + 870 + ] + ] + } + }, + { + "filename": "libvips/foreign/magick.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 37 + ], + [ + 42, + 96 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 33, + 34 + ], + [ + 45, + 52 + ], + [ + 53, + 94 + ] + ] + } + }, + { + "filename": "libvips/foreign/magick2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 16, + 23 + ], + [ + 25, + 32 + ], + [ + 41, + 53 + ], + [ + 72, + 100 + ], + [ + 126, + 139 + ], + [ + 141, + 148 + ], + [ + 168, + 202 + ], + [ + 204, + 287 + ], + [ + 300, + 316 + ], + [ + 319, + 392 + ], + [ + 393, + 400 + ], + [ + 404, + 416 + ], + [ + 430, + 521 + ], + [ + 522, + 561 + ], + [ + 562, + 640 + ], + [ + 643, + 662 + ], + [ + 665, + 684 + ], + [ + 687, + 706 + ], + [ + 712, + 751 + ], + [ + 753, + 950 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 19, + 20 + ], + [ + 28, + 29 + ], + [ + 44, + 45 + ], + [ + 49, + 50 + ], + [ + 75, + 76 + ], + [ + 77, + 81 + ], + [ + 82, + 91 + ], + [ + 96, + 97 + ], + [ + 129, + 130 + ], + [ + 135, + 136 + ], + [ + 144, + 145 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 177, + 183 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 196, + 199 + ], + [ + 207, + 208 + ], + [ + 210, + 213 + ], + [ + 219, + 221 + ], + [ + 227, + 228 + ], + [ + 229, + 231 + ], + [ + 232, + 235 + ], + [ + 238, + 242 + ], + [ + 245, + 246 + ], + [ + 249, + 250 + ], + [ + 254, + 256 + ], + [ + 257, + 260 + ], + [ + 262, + 263 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 272, + 273 + ], + [ + 274, + 275 + ], + [ + 281, + 284 + ], + [ + 303, + 306 + ], + [ + 308, + 309 + ], + [ + 312, + 313 + ], + [ + 322, + 338 + ], + [ + 343, + 345 + ], + [ + 349, + 354 + ], + [ + 356, + 357 + ], + [ + 359, + 360 + ], + [ + 364, + 365 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 375, + 377 + ], + [ + 380, + 384 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 396, + 397 + ], + [ + 407, + 410 + ], + [ + 412, + 413 + ], + [ + 433, + 435 + ], + [ + 438, + 440 + ], + [ + 442, + 444 + ], + [ + 445, + 456 + ], + [ + 458, + 460 + ], + [ + 461, + 467 + ], + [ + 468, + 471 + ], + [ + 473, + 475 + ], + [ + 476, + 483 + ], + [ + 484, + 487 + ], + [ + 488, + 489 + ], + [ + 490, + 495 + ], + [ + 498, + 499 + ], + [ + 502, + 503 + ], + [ + 504, + 507 + ], + [ + 508, + 509 + ], + [ + 510, + 512 + ], + [ + 513, + 518 + ], + [ + 525, + 526 + ], + [ + 531, + 532 + ], + [ + 534, + 536 + ], + [ + 539, + 541 + ], + [ + 542, + 543 + ], + [ + 544, + 545 + ], + [ + 547, + 549 + ], + [ + 552, + 553 + ], + [ + 554, + 556 + ], + [ + 557, + 558 + ], + [ + 565, + 575 + ], + [ + 576, + 587 + ], + [ + 588, + 600 + ], + [ + 601, + 614 + ], + [ + 616, + 617 + ], + [ + 620, + 621 + ], + [ + 624, + 637 + ], + [ + 646, + 647 + ], + [ + 648, + 659 + ], + [ + 668, + 681 + ], + [ + 690, + 691 + ], + [ + 692, + 703 + ], + [ + 715, + 716 + ], + [ + 720, + 722 + ], + [ + 723, + 724 + ], + [ + 725, + 726 + ], + [ + 732, + 733 + ], + [ + 734, + 736 + ], + [ + 739, + 740 + ], + [ + 744, + 745 + ], + [ + 747, + 748 + ], + [ + 756, + 757 + ], + [ + 760, + 762 + ], + [ + 767, + 768 + ], + [ + 774, + 775 + ], + [ + 776, + 778 + ], + [ + 779, + 780 + ], + [ + 781, + 786 + ], + [ + 788, + 790 + ], + [ + 792, + 793 + ], + [ + 796, + 798 + ], + [ + 802, + 803 + ], + [ + 805, + 807 + ], + [ + 809, + 810 + ], + [ + 812, + 818 + ], + [ + 820, + 825 + ], + [ + 826, + 827 + ], + [ + 830, + 832 + ], + [ + 836, + 837 + ], + [ + 839, + 841 + ], + [ + 843, + 844 + ], + [ + 848, + 849 + ], + [ + 850, + 856 + ], + [ + 858, + 860 + ], + [ + 861, + 865 + ], + [ + 869, + 870 + ], + [ + 871, + 872 + ], + [ + 875, + 877 + ], + [ + 881, + 882 + ], + [ + 884, + 886 + ], + [ + 888, + 889 + ], + [ + 891, + 897 + ], + [ + 899, + 904 + ], + [ + 905, + 906 + ], + [ + 909, + 911 + ], + [ + 915, + 916 + ], + [ + 918, + 920 + ], + [ + 922, + 923 + ], + [ + 926, + 928 + ], + [ + 929, + 935 + ], + [ + 937, + 939 + ], + [ + 940, + 944 + ], + [ + 946, + 947 + ] + ] + } + }, + { + "filename": "libvips/foreign/magick6load.c", + "line_filter": { + "diff_chunks": [ + [ + 18, + 46 + ], + [ + 74, + 109 + ], + [ + 110, + 119 + ], + [ + 126, + 167 + ], + [ + 168, + 227 + ], + [ + 228, + 250 + ], + [ + 256, + 302 + ], + [ + 303, + 325 + ] + ], + "lines_added": [ + [ + 21, + 37 + ], + [ + 42, + 43 + ], + [ + 77, + 80 + ], + [ + 85, + 87 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ], + [ + 129, + 130 + ], + [ + 133, + 136 + ], + [ + 137, + 139 + ], + [ + 140, + 143 + ], + [ + 144, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 153 + ], + [ + 154, + 157 + ], + [ + 158, + 160 + ], + [ + 163, + 164 + ], + [ + 171, + 172 + ], + [ + 177, + 179 + ], + [ + 181, + 182 + ], + [ + 188, + 190 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 203, + 204 + ], + [ + 206, + 207 + ], + [ + 209, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 220, + 222 + ], + [ + 223, + 224 + ], + [ + 231, + 232 + ], + [ + 237, + 243 + ], + [ + 246, + 247 + ], + [ + 259, + 261 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 279, + 280 + ], + [ + 282, + 283 + ], + [ + 285, + 290 + ], + [ + 291, + 292 + ], + [ + 295, + 297 + ], + [ + 298, + 299 + ], + [ + 306, + 307 + ], + [ + 312, + 318 + ], + [ + 321, + 322 + ] + ] + } + }, + { + "filename": "libvips/foreign/magick7load.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 71, + 80 + ], + [ + 85, + 93 + ], + [ + 96, + 108 + ], + [ + 114, + 222 + ], + [ + 230, + 237 + ], + [ + 243, + 346 + ], + [ + 348, + 358 + ], + [ + 365, + 422 + ], + [ + 424, + 456 + ], + [ + 457, + 498 + ], + [ + 499, + 506 + ], + [ + 510, + 533 + ], + [ + 541, + 602 + ], + [ + 603, + 634 + ], + [ + 636, + 712 + ], + [ + 713, + 724 + ], + [ + 725, + 840 + ], + [ + 841, + 862 + ], + [ + 868, + 922 + ], + [ + 923, + 944 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 74, + 77 + ], + [ + 88, + 90 + ], + [ + 99, + 101 + ], + [ + 104, + 105 + ], + [ + 117, + 135 + ], + [ + 138, + 139 + ], + [ + 141, + 164 + ], + [ + 167, + 191 + ], + [ + 193, + 200 + ], + [ + 201, + 203 + ], + [ + 205, + 209 + ], + [ + 212, + 213 + ], + [ + 218, + 219 + ], + [ + 233, + 234 + ], + [ + 246, + 249 + ], + [ + 251, + 253 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 276, + 277 + ], + [ + 279, + 281 + ], + [ + 282, + 290 + ], + [ + 293, + 294 + ], + [ + 298, + 299 + ], + [ + 303, + 304 + ], + [ + 307, + 309 + ], + [ + 310, + 311 + ], + [ + 315, + 316 + ], + [ + 319, + 320 + ], + [ + 324, + 326 + ], + [ + 327, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 335 + ], + [ + 338, + 339 + ], + [ + 340, + 341 + ], + [ + 342, + 343 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 368, + 369 + ], + [ + 372, + 375 + ], + [ + 376, + 378 + ], + [ + 379, + 382 + ], + [ + 383, + 385 + ], + [ + 386, + 389 + ], + [ + 390, + 392 + ], + [ + 393, + 396 + ], + [ + 397, + 399 + ], + [ + 402, + 403 + ], + [ + 408, + 409 + ], + [ + 410, + 411 + ], + [ + 412, + 415 + ], + [ + 418, + 419 + ], + [ + 427, + 429 + ], + [ + 430, + 431 + ], + [ + 432, + 433 + ], + [ + 434, + 435 + ], + [ + 438, + 440 + ], + [ + 441, + 442 + ], + [ + 447, + 453 + ], + [ + 460, + 462 + ], + [ + 466, + 471 + ], + [ + 474, + 475 + ], + [ + 477, + 478 + ], + [ + 479, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 484 + ], + [ + 486, + 490 + ], + [ + 492, + 493 + ], + [ + 494, + 495 + ], + [ + 502, + 503 + ], + [ + 513, + 517 + ], + [ + 519, + 520 + ], + [ + 523, + 524 + ], + [ + 529, + 530 + ], + [ + 544, + 546 + ], + [ + 549, + 551 + ], + [ + 552, + 553 + ], + [ + 555, + 559 + ], + [ + 560, + 562 + ], + [ + 566, + 568 + ], + [ + 569, + 575 + ], + [ + 576, + 577 + ], + [ + 578, + 579 + ], + [ + 583, + 584 + ], + [ + 588, + 590 + ], + [ + 591, + 593 + ], + [ + 594, + 599 + ], + [ + 606, + 607 + ], + [ + 612, + 613 + ], + [ + 615, + 617 + ], + [ + 620, + 622 + ], + [ + 625, + 626 + ], + [ + 627, + 629 + ], + [ + 630, + 631 + ], + [ + 639, + 655 + ], + [ + 656, + 657 + ], + [ + 659, + 661 + ], + [ + 663, + 664 + ], + [ + 668, + 669 + ], + [ + 674, + 676 + ], + [ + 677, + 678 + ], + [ + 679, + 682 + ], + [ + 683, + 684 + ], + [ + 685, + 686 + ], + [ + 692, + 693 + ], + [ + 694, + 695 + ], + [ + 696, + 697 + ], + [ + 700, + 701 + ], + [ + 704, + 705 + ], + [ + 708, + 709 + ], + [ + 716, + 717 + ], + [ + 720, + 721 + ], + [ + 728, + 729 + ], + [ + 731, + 734 + ], + [ + 737, + 741 + ], + [ + 742, + 743 + ], + [ + 744, + 745 + ], + [ + 749, + 756 + ], + [ + 761, + 763 + ], + [ + 765, + 769 + ], + [ + 770, + 771 + ], + [ + 776, + 777 + ], + [ + 782, + 784 + ], + [ + 786, + 787 + ], + [ + 793, + 795 + ], + [ + 798, + 799 + ], + [ + 804, + 805 + ], + [ + 807, + 809 + ], + [ + 810, + 811 + ], + [ + 815, + 816 + ], + [ + 818, + 822 + ], + [ + 824, + 826 + ], + [ + 827, + 828 + ], + [ + 829, + 830 + ], + [ + 833, + 835 + ], + [ + 836, + 837 + ], + [ + 844, + 845 + ], + [ + 849, + 855 + ], + [ + 858, + 859 + ], + [ + 871, + 873 + ], + [ + 875, + 876 + ], + [ + 877, + 879 + ], + [ + 882, + 883 + ], + [ + 885, + 886 + ], + [ + 889, + 890 + ], + [ + 895, + 896 + ], + [ + 898, + 901 + ], + [ + 902, + 906 + ], + [ + 908, + 910 + ], + [ + 911, + 912 + ], + [ + 915, + 917 + ], + [ + 918, + 919 + ], + [ + 926, + 927 + ], + [ + 931, + 937 + ], + [ + 940, + 941 + ] + ] + } + }, + { + "filename": "libvips/foreign/magickload.c", + "line_filter": { + "diff_chunks": [ + [ + 18, + 46 + ], + [ + 73, + 80 + ], + [ + 90, + 98 + ], + [ + 99, + 115 + ], + [ + 125, + 142 + ], + [ + 143, + 156 + ] + ], + "lines_added": [ + [ + 21, + 37 + ], + [ + 42, + 43 + ], + [ + 76, + 77 + ], + [ + 93, + 95 + ], + [ + 102, + 103 + ], + [ + 107, + 110 + ], + [ + 111, + 112 + ], + [ + 128, + 129 + ], + [ + 130, + 132 + ], + [ + 138, + 139 + ], + [ + 146, + 147 + ], + [ + 148, + 151 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ] + ] + } + }, + { + "filename": "libvips/foreign/magicksave.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 9, + 16 + ], + [ + 18, + 46 + ], + [ + 56, + 64 + ], + [ + 92, + 113 + ], + [ + 119, + 126 + ], + [ + 130, + 159 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 12, + 13 + ], + [ + 21, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 37 + ], + [ + 42, + 43 + ], + [ + 59, + 61 + ], + [ + 95, + 96 + ], + [ + 100, + 103 + ], + [ + 104, + 105 + ], + [ + 109, + 110 + ], + [ + 122, + 123 + ], + [ + 133, + 134 + ], + [ + 139, + 140 + ], + [ + 141, + 144 + ], + [ + 145, + 148 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ], + [ + 157, + 158 + ] + ] + } + }, + { + "filename": "libvips/foreign/matlab.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 41 + ], + [ + 46, + 53 + ], + [ + 86, + 146 + ], + [ + 157, + 194 + ], + [ + 199, + 293 + ], + [ + 295, + 339 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 12 + ], + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 32 + ], + [ + 37, + 38 + ], + [ + 49, + 50 + ], + [ + 89, + 90 + ], + [ + 91, + 94 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 103, + 105 + ], + [ + 106, + 107 + ], + [ + 111, + 116 + ], + [ + 118, + 125 + ], + [ + 128, + 132 + ], + [ + 136, + 137 + ], + [ + 139, + 140 + ], + [ + 142, + 143 + ], + [ + 160, + 162 + ], + [ + 163, + 178 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 190, + 191 + ], + [ + 202, + 205 + ], + [ + 207, + 209 + ], + [ + 210, + 214 + ], + [ + 216, + 217 + ], + [ + 218, + 222 + ], + [ + 223, + 227 + ], + [ + 228, + 229 + ], + [ + 232, + 233 + ], + [ + 237, + 238 + ], + [ + 240, + 245 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 256, + 257 + ], + [ + 261, + 262 + ], + [ + 263, + 267 + ], + [ + 272, + 275 + ], + [ + 276, + 277 + ], + [ + 282, + 283 + ], + [ + 285, + 286 + ], + [ + 289, + 290 + ], + [ + 298, + 300 + ], + [ + 302, + 303 + ], + [ + 306, + 307 + ], + [ + 311, + 312 + ], + [ + 314, + 320 + ], + [ + 321, + 322 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ], + [ + 331, + 334 + ], + [ + 335, + 336 + ] + ] + } + }, + { + "filename": "libvips/foreign/matload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 59, + 118 + ], + [ + 119, + 126 + ], + [ + 128, + 150 + ], + [ + 155, + 181 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 62, + 63 + ], + [ + 68, + 70 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 90, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 103, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 122, + 123 + ], + [ + 131, + 132 + ], + [ + 137, + 143 + ], + [ + 146, + 147 + ], + [ + 158, + 159 + ], + [ + 163, + 164 + ], + [ + 170, + 171 + ], + [ + 175, + 178 + ], + [ + 179, + 180 + ] + ] + } + }, + { + "filename": "libvips/foreign/matrixload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 71, + 175 + ], + [ + 181, + 286 + ], + [ + 294, + 324 + ], + [ + 326, + 333 + ], + [ + 336, + 359 + ], + [ + 366, + 385 + ], + [ + 391, + 420 + ], + [ + 424, + 450 + ], + [ + 456, + 472 + ], + [ + 478, + 496 + ], + [ + 502, + 518 + ], + [ + 520, + 541 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 74, + 76 + ], + [ + 78, + 79 + ], + [ + 82, + 85 + ], + [ + 86, + 87 + ], + [ + 90, + 91 + ], + [ + 94, + 96 + ], + [ + 97, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 115, + 117 + ], + [ + 122, + 130 + ], + [ + 132, + 133 + ], + [ + 134, + 135 + ], + [ + 136, + 139 + ], + [ + 141, + 145 + ], + [ + 151, + 152 + ], + [ + 153, + 158 + ], + [ + 159, + 162 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 184, + 212 + ], + [ + 215, + 216 + ], + [ + 218, + 219 + ], + [ + 222, + 229 + ], + [ + 230, + 231 + ], + [ + 234, + 245 + ], + [ + 247, + 248 + ], + [ + 249, + 253 + ], + [ + 255, + 258 + ], + [ + 260, + 261 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 273, + 274 + ], + [ + 282, + 283 + ], + [ + 297, + 299 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 307, + 308 + ], + [ + 312, + 316 + ], + [ + 317, + 319 + ], + [ + 320, + 321 + ], + [ + 329, + 330 + ], + [ + 339, + 341 + ], + [ + 344, + 346 + ], + [ + 348, + 349 + ], + [ + 352, + 354 + ], + [ + 355, + 356 + ], + [ + 369, + 370 + ], + [ + 372, + 375 + ], + [ + 376, + 378 + ], + [ + 381, + 382 + ], + [ + 394, + 396 + ], + [ + 398, + 399 + ], + [ + 401, + 402 + ], + [ + 404, + 405 + ], + [ + 406, + 407 + ], + [ + 409, + 411 + ], + [ + 412, + 413 + ], + [ + 416, + 417 + ], + [ + 427, + 431 + ], + [ + 433, + 435 + ], + [ + 437, + 438 + ], + [ + 441, + 443 + ], + [ + 444, + 445 + ], + [ + 446, + 447 + ], + [ + 459, + 465 + ], + [ + 468, + 469 + ], + [ + 481, + 482 + ], + [ + 486, + 488 + ], + [ + 492, + 493 + ], + [ + 505, + 506 + ], + [ + 510, + 513 + ], + [ + 514, + 515 + ], + [ + 523, + 524 + ], + [ + 530, + 531 + ], + [ + 535, + 538 + ], + [ + 539, + 540 + ] + ] + } + }, + { + "filename": "libvips/foreign/matrixsave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 61, + 142 + ], + [ + 153, + 160 + ], + [ + 162, + 171 + ], + [ + 172, + 223 + ], + [ + 225, + 241 + ], + [ + 246, + 277 + ], + [ + 279, + 295 + ], + [ + 299, + 340 + ], + [ + 345, + 366 + ], + [ + 370, + 391 + ], + [ + 395, + 409 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 64, + 66 + ], + [ + 68, + 69 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 84, + 87 + ], + [ + 88, + 89 + ], + [ + 90, + 93 + ], + [ + 94, + 97 + ], + [ + 98, + 100 + ], + [ + 102, + 103 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 115, + 117 + ], + [ + 118, + 121 + ], + [ + 122, + 130 + ], + [ + 131, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 156, + 157 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 175, + 176 + ], + [ + 185, + 186 + ], + [ + 192, + 193 + ], + [ + 197, + 199 + ], + [ + 201, + 202 + ], + [ + 206, + 209 + ], + [ + 210, + 213 + ], + [ + 216, + 218 + ], + [ + 219, + 220 + ], + [ + 228, + 234 + ], + [ + 237, + 238 + ], + [ + 249, + 251 + ], + [ + 253, + 254 + ], + [ + 256, + 257 + ], + [ + 259, + 262 + ], + [ + 264, + 267 + ], + [ + 270, + 272 + ], + [ + 273, + 274 + ], + [ + 282, + 288 + ], + [ + 291, + 292 + ], + [ + 302, + 304 + ], + [ + 306, + 307 + ], + [ + 310, + 312 + ], + [ + 313, + 315 + ], + [ + 316, + 317 + ], + [ + 320, + 321 + ], + [ + 325, + 326 + ], + [ + 330, + 331 + ], + [ + 336, + 337 + ], + [ + 348, + 349 + ], + [ + 353, + 356 + ], + [ + 357, + 358 + ], + [ + 362, + 363 + ], + [ + 373, + 374 + ], + [ + 378, + 381 + ], + [ + 382, + 383 + ], + [ + 387, + 388 + ], + [ + 398, + 399 + ], + [ + 403, + 406 + ], + [ + 407, + 408 + ] + ] + } + }, + { + "filename": "libvips/foreign/niftiload.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 42, + 54 + ], + [ + 87, + 94 + ], + [ + 95, + 144 + ], + [ + 145, + 152 + ], + [ + 163, + 190 + ], + [ + 198, + 389 + ], + [ + 393, + 422 + ], + [ + 425, + 473 + ], + [ + 474, + 525 + ], + [ + 529, + 587 + ], + [ + 589, + 596 + ], + [ + 606, + 613 + ], + [ + 615, + 657 + ], + [ + 660, + 697 + ], + [ + 699, + 722 + ], + [ + 730, + 803 + ], + [ + 808, + 815 + ], + [ + 817, + 833 + ], + [ + 835, + 854 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 45, + 46 + ], + [ + 50, + 51 + ], + [ + 90, + 91 + ], + [ + 98, + 100 + ], + [ + 102, + 103 + ], + [ + 106, + 109 + ], + [ + 110, + 111 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 122, + 124 + ], + [ + 127, + 132 + ], + [ + 134, + 135 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 148, + 149 + ], + [ + 166, + 167 + ], + [ + 170, + 173 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 182, + 185 + ], + [ + 186, + 187 + ], + [ + 201, + 318 + ], + [ + 321, + 322 + ], + [ + 326, + 327 + ], + [ + 329, + 333 + ], + [ + 334, + 336 + ], + [ + 338, + 339 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 356, + 357 + ], + [ + 360, + 362 + ], + [ + 366, + 368 + ], + [ + 370, + 371 + ], + [ + 374, + 377 + ], + [ + 378, + 379 + ], + [ + 382, + 384 + ], + [ + 385, + 386 + ], + [ + 396, + 402 + ], + [ + 403, + 408 + ], + [ + 414, + 419 + ], + [ + 428, + 433 + ], + [ + 434, + 437 + ], + [ + 439, + 444 + ], + [ + 446, + 447 + ], + [ + 448, + 449 + ], + [ + 455, + 458 + ], + [ + 459, + 462 + ], + [ + 463, + 465 + ], + [ + 468, + 470 + ], + [ + 477, + 481 + ], + [ + 483, + 486 + ], + [ + 487, + 492 + ], + [ + 495, + 497 + ], + [ + 501, + 505 + ], + [ + 506, + 507 + ], + [ + 509, + 511 + ], + [ + 513, + 514 + ], + [ + 515, + 516 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 532, + 536 + ], + [ + 538, + 541 + ], + [ + 543, + 544 + ], + [ + 545, + 546 + ], + [ + 549, + 550 + ], + [ + 551, + 552 + ], + [ + 555, + 556 + ], + [ + 558, + 559 + ], + [ + 560, + 564 + ], + [ + 566, + 571 + ], + [ + 572, + 574 + ], + [ + 575, + 576 + ], + [ + 579, + 580 + ], + [ + 581, + 582 + ], + [ + 583, + 584 + ], + [ + 592, + 593 + ], + [ + 609, + 610 + ], + [ + 618, + 619 + ], + [ + 624, + 626 + ], + [ + 628, + 629 + ], + [ + 633, + 637 + ], + [ + 638, + 640 + ], + [ + 641, + 642 + ], + [ + 644, + 650 + ], + [ + 653, + 654 + ], + [ + 663, + 665 + ], + [ + 666, + 670 + ], + [ + 671, + 672 + ], + [ + 673, + 674 + ], + [ + 675, + 676 + ], + [ + 680, + 685 + ], + [ + 686, + 687 + ], + [ + 690, + 692 + ], + [ + 693, + 694 + ], + [ + 702, + 703 + ], + [ + 709, + 715 + ], + [ + 718, + 719 + ], + [ + 733, + 735 + ], + [ + 737, + 738 + ], + [ + 740, + 741 + ], + [ + 743, + 744 + ], + [ + 745, + 746 + ], + [ + 748, + 752 + ], + [ + 753, + 754 + ], + [ + 757, + 758 + ], + [ + 759, + 760 + ], + [ + 763, + 766 + ], + [ + 769, + 771 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ], + [ + 781, + 782 + ], + [ + 786, + 787 + ], + [ + 789, + 795 + ], + [ + 798, + 800 + ], + [ + 811, + 812 + ], + [ + 820, + 821 + ], + [ + 825, + 828 + ], + [ + 829, + 830 + ], + [ + 838, + 839 + ], + [ + 843, + 844 + ], + [ + 848, + 851 + ], + [ + 852, + 853 + ] + ] + } + }, + { + "filename": "libvips/foreign/niftisave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 60, + 67 + ], + [ + 68, + 94 + ], + [ + 95, + 155 + ], + [ + 159, + 238 + ], + [ + 240, + 277 + ], + [ + 280, + 396 + ], + [ + 411, + 422 + ], + [ + 424, + 431 + ], + [ + 437, + 453 + ], + [ + 454, + 465 + ], + [ + 467, + 481 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 63, + 64 + ], + [ + 71, + 73 + ], + [ + 75, + 76 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 87, + 89 + ], + [ + 90, + 91 + ], + [ + 98, + 99 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 112, + 117 + ], + [ + 119, + 124 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 131, + 134 + ], + [ + 137, + 139 + ], + [ + 145, + 147 + ], + [ + 151, + 152 + ], + [ + 162, + 164 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 173, + 175 + ], + [ + 176, + 178 + ], + [ + 183, + 184 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 194, + 195 + ], + [ + 198, + 199 + ], + [ + 202, + 204 + ], + [ + 208, + 210 + ], + [ + 216, + 217 + ], + [ + 220, + 225 + ], + [ + 229, + 230 + ], + [ + 233, + 235 + ], + [ + 243, + 245 + ], + [ + 249, + 253 + ], + [ + 255, + 257 + ], + [ + 258, + 262 + ], + [ + 264, + 265 + ], + [ + 270, + 272 + ], + [ + 273, + 274 + ], + [ + 283, + 284 + ], + [ + 289, + 292 + ], + [ + 294, + 295 + ], + [ + 296, + 297 + ], + [ + 300, + 301 + ], + [ + 306, + 311 + ], + [ + 312, + 317 + ], + [ + 319, + 324 + ], + [ + 326, + 328 + ], + [ + 332, + 335 + ], + [ + 338, + 341 + ], + [ + 342, + 343 + ], + [ + 346, + 347 + ], + [ + 348, + 349 + ], + [ + 352, + 354 + ], + [ + 355, + 356 + ], + [ + 361, + 364 + ], + [ + 366, + 368 + ], + [ + 373, + 377 + ], + [ + 379, + 382 + ], + [ + 385, + 386 + ], + [ + 390, + 391 + ], + [ + 392, + 393 + ], + [ + 414, + 415 + ], + [ + 416, + 417 + ], + [ + 418, + 419 + ], + [ + 427, + 428 + ], + [ + 440, + 446 + ], + [ + 449, + 450 + ], + [ + 457, + 459 + ], + [ + 461, + 462 + ], + [ + 470, + 471 + ], + [ + 475, + 478 + ], + [ + 479, + 480 + ] + ] + } + }, + { + "filename": "libvips/foreign/nsgifload.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 38 + ], + [ + 74, + 93 + ], + [ + 116, + 123 + ], + [ + 142, + 250 + ], + [ + 251, + 332 + ], + [ + 337, + 346 + ], + [ + 347, + 468 + ], + [ + 470, + 504 + ], + [ + 508, + 574 + ], + [ + 577, + 640 + ], + [ + 643, + 660 + ], + [ + 667, + 697 + ], + [ + 699, + 723 + ], + [ + 725, + 748 + ], + [ + 756, + 803 + ], + [ + 804, + 825 + ], + [ + 833, + 890 + ], + [ + 920, + 936 + ], + [ + 955, + 962 + ], + [ + 963, + 978 + ], + [ + 993, + 1007 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 29 + ], + [ + 34, + 35 + ], + [ + 77, + 90 + ], + [ + 119, + 120 + ], + [ + 145, + 147 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 157, + 158 + ], + [ + 161, + 162 + ], + [ + 163, + 165 + ], + [ + 166, + 168 + ], + [ + 169, + 170 + ], + [ + 173, + 174 + ], + [ + 175, + 176 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 189, + 190 + ], + [ + 193, + 195 + ], + [ + 196, + 197 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 219 + ], + [ + 222, + 223 + ], + [ + 227, + 239 + ], + [ + 245, + 247 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 262 + ], + [ + 266, + 272 + ], + [ + 273, + 275 + ], + [ + 281, + 282 + ], + [ + 283, + 285 + ], + [ + 291, + 293 + ], + [ + 296, + 297 + ], + [ + 301, + 305 + ], + [ + 307, + 308 + ], + [ + 313, + 315 + ], + [ + 318, + 322 + ], + [ + 325, + 327 + ], + [ + 328, + 329 + ], + [ + 340, + 341 + ], + [ + 342, + 343 + ], + [ + 350, + 351 + ], + [ + 355, + 358 + ], + [ + 360, + 361 + ], + [ + 363, + 366 + ], + [ + 367, + 370 + ], + [ + 372, + 373 + ], + [ + 379, + 382 + ], + [ + 384, + 385 + ], + [ + 391, + 392 + ], + [ + 393, + 394 + ], + [ + 395, + 396 + ], + [ + 397, + 400 + ], + [ + 404, + 405 + ], + [ + 407, + 409 + ], + [ + 410, + 411 + ], + [ + 415, + 416 + ], + [ + 418, + 419 + ], + [ + 420, + 423 + ], + [ + 427, + 432 + ], + [ + 434, + 438 + ], + [ + 444, + 445 + ], + [ + 446, + 447 + ], + [ + 450, + 452 + ], + [ + 453, + 454 + ], + [ + 459, + 462 + ], + [ + 464, + 465 + ], + [ + 473, + 484 + ], + [ + 487, + 488 + ], + [ + 493, + 497 + ], + [ + 500, + 501 + ], + [ + 511, + 512 + ], + [ + 515, + 516 + ], + [ + 522, + 525 + ], + [ + 527, + 533 + ], + [ + 535, + 536 + ], + [ + 539, + 540 + ], + [ + 543, + 544 + ], + [ + 545, + 546 + ], + [ + 550, + 552 + ], + [ + 555, + 565 + ], + [ + 568, + 569 + ], + [ + 570, + 571 + ], + [ + 580, + 581 + ], + [ + 586, + 587 + ], + [ + 592, + 595 + ], + [ + 596, + 598 + ], + [ + 599, + 602 + ], + [ + 603, + 605 + ], + [ + 608, + 609 + ], + [ + 612, + 613 + ], + [ + 615, + 619 + ], + [ + 621, + 622 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 629, + 630 + ], + [ + 632, + 634 + ], + [ + 635, + 637 + ], + [ + 646, + 647 + ], + [ + 651, + 652 + ], + [ + 653, + 654 + ], + [ + 655, + 657 + ], + [ + 670, + 671 + ], + [ + 676, + 678 + ], + [ + 680, + 681 + ], + [ + 685, + 689 + ], + [ + 690, + 692 + ], + [ + 693, + 694 + ], + [ + 702, + 703 + ], + [ + 707, + 711 + ], + [ + 712, + 713 + ], + [ + 716, + 718 + ], + [ + 719, + 720 + ], + [ + 728, + 729 + ], + [ + 735, + 741 + ], + [ + 744, + 745 + ], + [ + 759, + 761 + ], + [ + 763, + 764 + ], + [ + 766, + 767 + ], + [ + 769, + 774 + ], + [ + 775, + 777 + ], + [ + 778, + 779 + ], + [ + 782, + 783 + ], + [ + 787, + 791 + ], + [ + 792, + 793 + ], + [ + 796, + 798 + ], + [ + 799, + 800 + ], + [ + 807, + 808 + ], + [ + 812, + 818 + ], + [ + 821, + 822 + ], + [ + 836, + 838 + ], + [ + 840, + 841 + ], + [ + 843, + 844 + ], + [ + 846, + 847 + ], + [ + 848, + 849 + ], + [ + 851, + 853 + ], + [ + 854, + 855 + ], + [ + 858, + 860 + ], + [ + 861, + 862 + ], + [ + 863, + 864 + ], + [ + 870, + 871 + ], + [ + 877, + 883 + ], + [ + 886, + 887 + ], + [ + 923, + 924 + ], + [ + 928, + 931 + ], + [ + 932, + 933 + ], + [ + 958, + 959 + ], + [ + 966, + 967 + ], + [ + 968, + 971 + ], + [ + 972, + 973 + ], + [ + 974, + 975 + ], + [ + 996, + 997 + ], + [ + 1001, + 1004 + ], + [ + 1005, + 1006 + ] + ] + } + }, + { + "filename": "libvips/foreign/openexr2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 25, + 37 + ], + [ + 43, + 71 + ], + [ + 107, + 276 + ], + [ + 293, + 326 + ], + [ + 328, + 374 + ], + [ + 375, + 401 + ], + [ + 406, + 451 + ] + ], + "lines_added": [ + [ + 28, + 30 + ], + [ + 33, + 34 + ], + [ + 46, + 47 + ], + [ + 48, + 52 + ], + [ + 53, + 62 + ], + [ + 67, + 68 + ], + [ + 110, + 111 + ], + [ + 114, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 131, + 133 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 152, + 155 + ], + [ + 158, + 161 + ], + [ + 164, + 165 + ], + [ + 168, + 170 + ], + [ + 171, + 172 + ], + [ + 176, + 178 + ], + [ + 179, + 180 + ], + [ + 182, + 186 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 205, + 207 + ], + [ + 208, + 209 + ], + [ + 210, + 211 + ], + [ + 216, + 217 + ], + [ + 220, + 221 + ], + [ + 222, + 224 + ], + [ + 226, + 234 + ], + [ + 239, + 240 + ], + [ + 243, + 244 + ], + [ + 247, + 251 + ], + [ + 252, + 253 + ], + [ + 258, + 259 + ], + [ + 263, + 266 + ], + [ + 267, + 268 + ], + [ + 271, + 273 + ], + [ + 296, + 298 + ], + [ + 302, + 308 + ], + [ + 309, + 310 + ], + [ + 313, + 315 + ], + [ + 317, + 319 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 331, + 332 + ], + [ + 335, + 336 + ], + [ + 339, + 341 + ], + [ + 343, + 345 + ], + [ + 348, + 350 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 359, + 360 + ], + [ + 363, + 364 + ], + [ + 367, + 369 + ], + [ + 370, + 371 + ], + [ + 378, + 396 + ], + [ + 397, + 398 + ], + [ + 409, + 412 + ], + [ + 413, + 414 + ], + [ + 415, + 416 + ], + [ + 418, + 421 + ], + [ + 422, + 423 + ], + [ + 424, + 426 + ], + [ + 427, + 428 + ], + [ + 430, + 432 + ], + [ + 436, + 437 + ], + [ + 439, + 442 + ], + [ + 444, + 445 + ], + [ + 447, + 448 + ] + ] + } + }, + { + "filename": "libvips/foreign/openexrload.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 57, + 125 + ], + [ + 126, + 133 + ], + [ + 139, + 161 + ], + [ + 166, + 173 + ], + [ + 180, + 194 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 61 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 82, + 83 + ], + [ + 86, + 88 + ], + [ + 91, + 92 + ], + [ + 95, + 97 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 108, + 110 + ], + [ + 111, + 112 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 129, + 130 + ], + [ + 142, + 143 + ], + [ + 148, + 154 + ], + [ + 157, + 158 + ], + [ + 169, + 170 + ], + [ + 183, + 184 + ], + [ + 188, + 191 + ], + [ + 192, + 193 + ] + ] + } + }, + { + "filename": "libvips/foreign/openslideload.c", + "line_filter": { + "diff_chunks": [ + [ + 44, + 51 + ], + [ + 59, + 81 + ], + [ + 114, + 121 + ], + [ + 130, + 274 + ], + [ + 276, + 286 + ], + [ + 291, + 312 + ], + [ + 323, + 525 + ], + [ + 532, + 578 + ], + [ + 583, + 656 + ], + [ + 658, + 803 + ], + [ + 818, + 825 + ], + [ + 826, + 965 + ], + [ + 967, + 974 + ], + [ + 979, + 1039 + ], + [ + 1041, + 1091 + ], + [ + 1093, + 1116 + ], + [ + 1124, + 1172 + ], + [ + 1173, + 1196 + ] + ], + "lines_added": [ + [ + 47, + 48 + ], + [ + 62, + 63 + ], + [ + 64, + 68 + ], + [ + 69, + 73 + ], + [ + 74, + 78 + ], + [ + 117, + 118 + ], + [ + 133, + 134 + ], + [ + 139, + 140 + ], + [ + 145, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 156, + 157 + ], + [ + 158, + 159 + ], + [ + 165, + 167 + ], + [ + 170, + 172 + ], + [ + 174, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 184, + 185 + ], + [ + 186, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 201 + ], + [ + 202, + 204 + ], + [ + 205, + 206 + ], + [ + 209, + 210 + ], + [ + 212, + 215 + ], + [ + 218, + 222 + ], + [ + 227, + 233 + ], + [ + 235, + 236 + ], + [ + 239, + 242 + ], + [ + 245, + 251 + ], + [ + 253, + 259 + ], + [ + 261, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 271 + ], + [ + 279, + 280 + ], + [ + 282, + 283 + ], + [ + 294, + 295 + ], + [ + 296, + 297 + ], + [ + 300, + 302 + ], + [ + 304, + 305 + ], + [ + 306, + 309 + ], + [ + 326, + 327 + ], + [ + 330, + 331 + ], + [ + 333, + 337 + ], + [ + 341, + 342 + ], + [ + 343, + 405 + ], + [ + 408, + 409 + ], + [ + 410, + 411 + ], + [ + 412, + 415 + ], + [ + 416, + 417 + ], + [ + 418, + 421 + ], + [ + 422, + 425 + ], + [ + 426, + 427 + ], + [ + 429, + 430 + ], + [ + 435, + 436 + ], + [ + 437, + 439 + ], + [ + 440, + 441 + ], + [ + 444, + 445 + ], + [ + 449, + 450 + ], + [ + 454, + 459 + ], + [ + 461, + 466 + ], + [ + 468, + 473 + ], + [ + 475, + 488 + ], + [ + 492, + 494 + ], + [ + 495, + 500 + ], + [ + 504, + 517 + ], + [ + 518, + 522 + ], + [ + 535, + 537 + ], + [ + 540, + 541 + ], + [ + 543, + 544 + ], + [ + 550, + 553 + ], + [ + 556, + 566 + ], + [ + 567, + 572 + ], + [ + 574, + 575 + ], + [ + 586, + 588 + ], + [ + 589, + 591 + ], + [ + 594, + 596 + ], + [ + 597, + 601 + ], + [ + 604, + 608 + ], + [ + 609, + 612 + ], + [ + 613, + 614 + ], + [ + 617, + 620 + ], + [ + 623, + 627 + ], + [ + 628, + 629 + ], + [ + 635, + 636 + ], + [ + 639, + 640 + ], + [ + 641, + 644 + ], + [ + 645, + 646 + ], + [ + 649, + 651 + ], + [ + 652, + 653 + ], + [ + 661, + 663 + ], + [ + 667, + 689 + ], + [ + 690, + 692 + ], + [ + 693, + 694 + ], + [ + 696, + 697 + ], + [ + 702, + 707 + ], + [ + 709, + 714 + ], + [ + 715, + 716 + ], + [ + 719, + 720 + ], + [ + 721, + 722 + ], + [ + 723, + 724 + ], + [ + 725, + 726 + ], + [ + 729, + 730 + ], + [ + 731, + 732 + ], + [ + 737, + 739 + ], + [ + 740, + 743 + ], + [ + 745, + 746 + ], + [ + 747, + 753 + ], + [ + 754, + 755 + ], + [ + 758, + 762 + ], + [ + 763, + 769 + ], + [ + 770, + 771 + ], + [ + 772, + 773 + ], + [ + 776, + 778 + ], + [ + 782, + 784 + ], + [ + 785, + 788 + ], + [ + 789, + 792 + ], + [ + 793, + 798 + ], + [ + 799, + 800 + ], + [ + 821, + 822 + ], + [ + 829, + 831 + ], + [ + 837, + 839 + ], + [ + 841, + 842 + ], + [ + 843, + 844 + ], + [ + 846, + 847 + ], + [ + 848, + 849 + ], + [ + 852, + 853 + ], + [ + 854, + 856 + ], + [ + 861, + 864 + ], + [ + 867, + 872 + ], + [ + 877, + 879 + ], + [ + 880, + 881 + ], + [ + 884, + 885 + ], + [ + 889, + 890 + ], + [ + 893, + 894 + ], + [ + 899, + 900 + ], + [ + 902, + 903 + ], + [ + 906, + 907 + ], + [ + 911, + 915 + ], + [ + 916, + 917 + ], + [ + 920, + 921 + ], + [ + 924, + 929 + ], + [ + 930, + 931 + ], + [ + 932, + 933 + ], + [ + 936, + 937 + ], + [ + 940, + 946 + ], + [ + 948, + 951 + ], + [ + 953, + 954 + ], + [ + 957, + 958 + ], + [ + 959, + 960 + ], + [ + 961, + 962 + ], + [ + 970, + 971 + ], + [ + 982, + 983 + ], + [ + 987, + 988 + ], + [ + 992, + 993 + ], + [ + 998, + 1001 + ], + [ + 1002, + 1004 + ], + [ + 1005, + 1008 + ], + [ + 1009, + 1015 + ], + [ + 1016, + 1018 + ], + [ + 1019, + 1022 + ], + [ + 1023, + 1025 + ], + [ + 1026, + 1032 + ], + [ + 1035, + 1036 + ], + [ + 1044, + 1045 + ], + [ + 1050, + 1052 + ], + [ + 1054, + 1055 + ], + [ + 1056, + 1057 + ], + [ + 1058, + 1059 + ], + [ + 1061, + 1065 + ], + [ + 1066, + 1068 + ], + [ + 1069, + 1070 + ], + [ + 1073, + 1080 + ], + [ + 1084, + 1086 + ], + [ + 1087, + 1088 + ], + [ + 1096, + 1097 + ], + [ + 1103, + 1109 + ], + [ + 1112, + 1113 + ], + [ + 1127, + 1130 + ], + [ + 1132, + 1133 + ], + [ + 1134, + 1135 + ], + [ + 1136, + 1137 + ], + [ + 1139, + 1140 + ], + [ + 1141, + 1142 + ], + [ + 1144, + 1148 + ], + [ + 1149, + 1150 + ], + [ + 1153, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1159, + 1162 + ], + [ + 1165, + 1167 + ], + [ + 1168, + 1169 + ], + [ + 1176, + 1177 + ], + [ + 1179, + 1180 + ], + [ + 1182, + 1188 + ], + [ + 1191, + 1193 + ] + ] + } + }, + { + "filename": "libvips/foreign/pdfiumload.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 52 + ], + [ + 53, + 60 + ], + [ + 67, + 86 + ], + [ + 121, + 128 + ], + [ + 144, + 151 + ], + [ + 162, + 170 + ], + [ + 178, + 219 + ], + [ + 221, + 365 + ], + [ + 370, + 501 + ], + [ + 504, + 547 + ], + [ + 548, + 600 + ], + [ + 601, + 742 + ], + [ + 743, + 768 + ], + [ + 770, + 824 + ], + [ + 826, + 833 + ], + [ + 834, + 850 + ], + [ + 858, + 887 + ], + [ + 888, + 909 + ], + [ + 915, + 980 + ] + ], + "lines_added": [ + [ + 23, + 39 + ], + [ + 44, + 45 + ], + [ + 48, + 49 + ], + [ + 56, + 57 + ], + [ + 70, + 80 + ], + [ + 82, + 83 + ], + [ + 124, + 125 + ], + [ + 147, + 148 + ], + [ + 165, + 167 + ], + [ + 181, + 182 + ], + [ + 185, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 200 + ], + [ + 201, + 202 + ], + [ + 205, + 206 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 232, + 234 + ], + [ + 239, + 242 + ], + [ + 243, + 245 + ], + [ + 246, + 247 + ], + [ + 249, + 252 + ], + [ + 256, + 257 + ], + [ + 260, + 261 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 276, + 285 + ], + [ + 290, + 291 + ], + [ + 292, + 295 + ], + [ + 296, + 301 + ], + [ + 303, + 304 + ], + [ + 306, + 308 + ], + [ + 309, + 310 + ], + [ + 313, + 314 + ], + [ + 318, + 319 + ], + [ + 322, + 323 + ], + [ + 324, + 325 + ], + [ + 328, + 329 + ], + [ + 330, + 332 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 342, + 344 + ], + [ + 345, + 348 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 360, + 362 + ], + [ + 373, + 374 + ], + [ + 376, + 377 + ], + [ + 382, + 383 + ], + [ + 387, + 389 + ], + [ + 392, + 394 + ], + [ + 395, + 396 + ], + [ + 397, + 399 + ], + [ + 404, + 406 + ], + [ + 410, + 415 + ], + [ + 419, + 420 + ], + [ + 425, + 427 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 434, + 435 + ], + [ + 436, + 437 + ], + [ + 443, + 444 + ], + [ + 446, + 449 + ], + [ + 452, + 453 + ], + [ + 455, + 456 + ], + [ + 457, + 460 + ], + [ + 464, + 466 + ], + [ + 472, + 475 + ], + [ + 481, + 485 + ], + [ + 488, + 489 + ], + [ + 491, + 495 + ], + [ + 497, + 498 + ], + [ + 507, + 509 + ], + [ + 514, + 517 + ], + [ + 518, + 519 + ], + [ + 522, + 530 + ], + [ + 533, + 534 + ], + [ + 535, + 536 + ], + [ + 539, + 541 + ], + [ + 543, + 544 + ], + [ + 551, + 553 + ], + [ + 556, + 557 + ], + [ + 559, + 561 + ], + [ + 563, + 565 + ], + [ + 568, + 569 + ], + [ + 570, + 572 + ], + [ + 573, + 574 + ], + [ + 577, + 580 + ], + [ + 583, + 584 + ], + [ + 586, + 588 + ], + [ + 590, + 591 + ], + [ + 592, + 593 + ], + [ + 594, + 595 + ], + [ + 596, + 597 + ], + [ + 604, + 608 + ], + [ + 609, + 610 + ], + [ + 613, + 614 + ], + [ + 616, + 618 + ], + [ + 620, + 621 + ], + [ + 625, + 626 + ], + [ + 629, + 631 + ], + [ + 632, + 636 + ], + [ + 638, + 639 + ], + [ + 640, + 650 + ], + [ + 653, + 654 + ], + [ + 660, + 661 + ], + [ + 664, + 665 + ], + [ + 668, + 669 + ], + [ + 672, + 673 + ], + [ + 679, + 680 + ], + [ + 682, + 683 + ], + [ + 688, + 691 + ], + [ + 692, + 694 + ], + [ + 695, + 698 + ], + [ + 699, + 701 + ], + [ + 702, + 705 + ], + [ + 706, + 708 + ], + [ + 709, + 712 + ], + [ + 713, + 715 + ], + [ + 716, + 719 + ], + [ + 720, + 722 + ], + [ + 723, + 726 + ], + [ + 727, + 729 + ], + [ + 732, + 733 + ], + [ + 738, + 739 + ], + [ + 746, + 747 + ], + [ + 752, + 754 + ], + [ + 756, + 757 + ], + [ + 760, + 761 + ], + [ + 762, + 765 + ], + [ + 773, + 774 + ], + [ + 779, + 780 + ], + [ + 782, + 785 + ], + [ + 786, + 787 + ], + [ + 790, + 791 + ], + [ + 794, + 796 + ], + [ + 798, + 800 + ], + [ + 801, + 802 + ], + [ + 805, + 806 + ], + [ + 809, + 812 + ], + [ + 813, + 814 + ], + [ + 817, + 819 + ], + [ + 820, + 821 + ], + [ + 829, + 830 + ], + [ + 837, + 843 + ], + [ + 846, + 847 + ], + [ + 861, + 863 + ], + [ + 865, + 866 + ], + [ + 870, + 875 + ], + [ + 876, + 877 + ], + [ + 880, + 882 + ], + [ + 883, + 884 + ], + [ + 891, + 892 + ], + [ + 896, + 902 + ], + [ + 905, + 906 + ], + [ + 918, + 920 + ], + [ + 922, + 923 + ], + [ + 927, + 928 + ], + [ + 929, + 930 + ], + [ + 932, + 933 + ], + [ + 936, + 937 + ], + [ + 940, + 942 + ], + [ + 944, + 945 + ], + [ + 948, + 950 + ], + [ + 951, + 952 + ], + [ + 953, + 954 + ], + [ + 960, + 961 + ], + [ + 967, + 973 + ], + [ + 976, + 977 + ] + ] + } + }, + { + "filename": "libvips/foreign/pforeign.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 37, + 56 + ], + [ + 62, + 128 + ], + [ + 130, + 173 + ], + [ + 180, + 216 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 40, + 43 + ], + [ + 49, + 50 + ], + [ + 51, + 53 + ], + [ + 65, + 66 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 78 + ], + [ + 81, + 84 + ], + [ + 87, + 94 + ], + [ + 97, + 101 + ], + [ + 104, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 114 + ], + [ + 115, + 119 + ], + [ + 122, + 125 + ], + [ + 133, + 138 + ], + [ + 139, + 140 + ], + [ + 145, + 147 + ], + [ + 150, + 163 + ], + [ + 165, + 166 + ], + [ + 169, + 170 + ], + [ + 183, + 184 + ], + [ + 185, + 189 + ], + [ + 192, + 194 + ], + [ + 195, + 198 + ], + [ + 202, + 203 + ], + [ + 205, + 206 + ], + [ + 208, + 210 + ], + [ + 212, + 213 + ] + ] + } + }, + { + "filename": "libvips/foreign/pngload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 69, + 151 + ], + [ + 154, + 182 + ], + [ + 190, + 251 + ], + [ + 253, + 302 + ], + [ + 304, + 327 + ], + [ + 335, + 380 + ], + [ + 381, + 402 + ], + [ + 421, + 429 + ], + [ + 430, + 446 + ], + [ + 456, + 471 + ], + [ + 472, + 487 + ], + [ + 494, + 515 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 72, + 74 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 91, + 92 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 108, + 109 + ], + [ + 113, + 117 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 126, + 128 + ], + [ + 129, + 130 + ], + [ + 133, + 134 + ], + [ + 137, + 140 + ], + [ + 141, + 142 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 157, + 158 + ], + [ + 163, + 164 + ], + [ + 169, + 172 + ], + [ + 173, + 175 + ], + [ + 178, + 179 + ], + [ + 193, + 195 + ], + [ + 197, + 198 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 209 + ], + [ + 210, + 211 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 220, + 221 + ], + [ + 222, + 223 + ], + [ + 224, + 225 + ], + [ + 231, + 232 + ], + [ + 238, + 244 + ], + [ + 247, + 248 + ], + [ + 256, + 257 + ], + [ + 262, + 264 + ], + [ + 266, + 267 + ], + [ + 271, + 274 + ], + [ + 275, + 277 + ], + [ + 278, + 279 + ], + [ + 282, + 283 + ], + [ + 287, + 291 + ], + [ + 292, + 293 + ], + [ + 296, + 297 + ], + [ + 298, + 299 + ], + [ + 307, + 308 + ], + [ + 314, + 320 + ], + [ + 323, + 324 + ], + [ + 338, + 340 + ], + [ + 342, + 343 + ], + [ + 347, + 352 + ], + [ + 353, + 355 + ], + [ + 356, + 357 + ], + [ + 360, + 361 + ], + [ + 365, + 369 + ], + [ + 370, + 371 + ], + [ + 374, + 375 + ], + [ + 376, + 377 + ], + [ + 384, + 385 + ], + [ + 389, + 395 + ], + [ + 398, + 399 + ], + [ + 424, + 426 + ], + [ + 433, + 434 + ], + [ + 438, + 441 + ], + [ + 442, + 443 + ], + [ + 459, + 461 + ], + [ + 467, + 468 + ], + [ + 475, + 476 + ], + [ + 477, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 484 + ], + [ + 497, + 498 + ], + [ + 504, + 505 + ], + [ + 509, + 512 + ], + [ + 513, + 514 + ] + ] + } + }, + { + "filename": "libvips/foreign/pngsave.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 83, + 170 + ], + [ + 188, + 197 + ], + [ + 200, + 207 + ], + [ + 208, + 288 + ], + [ + 298, + 397 + ], + [ + 402, + 455 + ], + [ + 456, + 464 + ], + [ + 467, + 474 + ], + [ + 476, + 492 + ], + [ + 497, + 504 + ], + [ + 515, + 536 + ], + [ + 541, + 553 + ], + [ + 557, + 593 + ], + [ + 597, + 604 + ], + [ + 609, + 623 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 86, + 88 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 107, + 109 + ], + [ + 111, + 112 + ], + [ + 115, + 121 + ], + [ + 125, + 127 + ], + [ + 130, + 131 + ], + [ + 133, + 136 + ], + [ + 137, + 138 + ], + [ + 144, + 146 + ], + [ + 150, + 151 + ], + [ + 153, + 159 + ], + [ + 161, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 203, + 204 + ], + [ + 211, + 214 + ], + [ + 215, + 217 + ], + [ + 218, + 221 + ], + [ + 222, + 224 + ], + [ + 225, + 228 + ], + [ + 229, + 231 + ], + [ + 232, + 235 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 240, + 243 + ], + [ + 244, + 246 + ], + [ + 247, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 257 + ], + [ + 258, + 260 + ], + [ + 261, + 264 + ], + [ + 265, + 267 + ], + [ + 268, + 271 + ], + [ + 272, + 274 + ], + [ + 275, + 278 + ], + [ + 279, + 281 + ], + [ + 284, + 285 + ], + [ + 301, + 303 + ], + [ + 305, + 306 + ], + [ + 311, + 312 + ], + [ + 313, + 315 + ], + [ + 316, + 317 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 329, + 330 + ], + [ + 332, + 338 + ], + [ + 341, + 342 + ], + [ + 348, + 349 + ], + [ + 353, + 355 + ], + [ + 357, + 358 + ], + [ + 362, + 364 + ], + [ + 365, + 367 + ], + [ + 368, + 369 + ], + [ + 372, + 373 + ], + [ + 374, + 375 + ], + [ + 381, + 382 + ], + [ + 384, + 390 + ], + [ + 393, + 394 + ], + [ + 405, + 407 + ], + [ + 409, + 410 + ], + [ + 416, + 418 + ], + [ + 419, + 421 + ], + [ + 422, + 425 + ], + [ + 426, + 427 + ], + [ + 430, + 431 + ], + [ + 432, + 433 + ], + [ + 439, + 440 + ], + [ + 442, + 448 + ], + [ + 451, + 452 + ], + [ + 459, + 461 + ], + [ + 470, + 471 + ], + [ + 479, + 480 + ], + [ + 485, + 487 + ], + [ + 488, + 489 + ], + [ + 500, + 501 + ], + [ + 518, + 519 + ], + [ + 523, + 526 + ], + [ + 527, + 528 + ], + [ + 532, + 533 + ], + [ + 544, + 545 + ], + [ + 549, + 550 + ], + [ + 560, + 561 + ], + [ + 566, + 567 + ], + [ + 568, + 571 + ], + [ + 572, + 575 + ], + [ + 578, + 579 + ], + [ + 581, + 582 + ], + [ + 584, + 585 + ], + [ + 589, + 590 + ], + [ + 600, + 601 + ], + [ + 612, + 613 + ], + [ + 617, + 620 + ], + [ + 621, + 622 + ] + ] + } + }, + { + "filename": "libvips/foreign/popplerload.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 18 + ], + [ + 26, + 54 + ], + [ + 76, + 83 + ], + [ + 85, + 104 + ], + [ + 114, + 121 + ], + [ + 144, + 151 + ], + [ + 165, + 257 + ], + [ + 263, + 295 + ], + [ + 296, + 369 + ], + [ + 372, + 420 + ], + [ + 421, + 472 + ], + [ + 473, + 527 + ], + [ + 528, + 598 + ], + [ + 599, + 606 + ], + [ + 607, + 637 + ], + [ + 639, + 708 + ], + [ + 711, + 718 + ], + [ + 719, + 735 + ], + [ + 743, + 772 + ], + [ + 773, + 794 + ], + [ + 800, + 865 + ] + ], + "lines_added": [ + [ + 14, + 15 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 79, + 80 + ], + [ + 88, + 101 + ], + [ + 117, + 118 + ], + [ + 147, + 148 + ], + [ + 168, + 170 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 176, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 191, + 193 + ], + [ + 196, + 202 + ], + [ + 204, + 206 + ], + [ + 207, + 208 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 230 + ], + [ + 231, + 232 + ], + [ + 235, + 236 + ], + [ + 238, + 243 + ], + [ + 247, + 248 + ], + [ + 253, + 254 + ], + [ + 266, + 267 + ], + [ + 269, + 270 + ], + [ + 275, + 276 + ], + [ + 280, + 282 + ], + [ + 283, + 285 + ], + [ + 289, + 292 + ], + [ + 299, + 301 + ], + [ + 302, + 303 + ], + [ + 304, + 308 + ], + [ + 309, + 310 + ], + [ + 313, + 314 + ], + [ + 315, + 317 + ], + [ + 322, + 323 + ], + [ + 325, + 326 + ], + [ + 329, + 330 + ], + [ + 332, + 333 + ], + [ + 334, + 337 + ], + [ + 341, + 343 + ], + [ + 349, + 350 + ], + [ + 353, + 356 + ], + [ + 362, + 364 + ], + [ + 365, + 366 + ], + [ + 375, + 377 + ], + [ + 382, + 385 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 390, + 395 + ], + [ + 398, + 399 + ], + [ + 400, + 401 + ], + [ + 402, + 403 + ], + [ + 406, + 407 + ], + [ + 408, + 409 + ], + [ + 412, + 414 + ], + [ + 415, + 417 + ], + [ + 424, + 426 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 433, + 434 + ], + [ + 436, + 438 + ], + [ + 440, + 442 + ], + [ + 446, + 447 + ], + [ + 448, + 455 + ], + [ + 456, + 460 + ], + [ + 461, + 462 + ], + [ + 464, + 467 + ], + [ + 468, + 469 + ], + [ + 476, + 480 + ], + [ + 481, + 482 + ], + [ + 485, + 486 + ], + [ + 487, + 490 + ], + [ + 492, + 493 + ], + [ + 497, + 498 + ], + [ + 501, + 503 + ], + [ + 504, + 508 + ], + [ + 511, + 514 + ], + [ + 515, + 516 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 523, + 524 + ], + [ + 531, + 532 + ], + [ + 538, + 539 + ], + [ + 544, + 547 + ], + [ + 548, + 550 + ], + [ + 551, + 554 + ], + [ + 555, + 557 + ], + [ + 558, + 561 + ], + [ + 562, + 564 + ], + [ + 565, + 568 + ], + [ + 569, + 571 + ], + [ + 572, + 575 + ], + [ + 576, + 578 + ], + [ + 579, + 582 + ], + [ + 583, + 585 + ], + [ + 588, + 589 + ], + [ + 594, + 595 + ], + [ + 602, + 603 + ], + [ + 610, + 612 + ], + [ + 614, + 615 + ], + [ + 616, + 617 + ], + [ + 619, + 620 + ], + [ + 621, + 622 + ], + [ + 625, + 626 + ], + [ + 629, + 630 + ], + [ + 631, + 634 + ], + [ + 642, + 643 + ], + [ + 644, + 645 + ], + [ + 648, + 649 + ], + [ + 651, + 652 + ], + [ + 657, + 662 + ], + [ + 663, + 664 + ], + [ + 665, + 668 + ], + [ + 670, + 671 + ], + [ + 674, + 675 + ], + [ + 678, + 680 + ], + [ + 682, + 684 + ], + [ + 685, + 686 + ], + [ + 689, + 690 + ], + [ + 693, + 696 + ], + [ + 697, + 698 + ], + [ + 701, + 703 + ], + [ + 704, + 705 + ], + [ + 714, + 715 + ], + [ + 722, + 728 + ], + [ + 731, + 732 + ], + [ + 746, + 748 + ], + [ + 750, + 751 + ], + [ + 752, + 753 + ], + [ + 755, + 760 + ], + [ + 761, + 762 + ], + [ + 765, + 767 + ], + [ + 768, + 769 + ], + [ + 776, + 777 + ], + [ + 781, + 787 + ], + [ + 790, + 791 + ], + [ + 803, + 805 + ], + [ + 807, + 808 + ], + [ + 809, + 810 + ], + [ + 812, + 813 + ], + [ + 814, + 815 + ], + [ + 817, + 818 + ], + [ + 821, + 822 + ], + [ + 825, + 827 + ], + [ + 829, + 830 + ], + [ + 833, + 835 + ], + [ + 836, + 837 + ], + [ + 838, + 839 + ], + [ + 845, + 846 + ], + [ + 852, + 858 + ], + [ + 861, + 862 + ] + ] + } + }, + { + "filename": "libvips/foreign/ppmload.c", + "line_filter": { + "diff_chunks": [ + [ + 36, + 43 + ], + [ + 49, + 77 + ], + [ + 112, + 122 + ], + [ + 123, + 149 + ], + [ + 151, + 237 + ], + [ + 247, + 267 + ], + [ + 273, + 308 + ], + [ + 309, + 325 + ], + [ + 329, + 337 + ], + [ + 344, + 388 + ], + [ + 393, + 471 + ], + [ + 472, + 528 + ], + [ + 529, + 579 + ], + [ + 580, + 625 + ], + [ + 631, + 743 + ], + [ + 745, + 752 + ], + [ + 761, + 771 + ], + [ + 778, + 821 + ], + [ + 822, + 843 + ], + [ + 849, + 881 + ], + [ + 887, + 903 + ], + [ + 908, + 918 + ], + [ + 919, + 935 + ], + [ + 945, + 966 + ] + ], + "lines_added": [ + [ + 39, + 40 + ], + [ + 52, + 53 + ], + [ + 54, + 58 + ], + [ + 59, + 68 + ], + [ + 73, + 74 + ], + [ + 115, + 117 + ], + [ + 118, + 119 + ], + [ + 126, + 128 + ], + [ + 132, + 140 + ], + [ + 144, + 146 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 161, + 164 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 174, + 177 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 184, + 185 + ], + [ + 188, + 191 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 205, + 206 + ], + [ + 208, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 219, + 221 + ], + [ + 222, + 224 + ], + [ + 225, + 226 + ], + [ + 231, + 232 + ], + [ + 233, + 234 + ], + [ + 250, + 252 + ], + [ + 255, + 257 + ], + [ + 258, + 260 + ], + [ + 261, + 264 + ], + [ + 276, + 279 + ], + [ + 282, + 287 + ], + [ + 293, + 295 + ], + [ + 299, + 300 + ], + [ + 302, + 303 + ], + [ + 304, + 305 + ], + [ + 312, + 317 + ], + [ + 321, + 322 + ], + [ + 332, + 334 + ], + [ + 347, + 349 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 363, + 378 + ], + [ + 380, + 381 + ], + [ + 384, + 385 + ], + [ + 396, + 402 + ], + [ + 406, + 407 + ], + [ + 410, + 412 + ], + [ + 415, + 419 + ], + [ + 420, + 422 + ], + [ + 423, + 424 + ], + [ + 426, + 428 + ], + [ + 432, + 433 + ], + [ + 434, + 437 + ], + [ + 438, + 439 + ], + [ + 440, + 441 + ], + [ + 443, + 445 + ], + [ + 449, + 450 + ], + [ + 453, + 456 + ], + [ + 457, + 458 + ], + [ + 459, + 460 + ], + [ + 461, + 462 + ], + [ + 467, + 468 + ], + [ + 475, + 476 + ], + [ + 478, + 484 + ], + [ + 485, + 486 + ], + [ + 487, + 490 + ], + [ + 491, + 492 + ], + [ + 493, + 494 + ], + [ + 497, + 499 + ], + [ + 500, + 501 + ], + [ + 502, + 503 + ], + [ + 504, + 505 + ], + [ + 508, + 510 + ], + [ + 514, + 515 + ], + [ + 517, + 525 + ], + [ + 532, + 533 + ], + [ + 536, + 538 + ], + [ + 539, + 540 + ], + [ + 545, + 547 + ], + [ + 548, + 549 + ], + [ + 551, + 553 + ], + [ + 554, + 555 + ], + [ + 561, + 562 + ], + [ + 565, + 567 + ], + [ + 568, + 569 + ], + [ + 574, + 576 + ], + [ + 583, + 586 + ], + [ + 587, + 588 + ], + [ + 591, + 592 + ], + [ + 595, + 597 + ], + [ + 598, + 599 + ], + [ + 605, + 607 + ], + [ + 608, + 609 + ], + [ + 611, + 615 + ], + [ + 616, + 617 + ], + [ + 620, + 622 + ], + [ + 634, + 635 + ], + [ + 638, + 639 + ], + [ + 640, + 642 + ], + [ + 648, + 649 + ], + [ + 650, + 651 + ], + [ + 655, + 656 + ], + [ + 658, + 659 + ], + [ + 660, + 661 + ], + [ + 662, + 663 + ], + [ + 667, + 668 + ], + [ + 669, + 670 + ], + [ + 676, + 677 + ], + [ + 682, + 687 + ], + [ + 688, + 689 + ], + [ + 692, + 693 + ], + [ + 695, + 697 + ], + [ + 698, + 701 + ], + [ + 704, + 709 + ], + [ + 711, + 713 + ], + [ + 716, + 718 + ], + [ + 722, + 723 + ], + [ + 724, + 727 + ], + [ + 728, + 730 + ], + [ + 731, + 732 + ], + [ + 735, + 736 + ], + [ + 737, + 738 + ], + [ + 739, + 740 + ], + [ + 748, + 749 + ], + [ + 767, + 768 + ], + [ + 781, + 783 + ], + [ + 785, + 786 + ], + [ + 790, + 794 + ], + [ + 795, + 796 + ], + [ + 799, + 800 + ], + [ + 804, + 807 + ], + [ + 808, + 810 + ], + [ + 811, + 812 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 825, + 826 + ], + [ + 830, + 836 + ], + [ + 839, + 840 + ], + [ + 852, + 854 + ], + [ + 856, + 857 + ], + [ + 861, + 862 + ], + [ + 863, + 864 + ], + [ + 866, + 868 + ], + [ + 869, + 870 + ], + [ + 873, + 874 + ], + [ + 875, + 876 + ], + [ + 877, + 878 + ], + [ + 890, + 896 + ], + [ + 899, + 900 + ], + [ + 911, + 912 + ], + [ + 914, + 915 + ], + [ + 922, + 923 + ], + [ + 927, + 930 + ], + [ + 931, + 932 + ], + [ + 948, + 949 + ], + [ + 955, + 956 + ], + [ + 960, + 963 + ], + [ + 964, + 965 + ] + ] + } + }, + { + "filename": "libvips/foreign/ppmsave.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 48 + ], + [ + 68, + 75 + ], + [ + 87, + 129 + ], + [ + 130, + 171 + ], + [ + 172, + 186 + ], + [ + 188, + 225 + ], + [ + 226, + 234 + ], + [ + 241, + 263 + ], + [ + 273, + 427 + ], + [ + 442, + 451 + ], + [ + 453, + 497 + ], + [ + 498, + 538 + ], + [ + 539, + 560 + ], + [ + 565, + 596 + ], + [ + 601, + 636 + ], + [ + 639, + 646 + ], + [ + 649, + 668 + ], + [ + 671, + 678 + ], + [ + 681, + 700 + ], + [ + 703, + 710 + ], + [ + 713, + 732 + ], + [ + 735, + 742 + ], + [ + 746, + 753 + ], + [ + 757, + 772 + ], + [ + 776, + 797 + ], + [ + 807, + 821 + ] + ], + "lines_added": [ + [ + 23, + 39 + ], + [ + 44, + 45 + ], + [ + 71, + 72 + ], + [ + 90, + 92 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 106 + ], + [ + 111, + 113 + ], + [ + 114, + 116 + ], + [ + 119, + 121 + ], + [ + 124, + 126 + ], + [ + 133, + 135 + ], + [ + 136, + 137 + ], + [ + 140, + 142 + ], + [ + 145, + 147 + ], + [ + 148, + 150 + ], + [ + 151, + 152 + ], + [ + 155, + 157 + ], + [ + 158, + 161 + ], + [ + 162, + 163 + ], + [ + 166, + 168 + ], + [ + 175, + 177 + ], + [ + 180, + 183 + ], + [ + 191, + 194 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 206, + 208 + ], + [ + 209, + 211 + ], + [ + 213, + 214 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 229, + 231 + ], + [ + 244, + 245 + ], + [ + 246, + 247 + ], + [ + 252, + 253 + ], + [ + 259, + 260 + ], + [ + 276, + 278 + ], + [ + 280, + 284 + ], + [ + 287, + 288 + ], + [ + 289, + 290 + ], + [ + 292, + 297 + ], + [ + 298, + 302 + ], + [ + 305, + 306 + ], + [ + 307, + 314 + ], + [ + 317, + 319 + ], + [ + 320, + 322 + ], + [ + 323, + 326 + ], + [ + 327, + 329 + ], + [ + 330, + 333 + ], + [ + 334, + 336 + ], + [ + 337, + 339 + ], + [ + 340, + 342 + ], + [ + 346, + 348 + ], + [ + 349, + 352 + ], + [ + 353, + 355 + ], + [ + 356, + 358 + ], + [ + 359, + 361 + ], + [ + 364, + 366 + ], + [ + 369, + 371 + ], + [ + 373, + 374 + ], + [ + 378, + 381 + ], + [ + 383, + 384 + ], + [ + 387, + 391 + ], + [ + 396, + 398 + ], + [ + 399, + 400 + ], + [ + 403, + 404 + ], + [ + 405, + 406 + ], + [ + 408, + 410 + ], + [ + 414, + 415 + ], + [ + 417, + 419 + ], + [ + 420, + 422 + ], + [ + 423, + 424 + ], + [ + 445, + 446 + ], + [ + 447, + 448 + ], + [ + 456, + 457 + ], + [ + 462, + 465 + ], + [ + 466, + 469 + ], + [ + 470, + 473 + ], + [ + 474, + 476 + ], + [ + 477, + 480 + ], + [ + 481, + 483 + ], + [ + 484, + 487 + ], + [ + 488, + 490 + ], + [ + 493, + 494 + ], + [ + 501, + 502 + ], + [ + 506, + 508 + ], + [ + 510, + 511 + ], + [ + 515, + 518 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 523, + 524 + ], + [ + 525, + 526 + ], + [ + 528, + 529 + ], + [ + 532, + 533 + ], + [ + 534, + 535 + ], + [ + 542, + 543 + ], + [ + 547, + 553 + ], + [ + 556, + 557 + ], + [ + 568, + 570 + ], + [ + 572, + 573 + ], + [ + 575, + 576 + ], + [ + 578, + 581 + ], + [ + 583, + 586 + ], + [ + 589, + 591 + ], + [ + 592, + 593 + ], + [ + 604, + 610 + ], + [ + 613, + 614 + ], + [ + 620, + 622 + ], + [ + 624, + 626 + ], + [ + 632, + 633 + ], + [ + 642, + 643 + ], + [ + 652, + 654 + ], + [ + 656, + 658 + ], + [ + 664, + 665 + ], + [ + 674, + 675 + ], + [ + 684, + 686 + ], + [ + 688, + 690 + ], + [ + 696, + 697 + ], + [ + 706, + 707 + ], + [ + 716, + 718 + ], + [ + 720, + 722 + ], + [ + 728, + 729 + ], + [ + 738, + 739 + ], + [ + 749, + 750 + ], + [ + 760, + 762 + ], + [ + 764, + 765 + ], + [ + 768, + 769 + ], + [ + 779, + 780 + ], + [ + 784, + 787 + ], + [ + 788, + 789 + ], + [ + 793, + 794 + ], + [ + 810, + 811 + ], + [ + 815, + 818 + ], + [ + 819, + 820 + ] + ] + } + }, + { + "filename": "libvips/foreign/quantise.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 56, + 99 + ], + [ + 103, + 123 + ], + [ + 124, + 182 + ], + [ + 187, + 200 + ], + [ + 201, + 208 + ], + [ + 209, + 279 + ], + [ + 295, + 324 + ], + [ + 325, + 445 + ], + [ + 448, + 475 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 77, + 79 + ], + [ + 80, + 81 + ], + [ + 84, + 86 + ], + [ + 87, + 88 + ], + [ + 94, + 96 + ], + [ + 106, + 108 + ], + [ + 110, + 111 + ], + [ + 116, + 120 + ], + [ + 127, + 129 + ], + [ + 130, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 143, + 145 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 156, + 158 + ], + [ + 160, + 161 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 204, + 205 + ], + [ + 212, + 214 + ], + [ + 218, + 219 + ], + [ + 222, + 224 + ], + [ + 225, + 226 + ], + [ + 230, + 232 + ], + [ + 236, + 238 + ], + [ + 241, + 243 + ], + [ + 244, + 245 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 298, + 299 + ], + [ + 302, + 305 + ], + [ + 306, + 308 + ], + [ + 309, + 310 + ], + [ + 313, + 314 + ], + [ + 315, + 316 + ], + [ + 320, + 321 + ], + [ + 328, + 330 + ], + [ + 331, + 332 + ], + [ + 335, + 336 + ], + [ + 338, + 339 + ], + [ + 345, + 346 + ], + [ + 348, + 350 + ], + [ + 351, + 352 + ], + [ + 353, + 358 + ], + [ + 362, + 363 + ], + [ + 365, + 369 + ], + [ + 374, + 377 + ], + [ + 382, + 385 + ], + [ + 386, + 388 + ], + [ + 394, + 406 + ], + [ + 408, + 409 + ], + [ + 411, + 412 + ], + [ + 413, + 414 + ], + [ + 415, + 418 + ], + [ + 420, + 426 + ], + [ + 428, + 429 + ], + [ + 431, + 432 + ], + [ + 433, + 434 + ], + [ + 435, + 438 + ], + [ + 440, + 442 + ], + [ + 451, + 452 + ], + [ + 453, + 454 + ], + [ + 455, + 456 + ], + [ + 457, + 458 + ], + [ + 463, + 464 + ], + [ + 466, + 467 + ], + [ + 468, + 470 + ], + [ + 471, + 472 + ] + ] + } + }, + { + "filename": "libvips/foreign/quantise.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 60, + 91 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 63, + 82 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ] + ] + } + }, + { + "filename": "libvips/foreign/radiance.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 16, + 23 + ], + [ + 33, + 61 + ], + [ + 70, + 78 + ], + [ + 176, + 362 + ], + [ + 363, + 474 + ], + [ + 475, + 575 + ], + [ + 577, + 586 + ], + [ + 587, + 735 + ], + [ + 748, + 755 + ], + [ + 756, + 800 + ], + [ + 805, + 849 + ], + [ + 855, + 862 + ], + [ + 863, + 1004 + ], + [ + 1016, + 1046 + ], + [ + 1051, + 1100 + ], + [ + 1105, + 1218 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 19, + 20 + ], + [ + 36, + 37 + ], + [ + 38, + 42 + ], + [ + 43, + 52 + ], + [ + 57, + 58 + ], + [ + 73, + 75 + ], + [ + 179, + 188 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 195, + 196 + ], + [ + 197, + 199 + ], + [ + 200, + 201 + ], + [ + 202, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 217, + 226 + ], + [ + 227, + 235 + ], + [ + 237, + 265 + ], + [ + 270, + 275 + ], + [ + 276, + 284 + ], + [ + 285, + 286 + ], + [ + 289, + 359 + ], + [ + 366, + 370 + ], + [ + 371, + 374 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 379, + 380 + ], + [ + 382, + 384 + ], + [ + 386, + 389 + ], + [ + 390, + 394 + ], + [ + 395, + 398 + ], + [ + 399, + 400 + ], + [ + 401, + 403 + ], + [ + 405, + 408 + ], + [ + 409, + 411 + ], + [ + 412, + 416 + ], + [ + 417, + 420 + ], + [ + 421, + 426 + ], + [ + 427, + 433 + ], + [ + 436, + 437 + ], + [ + 439, + 441 + ], + [ + 443, + 444 + ], + [ + 446, + 449 + ], + [ + 450, + 451 + ], + [ + 452, + 454 + ], + [ + 456, + 459 + ], + [ + 462, + 465 + ], + [ + 466, + 468 + ], + [ + 470, + 471 + ], + [ + 478, + 479 + ], + [ + 480, + 491 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 499, + 500 + ], + [ + 501, + 502 + ], + [ + 503, + 515 + ], + [ + 517, + 518 + ], + [ + 519, + 520 + ], + [ + 523, + 524 + ], + [ + 526, + 527 + ], + [ + 528, + 529 + ], + [ + 531, + 534 + ], + [ + 538, + 541 + ], + [ + 543, + 544 + ], + [ + 549, + 550 + ], + [ + 555, + 563 + ], + [ + 564, + 565 + ], + [ + 566, + 567 + ], + [ + 569, + 572 + ], + [ + 580, + 583 + ], + [ + 590, + 591 + ], + [ + 596, + 597 + ], + [ + 602, + 624 + ], + [ + 626, + 628 + ], + [ + 631, + 633 + ], + [ + 634, + 635 + ], + [ + 636, + 637 + ], + [ + 638, + 641 + ], + [ + 643, + 644 + ], + [ + 646, + 648 + ], + [ + 649, + 650 + ], + [ + 651, + 656 + ], + [ + 659, + 660 + ], + [ + 664, + 665 + ], + [ + 669, + 671 + ], + [ + 674, + 679 + ], + [ + 682, + 686 + ], + [ + 687, + 689 + ], + [ + 694, + 695 + ], + [ + 697, + 704 + ], + [ + 706, + 707 + ], + [ + 711, + 712 + ], + [ + 713, + 716 + ], + [ + 719, + 722 + ], + [ + 727, + 732 + ], + [ + 751, + 752 + ], + [ + 759, + 763 + ], + [ + 764, + 765 + ], + [ + 768, + 769 + ], + [ + 770, + 771 + ], + [ + 774, + 775 + ], + [ + 776, + 778 + ], + [ + 781, + 782 + ], + [ + 786, + 788 + ], + [ + 789, + 791 + ], + [ + 792, + 793 + ], + [ + 794, + 795 + ], + [ + 796, + 797 + ], + [ + 808, + 812 + ], + [ + 813, + 814 + ], + [ + 817, + 818 + ], + [ + 819, + 822 + ], + [ + 823, + 825 + ], + [ + 826, + 827 + ], + [ + 830, + 832 + ], + [ + 834, + 836 + ], + [ + 837, + 839 + ], + [ + 841, + 842 + ], + [ + 845, + 846 + ], + [ + 858, + 859 + ], + [ + 866, + 873 + ], + [ + 875, + 876 + ], + [ + 877, + 878 + ], + [ + 882, + 885 + ], + [ + 886, + 890 + ], + [ + 892, + 893 + ], + [ + 895, + 896 + ], + [ + 897, + 900 + ], + [ + 901, + 903 + ], + [ + 904, + 905 + ], + [ + 906, + 907 + ], + [ + 908, + 911 + ], + [ + 912, + 913 + ], + [ + 914, + 918 + ], + [ + 919, + 920 + ], + [ + 923, + 924 + ], + [ + 927, + 932 + ], + [ + 933, + 934 + ], + [ + 937, + 939 + ], + [ + 940, + 942 + ], + [ + 946, + 948 + ], + [ + 950, + 951 + ], + [ + 952, + 955 + ], + [ + 956, + 961 + ], + [ + 964, + 965 + ], + [ + 966, + 967 + ], + [ + 970, + 971 + ], + [ + 972, + 974 + ], + [ + 978, + 980 + ], + [ + 982, + 984 + ], + [ + 986, + 988 + ], + [ + 989, + 996 + ], + [ + 997, + 999 + ], + [ + 1000, + 1001 + ], + [ + 1019, + 1020 + ], + [ + 1021, + 1023 + ], + [ + 1024, + 1025 + ], + [ + 1028, + 1029 + ], + [ + 1033, + 1035 + ], + [ + 1038, + 1039 + ], + [ + 1040, + 1041 + ], + [ + 1042, + 1043 + ], + [ + 1054, + 1057 + ], + [ + 1059, + 1060 + ], + [ + 1063, + 1064 + ], + [ + 1069, + 1071 + ], + [ + 1072, + 1075 + ], + [ + 1076, + 1079 + ], + [ + 1080, + 1084 + ], + [ + 1085, + 1089 + ], + [ + 1091, + 1094 + ], + [ + 1095, + 1097 + ], + [ + 1108, + 1109 + ], + [ + 1110, + 1134 + ], + [ + 1139, + 1140 + ], + [ + 1141, + 1143 + ], + [ + 1145, + 1148 + ], + [ + 1154, + 1155 + ], + [ + 1156, + 1158 + ], + [ + 1160, + 1161 + ], + [ + 1164, + 1165 + ], + [ + 1169, + 1171 + ], + [ + 1172, + 1174 + ], + [ + 1176, + 1177 + ], + [ + 1180, + 1181 + ], + [ + 1182, + 1184 + ], + [ + 1185, + 1186 + ], + [ + 1189, + 1190 + ], + [ + 1194, + 1195 + ], + [ + 1197, + 1202 + ], + [ + 1203, + 1207 + ], + [ + 1209, + 1211 + ], + [ + 1212, + 1213 + ], + [ + 1214, + 1215 + ] + ] + } + }, + { + "filename": "libvips/foreign/radload.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 63, + 129 + ], + [ + 132, + 147 + ], + [ + 155, + 216 + ], + [ + 218, + 267 + ], + [ + 269, + 292 + ], + [ + 300, + 345 + ], + [ + 346, + 367 + ], + [ + 372, + 407 + ], + [ + 412, + 427 + ], + [ + 428, + 443 + ], + [ + 445, + 466 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 96, + 98 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 107, + 109 + ], + [ + 110, + 111 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 125, + 126 + ], + [ + 135, + 136 + ], + [ + 143, + 144 + ], + [ + 158, + 160 + ], + [ + 162, + 163 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 172, + 174 + ], + [ + 175, + 176 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 196, + 197 + ], + [ + 203, + 209 + ], + [ + 212, + 213 + ], + [ + 221, + 222 + ], + [ + 227, + 229 + ], + [ + 231, + 232 + ], + [ + 236, + 239 + ], + [ + 240, + 242 + ], + [ + 243, + 244 + ], + [ + 247, + 248 + ], + [ + 252, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 272, + 273 + ], + [ + 279, + 285 + ], + [ + 288, + 289 + ], + [ + 303, + 305 + ], + [ + 307, + 308 + ], + [ + 312, + 317 + ], + [ + 318, + 320 + ], + [ + 321, + 322 + ], + [ + 325, + 326 + ], + [ + 330, + 334 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 349, + 350 + ], + [ + 354, + 360 + ], + [ + 363, + 364 + ], + [ + 375, + 376 + ], + [ + 379, + 382 + ], + [ + 384, + 385 + ], + [ + 387, + 388 + ], + [ + 394, + 395 + ], + [ + 399, + 402 + ], + [ + 403, + 404 + ], + [ + 415, + 417 + ], + [ + 423, + 424 + ], + [ + 431, + 432 + ], + [ + 433, + 436 + ], + [ + 437, + 438 + ], + [ + 439, + 440 + ], + [ + 448, + 449 + ], + [ + 455, + 456 + ], + [ + 460, + 463 + ], + [ + 464, + 465 + ] + ] + } + }, + { + "filename": "libvips/foreign/radsave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 60, + 68 + ], + [ + 82, + 96 + ], + [ + 97, + 166 + ], + [ + 171, + 218 + ], + [ + 223, + 283 + ], + [ + 284, + 323 + ], + [ + 327, + 363 + ], + [ + 367, + 381 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 63, + 65 + ], + [ + 85, + 86 + ], + [ + 92, + 93 + ], + [ + 103, + 104 + ], + [ + 110, + 111 + ], + [ + 115, + 117 + ], + [ + 119, + 120 + ], + [ + 126, + 128 + ], + [ + 129, + 134 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 150, + 151 + ], + [ + 153, + 159 + ], + [ + 162, + 163 + ], + [ + 174, + 176 + ], + [ + 178, + 179 + ], + [ + 183, + 185 + ], + [ + 186, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 202, + 203 + ], + [ + 205, + 211 + ], + [ + 214, + 215 + ], + [ + 226, + 228 + ], + [ + 230, + 231 + ], + [ + 237, + 239 + ], + [ + 240, + 242 + ], + [ + 243, + 246 + ], + [ + 248, + 251 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 267, + 268 + ], + [ + 270, + 276 + ], + [ + 279, + 280 + ], + [ + 287, + 288 + ], + [ + 293, + 294 + ], + [ + 300, + 301 + ], + [ + 305, + 308 + ], + [ + 309, + 310 + ], + [ + 314, + 315 + ], + [ + 319, + 320 + ], + [ + 330, + 331 + ], + [ + 336, + 337 + ], + [ + 338, + 341 + ], + [ + 342, + 345 + ], + [ + 348, + 349 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 359, + 360 + ], + [ + 370, + 371 + ], + [ + 375, + 378 + ], + [ + 379, + 380 + ] + ] + } + }, + { + "filename": "libvips/foreign/rawload.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 61, + 124 + ], + [ + 128, + 193 + ], + [ + 207, + 238 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 64, + 66 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 87, + 100 + ], + [ + 101, + 102 + ], + [ + 104, + 105 + ], + [ + 106, + 109 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 138, + 144 + ], + [ + 145, + 148 + ], + [ + 149, + 151 + ], + [ + 152, + 155 + ], + [ + 156, + 158 + ], + [ + 159, + 162 + ], + [ + 163, + 165 + ], + [ + 166, + 169 + ], + [ + 170, + 172 + ], + [ + 173, + 176 + ], + [ + 177, + 179 + ], + [ + 180, + 183 + ], + [ + 184, + 186 + ], + [ + 189, + 190 + ], + [ + 210, + 212 + ], + [ + 218, + 219 + ], + [ + 225, + 227 + ], + [ + 231, + 235 + ], + [ + 236, + 237 + ] + ] + } + }, + { + "filename": "libvips/foreign/rawsave.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 75, + 128 + ], + [ + 130, + 139 + ], + [ + 142, + 192 + ], + [ + 199, + 248 + ], + [ + 250, + 279 + ], + [ + 284, + 298 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 78, + 80 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 97, + 105 + ], + [ + 107, + 108 + ], + [ + 111, + 112 + ], + [ + 116, + 118 + ], + [ + 119, + 123 + ], + [ + 124, + 125 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 145, + 146 + ], + [ + 152, + 158 + ], + [ + 161, + 162 + ], + [ + 167, + 168 + ], + [ + 172, + 173 + ], + [ + 179, + 180 + ], + [ + 184, + 187 + ], + [ + 188, + 189 + ], + [ + 202, + 204 + ], + [ + 206, + 207 + ], + [ + 211, + 219 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 230, + 232 + ], + [ + 233, + 237 + ], + [ + 238, + 239 + ], + [ + 242, + 243 + ], + [ + 244, + 245 + ], + [ + 253, + 254 + ], + [ + 260, + 266 + ], + [ + 269, + 270 + ], + [ + 275, + 276 + ], + [ + 287, + 288 + ], + [ + 292, + 295 + ], + [ + 296, + 297 + ] + ] + } + }, + { + "filename": "libvips/foreign/spngload.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 80, + 208 + ], + [ + 214, + 293 + ], + [ + 310, + 328 + ], + [ + 331, + 344 + ], + [ + 345, + 405 + ], + [ + 406, + 413 + ], + [ + 416, + 648 + ], + [ + 651, + 679 + ], + [ + 687, + 756 + ], + [ + 758, + 809 + ], + [ + 811, + 834 + ], + [ + 842, + 887 + ], + [ + 888, + 909 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 83, + 85 + ], + [ + 87, + 88 + ], + [ + 91, + 93 + ], + [ + 94, + 95 + ], + [ + 97, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 106, + 111 + ], + [ + 116, + 117 + ], + [ + 120, + 121 + ], + [ + 126, + 135 + ], + [ + 136, + 137 + ], + [ + 139, + 140 + ], + [ + 144, + 145 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 156, + 157 + ], + [ + 161, + 165 + ], + [ + 166, + 167 + ], + [ + 173, + 175 + ], + [ + 177, + 179 + ], + [ + 181, + 182 + ], + [ + 188, + 190 + ], + [ + 191, + 192 + ], + [ + 197, + 198 + ], + [ + 199, + 200 + ], + [ + 204, + 205 + ], + [ + 217, + 218 + ], + [ + 220, + 222 + ], + [ + 224, + 225 + ], + [ + 226, + 228 + ], + [ + 229, + 231 + ], + [ + 232, + 234 + ], + [ + 235, + 238 + ], + [ + 239, + 240 + ], + [ + 245, + 249 + ], + [ + 252, + 255 + ], + [ + 257, + 258 + ], + [ + 260, + 262 + ], + [ + 265, + 268 + ], + [ + 271, + 274 + ], + [ + 277, + 279 + ], + [ + 280, + 285 + ], + [ + 289, + 290 + ], + [ + 313, + 316 + ], + [ + 318, + 319 + ], + [ + 322, + 323 + ], + [ + 324, + 325 + ], + [ + 334, + 335 + ], + [ + 336, + 338 + ], + [ + 340, + 341 + ], + [ + 348, + 353 + ], + [ + 355, + 362 + ], + [ + 365, + 366 + ], + [ + 367, + 370 + ], + [ + 371, + 372 + ], + [ + 375, + 376 + ], + [ + 378, + 381 + ], + [ + 383, + 386 + ], + [ + 388, + 391 + ], + [ + 394, + 396 + ], + [ + 400, + 402 + ], + [ + 409, + 410 + ], + [ + 419, + 420 + ], + [ + 424, + 426 + ], + [ + 432, + 437 + ], + [ + 441, + 443 + ], + [ + 445, + 446 + ], + [ + 448, + 450 + ], + [ + 451, + 452 + ], + [ + 454, + 456 + ], + [ + 457, + 458 + ], + [ + 460, + 461 + ], + [ + 462, + 464 + ], + [ + 465, + 466 + ], + [ + 470, + 471 + ], + [ + 472, + 474 + ], + [ + 475, + 476 + ], + [ + 479, + 480 + ], + [ + 481, + 482 + ], + [ + 485, + 487 + ], + [ + 488, + 490 + ], + [ + 491, + 492 + ], + [ + 497, + 500 + ], + [ + 505, + 508 + ], + [ + 512, + 513 + ], + [ + 517, + 521 + ], + [ + 523, + 525 + ], + [ + 527, + 534 + ], + [ + 535, + 536 + ], + [ + 538, + 543 + ], + [ + 545, + 547 + ], + [ + 548, + 549 + ], + [ + 550, + 554 + ], + [ + 560, + 561 + ], + [ + 564, + 565 + ], + [ + 566, + 567 + ], + [ + 568, + 570 + ], + [ + 574, + 576 + ], + [ + 581, + 583 + ], + [ + 586, + 597 + ], + [ + 601, + 602 + ], + [ + 603, + 605 + ], + [ + 609, + 611 + ], + [ + 616, + 621 + ], + [ + 625, + 636 + ], + [ + 638, + 639 + ], + [ + 642, + 643 + ], + [ + 644, + 645 + ], + [ + 654, + 655 + ], + [ + 660, + 661 + ], + [ + 666, + 669 + ], + [ + 670, + 672 + ], + [ + 675, + 676 + ], + [ + 690, + 692 + ], + [ + 694, + 695 + ], + [ + 699, + 700 + ], + [ + 701, + 702 + ], + [ + 704, + 706 + ], + [ + 707, + 708 + ], + [ + 711, + 712 + ], + [ + 717, + 720 + ], + [ + 721, + 722 + ], + [ + 725, + 726 + ], + [ + 727, + 728 + ], + [ + 729, + 730 + ], + [ + 736, + 737 + ], + [ + 743, + 749 + ], + [ + 752, + 753 + ], + [ + 761, + 762 + ], + [ + 767, + 769 + ], + [ + 771, + 772 + ], + [ + 776, + 779 + ], + [ + 780, + 782 + ], + [ + 783, + 784 + ], + [ + 787, + 788 + ], + [ + 792, + 796 + ], + [ + 797, + 798 + ], + [ + 803, + 804 + ], + [ + 805, + 806 + ], + [ + 814, + 815 + ], + [ + 821, + 827 + ], + [ + 830, + 831 + ], + [ + 845, + 847 + ], + [ + 849, + 850 + ], + [ + 854, + 859 + ], + [ + 860, + 862 + ], + [ + 863, + 864 + ], + [ + 867, + 868 + ], + [ + 872, + 876 + ], + [ + 877, + 878 + ], + [ + 881, + 882 + ], + [ + 883, + 884 + ], + [ + 891, + 892 + ], + [ + 896, + 902 + ], + [ + 905, + 906 + ] + ] + } + }, + { + "filename": "libvips/foreign/spngsave.c", + "line_filter": { + "diff_chunks": [ + [ + 18, + 46 + ], + [ + 100, + 180 + ], + [ + 181, + 386 + ], + [ + 388, + 469 + ], + [ + 471, + 493 + ], + [ + 496, + 519 + ], + [ + 520, + 550 + ], + [ + 552, + 655 + ], + [ + 663, + 672 + ], + [ + 675, + 682 + ], + [ + 683, + 763 + ], + [ + 773, + 873 + ], + [ + 878, + 932 + ] + ], + "lines_added": [ + [ + 21, + 37 + ], + [ + 42, + 43 + ], + [ + 103, + 105 + ], + [ + 107, + 108 + ], + [ + 113, + 116 + ], + [ + 117, + 118 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 127, + 128 + ], + [ + 131, + 133 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 140, + 142 + ], + [ + 143, + 146 + ], + [ + 149, + 151 + ], + [ + 154, + 155 + ], + [ + 159, + 161 + ], + [ + 162, + 167 + ], + [ + 169, + 170 + ], + [ + 172, + 173 + ], + [ + 176, + 177 + ], + [ + 184, + 185 + ], + [ + 187, + 190 + ], + [ + 191, + 193 + ], + [ + 195, + 198 + ], + [ + 200, + 202 + ], + [ + 204, + 205 + ], + [ + 206, + 208 + ], + [ + 210, + 211 + ], + [ + 214, + 217 + ], + [ + 219, + 222 + ], + [ + 224, + 226 + ], + [ + 229, + 230 + ], + [ + 232, + 233 + ], + [ + 237, + 240 + ], + [ + 245, + 249 + ], + [ + 251, + 252 + ], + [ + 254, + 258 + ], + [ + 261, + 263 + ], + [ + 267, + 268 + ], + [ + 270, + 272 + ], + [ + 273, + 276 + ], + [ + 281, + 282 + ], + [ + 283, + 285 + ], + [ + 286, + 287 + ], + [ + 292, + 294 + ], + [ + 295, + 296 + ], + [ + 298, + 300 + ], + [ + 301, + 304 + ], + [ + 306, + 309 + ], + [ + 310, + 317 + ], + [ + 318, + 320 + ], + [ + 322, + 325 + ], + [ + 328, + 330 + ], + [ + 331, + 332 + ], + [ + 335, + 337 + ], + [ + 339, + 340 + ], + [ + 346, + 349 + ], + [ + 350, + 351 + ], + [ + 354, + 356 + ], + [ + 357, + 360 + ], + [ + 364, + 365 + ], + [ + 370, + 374 + ], + [ + 376, + 377 + ], + [ + 380, + 381 + ], + [ + 382, + 383 + ], + [ + 391, + 392 + ], + [ + 393, + 397 + ], + [ + 403, + 404 + ], + [ + 409, + 410 + ], + [ + 416, + 418 + ], + [ + 421, + 423 + ], + [ + 428, + 429 + ], + [ + 431, + 434 + ], + [ + 439, + 442 + ], + [ + 444, + 450 + ], + [ + 454, + 457 + ], + [ + 460, + 463 + ], + [ + 465, + 466 + ], + [ + 474, + 481 + ], + [ + 485, + 486 + ], + [ + 487, + 490 + ], + [ + 499, + 501 + ], + [ + 505, + 509 + ], + [ + 511, + 512 + ], + [ + 513, + 516 + ], + [ + 523, + 525 + ], + [ + 526, + 529 + ], + [ + 531, + 532 + ], + [ + 535, + 539 + ], + [ + 541, + 542 + ], + [ + 544, + 547 + ], + [ + 555, + 557 + ], + [ + 559, + 561 + ], + [ + 562, + 565 + ], + [ + 569, + 571 + ], + [ + 572, + 576 + ], + [ + 579, + 582 + ], + [ + 584, + 586 + ], + [ + 587, + 588 + ], + [ + 591, + 592 + ], + [ + 598, + 600 + ], + [ + 602, + 603 + ], + [ + 606, + 612 + ], + [ + 616, + 618 + ], + [ + 621, + 622 + ], + [ + 624, + 627 + ], + [ + 628, + 629 + ], + [ + 635, + 637 + ], + [ + 641, + 642 + ], + [ + 644, + 647 + ], + [ + 649, + 650 + ], + [ + 651, + 652 + ], + [ + 666, + 667 + ], + [ + 668, + 669 + ], + [ + 678, + 679 + ], + [ + 686, + 689 + ], + [ + 690, + 692 + ], + [ + 693, + 696 + ], + [ + 697, + 699 + ], + [ + 700, + 703 + ], + [ + 704, + 706 + ], + [ + 707, + 710 + ], + [ + 711, + 712 + ], + [ + 713, + 714 + ], + [ + 715, + 718 + ], + [ + 719, + 721 + ], + [ + 722, + 725 + ], + [ + 726, + 728 + ], + [ + 729, + 732 + ], + [ + 733, + 735 + ], + [ + 736, + 739 + ], + [ + 740, + 742 + ], + [ + 743, + 746 + ], + [ + 747, + 749 + ], + [ + 750, + 753 + ], + [ + 754, + 756 + ], + [ + 759, + 760 + ], + [ + 776, + 778 + ], + [ + 780, + 781 + ], + [ + 783, + 784 + ], + [ + 787, + 788 + ], + [ + 789, + 791 + ], + [ + 792, + 793 + ], + [ + 796, + 797 + ], + [ + 798, + 799 + ], + [ + 805, + 806 + ], + [ + 808, + 814 + ], + [ + 817, + 818 + ], + [ + 824, + 825 + ], + [ + 829, + 831 + ], + [ + 833, + 834 + ], + [ + 838, + 840 + ], + [ + 841, + 843 + ], + [ + 844, + 845 + ], + [ + 848, + 849 + ], + [ + 850, + 851 + ], + [ + 857, + 858 + ], + [ + 860, + 866 + ], + [ + 869, + 870 + ], + [ + 881, + 883 + ], + [ + 885, + 886 + ], + [ + 888, + 889 + ], + [ + 893, + 895 + ], + [ + 896, + 898 + ], + [ + 899, + 902 + ], + [ + 903, + 904 + ], + [ + 907, + 908 + ], + [ + 909, + 910 + ], + [ + 916, + 917 + ], + [ + 919, + 925 + ], + [ + 928, + 929 + ] + ] + } + }, + { + "filename": "libvips/foreign/svgload.c", + "line_filter": { + "diff_chunks": [ + [ + 21, + 28 + ], + [ + 32, + 60 + ], + [ + 81, + 88 + ], + [ + 125, + 231 + ], + [ + 245, + 254 + ], + [ + 259, + 281 + ], + [ + 295, + 339 + ], + [ + 341, + 386 + ], + [ + 387, + 405 + ], + [ + 407, + 472 + ], + [ + 473, + 515 + ], + [ + 517, + 683 + ], + [ + 685, + 692 + ], + [ + 696, + 731 + ], + [ + 742, + 769 + ], + [ + 770, + 817 + ], + [ + 818, + 834 + ], + [ + 836, + 864 + ], + [ + 867, + 891 + ], + [ + 893, + 903 + ], + [ + 911, + 927 + ], + [ + 935, + 949 + ], + [ + 950, + 974 + ], + [ + 979, + 995 + ], + [ + 1010, + 1017 + ], + [ + 1023, + 1039 + ], + [ + 1049, + 1066 + ], + [ + 1067, + 1082 + ], + [ + 1098, + 1105 + ], + [ + 1106, + 1121 + ], + [ + 1123, + 1144 + ] + ], + "lines_added": [ + [ + 24, + 25 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 84, + 85 + ], + [ + 128, + 130 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 145, + 146 + ], + [ + 150, + 151 + ], + [ + 154, + 156 + ], + [ + 157, + 159 + ], + [ + 162, + 167 + ], + [ + 169, + 172 + ], + [ + 176, + 181 + ], + [ + 182, + 183 + ], + [ + 184, + 186 + ], + [ + 187, + 189 + ], + [ + 191, + 214 + ], + [ + 216, + 218 + ], + [ + 219, + 222 + ], + [ + 227, + 228 + ], + [ + 248, + 251 + ], + [ + 262, + 264 + ], + [ + 267, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 278 + ], + [ + 298, + 299 + ], + [ + 300, + 302 + ], + [ + 303, + 304 + ], + [ + 307, + 308 + ], + [ + 311, + 312 + ], + [ + 313, + 314 + ], + [ + 317, + 318 + ], + [ + 321, + 322 + ], + [ + 325, + 326 + ], + [ + 327, + 328 + ], + [ + 330, + 331 + ], + [ + 335, + 336 + ], + [ + 344, + 383 + ], + [ + 390, + 392 + ], + [ + 393, + 394 + ], + [ + 398, + 399 + ], + [ + 400, + 402 + ], + [ + 410, + 411 + ], + [ + 413, + 414 + ], + [ + 415, + 418 + ], + [ + 420, + 422 + ], + [ + 426, + 428 + ], + [ + 431, + 432 + ], + [ + 434, + 435 + ], + [ + 437, + 438 + ], + [ + 441, + 443 + ], + [ + 445, + 447 + ], + [ + 448, + 450 + ], + [ + 452, + 454 + ], + [ + 456, + 457 + ], + [ + 462, + 465 + ], + [ + 467, + 469 + ], + [ + 476, + 478 + ], + [ + 479, + 483 + ], + [ + 488, + 492 + ], + [ + 497, + 498 + ], + [ + 501, + 503 + ], + [ + 509, + 512 + ], + [ + 520, + 522 + ], + [ + 523, + 524 + ], + [ + 527, + 528 + ], + [ + 533, + 535 + ], + [ + 540, + 541 + ], + [ + 543, + 544 + ], + [ + 547, + 549 + ], + [ + 550, + 551 + ], + [ + 554, + 555 + ], + [ + 558, + 559 + ], + [ + 562, + 564 + ], + [ + 566, + 568 + ], + [ + 574, + 576 + ], + [ + 577, + 578 + ], + [ + 582, + 583 + ], + [ + 584, + 591 + ], + [ + 595, + 596 + ], + [ + 597, + 600 + ], + [ + 601, + 618 + ], + [ + 619, + 621 + ], + [ + 624, + 627 + ], + [ + 628, + 634 + ], + [ + 636, + 637 + ], + [ + 642, + 646 + ], + [ + 647, + 648 + ], + [ + 651, + 652 + ], + [ + 654, + 656 + ], + [ + 659, + 664 + ], + [ + 667, + 670 + ], + [ + 671, + 672 + ], + [ + 675, + 676 + ], + [ + 677, + 678 + ], + [ + 679, + 680 + ], + [ + 688, + 689 + ], + [ + 699, + 700 + ], + [ + 704, + 707 + ], + [ + 708, + 710 + ], + [ + 711, + 714 + ], + [ + 715, + 717 + ], + [ + 718, + 721 + ], + [ + 722, + 724 + ], + [ + 727, + 728 + ], + [ + 745, + 747 + ], + [ + 749, + 750 + ], + [ + 754, + 757 + ], + [ + 758, + 759 + ], + [ + 762, + 763 + ], + [ + 765, + 766 + ], + [ + 773, + 775 + ], + [ + 776, + 782 + ], + [ + 783, + 784 + ], + [ + 785, + 786 + ], + [ + 789, + 790 + ], + [ + 793, + 797 + ], + [ + 798, + 799 + ], + [ + 802, + 803 + ], + [ + 804, + 805 + ], + [ + 806, + 807 + ], + [ + 813, + 814 + ], + [ + 821, + 827 + ], + [ + 830, + 831 + ], + [ + 839, + 840 + ], + [ + 845, + 847 + ], + [ + 849, + 850 + ], + [ + 854, + 857 + ], + [ + 860, + 861 + ], + [ + 870, + 876 + ], + [ + 877, + 878 + ], + [ + 879, + 880 + ], + [ + 881, + 882 + ], + [ + 886, + 888 + ], + [ + 896, + 898 + ], + [ + 899, + 900 + ], + [ + 914, + 920 + ], + [ + 923, + 924 + ], + [ + 938, + 940 + ], + [ + 942, + 943 + ], + [ + 945, + 946 + ], + [ + 953, + 960 + ], + [ + 961, + 962 + ], + [ + 963, + 964 + ], + [ + 967, + 969 + ], + [ + 970, + 971 + ], + [ + 982, + 988 + ], + [ + 991, + 992 + ], + [ + 1013, + 1014 + ], + [ + 1026, + 1027 + ], + [ + 1031, + 1034 + ], + [ + 1035, + 1036 + ], + [ + 1052, + 1053 + ], + [ + 1054, + 1056 + ], + [ + 1062, + 1063 + ], + [ + 1070, + 1071 + ], + [ + 1072, + 1075 + ], + [ + 1076, + 1077 + ], + [ + 1078, + 1079 + ], + [ + 1101, + 1102 + ], + [ + 1109, + 1110 + ], + [ + 1111, + 1114 + ], + [ + 1115, + 1116 + ], + [ + 1117, + 1118 + ], + [ + 1126, + 1127 + ], + [ + 1133, + 1134 + ], + [ + 1138, + 1141 + ], + [ + 1142, + 1143 + ] + ] + } + }, + { + "filename": "libvips/foreign/tiff.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 63, + 156 + ], + [ + 157, + 200 + ], + [ + 202, + 263 + ], + [ + 264, + 295 + ] + ], + "lines_added": [ + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 28 + ], + [ + 33, + 34 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 82, + 84 + ], + [ + 87, + 88 + ], + [ + 89, + 91 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 127, + 128 + ], + [ + 131, + 132 + ], + [ + 133, + 134 + ], + [ + 140, + 141 + ], + [ + 144, + 145 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 160, + 161 + ], + [ + 165, + 166 + ], + [ + 168, + 170 + ], + [ + 172, + 173 + ], + [ + 174, + 176 + ], + [ + 178, + 190 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 205, + 206 + ], + [ + 209, + 210 + ], + [ + 213, + 214 + ], + [ + 217, + 219 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 228, + 229 + ], + [ + 232, + 233 + ], + [ + 236, + 238 + ], + [ + 239, + 240 + ], + [ + 243, + 244 + ], + [ + 247, + 248 + ], + [ + 251, + 252 + ], + [ + 255, + 256 + ], + [ + 259, + 260 + ], + [ + 267, + 268 + ], + [ + 274, + 275 + ], + [ + 277, + 289 + ], + [ + 291, + 292 + ] + ] + } + }, + { + "filename": "libvips/foreign/tiff.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 37, + 47 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 40, + 41 + ], + [ + 42, + 44 + ] + ] + } + }, + { + "filename": "libvips/foreign/tiff2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 106, + 113 + ], + [ + 140, + 147 + ], + [ + 156, + 163 + ], + [ + 168, + 175 + ], + [ + 184, + 191 + ], + [ + 195, + 202 + ], + [ + 215, + 247 + ], + [ + 283, + 290 + ], + [ + 302, + 312 + ], + [ + 318, + 325 + ], + [ + 362, + 370 + ], + [ + 377, + 387 + ], + [ + 405, + 421 + ], + [ + 426, + 488 + ], + [ + 490, + 498 + ], + [ + 499, + 513 + ], + [ + 520, + 602 + ], + [ + 603, + 610 + ], + [ + 614, + 732 + ], + [ + 734, + 754 + ], + [ + 755, + 916 + ], + [ + 923, + 952 + ], + [ + 955, + 969 + ], + [ + 973, + 985 + ], + [ + 987, + 1016 + ], + [ + 1020, + 1063 + ], + [ + 1067, + 1284 + ], + [ + 1286, + 1320 + ], + [ + 1335, + 1343 + ], + [ + 1348, + 1358 + ], + [ + 1363, + 1371 + ], + [ + 1373, + 1389 + ], + [ + 1390, + 1400 + ], + [ + 1402, + 1421 + ], + [ + 1426, + 1436 + ], + [ + 1438, + 1456 + ], + [ + 1458, + 1482 + ], + [ + 1483, + 1504 + ], + [ + 1507, + 1516 + ], + [ + 1519, + 1610 + ], + [ + 1616, + 1776 + ], + [ + 1779, + 1795 + ], + [ + 1797, + 1840 + ], + [ + 1847, + 1988 + ], + [ + 1989, + 2145 + ], + [ + 2147, + 2190 + ], + [ + 2194, + 2205 + ], + [ + 2207, + 2214 + ], + [ + 2220, + 2231 + ], + [ + 2237, + 2244 + ], + [ + 2245, + 2272 + ], + [ + 2277, + 2291 + ], + [ + 2298, + 2497 + ], + [ + 2498, + 2537 + ], + [ + 2539, + 2557 + ], + [ + 2564, + 2571 + ], + [ + 2582, + 2615 + ], + [ + 2618, + 2643 + ], + [ + 2644, + 2696 + ], + [ + 2697, + 2709 + ], + [ + 2712, + 2730 + ], + [ + 2733, + 2773 + ], + [ + 2775, + 2806 + ], + [ + 2807, + 2995 + ], + [ + 3007, + 3017 + ], + [ + 3018, + 3042 + ], + [ + 3046, + 3155 + ], + [ + 3157, + 3262 + ] + ], + "lines_added": [ + [ + 109, + 110 + ], + [ + 143, + 144 + ], + [ + 159, + 160 + ], + [ + 171, + 172 + ], + [ + 187, + 188 + ], + [ + 198, + 199 + ], + [ + 218, + 219 + ], + [ + 220, + 224 + ], + [ + 225, + 234 + ], + [ + 239, + 240 + ], + [ + 243, + 244 + ], + [ + 286, + 287 + ], + [ + 305, + 307 + ], + [ + 308, + 309 + ], + [ + 321, + 322 + ], + [ + 365, + 367 + ], + [ + 380, + 384 + ], + [ + 408, + 409 + ], + [ + 410, + 411 + ], + [ + 416, + 418 + ], + [ + 429, + 430 + ], + [ + 433, + 437 + ], + [ + 439, + 440 + ], + [ + 442, + 443 + ], + [ + 446, + 450 + ], + [ + 454, + 455 + ], + [ + 460, + 461 + ], + [ + 464, + 468 + ], + [ + 472, + 473 + ], + [ + 476, + 477 + ], + [ + 481, + 485 + ], + [ + 493, + 495 + ], + [ + 502, + 504 + ], + [ + 507, + 510 + ], + [ + 523, + 524 + ], + [ + 527, + 528 + ], + [ + 534, + 535 + ], + [ + 537, + 538 + ], + [ + 543, + 544 + ], + [ + 547, + 548 + ], + [ + 554, + 556 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ], + [ + 565, + 566 + ], + [ + 567, + 570 + ], + [ + 573, + 574 + ], + [ + 575, + 576 + ], + [ + 579, + 580 + ], + [ + 584, + 587 + ], + [ + 590, + 592 + ], + [ + 595, + 597 + ], + [ + 598, + 599 + ], + [ + 606, + 607 + ], + [ + 617, + 621 + ], + [ + 622, + 627 + ], + [ + 632, + 637 + ], + [ + 639, + 641 + ], + [ + 642, + 643 + ], + [ + 646, + 647 + ], + [ + 651, + 652 + ], + [ + 654, + 660 + ], + [ + 661, + 665 + ], + [ + 667, + 668 + ], + [ + 673, + 674 + ], + [ + 677, + 680 + ], + [ + 683, + 687 + ], + [ + 690, + 691 + ], + [ + 692, + 693 + ], + [ + 694, + 696 + ], + [ + 698, + 702 + ], + [ + 704, + 705 + ], + [ + 708, + 713 + ], + [ + 715, + 719 + ], + [ + 720, + 722 + ], + [ + 724, + 729 + ], + [ + 737, + 738 + ], + [ + 740, + 741 + ], + [ + 744, + 745 + ], + [ + 748, + 749 + ], + [ + 750, + 751 + ], + [ + 758, + 759 + ], + [ + 761, + 762 + ], + [ + 765, + 766 + ], + [ + 767, + 771 + ], + [ + 773, + 774 + ], + [ + 779, + 780 + ], + [ + 781, + 786 + ], + [ + 788, + 789 + ], + [ + 791, + 792 + ], + [ + 794, + 795 + ], + [ + 796, + 801 + ], + [ + 803, + 804 + ], + [ + 807, + 815 + ], + [ + 817, + 818 + ], + [ + 821, + 822 + ], + [ + 823, + 827 + ], + [ + 829, + 830 + ], + [ + 833, + 844 + ], + [ + 846, + 847 + ], + [ + 850, + 851 + ], + [ + 855, + 856 + ], + [ + 860, + 864 + ], + [ + 867, + 871 + ], + [ + 874, + 880 + ], + [ + 883, + 887 + ], + [ + 890, + 892 + ], + [ + 898, + 899 + ], + [ + 900, + 901 + ], + [ + 906, + 907 + ], + [ + 912, + 913 + ], + [ + 926, + 927 + ], + [ + 928, + 932 + ], + [ + 933, + 937 + ], + [ + 940, + 941 + ], + [ + 947, + 949 + ], + [ + 958, + 959 + ], + [ + 965, + 966 + ], + [ + 976, + 977 + ], + [ + 978, + 982 + ], + [ + 990, + 991 + ], + [ + 996, + 997 + ], + [ + 1003, + 1004 + ], + [ + 1007, + 1008 + ], + [ + 1012, + 1013 + ], + [ + 1023, + 1024 + ], + [ + 1025, + 1029 + ], + [ + 1030, + 1034 + ], + [ + 1037, + 1038 + ], + [ + 1043, + 1044 + ], + [ + 1050, + 1051 + ], + [ + 1054, + 1055 + ], + [ + 1059, + 1060 + ], + [ + 1070, + 1071 + ], + [ + 1072, + 1075 + ], + [ + 1076, + 1080 + ], + [ + 1083, + 1084 + ], + [ + 1089, + 1117 + ], + [ + 1120, + 1126 + ], + [ + 1129, + 1137 + ], + [ + 1138, + 1139 + ], + [ + 1140, + 1146 + ], + [ + 1147, + 1150 + ], + [ + 1151, + 1152 + ], + [ + 1154, + 1155 + ], + [ + 1156, + 1159 + ], + [ + 1160, + 1164 + ], + [ + 1167, + 1168 + ], + [ + 1170, + 1171 + ], + [ + 1173, + 1174 + ], + [ + 1175, + 1178 + ], + [ + 1179, + 1183 + ], + [ + 1186, + 1187 + ], + [ + 1189, + 1190 + ], + [ + 1192, + 1193 + ], + [ + 1194, + 1197 + ], + [ + 1198, + 1202 + ], + [ + 1205, + 1206 + ], + [ + 1208, + 1209 + ], + [ + 1210, + 1230 + ], + [ + 1234, + 1236 + ], + [ + 1238, + 1239 + ], + [ + 1240, + 1241 + ], + [ + 1244, + 1245 + ], + [ + 1246, + 1247 + ], + [ + 1250, + 1251 + ], + [ + 1252, + 1253 + ], + [ + 1256, + 1257 + ], + [ + 1260, + 1261 + ], + [ + 1264, + 1265 + ], + [ + 1268, + 1269 + ], + [ + 1272, + 1273 + ], + [ + 1276, + 1277 + ], + [ + 1280, + 1281 + ], + [ + 1289, + 1290 + ], + [ + 1292, + 1293 + ], + [ + 1294, + 1297 + ], + [ + 1298, + 1303 + ], + [ + 1304, + 1306 + ], + [ + 1307, + 1308 + ], + [ + 1311, + 1313 + ], + [ + 1316, + 1317 + ], + [ + 1338, + 1340 + ], + [ + 1351, + 1352 + ], + [ + 1354, + 1355 + ], + [ + 1366, + 1368 + ], + [ + 1376, + 1378 + ], + [ + 1384, + 1386 + ], + [ + 1393, + 1394 + ], + [ + 1396, + 1397 + ], + [ + 1405, + 1407 + ], + [ + 1408, + 1410 + ], + [ + 1413, + 1414 + ], + [ + 1416, + 1418 + ], + [ + 1429, + 1430 + ], + [ + 1432, + 1433 + ], + [ + 1441, + 1443 + ], + [ + 1444, + 1446 + ], + [ + 1449, + 1450 + ], + [ + 1452, + 1453 + ], + [ + 1461, + 1464 + ], + [ + 1466, + 1471 + ], + [ + 1474, + 1479 + ], + [ + 1486, + 1490 + ], + [ + 1491, + 1493 + ], + [ + 1498, + 1499 + ], + [ + 1500, + 1501 + ], + [ + 1510, + 1513 + ], + [ + 1522, + 1524 + ], + [ + 1525, + 1527 + ], + [ + 1528, + 1532 + ], + [ + 1533, + 1534 + ], + [ + 1536, + 1539 + ], + [ + 1540, + 1541 + ], + [ + 1544, + 1545 + ], + [ + 1546, + 1547 + ], + [ + 1548, + 1549 + ], + [ + 1551, + 1552 + ], + [ + 1553, + 1554 + ], + [ + 1559, + 1560 + ], + [ + 1562, + 1563 + ], + [ + 1564, + 1565 + ], + [ + 1571, + 1572 + ], + [ + 1574, + 1575 + ], + [ + 1578, + 1580 + ], + [ + 1581, + 1586 + ], + [ + 1587, + 1588 + ], + [ + 1589, + 1593 + ], + [ + 1594, + 1595 + ], + [ + 1596, + 1597 + ], + [ + 1598, + 1599 + ], + [ + 1600, + 1604 + ], + [ + 1605, + 1607 + ], + [ + 1619, + 1620 + ], + [ + 1622, + 1623 + ], + [ + 1628, + 1629 + ], + [ + 1631, + 1632 + ], + [ + 1635, + 1639 + ], + [ + 1640, + 1641 + ], + [ + 1642, + 1644 + ], + [ + 1646, + 1648 + ], + [ + 1649, + 1651 + ], + [ + 1652, + 1658 + ], + [ + 1659, + 1660 + ], + [ + 1662, + 1664 + ], + [ + 1665, + 1666 + ], + [ + 1669, + 1670 + ], + [ + 1672, + 1673 + ], + [ + 1677, + 1678 + ], + [ + 1679, + 1681 + ], + [ + 1685, + 1687 + ], + [ + 1688, + 1691 + ], + [ + 1692, + 1695 + ], + [ + 1696, + 1697 + ], + [ + 1701, + 1703 + ], + [ + 1706, + 1710 + ], + [ + 1713, + 1717 + ], + [ + 1720, + 1724 + ], + [ + 1725, + 1726 + ], + [ + 1728, + 1729 + ], + [ + 1733, + 1737 + ], + [ + 1738, + 1741 + ], + [ + 1742, + 1744 + ], + [ + 1748, + 1750 + ], + [ + 1751, + 1757 + ], + [ + 1758, + 1759 + ], + [ + 1764, + 1765 + ], + [ + 1766, + 1768 + ], + [ + 1772, + 1773 + ], + [ + 1782, + 1783 + ], + [ + 1785, + 1786 + ], + [ + 1787, + 1789 + ], + [ + 1790, + 1792 + ], + [ + 1800, + 1801 + ], + [ + 1802, + 1805 + ], + [ + 1807, + 1808 + ], + [ + 1811, + 1813 + ], + [ + 1814, + 1816 + ], + [ + 1818, + 1820 + ], + [ + 1821, + 1824 + ], + [ + 1825, + 1830 + ], + [ + 1831, + 1835 + ], + [ + 1836, + 1837 + ], + [ + 1850, + 1852 + ], + [ + 1853, + 1854 + ], + [ + 1855, + 1867 + ], + [ + 1868, + 1871 + ], + [ + 1874, + 1876 + ], + [ + 1877, + 1881 + ], + [ + 1882, + 1890 + ], + [ + 1893, + 1902 + ], + [ + 1904, + 1906 + ], + [ + 1908, + 1978 + ], + [ + 1981, + 1982 + ], + [ + 1983, + 1985 + ], + [ + 1992, + 1993 + ], + [ + 1994, + 1996 + ], + [ + 1997, + 1998 + ], + [ + 2000, + 2001 + ], + [ + 2006, + 2027 + ], + [ + 2028, + 2029 + ], + [ + 2031, + 2034 + ], + [ + 2035, + 2036 + ], + [ + 2037, + 2038 + ], + [ + 2042, + 2059 + ], + [ + 2061, + 2065 + ], + [ + 2067, + 2071 + ], + [ + 2072, + 2073 + ], + [ + 2079, + 2080 + ], + [ + 2081, + 2082 + ], + [ + 2083, + 2084 + ], + [ + 2086, + 2089 + ], + [ + 2091, + 2094 + ], + [ + 2096, + 2104 + ], + [ + 2105, + 2112 + ], + [ + 2113, + 2114 + ], + [ + 2115, + 2122 + ], + [ + 2123, + 2126 + ], + [ + 2127, + 2130 + ], + [ + 2132, + 2137 + ], + [ + 2138, + 2142 + ], + [ + 2150, + 2152 + ], + [ + 2153, + 2154 + ], + [ + 2160, + 2165 + ], + [ + 2167, + 2168 + ], + [ + 2172, + 2176 + ], + [ + 2177, + 2178 + ], + [ + 2183, + 2185 + ], + [ + 2186, + 2187 + ], + [ + 2197, + 2198 + ], + [ + 2201, + 2202 + ], + [ + 2210, + 2211 + ], + [ + 2223, + 2226 + ], + [ + 2227, + 2228 + ], + [ + 2240, + 2241 + ], + [ + 2248, + 2249 + ], + [ + 2255, + 2256 + ], + [ + 2257, + 2258 + ], + [ + 2260, + 2261 + ], + [ + 2262, + 2266 + ], + [ + 2267, + 2269 + ], + [ + 2280, + 2281 + ], + [ + 2286, + 2288 + ], + [ + 2301, + 2304 + ], + [ + 2306, + 2307 + ], + [ + 2309, + 2310 + ], + [ + 2312, + 2313 + ], + [ + 2319, + 2321 + ], + [ + 2325, + 2326 + ], + [ + 2327, + 2330 + ], + [ + 2332, + 2333 + ], + [ + 2334, + 2335 + ], + [ + 2338, + 2339 + ], + [ + 2340, + 2341 + ], + [ + 2342, + 2344 + ], + [ + 2345, + 2346 + ], + [ + 2351, + 2352 + ], + [ + 2353, + 2354 + ], + [ + 2356, + 2358 + ], + [ + 2359, + 2363 + ], + [ + 2364, + 2365 + ], + [ + 2368, + 2369 + ], + [ + 2371, + 2372 + ], + [ + 2378, + 2379 + ], + [ + 2382, + 2384 + ], + [ + 2388, + 2389 + ], + [ + 2393, + 2397 + ], + [ + 2401, + 2402 + ], + [ + 2403, + 2405 + ], + [ + 2409, + 2412 + ], + [ + 2413, + 2417 + ], + [ + 2421, + 2429 + ], + [ + 2433, + 2436 + ], + [ + 2440, + 2444 + ], + [ + 2447, + 2449 + ], + [ + 2450, + 2451 + ], + [ + 2453, + 2454 + ], + [ + 2459, + 2461 + ], + [ + 2467, + 2469 + ], + [ + 2470, + 2471 + ], + [ + 2474, + 2476 + ], + [ + 2477, + 2478 + ], + [ + 2481, + 2482 + ], + [ + 2485, + 2489 + ], + [ + 2492, + 2494 + ], + [ + 2501, + 2504 + ], + [ + 2506, + 2507 + ], + [ + 2510, + 2512 + ], + [ + 2518, + 2519 + ], + [ + 2523, + 2526 + ], + [ + 2531, + 2534 + ], + [ + 2542, + 2548 + ], + [ + 2550, + 2551 + ], + [ + 2553, + 2554 + ], + [ + 2567, + 2568 + ], + [ + 2585, + 2586 + ], + [ + 2588, + 2590 + ], + [ + 2593, + 2594 + ], + [ + 2595, + 2596 + ], + [ + 2597, + 2598 + ], + [ + 2603, + 2604 + ], + [ + 2605, + 2612 + ], + [ + 2621, + 2627 + ], + [ + 2631, + 2632 + ], + [ + 2633, + 2637 + ], + [ + 2639, + 2640 + ], + [ + 2647, + 2648 + ], + [ + 2649, + 2650 + ], + [ + 2655, + 2656 + ], + [ + 2659, + 2660 + ], + [ + 2661, + 2663 + ], + [ + 2668, + 2669 + ], + [ + 2672, + 2674 + ], + [ + 2678, + 2679 + ], + [ + 2683, + 2686 + ], + [ + 2687, + 2688 + ], + [ + 2689, + 2693 + ], + [ + 2700, + 2701 + ], + [ + 2702, + 2706 + ], + [ + 2715, + 2716 + ], + [ + 2717, + 2719 + ], + [ + 2722, + 2723 + ], + [ + 2725, + 2727 + ], + [ + 2736, + 2739 + ], + [ + 2740, + 2745 + ], + [ + 2746, + 2749 + ], + [ + 2753, + 2757 + ], + [ + 2760, + 2762 + ], + [ + 2763, + 2764 + ], + [ + 2769, + 2770 + ], + [ + 2778, + 2794 + ], + [ + 2797, + 2799 + ], + [ + 2800, + 2803 + ], + [ + 2810, + 2811 + ], + [ + 2816, + 2818 + ], + [ + 2824, + 2842 + ], + [ + 2847, + 2848 + ], + [ + 2852, + 2853 + ], + [ + 2855, + 2859 + ], + [ + 2861, + 2868 + ], + [ + 2870, + 2872 + ], + [ + 2873, + 2876 + ], + [ + 2877, + 2881 + ], + [ + 2885, + 2887 + ], + [ + 2889, + 2891 + ], + [ + 2893, + 2898 + ], + [ + 2901, + 2902 + ], + [ + 2904, + 2918 + ], + [ + 2920, + 2926 + ], + [ + 2928, + 2932 + ], + [ + 2936, + 2937 + ], + [ + 2939, + 2943 + ], + [ + 2945, + 2947 + ], + [ + 2949, + 2953 + ], + [ + 2958, + 2959 + ], + [ + 2961, + 2965 + ], + [ + 2969, + 2972 + ], + [ + 2976, + 2982 + ], + [ + 2984, + 2992 + ], + [ + 3010, + 3011 + ], + [ + 3012, + 3014 + ], + [ + 3021, + 3024 + ], + [ + 3027, + 3029 + ], + [ + 3033, + 3039 + ], + [ + 3049, + 3051 + ], + [ + 3053, + 3056 + ], + [ + 3060, + 3065 + ], + [ + 3071, + 3072 + ], + [ + 3075, + 3076 + ], + [ + 3077, + 3078 + ], + [ + 3081, + 3082 + ], + [ + 3087, + 3089 + ], + [ + 3090, + 3094 + ], + [ + 3096, + 3097 + ], + [ + 3098, + 3100 + ], + [ + 3102, + 3103 + ], + [ + 3106, + 3107 + ], + [ + 3109, + 3112 + ], + [ + 3114, + 3115 + ], + [ + 3116, + 3120 + ], + [ + 3121, + 3122 + ], + [ + 3123, + 3126 + ], + [ + 3127, + 3128 + ], + [ + 3129, + 3130 + ], + [ + 3131, + 3132 + ], + [ + 3134, + 3135 + ], + [ + 3138, + 3141 + ], + [ + 3143, + 3146 + ], + [ + 3147, + 3152 + ], + [ + 3160, + 3161 + ], + [ + 3163, + 3164 + ], + [ + 3166, + 3167 + ], + [ + 3173, + 3174 + ], + [ + 3175, + 3176 + ], + [ + 3178, + 3179 + ], + [ + 3180, + 3181 + ], + [ + 3182, + 3183 + ], + [ + 3186, + 3187 + ], + [ + 3188, + 3189 + ], + [ + 3192, + 3193 + ], + [ + 3194, + 3195 + ], + [ + 3198, + 3200 + ], + [ + 3205, + 3209 + ], + [ + 3210, + 3212 + ], + [ + 3213, + 3217 + ], + [ + 3222, + 3223 + ], + [ + 3224, + 3225 + ], + [ + 3228, + 3230 + ], + [ + 3234, + 3235 + ], + [ + 3239, + 3243 + ], + [ + 3244, + 3247 + ], + [ + 3249, + 3251 + ], + [ + 3256, + 3257 + ], + [ + 3258, + 3259 + ] + ] + } + }, + { + "filename": "libvips/foreign/tiffload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 61, + 72 + ], + [ + 81, + 166 + ], + [ + 176, + 229 + ], + [ + 236, + 299 + ], + [ + 301, + 353 + ], + [ + 355, + 378 + ], + [ + 386, + 433 + ], + [ + 434, + 455 + ], + [ + 464, + 496 + ], + [ + 503, + 510 + ], + [ + 511, + 527 + ], + [ + 534, + 556 + ], + [ + 557, + 572 + ], + [ + 578, + 603 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 64, + 65 + ], + [ + 68, + 69 + ], + [ + 84, + 86 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 103, + 104 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 117, + 121 + ], + [ + 122, + 123 + ], + [ + 126, + 127 + ], + [ + 130, + 131 + ], + [ + 134, + 135 + ], + [ + 138, + 142 + ], + [ + 143, + 144 + ], + [ + 147, + 148 + ], + [ + 151, + 155 + ], + [ + 156, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 179, + 180 + ], + [ + 185, + 186 + ], + [ + 191, + 194 + ], + [ + 195, + 197 + ], + [ + 198, + 201 + ], + [ + 202, + 204 + ], + [ + 205, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 215 + ], + [ + 216, + 218 + ], + [ + 221, + 222 + ], + [ + 223, + 226 + ], + [ + 239, + 241 + ], + [ + 243, + 244 + ], + [ + 246, + 247 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 269 + ], + [ + 270, + 271 + ], + [ + 272, + 273 + ], + [ + 279, + 280 + ], + [ + 286, + 292 + ], + [ + 295, + 296 + ], + [ + 304, + 305 + ], + [ + 310, + 312 + ], + [ + 314, + 315 + ], + [ + 319, + 323 + ], + [ + 324, + 326 + ], + [ + 327, + 328 + ], + [ + 331, + 332 + ], + [ + 336, + 340 + ], + [ + 341, + 342 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 358, + 359 + ], + [ + 365, + 371 + ], + [ + 374, + 375 + ], + [ + 389, + 391 + ], + [ + 393, + 394 + ], + [ + 396, + 397 + ], + [ + 399, + 404 + ], + [ + 405, + 407 + ], + [ + 408, + 409 + ], + [ + 412, + 413 + ], + [ + 417, + 421 + ], + [ + 422, + 423 + ], + [ + 426, + 428 + ], + [ + 429, + 430 + ], + [ + 437, + 438 + ], + [ + 442, + 448 + ], + [ + 451, + 452 + ], + [ + 467, + 468 + ], + [ + 471, + 473 + ], + [ + 476, + 477 + ], + [ + 480, + 482 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 487, + 489 + ], + [ + 492, + 493 + ], + [ + 506, + 507 + ], + [ + 514, + 515 + ], + [ + 519, + 522 + ], + [ + 523, + 524 + ], + [ + 537, + 538 + ], + [ + 542, + 543 + ], + [ + 544, + 546 + ], + [ + 552, + 553 + ], + [ + 560, + 561 + ], + [ + 562, + 565 + ], + [ + 566, + 567 + ], + [ + 568, + 569 + ], + [ + 581, + 582 + ], + [ + 585, + 586 + ], + [ + 592, + 593 + ], + [ + 597, + 600 + ], + [ + 601, + 602 + ] + ] + } + }, + { + "filename": "libvips/foreign/tiffsave.c", + "line_filter": { + "diff_chunks": [ + [ + 34, + 62 + ], + [ + 94, + 101 + ], + [ + 119, + 136 + ], + [ + 142, + 151 + ], + [ + 155, + 185 + ], + [ + 188, + 245 + ], + [ + 248, + 255 + ], + [ + 256, + 428 + ], + [ + 434, + 441 + ], + [ + 446, + 547 + ], + [ + 552, + 607 + ], + [ + 608, + 616 + ], + [ + 640, + 657 + ], + [ + 660, + 674 + ], + [ + 696, + 711 + ], + [ + 715, + 728 + ], + [ + 733, + 754 + ], + [ + 776, + 783 + ], + [ + 787, + 818 + ], + [ + 851, + 865 + ] + ], + "lines_added": [ + [ + 37, + 53 + ], + [ + 58, + 59 + ], + [ + 97, + 98 + ], + [ + 122, + 124 + ], + [ + 126, + 127 + ], + [ + 130, + 131 + ], + [ + 132, + 133 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 158, + 160 + ], + [ + 164, + 168 + ], + [ + 169, + 171 + ], + [ + 173, + 175 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 191, + 197 + ], + [ + 199, + 200 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 211, + 236 + ], + [ + 239, + 240 + ], + [ + 241, + 242 + ], + [ + 251, + 252 + ], + [ + 259, + 262 + ], + [ + 263, + 266 + ], + [ + 267, + 270 + ], + [ + 271, + 273 + ], + [ + 274, + 277 + ], + [ + 278, + 281 + ], + [ + 282, + 285 + ], + [ + 286, + 288 + ], + [ + 289, + 292 + ], + [ + 293, + 295 + ], + [ + 296, + 299 + ], + [ + 300, + 302 + ], + [ + 303, + 306 + ], + [ + 307, + 309 + ], + [ + 310, + 313 + ], + [ + 314, + 316 + ], + [ + 317, + 320 + ], + [ + 321, + 323 + ], + [ + 324, + 327 + ], + [ + 328, + 330 + ], + [ + 331, + 334 + ], + [ + 335, + 337 + ], + [ + 338, + 341 + ], + [ + 342, + 344 + ], + [ + 345, + 348 + ], + [ + 349, + 351 + ], + [ + 352, + 355 + ], + [ + 356, + 358 + ], + [ + 359, + 362 + ], + [ + 363, + 365 + ], + [ + 366, + 369 + ], + [ + 370, + 372 + ], + [ + 373, + 376 + ], + [ + 377, + 379 + ], + [ + 380, + 383 + ], + [ + 384, + 386 + ], + [ + 387, + 390 + ], + [ + 391, + 393 + ], + [ + 394, + 397 + ], + [ + 398, + 400 + ], + [ + 401, + 404 + ], + [ + 405, + 411 + ], + [ + 412, + 414 + ], + [ + 415, + 421 + ], + [ + 424, + 425 + ], + [ + 437, + 438 + ], + [ + 449, + 451 + ], + [ + 453, + 454 + ], + [ + 456, + 457 + ], + [ + 460, + 461 + ], + [ + 462, + 464 + ], + [ + 465, + 466 + ], + [ + 469, + 471 + ], + [ + 472, + 473 + ], + [ + 479, + 480 + ], + [ + 482, + 488 + ], + [ + 491, + 492 + ], + [ + 498, + 499 + ], + [ + 503, + 505 + ], + [ + 507, + 508 + ], + [ + 512, + 514 + ], + [ + 515, + 517 + ], + [ + 518, + 519 + ], + [ + 522, + 523 + ], + [ + 524, + 525 + ], + [ + 531, + 532 + ], + [ + 534, + 540 + ], + [ + 543, + 544 + ], + [ + 555, + 557 + ], + [ + 559, + 560 + ], + [ + 562, + 563 + ], + [ + 567, + 569 + ], + [ + 570, + 572 + ], + [ + 573, + 576 + ], + [ + 577, + 578 + ], + [ + 581, + 583 + ], + [ + 584, + 585 + ], + [ + 591, + 592 + ], + [ + 594, + 600 + ], + [ + 603, + 604 + ], + [ + 611, + 613 + ], + [ + 643, + 644 + ], + [ + 646, + 647 + ], + [ + 648, + 651 + ], + [ + 653, + 654 + ], + [ + 663, + 665 + ], + [ + 667, + 669 + ], + [ + 670, + 671 + ], + [ + 699, + 704 + ], + [ + 707, + 708 + ], + [ + 718, + 719 + ], + [ + 720, + 721 + ], + [ + 724, + 725 + ], + [ + 736, + 737 + ], + [ + 741, + 744 + ], + [ + 745, + 746 + ], + [ + 750, + 751 + ], + [ + 779, + 780 + ], + [ + 790, + 791 + ], + [ + 796, + 797 + ], + [ + 798, + 801 + ], + [ + 802, + 805 + ], + [ + 808, + 809 + ], + [ + 811, + 812 + ], + [ + 814, + 815 + ], + [ + 854, + 855 + ], + [ + 859, + 862 + ], + [ + 863, + 864 + ] + ] + } + }, + { + "filename": "libvips/foreign/vips2jpeg.c", + "line_filter": { + "diff_chunks": [ + [ + 45, + 58 + ], + [ + 70, + 77 + ], + [ + 98, + 132 + ], + [ + 154, + 205 + ], + [ + 206, + 239 + ], + [ + 242, + 347 + ], + [ + 355, + 423 + ], + [ + 425, + 454 + ], + [ + 455, + 464 + ], + [ + 468, + 546 + ], + [ + 550, + 703 + ], + [ + 707, + 765 + ], + [ + 780, + 808 + ], + [ + 812, + 840 + ], + [ + 844, + 890 + ] + ], + "lines_added": [ + [ + 48, + 49 + ], + [ + 54, + 55 + ], + [ + 73, + 74 + ], + [ + 101, + 102 + ], + [ + 107, + 108 + ], + [ + 109, + 113 + ], + [ + 114, + 123 + ], + [ + 128, + 129 + ], + [ + 157, + 161 + ], + [ + 165, + 166 + ], + [ + 169, + 171 + ], + [ + 173, + 174 + ], + [ + 180, + 181 + ], + [ + 185, + 186 + ], + [ + 190, + 192 + ], + [ + 197, + 198 + ], + [ + 201, + 202 + ], + [ + 209, + 210 + ], + [ + 215, + 216 + ], + [ + 217, + 221 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 232 + ], + [ + 235, + 236 + ], + [ + 245, + 248 + ], + [ + 250, + 251 + ], + [ + 254, + 255 + ], + [ + 259, + 263 + ], + [ + 268, + 269 + ], + [ + 273, + 277 + ], + [ + 279, + 281 + ], + [ + 283, + 286 + ], + [ + 288, + 289 + ], + [ + 294, + 295 + ], + [ + 300, + 305 + ], + [ + 306, + 310 + ], + [ + 314, + 315 + ], + [ + 317, + 320 + ], + [ + 325, + 331 + ], + [ + 332, + 333 + ], + [ + 334, + 335 + ], + [ + 338, + 339 + ], + [ + 340, + 342 + ], + [ + 343, + 344 + ], + [ + 358, + 361 + ], + [ + 362, + 412 + ], + [ + 418, + 420 + ], + [ + 428, + 432 + ], + [ + 433, + 434 + ], + [ + 437, + 438 + ], + [ + 439, + 441 + ], + [ + 444, + 446 + ], + [ + 449, + 451 + ], + [ + 458, + 461 + ], + [ + 471, + 472 + ], + [ + 475, + 477 + ], + [ + 478, + 479 + ], + [ + 480, + 481 + ], + [ + 482, + 483 + ], + [ + 485, + 488 + ], + [ + 490, + 491 + ], + [ + 493, + 494 + ], + [ + 497, + 498 + ], + [ + 502, + 506 + ], + [ + 508, + 510 + ], + [ + 512, + 513 + ], + [ + 516, + 517 + ], + [ + 521, + 524 + ], + [ + 527, + 529 + ], + [ + 530, + 531 + ], + [ + 532, + 533 + ], + [ + 538, + 540 + ], + [ + 542, + 543 + ], + [ + 553, + 558 + ], + [ + 559, + 563 + ], + [ + 566, + 568 + ], + [ + 569, + 571 + ], + [ + 574, + 576 + ], + [ + 578, + 579 + ], + [ + 580, + 581 + ], + [ + 582, + 583 + ], + [ + 586, + 587 + ], + [ + 590, + 592 + ], + [ + 596, + 599 + ], + [ + 603, + 604 + ], + [ + 605, + 606 + ], + [ + 611, + 612 + ], + [ + 615, + 616 + ], + [ + 618, + 623 + ], + [ + 625, + 627 + ], + [ + 629, + 630 + ], + [ + 632, + 640 + ], + [ + 642, + 643 + ], + [ + 645, + 654 + ], + [ + 655, + 658 + ], + [ + 662, + 667 + ], + [ + 668, + 670 + ], + [ + 672, + 673 + ], + [ + 675, + 683 + ], + [ + 687, + 688 + ], + [ + 691, + 693 + ], + [ + 694, + 695 + ], + [ + 696, + 697 + ], + [ + 699, + 700 + ], + [ + 710, + 712 + ], + [ + 718, + 719 + ], + [ + 722, + 723 + ], + [ + 726, + 735 + ], + [ + 736, + 739 + ], + [ + 741, + 744 + ], + [ + 749, + 751 + ], + [ + 754, + 756 + ], + [ + 759, + 760 + ], + [ + 761, + 762 + ], + [ + 783, + 784 + ], + [ + 787, + 788 + ], + [ + 791, + 794 + ], + [ + 798, + 799 + ], + [ + 804, + 805 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 819, + 822 + ], + [ + 823, + 825 + ], + [ + 830, + 831 + ], + [ + 834, + 837 + ], + [ + 847, + 849 + ], + [ + 853, + 854 + ], + [ + 857, + 859 + ], + [ + 861, + 863 + ], + [ + 865, + 866 + ], + [ + 867, + 868 + ], + [ + 869, + 870 + ], + [ + 873, + 874 + ], + [ + 877, + 883 + ], + [ + 884, + 885 + ], + [ + 886, + 887 + ] + ] + } + }, + { + "filename": "libvips/foreign/vips2magick.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 9, + 16 + ], + [ + 20, + 48 + ], + [ + 66, + 73 + ], + [ + 93, + 127 + ], + [ + 129, + 141 + ], + [ + 143, + 173 + ], + [ + 175, + 237 + ], + [ + 239, + 290 + ], + [ + 292, + 301 + ], + [ + 316, + 435 + ], + [ + 449, + 458 + ], + [ + 462, + 469 + ], + [ + 479, + 529 + ], + [ + 535, + 591 + ], + [ + 599, + 681 + ], + [ + 684, + 714 + ], + [ + 717, + 747 + ], + [ + 750, + 780 + ], + [ + 783, + 795 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 12, + 13 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 69, + 70 + ], + [ + 96, + 98 + ], + [ + 100, + 101 + ], + [ + 105, + 106 + ], + [ + 108, + 114 + ], + [ + 115, + 116 + ], + [ + 121, + 122 + ], + [ + 123, + 124 + ], + [ + 132, + 133 + ], + [ + 134, + 138 + ], + [ + 146, + 151 + ], + [ + 152, + 153 + ], + [ + 156, + 160 + ], + [ + 165, + 166 + ], + [ + 167, + 170 + ], + [ + 178, + 180 + ], + [ + 185, + 186 + ], + [ + 188, + 190 + ], + [ + 193, + 196 + ], + [ + 202, + 206 + ], + [ + 209, + 211 + ], + [ + 217, + 218 + ], + [ + 219, + 222 + ], + [ + 226, + 227 + ], + [ + 229, + 231 + ], + [ + 233, + 234 + ], + [ + 242, + 257 + ], + [ + 261, + 264 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 282, + 283 + ], + [ + 285, + 287 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 319, + 322 + ], + [ + 324, + 325 + ], + [ + 326, + 327 + ], + [ + 330, + 331 + ], + [ + 334, + 335 + ], + [ + 338, + 340 + ], + [ + 341, + 342 + ], + [ + 345, + 346 + ], + [ + 349, + 352 + ], + [ + 354, + 361 + ], + [ + 362, + 365 + ], + [ + 367, + 368 + ], + [ + 370, + 371 + ], + [ + 375, + 381 + ], + [ + 383, + 386 + ], + [ + 387, + 393 + ], + [ + 394, + 395 + ], + [ + 398, + 404 + ], + [ + 405, + 406 + ], + [ + 408, + 409 + ], + [ + 413, + 421 + ], + [ + 424, + 425 + ], + [ + 431, + 432 + ], + [ + 452, + 453 + ], + [ + 454, + 455 + ], + [ + 465, + 466 + ], + [ + 482, + 485 + ], + [ + 486, + 488 + ], + [ + 489, + 492 + ], + [ + 493, + 495 + ], + [ + 496, + 499 + ], + [ + 500, + 502 + ], + [ + 503, + 506 + ], + [ + 507, + 514 + ], + [ + 515, + 516 + ], + [ + 520, + 521 + ], + [ + 525, + 526 + ], + [ + 538, + 540 + ], + [ + 542, + 543 + ], + [ + 544, + 545 + ], + [ + 548, + 549 + ], + [ + 550, + 552 + ], + [ + 553, + 557 + ], + [ + 558, + 559 + ], + [ + 561, + 562 + ], + [ + 566, + 567 + ], + [ + 568, + 569 + ], + [ + 575, + 576 + ], + [ + 578, + 581 + ], + [ + 582, + 584 + ], + [ + 587, + 588 + ], + [ + 602, + 604 + ], + [ + 606, + 607 + ], + [ + 608, + 609 + ], + [ + 610, + 611 + ], + [ + 617, + 619 + ], + [ + 620, + 624 + ], + [ + 625, + 626 + ], + [ + 628, + 631 + ], + [ + 632, + 633 + ], + [ + 636, + 638 + ], + [ + 639, + 640 + ], + [ + 646, + 647 + ], + [ + 649, + 652 + ], + [ + 653, + 655 + ], + [ + 658, + 659 + ], + [ + 665, + 667 + ], + [ + 669, + 671 + ], + [ + 677, + 678 + ], + [ + 687, + 688 + ], + [ + 691, + 692 + ], + [ + 697, + 700 + ], + [ + 703, + 704 + ], + [ + 710, + 711 + ], + [ + 720, + 722 + ], + [ + 725, + 726 + ], + [ + 731, + 733 + ], + [ + 735, + 737 + ], + [ + 743, + 744 + ], + [ + 753, + 754 + ], + [ + 757, + 758 + ], + [ + 763, + 766 + ], + [ + 769, + 770 + ], + [ + 776, + 777 + ], + [ + 786, + 788 + ], + [ + 791, + 792 + ] + ] + } + }, + { + "filename": "libvips/foreign/vips2tiff.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 14 + ], + [ + 69, + 76 + ], + [ + 80, + 91 + ], + [ + 95, + 102 + ], + [ + 169, + 177 + ], + [ + 208, + 240 + ], + [ + 293, + 311 + ], + [ + 312, + 333 + ], + [ + 336, + 368 + ], + [ + 378, + 385 + ], + [ + 386, + 448 + ], + [ + 458, + 471 + ], + [ + 472, + 482 + ], + [ + 500, + 719 + ], + [ + 724, + 1012 + ], + [ + 1013, + 1083 + ], + [ + 1089, + 1112 + ], + [ + 1114, + 1121 + ], + [ + 1136, + 1166 + ], + [ + 1168, + 1198 + ], + [ + 1201, + 1292 + ], + [ + 1300, + 1307 + ], + [ + 1309, + 1329 + ], + [ + 1332, + 1401 + ], + [ + 1405, + 1426 + ], + [ + 1430, + 1451 + ], + [ + 1455, + 1463 + ], + [ + 1467, + 1497 + ], + [ + 1499, + 1506 + ], + [ + 1512, + 1536 + ], + [ + 1538, + 1545 + ], + [ + 1555, + 1569 + ], + [ + 1571, + 1673 + ], + [ + 1678, + 1694 + ], + [ + 1696, + 1703 + ], + [ + 1707, + 1718 + ], + [ + 1720, + 1738 + ], + [ + 1739, + 1746 + ], + [ + 1748, + 1769 + ], + [ + 1774, + 1830 + ], + [ + 1834, + 1841 + ], + [ + 1844, + 1866 + ], + [ + 1867, + 1950 + ], + [ + 1953, + 2201 + ], + [ + 2213, + 2251 + ], + [ + 2254, + 2289 + ] + ], + "lines_added": [ + [ + 10, + 11 + ], + [ + 72, + 73 + ], + [ + 83, + 84 + ], + [ + 87, + 88 + ], + [ + 98, + 99 + ], + [ + 172, + 174 + ], + [ + 211, + 212 + ], + [ + 213, + 217 + ], + [ + 218, + 227 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 296, + 297 + ], + [ + 302, + 305 + ], + [ + 307, + 308 + ], + [ + 315, + 316 + ], + [ + 319, + 321 + ], + [ + 322, + 324 + ], + [ + 329, + 330 + ], + [ + 339, + 359 + ], + [ + 360, + 365 + ], + [ + 381, + 382 + ], + [ + 389, + 390 + ], + [ + 393, + 395 + ], + [ + 396, + 397 + ], + [ + 398, + 399 + ], + [ + 400, + 401 + ], + [ + 403, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 410 + ], + [ + 415, + 416 + ], + [ + 420, + 423 + ], + [ + 425, + 426 + ], + [ + 428, + 429 + ], + [ + 432, + 434 + ], + [ + 435, + 437 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 444, + 445 + ], + [ + 461, + 462 + ], + [ + 463, + 464 + ], + [ + 465, + 468 + ], + [ + 475, + 476 + ], + [ + 478, + 479 + ], + [ + 503, + 509 + ], + [ + 513, + 514 + ], + [ + 515, + 518 + ], + [ + 519, + 523 + ], + [ + 524, + 525 + ], + [ + 528, + 529 + ], + [ + 533, + 539 + ], + [ + 541, + 542 + ], + [ + 544, + 545 + ], + [ + 548, + 549 + ], + [ + 553, + 558 + ], + [ + 562, + 564 + ], + [ + 570, + 571 + ], + [ + 573, + 574 + ], + [ + 576, + 577 + ], + [ + 580, + 581 + ], + [ + 585, + 591 + ], + [ + 593, + 594 + ], + [ + 596, + 597 + ], + [ + 603, + 604 + ], + [ + 605, + 606 + ], + [ + 608, + 612 + ], + [ + 616, + 623 + ], + [ + 626, + 627 + ], + [ + 629, + 630 + ], + [ + 632, + 633 + ], + [ + 635, + 636 + ], + [ + 640, + 641 + ], + [ + 643, + 645 + ], + [ + 649, + 654 + ], + [ + 655, + 657 + ], + [ + 659, + 662 + ], + [ + 663, + 668 + ], + [ + 671, + 675 + ], + [ + 676, + 678 + ], + [ + 684, + 702 + ], + [ + 705, + 709 + ], + [ + 710, + 716 + ], + [ + 727, + 731 + ], + [ + 732, + 733 + ], + [ + 734, + 735 + ], + [ + 737, + 738 + ], + [ + 740, + 742 + ], + [ + 745, + 746 + ], + [ + 751, + 753 + ], + [ + 754, + 758 + ], + [ + 760, + 762 + ], + [ + 763, + 764 + ], + [ + 766, + 767 + ], + [ + 769, + 770 + ], + [ + 775, + 777 + ], + [ + 781, + 782 + ], + [ + 788, + 791 + ], + [ + 796, + 797 + ], + [ + 801, + 805 + ], + [ + 807, + 808 + ], + [ + 812, + 815 + ], + [ + 817, + 818 + ], + [ + 819, + 820 + ], + [ + 822, + 824 + ], + [ + 826, + 827 + ], + [ + 828, + 830 + ], + [ + 836, + 838 + ], + [ + 840, + 841 + ], + [ + 842, + 843 + ], + [ + 844, + 845 + ], + [ + 846, + 847 + ], + [ + 848, + 849 + ], + [ + 851, + 852 + ], + [ + 855, + 856 + ], + [ + 859, + 860 + ], + [ + 861, + 863 + ], + [ + 868, + 869 + ], + [ + 870, + 872 + ], + [ + 876, + 877 + ], + [ + 880, + 881 + ], + [ + 884, + 885 + ], + [ + 886, + 888 + ], + [ + 889, + 892 + ], + [ + 895, + 897 + ], + [ + 901, + 903 + ], + [ + 904, + 908 + ], + [ + 910, + 912 + ], + [ + 913, + 915 + ], + [ + 917, + 921 + ], + [ + 922, + 926 + ], + [ + 928, + 929 + ], + [ + 934, + 935 + ], + [ + 938, + 942 + ], + [ + 947, + 948 + ], + [ + 949, + 951 + ], + [ + 952, + 953 + ], + [ + 956, + 957 + ], + [ + 962, + 964 + ], + [ + 965, + 969 + ], + [ + 972, + 973 + ], + [ + 974, + 975 + ], + [ + 976, + 977 + ], + [ + 978, + 979 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 984, + 985 + ], + [ + 986, + 987 + ], + [ + 989, + 990 + ], + [ + 991, + 992 + ], + [ + 994, + 996 + ], + [ + 997, + 998 + ], + [ + 1002, + 1003 + ], + [ + 1004, + 1005 + ], + [ + 1006, + 1007 + ], + [ + 1008, + 1009 + ], + [ + 1016, + 1017 + ], + [ + 1022, + 1023 + ], + [ + 1028, + 1029 + ], + [ + 1030, + 1033 + ], + [ + 1037, + 1039 + ], + [ + 1041, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1050, + 1053 + ], + [ + 1054, + 1055 + ], + [ + 1060, + 1061 + ], + [ + 1063, + 1067 + ], + [ + 1068, + 1069 + ], + [ + 1074, + 1075 + ], + [ + 1078, + 1080 + ], + [ + 1092, + 1093 + ], + [ + 1094, + 1095 + ], + [ + 1097, + 1098 + ], + [ + 1101, + 1103 + ], + [ + 1108, + 1109 + ], + [ + 1117, + 1118 + ], + [ + 1139, + 1142 + ], + [ + 1146, + 1147 + ], + [ + 1151, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1157, + 1163 + ], + [ + 1171, + 1172 + ], + [ + 1176, + 1177 + ], + [ + 1181, + 1183 + ], + [ + 1185, + 1186 + ], + [ + 1187, + 1195 + ], + [ + 1204, + 1206 + ], + [ + 1211, + 1218 + ], + [ + 1223, + 1229 + ], + [ + 1235, + 1236 + ], + [ + 1237, + 1242 + ], + [ + 1245, + 1249 + ], + [ + 1251, + 1252 + ], + [ + 1254, + 1261 + ], + [ + 1266, + 1267 + ], + [ + 1268, + 1274 + ], + [ + 1275, + 1276 + ], + [ + 1278, + 1279 + ], + [ + 1284, + 1285 + ], + [ + 1288, + 1289 + ], + [ + 1303, + 1304 + ], + [ + 1312, + 1313 + ], + [ + 1315, + 1316 + ], + [ + 1319, + 1320 + ], + [ + 1321, + 1322 + ], + [ + 1325, + 1326 + ], + [ + 1335, + 1336 + ], + [ + 1337, + 1357 + ], + [ + 1363, + 1364 + ], + [ + 1368, + 1369 + ], + [ + 1370, + 1371 + ], + [ + 1373, + 1374 + ], + [ + 1377, + 1378 + ], + [ + 1381, + 1382 + ], + [ + 1385, + 1386 + ], + [ + 1389, + 1390 + ], + [ + 1393, + 1394 + ], + [ + 1397, + 1398 + ], + [ + 1408, + 1409 + ], + [ + 1415, + 1416 + ], + [ + 1418, + 1421 + ], + [ + 1422, + 1423 + ], + [ + 1433, + 1434 + ], + [ + 1440, + 1441 + ], + [ + 1443, + 1446 + ], + [ + 1447, + 1448 + ], + [ + 1458, + 1460 + ], + [ + 1470, + 1490 + ], + [ + 1491, + 1494 + ], + [ + 1502, + 1503 + ], + [ + 1515, + 1516 + ], + [ + 1522, + 1523 + ], + [ + 1525, + 1526 + ], + [ + 1527, + 1528 + ], + [ + 1530, + 1533 + ], + [ + 1541, + 1542 + ], + [ + 1558, + 1559 + ], + [ + 1562, + 1563 + ], + [ + 1564, + 1566 + ], + [ + 1574, + 1577 + ], + [ + 1579, + 1580 + ], + [ + 1581, + 1582 + ], + [ + 1583, + 1585 + ], + [ + 1586, + 1592 + ], + [ + 1597, + 1605 + ], + [ + 1609, + 1610 + ], + [ + 1615, + 1616 + ], + [ + 1619, + 1620 + ], + [ + 1624, + 1626 + ], + [ + 1628, + 1630 + ], + [ + 1633, + 1635 + ], + [ + 1637, + 1640 + ], + [ + 1642, + 1644 + ], + [ + 1646, + 1648 + ], + [ + 1650, + 1653 + ], + [ + 1656, + 1658 + ], + [ + 1660, + 1661 + ], + [ + 1663, + 1664 + ], + [ + 1669, + 1670 + ], + [ + 1681, + 1682 + ], + [ + 1688, + 1689 + ], + [ + 1690, + 1691 + ], + [ + 1699, + 1700 + ], + [ + 1710, + 1711 + ], + [ + 1713, + 1715 + ], + [ + 1723, + 1727 + ], + [ + 1730, + 1731 + ], + [ + 1733, + 1735 + ], + [ + 1742, + 1743 + ], + [ + 1751, + 1753 + ], + [ + 1754, + 1757 + ], + [ + 1758, + 1761 + ], + [ + 1762, + 1763 + ], + [ + 1764, + 1766 + ], + [ + 1777, + 1778 + ], + [ + 1779, + 1780 + ], + [ + 1782, + 1783 + ], + [ + 1785, + 1791 + ], + [ + 1793, + 1796 + ], + [ + 1799, + 1802 + ], + [ + 1804, + 1805 + ], + [ + 1807, + 1808 + ], + [ + 1811, + 1812 + ], + [ + 1813, + 1814 + ], + [ + 1817, + 1820 + ], + [ + 1824, + 1825 + ], + [ + 1826, + 1827 + ], + [ + 1837, + 1838 + ], + [ + 1847, + 1848 + ], + [ + 1851, + 1852 + ], + [ + 1856, + 1857 + ], + [ + 1861, + 1863 + ], + [ + 1870, + 1874 + ], + [ + 1877, + 1878 + ], + [ + 1882, + 1885 + ], + [ + 1887, + 1888 + ], + [ + 1889, + 1890 + ], + [ + 1895, + 1899 + ], + [ + 1901, + 1902 + ], + [ + 1906, + 1907 + ], + [ + 1908, + 1909 + ], + [ + 1911, + 1914 + ], + [ + 1916, + 1917 + ], + [ + 1919, + 1925 + ], + [ + 1928, + 1933 + ], + [ + 1937, + 1938 + ], + [ + 1939, + 1940 + ], + [ + 1942, + 1943 + ], + [ + 1946, + 1947 + ], + [ + 1956, + 1978 + ], + [ + 1982, + 1984 + ], + [ + 1987, + 1990 + ], + [ + 1991, + 1996 + ], + [ + 2001, + 2003 + ], + [ + 2009, + 2012 + ], + [ + 2013, + 2018 + ], + [ + 2021, + 2025 + ], + [ + 2028, + 2040 + ], + [ + 2045, + 2046 + ], + [ + 2050, + 2051 + ], + [ + 2053, + 2057 + ], + [ + 2061, + 2062 + ], + [ + 2064, + 2067 + ], + [ + 2068, + 2071 + ], + [ + 2073, + 2074 + ], + [ + 2075, + 2078 + ], + [ + 2080, + 2081 + ], + [ + 2082, + 2084 + ], + [ + 2086, + 2087 + ], + [ + 2090, + 2091 + ], + [ + 2093, + 2094 + ], + [ + 2096, + 2097 + ], + [ + 2099, + 2101 + ], + [ + 2104, + 2106 + ], + [ + 2110, + 2111 + ], + [ + 2115, + 2116 + ], + [ + 2118, + 2119 + ], + [ + 2121, + 2135 + ], + [ + 2138, + 2139 + ], + [ + 2142, + 2143 + ], + [ + 2145, + 2146 + ], + [ + 2148, + 2150 + ], + [ + 2153, + 2154 + ], + [ + 2156, + 2158 + ], + [ + 2160, + 2161 + ], + [ + 2164, + 2166 + ], + [ + 2169, + 2171 + ], + [ + 2172, + 2173 + ], + [ + 2179, + 2180 + ], + [ + 2186, + 2187 + ], + [ + 2188, + 2189 + ], + [ + 2193, + 2195 + ], + [ + 2197, + 2198 + ], + [ + 2216, + 2217 + ], + [ + 2220, + 2223 + ], + [ + 2226, + 2228 + ], + [ + 2231, + 2234 + ], + [ + 2240, + 2241 + ], + [ + 2242, + 2243 + ], + [ + 2245, + 2248 + ], + [ + 2257, + 2258 + ], + [ + 2259, + 2260 + ], + [ + 2264, + 2265 + ], + [ + 2270, + 2281 + ], + [ + 2283, + 2284 + ], + [ + 2285, + 2286 + ] + ] + } + }, + { + "filename": "libvips/foreign/vipsload.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 56, + 158 + ], + [ + 162, + 176 + ], + [ + 182, + 219 + ], + [ + 221, + 244 + ], + [ + 250, + 319 + ], + [ + 322, + 345 + ], + [ + 347, + 366 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 59, + 61 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 73, + 74 + ], + [ + 80, + 82 + ], + [ + 84, + 85 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 96, + 97 + ], + [ + 101, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 120, + 125 + ], + [ + 127, + 129 + ], + [ + 131, + 132 + ], + [ + 133, + 136 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 154, + 155 + ], + [ + 165, + 166 + ], + [ + 172, + 173 + ], + [ + 185, + 187 + ], + [ + 189, + 190 + ], + [ + 194, + 197 + ], + [ + 198, + 200 + ], + [ + 201, + 202 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 224, + 225 + ], + [ + 231, + 237 + ], + [ + 240, + 241 + ], + [ + 253, + 255 + ], + [ + 257, + 258 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 268, + 270 + ], + [ + 271, + 272 + ], + [ + 275, + 276 + ], + [ + 277, + 278 + ], + [ + 281, + 284 + ], + [ + 287, + 288 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 298, + 299 + ], + [ + 303, + 304 + ], + [ + 306, + 312 + ], + [ + 315, + 316 + ], + [ + 325, + 326 + ], + [ + 332, + 333 + ], + [ + 337, + 340 + ], + [ + 341, + 342 + ], + [ + 350, + 351 + ], + [ + 355, + 356 + ], + [ + 360, + 363 + ], + [ + 364, + 365 + ] + ] + } + }, + { + "filename": "libvips/foreign/vipspng.c", + "line_filter": { + "diff_chunks": [ + [ + 51, + 61 + ], + [ + 84, + 119 + ], + [ + 150, + 178 + ], + [ + 203, + 263 + ], + [ + 265, + 278 + ], + [ + 283, + 397 + ], + [ + 403, + 410 + ], + [ + 415, + 465 + ], + [ + 466, + 483 + ], + [ + 485, + 514 + ], + [ + 516, + 533 + ], + [ + 534, + 550 + ], + [ + 552, + 842 + ], + [ + 843, + 857 + ], + [ + 867, + 916 + ], + [ + 917, + 946 + ], + [ + 947, + 981 + ], + [ + 983, + 1027 + ], + [ + 1028, + 1230 + ], + [ + 1231, + 1354 + ] + ], + "lines_added": [ + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 87, + 88 + ], + [ + 94, + 95 + ], + [ + 96, + 100 + ], + [ + 101, + 110 + ], + [ + 115, + 116 + ], + [ + 153, + 154 + ], + [ + 156, + 157 + ], + [ + 159, + 160 + ], + [ + 164, + 165 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 206, + 207 + ], + [ + 212, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 229 + ], + [ + 232, + 233 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 243, + 244 + ], + [ + 246, + 247 + ], + [ + 249, + 253 + ], + [ + 258, + 260 + ], + [ + 268, + 270 + ], + [ + 273, + 275 + ], + [ + 286, + 287 + ], + [ + 288, + 292 + ], + [ + 293, + 297 + ], + [ + 298, + 301 + ], + [ + 302, + 304 + ], + [ + 310, + 311 + ], + [ + 317, + 319 + ], + [ + 323, + 324 + ], + [ + 325, + 328 + ], + [ + 331, + 333 + ], + [ + 334, + 336 + ], + [ + 339, + 340 + ], + [ + 342, + 343 + ], + [ + 345, + 346 + ], + [ + 350, + 351 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 363, + 364 + ], + [ + 367, + 368 + ], + [ + 374, + 376 + ], + [ + 377, + 378 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 387, + 388 + ], + [ + 393, + 394 + ], + [ + 406, + 407 + ], + [ + 418, + 419 + ], + [ + 422, + 424 + ], + [ + 425, + 426 + ], + [ + 427, + 428 + ], + [ + 434, + 437 + ], + [ + 439, + 442 + ], + [ + 444, + 447 + ], + [ + 450, + 452 + ], + [ + 454, + 456 + ], + [ + 461, + 462 + ], + [ + 469, + 471 + ], + [ + 474, + 476 + ], + [ + 478, + 480 + ], + [ + 488, + 491 + ], + [ + 495, + 498 + ], + [ + 499, + 500 + ], + [ + 504, + 506 + ], + [ + 510, + 511 + ], + [ + 519, + 520 + ], + [ + 522, + 524 + ], + [ + 525, + 527 + ], + [ + 528, + 530 + ], + [ + 537, + 539 + ], + [ + 540, + 543 + ], + [ + 545, + 547 + ], + [ + 555, + 556 + ], + [ + 560, + 566 + ], + [ + 570, + 572 + ], + [ + 573, + 575 + ], + [ + 580, + 584 + ], + [ + 587, + 588 + ], + [ + 590, + 593 + ], + [ + 597, + 599 + ], + [ + 600, + 602 + ], + [ + 603, + 635 + ], + [ + 636, + 640 + ], + [ + 644, + 647 + ], + [ + 648, + 652 + ], + [ + 654, + 655 + ], + [ + 660, + 661 + ], + [ + 665, + 666 + ], + [ + 668, + 670 + ], + [ + 671, + 673 + ], + [ + 674, + 678 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 683, + 684 + ], + [ + 687, + 689 + ], + [ + 690, + 691 + ], + [ + 696, + 698 + ], + [ + 703, + 706 + ], + [ + 710, + 711 + ], + [ + 715, + 719 + ], + [ + 721, + 723 + ], + [ + 726, + 731 + ], + [ + 732, + 733 + ], + [ + 735, + 741 + ], + [ + 747, + 751 + ], + [ + 757, + 758 + ], + [ + 761, + 762 + ], + [ + 763, + 766 + ], + [ + 767, + 769 + ], + [ + 772, + 776 + ], + [ + 779, + 788 + ], + [ + 790, + 791 + ], + [ + 794, + 795 + ], + [ + 798, + 801 + ], + [ + 802, + 803 + ], + [ + 806, + 808 + ], + [ + 811, + 814 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 821, + 823 + ], + [ + 826, + 830 + ], + [ + 831, + 832 + ], + [ + 838, + 839 + ], + [ + 846, + 849 + ], + [ + 850, + 852 + ], + [ + 853, + 854 + ], + [ + 870, + 871 + ], + [ + 873, + 874 + ], + [ + 876, + 881 + ], + [ + 884, + 885 + ], + [ + 886, + 887 + ], + [ + 888, + 890 + ], + [ + 893, + 894 + ], + [ + 897, + 899 + ], + [ + 903, + 904 + ], + [ + 906, + 913 + ], + [ + 920, + 922 + ], + [ + 924, + 925 + ], + [ + 928, + 931 + ], + [ + 933, + 936 + ], + [ + 938, + 939 + ], + [ + 942, + 943 + ], + [ + 950, + 953 + ], + [ + 954, + 955 + ], + [ + 956, + 958 + ], + [ + 959, + 960 + ], + [ + 961, + 962 + ], + [ + 963, + 964 + ], + [ + 965, + 966 + ], + [ + 969, + 971 + ], + [ + 977, + 978 + ], + [ + 986, + 987 + ], + [ + 990, + 992 + ], + [ + 995, + 996 + ], + [ + 1000, + 1002 + ], + [ + 1003, + 1008 + ], + [ + 1010, + 1011 + ], + [ + 1013, + 1014 + ], + [ + 1019, + 1020 + ], + [ + 1023, + 1024 + ], + [ + 1031, + 1035 + ], + [ + 1038, + 1040 + ], + [ + 1043, + 1044 + ], + [ + 1045, + 1048 + ], + [ + 1051, + 1053 + ], + [ + 1054, + 1059 + ], + [ + 1063, + 1064 + ], + [ + 1067, + 1068 + ], + [ + 1069, + 1082 + ], + [ + 1084, + 1087 + ], + [ + 1092, + 1093 + ], + [ + 1095, + 1098 + ], + [ + 1104, + 1105 + ], + [ + 1106, + 1109 + ], + [ + 1112, + 1115 + ], + [ + 1118, + 1120 + ], + [ + 1122, + 1125 + ], + [ + 1126, + 1127 + ], + [ + 1129, + 1132 + ], + [ + 1134, + 1137 + ], + [ + 1138, + 1139 + ], + [ + 1141, + 1142 + ], + [ + 1145, + 1148 + ], + [ + 1150, + 1153 + ], + [ + 1159, + 1160 + ], + [ + 1162, + 1163 + ], + [ + 1168, + 1171 + ], + [ + 1175, + 1177 + ], + [ + 1179, + 1180 + ], + [ + 1184, + 1185 + ], + [ + 1187, + 1196 + ], + [ + 1199, + 1200 + ], + [ + 1203, + 1207 + ], + [ + 1210, + 1212 + ], + [ + 1216, + 1218 + ], + [ + 1221, + 1223 + ], + [ + 1226, + 1227 + ], + [ + 1234, + 1237 + ], + [ + 1240, + 1241 + ], + [ + 1242, + 1246 + ], + [ + 1247, + 1250 + ], + [ + 1256, + 1257 + ], + [ + 1259, + 1261 + ], + [ + 1265, + 1267 + ], + [ + 1268, + 1271 + ], + [ + 1272, + 1274 + ], + [ + 1275, + 1277 + ], + [ + 1279, + 1281 + ], + [ + 1282, + 1283 + ], + [ + 1284, + 1285 + ], + [ + 1290, + 1291 + ], + [ + 1295, + 1298 + ], + [ + 1301, + 1302 + ], + [ + 1303, + 1305 + ], + [ + 1310, + 1313 + ], + [ + 1316, + 1318 + ], + [ + 1319, + 1320 + ], + [ + 1321, + 1322 + ], + [ + 1325, + 1326 + ], + [ + 1329, + 1330 + ], + [ + 1333, + 1335 + ], + [ + 1336, + 1343 + ], + [ + 1345, + 1346 + ], + [ + 1347, + 1349 + ], + [ + 1350, + 1351 + ] + ] + } + }, + { + "filename": "libvips/foreign/vipssave.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 57, + 88 + ], + [ + 90, + 106 + ], + [ + 107, + 122 + ], + [ + 123, + 134 + ], + [ + 135, + 153 + ], + [ + 158, + 205 + ], + [ + 211, + 267 + ], + [ + 270, + 291 + ], + [ + 293, + 307 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 60, + 62 + ], + [ + 64, + 65 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 80, + 82 + ], + [ + 83, + 85 + ], + [ + 93, + 98 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 110, + 113 + ], + [ + 115, + 117 + ], + [ + 118, + 119 + ], + [ + 126, + 127 + ], + [ + 130, + 131 + ], + [ + 138, + 139 + ], + [ + 144, + 145 + ], + [ + 149, + 150 + ], + [ + 161, + 163 + ], + [ + 165, + 166 + ], + [ + 170, + 172 + ], + [ + 173, + 175 + ], + [ + 176, + 177 + ], + [ + 180, + 181 + ], + [ + 182, + 183 + ], + [ + 189, + 190 + ], + [ + 192, + 198 + ], + [ + 201, + 202 + ], + [ + 214, + 216 + ], + [ + 218, + 219 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 229 + ], + [ + 230, + 231 + ], + [ + 234, + 236 + ], + [ + 237, + 238 + ], + [ + 244, + 245 + ], + [ + 247, + 253 + ], + [ + 256, + 257 + ], + [ + 262, + 264 + ], + [ + 273, + 274 + ], + [ + 278, + 281 + ], + [ + 282, + 283 + ], + [ + 287, + 288 + ], + [ + 296, + 297 + ], + [ + 301, + 304 + ], + [ + 305, + 306 + ] + ] + } + }, + { + "filename": "libvips/foreign/webp2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 23, + 30 + ], + [ + 32, + 60 + ], + [ + 112, + 119 + ], + [ + 160, + 208 + ], + [ + 211, + 232 + ], + [ + 233, + 252 + ], + [ + 253, + 366 + ], + [ + 372, + 390 + ], + [ + 393, + 413 + ], + [ + 415, + 472 + ], + [ + 473, + 531 + ], + [ + 537, + 566 + ], + [ + 567, + 679 + ], + [ + 681, + 738 + ], + [ + 740, + 762 + ], + [ + 764, + 773 + ], + [ + 776, + 828 + ] + ], + "lines_added": [ + [ + 26, + 27 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 115, + 116 + ], + [ + 163, + 164 + ], + [ + 165, + 168 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 185, + 186 + ], + [ + 188, + 189 + ], + [ + 191, + 192 + ], + [ + 196, + 197 + ], + [ + 201, + 205 + ], + [ + 214, + 215 + ], + [ + 217, + 218 + ], + [ + 220, + 221 + ], + [ + 227, + 229 + ], + [ + 236, + 237 + ], + [ + 241, + 245 + ], + [ + 248, + 249 + ], + [ + 256, + 257 + ], + [ + 258, + 259 + ], + [ + 260, + 262 + ], + [ + 263, + 264 + ], + [ + 266, + 267 + ], + [ + 269, + 272 + ], + [ + 273, + 274 + ], + [ + 279, + 281 + ], + [ + 284, + 285 + ], + [ + 288, + 289 + ], + [ + 290, + 292 + ], + [ + 295, + 297 + ], + [ + 298, + 300 + ], + [ + 303, + 305 + ], + [ + 307, + 309 + ], + [ + 310, + 312 + ], + [ + 317, + 318 + ], + [ + 323, + 327 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 334, + 338 + ], + [ + 339, + 342 + ], + [ + 343, + 344 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 353, + 354 + ], + [ + 357, + 359 + ], + [ + 362, + 363 + ], + [ + 375, + 377 + ], + [ + 378, + 379 + ], + [ + 382, + 385 + ], + [ + 386, + 387 + ], + [ + 396, + 397 + ], + [ + 399, + 400 + ], + [ + 404, + 407 + ], + [ + 409, + 410 + ], + [ + 418, + 422 + ], + [ + 423, + 424 + ], + [ + 427, + 430 + ], + [ + 432, + 435 + ], + [ + 437, + 438 + ], + [ + 444, + 446 + ], + [ + 447, + 448 + ], + [ + 450, + 453 + ], + [ + 456, + 458 + ], + [ + 459, + 460 + ], + [ + 463, + 464 + ], + [ + 466, + 467 + ], + [ + 468, + 469 + ], + [ + 476, + 478 + ], + [ + 479, + 480 + ], + [ + 481, + 483 + ], + [ + 486, + 488 + ], + [ + 490, + 491 + ], + [ + 492, + 493 + ], + [ + 495, + 496 + ], + [ + 497, + 501 + ], + [ + 506, + 507 + ], + [ + 511, + 513 + ], + [ + 515, + 519 + ], + [ + 521, + 522 + ], + [ + 525, + 528 + ], + [ + 540, + 541 + ], + [ + 547, + 550 + ], + [ + 552, + 553 + ], + [ + 556, + 557 + ], + [ + 559, + 563 + ], + [ + 570, + 572 + ], + [ + 574, + 579 + ], + [ + 580, + 581 + ], + [ + 585, + 595 + ], + [ + 597, + 598 + ], + [ + 604, + 606 + ], + [ + 610, + 611 + ], + [ + 614, + 615 + ], + [ + 618, + 623 + ], + [ + 625, + 629 + ], + [ + 631, + 632 + ], + [ + 634, + 638 + ], + [ + 640, + 641 + ], + [ + 644, + 645 + ], + [ + 650, + 651 + ], + [ + 657, + 661 + ], + [ + 664, + 667 + ], + [ + 668, + 669 + ], + [ + 674, + 676 + ], + [ + 684, + 693 + ], + [ + 694, + 699 + ], + [ + 700, + 701 + ], + [ + 703, + 707 + ], + [ + 710, + 712 + ], + [ + 713, + 714 + ], + [ + 715, + 716 + ], + [ + 717, + 718 + ], + [ + 719, + 724 + ], + [ + 727, + 728 + ], + [ + 731, + 733 + ], + [ + 734, + 735 + ], + [ + 743, + 744 + ], + [ + 746, + 747 + ], + [ + 748, + 751 + ], + [ + 755, + 759 + ], + [ + 767, + 770 + ], + [ + 779, + 780 + ], + [ + 783, + 784 + ], + [ + 785, + 787 + ], + [ + 789, + 791 + ], + [ + 792, + 797 + ], + [ + 798, + 799 + ], + [ + 802, + 804 + ], + [ + 807, + 810 + ], + [ + 811, + 812 + ], + [ + 815, + 817 + ], + [ + 820, + 823 + ], + [ + 824, + 825 + ] + ] + } + }, + { + "filename": "libvips/foreign/webpload.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 72, + 79 + ], + [ + 81, + 158 + ], + [ + 161, + 211 + ], + [ + 220, + 277 + ], + [ + 279, + 331 + ], + [ + 333, + 356 + ], + [ + 364, + 411 + ], + [ + 412, + 433 + ], + [ + 444, + 480 + ], + [ + 490, + 507 + ], + [ + 508, + 523 + ], + [ + 531, + 552 + ] + ], + "lines_added": [ + [ + 15, + 31 + ], + [ + 36, + 37 + ], + [ + 75, + 76 + ], + [ + 84, + 86 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 104, + 107 + ], + [ + 109, + 111 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 132, + 135 + ], + [ + 136, + 137 + ], + [ + 140, + 141 + ], + [ + 144, + 147 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ], + [ + 164, + 165 + ], + [ + 171, + 172 + ], + [ + 177, + 180 + ], + [ + 181, + 183 + ], + [ + 184, + 187 + ], + [ + 188, + 190 + ], + [ + 191, + 194 + ], + [ + 195, + 197 + ], + [ + 198, + 201 + ], + [ + 202, + 204 + ], + [ + 207, + 208 + ], + [ + 223, + 225 + ], + [ + 227, + 228 + ], + [ + 230, + 231 + ], + [ + 233, + 234 + ], + [ + 235, + 236 + ], + [ + 238, + 240 + ], + [ + 241, + 242 + ], + [ + 245, + 247 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 257, + 258 + ], + [ + 262, + 263 + ], + [ + 264, + 270 + ], + [ + 273, + 274 + ], + [ + 282, + 283 + ], + [ + 288, + 290 + ], + [ + 292, + 293 + ], + [ + 297, + 301 + ], + [ + 302, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 310 + ], + [ + 314, + 318 + ], + [ + 319, + 320 + ], + [ + 325, + 326 + ], + [ + 327, + 328 + ], + [ + 336, + 337 + ], + [ + 343, + 349 + ], + [ + 352, + 353 + ], + [ + 367, + 369 + ], + [ + 371, + 372 + ], + [ + 374, + 375 + ], + [ + 377, + 382 + ], + [ + 383, + 385 + ], + [ + 386, + 387 + ], + [ + 390, + 391 + ], + [ + 395, + 399 + ], + [ + 400, + 401 + ], + [ + 404, + 406 + ], + [ + 407, + 408 + ], + [ + 415, + 416 + ], + [ + 418, + 419 + ], + [ + 420, + 426 + ], + [ + 429, + 430 + ], + [ + 447, + 448 + ], + [ + 453, + 454 + ], + [ + 460, + 461 + ], + [ + 467, + 468 + ], + [ + 472, + 475 + ], + [ + 476, + 477 + ], + [ + 493, + 494 + ], + [ + 495, + 497 + ], + [ + 503, + 504 + ], + [ + 511, + 512 + ], + [ + 513, + 516 + ], + [ + 517, + 518 + ], + [ + 519, + 520 + ], + [ + 534, + 535 + ], + [ + 541, + 542 + ], + [ + 546, + 549 + ], + [ + 550, + 551 + ] + ] + } + }, + { + "filename": "libvips/foreign/webpsave.c", + "line_filter": { + "diff_chunks": [ + [ + 36, + 64 + ], + [ + 86, + 94 + ], + [ + 191, + 227 + ], + [ + 232, + 438 + ], + [ + 440, + 573 + ], + [ + 574, + 721 + ], + [ + 729, + 738 + ], + [ + 741, + 748 + ], + [ + 749, + 850 + ], + [ + 863, + 893 + ], + [ + 895, + 911 + ], + [ + 915, + 943 + ], + [ + 945, + 961 + ], + [ + 965, + 976 + ], + [ + 977, + 1001 + ], + [ + 1003, + 1019 + ], + [ + 1023, + 1034 + ], + [ + 1035, + 1075 + ], + [ + 1143, + 1159 + ], + [ + 1189, + 1196 + ], + [ + 1197, + 1220 + ], + [ + 1244, + 1260 + ], + [ + 1285, + 1299 + ] + ], + "lines_added": [ + [ + 39, + 40 + ], + [ + 41, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 55 + ], + [ + 60, + 61 + ], + [ + 89, + 91 + ], + [ + 194, + 196 + ], + [ + 198, + 199 + ], + [ + 200, + 204 + ], + [ + 207, + 208 + ], + [ + 211, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 224 + ], + [ + 235, + 236 + ], + [ + 241, + 243 + ], + [ + 245, + 246 + ], + [ + 247, + 249 + ], + [ + 253, + 254 + ], + [ + 258, + 263 + ], + [ + 265, + 266 + ], + [ + 271, + 272 + ], + [ + 274, + 275 + ], + [ + 276, + 279 + ], + [ + 282, + 289 + ], + [ + 292, + 294 + ], + [ + 301, + 306 + ], + [ + 309, + 310 + ], + [ + 311, + 312 + ], + [ + 318, + 319 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 326, + 330 + ], + [ + 335, + 338 + ], + [ + 344, + 345 + ], + [ + 348, + 349 + ], + [ + 350, + 351 + ], + [ + 352, + 353 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 362, + 363 + ], + [ + 369, + 371 + ], + [ + 374, + 375 + ], + [ + 378, + 380 + ], + [ + 382, + 384 + ], + [ + 385, + 386 + ], + [ + 391, + 393 + ], + [ + 399, + 404 + ], + [ + 406, + 407 + ], + [ + 410, + 411 + ], + [ + 414, + 415 + ], + [ + 418, + 419 + ], + [ + 422, + 427 + ], + [ + 430, + 431 + ], + [ + 434, + 435 + ], + [ + 443, + 446 + ], + [ + 448, + 449 + ], + [ + 451, + 453 + ], + [ + 454, + 455 + ], + [ + 458, + 459 + ], + [ + 461, + 463 + ], + [ + 464, + 465 + ], + [ + 469, + 470 + ], + [ + 473, + 475 + ], + [ + 478, + 481 + ], + [ + 482, + 484 + ], + [ + 486, + 489 + ], + [ + 493, + 494 + ], + [ + 497, + 498 + ], + [ + 501, + 503 + ], + [ + 505, + 511 + ], + [ + 517, + 523 + ], + [ + 529, + 530 + ], + [ + 531, + 532 + ], + [ + 533, + 534 + ], + [ + 536, + 540 + ], + [ + 542, + 543 + ], + [ + 546, + 548 + ], + [ + 550, + 551 + ], + [ + 554, + 558 + ], + [ + 564, + 570 + ], + [ + 577, + 581 + ], + [ + 583, + 584 + ], + [ + 585, + 589 + ], + [ + 594, + 595 + ], + [ + 597, + 599 + ], + [ + 601, + 602 + ], + [ + 605, + 607 + ], + [ + 611, + 616 + ], + [ + 618, + 622 + ], + [ + 627, + 630 + ], + [ + 635, + 636 + ], + [ + 639, + 640 + ], + [ + 646, + 648 + ], + [ + 649, + 654 + ], + [ + 659, + 662 + ], + [ + 667, + 672 + ], + [ + 676, + 678 + ], + [ + 682, + 683 + ], + [ + 687, + 690 + ], + [ + 691, + 694 + ], + [ + 697, + 700 + ], + [ + 701, + 704 + ], + [ + 706, + 710 + ], + [ + 712, + 714 + ], + [ + 715, + 716 + ], + [ + 717, + 718 + ], + [ + 732, + 733 + ], + [ + 734, + 735 + ], + [ + 744, + 745 + ], + [ + 752, + 755 + ], + [ + 756, + 758 + ], + [ + 759, + 762 + ], + [ + 763, + 765 + ], + [ + 766, + 769 + ], + [ + 770, + 771 + ], + [ + 772, + 773 + ], + [ + 774, + 777 + ], + [ + 778, + 780 + ], + [ + 781, + 784 + ], + [ + 785, + 787 + ], + [ + 788, + 791 + ], + [ + 792, + 794 + ], + [ + 795, + 798 + ], + [ + 799, + 801 + ], + [ + 802, + 805 + ], + [ + 806, + 808 + ], + [ + 809, + 812 + ], + [ + 813, + 815 + ], + [ + 816, + 819 + ], + [ + 820, + 822 + ], + [ + 823, + 826 + ], + [ + 827, + 829 + ], + [ + 830, + 833 + ], + [ + 834, + 836 + ], + [ + 837, + 840 + ], + [ + 841, + 843 + ], + [ + 846, + 847 + ], + [ + 866, + 868 + ], + [ + 870, + 871 + ], + [ + 877, + 878 + ], + [ + 879, + 881 + ], + [ + 882, + 883 + ], + [ + 887, + 888 + ], + [ + 889, + 890 + ], + [ + 898, + 901 + ], + [ + 902, + 904 + ], + [ + 907, + 908 + ], + [ + 918, + 920 + ], + [ + 922, + 923 + ], + [ + 927, + 929 + ], + [ + 930, + 932 + ], + [ + 933, + 934 + ], + [ + 937, + 938 + ], + [ + 939, + 940 + ], + [ + 948, + 951 + ], + [ + 952, + 954 + ], + [ + 957, + 958 + ], + [ + 968, + 970 + ], + [ + 972, + 973 + ], + [ + 980, + 982 + ], + [ + 983, + 985 + ], + [ + 986, + 989 + ], + [ + 990, + 991 + ], + [ + 995, + 996 + ], + [ + 997, + 998 + ], + [ + 1006, + 1009 + ], + [ + 1010, + 1012 + ], + [ + 1015, + 1016 + ], + [ + 1026, + 1028 + ], + [ + 1030, + 1031 + ], + [ + 1038, + 1040 + ], + [ + 1041, + 1043 + ], + [ + 1044, + 1048 + ], + [ + 1049, + 1054 + ], + [ + 1055, + 1056 + ], + [ + 1057, + 1058 + ], + [ + 1061, + 1062 + ], + [ + 1066, + 1067 + ], + [ + 1071, + 1072 + ], + [ + 1146, + 1147 + ], + [ + 1151, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1192, + 1193 + ], + [ + 1200, + 1203 + ], + [ + 1204, + 1207 + ], + [ + 1210, + 1211 + ], + [ + 1213, + 1214 + ], + [ + 1216, + 1217 + ], + [ + 1247, + 1248 + ], + [ + 1252, + 1255 + ], + [ + 1256, + 1257 + ], + [ + 1288, + 1289 + ], + [ + 1293, + 1296 + ], + [ + 1297, + 1298 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/freqfilt.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 60, + 115 + ], + [ + 118, + 127 + ], + [ + 130, + 180 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 64 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 71, + 74 + ], + [ + 76, + 77 + ], + [ + 78, + 80 + ], + [ + 81, + 82 + ], + [ + 85, + 86 + ], + [ + 87, + 89 + ], + [ + 94, + 95 + ], + [ + 97, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 108 + ], + [ + 111, + 112 + ], + [ + 121, + 124 + ], + [ + 133, + 136 + ], + [ + 137, + 141 + ], + [ + 144, + 146 + ], + [ + 147, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 156 + ], + [ + 162, + 163 + ], + [ + 165, + 167 + ], + [ + 168, + 171 + ], + [ + 173, + 175 + ], + [ + 176, + 179 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/freqmult.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 63, + 96 + ], + [ + 97, + 147 + ], + [ + 156, + 170 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 77, + 79 + ], + [ + 82, + 86 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 100, + 106 + ], + [ + 107, + 108 + ], + [ + 110, + 112 + ], + [ + 113, + 114 + ], + [ + 117, + 118 + ], + [ + 119, + 121 + ], + [ + 126, + 127 + ], + [ + 129, + 132 + ], + [ + 133, + 134 + ], + [ + 137, + 138 + ], + [ + 143, + 144 + ], + [ + 159, + 160 + ], + [ + 164, + 167 + ], + [ + 168, + 169 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/fwfft.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 41, + 69 + ], + [ + 89, + 106 + ], + [ + 109, + 341 + ], + [ + 342, + 349 + ], + [ + 356, + 370 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 44, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 60 + ], + [ + 65, + 66 + ], + [ + 92, + 93 + ], + [ + 96, + 98 + ], + [ + 100, + 103 + ], + [ + 112, + 115 + ], + [ + 119, + 122 + ], + [ + 127, + 139 + ], + [ + 141, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 147 + ], + [ + 149, + 151 + ], + [ + 153, + 155 + ], + [ + 156, + 158 + ], + [ + 163, + 164 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 179, + 181 + ], + [ + 182, + 184 + ], + [ + 186, + 187 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 204, + 206 + ], + [ + 208, + 209 + ], + [ + 213, + 215 + ], + [ + 217, + 219 + ], + [ + 225, + 228 + ], + [ + 232, + 235 + ], + [ + 238, + 241 + ], + [ + 244, + 252 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 262, + 264 + ], + [ + 266, + 268 + ], + [ + 272, + 274 + ], + [ + 277, + 278 + ], + [ + 284, + 286 + ], + [ + 288, + 289 + ], + [ + 292, + 293 + ], + [ + 294, + 295 + ], + [ + 296, + 297 + ], + [ + 300, + 302 + ], + [ + 303, + 304 + ], + [ + 305, + 308 + ], + [ + 309, + 313 + ], + [ + 315, + 318 + ], + [ + 320, + 322 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ], + [ + 329, + 330 + ], + [ + 332, + 333 + ], + [ + 337, + 338 + ], + [ + 345, + 346 + ], + [ + 359, + 360 + ], + [ + 364, + 367 + ], + [ + 368, + 369 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/invfft.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 30, + 58 + ], + [ + 80, + 145 + ], + [ + 150, + 170 + ], + [ + 174, + 267 + ], + [ + 268, + 275 + ], + [ + 287, + 301 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 49 + ], + [ + 54, + 55 + ], + [ + 83, + 84 + ], + [ + 87, + 89 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 97, + 100 + ], + [ + 104, + 107 + ], + [ + 111, + 122 + ], + [ + 124, + 126 + ], + [ + 127, + 128 + ], + [ + 131, + 132 + ], + [ + 136, + 138 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 153, + 156 + ], + [ + 159, + 162 + ], + [ + 163, + 165 + ], + [ + 166, + 167 + ], + [ + 177, + 179 + ], + [ + 181, + 183 + ], + [ + 187, + 196 + ], + [ + 198, + 200 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 217 + ], + [ + 218, + 219 + ], + [ + 220, + 223 + ], + [ + 224, + 228 + ], + [ + 230, + 233 + ], + [ + 235, + 239 + ], + [ + 242, + 243 + ], + [ + 244, + 246 + ], + [ + 251, + 252 + ], + [ + 254, + 257 + ], + [ + 258, + 260 + ], + [ + 263, + 264 + ], + [ + 271, + 272 + ], + [ + 290, + 291 + ], + [ + 295, + 298 + ], + [ + 299, + 300 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/pfreqfilt.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 65, + 80 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 74 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/phasecor.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 41 + ], + [ + 57, + 122 + ], + [ + 129, + 148 + ] + ], + "lines_added": [ + [ + 16, + 32 + ], + [ + 37, + 38 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 71, + 73 + ], + [ + 77, + 80 + ], + [ + 83, + 86 + ], + [ + 89, + 93 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 102 + ], + [ + 107, + 108 + ], + [ + 110, + 113 + ], + [ + 114, + 115 + ], + [ + 118, + 119 + ], + [ + 132, + 133 + ], + [ + 137, + 138 + ], + [ + 142, + 145 + ], + [ + 146, + 147 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/spectrum.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 9 + ], + [ + 20, + 48 + ], + [ + 59, + 115 + ], + [ + 122, + 136 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 62, + 63 + ], + [ + 65, + 66 + ], + [ + 67, + 69 + ], + [ + 72, + 74 + ], + [ + 77, + 80 + ], + [ + 83, + 87 + ], + [ + 88, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 105, + 106 + ], + [ + 111, + 112 + ], + [ + 125, + 126 + ], + [ + 130, + 133 + ], + [ + 134, + 135 + ] + ] + } + }, + { + "filename": "libvips/histogram/case.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 55, + 97 + ], + [ + 98, + 127 + ], + [ + 128, + 148 + ], + [ + 151, + 192 + ], + [ + 194, + 278 + ], + [ + 285, + 294 + ], + [ + 298, + 312 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 58, + 59 + ], + [ + 60, + 63 + ], + [ + 66, + 67 + ], + [ + 70, + 72 + ], + [ + 75, + 76 + ], + [ + 79, + 81 + ], + [ + 82, + 84 + ], + [ + 88, + 94 + ], + [ + 101, + 107 + ], + [ + 109, + 114 + ], + [ + 117, + 120 + ], + [ + 123, + 124 + ], + [ + 131, + 133 + ], + [ + 136, + 137 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 154, + 155 + ], + [ + 156, + 158 + ], + [ + 160, + 166 + ], + [ + 167, + 171 + ], + [ + 175, + 177 + ], + [ + 179, + 183 + ], + [ + 186, + 189 + ], + [ + 197, + 203 + ], + [ + 205, + 208 + ], + [ + 213, + 217 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 224, + 227 + ], + [ + 232, + 234 + ], + [ + 238, + 241 + ], + [ + 242, + 243 + ], + [ + 244, + 247 + ], + [ + 248, + 256 + ], + [ + 259, + 260 + ], + [ + 264, + 266 + ], + [ + 267, + 268 + ], + [ + 270, + 273 + ], + [ + 274, + 275 + ], + [ + 288, + 291 + ], + [ + 301, + 302 + ], + [ + 306, + 309 + ], + [ + 310, + 311 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_cum.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 54 + ], + [ + 66, + 132 + ], + [ + 147, + 167 + ], + [ + 170, + 191 + ] + ], + "lines_added": [ + [ + 23, + 24 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 69, + 83 + ], + [ + 84, + 85 + ], + [ + 87, + 89 + ], + [ + 90, + 93 + ], + [ + 95, + 127 + ], + [ + 128, + 129 + ], + [ + 150, + 151 + ], + [ + 153, + 154 + ], + [ + 156, + 157 + ], + [ + 163, + 164 + ], + [ + 173, + 174 + ], + [ + 179, + 181 + ], + [ + 185, + 188 + ], + [ + 189, + 190 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_entropy.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 8 + ], + [ + 9, + 37 + ], + [ + 44, + 51 + ], + [ + 54, + 135 + ], + [ + 142, + 157 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 28 + ], + [ + 33, + 34 + ], + [ + 47, + 48 + ], + [ + 57, + 59 + ], + [ + 61, + 62 + ], + [ + 63, + 66 + ], + [ + 67, + 69 + ], + [ + 70, + 72 + ], + [ + 73, + 75 + ], + [ + 80, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 107, + 108 + ], + [ + 110, + 113 + ], + [ + 114, + 115 + ], + [ + 116, + 119 + ], + [ + 120, + 122 + ], + [ + 125, + 126 + ], + [ + 131, + 132 + ], + [ + 145, + 147 + ], + [ + 151, + 154 + ], + [ + 155, + 156 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_equal.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 13, + 20 + ], + [ + 21, + 49 + ], + [ + 55, + 62 + ], + [ + 68, + 138 + ], + [ + 148, + 169 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 16, + 17 + ], + [ + 24, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 40 + ], + [ + 45, + 46 + ], + [ + 58, + 59 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 76, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 83 + ], + [ + 87, + 88 + ], + [ + 89, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 110, + 111 + ], + [ + 113, + 116 + ], + [ + 117, + 131 + ], + [ + 134, + 135 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 157, + 159 + ], + [ + 163, + 166 + ], + [ + 167, + 168 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_ismonotonic.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 53, + 60 + ], + [ + 63, + 136 + ], + [ + 143, + 158 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 56, + 57 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 72, + 75 + ], + [ + 76, + 77 + ], + [ + 78, + 80 + ], + [ + 81, + 83 + ], + [ + 84, + 89 + ], + [ + 92, + 93 + ], + [ + 94, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 114, + 115 + ], + [ + 117, + 120 + ], + [ + 121, + 129 + ], + [ + 132, + 133 + ], + [ + 146, + 148 + ], + [ + 152, + 155 + ], + [ + 156, + 157 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_local.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 31, + 59 + ], + [ + 83, + 95 + ], + [ + 96, + 196 + ], + [ + 197, + 208 + ], + [ + 210, + 219 + ], + [ + 220, + 239 + ], + [ + 244, + 251 + ], + [ + 254, + 269 + ], + [ + 275, + 399 + ], + [ + 409, + 416 + ], + [ + 423, + 438 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 7, + 8 + ], + [ + 34, + 35 + ], + [ + 36, + 40 + ], + [ + 41, + 50 + ], + [ + 55, + 56 + ], + [ + 86, + 87 + ], + [ + 91, + 92 + ], + [ + 99, + 100 + ], + [ + 104, + 108 + ], + [ + 109, + 111 + ], + [ + 112, + 114 + ], + [ + 115, + 116 + ], + [ + 119, + 120 + ], + [ + 126, + 128 + ], + [ + 131, + 135 + ], + [ + 137, + 142 + ], + [ + 143, + 144 + ], + [ + 147, + 149 + ], + [ + 153, + 155 + ], + [ + 160, + 161 + ], + [ + 166, + 170 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 177, + 181 + ], + [ + 182, + 183 + ], + [ + 185, + 186 + ], + [ + 187, + 189 + ], + [ + 190, + 193 + ], + [ + 200, + 202 + ], + [ + 204, + 205 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 223, + 226 + ], + [ + 229, + 230 + ], + [ + 233, + 236 + ], + [ + 247, + 248 + ], + [ + 257, + 258 + ], + [ + 260, + 262 + ], + [ + 265, + 266 + ], + [ + 278, + 279 + ], + [ + 282, + 283 + ], + [ + 284, + 285 + ], + [ + 286, + 287 + ], + [ + 290, + 292 + ], + [ + 293, + 294 + ], + [ + 295, + 298 + ], + [ + 299, + 301 + ], + [ + 302, + 306 + ], + [ + 308, + 309 + ], + [ + 310, + 316 + ], + [ + 318, + 319 + ], + [ + 323, + 326 + ], + [ + 329, + 335 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 355, + 356 + ], + [ + 360, + 363 + ], + [ + 364, + 365 + ], + [ + 366, + 371 + ], + [ + 372, + 375 + ], + [ + 376, + 378 + ], + [ + 379, + 382 + ], + [ + 383, + 385 + ], + [ + 386, + 389 + ], + [ + 390, + 392 + ], + [ + 395, + 396 + ], + [ + 412, + 413 + ], + [ + 426, + 428 + ], + [ + 432, + 435 + ], + [ + 436, + 437 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_match.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 19 + ], + [ + 20, + 48 + ], + [ + 72, + 86 + ], + [ + 88, + 206 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 75, + 76 + ], + [ + 78, + 80 + ], + [ + 81, + 83 + ], + [ + 91, + 92 + ], + [ + 97, + 98 + ], + [ + 100, + 102 + ], + [ + 104, + 105 + ], + [ + 107, + 108 + ], + [ + 110, + 111 + ], + [ + 115, + 116 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 132, + 136 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 144, + 145 + ], + [ + 146, + 149 + ], + [ + 154, + 155 + ], + [ + 157, + 158 + ], + [ + 160, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 181, + 182 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 194, + 196 + ], + [ + 200, + 203 + ], + [ + 204, + 205 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_norm.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 54 + ], + [ + 69, + 158 + ], + [ + 160, + 168 + ], + [ + 169, + 184 + ] + ], + "lines_added": [ + [ + 23, + 24 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 72, + 73 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 81, + 82 + ], + [ + 86, + 87 + ], + [ + 88, + 90 + ], + [ + 93, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 105 + ], + [ + 108, + 110 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 120, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 130, + 131 + ], + [ + 137, + 138 + ], + [ + 140, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 151 + ], + [ + 154, + 155 + ], + [ + 163, + 165 + ], + [ + 172, + 174 + ], + [ + 178, + 181 + ], + [ + 182, + 183 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_plot.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 23 + ], + [ + 32, + 60 + ], + [ + 79, + 294 + ], + [ + 304, + 350 + ], + [ + 353, + 383 + ] + ], + "lines_added": [ + [ + 19, + 20 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 82, + 95 + ], + [ + 99, + 101 + ], + [ + 103, + 104 + ], + [ + 106, + 108 + ], + [ + 112, + 141 + ], + [ + 143, + 144 + ], + [ + 147, + 148 + ], + [ + 150, + 161 + ], + [ + 165, + 167 + ], + [ + 169, + 170 + ], + [ + 172, + 174 + ], + [ + 175, + 176 + ], + [ + 180, + 209 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 230, + 231 + ], + [ + 232, + 234 + ], + [ + 237, + 241 + ], + [ + 242, + 245 + ], + [ + 248, + 251 + ], + [ + 254, + 255 + ], + [ + 260, + 264 + ], + [ + 265, + 268 + ], + [ + 272, + 274 + ], + [ + 277, + 281 + ], + [ + 283, + 284 + ], + [ + 287, + 288 + ], + [ + 290, + 291 + ], + [ + 307, + 317 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 329, + 330 + ], + [ + 332, + 335 + ], + [ + 336, + 337 + ], + [ + 338, + 343 + ], + [ + 346, + 347 + ], + [ + 356, + 357 + ], + [ + 359, + 362 + ], + [ + 366, + 367 + ], + [ + 371, + 373 + ], + [ + 377, + 380 + ], + [ + 381, + 382 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_unary.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 50, + 98 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 53, + 54 + ], + [ + 56, + 57 + ], + [ + 58, + 60 + ], + [ + 62, + 63 + ], + [ + 65, + 67 + ], + [ + 68, + 70 + ], + [ + 71, + 72 + ], + [ + 75, + 76 + ], + [ + 77, + 79 + ], + [ + 84, + 85 + ], + [ + 87, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_unary.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 64, + 74 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 67, + 68 + ] + ] + } + }, + { + "filename": "libvips/histogram/histogram.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 56, + 73 + ], + [ + 74, + 120 + ], + [ + 121, + 227 + ], + [ + 228, + 243 + ], + [ + 247, + 267 + ], + [ + 273, + 278 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 59, + 62 + ], + [ + 64, + 65 + ], + [ + 66, + 70 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 82, + 83 + ], + [ + 87, + 88 + ], + [ + 89, + 93 + ], + [ + 94, + 100 + ], + [ + 102, + 106 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 114, + 117 + ], + [ + 124, + 126 + ], + [ + 129, + 132 + ], + [ + 134, + 136 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 143, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 155 + ], + [ + 159, + 164 + ], + [ + 166, + 168 + ], + [ + 170, + 178 + ], + [ + 181, + 187 + ], + [ + 188, + 189 + ], + [ + 194, + 195 + ], + [ + 196, + 198 + ], + [ + 201, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 209 + ], + [ + 210, + 211 + ], + [ + 214, + 215 + ], + [ + 216, + 218 + ], + [ + 223, + 224 + ], + [ + 231, + 236 + ], + [ + 239, + 240 + ], + [ + 250, + 251 + ], + [ + 252, + 264 + ], + [ + 276, + 277 + ] + ] + } + }, + { + "filename": "libvips/histogram/maplut.c", + "line_filter": { + "diff_chunks": [ + [ + 37, + 65 + ], + [ + 79, + 424 + ], + [ + 426, + 508 + ], + [ + 510, + 519 + ], + [ + 521, + 528 + ], + [ + 529, + 761 + ], + [ + 770, + 791 + ], + [ + 796, + 810 + ] + ], + "lines_added": [ + [ + 40, + 56 + ], + [ + 61, + 62 + ], + [ + 82, + 83 + ], + [ + 84, + 91 + ], + [ + 96, + 97 + ], + [ + 99, + 101 + ], + [ + 106, + 108 + ], + [ + 109, + 111 + ], + [ + 116, + 118 + ], + [ + 123, + 124 + ], + [ + 128, + 130 + ], + [ + 136, + 138 + ], + [ + 139, + 140 + ], + [ + 144, + 157 + ], + [ + 158, + 159 + ], + [ + 162, + 179 + ], + [ + 181, + 182 + ], + [ + 183, + 202 + ], + [ + 205, + 206 + ], + [ + 207, + 229 + ], + [ + 232, + 233 + ], + [ + 236, + 248 + ], + [ + 251, + 266 + ], + [ + 267, + 268 + ], + [ + 272, + 289 + ], + [ + 291, + 292 + ], + [ + 293, + 312 + ], + [ + 314, + 315 + ], + [ + 318, + 332 + ], + [ + 333, + 334 + ], + [ + 337, + 353 + ], + [ + 355, + 356 + ], + [ + 359, + 377 + ], + [ + 379, + 380 + ], + [ + 383, + 404 + ], + [ + 406, + 407 + ], + [ + 410, + 421 + ], + [ + 429, + 431 + ], + [ + 432, + 437 + ], + [ + 438, + 440 + ], + [ + 441, + 443 + ], + [ + 444, + 446 + ], + [ + 447, + 449 + ], + [ + 450, + 452 + ], + [ + 453, + 455 + ], + [ + 456, + 458 + ], + [ + 459, + 461 + ], + [ + 467, + 470 + ], + [ + 475, + 476 + ], + [ + 478, + 481 + ], + [ + 484, + 486 + ], + [ + 487, + 488 + ], + [ + 490, + 494 + ], + [ + 496, + 497 + ], + [ + 498, + 499 + ], + [ + 504, + 505 + ], + [ + 513, + 514 + ], + [ + 515, + 516 + ], + [ + 524, + 525 + ], + [ + 532, + 550 + ], + [ + 551, + 552 + ], + [ + 553, + 554 + ], + [ + 555, + 574 + ], + [ + 576, + 579 + ], + [ + 581, + 582 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 588, + 589 + ], + [ + 594, + 595 + ], + [ + 596, + 598 + ], + [ + 602, + 605 + ], + [ + 608, + 610 + ], + [ + 612, + 616 + ], + [ + 617, + 620 + ], + [ + 625, + 626 + ], + [ + 632, + 633 + ], + [ + 635, + 639 + ], + [ + 643, + 645 + ], + [ + 647, + 648 + ], + [ + 652, + 653 + ], + [ + 654, + 656 + ], + [ + 662, + 668 + ], + [ + 671, + 675 + ], + [ + 676, + 704 + ], + [ + 706, + 710 + ], + [ + 711, + 712 + ], + [ + 715, + 716 + ], + [ + 717, + 720 + ], + [ + 725, + 726 + ], + [ + 730, + 733 + ], + [ + 734, + 735 + ], + [ + 736, + 741 + ], + [ + 742, + 745 + ], + [ + 746, + 747 + ], + [ + 748, + 751 + ], + [ + 752, + 754 + ], + [ + 757, + 758 + ], + [ + 773, + 774 + ], + [ + 775, + 776 + ], + [ + 778, + 779 + ], + [ + 781, + 782 + ], + [ + 783, + 788 + ], + [ + 799, + 800 + ], + [ + 804, + 807 + ], + [ + 808, + 809 + ] + ] + } + }, + { + "filename": "libvips/histogram/percent.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 54, + 61 + ], + [ + 65, + 134 + ], + [ + 138, + 145 + ], + [ + 148, + 170 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 57, + 58 + ], + [ + 68, + 69 + ], + [ + 71, + 72 + ], + [ + 73, + 75 + ], + [ + 78, + 80 + ], + [ + 81, + 89 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 96, + 97 + ], + [ + 98, + 99 + ], + [ + 105, + 106 + ], + [ + 108, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 127 + ], + [ + 130, + 131 + ], + [ + 141, + 142 + ], + [ + 151, + 152 + ], + [ + 158, + 160 + ], + [ + 164, + 167 + ], + [ + 168, + 169 + ] + ] + } + }, + { + "filename": "libvips/histogram/phistogram.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 40, + 84 + ], + [ + 89, + 99 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 43, + 55 + ], + [ + 59, + 61 + ], + [ + 67, + 68 + ], + [ + 74, + 75 + ], + [ + 80, + 81 + ], + [ + 92, + 93 + ] + ] + } + }, + { + "filename": "libvips/histogram/stdif.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 15, + 56 + ], + [ + 84, + 111 + ], + [ + 112, + 129 + ], + [ + 139, + 154 + ], + [ + 160, + 196 + ], + [ + 207, + 355 + ], + [ + 374, + 396 + ], + [ + 397, + 420 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 7, + 8 + ], + [ + 18, + 19 + ], + [ + 24, + 25 + ], + [ + 31, + 32 + ], + [ + 33, + 37 + ], + [ + 38, + 47 + ], + [ + 52, + 53 + ], + [ + 87, + 88 + ], + [ + 94, + 96 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 107, + 108 + ], + [ + 115, + 117 + ], + [ + 118, + 119 + ], + [ + 121, + 122 + ], + [ + 124, + 126 + ], + [ + 142, + 145 + ], + [ + 147, + 148 + ], + [ + 149, + 151 + ], + [ + 163, + 165 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 177 + ], + [ + 180, + 181 + ], + [ + 182, + 183 + ], + [ + 187, + 189 + ], + [ + 192, + 193 + ], + [ + 210, + 211 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 222, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 238 + ], + [ + 239, + 242 + ], + [ + 244, + 245 + ], + [ + 246, + 252 + ], + [ + 254, + 255 + ], + [ + 259, + 262 + ], + [ + 265, + 271 + ], + [ + 275, + 276 + ], + [ + 277, + 278 + ], + [ + 281, + 282 + ], + [ + 283, + 284 + ], + [ + 290, + 291 + ], + [ + 293, + 296 + ], + [ + 297, + 298 + ], + [ + 299, + 304 + ], + [ + 307, + 310 + ], + [ + 311, + 313 + ], + [ + 314, + 317 + ], + [ + 318, + 320 + ], + [ + 321, + 324 + ], + [ + 325, + 327 + ], + [ + 328, + 331 + ], + [ + 332, + 334 + ], + [ + 335, + 338 + ], + [ + 339, + 341 + ], + [ + 342, + 345 + ], + [ + 346, + 348 + ], + [ + 351, + 352 + ], + [ + 377, + 380 + ], + [ + 385, + 386 + ], + [ + 390, + 393 + ], + [ + 400, + 402 + ], + [ + 408, + 410 + ], + [ + 414, + 417 + ], + [ + 418, + 419 + ] + ] + } + }, + { + "filename": "libvips/include/vips/almostdeprecated.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 7, + 35 + ], + [ + 54, + 112 + ], + [ + 121, + 130 + ], + [ + 133, + 222 + ], + [ + 223, + 407 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 10, + 11 + ], + [ + 12, + 16 + ], + [ + 17, + 26 + ], + [ + 31, + 32 + ], + [ + 57, + 58 + ], + [ + 62, + 64 + ], + [ + 67, + 68 + ], + [ + 69, + 71 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 90, + 95 + ], + [ + 97, + 102 + ], + [ + 104, + 109 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 136, + 138 + ], + [ + 139, + 140 + ], + [ + 141, + 143 + ], + [ + 144, + 146 + ], + [ + 147, + 149 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 163, + 164 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 176, + 177 + ], + [ + 180, + 181 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 187, + 189 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 199, + 201 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 208, + 209 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 218, + 219 + ], + [ + 226, + 227 + ], + [ + 231, + 232 + ], + [ + 233, + 234 + ], + [ + 235, + 236 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 241, + 242 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 250, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 260, + 262 + ], + [ + 266, + 267 + ], + [ + 268, + 269 + ], + [ + 270, + 271 + ], + [ + 272, + 273 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 278, + 279 + ], + [ + 280, + 281 + ], + [ + 282, + 283 + ], + [ + 285, + 286 + ], + [ + 287, + 288 + ], + [ + 290, + 291 + ], + [ + 293, + 294 + ], + [ + 296, + 297 + ], + [ + 299, + 300 + ], + [ + 302, + 303 + ], + [ + 304, + 305 + ], + [ + 306, + 307 + ], + [ + 308, + 309 + ], + [ + 310, + 311 + ], + [ + 312, + 313 + ], + [ + 314, + 315 + ], + [ + 316, + 317 + ], + [ + 318, + 319 + ], + [ + 320, + 322 + ], + [ + 324, + 326 + ], + [ + 327, + 328 + ], + [ + 330, + 331 + ], + [ + 332, + 333 + ], + [ + 334, + 335 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 343, + 344 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 350, + 351 + ], + [ + 352, + 353 + ], + [ + 354, + 356 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 362, + 364 + ], + [ + 366, + 367 + ], + [ + 368, + 371 + ], + [ + 373, + 374 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 380, + 381 + ], + [ + 382, + 383 + ], + [ + 385, + 387 + ], + [ + 388, + 389 + ], + [ + 390, + 391 + ], + [ + 392, + 394 + ], + [ + 395, + 396 + ], + [ + 398, + 399 + ], + [ + 403, + 404 + ] + ] + } + }, + { + "filename": "libvips/include/vips/arithmetic.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 41, + 48 + ], + [ + 49, + 57 + ], + [ + 82, + 93 + ], + [ + 97, + 104 + ], + [ + 112, + 119 + ], + [ + 133, + 140 + ], + [ + 152, + 159 + ], + [ + 167, + 174 + ], + [ + 178, + 185 + ], + [ + 192, + 568 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 44, + 45 + ], + [ + 52, + 54 + ], + [ + 85, + 86 + ], + [ + 88, + 90 + ], + [ + 100, + 101 + ], + [ + 115, + 116 + ], + [ + 136, + 137 + ], + [ + 155, + 156 + ], + [ + 170, + 171 + ], + [ + 181, + 182 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 201, + 202 + ], + [ + 204, + 205 + ], + [ + 207, + 208 + ], + [ + 210, + 212 + ], + [ + 214, + 215 + ], + [ + 217, + 218 + ], + [ + 220, + 222 + ], + [ + 224, + 226 + ], + [ + 228, + 229 + ], + [ + 231, + 232 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 240, + 241 + ], + [ + 243, + 244 + ], + [ + 246, + 247 + ], + [ + 250, + 252 + ], + [ + 254, + 255 + ], + [ + 257, + 258 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 266, + 267 + ], + [ + 269, + 270 + ], + [ + 272, + 273 + ], + [ + 275, + 276 + ], + [ + 278, + 279 + ], + [ + 281, + 282 + ], + [ + 284, + 285 + ], + [ + 287, + 288 + ], + [ + 290, + 291 + ], + [ + 293, + 294 + ], + [ + 296, + 297 + ], + [ + 299, + 300 + ], + [ + 303, + 305 + ], + [ + 307, + 308 + ], + [ + 310, + 311 + ], + [ + 313, + 314 + ], + [ + 317, + 319 + ], + [ + 321, + 322 + ], + [ + 325, + 327 + ], + [ + 329, + 330 + ], + [ + 332, + 333 + ], + [ + 336, + 337 + ], + [ + 340, + 342 + ], + [ + 344, + 345 + ], + [ + 347, + 348 + ], + [ + 350, + 351 + ], + [ + 353, + 354 + ], + [ + 356, + 357 + ], + [ + 359, + 360 + ], + [ + 362, + 364 + ], + [ + 366, + 368 + ], + [ + 370, + 372 + ], + [ + 374, + 376 + ], + [ + 378, + 380 + ], + [ + 382, + 384 + ], + [ + 386, + 388 + ], + [ + 390, + 392 + ], + [ + 394, + 395 + ], + [ + 397, + 398 + ], + [ + 400, + 401 + ], + [ + 403, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 410 + ], + [ + 413, + 415 + ], + [ + 417, + 418 + ], + [ + 420, + 421 + ], + [ + 423, + 424 + ], + [ + 426, + 427 + ], + [ + 429, + 430 + ], + [ + 433, + 435 + ], + [ + 437, + 439 + ], + [ + 441, + 443 + ], + [ + 445, + 447 + ], + [ + 449, + 451 + ], + [ + 453, + 455 + ], + [ + 457, + 459 + ], + [ + 461, + 462 + ], + [ + 464, + 465 + ], + [ + 467, + 468 + ], + [ + 470, + 471 + ], + [ + 473, + 474 + ], + [ + 477, + 479 + ], + [ + 481, + 482 + ], + [ + 484, + 485 + ], + [ + 487, + 488 + ], + [ + 490, + 492 + ], + [ + 494, + 496 + ], + [ + 498, + 500 + ], + [ + 502, + 504 + ], + [ + 506, + 508 + ], + [ + 510, + 511 + ], + [ + 513, + 514 + ], + [ + 516, + 517 + ], + [ + 520, + 521 + ], + [ + 523, + 524 + ], + [ + 526, + 527 + ], + [ + 529, + 530 + ], + [ + 532, + 533 + ], + [ + 535, + 536 + ], + [ + 538, + 540 + ], + [ + 542, + 543 + ], + [ + 545, + 546 + ], + [ + 548, + 549 + ], + [ + 551, + 553 + ], + [ + 555, + 556 + ], + [ + 558, + 559 + ], + [ + 561, + 562 + ], + [ + 564, + 565 + ] + ] + } + }, + { + "filename": "libvips/include/vips/basic.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 37, + 46 + ], + [ + 49, + 60 + ], + [ + 70, + 86 + ], + [ + 91, + 110 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 40, + 41 + ], + [ + 42, + 43 + ], + [ + 52, + 54 + ], + [ + 55, + 57 + ], + [ + 73, + 74 + ], + [ + 77, + 83 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ] + ] + } + }, + { + "filename": "libvips/include/vips/buf.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 39, + 47 + ], + [ + 48, + 118 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 42, + 44 + ], + [ + 51, + 63 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 87 + ], + [ + 88, + 89 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ] + ] + } + }, + { + "filename": "libvips/include/vips/colour.h", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 108, + 304 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 111, + 112 + ], + [ + 113, + 115 + ], + [ + 118, + 119 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 127, + 128 + ], + [ + 130, + 131 + ], + [ + 133, + 134 + ], + [ + 136, + 137 + ], + [ + 139, + 140 + ], + [ + 142, + 143 + ], + [ + 145, + 146 + ], + [ + 148, + 149 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 164, + 165 + ], + [ + 167, + 168 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 180, + 181 + ], + [ + 183, + 184 + ], + [ + 186, + 187 + ], + [ + 189, + 190 + ], + [ + 192, + 193 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 209, + 210 + ], + [ + 211, + 213 + ], + [ + 215, + 216 + ], + [ + 218, + 219 + ], + [ + 221, + 223 + ], + [ + 224, + 226 + ], + [ + 228, + 229 + ], + [ + 231, + 232 + ], + [ + 234, + 235 + ], + [ + 238, + 240 + ], + [ + 241, + 243 + ], + [ + 244, + 245 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 251, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 264, + 265 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 271, + 273 + ], + [ + 274, + 276 + ], + [ + 278, + 280 + ], + [ + 281, + 283 + ], + [ + 285, + 287 + ], + [ + 288, + 290 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 296, + 298 + ], + [ + 299, + 301 + ] + ] + } + }, + { + "filename": "libvips/include/vips/connection.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 44, + 65 + ], + [ + 68, + 88 + ], + [ + 91, + 121 + ], + [ + 126, + 133 + ], + [ + 140, + 147 + ], + [ + 151, + 158 + ], + [ + 160, + 172 + ], + [ + 177, + 184 + ], + [ + 185, + 191 + ], + [ + 199, + 206 + ], + [ + 210, + 278 + ], + [ + 288, + 322 + ], + [ + 334, + 360 + ], + [ + 375, + 403 + ], + [ + 411, + 418 + ], + [ + 435, + 441 + ], + [ + 445, + 459 + ], + [ + 463, + 538 + ], + [ + 545, + 563 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 47, + 62 + ], + [ + 71, + 72 + ], + [ + 75, + 76 + ], + [ + 79, + 80 + ], + [ + 82, + 83 + ], + [ + 84, + 85 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 105, + 118 + ], + [ + 129, + 130 + ], + [ + 143, + 144 + ], + [ + 154, + 155 + ], + [ + 163, + 164 + ], + [ + 168, + 169 + ], + [ + 180, + 181 + ], + [ + 202, + 203 + ], + [ + 213, + 214 + ], + [ + 218, + 219 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 230 + ], + [ + 231, + 232 + ], + [ + 234, + 235 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 244, + 245 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 252, + 253 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 262, + 275 + ], + [ + 291, + 293 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 301, + 302 + ], + [ + 306, + 319 + ], + [ + 337, + 338 + ], + [ + 339, + 340 + ], + [ + 344, + 357 + ], + [ + 378, + 379 + ], + [ + 381, + 394 + ], + [ + 399, + 400 + ], + [ + 414, + 415 + ], + [ + 448, + 449 + ], + [ + 452, + 453 + ], + [ + 455, + 456 + ], + [ + 466, + 467 + ], + [ + 470, + 471 + ], + [ + 475, + 476 + ], + [ + 480, + 481 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 487, + 488 + ], + [ + 489, + 490 + ], + [ + 491, + 492 + ], + [ + 493, + 494 + ], + [ + 495, + 496 + ], + [ + 497, + 498 + ], + [ + 499, + 500 + ], + [ + 501, + 502 + ], + [ + 503, + 504 + ], + [ + 506, + 509 + ], + [ + 510, + 511 + ], + [ + 512, + 514 + ], + [ + 515, + 516 + ], + [ + 518, + 531 + ], + [ + 534, + 535 + ], + [ + 548, + 553 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ] + ] + } + }, + { + "filename": "libvips/include/vips/conversion.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 135, + 354 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 138, + 139 + ], + [ + 141, + 142 + ], + [ + 144, + 145 + ], + [ + 147, + 148 + ], + [ + 150, + 151 + ], + [ + 153, + 154 + ], + [ + 157, + 159 + ], + [ + 161, + 163 + ], + [ + 165, + 166 + ], + [ + 168, + 170 + ], + [ + 172, + 174 + ], + [ + 176, + 177 + ], + [ + 179, + 181 + ], + [ + 183, + 185 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 193, + 194 + ], + [ + 196, + 198 + ], + [ + 200, + 201 + ], + [ + 203, + 204 + ], + [ + 206, + 207 + ], + [ + 209, + 210 + ], + [ + 212, + 213 + ], + [ + 215, + 216 + ], + [ + 218, + 219 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 226, + 227 + ], + [ + 229, + 230 + ], + [ + 233, + 234 + ], + [ + 236, + 237 + ], + [ + 239, + 240 + ], + [ + 242, + 243 + ], + [ + 245, + 246 + ], + [ + 248, + 249 + ], + [ + 251, + 252 + ], + [ + 254, + 255 + ], + [ + 257, + 258 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 266, + 267 + ], + [ + 269, + 270 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 279, + 280 + ], + [ + 282, + 283 + ], + [ + 285, + 286 + ], + [ + 288, + 289 + ], + [ + 291, + 292 + ], + [ + 294, + 295 + ], + [ + 298, + 300 + ], + [ + 302, + 303 + ], + [ + 305, + 306 + ], + [ + 308, + 309 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 319, + 321 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ], + [ + 330, + 331 + ], + [ + 333, + 334 + ], + [ + 336, + 337 + ], + [ + 339, + 340 + ], + [ + 342, + 344 + ], + [ + 347, + 348 + ], + [ + 350, + 351 + ] + ] + } + }, + { + "filename": "libvips/include/vips/convolution.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 46, + 92 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 49, + 50 + ], + [ + 52, + 53 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 62 + ], + [ + 64, + 65 + ], + [ + 68, + 69 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 81, + 82 + ], + [ + 85, + 86 + ], + [ + 88, + 89 + ] + ] + } + }, + { + "filename": "libvips/include/vips/create.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 47, + 158 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 50, + 51 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 97, + 99 + ], + [ + 101, + 103 + ], + [ + 105, + 108 + ], + [ + 110, + 113 + ], + [ + 115, + 119 + ], + [ + 121, + 125 + ], + [ + 127, + 129 + ], + [ + 131, + 134 + ], + [ + 136, + 139 + ], + [ + 141, + 143 + ], + [ + 146, + 148 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ] + ] + } + }, + { + "filename": "libvips/include/vips/dbuf.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 59, + 101 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 62, + 63 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 79 + ], + [ + 80, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ] + ] + } + }, + { + "filename": "libvips/include/vips/debug.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 103 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 45 + ], + [ + 46, + 52 + ], + [ + 55, + 61 + ], + [ + 62, + 68 + ], + [ + 71, + 77 + ], + [ + 78, + 84 + ], + [ + 87, + 93 + ], + [ + 94, + 100 + ] + ] + } + }, + { + "filename": "libvips/include/vips/deprecated.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 50, + 121 + ], + [ + 125, + 150 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 53, + 60 + ], + [ + 62, + 74 + ], + [ + 77, + 91 + ], + [ + 92, + 105 + ], + [ + 106, + 114 + ], + [ + 115, + 118 + ], + [ + 128, + 129 + ], + [ + 131, + 133 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 147 + ] + ] + } + }, + { + "filename": "libvips/include/vips/dispatch.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 45, + 122 + ], + [ + 125, + 155 + ], + [ + 157, + 186 + ], + [ + 219, + 386 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 48, + 62 + ], + [ + 64, + 65 + ], + [ + 69, + 71 + ], + [ + 73, + 77 + ], + [ + 80, + 84 + ], + [ + 90, + 92 + ], + [ + 96, + 101 + ], + [ + 103, + 104 + ], + [ + 106, + 107 + ], + [ + 111, + 114 + ], + [ + 118, + 119 + ], + [ + 128, + 133 + ], + [ + 138, + 144 + ], + [ + 149, + 152 + ], + [ + 160, + 162 + ], + [ + 167, + 169 + ], + [ + 174, + 176 + ], + [ + 181, + 183 + ], + [ + 222, + 231 + ], + [ + 234, + 341 + ], + [ + 345, + 346 + ], + [ + 347, + 349 + ], + [ + 353, + 354 + ], + [ + 358, + 359 + ], + [ + 363, + 364 + ], + [ + 365, + 366 + ], + [ + 367, + 368 + ], + [ + 372, + 373 + ], + [ + 374, + 375 + ], + [ + 379, + 380 + ], + [ + 382, + 383 + ] + ] + } + }, + { + "filename": "libvips/include/vips/draw.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 46, + 110 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 49, + 50 + ], + [ + 52, + 54 + ], + [ + 56, + 58 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 71, + 73 + ], + [ + 75, + 77 + ], + [ + 80, + 82 + ], + [ + 84, + 86 + ], + [ + 89, + 91 + ], + [ + 93, + 95 + ], + [ + 98, + 99 + ], + [ + 101, + 102 + ], + [ + 105, + 107 + ] + ] + } + }, + { + "filename": "libvips/include/vips/error.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 140 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 40 + ], + [ + 41, + 42 + ], + [ + 43, + 44 + ], + [ + 46, + 47 + ], + [ + 48, + 49 + ], + [ + 51, + 53 + ], + [ + 54, + 55 + ], + [ + 56, + 58 + ], + [ + 59, + 61 + ], + [ + 62, + 63 + ], + [ + 64, + 65 + ], + [ + 67, + 69 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 130, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 137 + ] + ] + } + }, + { + "filename": "libvips/include/vips/foreign.h", + "line_filter": { + "diff_chunks": [ + [ + 4, + 32 + ], + [ + 42, + 61 + ], + [ + 91, + 123 + ], + [ + 129, + 158 + ], + [ + 198, + 267 + ], + [ + 269, + 314 + ], + [ + 343, + 350 + ], + [ + 363, + 380 + ], + [ + 391, + 423 + ], + [ + 452, + 478 + ], + [ + 496, + 522 + ], + [ + 583, + 673 + ], + [ + 691, + 713 + ], + [ + 741, + 890 + ], + [ + 894, + 901 + ], + [ + 936, + 949 + ], + [ + 952, + 959 + ] + ], + "lines_added": [ + [ + 7, + 23 + ], + [ + 28, + 29 + ], + [ + 45, + 58 + ], + [ + 94, + 96 + ], + [ + 97, + 98 + ], + [ + 103, + 108 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 117, + 120 + ], + [ + 132, + 145 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 211, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 226, + 228 + ], + [ + 232, + 233 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 247, + 248 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ], + [ + 257, + 259 + ], + [ + 263, + 264 + ], + [ + 272, + 273 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 279, + 280 + ], + [ + 281, + 282 + ], + [ + 283, + 285 + ], + [ + 286, + 288 + ], + [ + 290, + 291 + ], + [ + 293, + 308 + ], + [ + 310, + 311 + ], + [ + 346, + 347 + ], + [ + 366, + 368 + ], + [ + 374, + 377 + ], + [ + 394, + 395 + ], + [ + 396, + 397 + ], + [ + 398, + 399 + ], + [ + 400, + 401 + ], + [ + 403, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 410 + ], + [ + 412, + 413 + ], + [ + 416, + 417 + ], + [ + 419, + 420 + ], + [ + 455, + 456 + ], + [ + 458, + 459 + ], + [ + 461, + 462 + ], + [ + 465, + 466 + ], + [ + 468, + 469 + ], + [ + 471, + 472 + ], + [ + 474, + 475 + ], + [ + 499, + 500 + ], + [ + 502, + 503 + ], + [ + 505, + 506 + ], + [ + 509, + 510 + ], + [ + 512, + 513 + ], + [ + 515, + 516 + ], + [ + 518, + 519 + ], + [ + 586, + 587 + ], + [ + 589, + 590 + ], + [ + 592, + 593 + ], + [ + 595, + 596 + ], + [ + 598, + 599 + ], + [ + 601, + 602 + ], + [ + 605, + 606 + ], + [ + 609, + 610 + ], + [ + 612, + 613 + ], + [ + 616, + 617 + ], + [ + 620, + 622 + ], + [ + 624, + 625 + ], + [ + 627, + 628 + ], + [ + 631, + 632 + ], + [ + 634, + 635 + ], + [ + 637, + 638 + ], + [ + 640, + 641 + ], + [ + 644, + 645 + ], + [ + 647, + 648 + ], + [ + 650, + 651 + ], + [ + 653, + 654 + ], + [ + 656, + 657 + ], + [ + 660, + 661 + ], + [ + 663, + 664 + ], + [ + 666, + 667 + ], + [ + 669, + 670 + ], + [ + 694, + 695 + ], + [ + 697, + 698 + ], + [ + 700, + 701 + ], + [ + 703, + 704 + ], + [ + 706, + 707 + ], + [ + 709, + 710 + ], + [ + 744, + 745 + ], + [ + 747, + 748 + ], + [ + 750, + 751 + ], + [ + 753, + 754 + ], + [ + 757, + 758 + ], + [ + 761, + 762 + ], + [ + 764, + 765 + ], + [ + 767, + 768 + ], + [ + 770, + 771 + ], + [ + 773, + 774 + ], + [ + 776, + 777 + ], + [ + 780, + 781 + ], + [ + 783, + 784 + ], + [ + 786, + 787 + ], + [ + 790, + 791 + ], + [ + 793, + 794 + ], + [ + 796, + 797 + ], + [ + 799, + 800 + ], + [ + 803, + 804 + ], + [ + 806, + 807 + ], + [ + 809, + 810 + ], + [ + 813, + 814 + ], + [ + 816, + 817 + ], + [ + 819, + 820 + ], + [ + 823, + 824 + ], + [ + 826, + 827 + ], + [ + 829, + 830 + ], + [ + 832, + 833 + ], + [ + 835, + 836 + ], + [ + 838, + 839 + ], + [ + 842, + 843 + ], + [ + 845, + 846 + ], + [ + 848, + 849 + ], + [ + 852, + 853 + ], + [ + 855, + 856 + ], + [ + 858, + 859 + ], + [ + 861, + 862 + ], + [ + 864, + 865 + ], + [ + 867, + 868 + ], + [ + 871, + 872 + ], + [ + 874, + 875 + ], + [ + 877, + 878 + ], + [ + 880, + 881 + ], + [ + 883, + 884 + ], + [ + 886, + 887 + ], + [ + 897, + 898 + ], + [ + 939, + 940 + ], + [ + 942, + 943 + ], + [ + 945, + 946 + ], + [ + 955, + 956 + ] + ] + } + }, + { + "filename": "libvips/include/vips/format.h", + "line_filter": { + "diff_chunks": [ + [ + 4, + 32 + ], + [ + 37, + 63 + ], + [ + 74, + 97 + ], + [ + 105, + 133 + ] + ], + "lines_added": [ + [ + 7, + 23 + ], + [ + 28, + 29 + ], + [ + 40, + 55 + ], + [ + 57, + 60 + ], + [ + 77, + 78 + ], + [ + 81, + 82 + ], + [ + 85, + 86 + ], + [ + 89, + 90 + ], + [ + 93, + 94 + ], + [ + 108, + 109 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 121, + 123 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ] + ] + } + }, + { + "filename": "libvips/include/vips/freqfilt.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 39, + 61 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 43 + ], + [ + 45, + 46 + ], + [ + 49, + 50 + ], + [ + 53, + 54 + ], + [ + 57, + 58 + ] + ] + } + }, + { + "filename": "libvips/include/vips/gate.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 37, + 88 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 40, + 71 + ], + [ + 75, + 76 + ], + [ + 77, + 80 + ], + [ + 81, + 83 + ], + [ + 84, + 85 + ] + ] + } + }, + { + "filename": "libvips/include/vips/generate.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 37, + 89 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 40, + 41 + ], + [ + 42, + 43 + ], + [ + 45, + 46 + ], + [ + 47, + 48 + ], + [ + 49, + 50 + ], + [ + 52, + 53 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 59, + 60 + ], + [ + 62, + 63 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 82, + 84 + ], + [ + 85, + 86 + ] + ] + } + }, + { + "filename": "libvips/include/vips/header.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 80, + 87 + ], + [ + 105, + 120 + ], + [ + 130, + 137 + ], + [ + 139, + 153 + ], + [ + 165, + 310 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 83, + 84 + ], + [ + 108, + 109 + ], + [ + 115, + 117 + ], + [ + 133, + 134 + ], + [ + 142, + 143 + ], + [ + 149, + 150 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 219, + 220 + ], + [ + 222, + 227 + ], + [ + 229, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 236 + ], + [ + 237, + 238 + ], + [ + 239, + 242 + ], + [ + 243, + 244 + ], + [ + 245, + 246 + ], + [ + 248, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 257 + ], + [ + 258, + 260 + ], + [ + 261, + 263 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 269, + 271 + ], + [ + 272, + 273 + ], + [ + 274, + 276 + ], + [ + 277, + 279 + ], + [ + 280, + 281 + ], + [ + 282, + 284 + ], + [ + 285, + 286 + ], + [ + 287, + 289 + ], + [ + 290, + 292 + ], + [ + 293, + 295 + ], + [ + 296, + 298 + ], + [ + 300, + 302 + ], + [ + 303, + 305 + ], + [ + 306, + 307 + ] + ] + } + }, + { + "filename": "libvips/include/vips/histogram.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 39, + 82 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 43 + ], + [ + 45, + 46 + ], + [ + 48, + 49 + ], + [ + 51, + 52 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 73, + 74 + ], + [ + 77, + 79 + ] + ] + } + }, + { + "filename": "libvips/include/vips/image.h", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 47, + 55 + ], + [ + 64, + 90 + ], + [ + 140, + 181 + ], + [ + 187, + 213 + ], + [ + 217, + 225 + ], + [ + 232, + 261 + ], + [ + 271, + 278 + ], + [ + 328, + 365 + ], + [ + 373, + 603 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 50, + 52 + ], + [ + 67, + 69 + ], + [ + 71, + 72 + ], + [ + 78, + 87 + ], + [ + 143, + 147 + ], + [ + 153, + 154 + ], + [ + 156, + 162 + ], + [ + 165, + 178 + ], + [ + 190, + 193 + ], + [ + 194, + 199 + ], + [ + 200, + 202 + ], + [ + 203, + 204 + ], + [ + 209, + 210 + ], + [ + 220, + 222 + ], + [ + 235, + 241 + ], + [ + 242, + 243 + ], + [ + 248, + 249 + ], + [ + 250, + 253 + ], + [ + 256, + 258 + ], + [ + 274, + 275 + ], + [ + 331, + 332 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 341, + 343 + ], + [ + 346, + 347 + ], + [ + 348, + 350 + ], + [ + 351, + 352 + ], + [ + 353, + 354 + ], + [ + 357, + 358 + ], + [ + 361, + 362 + ], + [ + 376, + 377 + ], + [ + 378, + 385 + ], + [ + 386, + 387 + ], + [ + 392, + 411 + ], + [ + 412, + 413 + ], + [ + 414, + 416 + ], + [ + 419, + 425 + ], + [ + 426, + 428 + ], + [ + 431, + 432 + ], + [ + 434, + 435 + ], + [ + 437, + 438 + ], + [ + 440, + 441 + ], + [ + 443, + 444 + ], + [ + 445, + 446 + ], + [ + 447, + 448 + ], + [ + 450, + 451 + ], + [ + 452, + 453 + ], + [ + 455, + 456 + ], + [ + 457, + 458 + ], + [ + 459, + 460 + ], + [ + 461, + 462 + ], + [ + 464, + 465 + ], + [ + 466, + 468 + ], + [ + 469, + 471 + ], + [ + 472, + 474 + ], + [ + 475, + 477 + ], + [ + 479, + 481 + ], + [ + 482, + 483 + ], + [ + 484, + 485 + ], + [ + 486, + 488 + ], + [ + 489, + 491 + ], + [ + 492, + 494 + ], + [ + 495, + 496 + ], + [ + 498, + 500 + ], + [ + 501, + 502 + ], + [ + 503, + 504 + ], + [ + 506, + 507 + ], + [ + 508, + 509 + ], + [ + 511, + 513 + ], + [ + 515, + 517 + ], + [ + 519, + 520 + ], + [ + 522, + 524 + ], + [ + 525, + 526 + ], + [ + 527, + 528 + ], + [ + 530, + 531 + ], + [ + 532, + 533 + ], + [ + 534, + 535 + ], + [ + 536, + 537 + ], + [ + 539, + 540 + ], + [ + 541, + 542 + ], + [ + 543, + 544 + ], + [ + 545, + 546 + ], + [ + 547, + 548 + ], + [ + 549, + 550 + ], + [ + 552, + 553 + ], + [ + 555, + 556 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ], + [ + 561, + 562 + ], + [ + 563, + 564 + ], + [ + 566, + 567 + ], + [ + 572, + 573 + ], + [ + 574, + 575 + ], + [ + 576, + 578 + ], + [ + 579, + 580 + ], + [ + 581, + 583 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 588, + 589 + ], + [ + 593, + 595 + ], + [ + 596, + 597 + ], + [ + 599, + 600 + ] + ] + } + }, + { + "filename": "libvips/include/vips/inlines.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 38 + ], + [ + 46, + 67 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 34, + 35 + ], + [ + 49, + 51 + ], + [ + 52, + 54 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 63, + 64 + ] + ] + } + }, + { + "filename": "libvips/include/vips/internal.h", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 42, + 76 + ], + [ + 78, + 87 + ], + [ + 89, + 113 + ], + [ + 131, + 390 + ] + ], + "lines_added": [ + [ + 10, + 11 + ], + [ + 12, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 26 + ], + [ + 31, + 32 + ], + [ + 45, + 55 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 92, + 94 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 110 + ], + [ + 134, + 135 + ], + [ + 138, + 140 + ], + [ + 146, + 151 + ], + [ + 152, + 153 + ], + [ + 154, + 157 + ], + [ + 160, + 162 + ], + [ + 168, + 169 + ], + [ + 175, + 176 + ], + [ + 177, + 180 + ], + [ + 181, + 184 + ], + [ + 190, + 191 + ], + [ + 197, + 198 + ], + [ + 204, + 205 + ], + [ + 206, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 213 + ], + [ + 216, + 217 + ], + [ + 220, + 221 + ], + [ + 224, + 226 + ], + [ + 229, + 230 + ], + [ + 233, + 235 + ], + [ + 238, + 242 + ], + [ + 248, + 249 + ], + [ + 250, + 255 + ], + [ + 256, + 262 + ], + [ + 265, + 268 + ], + [ + 271, + 273 + ], + [ + 274, + 278 + ], + [ + 279, + 283 + ], + [ + 284, + 288 + ], + [ + 289, + 291 + ], + [ + 294, + 295 + ], + [ + 298, + 313 + ], + [ + 316, + 317 + ], + [ + 318, + 321 + ], + [ + 322, + 323 + ], + [ + 324, + 325 + ], + [ + 329, + 330 + ], + [ + 331, + 335 + ], + [ + 340, + 341 + ], + [ + 344, + 347 + ], + [ + 349, + 350 + ], + [ + 351, + 352 + ], + [ + 353, + 354 + ], + [ + 355, + 356 + ], + [ + 358, + 359 + ], + [ + 360, + 363 + ], + [ + 366, + 368 + ], + [ + 369, + 370 + ], + [ + 371, + 372 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 381, + 382 + ], + [ + 383, + 384 + ], + [ + 386, + 387 + ] + ] + } + }, + { + "filename": "libvips/include/vips/interpolate.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 62 + ], + [ + 66, + 74 + ], + [ + 79, + 86 + ], + [ + 88, + 95 + ], + [ + 97, + 111 + ], + [ + 123, + 141 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 59 + ], + [ + 69, + 71 + ], + [ + 82, + 83 + ], + [ + 91, + 92 + ], + [ + 100, + 102 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 134, + 135 + ] + ] + } + }, + { + "filename": "libvips/include/vips/mask.h", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 59, + 161 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 62, + 63 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 105, + 107 + ], + [ + 108, + 110 + ], + [ + 111, + 113 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 129, + 130 + ], + [ + 131, + 132 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 138, + 139 + ], + [ + 140, + 142 + ], + [ + 143, + 144 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 155, + 156 + ], + [ + 157, + 158 + ] + ] + } + }, + { + "filename": "libvips/include/vips/memory.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 37, + 99 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 40, + 73 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 84, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ] + ] + } + }, + { + "filename": "libvips/include/vips/morphology.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 45, + 70 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 48, + 50 + ], + [ + 52, + 54 + ], + [ + 56, + 57 + ], + [ + 59, + 61 + ], + [ + 63, + 64 + ], + [ + 66, + 67 + ] + ] + } + }, + { + "filename": "libvips/include/vips/mosaicing.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 39, + 78 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 44 + ], + [ + 46, + 48 + ], + [ + 51, + 55 + ], + [ + 58, + 61 + ], + [ + 64, + 65 + ], + [ + 67, + 69 + ], + [ + 72, + 73 + ] + ] + } + }, + { + "filename": "libvips/include/vips/object.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 43, + 61 + ], + [ + 85, + 271 + ], + [ + 279, + 287 + ], + [ + 303, + 310 + ], + [ + 317, + 379 + ], + [ + 386, + 393 + ], + [ + 394, + 448 + ], + [ + 466, + 473 + ], + [ + 476, + 482 + ], + [ + 484, + 533 + ], + [ + 537, + 549 + ], + [ + 553, + 563 + ], + [ + 566, + 579 + ], + [ + 584, + 634 + ], + [ + 635, + 724 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 46, + 54 + ], + [ + 55, + 56 + ], + [ + 57, + 58 + ], + [ + 88, + 89 + ], + [ + 95, + 97 + ], + [ + 100, + 101 + ], + [ + 104, + 106 + ], + [ + 109, + 263 + ], + [ + 267, + 268 + ], + [ + 282, + 284 + ], + [ + 306, + 307 + ], + [ + 320, + 326 + ], + [ + 327, + 329 + ], + [ + 330, + 333 + ], + [ + 334, + 335 + ], + [ + 336, + 338 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 348, + 350 + ], + [ + 351, + 352 + ], + [ + 357, + 376 + ], + [ + 389, + 390 + ], + [ + 397, + 398 + ], + [ + 399, + 404 + ], + [ + 405, + 407 + ], + [ + 409, + 412 + ], + [ + 414, + 417 + ], + [ + 419, + 421 + ], + [ + 422, + 424 + ], + [ + 425, + 426 + ], + [ + 429, + 430 + ], + [ + 432, + 433 + ], + [ + 435, + 445 + ], + [ + 469, + 470 + ], + [ + 487, + 488 + ], + [ + 489, + 490 + ], + [ + 491, + 492 + ], + [ + 496, + 497 + ], + [ + 500, + 501 + ], + [ + 502, + 503 + ], + [ + 506, + 507 + ], + [ + 508, + 509 + ], + [ + 511, + 512 + ], + [ + 516, + 517 + ], + [ + 520, + 521 + ], + [ + 524, + 525 + ], + [ + 529, + 530 + ], + [ + 540, + 541 + ], + [ + 543, + 544 + ], + [ + 545, + 546 + ], + [ + 556, + 557 + ], + [ + 559, + 560 + ], + [ + 569, + 570 + ], + [ + 575, + 576 + ], + [ + 587, + 588 + ], + [ + 593, + 597 + ], + [ + 600, + 601 + ], + [ + 602, + 604 + ], + [ + 605, + 607 + ], + [ + 609, + 610 + ], + [ + 611, + 612 + ], + [ + 614, + 615 + ], + [ + 616, + 617 + ], + [ + 618, + 619 + ], + [ + 621, + 622 + ], + [ + 623, + 624 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 630, + 631 + ], + [ + 638, + 641 + ], + [ + 642, + 644 + ], + [ + 645, + 647 + ], + [ + 648, + 650 + ], + [ + 651, + 652 + ], + [ + 653, + 654 + ], + [ + 655, + 657 + ], + [ + 659, + 660 + ], + [ + 661, + 662 + ], + [ + 664, + 665 + ], + [ + 667, + 669 + ], + [ + 670, + 671 + ], + [ + 673, + 674 + ], + [ + 675, + 678 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 683, + 684 + ], + [ + 685, + 686 + ], + [ + 687, + 688 + ], + [ + 690, + 691 + ], + [ + 692, + 694 + ], + [ + 696, + 697 + ], + [ + 699, + 702 + ], + [ + 704, + 705 + ], + [ + 706, + 707 + ], + [ + 708, + 709 + ], + [ + 711, + 712 + ], + [ + 714, + 715 + ], + [ + 717, + 718 + ] + ] + } + }, + { + "filename": "libvips/include/vips/operation.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 52, + 73 + ], + [ + 87, + 104 + ], + [ + 106, + 180 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 55, + 70 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 100, + 101 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 126, + 127 + ], + [ + 128, + 130 + ], + [ + 132, + 133 + ], + [ + 134, + 135 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 155, + 156 + ], + [ + 157, + 158 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 163, + 164 + ], + [ + 165, + 166 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ] + ] + } + }, + { + "filename": "libvips/include/vips/private.h", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 42, + 54 + ], + [ + 60, + 91 + ], + [ + 92, + 141 + ], + [ + 143, + 156 + ], + [ + 163, + 191 + ], + [ + 192, + 225 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 27 + ], + [ + 32, + 33 + ], + [ + 45, + 46 + ], + [ + 50, + 51 + ], + [ + 63, + 65 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 70, + 72 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 82, + 84 + ], + [ + 87, + 88 + ], + [ + 95, + 97 + ], + [ + 99, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 109, + 117 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 130, + 131 + ], + [ + 132, + 134 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 146, + 150 + ], + [ + 152, + 153 + ], + [ + 166, + 168 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 175, + 177 + ], + [ + 178, + 180 + ], + [ + 184, + 185 + ], + [ + 187, + 188 + ], + [ + 195, + 197 + ], + [ + 202, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 208 + ], + [ + 210, + 211 + ], + [ + 214, + 215 + ], + [ + 221, + 222 + ] + ] + } + }, + { + "filename": "libvips/include/vips/rect.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 51, + 78 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 58, + 59 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 64, + 65 + ], + [ + 66, + 68 + ], + [ + 69, + 71 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ] + ] + } + }, + { + "filename": "libvips/include/vips/region.h", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 48, + 67 + ], + [ + 93, + 109 + ], + [ + 120, + 127 + ], + [ + 134, + 235 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 32, + 33 + ], + [ + 51, + 64 + ], + [ + 96, + 98 + ], + [ + 102, + 106 + ], + [ + 123, + 124 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 146 + ], + [ + 147, + 148 + ], + [ + 149, + 150 + ], + [ + 152, + 153 + ], + [ + 154, + 156 + ], + [ + 157, + 158 + ], + [ + 159, + 161 + ], + [ + 162, + 164 + ], + [ + 165, + 167 + ], + [ + 169, + 170 + ], + [ + 171, + 173 + ], + [ + 175, + 177 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 183, + 184 + ], + [ + 189, + 190 + ], + [ + 191, + 192 + ], + [ + 194, + 204 + ], + [ + 208, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 229 + ], + [ + 231, + 232 + ] + ] + } + }, + { + "filename": "libvips/include/vips/resample.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 57, + 120 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 62 + ], + [ + 64, + 65 + ], + [ + 67, + 68 + ], + [ + 71, + 73 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 82, + 83 + ], + [ + 85, + 87 + ], + [ + 89, + 90 + ], + [ + 92, + 94 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 103, + 105 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ] + ] + } + }, + { + "filename": "libvips/include/vips/sbuf.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 42, + 66 + ], + [ + 96, + 137 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 45, + 58 + ], + [ + 62, + 63 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 105, + 106 + ], + [ + 108, + 111 + ], + [ + 112, + 118 + ], + [ + 120, + 125 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 131, + 132 + ], + [ + 133, + 134 + ] + ] + } + }, + { + "filename": "libvips/include/vips/semaphore.h", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 56, + 73 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 63, + 64 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ] + ] + } + }, + { + "filename": "libvips/include/vips/thread.h", + "line_filter": { + "diff_chunks": [ + [ + 4, + 32 + ], + [ + 40, + 72 + ] + ], + "lines_added": [ + [ + 7, + 23 + ], + [ + 28, + 29 + ], + [ + 43, + 44 + ], + [ + 45, + 46 + ], + [ + 50, + 51 + ], + [ + 52, + 53 + ], + [ + 57, + 58 + ], + [ + 59, + 60 + ], + [ + 62, + 63 + ], + [ + 65, + 69 + ] + ] + } + }, + { + "filename": "libvips/include/vips/threadpool.h", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 51, + 75 + ], + [ + 79, + 88 + ], + [ + 94, + 101 + ], + [ + 110, + 117 + ], + [ + 118, + 157 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 59, + 72 + ], + [ + 82, + 83 + ], + [ + 84, + 85 + ], + [ + 97, + 98 + ], + [ + 113, + 114 + ], + [ + 121, + 122 + ], + [ + 125, + 126 + ], + [ + 128, + 129 + ], + [ + 131, + 133 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 142, + 143 + ], + [ + 145, + 148 + ], + [ + 150, + 151 + ], + [ + 152, + 154 + ] + ] + } + }, + { + "filename": "libvips/include/vips/transform.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 42, + 52 + ], + [ + 54, + 87 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 45, + 47 + ], + [ + 48, + 49 + ], + [ + 57, + 58 + ], + [ + 61, + 62 + ], + [ + 64, + 84 + ] + ] + } + }, + { + "filename": "libvips/include/vips/type.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 53, + 66 + ], + [ + 68, + 83 + ], + [ + 94, + 130 + ], + [ + 132, + 139 + ], + [ + 152, + 166 + ], + [ + 170, + 190 + ], + [ + 194, + 210 + ], + [ + 214, + 230 + ], + [ + 234, + 241 + ], + [ + 245, + 301 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 56, + 57 + ], + [ + 62, + 63 + ], + [ + 71, + 72 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 112 + ], + [ + 114, + 124 + ], + [ + 125, + 127 + ], + [ + 135, + 136 + ], + [ + 155, + 156 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 173, + 174 + ], + [ + 178, + 180 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 185, + 187 + ], + [ + 197, + 198 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 217, + 218 + ], + [ + 222, + 223 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 237, + 238 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 257, + 259 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 266, + 267 + ], + [ + 268, + 270 + ], + [ + 271, + 272 + ], + [ + 274, + 276 + ], + [ + 277, + 279 + ], + [ + 281, + 282 + ], + [ + 283, + 284 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 295, + 298 + ] + ] + } + }, + { + "filename": "libvips/include/vips/util.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 7, + 35 + ], + [ + 46, + 250 + ], + [ + 251, + 372 + ], + [ + 374, + 381 + ], + [ + 383, + 439 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 10, + 11 + ], + [ + 12, + 16 + ], + [ + 17, + 26 + ], + [ + 31, + 32 + ], + [ + 49, + 50 + ], + [ + 51, + 53 + ], + [ + 54, + 56 + ], + [ + 57, + 59 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 68, + 76 + ], + [ + 77, + 85 + ], + [ + 89, + 96 + ], + [ + 100, + 101 + ], + [ + 102, + 104 + ], + [ + 107, + 118 + ], + [ + 121, + 163 + ], + [ + 165, + 166 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 178, + 247 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 269, + 271 + ], + [ + 272, + 274 + ], + [ + 275, + 276 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 282, + 284 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ], + [ + 292, + 293 + ], + [ + 294, + 295 + ], + [ + 296, + 297 + ], + [ + 298, + 299 + ], + [ + 301, + 302 + ], + [ + 303, + 305 + ], + [ + 307, + 308 + ], + [ + 310, + 311 + ], + [ + 314, + 315 + ], + [ + 319, + 322 + ], + [ + 323, + 327 + ], + [ + 330, + 334 + ], + [ + 337, + 340 + ], + [ + 341, + 346 + ], + [ + 347, + 348 + ], + [ + 351, + 353 + ], + [ + 354, + 356 + ], + [ + 357, + 359 + ], + [ + 360, + 362 + ], + [ + 363, + 365 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 377, + 378 + ], + [ + 386, + 387 + ], + [ + 393, + 404 + ], + [ + 407, + 409 + ], + [ + 411, + 412 + ], + [ + 413, + 414 + ], + [ + 418, + 419 + ], + [ + 420, + 422 + ], + [ + 424, + 425 + ], + [ + 426, + 428 + ], + [ + 429, + 431 + ], + [ + 432, + 433 + ], + [ + 435, + 436 + ] + ] + } + }, + { + "filename": "libvips/include/vips/vector.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 59, + 66 + ], + [ + 67, + 74 + ], + [ + 81, + 88 + ], + [ + 92, + 101 + ], + [ + 117, + 181 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 62, + 63 + ], + [ + 70, + 71 + ], + [ + 84, + 85 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 132, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 148 + ], + [ + 149, + 151 + ], + [ + 152, + 153 + ], + [ + 155, + 156 + ], + [ + 158, + 159 + ], + [ + 161, + 163 + ], + [ + 164, + 166 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 177, + 178 + ] + ] + } + }, + { + "filename": "libvips/include/vips/video.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 39, + 50 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 43 + ], + [ + 44, + 45 + ], + [ + 46, + 47 + ] + ] + } + }, + { + "filename": "libvips/include/vips/vips.h", + "line_filter": { + "diff_chunks": [ + [ + 52, + 80 + ], + [ + 145, + 193 + ] + ], + "lines_added": [ + [ + 55, + 71 + ], + [ + 76, + 77 + ], + [ + 148, + 160 + ], + [ + 162, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ] + ] + } + }, + { + "filename": "libvips/include/vips/vips7compat.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 43, + 90 + ], + [ + 213, + 284 + ], + [ + 291, + 298 + ], + [ + 299, + 379 + ], + [ + 396, + 408 + ], + [ + 412, + 546 + ], + [ + 553, + 581 + ], + [ + 655, + 1062 + ], + [ + 1063, + 1177 + ], + [ + 1182, + 1579 + ], + [ + 1581, + 1590 + ], + [ + 1612, + 1659 + ], + [ + 1668, + 1671 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 46, + 47 + ], + [ + 48, + 51 + ], + [ + 52, + 55 + ], + [ + 56, + 59 + ], + [ + 60, + 63 + ], + [ + 64, + 67 + ], + [ + 68, + 71 + ], + [ + 72, + 75 + ], + [ + 76, + 79 + ], + [ + 80, + 83 + ], + [ + 84, + 87 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 221, + 223 + ], + [ + 229, + 233 + ], + [ + 236, + 237 + ], + [ + 241, + 242 + ], + [ + 246, + 247 + ], + [ + 251, + 252 + ], + [ + 256, + 257 + ], + [ + 261, + 262 + ], + [ + 266, + 267 + ], + [ + 268, + 270 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 276, + 277 + ], + [ + 280, + 281 + ], + [ + 294, + 295 + ], + [ + 302, + 303 + ], + [ + 305, + 306 + ], + [ + 308, + 310 + ], + [ + 311, + 313 + ], + [ + 317, + 319 + ], + [ + 320, + 341 + ], + [ + 342, + 344 + ], + [ + 345, + 347 + ], + [ + 349, + 350 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 362, + 363 + ], + [ + 364, + 365 + ], + [ + 367, + 368 + ], + [ + 369, + 370 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 375, + 376 + ], + [ + 399, + 400 + ], + [ + 402, + 403 + ], + [ + 404, + 405 + ], + [ + 415, + 426 + ], + [ + 430, + 457 + ], + [ + 458, + 462 + ], + [ + 464, + 465 + ], + [ + 467, + 505 + ], + [ + 510, + 512 + ], + [ + 513, + 515 + ], + [ + 516, + 518 + ], + [ + 519, + 521 + ], + [ + 522, + 524 + ], + [ + 525, + 527 + ], + [ + 528, + 535 + ], + [ + 541, + 543 + ], + [ + 556, + 557 + ], + [ + 558, + 559 + ], + [ + 563, + 564 + ], + [ + 568, + 569 + ], + [ + 570, + 571 + ], + [ + 572, + 573 + ], + [ + 574, + 575 + ], + [ + 576, + 578 + ], + [ + 658, + 659 + ], + [ + 660, + 661 + ], + [ + 662, + 663 + ], + [ + 664, + 665 + ], + [ + 666, + 667 + ], + [ + 668, + 669 + ], + [ + 670, + 671 + ], + [ + 672, + 673 + ], + [ + 674, + 675 + ], + [ + 676, + 677 + ], + [ + 678, + 679 + ], + [ + 680, + 681 + ], + [ + 682, + 683 + ], + [ + 684, + 685 + ], + [ + 686, + 687 + ], + [ + 688, + 689 + ], + [ + 690, + 694 + ], + [ + 696, + 697 + ], + [ + 698, + 699 + ], + [ + 700, + 701 + ], + [ + 702, + 703 + ], + [ + 704, + 705 + ], + [ + 706, + 707 + ], + [ + 708, + 709 + ], + [ + 710, + 711 + ], + [ + 712, + 713 + ], + [ + 714, + 715 + ], + [ + 717, + 718 + ], + [ + 719, + 720 + ], + [ + 721, + 722 + ], + [ + 724, + 725 + ], + [ + 726, + 727 + ], + [ + 728, + 729 + ], + [ + 730, + 731 + ], + [ + 732, + 733 + ], + [ + 734, + 735 + ], + [ + 737, + 738 + ], + [ + 739, + 740 + ], + [ + 741, + 742 + ], + [ + 743, + 744 + ], + [ + 745, + 746 + ], + [ + 747, + 748 + ], + [ + 749, + 750 + ], + [ + 751, + 752 + ], + [ + 753, + 754 + ], + [ + 756, + 757 + ], + [ + 758, + 759 + ], + [ + 760, + 761 + ], + [ + 762, + 763 + ], + [ + 765, + 766 + ], + [ + 767, + 768 + ], + [ + 769, + 770 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ], + [ + 776, + 777 + ], + [ + 778, + 779 + ], + [ + 781, + 782 + ], + [ + 783, + 784 + ], + [ + 785, + 786 + ], + [ + 787, + 788 + ], + [ + 789, + 790 + ], + [ + 791, + 792 + ], + [ + 793, + 794 + ], + [ + 795, + 796 + ], + [ + 797, + 798 + ], + [ + 799, + 800 + ], + [ + 801, + 802 + ], + [ + 803, + 804 + ], + [ + 806, + 807 + ], + [ + 808, + 809 + ], + [ + 811, + 812 + ], + [ + 814, + 815 + ], + [ + 817, + 818 + ], + [ + 820, + 822 + ], + [ + 823, + 825 + ], + [ + 827, + 828 + ], + [ + 829, + 832 + ], + [ + 833, + 835 + ], + [ + 836, + 838 + ], + [ + 839, + 840 + ], + [ + 841, + 842 + ], + [ + 843, + 844 + ], + [ + 845, + 847 + ], + [ + 848, + 849 + ], + [ + 850, + 851 + ], + [ + 852, + 853 + ], + [ + 854, + 855 + ], + [ + 856, + 857 + ], + [ + 858, + 859 + ], + [ + 860, + 862 + ], + [ + 863, + 864 + ], + [ + 865, + 866 + ], + [ + 867, + 869 + ], + [ + 870, + 871 + ], + [ + 872, + 873 + ], + [ + 874, + 875 + ], + [ + 876, + 877 + ], + [ + 878, + 879 + ], + [ + 880, + 881 + ], + [ + 882, + 883 + ], + [ + 884, + 885 + ], + [ + 886, + 887 + ], + [ + 888, + 889 + ], + [ + 890, + 891 + ], + [ + 892, + 893 + ], + [ + 894, + 895 + ], + [ + 896, + 897 + ], + [ + 898, + 899 + ], + [ + 901, + 902 + ], + [ + 903, + 905 + ], + [ + 906, + 907 + ], + [ + 908, + 909 + ], + [ + 910, + 911 + ], + [ + 912, + 913 + ], + [ + 914, + 916 + ], + [ + 917, + 919 + ], + [ + 920, + 921 + ], + [ + 922, + 923 + ], + [ + 924, + 926 + ], + [ + 927, + 928 + ], + [ + 929, + 930 + ], + [ + 931, + 932 + ], + [ + 933, + 934 + ], + [ + 936, + 937 + ], + [ + 939, + 940 + ], + [ + 941, + 942 + ], + [ + 943, + 944 + ], + [ + 946, + 947 + ], + [ + 948, + 951 + ], + [ + 953, + 954 + ], + [ + 955, + 956 + ], + [ + 957, + 958 + ], + [ + 959, + 960 + ], + [ + 961, + 962 + ], + [ + 964, + 965 + ], + [ + 966, + 967 + ], + [ + 968, + 969 + ], + [ + 971, + 972 + ], + [ + 973, + 974 + ], + [ + 976, + 977 + ], + [ + 978, + 979 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 985, + 986 + ], + [ + 987, + 988 + ], + [ + 990, + 991 + ], + [ + 993, + 994 + ], + [ + 995, + 996 + ], + [ + 998, + 1000 + ], + [ + 1002, + 1003 + ], + [ + 1004, + 1005 + ], + [ + 1006, + 1008 + ], + [ + 1009, + 1011 + ], + [ + 1012, + 1014 + ], + [ + 1016, + 1017 + ], + [ + 1018, + 1019 + ], + [ + 1020, + 1021 + ], + [ + 1022, + 1024 + ], + [ + 1025, + 1026 + ], + [ + 1027, + 1028 + ], + [ + 1029, + 1030 + ], + [ + 1031, + 1032 + ], + [ + 1033, + 1034 + ], + [ + 1035, + 1036 + ], + [ + 1037, + 1038 + ], + [ + 1039, + 1040 + ], + [ + 1041, + 1042 + ], + [ + 1043, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1047, + 1048 + ], + [ + 1049, + 1050 + ], + [ + 1051, + 1052 + ], + [ + 1053, + 1054 + ], + [ + 1056, + 1057 + ], + [ + 1058, + 1059 + ], + [ + 1066, + 1067 + ], + [ + 1068, + 1069 + ], + [ + 1071, + 1072 + ], + [ + 1073, + 1074 + ], + [ + 1080, + 1081 + ], + [ + 1083, + 1084 + ], + [ + 1088, + 1090 + ], + [ + 1091, + 1092 + ], + [ + 1093, + 1095 + ], + [ + 1096, + 1097 + ], + [ + 1099, + 1100 + ], + [ + 1101, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1105, + 1106 + ], + [ + 1107, + 1108 + ], + [ + 1110, + 1111 + ], + [ + 1112, + 1113 + ], + [ + 1114, + 1115 + ], + [ + 1116, + 1117 + ], + [ + 1119, + 1120 + ], + [ + 1122, + 1123 + ], + [ + 1127, + 1128 + ], + [ + 1130, + 1131 + ], + [ + 1132, + 1133 + ], + [ + 1134, + 1135 + ], + [ + 1136, + 1137 + ], + [ + 1138, + 1139 + ], + [ + 1140, + 1141 + ], + [ + 1142, + 1143 + ], + [ + 1144, + 1145 + ], + [ + 1146, + 1147 + ], + [ + 1148, + 1149 + ], + [ + 1150, + 1151 + ], + [ + 1152, + 1153 + ], + [ + 1154, + 1155 + ], + [ + 1156, + 1157 + ], + [ + 1158, + 1159 + ], + [ + 1160, + 1162 + ], + [ + 1163, + 1164 + ], + [ + 1165, + 1166 + ], + [ + 1167, + 1168 + ], + [ + 1170, + 1172 + ], + [ + 1173, + 1174 + ], + [ + 1185, + 1186 + ], + [ + 1187, + 1188 + ], + [ + 1190, + 1192 + ], + [ + 1193, + 1194 + ], + [ + 1195, + 1196 + ], + [ + 1198, + 1200 + ], + [ + 1202, + 1203 + ], + [ + 1204, + 1205 + ], + [ + 1207, + 1208 + ], + [ + 1209, + 1210 + ], + [ + 1211, + 1212 + ], + [ + 1214, + 1215 + ], + [ + 1217, + 1219 + ], + [ + 1220, + 1222 + ], + [ + 1224, + 1225 + ], + [ + 1226, + 1227 + ], + [ + 1229, + 1230 + ], + [ + 1231, + 1232 + ], + [ + 1233, + 1234 + ], + [ + 1236, + 1240 + ], + [ + 1242, + 1264 + ], + [ + 1268, + 1287 + ], + [ + 1291, + 1292 + ], + [ + 1293, + 1295 + ], + [ + 1297, + 1298 + ], + [ + 1299, + 1300 + ], + [ + 1301, + 1302 + ], + [ + 1304, + 1305 + ], + [ + 1306, + 1307 + ], + [ + 1308, + 1309 + ], + [ + 1310, + 1311 + ], + [ + 1313, + 1314 + ], + [ + 1315, + 1316 + ], + [ + 1317, + 1318 + ], + [ + 1319, + 1320 + ], + [ + 1322, + 1323 + ], + [ + 1324, + 1325 + ], + [ + 1327, + 1329 + ], + [ + 1331, + 1333 + ], + [ + 1334, + 1335 + ], + [ + 1336, + 1338 + ], + [ + 1339, + 1341 + ], + [ + 1343, + 1346 + ], + [ + 1347, + 1349 + ], + [ + 1350, + 1352 + ], + [ + 1354, + 1355 + ], + [ + 1357, + 1358 + ], + [ + 1359, + 1361 + ], + [ + 1362, + 1364 + ], + [ + 1366, + 1367 + ], + [ + 1368, + 1369 + ], + [ + 1371, + 1373 + ], + [ + 1375, + 1376 + ], + [ + 1377, + 1378 + ], + [ + 1379, + 1380 + ], + [ + 1381, + 1382 + ], + [ + 1383, + 1384 + ], + [ + 1385, + 1386 + ], + [ + 1388, + 1389 + ], + [ + 1390, + 1391 + ], + [ + 1392, + 1393 + ], + [ + 1395, + 1396 + ], + [ + 1398, + 1399 + ], + [ + 1400, + 1401 + ], + [ + 1403, + 1405 + ], + [ + 1407, + 1409 + ], + [ + 1410, + 1411 + ], + [ + 1413, + 1414 + ], + [ + 1415, + 1417 + ], + [ + 1418, + 1419 + ], + [ + 1421, + 1422 + ], + [ + 1424, + 1425 + ], + [ + 1429, + 1430 + ], + [ + 1431, + 1432 + ], + [ + 1433, + 1434 + ], + [ + 1437, + 1438 + ], + [ + 1439, + 1440 + ], + [ + 1441, + 1442 + ], + [ + 1444, + 1445 + ], + [ + 1446, + 1447 + ], + [ + 1452, + 1453 + ], + [ + 1455, + 1456 + ], + [ + 1458, + 1459 + ], + [ + 1461, + 1462 + ], + [ + 1463, + 1464 + ], + [ + 1465, + 1467 + ], + [ + 1468, + 1469 + ], + [ + 1473, + 1474 + ], + [ + 1475, + 1477 + ], + [ + 1478, + 1479 + ], + [ + 1480, + 1481 + ], + [ + 1482, + 1484 + ], + [ + 1486, + 1487 + ], + [ + 1488, + 1489 + ], + [ + 1490, + 1492 + ], + [ + 1494, + 1495 + ], + [ + 1496, + 1498 + ], + [ + 1500, + 1501 + ], + [ + 1503, + 1504 + ], + [ + 1505, + 1506 + ], + [ + 1508, + 1509 + ], + [ + 1511, + 1512 + ], + [ + 1513, + 1514 + ], + [ + 1516, + 1517 + ], + [ + 1518, + 1519 + ], + [ + 1520, + 1522 + ], + [ + 1524, + 1525 + ], + [ + 1526, + 1527 + ], + [ + 1529, + 1531 + ], + [ + 1532, + 1533 + ], + [ + 1535, + 1536 + ], + [ + 1538, + 1539 + ], + [ + 1540, + 1541 + ], + [ + 1543, + 1544 + ], + [ + 1545, + 1546 + ], + [ + 1548, + 1549 + ], + [ + 1550, + 1556 + ], + [ + 1557, + 1558 + ], + [ + 1559, + 1562 + ], + [ + 1564, + 1576 + ], + [ + 1584, + 1585 + ], + [ + 1586, + 1587 + ], + [ + 1615, + 1616 + ], + [ + 1618, + 1619 + ], + [ + 1620, + 1621 + ], + [ + 1623, + 1627 + ], + [ + 1629, + 1630 + ], + [ + 1631, + 1632 + ], + [ + 1633, + 1634 + ], + [ + 1636, + 1637 + ], + [ + 1641, + 1642 + ], + [ + 1644, + 1646 + ], + [ + 1647, + 1649 + ], + [ + 1650, + 1652 + ], + [ + 1653, + 1654 + ], + [ + 1655, + 1656 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/buf.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 52, + 60 + ], + [ + 73, + 80 + ], + [ + 92, + 105 + ], + [ + 109, + 121 + ], + [ + 125, + 141 + ], + [ + 144, + 160 + ], + [ + 170, + 188 + ], + [ + 193, + 218 + ], + [ + 221, + 233 + ], + [ + 234, + 244 + ], + [ + 249, + 276 + ], + [ + 277, + 284 + ], + [ + 286, + 304 + ], + [ + 305, + 319 + ], + [ + 320, + 339 + ], + [ + 342, + 383 + ], + [ + 385, + 405 + ], + [ + 412, + 439 + ], + [ + 442, + 481 + ], + [ + 484, + 500 + ], + [ + 505, + 520 + ], + [ + 521, + 648 + ], + [ + 651, + 666 + ], + [ + 669, + 701 + ], + [ + 702, + 734 + ], + [ + 735, + 754 + ], + [ + 757, + 766 + ], + [ + 769, + 778 + ], + [ + 781, + 788 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 55, + 57 + ], + [ + 76, + 77 + ], + [ + 95, + 96 + ], + [ + 101, + 102 + ], + [ + 112, + 113 + ], + [ + 117, + 118 + ], + [ + 128, + 129 + ], + [ + 130, + 132 + ], + [ + 134, + 135 + ], + [ + 137, + 138 + ], + [ + 147, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 156, + 157 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 181, + 182 + ], + [ + 183, + 185 + ], + [ + 196, + 197 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 208 + ], + [ + 214, + 215 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 229, + 230 + ], + [ + 237, + 238 + ], + [ + 239, + 241 + ], + [ + 252, + 253 + ], + [ + 256, + 257 + ], + [ + 263, + 267 + ], + [ + 270, + 273 + ], + [ + 280, + 281 + ], + [ + 289, + 290 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 300, + 301 + ], + [ + 308, + 310 + ], + [ + 313, + 314 + ], + [ + 315, + 316 + ], + [ + 323, + 325 + ], + [ + 328, + 329 + ], + [ + 335, + 336 + ], + [ + 345, + 346 + ], + [ + 349, + 350 + ], + [ + 351, + 353 + ], + [ + 355, + 358 + ], + [ + 359, + 360 + ], + [ + 364, + 366 + ], + [ + 367, + 368 + ], + [ + 371, + 373 + ], + [ + 376, + 377 + ], + [ + 379, + 380 + ], + [ + 388, + 389 + ], + [ + 392, + 393 + ], + [ + 394, + 399 + ], + [ + 401, + 402 + ], + [ + 415, + 416 + ], + [ + 420, + 422 + ], + [ + 425, + 427 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 432, + 433 + ], + [ + 435, + 436 + ], + [ + 445, + 446 + ], + [ + 449, + 450 + ], + [ + 454, + 457 + ], + [ + 458, + 459 + ], + [ + 465, + 466 + ], + [ + 467, + 468 + ], + [ + 471, + 472 + ], + [ + 475, + 476 + ], + [ + 477, + 478 + ], + [ + 487, + 488 + ], + [ + 491, + 492 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 508, + 509 + ], + [ + 513, + 514 + ], + [ + 515, + 517 + ], + [ + 524, + 526 + ], + [ + 528, + 529 + ], + [ + 531, + 533 + ], + [ + 534, + 535 + ], + [ + 536, + 537 + ], + [ + 539, + 542 + ], + [ + 545, + 546 + ], + [ + 548, + 550 + ], + [ + 554, + 556 + ], + [ + 560, + 562 + ], + [ + 566, + 568 + ], + [ + 572, + 574 + ], + [ + 577, + 579 + ], + [ + 583, + 584 + ], + [ + 585, + 588 + ], + [ + 592, + 593 + ], + [ + 595, + 596 + ], + [ + 601, + 603 + ], + [ + 605, + 606 + ], + [ + 610, + 613 + ], + [ + 615, + 616 + ], + [ + 620, + 623 + ], + [ + 625, + 626 + ], + [ + 630, + 633 + ], + [ + 635, + 636 + ], + [ + 640, + 645 + ], + [ + 654, + 655 + ], + [ + 657, + 660 + ], + [ + 662, + 663 + ], + [ + 672, + 673 + ], + [ + 676, + 677 + ], + [ + 678, + 679 + ], + [ + 681, + 682 + ], + [ + 685, + 686 + ], + [ + 689, + 690 + ], + [ + 693, + 694 + ], + [ + 697, + 698 + ], + [ + 705, + 706 + ], + [ + 708, + 709 + ], + [ + 711, + 714 + ], + [ + 720, + 722 + ], + [ + 723, + 724 + ], + [ + 726, + 727 + ], + [ + 730, + 731 + ], + [ + 738, + 739 + ], + [ + 740, + 741 + ], + [ + 743, + 744 + ], + [ + 747, + 748 + ], + [ + 750, + 751 + ], + [ + 760, + 761 + ], + [ + 762, + 763 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ], + [ + 784, + 785 + ], + [ + 786, + 787 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/buffer.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 8, + 15 + ], + [ + 18, + 25 + ], + [ + 29, + 57 + ], + [ + 79, + 279 + ], + [ + 281, + 418 + ], + [ + 421, + 520 + ], + [ + 522, + 690 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 11, + 12 + ], + [ + 21, + 22 + ], + [ + 32, + 33 + ], + [ + 34, + 38 + ], + [ + 39, + 48 + ], + [ + 53, + 54 + ], + [ + 82, + 83 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 95, + 96 + ], + [ + 97, + 107 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 115, + 117 + ], + [ + 118, + 120 + ], + [ + 122, + 124 + ], + [ + 127, + 128 + ], + [ + 129, + 132 + ], + [ + 133, + 135 + ], + [ + 138, + 139 + ], + [ + 141, + 143 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 156, + 157 + ], + [ + 158, + 166 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 177, + 178 + ], + [ + 181, + 185 + ], + [ + 188, + 194 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 213 + ], + [ + 216, + 217 + ], + [ + 221, + 222 + ], + [ + 223, + 225 + ], + [ + 227, + 228 + ], + [ + 230, + 231 + ], + [ + 235, + 244 + ], + [ + 249, + 250 + ], + [ + 252, + 254 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 271, + 272 + ], + [ + 275, + 276 + ], + [ + 284, + 293 + ], + [ + 295, + 296 + ], + [ + 299, + 300 + ], + [ + 303, + 307 + ], + [ + 309, + 310 + ], + [ + 315, + 316 + ], + [ + 319, + 320 + ], + [ + 321, + 323 + ], + [ + 324, + 325 + ], + [ + 326, + 327 + ], + [ + 329, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 335 + ], + [ + 336, + 337 + ], + [ + 342, + 343 + ], + [ + 347, + 352 + ], + [ + 354, + 355 + ], + [ + 359, + 360 + ], + [ + 364, + 366 + ], + [ + 370, + 374 + ], + [ + 378, + 379 + ], + [ + 381, + 385 + ], + [ + 389, + 390 + ], + [ + 392, + 393 + ], + [ + 394, + 395 + ], + [ + 398, + 401 + ], + [ + 403, + 408 + ], + [ + 409, + 410 + ], + [ + 413, + 415 + ], + [ + 424, + 425 + ], + [ + 427, + 432 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 442, + 444 + ], + [ + 446, + 447 + ], + [ + 450, + 453 + ], + [ + 454, + 457 + ], + [ + 462, + 464 + ], + [ + 468, + 469 + ], + [ + 473, + 474 + ], + [ + 475, + 477 + ], + [ + 480, + 481 + ], + [ + 482, + 484 + ], + [ + 485, + 488 + ], + [ + 490, + 491 + ], + [ + 496, + 497 + ], + [ + 501, + 503 + ], + [ + 504, + 506 + ], + [ + 507, + 510 + ], + [ + 516, + 517 + ], + [ + 525, + 529 + ], + [ + 532, + 535 + ], + [ + 537, + 538 + ], + [ + 541, + 542 + ], + [ + 544, + 545 + ], + [ + 551, + 553 + ], + [ + 555, + 556 + ], + [ + 559, + 560 + ], + [ + 561, + 562 + ], + [ + 565, + 566 + ], + [ + 568, + 569 + ], + [ + 572, + 576 + ], + [ + 577, + 578 + ], + [ + 580, + 581 + ], + [ + 584, + 585 + ], + [ + 588, + 589 + ], + [ + 591, + 592 + ], + [ + 595, + 597 + ], + [ + 598, + 599 + ], + [ + 605, + 606 + ], + [ + 609, + 611 + ], + [ + 614, + 617 + ], + [ + 620, + 623 + ], + [ + 627, + 632 + ], + [ + 634, + 635 + ], + [ + 639, + 642 + ], + [ + 643, + 644 + ], + [ + 647, + 648 + ], + [ + 652, + 654 + ], + [ + 655, + 656 + ], + [ + 661, + 662 + ], + [ + 663, + 665 + ], + [ + 668, + 670 + ], + [ + 672, + 673 + ], + [ + 676, + 677 + ], + [ + 681, + 682 + ], + [ + 685, + 688 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/cache.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 73, + 83 + ], + [ + 132, + 377 + ], + [ + 380, + 498 + ], + [ + 501, + 657 + ], + [ + 658, + 693 + ], + [ + 696, + 881 + ], + [ + 884, + 928 + ], + [ + 937, + 968 + ], + [ + 969, + 988 + ], + [ + 990, + 1027 + ], + [ + 1029, + 1043 + ], + [ + 1045, + 1063 + ], + [ + 1066, + 1076 + ], + [ + 1081, + 1108 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 135, + 136 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 148, + 170 + ], + [ + 171, + 173 + ], + [ + 174, + 175 + ], + [ + 176, + 178 + ], + [ + 179, + 180 + ], + [ + 181, + 183 + ], + [ + 184, + 185 + ], + [ + 186, + 188 + ], + [ + 189, + 190 + ], + [ + 191, + 193 + ], + [ + 194, + 195 + ], + [ + 196, + 198 + ], + [ + 199, + 200 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 209 + ], + [ + 214, + 216 + ], + [ + 217, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 231, + 233 + ], + [ + 235, + 237 + ], + [ + 238, + 241 + ], + [ + 242, + 244 + ], + [ + 249, + 294 + ], + [ + 295, + 296 + ], + [ + 297, + 306 + ], + [ + 307, + 309 + ], + [ + 315, + 318 + ], + [ + 319, + 326 + ], + [ + 327, + 329 + ], + [ + 330, + 331 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 343, + 344 + ], + [ + 345, + 356 + ], + [ + 358, + 359 + ], + [ + 364, + 365 + ], + [ + 366, + 367 + ], + [ + 371, + 374 + ], + [ + 383, + 384 + ], + [ + 387, + 388 + ], + [ + 391, + 392 + ], + [ + 395, + 403 + ], + [ + 408, + 409 + ], + [ + 410, + 412 + ], + [ + 416, + 418 + ], + [ + 421, + 422 + ], + [ + 423, + 430 + ], + [ + 433, + 434 + ], + [ + 438, + 440 + ], + [ + 441, + 443 + ], + [ + 444, + 449 + ], + [ + 450, + 451 + ], + [ + 454, + 455 + ], + [ + 458, + 461 + ], + [ + 462, + 463 + ], + [ + 466, + 467 + ], + [ + 470, + 471 + ], + [ + 474, + 475 + ], + [ + 479, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 489, + 490 + ], + [ + 491, + 495 + ], + [ + 504, + 505 + ], + [ + 506, + 507 + ], + [ + 510, + 511 + ], + [ + 514, + 515 + ], + [ + 518, + 519 + ], + [ + 520, + 521 + ], + [ + 523, + 524 + ], + [ + 528, + 530 + ], + [ + 534, + 536 + ], + [ + 538, + 539 + ], + [ + 542, + 543 + ], + [ + 545, + 547 + ], + [ + 549, + 552 + ], + [ + 557, + 558 + ], + [ + 560, + 561 + ], + [ + 563, + 565 + ], + [ + 567, + 568 + ], + [ + 569, + 571 + ], + [ + 574, + 576 + ], + [ + 577, + 578 + ], + [ + 581, + 582 + ], + [ + 585, + 586 + ], + [ + 587, + 588 + ], + [ + 590, + 591 + ], + [ + 595, + 597 + ], + [ + 599, + 600 + ], + [ + 603, + 604 + ], + [ + 606, + 607 + ], + [ + 613, + 614 + ], + [ + 617, + 619 + ], + [ + 621, + 622 + ], + [ + 624, + 626 + ], + [ + 628, + 632 + ], + [ + 635, + 637 + ], + [ + 639, + 641 + ], + [ + 647, + 648 + ], + [ + 649, + 650 + ], + [ + 652, + 654 + ], + [ + 661, + 663 + ], + [ + 667, + 669 + ], + [ + 672, + 673 + ], + [ + 674, + 675 + ], + [ + 680, + 681 + ], + [ + 684, + 688 + ], + [ + 689, + 690 + ], + [ + 699, + 700 + ], + [ + 702, + 703 + ], + [ + 705, + 706 + ], + [ + 707, + 708 + ], + [ + 710, + 711 + ], + [ + 717, + 719 + ], + [ + 720, + 721 + ], + [ + 723, + 724 + ], + [ + 727, + 729 + ], + [ + 730, + 732 + ], + [ + 735, + 736 + ], + [ + 740, + 741 + ], + [ + 745, + 747 + ], + [ + 748, + 750 + ], + [ + 751, + 752 + ], + [ + 757, + 758 + ], + [ + 761, + 762 + ], + [ + 763, + 768 + ], + [ + 769, + 771 + ], + [ + 773, + 774 + ], + [ + 776, + 777 + ], + [ + 783, + 784 + ], + [ + 789, + 790 + ], + [ + 794, + 796 + ], + [ + 798, + 800 + ], + [ + 802, + 803 + ], + [ + 806, + 810 + ], + [ + 812, + 813 + ], + [ + 816, + 820 + ], + [ + 823, + 824 + ], + [ + 827, + 828 + ], + [ + 830, + 831 + ], + [ + 833, + 834 + ], + [ + 840, + 841 + ], + [ + 843, + 844 + ], + [ + 845, + 846 + ], + [ + 847, + 848 + ], + [ + 850, + 852 + ], + [ + 854, + 855 + ], + [ + 858, + 861 + ], + [ + 865, + 868 + ], + [ + 869, + 871 + ], + [ + 873, + 875 + ], + [ + 877, + 878 + ], + [ + 887, + 888 + ], + [ + 894, + 895 + ], + [ + 898, + 899 + ], + [ + 901, + 903 + ], + [ + 905, + 906 + ], + [ + 907, + 908 + ], + [ + 910, + 911 + ], + [ + 915, + 916 + ], + [ + 918, + 920 + ], + [ + 921, + 922 + ], + [ + 924, + 925 + ], + [ + 940, + 941 + ], + [ + 946, + 947 + ], + [ + 948, + 950 + ], + [ + 951, + 952 + ], + [ + 954, + 955 + ], + [ + 961, + 962 + ], + [ + 964, + 965 + ], + [ + 972, + 973 + ], + [ + 979, + 980 + ], + [ + 981, + 982 + ], + [ + 984, + 985 + ], + [ + 993, + 994 + ], + [ + 998, + 999 + ], + [ + 1000, + 1001 + ], + [ + 1006, + 1007 + ], + [ + 1011, + 1012 + ], + [ + 1015, + 1016 + ], + [ + 1018, + 1020 + ], + [ + 1021, + 1022 + ], + [ + 1023, + 1024 + ], + [ + 1032, + 1033 + ], + [ + 1037, + 1038 + ], + [ + 1039, + 1040 + ], + [ + 1048, + 1051 + ], + [ + 1052, + 1053 + ], + [ + 1057, + 1058 + ], + [ + 1059, + 1060 + ], + [ + 1069, + 1070 + ], + [ + 1072, + 1073 + ], + [ + 1084, + 1085 + ], + [ + 1087, + 1088 + ], + [ + 1094, + 1095 + ], + [ + 1101, + 1102 + ], + [ + 1104, + 1105 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/connection.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 59, + 172 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 62, + 63 + ], + [ + 66, + 68 + ], + [ + 69, + 71 + ], + [ + 73, + 74 + ], + [ + 80, + 82 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 92, + 95 + ], + [ + 97, + 100 + ], + [ + 104, + 107 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 125, + 128 + ], + [ + 129, + 131 + ], + [ + 132, + 135 + ], + [ + 136, + 138 + ], + [ + 141, + 142 + ], + [ + 148, + 150 + ], + [ + 155, + 156 + ], + [ + 157, + 158 + ], + [ + 160, + 162 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/dbuf.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 48, + 55 + ], + [ + 59, + 90 + ], + [ + 92, + 105 + ], + [ + 113, + 128 + ], + [ + 131, + 158 + ], + [ + 160, + 181 + ], + [ + 183, + 214 + ], + [ + 216, + 267 + ], + [ + 271, + 278 + ], + [ + 284, + 295 + ], + [ + 298, + 358 + ], + [ + 363, + 372 + ], + [ + 375, + 394 + ], + [ + 399, + 425 + ], + [ + 429, + 446 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 51, + 52 + ], + [ + 62, + 63 + ], + [ + 65, + 66 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 76, + 80 + ], + [ + 86, + 87 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 116, + 117 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 134, + 135 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 147, + 148 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ], + [ + 163, + 165 + ], + [ + 168, + 169 + ], + [ + 170, + 172 + ], + [ + 173, + 174 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 186, + 188 + ], + [ + 191, + 192 + ], + [ + 196, + 199 + ], + [ + 200, + 203 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 226, + 227 + ], + [ + 230, + 232 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 243, + 245 + ], + [ + 246, + 249 + ], + [ + 250, + 253 + ], + [ + 254, + 257 + ], + [ + 258, + 261 + ], + [ + 263, + 264 + ], + [ + 274, + 275 + ], + [ + 287, + 288 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 301, + 303 + ], + [ + 305, + 306 + ], + [ + 309, + 310 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 319, + 320 + ], + [ + 323, + 325 + ], + [ + 328, + 331 + ], + [ + 335, + 341 + ], + [ + 344, + 345 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 378, + 380 + ], + [ + 383, + 384 + ], + [ + 385, + 387 + ], + [ + 390, + 391 + ], + [ + 402, + 403 + ], + [ + 407, + 408 + ], + [ + 411, + 412 + ], + [ + 415, + 416 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 432, + 433 + ], + [ + 437, + 438 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 444, + 445 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/error.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 20, + 48 + ], + [ + 76, + 83 + ], + [ + 109, + 119 + ], + [ + 132, + 139 + ], + [ + 142, + 172 + ], + [ + 175, + 210 + ], + [ + 212, + 223 + ], + [ + 225, + 264 + ], + [ + 266, + 284 + ], + [ + 290, + 329 + ], + [ + 335, + 348 + ], + [ + 356, + 379 + ], + [ + 380, + 422 + ], + [ + 423, + 452 + ], + [ + 453, + 460 + ], + [ + 462, + 476 + ], + [ + 486, + 504 + ], + [ + 505, + 512 + ], + [ + 514, + 532 + ], + [ + 543, + 558 + ], + [ + 568, + 582 + ], + [ + 593, + 607 + ], + [ + 617, + 632 + ], + [ + 634, + 641 + ], + [ + 643, + 658 + ], + [ + 670, + 687 + ], + [ + 699, + 713 + ], + [ + 723, + 737 + ], + [ + 747, + 761 + ], + [ + 763, + 770 + ], + [ + 772, + 788 + ], + [ + 799, + 815 + ], + [ + 825, + 839 + ], + [ + 849, + 864 + ], + [ + 874, + 893 + ], + [ + 903, + 919 + ], + [ + 928, + 946 + ], + [ + 955, + 973 + ], + [ + 984, + 999 + ], + [ + 1000, + 1007 + ], + [ + 1009, + 1025 + ], + [ + 1036, + 1051 + ], + [ + 1054, + 1061 + ], + [ + 1063, + 1079 + ], + [ + 1090, + 1105 + ], + [ + 1116, + 1131 + ], + [ + 1133, + 1154 + ], + [ + 1165, + 1200 + ], + [ + 1202, + 1239 + ], + [ + 1241, + 1279 + ], + [ + 1283, + 1300 + ], + [ + 1310, + 1324 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 79, + 80 + ], + [ + 112, + 113 + ], + [ + 115, + 116 + ], + [ + 135, + 136 + ], + [ + 145, + 146 + ], + [ + 147, + 149 + ], + [ + 150, + 151 + ], + [ + 156, + 157 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 163, + 165 + ], + [ + 168, + 169 + ], + [ + 178, + 179 + ], + [ + 182, + 185 + ], + [ + 186, + 187 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 197, + 198 + ], + [ + 201, + 205 + ], + [ + 206, + 207 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 228, + 230 + ], + [ + 232, + 243 + ], + [ + 245, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 257 + ], + [ + 260, + 261 + ], + [ + 269, + 272 + ], + [ + 274, + 277 + ], + [ + 280, + 281 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ], + [ + 298, + 312 + ], + [ + 313, + 316 + ], + [ + 317, + 321 + ], + [ + 325, + 326 + ], + [ + 338, + 339 + ], + [ + 342, + 345 + ], + [ + 359, + 360 + ], + [ + 363, + 365 + ], + [ + 368, + 371 + ], + [ + 372, + 373 + ], + [ + 383, + 384 + ], + [ + 386, + 387 + ], + [ + 388, + 392 + ], + [ + 397, + 398 + ], + [ + 404, + 406 + ], + [ + 407, + 410 + ], + [ + 413, + 414 + ], + [ + 418, + 419 + ], + [ + 426, + 430 + ], + [ + 432, + 433 + ], + [ + 434, + 437 + ], + [ + 438, + 439 + ], + [ + 441, + 442 + ], + [ + 445, + 446 + ], + [ + 448, + 449 + ], + [ + 456, + 457 + ], + [ + 465, + 466 + ], + [ + 467, + 470 + ], + [ + 472, + 473 + ], + [ + 489, + 490 + ], + [ + 493, + 498 + ], + [ + 500, + 501 + ], + [ + 508, + 509 + ], + [ + 517, + 518 + ], + [ + 521, + 522 + ], + [ + 523, + 526 + ], + [ + 528, + 529 + ], + [ + 546, + 547 + ], + [ + 548, + 552 + ], + [ + 554, + 555 + ], + [ + 571, + 572 + ], + [ + 573, + 576 + ], + [ + 578, + 579 + ], + [ + 596, + 597 + ], + [ + 598, + 601 + ], + [ + 603, + 604 + ], + [ + 620, + 621 + ], + [ + 622, + 626 + ], + [ + 628, + 629 + ], + [ + 637, + 638 + ], + [ + 646, + 647 + ], + [ + 648, + 652 + ], + [ + 654, + 655 + ], + [ + 673, + 674 + ], + [ + 675, + 681 + ], + [ + 683, + 684 + ], + [ + 702, + 703 + ], + [ + 704, + 707 + ], + [ + 709, + 710 + ], + [ + 726, + 727 + ], + [ + 728, + 731 + ], + [ + 733, + 734 + ], + [ + 750, + 751 + ], + [ + 752, + 755 + ], + [ + 757, + 758 + ], + [ + 766, + 767 + ], + [ + 775, + 776 + ], + [ + 777, + 782 + ], + [ + 784, + 785 + ], + [ + 802, + 803 + ], + [ + 804, + 809 + ], + [ + 811, + 812 + ], + [ + 828, + 829 + ], + [ + 830, + 833 + ], + [ + 835, + 836 + ], + [ + 852, + 853 + ], + [ + 854, + 858 + ], + [ + 860, + 861 + ], + [ + 877, + 878 + ], + [ + 879, + 880 + ], + [ + 882, + 887 + ], + [ + 889, + 890 + ], + [ + 906, + 907 + ], + [ + 908, + 913 + ], + [ + 915, + 916 + ], + [ + 931, + 932 + ], + [ + 933, + 934 + ], + [ + 935, + 940 + ], + [ + 942, + 943 + ], + [ + 958, + 959 + ], + [ + 960, + 961 + ], + [ + 963, + 967 + ], + [ + 969, + 970 + ], + [ + 987, + 988 + ], + [ + 989, + 993 + ], + [ + 995, + 996 + ], + [ + 1003, + 1004 + ], + [ + 1012, + 1013 + ], + [ + 1014, + 1019 + ], + [ + 1021, + 1022 + ], + [ + 1039, + 1040 + ], + [ + 1041, + 1045 + ], + [ + 1047, + 1048 + ], + [ + 1057, + 1058 + ], + [ + 1066, + 1067 + ], + [ + 1068, + 1073 + ], + [ + 1075, + 1076 + ], + [ + 1093, + 1094 + ], + [ + 1095, + 1099 + ], + [ + 1101, + 1102 + ], + [ + 1119, + 1120 + ], + [ + 1121, + 1125 + ], + [ + 1127, + 1128 + ], + [ + 1136, + 1137 + ], + [ + 1143, + 1144 + ], + [ + 1145, + 1148 + ], + [ + 1150, + 1151 + ], + [ + 1168, + 1169 + ], + [ + 1172, + 1183 + ], + [ + 1184, + 1187 + ], + [ + 1188, + 1189 + ], + [ + 1194, + 1195 + ], + [ + 1196, + 1197 + ], + [ + 1205, + 1206 + ], + [ + 1207, + 1212 + ], + [ + 1213, + 1218 + ], + [ + 1220, + 1221 + ], + [ + 1223, + 1225 + ], + [ + 1226, + 1227 + ], + [ + 1231, + 1232 + ], + [ + 1235, + 1236 + ], + [ + 1244, + 1245 + ], + [ + 1250, + 1254 + ], + [ + 1255, + 1259 + ], + [ + 1261, + 1266 + ], + [ + 1267, + 1268 + ], + [ + 1269, + 1270 + ], + [ + 1275, + 1276 + ], + [ + 1286, + 1287 + ], + [ + 1288, + 1294 + ], + [ + 1296, + 1297 + ], + [ + 1313, + 1314 + ], + [ + 1315, + 1320 + ], + [ + 1322, + 1323 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/gate.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 49, + 63 + ], + [ + 64, + 73 + ], + [ + 76, + 376 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 52, + 53 + ], + [ + 59, + 60 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 79, + 80 + ], + [ + 85, + 87 + ], + [ + 93, + 94 + ], + [ + 96, + 97 + ], + [ + 102, + 103 + ], + [ + 106, + 111 + ], + [ + 114, + 115 + ], + [ + 116, + 123 + ], + [ + 127, + 128 + ], + [ + 132, + 133 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 148 + ], + [ + 151, + 152 + ], + [ + 154, + 158 + ], + [ + 159, + 160 + ], + [ + 163, + 164 + ], + [ + 165, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 175 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 182, + 185 + ], + [ + 188, + 189 + ], + [ + 190, + 192 + ], + [ + 195, + 196 + ], + [ + 200, + 201 + ], + [ + 204, + 205 + ], + [ + 206, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 217, + 219 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 234 + ], + [ + 235, + 236 + ], + [ + 239, + 240 + ], + [ + 245, + 246 + ], + [ + 247, + 248 + ], + [ + 249, + 256 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 271, + 272 + ], + [ + 275, + 276 + ], + [ + 277, + 280 + ], + [ + 281, + 283 + ], + [ + 287, + 288 + ], + [ + 291, + 292 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 308, + 313 + ], + [ + 315, + 317 + ], + [ + 320, + 321 + ], + [ + 325, + 326 + ], + [ + 329, + 330 + ], + [ + 331, + 332 + ], + [ + 336, + 341 + ], + [ + 343, + 345 + ], + [ + 348, + 349 + ], + [ + 355, + 356 + ], + [ + 359, + 360 + ], + [ + 362, + 364 + ], + [ + 366, + 367 + ], + [ + 370, + 373 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/generate.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 57, + 85 + ], + [ + 115, + 126 + ], + [ + 129, + 198 + ], + [ + 203, + 240 + ], + [ + 245, + 252 + ], + [ + 259, + 300 + ], + [ + 305, + 336 + ], + [ + 338, + 348 + ], + [ + 349, + 360 + ], + [ + 363, + 378 + ], + [ + 381, + 431 + ], + [ + 438, + 449 + ], + [ + 456, + 469 + ], + [ + 471, + 496 + ], + [ + 498, + 511 + ], + [ + 513, + 537 + ], + [ + 546, + 553 + ], + [ + 554, + 579 + ], + [ + 598, + 605 + ], + [ + 622, + 646 + ], + [ + 653, + 781 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 60, + 66 + ], + [ + 67, + 71 + ], + [ + 72, + 76 + ], + [ + 81, + 82 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 132, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 142 + ], + [ + 145, + 147 + ], + [ + 151, + 152 + ], + [ + 153, + 155 + ], + [ + 156, + 158 + ], + [ + 159, + 163 + ], + [ + 166, + 168 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 176, + 177 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 186, + 190 + ], + [ + 191, + 193 + ], + [ + 194, + 195 + ], + [ + 206, + 207 + ], + [ + 212, + 214 + ], + [ + 216, + 218 + ], + [ + 219, + 221 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 228, + 229 + ], + [ + 231, + 233 + ], + [ + 235, + 237 + ], + [ + 248, + 249 + ], + [ + 262, + 263 + ], + [ + 267, + 268 + ], + [ + 269, + 271 + ], + [ + 272, + 273 + ], + [ + 274, + 275 + ], + [ + 276, + 279 + ], + [ + 280, + 281 + ], + [ + 286, + 289 + ], + [ + 295, + 297 + ], + [ + 308, + 311 + ], + [ + 315, + 325 + ], + [ + 329, + 333 + ], + [ + 341, + 342 + ], + [ + 344, + 345 + ], + [ + 352, + 353 + ], + [ + 356, + 357 + ], + [ + 366, + 367 + ], + [ + 372, + 375 + ], + [ + 384, + 385 + ], + [ + 386, + 389 + ], + [ + 390, + 392 + ], + [ + 393, + 394 + ], + [ + 400, + 401 + ], + [ + 406, + 408 + ], + [ + 413, + 417 + ], + [ + 418, + 421 + ], + [ + 427, + 428 + ], + [ + 441, + 442 + ], + [ + 445, + 446 + ], + [ + 459, + 460 + ], + [ + 463, + 464 + ], + [ + 465, + 466 + ], + [ + 474, + 475 + ], + [ + 480, + 481 + ], + [ + 484, + 485 + ], + [ + 487, + 490 + ], + [ + 492, + 493 + ], + [ + 501, + 502 + ], + [ + 507, + 508 + ], + [ + 516, + 517 + ], + [ + 521, + 523 + ], + [ + 526, + 530 + ], + [ + 533, + 534 + ], + [ + 549, + 550 + ], + [ + 557, + 559 + ], + [ + 560, + 561 + ], + [ + 564, + 566 + ], + [ + 569, + 573 + ], + [ + 575, + 576 + ], + [ + 601, + 602 + ], + [ + 625, + 626 + ], + [ + 631, + 632 + ], + [ + 634, + 637 + ], + [ + 640, + 641 + ], + [ + 642, + 643 + ], + [ + 656, + 657 + ], + [ + 659, + 660 + ], + [ + 662, + 663 + ], + [ + 667, + 668 + ], + [ + 672, + 673 + ], + [ + 674, + 675 + ], + [ + 676, + 677 + ], + [ + 678, + 679 + ], + [ + 680, + 682 + ], + [ + 683, + 687 + ], + [ + 692, + 756 + ], + [ + 759, + 761 + ], + [ + 764, + 780 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/ginputsource.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 33 + ], + [ + 51, + 61 + ], + [ + 62, + 250 + ], + [ + 253, + 263 + ], + [ + 266, + 281 + ], + [ + 288, + 297 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 54, + 55 + ], + [ + 56, + 58 + ], + [ + 65, + 67 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 81, + 83 + ], + [ + 84, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 115, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 127, + 129 + ], + [ + 130, + 131 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 148, + 150 + ], + [ + 151, + 152 + ], + [ + 153, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 164 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 176, + 178 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 188, + 190 + ], + [ + 191, + 192 + ], + [ + 195, + 196 + ], + [ + 197, + 199 + ], + [ + 200, + 202 + ], + [ + 203, + 205 + ], + [ + 206, + 207 + ], + [ + 210, + 212 + ], + [ + 213, + 214 + ], + [ + 217, + 218 + ], + [ + 219, + 221 + ], + [ + 222, + 225 + ], + [ + 226, + 229 + ], + [ + 231, + 232 + ], + [ + 235, + 237 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 246, + 247 + ], + [ + 256, + 257 + ], + [ + 258, + 260 + ], + [ + 269, + 274 + ], + [ + 277, + 278 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/header.c", + "line_filter": { + "diff_chunks": [ + [ + 42, + 70 + ], + [ + 100, + 109 + ], + [ + 112, + 120 + ], + [ + 130, + 138 + ], + [ + 139, + 146 + ], + [ + 155, + 211 + ], + [ + 213, + 225 + ], + [ + 230, + 327 + ], + [ + 329, + 376 + ], + [ + 380, + 389 + ], + [ + 392, + 401 + ], + [ + 404, + 413 + ], + [ + 416, + 425 + ], + [ + 428, + 465 + ], + [ + 469, + 540 + ], + [ + 541, + 551 + ], + [ + 554, + 563 + ], + [ + 569, + 656 + ], + [ + 663, + 670 + ], + [ + 671, + 689 + ], + [ + 690, + 775 + ], + [ + 776, + 810 + ], + [ + 813, + 822 + ], + [ + 825, + 834 + ], + [ + 838, + 847 + ], + [ + 848, + 904 + ], + [ + 910, + 929 + ], + [ + 938, + 955 + ], + [ + 961, + 979 + ], + [ + 985, + 1026 + ], + [ + 1031, + 1043 + ], + [ + 1048, + 1067 + ], + [ + 1084, + 1162 + ], + [ + 1175, + 1182 + ], + [ + 1183, + 1205 + ], + [ + 1223, + 1233 + ], + [ + 1235, + 1287 + ], + [ + 1289, + 1300 + ], + [ + 1307, + 1316 + ], + [ + 1324, + 1375 + ], + [ + 1377, + 1419 + ], + [ + 1428, + 1454 + ], + [ + 1459, + 1476 + ], + [ + 1478, + 1486 + ], + [ + 1489, + 1568 + ], + [ + 1577, + 1615 + ], + [ + 1627, + 1648 + ], + [ + 1650, + 1675 + ], + [ + 1676, + 1714 + ], + [ + 1716, + 1852 + ], + [ + 1858, + 1965 + ], + [ + 1966, + 2018 + ], + [ + 2020, + 2074 + ], + [ + 2075, + 2114 + ], + [ + 2115, + 2132 + ], + [ + 2133, + 2156 + ], + [ + 2165, + 2172 + ], + [ + 2175, + 2216 + ], + [ + 2227, + 2252 + ], + [ + 2257, + 2264 + ], + [ + 2265, + 2284 + ] + ], + "lines_added": [ + [ + 45, + 46 + ], + [ + 47, + 51 + ], + [ + 52, + 61 + ], + [ + 66, + 67 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 115, + 117 + ], + [ + 133, + 135 + ], + [ + 142, + 143 + ], + [ + 158, + 170 + ], + [ + 176, + 187 + ], + [ + 190, + 191 + ], + [ + 192, + 194 + ], + [ + 198, + 208 + ], + [ + 216, + 218 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 233, + 235 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 245, + 246 + ], + [ + 249, + 252 + ], + [ + 253, + 256 + ], + [ + 257, + 260 + ], + [ + 261, + 262 + ], + [ + 265, + 266 + ], + [ + 267, + 270 + ], + [ + 271, + 274 + ], + [ + 275, + 278 + ], + [ + 281, + 282 + ], + [ + 283, + 288 + ], + [ + 292, + 293 + ], + [ + 295, + 297 + ], + [ + 298, + 303 + ], + [ + 305, + 308 + ], + [ + 309, + 312 + ], + [ + 315, + 316 + ], + [ + 319, + 320 + ], + [ + 322, + 324 + ], + [ + 332, + 334 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 341, + 343 + ], + [ + 345, + 347 + ], + [ + 348, + 352 + ], + [ + 354, + 355 + ], + [ + 360, + 361 + ], + [ + 362, + 364 + ], + [ + 367, + 368 + ], + [ + 369, + 373 + ], + [ + 383, + 384 + ], + [ + 385, + 386 + ], + [ + 395, + 396 + ], + [ + 397, + 398 + ], + [ + 407, + 408 + ], + [ + 409, + 410 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 431, + 432 + ], + [ + 433, + 434 + ], + [ + 435, + 436 + ], + [ + 438, + 439 + ], + [ + 441, + 442 + ], + [ + 444, + 445 + ], + [ + 447, + 448 + ], + [ + 450, + 451 + ], + [ + 454, + 455 + ], + [ + 458, + 459 + ], + [ + 461, + 462 + ], + [ + 472, + 473 + ], + [ + 477, + 478 + ], + [ + 483, + 484 + ], + [ + 485, + 489 + ], + [ + 492, + 495 + ], + [ + 500, + 502 + ], + [ + 505, + 512 + ], + [ + 515, + 517 + ], + [ + 522, + 523 + ], + [ + 526, + 527 + ], + [ + 530, + 532 + ], + [ + 535, + 537 + ], + [ + 544, + 545 + ], + [ + 547, + 548 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ], + [ + 572, + 573 + ], + [ + 574, + 575 + ], + [ + 580, + 581 + ], + [ + 582, + 583 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 591, + 592 + ], + [ + 596, + 597 + ], + [ + 599, + 600 + ], + [ + 603, + 604 + ], + [ + 606, + 607 + ], + [ + 610, + 611 + ], + [ + 612, + 613 + ], + [ + 615, + 616 + ], + [ + 619, + 620 + ], + [ + 622, + 623 + ], + [ + 626, + 627 + ], + [ + 629, + 630 + ], + [ + 634, + 635 + ], + [ + 637, + 638 + ], + [ + 641, + 642 + ], + [ + 644, + 645 + ], + [ + 649, + 650 + ], + [ + 652, + 653 + ], + [ + 666, + 667 + ], + [ + 674, + 675 + ], + [ + 680, + 681 + ], + [ + 685, + 686 + ], + [ + 693, + 694 + ], + [ + 698, + 699 + ], + [ + 704, + 705 + ], + [ + 710, + 712 + ], + [ + 715, + 717 + ], + [ + 720, + 728 + ], + [ + 731, + 733 + ], + [ + 735, + 737 + ], + [ + 740, + 742 + ], + [ + 745, + 747 + ], + [ + 750, + 751 + ], + [ + 753, + 756 + ], + [ + 759, + 762 + ], + [ + 765, + 767 + ], + [ + 770, + 772 + ], + [ + 779, + 781 + ], + [ + 782, + 783 + ], + [ + 789, + 790 + ], + [ + 792, + 793 + ], + [ + 794, + 795 + ], + [ + 801, + 802 + ], + [ + 804, + 805 + ], + [ + 806, + 807 + ], + [ + 816, + 817 + ], + [ + 818, + 819 + ], + [ + 828, + 829 + ], + [ + 830, + 831 + ], + [ + 841, + 842 + ], + [ + 843, + 844 + ], + [ + 851, + 852 + ], + [ + 856, + 857 + ], + [ + 858, + 859 + ], + [ + 865, + 867 + ], + [ + 871, + 872 + ], + [ + 876, + 878 + ], + [ + 879, + 880 + ], + [ + 886, + 888 + ], + [ + 892, + 893 + ], + [ + 897, + 899 + ], + [ + 900, + 901 + ], + [ + 913, + 914 + ], + [ + 917, + 920 + ], + [ + 922, + 924 + ], + [ + 925, + 926 + ], + [ + 941, + 942 + ], + [ + 945, + 947 + ], + [ + 948, + 950 + ], + [ + 951, + 952 + ], + [ + 964, + 965 + ], + [ + 966, + 967 + ], + [ + 968, + 971 + ], + [ + 972, + 974 + ], + [ + 975, + 976 + ], + [ + 988, + 989 + ], + [ + 992, + 994 + ], + [ + 995, + 997 + ], + [ + 998, + 999 + ], + [ + 1005, + 1006 + ], + [ + 1011, + 1012 + ], + [ + 1015, + 1018 + ], + [ + 1019, + 1021 + ], + [ + 1022, + 1023 + ], + [ + 1034, + 1035 + ], + [ + 1036, + 1037 + ], + [ + 1038, + 1040 + ], + [ + 1051, + 1052 + ], + [ + 1058, + 1059 + ], + [ + 1060, + 1062 + ], + [ + 1063, + 1064 + ], + [ + 1087, + 1093 + ], + [ + 1094, + 1095 + ], + [ + 1099, + 1100 + ], + [ + 1103, + 1105 + ], + [ + 1108, + 1109 + ], + [ + 1111, + 1113 + ], + [ + 1114, + 1119 + ], + [ + 1121, + 1122 + ], + [ + 1124, + 1125 + ], + [ + 1127, + 1128 + ], + [ + 1130, + 1131 + ], + [ + 1133, + 1134 + ], + [ + 1135, + 1136 + ], + [ + 1139, + 1144 + ], + [ + 1146, + 1147 + ], + [ + 1152, + 1154 + ], + [ + 1158, + 1159 + ], + [ + 1178, + 1179 + ], + [ + 1186, + 1187 + ], + [ + 1188, + 1191 + ], + [ + 1194, + 1197 + ], + [ + 1198, + 1199 + ], + [ + 1201, + 1202 + ], + [ + 1226, + 1227 + ], + [ + 1228, + 1230 + ], + [ + 1238, + 1242 + ], + [ + 1243, + 1244 + ], + [ + 1249, + 1252 + ], + [ + 1254, + 1255 + ], + [ + 1262, + 1263 + ], + [ + 1264, + 1265 + ], + [ + 1269, + 1279 + ], + [ + 1280, + 1282 + ], + [ + 1283, + 1284 + ], + [ + 1292, + 1293 + ], + [ + 1296, + 1297 + ], + [ + 1310, + 1311 + ], + [ + 1312, + 1313 + ], + [ + 1327, + 1328 + ], + [ + 1332, + 1334 + ], + [ + 1335, + 1336 + ], + [ + 1338, + 1340 + ], + [ + 1341, + 1345 + ], + [ + 1348, + 1349 + ], + [ + 1351, + 1353 + ], + [ + 1354, + 1358 + ], + [ + 1361, + 1365 + ], + [ + 1366, + 1367 + ], + [ + 1369, + 1370 + ], + [ + 1371, + 1372 + ], + [ + 1380, + 1381 + ], + [ + 1387, + 1389 + ], + [ + 1393, + 1394 + ], + [ + 1395, + 1396 + ], + [ + 1398, + 1400 + ], + [ + 1402, + 1403 + ], + [ + 1405, + 1407 + ], + [ + 1409, + 1412 + ], + [ + 1413, + 1414 + ], + [ + 1415, + 1416 + ], + [ + 1431, + 1432 + ], + [ + 1437, + 1439 + ], + [ + 1441, + 1443 + ], + [ + 1445, + 1448 + ], + [ + 1450, + 1451 + ], + [ + 1462, + 1463 + ], + [ + 1468, + 1471 + ], + [ + 1472, + 1473 + ], + [ + 1481, + 1483 + ], + [ + 1492, + 1493 + ], + [ + 1498, + 1499 + ], + [ + 1501, + 1504 + ], + [ + 1505, + 1507 + ], + [ + 1509, + 1513 + ], + [ + 1514, + 1515 + ], + [ + 1518, + 1519 + ], + [ + 1524, + 1525 + ], + [ + 1528, + 1529 + ], + [ + 1532, + 1533 + ], + [ + 1535, + 1536 + ], + [ + 1542, + 1543 + ], + [ + 1549, + 1550 + ], + [ + 1551, + 1553 + ], + [ + 1559, + 1561 + ], + [ + 1562, + 1563 + ], + [ + 1564, + 1565 + ], + [ + 1580, + 1582 + ], + [ + 1585, + 1588 + ], + [ + 1591, + 1593 + ], + [ + 1594, + 1595 + ], + [ + 1596, + 1602 + ], + [ + 1603, + 1606 + ], + [ + 1607, + 1608 + ], + [ + 1609, + 1610 + ], + [ + 1611, + 1612 + ], + [ + 1630, + 1632 + ], + [ + 1635, + 1639 + ], + [ + 1641, + 1642 + ], + [ + 1644, + 1645 + ], + [ + 1653, + 1654 + ], + [ + 1660, + 1662 + ], + [ + 1665, + 1669 + ], + [ + 1671, + 1672 + ], + [ + 1679, + 1680 + ], + [ + 1685, + 1687 + ], + [ + 1692, + 1693 + ], + [ + 1694, + 1695 + ], + [ + 1697, + 1698 + ], + [ + 1701, + 1702 + ], + [ + 1703, + 1704 + ], + [ + 1706, + 1708 + ], + [ + 1710, + 1711 + ], + [ + 1719, + 1720 + ], + [ + 1723, + 1724 + ], + [ + 1728, + 1730 + ], + [ + 1733, + 1737 + ], + [ + 1739, + 1740 + ], + [ + 1742, + 1743 + ], + [ + 1748, + 1749 + ], + [ + 1750, + 1751 + ], + [ + 1757, + 1758 + ], + [ + 1761, + 1765 + ], + [ + 1766, + 1767 + ], + [ + 1769, + 1770 + ], + [ + 1775, + 1776 + ], + [ + 1782, + 1783 + ], + [ + 1786, + 1790 + ], + [ + 1792, + 1793 + ], + [ + 1798, + 1799 + ], + [ + 1800, + 1801 + ], + [ + 1807, + 1808 + ], + [ + 1811, + 1815 + ], + [ + 1816, + 1817 + ], + [ + 1819, + 1820 + ], + [ + 1825, + 1826 + ], + [ + 1832, + 1833 + ], + [ + 1836, + 1840 + ], + [ + 1842, + 1843 + ], + [ + 1848, + 1849 + ], + [ + 1861, + 1863 + ], + [ + 1866, + 1868 + ], + [ + 1869, + 1870 + ], + [ + 1872, + 1873 + ], + [ + 1875, + 1877 + ], + [ + 1879, + 1881 + ], + [ + 1882, + 1884 + ], + [ + 1885, + 1886 + ], + [ + 1888, + 1889 + ], + [ + 1890, + 1891 + ], + [ + 1893, + 1894 + ], + [ + 1899, + 1900 + ], + [ + 1906, + 1907 + ], + [ + 1910, + 1914 + ], + [ + 1916, + 1917 + ], + [ + 1922, + 1923 + ], + [ + 1926, + 1928 + ], + [ + 1934, + 1936 + ], + [ + 1940, + 1942 + ], + [ + 1946, + 1948 + ], + [ + 1950, + 1955 + ], + [ + 1956, + 1958 + ], + [ + 1959, + 1960 + ], + [ + 1961, + 1962 + ], + [ + 1969, + 1970 + ], + [ + 1972, + 1973 + ], + [ + 1976, + 1978 + ], + [ + 1981, + 1982 + ], + [ + 1983, + 1984 + ], + [ + 1986, + 1987 + ], + [ + 1992, + 1993 + ], + [ + 1996, + 1997 + ], + [ + 2003, + 2006 + ], + [ + 2009, + 2013 + ], + [ + 2014, + 2015 + ], + [ + 2023, + 2024 + ], + [ + 2028, + 2030 + ], + [ + 2033, + 2037 + ], + [ + 2039, + 2040 + ], + [ + 2046, + 2047 + ], + [ + 2052, + 2053 + ], + [ + 2059, + 2062 + ], + [ + 2065, + 2069 + ], + [ + 2070, + 2071 + ], + [ + 2078, + 2079 + ], + [ + 2080, + 2081 + ], + [ + 2086, + 2088 + ], + [ + 2091, + 2095 + ], + [ + 2097, + 2098 + ], + [ + 2104, + 2105 + ], + [ + 2110, + 2111 + ], + [ + 2118, + 2120 + ], + [ + 2123, + 2127 + ], + [ + 2128, + 2129 + ], + [ + 2136, + 2137 + ], + [ + 2138, + 2139 + ], + [ + 2144, + 2146 + ], + [ + 2149, + 2153 + ], + [ + 2168, + 2169 + ], + [ + 2178, + 2179 + ], + [ + 2184, + 2186 + ], + [ + 2189, + 2190 + ], + [ + 2192, + 2196 + ], + [ + 2199, + 2202 + ], + [ + 2204, + 2207 + ], + [ + 2209, + 2211 + ], + [ + 2212, + 2213 + ], + [ + 2230, + 2234 + ], + [ + 2236, + 2237 + ], + [ + 2238, + 2239 + ], + [ + 2240, + 2243 + ], + [ + 2245, + 2247 + ], + [ + 2248, + 2249 + ], + [ + 2260, + 2261 + ], + [ + 2268, + 2269 + ], + [ + 2270, + 2272 + ], + [ + 2273, + 2274 + ], + [ + 2279, + 2280 + ], + [ + 2281, + 2282 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/image.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 24, + 52 + ], + [ + 74, + 120 + ], + [ + 130, + 143 + ], + [ + 151, + 204 + ], + [ + 205, + 217 + ], + [ + 227, + 245 + ], + [ + 251, + 287 + ], + [ + 335, + 351 + ], + [ + 354, + 381 + ], + [ + 382, + 389 + ], + [ + 393, + 400 + ], + [ + 404, + 446 + ], + [ + 449, + 469 + ], + [ + 471, + 514 + ], + [ + 516, + 528 + ], + [ + 533, + 553 + ], + [ + 555, + 737 + ], + [ + 742, + 786 + ], + [ + 790, + 829 + ], + [ + 832, + 1001 + ], + [ + 1003, + 1069 + ], + [ + 1075, + 1082 + ], + [ + 1091, + 1098 + ], + [ + 1101, + 1217 + ], + [ + 1224, + 1240 + ], + [ + 1241, + 1303 + ], + [ + 1306, + 1343 + ], + [ + 1349, + 1395 + ], + [ + 1397, + 1404 + ], + [ + 1407, + 1435 + ], + [ + 1437, + 1459 + ], + [ + 1466, + 1610 + ], + [ + 1612, + 1633 + ], + [ + 1637, + 1651 + ], + [ + 1652, + 1671 + ], + [ + 1673, + 1689 + ], + [ + 1691, + 1788 + ], + [ + 1789, + 1798 + ], + [ + 1799, + 1822 + ], + [ + 1823, + 1846 + ], + [ + 1850, + 1891 + ], + [ + 1896, + 1923 + ], + [ + 1927, + 1955 + ], + [ + 1956, + 1965 + ], + [ + 1972, + 1979 + ], + [ + 1980, + 2008 + ], + [ + 2025, + 2034 + ], + [ + 2035, + 2052 + ], + [ + 2053, + 2082 + ], + [ + 2087, + 2123 + ], + [ + 2126, + 2136 + ], + [ + 2137, + 2152 + ], + [ + 2155, + 2180 + ], + [ + 2182, + 2205 + ], + [ + 2208, + 2268 + ], + [ + 2274, + 2295 + ], + [ + 2296, + 2314 + ], + [ + 2318, + 2332 + ], + [ + 2333, + 2348 + ], + [ + 2356, + 2386 + ], + [ + 2395, + 2406 + ], + [ + 2417, + 2461 + ], + [ + 2471, + 2480 + ], + [ + 2490, + 2505 + ], + [ + 2507, + 2524 + ], + [ + 2526, + 2548 + ], + [ + 2549, + 2611 + ], + [ + 2620, + 2645 + ], + [ + 2648, + 2664 + ], + [ + 2667, + 2685 + ], + [ + 2691, + 2755 + ], + [ + 2757, + 2824 + ], + [ + 2825, + 2843 + ], + [ + 2844, + 2863 + ], + [ + 2864, + 2908 + ], + [ + 2909, + 2944 + ], + [ + 2952, + 2969 + ], + [ + 2971, + 2983 + ], + [ + 2993, + 3015 + ], + [ + 3017, + 3059 + ], + [ + 3062, + 3075 + ], + [ + 3076, + 3099 + ], + [ + 3105, + 3121 + ], + [ + 3123, + 3130 + ], + [ + 3132, + 3187 + ], + [ + 3198, + 3283 + ], + [ + 3284, + 3326 + ], + [ + 3335, + 3342 + ], + [ + 3345, + 3356 + ], + [ + 3357, + 3383 + ], + [ + 3384, + 3425 + ], + [ + 3431, + 3448 + ], + [ + 3449, + 3464 + ], + [ + 3470, + 3492 + ], + [ + 3495, + 3532 + ], + [ + 3537, + 3544 + ], + [ + 3547, + 3574 + ], + [ + 3576, + 3592 + ], + [ + 3596, + 3627 + ], + [ + 3628, + 3652 + ], + [ + 3659, + 3669 + ], + [ + 3677, + 3695 + ], + [ + 3702, + 3731 + ], + [ + 3734, + 3746 + ], + [ + 3749, + 3775 + ], + [ + 3779, + 3805 + ], + [ + 3809, + 3821 + ], + [ + 3824, + 3835 + ], + [ + 3839, + 3851 + ], + [ + 3853, + 3865 + ], + [ + 3869, + 3881 + ], + [ + 3883, + 3895 + ], + [ + 3901, + 3926 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 27, + 33 + ], + [ + 34, + 38 + ], + [ + 39, + 43 + ], + [ + 48, + 49 + ], + [ + 77, + 79 + ], + [ + 80, + 81 + ], + [ + 87, + 88 + ], + [ + 92, + 113 + ], + [ + 115, + 117 + ], + [ + 133, + 134 + ], + [ + 139, + 140 + ], + [ + 154, + 155 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 165, + 166 + ], + [ + 168, + 169 + ], + [ + 175, + 177 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 184, + 186 + ], + [ + 188, + 189 + ], + [ + 191, + 195 + ], + [ + 197, + 198 + ], + [ + 200, + 201 + ], + [ + 208, + 209 + ], + [ + 213, + 214 + ], + [ + 230, + 231 + ], + [ + 236, + 237 + ], + [ + 241, + 242 + ], + [ + 254, + 255 + ], + [ + 261, + 262 + ], + [ + 266, + 267 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 278, + 280 + ], + [ + 283, + 284 + ], + [ + 338, + 339 + ], + [ + 342, + 343 + ], + [ + 347, + 348 + ], + [ + 357, + 358 + ], + [ + 360, + 361 + ], + [ + 364, + 365 + ], + [ + 369, + 370 + ], + [ + 372, + 378 + ], + [ + 385, + 386 + ], + [ + 396, + 397 + ], + [ + 407, + 408 + ], + [ + 413, + 414 + ], + [ + 415, + 417 + ], + [ + 418, + 422 + ], + [ + 427, + 428 + ], + [ + 429, + 430 + ], + [ + 431, + 432 + ], + [ + 436, + 437 + ], + [ + 440, + 441 + ], + [ + 442, + 443 + ], + [ + 452, + 453 + ], + [ + 454, + 457 + ], + [ + 461, + 466 + ], + [ + 474, + 475 + ], + [ + 476, + 477 + ], + [ + 478, + 481 + ], + [ + 482, + 483 + ], + [ + 486, + 487 + ], + [ + 488, + 489 + ], + [ + 490, + 491 + ], + [ + 493, + 507 + ], + [ + 510, + 511 + ], + [ + 519, + 520 + ], + [ + 522, + 523 + ], + [ + 524, + 525 + ], + [ + 536, + 538 + ], + [ + 539, + 542 + ], + [ + 545, + 546 + ], + [ + 549, + 550 + ], + [ + 558, + 560 + ], + [ + 562, + 563 + ], + [ + 564, + 565 + ], + [ + 568, + 569 + ], + [ + 570, + 571 + ], + [ + 572, + 573 + ], + [ + 575, + 577 + ], + [ + 578, + 580 + ], + [ + 583, + 584 + ], + [ + 587, + 590 + ], + [ + 591, + 592 + ], + [ + 595, + 596 + ], + [ + 597, + 598 + ], + [ + 599, + 611 + ], + [ + 612, + 614 + ], + [ + 615, + 616 + ], + [ + 617, + 618 + ], + [ + 619, + 620 + ], + [ + 621, + 622 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 630, + 643 + ], + [ + 645, + 648 + ], + [ + 650, + 653 + ], + [ + 654, + 655 + ], + [ + 658, + 659 + ], + [ + 660, + 663 + ], + [ + 664, + 665 + ], + [ + 668, + 669 + ], + [ + 670, + 671 + ], + [ + 674, + 675 + ], + [ + 676, + 677 + ], + [ + 680, + 681 + ], + [ + 682, + 688 + ], + [ + 690, + 691 + ], + [ + 694, + 700 + ], + [ + 704, + 705 + ], + [ + 706, + 712 + ], + [ + 713, + 714 + ], + [ + 715, + 716 + ], + [ + 719, + 720 + ], + [ + 721, + 722 + ], + [ + 727, + 729 + ], + [ + 730, + 731 + ], + [ + 732, + 734 + ], + [ + 745, + 746 + ], + [ + 747, + 748 + ], + [ + 751, + 752 + ], + [ + 755, + 756 + ], + [ + 757, + 759 + ], + [ + 763, + 767 + ], + [ + 770, + 772 + ], + [ + 775, + 776 + ], + [ + 777, + 783 + ], + [ + 793, + 794 + ], + [ + 797, + 800 + ], + [ + 805, + 806 + ], + [ + 807, + 809 + ], + [ + 810, + 811 + ], + [ + 812, + 813 + ], + [ + 816, + 817 + ], + [ + 818, + 824 + ], + [ + 825, + 826 + ], + [ + 835, + 836 + ], + [ + 837, + 838 + ], + [ + 844, + 845 + ], + [ + 846, + 848 + ], + [ + 851, + 853 + ], + [ + 856, + 858 + ], + [ + 861, + 863 + ], + [ + 865, + 866 + ], + [ + 868, + 870 + ], + [ + 872, + 873 + ], + [ + 878, + 881 + ], + [ + 882, + 885 + ], + [ + 886, + 887 + ], + [ + 889, + 892 + ], + [ + 893, + 894 + ], + [ + 899, + 904 + ], + [ + 906, + 908 + ], + [ + 911, + 914 + ], + [ + 915, + 916 + ], + [ + 918, + 919 + ], + [ + 920, + 921 + ], + [ + 926, + 927 + ], + [ + 928, + 930 + ], + [ + 932, + 933 + ], + [ + 935, + 936 + ], + [ + 939, + 942 + ], + [ + 943, + 944 + ], + [ + 945, + 946 + ], + [ + 948, + 949 + ], + [ + 950, + 951 + ], + [ + 952, + 953 + ], + [ + 955, + 957 + ], + [ + 960, + 961 + ], + [ + 962, + 963 + ], + [ + 964, + 965 + ], + [ + 967, + 968 + ], + [ + 970, + 972 + ], + [ + 975, + 976 + ], + [ + 977, + 982 + ], + [ + 987, + 990 + ], + [ + 993, + 994 + ], + [ + 995, + 996 + ], + [ + 997, + 998 + ], + [ + 1006, + 1007 + ], + [ + 1008, + 1010 + ], + [ + 1011, + 1012 + ], + [ + 1013, + 1014 + ], + [ + 1017, + 1018 + ], + [ + 1019, + 1020 + ], + [ + 1021, + 1022 + ], + [ + 1024, + 1026 + ], + [ + 1027, + 1028 + ], + [ + 1029, + 1030 + ], + [ + 1031, + 1032 + ], + [ + 1033, + 1034 + ], + [ + 1035, + 1037 + ], + [ + 1038, + 1039 + ], + [ + 1041, + 1043 + ], + [ + 1044, + 1045 + ], + [ + 1047, + 1049 + ], + [ + 1050, + 1051 + ], + [ + 1054, + 1056 + ], + [ + 1060, + 1061 + ], + [ + 1062, + 1064 + ], + [ + 1065, + 1066 + ], + [ + 1078, + 1079 + ], + [ + 1094, + 1095 + ], + [ + 1104, + 1107 + ], + [ + 1108, + 1110 + ], + [ + 1111, + 1114 + ], + [ + 1115, + 1117 + ], + [ + 1118, + 1121 + ], + [ + 1122, + 1124 + ], + [ + 1125, + 1128 + ], + [ + 1129, + 1131 + ], + [ + 1132, + 1135 + ], + [ + 1136, + 1138 + ], + [ + 1139, + 1142 + ], + [ + 1143, + 1145 + ], + [ + 1146, + 1149 + ], + [ + 1150, + 1152 + ], + [ + 1153, + 1156 + ], + [ + 1157, + 1159 + ], + [ + 1160, + 1163 + ], + [ + 1164, + 1166 + ], + [ + 1167, + 1170 + ], + [ + 1171, + 1198 + ], + [ + 1199, + 1214 + ], + [ + 1227, + 1228 + ], + [ + 1229, + 1231 + ], + [ + 1232, + 1233 + ], + [ + 1236, + 1237 + ], + [ + 1244, + 1245 + ], + [ + 1251, + 1252 + ], + [ + 1253, + 1255 + ], + [ + 1256, + 1257 + ], + [ + 1260, + 1261 + ], + [ + 1267, + 1268 + ], + [ + 1271, + 1272 + ], + [ + 1273, + 1275 + ], + [ + 1276, + 1277 + ], + [ + 1280, + 1281 + ], + [ + 1287, + 1288 + ], + [ + 1290, + 1291 + ], + [ + 1292, + 1294 + ], + [ + 1295, + 1296 + ], + [ + 1299, + 1300 + ], + [ + 1309, + 1311 + ], + [ + 1312, + 1313 + ], + [ + 1315, + 1316 + ], + [ + 1322, + 1323 + ], + [ + 1325, + 1327 + ], + [ + 1328, + 1329 + ], + [ + 1331, + 1332 + ], + [ + 1337, + 1338 + ], + [ + 1339, + 1340 + ], + [ + 1352, + 1353 + ], + [ + 1357, + 1358 + ], + [ + 1360, + 1362 + ], + [ + 1366, + 1367 + ], + [ + 1370, + 1371 + ], + [ + 1373, + 1374 + ], + [ + 1375, + 1376 + ], + [ + 1379, + 1380 + ], + [ + 1381, + 1382 + ], + [ + 1383, + 1384 + ], + [ + 1387, + 1388 + ], + [ + 1389, + 1390 + ], + [ + 1391, + 1392 + ], + [ + 1400, + 1401 + ], + [ + 1410, + 1411 + ], + [ + 1412, + 1413 + ], + [ + 1414, + 1416 + ], + [ + 1419, + 1420 + ], + [ + 1421, + 1422 + ], + [ + 1423, + 1424 + ], + [ + 1427, + 1428 + ], + [ + 1429, + 1430 + ], + [ + 1431, + 1432 + ], + [ + 1440, + 1441 + ], + [ + 1444, + 1446 + ], + [ + 1450, + 1451 + ], + [ + 1452, + 1454 + ], + [ + 1455, + 1456 + ], + [ + 1469, + 1470 + ], + [ + 1471, + 1472 + ], + [ + 1477, + 1478 + ], + [ + 1481, + 1482 + ], + [ + 1483, + 1486 + ], + [ + 1492, + 1493 + ], + [ + 1495, + 1496 + ], + [ + 1498, + 1499 + ], + [ + 1502, + 1503 + ], + [ + 1506, + 1507 + ], + [ + 1510, + 1511 + ], + [ + 1512, + 1513 + ], + [ + 1514, + 1515 + ], + [ + 1521, + 1522 + ], + [ + 1526, + 1527 + ], + [ + 1528, + 1530 + ], + [ + 1531, + 1533 + ], + [ + 1534, + 1535 + ], + [ + 1537, + 1538 + ], + [ + 1540, + 1541 + ], + [ + 1542, + 1546 + ], + [ + 1552, + 1553 + ], + [ + 1554, + 1557 + ], + [ + 1558, + 1560 + ], + [ + 1561, + 1562 + ], + [ + 1567, + 1570 + ], + [ + 1571, + 1575 + ], + [ + 1579, + 1580 + ], + [ + 1581, + 1583 + ], + [ + 1585, + 1586 + ], + [ + 1587, + 1589 + ], + [ + 1593, + 1594 + ], + [ + 1599, + 1602 + ], + [ + 1603, + 1607 + ], + [ + 1615, + 1616 + ], + [ + 1621, + 1622 + ], + [ + 1623, + 1627 + ], + [ + 1629, + 1630 + ], + [ + 1640, + 1641 + ], + [ + 1644, + 1645 + ], + [ + 1647, + 1648 + ], + [ + 1655, + 1660 + ], + [ + 1664, + 1665 + ], + [ + 1667, + 1668 + ], + [ + 1676, + 1677 + ], + [ + 1681, + 1682 + ], + [ + 1683, + 1686 + ], + [ + 1694, + 1695 + ], + [ + 1698, + 1699 + ], + [ + 1700, + 1701 + ], + [ + 1706, + 1707 + ], + [ + 1708, + 1709 + ], + [ + 1710, + 1711 + ], + [ + 1712, + 1713 + ], + [ + 1717, + 1718 + ], + [ + 1724, + 1725 + ], + [ + 1726, + 1728 + ], + [ + 1730, + 1734 + ], + [ + 1736, + 1737 + ], + [ + 1740, + 1741 + ], + [ + 1744, + 1746 + ], + [ + 1749, + 1751 + ], + [ + 1753, + 1757 + ], + [ + 1759, + 1760 + ], + [ + 1766, + 1767 + ], + [ + 1773, + 1774 + ], + [ + 1777, + 1779 + ], + [ + 1784, + 1785 + ], + [ + 1792, + 1793 + ], + [ + 1794, + 1795 + ], + [ + 1802, + 1803 + ], + [ + 1804, + 1805 + ], + [ + 1811, + 1812 + ], + [ + 1816, + 1817 + ], + [ + 1818, + 1819 + ], + [ + 1826, + 1827 + ], + [ + 1828, + 1829 + ], + [ + 1835, + 1836 + ], + [ + 1840, + 1841 + ], + [ + 1842, + 1843 + ], + [ + 1853, + 1854 + ], + [ + 1857, + 1858 + ], + [ + 1861, + 1863 + ], + [ + 1865, + 1866 + ], + [ + 1867, + 1868 + ], + [ + 1873, + 1875 + ], + [ + 1878, + 1879 + ], + [ + 1880, + 1883 + ], + [ + 1887, + 1888 + ], + [ + 1899, + 1900 + ], + [ + 1906, + 1907 + ], + [ + 1908, + 1912 + ], + [ + 1913, + 1914 + ], + [ + 1919, + 1920 + ], + [ + 1930, + 1931 + ], + [ + 1932, + 1934 + ], + [ + 1935, + 1939 + ], + [ + 1940, + 1942 + ], + [ + 1943, + 1944 + ], + [ + 1950, + 1952 + ], + [ + 1959, + 1960 + ], + [ + 1961, + 1962 + ], + [ + 1975, + 1976 + ], + [ + 1983, + 1985 + ], + [ + 1990, + 1992 + ], + [ + 1998, + 2002 + ], + [ + 2004, + 2005 + ], + [ + 2028, + 2029 + ], + [ + 2030, + 2031 + ], + [ + 2038, + 2040 + ], + [ + 2045, + 2046 + ], + [ + 2047, + 2049 + ], + [ + 2056, + 2060 + ], + [ + 2062, + 2070 + ], + [ + 2072, + 2073 + ], + [ + 2076, + 2077 + ], + [ + 2078, + 2079 + ], + [ + 2090, + 2093 + ], + [ + 2099, + 2101 + ], + [ + 2107, + 2114 + ], + [ + 2116, + 2118 + ], + [ + 2119, + 2120 + ], + [ + 2129, + 2131 + ], + [ + 2132, + 2133 + ], + [ + 2140, + 2141 + ], + [ + 2147, + 2149 + ], + [ + 2158, + 2161 + ], + [ + 2164, + 2165 + ], + [ + 2166, + 2170 + ], + [ + 2171, + 2172 + ], + [ + 2173, + 2175 + ], + [ + 2176, + 2177 + ], + [ + 2185, + 2187 + ], + [ + 2190, + 2191 + ], + [ + 2197, + 2199 + ], + [ + 2200, + 2202 + ], + [ + 2211, + 2212 + ], + [ + 2214, + 2219 + ], + [ + 2220, + 2221 + ], + [ + 2223, + 2225 + ], + [ + 2226, + 2230 + ], + [ + 2231, + 2232 + ], + [ + 2238, + 2240 + ], + [ + 2241, + 2246 + ], + [ + 2248, + 2252 + ], + [ + 2253, + 2254 + ], + [ + 2256, + 2258 + ], + [ + 2261, + 2263 + ], + [ + 2264, + 2265 + ], + [ + 2277, + 2278 + ], + [ + 2280, + 2281 + ], + [ + 2284, + 2285 + ], + [ + 2290, + 2292 + ], + [ + 2299, + 2303 + ], + [ + 2305, + 2308 + ], + [ + 2310, + 2311 + ], + [ + 2321, + 2322 + ], + [ + 2324, + 2325 + ], + [ + 2328, + 2329 + ], + [ + 2336, + 2337 + ], + [ + 2338, + 2343 + ], + [ + 2344, + 2345 + ], + [ + 2359, + 2361 + ], + [ + 2366, + 2371 + ], + [ + 2375, + 2376 + ], + [ + 2378, + 2381 + ], + [ + 2382, + 2383 + ], + [ + 2398, + 2400 + ], + [ + 2401, + 2403 + ], + [ + 2420, + 2421 + ], + [ + 2423, + 2424 + ], + [ + 2429, + 2432 + ], + [ + 2433, + 2434 + ], + [ + 2436, + 2442 + ], + [ + 2447, + 2450 + ], + [ + 2453, + 2454 + ], + [ + 2455, + 2456 + ], + [ + 2457, + 2458 + ], + [ + 2474, + 2475 + ], + [ + 2476, + 2477 + ], + [ + 2493, + 2494 + ], + [ + 2495, + 2497 + ], + [ + 2499, + 2502 + ], + [ + 2510, + 2511 + ], + [ + 2515, + 2516 + ], + [ + 2520, + 2521 + ], + [ + 2529, + 2530 + ], + [ + 2531, + 2532 + ], + [ + 2533, + 2535 + ], + [ + 2536, + 2538 + ], + [ + 2540, + 2541 + ], + [ + 2544, + 2545 + ], + [ + 2552, + 2553 + ], + [ + 2558, + 2559 + ], + [ + 2565, + 2566 + ], + [ + 2572, + 2574 + ], + [ + 2575, + 2578 + ], + [ + 2580, + 2581 + ], + [ + 2582, + 2583 + ], + [ + 2584, + 2585 + ], + [ + 2588, + 2590 + ], + [ + 2592, + 2593 + ], + [ + 2598, + 2599 + ], + [ + 2603, + 2606 + ], + [ + 2607, + 2608 + ], + [ + 2623, + 2624 + ], + [ + 2628, + 2629 + ], + [ + 2630, + 2635 + ], + [ + 2637, + 2642 + ], + [ + 2651, + 2653 + ], + [ + 2655, + 2658 + ], + [ + 2660, + 2661 + ], + [ + 2670, + 2671 + ], + [ + 2674, + 2675 + ], + [ + 2681, + 2682 + ], + [ + 2694, + 2695 + ], + [ + 2697, + 2698 + ], + [ + 2700, + 2701 + ], + [ + 2703, + 2705 + ], + [ + 2706, + 2710 + ], + [ + 2711, + 2712 + ], + [ + 2713, + 2718 + ], + [ + 2720, + 2721 + ], + [ + 2722, + 2723 + ], + [ + 2728, + 2729 + ], + [ + 2733, + 2734 + ], + [ + 2737, + 2738 + ], + [ + 2742, + 2743 + ], + [ + 2749, + 2752 + ], + [ + 2760, + 2761 + ], + [ + 2763, + 2764 + ], + [ + 2766, + 2767 + ], + [ + 2769, + 2771 + ], + [ + 2772, + 2776 + ], + [ + 2777, + 2780 + ], + [ + 2782, + 2784 + ], + [ + 2785, + 2787 + ], + [ + 2788, + 2792 + ], + [ + 2793, + 2795 + ], + [ + 2797, + 2798 + ], + [ + 2800, + 2801 + ], + [ + 2803, + 2807 + ], + [ + 2808, + 2810 + ], + [ + 2811, + 2812 + ], + [ + 2814, + 2815 + ], + [ + 2820, + 2821 + ], + [ + 2828, + 2829 + ], + [ + 2831, + 2832 + ], + [ + 2838, + 2840 + ], + [ + 2847, + 2850 + ], + [ + 2851, + 2855 + ], + [ + 2856, + 2858 + ], + [ + 2859, + 2860 + ], + [ + 2867, + 2868 + ], + [ + 2869, + 2870 + ], + [ + 2876, + 2877 + ], + [ + 2882, + 2890 + ], + [ + 2892, + 2898 + ], + [ + 2899, + 2900 + ], + [ + 2901, + 2902 + ], + [ + 2904, + 2905 + ], + [ + 2912, + 2914 + ], + [ + 2916, + 2917 + ], + [ + 2918, + 2919 + ], + [ + 2923, + 2924 + ], + [ + 2927, + 2934 + ], + [ + 2936, + 2938 + ], + [ + 2940, + 2941 + ], + [ + 2955, + 2957 + ], + [ + 2959, + 2960 + ], + [ + 2961, + 2962 + ], + [ + 2965, + 2966 + ], + [ + 2974, + 2975 + ], + [ + 2976, + 2977 + ], + [ + 2979, + 2980 + ], + [ + 2996, + 2997 + ], + [ + 2998, + 3005 + ], + [ + 3007, + 3009 + ], + [ + 3011, + 3012 + ], + [ + 3020, + 3021 + ], + [ + 3023, + 3027 + ], + [ + 3028, + 3029 + ], + [ + 3035, + 3036 + ], + [ + 3037, + 3039 + ], + [ + 3040, + 3041 + ], + [ + 3045, + 3046 + ], + [ + 3051, + 3052 + ], + [ + 3054, + 3056 + ], + [ + 3065, + 3067 + ], + [ + 3068, + 3070 + ], + [ + 3071, + 3072 + ], + [ + 3079, + 3081 + ], + [ + 3085, + 3086 + ], + [ + 3092, + 3093 + ], + [ + 3095, + 3096 + ], + [ + 3108, + 3109 + ], + [ + 3111, + 3112 + ], + [ + 3117, + 3118 + ], + [ + 3126, + 3127 + ], + [ + 3135, + 3136 + ], + [ + 3137, + 3138 + ], + [ + 3139, + 3144 + ], + [ + 3149, + 3155 + ], + [ + 3159, + 3160 + ], + [ + 3165, + 3169 + ], + [ + 3173, + 3175 + ], + [ + 3179, + 3181 + ], + [ + 3183, + 3184 + ], + [ + 3201, + 3204 + ], + [ + 3207, + 3210 + ], + [ + 3211, + 3212 + ], + [ + 3214, + 3217 + ], + [ + 3221, + 3222 + ], + [ + 3224, + 3226 + ], + [ + 3231, + 3233 + ], + [ + 3236, + 3241 + ], + [ + 3245, + 3248 + ], + [ + 3251, + 3255 + ], + [ + 3257, + 3258 + ], + [ + 3263, + 3264 + ], + [ + 3267, + 3268 + ], + [ + 3270, + 3272 + ], + [ + 3273, + 3274 + ], + [ + 3276, + 3277 + ], + [ + 3279, + 3280 + ], + [ + 3287, + 3288 + ], + [ + 3289, + 3290 + ], + [ + 3296, + 3297 + ], + [ + 3298, + 3304 + ], + [ + 3307, + 3308 + ], + [ + 3309, + 3310 + ], + [ + 3311, + 3312 + ], + [ + 3314, + 3315 + ], + [ + 3317, + 3318 + ], + [ + 3319, + 3320 + ], + [ + 3322, + 3323 + ], + [ + 3338, + 3339 + ], + [ + 3348, + 3349 + ], + [ + 3352, + 3353 + ], + [ + 3360, + 3361 + ], + [ + 3367, + 3370 + ], + [ + 3374, + 3377 + ], + [ + 3379, + 3380 + ], + [ + 3387, + 3390 + ], + [ + 3396, + 3397 + ], + [ + 3402, + 3404 + ], + [ + 3406, + 3407 + ], + [ + 3409, + 3412 + ], + [ + 3413, + 3414 + ], + [ + 3418, + 3422 + ], + [ + 3434, + 3437 + ], + [ + 3438, + 3439 + ], + [ + 3442, + 3445 + ], + [ + 3452, + 3453 + ], + [ + 3457, + 3458 + ], + [ + 3460, + 3461 + ], + [ + 3473, + 3475 + ], + [ + 3480, + 3483 + ], + [ + 3486, + 3489 + ], + [ + 3498, + 3501 + ], + [ + 3505, + 3508 + ], + [ + 3510, + 3511 + ], + [ + 3513, + 3515 + ], + [ + 3517, + 3520 + ], + [ + 3521, + 3522 + ], + [ + 3525, + 3529 + ], + [ + 3540, + 3541 + ], + [ + 3550, + 3553 + ], + [ + 3555, + 3556 + ], + [ + 3557, + 3558 + ], + [ + 3563, + 3564 + ], + [ + 3566, + 3567 + ], + [ + 3570, + 3571 + ], + [ + 3579, + 3580 + ], + [ + 3583, + 3585 + ], + [ + 3588, + 3589 + ], + [ + 3599, + 3601 + ], + [ + 3605, + 3608 + ], + [ + 3610, + 3611 + ], + [ + 3613, + 3614 + ], + [ + 3615, + 3616 + ], + [ + 3622, + 3624 + ], + [ + 3631, + 3632 + ], + [ + 3633, + 3634 + ], + [ + 3636, + 3638 + ], + [ + 3640, + 3641 + ], + [ + 3645, + 3649 + ], + [ + 3662, + 3666 + ], + [ + 3680, + 3682 + ], + [ + 3686, + 3689 + ], + [ + 3691, + 3692 + ], + [ + 3705, + 3707 + ], + [ + 3709, + 3711 + ], + [ + 3713, + 3714 + ], + [ + 3715, + 3719 + ], + [ + 3724, + 3728 + ], + [ + 3737, + 3740 + ], + [ + 3742, + 3743 + ], + [ + 3752, + 3753 + ], + [ + 3754, + 3755 + ], + [ + 3761, + 3762 + ], + [ + 3764, + 3765 + ], + [ + 3766, + 3768 + ], + [ + 3771, + 3772 + ], + [ + 3782, + 3783 + ], + [ + 3784, + 3785 + ], + [ + 3788, + 3789 + ], + [ + 3794, + 3795 + ], + [ + 3796, + 3799 + ], + [ + 3801, + 3802 + ], + [ + 3812, + 3813 + ], + [ + 3814, + 3815 + ], + [ + 3817, + 3818 + ], + [ + 3827, + 3828 + ], + [ + 3831, + 3832 + ], + [ + 3842, + 3843 + ], + [ + 3844, + 3845 + ], + [ + 3846, + 3848 + ], + [ + 3856, + 3859 + ], + [ + 3861, + 3862 + ], + [ + 3872, + 3873 + ], + [ + 3874, + 3875 + ], + [ + 3876, + 3878 + ], + [ + 3886, + 3889 + ], + [ + 3891, + 3892 + ], + [ + 3904, + 3905 + ], + [ + 3906, + 3907 + ], + [ + 3912, + 3913 + ], + [ + 3914, + 3915 + ], + [ + 3917, + 3923 + ], + [ + 3924, + 3925 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/init.c", + "line_filter": { + "diff_chunks": [ + [ + 38, + 66 + ], + [ + 118, + 125 + ], + [ + 142, + 149 + ], + [ + 152, + 166 + ], + [ + 169, + 187 + ], + [ + 189, + 215 + ], + [ + 216, + 223 + ], + [ + 246, + 253 + ], + [ + 257, + 333 + ], + [ + 334, + 384 + ], + [ + 388, + 414 + ], + [ + 415, + 449 + ], + [ + 458, + 563 + ], + [ + 565, + 577 + ], + [ + 601, + 641 + ], + [ + 651, + 659 + ], + [ + 660, + 719 + ], + [ + 722, + 745 + ], + [ + 749, + 762 + ], + [ + 763, + 790 + ], + [ + 791, + 944 + ], + [ + 950, + 1235 + ], + [ + 1240, + 1249 + ], + [ + 1252, + 1288 + ], + [ + 1292, + 1323 + ], + [ + 1324, + 1339 + ] + ], + "lines_added": [ + [ + 41, + 57 + ], + [ + 62, + 63 + ], + [ + 121, + 122 + ], + [ + 145, + 146 + ], + [ + 155, + 156 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 172, + 173 + ], + [ + 176, + 177 + ], + [ + 180, + 182 + ], + [ + 183, + 184 + ], + [ + 192, + 195 + ], + [ + 197, + 198 + ], + [ + 202, + 203 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 219, + 220 + ], + [ + 249, + 250 + ], + [ + 260, + 261 + ], + [ + 262, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 282, + 283 + ], + [ + 284, + 287 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ], + [ + 294, + 296 + ], + [ + 297, + 298 + ], + [ + 299, + 303 + ], + [ + 309, + 312 + ], + [ + 313, + 314 + ], + [ + 320, + 323 + ], + [ + 329, + 330 + ], + [ + 337, + 338 + ], + [ + 339, + 342 + ], + [ + 345, + 352 + ], + [ + 357, + 358 + ], + [ + 361, + 362 + ], + [ + 363, + 367 + ], + [ + 369, + 371 + ], + [ + 372, + 373 + ], + [ + 377, + 378 + ], + [ + 380, + 381 + ], + [ + 391, + 392 + ], + [ + 393, + 398 + ], + [ + 400, + 403 + ], + [ + 404, + 408 + ], + [ + 410, + 411 + ], + [ + 418, + 419 + ], + [ + 425, + 426 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 435, + 436 + ], + [ + 437, + 446 + ], + [ + 461, + 462 + ], + [ + 464, + 466 + ], + [ + 469, + 470 + ], + [ + 476, + 479 + ], + [ + 480, + 481 + ], + [ + 482, + 483 + ], + [ + 486, + 497 + ], + [ + 503, + 504 + ], + [ + 505, + 506 + ], + [ + 508, + 509 + ], + [ + 514, + 515 + ], + [ + 517, + 519 + ], + [ + 521, + 522 + ], + [ + 524, + 525 + ], + [ + 527, + 529 + ], + [ + 530, + 531 + ], + [ + 534, + 535 + ], + [ + 536, + 538 + ], + [ + 539, + 540 + ], + [ + 541, + 546 + ], + [ + 547, + 551 + ], + [ + 555, + 558 + ], + [ + 559, + 560 + ], + [ + 568, + 574 + ], + [ + 604, + 605 + ], + [ + 608, + 609 + ], + [ + 614, + 616 + ], + [ + 620, + 622 + ], + [ + 623, + 625 + ], + [ + 627, + 630 + ], + [ + 636, + 638 + ], + [ + 654, + 656 + ], + [ + 663, + 664 + ], + [ + 665, + 666 + ], + [ + 667, + 668 + ], + [ + 670, + 672 + ], + [ + 675, + 677 + ], + [ + 680, + 681 + ], + [ + 682, + 683 + ], + [ + 688, + 689 + ], + [ + 694, + 695 + ], + [ + 699, + 700 + ], + [ + 705, + 706 + ], + [ + 708, + 709 + ], + [ + 711, + 713 + ], + [ + 715, + 716 + ], + [ + 725, + 726 + ], + [ + 731, + 732 + ], + [ + 733, + 734 + ], + [ + 738, + 739 + ], + [ + 741, + 742 + ], + [ + 752, + 755 + ], + [ + 756, + 759 + ], + [ + 766, + 767 + ], + [ + 773, + 776 + ], + [ + 781, + 782 + ], + [ + 786, + 787 + ], + [ + 794, + 796 + ], + [ + 799, + 800 + ], + [ + 803, + 805 + ], + [ + 806, + 807 + ], + [ + 808, + 809 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 821, + 823 + ], + [ + 824, + 825 + ], + [ + 826, + 827 + ], + [ + 830, + 832 + ], + [ + 833, + 834 + ], + [ + 835, + 836 + ], + [ + 839, + 841 + ], + [ + 842, + 843 + ], + [ + 844, + 845 + ], + [ + 848, + 850 + ], + [ + 851, + 852 + ], + [ + 853, + 854 + ], + [ + 857, + 859 + ], + [ + 860, + 861 + ], + [ + 862, + 863 + ], + [ + 866, + 867 + ], + [ + 868, + 903 + ], + [ + 904, + 906 + ], + [ + 907, + 909 + ], + [ + 910, + 926 + ], + [ + 930, + 931 + ], + [ + 933, + 934 + ], + [ + 935, + 936 + ], + [ + 938, + 939 + ], + [ + 940, + 941 + ], + [ + 953, + 954 + ], + [ + 959, + 960 + ], + [ + 963, + 965 + ], + [ + 967, + 970 + ], + [ + 972, + 973 + ], + [ + 978, + 982 + ], + [ + 985, + 996 + ], + [ + 999, + 1002 + ], + [ + 1003, + 1004 + ], + [ + 1005, + 1006 + ], + [ + 1011, + 1012 + ], + [ + 1016, + 1018 + ], + [ + 1022, + 1024 + ], + [ + 1025, + 1027 + ], + [ + 1028, + 1031 + ], + [ + 1034, + 1035 + ], + [ + 1040, + 1041 + ], + [ + 1042, + 1043 + ], + [ + 1046, + 1048 + ], + [ + 1049, + 1050 + ], + [ + 1052, + 1054 + ], + [ + 1055, + 1064 + ], + [ + 1066, + 1068 + ], + [ + 1069, + 1070 + ], + [ + 1075, + 1076 + ], + [ + 1082, + 1088 + ], + [ + 1092, + 1094 + ], + [ + 1096, + 1100 + ], + [ + 1104, + 1107 + ], + [ + 1108, + 1109 + ], + [ + 1110, + 1111 + ], + [ + 1112, + 1114 + ], + [ + 1118, + 1122 + ], + [ + 1123, + 1126 + ], + [ + 1127, + 1130 + ], + [ + 1136, + 1137 + ], + [ + 1139, + 1140 + ], + [ + 1144, + 1148 + ], + [ + 1149, + 1150 + ], + [ + 1153, + 1154 + ], + [ + 1159, + 1160 + ], + [ + 1161, + 1162 + ], + [ + 1165, + 1167 + ], + [ + 1170, + 1173 + ], + [ + 1174, + 1178 + ], + [ + 1180, + 1181 + ], + [ + 1182, + 1183 + ], + [ + 1185, + 1186 + ], + [ + 1190, + 1195 + ], + [ + 1196, + 1197 + ], + [ + 1200, + 1201 + ], + [ + 1206, + 1207 + ], + [ + 1208, + 1209 + ], + [ + 1213, + 1215 + ], + [ + 1217, + 1218 + ], + [ + 1224, + 1225 + ], + [ + 1226, + 1228 + ], + [ + 1229, + 1230 + ], + [ + 1231, + 1232 + ], + [ + 1243, + 1244 + ], + [ + 1245, + 1246 + ], + [ + 1255, + 1257 + ], + [ + 1261, + 1262 + ], + [ + 1263, + 1264 + ], + [ + 1265, + 1266 + ], + [ + 1268, + 1269 + ], + [ + 1271, + 1272 + ], + [ + 1274, + 1275 + ], + [ + 1277, + 1278 + ], + [ + 1280, + 1281 + ], + [ + 1283, + 1285 + ], + [ + 1295, + 1296 + ], + [ + 1297, + 1299 + ], + [ + 1300, + 1301 + ], + [ + 1304, + 1305 + ], + [ + 1306, + 1307 + ], + [ + 1308, + 1311 + ], + [ + 1312, + 1313 + ], + [ + 1315, + 1316 + ], + [ + 1319, + 1320 + ], + [ + 1327, + 1328 + ], + [ + 1334, + 1335 + ], + [ + 1336, + 1338 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/mapfile.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 26, + 58 + ], + [ + 92, + 407 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 54, + 55 + ], + [ + 95, + 96 + ], + [ + 102, + 104 + ], + [ + 105, + 140 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 151, + 153 + ], + [ + 156, + 204 + ], + [ + 206, + 209 + ], + [ + 210, + 214 + ], + [ + 215, + 216 + ], + [ + 217, + 221 + ], + [ + 222, + 223 + ], + [ + 225, + 239 + ], + [ + 242, + 243 + ], + [ + 246, + 247 + ], + [ + 249, + 253 + ], + [ + 254, + 259 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 271, + 272 + ], + [ + 276, + 281 + ], + [ + 282, + 286 + ], + [ + 288, + 292 + ], + [ + 294, + 296 + ], + [ + 299, + 300 + ], + [ + 305, + 306 + ], + [ + 310, + 311 + ], + [ + 315, + 320 + ], + [ + 322, + 326 + ], + [ + 328, + 330 + ], + [ + 333, + 334 + ], + [ + 336, + 338 + ], + [ + 340, + 341 + ], + [ + 345, + 346 + ], + [ + 349, + 379 + ], + [ + 380, + 392 + ], + [ + 397, + 401 + ], + [ + 402, + 403 + ], + [ + 405, + 406 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/memory.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 24 + ], + [ + 26, + 54 + ], + [ + 87, + 94 + ], + [ + 105, + 112 + ], + [ + 120, + 129 + ], + [ + 137, + 146 + ], + [ + 148, + 157 + ], + [ + 158, + 169 + ], + [ + 170, + 189 + ], + [ + 191, + 220 + ], + [ + 221, + 234 + ], + [ + 235, + 277 + ], + [ + 278, + 287 + ], + [ + 290, + 341 + ], + [ + 357, + 383 + ], + [ + 395, + 423 + ], + [ + 429, + 517 + ] + ], + "lines_added": [ + [ + 19, + 21 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 90, + 91 + ], + [ + 108, + 109 + ], + [ + 123, + 126 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 161, + 163 + ], + [ + 165, + 166 + ], + [ + 173, + 174 + ], + [ + 177, + 178 + ], + [ + 179, + 182 + ], + [ + 185, + 186 + ], + [ + 194, + 195 + ], + [ + 197, + 198 + ], + [ + 204, + 205 + ], + [ + 208, + 209 + ], + [ + 210, + 214 + ], + [ + 216, + 217 + ], + [ + 224, + 225 + ], + [ + 230, + 231 + ], + [ + 238, + 239 + ], + [ + 241, + 242 + ], + [ + 244, + 248 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 264, + 265 + ], + [ + 268, + 269 + ], + [ + 272, + 274 + ], + [ + 281, + 282 + ], + [ + 283, + 284 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 305, + 306 + ], + [ + 310, + 315 + ], + [ + 316, + 317 + ], + [ + 319, + 320 + ], + [ + 321, + 323 + ], + [ + 325, + 326 + ], + [ + 330, + 331 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 337, + 338 + ], + [ + 360, + 361 + ], + [ + 364, + 366 + ], + [ + 367, + 368 + ], + [ + 369, + 370 + ], + [ + 373, + 375 + ], + [ + 377, + 378 + ], + [ + 379, + 380 + ], + [ + 398, + 399 + ], + [ + 402, + 403 + ], + [ + 406, + 408 + ], + [ + 411, + 413 + ], + [ + 415, + 416 + ], + [ + 417, + 418 + ], + [ + 419, + 420 + ], + [ + 432, + 433 + ], + [ + 436, + 437 + ], + [ + 438, + 439 + ], + [ + 442, + 443 + ], + [ + 444, + 445 + ], + [ + 450, + 451 + ], + [ + 457, + 458 + ], + [ + 461, + 462 + ], + [ + 463, + 464 + ], + [ + 467, + 468 + ], + [ + 469, + 470 + ], + [ + 475, + 476 + ], + [ + 480, + 481 + ], + [ + 484, + 485 + ], + [ + 486, + 487 + ], + [ + 490, + 491 + ], + [ + 492, + 493 + ], + [ + 498, + 499 + ], + [ + 503, + 504 + ], + [ + 507, + 508 + ], + [ + 509, + 510 + ], + [ + 513, + 514 + ], + [ + 515, + 516 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/object.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 69, + 85 + ], + [ + 92, + 105 + ], + [ + 111, + 123 + ], + [ + 124, + 142 + ], + [ + 143, + 150 + ], + [ + 156, + 169 + ], + [ + 171, + 178 + ], + [ + 192, + 208 + ], + [ + 220, + 227 + ], + [ + 229, + 237 + ], + [ + 239, + 379 + ], + [ + 380, + 390 + ], + [ + 391, + 403 + ], + [ + 404, + 418 + ], + [ + 422, + 495 + ], + [ + 498, + 542 + ], + [ + 543, + 577 + ], + [ + 581, + 621 + ], + [ + 623, + 682 + ], + [ + 684, + 739 + ], + [ + 742, + 758 + ], + [ + 767, + 807 + ], + [ + 809, + 830 + ], + [ + 832, + 853 + ], + [ + 855, + 910 + ], + [ + 913, + 1078 + ], + [ + 1079, + 1160 + ], + [ + 1163, + 1328 + ], + [ + 1332, + 1436 + ], + [ + 1439, + 1526 + ], + [ + 1528, + 1535 + ], + [ + 1536, + 1580 + ], + [ + 1592, + 1639 + ], + [ + 1641, + 1754 + ], + [ + 1755, + 1876 + ], + [ + 1879, + 1897 + ], + [ + 1898, + 1971 + ], + [ + 1973, + 2208 + ], + [ + 2210, + 2307 + ], + [ + 2309, + 2330 + ], + [ + 2341, + 2374 + ], + [ + 2383, + 2408 + ], + [ + 2414, + 2447 + ], + [ + 2460, + 2490 + ], + [ + 2492, + 2578 + ], + [ + 2581, + 2704 + ], + [ + 2705, + 2730 + ], + [ + 2734, + 2745 + ], + [ + 2748, + 2761 + ], + [ + 2766, + 2780 + ], + [ + 2784, + 2810 + ], + [ + 2812, + 2903 + ], + [ + 2908, + 2927 + ], + [ + 2933, + 2979 + ], + [ + 2980, + 2998 + ], + [ + 3001, + 3063 + ], + [ + 3065, + 3083 + ], + [ + 3086, + 3093 + ], + [ + 3094, + 3101 + ], + [ + 3107, + 3184 + ], + [ + 3185, + 3257 + ], + [ + 3260, + 3291 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 32, + 33 + ], + [ + 72, + 73 + ], + [ + 76, + 78 + ], + [ + 81, + 82 + ], + [ + 95, + 96 + ], + [ + 100, + 102 + ], + [ + 114, + 116 + ], + [ + 119, + 120 + ], + [ + 127, + 128 + ], + [ + 132, + 133 + ], + [ + 138, + 139 + ], + [ + 146, + 147 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 165, + 166 + ], + [ + 174, + 175 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 201, + 205 + ], + [ + 223, + 224 + ], + [ + 232, + 234 + ], + [ + 242, + 243 + ], + [ + 248, + 249 + ], + [ + 253, + 256 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 273 + ], + [ + 275, + 276 + ], + [ + 280, + 281 + ], + [ + 282, + 283 + ], + [ + 286, + 289 + ], + [ + 291, + 292 + ], + [ + 296, + 297 + ], + [ + 298, + 299 + ], + [ + 302, + 305 + ], + [ + 307, + 308 + ], + [ + 312, + 313 + ], + [ + 315, + 316 + ], + [ + 317, + 318 + ], + [ + 322, + 336 + ], + [ + 339, + 343 + ], + [ + 346, + 347 + ], + [ + 350, + 351 + ], + [ + 352, + 353 + ], + [ + 356, + 357 + ], + [ + 362, + 365 + ], + [ + 367, + 369 + ], + [ + 374, + 376 + ], + [ + 383, + 385 + ], + [ + 386, + 387 + ], + [ + 394, + 395 + ], + [ + 397, + 398 + ], + [ + 399, + 400 + ], + [ + 407, + 408 + ], + [ + 410, + 411 + ], + [ + 412, + 413 + ], + [ + 414, + 415 + ], + [ + 425, + 426 + ], + [ + 427, + 428 + ], + [ + 429, + 430 + ], + [ + 433, + 434 + ], + [ + 436, + 437 + ], + [ + 438, + 440 + ], + [ + 443, + 444 + ], + [ + 446, + 447 + ], + [ + 448, + 450 + ], + [ + 453, + 454 + ], + [ + 456, + 457 + ], + [ + 458, + 460 + ], + [ + 463, + 464 + ], + [ + 465, + 466 + ], + [ + 469, + 470 + ], + [ + 473, + 474 + ], + [ + 475, + 477 + ], + [ + 478, + 479 + ], + [ + 481, + 487 + ], + [ + 488, + 489 + ], + [ + 491, + 492 + ], + [ + 501, + 502 + ], + [ + 503, + 504 + ], + [ + 505, + 506 + ], + [ + 512, + 513 + ], + [ + 517, + 518 + ], + [ + 521, + 523 + ], + [ + 524, + 528 + ], + [ + 531, + 534 + ], + [ + 535, + 539 + ], + [ + 546, + 547 + ], + [ + 548, + 550 + ], + [ + 553, + 554 + ], + [ + 557, + 560 + ], + [ + 561, + 562 + ], + [ + 565, + 566 + ], + [ + 567, + 568 + ], + [ + 571, + 572 + ], + [ + 573, + 574 + ], + [ + 584, + 585 + ], + [ + 590, + 592 + ], + [ + 596, + 597 + ], + [ + 598, + 601 + ], + [ + 605, + 606 + ], + [ + 607, + 611 + ], + [ + 612, + 614 + ], + [ + 615, + 616 + ], + [ + 617, + 618 + ], + [ + 626, + 628 + ], + [ + 629, + 636 + ], + [ + 639, + 642 + ], + [ + 644, + 645 + ], + [ + 651, + 652 + ], + [ + 658, + 659 + ], + [ + 661, + 662 + ], + [ + 663, + 664 + ], + [ + 666, + 667 + ], + [ + 671, + 674 + ], + [ + 676, + 677 + ], + [ + 678, + 679 + ], + [ + 687, + 688 + ], + [ + 689, + 690 + ], + [ + 691, + 694 + ], + [ + 696, + 697 + ], + [ + 698, + 699 + ], + [ + 705, + 708 + ], + [ + 709, + 712 + ], + [ + 714, + 715 + ], + [ + 717, + 718 + ], + [ + 719, + 720 + ], + [ + 726, + 729 + ], + [ + 732, + 736 + ], + [ + 745, + 747 + ], + [ + 750, + 751 + ], + [ + 752, + 755 + ], + [ + 770, + 771 + ], + [ + 773, + 774 + ], + [ + 775, + 776 + ], + [ + 777, + 782 + ], + [ + 784, + 790 + ], + [ + 792, + 797 + ], + [ + 799, + 800 + ], + [ + 803, + 804 + ], + [ + 812, + 813 + ], + [ + 818, + 821 + ], + [ + 822, + 823 + ], + [ + 826, + 827 + ], + [ + 835, + 836 + ], + [ + 841, + 844 + ], + [ + 845, + 846 + ], + [ + 849, + 850 + ], + [ + 858, + 859 + ], + [ + 864, + 867 + ], + [ + 868, + 869 + ], + [ + 872, + 873 + ], + [ + 876, + 878 + ], + [ + 879, + 880 + ], + [ + 881, + 883 + ], + [ + 884, + 890 + ], + [ + 894, + 895 + ], + [ + 896, + 897 + ], + [ + 898, + 904 + ], + [ + 906, + 907 + ], + [ + 916, + 917 + ], + [ + 919, + 920 + ], + [ + 921, + 923 + ], + [ + 924, + 926 + ], + [ + 927, + 930 + ], + [ + 932, + 935 + ], + [ + 937, + 938 + ], + [ + 942, + 943 + ], + [ + 944, + 945 + ], + [ + 950, + 951 + ], + [ + 953, + 956 + ], + [ + 958, + 959 + ], + [ + 964, + 965 + ], + [ + 967, + 968 + ], + [ + 969, + 971 + ], + [ + 972, + 973 + ], + [ + 974, + 977 + ], + [ + 979, + 982 + ], + [ + 984, + 985 + ], + [ + 991, + 992 + ], + [ + 994, + 997 + ], + [ + 999, + 1000 + ], + [ + 1003, + 1004 + ], + [ + 1005, + 1006 + ], + [ + 1008, + 1011 + ], + [ + 1017, + 1019 + ], + [ + 1020, + 1021 + ], + [ + 1022, + 1023 + ], + [ + 1025, + 1026 + ], + [ + 1027, + 1028 + ], + [ + 1029, + 1030 + ], + [ + 1031, + 1032 + ], + [ + 1033, + 1034 + ], + [ + 1035, + 1036 + ], + [ + 1039, + 1040 + ], + [ + 1041, + 1042 + ], + [ + 1044, + 1047 + ], + [ + 1053, + 1056 + ], + [ + 1057, + 1058 + ], + [ + 1061, + 1063 + ], + [ + 1067, + 1070 + ], + [ + 1073, + 1075 + ], + [ + 1082, + 1085 + ], + [ + 1091, + 1093 + ], + [ + 1094, + 1095 + ], + [ + 1096, + 1097 + ], + [ + 1098, + 1100 + ], + [ + 1101, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1105, + 1106 + ], + [ + 1108, + 1110 + ], + [ + 1111, + 1117 + ], + [ + 1121, + 1122 + ], + [ + 1123, + 1124 + ], + [ + 1125, + 1131 + ], + [ + 1135, + 1136 + ], + [ + 1139, + 1143 + ], + [ + 1145, + 1149 + ], + [ + 1150, + 1152 + ], + [ + 1154, + 1157 + ], + [ + 1166, + 1167 + ], + [ + 1168, + 1180 + ], + [ + 1181, + 1182 + ], + [ + 1187, + 1189 + ], + [ + 1190, + 1192 + ], + [ + 1193, + 1194 + ], + [ + 1195, + 1196 + ], + [ + 1197, + 1198 + ], + [ + 1200, + 1203 + ], + [ + 1207, + 1209 + ], + [ + 1210, + 1214 + ], + [ + 1216, + 1218 + ], + [ + 1222, + 1223 + ], + [ + 1224, + 1226 + ], + [ + 1227, + 1229 + ], + [ + 1234, + 1235 + ], + [ + 1236, + 1238 + ], + [ + 1239, + 1241 + ], + [ + 1247, + 1250 + ], + [ + 1251, + 1254 + ], + [ + 1255, + 1258 + ], + [ + 1259, + 1261 + ], + [ + 1262, + 1265 + ], + [ + 1266, + 1267 + ], + [ + 1268, + 1271 + ], + [ + 1272, + 1273 + ], + [ + 1274, + 1277 + ], + [ + 1278, + 1279 + ], + [ + 1280, + 1283 + ], + [ + 1284, + 1285 + ], + [ + 1286, + 1289 + ], + [ + 1290, + 1291 + ], + [ + 1292, + 1295 + ], + [ + 1296, + 1297 + ], + [ + 1298, + 1301 + ], + [ + 1302, + 1303 + ], + [ + 1304, + 1307 + ], + [ + 1308, + 1311 + ], + [ + 1317, + 1318 + ], + [ + 1320, + 1321 + ], + [ + 1322, + 1325 + ], + [ + 1335, + 1337 + ], + [ + 1338, + 1340 + ], + [ + 1341, + 1342 + ], + [ + 1343, + 1344 + ], + [ + 1345, + 1346 + ], + [ + 1347, + 1348 + ], + [ + 1353, + 1354 + ], + [ + 1357, + 1360 + ], + [ + 1361, + 1362 + ], + [ + 1363, + 1366 + ], + [ + 1367, + 1368 + ], + [ + 1369, + 1372 + ], + [ + 1373, + 1374 + ], + [ + 1375, + 1378 + ], + [ + 1379, + 1380 + ], + [ + 1381, + 1384 + ], + [ + 1385, + 1386 + ], + [ + 1387, + 1390 + ], + [ + 1391, + 1392 + ], + [ + 1393, + 1396 + ], + [ + 1397, + 1398 + ], + [ + 1399, + 1402 + ], + [ + 1403, + 1404 + ], + [ + 1405, + 1408 + ], + [ + 1409, + 1410 + ], + [ + 1411, + 1414 + ], + [ + 1418, + 1419 + ], + [ + 1421, + 1422 + ], + [ + 1423, + 1426 + ], + [ + 1430, + 1431 + ], + [ + 1432, + 1433 + ], + [ + 1442, + 1445 + ], + [ + 1447, + 1448 + ], + [ + 1453, + 1454 + ], + [ + 1455, + 1456 + ], + [ + 1457, + 1458 + ], + [ + 1461, + 1463 + ], + [ + 1464, + 1465 + ], + [ + 1468, + 1469 + ], + [ + 1471, + 1474 + ], + [ + 1476, + 1477 + ], + [ + 1478, + 1479 + ], + [ + 1482, + 1483 + ], + [ + 1484, + 1489 + ], + [ + 1492, + 1493 + ], + [ + 1497, + 1498 + ], + [ + 1499, + 1503 + ], + [ + 1504, + 1506 + ], + [ + 1509, + 1510 + ], + [ + 1514, + 1515 + ], + [ + 1517, + 1520 + ], + [ + 1522, + 1523 + ], + [ + 1531, + 1532 + ], + [ + 1539, + 1543 + ], + [ + 1545, + 1546 + ], + [ + 1548, + 1550 + ], + [ + 1551, + 1552 + ], + [ + 1555, + 1556 + ], + [ + 1559, + 1560 + ], + [ + 1561, + 1563 + ], + [ + 1566, + 1567 + ], + [ + 1568, + 1569 + ], + [ + 1574, + 1577 + ], + [ + 1595, + 1596 + ], + [ + 1600, + 1601 + ], + [ + 1605, + 1607 + ], + [ + 1608, + 1611 + ], + [ + 1612, + 1614 + ], + [ + 1615, + 1618 + ], + [ + 1619, + 1621 + ], + [ + 1627, + 1628 + ], + [ + 1629, + 1631 + ], + [ + 1632, + 1633 + ], + [ + 1635, + 1636 + ], + [ + 1644, + 1646 + ], + [ + 1647, + 1648 + ], + [ + 1650, + 1651 + ], + [ + 1657, + 1658 + ], + [ + 1659, + 1661 + ], + [ + 1662, + 1663 + ], + [ + 1665, + 1666 + ], + [ + 1671, + 1673 + ], + [ + 1674, + 1676 + ], + [ + 1677, + 1678 + ], + [ + 1680, + 1681 + ], + [ + 1684, + 1685 + ], + [ + 1687, + 1690 + ], + [ + 1692, + 1695 + ], + [ + 1698, + 1699 + ], + [ + 1701, + 1702 + ], + [ + 1703, + 1709 + ], + [ + 1712, + 1713 + ], + [ + 1717, + 1718 + ], + [ + 1723, + 1725 + ], + [ + 1726, + 1727 + ], + [ + 1732, + 1733 + ], + [ + 1734, + 1736 + ], + [ + 1740, + 1741 + ], + [ + 1744, + 1745 + ], + [ + 1748, + 1749 + ], + [ + 1750, + 1751 + ], + [ + 1758, + 1760 + ], + [ + 1764, + 1766 + ], + [ + 1767, + 1769 + ], + [ + 1771, + 1775 + ], + [ + 1777, + 1778 + ], + [ + 1780, + 1782 + ], + [ + 1784, + 1785 + ], + [ + 1786, + 1797 + ], + [ + 1802, + 1810 + ], + [ + 1812, + 1813 + ], + [ + 1814, + 1818 + ], + [ + 1819, + 1820 + ], + [ + 1822, + 1837 + ], + [ + 1840, + 1841 + ], + [ + 1844, + 1845 + ], + [ + 1846, + 1847 + ], + [ + 1852, + 1854 + ], + [ + 1856, + 1859 + ], + [ + 1860, + 1862 + ], + [ + 1863, + 1864 + ], + [ + 1869, + 1871 + ], + [ + 1872, + 1873 + ], + [ + 1882, + 1884 + ], + [ + 1885, + 1888 + ], + [ + 1889, + 1890 + ], + [ + 1891, + 1892 + ], + [ + 1893, + 1894 + ], + [ + 1901, + 1904 + ], + [ + 1905, + 1908 + ], + [ + 1910, + 1911 + ], + [ + 1912, + 1915 + ], + [ + 1916, + 1917 + ], + [ + 1918, + 1919 + ], + [ + 1921, + 1930 + ], + [ + 1931, + 1932 + ], + [ + 1934, + 1938 + ], + [ + 1940, + 1942 + ], + [ + 1946, + 1947 + ], + [ + 1948, + 1949 + ], + [ + 1951, + 1954 + ], + [ + 1956, + 1961 + ], + [ + 1965, + 1966 + ], + [ + 1967, + 1968 + ], + [ + 1976, + 1979 + ], + [ + 1982, + 1985 + ], + [ + 1986, + 1987 + ], + [ + 1989, + 1990 + ], + [ + 1991, + 1994 + ], + [ + 1995, + 1997 + ], + [ + 2001, + 2002 + ], + [ + 2003, + 2005 + ], + [ + 2007, + 2010 + ], + [ + 2012, + 2015 + ], + [ + 2019, + 2022 + ], + [ + 2024, + 2026 + ], + [ + 2029, + 2030 + ], + [ + 2031, + 2032 + ], + [ + 2035, + 2039 + ], + [ + 2041, + 2043 + ], + [ + 2044, + 2045 + ], + [ + 2047, + 2050 + ], + [ + 2052, + 2056 + ], + [ + 2058, + 2060 + ], + [ + 2061, + 2062 + ], + [ + 2066, + 2069 + ], + [ + 2071, + 2075 + ], + [ + 2077, + 2079 + ], + [ + 2080, + 2081 + ], + [ + 2083, + 2086 + ], + [ + 2088, + 2092 + ], + [ + 2094, + 2096 + ], + [ + 2097, + 2098 + ], + [ + 2100, + 2103 + ], + [ + 2105, + 2108 + ], + [ + 2109, + 2111 + ], + [ + 2112, + 2114 + ], + [ + 2117, + 2120 + ], + [ + 2122, + 2128 + ], + [ + 2130, + 2132 + ], + [ + 2134, + 2137 + ], + [ + 2139, + 2141 + ], + [ + 2143, + 2145 + ], + [ + 2146, + 2147 + ], + [ + 2153, + 2154 + ], + [ + 2160, + 2161 + ], + [ + 2163, + 2166 + ], + [ + 2167, + 2168 + ], + [ + 2171, + 2172 + ], + [ + 2173, + 2178 + ], + [ + 2180, + 2186 + ], + [ + 2188, + 2189 + ], + [ + 2192, + 2193 + ], + [ + 2196, + 2197 + ], + [ + 2203, + 2205 + ], + [ + 2213, + 2215 + ], + [ + 2217, + 2220 + ], + [ + 2221, + 2222 + ], + [ + 2223, + 2224 + ], + [ + 2225, + 2226 + ], + [ + 2230, + 2231 + ], + [ + 2232, + 2233 + ], + [ + 2235, + 2243 + ], + [ + 2244, + 2246 + ], + [ + 2250, + 2254 + ], + [ + 2255, + 2256 + ], + [ + 2258, + 2261 + ], + [ + 2263, + 2267 + ], + [ + 2268, + 2269 + ], + [ + 2272, + 2273 + ], + [ + 2274, + 2276 + ], + [ + 2278, + 2279 + ], + [ + 2282, + 2283 + ], + [ + 2286, + 2287 + ], + [ + 2288, + 2289 + ], + [ + 2291, + 2293 + ], + [ + 2294, + 2295 + ], + [ + 2300, + 2301 + ], + [ + 2302, + 2304 + ], + [ + 2312, + 2313 + ], + [ + 2316, + 2317 + ], + [ + 2321, + 2322 + ], + [ + 2326, + 2327 + ], + [ + 2344, + 2346 + ], + [ + 2347, + 2349 + ], + [ + 2353, + 2358 + ], + [ + 2360, + 2362 + ], + [ + 2363, + 2364 + ], + [ + 2365, + 2366 + ], + [ + 2367, + 2368 + ], + [ + 2370, + 2371 + ], + [ + 2386, + 2387 + ], + [ + 2392, + 2393 + ], + [ + 2394, + 2397 + ], + [ + 2399, + 2402 + ], + [ + 2404, + 2405 + ], + [ + 2417, + 2418 + ], + [ + 2421, + 2422 + ], + [ + 2423, + 2424 + ], + [ + 2428, + 2429 + ], + [ + 2430, + 2433 + ], + [ + 2434, + 2435 + ], + [ + 2436, + 2437 + ], + [ + 2438, + 2439 + ], + [ + 2443, + 2444 + ], + [ + 2463, + 2464 + ], + [ + 2468, + 2469 + ], + [ + 2473, + 2476 + ], + [ + 2477, + 2478 + ], + [ + 2481, + 2482 + ], + [ + 2484, + 2485 + ], + [ + 2486, + 2487 + ], + [ + 2495, + 2498 + ], + [ + 2499, + 2501 + ], + [ + 2502, + 2504 + ], + [ + 2505, + 2510 + ], + [ + 2515, + 2529 + ], + [ + 2530, + 2534 + ], + [ + 2536, + 2537 + ], + [ + 2540, + 2542 + ], + [ + 2543, + 2547 + ], + [ + 2549, + 2552 + ], + [ + 2554, + 2555 + ], + [ + 2556, + 2560 + ], + [ + 2561, + 2565 + ], + [ + 2568, + 2572 + ], + [ + 2574, + 2575 + ], + [ + 2584, + 2585 + ], + [ + 2586, + 2587 + ], + [ + 2589, + 2590 + ], + [ + 2594, + 2595 + ], + [ + 2601, + 2602 + ], + [ + 2606, + 2609 + ], + [ + 2610, + 2611 + ], + [ + 2612, + 2613 + ], + [ + 2616, + 2617 + ], + [ + 2622, + 2624 + ], + [ + 2628, + 2630 + ], + [ + 2631, + 2634 + ], + [ + 2637, + 2641 + ], + [ + 2643, + 2644 + ], + [ + 2647, + 2648 + ], + [ + 2651, + 2652 + ], + [ + 2656, + 2659 + ], + [ + 2662, + 2663 + ], + [ + 2665, + 2666 + ], + [ + 2668, + 2669 + ], + [ + 2672, + 2673 + ], + [ + 2676, + 2677 + ], + [ + 2681, + 2685 + ], + [ + 2688, + 2689 + ], + [ + 2691, + 2694 + ], + [ + 2696, + 2697 + ], + [ + 2700, + 2701 + ], + [ + 2708, + 2709 + ], + [ + 2710, + 2711 + ], + [ + 2714, + 2715 + ], + [ + 2719, + 2720 + ], + [ + 2721, + 2727 + ], + [ + 2737, + 2739 + ], + [ + 2740, + 2742 + ], + [ + 2751, + 2752 + ], + [ + 2757, + 2758 + ], + [ + 2769, + 2774 + ], + [ + 2776, + 2777 + ], + [ + 2787, + 2788 + ], + [ + 2793, + 2794 + ], + [ + 2800, + 2801 + ], + [ + 2802, + 2805 + ], + [ + 2806, + 2807 + ], + [ + 2815, + 2817 + ], + [ + 2822, + 2823 + ], + [ + 2826, + 2829 + ], + [ + 2830, + 2831 + ], + [ + 2834, + 2835 + ], + [ + 2840, + 2842 + ], + [ + 2847, + 2848 + ], + [ + 2853, + 2854 + ], + [ + 2857, + 2860 + ], + [ + 2862, + 2865 + ], + [ + 2866, + 2867 + ], + [ + 2872, + 2873 + ], + [ + 2877, + 2879 + ], + [ + 2881, + 2882 + ], + [ + 2885, + 2886 + ], + [ + 2887, + 2889 + ], + [ + 2892, + 2894 + ], + [ + 2895, + 2896 + ], + [ + 2899, + 2900 + ], + [ + 2911, + 2912 + ], + [ + 2918, + 2922 + ], + [ + 2923, + 2924 + ], + [ + 2936, + 2937 + ], + [ + 2938, + 2939 + ], + [ + 2941, + 2943 + ], + [ + 2947, + 2948 + ], + [ + 2950, + 2951 + ], + [ + 2954, + 2955 + ], + [ + 2957, + 2958 + ], + [ + 2961, + 2962 + ], + [ + 2965, + 2967 + ], + [ + 2968, + 2970 + ], + [ + 2971, + 2974 + ], + [ + 2975, + 2976 + ], + [ + 2983, + 2985 + ], + [ + 2987, + 2988 + ], + [ + 2994, + 2995 + ], + [ + 3004, + 3005 + ], + [ + 3006, + 3009 + ], + [ + 3013, + 3016 + ], + [ + 3017, + 3018 + ], + [ + 3022, + 3024 + ], + [ + 3025, + 3026 + ], + [ + 3028, + 3029 + ], + [ + 3035, + 3036 + ], + [ + 3037, + 3038 + ], + [ + 3040, + 3041 + ], + [ + 3045, + 3050 + ], + [ + 3051, + 3052 + ], + [ + 3057, + 3058 + ], + [ + 3059, + 3060 + ], + [ + 3068, + 3069 + ], + [ + 3072, + 3074 + ], + [ + 3075, + 3077 + ], + [ + 3079, + 3080 + ], + [ + 3089, + 3090 + ], + [ + 3097, + 3098 + ], + [ + 3110, + 3111 + ], + [ + 3114, + 3115 + ], + [ + 3116, + 3117 + ], + [ + 3119, + 3120 + ], + [ + 3121, + 3123 + ], + [ + 3124, + 3125 + ], + [ + 3127, + 3129 + ], + [ + 3134, + 3135 + ], + [ + 3136, + 3137 + ], + [ + 3139, + 3140 + ], + [ + 3143, + 3144 + ], + [ + 3148, + 3150 + ], + [ + 3151, + 3152 + ], + [ + 3155, + 3156 + ], + [ + 3157, + 3158 + ], + [ + 3160, + 3161 + ], + [ + 3162, + 3168 + ], + [ + 3169, + 3173 + ], + [ + 3176, + 3177 + ], + [ + 3180, + 3181 + ], + [ + 3188, + 3193 + ], + [ + 3194, + 3197 + ], + [ + 3199, + 3200 + ], + [ + 3203, + 3204 + ], + [ + 3210, + 3211 + ], + [ + 3212, + 3213 + ], + [ + 3214, + 3215 + ], + [ + 3218, + 3219 + ], + [ + 3220, + 3222 + ], + [ + 3225, + 3226 + ], + [ + 3229, + 3230 + ], + [ + 3231, + 3234 + ], + [ + 3236, + 3238 + ], + [ + 3242, + 3244 + ], + [ + 3246, + 3247 + ], + [ + 3253, + 3254 + ], + [ + 3263, + 3264 + ], + [ + 3265, + 3267 + ], + [ + 3273, + 3274 + ], + [ + 3277, + 3279 + ], + [ + 3282, + 3283 + ], + [ + 3284, + 3285 + ], + [ + 3286, + 3288 + ], + [ + 3289, + 3290 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/operation.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 62, + 71 + ], + [ + 75, + 82 + ], + [ + 91, + 98 + ], + [ + 100, + 118 + ], + [ + 156, + 172 + ], + [ + 178, + 185 + ], + [ + 191, + 205 + ], + [ + 208, + 247 + ], + [ + 258, + 422 + ], + [ + 423, + 432 + ], + [ + 434, + 443 + ], + [ + 444, + 597 + ], + [ + 599, + 621 + ], + [ + 627, + 638 + ], + [ + 641, + 665 + ], + [ + 666, + 681 + ], + [ + 682, + 705 + ], + [ + 707, + 788 + ], + [ + 794, + 897 + ], + [ + 900, + 975 + ], + [ + 978, + 989 + ], + [ + 995, + 1107 + ], + [ + 1111, + 1119 + ], + [ + 1120, + 1146 + ], + [ + 1147, + 1276 + ], + [ + 1282, + 1371 + ], + [ + 1375, + 1397 + ], + [ + 1398, + 1465 + ], + [ + 1477, + 1490 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 78, + 79 + ], + [ + 94, + 95 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 159, + 160 + ], + [ + 165, + 166 + ], + [ + 168, + 169 + ], + [ + 181, + 182 + ], + [ + 194, + 195 + ], + [ + 199, + 202 + ], + [ + 211, + 212 + ], + [ + 214, + 215 + ], + [ + 220, + 221 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 231 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 243, + 244 + ], + [ + 261, + 262 + ], + [ + 264, + 268 + ], + [ + 273, + 274 + ], + [ + 275, + 278 + ], + [ + 279, + 281 + ], + [ + 282, + 284 + ], + [ + 285, + 288 + ], + [ + 289, + 290 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ], + [ + 299, + 301 + ], + [ + 304, + 305 + ], + [ + 308, + 309 + ], + [ + 311, + 312 + ], + [ + 313, + 320 + ], + [ + 323, + 327 + ], + [ + 329, + 330 + ], + [ + 331, + 332 + ], + [ + 334, + 338 + ], + [ + 339, + 340 + ], + [ + 342, + 350 + ], + [ + 351, + 352 + ], + [ + 354, + 362 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 370, + 384 + ], + [ + 386, + 390 + ], + [ + 395, + 396 + ], + [ + 399, + 400 + ], + [ + 401, + 402 + ], + [ + 405, + 407 + ], + [ + 410, + 411 + ], + [ + 415, + 419 + ], + [ + 426, + 429 + ], + [ + 437, + 440 + ], + [ + 447, + 450 + ], + [ + 453, + 454 + ], + [ + 456, + 463 + ], + [ + 465, + 466 + ], + [ + 470, + 471 + ], + [ + 473, + 474 + ], + [ + 477, + 491 + ], + [ + 494, + 495 + ], + [ + 496, + 498 + ], + [ + 499, + 504 + ], + [ + 505, + 506 + ], + [ + 509, + 510 + ], + [ + 513, + 514 + ], + [ + 517, + 518 + ], + [ + 520, + 522 + ], + [ + 523, + 526 + ], + [ + 527, + 530 + ], + [ + 532, + 538 + ], + [ + 540, + 541 + ], + [ + 544, + 545 + ], + [ + 546, + 547 + ], + [ + 549, + 552 + ], + [ + 554, + 558 + ], + [ + 560, + 562 + ], + [ + 563, + 564 + ], + [ + 567, + 568 + ], + [ + 569, + 571 + ], + [ + 572, + 575 + ], + [ + 576, + 577 + ], + [ + 578, + 579 + ], + [ + 582, + 583 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 590, + 591 + ], + [ + 592, + 594 + ], + [ + 602, + 603 + ], + [ + 607, + 609 + ], + [ + 610, + 611 + ], + [ + 613, + 614 + ], + [ + 617, + 618 + ], + [ + 630, + 631 + ], + [ + 632, + 633 + ], + [ + 634, + 635 + ], + [ + 644, + 645 + ], + [ + 647, + 648 + ], + [ + 649, + 651 + ], + [ + 654, + 655 + ], + [ + 657, + 659 + ], + [ + 661, + 662 + ], + [ + 669, + 670 + ], + [ + 671, + 673 + ], + [ + 674, + 675 + ], + [ + 677, + 678 + ], + [ + 685, + 689 + ], + [ + 691, + 695 + ], + [ + 697, + 698 + ], + [ + 699, + 700 + ], + [ + 701, + 702 + ], + [ + 710, + 711 + ], + [ + 714, + 715 + ], + [ + 716, + 717 + ], + [ + 718, + 720 + ], + [ + 721, + 724 + ], + [ + 725, + 726 + ], + [ + 730, + 733 + ], + [ + 738, + 742 + ], + [ + 745, + 747 + ], + [ + 748, + 749 + ], + [ + 751, + 753 + ], + [ + 757, + 759 + ], + [ + 760, + 761 + ], + [ + 764, + 765 + ], + [ + 766, + 767 + ], + [ + 768, + 770 + ], + [ + 771, + 776 + ], + [ + 777, + 778 + ], + [ + 779, + 780 + ], + [ + 783, + 785 + ], + [ + 797, + 799 + ], + [ + 804, + 805 + ], + [ + 808, + 809 + ], + [ + 813, + 815 + ], + [ + 816, + 817 + ], + [ + 820, + 821 + ], + [ + 824, + 825 + ], + [ + 826, + 827 + ], + [ + 831, + 832 + ], + [ + 833, + 836 + ], + [ + 837, + 838 + ], + [ + 843, + 844 + ], + [ + 849, + 851 + ], + [ + 855, + 859 + ], + [ + 860, + 862 + ], + [ + 864, + 865 + ], + [ + 868, + 869 + ], + [ + 875, + 876 + ], + [ + 882, + 883 + ], + [ + 884, + 886 + ], + [ + 892, + 894 + ], + [ + 903, + 909 + ], + [ + 910, + 912 + ], + [ + 915, + 917 + ], + [ + 920, + 928 + ], + [ + 931, + 933 + ], + [ + 937, + 939 + ], + [ + 940, + 942 + ], + [ + 946, + 951 + ], + [ + 952, + 953 + ], + [ + 955, + 956 + ], + [ + 959, + 962 + ], + [ + 963, + 964 + ], + [ + 966, + 967 + ], + [ + 969, + 970 + ], + [ + 971, + 972 + ], + [ + 981, + 982 + ], + [ + 983, + 984 + ], + [ + 985, + 986 + ], + [ + 998, + 999 + ], + [ + 1005, + 1006 + ], + [ + 1012, + 1014 + ], + [ + 1015, + 1016 + ], + [ + 1020, + 1021 + ], + [ + 1022, + 1023 + ], + [ + 1024, + 1027 + ], + [ + 1028, + 1029 + ], + [ + 1030, + 1033 + ], + [ + 1034, + 1036 + ], + [ + 1039, + 1041 + ], + [ + 1044, + 1045 + ], + [ + 1046, + 1047 + ], + [ + 1048, + 1050 + ], + [ + 1051, + 1052 + ], + [ + 1055, + 1056 + ], + [ + 1060, + 1064 + ], + [ + 1065, + 1066 + ], + [ + 1069, + 1071 + ], + [ + 1075, + 1079 + ], + [ + 1080, + 1081 + ], + [ + 1084, + 1085 + ], + [ + 1088, + 1089 + ], + [ + 1095, + 1096 + ], + [ + 1097, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1114, + 1116 + ], + [ + 1123, + 1124 + ], + [ + 1126, + 1129 + ], + [ + 1130, + 1131 + ], + [ + 1134, + 1135 + ], + [ + 1136, + 1138 + ], + [ + 1141, + 1143 + ], + [ + 1150, + 1152 + ], + [ + 1155, + 1156 + ], + [ + 1158, + 1166 + ], + [ + 1170, + 1176 + ], + [ + 1179, + 1195 + ], + [ + 1197, + 1198 + ], + [ + 1203, + 1204 + ], + [ + 1205, + 1212 + ], + [ + 1214, + 1215 + ], + [ + 1218, + 1219 + ], + [ + 1222, + 1223 + ], + [ + 1226, + 1227 + ], + [ + 1228, + 1232 + ], + [ + 1235, + 1236 + ], + [ + 1239, + 1240 + ], + [ + 1245, + 1246 + ], + [ + 1247, + 1248 + ], + [ + 1252, + 1255 + ], + [ + 1260, + 1261 + ], + [ + 1262, + 1263 + ], + [ + 1265, + 1266 + ], + [ + 1269, + 1270 + ], + [ + 1271, + 1273 + ], + [ + 1285, + 1286 + ], + [ + 1287, + 1292 + ], + [ + 1294, + 1295 + ], + [ + 1298, + 1299 + ], + [ + 1302, + 1303 + ], + [ + 1308, + 1309 + ], + [ + 1310, + 1312 + ], + [ + 1313, + 1314 + ], + [ + 1316, + 1320 + ], + [ + 1323, + 1325 + ], + [ + 1329, + 1330 + ], + [ + 1333, + 1334 + ], + [ + 1337, + 1338 + ], + [ + 1343, + 1344 + ], + [ + 1345, + 1347 + ], + [ + 1348, + 1350 + ], + [ + 1353, + 1357 + ], + [ + 1361, + 1364 + ], + [ + 1367, + 1368 + ], + [ + 1378, + 1379 + ], + [ + 1382, + 1383 + ], + [ + 1385, + 1394 + ], + [ + 1401, + 1404 + ], + [ + 1409, + 1413 + ], + [ + 1418, + 1420 + ], + [ + 1423, + 1426 + ], + [ + 1429, + 1432 + ], + [ + 1433, + 1434 + ], + [ + 1437, + 1438 + ], + [ + 1439, + 1440 + ], + [ + 1442, + 1446 + ], + [ + 1448, + 1449 + ], + [ + 1453, + 1454 + ], + [ + 1456, + 1457 + ], + [ + 1458, + 1459 + ], + [ + 1461, + 1462 + ], + [ + 1480, + 1481 + ], + [ + 1484, + 1489 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/rect.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 62, + 88 + ], + [ + 93, + 102 + ], + [ + 103, + 120 + ], + [ + 121, + 136 + ], + [ + 142, + 155 + ], + [ + 159, + 167 + ], + [ + 171, + 190 + ], + [ + 195, + 221 + ], + [ + 232, + 247 + ], + [ + 251, + 264 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 29 + ], + [ + 34, + 35 + ], + [ + 65, + 66 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 79, + 82 + ], + [ + 84, + 85 + ], + [ + 96, + 99 + ], + [ + 106, + 107 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 116, + 117 + ], + [ + 124, + 125 + ], + [ + 129, + 133 + ], + [ + 145, + 146 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 162, + 164 + ], + [ + 174, + 175 + ], + [ + 179, + 187 + ], + [ + 198, + 199 + ], + [ + 203, + 206 + ], + [ + 207, + 208 + ], + [ + 210, + 218 + ], + [ + 235, + 236 + ], + [ + 239, + 241 + ], + [ + 243, + 244 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 261 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/region.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 46, + 53 + ], + [ + 55, + 88 + ], + [ + 109, + 116 + ], + [ + 136, + 143 + ], + [ + 168, + 177 + ], + [ + 182, + 193 + ], + [ + 195, + 374 + ], + [ + 376, + 418 + ], + [ + 419, + 475 + ], + [ + 479, + 495 + ], + [ + 496, + 530 + ], + [ + 537, + 556 + ], + [ + 557, + 604 + ], + [ + 605, + 619 + ], + [ + 621, + 628 + ], + [ + 629, + 666 + ], + [ + 667, + 684 + ], + [ + 688, + 695 + ], + [ + 697, + 712 + ], + [ + 715, + 733 + ], + [ + 742, + 749 + ], + [ + 754, + 769 + ], + [ + 773, + 796 + ], + [ + 797, + 819 + ], + [ + 829, + 836 + ], + [ + 843, + 905 + ], + [ + 906, + 919 + ], + [ + 920, + 959 + ], + [ + 961, + 969 + ], + [ + 975, + 982 + ], + [ + 984, + 999 + ], + [ + 1000, + 1021 + ], + [ + 1029, + 1044 + ], + [ + 1049, + 1063 + ], + [ + 1065, + 1072 + ], + [ + 1074, + 1140 + ], + [ + 1147, + 1185 + ], + [ + 1188, + 1236 + ], + [ + 1247, + 1274 + ], + [ + 1279, + 1543 + ], + [ + 1555, + 1588 + ], + [ + 1599, + 1671 + ], + [ + 1673, + 1699 + ], + [ + 1703, + 1767 + ], + [ + 1768, + 1783 + ], + [ + 1784, + 1792 + ], + [ + 1794, + 1825 + ], + [ + 1827, + 1840 + ], + [ + 1845, + 1872 + ], + [ + 1874, + 1883 + ], + [ + 1885, + 1936 + ], + [ + 1946, + 1954 + ], + [ + 1957, + 1965 + ], + [ + 1968, + 1997 + ], + [ + 2000, + 2010 + ], + [ + 2012, + 2024 + ], + [ + 2026, + 2087 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 49, + 50 + ], + [ + 58, + 64 + ], + [ + 65, + 69 + ], + [ + 70, + 74 + ], + [ + 79, + 80 + ], + [ + 84, + 85 + ], + [ + 112, + 113 + ], + [ + 139, + 140 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 185, + 186 + ], + [ + 189, + 190 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 207, + 208 + ], + [ + 210, + 213 + ], + [ + 216, + 219 + ], + [ + 221, + 222 + ], + [ + 227, + 228 + ], + [ + 231, + 233 + ], + [ + 234, + 235 + ], + [ + 236, + 237 + ], + [ + 238, + 240 + ], + [ + 241, + 244 + ], + [ + 245, + 248 + ], + [ + 250, + 253 + ], + [ + 254, + 255 + ], + [ + 257, + 258 + ], + [ + 260, + 261 + ], + [ + 264, + 265 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 276, + 277 + ], + [ + 281, + 287 + ], + [ + 290, + 291 + ], + [ + 292, + 293 + ], + [ + 296, + 299 + ], + [ + 301, + 302 + ], + [ + 303, + 306 + ], + [ + 309, + 311 + ], + [ + 312, + 313 + ], + [ + 314, + 315 + ], + [ + 316, + 317 + ], + [ + 318, + 319 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 326, + 327 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 334, + 352 + ], + [ + 355, + 356 + ], + [ + 357, + 358 + ], + [ + 359, + 365 + ], + [ + 366, + 369 + ], + [ + 370, + 371 + ], + [ + 379, + 380 + ], + [ + 384, + 385 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 390, + 392 + ], + [ + 393, + 396 + ], + [ + 398, + 400 + ], + [ + 404, + 405 + ], + [ + 408, + 409 + ], + [ + 410, + 415 + ], + [ + 422, + 423 + ], + [ + 424, + 425 + ], + [ + 426, + 427 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 433, + 435 + ], + [ + 436, + 437 + ], + [ + 440, + 441 + ], + [ + 442, + 443 + ], + [ + 445, + 446 + ], + [ + 447, + 449 + ], + [ + 450, + 451 + ], + [ + 454, + 455 + ], + [ + 456, + 457 + ], + [ + 458, + 459 + ], + [ + 460, + 461 + ], + [ + 462, + 463 + ], + [ + 464, + 465 + ], + [ + 468, + 469 + ], + [ + 470, + 472 + ], + [ + 482, + 483 + ], + [ + 487, + 492 + ], + [ + 499, + 500 + ], + [ + 505, + 506 + ], + [ + 512, + 515 + ], + [ + 516, + 517 + ], + [ + 519, + 522 + ], + [ + 524, + 525 + ], + [ + 526, + 527 + ], + [ + 540, + 541 + ], + [ + 545, + 546 + ], + [ + 552, + 553 + ], + [ + 560, + 561 + ], + [ + 564, + 568 + ], + [ + 570, + 571 + ], + [ + 577, + 579 + ], + [ + 581, + 583 + ], + [ + 585, + 586 + ], + [ + 588, + 591 + ], + [ + 596, + 597 + ], + [ + 600, + 601 + ], + [ + 608, + 611 + ], + [ + 615, + 616 + ], + [ + 624, + 625 + ], + [ + 632, + 633 + ], + [ + 634, + 638 + ], + [ + 641, + 642 + ], + [ + 643, + 644 + ], + [ + 646, + 647 + ], + [ + 652, + 654 + ], + [ + 656, + 657 + ], + [ + 660, + 663 + ], + [ + 670, + 671 + ], + [ + 674, + 675 + ], + [ + 676, + 678 + ], + [ + 680, + 681 + ], + [ + 691, + 692 + ], + [ + 700, + 702 + ], + [ + 707, + 709 + ], + [ + 718, + 722 + ], + [ + 723, + 728 + ], + [ + 729, + 730 + ], + [ + 745, + 746 + ], + [ + 757, + 761 + ], + [ + 765, + 766 + ], + [ + 776, + 780 + ], + [ + 784, + 786 + ], + [ + 789, + 790 + ], + [ + 792, + 793 + ], + [ + 800, + 801 + ], + [ + 804, + 805 + ], + [ + 811, + 812 + ], + [ + 813, + 816 + ], + [ + 832, + 833 + ], + [ + 846, + 850 + ], + [ + 855, + 856 + ], + [ + 859, + 861 + ], + [ + 862, + 864 + ], + [ + 865, + 866 + ], + [ + 867, + 868 + ], + [ + 871, + 872 + ], + [ + 876, + 878 + ], + [ + 881, + 884 + ], + [ + 887, + 889 + ], + [ + 891, + 892 + ], + [ + 894, + 902 + ], + [ + 909, + 911 + ], + [ + 913, + 914 + ], + [ + 915, + 916 + ], + [ + 923, + 924 + ], + [ + 927, + 932 + ], + [ + 934, + 937 + ], + [ + 941, + 945 + ], + [ + 947, + 948 + ], + [ + 950, + 951 + ], + [ + 955, + 956 + ], + [ + 964, + 966 + ], + [ + 978, + 979 + ], + [ + 987, + 988 + ], + [ + 991, + 994 + ], + [ + 995, + 996 + ], + [ + 1003, + 1004 + ], + [ + 1006, + 1007 + ], + [ + 1009, + 1010 + ], + [ + 1016, + 1018 + ], + [ + 1032, + 1033 + ], + [ + 1034, + 1035 + ], + [ + 1039, + 1041 + ], + [ + 1052, + 1054 + ], + [ + 1055, + 1060 + ], + [ + 1068, + 1069 + ], + [ + 1077, + 1078 + ], + [ + 1081, + 1082 + ], + [ + 1085, + 1087 + ], + [ + 1089, + 1090 + ], + [ + 1093, + 1094 + ], + [ + 1096, + 1099 + ], + [ + 1100, + 1102 + ], + [ + 1108, + 1109 + ], + [ + 1113, + 1115 + ], + [ + 1116, + 1117 + ], + [ + 1120, + 1125 + ], + [ + 1128, + 1129 + ], + [ + 1132, + 1133 + ], + [ + 1134, + 1135 + ], + [ + 1136, + 1137 + ], + [ + 1150, + 1152 + ], + [ + 1155, + 1158 + ], + [ + 1159, + 1160 + ], + [ + 1162, + 1163 + ], + [ + 1169, + 1171 + ], + [ + 1174, + 1177 + ], + [ + 1178, + 1179 + ], + [ + 1181, + 1182 + ], + [ + 1191, + 1193 + ], + [ + 1194, + 1196 + ], + [ + 1200, + 1205 + ], + [ + 1208, + 1209 + ], + [ + 1210, + 1212 + ], + [ + 1213, + 1215 + ], + [ + 1216, + 1218 + ], + [ + 1219, + 1221 + ], + [ + 1222, + 1224 + ], + [ + 1225, + 1227 + ], + [ + 1228, + 1230 + ], + [ + 1231, + 1233 + ], + [ + 1250, + 1269 + ], + [ + 1270, + 1271 + ], + [ + 1282, + 1306 + ], + [ + 1307, + 1308 + ], + [ + 1309, + 1326 + ], + [ + 1327, + 1328 + ], + [ + 1329, + 1346 + ], + [ + 1347, + 1348 + ], + [ + 1349, + 1362 + ], + [ + 1363, + 1410 + ], + [ + 1411, + 1412 + ], + [ + 1413, + 1418 + ], + [ + 1422, + 1424 + ], + [ + 1425, + 1429 + ], + [ + 1430, + 1433 + ], + [ + 1434, + 1437 + ], + [ + 1438, + 1441 + ], + [ + 1442, + 1445 + ], + [ + 1446, + 1449 + ], + [ + 1450, + 1452 + ], + [ + 1457, + 1492 + ], + [ + 1493, + 1494 + ], + [ + 1499, + 1501 + ], + [ + 1502, + 1503 + ], + [ + 1507, + 1512 + ], + [ + 1515, + 1540 + ], + [ + 1558, + 1559 + ], + [ + 1563, + 1565 + ], + [ + 1568, + 1570 + ], + [ + 1571, + 1575 + ], + [ + 1576, + 1578 + ], + [ + 1579, + 1580 + ], + [ + 1582, + 1583 + ], + [ + 1584, + 1585 + ], + [ + 1602, + 1603 + ], + [ + 1604, + 1606 + ], + [ + 1608, + 1609 + ], + [ + 1611, + 1612 + ], + [ + 1617, + 1621 + ], + [ + 1625, + 1631 + ], + [ + 1633, + 1634 + ], + [ + 1636, + 1637 + ], + [ + 1641, + 1643 + ], + [ + 1645, + 1647 + ], + [ + 1649, + 1650 + ], + [ + 1652, + 1653 + ], + [ + 1658, + 1660 + ], + [ + 1664, + 1665 + ], + [ + 1666, + 1668 + ], + [ + 1676, + 1685 + ], + [ + 1687, + 1690 + ], + [ + 1692, + 1693 + ], + [ + 1694, + 1696 + ], + [ + 1706, + 1708 + ], + [ + 1712, + 1716 + ], + [ + 1720, + 1721 + ], + [ + 1722, + 1723 + ], + [ + 1729, + 1731 + ], + [ + 1735, + 1739 + ], + [ + 1741, + 1743 + ], + [ + 1746, + 1747 + ], + [ + 1750, + 1752 + ], + [ + 1757, + 1759 + ], + [ + 1760, + 1761 + ], + [ + 1763, + 1764 + ], + [ + 1771, + 1772 + ], + [ + 1773, + 1775 + ], + [ + 1776, + 1777 + ], + [ + 1778, + 1780 + ], + [ + 1787, + 1789 + ], + [ + 1797, + 1799 + ], + [ + 1802, + 1803 + ], + [ + 1804, + 1808 + ], + [ + 1810, + 1812 + ], + [ + 1818, + 1819 + ], + [ + 1820, + 1822 + ], + [ + 1830, + 1834 + ], + [ + 1836, + 1837 + ], + [ + 1848, + 1852 + ], + [ + 1855, + 1858 + ], + [ + 1862, + 1863 + ], + [ + 1865, + 1866 + ], + [ + 1867, + 1869 + ], + [ + 1877, + 1880 + ], + [ + 1888, + 1892 + ], + [ + 1894, + 1897 + ], + [ + 1902, + 1906 + ], + [ + 1911, + 1913 + ], + [ + 1917, + 1918 + ], + [ + 1923, + 1924 + ], + [ + 1925, + 1928 + ], + [ + 1929, + 1930 + ], + [ + 1932, + 1933 + ], + [ + 1949, + 1951 + ], + [ + 1960, + 1962 + ], + [ + 1971, + 1975 + ], + [ + 1976, + 1980 + ], + [ + 1981, + 1982 + ], + [ + 1983, + 1985 + ], + [ + 1990, + 1991 + ], + [ + 1993, + 1994 + ], + [ + 2003, + 2004 + ], + [ + 2005, + 2007 + ], + [ + 2015, + 2016 + ], + [ + 2017, + 2019 + ], + [ + 2020, + 2021 + ], + [ + 2029, + 2030 + ], + [ + 2033, + 2035 + ], + [ + 2041, + 2042 + ], + [ + 2044, + 2045 + ], + [ + 2046, + 2048 + ], + [ + 2049, + 2050 + ], + [ + 2052, + 2053 + ], + [ + 2056, + 2057 + ], + [ + 2060, + 2061 + ], + [ + 2062, + 2067 + ], + [ + 2072, + 2073 + ], + [ + 2075, + 2083 + ], + [ + 2084, + 2085 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/reorder.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 56, + 63 + ], + [ + 66, + 76 + ], + [ + 78, + 147 + ], + [ + 150, + 224 + ], + [ + 228, + 286 + ], + [ + 289, + 314 + ], + [ + 320, + 348 + ], + [ + 352, + 359 + ], + [ + 360, + 387 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 59, + 60 + ], + [ + 69, + 70 + ], + [ + 72, + 73 + ], + [ + 81, + 82 + ], + [ + 85, + 86 + ], + [ + 89, + 100 + ], + [ + 102, + 109 + ], + [ + 114, + 115 + ], + [ + 120, + 125 + ], + [ + 128, + 129 + ], + [ + 130, + 132 + ], + [ + 135, + 136 + ], + [ + 139, + 144 + ], + [ + 153, + 155 + ], + [ + 156, + 157 + ], + [ + 160, + 161 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 178, + 180 + ], + [ + 185, + 187 + ], + [ + 188, + 189 + ], + [ + 191, + 194 + ], + [ + 196, + 198 + ], + [ + 201, + 202 + ], + [ + 207, + 208 + ], + [ + 210, + 216 + ], + [ + 217, + 219 + ], + [ + 220, + 221 + ], + [ + 231, + 233 + ], + [ + 237, + 238 + ], + [ + 239, + 244 + ], + [ + 249, + 251 + ], + [ + 254, + 255 + ], + [ + 259, + 261 + ], + [ + 263, + 264 + ], + [ + 269, + 270 + ], + [ + 275, + 276 + ], + [ + 280, + 281 + ], + [ + 282, + 283 + ], + [ + 292, + 297 + ], + [ + 300, + 301 + ], + [ + 307, + 308 + ], + [ + 310, + 311 + ], + [ + 323, + 324 + ], + [ + 330, + 331 + ], + [ + 332, + 333 + ], + [ + 336, + 338 + ], + [ + 339, + 342 + ], + [ + 344, + 345 + ], + [ + 355, + 356 + ], + [ + 363, + 364 + ], + [ + 365, + 366 + ], + [ + 369, + 370 + ], + [ + 374, + 375 + ], + [ + 376, + 378 + ], + [ + 381, + 382 + ], + [ + 383, + 386 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sbuf.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 59, + 66 + ], + [ + 67, + 100 + ], + [ + 104, + 131 + ], + [ + 135, + 147 + ], + [ + 148, + 207 + ], + [ + 211, + 226 + ], + [ + 229, + 236 + ], + [ + 243, + 285 + ], + [ + 286, + 307 + ], + [ + 310, + 317 + ], + [ + 324, + 331 + ], + [ + 334, + 360 + ], + [ + 362, + 401 + ], + [ + 406, + 417 + ], + [ + 418, + 454 + ], + [ + 455, + 505 + ], + [ + 512, + 538 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 62, + 63 + ], + [ + 70, + 71 + ], + [ + 73, + 74 + ], + [ + 76, + 77 + ], + [ + 78, + 80 + ], + [ + 85, + 93 + ], + [ + 96, + 97 + ], + [ + 107, + 108 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 122, + 125 + ], + [ + 127, + 128 + ], + [ + 138, + 139 + ], + [ + 142, + 144 + ], + [ + 151, + 152 + ], + [ + 155, + 156 + ], + [ + 159, + 160 + ], + [ + 161, + 165 + ], + [ + 168, + 170 + ], + [ + 174, + 175 + ], + [ + 181, + 182 + ], + [ + 188, + 189 + ], + [ + 190, + 193 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 203, + 204 + ], + [ + 214, + 215 + ], + [ + 220, + 221 + ], + [ + 222, + 223 + ], + [ + 232, + 233 + ], + [ + 246, + 247 + ], + [ + 248, + 253 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 265, + 267 + ], + [ + 268, + 270 + ], + [ + 273, + 282 + ], + [ + 289, + 290 + ], + [ + 292, + 293 + ], + [ + 297, + 298 + ], + [ + 303, + 304 + ], + [ + 313, + 314 + ], + [ + 327, + 328 + ], + [ + 337, + 338 + ], + [ + 343, + 344 + ], + [ + 349, + 350 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 365, + 368 + ], + [ + 369, + 371 + ], + [ + 372, + 373 + ], + [ + 375, + 378 + ], + [ + 381, + 385 + ], + [ + 388, + 389 + ], + [ + 390, + 391 + ], + [ + 397, + 398 + ], + [ + 409, + 410 + ], + [ + 413, + 414 + ], + [ + 421, + 423 + ], + [ + 425, + 426 + ], + [ + 430, + 434 + ], + [ + 439, + 440 + ], + [ + 441, + 443 + ], + [ + 444, + 445 + ], + [ + 446, + 447 + ], + [ + 448, + 449 + ], + [ + 450, + 451 + ], + [ + 458, + 459 + ], + [ + 461, + 462 + ], + [ + 467, + 468 + ], + [ + 469, + 470 + ], + [ + 475, + 476 + ], + [ + 480, + 484 + ], + [ + 490, + 493 + ], + [ + 498, + 500 + ], + [ + 501, + 502 + ], + [ + 515, + 517 + ], + [ + 521, + 522 + ], + [ + 525, + 527 + ], + [ + 528, + 531 + ], + [ + 532, + 533 + ], + [ + 534, + 535 + ], + [ + 536, + 537 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/semaphore.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 12, + 44 + ], + [ + 55, + 62 + ], + [ + 64, + 147 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 40, + 41 + ], + [ + 58, + 59 + ], + [ + 67, + 68 + ], + [ + 69, + 71 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 81, + 82 + ], + [ + 88, + 90 + ], + [ + 91, + 93 + ], + [ + 95, + 99 + ], + [ + 101, + 102 + ], + [ + 107, + 108 + ], + [ + 109, + 110 + ], + [ + 115, + 116 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 123, + 125 + ], + [ + 128, + 129 + ], + [ + 131, + 133 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sink.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 50, + 67 + ], + [ + 82, + 89 + ], + [ + 96, + 112 + ], + [ + 114, + 146 + ], + [ + 155, + 172 + ], + [ + 174, + 212 + ], + [ + 219, + 237 + ], + [ + 240, + 390 + ], + [ + 395, + 414 + ], + [ + 415, + 448 + ], + [ + 455, + 467 + ], + [ + 468, + 493 + ], + [ + 494, + 517 + ], + [ + 522, + 529 + ], + [ + 535, + 545 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 53, + 54 + ], + [ + 57, + 58 + ], + [ + 62, + 64 + ], + [ + 85, + 86 + ], + [ + 99, + 100 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 117, + 118 + ], + [ + 120, + 121 + ], + [ + 122, + 124 + ], + [ + 127, + 128 + ], + [ + 131, + 133 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 141, + 143 + ], + [ + 158, + 159 + ], + [ + 163, + 164 + ], + [ + 168, + 169 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 189, + 192 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 202, + 204 + ], + [ + 207, + 209 + ], + [ + 222, + 223 + ], + [ + 228, + 230 + ], + [ + 233, + 234 + ], + [ + 243, + 244 + ], + [ + 246, + 247 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 258, + 259 + ], + [ + 261, + 265 + ], + [ + 270, + 271 + ], + [ + 274, + 275 + ], + [ + 279, + 281 + ], + [ + 282, + 283 + ], + [ + 288, + 289 + ], + [ + 290, + 292 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ], + [ + 298, + 302 + ], + [ + 305, + 306 + ], + [ + 309, + 310 + ], + [ + 314, + 317 + ], + [ + 318, + 321 + ], + [ + 324, + 325 + ], + [ + 326, + 328 + ], + [ + 333, + 334 + ], + [ + 337, + 338 + ], + [ + 344, + 345 + ], + [ + 346, + 349 + ], + [ + 352, + 353 + ], + [ + 354, + 357 + ], + [ + 360, + 361 + ], + [ + 362, + 363 + ], + [ + 365, + 366 + ], + [ + 371, + 374 + ], + [ + 379, + 381 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 386, + 387 + ], + [ + 398, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 411 + ], + [ + 418, + 422 + ], + [ + 425, + 426 + ], + [ + 427, + 428 + ], + [ + 430, + 432 + ], + [ + 435, + 436 + ], + [ + 440, + 443 + ], + [ + 444, + 445 + ], + [ + 458, + 459 + ], + [ + 462, + 464 + ], + [ + 471, + 472 + ], + [ + 474, + 475 + ], + [ + 479, + 480 + ], + [ + 484, + 488 + ], + [ + 489, + 490 + ], + [ + 497, + 498 + ], + [ + 499, + 501 + ], + [ + 502, + 506 + ], + [ + 507, + 508 + ], + [ + 509, + 510 + ], + [ + 511, + 512 + ], + [ + 513, + 514 + ], + [ + 525, + 526 + ], + [ + 538, + 539 + ], + [ + 540, + 541 + ], + [ + 542, + 544 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sink.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 65, + 75 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 68, + 72 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sinkdisc.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 13, + 41 + ], + [ + 70, + 85 + ], + [ + 94, + 102 + ], + [ + 104, + 111 + ], + [ + 112, + 286 + ], + [ + 294, + 316 + ], + [ + 318, + 376 + ], + [ + 389, + 409 + ], + [ + 412, + 464 + ], + [ + 466, + 473 + ], + [ + 487, + 542 + ] + ], + "lines_added": [ + [ + 1, + 3 + ], + [ + 16, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 32 + ], + [ + 37, + 38 + ], + [ + 73, + 82 + ], + [ + 97, + 99 + ], + [ + 107, + 108 + ], + [ + 115, + 116 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 133, + 134 + ], + [ + 135, + 138 + ], + [ + 141, + 142 + ], + [ + 143, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 154, + 162 + ], + [ + 165, + 166 + ], + [ + 169, + 171 + ], + [ + 172, + 173 + ], + [ + 174, + 176 + ], + [ + 177, + 178 + ], + [ + 183, + 184 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 197, + 198 + ], + [ + 199, + 200 + ], + [ + 203, + 204 + ], + [ + 208, + 209 + ], + [ + 212, + 213 + ], + [ + 216, + 218 + ], + [ + 220, + 224 + ], + [ + 228, + 231 + ], + [ + 235, + 236 + ], + [ + 239, + 243 + ], + [ + 247, + 248 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 257, + 258 + ], + [ + 260, + 262 + ], + [ + 265, + 269 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 281, + 283 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 311 + ], + [ + 312, + 313 + ], + [ + 321, + 322 + ], + [ + 323, + 324 + ], + [ + 330, + 331 + ], + [ + 332, + 333 + ], + [ + 335, + 336 + ], + [ + 339, + 343 + ], + [ + 344, + 345 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 359, + 362 + ], + [ + 365, + 366 + ], + [ + 369, + 371 + ], + [ + 372, + 373 + ], + [ + 392, + 393 + ], + [ + 398, + 402 + ], + [ + 405, + 406 + ], + [ + 415, + 416 + ], + [ + 421, + 422 + ], + [ + 427, + 430 + ], + [ + 431, + 433 + ], + [ + 434, + 436 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 445, + 447 + ], + [ + 448, + 449 + ], + [ + 450, + 452 + ], + [ + 457, + 458 + ], + [ + 459, + 461 + ], + [ + 469, + 470 + ], + [ + 490, + 491 + ], + [ + 492, + 493 + ], + [ + 499, + 500 + ], + [ + 504, + 505 + ], + [ + 506, + 507 + ], + [ + 509, + 518 + ], + [ + 521, + 522 + ], + [ + 523, + 525 + ], + [ + 531, + 533 + ], + [ + 534, + 535 + ], + [ + 536, + 537 + ], + [ + 538, + 539 + ], + [ + 540, + 541 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sinkmemory.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 12, + 40 + ], + [ + 57, + 70 + ], + [ + 72, + 79 + ], + [ + 89, + 96 + ], + [ + 97, + 152 + ], + [ + 161, + 178 + ], + [ + 180, + 218 + ], + [ + 225, + 243 + ], + [ + 246, + 259 + ], + [ + 260, + 296 + ], + [ + 298, + 313 + ], + [ + 321, + 354 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 15, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 31 + ], + [ + 36, + 37 + ], + [ + 60, + 61 + ], + [ + 65, + 67 + ], + [ + 75, + 76 + ], + [ + 92, + 93 + ], + [ + 100, + 102 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 118, + 119 + ], + [ + 120, + 123 + ], + [ + 126, + 127 + ], + [ + 128, + 130 + ], + [ + 133, + 134 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 147, + 149 + ], + [ + 164, + 165 + ], + [ + 169, + 170 + ], + [ + 174, + 175 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 188, + 189 + ], + [ + 192, + 193 + ], + [ + 195, + 198 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 208, + 210 + ], + [ + 213, + 215 + ], + [ + 228, + 229 + ], + [ + 234, + 236 + ], + [ + 239, + 240 + ], + [ + 249, + 250 + ], + [ + 255, + 256 + ], + [ + 263, + 265 + ], + [ + 266, + 268 + ], + [ + 269, + 271 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 280, + 281 + ], + [ + 282, + 285 + ], + [ + 288, + 289 + ], + [ + 292, + 293 + ], + [ + 301, + 307 + ], + [ + 309, + 310 + ], + [ + 324, + 325 + ], + [ + 329, + 331 + ], + [ + 332, + 333 + ], + [ + 335, + 342 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 348, + 349 + ], + [ + 350, + 351 + ], + [ + 352, + 353 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sinkscreen.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 14, + 42 + ], + [ + 77, + 90 + ], + [ + 95, + 102 + ], + [ + 107, + 114 + ], + [ + 116, + 145 + ], + [ + 165, + 175 + ], + [ + 181, + 328 + ], + [ + 329, + 566 + ], + [ + 581, + 588 + ], + [ + 589, + 627 + ], + [ + 632, + 877 + ], + [ + 885, + 906 + ], + [ + 908, + 930 + ], + [ + 937, + 951 + ], + [ + 954, + 1070 + ], + [ + 1081, + 1109 + ], + [ + 1111, + 1150 + ], + [ + 1151, + 1197 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 80, + 81 + ], + [ + 86, + 87 + ], + [ + 98, + 99 + ], + [ + 110, + 111 + ], + [ + 119, + 123 + ], + [ + 124, + 127 + ], + [ + 129, + 130 + ], + [ + 131, + 132 + ], + [ + 135, + 138 + ], + [ + 141, + 142 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 184, + 185 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 206, + 207 + ], + [ + 208, + 211 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 231 + ], + [ + 232, + 233 + ], + [ + 235, + 238 + ], + [ + 239, + 241 + ], + [ + 244, + 245 + ], + [ + 246, + 248 + ], + [ + 249, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 265, + 266 + ], + [ + 271, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 279 + ], + [ + 280, + 281 + ], + [ + 283, + 284 + ], + [ + 287, + 288 + ], + [ + 291, + 294 + ], + [ + 295, + 297 + ], + [ + 299, + 300 + ], + [ + 302, + 304 + ], + [ + 305, + 306 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 319, + 321 + ], + [ + 324, + 325 + ], + [ + 332, + 333 + ], + [ + 336, + 337 + ], + [ + 339, + 342 + ], + [ + 344, + 347 + ], + [ + 349, + 350 + ], + [ + 355, + 356 + ], + [ + 359, + 362 + ], + [ + 366, + 367 + ], + [ + 372, + 373 + ], + [ + 376, + 378 + ], + [ + 379, + 381 + ], + [ + 383, + 384 + ], + [ + 386, + 388 + ], + [ + 393, + 394 + ], + [ + 395, + 398 + ], + [ + 401, + 402 + ], + [ + 404, + 405 + ], + [ + 406, + 407 + ], + [ + 409, + 411 + ], + [ + 416, + 417 + ], + [ + 418, + 420 + ], + [ + 421, + 427 + ], + [ + 430, + 433 + ], + [ + 434, + 435 + ], + [ + 437, + 438 + ], + [ + 442, + 443 + ], + [ + 446, + 448 + ], + [ + 449, + 450 + ], + [ + 456, + 457 + ], + [ + 458, + 459 + ], + [ + 460, + 461 + ], + [ + 463, + 464 + ], + [ + 465, + 467 + ], + [ + 470, + 472 + ], + [ + 473, + 474 + ], + [ + 479, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 489 + ], + [ + 493, + 494 + ], + [ + 497, + 498 + ], + [ + 501, + 502 + ], + [ + 508, + 509 + ], + [ + 512, + 513 + ], + [ + 517, + 519 + ], + [ + 522, + 523 + ], + [ + 524, + 525 + ], + [ + 526, + 528 + ], + [ + 533, + 534 + ], + [ + 535, + 536 + ], + [ + 538, + 539 + ], + [ + 543, + 546 + ], + [ + 547, + 548 + ], + [ + 554, + 556 + ], + [ + 559, + 560 + ], + [ + 561, + 563 + ], + [ + 584, + 585 + ], + [ + 592, + 594 + ], + [ + 595, + 599 + ], + [ + 601, + 602 + ], + [ + 607, + 608 + ], + [ + 613, + 614 + ], + [ + 617, + 618 + ], + [ + 622, + 624 + ], + [ + 635, + 638 + ], + [ + 640, + 641 + ], + [ + 643, + 644 + ], + [ + 649, + 650 + ], + [ + 651, + 652 + ], + [ + 657, + 658 + ], + [ + 661, + 662 + ], + [ + 666, + 667 + ], + [ + 669, + 672 + ], + [ + 673, + 674 + ], + [ + 679, + 680 + ], + [ + 683, + 684 + ], + [ + 685, + 688 + ], + [ + 689, + 691 + ], + [ + 697, + 698 + ], + [ + 703, + 704 + ], + [ + 706, + 707 + ], + [ + 709, + 710 + ], + [ + 713, + 715 + ], + [ + 717, + 718 + ], + [ + 719, + 721 + ], + [ + 724, + 726 + ], + [ + 728, + 730 + ], + [ + 732, + 735 + ], + [ + 740, + 741 + ], + [ + 742, + 745 + ], + [ + 746, + 747 + ], + [ + 752, + 754 + ], + [ + 755, + 757 + ], + [ + 763, + 764 + ], + [ + 768, + 770 + ], + [ + 771, + 775 + ], + [ + 777, + 778 + ], + [ + 784, + 785 + ], + [ + 788, + 790 + ], + [ + 791, + 792 + ], + [ + 795, + 797 + ], + [ + 798, + 799 + ], + [ + 800, + 803 + ], + [ + 805, + 807 + ], + [ + 808, + 809 + ], + [ + 810, + 811 + ], + [ + 813, + 815 + ], + [ + 816, + 821 + ], + [ + 823, + 824 + ], + [ + 825, + 826 + ], + [ + 828, + 829 + ], + [ + 834, + 835 + ], + [ + 840, + 842 + ], + [ + 844, + 845 + ], + [ + 846, + 848 + ], + [ + 851, + 854 + ], + [ + 855, + 859 + ], + [ + 860, + 861 + ], + [ + 864, + 867 + ], + [ + 873, + 874 + ], + [ + 888, + 891 + ], + [ + 892, + 893 + ], + [ + 894, + 895 + ], + [ + 896, + 897 + ], + [ + 901, + 903 + ], + [ + 911, + 914 + ], + [ + 915, + 916 + ], + [ + 918, + 919 + ], + [ + 920, + 921 + ], + [ + 926, + 927 + ], + [ + 940, + 943 + ], + [ + 944, + 945 + ], + [ + 946, + 948 + ], + [ + 957, + 958 + ], + [ + 959, + 963 + ], + [ + 966, + 967 + ], + [ + 969, + 970 + ], + [ + 971, + 972 + ], + [ + 974, + 975 + ], + [ + 977, + 978 + ], + [ + 983, + 984 + ], + [ + 985, + 986 + ], + [ + 987, + 988 + ], + [ + 990, + 991 + ], + [ + 996, + 997 + ], + [ + 998, + 999 + ], + [ + 1001, + 1002 + ], + [ + 1003, + 1004 + ], + [ + 1009, + 1010 + ], + [ + 1013, + 1016 + ], + [ + 1019, + 1028 + ], + [ + 1029, + 1031 + ], + [ + 1034, + 1035 + ], + [ + 1040, + 1041 + ], + [ + 1046, + 1047 + ], + [ + 1048, + 1049 + ], + [ + 1052, + 1053 + ], + [ + 1054, + 1056 + ], + [ + 1058, + 1059 + ], + [ + 1063, + 1065 + ], + [ + 1066, + 1067 + ], + [ + 1084, + 1085 + ], + [ + 1088, + 1089 + ], + [ + 1092, + 1093 + ], + [ + 1097, + 1098 + ], + [ + 1100, + 1101 + ], + [ + 1105, + 1106 + ], + [ + 1114, + 1115 + ], + [ + 1120, + 1123 + ], + [ + 1124, + 1125 + ], + [ + 1130, + 1131 + ], + [ + 1132, + 1136 + ], + [ + 1138, + 1142 + ], + [ + 1143, + 1147 + ], + [ + 1154, + 1157 + ], + [ + 1158, + 1159 + ], + [ + 1160, + 1167 + ], + [ + 1168, + 1169 + ], + [ + 1172, + 1173 + ], + [ + 1179, + 1181 + ], + [ + 1185, + 1187 + ], + [ + 1188, + 1191 + ], + [ + 1192, + 1193 + ], + [ + 1195, + 1196 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/source.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 18, + 46 + ], + [ + 79, + 86 + ], + [ + 98, + 222 + ], + [ + 224, + 388 + ], + [ + 392, + 428 + ], + [ + 436, + 490 + ], + [ + 495, + 532 + ], + [ + 533, + 566 + ], + [ + 571, + 594 + ], + [ + 602, + 639 + ], + [ + 640, + 695 + ], + [ + 698, + 743 + ], + [ + 747, + 754 + ], + [ + 755, + 807 + ], + [ + 810, + 861 + ], + [ + 865, + 892 + ], + [ + 893, + 960 + ], + [ + 969, + 1000 + ], + [ + 1006, + 1026 + ], + [ + 1035, + 1052 + ], + [ + 1056, + 1063 + ], + [ + 1064, + 1117 + ], + [ + 1123, + 1146 + ], + [ + 1154, + 1177 + ], + [ + 1184, + 1196 + ], + [ + 1202, + 1253 + ], + [ + 1254, + 1279 + ], + [ + 1280, + 1364 + ], + [ + 1367, + 1386 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 21, + 27 + ], + [ + 28, + 32 + ], + [ + 33, + 37 + ], + [ + 42, + 43 + ], + [ + 82, + 83 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ], + [ + 114, + 115 + ], + [ + 119, + 120 + ], + [ + 121, + 123 + ], + [ + 126, + 127 + ], + [ + 133, + 135 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 142, + 144 + ], + [ + 149, + 150 + ], + [ + 154, + 155 + ], + [ + 159, + 160 + ], + [ + 162, + 164 + ], + [ + 167, + 168 + ], + [ + 169, + 172 + ], + [ + 173, + 174 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 183, + 184 + ], + [ + 187, + 189 + ], + [ + 193, + 195 + ], + [ + 198, + 199 + ], + [ + 200, + 202 + ], + [ + 204, + 206 + ], + [ + 210, + 214 + ], + [ + 218, + 219 + ], + [ + 227, + 229 + ], + [ + 231, + 232 + ], + [ + 234, + 238 + ], + [ + 243, + 246 + ], + [ + 251, + 252 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 266, + 270 + ], + [ + 273, + 274 + ], + [ + 277, + 278 + ], + [ + 279, + 281 + ], + [ + 282, + 283 + ], + [ + 284, + 286 + ], + [ + 287, + 292 + ], + [ + 296, + 299 + ], + [ + 300, + 302 + ], + [ + 308, + 309 + ], + [ + 312, + 313 + ], + [ + 315, + 317 + ], + [ + 318, + 319 + ], + [ + 321, + 322 + ], + [ + 325, + 326 + ], + [ + 327, + 328 + ], + [ + 331, + 332 + ], + [ + 333, + 336 + ], + [ + 337, + 338 + ], + [ + 341, + 342 + ], + [ + 343, + 344 + ], + [ + 345, + 346 + ], + [ + 350, + 353 + ], + [ + 354, + 355 + ], + [ + 358, + 359 + ], + [ + 360, + 362 + ], + [ + 368, + 369 + ], + [ + 375, + 381 + ], + [ + 384, + 385 + ], + [ + 395, + 397 + ], + [ + 401, + 402 + ], + [ + 405, + 407 + ], + [ + 408, + 409 + ], + [ + 410, + 411 + ], + [ + 412, + 415 + ], + [ + 417, + 418 + ], + [ + 419, + 420 + ], + [ + 424, + 425 + ], + [ + 439, + 440 + ], + [ + 443, + 445 + ], + [ + 446, + 447 + ], + [ + 448, + 449 + ], + [ + 450, + 453 + ], + [ + 455, + 456 + ], + [ + 457, + 458 + ], + [ + 464, + 465 + ], + [ + 469, + 470 + ], + [ + 473, + 474 + ], + [ + 475, + 476 + ], + [ + 477, + 478 + ], + [ + 479, + 482 + ], + [ + 484, + 485 + ], + [ + 486, + 487 + ], + [ + 498, + 499 + ], + [ + 500, + 501 + ], + [ + 504, + 505 + ], + [ + 508, + 510 + ], + [ + 511, + 514 + ], + [ + 515, + 516 + ], + [ + 518, + 521 + ], + [ + 523, + 526 + ], + [ + 528, + 529 + ], + [ + 536, + 537 + ], + [ + 538, + 539 + ], + [ + 543, + 544 + ], + [ + 548, + 551 + ], + [ + 554, + 555 + ], + [ + 556, + 557 + ], + [ + 558, + 559 + ], + [ + 560, + 561 + ], + [ + 562, + 563 + ], + [ + 574, + 575 + ], + [ + 578, + 579 + ], + [ + 580, + 581 + ], + [ + 582, + 586 + ], + [ + 588, + 589 + ], + [ + 590, + 591 + ], + [ + 605, + 606 + ], + [ + 607, + 608 + ], + [ + 609, + 610 + ], + [ + 611, + 612 + ], + [ + 613, + 614 + ], + [ + 616, + 617 + ], + [ + 618, + 619 + ], + [ + 620, + 621 + ], + [ + 623, + 624 + ], + [ + 628, + 629 + ], + [ + 635, + 636 + ], + [ + 643, + 644 + ], + [ + 645, + 646 + ], + [ + 647, + 648 + ], + [ + 649, + 650 + ], + [ + 653, + 654 + ], + [ + 655, + 656 + ], + [ + 658, + 664 + ], + [ + 669, + 671 + ], + [ + 674, + 681 + ], + [ + 684, + 685 + ], + [ + 691, + 692 + ], + [ + 701, + 702 + ], + [ + 703, + 704 + ], + [ + 705, + 706 + ], + [ + 707, + 708 + ], + [ + 710, + 711 + ], + [ + 712, + 713 + ], + [ + 717, + 718 + ], + [ + 719, + 720 + ], + [ + 721, + 722 + ], + [ + 726, + 727 + ], + [ + 728, + 740 + ], + [ + 750, + 751 + ], + [ + 758, + 759 + ], + [ + 760, + 761 + ], + [ + 764, + 765 + ], + [ + 766, + 767 + ], + [ + 768, + 771 + ], + [ + 774, + 775 + ], + [ + 777, + 779 + ], + [ + 780, + 783 + ], + [ + 787, + 788 + ], + [ + 789, + 790 + ], + [ + 792, + 804 + ], + [ + 813, + 814 + ], + [ + 815, + 817 + ], + [ + 820, + 821 + ], + [ + 823, + 833 + ], + [ + 835, + 836 + ], + [ + 838, + 839 + ], + [ + 841, + 844 + ], + [ + 850, + 851 + ], + [ + 852, + 853 + ], + [ + 854, + 855 + ], + [ + 857, + 858 + ], + [ + 868, + 869 + ], + [ + 870, + 871 + ], + [ + 877, + 879 + ], + [ + 880, + 882 + ], + [ + 884, + 887 + ], + [ + 888, + 889 + ], + [ + 896, + 897 + ], + [ + 902, + 903 + ], + [ + 908, + 909 + ], + [ + 910, + 913 + ], + [ + 916, + 917 + ], + [ + 920, + 921 + ], + [ + 923, + 924 + ], + [ + 929, + 930 + ], + [ + 931, + 935 + ], + [ + 936, + 938 + ], + [ + 943, + 944 + ], + [ + 947, + 948 + ], + [ + 950, + 955 + ], + [ + 956, + 957 + ], + [ + 972, + 973 + ], + [ + 974, + 975 + ], + [ + 978, + 979 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 984, + 986 + ], + [ + 987, + 990 + ], + [ + 996, + 997 + ], + [ + 1009, + 1011 + ], + [ + 1012, + 1015 + ], + [ + 1019, + 1023 + ], + [ + 1038, + 1040 + ], + [ + 1041, + 1044 + ], + [ + 1047, + 1049 + ], + [ + 1059, + 1060 + ], + [ + 1067, + 1068 + ], + [ + 1069, + 1070 + ], + [ + 1071, + 1072 + ], + [ + 1073, + 1076 + ], + [ + 1080, + 1083 + ], + [ + 1087, + 1088 + ], + [ + 1089, + 1091 + ], + [ + 1094, + 1097 + ], + [ + 1098, + 1099 + ], + [ + 1101, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1107, + 1108 + ], + [ + 1109, + 1110 + ], + [ + 1111, + 1112 + ], + [ + 1113, + 1114 + ], + [ + 1126, + 1127 + ], + [ + 1132, + 1136 + ], + [ + 1139, + 1141 + ], + [ + 1142, + 1143 + ], + [ + 1157, + 1158 + ], + [ + 1159, + 1161 + ], + [ + 1164, + 1167 + ], + [ + 1168, + 1171 + ], + [ + 1172, + 1174 + ], + [ + 1187, + 1189 + ], + [ + 1191, + 1193 + ], + [ + 1205, + 1207 + ], + [ + 1212, + 1214 + ], + [ + 1217, + 1219 + ], + [ + 1224, + 1227 + ], + [ + 1230, + 1236 + ], + [ + 1240, + 1241 + ], + [ + 1242, + 1243 + ], + [ + 1249, + 1250 + ], + [ + 1257, + 1258 + ], + [ + 1259, + 1260 + ], + [ + 1261, + 1262 + ], + [ + 1263, + 1266 + ], + [ + 1270, + 1271 + ], + [ + 1273, + 1274 + ], + [ + 1275, + 1276 + ], + [ + 1283, + 1284 + ], + [ + 1289, + 1290 + ], + [ + 1294, + 1295 + ], + [ + 1296, + 1298 + ], + [ + 1299, + 1302 + ], + [ + 1303, + 1304 + ], + [ + 1307, + 1308 + ], + [ + 1312, + 1314 + ], + [ + 1320, + 1322 + ], + [ + 1326, + 1327 + ], + [ + 1328, + 1329 + ], + [ + 1330, + 1333 + ], + [ + 1334, + 1335 + ], + [ + 1336, + 1337 + ], + [ + 1338, + 1339 + ], + [ + 1341, + 1346 + ], + [ + 1352, + 1353 + ], + [ + 1356, + 1357 + ], + [ + 1360, + 1361 + ], + [ + 1370, + 1371 + ], + [ + 1375, + 1377 + ], + [ + 1378, + 1383 + ], + [ + 1384, + 1385 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sourcecustom.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 57, + 165 + ], + [ + 176, + 190 + ], + [ + 198, + 216 + ], + [ + 221, + 240 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 65, + 67 + ], + [ + 73, + 75 + ], + [ + 78, + 79 + ], + [ + 84, + 86 + ], + [ + 87, + 89 + ], + [ + 90, + 91 + ], + [ + 94, + 96 + ], + [ + 101, + 102 + ], + [ + 105, + 111 + ], + [ + 114, + 116 + ], + [ + 117, + 118 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 125, + 129 + ], + [ + 130, + 132 + ], + [ + 133, + 134 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 155, + 156 + ], + [ + 157, + 159 + ], + [ + 161, + 162 + ], + [ + 179, + 181 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 208, + 209 + ], + [ + 212, + 213 + ], + [ + 224, + 225 + ], + [ + 228, + 229 + ], + [ + 231, + 232 + ], + [ + 233, + 236 + ], + [ + 238, + 239 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sourceginput.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 54, + 69 + ], + [ + 71, + 239 + ], + [ + 245, + 266 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 57, + 59 + ], + [ + 65, + 66 + ], + [ + 74, + 75 + ], + [ + 76, + 79 + ], + [ + 81, + 82 + ], + [ + 83, + 85 + ], + [ + 86, + 87 + ], + [ + 91, + 97 + ], + [ + 100, + 120 + ], + [ + 123, + 125 + ], + [ + 126, + 128 + ], + [ + 129, + 132 + ], + [ + 133, + 134 + ], + [ + 137, + 139 + ], + [ + 140, + 142 + ], + [ + 146, + 148 + ], + [ + 151, + 156 + ], + [ + 158, + 159 + ], + [ + 160, + 161 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 178, + 179 + ], + [ + 180, + 183 + ], + [ + 187, + 190 + ], + [ + 191, + 196 + ], + [ + 198, + 199 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 209, + 210 + ], + [ + 211, + 214 + ], + [ + 219, + 220 + ], + [ + 226, + 232 + ], + [ + 235, + 236 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 259, + 262 + ], + [ + 264, + 265 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/system.c", + "line_filter": { + "diff_chunks": [ + [ + 26, + 54 + ], + [ + 97, + 129 + ], + [ + 135, + 322 + ], + [ + 332, + 364 + ], + [ + 368, + 394 + ] + ], + "lines_added": [ + [ + 29, + 45 + ], + [ + 50, + 51 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 110, + 113 + ], + [ + 116, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 138, + 140 + ], + [ + 142, + 143 + ], + [ + 145, + 147 + ], + [ + 148, + 160 + ], + [ + 165, + 166 + ], + [ + 169, + 175 + ], + [ + 177, + 186 + ], + [ + 187, + 192 + ], + [ + 198, + 209 + ], + [ + 210, + 216 + ], + [ + 217, + 223 + ], + [ + 224, + 226 + ], + [ + 227, + 228 + ], + [ + 230, + 234 + ], + [ + 235, + 238 + ], + [ + 240, + 242 + ], + [ + 243, + 245 + ], + [ + 246, + 251 + ], + [ + 253, + 254 + ], + [ + 257, + 258 + ], + [ + 259, + 262 + ], + [ + 268, + 269 + ], + [ + 271, + 272 + ], + [ + 275, + 278 + ], + [ + 279, + 291 + ], + [ + 292, + 294 + ], + [ + 295, + 298 + ], + [ + 299, + 301 + ], + [ + 302, + 305 + ], + [ + 306, + 308 + ], + [ + 309, + 312 + ], + [ + 313, + 315 + ], + [ + 318, + 319 + ], + [ + 335, + 337 + ], + [ + 339, + 340 + ], + [ + 342, + 343 + ], + [ + 345, + 346 + ], + [ + 347, + 351 + ], + [ + 353, + 354 + ], + [ + 357, + 358 + ], + [ + 360, + 361 + ], + [ + 371, + 375 + ], + [ + 380, + 381 + ], + [ + 383, + 384 + ], + [ + 388, + 391 + ], + [ + 392, + 393 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/target.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 10, + 38 + ], + [ + 67, + 194 + ], + [ + 201, + 281 + ], + [ + 284, + 312 + ], + [ + 321, + 372 + ], + [ + 379, + 401 + ], + [ + 409, + 497 + ], + [ + 499, + 531 + ], + [ + 534, + 541 + ], + [ + 545, + 561 + ], + [ + 565, + 595 + ], + [ + 598, + 643 + ], + [ + 648, + 661 + ], + [ + 663, + 707 + ], + [ + 708, + 719 + ], + [ + 726, + 743 + ], + [ + 745, + 759 + ], + [ + 761, + 791 + ], + [ + 793, + 843 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 13, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 29 + ], + [ + 34, + 35 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 83 + ], + [ + 86, + 88 + ], + [ + 91, + 94 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 111, + 116 + ], + [ + 118, + 119 + ], + [ + 125, + 131 + ], + [ + 136, + 138 + ], + [ + 144, + 145 + ], + [ + 147, + 150 + ], + [ + 151, + 152 + ], + [ + 154, + 156 + ], + [ + 157, + 158 + ], + [ + 161, + 162 + ], + [ + 163, + 166 + ], + [ + 167, + 169 + ], + [ + 173, + 174 + ], + [ + 175, + 176 + ], + [ + 178, + 180 + ], + [ + 181, + 183 + ], + [ + 186, + 188 + ], + [ + 189, + 191 + ], + [ + 204, + 206 + ], + [ + 208, + 211 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 220, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 230 + ], + [ + 231, + 236 + ], + [ + 239, + 240 + ], + [ + 242, + 245 + ], + [ + 247, + 248 + ], + [ + 249, + 250 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 268 + ], + [ + 269, + 271 + ], + [ + 277, + 278 + ], + [ + 287, + 290 + ], + [ + 291, + 293 + ], + [ + 297, + 303 + ], + [ + 306, + 307 + ], + [ + 308, + 309 + ], + [ + 324, + 325 + ], + [ + 328, + 330 + ], + [ + 331, + 332 + ], + [ + 333, + 334 + ], + [ + 335, + 338 + ], + [ + 340, + 341 + ], + [ + 345, + 346 + ], + [ + 352, + 353 + ], + [ + 356, + 358 + ], + [ + 359, + 360 + ], + [ + 361, + 362 + ], + [ + 363, + 366 + ], + [ + 368, + 369 + ], + [ + 382, + 383 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 390, + 391 + ], + [ + 392, + 395 + ], + [ + 397, + 398 + ], + [ + 412, + 413 + ], + [ + 416, + 417 + ], + [ + 418, + 419 + ], + [ + 422, + 428 + ], + [ + 429, + 433 + ], + [ + 434, + 435 + ], + [ + 441, + 442 + ], + [ + 445, + 447 + ], + [ + 448, + 449 + ], + [ + 450, + 451 + ], + [ + 452, + 454 + ], + [ + 455, + 456 + ], + [ + 458, + 459 + ], + [ + 460, + 461 + ], + [ + 463, + 469 + ], + [ + 475, + 476 + ], + [ + 479, + 480 + ], + [ + 481, + 483 + ], + [ + 484, + 485 + ], + [ + 486, + 490 + ], + [ + 493, + 494 + ], + [ + 502, + 503 + ], + [ + 507, + 508 + ], + [ + 509, + 510 + ], + [ + 511, + 514 + ], + [ + 515, + 516 + ], + [ + 518, + 520 + ], + [ + 522, + 524 + ], + [ + 527, + 528 + ], + [ + 537, + 538 + ], + [ + 548, + 549 + ], + [ + 550, + 551 + ], + [ + 552, + 553 + ], + [ + 554, + 556 + ], + [ + 557, + 558 + ], + [ + 568, + 569 + ], + [ + 574, + 575 + ], + [ + 576, + 577 + ], + [ + 580, + 582 + ], + [ + 583, + 585 + ], + [ + 586, + 587 + ], + [ + 588, + 590 + ], + [ + 591, + 592 + ], + [ + 601, + 602 + ], + [ + 608, + 609 + ], + [ + 610, + 611 + ], + [ + 612, + 613 + ], + [ + 614, + 616 + ], + [ + 617, + 619 + ], + [ + 622, + 623 + ], + [ + 627, + 628 + ], + [ + 629, + 631 + ], + [ + 633, + 635 + ], + [ + 639, + 640 + ], + [ + 651, + 652 + ], + [ + 653, + 654 + ], + [ + 657, + 658 + ], + [ + 666, + 667 + ], + [ + 669, + 670 + ], + [ + 673, + 674 + ], + [ + 677, + 678 + ], + [ + 679, + 682 + ], + [ + 684, + 685 + ], + [ + 687, + 688 + ], + [ + 689, + 690 + ], + [ + 694, + 695 + ], + [ + 696, + 698 + ], + [ + 699, + 700 + ], + [ + 703, + 704 + ], + [ + 711, + 712 + ], + [ + 713, + 714 + ], + [ + 715, + 716 + ], + [ + 729, + 730 + ], + [ + 731, + 732 + ], + [ + 733, + 736 + ], + [ + 739, + 740 + ], + [ + 748, + 749 + ], + [ + 752, + 753 + ], + [ + 754, + 756 + ], + [ + 764, + 766 + ], + [ + 769, + 770 + ], + [ + 775, + 778 + ], + [ + 779, + 780 + ], + [ + 781, + 782 + ], + [ + 783, + 784 + ], + [ + 787, + 788 + ], + [ + 796, + 797 + ], + [ + 798, + 799 + ], + [ + 803, + 804 + ], + [ + 807, + 809 + ], + [ + 811, + 812 + ], + [ + 814, + 815 + ], + [ + 816, + 817 + ], + [ + 820, + 823 + ], + [ + 824, + 827 + ], + [ + 828, + 831 + ], + [ + 832, + 835 + ], + [ + 836, + 839 + ], + [ + 841, + 842 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/targetcustom.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 57, + 234 + ], + [ + 247, + 265 + ], + [ + 272, + 286 + ], + [ + 294, + 308 + ], + [ + 312, + 325 + ], + [ + 326, + 343 + ], + [ + 348, + 367 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 65, + 70 + ], + [ + 76, + 78 + ], + [ + 81, + 82 + ], + [ + 87, + 89 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 106, + 108 + ], + [ + 109, + 111 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 122, + 123 + ], + [ + 126, + 132 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 141, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 150 + ], + [ + 151, + 153 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 162, + 163 + ], + [ + 168, + 170 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 183, + 185 + ], + [ + 186, + 187 + ], + [ + 188, + 189 + ], + [ + 192, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 226, + 228 + ], + [ + 230, + 231 + ], + [ + 250, + 251 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 275, + 277 + ], + [ + 278, + 279 + ], + [ + 282, + 283 + ], + [ + 297, + 299 + ], + [ + 300, + 301 + ], + [ + 304, + 305 + ], + [ + 315, + 317 + ], + [ + 318, + 319 + ], + [ + 321, + 322 + ], + [ + 329, + 331 + ], + [ + 332, + 333 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 351, + 352 + ], + [ + 355, + 356 + ], + [ + 357, + 359 + ], + [ + 360, + 363 + ], + [ + 365, + 366 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/thread.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 82, + 210 + ], + [ + 212, + 238 + ], + [ + 242, + 277 + ], + [ + 278, + 285 + ], + [ + 286, + 312 + ], + [ + 313, + 338 + ], + [ + 341, + 348 + ], + [ + 353, + 360 + ], + [ + 362, + 391 + ], + [ + 396, + 403 + ], + [ + 413, + 420 + ], + [ + 430, + 460 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 94, + 95 + ], + [ + 98, + 100 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 107, + 109 + ], + [ + 112, + 113 + ], + [ + 116, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 127 + ], + [ + 130, + 132 + ], + [ + 133, + 134 + ], + [ + 136, + 137 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 164, + 165 + ], + [ + 169, + 170 + ], + [ + 171, + 173 + ], + [ + 174, + 177 + ], + [ + 178, + 180 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 190, + 191 + ], + [ + 192, + 194 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 206, + 207 + ], + [ + 215, + 219 + ], + [ + 220, + 224 + ], + [ + 225, + 230 + ], + [ + 231, + 235 + ], + [ + 245, + 251 + ], + [ + 252, + 253 + ], + [ + 254, + 270 + ], + [ + 273, + 274 + ], + [ + 281, + 282 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 295, + 297 + ], + [ + 298, + 299 + ], + [ + 301, + 304 + ], + [ + 305, + 306 + ], + [ + 308, + 309 + ], + [ + 316, + 317 + ], + [ + 318, + 320 + ], + [ + 325, + 326 + ], + [ + 329, + 330 + ], + [ + 331, + 332 + ], + [ + 334, + 335 + ], + [ + 344, + 345 + ], + [ + 356, + 357 + ], + [ + 365, + 366 + ], + [ + 367, + 368 + ], + [ + 373, + 375 + ], + [ + 378, + 379 + ], + [ + 383, + 384 + ], + [ + 386, + 388 + ], + [ + 399, + 400 + ], + [ + 416, + 417 + ], + [ + 433, + 436 + ], + [ + 437, + 440 + ], + [ + 443, + 444 + ], + [ + 445, + 448 + ], + [ + 451, + 452 + ], + [ + 453, + 454 + ], + [ + 457, + 458 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/threadpool.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 22, + 59 + ], + [ + 80, + 87 + ], + [ + 112, + 143 + ], + [ + 151, + 206 + ], + [ + 207, + 233 + ], + [ + 245, + 264 + ], + [ + 275, + 282 + ], + [ + 288, + 308 + ], + [ + 311, + 384 + ], + [ + 386, + 495 + ], + [ + 498, + 538 + ], + [ + 562, + 571 + ], + [ + 586, + 593 + ], + [ + 625, + 636 + ], + [ + 637, + 657 + ], + [ + 660, + 708 + ], + [ + 717, + 726 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 25, + 26 + ], + [ + 30, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 46 + ], + [ + 51, + 52 + ], + [ + 55, + 56 + ], + [ + 83, + 84 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 121, + 123 + ], + [ + 126, + 127 + ], + [ + 133, + 134 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 159, + 160 + ], + [ + 162, + 163 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 178, + 180 + ], + [ + 181, + 184 + ], + [ + 187, + 188 + ], + [ + 189, + 191 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 210, + 211 + ], + [ + 215, + 216 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 228, + 230 + ], + [ + 248, + 249 + ], + [ + 250, + 252 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 278, + 279 + ], + [ + 291, + 292 + ], + [ + 295, + 296 + ], + [ + 297, + 300 + ], + [ + 301, + 303 + ], + [ + 304, + 305 + ], + [ + 314, + 315 + ], + [ + 318, + 319 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 326, + 327 + ], + [ + 328, + 329 + ], + [ + 334, + 335 + ], + [ + 339, + 340 + ], + [ + 343, + 344 + ], + [ + 346, + 347 + ], + [ + 349, + 350 + ], + [ + 352, + 353 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 364, + 365 + ], + [ + 366, + 368 + ], + [ + 369, + 370 + ], + [ + 371, + 372 + ], + [ + 373, + 376 + ], + [ + 380, + 381 + ], + [ + 389, + 390 + ], + [ + 394, + 395 + ], + [ + 396, + 397 + ], + [ + 398, + 399 + ], + [ + 401, + 402 + ], + [ + 403, + 411 + ], + [ + 412, + 413 + ], + [ + 417, + 418 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 423, + 425 + ], + [ + 428, + 429 + ], + [ + 434, + 435 + ], + [ + 438, + 440 + ], + [ + 444, + 445 + ], + [ + 448, + 452 + ], + [ + 456, + 457 + ], + [ + 458, + 459 + ], + [ + 462, + 463 + ], + [ + 464, + 465 + ], + [ + 466, + 471 + ], + [ + 474, + 475 + ], + [ + 476, + 478 + ], + [ + 482, + 483 + ], + [ + 484, + 488 + ], + [ + 491, + 492 + ], + [ + 501, + 503 + ], + [ + 508, + 510 + ], + [ + 514, + 515 + ], + [ + 519, + 521 + ], + [ + 522, + 524 + ], + [ + 525, + 526 + ], + [ + 528, + 529 + ], + [ + 530, + 533 + ], + [ + 534, + 535 + ], + [ + 565, + 566 + ], + [ + 567, + 568 + ], + [ + 589, + 590 + ], + [ + 628, + 629 + ], + [ + 630, + 633 + ], + [ + 640, + 643 + ], + [ + 644, + 646 + ], + [ + 647, + 648 + ], + [ + 652, + 654 + ], + [ + 663, + 667 + ], + [ + 669, + 670 + ], + [ + 672, + 673 + ], + [ + 674, + 675 + ], + [ + 676, + 678 + ], + [ + 680, + 682 + ], + [ + 684, + 686 + ], + [ + 688, + 692 + ], + [ + 693, + 697 + ], + [ + 699, + 705 + ], + [ + 720, + 721 + ], + [ + 722, + 723 + ], + [ + 724, + 725 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/threadset.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 60, + 67 + ], + [ + 84, + 91 + ], + [ + 95, + 122 + ], + [ + 129, + 190 + ], + [ + 195, + 226 + ], + [ + 233, + 241 + ], + [ + 242, + 264 + ], + [ + 265, + 298 + ], + [ + 299, + 332 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 64 + ], + [ + 87, + 88 + ], + [ + 98, + 99 + ], + [ + 103, + 104 + ], + [ + 106, + 109 + ], + [ + 113, + 115 + ], + [ + 118, + 119 + ], + [ + 132, + 135 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 147, + 148 + ], + [ + 151, + 156 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 163, + 167 + ], + [ + 168, + 169 + ], + [ + 171, + 173 + ], + [ + 174, + 178 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 206, + 208 + ], + [ + 210, + 213 + ], + [ + 215, + 216 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 236, + 238 + ], + [ + 245, + 247 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 254, + 256 + ], + [ + 259, + 261 + ], + [ + 268, + 269 + ], + [ + 270, + 271 + ], + [ + 276, + 277 + ], + [ + 281, + 283 + ], + [ + 284, + 285 + ], + [ + 286, + 288 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 294, + 295 + ], + [ + 302, + 303 + ], + [ + 304, + 305 + ], + [ + 308, + 309 + ], + [ + 312, + 314 + ], + [ + 315, + 316 + ], + [ + 317, + 318 + ], + [ + 319, + 320 + ], + [ + 322, + 323 + ], + [ + 325, + 328 + ], + [ + 329, + 331 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/type.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 13, + 41 + ], + [ + 63, + 70 + ], + [ + 73, + 80 + ], + [ + 96, + 191 + ], + [ + 192, + 240 + ], + [ + 246, + 253 + ], + [ + 255, + 266 + ], + [ + 268, + 314 + ], + [ + 324, + 357 + ], + [ + 361, + 388 + ], + [ + 392, + 507 + ], + [ + 508, + 565 + ], + [ + 567, + 587 + ], + [ + 589, + 633 + ], + [ + 637, + 702 + ], + [ + 713, + 807 + ], + [ + 816, + 832 + ], + [ + 841, + 863 + ], + [ + 864, + 927 + ], + [ + 928, + 1050 + ], + [ + 1059, + 1075 + ], + [ + 1084, + 1106 + ], + [ + 1107, + 1155 + ], + [ + 1156, + 1267 + ], + [ + 1269, + 1305 + ], + [ + 1307, + 1350 + ], + [ + 1355, + 1398 + ], + [ + 1400, + 1409 + ], + [ + 1410, + 1417 + ], + [ + 1420, + 1429 + ], + [ + 1430, + 1449 + ], + [ + 1450, + 1512 + ], + [ + 1517, + 1531 + ], + [ + 1534, + 1567 + ], + [ + 1570, + 1587 + ], + [ + 1589, + 1630 + ], + [ + 1632, + 1650 + ], + [ + 1662, + 1708 + ], + [ + 1718, + 1752 + ], + [ + 1761, + 1769 + ], + [ + 1770, + 1789 + ], + [ + 1795, + 1830 + ], + [ + 1836, + 1871 + ], + [ + 1877, + 1909 + ], + [ + 1915, + 1949 + ], + [ + 1953, + 1973 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 32 + ], + [ + 37, + 38 + ], + [ + 66, + 67 + ], + [ + 76, + 77 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 132, + 134 + ], + [ + 135, + 136 + ], + [ + 141, + 142 + ], + [ + 145, + 149 + ], + [ + 151, + 152 + ], + [ + 157, + 158 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 166, + 167 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 183, + 184 + ], + [ + 185, + 188 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 199, + 200 + ], + [ + 204, + 205 + ], + [ + 207, + 211 + ], + [ + 213, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 220, + 221 + ], + [ + 222, + 226 + ], + [ + 229, + 233 + ], + [ + 236, + 237 + ], + [ + 249, + 250 + ], + [ + 258, + 259 + ], + [ + 262, + 263 + ], + [ + 271, + 275 + ], + [ + 278, + 283 + ], + [ + 285, + 286 + ], + [ + 289, + 290 + ], + [ + 295, + 297 + ], + [ + 298, + 302 + ], + [ + 303, + 305 + ], + [ + 310, + 311 + ], + [ + 327, + 328 + ], + [ + 332, + 334 + ], + [ + 339, + 340 + ], + [ + 343, + 344 + ], + [ + 347, + 350 + ], + [ + 353, + 354 + ], + [ + 364, + 365 + ], + [ + 371, + 372 + ], + [ + 376, + 379 + ], + [ + 380, + 381 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 395, + 396 + ], + [ + 402, + 404 + ], + [ + 405, + 407 + ], + [ + 408, + 409 + ], + [ + 410, + 411 + ], + [ + 412, + 413 + ], + [ + 414, + 415 + ], + [ + 417, + 418 + ], + [ + 423, + 424 + ], + [ + 428, + 432 + ], + [ + 435, + 436 + ], + [ + 439, + 445 + ], + [ + 447, + 448 + ], + [ + 453, + 454 + ], + [ + 455, + 457 + ], + [ + 460, + 461 + ], + [ + 462, + 464 + ], + [ + 467, + 468 + ], + [ + 473, + 476 + ], + [ + 479, + 480 + ], + [ + 481, + 484 + ], + [ + 487, + 488 + ], + [ + 493, + 496 + ], + [ + 499, + 500 + ], + [ + 501, + 504 + ], + [ + 511, + 512 + ], + [ + 515, + 519 + ], + [ + 521, + 522 + ], + [ + 527, + 528 + ], + [ + 529, + 531 + ], + [ + 534, + 535 + ], + [ + 536, + 538 + ], + [ + 543, + 544 + ], + [ + 545, + 547 + ], + [ + 550, + 551 + ], + [ + 552, + 554 + ], + [ + 557, + 558 + ], + [ + 561, + 562 + ], + [ + 570, + 571 + ], + [ + 574, + 575 + ], + [ + 577, + 578 + ], + [ + 581, + 582 + ], + [ + 583, + 584 + ], + [ + 592, + 593 + ], + [ + 596, + 597 + ], + [ + 599, + 600 + ], + [ + 601, + 602 + ], + [ + 603, + 604 + ], + [ + 607, + 608 + ], + [ + 611, + 623 + ], + [ + 625, + 626 + ], + [ + 629, + 630 + ], + [ + 640, + 641 + ], + [ + 646, + 647 + ], + [ + 650, + 651 + ], + [ + 653, + 654 + ], + [ + 657, + 658 + ], + [ + 662, + 663 + ], + [ + 669, + 670 + ], + [ + 671, + 672 + ], + [ + 674, + 677 + ], + [ + 679, + 680 + ], + [ + 683, + 684 + ], + [ + 687, + 689 + ], + [ + 691, + 692 + ], + [ + 695, + 696 + ], + [ + 697, + 699 + ], + [ + 716, + 718 + ], + [ + 719, + 720 + ], + [ + 721, + 722 + ], + [ + 723, + 724 + ], + [ + 729, + 730 + ], + [ + 735, + 736 + ], + [ + 741, + 746 + ], + [ + 750, + 751 + ], + [ + 756, + 760 + ], + [ + 765, + 766 + ], + [ + 769, + 770 + ], + [ + 775, + 779 + ], + [ + 783, + 784 + ], + [ + 787, + 788 + ], + [ + 791, + 801 + ], + [ + 803, + 804 + ], + [ + 819, + 820 + ], + [ + 824, + 827 + ], + [ + 828, + 829 + ], + [ + 844, + 845 + ], + [ + 851, + 853 + ], + [ + 854, + 858 + ], + [ + 859, + 860 + ], + [ + 867, + 868 + ], + [ + 872, + 873 + ], + [ + 874, + 875 + ], + [ + 876, + 877 + ], + [ + 878, + 879 + ], + [ + 881, + 882 + ], + [ + 885, + 886 + ], + [ + 891, + 892 + ], + [ + 894, + 897 + ], + [ + 899, + 900 + ], + [ + 901, + 902 + ], + [ + 905, + 906 + ], + [ + 909, + 910 + ], + [ + 911, + 912 + ], + [ + 913, + 915 + ], + [ + 916, + 917 + ], + [ + 923, + 924 + ], + [ + 931, + 932 + ], + [ + 938, + 939 + ], + [ + 941, + 942 + ], + [ + 944, + 945 + ], + [ + 946, + 948 + ], + [ + 949, + 950 + ], + [ + 952, + 954 + ], + [ + 956, + 961 + ], + [ + 967, + 968 + ], + [ + 971, + 972 + ], + [ + 975, + 976 + ], + [ + 977, + 979 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 988, + 989 + ], + [ + 992, + 995 + ], + [ + 998, + 999 + ], + [ + 1002, + 1005 + ], + [ + 1008, + 1009 + ], + [ + 1011, + 1012 + ], + [ + 1015, + 1018 + ], + [ + 1022, + 1023 + ], + [ + 1026, + 1044 + ], + [ + 1046, + 1047 + ], + [ + 1062, + 1063 + ], + [ + 1067, + 1070 + ], + [ + 1071, + 1072 + ], + [ + 1087, + 1088 + ], + [ + 1094, + 1096 + ], + [ + 1097, + 1101 + ], + [ + 1102, + 1103 + ], + [ + 1110, + 1111 + ], + [ + 1115, + 1116 + ], + [ + 1117, + 1118 + ], + [ + 1119, + 1120 + ], + [ + 1121, + 1122 + ], + [ + 1124, + 1125 + ], + [ + 1128, + 1129 + ], + [ + 1134, + 1135 + ], + [ + 1137, + 1140 + ], + [ + 1142, + 1143 + ], + [ + 1144, + 1145 + ], + [ + 1151, + 1152 + ], + [ + 1159, + 1160 + ], + [ + 1165, + 1166 + ], + [ + 1168, + 1169 + ], + [ + 1171, + 1172 + ], + [ + 1173, + 1175 + ], + [ + 1176, + 1177 + ], + [ + 1179, + 1181 + ], + [ + 1183, + 1187 + ], + [ + 1193, + 1194 + ], + [ + 1199, + 1200 + ], + [ + 1203, + 1206 + ], + [ + 1209, + 1210 + ], + [ + 1213, + 1216 + ], + [ + 1219, + 1220 + ], + [ + 1222, + 1223 + ], + [ + 1226, + 1229 + ], + [ + 1232, + 1233 + ], + [ + 1235, + 1236 + ], + [ + 1237, + 1238 + ], + [ + 1241, + 1242 + ], + [ + 1245, + 1261 + ], + [ + 1263, + 1264 + ], + [ + 1272, + 1273 + ], + [ + 1274, + 1275 + ], + [ + 1279, + 1280 + ], + [ + 1286, + 1287 + ], + [ + 1292, + 1293 + ], + [ + 1295, + 1299 + ], + [ + 1301, + 1302 + ], + [ + 1310, + 1311 + ], + [ + 1312, + 1313 + ], + [ + 1317, + 1318 + ], + [ + 1324, + 1325 + ], + [ + 1331, + 1332 + ], + [ + 1334, + 1339 + ], + [ + 1340, + 1341 + ], + [ + 1342, + 1343 + ], + [ + 1346, + 1347 + ], + [ + 1358, + 1359 + ], + [ + 1361, + 1362 + ], + [ + 1364, + 1365 + ], + [ + 1366, + 1367 + ], + [ + 1369, + 1370 + ], + [ + 1371, + 1372 + ], + [ + 1374, + 1381 + ], + [ + 1386, + 1387 + ], + [ + 1388, + 1389 + ], + [ + 1394, + 1395 + ], + [ + 1403, + 1404 + ], + [ + 1405, + 1406 + ], + [ + 1413, + 1414 + ], + [ + 1423, + 1424 + ], + [ + 1425, + 1426 + ], + [ + 1433, + 1434 + ], + [ + 1436, + 1441 + ], + [ + 1443, + 1444 + ], + [ + 1445, + 1446 + ], + [ + 1453, + 1454 + ], + [ + 1458, + 1459 + ], + [ + 1460, + 1461 + ], + [ + 1462, + 1463 + ], + [ + 1464, + 1465 + ], + [ + 1467, + 1468 + ], + [ + 1471, + 1472 + ], + [ + 1474, + 1475 + ], + [ + 1476, + 1477 + ], + [ + 1481, + 1482 + ], + [ + 1484, + 1486 + ], + [ + 1489, + 1490 + ], + [ + 1491, + 1493 + ], + [ + 1496, + 1497 + ], + [ + 1500, + 1506 + ], + [ + 1508, + 1509 + ], + [ + 1520, + 1521 + ], + [ + 1524, + 1528 + ], + [ + 1537, + 1538 + ], + [ + 1540, + 1541 + ], + [ + 1544, + 1545 + ], + [ + 1546, + 1547 + ], + [ + 1549, + 1550 + ], + [ + 1555, + 1556 + ], + [ + 1558, + 1559 + ], + [ + 1560, + 1561 + ], + [ + 1563, + 1564 + ], + [ + 1573, + 1574 + ], + [ + 1575, + 1576 + ], + [ + 1577, + 1578 + ], + [ + 1580, + 1581 + ], + [ + 1583, + 1584 + ], + [ + 1592, + 1593 + ], + [ + 1597, + 1598 + ], + [ + 1599, + 1604 + ], + [ + 1606, + 1607 + ], + [ + 1613, + 1614 + ], + [ + 1616, + 1617 + ], + [ + 1618, + 1619 + ], + [ + 1621, + 1622 + ], + [ + 1626, + 1627 + ], + [ + 1635, + 1636 + ], + [ + 1639, + 1640 + ], + [ + 1641, + 1644 + ], + [ + 1646, + 1647 + ], + [ + 1665, + 1667 + ], + [ + 1670, + 1671 + ], + [ + 1672, + 1675 + ], + [ + 1677, + 1678 + ], + [ + 1684, + 1685 + ], + [ + 1686, + 1687 + ], + [ + 1693, + 1694 + ], + [ + 1697, + 1698 + ], + [ + 1699, + 1702 + ], + [ + 1704, + 1705 + ], + [ + 1721, + 1722 + ], + [ + 1723, + 1724 + ], + [ + 1727, + 1728 + ], + [ + 1729, + 1732 + ], + [ + 1733, + 1734 + ], + [ + 1735, + 1736 + ], + [ + 1739, + 1740 + ], + [ + 1743, + 1746 + ], + [ + 1748, + 1749 + ], + [ + 1764, + 1766 + ], + [ + 1773, + 1776 + ], + [ + 1777, + 1778 + ], + [ + 1779, + 1780 + ], + [ + 1782, + 1783 + ], + [ + 1785, + 1786 + ], + [ + 1798, + 1799 + ], + [ + 1800, + 1801 + ], + [ + 1803, + 1804 + ], + [ + 1807, + 1808 + ], + [ + 1809, + 1810 + ], + [ + 1814, + 1815 + ], + [ + 1816, + 1817 + ], + [ + 1818, + 1819 + ], + [ + 1821, + 1823 + ], + [ + 1826, + 1827 + ], + [ + 1839, + 1840 + ], + [ + 1841, + 1842 + ], + [ + 1844, + 1845 + ], + [ + 1848, + 1849 + ], + [ + 1850, + 1851 + ], + [ + 1855, + 1856 + ], + [ + 1857, + 1858 + ], + [ + 1859, + 1860 + ], + [ + 1862, + 1864 + ], + [ + 1867, + 1868 + ], + [ + 1880, + 1881 + ], + [ + 1882, + 1883 + ], + [ + 1885, + 1886 + ], + [ + 1888, + 1889 + ], + [ + 1890, + 1891 + ], + [ + 1895, + 1896 + ], + [ + 1899, + 1900 + ], + [ + 1901, + 1903 + ], + [ + 1905, + 1906 + ], + [ + 1918, + 1919 + ], + [ + 1920, + 1921 + ], + [ + 1923, + 1924 + ], + [ + 1926, + 1927 + ], + [ + 1928, + 1929 + ], + [ + 1933, + 1934 + ], + [ + 1937, + 1940 + ], + [ + 1945, + 1946 + ], + [ + 1956, + 1959 + ], + [ + 1960, + 1972 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/util.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 66, + 169 + ], + [ + 170, + 187 + ], + [ + 189, + 220 + ], + [ + 224, + 239 + ], + [ + 241, + 250 + ], + [ + 251, + 334 + ], + [ + 336, + 361 + ], + [ + 363, + 370 + ], + [ + 375, + 382 + ], + [ + 404, + 467 + ], + [ + 469, + 509 + ], + [ + 511, + 587 + ], + [ + 589, + 669 + ], + [ + 673, + 759 + ], + [ + 767, + 867 + ], + [ + 869, + 1022 + ], + [ + 1025, + 1103 + ], + [ + 1107, + 1262 + ], + [ + 1264, + 1280 + ], + [ + 1305, + 1332 + ], + [ + 1337, + 1355 + ], + [ + 1356, + 1398 + ], + [ + 1400, + 1430 + ], + [ + 1435, + 1468 + ], + [ + 1477, + 1492 + ], + [ + 1494, + 1555 + ], + [ + 1558, + 1631 + ], + [ + 1632, + 1694 + ], + [ + 1696, + 1703 + ], + [ + 1711, + 1841 + ], + [ + 1842, + 1865 + ], + [ + 1866, + 1901 + ], + [ + 1902, + 2076 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 69, + 70 + ], + [ + 74, + 75 + ], + [ + 76, + 79 + ], + [ + 84, + 88 + ], + [ + 93, + 94 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 111, + 112 + ], + [ + 117, + 119 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 130 + ], + [ + 135, + 136 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 148 + ], + [ + 149, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 158 + ], + [ + 159, + 160 + ], + [ + 165, + 166 + ], + [ + 173, + 175 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 183, + 184 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 198, + 199 + ], + [ + 204, + 205 + ], + [ + 206, + 208 + ], + [ + 211, + 212 + ], + [ + 213, + 215 + ], + [ + 216, + 217 + ], + [ + 227, + 228 + ], + [ + 229, + 230 + ], + [ + 235, + 236 + ], + [ + 244, + 245 + ], + [ + 246, + 247 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 258, + 259 + ], + [ + 260, + 264 + ], + [ + 265, + 266 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 277, + 282 + ], + [ + 284, + 285 + ], + [ + 287, + 291 + ], + [ + 292, + 294 + ], + [ + 295, + 296 + ], + [ + 298, + 299 + ], + [ + 301, + 305 + ], + [ + 306, + 308 + ], + [ + 309, + 310 + ], + [ + 313, + 314 + ], + [ + 316, + 317 + ], + [ + 320, + 323 + ], + [ + 327, + 329 + ], + [ + 330, + 331 + ], + [ + 339, + 340 + ], + [ + 345, + 347 + ], + [ + 349, + 351 + ], + [ + 355, + 356 + ], + [ + 357, + 358 + ], + [ + 366, + 367 + ], + [ + 378, + 379 + ], + [ + 407, + 408 + ], + [ + 409, + 411 + ], + [ + 412, + 417 + ], + [ + 418, + 421 + ], + [ + 424, + 426 + ], + [ + 427, + 428 + ], + [ + 429, + 441 + ], + [ + 445, + 447 + ], + [ + 453, + 454 + ], + [ + 459, + 460 + ], + [ + 462, + 464 + ], + [ + 472, + 485 + ], + [ + 489, + 490 + ], + [ + 494, + 497 + ], + [ + 498, + 499 + ], + [ + 505, + 506 + ], + [ + 514, + 515 + ], + [ + 518, + 519 + ], + [ + 522, + 524 + ], + [ + 528, + 529 + ], + [ + 530, + 531 + ], + [ + 536, + 537 + ], + [ + 541, + 543 + ], + [ + 545, + 546 + ], + [ + 547, + 550 + ], + [ + 552, + 553 + ], + [ + 558, + 559 + ], + [ + 561, + 562 + ], + [ + 563, + 567 + ], + [ + 571, + 572 + ], + [ + 573, + 574 + ], + [ + 577, + 579 + ], + [ + 583, + 584 + ], + [ + 592, + 593 + ], + [ + 595, + 596 + ], + [ + 597, + 600 + ], + [ + 606, + 607 + ], + [ + 613, + 614 + ], + [ + 615, + 616 + ], + [ + 618, + 619 + ], + [ + 621, + 624 + ], + [ + 626, + 627 + ], + [ + 629, + 631 + ], + [ + 632, + 633 + ], + [ + 638, + 639 + ], + [ + 642, + 643 + ], + [ + 645, + 648 + ], + [ + 650, + 651 + ], + [ + 655, + 657 + ], + [ + 661, + 664 + ], + [ + 665, + 666 + ], + [ + 676, + 678 + ], + [ + 683, + 684 + ], + [ + 687, + 688 + ], + [ + 691, + 693 + ], + [ + 694, + 696 + ], + [ + 698, + 701 + ], + [ + 702, + 704 + ], + [ + 706, + 708 + ], + [ + 709, + 710 + ], + [ + 713, + 714 + ], + [ + 719, + 720 + ], + [ + 723, + 724 + ], + [ + 727, + 732 + ], + [ + 734, + 735 + ], + [ + 740, + 741 + ], + [ + 742, + 743 + ], + [ + 744, + 745 + ], + [ + 746, + 748 + ], + [ + 750, + 754 + ], + [ + 755, + 756 + ], + [ + 770, + 776 + ], + [ + 781, + 784 + ], + [ + 785, + 786 + ], + [ + 788, + 789 + ], + [ + 792, + 793 + ], + [ + 794, + 804 + ], + [ + 809, + 810 + ], + [ + 812, + 813 + ], + [ + 819, + 821 + ], + [ + 825, + 830 + ], + [ + 831, + 832 + ], + [ + 833, + 834 + ], + [ + 839, + 840 + ], + [ + 843, + 845 + ], + [ + 846, + 851 + ], + [ + 853, + 854 + ], + [ + 856, + 858 + ], + [ + 863, + 864 + ], + [ + 872, + 876 + ], + [ + 877, + 878 + ], + [ + 881, + 882 + ], + [ + 884, + 885 + ], + [ + 887, + 888 + ], + [ + 891, + 896 + ], + [ + 900, + 901 + ], + [ + 906, + 907 + ], + [ + 910, + 912 + ], + [ + 913, + 914 + ], + [ + 917, + 918 + ], + [ + 921, + 923 + ], + [ + 924, + 925 + ], + [ + 928, + 929 + ], + [ + 930, + 932 + ], + [ + 935, + 936 + ], + [ + 939, + 941 + ], + [ + 942, + 943 + ], + [ + 948, + 949 + ], + [ + 950, + 952 + ], + [ + 957, + 958 + ], + [ + 964, + 967 + ], + [ + 968, + 969 + ], + [ + 970, + 971 + ], + [ + 973, + 975 + ], + [ + 978, + 979 + ], + [ + 985, + 986 + ], + [ + 988, + 989 + ], + [ + 990, + 991 + ], + [ + 993, + 995 + ], + [ + 996, + 997 + ], + [ + 999, + 1001 + ], + [ + 1004, + 1007 + ], + [ + 1009, + 1010 + ], + [ + 1011, + 1012 + ], + [ + 1018, + 1019 + ], + [ + 1028, + 1029 + ], + [ + 1032, + 1033 + ], + [ + 1036, + 1037 + ], + [ + 1040, + 1042 + ], + [ + 1045, + 1046 + ], + [ + 1049, + 1051 + ], + [ + 1053, + 1054 + ], + [ + 1057, + 1058 + ], + [ + 1059, + 1060 + ], + [ + 1063, + 1064 + ], + [ + 1065, + 1066 + ], + [ + 1069, + 1070 + ], + [ + 1074, + 1077 + ], + [ + 1078, + 1079 + ], + [ + 1080, + 1081 + ], + [ + 1083, + 1084 + ], + [ + 1089, + 1090 + ], + [ + 1093, + 1097 + ], + [ + 1099, + 1100 + ], + [ + 1110, + 1111 + ], + [ + 1113, + 1123 + ], + [ + 1124, + 1129 + ], + [ + 1132, + 1133 + ], + [ + 1138, + 1139 + ], + [ + 1140, + 1143 + ], + [ + 1144, + 1147 + ], + [ + 1148, + 1149 + ], + [ + 1150, + 1151 + ], + [ + 1152, + 1153 + ], + [ + 1158, + 1159 + ], + [ + 1160, + 1163 + ], + [ + 1164, + 1167 + ], + [ + 1168, + 1169 + ], + [ + 1170, + 1171 + ], + [ + 1172, + 1173 + ], + [ + 1178, + 1179 + ], + [ + 1180, + 1193 + ], + [ + 1194, + 1195 + ], + [ + 1196, + 1197 + ], + [ + 1202, + 1203 + ], + [ + 1204, + 1217 + ], + [ + 1218, + 1219 + ], + [ + 1220, + 1221 + ], + [ + 1223, + 1224 + ], + [ + 1226, + 1227 + ], + [ + 1228, + 1233 + ], + [ + 1235, + 1236 + ], + [ + 1241, + 1242 + ], + [ + 1245, + 1246 + ], + [ + 1249, + 1250 + ], + [ + 1251, + 1252 + ], + [ + 1253, + 1254 + ], + [ + 1258, + 1259 + ], + [ + 1267, + 1269 + ], + [ + 1272, + 1275 + ], + [ + 1276, + 1277 + ], + [ + 1308, + 1309 + ], + [ + 1311, + 1312 + ], + [ + 1315, + 1317 + ], + [ + 1319, + 1320 + ], + [ + 1322, + 1323 + ], + [ + 1328, + 1329 + ], + [ + 1340, + 1341 + ], + [ + 1342, + 1344 + ], + [ + 1350, + 1352 + ], + [ + 1359, + 1360 + ], + [ + 1365, + 1367 + ], + [ + 1368, + 1372 + ], + [ + 1374, + 1375 + ], + [ + 1380, + 1382 + ], + [ + 1385, + 1392 + ], + [ + 1394, + 1395 + ], + [ + 1403, + 1405 + ], + [ + 1408, + 1410 + ], + [ + 1411, + 1412 + ], + [ + 1413, + 1415 + ], + [ + 1418, + 1419 + ], + [ + 1422, + 1425 + ], + [ + 1426, + 1427 + ], + [ + 1438, + 1439 + ], + [ + 1440, + 1442 + ], + [ + 1444, + 1445 + ], + [ + 1450, + 1452 + ], + [ + 1455, + 1462 + ], + [ + 1464, + 1465 + ], + [ + 1480, + 1481 + ], + [ + 1484, + 1485 + ], + [ + 1488, + 1489 + ], + [ + 1497, + 1502 + ], + [ + 1506, + 1508 + ], + [ + 1511, + 1514 + ], + [ + 1516, + 1518 + ], + [ + 1519, + 1520 + ], + [ + 1522, + 1523 + ], + [ + 1528, + 1530 + ], + [ + 1533, + 1534 + ], + [ + 1538, + 1539 + ], + [ + 1541, + 1542 + ], + [ + 1545, + 1548 + ], + [ + 1551, + 1552 + ], + [ + 1561, + 1562 + ], + [ + 1567, + 1569 + ], + [ + 1573, + 1574 + ], + [ + 1576, + 1577 + ], + [ + 1578, + 1579 + ], + [ + 1584, + 1585 + ], + [ + 1587, + 1588 + ], + [ + 1589, + 1590 + ], + [ + 1595, + 1596 + ], + [ + 1599, + 1600 + ], + [ + 1603, + 1604 + ], + [ + 1608, + 1611 + ], + [ + 1613, + 1614 + ], + [ + 1618, + 1619 + ], + [ + 1621, + 1622 + ], + [ + 1624, + 1625 + ], + [ + 1627, + 1628 + ], + [ + 1635, + 1636 + ], + [ + 1637, + 1641 + ], + [ + 1643, + 1644 + ], + [ + 1647, + 1648 + ], + [ + 1651, + 1652 + ], + [ + 1654, + 1656 + ], + [ + 1658, + 1660 + ], + [ + 1661, + 1663 + ], + [ + 1665, + 1691 + ], + [ + 1699, + 1700 + ], + [ + 1714, + 1716 + ], + [ + 1717, + 1718 + ], + [ + 1720, + 1722 + ], + [ + 1726, + 1727 + ], + [ + 1728, + 1730 + ], + [ + 1731, + 1732 + ], + [ + 1737, + 1738 + ], + [ + 1741, + 1743 + ], + [ + 1744, + 1745 + ], + [ + 1748, + 1749 + ], + [ + 1752, + 1754 + ], + [ + 1755, + 1756 + ], + [ + 1759, + 1760 + ], + [ + 1766, + 1767 + ], + [ + 1768, + 1771 + ], + [ + 1772, + 1773 + ], + [ + 1774, + 1778 + ], + [ + 1781, + 1785 + ], + [ + 1787, + 1790 + ], + [ + 1791, + 1792 + ], + [ + 1795, + 1796 + ], + [ + 1802, + 1803 + ], + [ + 1804, + 1807 + ], + [ + 1808, + 1809 + ], + [ + 1810, + 1814 + ], + [ + 1815, + 1819 + ], + [ + 1821, + 1824 + ], + [ + 1825, + 1826 + ], + [ + 1828, + 1829 + ], + [ + 1834, + 1835 + ], + [ + 1836, + 1838 + ], + [ + 1845, + 1846 + ], + [ + 1850, + 1852 + ], + [ + 1854, + 1855 + ], + [ + 1856, + 1857 + ], + [ + 1859, + 1862 + ], + [ + 1869, + 1872 + ], + [ + 1877, + 1879 + ], + [ + 1884, + 1886 + ], + [ + 1887, + 1890 + ], + [ + 1891, + 1892 + ], + [ + 1897, + 1898 + ], + [ + 1905, + 1906 + ], + [ + 1909, + 1911 + ], + [ + 1913, + 1914 + ], + [ + 1915, + 1916 + ], + [ + 1921, + 1923 + ], + [ + 1924, + 1925 + ], + [ + 1926, + 1930 + ], + [ + 1931, + 1932 + ], + [ + 1935, + 1936 + ], + [ + 1940, + 1941 + ], + [ + 1942, + 1943 + ], + [ + 1946, + 1947 + ], + [ + 1953, + 1954 + ], + [ + 1959, + 1961 + ], + [ + 1963, + 1966 + ], + [ + 1967, + 1968 + ], + [ + 1972, + 1973 + ], + [ + 1976, + 1977 + ], + [ + 1980, + 1982 + ], + [ + 1988, + 1989 + ], + [ + 1990, + 1991 + ], + [ + 1993, + 1994 + ], + [ + 1999, + 2000 + ], + [ + 2004, + 2008 + ], + [ + 2010, + 2011 + ], + [ + 2014, + 2015 + ], + [ + 2018, + 2020 + ], + [ + 2023, + 2024 + ], + [ + 2027, + 2030 + ], + [ + 2031, + 2038 + ], + [ + 2039, + 2042 + ], + [ + 2044, + 2045 + ], + [ + 2051, + 2052 + ], + [ + 2057, + 2059 + ], + [ + 2061, + 2063 + ], + [ + 2064, + 2066 + ], + [ + 2070, + 2073 + ], + [ + 2074, + 2075 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/vector.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 40 + ], + [ + 70, + 93 + ], + [ + 94, + 111 + ], + [ + 112, + 140 + ], + [ + 141, + 168 + ], + [ + 170, + 177 + ], + [ + 182, + 189 + ], + [ + 191, + 297 + ], + [ + 300, + 392 + ], + [ + 394, + 545 + ], + [ + 549, + 558 + ], + [ + 564, + 589 + ], + [ + 592, + 599 + ], + [ + 601, + 613 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 34, + 35 + ], + [ + 36, + 37 + ], + [ + 73, + 74 + ], + [ + 77, + 80 + ], + [ + 84, + 86 + ], + [ + 89, + 90 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 115, + 117 + ], + [ + 119, + 122 + ], + [ + 125, + 127 + ], + [ + 132, + 133 + ], + [ + 136, + 137 + ], + [ + 144, + 146 + ], + [ + 147, + 148 + ], + [ + 149, + 151 + ], + [ + 154, + 155 + ], + [ + 161, + 163 + ], + [ + 164, + 165 + ], + [ + 173, + 174 + ], + [ + 185, + 186 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 198, + 199 + ], + [ + 201, + 204 + ], + [ + 208, + 209 + ], + [ + 213, + 215 + ], + [ + 216, + 217 + ], + [ + 220, + 223 + ], + [ + 227, + 228 + ], + [ + 232, + 235 + ], + [ + 236, + 237 + ], + [ + 241, + 242 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 253, + 254 + ], + [ + 260, + 262 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 269 + ], + [ + 270, + 273 + ], + [ + 279, + 281 + ], + [ + 283, + 284 + ], + [ + 285, + 286 + ], + [ + 288, + 291 + ], + [ + 292, + 294 + ], + [ + 303, + 304 + ], + [ + 308, + 309 + ], + [ + 310, + 312 + ], + [ + 314, + 316 + ], + [ + 318, + 319 + ], + [ + 322, + 323 + ], + [ + 326, + 327 + ], + [ + 329, + 330 + ], + [ + 331, + 333 + ], + [ + 335, + 337 + ], + [ + 343, + 344 + ], + [ + 348, + 349 + ], + [ + 350, + 353 + ], + [ + 355, + 357 + ], + [ + 359, + 360 + ], + [ + 363, + 364 + ], + [ + 367, + 368 + ], + [ + 372, + 373 + ], + [ + 374, + 375 + ], + [ + 376, + 378 + ], + [ + 380, + 381 + ], + [ + 384, + 385 + ], + [ + 388, + 389 + ], + [ + 397, + 399 + ], + [ + 403, + 405 + ], + [ + 406, + 407 + ], + [ + 408, + 410 + ], + [ + 411, + 412 + ], + [ + 414, + 416 + ], + [ + 417, + 418 + ], + [ + 421, + 422 + ], + [ + 428, + 431 + ], + [ + 433, + 434 + ], + [ + 435, + 436 + ], + [ + 437, + 438 + ], + [ + 440, + 441 + ], + [ + 446, + 447 + ], + [ + 450, + 451 + ], + [ + 454, + 457 + ], + [ + 458, + 471 + ], + [ + 474, + 475 + ], + [ + 479, + 481 + ], + [ + 485, + 486 + ], + [ + 488, + 490 + ], + [ + 494, + 495 + ], + [ + 497, + 499 + ], + [ + 503, + 505 + ], + [ + 507, + 509 + ], + [ + 512, + 515 + ], + [ + 518, + 519 + ], + [ + 522, + 523 + ], + [ + 526, + 527 + ], + [ + 529, + 530 + ], + [ + 533, + 535 + ], + [ + 541, + 542 + ], + [ + 552, + 553 + ], + [ + 554, + 555 + ], + [ + 567, + 569 + ], + [ + 571, + 572 + ], + [ + 574, + 575 + ], + [ + 576, + 577 + ], + [ + 578, + 579 + ], + [ + 581, + 584 + ], + [ + 585, + 586 + ], + [ + 595, + 596 + ], + [ + 604, + 605 + ], + [ + 606, + 607 + ], + [ + 609, + 610 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 13, + 20 + ], + [ + 31, + 59 + ], + [ + 110, + 117 + ], + [ + 120, + 173 + ], + [ + 174, + 182 + ], + [ + 184, + 202 + ], + [ + 203, + 230 + ], + [ + 231, + 246 + ], + [ + 247, + 293 + ], + [ + 294, + 419 + ], + [ + 421, + 545 + ], + [ + 548, + 580 + ], + [ + 598, + 640 + ], + [ + 642, + 869 + ], + [ + 870, + 955 + ], + [ + 957, + 1019 + ], + [ + 1026, + 1059 + ], + [ + 1062, + 1099 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 16, + 17 + ], + [ + 34, + 40 + ], + [ + 41, + 45 + ], + [ + 46, + 50 + ], + [ + 55, + 56 + ], + [ + 113, + 114 + ], + [ + 123, + 124 + ], + [ + 126, + 127 + ], + [ + 130, + 131 + ], + [ + 134, + 135 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 143, + 144 + ], + [ + 147, + 149 + ], + [ + 151, + 153 + ], + [ + 155, + 161 + ], + [ + 163, + 164 + ], + [ + 166, + 167 + ], + [ + 169, + 170 + ], + [ + 177, + 179 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 192, + 196 + ], + [ + 197, + 199 + ], + [ + 206, + 207 + ], + [ + 208, + 210 + ], + [ + 214, + 217 + ], + [ + 219, + 224 + ], + [ + 226, + 227 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 242, + 243 + ], + [ + 250, + 251 + ], + [ + 256, + 257 + ], + [ + 261, + 263 + ], + [ + 268, + 269 + ], + [ + 273, + 275 + ], + [ + 280, + 281 + ], + [ + 284, + 288 + ], + [ + 289, + 290 + ], + [ + 297, + 298 + ], + [ + 301, + 315 + ], + [ + 318, + 319 + ], + [ + 325, + 328 + ], + [ + 332, + 334 + ], + [ + 335, + 340 + ], + [ + 342, + 343 + ], + [ + 345, + 346 + ], + [ + 347, + 351 + ], + [ + 356, + 357 + ], + [ + 361, + 363 + ], + [ + 365, + 366 + ], + [ + 367, + 371 + ], + [ + 374, + 378 + ], + [ + 379, + 383 + ], + [ + 385, + 386 + ], + [ + 392, + 393 + ], + [ + 394, + 397 + ], + [ + 402, + 407 + ], + [ + 411, + 416 + ], + [ + 424, + 425 + ], + [ + 428, + 429 + ], + [ + 433, + 434 + ], + [ + 439, + 440 + ], + [ + 446, + 448 + ], + [ + 450, + 455 + ], + [ + 460, + 461 + ], + [ + 464, + 467 + ], + [ + 469, + 470 + ], + [ + 475, + 476 + ], + [ + 479, + 487 + ], + [ + 490, + 491 + ], + [ + 496, + 497 + ], + [ + 500, + 502 + ], + [ + 503, + 504 + ], + [ + 509, + 510 + ], + [ + 514, + 521 + ], + [ + 522, + 527 + ], + [ + 530, + 533 + ], + [ + 535, + 536 + ], + [ + 539, + 540 + ], + [ + 541, + 542 + ], + [ + 551, + 555 + ], + [ + 556, + 561 + ], + [ + 565, + 567 + ], + [ + 570, + 573 + ], + [ + 574, + 575 + ], + [ + 576, + 577 + ], + [ + 601, + 602 + ], + [ + 605, + 607 + ], + [ + 612, + 615 + ], + [ + 617, + 623 + ], + [ + 625, + 628 + ], + [ + 629, + 630 + ], + [ + 631, + 637 + ], + [ + 645, + 646 + ], + [ + 652, + 653 + ], + [ + 656, + 658 + ], + [ + 661, + 663 + ], + [ + 664, + 666 + ], + [ + 668, + 669 + ], + [ + 672, + 673 + ], + [ + 677, + 679 + ], + [ + 680, + 686 + ], + [ + 688, + 691 + ], + [ + 692, + 693 + ], + [ + 696, + 697 + ], + [ + 701, + 702 + ], + [ + 704, + 710 + ], + [ + 712, + 713 + ], + [ + 716, + 723 + ], + [ + 729, + 730 + ], + [ + 734, + 735 + ], + [ + 737, + 738 + ], + [ + 743, + 745 + ], + [ + 749, + 751 + ], + [ + 752, + 753 + ], + [ + 755, + 756 + ], + [ + 757, + 758 + ], + [ + 759, + 762 + ], + [ + 763, + 768 + ], + [ + 770, + 772 + ], + [ + 773, + 774 + ], + [ + 777, + 778 + ], + [ + 782, + 788 + ], + [ + 790, + 795 + ], + [ + 797, + 799 + ], + [ + 801, + 802 + ], + [ + 807, + 808 + ], + [ + 812, + 814 + ], + [ + 815, + 818 + ], + [ + 822, + 823 + ], + [ + 824, + 825 + ], + [ + 828, + 830 + ], + [ + 831, + 833 + ], + [ + 835, + 840 + ], + [ + 843, + 844 + ], + [ + 845, + 854 + ], + [ + 856, + 857 + ], + [ + 859, + 860 + ], + [ + 865, + 866 + ], + [ + 873, + 886 + ], + [ + 888, + 890 + ], + [ + 891, + 895 + ], + [ + 897, + 899 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 904, + 905 + ], + [ + 908, + 910 + ], + [ + 912, + 913 + ], + [ + 916, + 918 + ], + [ + 919, + 921 + ], + [ + 923, + 928 + ], + [ + 929, + 942 + ], + [ + 944, + 945 + ], + [ + 951, + 952 + ], + [ + 960, + 973 + ], + [ + 975, + 977 + ], + [ + 978, + 979 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 987, + 989 + ], + [ + 992, + 994 + ], + [ + 995, + 997 + ], + [ + 998, + 1002 + ], + [ + 1004, + 1005 + ], + [ + 1007, + 1008 + ], + [ + 1009, + 1010 + ], + [ + 1015, + 1016 + ], + [ + 1029, + 1033 + ], + [ + 1035, + 1043 + ], + [ + 1047, + 1048 + ], + [ + 1049, + 1052 + ], + [ + 1053, + 1056 + ], + [ + 1065, + 1068 + ], + [ + 1071, + 1072 + ], + [ + 1074, + 1076 + ], + [ + 1077, + 1079 + ], + [ + 1083, + 1086 + ], + [ + 1090, + 1091 + ], + [ + 1092, + 1095 + ], + [ + 1097, + 1098 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/window.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 8, + 36 + ], + [ + 84, + 103 + ], + [ + 104, + 217 + ], + [ + 218, + 229 + ], + [ + 230, + 249 + ], + [ + 256, + 282 + ], + [ + 284, + 304 + ], + [ + 308, + 423 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 27 + ], + [ + 32, + 33 + ], + [ + 87, + 88 + ], + [ + 91, + 94 + ], + [ + 96, + 97 + ], + [ + 98, + 100 + ], + [ + 107, + 108 + ], + [ + 111, + 112 + ], + [ + 115, + 116 + ], + [ + 118, + 122 + ], + [ + 124, + 126 + ], + [ + 127, + 129 + ], + [ + 132, + 133 + ], + [ + 134, + 135 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 145, + 147 + ], + [ + 149, + 150 + ], + [ + 153, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 175, + 179 + ], + [ + 182, + 183 + ], + [ + 187, + 188 + ], + [ + 191, + 192 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 203, + 204 + ], + [ + 207, + 208 + ], + [ + 213, + 214 + ], + [ + 221, + 222 + ], + [ + 223, + 226 + ], + [ + 233, + 238 + ], + [ + 240, + 242 + ], + [ + 243, + 246 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 268 + ], + [ + 273, + 274 + ], + [ + 277, + 279 + ], + [ + 287, + 288 + ], + [ + 289, + 292 + ], + [ + 296, + 298 + ], + [ + 300, + 301 + ], + [ + 311, + 312 + ], + [ + 313, + 316 + ], + [ + 317, + 318 + ], + [ + 323, + 324 + ], + [ + 330, + 332 + ], + [ + 333, + 334 + ], + [ + 337, + 340 + ], + [ + 343, + 344 + ], + [ + 346, + 347 + ], + [ + 349, + 350 + ], + [ + 355, + 356 + ], + [ + 357, + 359 + ], + [ + 360, + 361 + ], + [ + 364, + 369 + ], + [ + 370, + 371 + ], + [ + 373, + 374 + ], + [ + 375, + 376 + ], + [ + 381, + 382 + ], + [ + 386, + 388 + ], + [ + 389, + 390 + ], + [ + 392, + 393 + ], + [ + 395, + 397 + ], + [ + 399, + 401 + ], + [ + 402, + 405 + ], + [ + 407, + 408 + ], + [ + 409, + 410 + ], + [ + 413, + 414 + ], + [ + 415, + 422 + ] + ] + } + }, + { + "filename": "libvips/module/heif.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 52, + 86 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 68 + ], + [ + 70, + 73 + ], + [ + 76, + 80 + ], + [ + 82, + 83 + ] + ] + } + }, + { + "filename": "libvips/module/jxl.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 52, + 79 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 76 + ] + ] + } + }, + { + "filename": "libvips/module/magick.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 47, + 72 + ], + [ + 86, + 93 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 50, + 51 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 69 + ], + [ + 89, + 90 + ] + ] + } + }, + { + "filename": "libvips/module/openslide.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 52, + 71 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 63 + ], + [ + 67, + 68 + ] + ] + } + }, + { + "filename": "libvips/module/poppler.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 52, + 73 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 64 + ], + [ + 65, + 68 + ], + [ + 69, + 70 + ] + ] + } + }, + { + "filename": "libvips/morphology/countlines.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 16, + 44 + ], + [ + 69, + 158 + ], + [ + 174, + 189 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 7, + 8 + ], + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 35 + ], + [ + 40, + 41 + ], + [ + 72, + 73 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 84, + 86 + ], + [ + 91, + 92 + ], + [ + 93, + 96 + ], + [ + 97, + 101 + ], + [ + 104, + 107 + ], + [ + 108, + 112 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 126, + 128 + ], + [ + 129, + 130 + ], + [ + 135, + 136 + ], + [ + 138, + 141 + ], + [ + 142, + 144 + ], + [ + 145, + 148 + ], + [ + 149, + 151 + ], + [ + 154, + 155 + ], + [ + 177, + 179 + ], + [ + 183, + 186 + ], + [ + 187, + 188 + ] + ] + } + }, + { + "filename": "libvips/morphology/labelregions.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 49, + 98 + ], + [ + 100, + 142 + ], + [ + 169, + 183 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 52, + 53 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 64, + 65 + ], + [ + 71, + 73 + ], + [ + 77, + 78 + ], + [ + 79, + 84 + ], + [ + 87, + 90 + ], + [ + 92, + 95 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 111, + 112 + ], + [ + 113, + 115 + ], + [ + 120, + 121 + ], + [ + 123, + 126 + ], + [ + 127, + 128 + ], + [ + 129, + 132 + ], + [ + 133, + 135 + ], + [ + 138, + 139 + ], + [ + 172, + 173 + ], + [ + 177, + 180 + ], + [ + 181, + 182 + ] + ] + } + }, + { + "filename": "libvips/morphology/morph.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 15, + 28 + ], + [ + 30, + 58 + ], + [ + 77, + 102 + ], + [ + 111, + 145 + ], + [ + 146, + 203 + ], + [ + 210, + 262 + ], + [ + 267, + 389 + ], + [ + 390, + 412 + ], + [ + 415, + 426 + ], + [ + 432, + 462 + ], + [ + 463, + 472 + ], + [ + 475, + 494 + ], + [ + 496, + 506 + ], + [ + 508, + 523 + ], + [ + 526, + 537 + ], + [ + 543, + 573 + ], + [ + 574, + 583 + ], + [ + 586, + 605 + ], + [ + 606, + 615 + ], + [ + 616, + 638 + ], + [ + 643, + 700 + ], + [ + 701, + 756 + ], + [ + 757, + 781 + ], + [ + 782, + 804 + ], + [ + 806, + 838 + ], + [ + 846, + 853 + ], + [ + 855, + 877 + ], + [ + 878, + 894 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 18, + 19 + ], + [ + 24, + 25 + ], + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 49 + ], + [ + 54, + 55 + ], + [ + 80, + 81 + ], + [ + 83, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 93, + 94 + ], + [ + 98, + 99 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 120, + 121 + ], + [ + 126, + 127 + ], + [ + 132, + 133 + ], + [ + 134, + 138 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 149, + 150 + ], + [ + 153, + 155 + ], + [ + 159, + 160 + ], + [ + 164, + 167 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 177, + 178 + ], + [ + 181, + 184 + ], + [ + 185, + 186 + ], + [ + 191, + 192 + ], + [ + 198, + 200 + ], + [ + 213, + 214 + ], + [ + 217, + 219 + ], + [ + 220, + 224 + ], + [ + 228, + 238 + ], + [ + 241, + 242 + ], + [ + 244, + 249 + ], + [ + 251, + 252 + ], + [ + 258, + 259 + ], + [ + 270, + 271 + ], + [ + 274, + 276 + ], + [ + 277, + 279 + ], + [ + 281, + 283 + ], + [ + 284, + 287 + ], + [ + 288, + 289 + ], + [ + 291, + 292 + ], + [ + 293, + 295 + ], + [ + 297, + 298 + ], + [ + 303, + 304 + ], + [ + 308, + 309 + ], + [ + 312, + 315 + ], + [ + 317, + 318 + ], + [ + 322, + 326 + ], + [ + 328, + 329 + ], + [ + 331, + 332 + ], + [ + 333, + 335 + ], + [ + 337, + 338 + ], + [ + 340, + 341 + ], + [ + 346, + 347 + ], + [ + 348, + 350 + ], + [ + 352, + 354 + ], + [ + 356, + 357 + ], + [ + 362, + 363 + ], + [ + 368, + 369 + ], + [ + 373, + 375 + ], + [ + 377, + 378 + ], + [ + 379, + 380 + ], + [ + 384, + 386 + ], + [ + 393, + 395 + ], + [ + 397, + 398 + ], + [ + 401, + 402 + ], + [ + 407, + 409 + ], + [ + 418, + 419 + ], + [ + 421, + 423 + ], + [ + 435, + 437 + ], + [ + 439, + 441 + ], + [ + 446, + 448 + ], + [ + 451, + 454 + ], + [ + 456, + 459 + ], + [ + 466, + 469 + ], + [ + 478, + 481 + ], + [ + 484, + 485 + ], + [ + 488, + 491 + ], + [ + 499, + 503 + ], + [ + 511, + 513 + ], + [ + 518, + 520 + ], + [ + 529, + 530 + ], + [ + 532, + 534 + ], + [ + 546, + 548 + ], + [ + 550, + 552 + ], + [ + 557, + 559 + ], + [ + 562, + 565 + ], + [ + 567, + 570 + ], + [ + 577, + 580 + ], + [ + 589, + 592 + ], + [ + 595, + 596 + ], + [ + 599, + 602 + ], + [ + 609, + 612 + ], + [ + 619, + 621 + ], + [ + 626, + 628 + ], + [ + 633, + 635 + ], + [ + 646, + 648 + ], + [ + 650, + 652 + ], + [ + 654, + 657 + ], + [ + 658, + 659 + ], + [ + 660, + 662 + ], + [ + 667, + 670 + ], + [ + 672, + 678 + ], + [ + 679, + 680 + ], + [ + 683, + 684 + ], + [ + 685, + 686 + ], + [ + 687, + 688 + ], + [ + 691, + 692 + ], + [ + 693, + 694 + ], + [ + 696, + 697 + ], + [ + 704, + 706 + ], + [ + 711, + 713 + ], + [ + 715, + 717 + ], + [ + 720, + 727 + ], + [ + 730, + 732 + ], + [ + 736, + 738 + ], + [ + 740, + 743 + ], + [ + 744, + 746 + ], + [ + 747, + 753 + ], + [ + 760, + 762 + ], + [ + 765, + 767 + ], + [ + 768, + 769 + ], + [ + 771, + 772 + ], + [ + 774, + 778 + ], + [ + 785, + 788 + ], + [ + 792, + 793 + ], + [ + 794, + 795 + ], + [ + 798, + 799 + ], + [ + 800, + 801 + ], + [ + 809, + 810 + ], + [ + 812, + 831 + ], + [ + 834, + 835 + ], + [ + 849, + 850 + ], + [ + 858, + 859 + ], + [ + 860, + 863 + ], + [ + 864, + 865 + ], + [ + 868, + 870 + ], + [ + 872, + 874 + ], + [ + 881, + 884 + ], + [ + 888, + 891 + ], + [ + 892, + 893 + ] + ] + } + }, + { + "filename": "libvips/morphology/morphology.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 49, + 58 + ], + [ + 68, + 78 + ], + [ + 80, + 92 + ], + [ + 99, + 132 + ], + [ + 133, + 150 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 52, + 53 + ], + [ + 54, + 55 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 83, + 84 + ], + [ + 88, + 89 + ], + [ + 102, + 104 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 115, + 116 + ], + [ + 120, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 136, + 137 + ], + [ + 138, + 149 + ] + ] + } + }, + { + "filename": "libvips/morphology/nearest.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 78, + 105 + ], + [ + 107, + 191 + ], + [ + 192, + 254 + ], + [ + 260, + 333 + ], + [ + 341, + 348 + ], + [ + 355, + 369 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 89, + 92 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 102 + ], + [ + 110, + 112 + ], + [ + 117, + 118 + ], + [ + 122, + 123 + ], + [ + 125, + 126 + ], + [ + 127, + 130 + ], + [ + 131, + 136 + ], + [ + 142, + 143 + ], + [ + 147, + 149 + ], + [ + 150, + 151 + ], + [ + 153, + 154 + ], + [ + 156, + 158 + ], + [ + 161, + 163 + ], + [ + 166, + 168 + ], + [ + 169, + 170 + ], + [ + 172, + 175 + ], + [ + 176, + 179 + ], + [ + 181, + 183 + ], + [ + 187, + 188 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 203, + 206 + ], + [ + 207, + 209 + ], + [ + 210, + 211 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 220, + 221 + ], + [ + 225, + 227 + ], + [ + 228, + 230 + ], + [ + 233, + 236 + ], + [ + 238, + 242 + ], + [ + 244, + 245 + ], + [ + 247, + 251 + ], + [ + 263, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 280, + 283 + ], + [ + 286, + 289 + ], + [ + 290, + 292 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 303, + 305 + ], + [ + 311, + 313 + ], + [ + 315, + 318 + ], + [ + 319, + 320 + ], + [ + 321, + 324 + ], + [ + 325, + 326 + ], + [ + 329, + 330 + ], + [ + 344, + 345 + ], + [ + 358, + 359 + ], + [ + 363, + 366 + ], + [ + 367, + 368 + ] + ] + } + }, + { + "filename": "libvips/morphology/pmorphology.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 58, + 64 + ], + [ + 65, + 75 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 68, + 69 + ] + ] + } + }, + { + "filename": "libvips/morphology/rank.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 20 + ], + [ + 32, + 60 + ], + [ + 81, + 88 + ], + [ + 89, + 96 + ], + [ + 106, + 204 + ], + [ + 205, + 235 + ], + [ + 243, + 439 + ], + [ + 447, + 596 + ], + [ + 606, + 644 + ], + [ + 656, + 671 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 9, + 10 + ], + [ + 16, + 17 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 84, + 85 + ], + [ + 92, + 93 + ], + [ + 109, + 110 + ], + [ + 114, + 116 + ], + [ + 117, + 119 + ], + [ + 121, + 123 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 130, + 131 + ], + [ + 136, + 138 + ], + [ + 142, + 147 + ], + [ + 149, + 150 + ], + [ + 152, + 156 + ], + [ + 158, + 163 + ], + [ + 166, + 167 + ], + [ + 172, + 174 + ], + [ + 176, + 178 + ], + [ + 182, + 186 + ], + [ + 187, + 188 + ], + [ + 191, + 192 + ], + [ + 195, + 197 + ], + [ + 198, + 201 + ], + [ + 208, + 210 + ], + [ + 213, + 214 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 226, + 228 + ], + [ + 231, + 232 + ], + [ + 246, + 262 + ], + [ + 263, + 287 + ], + [ + 288, + 328 + ], + [ + 330, + 332 + ], + [ + 333, + 334 + ], + [ + 337, + 358 + ], + [ + 359, + 361 + ], + [ + 362, + 363 + ], + [ + 366, + 387 + ], + [ + 388, + 390 + ], + [ + 391, + 392 + ], + [ + 393, + 420 + ], + [ + 422, + 423 + ], + [ + 425, + 427 + ], + [ + 428, + 429 + ], + [ + 434, + 436 + ], + [ + 450, + 466 + ], + [ + 469, + 470 + ], + [ + 471, + 473 + ], + [ + 474, + 475 + ], + [ + 478, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 485 + ], + [ + 487, + 493 + ], + [ + 495, + 498 + ], + [ + 502, + 504 + ], + [ + 506, + 507 + ], + [ + 508, + 509 + ], + [ + 510, + 511 + ], + [ + 514, + 515 + ], + [ + 516, + 522 + ], + [ + 524, + 525 + ], + [ + 529, + 532 + ], + [ + 535, + 541 + ], + [ + 545, + 546 + ], + [ + 547, + 548 + ], + [ + 551, + 552 + ], + [ + 553, + 554 + ], + [ + 560, + 561 + ], + [ + 563, + 568 + ], + [ + 569, + 572 + ], + [ + 573, + 575 + ], + [ + 576, + 579 + ], + [ + 580, + 582 + ], + [ + 583, + 586 + ], + [ + 587, + 589 + ], + [ + 592, + 593 + ], + [ + 609, + 611 + ], + [ + 613, + 616 + ], + [ + 622, + 623 + ], + [ + 629, + 632 + ], + [ + 636, + 639 + ], + [ + 640, + 641 + ], + [ + 659, + 660 + ], + [ + 664, + 668 + ], + [ + 669, + 670 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/chkpair.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 21, + 49 + ], + [ + 67, + 79 + ], + [ + 84, + 109 + ], + [ + 114, + 121 + ], + [ + 124, + 142 + ], + [ + 143, + 189 + ], + [ + 193, + 220 + ], + [ + 223, + 234 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 24, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 40 + ], + [ + 45, + 46 + ], + [ + 70, + 71 + ], + [ + 75, + 76 + ], + [ + 87, + 88 + ], + [ + 92, + 94 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 105, + 106 + ], + [ + 117, + 118 + ], + [ + 127, + 128 + ], + [ + 131, + 139 + ], + [ + 146, + 150 + ], + [ + 153, + 157 + ], + [ + 163, + 166 + ], + [ + 170, + 173 + ], + [ + 174, + 175 + ], + [ + 181, + 182 + ], + [ + 184, + 186 + ], + [ + 196, + 202 + ], + [ + 203, + 206 + ], + [ + 208, + 209 + ], + [ + 211, + 217 + ], + [ + 226, + 227 + ], + [ + 228, + 229 + ], + [ + 232, + 233 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/global_balance.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 8 + ], + [ + 64, + 92 + ], + [ + 134, + 237 + ], + [ + 238, + 250 + ], + [ + 255, + 317 + ], + [ + 320, + 426 + ], + [ + 431, + 501 + ], + [ + 519, + 532 + ], + [ + 537, + 561 + ], + [ + 565, + 593 + ], + [ + 598, + 633 + ], + [ + 640, + 812 + ], + [ + 813, + 878 + ], + [ + 880, + 924 + ], + [ + 925, + 946 + ], + [ + 947, + 966 + ], + [ + 967, + 994 + ], + [ + 995, + 1122 + ], + [ + 1135, + 1228 + ], + [ + 1229, + 1316 + ], + [ + 1321, + 1388 + ], + [ + 1389, + 1463 + ], + [ + 1464, + 1514 + ], + [ + 1516, + 1547 + ], + [ + 1552, + 1568 + ], + [ + 1569, + 1863 + ], + [ + 1872, + 1948 + ], + [ + 1951, + 1964 + ], + [ + 1971, + 1981 + ], + [ + 1985, + 2000 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 67, + 73 + ], + [ + 74, + 78 + ], + [ + 79, + 83 + ], + [ + 88, + 89 + ], + [ + 137, + 138 + ], + [ + 142, + 143 + ], + [ + 145, + 146 + ], + [ + 150, + 153 + ], + [ + 159, + 162 + ], + [ + 164, + 165 + ], + [ + 170, + 171 + ], + [ + 175, + 176 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 182, + 185 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 198, + 199 + ], + [ + 204, + 205 + ], + [ + 208, + 209 + ], + [ + 210, + 211 + ], + [ + 213, + 214 + ], + [ + 219, + 220 + ], + [ + 221, + 223 + ], + [ + 226, + 228 + ], + [ + 233, + 234 + ], + [ + 241, + 243 + ], + [ + 246, + 247 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 266, + 267 + ], + [ + 268, + 269 + ], + [ + 270, + 272 + ], + [ + 278, + 279 + ], + [ + 281, + 282 + ], + [ + 285, + 286 + ], + [ + 289, + 291 + ], + [ + 295, + 297 + ], + [ + 299, + 301 + ], + [ + 306, + 307 + ], + [ + 308, + 309 + ], + [ + 311, + 314 + ], + [ + 323, + 325 + ], + [ + 326, + 327 + ], + [ + 329, + 330 + ], + [ + 335, + 336 + ], + [ + 337, + 339 + ], + [ + 340, + 341 + ], + [ + 346, + 347 + ], + [ + 348, + 350 + ], + [ + 356, + 357 + ], + [ + 360, + 363 + ], + [ + 364, + 365 + ], + [ + 367, + 368 + ], + [ + 370, + 371 + ], + [ + 374, + 380 + ], + [ + 385, + 387 + ], + [ + 389, + 390 + ], + [ + 395, + 396 + ], + [ + 397, + 399 + ], + [ + 401, + 402 + ], + [ + 405, + 406 + ], + [ + 409, + 410 + ], + [ + 416, + 418 + ], + [ + 422, + 423 + ], + [ + 434, + 435 + ], + [ + 439, + 440 + ], + [ + 444, + 445 + ], + [ + 451, + 452 + ], + [ + 455, + 456 + ], + [ + 457, + 459 + ], + [ + 460, + 464 + ], + [ + 469, + 472 + ], + [ + 475, + 477 + ], + [ + 478, + 479 + ], + [ + 482, + 483 + ], + [ + 486, + 489 + ], + [ + 494, + 498 + ], + [ + 522, + 525 + ], + [ + 528, + 529 + ], + [ + 540, + 543 + ], + [ + 544, + 545 + ], + [ + 550, + 551 + ], + [ + 554, + 558 + ], + [ + 568, + 569 + ], + [ + 570, + 571 + ], + [ + 576, + 577 + ], + [ + 581, + 582 + ], + [ + 586, + 587 + ], + [ + 588, + 590 + ], + [ + 601, + 607 + ], + [ + 609, + 617 + ], + [ + 619, + 620 + ], + [ + 624, + 627 + ], + [ + 628, + 630 + ], + [ + 643, + 649 + ], + [ + 651, + 661 + ], + [ + 663, + 664 + ], + [ + 668, + 671 + ], + [ + 672, + 673 + ], + [ + 679, + 685 + ], + [ + 687, + 691 + ], + [ + 693, + 694 + ], + [ + 699, + 700 + ], + [ + 701, + 702 + ], + [ + 703, + 704 + ], + [ + 705, + 707 + ], + [ + 712, + 713 + ], + [ + 714, + 716 + ], + [ + 717, + 718 + ], + [ + 723, + 724 + ], + [ + 729, + 731 + ], + [ + 734, + 736 + ], + [ + 739, + 744 + ], + [ + 750, + 754 + ], + [ + 756, + 757 + ], + [ + 762, + 763 + ], + [ + 766, + 767 + ], + [ + 769, + 770 + ], + [ + 771, + 773 + ], + [ + 777, + 779 + ], + [ + 780, + 781 + ], + [ + 786, + 787 + ], + [ + 788, + 789 + ], + [ + 793, + 794 + ], + [ + 800, + 801 + ], + [ + 802, + 804 + ], + [ + 807, + 809 + ], + [ + 816, + 817 + ], + [ + 818, + 820 + ], + [ + 821, + 822 + ], + [ + 828, + 829 + ], + [ + 830, + 831 + ], + [ + 833, + 834 + ], + [ + 836, + 837 + ], + [ + 843, + 844 + ], + [ + 847, + 849 + ], + [ + 854, + 855 + ], + [ + 856, + 869 + ], + [ + 871, + 872 + ], + [ + 874, + 875 + ], + [ + 883, + 884 + ], + [ + 885, + 886 + ], + [ + 887, + 888 + ], + [ + 892, + 895 + ], + [ + 897, + 904 + ], + [ + 907, + 910 + ], + [ + 913, + 915 + ], + [ + 918, + 919 + ], + [ + 920, + 921 + ], + [ + 928, + 929 + ], + [ + 930, + 934 + ], + [ + 936, + 938 + ], + [ + 939, + 943 + ], + [ + 950, + 951 + ], + [ + 953, + 960 + ], + [ + 962, + 963 + ], + [ + 970, + 971 + ], + [ + 972, + 975 + ], + [ + 977, + 978 + ], + [ + 984, + 986 + ], + [ + 988, + 991 + ], + [ + 998, + 999 + ], + [ + 1001, + 1009 + ], + [ + 1011, + 1012 + ], + [ + 1018, + 1019 + ], + [ + 1020, + 1022 + ], + [ + 1028, + 1031 + ], + [ + 1032, + 1045 + ], + [ + 1050, + 1051 + ], + [ + 1054, + 1057 + ], + [ + 1058, + 1059 + ], + [ + 1065, + 1067 + ], + [ + 1068, + 1070 + ], + [ + 1075, + 1082 + ], + [ + 1085, + 1087 + ], + [ + 1090, + 1092 + ], + [ + 1095, + 1097 + ], + [ + 1101, + 1102 + ], + [ + 1104, + 1106 + ], + [ + 1108, + 1109 + ], + [ + 1114, + 1115 + ], + [ + 1117, + 1119 + ], + [ + 1138, + 1141 + ], + [ + 1144, + 1152 + ], + [ + 1157, + 1158 + ], + [ + 1159, + 1161 + ], + [ + 1162, + 1163 + ], + [ + 1168, + 1169 + ], + [ + 1175, + 1177 + ], + [ + 1180, + 1184 + ], + [ + 1187, + 1188 + ], + [ + 1190, + 1191 + ], + [ + 1192, + 1193 + ], + [ + 1195, + 1198 + ], + [ + 1201, + 1203 + ], + [ + 1204, + 1205 + ], + [ + 1207, + 1209 + ], + [ + 1213, + 1215 + ], + [ + 1216, + 1220 + ], + [ + 1221, + 1222 + ], + [ + 1224, + 1225 + ], + [ + 1232, + 1233 + ], + [ + 1234, + 1235 + ], + [ + 1237, + 1241 + ], + [ + 1242, + 1244 + ], + [ + 1245, + 1247 + ], + [ + 1248, + 1250 + ], + [ + 1255, + 1260 + ], + [ + 1265, + 1266 + ], + [ + 1267, + 1269 + ], + [ + 1270, + 1272 + ], + [ + 1275, + 1276 + ], + [ + 1281, + 1282 + ], + [ + 1283, + 1285 + ], + [ + 1286, + 1288 + ], + [ + 1291, + 1292 + ], + [ + 1297, + 1298 + ], + [ + 1299, + 1302 + ], + [ + 1303, + 1307 + ], + [ + 1312, + 1313 + ], + [ + 1324, + 1325 + ], + [ + 1330, + 1331 + ], + [ + 1332, + 1336 + ], + [ + 1341, + 1342 + ], + [ + 1345, + 1346 + ], + [ + 1348, + 1360 + ], + [ + 1365, + 1368 + ], + [ + 1370, + 1371 + ], + [ + 1372, + 1373 + ], + [ + 1374, + 1379 + ], + [ + 1381, + 1385 + ], + [ + 1392, + 1394 + ], + [ + 1400, + 1401 + ], + [ + 1405, + 1406 + ], + [ + 1407, + 1408 + ], + [ + 1410, + 1411 + ], + [ + 1413, + 1414 + ], + [ + 1416, + 1417 + ], + [ + 1422, + 1423 + ], + [ + 1425, + 1438 + ], + [ + 1439, + 1440 + ], + [ + 1445, + 1454 + ], + [ + 1456, + 1460 + ], + [ + 1467, + 1470 + ], + [ + 1476, + 1479 + ], + [ + 1483, + 1484 + ], + [ + 1487, + 1488 + ], + [ + 1491, + 1492 + ], + [ + 1497, + 1499 + ], + [ + 1502, + 1505 + ], + [ + 1506, + 1507 + ], + [ + 1510, + 1511 + ], + [ + 1519, + 1522 + ], + [ + 1526, + 1528 + ], + [ + 1531, + 1533 + ], + [ + 1534, + 1536 + ], + [ + 1537, + 1538 + ], + [ + 1543, + 1544 + ], + [ + 1555, + 1556 + ], + [ + 1561, + 1562 + ], + [ + 1563, + 1565 + ], + [ + 1572, + 1575 + ], + [ + 1576, + 1577 + ], + [ + 1579, + 1581 + ], + [ + 1585, + 1591 + ], + [ + 1594, + 1598 + ], + [ + 1603, + 1604 + ], + [ + 1606, + 1607 + ], + [ + 1612, + 1615 + ], + [ + 1616, + 1620 + ], + [ + 1622, + 1626 + ], + [ + 1628, + 1629 + ], + [ + 1634, + 1635 + ], + [ + 1637, + 1638 + ], + [ + 1641, + 1642 + ], + [ + 1643, + 1644 + ], + [ + 1650, + 1658 + ], + [ + 1659, + 1660 + ], + [ + 1662, + 1666 + ], + [ + 1669, + 1671 + ], + [ + 1672, + 1673 + ], + [ + 1678, + 1679 + ], + [ + 1680, + 1681 + ], + [ + 1683, + 1687 + ], + [ + 1688, + 1690 + ], + [ + 1694, + 1695 + ], + [ + 1698, + 1699 + ], + [ + 1700, + 1702 + ], + [ + 1705, + 1706 + ], + [ + 1711, + 1712 + ], + [ + 1715, + 1717 + ], + [ + 1718, + 1720 + ], + [ + 1721, + 1727 + ], + [ + 1731, + 1734 + ], + [ + 1737, + 1739 + ], + [ + 1740, + 1741 + ], + [ + 1742, + 1744 + ], + [ + 1748, + 1750 + ], + [ + 1754, + 1760 + ], + [ + 1762, + 1763 + ], + [ + 1769, + 1770 + ], + [ + 1775, + 1776 + ], + [ + 1779, + 1780 + ], + [ + 1784, + 1785 + ], + [ + 1786, + 1789 + ], + [ + 1792, + 1800 + ], + [ + 1805, + 1808 + ], + [ + 1811, + 1812 + ], + [ + 1813, + 1814 + ], + [ + 1819, + 1820 + ], + [ + 1824, + 1826 + ], + [ + 1829, + 1830 + ], + [ + 1834, + 1837 + ], + [ + 1840, + 1847 + ], + [ + 1852, + 1854 + ], + [ + 1857, + 1858 + ], + [ + 1859, + 1860 + ], + [ + 1875, + 1876 + ], + [ + 1878, + 1879 + ], + [ + 1885, + 1886 + ], + [ + 1887, + 1889 + ], + [ + 1890, + 1894 + ], + [ + 1895, + 1899 + ], + [ + 1900, + 1901 + ], + [ + 1904, + 1905 + ], + [ + 1906, + 1907 + ], + [ + 1913, + 1914 + ], + [ + 1916, + 1931 + ], + [ + 1932, + 1934 + ], + [ + 1935, + 1938 + ], + [ + 1939, + 1941 + ], + [ + 1944, + 1945 + ], + [ + 1954, + 1955 + ], + [ + 1960, + 1961 + ], + [ + 1974, + 1976 + ], + [ + 1977, + 1978 + ], + [ + 1988, + 1990 + ], + [ + 1994, + 1997 + ], + [ + 1998, + 1999 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/global_balance.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 42, + 85 + ], + [ + 88, + 104 + ], + [ + 106, + 128 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 45, + 46 + ], + [ + 50, + 56 + ], + [ + 62, + 67 + ], + [ + 72, + 76 + ], + [ + 81, + 82 + ], + [ + 91, + 94 + ], + [ + 100, + 101 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 113, + 116 + ], + [ + 117, + 120 + ], + [ + 122, + 128 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_avgdxdy.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 13 + ], + [ + 18, + 46 + ], + [ + 55, + 83 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 21, + 27 + ], + [ + 28, + 32 + ], + [ + 33, + 37 + ], + [ + 42, + 43 + ], + [ + 58, + 60 + ], + [ + 64, + 67 + ], + [ + 73, + 74 + ], + [ + 78, + 80 + ], + [ + 81, + 82 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_clinear.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 16 + ], + [ + 25, + 53 + ], + [ + 63, + 71 + ], + [ + 87, + 101 + ], + [ + 107, + 173 + ], + [ + 175, + 180 + ] + ], + "lines_added": [ + [ + 12, + 13 + ], + [ + 28, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 44 + ], + [ + 49, + 50 + ], + [ + 66, + 68 + ], + [ + 90, + 95 + ], + [ + 97, + 98 + ], + [ + 110, + 114 + ], + [ + 115, + 119 + ], + [ + 120, + 124 + ], + [ + 125, + 129 + ], + [ + 135, + 140 + ], + [ + 142, + 146 + ], + [ + 147, + 152 + ], + [ + 154, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 164 + ], + [ + 166, + 167 + ], + [ + 169, + 170 + ], + [ + 178, + 179 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_improve.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 16 + ], + [ + 21, + 49 + ], + [ + 60, + 67 + ], + [ + 73, + 80 + ], + [ + 94, + 126 + ], + [ + 133, + 140 + ], + [ + 147, + 161 + ], + [ + 163, + 189 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 7, + 8 + ], + [ + 12, + 13 + ], + [ + 24, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 40 + ], + [ + 45, + 46 + ], + [ + 63, + 64 + ], + [ + 76, + 77 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 108, + 114 + ], + [ + 117, + 118 + ], + [ + 120, + 123 + ], + [ + 136, + 137 + ], + [ + 150, + 152 + ], + [ + 153, + 154 + ], + [ + 156, + 158 + ], + [ + 166, + 168 + ], + [ + 170, + 171 + ], + [ + 175, + 177 + ], + [ + 180, + 181 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_initialize.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 28 + ], + [ + 37, + 47 + ], + [ + 59, + 97 + ], + [ + 98, + 103 + ] + ], + "lines_added": [ + [ + 3, + 19 + ], + [ + 24, + 25 + ], + [ + 40, + 42 + ], + [ + 43, + 44 + ], + [ + 62, + 64 + ], + [ + 70, + 72 + ], + [ + 77, + 80 + ], + [ + 84, + 85 + ], + [ + 89, + 90 + ], + [ + 92, + 94 + ], + [ + 101, + 102 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_lrcalcon.c", + "line_filter": { + "diff_chunks": [ + [ + 24, + 33 + ], + [ + 44, + 51 + ], + [ + 53, + 81 + ], + [ + 102, + 109 + ], + [ + 114, + 140 + ], + [ + 144, + 188 + ], + [ + 201, + 237 + ], + [ + 240, + 272 + ], + [ + 284, + 295 + ], + [ + 298, + 319 + ] + ], + "lines_added": [ + [ + 27, + 28 + ], + [ + 29, + 30 + ], + [ + 47, + 48 + ], + [ + 56, + 57 + ], + [ + 58, + 62 + ], + [ + 63, + 72 + ], + [ + 77, + 78 + ], + [ + 105, + 106 + ], + [ + 117, + 121 + ], + [ + 123, + 124 + ], + [ + 128, + 129 + ], + [ + 133, + 134 + ], + [ + 135, + 137 + ], + [ + 147, + 149 + ], + [ + 151, + 152 + ], + [ + 155, + 156 + ], + [ + 162, + 163 + ], + [ + 168, + 169 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 178, + 180 + ], + [ + 181, + 183 + ], + [ + 184, + 185 + ], + [ + 204, + 208 + ], + [ + 211, + 212 + ], + [ + 213, + 215 + ], + [ + 218, + 220 + ], + [ + 225, + 226 + ], + [ + 232, + 234 + ], + [ + 243, + 249 + ], + [ + 253, + 254 + ], + [ + 257, + 258 + ], + [ + 262, + 263 + ], + [ + 264, + 265 + ], + [ + 267, + 269 + ], + [ + 287, + 292 + ], + [ + 301, + 302 + ], + [ + 307, + 318 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_tbcalcon.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 28 + ], + [ + 41, + 69 + ], + [ + 79, + 87 + ], + [ + 99, + 110 + ], + [ + 112, + 137 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 24, + 25 + ], + [ + 44, + 50 + ], + [ + 51, + 55 + ], + [ + 56, + 60 + ], + [ + 65, + 66 + ], + [ + 82, + 84 + ], + [ + 102, + 107 + ], + [ + 115, + 116 + ], + [ + 118, + 121 + ], + [ + 125, + 136 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/lrmerge.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 89, + 117 + ], + [ + 143, + 327 + ], + [ + 332, + 357 + ], + [ + 372, + 412 + ], + [ + 415, + 423 + ], + [ + 425, + 587 + ], + [ + 591, + 599 + ], + [ + 608, + 677 + ], + [ + 680, + 688 + ], + [ + 697, + 714 + ], + [ + 720, + 794 + ], + [ + 798, + 827 + ], + [ + 837, + 881 + ], + [ + 884, + 892 + ], + [ + 899, + 927 + ], + [ + 931, + 957 + ], + [ + 961, + 1025 + ], + [ + 1030, + 1072 + ], + [ + 1073, + 1191 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 92, + 93 + ], + [ + 94, + 98 + ], + [ + 99, + 108 + ], + [ + 113, + 114 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 156, + 158 + ], + [ + 161, + 169 + ], + [ + 171, + 172 + ], + [ + 177, + 178 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 192, + 193 + ], + [ + 197, + 205 + ], + [ + 206, + 237 + ], + [ + 239, + 241 + ], + [ + 247, + 248 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 262, + 263 + ], + [ + 267, + 275 + ], + [ + 276, + 307 + ], + [ + 309, + 311 + ], + [ + 317, + 318 + ], + [ + 323, + 324 + ], + [ + 335, + 336 + ], + [ + 340, + 341 + ], + [ + 344, + 345 + ], + [ + 349, + 350 + ], + [ + 352, + 354 + ], + [ + 375, + 380 + ], + [ + 384, + 388 + ], + [ + 392, + 394 + ], + [ + 400, + 401 + ], + [ + 403, + 409 + ], + [ + 418, + 420 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 435, + 446 + ], + [ + 449, + 473 + ], + [ + 474, + 513 + ], + [ + 516, + 540 + ], + [ + 541, + 579 + ], + [ + 583, + 584 + ], + [ + 594, + 596 + ], + [ + 611, + 614 + ], + [ + 617, + 622 + ], + [ + 628, + 653 + ], + [ + 654, + 656 + ], + [ + 657, + 659 + ], + [ + 662, + 663 + ], + [ + 666, + 667 + ], + [ + 672, + 674 + ], + [ + 683, + 685 + ], + [ + 700, + 703 + ], + [ + 706, + 711 + ], + [ + 723, + 725 + ], + [ + 728, + 729 + ], + [ + 732, + 733 + ], + [ + 735, + 736 + ], + [ + 739, + 740 + ], + [ + 741, + 742 + ], + [ + 748, + 751 + ], + [ + 753, + 754 + ], + [ + 756, + 757 + ], + [ + 763, + 769 + ], + [ + 772, + 787 + ], + [ + 789, + 791 + ], + [ + 801, + 805 + ], + [ + 806, + 807 + ], + [ + 808, + 812 + ], + [ + 813, + 814 + ], + [ + 815, + 819 + ], + [ + 823, + 824 + ], + [ + 840, + 841 + ], + [ + 844, + 845 + ], + [ + 848, + 853 + ], + [ + 857, + 859 + ], + [ + 860, + 861 + ], + [ + 866, + 868 + ], + [ + 869, + 870 + ], + [ + 871, + 874 + ], + [ + 877, + 878 + ], + [ + 887, + 889 + ], + [ + 902, + 907 + ], + [ + 913, + 914 + ], + [ + 916, + 918 + ], + [ + 923, + 924 + ], + [ + 934, + 936 + ], + [ + 939, + 941 + ], + [ + 942, + 943 + ], + [ + 945, + 947 + ], + [ + 952, + 954 + ], + [ + 964, + 966 + ], + [ + 967, + 968 + ], + [ + 974, + 976 + ], + [ + 979, + 980 + ], + [ + 982, + 983 + ], + [ + 984, + 986 + ], + [ + 987, + 988 + ], + [ + 990, + 993 + ], + [ + 994, + 997 + ], + [ + 999, + 1003 + ], + [ + 1009, + 1022 + ], + [ + 1033, + 1036 + ], + [ + 1038, + 1039 + ], + [ + 1045, + 1046 + ], + [ + 1049, + 1055 + ], + [ + 1056, + 1057 + ], + [ + 1062, + 1063 + ], + [ + 1067, + 1069 + ], + [ + 1076, + 1077 + ], + [ + 1079, + 1086 + ], + [ + 1089, + 1091 + ], + [ + 1092, + 1095 + ], + [ + 1097, + 1098 + ], + [ + 1101, + 1103 + ], + [ + 1107, + 1112 + ], + [ + 1114, + 1115 + ], + [ + 1118, + 1119 + ], + [ + 1123, + 1130 + ], + [ + 1131, + 1132 + ], + [ + 1136, + 1137 + ], + [ + 1139, + 1141 + ], + [ + 1142, + 1145 + ], + [ + 1151, + 1155 + ], + [ + 1156, + 1157 + ], + [ + 1160, + 1161 + ], + [ + 1164, + 1167 + ], + [ + 1168, + 1169 + ], + [ + 1171, + 1172 + ], + [ + 1175, + 1176 + ], + [ + 1181, + 1182 + ], + [ + 1188, + 1190 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/lrmosaic.c", + "line_filter": { + "diff_chunks": [ + [ + 31, + 59 + ], + [ + 75, + 89 + ], + [ + 91, + 114 + ], + [ + 117, + 127 + ], + [ + 136, + 179 + ], + [ + 181, + 193 + ], + [ + 198, + 231 + ], + [ + 238, + 253 + ], + [ + 257, + 285 + ] + ], + "lines_added": [ + [ + 34, + 50 + ], + [ + 55, + 56 + ], + [ + 78, + 79 + ], + [ + 85, + 86 + ], + [ + 94, + 98 + ], + [ + 101, + 105 + ], + [ + 107, + 108 + ], + [ + 110, + 111 + ], + [ + 120, + 124 + ], + [ + 139, + 145 + ], + [ + 149, + 162 + ], + [ + 163, + 169 + ], + [ + 171, + 173 + ], + [ + 175, + 176 + ], + [ + 184, + 185 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 201, + 202 + ], + [ + 203, + 206 + ], + [ + 209, + 212 + ], + [ + 215, + 217 + ], + [ + 218, + 219 + ], + [ + 220, + 223 + ], + [ + 226, + 228 + ], + [ + 241, + 242 + ], + [ + 244, + 248 + ], + [ + 249, + 250 + ], + [ + 260, + 268 + ], + [ + 269, + 270 + ], + [ + 273, + 280 + ], + [ + 281, + 282 + ], + [ + 283, + 284 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/match.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 44, + 86 + ], + [ + 105, + 115 + ], + [ + 116, + 147 + ], + [ + 148, + 302 + ], + [ + 316, + 352 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 47, + 51 + ], + [ + 52, + 61 + ], + [ + 63, + 67 + ], + [ + 69, + 77 + ], + [ + 78, + 81 + ], + [ + 82, + 83 + ], + [ + 108, + 109 + ], + [ + 111, + 112 + ], + [ + 119, + 120 + ], + [ + 121, + 123 + ], + [ + 124, + 126 + ], + [ + 127, + 128 + ], + [ + 131, + 136 + ], + [ + 139, + 144 + ], + [ + 151, + 155 + ], + [ + 158, + 170 + ], + [ + 171, + 172 + ], + [ + 173, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 192, + 193 + ], + [ + 195, + 204 + ], + [ + 205, + 212 + ], + [ + 213, + 216 + ], + [ + 217, + 219 + ], + [ + 220, + 223 + ], + [ + 224, + 226 + ], + [ + 227, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 237 + ], + [ + 238, + 240 + ], + [ + 241, + 244 + ], + [ + 245, + 247 + ], + [ + 248, + 251 + ], + [ + 252, + 254 + ], + [ + 255, + 258 + ], + [ + 259, + 261 + ], + [ + 262, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 275 + ], + [ + 276, + 279 + ], + [ + 280, + 282 + ], + [ + 283, + 289 + ], + [ + 290, + 295 + ], + [ + 298, + 299 + ], + [ + 319, + 320 + ], + [ + 324, + 325 + ], + [ + 329, + 330 + ], + [ + 331, + 332 + ], + [ + 338, + 341 + ], + [ + 345, + 349 + ], + [ + 350, + 351 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/matrixinvert.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 66, + 92 + ], + [ + 96, + 160 + ], + [ + 161, + 202 + ], + [ + 203, + 218 + ], + [ + 225, + 232 + ], + [ + 233, + 448 + ], + [ + 459, + 473 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 69, + 70 + ], + [ + 72, + 73 + ], + [ + 76, + 78 + ], + [ + 79, + 80 + ], + [ + 82, + 83 + ], + [ + 88, + 89 + ], + [ + 99, + 101 + ], + [ + 102, + 103 + ], + [ + 109, + 110 + ], + [ + 115, + 116 + ], + [ + 120, + 123 + ], + [ + 125, + 128 + ], + [ + 131, + 133 + ], + [ + 134, + 135 + ], + [ + 137, + 139 + ], + [ + 141, + 142 + ], + [ + 145, + 150 + ], + [ + 156, + 157 + ], + [ + 164, + 167 + ], + [ + 169, + 170 + ], + [ + 172, + 174 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 185, + 186 + ], + [ + 187, + 191 + ], + [ + 193, + 194 + ], + [ + 195, + 199 + ], + [ + 206, + 207 + ], + [ + 209, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 215 + ], + [ + 228, + 229 + ], + [ + 236, + 237 + ], + [ + 240, + 243 + ], + [ + 245, + 247 + ], + [ + 248, + 249 + ], + [ + 253, + 255 + ], + [ + 257, + 258 + ], + [ + 259, + 261 + ], + [ + 262, + 263 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 276, + 278 + ], + [ + 279, + 281 + ], + [ + 282, + 284 + ], + [ + 288, + 290 + ], + [ + 291, + 293 + ], + [ + 295, + 296 + ], + [ + 299, + 300 + ], + [ + 301, + 302 + ], + [ + 305, + 308 + ], + [ + 309, + 310 + ], + [ + 311, + 314 + ], + [ + 316, + 318 + ], + [ + 319, + 322 + ], + [ + 325, + 326 + ], + [ + 327, + 330 + ], + [ + 333, + 338 + ], + [ + 339, + 340 + ], + [ + 343, + 346 + ], + [ + 347, + 348 + ], + [ + 349, + 352 + ], + [ + 356, + 368 + ], + [ + 374, + 376 + ], + [ + 378, + 379 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 387, + 389 + ], + [ + 390, + 392 + ], + [ + 393, + 396 + ], + [ + 398, + 401 + ], + [ + 402, + 403 + ], + [ + 404, + 407 + ], + [ + 409, + 411 + ], + [ + 413, + 414 + ], + [ + 417, + 418 + ], + [ + 419, + 421 + ], + [ + 427, + 428 + ], + [ + 430, + 433 + ], + [ + 434, + 435 + ], + [ + 436, + 441 + ], + [ + 444, + 445 + ], + [ + 462, + 463 + ], + [ + 467, + 470 + ], + [ + 471, + 472 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/merge.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 58, + 171 + ], + [ + 178, + 208 + ], + [ + 211, + 228 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 61, + 62 + ], + [ + 64, + 65 + ], + [ + 68, + 69 + ], + [ + 70, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 78 + ], + [ + 81, + 84 + ], + [ + 90, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 114, + 115 + ], + [ + 119, + 122 + ], + [ + 123, + 124 + ], + [ + 125, + 128 + ], + [ + 129, + 130 + ], + [ + 131, + 143 + ], + [ + 144, + 164 + ], + [ + 167, + 168 + ], + [ + 181, + 182 + ], + [ + 184, + 185 + ], + [ + 189, + 191 + ], + [ + 194, + 196 + ], + [ + 200, + 201 + ], + [ + 203, + 205 + ], + [ + 214, + 217 + ], + [ + 221, + 225 + ], + [ + 226, + 227 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/mosaic.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 72, + 82 + ], + [ + 87, + 130 + ], + [ + 139, + 307 + ], + [ + 319, + 331 + ], + [ + 336, + 354 + ], + [ + 356, + 373 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 90, + 91 + ], + [ + 92, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 102, + 111 + ], + [ + 112, + 113 + ], + [ + 116, + 125 + ], + [ + 126, + 127 + ], + [ + 142, + 144 + ], + [ + 145, + 148 + ], + [ + 149, + 159 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 175, + 176 + ], + [ + 178, + 206 + ], + [ + 207, + 209 + ], + [ + 210, + 213 + ], + [ + 214, + 216 + ], + [ + 217, + 220 + ], + [ + 221, + 223 + ], + [ + 224, + 227 + ], + [ + 228, + 230 + ], + [ + 231, + 234 + ], + [ + 235, + 237 + ], + [ + 238, + 241 + ], + [ + 242, + 244 + ], + [ + 245, + 248 + ], + [ + 249, + 251 + ], + [ + 252, + 255 + ], + [ + 256, + 258 + ], + [ + 259, + 262 + ], + [ + 263, + 265 + ], + [ + 266, + 269 + ], + [ + 270, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 279 + ], + [ + 280, + 283 + ], + [ + 284, + 286 + ], + [ + 287, + 290 + ], + [ + 291, + 293 + ], + [ + 294, + 297 + ], + [ + 298, + 300 + ], + [ + 303, + 304 + ], + [ + 322, + 323 + ], + [ + 327, + 328 + ], + [ + 339, + 340 + ], + [ + 341, + 344 + ], + [ + 347, + 348 + ], + [ + 350, + 351 + ], + [ + 359, + 362 + ], + [ + 366, + 370 + ], + [ + 371, + 372 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/mosaic1.c", + "line_filter": { + "diff_chunks": [ + [ + 21, + 49 + ], + [ + 69, + 80 + ], + [ + 87, + 117 + ], + [ + 118, + 165 + ], + [ + 166, + 237 + ], + [ + 244, + 305 + ], + [ + 310, + 331 + ], + [ + 332, + 345 + ], + [ + 350, + 382 + ], + [ + 384, + 416 + ], + [ + 439, + 623 + ], + [ + 638, + 677 + ], + [ + 678, + 696 + ] + ], + "lines_added": [ + [ + 24, + 40 + ], + [ + 45, + 46 + ], + [ + 72, + 73 + ], + [ + 74, + 77 + ], + [ + 90, + 93 + ], + [ + 94, + 96 + ], + [ + 97, + 98 + ], + [ + 102, + 104 + ], + [ + 108, + 110 + ], + [ + 112, + 114 + ], + [ + 121, + 123 + ], + [ + 126, + 129 + ], + [ + 133, + 151 + ], + [ + 156, + 158 + ], + [ + 161, + 162 + ], + [ + 169, + 171 + ], + [ + 174, + 177 + ], + [ + 181, + 199 + ], + [ + 204, + 206 + ], + [ + 207, + 209 + ], + [ + 213, + 216 + ], + [ + 219, + 221 + ], + [ + 222, + 223 + ], + [ + 228, + 230 + ], + [ + 232, + 234 + ], + [ + 247, + 248 + ], + [ + 251, + 254 + ], + [ + 257, + 258 + ], + [ + 259, + 262 + ], + [ + 265, + 266 + ], + [ + 272, + 276 + ], + [ + 279, + 281 + ], + [ + 283, + 284 + ], + [ + 286, + 294 + ], + [ + 296, + 297 + ], + [ + 298, + 300 + ], + [ + 301, + 302 + ], + [ + 313, + 315 + ], + [ + 318, + 321 + ], + [ + 324, + 326 + ], + [ + 327, + 328 + ], + [ + 335, + 336 + ], + [ + 337, + 338 + ], + [ + 340, + 342 + ], + [ + 353, + 354 + ], + [ + 360, + 364 + ], + [ + 369, + 377 + ], + [ + 378, + 379 + ], + [ + 387, + 393 + ], + [ + 398, + 400 + ], + [ + 401, + 405 + ], + [ + 408, + 411 + ], + [ + 412, + 413 + ], + [ + 442, + 443 + ], + [ + 445, + 446 + ], + [ + 451, + 452 + ], + [ + 453, + 455 + ], + [ + 456, + 458 + ], + [ + 459, + 460 + ], + [ + 461, + 469 + ], + [ + 471, + 477 + ], + [ + 479, + 480 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 492, + 493 + ], + [ + 495, + 523 + ], + [ + 524, + 526 + ], + [ + 527, + 530 + ], + [ + 531, + 533 + ], + [ + 534, + 537 + ], + [ + 538, + 540 + ], + [ + 541, + 544 + ], + [ + 545, + 547 + ], + [ + 548, + 551 + ], + [ + 552, + 554 + ], + [ + 555, + 558 + ], + [ + 559, + 561 + ], + [ + 562, + 565 + ], + [ + 566, + 568 + ], + [ + 569, + 572 + ], + [ + 573, + 575 + ], + [ + 576, + 579 + ], + [ + 580, + 582 + ], + [ + 583, + 586 + ], + [ + 587, + 589 + ], + [ + 590, + 593 + ], + [ + 594, + 600 + ], + [ + 601, + 602 + ], + [ + 603, + 609 + ], + [ + 610, + 616 + ], + [ + 619, + 620 + ], + [ + 641, + 642 + ], + [ + 646, + 647 + ], + [ + 648, + 649 + ], + [ + 650, + 651 + ], + [ + 655, + 656 + ], + [ + 657, + 658 + ], + [ + 660, + 662 + ], + [ + 667, + 669 + ], + [ + 672, + 674 + ], + [ + 681, + 685 + ], + [ + 689, + 693 + ], + [ + 694, + 695 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/mosaicing.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 32 + ], + [ + 45, + 52 + ], + [ + 63, + 79 + ], + [ + 89, + 108 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 9, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 23 + ], + [ + 28, + 29 + ], + [ + 48, + 49 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 75, + 76 + ], + [ + 92, + 93 + ], + [ + 94, + 104 + ], + [ + 105, + 107 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/pmosaicing.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 9 + ], + [ + 11, + 39 + ], + [ + 42, + 49 + ], + [ + 51, + 64 + ], + [ + 71, + 89 + ], + [ + 93, + 103 + ], + [ + 107, + 202 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 5, + 6 + ], + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 35, + 36 + ], + [ + 45, + 46 + ], + [ + 54, + 56 + ], + [ + 60, + 61 + ], + [ + 74, + 76 + ], + [ + 77, + 78 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 96, + 97 + ], + [ + 99, + 100 + ], + [ + 110, + 111 + ], + [ + 112, + 114 + ], + [ + 115, + 116 + ], + [ + 117, + 125 + ], + [ + 126, + 130 + ], + [ + 131, + 137 + ], + [ + 138, + 140 + ], + [ + 142, + 151 + ], + [ + 152, + 153 + ], + [ + 155, + 156 + ], + [ + 162, + 163 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 176, + 189 + ], + [ + 191, + 195 + ], + [ + 197, + 199 + ], + [ + 201, + 202 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/remosaic.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 73, + 83 + ], + [ + 85, + 196 + ], + [ + 216, + 232 + ] + ], + "lines_added": [ + [ + 15, + 31 + ], + [ + 36, + 37 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 88, + 92 + ], + [ + 97, + 99 + ], + [ + 101, + 105 + ], + [ + 108, + 110 + ], + [ + 112, + 114 + ], + [ + 115, + 121 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 133, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 141 + ], + [ + 142, + 147 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ], + [ + 161, + 162 + ], + [ + 164, + 167 + ], + [ + 168, + 169 + ], + [ + 170, + 179 + ], + [ + 180, + 182 + ], + [ + 183, + 189 + ], + [ + 192, + 193 + ], + [ + 219, + 222 + ], + [ + 226, + 229 + ], + [ + 230, + 231 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/tbmerge.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 17 + ], + [ + 77, + 105 + ], + [ + 121, + 278 + ], + [ + 283, + 308 + ], + [ + 325, + 355 + ], + [ + 358, + 366 + ], + [ + 368, + 518 + ], + [ + 522, + 530 + ], + [ + 539, + 606 + ], + [ + 609, + 617 + ], + [ + 626, + 643 + ], + [ + 648, + 683 + ], + [ + 686, + 694 + ], + [ + 702, + 767 + ] + ], + "lines_added": [ + [ + 1, + 3 + ], + [ + 6, + 7 + ], + [ + 10, + 11 + ], + [ + 13, + 14 + ], + [ + 80, + 86 + ], + [ + 87, + 91 + ], + [ + 92, + 96 + ], + [ + 101, + 102 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 134, + 135 + ], + [ + 139, + 148 + ], + [ + 149, + 153 + ], + [ + 154, + 185 + ], + [ + 187, + 189 + ], + [ + 193, + 194 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 209, + 210 + ], + [ + 214, + 223 + ], + [ + 224, + 228 + ], + [ + 229, + 260 + ], + [ + 262, + 264 + ], + [ + 268, + 269 + ], + [ + 274, + 275 + ], + [ + 286, + 287 + ], + [ + 291, + 292 + ], + [ + 295, + 296 + ], + [ + 300, + 301 + ], + [ + 303, + 305 + ], + [ + 328, + 332 + ], + [ + 336, + 337 + ], + [ + 343, + 344 + ], + [ + 346, + 352 + ], + [ + 361, + 363 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 378, + 389 + ], + [ + 392, + 418 + ], + [ + 419, + 451 + ], + [ + 454, + 507 + ], + [ + 508, + 510 + ], + [ + 514, + 515 + ], + [ + 525, + 527 + ], + [ + 542, + 545 + ], + [ + 548, + 553 + ], + [ + 558, + 583 + ], + [ + 584, + 586 + ], + [ + 587, + 589 + ], + [ + 591, + 593 + ], + [ + 596, + 597 + ], + [ + 602, + 603 + ], + [ + 612, + 614 + ], + [ + 629, + 632 + ], + [ + 635, + 640 + ], + [ + 651, + 653 + ], + [ + 656, + 657 + ], + [ + 660, + 661 + ], + [ + 663, + 664 + ], + [ + 669, + 670 + ], + [ + 671, + 672 + ], + [ + 673, + 676 + ], + [ + 679, + 680 + ], + [ + 689, + 691 + ], + [ + 705, + 709 + ], + [ + 715, + 716 + ], + [ + 719, + 722 + ], + [ + 724, + 725 + ], + [ + 728, + 729 + ], + [ + 733, + 740 + ], + [ + 741, + 742 + ], + [ + 746, + 747 + ], + [ + 749, + 751 + ], + [ + 752, + 755 + ], + [ + 761, + 764 + ], + [ + 765, + 766 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/tbmosaic.c", + "line_filter": { + "diff_chunks": [ + [ + 31, + 59 + ], + [ + 69, + 98 + ], + [ + 107, + 150 + ], + [ + 152, + 164 + ], + [ + 169, + 202 + ], + [ + 209, + 224 + ], + [ + 228, + 256 + ] + ], + "lines_added": [ + [ + 34, + 50 + ], + [ + 55, + 56 + ], + [ + 72, + 76 + ], + [ + 78, + 79 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 91, + 95 + ], + [ + 110, + 116 + ], + [ + 120, + 133 + ], + [ + 134, + 140 + ], + [ + 142, + 144 + ], + [ + 146, + 147 + ], + [ + 155, + 156 + ], + [ + 158, + 159 + ], + [ + 160, + 161 + ], + [ + 172, + 173 + ], + [ + 174, + 177 + ], + [ + 180, + 183 + ], + [ + 186, + 188 + ], + [ + 189, + 190 + ], + [ + 191, + 194 + ], + [ + 197, + 199 + ], + [ + 212, + 213 + ], + [ + 215, + 217 + ], + [ + 218, + 219 + ], + [ + 220, + 221 + ], + [ + 231, + 239 + ], + [ + 240, + 241 + ], + [ + 244, + 251 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ] + ] + } + }, + { + "filename": "libvips/resample/affine.c", + "line_filter": { + "diff_chunks": [ + [ + 45, + 56 + ], + [ + 87, + 122 + ], + [ + 176, + 251 + ], + [ + 254, + 272 + ], + [ + 275, + 282 + ], + [ + 286, + 317 + ], + [ + 338, + 386 + ], + [ + 389, + 412 + ], + [ + 415, + 447 + ], + [ + 455, + 527 + ], + [ + 529, + 544 + ], + [ + 550, + 595 + ], + [ + 597, + 706 + ], + [ + 720, + 728 + ], + [ + 731, + 783 + ] + ], + "lines_added": [ + [ + 48, + 49 + ], + [ + 52, + 53 + ], + [ + 90, + 91 + ], + [ + 97, + 98 + ], + [ + 99, + 103 + ], + [ + 104, + 113 + ], + [ + 118, + 119 + ], + [ + 179, + 180 + ], + [ + 184, + 185 + ], + [ + 187, + 188 + ], + [ + 191, + 192 + ], + [ + 193, + 196 + ], + [ + 201, + 202 + ], + [ + 208, + 209 + ], + [ + 213, + 214 + ], + [ + 218, + 224 + ], + [ + 227, + 228 + ], + [ + 229, + 230 + ], + [ + 231, + 232 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 242, + 244 + ], + [ + 247, + 248 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 264, + 265 + ], + [ + 268, + 269 + ], + [ + 278, + 279 + ], + [ + 289, + 290 + ], + [ + 292, + 294 + ], + [ + 297, + 298 + ], + [ + 300, + 303 + ], + [ + 304, + 306 + ], + [ + 307, + 308 + ], + [ + 311, + 312 + ], + [ + 313, + 314 + ], + [ + 341, + 342 + ], + [ + 346, + 347 + ], + [ + 351, + 352 + ], + [ + 353, + 355 + ], + [ + 356, + 358 + ], + [ + 361, + 362 + ], + [ + 364, + 365 + ], + [ + 368, + 369 + ], + [ + 370, + 373 + ], + [ + 374, + 376 + ], + [ + 377, + 378 + ], + [ + 382, + 383 + ], + [ + 392, + 393 + ], + [ + 394, + 395 + ], + [ + 396, + 397 + ], + [ + 400, + 401 + ], + [ + 402, + 404 + ], + [ + 405, + 406 + ], + [ + 408, + 409 + ], + [ + 418, + 420 + ], + [ + 421, + 430 + ], + [ + 431, + 432 + ], + [ + 433, + 435 + ], + [ + 441, + 444 + ], + [ + 458, + 460 + ], + [ + 463, + 464 + ], + [ + 465, + 466 + ], + [ + 472, + 473 + ], + [ + 474, + 475 + ], + [ + 477, + 478 + ], + [ + 479, + 480 + ], + [ + 483, + 486 + ], + [ + 489, + 491 + ], + [ + 497, + 498 + ], + [ + 499, + 504 + ], + [ + 506, + 508 + ], + [ + 513, + 514 + ], + [ + 516, + 524 + ], + [ + 532, + 534 + ], + [ + 537, + 541 + ], + [ + 553, + 558 + ], + [ + 559, + 560 + ], + [ + 562, + 566 + ], + [ + 569, + 571 + ], + [ + 576, + 584 + ], + [ + 588, + 592 + ], + [ + 600, + 604 + ], + [ + 607, + 609 + ], + [ + 610, + 611 + ], + [ + 614, + 615 + ], + [ + 616, + 618 + ], + [ + 619, + 620 + ], + [ + 625, + 626 + ], + [ + 628, + 631 + ], + [ + 632, + 638 + ], + [ + 639, + 640 + ], + [ + 641, + 644 + ], + [ + 645, + 647 + ], + [ + 648, + 651 + ], + [ + 652, + 654 + ], + [ + 655, + 658 + ], + [ + 659, + 661 + ], + [ + 662, + 665 + ], + [ + 666, + 668 + ], + [ + 669, + 672 + ], + [ + 673, + 675 + ], + [ + 676, + 679 + ], + [ + 680, + 682 + ], + [ + 683, + 686 + ], + [ + 687, + 689 + ], + [ + 690, + 696 + ], + [ + 699, + 700 + ], + [ + 702, + 703 + ], + [ + 723, + 725 + ], + [ + 734, + 737 + ], + [ + 742, + 744 + ], + [ + 746, + 748 + ], + [ + 750, + 751 + ], + [ + 756, + 757 + ], + [ + 759, + 760 + ], + [ + 766, + 768 + ], + [ + 773, + 774 + ], + [ + 775, + 778 + ], + [ + 779, + 780 + ], + [ + 781, + 782 + ] + ] + } + }, + { + "filename": "libvips/resample/interpolate.c", + "line_filter": { + "diff_chunks": [ + [ + 22, + 50 + ], + [ + 72, + 79 + ], + [ + 99, + 106 + ], + [ + 108, + 115 + ], + [ + 123, + 181 + ], + [ + 182, + 189 + ], + [ + 192, + 207 + ], + [ + 215, + 232 + ], + [ + 235, + 284 + ], + [ + 290, + 297 + ], + [ + 303, + 634 + ], + [ + 650, + 665 + ] + ], + "lines_added": [ + [ + 25, + 26 + ], + [ + 27, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 41 + ], + [ + 46, + 47 + ], + [ + 75, + 76 + ], + [ + 102, + 103 + ], + [ + 111, + 112 + ], + [ + 126, + 127 + ], + [ + 132, + 133 + ], + [ + 134, + 136 + ], + [ + 137, + 138 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 158, + 161 + ], + [ + 162, + 164 + ], + [ + 167, + 168 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 177, + 178 + ], + [ + 185, + 186 + ], + [ + 195, + 196 + ], + [ + 198, + 200 + ], + [ + 203, + 204 + ], + [ + 218, + 220 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 228, + 229 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 244, + 245 + ], + [ + 247, + 248 + ], + [ + 251, + 252 + ], + [ + 256, + 257 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 278, + 279 + ], + [ + 280, + 281 + ], + [ + 293, + 294 + ], + [ + 306, + 307 + ], + [ + 313, + 326 + ], + [ + 332, + 334 + ], + [ + 336, + 338 + ], + [ + 339, + 340 + ], + [ + 344, + 346 + ], + [ + 349, + 350 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 358, + 359 + ], + [ + 361, + 362 + ], + [ + 368, + 369 + ], + [ + 371, + 373 + ], + [ + 377, + 378 + ], + [ + 379, + 381 + ], + [ + 386, + 387 + ], + [ + 392, + 393 + ], + [ + 396, + 397 + ], + [ + 398, + 399 + ], + [ + 401, + 402 + ], + [ + 408, + 421 + ], + [ + 425, + 427 + ], + [ + 433, + 441 + ], + [ + 444, + 466 + ], + [ + 467, + 473 + ], + [ + 474, + 475 + ], + [ + 478, + 500 + ], + [ + 502, + 503 + ], + [ + 504, + 541 + ], + [ + 543, + 545 + ], + [ + 548, + 550 + ], + [ + 551, + 552 + ], + [ + 556, + 560 + ], + [ + 563, + 567 + ], + [ + 568, + 569 + ], + [ + 572, + 573 + ], + [ + 574, + 575 + ], + [ + 579, + 580 + ], + [ + 586, + 587 + ], + [ + 589, + 591 + ], + [ + 595, + 596 + ], + [ + 597, + 599 + ], + [ + 604, + 605 + ], + [ + 610, + 611 + ], + [ + 614, + 615 + ], + [ + 616, + 617 + ], + [ + 619, + 620 + ], + [ + 625, + 626 + ], + [ + 627, + 631 + ], + [ + 653, + 654 + ], + [ + 657, + 661 + ], + [ + 663, + 664 + ] + ] + } + }, + { + "filename": "libvips/resample/mapim.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 44 + ], + [ + 94, + 150 + ], + [ + 157, + 200 + ], + [ + 204, + 222 + ], + [ + 225, + 351 + ], + [ + 362, + 441 + ], + [ + 445, + 494 + ], + [ + 500, + 516 + ], + [ + 517, + 598 + ], + [ + 604, + 612 + ], + [ + 617, + 658 + ] + ], + "lines_added": [ + [ + 19, + 35 + ], + [ + 40, + 41 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 115 + ], + [ + 116, + 117 + ], + [ + 118, + 135 + ], + [ + 136, + 142 + ], + [ + 146, + 147 + ], + [ + 160, + 197 + ], + [ + 207, + 211 + ], + [ + 215, + 219 + ], + [ + 228, + 248 + ], + [ + 249, + 250 + ], + [ + 253, + 275 + ], + [ + 276, + 277 + ], + [ + 280, + 304 + ], + [ + 305, + 306 + ], + [ + 308, + 309 + ], + [ + 310, + 311 + ], + [ + 313, + 314 + ], + [ + 315, + 322 + ], + [ + 327, + 328 + ], + [ + 329, + 331 + ], + [ + 334, + 335 + ], + [ + 340, + 342 + ], + [ + 343, + 344 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 365, + 366 + ], + [ + 368, + 370 + ], + [ + 373, + 374 + ], + [ + 376, + 379 + ], + [ + 380, + 382 + ], + [ + 383, + 384 + ], + [ + 387, + 420 + ], + [ + 426, + 427 + ], + [ + 428, + 429 + ], + [ + 432, + 433 + ], + [ + 434, + 436 + ], + [ + 437, + 438 + ], + [ + 448, + 450 + ], + [ + 451, + 454 + ], + [ + 457, + 459 + ], + [ + 461, + 464 + ], + [ + 468, + 469 + ], + [ + 473, + 481 + ], + [ + 483, + 485 + ], + [ + 487, + 491 + ], + [ + 503, + 508 + ], + [ + 510, + 513 + ], + [ + 520, + 524 + ], + [ + 527, + 531 + ], + [ + 534, + 536 + ], + [ + 537, + 538 + ], + [ + 541, + 542 + ], + [ + 543, + 545 + ], + [ + 546, + 547 + ], + [ + 552, + 553 + ], + [ + 555, + 564 + ], + [ + 565, + 566 + ], + [ + 567, + 570 + ], + [ + 571, + 573 + ], + [ + 574, + 577 + ], + [ + 578, + 580 + ], + [ + 581, + 587 + ], + [ + 590, + 591 + ], + [ + 592, + 593 + ], + [ + 594, + 595 + ], + [ + 607, + 609 + ], + [ + 620, + 621 + ], + [ + 622, + 623 + ], + [ + 624, + 625 + ], + [ + 626, + 627 + ], + [ + 628, + 630 + ], + [ + 634, + 635 + ], + [ + 637, + 638 + ], + [ + 639, + 640 + ], + [ + 641, + 642 + ], + [ + 647, + 648 + ], + [ + 652, + 655 + ], + [ + 656, + 657 + ] + ] + } + }, + { + "filename": "libvips/resample/presample.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 55 + ], + [ + 63, + 81 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 51 + ], + [ + 66, + 67 + ], + [ + 72, + 75 + ] + ] + } + }, + { + "filename": "libvips/resample/quadratic.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 64, + 74 + ], + [ + 102, + 154 + ], + [ + 155, + 165 + ], + [ + 166, + 174 + ], + [ + 175, + 245 + ], + [ + 246, + 363 + ], + [ + 371, + 392 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 67, + 71 + ], + [ + 105, + 106 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 118, + 120 + ], + [ + 123, + 126 + ], + [ + 128, + 129 + ], + [ + 132, + 133 + ], + [ + 134, + 135 + ], + [ + 141, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 151 + ], + [ + 158, + 160 + ], + [ + 161, + 162 + ], + [ + 169, + 171 + ], + [ + 178, + 179 + ], + [ + 184, + 185 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 203, + 205 + ], + [ + 209, + 210 + ], + [ + 211, + 216 + ], + [ + 218, + 221 + ], + [ + 227, + 228 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 240, + 242 + ], + [ + 249, + 251 + ], + [ + 255, + 258 + ], + [ + 261, + 275 + ], + [ + 277, + 279 + ], + [ + 281, + 283 + ], + [ + 285, + 287 + ], + [ + 290, + 295 + ], + [ + 296, + 298 + ], + [ + 299, + 301 + ], + [ + 302, + 303 + ], + [ + 304, + 311 + ], + [ + 313, + 318 + ], + [ + 320, + 324 + ], + [ + 325, + 326 + ], + [ + 329, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 335 + ], + [ + 341, + 343 + ], + [ + 345, + 348 + ], + [ + 349, + 350 + ], + [ + 351, + 354 + ], + [ + 355, + 356 + ], + [ + 359, + 360 + ], + [ + 374, + 375 + ], + [ + 381, + 382 + ], + [ + 386, + 389 + ], + [ + 390, + 391 + ] + ] + } + }, + { + "filename": "libvips/resample/reduce.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 10 + ], + [ + 14, + 42 + ], + [ + 59, + 74 + ], + [ + 94, + 104 + ], + [ + 125, + 135 + ], + [ + 138, + 147 + ], + [ + 154, + 261 + ], + [ + 273, + 280 + ], + [ + 282, + 307 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 6, + 7 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 62, + 63 + ], + [ + 64, + 66 + ], + [ + 70, + 71 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 128, + 129 + ], + [ + 131, + 132 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 157, + 158 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 164, + 172 + ], + [ + 173, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 190 + ], + [ + 191, + 192 + ], + [ + 197, + 198 + ], + [ + 202, + 205 + ], + [ + 206, + 208 + ], + [ + 209, + 212 + ], + [ + 213, + 215 + ], + [ + 216, + 219 + ], + [ + 220, + 222 + ], + [ + 223, + 226 + ], + [ + 227, + 229 + ], + [ + 230, + 231 + ], + [ + 232, + 235 + ], + [ + 236, + 238 + ], + [ + 239, + 242 + ], + [ + 243, + 245 + ], + [ + 248, + 251 + ], + [ + 252, + 254 + ], + [ + 257, + 258 + ], + [ + 276, + 277 + ], + [ + 285, + 286 + ], + [ + 288, + 289 + ], + [ + 295, + 297 + ], + [ + 301, + 304 + ], + [ + 305, + 306 + ] + ] + } + }, + { + "filename": "libvips/resample/resample.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 61, + 68 + ], + [ + 72, + 81 + ], + [ + 82, + 96 + ], + [ + 102, + 157 + ], + [ + 158, + 197 + ] + ], + "lines_added": [ + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 28 + ], + [ + 33, + 34 + ], + [ + 64, + 65 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 85, + 86 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 105, + 106 + ], + [ + 108, + 109 + ], + [ + 110, + 111 + ], + [ + 113, + 116 + ], + [ + 118, + 119 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 129, + 131 + ], + [ + 136, + 137 + ], + [ + 139, + 142 + ], + [ + 143, + 144 + ], + [ + 145, + 150 + ], + [ + 153, + 154 + ], + [ + 161, + 162 + ], + [ + 163, + 196 + ] + ] + } + }, + { + "filename": "libvips/resample/resize.c", + "line_filter": { + "diff_chunks": [ + [ + 22, + 29 + ], + [ + 30, + 37 + ], + [ + 41, + 69 + ], + [ + 108, + 144 + ], + [ + 145, + 202 + ], + [ + 205, + 395 + ], + [ + 404, + 414 + ], + [ + 416, + 423 + ], + [ + 432, + 439 + ], + [ + 442, + 457 + ] + ], + "lines_added": [ + [ + 25, + 26 + ], + [ + 33, + 34 + ], + [ + 44, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 60 + ], + [ + 65, + 66 + ], + [ + 111, + 112 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 130, + 131 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 148, + 150 + ], + [ + 156, + 157 + ], + [ + 163, + 165 + ], + [ + 167, + 168 + ], + [ + 173, + 176 + ], + [ + 178, + 187 + ], + [ + 189, + 191 + ], + [ + 192, + 199 + ], + [ + 208, + 210 + ], + [ + 213, + 220 + ], + [ + 223, + 230 + ], + [ + 235, + 239 + ], + [ + 244, + 246 + ], + [ + 249, + 252 + ], + [ + 253, + 256 + ], + [ + 258, + 261 + ], + [ + 263, + 275 + ], + [ + 277, + 287 + ], + [ + 289, + 299 + ], + [ + 303, + 305 + ], + [ + 306, + 307 + ], + [ + 310, + 311 + ], + [ + 312, + 315 + ], + [ + 316, + 317 + ], + [ + 322, + 323 + ], + [ + 327, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 337 + ], + [ + 338, + 340 + ], + [ + 341, + 344 + ], + [ + 345, + 347 + ], + [ + 348, + 351 + ], + [ + 352, + 354 + ], + [ + 356, + 357 + ], + [ + 358, + 361 + ], + [ + 362, + 364 + ], + [ + 365, + 368 + ], + [ + 369, + 371 + ], + [ + 374, + 379 + ], + [ + 382, + 385 + ], + [ + 386, + 388 + ], + [ + 391, + 392 + ], + [ + 407, + 408 + ], + [ + 410, + 411 + ], + [ + 419, + 420 + ], + [ + 435, + 436 + ], + [ + 445, + 447 + ], + [ + 451, + 454 + ], + [ + 455, + 456 + ] + ] + } + }, + { + "filename": "libvips/resample/shrink.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 13 + ], + [ + 16, + 44 + ], + [ + 63, + 137 + ], + [ + 138, + 184 + ], + [ + 196, + 224 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 35 + ], + [ + 40, + 41 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 74, + 75 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 83 + ], + [ + 87, + 89 + ], + [ + 93, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 101 + ], + [ + 102, + 105 + ], + [ + 107, + 115 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 126 + ], + [ + 127, + 128 + ], + [ + 133, + 134 + ], + [ + 141, + 144 + ], + [ + 145, + 147 + ], + [ + 148, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 158 + ], + [ + 159, + 161 + ], + [ + 162, + 163 + ], + [ + 164, + 167 + ], + [ + 168, + 170 + ], + [ + 171, + 174 + ], + [ + 175, + 177 + ], + [ + 180, + 181 + ], + [ + 199, + 200 + ], + [ + 202, + 203 + ], + [ + 205, + 206 + ], + [ + 212, + 214 + ], + [ + 218, + 221 + ], + [ + 222, + 223 + ] + ] + } + }, + { + "filename": "libvips/resample/shrinkh.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 12 + ], + [ + 14, + 42 + ], + [ + 61, + 225 + ], + [ + 226, + 289 + ], + [ + 290, + 361 + ], + [ + 370, + 397 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 64, + 66 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 96 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 117 + ], + [ + 118, + 119 + ], + [ + 123, + 125 + ], + [ + 126, + 132 + ], + [ + 136, + 138 + ], + [ + 144, + 145 + ], + [ + 146, + 148 + ], + [ + 149, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 157 + ], + [ + 160, + 187 + ], + [ + 189, + 190 + ], + [ + 194, + 196 + ], + [ + 199, + 200 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 213, + 214 + ], + [ + 217, + 219 + ], + [ + 221, + 222 + ], + [ + 229, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 235 + ], + [ + 236, + 238 + ], + [ + 239, + 240 + ], + [ + 242, + 243 + ], + [ + 244, + 245 + ], + [ + 248, + 249 + ], + [ + 250, + 252 + ], + [ + 253, + 255 + ], + [ + 258, + 260 + ], + [ + 261, + 262 + ], + [ + 263, + 267 + ], + [ + 269, + 271 + ], + [ + 275, + 281 + ], + [ + 283, + 286 + ], + [ + 293, + 298 + ], + [ + 301, + 304 + ], + [ + 306, + 310 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 317, + 320 + ], + [ + 321, + 322 + ], + [ + 327, + 328 + ], + [ + 332, + 335 + ], + [ + 336, + 338 + ], + [ + 339, + 342 + ], + [ + 343, + 345 + ], + [ + 346, + 347 + ], + [ + 348, + 351 + ], + [ + 352, + 354 + ], + [ + 357, + 358 + ], + [ + 373, + 374 + ], + [ + 376, + 377 + ], + [ + 379, + 380 + ], + [ + 386, + 387 + ], + [ + 391, + 394 + ], + [ + 395, + 396 + ] + ] + } + }, + { + "filename": "libvips/resample/shrinkv.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 12 + ], + [ + 42, + 49 + ], + [ + 53, + 81 + ], + [ + 101, + 116 + ], + [ + 122, + 319 + ], + [ + 320, + 401 + ], + [ + 402, + 425 + ], + [ + 430, + 498 + ], + [ + 507, + 534 + ] + ], + "lines_added": [ + [ + 7, + 9 + ], + [ + 45, + 46 + ], + [ + 56, + 57 + ], + [ + 58, + 62 + ], + [ + 63, + 72 + ], + [ + 77, + 78 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 112, + 113 + ], + [ + 125, + 126 + ], + [ + 129, + 132 + ], + [ + 133, + 134 + ], + [ + 139, + 140 + ], + [ + 145, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ], + [ + 157, + 165 + ], + [ + 166, + 167 + ], + [ + 169, + 171 + ], + [ + 172, + 176 + ], + [ + 179, + 211 + ], + [ + 213, + 214 + ], + [ + 217, + 218 + ], + [ + 219, + 229 + ], + [ + 230, + 240 + ], + [ + 242, + 244 + ], + [ + 245, + 249 + ], + [ + 252, + 254 + ], + [ + 255, + 257 + ], + [ + 258, + 260 + ], + [ + 261, + 284 + ], + [ + 286, + 287 + ], + [ + 291, + 293 + ], + [ + 297, + 298 + ], + [ + 302, + 303 + ], + [ + 304, + 305 + ], + [ + 308, + 310 + ], + [ + 312, + 314 + ], + [ + 315, + 316 + ], + [ + 323, + 324 + ], + [ + 325, + 327 + ], + [ + 328, + 329 + ], + [ + 330, + 332 + ], + [ + 333, + 334 + ], + [ + 336, + 337 + ], + [ + 338, + 340 + ], + [ + 341, + 342 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 350, + 351 + ], + [ + 352, + 354 + ], + [ + 355, + 357 + ], + [ + 360, + 362 + ], + [ + 363, + 364 + ], + [ + 365, + 369 + ], + [ + 371, + 373 + ], + [ + 377, + 383 + ], + [ + 387, + 390 + ], + [ + 392, + 393 + ], + [ + 395, + 398 + ], + [ + 405, + 410 + ], + [ + 413, + 416 + ], + [ + 418, + 422 + ], + [ + 433, + 434 + ], + [ + 435, + 437 + ], + [ + 438, + 442 + ], + [ + 445, + 447 + ], + [ + 448, + 449 + ], + [ + 452, + 453 + ], + [ + 454, + 457 + ], + [ + 458, + 459 + ], + [ + 464, + 465 + ], + [ + 469, + 472 + ], + [ + 473, + 475 + ], + [ + 476, + 479 + ], + [ + 480, + 482 + ], + [ + 483, + 484 + ], + [ + 485, + 488 + ], + [ + 489, + 491 + ], + [ + 494, + 495 + ], + [ + 510, + 511 + ], + [ + 513, + 514 + ], + [ + 516, + 517 + ], + [ + 523, + 524 + ], + [ + 528, + 531 + ], + [ + 532, + 533 + ] + ] + } + }, + { + "filename": "libvips/resample/similarity.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 76, + 219 + ], + [ + 227, + 234 + ], + [ + 236, + 289 + ], + [ + 296, + 303 + ], + [ + 305, + 326 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 79, + 81 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 87, + 91 + ], + [ + 94, + 96 + ], + [ + 97, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 111 + ], + [ + 114, + 115 + ], + [ + 116, + 118 + ], + [ + 123, + 124 + ], + [ + 126, + 129 + ], + [ + 130, + 131 + ], + [ + 132, + 135 + ], + [ + 136, + 138 + ], + [ + 139, + 142 + ], + [ + 143, + 145 + ], + [ + 146, + 149 + ], + [ + 150, + 152 + ], + [ + 153, + 156 + ], + [ + 157, + 159 + ], + [ + 160, + 166 + ], + [ + 169, + 170 + ], + [ + 171, + 179 + ], + [ + 184, + 186 + ], + [ + 188, + 189 + ], + [ + 190, + 192 + ], + [ + 197, + 198 + ], + [ + 199, + 202 + ], + [ + 203, + 205 + ], + [ + 206, + 209 + ], + [ + 210, + 212 + ], + [ + 215, + 216 + ], + [ + 230, + 231 + ], + [ + 239, + 240 + ], + [ + 246, + 247 + ], + [ + 251, + 254 + ], + [ + 255, + 256 + ], + [ + 261, + 262 + ], + [ + 264, + 265 + ], + [ + 266, + 268 + ], + [ + 273, + 275 + ], + [ + 276, + 279 + ], + [ + 280, + 282 + ], + [ + 285, + 286 + ], + [ + 299, + 300 + ], + [ + 308, + 309 + ], + [ + 315, + 316 + ], + [ + 320, + 323 + ], + [ + 324, + 325 + ] + ] + } + }, + { + "filename": "libvips/resample/templates.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 32, + 62 + ], + [ + 69, + 77 + ], + [ + 78, + 85 + ], + [ + 86, + 100 + ], + [ + 101, + 108 + ], + [ + 109, + 129 + ], + [ + 130, + 137 + ], + [ + 139, + 307 + ], + [ + 312, + 394 + ], + [ + 397, + 455 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 35, + 37 + ], + [ + 40, + 41 + ], + [ + 43, + 45 + ], + [ + 46, + 47 + ], + [ + 50, + 51 + ], + [ + 53, + 55 + ], + [ + 58, + 59 + ], + [ + 72, + 74 + ], + [ + 81, + 82 + ], + [ + 89, + 90 + ], + [ + 95, + 97 + ], + [ + 104, + 105 + ], + [ + 112, + 113 + ], + [ + 118, + 119 + ], + [ + 124, + 126 + ], + [ + 133, + 134 + ], + [ + 142, + 143 + ], + [ + 149, + 150 + ], + [ + 153, + 154 + ], + [ + 158, + 160 + ], + [ + 164, + 165 + ], + [ + 171, + 172 + ], + [ + 175, + 177 + ], + [ + 180, + 182 + ], + [ + 185, + 187 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 204, + 205 + ], + [ + 209, + 211 + ], + [ + 215, + 216 + ], + [ + 222, + 223 + ], + [ + 226, + 228 + ], + [ + 231, + 233 + ], + [ + 236, + 238 + ], + [ + 241, + 242 + ], + [ + 243, + 244 + ], + [ + 247, + 248 + ], + [ + 250, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 259 + ], + [ + 263, + 265 + ], + [ + 269, + 270 + ], + [ + 271, + 281 + ], + [ + 287, + 288 + ], + [ + 294, + 297 + ], + [ + 299, + 300 + ], + [ + 303, + 304 + ], + [ + 315, + 317 + ], + [ + 320, + 321 + ], + [ + 324, + 325 + ], + [ + 327, + 328 + ], + [ + 332, + 334 + ], + [ + 339, + 340 + ], + [ + 345, + 346 + ], + [ + 352, + 354 + ], + [ + 357, + 358 + ], + [ + 361, + 362 + ], + [ + 364, + 365 + ], + [ + 366, + 367 + ], + [ + 372, + 373 + ], + [ + 374, + 378 + ], + [ + 379, + 384 + ], + [ + 390, + 391 + ], + [ + 400, + 401 + ], + [ + 402, + 404 + ], + [ + 407, + 408 + ], + [ + 411, + 412 + ], + [ + 414, + 415 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 423, + 424 + ], + [ + 426, + 428 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 443, + 444 + ], + [ + 447, + 449 + ], + [ + 453, + 454 + ] + ] + } + }, + { + "filename": "libvips/resample/thumbnail.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 22 + ], + [ + 41, + 69 + ], + [ + 83, + 101 + ], + [ + 120, + 135 + ], + [ + 156, + 303 + ], + [ + 306, + 345 + ], + [ + 347, + 358 + ], + [ + 361, + 417 + ], + [ + 418, + 580 + ], + [ + 581, + 589 + ], + [ + 590, + 655 + ], + [ + 665, + 678 + ], + [ + 679, + 738 + ], + [ + 741, + 758 + ], + [ + 761, + 793 + ], + [ + 801, + 892 + ], + [ + 895, + 965 + ], + [ + 966, + 1072 + ], + [ + 1077, + 1221 + ], + [ + 1241, + 1253 + ], + [ + 1255, + 1281 + ], + [ + 1288, + 1304 + ], + [ + 1309, + 1469 + ], + [ + 1496, + 1503 + ], + [ + 1504, + 1519 + ], + [ + 1524, + 1683 + ], + [ + 1709, + 1725 + ], + [ + 1729, + 1742 + ], + [ + 1743, + 1799 + ], + [ + 1815, + 1822 + ], + [ + 1827, + 1841 + ] + ], + "lines_added": [ + [ + 18, + 19 + ], + [ + 44, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 55 + ], + [ + 56, + 60 + ], + [ + 65, + 66 + ], + [ + 86, + 97 + ], + [ + 123, + 124 + ], + [ + 127, + 132 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 177, + 180 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 189, + 192 + ], + [ + 194, + 195 + ], + [ + 201, + 202 + ], + [ + 205, + 208 + ], + [ + 209, + 210 + ], + [ + 213, + 214 + ], + [ + 217, + 222 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 230, + 231 + ], + [ + 235, + 236 + ], + [ + 239, + 241 + ], + [ + 243, + 244 + ], + [ + 246, + 248 + ], + [ + 249, + 252 + ], + [ + 253, + 254 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 274, + 275 + ], + [ + 277, + 278 + ], + [ + 284, + 285 + ], + [ + 288, + 289 + ], + [ + 295, + 297 + ], + [ + 298, + 300 + ], + [ + 309, + 312 + ], + [ + 318, + 319 + ], + [ + 321, + 322 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ], + [ + 330, + 331 + ], + [ + 337, + 338 + ], + [ + 341, + 342 + ], + [ + 350, + 352 + ], + [ + 353, + 355 + ], + [ + 364, + 367 + ], + [ + 372, + 373 + ], + [ + 374, + 375 + ], + [ + 378, + 380 + ], + [ + 381, + 382 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 395, + 396 + ], + [ + 399, + 401 + ], + [ + 402, + 403 + ], + [ + 404, + 405 + ], + [ + 407, + 409 + ], + [ + 413, + 414 + ], + [ + 421, + 423 + ], + [ + 428, + 429 + ], + [ + 434, + 436 + ], + [ + 441, + 444 + ], + [ + 445, + 448 + ], + [ + 452, + 454 + ], + [ + 460, + 462 + ], + [ + 467, + 469 + ], + [ + 470, + 471 + ], + [ + 472, + 473 + ], + [ + 478, + 480 + ], + [ + 481, + 483 + ], + [ + 487, + 489 + ], + [ + 492, + 494 + ], + [ + 497, + 505 + ], + [ + 510, + 512 + ], + [ + 515, + 517 + ], + [ + 518, + 523 + ], + [ + 524, + 525 + ], + [ + 527, + 528 + ], + [ + 529, + 530 + ], + [ + 533, + 534 + ], + [ + 535, + 536 + ], + [ + 540, + 545 + ], + [ + 547, + 548 + ], + [ + 549, + 550 + ], + [ + 554, + 555 + ], + [ + 556, + 557 + ], + [ + 560, + 561 + ], + [ + 562, + 563 + ], + [ + 569, + 571 + ], + [ + 574, + 575 + ], + [ + 576, + 577 + ], + [ + 584, + 586 + ], + [ + 593, + 604 + ], + [ + 605, + 609 + ], + [ + 612, + 613 + ], + [ + 614, + 620 + ], + [ + 624, + 625 + ], + [ + 629, + 633 + ], + [ + 637, + 638 + ], + [ + 639, + 641 + ], + [ + 642, + 643 + ], + [ + 644, + 645 + ], + [ + 648, + 649 + ], + [ + 650, + 652 + ], + [ + 668, + 671 + ], + [ + 673, + 675 + ], + [ + 682, + 683 + ], + [ + 685, + 686 + ], + [ + 690, + 692 + ], + [ + 696, + 697 + ], + [ + 700, + 702 + ], + [ + 705, + 707 + ], + [ + 710, + 712 + ], + [ + 714, + 716 + ], + [ + 718, + 719 + ], + [ + 720, + 735 + ], + [ + 744, + 755 + ], + [ + 764, + 775 + ], + [ + 780, + 782 + ], + [ + 786, + 790 + ], + [ + 804, + 808 + ], + [ + 810, + 812 + ], + [ + 815, + 819 + ], + [ + 821, + 826 + ], + [ + 832, + 835 + ], + [ + 836, + 838 + ], + [ + 840, + 842 + ], + [ + 846, + 847 + ], + [ + 851, + 857 + ], + [ + 859, + 860 + ], + [ + 865, + 875 + ], + [ + 879, + 886 + ], + [ + 887, + 889 + ], + [ + 898, + 909 + ], + [ + 912, + 916 + ], + [ + 918, + 921 + ], + [ + 926, + 927 + ], + [ + 930, + 932 + ], + [ + 933, + 934 + ], + [ + 939, + 942 + ], + [ + 943, + 945 + ], + [ + 948, + 949 + ], + [ + 950, + 952 + ], + [ + 953, + 954 + ], + [ + 957, + 958 + ], + [ + 959, + 962 + ], + [ + 969, + 970 + ], + [ + 972, + 973 + ], + [ + 977, + 982 + ], + [ + 983, + 986 + ], + [ + 987, + 989 + ], + [ + 990, + 993 + ], + [ + 994, + 996 + ], + [ + 997, + 1000 + ], + [ + 1001, + 1003 + ], + [ + 1004, + 1007 + ], + [ + 1008, + 1010 + ], + [ + 1011, + 1014 + ], + [ + 1015, + 1017 + ], + [ + 1018, + 1021 + ], + [ + 1022, + 1024 + ], + [ + 1025, + 1028 + ], + [ + 1029, + 1031 + ], + [ + 1032, + 1035 + ], + [ + 1036, + 1038 + ], + [ + 1039, + 1042 + ], + [ + 1043, + 1045 + ], + [ + 1046, + 1049 + ], + [ + 1050, + 1052 + ], + [ + 1053, + 1054 + ], + [ + 1059, + 1062 + ], + [ + 1063, + 1065 + ], + [ + 1068, + 1069 + ], + [ + 1080, + 1081 + ], + [ + 1085, + 1087 + ], + [ + 1091, + 1092 + ], + [ + 1097, + 1098 + ], + [ + 1099, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1105, + 1106 + ], + [ + 1107, + 1108 + ], + [ + 1110, + 1111 + ], + [ + 1113, + 1114 + ], + [ + 1117, + 1119 + ], + [ + 1122, + 1123 + ], + [ + 1124, + 1127 + ], + [ + 1130, + 1131 + ], + [ + 1132, + 1136 + ], + [ + 1139, + 1140 + ], + [ + 1141, + 1142 + ], + [ + 1144, + 1146 + ], + [ + 1149, + 1150 + ], + [ + 1151, + 1152 + ], + [ + 1153, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1159, + 1161 + ], + [ + 1164, + 1167 + ], + [ + 1170, + 1171 + ], + [ + 1172, + 1173 + ], + [ + 1175, + 1176 + ], + [ + 1177, + 1179 + ], + [ + 1182, + 1183 + ], + [ + 1185, + 1186 + ], + [ + 1188, + 1189 + ], + [ + 1193, + 1194 + ], + [ + 1195, + 1198 + ], + [ + 1203, + 1204 + ], + [ + 1208, + 1214 + ], + [ + 1217, + 1218 + ], + [ + 1244, + 1245 + ], + [ + 1246, + 1247 + ], + [ + 1249, + 1250 + ], + [ + 1258, + 1259 + ], + [ + 1261, + 1262 + ], + [ + 1263, + 1264 + ], + [ + 1269, + 1270 + ], + [ + 1274, + 1278 + ], + [ + 1291, + 1292 + ], + [ + 1296, + 1299 + ], + [ + 1300, + 1301 + ], + [ + 1312, + 1314 + ], + [ + 1318, + 1319 + ], + [ + 1324, + 1325 + ], + [ + 1326, + 1332 + ], + [ + 1333, + 1334 + ], + [ + 1335, + 1336 + ], + [ + 1337, + 1338 + ], + [ + 1340, + 1341 + ], + [ + 1343, + 1344 + ], + [ + 1347, + 1350 + ], + [ + 1353, + 1354 + ], + [ + 1355, + 1359 + ], + [ + 1362, + 1363 + ], + [ + 1364, + 1369 + ], + [ + 1372, + 1373 + ], + [ + 1374, + 1375 + ], + [ + 1377, + 1380 + ], + [ + 1383, + 1384 + ], + [ + 1385, + 1387 + ], + [ + 1389, + 1390 + ], + [ + 1391, + 1392 + ], + [ + 1395, + 1398 + ], + [ + 1401, + 1405 + ], + [ + 1408, + 1409 + ], + [ + 1410, + 1412 + ], + [ + 1414, + 1415 + ], + [ + 1416, + 1419 + ], + [ + 1422, + 1423 + ], + [ + 1425, + 1427 + ], + [ + 1429, + 1430 + ], + [ + 1434, + 1435 + ], + [ + 1436, + 1439 + ], + [ + 1444, + 1445 + ], + [ + 1449, + 1455 + ], + [ + 1456, + 1459 + ], + [ + 1460, + 1462 + ], + [ + 1465, + 1466 + ], + [ + 1499, + 1500 + ], + [ + 1507, + 1508 + ], + [ + 1509, + 1512 + ], + [ + 1513, + 1514 + ], + [ + 1515, + 1516 + ], + [ + 1527, + 1529 + ], + [ + 1533, + 1534 + ], + [ + 1539, + 1540 + ], + [ + 1541, + 1546 + ], + [ + 1547, + 1548 + ], + [ + 1549, + 1550 + ], + [ + 1551, + 1552 + ], + [ + 1554, + 1555 + ], + [ + 1557, + 1558 + ], + [ + 1561, + 1564 + ], + [ + 1567, + 1568 + ], + [ + 1569, + 1573 + ], + [ + 1576, + 1577 + ], + [ + 1578, + 1583 + ], + [ + 1586, + 1587 + ], + [ + 1588, + 1589 + ], + [ + 1591, + 1594 + ], + [ + 1597, + 1598 + ], + [ + 1599, + 1601 + ], + [ + 1603, + 1604 + ], + [ + 1605, + 1606 + ], + [ + 1609, + 1612 + ], + [ + 1615, + 1619 + ], + [ + 1622, + 1623 + ], + [ + 1624, + 1626 + ], + [ + 1628, + 1629 + ], + [ + 1630, + 1633 + ], + [ + 1636, + 1637 + ], + [ + 1639, + 1641 + ], + [ + 1643, + 1644 + ], + [ + 1648, + 1649 + ], + [ + 1650, + 1653 + ], + [ + 1658, + 1659 + ], + [ + 1663, + 1669 + ], + [ + 1670, + 1673 + ], + [ + 1674, + 1676 + ], + [ + 1679, + 1680 + ], + [ + 1712, + 1713 + ], + [ + 1717, + 1720 + ], + [ + 1721, + 1722 + ], + [ + 1732, + 1734 + ], + [ + 1738, + 1739 + ], + [ + 1746, + 1747 + ], + [ + 1748, + 1749 + ], + [ + 1754, + 1755 + ], + [ + 1757, + 1759 + ], + [ + 1763, + 1765 + ], + [ + 1766, + 1767 + ], + [ + 1768, + 1769 + ], + [ + 1772, + 1773 + ], + [ + 1774, + 1777 + ], + [ + 1782, + 1783 + ], + [ + 1787, + 1790 + ], + [ + 1791, + 1792 + ], + [ + 1795, + 1796 + ], + [ + 1818, + 1819 + ], + [ + 1830, + 1831 + ], + [ + 1835, + 1838 + ], + [ + 1839, + 1840 + ] + ] + } + }, + { + "filename": "libvips/resample/transform.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 43, + 65 + ], + [ + 68, + 81 + ], + [ + 84, + 91 + ], + [ + 93, + 121 + ], + [ + 126, + 164 + ], + [ + 166, + 178 + ], + [ + 180, + 197 + ], + [ + 198, + 253 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 46, + 47 + ], + [ + 53, + 54 + ], + [ + 57, + 58 + ], + [ + 59, + 62 + ], + [ + 71, + 72 + ], + [ + 77, + 78 + ], + [ + 87, + 88 + ], + [ + 96, + 97 + ], + [ + 102, + 103 + ], + [ + 104, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 111 + ], + [ + 116, + 118 + ], + [ + 129, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 137 + ], + [ + 138, + 140 + ], + [ + 143, + 145 + ], + [ + 148, + 153 + ], + [ + 155, + 156 + ], + [ + 158, + 161 + ], + [ + 169, + 170 + ], + [ + 172, + 175 + ], + [ + 183, + 185 + ], + [ + 189, + 192 + ], + [ + 193, + 194 + ], + [ + 201, + 209 + ], + [ + 213, + 222 + ], + [ + 228, + 231 + ], + [ + 232, + 233 + ], + [ + 235, + 236 + ], + [ + 239, + 242 + ], + [ + 243, + 244 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ] + ] + } + }, + { + "filename": "test/test_connections.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 47 + ], + [ + 48, + 55 + ], + [ + 62, + 80 + ], + [ + 81, + 105 + ], + [ + 106, + 160 + ] + ], + "lines_added": [ + [ + 12, + 14 + ], + [ + 19, + 20 + ], + [ + 24, + 26 + ], + [ + 27, + 29 + ], + [ + 34, + 36 + ], + [ + 38, + 39 + ], + [ + 42, + 44 + ], + [ + 51, + 52 + ], + [ + 65, + 67 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 75, + 77 + ], + [ + 84, + 85 + ], + [ + 86, + 87 + ], + [ + 90, + 91 + ], + [ + 96, + 97 + ], + [ + 101, + 102 + ], + [ + 109, + 111 + ], + [ + 112, + 114 + ], + [ + 120, + 123 + ], + [ + 125, + 129 + ], + [ + 130, + 135 + ], + [ + 139, + 142 + ], + [ + 144, + 148 + ], + [ + 149, + 152 + ], + [ + 153, + 157 + ], + [ + 158, + 159 + ] + ] + } + }, + { + "filename": "test/test_descriptors.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 36 + ], + [ + 37, + 55 + ], + [ + 56, + 108 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 20, + 22 + ], + [ + 23, + 24 + ], + [ + 26, + 27 + ], + [ + 28, + 29 + ], + [ + 32, + 33 + ], + [ + 40, + 42 + ], + [ + 43, + 45 + ], + [ + 46, + 49 + ], + [ + 51, + 52 + ], + [ + 59, + 69 + ], + [ + 73, + 81 + ], + [ + 85, + 93 + ], + [ + 96, + 100 + ], + [ + 102, + 105 + ], + [ + 106, + 107 + ] + ] + } + }, + { + "filename": "tools/vips.c", + "line_filter": { + "diff_chunks": [ + [ + 51, + 79 + ], + [ + 108, + 535 + ], + [ + 543, + 598 + ], + [ + 599, + 608 + ], + [ + 609, + 631 + ], + [ + 639, + 660 + ], + [ + 663, + 763 + ], + [ + 765, + 786 + ], + [ + 789, + 805 + ], + [ + 809, + 823 + ], + [ + 824, + 853 + ], + [ + 855, + 896 + ] + ], + "lines_added": [ + [ + 54, + 70 + ], + [ + 75, + 76 + ], + [ + 111, + 112 + ], + [ + 113, + 115 + ], + [ + 118, + 124 + ], + [ + 125, + 129 + ], + [ + 130, + 131 + ], + [ + 134, + 135 + ], + [ + 140, + 143 + ], + [ + 144, + 145 + ], + [ + 148, + 150 + ], + [ + 153, + 159 + ], + [ + 160, + 164 + ], + [ + 165, + 166 + ], + [ + 168, + 170 + ], + [ + 172, + 173 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 180, + 186 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 199, + 202 + ], + [ + 205, + 207 + ], + [ + 210, + 212 + ], + [ + 214, + 215 + ], + [ + 218, + 220 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 227, + 231 + ], + [ + 233, + 234 + ], + [ + 235, + 238 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 245, + 246 + ], + [ + 247, + 248 + ], + [ + 250, + 251 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 262 + ], + [ + 265, + 279 + ], + [ + 281, + 283 + ], + [ + 285, + 286 + ], + [ + 289, + 302 + ], + [ + 306, + 307 + ], + [ + 311, + 312 + ], + [ + 316, + 319 + ], + [ + 320, + 321 + ], + [ + 326, + 327 + ], + [ + 331, + 332 + ], + [ + 334, + 336 + ], + [ + 338, + 340 + ], + [ + 342, + 343 + ], + [ + 344, + 347 + ], + [ + 349, + 350 + ], + [ + 353, + 354 + ], + [ + 355, + 358 + ], + [ + 361, + 362 + ], + [ + 363, + 366 + ], + [ + 370, + 371 + ], + [ + 373, + 376 + ], + [ + 377, + 378 + ], + [ + 379, + 385 + ], + [ + 388, + 390 + ], + [ + 391, + 392 + ], + [ + 395, + 396 + ], + [ + 402, + 403 + ], + [ + 406, + 410 + ], + [ + 411, + 412 + ], + [ + 417, + 418 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 427, + 428 + ], + [ + 431, + 434 + ], + [ + 435, + 436 + ], + [ + 440, + 441 + ], + [ + 444, + 445 + ], + [ + 447, + 448 + ], + [ + 454, + 455 + ], + [ + 457, + 458 + ], + [ + 461, + 465 + ], + [ + 468, + 471 + ], + [ + 474, + 479 + ], + [ + 482, + 489 + ], + [ + 493, + 497 + ], + [ + 500, + 503 + ], + [ + 504, + 507 + ], + [ + 508, + 511 + ], + [ + 512, + 515 + ], + [ + 516, + 517 + ], + [ + 518, + 519 + ], + [ + 523, + 524 + ], + [ + 525, + 526 + ], + [ + 531, + 532 + ], + [ + 546, + 547 + ], + [ + 548, + 549 + ], + [ + 552, + 553 + ], + [ + 555, + 556 + ], + [ + 560, + 561 + ], + [ + 563, + 564 + ], + [ + 568, + 571 + ], + [ + 573, + 576 + ], + [ + 578, + 581 + ], + [ + 583, + 586 + ], + [ + 588, + 589 + ], + [ + 594, + 595 + ], + [ + 602, + 605 + ], + [ + 612, + 613 + ], + [ + 616, + 620 + ], + [ + 621, + 622 + ], + [ + 624, + 625 + ], + [ + 627, + 628 + ], + [ + 642, + 644 + ], + [ + 646, + 647 + ], + [ + 648, + 649 + ], + [ + 650, + 652 + ], + [ + 653, + 657 + ], + [ + 666, + 667 + ], + [ + 673, + 674 + ], + [ + 676, + 678 + ], + [ + 684, + 689 + ], + [ + 693, + 694 + ], + [ + 697, + 698 + ], + [ + 700, + 703 + ], + [ + 704, + 705 + ], + [ + 710, + 711 + ], + [ + 713, + 716 + ], + [ + 718, + 721 + ], + [ + 723, + 724 + ], + [ + 729, + 730 + ], + [ + 732, + 733 + ], + [ + 735, + 738 + ], + [ + 740, + 744 + ], + [ + 746, + 749 + ], + [ + 752, + 754 + ], + [ + 758, + 760 + ], + [ + 768, + 769 + ], + [ + 771, + 773 + ], + [ + 774, + 775 + ], + [ + 776, + 778 + ], + [ + 782, + 783 + ], + [ + 792, + 799 + ], + [ + 800, + 802 + ], + [ + 812, + 818 + ], + [ + 819, + 820 + ], + [ + 827, + 829 + ], + [ + 834, + 850 + ], + [ + 858, + 859 + ], + [ + 860, + 861 + ], + [ + 863, + 865 + ], + [ + 871, + 873 + ], + [ + 875, + 878 + ], + [ + 883, + 885 + ], + [ + 886, + 887 + ], + [ + 889, + 890 + ], + [ + 894, + 895 + ] + ] + } + }, + { + "filename": "tools/vipsedit.c", + "line_filter": { + "diff_chunks": [ + [ + 22, + 50 + ], + [ + 84, + 137 + ], + [ + 138, + 159 + ], + [ + 161, + 303 + ] + ], + "lines_added": [ + [ + 25, + 41 + ], + [ + 46, + 47 + ], + [ + 87, + 119 + ], + [ + 123, + 124 + ], + [ + 127, + 130 + ], + [ + 133, + 134 + ], + [ + 141, + 143 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 149, + 151 + ], + [ + 152, + 156 + ], + [ + 164, + 171 + ], + [ + 173, + 176 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 186, + 187 + ], + [ + 189, + 191 + ], + [ + 192, + 195 + ], + [ + 196, + 197 + ], + [ + 199, + 201 + ], + [ + 202, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 213 + ], + [ + 215, + 218 + ], + [ + 219, + 226 + ], + [ + 228, + 231 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 242, + 246 + ], + [ + 249, + 250 + ], + [ + 252, + 255 + ], + [ + 258, + 274 + ], + [ + 277, + 279 + ], + [ + 280, + 281 + ], + [ + 283, + 284 + ], + [ + 286, + 289 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 296, + 297 + ], + [ + 301, + 302 + ] + ] + } + }, + { + "filename": "tools/vipsheader.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 23, + 30 + ], + [ + 44, + 72 + ], + [ + 87, + 174 + ], + [ + 175, + 196 + ], + [ + 198, + 275 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 26, + 27 + ], + [ + 47, + 48 + ], + [ + 49, + 53 + ], + [ + 54, + 63 + ], + [ + 68, + 69 + ], + [ + 90, + 95 + ], + [ + 96, + 98 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 111, + 112 + ], + [ + 115, + 116 + ], + [ + 117, + 120 + ], + [ + 121, + 122 + ], + [ + 123, + 125 + ], + [ + 126, + 127 + ], + [ + 132, + 133 + ], + [ + 134, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 142 + ], + [ + 143, + 145 + ], + [ + 148, + 153 + ], + [ + 155, + 157 + ], + [ + 160, + 164 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 178, + 180 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 186, + 188 + ], + [ + 189, + 193 + ], + [ + 201, + 207 + ], + [ + 209, + 212 + ], + [ + 214, + 217 + ], + [ + 219, + 220 + ], + [ + 222, + 223 + ], + [ + 224, + 226 + ], + [ + 229, + 230 + ], + [ + 232, + 233 + ], + [ + 234, + 236 + ], + [ + 238, + 246 + ], + [ + 248, + 250 + ], + [ + 255, + 257 + ], + [ + 261, + 263 + ], + [ + 268, + 269 + ], + [ + 273, + 274 + ] + ] + } + }, + { + "filename": "tools/vipsthumbnail.c", + "line_filter": { + "diff_chunks": [ + [ + 95, + 102 + ], + [ + 151, + 283 + ], + [ + 285, + 387 + ], + [ + 392, + 399 + ], + [ + 400, + 490 + ], + [ + 491, + 512 + ], + [ + 514, + 569 + ], + [ + 571, + 587 + ] + ], + "lines_added": [ + [ + 98, + 99 + ], + [ + 154, + 223 + ], + [ + 229, + 230 + ], + [ + 232, + 233 + ], + [ + 239, + 240 + ], + [ + 243, + 244 + ], + [ + 246, + 247 + ], + [ + 249, + 251 + ], + [ + 255, + 257 + ], + [ + 260, + 263 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 279, + 280 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ], + [ + 293, + 296 + ], + [ + 300, + 301 + ], + [ + 303, + 306 + ], + [ + 309, + 311 + ], + [ + 313, + 330 + ], + [ + 331, + 332 + ], + [ + 334, + 345 + ], + [ + 348, + 349 + ], + [ + 352, + 354 + ], + [ + 356, + 358 + ], + [ + 359, + 364 + ], + [ + 366, + 367 + ], + [ + 369, + 372 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 383, + 384 + ], + [ + 395, + 396 + ], + [ + 403, + 404 + ], + [ + 405, + 406 + ], + [ + 407, + 409 + ], + [ + 410, + 411 + ], + [ + 414, + 415 + ], + [ + 416, + 417 + ], + [ + 419, + 420 + ], + [ + 423, + 424 + ], + [ + 426, + 427 + ], + [ + 428, + 430 + ], + [ + 431, + 432 + ], + [ + 437, + 438 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 443, + 444 + ], + [ + 445, + 450 + ], + [ + 455, + 456 + ], + [ + 461, + 463 + ], + [ + 464, + 465 + ], + [ + 468, + 469 + ], + [ + 471, + 477 + ], + [ + 478, + 480 + ], + [ + 482, + 483 + ], + [ + 486, + 487 + ], + [ + 494, + 496 + ], + [ + 498, + 499 + ], + [ + 500, + 501 + ], + [ + 502, + 504 + ], + [ + 505, + 509 + ], + [ + 517, + 518 + ], + [ + 519, + 524 + ], + [ + 526, + 529 + ], + [ + 531, + 534 + ], + [ + 536, + 537 + ], + [ + 539, + 540 + ], + [ + 541, + 543 + ], + [ + 544, + 547 + ], + [ + 549, + 553 + ], + [ + 557, + 558 + ], + [ + 560, + 561 + ], + [ + 562, + 566 + ], + [ + 574, + 575 + ], + [ + 580, + 581 + ], + [ + 585, + 586 + ] + ] + } + } +] diff --git a/tests/capture_tools_output/libvips/libvips/expected-result_fe82be-2.json b/tests/capture_tools_output/libvips/libvips/expected-result_fe82be-2.json new file mode 100644 index 0000000..ec33e98 --- /dev/null +++ b/tests/capture_tools_output/libvips/libvips/expected-result_fe82be-2.json @@ -0,0 +1,171565 @@ +[ + { + "filename": "cplusplus/include/vips/VConnection8.h", + "line_filter": { + "diff_chunks": [ + [ + 2, + 30 + ], + [ + 36, + 132 + ], + [ + 133, + 141 + ] + ], + "lines_added": [ + [ + 5, + 21 + ], + [ + 26, + 27 + ], + [ + 39, + 40 + ], + [ + 45, + 46 + ], + [ + 50, + 51 + ], + [ + 57, + 59 + ], + [ + 63, + 65 + ], + [ + 69, + 71 + ], + [ + 75, + 77 + ], + [ + 82, + 84 + ], + [ + 86, + 87 + ], + [ + 91, + 92 + ], + [ + 97, + 98 + ], + [ + 103, + 104 + ], + [ + 108, + 109 + ], + [ + 113, + 114 + ], + [ + 116, + 118 + ], + [ + 122, + 123 + ], + [ + 128, + 129 + ], + [ + 136, + 137 + ] + ] + } + }, + { + "filename": "cplusplus/include/vips/VError8.h", + "line_filter": { + "diff_chunks": [ + [ + 2, + 33 + ], + [ + 39, + 46 + ], + [ + 49, + 78 + ] + ], + "lines_added": [ + [ + 5, + 21 + ], + [ + 26, + 27 + ], + [ + 42, + 43 + ], + [ + 52, + 53 + ], + [ + 54, + 55 + ], + [ + 58, + 59 + ], + [ + 65, + 70 + ], + [ + 74, + 75 + ] + ] + } + }, + { + "filename": "cplusplus/include/vips/VImage8.h", + "line_filter": { + "diff_chunks": [ + [ + 2, + 30 + ], + [ + 43, + 54 + ], + [ + 64, + 74 + ], + [ + 76, + 148 + ], + [ + 149, + 164 + ], + [ + 168, + 188 + ], + [ + 218, + 229 + ], + [ + 232, + 249 + ], + [ + 259, + 293 + ], + [ + 295, + 302 + ], + [ + 303, + 310 + ], + [ + 311, + 318 + ], + [ + 319, + 421 + ], + [ + 423, + 516 + ], + [ + 518, + 525 + ], + [ + 527, + 534 + ], + [ + 536, + 574 + ], + [ + 575, + 585 + ], + [ + 586, + 597 + ], + [ + 599, + 608 + ], + [ + 610, + 629 + ], + [ + 630, + 640 + ], + [ + 643, + 749 + ], + [ + 750, + 765 + ], + [ + 768, + 800 + ], + [ + 801, + 810 + ], + [ + 812, + 858 + ], + [ + 860, + 868 + ], + [ + 870, + 879 + ], + [ + 881, + 890 + ], + [ + 891, + 916 + ], + [ + 919, + 983 + ], + [ + 990, + 1012 + ], + [ + 1013, + 1020 + ], + [ + 1028, + 1059 + ], + [ + 1065, + 1078 + ], + [ + 1079, + 1089 + ], + [ + 1091, + 1100 + ], + [ + 1102, + 1262 + ], + [ + 1264, + 1274 + ], + [ + 1276, + 1286 + ], + [ + 1288, + 1883 + ], + [ + 1885, + 6045 + ] + ], + "lines_added": [ + [ + 5, + 21 + ], + [ + 26, + 27 + ], + [ + 46, + 51 + ], + [ + 67, + 68 + ], + [ + 70, + 71 + ], + [ + 79, + 80 + ], + [ + 82, + 84 + ], + [ + 86, + 92 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 109, + 111 + ], + [ + 113, + 116 + ], + [ + 117, + 119 + ], + [ + 122, + 124 + ], + [ + 126, + 129 + ], + [ + 131, + 135 + ], + [ + 137, + 142 + ], + [ + 144, + 145 + ], + [ + 152, + 154 + ], + [ + 156, + 161 + ], + [ + 171, + 173 + ], + [ + 174, + 175 + ], + [ + 180, + 182 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 235, + 236 + ], + [ + 237, + 238 + ], + [ + 240, + 241 + ], + [ + 245, + 246 + ], + [ + 262, + 263 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 275, + 276 + ], + [ + 281, + 282 + ], + [ + 284, + 285 + ], + [ + 289, + 290 + ], + [ + 298, + 299 + ], + [ + 306, + 307 + ], + [ + 314, + 315 + ], + [ + 322, + 323 + ], + [ + 326, + 327 + ], + [ + 331, + 332 + ], + [ + 337, + 338 + ], + [ + 343, + 344 + ], + [ + 349, + 350 + ], + [ + 352, + 353 + ], + [ + 355, + 356 + ], + [ + 361, + 362 + ], + [ + 368, + 369 + ], + [ + 374, + 376 + ], + [ + 381, + 383 + ], + [ + 386, + 387 + ], + [ + 392, + 393 + ], + [ + 397, + 398 + ], + [ + 400, + 401 + ], + [ + 405, + 406 + ], + [ + 407, + 408 + ], + [ + 410, + 411 + ], + [ + 417, + 418 + ], + [ + 426, + 427 + ], + [ + 429, + 430 + ], + [ + 435, + 436 + ], + [ + 438, + 439 + ], + [ + 444, + 445 + ], + [ + 447, + 448 + ], + [ + 453, + 454 + ], + [ + 456, + 457 + ], + [ + 462, + 463 + ], + [ + 465, + 466 + ], + [ + 471, + 472 + ], + [ + 474, + 475 + ], + [ + 481, + 482 + ], + [ + 484, + 485 + ], + [ + 491, + 492 + ], + [ + 494, + 495 + ], + [ + 500, + 501 + ], + [ + 503, + 504 + ], + [ + 509, + 510 + ], + [ + 512, + 513 + ], + [ + 521, + 522 + ], + [ + 530, + 531 + ], + [ + 539, + 540 + ], + [ + 543, + 545 + ], + [ + 549, + 550 + ], + [ + 555, + 556 + ], + [ + 561, + 562 + ], + [ + 567, + 569 + ], + [ + 570, + 571 + ], + [ + 578, + 580 + ], + [ + 581, + 582 + ], + [ + 589, + 591 + ], + [ + 592, + 594 + ], + [ + 602, + 603 + ], + [ + 604, + 605 + ], + [ + 613, + 614 + ], + [ + 615, + 617 + ], + [ + 622, + 624 + ], + [ + 625, + 626 + ], + [ + 633, + 635 + ], + [ + 636, + 637 + ], + [ + 646, + 649 + ], + [ + 650, + 652 + ], + [ + 658, + 660 + ], + [ + 661, + 662 + ], + [ + 665, + 666 + ], + [ + 669, + 671 + ], + [ + 674, + 676 + ], + [ + 677, + 678 + ], + [ + 682, + 683 + ], + [ + 687, + 688 + ], + [ + 689, + 692 + ], + [ + 695, + 696 + ], + [ + 699, + 701 + ], + [ + 705, + 708 + ], + [ + 709, + 710 + ], + [ + 711, + 712 + ], + [ + 716, + 717 + ], + [ + 721, + 722 + ], + [ + 723, + 726 + ], + [ + 729, + 730 + ], + [ + 734, + 735 + ], + [ + 739, + 742 + ], + [ + 743, + 744 + ], + [ + 745, + 746 + ], + [ + 753, + 755 + ], + [ + 758, + 760 + ], + [ + 761, + 762 + ], + [ + 771, + 772 + ], + [ + 773, + 774 + ], + [ + 775, + 777 + ], + [ + 778, + 779 + ], + [ + 782, + 783 + ], + [ + 788, + 789 + ], + [ + 790, + 791 + ], + [ + 792, + 795 + ], + [ + 796, + 797 + ], + [ + 804, + 805 + ], + [ + 806, + 807 + ], + [ + 815, + 816 + ], + [ + 822, + 825 + ], + [ + 829, + 831 + ], + [ + 836, + 837 + ], + [ + 839, + 840 + ], + [ + 846, + 848 + ], + [ + 851, + 853 + ], + [ + 854, + 855 + ], + [ + 863, + 865 + ], + [ + 873, + 876 + ], + [ + 884, + 887 + ], + [ + 894, + 897 + ], + [ + 902, + 905 + ], + [ + 908, + 911 + ], + [ + 912, + 913 + ], + [ + 922, + 925 + ], + [ + 931, + 932 + ], + [ + 937, + 939 + ], + [ + 942, + 945 + ], + [ + 946, + 947 + ], + [ + 953, + 955 + ], + [ + 960, + 962 + ], + [ + 965, + 968 + ], + [ + 969, + 970 + ], + [ + 976, + 978 + ], + [ + 979, + 980 + ], + [ + 993, + 995 + ], + [ + 999, + 1001 + ], + [ + 1002, + 1003 + ], + [ + 1008, + 1009 + ], + [ + 1016, + 1017 + ], + [ + 1031, + 1033 + ], + [ + 1035, + 1036 + ], + [ + 1040, + 1042 + ], + [ + 1047, + 1048 + ], + [ + 1051, + 1054 + ], + [ + 1055, + 1056 + ], + [ + 1068, + 1069 + ], + [ + 1074, + 1075 + ], + [ + 1082, + 1083 + ], + [ + 1084, + 1086 + ], + [ + 1094, + 1095 + ], + [ + 1096, + 1097 + ], + [ + 1105, + 1106 + ], + [ + 1107, + 1108 + ], + [ + 1111, + 1112 + ], + [ + 1113, + 1114 + ], + [ + 1118, + 1119 + ], + [ + 1125, + 1126 + ], + [ + 1127, + 1128 + ], + [ + 1131, + 1132 + ], + [ + 1135, + 1136 + ], + [ + 1137, + 1138 + ], + [ + 1143, + 1145 + ], + [ + 1149, + 1150 + ], + [ + 1154, + 1155 + ], + [ + 1159, + 1161 + ], + [ + 1162, + 1163 + ], + [ + 1168, + 1170 + ], + [ + 1171, + 1172 + ], + [ + 1177, + 1179 + ], + [ + 1180, + 1181 + ], + [ + 1186, + 1188 + ], + [ + 1189, + 1190 + ], + [ + 1195, + 1197 + ], + [ + 1198, + 1199 + ], + [ + 1203, + 1204 + ], + [ + 1206, + 1208 + ], + [ + 1209, + 1211 + ], + [ + 1215, + 1216 + ], + [ + 1218, + 1220 + ], + [ + 1221, + 1223 + ], + [ + 1228, + 1230 + ], + [ + 1231, + 1232 + ], + [ + 1237, + 1239 + ], + [ + 1240, + 1241 + ], + [ + 1246, + 1248 + ], + [ + 1249, + 1250 + ], + [ + 1255, + 1257 + ], + [ + 1258, + 1259 + ], + [ + 1267, + 1269 + ], + [ + 1270, + 1271 + ], + [ + 1279, + 1281 + ], + [ + 1282, + 1283 + ], + [ + 1291, + 1293 + ], + [ + 1294, + 1295 + ], + [ + 1300, + 1302 + ], + [ + 1303, + 1304 + ], + [ + 1309, + 1311 + ], + [ + 1312, + 1313 + ], + [ + 1318, + 1320 + ], + [ + 1321, + 1322 + ], + [ + 1327, + 1329 + ], + [ + 1330, + 1331 + ], + [ + 1336, + 1338 + ], + [ + 1339, + 1340 + ], + [ + 1345, + 1347 + ], + [ + 1348, + 1349 + ], + [ + 1354, + 1356 + ], + [ + 1357, + 1358 + ], + [ + 1363, + 1365 + ], + [ + 1366, + 1367 + ], + [ + 1372, + 1374 + ], + [ + 1375, + 1376 + ], + [ + 1381, + 1383 + ], + [ + 1384, + 1385 + ], + [ + 1390, + 1392 + ], + [ + 1393, + 1394 + ], + [ + 1399, + 1401 + ], + [ + 1402, + 1403 + ], + [ + 1408, + 1410 + ], + [ + 1411, + 1412 + ], + [ + 1417, + 1419 + ], + [ + 1420, + 1421 + ], + [ + 1426, + 1428 + ], + [ + 1429, + 1430 + ], + [ + 1435, + 1437 + ], + [ + 1438, + 1439 + ], + [ + 1444, + 1446 + ], + [ + 1447, + 1448 + ], + [ + 1451, + 1452 + ], + [ + 1453, + 1455 + ], + [ + 1456, + 1457 + ], + [ + 1460, + 1461 + ], + [ + 1462, + 1464 + ], + [ + 1465, + 1466 + ], + [ + 1471, + 1473 + ], + [ + 1474, + 1475 + ], + [ + 1480, + 1482 + ], + [ + 1483, + 1484 + ], + [ + 1489, + 1491 + ], + [ + 1492, + 1493 + ], + [ + 1498, + 1500 + ], + [ + 1501, + 1503 + ], + [ + 1508, + 1510 + ], + [ + 1511, + 1513 + ], + [ + 1518, + 1520 + ], + [ + 1521, + 1522 + ], + [ + 1527, + 1529 + ], + [ + 1530, + 1532 + ], + [ + 1537, + 1539 + ], + [ + 1540, + 1542 + ], + [ + 1543, + 1544 + ], + [ + 1547, + 1549 + ], + [ + 1550, + 1551 + ], + [ + 1556, + 1558 + ], + [ + 1559, + 1561 + ], + [ + 1566, + 1568 + ], + [ + 1569, + 1571 + ], + [ + 1577, + 1580 + ], + [ + 1581, + 1582 + ], + [ + 1588, + 1591 + ], + [ + 1592, + 1593 + ], + [ + 1599, + 1602 + ], + [ + 1603, + 1605 + ], + [ + 1611, + 1613 + ], + [ + 1614, + 1615 + ], + [ + 1621, + 1623 + ], + [ + 1624, + 1625 + ], + [ + 1631, + 1633 + ], + [ + 1634, + 1636 + ], + [ + 1640, + 1880 + ], + [ + 1888, + 1889 + ], + [ + 1892, + 1894 + ], + [ + 1895, + 1901 + ], + [ + 1902, + 1908 + ], + [ + 1909, + 1915 + ], + [ + 1916, + 1922 + ], + [ + 1923, + 1929 + ], + [ + 1930, + 1936 + ], + [ + 1937, + 1943 + ], + [ + 1944, + 1950 + ], + [ + 1951, + 1961 + ], + [ + 1962, + 1968 + ], + [ + 1969, + 1975 + ], + [ + 1976, + 1982 + ], + [ + 1983, + 1989 + ], + [ + 1990, + 1996 + ], + [ + 1997, + 2003 + ], + [ + 2004, + 2014 + ], + [ + 2015, + 2021 + ], + [ + 2022, + 2028 + ], + [ + 2029, + 2035 + ], + [ + 2036, + 2042 + ], + [ + 2043, + 2050 + ], + [ + 2051, + 2070 + ], + [ + 2071, + 2084 + ], + [ + 2085, + 2102 + ], + [ + 2103, + 2109 + ], + [ + 2110, + 2116 + ], + [ + 2117, + 2124 + ], + [ + 2125, + 2135 + ], + [ + 2136, + 2143 + ], + [ + 2144, + 2151 + ], + [ + 2152, + 2158 + ], + [ + 2159, + 2170 + ], + [ + 2171, + 2181 + ], + [ + 2182, + 2194 + ], + [ + 2195, + 2203 + ], + [ + 2204, + 2212 + ], + [ + 2213, + 2219 + ], + [ + 2220, + 2226 + ], + [ + 2227, + 2239 + ], + [ + 2240, + 2251 + ], + [ + 2252, + 2259 + ], + [ + 2260, + 2271 + ], + [ + 2272, + 2283 + ], + [ + 2284, + 2300 + ], + [ + 2301, + 2308 + ], + [ + 2309, + 2317 + ], + [ + 2318, + 2325 + ], + [ + 2326, + 2333 + ], + [ + 2334, + 2349 + ], + [ + 2350, + 2365 + ], + [ + 2366, + 2379 + ], + [ + 2380, + 2392 + ], + [ + 2393, + 2404 + ], + [ + 2405, + 2412 + ], + [ + 2413, + 2420 + ], + [ + 2421, + 2434 + ], + [ + 2435, + 2454 + ], + [ + 2455, + 2462 + ], + [ + 2463, + 2473 + ], + [ + 2474, + 2491 + ], + [ + 2492, + 2509 + ], + [ + 2510, + 2523 + ], + [ + 2524, + 2537 + ], + [ + 2538, + 2545 + ], + [ + 2546, + 2553 + ], + [ + 2554, + 2561 + ], + [ + 2562, + 2568 + ], + [ + 2569, + 2576 + ], + [ + 2577, + 2590 + ], + [ + 2591, + 2604 + ], + [ + 2605, + 2617 + ], + [ + 2618, + 2628 + ], + [ + 2629, + 2638 + ], + [ + 2639, + 2653 + ], + [ + 2654, + 2663 + ], + [ + 2664, + 2690 + ], + [ + 2691, + 2717 + ], + [ + 2718, + 2744 + ], + [ + 2745, + 2760 + ], + [ + 2761, + 2771 + ], + [ + 2772, + 2783 + ], + [ + 2784, + 2797 + ], + [ + 2798, + 2804 + ], + [ + 2805, + 2812 + ], + [ + 2813, + 2819 + ], + [ + 2820, + 2834 + ], + [ + 2835, + 2848 + ], + [ + 2849, + 2862 + ], + [ + 2863, + 2875 + ], + [ + 2876, + 2887 + ], + [ + 2888, + 2895 + ], + [ + 2896, + 2902 + ], + [ + 2903, + 2912 + ], + [ + 2913, + 2920 + ], + [ + 2921, + 2927 + ], + [ + 2928, + 2938 + ], + [ + 2939, + 2951 + ], + [ + 2952, + 2965 + ], + [ + 2966, + 2980 + ], + [ + 2981, + 2989 + ], + [ + 2990, + 3005 + ], + [ + 3006, + 3021 + ], + [ + 3022, + 3037 + ], + [ + 3038, + 3056 + ], + [ + 3057, + 3075 + ], + [ + 3076, + 3094 + ], + [ + 3095, + 3106 + ], + [ + 3107, + 3121 + ], + [ + 3122, + 3134 + ], + [ + 3135, + 3144 + ], + [ + 3145, + 3162 + ], + [ + 3163, + 3180 + ], + [ + 3181, + 3198 + ], + [ + 3199, + 3217 + ], + [ + 3218, + 3236 + ], + [ + 3237, + 3255 + ], + [ + 3256, + 3262 + ], + [ + 3263, + 3269 + ], + [ + 3270, + 3280 + ], + [ + 3281, + 3291 + ], + [ + 3292, + 3303 + ], + [ + 3304, + 3314 + ], + [ + 3315, + 3321 + ], + [ + 3322, + 3334 + ], + [ + 3335, + 3342 + ], + [ + 3343, + 3349 + ], + [ + 3350, + 3356 + ], + [ + 3357, + 3369 + ], + [ + 3370, + 3381 + ], + [ + 3382, + 3396 + ], + [ + 3397, + 3411 + ], + [ + 3412, + 3428 + ], + [ + 3429, + 3441 + ], + [ + 3442, + 3454 + ], + [ + 3455, + 3469 + ], + [ + 3470, + 3476 + ], + [ + 3477, + 3487 + ], + [ + 3488, + 3498 + ], + [ + 3499, + 3514 + ], + [ + 3515, + 3529 + ], + [ + 3530, + 3544 + ], + [ + 3545, + 3559 + ], + [ + 3560, + 3577 + ], + [ + 3578, + 3595 + ], + [ + 3596, + 3613 + ], + [ + 3614, + 3629 + ], + [ + 3630, + 3645 + ], + [ + 3646, + 3661 + ], + [ + 3662, + 3684 + ], + [ + 3685, + 3707 + ], + [ + 3708, + 3729 + ], + [ + 3730, + 3752 + ], + [ + 3753, + 3766 + ], + [ + 3767, + 3780 + ], + [ + 3781, + 3794 + ], + [ + 3795, + 3812 + ], + [ + 3813, + 3830 + ], + [ + 3831, + 3848 + ], + [ + 3849, + 3855 + ], + [ + 3856, + 3868 + ], + [ + 3869, + 3882 + ], + [ + 3883, + 3896 + ], + [ + 3897, + 3913 + ], + [ + 3914, + 3930 + ], + [ + 3931, + 3948 + ], + [ + 3949, + 3966 + ], + [ + 3967, + 3981 + ], + [ + 3982, + 3993 + ], + [ + 3994, + 4012 + ], + [ + 4013, + 4033 + ], + [ + 4034, + 4053 + ], + [ + 4054, + 4070 + ], + [ + 4071, + 4088 + ], + [ + 4089, + 4108 + ], + [ + 4109, + 4127 + ], + [ + 4128, + 4144 + ], + [ + 4145, + 4163 + ], + [ + 4164, + 4181 + ], + [ + 4182, + 4204 + ], + [ + 4205, + 4212 + ], + [ + 4213, + 4221 + ], + [ + 4222, + 4230 + ], + [ + 4231, + 4244 + ], + [ + 4245, + 4251 + ], + [ + 4252, + 4265 + ], + [ + 4266, + 4279 + ], + [ + 4280, + 4291 + ], + [ + 4292, + 4304 + ], + [ + 4305, + 4317 + ], + [ + 4318, + 4328 + ], + [ + 4329, + 4344 + ], + [ + 4345, + 4359 + ], + [ + 4360, + 4370 + ], + [ + 4371, + 4379 + ], + [ + 4380, + 4399 + ], + [ + 4400, + 4435 + ], + [ + 4436, + 4443 + ], + [ + 4444, + 4457 + ], + [ + 4458, + 4471 + ], + [ + 4472, + 4484 + ], + [ + 4485, + 4498 + ], + [ + 4499, + 4516 + ], + [ + 4517, + 4534 + ], + [ + 4535, + 4554 + ], + [ + 4555, + 4574 + ], + [ + 4575, + 4594 + ], + [ + 4595, + 4602 + ], + [ + 4603, + 4617 + ], + [ + 4618, + 4625 + ], + [ + 4626, + 4640 + ], + [ + 4641, + 4655 + ], + [ + 4656, + 4670 + ], + [ + 4671, + 4692 + ], + [ + 4693, + 4714 + ], + [ + 4715, + 4736 + ], + [ + 4737, + 4750 + ], + [ + 4751, + 4764 + ], + [ + 4765, + 4780 + ], + [ + 4781, + 4796 + ], + [ + 4797, + 4807 + ], + [ + 4808, + 4815 + ], + [ + 4816, + 4823 + ], + [ + 4824, + 4831 + ], + [ + 4832, + 4843 + ], + [ + 4844, + 4850 + ], + [ + 4851, + 4864 + ], + [ + 4865, + 4878 + ], + [ + 4879, + 4892 + ], + [ + 4893, + 4905 + ], + [ + 4906, + 4918 + ], + [ + 4919, + 4931 + ], + [ + 4932, + 4941 + ], + [ + 4942, + 4961 + ], + [ + 4962, + 4974 + ], + [ + 4975, + 4987 + ], + [ + 4988, + 4995 + ], + [ + 4996, + 5009 + ], + [ + 5010, + 5022 + ], + [ + 5023, + 5035 + ], + [ + 5036, + 5044 + ], + [ + 5045, + 5053 + ], + [ + 5054, + 5061 + ], + [ + 5062, + 5069 + ], + [ + 5070, + 5078 + ], + [ + 5079, + 5092 + ], + [ + 5093, + 5100 + ], + [ + 5101, + 5111 + ], + [ + 5112, + 5128 + ], + [ + 5129, + 5136 + ], + [ + 5137, + 5143 + ], + [ + 5144, + 5150 + ], + [ + 5151, + 5161 + ], + [ + 5162, + 5168 + ], + [ + 5169, + 5179 + ], + [ + 5180, + 5191 + ], + [ + 5192, + 5202 + ], + [ + 5203, + 5218 + ], + [ + 5219, + 5231 + ], + [ + 5232, + 5243 + ], + [ + 5244, + 5255 + ], + [ + 5256, + 5262 + ], + [ + 5263, + 5280 + ], + [ + 5281, + 5295 + ], + [ + 5296, + 5308 + ], + [ + 5309, + 5315 + ], + [ + 5316, + 5323 + ], + [ + 5324, + 5330 + ], + [ + 5331, + 5337 + ], + [ + 5338, + 5353 + ], + [ + 5354, + 5366 + ], + [ + 5367, + 5374 + ], + [ + 5375, + 5382 + ], + [ + 5383, + 5399 + ], + [ + 5400, + 5416 + ], + [ + 5417, + 5433 + ], + [ + 5434, + 5441 + ], + [ + 5442, + 5454 + ], + [ + 5455, + 5474 + ], + [ + 5475, + 5495 + ], + [ + 5496, + 5517 + ], + [ + 5518, + 5537 + ], + [ + 5538, + 5559 + ], + [ + 5560, + 5577 + ], + [ + 5578, + 5595 + ], + [ + 5596, + 5613 + ], + [ + 5614, + 5647 + ], + [ + 5648, + 5681 + ], + [ + 5682, + 5715 + ], + [ + 5716, + 5731 + ], + [ + 5732, + 5751 + ], + [ + 5752, + 5762 + ], + [ + 5763, + 5774 + ], + [ + 5775, + 5788 + ], + [ + 5789, + 5802 + ], + [ + 5803, + 5815 + ], + [ + 5816, + 5828 + ], + [ + 5829, + 5845 + ], + [ + 5846, + 5862 + ], + [ + 5863, + 5879 + ], + [ + 5880, + 5904 + ], + [ + 5905, + 5929 + ], + [ + 5930, + 5954 + ], + [ + 5955, + 5979 + ], + [ + 5980, + 5993 + ], + [ + 5994, + 6005 + ], + [ + 6006, + 6020 + ], + [ + 6021, + 6042 + ] + ] + } + }, + { + "filename": "cplusplus/include/vips/VInterpolate8.h", + "line_filter": { + "diff_chunks": [ + [ + 2, + 30 + ], + [ + 34, + 63 + ], + [ + 64, + 72 + ] + ], + "lines_added": [ + [ + 5, + 21 + ], + [ + 26, + 27 + ], + [ + 37, + 38 + ], + [ + 42, + 43 + ], + [ + 45, + 46 + ], + [ + 52, + 53 + ], + [ + 59, + 60 + ], + [ + 67, + 68 + ] + ] + } + }, + { + "filename": "cplusplus/include/vips/VRegion8.h", + "line_filter": { + "diff_chunks": [ + [ + 2, + 30 + ], + [ + 37, + 51 + ], + [ + 52, + 59 + ], + [ + 67, + 76 + ], + [ + 77, + 88 + ], + [ + 99, + 124 + ], + [ + 126, + 151 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 7, + 11 + ], + [ + 12, + 16 + ], + [ + 17, + 21 + ], + [ + 26, + 27 + ], + [ + 40, + 41 + ], + [ + 47, + 48 + ], + [ + 55, + 56 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 80, + 81 + ], + [ + 84, + 85 + ], + [ + 102, + 103 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 129, + 130 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ] + ] + } + }, + { + "filename": "examples/annotate-animated.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 28 + ], + [ + 32, + 106 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 17, + 18 + ], + [ + 20, + 21 + ], + [ + 22, + 23 + ], + [ + 24, + 25 + ], + [ + 35, + 39 + ], + [ + 42, + 47 + ], + [ + 49, + 51 + ], + [ + 54, + 58 + ], + [ + 61, + 65 + ], + [ + 66, + 67 + ], + [ + 69, + 71 + ], + [ + 76, + 78 + ], + [ + 79, + 81 + ], + [ + 82, + 86 + ], + [ + 87, + 92 + ], + [ + 93, + 95 + ], + [ + 97, + 100 + ], + [ + 102, + 103 + ], + [ + 104, + 105 + ] + ] + } + }, + { + "filename": "examples/new-from-buffer.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 8, + 55 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 11, + 13 + ], + [ + 18, + 20 + ], + [ + 21, + 23 + ], + [ + 24, + 26 + ], + [ + 27, + 28 + ], + [ + 32, + 33 + ], + [ + 34, + 38 + ], + [ + 39, + 44 + ], + [ + 45, + 47 + ], + [ + 49, + 50 + ], + [ + 53, + 54 + ] + ] + } + }, + { + "filename": "examples/progress-cancel.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 78 + ] + ], + "lines_added": [ + [ + 12, + 14 + ], + [ + 15, + 16 + ], + [ + 18, + 20 + ], + [ + 21, + 22 + ], + [ + 23, + 26 + ], + [ + 29, + 31 + ], + [ + 32, + 34 + ], + [ + 36, + 38 + ], + [ + 44, + 46 + ], + [ + 47, + 49 + ], + [ + 50, + 54 + ], + [ + 55, + 57 + ], + [ + 58, + 65 + ], + [ + 67, + 70 + ], + [ + 71, + 75 + ] + ] + } + }, + { + "filename": "examples/use-vips-func.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 44 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 14 + ], + [ + 15, + 17 + ], + [ + 18, + 20 + ], + [ + 21, + 23 + ], + [ + 24, + 25 + ], + [ + 26, + 28 + ], + [ + 29, + 30 + ], + [ + 31, + 34 + ], + [ + 35, + 36 + ], + [ + 37, + 39 + ], + [ + 40, + 43 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/abs.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 26, + 61 + ], + [ + 78, + 245 + ], + [ + 267, + 317 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 29, + 30 + ], + [ + 36, + 37 + ], + [ + 38, + 42 + ], + [ + 43, + 47 + ], + [ + 48, + 52 + ], + [ + 57, + 58 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 95 + ], + [ + 96, + 98 + ], + [ + 99, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 105 + ], + [ + 108, + 109 + ], + [ + 114, + 115 + ], + [ + 116, + 119 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 128, + 137 + ], + [ + 140, + 149 + ], + [ + 155, + 166 + ], + [ + 169, + 193 + ], + [ + 194, + 195 + ], + [ + 199, + 201 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 209, + 211 + ], + [ + 213, + 216 + ], + [ + 217, + 218 + ], + [ + 220, + 242 + ], + [ + 270, + 271 + ], + [ + 273, + 274 + ], + [ + 276, + 277 + ], + [ + 281, + 282 + ], + [ + 285, + 286 + ], + [ + 289, + 290 + ], + [ + 295, + 300 + ], + [ + 306, + 307 + ], + [ + 311, + 314 + ], + [ + 315, + 316 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/add.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 42, + 70 + ], + [ + 87, + 149 + ], + [ + 171, + 215 + ], + [ + 276, + 290 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 45, + 46 + ], + [ + 47, + 51 + ], + [ + 52, + 56 + ], + [ + 57, + 61 + ], + [ + 66, + 67 + ], + [ + 90, + 91 + ], + [ + 92, + 101 + ], + [ + 103, + 104 + ], + [ + 109, + 111 + ], + [ + 114, + 115 + ], + [ + 117, + 146 + ], + [ + 174, + 175 + ], + [ + 177, + 178 + ], + [ + 180, + 181 + ], + [ + 184, + 185 + ], + [ + 188, + 189 + ], + [ + 194, + 196 + ], + [ + 199, + 200 + ], + [ + 204, + 206 + ], + [ + 209, + 212 + ], + [ + 279, + 280 + ], + [ + 284, + 287 + ], + [ + 288, + 289 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/arithmetic.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 55, + 62 + ], + [ + 63, + 88 + ], + [ + 97, + 106 + ], + [ + 255, + 269 + ], + [ + 281, + 429 + ], + [ + 431, + 469 + ], + [ + 470, + 488 + ], + [ + 489, + 507 + ], + [ + 508, + 521 + ], + [ + 533, + 560 + ], + [ + 561, + 569 + ], + [ + 570, + 651 + ], + [ + 653, + 775 + ], + [ + 778, + 830 + ], + [ + 831, + 877 + ], + [ + 887, + 914 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 31 + ], + [ + 36, + 37 + ], + [ + 58, + 59 + ], + [ + 66, + 68 + ], + [ + 70, + 72 + ], + [ + 75, + 77 + ], + [ + 82, + 85 + ], + [ + 100, + 103 + ], + [ + 258, + 262 + ], + [ + 265, + 266 + ], + [ + 284, + 291 + ], + [ + 296, + 297 + ], + [ + 298, + 303 + ], + [ + 304, + 305 + ], + [ + 306, + 311 + ], + [ + 312, + 313 + ], + [ + 314, + 316 + ], + [ + 319, + 320 + ], + [ + 324, + 325 + ], + [ + 327, + 329 + ], + [ + 330, + 332 + ], + [ + 336, + 337 + ], + [ + 339, + 341 + ], + [ + 343, + 344 + ], + [ + 347, + 348 + ], + [ + 353, + 354 + ], + [ + 357, + 360 + ], + [ + 362, + 365 + ], + [ + 369, + 370 + ], + [ + 372, + 375 + ], + [ + 377, + 378 + ], + [ + 383, + 384 + ], + [ + 389, + 394 + ], + [ + 395, + 399 + ], + [ + 401, + 404 + ], + [ + 405, + 407 + ], + [ + 408, + 409 + ], + [ + 411, + 412 + ], + [ + 418, + 420 + ], + [ + 425, + 426 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 444, + 447 + ], + [ + 450, + 451 + ], + [ + 453, + 455 + ], + [ + 456, + 457 + ], + [ + 460, + 461 + ], + [ + 464, + 466 + ], + [ + 473, + 475 + ], + [ + 479, + 480 + ], + [ + 483, + 485 + ], + [ + 492, + 494 + ], + [ + 498, + 499 + ], + [ + 502, + 504 + ], + [ + 511, + 513 + ], + [ + 517, + 518 + ], + [ + 536, + 537 + ], + [ + 540, + 541 + ], + [ + 543, + 546 + ], + [ + 548, + 549 + ], + [ + 550, + 551 + ], + [ + 552, + 553 + ], + [ + 556, + 557 + ], + [ + 564, + 566 + ], + [ + 573, + 574 + ], + [ + 578, + 581 + ], + [ + 585, + 589 + ], + [ + 594, + 597 + ], + [ + 599, + 600 + ], + [ + 603, + 605 + ], + [ + 608, + 611 + ], + [ + 617, + 622 + ], + [ + 623, + 624 + ], + [ + 625, + 626 + ], + [ + 627, + 629 + ], + [ + 630, + 633 + ], + [ + 635, + 636 + ], + [ + 637, + 638 + ], + [ + 639, + 640 + ], + [ + 643, + 644 + ], + [ + 645, + 648 + ], + [ + 656, + 659 + ], + [ + 661, + 663 + ], + [ + 664, + 665 + ], + [ + 666, + 674 + ], + [ + 677, + 680 + ], + [ + 683, + 688 + ], + [ + 693, + 696 + ], + [ + 698, + 699 + ], + [ + 701, + 702 + ], + [ + 704, + 710 + ], + [ + 711, + 712 + ], + [ + 715, + 716 + ], + [ + 717, + 720 + ], + [ + 725, + 726 + ], + [ + 730, + 735 + ], + [ + 738, + 739 + ], + [ + 744, + 747 + ], + [ + 748, + 749 + ], + [ + 753, + 755 + ], + [ + 758, + 759 + ], + [ + 760, + 763 + ], + [ + 766, + 767 + ], + [ + 768, + 772 + ], + [ + 781, + 782 + ], + [ + 783, + 785 + ], + [ + 788, + 789 + ], + [ + 794, + 795 + ], + [ + 796, + 797 + ], + [ + 798, + 801 + ], + [ + 802, + 803 + ], + [ + 806, + 807 + ], + [ + 810, + 811 + ], + [ + 812, + 815 + ], + [ + 821, + 827 + ], + [ + 834, + 835 + ], + [ + 836, + 874 + ], + [ + 890, + 897 + ], + [ + 901, + 902 + ], + [ + 903, + 913 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/avg.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 18, + 25 + ], + [ + 38, + 66 + ], + [ + 86, + 169 + ], + [ + 171, + 259 + ], + [ + 260, + 274 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 21, + 22 + ], + [ + 41, + 42 + ], + [ + 43, + 47 + ], + [ + 48, + 57 + ], + [ + 62, + 63 + ], + [ + 89, + 90 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 100, + 102 + ], + [ + 103, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 111 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 125, + 126 + ], + [ + 132, + 133 + ], + [ + 134, + 135 + ], + [ + 139, + 146 + ], + [ + 147, + 158 + ], + [ + 162, + 164 + ], + [ + 165, + 166 + ], + [ + 174, + 175 + ], + [ + 176, + 209 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 228, + 229 + ], + [ + 235, + 238 + ], + [ + 239, + 241 + ], + [ + 244, + 245 + ], + [ + 254, + 256 + ], + [ + 263, + 264 + ], + [ + 268, + 271 + ], + [ + 272, + 273 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/binary.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 52, + 113 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 29 + ], + [ + 34, + 35 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 60, + 62 + ], + [ + 64, + 65 + ], + [ + 68, + 72 + ], + [ + 73, + 75 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 82, + 84 + ], + [ + 89, + 90 + ], + [ + 95, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 104 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/binary.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 40, + 56 + ], + [ + 63, + 73 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 43, + 53 + ], + [ + 66, + 67 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/boolean.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 22, + 29 + ], + [ + 35, + 63 + ], + [ + 87, + 234 + ], + [ + 248, + 255 + ], + [ + 256, + 299 + ], + [ + 303, + 310 + ], + [ + 312, + 325 + ], + [ + 326, + 343 + ], + [ + 352, + 369 + ], + [ + 378, + 395 + ], + [ + 404, + 421 + ], + [ + 430, + 447 + ], + [ + 456, + 473 + ], + [ + 477, + 527 + ], + [ + 529, + 554 + ], + [ + 556, + 614 + ], + [ + 622, + 633 + ], + [ + 636, + 653 + ], + [ + 665, + 683 + ], + [ + 695, + 713 + ], + [ + 725, + 743 + ], + [ + 755, + 772 + ], + [ + 784, + 801 + ], + [ + 802, + 809 + ], + [ + 813, + 837 + ], + [ + 841, + 865 + ], + [ + 869, + 893 + ], + [ + 897, + 921 + ], + [ + 925, + 949 + ], + [ + 953, + 968 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 25, + 26 + ], + [ + 38, + 39 + ], + [ + 40, + 44 + ], + [ + 45, + 49 + ], + [ + 50, + 54 + ], + [ + 59, + 60 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 104 + ], + [ + 105, + 107 + ], + [ + 108, + 109 + ], + [ + 111, + 120 + ], + [ + 121, + 130 + ], + [ + 131, + 158 + ], + [ + 160, + 171 + ], + [ + 173, + 175 + ], + [ + 178, + 179 + ], + [ + 182, + 185 + ], + [ + 187, + 189 + ], + [ + 191, + 193 + ], + [ + 197, + 202 + ], + [ + 203, + 205 + ], + [ + 206, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 214 + ], + [ + 215, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 227 + ], + [ + 229, + 231 + ], + [ + 251, + 252 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 269, + 270 + ], + [ + 274, + 275 + ], + [ + 276, + 279 + ], + [ + 280, + 283 + ], + [ + 286, + 287 + ], + [ + 291, + 293 + ], + [ + 294, + 296 + ], + [ + 306, + 307 + ], + [ + 315, + 317 + ], + [ + 320, + 322 + ], + [ + 329, + 331 + ], + [ + 335, + 338 + ], + [ + 339, + 340 + ], + [ + 355, + 356 + ], + [ + 360, + 364 + ], + [ + 365, + 366 + ], + [ + 381, + 382 + ], + [ + 386, + 390 + ], + [ + 391, + 392 + ], + [ + 407, + 408 + ], + [ + 412, + 416 + ], + [ + 417, + 418 + ], + [ + 433, + 434 + ], + [ + 438, + 442 + ], + [ + 443, + 444 + ], + [ + 459, + 460 + ], + [ + 464, + 468 + ], + [ + 469, + 470 + ], + [ + 480, + 482 + ], + [ + 484, + 485 + ], + [ + 486, + 487 + ], + [ + 489, + 492 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 499, + 509 + ], + [ + 510, + 520 + ], + [ + 522, + 524 + ], + [ + 532, + 535 + ], + [ + 537, + 539 + ], + [ + 541, + 543 + ], + [ + 545, + 547 + ], + [ + 549, + 551 + ], + [ + 559, + 560 + ], + [ + 561, + 562 + ], + [ + 563, + 564 + ], + [ + 569, + 571 + ], + [ + 575, + 576 + ], + [ + 577, + 580 + ], + [ + 581, + 584 + ], + [ + 587, + 588 + ], + [ + 592, + 594 + ], + [ + 596, + 597 + ], + [ + 600, + 601 + ], + [ + 602, + 603 + ], + [ + 605, + 607 + ], + [ + 608, + 609 + ], + [ + 610, + 611 + ], + [ + 625, + 626 + ], + [ + 627, + 630 + ], + [ + 639, + 641 + ], + [ + 645, + 648 + ], + [ + 649, + 650 + ], + [ + 668, + 670 + ], + [ + 674, + 678 + ], + [ + 679, + 680 + ], + [ + 698, + 700 + ], + [ + 704, + 708 + ], + [ + 709, + 710 + ], + [ + 728, + 730 + ], + [ + 734, + 738 + ], + [ + 739, + 740 + ], + [ + 758, + 759 + ], + [ + 763, + 767 + ], + [ + 768, + 769 + ], + [ + 787, + 788 + ], + [ + 792, + 796 + ], + [ + 797, + 798 + ], + [ + 805, + 806 + ], + [ + 816, + 818 + ], + [ + 822, + 825 + ], + [ + 826, + 827 + ], + [ + 833, + 834 + ], + [ + 844, + 845 + ], + [ + 849, + 853 + ], + [ + 854, + 855 + ], + [ + 861, + 862 + ], + [ + 872, + 873 + ], + [ + 877, + 881 + ], + [ + 882, + 883 + ], + [ + 889, + 890 + ], + [ + 900, + 901 + ], + [ + 905, + 909 + ], + [ + 910, + 911 + ], + [ + 917, + 918 + ], + [ + 928, + 929 + ], + [ + 933, + 937 + ], + [ + 938, + 939 + ], + [ + 945, + 946 + ], + [ + 956, + 957 + ], + [ + 961, + 965 + ], + [ + 966, + 967 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/complex.c", + "line_filter": { + "diff_chunks": [ + [ + 27, + 55 + ], + [ + 79, + 167 + ], + [ + 168, + 241 + ], + [ + 260, + 301 + ], + [ + 306, + 328 + ], + [ + 335, + 351 + ], + [ + 358, + 374 + ], + [ + 381, + 397 + ], + [ + 402, + 547 + ], + [ + 567, + 609 + ], + [ + 615, + 638 + ], + [ + 641, + 664 + ], + [ + 669, + 780 + ], + [ + 799, + 842 + ], + [ + 845, + 871 + ], + [ + 878, + 895 + ], + [ + 902, + 1000 + ], + [ + 1009, + 1016 + ], + [ + 1018, + 1059 + ], + [ + 1061, + 1075 + ] + ], + "lines_added": [ + [ + 30, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 46 + ], + [ + 51, + 52 + ], + [ + 82, + 95 + ], + [ + 96, + 108 + ], + [ + 109, + 111 + ], + [ + 112, + 114 + ], + [ + 115, + 117 + ], + [ + 118, + 120 + ], + [ + 121, + 123 + ], + [ + 124, + 126 + ], + [ + 127, + 129 + ], + [ + 130, + 132 + ], + [ + 133, + 135 + ], + [ + 136, + 138 + ], + [ + 139, + 142 + ], + [ + 144, + 145 + ], + [ + 147, + 148 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 159, + 160 + ], + [ + 163, + 164 + ], + [ + 171, + 173 + ], + [ + 175, + 177 + ], + [ + 178, + 179 + ], + [ + 181, + 193 + ], + [ + 194, + 217 + ], + [ + 219, + 221 + ], + [ + 224, + 225 + ], + [ + 228, + 238 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 273, + 275 + ], + [ + 278, + 279 + ], + [ + 280, + 283 + ], + [ + 284, + 286 + ], + [ + 289, + 290 + ], + [ + 294, + 296 + ], + [ + 297, + 298 + ], + [ + 309, + 311 + ], + [ + 315, + 316 + ], + [ + 320, + 323 + ], + [ + 324, + 325 + ], + [ + 338, + 339 + ], + [ + 343, + 346 + ], + [ + 347, + 348 + ], + [ + 361, + 362 + ], + [ + 366, + 369 + ], + [ + 370, + 371 + ], + [ + 384, + 385 + ], + [ + 389, + 392 + ], + [ + 393, + 394 + ], + [ + 405, + 419 + ], + [ + 420, + 434 + ], + [ + 435, + 437 + ], + [ + 438, + 440 + ], + [ + 441, + 443 + ], + [ + 444, + 446 + ], + [ + 447, + 449 + ], + [ + 450, + 452 + ], + [ + 453, + 455 + ], + [ + 456, + 458 + ], + [ + 459, + 461 + ], + [ + 462, + 464 + ], + [ + 465, + 468 + ], + [ + 470, + 471 + ], + [ + 472, + 474 + ], + [ + 476, + 477 + ], + [ + 483, + 497 + ], + [ + 500, + 528 + ], + [ + 532, + 534 + ], + [ + 537, + 538 + ], + [ + 541, + 544 + ], + [ + 570, + 571 + ], + [ + 572, + 573 + ], + [ + 574, + 575 + ], + [ + 580, + 582 + ], + [ + 585, + 586 + ], + [ + 587, + 590 + ], + [ + 591, + 594 + ], + [ + 597, + 598 + ], + [ + 602, + 604 + ], + [ + 605, + 606 + ], + [ + 618, + 620 + ], + [ + 624, + 626 + ], + [ + 630, + 633 + ], + [ + 634, + 635 + ], + [ + 644, + 645 + ], + [ + 650, + 651 + ], + [ + 655, + 659 + ], + [ + 660, + 661 + ], + [ + 672, + 673 + ], + [ + 675, + 676 + ], + [ + 680, + 684 + ], + [ + 685, + 687 + ], + [ + 688, + 689 + ], + [ + 691, + 700 + ], + [ + 701, + 712 + ], + [ + 713, + 715 + ], + [ + 716, + 718 + ], + [ + 719, + 721 + ], + [ + 722, + 724 + ], + [ + 725, + 727 + ], + [ + 728, + 730 + ], + [ + 731, + 733 + ], + [ + 734, + 736 + ], + [ + 737, + 739 + ], + [ + 740, + 742 + ], + [ + 743, + 746 + ], + [ + 748, + 749 + ], + [ + 750, + 754 + ], + [ + 755, + 759 + ], + [ + 761, + 763 + ], + [ + 766, + 767 + ], + [ + 770, + 777 + ], + [ + 802, + 803 + ], + [ + 804, + 805 + ], + [ + 806, + 807 + ], + [ + 812, + 813 + ], + [ + 817, + 819 + ], + [ + 820, + 823 + ], + [ + 824, + 827 + ], + [ + 830, + 831 + ], + [ + 835, + 837 + ], + [ + 838, + 839 + ], + [ + 848, + 849 + ], + [ + 851, + 852 + ], + [ + 857, + 859 + ], + [ + 863, + 866 + ], + [ + 867, + 868 + ], + [ + 881, + 882 + ], + [ + 886, + 890 + ], + [ + 891, + 892 + ], + [ + 905, + 906 + ], + [ + 910, + 914 + ], + [ + 915, + 916 + ], + [ + 921, + 922 + ], + [ + 924, + 925 + ], + [ + 926, + 927 + ], + [ + 929, + 935 + ], + [ + 936, + 938 + ], + [ + 939, + 940 + ], + [ + 942, + 955 + ], + [ + 957, + 959 + ], + [ + 961, + 962 + ], + [ + 965, + 966 + ], + [ + 967, + 995 + ], + [ + 996, + 997 + ], + [ + 1012, + 1013 + ], + [ + 1021, + 1022 + ], + [ + 1024, + 1025 + ], + [ + 1027, + 1029 + ], + [ + 1033, + 1035 + ], + [ + 1038, + 1039 + ], + [ + 1044, + 1046 + ], + [ + 1049, + 1052 + ], + [ + 1054, + 1056 + ], + [ + 1064, + 1065 + ], + [ + 1069, + 1072 + ], + [ + 1073, + 1074 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/deviate.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 19, + 26 + ], + [ + 35, + 63 + ], + [ + 84, + 146 + ], + [ + 147, + 175 + ], + [ + 178, + 250 + ], + [ + 253, + 262 + ], + [ + 264, + 278 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 22, + 23 + ], + [ + 38, + 39 + ], + [ + 40, + 44 + ], + [ + 45, + 54 + ], + [ + 59, + 60 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 92, + 94 + ], + [ + 99, + 102 + ], + [ + 103, + 105 + ], + [ + 107, + 110 + ], + [ + 116, + 120 + ], + [ + 123, + 126 + ], + [ + 127, + 128 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 142, + 143 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 155, + 166 + ], + [ + 168, + 170 + ], + [ + 171, + 172 + ], + [ + 181, + 182 + ], + [ + 183, + 210 + ], + [ + 216, + 217 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 230, + 231 + ], + [ + 237, + 240 + ], + [ + 241, + 243 + ], + [ + 246, + 247 + ], + [ + 256, + 259 + ], + [ + 267, + 268 + ], + [ + 272, + 275 + ], + [ + 276, + 277 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/divide.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 25, + 34 + ], + [ + 37, + 65 + ], + [ + 82, + 221 + ], + [ + 230, + 237 + ], + [ + 239, + 267 + ], + [ + 270, + 284 + ], + [ + 342, + 356 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 28, + 29 + ], + [ + 30, + 31 + ], + [ + 40, + 41 + ], + [ + 42, + 46 + ], + [ + 47, + 51 + ], + [ + 52, + 56 + ], + [ + 61, + 62 + ], + [ + 85, + 86 + ], + [ + 92, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 154 + ], + [ + 155, + 156 + ], + [ + 161, + 170 + ], + [ + 172, + 174 + ], + [ + 176, + 177 + ], + [ + 180, + 181 + ], + [ + 182, + 216 + ], + [ + 217, + 218 + ], + [ + 233, + 234 + ], + [ + 242, + 243 + ], + [ + 245, + 246 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 256, + 257 + ], + [ + 262, + 264 + ], + [ + 273, + 275 + ], + [ + 278, + 281 + ], + [ + 345, + 346 + ], + [ + 350, + 353 + ], + [ + 354, + 355 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/find_trim.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 37 + ], + [ + 64, + 77 + ], + [ + 83, + 172 + ], + [ + 174, + 239 + ], + [ + 249, + 258 + ], + [ + 261, + 290 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 28 + ], + [ + 33, + 34 + ], + [ + 67, + 68 + ], + [ + 70, + 71 + ], + [ + 73, + 74 + ], + [ + 86, + 88 + ], + [ + 89, + 90 + ], + [ + 92, + 98 + ], + [ + 100, + 101 + ], + [ + 103, + 108 + ], + [ + 113, + 118 + ], + [ + 124, + 130 + ], + [ + 132, + 133 + ], + [ + 134, + 136 + ], + [ + 139, + 146 + ], + [ + 149, + 158 + ], + [ + 160, + 163 + ], + [ + 164, + 165 + ], + [ + 168, + 169 + ], + [ + 177, + 178 + ], + [ + 180, + 181 + ], + [ + 182, + 185 + ], + [ + 186, + 187 + ], + [ + 188, + 191 + ], + [ + 192, + 194 + ], + [ + 195, + 198 + ], + [ + 199, + 201 + ], + [ + 202, + 205 + ], + [ + 206, + 208 + ], + [ + 209, + 212 + ], + [ + 213, + 215 + ], + [ + 216, + 219 + ], + [ + 220, + 222 + ], + [ + 223, + 226 + ], + [ + 227, + 229 + ], + [ + 232, + 233 + ], + [ + 235, + 236 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ], + [ + 264, + 265 + ], + [ + 268, + 269 + ], + [ + 270, + 271 + ], + [ + 277, + 279 + ], + [ + 283, + 287 + ], + [ + 288, + 289 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/getpoint.c", + "line_filter": { + "diff_chunks": [ + [ + 27, + 55 + ], + [ + 83, + 133 + ], + [ + 135, + 174 + ], + [ + 180, + 187 + ], + [ + 191, + 220 + ] + ], + "lines_added": [ + [ + 30, + 46 + ], + [ + 51, + 52 + ], + [ + 86, + 87 + ], + [ + 89, + 90 + ], + [ + 92, + 93 + ], + [ + 97, + 99 + ], + [ + 102, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 114 + ], + [ + 115, + 118 + ], + [ + 119, + 121 + ], + [ + 122, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 138, + 139 + ], + [ + 141, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 153 + ], + [ + 154, + 157 + ], + [ + 158, + 160 + ], + [ + 161, + 164 + ], + [ + 165, + 167 + ], + [ + 170, + 171 + ], + [ + 183, + 184 + ], + [ + 194, + 195 + ], + [ + 201, + 204 + ], + [ + 205, + 207 + ], + [ + 208, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hist_find.c", + "line_filter": { + "diff_chunks": [ + [ + 32, + 60 + ], + [ + 71, + 82 + ], + [ + 91, + 98 + ], + [ + 102, + 131 + ], + [ + 132, + 389 + ], + [ + 391, + 398 + ], + [ + 407, + 424 + ], + [ + 425, + 447 + ], + [ + 456, + 464 + ], + [ + 467, + 481 + ] + ], + "lines_added": [ + [ + 35, + 51 + ], + [ + 56, + 57 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 94, + 95 + ], + [ + 105, + 106 + ], + [ + 110, + 111 + ], + [ + 114, + 115 + ], + [ + 119, + 122 + ], + [ + 123, + 128 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 141, + 143 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 152, + 155 + ], + [ + 159, + 162 + ], + [ + 167, + 169 + ], + [ + 172, + 179 + ], + [ + 182, + 202 + ], + [ + 203, + 204 + ], + [ + 205, + 207 + ], + [ + 208, + 209 + ], + [ + 214, + 215 + ], + [ + 220, + 230 + ], + [ + 235, + 236 + ], + [ + 239, + 240 + ], + [ + 243, + 245 + ], + [ + 248, + 264 + ], + [ + 265, + 267 + ], + [ + 270, + 271 + ], + [ + 273, + 274 + ], + [ + 276, + 289 + ], + [ + 290, + 291 + ], + [ + 294, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 320 + ], + [ + 323, + 338 + ], + [ + 339, + 340 + ], + [ + 342, + 344 + ], + [ + 347, + 348 + ], + [ + 352, + 354 + ], + [ + 355, + 357 + ], + [ + 358, + 359 + ], + [ + 363, + 365 + ], + [ + 366, + 367 + ], + [ + 372, + 374 + ], + [ + 375, + 377 + ], + [ + 378, + 379 + ], + [ + 382, + 384 + ], + [ + 385, + 386 + ], + [ + 394, + 395 + ], + [ + 410, + 411 + ], + [ + 414, + 415 + ], + [ + 420, + 421 + ], + [ + 428, + 440 + ], + [ + 443, + 444 + ], + [ + 459, + 461 + ], + [ + 470, + 471 + ], + [ + 475, + 478 + ], + [ + 479, + 480 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hist_find_indexed.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 57, + 69 + ], + [ + 72, + 79 + ], + [ + 80, + 89 + ], + [ + 90, + 125 + ], + [ + 134, + 243 + ], + [ + 244, + 264 + ], + [ + 267, + 337 + ], + [ + 343, + 381 + ], + [ + 382, + 413 + ], + [ + 417, + 491 + ], + [ + 504, + 519 + ], + [ + 522, + 536 + ] + ], + "lines_added": [ + [ + 15, + 31 + ], + [ + 36, + 37 + ], + [ + 60, + 61 + ], + [ + 62, + 66 + ], + [ + 75, + 76 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 93, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 101 + ], + [ + 103, + 105 + ], + [ + 108, + 109 + ], + [ + 113, + 117 + ], + [ + 118, + 120 + ], + [ + 121, + 122 + ], + [ + 137, + 138 + ], + [ + 139, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 147 + ], + [ + 153, + 165 + ], + [ + 169, + 172 + ], + [ + 173, + 175 + ], + [ + 176, + 177 + ], + [ + 178, + 186 + ], + [ + 187, + 190 + ], + [ + 191, + 192 + ], + [ + 195, + 196 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 208 + ], + [ + 209, + 228 + ], + [ + 229, + 230 + ], + [ + 234, + 235 + ], + [ + 238, + 240 + ], + [ + 247, + 248 + ], + [ + 253, + 259 + ], + [ + 260, + 261 + ], + [ + 270, + 271 + ], + [ + 272, + 273 + ], + [ + 277, + 296 + ], + [ + 297, + 298 + ], + [ + 301, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 334 + ], + [ + 346, + 368 + ], + [ + 369, + 370 + ], + [ + 373, + 376 + ], + [ + 377, + 378 + ], + [ + 385, + 410 + ], + [ + 420, + 422 + ], + [ + 424, + 426 + ], + [ + 430, + 431 + ], + [ + 435, + 437 + ], + [ + 438, + 439 + ], + [ + 443, + 444 + ], + [ + 445, + 446 + ], + [ + 449, + 450 + ], + [ + 453, + 454 + ], + [ + 459, + 460 + ], + [ + 466, + 484 + ], + [ + 487, + 488 + ], + [ + 507, + 509 + ], + [ + 510, + 511 + ], + [ + 515, + 516 + ], + [ + 525, + 526 + ], + [ + 530, + 533 + ], + [ + 534, + 535 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hist_find_ndim.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 42 + ], + [ + 59, + 66 + ], + [ + 79, + 99 + ], + [ + 103, + 281 + ], + [ + 291, + 308 + ], + [ + 309, + 331 + ], + [ + 342, + 349 + ], + [ + 352, + 366 + ] + ], + "lines_added": [ + [ + 3, + 5 + ], + [ + 11, + 12 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 62, + 63 + ], + [ + 82, + 83 + ], + [ + 88, + 89 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 106, + 108 + ], + [ + 111, + 126 + ], + [ + 129, + 130 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 145, + 147 + ], + [ + 148, + 152 + ], + [ + 154, + 155 + ], + [ + 156, + 161 + ], + [ + 167, + 169 + ], + [ + 170, + 176 + ], + [ + 177, + 179 + ], + [ + 180, + 183 + ], + [ + 184, + 187 + ], + [ + 189, + 191 + ], + [ + 193, + 194 + ], + [ + 197, + 198 + ], + [ + 203, + 205 + ], + [ + 206, + 207 + ], + [ + 212, + 213 + ], + [ + 216, + 217 + ], + [ + 220, + 225 + ], + [ + 227, + 228 + ], + [ + 233, + 234 + ], + [ + 236, + 247 + ], + [ + 249, + 251 + ], + [ + 257, + 258 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 271 + ], + [ + 274, + 275 + ], + [ + 277, + 278 + ], + [ + 294, + 295 + ], + [ + 298, + 299 + ], + [ + 304, + 305 + ], + [ + 312, + 324 + ], + [ + 327, + 328 + ], + [ + 345, + 346 + ], + [ + 355, + 356 + ], + [ + 360, + 363 + ], + [ + 364, + 365 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hough.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 43, + 151 + ], + [ + 157, + 174 + ], + [ + 175, + 189 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 46, + 47 + ], + [ + 49, + 50 + ], + [ + 51, + 53 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 58, + 64 + ], + [ + 66, + 67 + ], + [ + 70, + 71 + ], + [ + 72, + 74 + ], + [ + 76, + 77 + ], + [ + 81, + 84 + ], + [ + 85, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 93 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 106, + 108 + ], + [ + 109, + 110 + ], + [ + 115, + 116 + ], + [ + 120, + 125 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 133, + 135 + ], + [ + 137, + 138 + ], + [ + 143, + 146 + ], + [ + 147, + 148 + ], + [ + 160, + 161 + ], + [ + 164, + 165 + ], + [ + 170, + 171 + ], + [ + 178, + 183 + ], + [ + 186, + 187 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hough.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 39, + 73 + ], + [ + 76, + 88 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 54 + ], + [ + 59, + 63 + ], + [ + 69, + 70 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hough_circle.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 66, + 79 + ], + [ + 87, + 178 + ], + [ + 181, + 220 + ], + [ + 223, + 263 + ], + [ + 272, + 282 + ], + [ + 292, + 306 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 69, + 70 + ], + [ + 75, + 76 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 101 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 113, + 117 + ], + [ + 123, + 125 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 132, + 133 + ], + [ + 136, + 137 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 147, + 150 + ], + [ + 151, + 152 + ], + [ + 154, + 157 + ], + [ + 158, + 160 + ], + [ + 161, + 163 + ], + [ + 169, + 172 + ], + [ + 173, + 175 + ], + [ + 184, + 185 + ], + [ + 186, + 188 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 204, + 206 + ], + [ + 208, + 209 + ], + [ + 210, + 212 + ], + [ + 216, + 217 + ], + [ + 226, + 227 + ], + [ + 232, + 252 + ], + [ + 255, + 256 + ], + [ + 257, + 260 + ], + [ + 275, + 276 + ], + [ + 278, + 279 + ], + [ + 295, + 296 + ], + [ + 300, + 303 + ], + [ + 304, + 305 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/hough_line.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 49, + 56 + ], + [ + 62, + 113 + ], + [ + 115, + 134 + ], + [ + 137, + 166 + ], + [ + 178, + 203 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 52, + 53 + ], + [ + 65, + 66 + ], + [ + 68, + 69 + ], + [ + 75, + 77 + ], + [ + 80, + 82 + ], + [ + 83, + 85 + ], + [ + 86, + 87 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 118, + 119 + ], + [ + 123, + 125 + ], + [ + 130, + 131 + ], + [ + 140, + 141 + ], + [ + 146, + 159 + ], + [ + 162, + 163 + ], + [ + 181, + 183 + ], + [ + 185, + 186 + ], + [ + 192, + 193 + ], + [ + 197, + 200 + ], + [ + 201, + 202 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/invert.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 49 + ], + [ + 66, + 148 + ], + [ + 169, + 190 + ], + [ + 195, + 202 + ], + [ + 204, + 218 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 24, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 40 + ], + [ + 45, + 46 + ], + [ + 69, + 70 + ], + [ + 71, + 79 + ], + [ + 80, + 88 + ], + [ + 89, + 102 + ], + [ + 104, + 106 + ], + [ + 108, + 109 + ], + [ + 112, + 145 + ], + [ + 172, + 173 + ], + [ + 175, + 176 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 198, + 199 + ], + [ + 207, + 208 + ], + [ + 212, + 215 + ], + [ + 216, + 217 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/linear.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 17 + ], + [ + 49, + 77 + ], + [ + 113, + 126 + ], + [ + 129, + 416 + ], + [ + 433, + 500 + ], + [ + 512, + 523 + ], + [ + 526, + 543 + ], + [ + 551, + 572 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 6, + 7 + ], + [ + 13, + 14 + ], + [ + 52, + 53 + ], + [ + 54, + 58 + ], + [ + 59, + 63 + ], + [ + 64, + 68 + ], + [ + 73, + 74 + ], + [ + 116, + 117 + ], + [ + 119, + 120 + ], + [ + 121, + 123 + ], + [ + 132, + 137 + ], + [ + 139, + 141 + ], + [ + 144, + 152 + ], + [ + 157, + 158 + ], + [ + 162, + 164 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 176, + 178 + ], + [ + 182, + 183 + ], + [ + 188, + 190 + ], + [ + 191, + 193 + ], + [ + 194, + 195 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 207, + 208 + ], + [ + 210, + 212 + ], + [ + 213, + 214 + ], + [ + 218, + 229 + ], + [ + 232, + 241 + ], + [ + 242, + 251 + ], + [ + 252, + 253 + ], + [ + 254, + 267 + ], + [ + 271, + 285 + ], + [ + 288, + 300 + ], + [ + 301, + 310 + ], + [ + 311, + 312 + ], + [ + 313, + 326 + ], + [ + 330, + 332 + ], + [ + 335, + 337 + ], + [ + 341, + 373 + ], + [ + 378, + 409 + ], + [ + 436, + 437 + ], + [ + 438, + 439 + ], + [ + 440, + 441 + ], + [ + 446, + 447 + ], + [ + 451, + 452 + ], + [ + 453, + 456 + ], + [ + 457, + 459 + ], + [ + 460, + 463 + ], + [ + 464, + 466 + ], + [ + 467, + 470 + ], + [ + 471, + 473 + ], + [ + 476, + 477 + ], + [ + 481, + 483 + ], + [ + 488, + 490 + ], + [ + 491, + 492 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 515, + 516 + ], + [ + 517, + 520 + ], + [ + 529, + 531 + ], + [ + 535, + 538 + ], + [ + 539, + 540 + ], + [ + 554, + 555 + ], + [ + 561, + 562 + ], + [ + 566, + 569 + ], + [ + 570, + 571 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/math.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 29, + 57 + ], + [ + 80, + 233 + ], + [ + 252, + 292 + ], + [ + 295, + 305 + ], + [ + 307, + 323 + ], + [ + 330, + 346 + ], + [ + 353, + 369 + ], + [ + 376, + 392 + ], + [ + 399, + 415 + ], + [ + 422, + 438 + ], + [ + 445, + 461 + ], + [ + 468, + 484 + ], + [ + 491, + 507 + ], + [ + 514, + 530 + ], + [ + 537, + 553 + ], + [ + 560, + 576 + ], + [ + 583, + 599 + ], + [ + 606, + 622 + ], + [ + 629, + 645 + ], + [ + 652, + 668 + ], + [ + 675, + 689 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 32, + 33 + ], + [ + 34, + 38 + ], + [ + 39, + 43 + ], + [ + 44, + 48 + ], + [ + 53, + 54 + ], + [ + 83, + 84 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 91, + 94 + ], + [ + 95, + 97 + ], + [ + 98, + 99 + ], + [ + 101, + 109 + ], + [ + 110, + 112 + ], + [ + 113, + 115 + ], + [ + 116, + 118 + ], + [ + 119, + 121 + ], + [ + 122, + 124 + ], + [ + 125, + 127 + ], + [ + 128, + 130 + ], + [ + 131, + 133 + ], + [ + 134, + 137 + ], + [ + 139, + 140 + ], + [ + 144, + 147 + ], + [ + 148, + 151 + ], + [ + 155, + 161 + ], + [ + 164, + 165 + ], + [ + 168, + 170 + ], + [ + 172, + 174 + ], + [ + 177, + 178 + ], + [ + 181, + 230 + ], + [ + 255, + 256 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 265, + 266 + ], + [ + 270, + 271 + ], + [ + 272, + 275 + ], + [ + 276, + 278 + ], + [ + 281, + 282 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 298, + 299 + ], + [ + 300, + 302 + ], + [ + 310, + 311 + ], + [ + 315, + 318 + ], + [ + 319, + 320 + ], + [ + 333, + 334 + ], + [ + 338, + 341 + ], + [ + 342, + 343 + ], + [ + 356, + 357 + ], + [ + 361, + 364 + ], + [ + 365, + 366 + ], + [ + 379, + 380 + ], + [ + 384, + 387 + ], + [ + 388, + 389 + ], + [ + 402, + 403 + ], + [ + 407, + 410 + ], + [ + 411, + 412 + ], + [ + 425, + 426 + ], + [ + 430, + 433 + ], + [ + 434, + 435 + ], + [ + 448, + 449 + ], + [ + 453, + 456 + ], + [ + 457, + 458 + ], + [ + 471, + 472 + ], + [ + 476, + 479 + ], + [ + 480, + 481 + ], + [ + 494, + 495 + ], + [ + 499, + 502 + ], + [ + 503, + 504 + ], + [ + 517, + 518 + ], + [ + 522, + 525 + ], + [ + 526, + 527 + ], + [ + 540, + 541 + ], + [ + 545, + 548 + ], + [ + 549, + 550 + ], + [ + 563, + 564 + ], + [ + 568, + 571 + ], + [ + 572, + 573 + ], + [ + 586, + 587 + ], + [ + 591, + 594 + ], + [ + 595, + 596 + ], + [ + 609, + 610 + ], + [ + 614, + 617 + ], + [ + 618, + 619 + ], + [ + 632, + 633 + ], + [ + 637, + 640 + ], + [ + 641, + 642 + ], + [ + 655, + 656 + ], + [ + 660, + 663 + ], + [ + 664, + 665 + ], + [ + 678, + 679 + ], + [ + 683, + 686 + ], + [ + 687, + 688 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/math2.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 30, + 58 + ], + [ + 82, + 213 + ], + [ + 230, + 271 + ], + [ + 276, + 299 + ], + [ + 301, + 318 + ], + [ + 327, + 343 + ], + [ + 352, + 368 + ], + [ + 377, + 395 + ], + [ + 398, + 437 + ], + [ + 439, + 515 + ], + [ + 520, + 538 + ], + [ + 541, + 558 + ], + [ + 568, + 585 + ], + [ + 595, + 612 + ], + [ + 622, + 639 + ], + [ + 640, + 673 + ], + [ + 675, + 699 + ], + [ + 701, + 725 + ], + [ + 727, + 742 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 44 + ], + [ + 45, + 49 + ], + [ + 54, + 55 + ], + [ + 85, + 86 + ], + [ + 88, + 89 + ], + [ + 90, + 91 + ], + [ + 93, + 99 + ], + [ + 100, + 102 + ], + [ + 103, + 104 + ], + [ + 106, + 118 + ], + [ + 119, + 121 + ], + [ + 122, + 124 + ], + [ + 125, + 127 + ], + [ + 128, + 130 + ], + [ + 131, + 133 + ], + [ + 134, + 136 + ], + [ + 137, + 139 + ], + [ + 140, + 143 + ], + [ + 145, + 158 + ], + [ + 160, + 176 + ], + [ + 177, + 185 + ], + [ + 187, + 189 + ], + [ + 192, + 193 + ], + [ + 196, + 206 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 233, + 234 + ], + [ + 235, + 236 + ], + [ + 237, + 238 + ], + [ + 243, + 244 + ], + [ + 248, + 249 + ], + [ + 250, + 253 + ], + [ + 254, + 256 + ], + [ + 259, + 260 + ], + [ + 264, + 266 + ], + [ + 267, + 268 + ], + [ + 279, + 280 + ], + [ + 283, + 284 + ], + [ + 289, + 291 + ], + [ + 294, + 296 + ], + [ + 304, + 306 + ], + [ + 310, + 313 + ], + [ + 314, + 315 + ], + [ + 330, + 331 + ], + [ + 335, + 338 + ], + [ + 339, + 340 + ], + [ + 355, + 356 + ], + [ + 360, + 363 + ], + [ + 364, + 365 + ], + [ + 380, + 381 + ], + [ + 385, + 388 + ], + [ + 389, + 390 + ], + [ + 401, + 403 + ], + [ + 405, + 406 + ], + [ + 407, + 408 + ], + [ + 410, + 413 + ], + [ + 414, + 416 + ], + [ + 417, + 418 + ], + [ + 420, + 430 + ], + [ + 432, + 434 + ], + [ + 442, + 445 + ], + [ + 447, + 449 + ], + [ + 451, + 453 + ], + [ + 455, + 456 + ], + [ + 458, + 459 + ], + [ + 462, + 463 + ], + [ + 464, + 465 + ], + [ + 466, + 467 + ], + [ + 472, + 474 + ], + [ + 478, + 479 + ], + [ + 480, + 483 + ], + [ + 484, + 486 + ], + [ + 489, + 490 + ], + [ + 494, + 496 + ], + [ + 498, + 499 + ], + [ + 502, + 503 + ], + [ + 504, + 505 + ], + [ + 507, + 508 + ], + [ + 509, + 510 + ], + [ + 511, + 512 + ], + [ + 523, + 526 + ], + [ + 529, + 530 + ], + [ + 532, + 535 + ], + [ + 544, + 546 + ], + [ + 550, + 553 + ], + [ + 554, + 555 + ], + [ + 571, + 572 + ], + [ + 576, + 580 + ], + [ + 581, + 582 + ], + [ + 598, + 599 + ], + [ + 603, + 607 + ], + [ + 608, + 609 + ], + [ + 625, + 626 + ], + [ + 630, + 634 + ], + [ + 635, + 636 + ], + [ + 643, + 644 + ], + [ + 646, + 647 + ], + [ + 652, + 654 + ], + [ + 658, + 661 + ], + [ + 662, + 663 + ], + [ + 669, + 670 + ], + [ + 678, + 679 + ], + [ + 683, + 687 + ], + [ + 688, + 689 + ], + [ + 695, + 696 + ], + [ + 704, + 705 + ], + [ + 709, + 713 + ], + [ + 714, + 715 + ], + [ + 721, + 722 + ], + [ + 730, + 731 + ], + [ + 735, + 739 + ], + [ + 740, + 741 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/max.c", + "line_filter": { + "diff_chunks": [ + [ + 29, + 57 + ], + [ + 112, + 119 + ], + [ + 125, + 173 + ], + [ + 179, + 186 + ], + [ + 193, + 301 + ], + [ + 304, + 506 + ], + [ + 519, + 559 + ] + ], + "lines_added": [ + [ + 32, + 48 + ], + [ + 53, + 54 + ], + [ + 115, + 116 + ], + [ + 128, + 129 + ], + [ + 134, + 137 + ], + [ + 142, + 143 + ], + [ + 148, + 150 + ], + [ + 152, + 154 + ], + [ + 156, + 158 + ], + [ + 162, + 163 + ], + [ + 164, + 166 + ], + [ + 169, + 170 + ], + [ + 182, + 183 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 205, + 206 + ], + [ + 207, + 209 + ], + [ + 212, + 214 + ], + [ + 216, + 218 + ], + [ + 223, + 224 + ], + [ + 228, + 231 + ], + [ + 235, + 236 + ], + [ + 242, + 243 + ], + [ + 244, + 247 + ], + [ + 250, + 260 + ], + [ + 262, + 263 + ], + [ + 268, + 269 + ], + [ + 272, + 274 + ], + [ + 275, + 276 + ], + [ + 281, + 282 + ], + [ + 288, + 291 + ], + [ + 292, + 293 + ], + [ + 294, + 295 + ], + [ + 297, + 298 + ], + [ + 307, + 325 + ], + [ + 327, + 328 + ], + [ + 332, + 333 + ], + [ + 334, + 350 + ], + [ + 353, + 365 + ], + [ + 366, + 379 + ], + [ + 383, + 385 + ], + [ + 387, + 388 + ], + [ + 392, + 418 + ], + [ + 420, + 422 + ], + [ + 423, + 425 + ], + [ + 426, + 427 + ], + [ + 430, + 431 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 444, + 445 + ], + [ + 451, + 454 + ], + [ + 455, + 457 + ], + [ + 458, + 461 + ], + [ + 462, + 464 + ], + [ + 465, + 468 + ], + [ + 469, + 471 + ], + [ + 472, + 475 + ], + [ + 476, + 478 + ], + [ + 479, + 482 + ], + [ + 483, + 485 + ], + [ + 486, + 489 + ], + [ + 490, + 492 + ], + [ + 493, + 496 + ], + [ + 497, + 499 + ], + [ + 502, + 503 + ], + [ + 522, + 523 + ], + [ + 524, + 527 + ], + [ + 529, + 532 + ], + [ + 537, + 538 + ], + [ + 541, + 542 + ], + [ + 548, + 549 + ], + [ + 553, + 556 + ], + [ + 557, + 558 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/measure.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 27, + 55 + ], + [ + 85, + 97 + ], + [ + 101, + 126 + ], + [ + 131, + 185 + ], + [ + 187, + 254 + ], + [ + 268, + 279 + ], + [ + 281, + 295 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 30, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 46 + ], + [ + 51, + 52 + ], + [ + 88, + 89 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 104, + 106 + ], + [ + 107, + 110 + ], + [ + 111, + 112 + ], + [ + 113, + 116 + ], + [ + 119, + 123 + ], + [ + 134, + 136 + ], + [ + 141, + 144 + ], + [ + 147, + 159 + ], + [ + 162, + 168 + ], + [ + 169, + 170 + ], + [ + 171, + 173 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 190, + 192 + ], + [ + 194, + 197 + ], + [ + 198, + 199 + ], + [ + 200, + 205 + ], + [ + 206, + 209 + ], + [ + 210, + 212 + ], + [ + 213, + 216 + ], + [ + 217, + 219 + ], + [ + 220, + 223 + ], + [ + 224, + 226 + ], + [ + 227, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 237 + ], + [ + 238, + 240 + ], + [ + 241, + 244 + ], + [ + 245, + 247 + ], + [ + 250, + 251 + ], + [ + 271, + 272 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 284, + 285 + ], + [ + 289, + 292 + ], + [ + 293, + 294 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/min.c", + "line_filter": { + "diff_chunks": [ + [ + 29, + 57 + ], + [ + 112, + 119 + ], + [ + 125, + 173 + ], + [ + 179, + 186 + ], + [ + 193, + 301 + ], + [ + 304, + 506 + ], + [ + 519, + 560 + ] + ], + "lines_added": [ + [ + 32, + 48 + ], + [ + 53, + 54 + ], + [ + 115, + 116 + ], + [ + 128, + 129 + ], + [ + 134, + 137 + ], + [ + 142, + 143 + ], + [ + 148, + 150 + ], + [ + 152, + 154 + ], + [ + 156, + 158 + ], + [ + 162, + 163 + ], + [ + 164, + 166 + ], + [ + 169, + 170 + ], + [ + 182, + 183 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 205, + 206 + ], + [ + 207, + 209 + ], + [ + 212, + 214 + ], + [ + 216, + 218 + ], + [ + 223, + 224 + ], + [ + 228, + 231 + ], + [ + 235, + 236 + ], + [ + 242, + 243 + ], + [ + 244, + 247 + ], + [ + 250, + 252 + ], + [ + 253, + 260 + ], + [ + 262, + 263 + ], + [ + 268, + 269 + ], + [ + 272, + 274 + ], + [ + 275, + 276 + ], + [ + 281, + 282 + ], + [ + 288, + 291 + ], + [ + 292, + 293 + ], + [ + 294, + 295 + ], + [ + 297, + 298 + ], + [ + 307, + 325 + ], + [ + 327, + 328 + ], + [ + 332, + 333 + ], + [ + 334, + 350 + ], + [ + 353, + 365 + ], + [ + 366, + 379 + ], + [ + 383, + 385 + ], + [ + 387, + 388 + ], + [ + 392, + 418 + ], + [ + 420, + 422 + ], + [ + 423, + 425 + ], + [ + 426, + 427 + ], + [ + 430, + 431 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 444, + 445 + ], + [ + 451, + 454 + ], + [ + 455, + 457 + ], + [ + 458, + 461 + ], + [ + 462, + 464 + ], + [ + 465, + 468 + ], + [ + 469, + 471 + ], + [ + 472, + 475 + ], + [ + 476, + 478 + ], + [ + 479, + 482 + ], + [ + 483, + 485 + ], + [ + 486, + 489 + ], + [ + 490, + 492 + ], + [ + 493, + 496 + ], + [ + 497, + 499 + ], + [ + 502, + 503 + ], + [ + 522, + 523 + ], + [ + 524, + 527 + ], + [ + 529, + 532 + ], + [ + 538, + 539 + ], + [ + 542, + 543 + ], + [ + 549, + 550 + ], + [ + 554, + 557 + ], + [ + 558, + 559 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/multiply.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 31, + 59 + ], + [ + 76, + 168 + ], + [ + 177, + 184 + ], + [ + 186, + 207 + ], + [ + 211, + 230 + ], + [ + 288, + 302 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 34, + 35 + ], + [ + 36, + 40 + ], + [ + 41, + 45 + ], + [ + 46, + 50 + ], + [ + 55, + 56 + ], + [ + 79, + 80 + ], + [ + 83, + 104 + ], + [ + 107, + 116 + ], + [ + 118, + 120 + ], + [ + 122, + 123 + ], + [ + 126, + 127 + ], + [ + 128, + 163 + ], + [ + 164, + 165 + ], + [ + 180, + 181 + ], + [ + 189, + 190 + ], + [ + 192, + 193 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 203, + 204 + ], + [ + 214, + 215 + ], + [ + 219, + 221 + ], + [ + 224, + 227 + ], + [ + 291, + 292 + ], + [ + 296, + 299 + ], + [ + 300, + 301 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/nary.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 48, + 99 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 51, + 52 + ], + [ + 54, + 55 + ], + [ + 56, + 58 + ], + [ + 59, + 60 + ], + [ + 64, + 66 + ], + [ + 67, + 68 + ], + [ + 71, + 72 + ], + [ + 73, + 75 + ], + [ + 80, + 81 + ], + [ + 86, + 89 + ], + [ + 90, + 92 + ], + [ + 95, + 96 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/nary.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 40, + 56 + ], + [ + 62, + 72 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 43, + 53 + ], + [ + 65, + 66 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/parithmetic.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 39, + 62 + ], + [ + 104, + 123 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 42, + 54 + ], + [ + 57, + 59 + ], + [ + 107, + 108 + ], + [ + 109, + 117 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/profile.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 16, + 44 + ], + [ + 76, + 318 + ], + [ + 322, + 331 + ], + [ + 332, + 346 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 35 + ], + [ + 40, + 41 + ], + [ + 79, + 81 + ], + [ + 86, + 87 + ], + [ + 89, + 90 + ], + [ + 91, + 93 + ], + [ + 95, + 111 + ], + [ + 114, + 115 + ], + [ + 116, + 118 + ], + [ + 122, + 125 + ], + [ + 126, + 127 + ], + [ + 129, + 130 + ], + [ + 134, + 136 + ], + [ + 139, + 144 + ], + [ + 145, + 146 + ], + [ + 148, + 149 + ], + [ + 151, + 159 + ], + [ + 160, + 161 + ], + [ + 163, + 164 + ], + [ + 166, + 167 + ], + [ + 172, + 174 + ], + [ + 175, + 176 + ], + [ + 180, + 181 + ], + [ + 184, + 199 + ], + [ + 200, + 203 + ], + [ + 204, + 205 + ], + [ + 209, + 211 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 242, + 243 + ], + [ + 246, + 247 + ], + [ + 253, + 254 + ], + [ + 259, + 260 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 268, + 270 + ], + [ + 271, + 273 + ], + [ + 276, + 278 + ], + [ + 279, + 280 + ], + [ + 283, + 284 + ], + [ + 287, + 288 + ], + [ + 293, + 294 + ], + [ + 300, + 311 + ], + [ + 314, + 315 + ], + [ + 325, + 328 + ], + [ + 335, + 336 + ], + [ + 340, + 343 + ], + [ + 344, + 345 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/project.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 70, + 84 + ], + [ + 92, + 277 + ], + [ + 279, + 302 + ], + [ + 304, + 349 + ], + [ + 364, + 378 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 73, + 75 + ], + [ + 80, + 81 + ], + [ + 95, + 96 + ], + [ + 97, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 111 + ], + [ + 112, + 114 + ], + [ + 115, + 116 + ], + [ + 119, + 120 + ], + [ + 121, + 123 + ], + [ + 127, + 130 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 139, + 141 + ], + [ + 144, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 158, + 166 + ], + [ + 167, + 168 + ], + [ + 173, + 174 + ], + [ + 179, + 181 + ], + [ + 182, + 183 + ], + [ + 187, + 203 + ], + [ + 204, + 205 + ], + [ + 209, + 211 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 242, + 243 + ], + [ + 246, + 247 + ], + [ + 253, + 254 + ], + [ + 256, + 266 + ], + [ + 270, + 271 + ], + [ + 273, + 274 + ], + [ + 282, + 283 + ], + [ + 284, + 287 + ], + [ + 290, + 293 + ], + [ + 296, + 299 + ], + [ + 307, + 309 + ], + [ + 310, + 311 + ], + [ + 314, + 315 + ], + [ + 318, + 319 + ], + [ + 324, + 325 + ], + [ + 331, + 342 + ], + [ + 345, + 346 + ], + [ + 367, + 368 + ], + [ + 372, + 375 + ], + [ + 376, + 377 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/relational.c", + "line_filter": { + "diff_chunks": [ + [ + 29, + 64 + ], + [ + 87, + 170 + ], + [ + 174, + 205 + ], + [ + 225, + 268 + ], + [ + 272, + 316 + ], + [ + 325, + 342 + ], + [ + 351, + 368 + ], + [ + 377, + 394 + ], + [ + 403, + 420 + ], + [ + 429, + 446 + ], + [ + 455, + 472 + ], + [ + 476, + 586 + ], + [ + 589, + 647 + ], + [ + 655, + 666 + ], + [ + 669, + 686 + ], + [ + 696, + 713 + ], + [ + 723, + 741 + ], + [ + 751, + 768 + ], + [ + 778, + 795 + ], + [ + 805, + 822 + ], + [ + 832, + 849 + ], + [ + 850, + 857 + ], + [ + 861, + 885 + ], + [ + 887, + 911 + ], + [ + 913, + 937 + ], + [ + 939, + 963 + ], + [ + 965, + 989 + ], + [ + 991, + 1015 + ], + [ + 1017, + 1032 + ] + ], + "lines_added": [ + [ + 32, + 33 + ], + [ + 39, + 40 + ], + [ + 41, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 55 + ], + [ + 60, + 61 + ], + [ + 90, + 91 + ], + [ + 92, + 101 + ], + [ + 102, + 115 + ], + [ + 116, + 149 + ], + [ + 151, + 152 + ], + [ + 153, + 159 + ], + [ + 161, + 163 + ], + [ + 166, + 167 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 187, + 190 + ], + [ + 193, + 194 + ], + [ + 196, + 198 + ], + [ + 200, + 202 + ], + [ + 228, + 229 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 238, + 239 + ], + [ + 242, + 244 + ], + [ + 245, + 248 + ], + [ + 249, + 252 + ], + [ + 255, + 256 + ], + [ + 260, + 262 + ], + [ + 263, + 265 + ], + [ + 275, + 276 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 284, + 286 + ], + [ + 289, + 291 + ], + [ + 294, + 296 + ], + [ + 302, + 304 + ], + [ + 308, + 311 + ], + [ + 312, + 313 + ], + [ + 328, + 329 + ], + [ + 333, + 337 + ], + [ + 338, + 339 + ], + [ + 354, + 355 + ], + [ + 359, + 363 + ], + [ + 364, + 365 + ], + [ + 380, + 381 + ], + [ + 385, + 389 + ], + [ + 390, + 391 + ], + [ + 406, + 407 + ], + [ + 411, + 415 + ], + [ + 416, + 417 + ], + [ + 432, + 433 + ], + [ + 437, + 441 + ], + [ + 442, + 443 + ], + [ + 458, + 459 + ], + [ + 463, + 467 + ], + [ + 468, + 469 + ], + [ + 479, + 491 + ], + [ + 492, + 501 + ], + [ + 502, + 515 + ], + [ + 516, + 517 + ], + [ + 519, + 521 + ], + [ + 527, + 528 + ], + [ + 531, + 532 + ], + [ + 533, + 535 + ], + [ + 537, + 538 + ], + [ + 542, + 544 + ], + [ + 546, + 547 + ], + [ + 551, + 553 + ], + [ + 555, + 556 + ], + [ + 560, + 562 + ], + [ + 564, + 565 + ], + [ + 569, + 571 + ], + [ + 573, + 574 + ], + [ + 578, + 580 + ], + [ + 582, + 583 + ], + [ + 592, + 593 + ], + [ + 594, + 595 + ], + [ + 596, + 597 + ], + [ + 602, + 604 + ], + [ + 607, + 609 + ], + [ + 610, + 613 + ], + [ + 614, + 617 + ], + [ + 620, + 621 + ], + [ + 625, + 627 + ], + [ + 629, + 630 + ], + [ + 633, + 634 + ], + [ + 635, + 636 + ], + [ + 638, + 640 + ], + [ + 641, + 642 + ], + [ + 643, + 644 + ], + [ + 658, + 659 + ], + [ + 660, + 663 + ], + [ + 672, + 674 + ], + [ + 678, + 681 + ], + [ + 682, + 683 + ], + [ + 699, + 700 + ], + [ + 704, + 708 + ], + [ + 709, + 710 + ], + [ + 726, + 728 + ], + [ + 732, + 736 + ], + [ + 737, + 738 + ], + [ + 754, + 755 + ], + [ + 759, + 763 + ], + [ + 764, + 765 + ], + [ + 781, + 782 + ], + [ + 786, + 790 + ], + [ + 791, + 792 + ], + [ + 808, + 809 + ], + [ + 813, + 817 + ], + [ + 818, + 819 + ], + [ + 835, + 836 + ], + [ + 840, + 844 + ], + [ + 845, + 846 + ], + [ + 853, + 854 + ], + [ + 864, + 866 + ], + [ + 870, + 873 + ], + [ + 874, + 875 + ], + [ + 881, + 882 + ], + [ + 890, + 891 + ], + [ + 895, + 899 + ], + [ + 900, + 901 + ], + [ + 907, + 908 + ], + [ + 916, + 917 + ], + [ + 921, + 925 + ], + [ + 926, + 927 + ], + [ + 933, + 934 + ], + [ + 942, + 943 + ], + [ + 947, + 951 + ], + [ + 952, + 953 + ], + [ + 959, + 960 + ], + [ + 968, + 969 + ], + [ + 973, + 977 + ], + [ + 978, + 979 + ], + [ + 985, + 986 + ], + [ + 994, + 995 + ], + [ + 999, + 1003 + ], + [ + 1004, + 1005 + ], + [ + 1011, + 1012 + ], + [ + 1020, + 1021 + ], + [ + 1025, + 1029 + ], + [ + 1030, + 1031 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/remainder.c", + "line_filter": { + "diff_chunks": [ + [ + 22, + 50 + ], + [ + 68, + 161 + ], + [ + 178, + 206 + ], + [ + 210, + 231 + ], + [ + 233, + 306 + ], + [ + 307, + 389 + ], + [ + 393, + 409 + ], + [ + 412, + 448 + ], + [ + 451, + 465 + ] + ], + "lines_added": [ + [ + 25, + 26 + ], + [ + 27, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 41 + ], + [ + 46, + 47 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 79, + 85 + ], + [ + 86, + 88 + ], + [ + 89, + 90 + ], + [ + 94, + 103 + ], + [ + 106, + 119 + ], + [ + 121, + 123 + ], + [ + 125, + 126 + ], + [ + 129, + 156 + ], + [ + 157, + 158 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 191, + 193 + ], + [ + 197, + 199 + ], + [ + 202, + 203 + ], + [ + 213, + 215 + ], + [ + 221, + 223 + ], + [ + 226, + 228 + ], + [ + 236, + 237 + ], + [ + 241, + 244 + ], + [ + 245, + 246 + ], + [ + 251, + 253 + ], + [ + 255, + 256 + ], + [ + 257, + 258 + ], + [ + 260, + 263 + ], + [ + 264, + 266 + ], + [ + 267, + 268 + ], + [ + 272, + 282 + ], + [ + 285, + 299 + ], + [ + 301, + 303 + ], + [ + 310, + 337 + ], + [ + 338, + 339 + ], + [ + 342, + 343 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 352, + 355 + ], + [ + 359, + 360 + ], + [ + 363, + 364 + ], + [ + 368, + 370 + ], + [ + 372, + 373 + ], + [ + 376, + 377 + ], + [ + 378, + 379 + ], + [ + 381, + 382 + ], + [ + 383, + 384 + ], + [ + 385, + 386 + ], + [ + 396, + 401 + ], + [ + 403, + 406 + ], + [ + 415, + 417 + ], + [ + 421, + 424 + ], + [ + 425, + 426 + ], + [ + 432, + 433 + ], + [ + 435, + 440 + ], + [ + 442, + 445 + ], + [ + 454, + 455 + ], + [ + 459, + 462 + ], + [ + 463, + 464 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/round.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 41 + ], + [ + 64, + 145 + ], + [ + 160, + 201 + ], + [ + 206, + 214 + ], + [ + 217, + 233 + ], + [ + 235, + 257 + ], + [ + 259, + 281 + ], + [ + 283, + 303 + ] + ], + "lines_added": [ + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 32 + ], + [ + 37, + 38 + ], + [ + 67, + 68 + ], + [ + 70, + 71 + ], + [ + 77, + 80 + ], + [ + 81, + 83 + ], + [ + 84, + 85 + ], + [ + 87, + 113 + ], + [ + 115, + 117 + ], + [ + 123, + 125 + ], + [ + 128, + 142 + ], + [ + 163, + 164 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 173, + 174 + ], + [ + 178, + 179 + ], + [ + 180, + 183 + ], + [ + 184, + 186 + ], + [ + 189, + 190 + ], + [ + 194, + 196 + ], + [ + 197, + 198 + ], + [ + 209, + 211 + ], + [ + 220, + 221 + ], + [ + 225, + 228 + ], + [ + 229, + 230 + ], + [ + 238, + 240 + ], + [ + 244, + 245 + ], + [ + 249, + 252 + ], + [ + 253, + 254 + ], + [ + 262, + 264 + ], + [ + 268, + 269 + ], + [ + 273, + 276 + ], + [ + 277, + 278 + ], + [ + 286, + 288 + ], + [ + 292, + 293 + ], + [ + 297, + 300 + ], + [ + 301, + 302 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/sign.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 55, + 146 + ], + [ + 165, + 186 + ], + [ + 199, + 213 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 29 + ], + [ + 34, + 35 + ], + [ + 58, + 83 + ], + [ + 84, + 85 + ], + [ + 86, + 103 + ], + [ + 105, + 107 + ], + [ + 108, + 110 + ], + [ + 112, + 143 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 202, + 203 + ], + [ + 207, + 210 + ], + [ + 211, + 212 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/statistic.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 54, + 177 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 29 + ], + [ + 34, + 35 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 62, + 64 + ], + [ + 65, + 66 + ], + [ + 69, + 71 + ], + [ + 72, + 74 + ], + [ + 76, + 77 + ], + [ + 81, + 83 + ], + [ + 84, + 89 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 115 + ], + [ + 117, + 120 + ], + [ + 122, + 124 + ], + [ + 127, + 129 + ], + [ + 133, + 137 + ], + [ + 140, + 146 + ], + [ + 147, + 148 + ], + [ + 151, + 152 + ], + [ + 153, + 156 + ], + [ + 161, + 162 + ], + [ + 166, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/statistic.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 65 + ], + [ + 67, + 74 + ], + [ + 77, + 84 + ], + [ + 86, + 94 + ], + [ + 95, + 102 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 58, + 62 + ], + [ + 70, + 71 + ], + [ + 80, + 81 + ], + [ + 89, + 91 + ], + [ + 98, + 99 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/stats.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 26 + ], + [ + 31, + 59 + ], + [ + 79, + 91 + ], + [ + 103, + 152 + ], + [ + 155, + 214 + ], + [ + 218, + 451 + ], + [ + 455, + 487 + ] + ], + "lines_added": [ + [ + 20, + 21 + ], + [ + 22, + 23 + ], + [ + 34, + 35 + ], + [ + 36, + 40 + ], + [ + 41, + 50 + ], + [ + 55, + 56 + ], + [ + 82, + 83 + ], + [ + 87, + 88 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 116, + 118 + ], + [ + 119, + 121 + ], + [ + 122, + 125 + ], + [ + 127, + 129 + ], + [ + 130, + 133 + ], + [ + 134, + 137 + ], + [ + 139, + 141 + ], + [ + 142, + 143 + ], + [ + 148, + 149 + ], + [ + 158, + 160 + ], + [ + 162, + 165 + ], + [ + 168, + 171 + ], + [ + 172, + 173 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 186, + 190 + ], + [ + 193, + 194 + ], + [ + 199, + 203 + ], + [ + 204, + 205 + ], + [ + 210, + 211 + ], + [ + 221, + 223 + ], + [ + 224, + 225 + ], + [ + 227, + 228 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 236, + 240 + ], + [ + 243, + 244 + ], + [ + 249, + 268 + ], + [ + 269, + 275 + ], + [ + 276, + 297 + ], + [ + 298, + 307 + ], + [ + 308, + 311 + ], + [ + 314, + 333 + ], + [ + 334, + 340 + ], + [ + 341, + 362 + ], + [ + 363, + 372 + ], + [ + 373, + 376 + ], + [ + 380, + 382 + ], + [ + 383, + 384 + ], + [ + 388, + 415 + ], + [ + 418, + 419 + ], + [ + 422, + 423 + ], + [ + 426, + 427 + ], + [ + 432, + 433 + ], + [ + 439, + 444 + ], + [ + 447, + 448 + ], + [ + 458, + 461 + ], + [ + 462, + 463 + ], + [ + 465, + 466 + ], + [ + 468, + 470 + ], + [ + 476, + 477 + ], + [ + 481, + 484 + ], + [ + 485, + 486 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/subtract.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 35, + 63 + ], + [ + 80, + 147 + ], + [ + 165, + 209 + ], + [ + 267, + 281 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 38, + 39 + ], + [ + 40, + 44 + ], + [ + 45, + 49 + ], + [ + 50, + 54 + ], + [ + 59, + 60 + ], + [ + 83, + 84 + ], + [ + 85, + 94 + ], + [ + 96, + 98 + ], + [ + 103, + 105 + ], + [ + 108, + 109 + ], + [ + 110, + 139 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 188, + 190 + ], + [ + 193, + 194 + ], + [ + 198, + 200 + ], + [ + 203, + 206 + ], + [ + 270, + 271 + ], + [ + 275, + 278 + ], + [ + 279, + 280 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/sum.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 120 + ], + [ + 140, + 175 + ], + [ + 178, + 197 + ], + [ + 255, + 269 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 70 + ], + [ + 72, + 73 + ], + [ + 75, + 76 + ], + [ + 79, + 81 + ], + [ + 85, + 86 + ], + [ + 88, + 117 + ], + [ + 143, + 144 + ], + [ + 146, + 147 + ], + [ + 149, + 150 + ], + [ + 153, + 154 + ], + [ + 157, + 158 + ], + [ + 162, + 163 + ], + [ + 164, + 165 + ], + [ + 167, + 170 + ], + [ + 171, + 172 + ], + [ + 181, + 182 + ], + [ + 187, + 188 + ], + [ + 191, + 194 + ], + [ + 258, + 259 + ], + [ + 263, + 266 + ], + [ + 267, + 268 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/unary.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 48, + 99 + ], + [ + 102, + 118 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 51, + 52 + ], + [ + 54, + 55 + ], + [ + 56, + 58 + ], + [ + 60, + 61 + ], + [ + 62, + 64 + ], + [ + 65, + 67 + ], + [ + 68, + 69 + ], + [ + 72, + 73 + ], + [ + 74, + 76 + ], + [ + 81, + 82 + ], + [ + 87, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/unary.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 54 + ], + [ + 58, + 70 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 51 + ], + [ + 61, + 62 + ], + [ + 63, + 64 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/unaryconst.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 50, + 63 + ], + [ + 64, + 81 + ], + [ + 87, + 153 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 32, + 33 + ], + [ + 53, + 54 + ], + [ + 56, + 57 + ], + [ + 58, + 60 + ], + [ + 67, + 71 + ], + [ + 73, + 78 + ], + [ + 90, + 93 + ], + [ + 99, + 106 + ], + [ + 107, + 110 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 115, + 117 + ], + [ + 122, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 131, + 132 + ], + [ + 138, + 139 + ], + [ + 141, + 144 + ], + [ + 145, + 147 + ], + [ + 150, + 151 + ] + ] + } + }, + { + "filename": "libvips/arithmetic/unaryconst.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 76, + 86 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 79, + 80 + ] + ] + } + }, + { + "filename": "libvips/colour/CMYK2XYZ.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 58, + 132 + ], + [ + 137, + 151 + ], + [ + 164, + 190 + ], + [ + 205, + 227 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 61, + 62 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 71, + 72 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 80, + 81 + ], + [ + 82, + 84 + ], + [ + 86, + 87 + ], + [ + 88, + 94 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 109, + 110 + ], + [ + 114, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 140, + 141 + ], + [ + 147, + 148 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 177, + 179 + ], + [ + 183, + 184 + ], + [ + 185, + 187 + ], + [ + 208, + 209 + ], + [ + 210, + 211 + ], + [ + 216, + 217 + ], + [ + 221, + 224 + ], + [ + 225, + 226 + ] + ] + } + }, + { + "filename": "libvips/colour/HSV2sRGB.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 46, + 97 + ], + [ + 103, + 125 + ], + [ + 139, + 146 + ], + [ + 147, + 161 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 52, + 53 + ], + [ + 54, + 56 + ], + [ + 62, + 63 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 73, + 75 + ], + [ + 78, + 80 + ], + [ + 83, + 85 + ], + [ + 88, + 90 + ], + [ + 93, + 94 + ], + [ + 106, + 107 + ], + [ + 109, + 110 + ], + [ + 112, + 113 + ], + [ + 118, + 119 + ], + [ + 120, + 122 + ], + [ + 142, + 143 + ], + [ + 150, + 151 + ], + [ + 155, + 158 + ], + [ + 159, + 160 + ] + ] + } + }, + { + "filename": "libvips/colour/LCh2Lab.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 43 + ], + [ + 55, + 62 + ], + [ + 67, + 90 + ], + [ + 91, + 98 + ], + [ + 102, + 123 + ], + [ + 132, + 146 + ] + ], + "lines_added": [ + [ + 18, + 34 + ], + [ + 39, + 40 + ], + [ + 58, + 59 + ], + [ + 70, + 71 + ], + [ + 72, + 74 + ], + [ + 79, + 83 + ], + [ + 86, + 87 + ], + [ + 94, + 95 + ], + [ + 105, + 106 + ], + [ + 108, + 109 + ], + [ + 111, + 112 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 135, + 136 + ], + [ + 140, + 143 + ], + [ + 144, + 145 + ] + ] + } + }, + { + "filename": "libvips/colour/LCh2UCS.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 51, + 63 + ], + [ + 74, + 82 + ], + [ + 87, + 103 + ], + [ + 108, + 123 + ], + [ + 129, + 156 + ], + [ + 164, + 218 + ], + [ + 226, + 252 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 54, + 55 + ], + [ + 59, + 60 + ], + [ + 77, + 79 + ], + [ + 90, + 92 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 111, + 113 + ], + [ + 115, + 117 + ], + [ + 119, + 120 + ], + [ + 132, + 134 + ], + [ + 138, + 139 + ], + [ + 145, + 146 + ], + [ + 152, + 153 + ], + [ + 167, + 169 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 177, + 178 + ], + [ + 184, + 185 + ], + [ + 191, + 194 + ], + [ + 200, + 201 + ], + [ + 203, + 204 + ], + [ + 206, + 207 + ], + [ + 212, + 213 + ], + [ + 214, + 215 + ], + [ + 229, + 230 + ], + [ + 234, + 235 + ], + [ + 236, + 237 + ], + [ + 241, + 242 + ], + [ + 246, + 249 + ], + [ + 250, + 251 + ] + ] + } + }, + { + "filename": "libvips/colour/Lab2LCh.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 49, + 115 + ], + [ + 116, + 124 + ], + [ + 128, + 149 + ], + [ + 158, + 172 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 52, + 53 + ], + [ + 59, + 60 + ], + [ + 62, + 63 + ], + [ + 68, + 70 + ], + [ + 71, + 72 + ], + [ + 77, + 78 + ], + [ + 79, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 104, + 105 + ], + [ + 106, + 108 + ], + [ + 111, + 112 + ], + [ + 119, + 121 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 137, + 138 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 161, + 162 + ], + [ + 166, + 169 + ], + [ + 170, + 171 + ] + ] + } + }, + { + "filename": "libvips/colour/Lab2LabQ.c", + "line_filter": { + "diff_chunks": [ + [ + 35, + 63 + ], + [ + 75, + 82 + ], + [ + 83, + 121 + ], + [ + 122, + 150 + ], + [ + 168, + 182 + ] + ], + "lines_added": [ + [ + 38, + 54 + ], + [ + 59, + 60 + ], + [ + 78, + 79 + ], + [ + 86, + 87 + ], + [ + 88, + 90 + ], + [ + 93, + 94 + ], + [ + 98, + 99 + ], + [ + 100, + 114 + ], + [ + 117, + 118 + ], + [ + 125, + 126 + ], + [ + 127, + 128 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 137, + 138 + ], + [ + 143, + 144 + ], + [ + 145, + 147 + ], + [ + 171, + 172 + ], + [ + 176, + 179 + ], + [ + 180, + 181 + ] + ] + } + }, + { + "filename": "libvips/colour/Lab2LabS.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 51, + 67 + ], + [ + 71, + 93 + ], + [ + 110, + 124 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 59, + 61 + ], + [ + 63, + 64 + ], + [ + 74, + 75 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 86, + 87 + ], + [ + 88, + 90 + ], + [ + 113, + 114 + ], + [ + 118, + 121 + ], + [ + 122, + 123 + ] + ] + } + }, + { + "filename": "libvips/colour/Lab2XYZ.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 64, + 71 + ], + [ + 78, + 93 + ], + [ + 96, + 109 + ], + [ + 111, + 129 + ], + [ + 131, + 138 + ], + [ + 143, + 197 + ], + [ + 209, + 231 + ], + [ + 237, + 253 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 67, + 68 + ], + [ + 81, + 82 + ], + [ + 84, + 86 + ], + [ + 89, + 90 + ], + [ + 99, + 100 + ], + [ + 105, + 106 + ], + [ + 114, + 115 + ], + [ + 117, + 119 + ], + [ + 122, + 124 + ], + [ + 125, + 126 + ], + [ + 134, + 135 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 151, + 155 + ], + [ + 160, + 162 + ], + [ + 163, + 164 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 177, + 178 + ], + [ + 182, + 185 + ], + [ + 186, + 188 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 212, + 213 + ], + [ + 218, + 219 + ], + [ + 223, + 226 + ], + [ + 227, + 228 + ], + [ + 240, + 241 + ], + [ + 244, + 245 + ], + [ + 251, + 252 + ] + ] + } + }, + { + "filename": "libvips/colour/LabQ2Lab.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 17 + ], + [ + 22, + 50 + ], + [ + 62, + 69 + ], + [ + 72, + 109 + ], + [ + 110, + 138 + ], + [ + 154, + 168 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 25, + 26 + ], + [ + 27, + 31 + ], + [ + 32, + 41 + ], + [ + 46, + 47 + ], + [ + 65, + 66 + ], + [ + 75, + 76 + ], + [ + 77, + 79 + ], + [ + 81, + 83 + ], + [ + 86, + 87 + ], + [ + 93, + 94 + ], + [ + 99, + 100 + ], + [ + 104, + 106 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ], + [ + 119, + 120 + ], + [ + 122, + 123 + ], + [ + 125, + 126 + ], + [ + 131, + 132 + ], + [ + 133, + 135 + ], + [ + 157, + 158 + ], + [ + 162, + 165 + ], + [ + 166, + 167 + ] + ] + } + }, + { + "filename": "libvips/colour/LabQ2LabS.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 53, + 74 + ], + [ + 95, + 117 + ], + [ + 133, + 147 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 56, + 57 + ], + [ + 61, + 62 + ], + [ + 63, + 65 + ], + [ + 70, + 71 + ], + [ + 98, + 99 + ], + [ + 101, + 102 + ], + [ + 104, + 105 + ], + [ + 110, + 111 + ], + [ + 112, + 114 + ], + [ + 136, + 137 + ], + [ + 141, + 144 + ], + [ + 145, + 146 + ] + ] + } + }, + { + "filename": "libvips/colour/LabQ2sRGB.c", + "line_filter": { + "diff_chunks": [ + [ + 28, + 59 + ], + [ + 60, + 67 + ], + [ + 69, + 78 + ], + [ + 81, + 88 + ], + [ + 93, + 100 + ], + [ + 101, + 147 + ], + [ + 148, + 210 + ], + [ + 225, + 238 + ], + [ + 248, + 273 + ], + [ + 279, + 308 + ], + [ + 312, + 368 + ], + [ + 378, + 388 + ], + [ + 393, + 478 + ], + [ + 481, + 503 + ], + [ + 504, + 542 + ], + [ + 558, + 572 + ] + ], + "lines_added": [ + [ + 31, + 47 + ], + [ + 52, + 53 + ], + [ + 55, + 56 + ], + [ + 63, + 64 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 84, + 85 + ], + [ + 96, + 97 + ], + [ + 104, + 105 + ], + [ + 109, + 111 + ], + [ + 115, + 116 + ], + [ + 118, + 119 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 129, + 131 + ], + [ + 134, + 135 + ], + [ + 138, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ], + [ + 157, + 158 + ], + [ + 162, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 194, + 195 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 228, + 229 + ], + [ + 234, + 235 + ], + [ + 251, + 252 + ], + [ + 253, + 256 + ], + [ + 257, + 259 + ], + [ + 260, + 261 + ], + [ + 266, + 270 + ], + [ + 282, + 283 + ], + [ + 284, + 288 + ], + [ + 289, + 290 + ], + [ + 294, + 305 + ], + [ + 315, + 316 + ], + [ + 318, + 319 + ], + [ + 321, + 322 + ], + [ + 324, + 325 + ], + [ + 327, + 328 + ], + [ + 330, + 331 + ], + [ + 332, + 334 + ], + [ + 335, + 337 + ], + [ + 339, + 341 + ], + [ + 344, + 345 + ], + [ + 348, + 350 + ], + [ + 353, + 355 + ], + [ + 357, + 358 + ], + [ + 363, + 365 + ], + [ + 381, + 383 + ], + [ + 384, + 385 + ], + [ + 396, + 397 + ], + [ + 399, + 400 + ], + [ + 401, + 403 + ], + [ + 404, + 406 + ], + [ + 408, + 409 + ], + [ + 412, + 413 + ], + [ + 416, + 417 + ], + [ + 420, + 421 + ], + [ + 423, + 424 + ], + [ + 426, + 427 + ], + [ + 428, + 429 + ], + [ + 431, + 457 + ], + [ + 460, + 461 + ], + [ + 464, + 465 + ], + [ + 470, + 472 + ], + [ + 474, + 475 + ], + [ + 484, + 486 + ], + [ + 487, + 490 + ], + [ + 495, + 498 + ], + [ + 499, + 500 + ], + [ + 507, + 510 + ], + [ + 513, + 517 + ], + [ + 518, + 520 + ], + [ + 523, + 524 + ], + [ + 526, + 527 + ], + [ + 529, + 530 + ], + [ + 535, + 536 + ], + [ + 537, + 539 + ], + [ + 561, + 562 + ], + [ + 566, + 569 + ], + [ + 570, + 571 + ] + ] + } + }, + { + "filename": "libvips/colour/LabS2Lab.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 8, + 36 + ], + [ + 47, + 65 + ], + [ + 69, + 91 + ], + [ + 108, + 122 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 27 + ], + [ + 32, + 33 + ], + [ + 50, + 51 + ], + [ + 55, + 56 + ], + [ + 61, + 62 + ], + [ + 72, + 73 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 84, + 85 + ], + [ + 86, + 88 + ], + [ + 111, + 112 + ], + [ + 116, + 119 + ], + [ + 120, + 121 + ] + ] + } + }, + { + "filename": "libvips/colour/LabS2LabQ.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 58, + 102 + ], + [ + 118, + 140 + ], + [ + 158, + 172 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 61, + 62 + ], + [ + 66, + 67 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 86, + 87 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 127, + 128 + ], + [ + 133, + 134 + ], + [ + 135, + 137 + ], + [ + 161, + 162 + ], + [ + 166, + 169 + ], + [ + 170, + 171 + ] + ] + } + }, + { + "filename": "libvips/colour/UCS2LCh.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 43 + ], + [ + 61, + 137 + ], + [ + 145, + 182 + ], + [ + 190, + 256 + ], + [ + 262, + 283 + ], + [ + 290, + 309 + ] + ], + "lines_added": [ + [ + 18, + 34 + ], + [ + 39, + 40 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 74, + 76 + ], + [ + 77, + 78 + ], + [ + 82, + 83 + ], + [ + 85, + 86 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 98, + 100 + ], + [ + 101, + 102 + ], + [ + 106, + 107 + ], + [ + 109, + 110 + ], + [ + 114, + 115 + ], + [ + 117, + 118 + ], + [ + 122, + 125 + ], + [ + 126, + 128 + ], + [ + 130, + 131 + ], + [ + 133, + 134 + ], + [ + 148, + 150 + ], + [ + 152, + 154 + ], + [ + 155, + 157 + ], + [ + 163, + 164 + ], + [ + 170, + 172 + ], + [ + 174, + 176 + ], + [ + 177, + 179 + ], + [ + 193, + 195 + ], + [ + 201, + 202 + ], + [ + 203, + 205 + ], + [ + 206, + 208 + ], + [ + 211, + 213 + ], + [ + 217, + 218 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 236, + 237 + ], + [ + 243, + 244 + ], + [ + 250, + 253 + ], + [ + 265, + 266 + ], + [ + 268, + 269 + ], + [ + 271, + 272 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 293, + 294 + ], + [ + 298, + 299 + ], + [ + 303, + 306 + ], + [ + 307, + 308 + ] + ] + } + }, + { + "filename": "libvips/colour/XYZ2CMYK.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 60, + 133 + ], + [ + 138, + 145 + ], + [ + 147, + 154 + ], + [ + 155, + 175 + ], + [ + 177, + 203 + ], + [ + 218, + 240 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 63, + 64 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 83, + 85 + ], + [ + 87, + 88 + ], + [ + 89, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 105 + ], + [ + 110, + 111 + ], + [ + 115, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 141, + 142 + ], + [ + 150, + 151 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 168, + 172 + ], + [ + 180, + 181 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 190, + 192 + ], + [ + 196, + 197 + ], + [ + 198, + 200 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 229, + 230 + ], + [ + 234, + 237 + ], + [ + 238, + 239 + ] + ] + } + }, + { + "filename": "libvips/colour/XYZ2Lab.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 23, + 51 + ], + [ + 62, + 69 + ], + [ + 74, + 81 + ], + [ + 88, + 120 + ], + [ + 126, + 141 + ], + [ + 146, + 153 + ], + [ + 154, + 161 + ], + [ + 163, + 170 + ], + [ + 182, + 251 + ], + [ + 264, + 283 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 26, + 27 + ], + [ + 28, + 32 + ], + [ + 33, + 42 + ], + [ + 47, + 48 + ], + [ + 65, + 66 + ], + [ + 77, + 78 + ], + [ + 91, + 92 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 101, + 102 + ], + [ + 103, + 105 + ], + [ + 107, + 108 + ], + [ + 111, + 113 + ], + [ + 116, + 117 + ], + [ + 129, + 130 + ], + [ + 133, + 134 + ], + [ + 137, + 138 + ], + [ + 149, + 150 + ], + [ + 157, + 158 + ], + [ + 166, + 167 + ], + [ + 185, + 186 + ], + [ + 189, + 190 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 205, + 209 + ], + [ + 214, + 216 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 231, + 232 + ], + [ + 236, + 239 + ], + [ + 240, + 242 + ], + [ + 245, + 246 + ], + [ + 247, + 248 + ], + [ + 267, + 268 + ], + [ + 272, + 273 + ], + [ + 277, + 280 + ], + [ + 281, + 282 + ] + ] + } + }, + { + "filename": "libvips/colour/XYZ2Yxy.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 12, + 40 + ], + [ + 52, + 69 + ], + [ + 72, + 79 + ], + [ + 83, + 104 + ], + [ + 113, + 127 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 60, + 62 + ], + [ + 65, + 66 + ], + [ + 75, + 76 + ], + [ + 86, + 87 + ], + [ + 89, + 90 + ], + [ + 92, + 93 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 116, + 117 + ], + [ + 121, + 124 + ], + [ + 125, + 126 + ] + ] + } + }, + { + "filename": "libvips/colour/XYZ2scRGB.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 10, + 38 + ], + [ + 50, + 83 + ], + [ + 85, + 92 + ], + [ + 96, + 117 + ], + [ + 126, + 140 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 29 + ], + [ + 34, + 35 + ], + [ + 53, + 54 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 72, + 73 + ], + [ + 74, + 76 + ], + [ + 79, + 80 + ], + [ + 88, + 89 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 105, + 106 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 129, + 130 + ], + [ + 134, + 137 + ], + [ + 138, + 139 + ] + ] + } + }, + { + "filename": "libvips/colour/Yxy2XYZ.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 14, + 42 + ], + [ + 54, + 79 + ], + [ + 94, + 115 + ], + [ + 124, + 138 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 62, + 64 + ], + [ + 67, + 68 + ], + [ + 74, + 76 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 127, + 128 + ], + [ + 132, + 135 + ], + [ + 136, + 137 + ] + ] + } + }, + { + "filename": "libvips/colour/colour.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 53, + 61 + ], + [ + 66, + 91 + ], + [ + 97, + 110 + ], + [ + 112, + 136 + ], + [ + 138, + 157 + ], + [ + 216, + 368 + ], + [ + 370, + 425 + ], + [ + 427, + 492 + ], + [ + 496, + 511 + ], + [ + 512, + 702 + ], + [ + 707, + 752 + ], + [ + 768, + 787 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 56, + 58 + ], + [ + 69, + 72 + ], + [ + 73, + 75 + ], + [ + 80, + 82 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 100, + 102 + ], + [ + 106, + 107 + ], + [ + 115, + 116 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 126, + 127 + ], + [ + 132, + 133 + ], + [ + 141, + 144 + ], + [ + 147, + 148 + ], + [ + 152, + 154 + ], + [ + 219, + 220 + ], + [ + 226, + 228 + ], + [ + 230, + 233 + ], + [ + 237, + 243 + ], + [ + 244, + 246 + ], + [ + 247, + 248 + ], + [ + 249, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 268, + 270 + ], + [ + 272, + 273 + ], + [ + 278, + 281 + ], + [ + 283, + 285 + ], + [ + 286, + 290 + ], + [ + 291, + 294 + ], + [ + 298, + 299 + ], + [ + 301, + 303 + ], + [ + 307, + 321 + ], + [ + 324, + 325 + ], + [ + 327, + 333 + ], + [ + 339, + 343 + ], + [ + 349, + 352 + ], + [ + 353, + 358 + ], + [ + 361, + 362 + ], + [ + 363, + 365 + ], + [ + 373, + 377 + ], + [ + 379, + 384 + ], + [ + 385, + 387 + ], + [ + 392, + 393 + ], + [ + 394, + 395 + ], + [ + 398, + 399 + ], + [ + 400, + 403 + ], + [ + 408, + 409 + ], + [ + 413, + 418 + ], + [ + 421, + 422 + ], + [ + 430, + 432 + ], + [ + 434, + 435 + ], + [ + 436, + 439 + ], + [ + 442, + 446 + ], + [ + 449, + 450 + ], + [ + 452, + 453 + ], + [ + 459, + 461 + ], + [ + 462, + 463 + ], + [ + 466, + 467 + ], + [ + 468, + 470 + ], + [ + 475, + 476 + ], + [ + 478, + 483 + ], + [ + 486, + 487 + ], + [ + 488, + 489 + ], + [ + 499, + 500 + ], + [ + 502, + 503 + ], + [ + 504, + 508 + ], + [ + 515, + 516 + ], + [ + 517, + 520 + ], + [ + 523, + 527 + ], + [ + 528, + 529 + ], + [ + 531, + 534 + ], + [ + 537, + 538 + ], + [ + 540, + 544 + ], + [ + 548, + 549 + ], + [ + 552, + 554 + ], + [ + 555, + 556 + ], + [ + 559, + 560 + ], + [ + 561, + 563 + ], + [ + 568, + 569 + ], + [ + 571, + 576 + ], + [ + 579, + 580 + ], + [ + 586, + 588 + ], + [ + 590, + 591 + ], + [ + 592, + 594 + ], + [ + 599, + 600 + ], + [ + 604, + 607 + ], + [ + 610, + 613 + ], + [ + 616, + 617 + ], + [ + 620, + 625 + ], + [ + 628, + 633 + ], + [ + 638, + 642 + ], + [ + 645, + 649 + ], + [ + 652, + 654 + ], + [ + 658, + 659 + ], + [ + 663, + 665 + ], + [ + 666, + 667 + ], + [ + 670, + 671 + ], + [ + 672, + 674 + ], + [ + 679, + 680 + ], + [ + 682, + 693 + ], + [ + 696, + 697 + ], + [ + 698, + 699 + ], + [ + 710, + 711 + ], + [ + 712, + 741 + ], + [ + 742, + 745 + ], + [ + 746, + 749 + ], + [ + 771, + 773 + ], + [ + 777, + 778 + ], + [ + 783, + 786 + ] + ] + } + }, + { + "filename": "libvips/colour/colourspace.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 24 + ], + [ + 25, + 53 + ], + [ + 69, + 84 + ], + [ + 85, + 112 + ], + [ + 113, + 193 + ], + [ + 241, + 251 + ], + [ + 256, + 265 + ], + [ + 268, + 279 + ], + [ + 280, + 294 + ], + [ + 296, + 314 + ], + [ + 321, + 419 + ], + [ + 424, + 436 + ], + [ + 437, + 454 + ], + [ + 459, + 588 + ], + [ + 599, + 606 + ], + [ + 611, + 626 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 20, + 21 + ], + [ + 28, + 29 + ], + [ + 30, + 34 + ], + [ + 35, + 44 + ], + [ + 49, + 50 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 80, + 81 + ], + [ + 88, + 89 + ], + [ + 90, + 94 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 102, + 106 + ], + [ + 108, + 109 + ], + [ + 116, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 136 + ], + [ + 138, + 139 + ], + [ + 140, + 143 + ], + [ + 145, + 147 + ], + [ + 149, + 150 + ], + [ + 153, + 154 + ], + [ + 160, + 162 + ], + [ + 163, + 164 + ], + [ + 167, + 168 + ], + [ + 169, + 172 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 180, + 183 + ], + [ + 185, + 186 + ], + [ + 188, + 190 + ], + [ + 244, + 245 + ], + [ + 246, + 248 + ], + [ + 259, + 262 + ], + [ + 271, + 276 + ], + [ + 283, + 291 + ], + [ + 299, + 304 + ], + [ + 310, + 311 + ], + [ + 324, + 325 + ], + [ + 326, + 328 + ], + [ + 330, + 332 + ], + [ + 336, + 340 + ], + [ + 343, + 344 + ], + [ + 349, + 354 + ], + [ + 357, + 358 + ], + [ + 359, + 361 + ], + [ + 364, + 368 + ], + [ + 372, + 373 + ], + [ + 376, + 382 + ], + [ + 384, + 387 + ], + [ + 388, + 389 + ], + [ + 391, + 396 + ], + [ + 399, + 400 + ], + [ + 401, + 403 + ], + [ + 408, + 409 + ], + [ + 413, + 414 + ], + [ + 415, + 416 + ], + [ + 427, + 428 + ], + [ + 432, + 433 + ], + [ + 440, + 442 + ], + [ + 444, + 447 + ], + [ + 448, + 449 + ], + [ + 462, + 463 + ], + [ + 465, + 466 + ], + [ + 467, + 468 + ], + [ + 471, + 475 + ], + [ + 480, + 482 + ], + [ + 488, + 492 + ], + [ + 494, + 495 + ], + [ + 497, + 498 + ], + [ + 502, + 503 + ], + [ + 507, + 509 + ], + [ + 510, + 511 + ], + [ + 513, + 516 + ], + [ + 517, + 525 + ], + [ + 527, + 530 + ], + [ + 533, + 536 + ], + [ + 537, + 538 + ], + [ + 541, + 542 + ], + [ + 543, + 546 + ], + [ + 551, + 552 + ], + [ + 556, + 559 + ], + [ + 560, + 561 + ], + [ + 562, + 567 + ], + [ + 568, + 581 + ], + [ + 584, + 585 + ], + [ + 602, + 603 + ], + [ + 614, + 616 + ], + [ + 620, + 623 + ], + [ + 624, + 625 + ] + ] + } + }, + { + "filename": "libvips/colour/dE00.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 51, + 58 + ], + [ + 62, + 172 + ], + [ + 181, + 188 + ], + [ + 197, + 211 + ], + [ + 212, + 221 + ], + [ + 222, + 243 + ], + [ + 253, + 267 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 54, + 55 + ], + [ + 65, + 68 + ], + [ + 72, + 75 + ], + [ + 76, + 105 + ], + [ + 108, + 110 + ], + [ + 115, + 116 + ], + [ + 122, + 124 + ], + [ + 128, + 130 + ], + [ + 135, + 136 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 152 + ], + [ + 156, + 157 + ], + [ + 162, + 163 + ], + [ + 168, + 169 + ], + [ + 184, + 185 + ], + [ + 200, + 201 + ], + [ + 206, + 208 + ], + [ + 215, + 218 + ], + [ + 225, + 226 + ], + [ + 228, + 229 + ], + [ + 231, + 232 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 256, + 257 + ], + [ + 261, + 264 + ], + [ + 265, + 266 + ] + ] + } + }, + { + "filename": "libvips/colour/dE76.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 12, + 40 + ], + [ + 56, + 63 + ], + [ + 70, + 103 + ], + [ + 104, + 125 + ], + [ + 135, + 149 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 59, + 60 + ], + [ + 73, + 74 + ], + [ + 79, + 80 + ], + [ + 85, + 87 + ], + [ + 88, + 91 + ], + [ + 94, + 95 + ], + [ + 99, + 100 + ], + [ + 107, + 108 + ], + [ + 110, + 111 + ], + [ + 113, + 114 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 138, + 139 + ], + [ + 143, + 146 + ], + [ + 147, + 148 + ] + ] + } + }, + { + "filename": "libvips/colour/dECMC.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 49, + 73 + ], + [ + 79, + 86 + ], + [ + 90, + 104 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 52, + 53 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 62 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 82, + 83 + ], + [ + 93, + 94 + ], + [ + 98, + 101 + ], + [ + 102, + 103 + ] + ] + } + }, + { + "filename": "libvips/colour/float2rad.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 12, + 47 + ], + [ + 116, + 174 + ], + [ + 176, + 215 + ], + [ + 233, + 247 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 42, + 44 + ], + [ + 119, + 128 + ], + [ + 129, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 142, + 171 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 187, + 189 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 201, + 203 + ], + [ + 208, + 209 + ], + [ + 210, + 212 + ], + [ + 236, + 237 + ], + [ + 241, + 244 + ], + [ + 245, + 246 + ] + ] + } + }, + { + "filename": "libvips/colour/icc_transform.c", + "line_filter": { + "diff_chunks": [ + [ + 41, + 48 + ], + [ + 49, + 84 + ], + [ + 108, + 115 + ], + [ + 118, + 156 + ], + [ + 171, + 316 + ], + [ + 323, + 377 + ], + [ + 394, + 424 + ], + [ + 425, + 465 + ], + [ + 478, + 531 + ], + [ + 534, + 620 + ], + [ + 631, + 693 + ], + [ + 694, + 729 + ], + [ + 739, + 769 + ], + [ + 770, + 828 + ], + [ + 835, + 889 + ], + [ + 895, + 907 + ], + [ + 909, + 982 + ], + [ + 984, + 1017 + ], + [ + 1025, + 1033 + ], + [ + 1040, + 1094 + ], + [ + 1102, + 1203 + ], + [ + 1214, + 1221 + ], + [ + 1225, + 1322 + ], + [ + 1323, + 1348 + ], + [ + 1361, + 1380 + ], + [ + 1381, + 1397 + ], + [ + 1407, + 1419 + ], + [ + 1420, + 1436 + ], + [ + 1458, + 1492 + ] + ], + "lines_added": [ + [ + 44, + 45 + ], + [ + 52, + 53 + ], + [ + 54, + 58 + ], + [ + 59, + 68 + ], + [ + 73, + 74 + ], + [ + 80, + 81 + ], + [ + 111, + 112 + ], + [ + 121, + 123 + ], + [ + 129, + 130 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 140, + 152 + ], + [ + 174, + 175 + ], + [ + 180, + 181 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 190, + 193 + ], + [ + 194, + 196 + ], + [ + 199, + 201 + ], + [ + 204, + 205 + ], + [ + 210, + 211 + ], + [ + 212, + 214 + ], + [ + 219, + 223 + ], + [ + 226, + 242 + ], + [ + 245, + 246 + ], + [ + 247, + 248 + ], + [ + 249, + 252 + ], + [ + 253, + 254 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 266, + 271 + ], + [ + 273, + 284 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 290, + 294 + ], + [ + 297, + 301 + ], + [ + 305, + 306 + ], + [ + 312, + 313 + ], + [ + 326, + 335 + ], + [ + 338, + 340 + ], + [ + 343, + 346 + ], + [ + 347, + 353 + ], + [ + 355, + 356 + ], + [ + 357, + 358 + ], + [ + 359, + 365 + ], + [ + 368, + 374 + ], + [ + 397, + 399 + ], + [ + 400, + 404 + ], + [ + 407, + 409 + ], + [ + 410, + 411 + ], + [ + 414, + 415 + ], + [ + 416, + 421 + ], + [ + 428, + 429 + ], + [ + 431, + 436 + ], + [ + 437, + 439 + ], + [ + 440, + 441 + ], + [ + 446, + 447 + ], + [ + 451, + 455 + ], + [ + 456, + 457 + ], + [ + 461, + 462 + ], + [ + 481, + 487 + ], + [ + 489, + 495 + ], + [ + 498, + 502 + ], + [ + 503, + 504 + ], + [ + 505, + 508 + ], + [ + 509, + 520 + ], + [ + 521, + 525 + ], + [ + 526, + 528 + ], + [ + 537, + 539 + ], + [ + 543, + 544 + ], + [ + 546, + 550 + ], + [ + 552, + 556 + ], + [ + 559, + 560 + ], + [ + 562, + 573 + ], + [ + 577, + 578 + ], + [ + 579, + 583 + ], + [ + 585, + 591 + ], + [ + 593, + 594 + ], + [ + 596, + 597 + ], + [ + 601, + 603 + ], + [ + 604, + 605 + ], + [ + 607, + 610 + ], + [ + 613, + 614 + ], + [ + 616, + 617 + ], + [ + 634, + 636 + ], + [ + 637, + 638 + ], + [ + 644, + 649 + ], + [ + 653, + 654 + ], + [ + 655, + 661 + ], + [ + 666, + 674 + ], + [ + 677, + 681 + ], + [ + 683, + 684 + ], + [ + 687, + 688 + ], + [ + 689, + 690 + ], + [ + 697, + 698 + ], + [ + 700, + 703 + ], + [ + 704, + 706 + ], + [ + 707, + 710 + ], + [ + 711, + 713 + ], + [ + 714, + 717 + ], + [ + 718, + 720 + ], + [ + 721, + 722 + ], + [ + 725, + 726 + ], + [ + 742, + 743 + ], + [ + 745, + 746 + ], + [ + 751, + 754 + ], + [ + 755, + 756 + ], + [ + 757, + 758 + ], + [ + 759, + 760 + ], + [ + 761, + 762 + ], + [ + 764, + 766 + ], + [ + 773, + 775 + ], + [ + 778, + 781 + ], + [ + 783, + 784 + ], + [ + 786, + 788 + ], + [ + 791, + 795 + ], + [ + 796, + 799 + ], + [ + 805, + 807 + ], + [ + 810, + 814 + ], + [ + 815, + 818 + ], + [ + 823, + 825 + ], + [ + 838, + 840 + ], + [ + 841, + 842 + ], + [ + 843, + 845 + ], + [ + 846, + 847 + ], + [ + 848, + 849 + ], + [ + 854, + 855 + ], + [ + 856, + 857 + ], + [ + 858, + 859 + ], + [ + 864, + 865 + ], + [ + 869, + 875 + ], + [ + 876, + 882 + ], + [ + 885, + 886 + ], + [ + 898, + 899 + ], + [ + 901, + 902 + ], + [ + 903, + 904 + ], + [ + 912, + 913 + ], + [ + 914, + 916 + ], + [ + 917, + 918 + ], + [ + 919, + 920 + ], + [ + 921, + 922 + ], + [ + 923, + 924 + ], + [ + 926, + 929 + ], + [ + 930, + 935 + ], + [ + 938, + 943 + ], + [ + 945, + 947 + ], + [ + 948, + 949 + ], + [ + 954, + 956 + ], + [ + 959, + 960 + ], + [ + 964, + 965 + ], + [ + 966, + 967 + ], + [ + 969, + 970 + ], + [ + 971, + 972 + ], + [ + 973, + 974 + ], + [ + 975, + 976 + ], + [ + 978, + 979 + ], + [ + 987, + 988 + ], + [ + 991, + 993 + ], + [ + 996, + 997 + ], + [ + 1001, + 1002 + ], + [ + 1003, + 1004 + ], + [ + 1006, + 1007 + ], + [ + 1008, + 1009 + ], + [ + 1011, + 1012 + ], + [ + 1013, + 1014 + ], + [ + 1028, + 1030 + ], + [ + 1043, + 1045 + ], + [ + 1046, + 1048 + ], + [ + 1049, + 1050 + ], + [ + 1051, + 1052 + ], + [ + 1054, + 1055 + ], + [ + 1059, + 1060 + ], + [ + 1061, + 1062 + ], + [ + 1063, + 1064 + ], + [ + 1069, + 1070 + ], + [ + 1074, + 1087 + ], + [ + 1090, + 1091 + ], + [ + 1105, + 1106 + ], + [ + 1108, + 1109 + ], + [ + 1110, + 1111 + ], + [ + 1115, + 1118 + ], + [ + 1119, + 1123 + ], + [ + 1126, + 1129 + ], + [ + 1130, + 1133 + ], + [ + 1135, + 1137 + ], + [ + 1138, + 1139 + ], + [ + 1144, + 1146 + ], + [ + 1149, + 1150 + ], + [ + 1153, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1157, + 1158 + ], + [ + 1163, + 1165 + ], + [ + 1169, + 1175 + ], + [ + 1176, + 1196 + ], + [ + 1199, + 1200 + ], + [ + 1217, + 1218 + ], + [ + 1228, + 1231 + ], + [ + 1232, + 1233 + ], + [ + 1235, + 1236 + ], + [ + 1238, + 1242 + ], + [ + 1248, + 1249 + ], + [ + 1252, + 1254 + ], + [ + 1256, + 1259 + ], + [ + 1262, + 1263 + ], + [ + 1269, + 1270 + ], + [ + 1272, + 1275 + ], + [ + 1276, + 1277 + ], + [ + 1281, + 1282 + ], + [ + 1287, + 1289 + ], + [ + 1291, + 1292 + ], + [ + 1293, + 1295 + ], + [ + 1296, + 1297 + ], + [ + 1299, + 1300 + ], + [ + 1302, + 1314 + ], + [ + 1316, + 1317 + ], + [ + 1318, + 1319 + ], + [ + 1326, + 1327 + ], + [ + 1328, + 1329 + ], + [ + 1332, + 1333 + ], + [ + 1334, + 1336 + ], + [ + 1337, + 1338 + ], + [ + 1341, + 1343 + ], + [ + 1344, + 1345 + ], + [ + 1364, + 1365 + ], + [ + 1368, + 1369 + ], + [ + 1372, + 1373 + ], + [ + 1376, + 1377 + ], + [ + 1384, + 1385 + ], + [ + 1389, + 1392 + ], + [ + 1393, + 1394 + ], + [ + 1410, + 1411 + ], + [ + 1412, + 1416 + ], + [ + 1423, + 1424 + ], + [ + 1428, + 1431 + ], + [ + 1432, + 1433 + ], + [ + 1461, + 1462 + ], + [ + 1465, + 1466 + ], + [ + 1471, + 1472 + ], + [ + 1473, + 1474 + ], + [ + 1479, + 1481 + ], + [ + 1485, + 1489 + ], + [ + 1490, + 1491 + ] + ] + } + }, + { + "filename": "libvips/colour/pcolour.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 66 + ], + [ + 68, + 75 + ], + [ + 93, + 118 + ], + [ + 125, + 150 + ], + [ + 163, + 188 + ], + [ + 200, + 210 + ], + [ + 211, + 229 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 56, + 58 + ], + [ + 62, + 63 + ], + [ + 71, + 72 + ], + [ + 96, + 97 + ], + [ + 102, + 114 + ], + [ + 128, + 129 + ], + [ + 134, + 146 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 172, + 184 + ], + [ + 203, + 204 + ], + [ + 205, + 207 + ], + [ + 214, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 223 + ] + ] + } + }, + { + "filename": "libvips/colour/profile_load.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 56, + 181 + ], + [ + 192, + 235 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 59, + 60 + ], + [ + 62, + 63 + ], + [ + 67, + 69 + ], + [ + 75, + 78 + ], + [ + 79, + 80 + ], + [ + 83, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 94 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 108, + 109 + ], + [ + 110, + 112 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ], + [ + 117, + 122 + ], + [ + 123, + 126 + ], + [ + 128, + 129 + ], + [ + 130, + 132 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 148, + 149 + ], + [ + 151, + 164 + ], + [ + 167, + 168 + ], + [ + 172, + 173 + ], + [ + 177, + 178 + ], + [ + 195, + 196 + ], + [ + 200, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 208 + ], + [ + 210, + 211 + ], + [ + 214, + 216 + ], + [ + 217, + 218 + ], + [ + 220, + 224 + ], + [ + 225, + 227 + ], + [ + 228, + 230 + ], + [ + 233, + 234 + ] + ] + } + }, + { + "filename": "libvips/colour/rad2float.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 12, + 47 + ], + [ + 116, + 153 + ], + [ + 156, + 194 + ], + [ + 210, + 224 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 42, + 44 + ], + [ + 119, + 128 + ], + [ + 129, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 145, + 146 + ], + [ + 147, + 150 + ], + [ + 159, + 160 + ], + [ + 162, + 163 + ], + [ + 169, + 171 + ], + [ + 174, + 175 + ], + [ + 177, + 178 + ], + [ + 180, + 182 + ], + [ + 187, + 188 + ], + [ + 189, + 191 + ], + [ + 213, + 214 + ], + [ + 218, + 221 + ], + [ + 222, + 223 + ] + ] + } + }, + { + "filename": "libvips/colour/sRGB2HSV.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 45, + 120 + ], + [ + 124, + 146 + ], + [ + 160, + 167 + ], + [ + 168, + 182 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 48, + 49 + ], + [ + 51, + 52 + ], + [ + 58, + 59 + ], + [ + 64, + 66 + ], + [ + 72, + 73 + ], + [ + 77, + 78 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 90, + 91 + ], + [ + 95, + 96 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 127, + 128 + ], + [ + 130, + 131 + ], + [ + 133, + 134 + ], + [ + 139, + 140 + ], + [ + 141, + 143 + ], + [ + 163, + 164 + ], + [ + 171, + 172 + ], + [ + 176, + 179 + ], + [ + 180, + 181 + ] + ] + } + }, + { + "filename": "libvips/colour/sRGB2scRGB.c", + "line_filter": { + "diff_chunks": [ + [ + 23, + 51 + ], + [ + 69, + 91 + ], + [ + 93, + 101 + ], + [ + 105, + 112 + ], + [ + 113, + 120 + ], + [ + 124, + 137 + ], + [ + 139, + 147 + ], + [ + 151, + 158 + ], + [ + 159, + 166 + ], + [ + 168, + 299 + ], + [ + 304, + 312 + ], + [ + 313, + 327 + ] + ], + "lines_added": [ + [ + 26, + 42 + ], + [ + 47, + 48 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 81, + 83 + ], + [ + 86, + 88 + ], + [ + 96, + 98 + ], + [ + 108, + 109 + ], + [ + 116, + 117 + ], + [ + 127, + 129 + ], + [ + 132, + 134 + ], + [ + 142, + 144 + ], + [ + 154, + 155 + ], + [ + 162, + 163 + ], + [ + 171, + 173 + ], + [ + 175, + 176 + ], + [ + 180, + 182 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 188, + 190 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 199, + 201 + ], + [ + 202, + 203 + ], + [ + 204, + 206 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 220, + 221 + ], + [ + 226, + 228 + ], + [ + 230, + 237 + ], + [ + 240, + 241 + ], + [ + 245, + 249 + ], + [ + 253, + 258 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 268, + 269 + ], + [ + 270, + 271 + ], + [ + 276, + 277 + ], + [ + 281, + 292 + ], + [ + 295, + 296 + ], + [ + 307, + 309 + ], + [ + 316, + 317 + ], + [ + 321, + 324 + ], + [ + 325, + 326 + ] + ] + } + }, + { + "filename": "libvips/colour/scRGB2BW.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 57, + 82 + ], + [ + 83, + 111 + ], + [ + 112, + 181 + ], + [ + 186, + 261 + ], + [ + 271, + 293 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 61 + ], + [ + 65, + 67 + ], + [ + 70, + 71 + ], + [ + 76, + 77 + ], + [ + 78, + 79 + ], + [ + 86, + 88 + ], + [ + 94, + 96 + ], + [ + 99, + 100 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 115, + 117 + ], + [ + 123, + 125 + ], + [ + 128, + 129 + ], + [ + 133, + 135 + ], + [ + 136, + 137 + ], + [ + 138, + 143 + ], + [ + 144, + 147 + ], + [ + 148, + 150 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 160, + 161 + ], + [ + 163, + 164 + ], + [ + 165, + 166 + ], + [ + 168, + 169 + ], + [ + 170, + 172 + ], + [ + 174, + 176 + ], + [ + 177, + 178 + ], + [ + 189, + 192 + ], + [ + 194, + 196 + ], + [ + 199, + 203 + ], + [ + 208, + 213 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 231, + 232 + ], + [ + 236, + 254 + ], + [ + 257, + 258 + ], + [ + 274, + 276 + ], + [ + 282, + 283 + ], + [ + 287, + 290 + ], + [ + 291, + 292 + ] + ] + } + }, + { + "filename": "libvips/colour/scRGB2XYZ.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 12, + 40 + ], + [ + 52, + 69 + ], + [ + 71, + 78 + ], + [ + 81, + 102 + ], + [ + 111, + 125 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 60, + 62 + ], + [ + 65, + 66 + ], + [ + 74, + 75 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 96, + 97 + ], + [ + 98, + 99 + ], + [ + 114, + 115 + ], + [ + 119, + 122 + ], + [ + 123, + 124 + ] + ] + } + }, + { + "filename": "libvips/colour/scRGB2sRGB.c", + "line_filter": { + "diff_chunks": [ + [ + 31, + 59 + ], + [ + 82, + 106 + ], + [ + 109, + 136 + ], + [ + 139, + 208 + ], + [ + 213, + 287 + ], + [ + 297, + 319 + ] + ], + "lines_added": [ + [ + 34, + 50 + ], + [ + 55, + 56 + ], + [ + 85, + 86 + ], + [ + 90, + 92 + ], + [ + 95, + 96 + ], + [ + 102, + 103 + ], + [ + 112, + 114 + ], + [ + 120, + 122 + ], + [ + 125, + 126 + ], + [ + 132, + 133 + ], + [ + 142, + 144 + ], + [ + 150, + 152 + ], + [ + 155, + 156 + ], + [ + 160, + 162 + ], + [ + 163, + 164 + ], + [ + 165, + 170 + ], + [ + 171, + 174 + ], + [ + 175, + 177 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 195, + 196 + ], + [ + 197, + 199 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 216, + 219 + ], + [ + 221, + 223 + ], + [ + 226, + 230 + ], + [ + 234, + 239 + ], + [ + 241, + 242 + ], + [ + 243, + 244 + ], + [ + 247, + 248 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ], + [ + 257, + 258 + ], + [ + 262, + 280 + ], + [ + 283, + 284 + ], + [ + 300, + 302 + ], + [ + 308, + 309 + ], + [ + 313, + 316 + ], + [ + 317, + 318 + ] + ] + } + }, + { + "filename": "libvips/conversion/arrayjoin.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 74, + 126 + ], + [ + 129, + 153 + ], + [ + 162, + 230 + ], + [ + 235, + 274 + ], + [ + 285, + 292 + ], + [ + 306, + 430 + ], + [ + 448, + 473 + ], + [ + 477, + 491 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 77, + 78 + ], + [ + 80, + 82 + ], + [ + 85, + 87 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 100 + ], + [ + 104, + 105 + ], + [ + 108, + 111 + ], + [ + 113, + 114 + ], + [ + 116, + 120 + ], + [ + 122, + 123 + ], + [ + 132, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 150 + ], + [ + 165, + 167 + ], + [ + 168, + 169 + ], + [ + 171, + 173 + ], + [ + 176, + 179 + ], + [ + 184, + 188 + ], + [ + 194, + 196 + ], + [ + 197, + 198 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 209, + 210 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 220, + 221 + ], + [ + 225, + 227 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 246, + 248 + ], + [ + 253, + 255 + ], + [ + 260, + 262 + ], + [ + 265, + 266 + ], + [ + 270, + 271 + ], + [ + 288, + 289 + ], + [ + 309, + 314 + ], + [ + 316, + 319 + ], + [ + 323, + 327 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 334, + 337 + ], + [ + 338, + 339 + ], + [ + 344, + 345 + ], + [ + 349, + 352 + ], + [ + 353, + 355 + ], + [ + 356, + 359 + ], + [ + 360, + 362 + ], + [ + 363, + 366 + ], + [ + 367, + 369 + ], + [ + 370, + 373 + ], + [ + 374, + 376 + ], + [ + 377, + 380 + ], + [ + 381, + 383 + ], + [ + 384, + 387 + ], + [ + 388, + 390 + ], + [ + 391, + 394 + ], + [ + 395, + 397 + ], + [ + 398, + 401 + ], + [ + 402, + 404 + ], + [ + 407, + 408 + ], + [ + 411, + 413 + ], + [ + 417, + 418 + ], + [ + 419, + 420 + ], + [ + 422, + 425 + ], + [ + 426, + 427 + ], + [ + 451, + 453 + ], + [ + 457, + 458 + ], + [ + 459, + 460 + ], + [ + 463, + 465 + ], + [ + 468, + 470 + ], + [ + 480, + 481 + ], + [ + 485, + 488 + ], + [ + 489, + 490 + ] + ] + } + }, + { + "filename": "libvips/conversion/autorot.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 44 + ], + [ + 68, + 89 + ], + [ + 94, + 123 + ], + [ + 157, + 232 + ], + [ + 240, + 266 + ] + ], + "lines_added": [ + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 35 + ], + [ + 40, + 41 + ], + [ + 71, + 72 + ], + [ + 74, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 82, + 83 + ], + [ + 85, + 86 + ], + [ + 97, + 98 + ], + [ + 99, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 112 + ], + [ + 119, + 120 + ], + [ + 162, + 163 + ], + [ + 165, + 166 + ], + [ + 167, + 170 + ], + [ + 173, + 176 + ], + [ + 181, + 183 + ], + [ + 185, + 186 + ], + [ + 187, + 189 + ], + [ + 190, + 191 + ], + [ + 194, + 195 + ], + [ + 196, + 198 + ], + [ + 203, + 204 + ], + [ + 206, + 209 + ], + [ + 210, + 211 + ], + [ + 212, + 215 + ], + [ + 216, + 218 + ], + [ + 219, + 222 + ], + [ + 223, + 225 + ], + [ + 228, + 229 + ], + [ + 243, + 244 + ], + [ + 245, + 248 + ], + [ + 249, + 250 + ], + [ + 255, + 256 + ], + [ + 260, + 263 + ], + [ + 264, + 265 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandary.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 32, + 60 + ], + [ + 77, + 108 + ], + [ + 109, + 117 + ], + [ + 119, + 267 + ], + [ + 269, + 284 + ], + [ + 285, + 292 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 80, + 81 + ], + [ + 83, + 84 + ], + [ + 87, + 88 + ], + [ + 90, + 93 + ], + [ + 95, + 97 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 112, + 114 + ], + [ + 122, + 123 + ], + [ + 127, + 130 + ], + [ + 134, + 138 + ], + [ + 143, + 146 + ], + [ + 150, + 154 + ], + [ + 156, + 157 + ], + [ + 160, + 161 + ], + [ + 164, + 166 + ], + [ + 170, + 174 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 181 + ], + [ + 182, + 185 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 199 + ], + [ + 205, + 207 + ], + [ + 208, + 212 + ], + [ + 214, + 217 + ], + [ + 218, + 224 + ], + [ + 226, + 229 + ], + [ + 231, + 233 + ], + [ + 235, + 239 + ], + [ + 240, + 241 + ], + [ + 244, + 245 + ], + [ + 246, + 249 + ], + [ + 250, + 251 + ], + [ + 256, + 257 + ], + [ + 263, + 264 + ], + [ + 272, + 273 + ], + [ + 274, + 276 + ], + [ + 277, + 281 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandary.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 73, + 81 + ], + [ + 103, + 121 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 76, + 78 + ], + [ + 106, + 107 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandbool.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 58, + 171 + ], + [ + 173, + 190 + ], + [ + 204, + 211 + ], + [ + 212, + 260 + ], + [ + 267, + 300 + ], + [ + 308, + 324 + ], + [ + 332, + 348 + ], + [ + 356, + 370 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 61, + 62 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 72, + 79 + ], + [ + 81, + 84 + ], + [ + 88, + 90 + ], + [ + 94, + 96 + ], + [ + 97, + 98 + ], + [ + 100, + 127 + ], + [ + 129, + 130 + ], + [ + 131, + 164 + ], + [ + 166, + 168 + ], + [ + 176, + 179 + ], + [ + 181, + 183 + ], + [ + 185, + 187 + ], + [ + 207, + 208 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 219, + 220 + ], + [ + 225, + 226 + ], + [ + 231, + 234 + ], + [ + 235, + 236 + ], + [ + 237, + 240 + ], + [ + 241, + 244 + ], + [ + 247, + 248 + ], + [ + 253, + 255 + ], + [ + 256, + 257 + ], + [ + 270, + 271 + ], + [ + 276, + 277 + ], + [ + 279, + 280 + ], + [ + 286, + 288 + ], + [ + 292, + 295 + ], + [ + 296, + 297 + ], + [ + 311, + 312 + ], + [ + 316, + 319 + ], + [ + 320, + 321 + ], + [ + 335, + 336 + ], + [ + 340, + 343 + ], + [ + 344, + 345 + ], + [ + 359, + 360 + ], + [ + 364, + 367 + ], + [ + 368, + 369 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandfold.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 8, + 36 + ], + [ + 66, + 83 + ], + [ + 85, + 178 + ], + [ + 188, + 212 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 27 + ], + [ + 32, + 33 + ], + [ + 69, + 70 + ], + [ + 72, + 74 + ], + [ + 78, + 80 + ], + [ + 88, + 90 + ], + [ + 91, + 95 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 112, + 114 + ], + [ + 115, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 124 + ], + [ + 126, + 129 + ], + [ + 133, + 137 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 144, + 147 + ], + [ + 148, + 149 + ], + [ + 154, + 155 + ], + [ + 159, + 162 + ], + [ + 163, + 164 + ], + [ + 165, + 168 + ], + [ + 169, + 171 + ], + [ + 174, + 175 + ], + [ + 191, + 192 + ], + [ + 194, + 195 + ], + [ + 201, + 202 + ], + [ + 206, + 209 + ], + [ + 210, + 211 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandjoin.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 30, + 58 + ], + [ + 85, + 96 + ], + [ + 97, + 124 + ], + [ + 129, + 206 + ], + [ + 209, + 227 + ], + [ + 228, + 244 + ], + [ + 252, + 259 + ], + [ + 261, + 272 + ], + [ + 284, + 305 + ], + [ + 307, + 325 + ], + [ + 326, + 337 + ], + [ + 341, + 355 + ], + [ + 357, + 448 + ], + [ + 452, + 475 + ], + [ + 483, + 499 + ], + [ + 508, + 525 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 49 + ], + [ + 54, + 55 + ], + [ + 88, + 89 + ], + [ + 91, + 93 + ], + [ + 100, + 101 + ], + [ + 107, + 108 + ], + [ + 110, + 111 + ], + [ + 112, + 114 + ], + [ + 119, + 121 + ], + [ + 132, + 133 + ], + [ + 137, + 139 + ], + [ + 140, + 142 + ], + [ + 146, + 149 + ], + [ + 153, + 155 + ], + [ + 156, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 165 + ], + [ + 166, + 167 + ], + [ + 172, + 173 + ], + [ + 177, + 180 + ], + [ + 181, + 183 + ], + [ + 186, + 187 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 198, + 201 + ], + [ + 202, + 203 + ], + [ + 212, + 213 + ], + [ + 217, + 218 + ], + [ + 222, + 224 + ], + [ + 231, + 232 + ], + [ + 236, + 239 + ], + [ + 240, + 241 + ], + [ + 255, + 256 + ], + [ + 264, + 267 + ], + [ + 268, + 269 + ], + [ + 287, + 288 + ], + [ + 290, + 291 + ], + [ + 294, + 295 + ], + [ + 296, + 297 + ], + [ + 300, + 302 + ], + [ + 310, + 311 + ], + [ + 314, + 315 + ], + [ + 318, + 319 + ], + [ + 320, + 322 + ], + [ + 329, + 331 + ], + [ + 333, + 334 + ], + [ + 344, + 346 + ], + [ + 351, + 352 + ], + [ + 360, + 361 + ], + [ + 362, + 363 + ], + [ + 366, + 368 + ], + [ + 371, + 372 + ], + [ + 373, + 376 + ], + [ + 381, + 385 + ], + [ + 387, + 389 + ], + [ + 390, + 391 + ], + [ + 394, + 395 + ], + [ + 396, + 399 + ], + [ + 400, + 401 + ], + [ + 407, + 408 + ], + [ + 412, + 415 + ], + [ + 416, + 417 + ], + [ + 418, + 421 + ], + [ + 422, + 424 + ], + [ + 427, + 428 + ], + [ + 434, + 436 + ], + [ + 437, + 438 + ], + [ + 440, + 443 + ], + [ + 444, + 445 + ], + [ + 455, + 456 + ], + [ + 462, + 463 + ], + [ + 467, + 470 + ], + [ + 471, + 472 + ], + [ + 486, + 487 + ], + [ + 491, + 494 + ], + [ + 495, + 496 + ], + [ + 511, + 512 + ], + [ + 516, + 518 + ], + [ + 520, + 522 + ], + [ + 523, + 524 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandmean.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 41 + ], + [ + 64, + 169 + ], + [ + 170, + 177 + ], + [ + 178, + 221 + ], + [ + 224, + 232 + ], + [ + 234, + 248 + ] + ], + "lines_added": [ + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 32 + ], + [ + 37, + 38 + ], + [ + 67, + 68 + ], + [ + 71, + 86 + ], + [ + 89, + 104 + ], + [ + 107, + 122 + ], + [ + 124, + 126 + ], + [ + 130, + 132 + ], + [ + 135, + 160 + ], + [ + 161, + 163 + ], + [ + 164, + 166 + ], + [ + 173, + 174 + ], + [ + 181, + 184 + ], + [ + 187, + 189 + ], + [ + 190, + 191 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 198, + 199 + ], + [ + 204, + 205 + ], + [ + 209, + 212 + ], + [ + 213, + 214 + ], + [ + 217, + 218 + ], + [ + 227, + 229 + ], + [ + 237, + 238 + ], + [ + 242, + 245 + ], + [ + 246, + 247 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandrank.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 63, + 180 + ], + [ + 181, + 273 + ], + [ + 274, + 290 + ], + [ + 297, + 316 + ], + [ + 319, + 333 + ] + ], + "lines_added": [ + [ + 15, + 31 + ], + [ + 36, + 37 + ], + [ + 66, + 67 + ], + [ + 71, + 72 + ], + [ + 75, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 132 + ], + [ + 133, + 162 + ], + [ + 164, + 165 + ], + [ + 170, + 172 + ], + [ + 176, + 177 + ], + [ + 184, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 201, + 204 + ], + [ + 207, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 218, + 220 + ], + [ + 225, + 227 + ], + [ + 229, + 231 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 238, + 241 + ], + [ + 242, + 243 + ], + [ + 248, + 249 + ], + [ + 253, + 256 + ], + [ + 257, + 259 + ], + [ + 260, + 263 + ], + [ + 264, + 266 + ], + [ + 269, + 270 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 282, + 285 + ], + [ + 286, + 287 + ], + [ + 300, + 302 + ], + [ + 303, + 305 + ], + [ + 306, + 307 + ], + [ + 312, + 313 + ], + [ + 322, + 323 + ], + [ + 327, + 330 + ], + [ + 331, + 332 + ] + ] + } + }, + { + "filename": "libvips/conversion/bandunfold.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 8, + 36 + ], + [ + 66, + 85 + ], + [ + 87, + 181 + ], + [ + 191, + 200 + ], + [ + 201, + 215 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 27 + ], + [ + 32, + 33 + ], + [ + 69, + 70 + ], + [ + 72, + 74 + ], + [ + 79, + 82 + ], + [ + 90, + 92 + ], + [ + 93, + 96 + ], + [ + 97, + 98 + ], + [ + 102, + 103 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ], + [ + 111, + 113 + ], + [ + 115, + 117 + ], + [ + 118, + 120 + ], + [ + 121, + 122 + ], + [ + 123, + 127 + ], + [ + 129, + 132 + ], + [ + 136, + 140 + ], + [ + 141, + 142 + ], + [ + 145, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 152 + ], + [ + 157, + 158 + ], + [ + 162, + 165 + ], + [ + 166, + 167 + ], + [ + 168, + 171 + ], + [ + 172, + 174 + ], + [ + 177, + 178 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 204, + 205 + ], + [ + 209, + 212 + ], + [ + 213, + 214 + ] + ] + } + }, + { + "filename": "libvips/conversion/byteswap.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 64, + 217 + ], + [ + 220, + 252 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 67, + 68 + ], + [ + 72, + 74 + ], + [ + 76, + 77 + ], + [ + 78, + 79 + ], + [ + 80, + 82 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 97 + ], + [ + 102, + 103 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 112 + ], + [ + 114, + 115 + ], + [ + 117, + 127 + ], + [ + 132, + 134 + ], + [ + 137, + 138 + ], + [ + 142, + 143 + ], + [ + 144, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 160, + 161 + ], + [ + 163, + 165 + ], + [ + 168, + 171 + ], + [ + 172, + 174 + ], + [ + 175, + 178 + ], + [ + 179, + 183 + ], + [ + 184, + 185 + ], + [ + 188, + 189 + ], + [ + 190, + 193 + ], + [ + 194, + 195 + ], + [ + 200, + 201 + ], + [ + 205, + 208 + ], + [ + 209, + 210 + ], + [ + 213, + 214 + ], + [ + 223, + 224 + ], + [ + 230, + 231 + ], + [ + 235, + 238 + ], + [ + 239, + 240 + ], + [ + 245, + 246 + ], + [ + 247, + 249 + ], + [ + 250, + 251 + ] + ] + } + }, + { + "filename": "libvips/conversion/cache.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 54, + 133 + ], + [ + 148, + 182 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 57, + 58 + ], + [ + 64, + 65 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 72, + 73 + ], + [ + 74, + 76 + ], + [ + 77, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 88, + 90 + ], + [ + 91, + 92 + ], + [ + 97, + 98 + ], + [ + 100, + 103 + ], + [ + 104, + 105 + ], + [ + 106, + 109 + ], + [ + 110, + 112 + ], + [ + 113, + 116 + ], + [ + 117, + 119 + ], + [ + 120, + 123 + ], + [ + 124, + 126 + ], + [ + 129, + 130 + ], + [ + 151, + 153 + ], + [ + 155, + 156 + ], + [ + 158, + 159 + ], + [ + 164, + 165 + ], + [ + 171, + 172 + ], + [ + 176, + 179 + ], + [ + 180, + 181 + ] + ] + } + }, + { + "filename": "libvips/conversion/cast.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 9 + ], + [ + 60, + 88 + ], + [ + 116, + 561 + ], + [ + 571, + 583 + ], + [ + 584, + 600 + ], + [ + 602, + 623 + ], + [ + 625, + 646 + ], + [ + 648, + 669 + ], + [ + 671, + 692 + ], + [ + 694, + 715 + ], + [ + 717, + 738 + ], + [ + 740, + 761 + ], + [ + 763, + 784 + ], + [ + 786, + 807 + ], + [ + 809, + 828 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 63, + 64 + ], + [ + 65, + 69 + ], + [ + 70, + 79 + ], + [ + 84, + 85 + ], + [ + 119, + 120 + ], + [ + 123, + 127 + ], + [ + 128, + 129 + ], + [ + 130, + 132 + ], + [ + 138, + 149 + ], + [ + 153, + 164 + ], + [ + 165, + 177 + ], + [ + 182, + 193 + ], + [ + 194, + 195 + ], + [ + 196, + 211 + ], + [ + 212, + 225 + ], + [ + 231, + 239 + ], + [ + 245, + 255 + ], + [ + 258, + 266 + ], + [ + 269, + 279 + ], + [ + 282, + 293 + ], + [ + 296, + 308 + ], + [ + 309, + 356 + ], + [ + 358, + 359 + ], + [ + 363, + 365 + ], + [ + 368, + 451 + ], + [ + 453, + 454 + ], + [ + 455, + 456 + ], + [ + 459, + 460 + ], + [ + 461, + 462 + ], + [ + 463, + 465 + ], + [ + 466, + 467 + ], + [ + 468, + 470 + ], + [ + 471, + 472 + ], + [ + 475, + 477 + ], + [ + 478, + 481 + ], + [ + 483, + 485 + ], + [ + 487, + 493 + ], + [ + 496, + 499 + ], + [ + 502, + 506 + ], + [ + 507, + 508 + ], + [ + 511, + 512 + ], + [ + 513, + 516 + ], + [ + 517, + 518 + ], + [ + 523, + 524 + ], + [ + 528, + 531 + ], + [ + 532, + 533 + ], + [ + 534, + 537 + ], + [ + 538, + 540 + ], + [ + 541, + 544 + ], + [ + 545, + 547 + ], + [ + 550, + 551 + ], + [ + 555, + 556 + ], + [ + 557, + 558 + ], + [ + 574, + 575 + ], + [ + 579, + 580 + ], + [ + 587, + 588 + ], + [ + 592, + 595 + ], + [ + 596, + 597 + ], + [ + 605, + 606 + ], + [ + 610, + 611 + ], + [ + 615, + 618 + ], + [ + 619, + 620 + ], + [ + 628, + 629 + ], + [ + 633, + 634 + ], + [ + 638, + 641 + ], + [ + 642, + 643 + ], + [ + 651, + 652 + ], + [ + 656, + 657 + ], + [ + 661, + 664 + ], + [ + 665, + 666 + ], + [ + 674, + 675 + ], + [ + 679, + 680 + ], + [ + 684, + 687 + ], + [ + 688, + 689 + ], + [ + 697, + 698 + ], + [ + 702, + 703 + ], + [ + 707, + 710 + ], + [ + 711, + 712 + ], + [ + 720, + 721 + ], + [ + 725, + 726 + ], + [ + 730, + 733 + ], + [ + 734, + 735 + ], + [ + 743, + 744 + ], + [ + 748, + 749 + ], + [ + 753, + 756 + ], + [ + 757, + 758 + ], + [ + 766, + 767 + ], + [ + 771, + 772 + ], + [ + 776, + 779 + ], + [ + 780, + 781 + ], + [ + 789, + 790 + ], + [ + 794, + 795 + ], + [ + 799, + 802 + ], + [ + 803, + 804 + ], + [ + 812, + 813 + ], + [ + 817, + 818 + ], + [ + 822, + 825 + ], + [ + 826, + 827 + ] + ] + } + }, + { + "filename": "libvips/conversion/conversion.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 49, + 56 + ], + [ + 84, + 120 + ], + [ + 168, + 175 + ], + [ + 178, + 185 + ], + [ + 192, + 199 + ], + [ + 206, + 213 + ], + [ + 222, + 229 + ], + [ + 239, + 255 + ], + [ + 260, + 267 + ], + [ + 272, + 281 + ], + [ + 288, + 356 + ], + [ + 357, + 419 + ], + [ + 433, + 460 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 52, + 53 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 96, + 99 + ], + [ + 101, + 103 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 171, + 172 + ], + [ + 181, + 182 + ], + [ + 195, + 196 + ], + [ + 209, + 210 + ], + [ + 225, + 226 + ], + [ + 242, + 243 + ], + [ + 248, + 249 + ], + [ + 251, + 252 + ], + [ + 263, + 264 + ], + [ + 275, + 276 + ], + [ + 277, + 278 + ], + [ + 291, + 292 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 305, + 306 + ], + [ + 310, + 311 + ], + [ + 313, + 314 + ], + [ + 315, + 316 + ], + [ + 318, + 321 + ], + [ + 323, + 324 + ], + [ + 325, + 327 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 334, + 336 + ], + [ + 341, + 342 + ], + [ + 344, + 349 + ], + [ + 352, + 353 + ], + [ + 360, + 361 + ], + [ + 362, + 410 + ], + [ + 412, + 416 + ], + [ + 436, + 459 + ] + ] + } + }, + { + "filename": "libvips/conversion/copy.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 10 + ], + [ + 58, + 86 + ], + [ + 119, + 126 + ], + [ + 128, + 169 + ], + [ + 170, + 189 + ], + [ + 191, + 361 + ], + [ + 379, + 386 + ], + [ + 387, + 408 + ], + [ + 410, + 421 + ], + [ + 423, + 444 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 6, + 7 + ], + [ + 61, + 62 + ], + [ + 63, + 67 + ], + [ + 68, + 77 + ], + [ + 82, + 83 + ], + [ + 122, + 123 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 137, + 138 + ], + [ + 139, + 142 + ], + [ + 143, + 144 + ], + [ + 149, + 153 + ], + [ + 154, + 158 + ], + [ + 159, + 160 + ], + [ + 162, + 163 + ], + [ + 164, + 166 + ], + [ + 173, + 175 + ], + [ + 176, + 178 + ], + [ + 179, + 182 + ], + [ + 183, + 186 + ], + [ + 194, + 195 + ], + [ + 201, + 204 + ], + [ + 205, + 210 + ], + [ + 211, + 214 + ], + [ + 216, + 218 + ], + [ + 219, + 223 + ], + [ + 225, + 228 + ], + [ + 233, + 239 + ], + [ + 241, + 245 + ], + [ + 246, + 247 + ], + [ + 250, + 251 + ], + [ + 252, + 255 + ], + [ + 256, + 257 + ], + [ + 262, + 263 + ], + [ + 268, + 270 + ], + [ + 272, + 275 + ], + [ + 276, + 277 + ], + [ + 278, + 281 + ], + [ + 282, + 284 + ], + [ + 285, + 288 + ], + [ + 289, + 291 + ], + [ + 292, + 295 + ], + [ + 296, + 298 + ], + [ + 299, + 302 + ], + [ + 303, + 305 + ], + [ + 306, + 309 + ], + [ + 310, + 312 + ], + [ + 313, + 316 + ], + [ + 317, + 319 + ], + [ + 320, + 323 + ], + [ + 324, + 326 + ], + [ + 327, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 337 + ], + [ + 338, + 340 + ], + [ + 341, + 344 + ], + [ + 345, + 347 + ], + [ + 348, + 351 + ], + [ + 352, + 354 + ], + [ + 357, + 358 + ], + [ + 382, + 383 + ], + [ + 390, + 391 + ], + [ + 395, + 396 + ], + [ + 400, + 403 + ], + [ + 404, + 405 + ], + [ + 413, + 415 + ], + [ + 417, + 418 + ], + [ + 426, + 427 + ], + [ + 430, + 432 + ], + [ + 433, + 439 + ], + [ + 442, + 443 + ] + ] + } + }, + { + "filename": "libvips/conversion/embed.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 13 + ], + [ + 31, + 59 + ], + [ + 92, + 102 + ], + [ + 110, + 140 + ], + [ + 141, + 151 + ], + [ + 152, + 192 + ], + [ + 194, + 237 + ], + [ + 240, + 322 + ], + [ + 323, + 401 + ], + [ + 404, + 450 + ], + [ + 461, + 477 + ], + [ + 481, + 505 + ], + [ + 506, + 535 + ], + [ + 536, + 603 + ], + [ + 611, + 621 + ], + [ + 624, + 668 + ], + [ + 680, + 708 + ], + [ + 715, + 734 + ], + [ + 775, + 816 + ], + [ + 828, + 855 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 9, + 10 + ], + [ + 34, + 35 + ], + [ + 36, + 40 + ], + [ + 41, + 50 + ], + [ + 55, + 56 + ], + [ + 95, + 96 + ], + [ + 97, + 99 + ], + [ + 113, + 114 + ], + [ + 120, + 122 + ], + [ + 128, + 130 + ], + [ + 135, + 137 + ], + [ + 144, + 145 + ], + [ + 146, + 148 + ], + [ + 155, + 156 + ], + [ + 162, + 164 + ], + [ + 165, + 166 + ], + [ + 169, + 171 + ], + [ + 174, + 176 + ], + [ + 179, + 181 + ], + [ + 182, + 183 + ], + [ + 188, + 189 + ], + [ + 197, + 200 + ], + [ + 206, + 207 + ], + [ + 209, + 212 + ], + [ + 218, + 221 + ], + [ + 224, + 225 + ], + [ + 228, + 230 + ], + [ + 233, + 234 + ], + [ + 243, + 244 + ], + [ + 249, + 252 + ], + [ + 253, + 254 + ], + [ + 256, + 257 + ], + [ + 259, + 261 + ], + [ + 265, + 268 + ], + [ + 272, + 273 + ], + [ + 275, + 276 + ], + [ + 279, + 282 + ], + [ + 283, + 284 + ], + [ + 288, + 289 + ], + [ + 292, + 294 + ], + [ + 295, + 296 + ], + [ + 302, + 303 + ], + [ + 306, + 310 + ], + [ + 315, + 319 + ], + [ + 326, + 331 + ], + [ + 333, + 335 + ], + [ + 340, + 341 + ], + [ + 344, + 345 + ], + [ + 348, + 349 + ], + [ + 350, + 352 + ], + [ + 353, + 354 + ], + [ + 357, + 359 + ], + [ + 362, + 381 + ], + [ + 384, + 386 + ], + [ + 387, + 394 + ], + [ + 395, + 398 + ], + [ + 407, + 408 + ], + [ + 410, + 418 + ], + [ + 421, + 426 + ], + [ + 430, + 432 + ], + [ + 433, + 436 + ], + [ + 442, + 443 + ], + [ + 444, + 447 + ], + [ + 464, + 465 + ], + [ + 466, + 468 + ], + [ + 470, + 474 + ], + [ + 484, + 485 + ], + [ + 486, + 488 + ], + [ + 490, + 492 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 501, + 502 + ], + [ + 509, + 510 + ], + [ + 511, + 513 + ], + [ + 515, + 521 + ], + [ + 523, + 524 + ], + [ + 525, + 527 + ], + [ + 528, + 532 + ], + [ + 539, + 540 + ], + [ + 543, + 544 + ], + [ + 545, + 547 + ], + [ + 548, + 549 + ], + [ + 554, + 555 + ], + [ + 560, + 563 + ], + [ + 564, + 565 + ], + [ + 566, + 569 + ], + [ + 570, + 572 + ], + [ + 573, + 576 + ], + [ + 577, + 579 + ], + [ + 580, + 583 + ], + [ + 584, + 586 + ], + [ + 587, + 590 + ], + [ + 591, + 593 + ], + [ + 596, + 597 + ], + [ + 599, + 600 + ], + [ + 614, + 615 + ], + [ + 617, + 618 + ], + [ + 627, + 629 + ], + [ + 630, + 631 + ], + [ + 634, + 635 + ], + [ + 636, + 638 + ], + [ + 639, + 640 + ], + [ + 645, + 646 + ], + [ + 648, + 651 + ], + [ + 652, + 654 + ], + [ + 655, + 658 + ], + [ + 659, + 661 + ], + [ + 664, + 665 + ], + [ + 683, + 685 + ], + [ + 687, + 688 + ], + [ + 690, + 691 + ], + [ + 694, + 696 + ], + [ + 700, + 703 + ], + [ + 704, + 705 + ], + [ + 718, + 719 + ], + [ + 721, + 722 + ], + [ + 726, + 731 + ], + [ + 781, + 783 + ], + [ + 784, + 785 + ], + [ + 788, + 789 + ], + [ + 790, + 792 + ], + [ + 793, + 794 + ], + [ + 799, + 801 + ], + [ + 803, + 806 + ], + [ + 807, + 809 + ], + [ + 812, + 813 + ], + [ + 831, + 833 + ], + [ + 835, + 836 + ], + [ + 838, + 839 + ], + [ + 842, + 844 + ], + [ + 848, + 852 + ], + [ + 853, + 854 + ] + ] + } + }, + { + "filename": "libvips/conversion/extract.c", + "line_filter": { + "diff_chunks": [ + [ + 41, + 69 + ], + [ + 103, + 116 + ], + [ + 121, + 240 + ], + [ + 250, + 299 + ], + [ + 305, + 330 + ], + [ + 339, + 366 + ], + [ + 368, + 447 + ], + [ + 459, + 477 + ] + ], + "lines_added": [ + [ + 44, + 60 + ], + [ + 65, + 66 + ], + [ + 106, + 107 + ], + [ + 111, + 113 + ], + [ + 124, + 126 + ], + [ + 129, + 133 + ], + [ + 136, + 137 + ], + [ + 138, + 140 + ], + [ + 142, + 144 + ], + [ + 145, + 146 + ], + [ + 148, + 151 + ], + [ + 153, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 165 + ], + [ + 166, + 170 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 180 + ], + [ + 181, + 182 + ], + [ + 187, + 188 + ], + [ + 192, + 195 + ], + [ + 196, + 197 + ], + [ + 198, + 201 + ], + [ + 202, + 204 + ], + [ + 205, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 215 + ], + [ + 216, + 218 + ], + [ + 219, + 222 + ], + [ + 223, + 225 + ], + [ + 229, + 230 + ], + [ + 231, + 232 + ], + [ + 236, + 237 + ], + [ + 253, + 254 + ], + [ + 257, + 259 + ], + [ + 263, + 267 + ], + [ + 268, + 269 + ], + [ + 275, + 276 + ], + [ + 279, + 285 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ], + [ + 292, + 293 + ], + [ + 295, + 296 + ], + [ + 308, + 309 + ], + [ + 311, + 312 + ], + [ + 315, + 317 + ], + [ + 321, + 325 + ], + [ + 326, + 327 + ], + [ + 342, + 343 + ], + [ + 345, + 347 + ], + [ + 352, + 355 + ], + [ + 361, + 363 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 377, + 379 + ], + [ + 380, + 381 + ], + [ + 386, + 390 + ], + [ + 392, + 395 + ], + [ + 397, + 399 + ], + [ + 400, + 401 + ], + [ + 404, + 405 + ], + [ + 406, + 409 + ], + [ + 410, + 411 + ], + [ + 416, + 417 + ], + [ + 421, + 424 + ], + [ + 425, + 426 + ], + [ + 427, + 430 + ], + [ + 431, + 433 + ], + [ + 434, + 437 + ], + [ + 438, + 440 + ], + [ + 443, + 444 + ], + [ + 462, + 463 + ], + [ + 466, + 467 + ], + [ + 471, + 474 + ], + [ + 475, + 476 + ] + ] + } + }, + { + "filename": "libvips/conversion/falsecolour.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 48 + ], + [ + 66, + 73 + ], + [ + 330, + 401 + ], + [ + 404, + 418 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 69, + 70 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 337, + 338 + ], + [ + 339, + 341 + ], + [ + 342, + 348 + ], + [ + 353, + 361 + ], + [ + 364, + 365 + ], + [ + 366, + 369 + ], + [ + 374, + 375 + ], + [ + 379, + 382 + ], + [ + 383, + 384 + ], + [ + 387, + 388 + ], + [ + 393, + 394 + ], + [ + 397, + 398 + ], + [ + 407, + 408 + ], + [ + 412, + 415 + ], + [ + 416, + 417 + ] + ] + } + }, + { + "filename": "libvips/conversion/flatten.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 15, + 43 + ], + [ + 81, + 449 + ], + [ + 453, + 474 + ], + [ + 476, + 490 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 18, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 34 + ], + [ + 39, + 40 + ], + [ + 84, + 85 + ], + [ + 88, + 104 + ], + [ + 108, + 124 + ], + [ + 127, + 145 + ], + [ + 146, + 166 + ], + [ + 168, + 170 + ], + [ + 173, + 174 + ], + [ + 175, + 176 + ], + [ + 180, + 182 + ], + [ + 183, + 186 + ], + [ + 187, + 191 + ], + [ + 192, + 195 + ], + [ + 196, + 199 + ], + [ + 200, + 203 + ], + [ + 204, + 207 + ], + [ + 208, + 211 + ], + [ + 212, + 215 + ], + [ + 216, + 219 + ], + [ + 220, + 225 + ], + [ + 227, + 228 + ], + [ + 233, + 235 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 245, + 247 + ], + [ + 248, + 251 + ], + [ + 252, + 256 + ], + [ + 257, + 260 + ], + [ + 261, + 264 + ], + [ + 265, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 280 + ], + [ + 281, + 284 + ], + [ + 285, + 290 + ], + [ + 292, + 293 + ], + [ + 296, + 297 + ], + [ + 298, + 300 + ], + [ + 301, + 302 + ], + [ + 308, + 310 + ], + [ + 311, + 312 + ], + [ + 313, + 316 + ], + [ + 319, + 321 + ], + [ + 322, + 324 + ], + [ + 328, + 331 + ], + [ + 334, + 335 + ], + [ + 340, + 343 + ], + [ + 344, + 346 + ], + [ + 350, + 353 + ], + [ + 358, + 361 + ], + [ + 362, + 363 + ], + [ + 368, + 373 + ], + [ + 378, + 387 + ], + [ + 390, + 393 + ], + [ + 396, + 398 + ], + [ + 399, + 400 + ], + [ + 403, + 404 + ], + [ + 405, + 408 + ], + [ + 409, + 410 + ], + [ + 415, + 416 + ], + [ + 420, + 423 + ], + [ + 424, + 425 + ], + [ + 426, + 429 + ], + [ + 430, + 432 + ], + [ + 433, + 436 + ], + [ + 437, + 439 + ], + [ + 442, + 443 + ], + [ + 444, + 446 + ], + [ + 456, + 457 + ], + [ + 460, + 461 + ], + [ + 464, + 465 + ], + [ + 466, + 467 + ], + [ + 470, + 471 + ], + [ + 479, + 480 + ], + [ + 484, + 487 + ], + [ + 488, + 489 + ] + ] + } + }, + { + "filename": "libvips/conversion/flip.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 15 + ], + [ + 21, + 49 + ], + [ + 80, + 101 + ], + [ + 106, + 139 + ], + [ + 142, + 149 + ], + [ + 155, + 178 + ], + [ + 181, + 209 + ], + [ + 213, + 258 + ], + [ + 269, + 283 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 24, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 40 + ], + [ + 45, + 46 + ], + [ + 83, + 84 + ], + [ + 86, + 88 + ], + [ + 90, + 91 + ], + [ + 97, + 98 + ], + [ + 109, + 111 + ], + [ + 114, + 119 + ], + [ + 120, + 122 + ], + [ + 127, + 128 + ], + [ + 131, + 133 + ], + [ + 135, + 136 + ], + [ + 145, + 146 + ], + [ + 158, + 159 + ], + [ + 162, + 164 + ], + [ + 167, + 170 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 184, + 185 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 195, + 197 + ], + [ + 198, + 200 + ], + [ + 201, + 204 + ], + [ + 205, + 206 + ], + [ + 216, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 229 + ], + [ + 230, + 231 + ], + [ + 236, + 237 + ], + [ + 239, + 242 + ], + [ + 243, + 244 + ], + [ + 245, + 248 + ], + [ + 249, + 251 + ], + [ + 254, + 255 + ], + [ + 272, + 273 + ], + [ + 277, + 280 + ], + [ + 281, + 282 + ] + ] + } + }, + { + "filename": "libvips/conversion/gamma.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 8 + ], + [ + 19, + 47 + ], + [ + 64, + 71 + ], + [ + 82, + 167 + ], + [ + 169, + 190 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 22, + 28 + ], + [ + 29, + 33 + ], + [ + 34, + 38 + ], + [ + 43, + 44 + ], + [ + 67, + 68 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 93, + 95 + ], + [ + 96, + 99 + ], + [ + 100, + 103 + ], + [ + 104, + 113 + ], + [ + 114, + 123 + ], + [ + 126, + 127 + ], + [ + 128, + 131 + ], + [ + 136, + 137 + ], + [ + 141, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 153 + ], + [ + 156, + 157 + ], + [ + 163, + 164 + ], + [ + 172, + 173 + ], + [ + 179, + 180 + ], + [ + 184, + 187 + ], + [ + 188, + 189 + ] + ] + } + }, + { + "filename": "libvips/conversion/grid.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 63, + 78 + ], + [ + 92, + 99 + ], + [ + 102, + 117 + ], + [ + 124, + 133 + ], + [ + 137, + 231 + ], + [ + 240, + 247 + ], + [ + 250, + 273 + ] + ], + "lines_added": [ + [ + 15, + 31 + ], + [ + 36, + 37 + ], + [ + 66, + 67 + ], + [ + 69, + 71 + ], + [ + 74, + 75 + ], + [ + 95, + 96 + ], + [ + 105, + 108 + ], + [ + 109, + 110 + ], + [ + 112, + 114 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 140, + 143 + ], + [ + 145, + 146 + ], + [ + 149, + 150 + ], + [ + 151, + 153 + ], + [ + 155, + 157 + ], + [ + 158, + 161 + ], + [ + 162, + 167 + ], + [ + 171, + 174 + ], + [ + 177, + 181 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 188, + 190 + ], + [ + 195, + 196 + ], + [ + 198, + 201 + ], + [ + 202, + 203 + ], + [ + 204, + 207 + ], + [ + 208, + 210 + ], + [ + 211, + 214 + ], + [ + 215, + 217 + ], + [ + 218, + 221 + ], + [ + 222, + 224 + ], + [ + 227, + 228 + ], + [ + 243, + 244 + ], + [ + 253, + 254 + ], + [ + 260, + 262 + ], + [ + 266, + 270 + ], + [ + 271, + 272 + ] + ] + } + }, + { + "filename": "libvips/conversion/ifthenelse.c", + "line_filter": { + "diff_chunks": [ + [ + 29, + 57 + ], + [ + 88, + 227 + ], + [ + 230, + 275 + ], + [ + 276, + 290 + ], + [ + 291, + 370 + ], + [ + 373, + 470 + ], + [ + 478, + 557 + ], + [ + 566, + 578 + ], + [ + 590, + 605 + ] + ], + "lines_added": [ + [ + 32, + 48 + ], + [ + 53, + 54 + ], + [ + 91, + 106 + ], + [ + 107, + 119 + ], + [ + 120, + 121 + ], + [ + 122, + 135 + ], + [ + 136, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 164 + ], + [ + 165, + 179 + ], + [ + 180, + 181 + ], + [ + 185, + 188 + ], + [ + 193, + 224 + ], + [ + 233, + 236 + ], + [ + 241, + 272 + ], + [ + 279, + 281 + ], + [ + 283, + 284 + ], + [ + 286, + 287 + ], + [ + 294, + 296 + ], + [ + 300, + 304 + ], + [ + 306, + 307 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 318, + 321 + ], + [ + 322, + 323 + ], + [ + 325, + 328 + ], + [ + 330, + 331 + ], + [ + 336, + 349 + ], + [ + 350, + 352 + ], + [ + 355, + 356 + ], + [ + 359, + 361 + ], + [ + 363, + 364 + ], + [ + 366, + 367 + ], + [ + 376, + 377 + ], + [ + 379, + 380 + ], + [ + 385, + 386 + ], + [ + 389, + 391 + ], + [ + 395, + 399 + ], + [ + 400, + 401 + ], + [ + 405, + 406 + ], + [ + 409, + 410 + ], + [ + 412, + 415 + ], + [ + 416, + 417 + ], + [ + 419, + 422 + ], + [ + 424, + 425 + ], + [ + 427, + 440 + ], + [ + 442, + 443 + ], + [ + 447, + 448 + ], + [ + 451, + 452 + ], + [ + 453, + 455 + ], + [ + 456, + 457 + ], + [ + 458, + 462 + ], + [ + 465, + 467 + ], + [ + 481, + 484 + ], + [ + 487, + 490 + ], + [ + 493, + 494 + ], + [ + 496, + 498 + ], + [ + 499, + 502 + ], + [ + 503, + 507 + ], + [ + 508, + 509 + ], + [ + 512, + 513 + ], + [ + 514, + 516 + ], + [ + 517, + 518 + ], + [ + 523, + 524 + ], + [ + 526, + 529 + ], + [ + 530, + 531 + ], + [ + 532, + 535 + ], + [ + 536, + 537 + ], + [ + 538, + 541 + ], + [ + 542, + 543 + ], + [ + 544, + 547 + ], + [ + 548, + 550 + ], + [ + 553, + 554 + ], + [ + 569, + 570 + ], + [ + 574, + 575 + ], + [ + 593, + 595 + ], + [ + 599, + 602 + ], + [ + 603, + 604 + ] + ] + } + }, + { + "filename": "libvips/conversion/insert.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 34, + 62 + ], + [ + 103, + 110 + ], + [ + 113, + 127 + ], + [ + 129, + 161 + ], + [ + 162, + 257 + ], + [ + 258, + 392 + ], + [ + 393, + 404 + ], + [ + 409, + 420 + ], + [ + 424, + 516 + ], + [ + 526, + 549 + ], + [ + 550, + 565 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 37, + 38 + ], + [ + 39, + 43 + ], + [ + 44, + 53 + ], + [ + 58, + 59 + ], + [ + 106, + 107 + ], + [ + 116, + 117 + ], + [ + 123, + 124 + ], + [ + 132, + 134 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 143, + 144 + ], + [ + 149, + 150 + ], + [ + 156, + 158 + ], + [ + 165, + 168 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 177, + 180 + ], + [ + 186, + 187 + ], + [ + 190, + 191 + ], + [ + 193, + 196 + ], + [ + 197, + 199 + ], + [ + 201, + 204 + ], + [ + 206, + 209 + ], + [ + 210, + 211 + ], + [ + 214, + 218 + ], + [ + 222, + 226 + ], + [ + 229, + 231 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 240, + 241 + ], + [ + 244, + 247 + ], + [ + 250, + 251 + ], + [ + 252, + 254 + ], + [ + 261, + 262 + ], + [ + 264, + 266 + ], + [ + 270, + 274 + ], + [ + 277, + 283 + ], + [ + 287, + 288 + ], + [ + 289, + 293 + ], + [ + 296, + 297 + ], + [ + 298, + 303 + ], + [ + 306, + 310 + ], + [ + 312, + 313 + ], + [ + 315, + 328 + ], + [ + 330, + 331 + ], + [ + 332, + 333 + ], + [ + 336, + 337 + ], + [ + 338, + 339 + ], + [ + 342, + 343 + ], + [ + 345, + 347 + ], + [ + 348, + 349 + ], + [ + 352, + 353 + ], + [ + 354, + 357 + ], + [ + 358, + 360 + ], + [ + 361, + 362 + ], + [ + 365, + 366 + ], + [ + 367, + 369 + ], + [ + 370, + 371 + ], + [ + 372, + 374 + ], + [ + 375, + 383 + ], + [ + 386, + 389 + ], + [ + 396, + 399 + ], + [ + 400, + 401 + ], + [ + 412, + 413 + ], + [ + 415, + 417 + ], + [ + 427, + 428 + ], + [ + 433, + 438 + ], + [ + 439, + 443 + ], + [ + 444, + 445 + ], + [ + 448, + 449 + ], + [ + 450, + 453 + ], + [ + 454, + 455 + ], + [ + 460, + 462 + ], + [ + 466, + 469 + ], + [ + 470, + 471 + ], + [ + 472, + 475 + ], + [ + 476, + 477 + ], + [ + 478, + 481 + ], + [ + 482, + 484 + ], + [ + 485, + 488 + ], + [ + 489, + 491 + ], + [ + 492, + 495 + ], + [ + 496, + 498 + ], + [ + 499, + 502 + ], + [ + 503, + 505 + ], + [ + 508, + 509 + ], + [ + 512, + 513 + ], + [ + 529, + 530 + ], + [ + 532, + 533 + ], + [ + 534, + 535 + ], + [ + 537, + 538 + ], + [ + 539, + 541 + ], + [ + 544, + 546 + ], + [ + 553, + 555 + ], + [ + 559, + 562 + ], + [ + 563, + 564 + ] + ] + } + }, + { + "filename": "libvips/conversion/join.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 21 + ], + [ + 27, + 55 + ], + [ + 87, + 117 + ], + [ + 132, + 139 + ], + [ + 155, + 184 + ], + [ + 191, + 301 + ], + [ + 306, + 313 + ], + [ + 320, + 334 + ], + [ + 338, + 353 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 30, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 46 + ], + [ + 51, + 52 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 101, + 103 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 135, + 136 + ], + [ + 158, + 163 + ], + [ + 164, + 165 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 177, + 178 + ], + [ + 179, + 181 + ], + [ + 194, + 195 + ], + [ + 197, + 202 + ], + [ + 203, + 204 + ], + [ + 209, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 224 + ], + [ + 225, + 226 + ], + [ + 231, + 232 + ], + [ + 236, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 245 + ], + [ + 246, + 247 + ], + [ + 248, + 251 + ], + [ + 252, + 254 + ], + [ + 255, + 258 + ], + [ + 259, + 261 + ], + [ + 262, + 265 + ], + [ + 266, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 275 + ], + [ + 276, + 279 + ], + [ + 280, + 282 + ], + [ + 285, + 286 + ], + [ + 289, + 291 + ], + [ + 296, + 298 + ], + [ + 309, + 310 + ], + [ + 323, + 326 + ], + [ + 329, + 331 + ], + [ + 341, + 343 + ], + [ + 347, + 350 + ], + [ + 351, + 352 + ] + ] + } + }, + { + "filename": "libvips/conversion/msb.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 48 + ], + [ + 62, + 69 + ], + [ + 80, + 114 + ], + [ + 116, + 137 + ], + [ + 138, + 260 + ], + [ + 271, + 294 + ] + ], + "lines_added": [ + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 34 + ], + [ + 35, + 39 + ], + [ + 44, + 45 + ], + [ + 65, + 66 + ], + [ + 83, + 84 + ], + [ + 86, + 87 + ], + [ + 91, + 92 + ], + [ + 94, + 95 + ], + [ + 99, + 101 + ], + [ + 102, + 105 + ], + [ + 106, + 108 + ], + [ + 110, + 111 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 130, + 131 + ], + [ + 133, + 134 + ], + [ + 141, + 142 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 153, + 155 + ], + [ + 156, + 159 + ], + [ + 162, + 163 + ], + [ + 164, + 167 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 179, + 181 + ], + [ + 187, + 189 + ], + [ + 190, + 192 + ], + [ + 194, + 198 + ], + [ + 199, + 201 + ], + [ + 202, + 205 + ], + [ + 206, + 207 + ], + [ + 208, + 209 + ], + [ + 212, + 213 + ], + [ + 217, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 230 + ], + [ + 235, + 237 + ], + [ + 241, + 244 + ], + [ + 245, + 246 + ], + [ + 247, + 250 + ], + [ + 251, + 253 + ], + [ + 256, + 257 + ], + [ + 274, + 275 + ], + [ + 279, + 280 + ], + [ + 283, + 284 + ], + [ + 288, + 291 + ], + [ + 292, + 293 + ] + ] + } + }, + { + "filename": "libvips/conversion/pconversion.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 66, + 76 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 69, + 70 + ] + ] + } + }, + { + "filename": "libvips/conversion/premultiply.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 41 + ], + [ + 69, + 280 + ], + [ + 288, + 307 + ], + [ + 309, + 316 + ], + [ + 318, + 332 + ] + ], + "lines_added": [ + [ + 16, + 32 + ], + [ + 37, + 38 + ], + [ + 72, + 73 + ], + [ + 76, + 94 + ], + [ + 97, + 116 + ], + [ + 117, + 126 + ], + [ + 128, + 130 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 141, + 143 + ], + [ + 144, + 147 + ], + [ + 148, + 152 + ], + [ + 153, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 164 + ], + [ + 165, + 168 + ], + [ + 169, + 172 + ], + [ + 173, + 176 + ], + [ + 177, + 180 + ], + [ + 181, + 186 + ], + [ + 188, + 189 + ], + [ + 192, + 193 + ], + [ + 194, + 196 + ], + [ + 197, + 198 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 206, + 209 + ], + [ + 212, + 214 + ], + [ + 215, + 217 + ], + [ + 218, + 221 + ], + [ + 225, + 228 + ], + [ + 230, + 231 + ], + [ + 235, + 239 + ], + [ + 240, + 241 + ], + [ + 244, + 245 + ], + [ + 246, + 249 + ], + [ + 250, + 251 + ], + [ + 256, + 257 + ], + [ + 261, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 270 + ], + [ + 271, + 273 + ], + [ + 276, + 277 + ], + [ + 291, + 292 + ], + [ + 296, + 298 + ], + [ + 301, + 304 + ], + [ + 312, + 313 + ], + [ + 321, + 322 + ], + [ + 326, + 329 + ], + [ + 330, + 331 + ] + ] + } + }, + { + "filename": "libvips/conversion/recomb.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 60, + 67 + ], + [ + 68, + 106 + ], + [ + 109, + 252 + ], + [ + 259, + 273 + ] + ], + "lines_added": [ + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 35, + 36 + ], + [ + 63, + 64 + ], + [ + 71, + 72 + ], + [ + 75, + 97 + ], + [ + 98, + 99 + ], + [ + 101, + 103 + ], + [ + 112, + 146 + ], + [ + 152, + 153 + ], + [ + 156, + 157 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 165, + 185 + ], + [ + 187, + 190 + ], + [ + 191, + 194 + ], + [ + 196, + 197 + ], + [ + 199, + 203 + ], + [ + 204, + 205 + ], + [ + 208, + 209 + ], + [ + 210, + 211 + ], + [ + 212, + 213 + ], + [ + 218, + 219 + ], + [ + 223, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 234 + ], + [ + 237, + 238 + ], + [ + 241, + 242 + ], + [ + 248, + 249 + ], + [ + 262, + 263 + ], + [ + 267, + 270 + ], + [ + 271, + 272 + ] + ] + } + }, + { + "filename": "libvips/conversion/replicate.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 12, + 40 + ], + [ + 70, + 85 + ], + [ + 99, + 106 + ], + [ + 107, + 124 + ], + [ + 130, + 221 + ], + [ + 233, + 247 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 73, + 74 + ], + [ + 76, + 78 + ], + [ + 81, + 82 + ], + [ + 102, + 103 + ], + [ + 110, + 112 + ], + [ + 113, + 115 + ], + [ + 116, + 117 + ], + [ + 119, + 121 + ], + [ + 133, + 134 + ], + [ + 140, + 141 + ], + [ + 144, + 148 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 159, + 161 + ], + [ + 162, + 164 + ], + [ + 165, + 168 + ], + [ + 172, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 183, + 185 + ], + [ + 186, + 187 + ], + [ + 192, + 193 + ], + [ + 195, + 198 + ], + [ + 199, + 200 + ], + [ + 201, + 204 + ], + [ + 205, + 207 + ], + [ + 208, + 211 + ], + [ + 212, + 214 + ], + [ + 217, + 218 + ], + [ + 236, + 237 + ], + [ + 241, + 244 + ], + [ + 245, + 246 + ] + ] + } + }, + { + "filename": "libvips/conversion/rot.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 9 + ], + [ + 28, + 62 + ], + [ + 93, + 111 + ], + [ + 124, + 153 + ], + [ + 154, + 173 + ], + [ + 186, + 216 + ], + [ + 217, + 236 + ], + [ + 249, + 278 + ], + [ + 279, + 312 + ], + [ + 336, + 388 + ], + [ + 393, + 417 + ], + [ + 426, + 442 + ], + [ + 451, + 467 + ], + [ + 476, + 490 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 31, + 32 + ], + [ + 37, + 38 + ], + [ + 39, + 43 + ], + [ + 44, + 53 + ], + [ + 58, + 59 + ], + [ + 96, + 97 + ], + [ + 99, + 101 + ], + [ + 107, + 108 + ], + [ + 127, + 130 + ], + [ + 132, + 134 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 144, + 147 + ], + [ + 148, + 150 + ], + [ + 157, + 158 + ], + [ + 161, + 163 + ], + [ + 169, + 170 + ], + [ + 189, + 191 + ], + [ + 194, + 195 + ], + [ + 198, + 199 + ], + [ + 201, + 202 + ], + [ + 205, + 208 + ], + [ + 211, + 213 + ], + [ + 220, + 221 + ], + [ + 224, + 226 + ], + [ + 232, + 233 + ], + [ + 252, + 255 + ], + [ + 257, + 259 + ], + [ + 262, + 263 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 282, + 283 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 294, + 296 + ], + [ + 297, + 299 + ], + [ + 300, + 302 + ], + [ + 303, + 304 + ], + [ + 305, + 307 + ], + [ + 308, + 309 + ], + [ + 339, + 343 + ], + [ + 344, + 345 + ], + [ + 348, + 349 + ], + [ + 350, + 352 + ], + [ + 353, + 354 + ], + [ + 359, + 360 + ], + [ + 362, + 365 + ], + [ + 366, + 367 + ], + [ + 368, + 371 + ], + [ + 372, + 374 + ], + [ + 377, + 378 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 396, + 398 + ], + [ + 404, + 405 + ], + [ + 409, + 412 + ], + [ + 413, + 414 + ], + [ + 429, + 430 + ], + [ + 434, + 437 + ], + [ + 438, + 439 + ], + [ + 454, + 455 + ], + [ + 459, + 462 + ], + [ + 463, + 464 + ], + [ + 479, + 480 + ], + [ + 484, + 487 + ], + [ + 488, + 489 + ] + ] + } + }, + { + "filename": "libvips/conversion/rot45.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 46 + ], + [ + 77, + 121 + ], + [ + 123, + 242 + ], + [ + 243, + 286 + ], + [ + 295, + 319 + ] + ], + "lines_added": [ + [ + 16, + 17 + ], + [ + 21, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 37 + ], + [ + 42, + 43 + ], + [ + 80, + 81 + ], + [ + 82, + 91 + ], + [ + 92, + 95 + ], + [ + 96, + 98 + ], + [ + 99, + 101 + ], + [ + 105, + 106 + ], + [ + 107, + 110 + ], + [ + 114, + 118 + ], + [ + 126, + 127 + ], + [ + 131, + 133 + ], + [ + 135, + 136 + ], + [ + 139, + 141 + ], + [ + 144, + 146 + ], + [ + 149, + 151 + ], + [ + 154, + 156 + ], + [ + 157, + 158 + ], + [ + 159, + 161 + ], + [ + 162, + 163 + ], + [ + 164, + 166 + ], + [ + 169, + 171 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 179, + 180 + ], + [ + 183, + 184 + ], + [ + 185, + 187 + ], + [ + 188, + 189 + ], + [ + 192, + 194 + ], + [ + 195, + 197 + ], + [ + 198, + 200 + ], + [ + 201, + 203 + ], + [ + 206, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 246, + 248 + ], + [ + 249, + 250 + ], + [ + 253, + 254 + ], + [ + 255, + 257 + ], + [ + 258, + 259 + ], + [ + 264, + 265 + ], + [ + 267, + 270 + ], + [ + 271, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 279 + ], + [ + 282, + 283 + ], + [ + 298, + 299 + ], + [ + 301, + 302 + ], + [ + 308, + 309 + ], + [ + 313, + 316 + ], + [ + 317, + 318 + ] + ] + } + }, + { + "filename": "libvips/conversion/scale.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 9 + ], + [ + 22, + 56 + ], + [ + 78, + 126 + ], + [ + 128, + 180 + ], + [ + 193, + 200 + ], + [ + 201, + 215 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 25, + 27 + ], + [ + 31, + 32 + ], + [ + 33, + 37 + ], + [ + 38, + 47 + ], + [ + 52, + 53 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 93, + 95 + ], + [ + 96, + 100 + ], + [ + 101, + 102 + ], + [ + 104, + 109 + ], + [ + 110, + 112 + ], + [ + 113, + 116 + ], + [ + 118, + 123 + ], + [ + 131, + 136 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 144, + 146 + ], + [ + 151, + 152 + ], + [ + 154, + 157 + ], + [ + 158, + 159 + ], + [ + 160, + 163 + ], + [ + 164, + 166 + ], + [ + 167, + 170 + ], + [ + 171, + 173 + ], + [ + 176, + 177 + ], + [ + 196, + 197 + ], + [ + 204, + 205 + ], + [ + 209, + 212 + ], + [ + 213, + 214 + ] + ] + } + }, + { + "filename": "libvips/conversion/sequential.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 8 + ], + [ + 29, + 57 + ], + [ + 99, + 199 + ], + [ + 202, + 273 + ], + [ + 286, + 294 + ], + [ + 297, + 311 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 4, + 5 + ], + [ + 32, + 33 + ], + [ + 34, + 38 + ], + [ + 39, + 48 + ], + [ + 53, + 54 + ], + [ + 102, + 103 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 115, + 117 + ], + [ + 119, + 120 + ], + [ + 122, + 126 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 131, + 132 + ], + [ + 135, + 138 + ], + [ + 140, + 144 + ], + [ + 148, + 152 + ], + [ + 157, + 158 + ], + [ + 159, + 161 + ], + [ + 163, + 164 + ], + [ + 169, + 171 + ], + [ + 172, + 174 + ], + [ + 176, + 178 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 192, + 193 + ], + [ + 194, + 196 + ], + [ + 205, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 229 + ], + [ + 230, + 231 + ], + [ + 237, + 238 + ], + [ + 240, + 243 + ], + [ + 244, + 245 + ], + [ + 246, + 249 + ], + [ + 250, + 252 + ], + [ + 253, + 256 + ], + [ + 257, + 259 + ], + [ + 260, + 263 + ], + [ + 264, + 266 + ], + [ + 269, + 270 + ], + [ + 289, + 291 + ], + [ + 300, + 301 + ], + [ + 305, + 308 + ], + [ + 309, + 310 + ] + ] + } + }, + { + "filename": "libvips/conversion/smartcrop.c", + "line_filter": { + "diff_chunks": [ + [ + 18, + 46 + ], + [ + 75, + 104 + ], + [ + 111, + 210 + ], + [ + 217, + 287 + ], + [ + 289, + 347 + ], + [ + 353, + 366 + ], + [ + 384, + 444 + ], + [ + 454, + 461 + ], + [ + 463, + 481 + ] + ], + "lines_added": [ + [ + 21, + 37 + ], + [ + 42, + 43 + ], + [ + 78, + 79 + ], + [ + 81, + 83 + ], + [ + 84, + 86 + ], + [ + 87, + 91 + ], + [ + 92, + 93 + ], + [ + 96, + 97 + ], + [ + 99, + 101 + ], + [ + 114, + 117 + ], + [ + 118, + 119 + ], + [ + 121, + 129 + ], + [ + 132, + 136 + ], + [ + 137, + 141 + ], + [ + 143, + 144 + ], + [ + 147, + 148 + ], + [ + 151, + 155 + ], + [ + 156, + 160 + ], + [ + 162, + 163 + ], + [ + 167, + 168 + ], + [ + 173, + 174 + ], + [ + 175, + 178 + ], + [ + 181, + 184 + ], + [ + 185, + 188 + ], + [ + 189, + 192 + ], + [ + 193, + 194 + ], + [ + 197, + 199 + ], + [ + 202, + 204 + ], + [ + 205, + 207 + ], + [ + 220, + 228 + ], + [ + 231, + 236 + ], + [ + 239, + 242 + ], + [ + 243, + 244 + ], + [ + 245, + 247 + ], + [ + 248, + 252 + ], + [ + 255, + 256 + ], + [ + 258, + 260 + ], + [ + 263, + 265 + ], + [ + 268, + 269 + ], + [ + 272, + 276 + ], + [ + 279, + 284 + ], + [ + 292, + 296 + ], + [ + 299, + 307 + ], + [ + 310, + 311 + ], + [ + 312, + 314 + ], + [ + 315, + 316 + ], + [ + 321, + 323 + ], + [ + 324, + 325 + ], + [ + 326, + 329 + ], + [ + 335, + 336 + ], + [ + 337, + 340 + ], + [ + 343, + 344 + ], + [ + 356, + 358 + ], + [ + 361, + 363 + ], + [ + 387, + 392 + ], + [ + 393, + 394 + ], + [ + 397, + 398 + ], + [ + 399, + 401 + ], + [ + 402, + 403 + ], + [ + 408, + 409 + ], + [ + 411, + 414 + ], + [ + 415, + 416 + ], + [ + 417, + 420 + ], + [ + 421, + 423 + ], + [ + 424, + 427 + ], + [ + 428, + 430 + ], + [ + 431, + 434 + ], + [ + 435, + 437 + ], + [ + 440, + 441 + ], + [ + 457, + 458 + ], + [ + 466, + 467 + ], + [ + 470, + 471 + ], + [ + 475, + 478 + ], + [ + 479, + 480 + ] + ] + } + }, + { + "filename": "libvips/conversion/subsample.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 60, + 67 + ], + [ + 68, + 96 + ], + [ + 98, + 116 + ], + [ + 120, + 134 + ], + [ + 136, + 160 + ], + [ + 161, + 223 + ], + [ + 224, + 301 + ], + [ + 317, + 339 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 63, + 64 + ], + [ + 71, + 72 + ], + [ + 77, + 78 + ], + [ + 81, + 83 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 93 + ], + [ + 101, + 103 + ], + [ + 107, + 108 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 123, + 125 + ], + [ + 128, + 131 + ], + [ + 139, + 140 + ], + [ + 145, + 147 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 156, + 157 + ], + [ + 164, + 166 + ], + [ + 170, + 171 + ], + [ + 177, + 179 + ], + [ + 182, + 184 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 197 + ], + [ + 201, + 203 + ], + [ + 204, + 206 + ], + [ + 207, + 213 + ], + [ + 217, + 220 + ], + [ + 227, + 232 + ], + [ + 234, + 236 + ], + [ + 237, + 239 + ], + [ + 240, + 241 + ], + [ + 243, + 247 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 254, + 256 + ], + [ + 261, + 262 + ], + [ + 268, + 271 + ], + [ + 272, + 273 + ], + [ + 274, + 277 + ], + [ + 278, + 280 + ], + [ + 281, + 284 + ], + [ + 285, + 287 + ], + [ + 288, + 291 + ], + [ + 292, + 294 + ], + [ + 297, + 298 + ], + [ + 320, + 321 + ], + [ + 324, + 325 + ], + [ + 328, + 329 + ], + [ + 333, + 336 + ], + [ + 337, + 338 + ] + ] + } + }, + { + "filename": "libvips/conversion/switch.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 55, + 111 + ], + [ + 114, + 227 + ], + [ + 230, + 243 + ], + [ + 245, + 259 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 58, + 59 + ], + [ + 60, + 63 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 74, + 76 + ], + [ + 77, + 79 + ], + [ + 80, + 83 + ], + [ + 85, + 91 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 117, + 118 + ], + [ + 119, + 121 + ], + [ + 125, + 131 + ], + [ + 133, + 137 + ], + [ + 140, + 143 + ], + [ + 147, + 150 + ], + [ + 154, + 157 + ], + [ + 159, + 163 + ], + [ + 165, + 168 + ], + [ + 169, + 173 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 180, + 183 + ], + [ + 188, + 190 + ], + [ + 194, + 197 + ], + [ + 198, + 206 + ], + [ + 209, + 210 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 219, + 222 + ], + [ + 223, + 224 + ], + [ + 233, + 236 + ], + [ + 239, + 240 + ], + [ + 248, + 249 + ], + [ + 253, + 256 + ], + [ + 257, + 258 + ] + ] + } + }, + { + "filename": "libvips/conversion/tilecache.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 39, + 67 + ], + [ + 86, + 93 + ], + [ + 103, + 128 + ], + [ + 129, + 208 + ], + [ + 211, + 241 + ], + [ + 243, + 486 + ], + [ + 491, + 502 + ], + [ + 506, + 560 + ], + [ + 570, + 619 + ], + [ + 621, + 665 + ], + [ + 666, + 706 + ], + [ + 707, + 735 + ], + [ + 739, + 829 + ], + [ + 842, + 859 + ], + [ + 870, + 886 + ], + [ + 889, + 927 + ], + [ + 928, + 1001 + ], + [ + 1011, + 1028 + ], + [ + 1031, + 1050 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 42, + 43 + ], + [ + 44, + 48 + ], + [ + 49, + 58 + ], + [ + 63, + 64 + ], + [ + 89, + 90 + ], + [ + 106, + 107 + ], + [ + 111, + 112 + ], + [ + 117, + 118 + ], + [ + 124, + 125 + ], + [ + 132, + 137 + ], + [ + 141, + 143 + ], + [ + 147, + 148 + ], + [ + 153, + 154 + ], + [ + 157, + 158 + ], + [ + 161, + 164 + ], + [ + 165, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 179, + 180 + ], + [ + 186, + 187 + ], + [ + 188, + 190 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 203, + 205 + ], + [ + 214, + 217 + ], + [ + 219, + 222 + ], + [ + 224, + 225 + ], + [ + 226, + 229 + ], + [ + 231, + 232 + ], + [ + 237, + 238 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 257, + 259 + ], + [ + 265, + 266 + ], + [ + 270, + 271 + ], + [ + 272, + 273 + ], + [ + 275, + 276 + ], + [ + 279, + 280 + ], + [ + 285, + 290 + ], + [ + 294, + 303 + ], + [ + 308, + 311 + ], + [ + 315, + 316 + ], + [ + 318, + 319 + ], + [ + 322, + 324 + ], + [ + 325, + 326 + ], + [ + 328, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 335 + ], + [ + 337, + 339 + ], + [ + 342, + 343 + ], + [ + 346, + 347 + ], + [ + 348, + 349 + ], + [ + 350, + 351 + ], + [ + 354, + 356 + ], + [ + 357, + 358 + ], + [ + 361, + 362 + ], + [ + 363, + 364 + ], + [ + 366, + 367 + ], + [ + 368, + 370 + ], + [ + 371, + 372 + ], + [ + 373, + 375 + ], + [ + 376, + 379 + ], + [ + 380, + 381 + ], + [ + 384, + 385 + ], + [ + 386, + 389 + ], + [ + 390, + 391 + ], + [ + 397, + 398 + ], + [ + 402, + 405 + ], + [ + 406, + 407 + ], + [ + 408, + 411 + ], + [ + 412, + 414 + ], + [ + 415, + 418 + ], + [ + 419, + 421 + ], + [ + 422, + 425 + ], + [ + 426, + 428 + ], + [ + 429, + 432 + ], + [ + 433, + 435 + ], + [ + 438, + 439 + ], + [ + 445, + 446 + ], + [ + 449, + 450 + ], + [ + 452, + 454 + ], + [ + 455, + 456 + ], + [ + 459, + 460 + ], + [ + 463, + 465 + ], + [ + 468, + 471 + ], + [ + 473, + 474 + ], + [ + 476, + 477 + ], + [ + 478, + 479 + ], + [ + 482, + 483 + ], + [ + 494, + 496 + ], + [ + 498, + 499 + ], + [ + 509, + 510 + ], + [ + 512, + 513 + ], + [ + 514, + 515 + ], + [ + 518, + 519 + ], + [ + 522, + 523 + ], + [ + 524, + 525 + ], + [ + 529, + 530 + ], + [ + 533, + 534 + ], + [ + 535, + 537 + ], + [ + 538, + 539 + ], + [ + 543, + 544 + ], + [ + 547, + 549 + ], + [ + 550, + 551 + ], + [ + 556, + 557 + ], + [ + 573, + 578 + ], + [ + 580, + 581 + ], + [ + 585, + 586 + ], + [ + 587, + 590 + ], + [ + 592, + 593 + ], + [ + 596, + 597 + ], + [ + 602, + 605 + ], + [ + 610, + 612 + ], + [ + 615, + 616 + ], + [ + 624, + 625 + ], + [ + 626, + 627 + ], + [ + 628, + 629 + ], + [ + 630, + 633 + ], + [ + 636, + 637 + ], + [ + 638, + 639 + ], + [ + 641, + 643 + ], + [ + 645, + 646 + ], + [ + 649, + 650 + ], + [ + 652, + 655 + ], + [ + 656, + 657 + ], + [ + 660, + 662 + ], + [ + 669, + 670 + ], + [ + 672, + 673 + ], + [ + 675, + 678 + ], + [ + 683, + 685 + ], + [ + 689, + 694 + ], + [ + 695, + 698 + ], + [ + 699, + 700 + ], + [ + 701, + 703 + ], + [ + 710, + 711 + ], + [ + 712, + 714 + ], + [ + 715, + 717 + ], + [ + 718, + 720 + ], + [ + 721, + 722 + ], + [ + 728, + 729 + ], + [ + 731, + 732 + ], + [ + 742, + 745 + ], + [ + 747, + 748 + ], + [ + 750, + 751 + ], + [ + 752, + 753 + ], + [ + 754, + 755 + ], + [ + 756, + 757 + ], + [ + 758, + 759 + ], + [ + 762, + 763 + ], + [ + 764, + 765 + ], + [ + 768, + 769 + ], + [ + 770, + 771 + ], + [ + 774, + 775 + ], + [ + 776, + 778 + ], + [ + 779, + 781 + ], + [ + 782, + 785 + ], + [ + 786, + 790 + ], + [ + 791, + 792 + ], + [ + 795, + 796 + ], + [ + 797, + 799 + ], + [ + 800, + 801 + ], + [ + 806, + 807 + ], + [ + 809, + 812 + ], + [ + 813, + 815 + ], + [ + 816, + 819 + ], + [ + 820, + 822 + ], + [ + 825, + 826 + ], + [ + 845, + 847 + ], + [ + 848, + 849 + ], + [ + 850, + 852 + ], + [ + 854, + 856 + ], + [ + 873, + 874 + ], + [ + 878, + 881 + ], + [ + 882, + 883 + ], + [ + 892, + 893 + ], + [ + 895, + 897 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 904, + 905 + ], + [ + 908, + 910 + ], + [ + 911, + 913 + ], + [ + 915, + 916 + ], + [ + 917, + 918 + ], + [ + 921, + 922 + ], + [ + 923, + 924 + ], + [ + 931, + 932 + ], + [ + 933, + 934 + ], + [ + 936, + 938 + ], + [ + 941, + 943 + ], + [ + 946, + 947 + ], + [ + 953, + 982 + ], + [ + 985, + 986 + ], + [ + 987, + 988 + ], + [ + 989, + 990 + ], + [ + 992, + 993 + ], + [ + 997, + 998 + ], + [ + 1014, + 1015 + ], + [ + 1017, + 1018 + ], + [ + 1019, + 1021 + ], + [ + 1023, + 1025 + ], + [ + 1034, + 1035 + ], + [ + 1039, + 1040 + ], + [ + 1044, + 1047 + ], + [ + 1048, + 1049 + ] + ] + } + }, + { + "filename": "libvips/conversion/transpose3d.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 55, + 81 + ], + [ + 99, + 185 + ], + [ + 192, + 225 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 58, + 59 + ], + [ + 61, + 63 + ], + [ + 67, + 68 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 102, + 104 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 114 + ], + [ + 118, + 120 + ], + [ + 123, + 126 + ], + [ + 127, + 131 + ], + [ + 133, + 137 + ], + [ + 139, + 144 + ], + [ + 145, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 156, + 158 + ], + [ + 163, + 164 + ], + [ + 166, + 169 + ], + [ + 170, + 171 + ], + [ + 172, + 175 + ], + [ + 176, + 178 + ], + [ + 181, + 182 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 204, + 205 + ], + [ + 207, + 208 + ], + [ + 214, + 215 + ], + [ + 219, + 222 + ], + [ + 223, + 224 + ] + ] + } + }, + { + "filename": "libvips/conversion/unpremultiply.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 43 + ], + [ + 72, + 349 + ], + [ + 358, + 379 + ], + [ + 381, + 388 + ], + [ + 390, + 404 + ] + ], + "lines_added": [ + [ + 18, + 34 + ], + [ + 39, + 40 + ], + [ + 75, + 76 + ], + [ + 80, + 99 + ], + [ + 102, + 120 + ], + [ + 121, + 130 + ], + [ + 134, + 153 + ], + [ + 154, + 172 + ], + [ + 173, + 182 + ], + [ + 184, + 186 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 198, + 200 + ], + [ + 201, + 204 + ], + [ + 205, + 209 + ], + [ + 210, + 213 + ], + [ + 214, + 217 + ], + [ + 218, + 221 + ], + [ + 222, + 225 + ], + [ + 226, + 229 + ], + [ + 230, + 233 + ], + [ + 234, + 237 + ], + [ + 238, + 243 + ], + [ + 245, + 246 + ], + [ + 249, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 255 + ], + [ + 258, + 260 + ], + [ + 261, + 262 + ], + [ + 263, + 266 + ], + [ + 269, + 271 + ], + [ + 272, + 274 + ], + [ + 275, + 278 + ], + [ + 282, + 285 + ], + [ + 287, + 288 + ], + [ + 289, + 290 + ], + [ + 292, + 293 + ], + [ + 297, + 301 + ], + [ + 302, + 303 + ], + [ + 306, + 307 + ], + [ + 308, + 311 + ], + [ + 312, + 313 + ], + [ + 318, + 319 + ], + [ + 323, + 326 + ], + [ + 327, + 328 + ], + [ + 329, + 332 + ], + [ + 333, + 335 + ], + [ + 336, + 339 + ], + [ + 340, + 342 + ], + [ + 345, + 346 + ], + [ + 361, + 363 + ], + [ + 366, + 368 + ], + [ + 374, + 376 + ], + [ + 384, + 385 + ], + [ + 393, + 394 + ], + [ + 398, + 401 + ], + [ + 402, + 403 + ] + ] + } + }, + { + "filename": "libvips/conversion/wrap.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 13 + ], + [ + 14, + 42 + ], + [ + 60, + 140 + ], + [ + 150, + 171 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 28 + ], + [ + 29, + 33 + ], + [ + 38, + 39 + ], + [ + 63, + 64 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 75, + 77 + ], + [ + 78, + 79 + ], + [ + 80, + 81 + ], + [ + 86, + 94 + ], + [ + 98, + 99 + ], + [ + 102, + 103 + ], + [ + 104, + 106 + ], + [ + 111, + 112 + ], + [ + 114, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 123 + ], + [ + 124, + 126 + ], + [ + 127, + 130 + ], + [ + 131, + 133 + ], + [ + 136, + 137 + ], + [ + 153, + 154 + ], + [ + 160, + 161 + ], + [ + 165, + 168 + ], + [ + 169, + 170 + ] + ] + } + }, + { + "filename": "libvips/conversion/zoom.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 20 + ], + [ + 27, + 60 + ], + [ + 78, + 101 + ], + [ + 108, + 135 + ], + [ + 140, + 148 + ], + [ + 150, + 161 + ], + [ + 168, + 187 + ], + [ + 190, + 207 + ], + [ + 210, + 218 + ], + [ + 228, + 243 + ], + [ + 244, + 397 + ], + [ + 406, + 424 + ] + ], + "lines_added": [ + [ + 16, + 17 + ], + [ + 30, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 46 + ], + [ + 51, + 52 + ], + [ + 55, + 57 + ], + [ + 81, + 82 + ], + [ + 88, + 89 + ], + [ + 93, + 95 + ], + [ + 96, + 98 + ], + [ + 111, + 112 + ], + [ + 115, + 116 + ], + [ + 119, + 122 + ], + [ + 127, + 128 + ], + [ + 130, + 132 + ], + [ + 143, + 145 + ], + [ + 153, + 155 + ], + [ + 156, + 158 + ], + [ + 171, + 172 + ], + [ + 177, + 178 + ], + [ + 181, + 184 + ], + [ + 193, + 194 + ], + [ + 196, + 197 + ], + [ + 203, + 204 + ], + [ + 213, + 215 + ], + [ + 231, + 232 + ], + [ + 238, + 240 + ], + [ + 247, + 249 + ], + [ + 254, + 258 + ], + [ + 264, + 267 + ], + [ + 269, + 273 + ], + [ + 279, + 281 + ], + [ + 285, + 286 + ], + [ + 288, + 291 + ], + [ + 293, + 296 + ], + [ + 298, + 301 + ], + [ + 303, + 305 + ], + [ + 306, + 307 + ], + [ + 310, + 311 + ], + [ + 312, + 314 + ], + [ + 316, + 321 + ], + [ + 324, + 329 + ], + [ + 330, + 333 + ], + [ + 334, + 337 + ], + [ + 341, + 344 + ], + [ + 347, + 351 + ], + [ + 352, + 353 + ], + [ + 356, + 357 + ], + [ + 358, + 361 + ], + [ + 366, + 367 + ], + [ + 371, + 374 + ], + [ + 375, + 376 + ], + [ + 377, + 380 + ], + [ + 381, + 383 + ], + [ + 384, + 387 + ], + [ + 388, + 390 + ], + [ + 393, + 394 + ], + [ + 409, + 410 + ], + [ + 413, + 414 + ], + [ + 418, + 421 + ], + [ + 422, + 423 + ] + ] + } + }, + { + "filename": "libvips/convolution/canny.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 49, + 57 + ], + [ + 59, + 296 + ], + [ + 298, + 311 + ], + [ + 324, + 477 + ], + [ + 488, + 519 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 52, + 54 + ], + [ + 62, + 63 + ], + [ + 68, + 69 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 88, + 93 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 104, + 106 + ], + [ + 111, + 128 + ], + [ + 129, + 130 + ], + [ + 132, + 133 + ], + [ + 134, + 154 + ], + [ + 155, + 156 + ], + [ + 158, + 160 + ], + [ + 162, + 163 + ], + [ + 165, + 166 + ], + [ + 167, + 169 + ], + [ + 170, + 177 + ], + [ + 178, + 179 + ], + [ + 184, + 185 + ], + [ + 188, + 189 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 204, + 205 + ], + [ + 208, + 209 + ], + [ + 211, + 212 + ], + [ + 216, + 217 + ], + [ + 223, + 224 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 233, + 236 + ], + [ + 238, + 242 + ], + [ + 243, + 244 + ], + [ + 246, + 279 + ], + [ + 280, + 281 + ], + [ + 283, + 285 + ], + [ + 287, + 288 + ], + [ + 292, + 293 + ], + [ + 301, + 303 + ], + [ + 306, + 308 + ], + [ + 327, + 332 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 343, + 344 + ], + [ + 347, + 348 + ], + [ + 351, + 352 + ], + [ + 358, + 359 + ], + [ + 361, + 364 + ], + [ + 368, + 372 + ], + [ + 373, + 374 + ], + [ + 377, + 378 + ], + [ + 380, + 381 + ], + [ + 384, + 386 + ], + [ + 389, + 393 + ], + [ + 395, + 397 + ], + [ + 403, + 405 + ], + [ + 410, + 414 + ], + [ + 415, + 417 + ], + [ + 419, + 420 + ], + [ + 421, + 423 + ], + [ + 424, + 425 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 432, + 433 + ], + [ + 438, + 439 + ], + [ + 443, + 446 + ], + [ + 447, + 448 + ], + [ + 449, + 454 + ], + [ + 455, + 458 + ], + [ + 459, + 461 + ], + [ + 462, + 468 + ], + [ + 471, + 472 + ], + [ + 473, + 474 + ], + [ + 491, + 492 + ], + [ + 497, + 499 + ], + [ + 500, + 502 + ], + [ + 504, + 505 + ], + [ + 507, + 509 + ], + [ + 513, + 516 + ], + [ + 517, + 518 + ] + ] + } + }, + { + "filename": "libvips/convolution/compass.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 11, + 39 + ], + [ + 50, + 135 + ], + [ + 140, + 210 + ], + [ + 237, + 252 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 30 + ], + [ + 35, + 36 + ], + [ + 53, + 59 + ], + [ + 63, + 64 + ], + [ + 66, + 67 + ], + [ + 73, + 74 + ], + [ + 78, + 79 + ], + [ + 80, + 82 + ], + [ + 83, + 91 + ], + [ + 93, + 104 + ], + [ + 108, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 118 + ], + [ + 122, + 126 + ], + [ + 130, + 132 + ], + [ + 143, + 145 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 159, + 160 + ], + [ + 162, + 203 + ], + [ + 206, + 207 + ], + [ + 240, + 242 + ], + [ + 246, + 249 + ], + [ + 250, + 251 + ] + ] + } + }, + { + "filename": "libvips/convolution/conv.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 9, + 37 + ], + [ + 49, + 160 + ], + [ + 173, + 180 + ], + [ + 182, + 215 + ], + [ + 219, + 234 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 28 + ], + [ + 33, + 34 + ], + [ + 52, + 55 + ], + [ + 59, + 60 + ], + [ + 62, + 63 + ], + [ + 66, + 67 + ], + [ + 70, + 72 + ], + [ + 73, + 74 + ], + [ + 79, + 81 + ], + [ + 84, + 86 + ], + [ + 88, + 89 + ], + [ + 90, + 93 + ], + [ + 96, + 99 + ], + [ + 102, + 108 + ], + [ + 114, + 116 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 124 + ], + [ + 130, + 131 + ], + [ + 133, + 153 + ], + [ + 156, + 157 + ], + [ + 176, + 177 + ], + [ + 185, + 186 + ], + [ + 187, + 189 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 195, + 197 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 205, + 208 + ], + [ + 211, + 212 + ], + [ + 222, + 224 + ], + [ + 228, + 231 + ], + [ + 232, + 233 + ] + ] + } + }, + { + "filename": "libvips/convolution/conva.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 13, + 41 + ], + [ + 44, + 51 + ], + [ + 70, + 80 + ], + [ + 102, + 109 + ], + [ + 115, + 122 + ], + [ + 141, + 148 + ], + [ + 162, + 169 + ], + [ + 188, + 195 + ], + [ + 202, + 232 + ], + [ + 233, + 313 + ], + [ + 319, + 350 + ], + [ + 355, + 430 + ], + [ + 431, + 447 + ], + [ + 449, + 461 + ], + [ + 463, + 477 + ], + [ + 478, + 504 + ], + [ + 507, + 571 + ], + [ + 572, + 653 + ], + [ + 657, + 670 + ], + [ + 675, + 730 + ], + [ + 732, + 768 + ], + [ + 769, + 877 + ], + [ + 879, + 890 + ], + [ + 895, + 966 + ], + [ + 967, + 1107 + ], + [ + 1110, + 1121 + ], + [ + 1126, + 1324 + ], + [ + 1333, + 1350 + ], + [ + 1354, + 1369 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 7, + 8 + ], + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 32 + ], + [ + 37, + 38 + ], + [ + 47, + 48 + ], + [ + 73, + 74 + ], + [ + 75, + 77 + ], + [ + 105, + 106 + ], + [ + 118, + 119 + ], + [ + 144, + 145 + ], + [ + 165, + 166 + ], + [ + 191, + 192 + ], + [ + 205, + 206 + ], + [ + 210, + 211 + ], + [ + 212, + 214 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 226, + 227 + ], + [ + 228, + 229 + ], + [ + 236, + 239 + ], + [ + 242, + 245 + ], + [ + 248, + 249 + ], + [ + 253, + 254 + ], + [ + 257, + 260 + ], + [ + 262, + 265 + ], + [ + 266, + 268 + ], + [ + 270, + 273 + ], + [ + 274, + 275 + ], + [ + 276, + 278 + ], + [ + 282, + 283 + ], + [ + 286, + 299 + ], + [ + 305, + 306 + ], + [ + 309, + 310 + ], + [ + 322, + 325 + ], + [ + 327, + 329 + ], + [ + 335, + 336 + ], + [ + 337, + 338 + ], + [ + 340, + 342 + ], + [ + 346, + 347 + ], + [ + 358, + 359 + ], + [ + 365, + 366 + ], + [ + 368, + 370 + ], + [ + 372, + 377 + ], + [ + 381, + 386 + ], + [ + 391, + 395 + ], + [ + 399, + 402 + ], + [ + 404, + 405 + ], + [ + 410, + 411 + ], + [ + 412, + 413 + ], + [ + 414, + 416 + ], + [ + 422, + 423 + ], + [ + 426, + 427 + ], + [ + 434, + 435 + ], + [ + 436, + 437 + ], + [ + 442, + 444 + ], + [ + 452, + 453 + ], + [ + 457, + 458 + ], + [ + 466, + 467 + ], + [ + 473, + 474 + ], + [ + 481, + 483 + ], + [ + 485, + 486 + ], + [ + 488, + 489 + ], + [ + 491, + 493 + ], + [ + 499, + 501 + ], + [ + 510, + 511 + ], + [ + 516, + 517 + ], + [ + 523, + 524 + ], + [ + 526, + 527 + ], + [ + 531, + 532 + ], + [ + 534, + 535 + ], + [ + 540, + 541 + ], + [ + 543, + 544 + ], + [ + 546, + 547 + ], + [ + 551, + 552 + ], + [ + 558, + 559 + ], + [ + 562, + 563 + ], + [ + 566, + 568 + ], + [ + 575, + 577 + ], + [ + 579, + 581 + ], + [ + 584, + 586 + ], + [ + 591, + 592 + ], + [ + 596, + 598 + ], + [ + 599, + 601 + ], + [ + 602, + 603 + ], + [ + 606, + 607 + ], + [ + 610, + 611 + ], + [ + 614, + 616 + ], + [ + 618, + 619 + ], + [ + 624, + 630 + ], + [ + 634, + 635 + ], + [ + 638, + 640 + ], + [ + 644, + 646 + ], + [ + 649, + 650 + ], + [ + 660, + 662 + ], + [ + 663, + 664 + ], + [ + 665, + 667 + ], + [ + 678, + 679 + ], + [ + 684, + 685 + ], + [ + 686, + 687 + ], + [ + 688, + 689 + ], + [ + 690, + 692 + ], + [ + 697, + 699 + ], + [ + 702, + 706 + ], + [ + 710, + 711 + ], + [ + 714, + 715 + ], + [ + 721, + 722 + ], + [ + 725, + 727 + ], + [ + 735, + 738 + ], + [ + 744, + 746 + ], + [ + 747, + 748 + ], + [ + 752, + 754 + ], + [ + 759, + 762 + ], + [ + 764, + 765 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ], + [ + 776, + 777 + ], + [ + 779, + 780 + ], + [ + 781, + 782 + ], + [ + 784, + 785 + ], + [ + 790, + 791 + ], + [ + 794, + 795 + ], + [ + 796, + 797 + ], + [ + 802, + 803 + ], + [ + 809, + 810 + ], + [ + 811, + 812 + ], + [ + 815, + 817 + ], + [ + 818, + 820 + ], + [ + 821, + 823 + ], + [ + 824, + 825 + ], + [ + 827, + 828 + ], + [ + 834, + 852 + ], + [ + 855, + 865 + ], + [ + 867, + 868 + ], + [ + 872, + 874 + ], + [ + 882, + 883 + ], + [ + 886, + 887 + ], + [ + 898, + 900 + ], + [ + 901, + 905 + ], + [ + 906, + 907 + ], + [ + 908, + 909 + ], + [ + 911, + 912 + ], + [ + 917, + 922 + ], + [ + 923, + 924 + ], + [ + 926, + 929 + ], + [ + 930, + 931 + ], + [ + 933, + 935 + ], + [ + 937, + 939 + ], + [ + 941, + 943 + ], + [ + 945, + 947 + ], + [ + 949, + 951 + ], + [ + 953, + 955 + ], + [ + 957, + 959 + ], + [ + 961, + 963 + ], + [ + 970, + 971 + ], + [ + 974, + 975 + ], + [ + 976, + 977 + ], + [ + 981, + 985 + ], + [ + 987, + 991 + ], + [ + 996, + 1007 + ], + [ + 1009, + 1074 + ], + [ + 1076, + 1078 + ], + [ + 1080, + 1095 + ], + [ + 1097, + 1098 + ], + [ + 1099, + 1100 + ], + [ + 1102, + 1104 + ], + [ + 1113, + 1114 + ], + [ + 1117, + 1118 + ], + [ + 1129, + 1131 + ], + [ + 1132, + 1136 + ], + [ + 1137, + 1138 + ], + [ + 1139, + 1140 + ], + [ + 1142, + 1144 + ], + [ + 1145, + 1146 + ], + [ + 1150, + 1155 + ], + [ + 1156, + 1158 + ], + [ + 1160, + 1164 + ], + [ + 1165, + 1167 + ], + [ + 1169, + 1172 + ], + [ + 1174, + 1176 + ], + [ + 1178, + 1180 + ], + [ + 1182, + 1184 + ], + [ + 1186, + 1188 + ], + [ + 1190, + 1192 + ], + [ + 1194, + 1196 + ], + [ + 1198, + 1200 + ], + [ + 1206, + 1207 + ], + [ + 1210, + 1211 + ], + [ + 1212, + 1213 + ], + [ + 1218, + 1222 + ], + [ + 1224, + 1228 + ], + [ + 1232, + 1236 + ], + [ + 1237, + 1238 + ], + [ + 1241, + 1242 + ], + [ + 1245, + 1246 + ], + [ + 1249, + 1251 + ], + [ + 1254, + 1257 + ], + [ + 1259, + 1261 + ], + [ + 1265, + 1267 + ], + [ + 1268, + 1274 + ], + [ + 1276, + 1281 + ], + [ + 1285, + 1286 + ], + [ + 1289, + 1290 + ], + [ + 1291, + 1292 + ], + [ + 1298, + 1299 + ], + [ + 1301, + 1314 + ], + [ + 1317, + 1318 + ], + [ + 1319, + 1321 + ], + [ + 1336, + 1338 + ], + [ + 1339, + 1341 + ], + [ + 1346, + 1347 + ], + [ + 1357, + 1359 + ], + [ + 1363, + 1366 + ], + [ + 1367, + 1368 + ] + ] + } + }, + { + "filename": "libvips/convolution/convasep.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 13, + 41 + ], + [ + 44, + 51 + ], + [ + 53, + 69 + ], + [ + 96, + 108 + ], + [ + 113, + 121 + ], + [ + 132, + 172 + ], + [ + 177, + 195 + ], + [ + 197, + 214 + ], + [ + 225, + 262 + ], + [ + 268, + 277 + ], + [ + 282, + 290 + ], + [ + 291, + 311 + ], + [ + 312, + 337 + ], + [ + 338, + 551 + ], + [ + 553, + 564 + ], + [ + 569, + 631 + ], + [ + 632, + 727 + ], + [ + 729, + 740 + ], + [ + 745, + 828 + ], + [ + 830, + 928 + ], + [ + 936, + 973 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 7, + 8 + ], + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 32 + ], + [ + 37, + 38 + ], + [ + 47, + 48 + ], + [ + 56, + 57 + ], + [ + 61, + 62 + ], + [ + 64, + 66 + ], + [ + 99, + 100 + ], + [ + 101, + 103 + ], + [ + 104, + 105 + ], + [ + 116, + 118 + ], + [ + 135, + 136 + ], + [ + 138, + 139 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 151, + 154 + ], + [ + 157, + 158 + ], + [ + 163, + 164 + ], + [ + 166, + 169 + ], + [ + 180, + 183 + ], + [ + 188, + 190 + ], + [ + 191, + 192 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 205, + 206 + ], + [ + 210, + 211 + ], + [ + 228, + 229 + ], + [ + 232, + 237 + ], + [ + 240, + 243 + ], + [ + 247, + 250 + ], + [ + 255, + 259 + ], + [ + 271, + 274 + ], + [ + 285, + 287 + ], + [ + 294, + 297 + ], + [ + 303, + 304 + ], + [ + 306, + 308 + ], + [ + 315, + 319 + ], + [ + 321, + 323 + ], + [ + 324, + 325 + ], + [ + 326, + 327 + ], + [ + 328, + 331 + ], + [ + 333, + 334 + ], + [ + 341, + 342 + ], + [ + 343, + 344 + ], + [ + 349, + 351 + ], + [ + 352, + 353 + ], + [ + 358, + 359 + ], + [ + 362, + 367 + ], + [ + 368, + 369 + ], + [ + 374, + 375 + ], + [ + 381, + 383 + ], + [ + 387, + 390 + ], + [ + 392, + 394 + ], + [ + 395, + 396 + ], + [ + 398, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 452 + ], + [ + 457, + 469 + ], + [ + 470, + 474 + ], + [ + 476, + 480 + ], + [ + 481, + 482 + ], + [ + 484, + 498 + ], + [ + 499, + 500 + ], + [ + 501, + 513 + ], + [ + 514, + 518 + ], + [ + 520, + 524 + ], + [ + 527, + 540 + ], + [ + 541, + 542 + ], + [ + 546, + 548 + ], + [ + 556, + 557 + ], + [ + 560, + 561 + ], + [ + 572, + 574 + ], + [ + 578, + 582 + ], + [ + 583, + 584 + ], + [ + 585, + 586 + ], + [ + 588, + 589 + ], + [ + 594, + 598 + ], + [ + 600, + 602 + ], + [ + 604, + 606 + ], + [ + 608, + 610 + ], + [ + 612, + 614 + ], + [ + 616, + 618 + ], + [ + 620, + 623 + ], + [ + 625, + 628 + ], + [ + 635, + 636 + ], + [ + 638, + 650 + ], + [ + 651, + 655 + ], + [ + 659, + 660 + ], + [ + 662, + 677 + ], + [ + 678, + 679 + ], + [ + 680, + 692 + ], + [ + 693, + 697 + ], + [ + 702, + 715 + ], + [ + 716, + 717 + ], + [ + 722, + 724 + ], + [ + 732, + 733 + ], + [ + 736, + 737 + ], + [ + 748, + 750 + ], + [ + 754, + 757 + ], + [ + 758, + 759 + ], + [ + 760, + 761 + ], + [ + 763, + 764 + ], + [ + 769, + 772 + ], + [ + 774, + 776 + ], + [ + 778, + 780 + ], + [ + 782, + 784 + ], + [ + 786, + 788 + ], + [ + 790, + 792 + ], + [ + 794, + 797 + ], + [ + 799, + 802 + ], + [ + 808, + 809 + ], + [ + 812, + 814 + ], + [ + 815, + 816 + ], + [ + 819, + 823 + ], + [ + 824, + 825 + ], + [ + 833, + 838 + ], + [ + 840, + 843 + ], + [ + 844, + 845 + ], + [ + 847, + 849 + ], + [ + 850, + 851 + ], + [ + 853, + 854 + ], + [ + 857, + 859 + ], + [ + 860, + 862 + ], + [ + 865, + 868 + ], + [ + 871, + 873 + ], + [ + 874, + 880 + ], + [ + 882, + 889 + ], + [ + 893, + 895 + ], + [ + 896, + 897 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 909, + 911 + ], + [ + 913, + 919 + ], + [ + 922, + 923 + ], + [ + 924, + 925 + ], + [ + 939, + 941 + ], + [ + 942, + 945 + ], + [ + 950, + 951 + ], + [ + 954, + 956 + ], + [ + 961, + 963 + ], + [ + 967, + 970 + ], + [ + 971, + 972 + ] + ] + } + }, + { + "filename": "libvips/convolution/convf.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 31 + ], + [ + 55, + 83 + ], + [ + 99, + 200 + ], + [ + 204, + 267 + ], + [ + 268, + 287 + ], + [ + 289, + 316 + ], + [ + 318, + 325 + ], + [ + 326, + 344 + ], + [ + 345, + 382 + ], + [ + 386, + 416 + ] + ], + "lines_added": [ + [ + 19, + 20 + ], + [ + 22, + 23 + ], + [ + 27, + 28 + ], + [ + 58, + 59 + ], + [ + 60, + 64 + ], + [ + 65, + 74 + ], + [ + 79, + 80 + ], + [ + 102, + 104 + ], + [ + 108, + 109 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 130, + 131 + ], + [ + 136, + 137 + ], + [ + 142, + 144 + ], + [ + 149, + 153 + ], + [ + 155, + 156 + ], + [ + 158, + 176 + ], + [ + 180, + 181 + ], + [ + 186, + 187 + ], + [ + 189, + 190 + ], + [ + 191, + 192 + ], + [ + 194, + 197 + ], + [ + 207, + 209 + ], + [ + 210, + 211 + ], + [ + 213, + 215 + ], + [ + 216, + 217 + ], + [ + 221, + 225 + ], + [ + 228, + 229 + ], + [ + 230, + 234 + ], + [ + 236, + 238 + ], + [ + 240, + 242 + ], + [ + 244, + 246 + ], + [ + 248, + 250 + ], + [ + 252, + 254 + ], + [ + 256, + 259 + ], + [ + 261, + 264 + ], + [ + 271, + 272 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 279, + 280 + ], + [ + 283, + 284 + ], + [ + 292, + 294 + ], + [ + 296, + 297 + ], + [ + 301, + 303 + ], + [ + 305, + 308 + ], + [ + 311, + 313 + ], + [ + 321, + 322 + ], + [ + 329, + 336 + ], + [ + 337, + 341 + ], + [ + 348, + 349 + ], + [ + 353, + 356 + ], + [ + 360, + 361 + ], + [ + 364, + 365 + ], + [ + 369, + 370 + ], + [ + 374, + 375 + ], + [ + 376, + 379 + ], + [ + 389, + 390 + ], + [ + 394, + 395 + ], + [ + 396, + 397 + ], + [ + 398, + 399 + ], + [ + 404, + 406 + ], + [ + 410, + 413 + ], + [ + 414, + 415 + ] + ] + } + }, + { + "filename": "libvips/convolution/convi.c", + "line_filter": { + "diff_chunks": [ + [ + 30, + 42 + ], + [ + 75, + 114 + ], + [ + 131, + 160 + ], + [ + 166, + 255 + ], + [ + 257, + 306 + ], + [ + 308, + 343 + ], + [ + 348, + 392 + ], + [ + 393, + 487 + ], + [ + 488, + 495 + ], + [ + 497, + 505 + ], + [ + 507, + 693 + ], + [ + 697, + 760 + ], + [ + 761, + 772 + ], + [ + 774, + 781 + ], + [ + 783, + 794 + ], + [ + 801, + 843 + ], + [ + 845, + 852 + ], + [ + 855, + 895 + ], + [ + 897, + 1014 + ], + [ + 1015, + 1073 + ], + [ + 1074, + 1109 + ], + [ + 1112, + 1132 + ], + [ + 1133, + 1148 + ] + ], + "lines_added": [ + [ + 33, + 34 + ], + [ + 38, + 39 + ], + [ + 78, + 79 + ], + [ + 85, + 86 + ], + [ + 87, + 91 + ], + [ + 92, + 101 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 134, + 135 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 150, + 151 + ], + [ + 156, + 157 + ], + [ + 169, + 170 + ], + [ + 174, + 176 + ], + [ + 180, + 181 + ], + [ + 186, + 187 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 193, + 194 + ], + [ + 200, + 201 + ], + [ + 204, + 206 + ], + [ + 207, + 208 + ], + [ + 211, + 212 + ], + [ + 216, + 219 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 229, + 230 + ], + [ + 233, + 237 + ], + [ + 238, + 239 + ], + [ + 244, + 245 + ], + [ + 250, + 252 + ], + [ + 260, + 261 + ], + [ + 264, + 268 + ], + [ + 273, + 281 + ], + [ + 284, + 285 + ], + [ + 287, + 293 + ], + [ + 295, + 296 + ], + [ + 302, + 303 + ], + [ + 311, + 312 + ], + [ + 314, + 315 + ], + [ + 318, + 319 + ], + [ + 322, + 325 + ], + [ + 327, + 329 + ], + [ + 330, + 331 + ], + [ + 333, + 335 + ], + [ + 336, + 338 + ], + [ + 339, + 340 + ], + [ + 351, + 352 + ], + [ + 356, + 357 + ], + [ + 360, + 362 + ], + [ + 363, + 366 + ], + [ + 371, + 372 + ], + [ + 373, + 375 + ], + [ + 378, + 382 + ], + [ + 384, + 385 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 396, + 397 + ], + [ + 398, + 400 + ], + [ + 402, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 410 + ], + [ + 414, + 415 + ], + [ + 418, + 419 + ], + [ + 424, + 425 + ], + [ + 426, + 427 + ], + [ + 428, + 429 + ], + [ + 432, + 433 + ], + [ + 434, + 436 + ], + [ + 437, + 439 + ], + [ + 440, + 441 + ], + [ + 442, + 444 + ], + [ + 445, + 446 + ], + [ + 449, + 450 + ], + [ + 456, + 457 + ], + [ + 459, + 461 + ], + [ + 467, + 469 + ], + [ + 471, + 472 + ], + [ + 475, + 477 + ], + [ + 478, + 479 + ], + [ + 482, + 484 + ], + [ + 491, + 492 + ], + [ + 500, + 502 + ], + [ + 510, + 517 + ], + [ + 518, + 519 + ], + [ + 520, + 522 + ], + [ + 524, + 534 + ], + [ + 539, + 541 + ], + [ + 542, + 548 + ], + [ + 549, + 550 + ], + [ + 553, + 554 + ], + [ + 556, + 559 + ], + [ + 561, + 563 + ], + [ + 566, + 567 + ], + [ + 568, + 569 + ], + [ + 570, + 571 + ], + [ + 575, + 597 + ], + [ + 600, + 620 + ], + [ + 623, + 666 + ], + [ + 670, + 672 + ], + [ + 677, + 678 + ], + [ + 679, + 680 + ], + [ + 682, + 683 + ], + [ + 684, + 685 + ], + [ + 687, + 690 + ], + [ + 700, + 702 + ], + [ + 703, + 704 + ], + [ + 706, + 708 + ], + [ + 709, + 710 + ], + [ + 714, + 718 + ], + [ + 721, + 722 + ], + [ + 723, + 727 + ], + [ + 729, + 731 + ], + [ + 733, + 735 + ], + [ + 737, + 739 + ], + [ + 741, + 743 + ], + [ + 745, + 747 + ], + [ + 749, + 752 + ], + [ + 754, + 757 + ], + [ + 764, + 765 + ], + [ + 766, + 767 + ], + [ + 768, + 769 + ], + [ + 777, + 778 + ], + [ + 786, + 791 + ], + [ + 804, + 816 + ], + [ + 817, + 818 + ], + [ + 823, + 826 + ], + [ + 828, + 829 + ], + [ + 830, + 832 + ], + [ + 834, + 836 + ], + [ + 837, + 838 + ], + [ + 839, + 840 + ], + [ + 848, + 849 + ], + [ + 858, + 860 + ], + [ + 863, + 867 + ], + [ + 868, + 871 + ], + [ + 873, + 883 + ], + [ + 888, + 890 + ], + [ + 891, + 892 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 905, + 906 + ], + [ + 907, + 911 + ], + [ + 917, + 921 + ], + [ + 922, + 923 + ], + [ + 924, + 928 + ], + [ + 932, + 944 + ], + [ + 949, + 966 + ], + [ + 967, + 968 + ], + [ + 969, + 974 + ], + [ + 975, + 979 + ], + [ + 981, + 982 + ], + [ + 985, + 986 + ], + [ + 989, + 990 + ], + [ + 995, + 996 + ], + [ + 997, + 999 + ], + [ + 1004, + 1011 + ], + [ + 1018, + 1022 + ], + [ + 1023, + 1024 + ], + [ + 1026, + 1027 + ], + [ + 1031, + 1033 + ], + [ + 1036, + 1038 + ], + [ + 1040, + 1045 + ], + [ + 1046, + 1047 + ], + [ + 1049, + 1051 + ], + [ + 1056, + 1057 + ], + [ + 1059, + 1060 + ], + [ + 1066, + 1070 + ], + [ + 1077, + 1080 + ], + [ + 1084, + 1085 + ], + [ + 1088, + 1089 + ], + [ + 1090, + 1091 + ], + [ + 1096, + 1097 + ], + [ + 1101, + 1102 + ], + [ + 1103, + 1106 + ], + [ + 1115, + 1117 + ], + [ + 1119, + 1120 + ], + [ + 1125, + 1126 + ], + [ + 1128, + 1129 + ], + [ + 1136, + 1138 + ], + [ + 1142, + 1145 + ], + [ + 1146, + 1147 + ] + ] + } + }, + { + "filename": "libvips/convolution/convolution.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 51, + 58 + ], + [ + 62, + 78 + ], + [ + 80, + 124 + ], + [ + 125, + 152 + ], + [ + 153, + 186 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 32, + 33 + ], + [ + 54, + 55 + ], + [ + 65, + 66 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 83, + 85 + ], + [ + 87, + 88 + ], + [ + 89, + 92 + ], + [ + 94, + 97 + ], + [ + 99, + 101 + ], + [ + 102, + 104 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 115 + ], + [ + 120, + 121 + ], + [ + 128, + 131 + ], + [ + 132, + 133 + ], + [ + 134, + 139 + ], + [ + 140, + 145 + ], + [ + 148, + 149 + ], + [ + 156, + 157 + ], + [ + 158, + 185 + ] + ] + } + }, + { + "filename": "libvips/convolution/convsep.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 9, + 37 + ], + [ + 48, + 156 + ], + [ + 172, + 181 + ], + [ + 182, + 197 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 28 + ], + [ + 33, + 34 + ], + [ + 51, + 54 + ], + [ + 58, + 59 + ], + [ + 61, + 62 + ], + [ + 63, + 64 + ], + [ + 66, + 68 + ], + [ + 71, + 72 + ], + [ + 73, + 75 + ], + [ + 76, + 78 + ], + [ + 81, + 86 + ], + [ + 88, + 89 + ], + [ + 91, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 102 + ], + [ + 105, + 107 + ], + [ + 110, + 112 + ], + [ + 113, + 114 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 126, + 127 + ], + [ + 129, + 149 + ], + [ + 152, + 153 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 185, + 187 + ], + [ + 191, + 194 + ], + [ + 195, + 196 + ] + ] + } + }, + { + "filename": "libvips/convolution/correlation.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 45, + 63 + ], + [ + 67, + 172 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 48, + 50 + ], + [ + 52, + 54 + ], + [ + 57, + 60 + ], + [ + 70, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 79, + 80 + ], + [ + 81, + 83 + ], + [ + 84, + 85 + ], + [ + 86, + 88 + ], + [ + 91, + 102 + ], + [ + 106, + 107 + ], + [ + 111, + 115 + ], + [ + 117, + 118 + ], + [ + 119, + 131 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ], + [ + 144, + 145 + ], + [ + 149, + 152 + ], + [ + 153, + 154 + ], + [ + 155, + 160 + ], + [ + 161, + 166 + ], + [ + 169, + 170 + ] + ] + } + }, + { + "filename": "libvips/convolution/correlation.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 72, + 95 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 75, + 76 + ], + [ + 81, + 82 + ], + [ + 83, + 85 + ], + [ + 88, + 89 + ] + ] + } + }, + { + "filename": "libvips/convolution/fastcor.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 19 + ], + [ + 28, + 56 + ], + [ + 69, + 189 + ], + [ + 198, + 205 + ], + [ + 207, + 227 + ], + [ + 234, + 253 + ], + [ + 254, + 269 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 31, + 32 + ], + [ + 33, + 37 + ], + [ + 38, + 47 + ], + [ + 52, + 53 + ], + [ + 72, + 98 + ], + [ + 99, + 101 + ], + [ + 102, + 129 + ], + [ + 130, + 132 + ], + [ + 133, + 135 + ], + [ + 137, + 139 + ], + [ + 142, + 145 + ], + [ + 148, + 152 + ], + [ + 153, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 164 + ], + [ + 165, + 168 + ], + [ + 169, + 172 + ], + [ + 173, + 177 + ], + [ + 178, + 181 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 201, + 202 + ], + [ + 210, + 211 + ], + [ + 213, + 214 + ], + [ + 216, + 217 + ], + [ + 223, + 224 + ], + [ + 237, + 238 + ], + [ + 240, + 242 + ], + [ + 243, + 245 + ], + [ + 249, + 250 + ], + [ + 257, + 259 + ], + [ + 263, + 266 + ], + [ + 267, + 268 + ] + ] + } + }, + { + "filename": "libvips/convolution/gaussblur.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 11, + 39 + ], + [ + 57, + 174 + ], + [ + 184, + 205 + ] + ], + "lines_added": [ + [ + 1, + 3 + ], + [ + 14, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 35, + 36 + ], + [ + 60, + 63 + ], + [ + 68, + 69 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 76, + 78 + ], + [ + 82, + 85 + ], + [ + 87, + 93 + ], + [ + 95, + 97 + ], + [ + 99, + 100 + ], + [ + 101, + 105 + ], + [ + 107, + 108 + ], + [ + 109, + 111 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 126, + 127 + ], + [ + 131, + 134 + ], + [ + 135, + 136 + ], + [ + 137, + 142 + ], + [ + 143, + 146 + ], + [ + 147, + 149 + ], + [ + 150, + 153 + ], + [ + 154, + 156 + ], + [ + 157, + 163 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 193, + 195 + ], + [ + 199, + 202 + ], + [ + 203, + 204 + ] + ] + } + }, + { + "filename": "libvips/convolution/pconvolution.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 71, + 81 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 74, + 75 + ] + ] + } + }, + { + "filename": "libvips/convolution/sharpen.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 9 + ], + [ + 22, + 29 + ], + [ + 45, + 73 + ], + [ + 91, + 98 + ], + [ + 100, + 107 + ], + [ + 110, + 143 + ], + [ + 148, + 391 + ], + [ + 404, + 411 + ], + [ + 415, + 427 + ], + [ + 443, + 472 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 5, + 6 + ], + [ + 25, + 26 + ], + [ + 48, + 54 + ], + [ + 55, + 59 + ], + [ + 60, + 64 + ], + [ + 69, + 70 + ], + [ + 94, + 95 + ], + [ + 103, + 104 + ], + [ + 113, + 114 + ], + [ + 116, + 118 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 126, + 128 + ], + [ + 129, + 130 + ], + [ + 131, + 138 + ], + [ + 139, + 140 + ], + [ + 151, + 153 + ], + [ + 155, + 157 + ], + [ + 158, + 159 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 175, + 177 + ], + [ + 182, + 183 + ], + [ + 184, + 186 + ], + [ + 190, + 192 + ], + [ + 194, + 195 + ], + [ + 197, + 199 + ], + [ + 201, + 205 + ], + [ + 206, + 208 + ], + [ + 209, + 214 + ], + [ + 216, + 218 + ], + [ + 222, + 224 + ], + [ + 225, + 226 + ], + [ + 231, + 232 + ], + [ + 236, + 237 + ], + [ + 240, + 241 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 251, + 252 + ], + [ + 255, + 265 + ], + [ + 269, + 272 + ], + [ + 273, + 275 + ], + [ + 277, + 280 + ], + [ + 281, + 285 + ], + [ + 286, + 287 + ], + [ + 290, + 294 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 305, + 306 + ], + [ + 311, + 312 + ], + [ + 316, + 319 + ], + [ + 320, + 321 + ], + [ + 322, + 327 + ], + [ + 328, + 331 + ], + [ + 332, + 334 + ], + [ + 335, + 338 + ], + [ + 339, + 341 + ], + [ + 342, + 345 + ], + [ + 346, + 348 + ], + [ + 349, + 352 + ], + [ + 353, + 355 + ], + [ + 356, + 359 + ], + [ + 360, + 362 + ], + [ + 363, + 366 + ], + [ + 367, + 369 + ], + [ + 372, + 375 + ], + [ + 376, + 378 + ], + [ + 381, + 382 + ], + [ + 385, + 388 + ], + [ + 407, + 408 + ], + [ + 418, + 419 + ], + [ + 420, + 422 + ], + [ + 423, + 424 + ], + [ + 446, + 448 + ], + [ + 449, + 454 + ], + [ + 457, + 458 + ], + [ + 460, + 462 + ], + [ + 466, + 469 + ], + [ + 470, + 471 + ] + ] + } + }, + { + "filename": "libvips/convolution/sobel.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 59, + 109 + ], + [ + 110, + 228 + ], + [ + 234, + 252 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 62, + 63 + ], + [ + 65, + 67 + ], + [ + 69, + 70 + ], + [ + 74, + 76 + ], + [ + 77, + 84 + ], + [ + 85, + 86 + ], + [ + 88, + 89 + ], + [ + 94, + 95 + ], + [ + 100, + 101 + ], + [ + 102, + 104 + ], + [ + 105, + 106 + ], + [ + 113, + 126 + ], + [ + 127, + 129 + ], + [ + 130, + 131 + ], + [ + 135, + 138 + ], + [ + 139, + 143 + ], + [ + 144, + 145 + ], + [ + 150, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 156 + ], + [ + 157, + 165 + ], + [ + 166, + 171 + ], + [ + 172, + 173 + ], + [ + 174, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 185, + 188 + ], + [ + 190, + 192 + ], + [ + 194, + 195 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 207, + 208 + ], + [ + 210, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 221 + ], + [ + 224, + 225 + ], + [ + 237, + 238 + ], + [ + 240, + 242 + ], + [ + 246, + 249 + ], + [ + 250, + 251 + ] + ] + } + }, + { + "filename": "libvips/convolution/spcor.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 18 + ], + [ + 42, + 70 + ], + [ + 87, + 216 + ], + [ + 218, + 266 + ], + [ + 271, + 280 + ], + [ + 306, + 319 + ], + [ + 320, + 327 + ], + [ + 338, + 346 + ], + [ + 352, + 363 + ], + [ + 367, + 382 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 14, + 15 + ], + [ + 45, + 46 + ], + [ + 47, + 51 + ], + [ + 52, + 61 + ], + [ + 66, + 67 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 106, + 114 + ], + [ + 117, + 119 + ], + [ + 122, + 131 + ], + [ + 132, + 136 + ], + [ + 139, + 147 + ], + [ + 148, + 149 + ], + [ + 151, + 152 + ], + [ + 154, + 170 + ], + [ + 171, + 202 + ], + [ + 204, + 206 + ], + [ + 210, + 213 + ], + [ + 221, + 224 + ], + [ + 225, + 228 + ], + [ + 229, + 233 + ], + [ + 235, + 237 + ], + [ + 239, + 241 + ], + [ + 243, + 245 + ], + [ + 247, + 250 + ], + [ + 251, + 254 + ], + [ + 255, + 259 + ], + [ + 260, + 263 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 309, + 310 + ], + [ + 312, + 313 + ], + [ + 315, + 316 + ], + [ + 323, + 324 + ], + [ + 341, + 343 + ], + [ + 355, + 356 + ], + [ + 358, + 360 + ], + [ + 370, + 372 + ], + [ + 376, + 379 + ], + [ + 380, + 381 + ] + ] + } + }, + { + "filename": "libvips/create/black.c", + "line_filter": { + "diff_chunks": [ + [ + 22, + 50 + ], + [ + 77, + 166 + ], + [ + 182, + 196 + ] + ], + "lines_added": [ + [ + 25, + 41 + ], + [ + 46, + 47 + ], + [ + 80, + 81 + ], + [ + 83, + 85 + ], + [ + 86, + 88 + ], + [ + 89, + 93 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 105, + 107 + ], + [ + 108, + 110 + ], + [ + 111, + 116 + ], + [ + 117, + 120 + ], + [ + 121, + 122 + ], + [ + 125, + 126 + ], + [ + 127, + 129 + ], + [ + 130, + 131 + ], + [ + 136, + 137 + ], + [ + 139, + 142 + ], + [ + 143, + 145 + ], + [ + 146, + 149 + ], + [ + 150, + 152 + ], + [ + 153, + 156 + ], + [ + 157, + 159 + ], + [ + 162, + 163 + ], + [ + 185, + 186 + ], + [ + 190, + 193 + ], + [ + 194, + 195 + ] + ] + } + }, + { + "filename": "libvips/create/buildlut.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 20, + 48 + ], + [ + 67, + 189 + ], + [ + 195, + 212 + ], + [ + 215, + 274 + ], + [ + 279, + 286 + ], + [ + 296, + 303 + ], + [ + 328, + 336 + ], + [ + 338, + 352 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 70, + 71 + ], + [ + 76, + 80 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 91, + 94 + ], + [ + 95, + 96 + ], + [ + 101, + 102 + ], + [ + 108, + 114 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 126, + 130 + ], + [ + 132, + 136 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 148, + 151 + ], + [ + 153, + 157 + ], + [ + 158, + 161 + ], + [ + 164, + 166 + ], + [ + 168, + 170 + ], + [ + 172, + 173 + ], + [ + 174, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 198, + 202 + ], + [ + 207, + 209 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 224, + 226 + ], + [ + 228, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 237 + ], + [ + 238, + 244 + ], + [ + 245, + 246 + ], + [ + 249, + 250 + ], + [ + 251, + 253 + ], + [ + 259, + 260 + ], + [ + 262, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 271 + ], + [ + 282, + 283 + ], + [ + 299, + 300 + ], + [ + 331, + 333 + ], + [ + 341, + 342 + ], + [ + 346, + 349 + ], + [ + 350, + 351 + ] + ] + } + }, + { + "filename": "libvips/create/create.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 58 + ], + [ + 63, + 74 + ], + [ + 77, + 189 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 66, + 67 + ], + [ + 70, + 71 + ], + [ + 80, + 81 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 88, + 91 + ], + [ + 93, + 94 + ], + [ + 95, + 97 + ], + [ + 98, + 99 + ], + [ + 102, + 103 + ], + [ + 104, + 106 + ], + [ + 111, + 112 + ], + [ + 114, + 119 + ], + [ + 122, + 123 + ], + [ + 127, + 128 + ], + [ + 129, + 133 + ], + [ + 134, + 135 + ], + [ + 136, + 158 + ], + [ + 162, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 188 + ] + ] + } + }, + { + "filename": "libvips/create/eye.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 45 + ], + [ + 70, + 124 + ], + [ + 130, + 155 + ] + ], + "lines_added": [ + [ + 20, + 36 + ], + [ + 41, + 42 + ], + [ + 73, + 74 + ], + [ + 76, + 77 + ], + [ + 82, + 84 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 94, + 97 + ], + [ + 102, + 104 + ], + [ + 107, + 110 + ], + [ + 111, + 113 + ], + [ + 116, + 117 + ], + [ + 133, + 135 + ], + [ + 137, + 138 + ], + [ + 144, + 145 + ], + [ + 149, + 152 + ], + [ + 153, + 154 + ] + ] + } + }, + { + "filename": "libvips/create/fractsurf.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 62, + 133 + ], + [ + 138, + 145 + ], + [ + 146, + 162 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 65, + 66 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 74, + 76 + ], + [ + 77, + 78 + ], + [ + 80, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 95 + ], + [ + 100, + 101 + ], + [ + 103, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 113 + ], + [ + 114, + 116 + ], + [ + 117, + 120 + ], + [ + 121, + 123 + ], + [ + 126, + 127 + ], + [ + 128, + 130 + ], + [ + 141, + 142 + ], + [ + 149, + 151 + ], + [ + 155, + 159 + ], + [ + 160, + 161 + ] + ] + } + }, + { + "filename": "libvips/create/gaussmat.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 21 + ], + [ + 25, + 53 + ], + [ + 75, + 83 + ], + [ + 85, + 225 + ], + [ + 237, + 246 + ], + [ + 250, + 260 + ], + [ + 262, + 276 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 28, + 29 + ], + [ + 30, + 34 + ], + [ + 35, + 44 + ], + [ + 49, + 50 + ], + [ + 78, + 80 + ], + [ + 88, + 89 + ], + [ + 95, + 96 + ], + [ + 97, + 99 + ], + [ + 100, + 102 + ], + [ + 104, + 106 + ], + [ + 107, + 109 + ], + [ + 114, + 117 + ], + [ + 119, + 120 + ], + [ + 122, + 124 + ], + [ + 125, + 126 + ], + [ + 128, + 131 + ], + [ + 132, + 134 + ], + [ + 135, + 138 + ], + [ + 139, + 143 + ], + [ + 145, + 147 + ], + [ + 150, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 165, + 167 + ], + [ + 168, + 169 + ], + [ + 172, + 173 + ], + [ + 174, + 176 + ], + [ + 181, + 182 + ], + [ + 184, + 187 + ], + [ + 188, + 190 + ], + [ + 191, + 194 + ], + [ + 195, + 197 + ], + [ + 198, + 201 + ], + [ + 202, + 204 + ], + [ + 205, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 218 + ], + [ + 221, + 222 + ], + [ + 240, + 243 + ], + [ + 253, + 254 + ], + [ + 255, + 257 + ], + [ + 265, + 266 + ], + [ + 270, + 273 + ], + [ + 274, + 275 + ] + ] + } + }, + { + "filename": "libvips/create/gaussnoise.c", + "line_filter": { + "diff_chunks": [ + [ + 30, + 58 + ], + [ + 83, + 211 + ], + [ + 220, + 227 + ], + [ + 228, + 242 + ] + ], + "lines_added": [ + [ + 33, + 49 + ], + [ + 54, + 55 + ], + [ + 86, + 87 + ], + [ + 89, + 91 + ], + [ + 93, + 94 + ], + [ + 97, + 100 + ], + [ + 103, + 104 + ], + [ + 109, + 111 + ], + [ + 113, + 115 + ], + [ + 118, + 119 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 132, + 134 + ], + [ + 135, + 136 + ], + [ + 138, + 139 + ], + [ + 140, + 144 + ], + [ + 145, + 146 + ], + [ + 149, + 150 + ], + [ + 151, + 153 + ], + [ + 159, + 160 + ], + [ + 166, + 169 + ], + [ + 170, + 172 + ], + [ + 173, + 176 + ], + [ + 177, + 179 + ], + [ + 180, + 183 + ], + [ + 184, + 186 + ], + [ + 187, + 190 + ], + [ + 191, + 193 + ], + [ + 194, + 197 + ], + [ + 198, + 200 + ], + [ + 203, + 204 + ], + [ + 207, + 208 + ], + [ + 223, + 224 + ], + [ + 231, + 232 + ], + [ + 236, + 239 + ], + [ + 240, + 241 + ] + ] + } + }, + { + "filename": "libvips/create/grey.c", + "line_filter": { + "diff_chunks": [ + [ + 24, + 52 + ], + [ + 71, + 101 + ], + [ + 113, + 134 + ] + ], + "lines_added": [ + [ + 27, + 43 + ], + [ + 48, + 49 + ], + [ + 74, + 75 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 83, + 84 + ], + [ + 85, + 87 + ], + [ + 89, + 90 + ], + [ + 92, + 94 + ], + [ + 97, + 98 + ], + [ + 116, + 117 + ], + [ + 123, + 124 + ], + [ + 128, + 131 + ], + [ + 132, + 133 + ] + ] + } + }, + { + "filename": "libvips/create/identity.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 18, + 46 + ], + [ + 67, + 169 + ], + [ + 182, + 211 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 21, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 37 + ], + [ + 42, + 43 + ], + [ + 70, + 83 + ], + [ + 85, + 87 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 97 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 111, + 113 + ], + [ + 114, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 131, + 133 + ], + [ + 138, + 140 + ], + [ + 142, + 145 + ], + [ + 146, + 148 + ], + [ + 149, + 152 + ], + [ + 153, + 155 + ], + [ + 156, + 159 + ], + [ + 160, + 162 + ], + [ + 165, + 166 + ], + [ + 185, + 186 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 193, + 194 + ], + [ + 200, + 201 + ], + [ + 205, + 208 + ], + [ + 209, + 210 + ] + ] + } + }, + { + "filename": "libvips/create/invertlut.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 44 + ], + [ + 71, + 179 + ], + [ + 181, + 188 + ], + [ + 191, + 198 + ], + [ + 200, + 207 + ], + [ + 213, + 220 + ], + [ + 224, + 234 + ], + [ + 241, + 307 + ], + [ + 364, + 378 + ] + ], + "lines_added": [ + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 35 + ], + [ + 40, + 41 + ], + [ + 74, + 75 + ], + [ + 76, + 78 + ], + [ + 82, + 83 + ], + [ + 85, + 86 + ], + [ + 89, + 92 + ], + [ + 93, + 94 + ], + [ + 99, + 100 + ], + [ + 106, + 112 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 126 + ], + [ + 127, + 131 + ], + [ + 133, + 136 + ], + [ + 137, + 141 + ], + [ + 144, + 153 + ], + [ + 157, + 158 + ], + [ + 160, + 163 + ], + [ + 164, + 166 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 184, + 185 + ], + [ + 194, + 195 + ], + [ + 203, + 204 + ], + [ + 216, + 217 + ], + [ + 227, + 229 + ], + [ + 230, + 231 + ], + [ + 244, + 245 + ], + [ + 248, + 249 + ], + [ + 250, + 252 + ], + [ + 254, + 256 + ], + [ + 257, + 259 + ], + [ + 260, + 263 + ], + [ + 264, + 266 + ], + [ + 267, + 270 + ], + [ + 271, + 272 + ], + [ + 275, + 276 + ], + [ + 277, + 279 + ], + [ + 285, + 286 + ], + [ + 288, + 291 + ], + [ + 292, + 293 + ], + [ + 294, + 297 + ], + [ + 298, + 300 + ], + [ + 303, + 304 + ], + [ + 367, + 368 + ], + [ + 372, + 375 + ], + [ + 376, + 377 + ] + ] + } + }, + { + "filename": "libvips/create/logmat.c", + "line_filter": { + "diff_chunks": [ + [ + 21, + 49 + ], + [ + 71, + 79 + ], + [ + 81, + 241 + ], + [ + 253, + 283 + ], + [ + 285, + 299 + ] + ], + "lines_added": [ + [ + 24, + 40 + ], + [ + 45, + 46 + ], + [ + 74, + 76 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 89, + 91 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 96, + 98 + ], + [ + 99, + 101 + ], + [ + 106, + 109 + ], + [ + 111, + 114 + ], + [ + 115, + 117 + ], + [ + 120, + 121 + ], + [ + 127, + 128 + ], + [ + 132, + 135 + ], + [ + 137, + 138 + ], + [ + 140, + 142 + ], + [ + 146, + 149 + ], + [ + 152, + 153 + ], + [ + 154, + 157 + ], + [ + 158, + 162 + ], + [ + 164, + 166 + ], + [ + 171, + 172 + ], + [ + 173, + 175 + ], + [ + 176, + 178 + ], + [ + 181, + 183 + ], + [ + 184, + 185 + ], + [ + 188, + 189 + ], + [ + 190, + 192 + ], + [ + 197, + 198 + ], + [ + 200, + 203 + ], + [ + 204, + 206 + ], + [ + 207, + 210 + ], + [ + 211, + 213 + ], + [ + 214, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 224 + ], + [ + 225, + 227 + ], + [ + 228, + 234 + ], + [ + 237, + 238 + ], + [ + 256, + 261 + ], + [ + 263, + 264 + ], + [ + 267, + 268 + ], + [ + 270, + 271 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 278, + 280 + ], + [ + 288, + 289 + ], + [ + 293, + 296 + ], + [ + 297, + 298 + ] + ] + } + }, + { + "filename": "libvips/create/mask.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 75 + ], + [ + 76, + 85 + ], + [ + 88, + 147 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 59, + 61 + ], + [ + 64, + 66 + ], + [ + 71, + 72 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 91, + 92 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 109 + ], + [ + 114, + 115 + ], + [ + 117, + 119 + ], + [ + 121, + 124 + ], + [ + 125, + 127 + ], + [ + 128, + 131 + ], + [ + 132, + 134 + ], + [ + 135, + 138 + ], + [ + 139, + 141 + ], + [ + 144, + 145 + ] + ] + } + }, + { + "filename": "libvips/create/mask_butterworth.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 62 + ], + [ + 66, + 117 + ], + [ + 139, + 163 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 56 + ], + [ + 58, + 59 + ], + [ + 69, + 71 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 78, + 81 + ], + [ + 86, + 87 + ], + [ + 90, + 93 + ], + [ + 94, + 96 + ], + [ + 97, + 100 + ], + [ + 101, + 103 + ], + [ + 104, + 107 + ], + [ + 108, + 110 + ], + [ + 113, + 114 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 149, + 151 + ], + [ + 155, + 160 + ], + [ + 161, + 162 + ] + ] + } + }, + { + "filename": "libvips/create/mask_butterworth_band.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 64, + 78 + ], + [ + 83, + 152 + ], + [ + 160, + 167 + ], + [ + 173, + 204 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 67, + 69 + ], + [ + 71, + 73 + ], + [ + 74, + 75 + ], + [ + 86, + 87 + ], + [ + 91, + 92 + ], + [ + 95, + 97 + ], + [ + 98, + 101 + ], + [ + 106, + 107 + ], + [ + 110, + 113 + ], + [ + 114, + 116 + ], + [ + 117, + 120 + ], + [ + 121, + 123 + ], + [ + 124, + 127 + ], + [ + 128, + 130 + ], + [ + 131, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 141 + ], + [ + 142, + 144 + ], + [ + 147, + 149 + ], + [ + 163, + 164 + ], + [ + 176, + 178 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 188, + 191 + ], + [ + 195, + 201 + ], + [ + 202, + 203 + ] + ] + } + }, + { + "filename": "libvips/create/mask_butterworth_ring.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 60, + 76 + ], + [ + 79, + 118 + ], + [ + 134, + 165 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 65 + ], + [ + 67, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 82, + 84 + ], + [ + 85, + 86 + ], + [ + 89, + 91 + ], + [ + 92, + 95 + ], + [ + 100, + 101 + ], + [ + 104, + 107 + ], + [ + 108, + 110 + ], + [ + 113, + 115 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 150, + 153 + ], + [ + 157, + 162 + ], + [ + 163, + 164 + ] + ] + } + }, + { + "filename": "libvips/create/mask_fractal.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 60, + 105 + ], + [ + 119, + 142 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 65 + ], + [ + 67, + 68 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 80, + 83 + ], + [ + 88, + 89 + ], + [ + 92, + 95 + ], + [ + 96, + 98 + ], + [ + 101, + 102 + ], + [ + 122, + 123 + ], + [ + 129, + 131 + ], + [ + 135, + 139 + ], + [ + 140, + 141 + ] + ] + } + }, + { + "filename": "libvips/create/mask_gaussian.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 105 + ], + [ + 123, + 144 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 71, + 72 + ], + [ + 73, + 76 + ], + [ + 81, + 82 + ], + [ + 85, + 88 + ], + [ + 89, + 91 + ], + [ + 92, + 95 + ], + [ + 96, + 98 + ], + [ + 101, + 102 + ], + [ + 126, + 127 + ], + [ + 131, + 133 + ], + [ + 137, + 141 + ], + [ + 142, + 143 + ] + ] + } + }, + { + "filename": "libvips/create/mask_gaussian_band.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 63, + 73 + ], + [ + 75, + 139 + ], + [ + 145, + 152 + ], + [ + 158, + 185 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 78, + 79 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 96 + ], + [ + 101, + 102 + ], + [ + 105, + 108 + ], + [ + 109, + 111 + ], + [ + 112, + 115 + ], + [ + 116, + 118 + ], + [ + 119, + 122 + ], + [ + 123, + 125 + ], + [ + 126, + 129 + ], + [ + 130, + 132 + ], + [ + 135, + 136 + ], + [ + 148, + 149 + ], + [ + 161, + 163 + ], + [ + 165, + 166 + ], + [ + 170, + 173 + ], + [ + 177, + 182 + ], + [ + 183, + 184 + ] + ] + } + }, + { + "filename": "libvips/create/mask_gaussian_ring.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 60, + 74 + ], + [ + 75, + 113 + ], + [ + 128, + 155 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 65 + ], + [ + 67, + 68 + ], + [ + 70, + 71 + ], + [ + 78, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 88, + 91 + ], + [ + 96, + 97 + ], + [ + 100, + 103 + ], + [ + 104, + 106 + ], + [ + 109, + 110 + ], + [ + 131, + 132 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 140, + 143 + ], + [ + 147, + 152 + ], + [ + 153, + 154 + ] + ] + } + }, + { + "filename": "libvips/create/mask_ideal.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 61 + ], + [ + 62, + 96 + ], + [ + 113, + 157 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 65, + 66 + ], + [ + 69, + 70 + ], + [ + 71, + 74 + ], + [ + 79, + 80 + ], + [ + 83, + 86 + ], + [ + 87, + 89 + ], + [ + 92, + 93 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 123, + 124 + ], + [ + 126, + 128 + ], + [ + 130, + 131 + ], + [ + 135, + 140 + ], + [ + 144, + 146 + ], + [ + 150, + 154 + ], + [ + 155, + 156 + ] + ] + } + }, + { + "filename": "libvips/create/mask_ideal_band.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 62, + 73 + ], + [ + 76, + 124 + ], + [ + 141, + 167 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 65, + 67 + ], + [ + 69, + 70 + ], + [ + 79, + 80 + ], + [ + 83, + 84 + ], + [ + 85, + 88 + ], + [ + 93, + 94 + ], + [ + 97, + 100 + ], + [ + 101, + 103 + ], + [ + 104, + 107 + ], + [ + 108, + 110 + ], + [ + 111, + 114 + ], + [ + 115, + 117 + ], + [ + 120, + 121 + ], + [ + 144, + 147 + ], + [ + 153, + 156 + ], + [ + 160, + 164 + ], + [ + 165, + 166 + ] + ] + } + }, + { + "filename": "libvips/create/mask_ideal_ring.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 60, + 71 + ], + [ + 76, + 110 + ], + [ + 124, + 149 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 65 + ], + [ + 67, + 68 + ], + [ + 79, + 80 + ], + [ + 83, + 84 + ], + [ + 85, + 88 + ], + [ + 93, + 94 + ], + [ + 97, + 100 + ], + [ + 101, + 103 + ], + [ + 106, + 107 + ], + [ + 127, + 129 + ], + [ + 131, + 132 + ], + [ + 136, + 138 + ], + [ + 142, + 146 + ], + [ + 147, + 148 + ] + ] + } + }, + { + "filename": "libvips/create/pcreate.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 55 + ], + [ + 64, + 74 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 51 + ], + [ + 67, + 68 + ] + ] + } + }, + { + "filename": "libvips/create/perlin.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 69, + 76 + ], + [ + 92, + 108 + ], + [ + 118, + 131 + ], + [ + 134, + 208 + ], + [ + 216, + 334 + ], + [ + 354, + 376 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 72, + 73 + ], + [ + 95, + 96 + ], + [ + 98, + 100 + ], + [ + 103, + 105 + ], + [ + 121, + 122 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 127, + 128 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 147, + 148 + ], + [ + 153, + 155 + ], + [ + 160, + 161 + ], + [ + 167, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 176 + ], + [ + 178, + 179 + ], + [ + 183, + 186 + ], + [ + 188, + 189 + ], + [ + 194, + 196 + ], + [ + 201, + 205 + ], + [ + 219, + 220 + ], + [ + 226, + 227 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 235, + 237 + ], + [ + 240, + 242 + ], + [ + 243, + 245 + ], + [ + 247, + 248 + ], + [ + 249, + 250 + ], + [ + 251, + 259 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 269, + 271 + ], + [ + 273, + 274 + ], + [ + 277, + 278 + ], + [ + 279, + 281 + ], + [ + 284, + 285 + ], + [ + 290, + 291 + ], + [ + 293, + 296 + ], + [ + 297, + 299 + ], + [ + 300, + 303 + ], + [ + 304, + 306 + ], + [ + 307, + 310 + ], + [ + 311, + 313 + ], + [ + 314, + 317 + ], + [ + 318, + 320 + ], + [ + 321, + 324 + ], + [ + 325, + 327 + ], + [ + 330, + 331 + ], + [ + 357, + 359 + ], + [ + 365, + 366 + ], + [ + 370, + 373 + ], + [ + 374, + 375 + ] + ] + } + }, + { + "filename": "libvips/create/pmask.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 42, + 61 + ], + [ + 68, + 94 + ], + [ + 98, + 120 + ], + [ + 126, + 148 + ], + [ + 153, + 160 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 45, + 57 + ], + [ + 71, + 72 + ], + [ + 75, + 76 + ], + [ + 78, + 90 + ], + [ + 101, + 102 + ], + [ + 104, + 116 + ], + [ + 129, + 130 + ], + [ + 132, + 144 + ], + [ + 156, + 157 + ] + ] + } + }, + { + "filename": "libvips/create/point.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 49, + 112 + ], + [ + 113, + 166 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 52, + 53 + ], + [ + 55, + 57 + ], + [ + 59, + 61 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 68, + 70 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 78, + 82 + ], + [ + 85, + 87 + ], + [ + 89, + 90 + ], + [ + 92, + 97 + ], + [ + 99, + 100 + ], + [ + 104, + 109 + ], + [ + 116, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 127 + ], + [ + 132, + 133 + ], + [ + 135, + 138 + ], + [ + 140, + 143 + ], + [ + 144, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 153 + ], + [ + 154, + 157 + ], + [ + 158, + 160 + ], + [ + 163, + 164 + ] + ] + } + }, + { + "filename": "libvips/create/point.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 55 + ], + [ + 63, + 77 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 51 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 73, + 74 + ] + ] + } + }, + { + "filename": "libvips/create/sines.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 16, + 44 + ], + [ + 74, + 145 + ], + [ + 158, + 165 + ], + [ + 168, + 189 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 35 + ], + [ + 40, + 41 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 84, + 85 + ], + [ + 88, + 89 + ], + [ + 90, + 91 + ], + [ + 96, + 98 + ], + [ + 99, + 104 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 115 + ], + [ + 120, + 121 + ], + [ + 125, + 128 + ], + [ + 129, + 131 + ], + [ + 132, + 135 + ], + [ + 136, + 138 + ], + [ + 141, + 142 + ], + [ + 161, + 162 + ], + [ + 171, + 174 + ], + [ + 178, + 179 + ], + [ + 183, + 186 + ], + [ + 187, + 188 + ] + ] + } + }, + { + "filename": "libvips/create/text.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 29 + ], + [ + 41, + 69 + ], + [ + 117, + 128 + ], + [ + 129, + 149 + ], + [ + 150, + 168 + ], + [ + 178, + 187 + ], + [ + 203, + 267 + ], + [ + 282, + 308 + ], + [ + 311, + 323 + ], + [ + 328, + 350 + ], + [ + 353, + 379 + ], + [ + 380, + 638 + ], + [ + 651, + 658 + ], + [ + 673, + 699 + ], + [ + 706, + 720 + ] + ], + "lines_added": [ + [ + 15, + 17 + ], + [ + 22, + 24 + ], + [ + 25, + 26 + ], + [ + 44, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 55 + ], + [ + 56, + 60 + ], + [ + 65, + 66 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 132, + 133 + ], + [ + 136, + 138 + ], + [ + 139, + 140 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 153, + 155 + ], + [ + 156, + 160 + ], + [ + 161, + 163 + ], + [ + 164, + 165 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 206, + 207 + ], + [ + 208, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 220, + 222 + ], + [ + 223, + 229 + ], + [ + 230, + 232 + ], + [ + 238, + 244 + ], + [ + 246, + 247 + ], + [ + 252, + 253 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 263, + 264 + ], + [ + 285, + 288 + ], + [ + 290, + 293 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 304, + 305 + ], + [ + 314, + 316 + ], + [ + 319, + 320 + ], + [ + 331, + 333 + ], + [ + 337, + 339 + ], + [ + 340, + 342 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 356, + 357 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 363, + 364 + ], + [ + 366, + 367 + ], + [ + 370, + 371 + ], + [ + 372, + 374 + ], + [ + 375, + 376 + ], + [ + 383, + 385 + ], + [ + 386, + 390 + ], + [ + 394, + 395 + ], + [ + 396, + 397 + ], + [ + 398, + 401 + ], + [ + 403, + 405 + ], + [ + 408, + 413 + ], + [ + 414, + 415 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 423, + 427 + ], + [ + 429, + 430 + ], + [ + 431, + 432 + ], + [ + 434, + 438 + ], + [ + 442, + 444 + ], + [ + 445, + 449 + ], + [ + 452, + 455 + ], + [ + 456, + 457 + ], + [ + 460, + 463 + ], + [ + 464, + 466 + ], + [ + 468, + 476 + ], + [ + 478, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 487, + 488 + ], + [ + 490, + 491 + ], + [ + 493, + 498 + ], + [ + 502, + 504 + ], + [ + 505, + 507 + ], + [ + 510, + 512 + ], + [ + 513, + 514 + ], + [ + 517, + 518 + ], + [ + 519, + 520 + ], + [ + 522, + 523 + ], + [ + 526, + 527 + ], + [ + 528, + 530 + ], + [ + 533, + 534 + ], + [ + 540, + 541 + ], + [ + 543, + 546 + ], + [ + 547, + 549 + ], + [ + 550, + 553 + ], + [ + 554, + 556 + ], + [ + 557, + 560 + ], + [ + 561, + 563 + ], + [ + 564, + 567 + ], + [ + 568, + 570 + ], + [ + 571, + 574 + ], + [ + 575, + 577 + ], + [ + 578, + 581 + ], + [ + 582, + 584 + ], + [ + 585, + 588 + ], + [ + 589, + 591 + ], + [ + 592, + 595 + ], + [ + 596, + 598 + ], + [ + 599, + 602 + ], + [ + 603, + 605 + ], + [ + 606, + 609 + ], + [ + 610, + 612 + ], + [ + 613, + 616 + ], + [ + 617, + 619 + ], + [ + 620, + 623 + ], + [ + 624, + 626 + ], + [ + 629, + 630 + ], + [ + 634, + 635 + ], + [ + 654, + 655 + ], + [ + 676, + 678 + ], + [ + 679, + 680 + ], + [ + 683, + 684 + ], + [ + 685, + 686 + ], + [ + 688, + 690 + ], + [ + 692, + 693 + ], + [ + 695, + 696 + ], + [ + 709, + 710 + ], + [ + 714, + 717 + ], + [ + 718, + 719 + ] + ] + } + }, + { + "filename": "libvips/create/tonelut.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 19, + 47 + ], + [ + 63, + 70 + ], + [ + 78, + 181 + ], + [ + 184, + 197 + ], + [ + 198, + 321 + ], + [ + 325, + 353 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 22, + 23 + ], + [ + 24, + 28 + ], + [ + 29, + 38 + ], + [ + 43, + 44 + ], + [ + 66, + 67 + ], + [ + 81, + 82 + ], + [ + 86, + 87 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 108, + 109 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 130, + 131 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 146, + 147 + ], + [ + 152, + 153 + ], + [ + 156, + 162 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 170, + 171 + ], + [ + 173, + 175 + ], + [ + 176, + 178 + ], + [ + 187, + 190 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 201, + 209 + ], + [ + 212, + 213 + ], + [ + 214, + 216 + ], + [ + 221, + 222 + ], + [ + 224, + 227 + ], + [ + 228, + 230 + ], + [ + 231, + 234 + ], + [ + 235, + 237 + ], + [ + 238, + 241 + ], + [ + 242, + 244 + ], + [ + 245, + 248 + ], + [ + 249, + 251 + ], + [ + 252, + 255 + ], + [ + 256, + 258 + ], + [ + 259, + 262 + ], + [ + 263, + 265 + ], + [ + 266, + 269 + ], + [ + 270, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 279 + ], + [ + 280, + 283 + ], + [ + 284, + 286 + ], + [ + 287, + 290 + ], + [ + 291, + 293 + ], + [ + 296, + 297 + ], + [ + 298, + 308 + ], + [ + 312, + 313 + ], + [ + 317, + 318 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 335, + 337 + ], + [ + 342, + 343 + ], + [ + 347, + 350 + ], + [ + 351, + 352 + ] + ] + } + }, + { + "filename": "libvips/create/worley.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 71, + 78 + ], + [ + 107, + 123 + ], + [ + 133, + 210 + ], + [ + 211, + 341 + ], + [ + 365, + 379 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 74, + 75 + ], + [ + 110, + 111 + ], + [ + 113, + 115 + ], + [ + 118, + 120 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 156, + 160 + ], + [ + 162, + 165 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 187, + 189 + ], + [ + 194, + 195 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 214, + 215 + ], + [ + 217, + 221 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 232 + ], + [ + 234, + 235 + ], + [ + 239, + 241 + ], + [ + 242, + 243 + ], + [ + 246, + 250 + ], + [ + 254, + 256 + ], + [ + 259, + 260 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 268, + 270 + ], + [ + 273, + 275 + ], + [ + 276, + 278 + ], + [ + 280, + 281 + ], + [ + 282, + 283 + ], + [ + 284, + 292 + ], + [ + 295, + 296 + ], + [ + 297, + 299 + ], + [ + 304, + 305 + ], + [ + 307, + 310 + ], + [ + 311, + 313 + ], + [ + 314, + 317 + ], + [ + 318, + 320 + ], + [ + 321, + 324 + ], + [ + 325, + 327 + ], + [ + 328, + 331 + ], + [ + 332, + 334 + ], + [ + 337, + 338 + ], + [ + 368, + 369 + ], + [ + 373, + 376 + ], + [ + 377, + 378 + ] + ] + } + }, + { + "filename": "libvips/create/xyz.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 10, + 38 + ], + [ + 69, + 231 + ], + [ + 249, + 277 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 29 + ], + [ + 34, + 35 + ], + [ + 72, + 73 + ], + [ + 75, + 77 + ], + [ + 79, + 80 + ], + [ + 82, + 84 + ], + [ + 87, + 90 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 124, + 126 + ], + [ + 131, + 133 + ], + [ + 134, + 141 + ], + [ + 143, + 144 + ], + [ + 146, + 147 + ], + [ + 149, + 150 + ], + [ + 154, + 158 + ], + [ + 161, + 163 + ], + [ + 165, + 170 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 179 + ], + [ + 180, + 181 + ], + [ + 186, + 188 + ], + [ + 190, + 193 + ], + [ + 194, + 196 + ], + [ + 197, + 200 + ], + [ + 201, + 203 + ], + [ + 204, + 207 + ], + [ + 208, + 210 + ], + [ + 211, + 214 + ], + [ + 215, + 217 + ], + [ + 218, + 221 + ], + [ + 222, + 224 + ], + [ + 227, + 228 + ], + [ + 252, + 253 + ], + [ + 255, + 256 + ], + [ + 259, + 260 + ], + [ + 266, + 267 + ], + [ + 271, + 274 + ], + [ + 275, + 276 + ] + ] + } + }, + { + "filename": "libvips/create/zone.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 45 + ], + [ + 64, + 74 + ], + [ + 77, + 100 + ], + [ + 108, + 131 + ] + ], + "lines_added": [ + [ + 20, + 36 + ], + [ + 41, + 42 + ], + [ + 67, + 68 + ], + [ + 70, + 71 + ], + [ + 80, + 81 + ], + [ + 84, + 85 + ], + [ + 86, + 88 + ], + [ + 90, + 91 + ], + [ + 96, + 97 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 120, + 121 + ], + [ + 125, + 128 + ], + [ + 129, + 130 + ] + ] + } + }, + { + "filename": "libvips/deprecated/arith_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 182 + ], + [ + 185, + 881 + ], + [ + 886, + 1219 + ], + [ + 1224, + 1233 + ], + [ + 1270, + 1276 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 48 + ], + [ + 53, + 56 + ], + [ + 61, + 63 + ], + [ + 68, + 71 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 86, + 87 + ], + [ + 88, + 92 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 105, + 111 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 124, + 130 + ], + [ + 135, + 136 + ], + [ + 139, + 141 + ], + [ + 143, + 144 + ], + [ + 147, + 148 + ], + [ + 149, + 155 + ], + [ + 160, + 166 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 178, + 179 + ], + [ + 188, + 189 + ], + [ + 195, + 200 + ], + [ + 205, + 206 + ], + [ + 207, + 208 + ], + [ + 213, + 219 + ], + [ + 224, + 225 + ], + [ + 228, + 230 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 238, + 244 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ], + [ + 255, + 256 + ], + [ + 257, + 263 + ], + [ + 268, + 269 + ], + [ + 270, + 271 + ], + [ + 274, + 275 + ], + [ + 276, + 282 + ], + [ + 287, + 290 + ], + [ + 295, + 296 + ], + [ + 299, + 300 + ], + [ + 303, + 304 + ], + [ + 305, + 311 + ], + [ + 316, + 319 + ], + [ + 324, + 325 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 334, + 340 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 351, + 352 + ], + [ + 353, + 359 + ], + [ + 364, + 365 + ], + [ + 366, + 367 + ], + [ + 370, + 371 + ], + [ + 372, + 378 + ], + [ + 383, + 387 + ], + [ + 392, + 393 + ], + [ + 397, + 398 + ], + [ + 401, + 402 + ], + [ + 403, + 409 + ], + [ + 414, + 418 + ], + [ + 423, + 424 + ], + [ + 428, + 432 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 440, + 442 + ], + [ + 443, + 446 + ], + [ + 451, + 452 + ], + [ + 453, + 454 + ], + [ + 457, + 458 + ], + [ + 459, + 465 + ], + [ + 470, + 471 + ], + [ + 472, + 473 + ], + [ + 476, + 477 + ], + [ + 478, + 484 + ], + [ + 489, + 490 + ], + [ + 491, + 492 + ], + [ + 495, + 496 + ], + [ + 497, + 503 + ], + [ + 508, + 509 + ], + [ + 510, + 511 + ], + [ + 514, + 515 + ], + [ + 516, + 522 + ], + [ + 527, + 528 + ], + [ + 529, + 530 + ], + [ + 533, + 534 + ], + [ + 535, + 541 + ], + [ + 546, + 547 + ], + [ + 548, + 549 + ], + [ + 552, + 553 + ], + [ + 554, + 560 + ], + [ + 565, + 566 + ], + [ + 567, + 568 + ], + [ + 571, + 572 + ], + [ + 573, + 579 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 590, + 591 + ], + [ + 592, + 598 + ], + [ + 603, + 604 + ], + [ + 605, + 606 + ], + [ + 609, + 610 + ], + [ + 611, + 617 + ], + [ + 622, + 623 + ], + [ + 624, + 625 + ], + [ + 628, + 629 + ], + [ + 630, + 636 + ], + [ + 641, + 642 + ], + [ + 643, + 644 + ], + [ + 647, + 648 + ], + [ + 649, + 655 + ], + [ + 660, + 661 + ], + [ + 662, + 663 + ], + [ + 666, + 667 + ], + [ + 668, + 674 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 685, + 686 + ], + [ + 687, + 693 + ], + [ + 698, + 699 + ], + [ + 702, + 704 + ], + [ + 706, + 707 + ], + [ + 710, + 711 + ], + [ + 712, + 718 + ], + [ + 723, + 725 + ], + [ + 730, + 731 + ], + [ + 735, + 737 + ], + [ + 741, + 742 + ], + [ + 745, + 746 + ], + [ + 747, + 753 + ], + [ + 758, + 762 + ], + [ + 767, + 768 + ], + [ + 769, + 770 + ], + [ + 775, + 781 + ], + [ + 786, + 791 + ], + [ + 796, + 797 + ], + [ + 798, + 814 + ], + [ + 819, + 825 + ], + [ + 830, + 831 + ], + [ + 832, + 848 + ], + [ + 853, + 859 + ], + [ + 864, + 872 + ], + [ + 877, + 878 + ], + [ + 889, + 893 + ], + [ + 895, + 896 + ], + [ + 901, + 907 + ], + [ + 912, + 913 + ], + [ + 916, + 918 + ], + [ + 920, + 921 + ], + [ + 924, + 925 + ], + [ + 926, + 932 + ], + [ + 937, + 938 + ], + [ + 942, + 944 + ], + [ + 948, + 949 + ], + [ + 952, + 953 + ], + [ + 954, + 960 + ], + [ + 965, + 966 + ], + [ + 967, + 968 + ], + [ + 971, + 972 + ], + [ + 973, + 979 + ], + [ + 984, + 985 + ], + [ + 988, + 989 + ], + [ + 994, + 997 + ], + [ + 1000, + 1001 + ], + [ + 1002, + 1008 + ], + [ + 1013, + 1014 + ], + [ + 1017, + 1018 + ], + [ + 1023, + 1026 + ], + [ + 1029, + 1030 + ], + [ + 1031, + 1038 + ], + [ + 1043, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1049, + 1050 + ], + [ + 1051, + 1057 + ], + [ + 1062, + 1063 + ], + [ + 1066, + 1067 + ], + [ + 1070, + 1071 + ], + [ + 1072, + 1078 + ], + [ + 1083, + 1084 + ], + [ + 1087, + 1088 + ], + [ + 1091, + 1092 + ], + [ + 1093, + 1099 + ], + [ + 1104, + 1106 + ], + [ + 1111, + 1112 + ], + [ + 1115, + 1117 + ], + [ + 1118, + 1119 + ], + [ + 1122, + 1123 + ], + [ + 1124, + 1130 + ], + [ + 1135, + 1136 + ], + [ + 1137, + 1138 + ], + [ + 1141, + 1142 + ], + [ + 1143, + 1149 + ], + [ + 1154, + 1157 + ], + [ + 1162, + 1163 + ], + [ + 1165, + 1184 + ], + [ + 1189, + 1190 + ], + [ + 1191, + 1197 + ], + [ + 1202, + 1203 + ], + [ + 1204, + 1205 + ], + [ + 1208, + 1209 + ], + [ + 1210, + 1216 + ], + [ + 1227, + 1230 + ], + [ + 1273, + 1274 + ] + ] + } + }, + { + "filename": "libvips/deprecated/cimg_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 39, + 152 + ], + [ + 157, + 163 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 42, + 43 + ], + [ + 44, + 52 + ], + [ + 53, + 68 + ], + [ + 71, + 84 + ], + [ + 87, + 93 + ], + [ + 96, + 97 + ], + [ + 98, + 107 + ], + [ + 108, + 123 + ], + [ + 126, + 140 + ], + [ + 143, + 149 + ], + [ + 160, + 161 + ] + ] + } + }, + { + "filename": "libvips/deprecated/colour_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 950 + ], + [ + 951, + 968 + ], + [ + 1016, + 1022 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 48 + ], + [ + 53, + 56 + ], + [ + 61, + 62 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 69, + 75 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 88, + 94 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 107, + 113 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 126, + 132 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 143, + 144 + ], + [ + 145, + 151 + ], + [ + 156, + 157 + ], + [ + 158, + 159 + ], + [ + 162, + 163 + ], + [ + 164, + 170 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 183, + 189 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 202, + 208 + ], + [ + 211, + 212 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 233 + ], + [ + 236, + 237 + ], + [ + 240, + 242 + ], + [ + 245, + 250 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 257, + 262 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 273, + 276 + ], + [ + 279, + 280 + ], + [ + 281, + 288 + ], + [ + 291, + 292 + ], + [ + 295, + 297 + ], + [ + 300, + 304 + ], + [ + 307, + 308 + ], + [ + 309, + 316 + ], + [ + 319, + 320 + ], + [ + 324, + 326 + ], + [ + 329, + 334 + ], + [ + 337, + 338 + ], + [ + 339, + 346 + ], + [ + 349, + 350 + ], + [ + 351, + 352 + ], + [ + 355, + 358 + ], + [ + 361, + 362 + ], + [ + 363, + 370 + ], + [ + 373, + 374 + ], + [ + 379, + 380 + ], + [ + 383, + 388 + ], + [ + 391, + 392 + ], + [ + 393, + 394 + ], + [ + 395, + 400 + ], + [ + 405, + 406 + ], + [ + 407, + 408 + ], + [ + 411, + 412 + ], + [ + 413, + 419 + ], + [ + 424, + 425 + ], + [ + 426, + 427 + ], + [ + 430, + 431 + ], + [ + 432, + 438 + ], + [ + 443, + 444 + ], + [ + 445, + 446 + ], + [ + 449, + 450 + ], + [ + 451, + 457 + ], + [ + 462, + 463 + ], + [ + 464, + 465 + ], + [ + 468, + 469 + ], + [ + 470, + 476 + ], + [ + 481, + 482 + ], + [ + 483, + 484 + ], + [ + 487, + 488 + ], + [ + 489, + 495 + ], + [ + 500, + 501 + ], + [ + 502, + 503 + ], + [ + 506, + 507 + ], + [ + 508, + 514 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 525, + 526 + ], + [ + 527, + 533 + ], + [ + 538, + 539 + ], + [ + 540, + 541 + ], + [ + 544, + 545 + ], + [ + 546, + 552 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ], + [ + 563, + 564 + ], + [ + 565, + 571 + ], + [ + 576, + 577 + ], + [ + 578, + 579 + ], + [ + 582, + 583 + ], + [ + 584, + 590 + ], + [ + 595, + 596 + ], + [ + 597, + 598 + ], + [ + 601, + 602 + ], + [ + 603, + 609 + ], + [ + 614, + 615 + ], + [ + 616, + 617 + ], + [ + 620, + 621 + ], + [ + 622, + 628 + ], + [ + 633, + 634 + ], + [ + 635, + 636 + ], + [ + 639, + 640 + ], + [ + 641, + 647 + ], + [ + 652, + 653 + ], + [ + 654, + 655 + ], + [ + 658, + 659 + ], + [ + 660, + 666 + ], + [ + 669, + 670 + ], + [ + 675, + 676 + ], + [ + 679, + 680 + ], + [ + 681, + 688 + ], + [ + 693, + 694 + ], + [ + 695, + 696 + ], + [ + 699, + 700 + ], + [ + 701, + 707 + ], + [ + 712, + 715 + ], + [ + 720, + 721 + ], + [ + 722, + 723 + ], + [ + 726, + 727 + ], + [ + 728, + 734 + ], + [ + 739, + 740 + ], + [ + 741, + 742 + ], + [ + 745, + 746 + ], + [ + 747, + 753 + ], + [ + 758, + 759 + ], + [ + 760, + 761 + ], + [ + 764, + 765 + ], + [ + 766, + 772 + ], + [ + 777, + 778 + ], + [ + 779, + 780 + ], + [ + 783, + 784 + ], + [ + 785, + 786 + ], + [ + 787, + 791 + ], + [ + 796, + 797 + ], + [ + 798, + 799 + ], + [ + 802, + 803 + ], + [ + 804, + 805 + ], + [ + 806, + 810 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 821, + 822 + ], + [ + 823, + 824 + ], + [ + 825, + 829 + ], + [ + 834, + 835 + ], + [ + 836, + 837 + ], + [ + 840, + 841 + ], + [ + 842, + 843 + ], + [ + 844, + 848 + ], + [ + 853, + 857 + ], + [ + 862, + 863 + ], + [ + 864, + 865 + ], + [ + 868, + 869 + ], + [ + 870, + 871 + ], + [ + 872, + 876 + ], + [ + 881, + 882 + ], + [ + 883, + 884 + ], + [ + 887, + 888 + ], + [ + 889, + 890 + ], + [ + 891, + 895 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 906, + 907 + ], + [ + 908, + 914 + ], + [ + 919, + 920 + ], + [ + 921, + 922 + ], + [ + 925, + 926 + ], + [ + 927, + 933 + ], + [ + 936, + 943 + ], + [ + 946, + 947 + ], + [ + 954, + 956 + ], + [ + 959, + 965 + ], + [ + 1019, + 1020 + ] + ] + } + }, + { + "filename": "libvips/deprecated/conver_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 39, + 74 + ], + [ + 78, + 201 + ], + [ + 202, + 335 + ], + [ + 337, + 620 + ], + [ + 621, + 734 + ], + [ + 737, + 1270 + ], + [ + 1271, + 1289 + ], + [ + 1317, + 1325 + ], + [ + 1339, + 1345 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 42, + 43 + ], + [ + 48, + 50 + ], + [ + 51, + 52 + ], + [ + 55, + 58 + ], + [ + 62, + 67 + ], + [ + 70, + 71 + ], + [ + 81, + 85 + ], + [ + 87, + 92 + ], + [ + 94, + 95 + ], + [ + 98, + 104 + ], + [ + 107, + 113 + ], + [ + 116, + 117 + ], + [ + 123, + 125 + ], + [ + 126, + 127 + ], + [ + 130, + 134 + ], + [ + 137, + 143 + ], + [ + 148, + 153 + ], + [ + 158, + 159 + ], + [ + 165, + 169 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 177, + 180 + ], + [ + 185, + 192 + ], + [ + 197, + 198 + ], + [ + 205, + 207 + ], + [ + 212, + 218 + ], + [ + 223, + 229 + ], + [ + 234, + 235 + ], + [ + 241, + 242 + ], + [ + 247, + 253 + ], + [ + 258, + 262 + ], + [ + 267, + 268 + ], + [ + 272, + 273 + ], + [ + 278, + 284 + ], + [ + 289, + 292 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 307, + 313 + ], + [ + 318, + 326 + ], + [ + 331, + 332 + ], + [ + 340, + 342 + ], + [ + 347, + 353 + ], + [ + 358, + 360 + ], + [ + 365, + 368 + ], + [ + 373, + 374 + ], + [ + 375, + 376 + ], + [ + 381, + 387 + ], + [ + 390, + 392 + ], + [ + 395, + 396 + ], + [ + 399, + 400 + ], + [ + 403, + 409 + ], + [ + 414, + 420 + ], + [ + 425, + 426 + ], + [ + 431, + 432 + ], + [ + 437, + 443 + ], + [ + 448, + 452 + ], + [ + 457, + 458 + ], + [ + 463, + 464 + ], + [ + 469, + 475 + ], + [ + 480, + 483 + ], + [ + 488, + 489 + ], + [ + 492, + 493 + ], + [ + 498, + 504 + ], + [ + 509, + 510 + ], + [ + 511, + 512 + ], + [ + 517, + 518 + ], + [ + 519, + 523 + ], + [ + 528, + 529 + ], + [ + 530, + 531 + ], + [ + 536, + 537 + ], + [ + 538, + 542 + ], + [ + 547, + 548 + ], + [ + 549, + 550 + ], + [ + 555, + 556 + ], + [ + 557, + 561 + ], + [ + 566, + 567 + ], + [ + 568, + 569 + ], + [ + 574, + 575 + ], + [ + 576, + 580 + ], + [ + 585, + 586 + ], + [ + 587, + 588 + ], + [ + 593, + 594 + ], + [ + 595, + 599 + ], + [ + 604, + 611 + ], + [ + 616, + 617 + ], + [ + 624, + 626 + ], + [ + 631, + 632 + ], + [ + 637, + 638 + ], + [ + 639, + 642 + ], + [ + 647, + 651 + ], + [ + 656, + 657 + ], + [ + 661, + 662 + ], + [ + 667, + 668 + ], + [ + 673, + 674 + ], + [ + 675, + 678 + ], + [ + 683, + 688 + ], + [ + 693, + 694 + ], + [ + 699, + 701 + ], + [ + 706, + 707 + ], + [ + 712, + 713 + ], + [ + 714, + 717 + ], + [ + 722, + 723 + ], + [ + 724, + 725 + ], + [ + 730, + 731 + ], + [ + 740, + 743 + ], + [ + 748, + 749 + ], + [ + 750, + 751 + ], + [ + 756, + 757 + ], + [ + 762, + 763 + ], + [ + 764, + 767 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ], + [ + 780, + 781 + ], + [ + 786, + 787 + ], + [ + 788, + 791 + ], + [ + 796, + 797 + ], + [ + 798, + 799 + ], + [ + 804, + 805 + ], + [ + 806, + 810 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 823, + 824 + ], + [ + 825, + 829 + ], + [ + 834, + 835 + ], + [ + 836, + 837 + ], + [ + 842, + 843 + ], + [ + 844, + 848 + ], + [ + 853, + 858 + ], + [ + 863, + 864 + ], + [ + 868, + 869 + ], + [ + 874, + 875 + ], + [ + 876, + 880 + ], + [ + 885, + 890 + ], + [ + 895, + 896 + ], + [ + 900, + 904 + ], + [ + 906, + 908 + ], + [ + 909, + 910 + ], + [ + 913, + 914 + ], + [ + 915, + 916 + ], + [ + 917, + 921 + ], + [ + 926, + 927 + ], + [ + 931, + 932 + ], + [ + 937, + 938 + ], + [ + 939, + 943 + ], + [ + 948, + 949 + ], + [ + 950, + 951 + ], + [ + 956, + 957 + ], + [ + 958, + 962 + ], + [ + 967, + 968 + ], + [ + 969, + 970 + ], + [ + 975, + 976 + ], + [ + 977, + 981 + ], + [ + 986, + 987 + ], + [ + 988, + 989 + ], + [ + 994, + 995 + ], + [ + 996, + 1000 + ], + [ + 1005, + 1006 + ], + [ + 1007, + 1008 + ], + [ + 1013, + 1014 + ], + [ + 1015, + 1019 + ], + [ + 1024, + 1025 + ], + [ + 1026, + 1027 + ], + [ + 1032, + 1033 + ], + [ + 1034, + 1038 + ], + [ + 1043, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1051, + 1052 + ], + [ + 1053, + 1057 + ], + [ + 1062, + 1063 + ], + [ + 1064, + 1065 + ], + [ + 1070, + 1071 + ], + [ + 1072, + 1076 + ], + [ + 1081, + 1086 + ], + [ + 1091, + 1092 + ], + [ + 1097, + 1098 + ], + [ + 1103, + 1104 + ], + [ + 1105, + 1109 + ], + [ + 1114, + 1118 + ], + [ + 1123, + 1124 + ], + [ + 1128, + 1129 + ], + [ + 1134, + 1135 + ], + [ + 1136, + 1140 + ], + [ + 1145, + 1149 + ], + [ + 1154, + 1155 + ], + [ + 1159, + 1160 + ], + [ + 1165, + 1166 + ], + [ + 1167, + 1171 + ], + [ + 1176, + 1177 + ], + [ + 1178, + 1179 + ], + [ + 1184, + 1190 + ], + [ + 1195, + 1198 + ], + [ + 1203, + 1204 + ], + [ + 1205, + 1208 + ], + [ + 1209, + 1210 + ], + [ + 1215, + 1221 + ], + [ + 1226, + 1230 + ], + [ + 1235, + 1236 + ], + [ + 1237, + 1238 + ], + [ + 1243, + 1249 + ], + [ + 1254, + 1261 + ], + [ + 1266, + 1267 + ], + [ + 1274, + 1275 + ], + [ + 1278, + 1279 + ], + [ + 1280, + 1286 + ], + [ + 1320, + 1322 + ], + [ + 1342, + 1343 + ] + ] + } + }, + { + "filename": "libvips/deprecated/convol_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 139 + ], + [ + 141, + 481 + ], + [ + 490, + 500 + ], + [ + 503, + 509 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 48 + ], + [ + 53, + 56 + ], + [ + 61, + 64 + ], + [ + 69, + 70 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 85 + ], + [ + 90, + 94 + ], + [ + 99, + 100 + ], + [ + 104, + 106 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 113, + 117 + ], + [ + 122, + 130 + ], + [ + 135, + 136 + ], + [ + 144, + 145 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 152, + 156 + ], + [ + 161, + 164 + ], + [ + 169, + 172 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 189, + 193 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 208, + 209 + ], + [ + 210, + 214 + ], + [ + 219, + 220 + ], + [ + 223, + 224 + ], + [ + 227, + 228 + ], + [ + 229, + 230 + ], + [ + 231, + 235 + ], + [ + 240, + 241 + ], + [ + 244, + 245 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 252, + 256 + ], + [ + 261, + 262 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 273, + 277 + ], + [ + 282, + 283 + ], + [ + 284, + 285 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ], + [ + 292, + 296 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 307, + 308 + ], + [ + 309, + 310 + ], + [ + 311, + 315 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 326, + 327 + ], + [ + 328, + 329 + ], + [ + 330, + 334 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 349, + 353 + ], + [ + 358, + 359 + ], + [ + 362, + 363 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 370, + 374 + ], + [ + 379, + 380 + ], + [ + 383, + 384 + ], + [ + 387, + 388 + ], + [ + 389, + 390 + ], + [ + 391, + 395 + ], + [ + 400, + 401 + ], + [ + 402, + 403 + ], + [ + 406, + 407 + ], + [ + 408, + 409 + ], + [ + 410, + 414 + ], + [ + 419, + 424 + ], + [ + 429, + 430 + ], + [ + 435, + 436 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 443, + 447 + ], + [ + 452, + 456 + ], + [ + 461, + 462 + ], + [ + 466, + 467 + ], + [ + 470, + 471 + ], + [ + 472, + 473 + ], + [ + 474, + 478 + ], + [ + 493, + 494 + ], + [ + 495, + 497 + ], + [ + 506, + 507 + ] + ] + } + }, + { + "filename": "libvips/deprecated/cooc_funcs.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 14 + ], + [ + 35, + 68 + ], + [ + 77, + 85 + ], + [ + 90, + 157 + ], + [ + 162, + 447 + ] + ], + "lines_added": [ + [ + 9, + 11 + ], + [ + 38, + 39 + ], + [ + 43, + 44 + ], + [ + 45, + 49 + ], + [ + 50, + 59 + ], + [ + 64, + 65 + ], + [ + 80, + 82 + ], + [ + 93, + 102 + ], + [ + 103, + 104 + ], + [ + 109, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 123, + 126 + ], + [ + 132, + 133 + ], + [ + 136, + 137 + ], + [ + 140, + 145 + ], + [ + 146, + 150 + ], + [ + 152, + 154 + ], + [ + 165, + 174 + ], + [ + 175, + 176 + ], + [ + 180, + 188 + ], + [ + 189, + 190 + ], + [ + 191, + 192 + ], + [ + 194, + 197 + ], + [ + 201, + 202 + ], + [ + 205, + 206 + ], + [ + 209, + 214 + ], + [ + 215, + 219 + ], + [ + 223, + 226 + ], + [ + 228, + 235 + ], + [ + 239, + 241 + ], + [ + 245, + 247 + ], + [ + 248, + 253 + ], + [ + 254, + 256 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 263, + 265 + ], + [ + 269, + 271 + ], + [ + 272, + 277 + ], + [ + 278, + 280 + ], + [ + 282, + 284 + ], + [ + 287, + 288 + ], + [ + 290, + 291 + ], + [ + 296, + 297 + ], + [ + 301, + 303 + ], + [ + 304, + 305 + ], + [ + 306, + 312 + ], + [ + 313, + 314 + ], + [ + 315, + 319 + ], + [ + 320, + 321 + ], + [ + 326, + 328 + ], + [ + 333, + 337 + ], + [ + 339, + 355 + ], + [ + 357, + 359 + ], + [ + 360, + 362 + ], + [ + 363, + 365 + ], + [ + 367, + 369 + ], + [ + 372, + 374 + ], + [ + 377, + 378 + ], + [ + 380, + 381 + ], + [ + 383, + 385 + ], + [ + 387, + 388 + ], + [ + 389, + 390 + ], + [ + 392, + 393 + ], + [ + 396, + 401 + ], + [ + 402, + 405 + ], + [ + 407, + 409 + ], + [ + 412, + 413 + ], + [ + 416, + 418 + ], + [ + 419, + 425 + ], + [ + 428, + 429 + ], + [ + 431, + 433 + ], + [ + 434, + 435 + ], + [ + 436, + 437 + ], + [ + 438, + 440 + ], + [ + 442, + 443 + ], + [ + 444, + 446 + ] + ] + } + }, + { + "filename": "libvips/deprecated/deprecated_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 42, + 208 + ], + [ + 210, + 317 + ], + [ + 323, + 397 + ], + [ + 401, + 786 + ], + [ + 787, + 822 + ], + [ + 823, + 1092 + ], + [ + 1094, + 1291 + ], + [ + 1294, + 1332 + ], + [ + 1335, + 1374 + ], + [ + 1376, + 2236 + ], + [ + 2271, + 2278 + ], + [ + 2325, + 2331 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 22 + ], + [ + 27, + 28 + ], + [ + 45, + 47 + ], + [ + 50, + 53 + ], + [ + 56, + 57 + ], + [ + 58, + 59 + ], + [ + 62, + 63 + ], + [ + 64, + 68 + ], + [ + 73, + 76 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 89, + 90 + ], + [ + 91, + 95 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 108, + 109 + ], + [ + 110, + 114 + ], + [ + 119, + 123 + ], + [ + 128, + 136 + ], + [ + 141, + 144 + ], + [ + 149, + 154 + ], + [ + 159, + 162 + ], + [ + 167, + 170 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 183, + 189 + ], + [ + 194, + 199 + ], + [ + 204, + 205 + ], + [ + 213, + 214 + ], + [ + 217, + 218 + ], + [ + 219, + 225 + ], + [ + 230, + 236 + ], + [ + 241, + 242 + ], + [ + 247, + 248 + ], + [ + 251, + 252 + ], + [ + 253, + 259 + ], + [ + 264, + 269 + ], + [ + 274, + 275 + ], + [ + 279, + 280 + ], + [ + 283, + 284 + ], + [ + 285, + 291 + ], + [ + 296, + 308 + ], + [ + 313, + 314 + ], + [ + 326, + 327 + ], + [ + 330, + 331 + ], + [ + 332, + 333 + ], + [ + 334, + 338 + ], + [ + 343, + 349 + ], + [ + 354, + 355 + ], + [ + 361, + 362 + ], + [ + 365, + 366 + ], + [ + 367, + 368 + ], + [ + 369, + 373 + ], + [ + 378, + 388 + ], + [ + 393, + 394 + ], + [ + 404, + 406 + ], + [ + 409, + 410 + ], + [ + 411, + 412 + ], + [ + 413, + 417 + ], + [ + 420, + 421 + ], + [ + 424, + 426 + ], + [ + 429, + 433 + ], + [ + 436, + 437 + ], + [ + 438, + 445 + ], + [ + 450, + 453 + ], + [ + 458, + 459 + ], + [ + 464, + 465 + ], + [ + 468, + 469 + ], + [ + 470, + 471 + ], + [ + 472, + 476 + ], + [ + 479, + 480 + ], + [ + 484, + 487 + ], + [ + 488, + 489 + ], + [ + 492, + 494 + ], + [ + 497, + 498 + ], + [ + 499, + 503 + ], + [ + 508, + 509 + ], + [ + 510, + 511 + ], + [ + 516, + 517 + ], + [ + 518, + 522 + ], + [ + 527, + 528 + ], + [ + 529, + 530 + ], + [ + 535, + 536 + ], + [ + 537, + 541 + ], + [ + 546, + 547 + ], + [ + 548, + 549 + ], + [ + 554, + 555 + ], + [ + 556, + 560 + ], + [ + 565, + 566 + ], + [ + 567, + 568 + ], + [ + 573, + 574 + ], + [ + 575, + 579 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 592, + 593 + ], + [ + 594, + 598 + ], + [ + 603, + 604 + ], + [ + 605, + 606 + ], + [ + 611, + 612 + ], + [ + 613, + 617 + ], + [ + 622, + 623 + ], + [ + 624, + 625 + ], + [ + 630, + 631 + ], + [ + 632, + 636 + ], + [ + 641, + 642 + ], + [ + 643, + 644 + ], + [ + 649, + 650 + ], + [ + 651, + 655 + ], + [ + 660, + 661 + ], + [ + 662, + 663 + ], + [ + 668, + 669 + ], + [ + 670, + 674 + ], + [ + 679, + 682 + ], + [ + 687, + 688 + ], + [ + 691, + 692 + ], + [ + 697, + 698 + ], + [ + 699, + 703 + ], + [ + 708, + 712 + ], + [ + 717, + 718 + ], + [ + 722, + 723 + ], + [ + 728, + 729 + ], + [ + 730, + 734 + ], + [ + 739, + 744 + ], + [ + 749, + 750 + ], + [ + 755, + 756 + ], + [ + 759, + 760 + ], + [ + 761, + 762 + ], + [ + 763, + 767 + ], + [ + 772, + 777 + ], + [ + 782, + 783 + ], + [ + 790, + 791 + ], + [ + 796, + 802 + ], + [ + 807, + 813 + ], + [ + 818, + 819 + ], + [ + 826, + 827 + ], + [ + 830, + 831 + ], + [ + 832, + 833 + ], + [ + 834, + 838 + ], + [ + 843, + 847 + ], + [ + 852, + 853 + ], + [ + 857, + 858 + ], + [ + 861, + 862 + ], + [ + 863, + 864 + ], + [ + 865, + 869 + ], + [ + 874, + 879 + ], + [ + 884, + 885 + ], + [ + 889, + 893 + ], + [ + 895, + 897 + ], + [ + 898, + 899 + ], + [ + 902, + 903 + ], + [ + 904, + 905 + ], + [ + 906, + 910 + ], + [ + 915, + 916 + ], + [ + 917, + 918 + ], + [ + 921, + 922 + ], + [ + 923, + 924 + ], + [ + 925, + 929 + ], + [ + 934, + 935 + ], + [ + 936, + 937 + ], + [ + 940, + 941 + ], + [ + 942, + 943 + ], + [ + 944, + 948 + ], + [ + 953, + 954 + ], + [ + 955, + 956 + ], + [ + 959, + 960 + ], + [ + 961, + 962 + ], + [ + 963, + 967 + ], + [ + 972, + 973 + ], + [ + 976, + 977 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 984, + 988 + ], + [ + 993, + 994 + ], + [ + 997, + 998 + ], + [ + 1001, + 1002 + ], + [ + 1003, + 1004 + ], + [ + 1005, + 1009 + ], + [ + 1014, + 1015 + ], + [ + 1018, + 1019 + ], + [ + 1022, + 1023 + ], + [ + 1024, + 1025 + ], + [ + 1026, + 1030 + ], + [ + 1035, + 1036 + ], + [ + 1039, + 1040 + ], + [ + 1043, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1047, + 1051 + ], + [ + 1056, + 1060 + ], + [ + 1065, + 1066 + ], + [ + 1070, + 1072 + ], + [ + 1075, + 1076 + ], + [ + 1077, + 1078 + ], + [ + 1079, + 1083 + ], + [ + 1088, + 1089 + ], + [ + 1097, + 1098 + ], + [ + 1101, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1105, + 1109 + ], + [ + 1114, + 1115 + ], + [ + 1119, + 1120 + ], + [ + 1123, + 1124 + ], + [ + 1125, + 1126 + ], + [ + 1127, + 1131 + ], + [ + 1136, + 1137 + ], + [ + 1142, + 1143 + ], + [ + 1146, + 1147 + ], + [ + 1148, + 1149 + ], + [ + 1150, + 1154 + ], + [ + 1159, + 1160 + ], + [ + 1163, + 1164 + ], + [ + 1167, + 1168 + ], + [ + 1169, + 1170 + ], + [ + 1171, + 1175 + ], + [ + 1180, + 1181 + ], + [ + 1184, + 1185 + ], + [ + 1188, + 1189 + ], + [ + 1190, + 1191 + ], + [ + 1192, + 1196 + ], + [ + 1201, + 1202 + ], + [ + 1205, + 1206 + ], + [ + 1209, + 1210 + ], + [ + 1211, + 1212 + ], + [ + 1213, + 1217 + ], + [ + 1222, + 1223 + ], + [ + 1226, + 1227 + ], + [ + 1230, + 1231 + ], + [ + 1232, + 1233 + ], + [ + 1234, + 1238 + ], + [ + 1243, + 1248 + ], + [ + 1253, + 1254 + ], + [ + 1260, + 1261 + ], + [ + 1264, + 1265 + ], + [ + 1266, + 1267 + ], + [ + 1268, + 1272 + ], + [ + 1277, + 1282 + ], + [ + 1287, + 1288 + ], + [ + 1297, + 1300 + ], + [ + 1301, + 1302 + ], + [ + 1305, + 1306 + ], + [ + 1307, + 1308 + ], + [ + 1309, + 1313 + ], + [ + 1318, + 1323 + ], + [ + 1328, + 1329 + ], + [ + 1338, + 1341 + ], + [ + 1342, + 1343 + ], + [ + 1346, + 1347 + ], + [ + 1348, + 1349 + ], + [ + 1350, + 1354 + ], + [ + 1359, + 1365 + ], + [ + 1370, + 1371 + ], + [ + 1379, + 1381 + ], + [ + 1384, + 1385 + ], + [ + 1386, + 1387 + ], + [ + 1388, + 1392 + ], + [ + 1397, + 1401 + ], + [ + 1406, + 1407 + ], + [ + 1411, + 1412 + ], + [ + 1415, + 1416 + ], + [ + 1417, + 1418 + ], + [ + 1419, + 1423 + ], + [ + 1428, + 1429 + ], + [ + 1432, + 1433 + ], + [ + 1436, + 1439 + ], + [ + 1442, + 1449 + ], + [ + 1454, + 1456 + ], + [ + 1461, + 1462 + ], + [ + 1465, + 1466 + ], + [ + 1471, + 1472 + ], + [ + 1473, + 1477 + ], + [ + 1482, + 1484 + ], + [ + 1489, + 1490 + ], + [ + 1493, + 1495 + ], + [ + 1496, + 1497 + ], + [ + 1502, + 1503 + ], + [ + 1504, + 1508 + ], + [ + 1513, + 1516 + ], + [ + 1521, + 1524 + ], + [ + 1529, + 1532 + ], + [ + 1537, + 1538 + ], + [ + 1539, + 1540 + ], + [ + 1543, + 1544 + ], + [ + 1545, + 1551 + ], + [ + 1556, + 1557 + ], + [ + 1560, + 1561 + ], + [ + 1564, + 1565 + ], + [ + 1566, + 1567 + ], + [ + 1568, + 1572 + ], + [ + 1577, + 1578 + ], + [ + 1581, + 1582 + ], + [ + 1585, + 1586 + ], + [ + 1587, + 1588 + ], + [ + 1589, + 1593 + ], + [ + 1598, + 1599 + ], + [ + 1600, + 1601 + ], + [ + 1604, + 1605 + ], + [ + 1606, + 1608 + ], + [ + 1609, + 1612 + ], + [ + 1617, + 1618 + ], + [ + 1621, + 1622 + ], + [ + 1625, + 1626 + ], + [ + 1627, + 1628 + ], + [ + 1629, + 1633 + ], + [ + 1638, + 1639 + ], + [ + 1642, + 1643 + ], + [ + 1646, + 1647 + ], + [ + 1648, + 1649 + ], + [ + 1650, + 1654 + ], + [ + 1659, + 1660 + ], + [ + 1661, + 1662 + ], + [ + 1665, + 1666 + ], + [ + 1667, + 1673 + ], + [ + 1678, + 1679 + ], + [ + 1682, + 1683 + ], + [ + 1686, + 1687 + ], + [ + 1688, + 1689 + ], + [ + 1690, + 1694 + ], + [ + 1699, + 1700 + ], + [ + 1703, + 1704 + ], + [ + 1707, + 1708 + ], + [ + 1709, + 1710 + ], + [ + 1711, + 1715 + ], + [ + 1720, + 1721 + ], + [ + 1724, + 1725 + ], + [ + 1728, + 1729 + ], + [ + 1730, + 1731 + ], + [ + 1732, + 1736 + ], + [ + 1741, + 1742 + ], + [ + 1745, + 1746 + ], + [ + 1749, + 1750 + ], + [ + 1751, + 1752 + ], + [ + 1753, + 1757 + ], + [ + 1762, + 1763 + ], + [ + 1766, + 1767 + ], + [ + 1770, + 1771 + ], + [ + 1772, + 1773 + ], + [ + 1774, + 1778 + ], + [ + 1783, + 1784 + ], + [ + 1787, + 1788 + ], + [ + 1791, + 1792 + ], + [ + 1793, + 1794 + ], + [ + 1795, + 1799 + ], + [ + 1804, + 1805 + ], + [ + 1806, + 1807 + ], + [ + 1810, + 1811 + ], + [ + 1812, + 1818 + ], + [ + 1823, + 1824 + ], + [ + 1827, + 1828 + ], + [ + 1831, + 1832 + ], + [ + 1833, + 1839 + ], + [ + 1844, + 1845 + ], + [ + 1848, + 1849 + ], + [ + 1852, + 1853 + ], + [ + 1854, + 1860 + ], + [ + 1865, + 1866 + ], + [ + 1867, + 1868 + ], + [ + 1871, + 1872 + ], + [ + 1873, + 1879 + ], + [ + 1884, + 1885 + ], + [ + 1888, + 1889 + ], + [ + 1892, + 1893 + ], + [ + 1894, + 1900 + ], + [ + 1905, + 1906 + ], + [ + 1909, + 1910 + ], + [ + 1913, + 1914 + ], + [ + 1915, + 1921 + ], + [ + 1926, + 1927 + ], + [ + 1928, + 1929 + ], + [ + 1932, + 1933 + ], + [ + 1934, + 1940 + ], + [ + 1945, + 1946 + ], + [ + 1949, + 1950 + ], + [ + 1953, + 1954 + ], + [ + 1955, + 1961 + ], + [ + 1966, + 1967 + ], + [ + 1970, + 1971 + ], + [ + 1974, + 1975 + ], + [ + 1976, + 1982 + ], + [ + 1987, + 1988 + ], + [ + 1989, + 1990 + ], + [ + 1993, + 1994 + ], + [ + 1995, + 2001 + ], + [ + 2006, + 2007 + ], + [ + 2010, + 2011 + ], + [ + 2014, + 2015 + ], + [ + 2016, + 2022 + ], + [ + 2027, + 2028 + ], + [ + 2031, + 2032 + ], + [ + 2035, + 2036 + ], + [ + 2037, + 2043 + ], + [ + 2048, + 2049 + ], + [ + 2050, + 2051 + ], + [ + 2054, + 2055 + ], + [ + 2056, + 2057 + ], + [ + 2058, + 2062 + ], + [ + 2067, + 2068 + ], + [ + 2071, + 2072 + ], + [ + 2075, + 2076 + ], + [ + 2077, + 2078 + ], + [ + 2079, + 2083 + ], + [ + 2088, + 2089 + ], + [ + 2092, + 2093 + ], + [ + 2096, + 2097 + ], + [ + 2098, + 2099 + ], + [ + 2100, + 2104 + ], + [ + 2109, + 2110 + ], + [ + 2111, + 2112 + ], + [ + 2115, + 2116 + ], + [ + 2117, + 2118 + ], + [ + 2119, + 2123 + ], + [ + 2128, + 2129 + ], + [ + 2132, + 2133 + ], + [ + 2136, + 2137 + ], + [ + 2138, + 2139 + ], + [ + 2140, + 2144 + ], + [ + 2149, + 2150 + ], + [ + 2153, + 2154 + ], + [ + 2157, + 2158 + ], + [ + 2159, + 2160 + ], + [ + 2161, + 2165 + ], + [ + 2170, + 2174 + ], + [ + 2179, + 2180 + ], + [ + 2181, + 2182 + ], + [ + 2185, + 2186 + ], + [ + 2187, + 2188 + ], + [ + 2190, + 2193 + ], + [ + 2198, + 2199 + ], + [ + 2200, + 2201 + ], + [ + 2204, + 2205 + ], + [ + 2206, + 2207 + ], + [ + 2209, + 2212 + ], + [ + 2217, + 2218 + ], + [ + 2219, + 2220 + ], + [ + 2223, + 2224 + ], + [ + 2225, + 2231 + ], + [ + 2274, + 2275 + ], + [ + 2328, + 2329 + ] + ] + } + }, + { + "filename": "libvips/deprecated/dispatch_types.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 50, + 57 + ], + [ + 58, + 354 + ], + [ + 355, + 637 + ], + [ + 638, + 725 + ], + [ + 728, + 799 + ], + [ + 800, + 837 + ] + ], + "lines_added": [ + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 30 + ], + [ + 35, + 36 + ], + [ + 53, + 54 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 71, + 75 + ], + [ + 81, + 86 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ], + [ + 101, + 106 + ], + [ + 111, + 112 + ], + [ + 115, + 116 + ], + [ + 121, + 126 + ], + [ + 131, + 132 + ], + [ + 135, + 136 + ], + [ + 141, + 146 + ], + [ + 151, + 152 + ], + [ + 155, + 156 + ], + [ + 158, + 161 + ], + [ + 164, + 165 + ], + [ + 169, + 170 + ], + [ + 175, + 176 + ], + [ + 182, + 184 + ], + [ + 185, + 188 + ], + [ + 193, + 194 + ], + [ + 196, + 200 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 210, + 213 + ], + [ + 214, + 215 + ], + [ + 220, + 221 + ], + [ + 226, + 228 + ], + [ + 230, + 231 + ], + [ + 236, + 237 + ], + [ + 240, + 244 + ], + [ + 245, + 246 + ], + [ + 248, + 249 + ], + [ + 251, + 252 + ], + [ + 255, + 259 + ], + [ + 260, + 261 + ], + [ + 266, + 267 + ], + [ + 270, + 272 + ], + [ + 273, + 274 + ], + [ + 279, + 280 + ], + [ + 283, + 285 + ], + [ + 286, + 287 + ], + [ + 292, + 293 + ], + [ + 296, + 299 + ], + [ + 304, + 305 + ], + [ + 308, + 311 + ], + [ + 316, + 321 + ], + [ + 327, + 328 + ], + [ + 329, + 331 + ], + [ + 336, + 341 + ], + [ + 347, + 348 + ], + [ + 349, + 351 + ], + [ + 358, + 359 + ], + [ + 360, + 362 + ], + [ + 367, + 368 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 379, + 384 + ], + [ + 389, + 390 + ], + [ + 393, + 395 + ], + [ + 399, + 400 + ], + [ + 405, + 406 + ], + [ + 412, + 414 + ], + [ + 415, + 418 + ], + [ + 421, + 428 + ], + [ + 431, + 432 + ], + [ + 433, + 434 + ], + [ + 439, + 444 + ], + [ + 449, + 450 + ], + [ + 454, + 457 + ], + [ + 458, + 459 + ], + [ + 464, + 469 + ], + [ + 474, + 475 + ], + [ + 478, + 480 + ], + [ + 484, + 485 + ], + [ + 490, + 491 + ], + [ + 497, + 499 + ], + [ + 500, + 503 + ], + [ + 506, + 508 + ], + [ + 509, + 518 + ], + [ + 522, + 523 + ], + [ + 524, + 525 + ], + [ + 530, + 535 + ], + [ + 540, + 541 + ], + [ + 545, + 548 + ], + [ + 549, + 550 + ], + [ + 555, + 560 + ], + [ + 565, + 566 + ], + [ + 569, + 572 + ], + [ + 574, + 575 + ], + [ + 580, + 585 + ], + [ + 590, + 591 + ], + [ + 592, + 594 + ], + [ + 595, + 596 + ], + [ + 601, + 606 + ], + [ + 611, + 612 + ], + [ + 613, + 616 + ], + [ + 621, + 626 + ], + [ + 631, + 634 + ], + [ + 641, + 646 + ], + [ + 651, + 652 + ], + [ + 655, + 656 + ], + [ + 657, + 658 + ], + [ + 663, + 664 + ], + [ + 667, + 668 + ], + [ + 669, + 670 + ], + [ + 675, + 676 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 687, + 688 + ], + [ + 691, + 692 + ], + [ + 693, + 694 + ], + [ + 699, + 700 + ], + [ + 705, + 706 + ], + [ + 707, + 710 + ], + [ + 711, + 713 + ], + [ + 714, + 715 + ], + [ + 716, + 719 + ], + [ + 721, + 722 + ], + [ + 731, + 732 + ], + [ + 735, + 737 + ], + [ + 738, + 739 + ], + [ + 742, + 743 + ], + [ + 749, + 751 + ], + [ + 752, + 753 + ], + [ + 758, + 763 + ], + [ + 766, + 767 + ], + [ + 771, + 774 + ], + [ + 775, + 776 + ], + [ + 781, + 782 + ], + [ + 785, + 786 + ], + [ + 787, + 788 + ], + [ + 791, + 796 + ], + [ + 803, + 804 + ], + [ + 805, + 807 + ], + [ + 809, + 810 + ], + [ + 811, + 816 + ], + [ + 819, + 820 + ], + [ + 823, + 824 + ], + [ + 825, + 826 + ], + [ + 827, + 828 + ], + [ + 831, + 836 + ] + ] + } + }, + { + "filename": "libvips/deprecated/fits.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 46, + 80 + ], + [ + 84, + 97 + ], + [ + 99, + 107 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 49, + 50 + ], + [ + 53, + 58 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 67, + 69 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 87, + 88 + ], + [ + 93, + 94 + ], + [ + 102, + 103 + ], + [ + 106, + 107 + ] + ] + } + }, + { + "filename": "libvips/deprecated/format.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 39, + 64 + ], + [ + 67, + 74 + ], + [ + 78, + 144 + ], + [ + 146, + 153 + ], + [ + 155, + 169 + ], + [ + 171, + 225 + ], + [ + 227, + 246 + ], + [ + 251, + 330 + ], + [ + 337, + 381 + ], + [ + 388, + 409 + ], + [ + 417, + 432 + ], + [ + 440, + 453 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 42, + 43 + ], + [ + 47, + 48 + ], + [ + 49, + 50 + ], + [ + 52, + 53 + ], + [ + 54, + 55 + ], + [ + 58, + 59 + ], + [ + 60, + 61 + ], + [ + 70, + 71 + ], + [ + 81, + 82 + ], + [ + 87, + 89 + ], + [ + 90, + 93 + ], + [ + 94, + 95 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 111 + ], + [ + 113, + 118 + ], + [ + 119, + 120 + ], + [ + 122, + 132 + ], + [ + 135, + 136 + ], + [ + 140, + 141 + ], + [ + 149, + 150 + ], + [ + 158, + 159 + ], + [ + 163, + 164 + ], + [ + 165, + 166 + ], + [ + 174, + 175 + ], + [ + 178, + 181 + ], + [ + 183, + 186 + ], + [ + 188, + 189 + ], + [ + 191, + 192 + ], + [ + 195, + 196 + ], + [ + 199, + 202 + ], + [ + 203, + 204 + ], + [ + 207, + 208 + ], + [ + 214, + 216 + ], + [ + 217, + 219 + ], + [ + 221, + 222 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 242, + 243 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 263, + 264 + ], + [ + 265, + 269 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 280, + 281 + ], + [ + 287, + 288 + ], + [ + 291, + 292 + ], + [ + 295, + 296 + ], + [ + 300, + 301 + ], + [ + 304, + 305 + ], + [ + 307, + 308 + ], + [ + 309, + 310 + ], + [ + 316, + 318 + ], + [ + 319, + 322 + ], + [ + 323, + 325 + ], + [ + 326, + 327 + ], + [ + 340, + 341 + ], + [ + 346, + 347 + ], + [ + 349, + 350 + ], + [ + 351, + 354 + ], + [ + 356, + 362 + ], + [ + 364, + 365 + ], + [ + 371, + 372 + ], + [ + 373, + 376 + ], + [ + 377, + 378 + ], + [ + 391, + 392 + ], + [ + 395, + 401 + ], + [ + 402, + 403 + ], + [ + 405, + 406 + ], + [ + 420, + 421 + ], + [ + 424, + 427 + ], + [ + 428, + 429 + ], + [ + 443, + 444 + ], + [ + 447, + 450 + ], + [ + 451, + 452 + ] + ] + } + }, + { + "filename": "libvips/deprecated/format_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 39, + 443 + ], + [ + 464, + 470 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 42, + 43 + ], + [ + 47, + 49 + ], + [ + 50, + 51 + ], + [ + 54, + 56 + ], + [ + 59, + 65 + ], + [ + 68, + 69 + ], + [ + 73, + 75 + ], + [ + 76, + 77 + ], + [ + 80, + 82 + ], + [ + 85, + 91 + ], + [ + 94, + 95 + ], + [ + 99, + 101 + ], + [ + 102, + 103 + ], + [ + 106, + 108 + ], + [ + 111, + 117 + ], + [ + 120, + 121 + ], + [ + 125, + 127 + ], + [ + 128, + 129 + ], + [ + 132, + 134 + ], + [ + 137, + 138 + ], + [ + 139, + 143 + ], + [ + 148, + 150 + ], + [ + 155, + 156 + ], + [ + 157, + 158 + ], + [ + 163, + 164 + ], + [ + 166, + 169 + ], + [ + 174, + 176 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 189, + 190 + ], + [ + 192, + 195 + ], + [ + 200, + 202 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 215, + 216 + ], + [ + 218, + 221 + ], + [ + 226, + 228 + ], + [ + 233, + 234 + ], + [ + 235, + 236 + ], + [ + 241, + 242 + ], + [ + 244, + 247 + ], + [ + 252, + 254 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 267, + 269 + ], + [ + 270, + 273 + ], + [ + 278, + 280 + ], + [ + 285, + 286 + ], + [ + 287, + 288 + ], + [ + 293, + 294 + ], + [ + 296, + 299 + ], + [ + 302, + 303 + ], + [ + 304, + 306 + ], + [ + 307, + 308 + ], + [ + 311, + 313 + ], + [ + 316, + 322 + ], + [ + 325, + 326 + ], + [ + 327, + 329 + ], + [ + 330, + 331 + ], + [ + 334, + 336 + ], + [ + 339, + 345 + ], + [ + 348, + 349 + ], + [ + 350, + 352 + ], + [ + 353, + 354 + ], + [ + 357, + 359 + ], + [ + 362, + 368 + ], + [ + 371, + 372 + ], + [ + 373, + 375 + ], + [ + 376, + 377 + ], + [ + 380, + 382 + ], + [ + 385, + 391 + ], + [ + 394, + 395 + ], + [ + 396, + 398 + ], + [ + 399, + 400 + ], + [ + 403, + 405 + ], + [ + 408, + 414 + ], + [ + 417, + 418 + ], + [ + 422, + 424 + ], + [ + 425, + 426 + ], + [ + 429, + 431 + ], + [ + 434, + 440 + ], + [ + 467, + 468 + ] + ] + } + }, + { + "filename": "libvips/deprecated/freq_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 46, + 82 + ], + [ + 86, + 124 + ], + [ + 126, + 316 + ], + [ + 331, + 337 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 49, + 51 + ], + [ + 56, + 59 + ], + [ + 64, + 73 + ], + [ + 78, + 79 + ], + [ + 89, + 91 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 98, + 102 + ], + [ + 107, + 115 + ], + [ + 120, + 121 + ], + [ + 129, + 131 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 138, + 142 + ], + [ + 147, + 150 + ], + [ + 155, + 156 + ], + [ + 160, + 161 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 168, + 172 + ], + [ + 177, + 180 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 195, + 199 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 218 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 229, + 230 + ], + [ + 231, + 232 + ], + [ + 233, + 237 + ], + [ + 242, + 243 + ], + [ + 244, + 245 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 252, + 256 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 271, + 275 + ], + [ + 280, + 281 + ], + [ + 282, + 283 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 290, + 294 + ], + [ + 299, + 300 + ], + [ + 301, + 302 + ], + [ + 305, + 306 + ], + [ + 307, + 308 + ], + [ + 309, + 313 + ], + [ + 334, + 335 + ] + ] + } + }, + { + "filename": "libvips/deprecated/glds_funcs.c", + "line_filter": { + "diff_chunks": [ + [ + 37, + 65 + ], + [ + 76, + 85 + ], + [ + 89, + 256 + ] + ], + "lines_added": [ + [ + 40, + 56 + ], + [ + 61, + 62 + ], + [ + 79, + 82 + ], + [ + 92, + 93 + ], + [ + 94, + 98 + ], + [ + 99, + 103 + ], + [ + 105, + 107 + ], + [ + 112, + 113 + ], + [ + 114, + 120 + ], + [ + 121, + 123 + ], + [ + 124, + 125 + ], + [ + 127, + 129 + ], + [ + 133, + 134 + ], + [ + 138, + 146 + ], + [ + 150, + 152 + ], + [ + 154, + 155 + ], + [ + 156, + 158 + ], + [ + 159, + 164 + ], + [ + 165, + 167 + ], + [ + 168, + 170 + ], + [ + 171, + 172 + ], + [ + 176, + 178 + ], + [ + 180, + 181 + ], + [ + 182, + 184 + ], + [ + 185, + 190 + ], + [ + 191, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 203, + 205 + ], + [ + 207, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 217 + ], + [ + 218, + 223 + ], + [ + 224, + 228 + ], + [ + 232, + 234 + ], + [ + 236, + 237 + ], + [ + 238, + 240 + ], + [ + 241, + 246 + ], + [ + 247, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 255 + ] + ] + } + }, + { + "filename": "libvips/deprecated/hist_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 489 + ], + [ + 491, + 587 + ], + [ + 591, + 631 + ], + [ + 637, + 675 + ], + [ + 677, + 779 + ], + [ + 810, + 816 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 48 + ], + [ + 53, + 56 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 69, + 70 + ], + [ + 71, + 77 + ], + [ + 82, + 85 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 106 + ], + [ + 109, + 112 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 131 + ], + [ + 136, + 137 + ], + [ + 140, + 141 + ], + [ + 144, + 145 + ], + [ + 146, + 152 + ], + [ + 157, + 158 + ], + [ + 159, + 160 + ], + [ + 163, + 164 + ], + [ + 165, + 171 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 184, + 190 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 201, + 202 + ], + [ + 203, + 209 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 224, + 230 + ], + [ + 235, + 236 + ], + [ + 239, + 240 + ], + [ + 245, + 248 + ], + [ + 251, + 252 + ], + [ + 253, + 259 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 271 + ], + [ + 272, + 278 + ], + [ + 283, + 286 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 301, + 305 + ], + [ + 310, + 311 + ], + [ + 312, + 313 + ], + [ + 316, + 317 + ], + [ + 318, + 319 + ], + [ + 320, + 324 + ], + [ + 329, + 331 + ], + [ + 336, + 337 + ], + [ + 340, + 341 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 348, + 352 + ], + [ + 357, + 360 + ], + [ + 365, + 366 + ], + [ + 370, + 371 + ], + [ + 374, + 375 + ], + [ + 376, + 377 + ], + [ + 378, + 382 + ], + [ + 387, + 391 + ], + [ + 396, + 397 + ], + [ + 401, + 402 + ], + [ + 405, + 406 + ], + [ + 407, + 408 + ], + [ + 409, + 413 + ], + [ + 418, + 421 + ], + [ + 426, + 427 + ], + [ + 428, + 429 + ], + [ + 432, + 433 + ], + [ + 434, + 435 + ], + [ + 436, + 440 + ], + [ + 445, + 446 + ], + [ + 447, + 448 + ], + [ + 453, + 456 + ], + [ + 459, + 460 + ], + [ + 461, + 467 + ], + [ + 472, + 480 + ], + [ + 485, + 486 + ], + [ + 494, + 495 + ], + [ + 498, + 499 + ], + [ + 500, + 501 + ], + [ + 502, + 506 + ], + [ + 511, + 513 + ], + [ + 518, + 519 + ], + [ + 522, + 523 + ], + [ + 526, + 527 + ], + [ + 528, + 529 + ], + [ + 530, + 534 + ], + [ + 539, + 542 + ], + [ + 547, + 548 + ], + [ + 552, + 553 + ], + [ + 556, + 557 + ], + [ + 558, + 559 + ], + [ + 560, + 564 + ], + [ + 569, + 578 + ], + [ + 583, + 584 + ], + [ + 594, + 595 + ], + [ + 598, + 599 + ], + [ + 600, + 601 + ], + [ + 602, + 606 + ], + [ + 611, + 622 + ], + [ + 627, + 628 + ], + [ + 640, + 642 + ], + [ + 645, + 646 + ], + [ + 647, + 648 + ], + [ + 649, + 653 + ], + [ + 658, + 666 + ], + [ + 671, + 672 + ], + [ + 680, + 681 + ], + [ + 684, + 685 + ], + [ + 686, + 687 + ], + [ + 688, + 692 + ], + [ + 697, + 699 + ], + [ + 704, + 705 + ], + [ + 708, + 709 + ], + [ + 712, + 713 + ], + [ + 714, + 715 + ], + [ + 716, + 720 + ], + [ + 725, + 728 + ], + [ + 733, + 734 + ], + [ + 735, + 736 + ], + [ + 739, + 740 + ], + [ + 741, + 742 + ], + [ + 743, + 747 + ], + [ + 752, + 755 + ], + [ + 760, + 761 + ], + [ + 764, + 765 + ], + [ + 768, + 769 + ], + [ + 770, + 771 + ], + [ + 772, + 776 + ], + [ + 813, + 814 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_align_bands.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 47, + 100 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 32, + 33 + ], + [ + 50, + 51 + ], + [ + 53, + 54 + ], + [ + 58, + 61 + ], + [ + 62, + 98 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_analyze2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 44, + 76 + ], + [ + 78, + 91 + ], + [ + 93, + 101 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 47, + 48 + ], + [ + 49, + 51 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 60, + 61 + ], + [ + 64, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 81, + 82 + ], + [ + 87, + 88 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_benchmark.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 57, + 70 + ], + [ + 81, + 88 + ], + [ + 106, + 138 + ], + [ + 145, + 152 + ], + [ + 155, + 163 + ], + [ + 166, + 173 + ], + [ + 175, + 238 + ], + [ + 253, + 283 + ], + [ + 292, + 304 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 66, + 67 + ], + [ + 84, + 85 + ], + [ + 109, + 110 + ], + [ + 114, + 115 + ], + [ + 118, + 121 + ], + [ + 125, + 126 + ], + [ + 128, + 129 + ], + [ + 134, + 135 + ], + [ + 148, + 149 + ], + [ + 158, + 160 + ], + [ + 169, + 170 + ], + [ + 178, + 179 + ], + [ + 181, + 182 + ], + [ + 183, + 185 + ], + [ + 186, + 187 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 197, + 199 + ], + [ + 202, + 203 + ], + [ + 204, + 206 + ], + [ + 209, + 211 + ], + [ + 214, + 221 + ], + [ + 224, + 226 + ], + [ + 229, + 230 + ], + [ + 233, + 235 + ], + [ + 256, + 257 + ], + [ + 260, + 261 + ], + [ + 263, + 267 + ], + [ + 273, + 274 + ], + [ + 275, + 278 + ], + [ + 279, + 280 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 299, + 303 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_bernd.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 8 + ], + [ + 18, + 46 + ], + [ + 55, + 94 + ] + ], + "lines_added": [ + [ + 3, + 5 + ], + [ + 21, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 37 + ], + [ + 42, + 43 + ], + [ + 58, + 59 + ], + [ + 64, + 68 + ], + [ + 69, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 79, + 80 + ], + [ + 83, + 89 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_clamp.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 52, + 126 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 55, + 75 + ], + [ + 76, + 108 + ], + [ + 110, + 118 + ], + [ + 120, + 123 + ], + [ + 124, + 125 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_cmulnorm.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 16, + 44 + ], + [ + 60, + 84 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 35 + ], + [ + 40, + 41 + ], + [ + 63, + 64 + ], + [ + 65, + 66 + ], + [ + 72, + 74 + ], + [ + 77, + 83 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_convsub.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 49 + ], + [ + 59, + 358 + ] + ], + "lines_added": [ + [ + 19, + 20 + ], + [ + 24, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 40 + ], + [ + 45, + 46 + ], + [ + 62, + 64 + ], + [ + 66, + 68 + ], + [ + 73, + 74 + ], + [ + 76, + 82 + ], + [ + 87, + 89 + ], + [ + 91, + 92 + ], + [ + 96, + 100 + ], + [ + 103, + 105 + ], + [ + 107, + 109 + ], + [ + 113, + 116 + ], + [ + 118, + 123 + ], + [ + 124, + 131 + ], + [ + 133, + 134 + ], + [ + 136, + 137 + ], + [ + 138, + 140 + ], + [ + 143, + 144 + ], + [ + 145, + 150 + ], + [ + 151, + 152 + ], + [ + 154, + 156 + ], + [ + 161, + 163 + ], + [ + 166, + 167 + ], + [ + 169, + 171 + ], + [ + 172, + 174 + ], + [ + 179, + 184 + ], + [ + 185, + 192 + ], + [ + 193, + 194 + ], + [ + 195, + 199 + ], + [ + 202, + 203 + ], + [ + 204, + 209 + ], + [ + 212, + 213 + ], + [ + 214, + 219 + ], + [ + 221, + 223 + ], + [ + 224, + 225 + ], + [ + 226, + 229 + ], + [ + 230, + 232 + ], + [ + 233, + 234 + ], + [ + 235, + 239 + ], + [ + 240, + 246 + ], + [ + 247, + 248 + ], + [ + 252, + 255 + ], + [ + 257, + 260 + ], + [ + 261, + 262 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 268, + 272 + ], + [ + 273, + 280 + ], + [ + 281, + 288 + ], + [ + 289, + 290 + ], + [ + 291, + 293 + ], + [ + 294, + 295 + ], + [ + 296, + 299 + ], + [ + 301, + 303 + ], + [ + 305, + 307 + ], + [ + 308, + 310 + ], + [ + 312, + 323 + ], + [ + 324, + 325 + ], + [ + 327, + 341 + ], + [ + 342, + 357 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_csv2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 48, + 55 + ], + [ + 65, + 98 + ], + [ + 102, + 115 + ], + [ + 116, + 124 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 51, + 52 + ], + [ + 68, + 69 + ], + [ + 70, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 79 + ], + [ + 81, + 91 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 105, + 106 + ], + [ + 111, + 112 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_debugim.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 24, + 52 + ], + [ + 59, + 160 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 27, + 28 + ], + [ + 29, + 33 + ], + [ + 34, + 43 + ], + [ + 48, + 49 + ], + [ + 62, + 64 + ], + [ + 65, + 71 + ], + [ + 75, + 77 + ], + [ + 78, + 83 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 90, + 92 + ], + [ + 93, + 98 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 105, + 107 + ], + [ + 108, + 114 + ], + [ + 116, + 117 + ], + [ + 120, + 159 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_dif_std.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 48, + 95 + ], + [ + 96, + 140 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 51, + 54 + ], + [ + 57, + 58 + ], + [ + 62, + 64 + ], + [ + 65, + 67 + ], + [ + 69, + 73 + ], + [ + 74, + 75 + ], + [ + 77, + 78 + ], + [ + 80, + 83 + ], + [ + 87, + 88 + ], + [ + 90, + 92 + ], + [ + 99, + 101 + ], + [ + 102, + 110 + ], + [ + 112, + 119 + ], + [ + 121, + 122 + ], + [ + 124, + 126 + ], + [ + 128, + 129 + ], + [ + 130, + 134 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_exr2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 53, + 94 + ], + [ + 96, + 109 + ], + [ + 111, + 119 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 56, + 57 + ], + [ + 59, + 60 + ], + [ + 61, + 63 + ], + [ + 64, + 65 + ], + [ + 71, + 72 + ], + [ + 76, + 77 + ], + [ + 78, + 80 + ], + [ + 83, + 84 + ], + [ + 88, + 89 + ], + [ + 90, + 91 + ], + [ + 99, + 100 + ], + [ + 105, + 106 + ], + [ + 114, + 115 + ], + [ + 118, + 119 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_fav4.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 32 + ], + [ + 48, + 98 + ] + ], + "lines_added": [ + [ + 7, + 23 + ], + [ + 28, + 29 + ], + [ + 51, + 52 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 59, + 60 + ], + [ + 62, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 97 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_freq_mask.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 39 + ], + [ + 51, + 240 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 30 + ], + [ + 35, + 36 + ], + [ + 54, + 56 + ], + [ + 60, + 65 + ], + [ + 68, + 69 + ], + [ + 70, + 73 + ], + [ + 76, + 80 + ], + [ + 83, + 86 + ], + [ + 89, + 93 + ], + [ + 96, + 99 + ], + [ + 102, + 106 + ], + [ + 109, + 112 + ], + [ + 115, + 119 + ], + [ + 122, + 125 + ], + [ + 128, + 132 + ], + [ + 135, + 138 + ], + [ + 141, + 145 + ], + [ + 148, + 151 + ], + [ + 154, + 157 + ], + [ + 160, + 164 + ], + [ + 167, + 170 + ], + [ + 173, + 177 + ], + [ + 180, + 183 + ], + [ + 186, + 190 + ], + [ + 193, + 195 + ], + [ + 197, + 200 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 206, + 208 + ], + [ + 209, + 210 + ], + [ + 212, + 214 + ], + [ + 217, + 221 + ], + [ + 222, + 224 + ], + [ + 225, + 226 + ], + [ + 229, + 230 + ], + [ + 233, + 237 + ], + [ + 238, + 239 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_gadd.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 17, + 50 + ], + [ + 70, + 130 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 7, + 8 + ], + [ + 20, + 21 + ], + [ + 25, + 26 + ], + [ + 27, + 31 + ], + [ + 32, + 41 + ], + [ + 46, + 47 + ], + [ + 73, + 75 + ], + [ + 80, + 114 + ], + [ + 115, + 116 + ], + [ + 118, + 121 + ], + [ + 123, + 127 + ], + [ + 128, + 129 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_gaddim.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 12 + ], + [ + 23, + 51 + ], + [ + 64, + 311 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 8, + 9 + ], + [ + 26, + 27 + ], + [ + 28, + 32 + ], + [ + 33, + 42 + ], + [ + 47, + 48 + ], + [ + 67, + 95 + ], + [ + 96, + 113 + ], + [ + 115, + 148 + ], + [ + 155, + 157 + ], + [ + 159, + 160 + ], + [ + 165, + 166 + ], + [ + 167, + 230 + ], + [ + 232, + 237 + ], + [ + 239, + 243 + ], + [ + 244, + 253 + ], + [ + 254, + 255 + ], + [ + 257, + 270 + ], + [ + 273, + 283 + ], + [ + 284, + 285 + ], + [ + 286, + 294 + ], + [ + 295, + 306 + ], + [ + 307, + 308 + ], + [ + 309, + 310 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_gfadd.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 24 + ], + [ + 26, + 54 + ], + [ + 65, + 467 + ] + ], + "lines_added": [ + [ + 20, + 21 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 68, + 87 + ], + [ + 89, + 186 + ], + [ + 192, + 194 + ], + [ + 200, + 278 + ], + [ + 279, + 284 + ], + [ + 285, + 318 + ], + [ + 321, + 353 + ], + [ + 354, + 356 + ], + [ + 358, + 374 + ], + [ + 376, + 382 + ], + [ + 383, + 385 + ], + [ + 387, + 393 + ], + [ + 394, + 396 + ], + [ + 398, + 404 + ], + [ + 405, + 407 + ], + [ + 409, + 415 + ], + [ + 416, + 418 + ], + [ + 420, + 424 + ], + [ + 425, + 426 + ], + [ + 427, + 447 + ], + [ + 450, + 453 + ], + [ + 455, + 464 + ], + [ + 465, + 466 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_gradcor.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 42 + ], + [ + 46, + 79 + ], + [ + 80, + 123 + ], + [ + 132, + 145 + ], + [ + 146, + 170 + ], + [ + 186, + 234 + ], + [ + 235, + 251 + ], + [ + 264, + 313 + ], + [ + 314, + 585 + ] + ], + "lines_added": [ + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 35, + 36 + ], + [ + 50, + 76 + ], + [ + 83, + 86 + ], + [ + 88, + 120 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 149, + 151 + ], + [ + 153, + 154 + ], + [ + 155, + 162 + ], + [ + 166, + 167 + ], + [ + 189, + 192 + ], + [ + 194, + 196 + ], + [ + 197, + 203 + ], + [ + 204, + 206 + ], + [ + 207, + 209 + ], + [ + 210, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 216 + ], + [ + 217, + 219 + ], + [ + 220, + 222 + ], + [ + 223, + 225 + ], + [ + 226, + 228 + ], + [ + 229, + 231 + ], + [ + 238, + 241 + ], + [ + 242, + 245 + ], + [ + 267, + 270 + ], + [ + 272, + 274 + ], + [ + 275, + 279 + ], + [ + 280, + 282 + ], + [ + 283, + 285 + ], + [ + 286, + 288 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 293, + 295 + ], + [ + 296, + 298 + ], + [ + 299, + 301 + ], + [ + 302, + 304 + ], + [ + 305, + 307 + ], + [ + 308, + 310 + ], + [ + 317, + 320 + ], + [ + 321, + 324 + ], + [ + 327, + 330 + ], + [ + 331, + 346 + ], + [ + 348, + 351 + ], + [ + 352, + 363 + ], + [ + 365, + 368 + ], + [ + 369, + 501 + ], + [ + 503, + 582 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_jpeg2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 52, + 59 + ], + [ + 68, + 94 + ], + [ + 96, + 182 + ], + [ + 186, + 199 + ], + [ + 202, + 210 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 55, + 56 + ], + [ + 71, + 72 + ], + [ + 75, + 83 + ], + [ + 85, + 87 + ], + [ + 89, + 91 + ], + [ + 99, + 100 + ], + [ + 106, + 107 + ], + [ + 108, + 111 + ], + [ + 114, + 125 + ], + [ + 127, + 129 + ], + [ + 130, + 131 + ], + [ + 133, + 134 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 151, + 152 + ], + [ + 155, + 156 + ], + [ + 159, + 164 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 189, + 190 + ], + [ + 195, + 196 + ], + [ + 205, + 206 + ], + [ + 209, + 210 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_lab_morph.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 49, + 78 + ], + [ + 82, + 92 + ], + [ + 96, + 123 + ], + [ + 128, + 140 + ], + [ + 142, + 154 + ], + [ + 156, + 198 + ], + [ + 208, + 215 + ], + [ + 247, + 255 + ], + [ + 258, + 265 + ], + [ + 266, + 273 + ], + [ + 277, + 310 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 52, + 53 + ], + [ + 54, + 55 + ], + [ + 58, + 63 + ], + [ + 64, + 66 + ], + [ + 68, + 71 + ], + [ + 72, + 73 + ], + [ + 85, + 86 + ], + [ + 87, + 89 + ], + [ + 99, + 103 + ], + [ + 104, + 114 + ], + [ + 119, + 120 + ], + [ + 131, + 135 + ], + [ + 136, + 137 + ], + [ + 145, + 149 + ], + [ + 150, + 151 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 165, + 166 + ], + [ + 169, + 170 + ], + [ + 173, + 195 + ], + [ + 211, + 212 + ], + [ + 250, + 252 + ], + [ + 261, + 262 + ], + [ + 269, + 270 + ], + [ + 280, + 284 + ], + [ + 287, + 290 + ], + [ + 292, + 298 + ], + [ + 299, + 300 + ], + [ + 302, + 306 + ], + [ + 307, + 309 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_line.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 45 + ], + [ + 54, + 153 + ] + ], + "lines_added": [ + [ + 20, + 36 + ], + [ + 41, + 42 + ], + [ + 57, + 59 + ], + [ + 60, + 61 + ], + [ + 63, + 104 + ], + [ + 105, + 109 + ], + [ + 111, + 118 + ], + [ + 119, + 123 + ], + [ + 125, + 134 + ], + [ + 136, + 145 + ], + [ + 147, + 152 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_linreg.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 45 + ], + [ + 51, + 435 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 28 + ], + [ + 29, + 33 + ], + [ + 38, + 39 + ], + [ + 54, + 60 + ], + [ + 63, + 133 + ], + [ + 138, + 139 + ], + [ + 143, + 146 + ], + [ + 147, + 238 + ], + [ + 241, + 245 + ], + [ + 246, + 247 + ], + [ + 248, + 250 + ], + [ + 251, + 252 + ], + [ + 253, + 255 + ], + [ + 256, + 259 + ], + [ + 260, + 266 + ], + [ + 267, + 272 + ], + [ + 273, + 274 + ], + [ + 276, + 435 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_litecor.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 9, + 16 + ], + [ + 32, + 60 + ], + [ + 73, + 82 + ], + [ + 86, + 142 + ], + [ + 144, + 212 + ], + [ + 217, + 281 + ], + [ + 283, + 314 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 12, + 13 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 76, + 79 + ], + [ + 89, + 90 + ], + [ + 91, + 94 + ], + [ + 96, + 97 + ], + [ + 98, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 108 + ], + [ + 109, + 110 + ], + [ + 111, + 113 + ], + [ + 118, + 119 + ], + [ + 123, + 124 + ], + [ + 126, + 127 + ], + [ + 128, + 132 + ], + [ + 136, + 139 + ], + [ + 147, + 150 + ], + [ + 151, + 153 + ], + [ + 156, + 159 + ], + [ + 162, + 165 + ], + [ + 166, + 168 + ], + [ + 169, + 170 + ], + [ + 172, + 176 + ], + [ + 177, + 179 + ], + [ + 182, + 185 + ], + [ + 188, + 191 + ], + [ + 192, + 194 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 206, + 209 + ], + [ + 220, + 221 + ], + [ + 222, + 225 + ], + [ + 227, + 228 + ], + [ + 229, + 231 + ], + [ + 233, + 234 + ], + [ + 235, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 244 + ], + [ + 245, + 246 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 253, + 258 + ], + [ + 264, + 267 + ], + [ + 270, + 272 + ], + [ + 274, + 276 + ], + [ + 277, + 278 + ], + [ + 286, + 295 + ], + [ + 296, + 300 + ], + [ + 302, + 303 + ], + [ + 304, + 308 + ], + [ + 310, + 312 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_magick2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 46, + 70 + ], + [ + 74, + 87 + ], + [ + 93, + 121 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 49, + 50 + ], + [ + 54, + 55 + ], + [ + 56, + 58 + ], + [ + 59, + 60 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 77, + 78 + ], + [ + 83, + 84 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 111, + 116 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_mask2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 59, + 122 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 62, + 63 + ], + [ + 69, + 73 + ], + [ + 77, + 85 + ], + [ + 88, + 90 + ], + [ + 93, + 94 + ], + [ + 96, + 97 + ], + [ + 99, + 101 + ], + [ + 103, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 115, + 119 + ], + [ + 120, + 121 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_matcat.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 58, + 65 + ], + [ + 66, + 76 + ], + [ + 77, + 93 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 61, + 62 + ], + [ + 69, + 73 + ], + [ + 80, + 82 + ], + [ + 85, + 87 + ], + [ + 88, + 90 + ], + [ + 91, + 92 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_matinv.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 44 + ], + [ + 54, + 76 + ], + [ + 81, + 98 + ], + [ + 100, + 218 + ], + [ + 230, + 237 + ], + [ + 238, + 280 + ], + [ + 286, + 293 + ], + [ + 295, + 337 + ], + [ + 339, + 346 + ], + [ + 348, + 388 + ], + [ + 389, + 518 + ] + ], + "lines_added": [ + [ + 19, + 35 + ], + [ + 40, + 41 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 65, + 67 + ], + [ + 68, + 73 + ], + [ + 84, + 86 + ], + [ + 87, + 88 + ], + [ + 94, + 95 + ], + [ + 103, + 107 + ], + [ + 109, + 215 + ], + [ + 233, + 234 + ], + [ + 241, + 246 + ], + [ + 247, + 277 + ], + [ + 289, + 290 + ], + [ + 298, + 302 + ], + [ + 304, + 334 + ], + [ + 342, + 343 + ], + [ + 351, + 354 + ], + [ + 355, + 385 + ], + [ + 392, + 397 + ], + [ + 398, + 401 + ], + [ + 402, + 404 + ], + [ + 405, + 406 + ], + [ + 407, + 410 + ], + [ + 411, + 412 + ], + [ + 413, + 414 + ], + [ + 418, + 423 + ], + [ + 424, + 426 + ], + [ + 427, + 429 + ], + [ + 430, + 431 + ], + [ + 432, + 434 + ], + [ + 435, + 436 + ], + [ + 437, + 438 + ], + [ + 439, + 443 + ], + [ + 444, + 448 + ], + [ + 453, + 513 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_matmul.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 45, + 52 + ], + [ + 59, + 67 + ], + [ + 69, + 101 + ], + [ + 106, + 111 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 48, + 49 + ], + [ + 62, + 64 + ], + [ + 72, + 75 + ], + [ + 79, + 81 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 97, + 98 + ], + [ + 109, + 110 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_mattrn.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 43, + 50 + ], + [ + 54, + 70 + ], + [ + 72, + 82 + ], + [ + 83, + 88 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 46, + 47 + ], + [ + 57, + 59 + ], + [ + 65, + 67 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 86, + 87 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_maxpos_avg.c", + "line_filter": { + "diff_chunks": [ + [ + 23, + 51 + ], + [ + 80, + 218 + ], + [ + 223, + 278 + ], + [ + 279, + 286 + ], + [ + 287, + 329 + ] + ], + "lines_added": [ + [ + 26, + 42 + ], + [ + 47, + 48 + ], + [ + 83, + 84 + ], + [ + 88, + 90 + ], + [ + 92, + 93 + ], + [ + 98, + 99 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 109, + 110 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 122, + 143 + ], + [ + 144, + 147 + ], + [ + 150, + 173 + ], + [ + 174, + 177 + ], + [ + 180, + 205 + ], + [ + 206, + 207 + ], + [ + 211, + 212 + ], + [ + 214, + 215 + ], + [ + 226, + 263 + ], + [ + 264, + 265 + ], + [ + 271, + 272 + ], + [ + 274, + 275 + ], + [ + 282, + 283 + ], + [ + 290, + 291 + ], + [ + 294, + 297 + ], + [ + 298, + 300 + ], + [ + 302, + 305 + ], + [ + 306, + 307 + ], + [ + 310, + 311 + ], + [ + 314, + 316 + ], + [ + 317, + 319 + ], + [ + 320, + 322 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_maxpos_subpel.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 44, + 58 + ], + [ + 88, + 170 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 29 + ], + [ + 34, + 35 + ], + [ + 47, + 49 + ], + [ + 53, + 55 + ], + [ + 91, + 94 + ], + [ + 96, + 169 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_measure.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 26, + 54 + ], + [ + 65, + 75 + ], + [ + 88, + 107 + ], + [ + 110, + 131 + ], + [ + 132, + 143 + ], + [ + 144, + 237 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 68, + 72 + ], + [ + 91, + 92 + ], + [ + 94, + 99 + ], + [ + 103, + 104 + ], + [ + 113, + 114 + ], + [ + 116, + 119 + ], + [ + 121, + 126 + ], + [ + 127, + 128 + ], + [ + 135, + 140 + ], + [ + 147, + 148 + ], + [ + 151, + 156 + ], + [ + 158, + 161 + ], + [ + 164, + 165 + ], + [ + 168, + 171 + ], + [ + 176, + 178 + ], + [ + 181, + 185 + ], + [ + 187, + 188 + ], + [ + 191, + 195 + ], + [ + 201, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 215 + ], + [ + 217, + 220 + ], + [ + 221, + 231 + ], + [ + 232, + 233 + ], + [ + 234, + 235 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_nifti2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 101 + ], + [ + 103, + 116 + ], + [ + 119, + 127 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 58, + 63 + ], + [ + 64, + 65 + ], + [ + 66, + 67 + ], + [ + 69, + 75 + ], + [ + 78, + 79 + ], + [ + 83, + 84 + ], + [ + 85, + 87 + ], + [ + 90, + 91 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 106, + 107 + ], + [ + 112, + 113 + ], + [ + 122, + 123 + ], + [ + 126, + 127 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_openslide2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 55, + 62 + ], + [ + 65, + 132 + ], + [ + 134, + 147 + ], + [ + 150, + 158 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 58, + 59 + ], + [ + 68, + 69 + ], + [ + 72, + 78 + ], + [ + 80, + 81 + ], + [ + 83, + 91 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 97, + 105 + ], + [ + 109, + 110 + ], + [ + 114, + 115 + ], + [ + 116, + 118 + ], + [ + 121, + 122 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 137, + 138 + ], + [ + 143, + 144 + ], + [ + 153, + 154 + ], + [ + 157, + 158 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_png2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 49, + 78 + ], + [ + 80, + 93 + ], + [ + 95, + 103 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 52, + 53 + ], + [ + 58, + 59 + ], + [ + 60, + 65 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 83, + 84 + ], + [ + 89, + 90 + ], + [ + 98, + 99 + ], + [ + 102, + 103 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_point_bilinear.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 63, + 100 + ], + [ + 105, + 120 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 31 + ], + [ + 36, + 37 + ], + [ + 66, + 69 + ], + [ + 73, + 79 + ], + [ + 81, + 86 + ], + [ + 88, + 93 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 108, + 109 + ], + [ + 114, + 116 + ], + [ + 117, + 119 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_ppm2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 40, + 72 + ], + [ + 76, + 89 + ], + [ + 92, + 100 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 43, + 44 + ], + [ + 47, + 52 + ], + [ + 53, + 54 + ], + [ + 55, + 56 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 67, + 69 + ], + [ + 79, + 80 + ], + [ + 85, + 86 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_print.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 42, + 51 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 45, + 46 + ], + [ + 47, + 48 + ], + [ + 49, + 50 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_printlines.c", + "line_filter": { + "diff_chunks": [ + [ + 21, + 49 + ], + [ + 56, + 172 + ] + ], + "lines_added": [ + [ + 24, + 40 + ], + [ + 45, + 46 + ], + [ + 59, + 60 + ], + [ + 62, + 95 + ], + [ + 96, + 101 + ], + [ + 102, + 105 + ], + [ + 109, + 111 + ], + [ + 112, + 114 + ], + [ + 115, + 116 + ], + [ + 117, + 119 + ], + [ + 123, + 124 + ], + [ + 126, + 128 + ], + [ + 129, + 131 + ], + [ + 132, + 133 + ], + [ + 134, + 136 + ], + [ + 140, + 141 + ], + [ + 143, + 145 + ], + [ + 146, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 154 + ], + [ + 155, + 156 + ], + [ + 158, + 159 + ], + [ + 160, + 162 + ], + [ + 163, + 168 + ], + [ + 170, + 171 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_resize_linear.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 41 + ], + [ + 52, + 206 + ] + ], + "lines_added": [ + [ + 16, + 32 + ], + [ + 37, + 38 + ], + [ + 55, + 59 + ], + [ + 64, + 68 + ], + [ + 71, + 73 + ], + [ + 76, + 79 + ], + [ + 82, + 84 + ], + [ + 87, + 90 + ], + [ + 93, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 104, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 113 + ], + [ + 114, + 116 + ], + [ + 117, + 119 + ], + [ + 120, + 125 + ], + [ + 126, + 129 + ], + [ + 130, + 132 + ], + [ + 136, + 203 + ], + [ + 204, + 205 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_setbox.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 43 + ], + [ + 50, + 58 + ] + ], + "lines_added": [ + [ + 18, + 34 + ], + [ + 39, + 40 + ], + [ + 53, + 55 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_simcontr.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 63, + 138 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 66, + 68 + ], + [ + 72, + 90 + ], + [ + 92, + 94 + ], + [ + 95, + 98 + ], + [ + 99, + 101 + ], + [ + 102, + 118 + ], + [ + 119, + 125 + ], + [ + 126, + 132 + ], + [ + 133, + 137 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_slice.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 48 + ], + [ + 61, + 170 + ] + ], + "lines_added": [ + [ + 18, + 19 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 64, + 65 + ], + [ + 67, + 88 + ], + [ + 91, + 92 + ], + [ + 94, + 95 + ], + [ + 96, + 98 + ], + [ + 100, + 115 + ], + [ + 116, + 130 + ], + [ + 131, + 134 + ], + [ + 136, + 150 + ], + [ + 151, + 157 + ], + [ + 159, + 162 + ], + [ + 164, + 166 + ], + [ + 168, + 169 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_spatres.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 45 + ], + [ + 54, + 148 + ] + ], + "lines_added": [ + [ + 20, + 36 + ], + [ + 41, + 42 + ], + [ + 57, + 59 + ], + [ + 60, + 62 + ], + [ + 68, + 73 + ], + [ + 74, + 78 + ], + [ + 80, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 105 + ], + [ + 107, + 110 + ], + [ + 114, + 115 + ], + [ + 117, + 118 + ], + [ + 120, + 121 + ], + [ + 123, + 125 + ], + [ + 128, + 130 + ], + [ + 131, + 133 + ], + [ + 134, + 135 + ], + [ + 137, + 147 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_stretch3.c", + "line_filter": { + "diff_chunks": [ + [ + 27, + 55 + ], + [ + 70, + 78 + ], + [ + 84, + 127 + ], + [ + 128, + 148 + ], + [ + 149, + 156 + ], + [ + 164, + 172 + ], + [ + 175, + 202 + ], + [ + 203, + 296 + ], + [ + 299, + 317 + ], + [ + 318, + 327 + ] + ], + "lines_added": [ + [ + 30, + 46 + ], + [ + 51, + 52 + ], + [ + 73, + 75 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 97, + 98 + ], + [ + 103, + 105 + ], + [ + 106, + 110 + ], + [ + 111, + 114 + ], + [ + 116, + 117 + ], + [ + 122, + 124 + ], + [ + 131, + 134 + ], + [ + 135, + 136 + ], + [ + 141, + 145 + ], + [ + 152, + 153 + ], + [ + 167, + 169 + ], + [ + 178, + 187 + ], + [ + 193, + 195 + ], + [ + 198, + 199 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 214, + 217 + ], + [ + 219, + 223 + ], + [ + 224, + 225 + ], + [ + 231, + 232 + ], + [ + 234, + 236 + ], + [ + 239, + 241 + ], + [ + 244, + 246 + ], + [ + 249, + 250 + ], + [ + 253, + 255 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 265, + 267 + ], + [ + 268, + 277 + ], + [ + 278, + 280 + ], + [ + 281, + 282 + ], + [ + 283, + 287 + ], + [ + 288, + 290 + ], + [ + 291, + 293 + ], + [ + 302, + 314 + ], + [ + 321, + 324 + ], + [ + 325, + 326 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_thresh.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 45 + ], + [ + 57, + 148 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 20, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 36 + ], + [ + 41, + 42 + ], + [ + 60, + 84 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 92, + 101 + ], + [ + 103, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 111 + ], + [ + 112, + 115 + ], + [ + 117, + 135 + ], + [ + 137, + 140 + ], + [ + 142, + 144 + ], + [ + 146, + 147 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_tiff2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 39 + ], + [ + 54, + 112 + ], + [ + 114, + 134 + ], + [ + 138, + 205 + ], + [ + 207, + 220 + ], + [ + 224, + 232 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 35, + 36 + ], + [ + 57, + 58 + ], + [ + 62, + 66 + ], + [ + 67, + 68 + ], + [ + 71, + 73 + ], + [ + 76, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 89, + 91 + ], + [ + 94, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 108, + 109 + ], + [ + 117, + 118 + ], + [ + 122, + 124 + ], + [ + 125, + 127 + ], + [ + 130, + 131 + ], + [ + 141, + 142 + ], + [ + 143, + 147 + ], + [ + 149, + 152 + ], + [ + 154, + 156 + ], + [ + 158, + 160 + ], + [ + 161, + 162 + ], + [ + 164, + 165 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 182, + 183 + ], + [ + 187, + 188 + ], + [ + 189, + 191 + ], + [ + 194, + 195 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 210, + 211 + ], + [ + 216, + 217 + ], + [ + 227, + 228 + ], + [ + 231, + 232 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_video_test.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 47, + 59 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 50, + 51 + ], + [ + 52, + 55 + ], + [ + 57, + 58 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2csv.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 39, + 47 + ], + [ + 50, + 65 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 44 + ], + [ + 53, + 54 + ], + [ + 55, + 57 + ], + [ + 60, + 62 + ], + [ + 63, + 64 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2dz.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 48, + 55 + ], + [ + 56, + 69 + ], + [ + 70, + 130 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 51, + 52 + ], + [ + 59, + 60 + ], + [ + 63, + 64 + ], + [ + 65, + 66 + ], + [ + 73, + 75 + ], + [ + 76, + 77 + ], + [ + 78, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 88 + ], + [ + 91, + 102 + ], + [ + 105, + 107 + ], + [ + 110, + 114 + ], + [ + 117, + 129 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2jpeg.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 50, + 59 + ], + [ + 67, + 113 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 53, + 54 + ], + [ + 55, + 56 + ], + [ + 70, + 72 + ], + [ + 73, + 76 + ], + [ + 77, + 79 + ], + [ + 81, + 85 + ], + [ + 87, + 89 + ], + [ + 92, + 93 + ], + [ + 96, + 101 + ], + [ + 102, + 103 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2mask.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 14 + ], + [ + 15, + 43 + ], + [ + 53, + 60 + ], + [ + 69, + 146 + ], + [ + 151, + 199 + ], + [ + 205, + 247 + ] + ], + "lines_added": [ + [ + 10, + 11 + ], + [ + 18, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 34 + ], + [ + 39, + 40 + ], + [ + 56, + 57 + ], + [ + 72, + 73 + ], + [ + 79, + 80 + ], + [ + 82, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 96, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 108, + 109 + ], + [ + 113, + 116 + ], + [ + 118, + 121 + ], + [ + 126, + 128 + ], + [ + 132, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 154, + 155 + ], + [ + 157, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 171, + 174 + ], + [ + 175, + 176 + ], + [ + 179, + 180 + ], + [ + 183, + 184 + ], + [ + 188, + 191 + ], + [ + 194, + 196 + ], + [ + 208, + 210 + ], + [ + 211, + 212 + ], + [ + 213, + 217 + ], + [ + 220, + 221 + ], + [ + 223, + 224 + ], + [ + 225, + 227 + ], + [ + 228, + 229 + ], + [ + 234, + 236 + ], + [ + 239, + 240 + ], + [ + 241, + 243 + ], + [ + 245, + 246 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2png.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 50, + 60 + ], + [ + 63, + 96 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 53, + 54 + ], + [ + 55, + 57 + ], + [ + 66, + 68 + ], + [ + 71, + 75 + ], + [ + 76, + 78 + ], + [ + 81, + 83 + ], + [ + 84, + 89 + ], + [ + 90, + 93 + ], + [ + 94, + 95 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2ppm.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 42, + 49 + ], + [ + 54, + 73 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 45, + 46 + ], + [ + 57, + 60 + ], + [ + 61, + 62 + ], + [ + 64, + 68 + ], + [ + 71, + 72 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2tiff.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 48, + 208 + ], + [ + 211, + 252 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 51, + 52 + ], + [ + 58, + 59 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 68, + 69 + ], + [ + 73, + 75 + ], + [ + 76, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 86, + 87 + ], + [ + 89, + 94 + ], + [ + 98, + 99 + ], + [ + 101, + 102 + ], + [ + 104, + 109 + ], + [ + 113, + 114 + ], + [ + 116, + 122 + ], + [ + 125, + 131 + ], + [ + 134, + 136 + ], + [ + 138, + 144 + ], + [ + 147, + 148 + ], + [ + 150, + 155 + ], + [ + 158, + 160 + ], + [ + 161, + 162 + ], + [ + 164, + 169 + ], + [ + 172, + 174 + ], + [ + 175, + 176 + ], + [ + 178, + 183 + ], + [ + 186, + 188 + ], + [ + 189, + 190 + ], + [ + 192, + 197 + ], + [ + 199, + 205 + ], + [ + 214, + 215 + ], + [ + 221, + 223 + ], + [ + 224, + 225 + ], + [ + 227, + 231 + ], + [ + 233, + 251 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_vips2webp.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 28 + ], + [ + 44, + 54 + ], + [ + 55, + 71 + ] + ], + "lines_added": [ + [ + 3, + 19 + ], + [ + 24, + 25 + ], + [ + 47, + 48 + ], + [ + 49, + 51 + ], + [ + 58, + 60 + ], + [ + 63, + 67 + ], + [ + 68, + 70 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_webp2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 28 + ], + [ + 43, + 113 + ], + [ + 115, + 128 + ], + [ + 131, + 141 + ] + ], + "lines_added": [ + [ + 3, + 19 + ], + [ + 24, + 25 + ], + [ + 46, + 47 + ], + [ + 51, + 52 + ], + [ + 54, + 69 + ], + [ + 70, + 72 + ], + [ + 73, + 74 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 87, + 92 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 107, + 108 + ], + [ + 109, + 110 + ], + [ + 118, + 119 + ], + [ + 124, + 125 + ], + [ + 134, + 135 + ], + [ + 138, + 139 + ] + ] + } + }, + { + "filename": "libvips/deprecated/im_zerox.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 17, + 45 + ], + [ + 53, + 132 + ], + [ + 133, + 196 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 20, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 36 + ], + [ + 41, + 42 + ], + [ + 56, + 70 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 92, + 93 + ], + [ + 98, + 121 + ], + [ + 123, + 124 + ], + [ + 127, + 129 + ], + [ + 136, + 137 + ], + [ + 141, + 142 + ], + [ + 148, + 150 + ], + [ + 153, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 167 + ], + [ + 169, + 170 + ], + [ + 173, + 175 + ], + [ + 180, + 182 + ], + [ + 185, + 188 + ], + [ + 191, + 193 + ], + [ + 194, + 195 + ] + ] + } + }, + { + "filename": "libvips/deprecated/inplace_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 44, + 209 + ], + [ + 212, + 249 + ], + [ + 251, + 288 + ], + [ + 290, + 328 + ], + [ + 329, + 362 + ], + [ + 364, + 401 + ], + [ + 403, + 444 + ], + [ + 448, + 486 + ], + [ + 487, + 523 + ], + [ + 528, + 567 + ], + [ + 571, + 593 + ], + [ + 610, + 616 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 47, + 48 + ], + [ + 53, + 59 + ], + [ + 61, + 65 + ], + [ + 66, + 67 + ], + [ + 70, + 71 + ], + [ + 75, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 110 + ], + [ + 112, + 113 + ], + [ + 115, + 116 + ], + [ + 121, + 125 + ], + [ + 130, + 131 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 147 + ], + [ + 152, + 160 + ], + [ + 165, + 166 + ], + [ + 172, + 175 + ], + [ + 177, + 179 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 186, + 190 + ], + [ + 195, + 200 + ], + [ + 205, + 206 + ], + [ + 215, + 218 + ], + [ + 219, + 220 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 231 + ], + [ + 236, + 240 + ], + [ + 245, + 246 + ], + [ + 254, + 257 + ], + [ + 258, + 259 + ], + [ + 262, + 263 + ], + [ + 264, + 265 + ], + [ + 266, + 270 + ], + [ + 275, + 279 + ], + [ + 284, + 285 + ], + [ + 293, + 296 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 305, + 309 + ], + [ + 314, + 319 + ], + [ + 324, + 325 + ], + [ + 332, + 333 + ], + [ + 336, + 337 + ], + [ + 338, + 339 + ], + [ + 340, + 344 + ], + [ + 349, + 353 + ], + [ + 358, + 359 + ], + [ + 367, + 370 + ], + [ + 371, + 372 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 379, + 383 + ], + [ + 388, + 392 + ], + [ + 397, + 398 + ], + [ + 406, + 410 + ], + [ + 412, + 413 + ], + [ + 416, + 417 + ], + [ + 418, + 419 + ], + [ + 420, + 424 + ], + [ + 429, + 435 + ], + [ + 440, + 441 + ], + [ + 451, + 454 + ], + [ + 455, + 456 + ], + [ + 459, + 460 + ], + [ + 461, + 462 + ], + [ + 463, + 467 + ], + [ + 472, + 477 + ], + [ + 482, + 483 + ], + [ + 490, + 491 + ], + [ + 494, + 495 + ], + [ + 496, + 497 + ], + [ + 498, + 502 + ], + [ + 507, + 514 + ], + [ + 519, + 520 + ], + [ + 531, + 534 + ], + [ + 535, + 536 + ], + [ + 539, + 540 + ], + [ + 541, + 542 + ], + [ + 543, + 547 + ], + [ + 552, + 558 + ], + [ + 563, + 564 + ], + [ + 574, + 577 + ], + [ + 578, + 579 + ], + [ + 582, + 583 + ], + [ + 584, + 585 + ], + [ + 586, + 590 + ], + [ + 613, + 614 + ] + ] + } + }, + { + "filename": "libvips/deprecated/lazy.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 51, + 60 + ], + [ + 63, + 111 + ], + [ + 113, + 136 + ], + [ + 140, + 242 + ], + [ + 246, + 295 + ], + [ + 298, + 331 + ], + [ + 332, + 342 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 66, + 69 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 78, + 81 + ], + [ + 84, + 86 + ], + [ + 89, + 91 + ], + [ + 93, + 94 + ], + [ + 96, + 97 + ], + [ + 98, + 99 + ], + [ + 102, + 103 + ], + [ + 107, + 108 + ], + [ + 116, + 118 + ], + [ + 119, + 121 + ], + [ + 122, + 123 + ], + [ + 125, + 126 + ], + [ + 132, + 133 + ], + [ + 143, + 146 + ], + [ + 147, + 150 + ], + [ + 153, + 156 + ], + [ + 157, + 158 + ], + [ + 164, + 165 + ], + [ + 168, + 174 + ], + [ + 177, + 178 + ], + [ + 183, + 185 + ], + [ + 188, + 189 + ], + [ + 190, + 194 + ], + [ + 195, + 199 + ], + [ + 200, + 201 + ], + [ + 207, + 209 + ], + [ + 212, + 213 + ], + [ + 216, + 218 + ], + [ + 219, + 221 + ], + [ + 222, + 223 + ], + [ + 225, + 230 + ], + [ + 231, + 234 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 249, + 250 + ], + [ + 252, + 253 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 264, + 266 + ], + [ + 269, + 270 + ], + [ + 273, + 274 + ], + [ + 275, + 278 + ], + [ + 281, + 282 + ], + [ + 285, + 287 + ], + [ + 288, + 289 + ], + [ + 291, + 292 + ], + [ + 301, + 305 + ], + [ + 310, + 311 + ], + [ + 312, + 313 + ], + [ + 317, + 318 + ], + [ + 321, + 323 + ], + [ + 324, + 325 + ], + [ + 327, + 328 + ], + [ + 335, + 340 + ] + ] + } + }, + { + "filename": "libvips/deprecated/mask_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 574 + ], + [ + 579, + 589 + ], + [ + 598, + 604 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 48 + ], + [ + 53, + 56 + ], + [ + 61, + 62 + ], + [ + 66, + 69 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 78, + 82 + ], + [ + 87, + 88 + ], + [ + 92, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 108 + ], + [ + 113, + 114 + ], + [ + 119, + 122 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 131, + 135 + ], + [ + 140, + 141 + ], + [ + 146, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 158, + 162 + ], + [ + 167, + 169 + ], + [ + 174, + 175 + ], + [ + 178, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 189, + 193 + ], + [ + 198, + 201 + ], + [ + 206, + 207 + ], + [ + 212, + 217 + ], + [ + 220, + 221 + ], + [ + 222, + 223 + ], + [ + 224, + 228 + ], + [ + 233, + 234 + ], + [ + 239, + 244 + ], + [ + 247, + 248 + ], + [ + 249, + 250 + ], + [ + 251, + 255 + ], + [ + 260, + 263 + ], + [ + 268, + 269 + ], + [ + 274, + 279 + ], + [ + 282, + 283 + ], + [ + 284, + 285 + ], + [ + 286, + 290 + ], + [ + 295, + 296 + ], + [ + 301, + 306 + ], + [ + 309, + 310 + ], + [ + 311, + 312 + ], + [ + 313, + 317 + ], + [ + 322, + 325 + ], + [ + 330, + 331 + ], + [ + 336, + 339 + ], + [ + 340, + 341 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 348, + 352 + ], + [ + 357, + 360 + ], + [ + 365, + 366 + ], + [ + 371, + 374 + ], + [ + 375, + 376 + ], + [ + 379, + 380 + ], + [ + 381, + 382 + ], + [ + 383, + 387 + ], + [ + 390, + 392 + ], + [ + 395, + 397 + ], + [ + 402, + 403 + ], + [ + 407, + 409 + ], + [ + 410, + 411 + ], + [ + 414, + 415 + ], + [ + 416, + 417 + ], + [ + 418, + 422 + ], + [ + 427, + 428 + ], + [ + 432, + 434 + ], + [ + 435, + 436 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 443, + 447 + ], + [ + 452, + 453 + ], + [ + 457, + 459 + ], + [ + 460, + 461 + ], + [ + 464, + 465 + ], + [ + 466, + 467 + ], + [ + 468, + 472 + ], + [ + 477, + 478 + ], + [ + 482, + 484 + ], + [ + 485, + 486 + ], + [ + 489, + 490 + ], + [ + 491, + 492 + ], + [ + 493, + 497 + ], + [ + 500, + 501 + ], + [ + 502, + 504 + ], + [ + 507, + 508 + ], + [ + 509, + 511 + ], + [ + 514, + 515 + ], + [ + 516, + 518 + ], + [ + 521, + 522 + ], + [ + 523, + 525 + ], + [ + 528, + 530 + ], + [ + 533, + 535 + ], + [ + 538, + 544 + ], + [ + 547, + 553 + ], + [ + 556, + 562 + ], + [ + 565, + 571 + ], + [ + 582, + 586 + ], + [ + 601, + 602 + ] + ] + } + }, + { + "filename": "libvips/deprecated/matalloc.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 22 + ], + [ + 25, + 42 + ], + [ + 58, + 128 + ], + [ + 137, + 229 + ] + ], + "lines_added": [ + [ + 18, + 19 + ], + [ + 28, + 29 + ], + [ + 33, + 34 + ], + [ + 38, + 39 + ], + [ + 61, + 62 + ], + [ + 63, + 64 + ], + [ + 65, + 66 + ], + [ + 68, + 70 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 80, + 82 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 92, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 100 + ], + [ + 101, + 102 + ], + [ + 104, + 106 + ], + [ + 107, + 108 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 140, + 142 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 151, + 153 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 160, + 162 + ], + [ + 165, + 168 + ], + [ + 170, + 172 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 181, + 183 + ], + [ + 184, + 185 + ], + [ + 186, + 187 + ], + [ + 190, + 192 + ], + [ + 195, + 198 + ], + [ + 200, + 202 + ], + [ + 206, + 207 + ], + [ + 208, + 209 + ], + [ + 211, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 220, + 222 + ], + [ + 225, + 228 + ] + ] + } + }, + { + "filename": "libvips/deprecated/matlab.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 40, + 65 + ], + [ + 67, + 80 + ], + [ + 82, + 90 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 43, + 44 + ], + [ + 47, + 52 + ], + [ + 53, + 54 + ], + [ + 55, + 56 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 70, + 71 + ], + [ + 76, + 77 + ], + [ + 85, + 86 + ], + [ + 89, + 90 + ] + ] + } + }, + { + "filename": "libvips/deprecated/morph_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 292 + ], + [ + 306, + 312 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 49 + ], + [ + 54, + 55 + ], + [ + 58, + 59 + ], + [ + 62, + 63 + ], + [ + 64, + 70 + ], + [ + 75, + 78 + ], + [ + 83, + 84 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 99 + ], + [ + 104, + 105 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 116, + 120 + ], + [ + 125, + 128 + ], + [ + 133, + 134 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 150 + ], + [ + 155, + 160 + ], + [ + 165, + 166 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 183 + ], + [ + 188, + 191 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 208, + 212 + ], + [ + 215, + 217 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 228, + 234 + ], + [ + 237, + 240 + ], + [ + 243, + 244 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 254, + 258 + ], + [ + 263, + 266 + ], + [ + 271, + 272 + ], + [ + 277, + 278 + ], + [ + 281, + 282 + ], + [ + 283, + 284 + ], + [ + 285, + 289 + ], + [ + 309, + 310 + ] + ] + } + }, + { + "filename": "libvips/deprecated/mosaicing_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 45, + 118 + ], + [ + 122, + 139 + ], + [ + 146, + 193 + ], + [ + 205, + 249 + ], + [ + 253, + 270 + ], + [ + 277, + 295 + ], + [ + 307, + 374 + ], + [ + 379, + 428 + ], + [ + 433, + 486 + ], + [ + 490, + 534 + ], + [ + 540, + 583 + ], + [ + 588, + 732 + ], + [ + 737, + 744 + ], + [ + 749, + 755 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 48, + 54 + ], + [ + 59, + 71 + ], + [ + 76, + 88 + ], + [ + 93, + 109 + ], + [ + 114, + 115 + ], + [ + 125, + 128 + ], + [ + 129, + 130 + ], + [ + 135, + 136 + ], + [ + 149, + 153 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 160, + 166 + ], + [ + 169, + 184 + ], + [ + 189, + 190 + ], + [ + 208, + 213 + ], + [ + 214, + 216 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 223, + 229 + ], + [ + 232, + 233 + ], + [ + 234, + 240 + ], + [ + 245, + 246 + ], + [ + 256, + 259 + ], + [ + 260, + 261 + ], + [ + 266, + 267 + ], + [ + 280, + 284 + ], + [ + 285, + 286 + ], + [ + 291, + 292 + ], + [ + 310, + 315 + ], + [ + 316, + 318 + ], + [ + 319, + 320 + ], + [ + 323, + 324 + ], + [ + 325, + 331 + ], + [ + 334, + 335 + ], + [ + 336, + 342 + ], + [ + 345, + 346 + ], + [ + 347, + 353 + ], + [ + 358, + 359 + ], + [ + 364, + 365 + ], + [ + 370, + 371 + ], + [ + 382, + 385 + ], + [ + 388, + 389 + ], + [ + 390, + 396 + ], + [ + 399, + 400 + ], + [ + 401, + 407 + ], + [ + 412, + 413 + ], + [ + 418, + 419 + ], + [ + 424, + 425 + ], + [ + 436, + 439 + ], + [ + 442, + 443 + ], + [ + 444, + 450 + ], + [ + 453, + 454 + ], + [ + 455, + 461 + ], + [ + 466, + 477 + ], + [ + 482, + 483 + ], + [ + 493, + 496 + ], + [ + 499, + 500 + ], + [ + 501, + 502 + ], + [ + 503, + 507 + ], + [ + 512, + 525 + ], + [ + 530, + 531 + ], + [ + 543, + 545 + ], + [ + 546, + 547 + ], + [ + 550, + 551 + ], + [ + 552, + 553 + ], + [ + 554, + 558 + ], + [ + 563, + 574 + ], + [ + 579, + 580 + ], + [ + 591, + 593 + ], + [ + 596, + 597 + ], + [ + 598, + 599 + ], + [ + 600, + 604 + ], + [ + 609, + 612 + ], + [ + 617, + 618 + ], + [ + 621, + 622 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 630, + 633 + ], + [ + 638, + 639 + ], + [ + 642, + 643 + ], + [ + 646, + 647 + ], + [ + 648, + 649 + ], + [ + 651, + 654 + ], + [ + 659, + 663 + ], + [ + 668, + 669 + ], + [ + 670, + 671 + ], + [ + 674, + 675 + ], + [ + 676, + 677 + ], + [ + 678, + 682 + ], + [ + 684, + 688 + ], + [ + 690, + 693 + ], + [ + 695, + 702 + ], + [ + 704, + 708 + ], + [ + 710, + 714 + ], + [ + 716, + 723 + ], + [ + 728, + 729 + ], + [ + 740, + 741 + ], + [ + 752, + 753 + ] + ] + } + }, + { + "filename": "libvips/deprecated/other_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 344 + ], + [ + 360, + 366 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 51 + ], + [ + 56, + 57 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 71, + 75 + ], + [ + 80, + 84 + ], + [ + 89, + 90 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 107 + ], + [ + 112, + 113 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 126, + 130 + ], + [ + 135, + 137 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 154, + 158 + ], + [ + 163, + 164 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 175, + 179 + ], + [ + 184, + 186 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 197, + 198 + ], + [ + 199, + 200 + ], + [ + 201, + 205 + ], + [ + 210, + 212 + ], + [ + 217, + 218 + ], + [ + 219, + 220 + ], + [ + 221, + 223 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 232, + 238 + ], + [ + 243, + 246 + ], + [ + 251, + 252 + ], + [ + 255, + 256 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 263, + 267 + ], + [ + 272, + 275 + ], + [ + 280, + 281 + ], + [ + 285, + 286 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 293, + 297 + ], + [ + 302, + 303 + ], + [ + 307, + 308 + ], + [ + 311, + 312 + ], + [ + 313, + 314 + ], + [ + 315, + 319 + ], + [ + 324, + 325 + ], + [ + 329, + 330 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 337, + 341 + ], + [ + 363, + 364 + ] + ] + } + }, + { + "filename": "libvips/deprecated/package.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 84, + 541 + ], + [ + 542, + 568 + ], + [ + 588, + 595 + ], + [ + 618, + 627 + ], + [ + 630, + 734 + ], + [ + 735, + 812 + ], + [ + 813, + 1011 + ], + [ + 1013, + 1148 + ], + [ + 1154, + 1197 + ], + [ + 1198, + 1225 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 87, + 90 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 118 + ], + [ + 123, + 126 + ], + [ + 131, + 132 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 154 + ], + [ + 159, + 162 + ], + [ + 167, + 168 + ], + [ + 169, + 171 + ], + [ + 174, + 175 + ], + [ + 176, + 182 + ], + [ + 187, + 190 + ], + [ + 195, + 196 + ], + [ + 199, + 201 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 208, + 214 + ], + [ + 219, + 222 + ], + [ + 227, + 228 + ], + [ + 229, + 231 + ], + [ + 234, + 235 + ], + [ + 236, + 242 + ], + [ + 247, + 250 + ], + [ + 255, + 256 + ], + [ + 262, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 271 + ], + [ + 272, + 278 + ], + [ + 283, + 285 + ], + [ + 290, + 291 + ], + [ + 295, + 298 + ], + [ + 299, + 300 + ], + [ + 303, + 304 + ], + [ + 305, + 311 + ], + [ + 316, + 318 + ], + [ + 323, + 324 + ], + [ + 330, + 332 + ], + [ + 333, + 334 + ], + [ + 337, + 338 + ], + [ + 339, + 345 + ], + [ + 350, + 351 + ], + [ + 356, + 357 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 364, + 365 + ], + [ + 366, + 372 + ], + [ + 377, + 378 + ], + [ + 383, + 384 + ], + [ + 385, + 387 + ], + [ + 388, + 389 + ], + [ + 392, + 393 + ], + [ + 394, + 400 + ], + [ + 405, + 407 + ], + [ + 412, + 413 + ], + [ + 417, + 418 + ], + [ + 419, + 421 + ], + [ + 424, + 425 + ], + [ + 428, + 429 + ], + [ + 430, + 436 + ], + [ + 441, + 442 + ], + [ + 447, + 448 + ], + [ + 453, + 454 + ], + [ + 457, + 458 + ], + [ + 459, + 465 + ], + [ + 470, + 475 + ], + [ + 480, + 481 + ], + [ + 486, + 488 + ], + [ + 491, + 492 + ], + [ + 493, + 499 + ], + [ + 502, + 503 + ], + [ + 508, + 510 + ], + [ + 513, + 514 + ], + [ + 515, + 521 + ], + [ + 526, + 532 + ], + [ + 537, + 538 + ], + [ + 545, + 549 + ], + [ + 550, + 552 + ], + [ + 553, + 554 + ], + [ + 557, + 558 + ], + [ + 559, + 565 + ], + [ + 591, + 592 + ], + [ + 621, + 624 + ], + [ + 633, + 634 + ], + [ + 637, + 643 + ], + [ + 647, + 648 + ], + [ + 649, + 650 + ], + [ + 651, + 652 + ], + [ + 653, + 654 + ], + [ + 660, + 661 + ], + [ + 666, + 667 + ], + [ + 669, + 673 + ], + [ + 677, + 678 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 685, + 690 + ], + [ + 691, + 692 + ], + [ + 698, + 708 + ], + [ + 712, + 717 + ], + [ + 718, + 719 + ], + [ + 722, + 723 + ], + [ + 725, + 729 + ], + [ + 730, + 731 + ], + [ + 738, + 739 + ], + [ + 741, + 744 + ], + [ + 745, + 746 + ], + [ + 749, + 751 + ], + [ + 752, + 755 + ], + [ + 757, + 758 + ], + [ + 760, + 761 + ], + [ + 763, + 764 + ], + [ + 765, + 768 + ], + [ + 770, + 773 + ], + [ + 774, + 776 + ], + [ + 777, + 779 + ], + [ + 781, + 782 + ], + [ + 788, + 789 + ], + [ + 791, + 794 + ], + [ + 796, + 797 + ], + [ + 803, + 804 + ], + [ + 805, + 807 + ], + [ + 808, + 809 + ], + [ + 816, + 817 + ], + [ + 819, + 822 + ], + [ + 827, + 828 + ], + [ + 830, + 833 + ], + [ + 835, + 836 + ], + [ + 841, + 842 + ], + [ + 845, + 848 + ], + [ + 849, + 850 + ], + [ + 855, + 856 + ], + [ + 857, + 859 + ], + [ + 860, + 863 + ], + [ + 865, + 866 + ], + [ + 871, + 872 + ], + [ + 873, + 875 + ], + [ + 876, + 877 + ], + [ + 882, + 883 + ], + [ + 884, + 886 + ], + [ + 887, + 890 + ], + [ + 892, + 893 + ], + [ + 898, + 899 + ], + [ + 900, + 902 + ], + [ + 903, + 904 + ], + [ + 909, + 910 + ], + [ + 911, + 913 + ], + [ + 914, + 918 + ], + [ + 920, + 921 + ], + [ + 926, + 927 + ], + [ + 933, + 935 + ], + [ + 937, + 939 + ], + [ + 945, + 946 + ], + [ + 951, + 952 + ], + [ + 958, + 959 + ], + [ + 963, + 964 + ], + [ + 966, + 968 + ], + [ + 970, + 972 + ], + [ + 976, + 977 + ], + [ + 979, + 980 + ], + [ + 985, + 986 + ], + [ + 992, + 994 + ], + [ + 997, + 1000 + ], + [ + 1001, + 1002 + ], + [ + 1007, + 1008 + ], + [ + 1016, + 1017 + ], + [ + 1023, + 1028 + ], + [ + 1033, + 1035 + ], + [ + 1039, + 1041 + ], + [ + 1046, + 1049 + ], + [ + 1051, + 1052 + ], + [ + 1057, + 1058 + ], + [ + 1061, + 1066 + ], + [ + 1068, + 1069 + ], + [ + 1072, + 1073 + ], + [ + 1076, + 1077 + ], + [ + 1079, + 1083 + ], + [ + 1084, + 1085 + ], + [ + 1088, + 1092 + ], + [ + 1096, + 1097 + ], + [ + 1102, + 1103 + ], + [ + 1109, + 1113 + ], + [ + 1114, + 1115 + ], + [ + 1120, + 1121 + ], + [ + 1127, + 1132 + ], + [ + 1133, + 1134 + ], + [ + 1139, + 1140 + ], + [ + 1143, + 1145 + ], + [ + 1157, + 1158 + ], + [ + 1160, + 1161 + ], + [ + 1163, + 1167 + ], + [ + 1172, + 1174 + ], + [ + 1177, + 1179 + ], + [ + 1182, + 1184 + ], + [ + 1187, + 1188 + ], + [ + 1193, + 1194 + ], + [ + 1201, + 1203 + ], + [ + 1206, + 1208 + ], + [ + 1210, + 1215 + ], + [ + 1219, + 1222 + ], + [ + 1223, + 1224 + ] + ] + } + }, + { + "filename": "libvips/deprecated/radiance.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 40, + 71 + ], + [ + 73, + 86 + ], + [ + 88, + 96 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 43, + 44 + ], + [ + 47, + 52 + ], + [ + 53, + 54 + ], + [ + 55, + 56 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 76, + 77 + ], + [ + 82, + 83 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ] + ] + } + }, + { + "filename": "libvips/deprecated/raw.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 44, + 70 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 47, + 49 + ], + [ + 52, + 59 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ] + ] + } + }, + { + "filename": "libvips/deprecated/rename.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 41, + 422 + ], + [ + 426, + 433 + ], + [ + 436, + 456 + ], + [ + 457, + 575 + ], + [ + 579, + 653 + ], + [ + 672, + 727 + ], + [ + 729, + 802 + ], + [ + 805, + 822 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 44, + 46 + ], + [ + 47, + 48 + ], + [ + 50, + 52 + ], + [ + 53, + 54 + ], + [ + 56, + 58 + ], + [ + 59, + 60 + ], + [ + 62, + 64 + ], + [ + 65, + 66 + ], + [ + 68, + 70 + ], + [ + 71, + 72 + ], + [ + 74, + 76 + ], + [ + 77, + 78 + ], + [ + 80, + 82 + ], + [ + 83, + 84 + ], + [ + 86, + 89 + ], + [ + 91, + 94 + ], + [ + 96, + 100 + ], + [ + 103, + 104 + ], + [ + 107, + 110 + ], + [ + 112, + 115 + ], + [ + 117, + 120 + ], + [ + 122, + 124 + ], + [ + 127, + 130 + ], + [ + 132, + 136 + ], + [ + 137, + 141 + ], + [ + 143, + 147 + ], + [ + 148, + 152 + ], + [ + 154, + 157 + ], + [ + 158, + 161 + ], + [ + 164, + 166 + ], + [ + 167, + 168 + ], + [ + 172, + 173 + ], + [ + 176, + 180 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 190, + 191 + ], + [ + 193, + 195 + ], + [ + 197, + 198 + ], + [ + 199, + 201 + ], + [ + 202, + 203 + ], + [ + 206, + 209 + ], + [ + 210, + 214 + ], + [ + 217, + 218 + ], + [ + 219, + 220 + ], + [ + 223, + 228 + ], + [ + 230, + 232 + ], + [ + 233, + 234 + ], + [ + 236, + 238 + ], + [ + 239, + 240 + ], + [ + 243, + 244 + ], + [ + 245, + 246 + ], + [ + 248, + 250 + ], + [ + 251, + 252 + ], + [ + 255, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 270 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 279, + 282 + ], + [ + 285, + 286 + ], + [ + 287, + 288 + ], + [ + 290, + 292 + ], + [ + 293, + 294 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 303, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 310 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 317, + 318 + ], + [ + 321, + 322 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ], + [ + 329, + 330 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 351, + 352 + ], + [ + 353, + 354 + ], + [ + 357, + 358 + ], + [ + 359, + 360 + ], + [ + 361, + 362 + ], + [ + 364, + 365 + ], + [ + 367, + 368 + ], + [ + 370, + 371 + ], + [ + 373, + 376 + ], + [ + 382, + 393 + ], + [ + 395, + 397 + ], + [ + 400, + 401 + ], + [ + 404, + 405 + ], + [ + 406, + 407 + ], + [ + 408, + 409 + ], + [ + 412, + 414 + ], + [ + 415, + 416 + ], + [ + 417, + 419 + ], + [ + 429, + 430 + ], + [ + 439, + 441 + ], + [ + 444, + 449 + ], + [ + 452, + 453 + ], + [ + 460, + 461 + ], + [ + 464, + 469 + ], + [ + 470, + 471 + ], + [ + 474, + 475 + ], + [ + 478, + 483 + ], + [ + 484, + 485 + ], + [ + 488, + 490 + ], + [ + 493, + 498 + ], + [ + 499, + 500 + ], + [ + 503, + 504 + ], + [ + 505, + 507 + ], + [ + 510, + 511 + ], + [ + 512, + 513 + ], + [ + 515, + 517 + ], + [ + 518, + 519 + ], + [ + 521, + 525 + ], + [ + 526, + 528 + ], + [ + 531, + 532 + ], + [ + 535, + 541 + ], + [ + 542, + 543 + ], + [ + 544, + 545 + ], + [ + 547, + 549 + ], + [ + 550, + 551 + ], + [ + 553, + 555 + ], + [ + 556, + 557 + ], + [ + 562, + 564 + ], + [ + 568, + 569 + ], + [ + 570, + 572 + ], + [ + 582, + 583 + ], + [ + 584, + 585 + ], + [ + 588, + 590 + ], + [ + 594, + 597 + ], + [ + 600, + 602 + ], + [ + 603, + 605 + ], + [ + 606, + 608 + ], + [ + 611, + 614 + ], + [ + 618, + 622 + ], + [ + 623, + 626 + ], + [ + 627, + 630 + ], + [ + 631, + 634 + ], + [ + 635, + 638 + ], + [ + 639, + 642 + ], + [ + 643, + 646 + ], + [ + 647, + 650 + ], + [ + 675, + 677 + ], + [ + 679, + 680 + ], + [ + 683, + 684 + ], + [ + 685, + 687 + ], + [ + 689, + 691 + ], + [ + 692, + 693 + ], + [ + 695, + 697 + ], + [ + 698, + 699 + ], + [ + 701, + 704 + ], + [ + 705, + 706 + ], + [ + 709, + 710 + ], + [ + 711, + 712 + ], + [ + 715, + 716 + ], + [ + 717, + 718 + ], + [ + 721, + 722 + ], + [ + 723, + 724 + ], + [ + 732, + 733 + ], + [ + 736, + 737 + ], + [ + 740, + 742 + ], + [ + 743, + 746 + ], + [ + 749, + 760 + ], + [ + 763, + 765 + ], + [ + 768, + 785 + ], + [ + 787, + 789 + ], + [ + 791, + 794 + ], + [ + 796, + 799 + ], + [ + 808, + 809 + ], + [ + 810, + 811 + ], + [ + 816, + 817 + ], + [ + 818, + 819 + ], + [ + 820, + 821 + ] + ] + } + }, + { + "filename": "libvips/deprecated/resample_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 45, + 107 + ], + [ + 112, + 153 + ], + [ + 154, + 235 + ], + [ + 245, + 251 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 48, + 53 + ], + [ + 58, + 59 + ], + [ + 60, + 65 + ], + [ + 66, + 67 + ], + [ + 72, + 78 + ], + [ + 83, + 96 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 115, + 117 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 128 + ], + [ + 133, + 142 + ], + [ + 147, + 148 + ], + [ + 149, + 150 + ], + [ + 157, + 159 + ], + [ + 162, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 170 + ], + [ + 175, + 179 + ], + [ + 184, + 185 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 201 + ], + [ + 206, + 210 + ], + [ + 215, + 216 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 228, + 232 + ], + [ + 248, + 249 + ] + ] + } + }, + { + "filename": "libvips/deprecated/rotmask.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 44 + ], + [ + 59, + 156 + ] + ], + "lines_added": [ + [ + 19, + 35 + ], + [ + 40, + 41 + ], + [ + 62, + 63 + ], + [ + 67, + 68 + ], + [ + 74, + 84 + ], + [ + 85, + 86 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 100, + 108 + ], + [ + 109, + 110 + ], + [ + 114, + 115 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 129, + 131 + ], + [ + 134, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ] + ] + } + }, + { + "filename": "libvips/deprecated/rw_mask.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 21 + ], + [ + 43, + 50 + ], + [ + 58, + 86 + ], + [ + 106, + 117 + ], + [ + 128, + 138 + ], + [ + 156, + 172 + ], + [ + 180, + 196 + ], + [ + 198, + 227 + ], + [ + 228, + 247 + ], + [ + 257, + 279 + ], + [ + 281, + 310 + ], + [ + 311, + 330 + ], + [ + 340, + 421 + ], + [ + 423, + 430 + ], + [ + 433, + 451 + ], + [ + 457, + 464 + ], + [ + 466, + 503 + ], + [ + 514, + 562 + ], + [ + 570, + 619 + ], + [ + 620, + 650 + ], + [ + 658, + 681 + ], + [ + 688, + 707 + ], + [ + 719, + 741 + ], + [ + 749, + 798 + ], + [ + 806, + 842 + ], + [ + 848, + 863 + ], + [ + 871, + 913 + ], + [ + 920, + 987 + ], + [ + 992, + 1011 + ], + [ + 1016, + 1035 + ], + [ + 1045, + 1063 + ], + [ + 1072, + 1088 + ] + ], + "lines_added": [ + [ + 14, + 15 + ], + [ + 17, + 18 + ], + [ + 46, + 47 + ], + [ + 61, + 62 + ], + [ + 63, + 67 + ], + [ + 68, + 77 + ], + [ + 82, + 83 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 159, + 163 + ], + [ + 164, + 167 + ], + [ + 168, + 169 + ], + [ + 183, + 184 + ], + [ + 185, + 187 + ], + [ + 188, + 191 + ], + [ + 192, + 193 + ], + [ + 201, + 202 + ], + [ + 208, + 210 + ], + [ + 215, + 218 + ], + [ + 222, + 224 + ], + [ + 231, + 234 + ], + [ + 235, + 239 + ], + [ + 240, + 241 + ], + [ + 243, + 244 + ], + [ + 260, + 261 + ], + [ + 267, + 269 + ], + [ + 270, + 274 + ], + [ + 275, + 276 + ], + [ + 284, + 285 + ], + [ + 291, + 293 + ], + [ + 298, + 301 + ], + [ + 305, + 307 + ], + [ + 314, + 317 + ], + [ + 318, + 322 + ], + [ + 323, + 324 + ], + [ + 326, + 327 + ], + [ + 343, + 345 + ], + [ + 350, + 352 + ], + [ + 353, + 357 + ], + [ + 358, + 359 + ], + [ + 361, + 362 + ], + [ + 364, + 365 + ], + [ + 366, + 369 + ], + [ + 371, + 372 + ], + [ + 377, + 378 + ], + [ + 384, + 386 + ], + [ + 387, + 389 + ], + [ + 394, + 403 + ], + [ + 404, + 408 + ], + [ + 409, + 413 + ], + [ + 417, + 418 + ], + [ + 426, + 427 + ], + [ + 436, + 437 + ], + [ + 441, + 443 + ], + [ + 447, + 448 + ], + [ + 460, + 461 + ], + [ + 469, + 471 + ], + [ + 472, + 475 + ], + [ + 477, + 480 + ], + [ + 484, + 485 + ], + [ + 487, + 491 + ], + [ + 493, + 496 + ], + [ + 497, + 498 + ], + [ + 499, + 500 + ], + [ + 517, + 518 + ], + [ + 523, + 525 + ], + [ + 526, + 531 + ], + [ + 532, + 533 + ], + [ + 535, + 539 + ], + [ + 540, + 542 + ], + [ + 543, + 544 + ], + [ + 546, + 550 + ], + [ + 553, + 554 + ], + [ + 556, + 557 + ], + [ + 558, + 559 + ], + [ + 573, + 574 + ], + [ + 578, + 579 + ], + [ + 582, + 585 + ], + [ + 589, + 591 + ], + [ + 595, + 597 + ], + [ + 603, + 605 + ], + [ + 608, + 609 + ], + [ + 610, + 611 + ], + [ + 613, + 614 + ], + [ + 615, + 616 + ], + [ + 623, + 624 + ], + [ + 630, + 631 + ], + [ + 637, + 640 + ], + [ + 641, + 645 + ], + [ + 646, + 647 + ], + [ + 661, + 662 + ], + [ + 668, + 671 + ], + [ + 672, + 673 + ], + [ + 677, + 678 + ], + [ + 691, + 694 + ], + [ + 699, + 701 + ], + [ + 703, + 704 + ], + [ + 722, + 723 + ], + [ + 727, + 730 + ], + [ + 731, + 732 + ], + [ + 734, + 735 + ], + [ + 737, + 738 + ], + [ + 752, + 753 + ], + [ + 757, + 760 + ], + [ + 761, + 762 + ], + [ + 764, + 765 + ], + [ + 767, + 768 + ], + [ + 772, + 774 + ], + [ + 777, + 781 + ], + [ + 782, + 783 + ], + [ + 784, + 785 + ], + [ + 787, + 789 + ], + [ + 792, + 793 + ], + [ + 794, + 795 + ], + [ + 809, + 811 + ], + [ + 815, + 818 + ], + [ + 819, + 822 + ], + [ + 823, + 826 + ], + [ + 827, + 830 + ], + [ + 831, + 834 + ], + [ + 836, + 837 + ], + [ + 838, + 839 + ], + [ + 851, + 853 + ], + [ + 854, + 857 + ], + [ + 859, + 860 + ], + [ + 874, + 876 + ], + [ + 880, + 883 + ], + [ + 884, + 887 + ], + [ + 888, + 893 + ], + [ + 894, + 895 + ], + [ + 896, + 900 + ], + [ + 902, + 905 + ], + [ + 907, + 908 + ], + [ + 909, + 910 + ], + [ + 923, + 925 + ], + [ + 926, + 929 + ], + [ + 931, + 932 + ], + [ + 937, + 940 + ], + [ + 943, + 945 + ], + [ + 950, + 953 + ], + [ + 956, + 958 + ], + [ + 963, + 966 + ], + [ + 969, + 971 + ], + [ + 976, + 979 + ], + [ + 982, + 984 + ], + [ + 995, + 997 + ], + [ + 998, + 999 + ], + [ + 1000, + 1002 + ], + [ + 1003, + 1006 + ], + [ + 1007, + 1008 + ], + [ + 1019, + 1021 + ], + [ + 1022, + 1023 + ], + [ + 1024, + 1026 + ], + [ + 1027, + 1030 + ], + [ + 1031, + 1032 + ], + [ + 1048, + 1049 + ], + [ + 1050, + 1052 + ], + [ + 1053, + 1057 + ], + [ + 1059, + 1060 + ], + [ + 1075, + 1076 + ], + [ + 1077, + 1079 + ], + [ + 1080, + 1084 + ], + [ + 1086, + 1087 + ] + ] + } + }, + { + "filename": "libvips/deprecated/tone.c", + "line_filter": { + "diff_chunks": [ + [ + 17, + 45 + ], + [ + 61, + 68 + ], + [ + 71, + 133 + ], + [ + 141, + 189 + ] + ], + "lines_added": [ + [ + 20, + 36 + ], + [ + 41, + 42 + ], + [ + 64, + 65 + ], + [ + 74, + 75 + ], + [ + 78, + 81 + ], + [ + 84, + 87 + ], + [ + 93, + 98 + ], + [ + 102, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 110 + ], + [ + 116, + 119 + ], + [ + 120, + 121 + ], + [ + 122, + 124 + ], + [ + 128, + 130 + ], + [ + 144, + 148 + ], + [ + 149, + 150 + ], + [ + 155, + 157 + ], + [ + 160, + 163 + ], + [ + 169, + 173 + ], + [ + 174, + 177 + ], + [ + 178, + 181 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ] + ] + } + }, + { + "filename": "libvips/deprecated/video_dispatch.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 45 + ], + [ + 49, + 122 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 42 + ], + [ + 52, + 53 + ], + [ + 54, + 65 + ], + [ + 68, + 76 + ], + [ + 79, + 85 + ], + [ + 88, + 89 + ], + [ + 90, + 93 + ], + [ + 94, + 95 + ], + [ + 98, + 101 + ], + [ + 104, + 110 + ], + [ + 113, + 115 + ], + [ + 118, + 121 + ] + ] + } + }, + { + "filename": "libvips/deprecated/vips7compat.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 73, + 165 + ], + [ + 170, + 182 + ], + [ + 183, + 238 + ], + [ + 239, + 300 + ], + [ + 301, + 377 + ], + [ + 380, + 490 + ], + [ + 492, + 583 + ], + [ + 585, + 606 + ], + [ + 608, + 678 + ], + [ + 681, + 688 + ], + [ + 691, + 769 + ], + [ + 770, + 855 + ], + [ + 868, + 935 + ], + [ + 938, + 993 + ], + [ + 995, + 3466 + ], + [ + 3468, + 3911 + ], + [ + 3916, + 4593 + ], + [ + 4595, + 4712 + ], + [ + 4728, + 4740 + ], + [ + 4750, + 4989 + ], + [ + 4993, + 5010 + ], + [ + 5012, + 5096 + ], + [ + 5098, + 5127 + ], + [ + 5129, + 5551 + ], + [ + 5552, + 5593 + ], + [ + 5600, + 5618 + ], + [ + 5619, + 5821 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 4, + 5 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 86 + ], + [ + 87, + 89 + ], + [ + 92, + 94 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 109, + 110 + ], + [ + 115, + 117 + ], + [ + 121, + 122 + ], + [ + 123, + 128 + ], + [ + 130, + 131 + ], + [ + 137, + 138 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 147, + 148 + ], + [ + 154, + 155 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 173, + 174 + ], + [ + 177, + 179 + ], + [ + 186, + 187 + ], + [ + 190, + 191 + ], + [ + 195, + 196 + ], + [ + 197, + 199 + ], + [ + 201, + 202 + ], + [ + 208, + 209 + ], + [ + 212, + 213 + ], + [ + 214, + 219 + ], + [ + 224, + 225 + ], + [ + 229, + 233 + ], + [ + 234, + 235 + ], + [ + 242, + 243 + ], + [ + 244, + 246 + ], + [ + 247, + 249 + ], + [ + 250, + 252 + ], + [ + 256, + 258 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 267, + 279 + ], + [ + 280, + 284 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 296, + 297 + ], + [ + 304, + 307 + ], + [ + 309, + 310 + ], + [ + 313, + 314 + ], + [ + 317, + 318 + ], + [ + 324, + 328 + ], + [ + 329, + 332 + ], + [ + 333, + 336 + ], + [ + 338, + 340 + ], + [ + 342, + 343 + ], + [ + 348, + 350 + ], + [ + 353, + 356 + ], + [ + 357, + 358 + ], + [ + 363, + 364 + ], + [ + 365, + 366 + ], + [ + 369, + 372 + ], + [ + 373, + 374 + ], + [ + 383, + 384 + ], + [ + 385, + 387 + ], + [ + 389, + 392 + ], + [ + 395, + 396 + ], + [ + 399, + 401 + ], + [ + 402, + 403 + ], + [ + 406, + 407 + ], + [ + 408, + 410 + ], + [ + 412, + 415 + ], + [ + 418, + 419 + ], + [ + 422, + 424 + ], + [ + 425, + 426 + ], + [ + 432, + 434 + ], + [ + 437, + 447 + ], + [ + 449, + 450 + ], + [ + 456, + 458 + ], + [ + 461, + 464 + ], + [ + 465, + 466 + ], + [ + 469, + 470 + ], + [ + 471, + 472 + ], + [ + 473, + 474 + ], + [ + 479, + 480 + ], + [ + 484, + 485 + ], + [ + 486, + 487 + ], + [ + 495, + 496 + ], + [ + 497, + 498 + ], + [ + 503, + 528 + ], + [ + 532, + 559 + ], + [ + 563, + 572 + ], + [ + 577, + 580 + ], + [ + 588, + 595 + ], + [ + 600, + 603 + ], + [ + 611, + 612 + ], + [ + 617, + 622 + ], + [ + 623, + 626 + ], + [ + 627, + 628 + ], + [ + 630, + 655 + ], + [ + 658, + 668 + ], + [ + 673, + 675 + ], + [ + 684, + 685 + ], + [ + 694, + 699 + ], + [ + 700, + 701 + ], + [ + 704, + 705 + ], + [ + 710, + 711 + ], + [ + 715, + 717 + ], + [ + 720, + 723 + ], + [ + 725, + 726 + ], + [ + 731, + 732 + ], + [ + 736, + 737 + ], + [ + 738, + 740 + ], + [ + 743, + 744 + ], + [ + 747, + 748 + ], + [ + 754, + 755 + ], + [ + 756, + 759 + ], + [ + 763, + 766 + ], + [ + 773, + 778 + ], + [ + 782, + 784 + ], + [ + 789, + 792 + ], + [ + 795, + 799 + ], + [ + 800, + 801 + ], + [ + 804, + 805 + ], + [ + 806, + 807 + ], + [ + 810, + 811 + ], + [ + 817, + 818 + ], + [ + 821, + 823 + ], + [ + 824, + 826 + ], + [ + 829, + 830 + ], + [ + 831, + 833 + ], + [ + 836, + 838 + ], + [ + 842, + 843 + ], + [ + 846, + 849 + ], + [ + 850, + 852 + ], + [ + 871, + 878 + ], + [ + 883, + 884 + ], + [ + 885, + 887 + ], + [ + 889, + 891 + ], + [ + 892, + 893 + ], + [ + 894, + 895 + ], + [ + 896, + 898 + ], + [ + 900, + 902 + ], + [ + 903, + 904 + ], + [ + 905, + 906 + ], + [ + 908, + 909 + ], + [ + 912, + 913 + ], + [ + 917, + 918 + ], + [ + 920, + 922 + ], + [ + 923, + 926 + ], + [ + 927, + 928 + ], + [ + 931, + 932 + ], + [ + 941, + 942 + ], + [ + 947, + 948 + ], + [ + 952, + 957 + ], + [ + 958, + 961 + ], + [ + 963, + 964 + ], + [ + 966, + 967 + ], + [ + 970, + 971 + ], + [ + 975, + 976 + ], + [ + 978, + 983 + ], + [ + 984, + 985 + ], + [ + 988, + 990 + ], + [ + 998, + 1000 + ], + [ + 1001, + 1002 + ], + [ + 1005, + 1007 + ], + [ + 1013, + 1014 + ], + [ + 1015, + 1019 + ], + [ + 1022, + 1023 + ], + [ + 1026, + 1027 + ], + [ + 1030, + 1034 + ], + [ + 1037, + 1042 + ], + [ + 1045, + 1047 + ], + [ + 1050, + 1055 + ], + [ + 1056, + 1057 + ], + [ + 1058, + 1059 + ], + [ + 1061, + 1063 + ], + [ + 1066, + 1071 + ], + [ + 1072, + 1073 + ], + [ + 1074, + 1075 + ], + [ + 1077, + 1079 + ], + [ + 1082, + 1087 + ], + [ + 1088, + 1089 + ], + [ + 1090, + 1091 + ], + [ + 1093, + 1095 + ], + [ + 1098, + 1103 + ], + [ + 1104, + 1105 + ], + [ + 1106, + 1107 + ], + [ + 1110, + 1111 + ], + [ + 1112, + 1113 + ], + [ + 1116, + 1117 + ], + [ + 1118, + 1119 + ], + [ + 1121, + 1123 + ], + [ + 1124, + 1125 + ], + [ + 1126, + 1128 + ], + [ + 1131, + 1132 + ], + [ + 1133, + 1134 + ], + [ + 1137, + 1138 + ], + [ + 1139, + 1140 + ], + [ + 1143, + 1144 + ], + [ + 1145, + 1146 + ], + [ + 1149, + 1150 + ], + [ + 1151, + 1152 + ], + [ + 1156, + 1157 + ], + [ + 1158, + 1161 + ], + [ + 1162, + 1170 + ], + [ + 1171, + 1172 + ], + [ + 1173, + 1174 + ], + [ + 1177, + 1178 + ], + [ + 1179, + 1182 + ], + [ + 1183, + 1191 + ], + [ + 1192, + 1193 + ], + [ + 1196, + 1197 + ], + [ + 1198, + 1199 + ], + [ + 1201, + 1204 + ], + [ + 1207, + 1218 + ], + [ + 1219, + 1220 + ], + [ + 1221, + 1222 + ], + [ + 1224, + 1227 + ], + [ + 1230, + 1239 + ], + [ + 1240, + 1241 + ], + [ + 1242, + 1243 + ], + [ + 1246, + 1247 + ], + [ + 1248, + 1249 + ], + [ + 1252, + 1253 + ], + [ + 1256, + 1261 + ], + [ + 1262, + 1263 + ], + [ + 1264, + 1265 + ], + [ + 1268, + 1269 + ], + [ + 1270, + 1273 + ], + [ + 1274, + 1275 + ], + [ + 1278, + 1279 + ], + [ + 1280, + 1282 + ], + [ + 1283, + 1284 + ], + [ + 1287, + 1288 + ], + [ + 1291, + 1298 + ], + [ + 1299, + 1300 + ], + [ + 1301, + 1302 + ], + [ + 1304, + 1306 + ], + [ + 1309, + 1314 + ], + [ + 1315, + 1316 + ], + [ + 1317, + 1318 + ], + [ + 1320, + 1322 + ], + [ + 1325, + 1330 + ], + [ + 1331, + 1332 + ], + [ + 1333, + 1334 + ], + [ + 1336, + 1338 + ], + [ + 1341, + 1346 + ], + [ + 1347, + 1348 + ], + [ + 1349, + 1350 + ], + [ + 1352, + 1354 + ], + [ + 1357, + 1362 + ], + [ + 1363, + 1364 + ], + [ + 1365, + 1366 + ], + [ + 1368, + 1370 + ], + [ + 1373, + 1378 + ], + [ + 1379, + 1380 + ], + [ + 1381, + 1382 + ], + [ + 1384, + 1386 + ], + [ + 1389, + 1396 + ], + [ + 1397, + 1398 + ], + [ + 1399, + 1400 + ], + [ + 1402, + 1404 + ], + [ + 1407, + 1412 + ], + [ + 1413, + 1414 + ], + [ + 1415, + 1416 + ], + [ + 1418, + 1420 + ], + [ + 1423, + 1429 + ], + [ + 1430, + 1431 + ], + [ + 1432, + 1433 + ], + [ + 1435, + 1437 + ], + [ + 1440, + 1446 + ], + [ + 1447, + 1448 + ], + [ + 1449, + 1450 + ], + [ + 1453, + 1455 + ], + [ + 1458, + 1464 + ], + [ + 1465, + 1466 + ], + [ + 1467, + 1468 + ], + [ + 1470, + 1472 + ], + [ + 1475, + 1482 + ], + [ + 1483, + 1484 + ], + [ + 1485, + 1486 + ], + [ + 1488, + 1490 + ], + [ + 1491, + 1492 + ], + [ + 1495, + 1497 + ], + [ + 1500, + 1503 + ], + [ + 1504, + 1509 + ], + [ + 1510, + 1511 + ], + [ + 1512, + 1515 + ], + [ + 1516, + 1517 + ], + [ + 1518, + 1519 + ], + [ + 1521, + 1523 + ], + [ + 1526, + 1532 + ], + [ + 1533, + 1534 + ], + [ + 1535, + 1536 + ], + [ + 1538, + 1540 + ], + [ + 1543, + 1549 + ], + [ + 1550, + 1551 + ], + [ + 1552, + 1553 + ], + [ + 1555, + 1557 + ], + [ + 1560, + 1561 + ], + [ + 1562, + 1563 + ], + [ + 1565, + 1567 + ], + [ + 1570, + 1576 + ], + [ + 1577, + 1578 + ], + [ + 1579, + 1580 + ], + [ + 1582, + 1584 + ], + [ + 1587, + 1593 + ], + [ + 1594, + 1595 + ], + [ + 1596, + 1597 + ], + [ + 1600, + 1601 + ], + [ + 1604, + 1611 + ], + [ + 1612, + 1613 + ], + [ + 1614, + 1615 + ], + [ + 1618, + 1619 + ], + [ + 1620, + 1621 + ], + [ + 1623, + 1625 + ], + [ + 1628, + 1634 + ], + [ + 1635, + 1636 + ], + [ + 1637, + 1638 + ], + [ + 1640, + 1642 + ], + [ + 1645, + 1651 + ], + [ + 1652, + 1653 + ], + [ + 1654, + 1655 + ], + [ + 1657, + 1659 + ], + [ + 1662, + 1668 + ], + [ + 1669, + 1670 + ], + [ + 1671, + 1672 + ], + [ + 1674, + 1676 + ], + [ + 1679, + 1685 + ], + [ + 1686, + 1687 + ], + [ + 1688, + 1689 + ], + [ + 1691, + 1693 + ], + [ + 1696, + 1702 + ], + [ + 1703, + 1704 + ], + [ + 1705, + 1706 + ], + [ + 1708, + 1710 + ], + [ + 1713, + 1719 + ], + [ + 1720, + 1721 + ], + [ + 1722, + 1723 + ], + [ + 1725, + 1727 + ], + [ + 1730, + 1737 + ], + [ + 1738, + 1739 + ], + [ + 1740, + 1741 + ], + [ + 1743, + 1745 + ], + [ + 1748, + 1757 + ], + [ + 1758, + 1759 + ], + [ + 1760, + 1761 + ], + [ + 1763, + 1765 + ], + [ + 1768, + 1775 + ], + [ + 1776, + 1777 + ], + [ + 1778, + 1779 + ], + [ + 1781, + 1783 + ], + [ + 1786, + 1794 + ], + [ + 1795, + 1796 + ], + [ + 1797, + 1798 + ], + [ + 1800, + 1802 + ], + [ + 1805, + 1810 + ], + [ + 1811, + 1812 + ], + [ + 1813, + 1814 + ], + [ + 1816, + 1818 + ], + [ + 1821, + 1826 + ], + [ + 1827, + 1828 + ], + [ + 1829, + 1830 + ], + [ + 1832, + 1834 + ], + [ + 1837, + 1842 + ], + [ + 1843, + 1844 + ], + [ + 1845, + 1846 + ], + [ + 1848, + 1850 + ], + [ + 1853, + 1858 + ], + [ + 1859, + 1860 + ], + [ + 1861, + 1862 + ], + [ + 1865, + 1866 + ], + [ + 1869, + 1874 + ], + [ + 1875, + 1876 + ], + [ + 1877, + 1878 + ], + [ + 1881, + 1882 + ], + [ + 1885, + 1892 + ], + [ + 1893, + 1894 + ], + [ + 1895, + 1896 + ], + [ + 1899, + 1900 + ], + [ + 1903, + 1908 + ], + [ + 1909, + 1910 + ], + [ + 1911, + 1912 + ], + [ + 1914, + 1916 + ], + [ + 1919, + 1927 + ], + [ + 1928, + 1929 + ], + [ + 1930, + 1931 + ], + [ + 1933, + 1936 + ], + [ + 1939, + 1949 + ], + [ + 1950, + 1951 + ], + [ + 1952, + 1953 + ], + [ + 1955, + 1957 + ], + [ + 1962, + 1963 + ], + [ + 1966, + 1973 + ], + [ + 1975, + 1976 + ], + [ + 1977, + 1978 + ], + [ + 1980, + 1981 + ], + [ + 1984, + 1985 + ], + [ + 1986, + 1987 + ], + [ + 1990, + 1991 + ], + [ + 1992, + 1993 + ], + [ + 1996, + 1997 + ], + [ + 1998, + 2007 + ], + [ + 2009, + 2010 + ], + [ + 2011, + 2012 + ], + [ + 2014, + 2015 + ], + [ + 2016, + 2017 + ], + [ + 2020, + 2021 + ], + [ + 2024, + 2029 + ], + [ + 2030, + 2031 + ], + [ + 2032, + 2033 + ], + [ + 2036, + 2037 + ], + [ + 2038, + 2039 + ], + [ + 2041, + 2043 + ], + [ + 2046, + 2051 + ], + [ + 2052, + 2053 + ], + [ + 2054, + 2055 + ], + [ + 2057, + 2059 + ], + [ + 2062, + 2067 + ], + [ + 2068, + 2069 + ], + [ + 2070, + 2071 + ], + [ + 2073, + 2075 + ], + [ + 2078, + 2083 + ], + [ + 2084, + 2085 + ], + [ + 2086, + 2087 + ], + [ + 2090, + 2091 + ], + [ + 2094, + 2100 + ], + [ + 2101, + 2102 + ], + [ + 2103, + 2104 + ], + [ + 2106, + 2108 + ], + [ + 2109, + 2110 + ], + [ + 2112, + 2114 + ], + [ + 2115, + 2116 + ], + [ + 2118, + 2120 + ], + [ + 2121, + 2122 + ], + [ + 2124, + 2126 + ], + [ + 2127, + 2128 + ], + [ + 2130, + 2132 + ], + [ + 2133, + 2134 + ], + [ + 2136, + 2138 + ], + [ + 2139, + 2140 + ], + [ + 2142, + 2144 + ], + [ + 2145, + 2146 + ], + [ + 2148, + 2150 + ], + [ + 2151, + 2152 + ], + [ + 2154, + 2156 + ], + [ + 2157, + 2158 + ], + [ + 2160, + 2162 + ], + [ + 2163, + 2164 + ], + [ + 2167, + 2168 + ], + [ + 2172, + 2178 + ], + [ + 2179, + 2180 + ], + [ + 2181, + 2182 + ], + [ + 2185, + 2186 + ], + [ + 2190, + 2197 + ], + [ + 2198, + 2199 + ], + [ + 2200, + 2201 + ], + [ + 2204, + 2205 + ], + [ + 2209, + 2217 + ], + [ + 2218, + 2219 + ], + [ + 2220, + 2221 + ], + [ + 2224, + 2225 + ], + [ + 2229, + 2234 + ], + [ + 2235, + 2236 + ], + [ + 2237, + 2238 + ], + [ + 2241, + 2242 + ], + [ + 2246, + 2253 + ], + [ + 2254, + 2255 + ], + [ + 2256, + 2257 + ], + [ + 2260, + 2261 + ], + [ + 2265, + 2270 + ], + [ + 2271, + 2272 + ], + [ + 2273, + 2274 + ], + [ + 2277, + 2278 + ], + [ + 2282, + 2289 + ], + [ + 2290, + 2291 + ], + [ + 2292, + 2293 + ], + [ + 2295, + 2297 + ], + [ + 2300, + 2307 + ], + [ + 2308, + 2312 + ], + [ + 2313, + 2314 + ], + [ + 2315, + 2316 + ], + [ + 2318, + 2320 + ], + [ + 2323, + 2333 + ], + [ + 2334, + 2338 + ], + [ + 2339, + 2340 + ], + [ + 2341, + 2342 + ], + [ + 2344, + 2346 + ], + [ + 2349, + 2359 + ], + [ + 2360, + 2364 + ], + [ + 2365, + 2366 + ], + [ + 2367, + 2368 + ], + [ + 2371, + 2372 + ], + [ + 2375, + 2386 + ], + [ + 2387, + 2391 + ], + [ + 2392, + 2393 + ], + [ + 2394, + 2395 + ], + [ + 2398, + 2399 + ], + [ + 2400, + 2402 + ], + [ + 2404, + 2406 + ], + [ + 2409, + 2417 + ], + [ + 2418, + 2422 + ], + [ + 2423, + 2424 + ], + [ + 2425, + 2426 + ], + [ + 2429, + 2430 + ], + [ + 2431, + 2433 + ], + [ + 2435, + 2437 + ], + [ + 2440, + 2446 + ], + [ + 2447, + 2451 + ], + [ + 2452, + 2453 + ], + [ + 2454, + 2455 + ], + [ + 2457, + 2459 + ], + [ + 2462, + 2469 + ], + [ + 2470, + 2474 + ], + [ + 2475, + 2476 + ], + [ + 2477, + 2478 + ], + [ + 2481, + 2482 + ], + [ + 2483, + 2485 + ], + [ + 2487, + 2489 + ], + [ + 2492, + 2499 + ], + [ + 2500, + 2504 + ], + [ + 2505, + 2506 + ], + [ + 2507, + 2508 + ], + [ + 2510, + 2512 + ], + [ + 2515, + 2523 + ], + [ + 2524, + 2528 + ], + [ + 2529, + 2530 + ], + [ + 2531, + 2532 + ], + [ + 2534, + 2537 + ], + [ + 2540, + 2549 + ], + [ + 2550, + 2554 + ], + [ + 2555, + 2556 + ], + [ + 2557, + 2558 + ], + [ + 2561, + 2562 + ], + [ + 2563, + 2565 + ], + [ + 2568, + 2569 + ], + [ + 2572, + 2576 + ], + [ + 2577, + 2578 + ], + [ + 2581, + 2582 + ], + [ + 2583, + 2585 + ], + [ + 2588, + 2589 + ], + [ + 2590, + 2591 + ], + [ + 2593, + 2594 + ], + [ + 2595, + 2598 + ], + [ + 2601, + 2604 + ], + [ + 2605, + 2608 + ], + [ + 2609, + 2610 + ], + [ + 2611, + 2613 + ], + [ + 2614, + 2619 + ], + [ + 2620, + 2624 + ], + [ + 2625, + 2626 + ], + [ + 2629, + 2630 + ], + [ + 2631, + 2633 + ], + [ + 2636, + 2637 + ], + [ + 2640, + 2645 + ], + [ + 2646, + 2647 + ], + [ + 2648, + 2649 + ], + [ + 2652, + 2653 + ], + [ + 2654, + 2656 + ], + [ + 2659, + 2660 + ], + [ + 2663, + 2668 + ], + [ + 2669, + 2670 + ], + [ + 2671, + 2672 + ], + [ + 2675, + 2679 + ], + [ + 2680, + 2682 + ], + [ + 2684, + 2685 + ], + [ + 2686, + 2700 + ], + [ + 2703, + 2704 + ], + [ + 2707, + 2713 + ], + [ + 2714, + 2715 + ], + [ + 2716, + 2717 + ], + [ + 2719, + 2721 + ], + [ + 2722, + 2723 + ], + [ + 2725, + 2727 + ], + [ + 2728, + 2729 + ], + [ + 2731, + 2733 + ], + [ + 2734, + 2735 + ], + [ + 2737, + 2740 + ], + [ + 2743, + 2749 + ], + [ + 2750, + 2751 + ], + [ + 2752, + 2753 + ], + [ + 2755, + 2757 + ], + [ + 2758, + 2760 + ], + [ + 2762, + 2764 + ], + [ + 2765, + 2767 + ], + [ + 2769, + 2771 + ], + [ + 2772, + 2774 + ], + [ + 2776, + 2778 + ], + [ + 2779, + 2781 + ], + [ + 2783, + 2785 + ], + [ + 2786, + 2788 + ], + [ + 2790, + 2792 + ], + [ + 2793, + 2795 + ], + [ + 2797, + 2800 + ], + [ + 2803, + 2809 + ], + [ + 2810, + 2811 + ], + [ + 2812, + 2813 + ], + [ + 2815, + 2817 + ], + [ + 2818, + 2820 + ], + [ + 2822, + 2824 + ], + [ + 2825, + 2827 + ], + [ + 2829, + 2831 + ], + [ + 2832, + 2834 + ], + [ + 2836, + 2838 + ], + [ + 2839, + 2841 + ], + [ + 2843, + 2845 + ], + [ + 2846, + 2848 + ], + [ + 2850, + 2852 + ], + [ + 2853, + 2855 + ], + [ + 2857, + 2859 + ], + [ + 2860, + 2861 + ], + [ + 2864, + 2865 + ], + [ + 2866, + 2867 + ], + [ + 2870, + 2871 + ], + [ + 2872, + 2873 + ], + [ + 2876, + 2877 + ], + [ + 2878, + 2879 + ], + [ + 2882, + 2883 + ], + [ + 2884, + 2885 + ], + [ + 2888, + 2889 + ], + [ + 2890, + 2891 + ], + [ + 2893, + 2895 + ], + [ + 2898, + 2904 + ], + [ + 2905, + 2906 + ], + [ + 2907, + 2908 + ], + [ + 2910, + 2912 + ], + [ + 2915, + 2921 + ], + [ + 2922, + 2923 + ], + [ + 2924, + 2925 + ], + [ + 2927, + 2929 + ], + [ + 2930, + 2931 + ], + [ + 2933, + 2936 + ], + [ + 2939, + 2945 + ], + [ + 2946, + 2947 + ], + [ + 2948, + 2949 + ], + [ + 2951, + 2953 + ], + [ + 2954, + 2955 + ], + [ + 2957, + 2959 + ], + [ + 2960, + 2961 + ], + [ + 2963, + 2965 + ], + [ + 2966, + 2967 + ], + [ + 2969, + 2972 + ], + [ + 2975, + 2981 + ], + [ + 2982, + 2983 + ], + [ + 2984, + 2985 + ], + [ + 2987, + 2989 + ], + [ + 2990, + 2992 + ], + [ + 2994, + 2996 + ], + [ + 2997, + 2999 + ], + [ + 3001, + 3003 + ], + [ + 3004, + 3006 + ], + [ + 3008, + 3010 + ], + [ + 3011, + 3013 + ], + [ + 3015, + 3017 + ], + [ + 3018, + 3020 + ], + [ + 3022, + 3024 + ], + [ + 3025, + 3026 + ], + [ + 3028, + 3030 + ], + [ + 3031, + 3032 + ], + [ + 3034, + 3036 + ], + [ + 3037, + 3038 + ], + [ + 3040, + 3042 + ], + [ + 3045, + 3046 + ], + [ + 3048, + 3050 + ], + [ + 3053, + 3054 + ], + [ + 3056, + 3059 + ], + [ + 3062, + 3068 + ], + [ + 3069, + 3070 + ], + [ + 3071, + 3072 + ], + [ + 3074, + 3076 + ], + [ + 3077, + 3078 + ], + [ + 3080, + 3082 + ], + [ + 3083, + 3084 + ], + [ + 3086, + 3088 + ], + [ + 3089, + 3090 + ], + [ + 3092, + 3094 + ], + [ + 3095, + 3096 + ], + [ + 3098, + 3100 + ], + [ + 3103, + 3109 + ], + [ + 3110, + 3111 + ], + [ + 3112, + 3113 + ], + [ + 3115, + 3117 + ], + [ + 3120, + 3127 + ], + [ + 3128, + 3129 + ], + [ + 3130, + 3131 + ], + [ + 3134, + 3135 + ], + [ + 3138, + 3144 + ], + [ + 3145, + 3146 + ], + [ + 3147, + 3148 + ], + [ + 3150, + 3152 + ], + [ + 3153, + 3154 + ], + [ + 3156, + 3158 + ], + [ + 3159, + 3160 + ], + [ + 3163, + 3164 + ], + [ + 3167, + 3173 + ], + [ + 3174, + 3175 + ], + [ + 3176, + 3177 + ], + [ + 3179, + 3181 + ], + [ + 3182, + 3183 + ], + [ + 3185, + 3187 + ], + [ + 3188, + 3189 + ], + [ + 3191, + 3193 + ], + [ + 3196, + 3201 + ], + [ + 3202, + 3203 + ], + [ + 3204, + 3205 + ], + [ + 3208, + 3210 + ], + [ + 3211, + 3213 + ], + [ + 3216, + 3217 + ], + [ + 3220, + 3221 + ], + [ + 3224, + 3225 + ], + [ + 3228, + 3233 + ], + [ + 3234, + 3235 + ], + [ + 3236, + 3237 + ], + [ + 3240, + 3241 + ], + [ + 3244, + 3252 + ], + [ + 3253, + 3254 + ], + [ + 3255, + 3256 + ], + [ + 3259, + 3260 + ], + [ + 3263, + 3270 + ], + [ + 3271, + 3272 + ], + [ + 3273, + 3274 + ], + [ + 3277, + 3278 + ], + [ + 3281, + 3288 + ], + [ + 3289, + 3290 + ], + [ + 3291, + 3292 + ], + [ + 3295, + 3296 + ], + [ + 3299, + 3305 + ], + [ + 3306, + 3307 + ], + [ + 3308, + 3309 + ], + [ + 3312, + 3313 + ], + [ + 3318, + 3324 + ], + [ + 3325, + 3329 + ], + [ + 3330, + 3331 + ], + [ + 3332, + 3333 + ], + [ + 3336, + 3337 + ], + [ + 3342, + 3349 + ], + [ + 3350, + 3354 + ], + [ + 3355, + 3356 + ], + [ + 3357, + 3358 + ], + [ + 3360, + 3362 + ], + [ + 3364, + 3366 + ], + [ + 3369, + 3393 + ], + [ + 3394, + 3396 + ], + [ + 3399, + 3404 + ], + [ + 3405, + 3406 + ], + [ + 3409, + 3411 + ], + [ + 3412, + 3414 + ], + [ + 3415, + 3419 + ], + [ + 3420, + 3421 + ], + [ + 3423, + 3425 + ], + [ + 3429, + 3433 + ], + [ + 3434, + 3435 + ], + [ + 3436, + 3439 + ], + [ + 3440, + 3441 + ], + [ + 3442, + 3443 + ], + [ + 3445, + 3447 + ], + [ + 3450, + 3455 + ], + [ + 3456, + 3457 + ], + [ + 3458, + 3459 + ], + [ + 3461, + 3463 + ], + [ + 3471, + 3475 + ], + [ + 3476, + 3477 + ], + [ + 3478, + 3481 + ], + [ + 3482, + 3483 + ], + [ + 3484, + 3485 + ], + [ + 3487, + 3489 + ], + [ + 3492, + 3497 + ], + [ + 3498, + 3499 + ], + [ + 3500, + 3501 + ], + [ + 3503, + 3505 + ], + [ + 3508, + 3513 + ], + [ + 3514, + 3515 + ], + [ + 3516, + 3517 + ], + [ + 3519, + 3521 + ], + [ + 3524, + 3529 + ], + [ + 3530, + 3531 + ], + [ + 3532, + 3533 + ], + [ + 3535, + 3537 + ], + [ + 3540, + 3545 + ], + [ + 3546, + 3547 + ], + [ + 3548, + 3549 + ], + [ + 3551, + 3553 + ], + [ + 3556, + 3561 + ], + [ + 3562, + 3563 + ], + [ + 3564, + 3565 + ], + [ + 3567, + 3569 + ], + [ + 3572, + 3577 + ], + [ + 3578, + 3579 + ], + [ + 3580, + 3581 + ], + [ + 3583, + 3585 + ], + [ + 3588, + 3593 + ], + [ + 3594, + 3595 + ], + [ + 3596, + 3597 + ], + [ + 3599, + 3601 + ], + [ + 3604, + 3609 + ], + [ + 3610, + 3611 + ], + [ + 3612, + 3613 + ], + [ + 3615, + 3617 + ], + [ + 3620, + 3625 + ], + [ + 3626, + 3627 + ], + [ + 3628, + 3629 + ], + [ + 3631, + 3633 + ], + [ + 3636, + 3641 + ], + [ + 3642, + 3643 + ], + [ + 3644, + 3645 + ], + [ + 3647, + 3649 + ], + [ + 3652, + 3657 + ], + [ + 3658, + 3659 + ], + [ + 3660, + 3661 + ], + [ + 3663, + 3665 + ], + [ + 3668, + 3673 + ], + [ + 3674, + 3675 + ], + [ + 3676, + 3677 + ], + [ + 3679, + 3681 + ], + [ + 3684, + 3689 + ], + [ + 3690, + 3691 + ], + [ + 3692, + 3693 + ], + [ + 3695, + 3697 + ], + [ + 3700, + 3705 + ], + [ + 3706, + 3707 + ], + [ + 3708, + 3709 + ], + [ + 3711, + 3713 + ], + [ + 3716, + 3721 + ], + [ + 3722, + 3723 + ], + [ + 3724, + 3725 + ], + [ + 3727, + 3730 + ], + [ + 3732, + 3736 + ], + [ + 3737, + 3738 + ], + [ + 3740, + 3744 + ], + [ + 3746, + 3753 + ], + [ + 3754, + 3755 + ], + [ + 3757, + 3759 + ], + [ + 3762, + 3767 + ], + [ + 3768, + 3769 + ], + [ + 3771, + 3773 + ], + [ + 3776, + 3782 + ], + [ + 3784, + 3786 + ], + [ + 3787, + 3789 + ], + [ + 3790, + 3794 + ], + [ + 3795, + 3796 + ], + [ + 3798, + 3800 + ], + [ + 3801, + 3803 + ], + [ + 3804, + 3808 + ], + [ + 3809, + 3810 + ], + [ + 3812, + 3814 + ], + [ + 3817, + 3822 + ], + [ + 3823, + 3824 + ], + [ + 3825, + 3826 + ], + [ + 3828, + 3830 + ], + [ + 3832, + 3833 + ], + [ + 3836, + 3844 + ], + [ + 3845, + 3846 + ], + [ + 3847, + 3848 + ], + [ + 3850, + 3853 + ], + [ + 3856, + 3864 + ], + [ + 3865, + 3866 + ], + [ + 3867, + 3868 + ], + [ + 3870, + 3872 + ], + [ + 3875, + 3883 + ], + [ + 3884, + 3885 + ], + [ + 3886, + 3887 + ], + [ + 3889, + 3892 + ], + [ + 3895, + 3904 + ], + [ + 3905, + 3906 + ], + [ + 3907, + 3908 + ], + [ + 3919, + 3922 + ], + [ + 3924, + 3928 + ], + [ + 3929, + 3930 + ], + [ + 3932, + 3935 + ], + [ + 3937, + 3941 + ], + [ + 3942, + 3943 + ], + [ + 3945, + 3948 + ], + [ + 3950, + 3954 + ], + [ + 3955, + 3956 + ], + [ + 3958, + 3960 + ], + [ + 3963, + 3967 + ], + [ + 3968, + 3969 + ], + [ + 3971, + 3974 + ], + [ + 3976, + 3980 + ], + [ + 3981, + 3982 + ], + [ + 3984, + 3987 + ], + [ + 3989, + 3994 + ], + [ + 3995, + 3996 + ], + [ + 3998, + 4000 + ], + [ + 4003, + 4009 + ], + [ + 4010, + 4011 + ], + [ + 4012, + 4013 + ], + [ + 4015, + 4017 + ], + [ + 4020, + 4026 + ], + [ + 4027, + 4028 + ], + [ + 4029, + 4030 + ], + [ + 4032, + 4034 + ], + [ + 4037, + 4043 + ], + [ + 4044, + 4045 + ], + [ + 4046, + 4047 + ], + [ + 4050, + 4051 + ], + [ + 4054, + 4059 + ], + [ + 4060, + 4061 + ], + [ + 4062, + 4063 + ], + [ + 4065, + 4067 + ], + [ + 4070, + 4076 + ], + [ + 4077, + 4078 + ], + [ + 4079, + 4080 + ], + [ + 4082, + 4084 + ], + [ + 4090, + 4097 + ], + [ + 4098, + 4101 + ], + [ + 4102, + 4105 + ], + [ + 4106, + 4107 + ], + [ + 4109, + 4111 + ], + [ + 4117, + 4124 + ], + [ + 4125, + 4128 + ], + [ + 4129, + 4132 + ], + [ + 4133, + 4134 + ], + [ + 4136, + 4138 + ], + [ + 4141, + 4143 + ], + [ + 4144, + 4147 + ], + [ + 4148, + 4149 + ], + [ + 4150, + 4151 + ], + [ + 4153, + 4155 + ], + [ + 4158, + 4160 + ], + [ + 4161, + 4164 + ], + [ + 4165, + 4166 + ], + [ + 4167, + 4168 + ], + [ + 4171, + 4172 + ], + [ + 4175, + 4177 + ], + [ + 4178, + 4179 + ], + [ + 4180, + 4181 + ], + [ + 4183, + 4185 + ], + [ + 4188, + 4190 + ], + [ + 4191, + 4194 + ], + [ + 4195, + 4196 + ], + [ + 4197, + 4198 + ], + [ + 4200, + 4202 + ], + [ + 4205, + 4207 + ], + [ + 4208, + 4211 + ], + [ + 4212, + 4213 + ], + [ + 4214, + 4215 + ], + [ + 4217, + 4219 + ], + [ + 4222, + 4226 + ], + [ + 4227, + 4228 + ], + [ + 4230, + 4232 + ], + [ + 4235, + 4237 + ], + [ + 4238, + 4241 + ], + [ + 4242, + 4243 + ], + [ + 4244, + 4245 + ], + [ + 4247, + 4249 + ], + [ + 4252, + 4256 + ], + [ + 4257, + 4258 + ], + [ + 4260, + 4262 + ], + [ + 4265, + 4269 + ], + [ + 4270, + 4273 + ], + [ + 4274, + 4275 + ], + [ + 4276, + 4277 + ], + [ + 4279, + 4283 + ], + [ + 4286, + 4293 + ], + [ + 4294, + 4297 + ], + [ + 4298, + 4299 + ], + [ + 4300, + 4301 + ], + [ + 4303, + 4305 + ], + [ + 4308, + 4310 + ], + [ + 4311, + 4314 + ], + [ + 4315, + 4316 + ], + [ + 4317, + 4318 + ], + [ + 4320, + 4322 + ], + [ + 4325, + 4329 + ], + [ + 4330, + 4333 + ], + [ + 4334, + 4335 + ], + [ + 4336, + 4337 + ], + [ + 4339, + 4341 + ], + [ + 4344, + 4346 + ], + [ + 4347, + 4350 + ], + [ + 4351, + 4352 + ], + [ + 4353, + 4354 + ], + [ + 4356, + 4358 + ], + [ + 4361, + 4363 + ], + [ + 4364, + 4368 + ], + [ + 4369, + 4370 + ], + [ + 4371, + 4374 + ], + [ + 4375, + 4376 + ], + [ + 4377, + 4378 + ], + [ + 4380, + 4382 + ], + [ + 4386, + 4389 + ], + [ + 4390, + 4391 + ], + [ + 4394, + 4395 + ], + [ + 4397, + 4400 + ], + [ + 4401, + 4402 + ], + [ + 4403, + 4406 + ], + [ + 4407, + 4408 + ], + [ + 4409, + 4410 + ], + [ + 4413, + 4414 + ], + [ + 4417, + 4420 + ], + [ + 4421, + 4425 + ], + [ + 4426, + 4427 + ], + [ + 4428, + 4431 + ], + [ + 4432, + 4433 + ], + [ + 4434, + 4435 + ], + [ + 4438, + 4439 + ], + [ + 4440, + 4441 + ], + [ + 4444, + 4445 + ], + [ + 4448, + 4451 + ], + [ + 4452, + 4456 + ], + [ + 4457, + 4458 + ], + [ + 4459, + 4462 + ], + [ + 4463, + 4464 + ], + [ + 4465, + 4466 + ], + [ + 4469, + 4470 + ], + [ + 4471, + 4472 + ], + [ + 4475, + 4476 + ], + [ + 4477, + 4479 + ], + [ + 4480, + 4481 + ], + [ + 4484, + 4485 + ], + [ + 4488, + 4489 + ], + [ + 4490, + 4491 + ], + [ + 4493, + 4495 + ], + [ + 4498, + 4504 + ], + [ + 4505, + 4506 + ], + [ + 4509, + 4510 + ], + [ + 4513, + 4515 + ], + [ + 4516, + 4519 + ], + [ + 4520, + 4521 + ], + [ + 4522, + 4523 + ], + [ + 4525, + 4527 + ], + [ + 4532, + 4535 + ], + [ + 4536, + 4541 + ], + [ + 4542, + 4544 + ], + [ + 4545, + 4546 + ], + [ + 4547, + 4548 + ], + [ + 4550, + 4552 + ], + [ + 4553, + 4554 + ], + [ + 4556, + 4558 + ], + [ + 4561, + 4563 + ], + [ + 4564, + 4567 + ], + [ + 4568, + 4569 + ], + [ + 4570, + 4571 + ], + [ + 4573, + 4575 + ], + [ + 4578, + 4582 + ], + [ + 4583, + 4586 + ], + [ + 4587, + 4588 + ], + [ + 4589, + 4590 + ], + [ + 4598, + 4599 + ], + [ + 4603, + 4604 + ], + [ + 4606, + 4607 + ], + [ + 4609, + 4611 + ], + [ + 4614, + 4622 + ], + [ + 4623, + 4626 + ], + [ + 4627, + 4628 + ], + [ + 4629, + 4630 + ], + [ + 4633, + 4634 + ], + [ + 4636, + 4638 + ], + [ + 4641, + 4650 + ], + [ + 4651, + 4654 + ], + [ + 4655, + 4656 + ], + [ + 4657, + 4658 + ], + [ + 4660, + 4663 + ], + [ + 4664, + 4666 + ], + [ + 4670, + 4671 + ], + [ + 4672, + 4673 + ], + [ + 4679, + 4690 + ], + [ + 4692, + 4696 + ], + [ + 4699, + 4701 + ], + [ + 4702, + 4703 + ], + [ + 4705, + 4709 + ], + [ + 4731, + 4732 + ], + [ + 4734, + 4737 + ], + [ + 4753, + 4754 + ], + [ + 4755, + 4756 + ], + [ + 4760, + 4762 + ], + [ + 4763, + 4765 + ], + [ + 4768, + 4769 + ], + [ + 4772, + 4777 + ], + [ + 4778, + 4779 + ], + [ + 4780, + 4781 + ], + [ + 4784, + 4787 + ], + [ + 4788, + 4791 + ], + [ + 4793, + 4795 + ], + [ + 4798, + 4800 + ], + [ + 4801, + 4804 + ], + [ + 4805, + 4806 + ], + [ + 4807, + 4808 + ], + [ + 4810, + 4812 + ], + [ + 4815, + 4817 + ], + [ + 4818, + 4821 + ], + [ + 4822, + 4823 + ], + [ + 4824, + 4825 + ], + [ + 4827, + 4829 + ], + [ + 4832, + 4836 + ], + [ + 4837, + 4840 + ], + [ + 4841, + 4842 + ], + [ + 4843, + 4844 + ], + [ + 4846, + 4848 + ], + [ + 4851, + 4853 + ], + [ + 4854, + 4857 + ], + [ + 4858, + 4859 + ], + [ + 4860, + 4861 + ], + [ + 4863, + 4865 + ], + [ + 4868, + 4873 + ], + [ + 4874, + 4875 + ], + [ + 4876, + 4877 + ], + [ + 4879, + 4881 + ], + [ + 4884, + 4889 + ], + [ + 4890, + 4891 + ], + [ + 4892, + 4893 + ], + [ + 4895, + 4897 + ], + [ + 4900, + 4902 + ], + [ + 4903, + 4906 + ], + [ + 4907, + 4908 + ], + [ + 4909, + 4910 + ], + [ + 4912, + 4914 + ], + [ + 4915, + 4918 + ], + [ + 4921, + 4922 + ], + [ + 4925, + 4927 + ], + [ + 4928, + 4931 + ], + [ + 4932, + 4933 + ], + [ + 4934, + 4935 + ], + [ + 4937, + 4939 + ], + [ + 4942, + 4944 + ], + [ + 4945, + 4948 + ], + [ + 4949, + 4950 + ], + [ + 4951, + 4952 + ], + [ + 4955, + 4956 + ], + [ + 4957, + 4959 + ], + [ + 4962, + 4964 + ], + [ + 4968, + 4970 + ], + [ + 4971, + 4972 + ], + [ + 4973, + 4974 + ], + [ + 4976, + 4978 + ], + [ + 4982, + 4984 + ], + [ + 4985, + 4986 + ], + [ + 4996, + 4997 + ], + [ + 5000, + 5001 + ], + [ + 5003, + 5007 + ], + [ + 5015, + 5019 + ], + [ + 5022, + 5023 + ], + [ + 5026, + 5027 + ], + [ + 5030, + 5031 + ], + [ + 5032, + 5033 + ], + [ + 5036, + 5038 + ], + [ + 5042, + 5044 + ], + [ + 5045, + 5048 + ], + [ + 5051, + 5052 + ], + [ + 5056, + 5058 + ], + [ + 5059, + 5060 + ], + [ + 5063, + 5064 + ], + [ + 5065, + 5066 + ], + [ + 5069, + 5070 + ], + [ + 5075, + 5077 + ], + [ + 5078, + 5082 + ], + [ + 5084, + 5085 + ], + [ + 5086, + 5087 + ], + [ + 5088, + 5089 + ], + [ + 5092, + 5093 + ], + [ + 5101, + 5103 + ], + [ + 5104, + 5111 + ], + [ + 5112, + 5117 + ], + [ + 5119, + 5120 + ], + [ + 5123, + 5124 + ], + [ + 5132, + 5134 + ], + [ + 5135, + 5143 + ], + [ + 5144, + 5149 + ], + [ + 5151, + 5152 + ], + [ + 5155, + 5157 + ], + [ + 5163, + 5172 + ], + [ + 5173, + 5179 + ], + [ + 5180, + 5181 + ], + [ + 5184, + 5186 + ], + [ + 5190, + 5195 + ], + [ + 5196, + 5201 + ], + [ + 5202, + 5205 + ], + [ + 5210, + 5212 + ], + [ + 5218, + 5221 + ], + [ + 5222, + 5226 + ], + [ + 5228, + 5229 + ], + [ + 5232, + 5234 + ], + [ + 5235, + 5236 + ], + [ + 5239, + 5246 + ], + [ + 5247, + 5250 + ], + [ + 5251, + 5252 + ], + [ + 5253, + 5254 + ], + [ + 5257, + 5261 + ], + [ + 5263, + 5267 + ], + [ + 5268, + 5271 + ], + [ + 5272, + 5273 + ], + [ + 5274, + 5275 + ], + [ + 5278, + 5279 + ], + [ + 5282, + 5287 + ], + [ + 5288, + 5291 + ], + [ + 5292, + 5293 + ], + [ + 5294, + 5295 + ], + [ + 5297, + 5299 + ], + [ + 5302, + 5304 + ], + [ + 5305, + 5308 + ], + [ + 5309, + 5310 + ], + [ + 5311, + 5312 + ], + [ + 5315, + 5316 + ], + [ + 5319, + 5323 + ], + [ + 5324, + 5327 + ], + [ + 5328, + 5329 + ], + [ + 5330, + 5331 + ], + [ + 5334, + 5335 + ], + [ + 5338, + 5340 + ], + [ + 5341, + 5344 + ], + [ + 5345, + 5346 + ], + [ + 5347, + 5348 + ], + [ + 5351, + 5352 + ], + [ + 5354, + 5355 + ], + [ + 5356, + 5357 + ], + [ + 5360, + 5370 + ], + [ + 5371, + 5372 + ], + [ + 5373, + 5374 + ], + [ + 5377, + 5378 + ], + [ + 5379, + 5380 + ], + [ + 5383, + 5385 + ], + [ + 5387, + 5398 + ], + [ + 5399, + 5400 + ], + [ + 5401, + 5402 + ], + [ + 5405, + 5406 + ], + [ + 5408, + 5409 + ], + [ + 5410, + 5411 + ], + [ + 5414, + 5424 + ], + [ + 5425, + 5426 + ], + [ + 5427, + 5428 + ], + [ + 5431, + 5432 + ], + [ + 5433, + 5434 + ], + [ + 5437, + 5439 + ], + [ + 5441, + 5452 + ], + [ + 5453, + 5454 + ], + [ + 5455, + 5456 + ], + [ + 5459, + 5460 + ], + [ + 5462, + 5463 + ], + [ + 5464, + 5466 + ], + [ + 5469, + 5471 + ], + [ + 5474, + 5481 + ], + [ + 5482, + 5483 + ], + [ + 5484, + 5485 + ], + [ + 5488, + 5490 + ], + [ + 5491, + 5492 + ], + [ + 5495, + 5503 + ], + [ + 5504, + 5505 + ], + [ + 5506, + 5507 + ], + [ + 5510, + 5512 + ], + [ + 5515, + 5522 + ], + [ + 5523, + 5524 + ], + [ + 5525, + 5526 + ], + [ + 5529, + 5531 + ], + [ + 5532, + 5533 + ], + [ + 5536, + 5544 + ], + [ + 5545, + 5546 + ], + [ + 5547, + 5548 + ], + [ + 5555, + 5556 + ], + [ + 5562, + 5564 + ], + [ + 5568, + 5574 + ], + [ + 5577, + 5582 + ], + [ + 5585, + 5588 + ], + [ + 5589, + 5590 + ], + [ + 5603, + 5604 + ], + [ + 5608, + 5610 + ], + [ + 5613, + 5615 + ], + [ + 5622, + 5623 + ], + [ + 5628, + 5630 + ], + [ + 5633, + 5636 + ], + [ + 5637, + 5640 + ], + [ + 5641, + 5643 + ], + [ + 5644, + 5645 + ], + [ + 5650, + 5651 + ], + [ + 5652, + 5653 + ], + [ + 5656, + 5657 + ], + [ + 5661, + 5662 + ], + [ + 5663, + 5665 + ], + [ + 5666, + 5667 + ], + [ + 5670, + 5671 + ], + [ + 5672, + 5681 + ], + [ + 5683, + 5684 + ], + [ + 5687, + 5688 + ], + [ + 5689, + 5698 + ], + [ + 5700, + 5701 + ], + [ + 5704, + 5705 + ], + [ + 5706, + 5712 + ], + [ + 5714, + 5715 + ], + [ + 5718, + 5719 + ], + [ + 5722, + 5727 + ], + [ + 5729, + 5730 + ], + [ + 5736, + 5737 + ], + [ + 5738, + 5740 + ], + [ + 5746, + 5747 + ], + [ + 5748, + 5750 + ], + [ + 5754, + 5755 + ], + [ + 5759, + 5768 + ], + [ + 5771, + 5774 + ], + [ + 5775, + 5776 + ], + [ + 5777, + 5780 + ], + [ + 5781, + 5785 + ], + [ + 5787, + 5789 + ], + [ + 5790, + 5795 + ], + [ + 5796, + 5801 + ], + [ + 5803, + 5804 + ], + [ + 5809, + 5810 + ], + [ + 5811, + 5812 + ], + [ + 5817, + 5818 + ], + [ + 5819, + 5820 + ] + ] + } + }, + { + "filename": "libvips/draw/draw.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 45, + 52 + ], + [ + 53, + 63 + ], + [ + 68, + 83 + ], + [ + 84, + 158 + ], + [ + 161, + 164 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 48, + 49 + ], + [ + 56, + 57 + ], + [ + 59, + 60 + ], + [ + 71, + 73 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 87, + 88 + ], + [ + 92, + 93 + ], + [ + 95, + 96 + ], + [ + 97, + 99 + ], + [ + 101, + 104 + ], + [ + 106, + 108 + ], + [ + 109, + 112 + ], + [ + 113, + 115 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 125 + ], + [ + 130, + 131 + ], + [ + 133, + 138 + ], + [ + 141, + 142 + ], + [ + 146, + 147 + ], + [ + 148, + 155 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_circle.c", + "line_filter": { + "diff_chunks": [ + [ + 23, + 51 + ], + [ + 73, + 99 + ], + [ + 100, + 188 + ], + [ + 189, + 284 + ], + [ + 297, + 321 + ], + [ + 330, + 355 + ] + ], + "lines_added": [ + [ + 26, + 42 + ], + [ + 47, + 48 + ], + [ + 76, + 77 + ], + [ + 78, + 79 + ], + [ + 81, + 83 + ], + [ + 89, + 94 + ], + [ + 95, + 96 + ], + [ + 103, + 108 + ], + [ + 112, + 113 + ], + [ + 114, + 117 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 128, + 131 + ], + [ + 132, + 140 + ], + [ + 145, + 148 + ], + [ + 149, + 151 + ], + [ + 155, + 158 + ], + [ + 159, + 161 + ], + [ + 166, + 167 + ], + [ + 168, + 170 + ], + [ + 171, + 173 + ], + [ + 174, + 176 + ], + [ + 177, + 179 + ], + [ + 180, + 181 + ], + [ + 183, + 185 + ], + [ + 192, + 193 + ], + [ + 194, + 196 + ], + [ + 200, + 202 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 223, + 225 + ], + [ + 230, + 231 + ], + [ + 233, + 236 + ], + [ + 237, + 239 + ], + [ + 240, + 243 + ], + [ + 244, + 246 + ], + [ + 247, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 257 + ], + [ + 258, + 260 + ], + [ + 263, + 264 + ], + [ + 269, + 271 + ], + [ + 275, + 279 + ], + [ + 280, + 281 + ], + [ + 300, + 301 + ], + [ + 307, + 309 + ], + [ + 313, + 316 + ], + [ + 317, + 318 + ], + [ + 333, + 334 + ], + [ + 340, + 342 + ], + [ + 347, + 348 + ], + [ + 349, + 352 + ], + [ + 353, + 354 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_flood.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 10 + ], + [ + 36, + 64 + ], + [ + 75, + 89 + ], + [ + 103, + 110 + ], + [ + 114, + 121 + ], + [ + 144, + 151 + ], + [ + 153, + 185 + ], + [ + 187, + 206 + ], + [ + 213, + 336 + ], + [ + 340, + 371 + ], + [ + 372, + 444 + ], + [ + 451, + 459 + ], + [ + 460, + 626 + ], + [ + 633, + 691 + ], + [ + 712, + 743 + ], + [ + 756, + 780 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 6, + 7 + ], + [ + 39, + 40 + ], + [ + 41, + 45 + ], + [ + 46, + 55 + ], + [ + 60, + 61 + ], + [ + 78, + 79 + ], + [ + 85, + 86 + ], + [ + 106, + 107 + ], + [ + 117, + 118 + ], + [ + 147, + 148 + ], + [ + 156, + 157 + ], + [ + 161, + 162 + ], + [ + 165, + 166 + ], + [ + 169, + 170 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 181, + 182 + ], + [ + 190, + 191 + ], + [ + 194, + 203 + ], + [ + 216, + 217 + ], + [ + 221, + 222 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 228, + 230 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 244, + 246 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 264, + 266 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 276, + 278 + ], + [ + 279, + 281 + ], + [ + 282, + 284 + ], + [ + 285, + 286 + ], + [ + 288, + 290 + ], + [ + 294, + 295 + ], + [ + 297, + 299 + ], + [ + 304, + 308 + ], + [ + 313, + 315 + ], + [ + 316, + 318 + ], + [ + 323, + 324 + ], + [ + 328, + 330 + ], + [ + 331, + 333 + ], + [ + 343, + 344 + ], + [ + 345, + 349 + ], + [ + 351, + 352 + ], + [ + 355, + 356 + ], + [ + 360, + 362 + ], + [ + 363, + 368 + ], + [ + 375, + 378 + ], + [ + 379, + 380 + ], + [ + 383, + 384 + ], + [ + 389, + 400 + ], + [ + 402, + 403 + ], + [ + 408, + 409 + ], + [ + 414, + 415 + ], + [ + 420, + 423 + ], + [ + 424, + 425 + ], + [ + 427, + 428 + ], + [ + 430, + 432 + ], + [ + 436, + 437 + ], + [ + 439, + 441 + ], + [ + 454, + 456 + ], + [ + 463, + 464 + ], + [ + 466, + 467 + ], + [ + 468, + 471 + ], + [ + 473, + 475 + ], + [ + 476, + 478 + ], + [ + 481, + 482 + ], + [ + 485, + 486 + ], + [ + 487, + 492 + ], + [ + 495, + 496 + ], + [ + 497, + 498 + ], + [ + 499, + 500 + ], + [ + 505, + 506 + ], + [ + 508, + 516 + ], + [ + 518, + 521 + ], + [ + 523, + 525 + ], + [ + 527, + 528 + ], + [ + 531, + 532 + ], + [ + 533, + 538 + ], + [ + 539, + 540 + ], + [ + 542, + 545 + ], + [ + 547, + 548 + ], + [ + 549, + 550 + ], + [ + 553, + 554 + ], + [ + 555, + 557 + ], + [ + 562, + 563 + ], + [ + 565, + 568 + ], + [ + 569, + 571 + ], + [ + 572, + 575 + ], + [ + 576, + 578 + ], + [ + 579, + 582 + ], + [ + 583, + 584 + ], + [ + 585, + 588 + ], + [ + 589, + 591 + ], + [ + 592, + 595 + ], + [ + 596, + 598 + ], + [ + 599, + 602 + ], + [ + 603, + 605 + ], + [ + 606, + 609 + ], + [ + 610, + 612 + ], + [ + 613, + 616 + ], + [ + 617, + 619 + ], + [ + 622, + 623 + ], + [ + 636, + 637 + ], + [ + 639, + 641 + ], + [ + 642, + 653 + ], + [ + 656, + 657 + ], + [ + 658, + 659 + ], + [ + 660, + 661 + ], + [ + 666, + 670 + ], + [ + 671, + 672 + ], + [ + 673, + 674 + ], + [ + 677, + 679 + ], + [ + 683, + 686 + ], + [ + 687, + 688 + ], + [ + 715, + 716 + ], + [ + 717, + 718 + ], + [ + 720, + 721 + ], + [ + 722, + 723 + ], + [ + 729, + 731 + ], + [ + 735, + 738 + ], + [ + 739, + 740 + ], + [ + 759, + 760 + ], + [ + 766, + 767 + ], + [ + 772, + 773 + ], + [ + 774, + 777 + ], + [ + 778, + 779 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_image.c", + "line_filter": { + "diff_chunks": [ + [ + 32, + 60 + ], + [ + 80, + 160 + ], + [ + 161, + 204 + ], + [ + 212, + 301 + ], + [ + 309, + 338 + ] + ], + "lines_added": [ + [ + 35, + 51 + ], + [ + 56, + 57 + ], + [ + 83, + 84 + ], + [ + 90, + 107 + ], + [ + 108, + 116 + ], + [ + 118, + 120 + ], + [ + 123, + 125 + ], + [ + 128, + 157 + ], + [ + 164, + 165 + ], + [ + 166, + 168 + ], + [ + 169, + 170 + ], + [ + 173, + 174 + ], + [ + 176, + 178 + ], + [ + 179, + 185 + ], + [ + 186, + 188 + ], + [ + 189, + 192 + ], + [ + 196, + 201 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 221, + 223 + ], + [ + 224, + 229 + ], + [ + 230, + 232 + ], + [ + 233, + 236 + ], + [ + 239, + 241 + ], + [ + 247, + 249 + ], + [ + 252, + 253 + ], + [ + 256, + 257 + ], + [ + 258, + 260 + ], + [ + 265, + 266 + ], + [ + 268, + 271 + ], + [ + 272, + 273 + ], + [ + 274, + 277 + ], + [ + 278, + 280 + ], + [ + 281, + 284 + ], + [ + 285, + 287 + ], + [ + 288, + 291 + ], + [ + 292, + 294 + ], + [ + 297, + 298 + ], + [ + 312, + 313 + ], + [ + 314, + 315 + ], + [ + 319, + 321 + ], + [ + 327, + 328 + ], + [ + 332, + 335 + ], + [ + 336, + 337 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_line.c", + "line_filter": { + "diff_chunks": [ + [ + 26, + 54 + ], + [ + 77, + 90 + ], + [ + 91, + 208 + ], + [ + 212, + 333 + ], + [ + 340, + 366 + ], + [ + 372, + 397 + ] + ], + "lines_added": [ + [ + 29, + 45 + ], + [ + 50, + 51 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 85, + 87 + ], + [ + 94, + 95 + ], + [ + 96, + 99 + ], + [ + 102, + 104 + ], + [ + 105, + 107 + ], + [ + 109, + 111 + ], + [ + 116, + 117 + ], + [ + 121, + 124 + ], + [ + 126, + 127 + ], + [ + 129, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 137 + ], + [ + 140, + 142 + ], + [ + 144, + 146 + ], + [ + 147, + 149 + ], + [ + 151, + 153 + ], + [ + 154, + 156 + ], + [ + 158, + 160 + ], + [ + 162, + 163 + ], + [ + 168, + 170 + ], + [ + 172, + 174 + ], + [ + 176, + 177 + ], + [ + 182, + 184 + ], + [ + 186, + 188 + ], + [ + 190, + 191 + ], + [ + 196, + 198 + ], + [ + 200, + 202 + ], + [ + 204, + 205 + ], + [ + 215, + 216 + ], + [ + 217, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 235, + 237 + ], + [ + 240, + 241 + ], + [ + 242, + 244 + ], + [ + 248, + 250 + ], + [ + 251, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 257, + 259 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 280, + 281 + ], + [ + 283, + 286 + ], + [ + 287, + 289 + ], + [ + 290, + 293 + ], + [ + 294, + 296 + ], + [ + 297, + 300 + ], + [ + 301, + 303 + ], + [ + 304, + 307 + ], + [ + 308, + 310 + ], + [ + 313, + 314 + ], + [ + 318, + 320 + ], + [ + 324, + 328 + ], + [ + 329, + 330 + ], + [ + 343, + 344 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 352, + 354 + ], + [ + 358, + 361 + ], + [ + 362, + 363 + ], + [ + 375, + 376 + ], + [ + 382, + 384 + ], + [ + 389, + 390 + ], + [ + 391, + 394 + ], + [ + 395, + 396 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_mask.c", + "line_filter": { + "diff_chunks": [ + [ + 24, + 52 + ], + [ + 80, + 237 + ], + [ + 239, + 261 + ], + [ + 266, + 273 + ], + [ + 274, + 370 + ], + [ + 378, + 405 + ], + [ + 410, + 435 + ] + ], + "lines_added": [ + [ + 27, + 43 + ], + [ + 48, + 49 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 89, + 102 + ], + [ + 105, + 118 + ], + [ + 121, + 138 + ], + [ + 140, + 142 + ], + [ + 145, + 146 + ], + [ + 150, + 152 + ], + [ + 153, + 160 + ], + [ + 161, + 164 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 172, + 174 + ], + [ + 177, + 178 + ], + [ + 181, + 186 + ], + [ + 187, + 190 + ], + [ + 192, + 194 + ], + [ + 196, + 198 + ], + [ + 200, + 202 + ], + [ + 204, + 206 + ], + [ + 208, + 210 + ], + [ + 212, + 214 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 229, + 230 + ], + [ + 233, + 234 + ], + [ + 242, + 244 + ], + [ + 250, + 258 + ], + [ + 269, + 270 + ], + [ + 277, + 279 + ], + [ + 280, + 283 + ], + [ + 286, + 289 + ], + [ + 295, + 296 + ], + [ + 299, + 300 + ], + [ + 301, + 303 + ], + [ + 305, + 307 + ], + [ + 308, + 311 + ], + [ + 312, + 313 + ], + [ + 316, + 317 + ], + [ + 318, + 320 + ], + [ + 325, + 326 + ], + [ + 328, + 331 + ], + [ + 332, + 333 + ], + [ + 334, + 337 + ], + [ + 338, + 340 + ], + [ + 341, + 344 + ], + [ + 345, + 347 + ], + [ + 350, + 351 + ], + [ + 355, + 357 + ], + [ + 361, + 365 + ], + [ + 366, + 367 + ], + [ + 381, + 383 + ], + [ + 384, + 385 + ], + [ + 391, + 393 + ], + [ + 397, + 400 + ], + [ + 401, + 402 + ], + [ + 413, + 414 + ], + [ + 420, + 422 + ], + [ + 427, + 428 + ], + [ + 429, + 432 + ], + [ + 433, + 434 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_rect.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 17, + 51 + ], + [ + 71, + 94 + ], + [ + 95, + 124 + ], + [ + 127, + 138 + ], + [ + 141, + 230 + ], + [ + 249, + 267 + ], + [ + 277, + 305 + ], + [ + 317, + 333 + ], + [ + 337, + 361 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 20, + 21 + ], + [ + 26, + 27 + ], + [ + 28, + 32 + ], + [ + 33, + 42 + ], + [ + 47, + 48 + ], + [ + 74, + 75 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 86, + 87 + ], + [ + 88, + 91 + ], + [ + 98, + 99 + ], + [ + 101, + 103 + ], + [ + 106, + 107 + ], + [ + 108, + 121 + ], + [ + 130, + 131 + ], + [ + 132, + 135 + ], + [ + 144, + 146 + ], + [ + 150, + 152 + ], + [ + 156, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 164 + ], + [ + 169, + 170 + ], + [ + 172, + 175 + ], + [ + 176, + 178 + ], + [ + 179, + 182 + ], + [ + 183, + 185 + ], + [ + 186, + 189 + ], + [ + 190, + 192 + ], + [ + 193, + 196 + ], + [ + 197, + 199 + ], + [ + 200, + 203 + ], + [ + 204, + 206 + ], + [ + 209, + 210 + ], + [ + 214, + 217 + ], + [ + 221, + 225 + ], + [ + 226, + 227 + ], + [ + 252, + 254 + ], + [ + 258, + 262 + ], + [ + 263, + 264 + ], + [ + 280, + 281 + ], + [ + 287, + 289 + ], + [ + 294, + 295 + ], + [ + 296, + 300 + ], + [ + 301, + 302 + ], + [ + 320, + 321 + ], + [ + 325, + 328 + ], + [ + 329, + 330 + ], + [ + 340, + 341 + ], + [ + 347, + 348 + ], + [ + 353, + 354 + ], + [ + 355, + 358 + ], + [ + 359, + 360 + ] + ] + } + }, + { + "filename": "libvips/draw/draw_smudge.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 24, + 52 + ], + [ + 77, + 92 + ], + [ + 94, + 110 + ], + [ + 116, + 248 + ], + [ + 255, + 278 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 27, + 28 + ], + [ + 29, + 33 + ], + [ + 34, + 43 + ], + [ + 48, + 49 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 85, + 86 + ], + [ + 87, + 89 + ], + [ + 97, + 100 + ], + [ + 105, + 107 + ], + [ + 119, + 120 + ], + [ + 121, + 124 + ], + [ + 125, + 127 + ], + [ + 130, + 132 + ], + [ + 134, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 142 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 149 + ], + [ + 150, + 151 + ], + [ + 153, + 155 + ], + [ + 156, + 157 + ], + [ + 162, + 193 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 204, + 206 + ], + [ + 211, + 212 + ], + [ + 214, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 224 + ], + [ + 225, + 227 + ], + [ + 228, + 231 + ], + [ + 232, + 234 + ], + [ + 235, + 238 + ], + [ + 239, + 241 + ], + [ + 244, + 245 + ], + [ + 258, + 259 + ], + [ + 265, + 267 + ], + [ + 271, + 275 + ], + [ + 276, + 277 + ] + ] + } + }, + { + "filename": "libvips/draw/drawink.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 45, + 110 + ], + [ + 111, + 138 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 48, + 49 + ], + [ + 51, + 52 + ], + [ + 53, + 56 + ], + [ + 58, + 61 + ], + [ + 63, + 65 + ], + [ + 66, + 72 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 79, + 81 + ], + [ + 86, + 87 + ], + [ + 89, + 92 + ], + [ + 93, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 106, + 107 + ], + [ + 114, + 129 + ], + [ + 131, + 133 + ], + [ + 136, + 137 + ] + ] + } + }, + { + "filename": "libvips/draw/drawink.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 67, + 126 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 70, + 71 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 89, + 91 + ], + [ + 94, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 115, + 117 + ], + [ + 119, + 120 + ], + [ + 122, + 123 + ] + ] + } + }, + { + "filename": "libvips/draw/pdraw.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 69 + ], + [ + 73, + 80 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 51 + ], + [ + 58, + 59 + ], + [ + 65, + 66 + ], + [ + 76, + 77 + ] + ] + } + }, + { + "filename": "libvips/foreign/analyze2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 16, + 44 + ], + [ + 71, + 234 + ], + [ + 235, + 289 + ], + [ + 293, + 339 + ], + [ + 345, + 374 + ], + [ + 375, + 387 + ], + [ + 417, + 477 + ], + [ + 480, + 487 + ], + [ + 490, + 521 + ], + [ + 523, + 596 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 19, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 35 + ], + [ + 40, + 41 + ], + [ + 74, + 75 + ], + [ + 81, + 82 + ], + [ + 83, + 85 + ], + [ + 88, + 216 + ], + [ + 220, + 221 + ], + [ + 225, + 226 + ], + [ + 229, + 231 + ], + [ + 238, + 239 + ], + [ + 243, + 244 + ], + [ + 245, + 247 + ], + [ + 251, + 253 + ], + [ + 255, + 256 + ], + [ + 260, + 261 + ], + [ + 264, + 266 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 273, + 274 + ], + [ + 277, + 278 + ], + [ + 280, + 282 + ], + [ + 285, + 286 + ], + [ + 296, + 297 + ], + [ + 301, + 303 + ], + [ + 304, + 309 + ], + [ + 313, + 314 + ], + [ + 315, + 316 + ], + [ + 318, + 319 + ], + [ + 321, + 322 + ], + [ + 324, + 325 + ], + [ + 326, + 329 + ], + [ + 332, + 336 + ], + [ + 348, + 353 + ], + [ + 355, + 356 + ], + [ + 361, + 363 + ], + [ + 366, + 371 + ], + [ + 378, + 379 + ], + [ + 383, + 384 + ], + [ + 420, + 423 + ], + [ + 426, + 430 + ], + [ + 432, + 433 + ], + [ + 436, + 437 + ], + [ + 440, + 442 + ], + [ + 443, + 445 + ], + [ + 446, + 449 + ], + [ + 452, + 455 + ], + [ + 458, + 461 + ], + [ + 463, + 467 + ], + [ + 470, + 474 + ], + [ + 483, + 484 + ], + [ + 493, + 496 + ], + [ + 498, + 499 + ], + [ + 500, + 502 + ], + [ + 504, + 505 + ], + [ + 508, + 509 + ], + [ + 511, + 512 + ], + [ + 513, + 514 + ], + [ + 517, + 518 + ], + [ + 526, + 529 + ], + [ + 531, + 532 + ], + [ + 534, + 537 + ], + [ + 539, + 544 + ], + [ + 545, + 546 + ], + [ + 547, + 549 + ], + [ + 550, + 551 + ], + [ + 554, + 555 + ], + [ + 560, + 562 + ], + [ + 566, + 570 + ], + [ + 571, + 572 + ], + [ + 574, + 575 + ], + [ + 577, + 582 + ], + [ + 584, + 589 + ], + [ + 590, + 591 + ], + [ + 592, + 593 + ] + ] + } + }, + { + "filename": "libvips/foreign/analyzeload.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 57, + 116 + ], + [ + 117, + 126 + ], + [ + 131, + 153 + ], + [ + 171, + 185 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 61 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 78, + 79 + ], + [ + 82, + 83 + ], + [ + 86, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ], + [ + 99, + 101 + ], + [ + 102, + 103 + ], + [ + 108, + 109 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 134, + 135 + ], + [ + 140, + 146 + ], + [ + 149, + 150 + ], + [ + 174, + 175 + ], + [ + 179, + 182 + ], + [ + 183, + 184 + ] + ] + } + }, + { + "filename": "libvips/foreign/cairo.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 40, + 95 + ], + [ + 97, + 129 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 43, + 44 + ], + [ + 47, + 49 + ], + [ + 51, + 52 + ], + [ + 53, + 56 + ], + [ + 57, + 69 + ], + [ + 75, + 76 + ], + [ + 79, + 81 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 91, + 92 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 116 + ], + [ + 117, + 118 + ], + [ + 119, + 125 + ], + [ + 126, + 128 + ] + ] + } + }, + { + "filename": "libvips/foreign/cgifsave.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 57, + 66 + ], + [ + 90, + 97 + ], + [ + 102, + 110 + ], + [ + 113, + 120 + ], + [ + 128, + 135 + ], + [ + 141, + 203 + ], + [ + 205, + 217 + ], + [ + 223, + 250 + ], + [ + 251, + 270 + ], + [ + 273, + 296 + ], + [ + 299, + 326 + ], + [ + 331, + 387 + ], + [ + 390, + 402 + ], + [ + 406, + 426 + ], + [ + 430, + 440 + ], + [ + 445, + 453 + ], + [ + 456, + 464 + ], + [ + 466, + 520 + ], + [ + 522, + 543 + ], + [ + 544, + 559 + ], + [ + 560, + 665 + ], + [ + 667, + 694 + ], + [ + 695, + 724 + ], + [ + 726, + 767 + ], + [ + 775, + 784 + ], + [ + 787, + 794 + ], + [ + 795, + 853 + ], + [ + 866, + 896 + ], + [ + 898, + 914 + ], + [ + 918, + 946 + ], + [ + 948, + 964 + ], + [ + 968, + 1004 + ], + [ + 1006, + 1022 + ], + [ + 1067, + 1083 + ], + [ + 1108, + 1115 + ], + [ + 1116, + 1139 + ], + [ + 1159, + 1173 + ] + ], + "lines_added": [ + [ + 10, + 11 + ], + [ + 12, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 26 + ], + [ + 30, + 32 + ], + [ + 60, + 63 + ], + [ + 93, + 94 + ], + [ + 105, + 107 + ], + [ + 116, + 117 + ], + [ + 131, + 132 + ], + [ + 144, + 146 + ], + [ + 148, + 149 + ], + [ + 152, + 154 + ], + [ + 155, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 162 + ], + [ + 163, + 166 + ], + [ + 167, + 168 + ], + [ + 170, + 172 + ], + [ + 173, + 174 + ], + [ + 175, + 177 + ], + [ + 179, + 180 + ], + [ + 186, + 188 + ], + [ + 193, + 194 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 208, + 209 + ], + [ + 213, + 214 + ], + [ + 226, + 228 + ], + [ + 233, + 235 + ], + [ + 237, + 238 + ], + [ + 240, + 242 + ], + [ + 245, + 247 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 266, + 267 + ], + [ + 276, + 277 + ], + [ + 282, + 284 + ], + [ + 285, + 287 + ], + [ + 290, + 291 + ], + [ + 292, + 293 + ], + [ + 302, + 303 + ], + [ + 304, + 305 + ], + [ + 306, + 307 + ], + [ + 310, + 314 + ], + [ + 318, + 319 + ], + [ + 320, + 323 + ], + [ + 334, + 344 + ], + [ + 346, + 359 + ], + [ + 362, + 365 + ], + [ + 366, + 370 + ], + [ + 374, + 375 + ], + [ + 378, + 381 + ], + [ + 382, + 384 + ], + [ + 393, + 396 + ], + [ + 397, + 399 + ], + [ + 409, + 410 + ], + [ + 415, + 416 + ], + [ + 417, + 418 + ], + [ + 422, + 423 + ], + [ + 433, + 435 + ], + [ + 436, + 437 + ], + [ + 448, + 450 + ], + [ + 459, + 461 + ], + [ + 469, + 471 + ], + [ + 472, + 474 + ], + [ + 476, + 479 + ], + [ + 485, + 486 + ], + [ + 490, + 492 + ], + [ + 495, + 501 + ], + [ + 503, + 504 + ], + [ + 507, + 508 + ], + [ + 509, + 511 + ], + [ + 512, + 514 + ], + [ + 516, + 517 + ], + [ + 525, + 526 + ], + [ + 531, + 533 + ], + [ + 536, + 537 + ], + [ + 539, + 540 + ], + [ + 547, + 549 + ], + [ + 551, + 554 + ], + [ + 555, + 556 + ], + [ + 563, + 564 + ], + [ + 566, + 570 + ], + [ + 573, + 574 + ], + [ + 580, + 582 + ], + [ + 584, + 586 + ], + [ + 592, + 593 + ], + [ + 594, + 595 + ], + [ + 601, + 602 + ], + [ + 604, + 605 + ], + [ + 606, + 607 + ], + [ + 609, + 612 + ], + [ + 613, + 618 + ], + [ + 619, + 622 + ], + [ + 625, + 627 + ], + [ + 628, + 629 + ], + [ + 632, + 633 + ], + [ + 636, + 637 + ], + [ + 638, + 639 + ], + [ + 640, + 642 + ], + [ + 647, + 650 + ], + [ + 655, + 660 + ], + [ + 661, + 662 + ], + [ + 670, + 675 + ], + [ + 679, + 681 + ], + [ + 684, + 686 + ], + [ + 689, + 691 + ], + [ + 698, + 702 + ], + [ + 706, + 716 + ], + [ + 719, + 721 + ], + [ + 729, + 731 + ], + [ + 732, + 740 + ], + [ + 742, + 743 + ], + [ + 748, + 751 + ], + [ + 752, + 753 + ], + [ + 754, + 757 + ], + [ + 758, + 759 + ], + [ + 760, + 762 + ], + [ + 763, + 764 + ], + [ + 778, + 779 + ], + [ + 780, + 781 + ], + [ + 790, + 791 + ], + [ + 798, + 801 + ], + [ + 802, + 804 + ], + [ + 805, + 808 + ], + [ + 809, + 811 + ], + [ + 812, + 815 + ], + [ + 816, + 818 + ], + [ + 819, + 822 + ], + [ + 823, + 825 + ], + [ + 826, + 829 + ], + [ + 830, + 832 + ], + [ + 833, + 836 + ], + [ + 837, + 839 + ], + [ + 840, + 843 + ], + [ + 844, + 846 + ], + [ + 849, + 850 + ], + [ + 869, + 871 + ], + [ + 873, + 874 + ], + [ + 876, + 877 + ], + [ + 880, + 881 + ], + [ + 882, + 884 + ], + [ + 885, + 886 + ], + [ + 889, + 891 + ], + [ + 892, + 893 + ], + [ + 901, + 904 + ], + [ + 905, + 907 + ], + [ + 910, + 911 + ], + [ + 921, + 923 + ], + [ + 925, + 926 + ], + [ + 930, + 932 + ], + [ + 933, + 935 + ], + [ + 936, + 937 + ], + [ + 940, + 941 + ], + [ + 942, + 943 + ], + [ + 951, + 954 + ], + [ + 955, + 957 + ], + [ + 960, + 961 + ], + [ + 971, + 973 + ], + [ + 975, + 976 + ], + [ + 978, + 979 + ], + [ + 983, + 985 + ], + [ + 986, + 988 + ], + [ + 989, + 992 + ], + [ + 993, + 994 + ], + [ + 997, + 999 + ], + [ + 1000, + 1001 + ], + [ + 1009, + 1012 + ], + [ + 1013, + 1015 + ], + [ + 1018, + 1019 + ], + [ + 1070, + 1071 + ], + [ + 1075, + 1078 + ], + [ + 1079, + 1080 + ], + [ + 1111, + 1112 + ], + [ + 1119, + 1122 + ], + [ + 1123, + 1126 + ], + [ + 1129, + 1130 + ], + [ + 1132, + 1133 + ], + [ + 1135, + 1136 + ], + [ + 1162, + 1163 + ], + [ + 1167, + 1170 + ], + [ + 1171, + 1172 + ] + ] + } + }, + { + "filename": "libvips/foreign/csvload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 98, + 139 + ], + [ + 140, + 179 + ], + [ + 180, + 214 + ], + [ + 218, + 229 + ], + [ + 231, + 266 + ], + [ + 270, + 277 + ], + [ + 278, + 325 + ], + [ + 329, + 346 + ], + [ + 348, + 388 + ], + [ + 390, + 419 + ], + [ + 421, + 449 + ], + [ + 450, + 475 + ], + [ + 476, + 486 + ], + [ + 488, + 529 + ], + [ + 536, + 566 + ], + [ + 568, + 577 + ], + [ + 583, + 602 + ], + [ + 608, + 650 + ], + [ + 656, + 672 + ], + [ + 683, + 709 + ], + [ + 713, + 729 + ], + [ + 739, + 760 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 101, + 103 + ], + [ + 105, + 106 + ], + [ + 109, + 112 + ], + [ + 113, + 114 + ], + [ + 117, + 118 + ], + [ + 124, + 126 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 143, + 145 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 159, + 161 + ], + [ + 162, + 163 + ], + [ + 165, + 169 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 175, + 176 + ], + [ + 183, + 185 + ], + [ + 186, + 187 + ], + [ + 189, + 190 + ], + [ + 193, + 196 + ], + [ + 197, + 199 + ], + [ + 200, + 202 + ], + [ + 203, + 204 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 234, + 237 + ], + [ + 238, + 239 + ], + [ + 241, + 242 + ], + [ + 244, + 246 + ], + [ + 249, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 255 + ], + [ + 259, + 260 + ], + [ + 262, + 263 + ], + [ + 273, + 274 + ], + [ + 281, + 285 + ], + [ + 286, + 289 + ], + [ + 290, + 291 + ], + [ + 293, + 296 + ], + [ + 297, + 299 + ], + [ + 301, + 303 + ], + [ + 305, + 309 + ], + [ + 310, + 311 + ], + [ + 312, + 314 + ], + [ + 315, + 316 + ], + [ + 319, + 320 + ], + [ + 321, + 322 + ], + [ + 332, + 335 + ], + [ + 338, + 343 + ], + [ + 351, + 354 + ], + [ + 356, + 358 + ], + [ + 361, + 363 + ], + [ + 364, + 365 + ], + [ + 367, + 374 + ], + [ + 375, + 377 + ], + [ + 378, + 379 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 393, + 396 + ], + [ + 399, + 404 + ], + [ + 406, + 413 + ], + [ + 415, + 416 + ], + [ + 424, + 425 + ], + [ + 426, + 427 + ], + [ + 430, + 436 + ], + [ + 437, + 442 + ], + [ + 444, + 446 + ], + [ + 453, + 455 + ], + [ + 458, + 461 + ], + [ + 463, + 464 + ], + [ + 467, + 468 + ], + [ + 469, + 470 + ], + [ + 471, + 472 + ], + [ + 479, + 480 + ], + [ + 482, + 483 + ], + [ + 491, + 494 + ], + [ + 495, + 497 + ], + [ + 498, + 501 + ], + [ + 502, + 504 + ], + [ + 505, + 508 + ], + [ + 509, + 511 + ], + [ + 512, + 515 + ], + [ + 516, + 518 + ], + [ + 521, + 522 + ], + [ + 524, + 526 + ], + [ + 539, + 541 + ], + [ + 543, + 544 + ], + [ + 545, + 546 + ], + [ + 549, + 550 + ], + [ + 554, + 558 + ], + [ + 559, + 561 + ], + [ + 562, + 563 + ], + [ + 571, + 572 + ], + [ + 573, + 574 + ], + [ + 586, + 587 + ], + [ + 589, + 592 + ], + [ + 593, + 595 + ], + [ + 598, + 599 + ], + [ + 611, + 613 + ], + [ + 615, + 616 + ], + [ + 620, + 621 + ], + [ + 622, + 623 + ], + [ + 625, + 627 + ], + [ + 628, + 629 + ], + [ + 632, + 633 + ], + [ + 638, + 639 + ], + [ + 642, + 643 + ], + [ + 644, + 645 + ], + [ + 646, + 647 + ], + [ + 659, + 665 + ], + [ + 668, + 669 + ], + [ + 686, + 687 + ], + [ + 688, + 689 + ], + [ + 690, + 691 + ], + [ + 695, + 696 + ], + [ + 698, + 699 + ], + [ + 701, + 702 + ], + [ + 705, + 706 + ], + [ + 716, + 717 + ], + [ + 721, + 724 + ], + [ + 725, + 726 + ], + [ + 742, + 743 + ], + [ + 749, + 750 + ], + [ + 754, + 757 + ], + [ + 758, + 759 + ] + ] + } + }, + { + "filename": "libvips/foreign/csvsave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 61, + 198 + ], + [ + 200, + 209 + ], + [ + 212, + 267 + ], + [ + 269, + 285 + ], + [ + 290, + 317 + ], + [ + 319, + 341 + ], + [ + 344, + 355 + ], + [ + 356, + 377 + ], + [ + 385, + 399 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 64, + 66 + ], + [ + 68, + 69 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 77, + 87 + ], + [ + 88, + 100 + ], + [ + 101, + 119 + ], + [ + 121, + 122 + ], + [ + 128, + 164 + ], + [ + 167, + 169 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 179, + 180 + ], + [ + 181, + 183 + ], + [ + 184, + 187 + ], + [ + 188, + 190 + ], + [ + 191, + 193 + ], + [ + 194, + 195 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 215, + 216 + ], + [ + 222, + 225 + ], + [ + 226, + 228 + ], + [ + 231, + 232 + ], + [ + 233, + 234 + ], + [ + 239, + 240 + ], + [ + 244, + 246 + ], + [ + 248, + 249 + ], + [ + 253, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 272, + 278 + ], + [ + 281, + 282 + ], + [ + 293, + 295 + ], + [ + 297, + 298 + ], + [ + 302, + 305 + ], + [ + 307, + 308 + ], + [ + 311, + 312 + ], + [ + 313, + 314 + ], + [ + 322, + 328 + ], + [ + 331, + 332 + ], + [ + 337, + 338 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 351, + 352 + ], + [ + 359, + 360 + ], + [ + 364, + 367 + ], + [ + 368, + 369 + ], + [ + 373, + 374 + ], + [ + 388, + 389 + ], + [ + 393, + 396 + ], + [ + 397, + 398 + ] + ] + } + }, + { + "filename": "libvips/foreign/dbh.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 20, + 91 + ], + [ + 95, + 106 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 23, + 44 + ], + [ + 45, + 61 + ], + [ + 62, + 81 + ], + [ + 82, + 88 + ], + [ + 98, + 106 + ] + ] + } + }, + { + "filename": "libvips/foreign/dzsave.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 12 + ], + [ + 16, + 23 + ], + [ + 54, + 65 + ], + [ + 100, + 128 + ], + [ + 129, + 138 + ], + [ + 139, + 165 + ], + [ + 195, + 315 + ], + [ + 325, + 406 + ], + [ + 412, + 428 + ], + [ + 438, + 445 + ], + [ + 453, + 460 + ], + [ + 465, + 525 + ], + [ + 529, + 590 + ], + [ + 591, + 603 + ], + [ + 609, + 660 + ], + [ + 665, + 673 + ], + [ + 680, + 687 + ], + [ + 690, + 708 + ], + [ + 723, + 730 + ], + [ + 731, + 749 + ], + [ + 761, + 775 + ], + [ + 777, + 802 + ], + [ + 804, + 816 + ], + [ + 819, + 839 + ], + [ + 842, + 860 + ], + [ + 863, + 978 + ], + [ + 979, + 1000 + ], + [ + 1004, + 1031 + ], + [ + 1035, + 1049 + ], + [ + 1052, + 1059 + ], + [ + 1063, + 1091 + ], + [ + 1092, + 1171 + ], + [ + 1174, + 1226 + ], + [ + 1227, + 1260 + ], + [ + 1262, + 1412 + ], + [ + 1421, + 1428 + ], + [ + 1429, + 1548 + ], + [ + 1567, + 1590 + ], + [ + 1593, + 1600 + ], + [ + 1602, + 1622 + ], + [ + 1629, + 1669 + ], + [ + 1670, + 1713 + ], + [ + 1718, + 1759 + ], + [ + 1763, + 1791 + ], + [ + 1792, + 1824 + ], + [ + 1826, + 1954 + ], + [ + 1956, + 1988 + ], + [ + 1990, + 2016 + ], + [ + 2021, + 2049 + ], + [ + 2051, + 2058 + ], + [ + 2062, + 2073 + ], + [ + 2075, + 2093 + ], + [ + 2094, + 2101 + ], + [ + 2103, + 2124 + ], + [ + 2129, + 2208 + ], + [ + 2211, + 2236 + ], + [ + 2237, + 2247 + ], + [ + 2252, + 2382 + ], + [ + 2385, + 2528 + ], + [ + 2529, + 2630 + ], + [ + 2647, + 2656 + ], + [ + 2659, + 2666 + ], + [ + 2668, + 2815 + ], + [ + 2817, + 2870 + ], + [ + 2877, + 2929 + ], + [ + 2934, + 2987 + ], + [ + 2993, + 3013 + ], + [ + 3020, + 3038 + ], + [ + 3044, + 3051 + ], + [ + 3058, + 3094 + ], + [ + 3096, + 3108 + ], + [ + 3110, + 3120 + ], + [ + 3124, + 3160 + ], + [ + 3161, + 3173 + ], + [ + 3182, + 3196 + ] + ], + "lines_added": [ + [ + 6, + 9 + ], + [ + 19, + 20 + ], + [ + 57, + 58 + ], + [ + 61, + 62 + ], + [ + 103, + 104 + ], + [ + 105, + 109 + ], + [ + 110, + 119 + ], + [ + 124, + 125 + ], + [ + 132, + 135 + ], + [ + 142, + 143 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 150, + 151 + ], + [ + 156, + 159 + ], + [ + 161, + 162 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 205, + 206 + ], + [ + 208, + 209 + ], + [ + 211, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 218, + 220 + ], + [ + 221, + 223 + ], + [ + 224, + 225 + ], + [ + 228, + 229 + ], + [ + 230, + 231 + ], + [ + 232, + 233 + ], + [ + 234, + 235 + ], + [ + 238, + 240 + ], + [ + 241, + 242 + ], + [ + 243, + 245 + ], + [ + 246, + 247 + ], + [ + 250, + 251 + ], + [ + 255, + 256 + ], + [ + 260, + 270 + ], + [ + 274, + 277 + ], + [ + 280, + 281 + ], + [ + 285, + 286 + ], + [ + 290, + 291 + ], + [ + 292, + 294 + ], + [ + 295, + 296 + ], + [ + 297, + 300 + ], + [ + 303, + 304 + ], + [ + 307, + 308 + ], + [ + 309, + 310 + ], + [ + 311, + 312 + ], + [ + 328, + 329 + ], + [ + 331, + 332 + ], + [ + 333, + 334 + ], + [ + 337, + 338 + ], + [ + 341, + 342 + ], + [ + 343, + 344 + ], + [ + 347, + 349 + ], + [ + 352, + 353 + ], + [ + 354, + 360 + ], + [ + 362, + 366 + ], + [ + 367, + 368 + ], + [ + 371, + 372 + ], + [ + 374, + 375 + ], + [ + 378, + 379 + ], + [ + 380, + 383 + ], + [ + 384, + 387 + ], + [ + 388, + 389 + ], + [ + 392, + 393 + ], + [ + 398, + 399 + ], + [ + 400, + 403 + ], + [ + 415, + 416 + ], + [ + 420, + 423 + ], + [ + 424, + 425 + ], + [ + 441, + 442 + ], + [ + 456, + 457 + ], + [ + 468, + 469 + ], + [ + 470, + 471 + ], + [ + 473, + 474 + ], + [ + 477, + 478 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 487, + 493 + ], + [ + 495, + 496 + ], + [ + 498, + 504 + ], + [ + 506, + 507 + ], + [ + 509, + 512 + ], + [ + 513, + 514 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 532, + 533 + ], + [ + 536, + 537 + ], + [ + 538, + 540 + ], + [ + 541, + 542 + ], + [ + 547, + 548 + ], + [ + 549, + 552 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ], + [ + 561, + 562 + ], + [ + 564, + 565 + ], + [ + 571, + 574 + ], + [ + 576, + 577 + ], + [ + 578, + 581 + ], + [ + 582, + 583 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 594, + 595 + ], + [ + 599, + 600 + ], + [ + 612, + 614 + ], + [ + 615, + 619 + ], + [ + 620, + 622 + ], + [ + 623, + 624 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 629, + 630 + ], + [ + 632, + 633 + ], + [ + 637, + 639 + ], + [ + 643, + 644 + ], + [ + 650, + 651 + ], + [ + 653, + 655 + ], + [ + 656, + 657 + ], + [ + 668, + 670 + ], + [ + 683, + 684 + ], + [ + 693, + 694 + ], + [ + 697, + 699 + ], + [ + 700, + 702 + ], + [ + 703, + 705 + ], + [ + 726, + 727 + ], + [ + 734, + 735 + ], + [ + 740, + 743 + ], + [ + 745, + 746 + ], + [ + 764, + 765 + ], + [ + 771, + 772 + ], + [ + 780, + 781 + ], + [ + 782, + 783 + ], + [ + 784, + 785 + ], + [ + 786, + 787 + ], + [ + 791, + 792 + ], + [ + 798, + 799 + ], + [ + 811, + 813 + ], + [ + 822, + 823 + ], + [ + 824, + 825 + ], + [ + 827, + 828 + ], + [ + 830, + 831 + ], + [ + 835, + 836 + ], + [ + 845, + 846 + ], + [ + 848, + 849 + ], + [ + 853, + 855 + ], + [ + 856, + 857 + ], + [ + 866, + 868 + ], + [ + 872, + 878 + ], + [ + 879, + 880 + ], + [ + 883, + 884 + ], + [ + 885, + 891 + ], + [ + 892, + 893 + ], + [ + 897, + 898 + ], + [ + 900, + 901 + ], + [ + 903, + 905 + ], + [ + 906, + 909 + ], + [ + 911, + 912 + ], + [ + 913, + 915 + ], + [ + 916, + 919 + ], + [ + 923, + 924 + ], + [ + 925, + 926 + ], + [ + 927, + 928 + ], + [ + 933, + 934 + ], + [ + 935, + 938 + ], + [ + 939, + 940 + ], + [ + 943, + 944 + ], + [ + 947, + 948 + ], + [ + 949, + 952 + ], + [ + 953, + 957 + ], + [ + 958, + 959 + ], + [ + 961, + 962 + ], + [ + 964, + 965 + ], + [ + 967, + 969 + ], + [ + 970, + 972 + ], + [ + 974, + 975 + ], + [ + 982, + 983 + ], + [ + 984, + 985 + ], + [ + 987, + 988 + ], + [ + 993, + 994 + ], + [ + 996, + 997 + ], + [ + 1007, + 1011 + ], + [ + 1015, + 1017 + ], + [ + 1021, + 1023 + ], + [ + 1024, + 1025 + ], + [ + 1026, + 1028 + ], + [ + 1038, + 1039 + ], + [ + 1040, + 1043 + ], + [ + 1045, + 1046 + ], + [ + 1055, + 1056 + ], + [ + 1066, + 1068 + ], + [ + 1072, + 1073 + ], + [ + 1078, + 1079 + ], + [ + 1080, + 1081 + ], + [ + 1083, + 1088 + ], + [ + 1095, + 1106 + ], + [ + 1108, + 1109 + ], + [ + 1112, + 1113 + ], + [ + 1118, + 1120 + ], + [ + 1121, + 1123 + ], + [ + 1125, + 1138 + ], + [ + 1139, + 1141 + ], + [ + 1142, + 1143 + ], + [ + 1146, + 1147 + ], + [ + 1150, + 1151 + ], + [ + 1152, + 1155 + ], + [ + 1158, + 1159 + ], + [ + 1160, + 1162 + ], + [ + 1163, + 1164 + ], + [ + 1167, + 1168 + ], + [ + 1177, + 1178 + ], + [ + 1183, + 1185 + ], + [ + 1186, + 1188 + ], + [ + 1189, + 1193 + ], + [ + 1194, + 1198 + ], + [ + 1199, + 1201 + ], + [ + 1203, + 1204 + ], + [ + 1205, + 1208 + ], + [ + 1209, + 1210 + ], + [ + 1212, + 1213 + ], + [ + 1214, + 1215 + ], + [ + 1216, + 1217 + ], + [ + 1222, + 1223 + ], + [ + 1230, + 1231 + ], + [ + 1235, + 1236 + ], + [ + 1237, + 1239 + ], + [ + 1240, + 1244 + ], + [ + 1245, + 1246 + ], + [ + 1247, + 1248 + ], + [ + 1249, + 1250 + ], + [ + 1252, + 1254 + ], + [ + 1256, + 1257 + ], + [ + 1265, + 1266 + ], + [ + 1267, + 1269 + ], + [ + 1270, + 1271 + ], + [ + 1273, + 1274 + ], + [ + 1277, + 1278 + ], + [ + 1281, + 1282 + ], + [ + 1288, + 1289 + ], + [ + 1295, + 1296 + ], + [ + 1298, + 1299 + ], + [ + 1300, + 1302 + ], + [ + 1303, + 1307 + ], + [ + 1309, + 1310 + ], + [ + 1313, + 1315 + ], + [ + 1316, + 1317 + ], + [ + 1318, + 1321 + ], + [ + 1322, + 1324 + ], + [ + 1325, + 1327 + ], + [ + 1328, + 1329 + ], + [ + 1332, + 1333 + ], + [ + 1339, + 1341 + ], + [ + 1345, + 1348 + ], + [ + 1349, + 1350 + ], + [ + 1351, + 1354 + ], + [ + 1355, + 1356 + ], + [ + 1357, + 1358 + ], + [ + 1361, + 1363 + ], + [ + 1369, + 1370 + ], + [ + 1372, + 1373 + ], + [ + 1374, + 1375 + ], + [ + 1376, + 1378 + ], + [ + 1381, + 1384 + ], + [ + 1386, + 1387 + ], + [ + 1388, + 1390 + ], + [ + 1393, + 1395 + ], + [ + 1398, + 1407 + ], + [ + 1408, + 1409 + ], + [ + 1424, + 1425 + ], + [ + 1432, + 1438 + ], + [ + 1439, + 1440 + ], + [ + 1441, + 1443 + ], + [ + 1444, + 1445 + ], + [ + 1446, + 1448 + ], + [ + 1449, + 1450 + ], + [ + 1453, + 1454 + ], + [ + 1460, + 1462 + ], + [ + 1463, + 1467 + ], + [ + 1468, + 1469 + ], + [ + 1470, + 1471 + ], + [ + 1474, + 1476 + ], + [ + 1479, + 1480 + ], + [ + 1486, + 1487 + ], + [ + 1490, + 1491 + ], + [ + 1493, + 1495 + ], + [ + 1496, + 1498 + ], + [ + 1499, + 1502 + ], + [ + 1503, + 1504 + ], + [ + 1506, + 1507 + ], + [ + 1508, + 1509 + ], + [ + 1511, + 1512 + ], + [ + 1515, + 1516 + ], + [ + 1519, + 1521 + ], + [ + 1522, + 1523 + ], + [ + 1528, + 1529 + ], + [ + 1532, + 1533 + ], + [ + 1538, + 1539 + ], + [ + 1540, + 1541 + ], + [ + 1544, + 1545 + ], + [ + 1570, + 1571 + ], + [ + 1572, + 1573 + ], + [ + 1574, + 1580 + ], + [ + 1585, + 1587 + ], + [ + 1596, + 1597 + ], + [ + 1605, + 1606 + ], + [ + 1612, + 1613 + ], + [ + 1615, + 1616 + ], + [ + 1618, + 1619 + ], + [ + 1632, + 1633 + ], + [ + 1634, + 1635 + ], + [ + 1640, + 1641 + ], + [ + 1646, + 1647 + ], + [ + 1651, + 1652 + ], + [ + 1658, + 1659 + ], + [ + 1660, + 1663 + ], + [ + 1664, + 1666 + ], + [ + 1673, + 1674 + ], + [ + 1677, + 1678 + ], + [ + 1679, + 1680 + ], + [ + 1686, + 1689 + ], + [ + 1694, + 1695 + ], + [ + 1699, + 1703 + ], + [ + 1704, + 1705 + ], + [ + 1709, + 1710 + ], + [ + 1721, + 1736 + ], + [ + 1740, + 1742 + ], + [ + 1743, + 1744 + ], + [ + 1746, + 1748 + ], + [ + 1751, + 1754 + ], + [ + 1755, + 1756 + ], + [ + 1766, + 1767 + ], + [ + 1769, + 1770 + ], + [ + 1772, + 1774 + ], + [ + 1779, + 1780 + ], + [ + 1781, + 1782 + ], + [ + 1787, + 1788 + ], + [ + 1795, + 1798 + ], + [ + 1800, + 1802 + ], + [ + 1803, + 1808 + ], + [ + 1814, + 1815 + ], + [ + 1816, + 1817 + ], + [ + 1820, + 1821 + ], + [ + 1829, + 1830 + ], + [ + 1832, + 1833 + ], + [ + 1835, + 1840 + ], + [ + 1841, + 1843 + ], + [ + 1844, + 1846 + ], + [ + 1851, + 1852 + ], + [ + 1853, + 1856 + ], + [ + 1858, + 1859 + ], + [ + 1862, + 1863 + ], + [ + 1866, + 1870 + ], + [ + 1871, + 1874 + ], + [ + 1876, + 1879 + ], + [ + 1881, + 1882 + ], + [ + 1886, + 1892 + ], + [ + 1893, + 1894 + ], + [ + 1900, + 1901 + ], + [ + 1902, + 1904 + ], + [ + 1905, + 1906 + ], + [ + 1907, + 1908 + ], + [ + 1909, + 1912 + ], + [ + 1913, + 1914 + ], + [ + 1916, + 1918 + ], + [ + 1920, + 1921 + ], + [ + 1923, + 1924 + ], + [ + 1926, + 1927 + ], + [ + 1929, + 1930 + ], + [ + 1934, + 1935 + ], + [ + 1937, + 1943 + ], + [ + 1944, + 1945 + ], + [ + 1947, + 1948 + ], + [ + 1950, + 1951 + ], + [ + 1959, + 1960 + ], + [ + 1965, + 1966 + ], + [ + 1967, + 1969 + ], + [ + 1974, + 1977 + ], + [ + 1979, + 1980 + ], + [ + 1984, + 1985 + ], + [ + 1993, + 1994 + ], + [ + 1996, + 1998 + ], + [ + 2000, + 2002 + ], + [ + 2006, + 2007 + ], + [ + 2012, + 2013 + ], + [ + 2024, + 2026 + ], + [ + 2031, + 2032 + ], + [ + 2036, + 2037 + ], + [ + 2043, + 2044 + ], + [ + 2045, + 2046 + ], + [ + 2054, + 2055 + ], + [ + 2065, + 2066 + ], + [ + 2068, + 2070 + ], + [ + 2078, + 2082 + ], + [ + 2085, + 2086 + ], + [ + 2088, + 2090 + ], + [ + 2097, + 2098 + ], + [ + 2106, + 2108 + ], + [ + 2110, + 2112 + ], + [ + 2113, + 2116 + ], + [ + 2117, + 2118 + ], + [ + 2119, + 2121 + ], + [ + 2132, + 2133 + ], + [ + 2134, + 2135 + ], + [ + 2138, + 2142 + ], + [ + 2145, + 2146 + ], + [ + 2148, + 2149 + ], + [ + 2151, + 2157 + ], + [ + 2159, + 2162 + ], + [ + 2165, + 2168 + ], + [ + 2170, + 2171 + ], + [ + 2177, + 2178 + ], + [ + 2179, + 2182 + ], + [ + 2183, + 2186 + ], + [ + 2187, + 2188 + ], + [ + 2191, + 2192 + ], + [ + 2194, + 2195 + ], + [ + 2200, + 2202 + ], + [ + 2204, + 2205 + ], + [ + 2214, + 2215 + ], + [ + 2218, + 2219 + ], + [ + 2220, + 2221 + ], + [ + 2222, + 2223 + ], + [ + 2227, + 2228 + ], + [ + 2231, + 2233 + ], + [ + 2240, + 2244 + ], + [ + 2255, + 2256 + ], + [ + 2257, + 2258 + ], + [ + 2260, + 2262 + ], + [ + 2264, + 2265 + ], + [ + 2268, + 2269 + ], + [ + 2272, + 2273 + ], + [ + 2274, + 2275 + ], + [ + 2279, + 2280 + ], + [ + 2282, + 2284 + ], + [ + 2285, + 2287 + ], + [ + 2291, + 2294 + ], + [ + 2299, + 2302 + ], + [ + 2307, + 2309 + ], + [ + 2313, + 2314 + ], + [ + 2315, + 2316 + ], + [ + 2322, + 2325 + ], + [ + 2328, + 2329 + ], + [ + 2330, + 2332 + ], + [ + 2337, + 2340 + ], + [ + 2345, + 2347 + ], + [ + 2349, + 2351 + ], + [ + 2352, + 2354 + ], + [ + 2357, + 2359 + ], + [ + 2360, + 2362 + ], + [ + 2363, + 2366 + ], + [ + 2369, + 2375 + ], + [ + 2378, + 2379 + ], + [ + 2388, + 2390 + ], + [ + 2395, + 2399 + ], + [ + 2402, + 2404 + ], + [ + 2409, + 2415 + ], + [ + 2416, + 2417 + ], + [ + 2420, + 2422 + ], + [ + 2426, + 2434 + ], + [ + 2439, + 2441 + ], + [ + 2442, + 2448 + ], + [ + 2449, + 2453 + ], + [ + 2457, + 2458 + ], + [ + 2460, + 2461 + ], + [ + 2463, + 2466 + ], + [ + 2467, + 2468 + ], + [ + 2474, + 2477 + ], + [ + 2482, + 2485 + ], + [ + 2486, + 2488 + ], + [ + 2489, + 2490 + ], + [ + 2493, + 2495 + ], + [ + 2499, + 2501 + ], + [ + 2504, + 2506 + ], + [ + 2508, + 2511 + ], + [ + 2512, + 2514 + ], + [ + 2515, + 2518 + ], + [ + 2519, + 2522 + ], + [ + 2524, + 2525 + ], + [ + 2532, + 2536 + ], + [ + 2540, + 2541 + ], + [ + 2542, + 2546 + ], + [ + 2549, + 2550 + ], + [ + 2551, + 2552 + ], + [ + 2553, + 2555 + ], + [ + 2557, + 2561 + ], + [ + 2565, + 2566 + ], + [ + 2569, + 2571 + ], + [ + 2576, + 2578 + ], + [ + 2579, + 2580 + ], + [ + 2581, + 2583 + ], + [ + 2586, + 2588 + ], + [ + 2591, + 2593 + ], + [ + 2597, + 2599 + ], + [ + 2605, + 2607 + ], + [ + 2608, + 2611 + ], + [ + 2612, + 2615 + ], + [ + 2618, + 2621 + ], + [ + 2624, + 2625 + ], + [ + 2626, + 2627 + ], + [ + 2650, + 2651 + ], + [ + 2652, + 2653 + ], + [ + 2662, + 2663 + ], + [ + 2671, + 2674 + ], + [ + 2675, + 2677 + ], + [ + 2678, + 2681 + ], + [ + 2682, + 2684 + ], + [ + 2685, + 2688 + ], + [ + 2689, + 2691 + ], + [ + 2692, + 2695 + ], + [ + 2696, + 2698 + ], + [ + 2699, + 2702 + ], + [ + 2703, + 2705 + ], + [ + 2706, + 2709 + ], + [ + 2710, + 2712 + ], + [ + 2713, + 2716 + ], + [ + 2717, + 2719 + ], + [ + 2720, + 2723 + ], + [ + 2724, + 2726 + ], + [ + 2727, + 2730 + ], + [ + 2731, + 2733 + ], + [ + 2734, + 2737 + ], + [ + 2738, + 2740 + ], + [ + 2741, + 2744 + ], + [ + 2745, + 2747 + ], + [ + 2748, + 2751 + ], + [ + 2752, + 2754 + ], + [ + 2755, + 2758 + ], + [ + 2759, + 2761 + ], + [ + 2762, + 2765 + ], + [ + 2766, + 2768 + ], + [ + 2772, + 2775 + ], + [ + 2776, + 2778 + ], + [ + 2779, + 2782 + ], + [ + 2783, + 2785 + ], + [ + 2786, + 2789 + ], + [ + 2790, + 2792 + ], + [ + 2793, + 2796 + ], + [ + 2797, + 2799 + ], + [ + 2802, + 2803 + ], + [ + 2804, + 2806 + ], + [ + 2809, + 2812 + ], + [ + 2820, + 2821 + ], + [ + 2826, + 2828 + ], + [ + 2830, + 2831 + ], + [ + 2836, + 2837 + ], + [ + 2838, + 2840 + ], + [ + 2841, + 2842 + ], + [ + 2845, + 2846 + ], + [ + 2847, + 2848 + ], + [ + 2854, + 2855 + ], + [ + 2857, + 2863 + ], + [ + 2866, + 2867 + ], + [ + 2880, + 2881 + ], + [ + 2886, + 2888 + ], + [ + 2890, + 2891 + ], + [ + 2897, + 2899 + ], + [ + 2900, + 2901 + ], + [ + 2904, + 2905 + ], + [ + 2906, + 2907 + ], + [ + 2913, + 2914 + ], + [ + 2916, + 2922 + ], + [ + 2925, + 2926 + ], + [ + 2937, + 2939 + ], + [ + 2941, + 2942 + ], + [ + 2948, + 2950 + ], + [ + 2951, + 2953 + ], + [ + 2954, + 2957 + ], + [ + 2958, + 2959 + ], + [ + 2962, + 2963 + ], + [ + 2964, + 2965 + ], + [ + 2971, + 2972 + ], + [ + 2974, + 2980 + ], + [ + 2983, + 2984 + ], + [ + 2996, + 2998 + ], + [ + 3004, + 3007 + ], + [ + 3009, + 3010 + ], + [ + 3023, + 3024 + ], + [ + 3026, + 3030 + ], + [ + 3031, + 3032 + ], + [ + 3034, + 3035 + ], + [ + 3047, + 3048 + ], + [ + 3061, + 3064 + ], + [ + 3066, + 3067 + ], + [ + 3069, + 3071 + ], + [ + 3076, + 3077 + ], + [ + 3081, + 3084 + ], + [ + 3085, + 3086 + ], + [ + 3090, + 3091 + ], + [ + 3099, + 3102 + ], + [ + 3104, + 3105 + ], + [ + 3113, + 3114 + ], + [ + 3116, + 3117 + ], + [ + 3127, + 3128 + ], + [ + 3133, + 3134 + ], + [ + 3135, + 3138 + ], + [ + 3139, + 3142 + ], + [ + 3145, + 3146 + ], + [ + 3148, + 3149 + ], + [ + 3151, + 3152 + ], + [ + 3156, + 3157 + ], + [ + 3164, + 3167 + ], + [ + 3169, + 3170 + ], + [ + 3185, + 3186 + ], + [ + 3190, + 3193 + ], + [ + 3194, + 3195 + ] + ] + } + }, + { + "filename": "libvips/foreign/exif.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 45 + ], + [ + 82, + 288 + ], + [ + 290, + 297 + ], + [ + 298, + 346 + ], + [ + 353, + 425 + ], + [ + 429, + 453 + ], + [ + 457, + 465 + ], + [ + 466, + 505 + ], + [ + 506, + 574 + ], + [ + 575, + 607 + ], + [ + 610, + 617 + ], + [ + 622, + 651 + ], + [ + 652, + 693 + ], + [ + 696, + 704 + ], + [ + 706, + 772 + ], + [ + 774, + 789 + ], + [ + 795, + 827 + ], + [ + 829, + 869 + ], + [ + 873, + 989 + ], + [ + 990, + 1018 + ], + [ + 1028, + 1211 + ], + [ + 1213, + 1251 + ], + [ + 1255, + 1310 + ], + [ + 1311, + 1393 + ], + [ + 1396, + 1491 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 20, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 36 + ], + [ + 41, + 42 + ], + [ + 85, + 86 + ], + [ + 91, + 109 + ], + [ + 112, + 113 + ], + [ + 116, + 124 + ], + [ + 127, + 128 + ], + [ + 131, + 133 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 143, + 146 + ], + [ + 147, + 148 + ], + [ + 150, + 151 + ], + [ + 152, + 154 + ], + [ + 157, + 161 + ], + [ + 163, + 164 + ], + [ + 170, + 173 + ], + [ + 174, + 177 + ], + [ + 179, + 182 + ], + [ + 184, + 186 + ], + [ + 188, + 199 + ], + [ + 202, + 204 + ], + [ + 205, + 206 + ], + [ + 209, + 214 + ], + [ + 216, + 219 + ], + [ + 220, + 221 + ], + [ + 222, + 223 + ], + [ + 226, + 228 + ], + [ + 229, + 231 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 243, + 245 + ], + [ + 246, + 248 + ], + [ + 251, + 252 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 262 + ], + [ + 267, + 269 + ], + [ + 273, + 275 + ], + [ + 280, + 281 + ], + [ + 284, + 285 + ], + [ + 293, + 294 + ], + [ + 301, + 302 + ], + [ + 305, + 306 + ], + [ + 307, + 308 + ], + [ + 309, + 310 + ], + [ + 311, + 316 + ], + [ + 318, + 324 + ], + [ + 326, + 332 + ], + [ + 334, + 337 + ], + [ + 338, + 341 + ], + [ + 342, + 343 + ], + [ + 356, + 357 + ], + [ + 358, + 360 + ], + [ + 361, + 363 + ], + [ + 366, + 367 + ], + [ + 370, + 371 + ], + [ + 372, + 373 + ], + [ + 374, + 375 + ], + [ + 377, + 380 + ], + [ + 383, + 385 + ], + [ + 388, + 389 + ], + [ + 390, + 392 + ], + [ + 395, + 396 + ], + [ + 399, + 402 + ], + [ + 403, + 404 + ], + [ + 407, + 408 + ], + [ + 411, + 414 + ], + [ + 415, + 416 + ], + [ + 421, + 422 + ], + [ + 432, + 436 + ], + [ + 440, + 442 + ], + [ + 444, + 447 + ], + [ + 449, + 450 + ], + [ + 460, + 462 + ], + [ + 469, + 471 + ], + [ + 474, + 476 + ], + [ + 479, + 482 + ], + [ + 486, + 488 + ], + [ + 489, + 490 + ], + [ + 495, + 496 + ], + [ + 497, + 498 + ], + [ + 501, + 502 + ], + [ + 509, + 515 + ], + [ + 517, + 519 + ], + [ + 521, + 522 + ], + [ + 525, + 526 + ], + [ + 527, + 531 + ], + [ + 536, + 537 + ], + [ + 542, + 544 + ], + [ + 545, + 547 + ], + [ + 548, + 549 + ], + [ + 551, + 552 + ], + [ + 553, + 556 + ], + [ + 558, + 561 + ], + [ + 562, + 563 + ], + [ + 565, + 566 + ], + [ + 569, + 571 + ], + [ + 578, + 580 + ], + [ + 585, + 586 + ], + [ + 589, + 600 + ], + [ + 603, + 604 + ], + [ + 613, + 614 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 629, + 630 + ], + [ + 635, + 636 + ], + [ + 637, + 639 + ], + [ + 640, + 641 + ], + [ + 646, + 648 + ], + [ + 655, + 658 + ], + [ + 663, + 664 + ], + [ + 667, + 669 + ], + [ + 670, + 671 + ], + [ + 673, + 674 + ], + [ + 675, + 678 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 684, + 685 + ], + [ + 686, + 688 + ], + [ + 689, + 690 + ], + [ + 699, + 701 + ], + [ + 709, + 712 + ], + [ + 717, + 718 + ], + [ + 721, + 723 + ], + [ + 724, + 725 + ], + [ + 727, + 729 + ], + [ + 733, + 735 + ], + [ + 736, + 739 + ], + [ + 740, + 741 + ], + [ + 743, + 744 + ], + [ + 746, + 748 + ], + [ + 752, + 754 + ], + [ + 755, + 757 + ], + [ + 758, + 759 + ], + [ + 763, + 765 + ], + [ + 768, + 769 + ], + [ + 777, + 778 + ], + [ + 779, + 780 + ], + [ + 783, + 784 + ], + [ + 785, + 786 + ], + [ + 798, + 799 + ], + [ + 801, + 802 + ], + [ + 803, + 804 + ], + [ + 807, + 808 + ], + [ + 809, + 812 + ], + [ + 813, + 814 + ], + [ + 816, + 817 + ], + [ + 819, + 820 + ], + [ + 823, + 824 + ], + [ + 832, + 833 + ], + [ + 835, + 839 + ], + [ + 840, + 841 + ], + [ + 844, + 845 + ], + [ + 850, + 851 + ], + [ + 855, + 856 + ], + [ + 857, + 861 + ], + [ + 862, + 863 + ], + [ + 865, + 866 + ], + [ + 876, + 878 + ], + [ + 883, + 884 + ], + [ + 887, + 889 + ], + [ + 891, + 892 + ], + [ + 894, + 898 + ], + [ + 899, + 900 + ], + [ + 906, + 908 + ], + [ + 913, + 914 + ], + [ + 917, + 919 + ], + [ + 923, + 927 + ], + [ + 928, + 929 + ], + [ + 934, + 936 + ], + [ + 941, + 942 + ], + [ + 943, + 944 + ], + [ + 947, + 950 + ], + [ + 951, + 953 + ], + [ + 958, + 959 + ], + [ + 962, + 964 + ], + [ + 970, + 973 + ], + [ + 977, + 983 + ], + [ + 984, + 986 + ], + [ + 993, + 994 + ], + [ + 999, + 1001 + ], + [ + 1005, + 1009 + ], + [ + 1010, + 1011 + ], + [ + 1014, + 1015 + ], + [ + 1031, + 1033 + ], + [ + 1038, + 1046 + ], + [ + 1048, + 1049 + ], + [ + 1051, + 1052 + ], + [ + 1053, + 1055 + ], + [ + 1056, + 1060 + ], + [ + 1061, + 1062 + ], + [ + 1064, + 1065 + ], + [ + 1067, + 1068 + ], + [ + 1074, + 1076 + ], + [ + 1078, + 1079 + ], + [ + 1080, + 1082 + ], + [ + 1083, + 1084 + ], + [ + 1086, + 1087 + ], + [ + 1089, + 1090 + ], + [ + 1096, + 1097 + ], + [ + 1098, + 1100 + ], + [ + 1104, + 1105 + ], + [ + 1106, + 1107 + ], + [ + 1110, + 1113 + ], + [ + 1117, + 1121 + ], + [ + 1125, + 1126 + ], + [ + 1131, + 1132 + ], + [ + 1133, + 1134 + ], + [ + 1136, + 1137 + ], + [ + 1142, + 1143 + ], + [ + 1144, + 1145 + ], + [ + 1147, + 1148 + ], + [ + 1152, + 1153 + ], + [ + 1155, + 1156 + ], + [ + 1161, + 1162 + ], + [ + 1164, + 1166 + ], + [ + 1169, + 1172 + ], + [ + 1173, + 1175 + ], + [ + 1176, + 1177 + ], + [ + 1179, + 1182 + ], + [ + 1185, + 1188 + ], + [ + 1189, + 1190 + ], + [ + 1191, + 1192 + ], + [ + 1196, + 1199 + ], + [ + 1200, + 1201 + ], + [ + 1202, + 1203 + ], + [ + 1206, + 1208 + ], + [ + 1216, + 1218 + ], + [ + 1221, + 1224 + ], + [ + 1226, + 1228 + ], + [ + 1229, + 1230 + ], + [ + 1231, + 1234 + ], + [ + 1239, + 1243 + ], + [ + 1245, + 1246 + ], + [ + 1247, + 1248 + ], + [ + 1258, + 1259 + ], + [ + 1262, + 1263 + ], + [ + 1267, + 1268 + ], + [ + 1270, + 1273 + ], + [ + 1277, + 1278 + ], + [ + 1280, + 1282 + ], + [ + 1287, + 1289 + ], + [ + 1294, + 1297 + ], + [ + 1298, + 1299 + ], + [ + 1301, + 1305 + ], + [ + 1306, + 1307 + ], + [ + 1314, + 1317 + ], + [ + 1321, + 1322 + ], + [ + 1324, + 1328 + ], + [ + 1329, + 1332 + ], + [ + 1333, + 1335 + ], + [ + 1337, + 1338 + ], + [ + 1339, + 1340 + ], + [ + 1343, + 1344 + ], + [ + 1347, + 1352 + ], + [ + 1355, + 1356 + ], + [ + 1359, + 1360 + ], + [ + 1366, + 1368 + ], + [ + 1373, + 1374 + ], + [ + 1376, + 1379 + ], + [ + 1383, + 1384 + ], + [ + 1389, + 1390 + ], + [ + 1399, + 1403 + ], + [ + 1404, + 1406 + ], + [ + 1407, + 1408 + ], + [ + 1410, + 1414 + ], + [ + 1419, + 1420 + ], + [ + 1423, + 1424 + ], + [ + 1427, + 1430 + ], + [ + 1434, + 1437 + ], + [ + 1441, + 1444 + ], + [ + 1448, + 1451 + ], + [ + 1456, + 1461 + ], + [ + 1465, + 1466 + ], + [ + 1468, + 1470 + ], + [ + 1471, + 1472 + ], + [ + 1473, + 1474 + ], + [ + 1479, + 1480 + ], + [ + 1481, + 1482 + ], + [ + 1485, + 1486 + ], + [ + 1487, + 1488 + ] + ] + } + }, + { + "filename": "libvips/foreign/fits.c", + "line_filter": { + "diff_chunks": [ + [ + 18, + 25 + ], + [ + 28, + 37 + ], + [ + 40, + 68 + ], + [ + 90, + 101 + ], + [ + 120, + 127 + ], + [ + 130, + 199 + ], + [ + 200, + 216 + ], + [ + 225, + 269 + ], + [ + 273, + 285 + ], + [ + 292, + 324 + ], + [ + 325, + 402 + ], + [ + 405, + 458 + ], + [ + 460, + 602 + ], + [ + 613, + 621 + ], + [ + 625, + 658 + ], + [ + 664, + 737 + ], + [ + 742, + 778 + ] + ], + "lines_added": [ + [ + 21, + 22 + ], + [ + 31, + 32 + ], + [ + 33, + 34 + ], + [ + 43, + 44 + ], + [ + 45, + 49 + ], + [ + 50, + 59 + ], + [ + 64, + 65 + ], + [ + 93, + 94 + ], + [ + 97, + 98 + ], + [ + 123, + 124 + ], + [ + 133, + 134 + ], + [ + 137, + 139 + ], + [ + 144, + 145 + ], + [ + 146, + 148 + ], + [ + 149, + 150 + ], + [ + 154, + 156 + ], + [ + 160, + 161 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 175, + 177 + ], + [ + 178, + 179 + ], + [ + 183, + 185 + ], + [ + 187, + 191 + ], + [ + 195, + 196 + ], + [ + 203, + 208 + ], + [ + 212, + 213 + ], + [ + 228, + 233 + ], + [ + 235, + 236 + ], + [ + 238, + 243 + ], + [ + 247, + 248 + ], + [ + 251, + 254 + ], + [ + 257, + 261 + ], + [ + 265, + 266 + ], + [ + 276, + 282 + ], + [ + 295, + 297 + ], + [ + 302, + 304 + ], + [ + 305, + 309 + ], + [ + 313, + 315 + ], + [ + 319, + 321 + ], + [ + 328, + 332 + ], + [ + 333, + 337 + ], + [ + 341, + 344 + ], + [ + 347, + 350 + ], + [ + 352, + 353 + ], + [ + 356, + 359 + ], + [ + 361, + 363 + ], + [ + 369, + 371 + ], + [ + 373, + 374 + ], + [ + 377, + 378 + ], + [ + 381, + 382 + ], + [ + 383, + 385 + ], + [ + 386, + 389 + ], + [ + 391, + 392 + ], + [ + 393, + 394 + ], + [ + 397, + 399 + ], + [ + 408, + 413 + ], + [ + 414, + 415 + ], + [ + 417, + 418 + ], + [ + 420, + 430 + ], + [ + 432, + 433 + ], + [ + 434, + 435 + ], + [ + 436, + 437 + ], + [ + 439, + 440 + ], + [ + 444, + 445 + ], + [ + 450, + 451 + ], + [ + 454, + 455 + ], + [ + 463, + 465 + ], + [ + 469, + 472 + ], + [ + 473, + 474 + ], + [ + 475, + 477 + ], + [ + 481, + 482 + ], + [ + 487, + 488 + ], + [ + 489, + 490 + ], + [ + 493, + 494 + ], + [ + 498, + 502 + ], + [ + 504, + 507 + ], + [ + 510, + 511 + ], + [ + 512, + 513 + ], + [ + 516, + 517 + ], + [ + 520, + 527 + ], + [ + 529, + 530 + ], + [ + 533, + 534 + ], + [ + 538, + 539 + ], + [ + 542, + 544 + ], + [ + 545, + 547 + ], + [ + 549, + 550 + ], + [ + 551, + 552 + ], + [ + 553, + 554 + ], + [ + 557, + 558 + ], + [ + 564, + 567 + ], + [ + 571, + 573 + ], + [ + 574, + 576 + ], + [ + 579, + 582 + ], + [ + 587, + 588 + ], + [ + 589, + 594 + ], + [ + 598, + 599 + ], + [ + 616, + 618 + ], + [ + 628, + 630 + ], + [ + 631, + 632 + ], + [ + 634, + 635 + ], + [ + 638, + 641 + ], + [ + 642, + 644 + ], + [ + 645, + 648 + ], + [ + 650, + 651 + ], + [ + 654, + 655 + ], + [ + 667, + 669 + ], + [ + 670, + 674 + ], + [ + 679, + 683 + ], + [ + 685, + 689 + ], + [ + 691, + 694 + ], + [ + 695, + 696 + ], + [ + 699, + 700 + ], + [ + 703, + 705 + ], + [ + 711, + 714 + ], + [ + 719, + 722 + ], + [ + 723, + 724 + ], + [ + 730, + 732 + ], + [ + 733, + 734 + ], + [ + 745, + 750 + ], + [ + 754, + 755 + ], + [ + 758, + 759 + ], + [ + 762, + 763 + ], + [ + 764, + 766 + ], + [ + 767, + 771 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ] + ] + } + }, + { + "filename": "libvips/foreign/fitsload.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 67, + 178 + ], + [ + 180, + 187 + ], + [ + 192, + 208 + ], + [ + 210, + 245 + ], + [ + 247, + 270 + ], + [ + 278, + 348 + ], + [ + 353, + 366 + ], + [ + 368, + 384 + ], + [ + 386, + 405 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 70, + 72 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 80, + 81 + ], + [ + 84, + 85 + ], + [ + 86, + 88 + ], + [ + 93, + 95 + ], + [ + 98, + 103 + ], + [ + 108, + 110 + ], + [ + 111, + 112 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 132, + 136 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 145, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 157, + 159 + ], + [ + 161, + 165 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 183, + 184 + ], + [ + 195, + 196 + ], + [ + 204, + 205 + ], + [ + 213, + 214 + ], + [ + 219, + 221 + ], + [ + 223, + 224 + ], + [ + 228, + 231 + ], + [ + 232, + 234 + ], + [ + 235, + 236 + ], + [ + 239, + 240 + ], + [ + 241, + 242 + ], + [ + 250, + 251 + ], + [ + 257, + 263 + ], + [ + 266, + 267 + ], + [ + 281, + 283 + ], + [ + 285, + 286 + ], + [ + 288, + 289 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 296, + 298 + ], + [ + 299, + 300 + ], + [ + 303, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 312 + ], + [ + 315, + 317 + ], + [ + 318, + 319 + ], + [ + 320, + 321 + ], + [ + 327, + 328 + ], + [ + 332, + 333 + ], + [ + 335, + 341 + ], + [ + 344, + 345 + ], + [ + 356, + 357 + ], + [ + 359, + 360 + ], + [ + 361, + 363 + ], + [ + 371, + 372 + ], + [ + 376, + 379 + ], + [ + 380, + 381 + ], + [ + 389, + 390 + ], + [ + 394, + 395 + ], + [ + 399, + 402 + ], + [ + 403, + 404 + ] + ] + } + }, + { + "filename": "libvips/foreign/fitssave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 58, + 99 + ], + [ + 114, + 125 + ], + [ + 126, + 133 + ], + [ + 139, + 155 + ], + [ + 156, + 164 + ], + [ + 167, + 181 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 61, + 62 + ], + [ + 67, + 69 + ], + [ + 71, + 72 + ], + [ + 75, + 77 + ], + [ + 78, + 80 + ], + [ + 83, + 85 + ], + [ + 90, + 94 + ], + [ + 95, + 96 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 129, + 130 + ], + [ + 142, + 148 + ], + [ + 151, + 152 + ], + [ + 159, + 161 + ], + [ + 170, + 171 + ], + [ + 175, + 178 + ], + [ + 179, + 180 + ] + ] + } + }, + { + "filename": "libvips/foreign/foreign.c", + "line_filter": { + "diff_chunks": [ + [ + 30, + 58 + ], + [ + 81, + 122 + ], + [ + 124, + 131 + ], + [ + 132, + 191 + ], + [ + 192, + 232 + ], + [ + 233, + 265 + ], + [ + 266, + 301 + ], + [ + 303, + 315 + ], + [ + 317, + 328 + ], + [ + 331, + 409 + ], + [ + 413, + 420 + ], + [ + 424, + 543 + ], + [ + 544, + 601 + ], + [ + 602, + 705 + ], + [ + 707, + 741 + ], + [ + 747, + 767 + ], + [ + 775, + 794 + ], + [ + 801, + 820 + ], + [ + 821, + 1102 + ], + [ + 1104, + 1158 + ], + [ + 1163, + 1231 + ], + [ + 1241, + 1343 + ], + [ + 1345, + 1503 + ], + [ + 1505, + 1515 + ], + [ + 1518, + 1560 + ], + [ + 1569, + 1578 + ], + [ + 1579, + 1615 + ], + [ + 1619, + 1630 + ], + [ + 1631, + 1732 + ], + [ + 1745, + 1754 + ], + [ + 1761, + 1772 + ], + [ + 1775, + 1854 + ], + [ + 1855, + 1966 + ], + [ + 1967, + 2009 + ], + [ + 2010, + 2067 + ], + [ + 2068, + 2100 + ], + [ + 2112, + 2128 + ], + [ + 2138, + 2154 + ], + [ + 2164, + 2182 + ], + [ + 2183, + 2198 + ], + [ + 2207, + 2236 + ], + [ + 2241, + 2248 + ], + [ + 2266, + 2287 + ], + [ + 2294, + 2301 + ], + [ + 2305, + 2341 + ], + [ + 2354, + 2370 + ], + [ + 2372, + 2379 + ], + [ + 2382, + 2398 + ], + [ + 2401, + 2413 + ], + [ + 2414, + 2429 + ], + [ + 2431, + 2458 + ], + [ + 2462, + 2479 + ], + [ + 2482, + 2503 + ], + [ + 2516, + 2552 + ], + [ + 2564, + 2580 + ], + [ + 2591, + 2598 + ], + [ + 2601, + 2620 + ], + [ + 2623, + 2639 + ], + [ + 2651, + 2668 + ], + [ + 2669, + 2684 + ], + [ + 2694, + 2717 + ], + [ + 2754, + 2770 + ], + [ + 2779, + 3031 + ], + [ + 3034, + 3099 + ], + [ + 3117, + 3151 + ] + ], + "lines_added": [ + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 44 + ], + [ + 45, + 49 + ], + [ + 54, + 55 + ], + [ + 84, + 85 + ], + [ + 88, + 89 + ], + [ + 95, + 96 + ], + [ + 100, + 101 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 113, + 115 + ], + [ + 118, + 119 + ], + [ + 127, + 128 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 142 + ], + [ + 143, + 144 + ], + [ + 148, + 149 + ], + [ + 154, + 155 + ], + [ + 157, + 158 + ], + [ + 162, + 163 + ], + [ + 165, + 166 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 181, + 182 + ], + [ + 184, + 185 + ], + [ + 187, + 188 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 210, + 212 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 224, + 225 + ], + [ + 228, + 229 + ], + [ + 236, + 238 + ], + [ + 240, + 241 + ], + [ + 242, + 244 + ], + [ + 245, + 246 + ], + [ + 251, + 252 + ], + [ + 255, + 256 + ], + [ + 258, + 259 + ], + [ + 261, + 262 + ], + [ + 269, + 270 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 278, + 279 + ], + [ + 280, + 281 + ], + [ + 282, + 284 + ], + [ + 286, + 287 + ], + [ + 289, + 292 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 306, + 307 + ], + [ + 308, + 309 + ], + [ + 311, + 312 + ], + [ + 320, + 321 + ], + [ + 324, + 325 + ], + [ + 334, + 335 + ], + [ + 337, + 338 + ], + [ + 339, + 342 + ], + [ + 343, + 344 + ], + [ + 345, + 346 + ], + [ + 348, + 353 + ], + [ + 354, + 355 + ], + [ + 357, + 358 + ], + [ + 359, + 363 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 375, + 376 + ], + [ + 380, + 381 + ], + [ + 384, + 385 + ], + [ + 389, + 390 + ], + [ + 393, + 396 + ], + [ + 397, + 398 + ], + [ + 399, + 400 + ], + [ + 403, + 404 + ], + [ + 405, + 406 + ], + [ + 416, + 417 + ], + [ + 427, + 428 + ], + [ + 433, + 435 + ], + [ + 436, + 437 + ], + [ + 438, + 440 + ], + [ + 441, + 444 + ], + [ + 445, + 447 + ], + [ + 449, + 450 + ], + [ + 451, + 452 + ], + [ + 453, + 454 + ], + [ + 459, + 460 + ], + [ + 462, + 463 + ], + [ + 464, + 465 + ], + [ + 466, + 467 + ], + [ + 468, + 469 + ], + [ + 472, + 493 + ], + [ + 496, + 497 + ], + [ + 503, + 505 + ], + [ + 506, + 508 + ], + [ + 511, + 514 + ], + [ + 516, + 518 + ], + [ + 523, + 526 + ], + [ + 528, + 529 + ], + [ + 531, + 534 + ], + [ + 535, + 538 + ], + [ + 539, + 540 + ], + [ + 547, + 548 + ], + [ + 554, + 555 + ], + [ + 560, + 561 + ], + [ + 564, + 568 + ], + [ + 569, + 573 + ], + [ + 575, + 582 + ], + [ + 585, + 587 + ], + [ + 589, + 590 + ], + [ + 593, + 594 + ], + [ + 597, + 598 + ], + [ + 605, + 608 + ], + [ + 609, + 613 + ], + [ + 614, + 615 + ], + [ + 620, + 622 + ], + [ + 623, + 624 + ], + [ + 627, + 629 + ], + [ + 630, + 633 + ], + [ + 635, + 637 + ], + [ + 638, + 639 + ], + [ + 643, + 644 + ], + [ + 649, + 650 + ], + [ + 654, + 655 + ], + [ + 658, + 659 + ], + [ + 662, + 669 + ], + [ + 671, + 672 + ], + [ + 677, + 678 + ], + [ + 679, + 682 + ], + [ + 685, + 687 + ], + [ + 688, + 689 + ], + [ + 692, + 693 + ], + [ + 694, + 696 + ], + [ + 697, + 700 + ], + [ + 701, + 702 + ], + [ + 710, + 711 + ], + [ + 715, + 716 + ], + [ + 719, + 720 + ], + [ + 723, + 730 + ], + [ + 734, + 736 + ], + [ + 737, + 738 + ], + [ + 750, + 752 + ], + [ + 756, + 762 + ], + [ + 763, + 764 + ], + [ + 778, + 779 + ], + [ + 783, + 789 + ], + [ + 790, + 791 + ], + [ + 804, + 805 + ], + [ + 809, + 815 + ], + [ + 816, + 817 + ], + [ + 824, + 825 + ], + [ + 829, + 831 + ], + [ + 834, + 837 + ], + [ + 838, + 840 + ], + [ + 842, + 843 + ], + [ + 846, + 847 + ], + [ + 852, + 856 + ], + [ + 857, + 859 + ], + [ + 860, + 861 + ], + [ + 862, + 863 + ], + [ + 866, + 867 + ], + [ + 869, + 870 + ], + [ + 874, + 875 + ], + [ + 877, + 878 + ], + [ + 879, + 880 + ], + [ + 882, + 883 + ], + [ + 887, + 888 + ], + [ + 889, + 890 + ], + [ + 892, + 893 + ], + [ + 898, + 900 + ], + [ + 901, + 902 + ], + [ + 904, + 905 + ], + [ + 907, + 908 + ], + [ + 910, + 911 + ], + [ + 912, + 913 + ], + [ + 915, + 916 + ], + [ + 919, + 920 + ], + [ + 924, + 925 + ], + [ + 930, + 931 + ], + [ + 932, + 933 + ], + [ + 936, + 940 + ], + [ + 942, + 943 + ], + [ + 949, + 950 + ], + [ + 951, + 953 + ], + [ + 956, + 958 + ], + [ + 959, + 962 + ], + [ + 964, + 965 + ], + [ + 968, + 969 + ], + [ + 975, + 976 + ], + [ + 979, + 981 + ], + [ + 986, + 987 + ], + [ + 993, + 997 + ], + [ + 999, + 1000 + ], + [ + 1005, + 1008 + ], + [ + 1010, + 1011 + ], + [ + 1016, + 1018 + ], + [ + 1021, + 1022 + ], + [ + 1023, + 1027 + ], + [ + 1028, + 1032 + ], + [ + 1033, + 1034 + ], + [ + 1037, + 1038 + ], + [ + 1039, + 1042 + ], + [ + 1046, + 1047 + ], + [ + 1050, + 1058 + ], + [ + 1061, + 1062 + ], + [ + 1067, + 1069 + ], + [ + 1073, + 1076 + ], + [ + 1077, + 1079 + ], + [ + 1080, + 1084 + ], + [ + 1085, + 1086 + ], + [ + 1087, + 1089 + ], + [ + 1091, + 1092 + ], + [ + 1096, + 1099 + ], + [ + 1107, + 1108 + ], + [ + 1109, + 1110 + ], + [ + 1115, + 1117 + ], + [ + 1118, + 1119 + ], + [ + 1121, + 1127 + ], + [ + 1131, + 1133 + ], + [ + 1134, + 1135 + ], + [ + 1137, + 1139 + ], + [ + 1140, + 1141 + ], + [ + 1144, + 1146 + ], + [ + 1148, + 1149 + ], + [ + 1152, + 1153 + ], + [ + 1154, + 1155 + ], + [ + 1166, + 1167 + ], + [ + 1170, + 1175 + ], + [ + 1176, + 1179 + ], + [ + 1180, + 1182 + ], + [ + 1183, + 1186 + ], + [ + 1187, + 1189 + ], + [ + 1190, + 1193 + ], + [ + 1194, + 1196 + ], + [ + 1197, + 1200 + ], + [ + 1201, + 1203 + ], + [ + 1204, + 1207 + ], + [ + 1208, + 1210 + ], + [ + 1211, + 1214 + ], + [ + 1215, + 1217 + ], + [ + 1218, + 1221 + ], + [ + 1222, + 1224 + ], + [ + 1227, + 1228 + ], + [ + 1244, + 1245 + ], + [ + 1247, + 1250 + ], + [ + 1252, + 1253 + ], + [ + 1254, + 1255 + ], + [ + 1257, + 1258 + ], + [ + 1260, + 1263 + ], + [ + 1269, + 1270 + ], + [ + 1272, + 1273 + ], + [ + 1274, + 1275 + ], + [ + 1276, + 1277 + ], + [ + 1278, + 1279 + ], + [ + 1282, + 1283 + ], + [ + 1284, + 1285 + ], + [ + 1286, + 1287 + ], + [ + 1288, + 1290 + ], + [ + 1293, + 1294 + ], + [ + 1299, + 1303 + ], + [ + 1304, + 1306 + ], + [ + 1307, + 1308 + ], + [ + 1309, + 1310 + ], + [ + 1312, + 1313 + ], + [ + 1315, + 1316 + ], + [ + 1317, + 1318 + ], + [ + 1321, + 1322 + ], + [ + 1323, + 1324 + ], + [ + 1326, + 1328 + ], + [ + 1329, + 1330 + ], + [ + 1332, + 1333 + ], + [ + 1335, + 1338 + ], + [ + 1339, + 1340 + ], + [ + 1348, + 1349 + ], + [ + 1351, + 1354 + ], + [ + 1355, + 1356 + ], + [ + 1361, + 1362 + ], + [ + 1363, + 1364 + ], + [ + 1366, + 1369 + ], + [ + 1370, + 1371 + ], + [ + 1375, + 1376 + ], + [ + 1377, + 1380 + ], + [ + 1382, + 1386 + ], + [ + 1387, + 1388 + ], + [ + 1394, + 1395 + ], + [ + 1396, + 1397 + ], + [ + 1399, + 1401 + ], + [ + 1403, + 1410 + ], + [ + 1411, + 1412 + ], + [ + 1417, + 1418 + ], + [ + 1420, + 1421 + ], + [ + 1426, + 1427 + ], + [ + 1428, + 1431 + ], + [ + 1435, + 1436 + ], + [ + 1437, + 1438 + ], + [ + 1442, + 1445 + ], + [ + 1446, + 1447 + ], + [ + 1451, + 1453 + ], + [ + 1454, + 1455 + ], + [ + 1456, + 1457 + ], + [ + 1461, + 1462 + ], + [ + 1463, + 1464 + ], + [ + 1468, + 1471 + ], + [ + 1472, + 1473 + ], + [ + 1478, + 1479 + ], + [ + 1480, + 1481 + ], + [ + 1485, + 1488 + ], + [ + 1489, + 1491 + ], + [ + 1493, + 1498 + ], + [ + 1499, + 1500 + ], + [ + 1508, + 1509 + ], + [ + 1510, + 1512 + ], + [ + 1521, + 1526 + ], + [ + 1527, + 1528 + ], + [ + 1531, + 1532 + ], + [ + 1533, + 1536 + ], + [ + 1538, + 1543 + ], + [ + 1544, + 1545 + ], + [ + 1548, + 1550 + ], + [ + 1552, + 1555 + ], + [ + 1556, + 1557 + ], + [ + 1572, + 1575 + ], + [ + 1582, + 1583 + ], + [ + 1585, + 1588 + ], + [ + 1589, + 1590 + ], + [ + 1596, + 1599 + ], + [ + 1600, + 1601 + ], + [ + 1604, + 1605 + ], + [ + 1607, + 1610 + ], + [ + 1611, + 1612 + ], + [ + 1622, + 1625 + ], + [ + 1626, + 1627 + ], + [ + 1634, + 1635 + ], + [ + 1638, + 1639 + ], + [ + 1641, + 1644 + ], + [ + 1645, + 1646 + ], + [ + 1649, + 1650 + ], + [ + 1652, + 1655 + ], + [ + 1656, + 1657 + ], + [ + 1661, + 1662 + ], + [ + 1663, + 1664 + ], + [ + 1666, + 1667 + ], + [ + 1670, + 1673 + ], + [ + 1675, + 1678 + ], + [ + 1679, + 1680 + ], + [ + 1683, + 1684 + ], + [ + 1689, + 1690 + ], + [ + 1693, + 1694 + ], + [ + 1695, + 1696 + ], + [ + 1697, + 1700 + ], + [ + 1702, + 1706 + ], + [ + 1707, + 1708 + ], + [ + 1710, + 1713 + ], + [ + 1714, + 1715 + ], + [ + 1717, + 1719 + ], + [ + 1721, + 1722 + ], + [ + 1725, + 1727 + ], + [ + 1728, + 1729 + ], + [ + 1748, + 1749 + ], + [ + 1750, + 1751 + ], + [ + 1764, + 1765 + ], + [ + 1766, + 1769 + ], + [ + 1778, + 1779 + ], + [ + 1784, + 1785 + ], + [ + 1786, + 1789 + ], + [ + 1790, + 1791 + ], + [ + 1792, + 1795 + ], + [ + 1796, + 1798 + ], + [ + 1799, + 1802 + ], + [ + 1803, + 1805 + ], + [ + 1806, + 1809 + ], + [ + 1810, + 1812 + ], + [ + 1815, + 1816 + ], + [ + 1817, + 1818 + ], + [ + 1820, + 1821 + ], + [ + 1823, + 1825 + ], + [ + 1826, + 1828 + ], + [ + 1831, + 1832 + ], + [ + 1834, + 1836 + ], + [ + 1839, + 1842 + ], + [ + 1846, + 1849 + ], + [ + 1850, + 1851 + ], + [ + 1858, + 1859 + ], + [ + 1865, + 1866 + ], + [ + 1871, + 1872 + ], + [ + 1873, + 1879 + ], + [ + 1880, + 1881 + ], + [ + 1883, + 1884 + ], + [ + 1887, + 1889 + ], + [ + 1890, + 1891 + ], + [ + 1895, + 1897 + ], + [ + 1899, + 1900 + ], + [ + 1903, + 1905 + ], + [ + 1906, + 1907 + ], + [ + 1911, + 1914 + ], + [ + 1917, + 1918 + ], + [ + 1923, + 1924 + ], + [ + 1925, + 1927 + ], + [ + 1932, + 1934 + ], + [ + 1935, + 1937 + ], + [ + 1943, + 1944 + ], + [ + 1945, + 1947 + ], + [ + 1948, + 1949 + ], + [ + 1950, + 1951 + ], + [ + 1952, + 1954 + ], + [ + 1955, + 1956 + ], + [ + 1962, + 1963 + ], + [ + 1970, + 1971 + ], + [ + 1972, + 1974 + ], + [ + 1975, + 1979 + ], + [ + 1980, + 1981 + ], + [ + 1986, + 1988 + ], + [ + 1989, + 1991 + ], + [ + 1992, + 1993 + ], + [ + 1995, + 1998 + ], + [ + 1999, + 2000 + ], + [ + 2001, + 2004 + ], + [ + 2005, + 2006 + ], + [ + 2013, + 2014 + ], + [ + 2020, + 2021 + ], + [ + 2026, + 2027 + ], + [ + 2028, + 2034 + ], + [ + 2035, + 2036 + ], + [ + 2038, + 2039 + ], + [ + 2044, + 2046 + ], + [ + 2047, + 2049 + ], + [ + 2050, + 2051 + ], + [ + 2053, + 2056 + ], + [ + 2057, + 2058 + ], + [ + 2059, + 2062 + ], + [ + 2063, + 2064 + ], + [ + 2071, + 2072 + ], + [ + 2078, + 2079 + ], + [ + 2084, + 2085 + ], + [ + 2086, + 2092 + ], + [ + 2093, + 2094 + ], + [ + 2096, + 2097 + ], + [ + 2115, + 2116 + ], + [ + 2121, + 2122 + ], + [ + 2124, + 2125 + ], + [ + 2141, + 2142 + ], + [ + 2146, + 2149 + ], + [ + 2150, + 2151 + ], + [ + 2167, + 2169 + ], + [ + 2170, + 2172 + ], + [ + 2178, + 2179 + ], + [ + 2186, + 2187 + ], + [ + 2188, + 2191 + ], + [ + 2192, + 2193 + ], + [ + 2194, + 2195 + ], + [ + 2210, + 2211 + ], + [ + 2217, + 2218 + ], + [ + 2222, + 2225 + ], + [ + 2226, + 2227 + ], + [ + 2231, + 2233 + ], + [ + 2244, + 2245 + ], + [ + 2269, + 2270 + ], + [ + 2274, + 2277 + ], + [ + 2278, + 2279 + ], + [ + 2283, + 2284 + ], + [ + 2297, + 2298 + ], + [ + 2308, + 2309 + ], + [ + 2314, + 2315 + ], + [ + 2316, + 2319 + ], + [ + 2320, + 2323 + ], + [ + 2326, + 2327 + ], + [ + 2329, + 2330 + ], + [ + 2332, + 2333 + ], + [ + 2337, + 2338 + ], + [ + 2357, + 2358 + ], + [ + 2362, + 2365 + ], + [ + 2366, + 2367 + ], + [ + 2375, + 2376 + ], + [ + 2385, + 2386 + ], + [ + 2390, + 2393 + ], + [ + 2394, + 2395 + ], + [ + 2404, + 2405 + ], + [ + 2409, + 2410 + ], + [ + 2417, + 2418 + ], + [ + 2419, + 2422 + ], + [ + 2423, + 2424 + ], + [ + 2425, + 2426 + ], + [ + 2434, + 2435 + ], + [ + 2439, + 2440 + ], + [ + 2444, + 2447 + ], + [ + 2448, + 2449 + ], + [ + 2453, + 2455 + ], + [ + 2465, + 2466 + ], + [ + 2470, + 2471 + ], + [ + 2473, + 2474 + ], + [ + 2475, + 2476 + ], + [ + 2485, + 2486 + ], + [ + 2490, + 2493 + ], + [ + 2494, + 2495 + ], + [ + 2499, + 2500 + ], + [ + 2519, + 2520 + ], + [ + 2525, + 2526 + ], + [ + 2527, + 2530 + ], + [ + 2531, + 2534 + ], + [ + 2537, + 2538 + ], + [ + 2540, + 2541 + ], + [ + 2543, + 2544 + ], + [ + 2548, + 2549 + ], + [ + 2567, + 2568 + ], + [ + 2572, + 2575 + ], + [ + 2576, + 2577 + ], + [ + 2594, + 2595 + ], + [ + 2604, + 2605 + ], + [ + 2610, + 2611 + ], + [ + 2616, + 2617 + ], + [ + 2626, + 2627 + ], + [ + 2631, + 2634 + ], + [ + 2635, + 2636 + ], + [ + 2654, + 2655 + ], + [ + 2656, + 2658 + ], + [ + 2664, + 2665 + ], + [ + 2672, + 2673 + ], + [ + 2674, + 2677 + ], + [ + 2678, + 2679 + ], + [ + 2680, + 2681 + ], + [ + 2697, + 2698 + ], + [ + 2704, + 2705 + ], + [ + 2709, + 2712 + ], + [ + 2713, + 2714 + ], + [ + 2757, + 2758 + ], + [ + 2762, + 2765 + ], + [ + 2766, + 2767 + ], + [ + 2782, + 2783 + ], + [ + 2787, + 2788 + ], + [ + 2792, + 2795 + ], + [ + 2796, + 2797 + ], + [ + 2803, + 2964 + ], + [ + 2966, + 2967 + ], + [ + 2970, + 2977 + ], + [ + 2980, + 2986 + ], + [ + 2989, + 2992 + ], + [ + 2995, + 2998 + ], + [ + 3001, + 3004 + ], + [ + 3007, + 3013 + ], + [ + 3016, + 3022 + ], + [ + 3026, + 3028 + ], + [ + 3037, + 3040 + ], + [ + 3043, + 3049 + ], + [ + 3052, + 3058 + ], + [ + 3061, + 3062 + ], + [ + 3065, + 3072 + ], + [ + 3075, + 3081 + ], + [ + 3085, + 3091 + ], + [ + 3094, + 3096 + ], + [ + 3120, + 3123 + ], + [ + 3126, + 3127 + ], + [ + 3130, + 3133 + ], + [ + 3136, + 3139 + ], + [ + 3142, + 3145 + ], + [ + 3148, + 3150 + ] + ] + } + }, + { + "filename": "libvips/foreign/heifload.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 12 + ], + [ + 30, + 58 + ], + [ + 91, + 102 + ], + [ + 105, + 124 + ], + [ + 157, + 164 + ], + [ + 171, + 182 + ], + [ + 214, + 225 + ], + [ + 226, + 296 + ], + [ + 301, + 346 + ], + [ + 350, + 446 + ], + [ + 451, + 462 + ], + [ + 470, + 535 + ], + [ + 538, + 555 + ], + [ + 562, + 641 + ], + [ + 642, + 668 + ], + [ + 671, + 696 + ], + [ + 697, + 850 + ], + [ + 869, + 887 + ], + [ + 888, + 993 + ], + [ + 996, + 1048 + ], + [ + 1050, + 1146 + ], + [ + 1147, + 1160 + ], + [ + 1163, + 1178 + ], + [ + 1179, + 1186 + ], + [ + 1188, + 1235 + ], + [ + 1243, + 1259 + ], + [ + 1267, + 1306 + ], + [ + 1311, + 1327 + ], + [ + 1335, + 1378 + ], + [ + 1384, + 1400 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 49 + ], + [ + 54, + 55 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 108, + 121 + ], + [ + 160, + 161 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 217, + 218 + ], + [ + 219, + 222 + ], + [ + 229, + 231 + ], + [ + 233, + 234 + ], + [ + 238, + 246 + ], + [ + 249, + 250 + ], + [ + 254, + 255 + ], + [ + 257, + 260 + ], + [ + 261, + 262 + ], + [ + 266, + 268 + ], + [ + 269, + 274 + ], + [ + 277, + 279 + ], + [ + 280, + 281 + ], + [ + 284, + 293 + ], + [ + 304, + 305 + ], + [ + 306, + 313 + ], + [ + 316, + 321 + ], + [ + 322, + 325 + ], + [ + 327, + 328 + ], + [ + 331, + 332 + ], + [ + 335, + 336 + ], + [ + 338, + 339 + ], + [ + 342, + 343 + ], + [ + 353, + 354 + ], + [ + 356, + 360 + ], + [ + 361, + 366 + ], + [ + 369, + 371 + ], + [ + 372, + 374 + ], + [ + 375, + 380 + ], + [ + 382, + 385 + ], + [ + 386, + 387 + ], + [ + 388, + 391 + ], + [ + 392, + 394 + ], + [ + 396, + 399 + ], + [ + 401, + 402 + ], + [ + 404, + 405 + ], + [ + 411, + 413 + ], + [ + 414, + 415 + ], + [ + 416, + 417 + ], + [ + 420, + 422 + ], + [ + 424, + 426 + ], + [ + 429, + 434 + ], + [ + 436, + 439 + ], + [ + 442, + 443 + ], + [ + 454, + 455 + ], + [ + 458, + 459 + ], + [ + 473, + 474 + ], + [ + 476, + 478 + ], + [ + 481, + 485 + ], + [ + 487, + 488 + ], + [ + 489, + 491 + ], + [ + 495, + 497 + ], + [ + 501, + 508 + ], + [ + 513, + 514 + ], + [ + 516, + 517 + ], + [ + 518, + 525 + ], + [ + 530, + 532 + ], + [ + 541, + 544 + ], + [ + 545, + 547 + ], + [ + 548, + 549 + ], + [ + 550, + 552 + ], + [ + 565, + 566 + ], + [ + 568, + 570 + ], + [ + 572, + 596 + ], + [ + 601, + 605 + ], + [ + 608, + 615 + ], + [ + 618, + 619 + ], + [ + 621, + 623 + ], + [ + 624, + 626 + ], + [ + 629, + 631 + ], + [ + 635, + 638 + ], + [ + 645, + 655 + ], + [ + 658, + 661 + ], + [ + 662, + 663 + ], + [ + 664, + 665 + ], + [ + 674, + 675 + ], + [ + 676, + 682 + ], + [ + 683, + 685 + ], + [ + 686, + 687 + ], + [ + 690, + 691 + ], + [ + 692, + 693 + ], + [ + 700, + 701 + ], + [ + 703, + 707 + ], + [ + 710, + 714 + ], + [ + 715, + 717 + ], + [ + 722, + 724 + ], + [ + 726, + 727 + ], + [ + 728, + 729 + ], + [ + 730, + 733 + ], + [ + 736, + 737 + ], + [ + 742, + 744 + ], + [ + 745, + 749 + ], + [ + 750, + 753 + ], + [ + 754, + 755 + ], + [ + 757, + 762 + ], + [ + 764, + 772 + ], + [ + 778, + 789 + ], + [ + 791, + 802 + ], + [ + 806, + 828 + ], + [ + 829, + 832 + ], + [ + 836, + 838 + ], + [ + 839, + 840 + ], + [ + 841, + 842 + ], + [ + 846, + 847 + ], + [ + 872, + 875 + ], + [ + 877, + 884 + ], + [ + 891, + 892 + ], + [ + 893, + 896 + ], + [ + 897, + 898 + ], + [ + 900, + 902 + ], + [ + 903, + 904 + ], + [ + 908, + 910 + ], + [ + 912, + 914 + ], + [ + 919, + 920 + ], + [ + 922, + 923 + ], + [ + 924, + 926 + ], + [ + 927, + 928 + ], + [ + 930, + 933 + ], + [ + 935, + 943 + ], + [ + 946, + 947 + ], + [ + 950, + 955 + ], + [ + 960, + 965 + ], + [ + 967, + 972 + ], + [ + 975, + 978 + ], + [ + 981, + 982 + ], + [ + 983, + 984 + ], + [ + 988, + 990 + ], + [ + 999, + 1000 + ], + [ + 1003, + 1004 + ], + [ + 1005, + 1006 + ], + [ + 1009, + 1010 + ], + [ + 1013, + 1015 + ], + [ + 1017, + 1018 + ], + [ + 1021, + 1023 + ], + [ + 1026, + 1028 + ], + [ + 1029, + 1034 + ], + [ + 1035, + 1037 + ], + [ + 1038, + 1039 + ], + [ + 1042, + 1043 + ], + [ + 1044, + 1045 + ], + [ + 1053, + 1054 + ], + [ + 1060, + 1063 + ], + [ + 1064, + 1066 + ], + [ + 1067, + 1070 + ], + [ + 1071, + 1073 + ], + [ + 1074, + 1077 + ], + [ + 1078, + 1080 + ], + [ + 1081, + 1084 + ], + [ + 1085, + 1087 + ], + [ + 1088, + 1091 + ], + [ + 1092, + 1094 + ], + [ + 1097, + 1098 + ], + [ + 1101, + 1102 + ], + [ + 1104, + 1105 + ], + [ + 1106, + 1107 + ], + [ + 1110, + 1111 + ], + [ + 1114, + 1115 + ], + [ + 1117, + 1120 + ], + [ + 1125, + 1126 + ], + [ + 1129, + 1130 + ], + [ + 1135, + 1136 + ], + [ + 1141, + 1143 + ], + [ + 1150, + 1151 + ], + [ + 1152, + 1155 + ], + [ + 1156, + 1157 + ], + [ + 1166, + 1167 + ], + [ + 1170, + 1171 + ], + [ + 1174, + 1175 + ], + [ + 1182, + 1183 + ], + [ + 1191, + 1192 + ], + [ + 1197, + 1199 + ], + [ + 1201, + 1202 + ], + [ + 1206, + 1210 + ], + [ + 1211, + 1213 + ], + [ + 1214, + 1215 + ], + [ + 1218, + 1219 + ], + [ + 1222, + 1224 + ], + [ + 1225, + 1226 + ], + [ + 1229, + 1230 + ], + [ + 1231, + 1232 + ], + [ + 1246, + 1252 + ], + [ + 1255, + 1256 + ], + [ + 1270, + 1272 + ], + [ + 1274, + 1275 + ], + [ + 1277, + 1278 + ], + [ + 1280, + 1285 + ], + [ + 1286, + 1288 + ], + [ + 1289, + 1290 + ], + [ + 1293, + 1294 + ], + [ + 1295, + 1296 + ], + [ + 1299, + 1301 + ], + [ + 1302, + 1303 + ], + [ + 1314, + 1320 + ], + [ + 1323, + 1324 + ], + [ + 1338, + 1340 + ], + [ + 1342, + 1343 + ], + [ + 1345, + 1346 + ], + [ + 1348, + 1349 + ], + [ + 1350, + 1351 + ], + [ + 1353, + 1355 + ], + [ + 1356, + 1357 + ], + [ + 1360, + 1361 + ], + [ + 1364, + 1366 + ], + [ + 1369, + 1371 + ], + [ + 1372, + 1373 + ], + [ + 1374, + 1375 + ], + [ + 1387, + 1393 + ], + [ + 1396, + 1397 + ] + ] + } + }, + { + "filename": "libvips/foreign/heifsave.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 48 + ], + [ + 79, + 86 + ], + [ + 120, + 127 + ], + [ + 137, + 173 + ], + [ + 175, + 219 + ], + [ + 220, + 322 + ], + [ + 324, + 344 + ], + [ + 345, + 363 + ], + [ + 367, + 438 + ], + [ + 440, + 581 + ], + [ + 589, + 598 + ], + [ + 600, + 666 + ], + [ + 678, + 715 + ], + [ + 720, + 736 + ], + [ + 744, + 780 + ], + [ + 785, + 801 + ], + [ + 806, + 838 + ], + [ + 843, + 878 + ], + [ + 881, + 888 + ] + ], + "lines_added": [ + [ + 23, + 39 + ], + [ + 44, + 45 + ], + [ + 82, + 83 + ], + [ + 123, + 124 + ], + [ + 140, + 142 + ], + [ + 143, + 145 + ], + [ + 147, + 148 + ], + [ + 151, + 157 + ], + [ + 158, + 159 + ], + [ + 161, + 164 + ], + [ + 168, + 170 + ], + [ + 178, + 179 + ], + [ + 185, + 187 + ], + [ + 188, + 191 + ], + [ + 195, + 197 + ], + [ + 199, + 202 + ], + [ + 203, + 208 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 223, + 225 + ], + [ + 229, + 230 + ], + [ + 232, + 235 + ], + [ + 238, + 243 + ], + [ + 248, + 249 + ], + [ + 252, + 254 + ], + [ + 255, + 256 + ], + [ + 258, + 260 + ], + [ + 262, + 266 + ], + [ + 268, + 269 + ], + [ + 270, + 273 + ], + [ + 275, + 276 + ], + [ + 278, + 281 + ], + [ + 282, + 288 + ], + [ + 292, + 295 + ], + [ + 296, + 297 + ], + [ + 298, + 299 + ], + [ + 302, + 304 + ], + [ + 307, + 309 + ], + [ + 311, + 314 + ], + [ + 318, + 319 + ], + [ + 327, + 329 + ], + [ + 330, + 338 + ], + [ + 340, + 341 + ], + [ + 348, + 350 + ], + [ + 352, + 357 + ], + [ + 359, + 360 + ], + [ + 370, + 371 + ], + [ + 372, + 375 + ], + [ + 377, + 378 + ], + [ + 381, + 383 + ], + [ + 389, + 390 + ], + [ + 392, + 393 + ], + [ + 395, + 396 + ], + [ + 400, + 401 + ], + [ + 403, + 406 + ], + [ + 407, + 408 + ], + [ + 410, + 413 + ], + [ + 415, + 416 + ], + [ + 418, + 421 + ], + [ + 427, + 428 + ], + [ + 430, + 431 + ], + [ + 434, + 435 + ], + [ + 443, + 445 + ], + [ + 449, + 451 + ], + [ + 455, + 457 + ], + [ + 459, + 460 + ], + [ + 462, + 480 + ], + [ + 482, + 486 + ], + [ + 488, + 492 + ], + [ + 494, + 500 + ], + [ + 503, + 513 + ], + [ + 515, + 516 + ], + [ + 520, + 521 + ], + [ + 523, + 524 + ], + [ + 527, + 531 + ], + [ + 532, + 540 + ], + [ + 542, + 548 + ], + [ + 551, + 552 + ], + [ + 554, + 556 + ], + [ + 557, + 558 + ], + [ + 559, + 562 + ], + [ + 568, + 572 + ], + [ + 574, + 576 + ], + [ + 577, + 578 + ], + [ + 592, + 593 + ], + [ + 594, + 595 + ], + [ + 603, + 604 + ], + [ + 609, + 612 + ], + [ + 613, + 615 + ], + [ + 616, + 619 + ], + [ + 620, + 622 + ], + [ + 623, + 626 + ], + [ + 627, + 629 + ], + [ + 630, + 633 + ], + [ + 634, + 635 + ], + [ + 636, + 637 + ], + [ + 638, + 641 + ], + [ + 642, + 644 + ], + [ + 645, + 648 + ], + [ + 649, + 650 + ], + [ + 651, + 652 + ], + [ + 653, + 656 + ], + [ + 657, + 659 + ], + [ + 662, + 663 + ], + [ + 681, + 682 + ], + [ + 687, + 689 + ], + [ + 691, + 692 + ], + [ + 696, + 698 + ], + [ + 699, + 700 + ], + [ + 702, + 704 + ], + [ + 705, + 706 + ], + [ + 709, + 710 + ], + [ + 711, + 712 + ], + [ + 723, + 729 + ], + [ + 732, + 733 + ], + [ + 747, + 749 + ], + [ + 751, + 752 + ], + [ + 754, + 755 + ], + [ + 759, + 761 + ], + [ + 762, + 764 + ], + [ + 765, + 768 + ], + [ + 769, + 770 + ], + [ + 773, + 775 + ], + [ + 776, + 777 + ], + [ + 788, + 794 + ], + [ + 797, + 798 + ], + [ + 809, + 811 + ], + [ + 813, + 814 + ], + [ + 816, + 817 + ], + [ + 819, + 820 + ], + [ + 821, + 822 + ], + [ + 824, + 826 + ], + [ + 827, + 828 + ], + [ + 831, + 833 + ], + [ + 834, + 835 + ], + [ + 846, + 852 + ], + [ + 855, + 856 + ], + [ + 862, + 864 + ], + [ + 866, + 868 + ], + [ + 874, + 875 + ], + [ + 884, + 885 + ] + ] + } + }, + { + "filename": "libvips/foreign/jp2kload.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 77, + 89 + ], + [ + 100, + 233 + ], + [ + 237, + 377 + ], + [ + 378, + 406 + ], + [ + 409, + 424 + ], + [ + 429, + 601 + ], + [ + 602, + 658 + ], + [ + 664, + 699 + ], + [ + 700, + 720 + ], + [ + 722, + 765 + ], + [ + 768, + 779 + ], + [ + 783, + 799 + ], + [ + 807, + 856 + ], + [ + 857, + 867 + ], + [ + 869, + 888 + ], + [ + 890, + 897 + ], + [ + 906, + 917 + ], + [ + 919, + 946 + ], + [ + 954, + 1034 + ], + [ + 1035, + 1042 + ], + [ + 1046, + 1062 + ], + [ + 1064, + 1116 + ], + [ + 1124, + 1140 + ], + [ + 1148, + 1195 + ], + [ + 1200, + 1216 + ], + [ + 1224, + 1260 + ], + [ + 1266, + 1344 + ], + [ + 1348, + 1441 + ], + [ + 1452, + 1459 + ], + [ + 1468, + 1484 + ], + [ + 1492, + 1499 + ], + [ + 1500, + 1507 + ], + [ + 1508, + 1523 + ], + [ + 1530, + 1549 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 80, + 83 + ], + [ + 84, + 86 + ], + [ + 103, + 105 + ], + [ + 107, + 108 + ], + [ + 112, + 113 + ], + [ + 119, + 120 + ], + [ + 124, + 130 + ], + [ + 131, + 132 + ], + [ + 135, + 136 + ], + [ + 137, + 139 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 153, + 154 + ], + [ + 155, + 156 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 163, + 164 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 174, + 175 + ], + [ + 180, + 182 + ], + [ + 183, + 184 + ], + [ + 187, + 197 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 211, + 214 + ], + [ + 217, + 223 + ], + [ + 226, + 228 + ], + [ + 229, + 230 + ], + [ + 240, + 241 + ], + [ + 244, + 246 + ], + [ + 250, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 268, + 269 + ], + [ + 273, + 275 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 285, + 287 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 295, + 297 + ], + [ + 299, + 300 + ], + [ + 302, + 303 + ], + [ + 305, + 306 + ], + [ + 310, + 312 + ], + [ + 313, + 319 + ], + [ + 323, + 324 + ], + [ + 325, + 332 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 341, + 343 + ], + [ + 345, + 355 + ], + [ + 357, + 367 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 381, + 382 + ], + [ + 383, + 384 + ], + [ + 388, + 389 + ], + [ + 393, + 394 + ], + [ + 398, + 399 + ], + [ + 402, + 403 + ], + [ + 412, + 414 + ], + [ + 415, + 416 + ], + [ + 418, + 419 + ], + [ + 420, + 421 + ], + [ + 432, + 436 + ], + [ + 440, + 442 + ], + [ + 443, + 446 + ], + [ + 450, + 458 + ], + [ + 459, + 460 + ], + [ + 461, + 462 + ], + [ + 463, + 467 + ], + [ + 468, + 469 + ], + [ + 472, + 473 + ], + [ + 474, + 475 + ], + [ + 481, + 482 + ], + [ + 484, + 488 + ], + [ + 489, + 490 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 498, + 502 + ], + [ + 504, + 505 + ], + [ + 509, + 513 + ], + [ + 514, + 518 + ], + [ + 520, + 521 + ], + [ + 523, + 524 + ], + [ + 528, + 532 + ], + [ + 534, + 539 + ], + [ + 544, + 545 + ], + [ + 547, + 548 + ], + [ + 551, + 553 + ], + [ + 554, + 556 + ], + [ + 557, + 558 + ], + [ + 560, + 571 + ], + [ + 572, + 585 + ], + [ + 586, + 587 + ], + [ + 589, + 590 + ], + [ + 595, + 598 + ], + [ + 605, + 608 + ], + [ + 610, + 611 + ], + [ + 613, + 614 + ], + [ + 617, + 619 + ], + [ + 621, + 622 + ], + [ + 626, + 627 + ], + [ + 631, + 632 + ], + [ + 638, + 639 + ], + [ + 641, + 642 + ], + [ + 644, + 645 + ], + [ + 649, + 650 + ], + [ + 654, + 655 + ], + [ + 667, + 690 + ], + [ + 694, + 696 + ], + [ + 703, + 704 + ], + [ + 706, + 707 + ], + [ + 711, + 712 + ], + [ + 716, + 717 + ], + [ + 725, + 732 + ], + [ + 737, + 739 + ], + [ + 741, + 742 + ], + [ + 743, + 744 + ], + [ + 748, + 749 + ], + [ + 751, + 752 + ], + [ + 756, + 757 + ], + [ + 761, + 762 + ], + [ + 771, + 772 + ], + [ + 774, + 776 + ], + [ + 786, + 789 + ], + [ + 794, + 796 + ], + [ + 810, + 811 + ], + [ + 812, + 816 + ], + [ + 817, + 819 + ], + [ + 820, + 821 + ], + [ + 822, + 824 + ], + [ + 825, + 827 + ], + [ + 828, + 831 + ], + [ + 832, + 834 + ], + [ + 839, + 842 + ], + [ + 843, + 844 + ], + [ + 847, + 848 + ], + [ + 851, + 853 + ], + [ + 860, + 864 + ], + [ + 872, + 875 + ], + [ + 880, + 882 + ], + [ + 884, + 885 + ], + [ + 893, + 894 + ], + [ + 909, + 910 + ], + [ + 911, + 914 + ], + [ + 922, + 923 + ], + [ + 924, + 925 + ], + [ + 926, + 929 + ], + [ + 930, + 931 + ], + [ + 934, + 935 + ], + [ + 936, + 940 + ], + [ + 941, + 943 + ], + [ + 957, + 960 + ], + [ + 961, + 962 + ], + [ + 965, + 966 + ], + [ + 968, + 970 + ], + [ + 976, + 977 + ], + [ + 980, + 982 + ], + [ + 985, + 987 + ], + [ + 989, + 991 + ], + [ + 993, + 997 + ], + [ + 1001, + 1002 + ], + [ + 1003, + 1007 + ], + [ + 1009, + 1010 + ], + [ + 1012, + 1018 + ], + [ + 1019, + 1021 + ], + [ + 1022, + 1023 + ], + [ + 1026, + 1027 + ], + [ + 1028, + 1029 + ], + [ + 1030, + 1031 + ], + [ + 1038, + 1039 + ], + [ + 1049, + 1052 + ], + [ + 1053, + 1055 + ], + [ + 1058, + 1059 + ], + [ + 1067, + 1068 + ], + [ + 1073, + 1075 + ], + [ + 1077, + 1078 + ], + [ + 1082, + 1085 + ], + [ + 1086, + 1088 + ], + [ + 1089, + 1090 + ], + [ + 1092, + 1093 + ], + [ + 1095, + 1096 + ], + [ + 1100, + 1104 + ], + [ + 1105, + 1106 + ], + [ + 1109, + 1111 + ], + [ + 1112, + 1113 + ], + [ + 1127, + 1133 + ], + [ + 1136, + 1137 + ], + [ + 1151, + 1153 + ], + [ + 1155, + 1156 + ], + [ + 1158, + 1159 + ], + [ + 1161, + 1166 + ], + [ + 1167, + 1169 + ], + [ + 1170, + 1171 + ], + [ + 1174, + 1175 + ], + [ + 1179, + 1183 + ], + [ + 1184, + 1185 + ], + [ + 1188, + 1190 + ], + [ + 1191, + 1192 + ], + [ + 1203, + 1209 + ], + [ + 1212, + 1213 + ], + [ + 1227, + 1229 + ], + [ + 1231, + 1232 + ], + [ + 1234, + 1235 + ], + [ + 1237, + 1238 + ], + [ + 1239, + 1240 + ], + [ + 1242, + 1246 + ], + [ + 1247, + 1248 + ], + [ + 1251, + 1253 + ], + [ + 1254, + 1255 + ], + [ + 1256, + 1257 + ], + [ + 1269, + 1275 + ], + [ + 1278, + 1280 + ], + [ + 1283, + 1285 + ], + [ + 1289, + 1290 + ], + [ + 1293, + 1295 + ], + [ + 1299, + 1300 + ], + [ + 1303, + 1305 + ], + [ + 1307, + 1308 + ], + [ + 1310, + 1311 + ], + [ + 1315, + 1317 + ], + [ + 1321, + 1322 + ], + [ + 1323, + 1327 + ], + [ + 1329, + 1330 + ], + [ + 1331, + 1332 + ], + [ + 1335, + 1339 + ], + [ + 1340, + 1341 + ], + [ + 1351, + 1354 + ], + [ + 1360, + 1375 + ], + [ + 1377, + 1378 + ], + [ + 1379, + 1383 + ], + [ + 1385, + 1390 + ], + [ + 1395, + 1396 + ], + [ + 1398, + 1400 + ], + [ + 1403, + 1404 + ], + [ + 1406, + 1408 + ], + [ + 1409, + 1410 + ], + [ + 1411, + 1415 + ], + [ + 1416, + 1418 + ], + [ + 1422, + 1423 + ], + [ + 1424, + 1425 + ], + [ + 1430, + 1434 + ], + [ + 1435, + 1438 + ], + [ + 1455, + 1456 + ], + [ + 1471, + 1472 + ], + [ + 1476, + 1479 + ], + [ + 1480, + 1481 + ], + [ + 1495, + 1496 + ], + [ + 1503, + 1504 + ], + [ + 1511, + 1512 + ], + [ + 1513, + 1516 + ], + [ + 1517, + 1518 + ], + [ + 1519, + 1520 + ], + [ + 1533, + 1534 + ], + [ + 1538, + 1539 + ], + [ + 1543, + 1546 + ], + [ + 1547, + 1548 + ] + ] + } + }, + { + "filename": "libvips/foreign/jp2ksave.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 118, + 267 + ], + [ + 268, + 294 + ], + [ + 302, + 399 + ], + [ + 405, + 456 + ], + [ + 461, + 505 + ], + [ + 507, + 554 + ], + [ + 557, + 582 + ], + [ + 585, + 634 + ], + [ + 639, + 674 + ], + [ + 676, + 688 + ], + [ + 705, + 712 + ], + [ + 728, + 735 + ], + [ + 736, + 756 + ], + [ + 759, + 769 + ], + [ + 788, + 795 + ], + [ + 797, + 806 + ], + [ + 807, + 832 + ], + [ + 842, + 859 + ], + [ + 867, + 927 + ], + [ + 929, + 956 + ], + [ + 959, + 1011 + ], + [ + 1027, + 1055 + ], + [ + 1057, + 1073 + ], + [ + 1081, + 1092 + ], + [ + 1093, + 1117 + ], + [ + 1119, + 1135 + ], + [ + 1140, + 1172 + ], + [ + 1174, + 1197 + ], + [ + 1200, + 1217 + ], + [ + 1218, + 1258 + ], + [ + 1268, + 1304 + ], + [ + 1309, + 1321 + ], + [ + 1325, + 1335 + ], + [ + 1341, + 1352 + ], + [ + 1354, + 1435 + ], + [ + 1471, + 1487 + ], + [ + 1505, + 1512 + ], + [ + 1513, + 1536 + ], + [ + 1553, + 1567 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 121, + 123 + ], + [ + 125, + 126 + ], + [ + 129, + 132 + ], + [ + 133, + 135 + ], + [ + 136, + 138 + ], + [ + 139, + 140 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 158, + 160 + ], + [ + 161, + 162 + ], + [ + 164, + 166 + ], + [ + 167, + 168 + ], + [ + 169, + 171 + ], + [ + 172, + 173 + ], + [ + 178, + 179 + ], + [ + 184, + 196 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 207, + 208 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 223, + 224 + ], + [ + 225, + 231 + ], + [ + 235, + 258 + ], + [ + 262, + 264 + ], + [ + 271, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 278 + ], + [ + 280, + 281 + ], + [ + 285, + 286 + ], + [ + 290, + 291 + ], + [ + 305, + 317 + ], + [ + 319, + 340 + ], + [ + 342, + 344 + ], + [ + 346, + 348 + ], + [ + 354, + 355 + ], + [ + 361, + 362 + ], + [ + 363, + 365 + ], + [ + 366, + 367 + ], + [ + 368, + 370 + ], + [ + 373, + 374 + ], + [ + 375, + 376 + ], + [ + 379, + 380 + ], + [ + 383, + 384 + ], + [ + 387, + 388 + ], + [ + 391, + 392 + ], + [ + 395, + 396 + ], + [ + 408, + 418 + ], + [ + 420, + 422 + ], + [ + 424, + 425 + ], + [ + 431, + 434 + ], + [ + 435, + 436 + ], + [ + 439, + 440 + ], + [ + 442, + 443 + ], + [ + 447, + 448 + ], + [ + 452, + 453 + ], + [ + 464, + 465 + ], + [ + 467, + 468 + ], + [ + 473, + 474 + ], + [ + 480, + 481 + ], + [ + 482, + 484 + ], + [ + 488, + 489 + ], + [ + 492, + 493 + ], + [ + 496, + 497 + ], + [ + 501, + 502 + ], + [ + 510, + 511 + ], + [ + 512, + 515 + ], + [ + 516, + 518 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 523, + 524 + ], + [ + 526, + 527 + ], + [ + 529, + 533 + ], + [ + 535, + 536 + ], + [ + 539, + 541 + ], + [ + 546, + 548 + ], + [ + 550, + 551 + ], + [ + 560, + 561 + ], + [ + 564, + 566 + ], + [ + 570, + 572 + ], + [ + 577, + 579 + ], + [ + 588, + 589 + ], + [ + 592, + 593 + ], + [ + 595, + 597 + ], + [ + 599, + 600 + ], + [ + 604, + 606 + ], + [ + 612, + 613 + ], + [ + 614, + 615 + ], + [ + 619, + 621 + ], + [ + 622, + 629 + ], + [ + 630, + 631 + ], + [ + 642, + 643 + ], + [ + 644, + 647 + ], + [ + 651, + 652 + ], + [ + 653, + 654 + ], + [ + 655, + 658 + ], + [ + 660, + 661 + ], + [ + 664, + 665 + ], + [ + 668, + 669 + ], + [ + 670, + 671 + ], + [ + 679, + 681 + ], + [ + 684, + 685 + ], + [ + 708, + 709 + ], + [ + 731, + 732 + ], + [ + 739, + 740 + ], + [ + 742, + 744 + ], + [ + 749, + 750 + ], + [ + 752, + 753 + ], + [ + 762, + 764 + ], + [ + 765, + 766 + ], + [ + 791, + 792 + ], + [ + 800, + 801 + ], + [ + 802, + 803 + ], + [ + 810, + 812 + ], + [ + 816, + 820 + ], + [ + 822, + 823 + ], + [ + 828, + 829 + ], + [ + 845, + 846 + ], + [ + 850, + 851 + ], + [ + 854, + 856 + ], + [ + 870, + 874 + ], + [ + 875, + 877 + ], + [ + 882, + 886 + ], + [ + 890, + 896 + ], + [ + 897, + 898 + ], + [ + 899, + 901 + ], + [ + 902, + 904 + ], + [ + 908, + 909 + ], + [ + 910, + 912 + ], + [ + 915, + 918 + ], + [ + 922, + 924 + ], + [ + 932, + 934 + ], + [ + 937, + 940 + ], + [ + 941, + 942 + ], + [ + 943, + 945 + ], + [ + 946, + 947 + ], + [ + 950, + 951 + ], + [ + 952, + 953 + ], + [ + 962, + 963 + ], + [ + 969, + 972 + ], + [ + 973, + 975 + ], + [ + 976, + 979 + ], + [ + 980, + 982 + ], + [ + 983, + 986 + ], + [ + 987, + 989 + ], + [ + 990, + 993 + ], + [ + 994, + 995 + ], + [ + 996, + 997 + ], + [ + 998, + 1001 + ], + [ + 1002, + 1004 + ], + [ + 1007, + 1008 + ], + [ + 1030, + 1032 + ], + [ + 1034, + 1035 + ], + [ + 1039, + 1041 + ], + [ + 1042, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1049, + 1050 + ], + [ + 1051, + 1052 + ], + [ + 1060, + 1063 + ], + [ + 1064, + 1066 + ], + [ + 1069, + 1070 + ], + [ + 1084, + 1086 + ], + [ + 1088, + 1089 + ], + [ + 1096, + 1098 + ], + [ + 1099, + 1101 + ], + [ + 1102, + 1105 + ], + [ + 1106, + 1107 + ], + [ + 1111, + 1112 + ], + [ + 1113, + 1114 + ], + [ + 1122, + 1125 + ], + [ + 1126, + 1128 + ], + [ + 1131, + 1132 + ], + [ + 1143, + 1145 + ], + [ + 1147, + 1148 + ], + [ + 1153, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1158, + 1160 + ], + [ + 1161, + 1162 + ], + [ + 1166, + 1167 + ], + [ + 1168, + 1169 + ], + [ + 1177, + 1180 + ], + [ + 1181, + 1183 + ], + [ + 1186, + 1187 + ], + [ + 1193, + 1194 + ], + [ + 1203, + 1205 + ], + [ + 1207, + 1209 + ], + [ + 1213, + 1214 + ], + [ + 1221, + 1222 + ], + [ + 1223, + 1224 + ], + [ + 1225, + 1226 + ], + [ + 1227, + 1229 + ], + [ + 1232, + 1233 + ], + [ + 1234, + 1235 + ], + [ + 1238, + 1239 + ], + [ + 1242, + 1243 + ], + [ + 1246, + 1247 + ], + [ + 1250, + 1251 + ], + [ + 1254, + 1255 + ], + [ + 1271, + 1273 + ], + [ + 1279, + 1282 + ], + [ + 1283, + 1284 + ], + [ + 1285, + 1286 + ], + [ + 1287, + 1288 + ], + [ + 1290, + 1291 + ], + [ + 1295, + 1296 + ], + [ + 1300, + 1301 + ], + [ + 1312, + 1313 + ], + [ + 1314, + 1318 + ], + [ + 1328, + 1329 + ], + [ + 1331, + 1332 + ], + [ + 1344, + 1345 + ], + [ + 1348, + 1349 + ], + [ + 1357, + 1361 + ], + [ + 1365, + 1370 + ], + [ + 1372, + 1380 + ], + [ + 1382, + 1383 + ], + [ + 1384, + 1387 + ], + [ + 1390, + 1392 + ], + [ + 1393, + 1394 + ], + [ + 1395, + 1397 + ], + [ + 1398, + 1401 + ], + [ + 1403, + 1407 + ], + [ + 1409, + 1412 + ], + [ + 1414, + 1415 + ], + [ + 1416, + 1417 + ], + [ + 1418, + 1419 + ], + [ + 1424, + 1425 + ], + [ + 1427, + 1428 + ], + [ + 1429, + 1432 + ], + [ + 1474, + 1475 + ], + [ + 1479, + 1482 + ], + [ + 1483, + 1484 + ], + [ + 1508, + 1509 + ], + [ + 1516, + 1519 + ], + [ + 1520, + 1523 + ], + [ + 1526, + 1527 + ], + [ + 1529, + 1530 + ], + [ + 1532, + 1533 + ], + [ + 1556, + 1557 + ], + [ + 1561, + 1564 + ], + [ + 1565, + 1566 + ] + ] + } + }, + { + "filename": "libvips/foreign/jpeg.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 42, + 50 + ], + [ + 71, + 83 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 45, + 47 + ], + [ + 74, + 76 + ], + [ + 78, + 80 + ] + ] + } + }, + { + "filename": "libvips/foreign/jpeg2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 38, + 45 + ], + [ + 62, + 73 + ], + [ + 91, + 98 + ], + [ + 109, + 146 + ], + [ + 170, + 177 + ], + [ + 181, + 188 + ], + [ + 228, + 235 + ], + [ + 242, + 249 + ], + [ + 252, + 291 + ], + [ + 295, + 367 + ], + [ + 372, + 415 + ], + [ + 416, + 444 + ], + [ + 445, + 504 + ], + [ + 509, + 516 + ], + [ + 524, + 540 + ], + [ + 553, + 563 + ], + [ + 564, + 580 + ], + [ + 582, + 590 + ], + [ + 591, + 630 + ], + [ + 636, + 701 + ], + [ + 703, + 722 + ], + [ + 735, + 757 + ], + [ + 759, + 797 + ], + [ + 798, + 974 + ], + [ + 976, + 1034 + ] + ], + "lines_added": [ + [ + 41, + 42 + ], + [ + 65, + 66 + ], + [ + 69, + 70 + ], + [ + 94, + 95 + ], + [ + 112, + 113 + ], + [ + 115, + 116 + ], + [ + 121, + 122 + ], + [ + 123, + 127 + ], + [ + 128, + 137 + ], + [ + 142, + 143 + ], + [ + 173, + 174 + ], + [ + 184, + 185 + ], + [ + 231, + 232 + ], + [ + 245, + 246 + ], + [ + 255, + 257 + ], + [ + 261, + 267 + ], + [ + 268, + 269 + ], + [ + 274, + 275 + ], + [ + 278, + 279 + ], + [ + 282, + 283 + ], + [ + 285, + 286 + ], + [ + 287, + 288 + ], + [ + 298, + 299 + ], + [ + 302, + 304 + ], + [ + 306, + 308 + ], + [ + 309, + 312 + ], + [ + 318, + 320 + ], + [ + 324, + 325 + ], + [ + 328, + 329 + ], + [ + 330, + 331 + ], + [ + 334, + 335 + ], + [ + 341, + 342 + ], + [ + 343, + 348 + ], + [ + 349, + 350 + ], + [ + 352, + 353 + ], + [ + 358, + 359 + ], + [ + 360, + 364 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 379, + 380 + ], + [ + 381, + 382 + ], + [ + 385, + 386 + ], + [ + 387, + 388 + ], + [ + 391, + 392 + ], + [ + 393, + 394 + ], + [ + 397, + 400 + ], + [ + 403, + 405 + ], + [ + 408, + 409 + ], + [ + 411, + 412 + ], + [ + 419, + 420 + ], + [ + 424, + 426 + ], + [ + 427, + 428 + ], + [ + 429, + 433 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 440, + 441 + ], + [ + 448, + 449 + ], + [ + 452, + 453 + ], + [ + 456, + 457 + ], + [ + 458, + 459 + ], + [ + 461, + 462 + ], + [ + 465, + 467 + ], + [ + 469, + 470 + ], + [ + 471, + 472 + ], + [ + 474, + 475 + ], + [ + 479, + 480 + ], + [ + 484, + 487 + ], + [ + 493, + 495 + ], + [ + 496, + 498 + ], + [ + 499, + 501 + ], + [ + 512, + 513 + ], + [ + 527, + 528 + ], + [ + 530, + 531 + ], + [ + 533, + 534 + ], + [ + 536, + 537 + ], + [ + 556, + 558 + ], + [ + 559, + 560 + ], + [ + 567, + 571 + ], + [ + 575, + 577 + ], + [ + 585, + 587 + ], + [ + 594, + 596 + ], + [ + 599, + 600 + ], + [ + 604, + 606 + ], + [ + 611, + 612 + ], + [ + 616, + 617 + ], + [ + 618, + 620 + ], + [ + 621, + 623 + ], + [ + 626, + 627 + ], + [ + 639, + 641 + ], + [ + 644, + 646 + ], + [ + 647, + 649 + ], + [ + 652, + 653 + ], + [ + 654, + 663 + ], + [ + 665, + 666 + ], + [ + 669, + 680 + ], + [ + 686, + 689 + ], + [ + 694, + 696 + ], + [ + 697, + 698 + ], + [ + 706, + 711 + ], + [ + 716, + 719 + ], + [ + 738, + 741 + ], + [ + 742, + 745 + ], + [ + 751, + 754 + ], + [ + 762, + 763 + ], + [ + 764, + 765 + ], + [ + 769, + 771 + ], + [ + 773, + 775 + ], + [ + 777, + 779 + ], + [ + 782, + 784 + ], + [ + 786, + 787 + ], + [ + 790, + 792 + ], + [ + 793, + 794 + ], + [ + 801, + 803 + ], + [ + 805, + 806 + ], + [ + 810, + 813 + ], + [ + 816, + 817 + ], + [ + 821, + 822 + ], + [ + 826, + 830 + ], + [ + 831, + 832 + ], + [ + 837, + 839 + ], + [ + 841, + 842 + ], + [ + 844, + 845 + ], + [ + 847, + 850 + ], + [ + 855, + 856 + ], + [ + 858, + 859 + ], + [ + 861, + 863 + ], + [ + 864, + 865 + ], + [ + 866, + 867 + ], + [ + 869, + 870 + ], + [ + 873, + 874 + ], + [ + 876, + 877 + ], + [ + 878, + 879 + ], + [ + 884, + 885 + ], + [ + 887, + 889 + ], + [ + 895, + 897 + ], + [ + 899, + 901 + ], + [ + 904, + 906 + ], + [ + 907, + 908 + ], + [ + 910, + 911 + ], + [ + 916, + 920 + ], + [ + 921, + 925 + ], + [ + 927, + 929 + ], + [ + 932, + 935 + ], + [ + 938, + 940 + ], + [ + 941, + 942 + ], + [ + 945, + 946 + ], + [ + 950, + 954 + ], + [ + 956, + 958 + ], + [ + 959, + 964 + ], + [ + 968, + 971 + ], + [ + 979, + 983 + ], + [ + 986, + 988 + ], + [ + 990, + 991 + ], + [ + 994, + 997 + ], + [ + 1000, + 1003 + ], + [ + 1007, + 1009 + ], + [ + 1010, + 1013 + ], + [ + 1014, + 1016 + ], + [ + 1017, + 1018 + ], + [ + 1021, + 1022 + ], + [ + 1025, + 1029 + ], + [ + 1030, + 1031 + ] + ] + } + }, + { + "filename": "libvips/foreign/jpegload.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 90, + 171 + ], + [ + 174, + 217 + ], + [ + 224, + 337 + ], + [ + 339, + 362 + ], + [ + 368, + 415 + ], + [ + 416, + 437 + ], + [ + 446, + 474 + ], + [ + 478, + 493 + ], + [ + 494, + 503 + ], + [ + 504, + 520 + ], + [ + 527, + 548 + ], + [ + 549, + 564 + ], + [ + 570, + 595 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 93, + 95 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 111, + 118 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 143, + 147 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 156, + 160 + ], + [ + 161, + 162 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 177, + 178 + ], + [ + 184, + 185 + ], + [ + 190, + 193 + ], + [ + 194, + 196 + ], + [ + 197, + 200 + ], + [ + 201, + 203 + ], + [ + 204, + 207 + ], + [ + 208, + 210 + ], + [ + 213, + 214 + ], + [ + 227, + 229 + ], + [ + 231, + 232 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 242, + 244 + ], + [ + 245, + 246 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ], + [ + 255, + 257 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 267, + 268 + ], + [ + 274, + 280 + ], + [ + 283, + 284 + ], + [ + 290, + 291 + ], + [ + 296, + 298 + ], + [ + 300, + 301 + ], + [ + 305, + 309 + ], + [ + 310, + 312 + ], + [ + 313, + 314 + ], + [ + 317, + 318 + ], + [ + 322, + 326 + ], + [ + 327, + 328 + ], + [ + 331, + 332 + ], + [ + 333, + 334 + ], + [ + 342, + 343 + ], + [ + 349, + 355 + ], + [ + 358, + 359 + ], + [ + 371, + 373 + ], + [ + 375, + 376 + ], + [ + 378, + 379 + ], + [ + 381, + 386 + ], + [ + 387, + 389 + ], + [ + 390, + 391 + ], + [ + 394, + 395 + ], + [ + 399, + 403 + ], + [ + 404, + 405 + ], + [ + 408, + 410 + ], + [ + 411, + 412 + ], + [ + 419, + 420 + ], + [ + 424, + 430 + ], + [ + 433, + 434 + ], + [ + 449, + 450 + ], + [ + 451, + 452 + ], + [ + 454, + 456 + ], + [ + 461, + 462 + ], + [ + 463, + 464 + ], + [ + 465, + 467 + ], + [ + 470, + 471 + ], + [ + 481, + 485 + ], + [ + 489, + 490 + ], + [ + 497, + 498 + ], + [ + 499, + 500 + ], + [ + 507, + 508 + ], + [ + 512, + 515 + ], + [ + 516, + 517 + ], + [ + 530, + 531 + ], + [ + 534, + 535 + ], + [ + 536, + 538 + ], + [ + 544, + 545 + ], + [ + 552, + 553 + ], + [ + 554, + 557 + ], + [ + 558, + 559 + ], + [ + 560, + 561 + ], + [ + 573, + 574 + ], + [ + 577, + 578 + ], + [ + 584, + 585 + ], + [ + 589, + 592 + ], + [ + 593, + 594 + ] + ] + } + }, + { + "filename": "libvips/foreign/jpegsave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 90, + 97 + ], + [ + 111, + 119 + ], + [ + 124, + 150 + ], + [ + 152, + 159 + ], + [ + 162, + 249 + ], + [ + 257, + 312 + ], + [ + 314, + 331 + ], + [ + 332, + 380 + ], + [ + 388, + 457 + ], + [ + 461, + 472 + ], + [ + 475, + 525 + ], + [ + 526, + 534 + ], + [ + 549, + 570 + ], + [ + 592, + 603 + ], + [ + 610, + 617 + ], + [ + 619, + 656 + ], + [ + 674, + 695 + ], + [ + 707, + 714 + ], + [ + 718, + 754 + ], + [ + 771, + 785 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 93, + 94 + ], + [ + 114, + 116 + ], + [ + 127, + 128 + ], + [ + 131, + 133 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 144, + 145 + ], + [ + 146, + 147 + ], + [ + 155, + 156 + ], + [ + 165, + 168 + ], + [ + 169, + 171 + ], + [ + 172, + 175 + ], + [ + 176, + 178 + ], + [ + 179, + 182 + ], + [ + 183, + 185 + ], + [ + 186, + 189 + ], + [ + 190, + 192 + ], + [ + 193, + 196 + ], + [ + 197, + 199 + ], + [ + 200, + 203 + ], + [ + 204, + 206 + ], + [ + 207, + 210 + ], + [ + 211, + 213 + ], + [ + 214, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 224 + ], + [ + 225, + 227 + ], + [ + 228, + 231 + ], + [ + 232, + 233 + ], + [ + 234, + 235 + ], + [ + 236, + 239 + ], + [ + 240, + 242 + ], + [ + 245, + 246 + ], + [ + 260, + 262 + ], + [ + 264, + 265 + ], + [ + 268, + 269 + ], + [ + 271, + 273 + ], + [ + 274, + 281 + ], + [ + 282, + 283 + ], + [ + 286, + 288 + ], + [ + 289, + 290 + ], + [ + 296, + 297 + ], + [ + 299, + 305 + ], + [ + 308, + 309 + ], + [ + 317, + 318 + ], + [ + 323, + 325 + ], + [ + 327, + 328 + ], + [ + 335, + 348 + ], + [ + 349, + 350 + ], + [ + 351, + 352 + ], + [ + 355, + 356 + ], + [ + 357, + 358 + ], + [ + 364, + 365 + ], + [ + 367, + 373 + ], + [ + 376, + 377 + ], + [ + 391, + 393 + ], + [ + 395, + 396 + ], + [ + 399, + 400 + ], + [ + 405, + 419 + ], + [ + 421, + 424 + ], + [ + 425, + 426 + ], + [ + 427, + 428 + ], + [ + 431, + 433 + ], + [ + 434, + 435 + ], + [ + 441, + 442 + ], + [ + 444, + 450 + ], + [ + 453, + 454 + ], + [ + 464, + 466 + ], + [ + 468, + 469 + ], + [ + 478, + 492 + ], + [ + 494, + 495 + ], + [ + 496, + 502 + ], + [ + 503, + 504 + ], + [ + 505, + 506 + ], + [ + 507, + 508 + ], + [ + 511, + 512 + ], + [ + 516, + 517 + ], + [ + 521, + 522 + ], + [ + 529, + 531 + ], + [ + 552, + 554 + ], + [ + 555, + 556 + ], + [ + 560, + 561 + ], + [ + 564, + 565 + ], + [ + 566, + 567 + ], + [ + 595, + 596 + ], + [ + 597, + 598 + ], + [ + 599, + 600 + ], + [ + 613, + 614 + ], + [ + 622, + 624 + ], + [ + 628, + 629 + ], + [ + 631, + 632 + ], + [ + 638, + 639 + ], + [ + 643, + 646 + ], + [ + 647, + 648 + ], + [ + 652, + 653 + ], + [ + 677, + 678 + ], + [ + 682, + 685 + ], + [ + 686, + 687 + ], + [ + 691, + 692 + ], + [ + 710, + 711 + ], + [ + 721, + 722 + ], + [ + 727, + 728 + ], + [ + 729, + 732 + ], + [ + 733, + 736 + ], + [ + 739, + 740 + ], + [ + 742, + 743 + ], + [ + 745, + 746 + ], + [ + 750, + 751 + ], + [ + 774, + 775 + ], + [ + 779, + 782 + ], + [ + 783, + 784 + ] + ] + } + }, + { + "filename": "libvips/foreign/jxlload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 66, + 73 + ], + [ + 116, + 410 + ], + [ + 420, + 429 + ], + [ + 438, + 445 + ], + [ + 462, + 551 + ], + [ + 552, + 680 + ], + [ + 685, + 705 + ], + [ + 706, + 713 + ], + [ + 717, + 727 + ], + [ + 729, + 780 + ], + [ + 788, + 804 + ], + [ + 812, + 858 + ], + [ + 863, + 879 + ], + [ + 887, + 922 + ], + [ + 928, + 944 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 69, + 70 + ], + [ + 119, + 121 + ], + [ + 123, + 124 + ], + [ + 128, + 129 + ], + [ + 131, + 135 + ], + [ + 136, + 137 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 155, + 156 + ], + [ + 158, + 161 + ], + [ + 162, + 167 + ], + [ + 169, + 171 + ], + [ + 172, + 173 + ], + [ + 176, + 177 + ], + [ + 181, + 184 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 195 + ], + [ + 199, + 201 + ], + [ + 203, + 204 + ], + [ + 205, + 207 + ], + [ + 208, + 209 + ], + [ + 211, + 213 + ], + [ + 216, + 218 + ], + [ + 220, + 221 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 230 + ], + [ + 233, + 234 + ], + [ + 237, + 238 + ], + [ + 241, + 242 + ], + [ + 245, + 246 + ], + [ + 249, + 250 + ], + [ + 253, + 254 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 273, + 274 + ], + [ + 277, + 278 + ], + [ + 281, + 282 + ], + [ + 285, + 286 + ], + [ + 289, + 290 + ], + [ + 295, + 296 + ], + [ + 297, + 328 + ], + [ + 331, + 332 + ], + [ + 333, + 338 + ], + [ + 340, + 342 + ], + [ + 344, + 346 + ], + [ + 349, + 350 + ], + [ + 352, + 356 + ], + [ + 359, + 361 + ], + [ + 365, + 366 + ], + [ + 368, + 370 + ], + [ + 373, + 374 + ], + [ + 376, + 381 + ], + [ + 384, + 386 + ], + [ + 388, + 389 + ], + [ + 392, + 393 + ], + [ + 394, + 395 + ], + [ + 399, + 404 + ], + [ + 406, + 407 + ], + [ + 423, + 424 + ], + [ + 425, + 426 + ], + [ + 441, + 442 + ], + [ + 465, + 468 + ], + [ + 469, + 471 + ], + [ + 473, + 481 + ], + [ + 485, + 487 + ], + [ + 488, + 489 + ], + [ + 492, + 493 + ], + [ + 499, + 500 + ], + [ + 502, + 504 + ], + [ + 505, + 512 + ], + [ + 514, + 518 + ], + [ + 522, + 534 + ], + [ + 536, + 537 + ], + [ + 541, + 543 + ], + [ + 544, + 546 + ], + [ + 547, + 548 + ], + [ + 555, + 556 + ], + [ + 561, + 568 + ], + [ + 571, + 574 + ], + [ + 575, + 586 + ], + [ + 592, + 596 + ], + [ + 597, + 599 + ], + [ + 600, + 602 + ], + [ + 603, + 604 + ], + [ + 607, + 608 + ], + [ + 609, + 610 + ], + [ + 611, + 613 + ], + [ + 618, + 619 + ], + [ + 622, + 624 + ], + [ + 628, + 637 + ], + [ + 639, + 643 + ], + [ + 647, + 663 + ], + [ + 664, + 669 + ], + [ + 670, + 677 + ], + [ + 688, + 689 + ], + [ + 690, + 692 + ], + [ + 693, + 694 + ], + [ + 697, + 698 + ], + [ + 699, + 700 + ], + [ + 701, + 702 + ], + [ + 709, + 710 + ], + [ + 723, + 724 + ], + [ + 732, + 733 + ], + [ + 738, + 740 + ], + [ + 742, + 743 + ], + [ + 747, + 750 + ], + [ + 751, + 753 + ], + [ + 754, + 755 + ], + [ + 757, + 758 + ], + [ + 760, + 761 + ], + [ + 765, + 769 + ], + [ + 770, + 771 + ], + [ + 774, + 775 + ], + [ + 776, + 777 + ], + [ + 791, + 797 + ], + [ + 800, + 801 + ], + [ + 815, + 817 + ], + [ + 819, + 820 + ], + [ + 822, + 823 + ], + [ + 825, + 830 + ], + [ + 831, + 833 + ], + [ + 834, + 835 + ], + [ + 838, + 839 + ], + [ + 843, + 847 + ], + [ + 848, + 849 + ], + [ + 852, + 853 + ], + [ + 854, + 855 + ], + [ + 866, + 872 + ], + [ + 875, + 876 + ], + [ + 890, + 892 + ], + [ + 894, + 895 + ], + [ + 897, + 898 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 905, + 909 + ], + [ + 910, + 911 + ], + [ + 914, + 915 + ], + [ + 916, + 917 + ], + [ + 918, + 919 + ], + [ + 931, + 937 + ], + [ + 940, + 941 + ] + ] + } + }, + { + "filename": "libvips/foreign/jxlsave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 104, + 263 + ], + [ + 264, + 285 + ], + [ + 302, + 309 + ], + [ + 317, + 325 + ], + [ + 326, + 335 + ], + [ + 336, + 347 + ], + [ + 349, + 444 + ], + [ + 445, + 476 + ], + [ + 486, + 497 + ], + [ + 499, + 506 + ], + [ + 514, + 558 + ], + [ + 565, + 599 + ], + [ + 601, + 617 + ], + [ + 625, + 661 + ], + [ + 663, + 679 + ], + [ + 684, + 716 + ], + [ + 718, + 734 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 107, + 109 + ], + [ + 111, + 112 + ], + [ + 115, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 134, + 135 + ], + [ + 136, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 178 + ], + [ + 180, + 182 + ], + [ + 184, + 186 + ], + [ + 189, + 190 + ], + [ + 192, + 195 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 225, + 226 + ], + [ + 229, + 230 + ], + [ + 236, + 238 + ], + [ + 243, + 245 + ], + [ + 248, + 249 + ], + [ + 251, + 254 + ], + [ + 255, + 260 + ], + [ + 267, + 268 + ], + [ + 269, + 271 + ], + [ + 275, + 277 + ], + [ + 279, + 280 + ], + [ + 281, + 282 + ], + [ + 305, + 306 + ], + [ + 320, + 322 + ], + [ + 329, + 330 + ], + [ + 331, + 332 + ], + [ + 339, + 340 + ], + [ + 342, + 344 + ], + [ + 352, + 355 + ], + [ + 359, + 360 + ], + [ + 363, + 366 + ], + [ + 368, + 369 + ], + [ + 370, + 375 + ], + [ + 381, + 382 + ], + [ + 383, + 384 + ], + [ + 386, + 388 + ], + [ + 391, + 392 + ], + [ + 394, + 396 + ], + [ + 398, + 403 + ], + [ + 409, + 411 + ], + [ + 412, + 419 + ], + [ + 421, + 428 + ], + [ + 430, + 435 + ], + [ + 440, + 441 + ], + [ + 448, + 451 + ], + [ + 453, + 457 + ], + [ + 460, + 462 + ], + [ + 463, + 464 + ], + [ + 465, + 466 + ], + [ + 467, + 468 + ], + [ + 469, + 471 + ], + [ + 472, + 473 + ], + [ + 489, + 490 + ], + [ + 491, + 492 + ], + [ + 493, + 494 + ], + [ + 502, + 503 + ], + [ + 517, + 520 + ], + [ + 521, + 523 + ], + [ + 524, + 527 + ], + [ + 528, + 530 + ], + [ + 531, + 534 + ], + [ + 535, + 537 + ], + [ + 538, + 541 + ], + [ + 542, + 544 + ], + [ + 545, + 548 + ], + [ + 549, + 551 + ], + [ + 554, + 555 + ], + [ + 568, + 569 + ], + [ + 574, + 576 + ], + [ + 578, + 579 + ], + [ + 583, + 585 + ], + [ + 586, + 588 + ], + [ + 589, + 590 + ], + [ + 593, + 594 + ], + [ + 595, + 596 + ], + [ + 604, + 610 + ], + [ + 613, + 614 + ], + [ + 628, + 630 + ], + [ + 632, + 633 + ], + [ + 635, + 636 + ], + [ + 640, + 642 + ], + [ + 643, + 645 + ], + [ + 646, + 649 + ], + [ + 650, + 651 + ], + [ + 654, + 656 + ], + [ + 657, + 658 + ], + [ + 666, + 672 + ], + [ + 675, + 676 + ], + [ + 687, + 689 + ], + [ + 691, + 692 + ], + [ + 694, + 695 + ], + [ + 697, + 698 + ], + [ + 699, + 700 + ], + [ + 702, + 704 + ], + [ + 705, + 706 + ], + [ + 709, + 711 + ], + [ + 712, + 713 + ], + [ + 721, + 727 + ], + [ + 730, + 731 + ] + ] + } + }, + { + "filename": "libvips/foreign/magick.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 10, + 38 + ], + [ + 52, + 65 + ], + [ + 73, + 129 + ], + [ + 130, + 236 + ], + [ + 240, + 281 + ], + [ + 282, + 303 + ], + [ + 304, + 351 + ], + [ + 353, + 470 + ], + [ + 471, + 508 + ], + [ + 509, + 554 + ], + [ + 557, + 565 + ], + [ + 568, + 606 + ], + [ + 607, + 643 + ], + [ + 644, + 661 + ], + [ + 676, + 684 + ], + [ + 708, + 816 + ], + [ + 818, + 873 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 29 + ], + [ + 34, + 35 + ], + [ + 55, + 56 + ], + [ + 61, + 62 + ], + [ + 76, + 77 + ], + [ + 78, + 79 + ], + [ + 82, + 84 + ], + [ + 85, + 87 + ], + [ + 90, + 92 + ], + [ + 93, + 96 + ], + [ + 97, + 104 + ], + [ + 105, + 106 + ], + [ + 109, + 111 + ], + [ + 114, + 116 + ], + [ + 119, + 120 + ], + [ + 124, + 126 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 139, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 148 + ], + [ + 149, + 150 + ], + [ + 153, + 154 + ], + [ + 155, + 156 + ], + [ + 157, + 159 + ], + [ + 162, + 164 + ], + [ + 165, + 166 + ], + [ + 169, + 171 + ], + [ + 172, + 173 + ], + [ + 176, + 179 + ], + [ + 183, + 186 + ], + [ + 187, + 188 + ], + [ + 191, + 192 + ], + [ + 195, + 197 + ], + [ + 202, + 207 + ], + [ + 209, + 210 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 232, + 233 + ], + [ + 243, + 245 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 254, + 256 + ], + [ + 259, + 260 + ], + [ + 266, + 268 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 277, + 278 + ], + [ + 285, + 287 + ], + [ + 290, + 292 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 307, + 308 + ], + [ + 312, + 313 + ], + [ + 316, + 317 + ], + [ + 321, + 323 + ], + [ + 326, + 327 + ], + [ + 330, + 331 + ], + [ + 335, + 337 + ], + [ + 339, + 340 + ], + [ + 343, + 345 + ], + [ + 346, + 348 + ], + [ + 356, + 357 + ], + [ + 361, + 362 + ], + [ + 363, + 364 + ], + [ + 366, + 369 + ], + [ + 372, + 374 + ], + [ + 375, + 379 + ], + [ + 382, + 385 + ], + [ + 387, + 389 + ], + [ + 391, + 393 + ], + [ + 395, + 397 + ], + [ + 399, + 401 + ], + [ + 403, + 405 + ], + [ + 411, + 412 + ], + [ + 414, + 415 + ], + [ + 416, + 417 + ], + [ + 418, + 419 + ], + [ + 423, + 425 + ], + [ + 427, + 428 + ], + [ + 429, + 430 + ], + [ + 434, + 436 + ], + [ + 439, + 442 + ], + [ + 446, + 447 + ], + [ + 448, + 449 + ], + [ + 455, + 460 + ], + [ + 462, + 463 + ], + [ + 466, + 467 + ], + [ + 474, + 476 + ], + [ + 478, + 483 + ], + [ + 484, + 495 + ], + [ + 496, + 497 + ], + [ + 500, + 501 + ], + [ + 504, + 505 + ], + [ + 512, + 513 + ], + [ + 515, + 517 + ], + [ + 519, + 520 + ], + [ + 523, + 524 + ], + [ + 528, + 530 + ], + [ + 532, + 535 + ], + [ + 540, + 541 + ], + [ + 543, + 544 + ], + [ + 548, + 549 + ], + [ + 550, + 551 + ], + [ + 560, + 562 + ], + [ + 571, + 572 + ], + [ + 576, + 577 + ], + [ + 578, + 579 + ], + [ + 581, + 582 + ], + [ + 586, + 589 + ], + [ + 594, + 596 + ], + [ + 599, + 603 + ], + [ + 610, + 611 + ], + [ + 617, + 619 + ], + [ + 620, + 623 + ], + [ + 626, + 628 + ], + [ + 632, + 634 + ], + [ + 637, + 638 + ], + [ + 639, + 640 + ], + [ + 647, + 649 + ], + [ + 651, + 652 + ], + [ + 657, + 658 + ], + [ + 679, + 681 + ], + [ + 711, + 712 + ], + [ + 715, + 718 + ], + [ + 719, + 720 + ], + [ + 723, + 735 + ], + [ + 739, + 740 + ], + [ + 744, + 745 + ], + [ + 747, + 751 + ], + [ + 754, + 755 + ], + [ + 759, + 760 + ], + [ + 762, + 763 + ], + [ + 766, + 767 + ], + [ + 770, + 771 + ], + [ + 776, + 778 + ], + [ + 782, + 792 + ], + [ + 793, + 794 + ], + [ + 795, + 797 + ], + [ + 798, + 800 + ], + [ + 801, + 802 + ], + [ + 807, + 808 + ], + [ + 809, + 811 + ], + [ + 812, + 813 + ], + [ + 821, + 823 + ], + [ + 825, + 826 + ], + [ + 829, + 840 + ], + [ + 841, + 847 + ], + [ + 848, + 851 + ], + [ + 852, + 853 + ], + [ + 858, + 860 + ], + [ + 865, + 868 + ], + [ + 869, + 870 + ] + ] + } + }, + { + "filename": "libvips/foreign/magick.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 37 + ], + [ + 42, + 96 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 33, + 34 + ], + [ + 45, + 52 + ], + [ + 53, + 94 + ] + ] + } + }, + { + "filename": "libvips/foreign/magick2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 16, + 23 + ], + [ + 25, + 32 + ], + [ + 41, + 53 + ], + [ + 72, + 100 + ], + [ + 126, + 139 + ], + [ + 141, + 148 + ], + [ + 168, + 202 + ], + [ + 204, + 287 + ], + [ + 300, + 316 + ], + [ + 319, + 392 + ], + [ + 393, + 400 + ], + [ + 404, + 416 + ], + [ + 430, + 521 + ], + [ + 522, + 561 + ], + [ + 562, + 640 + ], + [ + 643, + 662 + ], + [ + 665, + 684 + ], + [ + 687, + 706 + ], + [ + 712, + 751 + ], + [ + 753, + 950 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 19, + 20 + ], + [ + 28, + 29 + ], + [ + 44, + 45 + ], + [ + 49, + 50 + ], + [ + 75, + 76 + ], + [ + 77, + 81 + ], + [ + 82, + 91 + ], + [ + 96, + 97 + ], + [ + 129, + 130 + ], + [ + 135, + 136 + ], + [ + 144, + 145 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 177, + 183 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 196, + 199 + ], + [ + 207, + 208 + ], + [ + 210, + 213 + ], + [ + 219, + 221 + ], + [ + 227, + 228 + ], + [ + 229, + 231 + ], + [ + 232, + 235 + ], + [ + 238, + 242 + ], + [ + 245, + 246 + ], + [ + 249, + 250 + ], + [ + 254, + 256 + ], + [ + 257, + 260 + ], + [ + 262, + 263 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 272, + 273 + ], + [ + 274, + 275 + ], + [ + 281, + 284 + ], + [ + 303, + 306 + ], + [ + 308, + 309 + ], + [ + 312, + 313 + ], + [ + 322, + 338 + ], + [ + 343, + 345 + ], + [ + 349, + 354 + ], + [ + 356, + 357 + ], + [ + 359, + 360 + ], + [ + 364, + 365 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 375, + 377 + ], + [ + 380, + 384 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 396, + 397 + ], + [ + 407, + 410 + ], + [ + 412, + 413 + ], + [ + 433, + 435 + ], + [ + 438, + 440 + ], + [ + 442, + 444 + ], + [ + 445, + 456 + ], + [ + 458, + 460 + ], + [ + 461, + 467 + ], + [ + 468, + 471 + ], + [ + 473, + 475 + ], + [ + 476, + 483 + ], + [ + 484, + 487 + ], + [ + 488, + 489 + ], + [ + 490, + 495 + ], + [ + 498, + 499 + ], + [ + 502, + 503 + ], + [ + 504, + 507 + ], + [ + 508, + 509 + ], + [ + 510, + 512 + ], + [ + 513, + 518 + ], + [ + 525, + 526 + ], + [ + 531, + 532 + ], + [ + 534, + 536 + ], + [ + 539, + 541 + ], + [ + 542, + 543 + ], + [ + 544, + 545 + ], + [ + 547, + 549 + ], + [ + 552, + 553 + ], + [ + 554, + 556 + ], + [ + 557, + 558 + ], + [ + 565, + 575 + ], + [ + 576, + 587 + ], + [ + 588, + 600 + ], + [ + 601, + 614 + ], + [ + 616, + 617 + ], + [ + 620, + 621 + ], + [ + 624, + 637 + ], + [ + 646, + 647 + ], + [ + 648, + 659 + ], + [ + 668, + 681 + ], + [ + 690, + 691 + ], + [ + 692, + 703 + ], + [ + 715, + 716 + ], + [ + 720, + 722 + ], + [ + 723, + 724 + ], + [ + 725, + 726 + ], + [ + 732, + 733 + ], + [ + 734, + 736 + ], + [ + 739, + 740 + ], + [ + 744, + 745 + ], + [ + 747, + 748 + ], + [ + 756, + 757 + ], + [ + 760, + 762 + ], + [ + 767, + 768 + ], + [ + 774, + 775 + ], + [ + 776, + 778 + ], + [ + 779, + 780 + ], + [ + 781, + 786 + ], + [ + 788, + 790 + ], + [ + 792, + 793 + ], + [ + 796, + 798 + ], + [ + 802, + 803 + ], + [ + 805, + 807 + ], + [ + 809, + 810 + ], + [ + 812, + 818 + ], + [ + 820, + 825 + ], + [ + 826, + 827 + ], + [ + 830, + 832 + ], + [ + 836, + 837 + ], + [ + 839, + 841 + ], + [ + 843, + 844 + ], + [ + 848, + 849 + ], + [ + 850, + 856 + ], + [ + 858, + 860 + ], + [ + 861, + 865 + ], + [ + 869, + 870 + ], + [ + 871, + 872 + ], + [ + 875, + 877 + ], + [ + 881, + 882 + ], + [ + 884, + 886 + ], + [ + 888, + 889 + ], + [ + 891, + 897 + ], + [ + 899, + 904 + ], + [ + 905, + 906 + ], + [ + 909, + 911 + ], + [ + 915, + 916 + ], + [ + 918, + 920 + ], + [ + 922, + 923 + ], + [ + 926, + 928 + ], + [ + 929, + 935 + ], + [ + 937, + 939 + ], + [ + 940, + 944 + ], + [ + 946, + 947 + ] + ] + } + }, + { + "filename": "libvips/foreign/magick6load.c", + "line_filter": { + "diff_chunks": [ + [ + 18, + 46 + ], + [ + 74, + 109 + ], + [ + 110, + 119 + ], + [ + 126, + 167 + ], + [ + 168, + 227 + ], + [ + 228, + 250 + ], + [ + 256, + 302 + ], + [ + 303, + 325 + ] + ], + "lines_added": [ + [ + 21, + 37 + ], + [ + 42, + 43 + ], + [ + 77, + 80 + ], + [ + 85, + 87 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ], + [ + 129, + 130 + ], + [ + 133, + 136 + ], + [ + 137, + 139 + ], + [ + 140, + 143 + ], + [ + 144, + 146 + ], + [ + 147, + 150 + ], + [ + 151, + 153 + ], + [ + 154, + 157 + ], + [ + 158, + 160 + ], + [ + 163, + 164 + ], + [ + 171, + 172 + ], + [ + 177, + 179 + ], + [ + 181, + 182 + ], + [ + 188, + 190 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 203, + 204 + ], + [ + 206, + 207 + ], + [ + 209, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 220, + 222 + ], + [ + 223, + 224 + ], + [ + 231, + 232 + ], + [ + 237, + 243 + ], + [ + 246, + 247 + ], + [ + 259, + 261 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 279, + 280 + ], + [ + 282, + 283 + ], + [ + 285, + 290 + ], + [ + 291, + 292 + ], + [ + 295, + 297 + ], + [ + 298, + 299 + ], + [ + 306, + 307 + ], + [ + 312, + 318 + ], + [ + 321, + 322 + ] + ] + } + }, + { + "filename": "libvips/foreign/magick7load.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 71, + 80 + ], + [ + 85, + 93 + ], + [ + 96, + 108 + ], + [ + 114, + 222 + ], + [ + 230, + 237 + ], + [ + 243, + 346 + ], + [ + 348, + 358 + ], + [ + 365, + 422 + ], + [ + 424, + 456 + ], + [ + 457, + 498 + ], + [ + 499, + 506 + ], + [ + 510, + 533 + ], + [ + 541, + 602 + ], + [ + 603, + 634 + ], + [ + 636, + 712 + ], + [ + 713, + 724 + ], + [ + 725, + 840 + ], + [ + 841, + 862 + ], + [ + 868, + 922 + ], + [ + 923, + 944 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 74, + 77 + ], + [ + 88, + 90 + ], + [ + 99, + 101 + ], + [ + 104, + 105 + ], + [ + 117, + 135 + ], + [ + 138, + 139 + ], + [ + 141, + 164 + ], + [ + 167, + 191 + ], + [ + 193, + 200 + ], + [ + 201, + 203 + ], + [ + 205, + 209 + ], + [ + 212, + 213 + ], + [ + 218, + 219 + ], + [ + 233, + 234 + ], + [ + 246, + 249 + ], + [ + 251, + 253 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 276, + 277 + ], + [ + 279, + 281 + ], + [ + 282, + 290 + ], + [ + 293, + 294 + ], + [ + 298, + 299 + ], + [ + 303, + 304 + ], + [ + 307, + 309 + ], + [ + 310, + 311 + ], + [ + 315, + 316 + ], + [ + 319, + 320 + ], + [ + 324, + 326 + ], + [ + 327, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 335 + ], + [ + 338, + 339 + ], + [ + 340, + 341 + ], + [ + 342, + 343 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 368, + 369 + ], + [ + 372, + 375 + ], + [ + 376, + 378 + ], + [ + 379, + 382 + ], + [ + 383, + 385 + ], + [ + 386, + 389 + ], + [ + 390, + 392 + ], + [ + 393, + 396 + ], + [ + 397, + 399 + ], + [ + 402, + 403 + ], + [ + 408, + 409 + ], + [ + 410, + 411 + ], + [ + 412, + 415 + ], + [ + 418, + 419 + ], + [ + 427, + 429 + ], + [ + 430, + 431 + ], + [ + 432, + 433 + ], + [ + 434, + 435 + ], + [ + 438, + 440 + ], + [ + 441, + 442 + ], + [ + 447, + 453 + ], + [ + 460, + 462 + ], + [ + 466, + 471 + ], + [ + 474, + 475 + ], + [ + 477, + 478 + ], + [ + 479, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 484 + ], + [ + 486, + 490 + ], + [ + 492, + 493 + ], + [ + 494, + 495 + ], + [ + 502, + 503 + ], + [ + 513, + 517 + ], + [ + 519, + 520 + ], + [ + 523, + 524 + ], + [ + 529, + 530 + ], + [ + 544, + 546 + ], + [ + 549, + 551 + ], + [ + 552, + 553 + ], + [ + 555, + 559 + ], + [ + 560, + 562 + ], + [ + 566, + 568 + ], + [ + 569, + 575 + ], + [ + 576, + 577 + ], + [ + 578, + 579 + ], + [ + 583, + 584 + ], + [ + 588, + 590 + ], + [ + 591, + 593 + ], + [ + 594, + 599 + ], + [ + 606, + 607 + ], + [ + 612, + 613 + ], + [ + 615, + 617 + ], + [ + 620, + 622 + ], + [ + 625, + 626 + ], + [ + 627, + 629 + ], + [ + 630, + 631 + ], + [ + 639, + 655 + ], + [ + 656, + 657 + ], + [ + 659, + 661 + ], + [ + 663, + 664 + ], + [ + 668, + 669 + ], + [ + 674, + 676 + ], + [ + 677, + 678 + ], + [ + 679, + 682 + ], + [ + 683, + 684 + ], + [ + 685, + 686 + ], + [ + 692, + 693 + ], + [ + 694, + 695 + ], + [ + 696, + 697 + ], + [ + 700, + 701 + ], + [ + 704, + 705 + ], + [ + 708, + 709 + ], + [ + 716, + 717 + ], + [ + 720, + 721 + ], + [ + 728, + 729 + ], + [ + 731, + 734 + ], + [ + 737, + 741 + ], + [ + 742, + 743 + ], + [ + 744, + 745 + ], + [ + 749, + 756 + ], + [ + 761, + 763 + ], + [ + 765, + 769 + ], + [ + 770, + 771 + ], + [ + 776, + 777 + ], + [ + 782, + 784 + ], + [ + 786, + 787 + ], + [ + 793, + 795 + ], + [ + 798, + 799 + ], + [ + 804, + 805 + ], + [ + 807, + 809 + ], + [ + 810, + 811 + ], + [ + 815, + 816 + ], + [ + 818, + 822 + ], + [ + 824, + 826 + ], + [ + 827, + 828 + ], + [ + 829, + 830 + ], + [ + 833, + 835 + ], + [ + 836, + 837 + ], + [ + 844, + 845 + ], + [ + 849, + 855 + ], + [ + 858, + 859 + ], + [ + 871, + 873 + ], + [ + 875, + 876 + ], + [ + 877, + 879 + ], + [ + 882, + 883 + ], + [ + 885, + 886 + ], + [ + 889, + 890 + ], + [ + 895, + 896 + ], + [ + 898, + 901 + ], + [ + 902, + 906 + ], + [ + 908, + 910 + ], + [ + 911, + 912 + ], + [ + 915, + 917 + ], + [ + 918, + 919 + ], + [ + 926, + 927 + ], + [ + 931, + 937 + ], + [ + 940, + 941 + ] + ] + } + }, + { + "filename": "libvips/foreign/magickload.c", + "line_filter": { + "diff_chunks": [ + [ + 18, + 46 + ], + [ + 73, + 80 + ], + [ + 90, + 98 + ], + [ + 99, + 115 + ], + [ + 125, + 142 + ], + [ + 143, + 156 + ] + ], + "lines_added": [ + [ + 21, + 37 + ], + [ + 42, + 43 + ], + [ + 76, + 77 + ], + [ + 93, + 95 + ], + [ + 102, + 103 + ], + [ + 107, + 110 + ], + [ + 111, + 112 + ], + [ + 128, + 129 + ], + [ + 130, + 132 + ], + [ + 138, + 139 + ], + [ + 146, + 147 + ], + [ + 148, + 151 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ] + ] + } + }, + { + "filename": "libvips/foreign/magicksave.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 9, + 16 + ], + [ + 18, + 46 + ], + [ + 56, + 64 + ], + [ + 92, + 113 + ], + [ + 119, + 126 + ], + [ + 130, + 159 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 12, + 13 + ], + [ + 21, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 37 + ], + [ + 42, + 43 + ], + [ + 59, + 61 + ], + [ + 95, + 96 + ], + [ + 100, + 103 + ], + [ + 104, + 105 + ], + [ + 109, + 110 + ], + [ + 122, + 123 + ], + [ + 133, + 134 + ], + [ + 139, + 140 + ], + [ + 141, + 144 + ], + [ + 145, + 148 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ], + [ + 157, + 158 + ] + ] + } + }, + { + "filename": "libvips/foreign/matlab.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 41 + ], + [ + 46, + 53 + ], + [ + 86, + 146 + ], + [ + 157, + 194 + ], + [ + 199, + 293 + ], + [ + 295, + 339 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 12 + ], + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 32 + ], + [ + 37, + 38 + ], + [ + 49, + 50 + ], + [ + 89, + 90 + ], + [ + 91, + 94 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 103, + 105 + ], + [ + 106, + 107 + ], + [ + 111, + 116 + ], + [ + 118, + 125 + ], + [ + 128, + 132 + ], + [ + 136, + 137 + ], + [ + 139, + 140 + ], + [ + 142, + 143 + ], + [ + 160, + 162 + ], + [ + 163, + 178 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 190, + 191 + ], + [ + 202, + 205 + ], + [ + 207, + 209 + ], + [ + 210, + 214 + ], + [ + 216, + 217 + ], + [ + 218, + 222 + ], + [ + 223, + 227 + ], + [ + 228, + 229 + ], + [ + 232, + 233 + ], + [ + 237, + 238 + ], + [ + 240, + 245 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 256, + 257 + ], + [ + 261, + 262 + ], + [ + 263, + 267 + ], + [ + 272, + 275 + ], + [ + 276, + 277 + ], + [ + 282, + 283 + ], + [ + 285, + 286 + ], + [ + 289, + 290 + ], + [ + 298, + 300 + ], + [ + 302, + 303 + ], + [ + 306, + 307 + ], + [ + 311, + 312 + ], + [ + 314, + 320 + ], + [ + 321, + 322 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ], + [ + 331, + 334 + ], + [ + 335, + 336 + ] + ] + } + }, + { + "filename": "libvips/foreign/matload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 59, + 118 + ], + [ + 119, + 126 + ], + [ + 128, + 150 + ], + [ + 155, + 181 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 62, + 63 + ], + [ + 68, + 70 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 90, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 103, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 122, + 123 + ], + [ + 131, + 132 + ], + [ + 137, + 143 + ], + [ + 146, + 147 + ], + [ + 158, + 159 + ], + [ + 163, + 164 + ], + [ + 170, + 171 + ], + [ + 175, + 178 + ], + [ + 179, + 180 + ] + ] + } + }, + { + "filename": "libvips/foreign/matrixload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 71, + 175 + ], + [ + 181, + 286 + ], + [ + 294, + 324 + ], + [ + 326, + 333 + ], + [ + 336, + 359 + ], + [ + 366, + 385 + ], + [ + 391, + 420 + ], + [ + 424, + 450 + ], + [ + 456, + 472 + ], + [ + 478, + 496 + ], + [ + 502, + 518 + ], + [ + 520, + 541 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 74, + 76 + ], + [ + 78, + 79 + ], + [ + 82, + 85 + ], + [ + 86, + 87 + ], + [ + 90, + 91 + ], + [ + 94, + 96 + ], + [ + 97, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 115, + 117 + ], + [ + 122, + 130 + ], + [ + 132, + 133 + ], + [ + 134, + 135 + ], + [ + 136, + 139 + ], + [ + 141, + 145 + ], + [ + 151, + 152 + ], + [ + 153, + 158 + ], + [ + 159, + 162 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 184, + 212 + ], + [ + 215, + 216 + ], + [ + 218, + 219 + ], + [ + 222, + 229 + ], + [ + 230, + 231 + ], + [ + 234, + 245 + ], + [ + 247, + 248 + ], + [ + 249, + 253 + ], + [ + 255, + 258 + ], + [ + 260, + 261 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 273, + 274 + ], + [ + 282, + 283 + ], + [ + 297, + 299 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 307, + 308 + ], + [ + 312, + 316 + ], + [ + 317, + 319 + ], + [ + 320, + 321 + ], + [ + 329, + 330 + ], + [ + 339, + 341 + ], + [ + 344, + 346 + ], + [ + 348, + 349 + ], + [ + 352, + 354 + ], + [ + 355, + 356 + ], + [ + 369, + 370 + ], + [ + 372, + 375 + ], + [ + 376, + 378 + ], + [ + 381, + 382 + ], + [ + 394, + 396 + ], + [ + 398, + 399 + ], + [ + 401, + 402 + ], + [ + 404, + 405 + ], + [ + 406, + 407 + ], + [ + 409, + 411 + ], + [ + 412, + 413 + ], + [ + 416, + 417 + ], + [ + 427, + 431 + ], + [ + 433, + 435 + ], + [ + 437, + 438 + ], + [ + 441, + 443 + ], + [ + 444, + 445 + ], + [ + 446, + 447 + ], + [ + 459, + 465 + ], + [ + 468, + 469 + ], + [ + 481, + 482 + ], + [ + 486, + 488 + ], + [ + 492, + 493 + ], + [ + 505, + 506 + ], + [ + 510, + 513 + ], + [ + 514, + 515 + ], + [ + 523, + 524 + ], + [ + 530, + 531 + ], + [ + 535, + 538 + ], + [ + 539, + 540 + ] + ] + } + }, + { + "filename": "libvips/foreign/matrixsave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 61, + 142 + ], + [ + 153, + 160 + ], + [ + 162, + 171 + ], + [ + 172, + 223 + ], + [ + 225, + 241 + ], + [ + 246, + 277 + ], + [ + 279, + 295 + ], + [ + 299, + 340 + ], + [ + 345, + 366 + ], + [ + 370, + 391 + ], + [ + 395, + 409 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 64, + 66 + ], + [ + 68, + 69 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 84, + 87 + ], + [ + 88, + 89 + ], + [ + 90, + 93 + ], + [ + 94, + 97 + ], + [ + 98, + 100 + ], + [ + 102, + 103 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 115, + 117 + ], + [ + 118, + 121 + ], + [ + 122, + 130 + ], + [ + 131, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 156, + 157 + ], + [ + 165, + 166 + ], + [ + 167, + 168 + ], + [ + 175, + 176 + ], + [ + 185, + 186 + ], + [ + 192, + 193 + ], + [ + 197, + 199 + ], + [ + 201, + 202 + ], + [ + 206, + 209 + ], + [ + 210, + 213 + ], + [ + 216, + 218 + ], + [ + 219, + 220 + ], + [ + 228, + 234 + ], + [ + 237, + 238 + ], + [ + 249, + 251 + ], + [ + 253, + 254 + ], + [ + 256, + 257 + ], + [ + 259, + 262 + ], + [ + 264, + 267 + ], + [ + 270, + 272 + ], + [ + 273, + 274 + ], + [ + 282, + 288 + ], + [ + 291, + 292 + ], + [ + 302, + 304 + ], + [ + 306, + 307 + ], + [ + 310, + 312 + ], + [ + 313, + 315 + ], + [ + 316, + 317 + ], + [ + 320, + 321 + ], + [ + 325, + 326 + ], + [ + 330, + 331 + ], + [ + 336, + 337 + ], + [ + 348, + 349 + ], + [ + 353, + 356 + ], + [ + 357, + 358 + ], + [ + 362, + 363 + ], + [ + 373, + 374 + ], + [ + 378, + 381 + ], + [ + 382, + 383 + ], + [ + 387, + 388 + ], + [ + 398, + 399 + ], + [ + 403, + 406 + ], + [ + 407, + 408 + ] + ] + } + }, + { + "filename": "libvips/foreign/niftiload.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 42, + 54 + ], + [ + 87, + 94 + ], + [ + 95, + 144 + ], + [ + 145, + 152 + ], + [ + 163, + 190 + ], + [ + 198, + 389 + ], + [ + 393, + 422 + ], + [ + 425, + 473 + ], + [ + 474, + 525 + ], + [ + 529, + 587 + ], + [ + 589, + 596 + ], + [ + 606, + 613 + ], + [ + 615, + 657 + ], + [ + 660, + 697 + ], + [ + 699, + 722 + ], + [ + 730, + 803 + ], + [ + 808, + 815 + ], + [ + 817, + 833 + ], + [ + 835, + 854 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 45, + 46 + ], + [ + 50, + 51 + ], + [ + 90, + 91 + ], + [ + 98, + 100 + ], + [ + 102, + 103 + ], + [ + 106, + 109 + ], + [ + 110, + 111 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 122, + 124 + ], + [ + 127, + 132 + ], + [ + 134, + 135 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 148, + 149 + ], + [ + 166, + 167 + ], + [ + 170, + 173 + ], + [ + 174, + 175 + ], + [ + 178, + 179 + ], + [ + 182, + 185 + ], + [ + 186, + 187 + ], + [ + 201, + 318 + ], + [ + 321, + 322 + ], + [ + 326, + 327 + ], + [ + 329, + 333 + ], + [ + 334, + 336 + ], + [ + 338, + 339 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 356, + 357 + ], + [ + 360, + 362 + ], + [ + 366, + 368 + ], + [ + 370, + 371 + ], + [ + 374, + 377 + ], + [ + 378, + 379 + ], + [ + 382, + 384 + ], + [ + 385, + 386 + ], + [ + 396, + 402 + ], + [ + 403, + 408 + ], + [ + 414, + 419 + ], + [ + 428, + 433 + ], + [ + 434, + 437 + ], + [ + 439, + 444 + ], + [ + 446, + 447 + ], + [ + 448, + 449 + ], + [ + 455, + 458 + ], + [ + 459, + 462 + ], + [ + 463, + 465 + ], + [ + 468, + 470 + ], + [ + 477, + 481 + ], + [ + 483, + 486 + ], + [ + 487, + 492 + ], + [ + 495, + 497 + ], + [ + 501, + 505 + ], + [ + 506, + 507 + ], + [ + 509, + 511 + ], + [ + 513, + 514 + ], + [ + 515, + 516 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 532, + 536 + ], + [ + 538, + 541 + ], + [ + 543, + 544 + ], + [ + 545, + 546 + ], + [ + 549, + 550 + ], + [ + 551, + 552 + ], + [ + 555, + 556 + ], + [ + 558, + 559 + ], + [ + 560, + 564 + ], + [ + 566, + 571 + ], + [ + 572, + 574 + ], + [ + 575, + 576 + ], + [ + 579, + 580 + ], + [ + 581, + 582 + ], + [ + 583, + 584 + ], + [ + 592, + 593 + ], + [ + 609, + 610 + ], + [ + 618, + 619 + ], + [ + 624, + 626 + ], + [ + 628, + 629 + ], + [ + 633, + 637 + ], + [ + 638, + 640 + ], + [ + 641, + 642 + ], + [ + 644, + 650 + ], + [ + 653, + 654 + ], + [ + 663, + 665 + ], + [ + 666, + 670 + ], + [ + 671, + 672 + ], + [ + 673, + 674 + ], + [ + 675, + 676 + ], + [ + 680, + 685 + ], + [ + 686, + 687 + ], + [ + 690, + 692 + ], + [ + 693, + 694 + ], + [ + 702, + 703 + ], + [ + 709, + 715 + ], + [ + 718, + 719 + ], + [ + 733, + 735 + ], + [ + 737, + 738 + ], + [ + 740, + 741 + ], + [ + 743, + 744 + ], + [ + 745, + 746 + ], + [ + 748, + 752 + ], + [ + 753, + 754 + ], + [ + 757, + 758 + ], + [ + 759, + 760 + ], + [ + 763, + 766 + ], + [ + 769, + 771 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ], + [ + 781, + 782 + ], + [ + 786, + 787 + ], + [ + 789, + 795 + ], + [ + 798, + 800 + ], + [ + 811, + 812 + ], + [ + 820, + 821 + ], + [ + 825, + 828 + ], + [ + 829, + 830 + ], + [ + 838, + 839 + ], + [ + 843, + 844 + ], + [ + 848, + 851 + ], + [ + 852, + 853 + ] + ] + } + }, + { + "filename": "libvips/foreign/niftisave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 60, + 67 + ], + [ + 68, + 94 + ], + [ + 95, + 155 + ], + [ + 159, + 238 + ], + [ + 240, + 277 + ], + [ + 280, + 396 + ], + [ + 411, + 422 + ], + [ + 424, + 431 + ], + [ + 437, + 453 + ], + [ + 454, + 465 + ], + [ + 467, + 481 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 63, + 64 + ], + [ + 71, + 73 + ], + [ + 75, + 76 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 87, + 89 + ], + [ + 90, + 91 + ], + [ + 98, + 99 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 112, + 117 + ], + [ + 119, + 124 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 131, + 134 + ], + [ + 137, + 139 + ], + [ + 145, + 147 + ], + [ + 151, + 152 + ], + [ + 162, + 164 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 173, + 175 + ], + [ + 176, + 178 + ], + [ + 183, + 184 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 194, + 195 + ], + [ + 198, + 199 + ], + [ + 202, + 204 + ], + [ + 208, + 210 + ], + [ + 216, + 217 + ], + [ + 220, + 225 + ], + [ + 229, + 230 + ], + [ + 233, + 235 + ], + [ + 243, + 245 + ], + [ + 249, + 253 + ], + [ + 255, + 257 + ], + [ + 258, + 262 + ], + [ + 264, + 265 + ], + [ + 270, + 272 + ], + [ + 273, + 274 + ], + [ + 283, + 284 + ], + [ + 289, + 292 + ], + [ + 294, + 295 + ], + [ + 296, + 297 + ], + [ + 300, + 301 + ], + [ + 306, + 311 + ], + [ + 312, + 317 + ], + [ + 319, + 324 + ], + [ + 326, + 328 + ], + [ + 332, + 335 + ], + [ + 338, + 341 + ], + [ + 342, + 343 + ], + [ + 346, + 347 + ], + [ + 348, + 349 + ], + [ + 352, + 354 + ], + [ + 355, + 356 + ], + [ + 361, + 364 + ], + [ + 366, + 368 + ], + [ + 373, + 377 + ], + [ + 379, + 382 + ], + [ + 385, + 386 + ], + [ + 390, + 391 + ], + [ + 392, + 393 + ], + [ + 414, + 415 + ], + [ + 416, + 417 + ], + [ + 418, + 419 + ], + [ + 427, + 428 + ], + [ + 440, + 446 + ], + [ + 449, + 450 + ], + [ + 457, + 459 + ], + [ + 461, + 462 + ], + [ + 470, + 471 + ], + [ + 475, + 478 + ], + [ + 479, + 480 + ] + ] + } + }, + { + "filename": "libvips/foreign/nsgifload.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 38 + ], + [ + 74, + 93 + ], + [ + 116, + 123 + ], + [ + 142, + 250 + ], + [ + 251, + 332 + ], + [ + 337, + 346 + ], + [ + 347, + 468 + ], + [ + 470, + 504 + ], + [ + 508, + 574 + ], + [ + 577, + 640 + ], + [ + 643, + 660 + ], + [ + 667, + 697 + ], + [ + 699, + 723 + ], + [ + 725, + 748 + ], + [ + 756, + 803 + ], + [ + 804, + 825 + ], + [ + 833, + 890 + ], + [ + 920, + 936 + ], + [ + 955, + 962 + ], + [ + 963, + 978 + ], + [ + 993, + 1007 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 29 + ], + [ + 34, + 35 + ], + [ + 77, + 90 + ], + [ + 119, + 120 + ], + [ + 145, + 147 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 157, + 158 + ], + [ + 161, + 162 + ], + [ + 163, + 165 + ], + [ + 166, + 168 + ], + [ + 169, + 170 + ], + [ + 173, + 174 + ], + [ + 175, + 176 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 189, + 190 + ], + [ + 193, + 195 + ], + [ + 196, + 197 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 219 + ], + [ + 222, + 223 + ], + [ + 227, + 239 + ], + [ + 245, + 247 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 262 + ], + [ + 266, + 272 + ], + [ + 273, + 275 + ], + [ + 281, + 282 + ], + [ + 283, + 285 + ], + [ + 291, + 293 + ], + [ + 296, + 297 + ], + [ + 301, + 305 + ], + [ + 307, + 308 + ], + [ + 313, + 315 + ], + [ + 318, + 322 + ], + [ + 325, + 327 + ], + [ + 328, + 329 + ], + [ + 340, + 341 + ], + [ + 342, + 343 + ], + [ + 350, + 351 + ], + [ + 355, + 358 + ], + [ + 360, + 361 + ], + [ + 363, + 366 + ], + [ + 367, + 370 + ], + [ + 372, + 373 + ], + [ + 379, + 382 + ], + [ + 384, + 385 + ], + [ + 391, + 392 + ], + [ + 393, + 394 + ], + [ + 395, + 396 + ], + [ + 397, + 400 + ], + [ + 404, + 405 + ], + [ + 407, + 409 + ], + [ + 410, + 411 + ], + [ + 415, + 416 + ], + [ + 418, + 419 + ], + [ + 420, + 423 + ], + [ + 427, + 432 + ], + [ + 434, + 438 + ], + [ + 444, + 445 + ], + [ + 446, + 447 + ], + [ + 450, + 452 + ], + [ + 453, + 454 + ], + [ + 459, + 462 + ], + [ + 464, + 465 + ], + [ + 473, + 484 + ], + [ + 487, + 488 + ], + [ + 493, + 497 + ], + [ + 500, + 501 + ], + [ + 511, + 512 + ], + [ + 515, + 516 + ], + [ + 522, + 525 + ], + [ + 527, + 533 + ], + [ + 535, + 536 + ], + [ + 539, + 540 + ], + [ + 543, + 544 + ], + [ + 545, + 546 + ], + [ + 550, + 552 + ], + [ + 555, + 565 + ], + [ + 568, + 569 + ], + [ + 570, + 571 + ], + [ + 580, + 581 + ], + [ + 586, + 587 + ], + [ + 592, + 595 + ], + [ + 596, + 598 + ], + [ + 599, + 602 + ], + [ + 603, + 605 + ], + [ + 608, + 609 + ], + [ + 612, + 613 + ], + [ + 615, + 619 + ], + [ + 621, + 622 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 629, + 630 + ], + [ + 632, + 634 + ], + [ + 635, + 637 + ], + [ + 646, + 647 + ], + [ + 651, + 652 + ], + [ + 653, + 654 + ], + [ + 655, + 657 + ], + [ + 670, + 671 + ], + [ + 676, + 678 + ], + [ + 680, + 681 + ], + [ + 685, + 689 + ], + [ + 690, + 692 + ], + [ + 693, + 694 + ], + [ + 702, + 703 + ], + [ + 707, + 711 + ], + [ + 712, + 713 + ], + [ + 716, + 718 + ], + [ + 719, + 720 + ], + [ + 728, + 729 + ], + [ + 735, + 741 + ], + [ + 744, + 745 + ], + [ + 759, + 761 + ], + [ + 763, + 764 + ], + [ + 766, + 767 + ], + [ + 769, + 774 + ], + [ + 775, + 777 + ], + [ + 778, + 779 + ], + [ + 782, + 783 + ], + [ + 787, + 791 + ], + [ + 792, + 793 + ], + [ + 796, + 798 + ], + [ + 799, + 800 + ], + [ + 807, + 808 + ], + [ + 812, + 818 + ], + [ + 821, + 822 + ], + [ + 836, + 838 + ], + [ + 840, + 841 + ], + [ + 843, + 844 + ], + [ + 846, + 847 + ], + [ + 848, + 849 + ], + [ + 851, + 853 + ], + [ + 854, + 855 + ], + [ + 858, + 860 + ], + [ + 861, + 862 + ], + [ + 863, + 864 + ], + [ + 870, + 871 + ], + [ + 877, + 883 + ], + [ + 886, + 887 + ], + [ + 923, + 924 + ], + [ + 928, + 931 + ], + [ + 932, + 933 + ], + [ + 958, + 959 + ], + [ + 966, + 967 + ], + [ + 968, + 971 + ], + [ + 972, + 973 + ], + [ + 974, + 975 + ], + [ + 996, + 997 + ], + [ + 1001, + 1004 + ], + [ + 1005, + 1006 + ] + ] + } + }, + { + "filename": "libvips/foreign/openexr2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 25, + 37 + ], + [ + 43, + 71 + ], + [ + 107, + 276 + ], + [ + 293, + 326 + ], + [ + 328, + 374 + ], + [ + 375, + 401 + ], + [ + 406, + 451 + ] + ], + "lines_added": [ + [ + 28, + 30 + ], + [ + 33, + 34 + ], + [ + 46, + 47 + ], + [ + 48, + 52 + ], + [ + 53, + 62 + ], + [ + 67, + 68 + ], + [ + 110, + 111 + ], + [ + 114, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 129, + 130 + ], + [ + 131, + 133 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 152, + 155 + ], + [ + 158, + 161 + ], + [ + 164, + 165 + ], + [ + 168, + 170 + ], + [ + 171, + 172 + ], + [ + 176, + 178 + ], + [ + 179, + 180 + ], + [ + 182, + 186 + ], + [ + 188, + 189 + ], + [ + 190, + 191 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 205, + 207 + ], + [ + 208, + 209 + ], + [ + 210, + 211 + ], + [ + 216, + 217 + ], + [ + 220, + 221 + ], + [ + 222, + 224 + ], + [ + 226, + 234 + ], + [ + 239, + 240 + ], + [ + 243, + 244 + ], + [ + 247, + 251 + ], + [ + 252, + 253 + ], + [ + 258, + 259 + ], + [ + 263, + 266 + ], + [ + 267, + 268 + ], + [ + 271, + 273 + ], + [ + 296, + 298 + ], + [ + 302, + 308 + ], + [ + 309, + 310 + ], + [ + 313, + 315 + ], + [ + 317, + 319 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 331, + 332 + ], + [ + 335, + 336 + ], + [ + 339, + 341 + ], + [ + 343, + 345 + ], + [ + 348, + 350 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 359, + 360 + ], + [ + 363, + 364 + ], + [ + 367, + 369 + ], + [ + 370, + 371 + ], + [ + 378, + 396 + ], + [ + 397, + 398 + ], + [ + 409, + 412 + ], + [ + 413, + 414 + ], + [ + 415, + 416 + ], + [ + 418, + 421 + ], + [ + 422, + 423 + ], + [ + 424, + 426 + ], + [ + 427, + 428 + ], + [ + 430, + 432 + ], + [ + 436, + 437 + ], + [ + 439, + 442 + ], + [ + 444, + 445 + ], + [ + 447, + 448 + ] + ] + } + }, + { + "filename": "libvips/foreign/openexrload.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 57, + 125 + ], + [ + 126, + 133 + ], + [ + 139, + 161 + ], + [ + 166, + 173 + ], + [ + 180, + 194 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 61 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 82, + 83 + ], + [ + 86, + 88 + ], + [ + 91, + 92 + ], + [ + 95, + 97 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 108, + 110 + ], + [ + 111, + 112 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 129, + 130 + ], + [ + 142, + 143 + ], + [ + 148, + 154 + ], + [ + 157, + 158 + ], + [ + 169, + 170 + ], + [ + 183, + 184 + ], + [ + 188, + 191 + ], + [ + 192, + 193 + ] + ] + } + }, + { + "filename": "libvips/foreign/openslideload.c", + "line_filter": { + "diff_chunks": [ + [ + 44, + 51 + ], + [ + 59, + 81 + ], + [ + 114, + 121 + ], + [ + 130, + 274 + ], + [ + 276, + 286 + ], + [ + 291, + 312 + ], + [ + 323, + 525 + ], + [ + 532, + 578 + ], + [ + 583, + 656 + ], + [ + 658, + 803 + ], + [ + 818, + 825 + ], + [ + 826, + 965 + ], + [ + 967, + 974 + ], + [ + 979, + 1039 + ], + [ + 1041, + 1091 + ], + [ + 1093, + 1116 + ], + [ + 1124, + 1172 + ], + [ + 1173, + 1196 + ] + ], + "lines_added": [ + [ + 47, + 48 + ], + [ + 62, + 63 + ], + [ + 64, + 68 + ], + [ + 69, + 73 + ], + [ + 74, + 78 + ], + [ + 117, + 118 + ], + [ + 133, + 134 + ], + [ + 139, + 140 + ], + [ + 145, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 156, + 157 + ], + [ + 158, + 159 + ], + [ + 165, + 167 + ], + [ + 170, + 172 + ], + [ + 174, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 184, + 185 + ], + [ + 186, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 201 + ], + [ + 202, + 204 + ], + [ + 205, + 206 + ], + [ + 209, + 210 + ], + [ + 212, + 215 + ], + [ + 218, + 222 + ], + [ + 227, + 233 + ], + [ + 235, + 236 + ], + [ + 239, + 242 + ], + [ + 245, + 251 + ], + [ + 253, + 259 + ], + [ + 261, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 271 + ], + [ + 279, + 280 + ], + [ + 282, + 283 + ], + [ + 294, + 295 + ], + [ + 296, + 297 + ], + [ + 300, + 302 + ], + [ + 304, + 305 + ], + [ + 306, + 309 + ], + [ + 326, + 327 + ], + [ + 330, + 331 + ], + [ + 333, + 337 + ], + [ + 341, + 342 + ], + [ + 343, + 405 + ], + [ + 408, + 409 + ], + [ + 410, + 411 + ], + [ + 412, + 415 + ], + [ + 416, + 417 + ], + [ + 418, + 421 + ], + [ + 422, + 425 + ], + [ + 426, + 427 + ], + [ + 429, + 430 + ], + [ + 435, + 436 + ], + [ + 437, + 439 + ], + [ + 440, + 441 + ], + [ + 444, + 445 + ], + [ + 449, + 450 + ], + [ + 454, + 459 + ], + [ + 461, + 466 + ], + [ + 468, + 473 + ], + [ + 475, + 488 + ], + [ + 492, + 494 + ], + [ + 495, + 500 + ], + [ + 504, + 517 + ], + [ + 518, + 522 + ], + [ + 535, + 537 + ], + [ + 540, + 541 + ], + [ + 543, + 544 + ], + [ + 550, + 553 + ], + [ + 556, + 566 + ], + [ + 567, + 572 + ], + [ + 574, + 575 + ], + [ + 586, + 588 + ], + [ + 589, + 591 + ], + [ + 594, + 596 + ], + [ + 597, + 601 + ], + [ + 604, + 608 + ], + [ + 609, + 612 + ], + [ + 613, + 614 + ], + [ + 617, + 620 + ], + [ + 623, + 627 + ], + [ + 628, + 629 + ], + [ + 635, + 636 + ], + [ + 639, + 640 + ], + [ + 641, + 644 + ], + [ + 645, + 646 + ], + [ + 649, + 651 + ], + [ + 652, + 653 + ], + [ + 661, + 663 + ], + [ + 667, + 689 + ], + [ + 690, + 692 + ], + [ + 693, + 694 + ], + [ + 696, + 697 + ], + [ + 702, + 707 + ], + [ + 709, + 714 + ], + [ + 715, + 716 + ], + [ + 719, + 720 + ], + [ + 721, + 722 + ], + [ + 723, + 724 + ], + [ + 725, + 726 + ], + [ + 729, + 730 + ], + [ + 731, + 732 + ], + [ + 737, + 739 + ], + [ + 740, + 743 + ], + [ + 745, + 746 + ], + [ + 747, + 753 + ], + [ + 754, + 755 + ], + [ + 758, + 762 + ], + [ + 763, + 769 + ], + [ + 770, + 771 + ], + [ + 772, + 773 + ], + [ + 776, + 778 + ], + [ + 782, + 784 + ], + [ + 785, + 788 + ], + [ + 789, + 792 + ], + [ + 793, + 798 + ], + [ + 799, + 800 + ], + [ + 821, + 822 + ], + [ + 829, + 831 + ], + [ + 837, + 839 + ], + [ + 841, + 842 + ], + [ + 843, + 844 + ], + [ + 846, + 847 + ], + [ + 848, + 849 + ], + [ + 852, + 853 + ], + [ + 854, + 856 + ], + [ + 861, + 864 + ], + [ + 867, + 872 + ], + [ + 877, + 879 + ], + [ + 880, + 881 + ], + [ + 884, + 885 + ], + [ + 889, + 890 + ], + [ + 893, + 894 + ], + [ + 899, + 900 + ], + [ + 902, + 903 + ], + [ + 906, + 907 + ], + [ + 911, + 915 + ], + [ + 916, + 917 + ], + [ + 920, + 921 + ], + [ + 924, + 929 + ], + [ + 930, + 931 + ], + [ + 932, + 933 + ], + [ + 936, + 937 + ], + [ + 940, + 946 + ], + [ + 948, + 951 + ], + [ + 953, + 954 + ], + [ + 957, + 958 + ], + [ + 959, + 960 + ], + [ + 961, + 962 + ], + [ + 970, + 971 + ], + [ + 982, + 983 + ], + [ + 987, + 988 + ], + [ + 992, + 993 + ], + [ + 998, + 1001 + ], + [ + 1002, + 1004 + ], + [ + 1005, + 1008 + ], + [ + 1009, + 1015 + ], + [ + 1016, + 1018 + ], + [ + 1019, + 1022 + ], + [ + 1023, + 1025 + ], + [ + 1026, + 1032 + ], + [ + 1035, + 1036 + ], + [ + 1044, + 1045 + ], + [ + 1050, + 1052 + ], + [ + 1054, + 1055 + ], + [ + 1056, + 1057 + ], + [ + 1058, + 1059 + ], + [ + 1061, + 1065 + ], + [ + 1066, + 1068 + ], + [ + 1069, + 1070 + ], + [ + 1073, + 1080 + ], + [ + 1084, + 1086 + ], + [ + 1087, + 1088 + ], + [ + 1096, + 1097 + ], + [ + 1103, + 1109 + ], + [ + 1112, + 1113 + ], + [ + 1127, + 1130 + ], + [ + 1132, + 1133 + ], + [ + 1134, + 1135 + ], + [ + 1136, + 1137 + ], + [ + 1139, + 1140 + ], + [ + 1141, + 1142 + ], + [ + 1144, + 1148 + ], + [ + 1149, + 1150 + ], + [ + 1153, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1159, + 1162 + ], + [ + 1165, + 1167 + ], + [ + 1168, + 1169 + ], + [ + 1176, + 1177 + ], + [ + 1179, + 1180 + ], + [ + 1182, + 1188 + ], + [ + 1191, + 1193 + ] + ] + } + }, + { + "filename": "libvips/foreign/pdfiumload.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 52 + ], + [ + 53, + 60 + ], + [ + 67, + 86 + ], + [ + 121, + 128 + ], + [ + 144, + 151 + ], + [ + 162, + 170 + ], + [ + 178, + 219 + ], + [ + 221, + 365 + ], + [ + 370, + 501 + ], + [ + 504, + 547 + ], + [ + 548, + 600 + ], + [ + 601, + 742 + ], + [ + 743, + 768 + ], + [ + 770, + 824 + ], + [ + 826, + 833 + ], + [ + 834, + 850 + ], + [ + 858, + 887 + ], + [ + 888, + 909 + ], + [ + 915, + 980 + ] + ], + "lines_added": [ + [ + 23, + 39 + ], + [ + 44, + 45 + ], + [ + 48, + 49 + ], + [ + 56, + 57 + ], + [ + 70, + 80 + ], + [ + 82, + 83 + ], + [ + 124, + 125 + ], + [ + 147, + 148 + ], + [ + 165, + 167 + ], + [ + 181, + 182 + ], + [ + 185, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 200 + ], + [ + 201, + 202 + ], + [ + 205, + 206 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 232, + 234 + ], + [ + 239, + 242 + ], + [ + 243, + 245 + ], + [ + 246, + 247 + ], + [ + 249, + 252 + ], + [ + 256, + 257 + ], + [ + 260, + 261 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 276, + 285 + ], + [ + 290, + 291 + ], + [ + 292, + 295 + ], + [ + 296, + 301 + ], + [ + 303, + 304 + ], + [ + 306, + 308 + ], + [ + 309, + 310 + ], + [ + 313, + 314 + ], + [ + 318, + 319 + ], + [ + 322, + 323 + ], + [ + 324, + 325 + ], + [ + 328, + 329 + ], + [ + 330, + 332 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 342, + 344 + ], + [ + 345, + 348 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 360, + 362 + ], + [ + 373, + 374 + ], + [ + 376, + 377 + ], + [ + 382, + 383 + ], + [ + 387, + 389 + ], + [ + 392, + 394 + ], + [ + 395, + 396 + ], + [ + 397, + 399 + ], + [ + 404, + 406 + ], + [ + 410, + 415 + ], + [ + 419, + 420 + ], + [ + 425, + 427 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 434, + 435 + ], + [ + 436, + 437 + ], + [ + 443, + 444 + ], + [ + 446, + 449 + ], + [ + 452, + 453 + ], + [ + 455, + 456 + ], + [ + 457, + 460 + ], + [ + 464, + 466 + ], + [ + 472, + 475 + ], + [ + 481, + 485 + ], + [ + 488, + 489 + ], + [ + 491, + 495 + ], + [ + 497, + 498 + ], + [ + 507, + 509 + ], + [ + 514, + 517 + ], + [ + 518, + 519 + ], + [ + 522, + 530 + ], + [ + 533, + 534 + ], + [ + 535, + 536 + ], + [ + 539, + 541 + ], + [ + 543, + 544 + ], + [ + 551, + 553 + ], + [ + 556, + 557 + ], + [ + 559, + 561 + ], + [ + 563, + 565 + ], + [ + 568, + 569 + ], + [ + 570, + 572 + ], + [ + 573, + 574 + ], + [ + 577, + 580 + ], + [ + 583, + 584 + ], + [ + 586, + 588 + ], + [ + 590, + 591 + ], + [ + 592, + 593 + ], + [ + 594, + 595 + ], + [ + 596, + 597 + ], + [ + 604, + 608 + ], + [ + 609, + 610 + ], + [ + 613, + 614 + ], + [ + 616, + 618 + ], + [ + 620, + 621 + ], + [ + 625, + 626 + ], + [ + 629, + 631 + ], + [ + 632, + 636 + ], + [ + 638, + 639 + ], + [ + 640, + 650 + ], + [ + 653, + 654 + ], + [ + 660, + 661 + ], + [ + 664, + 665 + ], + [ + 668, + 669 + ], + [ + 672, + 673 + ], + [ + 679, + 680 + ], + [ + 682, + 683 + ], + [ + 688, + 691 + ], + [ + 692, + 694 + ], + [ + 695, + 698 + ], + [ + 699, + 701 + ], + [ + 702, + 705 + ], + [ + 706, + 708 + ], + [ + 709, + 712 + ], + [ + 713, + 715 + ], + [ + 716, + 719 + ], + [ + 720, + 722 + ], + [ + 723, + 726 + ], + [ + 727, + 729 + ], + [ + 732, + 733 + ], + [ + 738, + 739 + ], + [ + 746, + 747 + ], + [ + 752, + 754 + ], + [ + 756, + 757 + ], + [ + 760, + 761 + ], + [ + 762, + 765 + ], + [ + 773, + 774 + ], + [ + 779, + 780 + ], + [ + 782, + 785 + ], + [ + 786, + 787 + ], + [ + 790, + 791 + ], + [ + 794, + 796 + ], + [ + 798, + 800 + ], + [ + 801, + 802 + ], + [ + 805, + 806 + ], + [ + 809, + 812 + ], + [ + 813, + 814 + ], + [ + 817, + 819 + ], + [ + 820, + 821 + ], + [ + 829, + 830 + ], + [ + 837, + 843 + ], + [ + 846, + 847 + ], + [ + 861, + 863 + ], + [ + 865, + 866 + ], + [ + 870, + 875 + ], + [ + 876, + 877 + ], + [ + 880, + 882 + ], + [ + 883, + 884 + ], + [ + 891, + 892 + ], + [ + 896, + 902 + ], + [ + 905, + 906 + ], + [ + 918, + 920 + ], + [ + 922, + 923 + ], + [ + 927, + 928 + ], + [ + 929, + 930 + ], + [ + 932, + 933 + ], + [ + 936, + 937 + ], + [ + 940, + 942 + ], + [ + 944, + 945 + ], + [ + 948, + 950 + ], + [ + 951, + 952 + ], + [ + 953, + 954 + ], + [ + 960, + 961 + ], + [ + 967, + 973 + ], + [ + 976, + 977 + ] + ] + } + }, + { + "filename": "libvips/foreign/pforeign.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 37, + 56 + ], + [ + 62, + 128 + ], + [ + 130, + 173 + ], + [ + 180, + 216 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 40, + 43 + ], + [ + 49, + 50 + ], + [ + 51, + 53 + ], + [ + 65, + 66 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 78 + ], + [ + 81, + 84 + ], + [ + 87, + 94 + ], + [ + 97, + 101 + ], + [ + 104, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 114 + ], + [ + 115, + 119 + ], + [ + 122, + 125 + ], + [ + 133, + 138 + ], + [ + 139, + 140 + ], + [ + 145, + 147 + ], + [ + 150, + 163 + ], + [ + 165, + 166 + ], + [ + 169, + 170 + ], + [ + 183, + 184 + ], + [ + 185, + 189 + ], + [ + 192, + 194 + ], + [ + 195, + 198 + ], + [ + 202, + 203 + ], + [ + 205, + 206 + ], + [ + 208, + 210 + ], + [ + 212, + 213 + ] + ] + } + }, + { + "filename": "libvips/foreign/pngload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 69, + 151 + ], + [ + 154, + 182 + ], + [ + 190, + 251 + ], + [ + 253, + 302 + ], + [ + 304, + 327 + ], + [ + 335, + 380 + ], + [ + 381, + 402 + ], + [ + 421, + 429 + ], + [ + 430, + 446 + ], + [ + 456, + 471 + ], + [ + 472, + 487 + ], + [ + 494, + 515 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 72, + 74 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 91, + 92 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 108, + 109 + ], + [ + 113, + 117 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 126, + 128 + ], + [ + 129, + 130 + ], + [ + 133, + 134 + ], + [ + 137, + 140 + ], + [ + 141, + 142 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 157, + 158 + ], + [ + 163, + 164 + ], + [ + 169, + 172 + ], + [ + 173, + 175 + ], + [ + 178, + 179 + ], + [ + 193, + 195 + ], + [ + 197, + 198 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 209 + ], + [ + 210, + 211 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 220, + 221 + ], + [ + 222, + 223 + ], + [ + 224, + 225 + ], + [ + 231, + 232 + ], + [ + 238, + 244 + ], + [ + 247, + 248 + ], + [ + 256, + 257 + ], + [ + 262, + 264 + ], + [ + 266, + 267 + ], + [ + 271, + 274 + ], + [ + 275, + 277 + ], + [ + 278, + 279 + ], + [ + 282, + 283 + ], + [ + 287, + 291 + ], + [ + 292, + 293 + ], + [ + 296, + 297 + ], + [ + 298, + 299 + ], + [ + 307, + 308 + ], + [ + 314, + 320 + ], + [ + 323, + 324 + ], + [ + 338, + 340 + ], + [ + 342, + 343 + ], + [ + 347, + 352 + ], + [ + 353, + 355 + ], + [ + 356, + 357 + ], + [ + 360, + 361 + ], + [ + 365, + 369 + ], + [ + 370, + 371 + ], + [ + 374, + 375 + ], + [ + 376, + 377 + ], + [ + 384, + 385 + ], + [ + 389, + 395 + ], + [ + 398, + 399 + ], + [ + 424, + 426 + ], + [ + 433, + 434 + ], + [ + 438, + 441 + ], + [ + 442, + 443 + ], + [ + 459, + 461 + ], + [ + 467, + 468 + ], + [ + 475, + 476 + ], + [ + 477, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 484 + ], + [ + 497, + 498 + ], + [ + 504, + 505 + ], + [ + 509, + 512 + ], + [ + 513, + 514 + ] + ] + } + }, + { + "filename": "libvips/foreign/pngsave.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 42 + ], + [ + 83, + 170 + ], + [ + 188, + 197 + ], + [ + 200, + 207 + ], + [ + 208, + 288 + ], + [ + 298, + 397 + ], + [ + 402, + 455 + ], + [ + 456, + 464 + ], + [ + 467, + 474 + ], + [ + 476, + 492 + ], + [ + 497, + 504 + ], + [ + 515, + 536 + ], + [ + 541, + 553 + ], + [ + 557, + 593 + ], + [ + 597, + 604 + ], + [ + 609, + 623 + ] + ], + "lines_added": [ + [ + 17, + 33 + ], + [ + 38, + 39 + ], + [ + 86, + 88 + ], + [ + 90, + 91 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 107, + 109 + ], + [ + 111, + 112 + ], + [ + 115, + 121 + ], + [ + 125, + 127 + ], + [ + 130, + 131 + ], + [ + 133, + 136 + ], + [ + 137, + 138 + ], + [ + 144, + 146 + ], + [ + 150, + 151 + ], + [ + 153, + 159 + ], + [ + 161, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 203, + 204 + ], + [ + 211, + 214 + ], + [ + 215, + 217 + ], + [ + 218, + 221 + ], + [ + 222, + 224 + ], + [ + 225, + 228 + ], + [ + 229, + 231 + ], + [ + 232, + 235 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 240, + 243 + ], + [ + 244, + 246 + ], + [ + 247, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 257 + ], + [ + 258, + 260 + ], + [ + 261, + 264 + ], + [ + 265, + 267 + ], + [ + 268, + 271 + ], + [ + 272, + 274 + ], + [ + 275, + 278 + ], + [ + 279, + 281 + ], + [ + 284, + 285 + ], + [ + 301, + 303 + ], + [ + 305, + 306 + ], + [ + 311, + 312 + ], + [ + 313, + 315 + ], + [ + 316, + 317 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 329, + 330 + ], + [ + 332, + 338 + ], + [ + 341, + 342 + ], + [ + 348, + 349 + ], + [ + 353, + 355 + ], + [ + 357, + 358 + ], + [ + 362, + 364 + ], + [ + 365, + 367 + ], + [ + 368, + 369 + ], + [ + 372, + 373 + ], + [ + 374, + 375 + ], + [ + 381, + 382 + ], + [ + 384, + 390 + ], + [ + 393, + 394 + ], + [ + 405, + 407 + ], + [ + 409, + 410 + ], + [ + 416, + 418 + ], + [ + 419, + 421 + ], + [ + 422, + 425 + ], + [ + 426, + 427 + ], + [ + 430, + 431 + ], + [ + 432, + 433 + ], + [ + 439, + 440 + ], + [ + 442, + 448 + ], + [ + 451, + 452 + ], + [ + 459, + 461 + ], + [ + 470, + 471 + ], + [ + 479, + 480 + ], + [ + 485, + 487 + ], + [ + 488, + 489 + ], + [ + 500, + 501 + ], + [ + 518, + 519 + ], + [ + 523, + 526 + ], + [ + 527, + 528 + ], + [ + 532, + 533 + ], + [ + 544, + 545 + ], + [ + 549, + 550 + ], + [ + 560, + 561 + ], + [ + 566, + 567 + ], + [ + 568, + 571 + ], + [ + 572, + 575 + ], + [ + 578, + 579 + ], + [ + 581, + 582 + ], + [ + 584, + 585 + ], + [ + 589, + 590 + ], + [ + 600, + 601 + ], + [ + 612, + 613 + ], + [ + 617, + 620 + ], + [ + 621, + 622 + ] + ] + } + }, + { + "filename": "libvips/foreign/popplerload.c", + "line_filter": { + "diff_chunks": [ + [ + 11, + 18 + ], + [ + 26, + 54 + ], + [ + 76, + 83 + ], + [ + 85, + 104 + ], + [ + 114, + 121 + ], + [ + 144, + 151 + ], + [ + 165, + 257 + ], + [ + 263, + 295 + ], + [ + 296, + 369 + ], + [ + 372, + 420 + ], + [ + 421, + 472 + ], + [ + 473, + 527 + ], + [ + 528, + 598 + ], + [ + 599, + 606 + ], + [ + 607, + 637 + ], + [ + 639, + 708 + ], + [ + 711, + 718 + ], + [ + 719, + 735 + ], + [ + 743, + 772 + ], + [ + 773, + 794 + ], + [ + 800, + 865 + ] + ], + "lines_added": [ + [ + 14, + 15 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 79, + 80 + ], + [ + 88, + 101 + ], + [ + 117, + 118 + ], + [ + 147, + 148 + ], + [ + 168, + 170 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 176, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 191, + 193 + ], + [ + 196, + 202 + ], + [ + 204, + 206 + ], + [ + 207, + 208 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 230 + ], + [ + 231, + 232 + ], + [ + 235, + 236 + ], + [ + 238, + 243 + ], + [ + 247, + 248 + ], + [ + 253, + 254 + ], + [ + 266, + 267 + ], + [ + 269, + 270 + ], + [ + 275, + 276 + ], + [ + 280, + 282 + ], + [ + 283, + 285 + ], + [ + 289, + 292 + ], + [ + 299, + 301 + ], + [ + 302, + 303 + ], + [ + 304, + 308 + ], + [ + 309, + 310 + ], + [ + 313, + 314 + ], + [ + 315, + 317 + ], + [ + 322, + 323 + ], + [ + 325, + 326 + ], + [ + 329, + 330 + ], + [ + 332, + 333 + ], + [ + 334, + 337 + ], + [ + 341, + 343 + ], + [ + 349, + 350 + ], + [ + 353, + 356 + ], + [ + 362, + 364 + ], + [ + 365, + 366 + ], + [ + 375, + 377 + ], + [ + 382, + 385 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 390, + 395 + ], + [ + 398, + 399 + ], + [ + 400, + 401 + ], + [ + 402, + 403 + ], + [ + 406, + 407 + ], + [ + 408, + 409 + ], + [ + 412, + 414 + ], + [ + 415, + 417 + ], + [ + 424, + 426 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 433, + 434 + ], + [ + 436, + 438 + ], + [ + 440, + 442 + ], + [ + 446, + 447 + ], + [ + 448, + 455 + ], + [ + 456, + 460 + ], + [ + 461, + 462 + ], + [ + 464, + 467 + ], + [ + 468, + 469 + ], + [ + 476, + 480 + ], + [ + 481, + 482 + ], + [ + 485, + 486 + ], + [ + 487, + 490 + ], + [ + 492, + 493 + ], + [ + 497, + 498 + ], + [ + 501, + 503 + ], + [ + 504, + 508 + ], + [ + 511, + 514 + ], + [ + 515, + 516 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 523, + 524 + ], + [ + 531, + 532 + ], + [ + 538, + 539 + ], + [ + 544, + 547 + ], + [ + 548, + 550 + ], + [ + 551, + 554 + ], + [ + 555, + 557 + ], + [ + 558, + 561 + ], + [ + 562, + 564 + ], + [ + 565, + 568 + ], + [ + 569, + 571 + ], + [ + 572, + 575 + ], + [ + 576, + 578 + ], + [ + 579, + 582 + ], + [ + 583, + 585 + ], + [ + 588, + 589 + ], + [ + 594, + 595 + ], + [ + 602, + 603 + ], + [ + 610, + 612 + ], + [ + 614, + 615 + ], + [ + 616, + 617 + ], + [ + 619, + 620 + ], + [ + 621, + 622 + ], + [ + 625, + 626 + ], + [ + 629, + 630 + ], + [ + 631, + 634 + ], + [ + 642, + 643 + ], + [ + 644, + 645 + ], + [ + 648, + 649 + ], + [ + 651, + 652 + ], + [ + 657, + 662 + ], + [ + 663, + 664 + ], + [ + 665, + 668 + ], + [ + 670, + 671 + ], + [ + 674, + 675 + ], + [ + 678, + 680 + ], + [ + 682, + 684 + ], + [ + 685, + 686 + ], + [ + 689, + 690 + ], + [ + 693, + 696 + ], + [ + 697, + 698 + ], + [ + 701, + 703 + ], + [ + 704, + 705 + ], + [ + 714, + 715 + ], + [ + 722, + 728 + ], + [ + 731, + 732 + ], + [ + 746, + 748 + ], + [ + 750, + 751 + ], + [ + 752, + 753 + ], + [ + 755, + 760 + ], + [ + 761, + 762 + ], + [ + 765, + 767 + ], + [ + 768, + 769 + ], + [ + 776, + 777 + ], + [ + 781, + 787 + ], + [ + 790, + 791 + ], + [ + 803, + 805 + ], + [ + 807, + 808 + ], + [ + 809, + 810 + ], + [ + 812, + 813 + ], + [ + 814, + 815 + ], + [ + 817, + 818 + ], + [ + 821, + 822 + ], + [ + 825, + 827 + ], + [ + 829, + 830 + ], + [ + 833, + 835 + ], + [ + 836, + 837 + ], + [ + 838, + 839 + ], + [ + 845, + 846 + ], + [ + 852, + 858 + ], + [ + 861, + 862 + ] + ] + } + }, + { + "filename": "libvips/foreign/ppmload.c", + "line_filter": { + "diff_chunks": [ + [ + 36, + 43 + ], + [ + 49, + 77 + ], + [ + 112, + 122 + ], + [ + 123, + 149 + ], + [ + 151, + 237 + ], + [ + 247, + 267 + ], + [ + 273, + 308 + ], + [ + 309, + 325 + ], + [ + 329, + 337 + ], + [ + 344, + 388 + ], + [ + 393, + 471 + ], + [ + 472, + 528 + ], + [ + 529, + 579 + ], + [ + 580, + 625 + ], + [ + 631, + 743 + ], + [ + 745, + 752 + ], + [ + 761, + 771 + ], + [ + 778, + 821 + ], + [ + 822, + 843 + ], + [ + 849, + 881 + ], + [ + 887, + 903 + ], + [ + 908, + 918 + ], + [ + 919, + 935 + ], + [ + 945, + 966 + ] + ], + "lines_added": [ + [ + 39, + 40 + ], + [ + 52, + 53 + ], + [ + 54, + 58 + ], + [ + 59, + 68 + ], + [ + 73, + 74 + ], + [ + 115, + 117 + ], + [ + 118, + 119 + ], + [ + 126, + 128 + ], + [ + 132, + 140 + ], + [ + 144, + 146 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 161, + 164 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 174, + 177 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 184, + 185 + ], + [ + 188, + 191 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 205, + 206 + ], + [ + 208, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 219, + 221 + ], + [ + 222, + 224 + ], + [ + 225, + 226 + ], + [ + 231, + 232 + ], + [ + 233, + 234 + ], + [ + 250, + 252 + ], + [ + 255, + 257 + ], + [ + 258, + 260 + ], + [ + 261, + 264 + ], + [ + 276, + 279 + ], + [ + 282, + 287 + ], + [ + 293, + 295 + ], + [ + 299, + 300 + ], + [ + 302, + 303 + ], + [ + 304, + 305 + ], + [ + 312, + 317 + ], + [ + 321, + 322 + ], + [ + 332, + 334 + ], + [ + 347, + 349 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 363, + 378 + ], + [ + 380, + 381 + ], + [ + 384, + 385 + ], + [ + 396, + 402 + ], + [ + 406, + 407 + ], + [ + 410, + 412 + ], + [ + 415, + 419 + ], + [ + 420, + 422 + ], + [ + 423, + 424 + ], + [ + 426, + 428 + ], + [ + 432, + 433 + ], + [ + 434, + 437 + ], + [ + 438, + 439 + ], + [ + 440, + 441 + ], + [ + 443, + 445 + ], + [ + 449, + 450 + ], + [ + 453, + 456 + ], + [ + 457, + 458 + ], + [ + 459, + 460 + ], + [ + 461, + 462 + ], + [ + 467, + 468 + ], + [ + 475, + 476 + ], + [ + 478, + 484 + ], + [ + 485, + 486 + ], + [ + 487, + 490 + ], + [ + 491, + 492 + ], + [ + 493, + 494 + ], + [ + 497, + 499 + ], + [ + 500, + 501 + ], + [ + 502, + 503 + ], + [ + 504, + 505 + ], + [ + 508, + 510 + ], + [ + 514, + 515 + ], + [ + 517, + 525 + ], + [ + 532, + 533 + ], + [ + 536, + 538 + ], + [ + 539, + 540 + ], + [ + 545, + 547 + ], + [ + 548, + 549 + ], + [ + 551, + 553 + ], + [ + 554, + 555 + ], + [ + 561, + 562 + ], + [ + 565, + 567 + ], + [ + 568, + 569 + ], + [ + 574, + 576 + ], + [ + 583, + 586 + ], + [ + 587, + 588 + ], + [ + 591, + 592 + ], + [ + 595, + 597 + ], + [ + 598, + 599 + ], + [ + 605, + 607 + ], + [ + 608, + 609 + ], + [ + 611, + 615 + ], + [ + 616, + 617 + ], + [ + 620, + 622 + ], + [ + 634, + 635 + ], + [ + 638, + 639 + ], + [ + 640, + 642 + ], + [ + 648, + 649 + ], + [ + 650, + 651 + ], + [ + 655, + 656 + ], + [ + 658, + 659 + ], + [ + 660, + 661 + ], + [ + 662, + 663 + ], + [ + 667, + 668 + ], + [ + 669, + 670 + ], + [ + 676, + 677 + ], + [ + 682, + 687 + ], + [ + 688, + 689 + ], + [ + 692, + 693 + ], + [ + 695, + 697 + ], + [ + 698, + 701 + ], + [ + 704, + 709 + ], + [ + 711, + 713 + ], + [ + 716, + 718 + ], + [ + 722, + 723 + ], + [ + 724, + 727 + ], + [ + 728, + 730 + ], + [ + 731, + 732 + ], + [ + 735, + 736 + ], + [ + 737, + 738 + ], + [ + 739, + 740 + ], + [ + 748, + 749 + ], + [ + 767, + 768 + ], + [ + 781, + 783 + ], + [ + 785, + 786 + ], + [ + 790, + 794 + ], + [ + 795, + 796 + ], + [ + 799, + 800 + ], + [ + 804, + 807 + ], + [ + 808, + 810 + ], + [ + 811, + 812 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 825, + 826 + ], + [ + 830, + 836 + ], + [ + 839, + 840 + ], + [ + 852, + 854 + ], + [ + 856, + 857 + ], + [ + 861, + 862 + ], + [ + 863, + 864 + ], + [ + 866, + 868 + ], + [ + 869, + 870 + ], + [ + 873, + 874 + ], + [ + 875, + 876 + ], + [ + 877, + 878 + ], + [ + 890, + 896 + ], + [ + 899, + 900 + ], + [ + 911, + 912 + ], + [ + 914, + 915 + ], + [ + 922, + 923 + ], + [ + 927, + 930 + ], + [ + 931, + 932 + ], + [ + 948, + 949 + ], + [ + 955, + 956 + ], + [ + 960, + 963 + ], + [ + 964, + 965 + ] + ] + } + }, + { + "filename": "libvips/foreign/ppmsave.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 48 + ], + [ + 68, + 75 + ], + [ + 87, + 129 + ], + [ + 130, + 171 + ], + [ + 172, + 186 + ], + [ + 188, + 225 + ], + [ + 226, + 234 + ], + [ + 241, + 263 + ], + [ + 273, + 427 + ], + [ + 442, + 451 + ], + [ + 453, + 497 + ], + [ + 498, + 538 + ], + [ + 539, + 560 + ], + [ + 565, + 596 + ], + [ + 601, + 636 + ], + [ + 639, + 646 + ], + [ + 649, + 668 + ], + [ + 671, + 678 + ], + [ + 681, + 700 + ], + [ + 703, + 710 + ], + [ + 713, + 732 + ], + [ + 735, + 742 + ], + [ + 746, + 753 + ], + [ + 757, + 772 + ], + [ + 776, + 797 + ], + [ + 807, + 821 + ] + ], + "lines_added": [ + [ + 23, + 39 + ], + [ + 44, + 45 + ], + [ + 71, + 72 + ], + [ + 90, + 92 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 106 + ], + [ + 111, + 113 + ], + [ + 114, + 116 + ], + [ + 119, + 121 + ], + [ + 124, + 126 + ], + [ + 133, + 135 + ], + [ + 136, + 137 + ], + [ + 140, + 142 + ], + [ + 145, + 147 + ], + [ + 148, + 150 + ], + [ + 151, + 152 + ], + [ + 155, + 157 + ], + [ + 158, + 161 + ], + [ + 162, + 163 + ], + [ + 166, + 168 + ], + [ + 175, + 177 + ], + [ + 180, + 183 + ], + [ + 191, + 194 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 206, + 208 + ], + [ + 209, + 211 + ], + [ + 213, + 214 + ], + [ + 217, + 218 + ], + [ + 221, + 222 + ], + [ + 229, + 231 + ], + [ + 244, + 245 + ], + [ + 246, + 247 + ], + [ + 252, + 253 + ], + [ + 259, + 260 + ], + [ + 276, + 278 + ], + [ + 280, + 284 + ], + [ + 287, + 288 + ], + [ + 289, + 290 + ], + [ + 292, + 297 + ], + [ + 298, + 302 + ], + [ + 305, + 306 + ], + [ + 307, + 314 + ], + [ + 317, + 319 + ], + [ + 320, + 322 + ], + [ + 323, + 326 + ], + [ + 327, + 329 + ], + [ + 330, + 333 + ], + [ + 334, + 336 + ], + [ + 337, + 339 + ], + [ + 340, + 342 + ], + [ + 346, + 348 + ], + [ + 349, + 352 + ], + [ + 353, + 355 + ], + [ + 356, + 358 + ], + [ + 359, + 361 + ], + [ + 364, + 366 + ], + [ + 369, + 371 + ], + [ + 373, + 374 + ], + [ + 378, + 381 + ], + [ + 383, + 384 + ], + [ + 387, + 391 + ], + [ + 396, + 398 + ], + [ + 399, + 400 + ], + [ + 403, + 404 + ], + [ + 405, + 406 + ], + [ + 408, + 410 + ], + [ + 414, + 415 + ], + [ + 417, + 419 + ], + [ + 420, + 422 + ], + [ + 423, + 424 + ], + [ + 445, + 446 + ], + [ + 447, + 448 + ], + [ + 456, + 457 + ], + [ + 462, + 465 + ], + [ + 466, + 469 + ], + [ + 470, + 473 + ], + [ + 474, + 476 + ], + [ + 477, + 480 + ], + [ + 481, + 483 + ], + [ + 484, + 487 + ], + [ + 488, + 490 + ], + [ + 493, + 494 + ], + [ + 501, + 502 + ], + [ + 506, + 508 + ], + [ + 510, + 511 + ], + [ + 515, + 518 + ], + [ + 519, + 520 + ], + [ + 521, + 522 + ], + [ + 523, + 524 + ], + [ + 525, + 526 + ], + [ + 528, + 529 + ], + [ + 532, + 533 + ], + [ + 534, + 535 + ], + [ + 542, + 543 + ], + [ + 547, + 553 + ], + [ + 556, + 557 + ], + [ + 568, + 570 + ], + [ + 572, + 573 + ], + [ + 575, + 576 + ], + [ + 578, + 581 + ], + [ + 583, + 586 + ], + [ + 589, + 591 + ], + [ + 592, + 593 + ], + [ + 604, + 610 + ], + [ + 613, + 614 + ], + [ + 620, + 622 + ], + [ + 624, + 626 + ], + [ + 632, + 633 + ], + [ + 642, + 643 + ], + [ + 652, + 654 + ], + [ + 656, + 658 + ], + [ + 664, + 665 + ], + [ + 674, + 675 + ], + [ + 684, + 686 + ], + [ + 688, + 690 + ], + [ + 696, + 697 + ], + [ + 706, + 707 + ], + [ + 716, + 718 + ], + [ + 720, + 722 + ], + [ + 728, + 729 + ], + [ + 738, + 739 + ], + [ + 749, + 750 + ], + [ + 760, + 762 + ], + [ + 764, + 765 + ], + [ + 768, + 769 + ], + [ + 779, + 780 + ], + [ + 784, + 787 + ], + [ + 788, + 789 + ], + [ + 793, + 794 + ], + [ + 810, + 811 + ], + [ + 815, + 818 + ], + [ + 819, + 820 + ] + ] + } + }, + { + "filename": "libvips/foreign/quantise.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 56, + 99 + ], + [ + 103, + 123 + ], + [ + 124, + 182 + ], + [ + 187, + 200 + ], + [ + 201, + 208 + ], + [ + 209, + 279 + ], + [ + 295, + 324 + ], + [ + 325, + 445 + ], + [ + 448, + 475 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 77, + 79 + ], + [ + 80, + 81 + ], + [ + 84, + 86 + ], + [ + 87, + 88 + ], + [ + 94, + 96 + ], + [ + 106, + 108 + ], + [ + 110, + 111 + ], + [ + 116, + 120 + ], + [ + 127, + 129 + ], + [ + 130, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 143, + 145 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 156, + 158 + ], + [ + 160, + 161 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 204, + 205 + ], + [ + 212, + 214 + ], + [ + 218, + 219 + ], + [ + 222, + 224 + ], + [ + 225, + 226 + ], + [ + 230, + 232 + ], + [ + 236, + 238 + ], + [ + 241, + 243 + ], + [ + 244, + 245 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 298, + 299 + ], + [ + 302, + 305 + ], + [ + 306, + 308 + ], + [ + 309, + 310 + ], + [ + 313, + 314 + ], + [ + 315, + 316 + ], + [ + 320, + 321 + ], + [ + 328, + 330 + ], + [ + 331, + 332 + ], + [ + 335, + 336 + ], + [ + 338, + 339 + ], + [ + 345, + 346 + ], + [ + 348, + 350 + ], + [ + 351, + 352 + ], + [ + 353, + 358 + ], + [ + 362, + 363 + ], + [ + 365, + 369 + ], + [ + 374, + 377 + ], + [ + 382, + 385 + ], + [ + 386, + 388 + ], + [ + 394, + 406 + ], + [ + 408, + 409 + ], + [ + 411, + 412 + ], + [ + 413, + 414 + ], + [ + 415, + 418 + ], + [ + 420, + 426 + ], + [ + 428, + 429 + ], + [ + 431, + 432 + ], + [ + 433, + 434 + ], + [ + 435, + 438 + ], + [ + 440, + 442 + ], + [ + 451, + 452 + ], + [ + 453, + 454 + ], + [ + 455, + 456 + ], + [ + 457, + 458 + ], + [ + 463, + 464 + ], + [ + 466, + 467 + ], + [ + 468, + 470 + ], + [ + 471, + 472 + ] + ] + } + }, + { + "filename": "libvips/foreign/quantise.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 60, + 91 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 63, + 82 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ] + ] + } + }, + { + "filename": "libvips/foreign/radiance.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 16, + 23 + ], + [ + 33, + 61 + ], + [ + 70, + 78 + ], + [ + 176, + 362 + ], + [ + 363, + 474 + ], + [ + 475, + 575 + ], + [ + 577, + 586 + ], + [ + 587, + 735 + ], + [ + 748, + 755 + ], + [ + 756, + 800 + ], + [ + 805, + 849 + ], + [ + 855, + 862 + ], + [ + 863, + 1004 + ], + [ + 1016, + 1046 + ], + [ + 1051, + 1100 + ], + [ + 1105, + 1218 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 19, + 20 + ], + [ + 36, + 37 + ], + [ + 38, + 42 + ], + [ + 43, + 52 + ], + [ + 57, + 58 + ], + [ + 73, + 75 + ], + [ + 179, + 188 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 195, + 196 + ], + [ + 197, + 199 + ], + [ + 200, + 201 + ], + [ + 202, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 217, + 226 + ], + [ + 227, + 235 + ], + [ + 237, + 265 + ], + [ + 270, + 275 + ], + [ + 276, + 284 + ], + [ + 285, + 286 + ], + [ + 289, + 359 + ], + [ + 366, + 370 + ], + [ + 371, + 374 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 379, + 380 + ], + [ + 382, + 384 + ], + [ + 386, + 389 + ], + [ + 390, + 394 + ], + [ + 395, + 398 + ], + [ + 399, + 400 + ], + [ + 401, + 403 + ], + [ + 405, + 408 + ], + [ + 409, + 411 + ], + [ + 412, + 416 + ], + [ + 417, + 420 + ], + [ + 421, + 426 + ], + [ + 427, + 433 + ], + [ + 436, + 437 + ], + [ + 439, + 441 + ], + [ + 443, + 444 + ], + [ + 446, + 449 + ], + [ + 450, + 451 + ], + [ + 452, + 454 + ], + [ + 456, + 459 + ], + [ + 462, + 465 + ], + [ + 466, + 468 + ], + [ + 470, + 471 + ], + [ + 478, + 479 + ], + [ + 480, + 491 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 499, + 500 + ], + [ + 501, + 502 + ], + [ + 503, + 515 + ], + [ + 517, + 518 + ], + [ + 519, + 520 + ], + [ + 523, + 524 + ], + [ + 526, + 527 + ], + [ + 528, + 529 + ], + [ + 531, + 534 + ], + [ + 538, + 541 + ], + [ + 543, + 544 + ], + [ + 549, + 550 + ], + [ + 555, + 563 + ], + [ + 564, + 565 + ], + [ + 566, + 567 + ], + [ + 569, + 572 + ], + [ + 580, + 583 + ], + [ + 590, + 591 + ], + [ + 596, + 597 + ], + [ + 602, + 624 + ], + [ + 626, + 628 + ], + [ + 631, + 633 + ], + [ + 634, + 635 + ], + [ + 636, + 637 + ], + [ + 638, + 641 + ], + [ + 643, + 644 + ], + [ + 646, + 648 + ], + [ + 649, + 650 + ], + [ + 651, + 656 + ], + [ + 659, + 660 + ], + [ + 664, + 665 + ], + [ + 669, + 671 + ], + [ + 674, + 679 + ], + [ + 682, + 686 + ], + [ + 687, + 689 + ], + [ + 694, + 695 + ], + [ + 697, + 704 + ], + [ + 706, + 707 + ], + [ + 711, + 712 + ], + [ + 713, + 716 + ], + [ + 719, + 722 + ], + [ + 727, + 732 + ], + [ + 751, + 752 + ], + [ + 759, + 763 + ], + [ + 764, + 765 + ], + [ + 768, + 769 + ], + [ + 770, + 771 + ], + [ + 774, + 775 + ], + [ + 776, + 778 + ], + [ + 781, + 782 + ], + [ + 786, + 788 + ], + [ + 789, + 791 + ], + [ + 792, + 793 + ], + [ + 794, + 795 + ], + [ + 796, + 797 + ], + [ + 808, + 812 + ], + [ + 813, + 814 + ], + [ + 817, + 818 + ], + [ + 819, + 822 + ], + [ + 823, + 825 + ], + [ + 826, + 827 + ], + [ + 830, + 832 + ], + [ + 834, + 836 + ], + [ + 837, + 839 + ], + [ + 841, + 842 + ], + [ + 845, + 846 + ], + [ + 858, + 859 + ], + [ + 866, + 873 + ], + [ + 875, + 876 + ], + [ + 877, + 878 + ], + [ + 882, + 885 + ], + [ + 886, + 890 + ], + [ + 892, + 893 + ], + [ + 895, + 896 + ], + [ + 897, + 900 + ], + [ + 901, + 903 + ], + [ + 904, + 905 + ], + [ + 906, + 907 + ], + [ + 908, + 911 + ], + [ + 912, + 913 + ], + [ + 914, + 918 + ], + [ + 919, + 920 + ], + [ + 923, + 924 + ], + [ + 927, + 932 + ], + [ + 933, + 934 + ], + [ + 937, + 939 + ], + [ + 940, + 942 + ], + [ + 946, + 948 + ], + [ + 950, + 951 + ], + [ + 952, + 955 + ], + [ + 956, + 961 + ], + [ + 964, + 965 + ], + [ + 966, + 967 + ], + [ + 970, + 971 + ], + [ + 972, + 974 + ], + [ + 978, + 980 + ], + [ + 982, + 984 + ], + [ + 986, + 988 + ], + [ + 989, + 996 + ], + [ + 997, + 999 + ], + [ + 1000, + 1001 + ], + [ + 1019, + 1020 + ], + [ + 1021, + 1023 + ], + [ + 1024, + 1025 + ], + [ + 1028, + 1029 + ], + [ + 1033, + 1035 + ], + [ + 1038, + 1039 + ], + [ + 1040, + 1041 + ], + [ + 1042, + 1043 + ], + [ + 1054, + 1057 + ], + [ + 1059, + 1060 + ], + [ + 1063, + 1064 + ], + [ + 1069, + 1071 + ], + [ + 1072, + 1075 + ], + [ + 1076, + 1079 + ], + [ + 1080, + 1084 + ], + [ + 1085, + 1089 + ], + [ + 1091, + 1094 + ], + [ + 1095, + 1097 + ], + [ + 1108, + 1109 + ], + [ + 1110, + 1134 + ], + [ + 1139, + 1140 + ], + [ + 1141, + 1143 + ], + [ + 1145, + 1148 + ], + [ + 1154, + 1155 + ], + [ + 1156, + 1158 + ], + [ + 1160, + 1161 + ], + [ + 1164, + 1165 + ], + [ + 1169, + 1171 + ], + [ + 1172, + 1174 + ], + [ + 1176, + 1177 + ], + [ + 1180, + 1181 + ], + [ + 1182, + 1184 + ], + [ + 1185, + 1186 + ], + [ + 1189, + 1190 + ], + [ + 1194, + 1195 + ], + [ + 1197, + 1202 + ], + [ + 1203, + 1207 + ], + [ + 1209, + 1211 + ], + [ + 1212, + 1213 + ], + [ + 1214, + 1215 + ] + ] + } + }, + { + "filename": "libvips/foreign/radload.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 63, + 129 + ], + [ + 132, + 147 + ], + [ + 155, + 216 + ], + [ + 218, + 267 + ], + [ + 269, + 292 + ], + [ + 300, + 345 + ], + [ + 346, + 367 + ], + [ + 372, + 407 + ], + [ + 412, + 427 + ], + [ + 428, + 443 + ], + [ + 445, + 466 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 96, + 98 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 107, + 109 + ], + [ + 110, + 111 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 125, + 126 + ], + [ + 135, + 136 + ], + [ + 143, + 144 + ], + [ + 158, + 160 + ], + [ + 162, + 163 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 172, + 174 + ], + [ + 175, + 176 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 196, + 197 + ], + [ + 203, + 209 + ], + [ + 212, + 213 + ], + [ + 221, + 222 + ], + [ + 227, + 229 + ], + [ + 231, + 232 + ], + [ + 236, + 239 + ], + [ + 240, + 242 + ], + [ + 243, + 244 + ], + [ + 247, + 248 + ], + [ + 252, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 272, + 273 + ], + [ + 279, + 285 + ], + [ + 288, + 289 + ], + [ + 303, + 305 + ], + [ + 307, + 308 + ], + [ + 312, + 317 + ], + [ + 318, + 320 + ], + [ + 321, + 322 + ], + [ + 325, + 326 + ], + [ + 330, + 334 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 349, + 350 + ], + [ + 354, + 360 + ], + [ + 363, + 364 + ], + [ + 375, + 376 + ], + [ + 379, + 382 + ], + [ + 384, + 385 + ], + [ + 387, + 388 + ], + [ + 394, + 395 + ], + [ + 399, + 402 + ], + [ + 403, + 404 + ], + [ + 415, + 417 + ], + [ + 423, + 424 + ], + [ + 431, + 432 + ], + [ + 433, + 436 + ], + [ + 437, + 438 + ], + [ + 439, + 440 + ], + [ + 448, + 449 + ], + [ + 455, + 456 + ], + [ + 460, + 463 + ], + [ + 464, + 465 + ] + ] + } + }, + { + "filename": "libvips/foreign/radsave.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 60, + 68 + ], + [ + 82, + 96 + ], + [ + 97, + 166 + ], + [ + 171, + 218 + ], + [ + 223, + 283 + ], + [ + 284, + 323 + ], + [ + 327, + 363 + ], + [ + 367, + 381 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 63, + 65 + ], + [ + 85, + 86 + ], + [ + 92, + 93 + ], + [ + 103, + 104 + ], + [ + 110, + 111 + ], + [ + 115, + 117 + ], + [ + 119, + 120 + ], + [ + 126, + 128 + ], + [ + 129, + 134 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 150, + 151 + ], + [ + 153, + 159 + ], + [ + 162, + 163 + ], + [ + 174, + 176 + ], + [ + 178, + 179 + ], + [ + 183, + 185 + ], + [ + 186, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 202, + 203 + ], + [ + 205, + 211 + ], + [ + 214, + 215 + ], + [ + 226, + 228 + ], + [ + 230, + 231 + ], + [ + 237, + 239 + ], + [ + 240, + 242 + ], + [ + 243, + 246 + ], + [ + 248, + 251 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 267, + 268 + ], + [ + 270, + 276 + ], + [ + 279, + 280 + ], + [ + 287, + 288 + ], + [ + 293, + 294 + ], + [ + 300, + 301 + ], + [ + 305, + 308 + ], + [ + 309, + 310 + ], + [ + 314, + 315 + ], + [ + 319, + 320 + ], + [ + 330, + 331 + ], + [ + 336, + 337 + ], + [ + 338, + 341 + ], + [ + 342, + 345 + ], + [ + 348, + 349 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 359, + 360 + ], + [ + 370, + 371 + ], + [ + 375, + 378 + ], + [ + 379, + 380 + ] + ] + } + }, + { + "filename": "libvips/foreign/rawload.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 61, + 124 + ], + [ + 128, + 193 + ], + [ + 207, + 238 + ] + ], + "lines_added": [ + [ + 10, + 26 + ], + [ + 31, + 32 + ], + [ + 64, + 66 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 80, + 81 + ], + [ + 87, + 100 + ], + [ + 101, + 102 + ], + [ + 104, + 105 + ], + [ + 106, + 109 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 131, + 132 + ], + [ + 134, + 135 + ], + [ + 138, + 144 + ], + [ + 145, + 148 + ], + [ + 149, + 151 + ], + [ + 152, + 155 + ], + [ + 156, + 158 + ], + [ + 159, + 162 + ], + [ + 163, + 165 + ], + [ + 166, + 169 + ], + [ + 170, + 172 + ], + [ + 173, + 176 + ], + [ + 177, + 179 + ], + [ + 180, + 183 + ], + [ + 184, + 186 + ], + [ + 189, + 190 + ], + [ + 210, + 212 + ], + [ + 218, + 219 + ], + [ + 225, + 227 + ], + [ + 231, + 235 + ], + [ + 236, + 237 + ] + ] + } + }, + { + "filename": "libvips/foreign/rawsave.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 75, + 128 + ], + [ + 130, + 139 + ], + [ + 142, + 192 + ], + [ + 199, + 248 + ], + [ + 250, + 279 + ], + [ + 284, + 298 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 78, + 80 + ], + [ + 82, + 83 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 97, + 105 + ], + [ + 107, + 108 + ], + [ + 111, + 112 + ], + [ + 116, + 118 + ], + [ + 119, + 123 + ], + [ + 124, + 125 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 145, + 146 + ], + [ + 152, + 158 + ], + [ + 161, + 162 + ], + [ + 167, + 168 + ], + [ + 172, + 173 + ], + [ + 179, + 180 + ], + [ + 184, + 187 + ], + [ + 188, + 189 + ], + [ + 202, + 204 + ], + [ + 206, + 207 + ], + [ + 211, + 219 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 230, + 232 + ], + [ + 233, + 237 + ], + [ + 238, + 239 + ], + [ + 242, + 243 + ], + [ + 244, + 245 + ], + [ + 253, + 254 + ], + [ + 260, + 266 + ], + [ + 269, + 270 + ], + [ + 275, + 276 + ], + [ + 287, + 288 + ], + [ + 292, + 295 + ], + [ + 296, + 297 + ] + ] + } + }, + { + "filename": "libvips/foreign/spngload.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 80, + 208 + ], + [ + 214, + 293 + ], + [ + 310, + 328 + ], + [ + 331, + 344 + ], + [ + 345, + 405 + ], + [ + 406, + 413 + ], + [ + 416, + 648 + ], + [ + 651, + 679 + ], + [ + 687, + 756 + ], + [ + 758, + 809 + ], + [ + 811, + 834 + ], + [ + 842, + 887 + ], + [ + 888, + 909 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 83, + 85 + ], + [ + 87, + 88 + ], + [ + 91, + 93 + ], + [ + 94, + 95 + ], + [ + 97, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 106, + 111 + ], + [ + 116, + 117 + ], + [ + 120, + 121 + ], + [ + 126, + 135 + ], + [ + 136, + 137 + ], + [ + 139, + 140 + ], + [ + 144, + 145 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 156, + 157 + ], + [ + 161, + 165 + ], + [ + 166, + 167 + ], + [ + 173, + 175 + ], + [ + 177, + 179 + ], + [ + 181, + 182 + ], + [ + 188, + 190 + ], + [ + 191, + 192 + ], + [ + 197, + 198 + ], + [ + 199, + 200 + ], + [ + 204, + 205 + ], + [ + 217, + 218 + ], + [ + 220, + 222 + ], + [ + 224, + 225 + ], + [ + 226, + 228 + ], + [ + 229, + 231 + ], + [ + 232, + 234 + ], + [ + 235, + 238 + ], + [ + 239, + 240 + ], + [ + 245, + 249 + ], + [ + 252, + 255 + ], + [ + 257, + 258 + ], + [ + 260, + 262 + ], + [ + 265, + 268 + ], + [ + 271, + 274 + ], + [ + 277, + 279 + ], + [ + 280, + 285 + ], + [ + 289, + 290 + ], + [ + 313, + 316 + ], + [ + 318, + 319 + ], + [ + 322, + 323 + ], + [ + 324, + 325 + ], + [ + 334, + 335 + ], + [ + 336, + 338 + ], + [ + 340, + 341 + ], + [ + 348, + 353 + ], + [ + 355, + 362 + ], + [ + 365, + 366 + ], + [ + 367, + 370 + ], + [ + 371, + 372 + ], + [ + 375, + 376 + ], + [ + 378, + 381 + ], + [ + 383, + 386 + ], + [ + 388, + 391 + ], + [ + 394, + 396 + ], + [ + 400, + 402 + ], + [ + 409, + 410 + ], + [ + 419, + 420 + ], + [ + 424, + 426 + ], + [ + 432, + 437 + ], + [ + 441, + 443 + ], + [ + 445, + 446 + ], + [ + 448, + 450 + ], + [ + 451, + 452 + ], + [ + 454, + 456 + ], + [ + 457, + 458 + ], + [ + 460, + 461 + ], + [ + 462, + 464 + ], + [ + 465, + 466 + ], + [ + 470, + 471 + ], + [ + 472, + 474 + ], + [ + 475, + 476 + ], + [ + 479, + 480 + ], + [ + 481, + 482 + ], + [ + 485, + 487 + ], + [ + 488, + 490 + ], + [ + 491, + 492 + ], + [ + 497, + 500 + ], + [ + 505, + 508 + ], + [ + 512, + 513 + ], + [ + 517, + 521 + ], + [ + 523, + 525 + ], + [ + 527, + 534 + ], + [ + 535, + 536 + ], + [ + 538, + 543 + ], + [ + 545, + 547 + ], + [ + 548, + 549 + ], + [ + 550, + 554 + ], + [ + 560, + 561 + ], + [ + 564, + 565 + ], + [ + 566, + 567 + ], + [ + 568, + 570 + ], + [ + 574, + 576 + ], + [ + 581, + 583 + ], + [ + 586, + 597 + ], + [ + 601, + 602 + ], + [ + 603, + 605 + ], + [ + 609, + 611 + ], + [ + 616, + 621 + ], + [ + 625, + 636 + ], + [ + 638, + 639 + ], + [ + 642, + 643 + ], + [ + 644, + 645 + ], + [ + 654, + 655 + ], + [ + 660, + 661 + ], + [ + 666, + 669 + ], + [ + 670, + 672 + ], + [ + 675, + 676 + ], + [ + 690, + 692 + ], + [ + 694, + 695 + ], + [ + 699, + 700 + ], + [ + 701, + 702 + ], + [ + 704, + 706 + ], + [ + 707, + 708 + ], + [ + 711, + 712 + ], + [ + 717, + 720 + ], + [ + 721, + 722 + ], + [ + 725, + 726 + ], + [ + 727, + 728 + ], + [ + 729, + 730 + ], + [ + 736, + 737 + ], + [ + 743, + 749 + ], + [ + 752, + 753 + ], + [ + 761, + 762 + ], + [ + 767, + 769 + ], + [ + 771, + 772 + ], + [ + 776, + 779 + ], + [ + 780, + 782 + ], + [ + 783, + 784 + ], + [ + 787, + 788 + ], + [ + 792, + 796 + ], + [ + 797, + 798 + ], + [ + 803, + 804 + ], + [ + 805, + 806 + ], + [ + 814, + 815 + ], + [ + 821, + 827 + ], + [ + 830, + 831 + ], + [ + 845, + 847 + ], + [ + 849, + 850 + ], + [ + 854, + 859 + ], + [ + 860, + 862 + ], + [ + 863, + 864 + ], + [ + 867, + 868 + ], + [ + 872, + 876 + ], + [ + 877, + 878 + ], + [ + 881, + 882 + ], + [ + 883, + 884 + ], + [ + 891, + 892 + ], + [ + 896, + 902 + ], + [ + 905, + 906 + ] + ] + } + }, + { + "filename": "libvips/foreign/spngsave.c", + "line_filter": { + "diff_chunks": [ + [ + 18, + 46 + ], + [ + 100, + 180 + ], + [ + 181, + 386 + ], + [ + 388, + 469 + ], + [ + 471, + 493 + ], + [ + 496, + 519 + ], + [ + 520, + 550 + ], + [ + 552, + 655 + ], + [ + 663, + 672 + ], + [ + 675, + 682 + ], + [ + 683, + 763 + ], + [ + 773, + 873 + ], + [ + 878, + 932 + ] + ], + "lines_added": [ + [ + 21, + 37 + ], + [ + 42, + 43 + ], + [ + 103, + 105 + ], + [ + 107, + 108 + ], + [ + 113, + 116 + ], + [ + 117, + 118 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 127, + 128 + ], + [ + 131, + 133 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 140, + 142 + ], + [ + 143, + 146 + ], + [ + 149, + 151 + ], + [ + 154, + 155 + ], + [ + 159, + 161 + ], + [ + 162, + 167 + ], + [ + 169, + 170 + ], + [ + 172, + 173 + ], + [ + 176, + 177 + ], + [ + 184, + 185 + ], + [ + 187, + 190 + ], + [ + 191, + 193 + ], + [ + 195, + 198 + ], + [ + 200, + 202 + ], + [ + 204, + 205 + ], + [ + 206, + 208 + ], + [ + 210, + 211 + ], + [ + 214, + 217 + ], + [ + 219, + 222 + ], + [ + 224, + 226 + ], + [ + 229, + 230 + ], + [ + 232, + 233 + ], + [ + 237, + 240 + ], + [ + 245, + 249 + ], + [ + 251, + 252 + ], + [ + 254, + 258 + ], + [ + 261, + 263 + ], + [ + 267, + 268 + ], + [ + 270, + 272 + ], + [ + 273, + 276 + ], + [ + 281, + 282 + ], + [ + 283, + 285 + ], + [ + 286, + 287 + ], + [ + 292, + 294 + ], + [ + 295, + 296 + ], + [ + 298, + 300 + ], + [ + 301, + 304 + ], + [ + 306, + 309 + ], + [ + 310, + 317 + ], + [ + 318, + 320 + ], + [ + 322, + 325 + ], + [ + 328, + 330 + ], + [ + 331, + 332 + ], + [ + 335, + 337 + ], + [ + 339, + 340 + ], + [ + 346, + 349 + ], + [ + 350, + 351 + ], + [ + 354, + 356 + ], + [ + 357, + 360 + ], + [ + 364, + 365 + ], + [ + 370, + 374 + ], + [ + 376, + 377 + ], + [ + 380, + 381 + ], + [ + 382, + 383 + ], + [ + 391, + 392 + ], + [ + 393, + 397 + ], + [ + 403, + 404 + ], + [ + 409, + 410 + ], + [ + 416, + 418 + ], + [ + 421, + 423 + ], + [ + 428, + 429 + ], + [ + 431, + 434 + ], + [ + 439, + 442 + ], + [ + 444, + 450 + ], + [ + 454, + 457 + ], + [ + 460, + 463 + ], + [ + 465, + 466 + ], + [ + 474, + 481 + ], + [ + 485, + 486 + ], + [ + 487, + 490 + ], + [ + 499, + 501 + ], + [ + 505, + 509 + ], + [ + 511, + 512 + ], + [ + 513, + 516 + ], + [ + 523, + 525 + ], + [ + 526, + 529 + ], + [ + 531, + 532 + ], + [ + 535, + 539 + ], + [ + 541, + 542 + ], + [ + 544, + 547 + ], + [ + 555, + 557 + ], + [ + 559, + 561 + ], + [ + 562, + 565 + ], + [ + 569, + 571 + ], + [ + 572, + 576 + ], + [ + 579, + 582 + ], + [ + 584, + 586 + ], + [ + 587, + 588 + ], + [ + 591, + 592 + ], + [ + 598, + 600 + ], + [ + 602, + 603 + ], + [ + 606, + 612 + ], + [ + 616, + 618 + ], + [ + 621, + 622 + ], + [ + 624, + 627 + ], + [ + 628, + 629 + ], + [ + 635, + 637 + ], + [ + 641, + 642 + ], + [ + 644, + 647 + ], + [ + 649, + 650 + ], + [ + 651, + 652 + ], + [ + 666, + 667 + ], + [ + 668, + 669 + ], + [ + 678, + 679 + ], + [ + 686, + 689 + ], + [ + 690, + 692 + ], + [ + 693, + 696 + ], + [ + 697, + 699 + ], + [ + 700, + 703 + ], + [ + 704, + 706 + ], + [ + 707, + 710 + ], + [ + 711, + 712 + ], + [ + 713, + 714 + ], + [ + 715, + 718 + ], + [ + 719, + 721 + ], + [ + 722, + 725 + ], + [ + 726, + 728 + ], + [ + 729, + 732 + ], + [ + 733, + 735 + ], + [ + 736, + 739 + ], + [ + 740, + 742 + ], + [ + 743, + 746 + ], + [ + 747, + 749 + ], + [ + 750, + 753 + ], + [ + 754, + 756 + ], + [ + 759, + 760 + ], + [ + 776, + 778 + ], + [ + 780, + 781 + ], + [ + 783, + 784 + ], + [ + 787, + 788 + ], + [ + 789, + 791 + ], + [ + 792, + 793 + ], + [ + 796, + 797 + ], + [ + 798, + 799 + ], + [ + 805, + 806 + ], + [ + 808, + 814 + ], + [ + 817, + 818 + ], + [ + 824, + 825 + ], + [ + 829, + 831 + ], + [ + 833, + 834 + ], + [ + 838, + 840 + ], + [ + 841, + 843 + ], + [ + 844, + 845 + ], + [ + 848, + 849 + ], + [ + 850, + 851 + ], + [ + 857, + 858 + ], + [ + 860, + 866 + ], + [ + 869, + 870 + ], + [ + 881, + 883 + ], + [ + 885, + 886 + ], + [ + 888, + 889 + ], + [ + 893, + 895 + ], + [ + 896, + 898 + ], + [ + 899, + 902 + ], + [ + 903, + 904 + ], + [ + 907, + 908 + ], + [ + 909, + 910 + ], + [ + 916, + 917 + ], + [ + 919, + 925 + ], + [ + 928, + 929 + ] + ] + } + }, + { + "filename": "libvips/foreign/svgload.c", + "line_filter": { + "diff_chunks": [ + [ + 21, + 28 + ], + [ + 32, + 60 + ], + [ + 81, + 88 + ], + [ + 125, + 231 + ], + [ + 245, + 254 + ], + [ + 259, + 281 + ], + [ + 295, + 339 + ], + [ + 341, + 386 + ], + [ + 387, + 405 + ], + [ + 407, + 472 + ], + [ + 473, + 515 + ], + [ + 517, + 683 + ], + [ + 685, + 692 + ], + [ + 696, + 731 + ], + [ + 742, + 769 + ], + [ + 770, + 817 + ], + [ + 818, + 834 + ], + [ + 836, + 864 + ], + [ + 867, + 891 + ], + [ + 893, + 903 + ], + [ + 911, + 927 + ], + [ + 935, + 949 + ], + [ + 950, + 974 + ], + [ + 979, + 995 + ], + [ + 1010, + 1017 + ], + [ + 1023, + 1039 + ], + [ + 1049, + 1066 + ], + [ + 1067, + 1082 + ], + [ + 1098, + 1105 + ], + [ + 1106, + 1121 + ], + [ + 1123, + 1144 + ] + ], + "lines_added": [ + [ + 24, + 25 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 84, + 85 + ], + [ + 128, + 130 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 145, + 146 + ], + [ + 150, + 151 + ], + [ + 154, + 156 + ], + [ + 157, + 159 + ], + [ + 162, + 167 + ], + [ + 169, + 172 + ], + [ + 176, + 181 + ], + [ + 182, + 183 + ], + [ + 184, + 186 + ], + [ + 187, + 189 + ], + [ + 191, + 214 + ], + [ + 216, + 218 + ], + [ + 219, + 222 + ], + [ + 227, + 228 + ], + [ + 248, + 251 + ], + [ + 262, + 264 + ], + [ + 267, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 278 + ], + [ + 298, + 299 + ], + [ + 300, + 302 + ], + [ + 303, + 304 + ], + [ + 307, + 308 + ], + [ + 311, + 312 + ], + [ + 313, + 314 + ], + [ + 317, + 318 + ], + [ + 321, + 322 + ], + [ + 325, + 326 + ], + [ + 327, + 328 + ], + [ + 330, + 331 + ], + [ + 335, + 336 + ], + [ + 344, + 383 + ], + [ + 390, + 392 + ], + [ + 393, + 394 + ], + [ + 398, + 399 + ], + [ + 400, + 402 + ], + [ + 410, + 411 + ], + [ + 413, + 414 + ], + [ + 415, + 418 + ], + [ + 420, + 422 + ], + [ + 426, + 428 + ], + [ + 431, + 432 + ], + [ + 434, + 435 + ], + [ + 437, + 438 + ], + [ + 441, + 443 + ], + [ + 445, + 447 + ], + [ + 448, + 450 + ], + [ + 452, + 454 + ], + [ + 456, + 457 + ], + [ + 462, + 465 + ], + [ + 467, + 469 + ], + [ + 476, + 478 + ], + [ + 479, + 483 + ], + [ + 488, + 492 + ], + [ + 497, + 498 + ], + [ + 501, + 503 + ], + [ + 509, + 512 + ], + [ + 520, + 522 + ], + [ + 523, + 524 + ], + [ + 527, + 528 + ], + [ + 533, + 535 + ], + [ + 540, + 541 + ], + [ + 543, + 544 + ], + [ + 547, + 549 + ], + [ + 550, + 551 + ], + [ + 554, + 555 + ], + [ + 558, + 559 + ], + [ + 562, + 564 + ], + [ + 566, + 568 + ], + [ + 574, + 576 + ], + [ + 577, + 578 + ], + [ + 582, + 583 + ], + [ + 584, + 591 + ], + [ + 595, + 596 + ], + [ + 597, + 600 + ], + [ + 601, + 618 + ], + [ + 619, + 621 + ], + [ + 624, + 627 + ], + [ + 628, + 634 + ], + [ + 636, + 637 + ], + [ + 642, + 646 + ], + [ + 647, + 648 + ], + [ + 651, + 652 + ], + [ + 654, + 656 + ], + [ + 659, + 664 + ], + [ + 667, + 670 + ], + [ + 671, + 672 + ], + [ + 675, + 676 + ], + [ + 677, + 678 + ], + [ + 679, + 680 + ], + [ + 688, + 689 + ], + [ + 699, + 700 + ], + [ + 704, + 707 + ], + [ + 708, + 710 + ], + [ + 711, + 714 + ], + [ + 715, + 717 + ], + [ + 718, + 721 + ], + [ + 722, + 724 + ], + [ + 727, + 728 + ], + [ + 745, + 747 + ], + [ + 749, + 750 + ], + [ + 754, + 757 + ], + [ + 758, + 759 + ], + [ + 762, + 763 + ], + [ + 765, + 766 + ], + [ + 773, + 775 + ], + [ + 776, + 782 + ], + [ + 783, + 784 + ], + [ + 785, + 786 + ], + [ + 789, + 790 + ], + [ + 793, + 797 + ], + [ + 798, + 799 + ], + [ + 802, + 803 + ], + [ + 804, + 805 + ], + [ + 806, + 807 + ], + [ + 813, + 814 + ], + [ + 821, + 827 + ], + [ + 830, + 831 + ], + [ + 839, + 840 + ], + [ + 845, + 847 + ], + [ + 849, + 850 + ], + [ + 854, + 857 + ], + [ + 860, + 861 + ], + [ + 870, + 876 + ], + [ + 877, + 878 + ], + [ + 879, + 880 + ], + [ + 881, + 882 + ], + [ + 886, + 888 + ], + [ + 896, + 898 + ], + [ + 899, + 900 + ], + [ + 914, + 920 + ], + [ + 923, + 924 + ], + [ + 938, + 940 + ], + [ + 942, + 943 + ], + [ + 945, + 946 + ], + [ + 953, + 960 + ], + [ + 961, + 962 + ], + [ + 963, + 964 + ], + [ + 967, + 969 + ], + [ + 970, + 971 + ], + [ + 982, + 988 + ], + [ + 991, + 992 + ], + [ + 1013, + 1014 + ], + [ + 1026, + 1027 + ], + [ + 1031, + 1034 + ], + [ + 1035, + 1036 + ], + [ + 1052, + 1053 + ], + [ + 1054, + 1056 + ], + [ + 1062, + 1063 + ], + [ + 1070, + 1071 + ], + [ + 1072, + 1075 + ], + [ + 1076, + 1077 + ], + [ + 1078, + 1079 + ], + [ + 1101, + 1102 + ], + [ + 1109, + 1110 + ], + [ + 1111, + 1114 + ], + [ + 1115, + 1116 + ], + [ + 1117, + 1118 + ], + [ + 1126, + 1127 + ], + [ + 1133, + 1134 + ], + [ + 1138, + 1141 + ], + [ + 1142, + 1143 + ] + ] + } + }, + { + "filename": "libvips/foreign/tiff.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 63, + 156 + ], + [ + 157, + 200 + ], + [ + 202, + 263 + ], + [ + 264, + 295 + ] + ], + "lines_added": [ + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 28 + ], + [ + 33, + 34 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 82, + 84 + ], + [ + 87, + 88 + ], + [ + 89, + 91 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 127, + 128 + ], + [ + 131, + 132 + ], + [ + 133, + 134 + ], + [ + 140, + 141 + ], + [ + 144, + 145 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 160, + 161 + ], + [ + 165, + 166 + ], + [ + 168, + 170 + ], + [ + 172, + 173 + ], + [ + 174, + 176 + ], + [ + 178, + 190 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 205, + 206 + ], + [ + 209, + 210 + ], + [ + 213, + 214 + ], + [ + 217, + 219 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 228, + 229 + ], + [ + 232, + 233 + ], + [ + 236, + 238 + ], + [ + 239, + 240 + ], + [ + 243, + 244 + ], + [ + 247, + 248 + ], + [ + 251, + 252 + ], + [ + 255, + 256 + ], + [ + 259, + 260 + ], + [ + 267, + 268 + ], + [ + 274, + 275 + ], + [ + 277, + 289 + ], + [ + 291, + 292 + ] + ] + } + }, + { + "filename": "libvips/foreign/tiff.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 37, + 47 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 40, + 41 + ], + [ + 42, + 44 + ] + ] + } + }, + { + "filename": "libvips/foreign/tiff2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 106, + 113 + ], + [ + 140, + 147 + ], + [ + 156, + 163 + ], + [ + 168, + 175 + ], + [ + 184, + 191 + ], + [ + 195, + 202 + ], + [ + 215, + 247 + ], + [ + 283, + 290 + ], + [ + 302, + 312 + ], + [ + 318, + 325 + ], + [ + 362, + 370 + ], + [ + 377, + 387 + ], + [ + 405, + 421 + ], + [ + 426, + 488 + ], + [ + 490, + 498 + ], + [ + 499, + 513 + ], + [ + 520, + 602 + ], + [ + 603, + 610 + ], + [ + 614, + 732 + ], + [ + 734, + 754 + ], + [ + 755, + 916 + ], + [ + 923, + 952 + ], + [ + 955, + 969 + ], + [ + 973, + 985 + ], + [ + 987, + 1016 + ], + [ + 1020, + 1063 + ], + [ + 1067, + 1284 + ], + [ + 1286, + 1320 + ], + [ + 1335, + 1343 + ], + [ + 1348, + 1358 + ], + [ + 1363, + 1371 + ], + [ + 1373, + 1389 + ], + [ + 1390, + 1400 + ], + [ + 1402, + 1421 + ], + [ + 1426, + 1436 + ], + [ + 1438, + 1456 + ], + [ + 1458, + 1482 + ], + [ + 1483, + 1504 + ], + [ + 1507, + 1516 + ], + [ + 1519, + 1610 + ], + [ + 1616, + 1776 + ], + [ + 1779, + 1795 + ], + [ + 1797, + 1840 + ], + [ + 1847, + 1988 + ], + [ + 1989, + 2145 + ], + [ + 2147, + 2190 + ], + [ + 2194, + 2205 + ], + [ + 2207, + 2214 + ], + [ + 2220, + 2231 + ], + [ + 2237, + 2244 + ], + [ + 2245, + 2272 + ], + [ + 2277, + 2291 + ], + [ + 2298, + 2497 + ], + [ + 2498, + 2537 + ], + [ + 2539, + 2557 + ], + [ + 2564, + 2571 + ], + [ + 2582, + 2615 + ], + [ + 2618, + 2643 + ], + [ + 2644, + 2696 + ], + [ + 2697, + 2709 + ], + [ + 2712, + 2730 + ], + [ + 2733, + 2773 + ], + [ + 2775, + 2806 + ], + [ + 2807, + 2995 + ], + [ + 3007, + 3017 + ], + [ + 3018, + 3042 + ], + [ + 3046, + 3155 + ], + [ + 3157, + 3262 + ] + ], + "lines_added": [ + [ + 109, + 110 + ], + [ + 143, + 144 + ], + [ + 159, + 160 + ], + [ + 171, + 172 + ], + [ + 187, + 188 + ], + [ + 198, + 199 + ], + [ + 218, + 219 + ], + [ + 220, + 224 + ], + [ + 225, + 234 + ], + [ + 239, + 240 + ], + [ + 243, + 244 + ], + [ + 286, + 287 + ], + [ + 305, + 307 + ], + [ + 308, + 309 + ], + [ + 321, + 322 + ], + [ + 365, + 367 + ], + [ + 380, + 384 + ], + [ + 408, + 409 + ], + [ + 410, + 411 + ], + [ + 416, + 418 + ], + [ + 429, + 430 + ], + [ + 433, + 437 + ], + [ + 439, + 440 + ], + [ + 442, + 443 + ], + [ + 446, + 450 + ], + [ + 454, + 455 + ], + [ + 460, + 461 + ], + [ + 464, + 468 + ], + [ + 472, + 473 + ], + [ + 476, + 477 + ], + [ + 481, + 485 + ], + [ + 493, + 495 + ], + [ + 502, + 504 + ], + [ + 507, + 510 + ], + [ + 523, + 524 + ], + [ + 527, + 528 + ], + [ + 534, + 535 + ], + [ + 537, + 538 + ], + [ + 543, + 544 + ], + [ + 547, + 548 + ], + [ + 554, + 556 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ], + [ + 565, + 566 + ], + [ + 567, + 570 + ], + [ + 573, + 574 + ], + [ + 575, + 576 + ], + [ + 579, + 580 + ], + [ + 584, + 587 + ], + [ + 590, + 592 + ], + [ + 595, + 597 + ], + [ + 598, + 599 + ], + [ + 606, + 607 + ], + [ + 617, + 621 + ], + [ + 622, + 627 + ], + [ + 632, + 637 + ], + [ + 639, + 641 + ], + [ + 642, + 643 + ], + [ + 646, + 647 + ], + [ + 651, + 652 + ], + [ + 654, + 660 + ], + [ + 661, + 665 + ], + [ + 667, + 668 + ], + [ + 673, + 674 + ], + [ + 677, + 680 + ], + [ + 683, + 687 + ], + [ + 690, + 691 + ], + [ + 692, + 693 + ], + [ + 694, + 696 + ], + [ + 698, + 702 + ], + [ + 704, + 705 + ], + [ + 708, + 713 + ], + [ + 715, + 719 + ], + [ + 720, + 722 + ], + [ + 724, + 729 + ], + [ + 737, + 738 + ], + [ + 740, + 741 + ], + [ + 744, + 745 + ], + [ + 748, + 749 + ], + [ + 750, + 751 + ], + [ + 758, + 759 + ], + [ + 761, + 762 + ], + [ + 765, + 766 + ], + [ + 767, + 771 + ], + [ + 773, + 774 + ], + [ + 779, + 780 + ], + [ + 781, + 786 + ], + [ + 788, + 789 + ], + [ + 791, + 792 + ], + [ + 794, + 795 + ], + [ + 796, + 801 + ], + [ + 803, + 804 + ], + [ + 807, + 815 + ], + [ + 817, + 818 + ], + [ + 821, + 822 + ], + [ + 823, + 827 + ], + [ + 829, + 830 + ], + [ + 833, + 844 + ], + [ + 846, + 847 + ], + [ + 850, + 851 + ], + [ + 855, + 856 + ], + [ + 860, + 864 + ], + [ + 867, + 871 + ], + [ + 874, + 880 + ], + [ + 883, + 887 + ], + [ + 890, + 892 + ], + [ + 898, + 899 + ], + [ + 900, + 901 + ], + [ + 906, + 907 + ], + [ + 912, + 913 + ], + [ + 926, + 927 + ], + [ + 928, + 932 + ], + [ + 933, + 937 + ], + [ + 940, + 941 + ], + [ + 947, + 949 + ], + [ + 958, + 959 + ], + [ + 965, + 966 + ], + [ + 976, + 977 + ], + [ + 978, + 982 + ], + [ + 990, + 991 + ], + [ + 996, + 997 + ], + [ + 1003, + 1004 + ], + [ + 1007, + 1008 + ], + [ + 1012, + 1013 + ], + [ + 1023, + 1024 + ], + [ + 1025, + 1029 + ], + [ + 1030, + 1034 + ], + [ + 1037, + 1038 + ], + [ + 1043, + 1044 + ], + [ + 1050, + 1051 + ], + [ + 1054, + 1055 + ], + [ + 1059, + 1060 + ], + [ + 1070, + 1071 + ], + [ + 1072, + 1075 + ], + [ + 1076, + 1080 + ], + [ + 1083, + 1084 + ], + [ + 1089, + 1117 + ], + [ + 1120, + 1126 + ], + [ + 1129, + 1137 + ], + [ + 1138, + 1139 + ], + [ + 1140, + 1146 + ], + [ + 1147, + 1150 + ], + [ + 1151, + 1152 + ], + [ + 1154, + 1155 + ], + [ + 1156, + 1159 + ], + [ + 1160, + 1164 + ], + [ + 1167, + 1168 + ], + [ + 1170, + 1171 + ], + [ + 1173, + 1174 + ], + [ + 1175, + 1178 + ], + [ + 1179, + 1183 + ], + [ + 1186, + 1187 + ], + [ + 1189, + 1190 + ], + [ + 1192, + 1193 + ], + [ + 1194, + 1197 + ], + [ + 1198, + 1202 + ], + [ + 1205, + 1206 + ], + [ + 1208, + 1209 + ], + [ + 1210, + 1230 + ], + [ + 1234, + 1236 + ], + [ + 1238, + 1239 + ], + [ + 1240, + 1241 + ], + [ + 1244, + 1245 + ], + [ + 1246, + 1247 + ], + [ + 1250, + 1251 + ], + [ + 1252, + 1253 + ], + [ + 1256, + 1257 + ], + [ + 1260, + 1261 + ], + [ + 1264, + 1265 + ], + [ + 1268, + 1269 + ], + [ + 1272, + 1273 + ], + [ + 1276, + 1277 + ], + [ + 1280, + 1281 + ], + [ + 1289, + 1290 + ], + [ + 1292, + 1293 + ], + [ + 1294, + 1297 + ], + [ + 1298, + 1303 + ], + [ + 1304, + 1306 + ], + [ + 1307, + 1308 + ], + [ + 1311, + 1313 + ], + [ + 1316, + 1317 + ], + [ + 1338, + 1340 + ], + [ + 1351, + 1352 + ], + [ + 1354, + 1355 + ], + [ + 1366, + 1368 + ], + [ + 1376, + 1378 + ], + [ + 1384, + 1386 + ], + [ + 1393, + 1394 + ], + [ + 1396, + 1397 + ], + [ + 1405, + 1407 + ], + [ + 1408, + 1410 + ], + [ + 1413, + 1414 + ], + [ + 1416, + 1418 + ], + [ + 1429, + 1430 + ], + [ + 1432, + 1433 + ], + [ + 1441, + 1443 + ], + [ + 1444, + 1446 + ], + [ + 1449, + 1450 + ], + [ + 1452, + 1453 + ], + [ + 1461, + 1464 + ], + [ + 1466, + 1471 + ], + [ + 1474, + 1479 + ], + [ + 1486, + 1490 + ], + [ + 1491, + 1493 + ], + [ + 1498, + 1499 + ], + [ + 1500, + 1501 + ], + [ + 1510, + 1513 + ], + [ + 1522, + 1524 + ], + [ + 1525, + 1527 + ], + [ + 1528, + 1532 + ], + [ + 1533, + 1534 + ], + [ + 1536, + 1539 + ], + [ + 1540, + 1541 + ], + [ + 1544, + 1545 + ], + [ + 1546, + 1547 + ], + [ + 1548, + 1549 + ], + [ + 1551, + 1552 + ], + [ + 1553, + 1554 + ], + [ + 1559, + 1560 + ], + [ + 1562, + 1563 + ], + [ + 1564, + 1565 + ], + [ + 1571, + 1572 + ], + [ + 1574, + 1575 + ], + [ + 1578, + 1580 + ], + [ + 1581, + 1586 + ], + [ + 1587, + 1588 + ], + [ + 1589, + 1593 + ], + [ + 1594, + 1595 + ], + [ + 1596, + 1597 + ], + [ + 1598, + 1599 + ], + [ + 1600, + 1604 + ], + [ + 1605, + 1607 + ], + [ + 1619, + 1620 + ], + [ + 1622, + 1623 + ], + [ + 1628, + 1629 + ], + [ + 1631, + 1632 + ], + [ + 1635, + 1639 + ], + [ + 1640, + 1641 + ], + [ + 1642, + 1644 + ], + [ + 1646, + 1648 + ], + [ + 1649, + 1651 + ], + [ + 1652, + 1658 + ], + [ + 1659, + 1660 + ], + [ + 1662, + 1664 + ], + [ + 1665, + 1666 + ], + [ + 1669, + 1670 + ], + [ + 1672, + 1673 + ], + [ + 1677, + 1678 + ], + [ + 1679, + 1681 + ], + [ + 1685, + 1687 + ], + [ + 1688, + 1691 + ], + [ + 1692, + 1695 + ], + [ + 1696, + 1697 + ], + [ + 1701, + 1703 + ], + [ + 1706, + 1710 + ], + [ + 1713, + 1717 + ], + [ + 1720, + 1724 + ], + [ + 1725, + 1726 + ], + [ + 1728, + 1729 + ], + [ + 1733, + 1737 + ], + [ + 1738, + 1741 + ], + [ + 1742, + 1744 + ], + [ + 1748, + 1750 + ], + [ + 1751, + 1757 + ], + [ + 1758, + 1759 + ], + [ + 1764, + 1765 + ], + [ + 1766, + 1768 + ], + [ + 1772, + 1773 + ], + [ + 1782, + 1783 + ], + [ + 1785, + 1786 + ], + [ + 1787, + 1789 + ], + [ + 1790, + 1792 + ], + [ + 1800, + 1801 + ], + [ + 1802, + 1805 + ], + [ + 1807, + 1808 + ], + [ + 1811, + 1813 + ], + [ + 1814, + 1816 + ], + [ + 1818, + 1820 + ], + [ + 1821, + 1824 + ], + [ + 1825, + 1830 + ], + [ + 1831, + 1835 + ], + [ + 1836, + 1837 + ], + [ + 1850, + 1852 + ], + [ + 1853, + 1854 + ], + [ + 1855, + 1867 + ], + [ + 1868, + 1871 + ], + [ + 1874, + 1876 + ], + [ + 1877, + 1881 + ], + [ + 1882, + 1890 + ], + [ + 1893, + 1902 + ], + [ + 1904, + 1906 + ], + [ + 1908, + 1978 + ], + [ + 1981, + 1982 + ], + [ + 1983, + 1985 + ], + [ + 1992, + 1993 + ], + [ + 1994, + 1996 + ], + [ + 1997, + 1998 + ], + [ + 2000, + 2001 + ], + [ + 2006, + 2027 + ], + [ + 2028, + 2029 + ], + [ + 2031, + 2034 + ], + [ + 2035, + 2036 + ], + [ + 2037, + 2038 + ], + [ + 2042, + 2059 + ], + [ + 2061, + 2065 + ], + [ + 2067, + 2071 + ], + [ + 2072, + 2073 + ], + [ + 2079, + 2080 + ], + [ + 2081, + 2082 + ], + [ + 2083, + 2084 + ], + [ + 2086, + 2089 + ], + [ + 2091, + 2094 + ], + [ + 2096, + 2104 + ], + [ + 2105, + 2112 + ], + [ + 2113, + 2114 + ], + [ + 2115, + 2122 + ], + [ + 2123, + 2126 + ], + [ + 2127, + 2130 + ], + [ + 2132, + 2137 + ], + [ + 2138, + 2142 + ], + [ + 2150, + 2152 + ], + [ + 2153, + 2154 + ], + [ + 2160, + 2165 + ], + [ + 2167, + 2168 + ], + [ + 2172, + 2176 + ], + [ + 2177, + 2178 + ], + [ + 2183, + 2185 + ], + [ + 2186, + 2187 + ], + [ + 2197, + 2198 + ], + [ + 2201, + 2202 + ], + [ + 2210, + 2211 + ], + [ + 2223, + 2226 + ], + [ + 2227, + 2228 + ], + [ + 2240, + 2241 + ], + [ + 2248, + 2249 + ], + [ + 2255, + 2256 + ], + [ + 2257, + 2258 + ], + [ + 2260, + 2261 + ], + [ + 2262, + 2266 + ], + [ + 2267, + 2269 + ], + [ + 2280, + 2281 + ], + [ + 2286, + 2288 + ], + [ + 2301, + 2304 + ], + [ + 2306, + 2307 + ], + [ + 2309, + 2310 + ], + [ + 2312, + 2313 + ], + [ + 2319, + 2321 + ], + [ + 2325, + 2326 + ], + [ + 2327, + 2330 + ], + [ + 2332, + 2333 + ], + [ + 2334, + 2335 + ], + [ + 2338, + 2339 + ], + [ + 2340, + 2341 + ], + [ + 2342, + 2344 + ], + [ + 2345, + 2346 + ], + [ + 2351, + 2352 + ], + [ + 2353, + 2354 + ], + [ + 2356, + 2358 + ], + [ + 2359, + 2363 + ], + [ + 2364, + 2365 + ], + [ + 2368, + 2369 + ], + [ + 2371, + 2372 + ], + [ + 2378, + 2379 + ], + [ + 2382, + 2384 + ], + [ + 2388, + 2389 + ], + [ + 2393, + 2397 + ], + [ + 2401, + 2402 + ], + [ + 2403, + 2405 + ], + [ + 2409, + 2412 + ], + [ + 2413, + 2417 + ], + [ + 2421, + 2429 + ], + [ + 2433, + 2436 + ], + [ + 2440, + 2444 + ], + [ + 2447, + 2449 + ], + [ + 2450, + 2451 + ], + [ + 2453, + 2454 + ], + [ + 2459, + 2461 + ], + [ + 2467, + 2469 + ], + [ + 2470, + 2471 + ], + [ + 2474, + 2476 + ], + [ + 2477, + 2478 + ], + [ + 2481, + 2482 + ], + [ + 2485, + 2489 + ], + [ + 2492, + 2494 + ], + [ + 2501, + 2504 + ], + [ + 2506, + 2507 + ], + [ + 2510, + 2512 + ], + [ + 2518, + 2519 + ], + [ + 2523, + 2526 + ], + [ + 2531, + 2534 + ], + [ + 2542, + 2548 + ], + [ + 2550, + 2551 + ], + [ + 2553, + 2554 + ], + [ + 2567, + 2568 + ], + [ + 2585, + 2586 + ], + [ + 2588, + 2590 + ], + [ + 2593, + 2594 + ], + [ + 2595, + 2596 + ], + [ + 2597, + 2598 + ], + [ + 2603, + 2604 + ], + [ + 2605, + 2612 + ], + [ + 2621, + 2627 + ], + [ + 2631, + 2632 + ], + [ + 2633, + 2637 + ], + [ + 2639, + 2640 + ], + [ + 2647, + 2648 + ], + [ + 2649, + 2650 + ], + [ + 2655, + 2656 + ], + [ + 2659, + 2660 + ], + [ + 2661, + 2663 + ], + [ + 2668, + 2669 + ], + [ + 2672, + 2674 + ], + [ + 2678, + 2679 + ], + [ + 2683, + 2686 + ], + [ + 2687, + 2688 + ], + [ + 2689, + 2693 + ], + [ + 2700, + 2701 + ], + [ + 2702, + 2706 + ], + [ + 2715, + 2716 + ], + [ + 2717, + 2719 + ], + [ + 2722, + 2723 + ], + [ + 2725, + 2727 + ], + [ + 2736, + 2739 + ], + [ + 2740, + 2745 + ], + [ + 2746, + 2749 + ], + [ + 2753, + 2757 + ], + [ + 2760, + 2762 + ], + [ + 2763, + 2764 + ], + [ + 2769, + 2770 + ], + [ + 2778, + 2794 + ], + [ + 2797, + 2799 + ], + [ + 2800, + 2803 + ], + [ + 2810, + 2811 + ], + [ + 2816, + 2818 + ], + [ + 2824, + 2842 + ], + [ + 2847, + 2848 + ], + [ + 2852, + 2853 + ], + [ + 2855, + 2859 + ], + [ + 2861, + 2868 + ], + [ + 2870, + 2872 + ], + [ + 2873, + 2876 + ], + [ + 2877, + 2881 + ], + [ + 2885, + 2887 + ], + [ + 2889, + 2891 + ], + [ + 2893, + 2898 + ], + [ + 2901, + 2902 + ], + [ + 2904, + 2918 + ], + [ + 2920, + 2926 + ], + [ + 2928, + 2932 + ], + [ + 2936, + 2937 + ], + [ + 2939, + 2943 + ], + [ + 2945, + 2947 + ], + [ + 2949, + 2953 + ], + [ + 2958, + 2959 + ], + [ + 2961, + 2965 + ], + [ + 2969, + 2972 + ], + [ + 2976, + 2982 + ], + [ + 2984, + 2992 + ], + [ + 3010, + 3011 + ], + [ + 3012, + 3014 + ], + [ + 3021, + 3024 + ], + [ + 3027, + 3029 + ], + [ + 3033, + 3039 + ], + [ + 3049, + 3051 + ], + [ + 3053, + 3056 + ], + [ + 3060, + 3065 + ], + [ + 3071, + 3072 + ], + [ + 3075, + 3076 + ], + [ + 3077, + 3078 + ], + [ + 3081, + 3082 + ], + [ + 3087, + 3089 + ], + [ + 3090, + 3094 + ], + [ + 3096, + 3097 + ], + [ + 3098, + 3100 + ], + [ + 3102, + 3103 + ], + [ + 3106, + 3107 + ], + [ + 3109, + 3112 + ], + [ + 3114, + 3115 + ], + [ + 3116, + 3120 + ], + [ + 3121, + 3122 + ], + [ + 3123, + 3126 + ], + [ + 3127, + 3128 + ], + [ + 3129, + 3130 + ], + [ + 3131, + 3132 + ], + [ + 3134, + 3135 + ], + [ + 3138, + 3141 + ], + [ + 3143, + 3146 + ], + [ + 3147, + 3152 + ], + [ + 3160, + 3161 + ], + [ + 3163, + 3164 + ], + [ + 3166, + 3167 + ], + [ + 3173, + 3174 + ], + [ + 3175, + 3176 + ], + [ + 3178, + 3179 + ], + [ + 3180, + 3181 + ], + [ + 3182, + 3183 + ], + [ + 3186, + 3187 + ], + [ + 3188, + 3189 + ], + [ + 3192, + 3193 + ], + [ + 3194, + 3195 + ], + [ + 3198, + 3200 + ], + [ + 3205, + 3209 + ], + [ + 3210, + 3212 + ], + [ + 3213, + 3217 + ], + [ + 3222, + 3223 + ], + [ + 3224, + 3225 + ], + [ + 3228, + 3230 + ], + [ + 3234, + 3235 + ], + [ + 3239, + 3243 + ], + [ + 3244, + 3247 + ], + [ + 3249, + 3251 + ], + [ + 3256, + 3257 + ], + [ + 3258, + 3259 + ] + ] + } + }, + { + "filename": "libvips/foreign/tiffload.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 61, + 72 + ], + [ + 81, + 166 + ], + [ + 176, + 229 + ], + [ + 236, + 299 + ], + [ + 301, + 353 + ], + [ + 355, + 378 + ], + [ + 386, + 433 + ], + [ + 434, + 455 + ], + [ + 464, + 496 + ], + [ + 503, + 510 + ], + [ + 511, + 527 + ], + [ + 534, + 556 + ], + [ + 557, + 572 + ], + [ + 578, + 603 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 64, + 65 + ], + [ + 68, + 69 + ], + [ + 84, + 86 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 103, + 104 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 117, + 121 + ], + [ + 122, + 123 + ], + [ + 126, + 127 + ], + [ + 130, + 131 + ], + [ + 134, + 135 + ], + [ + 138, + 142 + ], + [ + 143, + 144 + ], + [ + 147, + 148 + ], + [ + 151, + 155 + ], + [ + 156, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 179, + 180 + ], + [ + 185, + 186 + ], + [ + 191, + 194 + ], + [ + 195, + 197 + ], + [ + 198, + 201 + ], + [ + 202, + 204 + ], + [ + 205, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 215 + ], + [ + 216, + 218 + ], + [ + 221, + 222 + ], + [ + 223, + 226 + ], + [ + 239, + 241 + ], + [ + 243, + 244 + ], + [ + 246, + 247 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 269 + ], + [ + 270, + 271 + ], + [ + 272, + 273 + ], + [ + 279, + 280 + ], + [ + 286, + 292 + ], + [ + 295, + 296 + ], + [ + 304, + 305 + ], + [ + 310, + 312 + ], + [ + 314, + 315 + ], + [ + 319, + 323 + ], + [ + 324, + 326 + ], + [ + 327, + 328 + ], + [ + 331, + 332 + ], + [ + 336, + 340 + ], + [ + 341, + 342 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 358, + 359 + ], + [ + 365, + 371 + ], + [ + 374, + 375 + ], + [ + 389, + 391 + ], + [ + 393, + 394 + ], + [ + 396, + 397 + ], + [ + 399, + 404 + ], + [ + 405, + 407 + ], + [ + 408, + 409 + ], + [ + 412, + 413 + ], + [ + 417, + 421 + ], + [ + 422, + 423 + ], + [ + 426, + 428 + ], + [ + 429, + 430 + ], + [ + 437, + 438 + ], + [ + 442, + 448 + ], + [ + 451, + 452 + ], + [ + 467, + 468 + ], + [ + 471, + 473 + ], + [ + 476, + 477 + ], + [ + 480, + 482 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 487, + 489 + ], + [ + 492, + 493 + ], + [ + 506, + 507 + ], + [ + 514, + 515 + ], + [ + 519, + 522 + ], + [ + 523, + 524 + ], + [ + 537, + 538 + ], + [ + 542, + 543 + ], + [ + 544, + 546 + ], + [ + 552, + 553 + ], + [ + 560, + 561 + ], + [ + 562, + 565 + ], + [ + 566, + 567 + ], + [ + 568, + 569 + ], + [ + 581, + 582 + ], + [ + 585, + 586 + ], + [ + 592, + 593 + ], + [ + 597, + 600 + ], + [ + 601, + 602 + ] + ] + } + }, + { + "filename": "libvips/foreign/tiffsave.c", + "line_filter": { + "diff_chunks": [ + [ + 34, + 62 + ], + [ + 94, + 101 + ], + [ + 119, + 136 + ], + [ + 142, + 151 + ], + [ + 155, + 185 + ], + [ + 188, + 245 + ], + [ + 248, + 255 + ], + [ + 256, + 428 + ], + [ + 434, + 441 + ], + [ + 446, + 547 + ], + [ + 552, + 607 + ], + [ + 608, + 616 + ], + [ + 640, + 657 + ], + [ + 660, + 674 + ], + [ + 696, + 711 + ], + [ + 715, + 728 + ], + [ + 733, + 754 + ], + [ + 776, + 783 + ], + [ + 787, + 818 + ], + [ + 851, + 865 + ] + ], + "lines_added": [ + [ + 37, + 53 + ], + [ + 58, + 59 + ], + [ + 97, + 98 + ], + [ + 122, + 124 + ], + [ + 126, + 127 + ], + [ + 130, + 131 + ], + [ + 132, + 133 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 158, + 160 + ], + [ + 164, + 168 + ], + [ + 169, + 171 + ], + [ + 173, + 175 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 191, + 197 + ], + [ + 199, + 200 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 211, + 236 + ], + [ + 239, + 240 + ], + [ + 241, + 242 + ], + [ + 251, + 252 + ], + [ + 259, + 262 + ], + [ + 263, + 266 + ], + [ + 267, + 270 + ], + [ + 271, + 273 + ], + [ + 274, + 277 + ], + [ + 278, + 281 + ], + [ + 282, + 285 + ], + [ + 286, + 288 + ], + [ + 289, + 292 + ], + [ + 293, + 295 + ], + [ + 296, + 299 + ], + [ + 300, + 302 + ], + [ + 303, + 306 + ], + [ + 307, + 309 + ], + [ + 310, + 313 + ], + [ + 314, + 316 + ], + [ + 317, + 320 + ], + [ + 321, + 323 + ], + [ + 324, + 327 + ], + [ + 328, + 330 + ], + [ + 331, + 334 + ], + [ + 335, + 337 + ], + [ + 338, + 341 + ], + [ + 342, + 344 + ], + [ + 345, + 348 + ], + [ + 349, + 351 + ], + [ + 352, + 355 + ], + [ + 356, + 358 + ], + [ + 359, + 362 + ], + [ + 363, + 365 + ], + [ + 366, + 369 + ], + [ + 370, + 372 + ], + [ + 373, + 376 + ], + [ + 377, + 379 + ], + [ + 380, + 383 + ], + [ + 384, + 386 + ], + [ + 387, + 390 + ], + [ + 391, + 393 + ], + [ + 394, + 397 + ], + [ + 398, + 400 + ], + [ + 401, + 404 + ], + [ + 405, + 411 + ], + [ + 412, + 414 + ], + [ + 415, + 421 + ], + [ + 424, + 425 + ], + [ + 437, + 438 + ], + [ + 449, + 451 + ], + [ + 453, + 454 + ], + [ + 456, + 457 + ], + [ + 460, + 461 + ], + [ + 462, + 464 + ], + [ + 465, + 466 + ], + [ + 469, + 471 + ], + [ + 472, + 473 + ], + [ + 479, + 480 + ], + [ + 482, + 488 + ], + [ + 491, + 492 + ], + [ + 498, + 499 + ], + [ + 503, + 505 + ], + [ + 507, + 508 + ], + [ + 512, + 514 + ], + [ + 515, + 517 + ], + [ + 518, + 519 + ], + [ + 522, + 523 + ], + [ + 524, + 525 + ], + [ + 531, + 532 + ], + [ + 534, + 540 + ], + [ + 543, + 544 + ], + [ + 555, + 557 + ], + [ + 559, + 560 + ], + [ + 562, + 563 + ], + [ + 567, + 569 + ], + [ + 570, + 572 + ], + [ + 573, + 576 + ], + [ + 577, + 578 + ], + [ + 581, + 583 + ], + [ + 584, + 585 + ], + [ + 591, + 592 + ], + [ + 594, + 600 + ], + [ + 603, + 604 + ], + [ + 611, + 613 + ], + [ + 643, + 644 + ], + [ + 646, + 647 + ], + [ + 648, + 651 + ], + [ + 653, + 654 + ], + [ + 663, + 665 + ], + [ + 667, + 669 + ], + [ + 670, + 671 + ], + [ + 699, + 704 + ], + [ + 707, + 708 + ], + [ + 718, + 719 + ], + [ + 720, + 721 + ], + [ + 724, + 725 + ], + [ + 736, + 737 + ], + [ + 741, + 744 + ], + [ + 745, + 746 + ], + [ + 750, + 751 + ], + [ + 779, + 780 + ], + [ + 790, + 791 + ], + [ + 796, + 797 + ], + [ + 798, + 801 + ], + [ + 802, + 805 + ], + [ + 808, + 809 + ], + [ + 811, + 812 + ], + [ + 814, + 815 + ], + [ + 854, + 855 + ], + [ + 859, + 862 + ], + [ + 863, + 864 + ] + ] + } + }, + { + "filename": "libvips/foreign/vips2jpeg.c", + "line_filter": { + "diff_chunks": [ + [ + 45, + 58 + ], + [ + 70, + 77 + ], + [ + 98, + 132 + ], + [ + 154, + 205 + ], + [ + 206, + 239 + ], + [ + 242, + 347 + ], + [ + 355, + 423 + ], + [ + 425, + 454 + ], + [ + 455, + 464 + ], + [ + 468, + 546 + ], + [ + 550, + 703 + ], + [ + 707, + 765 + ], + [ + 780, + 808 + ], + [ + 812, + 840 + ], + [ + 844, + 890 + ] + ], + "lines_added": [ + [ + 48, + 49 + ], + [ + 54, + 55 + ], + [ + 73, + 74 + ], + [ + 101, + 102 + ], + [ + 107, + 108 + ], + [ + 109, + 113 + ], + [ + 114, + 123 + ], + [ + 128, + 129 + ], + [ + 157, + 161 + ], + [ + 165, + 166 + ], + [ + 169, + 171 + ], + [ + 173, + 174 + ], + [ + 180, + 181 + ], + [ + 185, + 186 + ], + [ + 190, + 192 + ], + [ + 197, + 198 + ], + [ + 201, + 202 + ], + [ + 209, + 210 + ], + [ + 215, + 216 + ], + [ + 217, + 221 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 232 + ], + [ + 235, + 236 + ], + [ + 245, + 248 + ], + [ + 250, + 251 + ], + [ + 254, + 255 + ], + [ + 259, + 263 + ], + [ + 268, + 269 + ], + [ + 273, + 277 + ], + [ + 279, + 281 + ], + [ + 283, + 286 + ], + [ + 288, + 289 + ], + [ + 294, + 295 + ], + [ + 300, + 305 + ], + [ + 306, + 310 + ], + [ + 314, + 315 + ], + [ + 317, + 320 + ], + [ + 325, + 331 + ], + [ + 332, + 333 + ], + [ + 334, + 335 + ], + [ + 338, + 339 + ], + [ + 340, + 342 + ], + [ + 343, + 344 + ], + [ + 358, + 361 + ], + [ + 362, + 412 + ], + [ + 418, + 420 + ], + [ + 428, + 432 + ], + [ + 433, + 434 + ], + [ + 437, + 438 + ], + [ + 439, + 441 + ], + [ + 444, + 446 + ], + [ + 449, + 451 + ], + [ + 458, + 461 + ], + [ + 471, + 472 + ], + [ + 475, + 477 + ], + [ + 478, + 479 + ], + [ + 480, + 481 + ], + [ + 482, + 483 + ], + [ + 485, + 488 + ], + [ + 490, + 491 + ], + [ + 493, + 494 + ], + [ + 497, + 498 + ], + [ + 502, + 506 + ], + [ + 508, + 510 + ], + [ + 512, + 513 + ], + [ + 516, + 517 + ], + [ + 521, + 524 + ], + [ + 527, + 529 + ], + [ + 530, + 531 + ], + [ + 532, + 533 + ], + [ + 538, + 540 + ], + [ + 542, + 543 + ], + [ + 553, + 558 + ], + [ + 559, + 563 + ], + [ + 566, + 568 + ], + [ + 569, + 571 + ], + [ + 574, + 576 + ], + [ + 578, + 579 + ], + [ + 580, + 581 + ], + [ + 582, + 583 + ], + [ + 586, + 587 + ], + [ + 590, + 592 + ], + [ + 596, + 599 + ], + [ + 603, + 604 + ], + [ + 605, + 606 + ], + [ + 611, + 612 + ], + [ + 615, + 616 + ], + [ + 618, + 623 + ], + [ + 625, + 627 + ], + [ + 629, + 630 + ], + [ + 632, + 640 + ], + [ + 642, + 643 + ], + [ + 645, + 654 + ], + [ + 655, + 658 + ], + [ + 662, + 667 + ], + [ + 668, + 670 + ], + [ + 672, + 673 + ], + [ + 675, + 683 + ], + [ + 687, + 688 + ], + [ + 691, + 693 + ], + [ + 694, + 695 + ], + [ + 696, + 697 + ], + [ + 699, + 700 + ], + [ + 710, + 712 + ], + [ + 718, + 719 + ], + [ + 722, + 723 + ], + [ + 726, + 735 + ], + [ + 736, + 739 + ], + [ + 741, + 744 + ], + [ + 749, + 751 + ], + [ + 754, + 756 + ], + [ + 759, + 760 + ], + [ + 761, + 762 + ], + [ + 783, + 784 + ], + [ + 787, + 788 + ], + [ + 791, + 794 + ], + [ + 798, + 799 + ], + [ + 804, + 805 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 819, + 822 + ], + [ + 823, + 825 + ], + [ + 830, + 831 + ], + [ + 834, + 837 + ], + [ + 847, + 849 + ], + [ + 853, + 854 + ], + [ + 857, + 859 + ], + [ + 861, + 863 + ], + [ + 865, + 866 + ], + [ + 867, + 868 + ], + [ + 869, + 870 + ], + [ + 873, + 874 + ], + [ + 877, + 883 + ], + [ + 884, + 885 + ], + [ + 886, + 887 + ] + ] + } + }, + { + "filename": "libvips/foreign/vips2magick.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 9, + 16 + ], + [ + 20, + 48 + ], + [ + 66, + 73 + ], + [ + 93, + 127 + ], + [ + 129, + 141 + ], + [ + 143, + 173 + ], + [ + 175, + 237 + ], + [ + 239, + 290 + ], + [ + 292, + 301 + ], + [ + 316, + 435 + ], + [ + 449, + 458 + ], + [ + 462, + 469 + ], + [ + 479, + 529 + ], + [ + 535, + 591 + ], + [ + 599, + 681 + ], + [ + 684, + 714 + ], + [ + 717, + 747 + ], + [ + 750, + 780 + ], + [ + 783, + 795 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 12, + 13 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 69, + 70 + ], + [ + 96, + 98 + ], + [ + 100, + 101 + ], + [ + 105, + 106 + ], + [ + 108, + 114 + ], + [ + 115, + 116 + ], + [ + 121, + 122 + ], + [ + 123, + 124 + ], + [ + 132, + 133 + ], + [ + 134, + 138 + ], + [ + 146, + 151 + ], + [ + 152, + 153 + ], + [ + 156, + 160 + ], + [ + 165, + 166 + ], + [ + 167, + 170 + ], + [ + 178, + 180 + ], + [ + 185, + 186 + ], + [ + 188, + 190 + ], + [ + 193, + 196 + ], + [ + 202, + 206 + ], + [ + 209, + 211 + ], + [ + 217, + 218 + ], + [ + 219, + 222 + ], + [ + 226, + 227 + ], + [ + 229, + 231 + ], + [ + 233, + 234 + ], + [ + 242, + 257 + ], + [ + 261, + 264 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 282, + 283 + ], + [ + 285, + 287 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 319, + 322 + ], + [ + 324, + 325 + ], + [ + 326, + 327 + ], + [ + 330, + 331 + ], + [ + 334, + 335 + ], + [ + 338, + 340 + ], + [ + 341, + 342 + ], + [ + 345, + 346 + ], + [ + 349, + 352 + ], + [ + 354, + 361 + ], + [ + 362, + 365 + ], + [ + 367, + 368 + ], + [ + 370, + 371 + ], + [ + 375, + 381 + ], + [ + 383, + 386 + ], + [ + 387, + 393 + ], + [ + 394, + 395 + ], + [ + 398, + 404 + ], + [ + 405, + 406 + ], + [ + 408, + 409 + ], + [ + 413, + 421 + ], + [ + 424, + 425 + ], + [ + 431, + 432 + ], + [ + 452, + 453 + ], + [ + 454, + 455 + ], + [ + 465, + 466 + ], + [ + 482, + 485 + ], + [ + 486, + 488 + ], + [ + 489, + 492 + ], + [ + 493, + 495 + ], + [ + 496, + 499 + ], + [ + 500, + 502 + ], + [ + 503, + 506 + ], + [ + 507, + 514 + ], + [ + 515, + 516 + ], + [ + 520, + 521 + ], + [ + 525, + 526 + ], + [ + 538, + 540 + ], + [ + 542, + 543 + ], + [ + 544, + 545 + ], + [ + 548, + 549 + ], + [ + 550, + 552 + ], + [ + 553, + 557 + ], + [ + 558, + 559 + ], + [ + 561, + 562 + ], + [ + 566, + 567 + ], + [ + 568, + 569 + ], + [ + 575, + 576 + ], + [ + 578, + 581 + ], + [ + 582, + 584 + ], + [ + 587, + 588 + ], + [ + 602, + 604 + ], + [ + 606, + 607 + ], + [ + 608, + 609 + ], + [ + 610, + 611 + ], + [ + 617, + 619 + ], + [ + 620, + 624 + ], + [ + 625, + 626 + ], + [ + 628, + 631 + ], + [ + 632, + 633 + ], + [ + 636, + 638 + ], + [ + 639, + 640 + ], + [ + 646, + 647 + ], + [ + 649, + 652 + ], + [ + 653, + 655 + ], + [ + 658, + 659 + ], + [ + 665, + 667 + ], + [ + 669, + 671 + ], + [ + 677, + 678 + ], + [ + 687, + 688 + ], + [ + 691, + 692 + ], + [ + 697, + 700 + ], + [ + 703, + 704 + ], + [ + 710, + 711 + ], + [ + 720, + 722 + ], + [ + 725, + 726 + ], + [ + 731, + 733 + ], + [ + 735, + 737 + ], + [ + 743, + 744 + ], + [ + 753, + 754 + ], + [ + 757, + 758 + ], + [ + 763, + 766 + ], + [ + 769, + 770 + ], + [ + 776, + 777 + ], + [ + 786, + 788 + ], + [ + 791, + 792 + ] + ] + } + }, + { + "filename": "libvips/foreign/vips2tiff.c", + "line_filter": { + "diff_chunks": [ + [ + 7, + 14 + ], + [ + 69, + 76 + ], + [ + 80, + 91 + ], + [ + 95, + 102 + ], + [ + 169, + 177 + ], + [ + 208, + 240 + ], + [ + 293, + 311 + ], + [ + 312, + 333 + ], + [ + 336, + 368 + ], + [ + 378, + 385 + ], + [ + 386, + 448 + ], + [ + 458, + 471 + ], + [ + 472, + 482 + ], + [ + 500, + 719 + ], + [ + 724, + 1012 + ], + [ + 1013, + 1083 + ], + [ + 1089, + 1112 + ], + [ + 1114, + 1121 + ], + [ + 1136, + 1166 + ], + [ + 1168, + 1198 + ], + [ + 1201, + 1292 + ], + [ + 1300, + 1307 + ], + [ + 1309, + 1329 + ], + [ + 1332, + 1401 + ], + [ + 1405, + 1426 + ], + [ + 1430, + 1451 + ], + [ + 1455, + 1463 + ], + [ + 1467, + 1497 + ], + [ + 1499, + 1506 + ], + [ + 1512, + 1536 + ], + [ + 1538, + 1545 + ], + [ + 1555, + 1569 + ], + [ + 1571, + 1673 + ], + [ + 1678, + 1694 + ], + [ + 1696, + 1703 + ], + [ + 1707, + 1718 + ], + [ + 1720, + 1738 + ], + [ + 1739, + 1746 + ], + [ + 1748, + 1769 + ], + [ + 1774, + 1830 + ], + [ + 1834, + 1841 + ], + [ + 1844, + 1866 + ], + [ + 1867, + 1950 + ], + [ + 1953, + 2201 + ], + [ + 2213, + 2251 + ], + [ + 2254, + 2289 + ] + ], + "lines_added": [ + [ + 10, + 11 + ], + [ + 72, + 73 + ], + [ + 83, + 84 + ], + [ + 87, + 88 + ], + [ + 98, + 99 + ], + [ + 172, + 174 + ], + [ + 211, + 212 + ], + [ + 213, + 217 + ], + [ + 218, + 227 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 296, + 297 + ], + [ + 302, + 305 + ], + [ + 307, + 308 + ], + [ + 315, + 316 + ], + [ + 319, + 321 + ], + [ + 322, + 324 + ], + [ + 329, + 330 + ], + [ + 339, + 359 + ], + [ + 360, + 365 + ], + [ + 381, + 382 + ], + [ + 389, + 390 + ], + [ + 393, + 395 + ], + [ + 396, + 397 + ], + [ + 398, + 399 + ], + [ + 400, + 401 + ], + [ + 403, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 410 + ], + [ + 415, + 416 + ], + [ + 420, + 423 + ], + [ + 425, + 426 + ], + [ + 428, + 429 + ], + [ + 432, + 434 + ], + [ + 435, + 437 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 444, + 445 + ], + [ + 461, + 462 + ], + [ + 463, + 464 + ], + [ + 465, + 468 + ], + [ + 475, + 476 + ], + [ + 478, + 479 + ], + [ + 503, + 509 + ], + [ + 513, + 514 + ], + [ + 515, + 518 + ], + [ + 519, + 523 + ], + [ + 524, + 525 + ], + [ + 528, + 529 + ], + [ + 533, + 539 + ], + [ + 541, + 542 + ], + [ + 544, + 545 + ], + [ + 548, + 549 + ], + [ + 553, + 558 + ], + [ + 562, + 564 + ], + [ + 570, + 571 + ], + [ + 573, + 574 + ], + [ + 576, + 577 + ], + [ + 580, + 581 + ], + [ + 585, + 591 + ], + [ + 593, + 594 + ], + [ + 596, + 597 + ], + [ + 603, + 604 + ], + [ + 605, + 606 + ], + [ + 608, + 612 + ], + [ + 616, + 623 + ], + [ + 626, + 627 + ], + [ + 629, + 630 + ], + [ + 632, + 633 + ], + [ + 635, + 636 + ], + [ + 640, + 641 + ], + [ + 643, + 645 + ], + [ + 649, + 654 + ], + [ + 655, + 657 + ], + [ + 659, + 662 + ], + [ + 663, + 668 + ], + [ + 671, + 675 + ], + [ + 676, + 678 + ], + [ + 684, + 702 + ], + [ + 705, + 709 + ], + [ + 710, + 716 + ], + [ + 727, + 731 + ], + [ + 732, + 733 + ], + [ + 734, + 735 + ], + [ + 737, + 738 + ], + [ + 740, + 742 + ], + [ + 745, + 746 + ], + [ + 751, + 753 + ], + [ + 754, + 758 + ], + [ + 760, + 762 + ], + [ + 763, + 764 + ], + [ + 766, + 767 + ], + [ + 769, + 770 + ], + [ + 775, + 777 + ], + [ + 781, + 782 + ], + [ + 788, + 791 + ], + [ + 796, + 797 + ], + [ + 801, + 805 + ], + [ + 807, + 808 + ], + [ + 812, + 815 + ], + [ + 817, + 818 + ], + [ + 819, + 820 + ], + [ + 822, + 824 + ], + [ + 826, + 827 + ], + [ + 828, + 830 + ], + [ + 836, + 838 + ], + [ + 840, + 841 + ], + [ + 842, + 843 + ], + [ + 844, + 845 + ], + [ + 846, + 847 + ], + [ + 848, + 849 + ], + [ + 851, + 852 + ], + [ + 855, + 856 + ], + [ + 859, + 860 + ], + [ + 861, + 863 + ], + [ + 868, + 869 + ], + [ + 870, + 872 + ], + [ + 876, + 877 + ], + [ + 880, + 881 + ], + [ + 884, + 885 + ], + [ + 886, + 888 + ], + [ + 889, + 892 + ], + [ + 895, + 897 + ], + [ + 901, + 903 + ], + [ + 904, + 908 + ], + [ + 910, + 912 + ], + [ + 913, + 915 + ], + [ + 917, + 921 + ], + [ + 922, + 926 + ], + [ + 928, + 929 + ], + [ + 934, + 935 + ], + [ + 938, + 942 + ], + [ + 947, + 948 + ], + [ + 949, + 951 + ], + [ + 952, + 953 + ], + [ + 956, + 957 + ], + [ + 962, + 964 + ], + [ + 965, + 969 + ], + [ + 972, + 973 + ], + [ + 974, + 975 + ], + [ + 976, + 977 + ], + [ + 978, + 979 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 984, + 985 + ], + [ + 986, + 987 + ], + [ + 989, + 990 + ], + [ + 991, + 992 + ], + [ + 994, + 996 + ], + [ + 997, + 998 + ], + [ + 1002, + 1003 + ], + [ + 1004, + 1005 + ], + [ + 1006, + 1007 + ], + [ + 1008, + 1009 + ], + [ + 1016, + 1017 + ], + [ + 1022, + 1023 + ], + [ + 1028, + 1029 + ], + [ + 1030, + 1033 + ], + [ + 1037, + 1039 + ], + [ + 1041, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1050, + 1053 + ], + [ + 1054, + 1055 + ], + [ + 1060, + 1061 + ], + [ + 1063, + 1067 + ], + [ + 1068, + 1069 + ], + [ + 1074, + 1075 + ], + [ + 1078, + 1080 + ], + [ + 1092, + 1093 + ], + [ + 1094, + 1095 + ], + [ + 1097, + 1098 + ], + [ + 1101, + 1103 + ], + [ + 1108, + 1109 + ], + [ + 1117, + 1118 + ], + [ + 1139, + 1142 + ], + [ + 1146, + 1147 + ], + [ + 1151, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1157, + 1163 + ], + [ + 1171, + 1172 + ], + [ + 1176, + 1177 + ], + [ + 1181, + 1183 + ], + [ + 1185, + 1186 + ], + [ + 1187, + 1195 + ], + [ + 1204, + 1206 + ], + [ + 1211, + 1218 + ], + [ + 1223, + 1229 + ], + [ + 1235, + 1236 + ], + [ + 1237, + 1242 + ], + [ + 1245, + 1249 + ], + [ + 1251, + 1252 + ], + [ + 1254, + 1261 + ], + [ + 1266, + 1267 + ], + [ + 1268, + 1274 + ], + [ + 1275, + 1276 + ], + [ + 1278, + 1279 + ], + [ + 1284, + 1285 + ], + [ + 1288, + 1289 + ], + [ + 1303, + 1304 + ], + [ + 1312, + 1313 + ], + [ + 1315, + 1316 + ], + [ + 1319, + 1320 + ], + [ + 1321, + 1322 + ], + [ + 1325, + 1326 + ], + [ + 1335, + 1336 + ], + [ + 1337, + 1357 + ], + [ + 1363, + 1364 + ], + [ + 1368, + 1369 + ], + [ + 1370, + 1371 + ], + [ + 1373, + 1374 + ], + [ + 1377, + 1378 + ], + [ + 1381, + 1382 + ], + [ + 1385, + 1386 + ], + [ + 1389, + 1390 + ], + [ + 1393, + 1394 + ], + [ + 1397, + 1398 + ], + [ + 1408, + 1409 + ], + [ + 1415, + 1416 + ], + [ + 1418, + 1421 + ], + [ + 1422, + 1423 + ], + [ + 1433, + 1434 + ], + [ + 1440, + 1441 + ], + [ + 1443, + 1446 + ], + [ + 1447, + 1448 + ], + [ + 1458, + 1460 + ], + [ + 1470, + 1490 + ], + [ + 1491, + 1494 + ], + [ + 1502, + 1503 + ], + [ + 1515, + 1516 + ], + [ + 1522, + 1523 + ], + [ + 1525, + 1526 + ], + [ + 1527, + 1528 + ], + [ + 1530, + 1533 + ], + [ + 1541, + 1542 + ], + [ + 1558, + 1559 + ], + [ + 1562, + 1563 + ], + [ + 1564, + 1566 + ], + [ + 1574, + 1577 + ], + [ + 1579, + 1580 + ], + [ + 1581, + 1582 + ], + [ + 1583, + 1585 + ], + [ + 1586, + 1592 + ], + [ + 1597, + 1605 + ], + [ + 1609, + 1610 + ], + [ + 1615, + 1616 + ], + [ + 1619, + 1620 + ], + [ + 1624, + 1626 + ], + [ + 1628, + 1630 + ], + [ + 1633, + 1635 + ], + [ + 1637, + 1640 + ], + [ + 1642, + 1644 + ], + [ + 1646, + 1648 + ], + [ + 1650, + 1653 + ], + [ + 1656, + 1658 + ], + [ + 1660, + 1661 + ], + [ + 1663, + 1664 + ], + [ + 1669, + 1670 + ], + [ + 1681, + 1682 + ], + [ + 1688, + 1689 + ], + [ + 1690, + 1691 + ], + [ + 1699, + 1700 + ], + [ + 1710, + 1711 + ], + [ + 1713, + 1715 + ], + [ + 1723, + 1727 + ], + [ + 1730, + 1731 + ], + [ + 1733, + 1735 + ], + [ + 1742, + 1743 + ], + [ + 1751, + 1753 + ], + [ + 1754, + 1757 + ], + [ + 1758, + 1761 + ], + [ + 1762, + 1763 + ], + [ + 1764, + 1766 + ], + [ + 1777, + 1778 + ], + [ + 1779, + 1780 + ], + [ + 1782, + 1783 + ], + [ + 1785, + 1791 + ], + [ + 1793, + 1796 + ], + [ + 1799, + 1802 + ], + [ + 1804, + 1805 + ], + [ + 1807, + 1808 + ], + [ + 1811, + 1812 + ], + [ + 1813, + 1814 + ], + [ + 1817, + 1820 + ], + [ + 1824, + 1825 + ], + [ + 1826, + 1827 + ], + [ + 1837, + 1838 + ], + [ + 1847, + 1848 + ], + [ + 1851, + 1852 + ], + [ + 1856, + 1857 + ], + [ + 1861, + 1863 + ], + [ + 1870, + 1874 + ], + [ + 1877, + 1878 + ], + [ + 1882, + 1885 + ], + [ + 1887, + 1888 + ], + [ + 1889, + 1890 + ], + [ + 1895, + 1899 + ], + [ + 1901, + 1902 + ], + [ + 1906, + 1907 + ], + [ + 1908, + 1909 + ], + [ + 1911, + 1914 + ], + [ + 1916, + 1917 + ], + [ + 1919, + 1925 + ], + [ + 1928, + 1933 + ], + [ + 1937, + 1938 + ], + [ + 1939, + 1940 + ], + [ + 1942, + 1943 + ], + [ + 1946, + 1947 + ], + [ + 1956, + 1978 + ], + [ + 1982, + 1984 + ], + [ + 1987, + 1990 + ], + [ + 1991, + 1996 + ], + [ + 2001, + 2003 + ], + [ + 2009, + 2012 + ], + [ + 2013, + 2018 + ], + [ + 2021, + 2025 + ], + [ + 2028, + 2040 + ], + [ + 2045, + 2046 + ], + [ + 2050, + 2051 + ], + [ + 2053, + 2057 + ], + [ + 2061, + 2062 + ], + [ + 2064, + 2067 + ], + [ + 2068, + 2071 + ], + [ + 2073, + 2074 + ], + [ + 2075, + 2078 + ], + [ + 2080, + 2081 + ], + [ + 2082, + 2084 + ], + [ + 2086, + 2087 + ], + [ + 2090, + 2091 + ], + [ + 2093, + 2094 + ], + [ + 2096, + 2097 + ], + [ + 2099, + 2101 + ], + [ + 2104, + 2106 + ], + [ + 2110, + 2111 + ], + [ + 2115, + 2116 + ], + [ + 2118, + 2119 + ], + [ + 2121, + 2135 + ], + [ + 2138, + 2139 + ], + [ + 2142, + 2143 + ], + [ + 2145, + 2146 + ], + [ + 2148, + 2150 + ], + [ + 2153, + 2154 + ], + [ + 2156, + 2158 + ], + [ + 2160, + 2161 + ], + [ + 2164, + 2166 + ], + [ + 2169, + 2171 + ], + [ + 2172, + 2173 + ], + [ + 2179, + 2180 + ], + [ + 2186, + 2187 + ], + [ + 2188, + 2189 + ], + [ + 2193, + 2195 + ], + [ + 2197, + 2198 + ], + [ + 2216, + 2217 + ], + [ + 2220, + 2223 + ], + [ + 2226, + 2228 + ], + [ + 2231, + 2234 + ], + [ + 2240, + 2241 + ], + [ + 2242, + 2243 + ], + [ + 2245, + 2248 + ], + [ + 2257, + 2258 + ], + [ + 2259, + 2260 + ], + [ + 2264, + 2265 + ], + [ + 2270, + 2281 + ], + [ + 2283, + 2284 + ], + [ + 2285, + 2286 + ] + ] + } + }, + { + "filename": "libvips/foreign/vipsload.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 56, + 158 + ], + [ + 162, + 176 + ], + [ + 182, + 219 + ], + [ + 221, + 244 + ], + [ + 250, + 319 + ], + [ + 322, + 345 + ], + [ + 347, + 366 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 59, + 61 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 73, + 74 + ], + [ + 80, + 82 + ], + [ + 84, + 85 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 96, + 97 + ], + [ + 101, + 105 + ], + [ + 106, + 107 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 120, + 125 + ], + [ + 127, + 129 + ], + [ + 131, + 132 + ], + [ + 133, + 136 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 154, + 155 + ], + [ + 165, + 166 + ], + [ + 172, + 173 + ], + [ + 185, + 187 + ], + [ + 189, + 190 + ], + [ + 194, + 197 + ], + [ + 198, + 200 + ], + [ + 201, + 202 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 224, + 225 + ], + [ + 231, + 237 + ], + [ + 240, + 241 + ], + [ + 253, + 255 + ], + [ + 257, + 258 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 268, + 270 + ], + [ + 271, + 272 + ], + [ + 275, + 276 + ], + [ + 277, + 278 + ], + [ + 281, + 284 + ], + [ + 287, + 288 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 298, + 299 + ], + [ + 303, + 304 + ], + [ + 306, + 312 + ], + [ + 315, + 316 + ], + [ + 325, + 326 + ], + [ + 332, + 333 + ], + [ + 337, + 340 + ], + [ + 341, + 342 + ], + [ + 350, + 351 + ], + [ + 355, + 356 + ], + [ + 360, + 363 + ], + [ + 364, + 365 + ] + ] + } + }, + { + "filename": "libvips/foreign/vipspng.c", + "line_filter": { + "diff_chunks": [ + [ + 51, + 61 + ], + [ + 84, + 119 + ], + [ + 150, + 178 + ], + [ + 203, + 263 + ], + [ + 265, + 278 + ], + [ + 283, + 397 + ], + [ + 403, + 410 + ], + [ + 415, + 465 + ], + [ + 466, + 483 + ], + [ + 485, + 514 + ], + [ + 516, + 533 + ], + [ + 534, + 550 + ], + [ + 552, + 842 + ], + [ + 843, + 857 + ], + [ + 867, + 916 + ], + [ + 917, + 946 + ], + [ + 947, + 981 + ], + [ + 983, + 1027 + ], + [ + 1028, + 1230 + ], + [ + 1231, + 1354 + ] + ], + "lines_added": [ + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 87, + 88 + ], + [ + 94, + 95 + ], + [ + 96, + 100 + ], + [ + 101, + 110 + ], + [ + 115, + 116 + ], + [ + 153, + 154 + ], + [ + 156, + 157 + ], + [ + 159, + 160 + ], + [ + 164, + 165 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 206, + 207 + ], + [ + 212, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 229 + ], + [ + 232, + 233 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 243, + 244 + ], + [ + 246, + 247 + ], + [ + 249, + 253 + ], + [ + 258, + 260 + ], + [ + 268, + 270 + ], + [ + 273, + 275 + ], + [ + 286, + 287 + ], + [ + 288, + 292 + ], + [ + 293, + 297 + ], + [ + 298, + 301 + ], + [ + 302, + 304 + ], + [ + 310, + 311 + ], + [ + 317, + 319 + ], + [ + 323, + 324 + ], + [ + 325, + 328 + ], + [ + 331, + 333 + ], + [ + 334, + 336 + ], + [ + 339, + 340 + ], + [ + 342, + 343 + ], + [ + 345, + 346 + ], + [ + 350, + 351 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 363, + 364 + ], + [ + 367, + 368 + ], + [ + 374, + 376 + ], + [ + 377, + 378 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 387, + 388 + ], + [ + 393, + 394 + ], + [ + 406, + 407 + ], + [ + 418, + 419 + ], + [ + 422, + 424 + ], + [ + 425, + 426 + ], + [ + 427, + 428 + ], + [ + 434, + 437 + ], + [ + 439, + 442 + ], + [ + 444, + 447 + ], + [ + 450, + 452 + ], + [ + 454, + 456 + ], + [ + 461, + 462 + ], + [ + 469, + 471 + ], + [ + 474, + 476 + ], + [ + 478, + 480 + ], + [ + 488, + 491 + ], + [ + 495, + 498 + ], + [ + 499, + 500 + ], + [ + 504, + 506 + ], + [ + 510, + 511 + ], + [ + 519, + 520 + ], + [ + 522, + 524 + ], + [ + 525, + 527 + ], + [ + 528, + 530 + ], + [ + 537, + 539 + ], + [ + 540, + 543 + ], + [ + 545, + 547 + ], + [ + 555, + 556 + ], + [ + 560, + 566 + ], + [ + 570, + 572 + ], + [ + 573, + 575 + ], + [ + 580, + 584 + ], + [ + 587, + 588 + ], + [ + 590, + 593 + ], + [ + 597, + 599 + ], + [ + 600, + 602 + ], + [ + 603, + 635 + ], + [ + 636, + 640 + ], + [ + 644, + 647 + ], + [ + 648, + 652 + ], + [ + 654, + 655 + ], + [ + 660, + 661 + ], + [ + 665, + 666 + ], + [ + 668, + 670 + ], + [ + 671, + 673 + ], + [ + 674, + 678 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 683, + 684 + ], + [ + 687, + 689 + ], + [ + 690, + 691 + ], + [ + 696, + 698 + ], + [ + 703, + 706 + ], + [ + 710, + 711 + ], + [ + 715, + 719 + ], + [ + 721, + 723 + ], + [ + 726, + 731 + ], + [ + 732, + 733 + ], + [ + 735, + 741 + ], + [ + 747, + 751 + ], + [ + 757, + 758 + ], + [ + 761, + 762 + ], + [ + 763, + 766 + ], + [ + 767, + 769 + ], + [ + 772, + 776 + ], + [ + 779, + 788 + ], + [ + 790, + 791 + ], + [ + 794, + 795 + ], + [ + 798, + 801 + ], + [ + 802, + 803 + ], + [ + 806, + 808 + ], + [ + 811, + 814 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 821, + 823 + ], + [ + 826, + 830 + ], + [ + 831, + 832 + ], + [ + 838, + 839 + ], + [ + 846, + 849 + ], + [ + 850, + 852 + ], + [ + 853, + 854 + ], + [ + 870, + 871 + ], + [ + 873, + 874 + ], + [ + 876, + 881 + ], + [ + 884, + 885 + ], + [ + 886, + 887 + ], + [ + 888, + 890 + ], + [ + 893, + 894 + ], + [ + 897, + 899 + ], + [ + 903, + 904 + ], + [ + 906, + 913 + ], + [ + 920, + 922 + ], + [ + 924, + 925 + ], + [ + 928, + 931 + ], + [ + 933, + 936 + ], + [ + 938, + 939 + ], + [ + 942, + 943 + ], + [ + 950, + 953 + ], + [ + 954, + 955 + ], + [ + 956, + 958 + ], + [ + 959, + 960 + ], + [ + 961, + 962 + ], + [ + 963, + 964 + ], + [ + 965, + 966 + ], + [ + 969, + 971 + ], + [ + 977, + 978 + ], + [ + 986, + 987 + ], + [ + 990, + 992 + ], + [ + 995, + 996 + ], + [ + 1000, + 1002 + ], + [ + 1003, + 1008 + ], + [ + 1010, + 1011 + ], + [ + 1013, + 1014 + ], + [ + 1019, + 1020 + ], + [ + 1023, + 1024 + ], + [ + 1031, + 1035 + ], + [ + 1038, + 1040 + ], + [ + 1043, + 1044 + ], + [ + 1045, + 1048 + ], + [ + 1051, + 1053 + ], + [ + 1054, + 1059 + ], + [ + 1063, + 1064 + ], + [ + 1067, + 1068 + ], + [ + 1069, + 1082 + ], + [ + 1084, + 1087 + ], + [ + 1092, + 1093 + ], + [ + 1095, + 1098 + ], + [ + 1104, + 1105 + ], + [ + 1106, + 1109 + ], + [ + 1112, + 1115 + ], + [ + 1118, + 1120 + ], + [ + 1122, + 1125 + ], + [ + 1126, + 1127 + ], + [ + 1129, + 1132 + ], + [ + 1134, + 1137 + ], + [ + 1138, + 1139 + ], + [ + 1141, + 1142 + ], + [ + 1145, + 1148 + ], + [ + 1150, + 1153 + ], + [ + 1159, + 1160 + ], + [ + 1162, + 1163 + ], + [ + 1168, + 1171 + ], + [ + 1175, + 1177 + ], + [ + 1179, + 1180 + ], + [ + 1184, + 1185 + ], + [ + 1187, + 1196 + ], + [ + 1199, + 1200 + ], + [ + 1203, + 1207 + ], + [ + 1210, + 1212 + ], + [ + 1216, + 1218 + ], + [ + 1221, + 1223 + ], + [ + 1226, + 1227 + ], + [ + 1234, + 1237 + ], + [ + 1240, + 1241 + ], + [ + 1242, + 1246 + ], + [ + 1247, + 1250 + ], + [ + 1256, + 1257 + ], + [ + 1259, + 1261 + ], + [ + 1265, + 1267 + ], + [ + 1268, + 1271 + ], + [ + 1272, + 1274 + ], + [ + 1275, + 1277 + ], + [ + 1279, + 1281 + ], + [ + 1282, + 1283 + ], + [ + 1284, + 1285 + ], + [ + 1290, + 1291 + ], + [ + 1295, + 1298 + ], + [ + 1301, + 1302 + ], + [ + 1303, + 1305 + ], + [ + 1310, + 1313 + ], + [ + 1316, + 1318 + ], + [ + 1319, + 1320 + ], + [ + 1321, + 1322 + ], + [ + 1325, + 1326 + ], + [ + 1329, + 1330 + ], + [ + 1333, + 1335 + ], + [ + 1336, + 1343 + ], + [ + 1345, + 1346 + ], + [ + 1347, + 1349 + ], + [ + 1350, + 1351 + ] + ] + } + }, + { + "filename": "libvips/foreign/vipssave.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 57, + 88 + ], + [ + 90, + 106 + ], + [ + 107, + 122 + ], + [ + 123, + 134 + ], + [ + 135, + 153 + ], + [ + 158, + 205 + ], + [ + 211, + 267 + ], + [ + 270, + 291 + ], + [ + 293, + 307 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 60, + 62 + ], + [ + 64, + 65 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 74, + 75 + ], + [ + 80, + 82 + ], + [ + 83, + 85 + ], + [ + 93, + 98 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 110, + 113 + ], + [ + 115, + 117 + ], + [ + 118, + 119 + ], + [ + 126, + 127 + ], + [ + 130, + 131 + ], + [ + 138, + 139 + ], + [ + 144, + 145 + ], + [ + 149, + 150 + ], + [ + 161, + 163 + ], + [ + 165, + 166 + ], + [ + 170, + 172 + ], + [ + 173, + 175 + ], + [ + 176, + 177 + ], + [ + 180, + 181 + ], + [ + 182, + 183 + ], + [ + 189, + 190 + ], + [ + 192, + 198 + ], + [ + 201, + 202 + ], + [ + 214, + 216 + ], + [ + 218, + 219 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 229 + ], + [ + 230, + 231 + ], + [ + 234, + 236 + ], + [ + 237, + 238 + ], + [ + 244, + 245 + ], + [ + 247, + 253 + ], + [ + 256, + 257 + ], + [ + 262, + 264 + ], + [ + 273, + 274 + ], + [ + 278, + 281 + ], + [ + 282, + 283 + ], + [ + 287, + 288 + ], + [ + 296, + 297 + ], + [ + 301, + 304 + ], + [ + 305, + 306 + ] + ] + } + }, + { + "filename": "libvips/foreign/webp2vips.c", + "line_filter": { + "diff_chunks": [ + [ + 23, + 30 + ], + [ + 32, + 60 + ], + [ + 112, + 119 + ], + [ + 160, + 208 + ], + [ + 211, + 232 + ], + [ + 233, + 252 + ], + [ + 253, + 366 + ], + [ + 372, + 390 + ], + [ + 393, + 413 + ], + [ + 415, + 472 + ], + [ + 473, + 531 + ], + [ + 537, + 566 + ], + [ + 567, + 679 + ], + [ + 681, + 738 + ], + [ + 740, + 762 + ], + [ + 764, + 773 + ], + [ + 776, + 828 + ] + ], + "lines_added": [ + [ + 26, + 27 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 115, + 116 + ], + [ + 163, + 164 + ], + [ + 165, + 168 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 185, + 186 + ], + [ + 188, + 189 + ], + [ + 191, + 192 + ], + [ + 196, + 197 + ], + [ + 201, + 205 + ], + [ + 214, + 215 + ], + [ + 217, + 218 + ], + [ + 220, + 221 + ], + [ + 227, + 229 + ], + [ + 236, + 237 + ], + [ + 241, + 245 + ], + [ + 248, + 249 + ], + [ + 256, + 257 + ], + [ + 258, + 259 + ], + [ + 260, + 262 + ], + [ + 263, + 264 + ], + [ + 266, + 267 + ], + [ + 269, + 272 + ], + [ + 273, + 274 + ], + [ + 279, + 281 + ], + [ + 284, + 285 + ], + [ + 288, + 289 + ], + [ + 290, + 292 + ], + [ + 295, + 297 + ], + [ + 298, + 300 + ], + [ + 303, + 305 + ], + [ + 307, + 309 + ], + [ + 310, + 312 + ], + [ + 317, + 318 + ], + [ + 323, + 327 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 334, + 338 + ], + [ + 339, + 342 + ], + [ + 343, + 344 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 353, + 354 + ], + [ + 357, + 359 + ], + [ + 362, + 363 + ], + [ + 375, + 377 + ], + [ + 378, + 379 + ], + [ + 382, + 385 + ], + [ + 386, + 387 + ], + [ + 396, + 397 + ], + [ + 399, + 400 + ], + [ + 404, + 407 + ], + [ + 409, + 410 + ], + [ + 418, + 422 + ], + [ + 423, + 424 + ], + [ + 427, + 430 + ], + [ + 432, + 435 + ], + [ + 437, + 438 + ], + [ + 444, + 446 + ], + [ + 447, + 448 + ], + [ + 450, + 453 + ], + [ + 456, + 458 + ], + [ + 459, + 460 + ], + [ + 463, + 464 + ], + [ + 466, + 467 + ], + [ + 468, + 469 + ], + [ + 476, + 478 + ], + [ + 479, + 480 + ], + [ + 481, + 483 + ], + [ + 486, + 488 + ], + [ + 490, + 491 + ], + [ + 492, + 493 + ], + [ + 495, + 496 + ], + [ + 497, + 501 + ], + [ + 506, + 507 + ], + [ + 511, + 513 + ], + [ + 515, + 519 + ], + [ + 521, + 522 + ], + [ + 525, + 528 + ], + [ + 540, + 541 + ], + [ + 547, + 550 + ], + [ + 552, + 553 + ], + [ + 556, + 557 + ], + [ + 559, + 563 + ], + [ + 570, + 572 + ], + [ + 574, + 579 + ], + [ + 580, + 581 + ], + [ + 585, + 595 + ], + [ + 597, + 598 + ], + [ + 604, + 606 + ], + [ + 610, + 611 + ], + [ + 614, + 615 + ], + [ + 618, + 623 + ], + [ + 625, + 629 + ], + [ + 631, + 632 + ], + [ + 634, + 638 + ], + [ + 640, + 641 + ], + [ + 644, + 645 + ], + [ + 650, + 651 + ], + [ + 657, + 661 + ], + [ + 664, + 667 + ], + [ + 668, + 669 + ], + [ + 674, + 676 + ], + [ + 684, + 693 + ], + [ + 694, + 699 + ], + [ + 700, + 701 + ], + [ + 703, + 707 + ], + [ + 710, + 712 + ], + [ + 713, + 714 + ], + [ + 715, + 716 + ], + [ + 717, + 718 + ], + [ + 719, + 724 + ], + [ + 727, + 728 + ], + [ + 731, + 733 + ], + [ + 734, + 735 + ], + [ + 743, + 744 + ], + [ + 746, + 747 + ], + [ + 748, + 751 + ], + [ + 755, + 759 + ], + [ + 767, + 770 + ], + [ + 779, + 780 + ], + [ + 783, + 784 + ], + [ + 785, + 787 + ], + [ + 789, + 791 + ], + [ + 792, + 797 + ], + [ + 798, + 799 + ], + [ + 802, + 804 + ], + [ + 807, + 810 + ], + [ + 811, + 812 + ], + [ + 815, + 817 + ], + [ + 820, + 823 + ], + [ + 824, + 825 + ] + ] + } + }, + { + "filename": "libvips/foreign/webpload.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 72, + 79 + ], + [ + 81, + 158 + ], + [ + 161, + 211 + ], + [ + 220, + 277 + ], + [ + 279, + 331 + ], + [ + 333, + 356 + ], + [ + 364, + 411 + ], + [ + 412, + 433 + ], + [ + 444, + 480 + ], + [ + 490, + 507 + ], + [ + 508, + 523 + ], + [ + 531, + 552 + ] + ], + "lines_added": [ + [ + 15, + 31 + ], + [ + 36, + 37 + ], + [ + 75, + 76 + ], + [ + 84, + 86 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 104, + 107 + ], + [ + 109, + 111 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 132, + 135 + ], + [ + 136, + 137 + ], + [ + 140, + 141 + ], + [ + 144, + 147 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ], + [ + 164, + 165 + ], + [ + 171, + 172 + ], + [ + 177, + 180 + ], + [ + 181, + 183 + ], + [ + 184, + 187 + ], + [ + 188, + 190 + ], + [ + 191, + 194 + ], + [ + 195, + 197 + ], + [ + 198, + 201 + ], + [ + 202, + 204 + ], + [ + 207, + 208 + ], + [ + 223, + 225 + ], + [ + 227, + 228 + ], + [ + 230, + 231 + ], + [ + 233, + 234 + ], + [ + 235, + 236 + ], + [ + 238, + 240 + ], + [ + 241, + 242 + ], + [ + 245, + 247 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 257, + 258 + ], + [ + 262, + 263 + ], + [ + 264, + 270 + ], + [ + 273, + 274 + ], + [ + 282, + 283 + ], + [ + 288, + 290 + ], + [ + 292, + 293 + ], + [ + 297, + 301 + ], + [ + 302, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 310 + ], + [ + 314, + 318 + ], + [ + 319, + 320 + ], + [ + 325, + 326 + ], + [ + 327, + 328 + ], + [ + 336, + 337 + ], + [ + 343, + 349 + ], + [ + 352, + 353 + ], + [ + 367, + 369 + ], + [ + 371, + 372 + ], + [ + 374, + 375 + ], + [ + 377, + 382 + ], + [ + 383, + 385 + ], + [ + 386, + 387 + ], + [ + 390, + 391 + ], + [ + 395, + 399 + ], + [ + 400, + 401 + ], + [ + 404, + 406 + ], + [ + 407, + 408 + ], + [ + 415, + 416 + ], + [ + 418, + 419 + ], + [ + 420, + 426 + ], + [ + 429, + 430 + ], + [ + 447, + 448 + ], + [ + 453, + 454 + ], + [ + 460, + 461 + ], + [ + 467, + 468 + ], + [ + 472, + 475 + ], + [ + 476, + 477 + ], + [ + 493, + 494 + ], + [ + 495, + 497 + ], + [ + 503, + 504 + ], + [ + 511, + 512 + ], + [ + 513, + 516 + ], + [ + 517, + 518 + ], + [ + 519, + 520 + ], + [ + 534, + 535 + ], + [ + 541, + 542 + ], + [ + 546, + 549 + ], + [ + 550, + 551 + ] + ] + } + }, + { + "filename": "libvips/foreign/webpsave.c", + "line_filter": { + "diff_chunks": [ + [ + 36, + 64 + ], + [ + 86, + 94 + ], + [ + 191, + 227 + ], + [ + 232, + 438 + ], + [ + 440, + 573 + ], + [ + 574, + 721 + ], + [ + 729, + 738 + ], + [ + 741, + 748 + ], + [ + 749, + 850 + ], + [ + 863, + 893 + ], + [ + 895, + 911 + ], + [ + 915, + 943 + ], + [ + 945, + 961 + ], + [ + 965, + 976 + ], + [ + 977, + 1001 + ], + [ + 1003, + 1019 + ], + [ + 1023, + 1034 + ], + [ + 1035, + 1075 + ], + [ + 1143, + 1159 + ], + [ + 1189, + 1196 + ], + [ + 1197, + 1220 + ], + [ + 1244, + 1260 + ], + [ + 1285, + 1299 + ] + ], + "lines_added": [ + [ + 39, + 40 + ], + [ + 41, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 55 + ], + [ + 60, + 61 + ], + [ + 89, + 91 + ], + [ + 194, + 196 + ], + [ + 198, + 199 + ], + [ + 200, + 204 + ], + [ + 207, + 208 + ], + [ + 211, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 224 + ], + [ + 235, + 236 + ], + [ + 241, + 243 + ], + [ + 245, + 246 + ], + [ + 247, + 249 + ], + [ + 253, + 254 + ], + [ + 258, + 263 + ], + [ + 265, + 266 + ], + [ + 271, + 272 + ], + [ + 274, + 275 + ], + [ + 276, + 279 + ], + [ + 282, + 289 + ], + [ + 292, + 294 + ], + [ + 301, + 306 + ], + [ + 309, + 310 + ], + [ + 311, + 312 + ], + [ + 318, + 319 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 326, + 330 + ], + [ + 335, + 338 + ], + [ + 344, + 345 + ], + [ + 348, + 349 + ], + [ + 350, + 351 + ], + [ + 352, + 353 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 362, + 363 + ], + [ + 369, + 371 + ], + [ + 374, + 375 + ], + [ + 378, + 380 + ], + [ + 382, + 384 + ], + [ + 385, + 386 + ], + [ + 391, + 393 + ], + [ + 399, + 404 + ], + [ + 406, + 407 + ], + [ + 410, + 411 + ], + [ + 414, + 415 + ], + [ + 418, + 419 + ], + [ + 422, + 427 + ], + [ + 430, + 431 + ], + [ + 434, + 435 + ], + [ + 443, + 446 + ], + [ + 448, + 449 + ], + [ + 451, + 453 + ], + [ + 454, + 455 + ], + [ + 458, + 459 + ], + [ + 461, + 463 + ], + [ + 464, + 465 + ], + [ + 469, + 470 + ], + [ + 473, + 475 + ], + [ + 478, + 481 + ], + [ + 482, + 484 + ], + [ + 486, + 489 + ], + [ + 493, + 494 + ], + [ + 497, + 498 + ], + [ + 501, + 503 + ], + [ + 505, + 511 + ], + [ + 517, + 523 + ], + [ + 529, + 530 + ], + [ + 531, + 532 + ], + [ + 533, + 534 + ], + [ + 536, + 540 + ], + [ + 542, + 543 + ], + [ + 546, + 548 + ], + [ + 550, + 551 + ], + [ + 554, + 558 + ], + [ + 564, + 570 + ], + [ + 577, + 581 + ], + [ + 583, + 584 + ], + [ + 585, + 589 + ], + [ + 594, + 595 + ], + [ + 597, + 599 + ], + [ + 601, + 602 + ], + [ + 605, + 607 + ], + [ + 611, + 616 + ], + [ + 618, + 622 + ], + [ + 627, + 630 + ], + [ + 635, + 636 + ], + [ + 639, + 640 + ], + [ + 646, + 648 + ], + [ + 649, + 654 + ], + [ + 659, + 662 + ], + [ + 667, + 672 + ], + [ + 676, + 678 + ], + [ + 682, + 683 + ], + [ + 687, + 690 + ], + [ + 691, + 694 + ], + [ + 697, + 700 + ], + [ + 701, + 704 + ], + [ + 706, + 710 + ], + [ + 712, + 714 + ], + [ + 715, + 716 + ], + [ + 717, + 718 + ], + [ + 732, + 733 + ], + [ + 734, + 735 + ], + [ + 744, + 745 + ], + [ + 752, + 755 + ], + [ + 756, + 758 + ], + [ + 759, + 762 + ], + [ + 763, + 765 + ], + [ + 766, + 769 + ], + [ + 770, + 771 + ], + [ + 772, + 773 + ], + [ + 774, + 777 + ], + [ + 778, + 780 + ], + [ + 781, + 784 + ], + [ + 785, + 787 + ], + [ + 788, + 791 + ], + [ + 792, + 794 + ], + [ + 795, + 798 + ], + [ + 799, + 801 + ], + [ + 802, + 805 + ], + [ + 806, + 808 + ], + [ + 809, + 812 + ], + [ + 813, + 815 + ], + [ + 816, + 819 + ], + [ + 820, + 822 + ], + [ + 823, + 826 + ], + [ + 827, + 829 + ], + [ + 830, + 833 + ], + [ + 834, + 836 + ], + [ + 837, + 840 + ], + [ + 841, + 843 + ], + [ + 846, + 847 + ], + [ + 866, + 868 + ], + [ + 870, + 871 + ], + [ + 877, + 878 + ], + [ + 879, + 881 + ], + [ + 882, + 883 + ], + [ + 887, + 888 + ], + [ + 889, + 890 + ], + [ + 898, + 901 + ], + [ + 902, + 904 + ], + [ + 907, + 908 + ], + [ + 918, + 920 + ], + [ + 922, + 923 + ], + [ + 927, + 929 + ], + [ + 930, + 932 + ], + [ + 933, + 934 + ], + [ + 937, + 938 + ], + [ + 939, + 940 + ], + [ + 948, + 951 + ], + [ + 952, + 954 + ], + [ + 957, + 958 + ], + [ + 968, + 970 + ], + [ + 972, + 973 + ], + [ + 980, + 982 + ], + [ + 983, + 985 + ], + [ + 986, + 989 + ], + [ + 990, + 991 + ], + [ + 995, + 996 + ], + [ + 997, + 998 + ], + [ + 1006, + 1009 + ], + [ + 1010, + 1012 + ], + [ + 1015, + 1016 + ], + [ + 1026, + 1028 + ], + [ + 1030, + 1031 + ], + [ + 1038, + 1040 + ], + [ + 1041, + 1043 + ], + [ + 1044, + 1048 + ], + [ + 1049, + 1054 + ], + [ + 1055, + 1056 + ], + [ + 1057, + 1058 + ], + [ + 1061, + 1062 + ], + [ + 1066, + 1067 + ], + [ + 1071, + 1072 + ], + [ + 1146, + 1147 + ], + [ + 1151, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1192, + 1193 + ], + [ + 1200, + 1203 + ], + [ + 1204, + 1207 + ], + [ + 1210, + 1211 + ], + [ + 1213, + 1214 + ], + [ + 1216, + 1217 + ], + [ + 1247, + 1248 + ], + [ + 1252, + 1255 + ], + [ + 1256, + 1257 + ], + [ + 1288, + 1289 + ], + [ + 1293, + 1296 + ], + [ + 1297, + 1298 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/freqfilt.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 60, + 115 + ], + [ + 118, + 127 + ], + [ + 130, + 180 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 64 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 71, + 74 + ], + [ + 76, + 77 + ], + [ + 78, + 80 + ], + [ + 81, + 82 + ], + [ + 85, + 86 + ], + [ + 87, + 89 + ], + [ + 94, + 95 + ], + [ + 97, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 108 + ], + [ + 111, + 112 + ], + [ + 121, + 124 + ], + [ + 133, + 136 + ], + [ + 137, + 141 + ], + [ + 144, + 146 + ], + [ + 147, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 156 + ], + [ + 162, + 163 + ], + [ + 165, + 167 + ], + [ + 168, + 171 + ], + [ + 173, + 175 + ], + [ + 176, + 179 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/freqmult.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 63, + 96 + ], + [ + 97, + 147 + ], + [ + 156, + 170 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 66, + 67 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 77, + 79 + ], + [ + 82, + 86 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 100, + 106 + ], + [ + 107, + 108 + ], + [ + 110, + 112 + ], + [ + 113, + 114 + ], + [ + 117, + 118 + ], + [ + 119, + 121 + ], + [ + 126, + 127 + ], + [ + 129, + 132 + ], + [ + 133, + 134 + ], + [ + 137, + 138 + ], + [ + 143, + 144 + ], + [ + 159, + 160 + ], + [ + 164, + 167 + ], + [ + 168, + 169 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/fwfft.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 41, + 69 + ], + [ + 89, + 106 + ], + [ + 109, + 341 + ], + [ + 342, + 349 + ], + [ + 356, + 370 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 44, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 60 + ], + [ + 65, + 66 + ], + [ + 92, + 93 + ], + [ + 96, + 98 + ], + [ + 100, + 103 + ], + [ + 112, + 115 + ], + [ + 119, + 122 + ], + [ + 127, + 139 + ], + [ + 141, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 147 + ], + [ + 149, + 151 + ], + [ + 153, + 155 + ], + [ + 156, + 158 + ], + [ + 163, + 164 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 179, + 181 + ], + [ + 182, + 184 + ], + [ + 186, + 187 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 204, + 206 + ], + [ + 208, + 209 + ], + [ + 213, + 215 + ], + [ + 217, + 219 + ], + [ + 225, + 228 + ], + [ + 232, + 235 + ], + [ + 238, + 241 + ], + [ + 244, + 252 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 262, + 264 + ], + [ + 266, + 268 + ], + [ + 272, + 274 + ], + [ + 277, + 278 + ], + [ + 284, + 286 + ], + [ + 288, + 289 + ], + [ + 292, + 293 + ], + [ + 294, + 295 + ], + [ + 296, + 297 + ], + [ + 300, + 302 + ], + [ + 303, + 304 + ], + [ + 305, + 308 + ], + [ + 309, + 313 + ], + [ + 315, + 318 + ], + [ + 320, + 322 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ], + [ + 329, + 330 + ], + [ + 332, + 333 + ], + [ + 337, + 338 + ], + [ + 345, + 346 + ], + [ + 359, + 360 + ], + [ + 364, + 367 + ], + [ + 368, + 369 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/invfft.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 30, + 58 + ], + [ + 80, + 145 + ], + [ + 150, + 170 + ], + [ + 174, + 267 + ], + [ + 268, + 275 + ], + [ + 287, + 301 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 49 + ], + [ + 54, + 55 + ], + [ + 83, + 84 + ], + [ + 87, + 89 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 97, + 100 + ], + [ + 104, + 107 + ], + [ + 111, + 122 + ], + [ + 124, + 126 + ], + [ + 127, + 128 + ], + [ + 131, + 132 + ], + [ + 136, + 138 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 153, + 156 + ], + [ + 159, + 162 + ], + [ + 163, + 165 + ], + [ + 166, + 167 + ], + [ + 177, + 179 + ], + [ + 181, + 183 + ], + [ + 187, + 196 + ], + [ + 198, + 200 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 217 + ], + [ + 218, + 219 + ], + [ + 220, + 223 + ], + [ + 224, + 228 + ], + [ + 230, + 233 + ], + [ + 235, + 239 + ], + [ + 242, + 243 + ], + [ + 244, + 246 + ], + [ + 251, + 252 + ], + [ + 254, + 257 + ], + [ + 258, + 260 + ], + [ + 263, + 264 + ], + [ + 271, + 272 + ], + [ + 290, + 291 + ], + [ + 295, + 298 + ], + [ + 299, + 300 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/pfreqfilt.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 65, + 80 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 74 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/phasecor.c", + "line_filter": { + "diff_chunks": [ + [ + 13, + 41 + ], + [ + 57, + 122 + ], + [ + 129, + 148 + ] + ], + "lines_added": [ + [ + 16, + 32 + ], + [ + 37, + 38 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 71, + 73 + ], + [ + 77, + 80 + ], + [ + 83, + 86 + ], + [ + 89, + 93 + ], + [ + 94, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 102 + ], + [ + 107, + 108 + ], + [ + 110, + 113 + ], + [ + 114, + 115 + ], + [ + 118, + 119 + ], + [ + 132, + 133 + ], + [ + 137, + 138 + ], + [ + 142, + 145 + ], + [ + 146, + 147 + ] + ] + } + }, + { + "filename": "libvips/freqfilt/spectrum.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 9 + ], + [ + 20, + 48 + ], + [ + 59, + 115 + ], + [ + 122, + 136 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 62, + 63 + ], + [ + 65, + 66 + ], + [ + 67, + 69 + ], + [ + 72, + 74 + ], + [ + 77, + 80 + ], + [ + 83, + 87 + ], + [ + 88, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 105, + 106 + ], + [ + 111, + 112 + ], + [ + 125, + 126 + ], + [ + 130, + 133 + ], + [ + 134, + 135 + ] + ] + } + }, + { + "filename": "libvips/histogram/case.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 55, + 97 + ], + [ + 98, + 127 + ], + [ + 128, + 148 + ], + [ + 151, + 192 + ], + [ + 194, + 278 + ], + [ + 285, + 294 + ], + [ + 298, + 312 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 58, + 59 + ], + [ + 60, + 63 + ], + [ + 66, + 67 + ], + [ + 70, + 72 + ], + [ + 75, + 76 + ], + [ + 79, + 81 + ], + [ + 82, + 84 + ], + [ + 88, + 94 + ], + [ + 101, + 107 + ], + [ + 109, + 114 + ], + [ + 117, + 120 + ], + [ + 123, + 124 + ], + [ + 131, + 133 + ], + [ + 136, + 137 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 154, + 155 + ], + [ + 156, + 158 + ], + [ + 160, + 166 + ], + [ + 167, + 171 + ], + [ + 175, + 177 + ], + [ + 179, + 183 + ], + [ + 186, + 189 + ], + [ + 197, + 203 + ], + [ + 205, + 208 + ], + [ + 213, + 217 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 224, + 227 + ], + [ + 232, + 234 + ], + [ + 238, + 241 + ], + [ + 242, + 243 + ], + [ + 244, + 247 + ], + [ + 248, + 256 + ], + [ + 259, + 260 + ], + [ + 264, + 266 + ], + [ + 267, + 268 + ], + [ + 270, + 273 + ], + [ + 274, + 275 + ], + [ + 288, + 291 + ], + [ + 301, + 302 + ], + [ + 306, + 309 + ], + [ + 310, + 311 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_cum.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 54 + ], + [ + 66, + 132 + ], + [ + 147, + 167 + ], + [ + 170, + 191 + ] + ], + "lines_added": [ + [ + 23, + 24 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 69, + 83 + ], + [ + 84, + 85 + ], + [ + 87, + 89 + ], + [ + 90, + 93 + ], + [ + 95, + 127 + ], + [ + 128, + 129 + ], + [ + 150, + 151 + ], + [ + 153, + 154 + ], + [ + 156, + 157 + ], + [ + 163, + 164 + ], + [ + 173, + 174 + ], + [ + 179, + 181 + ], + [ + 185, + 188 + ], + [ + 189, + 190 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_entropy.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 8 + ], + [ + 9, + 37 + ], + [ + 44, + 51 + ], + [ + 54, + 135 + ], + [ + 142, + 157 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 28 + ], + [ + 33, + 34 + ], + [ + 47, + 48 + ], + [ + 57, + 59 + ], + [ + 61, + 62 + ], + [ + 63, + 66 + ], + [ + 67, + 69 + ], + [ + 70, + 72 + ], + [ + 73, + 75 + ], + [ + 80, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 107, + 108 + ], + [ + 110, + 113 + ], + [ + 114, + 115 + ], + [ + 116, + 119 + ], + [ + 120, + 122 + ], + [ + 125, + 126 + ], + [ + 131, + 132 + ], + [ + 145, + 147 + ], + [ + 151, + 154 + ], + [ + 155, + 156 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_equal.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 13, + 20 + ], + [ + 21, + 49 + ], + [ + 55, + 62 + ], + [ + 68, + 138 + ], + [ + 148, + 169 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 16, + 17 + ], + [ + 24, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 40 + ], + [ + 45, + 46 + ], + [ + 58, + 59 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 76, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 83 + ], + [ + 87, + 88 + ], + [ + 89, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 110, + 111 + ], + [ + 113, + 116 + ], + [ + 117, + 131 + ], + [ + 134, + 135 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 157, + 159 + ], + [ + 163, + 166 + ], + [ + 167, + 168 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_ismonotonic.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 53, + 60 + ], + [ + 63, + 136 + ], + [ + 143, + 158 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 56, + 57 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 72, + 75 + ], + [ + 76, + 77 + ], + [ + 78, + 80 + ], + [ + 81, + 83 + ], + [ + 84, + 89 + ], + [ + 92, + 93 + ], + [ + 94, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 114, + 115 + ], + [ + 117, + 120 + ], + [ + 121, + 129 + ], + [ + 132, + 133 + ], + [ + 146, + 148 + ], + [ + 152, + 155 + ], + [ + 156, + 157 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_local.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 31, + 59 + ], + [ + 83, + 95 + ], + [ + 96, + 196 + ], + [ + 197, + 208 + ], + [ + 210, + 219 + ], + [ + 220, + 239 + ], + [ + 244, + 251 + ], + [ + 254, + 269 + ], + [ + 275, + 399 + ], + [ + 409, + 416 + ], + [ + 423, + 438 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 7, + 8 + ], + [ + 34, + 35 + ], + [ + 36, + 40 + ], + [ + 41, + 50 + ], + [ + 55, + 56 + ], + [ + 86, + 87 + ], + [ + 91, + 92 + ], + [ + 99, + 100 + ], + [ + 104, + 108 + ], + [ + 109, + 111 + ], + [ + 112, + 114 + ], + [ + 115, + 116 + ], + [ + 119, + 120 + ], + [ + 126, + 128 + ], + [ + 131, + 135 + ], + [ + 137, + 142 + ], + [ + 143, + 144 + ], + [ + 147, + 149 + ], + [ + 153, + 155 + ], + [ + 160, + 161 + ], + [ + 166, + 170 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 177, + 181 + ], + [ + 182, + 183 + ], + [ + 185, + 186 + ], + [ + 187, + 189 + ], + [ + 190, + 193 + ], + [ + 200, + 202 + ], + [ + 204, + 205 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 223, + 226 + ], + [ + 229, + 230 + ], + [ + 233, + 236 + ], + [ + 247, + 248 + ], + [ + 257, + 258 + ], + [ + 260, + 262 + ], + [ + 265, + 266 + ], + [ + 278, + 279 + ], + [ + 282, + 283 + ], + [ + 284, + 285 + ], + [ + 286, + 287 + ], + [ + 290, + 292 + ], + [ + 293, + 294 + ], + [ + 295, + 298 + ], + [ + 299, + 301 + ], + [ + 302, + 306 + ], + [ + 308, + 309 + ], + [ + 310, + 316 + ], + [ + 318, + 319 + ], + [ + 323, + 326 + ], + [ + 329, + 335 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 355, + 356 + ], + [ + 360, + 363 + ], + [ + 364, + 365 + ], + [ + 366, + 371 + ], + [ + 372, + 375 + ], + [ + 376, + 378 + ], + [ + 379, + 382 + ], + [ + 383, + 385 + ], + [ + 386, + 389 + ], + [ + 390, + 392 + ], + [ + 395, + 396 + ], + [ + 412, + 413 + ], + [ + 426, + 428 + ], + [ + 432, + 435 + ], + [ + 436, + 437 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_match.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 19 + ], + [ + 20, + 48 + ], + [ + 72, + 86 + ], + [ + 88, + 206 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 75, + 76 + ], + [ + 78, + 80 + ], + [ + 81, + 83 + ], + [ + 91, + 92 + ], + [ + 97, + 98 + ], + [ + 100, + 102 + ], + [ + 104, + 105 + ], + [ + 107, + 108 + ], + [ + 110, + 111 + ], + [ + 115, + 116 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 132, + 136 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 144, + 145 + ], + [ + 146, + 149 + ], + [ + 154, + 155 + ], + [ + 157, + 158 + ], + [ + 160, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 181, + 182 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 194, + 196 + ], + [ + 200, + 203 + ], + [ + 204, + 205 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_norm.c", + "line_filter": { + "diff_chunks": [ + [ + 20, + 54 + ], + [ + 69, + 158 + ], + [ + 160, + 168 + ], + [ + 169, + 184 + ] + ], + "lines_added": [ + [ + 23, + 24 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 72, + 73 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 81, + 82 + ], + [ + 86, + 87 + ], + [ + 88, + 90 + ], + [ + 93, + 95 + ], + [ + 98, + 99 + ], + [ + 100, + 105 + ], + [ + 108, + 110 + ], + [ + 113, + 114 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 120, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 130, + 131 + ], + [ + 137, + 138 + ], + [ + 140, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 151 + ], + [ + 154, + 155 + ], + [ + 163, + 165 + ], + [ + 172, + 174 + ], + [ + 178, + 181 + ], + [ + 182, + 183 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_plot.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 23 + ], + [ + 32, + 60 + ], + [ + 79, + 294 + ], + [ + 304, + 350 + ], + [ + 353, + 383 + ] + ], + "lines_added": [ + [ + 19, + 20 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 82, + 95 + ], + [ + 99, + 101 + ], + [ + 103, + 104 + ], + [ + 106, + 108 + ], + [ + 112, + 141 + ], + [ + 143, + 144 + ], + [ + 147, + 148 + ], + [ + 150, + 161 + ], + [ + 165, + 167 + ], + [ + 169, + 170 + ], + [ + 172, + 174 + ], + [ + 175, + 176 + ], + [ + 180, + 209 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 230, + 231 + ], + [ + 232, + 234 + ], + [ + 237, + 241 + ], + [ + 242, + 245 + ], + [ + 248, + 251 + ], + [ + 254, + 255 + ], + [ + 260, + 264 + ], + [ + 265, + 268 + ], + [ + 272, + 274 + ], + [ + 277, + 281 + ], + [ + 283, + 284 + ], + [ + 287, + 288 + ], + [ + 290, + 291 + ], + [ + 307, + 317 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 329, + 330 + ], + [ + 332, + 335 + ], + [ + 336, + 337 + ], + [ + 338, + 343 + ], + [ + 346, + 347 + ], + [ + 356, + 357 + ], + [ + 359, + 362 + ], + [ + 366, + 367 + ], + [ + 371, + 373 + ], + [ + 377, + 380 + ], + [ + 381, + 382 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_unary.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 50, + 98 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 53, + 54 + ], + [ + 56, + 57 + ], + [ + 58, + 60 + ], + [ + 62, + 63 + ], + [ + 65, + 67 + ], + [ + 68, + 70 + ], + [ + 71, + 72 + ], + [ + 75, + 76 + ], + [ + 77, + 79 + ], + [ + 84, + 85 + ], + [ + 87, + 90 + ], + [ + 91, + 92 + ], + [ + 95, + 96 + ] + ] + } + }, + { + "filename": "libvips/histogram/hist_unary.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 64, + 74 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 67, + 68 + ] + ] + } + }, + { + "filename": "libvips/histogram/histogram.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 56, + 73 + ], + [ + 74, + 120 + ], + [ + 121, + 227 + ], + [ + 228, + 243 + ], + [ + 247, + 267 + ], + [ + 273, + 278 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 59, + 62 + ], + [ + 64, + 65 + ], + [ + 66, + 70 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 82, + 83 + ], + [ + 87, + 88 + ], + [ + 89, + 93 + ], + [ + 94, + 100 + ], + [ + 102, + 106 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 114, + 117 + ], + [ + 124, + 126 + ], + [ + 129, + 132 + ], + [ + 134, + 136 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 143, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 155 + ], + [ + 159, + 164 + ], + [ + 166, + 168 + ], + [ + 170, + 178 + ], + [ + 181, + 187 + ], + [ + 188, + 189 + ], + [ + 194, + 195 + ], + [ + 196, + 198 + ], + [ + 201, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 209 + ], + [ + 210, + 211 + ], + [ + 214, + 215 + ], + [ + 216, + 218 + ], + [ + 223, + 224 + ], + [ + 231, + 236 + ], + [ + 239, + 240 + ], + [ + 250, + 251 + ], + [ + 252, + 264 + ], + [ + 276, + 277 + ] + ] + } + }, + { + "filename": "libvips/histogram/maplut.c", + "line_filter": { + "diff_chunks": [ + [ + 37, + 65 + ], + [ + 79, + 424 + ], + [ + 426, + 508 + ], + [ + 510, + 519 + ], + [ + 521, + 528 + ], + [ + 529, + 761 + ], + [ + 770, + 791 + ], + [ + 796, + 810 + ] + ], + "lines_added": [ + [ + 40, + 56 + ], + [ + 61, + 62 + ], + [ + 82, + 83 + ], + [ + 84, + 91 + ], + [ + 96, + 97 + ], + [ + 99, + 101 + ], + [ + 106, + 108 + ], + [ + 109, + 111 + ], + [ + 116, + 118 + ], + [ + 123, + 124 + ], + [ + 128, + 130 + ], + [ + 136, + 138 + ], + [ + 139, + 140 + ], + [ + 144, + 157 + ], + [ + 158, + 159 + ], + [ + 162, + 179 + ], + [ + 181, + 182 + ], + [ + 183, + 202 + ], + [ + 205, + 206 + ], + [ + 207, + 229 + ], + [ + 232, + 233 + ], + [ + 236, + 248 + ], + [ + 251, + 266 + ], + [ + 267, + 268 + ], + [ + 272, + 289 + ], + [ + 291, + 292 + ], + [ + 293, + 312 + ], + [ + 314, + 315 + ], + [ + 318, + 332 + ], + [ + 333, + 334 + ], + [ + 337, + 353 + ], + [ + 355, + 356 + ], + [ + 359, + 377 + ], + [ + 379, + 380 + ], + [ + 383, + 404 + ], + [ + 406, + 407 + ], + [ + 410, + 421 + ], + [ + 429, + 431 + ], + [ + 432, + 437 + ], + [ + 438, + 440 + ], + [ + 441, + 443 + ], + [ + 444, + 446 + ], + [ + 447, + 449 + ], + [ + 450, + 452 + ], + [ + 453, + 455 + ], + [ + 456, + 458 + ], + [ + 459, + 461 + ], + [ + 467, + 470 + ], + [ + 475, + 476 + ], + [ + 478, + 481 + ], + [ + 484, + 486 + ], + [ + 487, + 488 + ], + [ + 490, + 494 + ], + [ + 496, + 497 + ], + [ + 498, + 499 + ], + [ + 504, + 505 + ], + [ + 513, + 514 + ], + [ + 515, + 516 + ], + [ + 524, + 525 + ], + [ + 532, + 550 + ], + [ + 551, + 552 + ], + [ + 553, + 554 + ], + [ + 555, + 574 + ], + [ + 576, + 579 + ], + [ + 581, + 582 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 588, + 589 + ], + [ + 594, + 595 + ], + [ + 596, + 598 + ], + [ + 602, + 605 + ], + [ + 608, + 610 + ], + [ + 612, + 616 + ], + [ + 617, + 620 + ], + [ + 625, + 626 + ], + [ + 632, + 633 + ], + [ + 635, + 639 + ], + [ + 643, + 645 + ], + [ + 647, + 648 + ], + [ + 652, + 653 + ], + [ + 654, + 656 + ], + [ + 662, + 668 + ], + [ + 671, + 675 + ], + [ + 676, + 704 + ], + [ + 706, + 710 + ], + [ + 711, + 712 + ], + [ + 715, + 716 + ], + [ + 717, + 720 + ], + [ + 725, + 726 + ], + [ + 730, + 733 + ], + [ + 734, + 735 + ], + [ + 736, + 741 + ], + [ + 742, + 745 + ], + [ + 746, + 747 + ], + [ + 748, + 751 + ], + [ + 752, + 754 + ], + [ + 757, + 758 + ], + [ + 773, + 774 + ], + [ + 775, + 776 + ], + [ + 778, + 779 + ], + [ + 781, + 782 + ], + [ + 783, + 788 + ], + [ + 799, + 800 + ], + [ + 804, + 807 + ], + [ + 808, + 809 + ] + ] + } + }, + { + "filename": "libvips/histogram/percent.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 54, + 61 + ], + [ + 65, + 134 + ], + [ + 138, + 145 + ], + [ + 148, + 170 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 57, + 58 + ], + [ + 68, + 69 + ], + [ + 71, + 72 + ], + [ + 73, + 75 + ], + [ + 78, + 80 + ], + [ + 81, + 89 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 96, + 97 + ], + [ + 98, + 99 + ], + [ + 105, + 106 + ], + [ + 108, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 127 + ], + [ + 130, + 131 + ], + [ + 141, + 142 + ], + [ + 151, + 152 + ], + [ + 158, + 160 + ], + [ + 164, + 167 + ], + [ + 168, + 169 + ] + ] + } + }, + { + "filename": "libvips/histogram/phistogram.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 40, + 84 + ], + [ + 89, + 99 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 43, + 55 + ], + [ + 59, + 61 + ], + [ + 67, + 68 + ], + [ + 74, + 75 + ], + [ + 80, + 81 + ], + [ + 92, + 93 + ] + ] + } + }, + { + "filename": "libvips/histogram/stdif.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 15, + 56 + ], + [ + 84, + 111 + ], + [ + 112, + 129 + ], + [ + 139, + 154 + ], + [ + 160, + 196 + ], + [ + 207, + 355 + ], + [ + 374, + 396 + ], + [ + 397, + 420 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 7, + 8 + ], + [ + 18, + 19 + ], + [ + 24, + 25 + ], + [ + 31, + 32 + ], + [ + 33, + 37 + ], + [ + 38, + 47 + ], + [ + 52, + 53 + ], + [ + 87, + 88 + ], + [ + 94, + 96 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 107, + 108 + ], + [ + 115, + 117 + ], + [ + 118, + 119 + ], + [ + 121, + 122 + ], + [ + 124, + 126 + ], + [ + 142, + 145 + ], + [ + 147, + 148 + ], + [ + 149, + 151 + ], + [ + 163, + 165 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 177 + ], + [ + 180, + 181 + ], + [ + 182, + 183 + ], + [ + 187, + 189 + ], + [ + 192, + 193 + ], + [ + 210, + 211 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 222, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 238 + ], + [ + 239, + 242 + ], + [ + 244, + 245 + ], + [ + 246, + 252 + ], + [ + 254, + 255 + ], + [ + 259, + 262 + ], + [ + 265, + 271 + ], + [ + 275, + 276 + ], + [ + 277, + 278 + ], + [ + 281, + 282 + ], + [ + 283, + 284 + ], + [ + 290, + 291 + ], + [ + 293, + 296 + ], + [ + 297, + 298 + ], + [ + 299, + 304 + ], + [ + 307, + 310 + ], + [ + 311, + 313 + ], + [ + 314, + 317 + ], + [ + 318, + 320 + ], + [ + 321, + 324 + ], + [ + 325, + 327 + ], + [ + 328, + 331 + ], + [ + 332, + 334 + ], + [ + 335, + 338 + ], + [ + 339, + 341 + ], + [ + 342, + 345 + ], + [ + 346, + 348 + ], + [ + 351, + 352 + ], + [ + 377, + 380 + ], + [ + 385, + 386 + ], + [ + 390, + 393 + ], + [ + 400, + 402 + ], + [ + 408, + 410 + ], + [ + 414, + 417 + ], + [ + 418, + 419 + ] + ] + } + }, + { + "filename": "libvips/include/vips/almostdeprecated.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 7, + 35 + ], + [ + 54, + 112 + ], + [ + 121, + 130 + ], + [ + 133, + 222 + ], + [ + 223, + 407 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 10, + 11 + ], + [ + 12, + 16 + ], + [ + 17, + 26 + ], + [ + 31, + 32 + ], + [ + 57, + 58 + ], + [ + 62, + 64 + ], + [ + 67, + 68 + ], + [ + 69, + 71 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 90, + 95 + ], + [ + 97, + 102 + ], + [ + 104, + 109 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 136, + 138 + ], + [ + 139, + 140 + ], + [ + 141, + 143 + ], + [ + 144, + 146 + ], + [ + 147, + 149 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 163, + 164 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 176, + 177 + ], + [ + 180, + 181 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 187, + 189 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 199, + 201 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 208, + 209 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 218, + 219 + ], + [ + 226, + 227 + ], + [ + 231, + 232 + ], + [ + 233, + 234 + ], + [ + 235, + 236 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 241, + 242 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 250, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 260, + 262 + ], + [ + 266, + 267 + ], + [ + 268, + 269 + ], + [ + 270, + 271 + ], + [ + 272, + 273 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 278, + 279 + ], + [ + 280, + 281 + ], + [ + 282, + 283 + ], + [ + 285, + 286 + ], + [ + 287, + 288 + ], + [ + 290, + 291 + ], + [ + 293, + 294 + ], + [ + 296, + 297 + ], + [ + 299, + 300 + ], + [ + 302, + 303 + ], + [ + 304, + 305 + ], + [ + 306, + 307 + ], + [ + 308, + 309 + ], + [ + 310, + 311 + ], + [ + 312, + 313 + ], + [ + 314, + 315 + ], + [ + 316, + 317 + ], + [ + 318, + 319 + ], + [ + 320, + 322 + ], + [ + 324, + 326 + ], + [ + 327, + 328 + ], + [ + 330, + 331 + ], + [ + 332, + 333 + ], + [ + 334, + 335 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 343, + 344 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 350, + 351 + ], + [ + 352, + 353 + ], + [ + 354, + 356 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 362, + 364 + ], + [ + 366, + 367 + ], + [ + 368, + 371 + ], + [ + 373, + 374 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 380, + 381 + ], + [ + 382, + 383 + ], + [ + 385, + 387 + ], + [ + 388, + 389 + ], + [ + 390, + 391 + ], + [ + 392, + 394 + ], + [ + 395, + 396 + ], + [ + 398, + 399 + ], + [ + 403, + 404 + ] + ] + } + }, + { + "filename": "libvips/include/vips/arithmetic.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 41, + 48 + ], + [ + 49, + 57 + ], + [ + 82, + 93 + ], + [ + 97, + 104 + ], + [ + 112, + 119 + ], + [ + 133, + 140 + ], + [ + 152, + 159 + ], + [ + 167, + 174 + ], + [ + 178, + 185 + ], + [ + 192, + 568 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 44, + 45 + ], + [ + 52, + 54 + ], + [ + 85, + 86 + ], + [ + 88, + 90 + ], + [ + 100, + 101 + ], + [ + 115, + 116 + ], + [ + 136, + 137 + ], + [ + 155, + 156 + ], + [ + 170, + 171 + ], + [ + 181, + 182 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 201, + 202 + ], + [ + 204, + 205 + ], + [ + 207, + 208 + ], + [ + 210, + 212 + ], + [ + 214, + 215 + ], + [ + 217, + 218 + ], + [ + 220, + 222 + ], + [ + 224, + 226 + ], + [ + 228, + 229 + ], + [ + 231, + 232 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 240, + 241 + ], + [ + 243, + 244 + ], + [ + 246, + 247 + ], + [ + 250, + 252 + ], + [ + 254, + 255 + ], + [ + 257, + 258 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 266, + 267 + ], + [ + 269, + 270 + ], + [ + 272, + 273 + ], + [ + 275, + 276 + ], + [ + 278, + 279 + ], + [ + 281, + 282 + ], + [ + 284, + 285 + ], + [ + 287, + 288 + ], + [ + 290, + 291 + ], + [ + 293, + 294 + ], + [ + 296, + 297 + ], + [ + 299, + 300 + ], + [ + 303, + 305 + ], + [ + 307, + 308 + ], + [ + 310, + 311 + ], + [ + 313, + 314 + ], + [ + 317, + 319 + ], + [ + 321, + 322 + ], + [ + 325, + 327 + ], + [ + 329, + 330 + ], + [ + 332, + 333 + ], + [ + 336, + 337 + ], + [ + 340, + 342 + ], + [ + 344, + 345 + ], + [ + 347, + 348 + ], + [ + 350, + 351 + ], + [ + 353, + 354 + ], + [ + 356, + 357 + ], + [ + 359, + 360 + ], + [ + 362, + 364 + ], + [ + 366, + 368 + ], + [ + 370, + 372 + ], + [ + 374, + 376 + ], + [ + 378, + 380 + ], + [ + 382, + 384 + ], + [ + 386, + 388 + ], + [ + 390, + 392 + ], + [ + 394, + 395 + ], + [ + 397, + 398 + ], + [ + 400, + 401 + ], + [ + 403, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 410 + ], + [ + 413, + 415 + ], + [ + 417, + 418 + ], + [ + 420, + 421 + ], + [ + 423, + 424 + ], + [ + 426, + 427 + ], + [ + 429, + 430 + ], + [ + 433, + 435 + ], + [ + 437, + 439 + ], + [ + 441, + 443 + ], + [ + 445, + 447 + ], + [ + 449, + 451 + ], + [ + 453, + 455 + ], + [ + 457, + 459 + ], + [ + 461, + 462 + ], + [ + 464, + 465 + ], + [ + 467, + 468 + ], + [ + 470, + 471 + ], + [ + 473, + 474 + ], + [ + 477, + 479 + ], + [ + 481, + 482 + ], + [ + 484, + 485 + ], + [ + 487, + 488 + ], + [ + 490, + 492 + ], + [ + 494, + 496 + ], + [ + 498, + 500 + ], + [ + 502, + 504 + ], + [ + 506, + 508 + ], + [ + 510, + 511 + ], + [ + 513, + 514 + ], + [ + 516, + 517 + ], + [ + 520, + 521 + ], + [ + 523, + 524 + ], + [ + 526, + 527 + ], + [ + 529, + 530 + ], + [ + 532, + 533 + ], + [ + 535, + 536 + ], + [ + 538, + 540 + ], + [ + 542, + 543 + ], + [ + 545, + 546 + ], + [ + 548, + 549 + ], + [ + 551, + 553 + ], + [ + 555, + 556 + ], + [ + 558, + 559 + ], + [ + 561, + 562 + ], + [ + 564, + 565 + ] + ] + } + }, + { + "filename": "libvips/include/vips/basic.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 37, + 46 + ], + [ + 49, + 60 + ], + [ + 70, + 86 + ], + [ + 91, + 110 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 40, + 41 + ], + [ + 42, + 43 + ], + [ + 52, + 54 + ], + [ + 55, + 57 + ], + [ + 73, + 74 + ], + [ + 77, + 83 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ] + ] + } + }, + { + "filename": "libvips/include/vips/buf.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 39, + 47 + ], + [ + 48, + 118 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 42, + 44 + ], + [ + 51, + 63 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 87 + ], + [ + 88, + 89 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ] + ] + } + }, + { + "filename": "libvips/include/vips/colour.h", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 108, + 304 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 111, + 112 + ], + [ + 113, + 115 + ], + [ + 118, + 119 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 127, + 128 + ], + [ + 130, + 131 + ], + [ + 133, + 134 + ], + [ + 136, + 137 + ], + [ + 139, + 140 + ], + [ + 142, + 143 + ], + [ + 145, + 146 + ], + [ + 148, + 149 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 164, + 165 + ], + [ + 167, + 168 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 180, + 181 + ], + [ + 183, + 184 + ], + [ + 186, + 187 + ], + [ + 189, + 190 + ], + [ + 192, + 193 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 202, + 203 + ], + [ + 206, + 207 + ], + [ + 209, + 210 + ], + [ + 211, + 213 + ], + [ + 215, + 216 + ], + [ + 218, + 219 + ], + [ + 221, + 223 + ], + [ + 224, + 226 + ], + [ + 228, + 229 + ], + [ + 231, + 232 + ], + [ + 234, + 235 + ], + [ + 238, + 240 + ], + [ + 241, + 243 + ], + [ + 244, + 245 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 251, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 264, + 265 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 271, + 273 + ], + [ + 274, + 276 + ], + [ + 278, + 280 + ], + [ + 281, + 283 + ], + [ + 285, + 287 + ], + [ + 288, + 290 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 296, + 298 + ], + [ + 299, + 301 + ] + ] + } + }, + { + "filename": "libvips/include/vips/connection.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 44, + 65 + ], + [ + 68, + 88 + ], + [ + 91, + 121 + ], + [ + 126, + 133 + ], + [ + 140, + 147 + ], + [ + 151, + 158 + ], + [ + 160, + 172 + ], + [ + 177, + 184 + ], + [ + 185, + 191 + ], + [ + 199, + 206 + ], + [ + 210, + 278 + ], + [ + 288, + 322 + ], + [ + 334, + 360 + ], + [ + 375, + 403 + ], + [ + 411, + 418 + ], + [ + 435, + 441 + ], + [ + 445, + 459 + ], + [ + 463, + 538 + ], + [ + 545, + 563 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 47, + 62 + ], + [ + 71, + 72 + ], + [ + 75, + 76 + ], + [ + 79, + 80 + ], + [ + 82, + 83 + ], + [ + 84, + 85 + ], + [ + 94, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 105, + 118 + ], + [ + 129, + 130 + ], + [ + 143, + 144 + ], + [ + 154, + 155 + ], + [ + 163, + 164 + ], + [ + 168, + 169 + ], + [ + 180, + 181 + ], + [ + 202, + 203 + ], + [ + 213, + 214 + ], + [ + 218, + 219 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 230 + ], + [ + 231, + 232 + ], + [ + 234, + 235 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 244, + 245 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 252, + 253 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 262, + 275 + ], + [ + 291, + 293 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 301, + 302 + ], + [ + 306, + 319 + ], + [ + 337, + 338 + ], + [ + 339, + 340 + ], + [ + 344, + 357 + ], + [ + 378, + 379 + ], + [ + 381, + 394 + ], + [ + 399, + 400 + ], + [ + 414, + 415 + ], + [ + 448, + 449 + ], + [ + 452, + 453 + ], + [ + 455, + 456 + ], + [ + 466, + 467 + ], + [ + 470, + 471 + ], + [ + 475, + 476 + ], + [ + 480, + 481 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 487, + 488 + ], + [ + 489, + 490 + ], + [ + 491, + 492 + ], + [ + 493, + 494 + ], + [ + 495, + 496 + ], + [ + 497, + 498 + ], + [ + 499, + 500 + ], + [ + 501, + 502 + ], + [ + 503, + 504 + ], + [ + 506, + 509 + ], + [ + 510, + 511 + ], + [ + 512, + 514 + ], + [ + 515, + 516 + ], + [ + 518, + 531 + ], + [ + 534, + 535 + ], + [ + 548, + 553 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ] + ] + } + }, + { + "filename": "libvips/include/vips/conversion.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 135, + 354 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 138, + 139 + ], + [ + 141, + 142 + ], + [ + 144, + 145 + ], + [ + 147, + 148 + ], + [ + 150, + 151 + ], + [ + 153, + 154 + ], + [ + 157, + 159 + ], + [ + 161, + 163 + ], + [ + 165, + 166 + ], + [ + 168, + 170 + ], + [ + 172, + 174 + ], + [ + 176, + 177 + ], + [ + 179, + 181 + ], + [ + 183, + 185 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 193, + 194 + ], + [ + 196, + 198 + ], + [ + 200, + 201 + ], + [ + 203, + 204 + ], + [ + 206, + 207 + ], + [ + 209, + 210 + ], + [ + 212, + 213 + ], + [ + 215, + 216 + ], + [ + 218, + 219 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 226, + 227 + ], + [ + 229, + 230 + ], + [ + 233, + 234 + ], + [ + 236, + 237 + ], + [ + 239, + 240 + ], + [ + 242, + 243 + ], + [ + 245, + 246 + ], + [ + 248, + 249 + ], + [ + 251, + 252 + ], + [ + 254, + 255 + ], + [ + 257, + 258 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 266, + 267 + ], + [ + 269, + 270 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 279, + 280 + ], + [ + 282, + 283 + ], + [ + 285, + 286 + ], + [ + 288, + 289 + ], + [ + 291, + 292 + ], + [ + 294, + 295 + ], + [ + 298, + 300 + ], + [ + 302, + 303 + ], + [ + 305, + 306 + ], + [ + 308, + 309 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 319, + 321 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ], + [ + 330, + 331 + ], + [ + 333, + 334 + ], + [ + 336, + 337 + ], + [ + 339, + 340 + ], + [ + 342, + 344 + ], + [ + 347, + 348 + ], + [ + 350, + 351 + ] + ] + } + }, + { + "filename": "libvips/include/vips/convolution.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 46, + 92 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 49, + 50 + ], + [ + 52, + 53 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 62 + ], + [ + 64, + 65 + ], + [ + 68, + 69 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 78, + 79 + ], + [ + 81, + 82 + ], + [ + 85, + 86 + ], + [ + 88, + 89 + ] + ] + } + }, + { + "filename": "libvips/include/vips/create.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 47, + 158 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 50, + 51 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 97, + 99 + ], + [ + 101, + 103 + ], + [ + 105, + 108 + ], + [ + 110, + 113 + ], + [ + 115, + 119 + ], + [ + 121, + 125 + ], + [ + 127, + 129 + ], + [ + 131, + 134 + ], + [ + 136, + 139 + ], + [ + 141, + 143 + ], + [ + 146, + 148 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ] + ] + } + }, + { + "filename": "libvips/include/vips/dbuf.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 59, + 101 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 62, + 63 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 79 + ], + [ + 80, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ] + ] + } + }, + { + "filename": "libvips/include/vips/debug.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 103 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 45 + ], + [ + 46, + 52 + ], + [ + 55, + 61 + ], + [ + 62, + 68 + ], + [ + 71, + 77 + ], + [ + 78, + 84 + ], + [ + 87, + 93 + ], + [ + 94, + 100 + ] + ] + } + }, + { + "filename": "libvips/include/vips/deprecated.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 50, + 121 + ], + [ + 125, + 150 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 53, + 60 + ], + [ + 62, + 74 + ], + [ + 77, + 91 + ], + [ + 92, + 105 + ], + [ + 106, + 114 + ], + [ + 115, + 118 + ], + [ + 128, + 129 + ], + [ + 131, + 133 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 147 + ] + ] + } + }, + { + "filename": "libvips/include/vips/dispatch.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 45, + 122 + ], + [ + 125, + 155 + ], + [ + 157, + 186 + ], + [ + 219, + 386 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 48, + 62 + ], + [ + 64, + 65 + ], + [ + 69, + 71 + ], + [ + 73, + 77 + ], + [ + 80, + 84 + ], + [ + 90, + 92 + ], + [ + 96, + 101 + ], + [ + 103, + 104 + ], + [ + 106, + 107 + ], + [ + 111, + 114 + ], + [ + 118, + 119 + ], + [ + 128, + 133 + ], + [ + 138, + 144 + ], + [ + 149, + 152 + ], + [ + 160, + 162 + ], + [ + 167, + 169 + ], + [ + 174, + 176 + ], + [ + 181, + 183 + ], + [ + 222, + 231 + ], + [ + 234, + 341 + ], + [ + 345, + 346 + ], + [ + 347, + 349 + ], + [ + 353, + 354 + ], + [ + 358, + 359 + ], + [ + 363, + 364 + ], + [ + 365, + 366 + ], + [ + 367, + 368 + ], + [ + 372, + 373 + ], + [ + 374, + 375 + ], + [ + 379, + 380 + ], + [ + 382, + 383 + ] + ] + } + }, + { + "filename": "libvips/include/vips/draw.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 46, + 110 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 49, + 50 + ], + [ + 52, + 54 + ], + [ + 56, + 58 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 67, + 68 + ], + [ + 71, + 73 + ], + [ + 75, + 77 + ], + [ + 80, + 82 + ], + [ + 84, + 86 + ], + [ + 89, + 91 + ], + [ + 93, + 95 + ], + [ + 98, + 99 + ], + [ + 101, + 102 + ], + [ + 105, + 107 + ] + ] + } + }, + { + "filename": "libvips/include/vips/error.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 140 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 40 + ], + [ + 41, + 42 + ], + [ + 43, + 44 + ], + [ + 46, + 47 + ], + [ + 48, + 49 + ], + [ + 51, + 53 + ], + [ + 54, + 55 + ], + [ + 56, + 58 + ], + [ + 59, + 61 + ], + [ + 62, + 63 + ], + [ + 64, + 65 + ], + [ + 67, + 69 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 102, + 103 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 130, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 137 + ] + ] + } + }, + { + "filename": "libvips/include/vips/foreign.h", + "line_filter": { + "diff_chunks": [ + [ + 4, + 32 + ], + [ + 42, + 61 + ], + [ + 91, + 123 + ], + [ + 129, + 158 + ], + [ + 198, + 267 + ], + [ + 269, + 314 + ], + [ + 343, + 350 + ], + [ + 363, + 380 + ], + [ + 391, + 423 + ], + [ + 452, + 478 + ], + [ + 496, + 522 + ], + [ + 583, + 673 + ], + [ + 691, + 713 + ], + [ + 741, + 890 + ], + [ + 894, + 901 + ], + [ + 936, + 949 + ], + [ + 952, + 959 + ] + ], + "lines_added": [ + [ + 7, + 23 + ], + [ + 28, + 29 + ], + [ + 45, + 58 + ], + [ + 94, + 96 + ], + [ + 97, + 98 + ], + [ + 103, + 108 + ], + [ + 110, + 111 + ], + [ + 112, + 113 + ], + [ + 117, + 120 + ], + [ + 132, + 145 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 211, + 213 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 226, + 228 + ], + [ + 232, + 233 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 247, + 248 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ], + [ + 257, + 259 + ], + [ + 263, + 264 + ], + [ + 272, + 273 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 279, + 280 + ], + [ + 281, + 282 + ], + [ + 283, + 285 + ], + [ + 286, + 288 + ], + [ + 290, + 291 + ], + [ + 293, + 308 + ], + [ + 310, + 311 + ], + [ + 346, + 347 + ], + [ + 366, + 368 + ], + [ + 374, + 377 + ], + [ + 394, + 395 + ], + [ + 396, + 397 + ], + [ + 398, + 399 + ], + [ + 400, + 401 + ], + [ + 403, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 410 + ], + [ + 412, + 413 + ], + [ + 416, + 417 + ], + [ + 419, + 420 + ], + [ + 455, + 456 + ], + [ + 458, + 459 + ], + [ + 461, + 462 + ], + [ + 465, + 466 + ], + [ + 468, + 469 + ], + [ + 471, + 472 + ], + [ + 474, + 475 + ], + [ + 499, + 500 + ], + [ + 502, + 503 + ], + [ + 505, + 506 + ], + [ + 509, + 510 + ], + [ + 512, + 513 + ], + [ + 515, + 516 + ], + [ + 518, + 519 + ], + [ + 586, + 587 + ], + [ + 589, + 590 + ], + [ + 592, + 593 + ], + [ + 595, + 596 + ], + [ + 598, + 599 + ], + [ + 601, + 602 + ], + [ + 605, + 606 + ], + [ + 609, + 610 + ], + [ + 612, + 613 + ], + [ + 616, + 617 + ], + [ + 620, + 622 + ], + [ + 624, + 625 + ], + [ + 627, + 628 + ], + [ + 631, + 632 + ], + [ + 634, + 635 + ], + [ + 637, + 638 + ], + [ + 640, + 641 + ], + [ + 644, + 645 + ], + [ + 647, + 648 + ], + [ + 650, + 651 + ], + [ + 653, + 654 + ], + [ + 656, + 657 + ], + [ + 660, + 661 + ], + [ + 663, + 664 + ], + [ + 666, + 667 + ], + [ + 669, + 670 + ], + [ + 694, + 695 + ], + [ + 697, + 698 + ], + [ + 700, + 701 + ], + [ + 703, + 704 + ], + [ + 706, + 707 + ], + [ + 709, + 710 + ], + [ + 744, + 745 + ], + [ + 747, + 748 + ], + [ + 750, + 751 + ], + [ + 753, + 754 + ], + [ + 757, + 758 + ], + [ + 761, + 762 + ], + [ + 764, + 765 + ], + [ + 767, + 768 + ], + [ + 770, + 771 + ], + [ + 773, + 774 + ], + [ + 776, + 777 + ], + [ + 780, + 781 + ], + [ + 783, + 784 + ], + [ + 786, + 787 + ], + [ + 790, + 791 + ], + [ + 793, + 794 + ], + [ + 796, + 797 + ], + [ + 799, + 800 + ], + [ + 803, + 804 + ], + [ + 806, + 807 + ], + [ + 809, + 810 + ], + [ + 813, + 814 + ], + [ + 816, + 817 + ], + [ + 819, + 820 + ], + [ + 823, + 824 + ], + [ + 826, + 827 + ], + [ + 829, + 830 + ], + [ + 832, + 833 + ], + [ + 835, + 836 + ], + [ + 838, + 839 + ], + [ + 842, + 843 + ], + [ + 845, + 846 + ], + [ + 848, + 849 + ], + [ + 852, + 853 + ], + [ + 855, + 856 + ], + [ + 858, + 859 + ], + [ + 861, + 862 + ], + [ + 864, + 865 + ], + [ + 867, + 868 + ], + [ + 871, + 872 + ], + [ + 874, + 875 + ], + [ + 877, + 878 + ], + [ + 880, + 881 + ], + [ + 883, + 884 + ], + [ + 886, + 887 + ], + [ + 897, + 898 + ], + [ + 939, + 940 + ], + [ + 942, + 943 + ], + [ + 945, + 946 + ], + [ + 955, + 956 + ] + ] + } + }, + { + "filename": "libvips/include/vips/format.h", + "line_filter": { + "diff_chunks": [ + [ + 4, + 32 + ], + [ + 37, + 63 + ], + [ + 74, + 97 + ], + [ + 105, + 133 + ] + ], + "lines_added": [ + [ + 7, + 23 + ], + [ + 28, + 29 + ], + [ + 40, + 55 + ], + [ + 57, + 60 + ], + [ + 77, + 78 + ], + [ + 81, + 82 + ], + [ + 85, + 86 + ], + [ + 89, + 90 + ], + [ + 93, + 94 + ], + [ + 108, + 109 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 121, + 123 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ] + ] + } + }, + { + "filename": "libvips/include/vips/freqfilt.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 39, + 61 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 43 + ], + [ + 45, + 46 + ], + [ + 49, + 50 + ], + [ + 53, + 54 + ], + [ + 57, + 58 + ] + ] + } + }, + { + "filename": "libvips/include/vips/gate.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 37, + 88 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 40, + 71 + ], + [ + 75, + 76 + ], + [ + 77, + 80 + ], + [ + 81, + 83 + ], + [ + 84, + 85 + ] + ] + } + }, + { + "filename": "libvips/include/vips/generate.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 37, + 89 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 40, + 41 + ], + [ + 42, + 43 + ], + [ + 45, + 46 + ], + [ + 47, + 48 + ], + [ + 49, + 50 + ], + [ + 52, + 53 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 59, + 60 + ], + [ + 62, + 63 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 82, + 84 + ], + [ + 85, + 86 + ] + ] + } + }, + { + "filename": "libvips/include/vips/header.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 80, + 87 + ], + [ + 105, + 120 + ], + [ + 130, + 137 + ], + [ + 139, + 153 + ], + [ + 165, + 310 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 83, + 84 + ], + [ + 108, + 109 + ], + [ + 115, + 117 + ], + [ + 133, + 134 + ], + [ + 142, + 143 + ], + [ + 149, + 150 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 208 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 213, + 214 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 219, + 220 + ], + [ + 222, + 227 + ], + [ + 229, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 236 + ], + [ + 237, + 238 + ], + [ + 239, + 242 + ], + [ + 243, + 244 + ], + [ + 245, + 246 + ], + [ + 248, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 257 + ], + [ + 258, + 260 + ], + [ + 261, + 263 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 269, + 271 + ], + [ + 272, + 273 + ], + [ + 274, + 276 + ], + [ + 277, + 279 + ], + [ + 280, + 281 + ], + [ + 282, + 284 + ], + [ + 285, + 286 + ], + [ + 287, + 289 + ], + [ + 290, + 292 + ], + [ + 293, + 295 + ], + [ + 296, + 298 + ], + [ + 300, + 302 + ], + [ + 303, + 305 + ], + [ + 306, + 307 + ] + ] + } + }, + { + "filename": "libvips/include/vips/histogram.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 39, + 82 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 43 + ], + [ + 45, + 46 + ], + [ + 48, + 49 + ], + [ + 51, + 52 + ], + [ + 54, + 55 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 63, + 64 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 73, + 74 + ], + [ + 77, + 79 + ] + ] + } + }, + { + "filename": "libvips/include/vips/image.h", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 47, + 55 + ], + [ + 64, + 90 + ], + [ + 140, + 181 + ], + [ + 187, + 213 + ], + [ + 217, + 225 + ], + [ + 232, + 261 + ], + [ + 271, + 278 + ], + [ + 328, + 365 + ], + [ + 373, + 603 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 50, + 52 + ], + [ + 67, + 69 + ], + [ + 71, + 72 + ], + [ + 78, + 87 + ], + [ + 143, + 147 + ], + [ + 153, + 154 + ], + [ + 156, + 162 + ], + [ + 165, + 178 + ], + [ + 190, + 193 + ], + [ + 194, + 199 + ], + [ + 200, + 202 + ], + [ + 203, + 204 + ], + [ + 209, + 210 + ], + [ + 220, + 222 + ], + [ + 235, + 241 + ], + [ + 242, + 243 + ], + [ + 248, + 249 + ], + [ + 250, + 253 + ], + [ + 256, + 258 + ], + [ + 274, + 275 + ], + [ + 331, + 332 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 341, + 343 + ], + [ + 346, + 347 + ], + [ + 348, + 350 + ], + [ + 351, + 352 + ], + [ + 353, + 354 + ], + [ + 357, + 358 + ], + [ + 361, + 362 + ], + [ + 376, + 377 + ], + [ + 378, + 385 + ], + [ + 386, + 387 + ], + [ + 392, + 411 + ], + [ + 412, + 413 + ], + [ + 414, + 416 + ], + [ + 419, + 425 + ], + [ + 426, + 428 + ], + [ + 431, + 432 + ], + [ + 434, + 435 + ], + [ + 437, + 438 + ], + [ + 440, + 441 + ], + [ + 443, + 444 + ], + [ + 445, + 446 + ], + [ + 447, + 448 + ], + [ + 450, + 451 + ], + [ + 452, + 453 + ], + [ + 455, + 456 + ], + [ + 457, + 458 + ], + [ + 459, + 460 + ], + [ + 461, + 462 + ], + [ + 464, + 465 + ], + [ + 466, + 468 + ], + [ + 469, + 471 + ], + [ + 472, + 474 + ], + [ + 475, + 477 + ], + [ + 479, + 481 + ], + [ + 482, + 483 + ], + [ + 484, + 485 + ], + [ + 486, + 488 + ], + [ + 489, + 491 + ], + [ + 492, + 494 + ], + [ + 495, + 496 + ], + [ + 498, + 500 + ], + [ + 501, + 502 + ], + [ + 503, + 504 + ], + [ + 506, + 507 + ], + [ + 508, + 509 + ], + [ + 511, + 513 + ], + [ + 515, + 517 + ], + [ + 519, + 520 + ], + [ + 522, + 524 + ], + [ + 525, + 526 + ], + [ + 527, + 528 + ], + [ + 530, + 531 + ], + [ + 532, + 533 + ], + [ + 534, + 535 + ], + [ + 536, + 537 + ], + [ + 539, + 540 + ], + [ + 541, + 542 + ], + [ + 543, + 544 + ], + [ + 545, + 546 + ], + [ + 547, + 548 + ], + [ + 549, + 550 + ], + [ + 552, + 553 + ], + [ + 555, + 556 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ], + [ + 561, + 562 + ], + [ + 563, + 564 + ], + [ + 566, + 567 + ], + [ + 572, + 573 + ], + [ + 574, + 575 + ], + [ + 576, + 578 + ], + [ + 579, + 580 + ], + [ + 581, + 583 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 588, + 589 + ], + [ + 593, + 595 + ], + [ + 596, + 597 + ], + [ + 599, + 600 + ] + ] + } + }, + { + "filename": "libvips/include/vips/inlines.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 38 + ], + [ + 46, + 67 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 34, + 35 + ], + [ + 49, + 51 + ], + [ + 52, + 54 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 63, + 64 + ] + ] + } + }, + { + "filename": "libvips/include/vips/internal.h", + "line_filter": { + "diff_chunks": [ + [ + 7, + 35 + ], + [ + 42, + 76 + ], + [ + 78, + 87 + ], + [ + 89, + 113 + ], + [ + 131, + 390 + ] + ], + "lines_added": [ + [ + 10, + 11 + ], + [ + 12, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 26 + ], + [ + 31, + 32 + ], + [ + 45, + 55 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 81, + 82 + ], + [ + 83, + 84 + ], + [ + 92, + 94 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 110 + ], + [ + 134, + 135 + ], + [ + 138, + 140 + ], + [ + 146, + 151 + ], + [ + 152, + 153 + ], + [ + 154, + 157 + ], + [ + 160, + 162 + ], + [ + 168, + 169 + ], + [ + 175, + 176 + ], + [ + 177, + 180 + ], + [ + 181, + 184 + ], + [ + 190, + 191 + ], + [ + 197, + 198 + ], + [ + 204, + 205 + ], + [ + 206, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 213 + ], + [ + 216, + 217 + ], + [ + 220, + 221 + ], + [ + 224, + 226 + ], + [ + 229, + 230 + ], + [ + 233, + 235 + ], + [ + 238, + 242 + ], + [ + 248, + 249 + ], + [ + 250, + 255 + ], + [ + 256, + 262 + ], + [ + 265, + 268 + ], + [ + 271, + 273 + ], + [ + 274, + 278 + ], + [ + 279, + 283 + ], + [ + 284, + 288 + ], + [ + 289, + 291 + ], + [ + 294, + 295 + ], + [ + 298, + 313 + ], + [ + 316, + 317 + ], + [ + 318, + 321 + ], + [ + 322, + 323 + ], + [ + 324, + 325 + ], + [ + 329, + 330 + ], + [ + 331, + 335 + ], + [ + 340, + 341 + ], + [ + 344, + 347 + ], + [ + 349, + 350 + ], + [ + 351, + 352 + ], + [ + 353, + 354 + ], + [ + 355, + 356 + ], + [ + 358, + 359 + ], + [ + 360, + 363 + ], + [ + 366, + 368 + ], + [ + 369, + 370 + ], + [ + 371, + 372 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 381, + 382 + ], + [ + 383, + 384 + ], + [ + 386, + 387 + ] + ] + } + }, + { + "filename": "libvips/include/vips/interpolate.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 43, + 62 + ], + [ + 66, + 74 + ], + [ + 79, + 86 + ], + [ + 88, + 95 + ], + [ + 97, + 111 + ], + [ + 123, + 141 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 46, + 59 + ], + [ + 69, + 71 + ], + [ + 82, + 83 + ], + [ + 91, + 92 + ], + [ + 100, + 102 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 134, + 135 + ] + ] + } + }, + { + "filename": "libvips/include/vips/mask.h", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 59, + 161 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 62, + 63 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 90, + 91 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 105, + 107 + ], + [ + 108, + 110 + ], + [ + 111, + 113 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 129, + 130 + ], + [ + 131, + 132 + ], + [ + 133, + 134 + ], + [ + 135, + 136 + ], + [ + 138, + 139 + ], + [ + 140, + 142 + ], + [ + 143, + 144 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 155, + 156 + ], + [ + 157, + 158 + ] + ] + } + }, + { + "filename": "libvips/include/vips/memory.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 37, + 99 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 40, + 73 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 82, + 83 + ], + [ + 84, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 91, + 92 + ], + [ + 93, + 94 + ], + [ + 95, + 96 + ] + ] + } + }, + { + "filename": "libvips/include/vips/morphology.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 45, + 70 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 48, + 50 + ], + [ + 52, + 54 + ], + [ + 56, + 57 + ], + [ + 59, + 61 + ], + [ + 63, + 64 + ], + [ + 66, + 67 + ] + ] + } + }, + { + "filename": "libvips/include/vips/mosaicing.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 39, + 78 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 44 + ], + [ + 46, + 48 + ], + [ + 51, + 55 + ], + [ + 58, + 61 + ], + [ + 64, + 65 + ], + [ + 67, + 69 + ], + [ + 72, + 73 + ] + ] + } + }, + { + "filename": "libvips/include/vips/object.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 43, + 61 + ], + [ + 85, + 271 + ], + [ + 279, + 287 + ], + [ + 303, + 310 + ], + [ + 317, + 379 + ], + [ + 386, + 393 + ], + [ + 394, + 448 + ], + [ + 466, + 473 + ], + [ + 476, + 482 + ], + [ + 484, + 533 + ], + [ + 537, + 549 + ], + [ + 553, + 563 + ], + [ + 566, + 579 + ], + [ + 584, + 634 + ], + [ + 635, + 724 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 46, + 54 + ], + [ + 55, + 56 + ], + [ + 57, + 58 + ], + [ + 88, + 89 + ], + [ + 95, + 97 + ], + [ + 100, + 101 + ], + [ + 104, + 106 + ], + [ + 109, + 263 + ], + [ + 267, + 268 + ], + [ + 282, + 284 + ], + [ + 306, + 307 + ], + [ + 320, + 326 + ], + [ + 327, + 329 + ], + [ + 330, + 333 + ], + [ + 334, + 335 + ], + [ + 336, + 338 + ], + [ + 339, + 340 + ], + [ + 341, + 342 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 348, + 350 + ], + [ + 351, + 352 + ], + [ + 357, + 376 + ], + [ + 389, + 390 + ], + [ + 397, + 398 + ], + [ + 399, + 404 + ], + [ + 405, + 407 + ], + [ + 409, + 412 + ], + [ + 414, + 417 + ], + [ + 419, + 421 + ], + [ + 422, + 424 + ], + [ + 425, + 426 + ], + [ + 429, + 430 + ], + [ + 432, + 433 + ], + [ + 435, + 445 + ], + [ + 469, + 470 + ], + [ + 487, + 488 + ], + [ + 489, + 490 + ], + [ + 491, + 492 + ], + [ + 496, + 497 + ], + [ + 500, + 501 + ], + [ + 502, + 503 + ], + [ + 506, + 507 + ], + [ + 508, + 509 + ], + [ + 511, + 512 + ], + [ + 516, + 517 + ], + [ + 520, + 521 + ], + [ + 524, + 525 + ], + [ + 529, + 530 + ], + [ + 540, + 541 + ], + [ + 543, + 544 + ], + [ + 545, + 546 + ], + [ + 556, + 557 + ], + [ + 559, + 560 + ], + [ + 569, + 570 + ], + [ + 575, + 576 + ], + [ + 587, + 588 + ], + [ + 593, + 597 + ], + [ + 600, + 601 + ], + [ + 602, + 604 + ], + [ + 605, + 607 + ], + [ + 609, + 610 + ], + [ + 611, + 612 + ], + [ + 614, + 615 + ], + [ + 616, + 617 + ], + [ + 618, + 619 + ], + [ + 621, + 622 + ], + [ + 623, + 624 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 630, + 631 + ], + [ + 638, + 641 + ], + [ + 642, + 644 + ], + [ + 645, + 647 + ], + [ + 648, + 650 + ], + [ + 651, + 652 + ], + [ + 653, + 654 + ], + [ + 655, + 657 + ], + [ + 659, + 660 + ], + [ + 661, + 662 + ], + [ + 664, + 665 + ], + [ + 667, + 669 + ], + [ + 670, + 671 + ], + [ + 673, + 674 + ], + [ + 675, + 678 + ], + [ + 679, + 680 + ], + [ + 681, + 682 + ], + [ + 683, + 684 + ], + [ + 685, + 686 + ], + [ + 687, + 688 + ], + [ + 690, + 691 + ], + [ + 692, + 694 + ], + [ + 696, + 697 + ], + [ + 699, + 702 + ], + [ + 704, + 705 + ], + [ + 706, + 707 + ], + [ + 708, + 709 + ], + [ + 711, + 712 + ], + [ + 714, + 715 + ], + [ + 717, + 718 + ] + ] + } + }, + { + "filename": "libvips/include/vips/operation.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 52, + 73 + ], + [ + 87, + 104 + ], + [ + 106, + 180 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 55, + 70 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 94, + 95 + ], + [ + 100, + 101 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 126, + 127 + ], + [ + 128, + 130 + ], + [ + 132, + 133 + ], + [ + 134, + 135 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 155, + 156 + ], + [ + 157, + 158 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 163, + 164 + ], + [ + 165, + 166 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ] + ] + } + }, + { + "filename": "libvips/include/vips/private.h", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 42, + 54 + ], + [ + 60, + 91 + ], + [ + 92, + 141 + ], + [ + 143, + 156 + ], + [ + 163, + 191 + ], + [ + 192, + 225 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 27 + ], + [ + 32, + 33 + ], + [ + 45, + 46 + ], + [ + 50, + 51 + ], + [ + 63, + 65 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 70, + 72 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 82, + 84 + ], + [ + 87, + 88 + ], + [ + 95, + 97 + ], + [ + 99, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 109, + 117 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 130, + 131 + ], + [ + 132, + 134 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 146, + 150 + ], + [ + 152, + 153 + ], + [ + 166, + 168 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 175, + 177 + ], + [ + 178, + 180 + ], + [ + 184, + 185 + ], + [ + 187, + 188 + ], + [ + 195, + 197 + ], + [ + 202, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 208 + ], + [ + 210, + 211 + ], + [ + 214, + 215 + ], + [ + 221, + 222 + ] + ] + } + }, + { + "filename": "libvips/include/vips/rect.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 51, + 78 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 54, + 55 + ], + [ + 56, + 57 + ], + [ + 58, + 59 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 64, + 65 + ], + [ + 66, + 68 + ], + [ + 69, + 71 + ], + [ + 72, + 73 + ], + [ + 74, + 75 + ] + ] + } + }, + { + "filename": "libvips/include/vips/region.h", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 48, + 67 + ], + [ + 93, + 109 + ], + [ + 120, + 127 + ], + [ + 134, + 235 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 32, + 33 + ], + [ + 51, + 64 + ], + [ + 96, + 98 + ], + [ + 102, + 106 + ], + [ + 123, + 124 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 146 + ], + [ + 147, + 148 + ], + [ + 149, + 150 + ], + [ + 152, + 153 + ], + [ + 154, + 156 + ], + [ + 157, + 158 + ], + [ + 159, + 161 + ], + [ + 162, + 164 + ], + [ + 165, + 167 + ], + [ + 169, + 170 + ], + [ + 171, + 173 + ], + [ + 175, + 177 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 183, + 184 + ], + [ + 189, + 190 + ], + [ + 191, + 192 + ], + [ + 194, + 204 + ], + [ + 208, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 229 + ], + [ + 231, + 232 + ] + ] + } + }, + { + "filename": "libvips/include/vips/resample.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 57, + 120 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 62 + ], + [ + 64, + 65 + ], + [ + 67, + 68 + ], + [ + 71, + 73 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 82, + 83 + ], + [ + 85, + 87 + ], + [ + 89, + 90 + ], + [ + 92, + 94 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 103, + 105 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ] + ] + } + }, + { + "filename": "libvips/include/vips/sbuf.h", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 42, + 66 + ], + [ + 96, + 137 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 24 + ], + [ + 29, + 30 + ], + [ + 45, + 58 + ], + [ + 62, + 63 + ], + [ + 99, + 100 + ], + [ + 102, + 103 + ], + [ + 105, + 106 + ], + [ + 108, + 111 + ], + [ + 112, + 118 + ], + [ + 120, + 125 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 131, + 132 + ], + [ + 133, + 134 + ] + ] + } + }, + { + "filename": "libvips/include/vips/semaphore.h", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 56, + 73 + ] + ], + "lines_added": [ + [ + 12, + 28 + ], + [ + 33, + 34 + ], + [ + 59, + 60 + ], + [ + 61, + 62 + ], + [ + 63, + 64 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ] + ] + } + }, + { + "filename": "libvips/include/vips/thread.h", + "line_filter": { + "diff_chunks": [ + [ + 4, + 32 + ], + [ + 40, + 72 + ] + ], + "lines_added": [ + [ + 7, + 23 + ], + [ + 28, + 29 + ], + [ + 43, + 44 + ], + [ + 45, + 46 + ], + [ + 50, + 51 + ], + [ + 52, + 53 + ], + [ + 57, + 58 + ], + [ + 59, + 60 + ], + [ + 62, + 63 + ], + [ + 65, + 69 + ] + ] + } + }, + { + "filename": "libvips/include/vips/threadpool.h", + "line_filter": { + "diff_chunks": [ + [ + 11, + 39 + ], + [ + 51, + 75 + ], + [ + 79, + 88 + ], + [ + 94, + 101 + ], + [ + 110, + 117 + ], + [ + 118, + 157 + ] + ], + "lines_added": [ + [ + 14, + 30 + ], + [ + 35, + 36 + ], + [ + 59, + 72 + ], + [ + 82, + 83 + ], + [ + 84, + 85 + ], + [ + 97, + 98 + ], + [ + 113, + 114 + ], + [ + 121, + 122 + ], + [ + 125, + 126 + ], + [ + 128, + 129 + ], + [ + 131, + 133 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 142, + 143 + ], + [ + 145, + 148 + ], + [ + 150, + 151 + ], + [ + 152, + 154 + ] + ] + } + }, + { + "filename": "libvips/include/vips/transform.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 42, + 52 + ], + [ + 54, + 87 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 45, + 47 + ], + [ + 48, + 49 + ], + [ + 57, + 58 + ], + [ + 61, + 62 + ], + [ + 64, + 84 + ] + ] + } + }, + { + "filename": "libvips/include/vips/type.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 53, + 66 + ], + [ + 68, + 83 + ], + [ + 94, + 130 + ], + [ + 132, + 139 + ], + [ + 152, + 166 + ], + [ + 170, + 190 + ], + [ + 194, + 210 + ], + [ + 214, + 230 + ], + [ + 234, + 241 + ], + [ + 245, + 301 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 56, + 57 + ], + [ + 62, + 63 + ], + [ + 71, + 72 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 110, + 112 + ], + [ + 114, + 124 + ], + [ + 125, + 127 + ], + [ + 135, + 136 + ], + [ + 155, + 156 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 173, + 174 + ], + [ + 178, + 180 + ], + [ + 181, + 182 + ], + [ + 183, + 184 + ], + [ + 185, + 187 + ], + [ + 197, + 198 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 217, + 218 + ], + [ + 222, + 223 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 237, + 238 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 257, + 259 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 266, + 267 + ], + [ + 268, + 270 + ], + [ + 271, + 272 + ], + [ + 274, + 276 + ], + [ + 277, + 279 + ], + [ + 281, + 282 + ], + [ + 283, + 284 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 295, + 298 + ] + ] + } + }, + { + "filename": "libvips/include/vips/util.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 7, + 35 + ], + [ + 46, + 250 + ], + [ + 251, + 372 + ], + [ + 374, + 381 + ], + [ + 383, + 439 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 10, + 11 + ], + [ + 12, + 16 + ], + [ + 17, + 26 + ], + [ + 31, + 32 + ], + [ + 49, + 50 + ], + [ + 51, + 53 + ], + [ + 54, + 56 + ], + [ + 57, + 59 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 68, + 76 + ], + [ + 77, + 85 + ], + [ + 89, + 96 + ], + [ + 100, + 101 + ], + [ + 102, + 104 + ], + [ + 107, + 118 + ], + [ + 121, + 163 + ], + [ + 165, + 166 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 178, + 247 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 269, + 271 + ], + [ + 272, + 274 + ], + [ + 275, + 276 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 282, + 284 + ], + [ + 286, + 287 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ], + [ + 292, + 293 + ], + [ + 294, + 295 + ], + [ + 296, + 297 + ], + [ + 298, + 299 + ], + [ + 301, + 302 + ], + [ + 303, + 305 + ], + [ + 307, + 308 + ], + [ + 310, + 311 + ], + [ + 314, + 315 + ], + [ + 319, + 322 + ], + [ + 323, + 327 + ], + [ + 330, + 334 + ], + [ + 337, + 340 + ], + [ + 341, + 346 + ], + [ + 347, + 348 + ], + [ + 351, + 353 + ], + [ + 354, + 356 + ], + [ + 357, + 359 + ], + [ + 360, + 362 + ], + [ + 363, + 365 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 377, + 378 + ], + [ + 386, + 387 + ], + [ + 393, + 404 + ], + [ + 407, + 409 + ], + [ + 411, + 412 + ], + [ + 413, + 414 + ], + [ + 418, + 419 + ], + [ + 420, + 422 + ], + [ + 424, + 425 + ], + [ + 426, + 428 + ], + [ + 429, + 431 + ], + [ + 432, + 433 + ], + [ + 435, + 436 + ] + ] + } + }, + { + "filename": "libvips/include/vips/vector.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 59, + 66 + ], + [ + 67, + 74 + ], + [ + 81, + 88 + ], + [ + 92, + 101 + ], + [ + 117, + 181 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 62, + 63 + ], + [ + 70, + 71 + ], + [ + 84, + 85 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 127, + 128 + ], + [ + 129, + 130 + ], + [ + 132, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 148 + ], + [ + 149, + 151 + ], + [ + 152, + 153 + ], + [ + 155, + 156 + ], + [ + 158, + 159 + ], + [ + 161, + 163 + ], + [ + 164, + 166 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 177, + 178 + ] + ] + } + }, + { + "filename": "libvips/include/vips/video.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 39, + 50 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 42, + 43 + ], + [ + 44, + 45 + ], + [ + 46, + 47 + ] + ] + } + }, + { + "filename": "libvips/include/vips/vips.h", + "line_filter": { + "diff_chunks": [ + [ + 52, + 80 + ], + [ + 145, + 193 + ] + ], + "lines_added": [ + [ + 55, + 71 + ], + [ + 76, + 77 + ], + [ + 148, + 160 + ], + [ + 162, + 163 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ] + ] + } + }, + { + "filename": "libvips/include/vips/vips7compat.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 43, + 90 + ], + [ + 213, + 284 + ], + [ + 291, + 298 + ], + [ + 299, + 379 + ], + [ + 396, + 408 + ], + [ + 412, + 546 + ], + [ + 553, + 581 + ], + [ + 655, + 1062 + ], + [ + 1063, + 1177 + ], + [ + 1182, + 1579 + ], + [ + 1581, + 1590 + ], + [ + 1612, + 1659 + ], + [ + 1668, + 1671 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 46, + 47 + ], + [ + 48, + 51 + ], + [ + 52, + 55 + ], + [ + 56, + 59 + ], + [ + 60, + 63 + ], + [ + 64, + 67 + ], + [ + 68, + 71 + ], + [ + 72, + 75 + ], + [ + 76, + 79 + ], + [ + 80, + 83 + ], + [ + 84, + 87 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 221, + 223 + ], + [ + 229, + 233 + ], + [ + 236, + 237 + ], + [ + 241, + 242 + ], + [ + 246, + 247 + ], + [ + 251, + 252 + ], + [ + 256, + 257 + ], + [ + 261, + 262 + ], + [ + 266, + 267 + ], + [ + 268, + 270 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 276, + 277 + ], + [ + 280, + 281 + ], + [ + 294, + 295 + ], + [ + 302, + 303 + ], + [ + 305, + 306 + ], + [ + 308, + 310 + ], + [ + 311, + 313 + ], + [ + 317, + 319 + ], + [ + 320, + 341 + ], + [ + 342, + 344 + ], + [ + 345, + 347 + ], + [ + 349, + 350 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 362, + 363 + ], + [ + 364, + 365 + ], + [ + 367, + 368 + ], + [ + 369, + 370 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 375, + 376 + ], + [ + 399, + 400 + ], + [ + 402, + 403 + ], + [ + 404, + 405 + ], + [ + 415, + 426 + ], + [ + 430, + 457 + ], + [ + 458, + 462 + ], + [ + 464, + 465 + ], + [ + 467, + 505 + ], + [ + 510, + 512 + ], + [ + 513, + 515 + ], + [ + 516, + 518 + ], + [ + 519, + 521 + ], + [ + 522, + 524 + ], + [ + 525, + 527 + ], + [ + 528, + 535 + ], + [ + 541, + 543 + ], + [ + 556, + 557 + ], + [ + 558, + 559 + ], + [ + 563, + 564 + ], + [ + 568, + 569 + ], + [ + 570, + 571 + ], + [ + 572, + 573 + ], + [ + 574, + 575 + ], + [ + 576, + 578 + ], + [ + 658, + 659 + ], + [ + 660, + 661 + ], + [ + 662, + 663 + ], + [ + 664, + 665 + ], + [ + 666, + 667 + ], + [ + 668, + 669 + ], + [ + 670, + 671 + ], + [ + 672, + 673 + ], + [ + 674, + 675 + ], + [ + 676, + 677 + ], + [ + 678, + 679 + ], + [ + 680, + 681 + ], + [ + 682, + 683 + ], + [ + 684, + 685 + ], + [ + 686, + 687 + ], + [ + 688, + 689 + ], + [ + 690, + 694 + ], + [ + 696, + 697 + ], + [ + 698, + 699 + ], + [ + 700, + 701 + ], + [ + 702, + 703 + ], + [ + 704, + 705 + ], + [ + 706, + 707 + ], + [ + 708, + 709 + ], + [ + 710, + 711 + ], + [ + 712, + 713 + ], + [ + 714, + 715 + ], + [ + 717, + 718 + ], + [ + 719, + 720 + ], + [ + 721, + 722 + ], + [ + 724, + 725 + ], + [ + 726, + 727 + ], + [ + 728, + 729 + ], + [ + 730, + 731 + ], + [ + 732, + 733 + ], + [ + 734, + 735 + ], + [ + 737, + 738 + ], + [ + 739, + 740 + ], + [ + 741, + 742 + ], + [ + 743, + 744 + ], + [ + 745, + 746 + ], + [ + 747, + 748 + ], + [ + 749, + 750 + ], + [ + 751, + 752 + ], + [ + 753, + 754 + ], + [ + 756, + 757 + ], + [ + 758, + 759 + ], + [ + 760, + 761 + ], + [ + 762, + 763 + ], + [ + 765, + 766 + ], + [ + 767, + 768 + ], + [ + 769, + 770 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ], + [ + 776, + 777 + ], + [ + 778, + 779 + ], + [ + 781, + 782 + ], + [ + 783, + 784 + ], + [ + 785, + 786 + ], + [ + 787, + 788 + ], + [ + 789, + 790 + ], + [ + 791, + 792 + ], + [ + 793, + 794 + ], + [ + 795, + 796 + ], + [ + 797, + 798 + ], + [ + 799, + 800 + ], + [ + 801, + 802 + ], + [ + 803, + 804 + ], + [ + 806, + 807 + ], + [ + 808, + 809 + ], + [ + 811, + 812 + ], + [ + 814, + 815 + ], + [ + 817, + 818 + ], + [ + 820, + 822 + ], + [ + 823, + 825 + ], + [ + 827, + 828 + ], + [ + 829, + 832 + ], + [ + 833, + 835 + ], + [ + 836, + 838 + ], + [ + 839, + 840 + ], + [ + 841, + 842 + ], + [ + 843, + 844 + ], + [ + 845, + 847 + ], + [ + 848, + 849 + ], + [ + 850, + 851 + ], + [ + 852, + 853 + ], + [ + 854, + 855 + ], + [ + 856, + 857 + ], + [ + 858, + 859 + ], + [ + 860, + 862 + ], + [ + 863, + 864 + ], + [ + 865, + 866 + ], + [ + 867, + 869 + ], + [ + 870, + 871 + ], + [ + 872, + 873 + ], + [ + 874, + 875 + ], + [ + 876, + 877 + ], + [ + 878, + 879 + ], + [ + 880, + 881 + ], + [ + 882, + 883 + ], + [ + 884, + 885 + ], + [ + 886, + 887 + ], + [ + 888, + 889 + ], + [ + 890, + 891 + ], + [ + 892, + 893 + ], + [ + 894, + 895 + ], + [ + 896, + 897 + ], + [ + 898, + 899 + ], + [ + 901, + 902 + ], + [ + 903, + 905 + ], + [ + 906, + 907 + ], + [ + 908, + 909 + ], + [ + 910, + 911 + ], + [ + 912, + 913 + ], + [ + 914, + 916 + ], + [ + 917, + 919 + ], + [ + 920, + 921 + ], + [ + 922, + 923 + ], + [ + 924, + 926 + ], + [ + 927, + 928 + ], + [ + 929, + 930 + ], + [ + 931, + 932 + ], + [ + 933, + 934 + ], + [ + 936, + 937 + ], + [ + 939, + 940 + ], + [ + 941, + 942 + ], + [ + 943, + 944 + ], + [ + 946, + 947 + ], + [ + 948, + 951 + ], + [ + 953, + 954 + ], + [ + 955, + 956 + ], + [ + 957, + 958 + ], + [ + 959, + 960 + ], + [ + 961, + 962 + ], + [ + 964, + 965 + ], + [ + 966, + 967 + ], + [ + 968, + 969 + ], + [ + 971, + 972 + ], + [ + 973, + 974 + ], + [ + 976, + 977 + ], + [ + 978, + 979 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 985, + 986 + ], + [ + 987, + 988 + ], + [ + 990, + 991 + ], + [ + 993, + 994 + ], + [ + 995, + 996 + ], + [ + 998, + 1000 + ], + [ + 1002, + 1003 + ], + [ + 1004, + 1005 + ], + [ + 1006, + 1008 + ], + [ + 1009, + 1011 + ], + [ + 1012, + 1014 + ], + [ + 1016, + 1017 + ], + [ + 1018, + 1019 + ], + [ + 1020, + 1021 + ], + [ + 1022, + 1024 + ], + [ + 1025, + 1026 + ], + [ + 1027, + 1028 + ], + [ + 1029, + 1030 + ], + [ + 1031, + 1032 + ], + [ + 1033, + 1034 + ], + [ + 1035, + 1036 + ], + [ + 1037, + 1038 + ], + [ + 1039, + 1040 + ], + [ + 1041, + 1042 + ], + [ + 1043, + 1044 + ], + [ + 1045, + 1046 + ], + [ + 1047, + 1048 + ], + [ + 1049, + 1050 + ], + [ + 1051, + 1052 + ], + [ + 1053, + 1054 + ], + [ + 1056, + 1057 + ], + [ + 1058, + 1059 + ], + [ + 1066, + 1067 + ], + [ + 1068, + 1069 + ], + [ + 1071, + 1072 + ], + [ + 1073, + 1074 + ], + [ + 1080, + 1081 + ], + [ + 1083, + 1084 + ], + [ + 1088, + 1090 + ], + [ + 1091, + 1092 + ], + [ + 1093, + 1095 + ], + [ + 1096, + 1097 + ], + [ + 1099, + 1100 + ], + [ + 1101, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1105, + 1106 + ], + [ + 1107, + 1108 + ], + [ + 1110, + 1111 + ], + [ + 1112, + 1113 + ], + [ + 1114, + 1115 + ], + [ + 1116, + 1117 + ], + [ + 1119, + 1120 + ], + [ + 1122, + 1123 + ], + [ + 1127, + 1128 + ], + [ + 1130, + 1131 + ], + [ + 1132, + 1133 + ], + [ + 1134, + 1135 + ], + [ + 1136, + 1137 + ], + [ + 1138, + 1139 + ], + [ + 1140, + 1141 + ], + [ + 1142, + 1143 + ], + [ + 1144, + 1145 + ], + [ + 1146, + 1147 + ], + [ + 1148, + 1149 + ], + [ + 1150, + 1151 + ], + [ + 1152, + 1153 + ], + [ + 1154, + 1155 + ], + [ + 1156, + 1157 + ], + [ + 1158, + 1159 + ], + [ + 1160, + 1162 + ], + [ + 1163, + 1164 + ], + [ + 1165, + 1166 + ], + [ + 1167, + 1168 + ], + [ + 1170, + 1172 + ], + [ + 1173, + 1174 + ], + [ + 1185, + 1186 + ], + [ + 1187, + 1188 + ], + [ + 1190, + 1192 + ], + [ + 1193, + 1194 + ], + [ + 1195, + 1196 + ], + [ + 1198, + 1200 + ], + [ + 1202, + 1203 + ], + [ + 1204, + 1205 + ], + [ + 1207, + 1208 + ], + [ + 1209, + 1210 + ], + [ + 1211, + 1212 + ], + [ + 1214, + 1215 + ], + [ + 1217, + 1219 + ], + [ + 1220, + 1222 + ], + [ + 1224, + 1225 + ], + [ + 1226, + 1227 + ], + [ + 1229, + 1230 + ], + [ + 1231, + 1232 + ], + [ + 1233, + 1234 + ], + [ + 1236, + 1240 + ], + [ + 1242, + 1264 + ], + [ + 1268, + 1287 + ], + [ + 1291, + 1292 + ], + [ + 1293, + 1295 + ], + [ + 1297, + 1298 + ], + [ + 1299, + 1300 + ], + [ + 1301, + 1302 + ], + [ + 1304, + 1305 + ], + [ + 1306, + 1307 + ], + [ + 1308, + 1309 + ], + [ + 1310, + 1311 + ], + [ + 1313, + 1314 + ], + [ + 1315, + 1316 + ], + [ + 1317, + 1318 + ], + [ + 1319, + 1320 + ], + [ + 1322, + 1323 + ], + [ + 1324, + 1325 + ], + [ + 1327, + 1329 + ], + [ + 1331, + 1333 + ], + [ + 1334, + 1335 + ], + [ + 1336, + 1338 + ], + [ + 1339, + 1341 + ], + [ + 1343, + 1346 + ], + [ + 1347, + 1349 + ], + [ + 1350, + 1352 + ], + [ + 1354, + 1355 + ], + [ + 1357, + 1358 + ], + [ + 1359, + 1361 + ], + [ + 1362, + 1364 + ], + [ + 1366, + 1367 + ], + [ + 1368, + 1369 + ], + [ + 1371, + 1373 + ], + [ + 1375, + 1376 + ], + [ + 1377, + 1378 + ], + [ + 1379, + 1380 + ], + [ + 1381, + 1382 + ], + [ + 1383, + 1384 + ], + [ + 1385, + 1386 + ], + [ + 1388, + 1389 + ], + [ + 1390, + 1391 + ], + [ + 1392, + 1393 + ], + [ + 1395, + 1396 + ], + [ + 1398, + 1399 + ], + [ + 1400, + 1401 + ], + [ + 1403, + 1405 + ], + [ + 1407, + 1409 + ], + [ + 1410, + 1411 + ], + [ + 1413, + 1414 + ], + [ + 1415, + 1417 + ], + [ + 1418, + 1419 + ], + [ + 1421, + 1422 + ], + [ + 1424, + 1425 + ], + [ + 1429, + 1430 + ], + [ + 1431, + 1432 + ], + [ + 1433, + 1434 + ], + [ + 1437, + 1438 + ], + [ + 1439, + 1440 + ], + [ + 1441, + 1442 + ], + [ + 1444, + 1445 + ], + [ + 1446, + 1447 + ], + [ + 1452, + 1453 + ], + [ + 1455, + 1456 + ], + [ + 1458, + 1459 + ], + [ + 1461, + 1462 + ], + [ + 1463, + 1464 + ], + [ + 1465, + 1467 + ], + [ + 1468, + 1469 + ], + [ + 1473, + 1474 + ], + [ + 1475, + 1477 + ], + [ + 1478, + 1479 + ], + [ + 1480, + 1481 + ], + [ + 1482, + 1484 + ], + [ + 1486, + 1487 + ], + [ + 1488, + 1489 + ], + [ + 1490, + 1492 + ], + [ + 1494, + 1495 + ], + [ + 1496, + 1498 + ], + [ + 1500, + 1501 + ], + [ + 1503, + 1504 + ], + [ + 1505, + 1506 + ], + [ + 1508, + 1509 + ], + [ + 1511, + 1512 + ], + [ + 1513, + 1514 + ], + [ + 1516, + 1517 + ], + [ + 1518, + 1519 + ], + [ + 1520, + 1522 + ], + [ + 1524, + 1525 + ], + [ + 1526, + 1527 + ], + [ + 1529, + 1531 + ], + [ + 1532, + 1533 + ], + [ + 1535, + 1536 + ], + [ + 1538, + 1539 + ], + [ + 1540, + 1541 + ], + [ + 1543, + 1544 + ], + [ + 1545, + 1546 + ], + [ + 1548, + 1549 + ], + [ + 1550, + 1556 + ], + [ + 1557, + 1558 + ], + [ + 1559, + 1562 + ], + [ + 1564, + 1576 + ], + [ + 1584, + 1585 + ], + [ + 1586, + 1587 + ], + [ + 1615, + 1616 + ], + [ + 1618, + 1619 + ], + [ + 1620, + 1621 + ], + [ + 1623, + 1627 + ], + [ + 1629, + 1630 + ], + [ + 1631, + 1632 + ], + [ + 1633, + 1634 + ], + [ + 1636, + 1637 + ], + [ + 1641, + 1642 + ], + [ + 1644, + 1646 + ], + [ + 1647, + 1649 + ], + [ + 1650, + 1652 + ], + [ + 1653, + 1654 + ], + [ + 1655, + 1656 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/buf.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 52, + 60 + ], + [ + 73, + 80 + ], + [ + 92, + 105 + ], + [ + 109, + 121 + ], + [ + 125, + 141 + ], + [ + 144, + 160 + ], + [ + 170, + 188 + ], + [ + 193, + 218 + ], + [ + 221, + 233 + ], + [ + 234, + 244 + ], + [ + 249, + 276 + ], + [ + 277, + 284 + ], + [ + 286, + 304 + ], + [ + 305, + 319 + ], + [ + 320, + 339 + ], + [ + 342, + 383 + ], + [ + 385, + 405 + ], + [ + 412, + 439 + ], + [ + 442, + 481 + ], + [ + 484, + 500 + ], + [ + 505, + 520 + ], + [ + 521, + 648 + ], + [ + 651, + 666 + ], + [ + 669, + 701 + ], + [ + 702, + 734 + ], + [ + 735, + 754 + ], + [ + 757, + 766 + ], + [ + 769, + 778 + ], + [ + 781, + 788 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 55, + 57 + ], + [ + 76, + 77 + ], + [ + 95, + 96 + ], + [ + 101, + 102 + ], + [ + 112, + 113 + ], + [ + 117, + 118 + ], + [ + 128, + 129 + ], + [ + 130, + 132 + ], + [ + 134, + 135 + ], + [ + 137, + 138 + ], + [ + 147, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 156, + 157 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 181, + 182 + ], + [ + 183, + 185 + ], + [ + 196, + 197 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 207, + 208 + ], + [ + 214, + 215 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 229, + 230 + ], + [ + 237, + 238 + ], + [ + 239, + 241 + ], + [ + 252, + 253 + ], + [ + 256, + 257 + ], + [ + 263, + 267 + ], + [ + 270, + 273 + ], + [ + 280, + 281 + ], + [ + 289, + 290 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 300, + 301 + ], + [ + 308, + 310 + ], + [ + 313, + 314 + ], + [ + 315, + 316 + ], + [ + 323, + 325 + ], + [ + 328, + 329 + ], + [ + 335, + 336 + ], + [ + 345, + 346 + ], + [ + 349, + 350 + ], + [ + 351, + 353 + ], + [ + 355, + 358 + ], + [ + 359, + 360 + ], + [ + 364, + 366 + ], + [ + 367, + 368 + ], + [ + 371, + 373 + ], + [ + 376, + 377 + ], + [ + 379, + 380 + ], + [ + 388, + 389 + ], + [ + 392, + 393 + ], + [ + 394, + 399 + ], + [ + 401, + 402 + ], + [ + 415, + 416 + ], + [ + 420, + 422 + ], + [ + 425, + 427 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 432, + 433 + ], + [ + 435, + 436 + ], + [ + 445, + 446 + ], + [ + 449, + 450 + ], + [ + 454, + 457 + ], + [ + 458, + 459 + ], + [ + 465, + 466 + ], + [ + 467, + 468 + ], + [ + 471, + 472 + ], + [ + 475, + 476 + ], + [ + 477, + 478 + ], + [ + 487, + 488 + ], + [ + 491, + 492 + ], + [ + 493, + 495 + ], + [ + 496, + 497 + ], + [ + 508, + 509 + ], + [ + 513, + 514 + ], + [ + 515, + 517 + ], + [ + 524, + 526 + ], + [ + 528, + 529 + ], + [ + 531, + 533 + ], + [ + 534, + 535 + ], + [ + 536, + 537 + ], + [ + 539, + 542 + ], + [ + 545, + 546 + ], + [ + 548, + 550 + ], + [ + 554, + 556 + ], + [ + 560, + 562 + ], + [ + 566, + 568 + ], + [ + 572, + 574 + ], + [ + 577, + 579 + ], + [ + 583, + 584 + ], + [ + 585, + 588 + ], + [ + 592, + 593 + ], + [ + 595, + 596 + ], + [ + 601, + 603 + ], + [ + 605, + 606 + ], + [ + 610, + 613 + ], + [ + 615, + 616 + ], + [ + 620, + 623 + ], + [ + 625, + 626 + ], + [ + 630, + 633 + ], + [ + 635, + 636 + ], + [ + 640, + 645 + ], + [ + 654, + 655 + ], + [ + 657, + 660 + ], + [ + 662, + 663 + ], + [ + 672, + 673 + ], + [ + 676, + 677 + ], + [ + 678, + 679 + ], + [ + 681, + 682 + ], + [ + 685, + 686 + ], + [ + 689, + 690 + ], + [ + 693, + 694 + ], + [ + 697, + 698 + ], + [ + 705, + 706 + ], + [ + 708, + 709 + ], + [ + 711, + 714 + ], + [ + 720, + 722 + ], + [ + 723, + 724 + ], + [ + 726, + 727 + ], + [ + 730, + 731 + ], + [ + 738, + 739 + ], + [ + 740, + 741 + ], + [ + 743, + 744 + ], + [ + 747, + 748 + ], + [ + 750, + 751 + ], + [ + 760, + 761 + ], + [ + 762, + 763 + ], + [ + 772, + 773 + ], + [ + 774, + 775 + ], + [ + 784, + 785 + ], + [ + 786, + 787 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/buffer.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 8, + 15 + ], + [ + 18, + 25 + ], + [ + 29, + 57 + ], + [ + 79, + 279 + ], + [ + 281, + 418 + ], + [ + 421, + 520 + ], + [ + 522, + 690 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 11, + 12 + ], + [ + 21, + 22 + ], + [ + 32, + 33 + ], + [ + 34, + 38 + ], + [ + 39, + 48 + ], + [ + 53, + 54 + ], + [ + 82, + 83 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 89, + 90 + ], + [ + 95, + 96 + ], + [ + 97, + 107 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 115, + 117 + ], + [ + 118, + 120 + ], + [ + 122, + 124 + ], + [ + 127, + 128 + ], + [ + 129, + 132 + ], + [ + 133, + 135 + ], + [ + 138, + 139 + ], + [ + 141, + 143 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 156, + 157 + ], + [ + 158, + 166 + ], + [ + 170, + 171 + ], + [ + 173, + 174 + ], + [ + 177, + 178 + ], + [ + 181, + 185 + ], + [ + 188, + 194 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 213 + ], + [ + 216, + 217 + ], + [ + 221, + 222 + ], + [ + 223, + 225 + ], + [ + 227, + 228 + ], + [ + 230, + 231 + ], + [ + 235, + 244 + ], + [ + 249, + 250 + ], + [ + 252, + 254 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 271, + 272 + ], + [ + 275, + 276 + ], + [ + 284, + 293 + ], + [ + 295, + 296 + ], + [ + 299, + 300 + ], + [ + 303, + 307 + ], + [ + 309, + 310 + ], + [ + 315, + 316 + ], + [ + 319, + 320 + ], + [ + 321, + 323 + ], + [ + 324, + 325 + ], + [ + 326, + 327 + ], + [ + 329, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 335 + ], + [ + 336, + 337 + ], + [ + 342, + 343 + ], + [ + 347, + 352 + ], + [ + 354, + 355 + ], + [ + 359, + 360 + ], + [ + 364, + 366 + ], + [ + 370, + 374 + ], + [ + 378, + 379 + ], + [ + 381, + 385 + ], + [ + 389, + 390 + ], + [ + 392, + 393 + ], + [ + 394, + 395 + ], + [ + 398, + 401 + ], + [ + 403, + 408 + ], + [ + 409, + 410 + ], + [ + 413, + 415 + ], + [ + 424, + 425 + ], + [ + 427, + 432 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 442, + 444 + ], + [ + 446, + 447 + ], + [ + 450, + 453 + ], + [ + 454, + 457 + ], + [ + 462, + 464 + ], + [ + 468, + 469 + ], + [ + 473, + 474 + ], + [ + 475, + 477 + ], + [ + 480, + 481 + ], + [ + 482, + 484 + ], + [ + 485, + 488 + ], + [ + 490, + 491 + ], + [ + 496, + 497 + ], + [ + 501, + 503 + ], + [ + 504, + 506 + ], + [ + 507, + 510 + ], + [ + 516, + 517 + ], + [ + 525, + 529 + ], + [ + 532, + 535 + ], + [ + 537, + 538 + ], + [ + 541, + 542 + ], + [ + 544, + 545 + ], + [ + 551, + 553 + ], + [ + 555, + 556 + ], + [ + 559, + 560 + ], + [ + 561, + 562 + ], + [ + 565, + 566 + ], + [ + 568, + 569 + ], + [ + 572, + 576 + ], + [ + 577, + 578 + ], + [ + 580, + 581 + ], + [ + 584, + 585 + ], + [ + 588, + 589 + ], + [ + 591, + 592 + ], + [ + 595, + 597 + ], + [ + 598, + 599 + ], + [ + 605, + 606 + ], + [ + 609, + 611 + ], + [ + 614, + 617 + ], + [ + 620, + 623 + ], + [ + 627, + 632 + ], + [ + 634, + 635 + ], + [ + 639, + 642 + ], + [ + 643, + 644 + ], + [ + 647, + 648 + ], + [ + 652, + 654 + ], + [ + 655, + 656 + ], + [ + 661, + 662 + ], + [ + 663, + 665 + ], + [ + 668, + 670 + ], + [ + 672, + 673 + ], + [ + 676, + 677 + ], + [ + 681, + 682 + ], + [ + 685, + 688 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/cache.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 73, + 83 + ], + [ + 132, + 377 + ], + [ + 380, + 498 + ], + [ + 501, + 657 + ], + [ + 658, + 693 + ], + [ + 696, + 881 + ], + [ + 884, + 928 + ], + [ + 937, + 968 + ], + [ + 969, + 988 + ], + [ + 990, + 1027 + ], + [ + 1029, + 1043 + ], + [ + 1045, + 1063 + ], + [ + 1066, + 1076 + ], + [ + 1081, + 1108 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 135, + 136 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 148, + 170 + ], + [ + 171, + 173 + ], + [ + 174, + 175 + ], + [ + 176, + 178 + ], + [ + 179, + 180 + ], + [ + 181, + 183 + ], + [ + 184, + 185 + ], + [ + 186, + 188 + ], + [ + 189, + 190 + ], + [ + 191, + 193 + ], + [ + 194, + 195 + ], + [ + 196, + 198 + ], + [ + 199, + 200 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 207, + 209 + ], + [ + 214, + 216 + ], + [ + 217, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 231, + 233 + ], + [ + 235, + 237 + ], + [ + 238, + 241 + ], + [ + 242, + 244 + ], + [ + 249, + 294 + ], + [ + 295, + 296 + ], + [ + 297, + 306 + ], + [ + 307, + 309 + ], + [ + 315, + 318 + ], + [ + 319, + 326 + ], + [ + 327, + 329 + ], + [ + 330, + 331 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 343, + 344 + ], + [ + 345, + 356 + ], + [ + 358, + 359 + ], + [ + 364, + 365 + ], + [ + 366, + 367 + ], + [ + 371, + 374 + ], + [ + 383, + 384 + ], + [ + 387, + 388 + ], + [ + 391, + 392 + ], + [ + 395, + 403 + ], + [ + 408, + 409 + ], + [ + 410, + 412 + ], + [ + 416, + 418 + ], + [ + 421, + 422 + ], + [ + 423, + 430 + ], + [ + 433, + 434 + ], + [ + 438, + 440 + ], + [ + 441, + 443 + ], + [ + 444, + 449 + ], + [ + 450, + 451 + ], + [ + 454, + 455 + ], + [ + 458, + 461 + ], + [ + 462, + 463 + ], + [ + 466, + 467 + ], + [ + 470, + 471 + ], + [ + 474, + 475 + ], + [ + 479, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 489, + 490 + ], + [ + 491, + 495 + ], + [ + 504, + 505 + ], + [ + 506, + 507 + ], + [ + 510, + 511 + ], + [ + 514, + 515 + ], + [ + 518, + 519 + ], + [ + 520, + 521 + ], + [ + 523, + 524 + ], + [ + 528, + 530 + ], + [ + 534, + 536 + ], + [ + 538, + 539 + ], + [ + 542, + 543 + ], + [ + 545, + 547 + ], + [ + 549, + 552 + ], + [ + 557, + 558 + ], + [ + 560, + 561 + ], + [ + 563, + 565 + ], + [ + 567, + 568 + ], + [ + 569, + 571 + ], + [ + 574, + 576 + ], + [ + 577, + 578 + ], + [ + 581, + 582 + ], + [ + 585, + 586 + ], + [ + 587, + 588 + ], + [ + 590, + 591 + ], + [ + 595, + 597 + ], + [ + 599, + 600 + ], + [ + 603, + 604 + ], + [ + 606, + 607 + ], + [ + 613, + 614 + ], + [ + 617, + 619 + ], + [ + 621, + 622 + ], + [ + 624, + 626 + ], + [ + 628, + 632 + ], + [ + 635, + 637 + ], + [ + 639, + 641 + ], + [ + 647, + 648 + ], + [ + 649, + 650 + ], + [ + 652, + 654 + ], + [ + 661, + 663 + ], + [ + 667, + 669 + ], + [ + 672, + 673 + ], + [ + 674, + 675 + ], + [ + 680, + 681 + ], + [ + 684, + 688 + ], + [ + 689, + 690 + ], + [ + 699, + 700 + ], + [ + 702, + 703 + ], + [ + 705, + 706 + ], + [ + 707, + 708 + ], + [ + 710, + 711 + ], + [ + 717, + 719 + ], + [ + 720, + 721 + ], + [ + 723, + 724 + ], + [ + 727, + 729 + ], + [ + 730, + 732 + ], + [ + 735, + 736 + ], + [ + 740, + 741 + ], + [ + 745, + 747 + ], + [ + 748, + 750 + ], + [ + 751, + 752 + ], + [ + 757, + 758 + ], + [ + 761, + 762 + ], + [ + 763, + 768 + ], + [ + 769, + 771 + ], + [ + 773, + 774 + ], + [ + 776, + 777 + ], + [ + 783, + 784 + ], + [ + 789, + 790 + ], + [ + 794, + 796 + ], + [ + 798, + 800 + ], + [ + 802, + 803 + ], + [ + 806, + 810 + ], + [ + 812, + 813 + ], + [ + 816, + 820 + ], + [ + 823, + 824 + ], + [ + 827, + 828 + ], + [ + 830, + 831 + ], + [ + 833, + 834 + ], + [ + 840, + 841 + ], + [ + 843, + 844 + ], + [ + 845, + 846 + ], + [ + 847, + 848 + ], + [ + 850, + 852 + ], + [ + 854, + 855 + ], + [ + 858, + 861 + ], + [ + 865, + 868 + ], + [ + 869, + 871 + ], + [ + 873, + 875 + ], + [ + 877, + 878 + ], + [ + 887, + 888 + ], + [ + 894, + 895 + ], + [ + 898, + 899 + ], + [ + 901, + 903 + ], + [ + 905, + 906 + ], + [ + 907, + 908 + ], + [ + 910, + 911 + ], + [ + 915, + 916 + ], + [ + 918, + 920 + ], + [ + 921, + 922 + ], + [ + 924, + 925 + ], + [ + 940, + 941 + ], + [ + 946, + 947 + ], + [ + 948, + 950 + ], + [ + 951, + 952 + ], + [ + 954, + 955 + ], + [ + 961, + 962 + ], + [ + 964, + 965 + ], + [ + 972, + 973 + ], + [ + 979, + 980 + ], + [ + 981, + 982 + ], + [ + 984, + 985 + ], + [ + 993, + 994 + ], + [ + 998, + 999 + ], + [ + 1000, + 1001 + ], + [ + 1006, + 1007 + ], + [ + 1011, + 1012 + ], + [ + 1015, + 1016 + ], + [ + 1018, + 1020 + ], + [ + 1021, + 1022 + ], + [ + 1023, + 1024 + ], + [ + 1032, + 1033 + ], + [ + 1037, + 1038 + ], + [ + 1039, + 1040 + ], + [ + 1048, + 1051 + ], + [ + 1052, + 1053 + ], + [ + 1057, + 1058 + ], + [ + 1059, + 1060 + ], + [ + 1069, + 1070 + ], + [ + 1072, + 1073 + ], + [ + 1084, + 1085 + ], + [ + 1087, + 1088 + ], + [ + 1094, + 1095 + ], + [ + 1101, + 1102 + ], + [ + 1104, + 1105 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/connection.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 59, + 172 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 62, + 63 + ], + [ + 66, + 68 + ], + [ + 69, + 71 + ], + [ + 73, + 74 + ], + [ + 80, + 82 + ], + [ + 84, + 85 + ], + [ + 87, + 88 + ], + [ + 92, + 95 + ], + [ + 97, + 100 + ], + [ + 104, + 107 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 125, + 128 + ], + [ + 129, + 131 + ], + [ + 132, + 135 + ], + [ + 136, + 138 + ], + [ + 141, + 142 + ], + [ + 148, + 150 + ], + [ + 155, + 156 + ], + [ + 157, + 158 + ], + [ + 160, + 162 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/dbuf.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 48, + 55 + ], + [ + 59, + 90 + ], + [ + 92, + 105 + ], + [ + 113, + 128 + ], + [ + 131, + 158 + ], + [ + 160, + 181 + ], + [ + 183, + 214 + ], + [ + 216, + 267 + ], + [ + 271, + 278 + ], + [ + 284, + 295 + ], + [ + 298, + 358 + ], + [ + 363, + 372 + ], + [ + 375, + 394 + ], + [ + 399, + 425 + ], + [ + 429, + 446 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 51, + 52 + ], + [ + 62, + 63 + ], + [ + 65, + 66 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 76, + 80 + ], + [ + 86, + 87 + ], + [ + 95, + 96 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 116, + 117 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 134, + 135 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 147, + 148 + ], + [ + 151, + 152 + ], + [ + 154, + 155 + ], + [ + 163, + 165 + ], + [ + 168, + 169 + ], + [ + 170, + 172 + ], + [ + 173, + 174 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 186, + 188 + ], + [ + 191, + 192 + ], + [ + 196, + 199 + ], + [ + 200, + 203 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 226, + 227 + ], + [ + 230, + 232 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 243, + 245 + ], + [ + 246, + 249 + ], + [ + 250, + 253 + ], + [ + 254, + 257 + ], + [ + 258, + 261 + ], + [ + 263, + 264 + ], + [ + 274, + 275 + ], + [ + 287, + 288 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 301, + 303 + ], + [ + 305, + 306 + ], + [ + 309, + 310 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 319, + 320 + ], + [ + 323, + 325 + ], + [ + 328, + 331 + ], + [ + 335, + 341 + ], + [ + 344, + 345 + ], + [ + 351, + 352 + ], + [ + 354, + 355 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 378, + 380 + ], + [ + 383, + 384 + ], + [ + 385, + 387 + ], + [ + 390, + 391 + ], + [ + 402, + 403 + ], + [ + 407, + 408 + ], + [ + 411, + 412 + ], + [ + 415, + 416 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 432, + 433 + ], + [ + 437, + 438 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 444, + 445 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/error.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 20, + 48 + ], + [ + 76, + 83 + ], + [ + 109, + 119 + ], + [ + 132, + 139 + ], + [ + 142, + 172 + ], + [ + 175, + 210 + ], + [ + 212, + 223 + ], + [ + 225, + 264 + ], + [ + 266, + 284 + ], + [ + 290, + 329 + ], + [ + 335, + 348 + ], + [ + 356, + 379 + ], + [ + 380, + 422 + ], + [ + 423, + 452 + ], + [ + 453, + 460 + ], + [ + 462, + 476 + ], + [ + 486, + 504 + ], + [ + 505, + 512 + ], + [ + 514, + 532 + ], + [ + 543, + 558 + ], + [ + 568, + 582 + ], + [ + 593, + 607 + ], + [ + 617, + 632 + ], + [ + 634, + 641 + ], + [ + 643, + 658 + ], + [ + 670, + 687 + ], + [ + 699, + 713 + ], + [ + 723, + 737 + ], + [ + 747, + 761 + ], + [ + 763, + 770 + ], + [ + 772, + 788 + ], + [ + 799, + 815 + ], + [ + 825, + 839 + ], + [ + 849, + 864 + ], + [ + 874, + 893 + ], + [ + 903, + 919 + ], + [ + 928, + 946 + ], + [ + 955, + 973 + ], + [ + 984, + 999 + ], + [ + 1000, + 1007 + ], + [ + 1009, + 1025 + ], + [ + 1036, + 1051 + ], + [ + 1054, + 1061 + ], + [ + 1063, + 1079 + ], + [ + 1090, + 1105 + ], + [ + 1116, + 1131 + ], + [ + 1133, + 1154 + ], + [ + 1165, + 1200 + ], + [ + 1202, + 1239 + ], + [ + 1241, + 1279 + ], + [ + 1283, + 1300 + ], + [ + 1310, + 1324 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 23, + 24 + ], + [ + 25, + 29 + ], + [ + 30, + 39 + ], + [ + 44, + 45 + ], + [ + 79, + 80 + ], + [ + 112, + 113 + ], + [ + 115, + 116 + ], + [ + 135, + 136 + ], + [ + 145, + 146 + ], + [ + 147, + 149 + ], + [ + 150, + 151 + ], + [ + 156, + 157 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 163, + 165 + ], + [ + 168, + 169 + ], + [ + 178, + 179 + ], + [ + 182, + 185 + ], + [ + 186, + 187 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 197, + 198 + ], + [ + 201, + 205 + ], + [ + 206, + 207 + ], + [ + 215, + 216 + ], + [ + 219, + 220 + ], + [ + 228, + 230 + ], + [ + 232, + 243 + ], + [ + 245, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 257 + ], + [ + 260, + 261 + ], + [ + 269, + 272 + ], + [ + 274, + 277 + ], + [ + 280, + 281 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ], + [ + 298, + 312 + ], + [ + 313, + 316 + ], + [ + 317, + 321 + ], + [ + 325, + 326 + ], + [ + 338, + 339 + ], + [ + 342, + 345 + ], + [ + 359, + 360 + ], + [ + 363, + 365 + ], + [ + 368, + 371 + ], + [ + 372, + 373 + ], + [ + 383, + 384 + ], + [ + 386, + 387 + ], + [ + 388, + 392 + ], + [ + 397, + 398 + ], + [ + 404, + 406 + ], + [ + 407, + 410 + ], + [ + 413, + 414 + ], + [ + 418, + 419 + ], + [ + 426, + 430 + ], + [ + 432, + 433 + ], + [ + 434, + 437 + ], + [ + 438, + 439 + ], + [ + 441, + 442 + ], + [ + 445, + 446 + ], + [ + 448, + 449 + ], + [ + 456, + 457 + ], + [ + 465, + 466 + ], + [ + 467, + 470 + ], + [ + 472, + 473 + ], + [ + 489, + 490 + ], + [ + 493, + 498 + ], + [ + 500, + 501 + ], + [ + 508, + 509 + ], + [ + 517, + 518 + ], + [ + 521, + 522 + ], + [ + 523, + 526 + ], + [ + 528, + 529 + ], + [ + 546, + 547 + ], + [ + 548, + 552 + ], + [ + 554, + 555 + ], + [ + 571, + 572 + ], + [ + 573, + 576 + ], + [ + 578, + 579 + ], + [ + 596, + 597 + ], + [ + 598, + 601 + ], + [ + 603, + 604 + ], + [ + 620, + 621 + ], + [ + 622, + 626 + ], + [ + 628, + 629 + ], + [ + 637, + 638 + ], + [ + 646, + 647 + ], + [ + 648, + 652 + ], + [ + 654, + 655 + ], + [ + 673, + 674 + ], + [ + 675, + 681 + ], + [ + 683, + 684 + ], + [ + 702, + 703 + ], + [ + 704, + 707 + ], + [ + 709, + 710 + ], + [ + 726, + 727 + ], + [ + 728, + 731 + ], + [ + 733, + 734 + ], + [ + 750, + 751 + ], + [ + 752, + 755 + ], + [ + 757, + 758 + ], + [ + 766, + 767 + ], + [ + 775, + 776 + ], + [ + 777, + 782 + ], + [ + 784, + 785 + ], + [ + 802, + 803 + ], + [ + 804, + 809 + ], + [ + 811, + 812 + ], + [ + 828, + 829 + ], + [ + 830, + 833 + ], + [ + 835, + 836 + ], + [ + 852, + 853 + ], + [ + 854, + 858 + ], + [ + 860, + 861 + ], + [ + 877, + 878 + ], + [ + 879, + 880 + ], + [ + 882, + 887 + ], + [ + 889, + 890 + ], + [ + 906, + 907 + ], + [ + 908, + 913 + ], + [ + 915, + 916 + ], + [ + 931, + 932 + ], + [ + 933, + 934 + ], + [ + 935, + 940 + ], + [ + 942, + 943 + ], + [ + 958, + 959 + ], + [ + 960, + 961 + ], + [ + 963, + 967 + ], + [ + 969, + 970 + ], + [ + 987, + 988 + ], + [ + 989, + 993 + ], + [ + 995, + 996 + ], + [ + 1003, + 1004 + ], + [ + 1012, + 1013 + ], + [ + 1014, + 1019 + ], + [ + 1021, + 1022 + ], + [ + 1039, + 1040 + ], + [ + 1041, + 1045 + ], + [ + 1047, + 1048 + ], + [ + 1057, + 1058 + ], + [ + 1066, + 1067 + ], + [ + 1068, + 1073 + ], + [ + 1075, + 1076 + ], + [ + 1093, + 1094 + ], + [ + 1095, + 1099 + ], + [ + 1101, + 1102 + ], + [ + 1119, + 1120 + ], + [ + 1121, + 1125 + ], + [ + 1127, + 1128 + ], + [ + 1136, + 1137 + ], + [ + 1143, + 1144 + ], + [ + 1145, + 1148 + ], + [ + 1150, + 1151 + ], + [ + 1168, + 1169 + ], + [ + 1172, + 1183 + ], + [ + 1184, + 1187 + ], + [ + 1188, + 1189 + ], + [ + 1194, + 1195 + ], + [ + 1196, + 1197 + ], + [ + 1205, + 1206 + ], + [ + 1207, + 1212 + ], + [ + 1213, + 1218 + ], + [ + 1220, + 1221 + ], + [ + 1223, + 1225 + ], + [ + 1226, + 1227 + ], + [ + 1231, + 1232 + ], + [ + 1235, + 1236 + ], + [ + 1244, + 1245 + ], + [ + 1250, + 1254 + ], + [ + 1255, + 1259 + ], + [ + 1261, + 1266 + ], + [ + 1267, + 1268 + ], + [ + 1269, + 1270 + ], + [ + 1275, + 1276 + ], + [ + 1286, + 1287 + ], + [ + 1288, + 1294 + ], + [ + 1296, + 1297 + ], + [ + 1313, + 1314 + ], + [ + 1315, + 1320 + ], + [ + 1322, + 1323 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/gate.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 49, + 63 + ], + [ + 64, + 73 + ], + [ + 76, + 376 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 52, + 53 + ], + [ + 59, + 60 + ], + [ + 67, + 68 + ], + [ + 69, + 70 + ], + [ + 79, + 80 + ], + [ + 85, + 87 + ], + [ + 93, + 94 + ], + [ + 96, + 97 + ], + [ + 102, + 103 + ], + [ + 106, + 111 + ], + [ + 114, + 115 + ], + [ + 116, + 123 + ], + [ + 127, + 128 + ], + [ + 132, + 133 + ], + [ + 136, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 148 + ], + [ + 151, + 152 + ], + [ + 154, + 158 + ], + [ + 159, + 160 + ], + [ + 163, + 164 + ], + [ + 165, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 175 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 182, + 185 + ], + [ + 188, + 189 + ], + [ + 190, + 192 + ], + [ + 195, + 196 + ], + [ + 200, + 201 + ], + [ + 204, + 205 + ], + [ + 206, + 210 + ], + [ + 211, + 212 + ], + [ + 215, + 216 + ], + [ + 217, + 219 + ], + [ + 222, + 223 + ], + [ + 226, + 227 + ], + [ + 230, + 234 + ], + [ + 235, + 236 + ], + [ + 239, + 240 + ], + [ + 245, + 246 + ], + [ + 247, + 248 + ], + [ + 249, + 256 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 271, + 272 + ], + [ + 275, + 276 + ], + [ + 277, + 280 + ], + [ + 281, + 283 + ], + [ + 287, + 288 + ], + [ + 291, + 292 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 308, + 313 + ], + [ + 315, + 317 + ], + [ + 320, + 321 + ], + [ + 325, + 326 + ], + [ + 329, + 330 + ], + [ + 331, + 332 + ], + [ + 336, + 341 + ], + [ + 343, + 345 + ], + [ + 348, + 349 + ], + [ + 355, + 356 + ], + [ + 359, + 360 + ], + [ + 362, + 364 + ], + [ + 366, + 367 + ], + [ + 370, + 373 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/generate.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 57, + 85 + ], + [ + 115, + 126 + ], + [ + 129, + 198 + ], + [ + 203, + 240 + ], + [ + 245, + 252 + ], + [ + 259, + 300 + ], + [ + 305, + 336 + ], + [ + 338, + 348 + ], + [ + 349, + 360 + ], + [ + 363, + 378 + ], + [ + 381, + 431 + ], + [ + 438, + 449 + ], + [ + 456, + 469 + ], + [ + 471, + 496 + ], + [ + 498, + 511 + ], + [ + 513, + 537 + ], + [ + 546, + 553 + ], + [ + 554, + 579 + ], + [ + 598, + 605 + ], + [ + 622, + 646 + ], + [ + 653, + 781 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 60, + 66 + ], + [ + 67, + 71 + ], + [ + 72, + 76 + ], + [ + 81, + 82 + ], + [ + 118, + 119 + ], + [ + 122, + 123 + ], + [ + 132, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 142 + ], + [ + 145, + 147 + ], + [ + 151, + 152 + ], + [ + 153, + 155 + ], + [ + 156, + 158 + ], + [ + 159, + 163 + ], + [ + 166, + 168 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 176, + 177 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 186, + 190 + ], + [ + 191, + 193 + ], + [ + 194, + 195 + ], + [ + 206, + 207 + ], + [ + 212, + 214 + ], + [ + 216, + 218 + ], + [ + 219, + 221 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 228, + 229 + ], + [ + 231, + 233 + ], + [ + 235, + 237 + ], + [ + 248, + 249 + ], + [ + 262, + 263 + ], + [ + 267, + 268 + ], + [ + 269, + 271 + ], + [ + 272, + 273 + ], + [ + 274, + 275 + ], + [ + 276, + 279 + ], + [ + 280, + 281 + ], + [ + 286, + 289 + ], + [ + 295, + 297 + ], + [ + 308, + 311 + ], + [ + 315, + 325 + ], + [ + 329, + 333 + ], + [ + 341, + 342 + ], + [ + 344, + 345 + ], + [ + 352, + 353 + ], + [ + 356, + 357 + ], + [ + 366, + 367 + ], + [ + 372, + 375 + ], + [ + 384, + 385 + ], + [ + 386, + 389 + ], + [ + 390, + 392 + ], + [ + 393, + 394 + ], + [ + 400, + 401 + ], + [ + 406, + 408 + ], + [ + 413, + 417 + ], + [ + 418, + 421 + ], + [ + 427, + 428 + ], + [ + 441, + 442 + ], + [ + 445, + 446 + ], + [ + 459, + 460 + ], + [ + 463, + 464 + ], + [ + 465, + 466 + ], + [ + 474, + 475 + ], + [ + 480, + 481 + ], + [ + 484, + 485 + ], + [ + 487, + 490 + ], + [ + 492, + 493 + ], + [ + 501, + 502 + ], + [ + 507, + 508 + ], + [ + 516, + 517 + ], + [ + 521, + 523 + ], + [ + 526, + 530 + ], + [ + 533, + 534 + ], + [ + 549, + 550 + ], + [ + 557, + 559 + ], + [ + 560, + 561 + ], + [ + 564, + 566 + ], + [ + 569, + 573 + ], + [ + 575, + 576 + ], + [ + 601, + 602 + ], + [ + 625, + 626 + ], + [ + 631, + 632 + ], + [ + 634, + 637 + ], + [ + 640, + 641 + ], + [ + 642, + 643 + ], + [ + 656, + 657 + ], + [ + 659, + 660 + ], + [ + 662, + 663 + ], + [ + 667, + 668 + ], + [ + 672, + 673 + ], + [ + 674, + 675 + ], + [ + 676, + 677 + ], + [ + 678, + 679 + ], + [ + 680, + 682 + ], + [ + 683, + 687 + ], + [ + 692, + 756 + ], + [ + 759, + 761 + ], + [ + 764, + 780 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/ginputsource.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 33 + ], + [ + 51, + 61 + ], + [ + 62, + 250 + ], + [ + 253, + 263 + ], + [ + 266, + 281 + ], + [ + 288, + 297 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 8, + 9 + ], + [ + 10, + 14 + ], + [ + 15, + 24 + ], + [ + 29, + 30 + ], + [ + 54, + 55 + ], + [ + 56, + 58 + ], + [ + 65, + 67 + ], + [ + 68, + 69 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 76, + 77 + ], + [ + 81, + 83 + ], + [ + 84, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 115, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 127, + 129 + ], + [ + 130, + 131 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 148, + 150 + ], + [ + 151, + 152 + ], + [ + 153, + 156 + ], + [ + 157, + 160 + ], + [ + 161, + 164 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 176, + 178 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 188, + 190 + ], + [ + 191, + 192 + ], + [ + 195, + 196 + ], + [ + 197, + 199 + ], + [ + 200, + 202 + ], + [ + 203, + 205 + ], + [ + 206, + 207 + ], + [ + 210, + 212 + ], + [ + 213, + 214 + ], + [ + 217, + 218 + ], + [ + 219, + 221 + ], + [ + 222, + 225 + ], + [ + 226, + 229 + ], + [ + 231, + 232 + ], + [ + 235, + 237 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 246, + 247 + ], + [ + 256, + 257 + ], + [ + 258, + 260 + ], + [ + 269, + 274 + ], + [ + 277, + 278 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/header.c", + "line_filter": { + "diff_chunks": [ + [ + 42, + 70 + ], + [ + 100, + 109 + ], + [ + 112, + 120 + ], + [ + 130, + 138 + ], + [ + 139, + 146 + ], + [ + 155, + 211 + ], + [ + 213, + 225 + ], + [ + 230, + 327 + ], + [ + 329, + 376 + ], + [ + 380, + 389 + ], + [ + 392, + 401 + ], + [ + 404, + 413 + ], + [ + 416, + 425 + ], + [ + 428, + 465 + ], + [ + 469, + 540 + ], + [ + 541, + 551 + ], + [ + 554, + 563 + ], + [ + 569, + 656 + ], + [ + 663, + 670 + ], + [ + 671, + 689 + ], + [ + 690, + 775 + ], + [ + 776, + 810 + ], + [ + 813, + 822 + ], + [ + 825, + 834 + ], + [ + 838, + 847 + ], + [ + 848, + 904 + ], + [ + 910, + 929 + ], + [ + 938, + 955 + ], + [ + 961, + 979 + ], + [ + 985, + 1026 + ], + [ + 1031, + 1043 + ], + [ + 1048, + 1067 + ], + [ + 1084, + 1162 + ], + [ + 1175, + 1182 + ], + [ + 1183, + 1205 + ], + [ + 1223, + 1233 + ], + [ + 1235, + 1287 + ], + [ + 1289, + 1300 + ], + [ + 1307, + 1316 + ], + [ + 1324, + 1375 + ], + [ + 1377, + 1419 + ], + [ + 1428, + 1454 + ], + [ + 1459, + 1476 + ], + [ + 1478, + 1486 + ], + [ + 1489, + 1568 + ], + [ + 1577, + 1615 + ], + [ + 1627, + 1648 + ], + [ + 1650, + 1675 + ], + [ + 1676, + 1714 + ], + [ + 1716, + 1852 + ], + [ + 1858, + 1965 + ], + [ + 1966, + 2018 + ], + [ + 2020, + 2074 + ], + [ + 2075, + 2114 + ], + [ + 2115, + 2132 + ], + [ + 2133, + 2156 + ], + [ + 2165, + 2172 + ], + [ + 2175, + 2216 + ], + [ + 2227, + 2252 + ], + [ + 2257, + 2264 + ], + [ + 2265, + 2284 + ] + ], + "lines_added": [ + [ + 45, + 46 + ], + [ + 47, + 51 + ], + [ + 52, + 61 + ], + [ + 66, + 67 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 115, + 117 + ], + [ + 133, + 135 + ], + [ + 142, + 143 + ], + [ + 158, + 170 + ], + [ + 176, + 187 + ], + [ + 190, + 191 + ], + [ + 192, + 194 + ], + [ + 198, + 208 + ], + [ + 216, + 218 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 233, + 235 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 245, + 246 + ], + [ + 249, + 252 + ], + [ + 253, + 256 + ], + [ + 257, + 260 + ], + [ + 261, + 262 + ], + [ + 265, + 266 + ], + [ + 267, + 270 + ], + [ + 271, + 274 + ], + [ + 275, + 278 + ], + [ + 281, + 282 + ], + [ + 283, + 288 + ], + [ + 292, + 293 + ], + [ + 295, + 297 + ], + [ + 298, + 303 + ], + [ + 305, + 308 + ], + [ + 309, + 312 + ], + [ + 315, + 316 + ], + [ + 319, + 320 + ], + [ + 322, + 324 + ], + [ + 332, + 334 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 341, + 343 + ], + [ + 345, + 347 + ], + [ + 348, + 352 + ], + [ + 354, + 355 + ], + [ + 360, + 361 + ], + [ + 362, + 364 + ], + [ + 367, + 368 + ], + [ + 369, + 373 + ], + [ + 383, + 384 + ], + [ + 385, + 386 + ], + [ + 395, + 396 + ], + [ + 397, + 398 + ], + [ + 407, + 408 + ], + [ + 409, + 410 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 431, + 432 + ], + [ + 433, + 434 + ], + [ + 435, + 436 + ], + [ + 438, + 439 + ], + [ + 441, + 442 + ], + [ + 444, + 445 + ], + [ + 447, + 448 + ], + [ + 450, + 451 + ], + [ + 454, + 455 + ], + [ + 458, + 459 + ], + [ + 461, + 462 + ], + [ + 472, + 473 + ], + [ + 477, + 478 + ], + [ + 483, + 484 + ], + [ + 485, + 489 + ], + [ + 492, + 495 + ], + [ + 500, + 502 + ], + [ + 505, + 512 + ], + [ + 515, + 517 + ], + [ + 522, + 523 + ], + [ + 526, + 527 + ], + [ + 530, + 532 + ], + [ + 535, + 537 + ], + [ + 544, + 545 + ], + [ + 547, + 548 + ], + [ + 557, + 558 + ], + [ + 559, + 560 + ], + [ + 572, + 573 + ], + [ + 574, + 575 + ], + [ + 580, + 581 + ], + [ + 582, + 583 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 591, + 592 + ], + [ + 596, + 597 + ], + [ + 599, + 600 + ], + [ + 603, + 604 + ], + [ + 606, + 607 + ], + [ + 610, + 611 + ], + [ + 612, + 613 + ], + [ + 615, + 616 + ], + [ + 619, + 620 + ], + [ + 622, + 623 + ], + [ + 626, + 627 + ], + [ + 629, + 630 + ], + [ + 634, + 635 + ], + [ + 637, + 638 + ], + [ + 641, + 642 + ], + [ + 644, + 645 + ], + [ + 649, + 650 + ], + [ + 652, + 653 + ], + [ + 666, + 667 + ], + [ + 674, + 675 + ], + [ + 680, + 681 + ], + [ + 685, + 686 + ], + [ + 693, + 694 + ], + [ + 698, + 699 + ], + [ + 704, + 705 + ], + [ + 710, + 712 + ], + [ + 715, + 717 + ], + [ + 720, + 728 + ], + [ + 731, + 733 + ], + [ + 735, + 737 + ], + [ + 740, + 742 + ], + [ + 745, + 747 + ], + [ + 750, + 751 + ], + [ + 753, + 756 + ], + [ + 759, + 762 + ], + [ + 765, + 767 + ], + [ + 770, + 772 + ], + [ + 779, + 781 + ], + [ + 782, + 783 + ], + [ + 789, + 790 + ], + [ + 792, + 793 + ], + [ + 794, + 795 + ], + [ + 801, + 802 + ], + [ + 804, + 805 + ], + [ + 806, + 807 + ], + [ + 816, + 817 + ], + [ + 818, + 819 + ], + [ + 828, + 829 + ], + [ + 830, + 831 + ], + [ + 841, + 842 + ], + [ + 843, + 844 + ], + [ + 851, + 852 + ], + [ + 856, + 857 + ], + [ + 858, + 859 + ], + [ + 865, + 867 + ], + [ + 871, + 872 + ], + [ + 876, + 878 + ], + [ + 879, + 880 + ], + [ + 886, + 888 + ], + [ + 892, + 893 + ], + [ + 897, + 899 + ], + [ + 900, + 901 + ], + [ + 913, + 914 + ], + [ + 917, + 920 + ], + [ + 922, + 924 + ], + [ + 925, + 926 + ], + [ + 941, + 942 + ], + [ + 945, + 947 + ], + [ + 948, + 950 + ], + [ + 951, + 952 + ], + [ + 964, + 965 + ], + [ + 966, + 967 + ], + [ + 968, + 971 + ], + [ + 972, + 974 + ], + [ + 975, + 976 + ], + [ + 988, + 989 + ], + [ + 992, + 994 + ], + [ + 995, + 997 + ], + [ + 998, + 999 + ], + [ + 1005, + 1006 + ], + [ + 1011, + 1012 + ], + [ + 1015, + 1018 + ], + [ + 1019, + 1021 + ], + [ + 1022, + 1023 + ], + [ + 1034, + 1035 + ], + [ + 1036, + 1037 + ], + [ + 1038, + 1040 + ], + [ + 1051, + 1052 + ], + [ + 1058, + 1059 + ], + [ + 1060, + 1062 + ], + [ + 1063, + 1064 + ], + [ + 1087, + 1093 + ], + [ + 1094, + 1095 + ], + [ + 1099, + 1100 + ], + [ + 1103, + 1105 + ], + [ + 1108, + 1109 + ], + [ + 1111, + 1113 + ], + [ + 1114, + 1119 + ], + [ + 1121, + 1122 + ], + [ + 1124, + 1125 + ], + [ + 1127, + 1128 + ], + [ + 1130, + 1131 + ], + [ + 1133, + 1134 + ], + [ + 1135, + 1136 + ], + [ + 1139, + 1144 + ], + [ + 1146, + 1147 + ], + [ + 1152, + 1154 + ], + [ + 1158, + 1159 + ], + [ + 1178, + 1179 + ], + [ + 1186, + 1187 + ], + [ + 1188, + 1191 + ], + [ + 1194, + 1197 + ], + [ + 1198, + 1199 + ], + [ + 1201, + 1202 + ], + [ + 1226, + 1227 + ], + [ + 1228, + 1230 + ], + [ + 1238, + 1242 + ], + [ + 1243, + 1244 + ], + [ + 1249, + 1252 + ], + [ + 1254, + 1255 + ], + [ + 1262, + 1263 + ], + [ + 1264, + 1265 + ], + [ + 1269, + 1279 + ], + [ + 1280, + 1282 + ], + [ + 1283, + 1284 + ], + [ + 1292, + 1293 + ], + [ + 1296, + 1297 + ], + [ + 1310, + 1311 + ], + [ + 1312, + 1313 + ], + [ + 1327, + 1328 + ], + [ + 1332, + 1334 + ], + [ + 1335, + 1336 + ], + [ + 1338, + 1340 + ], + [ + 1341, + 1345 + ], + [ + 1348, + 1349 + ], + [ + 1351, + 1353 + ], + [ + 1354, + 1358 + ], + [ + 1361, + 1365 + ], + [ + 1366, + 1367 + ], + [ + 1369, + 1370 + ], + [ + 1371, + 1372 + ], + [ + 1380, + 1381 + ], + [ + 1387, + 1389 + ], + [ + 1393, + 1394 + ], + [ + 1395, + 1396 + ], + [ + 1398, + 1400 + ], + [ + 1402, + 1403 + ], + [ + 1405, + 1407 + ], + [ + 1409, + 1412 + ], + [ + 1413, + 1414 + ], + [ + 1415, + 1416 + ], + [ + 1431, + 1432 + ], + [ + 1437, + 1439 + ], + [ + 1441, + 1443 + ], + [ + 1445, + 1448 + ], + [ + 1450, + 1451 + ], + [ + 1462, + 1463 + ], + [ + 1468, + 1471 + ], + [ + 1472, + 1473 + ], + [ + 1481, + 1483 + ], + [ + 1492, + 1493 + ], + [ + 1498, + 1499 + ], + [ + 1501, + 1504 + ], + [ + 1505, + 1507 + ], + [ + 1509, + 1513 + ], + [ + 1514, + 1515 + ], + [ + 1518, + 1519 + ], + [ + 1524, + 1525 + ], + [ + 1528, + 1529 + ], + [ + 1532, + 1533 + ], + [ + 1535, + 1536 + ], + [ + 1542, + 1543 + ], + [ + 1549, + 1550 + ], + [ + 1551, + 1553 + ], + [ + 1559, + 1561 + ], + [ + 1562, + 1563 + ], + [ + 1564, + 1565 + ], + [ + 1580, + 1582 + ], + [ + 1585, + 1588 + ], + [ + 1591, + 1593 + ], + [ + 1594, + 1595 + ], + [ + 1596, + 1602 + ], + [ + 1603, + 1606 + ], + [ + 1607, + 1608 + ], + [ + 1609, + 1610 + ], + [ + 1611, + 1612 + ], + [ + 1630, + 1632 + ], + [ + 1635, + 1639 + ], + [ + 1641, + 1642 + ], + [ + 1644, + 1645 + ], + [ + 1653, + 1654 + ], + [ + 1660, + 1662 + ], + [ + 1665, + 1669 + ], + [ + 1671, + 1672 + ], + [ + 1679, + 1680 + ], + [ + 1685, + 1687 + ], + [ + 1692, + 1693 + ], + [ + 1694, + 1695 + ], + [ + 1697, + 1698 + ], + [ + 1701, + 1702 + ], + [ + 1703, + 1704 + ], + [ + 1706, + 1708 + ], + [ + 1710, + 1711 + ], + [ + 1719, + 1720 + ], + [ + 1723, + 1724 + ], + [ + 1728, + 1730 + ], + [ + 1733, + 1737 + ], + [ + 1739, + 1740 + ], + [ + 1742, + 1743 + ], + [ + 1748, + 1749 + ], + [ + 1750, + 1751 + ], + [ + 1757, + 1758 + ], + [ + 1761, + 1765 + ], + [ + 1766, + 1767 + ], + [ + 1769, + 1770 + ], + [ + 1775, + 1776 + ], + [ + 1782, + 1783 + ], + [ + 1786, + 1790 + ], + [ + 1792, + 1793 + ], + [ + 1798, + 1799 + ], + [ + 1800, + 1801 + ], + [ + 1807, + 1808 + ], + [ + 1811, + 1815 + ], + [ + 1816, + 1817 + ], + [ + 1819, + 1820 + ], + [ + 1825, + 1826 + ], + [ + 1832, + 1833 + ], + [ + 1836, + 1840 + ], + [ + 1842, + 1843 + ], + [ + 1848, + 1849 + ], + [ + 1861, + 1863 + ], + [ + 1866, + 1868 + ], + [ + 1869, + 1870 + ], + [ + 1872, + 1873 + ], + [ + 1875, + 1877 + ], + [ + 1879, + 1881 + ], + [ + 1882, + 1884 + ], + [ + 1885, + 1886 + ], + [ + 1888, + 1889 + ], + [ + 1890, + 1891 + ], + [ + 1893, + 1894 + ], + [ + 1899, + 1900 + ], + [ + 1906, + 1907 + ], + [ + 1910, + 1914 + ], + [ + 1916, + 1917 + ], + [ + 1922, + 1923 + ], + [ + 1926, + 1928 + ], + [ + 1934, + 1936 + ], + [ + 1940, + 1942 + ], + [ + 1946, + 1948 + ], + [ + 1950, + 1955 + ], + [ + 1956, + 1958 + ], + [ + 1959, + 1960 + ], + [ + 1961, + 1962 + ], + [ + 1969, + 1970 + ], + [ + 1972, + 1973 + ], + [ + 1976, + 1978 + ], + [ + 1981, + 1982 + ], + [ + 1983, + 1984 + ], + [ + 1986, + 1987 + ], + [ + 1992, + 1993 + ], + [ + 1996, + 1997 + ], + [ + 2003, + 2006 + ], + [ + 2009, + 2013 + ], + [ + 2014, + 2015 + ], + [ + 2023, + 2024 + ], + [ + 2028, + 2030 + ], + [ + 2033, + 2037 + ], + [ + 2039, + 2040 + ], + [ + 2046, + 2047 + ], + [ + 2052, + 2053 + ], + [ + 2059, + 2062 + ], + [ + 2065, + 2069 + ], + [ + 2070, + 2071 + ], + [ + 2078, + 2079 + ], + [ + 2080, + 2081 + ], + [ + 2086, + 2088 + ], + [ + 2091, + 2095 + ], + [ + 2097, + 2098 + ], + [ + 2104, + 2105 + ], + [ + 2110, + 2111 + ], + [ + 2118, + 2120 + ], + [ + 2123, + 2127 + ], + [ + 2128, + 2129 + ], + [ + 2136, + 2137 + ], + [ + 2138, + 2139 + ], + [ + 2144, + 2146 + ], + [ + 2149, + 2153 + ], + [ + 2168, + 2169 + ], + [ + 2178, + 2179 + ], + [ + 2184, + 2186 + ], + [ + 2189, + 2190 + ], + [ + 2192, + 2196 + ], + [ + 2199, + 2202 + ], + [ + 2204, + 2207 + ], + [ + 2209, + 2211 + ], + [ + 2212, + 2213 + ], + [ + 2230, + 2234 + ], + [ + 2236, + 2237 + ], + [ + 2238, + 2239 + ], + [ + 2240, + 2243 + ], + [ + 2245, + 2247 + ], + [ + 2248, + 2249 + ], + [ + 2260, + 2261 + ], + [ + 2268, + 2269 + ], + [ + 2270, + 2272 + ], + [ + 2273, + 2274 + ], + [ + 2279, + 2280 + ], + [ + 2281, + 2282 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/image.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 24, + 52 + ], + [ + 74, + 120 + ], + [ + 130, + 143 + ], + [ + 151, + 204 + ], + [ + 205, + 217 + ], + [ + 227, + 245 + ], + [ + 251, + 287 + ], + [ + 335, + 351 + ], + [ + 354, + 381 + ], + [ + 382, + 389 + ], + [ + 393, + 400 + ], + [ + 404, + 446 + ], + [ + 449, + 469 + ], + [ + 471, + 514 + ], + [ + 516, + 528 + ], + [ + 533, + 553 + ], + [ + 555, + 737 + ], + [ + 742, + 786 + ], + [ + 790, + 829 + ], + [ + 832, + 1001 + ], + [ + 1003, + 1069 + ], + [ + 1075, + 1082 + ], + [ + 1091, + 1098 + ], + [ + 1101, + 1217 + ], + [ + 1224, + 1240 + ], + [ + 1241, + 1303 + ], + [ + 1306, + 1343 + ], + [ + 1349, + 1395 + ], + [ + 1397, + 1404 + ], + [ + 1407, + 1435 + ], + [ + 1437, + 1459 + ], + [ + 1466, + 1610 + ], + [ + 1612, + 1633 + ], + [ + 1637, + 1651 + ], + [ + 1652, + 1671 + ], + [ + 1673, + 1689 + ], + [ + 1691, + 1788 + ], + [ + 1789, + 1798 + ], + [ + 1799, + 1822 + ], + [ + 1823, + 1846 + ], + [ + 1850, + 1891 + ], + [ + 1896, + 1923 + ], + [ + 1927, + 1955 + ], + [ + 1956, + 1965 + ], + [ + 1972, + 1979 + ], + [ + 1980, + 2008 + ], + [ + 2025, + 2034 + ], + [ + 2035, + 2052 + ], + [ + 2053, + 2082 + ], + [ + 2087, + 2123 + ], + [ + 2126, + 2136 + ], + [ + 2137, + 2152 + ], + [ + 2155, + 2180 + ], + [ + 2182, + 2205 + ], + [ + 2208, + 2268 + ], + [ + 2274, + 2295 + ], + [ + 2296, + 2314 + ], + [ + 2318, + 2332 + ], + [ + 2333, + 2348 + ], + [ + 2356, + 2386 + ], + [ + 2395, + 2406 + ], + [ + 2417, + 2461 + ], + [ + 2471, + 2480 + ], + [ + 2490, + 2505 + ], + [ + 2507, + 2524 + ], + [ + 2526, + 2548 + ], + [ + 2549, + 2611 + ], + [ + 2620, + 2645 + ], + [ + 2648, + 2664 + ], + [ + 2667, + 2685 + ], + [ + 2691, + 2755 + ], + [ + 2757, + 2824 + ], + [ + 2825, + 2843 + ], + [ + 2844, + 2863 + ], + [ + 2864, + 2908 + ], + [ + 2909, + 2944 + ], + [ + 2952, + 2969 + ], + [ + 2971, + 2983 + ], + [ + 2993, + 3015 + ], + [ + 3017, + 3059 + ], + [ + 3062, + 3075 + ], + [ + 3076, + 3099 + ], + [ + 3105, + 3121 + ], + [ + 3123, + 3130 + ], + [ + 3132, + 3187 + ], + [ + 3198, + 3283 + ], + [ + 3284, + 3326 + ], + [ + 3335, + 3342 + ], + [ + 3345, + 3356 + ], + [ + 3357, + 3383 + ], + [ + 3384, + 3425 + ], + [ + 3431, + 3448 + ], + [ + 3449, + 3464 + ], + [ + 3470, + 3492 + ], + [ + 3495, + 3532 + ], + [ + 3537, + 3544 + ], + [ + 3547, + 3574 + ], + [ + 3576, + 3592 + ], + [ + 3596, + 3627 + ], + [ + 3628, + 3652 + ], + [ + 3659, + 3669 + ], + [ + 3677, + 3695 + ], + [ + 3702, + 3731 + ], + [ + 3734, + 3746 + ], + [ + 3749, + 3775 + ], + [ + 3779, + 3805 + ], + [ + 3809, + 3821 + ], + [ + 3824, + 3835 + ], + [ + 3839, + 3851 + ], + [ + 3853, + 3865 + ], + [ + 3869, + 3881 + ], + [ + 3883, + 3895 + ], + [ + 3901, + 3926 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 27, + 33 + ], + [ + 34, + 38 + ], + [ + 39, + 43 + ], + [ + 48, + 49 + ], + [ + 77, + 79 + ], + [ + 80, + 81 + ], + [ + 87, + 88 + ], + [ + 92, + 113 + ], + [ + 115, + 117 + ], + [ + 133, + 134 + ], + [ + 139, + 140 + ], + [ + 154, + 155 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 165, + 166 + ], + [ + 168, + 169 + ], + [ + 175, + 177 + ], + [ + 179, + 180 + ], + [ + 181, + 182 + ], + [ + 184, + 186 + ], + [ + 188, + 189 + ], + [ + 191, + 195 + ], + [ + 197, + 198 + ], + [ + 200, + 201 + ], + [ + 208, + 209 + ], + [ + 213, + 214 + ], + [ + 230, + 231 + ], + [ + 236, + 237 + ], + [ + 241, + 242 + ], + [ + 254, + 255 + ], + [ + 261, + 262 + ], + [ + 266, + 267 + ], + [ + 272, + 273 + ], + [ + 276, + 277 + ], + [ + 278, + 280 + ], + [ + 283, + 284 + ], + [ + 338, + 339 + ], + [ + 342, + 343 + ], + [ + 347, + 348 + ], + [ + 357, + 358 + ], + [ + 360, + 361 + ], + [ + 364, + 365 + ], + [ + 369, + 370 + ], + [ + 372, + 378 + ], + [ + 385, + 386 + ], + [ + 396, + 397 + ], + [ + 407, + 408 + ], + [ + 413, + 414 + ], + [ + 415, + 417 + ], + [ + 418, + 422 + ], + [ + 427, + 428 + ], + [ + 429, + 430 + ], + [ + 431, + 432 + ], + [ + 436, + 437 + ], + [ + 440, + 441 + ], + [ + 442, + 443 + ], + [ + 452, + 453 + ], + [ + 454, + 457 + ], + [ + 461, + 466 + ], + [ + 474, + 475 + ], + [ + 476, + 477 + ], + [ + 478, + 481 + ], + [ + 482, + 483 + ], + [ + 486, + 487 + ], + [ + 488, + 489 + ], + [ + 490, + 491 + ], + [ + 493, + 507 + ], + [ + 510, + 511 + ], + [ + 519, + 520 + ], + [ + 522, + 523 + ], + [ + 524, + 525 + ], + [ + 536, + 538 + ], + [ + 539, + 542 + ], + [ + 545, + 546 + ], + [ + 549, + 550 + ], + [ + 558, + 560 + ], + [ + 562, + 563 + ], + [ + 564, + 565 + ], + [ + 568, + 569 + ], + [ + 570, + 571 + ], + [ + 572, + 573 + ], + [ + 575, + 577 + ], + [ + 578, + 580 + ], + [ + 583, + 584 + ], + [ + 587, + 590 + ], + [ + 591, + 592 + ], + [ + 595, + 596 + ], + [ + 597, + 598 + ], + [ + 599, + 611 + ], + [ + 612, + 614 + ], + [ + 615, + 616 + ], + [ + 617, + 618 + ], + [ + 619, + 620 + ], + [ + 621, + 622 + ], + [ + 625, + 626 + ], + [ + 627, + 628 + ], + [ + 630, + 643 + ], + [ + 645, + 648 + ], + [ + 650, + 653 + ], + [ + 654, + 655 + ], + [ + 658, + 659 + ], + [ + 660, + 663 + ], + [ + 664, + 665 + ], + [ + 668, + 669 + ], + [ + 670, + 671 + ], + [ + 674, + 675 + ], + [ + 676, + 677 + ], + [ + 680, + 681 + ], + [ + 682, + 688 + ], + [ + 690, + 691 + ], + [ + 694, + 700 + ], + [ + 704, + 705 + ], + [ + 706, + 712 + ], + [ + 713, + 714 + ], + [ + 715, + 716 + ], + [ + 719, + 720 + ], + [ + 721, + 722 + ], + [ + 727, + 729 + ], + [ + 730, + 731 + ], + [ + 732, + 734 + ], + [ + 745, + 746 + ], + [ + 747, + 748 + ], + [ + 751, + 752 + ], + [ + 755, + 756 + ], + [ + 757, + 759 + ], + [ + 763, + 767 + ], + [ + 770, + 772 + ], + [ + 775, + 776 + ], + [ + 777, + 783 + ], + [ + 793, + 794 + ], + [ + 797, + 800 + ], + [ + 805, + 806 + ], + [ + 807, + 809 + ], + [ + 810, + 811 + ], + [ + 812, + 813 + ], + [ + 816, + 817 + ], + [ + 818, + 824 + ], + [ + 825, + 826 + ], + [ + 835, + 836 + ], + [ + 837, + 838 + ], + [ + 844, + 845 + ], + [ + 846, + 848 + ], + [ + 851, + 853 + ], + [ + 856, + 858 + ], + [ + 861, + 863 + ], + [ + 865, + 866 + ], + [ + 868, + 870 + ], + [ + 872, + 873 + ], + [ + 878, + 881 + ], + [ + 882, + 885 + ], + [ + 886, + 887 + ], + [ + 889, + 892 + ], + [ + 893, + 894 + ], + [ + 899, + 904 + ], + [ + 906, + 908 + ], + [ + 911, + 914 + ], + [ + 915, + 916 + ], + [ + 918, + 919 + ], + [ + 920, + 921 + ], + [ + 926, + 927 + ], + [ + 928, + 930 + ], + [ + 932, + 933 + ], + [ + 935, + 936 + ], + [ + 939, + 942 + ], + [ + 943, + 944 + ], + [ + 945, + 946 + ], + [ + 948, + 949 + ], + [ + 950, + 951 + ], + [ + 952, + 953 + ], + [ + 955, + 957 + ], + [ + 960, + 961 + ], + [ + 962, + 963 + ], + [ + 964, + 965 + ], + [ + 967, + 968 + ], + [ + 970, + 972 + ], + [ + 975, + 976 + ], + [ + 977, + 982 + ], + [ + 987, + 990 + ], + [ + 993, + 994 + ], + [ + 995, + 996 + ], + [ + 997, + 998 + ], + [ + 1006, + 1007 + ], + [ + 1008, + 1010 + ], + [ + 1011, + 1012 + ], + [ + 1013, + 1014 + ], + [ + 1017, + 1018 + ], + [ + 1019, + 1020 + ], + [ + 1021, + 1022 + ], + [ + 1024, + 1026 + ], + [ + 1027, + 1028 + ], + [ + 1029, + 1030 + ], + [ + 1031, + 1032 + ], + [ + 1033, + 1034 + ], + [ + 1035, + 1037 + ], + [ + 1038, + 1039 + ], + [ + 1041, + 1043 + ], + [ + 1044, + 1045 + ], + [ + 1047, + 1049 + ], + [ + 1050, + 1051 + ], + [ + 1054, + 1056 + ], + [ + 1060, + 1061 + ], + [ + 1062, + 1064 + ], + [ + 1065, + 1066 + ], + [ + 1078, + 1079 + ], + [ + 1094, + 1095 + ], + [ + 1104, + 1107 + ], + [ + 1108, + 1110 + ], + [ + 1111, + 1114 + ], + [ + 1115, + 1117 + ], + [ + 1118, + 1121 + ], + [ + 1122, + 1124 + ], + [ + 1125, + 1128 + ], + [ + 1129, + 1131 + ], + [ + 1132, + 1135 + ], + [ + 1136, + 1138 + ], + [ + 1139, + 1142 + ], + [ + 1143, + 1145 + ], + [ + 1146, + 1149 + ], + [ + 1150, + 1152 + ], + [ + 1153, + 1156 + ], + [ + 1157, + 1159 + ], + [ + 1160, + 1163 + ], + [ + 1164, + 1166 + ], + [ + 1167, + 1170 + ], + [ + 1171, + 1198 + ], + [ + 1199, + 1214 + ], + [ + 1227, + 1228 + ], + [ + 1229, + 1231 + ], + [ + 1232, + 1233 + ], + [ + 1236, + 1237 + ], + [ + 1244, + 1245 + ], + [ + 1251, + 1252 + ], + [ + 1253, + 1255 + ], + [ + 1256, + 1257 + ], + [ + 1260, + 1261 + ], + [ + 1267, + 1268 + ], + [ + 1271, + 1272 + ], + [ + 1273, + 1275 + ], + [ + 1276, + 1277 + ], + [ + 1280, + 1281 + ], + [ + 1287, + 1288 + ], + [ + 1290, + 1291 + ], + [ + 1292, + 1294 + ], + [ + 1295, + 1296 + ], + [ + 1299, + 1300 + ], + [ + 1309, + 1311 + ], + [ + 1312, + 1313 + ], + [ + 1315, + 1316 + ], + [ + 1322, + 1323 + ], + [ + 1325, + 1327 + ], + [ + 1328, + 1329 + ], + [ + 1331, + 1332 + ], + [ + 1337, + 1338 + ], + [ + 1339, + 1340 + ], + [ + 1352, + 1353 + ], + [ + 1357, + 1358 + ], + [ + 1360, + 1362 + ], + [ + 1366, + 1367 + ], + [ + 1370, + 1371 + ], + [ + 1373, + 1374 + ], + [ + 1375, + 1376 + ], + [ + 1379, + 1380 + ], + [ + 1381, + 1382 + ], + [ + 1383, + 1384 + ], + [ + 1387, + 1388 + ], + [ + 1389, + 1390 + ], + [ + 1391, + 1392 + ], + [ + 1400, + 1401 + ], + [ + 1410, + 1411 + ], + [ + 1412, + 1413 + ], + [ + 1414, + 1416 + ], + [ + 1419, + 1420 + ], + [ + 1421, + 1422 + ], + [ + 1423, + 1424 + ], + [ + 1427, + 1428 + ], + [ + 1429, + 1430 + ], + [ + 1431, + 1432 + ], + [ + 1440, + 1441 + ], + [ + 1444, + 1446 + ], + [ + 1450, + 1451 + ], + [ + 1452, + 1454 + ], + [ + 1455, + 1456 + ], + [ + 1469, + 1470 + ], + [ + 1471, + 1472 + ], + [ + 1477, + 1478 + ], + [ + 1481, + 1482 + ], + [ + 1483, + 1486 + ], + [ + 1492, + 1493 + ], + [ + 1495, + 1496 + ], + [ + 1498, + 1499 + ], + [ + 1502, + 1503 + ], + [ + 1506, + 1507 + ], + [ + 1510, + 1511 + ], + [ + 1512, + 1513 + ], + [ + 1514, + 1515 + ], + [ + 1521, + 1522 + ], + [ + 1526, + 1527 + ], + [ + 1528, + 1530 + ], + [ + 1531, + 1533 + ], + [ + 1534, + 1535 + ], + [ + 1537, + 1538 + ], + [ + 1540, + 1541 + ], + [ + 1542, + 1546 + ], + [ + 1552, + 1553 + ], + [ + 1554, + 1557 + ], + [ + 1558, + 1560 + ], + [ + 1561, + 1562 + ], + [ + 1567, + 1570 + ], + [ + 1571, + 1575 + ], + [ + 1579, + 1580 + ], + [ + 1581, + 1583 + ], + [ + 1585, + 1586 + ], + [ + 1587, + 1589 + ], + [ + 1593, + 1594 + ], + [ + 1599, + 1602 + ], + [ + 1603, + 1607 + ], + [ + 1615, + 1616 + ], + [ + 1621, + 1622 + ], + [ + 1623, + 1627 + ], + [ + 1629, + 1630 + ], + [ + 1640, + 1641 + ], + [ + 1644, + 1645 + ], + [ + 1647, + 1648 + ], + [ + 1655, + 1660 + ], + [ + 1664, + 1665 + ], + [ + 1667, + 1668 + ], + [ + 1676, + 1677 + ], + [ + 1681, + 1682 + ], + [ + 1683, + 1686 + ], + [ + 1694, + 1695 + ], + [ + 1698, + 1699 + ], + [ + 1700, + 1701 + ], + [ + 1706, + 1707 + ], + [ + 1708, + 1709 + ], + [ + 1710, + 1711 + ], + [ + 1712, + 1713 + ], + [ + 1717, + 1718 + ], + [ + 1724, + 1725 + ], + [ + 1726, + 1728 + ], + [ + 1730, + 1734 + ], + [ + 1736, + 1737 + ], + [ + 1740, + 1741 + ], + [ + 1744, + 1746 + ], + [ + 1749, + 1751 + ], + [ + 1753, + 1757 + ], + [ + 1759, + 1760 + ], + [ + 1766, + 1767 + ], + [ + 1773, + 1774 + ], + [ + 1777, + 1779 + ], + [ + 1784, + 1785 + ], + [ + 1792, + 1793 + ], + [ + 1794, + 1795 + ], + [ + 1802, + 1803 + ], + [ + 1804, + 1805 + ], + [ + 1811, + 1812 + ], + [ + 1816, + 1817 + ], + [ + 1818, + 1819 + ], + [ + 1826, + 1827 + ], + [ + 1828, + 1829 + ], + [ + 1835, + 1836 + ], + [ + 1840, + 1841 + ], + [ + 1842, + 1843 + ], + [ + 1853, + 1854 + ], + [ + 1857, + 1858 + ], + [ + 1861, + 1863 + ], + [ + 1865, + 1866 + ], + [ + 1867, + 1868 + ], + [ + 1873, + 1875 + ], + [ + 1878, + 1879 + ], + [ + 1880, + 1883 + ], + [ + 1887, + 1888 + ], + [ + 1899, + 1900 + ], + [ + 1906, + 1907 + ], + [ + 1908, + 1912 + ], + [ + 1913, + 1914 + ], + [ + 1919, + 1920 + ], + [ + 1930, + 1931 + ], + [ + 1932, + 1934 + ], + [ + 1935, + 1939 + ], + [ + 1940, + 1942 + ], + [ + 1943, + 1944 + ], + [ + 1950, + 1952 + ], + [ + 1959, + 1960 + ], + [ + 1961, + 1962 + ], + [ + 1975, + 1976 + ], + [ + 1983, + 1985 + ], + [ + 1990, + 1992 + ], + [ + 1998, + 2002 + ], + [ + 2004, + 2005 + ], + [ + 2028, + 2029 + ], + [ + 2030, + 2031 + ], + [ + 2038, + 2040 + ], + [ + 2045, + 2046 + ], + [ + 2047, + 2049 + ], + [ + 2056, + 2060 + ], + [ + 2062, + 2070 + ], + [ + 2072, + 2073 + ], + [ + 2076, + 2077 + ], + [ + 2078, + 2079 + ], + [ + 2090, + 2093 + ], + [ + 2099, + 2101 + ], + [ + 2107, + 2114 + ], + [ + 2116, + 2118 + ], + [ + 2119, + 2120 + ], + [ + 2129, + 2131 + ], + [ + 2132, + 2133 + ], + [ + 2140, + 2141 + ], + [ + 2147, + 2149 + ], + [ + 2158, + 2161 + ], + [ + 2164, + 2165 + ], + [ + 2166, + 2170 + ], + [ + 2171, + 2172 + ], + [ + 2173, + 2175 + ], + [ + 2176, + 2177 + ], + [ + 2185, + 2187 + ], + [ + 2190, + 2191 + ], + [ + 2197, + 2199 + ], + [ + 2200, + 2202 + ], + [ + 2211, + 2212 + ], + [ + 2214, + 2219 + ], + [ + 2220, + 2221 + ], + [ + 2223, + 2225 + ], + [ + 2226, + 2230 + ], + [ + 2231, + 2232 + ], + [ + 2238, + 2240 + ], + [ + 2241, + 2246 + ], + [ + 2248, + 2252 + ], + [ + 2253, + 2254 + ], + [ + 2256, + 2258 + ], + [ + 2261, + 2263 + ], + [ + 2264, + 2265 + ], + [ + 2277, + 2278 + ], + [ + 2280, + 2281 + ], + [ + 2284, + 2285 + ], + [ + 2290, + 2292 + ], + [ + 2299, + 2303 + ], + [ + 2305, + 2308 + ], + [ + 2310, + 2311 + ], + [ + 2321, + 2322 + ], + [ + 2324, + 2325 + ], + [ + 2328, + 2329 + ], + [ + 2336, + 2337 + ], + [ + 2338, + 2343 + ], + [ + 2344, + 2345 + ], + [ + 2359, + 2361 + ], + [ + 2366, + 2371 + ], + [ + 2375, + 2376 + ], + [ + 2378, + 2381 + ], + [ + 2382, + 2383 + ], + [ + 2398, + 2400 + ], + [ + 2401, + 2403 + ], + [ + 2420, + 2421 + ], + [ + 2423, + 2424 + ], + [ + 2429, + 2432 + ], + [ + 2433, + 2434 + ], + [ + 2436, + 2442 + ], + [ + 2447, + 2450 + ], + [ + 2453, + 2454 + ], + [ + 2455, + 2456 + ], + [ + 2457, + 2458 + ], + [ + 2474, + 2475 + ], + [ + 2476, + 2477 + ], + [ + 2493, + 2494 + ], + [ + 2495, + 2497 + ], + [ + 2499, + 2502 + ], + [ + 2510, + 2511 + ], + [ + 2515, + 2516 + ], + [ + 2520, + 2521 + ], + [ + 2529, + 2530 + ], + [ + 2531, + 2532 + ], + [ + 2533, + 2535 + ], + [ + 2536, + 2538 + ], + [ + 2540, + 2541 + ], + [ + 2544, + 2545 + ], + [ + 2552, + 2553 + ], + [ + 2558, + 2559 + ], + [ + 2565, + 2566 + ], + [ + 2572, + 2574 + ], + [ + 2575, + 2578 + ], + [ + 2580, + 2581 + ], + [ + 2582, + 2583 + ], + [ + 2584, + 2585 + ], + [ + 2588, + 2590 + ], + [ + 2592, + 2593 + ], + [ + 2598, + 2599 + ], + [ + 2603, + 2606 + ], + [ + 2607, + 2608 + ], + [ + 2623, + 2624 + ], + [ + 2628, + 2629 + ], + [ + 2630, + 2635 + ], + [ + 2637, + 2642 + ], + [ + 2651, + 2653 + ], + [ + 2655, + 2658 + ], + [ + 2660, + 2661 + ], + [ + 2670, + 2671 + ], + [ + 2674, + 2675 + ], + [ + 2681, + 2682 + ], + [ + 2694, + 2695 + ], + [ + 2697, + 2698 + ], + [ + 2700, + 2701 + ], + [ + 2703, + 2705 + ], + [ + 2706, + 2710 + ], + [ + 2711, + 2712 + ], + [ + 2713, + 2718 + ], + [ + 2720, + 2721 + ], + [ + 2722, + 2723 + ], + [ + 2728, + 2729 + ], + [ + 2733, + 2734 + ], + [ + 2737, + 2738 + ], + [ + 2742, + 2743 + ], + [ + 2749, + 2752 + ], + [ + 2760, + 2761 + ], + [ + 2763, + 2764 + ], + [ + 2766, + 2767 + ], + [ + 2769, + 2771 + ], + [ + 2772, + 2776 + ], + [ + 2777, + 2780 + ], + [ + 2782, + 2784 + ], + [ + 2785, + 2787 + ], + [ + 2788, + 2792 + ], + [ + 2793, + 2795 + ], + [ + 2797, + 2798 + ], + [ + 2800, + 2801 + ], + [ + 2803, + 2807 + ], + [ + 2808, + 2810 + ], + [ + 2811, + 2812 + ], + [ + 2814, + 2815 + ], + [ + 2820, + 2821 + ], + [ + 2828, + 2829 + ], + [ + 2831, + 2832 + ], + [ + 2838, + 2840 + ], + [ + 2847, + 2850 + ], + [ + 2851, + 2855 + ], + [ + 2856, + 2858 + ], + [ + 2859, + 2860 + ], + [ + 2867, + 2868 + ], + [ + 2869, + 2870 + ], + [ + 2876, + 2877 + ], + [ + 2882, + 2890 + ], + [ + 2892, + 2898 + ], + [ + 2899, + 2900 + ], + [ + 2901, + 2902 + ], + [ + 2904, + 2905 + ], + [ + 2912, + 2914 + ], + [ + 2916, + 2917 + ], + [ + 2918, + 2919 + ], + [ + 2923, + 2924 + ], + [ + 2927, + 2934 + ], + [ + 2936, + 2938 + ], + [ + 2940, + 2941 + ], + [ + 2955, + 2957 + ], + [ + 2959, + 2960 + ], + [ + 2961, + 2962 + ], + [ + 2965, + 2966 + ], + [ + 2974, + 2975 + ], + [ + 2976, + 2977 + ], + [ + 2979, + 2980 + ], + [ + 2996, + 2997 + ], + [ + 2998, + 3005 + ], + [ + 3007, + 3009 + ], + [ + 3011, + 3012 + ], + [ + 3020, + 3021 + ], + [ + 3023, + 3027 + ], + [ + 3028, + 3029 + ], + [ + 3035, + 3036 + ], + [ + 3037, + 3039 + ], + [ + 3040, + 3041 + ], + [ + 3045, + 3046 + ], + [ + 3051, + 3052 + ], + [ + 3054, + 3056 + ], + [ + 3065, + 3067 + ], + [ + 3068, + 3070 + ], + [ + 3071, + 3072 + ], + [ + 3079, + 3081 + ], + [ + 3085, + 3086 + ], + [ + 3092, + 3093 + ], + [ + 3095, + 3096 + ], + [ + 3108, + 3109 + ], + [ + 3111, + 3112 + ], + [ + 3117, + 3118 + ], + [ + 3126, + 3127 + ], + [ + 3135, + 3136 + ], + [ + 3137, + 3138 + ], + [ + 3139, + 3144 + ], + [ + 3149, + 3155 + ], + [ + 3159, + 3160 + ], + [ + 3165, + 3169 + ], + [ + 3173, + 3175 + ], + [ + 3179, + 3181 + ], + [ + 3183, + 3184 + ], + [ + 3201, + 3204 + ], + [ + 3207, + 3210 + ], + [ + 3211, + 3212 + ], + [ + 3214, + 3217 + ], + [ + 3221, + 3222 + ], + [ + 3224, + 3226 + ], + [ + 3231, + 3233 + ], + [ + 3236, + 3241 + ], + [ + 3245, + 3248 + ], + [ + 3251, + 3255 + ], + [ + 3257, + 3258 + ], + [ + 3263, + 3264 + ], + [ + 3267, + 3268 + ], + [ + 3270, + 3272 + ], + [ + 3273, + 3274 + ], + [ + 3276, + 3277 + ], + [ + 3279, + 3280 + ], + [ + 3287, + 3288 + ], + [ + 3289, + 3290 + ], + [ + 3296, + 3297 + ], + [ + 3298, + 3304 + ], + [ + 3307, + 3308 + ], + [ + 3309, + 3310 + ], + [ + 3311, + 3312 + ], + [ + 3314, + 3315 + ], + [ + 3317, + 3318 + ], + [ + 3319, + 3320 + ], + [ + 3322, + 3323 + ], + [ + 3338, + 3339 + ], + [ + 3348, + 3349 + ], + [ + 3352, + 3353 + ], + [ + 3360, + 3361 + ], + [ + 3367, + 3370 + ], + [ + 3374, + 3377 + ], + [ + 3379, + 3380 + ], + [ + 3387, + 3390 + ], + [ + 3396, + 3397 + ], + [ + 3402, + 3404 + ], + [ + 3406, + 3407 + ], + [ + 3409, + 3412 + ], + [ + 3413, + 3414 + ], + [ + 3418, + 3422 + ], + [ + 3434, + 3437 + ], + [ + 3438, + 3439 + ], + [ + 3442, + 3445 + ], + [ + 3452, + 3453 + ], + [ + 3457, + 3458 + ], + [ + 3460, + 3461 + ], + [ + 3473, + 3475 + ], + [ + 3480, + 3483 + ], + [ + 3486, + 3489 + ], + [ + 3498, + 3501 + ], + [ + 3505, + 3508 + ], + [ + 3510, + 3511 + ], + [ + 3513, + 3515 + ], + [ + 3517, + 3520 + ], + [ + 3521, + 3522 + ], + [ + 3525, + 3529 + ], + [ + 3540, + 3541 + ], + [ + 3550, + 3553 + ], + [ + 3555, + 3556 + ], + [ + 3557, + 3558 + ], + [ + 3563, + 3564 + ], + [ + 3566, + 3567 + ], + [ + 3570, + 3571 + ], + [ + 3579, + 3580 + ], + [ + 3583, + 3585 + ], + [ + 3588, + 3589 + ], + [ + 3599, + 3601 + ], + [ + 3605, + 3608 + ], + [ + 3610, + 3611 + ], + [ + 3613, + 3614 + ], + [ + 3615, + 3616 + ], + [ + 3622, + 3624 + ], + [ + 3631, + 3632 + ], + [ + 3633, + 3634 + ], + [ + 3636, + 3638 + ], + [ + 3640, + 3641 + ], + [ + 3645, + 3649 + ], + [ + 3662, + 3666 + ], + [ + 3680, + 3682 + ], + [ + 3686, + 3689 + ], + [ + 3691, + 3692 + ], + [ + 3705, + 3707 + ], + [ + 3709, + 3711 + ], + [ + 3713, + 3714 + ], + [ + 3715, + 3719 + ], + [ + 3724, + 3728 + ], + [ + 3737, + 3740 + ], + [ + 3742, + 3743 + ], + [ + 3752, + 3753 + ], + [ + 3754, + 3755 + ], + [ + 3761, + 3762 + ], + [ + 3764, + 3765 + ], + [ + 3766, + 3768 + ], + [ + 3771, + 3772 + ], + [ + 3782, + 3783 + ], + [ + 3784, + 3785 + ], + [ + 3788, + 3789 + ], + [ + 3794, + 3795 + ], + [ + 3796, + 3799 + ], + [ + 3801, + 3802 + ], + [ + 3812, + 3813 + ], + [ + 3814, + 3815 + ], + [ + 3817, + 3818 + ], + [ + 3827, + 3828 + ], + [ + 3831, + 3832 + ], + [ + 3842, + 3843 + ], + [ + 3844, + 3845 + ], + [ + 3846, + 3848 + ], + [ + 3856, + 3859 + ], + [ + 3861, + 3862 + ], + [ + 3872, + 3873 + ], + [ + 3874, + 3875 + ], + [ + 3876, + 3878 + ], + [ + 3886, + 3889 + ], + [ + 3891, + 3892 + ], + [ + 3904, + 3905 + ], + [ + 3906, + 3907 + ], + [ + 3912, + 3913 + ], + [ + 3914, + 3915 + ], + [ + 3917, + 3923 + ], + [ + 3924, + 3925 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/init.c", + "line_filter": { + "diff_chunks": [ + [ + 38, + 66 + ], + [ + 118, + 125 + ], + [ + 142, + 149 + ], + [ + 152, + 166 + ], + [ + 169, + 187 + ], + [ + 189, + 215 + ], + [ + 216, + 223 + ], + [ + 246, + 253 + ], + [ + 257, + 333 + ], + [ + 334, + 384 + ], + [ + 388, + 414 + ], + [ + 415, + 449 + ], + [ + 458, + 563 + ], + [ + 565, + 577 + ], + [ + 601, + 641 + ], + [ + 651, + 659 + ], + [ + 660, + 719 + ], + [ + 722, + 745 + ], + [ + 749, + 762 + ], + [ + 763, + 790 + ], + [ + 791, + 944 + ], + [ + 950, + 1235 + ], + [ + 1240, + 1249 + ], + [ + 1252, + 1288 + ], + [ + 1292, + 1323 + ], + [ + 1324, + 1339 + ] + ], + "lines_added": [ + [ + 41, + 57 + ], + [ + 62, + 63 + ], + [ + 121, + 122 + ], + [ + 145, + 146 + ], + [ + 155, + 156 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 172, + 173 + ], + [ + 176, + 177 + ], + [ + 180, + 182 + ], + [ + 183, + 184 + ], + [ + 192, + 195 + ], + [ + 197, + 198 + ], + [ + 202, + 203 + ], + [ + 209, + 210 + ], + [ + 211, + 212 + ], + [ + 219, + 220 + ], + [ + 249, + 250 + ], + [ + 260, + 261 + ], + [ + 262, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 278 + ], + [ + 279, + 280 + ], + [ + 282, + 283 + ], + [ + 284, + 287 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ], + [ + 294, + 296 + ], + [ + 297, + 298 + ], + [ + 299, + 303 + ], + [ + 309, + 312 + ], + [ + 313, + 314 + ], + [ + 320, + 323 + ], + [ + 329, + 330 + ], + [ + 337, + 338 + ], + [ + 339, + 342 + ], + [ + 345, + 352 + ], + [ + 357, + 358 + ], + [ + 361, + 362 + ], + [ + 363, + 367 + ], + [ + 369, + 371 + ], + [ + 372, + 373 + ], + [ + 377, + 378 + ], + [ + 380, + 381 + ], + [ + 391, + 392 + ], + [ + 393, + 398 + ], + [ + 400, + 403 + ], + [ + 404, + 408 + ], + [ + 410, + 411 + ], + [ + 418, + 419 + ], + [ + 425, + 426 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 435, + 436 + ], + [ + 437, + 446 + ], + [ + 461, + 462 + ], + [ + 464, + 466 + ], + [ + 469, + 470 + ], + [ + 476, + 479 + ], + [ + 480, + 481 + ], + [ + 482, + 483 + ], + [ + 486, + 497 + ], + [ + 503, + 504 + ], + [ + 505, + 506 + ], + [ + 508, + 509 + ], + [ + 514, + 515 + ], + [ + 517, + 519 + ], + [ + 521, + 522 + ], + [ + 524, + 525 + ], + [ + 527, + 529 + ], + [ + 530, + 531 + ], + [ + 534, + 535 + ], + [ + 536, + 538 + ], + [ + 539, + 540 + ], + [ + 541, + 546 + ], + [ + 547, + 551 + ], + [ + 555, + 558 + ], + [ + 559, + 560 + ], + [ + 568, + 574 + ], + [ + 604, + 605 + ], + [ + 608, + 609 + ], + [ + 614, + 616 + ], + [ + 620, + 622 + ], + [ + 623, + 625 + ], + [ + 627, + 630 + ], + [ + 636, + 638 + ], + [ + 654, + 656 + ], + [ + 663, + 664 + ], + [ + 665, + 666 + ], + [ + 667, + 668 + ], + [ + 670, + 672 + ], + [ + 675, + 677 + ], + [ + 680, + 681 + ], + [ + 682, + 683 + ], + [ + 688, + 689 + ], + [ + 694, + 695 + ], + [ + 699, + 700 + ], + [ + 705, + 706 + ], + [ + 708, + 709 + ], + [ + 711, + 713 + ], + [ + 715, + 716 + ], + [ + 725, + 726 + ], + [ + 731, + 732 + ], + [ + 733, + 734 + ], + [ + 738, + 739 + ], + [ + 741, + 742 + ], + [ + 752, + 755 + ], + [ + 756, + 759 + ], + [ + 766, + 767 + ], + [ + 773, + 776 + ], + [ + 781, + 782 + ], + [ + 786, + 787 + ], + [ + 794, + 796 + ], + [ + 799, + 800 + ], + [ + 803, + 805 + ], + [ + 806, + 807 + ], + [ + 808, + 809 + ], + [ + 815, + 816 + ], + [ + 817, + 818 + ], + [ + 821, + 823 + ], + [ + 824, + 825 + ], + [ + 826, + 827 + ], + [ + 830, + 832 + ], + [ + 833, + 834 + ], + [ + 835, + 836 + ], + [ + 839, + 841 + ], + [ + 842, + 843 + ], + [ + 844, + 845 + ], + [ + 848, + 850 + ], + [ + 851, + 852 + ], + [ + 853, + 854 + ], + [ + 857, + 859 + ], + [ + 860, + 861 + ], + [ + 862, + 863 + ], + [ + 866, + 867 + ], + [ + 868, + 903 + ], + [ + 904, + 906 + ], + [ + 907, + 909 + ], + [ + 910, + 926 + ], + [ + 930, + 931 + ], + [ + 933, + 934 + ], + [ + 935, + 936 + ], + [ + 938, + 939 + ], + [ + 940, + 941 + ], + [ + 953, + 954 + ], + [ + 959, + 960 + ], + [ + 963, + 965 + ], + [ + 967, + 970 + ], + [ + 972, + 973 + ], + [ + 978, + 982 + ], + [ + 985, + 996 + ], + [ + 999, + 1002 + ], + [ + 1003, + 1004 + ], + [ + 1005, + 1006 + ], + [ + 1011, + 1012 + ], + [ + 1016, + 1018 + ], + [ + 1022, + 1024 + ], + [ + 1025, + 1027 + ], + [ + 1028, + 1031 + ], + [ + 1034, + 1035 + ], + [ + 1040, + 1041 + ], + [ + 1042, + 1043 + ], + [ + 1046, + 1048 + ], + [ + 1049, + 1050 + ], + [ + 1052, + 1054 + ], + [ + 1055, + 1064 + ], + [ + 1066, + 1068 + ], + [ + 1069, + 1070 + ], + [ + 1075, + 1076 + ], + [ + 1082, + 1088 + ], + [ + 1092, + 1094 + ], + [ + 1096, + 1100 + ], + [ + 1104, + 1107 + ], + [ + 1108, + 1109 + ], + [ + 1110, + 1111 + ], + [ + 1112, + 1114 + ], + [ + 1118, + 1122 + ], + [ + 1123, + 1126 + ], + [ + 1127, + 1130 + ], + [ + 1136, + 1137 + ], + [ + 1139, + 1140 + ], + [ + 1144, + 1148 + ], + [ + 1149, + 1150 + ], + [ + 1153, + 1154 + ], + [ + 1159, + 1160 + ], + [ + 1161, + 1162 + ], + [ + 1165, + 1167 + ], + [ + 1170, + 1173 + ], + [ + 1174, + 1178 + ], + [ + 1180, + 1181 + ], + [ + 1182, + 1183 + ], + [ + 1185, + 1186 + ], + [ + 1190, + 1195 + ], + [ + 1196, + 1197 + ], + [ + 1200, + 1201 + ], + [ + 1206, + 1207 + ], + [ + 1208, + 1209 + ], + [ + 1213, + 1215 + ], + [ + 1217, + 1218 + ], + [ + 1224, + 1225 + ], + [ + 1226, + 1228 + ], + [ + 1229, + 1230 + ], + [ + 1231, + 1232 + ], + [ + 1243, + 1244 + ], + [ + 1245, + 1246 + ], + [ + 1255, + 1257 + ], + [ + 1261, + 1262 + ], + [ + 1263, + 1264 + ], + [ + 1265, + 1266 + ], + [ + 1268, + 1269 + ], + [ + 1271, + 1272 + ], + [ + 1274, + 1275 + ], + [ + 1277, + 1278 + ], + [ + 1280, + 1281 + ], + [ + 1283, + 1285 + ], + [ + 1295, + 1296 + ], + [ + 1297, + 1299 + ], + [ + 1300, + 1301 + ], + [ + 1304, + 1305 + ], + [ + 1306, + 1307 + ], + [ + 1308, + 1311 + ], + [ + 1312, + 1313 + ], + [ + 1315, + 1316 + ], + [ + 1319, + 1320 + ], + [ + 1327, + 1328 + ], + [ + 1334, + 1335 + ], + [ + 1336, + 1338 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/mapfile.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 26, + 58 + ], + [ + 92, + 407 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 54, + 55 + ], + [ + 95, + 96 + ], + [ + 102, + 104 + ], + [ + 105, + 140 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 151, + 153 + ], + [ + 156, + 204 + ], + [ + 206, + 209 + ], + [ + 210, + 214 + ], + [ + 215, + 216 + ], + [ + 217, + 221 + ], + [ + 222, + 223 + ], + [ + 225, + 239 + ], + [ + 242, + 243 + ], + [ + 246, + 247 + ], + [ + 249, + 253 + ], + [ + 254, + 259 + ], + [ + 262, + 263 + ], + [ + 266, + 267 + ], + [ + 271, + 272 + ], + [ + 276, + 281 + ], + [ + 282, + 286 + ], + [ + 288, + 292 + ], + [ + 294, + 296 + ], + [ + 299, + 300 + ], + [ + 305, + 306 + ], + [ + 310, + 311 + ], + [ + 315, + 320 + ], + [ + 322, + 326 + ], + [ + 328, + 330 + ], + [ + 333, + 334 + ], + [ + 336, + 338 + ], + [ + 340, + 341 + ], + [ + 345, + 346 + ], + [ + 349, + 379 + ], + [ + 380, + 392 + ], + [ + 397, + 401 + ], + [ + 402, + 403 + ], + [ + 405, + 406 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/memory.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 24 + ], + [ + 26, + 54 + ], + [ + 87, + 94 + ], + [ + 105, + 112 + ], + [ + 120, + 129 + ], + [ + 137, + 146 + ], + [ + 148, + 157 + ], + [ + 158, + 169 + ], + [ + 170, + 189 + ], + [ + 191, + 220 + ], + [ + 221, + 234 + ], + [ + 235, + 277 + ], + [ + 278, + 287 + ], + [ + 290, + 341 + ], + [ + 357, + 383 + ], + [ + 395, + 423 + ], + [ + 429, + 517 + ] + ], + "lines_added": [ + [ + 19, + 21 + ], + [ + 29, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 45 + ], + [ + 50, + 51 + ], + [ + 90, + 91 + ], + [ + 108, + 109 + ], + [ + 123, + 126 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 151, + 152 + ], + [ + 153, + 154 + ], + [ + 161, + 163 + ], + [ + 165, + 166 + ], + [ + 173, + 174 + ], + [ + 177, + 178 + ], + [ + 179, + 182 + ], + [ + 185, + 186 + ], + [ + 194, + 195 + ], + [ + 197, + 198 + ], + [ + 204, + 205 + ], + [ + 208, + 209 + ], + [ + 210, + 214 + ], + [ + 216, + 217 + ], + [ + 224, + 225 + ], + [ + 230, + 231 + ], + [ + 238, + 239 + ], + [ + 241, + 242 + ], + [ + 244, + 248 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 264, + 265 + ], + [ + 268, + 269 + ], + [ + 272, + 274 + ], + [ + 281, + 282 + ], + [ + 283, + 284 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ], + [ + 297, + 298 + ], + [ + 299, + 300 + ], + [ + 305, + 306 + ], + [ + 310, + 315 + ], + [ + 316, + 317 + ], + [ + 319, + 320 + ], + [ + 321, + 323 + ], + [ + 325, + 326 + ], + [ + 330, + 331 + ], + [ + 333, + 334 + ], + [ + 335, + 336 + ], + [ + 337, + 338 + ], + [ + 360, + 361 + ], + [ + 364, + 366 + ], + [ + 367, + 368 + ], + [ + 369, + 370 + ], + [ + 373, + 375 + ], + [ + 377, + 378 + ], + [ + 379, + 380 + ], + [ + 398, + 399 + ], + [ + 402, + 403 + ], + [ + 406, + 408 + ], + [ + 411, + 413 + ], + [ + 415, + 416 + ], + [ + 417, + 418 + ], + [ + 419, + 420 + ], + [ + 432, + 433 + ], + [ + 436, + 437 + ], + [ + 438, + 439 + ], + [ + 442, + 443 + ], + [ + 444, + 445 + ], + [ + 450, + 451 + ], + [ + 457, + 458 + ], + [ + 461, + 462 + ], + [ + 463, + 464 + ], + [ + 467, + 468 + ], + [ + 469, + 470 + ], + [ + 475, + 476 + ], + [ + 480, + 481 + ], + [ + 484, + 485 + ], + [ + 486, + 487 + ], + [ + 490, + 491 + ], + [ + 492, + 493 + ], + [ + 498, + 499 + ], + [ + 503, + 504 + ], + [ + 507, + 508 + ], + [ + 509, + 510 + ], + [ + 513, + 514 + ], + [ + 515, + 516 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/object.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 69, + 85 + ], + [ + 92, + 105 + ], + [ + 111, + 123 + ], + [ + 124, + 142 + ], + [ + 143, + 150 + ], + [ + 156, + 169 + ], + [ + 171, + 178 + ], + [ + 192, + 208 + ], + [ + 220, + 227 + ], + [ + 229, + 237 + ], + [ + 239, + 379 + ], + [ + 380, + 390 + ], + [ + 391, + 403 + ], + [ + 404, + 418 + ], + [ + 422, + 495 + ], + [ + 498, + 542 + ], + [ + 543, + 577 + ], + [ + 581, + 621 + ], + [ + 623, + 682 + ], + [ + 684, + 739 + ], + [ + 742, + 758 + ], + [ + 767, + 807 + ], + [ + 809, + 830 + ], + [ + 832, + 853 + ], + [ + 855, + 910 + ], + [ + 913, + 1078 + ], + [ + 1079, + 1160 + ], + [ + 1163, + 1328 + ], + [ + 1332, + 1436 + ], + [ + 1439, + 1526 + ], + [ + 1528, + 1535 + ], + [ + 1536, + 1580 + ], + [ + 1592, + 1639 + ], + [ + 1641, + 1754 + ], + [ + 1755, + 1876 + ], + [ + 1879, + 1897 + ], + [ + 1898, + 1971 + ], + [ + 1973, + 2208 + ], + [ + 2210, + 2307 + ], + [ + 2309, + 2330 + ], + [ + 2341, + 2374 + ], + [ + 2383, + 2408 + ], + [ + 2414, + 2447 + ], + [ + 2460, + 2490 + ], + [ + 2492, + 2578 + ], + [ + 2581, + 2704 + ], + [ + 2705, + 2730 + ], + [ + 2734, + 2745 + ], + [ + 2748, + 2761 + ], + [ + 2766, + 2780 + ], + [ + 2784, + 2810 + ], + [ + 2812, + 2903 + ], + [ + 2908, + 2927 + ], + [ + 2933, + 2979 + ], + [ + 2980, + 2998 + ], + [ + 3001, + 3063 + ], + [ + 3065, + 3083 + ], + [ + 3086, + 3093 + ], + [ + 3094, + 3101 + ], + [ + 3107, + 3184 + ], + [ + 3185, + 3257 + ], + [ + 3260, + 3291 + ] + ], + "lines_added": [ + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 27 + ], + [ + 32, + 33 + ], + [ + 72, + 73 + ], + [ + 76, + 78 + ], + [ + 81, + 82 + ], + [ + 95, + 96 + ], + [ + 100, + 102 + ], + [ + 114, + 116 + ], + [ + 119, + 120 + ], + [ + 127, + 128 + ], + [ + 132, + 133 + ], + [ + 138, + 139 + ], + [ + 146, + 147 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 165, + 166 + ], + [ + 174, + 175 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 201, + 205 + ], + [ + 223, + 224 + ], + [ + 232, + 234 + ], + [ + 242, + 243 + ], + [ + 248, + 249 + ], + [ + 253, + 256 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 264, + 265 + ], + [ + 266, + 267 + ], + [ + 270, + 273 + ], + [ + 275, + 276 + ], + [ + 280, + 281 + ], + [ + 282, + 283 + ], + [ + 286, + 289 + ], + [ + 291, + 292 + ], + [ + 296, + 297 + ], + [ + 298, + 299 + ], + [ + 302, + 305 + ], + [ + 307, + 308 + ], + [ + 312, + 313 + ], + [ + 315, + 316 + ], + [ + 317, + 318 + ], + [ + 322, + 336 + ], + [ + 339, + 343 + ], + [ + 346, + 347 + ], + [ + 350, + 351 + ], + [ + 352, + 353 + ], + [ + 356, + 357 + ], + [ + 362, + 365 + ], + [ + 367, + 369 + ], + [ + 374, + 376 + ], + [ + 383, + 385 + ], + [ + 386, + 387 + ], + [ + 394, + 395 + ], + [ + 397, + 398 + ], + [ + 399, + 400 + ], + [ + 407, + 408 + ], + [ + 410, + 411 + ], + [ + 412, + 413 + ], + [ + 414, + 415 + ], + [ + 425, + 426 + ], + [ + 427, + 428 + ], + [ + 429, + 430 + ], + [ + 433, + 434 + ], + [ + 436, + 437 + ], + [ + 438, + 440 + ], + [ + 443, + 444 + ], + [ + 446, + 447 + ], + [ + 448, + 450 + ], + [ + 453, + 454 + ], + [ + 456, + 457 + ], + [ + 458, + 460 + ], + [ + 463, + 464 + ], + [ + 465, + 466 + ], + [ + 469, + 470 + ], + [ + 473, + 474 + ], + [ + 475, + 477 + ], + [ + 478, + 479 + ], + [ + 481, + 487 + ], + [ + 488, + 489 + ], + [ + 491, + 492 + ], + [ + 501, + 502 + ], + [ + 503, + 504 + ], + [ + 505, + 506 + ], + [ + 512, + 513 + ], + [ + 517, + 518 + ], + [ + 521, + 523 + ], + [ + 524, + 528 + ], + [ + 531, + 534 + ], + [ + 535, + 539 + ], + [ + 546, + 547 + ], + [ + 548, + 550 + ], + [ + 553, + 554 + ], + [ + 557, + 560 + ], + [ + 561, + 562 + ], + [ + 565, + 566 + ], + [ + 567, + 568 + ], + [ + 571, + 572 + ], + [ + 573, + 574 + ], + [ + 584, + 585 + ], + [ + 590, + 592 + ], + [ + 596, + 597 + ], + [ + 598, + 601 + ], + [ + 605, + 606 + ], + [ + 607, + 611 + ], + [ + 612, + 614 + ], + [ + 615, + 616 + ], + [ + 617, + 618 + ], + [ + 626, + 628 + ], + [ + 629, + 636 + ], + [ + 639, + 642 + ], + [ + 644, + 645 + ], + [ + 651, + 652 + ], + [ + 658, + 659 + ], + [ + 661, + 662 + ], + [ + 663, + 664 + ], + [ + 666, + 667 + ], + [ + 671, + 674 + ], + [ + 676, + 677 + ], + [ + 678, + 679 + ], + [ + 687, + 688 + ], + [ + 689, + 690 + ], + [ + 691, + 694 + ], + [ + 696, + 697 + ], + [ + 698, + 699 + ], + [ + 705, + 708 + ], + [ + 709, + 712 + ], + [ + 714, + 715 + ], + [ + 717, + 718 + ], + [ + 719, + 720 + ], + [ + 726, + 729 + ], + [ + 732, + 736 + ], + [ + 745, + 747 + ], + [ + 750, + 751 + ], + [ + 752, + 755 + ], + [ + 770, + 771 + ], + [ + 773, + 774 + ], + [ + 775, + 776 + ], + [ + 777, + 782 + ], + [ + 784, + 790 + ], + [ + 792, + 797 + ], + [ + 799, + 800 + ], + [ + 803, + 804 + ], + [ + 812, + 813 + ], + [ + 818, + 821 + ], + [ + 822, + 823 + ], + [ + 826, + 827 + ], + [ + 835, + 836 + ], + [ + 841, + 844 + ], + [ + 845, + 846 + ], + [ + 849, + 850 + ], + [ + 858, + 859 + ], + [ + 864, + 867 + ], + [ + 868, + 869 + ], + [ + 872, + 873 + ], + [ + 876, + 878 + ], + [ + 879, + 880 + ], + [ + 881, + 883 + ], + [ + 884, + 890 + ], + [ + 894, + 895 + ], + [ + 896, + 897 + ], + [ + 898, + 904 + ], + [ + 906, + 907 + ], + [ + 916, + 917 + ], + [ + 919, + 920 + ], + [ + 921, + 923 + ], + [ + 924, + 926 + ], + [ + 927, + 930 + ], + [ + 932, + 935 + ], + [ + 937, + 938 + ], + [ + 942, + 943 + ], + [ + 944, + 945 + ], + [ + 950, + 951 + ], + [ + 953, + 956 + ], + [ + 958, + 959 + ], + [ + 964, + 965 + ], + [ + 967, + 968 + ], + [ + 969, + 971 + ], + [ + 972, + 973 + ], + [ + 974, + 977 + ], + [ + 979, + 982 + ], + [ + 984, + 985 + ], + [ + 991, + 992 + ], + [ + 994, + 997 + ], + [ + 999, + 1000 + ], + [ + 1003, + 1004 + ], + [ + 1005, + 1006 + ], + [ + 1008, + 1011 + ], + [ + 1017, + 1019 + ], + [ + 1020, + 1021 + ], + [ + 1022, + 1023 + ], + [ + 1025, + 1026 + ], + [ + 1027, + 1028 + ], + [ + 1029, + 1030 + ], + [ + 1031, + 1032 + ], + [ + 1033, + 1034 + ], + [ + 1035, + 1036 + ], + [ + 1039, + 1040 + ], + [ + 1041, + 1042 + ], + [ + 1044, + 1047 + ], + [ + 1053, + 1056 + ], + [ + 1057, + 1058 + ], + [ + 1061, + 1063 + ], + [ + 1067, + 1070 + ], + [ + 1073, + 1075 + ], + [ + 1082, + 1085 + ], + [ + 1091, + 1093 + ], + [ + 1094, + 1095 + ], + [ + 1096, + 1097 + ], + [ + 1098, + 1100 + ], + [ + 1101, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1105, + 1106 + ], + [ + 1108, + 1110 + ], + [ + 1111, + 1117 + ], + [ + 1121, + 1122 + ], + [ + 1123, + 1124 + ], + [ + 1125, + 1131 + ], + [ + 1135, + 1136 + ], + [ + 1139, + 1143 + ], + [ + 1145, + 1149 + ], + [ + 1150, + 1152 + ], + [ + 1154, + 1157 + ], + [ + 1166, + 1167 + ], + [ + 1168, + 1180 + ], + [ + 1181, + 1182 + ], + [ + 1187, + 1189 + ], + [ + 1190, + 1192 + ], + [ + 1193, + 1194 + ], + [ + 1195, + 1196 + ], + [ + 1197, + 1198 + ], + [ + 1200, + 1203 + ], + [ + 1207, + 1209 + ], + [ + 1210, + 1214 + ], + [ + 1216, + 1218 + ], + [ + 1222, + 1223 + ], + [ + 1224, + 1226 + ], + [ + 1227, + 1229 + ], + [ + 1234, + 1235 + ], + [ + 1236, + 1238 + ], + [ + 1239, + 1241 + ], + [ + 1247, + 1250 + ], + [ + 1251, + 1254 + ], + [ + 1255, + 1258 + ], + [ + 1259, + 1261 + ], + [ + 1262, + 1265 + ], + [ + 1266, + 1267 + ], + [ + 1268, + 1271 + ], + [ + 1272, + 1273 + ], + [ + 1274, + 1277 + ], + [ + 1278, + 1279 + ], + [ + 1280, + 1283 + ], + [ + 1284, + 1285 + ], + [ + 1286, + 1289 + ], + [ + 1290, + 1291 + ], + [ + 1292, + 1295 + ], + [ + 1296, + 1297 + ], + [ + 1298, + 1301 + ], + [ + 1302, + 1303 + ], + [ + 1304, + 1307 + ], + [ + 1308, + 1311 + ], + [ + 1317, + 1318 + ], + [ + 1320, + 1321 + ], + [ + 1322, + 1325 + ], + [ + 1335, + 1337 + ], + [ + 1338, + 1340 + ], + [ + 1341, + 1342 + ], + [ + 1343, + 1344 + ], + [ + 1345, + 1346 + ], + [ + 1347, + 1348 + ], + [ + 1353, + 1354 + ], + [ + 1357, + 1360 + ], + [ + 1361, + 1362 + ], + [ + 1363, + 1366 + ], + [ + 1367, + 1368 + ], + [ + 1369, + 1372 + ], + [ + 1373, + 1374 + ], + [ + 1375, + 1378 + ], + [ + 1379, + 1380 + ], + [ + 1381, + 1384 + ], + [ + 1385, + 1386 + ], + [ + 1387, + 1390 + ], + [ + 1391, + 1392 + ], + [ + 1393, + 1396 + ], + [ + 1397, + 1398 + ], + [ + 1399, + 1402 + ], + [ + 1403, + 1404 + ], + [ + 1405, + 1408 + ], + [ + 1409, + 1410 + ], + [ + 1411, + 1414 + ], + [ + 1418, + 1419 + ], + [ + 1421, + 1422 + ], + [ + 1423, + 1426 + ], + [ + 1430, + 1431 + ], + [ + 1432, + 1433 + ], + [ + 1442, + 1445 + ], + [ + 1447, + 1448 + ], + [ + 1453, + 1454 + ], + [ + 1455, + 1456 + ], + [ + 1457, + 1458 + ], + [ + 1461, + 1463 + ], + [ + 1464, + 1465 + ], + [ + 1468, + 1469 + ], + [ + 1471, + 1474 + ], + [ + 1476, + 1477 + ], + [ + 1478, + 1479 + ], + [ + 1482, + 1483 + ], + [ + 1484, + 1489 + ], + [ + 1492, + 1493 + ], + [ + 1497, + 1498 + ], + [ + 1499, + 1503 + ], + [ + 1504, + 1506 + ], + [ + 1509, + 1510 + ], + [ + 1514, + 1515 + ], + [ + 1517, + 1520 + ], + [ + 1522, + 1523 + ], + [ + 1531, + 1532 + ], + [ + 1539, + 1543 + ], + [ + 1545, + 1546 + ], + [ + 1548, + 1550 + ], + [ + 1551, + 1552 + ], + [ + 1555, + 1556 + ], + [ + 1559, + 1560 + ], + [ + 1561, + 1563 + ], + [ + 1566, + 1567 + ], + [ + 1568, + 1569 + ], + [ + 1574, + 1577 + ], + [ + 1595, + 1596 + ], + [ + 1600, + 1601 + ], + [ + 1605, + 1607 + ], + [ + 1608, + 1611 + ], + [ + 1612, + 1614 + ], + [ + 1615, + 1618 + ], + [ + 1619, + 1621 + ], + [ + 1627, + 1628 + ], + [ + 1629, + 1631 + ], + [ + 1632, + 1633 + ], + [ + 1635, + 1636 + ], + [ + 1644, + 1646 + ], + [ + 1647, + 1648 + ], + [ + 1650, + 1651 + ], + [ + 1657, + 1658 + ], + [ + 1659, + 1661 + ], + [ + 1662, + 1663 + ], + [ + 1665, + 1666 + ], + [ + 1671, + 1673 + ], + [ + 1674, + 1676 + ], + [ + 1677, + 1678 + ], + [ + 1680, + 1681 + ], + [ + 1684, + 1685 + ], + [ + 1687, + 1690 + ], + [ + 1692, + 1695 + ], + [ + 1698, + 1699 + ], + [ + 1701, + 1702 + ], + [ + 1703, + 1709 + ], + [ + 1712, + 1713 + ], + [ + 1717, + 1718 + ], + [ + 1723, + 1725 + ], + [ + 1726, + 1727 + ], + [ + 1732, + 1733 + ], + [ + 1734, + 1736 + ], + [ + 1740, + 1741 + ], + [ + 1744, + 1745 + ], + [ + 1748, + 1749 + ], + [ + 1750, + 1751 + ], + [ + 1758, + 1760 + ], + [ + 1764, + 1766 + ], + [ + 1767, + 1769 + ], + [ + 1771, + 1775 + ], + [ + 1777, + 1778 + ], + [ + 1780, + 1782 + ], + [ + 1784, + 1785 + ], + [ + 1786, + 1797 + ], + [ + 1802, + 1810 + ], + [ + 1812, + 1813 + ], + [ + 1814, + 1818 + ], + [ + 1819, + 1820 + ], + [ + 1822, + 1837 + ], + [ + 1840, + 1841 + ], + [ + 1844, + 1845 + ], + [ + 1846, + 1847 + ], + [ + 1852, + 1854 + ], + [ + 1856, + 1859 + ], + [ + 1860, + 1862 + ], + [ + 1863, + 1864 + ], + [ + 1869, + 1871 + ], + [ + 1872, + 1873 + ], + [ + 1882, + 1884 + ], + [ + 1885, + 1888 + ], + [ + 1889, + 1890 + ], + [ + 1891, + 1892 + ], + [ + 1893, + 1894 + ], + [ + 1901, + 1904 + ], + [ + 1905, + 1908 + ], + [ + 1910, + 1911 + ], + [ + 1912, + 1915 + ], + [ + 1916, + 1917 + ], + [ + 1918, + 1919 + ], + [ + 1921, + 1930 + ], + [ + 1931, + 1932 + ], + [ + 1934, + 1938 + ], + [ + 1940, + 1942 + ], + [ + 1946, + 1947 + ], + [ + 1948, + 1949 + ], + [ + 1951, + 1954 + ], + [ + 1956, + 1961 + ], + [ + 1965, + 1966 + ], + [ + 1967, + 1968 + ], + [ + 1976, + 1979 + ], + [ + 1982, + 1985 + ], + [ + 1986, + 1987 + ], + [ + 1989, + 1990 + ], + [ + 1991, + 1994 + ], + [ + 1995, + 1997 + ], + [ + 2001, + 2002 + ], + [ + 2003, + 2005 + ], + [ + 2007, + 2010 + ], + [ + 2012, + 2015 + ], + [ + 2019, + 2022 + ], + [ + 2024, + 2026 + ], + [ + 2029, + 2030 + ], + [ + 2031, + 2032 + ], + [ + 2035, + 2039 + ], + [ + 2041, + 2043 + ], + [ + 2044, + 2045 + ], + [ + 2047, + 2050 + ], + [ + 2052, + 2056 + ], + [ + 2058, + 2060 + ], + [ + 2061, + 2062 + ], + [ + 2066, + 2069 + ], + [ + 2071, + 2075 + ], + [ + 2077, + 2079 + ], + [ + 2080, + 2081 + ], + [ + 2083, + 2086 + ], + [ + 2088, + 2092 + ], + [ + 2094, + 2096 + ], + [ + 2097, + 2098 + ], + [ + 2100, + 2103 + ], + [ + 2105, + 2108 + ], + [ + 2109, + 2111 + ], + [ + 2112, + 2114 + ], + [ + 2117, + 2120 + ], + [ + 2122, + 2128 + ], + [ + 2130, + 2132 + ], + [ + 2134, + 2137 + ], + [ + 2139, + 2141 + ], + [ + 2143, + 2145 + ], + [ + 2146, + 2147 + ], + [ + 2153, + 2154 + ], + [ + 2160, + 2161 + ], + [ + 2163, + 2166 + ], + [ + 2167, + 2168 + ], + [ + 2171, + 2172 + ], + [ + 2173, + 2178 + ], + [ + 2180, + 2186 + ], + [ + 2188, + 2189 + ], + [ + 2192, + 2193 + ], + [ + 2196, + 2197 + ], + [ + 2203, + 2205 + ], + [ + 2213, + 2215 + ], + [ + 2217, + 2220 + ], + [ + 2221, + 2222 + ], + [ + 2223, + 2224 + ], + [ + 2225, + 2226 + ], + [ + 2230, + 2231 + ], + [ + 2232, + 2233 + ], + [ + 2235, + 2243 + ], + [ + 2244, + 2246 + ], + [ + 2250, + 2254 + ], + [ + 2255, + 2256 + ], + [ + 2258, + 2261 + ], + [ + 2263, + 2267 + ], + [ + 2268, + 2269 + ], + [ + 2272, + 2273 + ], + [ + 2274, + 2276 + ], + [ + 2278, + 2279 + ], + [ + 2282, + 2283 + ], + [ + 2286, + 2287 + ], + [ + 2288, + 2289 + ], + [ + 2291, + 2293 + ], + [ + 2294, + 2295 + ], + [ + 2300, + 2301 + ], + [ + 2302, + 2304 + ], + [ + 2312, + 2313 + ], + [ + 2316, + 2317 + ], + [ + 2321, + 2322 + ], + [ + 2326, + 2327 + ], + [ + 2344, + 2346 + ], + [ + 2347, + 2349 + ], + [ + 2353, + 2358 + ], + [ + 2360, + 2362 + ], + [ + 2363, + 2364 + ], + [ + 2365, + 2366 + ], + [ + 2367, + 2368 + ], + [ + 2370, + 2371 + ], + [ + 2386, + 2387 + ], + [ + 2392, + 2393 + ], + [ + 2394, + 2397 + ], + [ + 2399, + 2402 + ], + [ + 2404, + 2405 + ], + [ + 2417, + 2418 + ], + [ + 2421, + 2422 + ], + [ + 2423, + 2424 + ], + [ + 2428, + 2429 + ], + [ + 2430, + 2433 + ], + [ + 2434, + 2435 + ], + [ + 2436, + 2437 + ], + [ + 2438, + 2439 + ], + [ + 2443, + 2444 + ], + [ + 2463, + 2464 + ], + [ + 2468, + 2469 + ], + [ + 2473, + 2476 + ], + [ + 2477, + 2478 + ], + [ + 2481, + 2482 + ], + [ + 2484, + 2485 + ], + [ + 2486, + 2487 + ], + [ + 2495, + 2498 + ], + [ + 2499, + 2501 + ], + [ + 2502, + 2504 + ], + [ + 2505, + 2510 + ], + [ + 2515, + 2529 + ], + [ + 2530, + 2534 + ], + [ + 2536, + 2537 + ], + [ + 2540, + 2542 + ], + [ + 2543, + 2547 + ], + [ + 2549, + 2552 + ], + [ + 2554, + 2555 + ], + [ + 2556, + 2560 + ], + [ + 2561, + 2565 + ], + [ + 2568, + 2572 + ], + [ + 2574, + 2575 + ], + [ + 2584, + 2585 + ], + [ + 2586, + 2587 + ], + [ + 2589, + 2590 + ], + [ + 2594, + 2595 + ], + [ + 2601, + 2602 + ], + [ + 2606, + 2609 + ], + [ + 2610, + 2611 + ], + [ + 2612, + 2613 + ], + [ + 2616, + 2617 + ], + [ + 2622, + 2624 + ], + [ + 2628, + 2630 + ], + [ + 2631, + 2634 + ], + [ + 2637, + 2641 + ], + [ + 2643, + 2644 + ], + [ + 2647, + 2648 + ], + [ + 2651, + 2652 + ], + [ + 2656, + 2659 + ], + [ + 2662, + 2663 + ], + [ + 2665, + 2666 + ], + [ + 2668, + 2669 + ], + [ + 2672, + 2673 + ], + [ + 2676, + 2677 + ], + [ + 2681, + 2685 + ], + [ + 2688, + 2689 + ], + [ + 2691, + 2694 + ], + [ + 2696, + 2697 + ], + [ + 2700, + 2701 + ], + [ + 2708, + 2709 + ], + [ + 2710, + 2711 + ], + [ + 2714, + 2715 + ], + [ + 2719, + 2720 + ], + [ + 2721, + 2727 + ], + [ + 2737, + 2739 + ], + [ + 2740, + 2742 + ], + [ + 2751, + 2752 + ], + [ + 2757, + 2758 + ], + [ + 2769, + 2774 + ], + [ + 2776, + 2777 + ], + [ + 2787, + 2788 + ], + [ + 2793, + 2794 + ], + [ + 2800, + 2801 + ], + [ + 2802, + 2805 + ], + [ + 2806, + 2807 + ], + [ + 2815, + 2817 + ], + [ + 2822, + 2823 + ], + [ + 2826, + 2829 + ], + [ + 2830, + 2831 + ], + [ + 2834, + 2835 + ], + [ + 2840, + 2842 + ], + [ + 2847, + 2848 + ], + [ + 2853, + 2854 + ], + [ + 2857, + 2860 + ], + [ + 2862, + 2865 + ], + [ + 2866, + 2867 + ], + [ + 2872, + 2873 + ], + [ + 2877, + 2879 + ], + [ + 2881, + 2882 + ], + [ + 2885, + 2886 + ], + [ + 2887, + 2889 + ], + [ + 2892, + 2894 + ], + [ + 2895, + 2896 + ], + [ + 2899, + 2900 + ], + [ + 2911, + 2912 + ], + [ + 2918, + 2922 + ], + [ + 2923, + 2924 + ], + [ + 2936, + 2937 + ], + [ + 2938, + 2939 + ], + [ + 2941, + 2943 + ], + [ + 2947, + 2948 + ], + [ + 2950, + 2951 + ], + [ + 2954, + 2955 + ], + [ + 2957, + 2958 + ], + [ + 2961, + 2962 + ], + [ + 2965, + 2967 + ], + [ + 2968, + 2970 + ], + [ + 2971, + 2974 + ], + [ + 2975, + 2976 + ], + [ + 2983, + 2985 + ], + [ + 2987, + 2988 + ], + [ + 2994, + 2995 + ], + [ + 3004, + 3005 + ], + [ + 3006, + 3009 + ], + [ + 3013, + 3016 + ], + [ + 3017, + 3018 + ], + [ + 3022, + 3024 + ], + [ + 3025, + 3026 + ], + [ + 3028, + 3029 + ], + [ + 3035, + 3036 + ], + [ + 3037, + 3038 + ], + [ + 3040, + 3041 + ], + [ + 3045, + 3050 + ], + [ + 3051, + 3052 + ], + [ + 3057, + 3058 + ], + [ + 3059, + 3060 + ], + [ + 3068, + 3069 + ], + [ + 3072, + 3074 + ], + [ + 3075, + 3077 + ], + [ + 3079, + 3080 + ], + [ + 3089, + 3090 + ], + [ + 3097, + 3098 + ], + [ + 3110, + 3111 + ], + [ + 3114, + 3115 + ], + [ + 3116, + 3117 + ], + [ + 3119, + 3120 + ], + [ + 3121, + 3123 + ], + [ + 3124, + 3125 + ], + [ + 3127, + 3129 + ], + [ + 3134, + 3135 + ], + [ + 3136, + 3137 + ], + [ + 3139, + 3140 + ], + [ + 3143, + 3144 + ], + [ + 3148, + 3150 + ], + [ + 3151, + 3152 + ], + [ + 3155, + 3156 + ], + [ + 3157, + 3158 + ], + [ + 3160, + 3161 + ], + [ + 3162, + 3168 + ], + [ + 3169, + 3173 + ], + [ + 3176, + 3177 + ], + [ + 3180, + 3181 + ], + [ + 3188, + 3193 + ], + [ + 3194, + 3197 + ], + [ + 3199, + 3200 + ], + [ + 3203, + 3204 + ], + [ + 3210, + 3211 + ], + [ + 3212, + 3213 + ], + [ + 3214, + 3215 + ], + [ + 3218, + 3219 + ], + [ + 3220, + 3222 + ], + [ + 3225, + 3226 + ], + [ + 3229, + 3230 + ], + [ + 3231, + 3234 + ], + [ + 3236, + 3238 + ], + [ + 3242, + 3244 + ], + [ + 3246, + 3247 + ], + [ + 3253, + 3254 + ], + [ + 3263, + 3264 + ], + [ + 3265, + 3267 + ], + [ + 3273, + 3274 + ], + [ + 3277, + 3279 + ], + [ + 3282, + 3283 + ], + [ + 3284, + 3285 + ], + [ + 3286, + 3288 + ], + [ + 3289, + 3290 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/operation.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 62, + 71 + ], + [ + 75, + 82 + ], + [ + 91, + 98 + ], + [ + 100, + 118 + ], + [ + 156, + 172 + ], + [ + 178, + 185 + ], + [ + 191, + 205 + ], + [ + 208, + 247 + ], + [ + 258, + 422 + ], + [ + 423, + 432 + ], + [ + 434, + 443 + ], + [ + 444, + 597 + ], + [ + 599, + 621 + ], + [ + 627, + 638 + ], + [ + 641, + 665 + ], + [ + 666, + 681 + ], + [ + 682, + 705 + ], + [ + 707, + 788 + ], + [ + 794, + 897 + ], + [ + 900, + 975 + ], + [ + 978, + 989 + ], + [ + 995, + 1107 + ], + [ + 1111, + 1119 + ], + [ + 1120, + 1146 + ], + [ + 1147, + 1276 + ], + [ + 1282, + 1371 + ], + [ + 1375, + 1397 + ], + [ + 1398, + 1465 + ], + [ + 1477, + 1490 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 65, + 66 + ], + [ + 67, + 68 + ], + [ + 78, + 79 + ], + [ + 94, + 95 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 159, + 160 + ], + [ + 165, + 166 + ], + [ + 168, + 169 + ], + [ + 181, + 182 + ], + [ + 194, + 195 + ], + [ + 199, + 202 + ], + [ + 211, + 212 + ], + [ + 214, + 215 + ], + [ + 220, + 221 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 231 + ], + [ + 232, + 233 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 243, + 244 + ], + [ + 261, + 262 + ], + [ + 264, + 268 + ], + [ + 273, + 274 + ], + [ + 275, + 278 + ], + [ + 279, + 281 + ], + [ + 282, + 284 + ], + [ + 285, + 288 + ], + [ + 289, + 290 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ], + [ + 299, + 301 + ], + [ + 304, + 305 + ], + [ + 308, + 309 + ], + [ + 311, + 312 + ], + [ + 313, + 320 + ], + [ + 323, + 327 + ], + [ + 329, + 330 + ], + [ + 331, + 332 + ], + [ + 334, + 338 + ], + [ + 339, + 340 + ], + [ + 342, + 350 + ], + [ + 351, + 352 + ], + [ + 354, + 362 + ], + [ + 366, + 367 + ], + [ + 368, + 369 + ], + [ + 370, + 384 + ], + [ + 386, + 390 + ], + [ + 395, + 396 + ], + [ + 399, + 400 + ], + [ + 401, + 402 + ], + [ + 405, + 407 + ], + [ + 410, + 411 + ], + [ + 415, + 419 + ], + [ + 426, + 429 + ], + [ + 437, + 440 + ], + [ + 447, + 450 + ], + [ + 453, + 454 + ], + [ + 456, + 463 + ], + [ + 465, + 466 + ], + [ + 470, + 471 + ], + [ + 473, + 474 + ], + [ + 477, + 491 + ], + [ + 494, + 495 + ], + [ + 496, + 498 + ], + [ + 499, + 504 + ], + [ + 505, + 506 + ], + [ + 509, + 510 + ], + [ + 513, + 514 + ], + [ + 517, + 518 + ], + [ + 520, + 522 + ], + [ + 523, + 526 + ], + [ + 527, + 530 + ], + [ + 532, + 538 + ], + [ + 540, + 541 + ], + [ + 544, + 545 + ], + [ + 546, + 547 + ], + [ + 549, + 552 + ], + [ + 554, + 558 + ], + [ + 560, + 562 + ], + [ + 563, + 564 + ], + [ + 567, + 568 + ], + [ + 569, + 571 + ], + [ + 572, + 575 + ], + [ + 576, + 577 + ], + [ + 578, + 579 + ], + [ + 582, + 583 + ], + [ + 584, + 585 + ], + [ + 586, + 587 + ], + [ + 590, + 591 + ], + [ + 592, + 594 + ], + [ + 602, + 603 + ], + [ + 607, + 609 + ], + [ + 610, + 611 + ], + [ + 613, + 614 + ], + [ + 617, + 618 + ], + [ + 630, + 631 + ], + [ + 632, + 633 + ], + [ + 634, + 635 + ], + [ + 644, + 645 + ], + [ + 647, + 648 + ], + [ + 649, + 651 + ], + [ + 654, + 655 + ], + [ + 657, + 659 + ], + [ + 661, + 662 + ], + [ + 669, + 670 + ], + [ + 671, + 673 + ], + [ + 674, + 675 + ], + [ + 677, + 678 + ], + [ + 685, + 689 + ], + [ + 691, + 695 + ], + [ + 697, + 698 + ], + [ + 699, + 700 + ], + [ + 701, + 702 + ], + [ + 710, + 711 + ], + [ + 714, + 715 + ], + [ + 716, + 717 + ], + [ + 718, + 720 + ], + [ + 721, + 724 + ], + [ + 725, + 726 + ], + [ + 730, + 733 + ], + [ + 738, + 742 + ], + [ + 745, + 747 + ], + [ + 748, + 749 + ], + [ + 751, + 753 + ], + [ + 757, + 759 + ], + [ + 760, + 761 + ], + [ + 764, + 765 + ], + [ + 766, + 767 + ], + [ + 768, + 770 + ], + [ + 771, + 776 + ], + [ + 777, + 778 + ], + [ + 779, + 780 + ], + [ + 783, + 785 + ], + [ + 797, + 799 + ], + [ + 804, + 805 + ], + [ + 808, + 809 + ], + [ + 813, + 815 + ], + [ + 816, + 817 + ], + [ + 820, + 821 + ], + [ + 824, + 825 + ], + [ + 826, + 827 + ], + [ + 831, + 832 + ], + [ + 833, + 836 + ], + [ + 837, + 838 + ], + [ + 843, + 844 + ], + [ + 849, + 851 + ], + [ + 855, + 859 + ], + [ + 860, + 862 + ], + [ + 864, + 865 + ], + [ + 868, + 869 + ], + [ + 875, + 876 + ], + [ + 882, + 883 + ], + [ + 884, + 886 + ], + [ + 892, + 894 + ], + [ + 903, + 909 + ], + [ + 910, + 912 + ], + [ + 915, + 917 + ], + [ + 920, + 928 + ], + [ + 931, + 933 + ], + [ + 937, + 939 + ], + [ + 940, + 942 + ], + [ + 946, + 951 + ], + [ + 952, + 953 + ], + [ + 955, + 956 + ], + [ + 959, + 962 + ], + [ + 963, + 964 + ], + [ + 966, + 967 + ], + [ + 969, + 970 + ], + [ + 971, + 972 + ], + [ + 981, + 982 + ], + [ + 983, + 984 + ], + [ + 985, + 986 + ], + [ + 998, + 999 + ], + [ + 1005, + 1006 + ], + [ + 1012, + 1014 + ], + [ + 1015, + 1016 + ], + [ + 1020, + 1021 + ], + [ + 1022, + 1023 + ], + [ + 1024, + 1027 + ], + [ + 1028, + 1029 + ], + [ + 1030, + 1033 + ], + [ + 1034, + 1036 + ], + [ + 1039, + 1041 + ], + [ + 1044, + 1045 + ], + [ + 1046, + 1047 + ], + [ + 1048, + 1050 + ], + [ + 1051, + 1052 + ], + [ + 1055, + 1056 + ], + [ + 1060, + 1064 + ], + [ + 1065, + 1066 + ], + [ + 1069, + 1071 + ], + [ + 1075, + 1079 + ], + [ + 1080, + 1081 + ], + [ + 1084, + 1085 + ], + [ + 1088, + 1089 + ], + [ + 1095, + 1096 + ], + [ + 1097, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1114, + 1116 + ], + [ + 1123, + 1124 + ], + [ + 1126, + 1129 + ], + [ + 1130, + 1131 + ], + [ + 1134, + 1135 + ], + [ + 1136, + 1138 + ], + [ + 1141, + 1143 + ], + [ + 1150, + 1152 + ], + [ + 1155, + 1156 + ], + [ + 1158, + 1166 + ], + [ + 1170, + 1176 + ], + [ + 1179, + 1195 + ], + [ + 1197, + 1198 + ], + [ + 1203, + 1204 + ], + [ + 1205, + 1212 + ], + [ + 1214, + 1215 + ], + [ + 1218, + 1219 + ], + [ + 1222, + 1223 + ], + [ + 1226, + 1227 + ], + [ + 1228, + 1232 + ], + [ + 1235, + 1236 + ], + [ + 1239, + 1240 + ], + [ + 1245, + 1246 + ], + [ + 1247, + 1248 + ], + [ + 1252, + 1255 + ], + [ + 1260, + 1261 + ], + [ + 1262, + 1263 + ], + [ + 1265, + 1266 + ], + [ + 1269, + 1270 + ], + [ + 1271, + 1273 + ], + [ + 1285, + 1286 + ], + [ + 1287, + 1292 + ], + [ + 1294, + 1295 + ], + [ + 1298, + 1299 + ], + [ + 1302, + 1303 + ], + [ + 1308, + 1309 + ], + [ + 1310, + 1312 + ], + [ + 1313, + 1314 + ], + [ + 1316, + 1320 + ], + [ + 1323, + 1325 + ], + [ + 1329, + 1330 + ], + [ + 1333, + 1334 + ], + [ + 1337, + 1338 + ], + [ + 1343, + 1344 + ], + [ + 1345, + 1347 + ], + [ + 1348, + 1350 + ], + [ + 1353, + 1357 + ], + [ + 1361, + 1364 + ], + [ + 1367, + 1368 + ], + [ + 1378, + 1379 + ], + [ + 1382, + 1383 + ], + [ + 1385, + 1394 + ], + [ + 1401, + 1404 + ], + [ + 1409, + 1413 + ], + [ + 1418, + 1420 + ], + [ + 1423, + 1426 + ], + [ + 1429, + 1432 + ], + [ + 1433, + 1434 + ], + [ + 1437, + 1438 + ], + [ + 1439, + 1440 + ], + [ + 1442, + 1446 + ], + [ + 1448, + 1449 + ], + [ + 1453, + 1454 + ], + [ + 1456, + 1457 + ], + [ + 1458, + 1459 + ], + [ + 1461, + 1462 + ], + [ + 1480, + 1481 + ], + [ + 1484, + 1489 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/rect.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 62, + 88 + ], + [ + 93, + 102 + ], + [ + 103, + 120 + ], + [ + 121, + 136 + ], + [ + 142, + 155 + ], + [ + 159, + 167 + ], + [ + 171, + 190 + ], + [ + 195, + 221 + ], + [ + 232, + 247 + ], + [ + 251, + 264 + ] + ], + "lines_added": [ + [ + 13, + 14 + ], + [ + 15, + 19 + ], + [ + 20, + 29 + ], + [ + 34, + 35 + ], + [ + 65, + 66 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 79, + 82 + ], + [ + 84, + 85 + ], + [ + 96, + 99 + ], + [ + 106, + 107 + ], + [ + 111, + 112 + ], + [ + 113, + 114 + ], + [ + 116, + 117 + ], + [ + 124, + 125 + ], + [ + 129, + 133 + ], + [ + 145, + 146 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 162, + 164 + ], + [ + 174, + 175 + ], + [ + 179, + 187 + ], + [ + 198, + 199 + ], + [ + 203, + 206 + ], + [ + 207, + 208 + ], + [ + 210, + 218 + ], + [ + 235, + 236 + ], + [ + 239, + 241 + ], + [ + 243, + 244 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 261 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/region.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 46, + 53 + ], + [ + 55, + 88 + ], + [ + 109, + 116 + ], + [ + 136, + 143 + ], + [ + 168, + 177 + ], + [ + 182, + 193 + ], + [ + 195, + 374 + ], + [ + 376, + 418 + ], + [ + 419, + 475 + ], + [ + 479, + 495 + ], + [ + 496, + 530 + ], + [ + 537, + 556 + ], + [ + 557, + 604 + ], + [ + 605, + 619 + ], + [ + 621, + 628 + ], + [ + 629, + 666 + ], + [ + 667, + 684 + ], + [ + 688, + 695 + ], + [ + 697, + 712 + ], + [ + 715, + 733 + ], + [ + 742, + 749 + ], + [ + 754, + 769 + ], + [ + 773, + 796 + ], + [ + 797, + 819 + ], + [ + 829, + 836 + ], + [ + 843, + 905 + ], + [ + 906, + 919 + ], + [ + 920, + 959 + ], + [ + 961, + 969 + ], + [ + 975, + 982 + ], + [ + 984, + 999 + ], + [ + 1000, + 1021 + ], + [ + 1029, + 1044 + ], + [ + 1049, + 1063 + ], + [ + 1065, + 1072 + ], + [ + 1074, + 1140 + ], + [ + 1147, + 1185 + ], + [ + 1188, + 1236 + ], + [ + 1247, + 1274 + ], + [ + 1279, + 1543 + ], + [ + 1555, + 1588 + ], + [ + 1599, + 1671 + ], + [ + 1673, + 1699 + ], + [ + 1703, + 1767 + ], + [ + 1768, + 1783 + ], + [ + 1784, + 1792 + ], + [ + 1794, + 1825 + ], + [ + 1827, + 1840 + ], + [ + 1845, + 1872 + ], + [ + 1874, + 1883 + ], + [ + 1885, + 1936 + ], + [ + 1946, + 1954 + ], + [ + 1957, + 1965 + ], + [ + 1968, + 1997 + ], + [ + 2000, + 2010 + ], + [ + 2012, + 2024 + ], + [ + 2026, + 2087 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 49, + 50 + ], + [ + 58, + 64 + ], + [ + 65, + 69 + ], + [ + 70, + 74 + ], + [ + 79, + 80 + ], + [ + 84, + 85 + ], + [ + 112, + 113 + ], + [ + 139, + 140 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 185, + 186 + ], + [ + 189, + 190 + ], + [ + 198, + 199 + ], + [ + 200, + 201 + ], + [ + 207, + 208 + ], + [ + 210, + 213 + ], + [ + 216, + 219 + ], + [ + 221, + 222 + ], + [ + 227, + 228 + ], + [ + 231, + 233 + ], + [ + 234, + 235 + ], + [ + 236, + 237 + ], + [ + 238, + 240 + ], + [ + 241, + 244 + ], + [ + 245, + 248 + ], + [ + 250, + 253 + ], + [ + 254, + 255 + ], + [ + 257, + 258 + ], + [ + 260, + 261 + ], + [ + 264, + 265 + ], + [ + 267, + 268 + ], + [ + 269, + 270 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 276, + 277 + ], + [ + 281, + 287 + ], + [ + 290, + 291 + ], + [ + 292, + 293 + ], + [ + 296, + 299 + ], + [ + 301, + 302 + ], + [ + 303, + 306 + ], + [ + 309, + 311 + ], + [ + 312, + 313 + ], + [ + 314, + 315 + ], + [ + 316, + 317 + ], + [ + 318, + 319 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 326, + 327 + ], + [ + 328, + 329 + ], + [ + 332, + 333 + ], + [ + 334, + 352 + ], + [ + 355, + 356 + ], + [ + 357, + 358 + ], + [ + 359, + 365 + ], + [ + 366, + 369 + ], + [ + 370, + 371 + ], + [ + 379, + 380 + ], + [ + 384, + 385 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 390, + 392 + ], + [ + 393, + 396 + ], + [ + 398, + 400 + ], + [ + 404, + 405 + ], + [ + 408, + 409 + ], + [ + 410, + 415 + ], + [ + 422, + 423 + ], + [ + 424, + 425 + ], + [ + 426, + 427 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 433, + 435 + ], + [ + 436, + 437 + ], + [ + 440, + 441 + ], + [ + 442, + 443 + ], + [ + 445, + 446 + ], + [ + 447, + 449 + ], + [ + 450, + 451 + ], + [ + 454, + 455 + ], + [ + 456, + 457 + ], + [ + 458, + 459 + ], + [ + 460, + 461 + ], + [ + 462, + 463 + ], + [ + 464, + 465 + ], + [ + 468, + 469 + ], + [ + 470, + 472 + ], + [ + 482, + 483 + ], + [ + 487, + 492 + ], + [ + 499, + 500 + ], + [ + 505, + 506 + ], + [ + 512, + 515 + ], + [ + 516, + 517 + ], + [ + 519, + 522 + ], + [ + 524, + 525 + ], + [ + 526, + 527 + ], + [ + 540, + 541 + ], + [ + 545, + 546 + ], + [ + 552, + 553 + ], + [ + 560, + 561 + ], + [ + 564, + 568 + ], + [ + 570, + 571 + ], + [ + 577, + 579 + ], + [ + 581, + 583 + ], + [ + 585, + 586 + ], + [ + 588, + 591 + ], + [ + 596, + 597 + ], + [ + 600, + 601 + ], + [ + 608, + 611 + ], + [ + 615, + 616 + ], + [ + 624, + 625 + ], + [ + 632, + 633 + ], + [ + 634, + 638 + ], + [ + 641, + 642 + ], + [ + 643, + 644 + ], + [ + 646, + 647 + ], + [ + 652, + 654 + ], + [ + 656, + 657 + ], + [ + 660, + 663 + ], + [ + 670, + 671 + ], + [ + 674, + 675 + ], + [ + 676, + 678 + ], + [ + 680, + 681 + ], + [ + 691, + 692 + ], + [ + 700, + 702 + ], + [ + 707, + 709 + ], + [ + 718, + 722 + ], + [ + 723, + 728 + ], + [ + 729, + 730 + ], + [ + 745, + 746 + ], + [ + 757, + 761 + ], + [ + 765, + 766 + ], + [ + 776, + 780 + ], + [ + 784, + 786 + ], + [ + 789, + 790 + ], + [ + 792, + 793 + ], + [ + 800, + 801 + ], + [ + 804, + 805 + ], + [ + 811, + 812 + ], + [ + 813, + 816 + ], + [ + 832, + 833 + ], + [ + 846, + 850 + ], + [ + 855, + 856 + ], + [ + 859, + 861 + ], + [ + 862, + 864 + ], + [ + 865, + 866 + ], + [ + 867, + 868 + ], + [ + 871, + 872 + ], + [ + 876, + 878 + ], + [ + 881, + 884 + ], + [ + 887, + 889 + ], + [ + 891, + 892 + ], + [ + 894, + 902 + ], + [ + 909, + 911 + ], + [ + 913, + 914 + ], + [ + 915, + 916 + ], + [ + 923, + 924 + ], + [ + 927, + 932 + ], + [ + 934, + 937 + ], + [ + 941, + 945 + ], + [ + 947, + 948 + ], + [ + 950, + 951 + ], + [ + 955, + 956 + ], + [ + 964, + 966 + ], + [ + 978, + 979 + ], + [ + 987, + 988 + ], + [ + 991, + 994 + ], + [ + 995, + 996 + ], + [ + 1003, + 1004 + ], + [ + 1006, + 1007 + ], + [ + 1009, + 1010 + ], + [ + 1016, + 1018 + ], + [ + 1032, + 1033 + ], + [ + 1034, + 1035 + ], + [ + 1039, + 1041 + ], + [ + 1052, + 1054 + ], + [ + 1055, + 1060 + ], + [ + 1068, + 1069 + ], + [ + 1077, + 1078 + ], + [ + 1081, + 1082 + ], + [ + 1085, + 1087 + ], + [ + 1089, + 1090 + ], + [ + 1093, + 1094 + ], + [ + 1096, + 1099 + ], + [ + 1100, + 1102 + ], + [ + 1108, + 1109 + ], + [ + 1113, + 1115 + ], + [ + 1116, + 1117 + ], + [ + 1120, + 1125 + ], + [ + 1128, + 1129 + ], + [ + 1132, + 1133 + ], + [ + 1134, + 1135 + ], + [ + 1136, + 1137 + ], + [ + 1150, + 1152 + ], + [ + 1155, + 1158 + ], + [ + 1159, + 1160 + ], + [ + 1162, + 1163 + ], + [ + 1169, + 1171 + ], + [ + 1174, + 1177 + ], + [ + 1178, + 1179 + ], + [ + 1181, + 1182 + ], + [ + 1191, + 1193 + ], + [ + 1194, + 1196 + ], + [ + 1200, + 1205 + ], + [ + 1208, + 1209 + ], + [ + 1210, + 1212 + ], + [ + 1213, + 1215 + ], + [ + 1216, + 1218 + ], + [ + 1219, + 1221 + ], + [ + 1222, + 1224 + ], + [ + 1225, + 1227 + ], + [ + 1228, + 1230 + ], + [ + 1231, + 1233 + ], + [ + 1250, + 1269 + ], + [ + 1270, + 1271 + ], + [ + 1282, + 1306 + ], + [ + 1307, + 1308 + ], + [ + 1309, + 1326 + ], + [ + 1327, + 1328 + ], + [ + 1329, + 1346 + ], + [ + 1347, + 1348 + ], + [ + 1349, + 1362 + ], + [ + 1363, + 1410 + ], + [ + 1411, + 1412 + ], + [ + 1413, + 1418 + ], + [ + 1422, + 1424 + ], + [ + 1425, + 1429 + ], + [ + 1430, + 1433 + ], + [ + 1434, + 1437 + ], + [ + 1438, + 1441 + ], + [ + 1442, + 1445 + ], + [ + 1446, + 1449 + ], + [ + 1450, + 1452 + ], + [ + 1457, + 1492 + ], + [ + 1493, + 1494 + ], + [ + 1499, + 1501 + ], + [ + 1502, + 1503 + ], + [ + 1507, + 1512 + ], + [ + 1515, + 1540 + ], + [ + 1558, + 1559 + ], + [ + 1563, + 1565 + ], + [ + 1568, + 1570 + ], + [ + 1571, + 1575 + ], + [ + 1576, + 1578 + ], + [ + 1579, + 1580 + ], + [ + 1582, + 1583 + ], + [ + 1584, + 1585 + ], + [ + 1602, + 1603 + ], + [ + 1604, + 1606 + ], + [ + 1608, + 1609 + ], + [ + 1611, + 1612 + ], + [ + 1617, + 1621 + ], + [ + 1625, + 1631 + ], + [ + 1633, + 1634 + ], + [ + 1636, + 1637 + ], + [ + 1641, + 1643 + ], + [ + 1645, + 1647 + ], + [ + 1649, + 1650 + ], + [ + 1652, + 1653 + ], + [ + 1658, + 1660 + ], + [ + 1664, + 1665 + ], + [ + 1666, + 1668 + ], + [ + 1676, + 1685 + ], + [ + 1687, + 1690 + ], + [ + 1692, + 1693 + ], + [ + 1694, + 1696 + ], + [ + 1706, + 1708 + ], + [ + 1712, + 1716 + ], + [ + 1720, + 1721 + ], + [ + 1722, + 1723 + ], + [ + 1729, + 1731 + ], + [ + 1735, + 1739 + ], + [ + 1741, + 1743 + ], + [ + 1746, + 1747 + ], + [ + 1750, + 1752 + ], + [ + 1757, + 1759 + ], + [ + 1760, + 1761 + ], + [ + 1763, + 1764 + ], + [ + 1771, + 1772 + ], + [ + 1773, + 1775 + ], + [ + 1776, + 1777 + ], + [ + 1778, + 1780 + ], + [ + 1787, + 1789 + ], + [ + 1797, + 1799 + ], + [ + 1802, + 1803 + ], + [ + 1804, + 1808 + ], + [ + 1810, + 1812 + ], + [ + 1818, + 1819 + ], + [ + 1820, + 1822 + ], + [ + 1830, + 1834 + ], + [ + 1836, + 1837 + ], + [ + 1848, + 1852 + ], + [ + 1855, + 1858 + ], + [ + 1862, + 1863 + ], + [ + 1865, + 1866 + ], + [ + 1867, + 1869 + ], + [ + 1877, + 1880 + ], + [ + 1888, + 1892 + ], + [ + 1894, + 1897 + ], + [ + 1902, + 1906 + ], + [ + 1911, + 1913 + ], + [ + 1917, + 1918 + ], + [ + 1923, + 1924 + ], + [ + 1925, + 1928 + ], + [ + 1929, + 1930 + ], + [ + 1932, + 1933 + ], + [ + 1949, + 1951 + ], + [ + 1960, + 1962 + ], + [ + 1971, + 1975 + ], + [ + 1976, + 1980 + ], + [ + 1981, + 1982 + ], + [ + 1983, + 1985 + ], + [ + 1990, + 1991 + ], + [ + 1993, + 1994 + ], + [ + 2003, + 2004 + ], + [ + 2005, + 2007 + ], + [ + 2015, + 2016 + ], + [ + 2017, + 2019 + ], + [ + 2020, + 2021 + ], + [ + 2029, + 2030 + ], + [ + 2033, + 2035 + ], + [ + 2041, + 2042 + ], + [ + 2044, + 2045 + ], + [ + 2046, + 2048 + ], + [ + 2049, + 2050 + ], + [ + 2052, + 2053 + ], + [ + 2056, + 2057 + ], + [ + 2060, + 2061 + ], + [ + 2062, + 2067 + ], + [ + 2072, + 2073 + ], + [ + 2075, + 2083 + ], + [ + 2084, + 2085 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/reorder.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 56, + 63 + ], + [ + 66, + 76 + ], + [ + 78, + 147 + ], + [ + 150, + 224 + ], + [ + 228, + 286 + ], + [ + 289, + 314 + ], + [ + 320, + 348 + ], + [ + 352, + 359 + ], + [ + 360, + 387 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 59, + 60 + ], + [ + 69, + 70 + ], + [ + 72, + 73 + ], + [ + 81, + 82 + ], + [ + 85, + 86 + ], + [ + 89, + 100 + ], + [ + 102, + 109 + ], + [ + 114, + 115 + ], + [ + 120, + 125 + ], + [ + 128, + 129 + ], + [ + 130, + 132 + ], + [ + 135, + 136 + ], + [ + 139, + 144 + ], + [ + 153, + 155 + ], + [ + 156, + 157 + ], + [ + 160, + 161 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 172, + 173 + ], + [ + 178, + 180 + ], + [ + 185, + 187 + ], + [ + 188, + 189 + ], + [ + 191, + 194 + ], + [ + 196, + 198 + ], + [ + 201, + 202 + ], + [ + 207, + 208 + ], + [ + 210, + 216 + ], + [ + 217, + 219 + ], + [ + 220, + 221 + ], + [ + 231, + 233 + ], + [ + 237, + 238 + ], + [ + 239, + 244 + ], + [ + 249, + 251 + ], + [ + 254, + 255 + ], + [ + 259, + 261 + ], + [ + 263, + 264 + ], + [ + 269, + 270 + ], + [ + 275, + 276 + ], + [ + 280, + 281 + ], + [ + 282, + 283 + ], + [ + 292, + 297 + ], + [ + 300, + 301 + ], + [ + 307, + 308 + ], + [ + 310, + 311 + ], + [ + 323, + 324 + ], + [ + 330, + 331 + ], + [ + 332, + 333 + ], + [ + 336, + 338 + ], + [ + 339, + 342 + ], + [ + 344, + 345 + ], + [ + 355, + 356 + ], + [ + 363, + 364 + ], + [ + 365, + 366 + ], + [ + 369, + 370 + ], + [ + 374, + 375 + ], + [ + 376, + 378 + ], + [ + 381, + 382 + ], + [ + 383, + 386 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sbuf.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 33 + ], + [ + 59, + 66 + ], + [ + 67, + 100 + ], + [ + 104, + 131 + ], + [ + 135, + 147 + ], + [ + 148, + 207 + ], + [ + 211, + 226 + ], + [ + 229, + 236 + ], + [ + 243, + 285 + ], + [ + 286, + 307 + ], + [ + 310, + 317 + ], + [ + 324, + 331 + ], + [ + 334, + 360 + ], + [ + 362, + 401 + ], + [ + 406, + 417 + ], + [ + 418, + 454 + ], + [ + 455, + 505 + ], + [ + 512, + 538 + ] + ], + "lines_added": [ + [ + 8, + 24 + ], + [ + 29, + 30 + ], + [ + 62, + 63 + ], + [ + 70, + 71 + ], + [ + 73, + 74 + ], + [ + 76, + 77 + ], + [ + 78, + 80 + ], + [ + 85, + 93 + ], + [ + 96, + 97 + ], + [ + 107, + 108 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 122, + 125 + ], + [ + 127, + 128 + ], + [ + 138, + 139 + ], + [ + 142, + 144 + ], + [ + 151, + 152 + ], + [ + 155, + 156 + ], + [ + 159, + 160 + ], + [ + 161, + 165 + ], + [ + 168, + 170 + ], + [ + 174, + 175 + ], + [ + 181, + 182 + ], + [ + 188, + 189 + ], + [ + 190, + 193 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 203, + 204 + ], + [ + 214, + 215 + ], + [ + 220, + 221 + ], + [ + 222, + 223 + ], + [ + 232, + 233 + ], + [ + 246, + 247 + ], + [ + 248, + 253 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 265, + 267 + ], + [ + 268, + 270 + ], + [ + 273, + 282 + ], + [ + 289, + 290 + ], + [ + 292, + 293 + ], + [ + 297, + 298 + ], + [ + 303, + 304 + ], + [ + 313, + 314 + ], + [ + 327, + 328 + ], + [ + 337, + 338 + ], + [ + 343, + 344 + ], + [ + 349, + 350 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 365, + 368 + ], + [ + 369, + 371 + ], + [ + 372, + 373 + ], + [ + 375, + 378 + ], + [ + 381, + 385 + ], + [ + 388, + 389 + ], + [ + 390, + 391 + ], + [ + 397, + 398 + ], + [ + 409, + 410 + ], + [ + 413, + 414 + ], + [ + 421, + 423 + ], + [ + 425, + 426 + ], + [ + 430, + 434 + ], + [ + 439, + 440 + ], + [ + 441, + 443 + ], + [ + 444, + 445 + ], + [ + 446, + 447 + ], + [ + 448, + 449 + ], + [ + 450, + 451 + ], + [ + 458, + 459 + ], + [ + 461, + 462 + ], + [ + 467, + 468 + ], + [ + 469, + 470 + ], + [ + 475, + 476 + ], + [ + 480, + 484 + ], + [ + 490, + 493 + ], + [ + 498, + 500 + ], + [ + 501, + 502 + ], + [ + 515, + 517 + ], + [ + 521, + 522 + ], + [ + 525, + 527 + ], + [ + 528, + 531 + ], + [ + 532, + 533 + ], + [ + 534, + 535 + ], + [ + 536, + 537 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/semaphore.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 12, + 44 + ], + [ + 55, + 62 + ], + [ + 64, + 147 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 15, + 16 + ], + [ + 17, + 21 + ], + [ + 22, + 31 + ], + [ + 36, + 37 + ], + [ + 40, + 41 + ], + [ + 58, + 59 + ], + [ + 67, + 68 + ], + [ + 69, + 71 + ], + [ + 73, + 74 + ], + [ + 77, + 78 + ], + [ + 81, + 82 + ], + [ + 88, + 90 + ], + [ + 91, + 93 + ], + [ + 95, + 99 + ], + [ + 101, + 102 + ], + [ + 107, + 108 + ], + [ + 109, + 110 + ], + [ + 115, + 116 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 123, + 125 + ], + [ + 128, + 129 + ], + [ + 131, + 133 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 143, + 144 + ], + [ + 145, + 146 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sink.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 50, + 67 + ], + [ + 82, + 89 + ], + [ + 96, + 112 + ], + [ + 114, + 146 + ], + [ + 155, + 172 + ], + [ + 174, + 212 + ], + [ + 219, + 237 + ], + [ + 240, + 390 + ], + [ + 395, + 414 + ], + [ + 415, + 448 + ], + [ + 455, + 467 + ], + [ + 468, + 493 + ], + [ + 494, + 517 + ], + [ + 522, + 529 + ], + [ + 535, + 545 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 53, + 54 + ], + [ + 57, + 58 + ], + [ + 62, + 64 + ], + [ + 85, + 86 + ], + [ + 99, + 100 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 117, + 118 + ], + [ + 120, + 121 + ], + [ + 122, + 124 + ], + [ + 127, + 128 + ], + [ + 131, + 133 + ], + [ + 134, + 135 + ], + [ + 136, + 137 + ], + [ + 141, + 143 + ], + [ + 158, + 159 + ], + [ + 163, + 164 + ], + [ + 168, + 169 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 189, + 192 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 202, + 204 + ], + [ + 207, + 209 + ], + [ + 222, + 223 + ], + [ + 228, + 230 + ], + [ + 233, + 234 + ], + [ + 243, + 244 + ], + [ + 246, + 247 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 258, + 259 + ], + [ + 261, + 265 + ], + [ + 270, + 271 + ], + [ + 274, + 275 + ], + [ + 279, + 281 + ], + [ + 282, + 283 + ], + [ + 288, + 289 + ], + [ + 290, + 292 + ], + [ + 293, + 294 + ], + [ + 295, + 296 + ], + [ + 298, + 302 + ], + [ + 305, + 306 + ], + [ + 309, + 310 + ], + [ + 314, + 317 + ], + [ + 318, + 321 + ], + [ + 324, + 325 + ], + [ + 326, + 328 + ], + [ + 333, + 334 + ], + [ + 337, + 338 + ], + [ + 344, + 345 + ], + [ + 346, + 349 + ], + [ + 352, + 353 + ], + [ + 354, + 357 + ], + [ + 360, + 361 + ], + [ + 362, + 363 + ], + [ + 365, + 366 + ], + [ + 371, + 374 + ], + [ + 379, + 381 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 386, + 387 + ], + [ + 398, + 404 + ], + [ + 406, + 407 + ], + [ + 409, + 411 + ], + [ + 418, + 422 + ], + [ + 425, + 426 + ], + [ + 427, + 428 + ], + [ + 430, + 432 + ], + [ + 435, + 436 + ], + [ + 440, + 443 + ], + [ + 444, + 445 + ], + [ + 458, + 459 + ], + [ + 462, + 464 + ], + [ + 471, + 472 + ], + [ + 474, + 475 + ], + [ + 479, + 480 + ], + [ + 484, + 488 + ], + [ + 489, + 490 + ], + [ + 497, + 498 + ], + [ + 499, + 501 + ], + [ + 502, + 506 + ], + [ + 507, + 508 + ], + [ + 509, + 510 + ], + [ + 511, + 512 + ], + [ + 513, + 514 + ], + [ + 525, + 526 + ], + [ + 538, + 539 + ], + [ + 540, + 541 + ], + [ + 542, + 544 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sink.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 65, + 75 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 68, + 72 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sinkdisc.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 13, + 41 + ], + [ + 70, + 85 + ], + [ + 94, + 102 + ], + [ + 104, + 111 + ], + [ + 112, + 286 + ], + [ + 294, + 316 + ], + [ + 318, + 376 + ], + [ + 389, + 409 + ], + [ + 412, + 464 + ], + [ + 466, + 473 + ], + [ + 487, + 542 + ] + ], + "lines_added": [ + [ + 1, + 3 + ], + [ + 16, + 22 + ], + [ + 23, + 27 + ], + [ + 28, + 32 + ], + [ + 37, + 38 + ], + [ + 73, + 82 + ], + [ + 97, + 99 + ], + [ + 107, + 108 + ], + [ + 115, + 116 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 133, + 134 + ], + [ + 135, + 138 + ], + [ + 141, + 142 + ], + [ + 143, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 154, + 162 + ], + [ + 165, + 166 + ], + [ + 169, + 171 + ], + [ + 172, + 173 + ], + [ + 174, + 176 + ], + [ + 177, + 178 + ], + [ + 183, + 184 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 197, + 198 + ], + [ + 199, + 200 + ], + [ + 203, + 204 + ], + [ + 208, + 209 + ], + [ + 212, + 213 + ], + [ + 216, + 218 + ], + [ + 220, + 224 + ], + [ + 228, + 231 + ], + [ + 235, + 236 + ], + [ + 239, + 243 + ], + [ + 247, + 248 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 257, + 258 + ], + [ + 260, + 262 + ], + [ + 265, + 269 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 281, + 283 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 303, + 304 + ], + [ + 305, + 306 + ], + [ + 309, + 311 + ], + [ + 312, + 313 + ], + [ + 321, + 322 + ], + [ + 323, + 324 + ], + [ + 330, + 331 + ], + [ + 332, + 333 + ], + [ + 335, + 336 + ], + [ + 339, + 343 + ], + [ + 344, + 345 + ], + [ + 347, + 348 + ], + [ + 349, + 350 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 359, + 362 + ], + [ + 365, + 366 + ], + [ + 369, + 371 + ], + [ + 372, + 373 + ], + [ + 392, + 393 + ], + [ + 398, + 402 + ], + [ + 405, + 406 + ], + [ + 415, + 416 + ], + [ + 421, + 422 + ], + [ + 427, + 430 + ], + [ + 431, + 433 + ], + [ + 434, + 436 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 445, + 447 + ], + [ + 448, + 449 + ], + [ + 450, + 452 + ], + [ + 457, + 458 + ], + [ + 459, + 461 + ], + [ + 469, + 470 + ], + [ + 490, + 491 + ], + [ + 492, + 493 + ], + [ + 499, + 500 + ], + [ + 504, + 505 + ], + [ + 506, + 507 + ], + [ + 509, + 518 + ], + [ + 521, + 522 + ], + [ + 523, + 525 + ], + [ + 531, + 533 + ], + [ + 534, + 535 + ], + [ + 536, + 537 + ], + [ + 538, + 539 + ], + [ + 540, + 541 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sinkmemory.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 12, + 40 + ], + [ + 57, + 70 + ], + [ + 72, + 79 + ], + [ + 89, + 96 + ], + [ + 97, + 152 + ], + [ + 161, + 178 + ], + [ + 180, + 218 + ], + [ + 225, + 243 + ], + [ + 246, + 259 + ], + [ + 260, + 296 + ], + [ + 298, + 313 + ], + [ + 321, + 354 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 15, + 21 + ], + [ + 22, + 26 + ], + [ + 27, + 31 + ], + [ + 36, + 37 + ], + [ + 60, + 61 + ], + [ + 65, + 67 + ], + [ + 75, + 76 + ], + [ + 92, + 93 + ], + [ + 100, + 102 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 109, + 110 + ], + [ + 113, + 114 + ], + [ + 118, + 119 + ], + [ + 120, + 123 + ], + [ + 126, + 127 + ], + [ + 128, + 130 + ], + [ + 133, + 134 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 147, + 149 + ], + [ + 164, + 165 + ], + [ + 169, + 170 + ], + [ + 174, + 175 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 188, + 189 + ], + [ + 192, + 193 + ], + [ + 195, + 198 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 208, + 210 + ], + [ + 213, + 215 + ], + [ + 228, + 229 + ], + [ + 234, + 236 + ], + [ + 239, + 240 + ], + [ + 249, + 250 + ], + [ + 255, + 256 + ], + [ + 263, + 265 + ], + [ + 266, + 268 + ], + [ + 269, + 271 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 280, + 281 + ], + [ + 282, + 285 + ], + [ + 288, + 289 + ], + [ + 292, + 293 + ], + [ + 301, + 307 + ], + [ + 309, + 310 + ], + [ + 324, + 325 + ], + [ + 329, + 331 + ], + [ + 332, + 333 + ], + [ + 335, + 342 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 348, + 349 + ], + [ + 350, + 351 + ], + [ + 352, + 353 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sinkscreen.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 10 + ], + [ + 14, + 42 + ], + [ + 77, + 90 + ], + [ + 95, + 102 + ], + [ + 107, + 114 + ], + [ + 116, + 145 + ], + [ + 165, + 175 + ], + [ + 181, + 328 + ], + [ + 329, + 566 + ], + [ + 581, + 588 + ], + [ + 589, + 627 + ], + [ + 632, + 877 + ], + [ + 885, + 906 + ], + [ + 908, + 930 + ], + [ + 937, + 951 + ], + [ + 954, + 1070 + ], + [ + 1081, + 1109 + ], + [ + 1111, + 1150 + ], + [ + 1151, + 1197 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 80, + 81 + ], + [ + 86, + 87 + ], + [ + 98, + 99 + ], + [ + 110, + 111 + ], + [ + 119, + 123 + ], + [ + 124, + 127 + ], + [ + 129, + 130 + ], + [ + 131, + 132 + ], + [ + 135, + 138 + ], + [ + 141, + 142 + ], + [ + 168, + 169 + ], + [ + 171, + 172 + ], + [ + 184, + 185 + ], + [ + 191, + 192 + ], + [ + 193, + 194 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 206, + 207 + ], + [ + 208, + 211 + ], + [ + 214, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 220 + ], + [ + 221, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 228 + ], + [ + 229, + 231 + ], + [ + 232, + 233 + ], + [ + 235, + 238 + ], + [ + 239, + 241 + ], + [ + 244, + 245 + ], + [ + 246, + 248 + ], + [ + 249, + 250 + ], + [ + 251, + 253 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 265, + 266 + ], + [ + 271, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 279 + ], + [ + 280, + 281 + ], + [ + 283, + 284 + ], + [ + 287, + 288 + ], + [ + 291, + 294 + ], + [ + 295, + 297 + ], + [ + 299, + 300 + ], + [ + 302, + 304 + ], + [ + 305, + 306 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 319, + 321 + ], + [ + 324, + 325 + ], + [ + 332, + 333 + ], + [ + 336, + 337 + ], + [ + 339, + 342 + ], + [ + 344, + 347 + ], + [ + 349, + 350 + ], + [ + 355, + 356 + ], + [ + 359, + 362 + ], + [ + 366, + 367 + ], + [ + 372, + 373 + ], + [ + 376, + 378 + ], + [ + 379, + 381 + ], + [ + 383, + 384 + ], + [ + 386, + 388 + ], + [ + 393, + 394 + ], + [ + 395, + 398 + ], + [ + 401, + 402 + ], + [ + 404, + 405 + ], + [ + 406, + 407 + ], + [ + 409, + 411 + ], + [ + 416, + 417 + ], + [ + 418, + 420 + ], + [ + 421, + 427 + ], + [ + 430, + 433 + ], + [ + 434, + 435 + ], + [ + 437, + 438 + ], + [ + 442, + 443 + ], + [ + 446, + 448 + ], + [ + 449, + 450 + ], + [ + 456, + 457 + ], + [ + 458, + 459 + ], + [ + 460, + 461 + ], + [ + 463, + 464 + ], + [ + 465, + 467 + ], + [ + 470, + 472 + ], + [ + 473, + 474 + ], + [ + 479, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 489 + ], + [ + 493, + 494 + ], + [ + 497, + 498 + ], + [ + 501, + 502 + ], + [ + 508, + 509 + ], + [ + 512, + 513 + ], + [ + 517, + 519 + ], + [ + 522, + 523 + ], + [ + 524, + 525 + ], + [ + 526, + 528 + ], + [ + 533, + 534 + ], + [ + 535, + 536 + ], + [ + 538, + 539 + ], + [ + 543, + 546 + ], + [ + 547, + 548 + ], + [ + 554, + 556 + ], + [ + 559, + 560 + ], + [ + 561, + 563 + ], + [ + 584, + 585 + ], + [ + 592, + 594 + ], + [ + 595, + 599 + ], + [ + 601, + 602 + ], + [ + 607, + 608 + ], + [ + 613, + 614 + ], + [ + 617, + 618 + ], + [ + 622, + 624 + ], + [ + 635, + 638 + ], + [ + 640, + 641 + ], + [ + 643, + 644 + ], + [ + 649, + 650 + ], + [ + 651, + 652 + ], + [ + 657, + 658 + ], + [ + 661, + 662 + ], + [ + 666, + 667 + ], + [ + 669, + 672 + ], + [ + 673, + 674 + ], + [ + 679, + 680 + ], + [ + 683, + 684 + ], + [ + 685, + 688 + ], + [ + 689, + 691 + ], + [ + 697, + 698 + ], + [ + 703, + 704 + ], + [ + 706, + 707 + ], + [ + 709, + 710 + ], + [ + 713, + 715 + ], + [ + 717, + 718 + ], + [ + 719, + 721 + ], + [ + 724, + 726 + ], + [ + 728, + 730 + ], + [ + 732, + 735 + ], + [ + 740, + 741 + ], + [ + 742, + 745 + ], + [ + 746, + 747 + ], + [ + 752, + 754 + ], + [ + 755, + 757 + ], + [ + 763, + 764 + ], + [ + 768, + 770 + ], + [ + 771, + 775 + ], + [ + 777, + 778 + ], + [ + 784, + 785 + ], + [ + 788, + 790 + ], + [ + 791, + 792 + ], + [ + 795, + 797 + ], + [ + 798, + 799 + ], + [ + 800, + 803 + ], + [ + 805, + 807 + ], + [ + 808, + 809 + ], + [ + 810, + 811 + ], + [ + 813, + 815 + ], + [ + 816, + 821 + ], + [ + 823, + 824 + ], + [ + 825, + 826 + ], + [ + 828, + 829 + ], + [ + 834, + 835 + ], + [ + 840, + 842 + ], + [ + 844, + 845 + ], + [ + 846, + 848 + ], + [ + 851, + 854 + ], + [ + 855, + 859 + ], + [ + 860, + 861 + ], + [ + 864, + 867 + ], + [ + 873, + 874 + ], + [ + 888, + 891 + ], + [ + 892, + 893 + ], + [ + 894, + 895 + ], + [ + 896, + 897 + ], + [ + 901, + 903 + ], + [ + 911, + 914 + ], + [ + 915, + 916 + ], + [ + 918, + 919 + ], + [ + 920, + 921 + ], + [ + 926, + 927 + ], + [ + 940, + 943 + ], + [ + 944, + 945 + ], + [ + 946, + 948 + ], + [ + 957, + 958 + ], + [ + 959, + 963 + ], + [ + 966, + 967 + ], + [ + 969, + 970 + ], + [ + 971, + 972 + ], + [ + 974, + 975 + ], + [ + 977, + 978 + ], + [ + 983, + 984 + ], + [ + 985, + 986 + ], + [ + 987, + 988 + ], + [ + 990, + 991 + ], + [ + 996, + 997 + ], + [ + 998, + 999 + ], + [ + 1001, + 1002 + ], + [ + 1003, + 1004 + ], + [ + 1009, + 1010 + ], + [ + 1013, + 1016 + ], + [ + 1019, + 1028 + ], + [ + 1029, + 1031 + ], + [ + 1034, + 1035 + ], + [ + 1040, + 1041 + ], + [ + 1046, + 1047 + ], + [ + 1048, + 1049 + ], + [ + 1052, + 1053 + ], + [ + 1054, + 1056 + ], + [ + 1058, + 1059 + ], + [ + 1063, + 1065 + ], + [ + 1066, + 1067 + ], + [ + 1084, + 1085 + ], + [ + 1088, + 1089 + ], + [ + 1092, + 1093 + ], + [ + 1097, + 1098 + ], + [ + 1100, + 1101 + ], + [ + 1105, + 1106 + ], + [ + 1114, + 1115 + ], + [ + 1120, + 1123 + ], + [ + 1124, + 1125 + ], + [ + 1130, + 1131 + ], + [ + 1132, + 1136 + ], + [ + 1138, + 1142 + ], + [ + 1143, + 1147 + ], + [ + 1154, + 1157 + ], + [ + 1158, + 1159 + ], + [ + 1160, + 1167 + ], + [ + 1168, + 1169 + ], + [ + 1172, + 1173 + ], + [ + 1179, + 1181 + ], + [ + 1185, + 1187 + ], + [ + 1188, + 1191 + ], + [ + 1192, + 1193 + ], + [ + 1195, + 1196 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/source.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 18, + 46 + ], + [ + 79, + 86 + ], + [ + 98, + 222 + ], + [ + 224, + 388 + ], + [ + 392, + 428 + ], + [ + 436, + 490 + ], + [ + 495, + 532 + ], + [ + 533, + 566 + ], + [ + 571, + 594 + ], + [ + 602, + 639 + ], + [ + 640, + 695 + ], + [ + 698, + 743 + ], + [ + 747, + 754 + ], + [ + 755, + 807 + ], + [ + 810, + 861 + ], + [ + 865, + 892 + ], + [ + 893, + 960 + ], + [ + 969, + 1000 + ], + [ + 1006, + 1026 + ], + [ + 1035, + 1052 + ], + [ + 1056, + 1063 + ], + [ + 1064, + 1117 + ], + [ + 1123, + 1146 + ], + [ + 1154, + 1177 + ], + [ + 1184, + 1196 + ], + [ + 1202, + 1253 + ], + [ + 1254, + 1279 + ], + [ + 1280, + 1364 + ], + [ + 1367, + 1386 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 21, + 27 + ], + [ + 28, + 32 + ], + [ + 33, + 37 + ], + [ + 42, + 43 + ], + [ + 82, + 83 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 109, + 110 + ], + [ + 114, + 115 + ], + [ + 119, + 120 + ], + [ + 121, + 123 + ], + [ + 126, + 127 + ], + [ + 133, + 135 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 142, + 144 + ], + [ + 149, + 150 + ], + [ + 154, + 155 + ], + [ + 159, + 160 + ], + [ + 162, + 164 + ], + [ + 167, + 168 + ], + [ + 169, + 172 + ], + [ + 173, + 174 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 183, + 184 + ], + [ + 187, + 189 + ], + [ + 193, + 195 + ], + [ + 198, + 199 + ], + [ + 200, + 202 + ], + [ + 204, + 206 + ], + [ + 210, + 214 + ], + [ + 218, + 219 + ], + [ + 227, + 229 + ], + [ + 231, + 232 + ], + [ + 234, + 238 + ], + [ + 243, + 246 + ], + [ + 251, + 252 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 266, + 270 + ], + [ + 273, + 274 + ], + [ + 277, + 278 + ], + [ + 279, + 281 + ], + [ + 282, + 283 + ], + [ + 284, + 286 + ], + [ + 287, + 292 + ], + [ + 296, + 299 + ], + [ + 300, + 302 + ], + [ + 308, + 309 + ], + [ + 312, + 313 + ], + [ + 315, + 317 + ], + [ + 318, + 319 + ], + [ + 321, + 322 + ], + [ + 325, + 326 + ], + [ + 327, + 328 + ], + [ + 331, + 332 + ], + [ + 333, + 336 + ], + [ + 337, + 338 + ], + [ + 341, + 342 + ], + [ + 343, + 344 + ], + [ + 345, + 346 + ], + [ + 350, + 353 + ], + [ + 354, + 355 + ], + [ + 358, + 359 + ], + [ + 360, + 362 + ], + [ + 368, + 369 + ], + [ + 375, + 381 + ], + [ + 384, + 385 + ], + [ + 395, + 397 + ], + [ + 401, + 402 + ], + [ + 405, + 407 + ], + [ + 408, + 409 + ], + [ + 410, + 411 + ], + [ + 412, + 415 + ], + [ + 417, + 418 + ], + [ + 419, + 420 + ], + [ + 424, + 425 + ], + [ + 439, + 440 + ], + [ + 443, + 445 + ], + [ + 446, + 447 + ], + [ + 448, + 449 + ], + [ + 450, + 453 + ], + [ + 455, + 456 + ], + [ + 457, + 458 + ], + [ + 464, + 465 + ], + [ + 469, + 470 + ], + [ + 473, + 474 + ], + [ + 475, + 476 + ], + [ + 477, + 478 + ], + [ + 479, + 482 + ], + [ + 484, + 485 + ], + [ + 486, + 487 + ], + [ + 498, + 499 + ], + [ + 500, + 501 + ], + [ + 504, + 505 + ], + [ + 508, + 510 + ], + [ + 511, + 514 + ], + [ + 515, + 516 + ], + [ + 518, + 521 + ], + [ + 523, + 526 + ], + [ + 528, + 529 + ], + [ + 536, + 537 + ], + [ + 538, + 539 + ], + [ + 543, + 544 + ], + [ + 548, + 551 + ], + [ + 554, + 555 + ], + [ + 556, + 557 + ], + [ + 558, + 559 + ], + [ + 560, + 561 + ], + [ + 562, + 563 + ], + [ + 574, + 575 + ], + [ + 578, + 579 + ], + [ + 580, + 581 + ], + [ + 582, + 586 + ], + [ + 588, + 589 + ], + [ + 590, + 591 + ], + [ + 605, + 606 + ], + [ + 607, + 608 + ], + [ + 609, + 610 + ], + [ + 611, + 612 + ], + [ + 613, + 614 + ], + [ + 616, + 617 + ], + [ + 618, + 619 + ], + [ + 620, + 621 + ], + [ + 623, + 624 + ], + [ + 628, + 629 + ], + [ + 635, + 636 + ], + [ + 643, + 644 + ], + [ + 645, + 646 + ], + [ + 647, + 648 + ], + [ + 649, + 650 + ], + [ + 653, + 654 + ], + [ + 655, + 656 + ], + [ + 658, + 664 + ], + [ + 669, + 671 + ], + [ + 674, + 681 + ], + [ + 684, + 685 + ], + [ + 691, + 692 + ], + [ + 701, + 702 + ], + [ + 703, + 704 + ], + [ + 705, + 706 + ], + [ + 707, + 708 + ], + [ + 710, + 711 + ], + [ + 712, + 713 + ], + [ + 717, + 718 + ], + [ + 719, + 720 + ], + [ + 721, + 722 + ], + [ + 726, + 727 + ], + [ + 728, + 740 + ], + [ + 750, + 751 + ], + [ + 758, + 759 + ], + [ + 760, + 761 + ], + [ + 764, + 765 + ], + [ + 766, + 767 + ], + [ + 768, + 771 + ], + [ + 774, + 775 + ], + [ + 777, + 779 + ], + [ + 780, + 783 + ], + [ + 787, + 788 + ], + [ + 789, + 790 + ], + [ + 792, + 804 + ], + [ + 813, + 814 + ], + [ + 815, + 817 + ], + [ + 820, + 821 + ], + [ + 823, + 833 + ], + [ + 835, + 836 + ], + [ + 838, + 839 + ], + [ + 841, + 844 + ], + [ + 850, + 851 + ], + [ + 852, + 853 + ], + [ + 854, + 855 + ], + [ + 857, + 858 + ], + [ + 868, + 869 + ], + [ + 870, + 871 + ], + [ + 877, + 879 + ], + [ + 880, + 882 + ], + [ + 884, + 887 + ], + [ + 888, + 889 + ], + [ + 896, + 897 + ], + [ + 902, + 903 + ], + [ + 908, + 909 + ], + [ + 910, + 913 + ], + [ + 916, + 917 + ], + [ + 920, + 921 + ], + [ + 923, + 924 + ], + [ + 929, + 930 + ], + [ + 931, + 935 + ], + [ + 936, + 938 + ], + [ + 943, + 944 + ], + [ + 947, + 948 + ], + [ + 950, + 955 + ], + [ + 956, + 957 + ], + [ + 972, + 973 + ], + [ + 974, + 975 + ], + [ + 978, + 979 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 984, + 986 + ], + [ + 987, + 990 + ], + [ + 996, + 997 + ], + [ + 1009, + 1011 + ], + [ + 1012, + 1015 + ], + [ + 1019, + 1023 + ], + [ + 1038, + 1040 + ], + [ + 1041, + 1044 + ], + [ + 1047, + 1049 + ], + [ + 1059, + 1060 + ], + [ + 1067, + 1068 + ], + [ + 1069, + 1070 + ], + [ + 1071, + 1072 + ], + [ + 1073, + 1076 + ], + [ + 1080, + 1083 + ], + [ + 1087, + 1088 + ], + [ + 1089, + 1091 + ], + [ + 1094, + 1097 + ], + [ + 1098, + 1099 + ], + [ + 1101, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1107, + 1108 + ], + [ + 1109, + 1110 + ], + [ + 1111, + 1112 + ], + [ + 1113, + 1114 + ], + [ + 1126, + 1127 + ], + [ + 1132, + 1136 + ], + [ + 1139, + 1141 + ], + [ + 1142, + 1143 + ], + [ + 1157, + 1158 + ], + [ + 1159, + 1161 + ], + [ + 1164, + 1167 + ], + [ + 1168, + 1171 + ], + [ + 1172, + 1174 + ], + [ + 1187, + 1189 + ], + [ + 1191, + 1193 + ], + [ + 1205, + 1207 + ], + [ + 1212, + 1214 + ], + [ + 1217, + 1219 + ], + [ + 1224, + 1227 + ], + [ + 1230, + 1236 + ], + [ + 1240, + 1241 + ], + [ + 1242, + 1243 + ], + [ + 1249, + 1250 + ], + [ + 1257, + 1258 + ], + [ + 1259, + 1260 + ], + [ + 1261, + 1262 + ], + [ + 1263, + 1266 + ], + [ + 1270, + 1271 + ], + [ + 1273, + 1274 + ], + [ + 1275, + 1276 + ], + [ + 1283, + 1284 + ], + [ + 1289, + 1290 + ], + [ + 1294, + 1295 + ], + [ + 1296, + 1298 + ], + [ + 1299, + 1302 + ], + [ + 1303, + 1304 + ], + [ + 1307, + 1308 + ], + [ + 1312, + 1314 + ], + [ + 1320, + 1322 + ], + [ + 1326, + 1327 + ], + [ + 1328, + 1329 + ], + [ + 1330, + 1333 + ], + [ + 1334, + 1335 + ], + [ + 1336, + 1337 + ], + [ + 1338, + 1339 + ], + [ + 1341, + 1346 + ], + [ + 1352, + 1353 + ], + [ + 1356, + 1357 + ], + [ + 1360, + 1361 + ], + [ + 1370, + 1371 + ], + [ + 1375, + 1377 + ], + [ + 1378, + 1383 + ], + [ + 1384, + 1385 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sourcecustom.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 57, + 165 + ], + [ + 176, + 190 + ], + [ + 198, + 216 + ], + [ + 221, + 240 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 65, + 67 + ], + [ + 73, + 75 + ], + [ + 78, + 79 + ], + [ + 84, + 86 + ], + [ + 87, + 89 + ], + [ + 90, + 91 + ], + [ + 94, + 96 + ], + [ + 101, + 102 + ], + [ + 105, + 111 + ], + [ + 114, + 116 + ], + [ + 117, + 118 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 125, + 129 + ], + [ + 130, + 132 + ], + [ + 133, + 134 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 148 + ], + [ + 149, + 150 + ], + [ + 151, + 152 + ], + [ + 155, + 156 + ], + [ + 157, + 159 + ], + [ + 161, + 162 + ], + [ + 179, + 181 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 208, + 209 + ], + [ + 212, + 213 + ], + [ + 224, + 225 + ], + [ + 228, + 229 + ], + [ + 231, + 232 + ], + [ + 233, + 236 + ], + [ + 238, + 239 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/sourceginput.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 54, + 69 + ], + [ + 71, + 239 + ], + [ + 245, + 266 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 57, + 59 + ], + [ + 65, + 66 + ], + [ + 74, + 75 + ], + [ + 76, + 79 + ], + [ + 81, + 82 + ], + [ + 83, + 85 + ], + [ + 86, + 87 + ], + [ + 91, + 97 + ], + [ + 100, + 120 + ], + [ + 123, + 125 + ], + [ + 126, + 128 + ], + [ + 129, + 132 + ], + [ + 133, + 134 + ], + [ + 137, + 139 + ], + [ + 140, + 142 + ], + [ + 146, + 148 + ], + [ + 151, + 156 + ], + [ + 158, + 159 + ], + [ + 160, + 161 + ], + [ + 164, + 165 + ], + [ + 166, + 167 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 173, + 174 + ], + [ + 178, + 179 + ], + [ + 180, + 183 + ], + [ + 187, + 190 + ], + [ + 191, + 196 + ], + [ + 198, + 199 + ], + [ + 203, + 204 + ], + [ + 205, + 206 + ], + [ + 209, + 210 + ], + [ + 211, + 214 + ], + [ + 219, + 220 + ], + [ + 226, + 232 + ], + [ + 235, + 236 + ], + [ + 248, + 249 + ], + [ + 252, + 253 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 259, + 262 + ], + [ + 264, + 265 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/system.c", + "line_filter": { + "diff_chunks": [ + [ + 26, + 54 + ], + [ + 97, + 129 + ], + [ + 135, + 322 + ], + [ + 332, + 364 + ], + [ + 368, + 394 + ] + ], + "lines_added": [ + [ + 29, + 45 + ], + [ + 50, + 51 + ], + [ + 100, + 101 + ], + [ + 103, + 104 + ], + [ + 107, + 108 + ], + [ + 110, + 113 + ], + [ + 116, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 126 + ], + [ + 138, + 140 + ], + [ + 142, + 143 + ], + [ + 145, + 147 + ], + [ + 148, + 160 + ], + [ + 165, + 166 + ], + [ + 169, + 175 + ], + [ + 177, + 186 + ], + [ + 187, + 192 + ], + [ + 198, + 209 + ], + [ + 210, + 216 + ], + [ + 217, + 223 + ], + [ + 224, + 226 + ], + [ + 227, + 228 + ], + [ + 230, + 234 + ], + [ + 235, + 238 + ], + [ + 240, + 242 + ], + [ + 243, + 245 + ], + [ + 246, + 251 + ], + [ + 253, + 254 + ], + [ + 257, + 258 + ], + [ + 259, + 262 + ], + [ + 268, + 269 + ], + [ + 271, + 272 + ], + [ + 275, + 278 + ], + [ + 279, + 291 + ], + [ + 292, + 294 + ], + [ + 295, + 298 + ], + [ + 299, + 301 + ], + [ + 302, + 305 + ], + [ + 306, + 308 + ], + [ + 309, + 312 + ], + [ + 313, + 315 + ], + [ + 318, + 319 + ], + [ + 335, + 337 + ], + [ + 339, + 340 + ], + [ + 342, + 343 + ], + [ + 345, + 346 + ], + [ + 347, + 351 + ], + [ + 353, + 354 + ], + [ + 357, + 358 + ], + [ + 360, + 361 + ], + [ + 371, + 375 + ], + [ + 380, + 381 + ], + [ + 383, + 384 + ], + [ + 388, + 391 + ], + [ + 392, + 393 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/target.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 10, + 38 + ], + [ + 67, + 194 + ], + [ + 201, + 281 + ], + [ + 284, + 312 + ], + [ + 321, + 372 + ], + [ + 379, + 401 + ], + [ + 409, + 497 + ], + [ + 499, + 531 + ], + [ + 534, + 541 + ], + [ + 545, + 561 + ], + [ + 565, + 595 + ], + [ + 598, + 643 + ], + [ + 648, + 661 + ], + [ + 663, + 707 + ], + [ + 708, + 719 + ], + [ + 726, + 743 + ], + [ + 745, + 759 + ], + [ + 761, + 791 + ], + [ + 793, + 843 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 13, + 19 + ], + [ + 20, + 24 + ], + [ + 25, + 29 + ], + [ + 34, + 35 + ], + [ + 70, + 71 + ], + [ + 72, + 73 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 83 + ], + [ + 86, + 88 + ], + [ + 91, + 94 + ], + [ + 95, + 96 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 103, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 111, + 116 + ], + [ + 118, + 119 + ], + [ + 125, + 131 + ], + [ + 136, + 138 + ], + [ + 144, + 145 + ], + [ + 147, + 150 + ], + [ + 151, + 152 + ], + [ + 154, + 156 + ], + [ + 157, + 158 + ], + [ + 161, + 162 + ], + [ + 163, + 166 + ], + [ + 167, + 169 + ], + [ + 173, + 174 + ], + [ + 175, + 176 + ], + [ + 178, + 180 + ], + [ + 181, + 183 + ], + [ + 186, + 188 + ], + [ + 189, + 191 + ], + [ + 204, + 206 + ], + [ + 208, + 211 + ], + [ + 215, + 216 + ], + [ + 217, + 218 + ], + [ + 220, + 222 + ], + [ + 225, + 226 + ], + [ + 227, + 230 + ], + [ + 231, + 236 + ], + [ + 239, + 240 + ], + [ + 242, + 245 + ], + [ + 247, + 248 + ], + [ + 249, + 250 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 268 + ], + [ + 269, + 271 + ], + [ + 277, + 278 + ], + [ + 287, + 290 + ], + [ + 291, + 293 + ], + [ + 297, + 303 + ], + [ + 306, + 307 + ], + [ + 308, + 309 + ], + [ + 324, + 325 + ], + [ + 328, + 330 + ], + [ + 331, + 332 + ], + [ + 333, + 334 + ], + [ + 335, + 338 + ], + [ + 340, + 341 + ], + [ + 345, + 346 + ], + [ + 352, + 353 + ], + [ + 356, + 358 + ], + [ + 359, + 360 + ], + [ + 361, + 362 + ], + [ + 363, + 366 + ], + [ + 368, + 369 + ], + [ + 382, + 383 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 390, + 391 + ], + [ + 392, + 395 + ], + [ + 397, + 398 + ], + [ + 412, + 413 + ], + [ + 416, + 417 + ], + [ + 418, + 419 + ], + [ + 422, + 428 + ], + [ + 429, + 433 + ], + [ + 434, + 435 + ], + [ + 441, + 442 + ], + [ + 445, + 447 + ], + [ + 448, + 449 + ], + [ + 450, + 451 + ], + [ + 452, + 454 + ], + [ + 455, + 456 + ], + [ + 458, + 459 + ], + [ + 460, + 461 + ], + [ + 463, + 469 + ], + [ + 475, + 476 + ], + [ + 479, + 480 + ], + [ + 481, + 483 + ], + [ + 484, + 485 + ], + [ + 486, + 490 + ], + [ + 493, + 494 + ], + [ + 502, + 503 + ], + [ + 507, + 508 + ], + [ + 509, + 510 + ], + [ + 511, + 514 + ], + [ + 515, + 516 + ], + [ + 518, + 520 + ], + [ + 522, + 524 + ], + [ + 527, + 528 + ], + [ + 537, + 538 + ], + [ + 548, + 549 + ], + [ + 550, + 551 + ], + [ + 552, + 553 + ], + [ + 554, + 556 + ], + [ + 557, + 558 + ], + [ + 568, + 569 + ], + [ + 574, + 575 + ], + [ + 576, + 577 + ], + [ + 580, + 582 + ], + [ + 583, + 585 + ], + [ + 586, + 587 + ], + [ + 588, + 590 + ], + [ + 591, + 592 + ], + [ + 601, + 602 + ], + [ + 608, + 609 + ], + [ + 610, + 611 + ], + [ + 612, + 613 + ], + [ + 614, + 616 + ], + [ + 617, + 619 + ], + [ + 622, + 623 + ], + [ + 627, + 628 + ], + [ + 629, + 631 + ], + [ + 633, + 635 + ], + [ + 639, + 640 + ], + [ + 651, + 652 + ], + [ + 653, + 654 + ], + [ + 657, + 658 + ], + [ + 666, + 667 + ], + [ + 669, + 670 + ], + [ + 673, + 674 + ], + [ + 677, + 678 + ], + [ + 679, + 682 + ], + [ + 684, + 685 + ], + [ + 687, + 688 + ], + [ + 689, + 690 + ], + [ + 694, + 695 + ], + [ + 696, + 698 + ], + [ + 699, + 700 + ], + [ + 703, + 704 + ], + [ + 711, + 712 + ], + [ + 713, + 714 + ], + [ + 715, + 716 + ], + [ + 729, + 730 + ], + [ + 731, + 732 + ], + [ + 733, + 736 + ], + [ + 739, + 740 + ], + [ + 748, + 749 + ], + [ + 752, + 753 + ], + [ + 754, + 756 + ], + [ + 764, + 766 + ], + [ + 769, + 770 + ], + [ + 775, + 778 + ], + [ + 779, + 780 + ], + [ + 781, + 782 + ], + [ + 783, + 784 + ], + [ + 787, + 788 + ], + [ + 796, + 797 + ], + [ + 798, + 799 + ], + [ + 803, + 804 + ], + [ + 807, + 809 + ], + [ + 811, + 812 + ], + [ + 814, + 815 + ], + [ + 816, + 817 + ], + [ + 820, + 823 + ], + [ + 824, + 827 + ], + [ + 828, + 831 + ], + [ + 832, + 835 + ], + [ + 836, + 839 + ], + [ + 841, + 842 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/targetcustom.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 57, + 234 + ], + [ + 247, + 265 + ], + [ + 272, + 286 + ], + [ + 294, + 308 + ], + [ + 312, + 325 + ], + [ + 326, + 343 + ], + [ + 348, + 367 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 65, + 70 + ], + [ + 76, + 78 + ], + [ + 81, + 82 + ], + [ + 87, + 89 + ], + [ + 90, + 91 + ], + [ + 92, + 93 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 106, + 108 + ], + [ + 109, + 111 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 122, + 123 + ], + [ + 126, + 132 + ], + [ + 135, + 137 + ], + [ + 138, + 139 + ], + [ + 141, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 150 + ], + [ + 151, + 153 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 162, + 163 + ], + [ + 168, + 170 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 183, + 185 + ], + [ + 186, + 187 + ], + [ + 188, + 189 + ], + [ + 192, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 201, + 203 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 210, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 215 + ], + [ + 218, + 219 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 226, + 228 + ], + [ + 230, + 231 + ], + [ + 250, + 251 + ], + [ + 254, + 256 + ], + [ + 257, + 258 + ], + [ + 261, + 262 + ], + [ + 275, + 277 + ], + [ + 278, + 279 + ], + [ + 282, + 283 + ], + [ + 297, + 299 + ], + [ + 300, + 301 + ], + [ + 304, + 305 + ], + [ + 315, + 317 + ], + [ + 318, + 319 + ], + [ + 321, + 322 + ], + [ + 329, + 331 + ], + [ + 332, + 333 + ], + [ + 335, + 336 + ], + [ + 339, + 340 + ], + [ + 351, + 352 + ], + [ + 355, + 356 + ], + [ + 357, + 359 + ], + [ + 360, + 363 + ], + [ + 365, + 366 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/thread.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 82, + 210 + ], + [ + 212, + 238 + ], + [ + 242, + 277 + ], + [ + 278, + 285 + ], + [ + 286, + 312 + ], + [ + 313, + 338 + ], + [ + 341, + 348 + ], + [ + 353, + 360 + ], + [ + 362, + 391 + ], + [ + 396, + 403 + ], + [ + 413, + 420 + ], + [ + 430, + 460 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 85, + 86 + ], + [ + 87, + 88 + ], + [ + 94, + 95 + ], + [ + 98, + 100 + ], + [ + 101, + 102 + ], + [ + 105, + 106 + ], + [ + 107, + 109 + ], + [ + 112, + 113 + ], + [ + 116, + 118 + ], + [ + 119, + 120 + ], + [ + 123, + 124 + ], + [ + 125, + 127 + ], + [ + 130, + 132 + ], + [ + 133, + 134 + ], + [ + 136, + 137 + ], + [ + 142, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 154, + 155 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 164, + 165 + ], + [ + 169, + 170 + ], + [ + 171, + 173 + ], + [ + 174, + 177 + ], + [ + 178, + 180 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 190, + 191 + ], + [ + 192, + 194 + ], + [ + 195, + 196 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 206, + 207 + ], + [ + 215, + 219 + ], + [ + 220, + 224 + ], + [ + 225, + 230 + ], + [ + 231, + 235 + ], + [ + 245, + 251 + ], + [ + 252, + 253 + ], + [ + 254, + 270 + ], + [ + 273, + 274 + ], + [ + 281, + 282 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 295, + 297 + ], + [ + 298, + 299 + ], + [ + 301, + 304 + ], + [ + 305, + 306 + ], + [ + 308, + 309 + ], + [ + 316, + 317 + ], + [ + 318, + 320 + ], + [ + 325, + 326 + ], + [ + 329, + 330 + ], + [ + 331, + 332 + ], + [ + 334, + 335 + ], + [ + 344, + 345 + ], + [ + 356, + 357 + ], + [ + 365, + 366 + ], + [ + 367, + 368 + ], + [ + 373, + 375 + ], + [ + 378, + 379 + ], + [ + 383, + 384 + ], + [ + 386, + 388 + ], + [ + 399, + 400 + ], + [ + 416, + 417 + ], + [ + 433, + 436 + ], + [ + 437, + 440 + ], + [ + 443, + 444 + ], + [ + 445, + 448 + ], + [ + 451, + 452 + ], + [ + 453, + 454 + ], + [ + 457, + 458 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/threadpool.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 22, + 59 + ], + [ + 80, + 87 + ], + [ + 112, + 143 + ], + [ + 151, + 206 + ], + [ + 207, + 233 + ], + [ + 245, + 264 + ], + [ + 275, + 282 + ], + [ + 288, + 308 + ], + [ + 311, + 384 + ], + [ + 386, + 495 + ], + [ + 498, + 538 + ], + [ + 562, + 571 + ], + [ + 586, + 593 + ], + [ + 625, + 636 + ], + [ + 637, + 657 + ], + [ + 660, + 708 + ], + [ + 717, + 726 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 25, + 26 + ], + [ + 30, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 46 + ], + [ + 51, + 52 + ], + [ + 55, + 56 + ], + [ + 83, + 84 + ], + [ + 115, + 116 + ], + [ + 117, + 118 + ], + [ + 121, + 123 + ], + [ + 126, + 127 + ], + [ + 133, + 134 + ], + [ + 137, + 138 + ], + [ + 139, + 140 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 159, + 160 + ], + [ + 162, + 163 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 170, + 171 + ], + [ + 174, + 175 + ], + [ + 178, + 180 + ], + [ + 181, + 184 + ], + [ + 187, + 188 + ], + [ + 189, + 191 + ], + [ + 196, + 197 + ], + [ + 200, + 201 + ], + [ + 202, + 203 + ], + [ + 210, + 211 + ], + [ + 215, + 216 + ], + [ + 220, + 221 + ], + [ + 224, + 225 + ], + [ + 226, + 227 + ], + [ + 228, + 230 + ], + [ + 248, + 249 + ], + [ + 250, + 252 + ], + [ + 254, + 255 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 278, + 279 + ], + [ + 291, + 292 + ], + [ + 295, + 296 + ], + [ + 297, + 300 + ], + [ + 301, + 303 + ], + [ + 304, + 305 + ], + [ + 314, + 315 + ], + [ + 318, + 319 + ], + [ + 320, + 321 + ], + [ + 322, + 323 + ], + [ + 326, + 327 + ], + [ + 328, + 329 + ], + [ + 334, + 335 + ], + [ + 339, + 340 + ], + [ + 343, + 344 + ], + [ + 346, + 347 + ], + [ + 349, + 350 + ], + [ + 352, + 353 + ], + [ + 358, + 359 + ], + [ + 360, + 361 + ], + [ + 364, + 365 + ], + [ + 366, + 368 + ], + [ + 369, + 370 + ], + [ + 371, + 372 + ], + [ + 373, + 376 + ], + [ + 380, + 381 + ], + [ + 389, + 390 + ], + [ + 394, + 395 + ], + [ + 396, + 397 + ], + [ + 398, + 399 + ], + [ + 401, + 402 + ], + [ + 403, + 411 + ], + [ + 412, + 413 + ], + [ + 417, + 418 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 423, + 425 + ], + [ + 428, + 429 + ], + [ + 434, + 435 + ], + [ + 438, + 440 + ], + [ + 444, + 445 + ], + [ + 448, + 452 + ], + [ + 456, + 457 + ], + [ + 458, + 459 + ], + [ + 462, + 463 + ], + [ + 464, + 465 + ], + [ + 466, + 471 + ], + [ + 474, + 475 + ], + [ + 476, + 478 + ], + [ + 482, + 483 + ], + [ + 484, + 488 + ], + [ + 491, + 492 + ], + [ + 501, + 503 + ], + [ + 508, + 510 + ], + [ + 514, + 515 + ], + [ + 519, + 521 + ], + [ + 522, + 524 + ], + [ + 525, + 526 + ], + [ + 528, + 529 + ], + [ + 530, + 533 + ], + [ + 534, + 535 + ], + [ + 565, + 566 + ], + [ + 567, + 568 + ], + [ + 589, + 590 + ], + [ + 628, + 629 + ], + [ + 630, + 633 + ], + [ + 640, + 643 + ], + [ + 644, + 646 + ], + [ + 647, + 648 + ], + [ + 652, + 654 + ], + [ + 663, + 667 + ], + [ + 669, + 670 + ], + [ + 672, + 673 + ], + [ + 674, + 675 + ], + [ + 676, + 678 + ], + [ + 680, + 682 + ], + [ + 684, + 686 + ], + [ + 688, + 692 + ], + [ + 693, + 697 + ], + [ + 699, + 705 + ], + [ + 720, + 721 + ], + [ + 722, + 723 + ], + [ + 724, + 725 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/threadset.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 6, + 34 + ], + [ + 60, + 67 + ], + [ + 84, + 91 + ], + [ + 95, + 122 + ], + [ + 129, + 190 + ], + [ + 195, + 226 + ], + [ + 233, + 241 + ], + [ + 242, + 264 + ], + [ + 265, + 298 + ], + [ + 299, + 332 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 63, + 64 + ], + [ + 87, + 88 + ], + [ + 98, + 99 + ], + [ + 103, + 104 + ], + [ + 106, + 109 + ], + [ + 113, + 115 + ], + [ + 118, + 119 + ], + [ + 132, + 135 + ], + [ + 137, + 138 + ], + [ + 141, + 142 + ], + [ + 147, + 148 + ], + [ + 151, + 156 + ], + [ + 158, + 159 + ], + [ + 161, + 162 + ], + [ + 163, + 167 + ], + [ + 168, + 169 + ], + [ + 171, + 173 + ], + [ + 174, + 178 + ], + [ + 179, + 180 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 198, + 199 + ], + [ + 202, + 203 + ], + [ + 206, + 208 + ], + [ + 210, + 213 + ], + [ + 215, + 216 + ], + [ + 218, + 219 + ], + [ + 222, + 223 + ], + [ + 236, + 238 + ], + [ + 245, + 247 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 254, + 256 + ], + [ + 259, + 261 + ], + [ + 268, + 269 + ], + [ + 270, + 271 + ], + [ + 276, + 277 + ], + [ + 281, + 283 + ], + [ + 284, + 285 + ], + [ + 286, + 288 + ], + [ + 289, + 290 + ], + [ + 291, + 292 + ], + [ + 294, + 295 + ], + [ + 302, + 303 + ], + [ + 304, + 305 + ], + [ + 308, + 309 + ], + [ + 312, + 314 + ], + [ + 315, + 316 + ], + [ + 317, + 318 + ], + [ + 319, + 320 + ], + [ + 322, + 323 + ], + [ + 325, + 328 + ], + [ + 329, + 331 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/type.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 13, + 41 + ], + [ + 63, + 70 + ], + [ + 73, + 80 + ], + [ + 96, + 191 + ], + [ + 192, + 240 + ], + [ + 246, + 253 + ], + [ + 255, + 266 + ], + [ + 268, + 314 + ], + [ + 324, + 357 + ], + [ + 361, + 388 + ], + [ + 392, + 507 + ], + [ + 508, + 565 + ], + [ + 567, + 587 + ], + [ + 589, + 633 + ], + [ + 637, + 702 + ], + [ + 713, + 807 + ], + [ + 816, + 832 + ], + [ + 841, + 863 + ], + [ + 864, + 927 + ], + [ + 928, + 1050 + ], + [ + 1059, + 1075 + ], + [ + 1084, + 1106 + ], + [ + 1107, + 1155 + ], + [ + 1156, + 1267 + ], + [ + 1269, + 1305 + ], + [ + 1307, + 1350 + ], + [ + 1355, + 1398 + ], + [ + 1400, + 1409 + ], + [ + 1410, + 1417 + ], + [ + 1420, + 1429 + ], + [ + 1430, + 1449 + ], + [ + 1450, + 1512 + ], + [ + 1517, + 1531 + ], + [ + 1534, + 1567 + ], + [ + 1570, + 1587 + ], + [ + 1589, + 1630 + ], + [ + 1632, + 1650 + ], + [ + 1662, + 1708 + ], + [ + 1718, + 1752 + ], + [ + 1761, + 1769 + ], + [ + 1770, + 1789 + ], + [ + 1795, + 1830 + ], + [ + 1836, + 1871 + ], + [ + 1877, + 1909 + ], + [ + 1915, + 1949 + ], + [ + 1953, + 1973 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 16, + 17 + ], + [ + 18, + 22 + ], + [ + 23, + 32 + ], + [ + 37, + 38 + ], + [ + 66, + 67 + ], + [ + 76, + 77 + ], + [ + 99, + 100 + ], + [ + 103, + 104 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 116, + 117 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 132, + 134 + ], + [ + 135, + 136 + ], + [ + 141, + 142 + ], + [ + 145, + 149 + ], + [ + 151, + 152 + ], + [ + 157, + 158 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 166, + 167 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 175, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 183, + 184 + ], + [ + 185, + 188 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 199, + 200 + ], + [ + 204, + 205 + ], + [ + 207, + 211 + ], + [ + 213, + 215 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 220, + 221 + ], + [ + 222, + 226 + ], + [ + 229, + 233 + ], + [ + 236, + 237 + ], + [ + 249, + 250 + ], + [ + 258, + 259 + ], + [ + 262, + 263 + ], + [ + 271, + 275 + ], + [ + 278, + 283 + ], + [ + 285, + 286 + ], + [ + 289, + 290 + ], + [ + 295, + 297 + ], + [ + 298, + 302 + ], + [ + 303, + 305 + ], + [ + 310, + 311 + ], + [ + 327, + 328 + ], + [ + 332, + 334 + ], + [ + 339, + 340 + ], + [ + 343, + 344 + ], + [ + 347, + 350 + ], + [ + 353, + 354 + ], + [ + 364, + 365 + ], + [ + 371, + 372 + ], + [ + 376, + 379 + ], + [ + 380, + 381 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 395, + 396 + ], + [ + 402, + 404 + ], + [ + 405, + 407 + ], + [ + 408, + 409 + ], + [ + 410, + 411 + ], + [ + 412, + 413 + ], + [ + 414, + 415 + ], + [ + 417, + 418 + ], + [ + 423, + 424 + ], + [ + 428, + 432 + ], + [ + 435, + 436 + ], + [ + 439, + 445 + ], + [ + 447, + 448 + ], + [ + 453, + 454 + ], + [ + 455, + 457 + ], + [ + 460, + 461 + ], + [ + 462, + 464 + ], + [ + 467, + 468 + ], + [ + 473, + 476 + ], + [ + 479, + 480 + ], + [ + 481, + 484 + ], + [ + 487, + 488 + ], + [ + 493, + 496 + ], + [ + 499, + 500 + ], + [ + 501, + 504 + ], + [ + 511, + 512 + ], + [ + 515, + 519 + ], + [ + 521, + 522 + ], + [ + 527, + 528 + ], + [ + 529, + 531 + ], + [ + 534, + 535 + ], + [ + 536, + 538 + ], + [ + 543, + 544 + ], + [ + 545, + 547 + ], + [ + 550, + 551 + ], + [ + 552, + 554 + ], + [ + 557, + 558 + ], + [ + 561, + 562 + ], + [ + 570, + 571 + ], + [ + 574, + 575 + ], + [ + 577, + 578 + ], + [ + 581, + 582 + ], + [ + 583, + 584 + ], + [ + 592, + 593 + ], + [ + 596, + 597 + ], + [ + 599, + 600 + ], + [ + 601, + 602 + ], + [ + 603, + 604 + ], + [ + 607, + 608 + ], + [ + 611, + 623 + ], + [ + 625, + 626 + ], + [ + 629, + 630 + ], + [ + 640, + 641 + ], + [ + 646, + 647 + ], + [ + 650, + 651 + ], + [ + 653, + 654 + ], + [ + 657, + 658 + ], + [ + 662, + 663 + ], + [ + 669, + 670 + ], + [ + 671, + 672 + ], + [ + 674, + 677 + ], + [ + 679, + 680 + ], + [ + 683, + 684 + ], + [ + 687, + 689 + ], + [ + 691, + 692 + ], + [ + 695, + 696 + ], + [ + 697, + 699 + ], + [ + 716, + 718 + ], + [ + 719, + 720 + ], + [ + 721, + 722 + ], + [ + 723, + 724 + ], + [ + 729, + 730 + ], + [ + 735, + 736 + ], + [ + 741, + 746 + ], + [ + 750, + 751 + ], + [ + 756, + 760 + ], + [ + 765, + 766 + ], + [ + 769, + 770 + ], + [ + 775, + 779 + ], + [ + 783, + 784 + ], + [ + 787, + 788 + ], + [ + 791, + 801 + ], + [ + 803, + 804 + ], + [ + 819, + 820 + ], + [ + 824, + 827 + ], + [ + 828, + 829 + ], + [ + 844, + 845 + ], + [ + 851, + 853 + ], + [ + 854, + 858 + ], + [ + 859, + 860 + ], + [ + 867, + 868 + ], + [ + 872, + 873 + ], + [ + 874, + 875 + ], + [ + 876, + 877 + ], + [ + 878, + 879 + ], + [ + 881, + 882 + ], + [ + 885, + 886 + ], + [ + 891, + 892 + ], + [ + 894, + 897 + ], + [ + 899, + 900 + ], + [ + 901, + 902 + ], + [ + 905, + 906 + ], + [ + 909, + 910 + ], + [ + 911, + 912 + ], + [ + 913, + 915 + ], + [ + 916, + 917 + ], + [ + 923, + 924 + ], + [ + 931, + 932 + ], + [ + 938, + 939 + ], + [ + 941, + 942 + ], + [ + 944, + 945 + ], + [ + 946, + 948 + ], + [ + 949, + 950 + ], + [ + 952, + 954 + ], + [ + 956, + 961 + ], + [ + 967, + 968 + ], + [ + 971, + 972 + ], + [ + 975, + 976 + ], + [ + 977, + 979 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 988, + 989 + ], + [ + 992, + 995 + ], + [ + 998, + 999 + ], + [ + 1002, + 1005 + ], + [ + 1008, + 1009 + ], + [ + 1011, + 1012 + ], + [ + 1015, + 1018 + ], + [ + 1022, + 1023 + ], + [ + 1026, + 1044 + ], + [ + 1046, + 1047 + ], + [ + 1062, + 1063 + ], + [ + 1067, + 1070 + ], + [ + 1071, + 1072 + ], + [ + 1087, + 1088 + ], + [ + 1094, + 1096 + ], + [ + 1097, + 1101 + ], + [ + 1102, + 1103 + ], + [ + 1110, + 1111 + ], + [ + 1115, + 1116 + ], + [ + 1117, + 1118 + ], + [ + 1119, + 1120 + ], + [ + 1121, + 1122 + ], + [ + 1124, + 1125 + ], + [ + 1128, + 1129 + ], + [ + 1134, + 1135 + ], + [ + 1137, + 1140 + ], + [ + 1142, + 1143 + ], + [ + 1144, + 1145 + ], + [ + 1151, + 1152 + ], + [ + 1159, + 1160 + ], + [ + 1165, + 1166 + ], + [ + 1168, + 1169 + ], + [ + 1171, + 1172 + ], + [ + 1173, + 1175 + ], + [ + 1176, + 1177 + ], + [ + 1179, + 1181 + ], + [ + 1183, + 1187 + ], + [ + 1193, + 1194 + ], + [ + 1199, + 1200 + ], + [ + 1203, + 1206 + ], + [ + 1209, + 1210 + ], + [ + 1213, + 1216 + ], + [ + 1219, + 1220 + ], + [ + 1222, + 1223 + ], + [ + 1226, + 1229 + ], + [ + 1232, + 1233 + ], + [ + 1235, + 1236 + ], + [ + 1237, + 1238 + ], + [ + 1241, + 1242 + ], + [ + 1245, + 1261 + ], + [ + 1263, + 1264 + ], + [ + 1272, + 1273 + ], + [ + 1274, + 1275 + ], + [ + 1279, + 1280 + ], + [ + 1286, + 1287 + ], + [ + 1292, + 1293 + ], + [ + 1295, + 1299 + ], + [ + 1301, + 1302 + ], + [ + 1310, + 1311 + ], + [ + 1312, + 1313 + ], + [ + 1317, + 1318 + ], + [ + 1324, + 1325 + ], + [ + 1331, + 1332 + ], + [ + 1334, + 1339 + ], + [ + 1340, + 1341 + ], + [ + 1342, + 1343 + ], + [ + 1346, + 1347 + ], + [ + 1358, + 1359 + ], + [ + 1361, + 1362 + ], + [ + 1364, + 1365 + ], + [ + 1366, + 1367 + ], + [ + 1369, + 1370 + ], + [ + 1371, + 1372 + ], + [ + 1374, + 1381 + ], + [ + 1386, + 1387 + ], + [ + 1388, + 1389 + ], + [ + 1394, + 1395 + ], + [ + 1403, + 1404 + ], + [ + 1405, + 1406 + ], + [ + 1413, + 1414 + ], + [ + 1423, + 1424 + ], + [ + 1425, + 1426 + ], + [ + 1433, + 1434 + ], + [ + 1436, + 1441 + ], + [ + 1443, + 1444 + ], + [ + 1445, + 1446 + ], + [ + 1453, + 1454 + ], + [ + 1458, + 1459 + ], + [ + 1460, + 1461 + ], + [ + 1462, + 1463 + ], + [ + 1464, + 1465 + ], + [ + 1467, + 1468 + ], + [ + 1471, + 1472 + ], + [ + 1474, + 1475 + ], + [ + 1476, + 1477 + ], + [ + 1481, + 1482 + ], + [ + 1484, + 1486 + ], + [ + 1489, + 1490 + ], + [ + 1491, + 1493 + ], + [ + 1496, + 1497 + ], + [ + 1500, + 1506 + ], + [ + 1508, + 1509 + ], + [ + 1520, + 1521 + ], + [ + 1524, + 1528 + ], + [ + 1537, + 1538 + ], + [ + 1540, + 1541 + ], + [ + 1544, + 1545 + ], + [ + 1546, + 1547 + ], + [ + 1549, + 1550 + ], + [ + 1555, + 1556 + ], + [ + 1558, + 1559 + ], + [ + 1560, + 1561 + ], + [ + 1563, + 1564 + ], + [ + 1573, + 1574 + ], + [ + 1575, + 1576 + ], + [ + 1577, + 1578 + ], + [ + 1580, + 1581 + ], + [ + 1583, + 1584 + ], + [ + 1592, + 1593 + ], + [ + 1597, + 1598 + ], + [ + 1599, + 1604 + ], + [ + 1606, + 1607 + ], + [ + 1613, + 1614 + ], + [ + 1616, + 1617 + ], + [ + 1618, + 1619 + ], + [ + 1621, + 1622 + ], + [ + 1626, + 1627 + ], + [ + 1635, + 1636 + ], + [ + 1639, + 1640 + ], + [ + 1641, + 1644 + ], + [ + 1646, + 1647 + ], + [ + 1665, + 1667 + ], + [ + 1670, + 1671 + ], + [ + 1672, + 1675 + ], + [ + 1677, + 1678 + ], + [ + 1684, + 1685 + ], + [ + 1686, + 1687 + ], + [ + 1693, + 1694 + ], + [ + 1697, + 1698 + ], + [ + 1699, + 1702 + ], + [ + 1704, + 1705 + ], + [ + 1721, + 1722 + ], + [ + 1723, + 1724 + ], + [ + 1727, + 1728 + ], + [ + 1729, + 1732 + ], + [ + 1733, + 1734 + ], + [ + 1735, + 1736 + ], + [ + 1739, + 1740 + ], + [ + 1743, + 1746 + ], + [ + 1748, + 1749 + ], + [ + 1764, + 1766 + ], + [ + 1773, + 1776 + ], + [ + 1777, + 1778 + ], + [ + 1779, + 1780 + ], + [ + 1782, + 1783 + ], + [ + 1785, + 1786 + ], + [ + 1798, + 1799 + ], + [ + 1800, + 1801 + ], + [ + 1803, + 1804 + ], + [ + 1807, + 1808 + ], + [ + 1809, + 1810 + ], + [ + 1814, + 1815 + ], + [ + 1816, + 1817 + ], + [ + 1818, + 1819 + ], + [ + 1821, + 1823 + ], + [ + 1826, + 1827 + ], + [ + 1839, + 1840 + ], + [ + 1841, + 1842 + ], + [ + 1844, + 1845 + ], + [ + 1848, + 1849 + ], + [ + 1850, + 1851 + ], + [ + 1855, + 1856 + ], + [ + 1857, + 1858 + ], + [ + 1859, + 1860 + ], + [ + 1862, + 1864 + ], + [ + 1867, + 1868 + ], + [ + 1880, + 1881 + ], + [ + 1882, + 1883 + ], + [ + 1885, + 1886 + ], + [ + 1888, + 1889 + ], + [ + 1890, + 1891 + ], + [ + 1895, + 1896 + ], + [ + 1899, + 1900 + ], + [ + 1901, + 1903 + ], + [ + 1905, + 1906 + ], + [ + 1918, + 1919 + ], + [ + 1920, + 1921 + ], + [ + 1923, + 1924 + ], + [ + 1926, + 1927 + ], + [ + 1928, + 1929 + ], + [ + 1933, + 1934 + ], + [ + 1937, + 1940 + ], + [ + 1945, + 1946 + ], + [ + 1956, + 1959 + ], + [ + 1960, + 1972 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/util.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 66, + 169 + ], + [ + 170, + 187 + ], + [ + 189, + 220 + ], + [ + 224, + 239 + ], + [ + 241, + 250 + ], + [ + 251, + 334 + ], + [ + 336, + 361 + ], + [ + 363, + 370 + ], + [ + 375, + 382 + ], + [ + 404, + 467 + ], + [ + 469, + 509 + ], + [ + 511, + 587 + ], + [ + 589, + 669 + ], + [ + 673, + 759 + ], + [ + 767, + 867 + ], + [ + 869, + 1022 + ], + [ + 1025, + 1103 + ], + [ + 1107, + 1262 + ], + [ + 1264, + 1280 + ], + [ + 1305, + 1332 + ], + [ + 1337, + 1355 + ], + [ + 1356, + 1398 + ], + [ + 1400, + 1430 + ], + [ + 1435, + 1468 + ], + [ + 1477, + 1492 + ], + [ + 1494, + 1555 + ], + [ + 1558, + 1631 + ], + [ + 1632, + 1694 + ], + [ + 1696, + 1703 + ], + [ + 1711, + 1841 + ], + [ + 1842, + 1865 + ], + [ + 1866, + 1901 + ], + [ + 1902, + 2076 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 69, + 70 + ], + [ + 74, + 75 + ], + [ + 76, + 79 + ], + [ + 84, + 88 + ], + [ + 93, + 94 + ], + [ + 99, + 100 + ], + [ + 101, + 102 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 111, + 112 + ], + [ + 117, + 119 + ], + [ + 120, + 121 + ], + [ + 122, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 130 + ], + [ + 135, + 136 + ], + [ + 137, + 139 + ], + [ + 140, + 141 + ], + [ + 142, + 143 + ], + [ + 146, + 148 + ], + [ + 149, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 158 + ], + [ + 159, + 160 + ], + [ + 165, + 166 + ], + [ + 173, + 175 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 183, + 184 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 198, + 199 + ], + [ + 204, + 205 + ], + [ + 206, + 208 + ], + [ + 211, + 212 + ], + [ + 213, + 215 + ], + [ + 216, + 217 + ], + [ + 227, + 228 + ], + [ + 229, + 230 + ], + [ + 235, + 236 + ], + [ + 244, + 245 + ], + [ + 246, + 247 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 258, + 259 + ], + [ + 260, + 264 + ], + [ + 265, + 266 + ], + [ + 271, + 272 + ], + [ + 273, + 275 + ], + [ + 277, + 282 + ], + [ + 284, + 285 + ], + [ + 287, + 291 + ], + [ + 292, + 294 + ], + [ + 295, + 296 + ], + [ + 298, + 299 + ], + [ + 301, + 305 + ], + [ + 306, + 308 + ], + [ + 309, + 310 + ], + [ + 313, + 314 + ], + [ + 316, + 317 + ], + [ + 320, + 323 + ], + [ + 327, + 329 + ], + [ + 330, + 331 + ], + [ + 339, + 340 + ], + [ + 345, + 347 + ], + [ + 349, + 351 + ], + [ + 355, + 356 + ], + [ + 357, + 358 + ], + [ + 366, + 367 + ], + [ + 378, + 379 + ], + [ + 407, + 408 + ], + [ + 409, + 411 + ], + [ + 412, + 417 + ], + [ + 418, + 421 + ], + [ + 424, + 426 + ], + [ + 427, + 428 + ], + [ + 429, + 441 + ], + [ + 445, + 447 + ], + [ + 453, + 454 + ], + [ + 459, + 460 + ], + [ + 462, + 464 + ], + [ + 472, + 485 + ], + [ + 489, + 490 + ], + [ + 494, + 497 + ], + [ + 498, + 499 + ], + [ + 505, + 506 + ], + [ + 514, + 515 + ], + [ + 518, + 519 + ], + [ + 522, + 524 + ], + [ + 528, + 529 + ], + [ + 530, + 531 + ], + [ + 536, + 537 + ], + [ + 541, + 543 + ], + [ + 545, + 546 + ], + [ + 547, + 550 + ], + [ + 552, + 553 + ], + [ + 558, + 559 + ], + [ + 561, + 562 + ], + [ + 563, + 567 + ], + [ + 571, + 572 + ], + [ + 573, + 574 + ], + [ + 577, + 579 + ], + [ + 583, + 584 + ], + [ + 592, + 593 + ], + [ + 595, + 596 + ], + [ + 597, + 600 + ], + [ + 606, + 607 + ], + [ + 613, + 614 + ], + [ + 615, + 616 + ], + [ + 618, + 619 + ], + [ + 621, + 624 + ], + [ + 626, + 627 + ], + [ + 629, + 631 + ], + [ + 632, + 633 + ], + [ + 638, + 639 + ], + [ + 642, + 643 + ], + [ + 645, + 648 + ], + [ + 650, + 651 + ], + [ + 655, + 657 + ], + [ + 661, + 664 + ], + [ + 665, + 666 + ], + [ + 676, + 678 + ], + [ + 683, + 684 + ], + [ + 687, + 688 + ], + [ + 691, + 693 + ], + [ + 694, + 696 + ], + [ + 698, + 701 + ], + [ + 702, + 704 + ], + [ + 706, + 708 + ], + [ + 709, + 710 + ], + [ + 713, + 714 + ], + [ + 719, + 720 + ], + [ + 723, + 724 + ], + [ + 727, + 732 + ], + [ + 734, + 735 + ], + [ + 740, + 741 + ], + [ + 742, + 743 + ], + [ + 744, + 745 + ], + [ + 746, + 748 + ], + [ + 750, + 754 + ], + [ + 755, + 756 + ], + [ + 770, + 776 + ], + [ + 781, + 784 + ], + [ + 785, + 786 + ], + [ + 788, + 789 + ], + [ + 792, + 793 + ], + [ + 794, + 804 + ], + [ + 809, + 810 + ], + [ + 812, + 813 + ], + [ + 819, + 821 + ], + [ + 825, + 830 + ], + [ + 831, + 832 + ], + [ + 833, + 834 + ], + [ + 839, + 840 + ], + [ + 843, + 845 + ], + [ + 846, + 851 + ], + [ + 853, + 854 + ], + [ + 856, + 858 + ], + [ + 863, + 864 + ], + [ + 872, + 876 + ], + [ + 877, + 878 + ], + [ + 881, + 882 + ], + [ + 884, + 885 + ], + [ + 887, + 888 + ], + [ + 891, + 896 + ], + [ + 900, + 901 + ], + [ + 906, + 907 + ], + [ + 910, + 912 + ], + [ + 913, + 914 + ], + [ + 917, + 918 + ], + [ + 921, + 923 + ], + [ + 924, + 925 + ], + [ + 928, + 929 + ], + [ + 930, + 932 + ], + [ + 935, + 936 + ], + [ + 939, + 941 + ], + [ + 942, + 943 + ], + [ + 948, + 949 + ], + [ + 950, + 952 + ], + [ + 957, + 958 + ], + [ + 964, + 967 + ], + [ + 968, + 969 + ], + [ + 970, + 971 + ], + [ + 973, + 975 + ], + [ + 978, + 979 + ], + [ + 985, + 986 + ], + [ + 988, + 989 + ], + [ + 990, + 991 + ], + [ + 993, + 995 + ], + [ + 996, + 997 + ], + [ + 999, + 1001 + ], + [ + 1004, + 1007 + ], + [ + 1009, + 1010 + ], + [ + 1011, + 1012 + ], + [ + 1018, + 1019 + ], + [ + 1028, + 1029 + ], + [ + 1032, + 1033 + ], + [ + 1036, + 1037 + ], + [ + 1040, + 1042 + ], + [ + 1045, + 1046 + ], + [ + 1049, + 1051 + ], + [ + 1053, + 1054 + ], + [ + 1057, + 1058 + ], + [ + 1059, + 1060 + ], + [ + 1063, + 1064 + ], + [ + 1065, + 1066 + ], + [ + 1069, + 1070 + ], + [ + 1074, + 1077 + ], + [ + 1078, + 1079 + ], + [ + 1080, + 1081 + ], + [ + 1083, + 1084 + ], + [ + 1089, + 1090 + ], + [ + 1093, + 1097 + ], + [ + 1099, + 1100 + ], + [ + 1110, + 1111 + ], + [ + 1113, + 1123 + ], + [ + 1124, + 1129 + ], + [ + 1132, + 1133 + ], + [ + 1138, + 1139 + ], + [ + 1140, + 1143 + ], + [ + 1144, + 1147 + ], + [ + 1148, + 1149 + ], + [ + 1150, + 1151 + ], + [ + 1152, + 1153 + ], + [ + 1158, + 1159 + ], + [ + 1160, + 1163 + ], + [ + 1164, + 1167 + ], + [ + 1168, + 1169 + ], + [ + 1170, + 1171 + ], + [ + 1172, + 1173 + ], + [ + 1178, + 1179 + ], + [ + 1180, + 1193 + ], + [ + 1194, + 1195 + ], + [ + 1196, + 1197 + ], + [ + 1202, + 1203 + ], + [ + 1204, + 1217 + ], + [ + 1218, + 1219 + ], + [ + 1220, + 1221 + ], + [ + 1223, + 1224 + ], + [ + 1226, + 1227 + ], + [ + 1228, + 1233 + ], + [ + 1235, + 1236 + ], + [ + 1241, + 1242 + ], + [ + 1245, + 1246 + ], + [ + 1249, + 1250 + ], + [ + 1251, + 1252 + ], + [ + 1253, + 1254 + ], + [ + 1258, + 1259 + ], + [ + 1267, + 1269 + ], + [ + 1272, + 1275 + ], + [ + 1276, + 1277 + ], + [ + 1308, + 1309 + ], + [ + 1311, + 1312 + ], + [ + 1315, + 1317 + ], + [ + 1319, + 1320 + ], + [ + 1322, + 1323 + ], + [ + 1328, + 1329 + ], + [ + 1340, + 1341 + ], + [ + 1342, + 1344 + ], + [ + 1350, + 1352 + ], + [ + 1359, + 1360 + ], + [ + 1365, + 1367 + ], + [ + 1368, + 1372 + ], + [ + 1374, + 1375 + ], + [ + 1380, + 1382 + ], + [ + 1385, + 1392 + ], + [ + 1394, + 1395 + ], + [ + 1403, + 1405 + ], + [ + 1408, + 1410 + ], + [ + 1411, + 1412 + ], + [ + 1413, + 1415 + ], + [ + 1418, + 1419 + ], + [ + 1422, + 1425 + ], + [ + 1426, + 1427 + ], + [ + 1438, + 1439 + ], + [ + 1440, + 1442 + ], + [ + 1444, + 1445 + ], + [ + 1450, + 1452 + ], + [ + 1455, + 1462 + ], + [ + 1464, + 1465 + ], + [ + 1480, + 1481 + ], + [ + 1484, + 1485 + ], + [ + 1488, + 1489 + ], + [ + 1497, + 1502 + ], + [ + 1506, + 1508 + ], + [ + 1511, + 1514 + ], + [ + 1516, + 1518 + ], + [ + 1519, + 1520 + ], + [ + 1522, + 1523 + ], + [ + 1528, + 1530 + ], + [ + 1533, + 1534 + ], + [ + 1538, + 1539 + ], + [ + 1541, + 1542 + ], + [ + 1545, + 1548 + ], + [ + 1551, + 1552 + ], + [ + 1561, + 1562 + ], + [ + 1567, + 1569 + ], + [ + 1573, + 1574 + ], + [ + 1576, + 1577 + ], + [ + 1578, + 1579 + ], + [ + 1584, + 1585 + ], + [ + 1587, + 1588 + ], + [ + 1589, + 1590 + ], + [ + 1595, + 1596 + ], + [ + 1599, + 1600 + ], + [ + 1603, + 1604 + ], + [ + 1608, + 1611 + ], + [ + 1613, + 1614 + ], + [ + 1618, + 1619 + ], + [ + 1621, + 1622 + ], + [ + 1624, + 1625 + ], + [ + 1627, + 1628 + ], + [ + 1635, + 1636 + ], + [ + 1637, + 1641 + ], + [ + 1643, + 1644 + ], + [ + 1647, + 1648 + ], + [ + 1651, + 1652 + ], + [ + 1654, + 1656 + ], + [ + 1658, + 1660 + ], + [ + 1661, + 1663 + ], + [ + 1665, + 1691 + ], + [ + 1699, + 1700 + ], + [ + 1714, + 1716 + ], + [ + 1717, + 1718 + ], + [ + 1720, + 1722 + ], + [ + 1726, + 1727 + ], + [ + 1728, + 1730 + ], + [ + 1731, + 1732 + ], + [ + 1737, + 1738 + ], + [ + 1741, + 1743 + ], + [ + 1744, + 1745 + ], + [ + 1748, + 1749 + ], + [ + 1752, + 1754 + ], + [ + 1755, + 1756 + ], + [ + 1759, + 1760 + ], + [ + 1766, + 1767 + ], + [ + 1768, + 1771 + ], + [ + 1772, + 1773 + ], + [ + 1774, + 1778 + ], + [ + 1781, + 1785 + ], + [ + 1787, + 1790 + ], + [ + 1791, + 1792 + ], + [ + 1795, + 1796 + ], + [ + 1802, + 1803 + ], + [ + 1804, + 1807 + ], + [ + 1808, + 1809 + ], + [ + 1810, + 1814 + ], + [ + 1815, + 1819 + ], + [ + 1821, + 1824 + ], + [ + 1825, + 1826 + ], + [ + 1828, + 1829 + ], + [ + 1834, + 1835 + ], + [ + 1836, + 1838 + ], + [ + 1845, + 1846 + ], + [ + 1850, + 1852 + ], + [ + 1854, + 1855 + ], + [ + 1856, + 1857 + ], + [ + 1859, + 1862 + ], + [ + 1869, + 1872 + ], + [ + 1877, + 1879 + ], + [ + 1884, + 1886 + ], + [ + 1887, + 1890 + ], + [ + 1891, + 1892 + ], + [ + 1897, + 1898 + ], + [ + 1905, + 1906 + ], + [ + 1909, + 1911 + ], + [ + 1913, + 1914 + ], + [ + 1915, + 1916 + ], + [ + 1921, + 1923 + ], + [ + 1924, + 1925 + ], + [ + 1926, + 1930 + ], + [ + 1931, + 1932 + ], + [ + 1935, + 1936 + ], + [ + 1940, + 1941 + ], + [ + 1942, + 1943 + ], + [ + 1946, + 1947 + ], + [ + 1953, + 1954 + ], + [ + 1959, + 1961 + ], + [ + 1963, + 1966 + ], + [ + 1967, + 1968 + ], + [ + 1972, + 1973 + ], + [ + 1976, + 1977 + ], + [ + 1980, + 1982 + ], + [ + 1988, + 1989 + ], + [ + 1990, + 1991 + ], + [ + 1993, + 1994 + ], + [ + 1999, + 2000 + ], + [ + 2004, + 2008 + ], + [ + 2010, + 2011 + ], + [ + 2014, + 2015 + ], + [ + 2018, + 2020 + ], + [ + 2023, + 2024 + ], + [ + 2027, + 2030 + ], + [ + 2031, + 2038 + ], + [ + 2039, + 2042 + ], + [ + 2044, + 2045 + ], + [ + 2051, + 2052 + ], + [ + 2057, + 2059 + ], + [ + 2061, + 2063 + ], + [ + 2064, + 2066 + ], + [ + 2070, + 2073 + ], + [ + 2074, + 2075 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/vector.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 40 + ], + [ + 70, + 93 + ], + [ + 94, + 111 + ], + [ + 112, + 140 + ], + [ + 141, + 168 + ], + [ + 170, + 177 + ], + [ + 182, + 189 + ], + [ + 191, + 297 + ], + [ + 300, + 392 + ], + [ + 394, + 545 + ], + [ + 549, + 558 + ], + [ + 564, + 589 + ], + [ + 592, + 599 + ], + [ + 601, + 613 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 34, + 35 + ], + [ + 36, + 37 + ], + [ + 73, + 74 + ], + [ + 77, + 80 + ], + [ + 84, + 86 + ], + [ + 89, + 90 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 115, + 117 + ], + [ + 119, + 122 + ], + [ + 125, + 127 + ], + [ + 132, + 133 + ], + [ + 136, + 137 + ], + [ + 144, + 146 + ], + [ + 147, + 148 + ], + [ + 149, + 151 + ], + [ + 154, + 155 + ], + [ + 161, + 163 + ], + [ + 164, + 165 + ], + [ + 173, + 174 + ], + [ + 185, + 186 + ], + [ + 194, + 195 + ], + [ + 196, + 197 + ], + [ + 198, + 199 + ], + [ + 201, + 204 + ], + [ + 208, + 209 + ], + [ + 213, + 215 + ], + [ + 216, + 217 + ], + [ + 220, + 223 + ], + [ + 227, + 228 + ], + [ + 232, + 235 + ], + [ + 236, + 237 + ], + [ + 241, + 242 + ], + [ + 246, + 247 + ], + [ + 248, + 249 + ], + [ + 250, + 251 + ], + [ + 253, + 254 + ], + [ + 260, + 262 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 267, + 269 + ], + [ + 270, + 273 + ], + [ + 279, + 281 + ], + [ + 283, + 284 + ], + [ + 285, + 286 + ], + [ + 288, + 291 + ], + [ + 292, + 294 + ], + [ + 303, + 304 + ], + [ + 308, + 309 + ], + [ + 310, + 312 + ], + [ + 314, + 316 + ], + [ + 318, + 319 + ], + [ + 322, + 323 + ], + [ + 326, + 327 + ], + [ + 329, + 330 + ], + [ + 331, + 333 + ], + [ + 335, + 337 + ], + [ + 343, + 344 + ], + [ + 348, + 349 + ], + [ + 350, + 353 + ], + [ + 355, + 357 + ], + [ + 359, + 360 + ], + [ + 363, + 364 + ], + [ + 367, + 368 + ], + [ + 372, + 373 + ], + [ + 374, + 375 + ], + [ + 376, + 378 + ], + [ + 380, + 381 + ], + [ + 384, + 385 + ], + [ + 388, + 389 + ], + [ + 397, + 399 + ], + [ + 403, + 405 + ], + [ + 406, + 407 + ], + [ + 408, + 410 + ], + [ + 411, + 412 + ], + [ + 414, + 416 + ], + [ + 417, + 418 + ], + [ + 421, + 422 + ], + [ + 428, + 431 + ], + [ + 433, + 434 + ], + [ + 435, + 436 + ], + [ + 437, + 438 + ], + [ + 440, + 441 + ], + [ + 446, + 447 + ], + [ + 450, + 451 + ], + [ + 454, + 457 + ], + [ + 458, + 471 + ], + [ + 474, + 475 + ], + [ + 479, + 481 + ], + [ + 485, + 486 + ], + [ + 488, + 490 + ], + [ + 494, + 495 + ], + [ + 497, + 499 + ], + [ + 503, + 505 + ], + [ + 507, + 509 + ], + [ + 512, + 515 + ], + [ + 518, + 519 + ], + [ + 522, + 523 + ], + [ + 526, + 527 + ], + [ + 529, + 530 + ], + [ + 533, + 535 + ], + [ + 541, + 542 + ], + [ + 552, + 553 + ], + [ + 554, + 555 + ], + [ + 567, + 569 + ], + [ + 571, + 572 + ], + [ + 574, + 575 + ], + [ + 576, + 577 + ], + [ + 578, + 579 + ], + [ + 581, + 584 + ], + [ + 585, + 586 + ], + [ + 595, + 596 + ], + [ + 604, + 605 + ], + [ + 606, + 607 + ], + [ + 609, + 610 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/vips.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 13, + 20 + ], + [ + 31, + 59 + ], + [ + 110, + 117 + ], + [ + 120, + 173 + ], + [ + 174, + 182 + ], + [ + 184, + 202 + ], + [ + 203, + 230 + ], + [ + 231, + 246 + ], + [ + 247, + 293 + ], + [ + 294, + 419 + ], + [ + 421, + 545 + ], + [ + 548, + 580 + ], + [ + 598, + 640 + ], + [ + 642, + 869 + ], + [ + 870, + 955 + ], + [ + 957, + 1019 + ], + [ + 1026, + 1059 + ], + [ + 1062, + 1099 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 16, + 17 + ], + [ + 34, + 40 + ], + [ + 41, + 45 + ], + [ + 46, + 50 + ], + [ + 55, + 56 + ], + [ + 113, + 114 + ], + [ + 123, + 124 + ], + [ + 126, + 127 + ], + [ + 130, + 131 + ], + [ + 134, + 135 + ], + [ + 138, + 139 + ], + [ + 140, + 141 + ], + [ + 143, + 144 + ], + [ + 147, + 149 + ], + [ + 151, + 153 + ], + [ + 155, + 161 + ], + [ + 163, + 164 + ], + [ + 166, + 167 + ], + [ + 169, + 170 + ], + [ + 177, + 179 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 192, + 196 + ], + [ + 197, + 199 + ], + [ + 206, + 207 + ], + [ + 208, + 210 + ], + [ + 214, + 217 + ], + [ + 219, + 224 + ], + [ + 226, + 227 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 242, + 243 + ], + [ + 250, + 251 + ], + [ + 256, + 257 + ], + [ + 261, + 263 + ], + [ + 268, + 269 + ], + [ + 273, + 275 + ], + [ + 280, + 281 + ], + [ + 284, + 288 + ], + [ + 289, + 290 + ], + [ + 297, + 298 + ], + [ + 301, + 315 + ], + [ + 318, + 319 + ], + [ + 325, + 328 + ], + [ + 332, + 334 + ], + [ + 335, + 340 + ], + [ + 342, + 343 + ], + [ + 345, + 346 + ], + [ + 347, + 351 + ], + [ + 356, + 357 + ], + [ + 361, + 363 + ], + [ + 365, + 366 + ], + [ + 367, + 371 + ], + [ + 374, + 378 + ], + [ + 379, + 383 + ], + [ + 385, + 386 + ], + [ + 392, + 393 + ], + [ + 394, + 397 + ], + [ + 402, + 407 + ], + [ + 411, + 416 + ], + [ + 424, + 425 + ], + [ + 428, + 429 + ], + [ + 433, + 434 + ], + [ + 439, + 440 + ], + [ + 446, + 448 + ], + [ + 450, + 455 + ], + [ + 460, + 461 + ], + [ + 464, + 467 + ], + [ + 469, + 470 + ], + [ + 475, + 476 + ], + [ + 479, + 487 + ], + [ + 490, + 491 + ], + [ + 496, + 497 + ], + [ + 500, + 502 + ], + [ + 503, + 504 + ], + [ + 509, + 510 + ], + [ + 514, + 521 + ], + [ + 522, + 527 + ], + [ + 530, + 533 + ], + [ + 535, + 536 + ], + [ + 539, + 540 + ], + [ + 541, + 542 + ], + [ + 551, + 555 + ], + [ + 556, + 561 + ], + [ + 565, + 567 + ], + [ + 570, + 573 + ], + [ + 574, + 575 + ], + [ + 576, + 577 + ], + [ + 601, + 602 + ], + [ + 605, + 607 + ], + [ + 612, + 615 + ], + [ + 617, + 623 + ], + [ + 625, + 628 + ], + [ + 629, + 630 + ], + [ + 631, + 637 + ], + [ + 645, + 646 + ], + [ + 652, + 653 + ], + [ + 656, + 658 + ], + [ + 661, + 663 + ], + [ + 664, + 666 + ], + [ + 668, + 669 + ], + [ + 672, + 673 + ], + [ + 677, + 679 + ], + [ + 680, + 686 + ], + [ + 688, + 691 + ], + [ + 692, + 693 + ], + [ + 696, + 697 + ], + [ + 701, + 702 + ], + [ + 704, + 710 + ], + [ + 712, + 713 + ], + [ + 716, + 723 + ], + [ + 729, + 730 + ], + [ + 734, + 735 + ], + [ + 737, + 738 + ], + [ + 743, + 745 + ], + [ + 749, + 751 + ], + [ + 752, + 753 + ], + [ + 755, + 756 + ], + [ + 757, + 758 + ], + [ + 759, + 762 + ], + [ + 763, + 768 + ], + [ + 770, + 772 + ], + [ + 773, + 774 + ], + [ + 777, + 778 + ], + [ + 782, + 788 + ], + [ + 790, + 795 + ], + [ + 797, + 799 + ], + [ + 801, + 802 + ], + [ + 807, + 808 + ], + [ + 812, + 814 + ], + [ + 815, + 818 + ], + [ + 822, + 823 + ], + [ + 824, + 825 + ], + [ + 828, + 830 + ], + [ + 831, + 833 + ], + [ + 835, + 840 + ], + [ + 843, + 844 + ], + [ + 845, + 854 + ], + [ + 856, + 857 + ], + [ + 859, + 860 + ], + [ + 865, + 866 + ], + [ + 873, + 886 + ], + [ + 888, + 890 + ], + [ + 891, + 895 + ], + [ + 897, + 899 + ], + [ + 900, + 901 + ], + [ + 902, + 903 + ], + [ + 904, + 905 + ], + [ + 908, + 910 + ], + [ + 912, + 913 + ], + [ + 916, + 918 + ], + [ + 919, + 921 + ], + [ + 923, + 928 + ], + [ + 929, + 942 + ], + [ + 944, + 945 + ], + [ + 951, + 952 + ], + [ + 960, + 973 + ], + [ + 975, + 977 + ], + [ + 978, + 979 + ], + [ + 980, + 981 + ], + [ + 982, + 983 + ], + [ + 987, + 989 + ], + [ + 992, + 994 + ], + [ + 995, + 997 + ], + [ + 998, + 1002 + ], + [ + 1004, + 1005 + ], + [ + 1007, + 1008 + ], + [ + 1009, + 1010 + ], + [ + 1015, + 1016 + ], + [ + 1029, + 1033 + ], + [ + 1035, + 1043 + ], + [ + 1047, + 1048 + ], + [ + 1049, + 1052 + ], + [ + 1053, + 1056 + ], + [ + 1065, + 1068 + ], + [ + 1071, + 1072 + ], + [ + 1074, + 1076 + ], + [ + 1077, + 1079 + ], + [ + 1083, + 1086 + ], + [ + 1090, + 1091 + ], + [ + 1092, + 1095 + ], + [ + 1097, + 1098 + ] + ] + } + }, + { + "filename": "libvips/iofuncs/window.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 6 + ], + [ + 8, + 36 + ], + [ + 84, + 103 + ], + [ + 104, + 217 + ], + [ + 218, + 229 + ], + [ + 230, + 249 + ], + [ + 256, + 282 + ], + [ + 284, + 304 + ], + [ + 308, + 423 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 11, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 27 + ], + [ + 32, + 33 + ], + [ + 87, + 88 + ], + [ + 91, + 94 + ], + [ + 96, + 97 + ], + [ + 98, + 100 + ], + [ + 107, + 108 + ], + [ + 111, + 112 + ], + [ + 115, + 116 + ], + [ + 118, + 122 + ], + [ + 124, + 126 + ], + [ + 127, + 129 + ], + [ + 132, + 133 + ], + [ + 134, + 135 + ], + [ + 138, + 139 + ], + [ + 142, + 143 + ], + [ + 145, + 147 + ], + [ + 149, + 150 + ], + [ + 153, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 167, + 168 + ], + [ + 169, + 170 + ], + [ + 175, + 179 + ], + [ + 182, + 183 + ], + [ + 187, + 188 + ], + [ + 191, + 192 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 203, + 204 + ], + [ + 207, + 208 + ], + [ + 213, + 214 + ], + [ + 221, + 222 + ], + [ + 223, + 226 + ], + [ + 233, + 238 + ], + [ + 240, + 242 + ], + [ + 243, + 246 + ], + [ + 259, + 260 + ], + [ + 261, + 262 + ], + [ + 263, + 264 + ], + [ + 267, + 268 + ], + [ + 273, + 274 + ], + [ + 277, + 279 + ], + [ + 287, + 288 + ], + [ + 289, + 292 + ], + [ + 296, + 298 + ], + [ + 300, + 301 + ], + [ + 311, + 312 + ], + [ + 313, + 316 + ], + [ + 317, + 318 + ], + [ + 323, + 324 + ], + [ + 330, + 332 + ], + [ + 333, + 334 + ], + [ + 337, + 340 + ], + [ + 343, + 344 + ], + [ + 346, + 347 + ], + [ + 349, + 350 + ], + [ + 355, + 356 + ], + [ + 357, + 359 + ], + [ + 360, + 361 + ], + [ + 364, + 369 + ], + [ + 370, + 371 + ], + [ + 373, + 374 + ], + [ + 375, + 376 + ], + [ + 381, + 382 + ], + [ + 386, + 388 + ], + [ + 389, + 390 + ], + [ + 392, + 393 + ], + [ + 395, + 397 + ], + [ + 399, + 401 + ], + [ + 402, + 405 + ], + [ + 407, + 408 + ], + [ + 409, + 410 + ], + [ + 413, + 414 + ], + [ + 415, + 422 + ] + ] + } + }, + { + "filename": "libvips/module/heif.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 52, + 86 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 68 + ], + [ + 70, + 73 + ], + [ + 76, + 80 + ], + [ + 82, + 83 + ] + ] + } + }, + { + "filename": "libvips/module/jxl.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 52, + 79 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 76 + ] + ] + } + }, + { + "filename": "libvips/module/magick.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 47, + 72 + ], + [ + 86, + 93 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 50, + 51 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 69 + ], + [ + 89, + 90 + ] + ] + } + }, + { + "filename": "libvips/module/openslide.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 52, + 71 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 63 + ], + [ + 67, + 68 + ] + ] + } + }, + { + "filename": "libvips/module/poppler.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 52, + 73 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 55, + 56 + ], + [ + 58, + 59 + ], + [ + 61, + 64 + ], + [ + 65, + 68 + ], + [ + 69, + 70 + ] + ] + } + }, + { + "filename": "libvips/morphology/countlines.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 11 + ], + [ + 16, + 44 + ], + [ + 69, + 158 + ], + [ + 174, + 189 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 7, + 8 + ], + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 35 + ], + [ + 40, + 41 + ], + [ + 72, + 73 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 80, + 81 + ], + [ + 84, + 86 + ], + [ + 91, + 92 + ], + [ + 93, + 96 + ], + [ + 97, + 101 + ], + [ + 104, + 107 + ], + [ + 108, + 112 + ], + [ + 118, + 119 + ], + [ + 120, + 121 + ], + [ + 124, + 125 + ], + [ + 126, + 128 + ], + [ + 129, + 130 + ], + [ + 135, + 136 + ], + [ + 138, + 141 + ], + [ + 142, + 144 + ], + [ + 145, + 148 + ], + [ + 149, + 151 + ], + [ + 154, + 155 + ], + [ + 177, + 179 + ], + [ + 183, + 186 + ], + [ + 187, + 188 + ] + ] + } + }, + { + "filename": "libvips/morphology/labelregions.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 49, + 98 + ], + [ + 100, + 142 + ], + [ + 169, + 183 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 52, + 53 + ], + [ + 57, + 58 + ], + [ + 60, + 61 + ], + [ + 62, + 63 + ], + [ + 64, + 65 + ], + [ + 71, + 73 + ], + [ + 77, + 78 + ], + [ + 79, + 84 + ], + [ + 87, + 90 + ], + [ + 92, + 95 + ], + [ + 103, + 104 + ], + [ + 105, + 106 + ], + [ + 107, + 108 + ], + [ + 111, + 112 + ], + [ + 113, + 115 + ], + [ + 120, + 121 + ], + [ + 123, + 126 + ], + [ + 127, + 128 + ], + [ + 129, + 132 + ], + [ + 133, + 135 + ], + [ + 138, + 139 + ], + [ + 172, + 173 + ], + [ + 177, + 180 + ], + [ + 181, + 182 + ] + ] + } + }, + { + "filename": "libvips/morphology/morph.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 11 + ], + [ + 15, + 28 + ], + [ + 30, + 58 + ], + [ + 77, + 102 + ], + [ + 111, + 145 + ], + [ + 146, + 203 + ], + [ + 210, + 262 + ], + [ + 267, + 389 + ], + [ + 390, + 412 + ], + [ + 415, + 426 + ], + [ + 432, + 462 + ], + [ + 463, + 472 + ], + [ + 475, + 494 + ], + [ + 496, + 506 + ], + [ + 508, + 523 + ], + [ + 526, + 537 + ], + [ + 543, + 573 + ], + [ + 574, + 583 + ], + [ + 586, + 605 + ], + [ + 606, + 615 + ], + [ + 616, + 638 + ], + [ + 643, + 700 + ], + [ + 701, + 756 + ], + [ + 757, + 781 + ], + [ + 782, + 804 + ], + [ + 806, + 838 + ], + [ + 846, + 853 + ], + [ + 855, + 877 + ], + [ + 878, + 894 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 18, + 19 + ], + [ + 24, + 25 + ], + [ + 33, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 49 + ], + [ + 54, + 55 + ], + [ + 80, + 81 + ], + [ + 83, + 85 + ], + [ + 86, + 87 + ], + [ + 88, + 89 + ], + [ + 93, + 94 + ], + [ + 98, + 99 + ], + [ + 114, + 115 + ], + [ + 116, + 117 + ], + [ + 120, + 121 + ], + [ + 126, + 127 + ], + [ + 132, + 133 + ], + [ + 134, + 138 + ], + [ + 139, + 140 + ], + [ + 141, + 142 + ], + [ + 149, + 150 + ], + [ + 153, + 155 + ], + [ + 159, + 160 + ], + [ + 164, + 167 + ], + [ + 169, + 170 + ], + [ + 171, + 172 + ], + [ + 177, + 178 + ], + [ + 181, + 184 + ], + [ + 185, + 186 + ], + [ + 191, + 192 + ], + [ + 198, + 200 + ], + [ + 213, + 214 + ], + [ + 217, + 219 + ], + [ + 220, + 224 + ], + [ + 228, + 238 + ], + [ + 241, + 242 + ], + [ + 244, + 249 + ], + [ + 251, + 252 + ], + [ + 258, + 259 + ], + [ + 270, + 271 + ], + [ + 274, + 276 + ], + [ + 277, + 279 + ], + [ + 281, + 283 + ], + [ + 284, + 287 + ], + [ + 288, + 289 + ], + [ + 291, + 292 + ], + [ + 293, + 295 + ], + [ + 297, + 298 + ], + [ + 303, + 304 + ], + [ + 308, + 309 + ], + [ + 312, + 315 + ], + [ + 317, + 318 + ], + [ + 322, + 326 + ], + [ + 328, + 329 + ], + [ + 331, + 332 + ], + [ + 333, + 335 + ], + [ + 337, + 338 + ], + [ + 340, + 341 + ], + [ + 346, + 347 + ], + [ + 348, + 350 + ], + [ + 352, + 354 + ], + [ + 356, + 357 + ], + [ + 362, + 363 + ], + [ + 368, + 369 + ], + [ + 373, + 375 + ], + [ + 377, + 378 + ], + [ + 379, + 380 + ], + [ + 384, + 386 + ], + [ + 393, + 395 + ], + [ + 397, + 398 + ], + [ + 401, + 402 + ], + [ + 407, + 409 + ], + [ + 418, + 419 + ], + [ + 421, + 423 + ], + [ + 435, + 437 + ], + [ + 439, + 441 + ], + [ + 446, + 448 + ], + [ + 451, + 454 + ], + [ + 456, + 459 + ], + [ + 466, + 469 + ], + [ + 478, + 481 + ], + [ + 484, + 485 + ], + [ + 488, + 491 + ], + [ + 499, + 503 + ], + [ + 511, + 513 + ], + [ + 518, + 520 + ], + [ + 529, + 530 + ], + [ + 532, + 534 + ], + [ + 546, + 548 + ], + [ + 550, + 552 + ], + [ + 557, + 559 + ], + [ + 562, + 565 + ], + [ + 567, + 570 + ], + [ + 577, + 580 + ], + [ + 589, + 592 + ], + [ + 595, + 596 + ], + [ + 599, + 602 + ], + [ + 609, + 612 + ], + [ + 619, + 621 + ], + [ + 626, + 628 + ], + [ + 633, + 635 + ], + [ + 646, + 648 + ], + [ + 650, + 652 + ], + [ + 654, + 657 + ], + [ + 658, + 659 + ], + [ + 660, + 662 + ], + [ + 667, + 670 + ], + [ + 672, + 678 + ], + [ + 679, + 680 + ], + [ + 683, + 684 + ], + [ + 685, + 686 + ], + [ + 687, + 688 + ], + [ + 691, + 692 + ], + [ + 693, + 694 + ], + [ + 696, + 697 + ], + [ + 704, + 706 + ], + [ + 711, + 713 + ], + [ + 715, + 717 + ], + [ + 720, + 727 + ], + [ + 730, + 732 + ], + [ + 736, + 738 + ], + [ + 740, + 743 + ], + [ + 744, + 746 + ], + [ + 747, + 753 + ], + [ + 760, + 762 + ], + [ + 765, + 767 + ], + [ + 768, + 769 + ], + [ + 771, + 772 + ], + [ + 774, + 778 + ], + [ + 785, + 788 + ], + [ + 792, + 793 + ], + [ + 794, + 795 + ], + [ + 798, + 799 + ], + [ + 800, + 801 + ], + [ + 809, + 810 + ], + [ + 812, + 831 + ], + [ + 834, + 835 + ], + [ + 849, + 850 + ], + [ + 858, + 859 + ], + [ + 860, + 863 + ], + [ + 864, + 865 + ], + [ + 868, + 870 + ], + [ + 872, + 874 + ], + [ + 881, + 884 + ], + [ + 888, + 891 + ], + [ + 892, + 893 + ] + ] + } + }, + { + "filename": "libvips/morphology/morphology.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 49, + 58 + ], + [ + 68, + 78 + ], + [ + 80, + 92 + ], + [ + 99, + 132 + ], + [ + 133, + 150 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 52, + 53 + ], + [ + 54, + 55 + ], + [ + 71, + 72 + ], + [ + 74, + 75 + ], + [ + 83, + 84 + ], + [ + 88, + 89 + ], + [ + 102, + 104 + ], + [ + 106, + 107 + ], + [ + 108, + 110 + ], + [ + 115, + 116 + ], + [ + 120, + 123 + ], + [ + 124, + 125 + ], + [ + 128, + 129 + ], + [ + 136, + 137 + ], + [ + 138, + 149 + ] + ] + } + }, + { + "filename": "libvips/morphology/nearest.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 78, + 105 + ], + [ + 107, + 191 + ], + [ + 192, + 254 + ], + [ + 260, + 333 + ], + [ + 341, + 348 + ], + [ + 355, + 369 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 9, + 10 + ], + [ + 11, + 15 + ], + [ + 16, + 25 + ], + [ + 30, + 31 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 89, + 92 + ], + [ + 94, + 95 + ], + [ + 96, + 97 + ], + [ + 100, + 102 + ], + [ + 110, + 112 + ], + [ + 117, + 118 + ], + [ + 122, + 123 + ], + [ + 125, + 126 + ], + [ + 127, + 130 + ], + [ + 131, + 136 + ], + [ + 142, + 143 + ], + [ + 147, + 149 + ], + [ + 150, + 151 + ], + [ + 153, + 154 + ], + [ + 156, + 158 + ], + [ + 161, + 163 + ], + [ + 166, + 168 + ], + [ + 169, + 170 + ], + [ + 172, + 175 + ], + [ + 176, + 179 + ], + [ + 181, + 183 + ], + [ + 187, + 188 + ], + [ + 195, + 196 + ], + [ + 198, + 199 + ], + [ + 203, + 206 + ], + [ + 207, + 209 + ], + [ + 210, + 211 + ], + [ + 216, + 217 + ], + [ + 218, + 219 + ], + [ + 220, + 221 + ], + [ + 225, + 227 + ], + [ + 228, + 230 + ], + [ + 233, + 236 + ], + [ + 238, + 242 + ], + [ + 244, + 245 + ], + [ + 247, + 251 + ], + [ + 263, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 280, + 283 + ], + [ + 286, + 289 + ], + [ + 290, + 292 + ], + [ + 297, + 298 + ], + [ + 301, + 302 + ], + [ + 303, + 305 + ], + [ + 311, + 313 + ], + [ + 315, + 318 + ], + [ + 319, + 320 + ], + [ + 321, + 324 + ], + [ + 325, + 326 + ], + [ + 329, + 330 + ], + [ + 344, + 345 + ], + [ + 358, + 359 + ], + [ + 363, + 366 + ], + [ + 367, + 368 + ] + ] + } + }, + { + "filename": "libvips/morphology/pmorphology.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 38, + 57 + ], + [ + 58, + 64 + ], + [ + 65, + 75 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 41, + 53 + ], + [ + 68, + 69 + ] + ] + } + }, + { + "filename": "libvips/morphology/rank.c", + "line_filter": { + "diff_chunks": [ + [ + 2, + 20 + ], + [ + 32, + 60 + ], + [ + 81, + 88 + ], + [ + 89, + 96 + ], + [ + 106, + 204 + ], + [ + 205, + 235 + ], + [ + 243, + 439 + ], + [ + 447, + 596 + ], + [ + 606, + 644 + ], + [ + 656, + 671 + ] + ], + "lines_added": [ + [ + 5, + 6 + ], + [ + 9, + 10 + ], + [ + 16, + 17 + ], + [ + 35, + 36 + ], + [ + 37, + 41 + ], + [ + 42, + 51 + ], + [ + 56, + 57 + ], + [ + 84, + 85 + ], + [ + 92, + 93 + ], + [ + 109, + 110 + ], + [ + 114, + 116 + ], + [ + 117, + 119 + ], + [ + 121, + 123 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 130, + 131 + ], + [ + 136, + 138 + ], + [ + 142, + 147 + ], + [ + 149, + 150 + ], + [ + 152, + 156 + ], + [ + 158, + 163 + ], + [ + 166, + 167 + ], + [ + 172, + 174 + ], + [ + 176, + 178 + ], + [ + 182, + 186 + ], + [ + 187, + 188 + ], + [ + 191, + 192 + ], + [ + 195, + 197 + ], + [ + 198, + 201 + ], + [ + 208, + 210 + ], + [ + 213, + 214 + ], + [ + 219, + 220 + ], + [ + 221, + 222 + ], + [ + 226, + 228 + ], + [ + 231, + 232 + ], + [ + 246, + 262 + ], + [ + 263, + 287 + ], + [ + 288, + 328 + ], + [ + 330, + 332 + ], + [ + 333, + 334 + ], + [ + 337, + 358 + ], + [ + 359, + 361 + ], + [ + 362, + 363 + ], + [ + 366, + 387 + ], + [ + 388, + 390 + ], + [ + 391, + 392 + ], + [ + 393, + 420 + ], + [ + 422, + 423 + ], + [ + 425, + 427 + ], + [ + 428, + 429 + ], + [ + 434, + 436 + ], + [ + 450, + 466 + ], + [ + 469, + 470 + ], + [ + 471, + 473 + ], + [ + 474, + 475 + ], + [ + 478, + 480 + ], + [ + 481, + 482 + ], + [ + 483, + 485 + ], + [ + 487, + 493 + ], + [ + 495, + 498 + ], + [ + 502, + 504 + ], + [ + 506, + 507 + ], + [ + 508, + 509 + ], + [ + 510, + 511 + ], + [ + 514, + 515 + ], + [ + 516, + 522 + ], + [ + 524, + 525 + ], + [ + 529, + 532 + ], + [ + 535, + 541 + ], + [ + 545, + 546 + ], + [ + 547, + 548 + ], + [ + 551, + 552 + ], + [ + 553, + 554 + ], + [ + 560, + 561 + ], + [ + 563, + 568 + ], + [ + 569, + 572 + ], + [ + 573, + 575 + ], + [ + 576, + 579 + ], + [ + 580, + 582 + ], + [ + 583, + 586 + ], + [ + 587, + 589 + ], + [ + 592, + 593 + ], + [ + 609, + 611 + ], + [ + 613, + 616 + ], + [ + 622, + 623 + ], + [ + 629, + 632 + ], + [ + 636, + 639 + ], + [ + 640, + 641 + ], + [ + 659, + 660 + ], + [ + 664, + 668 + ], + [ + 669, + 670 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/chkpair.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5 + ], + [ + 21, + 49 + ], + [ + 67, + 79 + ], + [ + 84, + 109 + ], + [ + 114, + 121 + ], + [ + 124, + 142 + ], + [ + 143, + 189 + ], + [ + 193, + 220 + ], + [ + 223, + 234 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 24, + 25 + ], + [ + 26, + 30 + ], + [ + 31, + 40 + ], + [ + 45, + 46 + ], + [ + 70, + 71 + ], + [ + 75, + 76 + ], + [ + 87, + 88 + ], + [ + 92, + 94 + ], + [ + 96, + 97 + ], + [ + 100, + 101 + ], + [ + 105, + 106 + ], + [ + 117, + 118 + ], + [ + 127, + 128 + ], + [ + 131, + 139 + ], + [ + 146, + 150 + ], + [ + 153, + 157 + ], + [ + 163, + 166 + ], + [ + 170, + 173 + ], + [ + 174, + 175 + ], + [ + 181, + 182 + ], + [ + 184, + 186 + ], + [ + 196, + 202 + ], + [ + 203, + 206 + ], + [ + 208, + 209 + ], + [ + 211, + 217 + ], + [ + 226, + 227 + ], + [ + 228, + 229 + ], + [ + 232, + 233 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/global_balance.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 8 + ], + [ + 64, + 92 + ], + [ + 134, + 237 + ], + [ + 238, + 250 + ], + [ + 255, + 317 + ], + [ + 320, + 426 + ], + [ + 431, + 501 + ], + [ + 519, + 532 + ], + [ + 537, + 561 + ], + [ + 565, + 593 + ], + [ + 598, + 633 + ], + [ + 640, + 812 + ], + [ + 813, + 878 + ], + [ + 880, + 924 + ], + [ + 925, + 946 + ], + [ + 947, + 966 + ], + [ + 967, + 994 + ], + [ + 995, + 1122 + ], + [ + 1135, + 1228 + ], + [ + 1229, + 1316 + ], + [ + 1321, + 1388 + ], + [ + 1389, + 1463 + ], + [ + 1464, + 1514 + ], + [ + 1516, + 1547 + ], + [ + 1552, + 1568 + ], + [ + 1569, + 1863 + ], + [ + 1872, + 1948 + ], + [ + 1951, + 1964 + ], + [ + 1971, + 1981 + ], + [ + 1985, + 2000 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 67, + 73 + ], + [ + 74, + 78 + ], + [ + 79, + 83 + ], + [ + 88, + 89 + ], + [ + 137, + 138 + ], + [ + 142, + 143 + ], + [ + 145, + 146 + ], + [ + 150, + 153 + ], + [ + 159, + 162 + ], + [ + 164, + 165 + ], + [ + 170, + 171 + ], + [ + 175, + 176 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 182, + 185 + ], + [ + 187, + 188 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 198, + 199 + ], + [ + 204, + 205 + ], + [ + 208, + 209 + ], + [ + 210, + 211 + ], + [ + 213, + 214 + ], + [ + 219, + 220 + ], + [ + 221, + 223 + ], + [ + 226, + 228 + ], + [ + 233, + 234 + ], + [ + 241, + 243 + ], + [ + 246, + 247 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 266, + 267 + ], + [ + 268, + 269 + ], + [ + 270, + 272 + ], + [ + 278, + 279 + ], + [ + 281, + 282 + ], + [ + 285, + 286 + ], + [ + 289, + 291 + ], + [ + 295, + 297 + ], + [ + 299, + 301 + ], + [ + 306, + 307 + ], + [ + 308, + 309 + ], + [ + 311, + 314 + ], + [ + 323, + 325 + ], + [ + 326, + 327 + ], + [ + 329, + 330 + ], + [ + 335, + 336 + ], + [ + 337, + 339 + ], + [ + 340, + 341 + ], + [ + 346, + 347 + ], + [ + 348, + 350 + ], + [ + 356, + 357 + ], + [ + 360, + 363 + ], + [ + 364, + 365 + ], + [ + 367, + 368 + ], + [ + 370, + 371 + ], + [ + 374, + 380 + ], + [ + 385, + 387 + ], + [ + 389, + 390 + ], + [ + 395, + 396 + ], + [ + 397, + 399 + ], + [ + 401, + 402 + ], + [ + 405, + 406 + ], + [ + 409, + 410 + ], + [ + 416, + 418 + ], + [ + 422, + 423 + ], + [ + 434, + 435 + ], + [ + 439, + 440 + ], + [ + 444, + 445 + ], + [ + 451, + 452 + ], + [ + 455, + 456 + ], + [ + 457, + 459 + ], + [ + 460, + 464 + ], + [ + 469, + 472 + ], + [ + 475, + 477 + ], + [ + 478, + 479 + ], + [ + 482, + 483 + ], + [ + 486, + 489 + ], + [ + 494, + 498 + ], + [ + 522, + 525 + ], + [ + 528, + 529 + ], + [ + 540, + 543 + ], + [ + 544, + 545 + ], + [ + 550, + 551 + ], + [ + 554, + 558 + ], + [ + 568, + 569 + ], + [ + 570, + 571 + ], + [ + 576, + 577 + ], + [ + 581, + 582 + ], + [ + 586, + 587 + ], + [ + 588, + 590 + ], + [ + 601, + 607 + ], + [ + 609, + 617 + ], + [ + 619, + 620 + ], + [ + 624, + 627 + ], + [ + 628, + 630 + ], + [ + 643, + 649 + ], + [ + 651, + 661 + ], + [ + 663, + 664 + ], + [ + 668, + 671 + ], + [ + 672, + 673 + ], + [ + 679, + 685 + ], + [ + 687, + 691 + ], + [ + 693, + 694 + ], + [ + 699, + 700 + ], + [ + 701, + 702 + ], + [ + 703, + 704 + ], + [ + 705, + 707 + ], + [ + 712, + 713 + ], + [ + 714, + 716 + ], + [ + 717, + 718 + ], + [ + 723, + 724 + ], + [ + 729, + 731 + ], + [ + 734, + 736 + ], + [ + 739, + 744 + ], + [ + 750, + 754 + ], + [ + 756, + 757 + ], + [ + 762, + 763 + ], + [ + 766, + 767 + ], + [ + 769, + 770 + ], + [ + 771, + 773 + ], + [ + 777, + 779 + ], + [ + 780, + 781 + ], + [ + 786, + 787 + ], + [ + 788, + 789 + ], + [ + 793, + 794 + ], + [ + 800, + 801 + ], + [ + 802, + 804 + ], + [ + 807, + 809 + ], + [ + 816, + 817 + ], + [ + 818, + 820 + ], + [ + 821, + 822 + ], + [ + 828, + 829 + ], + [ + 830, + 831 + ], + [ + 833, + 834 + ], + [ + 836, + 837 + ], + [ + 843, + 844 + ], + [ + 847, + 849 + ], + [ + 854, + 855 + ], + [ + 856, + 869 + ], + [ + 871, + 872 + ], + [ + 874, + 875 + ], + [ + 883, + 884 + ], + [ + 885, + 886 + ], + [ + 887, + 888 + ], + [ + 892, + 895 + ], + [ + 897, + 904 + ], + [ + 907, + 910 + ], + [ + 913, + 915 + ], + [ + 918, + 919 + ], + [ + 920, + 921 + ], + [ + 928, + 929 + ], + [ + 930, + 934 + ], + [ + 936, + 938 + ], + [ + 939, + 943 + ], + [ + 950, + 951 + ], + [ + 953, + 960 + ], + [ + 962, + 963 + ], + [ + 970, + 971 + ], + [ + 972, + 975 + ], + [ + 977, + 978 + ], + [ + 984, + 986 + ], + [ + 988, + 991 + ], + [ + 998, + 999 + ], + [ + 1001, + 1009 + ], + [ + 1011, + 1012 + ], + [ + 1018, + 1019 + ], + [ + 1020, + 1022 + ], + [ + 1028, + 1031 + ], + [ + 1032, + 1045 + ], + [ + 1050, + 1051 + ], + [ + 1054, + 1057 + ], + [ + 1058, + 1059 + ], + [ + 1065, + 1067 + ], + [ + 1068, + 1070 + ], + [ + 1075, + 1082 + ], + [ + 1085, + 1087 + ], + [ + 1090, + 1092 + ], + [ + 1095, + 1097 + ], + [ + 1101, + 1102 + ], + [ + 1104, + 1106 + ], + [ + 1108, + 1109 + ], + [ + 1114, + 1115 + ], + [ + 1117, + 1119 + ], + [ + 1138, + 1141 + ], + [ + 1144, + 1152 + ], + [ + 1157, + 1158 + ], + [ + 1159, + 1161 + ], + [ + 1162, + 1163 + ], + [ + 1168, + 1169 + ], + [ + 1175, + 1177 + ], + [ + 1180, + 1184 + ], + [ + 1187, + 1188 + ], + [ + 1190, + 1191 + ], + [ + 1192, + 1193 + ], + [ + 1195, + 1198 + ], + [ + 1201, + 1203 + ], + [ + 1204, + 1205 + ], + [ + 1207, + 1209 + ], + [ + 1213, + 1215 + ], + [ + 1216, + 1220 + ], + [ + 1221, + 1222 + ], + [ + 1224, + 1225 + ], + [ + 1232, + 1233 + ], + [ + 1234, + 1235 + ], + [ + 1237, + 1241 + ], + [ + 1242, + 1244 + ], + [ + 1245, + 1247 + ], + [ + 1248, + 1250 + ], + [ + 1255, + 1260 + ], + [ + 1265, + 1266 + ], + [ + 1267, + 1269 + ], + [ + 1270, + 1272 + ], + [ + 1275, + 1276 + ], + [ + 1281, + 1282 + ], + [ + 1283, + 1285 + ], + [ + 1286, + 1288 + ], + [ + 1291, + 1292 + ], + [ + 1297, + 1298 + ], + [ + 1299, + 1302 + ], + [ + 1303, + 1307 + ], + [ + 1312, + 1313 + ], + [ + 1324, + 1325 + ], + [ + 1330, + 1331 + ], + [ + 1332, + 1336 + ], + [ + 1341, + 1342 + ], + [ + 1345, + 1346 + ], + [ + 1348, + 1360 + ], + [ + 1365, + 1368 + ], + [ + 1370, + 1371 + ], + [ + 1372, + 1373 + ], + [ + 1374, + 1379 + ], + [ + 1381, + 1385 + ], + [ + 1392, + 1394 + ], + [ + 1400, + 1401 + ], + [ + 1405, + 1406 + ], + [ + 1407, + 1408 + ], + [ + 1410, + 1411 + ], + [ + 1413, + 1414 + ], + [ + 1416, + 1417 + ], + [ + 1422, + 1423 + ], + [ + 1425, + 1438 + ], + [ + 1439, + 1440 + ], + [ + 1445, + 1454 + ], + [ + 1456, + 1460 + ], + [ + 1467, + 1470 + ], + [ + 1476, + 1479 + ], + [ + 1483, + 1484 + ], + [ + 1487, + 1488 + ], + [ + 1491, + 1492 + ], + [ + 1497, + 1499 + ], + [ + 1502, + 1505 + ], + [ + 1506, + 1507 + ], + [ + 1510, + 1511 + ], + [ + 1519, + 1522 + ], + [ + 1526, + 1528 + ], + [ + 1531, + 1533 + ], + [ + 1534, + 1536 + ], + [ + 1537, + 1538 + ], + [ + 1543, + 1544 + ], + [ + 1555, + 1556 + ], + [ + 1561, + 1562 + ], + [ + 1563, + 1565 + ], + [ + 1572, + 1575 + ], + [ + 1576, + 1577 + ], + [ + 1579, + 1581 + ], + [ + 1585, + 1591 + ], + [ + 1594, + 1598 + ], + [ + 1603, + 1604 + ], + [ + 1606, + 1607 + ], + [ + 1612, + 1615 + ], + [ + 1616, + 1620 + ], + [ + 1622, + 1626 + ], + [ + 1628, + 1629 + ], + [ + 1634, + 1635 + ], + [ + 1637, + 1638 + ], + [ + 1641, + 1642 + ], + [ + 1643, + 1644 + ], + [ + 1650, + 1658 + ], + [ + 1659, + 1660 + ], + [ + 1662, + 1666 + ], + [ + 1669, + 1671 + ], + [ + 1672, + 1673 + ], + [ + 1678, + 1679 + ], + [ + 1680, + 1681 + ], + [ + 1683, + 1687 + ], + [ + 1688, + 1690 + ], + [ + 1694, + 1695 + ], + [ + 1698, + 1699 + ], + [ + 1700, + 1702 + ], + [ + 1705, + 1706 + ], + [ + 1711, + 1712 + ], + [ + 1715, + 1717 + ], + [ + 1718, + 1720 + ], + [ + 1721, + 1727 + ], + [ + 1731, + 1734 + ], + [ + 1737, + 1739 + ], + [ + 1740, + 1741 + ], + [ + 1742, + 1744 + ], + [ + 1748, + 1750 + ], + [ + 1754, + 1760 + ], + [ + 1762, + 1763 + ], + [ + 1769, + 1770 + ], + [ + 1775, + 1776 + ], + [ + 1779, + 1780 + ], + [ + 1784, + 1785 + ], + [ + 1786, + 1789 + ], + [ + 1792, + 1800 + ], + [ + 1805, + 1808 + ], + [ + 1811, + 1812 + ], + [ + 1813, + 1814 + ], + [ + 1819, + 1820 + ], + [ + 1824, + 1826 + ], + [ + 1829, + 1830 + ], + [ + 1834, + 1837 + ], + [ + 1840, + 1847 + ], + [ + 1852, + 1854 + ], + [ + 1857, + 1858 + ], + [ + 1859, + 1860 + ], + [ + 1875, + 1876 + ], + [ + 1878, + 1879 + ], + [ + 1885, + 1886 + ], + [ + 1887, + 1889 + ], + [ + 1890, + 1894 + ], + [ + 1895, + 1899 + ], + [ + 1900, + 1901 + ], + [ + 1904, + 1905 + ], + [ + 1906, + 1907 + ], + [ + 1913, + 1914 + ], + [ + 1916, + 1931 + ], + [ + 1932, + 1934 + ], + [ + 1935, + 1938 + ], + [ + 1939, + 1941 + ], + [ + 1944, + 1945 + ], + [ + 1954, + 1955 + ], + [ + 1960, + 1961 + ], + [ + 1974, + 1976 + ], + [ + 1977, + 1978 + ], + [ + 1988, + 1990 + ], + [ + 1994, + 1997 + ], + [ + 1998, + 1999 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/global_balance.h", + "line_filter": { + "diff_chunks": [ + [ + 6, + 34 + ], + [ + 42, + 85 + ], + [ + 88, + 104 + ], + [ + 106, + 128 + ] + ], + "lines_added": [ + [ + 9, + 25 + ], + [ + 30, + 31 + ], + [ + 45, + 46 + ], + [ + 50, + 56 + ], + [ + 62, + 67 + ], + [ + 72, + 76 + ], + [ + 81, + 82 + ], + [ + 91, + 94 + ], + [ + 100, + 101 + ], + [ + 109, + 110 + ], + [ + 111, + 112 + ], + [ + 113, + 116 + ], + [ + 117, + 120 + ], + [ + 122, + 128 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_avgdxdy.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 13 + ], + [ + 18, + 46 + ], + [ + 55, + 83 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 21, + 27 + ], + [ + 28, + 32 + ], + [ + 33, + 37 + ], + [ + 42, + 43 + ], + [ + 58, + 60 + ], + [ + 64, + 67 + ], + [ + 73, + 74 + ], + [ + 78, + 80 + ], + [ + 81, + 82 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_clinear.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 16 + ], + [ + 25, + 53 + ], + [ + 63, + 71 + ], + [ + 87, + 101 + ], + [ + 107, + 173 + ], + [ + 175, + 180 + ] + ], + "lines_added": [ + [ + 12, + 13 + ], + [ + 28, + 34 + ], + [ + 35, + 39 + ], + [ + 40, + 44 + ], + [ + 49, + 50 + ], + [ + 66, + 68 + ], + [ + 90, + 95 + ], + [ + 97, + 98 + ], + [ + 110, + 114 + ], + [ + 115, + 119 + ], + [ + 120, + 124 + ], + [ + 125, + 129 + ], + [ + 135, + 140 + ], + [ + 142, + 146 + ], + [ + 147, + 152 + ], + [ + 154, + 157 + ], + [ + 160, + 161 + ], + [ + 162, + 164 + ], + [ + 166, + 167 + ], + [ + 169, + 170 + ], + [ + 178, + 179 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_improve.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 16 + ], + [ + 21, + 49 + ], + [ + 60, + 67 + ], + [ + 73, + 80 + ], + [ + 94, + 126 + ], + [ + 133, + 140 + ], + [ + 147, + 161 + ], + [ + 163, + 189 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 7, + 8 + ], + [ + 12, + 13 + ], + [ + 24, + 30 + ], + [ + 31, + 35 + ], + [ + 36, + 40 + ], + [ + 45, + 46 + ], + [ + 63, + 64 + ], + [ + 76, + 77 + ], + [ + 97, + 98 + ], + [ + 101, + 102 + ], + [ + 108, + 114 + ], + [ + 117, + 118 + ], + [ + 120, + 123 + ], + [ + 136, + 137 + ], + [ + 150, + 152 + ], + [ + 153, + 154 + ], + [ + 156, + 158 + ], + [ + 166, + 168 + ], + [ + 170, + 171 + ], + [ + 175, + 177 + ], + [ + 180, + 181 + ], + [ + 185, + 186 + ], + [ + 187, + 188 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_initialize.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 28 + ], + [ + 37, + 47 + ], + [ + 59, + 97 + ], + [ + 98, + 103 + ] + ], + "lines_added": [ + [ + 3, + 19 + ], + [ + 24, + 25 + ], + [ + 40, + 42 + ], + [ + 43, + 44 + ], + [ + 62, + 64 + ], + [ + 70, + 72 + ], + [ + 77, + 80 + ], + [ + 84, + 85 + ], + [ + 89, + 90 + ], + [ + 92, + 94 + ], + [ + 101, + 102 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_lrcalcon.c", + "line_filter": { + "diff_chunks": [ + [ + 24, + 33 + ], + [ + 44, + 51 + ], + [ + 53, + 81 + ], + [ + 102, + 109 + ], + [ + 114, + 140 + ], + [ + 144, + 188 + ], + [ + 201, + 237 + ], + [ + 240, + 272 + ], + [ + 284, + 295 + ], + [ + 298, + 319 + ] + ], + "lines_added": [ + [ + 27, + 28 + ], + [ + 29, + 30 + ], + [ + 47, + 48 + ], + [ + 56, + 57 + ], + [ + 58, + 62 + ], + [ + 63, + 72 + ], + [ + 77, + 78 + ], + [ + 105, + 106 + ], + [ + 117, + 121 + ], + [ + 123, + 124 + ], + [ + 128, + 129 + ], + [ + 133, + 134 + ], + [ + 135, + 137 + ], + [ + 147, + 149 + ], + [ + 151, + 152 + ], + [ + 155, + 156 + ], + [ + 162, + 163 + ], + [ + 168, + 169 + ], + [ + 173, + 174 + ], + [ + 176, + 177 + ], + [ + 178, + 180 + ], + [ + 181, + 183 + ], + [ + 184, + 185 + ], + [ + 204, + 208 + ], + [ + 211, + 212 + ], + [ + 213, + 215 + ], + [ + 218, + 220 + ], + [ + 225, + 226 + ], + [ + 232, + 234 + ], + [ + 243, + 249 + ], + [ + 253, + 254 + ], + [ + 257, + 258 + ], + [ + 262, + 263 + ], + [ + 264, + 265 + ], + [ + 267, + 269 + ], + [ + 287, + 292 + ], + [ + 301, + 302 + ], + [ + 307, + 318 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/im_tbcalcon.c", + "line_filter": { + "diff_chunks": [ + [ + 14, + 28 + ], + [ + 41, + 69 + ], + [ + 79, + 87 + ], + [ + 99, + 110 + ], + [ + 112, + 137 + ] + ], + "lines_added": [ + [ + 17, + 18 + ], + [ + 24, + 25 + ], + [ + 44, + 50 + ], + [ + 51, + 55 + ], + [ + 56, + 60 + ], + [ + 65, + 66 + ], + [ + 82, + 84 + ], + [ + 102, + 107 + ], + [ + 115, + 116 + ], + [ + 118, + 121 + ], + [ + 125, + 136 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/lrmerge.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 89, + 117 + ], + [ + 143, + 327 + ], + [ + 332, + 357 + ], + [ + 372, + 412 + ], + [ + 415, + 423 + ], + [ + 425, + 587 + ], + [ + 591, + 599 + ], + [ + 608, + 677 + ], + [ + 680, + 688 + ], + [ + 697, + 714 + ], + [ + 720, + 794 + ], + [ + 798, + 827 + ], + [ + 837, + 881 + ], + [ + 884, + 892 + ], + [ + 899, + 927 + ], + [ + 931, + 957 + ], + [ + 961, + 1025 + ], + [ + 1030, + 1072 + ], + [ + 1073, + 1191 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 3, + 4 + ], + [ + 92, + 93 + ], + [ + 94, + 98 + ], + [ + 99, + 108 + ], + [ + 113, + 114 + ], + [ + 146, + 147 + ], + [ + 150, + 151 + ], + [ + 156, + 158 + ], + [ + 161, + 169 + ], + [ + 171, + 172 + ], + [ + 177, + 178 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 192, + 193 + ], + [ + 197, + 205 + ], + [ + 206, + 237 + ], + [ + 239, + 241 + ], + [ + 247, + 248 + ], + [ + 253, + 254 + ], + [ + 255, + 256 + ], + [ + 262, + 263 + ], + [ + 267, + 275 + ], + [ + 276, + 307 + ], + [ + 309, + 311 + ], + [ + 317, + 318 + ], + [ + 323, + 324 + ], + [ + 335, + 336 + ], + [ + 340, + 341 + ], + [ + 344, + 345 + ], + [ + 349, + 350 + ], + [ + 352, + 354 + ], + [ + 375, + 380 + ], + [ + 384, + 388 + ], + [ + 392, + 394 + ], + [ + 400, + 401 + ], + [ + 403, + 409 + ], + [ + 418, + 420 + ], + [ + 428, + 429 + ], + [ + 430, + 431 + ], + [ + 435, + 446 + ], + [ + 449, + 473 + ], + [ + 474, + 513 + ], + [ + 516, + 540 + ], + [ + 541, + 579 + ], + [ + 583, + 584 + ], + [ + 594, + 596 + ], + [ + 611, + 614 + ], + [ + 617, + 622 + ], + [ + 628, + 653 + ], + [ + 654, + 656 + ], + [ + 657, + 659 + ], + [ + 662, + 663 + ], + [ + 666, + 667 + ], + [ + 672, + 674 + ], + [ + 683, + 685 + ], + [ + 700, + 703 + ], + [ + 706, + 711 + ], + [ + 723, + 725 + ], + [ + 728, + 729 + ], + [ + 732, + 733 + ], + [ + 735, + 736 + ], + [ + 739, + 740 + ], + [ + 741, + 742 + ], + [ + 748, + 751 + ], + [ + 753, + 754 + ], + [ + 756, + 757 + ], + [ + 763, + 769 + ], + [ + 772, + 787 + ], + [ + 789, + 791 + ], + [ + 801, + 805 + ], + [ + 806, + 807 + ], + [ + 808, + 812 + ], + [ + 813, + 814 + ], + [ + 815, + 819 + ], + [ + 823, + 824 + ], + [ + 840, + 841 + ], + [ + 844, + 845 + ], + [ + 848, + 853 + ], + [ + 857, + 859 + ], + [ + 860, + 861 + ], + [ + 866, + 868 + ], + [ + 869, + 870 + ], + [ + 871, + 874 + ], + [ + 877, + 878 + ], + [ + 887, + 889 + ], + [ + 902, + 907 + ], + [ + 913, + 914 + ], + [ + 916, + 918 + ], + [ + 923, + 924 + ], + [ + 934, + 936 + ], + [ + 939, + 941 + ], + [ + 942, + 943 + ], + [ + 945, + 947 + ], + [ + 952, + 954 + ], + [ + 964, + 966 + ], + [ + 967, + 968 + ], + [ + 974, + 976 + ], + [ + 979, + 980 + ], + [ + 982, + 983 + ], + [ + 984, + 986 + ], + [ + 987, + 988 + ], + [ + 990, + 993 + ], + [ + 994, + 997 + ], + [ + 999, + 1003 + ], + [ + 1009, + 1022 + ], + [ + 1033, + 1036 + ], + [ + 1038, + 1039 + ], + [ + 1045, + 1046 + ], + [ + 1049, + 1055 + ], + [ + 1056, + 1057 + ], + [ + 1062, + 1063 + ], + [ + 1067, + 1069 + ], + [ + 1076, + 1077 + ], + [ + 1079, + 1086 + ], + [ + 1089, + 1091 + ], + [ + 1092, + 1095 + ], + [ + 1097, + 1098 + ], + [ + 1101, + 1103 + ], + [ + 1107, + 1112 + ], + [ + 1114, + 1115 + ], + [ + 1118, + 1119 + ], + [ + 1123, + 1130 + ], + [ + 1131, + 1132 + ], + [ + 1136, + 1137 + ], + [ + 1139, + 1141 + ], + [ + 1142, + 1145 + ], + [ + 1151, + 1155 + ], + [ + 1156, + 1157 + ], + [ + 1160, + 1161 + ], + [ + 1164, + 1167 + ], + [ + 1168, + 1169 + ], + [ + 1171, + 1172 + ], + [ + 1175, + 1176 + ], + [ + 1181, + 1182 + ], + [ + 1188, + 1190 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/lrmosaic.c", + "line_filter": { + "diff_chunks": [ + [ + 31, + 59 + ], + [ + 75, + 89 + ], + [ + 91, + 114 + ], + [ + 117, + 127 + ], + [ + 136, + 179 + ], + [ + 181, + 193 + ], + [ + 198, + 231 + ], + [ + 238, + 253 + ], + [ + 257, + 285 + ] + ], + "lines_added": [ + [ + 34, + 50 + ], + [ + 55, + 56 + ], + [ + 78, + 79 + ], + [ + 85, + 86 + ], + [ + 94, + 98 + ], + [ + 101, + 105 + ], + [ + 107, + 108 + ], + [ + 110, + 111 + ], + [ + 120, + 124 + ], + [ + 139, + 145 + ], + [ + 149, + 162 + ], + [ + 163, + 169 + ], + [ + 171, + 173 + ], + [ + 175, + 176 + ], + [ + 184, + 185 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 201, + 202 + ], + [ + 203, + 206 + ], + [ + 209, + 212 + ], + [ + 215, + 217 + ], + [ + 218, + 219 + ], + [ + 220, + 223 + ], + [ + 226, + 228 + ], + [ + 241, + 242 + ], + [ + 244, + 248 + ], + [ + 249, + 250 + ], + [ + 260, + 268 + ], + [ + 269, + 270 + ], + [ + 273, + 280 + ], + [ + 281, + 282 + ], + [ + 283, + 284 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/match.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 44, + 86 + ], + [ + 105, + 115 + ], + [ + 116, + 147 + ], + [ + 148, + 302 + ], + [ + 316, + 352 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 47, + 51 + ], + [ + 52, + 61 + ], + [ + 63, + 67 + ], + [ + 69, + 77 + ], + [ + 78, + 81 + ], + [ + 82, + 83 + ], + [ + 108, + 109 + ], + [ + 111, + 112 + ], + [ + 119, + 120 + ], + [ + 121, + 123 + ], + [ + 124, + 126 + ], + [ + 127, + 128 + ], + [ + 131, + 136 + ], + [ + 139, + 144 + ], + [ + 151, + 155 + ], + [ + 158, + 170 + ], + [ + 171, + 172 + ], + [ + 173, + 176 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 183, + 184 + ], + [ + 185, + 186 + ], + [ + 192, + 193 + ], + [ + 195, + 204 + ], + [ + 205, + 212 + ], + [ + 213, + 216 + ], + [ + 217, + 219 + ], + [ + 220, + 223 + ], + [ + 224, + 226 + ], + [ + 227, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 237 + ], + [ + 238, + 240 + ], + [ + 241, + 244 + ], + [ + 245, + 247 + ], + [ + 248, + 251 + ], + [ + 252, + 254 + ], + [ + 255, + 258 + ], + [ + 259, + 261 + ], + [ + 262, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 275 + ], + [ + 276, + 279 + ], + [ + 280, + 282 + ], + [ + 283, + 289 + ], + [ + 290, + 295 + ], + [ + 298, + 299 + ], + [ + 319, + 320 + ], + [ + 324, + 325 + ], + [ + 329, + 330 + ], + [ + 331, + 332 + ], + [ + 338, + 341 + ], + [ + 345, + 349 + ], + [ + 350, + 351 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/matrixinvert.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 34 + ], + [ + 66, + 92 + ], + [ + 96, + 160 + ], + [ + 161, + 202 + ], + [ + 203, + 218 + ], + [ + 225, + 232 + ], + [ + 233, + 448 + ], + [ + 459, + 473 + ] + ], + "lines_added": [ + [ + 2, + 3 + ], + [ + 9, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 30, + 31 + ], + [ + 69, + 70 + ], + [ + 72, + 73 + ], + [ + 76, + 78 + ], + [ + 79, + 80 + ], + [ + 82, + 83 + ], + [ + 88, + 89 + ], + [ + 99, + 101 + ], + [ + 102, + 103 + ], + [ + 109, + 110 + ], + [ + 115, + 116 + ], + [ + 120, + 123 + ], + [ + 125, + 128 + ], + [ + 131, + 133 + ], + [ + 134, + 135 + ], + [ + 137, + 139 + ], + [ + 141, + 142 + ], + [ + 145, + 150 + ], + [ + 156, + 157 + ], + [ + 164, + 167 + ], + [ + 169, + 170 + ], + [ + 172, + 174 + ], + [ + 177, + 178 + ], + [ + 179, + 180 + ], + [ + 185, + 186 + ], + [ + 187, + 191 + ], + [ + 193, + 194 + ], + [ + 195, + 199 + ], + [ + 206, + 207 + ], + [ + 209, + 211 + ], + [ + 212, + 213 + ], + [ + 214, + 215 + ], + [ + 228, + 229 + ], + [ + 236, + 237 + ], + [ + 240, + 243 + ], + [ + 245, + 247 + ], + [ + 248, + 249 + ], + [ + 253, + 255 + ], + [ + 257, + 258 + ], + [ + 259, + 261 + ], + [ + 262, + 263 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 276, + 278 + ], + [ + 279, + 281 + ], + [ + 282, + 284 + ], + [ + 288, + 290 + ], + [ + 291, + 293 + ], + [ + 295, + 296 + ], + [ + 299, + 300 + ], + [ + 301, + 302 + ], + [ + 305, + 308 + ], + [ + 309, + 310 + ], + [ + 311, + 314 + ], + [ + 316, + 318 + ], + [ + 319, + 322 + ], + [ + 325, + 326 + ], + [ + 327, + 330 + ], + [ + 333, + 338 + ], + [ + 339, + 340 + ], + [ + 343, + 346 + ], + [ + 347, + 348 + ], + [ + 349, + 352 + ], + [ + 356, + 368 + ], + [ + 374, + 376 + ], + [ + 378, + 379 + ], + [ + 382, + 383 + ], + [ + 384, + 385 + ], + [ + 387, + 389 + ], + [ + 390, + 392 + ], + [ + 393, + 396 + ], + [ + 398, + 401 + ], + [ + 402, + 403 + ], + [ + 404, + 407 + ], + [ + 409, + 411 + ], + [ + 413, + 414 + ], + [ + 417, + 418 + ], + [ + 419, + 421 + ], + [ + 427, + 428 + ], + [ + 430, + 433 + ], + [ + 434, + 435 + ], + [ + 436, + 441 + ], + [ + 444, + 445 + ], + [ + 462, + 463 + ], + [ + 467, + 470 + ], + [ + 471, + 472 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/merge.c", + "line_filter": { + "diff_chunks": [ + [ + 8, + 36 + ], + [ + 58, + 171 + ], + [ + 178, + 208 + ], + [ + 211, + 228 + ] + ], + "lines_added": [ + [ + 11, + 27 + ], + [ + 32, + 33 + ], + [ + 61, + 62 + ], + [ + 64, + 65 + ], + [ + 68, + 69 + ], + [ + 70, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 78 + ], + [ + 81, + 84 + ], + [ + 90, + 101 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 108, + 109 + ], + [ + 114, + 115 + ], + [ + 119, + 122 + ], + [ + 123, + 124 + ], + [ + 125, + 128 + ], + [ + 129, + 130 + ], + [ + 131, + 143 + ], + [ + 144, + 164 + ], + [ + 167, + 168 + ], + [ + 181, + 182 + ], + [ + 184, + 185 + ], + [ + 189, + 191 + ], + [ + 194, + 196 + ], + [ + 200, + 201 + ], + [ + 203, + 205 + ], + [ + 214, + 217 + ], + [ + 221, + 225 + ], + [ + 226, + 227 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/mosaic.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 72, + 82 + ], + [ + 87, + 130 + ], + [ + 139, + 307 + ], + [ + 319, + 331 + ], + [ + 336, + 354 + ], + [ + 356, + 373 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 75, + 76 + ], + [ + 78, + 79 + ], + [ + 90, + 91 + ], + [ + 92, + 94 + ], + [ + 95, + 96 + ], + [ + 98, + 99 + ], + [ + 100, + 101 + ], + [ + 102, + 111 + ], + [ + 112, + 113 + ], + [ + 116, + 125 + ], + [ + 126, + 127 + ], + [ + 142, + 144 + ], + [ + 145, + 148 + ], + [ + 149, + 159 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 166, + 167 + ], + [ + 168, + 169 + ], + [ + 175, + 176 + ], + [ + 178, + 206 + ], + [ + 207, + 209 + ], + [ + 210, + 213 + ], + [ + 214, + 216 + ], + [ + 217, + 220 + ], + [ + 221, + 223 + ], + [ + 224, + 227 + ], + [ + 228, + 230 + ], + [ + 231, + 234 + ], + [ + 235, + 237 + ], + [ + 238, + 241 + ], + [ + 242, + 244 + ], + [ + 245, + 248 + ], + [ + 249, + 251 + ], + [ + 252, + 255 + ], + [ + 256, + 258 + ], + [ + 259, + 262 + ], + [ + 263, + 265 + ], + [ + 266, + 269 + ], + [ + 270, + 272 + ], + [ + 273, + 276 + ], + [ + 277, + 279 + ], + [ + 280, + 283 + ], + [ + 284, + 286 + ], + [ + 287, + 290 + ], + [ + 291, + 293 + ], + [ + 294, + 297 + ], + [ + 298, + 300 + ], + [ + 303, + 304 + ], + [ + 322, + 323 + ], + [ + 327, + 328 + ], + [ + 339, + 340 + ], + [ + 341, + 344 + ], + [ + 347, + 348 + ], + [ + 350, + 351 + ], + [ + 359, + 362 + ], + [ + 366, + 370 + ], + [ + 371, + 372 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/mosaic1.c", + "line_filter": { + "diff_chunks": [ + [ + 21, + 49 + ], + [ + 69, + 80 + ], + [ + 87, + 117 + ], + [ + 118, + 165 + ], + [ + 166, + 237 + ], + [ + 244, + 305 + ], + [ + 310, + 331 + ], + [ + 332, + 345 + ], + [ + 350, + 382 + ], + [ + 384, + 416 + ], + [ + 439, + 623 + ], + [ + 638, + 677 + ], + [ + 678, + 696 + ] + ], + "lines_added": [ + [ + 24, + 40 + ], + [ + 45, + 46 + ], + [ + 72, + 73 + ], + [ + 74, + 77 + ], + [ + 90, + 93 + ], + [ + 94, + 96 + ], + [ + 97, + 98 + ], + [ + 102, + 104 + ], + [ + 108, + 110 + ], + [ + 112, + 114 + ], + [ + 121, + 123 + ], + [ + 126, + 129 + ], + [ + 133, + 151 + ], + [ + 156, + 158 + ], + [ + 161, + 162 + ], + [ + 169, + 171 + ], + [ + 174, + 177 + ], + [ + 181, + 199 + ], + [ + 204, + 206 + ], + [ + 207, + 209 + ], + [ + 213, + 216 + ], + [ + 219, + 221 + ], + [ + 222, + 223 + ], + [ + 228, + 230 + ], + [ + 232, + 234 + ], + [ + 247, + 248 + ], + [ + 251, + 254 + ], + [ + 257, + 258 + ], + [ + 259, + 262 + ], + [ + 265, + 266 + ], + [ + 272, + 276 + ], + [ + 279, + 281 + ], + [ + 283, + 284 + ], + [ + 286, + 294 + ], + [ + 296, + 297 + ], + [ + 298, + 300 + ], + [ + 301, + 302 + ], + [ + 313, + 315 + ], + [ + 318, + 321 + ], + [ + 324, + 326 + ], + [ + 327, + 328 + ], + [ + 335, + 336 + ], + [ + 337, + 338 + ], + [ + 340, + 342 + ], + [ + 353, + 354 + ], + [ + 360, + 364 + ], + [ + 369, + 377 + ], + [ + 378, + 379 + ], + [ + 387, + 393 + ], + [ + 398, + 400 + ], + [ + 401, + 405 + ], + [ + 408, + 411 + ], + [ + 412, + 413 + ], + [ + 442, + 443 + ], + [ + 445, + 446 + ], + [ + 451, + 452 + ], + [ + 453, + 455 + ], + [ + 456, + 458 + ], + [ + 459, + 460 + ], + [ + 461, + 469 + ], + [ + 471, + 477 + ], + [ + 479, + 480 + ], + [ + 483, + 484 + ], + [ + 485, + 486 + ], + [ + 492, + 493 + ], + [ + 495, + 523 + ], + [ + 524, + 526 + ], + [ + 527, + 530 + ], + [ + 531, + 533 + ], + [ + 534, + 537 + ], + [ + 538, + 540 + ], + [ + 541, + 544 + ], + [ + 545, + 547 + ], + [ + 548, + 551 + ], + [ + 552, + 554 + ], + [ + 555, + 558 + ], + [ + 559, + 561 + ], + [ + 562, + 565 + ], + [ + 566, + 568 + ], + [ + 569, + 572 + ], + [ + 573, + 575 + ], + [ + 576, + 579 + ], + [ + 580, + 582 + ], + [ + 583, + 586 + ], + [ + 587, + 589 + ], + [ + 590, + 593 + ], + [ + 594, + 600 + ], + [ + 601, + 602 + ], + [ + 603, + 609 + ], + [ + 610, + 616 + ], + [ + 619, + 620 + ], + [ + 641, + 642 + ], + [ + 646, + 647 + ], + [ + 648, + 649 + ], + [ + 650, + 651 + ], + [ + 655, + 656 + ], + [ + 657, + 658 + ], + [ + 660, + 662 + ], + [ + 667, + 669 + ], + [ + 672, + 674 + ], + [ + 681, + 685 + ], + [ + 689, + 693 + ], + [ + 694, + 695 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/mosaicing.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 32 + ], + [ + 45, + 52 + ], + [ + 63, + 79 + ], + [ + 89, + 108 + ] + ], + "lines_added": [ + [ + 7, + 8 + ], + [ + 9, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 23 + ], + [ + 28, + 29 + ], + [ + 48, + 49 + ], + [ + 66, + 68 + ], + [ + 70, + 71 + ], + [ + 75, + 76 + ], + [ + 92, + 93 + ], + [ + 94, + 104 + ], + [ + 105, + 107 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/pmosaicing.h", + "line_filter": { + "diff_chunks": [ + [ + 1, + 9 + ], + [ + 11, + 39 + ], + [ + 42, + 49 + ], + [ + 51, + 64 + ], + [ + 71, + 89 + ], + [ + 93, + 103 + ], + [ + 107, + 202 + ] + ], + "lines_added": [ + [ + 1, + 2 + ], + [ + 5, + 6 + ], + [ + 14, + 15 + ], + [ + 16, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 30 + ], + [ + 35, + 36 + ], + [ + 45, + 46 + ], + [ + 54, + 56 + ], + [ + 60, + 61 + ], + [ + 74, + 76 + ], + [ + 77, + 78 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 96, + 97 + ], + [ + 99, + 100 + ], + [ + 110, + 111 + ], + [ + 112, + 114 + ], + [ + 115, + 116 + ], + [ + 117, + 125 + ], + [ + 126, + 130 + ], + [ + 131, + 137 + ], + [ + 138, + 140 + ], + [ + 142, + 151 + ], + [ + 152, + 153 + ], + [ + 155, + 156 + ], + [ + 162, + 163 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 176, + 189 + ], + [ + 191, + 195 + ], + [ + 197, + 199 + ], + [ + 201, + 202 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/remosaic.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 40 + ], + [ + 73, + 83 + ], + [ + 85, + 196 + ], + [ + 216, + 232 + ] + ], + "lines_added": [ + [ + 15, + 31 + ], + [ + 36, + 37 + ], + [ + 76, + 77 + ], + [ + 79, + 80 + ], + [ + 88, + 92 + ], + [ + 97, + 99 + ], + [ + 101, + 105 + ], + [ + 108, + 110 + ], + [ + 112, + 114 + ], + [ + 115, + 121 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 133, + 134 + ], + [ + 135, + 137 + ], + [ + 138, + 141 + ], + [ + 142, + 147 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ], + [ + 161, + 162 + ], + [ + 164, + 167 + ], + [ + 168, + 169 + ], + [ + 170, + 179 + ], + [ + 180, + 182 + ], + [ + 183, + 189 + ], + [ + 192, + 193 + ], + [ + 219, + 222 + ], + [ + 226, + 229 + ], + [ + 230, + 231 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/tbmerge.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 17 + ], + [ + 77, + 105 + ], + [ + 121, + 278 + ], + [ + 283, + 308 + ], + [ + 325, + 355 + ], + [ + 358, + 366 + ], + [ + 368, + 518 + ], + [ + 522, + 530 + ], + [ + 539, + 606 + ], + [ + 609, + 617 + ], + [ + 626, + 643 + ], + [ + 648, + 683 + ], + [ + 686, + 694 + ], + [ + 702, + 767 + ] + ], + "lines_added": [ + [ + 1, + 3 + ], + [ + 6, + 7 + ], + [ + 10, + 11 + ], + [ + 13, + 14 + ], + [ + 80, + 86 + ], + [ + 87, + 91 + ], + [ + 92, + 96 + ], + [ + 101, + 102 + ], + [ + 124, + 125 + ], + [ + 126, + 127 + ], + [ + 128, + 129 + ], + [ + 134, + 135 + ], + [ + 139, + 148 + ], + [ + 149, + 153 + ], + [ + 154, + 185 + ], + [ + 187, + 189 + ], + [ + 193, + 194 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 203, + 204 + ], + [ + 209, + 210 + ], + [ + 214, + 223 + ], + [ + 224, + 228 + ], + [ + 229, + 260 + ], + [ + 262, + 264 + ], + [ + 268, + 269 + ], + [ + 274, + 275 + ], + [ + 286, + 287 + ], + [ + 291, + 292 + ], + [ + 295, + 296 + ], + [ + 300, + 301 + ], + [ + 303, + 305 + ], + [ + 328, + 332 + ], + [ + 336, + 337 + ], + [ + 343, + 344 + ], + [ + 346, + 352 + ], + [ + 361, + 363 + ], + [ + 371, + 372 + ], + [ + 373, + 374 + ], + [ + 378, + 389 + ], + [ + 392, + 418 + ], + [ + 419, + 451 + ], + [ + 454, + 507 + ], + [ + 508, + 510 + ], + [ + 514, + 515 + ], + [ + 525, + 527 + ], + [ + 542, + 545 + ], + [ + 548, + 553 + ], + [ + 558, + 583 + ], + [ + 584, + 586 + ], + [ + 587, + 589 + ], + [ + 591, + 593 + ], + [ + 596, + 597 + ], + [ + 602, + 603 + ], + [ + 612, + 614 + ], + [ + 629, + 632 + ], + [ + 635, + 640 + ], + [ + 651, + 653 + ], + [ + 656, + 657 + ], + [ + 660, + 661 + ], + [ + 663, + 664 + ], + [ + 669, + 670 + ], + [ + 671, + 672 + ], + [ + 673, + 676 + ], + [ + 679, + 680 + ], + [ + 689, + 691 + ], + [ + 705, + 709 + ], + [ + 715, + 716 + ], + [ + 719, + 722 + ], + [ + 724, + 725 + ], + [ + 728, + 729 + ], + [ + 733, + 740 + ], + [ + 741, + 742 + ], + [ + 746, + 747 + ], + [ + 749, + 751 + ], + [ + 752, + 755 + ], + [ + 761, + 764 + ], + [ + 765, + 766 + ] + ] + } + }, + { + "filename": "libvips/mosaicing/tbmosaic.c", + "line_filter": { + "diff_chunks": [ + [ + 31, + 59 + ], + [ + 69, + 98 + ], + [ + 107, + 150 + ], + [ + 152, + 164 + ], + [ + 169, + 202 + ], + [ + 209, + 224 + ], + [ + 228, + 256 + ] + ], + "lines_added": [ + [ + 34, + 50 + ], + [ + 55, + 56 + ], + [ + 72, + 76 + ], + [ + 78, + 79 + ], + [ + 81, + 82 + ], + [ + 84, + 85 + ], + [ + 91, + 95 + ], + [ + 110, + 116 + ], + [ + 120, + 133 + ], + [ + 134, + 140 + ], + [ + 142, + 144 + ], + [ + 146, + 147 + ], + [ + 155, + 156 + ], + [ + 158, + 159 + ], + [ + 160, + 161 + ], + [ + 172, + 173 + ], + [ + 174, + 177 + ], + [ + 180, + 183 + ], + [ + 186, + 188 + ], + [ + 189, + 190 + ], + [ + 191, + 194 + ], + [ + 197, + 199 + ], + [ + 212, + 213 + ], + [ + 215, + 217 + ], + [ + 218, + 219 + ], + [ + 220, + 221 + ], + [ + 231, + 239 + ], + [ + 240, + 241 + ], + [ + 244, + 251 + ], + [ + 252, + 253 + ], + [ + 254, + 255 + ] + ] + } + }, + { + "filename": "libvips/resample/affine.c", + "line_filter": { + "diff_chunks": [ + [ + 45, + 56 + ], + [ + 87, + 122 + ], + [ + 176, + 251 + ], + [ + 254, + 272 + ], + [ + 275, + 282 + ], + [ + 286, + 317 + ], + [ + 338, + 386 + ], + [ + 389, + 412 + ], + [ + 415, + 447 + ], + [ + 455, + 527 + ], + [ + 529, + 544 + ], + [ + 550, + 595 + ], + [ + 597, + 706 + ], + [ + 720, + 728 + ], + [ + 731, + 783 + ] + ], + "lines_added": [ + [ + 48, + 49 + ], + [ + 52, + 53 + ], + [ + 90, + 91 + ], + [ + 97, + 98 + ], + [ + 99, + 103 + ], + [ + 104, + 113 + ], + [ + 118, + 119 + ], + [ + 179, + 180 + ], + [ + 184, + 185 + ], + [ + 187, + 188 + ], + [ + 191, + 192 + ], + [ + 193, + 196 + ], + [ + 201, + 202 + ], + [ + 208, + 209 + ], + [ + 213, + 214 + ], + [ + 218, + 224 + ], + [ + 227, + 228 + ], + [ + 229, + 230 + ], + [ + 231, + 232 + ], + [ + 236, + 237 + ], + [ + 238, + 239 + ], + [ + 242, + 244 + ], + [ + 247, + 248 + ], + [ + 257, + 258 + ], + [ + 259, + 260 + ], + [ + 264, + 265 + ], + [ + 268, + 269 + ], + [ + 278, + 279 + ], + [ + 289, + 290 + ], + [ + 292, + 294 + ], + [ + 297, + 298 + ], + [ + 300, + 303 + ], + [ + 304, + 306 + ], + [ + 307, + 308 + ], + [ + 311, + 312 + ], + [ + 313, + 314 + ], + [ + 341, + 342 + ], + [ + 346, + 347 + ], + [ + 351, + 352 + ], + [ + 353, + 355 + ], + [ + 356, + 358 + ], + [ + 361, + 362 + ], + [ + 364, + 365 + ], + [ + 368, + 369 + ], + [ + 370, + 373 + ], + [ + 374, + 376 + ], + [ + 377, + 378 + ], + [ + 382, + 383 + ], + [ + 392, + 393 + ], + [ + 394, + 395 + ], + [ + 396, + 397 + ], + [ + 400, + 401 + ], + [ + 402, + 404 + ], + [ + 405, + 406 + ], + [ + 408, + 409 + ], + [ + 418, + 420 + ], + [ + 421, + 430 + ], + [ + 431, + 432 + ], + [ + 433, + 435 + ], + [ + 441, + 444 + ], + [ + 458, + 460 + ], + [ + 463, + 464 + ], + [ + 465, + 466 + ], + [ + 472, + 473 + ], + [ + 474, + 475 + ], + [ + 477, + 478 + ], + [ + 479, + 480 + ], + [ + 483, + 486 + ], + [ + 489, + 491 + ], + [ + 497, + 498 + ], + [ + 499, + 504 + ], + [ + 506, + 508 + ], + [ + 513, + 514 + ], + [ + 516, + 524 + ], + [ + 532, + 534 + ], + [ + 537, + 541 + ], + [ + 553, + 558 + ], + [ + 559, + 560 + ], + [ + 562, + 566 + ], + [ + 569, + 571 + ], + [ + 576, + 584 + ], + [ + 588, + 592 + ], + [ + 600, + 604 + ], + [ + 607, + 609 + ], + [ + 610, + 611 + ], + [ + 614, + 615 + ], + [ + 616, + 618 + ], + [ + 619, + 620 + ], + [ + 625, + 626 + ], + [ + 628, + 631 + ], + [ + 632, + 638 + ], + [ + 639, + 640 + ], + [ + 641, + 644 + ], + [ + 645, + 647 + ], + [ + 648, + 651 + ], + [ + 652, + 654 + ], + [ + 655, + 658 + ], + [ + 659, + 661 + ], + [ + 662, + 665 + ], + [ + 666, + 668 + ], + [ + 669, + 672 + ], + [ + 673, + 675 + ], + [ + 676, + 679 + ], + [ + 680, + 682 + ], + [ + 683, + 686 + ], + [ + 687, + 689 + ], + [ + 690, + 696 + ], + [ + 699, + 700 + ], + [ + 702, + 703 + ], + [ + 723, + 725 + ], + [ + 734, + 737 + ], + [ + 742, + 744 + ], + [ + 746, + 748 + ], + [ + 750, + 751 + ], + [ + 756, + 757 + ], + [ + 759, + 760 + ], + [ + 766, + 768 + ], + [ + 773, + 774 + ], + [ + 775, + 778 + ], + [ + 779, + 780 + ], + [ + 781, + 782 + ] + ] + } + }, + { + "filename": "libvips/resample/interpolate.c", + "line_filter": { + "diff_chunks": [ + [ + 22, + 50 + ], + [ + 72, + 79 + ], + [ + 99, + 106 + ], + [ + 108, + 115 + ], + [ + 123, + 181 + ], + [ + 182, + 189 + ], + [ + 192, + 207 + ], + [ + 215, + 232 + ], + [ + 235, + 284 + ], + [ + 290, + 297 + ], + [ + 303, + 634 + ], + [ + 650, + 665 + ] + ], + "lines_added": [ + [ + 25, + 26 + ], + [ + 27, + 31 + ], + [ + 32, + 36 + ], + [ + 37, + 41 + ], + [ + 46, + 47 + ], + [ + 75, + 76 + ], + [ + 102, + 103 + ], + [ + 111, + 112 + ], + [ + 126, + 127 + ], + [ + 132, + 133 + ], + [ + 134, + 136 + ], + [ + 137, + 138 + ], + [ + 142, + 143 + ], + [ + 144, + 145 + ], + [ + 146, + 147 + ], + [ + 148, + 149 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ], + [ + 156, + 157 + ], + [ + 158, + 161 + ], + [ + 162, + 164 + ], + [ + 167, + 168 + ], + [ + 172, + 173 + ], + [ + 174, + 175 + ], + [ + 177, + 178 + ], + [ + 185, + 186 + ], + [ + 195, + 196 + ], + [ + 198, + 200 + ], + [ + 203, + 204 + ], + [ + 218, + 220 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 228, + 229 + ], + [ + 238, + 239 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 244, + 245 + ], + [ + 247, + 248 + ], + [ + 251, + 252 + ], + [ + 256, + 257 + ], + [ + 258, + 259 + ], + [ + 260, + 261 + ], + [ + 262, + 263 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 274, + 275 + ], + [ + 276, + 277 + ], + [ + 278, + 279 + ], + [ + 280, + 281 + ], + [ + 293, + 294 + ], + [ + 306, + 307 + ], + [ + 313, + 326 + ], + [ + 332, + 334 + ], + [ + 336, + 338 + ], + [ + 339, + 340 + ], + [ + 344, + 346 + ], + [ + 349, + 350 + ], + [ + 354, + 355 + ], + [ + 356, + 357 + ], + [ + 358, + 359 + ], + [ + 361, + 362 + ], + [ + 368, + 369 + ], + [ + 371, + 373 + ], + [ + 377, + 378 + ], + [ + 379, + 381 + ], + [ + 386, + 387 + ], + [ + 392, + 393 + ], + [ + 396, + 397 + ], + [ + 398, + 399 + ], + [ + 401, + 402 + ], + [ + 408, + 421 + ], + [ + 425, + 427 + ], + [ + 433, + 441 + ], + [ + 444, + 466 + ], + [ + 467, + 473 + ], + [ + 474, + 475 + ], + [ + 478, + 500 + ], + [ + 502, + 503 + ], + [ + 504, + 541 + ], + [ + 543, + 545 + ], + [ + 548, + 550 + ], + [ + 551, + 552 + ], + [ + 556, + 560 + ], + [ + 563, + 567 + ], + [ + 568, + 569 + ], + [ + 572, + 573 + ], + [ + 574, + 575 + ], + [ + 579, + 580 + ], + [ + 586, + 587 + ], + [ + 589, + 591 + ], + [ + 595, + 596 + ], + [ + 597, + 599 + ], + [ + 604, + 605 + ], + [ + 610, + 611 + ], + [ + 614, + 615 + ], + [ + 616, + 617 + ], + [ + 619, + 620 + ], + [ + 625, + 626 + ], + [ + 627, + 631 + ], + [ + 653, + 654 + ], + [ + 657, + 661 + ], + [ + 663, + 664 + ] + ] + } + }, + { + "filename": "libvips/resample/mapim.c", + "line_filter": { + "diff_chunks": [ + [ + 16, + 44 + ], + [ + 94, + 150 + ], + [ + 157, + 200 + ], + [ + 204, + 222 + ], + [ + 225, + 351 + ], + [ + 362, + 441 + ], + [ + 445, + 494 + ], + [ + 500, + 516 + ], + [ + 517, + 598 + ], + [ + 604, + 612 + ], + [ + 617, + 658 + ] + ], + "lines_added": [ + [ + 19, + 35 + ], + [ + 40, + 41 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 115 + ], + [ + 116, + 117 + ], + [ + 118, + 135 + ], + [ + 136, + 142 + ], + [ + 146, + 147 + ], + [ + 160, + 197 + ], + [ + 207, + 211 + ], + [ + 215, + 219 + ], + [ + 228, + 248 + ], + [ + 249, + 250 + ], + [ + 253, + 275 + ], + [ + 276, + 277 + ], + [ + 280, + 304 + ], + [ + 305, + 306 + ], + [ + 308, + 309 + ], + [ + 310, + 311 + ], + [ + 313, + 314 + ], + [ + 315, + 322 + ], + [ + 327, + 328 + ], + [ + 329, + 331 + ], + [ + 334, + 335 + ], + [ + 340, + 342 + ], + [ + 343, + 344 + ], + [ + 345, + 346 + ], + [ + 347, + 348 + ], + [ + 365, + 366 + ], + [ + 368, + 370 + ], + [ + 373, + 374 + ], + [ + 376, + 379 + ], + [ + 380, + 382 + ], + [ + 383, + 384 + ], + [ + 387, + 420 + ], + [ + 426, + 427 + ], + [ + 428, + 429 + ], + [ + 432, + 433 + ], + [ + 434, + 436 + ], + [ + 437, + 438 + ], + [ + 448, + 450 + ], + [ + 451, + 454 + ], + [ + 457, + 459 + ], + [ + 461, + 464 + ], + [ + 468, + 469 + ], + [ + 473, + 481 + ], + [ + 483, + 485 + ], + [ + 487, + 491 + ], + [ + 503, + 508 + ], + [ + 510, + 513 + ], + [ + 520, + 524 + ], + [ + 527, + 531 + ], + [ + 534, + 536 + ], + [ + 537, + 538 + ], + [ + 541, + 542 + ], + [ + 543, + 545 + ], + [ + 546, + 547 + ], + [ + 552, + 553 + ], + [ + 555, + 564 + ], + [ + 565, + 566 + ], + [ + 567, + 570 + ], + [ + 571, + 573 + ], + [ + 574, + 577 + ], + [ + 578, + 580 + ], + [ + 581, + 587 + ], + [ + 590, + 591 + ], + [ + 592, + 593 + ], + [ + 594, + 595 + ], + [ + 607, + 609 + ], + [ + 620, + 621 + ], + [ + 622, + 623 + ], + [ + 624, + 625 + ], + [ + 626, + 627 + ], + [ + 628, + 630 + ], + [ + 634, + 635 + ], + [ + 637, + 638 + ], + [ + 639, + 640 + ], + [ + 641, + 642 + ], + [ + 647, + 648 + ], + [ + 652, + 655 + ], + [ + 656, + 657 + ] + ] + } + }, + { + "filename": "libvips/resample/presample.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 36, + 55 + ], + [ + 63, + 81 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 39, + 51 + ], + [ + 66, + 67 + ], + [ + 72, + 75 + ] + ] + } + }, + { + "filename": "libvips/resample/quadratic.c", + "line_filter": { + "diff_chunks": [ + [ + 10, + 38 + ], + [ + 64, + 74 + ], + [ + 102, + 154 + ], + [ + 155, + 165 + ], + [ + 166, + 174 + ], + [ + 175, + 245 + ], + [ + 246, + 363 + ], + [ + 371, + 392 + ] + ], + "lines_added": [ + [ + 13, + 29 + ], + [ + 34, + 35 + ], + [ + 67, + 71 + ], + [ + 105, + 106 + ], + [ + 108, + 109 + ], + [ + 112, + 113 + ], + [ + 114, + 115 + ], + [ + 118, + 120 + ], + [ + 123, + 126 + ], + [ + 128, + 129 + ], + [ + 132, + 133 + ], + [ + 134, + 135 + ], + [ + 141, + 143 + ], + [ + 146, + 147 + ], + [ + 148, + 151 + ], + [ + 158, + 160 + ], + [ + 161, + 162 + ], + [ + 169, + 171 + ], + [ + 178, + 179 + ], + [ + 184, + 185 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 201, + 202 + ], + [ + 203, + 205 + ], + [ + 209, + 210 + ], + [ + 211, + 216 + ], + [ + 218, + 221 + ], + [ + 227, + 228 + ], + [ + 234, + 235 + ], + [ + 238, + 239 + ], + [ + 240, + 242 + ], + [ + 249, + 251 + ], + [ + 255, + 258 + ], + [ + 261, + 275 + ], + [ + 277, + 279 + ], + [ + 281, + 283 + ], + [ + 285, + 287 + ], + [ + 290, + 295 + ], + [ + 296, + 298 + ], + [ + 299, + 301 + ], + [ + 302, + 303 + ], + [ + 304, + 311 + ], + [ + 313, + 318 + ], + [ + 320, + 324 + ], + [ + 325, + 326 + ], + [ + 329, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 335 + ], + [ + 341, + 343 + ], + [ + 345, + 348 + ], + [ + 349, + 350 + ], + [ + 351, + 354 + ], + [ + 355, + 356 + ], + [ + 359, + 360 + ], + [ + 374, + 375 + ], + [ + 381, + 382 + ], + [ + 386, + 389 + ], + [ + 390, + 391 + ] + ] + } + }, + { + "filename": "libvips/resample/reduce.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 10 + ], + [ + 14, + 42 + ], + [ + 59, + 74 + ], + [ + 94, + 104 + ], + [ + 125, + 135 + ], + [ + 138, + 147 + ], + [ + 154, + 261 + ], + [ + 273, + 280 + ], + [ + 282, + 307 + ] + ], + "lines_added": [ + [ + 4, + 5 + ], + [ + 6, + 7 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 62, + 63 + ], + [ + 64, + 66 + ], + [ + 70, + 71 + ], + [ + 97, + 98 + ], + [ + 100, + 101 + ], + [ + 128, + 129 + ], + [ + 131, + 132 + ], + [ + 141, + 142 + ], + [ + 143, + 144 + ], + [ + 157, + 158 + ], + [ + 160, + 161 + ], + [ + 162, + 163 + ], + [ + 164, + 172 + ], + [ + 173, + 180 + ], + [ + 181, + 182 + ], + [ + 185, + 186 + ], + [ + 187, + 190 + ], + [ + 191, + 192 + ], + [ + 197, + 198 + ], + [ + 202, + 205 + ], + [ + 206, + 208 + ], + [ + 209, + 212 + ], + [ + 213, + 215 + ], + [ + 216, + 219 + ], + [ + 220, + 222 + ], + [ + 223, + 226 + ], + [ + 227, + 229 + ], + [ + 230, + 231 + ], + [ + 232, + 235 + ], + [ + 236, + 238 + ], + [ + 239, + 242 + ], + [ + 243, + 245 + ], + [ + 248, + 251 + ], + [ + 252, + 254 + ], + [ + 257, + 258 + ], + [ + 276, + 277 + ], + [ + 285, + 286 + ], + [ + 288, + 289 + ], + [ + 295, + 297 + ], + [ + 301, + 304 + ], + [ + 305, + 306 + ] + ] + } + }, + { + "filename": "libvips/resample/resample.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 37 + ], + [ + 61, + 68 + ], + [ + 72, + 81 + ], + [ + 82, + 96 + ], + [ + 102, + 157 + ], + [ + 158, + 197 + ] + ], + "lines_added": [ + [ + 12, + 13 + ], + [ + 14, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 28 + ], + [ + 33, + 34 + ], + [ + 64, + 65 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 85, + 86 + ], + [ + 88, + 89 + ], + [ + 92, + 93 + ], + [ + 105, + 106 + ], + [ + 108, + 109 + ], + [ + 110, + 111 + ], + [ + 113, + 116 + ], + [ + 118, + 119 + ], + [ + 120, + 122 + ], + [ + 123, + 124 + ], + [ + 127, + 128 + ], + [ + 129, + 131 + ], + [ + 136, + 137 + ], + [ + 139, + 142 + ], + [ + 143, + 144 + ], + [ + 145, + 150 + ], + [ + 153, + 154 + ], + [ + 161, + 162 + ], + [ + 163, + 196 + ] + ] + } + }, + { + "filename": "libvips/resample/resize.c", + "line_filter": { + "diff_chunks": [ + [ + 22, + 29 + ], + [ + 30, + 37 + ], + [ + 41, + 69 + ], + [ + 108, + 144 + ], + [ + 145, + 202 + ], + [ + 205, + 395 + ], + [ + 404, + 414 + ], + [ + 416, + 423 + ], + [ + 432, + 439 + ], + [ + 442, + 457 + ] + ], + "lines_added": [ + [ + 25, + 26 + ], + [ + 33, + 34 + ], + [ + 44, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 60 + ], + [ + 65, + 66 + ], + [ + 111, + 112 + ], + [ + 117, + 118 + ], + [ + 119, + 120 + ], + [ + 121, + 122 + ], + [ + 124, + 125 + ], + [ + 130, + 131 + ], + [ + 135, + 136 + ], + [ + 137, + 138 + ], + [ + 140, + 141 + ], + [ + 148, + 150 + ], + [ + 156, + 157 + ], + [ + 163, + 165 + ], + [ + 167, + 168 + ], + [ + 173, + 176 + ], + [ + 178, + 187 + ], + [ + 189, + 191 + ], + [ + 192, + 199 + ], + [ + 208, + 210 + ], + [ + 213, + 220 + ], + [ + 223, + 230 + ], + [ + 235, + 239 + ], + [ + 244, + 246 + ], + [ + 249, + 252 + ], + [ + 253, + 256 + ], + [ + 258, + 261 + ], + [ + 263, + 275 + ], + [ + 277, + 287 + ], + [ + 289, + 299 + ], + [ + 303, + 305 + ], + [ + 306, + 307 + ], + [ + 310, + 311 + ], + [ + 312, + 315 + ], + [ + 316, + 317 + ], + [ + 322, + 323 + ], + [ + 327, + 330 + ], + [ + 331, + 333 + ], + [ + 334, + 337 + ], + [ + 338, + 340 + ], + [ + 341, + 344 + ], + [ + 345, + 347 + ], + [ + 348, + 351 + ], + [ + 352, + 354 + ], + [ + 356, + 357 + ], + [ + 358, + 361 + ], + [ + 362, + 364 + ], + [ + 365, + 368 + ], + [ + 369, + 371 + ], + [ + 374, + 379 + ], + [ + 382, + 385 + ], + [ + 386, + 388 + ], + [ + 391, + 392 + ], + [ + 407, + 408 + ], + [ + 410, + 411 + ], + [ + 419, + 420 + ], + [ + 435, + 436 + ], + [ + 445, + 447 + ], + [ + 451, + 454 + ], + [ + 455, + 456 + ] + ] + } + }, + { + "filename": "libvips/resample/shrink.c", + "line_filter": { + "diff_chunks": [ + [ + 6, + 13 + ], + [ + 16, + 44 + ], + [ + 63, + 137 + ], + [ + 138, + 184 + ], + [ + 196, + 224 + ] + ], + "lines_added": [ + [ + 9, + 10 + ], + [ + 19, + 20 + ], + [ + 21, + 25 + ], + [ + 26, + 35 + ], + [ + 40, + 41 + ], + [ + 66, + 67 + ], + [ + 68, + 69 + ], + [ + 74, + 75 + ], + [ + 77, + 78 + ], + [ + 79, + 80 + ], + [ + 81, + 83 + ], + [ + 87, + 89 + ], + [ + 93, + 95 + ], + [ + 97, + 98 + ], + [ + 99, + 101 + ], + [ + 102, + 105 + ], + [ + 107, + 115 + ], + [ + 117, + 118 + ], + [ + 121, + 122 + ], + [ + 123, + 126 + ], + [ + 127, + 128 + ], + [ + 133, + 134 + ], + [ + 141, + 144 + ], + [ + 145, + 147 + ], + [ + 148, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 158 + ], + [ + 159, + 161 + ], + [ + 162, + 163 + ], + [ + 164, + 167 + ], + [ + 168, + 170 + ], + [ + 171, + 174 + ], + [ + 175, + 177 + ], + [ + 180, + 181 + ], + [ + 199, + 200 + ], + [ + 202, + 203 + ], + [ + 205, + 206 + ], + [ + 212, + 214 + ], + [ + 218, + 221 + ], + [ + 222, + 223 + ] + ] + } + }, + { + "filename": "libvips/resample/shrinkh.c", + "line_filter": { + "diff_chunks": [ + [ + 5, + 12 + ], + [ + 14, + 42 + ], + [ + 61, + 225 + ], + [ + 226, + 289 + ], + [ + 290, + 361 + ], + [ + 370, + 397 + ] + ], + "lines_added": [ + [ + 8, + 9 + ], + [ + 17, + 18 + ], + [ + 19, + 23 + ], + [ + 24, + 33 + ], + [ + 38, + 39 + ], + [ + 64, + 66 + ], + [ + 71, + 72 + ], + [ + 73, + 74 + ], + [ + 75, + 76 + ], + [ + 77, + 78 + ], + [ + 79, + 96 + ], + [ + 97, + 98 + ], + [ + 99, + 100 + ], + [ + 101, + 117 + ], + [ + 118, + 119 + ], + [ + 123, + 125 + ], + [ + 126, + 132 + ], + [ + 136, + 138 + ], + [ + 144, + 145 + ], + [ + 146, + 148 + ], + [ + 149, + 151 + ], + [ + 152, + 154 + ], + [ + 155, + 157 + ], + [ + 160, + 187 + ], + [ + 189, + 190 + ], + [ + 194, + 196 + ], + [ + 199, + 200 + ], + [ + 204, + 205 + ], + [ + 206, + 207 + ], + [ + 213, + 214 + ], + [ + 217, + 219 + ], + [ + 221, + 222 + ], + [ + 229, + 230 + ], + [ + 231, + 233 + ], + [ + 234, + 235 + ], + [ + 236, + 238 + ], + [ + 239, + 240 + ], + [ + 242, + 243 + ], + [ + 244, + 245 + ], + [ + 248, + 249 + ], + [ + 250, + 252 + ], + [ + 253, + 255 + ], + [ + 258, + 260 + ], + [ + 261, + 262 + ], + [ + 263, + 267 + ], + [ + 269, + 271 + ], + [ + 275, + 281 + ], + [ + 283, + 286 + ], + [ + 293, + 298 + ], + [ + 301, + 304 + ], + [ + 306, + 310 + ], + [ + 311, + 312 + ], + [ + 315, + 316 + ], + [ + 317, + 320 + ], + [ + 321, + 322 + ], + [ + 327, + 328 + ], + [ + 332, + 335 + ], + [ + 336, + 338 + ], + [ + 339, + 342 + ], + [ + 343, + 345 + ], + [ + 346, + 347 + ], + [ + 348, + 351 + ], + [ + 352, + 354 + ], + [ + 357, + 358 + ], + [ + 373, + 374 + ], + [ + 376, + 377 + ], + [ + 379, + 380 + ], + [ + 386, + 387 + ], + [ + 391, + 394 + ], + [ + 395, + 396 + ] + ] + } + }, + { + "filename": "libvips/resample/shrinkv.c", + "line_filter": { + "diff_chunks": [ + [ + 4, + 12 + ], + [ + 42, + 49 + ], + [ + 53, + 81 + ], + [ + 101, + 116 + ], + [ + 122, + 319 + ], + [ + 320, + 401 + ], + [ + 402, + 425 + ], + [ + 430, + 498 + ], + [ + 507, + 534 + ] + ], + "lines_added": [ + [ + 7, + 9 + ], + [ + 45, + 46 + ], + [ + 56, + 57 + ], + [ + 58, + 62 + ], + [ + 63, + 72 + ], + [ + 77, + 78 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 112, + 113 + ], + [ + 125, + 126 + ], + [ + 129, + 132 + ], + [ + 133, + 134 + ], + [ + 139, + 140 + ], + [ + 145, + 147 + ], + [ + 148, + 149 + ], + [ + 150, + 151 + ], + [ + 152, + 153 + ], + [ + 154, + 155 + ], + [ + 157, + 165 + ], + [ + 166, + 167 + ], + [ + 169, + 171 + ], + [ + 172, + 176 + ], + [ + 179, + 211 + ], + [ + 213, + 214 + ], + [ + 217, + 218 + ], + [ + 219, + 229 + ], + [ + 230, + 240 + ], + [ + 242, + 244 + ], + [ + 245, + 249 + ], + [ + 252, + 254 + ], + [ + 255, + 257 + ], + [ + 258, + 260 + ], + [ + 261, + 284 + ], + [ + 286, + 287 + ], + [ + 291, + 293 + ], + [ + 297, + 298 + ], + [ + 302, + 303 + ], + [ + 304, + 305 + ], + [ + 308, + 310 + ], + [ + 312, + 314 + ], + [ + 315, + 316 + ], + [ + 323, + 324 + ], + [ + 325, + 327 + ], + [ + 328, + 329 + ], + [ + 330, + 332 + ], + [ + 333, + 334 + ], + [ + 336, + 337 + ], + [ + 338, + 340 + ], + [ + 341, + 342 + ], + [ + 344, + 345 + ], + [ + 346, + 347 + ], + [ + 350, + 351 + ], + [ + 352, + 354 + ], + [ + 355, + 357 + ], + [ + 360, + 362 + ], + [ + 363, + 364 + ], + [ + 365, + 369 + ], + [ + 371, + 373 + ], + [ + 377, + 383 + ], + [ + 387, + 390 + ], + [ + 392, + 393 + ], + [ + 395, + 398 + ], + [ + 405, + 410 + ], + [ + 413, + 416 + ], + [ + 418, + 422 + ], + [ + 433, + 434 + ], + [ + 435, + 437 + ], + [ + 438, + 442 + ], + [ + 445, + 447 + ], + [ + 448, + 449 + ], + [ + 452, + 453 + ], + [ + 454, + 457 + ], + [ + 458, + 459 + ], + [ + 464, + 465 + ], + [ + 469, + 472 + ], + [ + 473, + 475 + ], + [ + 476, + 479 + ], + [ + 480, + 482 + ], + [ + 483, + 484 + ], + [ + 485, + 488 + ], + [ + 489, + 491 + ], + [ + 494, + 495 + ], + [ + 510, + 511 + ], + [ + 513, + 514 + ], + [ + 516, + 517 + ], + [ + 523, + 524 + ], + [ + 528, + 531 + ], + [ + 532, + 533 + ] + ] + } + }, + { + "filename": "libvips/resample/similarity.c", + "line_filter": { + "diff_chunks": [ + [ + 19, + 47 + ], + [ + 76, + 219 + ], + [ + 227, + 234 + ], + [ + 236, + 289 + ], + [ + 296, + 303 + ], + [ + 305, + 326 + ] + ], + "lines_added": [ + [ + 22, + 38 + ], + [ + 43, + 44 + ], + [ + 79, + 81 + ], + [ + 83, + 84 + ], + [ + 85, + 86 + ], + [ + 87, + 91 + ], + [ + 94, + 96 + ], + [ + 97, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 111 + ], + [ + 114, + 115 + ], + [ + 116, + 118 + ], + [ + 123, + 124 + ], + [ + 126, + 129 + ], + [ + 130, + 131 + ], + [ + 132, + 135 + ], + [ + 136, + 138 + ], + [ + 139, + 142 + ], + [ + 143, + 145 + ], + [ + 146, + 149 + ], + [ + 150, + 152 + ], + [ + 153, + 156 + ], + [ + 157, + 159 + ], + [ + 160, + 166 + ], + [ + 169, + 170 + ], + [ + 171, + 179 + ], + [ + 184, + 186 + ], + [ + 188, + 189 + ], + [ + 190, + 192 + ], + [ + 197, + 198 + ], + [ + 199, + 202 + ], + [ + 203, + 205 + ], + [ + 206, + 209 + ], + [ + 210, + 212 + ], + [ + 215, + 216 + ], + [ + 230, + 231 + ], + [ + 239, + 240 + ], + [ + 246, + 247 + ], + [ + 251, + 254 + ], + [ + 255, + 256 + ], + [ + 261, + 262 + ], + [ + 264, + 265 + ], + [ + 266, + 268 + ], + [ + 273, + 275 + ], + [ + 276, + 279 + ], + [ + 280, + 282 + ], + [ + 285, + 286 + ], + [ + 299, + 300 + ], + [ + 308, + 309 + ], + [ + 315, + 316 + ], + [ + 320, + 323 + ], + [ + 324, + 325 + ] + ] + } + }, + { + "filename": "libvips/resample/templates.h", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 32, + 62 + ], + [ + 69, + 77 + ], + [ + 78, + 85 + ], + [ + 86, + 100 + ], + [ + 101, + 108 + ], + [ + 109, + 129 + ], + [ + 130, + 137 + ], + [ + 139, + 307 + ], + [ + 312, + 394 + ], + [ + 397, + 455 + ] + ], + "lines_added": [ + [ + 6, + 7 + ], + [ + 8, + 12 + ], + [ + 13, + 17 + ], + [ + 18, + 22 + ], + [ + 27, + 28 + ], + [ + 35, + 37 + ], + [ + 40, + 41 + ], + [ + 43, + 45 + ], + [ + 46, + 47 + ], + [ + 50, + 51 + ], + [ + 53, + 55 + ], + [ + 58, + 59 + ], + [ + 72, + 74 + ], + [ + 81, + 82 + ], + [ + 89, + 90 + ], + [ + 95, + 97 + ], + [ + 104, + 105 + ], + [ + 112, + 113 + ], + [ + 118, + 119 + ], + [ + 124, + 126 + ], + [ + 133, + 134 + ], + [ + 142, + 143 + ], + [ + 149, + 150 + ], + [ + 153, + 154 + ], + [ + 158, + 160 + ], + [ + 164, + 165 + ], + [ + 171, + 172 + ], + [ + 175, + 177 + ], + [ + 180, + 182 + ], + [ + 185, + 187 + ], + [ + 190, + 191 + ], + [ + 192, + 193 + ], + [ + 196, + 197 + ], + [ + 199, + 200 + ], + [ + 204, + 205 + ], + [ + 209, + 211 + ], + [ + 215, + 216 + ], + [ + 222, + 223 + ], + [ + 226, + 228 + ], + [ + 231, + 233 + ], + [ + 236, + 238 + ], + [ + 241, + 242 + ], + [ + 243, + 244 + ], + [ + 247, + 248 + ], + [ + 250, + 252 + ], + [ + 253, + 254 + ], + [ + 255, + 259 + ], + [ + 263, + 265 + ], + [ + 269, + 270 + ], + [ + 271, + 281 + ], + [ + 287, + 288 + ], + [ + 294, + 297 + ], + [ + 299, + 300 + ], + [ + 303, + 304 + ], + [ + 315, + 317 + ], + [ + 320, + 321 + ], + [ + 324, + 325 + ], + [ + 327, + 328 + ], + [ + 332, + 334 + ], + [ + 339, + 340 + ], + [ + 345, + 346 + ], + [ + 352, + 354 + ], + [ + 357, + 358 + ], + [ + 361, + 362 + ], + [ + 364, + 365 + ], + [ + 366, + 367 + ], + [ + 372, + 373 + ], + [ + 374, + 378 + ], + [ + 379, + 384 + ], + [ + 390, + 391 + ], + [ + 400, + 401 + ], + [ + 402, + 404 + ], + [ + 407, + 408 + ], + [ + 411, + 412 + ], + [ + 414, + 415 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 423, + 424 + ], + [ + 426, + 428 + ], + [ + 434, + 435 + ], + [ + 438, + 439 + ], + [ + 443, + 444 + ], + [ + 447, + 449 + ], + [ + 453, + 454 + ] + ] + } + }, + { + "filename": "libvips/resample/thumbnail.c", + "line_filter": { + "diff_chunks": [ + [ + 15, + 22 + ], + [ + 41, + 69 + ], + [ + 83, + 101 + ], + [ + 120, + 135 + ], + [ + 156, + 303 + ], + [ + 306, + 345 + ], + [ + 347, + 358 + ], + [ + 361, + 417 + ], + [ + 418, + 580 + ], + [ + 581, + 589 + ], + [ + 590, + 655 + ], + [ + 665, + 678 + ], + [ + 679, + 738 + ], + [ + 741, + 758 + ], + [ + 761, + 793 + ], + [ + 801, + 892 + ], + [ + 895, + 965 + ], + [ + 966, + 1072 + ], + [ + 1077, + 1221 + ], + [ + 1241, + 1253 + ], + [ + 1255, + 1281 + ], + [ + 1288, + 1304 + ], + [ + 1309, + 1469 + ], + [ + 1496, + 1503 + ], + [ + 1504, + 1519 + ], + [ + 1524, + 1683 + ], + [ + 1709, + 1725 + ], + [ + 1729, + 1742 + ], + [ + 1743, + 1799 + ], + [ + 1815, + 1822 + ], + [ + 1827, + 1841 + ] + ], + "lines_added": [ + [ + 18, + 19 + ], + [ + 44, + 45 + ], + [ + 46, + 50 + ], + [ + 51, + 55 + ], + [ + 56, + 60 + ], + [ + 65, + 66 + ], + [ + 86, + 97 + ], + [ + 123, + 124 + ], + [ + 127, + 132 + ], + [ + 159, + 160 + ], + [ + 161, + 162 + ], + [ + 167, + 168 + ], + [ + 171, + 172 + ], + [ + 174, + 175 + ], + [ + 177, + 180 + ], + [ + 182, + 183 + ], + [ + 186, + 187 + ], + [ + 189, + 192 + ], + [ + 194, + 195 + ], + [ + 201, + 202 + ], + [ + 205, + 208 + ], + [ + 209, + 210 + ], + [ + 213, + 214 + ], + [ + 217, + 222 + ], + [ + 223, + 224 + ], + [ + 225, + 226 + ], + [ + 230, + 231 + ], + [ + 235, + 236 + ], + [ + 239, + 241 + ], + [ + 243, + 244 + ], + [ + 246, + 248 + ], + [ + 249, + 252 + ], + [ + 253, + 254 + ], + [ + 260, + 261 + ], + [ + 263, + 264 + ], + [ + 265, + 266 + ], + [ + 269, + 270 + ], + [ + 274, + 275 + ], + [ + 277, + 278 + ], + [ + 284, + 285 + ], + [ + 288, + 289 + ], + [ + 295, + 297 + ], + [ + 298, + 300 + ], + [ + 309, + 312 + ], + [ + 318, + 319 + ], + [ + 321, + 322 + ], + [ + 323, + 324 + ], + [ + 327, + 328 + ], + [ + 330, + 331 + ], + [ + 337, + 338 + ], + [ + 341, + 342 + ], + [ + 350, + 352 + ], + [ + 353, + 355 + ], + [ + 364, + 367 + ], + [ + 372, + 373 + ], + [ + 374, + 375 + ], + [ + 378, + 380 + ], + [ + 381, + 382 + ], + [ + 386, + 387 + ], + [ + 388, + 389 + ], + [ + 395, + 396 + ], + [ + 399, + 401 + ], + [ + 402, + 403 + ], + [ + 404, + 405 + ], + [ + 407, + 409 + ], + [ + 413, + 414 + ], + [ + 421, + 423 + ], + [ + 428, + 429 + ], + [ + 434, + 436 + ], + [ + 441, + 444 + ], + [ + 445, + 448 + ], + [ + 452, + 454 + ], + [ + 460, + 462 + ], + [ + 467, + 469 + ], + [ + 470, + 471 + ], + [ + 472, + 473 + ], + [ + 478, + 480 + ], + [ + 481, + 483 + ], + [ + 487, + 489 + ], + [ + 492, + 494 + ], + [ + 497, + 505 + ], + [ + 510, + 512 + ], + [ + 515, + 517 + ], + [ + 518, + 523 + ], + [ + 524, + 525 + ], + [ + 527, + 528 + ], + [ + 529, + 530 + ], + [ + 533, + 534 + ], + [ + 535, + 536 + ], + [ + 540, + 545 + ], + [ + 547, + 548 + ], + [ + 549, + 550 + ], + [ + 554, + 555 + ], + [ + 556, + 557 + ], + [ + 560, + 561 + ], + [ + 562, + 563 + ], + [ + 569, + 571 + ], + [ + 574, + 575 + ], + [ + 576, + 577 + ], + [ + 584, + 586 + ], + [ + 593, + 604 + ], + [ + 605, + 609 + ], + [ + 612, + 613 + ], + [ + 614, + 620 + ], + [ + 624, + 625 + ], + [ + 629, + 633 + ], + [ + 637, + 638 + ], + [ + 639, + 641 + ], + [ + 642, + 643 + ], + [ + 644, + 645 + ], + [ + 648, + 649 + ], + [ + 650, + 652 + ], + [ + 668, + 671 + ], + [ + 673, + 675 + ], + [ + 682, + 683 + ], + [ + 685, + 686 + ], + [ + 690, + 692 + ], + [ + 696, + 697 + ], + [ + 700, + 702 + ], + [ + 705, + 707 + ], + [ + 710, + 712 + ], + [ + 714, + 716 + ], + [ + 718, + 719 + ], + [ + 720, + 735 + ], + [ + 744, + 755 + ], + [ + 764, + 775 + ], + [ + 780, + 782 + ], + [ + 786, + 790 + ], + [ + 804, + 808 + ], + [ + 810, + 812 + ], + [ + 815, + 819 + ], + [ + 821, + 826 + ], + [ + 832, + 835 + ], + [ + 836, + 838 + ], + [ + 840, + 842 + ], + [ + 846, + 847 + ], + [ + 851, + 857 + ], + [ + 859, + 860 + ], + [ + 865, + 875 + ], + [ + 879, + 886 + ], + [ + 887, + 889 + ], + [ + 898, + 909 + ], + [ + 912, + 916 + ], + [ + 918, + 921 + ], + [ + 926, + 927 + ], + [ + 930, + 932 + ], + [ + 933, + 934 + ], + [ + 939, + 942 + ], + [ + 943, + 945 + ], + [ + 948, + 949 + ], + [ + 950, + 952 + ], + [ + 953, + 954 + ], + [ + 957, + 958 + ], + [ + 959, + 962 + ], + [ + 969, + 970 + ], + [ + 972, + 973 + ], + [ + 977, + 982 + ], + [ + 983, + 986 + ], + [ + 987, + 989 + ], + [ + 990, + 993 + ], + [ + 994, + 996 + ], + [ + 997, + 1000 + ], + [ + 1001, + 1003 + ], + [ + 1004, + 1007 + ], + [ + 1008, + 1010 + ], + [ + 1011, + 1014 + ], + [ + 1015, + 1017 + ], + [ + 1018, + 1021 + ], + [ + 1022, + 1024 + ], + [ + 1025, + 1028 + ], + [ + 1029, + 1031 + ], + [ + 1032, + 1035 + ], + [ + 1036, + 1038 + ], + [ + 1039, + 1042 + ], + [ + 1043, + 1045 + ], + [ + 1046, + 1049 + ], + [ + 1050, + 1052 + ], + [ + 1053, + 1054 + ], + [ + 1059, + 1062 + ], + [ + 1063, + 1065 + ], + [ + 1068, + 1069 + ], + [ + 1080, + 1081 + ], + [ + 1085, + 1087 + ], + [ + 1091, + 1092 + ], + [ + 1097, + 1098 + ], + [ + 1099, + 1102 + ], + [ + 1103, + 1104 + ], + [ + 1105, + 1106 + ], + [ + 1107, + 1108 + ], + [ + 1110, + 1111 + ], + [ + 1113, + 1114 + ], + [ + 1117, + 1119 + ], + [ + 1122, + 1123 + ], + [ + 1124, + 1127 + ], + [ + 1130, + 1131 + ], + [ + 1132, + 1136 + ], + [ + 1139, + 1140 + ], + [ + 1141, + 1142 + ], + [ + 1144, + 1146 + ], + [ + 1149, + 1150 + ], + [ + 1151, + 1152 + ], + [ + 1153, + 1154 + ], + [ + 1155, + 1156 + ], + [ + 1159, + 1161 + ], + [ + 1164, + 1167 + ], + [ + 1170, + 1171 + ], + [ + 1172, + 1173 + ], + [ + 1175, + 1176 + ], + [ + 1177, + 1179 + ], + [ + 1182, + 1183 + ], + [ + 1185, + 1186 + ], + [ + 1188, + 1189 + ], + [ + 1193, + 1194 + ], + [ + 1195, + 1198 + ], + [ + 1203, + 1204 + ], + [ + 1208, + 1214 + ], + [ + 1217, + 1218 + ], + [ + 1244, + 1245 + ], + [ + 1246, + 1247 + ], + [ + 1249, + 1250 + ], + [ + 1258, + 1259 + ], + [ + 1261, + 1262 + ], + [ + 1263, + 1264 + ], + [ + 1269, + 1270 + ], + [ + 1274, + 1278 + ], + [ + 1291, + 1292 + ], + [ + 1296, + 1299 + ], + [ + 1300, + 1301 + ], + [ + 1312, + 1314 + ], + [ + 1318, + 1319 + ], + [ + 1324, + 1325 + ], + [ + 1326, + 1332 + ], + [ + 1333, + 1334 + ], + [ + 1335, + 1336 + ], + [ + 1337, + 1338 + ], + [ + 1340, + 1341 + ], + [ + 1343, + 1344 + ], + [ + 1347, + 1350 + ], + [ + 1353, + 1354 + ], + [ + 1355, + 1359 + ], + [ + 1362, + 1363 + ], + [ + 1364, + 1369 + ], + [ + 1372, + 1373 + ], + [ + 1374, + 1375 + ], + [ + 1377, + 1380 + ], + [ + 1383, + 1384 + ], + [ + 1385, + 1387 + ], + [ + 1389, + 1390 + ], + [ + 1391, + 1392 + ], + [ + 1395, + 1398 + ], + [ + 1401, + 1405 + ], + [ + 1408, + 1409 + ], + [ + 1410, + 1412 + ], + [ + 1414, + 1415 + ], + [ + 1416, + 1419 + ], + [ + 1422, + 1423 + ], + [ + 1425, + 1427 + ], + [ + 1429, + 1430 + ], + [ + 1434, + 1435 + ], + [ + 1436, + 1439 + ], + [ + 1444, + 1445 + ], + [ + 1449, + 1455 + ], + [ + 1456, + 1459 + ], + [ + 1460, + 1462 + ], + [ + 1465, + 1466 + ], + [ + 1499, + 1500 + ], + [ + 1507, + 1508 + ], + [ + 1509, + 1512 + ], + [ + 1513, + 1514 + ], + [ + 1515, + 1516 + ], + [ + 1527, + 1529 + ], + [ + 1533, + 1534 + ], + [ + 1539, + 1540 + ], + [ + 1541, + 1546 + ], + [ + 1547, + 1548 + ], + [ + 1549, + 1550 + ], + [ + 1551, + 1552 + ], + [ + 1554, + 1555 + ], + [ + 1557, + 1558 + ], + [ + 1561, + 1564 + ], + [ + 1567, + 1568 + ], + [ + 1569, + 1573 + ], + [ + 1576, + 1577 + ], + [ + 1578, + 1583 + ], + [ + 1586, + 1587 + ], + [ + 1588, + 1589 + ], + [ + 1591, + 1594 + ], + [ + 1597, + 1598 + ], + [ + 1599, + 1601 + ], + [ + 1603, + 1604 + ], + [ + 1605, + 1606 + ], + [ + 1609, + 1612 + ], + [ + 1615, + 1619 + ], + [ + 1622, + 1623 + ], + [ + 1624, + 1626 + ], + [ + 1628, + 1629 + ], + [ + 1630, + 1633 + ], + [ + 1636, + 1637 + ], + [ + 1639, + 1641 + ], + [ + 1643, + 1644 + ], + [ + 1648, + 1649 + ], + [ + 1650, + 1653 + ], + [ + 1658, + 1659 + ], + [ + 1663, + 1669 + ], + [ + 1670, + 1673 + ], + [ + 1674, + 1676 + ], + [ + 1679, + 1680 + ], + [ + 1712, + 1713 + ], + [ + 1717, + 1720 + ], + [ + 1721, + 1722 + ], + [ + 1732, + 1734 + ], + [ + 1738, + 1739 + ], + [ + 1746, + 1747 + ], + [ + 1748, + 1749 + ], + [ + 1754, + 1755 + ], + [ + 1757, + 1759 + ], + [ + 1763, + 1765 + ], + [ + 1766, + 1767 + ], + [ + 1768, + 1769 + ], + [ + 1772, + 1773 + ], + [ + 1774, + 1777 + ], + [ + 1782, + 1783 + ], + [ + 1787, + 1790 + ], + [ + 1791, + 1792 + ], + [ + 1795, + 1796 + ], + [ + 1818, + 1819 + ], + [ + 1830, + 1831 + ], + [ + 1835, + 1838 + ], + [ + 1839, + 1840 + ] + ] + } + }, + { + "filename": "libvips/resample/transform.c", + "line_filter": { + "diff_chunks": [ + [ + 3, + 31 + ], + [ + 43, + 65 + ], + [ + 68, + 81 + ], + [ + 84, + 91 + ], + [ + 93, + 121 + ], + [ + 126, + 164 + ], + [ + 166, + 178 + ], + [ + 180, + 197 + ], + [ + 198, + 253 + ] + ], + "lines_added": [ + [ + 6, + 22 + ], + [ + 27, + 28 + ], + [ + 46, + 47 + ], + [ + 53, + 54 + ], + [ + 57, + 58 + ], + [ + 59, + 62 + ], + [ + 71, + 72 + ], + [ + 77, + 78 + ], + [ + 87, + 88 + ], + [ + 96, + 97 + ], + [ + 102, + 103 + ], + [ + 104, + 106 + ], + [ + 107, + 109 + ], + [ + 110, + 111 + ], + [ + 116, + 118 + ], + [ + 129, + 131 + ], + [ + 132, + 133 + ], + [ + 135, + 137 + ], + [ + 138, + 140 + ], + [ + 143, + 145 + ], + [ + 148, + 153 + ], + [ + 155, + 156 + ], + [ + 158, + 161 + ], + [ + 169, + 170 + ], + [ + 172, + 175 + ], + [ + 183, + 185 + ], + [ + 189, + 192 + ], + [ + 193, + 194 + ], + [ + 201, + 209 + ], + [ + 213, + 222 + ], + [ + 228, + 231 + ], + [ + 232, + 233 + ], + [ + 235, + 236 + ], + [ + 239, + 242 + ], + [ + 243, + 244 + ], + [ + 249, + 250 + ], + [ + 251, + 252 + ] + ] + } + }, + { + "filename": "test/test_connections.c", + "line_filter": { + "diff_chunks": [ + [ + 9, + 47 + ], + [ + 48, + 55 + ], + [ + 62, + 80 + ], + [ + 81, + 105 + ], + [ + 106, + 160 + ] + ], + "lines_added": [ + [ + 12, + 14 + ], + [ + 19, + 20 + ], + [ + 24, + 26 + ], + [ + 27, + 29 + ], + [ + 34, + 36 + ], + [ + 38, + 39 + ], + [ + 42, + 44 + ], + [ + 51, + 52 + ], + [ + 65, + 67 + ], + [ + 69, + 70 + ], + [ + 71, + 72 + ], + [ + 75, + 77 + ], + [ + 84, + 85 + ], + [ + 86, + 87 + ], + [ + 90, + 91 + ], + [ + 96, + 97 + ], + [ + 101, + 102 + ], + [ + 109, + 111 + ], + [ + 112, + 114 + ], + [ + 120, + 123 + ], + [ + 125, + 129 + ], + [ + 130, + 135 + ], + [ + 139, + 142 + ], + [ + 144, + 148 + ], + [ + 149, + 152 + ], + [ + 153, + 157 + ], + [ + 158, + 159 + ] + ] + } + }, + { + "filename": "test/test_descriptors.c", + "line_filter": { + "diff_chunks": [ + [ + 12, + 36 + ], + [ + 37, + 55 + ], + [ + 56, + 108 + ] + ], + "lines_added": [ + [ + 15, + 16 + ], + [ + 20, + 22 + ], + [ + 23, + 24 + ], + [ + 26, + 27 + ], + [ + 28, + 29 + ], + [ + 32, + 33 + ], + [ + 40, + 42 + ], + [ + 43, + 45 + ], + [ + 46, + 49 + ], + [ + 51, + 52 + ], + [ + 59, + 69 + ], + [ + 73, + 81 + ], + [ + 85, + 93 + ], + [ + 96, + 100 + ], + [ + 102, + 105 + ], + [ + 106, + 107 + ] + ] + } + }, + { + "filename": "tools/vips.c", + "line_filter": { + "diff_chunks": [ + [ + 51, + 79 + ], + [ + 108, + 535 + ], + [ + 543, + 598 + ], + [ + 599, + 608 + ], + [ + 609, + 631 + ], + [ + 639, + 660 + ], + [ + 663, + 763 + ], + [ + 765, + 786 + ], + [ + 789, + 805 + ], + [ + 809, + 823 + ], + [ + 824, + 853 + ], + [ + 855, + 896 + ] + ], + "lines_added": [ + [ + 54, + 70 + ], + [ + 75, + 76 + ], + [ + 111, + 112 + ], + [ + 113, + 115 + ], + [ + 118, + 124 + ], + [ + 125, + 129 + ], + [ + 130, + 131 + ], + [ + 134, + 135 + ], + [ + 140, + 143 + ], + [ + 144, + 145 + ], + [ + 148, + 150 + ], + [ + 153, + 159 + ], + [ + 160, + 164 + ], + [ + 165, + 166 + ], + [ + 168, + 170 + ], + [ + 172, + 173 + ], + [ + 176, + 177 + ], + [ + 178, + 179 + ], + [ + 180, + 186 + ], + [ + 187, + 188 + ], + [ + 189, + 190 + ], + [ + 193, + 194 + ], + [ + 195, + 196 + ], + [ + 197, + 198 + ], + [ + 199, + 202 + ], + [ + 205, + 207 + ], + [ + 210, + 212 + ], + [ + 214, + 215 + ], + [ + 218, + 220 + ], + [ + 221, + 222 + ], + [ + 223, + 224 + ], + [ + 227, + 231 + ], + [ + 233, + 234 + ], + [ + 235, + 238 + ], + [ + 240, + 241 + ], + [ + 242, + 243 + ], + [ + 245, + 246 + ], + [ + 247, + 248 + ], + [ + 250, + 251 + ], + [ + 254, + 255 + ], + [ + 256, + 257 + ], + [ + 260, + 262 + ], + [ + 265, + 279 + ], + [ + 281, + 283 + ], + [ + 285, + 286 + ], + [ + 289, + 302 + ], + [ + 306, + 307 + ], + [ + 311, + 312 + ], + [ + 316, + 319 + ], + [ + 320, + 321 + ], + [ + 326, + 327 + ], + [ + 331, + 332 + ], + [ + 334, + 336 + ], + [ + 338, + 340 + ], + [ + 342, + 343 + ], + [ + 344, + 347 + ], + [ + 349, + 350 + ], + [ + 353, + 354 + ], + [ + 355, + 358 + ], + [ + 361, + 362 + ], + [ + 363, + 366 + ], + [ + 370, + 371 + ], + [ + 373, + 376 + ], + [ + 377, + 378 + ], + [ + 379, + 385 + ], + [ + 388, + 390 + ], + [ + 391, + 392 + ], + [ + 395, + 396 + ], + [ + 402, + 403 + ], + [ + 406, + 410 + ], + [ + 411, + 412 + ], + [ + 417, + 418 + ], + [ + 419, + 420 + ], + [ + 421, + 422 + ], + [ + 427, + 428 + ], + [ + 431, + 434 + ], + [ + 435, + 436 + ], + [ + 440, + 441 + ], + [ + 444, + 445 + ], + [ + 447, + 448 + ], + [ + 454, + 455 + ], + [ + 457, + 458 + ], + [ + 461, + 465 + ], + [ + 468, + 471 + ], + [ + 474, + 479 + ], + [ + 482, + 489 + ], + [ + 493, + 497 + ], + [ + 500, + 503 + ], + [ + 504, + 507 + ], + [ + 508, + 511 + ], + [ + 512, + 515 + ], + [ + 516, + 517 + ], + [ + 518, + 519 + ], + [ + 523, + 524 + ], + [ + 525, + 526 + ], + [ + 531, + 532 + ], + [ + 546, + 547 + ], + [ + 548, + 549 + ], + [ + 552, + 553 + ], + [ + 555, + 556 + ], + [ + 560, + 561 + ], + [ + 563, + 564 + ], + [ + 568, + 571 + ], + [ + 573, + 576 + ], + [ + 578, + 581 + ], + [ + 583, + 586 + ], + [ + 588, + 589 + ], + [ + 594, + 595 + ], + [ + 602, + 605 + ], + [ + 612, + 613 + ], + [ + 616, + 620 + ], + [ + 621, + 622 + ], + [ + 624, + 625 + ], + [ + 627, + 628 + ], + [ + 642, + 644 + ], + [ + 646, + 647 + ], + [ + 648, + 649 + ], + [ + 650, + 652 + ], + [ + 653, + 657 + ], + [ + 666, + 667 + ], + [ + 673, + 674 + ], + [ + 676, + 678 + ], + [ + 684, + 689 + ], + [ + 693, + 694 + ], + [ + 697, + 698 + ], + [ + 700, + 703 + ], + [ + 704, + 705 + ], + [ + 710, + 711 + ], + [ + 713, + 716 + ], + [ + 718, + 721 + ], + [ + 723, + 724 + ], + [ + 729, + 730 + ], + [ + 732, + 733 + ], + [ + 735, + 738 + ], + [ + 740, + 744 + ], + [ + 746, + 749 + ], + [ + 752, + 754 + ], + [ + 758, + 760 + ], + [ + 768, + 769 + ], + [ + 771, + 773 + ], + [ + 774, + 775 + ], + [ + 776, + 778 + ], + [ + 782, + 783 + ], + [ + 792, + 799 + ], + [ + 800, + 802 + ], + [ + 812, + 818 + ], + [ + 819, + 820 + ], + [ + 827, + 829 + ], + [ + 834, + 850 + ], + [ + 858, + 859 + ], + [ + 860, + 861 + ], + [ + 863, + 865 + ], + [ + 871, + 873 + ], + [ + 875, + 878 + ], + [ + 883, + 885 + ], + [ + 886, + 887 + ], + [ + 889, + 890 + ], + [ + 894, + 895 + ] + ] + } + }, + { + "filename": "tools/vipsedit.c", + "line_filter": { + "diff_chunks": [ + [ + 22, + 50 + ], + [ + 84, + 137 + ], + [ + 138, + 159 + ], + [ + 161, + 303 + ] + ], + "lines_added": [ + [ + 25, + 41 + ], + [ + 46, + 47 + ], + [ + 87, + 119 + ], + [ + 123, + 124 + ], + [ + 127, + 130 + ], + [ + 133, + 134 + ], + [ + 141, + 143 + ], + [ + 145, + 146 + ], + [ + 147, + 148 + ], + [ + 149, + 151 + ], + [ + 152, + 156 + ], + [ + 164, + 171 + ], + [ + 173, + 176 + ], + [ + 178, + 179 + ], + [ + 180, + 181 + ], + [ + 186, + 187 + ], + [ + 189, + 191 + ], + [ + 192, + 195 + ], + [ + 196, + 197 + ], + [ + 199, + 201 + ], + [ + 202, + 208 + ], + [ + 209, + 211 + ], + [ + 212, + 213 + ], + [ + 215, + 218 + ], + [ + 219, + 226 + ], + [ + 228, + 231 + ], + [ + 234, + 235 + ], + [ + 237, + 238 + ], + [ + 239, + 240 + ], + [ + 242, + 246 + ], + [ + 249, + 250 + ], + [ + 252, + 255 + ], + [ + 258, + 274 + ], + [ + 277, + 279 + ], + [ + 280, + 281 + ], + [ + 283, + 284 + ], + [ + 286, + 289 + ], + [ + 291, + 292 + ], + [ + 293, + 294 + ], + [ + 296, + 297 + ], + [ + 301, + 302 + ] + ] + } + }, + { + "filename": "tools/vipsheader.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 7 + ], + [ + 23, + 30 + ], + [ + 44, + 72 + ], + [ + 87, + 174 + ], + [ + 175, + 196 + ], + [ + 198, + 275 + ] + ], + "lines_added": [ + [ + 3, + 4 + ], + [ + 26, + 27 + ], + [ + 47, + 48 + ], + [ + 49, + 53 + ], + [ + 54, + 63 + ], + [ + 68, + 69 + ], + [ + 90, + 95 + ], + [ + 96, + 98 + ], + [ + 104, + 105 + ], + [ + 106, + 107 + ], + [ + 111, + 112 + ], + [ + 115, + 116 + ], + [ + 117, + 120 + ], + [ + 121, + 122 + ], + [ + 123, + 125 + ], + [ + 126, + 127 + ], + [ + 132, + 133 + ], + [ + 134, + 137 + ], + [ + 138, + 139 + ], + [ + 140, + 142 + ], + [ + 143, + 145 + ], + [ + 148, + 153 + ], + [ + 155, + 157 + ], + [ + 160, + 164 + ], + [ + 166, + 167 + ], + [ + 170, + 171 + ], + [ + 178, + 180 + ], + [ + 182, + 183 + ], + [ + 184, + 185 + ], + [ + 186, + 188 + ], + [ + 189, + 193 + ], + [ + 201, + 207 + ], + [ + 209, + 212 + ], + [ + 214, + 217 + ], + [ + 219, + 220 + ], + [ + 222, + 223 + ], + [ + 224, + 226 + ], + [ + 229, + 230 + ], + [ + 232, + 233 + ], + [ + 234, + 236 + ], + [ + 238, + 246 + ], + [ + 248, + 250 + ], + [ + 255, + 257 + ], + [ + 261, + 263 + ], + [ + 268, + 269 + ], + [ + 273, + 274 + ] + ] + } + }, + { + "filename": "tools/vipsthumbnail.c", + "line_filter": { + "diff_chunks": [ + [ + 95, + 102 + ], + [ + 151, + 283 + ], + [ + 285, + 387 + ], + [ + 392, + 399 + ], + [ + 400, + 490 + ], + [ + 491, + 512 + ], + [ + 514, + 569 + ], + [ + 571, + 587 + ] + ], + "lines_added": [ + [ + 98, + 99 + ], + [ + 154, + 223 + ], + [ + 229, + 230 + ], + [ + 232, + 233 + ], + [ + 239, + 240 + ], + [ + 243, + 244 + ], + [ + 246, + 247 + ], + [ + 249, + 251 + ], + [ + 255, + 257 + ], + [ + 260, + 263 + ], + [ + 265, + 266 + ], + [ + 267, + 268 + ], + [ + 269, + 272 + ], + [ + 273, + 274 + ], + [ + 275, + 276 + ], + [ + 279, + 280 + ], + [ + 288, + 289 + ], + [ + 290, + 291 + ], + [ + 293, + 296 + ], + [ + 300, + 301 + ], + [ + 303, + 306 + ], + [ + 309, + 311 + ], + [ + 313, + 330 + ], + [ + 331, + 332 + ], + [ + 334, + 345 + ], + [ + 348, + 349 + ], + [ + 352, + 354 + ], + [ + 356, + 358 + ], + [ + 359, + 364 + ], + [ + 366, + 367 + ], + [ + 369, + 372 + ], + [ + 375, + 376 + ], + [ + 377, + 378 + ], + [ + 383, + 384 + ], + [ + 395, + 396 + ], + [ + 403, + 404 + ], + [ + 405, + 406 + ], + [ + 407, + 409 + ], + [ + 410, + 411 + ], + [ + 414, + 415 + ], + [ + 416, + 417 + ], + [ + 419, + 420 + ], + [ + 423, + 424 + ], + [ + 426, + 427 + ], + [ + 428, + 430 + ], + [ + 431, + 432 + ], + [ + 437, + 438 + ], + [ + 439, + 440 + ], + [ + 441, + 442 + ], + [ + 443, + 444 + ], + [ + 445, + 450 + ], + [ + 455, + 456 + ], + [ + 461, + 463 + ], + [ + 464, + 465 + ], + [ + 468, + 469 + ], + [ + 471, + 477 + ], + [ + 478, + 480 + ], + [ + 482, + 483 + ], + [ + 486, + 487 + ], + [ + 494, + 496 + ], + [ + 498, + 499 + ], + [ + 500, + 501 + ], + [ + 502, + 504 + ], + [ + 505, + 509 + ], + [ + 517, + 518 + ], + [ + 519, + 524 + ], + [ + 526, + 529 + ], + [ + 531, + 534 + ], + [ + 536, + 537 + ], + [ + 539, + 540 + ], + [ + 541, + 543 + ], + [ + 544, + 547 + ], + [ + 549, + 553 + ], + [ + 557, + 558 + ], + [ + 560, + 561 + ], + [ + 562, + 566 + ], + [ + 574, + 575 + ], + [ + 580, + 581 + ], + [ + 585, + 586 + ] + ] + } + } +] diff --git a/tests/capture_tools_output/libvips/libvips/fe82be345a5b654a76835a7aea5a804bd9ebff0a.diff b/tests/capture_tools_output/libvips/libvips/fe82be345a5b654a76835a7aea5a804bd9ebff0a.diff new file mode 100644 index 0000000..bbde7ef --- /dev/null +++ b/tests/capture_tools_output/libvips/libvips/fe82be345a5b654a76835a7aea5a804bd9ebff0a.diff @@ -0,0 +1,301611 @@ +diff --git a/cplusplus/VConnection.cpp b/cplusplus/VConnection.cpp +index 55451415a8..b2f5e7a9a9 100644 +--- a/cplusplus/VConnection.cpp ++++ b/cplusplus/VConnection.cpp +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2001 The National Gallery ++ Copyright (C) 1991-2001 The National Gallery + +- This program is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,109 +43,109 @@ + + VIPS_NAMESPACE_START + +-VSource +-VSource::new_from_descriptor( int descriptor ) ++VSource ++VSource::new_from_descriptor(int descriptor) + { + VipsSource *input; + +- if( !(input = vips_source_new_from_descriptor( descriptor )) ) ++ if (!(input = vips_source_new_from_descriptor(descriptor))) + throw VError(); + +- VSource out( input ); ++ VSource out(input); + +- return( out ); ++ return (out); + } + +-VSource +-VSource::new_from_file( const char *filename ) ++VSource ++VSource::new_from_file(const char *filename) + { + VipsSource *input; + +- if( !(input = vips_source_new_from_file( filename )) ) ++ if (!(input = vips_source_new_from_file(filename))) + throw VError(); + +- VSource out( input ); ++ VSource out(input); + +- return( out ); ++ return (out); + } + +-VSource +-VSource::new_from_blob( VipsBlob *blob ) ++VSource ++VSource::new_from_blob(VipsBlob *blob) + { + VipsSource *input; + +- if( !(input = vips_source_new_from_blob( blob )) ) ++ if (!(input = vips_source_new_from_blob(blob))) + throw VError(); + +- VSource out( input ); ++ VSource out(input); + +- return( out ); ++ return (out); + } + +-VSource +-VSource::new_from_memory( const void *data, +- size_t size ) ++VSource ++VSource::new_from_memory(const void *data, ++ size_t size) + { + VipsSource *input; + +- if( !(input = vips_source_new_from_memory( data, size )) ) ++ if (!(input = vips_source_new_from_memory(data, size))) + throw VError(); + +- VSource out( input ); ++ VSource out(input); + +- return( out ); ++ return (out); + } + +-VSource +-VSource::new_from_options( const char *options ) ++VSource ++VSource::new_from_options(const char *options) + { + VipsSource *input; + +- if( !(input = vips_source_new_from_options( options )) ) ++ if (!(input = vips_source_new_from_options(options))) + throw VError(); + +- VSource out( input ); ++ VSource out(input); + +- return( out ); ++ return (out); + } + +-VTarget +-VTarget::new_to_descriptor( int descriptor ) ++VTarget ++VTarget::new_to_descriptor(int descriptor) + { + VipsTarget *output; + +- if( !(output = vips_target_new_to_descriptor( descriptor )) ) ++ if (!(output = vips_target_new_to_descriptor(descriptor))) + throw VError(); + +- VTarget out( output ); ++ VTarget out(output); + +- return( out ); ++ return (out); + } + +-VTarget +-VTarget::new_to_file( const char *filename ) ++VTarget ++VTarget::new_to_file(const char *filename) + { + VipsTarget *output; + +- if( !(output = vips_target_new_to_file( filename )) ) ++ if (!(output = vips_target_new_to_file(filename))) + throw VError(); + +- VTarget out( output ); ++ VTarget out(output); + +- return( out ); ++ return (out); + } + +-VTarget ++VTarget + VTarget::new_to_memory() + { + VipsTarget *output; + +- if( !(output = vips_target_new_to_memory()) ) ++ if (!(output = vips_target_new_to_memory())) + throw VError(); + +- VTarget out( output ); ++ VTarget out(output); + +- return( out ); ++ return (out); + } + + VIPS_NAMESPACE_END +diff --git a/cplusplus/VError.cpp b/cplusplus/VError.cpp +index 3be4906893..e02e9e9a8a 100644 +--- a/cplusplus/VError.cpp ++++ b/cplusplus/VError.cpp +@@ -2,28 +2,28 @@ + + /* + +- Copyright (C) 1991-2001 The National Gallery ++ Copyright (C) 1991-2001 The National Gallery + +- This program is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -35,13 +35,15 @@ + + VIPS_NAMESPACE_START + +-std::ostream &operator<<( std::ostream &file, const VError &err ) ++std::ostream & ++operator<<(std::ostream &file, const VError &err) + { +- err.ostream_print( file ); +- return( file ); ++ err.ostream_print(file); ++ return (file); + } + +-void VError::ostream_print( std::ostream &file ) const ++void ++VError::ostream_print(std::ostream &file) const + { + file << _what; + } +diff --git a/cplusplus/VImage.cpp b/cplusplus/VImage.cpp +index 72c3fa9dc0..60059735f1 100644 +--- a/cplusplus/VImage.cpp ++++ b/cplusplus/VImage.cpp +@@ -10,28 +10,28 @@ + + /* + +- Copyright (C) 1991-2001 The National Gallery ++ Copyright (C) 1991-2001 The National Gallery + +- This program is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -57,488 +57,488 @@ VIPS_NAMESPACE_START + */ + + std::vector +-to_vectorv( int n, ... ) ++to_vectorv(int n, ...) + { +- std::vector vector( n ); ++ std::vector vector(n); + va_list ap; + +- va_start( ap, n ); +- for( int i = 0; i < n; i++ ) +- vector[i] = va_arg( ap, double ); +- va_end( ap ); ++ va_start(ap, n); ++ for (int i = 0; i < n; i++) ++ vector[i] = va_arg(ap, double); ++ va_end(ap); + +- return( vector ); ++ return (vector); + } + + std::vector +-to_vector( double value ) ++to_vector(double value) + { +- return( to_vectorv( 1, value ) ); ++ return (to_vectorv(1, value)); + } + + std::vector +-to_vector( int n, double array[] ) ++to_vector(int n, double array[]) + { +- std::vector vector( n ); ++ std::vector vector(n); + +- for( int i = 0; i < n; i++ ) ++ for (int i = 0; i < n; i++) + vector[i] = array[i]; + +- return( vector ); ++ return (vector); + } + + std::vector +-negate( std::vector vector ) ++negate(std::vector vector) + { +- std::vector new_vector( vector.size() ); ++ std::vector new_vector(vector.size()); + +- for( std::vector::size_type i = 0; i < vector.size(); i++ ) ++ for (std::vector::size_type i = 0; i < vector.size(); i++) + new_vector[i] = vector[i] * -1; + +- return( new_vector ); ++ return (new_vector); + } + + std::vector +-invert( std::vector vector ) ++invert(std::vector vector) + { +- std::vector new_vector( vector.size() ); ++ std::vector new_vector(vector.size()); + +- for( std::vector::size_type i = 0; i < vector.size(); i++ ) ++ for (std::vector::size_type i = 0; i < vector.size(); i++) + new_vector[i] = 1.0 / vector[i]; + +- return( new_vector ); ++ return (new_vector); + } + + VOption::~VOption() + { + std::list::iterator i; + +- for( i = options.begin(); i != options.end(); ++i ) ++ for (i = options.begin(); i != options.end(); ++i) + delete *i; + } + + // input bool + VOption * +-VOption::set( const char *name, bool value ) ++VOption::set(const char *name, bool value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + + pair->input = true; +- g_value_init( &pair->value, G_TYPE_BOOLEAN ); +- g_value_set_boolean( &pair->value, value ); +- options.push_back( pair ); ++ g_value_init(&pair->value, G_TYPE_BOOLEAN); ++ g_value_set_boolean(&pair->value, value); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + // input int ... this path is used for enums as well + VOption * +-VOption::set( const char *name, int value ) ++VOption::set(const char *name, int value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + + pair->input = true; +- g_value_init( &pair->value, G_TYPE_INT ); +- g_value_set_int( &pair->value, value ); +- options.push_back( pair ); ++ g_value_init(&pair->value, G_TYPE_INT); ++ g_value_set_int(&pair->value, value); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + // input guint64 + VOption * +-VOption::set( const char *name, guint64 value ) ++VOption::set(const char *name, guint64 value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + + pair->input = true; +- g_value_init( &pair->value, G_TYPE_UINT64 ); +- g_value_set_uint64( &pair->value, value ); +- options.push_back( pair ); ++ g_value_init(&pair->value, G_TYPE_UINT64); ++ g_value_set_uint64(&pair->value, value); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + // input double + VOption * +-VOption::set( const char *name, double value ) ++VOption::set(const char *name, double value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + + pair->input = true; +- g_value_init( &pair->value, G_TYPE_DOUBLE ); +- g_value_set_double( &pair->value, value ); +- options.push_back( pair ); ++ g_value_init(&pair->value, G_TYPE_DOUBLE); ++ g_value_set_double(&pair->value, value); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + VOption * +-VOption::set( const char *name, const char *value ) ++VOption::set(const char *name, const char *value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + + pair->input = true; +- g_value_init( &pair->value, G_TYPE_STRING ); +- g_value_set_string( &pair->value, value ); +- options.push_back( pair ); ++ g_value_init(&pair->value, G_TYPE_STRING); ++ g_value_set_string(&pair->value, value); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + // input vips object (image, source, target, etc. etc.) + VOption * +-VOption::set( const char *name, const VObject value ) ++VOption::set(const char *name, const VObject value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + VipsObject *object = value.get_object(); +- GType type = G_OBJECT_TYPE( object ); ++ GType type = G_OBJECT_TYPE(object); + + pair->input = true; +- g_value_init( &pair->value, type ); +- g_value_set_object( &pair->value, object ); +- options.push_back( pair ); ++ g_value_init(&pair->value, type); ++ g_value_set_object(&pair->value, object); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + // input int array + VOption * +-VOption::set( const char *name, std::vector value ) ++VOption::set(const char *name, std::vector value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + + int *array; + + pair->input = true; + +- g_value_init( &pair->value, VIPS_TYPE_ARRAY_INT ); +- vips_value_set_array_int( &pair->value, NULL, +- static_cast< int >( value.size() ) ); +- array = vips_value_get_array_int( &pair->value, NULL ); ++ g_value_init(&pair->value, VIPS_TYPE_ARRAY_INT); ++ vips_value_set_array_int(&pair->value, NULL, ++ static_cast(value.size())); ++ array = vips_value_get_array_int(&pair->value, NULL); + +- for( std::vector::size_type i = 0; i < value.size(); i++ ) ++ for (std::vector::size_type i = 0; i < value.size(); i++) + array[i] = value[i]; + +- options.push_back( pair ); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + // input double array + VOption * +-VOption::set( const char *name, std::vector value ) ++VOption::set(const char *name, std::vector value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + + double *array; + + pair->input = true; + +- g_value_init( &pair->value, VIPS_TYPE_ARRAY_DOUBLE ); +- vips_value_set_array_double( &pair->value, NULL, +- static_cast< int >( value.size() ) ); +- array = vips_value_get_array_double( &pair->value, NULL ); ++ g_value_init(&pair->value, VIPS_TYPE_ARRAY_DOUBLE); ++ vips_value_set_array_double(&pair->value, NULL, ++ static_cast(value.size())); ++ array = vips_value_get_array_double(&pair->value, NULL); + +- for( std::vector::size_type i = 0; i < value.size(); i++ ) ++ for (std::vector::size_type i = 0; i < value.size(); i++) + array[i] = value[i]; + +- options.push_back( pair ); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + // input image array + VOption * +-VOption::set( const char *name, std::vector value ) ++VOption::set(const char *name, std::vector value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + + VipsImage **array; + + pair->input = true; + +- g_value_init( &pair->value, VIPS_TYPE_ARRAY_IMAGE ); +- vips_value_set_array_image( &pair->value, +- static_cast< int >( value.size() ) ); +- array = vips_value_get_array_image( &pair->value, NULL ); ++ g_value_init(&pair->value, VIPS_TYPE_ARRAY_IMAGE); ++ vips_value_set_array_image(&pair->value, ++ static_cast(value.size())); ++ array = vips_value_get_array_image(&pair->value, NULL); + +- for( std::vector::size_type i = 0; i < value.size(); i++ ) { ++ for (std::vector::size_type i = 0; i < value.size(); i++) { + VipsImage *vips_image = value[i].get_image(); + + array[i] = vips_image; +- g_object_ref( vips_image ); ++ g_object_ref(vips_image); + } + +- options.push_back( pair ); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + // input blob + VOption * +-VOption::set( const char *name, VipsBlob *value ) ++VOption::set(const char *name, VipsBlob *value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + + pair->input = true; +- g_value_init( &pair->value, VIPS_TYPE_BLOB ); +- g_value_set_boxed( &pair->value, value ); +- options.push_back( pair ); ++ g_value_init(&pair->value, VIPS_TYPE_BLOB); ++ g_value_set_boxed(&pair->value, value); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + // output bool + VOption * +-VOption::set( const char *name, bool *value ) ++VOption::set(const char *name, bool *value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + + pair->input = false; + pair->vbool = value; +- g_value_init( &pair->value, G_TYPE_BOOLEAN ); ++ g_value_init(&pair->value, G_TYPE_BOOLEAN); + +- options.push_back( pair ); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + // output int + VOption * +-VOption::set( const char *name, int *value ) ++VOption::set(const char *name, int *value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + + pair->input = false; + pair->vint = value; +- g_value_init( &pair->value, G_TYPE_INT ); ++ g_value_init(&pair->value, G_TYPE_INT); + +- options.push_back( pair ); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + // output double + VOption * +-VOption::set( const char *name, double *value ) ++VOption::set(const char *name, double *value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + + pair->input = false; + pair->vdouble = value; +- g_value_init( &pair->value, G_TYPE_DOUBLE ); ++ g_value_init(&pair->value, G_TYPE_DOUBLE); + +- options.push_back( pair ); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + // output image + VOption * +-VOption::set( const char *name, VImage *value ) ++VOption::set(const char *name, VImage *value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + + pair->input = false; + pair->vimage = value; +- g_value_init( &pair->value, VIPS_TYPE_IMAGE ); ++ g_value_init(&pair->value, VIPS_TYPE_IMAGE); + +- options.push_back( pair ); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + // output doublearray + VOption * +-VOption::set( const char *name, std::vector *value ) ++VOption::set(const char *name, std::vector *value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + + pair->input = false; + pair->vvector = value; +- g_value_init( &pair->value, VIPS_TYPE_ARRAY_DOUBLE ); ++ g_value_init(&pair->value, VIPS_TYPE_ARRAY_DOUBLE); + +- options.push_back( pair ); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + // output blob + VOption * +-VOption::set( const char *name, VipsBlob **value ) ++VOption::set(const char *name, VipsBlob **value) + { +- Pair *pair = new Pair( name ); ++ Pair *pair = new Pair(name); + + pair->input = false; + pair->vblob = value; +- g_value_init( &pair->value, VIPS_TYPE_BLOB ); ++ g_value_init(&pair->value, VIPS_TYPE_BLOB); + +- options.push_back( pair ); ++ options.push_back(pair); + +- return( this ); ++ return (this); + } + + // just g_object_set_property(), except we allow set enum from string + static void +-set_property( VipsObject *object, const char *name, const GValue *value ) ++set_property(VipsObject *object, const char *name, const GValue *value) + { +- VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( object ); +- GType type = G_VALUE_TYPE( value ); ++ VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS(object); ++ GType type = G_VALUE_TYPE(value); + + GParamSpec *pspec; + VipsArgumentClass *argument_class; + VipsArgumentInstance *argument_instance; + +- if( vips_object_get_argument( object, name, +- &pspec, &argument_class, &argument_instance ) ) { +- g_warning( "%s", vips_error_buffer() ); ++ if (vips_object_get_argument(object, name, ++ &pspec, &argument_class, &argument_instance)) { ++ g_warning("%s", vips_error_buffer()); + vips_error_clear(); + return; + } + +- if( G_IS_PARAM_SPEC_ENUM( pspec ) && +- type == G_TYPE_STRING ) { +- GType pspec_type = G_PARAM_SPEC_VALUE_TYPE( pspec ); ++ if (G_IS_PARAM_SPEC_ENUM(pspec) && ++ type == G_TYPE_STRING) { ++ GType pspec_type = G_PARAM_SPEC_VALUE_TYPE(pspec); + + int enum_value; + GValue value2 = { 0 }; + +- if( (enum_value = vips_enum_from_nick( object_class->nickname, +- pspec_type, g_value_get_string( value ) )) < 0 ) { +- g_warning( "%s", vips_error_buffer() ); ++ if ((enum_value = vips_enum_from_nick(object_class->nickname, ++ pspec_type, g_value_get_string(value))) < 0) { ++ g_warning("%s", vips_error_buffer()); + vips_error_clear(); + return; + } + +- g_value_init( &value2, pspec_type ); +- g_value_set_enum( &value2, enum_value ); +- g_object_set_property( G_OBJECT( object ), name, &value2 ); +- g_value_unset( &value2 ); ++ g_value_init(&value2, pspec_type); ++ g_value_set_enum(&value2, enum_value); ++ g_object_set_property(G_OBJECT(object), name, &value2); ++ g_value_unset(&value2); + } + else +- g_object_set_property( G_OBJECT( object ), name, value ); ++ g_object_set_property(G_OBJECT(object), name, value); + } + + // walk the options and set props on the operation + void +-VOption::set_operation( VipsOperation *operation ) ++VOption::set_operation(VipsOperation *operation) + { + std::list::iterator i; + +- for( i = options.begin(); i != options.end(); ++i ) +- if( (*i)->input ) { ++ for (i = options.begin(); i != options.end(); ++i) ++ if ((*i)->input) { + #ifdef VIPS_DEBUG_VERBOSE +- printf( "set_operation: " ); +- vips_object_print_name( VIPS_OBJECT( operation ) ); ++ printf("set_operation: "); ++ vips_object_print_name(VIPS_OBJECT(operation)); + char *str_value = +- g_strdup_value_contents( &(*i)->value ); +- printf( ".%s = %s\n", (*i)->name, str_value ); +- g_free( str_value ); ++ g_strdup_value_contents(&(*i)->value); ++ printf(".%s = %s\n", (*i)->name, str_value); ++ g_free(str_value); + #endif /*VIPS_DEBUG_VERBOSE*/ + +- set_property( VIPS_OBJECT( operation ), +- (*i)->name, &(*i)->value ); ++ set_property(VIPS_OBJECT(operation), ++ (*i)->name, &(*i)->value); + } + } + + // walk the options and fetch any requested outputs + void +-VOption::get_operation( VipsOperation *operation ) ++VOption::get_operation(VipsOperation *operation) + { + std::list::iterator i; + +- for( i = options.begin(); i != options.end(); ++i ) +- if( ! (*i)->input ) { ++ for (i = options.begin(); i != options.end(); ++i) ++ if (!(*i)->input) { + const char *name = (*i)->name; + +- g_object_get_property( G_OBJECT( operation ), +- name, &(*i)->value ); ++ g_object_get_property(G_OBJECT(operation), ++ name, &(*i)->value); + + #ifdef VIPS_DEBUG_VERBOSE +- printf( "get_operation: " ); +- vips_object_print_name( VIPS_OBJECT( operation ) ); ++ printf("get_operation: "); ++ vips_object_print_name(VIPS_OBJECT(operation)); + char *str_value = g_strdup_value_contents( +- &(*i)->value ); +- printf( ".%s = %s\n", name, str_value ); +- g_free( str_value ); ++ &(*i)->value); ++ printf(".%s = %s\n", name, str_value); ++ g_free(str_value); + #endif /*VIPS_DEBUG_VERBOSE*/ + + GValue *value = &(*i)->value; +- GType type = G_VALUE_TYPE( value ); ++ GType type = G_VALUE_TYPE(value); + +- if( type == VIPS_TYPE_IMAGE ) { ++ if (type == VIPS_TYPE_IMAGE) { + // rebox object + VipsImage *image = VIPS_IMAGE( +- g_value_get_object( value ) ); +- *((*i)->vimage) = VImage( image ); ++ g_value_get_object(value)); ++ *((*i)->vimage) = VImage(image); + } +- else if( type == G_TYPE_INT ) +- *((*i)->vint) = g_value_get_int( value ); +- else if( type == G_TYPE_BOOLEAN ) +- *((*i)->vbool) = g_value_get_boolean( value ); +- else if( type == G_TYPE_DOUBLE ) +- *((*i)->vdouble) = g_value_get_double( value ); +- else if( type == VIPS_TYPE_ARRAY_DOUBLE ) { ++ else if (type == G_TYPE_INT) ++ *((*i)->vint) = g_value_get_int(value); ++ else if (type == G_TYPE_BOOLEAN) ++ *((*i)->vbool) = g_value_get_boolean(value); ++ else if (type == G_TYPE_DOUBLE) ++ *((*i)->vdouble) = g_value_get_double(value); ++ else if (type == VIPS_TYPE_ARRAY_DOUBLE) { + int length; + double *array = +- vips_value_get_array_double( value, +- &length ); ++ vips_value_get_array_double(value, ++ &length); + +- ((*i)->vvector)->resize( length ); +- for( int j = 0; j < length; j++ ) ++ ((*i)->vvector)->resize(length); ++ for (int j = 0; j < length; j++) + (*((*i)->vvector))[j] = array[j]; + } +- else if( type == VIPS_TYPE_BLOB ) { ++ else if (type == VIPS_TYPE_BLOB) { + // our caller gets a reference + *((*i)->vblob) = +- (VipsBlob *) g_value_dup_boxed( value ); ++ (VipsBlob *) g_value_dup_boxed(value); + } + } + } + + void +-VImage::call_option_string( const char *operation_name, +- const char *option_string, VOption *options ) ++VImage::call_option_string(const char *operation_name, ++ const char *option_string, VOption *options) + { + VipsOperation *operation; + +- VIPS_DEBUG_MSG( "call_option_string: starting for %s ...\n", +- operation_name ); ++ VIPS_DEBUG_MSG("call_option_string: starting for %s ...\n", ++ operation_name); + +- if( !(operation = vips_operation_new( operation_name )) ) { ++ if (!(operation = vips_operation_new(operation_name))) { + delete options; +- throw( VError() ); ++ throw(VError()); + } + + /* Set str options before vargs options, so the user can't + * override things we set deliberately. + */ +- if( option_string && +- vips_object_set_from_string( VIPS_OBJECT( operation ), +- option_string ) ) { +- vips_object_unref_outputs( VIPS_OBJECT( operation ) ); +- g_object_unref( operation ); ++ if (option_string && ++ vips_object_set_from_string(VIPS_OBJECT(operation), ++ option_string)) { ++ vips_object_unref_outputs(VIPS_OBJECT(operation)); ++ g_object_unref(operation); + delete options; +- throw( VError() ); ++ throw(VError()); + } + +- if( options ) +- options->set_operation( operation ); ++ if (options) ++ options->set_operation(operation); + + /* Build from cache. + */ +- if( vips_cache_operation_buildp( &operation ) ) { +- vips_object_unref_outputs( VIPS_OBJECT( operation ) ); +- g_object_unref( operation ); ++ if (vips_cache_operation_buildp(&operation)) { ++ vips_object_unref_outputs(VIPS_OBJECT(operation)); ++ g_object_unref(operation); + delete options; +- throw( VError() ); ++ throw(VError()); + } + + /* Walk args again, writing output. + */ +- if( options ) +- options->get_operation( operation ); ++ if (options) ++ options->get_operation(operation); + + /* We're done with options! + */ +@@ -548,17 +548,17 @@ VImage::call_option_string( const char *operation_name, + * one of its arguments or have finished its work. Either + * way, we can unref. + */ +- g_object_unref( operation ); ++ g_object_unref(operation); + } + + void +-VImage::call( const char *operation_name, VOption *options ) ++VImage::call(const char *operation_name, VOption *options) + { +- call_option_string( operation_name, NULL, options ); ++ call_option_string(operation_name, NULL, options); + } + + VImage +-VImage::new_from_file( const char *name, VOption *options ) ++VImage::new_from_file(const char *name, VOption *options) + { + char filename[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; +@@ -566,147 +566,139 @@ VImage::new_from_file( const char *name, VOption *options ) + + VImage out; + +- vips__filename_split8( name, filename, option_string ); +- if( !(operation_name = vips_foreign_find_load( filename )) ) { ++ vips__filename_split8(name, filename, option_string); ++ if (!(operation_name = vips_foreign_find_load(filename))) { + delete options; + throw VError(); + } + +- call_option_string( operation_name, option_string, +- (options ? options : VImage::option())-> +- set( "filename", filename )-> +- set( "out", &out ) ); ++ call_option_string(operation_name, option_string, ++ (options ? options : VImage::option())->set("filename", filename)->set("out", &out)); + +- return( out ); ++ return (out); + } + + VImage +-VImage::new_from_buffer( const void *buf, size_t len, const char *option_string, +- VOption *options ) ++VImage::new_from_buffer(const void *buf, size_t len, const char *option_string, ++ VOption *options) + { + const char *operation_name; + VipsBlob *blob; + VImage out; + +- if( !(operation_name = vips_foreign_find_load_buffer( buf, len )) ) { ++ if (!(operation_name = vips_foreign_find_load_buffer(buf, len))) { + delete options; +- throw( VError() ); ++ throw(VError()); + } + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, buf, len ); +- options = (options ? options : VImage::option())-> +- set( "buffer", blob )-> +- set( "out", &out ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ blob = vips_blob_new(NULL, buf, len); ++ options = (options ? options : VImage::option())->set("buffer", blob)->set("out", &out); ++ vips_area_unref(VIPS_AREA(blob)); + +- call_option_string( operation_name, option_string, options ); ++ call_option_string(operation_name, option_string, options); + +- return( out ); ++ return (out); + } + + VImage +-VImage::new_from_buffer( const std::string &buf, const char *option_string, +- VOption *options ) ++VImage::new_from_buffer(const std::string &buf, const char *option_string, ++ VOption *options) + { +- return( new_from_buffer( buf.c_str(), buf.size(), +- option_string, options ) ); ++ return (new_from_buffer(buf.c_str(), buf.size(), ++ option_string, options)); + } + + VImage +-VImage::new_from_source( VSource source, const char *option_string, +- VOption *options ) ++VImage::new_from_source(VSource source, const char *option_string, ++ VOption *options) + { + const char *operation_name; + VImage out; + +- if( !(operation_name = vips_foreign_find_load_source( +- source.get_source() )) ) { ++ if (!(operation_name = vips_foreign_find_load_source( ++ source.get_source()))) { + delete options; +- throw( VError() ); ++ throw(VError()); + } + +- options = (options ? options : VImage::option())-> +- set( "source", source )-> +- set( "out", &out ); ++ options = (options ? options : VImage::option())->set("source", source)->set("out", &out); + +- call_option_string( operation_name, option_string, options ); ++ call_option_string(operation_name, option_string, options); + +- return( out ); ++ return (out); + } + +-VImage +-VImage::new_from_memory_steal( void *data, size_t size, +- int width, int height, int bands, VipsBandFormat format ) ++VImage ++VImage::new_from_memory_steal(void *data, size_t size, ++ int width, int height, int bands, VipsBandFormat format) + { + VipsImage *image; + +- if( !(image = vips_image_new_from_memory( data, size, +- width, height, bands, format )) ) +- throw( VError() ); ++ if (!(image = vips_image_new_from_memory(data, size, ++ width, height, bands, format))) ++ throw(VError()); + +- g_signal_connect( image, "postclose", +- G_CALLBACK( vips_image_free_buffer ), data); ++ g_signal_connect(image, "postclose", ++ G_CALLBACK(vips_image_free_buffer), data); + +- return( VImage( image ) ); ++ return (VImage(image)); + } + + VImage +-VImage::new_matrix( int width, int height ) ++VImage::new_matrix(int width, int height) + { +- return( VImage( vips_image_new_matrix( width, height ) ) ); ++ return (VImage(vips_image_new_matrix(width, height))); + } + + VImage +-VImage::new_matrixv( int width, int height, ... ) ++VImage::new_matrixv(int width, int height, ...) + { +- VImage matrix = new_matrix( width, height ); ++ VImage matrix = new_matrix(width, height); + VipsImage *vips_matrix = matrix.get_image(); + + va_list ap; + +- va_start( ap, height ); +- for( int y = 0; y < height; y++ ) +- for( int x = 0; x < width; x++ ) +- *VIPS_MATRIX( vips_matrix, x, y ) = +- va_arg( ap, double ); +- va_end( ap ); ++ va_start(ap, height); ++ for (int y = 0; y < height; y++) ++ for (int x = 0; x < width; x++) ++ *VIPS_MATRIX(vips_matrix, x, y) = ++ va_arg(ap, double); ++ va_end(ap); + +- return( matrix ); ++ return (matrix); + } + + VImage +-VImage::write( VImage out ) const ++VImage::write(VImage out) const + { +- if( vips_image_write( this->get_image(), out.get_image() ) ) ++ if (vips_image_write(this->get_image(), out.get_image())) + throw VError(); + +- return( out ); ++ return (out); + } + + void +-VImage::write_to_file( const char *name, VOption *options ) const ++VImage::write_to_file(const char *name, VOption *options) const + { + char filename[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; + const char *operation_name; + +- vips__filename_split8( name, filename, option_string ); +- if( !(operation_name = vips_foreign_find_save( filename )) ) { ++ vips__filename_split8(name, filename, option_string); ++ if (!(operation_name = vips_foreign_find_save(filename))) { + delete options; + throw VError(); + } + +- call_option_string( operation_name, option_string, +- (options ? options : VImage::option())-> +- set( "in", *this )-> +- set( "filename", filename ) ); ++ call_option_string(operation_name, option_string, ++ (options ? options : VImage::option())->set("in", *this)->set("filename", filename)); + } + + void +-VImage::write_to_buffer( const char *suffix, void **buf, size_t *size, +- VOption *options ) const ++VImage::write_to_buffer(const char *suffix, void **buf, size_t *size, ++ VOption *options) const + { + char filename[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; +@@ -718,87 +710,81 @@ VImage::write_to_buffer( const char *suffix, void **buf, size_t *size, + * + * We need to hide any errors from this first phase. + */ +- vips__filename_split8( suffix, filename, option_string ); ++ vips__filename_split8(suffix, filename, option_string); + + vips_error_freeze(); +- operation_name = vips_foreign_find_save_target( filename ); ++ operation_name = vips_foreign_find_save_target(filename); + vips_error_thaw(); + +- if( operation_name ) { ++ if (operation_name) { + VTarget target = VTarget::new_to_memory(); + +- call_option_string( operation_name, option_string, +- (options ? options : VImage::option())-> +- set( "in", *this )-> +- set( "target", target ) ); ++ call_option_string(operation_name, option_string, ++ (options ? options : VImage::option())->set("in", *this)->set("target", target)); + +- g_object_get( target.get_target(), "blob", &blob, (void *) NULL ); ++ g_object_get(target.get_target(), "blob", &blob, (void *) NULL); + } +- else if( (operation_name = vips_foreign_find_save_buffer( filename )) ) { +- call_option_string( operation_name, option_string, +- (options ? options : VImage::option())-> +- set( "in", *this )-> +- set( "buffer", &blob ) ); ++ else if ((operation_name = vips_foreign_find_save_buffer(filename))) { ++ call_option_string(operation_name, option_string, ++ (options ? options : VImage::option())->set("in", *this)->set("buffer", &blob)); + } + else { + delete options; + throw VError(); + } + +- if( blob ) { +- if( buf ) { +- *buf = VIPS_AREA( blob )->data; +- VIPS_AREA( blob )->free_fn = NULL; ++ if (blob) { ++ if (buf) { ++ *buf = VIPS_AREA(blob)->data; ++ VIPS_AREA(blob)->free_fn = NULL; + } +- if( size ) +- *size = VIPS_AREA( blob )->length; ++ if (size) ++ *size = VIPS_AREA(blob)->length; + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + } + } + + void +-VImage::write_to_target( const char *suffix, VTarget target, +- VOption *options ) const ++VImage::write_to_target(const char *suffix, VTarget target, ++ VOption *options) const + { + char filename[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; + const char *operation_name; + +- vips__filename_split8( suffix, filename, option_string ); +- if( !(operation_name = vips_foreign_find_save_target( filename )) ) { ++ vips__filename_split8(suffix, filename, option_string); ++ if (!(operation_name = vips_foreign_find_save_target(filename))) { + delete options; + throw VError(); + } + +- call_option_string( operation_name, option_string, +- (options ? options : VImage::option())-> +- set( "in", *this )-> +- set( "target", target ) ); ++ call_option_string(operation_name, option_string, ++ (options ? options : VImage::option())->set("in", *this)->set("target", target)); + } + + VRegion + VImage::region() const + { +- return VRegion::new_from_image( *this ); ++ return VRegion::new_from_image(*this); + } + + VRegion +-VImage::region( VipsRect *rect ) const ++VImage::region(VipsRect *rect) const + { +- VRegion region = VRegion::new_from_image( *this ); ++ VRegion region = VRegion::new_from_image(*this); + +- region.prepare( rect ); ++ region.prepare(rect); + + return region; + } + + VRegion +-VImage::region( int left, int top, int width, int height ) const ++VImage::region(int left, int top, int width, int height) const + { +- VRegion region = VRegion::new_from_image( *this ); ++ VRegion region = VRegion::new_from_image(*this); + +- region.prepare( left, top, width, height ); ++ region.prepare(left, top, width, height); + + return region; + } +@@ -806,743 +792,739 @@ VImage::region( int left, int top, int width, int height ) const + #include "vips-operators.cpp" + + std::vector +-VImage::bandsplit( VOption *options ) const ++VImage::bandsplit(VOption *options) const + { + std::vector b; + b.reserve(bands()); + +- for( int i = 0; i < bands(); i++ ) +- b.push_back( extract_band( i ) ); ++ for (int i = 0; i < bands(); i++) ++ b.push_back(extract_band(i)); + +- return( b ); ++ return (b); + } + + VImage +-VImage::bandjoin( VImage other, VOption *options ) const ++VImage::bandjoin(VImage other, VOption *options) const + { + VImage v[2] = { *this, other }; +- std::vector vec( v, v + VIPS_NUMBER( v ) ); ++ std::vector vec(v, v + VIPS_NUMBER(v)); + +- return( bandjoin( vec, options ) ); ++ return (bandjoin(vec, options)); + } + + VImage +-VImage::composite( VImage other, VipsBlendMode mode, VOption *options ) const ++VImage::composite(VImage other, VipsBlendMode mode, VOption *options) const + { + VImage v[2] = { *this, other }; +- std::vector ivec( v, v + VIPS_NUMBER( v ) ); +- int m[1] = { static_cast( mode ) }; +- std::vector mvec( m, m + VIPS_NUMBER( m ) ); ++ std::vector ivec(v, v + VIPS_NUMBER(v)); ++ int m[1] = { static_cast(mode) }; ++ std::vector mvec(m, m + VIPS_NUMBER(m)); + +- return( composite( ivec, mvec, options ) ); ++ return (composite(ivec, mvec, options)); + } + + std::complex +-VImage::minpos( VOption *options ) const ++VImage::minpos(VOption *options) const + { + double x, y; + + (void) min( +- (options ? options : VImage::option()) -> +- set( "x", &x ) -> +- set( "y", &y ) ); ++ (options ? options : VImage::option())->set("x", &x)->set("y", &y)); + +- return( std::complex( x, y ) ); ++ return (std::complex(x, y)); + } + + std::complex +-VImage::maxpos( VOption *options ) const ++VImage::maxpos(VOption *options) const + { + double x, y; + + (void) max( +- (options ? options : VImage::option()) -> +- set( "x", &x ) -> +- set( "y", &y ) ); ++ (options ? options : VImage::option())->set("x", &x)->set("y", &y)); + +- return( std::complex( x, y ) ); ++ return (std::complex(x, y)); + } + + // Operator overloads + + VImage +-VImage::operator[]( int index ) const ++VImage::operator[](int index) const + { +- return( this->extract_band( index ) ); ++ return (this->extract_band(index)); + } + + std::vector +-VImage::operator()( int x, int y ) const ++VImage::operator()(int x, int y) const + { +- return( this->getpoint( x, y ) ); ++ return (this->getpoint(x, y)); + } + + VImage +-operator+( const VImage a, const VImage b ) ++operator+(const VImage a, const VImage b) + { +- return( a.add( b ) ); ++ return (a.add(b)); + } + + VImage +-operator+( double a, const VImage b ) ++operator+(double a, const VImage b) + { +- return( b.linear( 1.0, a ) ); ++ return (b.linear(1.0, a)); + } + + VImage +-operator+( const VImage a, double b ) ++operator+(const VImage a, double b) + { +- return( a.linear( 1.0, b ) ); ++ return (a.linear(1.0, b)); + } + + VImage +-operator+( const std::vector a, const VImage b ) ++operator+(const std::vector a, const VImage b) + { +- return( b.linear( 1.0, a ) ); ++ return (b.linear(1.0, a)); + } + + VImage +-operator+( const VImage a, const std::vector b ) ++operator+(const VImage a, const std::vector b) + { +- return( a.linear( 1.0, b ) ); ++ return (a.linear(1.0, b)); + } + + VImage & +-operator+=( VImage &a, const VImage b ) ++operator+=(VImage &a, const VImage b) + { +- return( a = a + b ); ++ return (a = a + b); + } + + VImage & +-operator+=( VImage &a, const double b ) ++operator+=(VImage &a, const double b) + { +- return( a = a + b ); ++ return (a = a + b); + } + + VImage & +-operator+=( VImage &a, const std::vector b ) ++operator+=(VImage &a, const std::vector b) + { +- return( a = a + b ); ++ return (a = a + b); + } + + VImage +-operator-( const VImage a, const VImage b ) ++operator-(const VImage a, const VImage b) + { +- return( a.subtract( b ) ); ++ return (a.subtract(b)); + } + + VImage +-operator-( double a, const VImage b ) ++operator-(double a, const VImage b) + { +- return( b.linear( -1.0, a ) ); ++ return (b.linear(-1.0, a)); + } + + VImage +-operator-( const VImage a, double b ) ++operator-(const VImage a, double b) + { +- return( a.linear( 1.0, -b ) ); ++ return (a.linear(1.0, -b)); + } + + VImage +-operator-( const std::vector a, const VImage b ) ++operator-(const std::vector a, const VImage b) + { +- return( b.linear( -1.0, a ) ); ++ return (b.linear(-1.0, a)); + } + + VImage +-operator-( const VImage a, const std::vector b ) ++operator-(const VImage a, const std::vector b) + { +- return( a.linear( 1.0, vips::negate( b ) ) ); ++ return (a.linear(1.0, vips::negate(b))); + } + + VImage & +-operator-=( VImage &a, const VImage b ) ++operator-=(VImage &a, const VImage b) + { +- return( a = a - b ); ++ return (a = a - b); + } + + VImage & +-operator-=( VImage &a, const double b ) ++operator-=(VImage &a, const double b) + { +- return( a = a - b ); ++ return (a = a - b); + } + + VImage & +-operator-=( VImage &a, const std::vector b ) ++operator-=(VImage &a, const std::vector b) + { +- return( a = a - b ); ++ return (a = a - b); + } + + VImage +-operator-( const VImage a ) ++operator-(const VImage a) + { +- return( a * -1 ); ++ return (a * -1); + } + + VImage +-operator*( const VImage a, const VImage b ) ++operator*(const VImage a, const VImage b) + { +- return( a.multiply( b ) ); ++ return (a.multiply(b)); + } + + VImage +-operator*( double a, const VImage b ) ++operator*(double a, const VImage b) + { +- return( b.linear( a, 0.0 ) ); ++ return (b.linear(a, 0.0)); + } + + VImage +-operator*( const VImage a, double b ) ++operator*(const VImage a, double b) + { +- return( a.linear( b, 0.0 ) ); ++ return (a.linear(b, 0.0)); + } + + VImage +-operator*( const std::vector a, const VImage b ) ++operator*(const std::vector a, const VImage b) + { +- return( b.linear( a, 0.0 ) ); ++ return (b.linear(a, 0.0)); + } + + VImage +-operator*( const VImage a, const std::vector b ) ++operator*(const VImage a, const std::vector b) + { +- return( a.linear( b, 0.0 ) ); ++ return (a.linear(b, 0.0)); + } + + VImage & +-operator*=( VImage &a, const VImage b ) ++operator*=(VImage &a, const VImage b) + { +- return( a = a * b ); ++ return (a = a * b); + } + + VImage & +-operator*=( VImage &a, const double b ) ++operator*=(VImage &a, const double b) + { +- return( a = a * b ); ++ return (a = a * b); + } + + VImage & +-operator*=( VImage &a, const std::vector b ) ++operator*=(VImage &a, const std::vector b) + { +- return( a = a * b ); ++ return (a = a * b); + } + + VImage +-operator/( const VImage a, const VImage b ) ++operator/(const VImage a, const VImage b) + { +- return( a.divide( b ) ); ++ return (a.divide(b)); + } + + VImage +-operator/( double a, const VImage b ) ++operator/(double a, const VImage b) + { +- return( b.pow( -1.0 ).linear( a, 0.0 ) ); ++ return (b.pow(-1.0).linear(a, 0.0)); + } + + VImage +-operator/( const VImage a, double b ) ++operator/(const VImage a, double b) + { +- return( a.linear( 1.0 / b, 0.0 ) ); ++ return (a.linear(1.0 / b, 0.0)); + } + + VImage +-operator/( const std::vector a, const VImage b ) ++operator/(const std::vector a, const VImage b) + { +- return( b.pow( -1.0 ).linear( a, 0.0 ) ); ++ return (b.pow(-1.0).linear(a, 0.0)); + } + + VImage +-operator/( const VImage a, const std::vector b ) ++operator/(const VImage a, const std::vector b) + { +- return( a.linear( vips::invert( b ), 0.0 ) ); ++ return (a.linear(vips::invert(b), 0.0)); + } + + VImage & +-operator/=( VImage &a, const VImage b ) ++operator/=(VImage &a, const VImage b) + { +- return( a = a / b ); ++ return (a = a / b); + } + + VImage & +-operator/=( VImage &a, const double b ) ++operator/=(VImage &a, const double b) + { +- return( a = a / b ); ++ return (a = a / b); + } + + VImage & +-operator/=( VImage &a, const std::vector b ) ++operator/=(VImage &a, const std::vector b) + { +- return( a = a / b ); ++ return (a = a / b); + } + + VImage +-operator%( const VImage a, const VImage b ) ++operator%(const VImage a, const VImage b) + { +- return( a.remainder( b ) ); ++ return (a.remainder(b)); + } + + VImage +-operator%( const VImage a, const double b ) ++operator%(const VImage a, const double b) + { +- return( a.remainder_const( to_vector( b ) ) ); ++ return (a.remainder_const(to_vector(b))); + } + + VImage +-operator%( const VImage a, const std::vector b ) ++operator%(const VImage a, const std::vector b) + { +- return( a.remainder_const( b ) ); ++ return (a.remainder_const(b)); + } + + VImage & +-operator%=( VImage &a, const VImage b ) ++operator%=(VImage &a, const VImage b) + { +- return( a = a % b ); ++ return (a = a % b); + } + + VImage & +-operator%=( VImage &a, const double b ) ++operator%=(VImage &a, const double b) + { +- return( a = a % b ); ++ return (a = a % b); + } + + VImage & +-operator%=( VImage &a, const std::vector b ) ++operator%=(VImage &a, const std::vector b) + { +- return( a = a % b ); ++ return (a = a % b); + } + + VImage +-operator<( const VImage a, const VImage b ) ++operator<(const VImage a, const VImage b) + { +- return( a.relational( b, VIPS_OPERATION_RELATIONAL_LESS ) ); ++ return (a.relational(b, VIPS_OPERATION_RELATIONAL_LESS)); + } + + VImage +-operator<( const double a, const VImage b ) ++operator<(const double a, const VImage b) + { +- return( b.relational_const( VIPS_OPERATION_RELATIONAL_MORE, +- to_vector( a ) ) ); ++ return (b.relational_const(VIPS_OPERATION_RELATIONAL_MORE, ++ to_vector(a))); + } + + VImage +-operator<( const VImage a, const double b ) ++operator<(const VImage a, const double b) + { +- return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESS, +- to_vector( b ) ) ); ++ return (a.relational_const(VIPS_OPERATION_RELATIONAL_LESS, ++ to_vector(b))); + } + + VImage +-operator<( const std::vector a, const VImage b ) ++operator<(const std::vector a, const VImage b) + { +- return( b.relational_const( VIPS_OPERATION_RELATIONAL_MORE, +- a ) ); ++ return (b.relational_const(VIPS_OPERATION_RELATIONAL_MORE, ++ a)); + } + + VImage +-operator<( const VImage a, const std::vector b ) ++operator<(const VImage a, const std::vector b) + { +- return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESS, +- b ) ); ++ return (a.relational_const(VIPS_OPERATION_RELATIONAL_LESS, ++ b)); + } + + VImage +-operator<=( const VImage a, const VImage b ) ++operator<=(const VImage a, const VImage b) + { +- return( a.relational( b, VIPS_OPERATION_RELATIONAL_LESSEQ ) ); ++ return (a.relational(b, VIPS_OPERATION_RELATIONAL_LESSEQ)); + } + + VImage +-operator<=( const double a, const VImage b ) ++operator<=(const double a, const VImage b) + { +- return( b.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ, +- to_vector( a ) ) ); ++ return (b.relational_const(VIPS_OPERATION_RELATIONAL_MOREEQ, ++ to_vector(a))); + } + + VImage +-operator<=( const VImage a, const double b ) ++operator<=(const VImage a, const double b) + { +- return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ, +- to_vector( b ) ) ); ++ return (a.relational_const(VIPS_OPERATION_RELATIONAL_LESSEQ, ++ to_vector(b))); + } + + VImage +-operator<=( const std::vector a, const VImage b ) ++operator<=(const std::vector a, const VImage b) + { +- return( b.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ, +- a ) ); ++ return (b.relational_const(VIPS_OPERATION_RELATIONAL_MOREEQ, ++ a)); + } + + VImage +-operator<=( const VImage a, const std::vector b ) ++operator<=(const VImage a, const std::vector b) + { +- return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ, +- b ) ); ++ return (a.relational_const(VIPS_OPERATION_RELATIONAL_LESSEQ, ++ b)); + } + + VImage +-operator>( const VImage a, const VImage b ) ++operator>(const VImage a, const VImage b) + { +- return( a.relational( b, VIPS_OPERATION_RELATIONAL_MORE ) ); ++ return (a.relational(b, VIPS_OPERATION_RELATIONAL_MORE)); + } + + VImage +-operator>( const double a, const VImage b ) ++operator>(const double a, const VImage b) + { +- return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESS, +- to_vector( a ) ) ); ++ return (b.relational_const(VIPS_OPERATION_RELATIONAL_LESS, ++ to_vector(a))); + } + + VImage +-operator>( const VImage a, const double b ) ++operator>(const VImage a, const double b) + { +- return( a.relational_const( VIPS_OPERATION_RELATIONAL_MORE, +- to_vector( b ) ) ); ++ return (a.relational_const(VIPS_OPERATION_RELATIONAL_MORE, ++ to_vector(b))); + } + + VImage +-operator>( const std::vector a, const VImage b ) ++operator>(const std::vector a, const VImage b) + { +- return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESS, +- a ) ); ++ return (b.relational_const(VIPS_OPERATION_RELATIONAL_LESS, ++ a)); + } + + VImage +-operator>( const VImage a, const std::vector b ) ++operator>(const VImage a, const std::vector b) + { +- return( a.relational_const( VIPS_OPERATION_RELATIONAL_MORE, +- b ) ); ++ return (a.relational_const(VIPS_OPERATION_RELATIONAL_MORE, ++ b)); + } + + VImage +-operator>=( const VImage a, const VImage b ) ++operator>=(const VImage a, const VImage b) + { +- return( a.relational( b, VIPS_OPERATION_RELATIONAL_MOREEQ ) ); ++ return (a.relational(b, VIPS_OPERATION_RELATIONAL_MOREEQ)); + } + + VImage +-operator>=( const double a, const VImage b ) ++operator>=(const double a, const VImage b) + { +- return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ, +- to_vector( a ) ) ); ++ return (b.relational_const(VIPS_OPERATION_RELATIONAL_LESSEQ, ++ to_vector(a))); + } + + VImage +-operator>=( const VImage a, const double b ) ++operator>=(const VImage a, const double b) + { +- return( a.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ, +- to_vector( b ) ) ); ++ return (a.relational_const(VIPS_OPERATION_RELATIONAL_MOREEQ, ++ to_vector(b))); + } + + VImage +-operator>=( const std::vector a, const VImage b ) ++operator>=(const std::vector a, const VImage b) + { +- return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ, +- a ) ); ++ return (b.relational_const(VIPS_OPERATION_RELATIONAL_LESSEQ, ++ a)); + } + + VImage +-operator>=( const VImage a, const std::vector b ) ++operator>=(const VImage a, const std::vector b) + { +- return( a.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ, +- b ) ); ++ return (a.relational_const(VIPS_OPERATION_RELATIONAL_MOREEQ, ++ b)); + } + + VImage +-operator==( const VImage a, const VImage b ) ++operator==(const VImage a, const VImage b) + { +- return( a.relational( b, VIPS_OPERATION_RELATIONAL_EQUAL ) ); ++ return (a.relational(b, VIPS_OPERATION_RELATIONAL_EQUAL)); + } + + VImage +-operator==( const double a, const VImage b ) ++operator==(const double a, const VImage b) + { +- return( b.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL, +- to_vector( a ) ) ); ++ return (b.relational_const(VIPS_OPERATION_RELATIONAL_EQUAL, ++ to_vector(a))); + } + + VImage +-operator==( const VImage a, const double b ) ++operator==(const VImage a, const double b) + { +- return( a.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL, +- to_vector( b ) ) ); ++ return (a.relational_const(VIPS_OPERATION_RELATIONAL_EQUAL, ++ to_vector(b))); + } + + VImage +-operator==( const std::vector a, const VImage b ) ++operator==(const std::vector a, const VImage b) + { +- return( b.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL, +- a ) ); ++ return (b.relational_const(VIPS_OPERATION_RELATIONAL_EQUAL, ++ a)); + } + + VImage +-operator==( const VImage a, const std::vector b ) ++operator==(const VImage a, const std::vector b) + { +- return( a.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL, +- b ) ); ++ return (a.relational_const(VIPS_OPERATION_RELATIONAL_EQUAL, ++ b)); + } + + VImage +-operator!=( const VImage a, const VImage b ) ++operator!=(const VImage a, const VImage b) + { +- return( a.relational( b, VIPS_OPERATION_RELATIONAL_NOTEQ ) ); ++ return (a.relational(b, VIPS_OPERATION_RELATIONAL_NOTEQ)); + } + + VImage +-operator!=( const double a, const VImage b ) ++operator!=(const double a, const VImage b) + { +- return( b.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ, +- to_vector( a ) ) ); ++ return (b.relational_const(VIPS_OPERATION_RELATIONAL_NOTEQ, ++ to_vector(a))); + } + + VImage +-operator!=( const VImage a, const double b ) ++operator!=(const VImage a, const double b) + { +- return( a.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ, +- to_vector( b ) ) ); ++ return (a.relational_const(VIPS_OPERATION_RELATIONAL_NOTEQ, ++ to_vector(b))); + } + + VImage +-operator!=( const std::vector a, const VImage b ) ++operator!=(const std::vector a, const VImage b) + { +- return( b.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ, +- a ) ); ++ return (b.relational_const(VIPS_OPERATION_RELATIONAL_NOTEQ, ++ a)); + } + + VImage +-operator!=( const VImage a, const std::vector b ) ++operator!=(const VImage a, const std::vector b) + { +- return( a.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ, +- b ) ); ++ return (a.relational_const(VIPS_OPERATION_RELATIONAL_NOTEQ, ++ b)); + } + + VImage +-operator&( const VImage a, const VImage b ) ++operator&(const VImage a, const VImage b) + { +- return( a.boolean( b, VIPS_OPERATION_BOOLEAN_AND ) ); ++ return (a.boolean(b, VIPS_OPERATION_BOOLEAN_AND)); + } + + VImage +-operator&( const double a, const VImage b ) ++operator&(const double a, const VImage b) + { +- return( b.boolean_const( VIPS_OPERATION_BOOLEAN_AND, +- to_vector( a ) ) ); ++ return (b.boolean_const(VIPS_OPERATION_BOOLEAN_AND, ++ to_vector(a))); + } + + VImage +-operator&( const VImage a, const double b ) ++operator&(const VImage a, const double b) + { +- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_AND, +- to_vector( b ) ) ); ++ return (a.boolean_const(VIPS_OPERATION_BOOLEAN_AND, ++ to_vector(b))); + } + + VImage +-operator&( const std::vector a, const VImage b ) ++operator&(const std::vector a, const VImage b) + { +- return( b.boolean_const( VIPS_OPERATION_BOOLEAN_AND, a ) ); ++ return (b.boolean_const(VIPS_OPERATION_BOOLEAN_AND, a)); + } + + VImage +-operator&( const VImage a, const std::vector b ) ++operator&(const VImage a, const std::vector b) + { +- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_AND, b ) ); ++ return (a.boolean_const(VIPS_OPERATION_BOOLEAN_AND, b)); + } + + VImage & +-operator&=( VImage &a, const VImage b ) ++operator&=(VImage &a, const VImage b) + { +- return( a = a & b ); ++ return (a = a & b); + } + + VImage & +-operator&=( VImage &a, const double b ) ++operator&=(VImage &a, const double b) + { +- return( a = a & b ); ++ return (a = a & b); + } + + VImage & +-operator&=( VImage &a, const std::vector b ) ++operator&=(VImage &a, const std::vector b) + { +- return( a = a & b ); ++ return (a = a & b); + } + + VImage +-operator|( const VImage a, const VImage b ) ++operator|(const VImage a, const VImage b) + { +- return( a.boolean( b, VIPS_OPERATION_BOOLEAN_OR ) ); ++ return (a.boolean(b, VIPS_OPERATION_BOOLEAN_OR)); + } + + VImage +-operator|( const double a, const VImage b ) ++operator|(const double a, const VImage b) + { +- return( b.boolean_const( VIPS_OPERATION_BOOLEAN_OR, +- to_vector( a ) ) ); ++ return (b.boolean_const(VIPS_OPERATION_BOOLEAN_OR, ++ to_vector(a))); + } + + VImage +-operator|( const VImage a, const double b ) ++operator|(const VImage a, const double b) + { +- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_OR, +- to_vector( b ) ) ); ++ return (a.boolean_const(VIPS_OPERATION_BOOLEAN_OR, ++ to_vector(b))); + } + + VImage +-operator|( const std::vector a, const VImage b ) ++operator|(const std::vector a, const VImage b) + { +- return( b.boolean_const( VIPS_OPERATION_BOOLEAN_OR, +- a ) ); ++ return (b.boolean_const(VIPS_OPERATION_BOOLEAN_OR, ++ a)); + } + + VImage +-operator|( const VImage a, const std::vector b ) ++operator|(const VImage a, const std::vector b) + { +- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_OR, +- b ) ); ++ return (a.boolean_const(VIPS_OPERATION_BOOLEAN_OR, ++ b)); + } + + VImage & +-operator|=( VImage &a, const VImage b ) ++operator|=(VImage &a, const VImage b) + { +- return( a = a | b ); ++ return (a = a | b); + } + + VImage & +-operator|=( VImage &a, const double b ) ++operator|=(VImage &a, const double b) + { +- return( a = a | b ); ++ return (a = a | b); + } + + VImage & +-operator|=( VImage &a, const std::vector b ) ++operator|=(VImage &a, const std::vector b) + { +- return( a = a | b ); ++ return (a = a | b); + } + + VImage +-operator^( const VImage a, const VImage b ) ++operator^(const VImage a, const VImage b) + { +- return( a.boolean( b, VIPS_OPERATION_BOOLEAN_EOR ) ); ++ return (a.boolean(b, VIPS_OPERATION_BOOLEAN_EOR)); + } + + VImage +-operator^( const double a, const VImage b ) ++operator^(const double a, const VImage b) + { +- return( b.boolean_const( VIPS_OPERATION_BOOLEAN_EOR, +- to_vector( a ) ) ); ++ return (b.boolean_const(VIPS_OPERATION_BOOLEAN_EOR, ++ to_vector(a))); + } + + VImage +-operator^( const VImage a, const double b ) ++operator^(const VImage a, const double b) + { +- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_EOR, +- to_vector( b ) ) ); ++ return (a.boolean_const(VIPS_OPERATION_BOOLEAN_EOR, ++ to_vector(b))); + } + + VImage +-operator^( const std::vector a, const VImage b ) ++operator^(const std::vector a, const VImage b) + { +- return( b.boolean_const( VIPS_OPERATION_BOOLEAN_EOR, +- a ) ); ++ return (b.boolean_const(VIPS_OPERATION_BOOLEAN_EOR, ++ a)); + } + + VImage +-operator^( const VImage a, const std::vector b ) ++operator^(const VImage a, const std::vector b) + { +- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_EOR, +- b ) ); ++ return (a.boolean_const(VIPS_OPERATION_BOOLEAN_EOR, ++ b)); + } + + VImage & +-operator^=( VImage &a, const VImage b ) ++operator^=(VImage &a, const VImage b) + { +- return( a = a ^ b ); ++ return (a = a ^ b); + } + + VImage & +-operator^=( VImage &a, const double b ) ++operator^=(VImage &a, const double b) + { +- return( a = a ^ b ); ++ return (a = a ^ b); + } + + VImage & +-operator^=( VImage &a, const std::vector b ) ++operator^=(VImage &a, const std::vector b) + { +- return( a = a ^ b ); ++ return (a = a ^ b); + } + + VImage +-operator<<( const VImage a, const VImage b ) ++operator<<(const VImage a, const VImage b) + { +- return( a.boolean( b, VIPS_OPERATION_BOOLEAN_LSHIFT ) ); ++ return (a.boolean(b, VIPS_OPERATION_BOOLEAN_LSHIFT)); + } + + VImage +-operator<<( const VImage a, const double b ) ++operator<<(const VImage a, const double b) + { +- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_LSHIFT, +- to_vector( b ) ) ); ++ return (a.boolean_const(VIPS_OPERATION_BOOLEAN_LSHIFT, ++ to_vector(b))); + } + + VImage +-operator<<( const VImage a, const std::vector b ) ++operator<<(const VImage a, const std::vector b) + { +- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_LSHIFT, +- b ) ); ++ return (a.boolean_const(VIPS_OPERATION_BOOLEAN_LSHIFT, ++ b)); + } + + VImage & +-operator<<=( VImage &a, const VImage b ) ++operator<<=(VImage &a, const VImage b) + { +- return( a = a << b ); ++ return (a = a << b); + } + + VImage & +-operator<<=( VImage &a, const double b ) ++operator<<=(VImage &a, const double b) + { +- return( a = a << b ); ++ return (a = a << b); + } + + VImage & +-operator<<=( VImage &a, const std::vector b ) ++operator<<=(VImage &a, const std::vector b) + { +- return( a = a << b ); ++ return (a = a << b); + } + + VImage +-operator>>( const VImage a, const VImage b ) ++operator>>(const VImage a, const VImage b) + { +- return( a.boolean( b, VIPS_OPERATION_BOOLEAN_RSHIFT ) ); ++ return (a.boolean(b, VIPS_OPERATION_BOOLEAN_RSHIFT)); + } + + VImage +-operator>>( const VImage a, const double b ) ++operator>>(const VImage a, const double b) + { +- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_RSHIFT, +- to_vector( b ) ) ); ++ return (a.boolean_const(VIPS_OPERATION_BOOLEAN_RSHIFT, ++ to_vector(b))); + } + + VImage +-operator>>( const VImage a, const std::vector b ) ++operator>>(const VImage a, const std::vector b) + { +- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_RSHIFT, +- b ) ); ++ return (a.boolean_const(VIPS_OPERATION_BOOLEAN_RSHIFT, ++ b)); + } + + VImage & +-operator>>=( VImage &a, const VImage b ) ++operator>>=(VImage &a, const VImage b) + { +- return( a = a << b ); ++ return (a = a << b); + } + + VImage & +-operator>>=( VImage &a, const double b ) ++operator>>=(VImage &a, const double b) + { +- return( a = a << b ); ++ return (a = a << b); + } + + VImage & +-operator>>=( VImage &a, const std::vector b ) ++operator>>=(VImage &a, const std::vector b) + { +- return( a = a << b ); ++ return (a = a << b); + } + + VIPS_NAMESPACE_END +diff --git a/cplusplus/VInterpolate.cpp b/cplusplus/VInterpolate.cpp +index ed1e2bd906..d1bff2f529 100644 +--- a/cplusplus/VInterpolate.cpp ++++ b/cplusplus/VInterpolate.cpp +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2001 The National Gallery ++ Copyright (C) 1991-2001 The National Gallery + +- This program is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,20 +43,20 @@ + + VIPS_NAMESPACE_START + +-VInterpolate +-VInterpolate::new_from_name( const char *name, VOption *options ) ++VInterpolate ++VInterpolate::new_from_name(const char *name, VOption *options) + { + VipsInterpolate *interp; + +- if( !(interp = vips_interpolate_new( name )) ) { +- delete options; +- throw VError(); ++ if (!(interp = vips_interpolate_new(name))) { ++ delete options; ++ throw VError(); + } +- delete options; ++ delete options; + +- VInterpolate out( interp ); ++ VInterpolate out(interp); + +- return( out ); ++ return (out); + } + + VIPS_NAMESPACE_END +diff --git a/cplusplus/VRegion.cpp b/cplusplus/VRegion.cpp +index 4a0428218d..4d95485070 100644 +--- a/cplusplus/VRegion.cpp ++++ b/cplusplus/VRegion.cpp +@@ -11,17 +11,17 @@ + VIPS_NAMESPACE_START + + VRegion +-VRegion::new_from_image( VImage image ) ++VRegion::new_from_image(VImage image) + { + VipsRegion *region; + +- if( !(region = vips_region_new( image.get_image() )) ) { ++ if (!(region = vips_region_new(image.get_image()))) { + throw VError(); + } + +- VRegion out( region ); ++ VRegion out(region); + +- return( out ); ++ return (out); + } + + VIPS_NAMESPACE_END +diff --git a/cplusplus/examples/avg.cpp b/cplusplus/examples/avg.cpp +index 100d5f9dc9..6569d32534 100644 +--- a/cplusplus/examples/avg.cpp ++++ b/cplusplus/examples/avg.cpp +@@ -1,4 +1,4 @@ +-/* ++/* + * compile with: + * + * g++ -g -Wall avg.cpp `pkg-config vips-cpp --cflags --libs` +@@ -12,20 +12,20 @@ + using namespace vips; + + int +-main( int argc, char **argv ) ++main(int argc, char **argv) + { +- if( vips_init( argv[0] ) ) +- vips_error_exit( NULL ); ++ if (vips_init(argv[0])) ++ vips_error_exit(NULL); + +- VImage in = VImage::new_from_file( argv[1], +- VImage::option()->set( "access", VIPS_ACCESS_SEQUENTIAL ) ); ++ VImage in = VImage::new_from_file(argv[1], ++ VImage::option()->set("access", VIPS_ACCESS_SEQUENTIAL)); + double avg; + +- avg = in.avg(); ++ avg = in.avg(); + +- printf( "avg = %g\n", avg ); ++ printf("avg = %g\n", avg); + + vips_shutdown(); + +- return( 0 ); ++ return (0); + } +diff --git a/cplusplus/examples/buffer.cpp b/cplusplus/examples/buffer.cpp +index c4a73e1d77..cd7b427f48 100644 +--- a/cplusplus/examples/buffer.cpp ++++ b/cplusplus/examples/buffer.cpp +@@ -1,4 +1,4 @@ +-/* ++/* + * compile with: + * + * g++ -g -Wall buffer.cpp `pkg-config vips-cpp --cflags --libs` +@@ -12,31 +12,31 @@ + using namespace vips; + + int +-main( int argc, char **argv ) ++main(int argc, char **argv) + { +- if( VIPS_INIT( argv[0] ) ) +- vips_error_exit( NULL ); ++ if (VIPS_INIT(argv[0])) ++ vips_error_exit(NULL); + + // load an image from a file +- VImage im = VImage::new_from_file( argv[1], +- VImage::option()->set( "access", "sequential" ) ); +- printf( "loaded %d x %d pixel image from %s\n", +- im.width(), im.height(), argv[1] ); ++ VImage im = VImage::new_from_file(argv[1], ++ VImage::option()->set("access", "sequential")); ++ printf("loaded %d x %d pixel image from %s\n", ++ im.width(), im.height(), argv[1]); + + // write to a formatted memory buffer + size_t size; + void *buf; +- im.write_to_buffer( ".png", &buf, &size ); +- printf( "written to memory %p in png format, %zu bytes\n", buf, size ); ++ im.write_to_buffer(".png", &buf, &size); ++ printf("written to memory %p in png format, %zu bytes\n", buf, size); + + // load from the formatted memory area +- im = VImage::new_from_buffer( buf, size, "" ); +- printf( "loaded from memory, %d x %d pixel image\n", +- im.width(), im.height() ); ++ im = VImage::new_from_buffer(buf, size, ""); ++ printf("loaded from memory, %d x %d pixel image\n", ++ im.width(), im.height()); + + // write back to a file +- im.write_to_file( argv[2] ); +- printf( "written back to %s\n", argv[2] ); ++ im.write_to_file(argv[2]); ++ printf("written back to %s\n", argv[2]); + +- return( 0 ); ++ return (0); + } +diff --git a/cplusplus/examples/embed.cpp b/cplusplus/examples/embed.cpp +index b9a7db2934..c25bb5877f 100644 +--- a/cplusplus/examples/embed.cpp ++++ b/cplusplus/examples/embed.cpp +@@ -1,4 +1,4 @@ +-/* ++/* + * compile with: + * + * g++ -g -Wall embed.cpp `pkg-config vips-cpp --cflags --libs` +@@ -12,20 +12,20 @@ + using namespace vips; + + int +-main( int argc, char **argv ) ++main(int argc, char **argv) + { +- if( vips_init( argv[0] ) ) +- vips_error_exit( NULL ); ++ if (vips_init(argv[0])) ++ vips_error_exit(NULL); + +- VImage in = VImage::new_from_file( argv[1], +- VImage::option()->set( "access", "sequential" ) ); ++ VImage in = VImage::new_from_file(argv[1], ++ VImage::option()->set("access", "sequential")); + +- VImage out = in.embed( 10, 10, 1000, 1000, +- VImage::option()->set( "extend", "copy" ) ); ++ VImage out = in.embed(10, 10, 1000, 1000, ++ VImage::option()->set("extend", "copy")); + +- out.write_to_file( argv[2] ); ++ out.write_to_file(argv[2]); + + vips_shutdown(); + +- return( 0 ); ++ return (0); + } +diff --git a/cplusplus/examples/invert.cpp b/cplusplus/examples/invert.cpp +index 08b01829f5..8880d31dda 100644 +--- a/cplusplus/examples/invert.cpp ++++ b/cplusplus/examples/invert.cpp +@@ -1,4 +1,4 @@ +-/* ++/* + * compile with: + * + * g++ -g -Wall invert.cpp `pkg-config vips-cpp --cflags --libs` +@@ -12,25 +12,25 @@ + using namespace vips; + + int +-main( int argc, char **argv ) ++main(int argc, char **argv) + { +- if( vips_init( argv[0] ) ) +- vips_error_exit( NULL ); ++ if (vips_init(argv[0])) ++ vips_error_exit(NULL); + +- printf( "these should match if VImage is compile-time-only\n" ); +- printf( "sizeof( VipsImage *) = %zd\n", sizeof( VipsImage *) ); +- printf( "sizeof( VImage ) = %zd\n", sizeof( VImage ) ); ++ printf("these should match if VImage is compile-time-only\n"); ++ printf("sizeof( VipsImage *) = %zd\n", sizeof(VipsImage *)); ++ printf("sizeof( VImage ) = %zd\n", sizeof(VImage)); + +- VImage in = VImage::new_from_file( argv[1], +- VImage::option()->set( "access", VIPS_ACCESS_SEQUENTIAL ) ); ++ VImage in = VImage::new_from_file(argv[1], ++ VImage::option()->set("access", VIPS_ACCESS_SEQUENTIAL)); + +- VImage out; ++ VImage out; + + out = in.invert(); + +- out.write_to_file( argv[2] ); ++ out.write_to_file(argv[2]); + + vips_shutdown(); + +- return( 0 ); ++ return (0); + } +diff --git a/cplusplus/examples/profile.cpp b/cplusplus/examples/profile.cpp +index cb469a08f1..bcc0ac38c5 100644 +--- a/cplusplus/examples/profile.cpp ++++ b/cplusplus/examples/profile.cpp +@@ -1,4 +1,4 @@ +-/* ++/* + * compile with: + * + * g++ -g -Wall profile.cpp `pkg-config vips-cpp --cflags --libs` +@@ -12,20 +12,20 @@ + using namespace vips; + + int +-main( int argc, char **argv ) ++main(int argc, char **argv) + { +- if( vips_init( argv[0] ) ) +- vips_error_exit( NULL ); ++ if (vips_init(argv[0])) ++ vips_error_exit(NULL); + +- VImage in = VImage::new_from_file( argv[1] ); ++ VImage in = VImage::new_from_file(argv[1]); + +- VImage rows; +- VImage cols = in.profile( &rows ); ++ VImage rows; ++ VImage cols = in.profile(&rows); + +- rows.write_to_file( argv[2] ); +- cols.write_to_file( argv[3] ); ++ rows.write_to_file(argv[2]); ++ cols.write_to_file(argv[3]); + + vips_shutdown(); + +- return( 0 ); ++ return (0); + } +diff --git a/cplusplus/examples/resize.cpp b/cplusplus/examples/resize.cpp +index fb2a47ac31..96fd5e336c 100644 +--- a/cplusplus/examples/resize.cpp ++++ b/cplusplus/examples/resize.cpp +@@ -8,21 +8,18 @@ + using namespace vips; + + int +-main( int argc, char **argv ) ++main(int argc, char **argv) + { +- if( VIPS_INIT( argv[0] ) ) +- vips_error_exit( NULL ); ++ if (VIPS_INIT(argv[0])) ++ vips_error_exit(NULL); + +- VImage in = VImage::new_from_file( argv[1], VImage::option() +- ->set( "access", "sequential" ) ); ++ VImage in = VImage::new_from_file(argv[1], VImage::option()->set("access", "sequential")); + +- VImage out = in.resize( 0.2, VImage::option() +- ->set( "kernel", "cubic" ) +- ->set( "vscale", 0.2 ) ); ++ VImage out = in.resize(0.2, VImage::option()->set("kernel", "cubic")->set("vscale", 0.2)); + +- out.write_to_file( argv[2] ); ++ out.write_to_file(argv[2]); + + vips_shutdown(); + +- return( 0 ); ++ return (0); + } +diff --git a/cplusplus/examples/test.cpp b/cplusplus/examples/test.cpp +index 8712884880..d1bb6a49f2 100644 +--- a/cplusplus/examples/test.cpp ++++ b/cplusplus/examples/test.cpp +@@ -1,7 +1,7 @@ +-/* Test the C++ API. ++/* Test the C++ API. + * + * This isn't a full test suite, look in the Python area for that. This is +- * just supposed to check that the C++ binding is working. ++ * just supposed to check that the C++ binding is working. + * + * compile with: + * +@@ -10,7 +10,7 @@ + * run with: + * + * VIPS_LEAK=1 ./a.out ~/pics/k2.jpg ~/pics/shark.jpg +- * valgrind --leak-check=yes ./a.out ~/pics/k2.jpg ~/pics/shark.jpg ++ * valgrind --leak-check=yes ./a.out ~/pics/k2.jpg ~/pics/shark.jpg + * rm x.tif + * + */ +@@ -27,368 +27,376 @@ + using namespace vips; + + bool +-equal_vector( std::vector a, std::vector b ) ++equal_vector(std::vector a, std::vector b) + { +- for( unsigned int i = 0; i < a.size(); i++ ) +- if( fabs( a[i] - b[i] ) > 0.001 ) { +- printf( "vectors differ at %u: should be [", i ); +- for( unsigned int i = 0; i < a.size(); i++ ) { +- if( i > 0 ) +- printf( ", " ); +- printf( "%g", a[i] ); ++ for (unsigned int i = 0; i < a.size(); i++) ++ if (fabs(a[i] - b[i]) > 0.001) { ++ printf("vectors differ at %u: should be [", i); ++ for (unsigned int i = 0; i < a.size(); i++) { ++ if (i > 0) ++ printf(", "); ++ printf("%g", a[i]); + } +- printf( "], is [" ); +- for( unsigned int i = 0; i < a.size(); i++ ) { +- if( i > 0 ) +- printf( ", " ); +- printf( "%g", a[i] ); ++ printf("], is ["); ++ for (unsigned int i = 0; i < a.size(); i++) { ++ if (i > 0) ++ printf(", "); ++ printf("%g", a[i]); + } +- printf( "]\n" ); ++ printf("]\n"); + +- return( false ); ++ return (false); + } + +- return( true ); ++ return (true); + } + + bool +-equal_double( double a, double b ) ++equal_double(double a, double b) + { +- if( fabs( a - b ) > 0.001 ) { +- printf( "doubles differ: should be %g, is %g\n", a, b ); +- return( false ); ++ if (fabs(a - b) > 0.001) { ++ printf("doubles differ: should be %g, is %g\n", a, b); ++ return (false); + } + +- return( true ); ++ return (true); + } + + /* We can't do this with a template, I think we'd need partially-parameterised + * template, which is C++11 only. + */ + +-/* Only test a few points and only test uchar: we are just testing the C++ +- * overloads, we rely on the python test suite for testing the underlying ++/* Only test a few points and only test uchar: we are just testing the C++ ++ * overloads, we rely on the python test suite for testing the underlying + * vips operators. + */ +-#define TEST_BINARY( OPERATOR ) \ +-void \ +-test_binary_##OPERATOR( VImage left, VImage right ) \ +-{ \ +- for( int x = 10; x < 30; x += 10 ) { \ +- std::vector p_left = left.getpoint( x, x ); \ +- std::vector p_right = right.getpoint( x, x ); \ +- std::vector p_result = \ +- OPERATOR, \ +- std::vector, \ +- std::vector >(p_left, p_right ); \ +- \ +- VImage im_result; \ +- std::vector p_im_result; \ +- \ +- /* test: image = image OP image \ +- */ \ +- im_result = OPERATOR( left, right ); \ +- p_im_result = im_result.getpoint( x, x ); \ +- \ +- if( !equal_vector( p_result, p_im_result ) ) { \ +- printf( #OPERATOR \ +- "(VImage, VImage) failed at (%d, %d)\n", \ +- x, x ); \ +- abort(); \ +- } \ +- \ +- /* test: image = image OP vec \ +- */ \ +- im_result = \ +- OPERATOR >( left, p_right );\ +- p_im_result = im_result.getpoint( x, x ); \ +- \ +- if( !equal_vector( p_result, p_im_result ) ) { \ +- printf( #OPERATOR \ +- "(VImage, vector) failed at (%d, %d)\n", \ +- x, x ); \ +- abort(); \ +- } \ +- \ +- /* test: image = vec OP image \ +- */ \ +- im_result = \ +- OPERATOR, \ +- VImage>( p_left, right ); \ +- p_im_result = im_result.getpoint( x, x ); \ +- \ +- if( !equal_vector( p_result, p_im_result ) ) { \ +- printf( #OPERATOR \ +- "(vector, VImage) failed at (%d, %d)\n", \ +- x, x ); \ +- abort(); \ +- } \ +- \ +- /* test: image = image OP double \ +- */ \ +- for( unsigned int i = 0; i < p_right.size(); i++ ) { \ +- im_result = \ +- OPERATOR( left, p_right[i] ); \ +- p_im_result = im_result.getpoint( x, x ); \ +- \ +- if( !equal_double( p_result[i], p_im_result[i] ) ) { \ +- printf( #OPERATOR \ +- "(VImage, double) failed at " \ +- "(%d, %d)\n", \ +- x, x ); \ ++#define TEST_BINARY(OPERATOR) \ ++ void \ ++ test_binary_##OPERATOR(VImage left, VImage right) \ ++ { \ ++ for (int x = 10; x < 30; x += 10) { \ ++ std::vector p_left = left.getpoint(x, x); \ ++ std::vector p_right = right.getpoint(x, x); \ ++ std::vector p_result = \ ++ OPERATOR, \ ++ std::vector, \ ++ std::vector >(p_left, p_right); \ ++\ ++ VImage im_result; \ ++ std::vector p_im_result; \ ++\ ++ /* test: image = image OP image \ ++ */ \ ++ im_result = OPERATOR(left, right); \ ++ p_im_result = im_result.getpoint(x, x); \ ++\ ++ if (!equal_vector(p_result, p_im_result)) { \ ++ printf(#OPERATOR \ ++ "(VImage, VImage) failed at (%d, %d)\n", \ ++ x, x); \ + abort(); \ + } \ +- } \ +- \ +- /* test: image = double OP image \ +- */ \ +- for( unsigned int i = 0; i < p_left.size(); i++ ) { \ ++\ ++ /* test: image = image OP vec \ ++ */ \ + im_result = \ + OPERATOR( p_left[i], right ); \ +- p_im_result = im_result.getpoint( x, x ); \ +- \ +- if( !equal_double( p_result[i], p_im_result[i] ) ) { \ +- printf( #OPERATOR \ +- "(double, VImage) failed at " \ +- "(%d, %d)\n", \ +- x, x ); \ ++ VImage, std::vector >(left, p_right); \ ++ p_im_result = im_result.getpoint(x, x); \ ++\ ++ if (!equal_vector(p_result, p_im_result)) { \ ++ printf(#OPERATOR \ ++ "(VImage, vector) failed at (%d, %d)\n", \ ++ x, x); \ ++ abort(); \ ++ } \ ++\ ++ /* test: image = vec OP image \ ++ */ \ ++ im_result = \ ++ OPERATOR, \ ++ VImage>(p_left, right); \ ++ p_im_result = im_result.getpoint(x, x); \ ++\ ++ if (!equal_vector(p_result, p_im_result)) { \ ++ printf(#OPERATOR \ ++ "(vector, VImage) failed at (%d, %d)\n", \ ++ x, x); \ + abort(); \ + } \ ++\ ++ /* test: image = image OP double \ ++ */ \ ++ for (unsigned int i = 0; i < p_right.size(); i++) { \ ++ im_result = \ ++ OPERATOR(left, p_right[i]); \ ++ p_im_result = im_result.getpoint(x, x); \ ++\ ++ if (!equal_double(p_result[i], p_im_result[i])) { \ ++ printf(#OPERATOR \ ++ "(VImage, double) failed at " \ ++ "(%d, %d)\n", \ ++ x, x); \ ++ abort(); \ ++ } \ ++ } \ ++\ ++ /* test: image = double OP image \ ++ */ \ ++ for (unsigned int i = 0; i < p_left.size(); i++) { \ ++ im_result = \ ++ OPERATOR(p_left[i], right); \ ++ p_im_result = im_result.getpoint(x, x); \ ++\ ++ if (!equal_double(p_result[i], p_im_result[i])) { \ ++ printf(#OPERATOR \ ++ "(double, VImage) failed at " \ ++ "(%d, %d)\n", \ ++ x, x); \ ++ abort(); \ ++ } \ ++ } \ + } \ +- } \ +-} ++ } + + // eg. double = double + double + // or image = double + image +-template +-A test_add( B left, C right ) ++template ++A ++test_add(B left, C right) + { +- return( left + right ); ++ return (left + right); + } + + template +-std::vector operator+(std::vector &v1, const std::vector &v2) ++std::vector ++operator+(std::vector &v1, const std::vector &v2) + { +- std::vector result( v1.size() ); ++ std::vector result(v1.size()); + +- for( unsigned int i = 0; i < v1.size(); i++ ) ++ for (unsigned int i = 0; i < v1.size(); i++) + result[i] = v1[i] + v2[i]; + +- return( result ); ++ return (result); + } + +-TEST_BINARY( test_add ); ++TEST_BINARY(test_add); + +-template +-A test_subtract( B left, C right ) ++template ++A ++test_subtract(B left, C right) + { +- return( left - right ); ++ return (left - right); + } + + template +-std::vector operator-(std::vector &v1, const std::vector &v2) ++std::vector ++operator-(std::vector &v1, const std::vector &v2) + { +- std::vector result( v1.size() ); ++ std::vector result(v1.size()); + +- for( unsigned int i = 0; i < v1.size(); i++ ) ++ for (unsigned int i = 0; i < v1.size(); i++) + result[i] = v1[i] - v2[i]; + +- return( result ); ++ return (result); + } + +-TEST_BINARY( test_subtract ); ++TEST_BINARY(test_subtract); + +-template +-A test_multiply( B left, C right ) ++template ++A ++test_multiply(B left, C right) + { +- return( left * right ); ++ return (left * right); + } + + template +-std::vector operator*(std::vector &v1, const std::vector &v2) ++std::vector ++operator*(std::vector &v1, const std::vector &v2) + { +- std::vector result( v1.size() ); ++ std::vector result(v1.size()); + +- for( unsigned int i = 0; i < v1.size(); i++ ) ++ for (unsigned int i = 0; i < v1.size(); i++) + result[i] = v1[i] * v2[i]; + +- return( result ); ++ return (result); + } + +-TEST_BINARY( test_multiply ); ++TEST_BINARY(test_multiply); + +-template +-A test_divide( B left, C right ) ++template ++A ++test_divide(B left, C right) + { +- return( left / right ); ++ return (left / right); + } + + template +-std::vector operator/(std::vector &v1, const std::vector &v2) ++std::vector ++operator/(std::vector &v1, const std::vector &v2) + { +- std::vector result( v1.size() ); ++ std::vector result(v1.size()); + +- for( unsigned int i = 0; i < v1.size(); i++ ) ++ for (unsigned int i = 0; i < v1.size(); i++) + result[i] = v1[i] / v2[i]; + +- return( result ); ++ return (result); + } + +-TEST_BINARY( test_divide ); ++TEST_BINARY(test_divide); + + int +-main( int argc, char **argv ) ++main(int argc, char **argv) + { +- if( VIPS_INIT( argv[0] ) ) +- vips_error_exit( NULL ); ++ if (VIPS_INIT(argv[0])) ++ vips_error_exit(NULL); + +- VImage left = VImage::new_from_file( argv[1] ); +- VImage right = VImage::new_from_file( argv[2] ); ++ VImage left = VImage::new_from_file(argv[1]); ++ VImage right = VImage::new_from_file(argv[2]); + +-{ +- printf( "testing constant args ...\n" ); ++ { ++ printf("testing constant args ...\n"); + +- double a[] = { 1.0, 2.0, 3.0 }; +- double b[] = { 4.0, 5.0, 6.0 }; ++ double a[] = { 1.0, 2.0, 3.0 }; ++ double b[] = { 4.0, 5.0, 6.0 }; + +- std::vector avec( a, a + VIPS_NUMBER( a ) ); +- std::vector bvec( b, b + VIPS_NUMBER( b ) ); ++ std::vector avec(a, a + VIPS_NUMBER(a)); ++ std::vector bvec(b, b + VIPS_NUMBER(b)); + +- VImage out = left.linear( avec, bvec ); ++ VImage out = left.linear(avec, bvec); + +- out.write_to_file( "x.tif" ); +-} ++ out.write_to_file("x.tif"); ++ } + +-{ +- printf( "testing operator overloads ...\n" ); +- test_binary_test_add( left, right ); +- test_binary_test_subtract( left, right ); +- test_binary_test_multiply( left, right ); +- test_binary_test_divide( left, right ); ++ { ++ printf("testing operator overloads ...\n"); ++ test_binary_test_add(left, right); ++ test_binary_test_subtract(left, right); ++ test_binary_test_multiply(left, right); ++ test_binary_test_divide(left, right); + +- VImage band_one = left[1]; ++ VImage band_one = left[1]; + +- std::vector point = left(0, 0); +-} ++ std::vector point = left(0, 0); ++ } + +-{ +- // write to a formatted memory buffer +- printf( "testing formatted memory write ...\n" ); ++ { ++ // write to a formatted memory buffer ++ printf("testing formatted memory write ...\n"); + +- size_t size; +- void *buf; +- left.write_to_buffer( ".png", &buf, &size ); +- printf( "written to memory %p in png format, %zu bytes\n", buf, size ); ++ size_t size; ++ void *buf; ++ left.write_to_buffer(".png", &buf, &size); ++ printf("written to memory %p in png format, %zu bytes\n", buf, size); + +- // load from the formatted memory area +- VImage im = VImage::new_from_buffer( buf, size, "" ); +- printf( "loaded from memory, %d x %d pixel image\n", +- im.width(), im.height() ); ++ // load from the formatted memory area ++ VImage im = VImage::new_from_buffer(buf, size, ""); ++ printf("loaded from memory, %d x %d pixel image\n", ++ im.width(), im.height()); + +- // write back to a file +- im.write_to_file( "x.tif" ); +- printf( "written back to x.tif\n" ); ++ // write back to a file ++ im.write_to_file("x.tif"); ++ printf("written back to x.tif\n"); + +- g_free( buf ); +-} ++ g_free(buf); ++ } + +-{ +- // write to a formatted AVIF memory buffer +- printf( "testing formatted AVIF memory write ...\n" ); ++ { ++ // write to a formatted AVIF memory buffer ++ printf("testing formatted AVIF memory write ...\n"); + +- if( vips_type_find("VipsOperation", "avifsave_target") != 0 ) { +- size_t size; +- void *buf; ++ if (vips_type_find("VipsOperation", "avifsave_target") != 0) { ++ size_t size; ++ void *buf; + +- // speed-up test by setting @effort to 0 +- left.write_to_buffer( ".avif", &buf, &size, +- VImage::option()->set( "effort", 0 ) ); +- printf( "written to memory %p in AVIF format, %zu bytes\n", buf, size ); ++ // speed-up test by setting @effort to 0 ++ left.write_to_buffer(".avif", &buf, &size, ++ VImage::option()->set("effort", 0)); ++ printf("written to memory %p in AVIF format, %zu bytes\n", buf, size); + +- // load from the formatted memory area +- VImage im = VImage::new_from_buffer( buf, size, "" ); +- printf( "loaded from memory, %d x %d pixel %s image\n", +- im.width(), im.height(), im.get_string("heif-compression") ); ++ // load from the formatted memory area ++ VImage im = VImage::new_from_buffer(buf, size, ""); ++ printf("loaded from memory, %d x %d pixel %s image\n", ++ im.width(), im.height(), im.get_string("heif-compression")); + +- g_free( buf ); +- } +- else { +- printf( "skipped, not compiled against libheif\n" ); ++ g_free(buf); ++ } ++ else { ++ printf("skipped, not compiled against libheif\n"); ++ } + } +-} + +-{ +- // write to a vanilla memory buffer +- printf( "testing memory array write ...\n" ); ++ { ++ // write to a vanilla memory buffer ++ printf("testing memory array write ...\n"); + +- size_t size; +- void *buf; +- buf = left.write_to_memory( &size ); +- printf( "written to memory %p as an array, %zu bytes\n", buf, size ); ++ size_t size; ++ void *buf; ++ buf = left.write_to_memory(&size); ++ printf("written to memory %p as an array, %zu bytes\n", buf, size); + +- // load from the memory array +- VImage im = VImage::new_from_memory( buf, size, +- left.width(), left.height(), left.bands(), left.format() ); +- printf( "loaded from memory array, %d x %d pixel image\n", +- im.width(), im.height() ); ++ // load from the memory array ++ VImage im = VImage::new_from_memory(buf, size, ++ left.width(), left.height(), left.bands(), left.format()); ++ printf("loaded from memory array, %d x %d pixel image\n", ++ im.width(), im.height()); + +- // write back to a file +- im.write_to_file( "x.tif" ); +- printf( "written back to x.tif\n" ); ++ // write back to a file ++ im.write_to_file("x.tif"); ++ printf("written back to x.tif\n"); + +- g_free( buf ); +-} ++ g_free(buf); ++ } + +-{ +- printf( "testing double return from operation ...\n" ); ++ { ++ printf("testing double return from operation ...\n"); + +- double avg = left.avg(); ++ double avg = left.avg(); + +- printf( "left.avg() = %g\n", avg ); +-} ++ printf("left.avg() = %g\n", avg); ++ } + +-{ +- printf( "testing optional enum args ...\n" ); ++ { ++ printf("testing optional enum args ...\n"); + +- VImage out = left.embed( 10, 10, 1000, 1000, +- VImage::option()->set( "extend", "copy" ) ); ++ VImage out = left.embed(10, 10, 1000, 1000, ++ VImage::option()->set("extend", "copy")); + +- out.write_to_file( "x.tif" ); +-} ++ out.write_to_file("x.tif"); ++ } + +-{ +- printf( "testing multiple image return ...\n" ); ++ { ++ printf("testing multiple image return ...\n"); + +- VImage rows; +- VImage cols = left.profile( &rows ); +- rows.write_to_file( "x.tif" ); +- cols.write_to_file( "x.tif" ); +-} ++ VImage rows; ++ VImage cols = left.profile(&rows); ++ rows.write_to_file("x.tif"); ++ cols.write_to_file("x.tif"); ++ } + +-{ +- printf( "testing interpolators ...\n" ); ++ { ++ printf("testing interpolators ...\n"); + +- VInterpolate interp = VInterpolate::new_from_name( "nohalo" ); ++ VInterpolate interp = VInterpolate::new_from_name("nohalo"); + +- VImage out; ++ VImage out; + +- out = left.resize( 0.2, +- VImage::option()->set( "interpolate", interp ) ); +- out.write_to_file( "x.tif" ); +-} ++ out = left.resize(0.2, ++ VImage::option()->set("interpolate", interp)); ++ out.write_to_file("x.tif"); ++ } + +-{ +- printf( "testing new_from_image() ...\n" ); ++ { ++ printf("testing new_from_image() ...\n"); + +- VImage out = left.new_from_image( 128 ); ++ VImage out = left.new_from_image(128); + +- out.write_to_file( "x.tif" ); +-} ++ out.write_to_file("x.tif"); ++ } + +- printf( "all tests passed\n" ); ++ printf("all tests passed\n"); + +- return( 0 ); ++ return (0); + } +diff --git a/cplusplus/examples/test_overloads.cpp b/cplusplus/examples/test_overloads.cpp +index ed3a25cca8..7f47cd4c9a 100644 +--- a/cplusplus/examples/test_overloads.cpp ++++ b/cplusplus/examples/test_overloads.cpp +@@ -1,5 +1,5 @@ + /* Test +/-* overloads with every combination of vector, image and double. +- * This isn't a full test suite, look in the Python area for that. ++ * This isn't a full test suite, look in the Python area for that. + * + * compile with: + * +@@ -7,7 +7,7 @@ + * + * run with: + * +- * valgrind --leak-check=yes ./a.out ~/pics/k2.jpg ~/pics/shark.jpg ++ * valgrind --leak-check=yes ./a.out ~/pics/k2.jpg ~/pics/shark.jpg + * + */ + +@@ -23,217 +23,225 @@ + using namespace vips; + + bool +-equal_vector( std::vector a, std::vector b ) ++equal_vector(std::vector a, std::vector b) + { +- for( unsigned int i = 0; i < a.size(); i++ ) +- if( fabs( a[i] - b[i] ) > 0.001 ) { +- printf( "vectors differ at %u: should be [", i ); +- for( unsigned int i = 0; i < a.size(); i++ ) { +- if( i > 0 ) +- printf( ", " ); +- printf( "%g", a[i] ); ++ for (unsigned int i = 0; i < a.size(); i++) ++ if (fabs(a[i] - b[i]) > 0.001) { ++ printf("vectors differ at %u: should be [", i); ++ for (unsigned int i = 0; i < a.size(); i++) { ++ if (i > 0) ++ printf(", "); ++ printf("%g", a[i]); + } +- printf( "], is [" ); +- for( unsigned int i = 0; i < a.size(); i++ ) { +- if( i > 0 ) +- printf( ", " ); +- printf( "%g", a[i] ); ++ printf("], is ["); ++ for (unsigned int i = 0; i < a.size(); i++) { ++ if (i > 0) ++ printf(", "); ++ printf("%g", a[i]); + } +- printf( "]\n" ); ++ printf("]\n"); + +- return( false ); ++ return (false); + } + +- return( true ); ++ return (true); + } + + bool +-equal_double( double a, double b ) ++equal_double(double a, double b) + { +- if( fabs( a - b ) > 0.001 ) { +- printf( "doubles differ: should be %g, is %g\n", a, b ); +- return( false ); ++ if (fabs(a - b) > 0.001) { ++ printf("doubles differ: should be %g, is %g\n", a, b); ++ return (false); + } + +- return( true ); ++ return (true); + } + + /* We can't do this with a template, I think we'd need partially-parameterised + * template, which is C++11 only. + */ + +-/* Only test a few points and only test uchar: we are just testing the C++ +- * overloads, we rely on the python test suite for testing the underlying ++/* Only test a few points and only test uchar: we are just testing the C++ ++ * overloads, we rely on the python test suite for testing the underlying + * vips operators. + */ +-#define TEST_BINARY( OPERATOR ) \ +-void \ +-test_binary_##OPERATOR( VImage left, VImage right ) \ +-{ \ +- for( int x = 10; x < 30; x += 10 ) { \ +- std::vector p_left = left.getpoint( x, x ); \ +- std::vector p_right = right.getpoint( x, x ); \ +- std::vector p_result = \ +- OPERATOR, \ +- std::vector, \ +- std::vector >(p_left, p_right ); \ +- \ +- VImage im_result; \ +- std::vector p_im_result; \ +- \ +- /* test: image = image OP image \ +- */ \ +- im_result = OPERATOR( left, right ); \ +- p_im_result = im_result.getpoint( x, x ); \ +- \ +- if( !equal_vector( p_result, p_im_result ) ) { \ +- printf( #OPERATOR \ +- "(VImage, VImage) failed at (%d, %d)\n", \ +- x, x ); \ +- abort(); \ +- } \ +- \ +- /* test: image = image OP vec \ +- */ \ +- im_result = \ +- OPERATOR >( left, p_right );\ +- p_im_result = im_result.getpoint( x, x ); \ +- \ +- if( !equal_vector( p_result, p_im_result ) ) { \ +- printf( #OPERATOR \ +- "(VImage, vector) failed at (%d, %d)\n", \ +- x, x ); \ +- abort(); \ +- } \ +- \ +- /* test: image = vec OP image \ +- */ \ +- im_result = \ +- OPERATOR, \ +- VImage>( p_left, right ); \ +- p_im_result = im_result.getpoint( x, x ); \ +- \ +- if( !equal_vector( p_result, p_im_result ) ) { \ +- printf( #OPERATOR \ +- "(vector, VImage) failed at (%d, %d)\n", \ +- x, x ); \ +- abort(); \ +- } \ +- \ +- /* test: image = image OP double \ +- */ \ +- for( unsigned int i = 0; i < p_right.size(); i++ ) { \ +- im_result = \ +- OPERATOR( left, p_right[i] ); \ +- p_im_result = im_result.getpoint( x, x ); \ +- \ +- if( !equal_double( p_result[i], p_im_result[i] ) ) { \ +- printf( #OPERATOR \ +- "(VImage, double) failed at " \ +- "(%d, %d)\n", \ +- x, x ); \ ++#define TEST_BINARY(OPERATOR) \ ++ void \ ++ test_binary_##OPERATOR(VImage left, VImage right) \ ++ { \ ++ for (int x = 10; x < 30; x += 10) { \ ++ std::vector p_left = left.getpoint(x, x); \ ++ std::vector p_right = right.getpoint(x, x); \ ++ std::vector p_result = \ ++ OPERATOR, \ ++ std::vector, \ ++ std::vector >(p_left, p_right); \ ++\ ++ VImage im_result; \ ++ std::vector p_im_result; \ ++\ ++ /* test: image = image OP image \ ++ */ \ ++ im_result = OPERATOR(left, right); \ ++ p_im_result = im_result.getpoint(x, x); \ ++\ ++ if (!equal_vector(p_result, p_im_result)) { \ ++ printf(#OPERATOR \ ++ "(VImage, VImage) failed at (%d, %d)\n", \ ++ x, x); \ + abort(); \ + } \ +- } \ +- \ +- /* test: image = double OP image \ +- */ \ +- for( unsigned int i = 0; i < p_left.size(); i++ ) { \ ++\ ++ /* test: image = image OP vec \ ++ */ \ + im_result = \ + OPERATOR( p_left[i], right ); \ +- p_im_result = im_result.getpoint( x, x ); \ +- \ +- if( !equal_double( p_result[i], p_im_result[i] ) ) { \ +- printf( #OPERATOR \ +- "(double, VImage) failed at " \ +- "(%d, %d)\n", \ +- x, x ); \ ++ VImage, std::vector >(left, p_right); \ ++ p_im_result = im_result.getpoint(x, x); \ ++\ ++ if (!equal_vector(p_result, p_im_result)) { \ ++ printf(#OPERATOR \ ++ "(VImage, vector) failed at (%d, %d)\n", \ ++ x, x); \ + abort(); \ + } \ ++\ ++ /* test: image = vec OP image \ ++ */ \ ++ im_result = \ ++ OPERATOR, \ ++ VImage>(p_left, right); \ ++ p_im_result = im_result.getpoint(x, x); \ ++\ ++ if (!equal_vector(p_result, p_im_result)) { \ ++ printf(#OPERATOR \ ++ "(vector, VImage) failed at (%d, %d)\n", \ ++ x, x); \ ++ abort(); \ ++ } \ ++\ ++ /* test: image = image OP double \ ++ */ \ ++ for (unsigned int i = 0; i < p_right.size(); i++) { \ ++ im_result = \ ++ OPERATOR(left, p_right[i]); \ ++ p_im_result = im_result.getpoint(x, x); \ ++\ ++ if (!equal_double(p_result[i], p_im_result[i])) { \ ++ printf(#OPERATOR \ ++ "(VImage, double) failed at " \ ++ "(%d, %d)\n", \ ++ x, x); \ ++ abort(); \ ++ } \ ++ } \ ++\ ++ /* test: image = double OP image \ ++ */ \ ++ for (unsigned int i = 0; i < p_left.size(); i++) { \ ++ im_result = \ ++ OPERATOR(p_left[i], right); \ ++ p_im_result = im_result.getpoint(x, x); \ ++\ ++ if (!equal_double(p_result[i], p_im_result[i])) { \ ++ printf(#OPERATOR \ ++ "(double, VImage) failed at " \ ++ "(%d, %d)\n", \ ++ x, x); \ ++ abort(); \ ++ } \ ++ } \ + } \ +- } \ +-} ++ } + + // eg. double = double + double + // or image = double + image +-template +-A test_add( B left, C right ) ++template ++A ++test_add(B left, C right) + { +- return( left + right ); ++ return (left + right); + } + + template +-std::vector operator+( std::vector &v1, const std::vector &v2 ) ++std::vector ++operator+(std::vector &v1, const std::vector &v2) + { +- std::vector result( v1.size() ); ++ std::vector result(v1.size()); + +- for( unsigned int i = 0; i < v1.size(); i++ ) ++ for (unsigned int i = 0; i < v1.size(); i++) + result[i] = v1[i] + v2[i]; + +- return( result ); ++ return (result); + } + +-TEST_BINARY( test_add ); ++TEST_BINARY(test_add); + +-template +-A test_subtract( B left, C right ) ++template ++A ++test_subtract(B left, C right) + { +- return( left - right ); ++ return (left - right); + } + + template +-std::vector operator-( std::vector &v1, const std::vector &v2 ) ++std::vector ++operator-(std::vector &v1, const std::vector &v2) + { +- std::vector result( v1.size() ); ++ std::vector result(v1.size()); + +- for( unsigned int i = 0; i < v1.size(); i++ ) ++ for (unsigned int i = 0; i < v1.size(); i++) + result[i] = v1[i] - v2[i]; + +- return( result ); ++ return (result); + } + +-TEST_BINARY( test_subtract ); ++TEST_BINARY(test_subtract); + +-template +-A test_multiply( B left, C right ) ++template ++A ++test_multiply(B left, C right) + { +- return( left * right ); ++ return (left * right); + } + + template +-std::vector operator*( std::vector &v1, const std::vector &v2 ) ++std::vector ++operator*(std::vector &v1, const std::vector &v2) + { +- std::vector result( v1.size() ); ++ std::vector result(v1.size()); + +- for( unsigned int i = 0; i < v1.size(); i++ ) ++ for (unsigned int i = 0; i < v1.size(); i++) + result[i] = v1[i] * v2[i]; + +- return( result ); ++ return (result); + } + +-TEST_BINARY( test_multiply ); ++TEST_BINARY(test_multiply); + +-template +-A test_divide( B left, C right ) ++template ++A ++test_divide(B left, C right) + { +- return( left / right ); ++ return (left / right); + } + + template +-std::vector operator/( std::vector &v1, const std::vector &v2 ) ++std::vector ++operator/(std::vector &v1, const std::vector &v2) + { +- std::vector result( v1.size() ); ++ std::vector result(v1.size()); + +- for( unsigned int i = 0; i < v1.size(); i++ ) ++ for (unsigned int i = 0; i < v1.size(); i++) + result[i] = v1[i] / v2[i]; + +- return( result ); ++ return (result); + } + +-TEST_BINARY( test_divide ); ++TEST_BINARY(test_divide); + + /* We can't test remainder easily, vips does not support constant % image. + */ +@@ -242,121 +250,128 @@ TEST_BINARY( test_divide ); + * double & double. + */ + +-/* Only test a few points and only test uchar: we are just testing the C++ +- * overloads, we rely on the python test suite for testing the underlying ++/* Only test a few points and only test uchar: we are just testing the C++ ++ * overloads, we rely on the python test suite for testing the underlying + * vips operators. + */ +-#define TEST_ASSIGNMENT( OPERATOR ) \ +-void \ +-test_assignment_##OPERATOR( VImage left, VImage right ) \ +-{ \ +- for( int x = 10; x < 30; x += 10 ) { \ +- std::vector p_left = left.getpoint( x, x ); \ +- std::vector p_right = right.getpoint( x, x ); \ +- std::vector p_result = p_left; \ +- OPERATOR, \ +- std::vector >( p_result, p_right ); \ +- \ +- /* test: image OP= image \ +- */ \ +- VImage im_result = left; \ +- OPERATOR( im_result, right ); \ +- std::vector p_im_result = im_result.getpoint( x, x ); \ +- \ +- if( !equal_vector( p_result, p_im_result ) ) { \ +- printf( #OPERATOR \ +- "(VImage, VImage) failed at (%d, %d)\n", \ +- x, x ); \ +- abort(); \ +- } \ +- \ +- /* test: image OP= vec \ +- */ \ +- im_result = left; \ +- OPERATOR >( im_result, p_right ); \ +- p_im_result = im_result.getpoint( x, x ); \ +- \ +- if( !equal_vector( p_result, p_im_result ) ) { \ +- printf( #OPERATOR \ +- "(VImage, vector) failed at (%d, %d)\n", \ +- x, x ); \ +- abort(); \ +- } \ +- \ +- \ +- /* test: image OP= double \ +- */ \ +- for( unsigned int i = 0; i < p_left.size(); i++ ) { \ ++#define TEST_ASSIGNMENT(OPERATOR) \ ++ void \ ++ test_assignment_##OPERATOR(VImage left, VImage right) \ ++ { \ ++ for (int x = 10; x < 30; x += 10) { \ ++ std::vector p_left = left.getpoint(x, x); \ ++ std::vector p_right = right.getpoint(x, x); \ ++ std::vector p_result = p_left; \ ++ OPERATOR, \ ++ std::vector >(p_result, p_right); \ ++\ ++ /* test: image OP= image \ ++ */ \ ++ VImage im_result = left; \ ++ OPERATOR(im_result, right); \ ++ std::vector p_im_result = im_result.getpoint(x, x); \ ++\ ++ if (!equal_vector(p_result, p_im_result)) { \ ++ printf(#OPERATOR \ ++ "(VImage, VImage) failed at (%d, %d)\n", \ ++ x, x); \ ++ abort(); \ ++ } \ ++\ ++ /* test: image OP= vec \ ++ */ \ + im_result = left; \ +- OPERATOR( im_result, p_right[i] ); \ +- p_im_result = im_result.getpoint( x, x ); \ +- \ +- if( !equal_double( p_result[i], p_im_result[i] ) ) { \ +- printf( #OPERATOR \ +- "(VImage, double) failed at " \ +- "(%d, %d)\n", \ +- x, x ); \ ++ OPERATOR >(im_result, p_right); \ ++ p_im_result = im_result.getpoint(x, x); \ ++\ ++ if (!equal_vector(p_result, p_im_result)) { \ ++ printf(#OPERATOR \ ++ "(VImage, vector) failed at (%d, %d)\n", \ ++ x, x); \ + abort(); \ + } \ ++\ ++ /* test: image OP= double \ ++ */ \ ++ for (unsigned int i = 0; i < p_left.size(); i++) { \ ++ im_result = left; \ ++ OPERATOR(im_result, p_right[i]); \ ++ p_im_result = im_result.getpoint(x, x); \ ++\ ++ if (!equal_double(p_result[i], p_im_result[i])) { \ ++ printf(#OPERATOR \ ++ "(VImage, double) failed at " \ ++ "(%d, %d)\n", \ ++ x, x); \ ++ abort(); \ ++ } \ ++ } \ + } \ +- } \ +-} ++ } + + template +-std::vector & operator+=( std::vector & a, std::vector b ) ++std::vector & ++operator+=(std::vector &a, std::vector b) + { +- return( a = a + b ); ++ return (a = a + b); + } + + template +-void test_plusequals( A &left, B right ) ++void ++test_plusequals(A &left, B right) + { + left += right; + } + +-TEST_ASSIGNMENT( test_plusequals ); ++TEST_ASSIGNMENT(test_plusequals); + + template +-std::vector & operator-=( std::vector & a, std::vector b ) ++std::vector & ++operator-=(std::vector &a, std::vector b) + { +- return( a = a - b ); ++ return (a = a - b); + } + + template +-void test_minusequals( A &left, B right ) ++void ++test_minusequals(A &left, B right) + { + left -= right; + } + +-TEST_ASSIGNMENT( test_minusequals ); ++TEST_ASSIGNMENT(test_minusequals); + + template +-std::vector & operator*=( std::vector & a, std::vector b ) ++std::vector & ++operator*=(std::vector &a, std::vector b) + { +- return( a = a * b ); ++ return (a = a * b); + } + + template +-void test_timesequals( A &left, B right ) ++void ++test_timesequals(A &left, B right) + { + left *= right; + } + +-TEST_ASSIGNMENT( test_timesequals ); ++TEST_ASSIGNMENT(test_timesequals); + + template +-std::vector & operator/=( std::vector & a, std::vector b ) ++std::vector & ++operator/=(std::vector &a, std::vector b) + { +- return( a = a / b ); ++ return (a = a / b); + } + + template +-void test_divideequals( A &left, B right ) ++void ++test_divideequals(A &left, B right) + { + left /= right; + } + +-TEST_ASSIGNMENT( test_divideequals ); ++TEST_ASSIGNMENT(test_divideequals); + + /* We can't test remainder easily, vips does not support constant % image. + */ +@@ -365,28 +380,28 @@ TEST_ASSIGNMENT( test_divideequals ); + */ + + int +-main( int argc, char **argv ) ++main(int argc, char **argv) + { +- if( VIPS_INIT( argv[0] ) ) +- vips_error_exit( NULL ); ++ if (VIPS_INIT(argv[0])) ++ vips_error_exit(NULL); + +- VImage left = VImage::new_from_file( argv[1] ); +- VImage right = VImage::new_from_file( argv[2] ); ++ VImage left = VImage::new_from_file(argv[1]); ++ VImage right = VImage::new_from_file(argv[2]); + + VImage band_one = left[1]; + std::vector point = left(0, 0); + +- test_binary_test_add( left, right ); +- test_binary_test_subtract( left, right ); +- test_binary_test_multiply( left, right ); +- test_binary_test_divide( left, right ); ++ test_binary_test_add(left, right); ++ test_binary_test_subtract(left, right); ++ test_binary_test_multiply(left, right); ++ test_binary_test_divide(left, right); + +- test_assignment_test_plusequals( left, right ); +- test_assignment_test_minusequals( left, right ); +- test_assignment_test_timesequals( left, right ); +- test_assignment_test_divideequals( left, right ); ++ test_assignment_test_plusequals(left, right); ++ test_assignment_test_minusequals(left, right); ++ test_assignment_test_timesequals(left, right); ++ test_assignment_test_divideequals(left, right); + + vips_shutdown(); + +- return( 0 ); ++ return (0); + } +diff --git a/cplusplus/include/vips/VConnection8.h b/cplusplus/include/vips/VConnection8.h +index 9668dd8157..a5a5bb2d31 100644 +--- a/cplusplus/include/vips/VConnection8.h ++++ b/cplusplus/include/vips/VConnection8.h +@@ -2,28 +2,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -36,103 +36,96 @@ VIPS_NAMESPACE_START + + /** + * A generic source object. These supply a stream of bytes that loaders can +- * use to fetch image files, see VImage::new_from_source(). ++ * use to fetch image files, see VImage::new_from_source(). + * + * Methods let you can connect a source up to memory, a file or + * a file descriptor. Use vips::VSourceCustom to implement custom sources + * using GObject signals. + */ +-class VSource : public VObject +-{ ++class VSource : public VObject { + public: + /** + * Wrap a VSource around an underlying VipsSource object. + */ +- VSource( VipsSource *input, VSteal steal = STEAL ) : +- VObject( (VipsObject *) input, steal ) ++ VSource(VipsSource *input, VSteal steal = STEAL) : VObject((VipsObject *) input, steal) + { + } + + /** + * Make a new VSource from a file descriptor. + */ +- static VSource +- new_from_descriptor( int descriptor ); ++ static VSource ++ new_from_descriptor(int descriptor); + + /** + * Make a new VSource from a file on disc. + */ +- static VSource +- new_from_file( const char *filename ); ++ static VSource ++ new_from_file(const char *filename); + + /** + * Make a new VSource from a binary object. + */ +- static VSource +- new_from_blob( VipsBlob *blob ); ++ static VSource ++ new_from_blob(VipsBlob *blob); + + /** + * Make a new VSource from an area of memory. + */ +- static VSource +- new_from_memory( const void *data, size_t size ); ++ static VSource ++ new_from_memory(const void *data, size_t size); + + /** + * Make a new VSource from a set of options encoded as a string. See + * vips_source_new(). + */ +- static VSource +- new_from_options( const char *options ); ++ static VSource ++ new_from_options(const char *options); + + /** +- * Get a pointer to the underlying VipsSoure object. ++ * Get a pointer to the underlying VipsSoure object. + */ + VipsSource * + get_source() const + { +- return( (VipsSource *) VObject::get_object() ); ++ return ((VipsSource *) VObject::get_object()); + } +- + }; + + /** + * A generic target object. Savers can use these to write a stream of bytes +- * somewhere, see VImage::write_to_target(). ++ * somewhere, see VImage::write_to_target(). + * + * Methods let you can connect a target up to memory, a file or + * a file descriptor. Use vips::VTargetCustom to implement custom targets + * using GObject signals. + */ +-class VTarget : public VObject +-{ ++class VTarget : public VObject { + public: + /** + * Wrap a VTarget around an underlying VipsTarget object. + */ +- VTarget( VipsTarget *output, VSteal steal = STEAL ) : +- VObject( (VipsObject *) output, steal ) ++ VTarget(VipsTarget *output, VSteal steal = STEAL) : VObject((VipsObject *) output, steal) + { + } + + /** +- * Make a new VTarget which, when written to, will write to a file ++ * Make a new VTarget which, when written to, will write to a file + * descriptor. + */ +- static VTarget +- new_to_descriptor( int descriptor ); ++ static VTarget ++ new_to_descriptor(int descriptor); + + /** + * Make a new VTarget which, when written to, will write to a file. + */ +- static +- VTarget new_to_file( const char *filename ); ++ static VTarget new_to_file(const char *filename); + + /** + * Make a new VTarget which, when written to, will write to a file + * descriptor. + */ +- static +- VTarget new_to_memory(); ++ static VTarget new_to_memory(); + + /** + * Get a pointer to the underlying VipsTarget object. +@@ -140,9 +133,8 @@ class VTarget : public VObject + VipsTarget * + get_target() const + { +- return( (VipsTarget *) VObject::get_object() ); ++ return ((VipsTarget *) VObject::get_object()); + } +- + }; + + VIPS_NAMESPACE_END +diff --git a/cplusplus/include/vips/VError8.h b/cplusplus/include/vips/VError8.h +index 84ee90e67e..1dfd72e99e 100644 +--- a/cplusplus/include/vips/VError8.h ++++ b/cplusplus/include/vips/VError8.h +@@ -2,32 +2,31 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +- + #ifndef VIPS_VERROR_H + #define VIPS_VERROR_H + +@@ -40,7 +39,7 @@ + VIPS_NAMESPACE_START + + /** +- * The libvips error class. It holds a single string containing an ++ * The libvips error class. It holds a single string containing an + * internationalized error message in utf-8 encoding. + */ + class VIPS_CPLUSPLUS_API VError : public std::exception { +@@ -50,25 +49,29 @@ class VIPS_CPLUSPLUS_API VError : public std::exception { + /** + * Construct a VError, setting the error message. + */ +- VError( const std::string &what ) : _what( what ) {} ++ VError(const std::string &what) : _what(what) {} + +- /** ++ /** + * Construct a VError, fetching the error message from the libvips + * error buffer. + */ +- VError() : _what( vips_error_buffer() ) {} ++ VError() : _what(vips_error_buffer()) {} + + virtual ~VError() throw() {} + + /** + * Get a reference to the underlying C string. + */ +- virtual const char *what() const throw() { return _what.c_str(); } ++ virtual const char * ++ what() const throw() ++ { ++ return _what.c_str(); ++ } + + /** + * Print the error message to a stream. + */ +- void ostream_print( std::ostream & ) const; ++ void ostream_print(std::ostream &) const; + }; + + VIPS_NAMESPACE_END +diff --git a/cplusplus/include/vips/VImage8.h b/cplusplus/include/vips/VImage8.h +index 64ec9a36f6..963ac4199e 100644 +--- a/cplusplus/include/vips/VImage8.h ++++ b/cplusplus/include/vips/VImage8.h +@@ -2,28 +2,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,11 +43,11 @@ VIPS_NAMESPACE_START + /* Small utility things. + */ + +-VIPS_CPLUSPLUS_API std::vector to_vectorv( int n, ... ); +-VIPS_CPLUSPLUS_API std::vector to_vector( double value ); +-VIPS_CPLUSPLUS_API std::vector to_vector( int n, double array[] ); +-VIPS_CPLUSPLUS_API std::vector negate( std::vector value ); +-VIPS_CPLUSPLUS_API std::vector invert( std::vector value ); ++VIPS_CPLUSPLUS_API std::vector to_vectorv(int n, ...); ++VIPS_CPLUSPLUS_API std::vector to_vector(double value); ++VIPS_CPLUSPLUS_API std::vector to_vector(int n, double array[]); ++VIPS_CPLUSPLUS_API std::vector negate(std::vector value); ++VIPS_CPLUSPLUS_API std::vector invert(std::vector value); + + /** + * Whether or not VObject should take over the reference that you pass in. See +@@ -64,11 +64,10 @@ enum VSteal { + * + * VObjects can be null (have no value set). See is_null(). + */ +-class VObject +-{ ++class VObject { + private: + // can be NULL, see eg. VObject() +- VipsObject *vobject; ++ VipsObject *vobject; + + public: + /** +@@ -77,74 +76,72 @@ class VObject + * If steal is STEAL, then the new VObject takes over the reference + * that you pass in. + */ +- VObject( VipsObject *new_vobject, VSteal steal = STEAL ) : +- vobject( new_vobject ) ++ VObject(VipsObject *new_vobject, VSteal steal = STEAL) : vobject(new_vobject) + { + // we allow NULL init, eg. "VImage a;" +- g_assert( !new_vobject || +- VIPS_IS_OBJECT( new_vobject ) ); ++ g_assert(!new_vobject || ++ VIPS_IS_OBJECT(new_vobject)); + + #ifdef VIPS_DEBUG_VERBOSE +- printf( "VObject constructor, obj = %p, steal = %d\n", +- new_vobject, steal ); +- if( new_vobject ) { +- printf( " obj " ); +- vips_object_print_name( VIPS_OBJECT( new_vobject ) ); +- printf( "\n" ); ++ printf("VObject constructor, obj = %p, steal = %d\n", ++ new_vobject, steal); ++ if (new_vobject) { ++ printf(" obj "); ++ vips_object_print_name(VIPS_OBJECT(new_vobject)); ++ printf("\n"); + } + #endif /*VIPS_DEBUG_VERBOSE*/ + +- if( !steal && vobject ) { ++ if (!steal && vobject) { + #ifdef VIPS_DEBUG_VERBOSE +- printf( " reffing object\n" ); ++ printf(" reffing object\n"); + #endif /*VIPS_DEBUG_VERBOSE*/ +- g_object_ref( vobject ); ++ g_object_ref(vobject); + } + } + +- VObject() : +- vobject( 0 ) ++ VObject() : vobject(0) + { + } + +- VObject( const VObject &a ) : +- vobject( a.vobject ) ++ VObject(const VObject &a) : vobject(a.vobject) + { +- g_assert( !vobject || +- VIPS_IS_OBJECT( vobject ) ); ++ g_assert(!vobject || ++ VIPS_IS_OBJECT(vobject)); + + #ifdef VIPS_DEBUG_VERBOSE +- printf( "VObject copy constructor, obj = %p\n", +- vobject ); +- printf( " reffing object\n" ); ++ printf("VObject copy constructor, obj = %p\n", ++ vobject); ++ printf(" reffing object\n"); + #endif /*VIPS_DEBUG_VERBOSE*/ +- if( vobject ) +- g_object_ref( vobject ); ++ if (vobject) ++ g_object_ref(vobject); + } + + // assignment ... we must delete the old ref +- VObject &operator=( const VObject &a ) ++ VObject & ++ operator=(const VObject &a) + { + #ifdef VIPS_DEBUG_VERBOSE +- printf( "VObject assignment\n" ); +- printf( " reffing %p\n", a.vobject ); +- printf( " unreffing %p\n", vobject ); ++ printf("VObject assignment\n"); ++ printf(" reffing %p\n", a.vobject); ++ printf(" unreffing %p\n", vobject); + #endif /*VIPS_DEBUG_VERBOSE*/ + +- g_assert( !vobject || +- VIPS_IS_OBJECT( vobject ) ); +- g_assert( !a.vobject || +- VIPS_IS_OBJECT( a.vobject ) ); ++ g_assert(!vobject || ++ VIPS_IS_OBJECT(vobject)); ++ g_assert(!a.vobject || ++ VIPS_IS_OBJECT(a.vobject)); + + // delete the old ref at the end ... otherwise "a = a;" could +- // unref before reffing again +- if( a.vobject ) +- g_object_ref( a.vobject ); +- if( vobject ) +- g_object_unref( vobject ); ++ // unref before reffing again ++ if (a.vobject) ++ g_object_ref(a.vobject); ++ if (vobject) ++ g_object_unref(vobject); + vobject = a.vobject; + +- return( *this ); ++ return (*this); + } + + // this mustn't be virtual: we want this class to only be a pointer, +@@ -152,15 +149,15 @@ class VObject + ~VObject() + { + #ifdef VIPS_DEBUG_VERBOSE +- printf( "VObject destructor\n" ); +- printf( " unreffing %p\n", vobject ); ++ printf("VObject destructor\n"); ++ printf(" unreffing %p\n", vobject); + #endif /*VIPS_DEBUG_VERBOSE*/ + +- g_assert( !vobject || +- VIPS_IS_OBJECT( vobject ) ); +- +- if( vobject ) +- g_object_unref( vobject ); ++ g_assert(!vobject || ++ VIPS_IS_OBJECT(vobject)); ++ ++ if (vobject) ++ g_object_unref(vobject); + } + + /** +@@ -171,20 +168,20 @@ class VObject + VipsObject * + get_object() const + { +- g_assert( !vobject || +- VIPS_IS_OBJECT( vobject ) ); ++ g_assert(!vobject || ++ VIPS_IS_OBJECT(vobject)); + +- return( vobject ); ++ return (vobject); + } + + /** + * TRUE if this is a null VObject. + */ +- bool is_null() const ++ bool ++ is_null() const + { + return vobject == 0; + } +- + }; + + class VIPS_CPLUSPLUS_API VImage; +@@ -221,11 +218,11 @@ class VOption { + const char *name; + + // the thing we pass to and from our caller +- GValue value; ++ GValue value; + + // an input or output parameter ... we guess the direction + // from the arg to set() +- bool input; ++ bool input; + + // the pointer we write output values to + union { +@@ -235,18 +232,17 @@ class VOption { + VImage *vimage; + std::vector *vvector; + VipsBlob **vblob; +- }; ++ }; + +- Pair( const char *name ) : +- name( name ), input( false ), vimage( 0 ) ++ Pair(const char *name) : name(name), input(false), vimage(0) + { + // argh = {0} won't work wil vanilla C++ +- memset( &value, 0, sizeof( GValue ) ); ++ memset(&value, 0, sizeof(GValue)); + } + + ~Pair() + { +- g_value_unset( &value ); ++ g_value_unset(&value); + } + }; + +@@ -263,34 +259,34 @@ class VOption { + * Set an input boolean option. + */ + VOption * +- set( const char *name, bool value ); ++ set(const char *name, bool value); + + /** + * Set an input int option. This is used for enums as well, or you can + * use the string version. + */ + VOption * +- set( const char *name, int value ); ++ set(const char *name, int value); + +- /** ++ /** + * Set an input unsigned 64-bit integer option. + */ + VOption * +- set( const char *name, guint64 value ); ++ set(const char *name, guint64 value); + + /** + * Set an input double option. + */ + VOption * +- set( const char *name, double value ); ++ set(const char *name, double value); + + /** +- * Set an input string option. ++ * Set an input string option. + * + * A copy is taken of the object. + */ + VOption * +- set( const char *name, const char *value ); ++ set(const char *name, const char *value); + + /** + * Set a libvips object as an option. These can be images, sources, +@@ -299,7 +295,7 @@ class VOption { + * A copy is taken of the object. + */ + VOption * +- set( const char *name, const VObject value ); ++ set(const char *name, const VObject value); + + /** + * Set an array of integers as an input option. +@@ -307,7 +303,7 @@ class VOption { + * A copy is taken of the object. + */ + VOption * +- set( const char *name, std::vector value ); ++ set(const char *name, std::vector value); + + /** + * Set an array of doubles as an input option. +@@ -315,7 +311,7 @@ class VOption { + * A copy is taken of the object. + */ + VOption * +- set( const char *name, std::vector value ); ++ set(const char *name, std::vector value); + + /** + * Set an array of images as an input option. +@@ -323,106 +319,102 @@ class VOption { + * A copy is taken of the object. + */ + VOption * +- set( const char *name, std::vector value ); ++ set(const char *name, std::vector value); + + /** + * Set a binary object an input option. Use vips_blob_new() to make +- * blobs. ++ * blobs. + * + * A copy is taken of the object. + */ + VOption * +- set( const char *name, VipsBlob *value ); ++ set(const char *name, VipsBlob *value); + + /** + * Set an option which will return a bool value. + */ + VOption * +- set( const char *name, bool *value ); ++ set(const char *name, bool *value); + + /** + * Set an option which will return an integer value. + */ + VOption * +- set( const char *name, int *value ); ++ set(const char *name, int *value); + + /** + * Set an option which will return a double value. + */ + VOption * +- set( const char *name, double *value ); ++ set(const char *name, double *value); + + /** +- * Set an option which will return a reference to an image. ++ * Set an option which will return a reference to an image. + */ + VOption * +- set( const char *name, VImage *value ); ++ set(const char *name, VImage *value); + + /** + * Set an option which will return an array of doubles. + */ + VOption * +- set( const char *name, std::vector *value ); ++ set(const char *name, std::vector *value); + + /** + * Set an option which will return a binary object, such as an ICC + * profile. + */ + VOption * +- set( const char *name, VipsBlob **blob ); ++ set(const char *name, VipsBlob **blob); + + /** + * Walk the set of options, setting options on the operation. This is + * used internally by VImage::call(). + */ +- void +- set_operation( VipsOperation *operation ); ++ void ++ set_operation(VipsOperation *operation); + + /** + * Walk the set of options, fetching any output values. This is used + * internally by VImage::call(). + */ +- void +- get_operation( VipsOperation *operation ); +- ++ void ++ get_operation(VipsOperation *operation); + }; + + /** +- * An image object. ++ * An image object. + * + * Image processing operations on images are member functions of VImage. For + * example: + * + * VImage in = VImage::new_from_file( argv[1], VImage::option() +- * ->set( "access", "sequential" ) ); ++ * ->set( "access", "sequential" ) ); + * VImage out = in.embed( 10, 10, 1000, 1000, VImage::option() + * ->set( "extend", "copy" ) ); + * out.write_to_file( argv[2] ); + * +- * VImage objects are smart pointers over the underlying VipsImage objects. ++ * VImage objects are smart pointers over the underlying VipsImage objects. + * They manage the complications of GLib's ref and unref system for you. + */ +-class VImage : public VObject +-{ ++class VImage : public VObject { + public: + using VObject::is_null; + + /** +- * Wrap a VImage around an underlying VipsImage object. ++ * Wrap a VImage around an underlying VipsImage object. + * +- * If steal is STEAL, then the VImage will take ownership of the ++ * If steal is STEAL, then the VImage will take ownership of the + * reference to the VipsImage. + */ +- VImage( VipsImage *image, VSteal steal = STEAL ) : +- VObject( (VipsObject *) image, steal ) ++ VImage(VipsImage *image, VSteal steal = STEAL) : VObject((VipsObject *) image, steal) + { + } + + /** + * An empty (NULL) VImage, eg. "VImage a;" + */ +- VImage() : +- VObject( 0 ) ++ VImage() : VObject(0) + { + } + +@@ -431,93 +423,93 @@ class VImage : public VObject + * This does not make a new reference -- you'll need to g_object_ref() + * the pointer if you need it to last. + */ +- VipsImage * ++ VipsImage * + get_image() const + { +- return( (VipsImage *) VObject::get_object() ); ++ return ((VipsImage *) VObject::get_object()); + } + + /** + * Return the width of the image in pixels. + */ +- int ++ int + width() const + { +- return( vips_image_get_width( get_image() ) ); ++ return (vips_image_get_width(get_image())); + } + + /** + * Return the height of the image in pixels. + */ +- int ++ int + height() const + { +- return( vips_image_get_height( get_image() ) ); ++ return (vips_image_get_height(get_image())); + } + + /** + * Return the number of image bands. + */ +- int ++ int + bands() const + { +- return( vips_image_get_bands( get_image() ) ); ++ return (vips_image_get_bands(get_image())); + } + + /** + * Return the image format, for example VIPS_FORMAT_UCHAR. + */ +- VipsBandFormat ++ VipsBandFormat + format() const + { +- return( vips_image_get_format( get_image() ) ); ++ return (vips_image_get_format(get_image())); + } + + /** + * Return the image coding, for example VIPS_CODING_NONE. + */ +- VipsCoding ++ VipsCoding + coding() const + { +- return( vips_image_get_coding( get_image() ) ); ++ return (vips_image_get_coding(get_image())); + } + + /** + * Return the image interpretation, for example + * VIPS_INTERPRETATION_sRGB. + */ +- VipsInterpretation ++ VipsInterpretation + interpretation() const + { +- return( vips_image_get_interpretation( get_image() ) ); ++ return (vips_image_get_interpretation(get_image())); + } + + /** + * Try to guess the image interpretation from other fields. This is + * handy if the interpretation has not been set correctly. + */ +- VipsInterpretation ++ VipsInterpretation + guess_interpretation() const + { +- return( vips_image_guess_interpretation( get_image() ) ); ++ return (vips_image_guess_interpretation(get_image())); + } + + /** + * The horizontal resolution in pixels per millimeter. + */ +- double ++ double + xres() const + { +- return( vips_image_get_xres( get_image() ) ); ++ return (vips_image_get_xres(get_image())); + } + + /** + * The vertical resolution in pixels per millimeter. + */ +- double ++ double + yres() const + { +- return( vips_image_get_yres( get_image() ) ); ++ return (vips_image_get_yres(get_image())); + } + + /** +@@ -526,7 +518,7 @@ class VImage : public VObject + int + xoffset() const + { +- return( vips_image_get_xoffset( get_image() ) ); ++ return (vips_image_get_xoffset(get_image())); + } + + /** +@@ -535,7 +527,7 @@ class VImage : public VObject + int + yoffset() const + { +- return( vips_image_get_yoffset( get_image() ) ); ++ return (vips_image_get_yoffset(get_image())); + } + + /** +@@ -544,38 +536,38 @@ class VImage : public VObject + bool + has_alpha() const + { +- return( vips_image_hasalpha( get_image() ) ); ++ return (vips_image_hasalpha(get_image())); + } + + /** +- * The name of the file this image originally came from, or NULL if +- * it's not a file image. ++ * The name of the file this image originally came from, or NULL if ++ * it's not a file image. + */ + const char * + filename() const + { +- return( vips_image_get_filename( get_image() ) ); ++ return (vips_image_get_filename(get_image())); + } + + /** + * Arrange for the underlying object to be entirely in memory, then + * return a pointer to the first pixel. +- * ++ * + * This can take a long time and need a very large amount of RAM. + */ + const void * + data() const + { +- return( vips_image_get_data( get_image() ) ); ++ return (vips_image_get_data(get_image())); + } + + /** + * Set the value of an int metadata item on an image. + */ +- void +- set( const char *field, int value ) ++ void ++ set(const char *field, int value) + { +- vips_image_set_int( this->get_image(), field, value ); ++ vips_image_set_int(this->get_image(), field, value); + } + + /** +@@ -583,10 +575,10 @@ class VImage : public VObject + * + * A copy of the array is taken. + */ +- void +- set( const char *field, int *value, int n ) ++ void ++ set(const char *field, int *value, int n) + { +- vips_image_set_array_int( this->get_image(), field, value, n ); ++ vips_image_set_array_int(this->get_image(), field, value, n); + } + + /** +@@ -594,11 +586,11 @@ class VImage : public VObject + * + * A copy of the array is taken. + */ +- void +- set( const char *field, std::vector value ) ++ void ++ set(const char *field, std::vector value) + { +- vips_image_set_array_int( this->get_image(), field, &value[0], +- static_cast( value.size() ) ); ++ vips_image_set_array_int(this->get_image(), field, &value[0], ++ static_cast(value.size())); + } + + /** +@@ -607,9 +599,9 @@ class VImage : public VObject + * A copy of the array is taken. + */ + void +- set( const char *field, double *value, int n ) ++ set(const char *field, double *value, int n) + { +- vips_image_set_array_double( this->get_image(), field, value, n ); ++ vips_image_set_array_double(this->get_image(), field, value, n); + } + + /** +@@ -618,19 +610,19 @@ class VImage : public VObject + * A copy of the array is taken. + */ + void +- set( const char *field, std::vector value ) ++ set(const char *field, std::vector value) + { +- vips_image_set_array_double( this->get_image(), field, &value[0], +- static_cast( value.size() ) ); ++ vips_image_set_array_double(this->get_image(), field, &value[0], ++ static_cast(value.size())); + } + + /** + * Set the value of a double metadata item on an image. + */ +- void +- set( const char *field, double value ) ++ void ++ set(const char *field, double value) + { +- vips_image_set_double( this->get_image(), field, value ); ++ vips_image_set_double(this->get_image(), field, value); + } + + /** +@@ -638,10 +630,10 @@ class VImage : public VObject + * + * A copy of the string is taken. + */ +- void +- set( const char *field, const char *value ) ++ void ++ set(const char *field, const char *value) + { +- vips_image_set_string( this->get_image(), field, value ); ++ vips_image_set_string(this->get_image(), field, value); + } + + /** +@@ -651,106 +643,106 @@ class VImage : public VObject + * When libvips no longer needs the value, it will be disposed with + * the free function. This can be NULL. + */ +- void +- set( const char *field, +- VipsCallbackFn free_fn, void *data, size_t length ) ++ void ++ set(const char *field, ++ VipsCallbackFn free_fn, void *data, size_t length) + { +- vips_image_set_blob( this->get_image(), field, +- free_fn, data, length ); ++ vips_image_set_blob(this->get_image(), field, ++ free_fn, data, length); + } + + /** + * Return the GType of a metadata item, or 0 if the named item does not + * exist. + */ +- GType +- get_typeof( const char *field ) const ++ GType ++ get_typeof(const char *field) const + { +- return( vips_image_get_typeof( this->get_image(), field ) ); ++ return (vips_image_get_typeof(this->get_image(), field)); + } + + /** +- * Get the value of a metadata item as an int. ++ * Get the value of a metadata item as an int. + * + * If the item is not of this type, an exception is thrown. + */ +- int +- get_int( const char *field ) const ++ int ++ get_int(const char *field) const + { + int value; + +- if( vips_image_get_int( this->get_image(), field, &value ) ) +- throw( VError() ); ++ if (vips_image_get_int(this->get_image(), field, &value)) ++ throw(VError()); + +- return( value ); ++ return (value); + } + + /** + * Get the value of a metadata item as an array of ints. Do not free +- * the result. ++ * the result. + * + * If the item is not of this type, an exception is thrown. + */ + void +- get_array_int( const char *field, int **out, int *n ) const ++ get_array_int(const char *field, int **out, int *n) const + { +- if( vips_image_get_array_int( this->get_image(), +- field, out, n ) ) +- throw( VError() ); ++ if (vips_image_get_array_int(this->get_image(), ++ field, out, n)) ++ throw(VError()); + } + + /** +- * Get the value of a metadata item as an array of ints. ++ * Get the value of a metadata item as an array of ints. + * + * If the item is not of this type, an exception is thrown. + */ +- std::vector +- get_array_int( const char *field ) const ++ std::vector ++ get_array_int(const char *field) const + { + int length; + int *array; + +- if( vips_image_get_array_int( this->get_image(), +- field, &array, &length ) ) +- throw( VError() ); ++ if (vips_image_get_array_int(this->get_image(), ++ field, &array, &length)) ++ throw(VError()); + +- std::vector vector( array, array + length ); ++ std::vector vector(array, array + length); + +- return( vector ); ++ return (vector); + } + + /** + * Get the value of a metadata item as an array of doubles. Do not free +- * the result. ++ * the result. + * + * If the item is not of this type, an exception is thrown. + */ + void +- get_array_double( const char *field, double **out, int *n ) const ++ get_array_double(const char *field, double **out, int *n) const + { +- if( vips_image_get_array_double( this->get_image(), +- field, out, n ) ) +- throw( VError() ); ++ if (vips_image_get_array_double(this->get_image(), ++ field, out, n)) ++ throw(VError()); + } + + /** +- * Get the value of a metadata item as an array of doubles. ++ * Get the value of a metadata item as an array of doubles. + * + * If the item is not of this type, an exception is thrown. + */ + std::vector +- get_array_double( const char *field ) const ++ get_array_double(const char *field) const + { + int length; + double *array; + +- if( vips_image_get_array_double( this->get_image(), +- field, &array, &length ) ) +- throw( VError() ); ++ if (vips_image_get_array_double(this->get_image(), ++ field, &array, &length)) ++ throw(VError()); + +- std::vector vector( array, array + length ); ++ std::vector vector(array, array + length); + +- return( vector ); ++ return (vector); + } + + /** +@@ -758,15 +750,15 @@ class VImage : public VObject + * + * If the item is not of this type, an exception is thrown. + */ +- double +- get_double( const char *field ) const ++ double ++ get_double(const char *field) const + { + double value; + +- if( vips_image_get_double( this->get_image(), field, &value ) ) +- throw( VError() ); ++ if (vips_image_get_double(this->get_image(), field, &value)) ++ throw(VError()); + +- return( value ); ++ return (value); + } + + /** +@@ -776,32 +768,32 @@ class VImage : public VObject + * If the item is not of this type, an exception is thrown. + */ + const char * +- get_string( const char *field ) const ++ get_string(const char *field) const + { +- const char *value; ++ const char *value; + +- if( vips_image_get_string( this->get_image(), field, &value ) ) +- throw( VError() ); ++ if (vips_image_get_string(this->get_image(), field, &value)) ++ throw(VError()); + +- return( value ); ++ return (value); + } + + /** +- * Get the value of a metadata item as a binary object. You must not ++ * Get the value of a metadata item as a binary object. You must not + * free the result. + * + * If the item is not of this type, an exception is thrown. + */ + const void * +- get_blob( const char *field, size_t *length ) const ++ get_blob(const char *field, size_t *length) const + { +- const void *value; ++ const void *value; + +- if( vips_image_get_blob( this->get_image(), field, +- &value, length ) ) +- throw( VError() ); ++ if (vips_image_get_blob(this->get_image(), field, ++ &value, length)) ++ throw(VError()); + +- return( value ); ++ return (value); + } + + /** +@@ -809,9 +801,9 @@ class VImage : public VObject + * exist. + */ + bool +- remove( const char *name ) const ++ remove(const char *name) const + { +- return( vips_image_remove( get_image(), name ) ); ++ return (vips_image_remove(get_image(), name)); + } + + /** +@@ -820,46 +812,46 @@ class VImage : public VObject + static VOption * + option() + { +- return( new VOption() ); ++ return (new VOption()); + } + + /** + * Call any libvips operation, with a set of string-encoded options as + * well as VOption. + */ +- static void +- call_option_string( const char *operation_name, +- const char *option_string, VOption *options = 0 ); ++ static void ++ call_option_string(const char *operation_name, ++ const char *option_string, VOption *options = 0); + + /** + * Call any libvips operation. + */ +- static void +- call( const char *operation_name, VOption *options = 0 ); ++ static void ++ call(const char *operation_name, VOption *options = 0); + + /** + * Make a new image which, when written to, will create a large memory + * object. See VImage::write(). + */ +- static VImage ++ static VImage + new_memory() + { +- return( VImage( vips_image_new_memory() ) ); ++ return (VImage(vips_image_new_memory())); + } + + /** + * Make a new VImage which, when written to, will craete a temporary + * file on disc. See VImage::write(). + */ +- static VImage +- new_temp_file( const char *file_format = ".v" ) ++ static VImage ++ new_temp_file(const char *file_format = ".v") + { + VipsImage *image; + +- if( !(image = vips_image_new_temp_file( file_format )) ) +- throw( VError() ); ++ if (!(image = vips_image_new_temp_file(file_format))) ++ throw(VError()); + +- return( VImage( image ) ); ++ return (VImage(image)); + } + + /** +@@ -868,8 +860,8 @@ class VImage : public VObject + * The available options depends on the image format. See for example + * VImage::jpegload(). + */ +- static VImage +- new_from_file( const char *name, VOption *options = 0 ); ++ static VImage ++ new_from_file(const char *name, VOption *options = 0); + + /** + * Create a new VImage object from an area of memory containing an +@@ -878,9 +870,9 @@ class VImage : public VObject + * The available options depends on the image format. See for example + * VImage::jpegload(). + */ +- static VImage +- new_from_buffer( const void *buf, size_t len, +- const char *option_string, VOption *options = 0 ); ++ static VImage ++ new_from_buffer(const void *buf, size_t len, ++ const char *option_string, VOption *options = 0); + + /** + * Create a new VImage object from an area of memory containing an +@@ -889,9 +881,9 @@ class VImage : public VObject + * The available options depends on the image format. See for example + * VImage::jpegload(). + */ +- static VImage +- new_from_buffer( const std::string &buf, +- const char *option_string, VOption *options = 0 ); ++ static VImage ++ new_from_buffer(const std::string &buf, ++ const char *option_string, VOption *options = 0); + + /** + * Create a new VImage object from a generic source object. +@@ -899,25 +891,25 @@ class VImage : public VObject + * The available options depends on the image format. See for example + * VImage::jpegload(). + */ +- static VImage +- new_from_source( VSource source, +- const char *option_string, VOption *options = 0 ); ++ static VImage ++ new_from_source(VSource source, ++ const char *option_string, VOption *options = 0); + + /** + * Create a new VImage object from an area of memory containing a + * C-style array. + */ +- static VImage +- new_from_memory( void *data, size_t size, +- int width, int height, int bands, VipsBandFormat format ) ++ static VImage ++ new_from_memory(void *data, size_t size, ++ int width, int height, int bands, VipsBandFormat format) + { + VipsImage *image; + +- if( !(image = vips_image_new_from_memory( data, size, +- width, height, bands, format )) ) +- throw( VError() ); ++ if (!(image = vips_image_new_from_memory(data, size, ++ width, height, bands, format))) ++ throw(VError()); + +- return( VImage( image ) ); ++ return (VImage(image)); + } + + /** +@@ -927,64 +919,64 @@ class VImage : public VObject + * The VImage steals ownership of @data and will free() it when it + * goes out of scope. + */ +- static VImage +- new_from_memory_steal( void *data, size_t size, +- int width, int height, int bands, VipsBandFormat format ); ++ static VImage ++ new_from_memory_steal(void *data, size_t size, ++ int width, int height, int bands, VipsBandFormat format); + + /** + * Create a matrix image of a specified size. All elements will be + * zero. + */ + static VImage +- new_matrix( int width, int height ); ++ new_matrix(int width, int height); + + /** + * Create a matrix image of a specified size, initialized from the + * array. + */ +- static VImage +- new_matrix( int width, int height, double *array, int size ) ++ static VImage ++ new_matrix(int width, int height, double *array, int size) + { + VipsImage *image; + +- if( !(image = vips_image_new_matrix_from_array( width, height, +- array, size )) ) +- throw( VError() ); ++ if (!(image = vips_image_new_matrix_from_array(width, height, ++ array, size))) ++ throw(VError()); + +- return( VImage( image ) ); ++ return (VImage(image)); + } + + /** + * Create a matrix image of a specified size, initialized from the + * function parameters. + */ +- static VImage +- new_matrixv( int width, int height, ... ); ++ static VImage ++ new_matrixv(int width, int height, ...); + + /** + * Make a new image of the same size and type as self, but with each + * pixel initialized with the constant. + */ +- VImage +- new_from_image( std::vector pixel ) const ++ VImage ++ new_from_image(std::vector pixel) const + { + VipsImage *image; + +- if( !(image = vips_image_new_from_image( this->get_image(), +- &pixel[0], static_cast( pixel.size() ) )) ) +- throw( VError() ); ++ if (!(image = vips_image_new_from_image(this->get_image(), ++ &pixel[0], static_cast(pixel.size())))) ++ throw(VError()); + +- return( VImage( image ) ); ++ return (VImage(image)); + } + + /** + * Make a new image of the same size and type as self, but with each + * pixel initialized with the constant. + */ +- VImage +- new_from_image( double pixel ) const ++ VImage ++ new_from_image(double pixel) const + { +- return( new_from_image( to_vectorv( 1, pixel ) ) ); ++ return (new_from_image(to_vectorv(1, pixel))); + } + + /** +@@ -998,22 +990,22 @@ class VImage : public VObject + * + * VImage::copy() adds a null "copy" node to a pipeline. Use that + * instead if you want to change metadata and not pixels. +- */ +- VImage ++ */ ++ VImage + copy_memory() const + { + VipsImage *image; + +- if( !(image = vips_image_copy_memory( this->get_image() )) ) +- throw( VError() ); ++ if (!(image = vips_image_copy_memory(this->get_image()))) ++ throw(VError()); + +- return( VImage( image ) ); ++ return (VImage(image)); + } + + /** + * Write self to out. See VImage::new_memory() etc. + */ +- VImage write( VImage out ) const; ++ VImage write(VImage out) const; + + /** + * Write an image to a file. +@@ -1021,7 +1013,7 @@ class VImage : public VObject + * The available options depends on the file format. See + * VImage::jpegsave(), for example. + */ +- void write_to_file( const char *name, VOption *options = 0 ) const; ++ void write_to_file(const char *name, VOption *options = 0) const; + + /** + * Write an image to an area of memory in the specified format. You +@@ -1036,31 +1028,31 @@ class VImage : public VObject + * The available options depends on the file format. See + * VImage::jpegsave(), for example. + */ +- void write_to_buffer( const char *suffix, void **buf, size_t *size, +- VOption *options = 0 ) const; ++ void write_to_buffer(const char *suffix, void **buf, size_t *size, ++ VOption *options = 0) const; + + /** +- * Write an image to a generic target object in the specified format. ++ * Write an image to a generic target object in the specified format. + * + * The available options depends on the file format. See + * VImage::jpegsave(), for example. + */ +- void write_to_target( const char *suffix, VTarget target, +- VOption *options = 0 ) const; ++ void write_to_target(const char *suffix, VTarget target, ++ VOption *options = 0) const; + + /** + * Write an image to an area of memory as a C-style array. + */ + void * +- write_to_memory( size_t *size ) const ++ write_to_memory(size_t *size) const + { + void *result; + +- if( !(result = vips_image_write_to_memory( this->get_image(), +- size )) ) +- throw( VError() ); ++ if (!(result = vips_image_write_to_memory(this->get_image(), ++ size))) ++ throw(VError()); + +- return( result ); ++ return (result); + } + + /** +@@ -1073,13 +1065,13 @@ class VImage : public VObject + * Acquire VRegion covering the given VipsRect. + */ + VRegion +- region( VipsRect *rect ) const; ++ region(VipsRect *rect) const; + + /** + * Acquire VRegion covering the given coordinates. + */ + VRegion +- region( int left, int top, int width, int height ) const; ++ region(int left, int top, int width, int height) const; + + /** + * Apply a linear transform to an image. For every pixel, +@@ -1087,10 +1079,10 @@ class VImage : public VObject + * out = in * a + b + */ + VImage +- linear( double a, double b, VOption *options = 0 ) const ++ linear(double a, double b, VOption *options = 0) const + { +- return( this->linear( to_vector( a ), to_vector( b ), +- options ) ); ++ return (this->linear(to_vector(a), to_vector(b), ++ options)); + } + + /** +@@ -1099,9 +1091,9 @@ class VImage : public VObject + * out = in * a + b + */ + VImage +- linear( std::vector a, double b, VOption *options = 0 ) const ++ linear(std::vector a, double b, VOption *options = 0) const + { +- return( this->linear( a, to_vector( b ), options ) ); ++ return (this->linear(a, to_vector(b), options)); + } + + /** +@@ -1110,160 +1102,160 @@ class VImage : public VObject + * out = in * a + b + */ + VImage +- linear( double a, std::vector b, VOption *options = 0 ) const ++ linear(double a, std::vector b, VOption *options = 0) const + { +- return( this->linear( to_vector( a ), b, options ) ); ++ return (this->linear(to_vector(a), b, options)); + } + + /** +- * Split a many-band image into an array of one-band images. ++ * Split a many-band image into an array of one-band images. + */ +- std::vector bandsplit( VOption *options = 0 ) const; ++ std::vector bandsplit(VOption *options = 0) const; + + /** + * Join two images bandwise. + */ +- VImage bandjoin( VImage other, VOption *options = 0 ) const; ++ VImage bandjoin(VImage other, VOption *options = 0) const; + + /** + * Append a band to an image, with each element initialized to the + * constant value. + */ + VImage +- bandjoin( double other, VOption *options = 0 ) const ++ bandjoin(double other, VOption *options = 0) const + { +- return( bandjoin( to_vector( other ), options ) ); ++ return (bandjoin(to_vector(other), options)); + } + + /** +- * Append a series of bands to an image, with each element initialized ++ * Append a series of bands to an image, with each element initialized + * to the constant values. + */ + VImage +- bandjoin( std::vector other, VOption *options = 0 ) const ++ bandjoin(std::vector other, VOption *options = 0) const + { +- return( bandjoin_const( other, options ) ); ++ return (bandjoin_const(other, options)); + } + + /** + * Composite other on top of self using the specified blending mode. + */ +- VImage composite( VImage other, VipsBlendMode mode, +- VOption *options = 0 ) const; ++ VImage composite(VImage other, VipsBlendMode mode, ++ VOption *options = 0) const; + + /** + * Find the position of the image minimum as (x, y). + */ +- std::complex minpos( VOption *options = 0 ) const; ++ std::complex minpos(VOption *options = 0) const; + + /** + * Find the position of the image maximum as (x, y). + */ +- std::complex maxpos( VOption *options = 0 ) const; ++ std::complex maxpos(VOption *options = 0) const; + + /** + * Flip the image left-right. + */ +- VImage +- fliphor( VOption *options = 0 ) const ++ VImage ++ fliphor(VOption *options = 0) const + { +- return( flip( VIPS_DIRECTION_HORIZONTAL, options ) ); ++ return (flip(VIPS_DIRECTION_HORIZONTAL, options)); + } + + /** + * Flip the image top-bottom. + */ +- VImage +- flipver( VOption *options = 0 ) const ++ VImage ++ flipver(VOption *options = 0) const + { +- return( flip( VIPS_DIRECTION_VERTICAL, options ) ); ++ return (flip(VIPS_DIRECTION_VERTICAL, options)); + } + + /** + * Rotate the image by 90 degrees clockwise. + */ +- VImage +- rot90( VOption *options = 0 ) const ++ VImage ++ rot90(VOption *options = 0) const + { +- return( rot( VIPS_ANGLE_D90, options ) ); ++ return (rot(VIPS_ANGLE_D90, options)); + } + + /** + * Rotate the image by 180 degrees. + */ +- VImage +- rot180( VOption *options = 0 ) const ++ VImage ++ rot180(VOption *options = 0) const + { +- return( rot( VIPS_ANGLE_D180, options ) ); ++ return (rot(VIPS_ANGLE_D180, options)); + } + + /** + * Rotate the image by 270 degrees clockwise. + */ +- VImage +- rot270( VOption *options = 0 ) const ++ VImage ++ rot270(VOption *options = 0) const + { +- return( rot( VIPS_ANGLE_D270, options ) ); ++ return (rot(VIPS_ANGLE_D270, options)); + } + + /** + * Dilate the image with the specified strucuring element, see +- * VImage::new_matrix(). Stucturing element values can be 0 for ++ * VImage::new_matrix(). Stucturing element values can be 0 for + * black, 255 for white and 128 for don't care. See VImage::morph(). + */ +- VImage +- dilate( VImage mask, VOption *options = 0 ) const ++ VImage ++ dilate(VImage mask, VOption *options = 0) const + { +- return( morph( mask, VIPS_OPERATION_MORPHOLOGY_DILATE, +- options ) ); ++ return (morph(mask, VIPS_OPERATION_MORPHOLOGY_DILATE, ++ options)); + } + + /** + * Erode the image with the specified strucuring element, see +- * VImage::new_matrix(). Stucturing element values can be 0 for ++ * VImage::new_matrix(). Stucturing element values can be 0 for + * black, 255 for white and 128 for don't care. See VImage::morph(). + */ +- VImage +- erode( VImage mask, VOption *options = 0 ) const ++ VImage ++ erode(VImage mask, VOption *options = 0) const + { +- return( morph( mask, VIPS_OPERATION_MORPHOLOGY_ERODE, +- options ) ); ++ return (morph(mask, VIPS_OPERATION_MORPHOLOGY_ERODE, ++ options)); + } + + /** + * A median filter of the specified size. See VImage::rank(). + */ +- VImage +- median( int size = 3, VOption *options = 0 ) const ++ VImage ++ median(int size = 3, VOption *options = 0) const + { +- return( rank( size, size, (size * size) / 2, options ) ); ++ return (rank(size, size, (size * size) / 2, options)); + } + + /** + * Convert to integer, rounding down. + */ +- VImage +- floor( VOption *options = 0 ) const ++ VImage ++ floor(VOption *options = 0) const + { +- return( round( VIPS_OPERATION_ROUND_FLOOR, options ) ); ++ return (round(VIPS_OPERATION_ROUND_FLOOR, options)); + } + + /** + * Convert to integer, rounding up. + */ +- VImage +- ceil( VOption *options = 0 ) const ++ VImage ++ ceil(VOption *options = 0) const + { +- return( round( VIPS_OPERATION_ROUND_CEIL, options ) ); ++ return (round(VIPS_OPERATION_ROUND_CEIL, options)); + } + + /** + * Convert to integer, rounding to nearest. + */ +- VImage +- rint( VOption *options = 0 ) const ++ VImage ++ rint(VOption *options = 0) const + { +- return( round( VIPS_OPERATION_ROUND_RINT, options ) ); ++ return (round(VIPS_OPERATION_ROUND_RINT, options)); + } + + /** +@@ -1272,10 +1264,10 @@ class VImage : public VObject + * + * VImage mask = (in > 128).bandand() + */ +- VImage +- bandand( VOption *options = 0 ) const ++ VImage ++ bandand(VOption *options = 0) const + { +- return( bandbool( VIPS_OPERATION_BOOLEAN_AND, options ) ); ++ return (bandbool(VIPS_OPERATION_BOOLEAN_AND, options)); + } + + /** +@@ -1284,10 +1276,10 @@ class VImage : public VObject + * + * VImage mask = (in > 128).bandand() + */ +- VImage +- bandor( VOption *options = 0 ) const ++ VImage ++ bandor(VOption *options = 0) const + { +- return( bandbool( VIPS_OPERATION_BOOLEAN_OR, options ) ); ++ return (bandbool(VIPS_OPERATION_BOOLEAN_OR, options)); + } + + /** +@@ -1296,595 +1288,595 @@ class VImage : public VObject + * + * VImage mask = (in > 128).bandand() + */ +- VImage +- bandeor( VOption *options = 0 ) const ++ VImage ++ bandeor(VOption *options = 0) const + { +- return( bandbool( VIPS_OPERATION_BOOLEAN_EOR, options ) ); ++ return (bandbool(VIPS_OPERATION_BOOLEAN_EOR, options)); + } + + /** + * Return the real part of a complex image. + */ +- VImage +- real( VOption *options = 0 ) const ++ VImage ++ real(VOption *options = 0) const + { +- return( complexget( VIPS_OPERATION_COMPLEXGET_REAL, options ) ); ++ return (complexget(VIPS_OPERATION_COMPLEXGET_REAL, options)); + } + + /** + * Return the imaginary part of a complex image. + */ +- VImage +- imag( VOption *options = 0 ) const ++ VImage ++ imag(VOption *options = 0) const + { +- return( complexget( VIPS_OPERATION_COMPLEXGET_IMAG, options ) ); ++ return (complexget(VIPS_OPERATION_COMPLEXGET_IMAG, options)); + } + + /** + * Convert a complex image to polar coordinates. + */ +- VImage +- polar( VOption *options = 0 ) const ++ VImage ++ polar(VOption *options = 0) const + { +- return( complex( VIPS_OPERATION_COMPLEX_POLAR, options ) ); ++ return (complex(VIPS_OPERATION_COMPLEX_POLAR, options)); + } + + /** + * Convert a complex image to rectangular coordinates. + */ +- VImage +- rect( VOption *options = 0 ) const ++ VImage ++ rect(VOption *options = 0) const + { +- return( complex( VIPS_OPERATION_COMPLEX_RECT, options ) ); ++ return (complex(VIPS_OPERATION_COMPLEX_RECT, options)); + } + + /** + * Find the complex conjugate. + */ +- VImage +- conj( VOption *options = 0 ) const ++ VImage ++ conj(VOption *options = 0) const + { +- return( complex( VIPS_OPERATION_COMPLEX_CONJ, options ) ); ++ return (complex(VIPS_OPERATION_COMPLEX_CONJ, options)); + } + + /** + * Find the sine of each pixel. Angles are in degrees. + */ +- VImage +- sin( VOption *options = 0 ) const ++ VImage ++ sin(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_SIN, options ) ); ++ return (math(VIPS_OPERATION_MATH_SIN, options)); + } + + /** + * Find the cosine of each pixel. Angles are in degrees. + */ +- VImage +- cos( VOption *options = 0 ) const ++ VImage ++ cos(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_COS, options ) ); ++ return (math(VIPS_OPERATION_MATH_COS, options)); + } + + /** + * Find the tangent of each pixel. Angles are in degrees. + */ +- VImage +- tan( VOption *options = 0 ) const ++ VImage ++ tan(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_TAN, options ) ); ++ return (math(VIPS_OPERATION_MATH_TAN, options)); + } + + /** + * Find the arc sine of each pixel. Angles are in degrees. + */ +- VImage +- asin( VOption *options = 0 ) const ++ VImage ++ asin(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_ASIN, options ) ); ++ return (math(VIPS_OPERATION_MATH_ASIN, options)); + } + + /** + * Find the arc cosine of each pixel. Angles are in degrees. + */ +- VImage +- acos( VOption *options = 0 ) const ++ VImage ++ acos(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_ACOS, options ) ); ++ return (math(VIPS_OPERATION_MATH_ACOS, options)); + } + + /** + * Find the arc tangent of each pixel. Angles are in degrees. + */ +- VImage +- atan( VOption *options = 0 ) const ++ VImage ++ atan(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_ATAN, options ) ); ++ return (math(VIPS_OPERATION_MATH_ATAN, options)); + } + + /** + * Find the hyperbolic sine of each pixel. Angles are in degrees. + */ +- VImage +- sinh( VOption *options = 0 ) const ++ VImage ++ sinh(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_SINH, options ) ); ++ return (math(VIPS_OPERATION_MATH_SINH, options)); + } + + /** + * Find the hyperbolic cosine of each pixel. Angles are in degrees. + */ +- VImage +- cosh( VOption *options = 0 ) const ++ VImage ++ cosh(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_COSH, options ) ); ++ return (math(VIPS_OPERATION_MATH_COSH, options)); + } + + /** + * Find the hyperbolic tangent of each pixel. Angles are in degrees. + */ +- VImage +- tanh( VOption *options = 0 ) const ++ VImage ++ tanh(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_TANH, options ) ); ++ return (math(VIPS_OPERATION_MATH_TANH, options)); + } + + /** + * Find the hyperbolic arc sine of each pixel. Angles are in radians. + */ +- VImage +- asinh( VOption *options = 0 ) const ++ VImage ++ asinh(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_ASINH, options ) ); ++ return (math(VIPS_OPERATION_MATH_ASINH, options)); + } + + /** + * Find the hyperbolic arc cosine of each pixel. Angles are in radians. + */ +- VImage +- acosh( VOption *options = 0 ) const ++ VImage ++ acosh(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_ACOSH, options ) ); ++ return (math(VIPS_OPERATION_MATH_ACOSH, options)); + } + + /** + * Find the hyperbolic arc tangent of each pixel. Angles are in radians. + */ +- VImage +- atanh( VOption *options = 0 ) const ++ VImage ++ atanh(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_ATANH, options ) ); ++ return (math(VIPS_OPERATION_MATH_ATANH, options)); + } + + /** +- * Find the natural log of each pixel. ++ * Find the natural log of each pixel. + */ +- VImage +- log( VOption *options = 0 ) const ++ VImage ++ log(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_LOG, options ) ); ++ return (math(VIPS_OPERATION_MATH_LOG, options)); + } + + /** +- * Find the base 10 log of each pixel. ++ * Find the base 10 log of each pixel. + */ +- VImage +- log10( VOption *options = 0 ) const ++ VImage ++ log10(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_LOG10, options ) ); ++ return (math(VIPS_OPERATION_MATH_LOG10, options)); + } + + /** + * Find e to the power of each pixel. + */ +- VImage +- exp( VOption *options = 0 ) const ++ VImage ++ exp(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_EXP, options ) ); ++ return (math(VIPS_OPERATION_MATH_EXP, options)); + } + + /** + * Find 10 to the power of each pixel. + */ +- VImage +- exp10( VOption *options = 0 ) const ++ VImage ++ exp10(VOption *options = 0) const + { +- return( math( VIPS_OPERATION_MATH_EXP10, options ) ); ++ return (math(VIPS_OPERATION_MATH_EXP10, options)); + } + + /** + * Raise each pixel to the specified power. + */ +- VImage +- pow( VImage other, VOption *options = 0 ) const ++ VImage ++ pow(VImage other, VOption *options = 0) const + { +- return( math2( other, VIPS_OPERATION_MATH2_POW, options ) ); ++ return (math2(other, VIPS_OPERATION_MATH2_POW, options)); + } + + /** + * Raise each pixel to the specified power. + */ +- VImage +- pow( double other, VOption *options = 0 ) const ++ VImage ++ pow(double other, VOption *options = 0) const + { +- return( math2_const( VIPS_OPERATION_MATH2_POW, +- to_vector( other ), options ) ); ++ return (math2_const(VIPS_OPERATION_MATH2_POW, ++ to_vector(other), options)); + } + + /** + * Raise each pixel to the specified power. + */ +- VImage +- pow( std::vector other, VOption *options = 0 ) const ++ VImage ++ pow(std::vector other, VOption *options = 0) const + { +- return( math2_const( VIPS_OPERATION_MATH2_POW, +- other, options ) ); ++ return (math2_const(VIPS_OPERATION_MATH2_POW, ++ other, options)); + } + + /** + * Raise other to the power of each pixel (the opposite of pow). + */ +- VImage +- wop( VImage other, VOption *options = 0 ) const ++ VImage ++ wop(VImage other, VOption *options = 0) const + { +- return( math2( other, VIPS_OPERATION_MATH2_WOP, options ) ); ++ return (math2(other, VIPS_OPERATION_MATH2_WOP, options)); + } + + /** + * Raise the constant to the power of each pixel (the opposite of pow). + */ +- VImage +- wop( double other, VOption *options = 0 ) const ++ VImage ++ wop(double other, VOption *options = 0) const + { +- return( math2_const( VIPS_OPERATION_MATH2_WOP, +- to_vector( other ), options ) ); ++ return (math2_const(VIPS_OPERATION_MATH2_WOP, ++ to_vector(other), options)); + } + + /** + * Raise the constant to the power of each pixel (the opposite of pow). + */ +- VImage +- wop( std::vector other, VOption *options = 0 ) const ++ VImage ++ wop(std::vector other, VOption *options = 0) const + { +- return( math2_const( VIPS_OPERATION_MATH2_WOP, +- other, options ) ); ++ return (math2_const(VIPS_OPERATION_MATH2_WOP, ++ other, options)); + } +- ++ + /** + * Calculate atan2 of each pixel. + */ +- VImage +- atan2( VImage other, VOption *options = 0 ) const ++ VImage ++ atan2(VImage other, VOption *options = 0) const + { +- return( math2( other, VIPS_OPERATION_MATH2_ATAN2, options ) ); ++ return (math2(other, VIPS_OPERATION_MATH2_ATAN2, options)); + } + + /** + * Calculate atan2 of each pixel. + */ +- VImage +- atan2( double other, VOption *options = 0 ) const ++ VImage ++ atan2(double other, VOption *options = 0) const + { +- return( math2_const( VIPS_OPERATION_MATH2_ATAN2, +- to_vector( other ), options ) ); ++ return (math2_const(VIPS_OPERATION_MATH2_ATAN2, ++ to_vector(other), options)); + } + + /** + * Calculate atan2 of each pixel. + */ +- VImage +- atan2( std::vector other, VOption *options = 0 ) const ++ VImage ++ atan2(std::vector other, VOption *options = 0) const + { +- return( math2_const( VIPS_OPERATION_MATH2_ATAN2, +- other, options ) ); ++ return (math2_const(VIPS_OPERATION_MATH2_ATAN2, ++ other, options)); + } + + /** + * Use self as a conditional image (not zero meaning TRUE) to pick + * pixels from th (then) or el (else). + */ +- VImage +- ifthenelse( std::vector th, VImage el, +- VOption *options = 0 ) const ++ VImage ++ ifthenelse(std::vector th, VImage el, ++ VOption *options = 0) const + { +- return( ifthenelse( el.new_from_image( th ), el, options ) ); ++ return (ifthenelse(el.new_from_image(th), el, options)); + } + + /** + * Use self as a conditional image (not zero meaning TRUE) to pick + * pixels from th (then) or el (else). + */ +- VImage +- ifthenelse( VImage th, std::vector el, +- VOption *options = 0 ) const ++ VImage ++ ifthenelse(VImage th, std::vector el, ++ VOption *options = 0) const + { +- return( ifthenelse( th, th.new_from_image( el ), options ) ); ++ return (ifthenelse(th, th.new_from_image(el), options)); + } + + /** + * Use self as a conditional image (not zero meaning TRUE) to pick + * pixels from th (then) or el (else). + */ +- VImage +- ifthenelse( std::vector th, std::vector el, +- VOption *options = 0 ) const ++ VImage ++ ifthenelse(std::vector th, std::vector el, ++ VOption *options = 0) const + { +- return( ifthenelse( new_from_image( th ), new_from_image( el ), +- options ) ); ++ return (ifthenelse(new_from_image(th), new_from_image(el), ++ options)); + } + + /** + * Use self as a conditional image (not zero meaning TRUE) to pick + * pixels from th (then) or el (else). + */ +- VImage +- ifthenelse( double th, VImage el, VOption *options = 0 ) const ++ VImage ++ ifthenelse(double th, VImage el, VOption *options = 0) const + { +- return( ifthenelse( to_vector( th ), el, options ) ); ++ return (ifthenelse(to_vector(th), el, options)); + } + + /** + * Use self as a conditional image (not zero meaning TRUE) to pick + * pixels from th (then) or el (else). + */ +- VImage +- ifthenelse( VImage th, double el, VOption *options = 0 ) const ++ VImage ++ ifthenelse(VImage th, double el, VOption *options = 0) const + { +- return( ifthenelse( th, to_vector( el ), options ) ); ++ return (ifthenelse(th, to_vector(el), options)); + } + + /** + * Use self as a conditional image (not zero meaning TRUE) to pick + * pixels from th (then) or el (else). + */ +- VImage +- ifthenelse( double th, double el, VOption *options = 0 ) const ++ VImage ++ ifthenelse(double th, double el, VOption *options = 0) const + { +- return( ifthenelse( to_vector( th ), to_vector( el ), +- options ) ); ++ return (ifthenelse(to_vector(th), to_vector(el), ++ options)); + } + + // Operator overloads + +- VImage operator[]( int index ) const; +- +- std::vector operator()( int x, int y ) const; +- +- friend VIPS_CPLUSPLUS_API VImage +- operator+( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator+( const double a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator+( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator+( const std::vector a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator+( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage & +- operator+=( VImage &a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator+=( VImage &a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator+=( VImage &a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator-( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator-( const double a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator-( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator-( const std::vector a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator-( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage & +- operator-=( VImage &a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator-=( VImage &a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator-=( VImage &a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator-( const VImage a ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator*( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator*( const double a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator*( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator*( const std::vector a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator*( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage & +- operator*=( VImage &a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator*=( VImage &a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator*=( VImage &a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator/( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator/( const double a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator/( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator/( const std::vector a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator/( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage & +- operator/=( VImage &a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator/=( VImage &a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator/=( VImage &a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator%( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator%( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator%( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage & +- operator%=( VImage &a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator%=( VImage &a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator%=( VImage &a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator<( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator<( const double a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator<( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator<( const std::vector a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator<( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator<=( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator<=( const double a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator<=( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator<=( const std::vector a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator<=( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator>( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator>( const double a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator>( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator>( const std::vector a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator>( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator>=( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator>=( const double a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator>=( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator>=( const std::vector a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator>=( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator==( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator==( const double a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator==( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator==( const std::vector a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator==( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator!=( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator!=( const double a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator!=( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator!=( const std::vector a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator!=( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator&( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator&( const double a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator&( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator&( const std::vector a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator&( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage & +- operator&=( VImage &a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator&=( VImage &a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator&=( VImage &a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator|( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator|( const double a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator|( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator|( const std::vector a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator|( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage & +- operator|=( VImage &a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator|=( VImage &a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator|=( VImage &a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator^( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator^( const double a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator^( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator^( const std::vector a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator^( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage & +- operator^=( VImage &a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator^=( VImage &a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator^=( VImage &a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator<<( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator<<( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator<<( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage & +- operator<<=( VImage &a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator<<=( VImage &a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator<<=( VImage &a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage +- operator>>( const VImage a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator>>( const VImage a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage +- operator>>( const VImage a, const std::vector b ); +- +- friend VIPS_CPLUSPLUS_API VImage & +- operator>>=( VImage &a, const VImage b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator>>=( VImage &a, const double b ); +- friend VIPS_CPLUSPLUS_API VImage & +- operator>>=( VImage &a, const std::vector b ); ++ VImage operator[](int index) const; ++ ++ std::vector operator()(int x, int y) const; ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator+(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator+(const double a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator+(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator+(const std::vector a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator+(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator+=(VImage &a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator+=(VImage &a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator+=(VImage &a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator-(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator-(const double a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator-(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator-(const std::vector a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator-(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator-=(VImage &a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator-=(VImage &a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator-=(VImage &a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator-(const VImage a); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator*(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator*(const double a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator*(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator*(const std::vector a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator*(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator*=(VImage &a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator*=(VImage &a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator*=(VImage &a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator/(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator/(const double a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator/(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator/(const std::vector a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator/(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator/=(VImage &a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator/=(VImage &a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator/=(VImage &a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator%(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator%(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator%(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator%=(VImage &a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator%=(VImage &a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator%=(VImage &a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator<(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator<(const double a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator<(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator<(const std::vector a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator<(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator<=(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator<=(const double a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator<=(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator<=(const std::vector a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator<=(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator>(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator>(const double a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator>(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator>(const std::vector a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator>(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator>=(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator>=(const double a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator>=(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator>=(const std::vector a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator>=(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator==(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator==(const double a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator==(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator==(const std::vector a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator==(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator!=(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator!=(const double a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator!=(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator!=(const std::vector a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator!=(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator&(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator&(const double a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator&(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator&(const std::vector a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator&(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator&=(VImage &a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator&=(VImage &a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator&=(VImage &a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator|(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator|(const double a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator|(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator|(const std::vector a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator|(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator|=(VImage &a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator|=(VImage &a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator|=(VImage &a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator^(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator^(const double a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator^(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator^(const std::vector a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator^(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator^=(VImage &a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator^=(VImage &a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator^=(VImage &a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator<<(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator<<(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator<<(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator<<=(VImage &a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator<<=(VImage &a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator<<=(VImage &a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage ++ operator>>(const VImage a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator>>(const VImage a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage ++ operator>>(const VImage a, const std::vector b); ++ ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator>>=(VImage &a, const VImage b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator>>=(VImage &a, const double b); ++ friend VIPS_CPLUSPLUS_API VImage & ++ operator>>=(VImage &a, const std::vector b); + + /* Automatically generated members. + * +@@ -1893,4160 +1885,4160 @@ class VImage : public VObject + * make vips-operators + * + * Then delete from here to the end of the class and paste in +- * vips-operators.h. We could just #include vips-operators.h, but ++ * vips-operators.h. We could just #include vips-operators.h, but + * that confuses doxygen. + */ + +-// headers for vips operations +-// this file is generated automatically, do not edit! +- +-/** +- * Transform lch to cmc. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage CMC2LCh( VOption *options = 0 ) const; ++ // headers for vips operations ++ // this file is generated automatically, do not edit! + +-/** +- * Transform cmyk to xyz. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage CMYK2XYZ( VOption *options = 0 ) const; ++ /** ++ * Transform lch to cmc. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage CMC2LCh(VOption *options = 0) const; + +-/** +- * Transform hsv to srgb. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage HSV2sRGB( VOption *options = 0 ) const; ++ /** ++ * Transform cmyk to xyz. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage CMYK2XYZ(VOption *options = 0) const; + +-/** +- * Transform lch to cmc. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage LCh2CMC( VOption *options = 0 ) const; ++ /** ++ * Transform hsv to srgb. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage HSV2sRGB(VOption *options = 0) const; + +-/** +- * Transform lch to lab. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage LCh2Lab( VOption *options = 0 ) const; ++ /** ++ * Transform lch to cmc. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage LCh2CMC(VOption *options = 0) const; + +-/** +- * Transform lab to lch. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage Lab2LCh( VOption *options = 0 ) const; ++ /** ++ * Transform lch to lab. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage LCh2Lab(VOption *options = 0) const; + +-/** +- * Transform float lab to labq coding. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage Lab2LabQ( VOption *options = 0 ) const; ++ /** ++ * Transform lab to lch. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage Lab2LCh(VOption *options = 0) const; + +-/** +- * Transform float lab to signed short. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage Lab2LabS( VOption *options = 0 ) const; ++ /** ++ * Transform float lab to labq coding. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage Lab2LabQ(VOption *options = 0) const; + +-/** +- * Transform cielab to xyz. +- * +- * **Optional parameters** +- * - **temp** -- Color temperature, std::vector. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage Lab2XYZ( VOption *options = 0 ) const; ++ /** ++ * Transform float lab to signed short. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage Lab2LabS(VOption *options = 0) const; + +-/** +- * Unpack a labq image to float lab. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage LabQ2Lab( VOption *options = 0 ) const; ++ /** ++ * Transform cielab to xyz. ++ * ++ * **Optional parameters** ++ * - **temp** -- Color temperature, std::vector. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage Lab2XYZ(VOption *options = 0) const; + +-/** +- * Unpack a labq image to short lab. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage LabQ2LabS( VOption *options = 0 ) const; ++ /** ++ * Unpack a labq image to float lab. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage LabQ2Lab(VOption *options = 0) const; + +-/** +- * Convert a labq image to srgb. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage LabQ2sRGB( VOption *options = 0 ) const; ++ /** ++ * Unpack a labq image to short lab. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage LabQ2LabS(VOption *options = 0) const; + +-/** +- * Transform signed short lab to float. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage LabS2Lab( VOption *options = 0 ) const; ++ /** ++ * Convert a labq image to srgb. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage LabQ2sRGB(VOption *options = 0) const; + +-/** +- * Transform short lab to labq coding. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage LabS2LabQ( VOption *options = 0 ) const; ++ /** ++ * Transform signed short lab to float. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage LabS2Lab(VOption *options = 0) const; + +-/** +- * Transform xyz to cmyk. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage XYZ2CMYK( VOption *options = 0 ) const; ++ /** ++ * Transform short lab to labq coding. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage LabS2LabQ(VOption *options = 0) const; + +-/** +- * Transform xyz to lab. +- * +- * **Optional parameters** +- * - **temp** -- Colour temperature, std::vector. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage XYZ2Lab( VOption *options = 0 ) const; ++ /** ++ * Transform xyz to cmyk. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage XYZ2CMYK(VOption *options = 0) const; + +-/** +- * Transform xyz to yxy. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage XYZ2Yxy( VOption *options = 0 ) const; ++ /** ++ * Transform xyz to lab. ++ * ++ * **Optional parameters** ++ * - **temp** -- Colour temperature, std::vector. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage XYZ2Lab(VOption *options = 0) const; + +-/** +- * Transform xyz to scrgb. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage XYZ2scRGB( VOption *options = 0 ) const; ++ /** ++ * Transform xyz to yxy. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage XYZ2Yxy(VOption *options = 0) const; + +-/** +- * Transform yxy to xyz. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage Yxy2XYZ( VOption *options = 0 ) const; ++ /** ++ * Transform xyz to scrgb. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage XYZ2scRGB(VOption *options = 0) const; + +-/** +- * Absolute value of an image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage abs( VOption *options = 0 ) const; ++ /** ++ * Transform yxy to xyz. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage Yxy2XYZ(VOption *options = 0) const; + +-/** +- * Add two images. +- * @param right Right-hand image argument. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage add( VImage right, VOption *options = 0 ) const; ++ /** ++ * Absolute value of an image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage abs(VOption *options = 0) const; + +-/** +- * Affine transform of an image. +- * +- * **Optional parameters** +- * - **interpolate** -- Interpolate pixels with this, VInterpolate. +- * - **oarea** -- Area of output to generate, std::vector. +- * - **odx** -- Horizontal output displacement, double. +- * - **ody** -- Vertical output displacement, double. +- * - **idx** -- Horizontal input displacement, double. +- * - **idy** -- Vertical input displacement, double. +- * - **background** -- Background value, std::vector. +- * - **premultiplied** -- Images have premultiplied alpha, bool. +- * - **extend** -- How to generate the extra pixels, VipsExtend. +- * +- * @param matrix Transformation matrix. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage affine( std::vector matrix, VOption *options = 0 ) const; ++ /** ++ * Add two images. ++ * @param right Right-hand image argument. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage add(VImage right, VOption *options = 0) const; + +-/** +- * Load an analyze6 image. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage analyzeload( const char *filename, VOption *options = 0 ); ++ /** ++ * Affine transform of an image. ++ * ++ * **Optional parameters** ++ * - **interpolate** -- Interpolate pixels with this, VInterpolate. ++ * - **oarea** -- Area of output to generate, std::vector. ++ * - **odx** -- Horizontal output displacement, double. ++ * - **ody** -- Vertical output displacement, double. ++ * - **idx** -- Horizontal input displacement, double. ++ * - **idy** -- Vertical input displacement, double. ++ * - **background** -- Background value, std::vector. ++ * - **premultiplied** -- Images have premultiplied alpha, bool. ++ * - **extend** -- How to generate the extra pixels, VipsExtend. ++ * ++ * @param matrix Transformation matrix. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage affine(std::vector matrix, VOption *options = 0) const; + +-/** +- * Join an array of images. +- * +- * **Optional parameters** +- * - **across** -- Number of images across grid, int. +- * - **shim** -- Pixels between images, int. +- * - **background** -- Colour for new pixels, std::vector. +- * - **halign** -- Align on the left, centre or right, VipsAlign. +- * - **valign** -- Align on the top, centre or bottom, VipsAlign. +- * - **hspacing** -- Horizontal spacing between images, int. +- * - **vspacing** -- Vertical spacing between images, int. +- * +- * @param in Array of input images. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage arrayjoin( std::vector in, VOption *options = 0 ); ++ /** ++ * Load an analyze6 image. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage analyzeload(const char *filename, VOption *options = 0); + +-/** +- * Autorotate image by exif tag. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage autorot( VOption *options = 0 ) const; ++ /** ++ * Join an array of images. ++ * ++ * **Optional parameters** ++ * - **across** -- Number of images across grid, int. ++ * - **shim** -- Pixels between images, int. ++ * - **background** -- Colour for new pixels, std::vector. ++ * - **halign** -- Align on the left, centre or right, VipsAlign. ++ * - **valign** -- Align on the top, centre or bottom, VipsAlign. ++ * - **hspacing** -- Horizontal spacing between images, int. ++ * - **vspacing** -- Vertical spacing between images, int. ++ * ++ * @param in Array of input images. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage arrayjoin(std::vector in, VOption *options = 0); + +-/** +- * Find image average. +- * @param options Set of options. +- * @return Output value. +- */ +-double avg( VOption *options = 0 ) const; ++ /** ++ * Autorotate image by exif tag. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage autorot(VOption *options = 0) const; + +-/** +- * Boolean operation across image bands. +- * @param boolean Boolean to perform. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage bandbool( VipsOperationBoolean boolean, VOption *options = 0 ) const; ++ /** ++ * Find image average. ++ * @param options Set of options. ++ * @return Output value. ++ */ ++ double avg(VOption *options = 0) const; + +-/** +- * Fold up x axis into bands. +- * +- * **Optional parameters** +- * - **factor** -- Fold by this factor, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage bandfold( VOption *options = 0 ) const; ++ /** ++ * Boolean operation across image bands. ++ * @param boolean Boolean to perform. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage bandbool(VipsOperationBoolean boolean, VOption *options = 0) const; + +-/** +- * Bandwise join a set of images. +- * @param in Array of input images. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage bandjoin( std::vector in, VOption *options = 0 ); ++ /** ++ * Fold up x axis into bands. ++ * ++ * **Optional parameters** ++ * - **factor** -- Fold by this factor, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage bandfold(VOption *options = 0) const; + +-/** +- * Append a constant band to an image. +- * @param c Array of constants to add. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage bandjoin_const( std::vector c, VOption *options = 0 ) const; ++ /** ++ * Bandwise join a set of images. ++ * @param in Array of input images. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage bandjoin(std::vector in, VOption *options = 0); + +-/** +- * Band-wise average. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage bandmean( VOption *options = 0 ) const; ++ /** ++ * Append a constant band to an image. ++ * @param c Array of constants to add. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage bandjoin_const(std::vector c, VOption *options = 0) const; + +-/** +- * Band-wise rank of a set of images. +- * +- * **Optional parameters** +- * - **index** -- Select this band element from sorted list, int. +- * +- * @param in Array of input images. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage bandrank( std::vector in, VOption *options = 0 ); ++ /** ++ * Band-wise average. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage bandmean(VOption *options = 0) const; + +-/** +- * Unfold image bands into x axis. +- * +- * **Optional parameters** +- * - **factor** -- Unfold by this factor, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage bandunfold( VOption *options = 0 ) const; ++ /** ++ * Band-wise rank of a set of images. ++ * ++ * **Optional parameters** ++ * - **index** -- Select this band element from sorted list, int. ++ * ++ * @param in Array of input images. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage bandrank(std::vector in, VOption *options = 0); + +-/** +- * Make a black image. +- * +- * **Optional parameters** +- * - **bands** -- Number of bands in image, int. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage black( int width, int height, VOption *options = 0 ); ++ /** ++ * Unfold image bands into x axis. ++ * ++ * **Optional parameters** ++ * - **factor** -- Unfold by this factor, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage bandunfold(VOption *options = 0) const; + +-/** +- * Boolean operation on two images. +- * @param right Right-hand image argument. +- * @param boolean Boolean to perform. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage boolean( VImage right, VipsOperationBoolean boolean, VOption *options = 0 ) const; +- +-/** +- * Boolean operations against a constant. +- * @param boolean Boolean to perform. +- * @param c Array of constants. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage boolean_const( VipsOperationBoolean boolean, std::vector c, VOption *options = 0 ) const; ++ /** ++ * Make a black image. ++ * ++ * **Optional parameters** ++ * - **bands** -- Number of bands in image, int. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage black(int width, int height, VOption *options = 0); + +-/** +- * Build a look-up table. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage buildlut( VOption *options = 0 ) const; ++ /** ++ * Boolean operation on two images. ++ * @param right Right-hand image argument. ++ * @param boolean Boolean to perform. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage boolean(VImage right, VipsOperationBoolean boolean, VOption *options = 0) const; + +-/** +- * Byteswap an image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage byteswap( VOption *options = 0 ) const; ++ /** ++ * Boolean operations against a constant. ++ * @param boolean Boolean to perform. ++ * @param c Array of constants. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage boolean_const(VipsOperationBoolean boolean, std::vector c, VOption *options = 0) const; + +-/** +- * Cache an image. +- * +- * **Optional parameters** +- * - **max_tiles** -- Maximum number of tiles to cache, int. +- * - **tile_height** -- Tile height in pixels, int. +- * - **tile_width** -- Tile width in pixels, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage cache( VOption *options = 0 ) const; ++ /** ++ * Build a look-up table. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage buildlut(VOption *options = 0) const; + +-/** +- * Canny edge detector. +- * +- * **Optional parameters** +- * - **sigma** -- Sigma of Gaussian, double. +- * - **precision** -- Convolve with this precision, VipsPrecision. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage canny( VOption *options = 0 ) const; ++ /** ++ * Byteswap an image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage byteswap(VOption *options = 0) const; + +-/** +- * Use pixel values to pick cases from an array of images. +- * @param cases Array of case images. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage case_image( std::vector cases, VOption *options = 0 ) const; ++ /** ++ * Cache an image. ++ * ++ * **Optional parameters** ++ * - **max_tiles** -- Maximum number of tiles to cache, int. ++ * - **tile_height** -- Tile height in pixels, int. ++ * - **tile_width** -- Tile width in pixels, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage cache(VOption *options = 0) const; + +-/** +- * Cast an image. +- * +- * **Optional parameters** +- * - **shift** -- Shift integer values up and down, bool. +- * +- * @param format Format to cast to. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage cast( VipsBandFormat format, VOption *options = 0 ) const; ++ /** ++ * Canny edge detector. ++ * ++ * **Optional parameters** ++ * - **sigma** -- Sigma of Gaussian, double. ++ * - **precision** -- Convolve with this precision, VipsPrecision. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage canny(VOption *options = 0) const; + +-/** +- * Convert to a new colorspace. +- * +- * **Optional parameters** +- * - **source_space** -- Source color space, VipsInterpretation. +- * +- * @param space Destination color space. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage colourspace( VipsInterpretation space, VOption *options = 0 ) const; ++ /** ++ * Use pixel values to pick cases from an array of images. ++ * @param cases Array of case images. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage case_image(std::vector cases, VOption *options = 0) const; + +-/** +- * Convolve with rotating mask. +- * +- * **Optional parameters** +- * - **times** -- Rotate and convolve this many times, int. +- * - **angle** -- Rotate mask by this much between convolutions, VipsAngle45. +- * - **combine** -- Combine convolution results like this, VipsCombine. +- * - **precision** -- Convolve with this precision, VipsPrecision. +- * - **layers** -- Use this many layers in approximation, int. +- * - **cluster** -- Cluster lines closer than this in approximation, int. +- * +- * @param mask Input matrix image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage compass( VImage mask, VOption *options = 0 ) const; ++ /** ++ * Cast an image. ++ * ++ * **Optional parameters** ++ * - **shift** -- Shift integer values up and down, bool. ++ * ++ * @param format Format to cast to. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage cast(VipsBandFormat format, VOption *options = 0) const; + +-/** +- * Perform a complex operation on an image. +- * @param cmplx Complex to perform. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage complex( VipsOperationComplex cmplx, VOption *options = 0 ) const; ++ /** ++ * Convert to a new colorspace. ++ * ++ * **Optional parameters** ++ * - **source_space** -- Source color space, VipsInterpretation. ++ * ++ * @param space Destination color space. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage colourspace(VipsInterpretation space, VOption *options = 0) const; + +-/** +- * Complex binary operations on two images. +- * @param right Right-hand image argument. +- * @param cmplx Binary complex operation to perform. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage complex2( VImage right, VipsOperationComplex2 cmplx, VOption *options = 0 ) const; ++ /** ++ * Convolve with rotating mask. ++ * ++ * **Optional parameters** ++ * - **times** -- Rotate and convolve this many times, int. ++ * - **angle** -- Rotate mask by this much between convolutions, VipsAngle45. ++ * - **combine** -- Combine convolution results like this, VipsCombine. ++ * - **precision** -- Convolve with this precision, VipsPrecision. ++ * - **layers** -- Use this many layers in approximation, int. ++ * - **cluster** -- Cluster lines closer than this in approximation, int. ++ * ++ * @param mask Input matrix image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage compass(VImage mask, VOption *options = 0) const; + +-/** +- * Form a complex image from two real images. +- * @param right Right-hand image argument. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage complexform( VImage right, VOption *options = 0 ) const; ++ /** ++ * Perform a complex operation on an image. ++ * @param cmplx Complex to perform. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage complex(VipsOperationComplex cmplx, VOption *options = 0) const; + +-/** +- * Get a component from a complex image. +- * @param get Complex to perform. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage complexget( VipsOperationComplexget get, VOption *options = 0 ) const; ++ /** ++ * Complex binary operations on two images. ++ * @param right Right-hand image argument. ++ * @param cmplx Binary complex operation to perform. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage complex2(VImage right, VipsOperationComplex2 cmplx, VOption *options = 0) const; + +-/** +- * Blend an array of images with an array of blend modes. +- * +- * **Optional parameters** +- * - **x** -- Array of x coordinates to join at, std::vector. +- * - **y** -- Array of y coordinates to join at, std::vector. +- * - **compositing_space** -- Composite images in this colour space, VipsInterpretation. +- * - **premultiplied** -- Images have premultiplied alpha, bool. +- * +- * @param in Array of input images. +- * @param mode Array of VipsBlendMode to join with. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage composite( std::vector in, std::vector mode, VOption *options = 0 ); ++ /** ++ * Form a complex image from two real images. ++ * @param right Right-hand image argument. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage complexform(VImage right, VOption *options = 0) const; + +-/** +- * Blend a pair of images with a blend mode. +- * +- * **Optional parameters** +- * - **x** -- x position of overlay, int. +- * - **y** -- y position of overlay, int. +- * - **compositing_space** -- Composite images in this colour space, VipsInterpretation. +- * - **premultiplied** -- Images have premultiplied alpha, bool. +- * +- * @param overlay Overlay image. +- * @param mode VipsBlendMode to join with. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage composite2( VImage overlay, VipsBlendMode mode, VOption *options = 0 ) const; ++ /** ++ * Get a component from a complex image. ++ * @param get Complex to perform. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage complexget(VipsOperationComplexget get, VOption *options = 0) const; + +-/** +- * Convolution operation. +- * +- * **Optional parameters** +- * - **precision** -- Convolve with this precision, VipsPrecision. +- * - **layers** -- Use this many layers in approximation, int. +- * - **cluster** -- Cluster lines closer than this in approximation, int. +- * +- * @param mask Input matrix image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage conv( VImage mask, VOption *options = 0 ) const; ++ /** ++ * Blend an array of images with an array of blend modes. ++ * ++ * **Optional parameters** ++ * - **x** -- Array of x coordinates to join at, std::vector. ++ * - **y** -- Array of y coordinates to join at, std::vector. ++ * - **compositing_space** -- Composite images in this colour space, VipsInterpretation. ++ * - **premultiplied** -- Images have premultiplied alpha, bool. ++ * ++ * @param in Array of input images. ++ * @param mode Array of VipsBlendMode to join with. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage composite(std::vector in, std::vector mode, VOption *options = 0); + +-/** +- * Approximate integer convolution. +- * +- * **Optional parameters** +- * - **layers** -- Use this many layers in approximation, int. +- * - **cluster** -- Cluster lines closer than this in approximation, int. +- * +- * @param mask Input matrix image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage conva( VImage mask, VOption *options = 0 ) const; ++ /** ++ * Blend a pair of images with a blend mode. ++ * ++ * **Optional parameters** ++ * - **x** -- x position of overlay, int. ++ * - **y** -- y position of overlay, int. ++ * - **compositing_space** -- Composite images in this colour space, VipsInterpretation. ++ * - **premultiplied** -- Images have premultiplied alpha, bool. ++ * ++ * @param overlay Overlay image. ++ * @param mode VipsBlendMode to join with. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage composite2(VImage overlay, VipsBlendMode mode, VOption *options = 0) const; + +-/** +- * Approximate separable integer convolution. +- * +- * **Optional parameters** +- * - **layers** -- Use this many layers in approximation, int. +- * +- * @param mask Input matrix image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage convasep( VImage mask, VOption *options = 0 ) const; ++ /** ++ * Convolution operation. ++ * ++ * **Optional parameters** ++ * - **precision** -- Convolve with this precision, VipsPrecision. ++ * - **layers** -- Use this many layers in approximation, int. ++ * - **cluster** -- Cluster lines closer than this in approximation, int. ++ * ++ * @param mask Input matrix image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage conv(VImage mask, VOption *options = 0) const; + +-/** +- * Float convolution operation. +- * @param mask Input matrix image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage convf( VImage mask, VOption *options = 0 ) const; ++ /** ++ * Approximate integer convolution. ++ * ++ * **Optional parameters** ++ * - **layers** -- Use this many layers in approximation, int. ++ * - **cluster** -- Cluster lines closer than this in approximation, int. ++ * ++ * @param mask Input matrix image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage conva(VImage mask, VOption *options = 0) const; + +-/** +- * Int convolution operation. +- * @param mask Input matrix image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage convi( VImage mask, VOption *options = 0 ) const; ++ /** ++ * Approximate separable integer convolution. ++ * ++ * **Optional parameters** ++ * - **layers** -- Use this many layers in approximation, int. ++ * ++ * @param mask Input matrix image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage convasep(VImage mask, VOption *options = 0) const; + +-/** +- * Seperable convolution operation. +- * +- * **Optional parameters** +- * - **precision** -- Convolve with this precision, VipsPrecision. +- * - **layers** -- Use this many layers in approximation, int. +- * - **cluster** -- Cluster lines closer than this in approximation, int. +- * +- * @param mask Input matrix image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage convsep( VImage mask, VOption *options = 0 ) const; ++ /** ++ * Float convolution operation. ++ * @param mask Input matrix image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage convf(VImage mask, VOption *options = 0) const; + +-/** +- * Copy an image. +- * +- * **Optional parameters** +- * - **width** -- Image width in pixels, int. +- * - **height** -- Image height in pixels, int. +- * - **bands** -- Number of bands in image, int. +- * - **format** -- Pixel format in image, VipsBandFormat. +- * - **coding** -- Pixel coding, VipsCoding. +- * - **interpretation** -- Pixel interpretation, VipsInterpretation. +- * - **xres** -- Horizontal resolution in pixels/mm, double. +- * - **yres** -- Vertical resolution in pixels/mm, double. +- * - **xoffset** -- Horizontal offset of origin, int. +- * - **yoffset** -- Vertical offset of origin, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage copy( VOption *options = 0 ) const; ++ /** ++ * Int convolution operation. ++ * @param mask Input matrix image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage convi(VImage mask, VOption *options = 0) const; + +-/** +- * Count lines in an image. +- * @param direction Countlines left-right or up-down. +- * @param options Set of options. +- * @return Number of lines. +- */ +-double countlines( VipsDirection direction, VOption *options = 0 ) const; ++ /** ++ * Seperable convolution operation. ++ * ++ * **Optional parameters** ++ * - **precision** -- Convolve with this precision, VipsPrecision. ++ * - **layers** -- Use this many layers in approximation, int. ++ * - **cluster** -- Cluster lines closer than this in approximation, int. ++ * ++ * @param mask Input matrix image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage convsep(VImage mask, VOption *options = 0) const; + +-/** +- * Extract an area from an image. +- * @param left Left edge of extract area. +- * @param top Top edge of extract area. +- * @param width Width of extract area. +- * @param height Height of extract area. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage crop( int left, int top, int width, int height, VOption *options = 0 ) const; ++ /** ++ * Copy an image. ++ * ++ * **Optional parameters** ++ * - **width** -- Image width in pixels, int. ++ * - **height** -- Image height in pixels, int. ++ * - **bands** -- Number of bands in image, int. ++ * - **format** -- Pixel format in image, VipsBandFormat. ++ * - **coding** -- Pixel coding, VipsCoding. ++ * - **interpretation** -- Pixel interpretation, VipsInterpretation. ++ * - **xres** -- Horizontal resolution in pixels/mm, double. ++ * - **yres** -- Vertical resolution in pixels/mm, double. ++ * - **xoffset** -- Horizontal offset of origin, int. ++ * - **yoffset** -- Vertical offset of origin, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage copy(VOption *options = 0) const; + +-/** +- * Load csv. +- * +- * **Optional parameters** +- * - **skip** -- Skip this many lines at the start of the file, int. +- * - **lines** -- Read this many lines from the file, int. +- * - **whitespace** -- Set of whitespace characters, const char *. +- * - **separator** -- Set of separator characters, const char *. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage csvload( const char *filename, VOption *options = 0 ); ++ /** ++ * Count lines in an image. ++ * @param direction Countlines left-right or up-down. ++ * @param options Set of options. ++ * @return Number of lines. ++ */ ++ double countlines(VipsDirection direction, VOption *options = 0) const; + +-/** +- * Load csv. +- * +- * **Optional parameters** +- * - **skip** -- Skip this many lines at the start of the file, int. +- * - **lines** -- Read this many lines from the file, int. +- * - **whitespace** -- Set of whitespace characters, const char *. +- * - **separator** -- Set of separator characters, const char *. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage csvload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Extract an area from an image. ++ * @param left Left edge of extract area. ++ * @param top Top edge of extract area. ++ * @param width Width of extract area. ++ * @param height Height of extract area. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage crop(int left, int top, int width, int height, VOption *options = 0) const; + +-/** +- * Save image to csv. +- * +- * **Optional parameters** +- * - **separator** -- Separator characters, const char *. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void csvsave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load csv. ++ * ++ * **Optional parameters** ++ * - **skip** -- Skip this many lines at the start of the file, int. ++ * - **lines** -- Read this many lines from the file, int. ++ * - **whitespace** -- Set of whitespace characters, const char *. ++ * - **separator** -- Set of separator characters, const char *. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage csvload(const char *filename, VOption *options = 0); + +-/** +- * Save image to csv. +- * +- * **Optional parameters** +- * - **separator** -- Separator characters, const char *. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param target Target to save to. +- * @param options Set of options. +- */ +-void csvsave_target( VTarget target, VOption *options = 0 ) const; ++ /** ++ * Load csv. ++ * ++ * **Optional parameters** ++ * - **skip** -- Skip this many lines at the start of the file, int. ++ * - **lines** -- Read this many lines from the file, int. ++ * - **whitespace** -- Set of whitespace characters, const char *. ++ * - **separator** -- Set of separator characters, const char *. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage csvload_source(VSource source, VOption *options = 0); + +-/** +- * Calculate de00. +- * @param right Right-hand input image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage dE00( VImage right, VOption *options = 0 ) const; ++ /** ++ * Save image to csv. ++ * ++ * **Optional parameters** ++ * - **separator** -- Separator characters, const char *. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void csvsave(const char *filename, VOption *options = 0) const; + +-/** +- * Calculate de76. +- * @param right Right-hand input image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage dE76( VImage right, VOption *options = 0 ) const; ++ /** ++ * Save image to csv. ++ * ++ * **Optional parameters** ++ * - **separator** -- Separator characters, const char *. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param target Target to save to. ++ * @param options Set of options. ++ */ ++ void csvsave_target(VTarget target, VOption *options = 0) const; + +-/** +- * Calculate decmc. +- * @param right Right-hand input image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage dECMC( VImage right, VOption *options = 0 ) const; ++ /** ++ * Calculate de00. ++ * @param right Right-hand input image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage dE00(VImage right, VOption *options = 0) const; + +-/** +- * Find image standard deviation. +- * @param options Set of options. +- * @return Output value. +- */ +-double deviate( VOption *options = 0 ) const; ++ /** ++ * Calculate de76. ++ * @param right Right-hand input image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage dE76(VImage right, VOption *options = 0) const; + +-/** +- * Divide two images. +- * @param right Right-hand image argument. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage divide( VImage right, VOption *options = 0 ) const; ++ /** ++ * Calculate decmc. ++ * @param right Right-hand input image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage dECMC(VImage right, VOption *options = 0) const; + +-/** +- * Draw a circle on an image. +- * +- * **Optional parameters** +- * - **fill** -- Draw a solid object, bool. +- * +- * @param ink Color for pixels. +- * @param cx Centre of draw_circle. +- * @param cy Centre of draw_circle. +- * @param radius Radius in pixels. +- * @param options Set of options. +- */ +-void draw_circle( std::vector ink, int cx, int cy, int radius, VOption *options = 0 ) const; ++ /** ++ * Find image standard deviation. ++ * @param options Set of options. ++ * @return Output value. ++ */ ++ double deviate(VOption *options = 0) const; + +-/** +- * Flood-fill an area. +- * +- * **Optional parameters** +- * - **test** -- Test pixels in this image, VImage. +- * - **equal** -- DrawFlood while equal to edge, bool. +- * +- * @param ink Color for pixels. +- * @param x DrawFlood start point. +- * @param y DrawFlood start point. +- * @param options Set of options. +- */ +-void draw_flood( std::vector ink, int x, int y, VOption *options = 0 ) const; ++ /** ++ * Divide two images. ++ * @param right Right-hand image argument. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage divide(VImage right, VOption *options = 0) const; + +-/** +- * Paint an image into another image. +- * +- * **Optional parameters** +- * - **mode** -- Combining mode, VipsCombineMode. +- * +- * @param sub Sub-image to insert into main image. +- * @param x Draw image here. +- * @param y Draw image here. +- * @param options Set of options. +- */ +-void draw_image( VImage sub, int x, int y, VOption *options = 0 ) const; ++ /** ++ * Draw a circle on an image. ++ * ++ * **Optional parameters** ++ * - **fill** -- Draw a solid object, bool. ++ * ++ * @param ink Color for pixels. ++ * @param cx Centre of draw_circle. ++ * @param cy Centre of draw_circle. ++ * @param radius Radius in pixels. ++ * @param options Set of options. ++ */ ++ void draw_circle(std::vector ink, int cx, int cy, int radius, VOption *options = 0) const; + +-/** +- * Draw a line on an image. +- * @param ink Color for pixels. +- * @param x1 Start of draw_line. +- * @param y1 Start of draw_line. +- * @param x2 End of draw_line. +- * @param y2 End of draw_line. +- * @param options Set of options. +- */ +-void draw_line( std::vector ink, int x1, int y1, int x2, int y2, VOption *options = 0 ) const; ++ /** ++ * Flood-fill an area. ++ * ++ * **Optional parameters** ++ * - **test** -- Test pixels in this image, VImage. ++ * - **equal** -- DrawFlood while equal to edge, bool. ++ * ++ * @param ink Color for pixels. ++ * @param x DrawFlood start point. ++ * @param y DrawFlood start point. ++ * @param options Set of options. ++ */ ++ void draw_flood(std::vector ink, int x, int y, VOption *options = 0) const; + +-/** +- * Draw a mask on an image. +- * @param ink Color for pixels. +- * @param mask Mask of pixels to draw. +- * @param x Draw mask here. +- * @param y Draw mask here. +- * @param options Set of options. +- */ +-void draw_mask( std::vector ink, VImage mask, int x, int y, VOption *options = 0 ) const; ++ /** ++ * Paint an image into another image. ++ * ++ * **Optional parameters** ++ * - **mode** -- Combining mode, VipsCombineMode. ++ * ++ * @param sub Sub-image to insert into main image. ++ * @param x Draw image here. ++ * @param y Draw image here. ++ * @param options Set of options. ++ */ ++ void draw_image(VImage sub, int x, int y, VOption *options = 0) const; + +-/** +- * Paint a rectangle on an image. +- * +- * **Optional parameters** +- * - **fill** -- Draw a solid object, bool. +- * +- * @param ink Color for pixels. +- * @param left Rect to fill. +- * @param top Rect to fill. +- * @param width Rect to fill. +- * @param height Rect to fill. +- * @param options Set of options. +- */ +-void draw_rect( std::vector ink, int left, int top, int width, int height, VOption *options = 0 ) const; ++ /** ++ * Draw a line on an image. ++ * @param ink Color for pixels. ++ * @param x1 Start of draw_line. ++ * @param y1 Start of draw_line. ++ * @param x2 End of draw_line. ++ * @param y2 End of draw_line. ++ * @param options Set of options. ++ */ ++ void draw_line(std::vector ink, int x1, int y1, int x2, int y2, VOption *options = 0) const; + +-/** +- * Blur a rectangle on an image. +- * @param left Rect to fill. +- * @param top Rect to fill. +- * @param width Rect to fill. +- * @param height Rect to fill. +- * @param options Set of options. +- */ +-void draw_smudge( int left, int top, int width, int height, VOption *options = 0 ) const; ++ /** ++ * Draw a mask on an image. ++ * @param ink Color for pixels. ++ * @param mask Mask of pixels to draw. ++ * @param x Draw mask here. ++ * @param y Draw mask here. ++ * @param options Set of options. ++ */ ++ void draw_mask(std::vector ink, VImage mask, int x, int y, VOption *options = 0) const; + +-/** +- * Save image to deepzoom file. +- * +- * **Optional parameters** +- * - **basename** -- Base name to save to, const char *. +- * - **layout** -- Directory layout, VipsForeignDzLayout. +- * - **suffix** -- Filename suffix for tiles, const char *. +- * - **overlap** -- Tile overlap in pixels, int. +- * - **tile_size** -- Tile size in pixels, int. +- * - **centre** -- Center image in tile, bool. +- * - **depth** -- Pyramid depth, VipsForeignDzDepth. +- * - **angle** -- Rotate image during save, VipsAngle. +- * - **container** -- Pyramid container type, VipsForeignDzContainer. +- * - **compression** -- ZIP deflate compression level, int. +- * - **region_shrink** -- Method to shrink regions, VipsRegionShrink. +- * - **skip_blanks** -- Skip tiles which are nearly equal to the background, int. +- * - **no_strip** -- Don't strip tile metadata, bool. +- * - **id** -- Resource ID, const char *. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void dzsave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Paint a rectangle on an image. ++ * ++ * **Optional parameters** ++ * - **fill** -- Draw a solid object, bool. ++ * ++ * @param ink Color for pixels. ++ * @param left Rect to fill. ++ * @param top Rect to fill. ++ * @param width Rect to fill. ++ * @param height Rect to fill. ++ * @param options Set of options. ++ */ ++ void draw_rect(std::vector ink, int left, int top, int width, int height, VOption *options = 0) const; + +-/** +- * Save image to dz buffer. +- * +- * **Optional parameters** +- * - **basename** -- Base name to save to, const char *. +- * - **layout** -- Directory layout, VipsForeignDzLayout. +- * - **suffix** -- Filename suffix for tiles, const char *. +- * - **overlap** -- Tile overlap in pixels, int. +- * - **tile_size** -- Tile size in pixels, int. +- * - **centre** -- Center image in tile, bool. +- * - **depth** -- Pyramid depth, VipsForeignDzDepth. +- * - **angle** -- Rotate image during save, VipsAngle. +- * - **container** -- Pyramid container type, VipsForeignDzContainer. +- * - **compression** -- ZIP deflate compression level, int. +- * - **region_shrink** -- Method to shrink regions, VipsRegionShrink. +- * - **skip_blanks** -- Skip tiles which are nearly equal to the background, int. +- * - **no_strip** -- Don't strip tile metadata, bool. +- * - **id** -- Resource ID, const char *. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param options Set of options. +- * @return Buffer to save to. +- */ +-VipsBlob *dzsave_buffer( VOption *options = 0 ) const; ++ /** ++ * Blur a rectangle on an image. ++ * @param left Rect to fill. ++ * @param top Rect to fill. ++ * @param width Rect to fill. ++ * @param height Rect to fill. ++ * @param options Set of options. ++ */ ++ void draw_smudge(int left, int top, int width, int height, VOption *options = 0) const; + +-/** +- * Save image to deepzoom target. +- * +- * **Optional parameters** +- * - **basename** -- Base name to save to, const char *. +- * - **layout** -- Directory layout, VipsForeignDzLayout. +- * - **suffix** -- Filename suffix for tiles, const char *. +- * - **overlap** -- Tile overlap in pixels, int. +- * - **tile_size** -- Tile size in pixels, int. +- * - **centre** -- Center image in tile, bool. +- * - **depth** -- Pyramid depth, VipsForeignDzDepth. +- * - **angle** -- Rotate image during save, VipsAngle. +- * - **container** -- Pyramid container type, VipsForeignDzContainer. +- * - **compression** -- ZIP deflate compression level, int. +- * - **region_shrink** -- Method to shrink regions, VipsRegionShrink. +- * - **skip_blanks** -- Skip tiles which are nearly equal to the background, int. +- * - **no_strip** -- Don't strip tile metadata, bool. +- * - **id** -- Resource ID, const char *. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param target Target to save to. +- * @param options Set of options. +- */ +-void dzsave_target( VTarget target, VOption *options = 0 ) const; ++ /** ++ * Save image to deepzoom file. ++ * ++ * **Optional parameters** ++ * - **basename** -- Base name to save to, const char *. ++ * - **layout** -- Directory layout, VipsForeignDzLayout. ++ * - **suffix** -- Filename suffix for tiles, const char *. ++ * - **overlap** -- Tile overlap in pixels, int. ++ * - **tile_size** -- Tile size in pixels, int. ++ * - **centre** -- Center image in tile, bool. ++ * - **depth** -- Pyramid depth, VipsForeignDzDepth. ++ * - **angle** -- Rotate image during save, VipsAngle. ++ * - **container** -- Pyramid container type, VipsForeignDzContainer. ++ * - **compression** -- ZIP deflate compression level, int. ++ * - **region_shrink** -- Method to shrink regions, VipsRegionShrink. ++ * - **skip_blanks** -- Skip tiles which are nearly equal to the background, int. ++ * - **no_strip** -- Don't strip tile metadata, bool. ++ * - **id** -- Resource ID, const char *. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void dzsave(const char *filename, VOption *options = 0) const; + +-/** +- * Embed an image in a larger image. +- * +- * **Optional parameters** +- * - **extend** -- How to generate the extra pixels, VipsExtend. +- * - **background** -- Color for background pixels, std::vector. +- * +- * @param x Left edge of input in output. +- * @param y Top edge of input in output. +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage embed( int x, int y, int width, int height, VOption *options = 0 ) const; ++ /** ++ * Save image to dz buffer. ++ * ++ * **Optional parameters** ++ * - **basename** -- Base name to save to, const char *. ++ * - **layout** -- Directory layout, VipsForeignDzLayout. ++ * - **suffix** -- Filename suffix for tiles, const char *. ++ * - **overlap** -- Tile overlap in pixels, int. ++ * - **tile_size** -- Tile size in pixels, int. ++ * - **centre** -- Center image in tile, bool. ++ * - **depth** -- Pyramid depth, VipsForeignDzDepth. ++ * - **angle** -- Rotate image during save, VipsAngle. ++ * - **container** -- Pyramid container type, VipsForeignDzContainer. ++ * - **compression** -- ZIP deflate compression level, int. ++ * - **region_shrink** -- Method to shrink regions, VipsRegionShrink. ++ * - **skip_blanks** -- Skip tiles which are nearly equal to the background, int. ++ * - **no_strip** -- Don't strip tile metadata, bool. ++ * - **id** -- Resource ID, const char *. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param options Set of options. ++ * @return Buffer to save to. ++ */ ++ VipsBlob *dzsave_buffer(VOption *options = 0) const; + +-/** +- * Extract an area from an image. +- * @param left Left edge of extract area. +- * @param top Top edge of extract area. +- * @param width Width of extract area. +- * @param height Height of extract area. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage extract_area( int left, int top, int width, int height, VOption *options = 0 ) const; ++ /** ++ * Save image to deepzoom target. ++ * ++ * **Optional parameters** ++ * - **basename** -- Base name to save to, const char *. ++ * - **layout** -- Directory layout, VipsForeignDzLayout. ++ * - **suffix** -- Filename suffix for tiles, const char *. ++ * - **overlap** -- Tile overlap in pixels, int. ++ * - **tile_size** -- Tile size in pixels, int. ++ * - **centre** -- Center image in tile, bool. ++ * - **depth** -- Pyramid depth, VipsForeignDzDepth. ++ * - **angle** -- Rotate image during save, VipsAngle. ++ * - **container** -- Pyramid container type, VipsForeignDzContainer. ++ * - **compression** -- ZIP deflate compression level, int. ++ * - **region_shrink** -- Method to shrink regions, VipsRegionShrink. ++ * - **skip_blanks** -- Skip tiles which are nearly equal to the background, int. ++ * - **no_strip** -- Don't strip tile metadata, bool. ++ * - **id** -- Resource ID, const char *. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param target Target to save to. ++ * @param options Set of options. ++ */ ++ void dzsave_target(VTarget target, VOption *options = 0) const; + +-/** +- * Extract band from an image. +- * +- * **Optional parameters** +- * - **n** -- Number of bands to extract, int. +- * +- * @param band Band to extract. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage extract_band( int band, VOption *options = 0 ) const; ++ /** ++ * Embed an image in a larger image. ++ * ++ * **Optional parameters** ++ * - **extend** -- How to generate the extra pixels, VipsExtend. ++ * - **background** -- Color for background pixels, std::vector. ++ * ++ * @param x Left edge of input in output. ++ * @param y Top edge of input in output. ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage embed(int x, int y, int width, int height, VOption *options = 0) const; + +-/** +- * Make an image showing the eye's spatial response. +- * +- * **Optional parameters** +- * - **uchar** -- Output an unsigned char image, bool. +- * - **factor** -- Maximum spatial frequency, double. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage eye( int width, int height, VOption *options = 0 ); ++ /** ++ * Extract an area from an image. ++ * @param left Left edge of extract area. ++ * @param top Top edge of extract area. ++ * @param width Width of extract area. ++ * @param height Height of extract area. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage extract_area(int left, int top, int width, int height, VOption *options = 0) const; + +-/** +- * False-color an image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage falsecolour( VOption *options = 0 ) const; ++ /** ++ * Extract band from an image. ++ * ++ * **Optional parameters** ++ * - **n** -- Number of bands to extract, int. ++ * ++ * @param band Band to extract. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage extract_band(int band, VOption *options = 0) const; + +-/** +- * Fast correlation. +- * @param ref Input reference image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage fastcor( VImage ref, VOption *options = 0 ) const; ++ /** ++ * Make an image showing the eye's spatial response. ++ * ++ * **Optional parameters** ++ * - **uchar** -- Output an unsigned char image, bool. ++ * - **factor** -- Maximum spatial frequency, double. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage eye(int width, int height, VOption *options = 0); + +-/** +- * Fill image zeros with nearest non-zero pixel. +- * @param options Set of options. +- * @return Value of nearest non-zero pixel. +- */ +-VImage fill_nearest( VOption *options = 0 ) const; ++ /** ++ * False-color an image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage falsecolour(VOption *options = 0) const; + +-/** +- * Search an image for non-edge areas. +- * +- * **Optional parameters** +- * - **threshold** -- Object threshold, double. +- * - **background** -- Color for background pixels, std::vector. +- * +- * @param top Top edge of extract area. +- * @param width Width of extract area. +- * @param height Height of extract area. +- * @param options Set of options. +- * @return Left edge of image. +- */ +-int find_trim( int *top, int *width, int *height, VOption *options = 0 ) const; ++ /** ++ * Fast correlation. ++ * @param ref Input reference image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage fastcor(VImage ref, VOption *options = 0) const; + +-/** +- * Load a fits image. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage fitsload( const char *filename, VOption *options = 0 ); ++ /** ++ * Fill image zeros with nearest non-zero pixel. ++ * @param options Set of options. ++ * @return Value of nearest non-zero pixel. ++ */ ++ VImage fill_nearest(VOption *options = 0) const; + +-/** +- * Load fits from a source. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage fitsload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Search an image for non-edge areas. ++ * ++ * **Optional parameters** ++ * - **threshold** -- Object threshold, double. ++ * - **background** -- Color for background pixels, std::vector. ++ * ++ * @param top Top edge of extract area. ++ * @param width Width of extract area. ++ * @param height Height of extract area. ++ * @param options Set of options. ++ * @return Left edge of image. ++ */ ++ int find_trim(int *top, int *width, int *height, VOption *options = 0) const; + +-/** +- * Save image to fits file. +- * +- * **Optional parameters** +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void fitssave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load a fits image. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage fitsload(const char *filename, VOption *options = 0); + +-/** +- * Flatten alpha out of an image. +- * +- * **Optional parameters** +- * - **background** -- Background value, std::vector. +- * - **max_alpha** -- Maximum value of alpha channel, double. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage flatten( VOption *options = 0 ) const; ++ /** ++ * Load fits from a source. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage fitsload_source(VSource source, VOption *options = 0); + +-/** +- * Flip an image. +- * @param direction Direction to flip image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage flip( VipsDirection direction, VOption *options = 0 ) const; ++ /** ++ * Save image to fits file. ++ * ++ * **Optional parameters** ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void fitssave(const char *filename, VOption *options = 0) const; + +-/** +- * Transform float rgb to radiance coding. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage float2rad( VOption *options = 0 ) const; ++ /** ++ * Flatten alpha out of an image. ++ * ++ * **Optional parameters** ++ * - **background** -- Background value, std::vector. ++ * - **max_alpha** -- Maximum value of alpha channel, double. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage flatten(VOption *options = 0) const; + +-/** +- * Make a fractal surface. +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param fractal_dimension Fractal dimension. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage fractsurf( int width, int height, double fractal_dimension, VOption *options = 0 ); ++ /** ++ * Flip an image. ++ * @param direction Direction to flip image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage flip(VipsDirection direction, VOption *options = 0) const; + +-/** +- * Frequency-domain filtering. +- * @param mask Input mask image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage freqmult( VImage mask, VOption *options = 0 ) const; ++ /** ++ * Transform float rgb to radiance coding. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage float2rad(VOption *options = 0) const; + +-/** +- * Forward fft. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage fwfft( VOption *options = 0 ) const; ++ /** ++ * Make a fractal surface. ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param fractal_dimension Fractal dimension. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage fractsurf(int width, int height, double fractal_dimension, VOption *options = 0); + +-/** +- * Gamma an image. +- * +- * **Optional parameters** +- * - **exponent** -- Gamma factor, double. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage gamma( VOption *options = 0 ) const; ++ /** ++ * Frequency-domain filtering. ++ * @param mask Input mask image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage freqmult(VImage mask, VOption *options = 0) const; + +-/** +- * Gaussian blur. +- * +- * **Optional parameters** +- * - **min_ampl** -- Minimum amplitude of Gaussian, double. +- * - **precision** -- Convolve with this precision, VipsPrecision. +- * +- * @param sigma Sigma of Gaussian. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage gaussblur( double sigma, VOption *options = 0 ) const; ++ /** ++ * Forward fft. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage fwfft(VOption *options = 0) const; + +-/** +- * Make a gaussian image. +- * +- * **Optional parameters** +- * - **separable** -- Generate separable Gaussian, bool. +- * - **precision** -- Generate with this precision, VipsPrecision. +- * +- * @param sigma Sigma of Gaussian. +- * @param min_ampl Minimum amplitude of Gaussian. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage gaussmat( double sigma, double min_ampl, VOption *options = 0 ); ++ /** ++ * Gamma an image. ++ * ++ * **Optional parameters** ++ * - **exponent** -- Gamma factor, double. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage gamma(VOption *options = 0) const; + +-/** +- * Make a gaussnoise image. +- * +- * **Optional parameters** +- * - **sigma** -- Standard deviation of pixels in generated image, double. +- * - **mean** -- Mean of pixels in generated image, double. +- * - **seed** -- Random number seed, int. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage gaussnoise( int width, int height, VOption *options = 0 ); ++ /** ++ * Gaussian blur. ++ * ++ * **Optional parameters** ++ * - **min_ampl** -- Minimum amplitude of Gaussian, double. ++ * - **precision** -- Convolve with this precision, VipsPrecision. ++ * ++ * @param sigma Sigma of Gaussian. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage gaussblur(double sigma, VOption *options = 0) const; + +-/** +- * Read a point from an image. +- * @param x Point to read. +- * @param y Point to read. +- * @param options Set of options. +- * @return Array of output values. +- */ +-std::vector getpoint( int x, int y, VOption *options = 0 ) const; ++ /** ++ * Make a gaussian image. ++ * ++ * **Optional parameters** ++ * - **separable** -- Generate separable Gaussian, bool. ++ * - **precision** -- Generate with this precision, VipsPrecision. ++ * ++ * @param sigma Sigma of Gaussian. ++ * @param min_ampl Minimum amplitude of Gaussian. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage gaussmat(double sigma, double min_ampl, VOption *options = 0); + +-/** +- * Load gif with libnsgif. +- * +- * **Optional parameters** +- * - **n** -- Load this many pages, int. +- * - **page** -- Load this page from the file, int. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage gifload( const char *filename, VOption *options = 0 ); ++ /** ++ * Make a gaussnoise image. ++ * ++ * **Optional parameters** ++ * - **sigma** -- Standard deviation of pixels in generated image, double. ++ * - **mean** -- Mean of pixels in generated image, double. ++ * - **seed** -- Random number seed, int. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage gaussnoise(int width, int height, VOption *options = 0); + +-/** +- * Load gif with libnsgif. +- * +- * **Optional parameters** +- * - **n** -- Load this many pages, int. +- * - **page** -- Load this page from the file, int. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param buffer Buffer to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage gifload_buffer( VipsBlob *buffer, VOption *options = 0 ); ++ /** ++ * Read a point from an image. ++ * @param x Point to read. ++ * @param y Point to read. ++ * @param options Set of options. ++ * @return Array of output values. ++ */ ++ std::vector getpoint(int x, int y, VOption *options = 0) const; + +-/** +- * Load gif from source. +- * +- * **Optional parameters** +- * - **n** -- Load this many pages, int. +- * - **page** -- Load this page from the file, int. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage gifload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Load gif with libnsgif. ++ * ++ * **Optional parameters** ++ * - **n** -- Load this many pages, int. ++ * - **page** -- Load this page from the file, int. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage gifload(const char *filename, VOption *options = 0); + +-/** +- * Save as gif. +- * +- * **Optional parameters** +- * - **dither** -- Amount of dithering, double. +- * - **effort** -- Quantisation effort, int. +- * - **bitdepth** -- Number of bits per pixel, int. +- * - **interframe_maxerror** -- Maximum inter-frame error for transparency, double. +- * - **reoptimise** -- Reoptimise colour palettes, bool. +- * - **interpalette_maxerror** -- Maximum inter-palette error for palette reusage, double. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void gifsave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load gif with libnsgif. ++ * ++ * **Optional parameters** ++ * - **n** -- Load this many pages, int. ++ * - **page** -- Load this page from the file, int. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param buffer Buffer to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage gifload_buffer(VipsBlob *buffer, VOption *options = 0); + +-/** +- * Save as gif. +- * +- * **Optional parameters** +- * - **dither** -- Amount of dithering, double. +- * - **effort** -- Quantisation effort, int. +- * - **bitdepth** -- Number of bits per pixel, int. +- * - **interframe_maxerror** -- Maximum inter-frame error for transparency, double. +- * - **reoptimise** -- Reoptimise colour palettes, bool. +- * - **interpalette_maxerror** -- Maximum inter-palette error for palette reusage, double. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param options Set of options. +- * @return Buffer to save to. +- */ +-VipsBlob *gifsave_buffer( VOption *options = 0 ) const; ++ /** ++ * Load gif from source. ++ * ++ * **Optional parameters** ++ * - **n** -- Load this many pages, int. ++ * - **page** -- Load this page from the file, int. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage gifload_source(VSource source, VOption *options = 0); + +-/** +- * Save as gif. +- * +- * **Optional parameters** +- * - **dither** -- Amount of dithering, double. +- * - **effort** -- Quantisation effort, int. +- * - **bitdepth** -- Number of bits per pixel, int. +- * - **interframe_maxerror** -- Maximum inter-frame error for transparency, double. +- * - **reoptimise** -- Reoptimise colour palettes, bool. +- * - **interpalette_maxerror** -- Maximum inter-palette error for palette reusage, double. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param target Target to save to. +- * @param options Set of options. +- */ +-void gifsave_target( VTarget target, VOption *options = 0 ) const; ++ /** ++ * Save as gif. ++ * ++ * **Optional parameters** ++ * - **dither** -- Amount of dithering, double. ++ * - **effort** -- Quantisation effort, int. ++ * - **bitdepth** -- Number of bits per pixel, int. ++ * - **interframe_maxerror** -- Maximum inter-frame error for transparency, double. ++ * - **reoptimise** -- Reoptimise colour palettes, bool. ++ * - **interpalette_maxerror** -- Maximum inter-palette error for palette reusage, double. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void gifsave(const char *filename, VOption *options = 0) const; + +-/** +- * Global balance an image mosaic. +- * +- * **Optional parameters** +- * - **gamma** -- Image gamma, double. +- * - **int_output** -- Integer output, bool. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage globalbalance( VOption *options = 0 ) const; ++ /** ++ * Save as gif. ++ * ++ * **Optional parameters** ++ * - **dither** -- Amount of dithering, double. ++ * - **effort** -- Quantisation effort, int. ++ * - **bitdepth** -- Number of bits per pixel, int. ++ * - **interframe_maxerror** -- Maximum inter-frame error for transparency, double. ++ * - **reoptimise** -- Reoptimise colour palettes, bool. ++ * - **interpalette_maxerror** -- Maximum inter-palette error for palette reusage, double. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param options Set of options. ++ * @return Buffer to save to. ++ */ ++ VipsBlob *gifsave_buffer(VOption *options = 0) const; + +-/** +- * Place an image within a larger image with a certain gravity. +- * +- * **Optional parameters** +- * - **extend** -- How to generate the extra pixels, VipsExtend. +- * - **background** -- Color for background pixels, std::vector. +- * +- * @param direction Direction to place image within width/height. +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage gravity( VipsCompassDirection direction, int width, int height, VOption *options = 0 ) const; ++ /** ++ * Save as gif. ++ * ++ * **Optional parameters** ++ * - **dither** -- Amount of dithering, double. ++ * - **effort** -- Quantisation effort, int. ++ * - **bitdepth** -- Number of bits per pixel, int. ++ * - **interframe_maxerror** -- Maximum inter-frame error for transparency, double. ++ * - **reoptimise** -- Reoptimise colour palettes, bool. ++ * - **interpalette_maxerror** -- Maximum inter-palette error for palette reusage, double. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param target Target to save to. ++ * @param options Set of options. ++ */ ++ void gifsave_target(VTarget target, VOption *options = 0) const; + +-/** +- * Make a grey ramp image. +- * +- * **Optional parameters** +- * - **uchar** -- Output an unsigned char image, bool. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage grey( int width, int height, VOption *options = 0 ); ++ /** ++ * Global balance an image mosaic. ++ * ++ * **Optional parameters** ++ * - **gamma** -- Image gamma, double. ++ * - **int_output** -- Integer output, bool. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage globalbalance(VOption *options = 0) const; + +-/** +- * Grid an image. +- * @param tile_height Chop into tiles this high. +- * @param across Number of tiles across. +- * @param down Number of tiles down. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage grid( int tile_height, int across, int down, VOption *options = 0 ) const; ++ /** ++ * Place an image within a larger image with a certain gravity. ++ * ++ * **Optional parameters** ++ * - **extend** -- How to generate the extra pixels, VipsExtend. ++ * - **background** -- Color for background pixels, std::vector. ++ * ++ * @param direction Direction to place image within width/height. ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage gravity(VipsCompassDirection direction, int width, int height, VOption *options = 0) const; + +-/** +- * Load a heif image. +- * +- * **Optional parameters** +- * - **page** -- Load this page from the file, int. +- * - **n** -- Load this many pages, int. +- * - **thumbnail** -- Fetch thumbnail image, bool. +- * - **unlimited** -- Remove all denial of service limits, bool. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage heifload( const char *filename, VOption *options = 0 ); ++ /** ++ * Make a grey ramp image. ++ * ++ * **Optional parameters** ++ * - **uchar** -- Output an unsigned char image, bool. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage grey(int width, int height, VOption *options = 0); + +-/** +- * Load a heif image. +- * +- * **Optional parameters** +- * - **page** -- Load this page from the file, int. +- * - **n** -- Load this many pages, int. +- * - **thumbnail** -- Fetch thumbnail image, bool. +- * - **unlimited** -- Remove all denial of service limits, bool. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param buffer Buffer to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage heifload_buffer( VipsBlob *buffer, VOption *options = 0 ); ++ /** ++ * Grid an image. ++ * @param tile_height Chop into tiles this high. ++ * @param across Number of tiles across. ++ * @param down Number of tiles down. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage grid(int tile_height, int across, int down, VOption *options = 0) const; + +-/** +- * Load a heif image. +- * +- * **Optional parameters** +- * - **page** -- Load this page from the file, int. +- * - **n** -- Load this many pages, int. +- * - **thumbnail** -- Fetch thumbnail image, bool. +- * - **unlimited** -- Remove all denial of service limits, bool. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage heifload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Load a heif image. ++ * ++ * **Optional parameters** ++ * - **page** -- Load this page from the file, int. ++ * - **n** -- Load this many pages, int. ++ * - **thumbnail** -- Fetch thumbnail image, bool. ++ * - **unlimited** -- Remove all denial of service limits, bool. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage heifload(const char *filename, VOption *options = 0); + +-/** +- * Save image in heif format. +- * +- * **Optional parameters** +- * - **Q** -- Q factor, int. +- * - **bitdepth** -- Number of bits per pixel, int. +- * - **lossless** -- Enable lossless compression, bool. +- * - **compression** -- Compression format, VipsForeignHeifCompression. +- * - **effort** -- CPU effort, int. +- * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void heifsave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load a heif image. ++ * ++ * **Optional parameters** ++ * - **page** -- Load this page from the file, int. ++ * - **n** -- Load this many pages, int. ++ * - **thumbnail** -- Fetch thumbnail image, bool. ++ * - **unlimited** -- Remove all denial of service limits, bool. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param buffer Buffer to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage heifload_buffer(VipsBlob *buffer, VOption *options = 0); + +-/** +- * Save image in heif format. +- * +- * **Optional parameters** +- * - **Q** -- Q factor, int. +- * - **bitdepth** -- Number of bits per pixel, int. +- * - **lossless** -- Enable lossless compression, bool. +- * - **compression** -- Compression format, VipsForeignHeifCompression. +- * - **effort** -- CPU effort, int. +- * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param options Set of options. +- * @return Buffer to save to. +- */ +-VipsBlob *heifsave_buffer( VOption *options = 0 ) const; ++ /** ++ * Load a heif image. ++ * ++ * **Optional parameters** ++ * - **page** -- Load this page from the file, int. ++ * - **n** -- Load this many pages, int. ++ * - **thumbnail** -- Fetch thumbnail image, bool. ++ * - **unlimited** -- Remove all denial of service limits, bool. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage heifload_source(VSource source, VOption *options = 0); + +-/** +- * Save image in heif format. +- * +- * **Optional parameters** +- * - **Q** -- Q factor, int. +- * - **bitdepth** -- Number of bits per pixel, int. +- * - **lossless** -- Enable lossless compression, bool. +- * - **compression** -- Compression format, VipsForeignHeifCompression. +- * - **effort** -- CPU effort, int. +- * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param target Target to save to. +- * @param options Set of options. +- */ +-void heifsave_target( VTarget target, VOption *options = 0 ) const; ++ /** ++ * Save image in heif format. ++ * ++ * **Optional parameters** ++ * - **Q** -- Q factor, int. ++ * - **bitdepth** -- Number of bits per pixel, int. ++ * - **lossless** -- Enable lossless compression, bool. ++ * - **compression** -- Compression format, VipsForeignHeifCompression. ++ * - **effort** -- CPU effort, int. ++ * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void heifsave(const char *filename, VOption *options = 0) const; + +-/** +- * Form cumulative histogram. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage hist_cum( VOption *options = 0 ) const; ++ /** ++ * Save image in heif format. ++ * ++ * **Optional parameters** ++ * - **Q** -- Q factor, int. ++ * - **bitdepth** -- Number of bits per pixel, int. ++ * - **lossless** -- Enable lossless compression, bool. ++ * - **compression** -- Compression format, VipsForeignHeifCompression. ++ * - **effort** -- CPU effort, int. ++ * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param options Set of options. ++ * @return Buffer to save to. ++ */ ++ VipsBlob *heifsave_buffer(VOption *options = 0) const; + +-/** +- * Estimate image entropy. +- * @param options Set of options. +- * @return Output value. +- */ +-double hist_entropy( VOption *options = 0 ) const; ++ /** ++ * Save image in heif format. ++ * ++ * **Optional parameters** ++ * - **Q** -- Q factor, int. ++ * - **bitdepth** -- Number of bits per pixel, int. ++ * - **lossless** -- Enable lossless compression, bool. ++ * - **compression** -- Compression format, VipsForeignHeifCompression. ++ * - **effort** -- CPU effort, int. ++ * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param target Target to save to. ++ * @param options Set of options. ++ */ ++ void heifsave_target(VTarget target, VOption *options = 0) const; + +-/** +- * Histogram equalisation. +- * +- * **Optional parameters** +- * - **band** -- Equalise with this band, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage hist_equal( VOption *options = 0 ) const; ++ /** ++ * Form cumulative histogram. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage hist_cum(VOption *options = 0) const; + +-/** +- * Find image histogram. +- * +- * **Optional parameters** +- * - **band** -- Find histogram of band, int. +- * +- * @param options Set of options. +- * @return Output histogram. +- */ +-VImage hist_find( VOption *options = 0 ) const; ++ /** ++ * Estimate image entropy. ++ * @param options Set of options. ++ * @return Output value. ++ */ ++ double hist_entropy(VOption *options = 0) const; + +-/** +- * Find indexed image histogram. +- * +- * **Optional parameters** +- * - **combine** -- Combine bins like this, VipsCombine. +- * +- * @param index Index image. +- * @param options Set of options. +- * @return Output histogram. +- */ +-VImage hist_find_indexed( VImage index, VOption *options = 0 ) const; ++ /** ++ * Histogram equalisation. ++ * ++ * **Optional parameters** ++ * - **band** -- Equalise with this band, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage hist_equal(VOption *options = 0) const; + +-/** +- * Find n-dimensional image histogram. +- * +- * **Optional parameters** +- * - **bins** -- Number of bins in each dimension, int. +- * +- * @param options Set of options. +- * @return Output histogram. +- */ +-VImage hist_find_ndim( VOption *options = 0 ) const; ++ /** ++ * Find image histogram. ++ * ++ * **Optional parameters** ++ * - **band** -- Find histogram of band, int. ++ * ++ * @param options Set of options. ++ * @return Output histogram. ++ */ ++ VImage hist_find(VOption *options = 0) const; + +-/** +- * Test for monotonicity. +- * @param options Set of options. +- * @return true if in is monotonic. +- */ +-bool hist_ismonotonic( VOption *options = 0 ) const; ++ /** ++ * Find indexed image histogram. ++ * ++ * **Optional parameters** ++ * - **combine** -- Combine bins like this, VipsCombine. ++ * ++ * @param index Index image. ++ * @param options Set of options. ++ * @return Output histogram. ++ */ ++ VImage hist_find_indexed(VImage index, VOption *options = 0) const; + +-/** +- * Local histogram equalisation. +- * +- * **Optional parameters** +- * - **max_slope** -- Maximum slope (CLAHE), int. +- * +- * @param width Window width in pixels. +- * @param height Window height in pixels. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage hist_local( int width, int height, VOption *options = 0 ) const; ++ /** ++ * Find n-dimensional image histogram. ++ * ++ * **Optional parameters** ++ * - **bins** -- Number of bins in each dimension, int. ++ * ++ * @param options Set of options. ++ * @return Output histogram. ++ */ ++ VImage hist_find_ndim(VOption *options = 0) const; + +-/** +- * Match two histograms. +- * @param ref Reference histogram. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage hist_match( VImage ref, VOption *options = 0 ) const; ++ /** ++ * Test for monotonicity. ++ * @param options Set of options. ++ * @return true if in is monotonic. ++ */ ++ bool hist_ismonotonic(VOption *options = 0) const; + +-/** +- * Normalise histogram. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage hist_norm( VOption *options = 0 ) const; ++ /** ++ * Local histogram equalisation. ++ * ++ * **Optional parameters** ++ * - **max_slope** -- Maximum slope (CLAHE), int. ++ * ++ * @param width Window width in pixels. ++ * @param height Window height in pixels. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage hist_local(int width, int height, VOption *options = 0) const; + +-/** +- * Plot histogram. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage hist_plot( VOption *options = 0 ) const; ++ /** ++ * Match two histograms. ++ * @param ref Reference histogram. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage hist_match(VImage ref, VOption *options = 0) const; + +-/** +- * Find hough circle transform. +- * +- * **Optional parameters** +- * - **scale** -- Scale down dimensions by this factor, int. +- * - **min_radius** -- Smallest radius to search for, int. +- * - **max_radius** -- Largest radius to search for, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage hough_circle( VOption *options = 0 ) const; ++ /** ++ * Normalise histogram. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage hist_norm(VOption *options = 0) const; + +-/** +- * Find hough line transform. +- * +- * **Optional parameters** +- * - **width** -- Horizontal size of parameter space, int. +- * - **height** -- Vertical size of parameter space, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage hough_line( VOption *options = 0 ) const; ++ /** ++ * Plot histogram. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage hist_plot(VOption *options = 0) const; + +-/** +- * Output to device with icc profile. +- * +- * **Optional parameters** +- * - **pcs** -- Set Profile Connection Space, VipsPCS. +- * - **intent** -- Rendering intent, VipsIntent. +- * - **black_point_compensation** -- Enable black point compensation, bool. +- * - **output_profile** -- Filename to load output profile from, const char *. +- * - **depth** -- Output device space depth in bits, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage icc_export( VOption *options = 0 ) const; ++ /** ++ * Find hough circle transform. ++ * ++ * **Optional parameters** ++ * - **scale** -- Scale down dimensions by this factor, int. ++ * - **min_radius** -- Smallest radius to search for, int. ++ * - **max_radius** -- Largest radius to search for, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage hough_circle(VOption *options = 0) const; + +-/** +- * Import from device with icc profile. +- * +- * **Optional parameters** +- * - **pcs** -- Set Profile Connection Space, VipsPCS. +- * - **intent** -- Rendering intent, VipsIntent. +- * - **black_point_compensation** -- Enable black point compensation, bool. +- * - **embedded** -- Use embedded input profile, if available, bool. +- * - **input_profile** -- Filename to load input profile from, const char *. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage icc_import( VOption *options = 0 ) const; ++ /** ++ * Find hough line transform. ++ * ++ * **Optional parameters** ++ * - **width** -- Horizontal size of parameter space, int. ++ * - **height** -- Vertical size of parameter space, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage hough_line(VOption *options = 0) const; + +-/** +- * Transform between devices with icc profiles. +- * +- * **Optional parameters** +- * - **pcs** -- Set Profile Connection Space, VipsPCS. +- * - **intent** -- Rendering intent, VipsIntent. +- * - **black_point_compensation** -- Enable black point compensation, bool. +- * - **embedded** -- Use embedded input profile, if available, bool. +- * - **input_profile** -- Filename to load input profile from, const char *. +- * - **depth** -- Output device space depth in bits, int. +- * +- * @param output_profile Filename to load output profile from. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage icc_transform( const char *output_profile, VOption *options = 0 ) const; ++ /** ++ * Output to device with icc profile. ++ * ++ * **Optional parameters** ++ * - **pcs** -- Set Profile Connection Space, VipsPCS. ++ * - **intent** -- Rendering intent, VipsIntent. ++ * - **black_point_compensation** -- Enable black point compensation, bool. ++ * - **output_profile** -- Filename to load output profile from, const char *. ++ * - **depth** -- Output device space depth in bits, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage icc_export(VOption *options = 0) const; + +-/** +- * Make a 1d image where pixel values are indexes. +- * +- * **Optional parameters** +- * - **bands** -- Number of bands in LUT, int. +- * - **ushort** -- Create a 16-bit LUT, bool. +- * - **size** -- Size of 16-bit LUT, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage identity( VOption *options = 0 ); ++ /** ++ * Import from device with icc profile. ++ * ++ * **Optional parameters** ++ * - **pcs** -- Set Profile Connection Space, VipsPCS. ++ * - **intent** -- Rendering intent, VipsIntent. ++ * - **black_point_compensation** -- Enable black point compensation, bool. ++ * - **embedded** -- Use embedded input profile, if available, bool. ++ * - **input_profile** -- Filename to load input profile from, const char *. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage icc_import(VOption *options = 0) const; + +-/** +- * Ifthenelse an image. +- * +- * **Optional parameters** +- * - **blend** -- Blend smoothly between then and else parts, bool. +- * +- * @param in1 Source for TRUE pixels. +- * @param in2 Source for FALSE pixels. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage ifthenelse( VImage in1, VImage in2, VOption *options = 0 ) const; ++ /** ++ * Transform between devices with icc profiles. ++ * ++ * **Optional parameters** ++ * - **pcs** -- Set Profile Connection Space, VipsPCS. ++ * - **intent** -- Rendering intent, VipsIntent. ++ * - **black_point_compensation** -- Enable black point compensation, bool. ++ * - **embedded** -- Use embedded input profile, if available, bool. ++ * - **input_profile** -- Filename to load input profile from, const char *. ++ * - **depth** -- Output device space depth in bits, int. ++ * ++ * @param output_profile Filename to load output profile from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage icc_transform(const char *output_profile, VOption *options = 0) const; + +-/** +- * Insert image @sub into @main at @x, @y. +- * +- * **Optional parameters** +- * - **expand** -- Expand output to hold all of both inputs, bool. +- * - **background** -- Color for new pixels, std::vector. +- * +- * @param sub Sub-image to insert into main image. +- * @param x Left edge of sub in main. +- * @param y Top edge of sub in main. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage insert( VImage sub, int x, int y, VOption *options = 0 ) const; ++ /** ++ * Make a 1d image where pixel values are indexes. ++ * ++ * **Optional parameters** ++ * - **bands** -- Number of bands in LUT, int. ++ * - **ushort** -- Create a 16-bit LUT, bool. ++ * - **size** -- Size of 16-bit LUT, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage identity(VOption *options = 0); + +-/** +- * Invert an image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage invert( VOption *options = 0 ) const; ++ /** ++ * Ifthenelse an image. ++ * ++ * **Optional parameters** ++ * - **blend** -- Blend smoothly between then and else parts, bool. ++ * ++ * @param in1 Source for TRUE pixels. ++ * @param in2 Source for FALSE pixels. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage ifthenelse(VImage in1, VImage in2, VOption *options = 0) const; + +-/** +- * Build an inverted look-up table. +- * +- * **Optional parameters** +- * - **size** -- LUT size to generate, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage invertlut( VOption *options = 0 ) const; ++ /** ++ * Insert image @sub into @main at @x, @y. ++ * ++ * **Optional parameters** ++ * - **expand** -- Expand output to hold all of both inputs, bool. ++ * - **background** -- Color for new pixels, std::vector. ++ * ++ * @param sub Sub-image to insert into main image. ++ * @param x Left edge of sub in main. ++ * @param y Top edge of sub in main. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage insert(VImage sub, int x, int y, VOption *options = 0) const; + +-/** +- * Inverse fft. +- * +- * **Optional parameters** +- * - **real** -- Output only the real part of the transform, bool. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage invfft( VOption *options = 0 ) const; ++ /** ++ * Invert an image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage invert(VOption *options = 0) const; + +-/** +- * Join a pair of images. +- * +- * **Optional parameters** +- * - **expand** -- Expand output to hold all of both inputs, bool. +- * - **shim** -- Pixels between images, int. +- * - **background** -- Colour for new pixels, std::vector. +- * - **align** -- Align on the low, centre or high coordinate edge, VipsAlign. +- * +- * @param in2 Second input image. +- * @param direction Join left-right or up-down. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage join( VImage in2, VipsDirection direction, VOption *options = 0 ) const; ++ /** ++ * Build an inverted look-up table. ++ * ++ * **Optional parameters** ++ * - **size** -- LUT size to generate, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage invertlut(VOption *options = 0) const; + +-/** +- * Load jpeg2000 image. +- * +- * **Optional parameters** +- * - **page** -- Load this page from the image, int. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage jp2kload( const char *filename, VOption *options = 0 ); ++ /** ++ * Inverse fft. ++ * ++ * **Optional parameters** ++ * - **real** -- Output only the real part of the transform, bool. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage invfft(VOption *options = 0) const; + +-/** +- * Load jpeg2000 image. +- * +- * **Optional parameters** +- * - **page** -- Load this page from the image, int. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param buffer Buffer to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage jp2kload_buffer( VipsBlob *buffer, VOption *options = 0 ); ++ /** ++ * Join a pair of images. ++ * ++ * **Optional parameters** ++ * - **expand** -- Expand output to hold all of both inputs, bool. ++ * - **shim** -- Pixels between images, int. ++ * - **background** -- Colour for new pixels, std::vector. ++ * - **align** -- Align on the low, centre or high coordinate edge, VipsAlign. ++ * ++ * @param in2 Second input image. ++ * @param direction Join left-right or up-down. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage join(VImage in2, VipsDirection direction, VOption *options = 0) const; + +-/** +- * Load jpeg2000 image. +- * +- * **Optional parameters** +- * - **page** -- Load this page from the image, int. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage jp2kload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Load jpeg2000 image. ++ * ++ * **Optional parameters** ++ * - **page** -- Load this page from the image, int. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage jp2kload(const char *filename, VOption *options = 0); + +-/** +- * Save image in jpeg2000 format. +- * +- * **Optional parameters** +- * - **tile_width** -- Tile width in pixels, int. +- * - **tile_height** -- Tile height in pixels, int. +- * - **lossless** -- Enable lossless compression, bool. +- * - **Q** -- Q factor, int. +- * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- */ +-void jp2ksave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load jpeg2000 image. ++ * ++ * **Optional parameters** ++ * - **page** -- Load this page from the image, int. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param buffer Buffer to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage jp2kload_buffer(VipsBlob *buffer, VOption *options = 0); + +-/** +- * Save image in jpeg2000 format. +- * +- * **Optional parameters** +- * - **tile_width** -- Tile width in pixels, int. +- * - **tile_height** -- Tile height in pixels, int. +- * - **lossless** -- Enable lossless compression, bool. +- * - **Q** -- Q factor, int. +- * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param options Set of options. +- * @return Buffer to save to. +- */ +-VipsBlob *jp2ksave_buffer( VOption *options = 0 ) const; ++ /** ++ * Load jpeg2000 image. ++ * ++ * **Optional parameters** ++ * - **page** -- Load this page from the image, int. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage jp2kload_source(VSource source, VOption *options = 0); + +-/** +- * Save image in jpeg2000 format. +- * +- * **Optional parameters** +- * - **tile_width** -- Tile width in pixels, int. +- * - **tile_height** -- Tile height in pixels, int. +- * - **lossless** -- Enable lossless compression, bool. +- * - **Q** -- Q factor, int. +- * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param target Target to save to. +- * @param options Set of options. +- */ +-void jp2ksave_target( VTarget target, VOption *options = 0 ) const; ++ /** ++ * Save image in jpeg2000 format. ++ * ++ * **Optional parameters** ++ * - **tile_width** -- Tile width in pixels, int. ++ * - **tile_height** -- Tile height in pixels, int. ++ * - **lossless** -- Enable lossless compression, bool. ++ * - **Q** -- Q factor, int. ++ * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ */ ++ void jp2ksave(const char *filename, VOption *options = 0) const; + +-/** +- * Load jpeg from file. +- * +- * **Optional parameters** +- * - **shrink** -- Shrink factor on load, int. +- * - **autorotate** -- Rotate image using exif orientation, bool. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage jpegload( const char *filename, VOption *options = 0 ); ++ /** ++ * Save image in jpeg2000 format. ++ * ++ * **Optional parameters** ++ * - **tile_width** -- Tile width in pixels, int. ++ * - **tile_height** -- Tile height in pixels, int. ++ * - **lossless** -- Enable lossless compression, bool. ++ * - **Q** -- Q factor, int. ++ * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param options Set of options. ++ * @return Buffer to save to. ++ */ ++ VipsBlob *jp2ksave_buffer(VOption *options = 0) const; + +-/** +- * Load jpeg from buffer. +- * +- * **Optional parameters** +- * - **shrink** -- Shrink factor on load, int. +- * - **autorotate** -- Rotate image using exif orientation, bool. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param buffer Buffer to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage jpegload_buffer( VipsBlob *buffer, VOption *options = 0 ); ++ /** ++ * Save image in jpeg2000 format. ++ * ++ * **Optional parameters** ++ * - **tile_width** -- Tile width in pixels, int. ++ * - **tile_height** -- Tile height in pixels, int. ++ * - **lossless** -- Enable lossless compression, bool. ++ * - **Q** -- Q factor, int. ++ * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param target Target to save to. ++ * @param options Set of options. ++ */ ++ void jp2ksave_target(VTarget target, VOption *options = 0) const; + +-/** +- * Load image from jpeg source. +- * +- * **Optional parameters** +- * - **shrink** -- Shrink factor on load, int. +- * - **autorotate** -- Rotate image using exif orientation, bool. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage jpegload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Load jpeg from file. ++ * ++ * **Optional parameters** ++ * - **shrink** -- Shrink factor on load, int. ++ * - **autorotate** -- Rotate image using exif orientation, bool. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage jpegload(const char *filename, VOption *options = 0); + +-/** +- * Save image to jpeg file. +- * +- * **Optional parameters** +- * - **Q** -- Q factor, int. +- * - **profile** -- ICC profile to embed, const char *. +- * - **optimize_coding** -- Compute optimal Huffman coding tables, bool. +- * - **interlace** -- Generate an interlaced (progressive) jpeg, bool. +- * - **trellis_quant** -- Apply trellis quantisation to each 8x8 block, bool. +- * - **overshoot_deringing** -- Apply overshooting to samples with extreme values, bool. +- * - **optimize_scans** -- Split spectrum of DCT coefficients into separate scans, bool. +- * - **quant_table** -- Use predefined quantization table with given index, int. +- * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. +- * - **restart_interval** -- Add restart markers every specified number of mcu, int. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void jpegsave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load jpeg from buffer. ++ * ++ * **Optional parameters** ++ * - **shrink** -- Shrink factor on load, int. ++ * - **autorotate** -- Rotate image using exif orientation, bool. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param buffer Buffer to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage jpegload_buffer(VipsBlob *buffer, VOption *options = 0); + +-/** +- * Save image to jpeg buffer. +- * +- * **Optional parameters** +- * - **Q** -- Q factor, int. +- * - **profile** -- ICC profile to embed, const char *. +- * - **optimize_coding** -- Compute optimal Huffman coding tables, bool. +- * - **interlace** -- Generate an interlaced (progressive) jpeg, bool. +- * - **trellis_quant** -- Apply trellis quantisation to each 8x8 block, bool. +- * - **overshoot_deringing** -- Apply overshooting to samples with extreme values, bool. +- * - **optimize_scans** -- Split spectrum of DCT coefficients into separate scans, bool. +- * - **quant_table** -- Use predefined quantization table with given index, int. +- * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. +- * - **restart_interval** -- Add restart markers every specified number of mcu, int. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param options Set of options. +- * @return Buffer to save to. +- */ +-VipsBlob *jpegsave_buffer( VOption *options = 0 ) const; ++ /** ++ * Load image from jpeg source. ++ * ++ * **Optional parameters** ++ * - **shrink** -- Shrink factor on load, int. ++ * - **autorotate** -- Rotate image using exif orientation, bool. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage jpegload_source(VSource source, VOption *options = 0); + +-/** +- * Save image to jpeg mime. +- * +- * **Optional parameters** +- * - **Q** -- Q factor, int. +- * - **profile** -- ICC profile to embed, const char *. +- * - **optimize_coding** -- Compute optimal Huffman coding tables, bool. +- * - **interlace** -- Generate an interlaced (progressive) jpeg, bool. +- * - **trellis_quant** -- Apply trellis quantisation to each 8x8 block, bool. +- * - **overshoot_deringing** -- Apply overshooting to samples with extreme values, bool. +- * - **optimize_scans** -- Split spectrum of DCT coefficients into separate scans, bool. +- * - **quant_table** -- Use predefined quantization table with given index, int. +- * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. +- * - **restart_interval** -- Add restart markers every specified number of mcu, int. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param options Set of options. +- */ +-void jpegsave_mime( VOption *options = 0 ) const; ++ /** ++ * Save image to jpeg file. ++ * ++ * **Optional parameters** ++ * - **Q** -- Q factor, int. ++ * - **profile** -- ICC profile to embed, const char *. ++ * - **optimize_coding** -- Compute optimal Huffman coding tables, bool. ++ * - **interlace** -- Generate an interlaced (progressive) jpeg, bool. ++ * - **trellis_quant** -- Apply trellis quantisation to each 8x8 block, bool. ++ * - **overshoot_deringing** -- Apply overshooting to samples with extreme values, bool. ++ * - **optimize_scans** -- Split spectrum of DCT coefficients into separate scans, bool. ++ * - **quant_table** -- Use predefined quantization table with given index, int. ++ * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. ++ * - **restart_interval** -- Add restart markers every specified number of mcu, int. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void jpegsave(const char *filename, VOption *options = 0) const; + +-/** +- * Save image to jpeg target. +- * +- * **Optional parameters** +- * - **Q** -- Q factor, int. +- * - **profile** -- ICC profile to embed, const char *. +- * - **optimize_coding** -- Compute optimal Huffman coding tables, bool. +- * - **interlace** -- Generate an interlaced (progressive) jpeg, bool. +- * - **trellis_quant** -- Apply trellis quantisation to each 8x8 block, bool. +- * - **overshoot_deringing** -- Apply overshooting to samples with extreme values, bool. +- * - **optimize_scans** -- Split spectrum of DCT coefficients into separate scans, bool. +- * - **quant_table** -- Use predefined quantization table with given index, int. +- * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. +- * - **restart_interval** -- Add restart markers every specified number of mcu, int. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param target Target to save to. +- * @param options Set of options. +- */ +-void jpegsave_target( VTarget target, VOption *options = 0 ) const; ++ /** ++ * Save image to jpeg buffer. ++ * ++ * **Optional parameters** ++ * - **Q** -- Q factor, int. ++ * - **profile** -- ICC profile to embed, const char *. ++ * - **optimize_coding** -- Compute optimal Huffman coding tables, bool. ++ * - **interlace** -- Generate an interlaced (progressive) jpeg, bool. ++ * - **trellis_quant** -- Apply trellis quantisation to each 8x8 block, bool. ++ * - **overshoot_deringing** -- Apply overshooting to samples with extreme values, bool. ++ * - **optimize_scans** -- Split spectrum of DCT coefficients into separate scans, bool. ++ * - **quant_table** -- Use predefined quantization table with given index, int. ++ * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. ++ * - **restart_interval** -- Add restart markers every specified number of mcu, int. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param options Set of options. ++ * @return Buffer to save to. ++ */ ++ VipsBlob *jpegsave_buffer(VOption *options = 0) const; + +-/** +- * Load jpeg-xl image. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage jxlload( const char *filename, VOption *options = 0 ); ++ /** ++ * Save image to jpeg mime. ++ * ++ * **Optional parameters** ++ * - **Q** -- Q factor, int. ++ * - **profile** -- ICC profile to embed, const char *. ++ * - **optimize_coding** -- Compute optimal Huffman coding tables, bool. ++ * - **interlace** -- Generate an interlaced (progressive) jpeg, bool. ++ * - **trellis_quant** -- Apply trellis quantisation to each 8x8 block, bool. ++ * - **overshoot_deringing** -- Apply overshooting to samples with extreme values, bool. ++ * - **optimize_scans** -- Split spectrum of DCT coefficients into separate scans, bool. ++ * - **quant_table** -- Use predefined quantization table with given index, int. ++ * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. ++ * - **restart_interval** -- Add restart markers every specified number of mcu, int. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param options Set of options. ++ */ ++ void jpegsave_mime(VOption *options = 0) const; + +-/** +- * Load jpeg-xl image. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param buffer Buffer to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage jxlload_buffer( VipsBlob *buffer, VOption *options = 0 ); ++ /** ++ * Save image to jpeg target. ++ * ++ * **Optional parameters** ++ * - **Q** -- Q factor, int. ++ * - **profile** -- ICC profile to embed, const char *. ++ * - **optimize_coding** -- Compute optimal Huffman coding tables, bool. ++ * - **interlace** -- Generate an interlaced (progressive) jpeg, bool. ++ * - **trellis_quant** -- Apply trellis quantisation to each 8x8 block, bool. ++ * - **overshoot_deringing** -- Apply overshooting to samples with extreme values, bool. ++ * - **optimize_scans** -- Split spectrum of DCT coefficients into separate scans, bool. ++ * - **quant_table** -- Use predefined quantization table with given index, int. ++ * - **subsample_mode** -- Select chroma subsample operation mode, VipsForeignSubsample. ++ * - **restart_interval** -- Add restart markers every specified number of mcu, int. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param target Target to save to. ++ * @param options Set of options. ++ */ ++ void jpegsave_target(VTarget target, VOption *options = 0) const; + +-/** +- * Load jpeg-xl image. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage jxlload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Load jpeg-xl image. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage jxlload(const char *filename, VOption *options = 0); + +-/** +- * Save image in jpeg-xl format. +- * +- * **Optional parameters** +- * - **tier** -- Decode speed tier, int. +- * - **distance** -- Target butteraugli distance, double. +- * - **effort** -- Encoding effort, int. +- * - **lossless** -- Enable lossless compression, bool. +- * - **Q** -- Quality factor, int. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- */ +-void jxlsave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load jpeg-xl image. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param buffer Buffer to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage jxlload_buffer(VipsBlob *buffer, VOption *options = 0); + +-/** +- * Save image in jpeg-xl format. +- * +- * **Optional parameters** +- * - **tier** -- Decode speed tier, int. +- * - **distance** -- Target butteraugli distance, double. +- * - **effort** -- Encoding effort, int. +- * - **lossless** -- Enable lossless compression, bool. +- * - **Q** -- Quality factor, int. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param options Set of options. +- * @return Buffer to save to. +- */ +-VipsBlob *jxlsave_buffer( VOption *options = 0 ) const; ++ /** ++ * Load jpeg-xl image. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage jxlload_source(VSource source, VOption *options = 0); + +-/** +- * Save image in jpeg-xl format. +- * +- * **Optional parameters** +- * - **tier** -- Decode speed tier, int. +- * - **distance** -- Target butteraugli distance, double. +- * - **effort** -- Encoding effort, int. +- * - **lossless** -- Enable lossless compression, bool. +- * - **Q** -- Quality factor, int. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param target Target to save to. +- * @param options Set of options. +- */ +-void jxlsave_target( VTarget target, VOption *options = 0 ) const; ++ /** ++ * Save image in jpeg-xl format. ++ * ++ * **Optional parameters** ++ * - **tier** -- Decode speed tier, int. ++ * - **distance** -- Target butteraugli distance, double. ++ * - **effort** -- Encoding effort, int. ++ * - **lossless** -- Enable lossless compression, bool. ++ * - **Q** -- Quality factor, int. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ */ ++ void jxlsave(const char *filename, VOption *options = 0) const; + +-/** +- * Label regions in an image. +- * @param options Set of options. +- * @return Mask of region labels. +- */ +-VImage labelregions( VOption *options = 0 ) const; ++ /** ++ * Save image in jpeg-xl format. ++ * ++ * **Optional parameters** ++ * - **tier** -- Decode speed tier, int. ++ * - **distance** -- Target butteraugli distance, double. ++ * - **effort** -- Encoding effort, int. ++ * - **lossless** -- Enable lossless compression, bool. ++ * - **Q** -- Quality factor, int. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param options Set of options. ++ * @return Buffer to save to. ++ */ ++ VipsBlob *jxlsave_buffer(VOption *options = 0) const; + +-/** +- * Calculate (a * in + b). +- * +- * **Optional parameters** +- * - **uchar** -- Output should be uchar, bool. +- * +- * @param a Multiply by this. +- * @param b Add this. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage linear( std::vector a, std::vector b, VOption *options = 0 ) const; ++ /** ++ * Save image in jpeg-xl format. ++ * ++ * **Optional parameters** ++ * - **tier** -- Decode speed tier, int. ++ * - **distance** -- Target butteraugli distance, double. ++ * - **effort** -- Encoding effort, int. ++ * - **lossless** -- Enable lossless compression, bool. ++ * - **Q** -- Quality factor, int. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param target Target to save to. ++ * @param options Set of options. ++ */ ++ void jxlsave_target(VTarget target, VOption *options = 0) const; + +-/** +- * Cache an image as a set of lines. +- * +- * **Optional parameters** +- * - **tile_height** -- Tile height in pixels, int. +- * - **access** -- Expected access pattern, VipsAccess. +- * - **threaded** -- Allow threaded access, bool. +- * - **persistent** -- Keep cache between evaluations, bool. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage linecache( VOption *options = 0 ) const; ++ /** ++ * Label regions in an image. ++ * @param options Set of options. ++ * @return Mask of region labels. ++ */ ++ VImage labelregions(VOption *options = 0) const; + +-/** +- * Make a laplacian of gaussian image. +- * +- * **Optional parameters** +- * - **separable** -- Generate separable Gaussian, bool. +- * - **precision** -- Generate with this precision, VipsPrecision. +- * +- * @param sigma Radius of Gaussian. +- * @param min_ampl Minimum amplitude of Gaussian. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage logmat( double sigma, double min_ampl, VOption *options = 0 ); ++ /** ++ * Calculate (a * in + b). ++ * ++ * **Optional parameters** ++ * - **uchar** -- Output should be uchar, bool. ++ * ++ * @param a Multiply by this. ++ * @param b Add this. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage linear(std::vector a, std::vector b, VOption *options = 0) const; + +-/** +- * Load file with imagemagick. +- * +- * **Optional parameters** +- * - **density** -- Canvas resolution for rendering vector formats like SVG, const char *. +- * - **page** -- Load this page from the file, int. +- * - **n** -- Load this many pages, int. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage magickload( const char *filename, VOption *options = 0 ); ++ /** ++ * Cache an image as a set of lines. ++ * ++ * **Optional parameters** ++ * - **tile_height** -- Tile height in pixels, int. ++ * - **access** -- Expected access pattern, VipsAccess. ++ * - **threaded** -- Allow threaded access, bool. ++ * - **persistent** -- Keep cache between evaluations, bool. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage linecache(VOption *options = 0) const; + +-/** +- * Load buffer with imagemagick. +- * +- * **Optional parameters** +- * - **density** -- Canvas resolution for rendering vector formats like SVG, const char *. +- * - **page** -- Load this page from the file, int. +- * - **n** -- Load this many pages, int. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param buffer Buffer to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage magickload_buffer( VipsBlob *buffer, VOption *options = 0 ); ++ /** ++ * Make a laplacian of gaussian image. ++ * ++ * **Optional parameters** ++ * - **separable** -- Generate separable Gaussian, bool. ++ * - **precision** -- Generate with this precision, VipsPrecision. ++ * ++ * @param sigma Radius of Gaussian. ++ * @param min_ampl Minimum amplitude of Gaussian. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage logmat(double sigma, double min_ampl, VOption *options = 0); + +-/** +- * Save file with imagemagick. +- * +- * **Optional parameters** +- * - **format** -- Format to save in, const char *. +- * - **quality** -- Quality to use, int. +- * - **optimize_gif_frames** -- Apply GIF frames optimization, bool. +- * - **optimize_gif_transparency** -- Apply GIF transparency optimization, bool. +- * - **bitdepth** -- Number of bits per pixel, int. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void magicksave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load file with imagemagick. ++ * ++ * **Optional parameters** ++ * - **density** -- Canvas resolution for rendering vector formats like SVG, const char *. ++ * - **page** -- Load this page from the file, int. ++ * - **n** -- Load this many pages, int. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage magickload(const char *filename, VOption *options = 0); + +-/** +- * Save image to magick buffer. +- * +- * **Optional parameters** +- * - **format** -- Format to save in, const char *. +- * - **quality** -- Quality to use, int. +- * - **optimize_gif_frames** -- Apply GIF frames optimization, bool. +- * - **optimize_gif_transparency** -- Apply GIF transparency optimization, bool. +- * - **bitdepth** -- Number of bits per pixel, int. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param options Set of options. +- * @return Buffer to save to. +- */ +-VipsBlob *magicksave_buffer( VOption *options = 0 ) const; ++ /** ++ * Load buffer with imagemagick. ++ * ++ * **Optional parameters** ++ * - **density** -- Canvas resolution for rendering vector formats like SVG, const char *. ++ * - **page** -- Load this page from the file, int. ++ * - **n** -- Load this many pages, int. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param buffer Buffer to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage magickload_buffer(VipsBlob *buffer, VOption *options = 0); + +-/** +- * Resample with a map image. +- * +- * **Optional parameters** +- * - **interpolate** -- Interpolate pixels with this, VInterpolate. +- * - **background** -- Background value, std::vector. +- * - **premultiplied** -- Images have premultiplied alpha, bool. +- * - **extend** -- How to generate the extra pixels, VipsExtend. +- * +- * @param index Index pixels with this. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage mapim( VImage index, VOption *options = 0 ) const; ++ /** ++ * Save file with imagemagick. ++ * ++ * **Optional parameters** ++ * - **format** -- Format to save in, const char *. ++ * - **quality** -- Quality to use, int. ++ * - **optimize_gif_frames** -- Apply GIF frames optimization, bool. ++ * - **optimize_gif_transparency** -- Apply GIF transparency optimization, bool. ++ * - **bitdepth** -- Number of bits per pixel, int. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void magicksave(const char *filename, VOption *options = 0) const; + +-/** +- * Map an image though a lut. +- * +- * **Optional parameters** +- * - **band** -- Apply one-band lut to this band of in, int. +- * +- * @param lut Look-up table image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage maplut( VImage lut, VOption *options = 0 ) const; ++ /** ++ * Save image to magick buffer. ++ * ++ * **Optional parameters** ++ * - **format** -- Format to save in, const char *. ++ * - **quality** -- Quality to use, int. ++ * - **optimize_gif_frames** -- Apply GIF frames optimization, bool. ++ * - **optimize_gif_transparency** -- Apply GIF transparency optimization, bool. ++ * - **bitdepth** -- Number of bits per pixel, int. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param options Set of options. ++ * @return Buffer to save to. ++ */ ++ VipsBlob *magicksave_buffer(VOption *options = 0) const; + +-/** +- * Make a butterworth filter. +- * +- * **Optional parameters** +- * - **uchar** -- Output an unsigned char image, bool. +- * - **nodc** -- Remove DC component, bool. +- * - **reject** -- Invert the sense of the filter, bool. +- * - **optical** -- Rotate quadrants to optical space, bool. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param order Filter order. +- * @param frequency_cutoff Frequency cutoff. +- * @param amplitude_cutoff Amplitude cutoff. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage mask_butterworth( int width, int height, double order, double frequency_cutoff, double amplitude_cutoff, VOption *options = 0 ); ++ /** ++ * Resample with a map image. ++ * ++ * **Optional parameters** ++ * - **interpolate** -- Interpolate pixels with this, VInterpolate. ++ * - **background** -- Background value, std::vector. ++ * - **premultiplied** -- Images have premultiplied alpha, bool. ++ * - **extend** -- How to generate the extra pixels, VipsExtend. ++ * ++ * @param index Index pixels with this. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage mapim(VImage index, VOption *options = 0) const; + +-/** +- * Make a butterworth_band filter. +- * +- * **Optional parameters** +- * - **uchar** -- Output an unsigned char image, bool. +- * - **nodc** -- Remove DC component, bool. +- * - **reject** -- Invert the sense of the filter, bool. +- * - **optical** -- Rotate quadrants to optical space, bool. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param order Filter order. +- * @param frequency_cutoff_x Frequency cutoff x. +- * @param frequency_cutoff_y Frequency cutoff y. +- * @param radius Radius of circle. +- * @param amplitude_cutoff Amplitude cutoff. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage mask_butterworth_band( int width, int height, double order, double frequency_cutoff_x, double frequency_cutoff_y, double radius, double amplitude_cutoff, VOption *options = 0 ); ++ /** ++ * Map an image though a lut. ++ * ++ * **Optional parameters** ++ * - **band** -- Apply one-band lut to this band of in, int. ++ * ++ * @param lut Look-up table image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage maplut(VImage lut, VOption *options = 0) const; + +-/** +- * Make a butterworth ring filter. +- * +- * **Optional parameters** +- * - **uchar** -- Output an unsigned char image, bool. +- * - **nodc** -- Remove DC component, bool. +- * - **reject** -- Invert the sense of the filter, bool. +- * - **optical** -- Rotate quadrants to optical space, bool. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param order Filter order. +- * @param frequency_cutoff Frequency cutoff. +- * @param amplitude_cutoff Amplitude cutoff. +- * @param ringwidth Ringwidth. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage mask_butterworth_ring( int width, int height, double order, double frequency_cutoff, double amplitude_cutoff, double ringwidth, VOption *options = 0 ); ++ /** ++ * Make a butterworth filter. ++ * ++ * **Optional parameters** ++ * - **uchar** -- Output an unsigned char image, bool. ++ * - **nodc** -- Remove DC component, bool. ++ * - **reject** -- Invert the sense of the filter, bool. ++ * - **optical** -- Rotate quadrants to optical space, bool. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param order Filter order. ++ * @param frequency_cutoff Frequency cutoff. ++ * @param amplitude_cutoff Amplitude cutoff. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage mask_butterworth(int width, int height, double order, double frequency_cutoff, double amplitude_cutoff, VOption *options = 0); + +-/** +- * Make fractal filter. +- * +- * **Optional parameters** +- * - **uchar** -- Output an unsigned char image, bool. +- * - **nodc** -- Remove DC component, bool. +- * - **reject** -- Invert the sense of the filter, bool. +- * - **optical** -- Rotate quadrants to optical space, bool. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param fractal_dimension Fractal dimension. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage mask_fractal( int width, int height, double fractal_dimension, VOption *options = 0 ); ++ /** ++ * Make a butterworth_band filter. ++ * ++ * **Optional parameters** ++ * - **uchar** -- Output an unsigned char image, bool. ++ * - **nodc** -- Remove DC component, bool. ++ * - **reject** -- Invert the sense of the filter, bool. ++ * - **optical** -- Rotate quadrants to optical space, bool. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param order Filter order. ++ * @param frequency_cutoff_x Frequency cutoff x. ++ * @param frequency_cutoff_y Frequency cutoff y. ++ * @param radius Radius of circle. ++ * @param amplitude_cutoff Amplitude cutoff. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage mask_butterworth_band(int width, int height, double order, double frequency_cutoff_x, double frequency_cutoff_y, double radius, double amplitude_cutoff, VOption *options = 0); + +-/** +- * Make a gaussian filter. +- * +- * **Optional parameters** +- * - **uchar** -- Output an unsigned char image, bool. +- * - **nodc** -- Remove DC component, bool. +- * - **reject** -- Invert the sense of the filter, bool. +- * - **optical** -- Rotate quadrants to optical space, bool. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param frequency_cutoff Frequency cutoff. +- * @param amplitude_cutoff Amplitude cutoff. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage mask_gaussian( int width, int height, double frequency_cutoff, double amplitude_cutoff, VOption *options = 0 ); ++ /** ++ * Make a butterworth ring filter. ++ * ++ * **Optional parameters** ++ * - **uchar** -- Output an unsigned char image, bool. ++ * - **nodc** -- Remove DC component, bool. ++ * - **reject** -- Invert the sense of the filter, bool. ++ * - **optical** -- Rotate quadrants to optical space, bool. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param order Filter order. ++ * @param frequency_cutoff Frequency cutoff. ++ * @param amplitude_cutoff Amplitude cutoff. ++ * @param ringwidth Ringwidth. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage mask_butterworth_ring(int width, int height, double order, double frequency_cutoff, double amplitude_cutoff, double ringwidth, VOption *options = 0); + +-/** +- * Make a gaussian filter. +- * +- * **Optional parameters** +- * - **uchar** -- Output an unsigned char image, bool. +- * - **nodc** -- Remove DC component, bool. +- * - **reject** -- Invert the sense of the filter, bool. +- * - **optical** -- Rotate quadrants to optical space, bool. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param frequency_cutoff_x Frequency cutoff x. +- * @param frequency_cutoff_y Frequency cutoff y. +- * @param radius Radius of circle. +- * @param amplitude_cutoff Amplitude cutoff. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage mask_gaussian_band( int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius, double amplitude_cutoff, VOption *options = 0 ); ++ /** ++ * Make fractal filter. ++ * ++ * **Optional parameters** ++ * - **uchar** -- Output an unsigned char image, bool. ++ * - **nodc** -- Remove DC component, bool. ++ * - **reject** -- Invert the sense of the filter, bool. ++ * - **optical** -- Rotate quadrants to optical space, bool. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param fractal_dimension Fractal dimension. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage mask_fractal(int width, int height, double fractal_dimension, VOption *options = 0); + +-/** +- * Make a gaussian ring filter. +- * +- * **Optional parameters** +- * - **uchar** -- Output an unsigned char image, bool. +- * - **nodc** -- Remove DC component, bool. +- * - **reject** -- Invert the sense of the filter, bool. +- * - **optical** -- Rotate quadrants to optical space, bool. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param frequency_cutoff Frequency cutoff. +- * @param amplitude_cutoff Amplitude cutoff. +- * @param ringwidth Ringwidth. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage mask_gaussian_ring( int width, int height, double frequency_cutoff, double amplitude_cutoff, double ringwidth, VOption *options = 0 ); ++ /** ++ * Make a gaussian filter. ++ * ++ * **Optional parameters** ++ * - **uchar** -- Output an unsigned char image, bool. ++ * - **nodc** -- Remove DC component, bool. ++ * - **reject** -- Invert the sense of the filter, bool. ++ * - **optical** -- Rotate quadrants to optical space, bool. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param frequency_cutoff Frequency cutoff. ++ * @param amplitude_cutoff Amplitude cutoff. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage mask_gaussian(int width, int height, double frequency_cutoff, double amplitude_cutoff, VOption *options = 0); + +-/** +- * Make an ideal filter. +- * +- * **Optional parameters** +- * - **uchar** -- Output an unsigned char image, bool. +- * - **nodc** -- Remove DC component, bool. +- * - **reject** -- Invert the sense of the filter, bool. +- * - **optical** -- Rotate quadrants to optical space, bool. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param frequency_cutoff Frequency cutoff. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage mask_ideal( int width, int height, double frequency_cutoff, VOption *options = 0 ); ++ /** ++ * Make a gaussian filter. ++ * ++ * **Optional parameters** ++ * - **uchar** -- Output an unsigned char image, bool. ++ * - **nodc** -- Remove DC component, bool. ++ * - **reject** -- Invert the sense of the filter, bool. ++ * - **optical** -- Rotate quadrants to optical space, bool. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param frequency_cutoff_x Frequency cutoff x. ++ * @param frequency_cutoff_y Frequency cutoff y. ++ * @param radius Radius of circle. ++ * @param amplitude_cutoff Amplitude cutoff. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage mask_gaussian_band(int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius, double amplitude_cutoff, VOption *options = 0); + +-/** +- * Make an ideal band filter. +- * +- * **Optional parameters** +- * - **uchar** -- Output an unsigned char image, bool. +- * - **nodc** -- Remove DC component, bool. +- * - **reject** -- Invert the sense of the filter, bool. +- * - **optical** -- Rotate quadrants to optical space, bool. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param frequency_cutoff_x Frequency cutoff x. +- * @param frequency_cutoff_y Frequency cutoff y. +- * @param radius Radius of circle. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage mask_ideal_band( int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius, VOption *options = 0 ); ++ /** ++ * Make a gaussian ring filter. ++ * ++ * **Optional parameters** ++ * - **uchar** -- Output an unsigned char image, bool. ++ * - **nodc** -- Remove DC component, bool. ++ * - **reject** -- Invert the sense of the filter, bool. ++ * - **optical** -- Rotate quadrants to optical space, bool. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param frequency_cutoff Frequency cutoff. ++ * @param amplitude_cutoff Amplitude cutoff. ++ * @param ringwidth Ringwidth. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage mask_gaussian_ring(int width, int height, double frequency_cutoff, double amplitude_cutoff, double ringwidth, VOption *options = 0); + +-/** +- * Make an ideal ring filter. +- * +- * **Optional parameters** +- * - **uchar** -- Output an unsigned char image, bool. +- * - **nodc** -- Remove DC component, bool. +- * - **reject** -- Invert the sense of the filter, bool. +- * - **optical** -- Rotate quadrants to optical space, bool. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param frequency_cutoff Frequency cutoff. +- * @param ringwidth Ringwidth. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage mask_ideal_ring( int width, int height, double frequency_cutoff, double ringwidth, VOption *options = 0 ); ++ /** ++ * Make an ideal filter. ++ * ++ * **Optional parameters** ++ * - **uchar** -- Output an unsigned char image, bool. ++ * - **nodc** -- Remove DC component, bool. ++ * - **reject** -- Invert the sense of the filter, bool. ++ * - **optical** -- Rotate quadrants to optical space, bool. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param frequency_cutoff Frequency cutoff. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage mask_ideal(int width, int height, double frequency_cutoff, VOption *options = 0); + +-/** +- * First-order match of two images. +- * +- * **Optional parameters** +- * - **hwindow** -- Half window size, int. +- * - **harea** -- Half area size, int. +- * - **search** -- Search to improve tie-points, bool. +- * - **interpolate** -- Interpolate pixels with this, VInterpolate. +- * +- * @param sec Secondary image. +- * @param xr1 Position of first reference tie-point. +- * @param yr1 Position of first reference tie-point. +- * @param xs1 Position of first secondary tie-point. +- * @param ys1 Position of first secondary tie-point. +- * @param xr2 Position of second reference tie-point. +- * @param yr2 Position of second reference tie-point. +- * @param xs2 Position of second secondary tie-point. +- * @param ys2 Position of second secondary tie-point. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage match( VImage sec, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, VOption *options = 0 ) const; ++ /** ++ * Make an ideal band filter. ++ * ++ * **Optional parameters** ++ * - **uchar** -- Output an unsigned char image, bool. ++ * - **nodc** -- Remove DC component, bool. ++ * - **reject** -- Invert the sense of the filter, bool. ++ * - **optical** -- Rotate quadrants to optical space, bool. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param frequency_cutoff_x Frequency cutoff x. ++ * @param frequency_cutoff_y Frequency cutoff y. ++ * @param radius Radius of circle. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage mask_ideal_band(int width, int height, double frequency_cutoff_x, double frequency_cutoff_y, double radius, VOption *options = 0); + +-/** +- * Apply a math operation to an image. +- * @param math Math to perform. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage math( VipsOperationMath math, VOption *options = 0 ) const; ++ /** ++ * Make an ideal ring filter. ++ * ++ * **Optional parameters** ++ * - **uchar** -- Output an unsigned char image, bool. ++ * - **nodc** -- Remove DC component, bool. ++ * - **reject** -- Invert the sense of the filter, bool. ++ * - **optical** -- Rotate quadrants to optical space, bool. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param frequency_cutoff Frequency cutoff. ++ * @param ringwidth Ringwidth. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage mask_ideal_ring(int width, int height, double frequency_cutoff, double ringwidth, VOption *options = 0); + +-/** +- * Binary math operations. +- * @param right Right-hand image argument. +- * @param math2 Math to perform. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage math2( VImage right, VipsOperationMath2 math2, VOption *options = 0 ) const; ++ /** ++ * First-order match of two images. ++ * ++ * **Optional parameters** ++ * - **hwindow** -- Half window size, int. ++ * - **harea** -- Half area size, int. ++ * - **search** -- Search to improve tie-points, bool. ++ * - **interpolate** -- Interpolate pixels with this, VInterpolate. ++ * ++ * @param sec Secondary image. ++ * @param xr1 Position of first reference tie-point. ++ * @param yr1 Position of first reference tie-point. ++ * @param xs1 Position of first secondary tie-point. ++ * @param ys1 Position of first secondary tie-point. ++ * @param xr2 Position of second reference tie-point. ++ * @param yr2 Position of second reference tie-point. ++ * @param xs2 Position of second secondary tie-point. ++ * @param ys2 Position of second secondary tie-point. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage match(VImage sec, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, VOption *options = 0) const; + +-/** +- * Binary math operations with a constant. +- * @param math2 Math to perform. +- * @param c Array of constants. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage math2_const( VipsOperationMath2 math2, std::vector c, VOption *options = 0 ) const; ++ /** ++ * Apply a math operation to an image. ++ * @param math Math to perform. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage math(VipsOperationMath math, VOption *options = 0) const; + +-/** +- * Load mat from file. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage matload( const char *filename, VOption *options = 0 ); ++ /** ++ * Binary math operations. ++ * @param right Right-hand image argument. ++ * @param math2 Math to perform. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage math2(VImage right, VipsOperationMath2 math2, VOption *options = 0) const; + +-/** +- * Invert an matrix. +- * @param options Set of options. +- * @return Output matrix. +- */ +-VImage matrixinvert( VOption *options = 0 ) const; ++ /** ++ * Binary math operations with a constant. ++ * @param math2 Math to perform. ++ * @param c Array of constants. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage math2_const(VipsOperationMath2 math2, std::vector c, VOption *options = 0) const; + +-/** +- * Load matrix. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage matrixload( const char *filename, VOption *options = 0 ); ++ /** ++ * Load mat from file. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage matload(const char *filename, VOption *options = 0); + +-/** +- * Load matrix. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage matrixload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Invert an matrix. ++ * @param options Set of options. ++ * @return Output matrix. ++ */ ++ VImage matrixinvert(VOption *options = 0) const; + +-/** +- * Print matrix. +- * +- * **Optional parameters** +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param options Set of options. +- */ +-void matrixprint( VOption *options = 0 ) const; ++ /** ++ * Load matrix. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage matrixload(const char *filename, VOption *options = 0); + +-/** +- * Save image to matrix. +- * +- * **Optional parameters** +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void matrixsave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load matrix. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage matrixload_source(VSource source, VOption *options = 0); + +-/** +- * Save image to matrix. +- * +- * **Optional parameters** +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param target Target to save to. +- * @param options Set of options. +- */ +-void matrixsave_target( VTarget target, VOption *options = 0 ) const; ++ /** ++ * Print matrix. ++ * ++ * **Optional parameters** ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param options Set of options. ++ */ ++ void matrixprint(VOption *options = 0) const; + +-/** +- * Find image maximum. +- * +- * **Optional parameters** +- * - **size** -- Number of maximum values to find, int. +- * +- * @param options Set of options. +- * @return Output value. +- */ +-double max( VOption *options = 0 ) const; ++ /** ++ * Save image to matrix. ++ * ++ * **Optional parameters** ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void matrixsave(const char *filename, VOption *options = 0) const; + +-/** +- * Measure a set of patches on a color chart. +- * +- * **Optional parameters** +- * - **left** -- Left edge of extract area, int. +- * - **top** -- Top edge of extract area, int. +- * - **width** -- Width of extract area, int. +- * - **height** -- Height of extract area, int. +- * +- * @param h Number of patches across chart. +- * @param v Number of patches down chart. +- * @param options Set of options. +- * @return Output array of statistics. +- */ +-VImage measure( int h, int v, VOption *options = 0 ) const; ++ /** ++ * Save image to matrix. ++ * ++ * **Optional parameters** ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param target Target to save to. ++ * @param options Set of options. ++ */ ++ void matrixsave_target(VTarget target, VOption *options = 0) const; + +-/** +- * Merge two images. +- * +- * **Optional parameters** +- * - **mblend** -- Maximum blend size, int. +- * +- * @param sec Secondary image. +- * @param direction Horizontal or vertical merge. +- * @param dx Horizontal displacement from sec to ref. +- * @param dy Vertical displacement from sec to ref. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage merge( VImage sec, VipsDirection direction, int dx, int dy, VOption *options = 0 ) const; ++ /** ++ * Find image maximum. ++ * ++ * **Optional parameters** ++ * - **size** -- Number of maximum values to find, int. ++ * ++ * @param options Set of options. ++ * @return Output value. ++ */ ++ double max(VOption *options = 0) const; + +-/** +- * Find image minimum. +- * +- * **Optional parameters** +- * - **size** -- Number of minimum values to find, int. +- * +- * @param options Set of options. +- * @return Output value. +- */ +-double min( VOption *options = 0 ) const; ++ /** ++ * Measure a set of patches on a color chart. ++ * ++ * **Optional parameters** ++ * - **left** -- Left edge of extract area, int. ++ * - **top** -- Top edge of extract area, int. ++ * - **width** -- Width of extract area, int. ++ * - **height** -- Height of extract area, int. ++ * ++ * @param h Number of patches across chart. ++ * @param v Number of patches down chart. ++ * @param options Set of options. ++ * @return Output array of statistics. ++ */ ++ VImage measure(int h, int v, VOption *options = 0) const; + +-/** +- * Morphology operation. +- * @param mask Input matrix image. +- * @param morph Morphological operation to perform. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage morph( VImage mask, VipsOperationMorphology morph, VOption *options = 0 ) const; ++ /** ++ * Merge two images. ++ * ++ * **Optional parameters** ++ * - **mblend** -- Maximum blend size, int. ++ * ++ * @param sec Secondary image. ++ * @param direction Horizontal or vertical merge. ++ * @param dx Horizontal displacement from sec to ref. ++ * @param dy Vertical displacement from sec to ref. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage merge(VImage sec, VipsDirection direction, int dx, int dy, VOption *options = 0) const; + +-/** +- * Mosaic two images. +- * +- * **Optional parameters** +- * - **hwindow** -- Half window size, int. +- * - **harea** -- Half area size, int. +- * - **mblend** -- Maximum blend size, int. +- * - **bandno** -- Band to search for features on, int. +- * +- * @param sec Secondary image. +- * @param direction Horizontal or vertical mosaic. +- * @param xref Position of reference tie-point. +- * @param yref Position of reference tie-point. +- * @param xsec Position of secondary tie-point. +- * @param ysec Position of secondary tie-point. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage mosaic( VImage sec, VipsDirection direction, int xref, int yref, int xsec, int ysec, VOption *options = 0 ) const; ++ /** ++ * Find image minimum. ++ * ++ * **Optional parameters** ++ * - **size** -- Number of minimum values to find, int. ++ * ++ * @param options Set of options. ++ * @return Output value. ++ */ ++ double min(VOption *options = 0) const; + +-/** +- * First-order mosaic of two images. +- * +- * **Optional parameters** +- * - **hwindow** -- Half window size, int. +- * - **harea** -- Half area size, int. +- * - **search** -- Search to improve tie-points, bool. +- * - **interpolate** -- Interpolate pixels with this, VInterpolate. +- * - **mblend** -- Maximum blend size, int. +- * +- * @param sec Secondary image. +- * @param direction Horizontal or vertical mosaic. +- * @param xr1 Position of first reference tie-point. +- * @param yr1 Position of first reference tie-point. +- * @param xs1 Position of first secondary tie-point. +- * @param ys1 Position of first secondary tie-point. +- * @param xr2 Position of second reference tie-point. +- * @param yr2 Position of second reference tie-point. +- * @param xs2 Position of second secondary tie-point. +- * @param ys2 Position of second secondary tie-point. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage mosaic1( VImage sec, VipsDirection direction, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, VOption *options = 0 ) const; ++ /** ++ * Morphology operation. ++ * @param mask Input matrix image. ++ * @param morph Morphological operation to perform. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage morph(VImage mask, VipsOperationMorphology morph, VOption *options = 0) const; + +-/** +- * Pick most-significant byte from an image. +- * +- * **Optional parameters** +- * - **band** -- Band to msb, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage msb( VOption *options = 0 ) const; ++ /** ++ * Mosaic two images. ++ * ++ * **Optional parameters** ++ * - **hwindow** -- Half window size, int. ++ * - **harea** -- Half area size, int. ++ * - **mblend** -- Maximum blend size, int. ++ * - **bandno** -- Band to search for features on, int. ++ * ++ * @param sec Secondary image. ++ * @param direction Horizontal or vertical mosaic. ++ * @param xref Position of reference tie-point. ++ * @param yref Position of reference tie-point. ++ * @param xsec Position of secondary tie-point. ++ * @param ysec Position of secondary tie-point. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage mosaic(VImage sec, VipsDirection direction, int xref, int yref, int xsec, int ysec, VOption *options = 0) const; + +-/** +- * Multiply two images. +- * @param right Right-hand image argument. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage multiply( VImage right, VOption *options = 0 ) const; ++ /** ++ * First-order mosaic of two images. ++ * ++ * **Optional parameters** ++ * - **hwindow** -- Half window size, int. ++ * - **harea** -- Half area size, int. ++ * - **search** -- Search to improve tie-points, bool. ++ * - **interpolate** -- Interpolate pixels with this, VInterpolate. ++ * - **mblend** -- Maximum blend size, int. ++ * ++ * @param sec Secondary image. ++ * @param direction Horizontal or vertical mosaic. ++ * @param xr1 Position of first reference tie-point. ++ * @param yr1 Position of first reference tie-point. ++ * @param xs1 Position of first secondary tie-point. ++ * @param ys1 Position of first secondary tie-point. ++ * @param xr2 Position of second reference tie-point. ++ * @param yr2 Position of second reference tie-point. ++ * @param xs2 Position of second secondary tie-point. ++ * @param ys2 Position of second secondary tie-point. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage mosaic1(VImage sec, VipsDirection direction, int xr1, int yr1, int xs1, int ys1, int xr2, int yr2, int xs2, int ys2, VOption *options = 0) const; ++ ++ /** ++ * Pick most-significant byte from an image. ++ * ++ * **Optional parameters** ++ * - **band** -- Band to msb, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage msb(VOption *options = 0) const; + +-/** +- * Load nifti volume. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage niftiload( const char *filename, VOption *options = 0 ); ++ /** ++ * Multiply two images. ++ * @param right Right-hand image argument. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage multiply(VImage right, VOption *options = 0) const; + +-/** +- * Load nifti volumes. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage niftiload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Load nifti volume. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage niftiload(const char *filename, VOption *options = 0); + +-/** +- * Save image to nifti file. +- * +- * **Optional parameters** +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void niftisave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load nifti volumes. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage niftiload_source(VSource source, VOption *options = 0); + +-/** +- * Load an openexr image. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage openexrload( const char *filename, VOption *options = 0 ); ++ /** ++ * Save image to nifti file. ++ * ++ * **Optional parameters** ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void niftisave(const char *filename, VOption *options = 0) const; + +-/** +- * Load file with openslide. +- * +- * **Optional parameters** +- * - **attach_associated** -- Attach all associated images, bool. +- * - **level** -- Load this level from the file, int. +- * - **autocrop** -- Crop to image bounds, bool. +- * - **associated** -- Load this associated image, const char *. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage openslideload( const char *filename, VOption *options = 0 ); ++ /** ++ * Load an openexr image. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage openexrload(const char *filename, VOption *options = 0); + +-/** +- * Load source with openslide. +- * +- * **Optional parameters** +- * - **attach_associated** -- Attach all associated images, bool. +- * - **level** -- Load this level from the file, int. +- * - **autocrop** -- Crop to image bounds, bool. +- * - **associated** -- Load this associated image, const char *. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage openslideload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Load file with openslide. ++ * ++ * **Optional parameters** ++ * - **attach_associated** -- Attach all associated images, bool. ++ * - **level** -- Load this level from the file, int. ++ * - **autocrop** -- Crop to image bounds, bool. ++ * - **associated** -- Load this associated image, const char *. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage openslideload(const char *filename, VOption *options = 0); + +-/** +- * Load pdf from file. +- * +- * **Optional parameters** +- * - **page** -- Load this page from the file, int. +- * - **n** -- Load this many pages, int. +- * - **dpi** -- Render at this DPI, double. +- * - **scale** -- Scale output by this factor, double. +- * - **background** -- Background value, std::vector. +- * - **password** -- Decrypt with this password, const char *. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage pdfload( const char *filename, VOption *options = 0 ); ++ /** ++ * Load source with openslide. ++ * ++ * **Optional parameters** ++ * - **attach_associated** -- Attach all associated images, bool. ++ * - **level** -- Load this level from the file, int. ++ * - **autocrop** -- Crop to image bounds, bool. ++ * - **associated** -- Load this associated image, const char *. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage openslideload_source(VSource source, VOption *options = 0); + +-/** +- * Load pdf from buffer. +- * +- * **Optional parameters** +- * - **page** -- Load this page from the file, int. +- * - **n** -- Load this many pages, int. +- * - **dpi** -- Render at this DPI, double. +- * - **scale** -- Scale output by this factor, double. +- * - **background** -- Background value, std::vector. +- * - **password** -- Decrypt with this password, const char *. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param buffer Buffer to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage pdfload_buffer( VipsBlob *buffer, VOption *options = 0 ); ++ /** ++ * Load pdf from file. ++ * ++ * **Optional parameters** ++ * - **page** -- Load this page from the file, int. ++ * - **n** -- Load this many pages, int. ++ * - **dpi** -- Render at this DPI, double. ++ * - **scale** -- Scale output by this factor, double. ++ * - **background** -- Background value, std::vector. ++ * - **password** -- Decrypt with this password, const char *. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage pdfload(const char *filename, VOption *options = 0); + +-/** +- * Load pdf from source. +- * +- * **Optional parameters** +- * - **page** -- Load this page from the file, int. +- * - **n** -- Load this many pages, int. +- * - **dpi** -- Render at this DPI, double. +- * - **scale** -- Scale output by this factor, double. +- * - **background** -- Background value, std::vector. +- * - **password** -- Decrypt with this password, const char *. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage pdfload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Load pdf from buffer. ++ * ++ * **Optional parameters** ++ * - **page** -- Load this page from the file, int. ++ * - **n** -- Load this many pages, int. ++ * - **dpi** -- Render at this DPI, double. ++ * - **scale** -- Scale output by this factor, double. ++ * - **background** -- Background value, std::vector. ++ * - **password** -- Decrypt with this password, const char *. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param buffer Buffer to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage pdfload_buffer(VipsBlob *buffer, VOption *options = 0); + +-/** +- * Find threshold for percent of pixels. +- * @param percent Percent of pixels. +- * @param options Set of options. +- * @return Threshold above which lie percent of pixels. +- */ +-int percent( double percent, VOption *options = 0 ) const; ++ /** ++ * Load pdf from source. ++ * ++ * **Optional parameters** ++ * - **page** -- Load this page from the file, int. ++ * - **n** -- Load this many pages, int. ++ * - **dpi** -- Render at this DPI, double. ++ * - **scale** -- Scale output by this factor, double. ++ * - **background** -- Background value, std::vector. ++ * - **password** -- Decrypt with this password, const char *. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage pdfload_source(VSource source, VOption *options = 0); + +-/** +- * Make a perlin noise image. +- * +- * **Optional parameters** +- * - **cell_size** -- Size of Perlin cells, int. +- * - **uchar** -- Output an unsigned char image, bool. +- * - **seed** -- Random number seed, int. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage perlin( int width, int height, VOption *options = 0 ); ++ /** ++ * Find threshold for percent of pixels. ++ * @param percent Percent of pixels. ++ * @param options Set of options. ++ * @return Threshold above which lie percent of pixels. ++ */ ++ int percent(double percent, VOption *options = 0) const; + +-/** +- * Calculate phase correlation. +- * @param in2 Second input image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage phasecor( VImage in2, VOption *options = 0 ) const; ++ /** ++ * Make a perlin noise image. ++ * ++ * **Optional parameters** ++ * - **cell_size** -- Size of Perlin cells, int. ++ * - **uchar** -- Output an unsigned char image, bool. ++ * - **seed** -- Random number seed, int. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage perlin(int width, int height, VOption *options = 0); + +-/** +- * Load png from file. +- * +- * **Optional parameters** +- * - **unlimited** -- Remove all denial of service limits, bool. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage pngload( const char *filename, VOption *options = 0 ); ++ /** ++ * Calculate phase correlation. ++ * @param in2 Second input image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage phasecor(VImage in2, VOption *options = 0) const; + +-/** +- * Load png from buffer. +- * +- * **Optional parameters** +- * - **unlimited** -- Remove all denial of service limits, bool. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param buffer Buffer to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage pngload_buffer( VipsBlob *buffer, VOption *options = 0 ); ++ /** ++ * Load png from file. ++ * ++ * **Optional parameters** ++ * - **unlimited** -- Remove all denial of service limits, bool. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage pngload(const char *filename, VOption *options = 0); + +-/** +- * Load png from source. +- * +- * **Optional parameters** +- * - **unlimited** -- Remove all denial of service limits, bool. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage pngload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Load png from buffer. ++ * ++ * **Optional parameters** ++ * - **unlimited** -- Remove all denial of service limits, bool. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param buffer Buffer to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage pngload_buffer(VipsBlob *buffer, VOption *options = 0); + +-/** +- * Save image to file as png. +- * +- * **Optional parameters** +- * - **compression** -- Compression factor, int. +- * - **interlace** -- Interlace image, bool. +- * - **profile** -- ICC profile to embed, const char *. +- * - **filter** -- libspng row filter flag(s), int. +- * - **palette** -- Quantise to 8bpp palette, bool. +- * - **Q** -- Quantisation quality, int. +- * - **dither** -- Amount of dithering, double. +- * - **bitdepth** -- Write as a 1, 2, 4, 8 or 16 bit image, int. +- * - **effort** -- Quantisation CPU effort, int. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void pngsave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load png from source. ++ * ++ * **Optional parameters** ++ * - **unlimited** -- Remove all denial of service limits, bool. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage pngload_source(VSource source, VOption *options = 0); + +-/** +- * Save image to buffer as png. +- * +- * **Optional parameters** +- * - **compression** -- Compression factor, int. +- * - **interlace** -- Interlace image, bool. +- * - **profile** -- ICC profile to embed, const char *. +- * - **filter** -- libspng row filter flag(s), int. +- * - **palette** -- Quantise to 8bpp palette, bool. +- * - **Q** -- Quantisation quality, int. +- * - **dither** -- Amount of dithering, double. +- * - **bitdepth** -- Write as a 1, 2, 4, 8 or 16 bit image, int. +- * - **effort** -- Quantisation CPU effort, int. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param options Set of options. +- * @return Buffer to save to. +- */ +-VipsBlob *pngsave_buffer( VOption *options = 0 ) const; ++ /** ++ * Save image to file as png. ++ * ++ * **Optional parameters** ++ * - **compression** -- Compression factor, int. ++ * - **interlace** -- Interlace image, bool. ++ * - **profile** -- ICC profile to embed, const char *. ++ * - **filter** -- libspng row filter flag(s), int. ++ * - **palette** -- Quantise to 8bpp palette, bool. ++ * - **Q** -- Quantisation quality, int. ++ * - **dither** -- Amount of dithering, double. ++ * - **bitdepth** -- Write as a 1, 2, 4, 8 or 16 bit image, int. ++ * - **effort** -- Quantisation CPU effort, int. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void pngsave(const char *filename, VOption *options = 0) const; + +-/** +- * Save image to target as png. +- * +- * **Optional parameters** +- * - **compression** -- Compression factor, int. +- * - **interlace** -- Interlace image, bool. +- * - **profile** -- ICC profile to embed, const char *. +- * - **filter** -- libspng row filter flag(s), int. +- * - **palette** -- Quantise to 8bpp palette, bool. +- * - **Q** -- Quantisation quality, int. +- * - **dither** -- Amount of dithering, double. +- * - **bitdepth** -- Write as a 1, 2, 4, 8 or 16 bit image, int. +- * - **effort** -- Quantisation CPU effort, int. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param target Target to save to. +- * @param options Set of options. +- */ +-void pngsave_target( VTarget target, VOption *options = 0 ) const; ++ /** ++ * Save image to buffer as png. ++ * ++ * **Optional parameters** ++ * - **compression** -- Compression factor, int. ++ * - **interlace** -- Interlace image, bool. ++ * - **profile** -- ICC profile to embed, const char *. ++ * - **filter** -- libspng row filter flag(s), int. ++ * - **palette** -- Quantise to 8bpp palette, bool. ++ * - **Q** -- Quantisation quality, int. ++ * - **dither** -- Amount of dithering, double. ++ * - **bitdepth** -- Write as a 1, 2, 4, 8 or 16 bit image, int. ++ * - **effort** -- Quantisation CPU effort, int. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param options Set of options. ++ * @return Buffer to save to. ++ */ ++ VipsBlob *pngsave_buffer(VOption *options = 0) const; + +-/** +- * Load ppm from file. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage ppmload( const char *filename, VOption *options = 0 ); ++ /** ++ * Save image to target as png. ++ * ++ * **Optional parameters** ++ * - **compression** -- Compression factor, int. ++ * - **interlace** -- Interlace image, bool. ++ * - **profile** -- ICC profile to embed, const char *. ++ * - **filter** -- libspng row filter flag(s), int. ++ * - **palette** -- Quantise to 8bpp palette, bool. ++ * - **Q** -- Quantisation quality, int. ++ * - **dither** -- Amount of dithering, double. ++ * - **bitdepth** -- Write as a 1, 2, 4, 8 or 16 bit image, int. ++ * - **effort** -- Quantisation CPU effort, int. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param target Target to save to. ++ * @param options Set of options. ++ */ ++ void pngsave_target(VTarget target, VOption *options = 0) const; + +-/** +- * Load ppm base class. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage ppmload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Load ppm from file. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage ppmload(const char *filename, VOption *options = 0); + +-/** +- * Save image to ppm file. +- * +- * **Optional parameters** +- * - **format** -- Format to save in, VipsForeignPpmFormat. +- * - **ascii** -- Save as ascii, bool. +- * - **bitdepth** -- Set to 1 to write as a 1 bit image, int. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void ppmsave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load ppm base class. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage ppmload_source(VSource source, VOption *options = 0); + +-/** +- * Save to ppm. +- * +- * **Optional parameters** +- * - **format** -- Format to save in, VipsForeignPpmFormat. +- * - **ascii** -- Save as ascii, bool. +- * - **bitdepth** -- Set to 1 to write as a 1 bit image, int. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param target Target to save to. +- * @param options Set of options. +- */ +-void ppmsave_target( VTarget target, VOption *options = 0 ) const; ++ /** ++ * Save image to ppm file. ++ * ++ * **Optional parameters** ++ * - **format** -- Format to save in, VipsForeignPpmFormat. ++ * - **ascii** -- Save as ascii, bool. ++ * - **bitdepth** -- Set to 1 to write as a 1 bit image, int. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void ppmsave(const char *filename, VOption *options = 0) const; + +-/** +- * Premultiply image alpha. +- * +- * **Optional parameters** +- * - **max_alpha** -- Maximum value of alpha channel, double. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage premultiply( VOption *options = 0 ) const; ++ /** ++ * Save to ppm. ++ * ++ * **Optional parameters** ++ * - **format** -- Format to save in, VipsForeignPpmFormat. ++ * - **ascii** -- Save as ascii, bool. ++ * - **bitdepth** -- Set to 1 to write as a 1 bit image, int. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param target Target to save to. ++ * @param options Set of options. ++ */ ++ void ppmsave_target(VTarget target, VOption *options = 0) const; + +-/** +- * Find image profiles. +- * @param rows First non-zero pixel in row. +- * @param options Set of options. +- * @return First non-zero pixel in column. +- */ +-VImage profile( VImage *rows, VOption *options = 0 ) const; ++ /** ++ * Premultiply image alpha. ++ * ++ * **Optional parameters** ++ * - **max_alpha** -- Maximum value of alpha channel, double. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage premultiply(VOption *options = 0) const; + +-/** +- * Load named icc profile. +- * @param name Profile name. +- * @param options Set of options. +- * @return Loaded profile. +- */ +-static VipsBlob *profile_load( const char *name, VOption *options = 0 ); ++ /** ++ * Find image profiles. ++ * @param rows First non-zero pixel in row. ++ * @param options Set of options. ++ * @return First non-zero pixel in column. ++ */ ++ VImage profile(VImage *rows, VOption *options = 0) const; + +-/** +- * Find image projections. +- * @param rows Sums of rows. +- * @param options Set of options. +- * @return Sums of columns. +- */ +-VImage project( VImage *rows, VOption *options = 0 ) const; ++ /** ++ * Load named icc profile. ++ * @param name Profile name. ++ * @param options Set of options. ++ * @return Loaded profile. ++ */ ++ static VipsBlob *profile_load(const char *name, VOption *options = 0); + +-/** +- * Resample an image with a quadratic transform. +- * +- * **Optional parameters** +- * - **interpolate** -- Interpolate values with this, VInterpolate. +- * +- * @param coeff Coefficient matrix. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage quadratic( VImage coeff, VOption *options = 0 ) const; ++ /** ++ * Find image projections. ++ * @param rows Sums of rows. ++ * @param options Set of options. ++ * @return Sums of columns. ++ */ ++ VImage project(VImage *rows, VOption *options = 0) const; + +-/** +- * Unpack radiance coding to float rgb. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage rad2float( VOption *options = 0 ) const; ++ /** ++ * Resample an image with a quadratic transform. ++ * ++ * **Optional parameters** ++ * - **interpolate** -- Interpolate values with this, VInterpolate. ++ * ++ * @param coeff Coefficient matrix. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage quadratic(VImage coeff, VOption *options = 0) const; + +-/** +- * Load a radiance image from a file. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage radload( const char *filename, VOption *options = 0 ); ++ /** ++ * Unpack radiance coding to float rgb. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage rad2float(VOption *options = 0) const; + +-/** +- * Load rad from buffer. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param buffer Buffer to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage radload_buffer( VipsBlob *buffer, VOption *options = 0 ); ++ /** ++ * Load a radiance image from a file. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage radload(const char *filename, VOption *options = 0); + +-/** +- * Load rad from source. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage radload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Load rad from buffer. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param buffer Buffer to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage radload_buffer(VipsBlob *buffer, VOption *options = 0); + +-/** +- * Save image to radiance file. +- * +- * **Optional parameters** +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void radsave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load rad from source. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage radload_source(VSource source, VOption *options = 0); + +-/** +- * Save image to radiance buffer. +- * +- * **Optional parameters** +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param options Set of options. +- * @return Buffer to save to. +- */ +-VipsBlob *radsave_buffer( VOption *options = 0 ) const; ++ /** ++ * Save image to radiance file. ++ * ++ * **Optional parameters** ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void radsave(const char *filename, VOption *options = 0) const; + +-/** +- * Save image to radiance target. +- * +- * **Optional parameters** +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param target Target to save to. +- * @param options Set of options. +- */ +-void radsave_target( VTarget target, VOption *options = 0 ) const; ++ /** ++ * Save image to radiance buffer. ++ * ++ * **Optional parameters** ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param options Set of options. ++ * @return Buffer to save to. ++ */ ++ VipsBlob *radsave_buffer(VOption *options = 0) const; + +-/** +- * Rank filter. +- * @param width Window width in pixels. +- * @param height Window height in pixels. +- * @param index Select pixel at index. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage rank( int width, int height, int index, VOption *options = 0 ) const; ++ /** ++ * Save image to radiance target. ++ * ++ * **Optional parameters** ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param target Target to save to. ++ * @param options Set of options. ++ */ ++ void radsave_target(VTarget target, VOption *options = 0) const; + +-/** +- * Load raw data from a file. +- * +- * **Optional parameters** +- * - **offset** -- Offset in bytes from start of file, guint64. +- * - **format** -- Pixel format in image, VipsBandFormat. +- * - **interpretation** -- Pixel interpretation, VipsInterpretation. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param bands Number of bands in image. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage rawload( const char *filename, int width, int height, int bands, VOption *options = 0 ); ++ /** ++ * Rank filter. ++ * @param width Window width in pixels. ++ * @param height Window height in pixels. ++ * @param index Select pixel at index. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage rank(int width, int height, int index, VOption *options = 0) const; + +-/** +- * Save image to raw file. +- * +- * **Optional parameters** +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void rawsave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load raw data from a file. ++ * ++ * **Optional parameters** ++ * - **offset** -- Offset in bytes from start of file, guint64. ++ * - **format** -- Pixel format in image, VipsBandFormat. ++ * - **interpretation** -- Pixel interpretation, VipsInterpretation. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param bands Number of bands in image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage rawload(const char *filename, int width, int height, int bands, VOption *options = 0); + +-/** +- * Write raw image to file descriptor. +- * +- * **Optional parameters** +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param fd File descriptor to write to. +- * @param options Set of options. +- */ +-void rawsave_fd( int fd, VOption *options = 0 ) const; ++ /** ++ * Save image to raw file. ++ * ++ * **Optional parameters** ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void rawsave(const char *filename, VOption *options = 0) const; + +-/** +- * Linear recombination with matrix. +- * @param m Matrix of coefficients. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage recomb( VImage m, VOption *options = 0 ) const; ++ /** ++ * Write raw image to file descriptor. ++ * ++ * **Optional parameters** ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param fd File descriptor to write to. ++ * @param options Set of options. ++ */ ++ void rawsave_fd(int fd, VOption *options = 0) const; + +-/** +- * Reduce an image. +- * +- * **Optional parameters** +- * - **kernel** -- Resampling kernel, VipsKernel. +- * - **gap** -- Reducing gap, double. +- * +- * @param hshrink Horizontal shrink factor. +- * @param vshrink Vertical shrink factor. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage reduce( double hshrink, double vshrink, VOption *options = 0 ) const; ++ /** ++ * Linear recombination with matrix. ++ * @param m Matrix of coefficients. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage recomb(VImage m, VOption *options = 0) const; + +-/** +- * Shrink an image horizontally. +- * +- * **Optional parameters** +- * - **kernel** -- Resampling kernel, VipsKernel. +- * - **gap** -- Reducing gap, double. +- * +- * @param hshrink Horizontal shrink factor. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage reduceh( double hshrink, VOption *options = 0 ) const; ++ /** ++ * Reduce an image. ++ * ++ * **Optional parameters** ++ * - **kernel** -- Resampling kernel, VipsKernel. ++ * - **gap** -- Reducing gap, double. ++ * ++ * @param hshrink Horizontal shrink factor. ++ * @param vshrink Vertical shrink factor. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage reduce(double hshrink, double vshrink, VOption *options = 0) const; + +-/** +- * Shrink an image vertically. +- * +- * **Optional parameters** +- * - **kernel** -- Resampling kernel, VipsKernel. +- * - **gap** -- Reducing gap, double. +- * +- * @param vshrink Vertical shrink factor. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage reducev( double vshrink, VOption *options = 0 ) const; ++ /** ++ * Shrink an image horizontally. ++ * ++ * **Optional parameters** ++ * - **kernel** -- Resampling kernel, VipsKernel. ++ * - **gap** -- Reducing gap, double. ++ * ++ * @param hshrink Horizontal shrink factor. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage reduceh(double hshrink, VOption *options = 0) const; + +-/** +- * Relational operation on two images. +- * @param right Right-hand image argument. +- * @param relational Relational to perform. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage relational( VImage right, VipsOperationRelational relational, VOption *options = 0 ) const; ++ /** ++ * Shrink an image vertically. ++ * ++ * **Optional parameters** ++ * - **kernel** -- Resampling kernel, VipsKernel. ++ * - **gap** -- Reducing gap, double. ++ * ++ * @param vshrink Vertical shrink factor. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage reducev(double vshrink, VOption *options = 0) const; + +-/** +- * Relational operations against a constant. +- * @param relational Relational to perform. +- * @param c Array of constants. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage relational_const( VipsOperationRelational relational, std::vector c, VOption *options = 0 ) const; ++ /** ++ * Relational operation on two images. ++ * @param right Right-hand image argument. ++ * @param relational Relational to perform. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage relational(VImage right, VipsOperationRelational relational, VOption *options = 0) const; + +-/** +- * Remainder after integer division of two images. +- * @param right Right-hand image argument. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage remainder( VImage right, VOption *options = 0 ) const; ++ /** ++ * Relational operations against a constant. ++ * @param relational Relational to perform. ++ * @param c Array of constants. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage relational_const(VipsOperationRelational relational, std::vector c, VOption *options = 0) const; + +-/** +- * Remainder after integer division of an image and a constant. +- * @param c Array of constants. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage remainder_const( std::vector c, VOption *options = 0 ) const; ++ /** ++ * Remainder after integer division of two images. ++ * @param right Right-hand image argument. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage remainder(VImage right, VOption *options = 0) const; + +-/** +- * Replicate an image. +- * @param across Repeat this many times horizontally. +- * @param down Repeat this many times vertically. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage replicate( int across, int down, VOption *options = 0 ) const; ++ /** ++ * Remainder after integer division of an image and a constant. ++ * @param c Array of constants. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage remainder_const(std::vector c, VOption *options = 0) const; + +-/** +- * Resize an image. +- * +- * **Optional parameters** +- * - **kernel** -- Resampling kernel, VipsKernel. +- * - **gap** -- Reducing gap, double. +- * - **vscale** -- Vertical scale image by this factor, double. +- * +- * @param scale Scale image by this factor. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage resize( double scale, VOption *options = 0 ) const; ++ /** ++ * Replicate an image. ++ * @param across Repeat this many times horizontally. ++ * @param down Repeat this many times vertically. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage replicate(int across, int down, VOption *options = 0) const; + +-/** +- * Rotate an image. +- * @param angle Angle to rotate image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage rot( VipsAngle angle, VOption *options = 0 ) const; ++ /** ++ * Resize an image. ++ * ++ * **Optional parameters** ++ * - **kernel** -- Resampling kernel, VipsKernel. ++ * - **gap** -- Reducing gap, double. ++ * - **vscale** -- Vertical scale image by this factor, double. ++ * ++ * @param scale Scale image by this factor. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage resize(double scale, VOption *options = 0) const; + +-/** +- * Rotate an image. +- * +- * **Optional parameters** +- * - **angle** -- Angle to rotate image, VipsAngle45. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage rot45( VOption *options = 0 ) const; ++ /** ++ * Rotate an image. ++ * @param angle Angle to rotate image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage rot(VipsAngle angle, VOption *options = 0) const; + +-/** +- * Rotate an image by a number of degrees. +- * +- * **Optional parameters** +- * - **interpolate** -- Interpolate pixels with this, VInterpolate. +- * - **background** -- Background value, std::vector. +- * - **odx** -- Horizontal output displacement, double. +- * - **ody** -- Vertical output displacement, double. +- * - **idx** -- Horizontal input displacement, double. +- * - **idy** -- Vertical input displacement, double. +- * +- * @param angle Rotate anticlockwise by this many degrees. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage rotate( double angle, VOption *options = 0 ) const; ++ /** ++ * Rotate an image. ++ * ++ * **Optional parameters** ++ * - **angle** -- Angle to rotate image, VipsAngle45. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage rot45(VOption *options = 0) const; + +-/** +- * Perform a round function on an image. +- * @param round Rounding operation to perform. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage round( VipsOperationRound round, VOption *options = 0 ) const; ++ /** ++ * Rotate an image by a number of degrees. ++ * ++ * **Optional parameters** ++ * - **interpolate** -- Interpolate pixels with this, VInterpolate. ++ * - **background** -- Background value, std::vector. ++ * - **odx** -- Horizontal output displacement, double. ++ * - **ody** -- Vertical output displacement, double. ++ * - **idx** -- Horizontal input displacement, double. ++ * - **idy** -- Vertical input displacement, double. ++ * ++ * @param angle Rotate anticlockwise by this many degrees. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage rotate(double angle, VOption *options = 0) const; + +-/** +- * Transform srgb to hsv. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage sRGB2HSV( VOption *options = 0 ) const; ++ /** ++ * Perform a round function on an image. ++ * @param round Rounding operation to perform. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage round(VipsOperationRound round, VOption *options = 0) const; + +-/** +- * Convert an srgb image to scrgb. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage sRGB2scRGB( VOption *options = 0 ) const; ++ /** ++ * Transform srgb to hsv. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage sRGB2HSV(VOption *options = 0) const; + +-/** +- * Convert scrgb to bw. +- * +- * **Optional parameters** +- * - **depth** -- Output device space depth in bits, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage scRGB2BW( VOption *options = 0 ) const; ++ /** ++ * Convert an srgb image to scrgb. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage sRGB2scRGB(VOption *options = 0) const; + +-/** +- * Transform scrgb to xyz. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage scRGB2XYZ( VOption *options = 0 ) const; ++ /** ++ * Convert scrgb to bw. ++ * ++ * **Optional parameters** ++ * - **depth** -- Output device space depth in bits, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage scRGB2BW(VOption *options = 0) const; + +-/** +- * Convert an scrgb image to srgb. +- * +- * **Optional parameters** +- * - **depth** -- Output device space depth in bits, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage scRGB2sRGB( VOption *options = 0 ) const; ++ /** ++ * Transform scrgb to xyz. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage scRGB2XYZ(VOption *options = 0) const; + +-/** +- * Scale an image to uchar. +- * +- * **Optional parameters** +- * - **exp** -- Exponent for log scale, double. +- * - **log** -- Log scale, bool. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage scale( VOption *options = 0 ) const; ++ /** ++ * Convert an scrgb image to srgb. ++ * ++ * **Optional parameters** ++ * - **depth** -- Output device space depth in bits, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage scRGB2sRGB(VOption *options = 0) const; + +-/** +- * Check sequential access. +- * +- * **Optional parameters** +- * - **tile_height** -- Tile height in pixels, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage sequential( VOption *options = 0 ) const; ++ /** ++ * Scale an image to uchar. ++ * ++ * **Optional parameters** ++ * - **exp** -- Exponent for log scale, double. ++ * - **log** -- Log scale, bool. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage scale(VOption *options = 0) const; + +-/** +- * Unsharp masking for print. +- * +- * **Optional parameters** +- * - **sigma** -- Sigma of Gaussian, double. +- * - **x1** -- Flat/jaggy threshold, double. +- * - **y2** -- Maximum brightening, double. +- * - **y3** -- Maximum darkening, double. +- * - **m1** -- Slope for flat areas, double. +- * - **m2** -- Slope for jaggy areas, double. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage sharpen( VOption *options = 0 ) const; ++ /** ++ * Check sequential access. ++ * ++ * **Optional parameters** ++ * - **tile_height** -- Tile height in pixels, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage sequential(VOption *options = 0) const; + +-/** +- * Shrink an image. +- * +- * **Optional parameters** +- * - **ceil** -- Round-up output dimensions, bool. +- * +- * @param hshrink Horizontal shrink factor. +- * @param vshrink Vertical shrink factor. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage shrink( double hshrink, double vshrink, VOption *options = 0 ) const; ++ /** ++ * Unsharp masking for print. ++ * ++ * **Optional parameters** ++ * - **sigma** -- Sigma of Gaussian, double. ++ * - **x1** -- Flat/jaggy threshold, double. ++ * - **y2** -- Maximum brightening, double. ++ * - **y3** -- Maximum darkening, double. ++ * - **m1** -- Slope for flat areas, double. ++ * - **m2** -- Slope for jaggy areas, double. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage sharpen(VOption *options = 0) const; + +-/** +- * Shrink an image horizontally. +- * +- * **Optional parameters** +- * - **ceil** -- Round-up output dimensions, bool. +- * +- * @param hshrink Horizontal shrink factor. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage shrinkh( int hshrink, VOption *options = 0 ) const; ++ /** ++ * Shrink an image. ++ * ++ * **Optional parameters** ++ * - **ceil** -- Round-up output dimensions, bool. ++ * ++ * @param hshrink Horizontal shrink factor. ++ * @param vshrink Vertical shrink factor. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage shrink(double hshrink, double vshrink, VOption *options = 0) const; + +-/** +- * Shrink an image vertically. +- * +- * **Optional parameters** +- * - **ceil** -- Round-up output dimensions, bool. +- * +- * @param vshrink Vertical shrink factor. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage shrinkv( int vshrink, VOption *options = 0 ) const; ++ /** ++ * Shrink an image horizontally. ++ * ++ * **Optional parameters** ++ * - **ceil** -- Round-up output dimensions, bool. ++ * ++ * @param hshrink Horizontal shrink factor. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage shrinkh(int hshrink, VOption *options = 0) const; + +-/** +- * Unit vector of pixel. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage sign( VOption *options = 0 ) const; ++ /** ++ * Shrink an image vertically. ++ * ++ * **Optional parameters** ++ * - **ceil** -- Round-up output dimensions, bool. ++ * ++ * @param vshrink Vertical shrink factor. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage shrinkv(int vshrink, VOption *options = 0) const; + +-/** +- * Similarity transform of an image. +- * +- * **Optional parameters** +- * - **scale** -- Scale by this factor, double. +- * - **angle** -- Rotate anticlockwise by this many degrees, double. +- * - **interpolate** -- Interpolate pixels with this, VInterpolate. +- * - **background** -- Background value, std::vector. +- * - **odx** -- Horizontal output displacement, double. +- * - **ody** -- Vertical output displacement, double. +- * - **idx** -- Horizontal input displacement, double. +- * - **idy** -- Vertical input displacement, double. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage similarity( VOption *options = 0 ) const; ++ /** ++ * Unit vector of pixel. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage sign(VOption *options = 0) const; + +-/** +- * Make a 2d sine wave. +- * +- * **Optional parameters** +- * - **uchar** -- Output an unsigned char image, bool. +- * - **hfreq** -- Horizontal spatial frequency, double. +- * - **vfreq** -- Vertical spatial frequency, double. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage sines( int width, int height, VOption *options = 0 ); ++ /** ++ * Similarity transform of an image. ++ * ++ * **Optional parameters** ++ * - **scale** -- Scale by this factor, double. ++ * - **angle** -- Rotate anticlockwise by this many degrees, double. ++ * - **interpolate** -- Interpolate pixels with this, VInterpolate. ++ * - **background** -- Background value, std::vector. ++ * - **odx** -- Horizontal output displacement, double. ++ * - **ody** -- Vertical output displacement, double. ++ * - **idx** -- Horizontal input displacement, double. ++ * - **idy** -- Vertical input displacement, double. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage similarity(VOption *options = 0) const; + +-/** +- * Extract an area from an image. +- * +- * **Optional parameters** +- * - **interesting** -- How to measure interestingness, VipsInteresting. +- * +- * @param width Width of extract area. +- * @param height Height of extract area. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage smartcrop( int width, int height, VOption *options = 0 ) const; ++ /** ++ * Make a 2d sine wave. ++ * ++ * **Optional parameters** ++ * - **uchar** -- Output an unsigned char image, bool. ++ * - **hfreq** -- Horizontal spatial frequency, double. ++ * - **vfreq** -- Vertical spatial frequency, double. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage sines(int width, int height, VOption *options = 0); + +-/** +- * Sobel edge detector. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage sobel( VOption *options = 0 ) const; ++ /** ++ * Extract an area from an image. ++ * ++ * **Optional parameters** ++ * - **interesting** -- How to measure interestingness, VipsInteresting. ++ * ++ * @param width Width of extract area. ++ * @param height Height of extract area. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage smartcrop(int width, int height, VOption *options = 0) const; + +-/** +- * Spatial correlation. +- * @param ref Input reference image. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage spcor( VImage ref, VOption *options = 0 ) const; ++ /** ++ * Sobel edge detector. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage sobel(VOption *options = 0) const; + +-/** +- * Make displayable power spectrum. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage spectrum( VOption *options = 0 ) const; ++ /** ++ * Spatial correlation. ++ * @param ref Input reference image. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage spcor(VImage ref, VOption *options = 0) const; + +-/** +- * Find many image stats. +- * @param options Set of options. +- * @return Output array of statistics. +- */ +-VImage stats( VOption *options = 0 ) const; ++ /** ++ * Make displayable power spectrum. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage spectrum(VOption *options = 0) const; + +-/** +- * Statistical difference. +- * +- * **Optional parameters** +- * - **s0** -- New deviation, double. +- * - **b** -- Weight of new deviation, double. +- * - **m0** -- New mean, double. +- * - **a** -- Weight of new mean, double. +- * +- * @param width Window width in pixels. +- * @param height Window height in pixels. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage stdif( int width, int height, VOption *options = 0 ) const; ++ /** ++ * Find many image stats. ++ * @param options Set of options. ++ * @return Output array of statistics. ++ */ ++ VImage stats(VOption *options = 0) const; + +-/** +- * Subsample an image. +- * +- * **Optional parameters** +- * - **point** -- Point sample, bool. +- * +- * @param xfac Horizontal subsample factor. +- * @param yfac Vertical subsample factor. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage subsample( int xfac, int yfac, VOption *options = 0 ) const; ++ /** ++ * Statistical difference. ++ * ++ * **Optional parameters** ++ * - **s0** -- New deviation, double. ++ * - **b** -- Weight of new deviation, double. ++ * - **m0** -- New mean, double. ++ * - **a** -- Weight of new mean, double. ++ * ++ * @param width Window width in pixels. ++ * @param height Window height in pixels. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage stdif(int width, int height, VOption *options = 0) const; + +-/** +- * Subtract two images. +- * @param right Right-hand image argument. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage subtract( VImage right, VOption *options = 0 ) const; ++ /** ++ * Subsample an image. ++ * ++ * **Optional parameters** ++ * - **point** -- Point sample, bool. ++ * ++ * @param xfac Horizontal subsample factor. ++ * @param yfac Vertical subsample factor. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage subsample(int xfac, int yfac, VOption *options = 0) const; + +-/** +- * Sum an array of images. +- * @param in Array of input images. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage sum( std::vector in, VOption *options = 0 ); ++ /** ++ * Subtract two images. ++ * @param right Right-hand image argument. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage subtract(VImage right, VOption *options = 0) const; + +-/** +- * Load svg with rsvg. +- * +- * **Optional parameters** +- * - **dpi** -- Render at this DPI, double. +- * - **scale** -- Scale output by this factor, double. +- * - **unlimited** -- Allow SVG of any size, bool. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage svgload( const char *filename, VOption *options = 0 ); ++ /** ++ * Sum an array of images. ++ * @param in Array of input images. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage sum(std::vector in, VOption *options = 0); + +-/** +- * Load svg with rsvg. +- * +- * **Optional parameters** +- * - **dpi** -- Render at this DPI, double. +- * - **scale** -- Scale output by this factor, double. +- * - **unlimited** -- Allow SVG of any size, bool. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param buffer Buffer to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage svgload_buffer( VipsBlob *buffer, VOption *options = 0 ); ++ /** ++ * Load svg with rsvg. ++ * ++ * **Optional parameters** ++ * - **dpi** -- Render at this DPI, double. ++ * - **scale** -- Scale output by this factor, double. ++ * - **unlimited** -- Allow SVG of any size, bool. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage svgload(const char *filename, VOption *options = 0); + +-/** +- * Load svg from source. +- * +- * **Optional parameters** +- * - **dpi** -- Render at this DPI, double. +- * - **scale** -- Scale output by this factor, double. +- * - **unlimited** -- Allow SVG of any size, bool. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage svgload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Load svg with rsvg. ++ * ++ * **Optional parameters** ++ * - **dpi** -- Render at this DPI, double. ++ * - **scale** -- Scale output by this factor, double. ++ * - **unlimited** -- Allow SVG of any size, bool. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param buffer Buffer to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage svgload_buffer(VipsBlob *buffer, VOption *options = 0); + +-/** +- * Find the index of the first non-zero pixel in tests. +- * @param tests Table of images to test. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage switch_image( std::vector tests, VOption *options = 0 ); ++ /** ++ * Load svg from source. ++ * ++ * **Optional parameters** ++ * - **dpi** -- Render at this DPI, double. ++ * - **scale** -- Scale output by this factor, double. ++ * - **unlimited** -- Allow SVG of any size, bool. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage svgload_source(VSource source, VOption *options = 0); + +-/** +- * Run an external command. +- * +- * **Optional parameters** +- * - **in** -- Array of input images, std::vector. +- * - **out_format** -- Format for output filename, const char *. +- * - **in_format** -- Format for input filename, const char *. +- * +- * @param cmd_format Command to run. +- * @param options Set of options. +- */ +-static void system( const char *cmd_format, VOption *options = 0 ); ++ /** ++ * Find the index of the first non-zero pixel in tests. ++ * @param tests Table of images to test. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage switch_image(std::vector tests, VOption *options = 0); + +-/** +- * Make a text image. +- * +- * **Optional parameters** +- * - **font** -- Font to render with, const char *. +- * - **width** -- Maximum image width in pixels, int. +- * - **height** -- Maximum image height in pixels, int. +- * - **align** -- Align on the low, centre or high edge, VipsAlign. +- * - **rgba** -- Enable RGBA output, bool. +- * - **dpi** -- DPI to render at, int. +- * - **justify** -- Justify lines, bool. +- * - **spacing** -- Line spacing, int. +- * - **fontfile** -- Load this font file, const char *. +- * +- * @param text Text to render. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage text( const char *text, VOption *options = 0 ); ++ /** ++ * Run an external command. ++ * ++ * **Optional parameters** ++ * - **in** -- Array of input images, std::vector. ++ * - **out_format** -- Format for output filename, const char *. ++ * - **in_format** -- Format for input filename, const char *. ++ * ++ * @param cmd_format Command to run. ++ * @param options Set of options. ++ */ ++ static void system(const char *cmd_format, VOption *options = 0); + +-/** +- * Generate thumbnail from file. +- * +- * **Optional parameters** +- * - **height** -- Size to this height, int. +- * - **size** -- Only upsize, only downsize, or both, VipsSize. +- * - **no_rotate** -- Don't use orientation tags to rotate image upright, bool. +- * - **crop** -- Reduce to fill target rectangle, then crop, VipsInteresting. +- * - **linear** -- Reduce in linear light, bool. +- * - **import_profile** -- Fallback import profile, const char *. +- * - **export_profile** -- Fallback export profile, const char *. +- * - **intent** -- Rendering intent, VipsIntent. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to read from. +- * @param width Size to this width. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage thumbnail( const char *filename, int width, VOption *options = 0 ); ++ /** ++ * Make a text image. ++ * ++ * **Optional parameters** ++ * - **font** -- Font to render with, const char *. ++ * - **width** -- Maximum image width in pixels, int. ++ * - **height** -- Maximum image height in pixels, int. ++ * - **align** -- Align on the low, centre or high edge, VipsAlign. ++ * - **rgba** -- Enable RGBA output, bool. ++ * - **dpi** -- DPI to render at, int. ++ * - **justify** -- Justify lines, bool. ++ * - **spacing** -- Line spacing, int. ++ * - **fontfile** -- Load this font file, const char *. ++ * ++ * @param text Text to render. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage text(const char *text, VOption *options = 0); + +-/** +- * Generate thumbnail from buffer. +- * +- * **Optional parameters** +- * - **option_string** -- Options that are passed on to the underlying loader, const char *. +- * - **height** -- Size to this height, int. +- * - **size** -- Only upsize, only downsize, or both, VipsSize. +- * - **no_rotate** -- Don't use orientation tags to rotate image upright, bool. +- * - **crop** -- Reduce to fill target rectangle, then crop, VipsInteresting. +- * - **linear** -- Reduce in linear light, bool. +- * - **import_profile** -- Fallback import profile, const char *. +- * - **export_profile** -- Fallback export profile, const char *. +- * - **intent** -- Rendering intent, VipsIntent. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param buffer Buffer to load from. +- * @param width Size to this width. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage thumbnail_buffer( VipsBlob *buffer, int width, VOption *options = 0 ); ++ /** ++ * Generate thumbnail from file. ++ * ++ * **Optional parameters** ++ * - **height** -- Size to this height, int. ++ * - **size** -- Only upsize, only downsize, or both, VipsSize. ++ * - **no_rotate** -- Don't use orientation tags to rotate image upright, bool. ++ * - **crop** -- Reduce to fill target rectangle, then crop, VipsInteresting. ++ * - **linear** -- Reduce in linear light, bool. ++ * - **import_profile** -- Fallback import profile, const char *. ++ * - **export_profile** -- Fallback export profile, const char *. ++ * - **intent** -- Rendering intent, VipsIntent. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to read from. ++ * @param width Size to this width. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage thumbnail(const char *filename, int width, VOption *options = 0); + +-/** +- * Generate thumbnail from image. +- * +- * **Optional parameters** +- * - **height** -- Size to this height, int. +- * - **size** -- Only upsize, only downsize, or both, VipsSize. +- * - **no_rotate** -- Don't use orientation tags to rotate image upright, bool. +- * - **crop** -- Reduce to fill target rectangle, then crop, VipsInteresting. +- * - **linear** -- Reduce in linear light, bool. +- * - **import_profile** -- Fallback import profile, const char *. +- * - **export_profile** -- Fallback export profile, const char *. +- * - **intent** -- Rendering intent, VipsIntent. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param width Size to this width. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage thumbnail_image( int width, VOption *options = 0 ) const; ++ /** ++ * Generate thumbnail from buffer. ++ * ++ * **Optional parameters** ++ * - **option_string** -- Options that are passed on to the underlying loader, const char *. ++ * - **height** -- Size to this height, int. ++ * - **size** -- Only upsize, only downsize, or both, VipsSize. ++ * - **no_rotate** -- Don't use orientation tags to rotate image upright, bool. ++ * - **crop** -- Reduce to fill target rectangle, then crop, VipsInteresting. ++ * - **linear** -- Reduce in linear light, bool. ++ * - **import_profile** -- Fallback import profile, const char *. ++ * - **export_profile** -- Fallback export profile, const char *. ++ * - **intent** -- Rendering intent, VipsIntent. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param buffer Buffer to load from. ++ * @param width Size to this width. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage thumbnail_buffer(VipsBlob *buffer, int width, VOption *options = 0); + +-/** +- * Generate thumbnail from source. +- * +- * **Optional parameters** +- * - **option_string** -- Options that are passed on to the underlying loader, const char *. +- * - **height** -- Size to this height, int. +- * - **size** -- Only upsize, only downsize, or both, VipsSize. +- * - **no_rotate** -- Don't use orientation tags to rotate image upright, bool. +- * - **crop** -- Reduce to fill target rectangle, then crop, VipsInteresting. +- * - **linear** -- Reduce in linear light, bool. +- * - **import_profile** -- Fallback import profile, const char *. +- * - **export_profile** -- Fallback export profile, const char *. +- * - **intent** -- Rendering intent, VipsIntent. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param width Size to this width. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage thumbnail_source( VSource source, int width, VOption *options = 0 ); ++ /** ++ * Generate thumbnail from image. ++ * ++ * **Optional parameters** ++ * - **height** -- Size to this height, int. ++ * - **size** -- Only upsize, only downsize, or both, VipsSize. ++ * - **no_rotate** -- Don't use orientation tags to rotate image upright, bool. ++ * - **crop** -- Reduce to fill target rectangle, then crop, VipsInteresting. ++ * - **linear** -- Reduce in linear light, bool. ++ * - **import_profile** -- Fallback import profile, const char *. ++ * - **export_profile** -- Fallback export profile, const char *. ++ * - **intent** -- Rendering intent, VipsIntent. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param width Size to this width. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage thumbnail_image(int width, VOption *options = 0) const; + +-/** +- * Load tiff from file. +- * +- * **Optional parameters** +- * - **page** -- Load this page from the image, int. +- * - **subifd** -- Select subifd index, int. +- * - **n** -- Load this many pages, int. +- * - **autorotate** -- Rotate image using orientation tag, bool. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage tiffload( const char *filename, VOption *options = 0 ); ++ /** ++ * Generate thumbnail from source. ++ * ++ * **Optional parameters** ++ * - **option_string** -- Options that are passed on to the underlying loader, const char *. ++ * - **height** -- Size to this height, int. ++ * - **size** -- Only upsize, only downsize, or both, VipsSize. ++ * - **no_rotate** -- Don't use orientation tags to rotate image upright, bool. ++ * - **crop** -- Reduce to fill target rectangle, then crop, VipsInteresting. ++ * - **linear** -- Reduce in linear light, bool. ++ * - **import_profile** -- Fallback import profile, const char *. ++ * - **export_profile** -- Fallback export profile, const char *. ++ * - **intent** -- Rendering intent, VipsIntent. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param width Size to this width. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage thumbnail_source(VSource source, int width, VOption *options = 0); + +-/** +- * Load tiff from buffer. +- * +- * **Optional parameters** +- * - **page** -- Load this page from the image, int. +- * - **subifd** -- Select subifd index, int. +- * - **n** -- Load this many pages, int. +- * - **autorotate** -- Rotate image using orientation tag, bool. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param buffer Buffer to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage tiffload_buffer( VipsBlob *buffer, VOption *options = 0 ); ++ /** ++ * Load tiff from file. ++ * ++ * **Optional parameters** ++ * - **page** -- Load this page from the image, int. ++ * - **subifd** -- Select subifd index, int. ++ * - **n** -- Load this many pages, int. ++ * - **autorotate** -- Rotate image using orientation tag, bool. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage tiffload(const char *filename, VOption *options = 0); + +-/** +- * Load tiff from source. +- * +- * **Optional parameters** +- * - **page** -- Load this page from the image, int. +- * - **subifd** -- Select subifd index, int. +- * - **n** -- Load this many pages, int. +- * - **autorotate** -- Rotate image using orientation tag, bool. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage tiffload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Load tiff from buffer. ++ * ++ * **Optional parameters** ++ * - **page** -- Load this page from the image, int. ++ * - **subifd** -- Select subifd index, int. ++ * - **n** -- Load this many pages, int. ++ * - **autorotate** -- Rotate image using orientation tag, bool. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param buffer Buffer to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage tiffload_buffer(VipsBlob *buffer, VOption *options = 0); + +-/** +- * Save image to tiff file. +- * +- * **Optional parameters** +- * - **compression** -- Compression for this file, VipsForeignTiffCompression. +- * - **Q** -- Q factor, int. +- * - **predictor** -- Compression prediction, VipsForeignTiffPredictor. +- * - **profile** -- ICC profile to embed, const char *. +- * - **tile** -- Write a tiled tiff, bool. +- * - **tile_width** -- Tile width in pixels, int. +- * - **tile_height** -- Tile height in pixels, int. +- * - **pyramid** -- Write a pyramidal tiff, bool. +- * - **miniswhite** -- Use 0 for white in 1-bit images, bool. +- * - **bitdepth** -- Write as a 1, 2, 4 or 8 bit image, int. +- * - **resunit** -- Resolution unit, VipsForeignTiffResunit. +- * - **xres** -- Horizontal resolution in pixels/mm, double. +- * - **yres** -- Vertical resolution in pixels/mm, double. +- * - **bigtiff** -- Write a bigtiff image, bool. +- * - **properties** -- Write a properties document to IMAGEDESCRIPTION, bool. +- * - **region_shrink** -- Method to shrink regions, VipsRegionShrink. +- * - **level** -- ZSTD compression level, int. +- * - **lossless** -- Enable WEBP lossless mode, bool. +- * - **depth** -- Pyramid depth, VipsForeignDzDepth. +- * - **subifd** -- Save pyr layers as sub-IFDs, bool. +- * - **premultiply** -- Save with premultiplied alpha, bool. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void tiffsave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load tiff from source. ++ * ++ * **Optional parameters** ++ * - **page** -- Load this page from the image, int. ++ * - **subifd** -- Select subifd index, int. ++ * - **n** -- Load this many pages, int. ++ * - **autorotate** -- Rotate image using orientation tag, bool. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage tiffload_source(VSource source, VOption *options = 0); + +-/** +- * Save image to tiff buffer. +- * +- * **Optional parameters** +- * - **compression** -- Compression for this file, VipsForeignTiffCompression. +- * - **Q** -- Q factor, int. +- * - **predictor** -- Compression prediction, VipsForeignTiffPredictor. +- * - **profile** -- ICC profile to embed, const char *. +- * - **tile** -- Write a tiled tiff, bool. +- * - **tile_width** -- Tile width in pixels, int. +- * - **tile_height** -- Tile height in pixels, int. +- * - **pyramid** -- Write a pyramidal tiff, bool. +- * - **miniswhite** -- Use 0 for white in 1-bit images, bool. +- * - **bitdepth** -- Write as a 1, 2, 4 or 8 bit image, int. +- * - **resunit** -- Resolution unit, VipsForeignTiffResunit. +- * - **xres** -- Horizontal resolution in pixels/mm, double. +- * - **yres** -- Vertical resolution in pixels/mm, double. +- * - **bigtiff** -- Write a bigtiff image, bool. +- * - **properties** -- Write a properties document to IMAGEDESCRIPTION, bool. +- * - **region_shrink** -- Method to shrink regions, VipsRegionShrink. +- * - **level** -- ZSTD compression level, int. +- * - **lossless** -- Enable WEBP lossless mode, bool. +- * - **depth** -- Pyramid depth, VipsForeignDzDepth. +- * - **subifd** -- Save pyr layers as sub-IFDs, bool. +- * - **premultiply** -- Save with premultiplied alpha, bool. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param options Set of options. +- * @return Buffer to save to. +- */ +-VipsBlob *tiffsave_buffer( VOption *options = 0 ) const; ++ /** ++ * Save image to tiff file. ++ * ++ * **Optional parameters** ++ * - **compression** -- Compression for this file, VipsForeignTiffCompression. ++ * - **Q** -- Q factor, int. ++ * - **predictor** -- Compression prediction, VipsForeignTiffPredictor. ++ * - **profile** -- ICC profile to embed, const char *. ++ * - **tile** -- Write a tiled tiff, bool. ++ * - **tile_width** -- Tile width in pixels, int. ++ * - **tile_height** -- Tile height in pixels, int. ++ * - **pyramid** -- Write a pyramidal tiff, bool. ++ * - **miniswhite** -- Use 0 for white in 1-bit images, bool. ++ * - **bitdepth** -- Write as a 1, 2, 4 or 8 bit image, int. ++ * - **resunit** -- Resolution unit, VipsForeignTiffResunit. ++ * - **xres** -- Horizontal resolution in pixels/mm, double. ++ * - **yres** -- Vertical resolution in pixels/mm, double. ++ * - **bigtiff** -- Write a bigtiff image, bool. ++ * - **properties** -- Write a properties document to IMAGEDESCRIPTION, bool. ++ * - **region_shrink** -- Method to shrink regions, VipsRegionShrink. ++ * - **level** -- ZSTD compression level, int. ++ * - **lossless** -- Enable WEBP lossless mode, bool. ++ * - **depth** -- Pyramid depth, VipsForeignDzDepth. ++ * - **subifd** -- Save pyr layers as sub-IFDs, bool. ++ * - **premultiply** -- Save with premultiplied alpha, bool. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void tiffsave(const char *filename, VOption *options = 0) const; + +-/** +- * Save image to tiff target. +- * +- * **Optional parameters** +- * - **compression** -- Compression for this file, VipsForeignTiffCompression. +- * - **Q** -- Q factor, int. +- * - **predictor** -- Compression prediction, VipsForeignTiffPredictor. +- * - **profile** -- ICC profile to embed, const char *. +- * - **tile** -- Write a tiled tiff, bool. +- * - **tile_width** -- Tile width in pixels, int. +- * - **tile_height** -- Tile height in pixels, int. +- * - **pyramid** -- Write a pyramidal tiff, bool. +- * - **miniswhite** -- Use 0 for white in 1-bit images, bool. +- * - **bitdepth** -- Write as a 1, 2, 4 or 8 bit image, int. +- * - **resunit** -- Resolution unit, VipsForeignTiffResunit. +- * - **xres** -- Horizontal resolution in pixels/mm, double. +- * - **yres** -- Vertical resolution in pixels/mm, double. +- * - **bigtiff** -- Write a bigtiff image, bool. +- * - **properties** -- Write a properties document to IMAGEDESCRIPTION, bool. +- * - **region_shrink** -- Method to shrink regions, VipsRegionShrink. +- * - **level** -- ZSTD compression level, int. +- * - **lossless** -- Enable WEBP lossless mode, bool. +- * - **depth** -- Pyramid depth, VipsForeignDzDepth. +- * - **subifd** -- Save pyr layers as sub-IFDs, bool. +- * - **premultiply** -- Save with premultiplied alpha, bool. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param target Target to save to. +- * @param options Set of options. +- */ +-void tiffsave_target( VTarget target, VOption *options = 0 ) const; ++ /** ++ * Save image to tiff buffer. ++ * ++ * **Optional parameters** ++ * - **compression** -- Compression for this file, VipsForeignTiffCompression. ++ * - **Q** -- Q factor, int. ++ * - **predictor** -- Compression prediction, VipsForeignTiffPredictor. ++ * - **profile** -- ICC profile to embed, const char *. ++ * - **tile** -- Write a tiled tiff, bool. ++ * - **tile_width** -- Tile width in pixels, int. ++ * - **tile_height** -- Tile height in pixels, int. ++ * - **pyramid** -- Write a pyramidal tiff, bool. ++ * - **miniswhite** -- Use 0 for white in 1-bit images, bool. ++ * - **bitdepth** -- Write as a 1, 2, 4 or 8 bit image, int. ++ * - **resunit** -- Resolution unit, VipsForeignTiffResunit. ++ * - **xres** -- Horizontal resolution in pixels/mm, double. ++ * - **yres** -- Vertical resolution in pixels/mm, double. ++ * - **bigtiff** -- Write a bigtiff image, bool. ++ * - **properties** -- Write a properties document to IMAGEDESCRIPTION, bool. ++ * - **region_shrink** -- Method to shrink regions, VipsRegionShrink. ++ * - **level** -- ZSTD compression level, int. ++ * - **lossless** -- Enable WEBP lossless mode, bool. ++ * - **depth** -- Pyramid depth, VipsForeignDzDepth. ++ * - **subifd** -- Save pyr layers as sub-IFDs, bool. ++ * - **premultiply** -- Save with premultiplied alpha, bool. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param options Set of options. ++ * @return Buffer to save to. ++ */ ++ VipsBlob *tiffsave_buffer(VOption *options = 0) const; + +-/** +- * Cache an image as a set of tiles. +- * +- * **Optional parameters** +- * - **tile_width** -- Tile width in pixels, int. +- * - **tile_height** -- Tile height in pixels, int. +- * - **max_tiles** -- Maximum number of tiles to cache, int. +- * - **access** -- Expected access pattern, VipsAccess. +- * - **threaded** -- Allow threaded access, bool. +- * - **persistent** -- Keep cache between evaluations, bool. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage tilecache( VOption *options = 0 ) const; ++ /** ++ * Save image to tiff target. ++ * ++ * **Optional parameters** ++ * - **compression** -- Compression for this file, VipsForeignTiffCompression. ++ * - **Q** -- Q factor, int. ++ * - **predictor** -- Compression prediction, VipsForeignTiffPredictor. ++ * - **profile** -- ICC profile to embed, const char *. ++ * - **tile** -- Write a tiled tiff, bool. ++ * - **tile_width** -- Tile width in pixels, int. ++ * - **tile_height** -- Tile height in pixels, int. ++ * - **pyramid** -- Write a pyramidal tiff, bool. ++ * - **miniswhite** -- Use 0 for white in 1-bit images, bool. ++ * - **bitdepth** -- Write as a 1, 2, 4 or 8 bit image, int. ++ * - **resunit** -- Resolution unit, VipsForeignTiffResunit. ++ * - **xres** -- Horizontal resolution in pixels/mm, double. ++ * - **yres** -- Vertical resolution in pixels/mm, double. ++ * - **bigtiff** -- Write a bigtiff image, bool. ++ * - **properties** -- Write a properties document to IMAGEDESCRIPTION, bool. ++ * - **region_shrink** -- Method to shrink regions, VipsRegionShrink. ++ * - **level** -- ZSTD compression level, int. ++ * - **lossless** -- Enable WEBP lossless mode, bool. ++ * - **depth** -- Pyramid depth, VipsForeignDzDepth. ++ * - **subifd** -- Save pyr layers as sub-IFDs, bool. ++ * - **premultiply** -- Save with premultiplied alpha, bool. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param target Target to save to. ++ * @param options Set of options. ++ */ ++ void tiffsave_target(VTarget target, VOption *options = 0) const; + +-/** +- * Build a look-up table. +- * +- * **Optional parameters** +- * - **in_max** -- Size of LUT to build, int. +- * - **out_max** -- Maximum value in output LUT, int. +- * - **Lb** -- Lowest value in output, double. +- * - **Lw** -- Highest value in output, double. +- * - **Ps** -- Position of shadow, double. +- * - **Pm** -- Position of mid-tones, double. +- * - **Ph** -- Position of highlights, double. +- * - **S** -- Adjust shadows by this much, double. +- * - **M** -- Adjust mid-tones by this much, double. +- * - **H** -- Adjust highlights by this much, double. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage tonelut( VOption *options = 0 ); ++ /** ++ * Cache an image as a set of tiles. ++ * ++ * **Optional parameters** ++ * - **tile_width** -- Tile width in pixels, int. ++ * - **tile_height** -- Tile height in pixels, int. ++ * - **max_tiles** -- Maximum number of tiles to cache, int. ++ * - **access** -- Expected access pattern, VipsAccess. ++ * - **threaded** -- Allow threaded access, bool. ++ * - **persistent** -- Keep cache between evaluations, bool. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage tilecache(VOption *options = 0) const; + +-/** +- * Transpose3d an image. +- * +- * **Optional parameters** +- * - **page_height** -- Height of each input page, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage transpose3d( VOption *options = 0 ) const; ++ /** ++ * Build a look-up table. ++ * ++ * **Optional parameters** ++ * - **in_max** -- Size of LUT to build, int. ++ * - **out_max** -- Maximum value in output LUT, int. ++ * - **Lb** -- Lowest value in output, double. ++ * - **Lw** -- Highest value in output, double. ++ * - **Ps** -- Position of shadow, double. ++ * - **Pm** -- Position of mid-tones, double. ++ * - **Ph** -- Position of highlights, double. ++ * - **S** -- Adjust shadows by this much, double. ++ * - **M** -- Adjust mid-tones by this much, double. ++ * - **H** -- Adjust highlights by this much, double. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage tonelut(VOption *options = 0); + +-/** +- * Unpremultiply image alpha. +- * +- * **Optional parameters** +- * - **max_alpha** -- Maximum value of alpha channel, double. +- * - **alpha_band** -- Unpremultiply with this alpha, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage unpremultiply( VOption *options = 0 ) const; ++ /** ++ * Transpose3d an image. ++ * ++ * **Optional parameters** ++ * - **page_height** -- Height of each input page, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage transpose3d(VOption *options = 0) const; + +-/** +- * Load vips from file. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage vipsload( const char *filename, VOption *options = 0 ); ++ /** ++ * Unpremultiply image alpha. ++ * ++ * **Optional parameters** ++ * - **max_alpha** -- Maximum value of alpha channel, double. ++ * - **alpha_band** -- Unpremultiply with this alpha, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage unpremultiply(VOption *options = 0) const; + +-/** +- * Load vips from source. +- * +- * **Optional parameters** +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage vipsload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Load vips from file. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage vipsload(const char *filename, VOption *options = 0); + +-/** +- * Save image to file in vips format. +- * +- * **Optional parameters** +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void vipssave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load vips from source. ++ * ++ * **Optional parameters** ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage vipsload_source(VSource source, VOption *options = 0); + +-/** +- * Save image to target in vips format. +- * +- * **Optional parameters** +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param target Target to save to. +- * @param options Set of options. +- */ +-void vipssave_target( VTarget target, VOption *options = 0 ) const; ++ /** ++ * Save image to file in vips format. ++ * ++ * **Optional parameters** ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void vipssave(const char *filename, VOption *options = 0) const; + +-/** +- * Load webp from file. +- * +- * **Optional parameters** +- * - **page** -- Load this page from the file, int. +- * - **n** -- Load this many pages, int. +- * - **scale** -- Scale factor on load, double. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param filename Filename to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage webpload( const char *filename, VOption *options = 0 ); ++ /** ++ * Save image to target in vips format. ++ * ++ * **Optional parameters** ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param target Target to save to. ++ * @param options Set of options. ++ */ ++ void vipssave_target(VTarget target, VOption *options = 0) const; + +-/** +- * Load webp from buffer. +- * +- * **Optional parameters** +- * - **page** -- Load this page from the file, int. +- * - **n** -- Load this many pages, int. +- * - **scale** -- Scale factor on load, double. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param buffer Buffer to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage webpload_buffer( VipsBlob *buffer, VOption *options = 0 ); ++ /** ++ * Load webp from file. ++ * ++ * **Optional parameters** ++ * - **page** -- Load this page from the file, int. ++ * - **n** -- Load this many pages, int. ++ * - **scale** -- Scale factor on load, double. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param filename Filename to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage webpload(const char *filename, VOption *options = 0); + +-/** +- * Load webp from source. +- * +- * **Optional parameters** +- * - **page** -- Load this page from the file, int. +- * - **n** -- Load this many pages, int. +- * - **scale** -- Scale factor on load, double. +- * - **memory** -- Force open via memory, bool. +- * - **access** -- Required access pattern for this file, VipsAccess. +- * - **fail_on** -- Error level to fail on, VipsFailOn. +- * +- * @param source Source to load from. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage webpload_source( VSource source, VOption *options = 0 ); ++ /** ++ * Load webp from buffer. ++ * ++ * **Optional parameters** ++ * - **page** -- Load this page from the file, int. ++ * - **n** -- Load this many pages, int. ++ * - **scale** -- Scale factor on load, double. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param buffer Buffer to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage webpload_buffer(VipsBlob *buffer, VOption *options = 0); + +-/** +- * Save image to webp file. +- * +- * **Optional parameters** +- * - **Q** -- Q factor, int. +- * - **lossless** -- Enable lossless compression, bool. +- * - **preset** -- Preset for lossy compression, VipsForeignWebpPreset. +- * - **smart_subsample** -- Enable high quality chroma subsampling, bool. +- * - **near_lossless** -- Enable preprocessing in lossless mode (uses Q), bool. +- * - **alpha_q** -- Change alpha plane fidelity for lossy compression, int. +- * - **min_size** -- Optimise for minimum size, bool. +- * - **kmin** -- Minimum number of frames between key frames, int. +- * - **kmax** -- Maximum number of frames between key frames, int. +- * - **effort** -- Level of CPU effort to reduce file size, int. +- * - **profile** -- ICC profile to embed, const char *. +- * - **mixed** -- Allow mixed encoding (might reduce file size), bool. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param filename Filename to save to. +- * @param options Set of options. +- */ +-void webpsave( const char *filename, VOption *options = 0 ) const; ++ /** ++ * Load webp from source. ++ * ++ * **Optional parameters** ++ * - **page** -- Load this page from the file, int. ++ * - **n** -- Load this many pages, int. ++ * - **scale** -- Scale factor on load, double. ++ * - **memory** -- Force open via memory, bool. ++ * - **access** -- Required access pattern for this file, VipsAccess. ++ * - **fail_on** -- Error level to fail on, VipsFailOn. ++ * ++ * @param source Source to load from. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage webpload_source(VSource source, VOption *options = 0); + +-/** +- * Save image to webp buffer. +- * +- * **Optional parameters** +- * - **Q** -- Q factor, int. +- * - **lossless** -- Enable lossless compression, bool. +- * - **preset** -- Preset for lossy compression, VipsForeignWebpPreset. +- * - **smart_subsample** -- Enable high quality chroma subsampling, bool. +- * - **near_lossless** -- Enable preprocessing in lossless mode (uses Q), bool. +- * - **alpha_q** -- Change alpha plane fidelity for lossy compression, int. +- * - **min_size** -- Optimise for minimum size, bool. +- * - **kmin** -- Minimum number of frames between key frames, int. +- * - **kmax** -- Maximum number of frames between key frames, int. +- * - **effort** -- Level of CPU effort to reduce file size, int. +- * - **profile** -- ICC profile to embed, const char *. +- * - **mixed** -- Allow mixed encoding (might reduce file size), bool. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param options Set of options. +- * @return Buffer to save to. +- */ +-VipsBlob *webpsave_buffer( VOption *options = 0 ) const; ++ /** ++ * Save image to webp file. ++ * ++ * **Optional parameters** ++ * - **Q** -- Q factor, int. ++ * - **lossless** -- Enable lossless compression, bool. ++ * - **preset** -- Preset for lossy compression, VipsForeignWebpPreset. ++ * - **smart_subsample** -- Enable high quality chroma subsampling, bool. ++ * - **near_lossless** -- Enable preprocessing in lossless mode (uses Q), bool. ++ * - **alpha_q** -- Change alpha plane fidelity for lossy compression, int. ++ * - **min_size** -- Optimise for minimum size, bool. ++ * - **kmin** -- Minimum number of frames between key frames, int. ++ * - **kmax** -- Maximum number of frames between key frames, int. ++ * - **effort** -- Level of CPU effort to reduce file size, int. ++ * - **profile** -- ICC profile to embed, const char *. ++ * - **mixed** -- Allow mixed encoding (might reduce file size), bool. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param filename Filename to save to. ++ * @param options Set of options. ++ */ ++ void webpsave(const char *filename, VOption *options = 0) const; + +-/** +- * Save image to webp target. +- * +- * **Optional parameters** +- * - **Q** -- Q factor, int. +- * - **lossless** -- Enable lossless compression, bool. +- * - **preset** -- Preset for lossy compression, VipsForeignWebpPreset. +- * - **smart_subsample** -- Enable high quality chroma subsampling, bool. +- * - **near_lossless** -- Enable preprocessing in lossless mode (uses Q), bool. +- * - **alpha_q** -- Change alpha plane fidelity for lossy compression, int. +- * - **min_size** -- Optimise for minimum size, bool. +- * - **kmin** -- Minimum number of frames between key frames, int. +- * - **kmax** -- Maximum number of frames between key frames, int. +- * - **effort** -- Level of CPU effort to reduce file size, int. +- * - **profile** -- ICC profile to embed, const char *. +- * - **mixed** -- Allow mixed encoding (might reduce file size), bool. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param target Target to save to. +- * @param options Set of options. +- */ +-void webpsave_target( VTarget target, VOption *options = 0 ) const; ++ /** ++ * Save image to webp buffer. ++ * ++ * **Optional parameters** ++ * - **Q** -- Q factor, int. ++ * - **lossless** -- Enable lossless compression, bool. ++ * - **preset** -- Preset for lossy compression, VipsForeignWebpPreset. ++ * - **smart_subsample** -- Enable high quality chroma subsampling, bool. ++ * - **near_lossless** -- Enable preprocessing in lossless mode (uses Q), bool. ++ * - **alpha_q** -- Change alpha plane fidelity for lossy compression, int. ++ * - **min_size** -- Optimise for minimum size, bool. ++ * - **kmin** -- Minimum number of frames between key frames, int. ++ * - **kmax** -- Maximum number of frames between key frames, int. ++ * - **effort** -- Level of CPU effort to reduce file size, int. ++ * - **profile** -- ICC profile to embed, const char *. ++ * - **mixed** -- Allow mixed encoding (might reduce file size), bool. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param options Set of options. ++ * @return Buffer to save to. ++ */ ++ VipsBlob *webpsave_buffer(VOption *options = 0) const; + +-/** +- * Save image to webp mime. +- * +- * **Optional parameters** +- * - **Q** -- Q factor, int. +- * - **lossless** -- Enable lossless compression, bool. +- * - **preset** -- Preset for lossy compression, VipsForeignWebpPreset. +- * - **smart_subsample** -- Enable high quality chroma subsampling, bool. +- * - **near_lossless** -- Enable preprocessing in lossless mode (uses Q), bool. +- * - **alpha_q** -- Change alpha plane fidelity for lossy compression, int. +- * - **min_size** -- Optimise for minimum size, bool. +- * - **kmin** -- Minimum number of frames between key frames, int. +- * - **kmax** -- Maximum number of frames between key frames, int. +- * - **effort** -- Level of CPU effort to reduce file size, int. +- * - **profile** -- ICC profile to embed, const char *. +- * - **mixed** -- Allow mixed encoding (might reduce file size), bool. +- * - **strip** -- Strip all metadata from image, bool. +- * - **background** -- Background value, std::vector. +- * - **page_height** -- Set page height for multipage save, int. +- * +- * @param target Target to save to. +- * @param options Set of options. +- */ +-void webpsave_mime( VOption *options = 0 ) const; ++ /** ++ * Save image to webp target. ++ * ++ * **Optional parameters** ++ * - **Q** -- Q factor, int. ++ * - **lossless** -- Enable lossless compression, bool. ++ * - **preset** -- Preset for lossy compression, VipsForeignWebpPreset. ++ * - **smart_subsample** -- Enable high quality chroma subsampling, bool. ++ * - **near_lossless** -- Enable preprocessing in lossless mode (uses Q), bool. ++ * - **alpha_q** -- Change alpha plane fidelity for lossy compression, int. ++ * - **min_size** -- Optimise for minimum size, bool. ++ * - **kmin** -- Minimum number of frames between key frames, int. ++ * - **kmax** -- Maximum number of frames between key frames, int. ++ * - **effort** -- Level of CPU effort to reduce file size, int. ++ * - **profile** -- ICC profile to embed, const char *. ++ * - **mixed** -- Allow mixed encoding (might reduce file size), bool. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param target Target to save to. ++ * @param options Set of options. ++ */ ++ void webpsave_target(VTarget target, VOption *options = 0) const; + +-/** +- * Make a worley noise image. +- * +- * **Optional parameters** +- * - **cell_size** -- Size of Worley cells, int. +- * - **seed** -- Random number seed, int. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage worley( int width, int height, VOption *options = 0 ); ++ /** ++ * Save image to webp mime. ++ * ++ * **Optional parameters** ++ * - **Q** -- Q factor, int. ++ * - **lossless** -- Enable lossless compression, bool. ++ * - **preset** -- Preset for lossy compression, VipsForeignWebpPreset. ++ * - **smart_subsample** -- Enable high quality chroma subsampling, bool. ++ * - **near_lossless** -- Enable preprocessing in lossless mode (uses Q), bool. ++ * - **alpha_q** -- Change alpha plane fidelity for lossy compression, int. ++ * - **min_size** -- Optimise for minimum size, bool. ++ * - **kmin** -- Minimum number of frames between key frames, int. ++ * - **kmax** -- Maximum number of frames between key frames, int. ++ * - **effort** -- Level of CPU effort to reduce file size, int. ++ * - **profile** -- ICC profile to embed, const char *. ++ * - **mixed** -- Allow mixed encoding (might reduce file size), bool. ++ * - **strip** -- Strip all metadata from image, bool. ++ * - **background** -- Background value, std::vector. ++ * - **page_height** -- Set page height for multipage save, int. ++ * ++ * @param target Target to save to. ++ * @param options Set of options. ++ */ ++ void webpsave_mime(VOption *options = 0) const; + +-/** +- * Wrap image origin. +- * +- * **Optional parameters** +- * - **x** -- Left edge of input in output, int. +- * - **y** -- Top edge of input in output, int. +- * +- * @param options Set of options. +- * @return Output image. +- */ +-VImage wrap( VOption *options = 0 ) const; ++ /** ++ * Make a worley noise image. ++ * ++ * **Optional parameters** ++ * - **cell_size** -- Size of Worley cells, int. ++ * - **seed** -- Random number seed, int. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage worley(int width, int height, VOption *options = 0); + +-/** +- * Make an image where pixel values are coordinates. +- * +- * **Optional parameters** +- * - **csize** -- Size of third dimension, int. +- * - **dsize** -- Size of fourth dimension, int. +- * - **esize** -- Size of fifth dimension, int. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage xyz( int width, int height, VOption *options = 0 ); ++ /** ++ * Wrap image origin. ++ * ++ * **Optional parameters** ++ * - **x** -- Left edge of input in output, int. ++ * - **y** -- Top edge of input in output, int. ++ * ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage wrap(VOption *options = 0) const; + +-/** +- * Make a zone plate. +- * +- * **Optional parameters** +- * - **uchar** -- Output an unsigned char image, bool. +- * +- * @param width Image width in pixels. +- * @param height Image height in pixels. +- * @param options Set of options. +- * @return Output image. +- */ +-static VImage zone( int width, int height, VOption *options = 0 ); ++ /** ++ * Make an image where pixel values are coordinates. ++ * ++ * **Optional parameters** ++ * - **csize** -- Size of third dimension, int. ++ * - **dsize** -- Size of fourth dimension, int. ++ * - **esize** -- Size of fifth dimension, int. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage xyz(int width, int height, VOption *options = 0); + +-/** +- * Zoom an image. +- * @param xfac Horizontal zoom factor. +- * @param yfac Vertical zoom factor. +- * @param options Set of options. +- * @return Output image. +- */ +-VImage zoom( int xfac, int yfac, VOption *options = 0 ) const; ++ /** ++ * Make a zone plate. ++ * ++ * **Optional parameters** ++ * - **uchar** -- Output an unsigned char image, bool. ++ * ++ * @param width Image width in pixels. ++ * @param height Image height in pixels. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ static VImage zone(int width, int height, VOption *options = 0); ++ ++ /** ++ * Zoom an image. ++ * @param xfac Horizontal zoom factor. ++ * @param yfac Vertical zoom factor. ++ * @param options Set of options. ++ * @return Output image. ++ */ ++ VImage zoom(int xfac, int yfac, VOption *options = 0) const; + }; + + VIPS_NAMESPACE_END +diff --git a/cplusplus/include/vips/VInterpolate8.h b/cplusplus/include/vips/VInterpolate8.h +index f5560e141b..041ceaef47 100644 +--- a/cplusplus/include/vips/VInterpolate8.h ++++ b/cplusplus/include/vips/VInterpolate8.h +@@ -2,28 +2,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -34,32 +34,29 @@ + + VIPS_NAMESPACE_START + +-/** ++/** + * An interpolation. You can pass one of these to something like + * VImage::affine for it to use to interpolate pixels. + * + * The available interpolators vary a bit with your libvips version and how it +- * was built, but will include `nearest`, `bilinear` and `bicubic`. Run ++ * was built, but will include `nearest`, `bilinear` and `bicubic`. Run + * vips -l interpolate` to see them all. + */ +-class VInterpolate : public VObject +-{ ++class VInterpolate : public VObject { + public: + /** + * Create a VInterpolate that wraps a VipsInterpolate object. If steal + * is STEAL, then this VInterpolate takes over ownership of the libvips + * object and will automatically unref it. + */ +- VInterpolate( VipsInterpolate *interpolate, VSteal steal = STEAL ) : +- VObject( (VipsObject *) interpolate, steal ) ++ VInterpolate(VipsInterpolate *interpolate, VSteal steal = STEAL) : VObject((VipsObject *) interpolate, steal) + { + } + + /** + * Create a VInterpolate from a name, for example `"bicubic"`. + */ +- static +- VInterpolate new_from_name( const char *name, VOption *options = 0 ); ++ static VInterpolate new_from_name(const char *name, VOption *options = 0); + + /** + * Get a pointer to the underlying VipsInterpolate object. +@@ -67,9 +64,8 @@ class VInterpolate : public VObject + VipsInterpolate * + get_interpolate() const + { +- return( (VipsInterpolate *) VObject::get_object() ); ++ return ((VipsInterpolate *) VObject::get_object()); + } +- + }; + + VIPS_NAMESPACE_END +diff --git a/cplusplus/include/vips/VRegion8.h b/cplusplus/include/vips/VRegion8.h +index c841aacf15..65c51495b2 100644 +--- a/cplusplus/include/vips/VRegion8.h ++++ b/cplusplus/include/vips/VRegion8.h +@@ -2,28 +2,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -37,16 +37,14 @@ VIPS_NAMESPACE_START + /** + * A region of an image. Can be used to access raw pixel data. + * */ +-class VRegion : public VObject +-{ ++class VRegion : public VObject { + public: + /** + * Create a VRegion that wraps a VipsRegion object. If steal + * is STEAL, then this VRegion takes over ownership of the libvips + * object and will automatically unref it. + */ +- VRegion( VipsRegion *region, VSteal steal = STEAL ) : +- VObject( (VipsObject *) region, steal ) ++ VRegion(VipsRegion *region, VSteal steal = STEAL) : VObject((VipsObject *) region, steal) + { + } + +@@ -54,7 +52,7 @@ class VRegion : public VObject + * Create a VRegion from an image. + */ + static VRegion +- new_from_image( VImage image ); ++ new_from_image(VImage image); + + /** + * Get a pointer to the underlying VipsRegion object. +@@ -69,9 +67,9 @@ class VRegion : public VObject + * Prepare the region from VipsRect. + */ + void +- prepare( const VipsRect *rect ) const ++ prepare(const VipsRect *rect) const + { +- if ( vips_region_prepare( get_region(), rect ) ) ++ if (vips_region_prepare(get_region(), rect)) + throw VError(); + } + +@@ -79,11 +77,11 @@ class VRegion : public VObject + * Prepare the region from rectangle coordinates. + */ + void +- prepare( int left, int top, int width, int height ) const ++ prepare(int left, int top, int width, int height) const + { + VipsRect rect = { left, top, width, height }; + +- prepare( &rect ); ++ prepare(&rect); + } + + /** +@@ -101,25 +99,25 @@ class VRegion : public VObject + VipsPel * + addr() const + { +- return addr( 0 ); ++ return addr(0); + } + + /** + * Get pointer at the given index of the region. + */ + VipsPel * +- addr( size_t i ) const ++ addr(size_t i) const + { +- return &VIPS_REGION_ADDR_TOPLEFT( get_region() )[i]; ++ return &VIPS_REGION_ADDR_TOPLEFT(get_region())[i]; + } + + /** + * Get pointer at the given coordinates of the region. + */ + VipsPel * +- addr( int x, int y ) const ++ addr(int x, int y) const + { +- return VIPS_REGION_ADDR( get_region(), x, y ); ++ return VIPS_REGION_ADDR(get_region(), x, y); + } + + /** +@@ -128,25 +126,25 @@ class VRegion : public VObject + size_t + stride() const + { +- return VIPS_REGION_LSKIP( get_region() ); ++ return VIPS_REGION_LSKIP(get_region()); + } + + /** + * Get VipsPel at the given index of the region. + */ + VipsPel +- operator[]( size_t i ) const ++ operator[](size_t i) const + { +- return *addr( i ); ++ return *addr(i); + } + + /** + * Get VipsPel at the given coordinates of the region. + */ + VipsPel +- operator()( int x, int y ) const ++ operator()(int x, int y) const + { +- return *addr( x, y ); ++ return *addr(x, y); + } + }; + +diff --git a/examples/annotate-animated.c b/examples/annotate-animated.c +index 25bbd063aa..3a23761448 100644 +--- a/examples/annotate-animated.c ++++ b/examples/annotate-animated.c +@@ -12,16 +12,16 @@ + #include + + static int +-annotate_image( VipsObject *context, VipsImage *image, VipsImage **out ) ++annotate_image(VipsObject *context, VipsImage *image, VipsImage **out) + { +- int page_height = vips_image_get_page_height( image ); ++ int page_height = vips_image_get_page_height(image); + int n_pages = image->Ysize / page_height; + VipsImage **overlay = (VipsImage **) +- vips_object_local_array( context, n_pages ); ++ vips_object_local_array(context, n_pages); + VipsImage **page = (VipsImage **) +- vips_object_local_array( context, n_pages ); ++ vips_object_local_array(context, n_pages); + VipsImage **annotated = (VipsImage **) +- vips_object_local_array( context, n_pages ); ++ vips_object_local_array(context, n_pages); + + /* Red as RGBA. + */ +@@ -32,74 +32,74 @@ annotate_image( VipsObject *context, VipsImage *image, VipsImage **out ) + + /* Split the image into frames. + */ +- for( i = 0; i < n_pages; i++ ) +- if( vips_crop( image, &page[i], +- 0, page_height * i, image->Xsize, page_height, NULL ) ) +- return( -1 ); ++ for (i = 0; i < n_pages; i++) ++ if (vips_crop(image, &page[i], ++ 0, page_height * i, image->Xsize, page_height, NULL)) ++ return (-1); + + /* Make an overlay ... a solid red square, with a transparent hole. + */ +- if( +- !(overlay[0] = vips_image_new_from_image( page[0], +- red, VIPS_NUMBER( red ) )) || +- vips_draw_rect( overlay[0], +- transparent, VIPS_NUMBER( transparent ), ++ if ( ++ !(overlay[0] = vips_image_new_from_image(page[0], ++ red, VIPS_NUMBER(red))) || ++ vips_draw_rect(overlay[0], ++ transparent, VIPS_NUMBER(transparent), + 10, 10, overlay[0]->Xsize - 20, overlay[0]->Ysize - 20, + "fill", TRUE, +- NULL ) ) +- return( -1 ); ++ NULL)) ++ return (-1); + + /* Draw the overlay on every page. + */ +- for( i = 0; i < n_pages; i++ ) +- if( vips_composite2( page[i], overlay[0], &annotated[i], +- VIPS_BLEND_MODE_OVER, NULL ) ) +- return( -1 ); ++ for (i = 0; i < n_pages; i++) ++ if (vips_composite2(page[i], overlay[0], &annotated[i], ++ VIPS_BLEND_MODE_OVER, NULL)) ++ return (-1); + + /* Reassemble the frames. + */ +- if( vips_arrayjoin( annotated, out, n_pages, +- "across", 1, +- NULL ) ) +- return( -1 ); ++ if (vips_arrayjoin(annotated, out, n_pages, ++ "across", 1, ++ NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-main( int argc, char **argv ) ++int ++main(int argc, char **argv) + { + VipsImage *image; + VipsObject *context; + VipsImage *x; + +- if( VIPS_INIT( argv[0] ) ) +- vips_error_exit( NULL ); ++ if (VIPS_INIT(argv[0])) ++ vips_error_exit(NULL); + +- if( argc != 3 ) +- vips_error_exit( "usage: %s xxx.gif[n=-1] yyy.gif", argv[0] ); ++ if (argc != 3) ++ vips_error_exit("usage: %s xxx.gif[n=-1] yyy.gif", argv[0]); + +- if( !(image = vips_image_new_from_file( argv[1], +- "access", VIPS_ACCESS_SEQUENTIAL, +- NULL )) ) +- vips_error_exit( NULL ); ++ if (!(image = vips_image_new_from_file(argv[1], ++ "access", VIPS_ACCESS_SEQUENTIAL, ++ NULL))) ++ vips_error_exit(NULL); + +- context = VIPS_OBJECT( vips_image_new() ); +- if( annotate_image( context, image, &x ) ) { +- g_object_unref( image ); +- g_object_unref( context ); +- vips_error_exit( NULL ); ++ context = VIPS_OBJECT(vips_image_new()); ++ if (annotate_image(context, image, &x)) { ++ g_object_unref(image); ++ g_object_unref(context); ++ vips_error_exit(NULL); + } +- g_object_unref( image ); +- g_object_unref( context ); ++ g_object_unref(image); ++ g_object_unref(context); + image = x; + +- if( vips_image_write_to_file( image, argv[2], NULL ) ) { +- g_object_unref( image ); +- vips_error_exit( NULL ); ++ if (vips_image_write_to_file(image, argv[2], NULL)) { ++ g_object_unref(image); ++ vips_error_exit(NULL); + } + +- g_object_unref( image ); ++ g_object_unref(image); + +- return( 0 ); ++ return (0); + } +diff --git a/examples/new-from-buffer.c b/examples/new-from-buffer.c +index db3f979a51..2fd5cac5a3 100644 +--- a/examples/new-from-buffer.c ++++ b/examples/new-from-buffer.c +@@ -1,6 +1,6 @@ + /* Read and write formatted images to memory. + * +- * Compile with: ++ * Compile with: + * + * gcc -g -Wall new-from-buffer.c `pkg-config vips --cflags --libs` + * +@@ -8,47 +8,47 @@ + + #include + +-int +-main( int argc, char **argv ) ++int ++main(int argc, char **argv) + { + gchar *buf; + gsize len; + int i; + +- if( VIPS_INIT( argv[0] ) ) +- vips_error_exit( NULL ); ++ if (VIPS_INIT(argv[0])) ++ vips_error_exit(NULL); + +- if( argc != 2 ) +- vips_error_exit( "usage: %s FILENAME", argv[0] ); ++ if (argc != 2) ++ vips_error_exit("usage: %s FILENAME", argv[0]); + +- if( !g_file_get_contents( argv[1], &buf, &len, NULL ) ) +- vips_error_exit( NULL ); ++ if (!g_file_get_contents(argv[1], &buf, &len, NULL)) ++ vips_error_exit(NULL); + +- for( i = 0; i < 10; i++ ) { ++ for (i = 0; i < 10; i++) { + VipsImage *image; + void *new_buf; + size_t new_len; + +- printf( "loop %d ...\n", i ); ++ printf("loop %d ...\n", i); + +- if( !(image = vips_image_new_from_buffer( buf, len, "", +- "access", VIPS_ACCESS_SEQUENTIAL, +- NULL )) ) +- vips_error_exit( NULL ); ++ if (!(image = vips_image_new_from_buffer(buf, len, "", ++ "access", VIPS_ACCESS_SEQUENTIAL, ++ NULL))) ++ vips_error_exit(NULL); + +- if( vips_image_write_to_buffer( image, +- ".jpg", &new_buf, &new_len, +- "Q", 95, +- NULL ) ) +- vips_error_exit( NULL ); ++ if (vips_image_write_to_buffer(image, ++ ".jpg", &new_buf, &new_len, ++ "Q", 95, ++ NULL)) ++ vips_error_exit(NULL); + +- g_object_unref( image ); +- g_free( new_buf ); ++ g_object_unref(image); ++ g_free(new_buf); + } + +- g_free( buf ); ++ g_free(buf); + + vips_shutdown(); + +- return( 0 ); ++ return (0); + } +diff --git a/examples/progress-cancel.c b/examples/progress-cancel.c +index 86b7b51c6d..14c9afcf21 100644 +--- a/examples/progress-cancel.c ++++ b/examples/progress-cancel.c +@@ -9,69 +9,69 @@ + #include + #include + +-void +-preeval_callback( VipsImage *image, VipsProgress *progress, void* pdata ) ++void ++preeval_callback(VipsImage *image, VipsProgress *progress, void *pdata) + { +- printf( "preeval_callback:\n" ); ++ printf("preeval_callback:\n"); + } + +-void +-eval_callback( VipsImage *image, VipsProgress *progress, void* pdata ) ++void ++eval_callback(VipsImage *image, VipsProgress *progress, void *pdata) + { +- printf( "eval_callback: percent = %d\n", progress->percent ); ++ printf("eval_callback: percent = %d\n", progress->percent); + +- if( progress->percent >= 25 ) { +- printf( "calling vips_image_set_kill() ...\n" ); +- vips_image_set_kill( image, TRUE ); ++ if (progress->percent >= 25) { ++ printf("calling vips_image_set_kill() ...\n"); ++ vips_image_set_kill(image, TRUE); + } + } + +-void +-posteval_callback( VipsImage *image, VipsProgress *progress, void* pdata ) ++void ++posteval_callback(VipsImage *image, VipsProgress *progress, void *pdata) + { +- printf( "posteval_callback: finished in %.3gs\n", +- g_timer_elapsed( progress->start, NULL ) ); ++ printf("posteval_callback: finished in %.3gs\n", ++ g_timer_elapsed(progress->start, NULL)); + } + +-int +-main( int argc, char **argv ) ++int ++main(int argc, char **argv) + { + VipsImage *image; + VipsImage *out; + void *output; + size_t output_length; + +- if( VIPS_INIT( argv[0] ) ) +- vips_error_exit( NULL ); ++ if (VIPS_INIT(argv[0])) ++ vips_error_exit(NULL); + +- if( argc != 3 ) +- vips_error_exit( "usage: %s INPUT-FILE OUTPUT-FILE", argv[0] ); ++ if (argc != 3) ++ vips_error_exit("usage: %s INPUT-FILE OUTPUT-FILE", argv[0]); + +- if( !(image = vips_image_new_from_file( argv[1], +- "access", VIPS_ACCESS_SEQUENTIAL, +- NULL )) ) +- vips_error_exit( NULL ); ++ if (!(image = vips_image_new_from_file(argv[1], ++ "access", VIPS_ACCESS_SEQUENTIAL, ++ NULL))) ++ vips_error_exit(NULL); + +- if( vips_resize( image, &out, 0.5, NULL ) ) +- vips_error_exit( NULL ); ++ if (vips_resize(image, &out, 0.5, NULL)) ++ vips_error_exit(NULL); + +- vips_image_set_progress( out, TRUE ); +- g_signal_connect( out, "preeval", +- G_CALLBACK( preeval_callback ), NULL ); +- g_signal_connect( out, "eval", +- G_CALLBACK( eval_callback ), NULL ); +- g_signal_connect( out, "posteval", +- G_CALLBACK( posteval_callback ), NULL ); ++ vips_image_set_progress(out, TRUE); ++ g_signal_connect(out, "preeval", ++ G_CALLBACK(preeval_callback), NULL); ++ g_signal_connect(out, "eval", ++ G_CALLBACK(eval_callback), NULL); ++ g_signal_connect(out, "posteval", ++ G_CALLBACK(posteval_callback), NULL); + + output = NULL; +- if( vips_image_write_to_buffer( out, argv[2], &output, &output_length, +- NULL ) ) +- printf( "error return from vips_image_write_to_buffer()\n" ); ++ if (vips_image_write_to_buffer(out, argv[2], &output, &output_length, ++ NULL)) ++ printf("error return from vips_image_write_to_buffer()\n"); + +- g_object_unref( out ); +- g_object_unref( image ); +- if( output ) +- g_free( output ); ++ g_object_unref(out); ++ g_object_unref(image); ++ if (output) ++ g_free(output); + vips_shutdown(); + + return 0; +diff --git a/examples/use-vips-func.c b/examples/use-vips-func.c +index 0b8dc08493..4445a54358 100644 +--- a/examples/use-vips-func.c ++++ b/examples/use-vips-func.c +@@ -6,38 +6,38 @@ + #include + + int +-main( int argc, char **argv ) ++main(int argc, char **argv) + { +- VipsImage *in; +- double mean; +- VipsImage *out; ++ VipsImage *in; ++ double mean; ++ VipsImage *out; + +- if( VIPS_INIT( argv[0] ) ) +- vips_error_exit( NULL ); ++ if (VIPS_INIT(argv[0])) ++ vips_error_exit(NULL); + +- if( argc != 3 ) +- vips_error_exit( "usage: %s infile outfile", argv[0] ); +- +- if( !(in = vips_image_new_from_file( argv[1], NULL )) ) +- vips_error_exit( NULL ); ++ if (argc != 3) ++ vips_error_exit("usage: %s infile outfile", argv[0]); + +- printf( "image width = %d\n", vips_image_get_width( in ) ); ++ if (!(in = vips_image_new_from_file(argv[1], NULL))) ++ vips_error_exit(NULL); + +- if( vips_avg( in, &mean, NULL ) ) +- vips_error_exit( NULL ); ++ printf("image width = %d\n", vips_image_get_width(in)); + +- printf( "mean pixel value = %g\n", mean ); ++ if (vips_avg(in, &mean, NULL)) ++ vips_error_exit(NULL); + +- /* generate photo nexative - replace with other vips_ funcs */ +- if( vips_invert( in, &out, NULL ) ) +- vips_error_exit( NULL ); ++ printf("mean pixel value = %g\n", mean); + +- g_object_unref( in ); ++ /* generate photo nexative - replace with other vips_ funcs */ ++ if (vips_invert(in, &out, NULL)) ++ vips_error_exit(NULL); + +- if( vips_image_write_to_file( out, argv[2], NULL ) ) +- vips_error_exit( NULL ); ++ g_object_unref(in); + +- g_object_unref( out ); ++ if (vips_image_write_to_file(out, argv[2], NULL)) ++ vips_error_exit(NULL); + +- return( 0 ); ++ g_object_unref(out); ++ ++ return (0); + } +diff --git a/libvips/arithmetic/abs.c b/libvips/arithmetic/abs.c +index 594f6dd8f8..f91050e9eb 100644 +--- a/libvips/arithmetic/abs.c ++++ b/libvips/arithmetic/abs.c +@@ -3,7 +3,7 @@ + * Copyright: 1990, N. Dessipris, based on im_powtra() + * Author: Nicos Dessipris + * Written on: 02/05/1990 +- * Modified on: ++ * Modified on: + * 5/5/93 J.Cupitt + * - adapted from im_lintra to work with partial images + * - complex and signed support added +@@ -26,35 +26,35 @@ + * - redone as a class + * 3/12/13 + * - add orc, though the speed improvement vs. gcc's auto-vectorizer +- * seems very marginal ++ * seems very marginal + * 21/2/19 + * - move orc init to first use of abs + */ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -78,149 +78,167 @@ + typedef VipsUnary VipsAbs; + typedef VipsUnaryClass VipsAbsClass; + +-G_DEFINE_TYPE( VipsAbs, vips_abs, VIPS_TYPE_UNARY ); ++G_DEFINE_TYPE(VipsAbs, vips_abs, VIPS_TYPE_UNARY); + + static void * +-vips_abs_orc_init_cb( void *a ) ++vips_abs_orc_init_cb(void *a) + { + VipsAbs *abs = (VipsAbs *) a; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_GET_CLASS( abs ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_GET_CLASS(abs); + + VipsVector *v; + +- vips_arithmetic_set_vector( aclass ); ++ vips_arithmetic_set_vector(aclass); + +- v = vips_arithmetic_get_program( aclass, VIPS_FORMAT_CHAR ); +- vips_vector_asm2( v, "absb", "d1", "s1" ); ++ v = vips_arithmetic_get_program(aclass, VIPS_FORMAT_CHAR); ++ vips_vector_asm2(v, "absb", "d1", "s1"); + +- v = vips_arithmetic_get_program( aclass, VIPS_FORMAT_SHORT ); +- vips_vector_asm2( v, "absw", "d1", "s1" ); ++ v = vips_arithmetic_get_program(aclass, VIPS_FORMAT_SHORT); ++ vips_vector_asm2(v, "absw", "d1", "s1"); + +- v = vips_arithmetic_get_program( aclass, VIPS_FORMAT_INT ); +- vips_vector_asm2( v, "absl", "d1", "s1" ); ++ v = vips_arithmetic_get_program(aclass, VIPS_FORMAT_INT); ++ vips_vector_asm2(v, "absl", "d1", "s1"); + +- vips_arithmetic_compile( aclass ); ++ vips_arithmetic_compile(aclass); + +- return( NULL ); ++ return (NULL); + } + + static int +-vips_abs_build( VipsObject *object ) ++vips_abs_build(VipsObject *object) + { + static GOnce once = G_ONCE_INIT; + + VipsUnary *unary = (VipsUnary *) object; + +- VIPS_ONCE( &once, vips_abs_orc_init_cb, object ); ++ VIPS_ONCE(&once, vips_abs_orc_init_cb, object); + +- if( unary->in && +- vips_band_format_isuint( unary->in->BandFmt ) ) +- return( vips_unary_copy( unary ) ); ++ if (unary->in && ++ vips_band_format_isuint(unary->in->BandFmt)) ++ return (vips_unary_copy(unary)); + +- if( VIPS_OBJECT_CLASS( vips_abs_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_abs_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Integer abs operation: just test and negate. + */ +-#define ABS_INT( TYPE ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- TYPE * restrict q = (TYPE *) out; \ +- int x; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = p[x] < 0 ? 0 - p[x] : p[x]; \ +-} ++#define ABS_INT(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++ int x; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = p[x] < 0 ? 0 - p[x] : p[x]; \ ++ } + + /* Float abs operation: call fabs(). + */ +-#define ABS_FLOAT( TYPE ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- TYPE * restrict q = (TYPE *) out; \ +- int x; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = VIPS_FABS( p[x] ); \ +-} ++#define ABS_FLOAT(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++ int x; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = VIPS_FABS(p[x]); \ ++ } + + /* Complex abs operation: calculate modulus. + */ + + #ifdef HAVE_HYPOT + +-#define ABS_COMPLEX( TYPE ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- TYPE * restrict q = (TYPE *) out; \ +- int x; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- q[x] = hypot( p[0], p[1] ); \ +- p += 2; \ +- } \ +-} ++#define ABS_COMPLEX(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++ int x; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ q[x] = hypot(p[0], p[1]); \ ++ p += 2; \ ++ } \ ++ } + + #else /*HAVE_HYPOT*/ + +-#define ABS_COMPLEX( TYPE ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- TYPE * restrict q = (TYPE *) out; \ +- int x; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- double rp = p[0]; \ +- double ip = p[1]; \ +- double abs_rp = VIPS_FABS( rp ); \ +- double abs_ip = VIPS_FABS( ip ); \ +- \ +- if( abs_rp > abs_ip ) { \ +- double temp = ip / rp; \ +- \ +- q[x] = abs_rp * sqrt( 1.0 + temp * temp ); \ +- } \ +- else { \ +- double temp = rp / ip; \ +- \ +- q[x] = abs_ip * sqrt( 1.0 + temp * temp ); \ ++#define ABS_COMPLEX(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++ int x; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ double rp = p[0]; \ ++ double ip = p[1]; \ ++ double abs_rp = VIPS_FABS(rp); \ ++ double abs_ip = VIPS_FABS(ip); \ ++\ ++ if (abs_rp > abs_ip) { \ ++ double temp = ip / rp; \ ++\ ++ q[x] = abs_rp * sqrt(1.0 + temp * temp); \ ++ } \ ++ else { \ ++ double temp = rp / ip; \ ++\ ++ q[x] = abs_ip * sqrt(1.0 + temp * temp); \ ++ } \ ++\ ++ p += 2; \ + } \ +- \ +- p += 2; \ +- } \ +-} ++ } + + #endif /*HAVE_HYPOT*/ + + static void +-vips_abs_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_abs_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { +- VipsArithmeticClass *class = VIPS_ARITHMETIC_GET_CLASS( arithmetic ); ++ VipsArithmeticClass *class = VIPS_ARITHMETIC_GET_CLASS(arithmetic); + VipsImage *im = arithmetic->ready[0]; +- const int bands = vips_image_get_bands( im ); ++ const int bands = vips_image_get_bands(im); + int sz = width * bands; + + VipsVector *v; + +- if( (v = vips_arithmetic_get_vector( class, +- vips_image_get_format( im ) )) ) { ++ if ((v = vips_arithmetic_get_vector(class, ++ vips_image_get_format(im)))) { + VipsExecutor ex; + +- vips_executor_set_program( &ex, v, sz ); +- vips_executor_set_array( &ex, v->s[0], in[0] ); +- vips_executor_set_destination( &ex, out ); ++ vips_executor_set_program(&ex, v, sz); ++ vips_executor_set_array(&ex, v->s[0], in[0]); ++ vips_executor_set_destination(&ex, out); + +- vips_executor_run( &ex ); ++ vips_executor_run(&ex); + } + else { +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_CHAR: ABS_INT( signed char ); break; +- case VIPS_FORMAT_SHORT: ABS_INT( signed short ); break; +- case VIPS_FORMAT_INT: ABS_INT( signed int ); break; +- case VIPS_FORMAT_FLOAT: ABS_FLOAT( float ); break; +- case VIPS_FORMAT_DOUBLE: ABS_FLOAT( double ); break; +- case VIPS_FORMAT_COMPLEX: ABS_COMPLEX( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: ABS_COMPLEX( double ); break; ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_CHAR: ++ ABS_INT(signed char); ++ break; ++ case VIPS_FORMAT_SHORT: ++ ABS_INT(signed short); ++ break; ++ case VIPS_FORMAT_INT: ++ ABS_INT(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ ABS_FLOAT(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ ABS_FLOAT(double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ ABS_COMPLEX(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ ABS_COMPLEX(double); ++ break; + + default: + g_assert_not_reached(); +@@ -249,50 +267,50 @@ static const VipsBandFormat vips_abs_format_table[10] = { + }; + + static void +-vips_abs_class_init( VipsAbsClass *class ) ++vips_abs_class_init(VipsAbsClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + object_class->nickname = "abs"; +- object_class->description = _( "absolute value of an image" ); ++ object_class->description = _("absolute value of an image"); + object_class->build = vips_abs_build; + + aclass->process_line = vips_abs_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_abs_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_abs_format_table); + } + + static void +-vips_abs_init( VipsAbs *abs ) ++vips_abs_init(VipsAbs *abs) + { + } + +-/** ++/** + * vips_abs: (method) + * @in: input #VipsImage + * @out: (out): output #VipsImage + * @...: %NULL-terminated list of optional named arguments + * +- * This operation finds the absolute value of an image. It does a copy for +- * unsigned integer types, negate for negative values in +- * signed integer types, fabs(3) for +- * float types, and calculates modulus for complex +- * types. ++ * This operation finds the absolute value of an image. It does a copy for ++ * unsigned integer types, negate for negative values in ++ * signed integer types, fabs(3) for ++ * float types, and calculates modulus for complex ++ * types. + * + * See also: vips_sign(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_abs( VipsImage *in, VipsImage **out, ... ) ++vips_abs(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "abs", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("abs", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/add.c b/libvips/arithmetic/add.c +index 8e7335dd61..d06598b489 100644 +--- a/libvips/arithmetic/add.c ++++ b/libvips/arithmetic/add.c +@@ -4,7 +4,7 @@ + * + * Author: Nicos Dessipris + * Written on: 02/05/1990 +- * Modified on: ++ * Modified on: + * 29/4/93 J.Cupitt + * - now works for partial images + * 1/7/93 JC +@@ -42,28 +42,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -87,54 +87,62 @@ + typedef VipsBinary VipsAdd; + typedef VipsBinaryClass VipsAddClass; + +-G_DEFINE_TYPE( VipsAdd, vips_add, VIPS_TYPE_BINARY ); ++G_DEFINE_TYPE(VipsAdd, vips_add, VIPS_TYPE_BINARY); + +-#define LOOP( IN, OUT ) { \ +- IN * restrict left = (IN *) in[0]; \ +- IN * restrict right = (IN *) in[1]; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = left[x] + right[x]; \ +-} ++#define LOOP(IN, OUT) \ ++ { \ ++ IN *restrict left = (IN *) in[0]; \ ++ IN *restrict right = (IN *) in[1]; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = left[x] + right[x]; \ ++ } + + static void +-add_buffer( VipsArithmetic *arithmetic, VipsPel *out, VipsPel **in, int width ) ++add_buffer(VipsArithmetic *arithmetic, VipsPel *out, VipsPel **in, int width) + { + VipsImage *im = arithmetic->ready[0]; + + /* Complex just doubles the size. + */ +- const int sz = width * vips_image_get_bands( im ) * +- (vips_band_format_iscomplex( vips_image_get_format( im ) ) ? +- 2 : 1); ++ const int sz = width * vips_image_get_bands(im) * ++ (vips_band_format_iscomplex(vips_image_get_format(im)) ? 2 : 1); + + int x; + +- /* Add all input types. Keep types here in sync with ++ /* Add all input types. Keep types here in sync with + * vips_add_format_table[] below. + */ +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_UCHAR: +- LOOP( unsigned char, unsigned short ); break; +- case VIPS_FORMAT_CHAR: +- LOOP( signed char, signed short ); break; +- case VIPS_FORMAT_USHORT: +- LOOP( unsigned short, unsigned int ); break; +- case VIPS_FORMAT_SHORT: +- LOOP( signed short, signed int ); break; +- case VIPS_FORMAT_UINT: +- LOOP( unsigned int, unsigned int ); break; +- case VIPS_FORMAT_INT: +- LOOP( signed int, signed int ); break; +- +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- LOOP( float, float ); break; +- +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- LOOP( double, double ); break; ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_UCHAR: ++ LOOP(unsigned char, unsigned short); ++ break; ++ case VIPS_FORMAT_CHAR: ++ LOOP(signed char, signed short); ++ break; ++ case VIPS_FORMAT_USHORT: ++ LOOP(unsigned short, unsigned int); ++ break; ++ case VIPS_FORMAT_SHORT: ++ LOOP(signed short, signed int); ++ break; ++ case VIPS_FORMAT_UINT: ++ LOOP(unsigned int, unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ LOOP(signed int, signed int); ++ break; ++ ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ LOOP(float, float); ++ break; ++ ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ LOOP(double, double); ++ break; + + default: + g_assert_not_reached(); +@@ -163,44 +171,44 @@ static const VipsBandFormat vips_add_format_table[10] = { + }; + + static void +-vips_add_class_init( VipsAddClass *class ) ++vips_add_class_init(VipsAddClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + object_class->nickname = "add"; +- object_class->description = _( "add two images" ); ++ object_class->description = _("add two images"); + + aclass->process_line = add_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_add_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_add_format_table); + } + + static void +-vips_add_init( VipsAdd *add ) ++vips_add_init(VipsAdd *add) + { + } + + /** + * vips_add: +- * @left: input image +- * @right: input image ++ * @left: input image ++ * @right: input image + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * This operation calculates @in1 + @in2 and writes the result to @out. ++ * This operation calculates @in1 + @in2 and writes the result to @out. + * + * If the images differ in size, the smaller image is enlarged to match the + * larger by adding zero pixels along the bottom and right. + * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +- * The two input images are cast up to the smallest common format (see table +- * Smallest common format in +- * arithmetic), then the ++ * The two input images are cast up to the smallest common format (see table ++ * Smallest common format in ++ * arithmetic), then the + * following table is used to determine the output type: + * + * +@@ -268,14 +276,14 @@ vips_add_init( VipsAdd *add ) + * Returns: 0 on success, -1 on error + */ + int +-vips_add( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_add(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "add", ap, left, right, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("add", ap, left, right, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/arithmetic.c b/libvips/arithmetic/arithmetic.c +index 744665bca0..54e1222431 100644 +--- a/libvips/arithmetic/arithmetic.c ++++ b/libvips/arithmetic/arithmetic.c +@@ -12,28 +12,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -55,7 +55,7 @@ + + #include "parithmetic.h" + +-/** ++/** + * SECTION: arithmetic + * @short_description: pixel arithmetic, trig, log, statistics + * @stability: Stable +@@ -63,25 +63,25 @@ + * + * These operations perform pixel arithmetic, that is, they perform an + * arithmetic operation, such as addition, on every pixel in an image or a +- * pair of images. All (except in a few cases noted below) will work with +- * images of any type or any mixture of types, of any size and of any number ++ * pair of images. All (except in a few cases noted below) will work with ++ * images of any type or any mixture of types, of any size and of any number + * of bands. + * +- * For binary operations, if the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * For binary operations, if the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +- * In the same way, for operations that take an array constant, such as +- * vips_remainder_const(), you can mix single-element arrays or single-band ++ * In the same way, for operations that take an array constant, such as ++ * vips_remainder_const(), you can mix single-element arrays or single-band + * images freely. + * + * Arithmetic operations try to preserve precision by increasing the number of + * bits in the output image when necessary. Generally, this follows the ANSI C + * conventions for type promotion, so multiplying two +- * #VIPS_FORMAT_UCHAR images together, for example, produces a +- * #VIPS_FORMAT_USHORT image, and taking the vips_cos() of a +- * #VIPS_FORMAT_USHORT image produces #VIPS_FORMAT_FLOAT image. ++ * #VIPS_FORMAT_UCHAR images together, for example, produces a ++ * #VIPS_FORMAT_USHORT image, and taking the vips_cos() of a ++ * #VIPS_FORMAT_USHORT image produces #VIPS_FORMAT_FLOAT image. + * + * After processing, use vips_cast() and friends to take then format back down + * again. vips_cast_uchar(), for example, will cast any image down to 8-bit +@@ -97,9 +97,9 @@ + * save as 16-bit PNG). Use vips_copy() to change the interpretation without + * changing pixels. + * +- * For binary arithmetic operations, type promotion occurs in two stages. +- * First, the two input images are cast up to the smallest common format, +- * that is, the type with the smallest range that can represent the full ++ * For binary arithmetic operations, type promotion occurs in two stages. ++ * First, the two input images are cast up to the smallest common format, ++ * that is, the type with the smallest range that can represent the full + * range of both inputs. This conversion can be represented as a table: + * + *
+@@ -255,14 +255,14 @@ + * + *
+ * +- * In the second stage, the operation is performed between the two identical +- * types to form the output. The details vary between operations, but +- * generally the principle is that the output type should be large enough to +- * represent the whole range of possible values, except that int never becomes ++ * In the second stage, the operation is performed between the two identical ++ * types to form the output. The details vary between operations, but ++ * generally the principle is that the output type should be large enough to ++ * represent the whole range of possible values, except that int never becomes + * float. + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsArithmetic, vips_arithmetic, VIPS_TYPE_OPERATION ); ++G_DEFINE_ABSTRACT_TYPE(VipsArithmetic, vips_arithmetic, VIPS_TYPE_OPERATION); + + /* Save a bit of typing. + */ +@@ -281,149 +281,148 @@ G_DEFINE_ABSTRACT_TYPE( VipsArithmetic, vips_arithmetic, VIPS_TYPE_OPERATION ); + * full range of both. + */ + static VipsBandFormat format_largest[6][6] = { +- /* UC C US S UI I */ +-/* UC */ { UC, S, US, S, UI, I }, +-/* C */ { S, C, I, S, I, I }, +-/* US */ { US, I, US, I, UI, I }, +-/* S */ { S, S, I, S, I, I }, +-/* UI */ { UI, I, UI, I, UI, I }, +-/* I */ { I, I, I, I, I, I } ++ /* UC C US S UI I */ ++ /* UC */ { UC, S, US, S, UI, I }, ++ /* C */ { S, C, I, S, I, I }, ++ /* US */ { US, I, US, I, UI, I }, ++ /* S */ { S, S, I, S, I, I }, ++ /* UI */ { UI, I, UI, I, UI, I }, ++ /* I */ { I, I, I, I, I, I } + }; + + /* For two formats, find one which can represent the full range of both. + */ + static VipsBandFormat +-vips_format_common( VipsBandFormat a, VipsBandFormat b ) ++vips_format_common(VipsBandFormat a, VipsBandFormat b) + { +- if( vips_band_format_iscomplex( a ) || +- vips_band_format_iscomplex( b ) ) { +- if( a == VIPS_FORMAT_DPCOMPLEX || +- b == VIPS_FORMAT_DPCOMPLEX ) +- return( VIPS_FORMAT_DPCOMPLEX ); ++ if (vips_band_format_iscomplex(a) || ++ vips_band_format_iscomplex(b)) { ++ if (a == VIPS_FORMAT_DPCOMPLEX || ++ b == VIPS_FORMAT_DPCOMPLEX) ++ return (VIPS_FORMAT_DPCOMPLEX); + else +- return( VIPS_FORMAT_COMPLEX ); +- ++ return (VIPS_FORMAT_COMPLEX); + } +- else if( vips_band_format_isfloat( a ) || +- vips_band_format_isfloat( b ) ) { +- if( a == VIPS_FORMAT_DOUBLE || +- b == VIPS_FORMAT_DOUBLE ) +- return( VIPS_FORMAT_DOUBLE ); ++ else if (vips_band_format_isfloat(a) || ++ vips_band_format_isfloat(b)) { ++ if (a == VIPS_FORMAT_DOUBLE || ++ b == VIPS_FORMAT_DOUBLE) ++ return (VIPS_FORMAT_DOUBLE); + else +- return( VIPS_FORMAT_FLOAT ); ++ return (VIPS_FORMAT_FLOAT); + } +- else +- return( format_largest[a][b] ); ++ else ++ return (format_largest[a][b]); + } + + int +-vips__formatalike_vec( VipsImage **in, VipsImage **out, int n ) ++vips__formatalike_vec(VipsImage **in, VipsImage **out, int n) + { + int i; + VipsBandFormat format; + +- g_assert( n >= 1 ); ++ g_assert(n >= 1); + + format = in[0]->BandFmt; +- for( i = 1; i < n; i++ ) +- format = vips_format_common( format, in[i]->BandFmt ); ++ for (i = 1; i < n; i++) ++ format = vips_format_common(format, in[i]->BandFmt); + +- for( i = 0; i < n; i++ ) +- if( in[i]->BandFmt == format ) { ++ for (i = 0; i < n; i++) ++ if (in[i]->BandFmt == format) { + /* Already in the right format ... just copy the image + * pointer and add a ref. + */ + out[i] = in[i]; +- g_object_ref( in[i] ); ++ g_object_ref(in[i]); + } + else { +- if( vips_cast( in[i], &out[i], format, NULL ) ) +- return( -1 ); ++ if (vips_cast(in[i], &out[i], format, NULL)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + int +-vips__sizealike_vec( VipsImage **in, VipsImage **out, int n ) ++vips__sizealike_vec(VipsImage **in, VipsImage **out, int n) + { + int i; + int width_max; + int height_max; + +- g_assert( n >= 1 ); ++ g_assert(n >= 1); + + width_max = in[0]->Xsize; + height_max = in[0]->Ysize; +- for( i = 1; i < n; i++ ) { +- width_max = VIPS_MAX( width_max, in[i]->Xsize ); +- height_max = VIPS_MAX( height_max, in[i]->Ysize ); ++ for (i = 1; i < n; i++) { ++ width_max = VIPS_MAX(width_max, in[i]->Xsize); ++ height_max = VIPS_MAX(height_max, in[i]->Ysize); + } + +- for( i = 0; i < n; i++ ) +- if( in[i]->Xsize == width_max && +- in[i]->Ysize == height_max ) { ++ for (i = 0; i < n; i++) ++ if (in[i]->Xsize == width_max && ++ in[i]->Ysize == height_max) { + /* Already the right size ... just copy the image + * pointer and add a ref. + */ + out[i] = in[i]; +- g_object_ref( in[i] ); ++ g_object_ref(in[i]); + } + else { +- if( vips_embed( in[i], &out[i], +- 0, 0, width_max, height_max, NULL ) ) +- return( -1 ); ++ if (vips_embed(in[i], &out[i], ++ 0, 0, width_max, height_max, NULL)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Make an n-band image. Input 1 or n bands. + */ + int +-vips__bandup( const char *domain, VipsImage *in, VipsImage **out, int n ) ++vips__bandup(const char *domain, VipsImage *in, VipsImage **out, int n) + { + VipsImage **bands; + int i; + int result; + +- if( in->Bands == n ) +- return( vips_copy( in, out, NULL ) ); +- if( in->Bands != 1 ) { +- vips_error( domain, _( "not one band or %d bands" ), n ); +- return( -1 ); ++ if (in->Bands == n) ++ return (vips_copy(in, out, NULL)); ++ if (in->Bands != 1) { ++ vips_error(domain, _("not one band or %d bands"), n); ++ return (-1); + } +- if( n > VIPS_MAX_COORD || +- n < 1 ) { +- vips_error( domain, "%s", _( "bad bands" ) ); +- return( -1 ); ++ if (n > VIPS_MAX_COORD || ++ n < 1) { ++ vips_error(domain, "%s", _("bad bands")); ++ return (-1); + } + +- if( !(bands = VIPS_ARRAY( NULL, n, VipsImage * )) ) +- return( -1 ); +- for( i = 0; i < n; i++ ) ++ if (!(bands = VIPS_ARRAY(NULL, n, VipsImage *))) ++ return (-1); ++ for (i = 0; i < n; i++) + bands[i] = in; +- result = vips_bandjoin( bands, out, n, NULL ); +- VIPS_FREE( bands ); ++ result = vips_bandjoin(bands, out, n, NULL); ++ VIPS_FREE(bands); + +- return( result ); ++ return (result); + } + +-/* base_bands is the default minimum. ++/* base_bands is the default minimum. + * + * Handy for example, if you have VipsLinear with + * a 3-element vector of constants and a 1-band input image, you need to cast + * the image up to three bands. + */ + int +-vips__bandalike_vec( const char *domain, +- VipsImage **in, VipsImage **out, int n, int base_bands ) ++vips__bandalike_vec(const char *domain, ++ VipsImage **in, VipsImage **out, int n, int base_bands) + { + int i; + int max_bands; + VipsInterpretation interpretation; + +- g_assert( n >= 1 ); ++ g_assert(n >= 1); + + /* We try to set the interpretation of the output images from the + * interpretation of the n-band input. For example, if we are matching +@@ -432,38 +431,38 @@ vips__bandalike_vec( const char *domain, + */ + max_bands = base_bands; + interpretation = VIPS_INTERPRETATION_ERROR; +- for( i = 0; i < n; i++ ) { ++ for (i = 0; i < n; i++) { + /* >= so we can pick up interpretation if base_bands is equal + * to the number of bands of the largest image. + */ +- if( in[i]->Bands >= max_bands ) { ++ if (in[i]->Bands >= max_bands) { + max_bands = in[i]->Bands; + interpretation = in[i]->Type; + } + } + +- for( i = 0; i < n; i++ ) +- if( in[i]->Bands == max_bands ) { +- /* Already the right number of bands ... just copy the ++ for (i = 0; i < n; i++) ++ if (in[i]->Bands == max_bands) { ++ /* Already the right number of bands ... just copy the + * image pointer and add a ref. + */ + out[i] = in[i]; +- g_object_ref( in[i] ); ++ g_object_ref(in[i]); + } + else { +- if( vips__bandup( domain, in[i], &out[i], max_bands ) ) +- return( -1 ); ++ if (vips__bandup(domain, in[i], &out[i], max_bands)) ++ return (-1); + +- if( interpretation != VIPS_INTERPRETATION_ERROR ) ++ if (interpretation != VIPS_INTERPRETATION_ERROR) + out[i]->Type = interpretation; + } + +- return( 0 ); ++ return (0); + } + + int +-vips__formatalike( VipsImage *in1, VipsImage *in2, +- VipsImage **out1, VipsImage **out2 ) ++vips__formatalike(VipsImage *in1, VipsImage *in2, ++ VipsImage **out1, VipsImage **out2) + { + VipsImage *in[2]; + VipsImage *out[2]; +@@ -471,18 +470,18 @@ vips__formatalike( VipsImage *in1, VipsImage *in2, + in[0] = in1; + in[1] = in2; + +- if( vips__formatalike_vec( in, out, 2 ) ) +- return( -1 ); ++ if (vips__formatalike_vec(in, out, 2)) ++ return (-1); + + *out1 = out[0]; + *out2 = out[1]; + +- return( 0 ); ++ return (0); + } + + int +-vips__sizealike( VipsImage *in1, VipsImage *in2, +- VipsImage **out1, VipsImage **out2 ) ++vips__sizealike(VipsImage *in1, VipsImage *in2, ++ VipsImage **out1, VipsImage **out2) + { + VipsImage *in[2]; + VipsImage *out[2]; +@@ -490,18 +489,18 @@ vips__sizealike( VipsImage *in1, VipsImage *in2, + in[0] = in1; + in[1] = in2; + +- if( vips__sizealike_vec( in, out, 2 ) ) +- return( -1 ); ++ if (vips__sizealike_vec(in, out, 2)) ++ return (-1); + + *out1 = out[0]; + *out2 = out[1]; + +- return( 0 ); ++ return (0); + } + + int +-vips__bandalike( const char *domain, +- VipsImage *in1, VipsImage *in2, VipsImage **out1, VipsImage **out2 ) ++vips__bandalike(const char *domain, ++ VipsImage *in1, VipsImage *in2, VipsImage **out1, VipsImage **out2) + { + VipsImage *in[2]; + VipsImage *out[2]; +@@ -509,13 +508,13 @@ vips__bandalike( const char *domain, + in[0] = in1; + in[1] = in2; + +- if( vips__bandalike_vec( domain, in, out, 2, 1 ) ) +- return( -1 ); ++ if (vips__bandalike_vec(domain, in, out, 2, 1)) ++ return (-1); + + *out1 = out[0]; + *out2 = out[1]; + +- return( 0 ); ++ return (0); + } + + /* Our sequence value. +@@ -534,27 +533,27 @@ typedef struct { + } VipsArithmeticSequence; + + static int +-vips_arithmetic_stop( void *vseq, void *a, void *b ) ++vips_arithmetic_stop(void *vseq, void *a, void *b) + { + VipsArithmeticSequence *seq = (VipsArithmeticSequence *) vseq; + +- if( seq->ir ) { ++ if (seq->ir) { + int i; + +- for( i = 0; seq->ir[i]; i++ ) +- VIPS_UNREF( seq->ir[i] ); +- VIPS_FREE( seq->ir ); ++ for (i = 0; seq->ir[i]; i++) ++ VIPS_UNREF(seq->ir[i]); ++ VIPS_FREE(seq->ir); + } + +- VIPS_FREE( seq->p ); ++ VIPS_FREE(seq->p); + +- VIPS_FREE( seq ); ++ VIPS_FREE(seq); + +- return( 0 ); ++ return (0); + } + + static void * +-vips_arithmetic_start( VipsImage *out, void *a, void *b ) ++vips_arithmetic_start(VipsImage *out, void *a, void *b) + { + VipsImage **in = (VipsImage **) a; + VipsArithmetic *arithmetic = (VipsArithmetic *) b; +@@ -562,8 +561,8 @@ vips_arithmetic_start( VipsImage *out, void *a, void *b ) + VipsArithmeticSequence *seq; + int i, n; + +- if( !(seq = VIPS_NEW( NULL, VipsArithmeticSequence )) ) +- return( NULL ); ++ if (!(seq = VIPS_NEW(NULL, VipsArithmeticSequence))) ++ return (NULL); + + seq->arithmetic = arithmetic; + seq->ir = NULL; +@@ -571,81 +570,81 @@ vips_arithmetic_start( VipsImage *out, void *a, void *b ) + + /* How many images? + */ +- for( n = 0; in[n]; n++ ) ++ for (n = 0; in[n]; n++) + ; + + /* Alocate space for region array. + */ +- if( !(seq->ir = VIPS_ARRAY( NULL, n + 1, VipsRegion * )) ) { +- vips_arithmetic_stop( seq, NULL, NULL ); +- return( NULL ); ++ if (!(seq->ir = VIPS_ARRAY(NULL, n + 1, VipsRegion *))) { ++ vips_arithmetic_stop(seq, NULL, NULL); ++ return (NULL); + } + + /* Create a set of regions. + */ +- for( i = 0; i < n; i++ ) +- if( !(seq->ir[i] = vips_region_new( in[i] )) ) { +- vips_arithmetic_stop( seq, NULL, NULL ); +- return( NULL ); ++ for (i = 0; i < n; i++) ++ if (!(seq->ir[i] = vips_region_new(in[i]))) { ++ vips_arithmetic_stop(seq, NULL, NULL); ++ return (NULL); + } + seq->ir[n] = NULL; + + /* Input pointers. + */ +- if( !(seq->p = VIPS_ARRAY( NULL, n + 1, VipsPel * )) ) { +- vips_arithmetic_stop( seq, NULL, NULL ); +- return( NULL ); ++ if (!(seq->p = VIPS_ARRAY(NULL, n + 1, VipsPel *))) { ++ vips_arithmetic_stop(seq, NULL, NULL); ++ return (NULL); + } + +- return( seq ); ++ return (seq); + } + + static int +-vips_arithmetic_gen( VipsRegion *or, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_arithmetic_gen(VipsRegion * or, ++ void *vseq, void *a, void *b, gboolean *stop) + { + VipsArithmeticSequence *seq = (VipsArithmeticSequence *) vseq; + VipsRegion **ir = seq->ir; +- VipsArithmetic *arithmetic = VIPS_ARITHMETIC( b ); +- VipsArithmeticClass *class = VIPS_ARITHMETIC_GET_CLASS( arithmetic ); +- VipsRect *r = &or->valid; ++ VipsArithmetic *arithmetic = VIPS_ARITHMETIC(b); ++ VipsArithmeticClass *class = VIPS_ARITHMETIC_GET_CLASS(arithmetic); ++ VipsRect *r = & or->valid; + + VipsPel *q; + int i, y; + + /* Prepare all input regions and make buffer pointers. + */ +- if( vips_reorder_prepare_many( or->im, ir, r ) ) +- return( -1 ); +- for( i = 0; ir[i]; i++ ) +- seq->p[i] = (VipsPel *) +- VIPS_REGION_ADDR( ir[i], r->left, r->top ); ++ if (vips_reorder_prepare_many(or->im, ir, r)) ++ return (-1); ++ for (i = 0; ir[i]; i++) ++ seq->p[i] = (VipsPel *) ++ VIPS_REGION_ADDR(ir[i], r->left, r->top); + seq->p[i] = NULL; +- q = (VipsPel *) VIPS_REGION_ADDR( or, r->left, r->top ); ++ q = (VipsPel *) VIPS_REGION_ADDR(or, r->left, r->top); + +- VIPS_GATE_START( "vips_arithmetic_gen: work" ); ++ VIPS_GATE_START("vips_arithmetic_gen: work"); + +- for( y = 0; y < r->height; y++ ) { +- class->process_line( arithmetic, q, seq->p, r->width ); ++ for (y = 0; y < r->height; y++) { ++ class->process_line(arithmetic, q, seq->p, r->width); + +- for( i = 0; ir[i]; i++ ) +- seq->p[i] += VIPS_REGION_LSKIP( ir[i] ); +- q += VIPS_REGION_LSKIP( or ); ++ for (i = 0; ir[i]; i++) ++ seq->p[i] += VIPS_REGION_LSKIP(ir[i]); ++ q += VIPS_REGION_LSKIP(or); + } + +- VIPS_GATE_STOP( "vips_arithmetic_gen: work" ); ++ VIPS_GATE_STOP("vips_arithmetic_gen: work"); + +- VIPS_COUNT_PIXELS( or, VIPS_OBJECT_CLASS( class )->nickname ); ++ VIPS_COUNT_PIXELS(or, VIPS_OBJECT_CLASS(class)->nickname); + +- return( 0 ); ++ return (0); + } + + static int +-vips_arithmetic_build( VipsObject *object ) ++vips_arithmetic_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsArithmetic *arithmetic = VIPS_ARITHMETIC( object ); +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_GET_CLASS( arithmetic ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsArithmetic *arithmetic = VIPS_ARITHMETIC(object); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_GET_CLASS(arithmetic); + + VipsImage **decode; + VipsImage **format; +@@ -654,123 +653,122 @@ vips_arithmetic_build( VipsObject *object ) + int i; + + #ifdef DEBUG +- printf( "vips_arithmetic_build: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_arithmetic_build: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- if( VIPS_OBJECT_CLASS( vips_arithmetic_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_arithmetic_parent_class)->build(object)) ++ return (-1); + +- g_object_set( arithmetic, "out", vips_image_new(), NULL ); ++ g_object_set(arithmetic, "out", vips_image_new(), NULL); + +- decode = (VipsImage **) +- vips_object_local_array( object, arithmetic->n ); +- format = (VipsImage **) +- vips_object_local_array( object, arithmetic->n ); +- band = (VipsImage **) +- vips_object_local_array( object, arithmetic->n ); +- size = (VipsImage **) +- vips_object_local_array( object, arithmetic->n ); ++ decode = (VipsImage **) ++ vips_object_local_array(object, arithmetic->n); ++ format = (VipsImage **) ++ vips_object_local_array(object, arithmetic->n); ++ band = (VipsImage **) ++ vips_object_local_array(object, arithmetic->n); ++ size = (VipsImage **) ++ vips_object_local_array(object, arithmetic->n); + + /* Decode RAD/LABQ etc. + */ +- for( i = 0; i < arithmetic->n; i++ ) +- if( vips_image_decode( arithmetic->in[i], &decode[i] ) ) +- return( -1 ); ++ for (i = 0; i < arithmetic->n; i++) ++ if (vips_image_decode(arithmetic->in[i], &decode[i])) ++ return (-1); + + /* Cast our input images up to a common format, bands and size. + */ +- if( vips__formatalike_vec( decode, format, arithmetic->n ) || +- vips__bandalike_vec( class->nickname, +- format, band, arithmetic->n, arithmetic->base_bands ) || +- vips__sizealike_vec( band, size, arithmetic->n ) ) +- return( -1 ); ++ if (vips__formatalike_vec(decode, format, arithmetic->n) || ++ vips__bandalike_vec(class->nickname, ++ format, band, arithmetic->n, arithmetic->base_bands) || ++ vips__sizealike_vec(band, size, arithmetic->n)) ++ return (-1); + + /* Keep a copy of the processed images here for subclasses. + */ + arithmetic->ready = size; + +- if( vips_image_pipeline_array( arithmetic->out, +- VIPS_DEMAND_STYLE_THINSTRIP, arithmetic->ready ) ) +- return( -1 ); ++ if (vips_image_pipeline_array(arithmetic->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, arithmetic->ready)) ++ return (-1); + + arithmetic->out->Bands = arithmetic->ready[0]->Bands; +- if( arithmetic->format != VIPS_FORMAT_NOTSET ) ++ if (arithmetic->format != VIPS_FORMAT_NOTSET) + arithmetic->out->BandFmt = arithmetic->format; + else +- arithmetic->out->BandFmt = ++ arithmetic->out->BandFmt = + aclass->format_table[arithmetic->ready[0]->BandFmt]; + +- if( vips_image_generate( arithmetic->out, +- vips_arithmetic_start, +- vips_arithmetic_gen, +- vips_arithmetic_stop, +- arithmetic->ready, arithmetic ) ) +- return( -1 ); ++ if (vips_image_generate(arithmetic->out, ++ vips_arithmetic_start, ++ vips_arithmetic_gen, ++ vips_arithmetic_stop, ++ arithmetic->ready, arithmetic)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_arithmetic_class_init( VipsArithmeticClass *class ) ++vips_arithmetic_class_init(VipsArithmeticClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "arithmetic"; +- vobject_class->description = _( "arithmetic operations" ); ++ vobject_class->description = _("arithmetic operations"); + vobject_class->build = vips_arithmetic_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "out", 100, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsArithmetic, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 100, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsArithmetic, out)); + } + + static void +-vips_arithmetic_init( VipsArithmetic *arithmetic ) ++vips_arithmetic_init(VipsArithmetic *arithmetic) + { + arithmetic->base_bands = 1; + arithmetic->format = VIPS_FORMAT_NOTSET; + } + +-void +-vips_arithmetic_set_format_table( VipsArithmeticClass *class, +- const VipsBandFormat *format_table ) ++void ++vips_arithmetic_set_format_table(VipsArithmeticClass *class, ++ const VipsBandFormat *format_table) + { +- g_assert( !class->format_table ); ++ g_assert(!class->format_table); + + class->format_table = format_table; + } + +-void +-vips_arithmetic_set_vector( VipsArithmeticClass *class ) ++void ++vips_arithmetic_set_vector(VipsArithmeticClass *class) + { + int i; + +- g_assert( class->format_table ); ++ g_assert(class->format_table); + +- for( i = 0; i < VIPS_FORMAT_LAST; i++ ) { +- int isize = vips_format_sizeof( i ); +- int osize = vips_format_sizeof( (int) class->format_table[i] ); ++ for (i = 0; i < VIPS_FORMAT_LAST; i++) { ++ int isize = vips_format_sizeof(i); ++ int osize = vips_format_sizeof((int) class->format_table[i]); + + VipsVector *v; + +- v = vips_vector_new( "arithmetic", osize ); ++ v = vips_vector_new("arithmetic", osize); + +- vips_vector_source_name( v, "s1", isize ); +- vips_vector_source_name( v, "s2", isize ); +- vips_vector_temporary( v, "t1", osize ); +- vips_vector_temporary( v, "t2", osize ); ++ vips_vector_source_name(v, "s1", isize); ++ vips_vector_source_name(v, "s2", isize); ++ vips_vector_temporary(v, "t1", osize); ++ vips_vector_temporary(v, "t2", osize); + + class->vectors[i] = v; + } +@@ -780,52 +778,52 @@ vips_arithmetic_set_vector( VipsArithmeticClass *class ) + * code. + */ + VipsVector * +-vips_arithmetic_get_program( VipsArithmeticClass *class, VipsBandFormat fmt ) ++vips_arithmetic_get_program(VipsArithmeticClass *class, VipsBandFormat fmt) + { +- g_assert( (int) fmt >= 0 && (int) fmt < VIPS_FORMAT_LAST ); +- g_assert( !class->vector_program[fmt] ); ++ g_assert((int) fmt >= 0 && (int) fmt < VIPS_FORMAT_LAST); ++ g_assert(!class->vector_program[fmt]); + + class->vector_program[fmt] = TRUE; + +- return( class->vectors[fmt] ); ++ return (class->vectors[fmt]); + } + + /* Get the compiled code for this type, if available. + */ + VipsVector * +-vips_arithmetic_get_vector( VipsArithmeticClass *class, VipsBandFormat fmt ) ++vips_arithmetic_get_vector(VipsArithmeticClass *class, VipsBandFormat fmt) + { +- g_assert( fmt >= 0 && fmt < VIPS_FORMAT_LAST ); ++ g_assert(fmt >= 0 && fmt < VIPS_FORMAT_LAST); + +- if( !vips_vector_isenabled() || +- !class->vector_program[fmt] ) +- return( NULL ); ++ if (!vips_vector_isenabled() || ++ !class->vector_program[fmt]) ++ return (NULL); + +- return( class->vectors[fmt] ); ++ return (class->vectors[fmt]); + } + + void +-vips_arithmetic_compile( VipsArithmeticClass *class ) ++vips_arithmetic_compile(VipsArithmeticClass *class) + { + int i; + +- g_assert( class->format_table ); ++ g_assert(class->format_table); + +- for( i = 0; i < VIPS_FORMAT_LAST; i++ ) +- if( class->vector_program[i] && +- !vips_vector_compile( class->vectors[i] ) ) ++ for (i = 0; i < VIPS_FORMAT_LAST; i++) ++ if (class->vector_program[i] && ++ !vips_vector_compile(class->vectors[i])) + /* If compilation fails, turn off the vector for this + * type. + */ + class->vector_program[i] = FALSE; + + #ifdef DEBUG +- printf( "vips_arithmetic_compile: " ); +- for( i = 0; i < VIPS_FORMAT_LAST; i++ ) +- if( class->vector_program[i] ) +- printf( "%s ", +- vips_enum_nick( VIPS_TYPE_BAND_FORMAT, i ) ); +- printf( "\n" ); ++ printf("vips_arithmetic_compile: "); ++ for (i = 0; i < VIPS_FORMAT_LAST; i++) ++ if (class->vector_program[i]) ++ printf("%s ", ++ vips_enum_nick(VIPS_TYPE_BAND_FORMAT, i)); ++ printf("\n"); + #endif /*DEBUG*/ + } + +@@ -833,46 +831,46 @@ vips_arithmetic_compile( VipsArithmeticClass *class ) + * instead? + */ + void +-vips_arithmetic_operation_init( void ) ++vips_arithmetic_operation_init(void) + { +- extern GType vips_add_get_type( void ); +- extern GType vips_sum_get_type( void ); +- extern GType vips_subtract_get_type( void ); +- extern GType vips_multiply_get_type( void ); +- extern GType vips_divide_get_type( void ); +- extern GType vips_invert_get_type( void ); +- extern GType vips_avg_get_type( void ); +- extern GType vips_min_get_type( void ); +- extern GType vips_max_get_type( void ); +- extern GType vips_deviate_get_type( void ); +- extern GType vips_linear_get_type( void ); +- extern GType vips_math_get_type( void ); +- extern GType vips_abs_get_type( void ); +- extern GType vips_sign_get_type( void ); +- extern GType vips_stats_get_type( void ); +- extern GType vips_hist_find_get_type( void ); +- extern GType vips_hist_find_ndim_get_type( void ); +- extern GType vips_hist_find_indexed_get_type( void ); +- extern GType vips_hough_line_get_type( void ); +- extern GType vips_hough_circle_get_type( void ); +- extern GType vips_project_get_type( void ); +- extern GType vips_profile_get_type( void ); +- extern GType vips_measure_get_type( void ); +- extern GType vips_getpoint_get_type( void ); +- extern GType vips_round_get_type( void ); +- extern GType vips_relational_get_type( void ); +- extern GType vips_relational_const_get_type( void ); +- extern GType vips_remainder_get_type( void ); +- extern GType vips_remainder_const_get_type( void ); +- extern GType vips_boolean_get_type( void ); +- extern GType vips_boolean_const_get_type( void ); +- extern GType vips_math2_get_type( void ); +- extern GType vips_math2_const_get_type( void ); +- extern GType vips_complex_get_type( void ); +- extern GType vips_complex2_get_type( void ); +- extern GType vips_complexget_get_type( void ); +- extern GType vips_complexform_get_type( void ); +- extern GType vips_find_trim_get_type( void ); ++ extern GType vips_add_get_type(void); ++ extern GType vips_sum_get_type(void); ++ extern GType vips_subtract_get_type(void); ++ extern GType vips_multiply_get_type(void); ++ extern GType vips_divide_get_type(void); ++ extern GType vips_invert_get_type(void); ++ extern GType vips_avg_get_type(void); ++ extern GType vips_min_get_type(void); ++ extern GType vips_max_get_type(void); ++ extern GType vips_deviate_get_type(void); ++ extern GType vips_linear_get_type(void); ++ extern GType vips_math_get_type(void); ++ extern GType vips_abs_get_type(void); ++ extern GType vips_sign_get_type(void); ++ extern GType vips_stats_get_type(void); ++ extern GType vips_hist_find_get_type(void); ++ extern GType vips_hist_find_ndim_get_type(void); ++ extern GType vips_hist_find_indexed_get_type(void); ++ extern GType vips_hough_line_get_type(void); ++ extern GType vips_hough_circle_get_type(void); ++ extern GType vips_project_get_type(void); ++ extern GType vips_profile_get_type(void); ++ extern GType vips_measure_get_type(void); ++ extern GType vips_getpoint_get_type(void); ++ extern GType vips_round_get_type(void); ++ extern GType vips_relational_get_type(void); ++ extern GType vips_relational_const_get_type(void); ++ extern GType vips_remainder_get_type(void); ++ extern GType vips_remainder_const_get_type(void); ++ extern GType vips_boolean_get_type(void); ++ extern GType vips_boolean_const_get_type(void); ++ extern GType vips_math2_get_type(void); ++ extern GType vips_math2_const_get_type(void); ++ extern GType vips_complex_get_type(void); ++ extern GType vips_complex2_get_type(void); ++ extern GType vips_complexget_get_type(void); ++ extern GType vips_complexform_get_type(void); ++ extern GType vips_find_trim_get_type(void); + + vips_add_get_type(); + vips_sum_get_type(); +@@ -889,27 +887,27 @@ vips_arithmetic_operation_init( void ) + vips_abs_get_type(); + vips_sign_get_type(); + vips_stats_get_type(); +- vips_hist_find_get_type(); +- vips_hist_find_ndim_get_type(); +- vips_hist_find_indexed_get_type(); +- vips_hough_line_get_type(); +- vips_hough_circle_get_type(); +- vips_project_get_type(); +- vips_profile_get_type(); ++ vips_hist_find_get_type(); ++ vips_hist_find_ndim_get_type(); ++ vips_hist_find_indexed_get_type(); ++ vips_hough_line_get_type(); ++ vips_hough_circle_get_type(); ++ vips_project_get_type(); ++ vips_profile_get_type(); + vips_measure_get_type(); + vips_getpoint_get_type(); + vips_round_get_type(); + vips_relational_get_type(); +- vips_relational_const_get_type(); ++ vips_relational_const_get_type(); + vips_remainder_get_type(); +- vips_remainder_const_get_type(); +- vips_boolean_get_type(); +- vips_boolean_const_get_type(); +- vips_math2_get_type(); +- vips_math2_const_get_type(); +- vips_complex_get_type(); +- vips_complex2_get_type(); +- vips_complexget_get_type(); +- vips_complexform_get_type(); +- vips_find_trim_get_type(); ++ vips_remainder_const_get_type(); ++ vips_boolean_get_type(); ++ vips_boolean_const_get_type(); ++ vips_math2_get_type(); ++ vips_math2_const_get_type(); ++ vips_complex_get_type(); ++ vips_complex2_get_type(); ++ vips_complexget_get_type(); ++ vips_complexform_get_type(); ++ vips_find_trim_get_type(); + } +diff --git a/libvips/arithmetic/avg.c b/libvips/arithmetic/avg.c +index 1390ff109f..85acbc9790 100644 +--- a/libvips/arithmetic/avg.c ++++ b/libvips/arithmetic/avg.c +@@ -4,7 +4,7 @@ + * + * Author: J. Cupitt + * Written on: 02/08/1990 +- * Modified on: ++ * Modified on: + * 5/5/93 JC + * - now does partial images + * - less likely to overflow +@@ -18,7 +18,7 @@ + * 20/6/95 JC + * - now returns double + * 13/1/05 +- * - use 64 bit arithmetic ++ * - use 64 bit arithmetic + * 8/12/06 + * - add liboil support + * 18/8/09 +@@ -38,28 +38,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -86,81 +86,83 @@ typedef struct _VipsAvg { + + typedef VipsStatisticClass VipsAvgClass; + +-G_DEFINE_TYPE( VipsAvg, vips_avg, VIPS_TYPE_STATISTIC ); ++G_DEFINE_TYPE(VipsAvg, vips_avg, VIPS_TYPE_STATISTIC); + + static int +-vips_avg_build( VipsObject *object ) ++vips_avg_build(VipsObject *object) + { +- VipsStatistic *statistic = VIPS_STATISTIC( object ); ++ VipsStatistic *statistic = VIPS_STATISTIC(object); + VipsAvg *avg = (VipsAvg *) object; + + gint64 vals; + double average; + +- if( VIPS_OBJECT_CLASS( vips_avg_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_avg_parent_class)->build(object)) ++ return (-1); + +- vals = (gint64) +- vips_image_get_width( statistic->in ) * +- vips_image_get_height( statistic->in ) * +- vips_image_get_bands( statistic->in ); ++ vals = (gint64) ++ vips_image_get_width(statistic->in) * ++ vips_image_get_height(statistic->in) * ++ vips_image_get_bands(statistic->in); + average = avg->sum / vals; +- g_object_set( object, "out", average, NULL ); ++ g_object_set(object, "out", average, NULL); + +- return( 0 ); ++ return (0); + } + + /* Start function: allocate space for a double in which we can accumulate the + * sum for this thread. + */ + static void * +-vips_avg_start( VipsStatistic *statistic ) ++vips_avg_start(VipsStatistic *statistic) + { +- return( (void *) g_new0( double, 1 ) ); ++ return ((void *) g_new0(double, 1)); + } + + /* Stop function. Add this little sum to the main sum. + */ + static int +-vips_avg_stop( VipsStatistic *statistic, void *seq ) ++vips_avg_stop(VipsStatistic *statistic, void *seq) + { + VipsAvg *avg = (VipsAvg *) statistic; + double *sum = (double *) seq; + + avg->sum += *sum; + +- g_free( seq ); ++ g_free(seq); + +- return( 0 ); ++ return (0); + } + + /* Sum pels in this section. + */ +-#define LOOP( TYPE ) { \ +- TYPE *p = (TYPE *) in; \ +- \ +- for( i = 0; i < sz; i++ ) \ +- m += p[i]; \ +-} ++#define LOOP(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) in; \ ++\ ++ for (i = 0; i < sz; i++) \ ++ m += p[i]; \ ++ } + +-#define CLOOP( TYPE ) { \ +- TYPE *p = (TYPE *) in; \ +- \ +- for( i = 0; i < sz; i++ ) { \ +- double mod = sqrt( p[0] * p[0] + p[1] * p[1] ); \ +- \ +- m += mod; \ +- p += 2; \ +- } \ +-} ++#define CLOOP(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) in; \ ++\ ++ for (i = 0; i < sz; i++) { \ ++ double mod = sqrt(p[0] * p[0] + p[1] * p[1]); \ ++\ ++ m += mod; \ ++ p += 2; \ ++ } \ ++ } + + /* Loop over region, accumulating a sum in *tmp. + */ + static int +-vips_avg_scan( VipsStatistic *statistic, void *seq, +- int x, int y, void *in, int n ) ++vips_avg_scan(VipsStatistic *statistic, void *seq, ++ int x, int y, void *in, int n) + { +- const int sz = n * vips_image_get_bands( statistic->in ); ++ const int sz = n * vips_image_get_bands(statistic->in); + + double *sum = (double *) seq; + +@@ -169,69 +171,88 @@ vips_avg_scan( VipsStatistic *statistic, void *seq, + + m = *sum; + +- /* Now generate code for all types. ++ /* Now generate code for all types. + */ +- switch( vips_image_get_format( statistic->in ) ) { +- case VIPS_FORMAT_UCHAR: LOOP( unsigned char ); break; +- case VIPS_FORMAT_CHAR: LOOP( signed char ); break; +- case VIPS_FORMAT_USHORT: LOOP( unsigned short ); break; +- case VIPS_FORMAT_SHORT: LOOP( signed short ); break; +- case VIPS_FORMAT_UINT: LOOP( unsigned int ); break; +- case VIPS_FORMAT_INT: LOOP( signed int ); break; +- case VIPS_FORMAT_FLOAT: LOOP( float ); break; +- case VIPS_FORMAT_DOUBLE: LOOP( double ); break; +- case VIPS_FORMAT_COMPLEX: CLOOP( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: CLOOP( double ); break; +- +- default: ++ switch (vips_image_get_format(statistic->in)) { ++ case VIPS_FORMAT_UCHAR: ++ LOOP(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ LOOP(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ LOOP(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ LOOP(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ LOOP(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ LOOP(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ LOOP(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ LOOP(double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ CLOOP(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ CLOOP(double); ++ break; ++ ++ default: + g_assert_not_reached(); + } + + *sum = m; + +- return( 0 ); ++ return (0); + } + + static void +-vips_avg_class_init( VipsAvgClass *class ) ++vips_avg_class_init(VipsAvgClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS( class ); ++ VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "avg"; +- object_class->description = _( "find image average" ); ++ object_class->description = _("find image average"); + object_class->build = vips_avg_build; + + sclass->start = vips_avg_start; + sclass->scan = vips_avg_scan; + sclass->stop = vips_avg_stop; + +- VIPS_ARG_DOUBLE( class, "out", 2, +- _( "Output" ), +- _( "Output value" ), ++ VIPS_ARG_DOUBLE(class, "out", 2, ++ _("Output"), ++ _("Output value"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsAvg, out ), +- -INFINITY, INFINITY, 0.0 ); ++ G_STRUCT_OFFSET(VipsAvg, out), ++ -INFINITY, INFINITY, 0.0); + } + + static void +-vips_avg_init( VipsAvg *avg ) ++vips_avg_init(VipsAvg *avg) + { + } + +- + /** + * vips_avg: (method) + * @in: input #VipsImage + * @out: (out): output pixel average + * @...: %NULL-terminated list of optional named arguments + * +- * This operation finds the average value in an image. It operates on all +- * bands of the input image: use vips_stats() if you need to calculate an ++ * This operation finds the average value in an image. It operates on all ++ * bands of the input image: use vips_stats() if you need to calculate an + * average for each band. For complex images, return the average modulus. + * + * See also: vips_stats(), vips_bandmean(), vips_deviate(), vips_rank() +@@ -239,14 +260,14 @@ vips_avg_init( VipsAvg *avg ) + * Returns: 0 on success, -1 on error + */ + int +-vips_avg( VipsImage *in, double *out, ... ) ++vips_avg(VipsImage *in, double *out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "avg", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("avg", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/binary.c b/libvips/arithmetic/binary.c +index b9ad225483..e76f59da6d 100644 +--- a/libvips/arithmetic/binary.c ++++ b/libvips/arithmetic/binary.c +@@ -10,28 +10,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -52,62 +52,61 @@ + + #include "binary.h" + +-G_DEFINE_ABSTRACT_TYPE( VipsBinary, vips_binary, VIPS_TYPE_ARITHMETIC ); ++G_DEFINE_ABSTRACT_TYPE(VipsBinary, vips_binary, VIPS_TYPE_ARITHMETIC); + + static int +-vips_binary_build( VipsObject *object ) ++vips_binary_build(VipsObject *object) + { +- VipsArithmetic *arithmetic = VIPS_ARITHMETIC( object ); +- VipsBinary *binary = VIPS_BINARY( object ); ++ VipsArithmetic *arithmetic = VIPS_ARITHMETIC(object); ++ VipsBinary *binary = VIPS_BINARY(object); + + arithmetic->n = 2; +- arithmetic->in = (VipsImage **) vips_object_local_array( object, 2 ); ++ arithmetic->in = (VipsImage **) vips_object_local_array(object, 2); + arithmetic->in[0] = binary->left; + arithmetic->in[1] = binary->right; + +- if( arithmetic->in[0] ) +- g_object_ref( arithmetic->in[0] ); +- if( arithmetic->in[1] ) +- g_object_ref( arithmetic->in[1] ); ++ if (arithmetic->in[0]) ++ g_object_ref(arithmetic->in[0]); ++ if (arithmetic->in[1]) ++ g_object_ref(arithmetic->in[1]); + +- if( VIPS_OBJECT_CLASS( vips_binary_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_binary_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_binary_class_init( VipsBinaryClass *class ) ++vips_binary_class_init(VipsBinaryClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "binary"; +- vobject_class->description = _( "binary operations" ); ++ vobject_class->description = _("binary operations"); + vobject_class->build = vips_binary_build; + + /* Create properties. + */ + +- VIPS_ARG_IMAGE( class, "left", 1, +- _( "Left" ), +- _( "Left-hand image argument" ), ++ VIPS_ARG_IMAGE(class, "left", 1, ++ _("Left"), ++ _("Left-hand image argument"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBinary, left ) ); ++ G_STRUCT_OFFSET(VipsBinary, left)); + +- VIPS_ARG_IMAGE( class, "right", 2, +- _( "Right" ), +- _( "Right-hand image argument" ), ++ VIPS_ARG_IMAGE(class, "right", 2, ++ _("Right"), ++ _("Right-hand image argument"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBinary, right ) ); +- ++ G_STRUCT_OFFSET(VipsBinary, right)); + } + + static void +-vips_binary_init( VipsBinary *binary ) ++vips_binary_init(VipsBinary *binary) + { + /* Init our instance fields. + */ +diff --git a/libvips/arithmetic/binary.h b/libvips/arithmetic/binary.h +index 7897454704..80913a1e0e 100644 +--- a/libvips/arithmetic/binary.h ++++ b/libvips/arithmetic/binary.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -40,16 +40,16 @@ extern "C" { + #include "parithmetic.h" + + #define VIPS_TYPE_BINARY (vips_binary_get_type()) +-#define VIPS_BINARY( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), VIPS_TYPE_BINARY, VipsBinary )) +-#define VIPS_BINARY_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), VIPS_TYPE_BINARY, VipsBinaryClass)) +-#define VIPS_IS_BINARY( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_BINARY )) +-#define VIPS_IS_BINARY_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_BINARY )) +-#define VIPS_BINARY_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), VIPS_TYPE_BINARY, VipsBinaryClass )) ++#define VIPS_BINARY(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), VIPS_TYPE_BINARY, VipsBinary)) ++#define VIPS_BINARY_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), VIPS_TYPE_BINARY, VipsBinaryClass)) ++#define VIPS_IS_BINARY(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_BINARY)) ++#define VIPS_IS_BINARY_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_BINARY)) ++#define VIPS_BINARY_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), VIPS_TYPE_BINARY, VipsBinaryClass)) + + typedef struct _VipsBinary { + VipsArithmetic parent_instance; +@@ -63,12 +63,10 @@ typedef struct _VipsBinary { + + typedef VipsArithmeticClass VipsBinaryClass; + +-GType vips_binary_get_type( void ); ++GType vips_binary_get_type(void); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_BINARY_H*/ +- +- +diff --git a/libvips/arithmetic/boolean.c b/libvips/arithmetic/boolean.c +index 50d87c35e3..e58390b41e 100644 +--- a/libvips/arithmetic/boolean.c ++++ b/libvips/arithmetic/boolean.c +@@ -1,6 +1,6 @@ + /* boolean.c --- various bit operations + * +- * Modified: ++ * Modified: + * 15/12/94 JC + * - ANSIfied + * - adapted to partials with im_wrap... +@@ -22,7 +22,7 @@ + * - now cast float/complex args to int + * 11/9/09 + * - use new im__cast_and__call() +- * - therefore now supports 1-band $op n-band ++ * - therefore now supports 1-band $op n-band + * 17/9/09 + * - moved to im__arith_binary*() + * - renamed im_eor_vec() as im_eorimage_vec() for C++ sanity +@@ -35,28 +35,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -87,120 +87,147 @@ typedef struct _VipsBoolean { + + typedef VipsBinaryClass VipsBooleanClass; + +-G_DEFINE_TYPE( VipsBoolean, vips_boolean, VIPS_TYPE_BINARY ); ++G_DEFINE_TYPE(VipsBoolean, vips_boolean, VIPS_TYPE_BINARY); + + static int +-vips_boolean_build( VipsObject *object ) ++vips_boolean_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsBinary *binary = (VipsBinary *) object; + +- if( binary->left && +- vips_check_noncomplex( class->nickname, binary->left ) ) +- return( -1 ); +- if( binary->right && +- vips_check_noncomplex( class->nickname, binary->right ) ) +- return( -1 ); ++ if (binary->left && ++ vips_check_noncomplex(class->nickname, binary->left)) ++ return (-1); ++ if (binary->right && ++ vips_check_noncomplex(class->nickname, binary->right)) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_boolean_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_boolean_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-#define LOOP( TYPE, OP ) { \ +- TYPE * restrict left = (TYPE *) in[0]; \ +- TYPE * restrict right = (TYPE *) in[1]; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = left[x] OP right[x]; \ +-} ++#define LOOP(TYPE, OP) \ ++ { \ ++ TYPE *restrict left = (TYPE *) in[0]; \ ++ TYPE *restrict right = (TYPE *) in[1]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = left[x] OP right[x]; \ ++ } + +-#define FLOOP( TYPE, OP ) { \ +- TYPE * restrict left = (TYPE *) in[0]; \ +- TYPE * restrict right = (TYPE *) in[1]; \ +- int * restrict q = (int *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = ((int) left[x]) OP ((int) right[x]); \ +-} ++#define FLOOP(TYPE, OP) \ ++ { \ ++ TYPE *restrict left = (TYPE *) in[0]; \ ++ TYPE *restrict right = (TYPE *) in[1]; \ ++ int *restrict q = (int *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = ((int) left[x]) OP((int) right[x]); \ ++ } + +-#define SWITCH( I, F, OP ) \ +- switch( vips_image_get_format( im ) ) { \ +- case VIPS_FORMAT_UCHAR: I( unsigned char, OP ); break; \ +- case VIPS_FORMAT_CHAR: I( signed char, OP ); break; \ +- case VIPS_FORMAT_USHORT: I( unsigned short, OP ); break; \ +- case VIPS_FORMAT_SHORT: I( signed short, OP ); break; \ +- case VIPS_FORMAT_UINT: I( unsigned int, OP ); break; \ +- case VIPS_FORMAT_INT: I( signed int, OP ); break; \ +- case VIPS_FORMAT_FLOAT: F( float, OP ); break; \ +- case VIPS_FORMAT_DOUBLE: F( double, OP ); break;\ +- \ ++#define SWITCH(I, F, OP) \ ++ switch (vips_image_get_format(im)) { \ ++ case VIPS_FORMAT_UCHAR: \ ++ I(unsigned char, OP); \ ++ break; \ ++ case VIPS_FORMAT_CHAR: \ ++ I(signed char, OP); \ ++ break; \ ++ case VIPS_FORMAT_USHORT: \ ++ I(unsigned short, OP); \ ++ break; \ ++ case VIPS_FORMAT_SHORT: \ ++ I(signed short, OP); \ ++ break; \ ++ case VIPS_FORMAT_UINT: \ ++ I(unsigned int, OP); \ ++ break; \ ++ case VIPS_FORMAT_INT: \ ++ I(signed int, OP); \ ++ break; \ ++ case VIPS_FORMAT_FLOAT: \ ++ F(float, OP); \ ++ break; \ ++ case VIPS_FORMAT_DOUBLE: \ ++ F(double, OP); \ ++ break; \ ++\ + default: \ + g_assert_not_reached(); \ +- } +- +-#define FNLOOP( TYPE, FN ) { \ +- TYPE * restrict left = (TYPE *) in[0]; \ +- TYPE * restrict right = (TYPE *) in[1]; \ +- int * restrict q = (int *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = FN( left[x], right[x] ); \ +-} ++ } ++ ++#define FNLOOP(TYPE, FN) \ ++ { \ ++ TYPE *restrict left = (TYPE *) in[0]; \ ++ TYPE *restrict right = (TYPE *) in[1]; \ ++ int *restrict q = (int *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = FN(left[x], right[x]); \ ++ } + + static void +-vips_boolean_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_boolean_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsBoolean *boolean = (VipsBoolean *) arithmetic; + VipsImage *im = arithmetic->ready[0]; +- const int sz = width * vips_image_get_bands( im ); ++ const int sz = width * vips_image_get_bands(im); + + int x; + +- switch( boolean->operation ) { +- case VIPS_OPERATION_BOOLEAN_AND: +- SWITCH( LOOP, FLOOP, & ); ++ switch (boolean->operation) { ++ case VIPS_OPERATION_BOOLEAN_AND: ++ SWITCH(LOOP, FLOOP, &); + break; + +- case VIPS_OPERATION_BOOLEAN_OR: +- SWITCH( LOOP, FLOOP, | ); ++ case VIPS_OPERATION_BOOLEAN_OR: ++ SWITCH(LOOP, FLOOP, |); + break; + +- case VIPS_OPERATION_BOOLEAN_EOR: +- SWITCH( LOOP, FLOOP, ^ ); ++ case VIPS_OPERATION_BOOLEAN_EOR: ++ SWITCH(LOOP, FLOOP, ^); + break; + + /* Special case: we need to be able to use VIPS_LSHIFT_INT(). + */ +- case VIPS_OPERATION_BOOLEAN_LSHIFT: +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_UCHAR: +- LOOP( unsigned char, << ); break; ++ case VIPS_OPERATION_BOOLEAN_LSHIFT: ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_UCHAR: ++ LOOP(unsigned char, <<); ++ break; + case VIPS_FORMAT_CHAR: +- FNLOOP( signed char, VIPS_LSHIFT_INT ); break; ++ FNLOOP(signed char, VIPS_LSHIFT_INT); ++ break; + case VIPS_FORMAT_USHORT: +- LOOP( unsigned short, << ); break; ++ LOOP(unsigned short, <<); ++ break; + case VIPS_FORMAT_SHORT: +- FNLOOP( signed short, VIPS_LSHIFT_INT ); break; ++ FNLOOP(signed short, VIPS_LSHIFT_INT); ++ break; + case VIPS_FORMAT_UINT: +- LOOP( unsigned int, << ); break; ++ LOOP(unsigned int, <<); ++ break; + case VIPS_FORMAT_INT: +- FNLOOP( signed int, VIPS_LSHIFT_INT ); break; ++ FNLOOP(signed int, VIPS_LSHIFT_INT); ++ break; + case VIPS_FORMAT_FLOAT: +- FLOOP( float, << ); break; ++ FLOOP(float, <<); ++ break; + case VIPS_FORMAT_DOUBLE: +- FLOOP( double, << ); break; +- +- default: +- g_assert_not_reached(); +- } ++ FLOOP(double, <<); ++ break; ++ ++ default: ++ g_assert_not_reached(); ++ } + break; + +- case VIPS_OPERATION_BOOLEAN_RSHIFT: +- SWITCH( LOOP, FLOOP, >> ); ++ case VIPS_OPERATION_BOOLEAN_RSHIFT: ++ SWITCH(LOOP, FLOOP, >>); + break; + + default: +@@ -221,7 +248,7 @@ vips_boolean_buffer( VipsArithmetic *arithmetic, + #define D VIPS_FORMAT_DOUBLE + #define DX VIPS_FORMAT_DPCOMPLEX + +-/* Type conversions for boolean. ++/* Type conversions for boolean. + */ + static const VipsBandFormat vips_boolean_format_table[10] = { + /* Band format: UC C US S UI I F X D DX */ +@@ -229,43 +256,43 @@ static const VipsBandFormat vips_boolean_format_table[10] = { + }; + + static void +-vips_boolean_class_init( VipsBooleanClass *class ) ++vips_boolean_class_init(VipsBooleanClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "boolean"; +- object_class->description = _( "boolean operation on two images" ); ++ object_class->description = _("boolean operation on two images"); + object_class->build = vips_boolean_build; + + aclass->process_line = vips_boolean_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_boolean_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_boolean_format_table); + +- VIPS_ARG_ENUM( class, "boolean", 200, +- _( "Operation" ), +- _( "Boolean to perform" ), ++ VIPS_ARG_ENUM(class, "boolean", 200, ++ _("Operation"), ++ _("Boolean to perform"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBoolean, operation ), +- VIPS_TYPE_OPERATION_BOOLEAN, +- VIPS_OPERATION_BOOLEAN_AND ); ++ G_STRUCT_OFFSET(VipsBoolean, operation), ++ VIPS_TYPE_OPERATION_BOOLEAN, ++ VIPS_OPERATION_BOOLEAN_AND); + } + + static void +-vips_boolean_init( VipsBoolean *boolean ) ++vips_boolean_init(VipsBoolean *boolean) + { + } + + static int +-vips_booleanv( VipsImage *left, VipsImage *right, VipsImage **out, +- VipsOperationBoolean operation, va_list ap ) ++vips_booleanv(VipsImage *left, VipsImage *right, VipsImage **out, ++ VipsOperationBoolean operation, va_list ap) + { +- return( vips_call_split( "boolean", ap, left, right, out, +- operation ) ); ++ return (vips_call_split("boolean", ap, left, right, out, ++ operation)); + } + + /** +@@ -276,7 +303,7 @@ vips_booleanv( VipsImage *left, VipsImage *right, VipsImage **out, + * @boolean: boolean operation to perform + * @...: %NULL-terminated list of optional named arguments + * +- * Perform various boolean operations on pairs of images. ++ * Perform various boolean operations on pairs of images. + * + * The output image is the same format as the upcast input images for integer + * types. Float types are cast to int before processing. Complex types are not +@@ -285,13 +312,13 @@ vips_booleanv( VipsImage *left, VipsImage *right, VipsImage **out, + * If the images differ in size, the smaller image is enlarged to match the + * larger by adding zero pixels along the bottom and right. + * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +- * The two input images are cast up to the smallest common format (see table +- * Smallest common format in ++ * The two input images are cast up to the smallest common format (see table ++ * Smallest common format in + * arithmetic). + * + * See also: vips_boolean_const(). +@@ -299,17 +326,17 @@ vips_booleanv( VipsImage *left, VipsImage *right, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_boolean( VipsImage *left, VipsImage *right, VipsImage **out, +- VipsOperationBoolean boolean, ... ) ++vips_boolean(VipsImage *left, VipsImage *right, VipsImage **out, ++ VipsOperationBoolean boolean, ...) + { + va_list ap; + int result; + +- va_start( ap, boolean ); +- result = vips_booleanv( left, right, out, boolean, ap ); +- va_end( ap ); ++ va_start(ap, boolean); ++ result = vips_booleanv(left, right, out, boolean, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -325,17 +352,17 @@ vips_boolean( VipsImage *left, VipsImage *right, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_andimage( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_andimage(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_booleanv( left, right, out, +- VIPS_OPERATION_BOOLEAN_AND, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_booleanv(left, right, out, ++ VIPS_OPERATION_BOOLEAN_AND, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -351,17 +378,17 @@ vips_andimage( VipsImage *left, VipsImage *right, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_orimage( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_orimage(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_booleanv( left, right, out, +- VIPS_OPERATION_BOOLEAN_OR, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_booleanv(left, right, out, ++ VIPS_OPERATION_BOOLEAN_OR, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -377,17 +404,17 @@ vips_orimage( VipsImage *left, VipsImage *right, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_eorimage( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_eorimage(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_booleanv( left, right, out, +- VIPS_OPERATION_BOOLEAN_EOR, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_booleanv(left, right, out, ++ VIPS_OPERATION_BOOLEAN_EOR, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -403,17 +430,17 @@ vips_eorimage( VipsImage *left, VipsImage *right, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_lshift( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_lshift(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_booleanv( left, right, out, +- VIPS_OPERATION_BOOLEAN_LSHIFT, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_booleanv(left, right, out, ++ VIPS_OPERATION_BOOLEAN_LSHIFT, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -429,17 +456,17 @@ vips_lshift( VipsImage *left, VipsImage *right, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_rshift( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_rshift(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_booleanv( left, right, out, +- VIPS_OPERATION_BOOLEAN_RSHIFT, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_booleanv(left, right, out, ++ VIPS_OPERATION_BOOLEAN_RSHIFT, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + typedef struct _VipsBooleanConst { +@@ -450,49 +477,50 @@ typedef struct _VipsBooleanConst { + + typedef VipsUnaryConstClass VipsBooleanConstClass; + +-G_DEFINE_TYPE( VipsBooleanConst, +- vips_boolean_const, VIPS_TYPE_UNARY_CONST ); ++G_DEFINE_TYPE(VipsBooleanConst, ++ vips_boolean_const, VIPS_TYPE_UNARY_CONST); + + static int +-vips_boolean_const_build( VipsObject *object ) ++vips_boolean_const_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsUnary *unary = (VipsUnary *) object; + +- if( unary->in && +- vips_check_noncomplex( class->nickname, unary->in ) ) +- return( -1 ); ++ if (unary->in && ++ vips_check_noncomplex(class->nickname, unary->in)) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_boolean_const_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_boolean_const_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-#define LOOPC( TYPE, OP ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- TYPE * restrict q = (TYPE *) out; \ +- int * restrict c = uconst->c_int; \ +- \ +- for( i = 0, x = 0; x < width; x++ ) \ +- for( b = 0; b < bands; b++, i++ ) \ +- q[i] = p[i] OP c[b]; \ +-} ++#define LOOPC(TYPE, OP) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++ int *restrict c = uconst->c_int; \ ++\ ++ for (i = 0, x = 0; x < width; x++) \ ++ for (b = 0; b < bands; b++, i++) \ ++ q[i] = p[i] OP c[b]; \ ++ } + +-#define FLOOPC( TYPE, OP ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- int * restrict q = (int *) out; \ +- int * restrict c = uconst->c_int; \ +- \ +- for( i = 0, x = 0; x < width; x++ ) \ +- for( b = 0; b < bands; b++, i++ ) \ +- q[i] = ((int) p[i]) OP ((int) c[b]); \ +-} ++#define FLOOPC(TYPE, OP) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ int *restrict q = (int *) out; \ ++ int *restrict c = uconst->c_int; \ ++\ ++ for (i = 0, x = 0; x < width; x++) \ ++ for (b = 0; b < bands; b++, i++) \ ++ q[i] = ((int) p[i]) OP((int) c[b]); \ ++ } + + static void +-vips_boolean_const_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_boolean_const_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsUnaryConst *uconst = (VipsUnaryConst *) arithmetic; + VipsBooleanConst *bconst = (VipsBooleanConst *) arithmetic; +@@ -501,25 +529,25 @@ vips_boolean_const_buffer( VipsArithmetic *arithmetic, + + int i, x, b; + +- switch( bconst->operation ) { +- case VIPS_OPERATION_BOOLEAN_AND: +- SWITCH( LOOPC, FLOOPC, & ); ++ switch (bconst->operation) { ++ case VIPS_OPERATION_BOOLEAN_AND: ++ SWITCH(LOOPC, FLOOPC, &); + break; + +- case VIPS_OPERATION_BOOLEAN_OR: +- SWITCH( LOOPC, FLOOPC, | ); ++ case VIPS_OPERATION_BOOLEAN_OR: ++ SWITCH(LOOPC, FLOOPC, |); + break; + +- case VIPS_OPERATION_BOOLEAN_EOR: +- SWITCH( LOOPC, FLOOPC, ^ ); ++ case VIPS_OPERATION_BOOLEAN_EOR: ++ SWITCH(LOOPC, FLOOPC, ^); + break; + +- case VIPS_OPERATION_BOOLEAN_LSHIFT: +- SWITCH( LOOPC, FLOOPC, << ); ++ case VIPS_OPERATION_BOOLEAN_LSHIFT: ++ SWITCH(LOOPC, FLOOPC, <<); + break; + +- case VIPS_OPERATION_BOOLEAN_RSHIFT: +- SWITCH( LOOPC, FLOOPC, >> ); ++ case VIPS_OPERATION_BOOLEAN_RSHIFT: ++ SWITCH(LOOPC, FLOOPC, >>); + break; + + default: +@@ -528,58 +556,58 @@ vips_boolean_const_buffer( VipsArithmetic *arithmetic, + } + + static void +-vips_boolean_const_class_init( VipsBooleanConstClass *class ) ++vips_boolean_const_class_init(VipsBooleanConstClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "boolean_const"; +- object_class->description = +- _( "boolean operations against a constant" ); ++ object_class->description = ++ _("boolean operations against a constant"); + object_class->build = vips_boolean_const_build; + + aclass->process_line = vips_boolean_const_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_boolean_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_boolean_format_table); + +- VIPS_ARG_ENUM( class, "boolean", 200, +- _( "Operation" ), +- _( "Boolean to perform" ), ++ VIPS_ARG_ENUM(class, "boolean", 200, ++ _("Operation"), ++ _("Boolean to perform"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBooleanConst, operation ), +- VIPS_TYPE_OPERATION_BOOLEAN, +- VIPS_OPERATION_BOOLEAN_AND ); ++ G_STRUCT_OFFSET(VipsBooleanConst, operation), ++ VIPS_TYPE_OPERATION_BOOLEAN, ++ VIPS_OPERATION_BOOLEAN_AND); + } + + static void +-vips_boolean_const_init( VipsBooleanConst *boolean_const ) ++vips_boolean_const_init(VipsBooleanConst *boolean_const) + { + } + + static int +-vips_boolean_constv( VipsImage *in, VipsImage **out, +- VipsOperationBoolean operation, const double *c, int n, va_list ap ) ++vips_boolean_constv(VipsImage *in, VipsImage **out, ++ VipsOperationBoolean operation, const double *c, int n, va_list ap) + { + VipsArea *area_c; +- double *array; ++ double *array; + int result; + int i; + +- area_c = vips_area_new_array( G_TYPE_DOUBLE, sizeof( double ), n ); ++ area_c = vips_area_new_array(G_TYPE_DOUBLE, sizeof(double), n); + array = (double *) area_c->data; +- for( i = 0; i < n; i++ ) ++ for (i = 0; i < n; i++) + array[i] = c[i]; + +- result = vips_call_split( "boolean_const", ap, +- in, out, operation, area_c ); ++ result = vips_call_split("boolean_const", ap, ++ in, out, operation, area_c); + +- vips_area_unref( area_c ); ++ vips_area_unref(area_c); + +- return( result ); ++ return (result); + } + + /** +@@ -594,11 +622,11 @@ vips_boolean_constv( VipsImage *in, VipsImage **out, + * Perform various boolean operations on an image against an array of + * constants. + * +- * The output type is always uchar, with 0 for FALSE and 255 for TRUE. ++ * The output type is always uchar, with 0 for FALSE and 255 for TRUE. + * +- * If the array of constants has just one element, that constant is used for +- * all image bands. If the array has more than one element and they have +- * the same number of elements as there are bands in the image, then ++ * If the array of constants has just one element, that constant is used for ++ * all image bands. If the array has more than one element and they have ++ * the same number of elements as there are bands in the image, then + * one array element is used for each band. If the arrays have more than one + * element and the image only has a single band, the result is a many-band + * image where each band corresponds to one array element. +@@ -608,17 +636,17 @@ vips_boolean_constv( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_boolean_const( VipsImage *in, VipsImage **out, +- VipsOperationBoolean boolean, const double *c, int n, ... ) ++vips_boolean_const(VipsImage *in, VipsImage **out, ++ VipsOperationBoolean boolean, const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_boolean_constv( in, out, boolean, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_boolean_constv(in, out, boolean, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -637,18 +665,18 @@ vips_boolean_const( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_andimage_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++vips_andimage_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_boolean_constv( in, out, +- VIPS_OPERATION_BOOLEAN_AND, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_boolean_constv(in, out, ++ VIPS_OPERATION_BOOLEAN_AND, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -667,18 +695,18 @@ vips_andimage_const( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_orimage_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++vips_orimage_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_boolean_constv( in, out, +- VIPS_OPERATION_BOOLEAN_OR, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_boolean_constv(in, out, ++ VIPS_OPERATION_BOOLEAN_OR, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -697,18 +725,18 @@ vips_orimage_const( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_eorimage_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++vips_eorimage_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_boolean_constv( in, out, +- VIPS_OPERATION_BOOLEAN_EOR, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_boolean_constv(in, out, ++ VIPS_OPERATION_BOOLEAN_EOR, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -727,17 +755,17 @@ vips_eorimage_const( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_lshift_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) ++vips_lshift_const(VipsImage *in, VipsImage **out, const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_boolean_constv( in, out, +- VIPS_OPERATION_BOOLEAN_LSHIFT, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_boolean_constv(in, out, ++ VIPS_OPERATION_BOOLEAN_LSHIFT, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -756,17 +784,17 @@ vips_lshift_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_rshift_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) ++vips_rshift_const(VipsImage *in, VipsImage **out, const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_boolean_constv( in, out, +- VIPS_OPERATION_BOOLEAN_RSHIFT, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_boolean_constv(in, out, ++ VIPS_OPERATION_BOOLEAN_RSHIFT, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -774,7 +802,7 @@ vips_rshift_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) + * @in: input image + * @out: (out): output image + * @boolean: boolean operation to perform +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform various boolean operations on an image with a single constant. See +@@ -785,24 +813,24 @@ vips_rshift_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_boolean_const1( VipsImage *in, VipsImage **out, +- VipsOperationBoolean boolean, double c, ... ) ++vips_boolean_const1(VipsImage *in, VipsImage **out, ++ VipsOperationBoolean boolean, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_boolean_constv( in, out, boolean, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_boolean_constv(in, out, boolean, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_andimage_const1: (method) + * @in: input image + * @out: (out): output image +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform #VIPS_OPERATION_BOOLEAN_AND on an image and a constant. +@@ -813,24 +841,24 @@ vips_boolean_const1( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_andimage_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_andimage_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_boolean_constv( in, out, +- VIPS_OPERATION_BOOLEAN_AND, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_boolean_constv(in, out, ++ VIPS_OPERATION_BOOLEAN_AND, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_orimage_const1: (method) + * @in: input image + * @out: (out): output image +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform #VIPS_OPERATION_BOOLEAN_OR on an image and a constant. +@@ -841,24 +869,24 @@ vips_andimage_const1( VipsImage *in, VipsImage **out, double c, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_orimage_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_orimage_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_boolean_constv( in, out, +- VIPS_OPERATION_BOOLEAN_OR, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_boolean_constv(in, out, ++ VIPS_OPERATION_BOOLEAN_OR, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_eorimage_const1: (method) + * @in: input image + * @out: (out): output image +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform #VIPS_OPERATION_BOOLEAN_EOR on an image and a constant. +@@ -869,24 +897,24 @@ vips_orimage_const1( VipsImage *in, VipsImage **out, double c, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_eorimage_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_eorimage_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_boolean_constv( in, out, +- VIPS_OPERATION_BOOLEAN_EOR, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_boolean_constv(in, out, ++ VIPS_OPERATION_BOOLEAN_EOR, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_lshift_const1: (method) + * @in: input image + * @out: (out): output image +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform #VIPS_OPERATION_BOOLEAN_LSHIFT on an image and a constant. +@@ -897,24 +925,24 @@ vips_eorimage_const1( VipsImage *in, VipsImage **out, double c, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_lshift_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_lshift_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_boolean_constv( in, out, +- VIPS_OPERATION_BOOLEAN_LSHIFT, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_boolean_constv(in, out, ++ VIPS_OPERATION_BOOLEAN_LSHIFT, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_rshift_const1: (method) + * @in: input image + * @out: (out): output image +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform #VIPS_OPERATION_BOOLEAN_RSHIFT on an image and a constant. +@@ -925,15 +953,15 @@ vips_lshift_const1( VipsImage *in, VipsImage **out, double c, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_rshift_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_rshift_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_boolean_constv( in, out, +- VIPS_OPERATION_BOOLEAN_RSHIFT, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_boolean_constv(in, out, ++ VIPS_OPERATION_BOOLEAN_RSHIFT, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/complex.c b/libvips/arithmetic/complex.c +index 0367ea6332..c7997c526d 100644 +--- a/libvips/arithmetic/complex.c ++++ b/libvips/arithmetic/complex.c +@@ -27,28 +27,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -79,76 +79,88 @@ typedef struct _VipsComplex { + + typedef VipsUnaryClass VipsComplexClass; + +-G_DEFINE_TYPE( VipsComplex, vips_complex, VIPS_TYPE_UNARY ); +- +-#define LOOP( IN, OUT, OP ) { \ +- IN * restrict p = (IN *) in[0]; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- OP( q, p[x], 0.0 ); \ +- \ +- q += 2; \ +- } \ +-} ++G_DEFINE_TYPE(VipsComplex, vips_complex, VIPS_TYPE_UNARY); ++ ++#define LOOP(IN, OUT, OP) \ ++ { \ ++ IN *restrict p = (IN *) in[0]; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ OP(q, p[x], 0.0); \ ++\ ++ q += 2; \ ++ } \ ++ } + +-#define CLOOP( IN, OUT, OP ) { \ +- IN * restrict p = (IN *) in[0]; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- OP( q, p[0], p[1] ); \ +- \ +- p += 2; \ +- q += 2; \ +- } \ +-} ++#define CLOOP(IN, OUT, OP) \ ++ { \ ++ IN *restrict p = (IN *) in[0]; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ OP(q, p[0], p[1]); \ ++\ ++ p += 2; \ ++ q += 2; \ ++ } \ ++ } + +-#define SWITCH( OP ) \ +- switch( vips_image_get_format( im ) ) { \ ++#define SWITCH(OP) \ ++ switch (vips_image_get_format(im)) { \ + case VIPS_FORMAT_UCHAR: \ +- LOOP( unsigned char, float, OP ); break; \ ++ LOOP(unsigned char, float, OP); \ ++ break; \ + case VIPS_FORMAT_CHAR: \ +- LOOP( signed char, float, OP ); break; \ ++ LOOP(signed char, float, OP); \ ++ break; \ + case VIPS_FORMAT_USHORT: \ +- LOOP( unsigned short, float, OP ); break; \ ++ LOOP(unsigned short, float, OP); \ ++ break; \ + case VIPS_FORMAT_SHORT: \ +- LOOP( signed short, float, OP ); break; \ ++ LOOP(signed short, float, OP); \ ++ break; \ + case VIPS_FORMAT_UINT: \ +- LOOP( unsigned int, float, OP ); break; \ ++ LOOP(unsigned int, float, OP); \ ++ break; \ + case VIPS_FORMAT_INT: \ +- LOOP( signed int, float, OP ); break; \ ++ LOOP(signed int, float, OP); \ ++ break; \ + case VIPS_FORMAT_FLOAT: \ +- LOOP( float, float, OP ); break; \ ++ LOOP(float, float, OP); \ ++ break; \ + case VIPS_FORMAT_DOUBLE: \ +- LOOP( double, double, OP ); break;\ ++ LOOP(double, double, OP); \ ++ break; \ + case VIPS_FORMAT_COMPLEX: \ +- CLOOP( float, float, OP ); break; \ ++ CLOOP(float, float, OP); \ ++ break; \ + case VIPS_FORMAT_DPCOMPLEX: \ +- CLOOP( double, double, OP ); break;\ +- \ ++ CLOOP(double, double, OP); \ ++ break; \ ++\ + default: \ + g_assert_not_reached(); \ +- } ++ } + + static double +-vips_complex_hypot( double a, double b ) ++vips_complex_hypot(double a, double b) + { + double d; + + /* hypot() is less sensitive to overflow. Use it if we can. + */ + #ifdef HAVE_HYPOT +- d = hypot( a, b ); ++ d = hypot(a, b); + #else +- d = sqrt( a * a + b * b ); ++ d = sqrt(a * a + b * b); + #endif + +- return( d ); ++ return (d); + } + + static double +-vips_complex_atan2( double a, double b ) ++vips_complex_atan2(double a, double b) + { + double h; + +@@ -156,64 +168,73 @@ vips_complex_atan2( double a, double b ) + * it in preference when we can. + */ + #ifdef HAVE_ATAN2 +- h = VIPS_DEG( atan2( b, a ) ); +- if( h < 0.0 ) ++ h = VIPS_DEG(atan2(b, a)); ++ if (h < 0.0) + h += 360; + #else +- h = vips_col_ab2h( a, b ); +-#endif ++ h = vips_col_ab2h(a, b); ++#endif + +- return( h ); ++ return (h); + } + +-#define POLAR( Q, X, Y ) { \ +- double re = (X); \ +- double im = (Y); \ +- double am, ph; \ +- \ +- am = vips_complex_hypot( re, im ); \ +- ph = vips_complex_atan2( re, im ); \ +- \ +- Q[0] = am; \ +- Q[1] = ph; \ +-} +- +-#define RECT( Q, X, Y ) { \ +- double am = (X); \ +- double ph = (Y); \ +- double re, im; \ +- \ +- re = am * cos( VIPS_RAD( ph ) ); \ +- im = am * sin( VIPS_RAD( ph ) ); \ +- \ +- Q[0] = re; \ +- Q[1] = im; \ +-} ++#define POLAR(Q, X, Y) \ ++ { \ ++ double re = (X); \ ++ double im = (Y); \ ++ double am, ph; \ ++\ ++ am = vips_complex_hypot(re, im); \ ++ ph = vips_complex_atan2(re, im); \ ++\ ++ Q[0] = am; \ ++ Q[1] = ph; \ ++ } + +-#define CONJ( Q, X, Y ) { \ +- double re = (X); \ +- double im = (Y); \ +- \ +- im *= -1; \ +- \ +- Q[0] = re; \ +- Q[1] = im; \ +-} ++#define RECT(Q, X, Y) \ ++ { \ ++ double am = (X); \ ++ double ph = (Y); \ ++ double re, im; \ ++\ ++ re = am * cos(VIPS_RAD(ph)); \ ++ im = am * sin(VIPS_RAD(ph)); \ ++\ ++ Q[0] = re; \ ++ Q[1] = im; \ ++ } ++ ++#define CONJ(Q, X, Y) \ ++ { \ ++ double re = (X); \ ++ double im = (Y); \ ++\ ++ im *= -1; \ ++\ ++ Q[0] = re; \ ++ Q[1] = im; \ ++ } + + static void +-vips_complex_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_complex_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsComplex *cmplx = (VipsComplex *) arithmetic; + VipsImage *im = arithmetic->ready[0]; +- const int sz = width * vips_image_get_bands( im ); ++ const int sz = width * vips_image_get_bands(im); + + int x; + +- switch( cmplx->cmplx ) { +- case VIPS_OPERATION_COMPLEX_POLAR: SWITCH( POLAR ); break; +- case VIPS_OPERATION_COMPLEX_RECT: SWITCH( RECT ); break; +- case VIPS_OPERATION_COMPLEX_CONJ: SWITCH( CONJ ); break; ++ switch (cmplx->cmplx) { ++ case VIPS_OPERATION_COMPLEX_POLAR: ++ SWITCH(POLAR); ++ break; ++ case VIPS_OPERATION_COMPLEX_RECT: ++ SWITCH(RECT); ++ break; ++ case VIPS_OPERATION_COMPLEX_CONJ: ++ SWITCH(CONJ); ++ break; + + default: + g_assert_not_reached(); +@@ -239,41 +260,41 @@ static const VipsBandFormat vips_complex_format_table[10] = { + }; + + static void +-vips_complex_class_init( VipsComplexClass *class ) ++vips_complex_class_init(VipsComplexClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "complex"; +- object_class->description = +- _( "perform a complex operation on an image" ); ++ object_class->description = ++ _("perform a complex operation on an image"); + + aclass->process_line = vips_complex_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_complex_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_complex_format_table); + +- VIPS_ARG_ENUM( class, "cmplx", 200, +- _( "Operation" ), +- _( "Complex to perform" ), ++ VIPS_ARG_ENUM(class, "cmplx", 200, ++ _("Operation"), ++ _("Complex to perform"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsComplex, cmplx ), +- VIPS_TYPE_OPERATION_COMPLEX, VIPS_OPERATION_COMPLEX_POLAR ); ++ G_STRUCT_OFFSET(VipsComplex, cmplx), ++ VIPS_TYPE_OPERATION_COMPLEX, VIPS_OPERATION_COMPLEX_POLAR); + } + + static void +-vips_complex_init( VipsComplex *cmplx ) ++vips_complex_init(VipsComplex *cmplx) + { + } + + static int +-vips_complexv( VipsImage *in, VipsImage **out, +- VipsOperationComplex cmplx, va_list ap ) ++vips_complexv(VipsImage *in, VipsImage **out, ++ VipsOperationComplex cmplx, va_list ap) + { +- return( vips_call_split( "complex", ap, in, out, cmplx ) ); ++ return (vips_call_split("complex", ap, in, out, cmplx)); + } + + /** +@@ -285,22 +306,22 @@ vips_complexv( VipsImage *in, VipsImage **out, + * + * Perform various operations on complex images. + * +- * Angles are expressed in degrees. The output type is complex unless the +- * input is double or dpcomplex, in which case the output is dpcomplex. ++ * Angles are expressed in degrees. The output type is complex unless the ++ * input is double or dpcomplex, in which case the output is dpcomplex. + * + * Returns: 0 on success, -1 on error + */ + int +-vips_complex( VipsImage *in, VipsImage **out, VipsOperationComplex cmplx, ... ) ++vips_complex(VipsImage *in, VipsImage **out, VipsOperationComplex cmplx, ...) + { + va_list ap; + int result; + +- va_start( ap, cmplx ); +- result = vips_complexv( in, out, cmplx, ap ); +- va_end( ap ); ++ va_start(ap, cmplx); ++ result = vips_complexv(in, out, cmplx, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -314,16 +335,16 @@ vips_complex( VipsImage *in, VipsImage **out, VipsOperationComplex cmplx, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_polar( VipsImage *in, VipsImage **out, ... ) ++vips_polar(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_complexv( in, out, VIPS_OPERATION_COMPLEX_POLAR, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_complexv(in, out, VIPS_OPERATION_COMPLEX_POLAR, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -337,16 +358,16 @@ vips_polar( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_rect( VipsImage *in, VipsImage **out, ... ) ++vips_rect(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_complexv( in, out, VIPS_OPERATION_COMPLEX_RECT, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_complexv(in, out, VIPS_OPERATION_COMPLEX_RECT, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -360,16 +381,16 @@ vips_rect( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_conj( VipsImage *in, VipsImage **out, ... ) ++vips_conj(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_complexv( in, out, VIPS_OPERATION_COMPLEX_CONJ, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_complexv(in, out, VIPS_OPERATION_COMPLEX_CONJ, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + typedef struct _VipsComplex2 { +@@ -381,131 +402,145 @@ typedef struct _VipsComplex2 { + + typedef VipsBinaryClass VipsComplex2Class; + +-G_DEFINE_TYPE( VipsComplex2, vips_complex2, VIPS_TYPE_BINARY ); +- +-#define LOOP2( IN, OUT, OP ) { \ +- IN *p1 = (IN *) in[0]; \ +- IN *p2 = (IN *) in[1]; \ +- OUT *q = (OUT *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- OP( q, p1[x], 0.0, p2[x], 0.0 ); \ +- \ +- q += 2; \ +- } \ +-} ++G_DEFINE_TYPE(VipsComplex2, vips_complex2, VIPS_TYPE_BINARY); ++ ++#define LOOP2(IN, OUT, OP) \ ++ { \ ++ IN *p1 = (IN *) in[0]; \ ++ IN *p2 = (IN *) in[1]; \ ++ OUT *q = (OUT *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ OP(q, p1[x], 0.0, p2[x], 0.0); \ ++\ ++ q += 2; \ ++ } \ ++ } + +-#define CLOOP2( IN, OUT, OP ) { \ +- IN *p1 = (IN *) in[0]; \ +- IN *p2 = (IN *) in[1]; \ +- OUT *q = (OUT *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- OP( q, p1[0], p1[1], p2[0], p2[1] ); \ +- \ +- p1 += 2; \ +- p2 += 2; \ +- q += 2; \ +- } \ +-} ++#define CLOOP2(IN, OUT, OP) \ ++ { \ ++ IN *p1 = (IN *) in[0]; \ ++ IN *p2 = (IN *) in[1]; \ ++ OUT *q = (OUT *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ OP(q, p1[0], p1[1], p2[0], p2[1]); \ ++\ ++ p1 += 2; \ ++ p2 += 2; \ ++ q += 2; \ ++ } \ ++ } + +-#define SWITCH2( OP ) \ +- switch( vips_image_get_format( im ) ) { \ ++#define SWITCH2(OP) \ ++ switch (vips_image_get_format(im)) { \ + case VIPS_FORMAT_UCHAR: \ +- LOOP2( unsigned char, float, OP ); break; \ ++ LOOP2(unsigned char, float, OP); \ ++ break; \ + case VIPS_FORMAT_CHAR: \ +- LOOP2( signed char, float, OP ); break; \ ++ LOOP2(signed char, float, OP); \ ++ break; \ + case VIPS_FORMAT_USHORT: \ +- LOOP2( unsigned short, float, OP ); break; \ ++ LOOP2(unsigned short, float, OP); \ ++ break; \ + case VIPS_FORMAT_SHORT: \ +- LOOP2( signed short, float, OP ); break; \ ++ LOOP2(signed short, float, OP); \ ++ break; \ + case VIPS_FORMAT_UINT: \ +- LOOP2( unsigned int, float, OP ); break; \ ++ LOOP2(unsigned int, float, OP); \ ++ break; \ + case VIPS_FORMAT_INT: \ +- LOOP2( signed int, float, OP ); break; \ ++ LOOP2(signed int, float, OP); \ ++ break; \ + case VIPS_FORMAT_FLOAT: \ +- LOOP2( float, float, OP ); break; \ ++ LOOP2(float, float, OP); \ ++ break; \ + case VIPS_FORMAT_DOUBLE: \ +- LOOP2( double, double, OP ); break;\ ++ LOOP2(double, double, OP); \ ++ break; \ + case VIPS_FORMAT_COMPLEX: \ +- CLOOP2( float, float, OP ); break; \ ++ CLOOP2(float, float, OP); \ ++ break; \ + case VIPS_FORMAT_DPCOMPLEX: \ +- CLOOP2( double, double, OP ); break;\ +- \ ++ CLOOP2(double, double, OP); \ ++ break; \ ++\ + default: \ + g_assert_not_reached(); \ +- } ++ } + +-/* There doesn't seem to be much difference in speed between these two methods +- * (on an Athlon64), so I use the modulus argument version, since atan2() is ++/* There doesn't seem to be much difference in speed between these two methods ++ * (on an Athlon64), so I use the modulus argument version, since atan2() is + * in c89 but hypot() is c99. + * +- * If you think that it might be faster on your platform, uncomment the ++ * If you think that it might be faster on your platform, uncomment the + * following: + */ + #define USE_MODARG_DIV + + #ifdef USE_MODARG_DIV + +-#define CROSS( Q, X1, Y1, X2, Y2 ) { \ +- if( ((X1) == 0.0 && (Y1) == 0.0) || \ +- ((X2) == 0.0 && (Y2) == 0.0) ) { \ +- Q[0] = 0.0; \ +- Q[1] = 0.0; \ +- } \ +- else { \ +- double arg = atan2( X2, X1 ) - atan2( Y2, Y1 ); \ +- \ +- Q[0] = cos( arg ); \ +- Q[1] = sin( arg ); \ +- } \ +-} ++#define CROSS(Q, X1, Y1, X2, Y2) \ ++ { \ ++ if (((X1) == 0.0 && (Y1) == 0.0) || \ ++ ((X2) == 0.0 && (Y2) == 0.0)) { \ ++ Q[0] = 0.0; \ ++ Q[1] = 0.0; \ ++ } \ ++ else { \ ++ double arg = atan2(X2, X1) - atan2(Y2, Y1); \ ++\ ++ Q[0] = cos(arg); \ ++ Q[1] = sin(arg); \ ++ } \ ++ } + + #else /* USE_MODARG_DIV */ + +-#define CROSS( Q, X1, Y1, X2, Y2 ) { \ +- if( ((X1) == 0.0 && (Y1) == 0.0) || \ +- ((X2) == 0.0 && (Y2) == 0.0) ) { \ +- Q[0] = 0.0; \ +- Q[1] = 0.0; \ +- } \ +- else if( ABS( Y1 ) > ABS( Y2 ) ) { \ +- double a = Y2 / Y1; \ +- double b = Y1 + Y2 * a; \ +- double re = (X1 + X2 * a) / b; \ +- double im = (X2 - X1 * a) / b; \ +- double mod = vips__hypot( re, im ); \ +- \ +- Q[0] = re / mod; \ +- Q[1] = im / mod; \ +- } \ +- else { \ +- double a = Y1 / Y2; \ +- double b = Y2 + Y1 * a; \ +- double re = (X1 * a + X2) / b; \ +- double im = (X2 * a - X1) / b; \ +- double mod = vips__hypot( re, im ); \ +- \ +- Q[0] = re / mod; \ +- Q[1] = im / mod; \ +- } \ +-} ++#define CROSS(Q, X1, Y1, X2, Y2) \ ++ { \ ++ if (((X1) == 0.0 && (Y1) == 0.0) || \ ++ ((X2) == 0.0 && (Y2) == 0.0)) { \ ++ Q[0] = 0.0; \ ++ Q[1] = 0.0; \ ++ } \ ++ else if (ABS(Y1) > ABS(Y2)) { \ ++ double a = Y2 / Y1; \ ++ double b = Y1 + Y2 * a; \ ++ double re = (X1 + X2 * a) / b; \ ++ double im = (X2 - X1 * a) / b; \ ++ double mod = vips__hypot(re, im); \ ++\ ++ Q[0] = re / mod; \ ++ Q[1] = im / mod; \ ++ } \ ++ else { \ ++ double a = Y1 / Y2; \ ++ double b = Y2 + Y1 * a; \ ++ double re = (X1 * a + X2) / b; \ ++ double im = (X2 * a - X1) / b; \ ++ double mod = vips__hypot(re, im); \ ++\ ++ Q[0] = re / mod; \ ++ Q[1] = im / mod; \ ++ } \ ++ } + + #endif /* USE_MODARG_DIV */ + + static void +-vips_complex2_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_complex2_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsComplex2 *cmplx = (VipsComplex2 *) arithmetic; + VipsImage *im = arithmetic->ready[0]; +- const int sz = width * vips_image_get_bands( im ); ++ const int sz = width * vips_image_get_bands(im); + + int x; + +- switch( cmplx->cmplx ) { +- case VIPS_OPERATION_COMPLEX2_CROSS_PHASE: +- SWITCH2( CROSS ); ++ switch (cmplx->cmplx) { ++ case VIPS_OPERATION_COMPLEX2_CROSS_PHASE: ++ SWITCH2(CROSS); + break; + + default: +@@ -532,42 +567,42 @@ static const VipsBandFormat vips_complex2_format_table[10] = { + }; + + static void +-vips_complex2_class_init( VipsComplex2Class *class ) ++vips_complex2_class_init(VipsComplex2Class *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "complex2"; +- object_class->description = +- _( "complex binary operations on two images" ); ++ object_class->description = ++ _("complex binary operations on two images"); + + aclass->process_line = vips_complex2_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_complex2_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_complex2_format_table); + +- VIPS_ARG_ENUM( class, "cmplx", 200, +- _( "Operation" ), +- _( "Binary complex operation to perform" ), ++ VIPS_ARG_ENUM(class, "cmplx", 200, ++ _("Operation"), ++ _("Binary complex operation to perform"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsComplex2, cmplx ), +- VIPS_TYPE_OPERATION_COMPLEX2, +- VIPS_OPERATION_COMPLEX2_CROSS_PHASE ); ++ G_STRUCT_OFFSET(VipsComplex2, cmplx), ++ VIPS_TYPE_OPERATION_COMPLEX2, ++ VIPS_OPERATION_COMPLEX2_CROSS_PHASE); + } + + static void +-vips_complex2_init( VipsComplex2 *cmplx ) ++vips_complex2_init(VipsComplex2 *cmplx) + { + } + + static int +-vips_complex2v( VipsImage *left, VipsImage *right, VipsImage **out, +- VipsOperationComplex2 cmplx, va_list ap ) ++vips_complex2v(VipsImage *left, VipsImage *right, VipsImage **out, ++ VipsOperationComplex2 cmplx, va_list ap) + { +- return( vips_call_split( "complex2", ap, left, right, out, cmplx ) ); ++ return (vips_call_split("complex2", ap, left, right, out, cmplx)); + } + + /** +@@ -580,23 +615,23 @@ vips_complex2v( VipsImage *left, VipsImage *right, VipsImage **out, + * + * Perform various binary operations on complex images. + * +- * Angles are expressed in degrees. The output type is complex unless the +- * input is double or dpcomplex, in which case the output is dpcomplex. ++ * Angles are expressed in degrees. The output type is complex unless the ++ * input is double or dpcomplex, in which case the output is dpcomplex. + * + * Returns: 0 on success, -1 on error + */ + int +-vips_complex2( VipsImage *left, VipsImage *right, VipsImage **out, +- VipsOperationComplex2 cmplx, ... ) ++vips_complex2(VipsImage *left, VipsImage *right, VipsImage **out, ++ VipsOperationComplex2 cmplx, ...) + { + va_list ap; + int result; + +- va_start( ap, cmplx ); +- result = vips_complex2v( left, right, out, cmplx, ap ); +- va_end( ap ); ++ va_start(ap, cmplx); ++ result = vips_complex2v(left, right, out, cmplx, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -606,23 +641,23 @@ vips_complex2( VipsImage *left, VipsImage *right, VipsImage **out, + * @out: (out): output #VipsImage + * @...: %NULL-terminated list of optional named arguments + * +- * Perform #VIPS_OPERATION_COMPLEX2_CROSS_PHASE on an image. ++ * Perform #VIPS_OPERATION_COMPLEX2_CROSS_PHASE on an image. + * See vips_complex2(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_cross_phase( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_cross_phase(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_complex2v( left, right, out, +- VIPS_OPERATION_COMPLEX2_CROSS_PHASE, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_complex2v(left, right, out, ++ VIPS_OPERATION_COMPLEX2_CROSS_PHASE, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + typedef struct _VipsComplexget { +@@ -634,93 +669,111 @@ typedef struct _VipsComplexget { + + typedef VipsUnaryClass VipsComplexgetClass; + +-G_DEFINE_TYPE( VipsComplexget, vips_complexget, VIPS_TYPE_UNARY ); ++G_DEFINE_TYPE(VipsComplexget, vips_complexget, VIPS_TYPE_UNARY); + + static int +-vips_complexget_build( VipsObject *object ) ++vips_complexget_build(VipsObject *object) + { + VipsUnary *unary = (VipsUnary *) object; + VipsComplexget *complexget = (VipsComplexget *) object; + +- if( unary->in && +- !vips_band_format_iscomplex( unary->in->BandFmt ) && +- complexget->get == VIPS_OPERATION_COMPLEXGET_REAL ) +- return( vips_unary_copy( unary ) ); ++ if (unary->in && ++ !vips_band_format_iscomplex(unary->in->BandFmt) && ++ complexget->get == VIPS_OPERATION_COMPLEXGET_REAL) ++ return (vips_unary_copy(unary)); + +- if( VIPS_OBJECT_CLASS( vips_complexget_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_complexget_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-#define GETLOOP( TYPE, OP ) { \ +- TYPE *p G_GNUC_UNUSED = (TYPE *) in[0]; \ +- TYPE *q = (TYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- OP( q[x], p[x], 0.0 ); \ +- } \ +-} ++#define GETLOOP(TYPE, OP) \ ++ { \ ++ TYPE *p G_GNUC_UNUSED = (TYPE *) in[0]; \ ++ TYPE *q = (TYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ OP(q[x], p[x], 0.0); \ ++ } \ ++ } + +-#define CGETLOOP( TYPE, OP ) { \ +- TYPE *p G_GNUC_UNUSED = (TYPE *) in[0]; \ +- TYPE *q = (TYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- OP( q[x], p[0], p[1] ); \ +- \ +- p += 2; \ +- } \ +-} ++#define CGETLOOP(TYPE, OP) \ ++ { \ ++ TYPE *p G_GNUC_UNUSED = (TYPE *) in[0]; \ ++ TYPE *q = (TYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ OP(q[x], p[0], p[1]); \ ++\ ++ p += 2; \ ++ } \ ++ } + +-#define GETSWITCH( OP ) \ +- switch( vips_image_get_format( im ) ) { \ ++#define GETSWITCH(OP) \ ++ switch (vips_image_get_format(im)) { \ + case VIPS_FORMAT_UCHAR: \ +- GETLOOP( unsigned char, OP ); break; \ ++ GETLOOP(unsigned char, OP); \ ++ break; \ + case VIPS_FORMAT_CHAR: \ +- GETLOOP( signed char, OP ); break; \ ++ GETLOOP(signed char, OP); \ ++ break; \ + case VIPS_FORMAT_USHORT: \ +- GETLOOP( unsigned short, OP ); break; \ ++ GETLOOP(unsigned short, OP); \ ++ break; \ + case VIPS_FORMAT_SHORT: \ +- GETLOOP( signed short, OP ); break; \ ++ GETLOOP(signed short, OP); \ ++ break; \ + case VIPS_FORMAT_UINT: \ +- GETLOOP( unsigned int, OP ); break; \ ++ GETLOOP(unsigned int, OP); \ ++ break; \ + case VIPS_FORMAT_INT: \ +- GETLOOP( signed int, OP ); break; \ ++ GETLOOP(signed int, OP); \ ++ break; \ + case VIPS_FORMAT_FLOAT: \ +- GETLOOP( float, OP ); break; \ ++ GETLOOP(float, OP); \ ++ break; \ + case VIPS_FORMAT_DOUBLE: \ +- GETLOOP( double, OP ); break;\ ++ GETLOOP(double, OP); \ ++ break; \ + case VIPS_FORMAT_COMPLEX: \ +- CGETLOOP( float, OP ); break; \ ++ CGETLOOP(float, OP); \ ++ break; \ + case VIPS_FORMAT_DPCOMPLEX: \ +- CGETLOOP( double, OP ); break;\ +- \ ++ CGETLOOP(double, OP); \ ++ break; \ ++\ + default: \ + g_assert_not_reached(); \ +- } ++ } + +-#define REAL( Q, X, Y ) { \ +- Q = X; \ +-} ++#define REAL(Q, X, Y) \ ++ { \ ++ Q = X; \ ++ } + +-#define IMAG( Q, X, Y ) { \ +- Q = Y; \ +-} ++#define IMAG(Q, X, Y) \ ++ { \ ++ Q = Y; \ ++ } + + static void +-vips_complexget_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_complexget_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsComplexget *complexget = (VipsComplexget *) arithmetic; + VipsImage *im = arithmetic->ready[0]; +- const int sz = width * vips_image_get_bands( im ); ++ const int sz = width * vips_image_get_bands(im); + + int x; + +- switch( complexget->get ) { +- case VIPS_OPERATION_COMPLEXGET_REAL: GETSWITCH( REAL ); break; +- case VIPS_OPERATION_COMPLEXGET_IMAG: GETSWITCH( IMAG ); break; ++ switch (complexget->get) { ++ case VIPS_OPERATION_COMPLEXGET_REAL: ++ GETSWITCH(REAL); ++ break; ++ case VIPS_OPERATION_COMPLEXGET_IMAG: ++ GETSWITCH(IMAG); ++ break; + + default: + g_assert_not_reached(); +@@ -746,43 +799,43 @@ static const VipsBandFormat vips_complexget_format_table[10] = { + }; + + static void +-vips_complexget_class_init( VipsComplexgetClass *class ) ++vips_complexget_class_init(VipsComplexgetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "complexget"; +- object_class->description = _( "get a component from a complex image" ); ++ object_class->description = _("get a component from a complex image"); + object_class->build = vips_complexget_build; + + aclass->process_line = vips_complexget_buffer; + +- vips_arithmetic_set_format_table( aclass, +- vips_complexget_format_table ); ++ vips_arithmetic_set_format_table(aclass, ++ vips_complexget_format_table); + +- VIPS_ARG_ENUM( class, "get", 200, +- _( "Operation" ), +- _( "Complex to perform" ), ++ VIPS_ARG_ENUM(class, "get", 200, ++ _("Operation"), ++ _("Complex to perform"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsComplexget, get ), +- VIPS_TYPE_OPERATION_COMPLEXGET, +- VIPS_OPERATION_COMPLEXGET_REAL ); ++ G_STRUCT_OFFSET(VipsComplexget, get), ++ VIPS_TYPE_OPERATION_COMPLEXGET, ++ VIPS_OPERATION_COMPLEXGET_REAL); + } + + static void +-vips_complexget_init( VipsComplexget *complexget ) ++vips_complexget_init(VipsComplexget *complexget) + { + } + + static int +-vips_complexgetv( VipsImage *in, VipsImage **out, +- VipsOperationComplexget get, va_list ap ) ++vips_complexgetv(VipsImage *in, VipsImage **out, ++ VipsOperationComplexget get, va_list ap) + { +- return( vips_call_split( "complexget", ap, in, out, get ) ); ++ return (vips_call_split("complexget", ap, in, out, get)); + } + + /** +@@ -792,26 +845,26 @@ vips_complexgetv( VipsImage *in, VipsImage **out, + * @get: complex operation to perform + * @...: %NULL-terminated list of optional named arguments + * +- * Get components of complex images. ++ * Get components of complex images. + * + * The output type is the same as the input type, except #VIPS_FORMAT_COMPLEX +- * becomes #VIPS_FORMAT_FLOAT and #VIPS_FORMAT_DPCOMPLEX becomes ++ * becomes #VIPS_FORMAT_FLOAT and #VIPS_FORMAT_DPCOMPLEX becomes + * #VIPS_FORMAT_DOUBLE. + * + * Returns: 0 on success, -1 on error + */ + int +-vips_complexget( VipsImage *in, VipsImage **out, +- VipsOperationComplexget get, ... ) ++vips_complexget(VipsImage *in, VipsImage **out, ++ VipsOperationComplexget get, ...) + { + va_list ap; + int result; + +- va_start( ap, get ); +- result = vips_complexgetv( in, out, get, ap ); +- va_end( ap ); ++ va_start(ap, get); ++ result = vips_complexgetv(in, out, get, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -825,17 +878,17 @@ vips_complexget( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_real( VipsImage *in, VipsImage **out, ... ) ++vips_real(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_complexgetv( in, out, +- VIPS_OPERATION_COMPLEXGET_REAL, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_complexgetv(in, out, ++ VIPS_OPERATION_COMPLEXGET_REAL, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -849,90 +902,98 @@ vips_real( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_imag( VipsImage *in, VipsImage **out, ... ) ++vips_imag(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_complexgetv( in, out, +- VIPS_OPERATION_COMPLEXGET_IMAG, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_complexgetv(in, out, ++ VIPS_OPERATION_COMPLEXGET_IMAG, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + typedef VipsBinary VipsComplexform; + typedef VipsBinaryClass VipsComplexformClass; + +-G_DEFINE_TYPE( VipsComplexform, vips_complexform, VIPS_TYPE_BINARY ); ++G_DEFINE_TYPE(VipsComplexform, vips_complexform, VIPS_TYPE_BINARY); + + static int +-vips_complexform_build( VipsObject *object ) ++vips_complexform_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsBinary *binary = (VipsBinary *) object; + +- if( binary->left && +- vips_check_noncomplex( class->nickname, binary->left ) ) +- return( -1 ); +- if( binary->right && +- vips_check_noncomplex( class->nickname, binary->right ) ) +- return( -1 ); ++ if (binary->left && ++ vips_check_noncomplex(class->nickname, binary->left)) ++ return (-1); ++ if (binary->right && ++ vips_check_noncomplex(class->nickname, binary->right)) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_complexform_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_complexform_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-#define CFORM( IN, OUT ) { \ +- IN *left = (IN *) in[0]; \ +- IN *right = (IN *) in[1]; \ +- OUT *q = (OUT *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- q[0] = left[x]; \ +- q[1] = right[x]; \ +- \ +- q += 2; \ +- } \ +-} ++#define CFORM(IN, OUT) \ ++ { \ ++ IN *left = (IN *) in[0]; \ ++ IN *right = (IN *) in[1]; \ ++ OUT *q = (OUT *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ q[0] = left[x]; \ ++ q[1] = right[x]; \ ++\ ++ q += 2; \ ++ } \ ++ } + + static void +-vips_complexform_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_complexform_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsImage *im = arithmetic->ready[0]; +- const int sz = width * vips_image_get_bands( im ); ++ const int sz = width * vips_image_get_bands(im); + + int x; + +- /* Keep types here in sync with bandfmt_complexform[] ++ /* Keep types here in sync with bandfmt_complexform[] + * below. +- */ +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_UCHAR: +- CFORM( unsigned char, float ); break; +- case VIPS_FORMAT_CHAR: +- CFORM( signed char, float ); break; +- case VIPS_FORMAT_USHORT: +- CFORM( unsigned short, float ); break; +- case VIPS_FORMAT_SHORT: +- CFORM( signed short, float ); break; +- case VIPS_FORMAT_UINT: +- CFORM( unsigned int, float ); break; +- case VIPS_FORMAT_INT: +- CFORM( signed int, float ); break; +- case VIPS_FORMAT_FLOAT: +- CFORM( float, float ); break; +- case VIPS_FORMAT_DOUBLE: +- CFORM( double, double ); break; +- +- default: ++ */ ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_UCHAR: ++ CFORM(unsigned char, float); ++ break; ++ case VIPS_FORMAT_CHAR: ++ CFORM(signed char, float); ++ break; ++ case VIPS_FORMAT_USHORT: ++ CFORM(unsigned short, float); ++ break; ++ case VIPS_FORMAT_SHORT: ++ CFORM(signed short, float); ++ break; ++ case VIPS_FORMAT_UINT: ++ CFORM(unsigned int, float); ++ break; ++ case VIPS_FORMAT_INT: ++ CFORM(signed int, float); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ CFORM(float, float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ CFORM(double, double); ++ break; ++ ++ default: + g_assert_not_reached(); +- } ++ } + } + + /* Save a bit of typing. +@@ -948,7 +1009,7 @@ vips_complexform_buffer( VipsArithmetic *arithmetic, + #define D VIPS_FORMAT_DOUBLE + #define DX VIPS_FORMAT_DPCOMPLEX + +-/* Type promotion for form complex. Sign and value preserving. Make sure ++/* Type promotion for form complex. Sign and value preserving. Make sure + * these match the case statement in complexform_buffer() above. + */ + static VipsBandFormat vips_complexform_format_table[10] = { +@@ -957,41 +1018,41 @@ static VipsBandFormat vips_complexform_format_table[10] = { + }; + + static void +-vips_complexform_class_init( VipsComplexformClass *class ) ++vips_complexform_class_init(VipsComplexformClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + object_class->nickname = "complexform"; +- object_class->description = +- _( "form a complex image from two real images" ); ++ object_class->description = ++ _("form a complex image from two real images"); + object_class->build = vips_complexform_build; + + aclass->process_line = vips_complexform_buffer; + +- vips_arithmetic_set_format_table( aclass, +- vips_complexform_format_table ); ++ vips_arithmetic_set_format_table(aclass, ++ vips_complexform_format_table); + } + + static void +-vips_complexform_init( VipsComplexform *complexform ) ++vips_complexform_init(VipsComplexform *complexform) + { + } + + /** + * vips_complexform: +- * @left: input image +- * @right: input image ++ * @left: input image ++ * @right: input image + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Compose two real images to make a complex image. If either @left or @right +- * are #VIPS_FORMAT_DOUBLE, @out is #VIPS_FORMAT_DPCOMPLEX. Otherwise @out +- * is #VIPS_FORMAT_COMPLEX. @left becomes the real component of @out and ++ * Compose two real images to make a complex image. If either @left or @right ++ * are #VIPS_FORMAT_DOUBLE, @out is #VIPS_FORMAT_DPCOMPLEX. Otherwise @out ++ * is #VIPS_FORMAT_COMPLEX. @left becomes the real component of @out and + * @right the imaginary. + * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +@@ -1000,19 +1061,14 @@ vips_complexform_init( VipsComplexform *complexform ) + * Returns: 0 on success, -1 on error + */ + int +-vips_complexform( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_complexform(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "complexform", ap, left, right, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("complexform", ap, left, right, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +- +- +- +- +diff --git a/libvips/arithmetic/deviate.c b/libvips/arithmetic/deviate.c +index d1ff1954bc..7c6dc8c41d 100644 +--- a/libvips/arithmetic/deviate.c ++++ b/libvips/arithmetic/deviate.c +@@ -4,7 +4,7 @@ + * + * Author: J. Cupitt + * Written on: 02/08/1990 +- * Modified on: ++ * Modified on: + * 5/5/93 JC + * - now does partial images + * - less likely to overflow +@@ -19,7 +19,7 @@ + * 20/6/95 JC + * - now returns double, not float + * 13/1/05 +- * - use 64 bit arithmetic ++ * - use 64 bit arithmetic + * 8/12/06 + * - add liboil support + * 2/9/09 +@@ -35,28 +35,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -84,62 +84,62 @@ typedef struct _VipsDeviate { + + typedef VipsStatisticClass VipsDeviateClass; + +-G_DEFINE_TYPE( VipsDeviate, vips_deviate, VIPS_TYPE_STATISTIC ); ++G_DEFINE_TYPE(VipsDeviate, vips_deviate, VIPS_TYPE_STATISTIC); + + static int +-vips_deviate_build( VipsObject *object ) ++vips_deviate_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsStatistic *statistic = VIPS_STATISTIC( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsStatistic *statistic = VIPS_STATISTIC(object); + VipsDeviate *deviate = (VipsDeviate *) object; + + gint64 vals; + double s, s2; + +- if( statistic->in && +- vips_check_noncomplex( class->nickname, statistic->in ) ) +- return( -1 ); ++ if (statistic->in && ++ vips_check_noncomplex(class->nickname, statistic->in)) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_deviate_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_deviate_parent_class)->build(object)) ++ return (-1); + + /* +- +- NOTE: NR suggests a two-pass algorithm to minimise roundoff. +- But that's too expensive for us :-( so do it the old one-pass ++ ++ NOTE: NR suggests a two-pass algorithm to minimise roundoff. ++ But that's too expensive for us :-( so do it the old one-pass + way. + + */ + + /* Calculate and return deviation. Add a fabs to stop sqrt(<=0). + */ +- vals = (gint64) +- vips_image_get_width( statistic->in ) * +- vips_image_get_height( statistic->in ) * +- vips_image_get_bands( statistic->in ); ++ vals = (gint64) ++ vips_image_get_width(statistic->in) * ++ vips_image_get_height(statistic->in) * ++ vips_image_get_bands(statistic->in); + s = deviate->sum; + s2 = deviate->sum2; + +- g_object_set( object, +- "out", sqrt( VIPS_FABS( s2 - (s * s / vals) ) / (vals - 1) ), +- NULL ); ++ g_object_set(object, ++ "out", sqrt(VIPS_FABS(s2 - (s * s / vals)) / (vals - 1)), ++ NULL); + +- return( 0 ); ++ return (0); + } + + /* Start function: allocate space for an array in which we can accumulate the + * sum and sum of squares for this thread. + */ + static void * +-vips_deviate_start( VipsStatistic *statistic ) ++vips_deviate_start(VipsStatistic *statistic) + { +- return( (void *) g_new0( double, 2 ) ); ++ return ((void *) g_new0(double, 2)); + } + + /* Stop function. Add this little sum to the main sum. + */ + static int +-vips_deviate_stop( VipsStatistic *statistic, void *seq ) ++vips_deviate_stop(VipsStatistic *statistic, void *seq) + { + VipsDeviate *deviate = (VipsDeviate *) statistic; + double *ss2 = (double *) seq; +@@ -147,27 +147,28 @@ vips_deviate_stop( VipsStatistic *statistic, void *seq ) + deviate->sum += ss2[0]; + deviate->sum2 += ss2[1]; + +- g_free( ss2 ); ++ g_free(ss2); + +- return( 0 ); ++ return (0); + } + +-#define LOOP( TYPE ) { \ +- TYPE *p = (TYPE *) in; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- TYPE v = p[x]; \ +- \ +- sum += v; \ +- sum2 += (double) v * (double) v; \ +- } \ +-} ++#define LOOP(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) in; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ TYPE v = p[x]; \ ++\ ++ sum += v; \ ++ sum2 += (double) v * (double) v; \ ++ } \ ++ } + + static int +-vips_deviate_scan( VipsStatistic *statistic, void *seq, +- int x, int y, void *in, int n ) ++vips_deviate_scan(VipsStatistic *statistic, void *seq, ++ int x, int y, void *in, int n) + { +- const int sz = n * vips_image_get_bands( statistic->in ); ++ const int sz = n * vips_image_get_bands(statistic->in); + + double *ss2 = (double *) seq; + +@@ -177,56 +178,72 @@ vips_deviate_scan( VipsStatistic *statistic, void *seq, + sum = ss2[0]; + sum2 = ss2[1]; + +- /* Now generate code for all types. ++ /* Now generate code for all types. + */ +- switch( vips_image_get_format( statistic->in ) ) { +- case VIPS_FORMAT_UCHAR: LOOP( unsigned char ); break; +- case VIPS_FORMAT_CHAR: LOOP( signed char ); break; +- case VIPS_FORMAT_USHORT: LOOP( unsigned short ); break; +- case VIPS_FORMAT_SHORT: LOOP( signed short ); break; +- case VIPS_FORMAT_UINT: LOOP( unsigned int ); break; +- case VIPS_FORMAT_INT: LOOP( signed int ); break; +- case VIPS_FORMAT_FLOAT: LOOP( float ); break; +- case VIPS_FORMAT_DOUBLE: LOOP( double ); break; +- +- default: ++ switch (vips_image_get_format(statistic->in)) { ++ case VIPS_FORMAT_UCHAR: ++ LOOP(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ LOOP(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ LOOP(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ LOOP(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ LOOP(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ LOOP(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ LOOP(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ LOOP(double); ++ break; ++ ++ default: + g_assert_not_reached(); + } + + ss2[0] = sum; + ss2[1] = sum2; + +- return( 0 ); ++ return (0); + } + + static void +-vips_deviate_class_init( VipsDeviateClass *class ) ++vips_deviate_class_init(VipsDeviateClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS( class ); ++ VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "deviate"; +- object_class->description = _( "find image standard deviation" ); ++ object_class->description = _("find image standard deviation"); + object_class->build = vips_deviate_build; + + sclass->start = vips_deviate_start; + sclass->scan = vips_deviate_scan; + sclass->stop = vips_deviate_stop; + +- VIPS_ARG_DOUBLE( class, "out", 2, +- _( "Output" ), +- _( "Output value" ), ++ VIPS_ARG_DOUBLE(class, "out", 2, ++ _("Output"), ++ _("Output value"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsDeviate, out ), +- -INFINITY, INFINITY, 0.0 ); ++ G_STRUCT_OFFSET(VipsDeviate, out), ++ -INFINITY, INFINITY, 0.0); + } + + static void +-vips_deviate_init( VipsDeviate *deviate ) ++vips_deviate_init(VipsDeviate *deviate) + { + } + +@@ -236,9 +253,9 @@ vips_deviate_init( VipsDeviate *deviate ) + * @out: (out): output pixel standard deviation + * @...: %NULL-terminated list of optional named arguments + * +- * This operation finds the standard deviation of all pixels in @in. It +- * operates on all bands of the input image: use vips_stats() if you need +- * to calculate an average for each band. ++ * This operation finds the standard deviation of all pixels in @in. It ++ * operates on all bands of the input image: use vips_stats() if you need ++ * to calculate an average for each band. + * + * Non-complex images only. + * +@@ -247,14 +264,14 @@ vips_deviate_init( VipsDeviate *deviate ) + * Returns: 0 on success, -1 on error + */ + int +-vips_deviate( VipsImage *in, double *out, ... ) ++vips_deviate(VipsImage *in, double *out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "deviate", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("deviate", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/divide.c b/libvips/arithmetic/divide.c +index 8f52e30991..d69eca1bac 100644 +--- a/libvips/arithmetic/divide.c ++++ b/libvips/arithmetic/divide.c +@@ -4,7 +4,7 @@ + * + * Author: Nicos Dessipris + * Written on: 02/05/1990 +- * Modified on: ++ * Modified on: + * 29/4/93 JC + * - now works for partial images + * 1/7/93 JC +@@ -25,9 +25,9 @@ + * - add gtkdoc comments + * 31/7/10 + * - remove liboil support +- * - avoid /0 ++ * - avoid /0 + * 6/11/11 +- * - rewrite as a class ++ * - rewrite as a class + * 22/2/12 + * - avoid /0 for complex as well + * 6/4/12 +@@ -37,28 +37,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -82,116 +82,139 @@ + typedef VipsBinary VipsDivide; + typedef VipsBinaryClass VipsDivideClass; + +-G_DEFINE_TYPE( VipsDivide, vips_divide, VIPS_TYPE_BINARY ); ++G_DEFINE_TYPE(VipsDivide, vips_divide, VIPS_TYPE_BINARY); + + /* Complex divide. + */ + #ifdef USE_MODARG_DIV + + /* This is going to be much slower */ +-#define CLOOP( TYPE ) { \ +- TYPE * restrict left = (TYPE *) in[0]; \ +- TYPE * restrict right = (TYPE *) in[1]; \ +- TYPE * restrict q = (TYPE *) out; \ +- int i; \ +- \ +- for( i = 0; i < sz; i++ ) { \ +- if( right[0] == 0.0 && \ +- right[1] == 0.0 ) { \ +- q[0] = 0.0; \ +- q[1] = 0.0; \ ++#define CLOOP(TYPE) \ ++ { \ ++ TYPE *restrict left = (TYPE *) in[0]; \ ++ TYPE *restrict right = (TYPE *) in[1]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++ int i; \ ++\ ++ for (i = 0; i < sz; i++) { \ ++ if (right[0] == 0.0 && \ ++ right[1] == 0.0) { \ ++ q[0] = 0.0; \ ++ q[1] = 0.0; \ ++ } \ ++ else { \ ++ double arg = atan2(left[1], left[0]) - \ ++ atan2(right[1], right[0]); \ ++ double mod = hypot(left[1], left[0]) / \ ++ hypot(right[1], right[0]); \ ++\ ++ q[0] = mod * cos(arg); \ ++ q[1] = mod * sin(arg); \ ++ } \ ++\ ++ left += 2; \ ++ right += 2; \ ++ q += 2; \ + } \ +- else { \ +- double arg = atan2( left[1], left[0] ) - \ +- atan2( right[1], right[0] ); \ +- double mod = hypot( left[1], left[0] ) / \ +- hypot( right[1], right[0] ); \ +- \ +- q[0] = mod * cos( arg ); \ +- q[1] = mod * sin( arg ); \ +- } \ +- \ +- left += 2; \ +- right += 2; \ +- q += 2; \ +- } \ +-} ++ } + + #else /* USE_MODARG_DIV */ + +-#define CLOOP( TYPE ) { \ +- TYPE * restrict left = (TYPE *) in[0]; \ +- TYPE * restrict right = (TYPE *) in[1]; \ +- TYPE * restrict q = (TYPE *) out; \ +- int i; \ +- \ +- for( i = 0; i < sz; i++ ) { \ +- if( right[0] == 0.0 && \ +- right[1] == 0.0 ) { \ +- q[0] = 0.0; \ +- q[1] = 0.0; \ +- } \ +- else if( VIPS_FABS( right[0] ) > VIPS_FABS( right[1] ) ) { \ +- double a = right[1] / right[0]; \ +- double b = right[0] + right[1] * a; \ +- \ +- q[0] = (left[0] + left[1] * a) / b; \ +- q[1] = (left[1] - left[0] * a) / b; \ ++#define CLOOP(TYPE) \ ++ { \ ++ TYPE *restrict left = (TYPE *) in[0]; \ ++ TYPE *restrict right = (TYPE *) in[1]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++ int i; \ ++\ ++ for (i = 0; i < sz; i++) { \ ++ if (right[0] == 0.0 && \ ++ right[1] == 0.0) { \ ++ q[0] = 0.0; \ ++ q[1] = 0.0; \ ++ } \ ++ else if (VIPS_FABS(right[0]) > VIPS_FABS(right[1])) { \ ++ double a = right[1] / right[0]; \ ++ double b = right[0] + right[1] * a; \ ++\ ++ q[0] = (left[0] + left[1] * a) / b; \ ++ q[1] = (left[1] - left[0] * a) / b; \ ++ } \ ++ else { \ ++ double a = right[0] / right[1]; \ ++ double b = right[1] + right[0] * a; \ ++\ ++ q[0] = (left[0] * a + left[1]) / b; \ ++ q[1] = (left[1] * a - left[0]) / b; \ ++ } \ ++\ ++ left += 2; \ ++ right += 2; \ ++ q += 2; \ + } \ +- else { \ +- double a = right[0] / right[1]; \ +- double b = right[1] + right[0] * a; \ +- \ +- q[0] = (left[0] * a + left[1]) / b; \ +- q[1] = (left[1] * a - left[0]) / b; \ +- } \ +- \ +- left += 2; \ +- right += 2; \ +- q += 2; \ +- } \ +-} ++ } + + #endif /* USE_MODARG_DIV */ + + /* Real divide. Cast in to OUT before divide so we work for float output. + */ +-#define RLOOP( IN, OUT ) { \ +- IN * restrict left = (IN *) in[0]; \ +- IN * restrict right = (IN *) in[1]; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = right[x] == 0 ? 0 : (OUT) left[x] / (OUT) right[x]; \ +-} ++#define RLOOP(IN, OUT) \ ++ { \ ++ IN *restrict left = (IN *) in[0]; \ ++ IN *restrict right = (IN *) in[1]; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = right[x] == 0 ? 0 : (OUT) left[x] / (OUT) right[x]; \ ++ } + + static void +-vips_divide_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_divide_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsImage *im = arithmetic->ready[0]; +- const int sz = width * vips_image_get_bands( im ); ++ const int sz = width * vips_image_get_bands(im); + + int x; + +- /* Keep types here in sync with vips_divide_format_table[] ++ /* Keep types here in sync with vips_divide_format_table[] + * below. +- */ +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_CHAR: RLOOP( signed char, float ); break; +- case VIPS_FORMAT_UCHAR: RLOOP( unsigned char, float ); break; +- case VIPS_FORMAT_SHORT: RLOOP( signed short, float ); break; +- case VIPS_FORMAT_USHORT: RLOOP( unsigned short, float ); break; +- case VIPS_FORMAT_INT: RLOOP( signed int, float ); break; +- case VIPS_FORMAT_UINT: RLOOP( unsigned int, float ); break; +- case VIPS_FORMAT_FLOAT: RLOOP( float, float ); break; +- case VIPS_FORMAT_DOUBLE: RLOOP( double, double ); break; +- case VIPS_FORMAT_COMPLEX: CLOOP( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: CLOOP( double ); break; +- +- default: ++ */ ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_CHAR: ++ RLOOP(signed char, float); ++ break; ++ case VIPS_FORMAT_UCHAR: ++ RLOOP(unsigned char, float); ++ break; ++ case VIPS_FORMAT_SHORT: ++ RLOOP(signed short, float); ++ break; ++ case VIPS_FORMAT_USHORT: ++ RLOOP(unsigned short, float); ++ break; ++ case VIPS_FORMAT_INT: ++ RLOOP(signed int, float); ++ break; ++ case VIPS_FORMAT_UINT: ++ RLOOP(unsigned int, float); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ RLOOP(float, float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ RLOOP(double, double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ CLOOP(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ CLOOP(double); ++ break; ++ ++ default: + g_assert_not_reached(); +- } ++ } + } + + /* Save a bit of typing. +@@ -207,7 +230,7 @@ vips_divide_buffer( VipsArithmetic *arithmetic, + #define D VIPS_FORMAT_DOUBLE + #define DX VIPS_FORMAT_DPCOMPLEX + +-/* Type promotion for division. Sign and value preserving. Make sure ++/* Type promotion for division. Sign and value preserving. Make sure + * these match the case statement in divide_buffer() above. + */ + static VipsBandFormat vips_divide_format_table[10] = { +@@ -216,28 +239,28 @@ static VipsBandFormat vips_divide_format_table[10] = { + }; + + static void +-vips_divide_class_init( VipsDivideClass *class ) ++vips_divide_class_init(VipsDivideClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + object_class->nickname = "divide"; +- object_class->description = _( "divide two images" ); ++ object_class->description = _("divide two images"); + + aclass->process_line = vips_divide_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_divide_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_divide_format_table); + } + + static void +-vips_divide_init( VipsDivide *divide ) ++vips_divide_init(VipsDivide *divide) + { + } + + /** + * vips_divide: +- * @left: input image +- * @right: input image ++ * @left: input image ++ * @right: input image + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +@@ -247,14 +270,14 @@ vips_divide_init( VipsDivide *divide ) + * If the images differ in size, the smaller image is enlarged to match the + * larger by adding zero pixels along the bottom and right. + * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +- * The two input images are cast up to the smallest common format (see table +- * Smallest common format in +- * arithmetic), then the ++ * The two input images are cast up to the smallest common format (see table ++ * Smallest common format in ++ * arithmetic), then the + * following table is used to determine the output type: + * + * +@@ -319,14 +342,14 @@ vips_divide_init( VipsDivide *divide ) + * Returns: 0 on success, -1 on error + */ + int +-vips_divide( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_divide(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "divide", ap, left, right, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("divide", ap, left, right, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/find_trim.c b/libvips/arithmetic/find_trim.c +index 79b4f40218..d82431adf2 100644 +--- a/libvips/arithmetic/find_trim.c ++++ b/libvips/arithmetic/find_trim.c +@@ -2,35 +2,35 @@ + * + * 26/7/17 + * - from a ruby example +- * 18/9/17 kleisauke ++ * 18/9/17 kleisauke + * - missing bandor + * - only flatten if there is an alpha + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -64,13 +64,13 @@ typedef struct _VipsFindTrim { + + typedef VipsOperationClass VipsFindTrimClass; + +-G_DEFINE_TYPE( VipsFindTrim, vips_find_trim, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsFindTrim, vips_find_trim, VIPS_TYPE_OPERATION); + + static int +-vips_find_trim_build( VipsObject *object ) ++vips_find_trim_build(VipsObject *object) + { + VipsFindTrim *find_trim = (VipsFindTrim *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 20 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 20); + + VipsImage *in; + double *background; +@@ -83,89 +83,89 @@ vips_find_trim_build( VipsObject *object ) + double right; + double bottom; + +- if( VIPS_OBJECT_CLASS( vips_find_trim_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_find_trim_parent_class)->build(object)) ++ return (-1); + +- /* Is "background" unset? Default to the correct value ++ /* Is "background" unset? Default to the correct value + * for this interpretation. + */ +- if( !vips_object_argument_isset( object, "background" ) ) +- if( find_trim->in->Type == VIPS_INTERPRETATION_GREY16 || +- find_trim->in->Type == VIPS_INTERPRETATION_RGB16 ) { +- vips_area_unref( VIPS_AREA( find_trim->background ) ); +- find_trim->background = +- vips_array_double_newv( 1, 65535.0 ); ++ if (!vips_object_argument_isset(object, "background")) ++ if (find_trim->in->Type == VIPS_INTERPRETATION_GREY16 || ++ find_trim->in->Type == VIPS_INTERPRETATION_RGB16) { ++ vips_area_unref(VIPS_AREA(find_trim->background)); ++ find_trim->background = ++ vips_array_double_newv(1, 65535.0); + } + +- /* Flatten out alpha, if any. ++ /* Flatten out alpha, if any. + */ + in = find_trim->in; +- if( vips_image_hasalpha( in ) ) { +- if( vips_flatten( in, &t[0], +- "background", find_trim->background, +- NULL ) ) +- return( -1 ); ++ if (vips_image_hasalpha(in)) { ++ if (vips_flatten(in, &t[0], ++ "background", find_trim->background, ++ NULL)) ++ return (-1); + in = t[0]; + } + + /* We want to subtract the bg. + */ +- background = vips_array_double_get( find_trim->background, &n ); +- if( !(neg_bg = VIPS_ARRAY( find_trim, n, double )) || +- !(ones = VIPS_ARRAY( find_trim, n, double )) ) +- return( -1 ); +- for( i = 0; i < n; i++ ) { ++ background = vips_array_double_get(find_trim->background, &n); ++ if (!(neg_bg = VIPS_ARRAY(find_trim, n, double)) || ++ !(ones = VIPS_ARRAY(find_trim, n, double))) ++ return (-1); ++ for (i = 0; i < n; i++) { + neg_bg[i] = -1 * background[i]; + ones[i] = 1.0; + } + + /* Smooth, find difference from bg, abs, threshold. + */ +- if( vips_median( in, &t[1], 3, NULL ) || +- vips_linear( t[1], &t[2], ones, neg_bg, n, NULL ) || +- vips_abs( t[2], &t[3], NULL ) || +- vips_more_const1( t[3], &t[4], find_trim->threshold, NULL ) || +- vips_bandor( t[4], &t[5], NULL ) ) +- return( -1 ); ++ if (vips_median(in, &t[1], 3, NULL) || ++ vips_linear(t[1], &t[2], ones, neg_bg, n, NULL) || ++ vips_abs(t[2], &t[3], NULL) || ++ vips_more_const1(t[3], &t[4], find_trim->threshold, NULL) || ++ vips_bandor(t[4], &t[5], NULL)) ++ return (-1); + in = t[5]; + +- /* t[6] == column sums, t[7] == row sums. ++ /* t[6] == column sums, t[7] == row sums. + */ +- if( vips_project( in, &t[6], &t[7], NULL ) ) +- return( -1 ); ++ if (vips_project(in, &t[6], &t[7], NULL)) ++ return (-1); + + /* t[8] == search column sums in from left. + */ +- if( vips_profile( t[6], &t[8], &t[9], NULL ) || +- vips_avg( t[9], &left, NULL ) ) +- return( -1 ); +- if( vips_flip( t[6], &t[10], VIPS_DIRECTION_HORIZONTAL, NULL ) || +- vips_profile( t[10], &t[11], &t[12], NULL ) || +- vips_avg( t[12], &right, NULL ) ) +- return( -1 ); ++ if (vips_profile(t[6], &t[8], &t[9], NULL) || ++ vips_avg(t[9], &left, NULL)) ++ return (-1); ++ if (vips_flip(t[6], &t[10], VIPS_DIRECTION_HORIZONTAL, NULL) || ++ vips_profile(t[10], &t[11], &t[12], NULL) || ++ vips_avg(t[12], &right, NULL)) ++ return (-1); + + /* t[8] == search column sums in from left. + */ +- if( vips_profile( t[7], &t[13], &t[14], NULL ) || +- vips_avg( t[13], &top, NULL ) ) +- return( -1 ); +- if( vips_flip( t[7], &t[15], VIPS_DIRECTION_VERTICAL, NULL ) || +- vips_profile( t[15], &t[16], &t[17], NULL ) || +- vips_avg( t[16], &bottom, NULL ) ) +- return( -1 ); +- +- g_object_set( find_trim, ++ if (vips_profile(t[7], &t[13], &t[14], NULL) || ++ vips_avg(t[13], &top, NULL)) ++ return (-1); ++ if (vips_flip(t[7], &t[15], VIPS_DIRECTION_VERTICAL, NULL) || ++ vips_profile(t[15], &t[16], &t[17], NULL) || ++ vips_avg(t[16], &bottom, NULL)) ++ return (-1); ++ ++ g_object_set(find_trim, + "left", (int) left, + "top", (int) top, +- "width", (int) VIPS_MAX( 0, (t[6]->Xsize - right) - left ), +- "height", (int) VIPS_MAX( 0, (t[7]->Ysize - bottom) - top ), +- NULL ); ++ "width", (int) VIPS_MAX(0, (t[6]->Xsize - right) - left), ++ "height", (int) VIPS_MAX(0, (t[7]->Ysize - bottom) - top), ++ NULL); + +- return( 0 ); ++ return (0); + } + + static void +-vips_find_trim_class_init( VipsFindTrimClass *class ) ++vips_find_trim_class_init(VipsFindTrimClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +@@ -174,66 +174,65 @@ vips_find_trim_class_init( VipsFindTrimClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "find_trim"; +- object_class->description = _( "search an image for non-edge areas" ); ++ object_class->description = _("search an image for non-edge areas"); + object_class->build = vips_find_trim_build; + +- //operation_class->flags = VIPS_OPERATION_SEQUENTIAL; ++ // operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Image to find_trim" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Image to find_trim"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsFindTrim, in ) ); ++ G_STRUCT_OFFSET(VipsFindTrim, in)); + +- VIPS_ARG_DOUBLE( class, "threshold", 2, +- _( "Threshold" ), +- _( "Object threshold" ), ++ VIPS_ARG_DOUBLE(class, "threshold", 2, ++ _("Threshold"), ++ _("Object threshold"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsFindTrim, threshold ), +- 0, INFINITY, 10.0 ); ++ G_STRUCT_OFFSET(VipsFindTrim, threshold), ++ 0, INFINITY, 10.0); + +- VIPS_ARG_BOXED( class, "background", 3, +- _( "Background" ), +- _( "Color for background pixels" ), ++ VIPS_ARG_BOXED(class, "background", 3, ++ _("Background"), ++ _("Color for background pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsFindTrim, background ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsFindTrim, background), ++ VIPS_TYPE_ARRAY_DOUBLE); + +- VIPS_ARG_INT( class, "left", 5, +- _( "Left" ), +- _( "Left edge of image" ), ++ VIPS_ARG_INT(class, "left", 5, ++ _("Left"), ++ _("Left edge of image"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsFindTrim, left ), +- 0, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsFindTrim, left), ++ 0, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "top", 11, +- _( "Top" ), +- _( "Top edge of extract area" ), ++ VIPS_ARG_INT(class, "top", 11, ++ _("Top"), ++ _("Top edge of extract area"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsFindTrim, top ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsFindTrim, top), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "width", 12, +- _( "Width" ), +- _( "Width of extract area" ), ++ VIPS_ARG_INT(class, "width", 12, ++ _("Width"), ++ _("Width of extract area"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsFindTrim, width ), +- 0, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsFindTrim, width), ++ 0, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "height", 13, +- _( "Height" ), +- _( "Height of extract area" ), ++ VIPS_ARG_INT(class, "height", 13, ++ _("Height"), ++ _("Height of extract area"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsFindTrim, height ), +- 0, VIPS_MAX_COORD, 1 ); +- ++ G_STRUCT_OFFSET(VipsFindTrim, height), ++ 0, VIPS_MAX_COORD, 1); + } + + static void +-vips_find_trim_init( VipsFindTrim *find_trim ) ++vips_find_trim_init(VipsFindTrim *find_trim) + { + find_trim->threshold = 10; +- find_trim->background = vips_array_double_newv( 1, 255.0 ); ++ find_trim->background = vips_array_double_newv(1, 255.0); + } + + /** +@@ -250,9 +249,9 @@ vips_find_trim_init( VipsFindTrim *find_trim ) + * * @threshold: %gdouble, background / object threshold + * * @background: #VipsArrayDouble, background colour + * +- * Search @in for the bounding box of the non-background area. ++ * Search @in for the bounding box of the non-background area. + * +- * Any alpha is flattened out, then the image is median-filtered, all the row ++ * Any alpha is flattened out, then the image is median-filtered, all the row + * and column sums of the absolute + * difference from @background are calculated in a + * single pass, then the first row or column in each of the +@@ -262,29 +261,29 @@ vips_find_trim_init( VipsFindTrim *find_trim ) + * If the image is entirely background, vips_find_trim() returns @width == 0 + * and @height == 0. + * +- * @background defaults to 255, or 65535 for 16-bit images. Set another value, ++ * @background defaults to 255, or 65535 for 16-bit images. Set another value, + * or use vips_getpoint() to pick a value from an edge. You'll need to flatten + * before vips_getpoint() to get a correct background value. + * +- * @threshold defaults to 10. ++ * @threshold defaults to 10. + * +- * The image needs to be at least 3x3 pixels in size. ++ * The image needs to be at least 3x3 pixels in size. + * + * See also: vips_getpoint(), vips_extract_area(), vips_smartcrop(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_find_trim( VipsImage *in, +- int *left, int *top, int *width, int *height, ... ) ++vips_find_trim(VipsImage *in, ++ int *left, int *top, int *width, int *height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "find_trim", ap, in, +- left, top, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("find_trim", ap, in, ++ left, top, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/getpoint.c b/libvips/arithmetic/getpoint.c +index 8d70d4cb3a..647198b9fd 100644 +--- a/libvips/arithmetic/getpoint.c ++++ b/libvips/arithmetic/getpoint.c +@@ -27,28 +27,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -83,50 +83,50 @@ typedef struct _VipsGetpoint { + + typedef VipsOperationClass VipsGetpointClass; + +-G_DEFINE_TYPE( VipsGetpoint, vips_getpoint, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsGetpoint, vips_getpoint, VIPS_TYPE_OPERATION); + + static int +-vips_getpoint_build( VipsObject *object ) ++vips_getpoint_build(VipsObject *object) + { + VipsGetpoint *getpoint = (VipsGetpoint *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); + + double *vector; + VipsArrayDouble *out_array; + +- if( VIPS_OBJECT_CLASS( vips_getpoint_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_getpoint_parent_class)->build(object)) ++ return (-1); + + /* Crop, decode and unpack to double. + */ +- if( vips_crop( getpoint->in, &t[0], +- getpoint->x, getpoint->y, 1, 1, NULL ) || +- vips_image_decode( t[0], &t[1] ) || +- vips_cast( t[1], &t[2], VIPS_FORMAT_DOUBLE, NULL ) ) +- return( -1 ); ++ if (vips_crop(getpoint->in, &t[0], ++ getpoint->x, getpoint->y, 1, 1, NULL) || ++ vips_image_decode(t[0], &t[1]) || ++ vips_cast(t[1], &t[2], VIPS_FORMAT_DOUBLE, NULL)) ++ return (-1); + +- /* To a mem buffer, then copy to out. ++ /* To a mem buffer, then copy to out. + */ +- vips_image_set_int( t[2], "hide-progress", 1 ); +- if( !(t[3] = vips_image_new_memory()) || +- vips_image_write( t[2], t[3] ) ) +- return( -1 ); ++ vips_image_set_int(t[2], "hide-progress", 1); ++ if (!(t[3] = vips_image_new_memory()) || ++ vips_image_write(t[2], t[3])) ++ return (-1); + +- if( !(vector = VIPS_ARRAY( getpoint->in, t[3]->Bands, double )) ) +- return( -1 ); +- memcpy( vector, t[3]->data, VIPS_IMAGE_SIZEOF_PEL( t[3] ) ); ++ if (!(vector = VIPS_ARRAY(getpoint->in, t[3]->Bands, double))) ++ return (-1); ++ memcpy(vector, t[3]->data, VIPS_IMAGE_SIZEOF_PEL(t[3])); + +- out_array = vips_array_double_new( vector, t[3]->Bands ); +- g_object_set( object, ++ out_array = vips_array_double_new(vector, t[3]->Bands); ++ g_object_set(object, + "out_array", out_array, +- NULL ); +- vips_area_unref( VIPS_AREA( out_array ) ); ++ NULL); ++ vips_area_unref(VIPS_AREA(out_array)); + +- return( 0 ); ++ return (0); + } + + static void +-vips_getpoint_class_init( VipsGetpointClass *class ) ++vips_getpoint_class_init(VipsGetpointClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +@@ -135,40 +135,39 @@ vips_getpoint_class_init( VipsGetpointClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "getpoint"; +- object_class->description = _( "read a point from an image" ); ++ object_class->description = _("read a point from an image"); + object_class->build = vips_getpoint_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGetpoint, in ) ); ++ G_STRUCT_OFFSET(VipsGetpoint, in)); + +- VIPS_ARG_BOXED( class, "out_array", 2, +- _( "Output array" ), +- _( "Array of output values" ), ++ VIPS_ARG_BOXED(class, "out_array", 2, ++ _("Output array"), ++ _("Array of output values"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsGetpoint, out_array ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsGetpoint, out_array), ++ VIPS_TYPE_ARRAY_DOUBLE); + +- VIPS_ARG_INT( class, "x", 5, +- _( "x" ), +- _( "Point to read" ), ++ VIPS_ARG_INT(class, "x", 5, ++ _("x"), ++ _("Point to read"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGetpoint, x ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsGetpoint, x), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "y", 6, +- _( "y" ), +- _( "Point to read" ), ++ VIPS_ARG_INT(class, "y", 6, ++ _("y"), ++ _("Point to read"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGetpoint, y ), +- 0, VIPS_MAX_COORD, 0 ); +- ++ G_STRUCT_OFFSET(VipsGetpoint, y), ++ 0, VIPS_MAX_COORD, 0); + } + + static void +-vips_getpoint_init( VipsGetpoint *getpoint ) ++vips_getpoint_init(VipsGetpoint *getpoint) + { + } + +@@ -181,7 +180,7 @@ vips_getpoint_init( VipsGetpoint *getpoint ) + * @y: position to read + * @...: %NULL-terminated list of optional named arguments + * +- * Reads a single pixel on an image. ++ * Reads a single pixel on an image. + * + * The pixel values are returned in @vector, the length of the + * array in @n. You must free the array with g_free() when you are done with +@@ -192,29 +191,29 @@ vips_getpoint_init( VipsGetpoint *getpoint ) + * Returns: 0 on success, or -1 on error. + */ + int +-vips_getpoint( VipsImage *in, double **vector, int *n, int x, int y, ... ) ++vips_getpoint(VipsImage *in, double **vector, int *n, int x, int y, ...) + { + va_list ap; + VipsArrayDouble *out_array; + VipsArea *area; + int result; + +- va_start( ap, y ); +- result = vips_call_split( "getpoint", ap, in, &out_array, x, y ); +- va_end( ap ); ++ va_start(ap, y); ++ result = vips_call_split("getpoint", ap, in, &out_array, x, y); ++ va_end(ap); + +- if( result ) +- return( -1 ); ++ if (result) ++ return (-1); + +- area = VIPS_AREA( out_array ); +- *vector = VIPS_ARRAY( NULL, area->n, double ); +- if( !*vector ) { +- vips_area_unref( area ); +- return( -1 ); ++ area = VIPS_AREA(out_array); ++ *vector = VIPS_ARRAY(NULL, area->n, double); ++ if (!*vector) { ++ vips_area_unref(area); ++ return (-1); + } +- memcpy( *vector, area->data, area->n * area->sizeof_type ); ++ memcpy(*vector, area->data, area->n * area->sizeof_type); + *n = area->n; +- vips_area_unref( area ); ++ vips_area_unref(area); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/arithmetic/hist_find.c b/libvips/arithmetic/hist_find.c +index 025de35ac9..76e2f7bb7f 100644 +--- a/libvips/arithmetic/hist_find.c ++++ b/libvips/arithmetic/hist_find.c +@@ -32,28 +32,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -71,11 +71,11 @@ + /* Accumulate a histogram in one of these. + */ + typedef struct { +- int n_bands; /* Number of bands in output */ ++ int n_bands; /* Number of bands in output */ + int band; /* If one band in out, which band of input */ + int size; /* Number of bins for each band */ + int mx; /* Maximum value we have seen */ +- VipsPel **bins; /* double or uint bins */ ++ VipsPel **bins; /* double or uint bins */ + } Histogram; + + typedef struct _VipsHistFind { +@@ -91,7 +91,7 @@ typedef struct _VipsHistFind { + + /* Write hist to this output image. + */ +- VipsImage *out; ++ VipsImage *out; + + /* TRUE for "large" histograms ... causes double output rather than + * uint. +@@ -102,29 +102,29 @@ typedef struct _VipsHistFind { + + typedef VipsStatisticClass VipsHistFindClass; + +-G_DEFINE_TYPE( VipsHistFind, vips_hist_find, VIPS_TYPE_STATISTIC ); ++G_DEFINE_TYPE(VipsHistFind, vips_hist_find, VIPS_TYPE_STATISTIC); + + /* Build a Histogram. + */ + static Histogram * +-histogram_new( VipsHistFind *hist_find, int n_bands, int band, int size ) ++histogram_new(VipsHistFind *hist_find, int n_bands, int band, int size) + { + /* We won't use all of this for uint accumulators. + */ +- int n_bytes = size * sizeof( double ); ++ int n_bytes = size * sizeof(double); + + Histogram *hist; + int i; + +- if( !(hist = VIPS_NEW( hist_find, Histogram )) || +- !(hist->bins = VIPS_ARRAY( hist_find, n_bands, VipsPel * )) ) +- return( NULL ); ++ if (!(hist = VIPS_NEW(hist_find, Histogram)) || ++ !(hist->bins = VIPS_ARRAY(hist_find, n_bands, VipsPel *))) ++ return (NULL); + +- for( i = 0; i < n_bands; i++ ) { +- if( !(hist->bins[i] = VIPS_ARRAY( hist_find, +- n_bytes, VipsPel )) ) +- return( NULL ); +- memset( hist->bins[i], 0, n_bytes ); ++ for (i = 0; i < n_bands; i++) { ++ if (!(hist->bins[i] = VIPS_ARRAY(hist_find, ++ n_bytes, VipsPel))) ++ return (NULL); ++ memset(hist->bins[i], 0, n_bytes); + } + + hist->n_bands = n_bands; +@@ -132,241 +132,257 @@ histogram_new( VipsHistFind *hist_find, int n_bands, int band, int size ) + hist->size = size; + hist->mx = 0; + +- return( hist ); ++ return (hist); + } + + static int +-vips_hist_find_build( VipsObject *object ) ++vips_hist_find_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsStatistic *statistic = VIPS_STATISTIC( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsStatistic *statistic = VIPS_STATISTIC(object); + VipsHistFind *hist_find = (VipsHistFind *) object; + VipsImage *in = statistic->in; + + VipsPel *obuffer; + +- g_object_set( object, ++ g_object_set(object, + "out", vips_image_new(), +- NULL ); ++ NULL); + +- if( in && +- vips_check_bandno( class->nickname, in, hist_find->band ) ) +- return( -1 ); ++ if (in && ++ vips_check_bandno(class->nickname, in, hist_find->band)) ++ return (-1); + + /* Is this a large histogram? We want to avoid overflow of the uint + * accumulators. + */ +- if( in && +- (guint64) in->Xsize * (guint64) in->Ysize >= +- ((guint64) 1 << 32) ) ++ if (in && ++ (guint64) in->Xsize * (guint64) in->Ysize >= ++ ((guint64) 1 << 32)) + hist_find->large = TRUE; + + /* main hist made on in vips_hist_find_start(). + */ + +- if( VIPS_OBJECT_CLASS( vips_hist_find_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_hist_find_parent_class)->build(object)) ++ return (-1); + + /* Make the output image. + */ +- if( vips_image_pipelinev( hist_find->out, +- VIPS_DEMAND_STYLE_ANY, statistic->ready, NULL ) ) +- return( -1 ); +- vips_image_init_fields( hist_find->out, +- hist_find->hist->mx + 1, 1, hist_find->hist->n_bands, +- hist_find->large ? VIPS_FORMAT_DOUBLE : VIPS_FORMAT_UINT, +- VIPS_CODING_NONE, VIPS_INTERPRETATION_HISTOGRAM, 1.0, 1.0 ); ++ if (vips_image_pipelinev(hist_find->out, ++ VIPS_DEMAND_STYLE_ANY, statistic->ready, NULL)) ++ return (-1); ++ vips_image_init_fields(hist_find->out, ++ hist_find->hist->mx + 1, 1, hist_find->hist->n_bands, ++ hist_find->large ? VIPS_FORMAT_DOUBLE : VIPS_FORMAT_UINT, ++ VIPS_CODING_NONE, VIPS_INTERPRETATION_HISTOGRAM, 1.0, 1.0); + + /* Interleave for output. + */ +- if( !(obuffer = VIPS_ARRAY( object, +- VIPS_IMAGE_SIZEOF_LINE( hist_find->out ), VipsPel )) ) +- return( -1 ); +- +-#define INTERLEAVE( TYPE ) G_STMT_START { \ +- TYPE **bins = (TYPE **) hist_find->hist->bins; \ +- \ +- TYPE *q; \ +- int i, j; \ +- \ +- for( q = (TYPE *) obuffer, j = 0; j < hist_find->out->Xsize; j++ ) \ +- for( i = 0; i < hist_find->out->Bands; i++ ) \ +- *q++ = bins[i][j]; \ +-} G_STMT_END +- +- if( hist_find->large ) +- INTERLEAVE( double ); ++ if (!(obuffer = VIPS_ARRAY(object, ++ VIPS_IMAGE_SIZEOF_LINE(hist_find->out), VipsPel))) ++ return (-1); ++ ++#define INTERLEAVE(TYPE) \ ++ G_STMT_START \ ++ { \ ++ TYPE **bins = (TYPE **) hist_find->hist->bins; \ ++\ ++ TYPE *q; \ ++ int i, j; \ ++\ ++ for (q = (TYPE *) obuffer, j = 0; j < hist_find->out->Xsize; j++) \ ++ for (i = 0; i < hist_find->out->Bands; i++) \ ++ *q++ = bins[i][j]; \ ++ } \ ++ G_STMT_END ++ ++ if (hist_find->large) ++ INTERLEAVE(double); + else +- INTERLEAVE( unsigned int ); ++ INTERLEAVE(unsigned int); + +- if( vips_image_write_line( hist_find->out, 0, obuffer ) ) +- return( -1 ); ++ if (vips_image_write_line(hist_find->out, 0, obuffer)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Build a sub-hist, based on the main hist. + */ + static void * +-vips_hist_find_start( VipsStatistic *statistic ) ++vips_hist_find_start(VipsStatistic *statistic) + { + VipsHistFind *hist_find = (VipsHistFind *) statistic; + + /* Make the main hist, if necessary. + */ +- if( !hist_find->hist ) +- hist_find->hist = histogram_new( hist_find, +- hist_find->band == -1 ? +- statistic->ready->Bands : 1, +- hist_find->band, +- statistic->ready->BandFmt == VIPS_FORMAT_UCHAR ? +- 256 : 65536 ); +- +- return( (void *) histogram_new( hist_find, +- hist_find->hist->n_bands, +- hist_find->hist->band, +- hist_find->hist->size ) ); ++ if (!hist_find->hist) ++ hist_find->hist = histogram_new(hist_find, ++ hist_find->band == -1 ? statistic->ready->Bands : 1, ++ hist_find->band, ++ statistic->ready->BandFmt == VIPS_FORMAT_UCHAR ? 256 : 65536); ++ ++ return ((void *) histogram_new(hist_find, ++ hist_find->hist->n_bands, ++ hist_find->hist->band, ++ hist_find->hist->size)); + } + + /* Join a sub-hist onto the main hist. + */ + static int +-vips_hist_find_stop( VipsStatistic *statistic, void *seq ) ++vips_hist_find_stop(VipsStatistic *statistic, void *seq) + { + Histogram *sub_hist = (Histogram *) seq; + VipsHistFind *hist_find = (VipsHistFind *) statistic; +- Histogram *hist = hist_find->hist; ++ Histogram *hist = hist_find->hist; + + int i, j; + +- g_assert( sub_hist->n_bands == hist->n_bands && +- sub_hist->size == hist->size ); ++ g_assert(sub_hist->n_bands == hist->n_bands && ++ sub_hist->size == hist->size); + + /* Add on sub-data. + */ +- hist->mx = VIPS_MAX( hist->mx, sub_hist->mx ); +- +-#define SUM( TYPE ) G_STMT_START { \ +- TYPE **main_bins = (TYPE **) hist->bins; \ +- TYPE **sub_bins = (TYPE **) sub_hist->bins; \ +- \ +- for( i = 0; i < hist->n_bands; i++ ) \ +- for( j = 0; j < hist->size; j++ ) \ +- main_bins[i][j] += sub_bins[i][j]; \ +-} G_STMT_END +- +- if( hist_find->large ) +- SUM( double ); ++ hist->mx = VIPS_MAX(hist->mx, sub_hist->mx); ++ ++#define SUM(TYPE) \ ++ G_STMT_START \ ++ { \ ++ TYPE **main_bins = (TYPE **) hist->bins; \ ++ TYPE **sub_bins = (TYPE **) sub_hist->bins; \ ++\ ++ for (i = 0; i < hist->n_bands; i++) \ ++ for (j = 0; j < hist->size; j++) \ ++ main_bins[i][j] += sub_bins[i][j]; \ ++ } \ ++ G_STMT_END ++ ++ if (hist_find->large) ++ SUM(double); + else +- SUM( unsigned int ); +- ++ SUM(unsigned int); ++ + /* Blank out sub-hist to make sure we can't add it again. + */ + sub_hist->mx = 0; +- for( i = 0; i < sub_hist->n_bands; i++ ) ++ for (i = 0; i < sub_hist->n_bands; i++) + sub_hist->bins[i] = NULL; + +- return( 0 ); ++ return (0); + } + +-#define SCANOP G_STMT_START { \ +- for( z = 0; z < nb; z++ ) { \ +- int v = p[z]; \ +- \ +- if( v > mx ) \ +- mx = v; \ +- \ +- bins[z][v] += 1; \ ++#define SCANOP \ ++ G_STMT_START \ ++ { \ ++ for (z = 0; z < nb; z++) { \ ++ int v = p[z]; \ ++\ ++ if (v > mx) \ ++ mx = v; \ ++\ ++ bins[z][v] += 1; \ ++ } \ ++\ ++ p += nb; \ + } \ +- \ +- p += nb; \ +-} G_STMT_END ++ G_STMT_END + + /* No need to track max for uchar images (it's always 255). + */ +-#define UCSCANOP G_STMT_START { \ +- for( z = 0; z < nb; z++ ) { \ +- int v = p[z]; \ +- \ +- bins[z][v] += 1; \ ++#define UCSCANOP \ ++ G_STMT_START \ ++ { \ ++ for (z = 0; z < nb; z++) { \ ++ int v = p[z]; \ ++\ ++ bins[z][v] += 1; \ ++ } \ ++\ ++ p += nb; \ + } \ +- \ +- p += nb; \ +-} G_STMT_END ++ G_STMT_END + + /* Hist of all bands. This one is just about worth unrolling. + */ +-#define SCAN( IMAGE_TYPE, HIST_TYPE, OP ) G_STMT_START { \ +- HIST_TYPE **bins = (HIST_TYPE **) hist->bins; \ +- IMAGE_TYPE *p = (IMAGE_TYPE *) in; \ +- \ +- int z; \ +- \ +- VIPS_UNROLL( n, OP ); \ +-} G_STMT_END ++#define SCAN(IMAGE_TYPE, HIST_TYPE, OP) \ ++ G_STMT_START \ ++ { \ ++ HIST_TYPE **bins = (HIST_TYPE **) hist->bins; \ ++ IMAGE_TYPE *p = (IMAGE_TYPE *) in; \ ++\ ++ int z; \ ++\ ++ VIPS_UNROLL(n, OP); \ ++ } \ ++ G_STMT_END + + /* Hist of selected band. + */ +-#define SCAN1( IMAGE_TYPE, HIST_TYPE ) G_STMT_START { \ +- HIST_TYPE *bins = (HIST_TYPE *) hist->bins[0]; \ +- IMAGE_TYPE *p = (IMAGE_TYPE *) in; \ +- int max = nb * n; \ +- \ +- for( i = hist->band; i < max; i += nb ) { \ +- int v = p[i]; \ +- \ +- if( v > mx ) \ +- mx = v; \ +- \ +- bins[v] += 1; \ ++#define SCAN1(IMAGE_TYPE, HIST_TYPE) \ ++ G_STMT_START \ ++ { \ ++ HIST_TYPE *bins = (HIST_TYPE *) hist->bins[0]; \ ++ IMAGE_TYPE *p = (IMAGE_TYPE *) in; \ ++ int max = nb * n; \ ++\ ++ for (i = hist->band; i < max; i += nb) { \ ++ int v = p[i]; \ ++\ ++ if (v > mx) \ ++ mx = v; \ ++\ ++ bins[v] += 1; \ ++ } \ + } \ +-} G_STMT_END ++ G_STMT_END + + static int +-vips_hist_find_scan( VipsStatistic *statistic, void *seq, +- int x, int y, void *in, int n ) ++vips_hist_find_scan(VipsStatistic *statistic, void *seq, ++ int x, int y, void *in, int n) + { + VipsHistFind *hist_find = (VipsHistFind *) statistic; + Histogram *hist = (Histogram *) seq; +- int nb = statistic->ready->Bands; ++ int nb = statistic->ready->Bands; + int mx = hist->mx; + + int i; + +- if( hist_find->band < 0 ) +- switch( statistic->ready->BandFmt ) { ++ if (hist_find->band < 0) ++ switch (statistic->ready->BandFmt) { + case VIPS_FORMAT_UCHAR: +- if( hist_find->large ) +- SCAN( unsigned char, double, UCSCANOP ); ++ if (hist_find->large) ++ SCAN(unsigned char, double, UCSCANOP); + else +- SCAN( unsigned char, unsigned int, UCSCANOP ); ++ SCAN(unsigned char, unsigned int, UCSCANOP); + mx = 255; + break; + + case VIPS_FORMAT_USHORT: +- if( hist_find->large ) +- SCAN( unsigned short, double, SCANOP ); ++ if (hist_find->large) ++ SCAN(unsigned short, double, SCANOP); + else +- SCAN( unsigned short, unsigned int, SCANOP ); ++ SCAN(unsigned short, unsigned int, SCANOP); + break; + + default: + g_assert_not_reached(); + } +- else +- switch( statistic->ready->BandFmt ) { ++ else ++ switch (statistic->ready->BandFmt) { + case VIPS_FORMAT_UCHAR: +- if( hist_find->large ) +- SCAN1( unsigned char, double ); ++ if (hist_find->large) ++ SCAN1(unsigned char, double); + else +- SCAN1( unsigned char, unsigned int ); ++ SCAN1(unsigned char, unsigned int); + break; + + case VIPS_FORMAT_USHORT: +- if( hist_find->large ) +- SCAN1( unsigned short, double ); ++ if (hist_find->large) ++ SCAN1(unsigned short, double); + else +- SCAN1( unsigned short, unsigned int ); ++ SCAN1(unsigned short, unsigned int); + break; + + default: +@@ -375,7 +391,7 @@ vips_hist_find_scan( VipsStatistic *statistic, void *seq, + + hist->mx = mx; + +- return( 0 ); ++ return (0); + } + + /* Save a bit of typing. +@@ -391,17 +407,17 @@ static const VipsBandFormat vips_hist_find_format_table[10] = { + }; + + static void +-vips_hist_find_class_init( VipsHistFindClass *class ) ++vips_hist_find_class_init(VipsHistFindClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS( class ); ++ VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "hist_find"; +- object_class->description = _( "find image histogram" ); ++ object_class->description = _("find image histogram"); + object_class->build = vips_hist_find_build; + + sclass->start = vips_hist_find_start; +@@ -409,23 +425,22 @@ vips_hist_find_class_init( VipsHistFindClass *class ) + sclass->stop = vips_hist_find_stop; + sclass->format_table = vips_hist_find_format_table; + +- VIPS_ARG_IMAGE( class, "out", 100, +- _( "Output" ), +- _( "Output histogram" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsHistFind, out ) ); +- +- VIPS_ARG_INT( class, "band", 110, +- _( "Band" ), +- _( "Find histogram of band" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsHistFind, band ), +- -1, 100000, -1 ); +- ++ VIPS_ARG_IMAGE(class, "out", 100, ++ _("Output"), ++ _("Output histogram"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsHistFind, out)); ++ ++ VIPS_ARG_INT(class, "band", 110, ++ _("Band"), ++ _("Find histogram of band"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsHistFind, band), ++ -1, 100000, -1); + } + + static void +-vips_hist_find_init( VipsHistFind *hist_find ) ++vips_hist_find_init(VipsHistFind *hist_find) + { + hist_find->band = -1; + } +@@ -441,8 +456,8 @@ vips_hist_find_init( VipsHistFind *hist_find ) + * * @band: band to equalise + * + * Find the histogram of @in. Find the histogram for band @band (producing a +- * one-band histogram), or for all bands (producing an n-band histogram) if +- * @band is -1. ++ * one-band histogram), or for all bands (producing an n-band histogram) if ++ * @band is -1. + * + * char and uchar images are cast to uchar before histogramming, all other + * image types are cast to ushort. +@@ -452,14 +467,14 @@ vips_hist_find_init( VipsHistFind *hist_find ) + * Returns: 0 on success, -1 on error + */ + int +-vips_hist_find( VipsImage *in, VipsImage **out, ... ) ++vips_hist_find(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "hist_find", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("hist_find", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/hist_find_indexed.c b/libvips/arithmetic/hist_find_indexed.c +index 8ee45e3ddd..601141187b 100644 +--- a/libvips/arithmetic/hist_find_indexed.c ++++ b/libvips/arithmetic/hist_find_indexed.c +@@ -12,28 +12,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -57,12 +57,12 @@ struct _VipsHistFindIndexed; + typedef struct { + struct _VipsHistFindIndexed *indexed; + +- VipsRegion *reg; /* Get index pixels with this */ ++ VipsRegion *reg; /* Get index pixels with this */ + +- int size; /* Length of bins */ +- int mx; /* Maximum value we have seen */ +- double *bins; /* All the bins! */ +- int *init; /* TRUE for bin has been initialised */ ++ int size; /* Length of bins */ ++ int mx; /* Maximum value we have seen */ ++ double *bins; /* All the bins! */ ++ int *init; /* TRUE for bin has been initialised */ + } Histogram; + + typedef struct _VipsHistFindIndexed { +@@ -72,7 +72,7 @@ typedef struct _VipsHistFindIndexed { + + /* Index image, cast to uchar/ushort. + */ +- VipsImage *index_ready; ++ VipsImage *index_ready; + + /* Main image histogram. Subhists accumulate to this. + */ +@@ -80,9 +80,9 @@ typedef struct _VipsHistFindIndexed { + + /* Write hist to this output image. + */ +- VipsImage *out; ++ VipsImage *out; + +- /* Combine bins with this. ++ /* Combine bins with this. + */ + VipsCombine combine; + +@@ -90,36 +90,35 @@ typedef struct _VipsHistFindIndexed { + + typedef VipsStatisticClass VipsHistFindIndexedClass; + +-G_DEFINE_TYPE( VipsHistFindIndexed, +- vips_hist_find_indexed, VIPS_TYPE_STATISTIC ); ++G_DEFINE_TYPE(VipsHistFindIndexed, ++ vips_hist_find_indexed, VIPS_TYPE_STATISTIC); + + static Histogram * +-histogram_new( VipsHistFindIndexed *indexed ) ++histogram_new(VipsHistFindIndexed *indexed) + { +- VipsStatistic *statistic = VIPS_STATISTIC( indexed ); +- int bands = statistic->ready->Bands; ++ VipsStatistic *statistic = VIPS_STATISTIC(indexed); ++ int bands = statistic->ready->Bands; + Histogram *hist; + +- if( !(hist = VIPS_NEW( indexed, Histogram )) ) +- return( NULL ); ++ if (!(hist = VIPS_NEW(indexed, Histogram))) ++ return (NULL); + + hist->indexed = indexed; + hist->reg = NULL; +- hist->size = indexed->index_ready->BandFmt == VIPS_FORMAT_UCHAR ? +- 256 : 65536; ++ hist->size = indexed->index_ready->BandFmt == VIPS_FORMAT_UCHAR ? 256 : 65536; + hist->mx = 0; + hist->bins = NULL; + hist->init = NULL; + +- if( !(hist->bins = VIPS_ARRAY( indexed, bands * hist->size, double )) || +- !(hist->init = VIPS_ARRAY( indexed, hist->size, int )) || +- !(hist->reg = vips_region_new( indexed->index_ready )) ) +- return( NULL ); ++ if (!(hist->bins = VIPS_ARRAY(indexed, bands * hist->size, double)) || ++ !(hist->init = VIPS_ARRAY(indexed, hist->size, int)) || ++ !(hist->reg = vips_region_new(indexed->index_ready))) ++ return (NULL); + +- memset( hist->bins, 0, bands * hist->size * sizeof( double ) ); +- memset( hist->init, 0, hist->size * sizeof( int ) ); ++ memset(hist->bins, 0, bands * hist->size * sizeof(double)); ++ memset(hist->init, 0, hist->size * sizeof(int)); + +- return( hist ); ++ return (hist); + } + + /* Save a bit of typing. +@@ -135,107 +134,109 @@ static const VipsBandFormat vips_hist_find_indexed_format[10] = { + }; + + static int +-vips_hist_find_indexed_build( VipsObject *object ) ++vips_hist_find_indexed_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsStatistic *statistic = VIPS_STATISTIC( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsStatistic *statistic = VIPS_STATISTIC(object); + VipsHistFindIndexed *indexed = (VipsHistFindIndexed *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + +- g_object_set( object, ++ g_object_set(object, + "out", vips_image_new(), +- NULL ); ++ NULL); + + /* main hist made on first thread start. + */ + + /* index image must be cast to uchar/ushort. + */ +- if( indexed->index && +- statistic->in ) { +- if( vips_check_uncoded( class->nickname, indexed->index ) || +- vips_check_size_same( class->nickname, +- indexed->index, statistic->in ) || +- vips_check_mono( class->nickname, indexed->index ) ) +- return( -1 ); +- +- if( vips_cast( indexed->index, &t[0], +- vips_hist_find_indexed_format[indexed->index->BandFmt], +- NULL ) ) +- return( -1 ); ++ if (indexed->index && ++ statistic->in) { ++ if (vips_check_uncoded(class->nickname, indexed->index) || ++ vips_check_size_same(class->nickname, ++ indexed->index, statistic->in) || ++ vips_check_mono(class->nickname, indexed->index)) ++ return (-1); ++ ++ if (vips_cast(indexed->index, &t[0], ++ vips_hist_find_indexed_format[indexed->index->BandFmt], ++ NULL)) ++ return (-1); + + indexed->index_ready = t[0]; + } + +- if( statistic->in ) +- if( vips_check_noncomplex( class->nickname, statistic->in ) ) +- return( -1 ); ++ if (statistic->in) ++ if (vips_check_noncomplex(class->nickname, statistic->in)) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_hist_find_indexed_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_hist_find_indexed_parent_class)->build(object)) ++ return (-1); + +- VIPS_UNREF( indexed->hist->reg ); ++ VIPS_UNREF(indexed->hist->reg); + +- if( vips_image_pipelinev( indexed->out, +- VIPS_DEMAND_STYLE_ANY, +- statistic->ready, indexed->index_ready, NULL ) ) +- return( -1 ); +- vips_image_init_fields( indexed->out, +- indexed->hist->mx + 1, 1, statistic->ready->Bands, +- VIPS_FORMAT_DOUBLE, VIPS_CODING_NONE, +- VIPS_INTERPRETATION_HISTOGRAM, 1.0, 1.0 ); ++ if (vips_image_pipelinev(indexed->out, ++ VIPS_DEMAND_STYLE_ANY, ++ statistic->ready, indexed->index_ready, NULL)) ++ return (-1); ++ vips_image_init_fields(indexed->out, ++ indexed->hist->mx + 1, 1, statistic->ready->Bands, ++ VIPS_FORMAT_DOUBLE, VIPS_CODING_NONE, ++ VIPS_INTERPRETATION_HISTOGRAM, 1.0, 1.0); + +- if( vips_image_write_line( indexed->out, 0, +- (VipsPel *) indexed->hist->bins ) ) +- return( -1 ); ++ if (vips_image_write_line(indexed->out, 0, ++ (VipsPel *) indexed->hist->bins)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void * +-vips_hist_find_indexed_start( VipsStatistic *statistic ) ++vips_hist_find_indexed_start(VipsStatistic *statistic) + { + VipsHistFindIndexed *indexed = (VipsHistFindIndexed *) statistic; + + /* Make the main hist, if necessary. + */ +- if( !indexed->hist ) +- indexed->hist = histogram_new( indexed ); ++ if (!indexed->hist) ++ indexed->hist = histogram_new(indexed); + +- return( (void *) histogram_new( indexed ) ); ++ return ((void *) histogram_new(indexed)); + } + +-/* Combine B with A according to mode. ++/* Combine B with A according to mode. + */ +-#define COMBINE( MODE, A, B ) G_STMT_START { \ +- switch( MODE ) { \ +- case VIPS_COMBINE_MAX: \ +- (A) = VIPS_MAX( A, B ); \ +- break; \ +- \ +- case VIPS_COMBINE_SUM: \ +- (A) += (B); \ +- break; \ +- \ +- case VIPS_COMBINE_MIN: \ +- (A) = VIPS_MIN( A, B ); \ +- break; \ +- \ +- default: \ +- g_assert_not_reached(); \ ++#define COMBINE(MODE, A, B) \ ++ G_STMT_START \ ++ { \ ++ switch (MODE) { \ ++ case VIPS_COMBINE_MAX: \ ++ (A) = VIPS_MAX(A, B); \ ++ break; \ ++\ ++ case VIPS_COMBINE_SUM: \ ++ (A) += (B); \ ++ break; \ ++\ ++ case VIPS_COMBINE_MIN: \ ++ (A) = VIPS_MIN(A, B); \ ++ break; \ ++\ ++ default: \ ++ g_assert_not_reached(); \ ++ } \ + } \ +-} G_STMT_END ++ G_STMT_END + + /* Join a sub-hist onto the main hist. + */ + static int +-vips_hist_find_indexed_stop( VipsStatistic *statistic, void *seq ) ++vips_hist_find_indexed_stop(VipsStatistic *statistic, void *seq) + { + Histogram *sub_hist = (Histogram *) seq; + VipsHistFindIndexed *indexed = (VipsHistFindIndexed *) statistic; +- Histogram *hist = indexed->hist; +- int bands = statistic->ready->Bands; ++ Histogram *hist = indexed->hist; ++ int bands = statistic->ready->Bands; + + int i, j; + double *bins; +@@ -243,20 +244,20 @@ vips_hist_find_indexed_stop( VipsStatistic *statistic, void *seq ) + int *init; + int *sub_init; + +- hist->mx = VIPS_MAX( hist->mx, sub_hist->mx ); ++ hist->mx = VIPS_MAX(hist->mx, sub_hist->mx); + + bins = hist->bins; + sub_bins = sub_hist->bins; + init = hist->init; + sub_init = sub_hist->init; +- for( i = 0; i <= sub_hist->mx; i++ ) { +- if( sub_init[i] ) { +- if( init[i] ) +- for( j = 0; j < bands; j++ ) +- COMBINE( indexed->combine, +- bins[j], sub_bins[j] ); ++ for (i = 0; i <= sub_hist->mx; i++) { ++ if (sub_init[i]) { ++ if (init[i]) ++ for (j = 0; j < bands; j++) ++ COMBINE(indexed->combine, ++ bins[j], sub_bins[j]); + else { +- for( j = 0; j < bands; j++ ) ++ for (j = 0; j < bands; j++) + bins[j] = sub_bins[j]; + init[i] = TRUE; + } +@@ -266,61 +267,70 @@ vips_hist_find_indexed_stop( VipsStatistic *statistic, void *seq ) + sub_bins += bands; + } + +- VIPS_UNREF( sub_hist->reg ); ++ VIPS_UNREF(sub_hist->reg); + +- return( 0 ); ++ return (0); + } + + /* Accumulate a buffer of pels, uchar index. + */ +-#define ACCUMULATE_UCHAR( TYPE ) { \ +- int x, z; \ +- TYPE *tv = (TYPE *) in; \ +- \ +- for( x = 0; x < n; x++ ) { \ +- int ix = i[x]; \ +- double *bin = hist->bins + ix * bands; \ +- \ +- if( hist->init[ix] ) \ +- for( z = 0; z < bands; z++ ) \ +- COMBINE( indexed->combine, bin[z], tv[z] ); \ +- else { \ +- for( z = 0; z < bands; z++ ) \ +- bin[z] = tv[z]; \ +- hist->init[ix] = TRUE; \ ++#define ACCUMULATE_UCHAR(TYPE) \ ++ { \ ++ int x, z; \ ++ TYPE *tv = (TYPE *) in; \ ++\ ++ for (x = 0; x < n; x++) { \ ++ int ix = i[x]; \ ++ double *bin = hist->bins + ix * bands; \ ++\ ++ if (hist->init[ix]) \ ++ for (z = 0; z < bands; z++) \ ++ COMBINE(indexed->combine, bin[z], tv[z]); \ ++ else { \ ++ for (z = 0; z < bands; z++) \ ++ bin[z] = tv[z]; \ ++ hist->init[ix] = TRUE; \ ++ } \ ++\ ++ tv += bands; \ + } \ +- \ +- tv += bands; \ +- } \ +-} ++ } + + /* A uchar index image. + */ +-static void +-vips_hist_find_indexed_uchar_scan( VipsHistFindIndexed *indexed, +- Histogram *hist, void *in, void *index, int n ) ++static void ++vips_hist_find_indexed_uchar_scan(VipsHistFindIndexed *indexed, ++ Histogram *hist, void *in, void *index, int n) + { +- VipsStatistic *statistic = VIPS_STATISTIC( indexed ); ++ VipsStatistic *statistic = VIPS_STATISTIC(indexed); + int bands = statistic->ready->Bands; + unsigned char *i = (unsigned char *) index; + +- switch( statistic->ready->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- ACCUMULATE_UCHAR( unsigned char ); break; +- case VIPS_FORMAT_CHAR: +- ACCUMULATE_UCHAR( signed char ); break; +- case VIPS_FORMAT_USHORT: +- ACCUMULATE_UCHAR( unsigned short ); break; +- case VIPS_FORMAT_SHORT: +- ACCUMULATE_UCHAR( signed short ); break; +- case VIPS_FORMAT_UINT: +- ACCUMULATE_UCHAR( unsigned int ); break; +- case VIPS_FORMAT_INT: +- ACCUMULATE_UCHAR( signed int ); break; +- case VIPS_FORMAT_FLOAT: +- ACCUMULATE_UCHAR( float ); break; +- case VIPS_FORMAT_DOUBLE: +- ACCUMULATE_UCHAR( double ); break; ++ switch (statistic->ready->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ ACCUMULATE_UCHAR(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ ACCUMULATE_UCHAR(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ ACCUMULATE_UCHAR(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ ACCUMULATE_UCHAR(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ ACCUMULATE_UCHAR(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ ACCUMULATE_UCHAR(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ ACCUMULATE_UCHAR(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ ACCUMULATE_UCHAR(double); ++ break; + + default: + g_assert_not_reached(); +@@ -333,37 +343,38 @@ vips_hist_find_indexed_uchar_scan( VipsHistFindIndexed *indexed, + + /* Accumulate a buffer of pels, ushort index. + */ +-#define ACCUMULATE_USHORT( TYPE ) { \ +- int x, z; \ +- TYPE *tv = (TYPE *) in; \ +- \ +- for( x = 0; x < n; x++ ) { \ +- int ix = i[x]; \ +- double *bin = hist->bins + ix * bands; \ +- \ +- if( ix > mx ) \ +- mx = ix; \ +- \ +- if( hist->init[ix] ) \ +- for( z = 0; z < bands; z++ ) \ +- COMBINE( indexed->combine, bin[z], tv[z] ); \ +- else { \ +- for( z = 0; z < bands; z++ ) \ +- bin[z] = tv[z]; \ +- hist->init[ix] = TRUE; \ ++#define ACCUMULATE_USHORT(TYPE) \ ++ { \ ++ int x, z; \ ++ TYPE *tv = (TYPE *) in; \ ++\ ++ for (x = 0; x < n; x++) { \ ++ int ix = i[x]; \ ++ double *bin = hist->bins + ix * bands; \ ++\ ++ if (ix > mx) \ ++ mx = ix; \ ++\ ++ if (hist->init[ix]) \ ++ for (z = 0; z < bands; z++) \ ++ COMBINE(indexed->combine, bin[z], tv[z]); \ ++ else { \ ++ for (z = 0; z < bands; z++) \ ++ bin[z] = tv[z]; \ ++ hist->init[ix] = TRUE; \ ++ } \ ++\ ++ tv += bands; \ + } \ +- \ +- tv += bands; \ +- } \ +-} ++ } + + /* A ushort index image. + */ +-static void +-vips_hist_find_indexed_ushort_scan( VipsHistFindIndexed *indexed, +- Histogram *hist, void *in, void *index, int n ) ++static void ++vips_hist_find_indexed_ushort_scan(VipsHistFindIndexed *indexed, ++ Histogram *hist, void *in, void *index, int n) + { +- VipsStatistic *statistic = VIPS_STATISTIC( indexed ); ++ VipsStatistic *statistic = VIPS_STATISTIC(indexed); + int bands = statistic->ready->Bands; + unsigned short *i = (unsigned short *) index; + +@@ -371,23 +382,31 @@ vips_hist_find_indexed_ushort_scan( VipsHistFindIndexed *indexed, + + mx = hist->mx; + +- switch( statistic->ready->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- ACCUMULATE_USHORT( unsigned char ); break; +- case VIPS_FORMAT_CHAR: +- ACCUMULATE_USHORT( signed char ); break; +- case VIPS_FORMAT_USHORT: +- ACCUMULATE_USHORT( unsigned short ); break; +- case VIPS_FORMAT_SHORT: +- ACCUMULATE_USHORT( signed short ); break; +- case VIPS_FORMAT_UINT: +- ACCUMULATE_USHORT( unsigned int ); break; +- case VIPS_FORMAT_INT: +- ACCUMULATE_USHORT( signed int ); break; +- case VIPS_FORMAT_FLOAT: +- ACCUMULATE_USHORT( float ); break; +- case VIPS_FORMAT_DOUBLE: +- ACCUMULATE_USHORT( double ); break; ++ switch (statistic->ready->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ ACCUMULATE_USHORT(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ ACCUMULATE_USHORT(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ ACCUMULATE_USHORT(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ ACCUMULATE_USHORT(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ ACCUMULATE_USHORT(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ ACCUMULATE_USHORT(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ ACCUMULATE_USHORT(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ ACCUMULATE_USHORT(double); ++ break; + + default: + g_assert_not_reached(); +@@ -398,75 +417,74 @@ vips_hist_find_indexed_ushort_scan( VipsHistFindIndexed *indexed, + hist->mx = mx; + } + +-typedef void (*VipsHistFindIndexedScanFn)( VipsHistFindIndexed *indexed, +- Histogram *hist, void *in, void *index, int n ); ++typedef void (*VipsHistFindIndexedScanFn)(VipsHistFindIndexed *indexed, ++ Histogram *hist, void *in, void *index, int n); + + static int +-vips_hist_find_indexed_scan( VipsStatistic *statistic, void *seq, +- int x, int y, void *in, int n ) ++vips_hist_find_indexed_scan(VipsStatistic *statistic, void *seq, ++ int x, int y, void *in, int n) + { + Histogram *hist = (Histogram *) seq; + VipsHistFindIndexed *indexed = (VipsHistFindIndexed *) statistic; + +- VipsRect r = { x, y, n, 1 }; ++ VipsRect r = { x, y, n, 1 }; + VipsHistFindIndexedScanFn scan; + + /* Need the corresponding area of the index image. + */ +- if( vips_region_prepare( hist->reg, &r ) ) +- return( -1 ); ++ if (vips_region_prepare(hist->reg, &r)) ++ return (-1); + +- if( indexed->index_ready->BandFmt == VIPS_FORMAT_UCHAR ) ++ if (indexed->index_ready->BandFmt == VIPS_FORMAT_UCHAR) + scan = vips_hist_find_indexed_uchar_scan; + else + scan = vips_hist_find_indexed_ushort_scan; + +- scan( indexed, hist, in, VIPS_REGION_ADDR( hist->reg, x, y ), n ); ++ scan(indexed, hist, in, VIPS_REGION_ADDR(hist->reg, x, y), n); + +- return( 0 ); ++ return (0); + } + + static void +-vips_hist_find_indexed_class_init( VipsHistFindIndexedClass *class ) ++vips_hist_find_indexed_class_init(VipsHistFindIndexedClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS( class ); ++ VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "hist_find_indexed"; +- object_class->description = _( "find indexed image histogram" ); ++ object_class->description = _("find indexed image histogram"); + object_class->build = vips_hist_find_indexed_build; + + sclass->start = vips_hist_find_indexed_start; + sclass->scan = vips_hist_find_indexed_scan; + sclass->stop = vips_hist_find_indexed_stop; + +- VIPS_ARG_IMAGE( class, "index", 90, +- _( "Index" ), +- _( "Index image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsHistFindIndexed, index ) ); +- +- VIPS_ARG_IMAGE( class, "out", 100, +- _( "Output" ), +- _( "Output histogram" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsHistFindIndexed, out ) ); +- +- VIPS_ARG_ENUM( class, "combine", 104, +- _( "Combine" ), +- _( "Combine bins like this" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsHistFindIndexed, combine ), +- VIPS_TYPE_COMBINE, VIPS_COMBINE_SUM ); +- ++ VIPS_ARG_IMAGE(class, "index", 90, ++ _("Index"), ++ _("Index image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsHistFindIndexed, index)); ++ ++ VIPS_ARG_IMAGE(class, "out", 100, ++ _("Output"), ++ _("Output histogram"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsHistFindIndexed, out)); ++ ++ VIPS_ARG_ENUM(class, "combine", 104, ++ _("Combine"), ++ _("Combine bins like this"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsHistFindIndexed, combine), ++ VIPS_TYPE_COMBINE, VIPS_COMBINE_SUM); + } + + static void +-vips_hist_find_indexed_init( VipsHistFindIndexed *indexed ) ++vips_hist_find_indexed_init(VipsHistFindIndexed *indexed) + { + indexed->combine = VIPS_COMBINE_SUM; + } +@@ -486,15 +504,15 @@ vips_hist_find_indexed_init( VipsHistFindIndexed *indexed ) + * words, element zero in @out contains the combination of all the pixels in @in + * whose corresponding pixel in @index is zero. + * +- * char and uchar @index images are cast to uchar before histogramming, all +- * other image types are cast to ushort. @index must have just one band. ++ * char and uchar @index images are cast to uchar before histogramming, all ++ * other image types are cast to ushort. @index must have just one band. + * +- * @in must be non-complex. ++ * @in must be non-complex. + * + * @out always has the same size and format as @in. + * + * Normally, bins are summed, but you can use @combine to set other combine +- * modes. ++ * modes. + * + * This operation is useful in conjunction with vips_labelregions(). You can + * use it to find the centre of gravity of blobs in an image, for example. +@@ -504,14 +522,14 @@ vips_hist_find_indexed_init( VipsHistFindIndexed *indexed ) + * Returns: 0 on success, -1 on error + */ + int +-vips_hist_find_indexed( VipsImage *in, VipsImage *index, VipsImage **out, ... ) ++vips_hist_find_indexed(VipsImage *in, VipsImage *index, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "hist_find_indexed", ap, in, index, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("hist_find_indexed", ap, in, index, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/hist_find_ndim.c b/libvips/arithmetic/hist_find_ndim.c +index 87d7d7c97c..8608652899 100644 +--- a/libvips/arithmetic/hist_find_ndim.c ++++ b/libvips/arithmetic/hist_find_ndim.c +@@ -1,41 +1,41 @@ + /* n-dimensional histogram + * +- * Written on: 8/7/03 +- * 10/11/04 ++ * Written on: 8/7/03 ++ * 10/11/04 + * - oops, was not checking the bandfmt coming in + * 24/3/10 + * - gtkdoc + * - small celanups + * 17/8/13 + * - redo as a class +- * 28/1/22 travisbell ++ * 28/1/22 travisbell + * - better arg checking + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -59,7 +59,7 @@ struct _VipsHistFindNDim; + typedef struct { + struct _VipsHistFindNDim *ndim; + +- unsigned int ***data; ++ unsigned int ***data; + } Histogram; + + typedef struct _VipsHistFindNDim { +@@ -79,20 +79,20 @@ typedef struct _VipsHistFindNDim { + + /* Write hist to this output image. + */ +- VipsImage *out; ++ VipsImage *out; + + } VipsHistFindNDim; + + typedef VipsStatisticClass VipsHistFindNDimClass; + +-G_DEFINE_TYPE( VipsHistFindNDim, vips_hist_find_ndim, VIPS_TYPE_STATISTIC ); ++G_DEFINE_TYPE(VipsHistFindNDim, vips_hist_find_ndim, VIPS_TYPE_STATISTIC); + + /* Build a Histogram. + */ + static Histogram * +-histogram_new( VipsHistFindNDim *ndim ) ++histogram_new(VipsHistFindNDim *ndim) + { +- VipsImage *in = VIPS_STATISTIC( ndim )->ready; ++ VipsImage *in = VIPS_STATISTIC(ndim)->ready; + int bins = ndim->bins; + + /* How many dimensions do we need to allocate? +@@ -103,178 +103,178 @@ histogram_new( VipsHistFindNDim *ndim ) + int i, j; + Histogram *hist; + +- if( !(hist = VIPS_NEW( ndim, Histogram )) ) +- return( NULL ); ++ if (!(hist = VIPS_NEW(ndim, Histogram))) ++ return (NULL); + + hist->ndim = ndim; + +- if( !(hist->data = VIPS_ARRAY( ndim, bins, unsigned int ** )) ) +- return( NULL ); +- memset( hist->data, 0, bins * sizeof( unsigned int ** ) ); +- +- for( i = 0; i < ilimit; i++ ) { +- if( !(hist->data[i] = +- VIPS_ARRAY( ndim, bins, unsigned int * )) ) +- return( NULL ); +- memset( hist->data[i], 0, bins * sizeof( unsigned int * ) ); +- for( j = 0; j < jlimit; j++ ) { +- if( !(hist->data[i][j] = +- VIPS_ARRAY( ndim, bins, unsigned int )) ) +- return( NULL ); +- memset( hist->data[i][j], +- 0, bins * sizeof( unsigned int ) ); ++ if (!(hist->data = VIPS_ARRAY(ndim, bins, unsigned int **))) ++ return (NULL); ++ memset(hist->data, 0, bins * sizeof(unsigned int **)); ++ ++ for (i = 0; i < ilimit; i++) { ++ if (!(hist->data[i] = ++ VIPS_ARRAY(ndim, bins, unsigned int *))) ++ return (NULL); ++ memset(hist->data[i], 0, bins * sizeof(unsigned int *)); ++ for (j = 0; j < jlimit; j++) { ++ if (!(hist->data[i][j] = ++ VIPS_ARRAY(ndim, bins, unsigned int))) ++ return (NULL); ++ memset(hist->data[i][j], ++ 0, bins * sizeof(unsigned int)); + } + } + +- return( hist ); ++ return (hist); + } + + static int +-vips_hist_find_ndim_build( VipsObject *object ) ++vips_hist_find_ndim_build(VipsObject *object) + { +- VipsStatistic *statistic = VIPS_STATISTIC( object ); ++ VipsStatistic *statistic = VIPS_STATISTIC(object); + VipsHistFindNDim *ndim = (VipsHistFindNDim *) object; + + unsigned int *obuffer; +- int y, i, x, z; ++ int y, i, x, z; + +- g_object_set( object, ++ g_object_set(object, + "out", vips_image_new(), +- NULL ); ++ NULL); + +- if( statistic->in ) { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( ndim ); ++ if (statistic->in) { ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(ndim); + +- if( statistic->in->Bands > 3 ) { +- vips_error( class->nickname, +- "%s", _( "image is not 1 - 3 bands" ) ); +- return( -1 ); ++ if (statistic->in->Bands > 3) { ++ vips_error(class->nickname, ++ "%s", _("image is not 1 - 3 bands")); ++ return (-1); + } + +- ndim->max_val = ++ ndim->max_val = + statistic->in->BandFmt == VIPS_FORMAT_UCHAR ? 256 : 65536; +- if( ndim->bins < 1 || +- ndim->bins > ndim->max_val ) { +- vips_error( class->nickname, +- _( "bins out of range [1,%d]" ), ndim->max_val ); +- return( -1 ); ++ if (ndim->bins < 1 || ++ ndim->bins > ndim->max_val) { ++ vips_error(class->nickname, ++ _("bins out of range [1,%d]"), ndim->max_val); ++ return (-1); + } + } + + /* main hist made on first thread start. + */ + +- if( VIPS_OBJECT_CLASS( vips_hist_find_ndim_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_hist_find_ndim_parent_class)->build(object)) ++ return (-1); + +- if( vips_image_pipelinev( ndim->out, +- VIPS_DEMAND_STYLE_ANY, statistic->ready, NULL ) ) +- return( -1 ); +- vips_image_init_fields( ndim->out, +- ndim->bins, +- statistic->ready->Bands > 1 ? ndim->bins : 1, ++ if (vips_image_pipelinev(ndim->out, ++ VIPS_DEMAND_STYLE_ANY, statistic->ready, NULL)) ++ return (-1); ++ vips_image_init_fields(ndim->out, ++ ndim->bins, ++ statistic->ready->Bands > 1 ? ndim->bins : 1, + statistic->ready->Bands > 2 ? ndim->bins : 1, +- VIPS_FORMAT_UINT, +- VIPS_CODING_NONE, VIPS_INTERPRETATION_HISTOGRAM, 1.0, 1.0 ); ++ VIPS_FORMAT_UINT, ++ VIPS_CODING_NONE, VIPS_INTERPRETATION_HISTOGRAM, 1.0, 1.0); + +- if( !(obuffer = VIPS_ARRAY( ndim, +- VIPS_IMAGE_N_ELEMENTS( ndim->out ), unsigned int )) ) +- return( -1 ); ++ if (!(obuffer = VIPS_ARRAY(ndim, ++ VIPS_IMAGE_N_ELEMENTS(ndim->out), unsigned int))) ++ return (-1); + +- for( y = 0; y < ndim->out->Ysize; y++ ) { +- for( i = 0, x = 0; x < ndim->out->Xsize; x++ ) +- for( z = 0; z < ndim->out->Bands; z++, i++ ) ++ for (y = 0; y < ndim->out->Ysize; y++) { ++ for (i = 0, x = 0; x < ndim->out->Xsize; x++) ++ for (z = 0; z < ndim->out->Bands; z++, i++) + obuffer[i] = ndim->hist->data[z][y][x]; + +- if( vips_image_write_line( ndim->out, y, (VipsPel *) obuffer ) ) +- return( -1 ); ++ if (vips_image_write_line(ndim->out, y, (VipsPel *) obuffer)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static void * +-vips_hist_find_ndim_start( VipsStatistic *statistic ) ++vips_hist_find_ndim_start(VipsStatistic *statistic) + { + VipsHistFindNDim *ndim = (VipsHistFindNDim *) statistic; + + /* Make the main hist, if necessary. + */ +- if( !ndim->hist ) +- ndim->hist = histogram_new( ndim ); ++ if (!ndim->hist) ++ ndim->hist = histogram_new(ndim); + +- return( (void *) histogram_new( ndim ) ); ++ return ((void *) histogram_new(ndim)); + } + + /* Join a sub-hist onto the main hist. + */ + static int +-vips_hist_find_ndim_stop( VipsStatistic *statistic, void *seq ) ++vips_hist_find_ndim_stop(VipsStatistic *statistic, void *seq) + { + Histogram *sub_hist = (Histogram *) seq; + VipsHistFindNDim *ndim = (VipsHistFindNDim *) statistic; +- Histogram *hist = ndim->hist; ++ Histogram *hist = ndim->hist; + + int i, j, k; + +- for( i = 0; i < ndim->bins; i++ ) +- for( j = 0; j < ndim->bins; j++ ) +- for( k = 0; k < ndim->bins; k++ ) +- if( hist->data[i] && hist->data[i][j] ) { +- hist->data[i][j][k] += ++ for (i = 0; i < ndim->bins; i++) ++ for (j = 0; j < ndim->bins; j++) ++ for (k = 0; k < ndim->bins; k++) ++ if (hist->data[i] && hist->data[i][j]) { ++ hist->data[i][j][k] += + sub_hist->data[i][j][k]; + +- /* Zap sub-hist to make sure we ++ /* Zap sub-hist to make sure we + * can't add it again. + */ + sub_hist->data[i][j][k] = 0; + } + +- return( 0 ); ++ return (0); + } + +-#define LOOP( TYPE ) { \ +- TYPE *p = (TYPE *) in; \ +- \ +- for( i = 0, j = 0; j < n; j++ ) { \ +- for( k = 0; k < nb; k++, i++ ) \ +- index[k] = p[i] / scale; \ +- \ +- hist->data[index[2]][index[1]][index[0]] += 1; \ +- } \ +-} ++#define LOOP(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) in; \ ++\ ++ for (i = 0, j = 0; j < n; j++) { \ ++ for (k = 0; k < nb; k++, i++) \ ++ index[k] = p[i] / scale; \ ++\ ++ hist->data[index[2]][index[1]][index[0]] += 1; \ ++ } \ ++ } + + static int +-vips_hist_find_ndim_scan( VipsStatistic *statistic, void *seq, +- int x, int y, void *in, int n ) ++vips_hist_find_ndim_scan(VipsStatistic *statistic, void *seq, ++ int x, int y, void *in, int n) + { + Histogram *hist = (Histogram *) seq; + VipsHistFindNDim *ndim = (VipsHistFindNDim *) statistic; + VipsImage *im = statistic->ready; + int nb = im->Bands; + double scale = (double) (ndim->max_val + 1) / ndim->bins; +- int i, j, k; ++ int i, j, k; + int index[3]; + + /* Fill these with dimensions, backwards. + */ + index[0] = index[1] = index[2] = 0; + +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_UCHAR: +- LOOP( unsigned char ); ++ LOOP(unsigned char); + break; + + case VIPS_FORMAT_USHORT: +- LOOP( unsigned short ); ++ LOOP(unsigned short); + break; + + default: +- g_assert_not_reached(); ++ g_assert_not_reached(); + } + +- return( 0 ); ++ return (0); + } + + /* Save a bit of typing. +@@ -291,17 +291,17 @@ static const VipsBandFormat vips_hist_find_ndim_format_table[10] = { + }; + + static void +-vips_hist_find_ndim_class_init( VipsHistFindNDimClass *class ) ++vips_hist_find_ndim_class_init(VipsHistFindNDimClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS( class ); ++ VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "hist_find_ndim"; +- object_class->description = _( "find n-dimensional image histogram" ); ++ object_class->description = _("find n-dimensional image histogram"); + object_class->build = vips_hist_find_ndim_build; + + sclass->start = vips_hist_find_ndim_start; +@@ -309,23 +309,22 @@ vips_hist_find_ndim_class_init( VipsHistFindNDimClass *class ) + sclass->stop = vips_hist_find_ndim_stop; + sclass->format_table = vips_hist_find_ndim_format_table; + +- VIPS_ARG_IMAGE( class, "out", 100, +- _( "Output" ), +- _( "Output histogram" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsHistFindNDim, out ) ); +- +- VIPS_ARG_INT( class, "bins", 110, +- _( "Bins" ), +- _( "Number of bins in each dimension" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsHistFindNDim, bins ), +- 1, 65536, 10 ); +- ++ VIPS_ARG_IMAGE(class, "out", 100, ++ _("Output"), ++ _("Output histogram"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsHistFindNDim, out)); ++ ++ VIPS_ARG_INT(class, "bins", 110, ++ _("Bins"), ++ _("Number of bins in each dimension"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsHistFindNDim, bins), ++ 1, 65536, 10); + } + + static void +-vips_hist_find_ndim_init( VipsHistFindNDim *ndim ) ++vips_hist_find_ndim_init(VipsHistFindNDim *ndim) + { + ndim->bins = 10; + } +@@ -343,7 +342,7 @@ vips_hist_find_ndim_init( VipsHistFindNDim *ndim ) + * Make a one, two or three dimensional histogram of a 1, 2 or + * 3 band image. Divide each axis into @bins bins .. ie. + * output is 1 x bins, bins x bins, or bins x bins x bins bands. +- * @bins defaults to 10. ++ * @bins defaults to 10. + * + * char and uchar images are cast to uchar before histogramming, all other + * image types are cast to ushort. +@@ -353,14 +352,14 @@ vips_hist_find_ndim_init( VipsHistFindNDim *ndim ) + * Returns: 0 on success, -1 on error + */ + int +-vips_hist_find_ndim( VipsImage *in, VipsImage **out, ... ) ++vips_hist_find_ndim(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "hist_find_ndim", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("hist_find_ndim", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/hough.c b/libvips/arithmetic/hough.c +index 42b1008728..491c22fe1e 100644 +--- a/libvips/arithmetic/hough.c ++++ b/libvips/arithmetic/hough.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,108 +43,108 @@ + #include "statistic.h" + #include "hough.h" + +-G_DEFINE_ABSTRACT_TYPE( VipsHough, vips_hough, VIPS_TYPE_STATISTIC ); ++G_DEFINE_ABSTRACT_TYPE(VipsHough, vips_hough, VIPS_TYPE_STATISTIC); + + static VipsImage * +-vips_hough_new_accumulator( VipsHough *hough ) ++vips_hough_new_accumulator(VipsHough *hough) + { +- VipsHoughClass *class = VIPS_HOUGH_GET_CLASS( hough ); +- VipsStatistic *statistic = VIPS_STATISTIC( hough ); ++ VipsHoughClass *class = VIPS_HOUGH_GET_CLASS(hough); ++ VipsStatistic *statistic = VIPS_STATISTIC(hough); + +- VipsImage *accumulator; ++ VipsImage *accumulator; + +- accumulator = vips_image_new_memory(); ++ accumulator = vips_image_new_memory(); + +- if( vips_image_pipelinev( accumulator, +- VIPS_DEMAND_STYLE_ANY, statistic->ready, NULL ) || +- class->init_accumulator( hough, accumulator ) || +- vips_image_write_prepare( accumulator ) ) { +- g_object_unref( accumulator ); +- return( NULL ); ++ if (vips_image_pipelinev(accumulator, ++ VIPS_DEMAND_STYLE_ANY, statistic->ready, NULL) || ++ class->init_accumulator(hough, accumulator) || ++ vips_image_write_prepare(accumulator)) { ++ g_object_unref(accumulator); ++ return (NULL); + } + +- return( accumulator ); ++ return (accumulator); + } + + static int +-vips_hough_build( VipsObject *object ) ++vips_hough_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsStatistic *statistic = VIPS_STATISTIC( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsStatistic *statistic = VIPS_STATISTIC(object); + VipsHough *hough = (VipsHough *) object; + +- VipsImage *out; ++ VipsImage *out; + + /* Mono only, we use the bands dimension of the output image for + * a parameter. + */ +- if( statistic->in ) +- if( vips_check_mono( class->nickname, statistic->in ) ) +- return( -1 ); ++ if (statistic->in) ++ if (vips_check_mono(class->nickname, statistic->in)) ++ return (-1); + +- if( !(out = vips_hough_new_accumulator( hough )) ) +- return( -1 ); +- g_object_set( object, ++ if (!(out = vips_hough_new_accumulator(hough))) ++ return (-1); ++ g_object_set(object, + "out", out, +- NULL ); ++ NULL); + +- if( VIPS_OBJECT_CLASS( vips_hough_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_hough_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-/* Build a new accumulator. ++/* Build a new accumulator. + */ + static void * +-vips_hough_start( VipsStatistic *statistic ) ++vips_hough_start(VipsStatistic *statistic) + { + VipsHough *hough = (VipsHough *) statistic; + + VipsImage *accumulator; + +- if( !(accumulator = vips_hough_new_accumulator( hough )) ) +- return( NULL ); ++ if (!(accumulator = vips_hough_new_accumulator(hough))) ++ return (NULL); + +- return( (void *) accumulator ); ++ return ((void *) accumulator); + } + + /* Add our finished accumulator to the main area. + */ + static int +-vips_hough_stop( VipsStatistic *statistic, void *seq ) ++vips_hough_stop(VipsStatistic *statistic, void *seq) + { + VipsImage *accumulator = (VipsImage *) seq; + VipsHough *hough = (VipsHough *) statistic; + +- if( vips_draw_image( hough->out, accumulator, 0, 0, +- "mode", VIPS_COMBINE_MODE_ADD, +- NULL ) ) { +- g_object_unref( accumulator ); +- return( -1 ); ++ if (vips_draw_image(hough->out, accumulator, 0, 0, ++ "mode", VIPS_COMBINE_MODE_ADD, ++ NULL)) { ++ g_object_unref(accumulator); ++ return (-1); + } + +- g_object_unref( accumulator ); ++ g_object_unref(accumulator); + +- return( 0 ); ++ return (0); + } + + static int +-vips_hough_scan( VipsStatistic *statistic, +- void *seq, int x, int y, void *in, int n ) ++vips_hough_scan(VipsStatistic *statistic, ++ void *seq, int x, int y, void *in, int n) + { + VipsHough *hough = (VipsHough *) statistic; +- VipsHoughClass *class = VIPS_HOUGH_GET_CLASS( hough ); ++ VipsHoughClass *class = VIPS_HOUGH_GET_CLASS(hough); + VipsImage *accumulator = (VipsImage *) seq; + VipsPel *p = (VipsPel *) in; + + int i; + +- for( i = 0; i < n; i++ ) +- if( p[i] ) +- class->vote( hough, accumulator, x + i, y ); ++ for (i = 0; i < n; i++) ++ if (p[i]) ++ class->vote(hough, accumulator, x + i, y); + +- return( 0 ); ++ return (0); + } + + #define UC VIPS_FORMAT_UCHAR +@@ -157,17 +157,17 @@ static const VipsBandFormat vips_hough_format_table[10] = { + }; + + static void +-vips_hough_class_init( VipsHoughClass *class ) ++vips_hough_class_init(VipsHoughClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS( class ); ++ VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "hough"; +- object_class->description = _( "find hough transform" ); ++ object_class->description = _("find hough transform"); + object_class->build = vips_hough_build; + + sclass->start = vips_hough_start; +@@ -175,15 +175,14 @@ vips_hough_class_init( VipsHoughClass *class ) + sclass->stop = vips_hough_stop; + sclass->format_table = vips_hough_format_table; + +- VIPS_ARG_IMAGE( class, "out", 100, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsHough, out ) ); +- ++ VIPS_ARG_IMAGE(class, "out", 100, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsHough, out)); + } + + static void +-vips_hough_init( VipsHough *hough ) ++vips_hough_init(VipsHough *hough) + { + } +diff --git a/libvips/arithmetic/hough.h b/libvips/arithmetic/hough.h +index 2691fb7fc4..569c4abae2 100644 +--- a/libvips/arithmetic/hough.h ++++ b/libvips/arithmetic/hough.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -39,35 +39,34 @@ extern "C" { + #endif /*__cplusplus*/ + + #define VIPS_TYPE_HOUGH (vips_hough_get_type()) +-#define VIPS_HOUGH( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_HOUGH, VipsHough )) +-#define VIPS_HOUGH_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_HOUGH(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_HOUGH, VipsHough)) ++#define VIPS_HOUGH_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_HOUGH, VipsHoughClass)) ++#define VIPS_IS_HOUGH(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_HOUGH)) ++#define VIPS_IS_HOUGH_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_HOUGH)) ++#define VIPS_HOUGH_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_HOUGH, VipsHoughClass)) +-#define VIPS_IS_HOUGH( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_HOUGH )) +-#define VIPS_IS_HOUGH_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_HOUGH )) +-#define VIPS_HOUGH_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_HOUGH, VipsHoughClass )) + + typedef struct _VipsHough VipsHough; + typedef struct _VipsHoughClass VipsHoughClass; + +-typedef int (*VipsHoughInitAccumulator)( VipsHough *hough, +- VipsImage *accumulator ); +-typedef void (*VipsHoughVote)( VipsHough *hough, +- VipsImage *accumulator, int x, int y ); ++typedef int (*VipsHoughInitAccumulator)(VipsHough *hough, ++ VipsImage *accumulator); ++typedef void (*VipsHoughVote)(VipsHough *hough, ++ VipsImage *accumulator, int x, int y); + + struct _VipsHough { + VipsStatistic parent_instance; + + /* Sum the thread accumulators to here. + */ +- VipsImage *out; +- ++ VipsImage *out; + }; + + struct _VipsHoughClass { +@@ -77,13 +76,12 @@ struct _VipsHoughClass { + */ + VipsHoughInitAccumulator init_accumulator; + +- /* Vote function for this parameter space. ++ /* Vote function for this parameter space. + */ +- VipsHoughVote vote; +- ++ VipsHoughVote vote; + }; + +-GType vips_hough_get_type( void ); ++GType vips_hough_get_type(void); + + #ifdef __cplusplus + } +diff --git a/libvips/arithmetic/hough_circle.c b/libvips/arithmetic/hough_circle.c +index b0453228bb..222982cfd8 100644 +--- a/libvips/arithmetic/hough_circle.c ++++ b/libvips/arithmetic/hough_circle.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -66,13 +66,13 @@ typedef struct _VipsHoughCircle { + + typedef VipsHoughClass VipsHoughCircleClass; + +-G_DEFINE_TYPE( VipsHoughCircle, vips_hough_circle, VIPS_TYPE_HOUGH ); ++G_DEFINE_TYPE(VipsHoughCircle, vips_hough_circle, VIPS_TYPE_HOUGH); + + /* Smaller circles have fewer pixels and therefore fewer votes. Scale bands by + * the ratio of circumference, so all radii get equal weight. + */ + static void +-vips_hough_circle_normalise( VipsHoughCircle *hough_circle ) ++vips_hough_circle_normalise(VipsHoughCircle *hough_circle) + { + VipsHough *hough = (VipsHough *) hough_circle; + +@@ -87,92 +87,91 @@ vips_hough_circle_normalise( VipsHoughCircle *hough_circle ) + + int b; + +- for( b = 0; b < bands; b++ ) { ++ for (b = 0; b < bands; b++) { + int radius = b * scale + min_radius; + double circumference = 2 * VIPS_PI * radius; + double ratio = max_circumference / circumference; +- size_t n_pels = (size_t) width * height * bands; ++ size_t n_pels = (size_t) width * height * bands; + + size_t i; +- guint *q; ++ guint *q; + +- q = b + (guint *) VIPS_IMAGE_ADDR( hough->out, 0, 0 ); +- for( i = 0; i < n_pels; i += bands ) ++ q = b + (guint *) VIPS_IMAGE_ADDR(hough->out, 0, 0); ++ for (i = 0; i < n_pels; i += bands) + q[i] *= ratio; + } + } + + static int +-vips_hough_circle_build( VipsObject *object ) ++vips_hough_circle_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsStatistic *statistic = (VipsStatistic *) object; ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsStatistic *statistic = (VipsStatistic *) object; + VipsHoughCircle *hough_circle = (VipsHoughCircle *) object; + int range = hough_circle->max_radius - hough_circle->min_radius; + +- if( range <= 0 ) { +- vips_error( class->nickname, +- "%s", _( "parameters out of range" ) ); +- return( -1 ); ++ if (range <= 0) { ++ vips_error(class->nickname, ++ "%s", _("parameters out of range")); ++ return (-1); + } + + hough_circle->width = statistic->in->Xsize / hough_circle->scale; + hough_circle->height = statistic->in->Ysize / hough_circle->scale; + hough_circle->bands = 1 + range / hough_circle->scale; + +- if( VIPS_OBJECT_CLASS( vips_hough_circle_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_hough_circle_parent_class)->build(object)) ++ return (-1); + +- vips_hough_circle_normalise( hough_circle ); ++ vips_hough_circle_normalise(hough_circle); + +- return( 0 ); ++ return (0); + } + + static int +-vips_hough_circle_init_accumulator( VipsHough *hough, VipsImage *accumulator ) ++vips_hough_circle_init_accumulator(VipsHough *hough, VipsImage *accumulator) + { + VipsHoughCircle *hough_circle = (VipsHoughCircle *) hough; + +- vips_image_init_fields( accumulator, ++ vips_image_init_fields(accumulator, + hough_circle->width, hough_circle->height, hough_circle->bands, + VIPS_FORMAT_UINT, VIPS_CODING_NONE, + VIPS_INTERPRETATION_MATRIX, +- 1.0, 1.0 ); ++ 1.0, 1.0); + +- return( 0 ); ++ return (0); + } + + /* Vote endpoints, with clip. + */ +-static void +-vips_hough_circle_vote_endpoints_clip( VipsImage *image, +- int y, int x1, int x2, int quadrant, void *client ) ++static void ++vips_hough_circle_vote_endpoints_clip(VipsImage *image, ++ int y, int x1, int x2, int quadrant, void *client) + { +- int r = *((int *) client); ++ int r = *((int *) client); + int b = image->Bands; + +- if( y >= 0 && +- y < image->Ysize ) { +- guint *line = (guint *) VIPS_IMAGE_ADDR( image, 0, y ) + r; ++ if (y >= 0 && ++ y < image->Ysize) { ++ guint *line = (guint *) VIPS_IMAGE_ADDR(image, 0, y) + r; + +- if( x1 >=0 && +- x1 < image->Xsize ) ++ if (x1 >= 0 && ++ x1 < image->Xsize) + line[x1 * b] += 1; +- if( x2 >=0 && +- x2 < image->Xsize ) ++ if (x2 >= 0 && ++ x2 < image->Xsize) + line[x2 * b] += 1; + } + } + + /* Vote endpoints, no clip. + */ +-static void +-vips_hough_circle_vote_endpoints_noclip( VipsImage *image, +- int y, int x1, int x2, int quadrant, void *client ) ++static void ++vips_hough_circle_vote_endpoints_noclip(VipsImage *image, ++ int y, int x1, int x2, int quadrant, void *client) + { +- int r = *((int *) client); +- guint *line = (guint *) VIPS_IMAGE_ADDR( image, 0, y ) + r; ++ int r = *((int *) client); ++ guint *line = (guint *) VIPS_IMAGE_ADDR(image, 0, y) + r; + int b = image->Bands; + + line[x1 * b] += 1; +@@ -182,39 +181,39 @@ vips_hough_circle_vote_endpoints_noclip( VipsImage *image, + /* Cast votes for all possible circles passing through x, y. + */ + static void +-vips_hough_circle_vote( VipsHough *hough, VipsImage *accumulator, int x, int y ) ++vips_hough_circle_vote(VipsHough *hough, VipsImage *accumulator, int x, int y) + { +- VipsHoughCircle *hough_circle = (VipsHoughCircle *) hough; +- int min_radius = hough_circle->min_radius; ++ VipsHoughCircle *hough_circle = (VipsHoughCircle *) hough; ++ int min_radius = hough_circle->min_radius; + int cx = x / hough_circle->scale; + int cy = y / hough_circle->scale; + + int rb; + +- g_assert( hough_circle->max_radius - min_radius >= 0 ); ++ g_assert(hough_circle->max_radius - min_radius >= 0); + +- for( rb = 0; rb < hough_circle->bands; rb++ ) { ++ for (rb = 0; rb < hough_circle->bands; rb++) { + /* r needs to be in scaled down image space. + */ +- int r = rb + min_radius / hough_circle->scale; ++ int r = rb + min_radius / hough_circle->scale; + + VipsDrawScanline draw_scanline; + +- if( cx - r >= 0 && ++ if (cx - r >= 0 && + cx + r < accumulator->Xsize && +- cy - r >= 0 && +- cy + r < accumulator->Ysize ) ++ cy - r >= 0 && ++ cy + r < accumulator->Ysize) + draw_scanline = vips_hough_circle_vote_endpoints_noclip; + else +- draw_scanline = vips_hough_circle_vote_endpoints_clip; ++ draw_scanline = vips_hough_circle_vote_endpoints_clip; + +- vips__draw_circle_direct( accumulator, +- cx, cy, r, draw_scanline, &rb ); ++ vips__draw_circle_direct(accumulator, ++ cx, cy, r, draw_scanline, &rb); + } + } + + static void +-vips_hough_circle_class_init( VipsHoughClass *class ) ++vips_hough_circle_class_init(VipsHoughClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +@@ -224,41 +223,40 @@ vips_hough_circle_class_init( VipsHoughClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "hough_circle"; +- object_class->description = _( "find hough circle transform" ); ++ object_class->description = _("find hough circle transform"); + object_class->build = vips_hough_circle_build; + + hclass->init_accumulator = vips_hough_circle_init_accumulator; + hclass->vote = vips_hough_circle_vote; + +- VIPS_ARG_INT( class, "scale", 119, +- _( "Scale" ), +- _( "Scale down dimensions by this factor" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsHoughCircle, scale ), +- 1, 100000, 3 ); +- +- VIPS_ARG_INT( class, "min_radius", 120, +- _( "Min radius" ), +- _( "Smallest radius to search for" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsHoughCircle, min_radius ), +- 1, 100000, 10 ); +- +- VIPS_ARG_INT( class, "max_radius", 121, +- _( "Max radius" ), +- _( "Largest radius to search for" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsHoughCircle, max_radius ), +- 1, 100000, 20 ); +- ++ VIPS_ARG_INT(class, "scale", 119, ++ _("Scale"), ++ _("Scale down dimensions by this factor"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsHoughCircle, scale), ++ 1, 100000, 3); ++ ++ VIPS_ARG_INT(class, "min_radius", 120, ++ _("Min radius"), ++ _("Smallest radius to search for"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsHoughCircle, min_radius), ++ 1, 100000, 10); ++ ++ VIPS_ARG_INT(class, "max_radius", 121, ++ _("Max radius"), ++ _("Largest radius to search for"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsHoughCircle, max_radius), ++ 1, 100000, 20); + } + + static void +-vips_hough_circle_init( VipsHoughCircle *hough_circle ) ++vips_hough_circle_init(VipsHoughCircle *hough_circle) + { +- hough_circle->scale = 1; +- hough_circle->min_radius = 10; +- hough_circle->max_radius = 20; ++ hough_circle->scale = 1; ++ hough_circle->min_radius = 10; ++ hough_circle->max_radius = 20; + } + + /** +@@ -274,10 +272,10 @@ vips_hough_circle_init( VipsHoughCircle *hough_circle ) + * * @max_radius: largest radius to search for + * + * Find the circular Hough transform of an image. @in must be one band, with +- * non-zero pixels for image edges. @out is three-band, with the third channel ++ * non-zero pixels for image edges. @out is three-band, with the third channel + * representing the detected circle radius. The operation scales the number of + * votes by circle circumference so circles of differing size are given equal +- * weight. ++ * weight. + * + * The output pixel at (x, y, band) is the strength of the circle centred on + * (x, y) and with radius (band). +@@ -294,14 +292,14 @@ vips_hough_circle_init( VipsHoughCircle *hough_circle ) + * Returns: 0 on success, -1 on error + */ + int +-vips_hough_circle( VipsImage *in, VipsImage **out, ... ) ++vips_hough_circle(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "hough_circle", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("hough_circle", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/hough_line.c b/libvips/arithmetic/hough_line.c +index 42e6039a33..8d0f1dc513 100644 +--- a/libvips/arithmetic/hough_line.c ++++ b/libvips/arithmetic/hough_line.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -49,7 +49,7 @@ + typedef struct _VipsHoughLine { + VipsHough parent_instance; + +- /* Size of parameter space. ++ /* Size of parameter space. + */ + int width; + int height; +@@ -62,51 +62,51 @@ typedef struct _VipsHoughLine { + + typedef VipsHoughClass VipsHoughLineClass; + +-G_DEFINE_TYPE( VipsHoughLine, vips_hough_line, VIPS_TYPE_HOUGH ); ++G_DEFINE_TYPE(VipsHoughLine, vips_hough_line, VIPS_TYPE_HOUGH); + + static int +-vips_hough_line_build( VipsObject *object ) ++vips_hough_line_build(VipsObject *object) + { + VipsHoughLine *hough_line = (VipsHoughLine *) object; + int width = hough_line->width; + + int i; + +- if( !(hough_line->sin = VIPS_ARRAY( object, 2 * width, double )) ) +- return( -1 ); ++ if (!(hough_line->sin = VIPS_ARRAY(object, 2 * width, double))) ++ return (-1); + + /* Map width to 180 degrees, width * 2 to 360. + */ +- for( i = 0; i < 2 * width; i++ ) +- hough_line->sin[i] = sin( 2 * VIPS_PI * i / (2 * width) ); ++ for (i = 0; i < 2 * width; i++) ++ hough_line->sin[i] = sin(2 * VIPS_PI * i / (2 * width)); + +- if( VIPS_OBJECT_CLASS( vips_hough_line_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_hough_line_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_hough_line_init_accumulator( VipsHough *hough, VipsImage *accumulator ) ++vips_hough_line_init_accumulator(VipsHough *hough, VipsImage *accumulator) + { + VipsHoughLine *hough_line = (VipsHoughLine *) hough; + +- vips_image_init_fields( accumulator, ++ vips_image_init_fields(accumulator, + hough_line->width, hough_line->height, 1, + VIPS_FORMAT_UINT, VIPS_CODING_NONE, + VIPS_INTERPRETATION_MATRIX, +- 1.0, 1.0 ); ++ 1.0, 1.0); + +- return( 0 ); ++ return (0); + } + + /* Cast votes for all lines passing through x, y. + */ + static void +-vips_hough_line_vote( VipsHough *hough, VipsImage *accumulator, int x, int y ) ++vips_hough_line_vote(VipsHough *hough, VipsImage *accumulator, int x, int y) + { +- VipsHoughLine *hough_line = (VipsHoughLine *) hough; +- VipsStatistic *statistic = (VipsStatistic *) hough; ++ VipsHoughLine *hough_line = (VipsHoughLine *) hough; ++ VipsStatistic *statistic = (VipsStatistic *) hough; + double xd = (double) x / statistic->ready->Xsize; + double yd = (double) y / statistic->ready->Ysize; + int width = hough_line->width; +@@ -115,19 +115,19 @@ vips_hough_line_vote( VipsHough *hough, VipsImage *accumulator, int x, int y ) + + int i; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + int i90 = i + width / 2; + double r = xd * hough_line->sin[i90] + yd * hough_line->sin[i]; + int ri = height * r; + +- if( ri >= 0 && +- ri < height ) ++ if (ri >= 0 && ++ ri < height) + data[i + ri * width] += 1; + } + } + + static void +-vips_hough_line_class_init( VipsHoughClass *class ) ++vips_hough_line_class_init(VipsHoughClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +@@ -137,30 +137,29 @@ vips_hough_line_class_init( VipsHoughClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "hough_line"; +- object_class->description = _( "find hough line transform" ); ++ object_class->description = _("find hough line transform"); + object_class->build = vips_hough_line_build; + + hclass->init_accumulator = vips_hough_line_init_accumulator; + hclass->vote = vips_hough_line_vote; + +- VIPS_ARG_INT( class, "width", 110, +- _( "Width" ), +- _( "Horizontal size of parameter space" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsHoughLine, width ), +- 1, 100000, 256 ); +- +- VIPS_ARG_INT( class, "height", 111, +- _( "Height" ), +- _( "Vertical size of parameter space" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsHoughLine, height ), +- 1, 100000, 256 ); +- ++ VIPS_ARG_INT(class, "width", 110, ++ _("Width"), ++ _("Horizontal size of parameter space"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsHoughLine, width), ++ 1, 100000, 256); ++ ++ VIPS_ARG_INT(class, "height", 111, ++ _("Height"), ++ _("Vertical size of parameter space"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsHoughLine, height), ++ 1, 100000, 256); + } + + static void +-vips_hough_line_init( VipsHoughLine *hough_line ) ++vips_hough_line_init(VipsHoughLine *hough_line) + { + hough_line->width = 256; + hough_line->height = 256; +@@ -179,25 +178,25 @@ vips_hough_line_init( VipsHoughLine *hough_line ) + * + * Find the line Hough transform for @in. @in must have one band. @out has one + * band, with pixels being the number of votes for that line. The X dimension +- * of @out is the line angle in 0 - 180 degrees, the Y dimension is the +- * distance of the closest part of that line to the origin in the top-left. ++ * of @out is the line angle in 0 - 180 degrees, the Y dimension is the ++ * distance of the closest part of that line to the origin in the top-left. + * + * Use @width @height to set the size of the parameter space image (@out), +- * that is, how accurate the line determination should be. ++ * that is, how accurate the line determination should be. + * + * See also: vips_hough_circle(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_hough_line( VipsImage *in, VipsImage **out, ... ) ++vips_hough_line(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "hough_line", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("hough_line", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/invert.c b/libvips/arithmetic/invert.c +index 7631bea0ef..cbe5886e64 100644 +--- a/libvips/arithmetic/invert.c ++++ b/libvips/arithmetic/invert.c +@@ -14,35 +14,35 @@ + * 2/9/09 + * - gtk-doc comment + * 23/8/11 +- * - rewrite as a class ++ * - rewrite as a class + * 7/12/12 + * - only invert real part of complex + */ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -66,69 +66,82 @@ + typedef VipsUnary VipsInvert; + typedef VipsUnaryClass VipsInvertClass; + +-G_DEFINE_TYPE( VipsInvert, vips_invert, VIPS_TYPE_UNARY ); ++G_DEFINE_TYPE(VipsInvert, vips_invert, VIPS_TYPE_UNARY); + +-#define LOOP( TYPE, L ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = (L) - p[x]; \ +-} ++#define LOOP(TYPE, L) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = (L) -p[x]; \ ++ } + +-#define LOOPN( TYPE ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = -1 * p[x]; \ +-} ++#define LOOPN(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = -1 * p[x]; \ ++ } + +-#define LOOPC( TYPE ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- q[0] = -1 * p[0]; \ +- q[1] = p[1]; \ +- \ +- p += 2; \ +- q += 2; \ +- } \ +-} ++#define LOOPC(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ q[0] = -1 * p[0]; \ ++ q[1] = p[1]; \ ++\ ++ p += 2; \ ++ q += 2; \ ++ } \ ++ } + + static void +-vips_invert_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_invert_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsImage *im = arithmetic->ready[0]; +- const int sz = width * vips_image_get_bands( im ); ++ const int sz = width * vips_image_get_bands(im); + + int x; + +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_UCHAR: +- LOOP( unsigned char, UCHAR_MAX ); break; +- case VIPS_FORMAT_CHAR: +- LOOPN( signed char ); break; +- case VIPS_FORMAT_USHORT: +- LOOP( unsigned short, USHRT_MAX ); break; +- case VIPS_FORMAT_SHORT: +- LOOPN( signed short ); break; +- case VIPS_FORMAT_UINT: +- LOOP( unsigned int, UINT_MAX ); break; +- case VIPS_FORMAT_INT: +- LOOPN( signed int ); break; +- +- case VIPS_FORMAT_FLOAT: +- LOOPN( float ); break; +- case VIPS_FORMAT_DOUBLE: +- LOOPN( double ); break; +- +- case VIPS_FORMAT_COMPLEX: +- LOOPC( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: +- LOOPC( double ); break; ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_UCHAR: ++ LOOP(unsigned char, UCHAR_MAX); ++ break; ++ case VIPS_FORMAT_CHAR: ++ LOOPN(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ LOOP(unsigned short, USHRT_MAX); ++ break; ++ case VIPS_FORMAT_SHORT: ++ LOOPN(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ LOOP(unsigned int, UINT_MAX); ++ break; ++ case VIPS_FORMAT_INT: ++ LOOPN(signed int); ++ break; ++ ++ case VIPS_FORMAT_FLOAT: ++ LOOPN(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ LOOPN(double); ++ break; ++ ++ case VIPS_FORMAT_COMPLEX: ++ LOOPC(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ LOOPC(double); ++ break; + + default: + g_assert_not_reached(); +@@ -156,21 +169,21 @@ static const VipsBandFormat vips_invert_format_table[10] = { + }; + + static void +-vips_invert_class_init( VipsInvertClass *class ) ++vips_invert_class_init(VipsInvertClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + object_class->nickname = "invert"; +- object_class->description = _( "invert an image" ); ++ object_class->description = _("invert an image"); + + aclass->process_line = vips_invert_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_invert_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_invert_format_table); + } + + static void +-vips_invert_init( VipsInvert *invert ) ++vips_invert_init(VipsInvert *invert) + { + } + +@@ -182,7 +195,7 @@ vips_invert_init( VipsInvert *invert ) + * + * For unsigned formats, this operation calculates (max - @in), eg. (255 - + * @in) for uchar. For signed and float formats, this operation calculates (-1 +- * @in). ++ * @in). + * + * For complex images, only the real part is inverted. See also vips_conj(). + * +@@ -191,14 +204,14 @@ vips_invert_init( VipsInvert *invert ) + * Returns: 0 on success, -1 on error + */ + int +-vips_invert( VipsImage *in, VipsImage **out, ... ) ++vips_invert(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "invert", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("invert", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/linear.c b/libvips/arithmetic/linear.c +index bddde8896f..d2f26bdef4 100644 +--- a/libvips/arithmetic/linear.c ++++ b/libvips/arithmetic/linear.c +@@ -1,16 +1,16 @@ +-/* im_lintra.c -- linear transform ++/* im_lintra.c -- linear transform + * + * Copyright: 1990, N. Dessipris, based on im_powtra() + * Author: Nicos Dessipris + * Written on: 02/05/1990 +- * Modified on: ++ * Modified on: + * 23/4/93 JC + * - adapted to work with partial images + * 1/7/93 JC + * - adapted for partial v2 + * 7/10/94 JC + * - new IM_NEW() +- * - more typedefs ++ * - more typedefs + * 9/2/95 JC + * - adapted for im_wrap... + * - operations on complex images now just transform the real channel +@@ -49,28 +49,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -113,13 +113,13 @@ typedef struct _VipsLinear { + + typedef VipsUnaryClass VipsLinearClass; + +-G_DEFINE_TYPE( VipsLinear, vips_linear, VIPS_TYPE_UNARY ); ++G_DEFINE_TYPE(VipsLinear, vips_linear, VIPS_TYPE_UNARY); + + static int +-vips_linear_build( VipsObject *object ) ++vips_linear_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsArithmetic *arithmetic = VIPS_ARITHMETIC( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsArithmetic *arithmetic = VIPS_ARITHMETIC(object); + VipsUnary *unary = (VipsUnary *) object; + VipsLinear *linear = (VipsLinear *) object; + +@@ -129,260 +129,287 @@ vips_linear_build( VipsObject *object ) + * match. + */ + linear->n = 1; +- if( linear->a ) +- linear->n = VIPS_MAX( linear->n, linear->a->n ); +- if( linear->b ) +- linear->n = VIPS_MAX( linear->n, linear->b->n ); +- if( unary->in ) { ++ if (linear->a) ++ linear->n = VIPS_MAX(linear->n, linear->a->n); ++ if (linear->b) ++ linear->n = VIPS_MAX(linear->n, linear->b->n); ++ if (unary->in) { + int bands; + +- vips_image_decode_predict( unary->in, &bands, NULL ); +- linear->n = VIPS_MAX( linear->n, bands ); ++ vips_image_decode_predict(unary->in, &bands, NULL); ++ linear->n = VIPS_MAX(linear->n, bands); + } + arithmetic->base_bands = linear->n; + +- if( unary->in && +- linear->a && +- linear->b ) { +- if( vips_check_vector( class->nickname, +- linear->a->n, unary->in ) || +- vips_check_vector( class->nickname, +- linear->b->n, unary->in ) ) +- return( -1 ); ++ if (unary->in && ++ linear->a && ++ linear->b) { ++ if (vips_check_vector(class->nickname, ++ linear->a->n, unary->in) || ++ vips_check_vector(class->nickname, ++ linear->b->n, unary->in)) ++ return (-1); + } + + /* If all elements of the constants are equal, we can shrink them down + * to a single element. + */ +- if( linear->a ) { ++ if (linear->a) { + double *ary = (double *) linear->a->data; + gboolean all_equal; + + all_equal = TRUE; +- for( i = 1; i < linear->a->n; i++ ) +- if( ary[i] != ary[0] ) { ++ for (i = 1; i < linear->a->n; i++) ++ if (ary[i] != ary[0]) { + all_equal = FALSE; + break; + } + +- if( all_equal ) ++ if (all_equal) + linear->a->n = 1; + } +- if( linear->b ) { ++ if (linear->b) { + double *ary = (double *) linear->b->data; + gboolean all_equal; + + all_equal = TRUE; +- for( i = 1; i < linear->b->n; i++ ) +- if( ary[i] != ary[0] ) { ++ for (i = 1; i < linear->b->n; i++) ++ if (ary[i] != ary[0]) { + all_equal = FALSE; + break; + } + +- if( all_equal ) ++ if (all_equal) + linear->b->n = 1; + } + + /* Make up-banded versions of our constants. + */ +- linear->a_ready = VIPS_ARRAY( linear, linear->n, double ); +- linear->b_ready = VIPS_ARRAY( linear, linear->n, double ); ++ linear->a_ready = VIPS_ARRAY(linear, linear->n, double); ++ linear->b_ready = VIPS_ARRAY(linear, linear->n, double); + +- for( i = 0; i < linear->n; i++ ) { +- if( linear->a ) { ++ for (i = 0; i < linear->n; i++) { ++ if (linear->a) { + double *ary = (double *) linear->a->data; +- int j = VIPS_MIN( i, linear->a->n - 1 ); ++ int j = VIPS_MIN(i, linear->a->n - 1); + + linear->a_ready[i] = ary[j]; + } + +- if( linear->b ) { ++ if (linear->b) { + double *ary = (double *) linear->b->data; +- int j = VIPS_MIN( i, linear->b->n - 1 ); ++ int j = VIPS_MIN(i, linear->b->n - 1); + + linear->b_ready[i] = ary[j]; + } + } + +- if( linear->uchar ) ++ if (linear->uchar) + arithmetic->format = VIPS_FORMAT_UCHAR; + +- if( VIPS_OBJECT_CLASS( vips_linear_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_linear_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Non-complex input, any output, all bands of the constant equal. + */ +-#define LOOP1( IN, OUT ) { \ +- IN * restrict p = (IN *) in[0]; \ +- OUT * restrict q = (OUT *) out; \ +- OUT a1 = a[0]; \ +- OUT b1 = b[0]; \ +- int sz = width * nb; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = a1 * (OUT) p[x] + b1; \ +-} ++#define LOOP1(IN, OUT) \ ++ { \ ++ IN *restrict p = (IN *) in[0]; \ ++ OUT *restrict q = (OUT *) out; \ ++ OUT a1 = a[0]; \ ++ OUT b1 = b[0]; \ ++ int sz = width * nb; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = a1 * (OUT) p[x] + b1; \ ++ } + + /* Non-complex input, any output. + */ +-#define LOOPN( IN, OUT ) { \ +- IN * restrict p = (IN *) in[0]; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( i = 0, x = 0; x < width; x++ ) \ +- for( k = 0; k < nb; k++, i++ ) \ +- q[i] = a[k] * (OUT) p[i] + b[k]; \ +-} ++#define LOOPN(IN, OUT) \ ++ { \ ++ IN *restrict p = (IN *) in[0]; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (i = 0, x = 0; x < width; x++) \ ++ for (k = 0; k < nb; k++, i++) \ ++ q[i] = a[k] * (OUT) p[i] + b[k]; \ ++ } + +-#define LOOP( IN, OUT ) { \ +- if( linear->a->n == 1 && linear->b->n == 1 ) { \ +- LOOP1( IN, OUT ); \ +- } \ +- else { \ +- LOOPN( IN, OUT ); \ +- } \ +-} ++#define LOOP(IN, OUT) \ ++ { \ ++ if (linear->a->n == 1 && linear->b->n == 1) { \ ++ LOOP1(IN, OUT); \ ++ } \ ++ else { \ ++ LOOPN(IN, OUT); \ ++ } \ ++ } + +-/* Complex input, complex output. ++/* Complex input, complex output. + */ +-#define LOOPCMPLXN( IN, OUT ) { \ +- IN * restrict p = (IN *) in[0]; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < width; x++ ) \ +- for( k = 0; k < nb; k++ ) { \ +- q[0] = a[k] * p[0] + b[k]; \ +- q[1] = p[1]; \ +- q += 2; \ +- p += 2; \ +- } \ +-} ++#define LOOPCMPLXN(IN, OUT) \ ++ { \ ++ IN *restrict p = (IN *) in[0]; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < width; x++) \ ++ for (k = 0; k < nb; k++) { \ ++ q[0] = a[k] * p[0] + b[k]; \ ++ q[1] = p[1]; \ ++ q += 2; \ ++ p += 2; \ ++ } \ ++ } + + /* Non-complex input, any output, all bands of the constant equal, uchar + * output. + */ +-#define LOOP1uc( IN ) { \ +- IN * restrict p = (IN *) in[0]; \ +- VipsPel * restrict q = (VipsPel *) out; \ +- float a1 = a[0]; \ +- float b1 = b[0]; \ +- int sz = width * nb; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- float t = a1 * p[x] + b1; \ +- \ +- q[x] = VIPS_FCLIP( 0, t, 255 ); \ +- } \ +-} ++#define LOOP1uc(IN) \ ++ { \ ++ IN *restrict p = (IN *) in[0]; \ ++ VipsPel *restrict q = (VipsPel *) out; \ ++ float a1 = a[0]; \ ++ float b1 = b[0]; \ ++ int sz = width * nb; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ float t = a1 * p[x] + b1; \ ++\ ++ q[x] = VIPS_FCLIP(0, t, 255); \ ++ } \ ++ } + + /* Non-complex input, uchar output. + */ +-#define LOOPNuc( IN ) { \ +- IN * restrict p = (IN *) in[0]; \ +- VipsPel * restrict q = (VipsPel *) out; \ +- \ +- for( i = 0, x = 0; x < width; x++ ) \ +- for( k = 0; k < nb; k++, i++ ) { \ +- double t = a[k] * p[i] + b[k]; \ +- \ +- q[i] = VIPS_FCLIP( 0, t, 255 ); \ +- } \ +-} ++#define LOOPNuc(IN) \ ++ { \ ++ IN *restrict p = (IN *) in[0]; \ ++ VipsPel *restrict q = (VipsPel *) out; \ ++\ ++ for (i = 0, x = 0; x < width; x++) \ ++ for (k = 0; k < nb; k++, i++) { \ ++ double t = a[k] * p[i] + b[k]; \ ++\ ++ q[i] = VIPS_FCLIP(0, t, 255); \ ++ } \ ++ } + +-#define LOOPuc( IN ) { \ +- if( linear->a->n == 1 && linear->b->n == 1 ) { \ +- LOOP1uc( IN ); \ +- } \ +- else { \ +- LOOPNuc( IN ); \ +- } \ +-} ++#define LOOPuc(IN) \ ++ { \ ++ if (linear->a->n == 1 && linear->b->n == 1) { \ ++ LOOP1uc(IN); \ ++ } \ ++ else { \ ++ LOOPNuc(IN); \ ++ } \ ++ } + +-/* Complex input, uchar output. ++/* Complex input, uchar output. + */ +-#define LOOPCMPLXNuc( IN ) { \ +- IN * restrict p = (IN *) in[0]; \ +- VipsPel * restrict q = (VipsPel *) out; \ +- \ +- for( i = 0, x = 0; x < width; x++ ) \ +- for( k = 0; k < nb; k++, i++ ) { \ +- double t = a[k] * p[0] + b[k]; \ +- \ +- q[i] = VIPS_FCLIP( 0, t, 255 ); \ +- p += 2; \ +- } \ +-} ++#define LOOPCMPLXNuc(IN) \ ++ { \ ++ IN *restrict p = (IN *) in[0]; \ ++ VipsPel *restrict q = (VipsPel *) out; \ ++\ ++ for (i = 0, x = 0; x < width; x++) \ ++ for (k = 0; k < nb; k++, i++) { \ ++ double t = a[k] * p[0] + b[k]; \ ++\ ++ q[i] = VIPS_FCLIP(0, t, 255); \ ++ p += 2; \ ++ } \ ++ } + + /* Lintra a buffer, n set of scale/offset. + */ + static void +-vips_linear_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_linear_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsImage *im = arithmetic->ready[0]; + VipsLinear *linear = (VipsLinear *) arithmetic; +- double * restrict a = linear->a_ready; +- double * restrict b = linear->b_ready; ++ double *restrict a = linear->a_ready; ++ double *restrict b = linear->b_ready; + int nb = im->Bands; + + int i, x, k; + +- if( linear->uchar ) +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_UCHAR: +- LOOPuc( unsigned char ); break; +- case VIPS_FORMAT_CHAR: +- LOOPuc( signed char ); break; +- case VIPS_FORMAT_USHORT: +- LOOPuc( unsigned short ); break; +- case VIPS_FORMAT_SHORT: +- LOOPuc( signed short ); break; +- case VIPS_FORMAT_UINT: +- LOOPuc( unsigned int ); break; +- case VIPS_FORMAT_INT: +- LOOPuc( signed int ); break; +- case VIPS_FORMAT_FLOAT: +- LOOPuc( float ); break; +- case VIPS_FORMAT_DOUBLE: +- LOOPuc( double ); break; +- case VIPS_FORMAT_COMPLEX: +- LOOPCMPLXNuc( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: +- LOOPCMPLXNuc( double ); break; ++ if (linear->uchar) ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_UCHAR: ++ LOOPuc(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ LOOPuc(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ LOOPuc(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ LOOPuc(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ LOOPuc(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ LOOPuc(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ LOOPuc(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ LOOPuc(double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ LOOPCMPLXNuc(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ LOOPCMPLXNuc(double); ++ break; + + default: + g_assert_not_reached(); + } + else +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_UCHAR: +- LOOP( unsigned char, float ); break; +- case VIPS_FORMAT_CHAR: +- LOOP( signed char, float ); break; +- case VIPS_FORMAT_USHORT: +- LOOP( unsigned short, float ); break; +- case VIPS_FORMAT_SHORT: +- LOOP( signed short, float ); break; +- case VIPS_FORMAT_UINT: +- LOOP( unsigned int, float ); break; +- case VIPS_FORMAT_INT: +- LOOP( signed int, float ); break; +- case VIPS_FORMAT_FLOAT: +- LOOP( float, float ); break; +- case VIPS_FORMAT_DOUBLE: +- LOOP( double, double ); break; +- case VIPS_FORMAT_COMPLEX: +- LOOPCMPLXN( float, float ); break; +- case VIPS_FORMAT_DPCOMPLEX: +- LOOPCMPLXN( double, double ); break; ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_UCHAR: ++ LOOP(unsigned char, float); ++ break; ++ case VIPS_FORMAT_CHAR: ++ LOOP(signed char, float); ++ break; ++ case VIPS_FORMAT_USHORT: ++ LOOP(unsigned short, float); ++ break; ++ case VIPS_FORMAT_SHORT: ++ LOOP(signed short, float); ++ break; ++ case VIPS_FORMAT_UINT: ++ LOOP(unsigned int, float); ++ break; ++ case VIPS_FORMAT_INT: ++ LOOP(signed int, float); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ LOOP(float, float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ LOOP(double, double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ LOOPCMPLXN(float, float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ LOOPCMPLXN(double, double); ++ break; + + default: + g_assert_not_reached(); + } +- + } + + /* Save a bit of typing. +@@ -406,68 +433,67 @@ static const VipsBandFormat vips_linear_format_table[10] = { + }; + + static void +-vips_linear_class_init( VipsLinearClass *class ) ++vips_linear_class_init(VipsLinearClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "linear"; +- object_class->description = _( "calculate (a * in + b)" ); ++ object_class->description = _("calculate (a * in + b)"); + object_class->build = vips_linear_build; + + aclass->process_line = vips_linear_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_linear_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_linear_format_table); + +- VIPS_ARG_BOXED( class, "a", 110, +- _( "a" ), +- _( "Multiply by this" ), ++ VIPS_ARG_BOXED(class, "a", 110, ++ _("a"), ++ _("Multiply by this"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsLinear, a ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsLinear, a), ++ VIPS_TYPE_ARRAY_DOUBLE); + +- VIPS_ARG_BOXED( class, "b", 111, +- _( "b" ), +- _( "Add this" ), ++ VIPS_ARG_BOXED(class, "b", 111, ++ _("b"), ++ _("Add this"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsLinear, b ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsLinear, b), ++ VIPS_TYPE_ARRAY_DOUBLE); + +- VIPS_ARG_BOOL( class, "uchar", 112, +- _( "uchar" ), +- _( "Output should be uchar" ), ++ VIPS_ARG_BOOL(class, "uchar", 112, ++ _("uchar"), ++ _("Output should be uchar"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsLinear, uchar ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsLinear, uchar), ++ FALSE); + } + + static void +-vips_linear_init( VipsLinear *linear ) ++vips_linear_init(VipsLinear *linear) + { + } + + static int +-vips_linearv( VipsImage *in, VipsImage **out, +- const double *a, const double *b, int n, va_list ap ) ++vips_linearv(VipsImage *in, VipsImage **out, ++ const double *a, const double *b, int n, va_list ap) + { + VipsArea *area_a; + VipsArea *area_b; + int result; + +- area_a = VIPS_AREA( vips_array_double_new( a, n ) ); +- area_b = VIPS_AREA( vips_array_double_new( b, n ) ); ++ area_a = VIPS_AREA(vips_array_double_new(a, n)); ++ area_b = VIPS_AREA(vips_array_double_new(b, n)); + +- result = vips_call_split( "linear", ap, in, out, area_a, area_b ); ++ result = vips_call_split("linear", ap, in, out, area_a, area_b); + +- vips_area_unref( area_a ); +- vips_area_unref( area_b ); ++ vips_area_unref(area_a); ++ vips_area_unref(area_b); + +- return( result ); ++ return (result); + } + + /** +@@ -486,11 +512,11 @@ vips_linearv( VipsImage *in, VipsImage **out, + * Pass an image through a linear transform, ie. (@out = @in * @a + @b). Output + * is float for integer input, double for double input, complex for + * complex input and double complex for double complex input. Set @uchar to +- * output uchar pixels. ++ * output uchar pixels. + * +- * If the arrays of constants have just one element, that constant is used for +- * all image bands. If the arrays have more than one element and they have +- * the same number of elements as there are bands in the image, then ++ * If the arrays of constants have just one element, that constant is used for ++ * all image bands. If the arrays have more than one element and they have ++ * the same number of elements as there are bands in the image, then + * one array element is used for each band. If the arrays have more than one + * element and the image only has a single band, the result is a many-band + * image where each band corresponds to one array element. +@@ -500,17 +526,17 @@ vips_linearv( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_linear( VipsImage *in, VipsImage **out, +- const double *a, const double *b, int n, ... ) ++vips_linear(VipsImage *in, VipsImage **out, ++ const double *a, const double *b, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_linearv( in, out, a, b, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_linearv(in, out, a, b, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -525,21 +551,21 @@ vips_linear( VipsImage *in, VipsImage **out, + * + * * @uchar: output uchar pixels + * +- * Run vips_linear() with a single constant. ++ * Run vips_linear() with a single constant. + * + * See also: vips_linear(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_linear1( VipsImage *in, VipsImage **out, double a, double b, ... ) ++vips_linear1(VipsImage *in, VipsImage **out, double a, double b, ...) + { + va_list ap; + int result; + +- va_start( ap, b ); +- result = vips_linearv( in, out, &a, &b, 1, ap ); +- va_end( ap ); ++ va_start(ap, b); ++ result = vips_linearv(in, out, &a, &b, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/math.c b/libvips/arithmetic/math.c +index bed7ac925a..e3b18f23a7 100644 +--- a/libvips/arithmetic/math.c ++++ b/libvips/arithmetic/math.c +@@ -3,7 +3,7 @@ + * Copyright: 1990, N. Dessipris, based on im_powtra() + * Author: Nicos Dessipris + * Written on: 02/05/1990 +- * Modified on: ++ * Modified on: + * 5/5/93 JC + * - adapted from im_lintra to work with partial images + * - incorrect implementation of complex logs removed +@@ -29,28 +29,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -80,112 +80,153 @@ typedef struct _VipsMath { + + typedef VipsUnaryClass VipsMathClass; + +-G_DEFINE_TYPE( VipsMath, vips_math, VIPS_TYPE_UNARY ); ++G_DEFINE_TYPE(VipsMath, vips_math, VIPS_TYPE_UNARY); + + static int +-vips_math_build( VipsObject *object ) ++vips_math_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsUnary *unary = (VipsUnary *) object; + +- if( unary->in && +- vips_check_noncomplex( class->nickname, unary->in ) ) +- return( -1 ); ++ if (unary->in && ++ vips_check_noncomplex(class->nickname, unary->in)) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_math_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_math_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-#define LOOP( IN, OUT, OP ) { \ +- IN * restrict p = (IN *) in[0]; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = OP( p[x] ); \ +-} ++#define LOOP(IN, OUT, OP) \ ++ { \ ++ IN *restrict p = (IN *) in[0]; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = OP(p[x]); \ ++ } + +-#define SWITCH( OP ) \ +- switch( vips_image_get_format( im ) ) { \ ++#define SWITCH(OP) \ ++ switch (vips_image_get_format(im)) { \ + case VIPS_FORMAT_UCHAR: \ +- LOOP( unsigned char, float, OP ); break; \ ++ LOOP(unsigned char, float, OP); \ ++ break; \ + case VIPS_FORMAT_CHAR: \ +- LOOP( signed char, float, OP ); break; \ ++ LOOP(signed char, float, OP); \ ++ break; \ + case VIPS_FORMAT_USHORT: \ +- LOOP( unsigned short, float, OP ); break; \ ++ LOOP(unsigned short, float, OP); \ ++ break; \ + case VIPS_FORMAT_SHORT: \ +- LOOP( signed short, float, OP ); break; \ ++ LOOP(signed short, float, OP); \ ++ break; \ + case VIPS_FORMAT_UINT: \ +- LOOP( unsigned int, float, OP ); break; \ ++ LOOP(unsigned int, float, OP); \ ++ break; \ + case VIPS_FORMAT_INT: \ +- LOOP( signed int, float, OP ); break; \ ++ LOOP(signed int, float, OP); \ ++ break; \ + case VIPS_FORMAT_FLOAT: \ +- LOOP( float, float, OP ); break; \ ++ LOOP(float, float, OP); \ ++ break; \ + case VIPS_FORMAT_DOUBLE: \ +- LOOP( double, double, OP ); break;\ +- \ ++ LOOP(double, double, OP); \ ++ break; \ ++\ + default: \ + g_assert_not_reached(); \ +- } ++ } + + /* If there's asinh, assume we have the other two as well. + */ + #if HAVE_ASINH +- #define ASINH( X ) (asinh( X )) +- #define ACOSH( X ) (acosh( X )) +- #define ATANH( X ) (atanh( X )) ++#define ASINH(X) (asinh(X)) ++#define ACOSH(X) (acosh(X)) ++#define ATANH(X) (atanh(X)) + #else +- #define ASINH( X ) (LOGZ( (X) + sqrt( (X) * (X) + 1.0 ) )) +- #define ACOSH( X ) (LOGZ( (X) + sqrt( (X) * (X) - 1.0 ) )) +- #define ATANH( X ) (0.5 * LOGZ( (1.0 + (X)) / (1.0 - (X)) )) ++#define ASINH(X) (LOGZ((X) + sqrt((X) * (X) + 1.0))) ++#define ACOSH(X) (LOGZ((X) + sqrt((X) * (X) -1.0))) ++#define ATANH(X) (0.5 * LOGZ((1.0 + (X)) / (1.0 - (X)))) + #endif + + /* sin/cos/tan in degrees. + */ +-#define DSIN( X ) (sin( VIPS_RAD( X ) )) +-#define DCOS( X ) (cos( VIPS_RAD( X ) )) +-#define DTAN( X ) (tan( VIPS_RAD( X ) )) +-#define ADSIN( X ) (VIPS_DEG( asin( X ) )) +-#define ADCOS( X ) (VIPS_DEG( acos( X ) )) +-#define ADTAN( X ) (VIPS_DEG( atan( X ) )) ++#define DSIN(X) (sin(VIPS_RAD(X))) ++#define DCOS(X) (cos(VIPS_RAD(X))) ++#define DTAN(X) (tan(VIPS_RAD(X))) ++#define ADSIN(X) (VIPS_DEG(asin(X))) ++#define ADCOS(X) (VIPS_DEG(acos(X))) ++#define ADTAN(X) (VIPS_DEG(atan(X))) + + /* exp10() is a gnu extension, use pow(). + */ +-#define EXP10( X ) (pow( 10.0, (X) )) ++#define EXP10(X) (pow(10.0, (X))) + + /* Zero-avoiding log, cf. zero-avoiding behaviour of /. + */ +-#define LOGZ( X ) ((X) == 0.0 ? 0.0 : log( X )) +-#define LOGZ10( X ) ((X) == 0.0 ? 0.0 : log10( X )) ++#define LOGZ(X) ((X) == 0.0 ? 0.0 : log(X)) ++#define LOGZ10(X) ((X) == 0.0 ? 0.0 : log10(X)) + + static void +-vips_math_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_math_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsMath *math = (VipsMath *) arithmetic; + VipsImage *im = arithmetic->ready[0]; +- const int sz = width * vips_image_get_bands( im ); ++ const int sz = width * vips_image_get_bands(im); + + int x; + +- switch( math->math ) { +- case VIPS_OPERATION_MATH_SIN: SWITCH( DSIN ); break; +- case VIPS_OPERATION_MATH_COS: SWITCH( DCOS ); break; +- case VIPS_OPERATION_MATH_TAN: SWITCH( DTAN ); break; +- case VIPS_OPERATION_MATH_ASIN: SWITCH( ADSIN ); break; +- case VIPS_OPERATION_MATH_ACOS: SWITCH( ADCOS ); break; +- case VIPS_OPERATION_MATH_ATAN: SWITCH( ADTAN ); break; +- case VIPS_OPERATION_MATH_SINH: SWITCH( sinh ); break; +- case VIPS_OPERATION_MATH_COSH: SWITCH( cosh ); break; +- case VIPS_OPERATION_MATH_TANH: SWITCH( tanh ); break; +- case VIPS_OPERATION_MATH_ASINH: SWITCH( ASINH ); break; +- case VIPS_OPERATION_MATH_ACOSH: SWITCH( ACOSH ); break; +- case VIPS_OPERATION_MATH_ATANH: SWITCH( ATANH ); break; +- case VIPS_OPERATION_MATH_LOG: SWITCH( LOGZ ); break; +- case VIPS_OPERATION_MATH_LOG10: SWITCH( LOGZ10 ); break; +- case VIPS_OPERATION_MATH_EXP: SWITCH( exp ); break; +- case VIPS_OPERATION_MATH_EXP10: SWITCH( EXP10 ); break; ++ switch (math->math) { ++ case VIPS_OPERATION_MATH_SIN: ++ SWITCH(DSIN); ++ break; ++ case VIPS_OPERATION_MATH_COS: ++ SWITCH(DCOS); ++ break; ++ case VIPS_OPERATION_MATH_TAN: ++ SWITCH(DTAN); ++ break; ++ case VIPS_OPERATION_MATH_ASIN: ++ SWITCH(ADSIN); ++ break; ++ case VIPS_OPERATION_MATH_ACOS: ++ SWITCH(ADCOS); ++ break; ++ case VIPS_OPERATION_MATH_ATAN: ++ SWITCH(ADTAN); ++ break; ++ case VIPS_OPERATION_MATH_SINH: ++ SWITCH(sinh); ++ break; ++ case VIPS_OPERATION_MATH_COSH: ++ SWITCH(cosh); ++ break; ++ case VIPS_OPERATION_MATH_TANH: ++ SWITCH(tanh); ++ break; ++ case VIPS_OPERATION_MATH_ASINH: ++ SWITCH(ASINH); ++ break; ++ case VIPS_OPERATION_MATH_ACOSH: ++ SWITCH(ACOSH); ++ break; ++ case VIPS_OPERATION_MATH_ATANH: ++ SWITCH(ATANH); ++ break; ++ case VIPS_OPERATION_MATH_LOG: ++ SWITCH(LOGZ); ++ break; ++ case VIPS_OPERATION_MATH_LOG10: ++ SWITCH(LOGZ10); ++ break; ++ case VIPS_OPERATION_MATH_EXP: ++ SWITCH(exp); ++ break; ++ case VIPS_OPERATION_MATH_EXP10: ++ SWITCH(EXP10); ++ break; + + default: + g_assert_not_reached(); +@@ -211,40 +252,40 @@ static const VipsBandFormat vips_math_format_table[10] = { + }; + + static void +-vips_math_class_init( VipsMathClass *class ) ++vips_math_class_init(VipsMathClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "math"; +- object_class->description = _( "apply a math operation to an image" ); ++ object_class->description = _("apply a math operation to an image"); + object_class->build = vips_math_build; + + aclass->process_line = vips_math_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_math_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_math_format_table); + +- VIPS_ARG_ENUM( class, "math", 200, +- _( "Operation" ), +- _( "Math to perform" ), ++ VIPS_ARG_ENUM(class, "math", 200, ++ _("Operation"), ++ _("Math to perform"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMath, math ), +- VIPS_TYPE_OPERATION_MATH, VIPS_OPERATION_MATH_SIN ); ++ G_STRUCT_OFFSET(VipsMath, math), ++ VIPS_TYPE_OPERATION_MATH, VIPS_OPERATION_MATH_SIN); + } + + static void +-vips_math_init( VipsMath *math ) ++vips_math_init(VipsMath *math) + { + } + + static int +-vips_mathv( VipsImage *in, VipsImage **out, VipsOperationMath math, va_list ap ) ++vips_mathv(VipsImage *in, VipsImage **out, VipsOperationMath math, va_list ap) + { +- return( vips_call_split( "math", ap, in, out, math ) ); ++ return (vips_call_split("math", ap, in, out, math)); + } + + /** +@@ -254,10 +295,10 @@ vips_mathv( VipsImage *in, VipsImage **out, VipsOperationMath math, va_list ap ) + * @math: math operation to perform + * @...: %NULL-terminated list of optional named arguments + * +- * Perform various functions in -lm, the maths library, on images. ++ * Perform various functions in -lm, the maths library, on images. + * +- * Angles are expressed in degrees. The output type is float unless the +- * input is double, in which case the output is double. ++ * Angles are expressed in degrees. The output type is float unless the ++ * input is double, in which case the output is double. + * + * Non-complex images only. + * +@@ -266,16 +307,16 @@ vips_mathv( VipsImage *in, VipsImage **out, VipsOperationMath math, va_list ap ) + * Returns: 0 on success, -1 on error + */ + int +-vips_math( VipsImage *in, VipsImage **out, VipsOperationMath math, ... ) ++vips_math(VipsImage *in, VipsImage **out, VipsOperationMath math, ...) + { + va_list ap; + int result; + +- va_start( ap, math ); +- result = vips_mathv( in, out, math, ap ); +- va_end( ap ); ++ va_start(ap, math); ++ result = vips_mathv(in, out, math, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -289,16 +330,16 @@ vips_math( VipsImage *in, VipsImage **out, VipsOperationMath math, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_sin( VipsImage *in, VipsImage **out, ... ) ++vips_sin(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_SIN, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_SIN, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -312,16 +353,16 @@ vips_sin( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_cos( VipsImage *in, VipsImage **out, ... ) ++vips_cos(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_COS, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_COS, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -335,16 +376,16 @@ vips_cos( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_tan( VipsImage *in, VipsImage **out, ... ) ++vips_tan(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_TAN, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_TAN, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -358,16 +399,16 @@ vips_tan( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_asin( VipsImage *in, VipsImage **out, ... ) ++vips_asin(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_ASIN, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_ASIN, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -381,16 +422,16 @@ vips_asin( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_acos( VipsImage *in, VipsImage **out, ... ) ++vips_acos(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_ACOS, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_ACOS, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -404,16 +445,16 @@ vips_acos( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_atan( VipsImage *in, VipsImage **out, ... ) ++vips_atan(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_ATAN, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_ATAN, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -427,16 +468,16 @@ vips_atan( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_sinh( VipsImage *in, VipsImage **out, ... ) ++vips_sinh(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_SINH, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_SINH, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -450,16 +491,16 @@ vips_sinh( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_cosh( VipsImage *in, VipsImage **out, ... ) ++vips_cosh(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_COSH, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_COSH, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -473,16 +514,16 @@ vips_cosh( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_tanh( VipsImage *in, VipsImage **out, ... ) ++vips_tanh(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_TANH, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_TANH, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -496,16 +537,16 @@ vips_tanh( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_asinh( VipsImage *in, VipsImage **out, ... ) ++vips_asinh(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_ASINH, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_ASINH, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -519,16 +560,16 @@ vips_asinh( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_acosh( VipsImage *in, VipsImage **out, ... ) ++vips_acosh(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_ACOSH, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_ACOSH, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -542,16 +583,16 @@ vips_acosh( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_atanh( VipsImage *in, VipsImage **out, ... ) ++vips_atanh(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_ATANH, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_ATANH, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -565,16 +606,16 @@ vips_atanh( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_log( VipsImage *in, VipsImage **out, ... ) ++vips_log(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_LOG, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_LOG, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -588,16 +629,16 @@ vips_log( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_log10( VipsImage *in, VipsImage **out, ... ) ++vips_log10(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_LOG10, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_LOG10, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -611,16 +652,16 @@ vips_log10( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_exp( VipsImage *in, VipsImage **out, ... ) ++vips_exp(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_EXP, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_EXP, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -634,14 +675,14 @@ vips_exp( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_exp10( VipsImage *in, VipsImage **out, ... ) ++vips_exp10(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_mathv( in, out, VIPS_OPERATION_MATH_EXP10, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_mathv(in, out, VIPS_OPERATION_MATH_EXP10, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/math2.c b/libvips/arithmetic/math2.c +index 9c0b40634a..a18c2e012f 100644 +--- a/libvips/arithmetic/math2.c ++++ b/libvips/arithmetic/math2.c +@@ -4,7 +4,7 @@ + * + * Author: Nicos Dessipris + * Written on: 02/05/1990 +- * Modified on: ++ * Modified on: + * 10/12/93 JC + * - now reports total number of x/0, rather than each one. + * 1/2/95 JC +@@ -30,28 +30,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -82,113 +82,131 @@ typedef struct _VipsMath2 { + + typedef VipsBinaryClass VipsMath2Class; + +-G_DEFINE_TYPE( VipsMath2, vips_math2, VIPS_TYPE_BINARY ); ++G_DEFINE_TYPE(VipsMath2, vips_math2, VIPS_TYPE_BINARY); + + static int +-vips_math2_build( VipsObject *object ) ++vips_math2_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsBinary *binary = (VipsBinary *) object; + +- if( binary->left && +- vips_check_noncomplex( class->nickname, binary->left ) ) +- return( -1 ); +- if( binary->right && +- vips_check_noncomplex( class->nickname, binary->right ) ) +- return( -1 ); ++ if (binary->left && ++ vips_check_noncomplex(class->nickname, binary->left)) ++ return (-1); ++ if (binary->right && ++ vips_check_noncomplex(class->nickname, binary->right)) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_math2_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_math2_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-#define LOOP( IN, OUT, OP ) { \ +- IN * restrict p1 = (IN *) in[0]; \ +- IN * restrict p2 = (IN *) in[1]; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- OP( q[x], p1[x], p2[x] ); \ +-} +- +-#define SWITCH( L, OP ) \ +- switch( vips_image_get_format( im ) ) { \ ++#define LOOP(IN, OUT, OP) \ ++ { \ ++ IN *restrict p1 = (IN *) in[0]; \ ++ IN *restrict p2 = (IN *) in[1]; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ OP(q[x], p1[x], p2[x]); \ ++ } ++ ++#define SWITCH(L, OP) \ ++ switch (vips_image_get_format(im)) { \ + case VIPS_FORMAT_UCHAR: \ +- L( unsigned char, float, OP ); break; \ ++ L(unsigned char, float, OP); \ ++ break; \ + case VIPS_FORMAT_CHAR: \ +- L( signed char, float, OP ); break; \ ++ L(signed char, float, OP); \ ++ break; \ + case VIPS_FORMAT_USHORT: \ +- L( unsigned short, float, OP ); break; \ ++ L(unsigned short, float, OP); \ ++ break; \ + case VIPS_FORMAT_SHORT: \ +- L( signed short, float, OP ); break; \ ++ L(signed short, float, OP); \ ++ break; \ + case VIPS_FORMAT_UINT: \ +- L( unsigned int, float, OP ); break; \ ++ L(unsigned int, float, OP); \ ++ break; \ + case VIPS_FORMAT_INT: \ +- L( signed int, float, OP ); break; \ ++ L(signed int, float, OP); \ ++ break; \ + case VIPS_FORMAT_FLOAT: \ +- L( float, float, OP ); break; \ ++ L(float, float, OP); \ ++ break; \ + case VIPS_FORMAT_DOUBLE: \ +- L( double, double, OP ); break;\ +- \ ++ L(double, double, OP); \ ++ break; \ ++\ + default: \ + g_assert_not_reached(); \ +- } +- +-#define POW( Y, X, E ) { \ +- double left = (double) (X); \ +- double right = (double) (E); \ +- \ +- /* Special case for **-1 and **0.5, since they are so common. Also \ +- * watch for /0. \ +- */ \ +- (Y) = (left == 0.0) \ +- ? 0.0 \ +- : (right == -1) \ ++ } ++ ++#define POW(Y, X, E) \ ++ { \ ++ double left = (double) (X); \ ++ double right = (double) (E); \ ++\ ++ /* Special case for **-1 and **0.5, since they are so common. Also \ ++ * watch for /0. \ ++ */ \ ++ (Y) = (left == 0.0) \ ++ ? 0.0 \ ++ : (right == -1) \ + ? 1.0 / left \ + : (right == 0.5) \ +- ? sqrt( left ) \ +- : pow( left, right ); \ +-} +- +-#define WOP( Y, X, E ) POW( Y, E, X ) +- +-#ifdef HAVE_ATAN2 +-#define ATAN2( Y, L, R ) { \ +- double left = (double) (L); \ +- double right = (double) (R); \ +- \ +- (Y) = VIPS_DEG( atan2( left, right ) ); \ +- if( (Y) < 0.0 ) \ +- (Y) += 360; \ +-} ++ ? sqrt(left) \ ++ : pow(left, right); \ ++ } ++ ++#define WOP(Y, X, E) POW(Y, E, X) ++ ++#ifdef HAVE_ATAN2 ++#define ATAN2(Y, L, R) \ ++ { \ ++ double left = (double) (L); \ ++ double right = (double) (R); \ ++\ ++ (Y) = VIPS_DEG(atan2(left, right)); \ ++ if ((Y) < 0.0) \ ++ (Y) += 360; \ ++ } + #else +-#define ATAN2( Y, L, R ) { \ +- double left = (double) (L); \ +- double right = (double) (R); \ +- \ +- (Y) = vips_col_ab2h( left, right ); \ +-} +-#endif ++#define ATAN2(Y, L, R) \ ++ { \ ++ double left = (double) (L); \ ++ double right = (double) (R); \ ++\ ++ (Y) = vips_col_ab2h(left, right); \ ++ } ++#endif + + static void +-vips_math2_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_math2_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsMath2 *math2 = (VipsMath2 *) arithmetic; + VipsImage *im = arithmetic->ready[0]; +- const int sz = width * vips_image_get_bands( im ); ++ const int sz = width * vips_image_get_bands(im); + + int x; + +- switch( math2->math2 ) { +- case VIPS_OPERATION_MATH2_POW: SWITCH( LOOP, POW ); break; +- case VIPS_OPERATION_MATH2_WOP: SWITCH( LOOP, WOP ); break; +- case VIPS_OPERATION_MATH2_ATAN2: SWITCH( LOOP, ATAN2 ); break; ++ switch (math2->math2) { ++ case VIPS_OPERATION_MATH2_POW: ++ SWITCH(LOOP, POW); ++ break; ++ case VIPS_OPERATION_MATH2_WOP: ++ SWITCH(LOOP, WOP); ++ break; ++ case VIPS_OPERATION_MATH2_ATAN2: ++ SWITCH(LOOP, ATAN2); ++ break; + +- default: ++ default: + g_assert_not_reached(); +- } ++ } + } + + /* Save a bit of typing. +@@ -212,41 +230,41 @@ static const VipsBandFormat vips_math2_format_table[10] = { + }; + + static void +-vips_math2_class_init( VipsMath2Class *class ) ++vips_math2_class_init(VipsMath2Class *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "math2"; +- object_class->description = _( "binary math operations" ); ++ object_class->description = _("binary math operations"); + object_class->build = vips_math2_build; + + aclass->process_line = vips_math2_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_math2_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_math2_format_table); + +- VIPS_ARG_ENUM( class, "math2", 200, +- _( "Operation" ), +- _( "Math to perform" ), ++ VIPS_ARG_ENUM(class, "math2", 200, ++ _("Operation"), ++ _("Math to perform"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMath2, math2 ), +- VIPS_TYPE_OPERATION_MATH2, VIPS_OPERATION_MATH2_POW ); ++ G_STRUCT_OFFSET(VipsMath2, math2), ++ VIPS_TYPE_OPERATION_MATH2, VIPS_OPERATION_MATH2_POW); + } + + static void +-vips_math2_init( VipsMath2 *math2 ) ++vips_math2_init(VipsMath2 *math2) + { + } + + static int +-vips_math2v( VipsImage *left, VipsImage *right, VipsImage **out, +- VipsOperationMath2 math2, va_list ap ) ++vips_math2v(VipsImage *left, VipsImage *right, VipsImage **out, ++ VipsOperationMath2 math2, va_list ap) + { +- return( vips_call_split( "math2", ap, left, right, out, math2 ) ); ++ return (vips_call_split("math2", ap, left, right, out, math2)); + } + + /** +@@ -258,23 +276,23 @@ vips_math2v( VipsImage *left, VipsImage *right, VipsImage **out, + * @...: %NULL-terminated list of optional named arguments + * + * This operation calculates a 2-ary maths operation on a pair of images +- * and writes the result to @out. The images may have any ++ * and writes the result to @out. The images may have any + * non-complex format. @out is float except in the case that either of @left + * or @right are double, in which case @out is also double. + * +- * It detects division by zero, setting those pixels to zero in the output. ++ * It detects division by zero, setting those pixels to zero in the output. + * Beware: it does this silently! + * + * If the images differ in size, the smaller image is enlarged to match the + * larger by adding zero pixels along the bottom and right. + * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +- * The two input images are cast up to the smallest common format (see table +- * Smallest common format in ++ * The two input images are cast up to the smallest common format (see table ++ * Smallest common format in + * arithmetic), and that format is the + * result type. + * +@@ -283,17 +301,17 @@ vips_math2v( VipsImage *left, VipsImage *right, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_math2( VipsImage *left, VipsImage *right, VipsImage **out, +- VipsOperationMath2 math2, ... ) ++vips_math2(VipsImage *left, VipsImage *right, VipsImage **out, ++ VipsOperationMath2 math2, ...) + { + va_list ap; + int result; + +- va_start( ap, math2 ); +- result = vips_math2v( left, right, out, math2, ap ); +- va_end( ap ); ++ va_start(ap, math2); ++ result = vips_math2v(left, right, out, math2, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -309,16 +327,16 @@ vips_math2( VipsImage *left, VipsImage *right, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_pow( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_pow(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_math2v( left, right, out, VIPS_OPERATION_MATH2_POW, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_math2v(left, right, out, VIPS_OPERATION_MATH2_POW, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -334,16 +352,16 @@ vips_pow( VipsImage *left, VipsImage *right, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_wop( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_wop(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_math2v( left, right, out, VIPS_OPERATION_MATH2_WOP, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_math2v(left, right, out, VIPS_OPERATION_MATH2_WOP, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -359,19 +377,18 @@ vips_wop( VipsImage *left, VipsImage *right, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_atan2( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_atan2(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_math2v( left, right, out, VIPS_OPERATION_MATH2_ATAN2, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_math2v(left, right, out, VIPS_OPERATION_MATH2_ATAN2, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + +- + typedef struct _VipsMath2Const { + VipsUnaryConst parent_instance; + +@@ -381,39 +398,39 @@ typedef struct _VipsMath2Const { + + typedef VipsUnaryConstClass VipsMath2ConstClass; + +-G_DEFINE_TYPE( VipsMath2Const, +- vips_math2_const, VIPS_TYPE_UNARY_CONST ); ++G_DEFINE_TYPE(VipsMath2Const, ++ vips_math2_const, VIPS_TYPE_UNARY_CONST); + + static int +-vips_math2_const_build( VipsObject *object ) ++vips_math2_const_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsUnary *unary = (VipsUnary *) object; + +- if( unary->in && +- vips_check_noncomplex( class->nickname, unary->in ) ) +- return( -1 ); ++ if (unary->in && ++ vips_check_noncomplex(class->nickname, unary->in)) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_math2_const_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_math2_const_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-#define LOOPC( IN, OUT, OP ) { \ +- IN * restrict p = (IN *) in[0]; \ +- OUT * restrict q = (OUT *) out; \ +- double * restrict c = uconst->c_double; \ +- \ +- for( i = 0, x = 0; x < width; x++ ) \ +- for( b = 0; b < bands; b++, i++ ) \ +- OP( q[i], p[i], c[b] ); \ +-} ++#define LOOPC(IN, OUT, OP) \ ++ { \ ++ IN *restrict p = (IN *) in[0]; \ ++ OUT *restrict q = (OUT *) out; \ ++ double *restrict c = uconst->c_double; \ ++\ ++ for (i = 0, x = 0; x < width; x++) \ ++ for (b = 0; b < bands; b++, i++) \ ++ OP(q[i], p[i], c[b]); \ ++ } + + static void +-vips_math2_const_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_math2_const_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsUnaryConst *uconst = (VipsUnaryConst *) arithmetic; + VipsMath2Const *math2 = (VipsMath2Const *) arithmetic; +@@ -422,76 +439,76 @@ vips_math2_const_buffer( VipsArithmetic *arithmetic, + + int i, x, b; + +- switch( math2->math2 ) { +- case VIPS_OPERATION_MATH2_POW: +- SWITCH( LOOPC, POW ); ++ switch (math2->math2) { ++ case VIPS_OPERATION_MATH2_POW: ++ SWITCH(LOOPC, POW); + break; + +- case VIPS_OPERATION_MATH2_WOP: +- SWITCH( LOOPC, WOP ); ++ case VIPS_OPERATION_MATH2_WOP: ++ SWITCH(LOOPC, WOP); + break; + +- case VIPS_OPERATION_MATH2_ATAN2: +- SWITCH( LOOPC, ATAN2 ); ++ case VIPS_OPERATION_MATH2_ATAN2: ++ SWITCH(LOOPC, ATAN2); + break; + +- default: ++ default: + g_assert_not_reached(); + break; +- } ++ } + } + + static void +-vips_math2_const_class_init( VipsMath2ConstClass *class ) ++vips_math2_const_class_init(VipsMath2ConstClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "math2_const"; +- object_class->description = +- _( "binary math operations with a constant" ); ++ object_class->description = ++ _("binary math operations with a constant"); + object_class->build = vips_math2_const_build; + + aclass->process_line = vips_math2_const_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_math2_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_math2_format_table); + +- VIPS_ARG_ENUM( class, "math2", 200, +- _( "Operation" ), +- _( "Math to perform" ), ++ VIPS_ARG_ENUM(class, "math2", 200, ++ _("Operation"), ++ _("Math to perform"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMath2Const, math2 ), +- VIPS_TYPE_OPERATION_MATH2, VIPS_OPERATION_MATH2_POW ); ++ G_STRUCT_OFFSET(VipsMath2Const, math2), ++ VIPS_TYPE_OPERATION_MATH2, VIPS_OPERATION_MATH2_POW); + } + + static void +-vips_math2_const_init( VipsMath2Const *math2_const ) ++vips_math2_const_init(VipsMath2Const *math2_const) + { + } + + static int +-vips_math2_constv( VipsImage *in, VipsImage **out, +- VipsOperationMath2 math2, const double *c, int n, va_list ap ) ++vips_math2_constv(VipsImage *in, VipsImage **out, ++ VipsOperationMath2 math2, const double *c, int n, va_list ap) + { + VipsArea *area_c; +- double *array; ++ double *array; + int result; + int i; + +- area_c = vips_area_new_array( G_TYPE_DOUBLE, sizeof( double ), n ); ++ area_c = vips_area_new_array(G_TYPE_DOUBLE, sizeof(double), n); + array = (double *) area_c->data; +- for( i = 0; i < n; i++ ) ++ for (i = 0; i < n; i++) + array[i] = c[i]; + +- result = vips_call_split( "math2_const", ap, in, out, math2, area_c ); ++ result = vips_call_split("math2_const", ap, in, out, math2, area_c); + +- vips_area_unref( area_c ); ++ vips_area_unref(area_c); + +- return( result ); ++ return (result); + } + + /** +@@ -503,18 +520,18 @@ vips_math2_constv( VipsImage *in, VipsImage **out, + * @n: number of constants in @c + * @...: %NULL-terminated list of optional named arguments + * +- * This operation calculates various 2-ary maths operations on an image and +- * an array of constants and writes the result to @out. +- * The image may have any ++ * This operation calculates various 2-ary maths operations on an image and ++ * an array of constants and writes the result to @out. ++ * The image may have any + * non-complex format. @out is float except in the case that @in + * is double, in which case @out is also double. + * +- * It detects division by zero, setting those pixels to zero in the output. ++ * It detects division by zero, setting those pixels to zero in the output. + * Beware: it does this silently! + * +- * If the array of constants has just one element, that constant is used for +- * all image bands. If the array has more than one element and they have +- * the same number of elements as there are bands in the image, then ++ * If the array of constants has just one element, that constant is used for ++ * all image bands. If the array has more than one element and they have ++ * the same number of elements as there are bands in the image, then + * one array element is used for each band. If the arrays have more than one + * element and the image only has a single band, the result is a many-band + * image where each band corresponds to one array element. +@@ -524,17 +541,17 @@ vips_math2_constv( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_math2_const( VipsImage *in, VipsImage **out, +- VipsOperationMath2 math2, const double *c, int n, ... ) ++vips_math2_const(VipsImage *in, VipsImage **out, ++ VipsOperationMath2 math2, const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_math2_constv( in, out, math2, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_math2_constv(in, out, math2, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -551,17 +568,17 @@ vips_math2_const( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_pow_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) ++vips_pow_const(VipsImage *in, VipsImage **out, const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_math2_constv( in, out, +- VIPS_OPERATION_MATH2_POW, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_math2_constv(in, out, ++ VIPS_OPERATION_MATH2_POW, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -578,17 +595,17 @@ vips_pow_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_wop_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) ++vips_wop_const(VipsImage *in, VipsImage **out, const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_math2_constv( in, out, +- VIPS_OPERATION_MATH2_WOP, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_math2_constv(in, out, ++ VIPS_OPERATION_MATH2_WOP, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -605,17 +622,17 @@ vips_wop_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_atan2_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) ++vips_atan2_const(VipsImage *in, VipsImage **out, const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_math2_constv( in, out, +- VIPS_OPERATION_MATH2_ATAN2, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_math2_constv(in, out, ++ VIPS_OPERATION_MATH2_ATAN2, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -623,33 +640,33 @@ vips_atan2_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) + * @in: input image + * @out: (out): output image + * @math2: math operation to perform +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * +- * This operation calculates various 2-ary maths operations on an image and ++ * This operation calculates various 2-ary maths operations on an image and + * a constant. See vips_math2_const(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_math2_const1( VipsImage *in, VipsImage **out, +- VipsOperationMath2 math2, double c, ... ) ++vips_math2_const1(VipsImage *in, VipsImage **out, ++ VipsOperationMath2 math2, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_math2_constv( in, out, math2, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_math2_constv(in, out, math2, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_pow_const1: (method) + * @in: left-hand input #VipsImage + * @out: (out): output #VipsImage +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform #VIPS_OPERATION_MATH2_POW on an image and a constant. See +@@ -658,24 +675,24 @@ vips_math2_const1( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_pow_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_pow_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_math2_constv( in, out, +- VIPS_OPERATION_MATH2_POW, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_math2_constv(in, out, ++ VIPS_OPERATION_MATH2_POW, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_wop_const1: (method) + * @in: left-hand input #VipsImage + * @out: (out): output #VipsImage +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform #VIPS_OPERATION_MATH2_WOP on an image and a constant. See +@@ -684,24 +701,24 @@ vips_pow_const1( VipsImage *in, VipsImage **out, double c, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_wop_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_wop_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_math2_constv( in, out, +- VIPS_OPERATION_MATH2_WOP, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_math2_constv(in, out, ++ VIPS_OPERATION_MATH2_WOP, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_atan2_const1: (method) + * @in: left-hand input #VipsImage + * @out: (out): output #VipsImage +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform #VIPS_OPERATION_MATH2_ATAN2 on an image and a constant. See +@@ -710,15 +727,15 @@ vips_wop_const1( VipsImage *in, VipsImage **out, double c, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_atan2_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_atan2_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_math2_constv( in, out, +- VIPS_OPERATION_MATH2_ATAN2, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_math2_constv(in, out, ++ VIPS_OPERATION_MATH2_ATAN2, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/max.c b/libvips/arithmetic/max.c +index 09bd55ed2a..78fbb9c005 100644 +--- a/libvips/arithmetic/max.c ++++ b/libvips/arithmetic/max.c +@@ -29,28 +29,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -112,7 +112,7 @@ typedef struct _VipsMax { + int x; + int y; + +- /* And the positions and values we found as VipsArrays for returning ++ /* And the positions and values we found as VipsArrays for returning + * to our caller. + */ + VipsArrayDouble *out_array; +@@ -125,48 +125,48 @@ typedef struct _VipsMax { + } VipsMax; + + static void +-vips_values_init( VipsValues *values, VipsMax *max ) ++vips_values_init(VipsValues *values, VipsMax *max) + { + values->max = max; + + values->size = max->size; + values->n = 0; +- values->value = VIPS_ARRAY( max, values->size, double ); +- values->x_pos = VIPS_ARRAY( max, values->size, int ); +- values->y_pos = VIPS_ARRAY( max, values->size, int ); ++ values->value = VIPS_ARRAY(max, values->size, double); ++ values->x_pos = VIPS_ARRAY(max, values->size, int); ++ values->y_pos = VIPS_ARRAY(max, values->size, int); + } + + /* Add a value. Do nothing if the value is too small. + */ + static void +-vips_values_add( VipsValues *values, double v, int x, int y ) ++vips_values_add(VipsValues *values, double v, int x, int y) + { + int i, j; + + /* Find insertion point. + */ +- for( i = 0; i < values->n; i++ ) { +- if( v < values->value[i] ) ++ for (i = 0; i < values->n; i++) { ++ if (v < values->value[i]) + break; + +- if( v == values->value[i] ) { +- if( y < values->y_pos[i] ) ++ if (v == values->value[i]) { ++ if (y < values->y_pos[i]) + break; + +- if( y == values->y_pos[i] ) +- if( x <= values->x_pos[i] ) ++ if (y == values->y_pos[i]) ++ if (x <= values->x_pos[i]) + break; + } + } + +- /* Array full? ++ /* Array full? + */ +- if( values->n == values->size ) { +- if( i > 0 ) { ++ if (values->n == values->size) { ++ if (i > 0) { + /* We need to move stuff to the left to make space, + * shunting the smallest out. + */ +- for( j = 0; j < i - 1; j++ ) { ++ for (j = 0; j < i - 1; j++) { + values->value[j] = values->value[j + 1]; + values->x_pos[j] = values->x_pos[j + 1]; + values->y_pos[j] = values->y_pos[j + 1]; +@@ -179,7 +179,7 @@ vips_values_add( VipsValues *values, double v, int x, int y ) + else { + /* Not full, move stuff to the right into empty space. + */ +- for( j = values->n; j > i; j-- ) { ++ for (j = values->n; j > i; j--) { + values->value[j] = values->value[j - 1]; + values->x_pos[j] = values->x_pos[j - 1]; + values->y_pos[j] = values->y_pos[j - 1]; +@@ -193,107 +193,108 @@ vips_values_add( VipsValues *values, double v, int x, int y ) + + typedef VipsStatisticClass VipsMaxClass; + +-G_DEFINE_TYPE( VipsMax, vips_max, VIPS_TYPE_STATISTIC ); ++G_DEFINE_TYPE(VipsMax, vips_max, VIPS_TYPE_STATISTIC); + + static int +-vips_max_build( VipsObject *object ) ++vips_max_build(VipsObject *object) + { +- VipsStatistic *statistic = VIPS_STATISTIC( object ); ++ VipsStatistic *statistic = VIPS_STATISTIC(object); + VipsMax *max = (VipsMax *) object; + VipsValues *values = &max->values; + +- vips_values_init( values, max ); ++ vips_values_init(values, max); + +- if( VIPS_OBJECT_CLASS( vips_max_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_max_parent_class)->build(object)) ++ return (-1); + + /* For speed we accumulate max ** 2 for complex. + */ +- if( vips_band_format_iscomplex( +- vips_image_get_format( statistic->in ) ) ) { ++ if (vips_band_format_iscomplex( ++ vips_image_get_format(statistic->in))) { + int i; + +- for( i = 0; i < values->n; i++ ) +- values->value[i] = sqrt( values->value[i] ); ++ for (i = 0; i < values->n; i++) ++ values->value[i] = sqrt(values->value[i]); + } + + /* Don't set if there's no value (eg. if every pixel is NaN). This + * will trigger an error later. + */ +- if( values->n > 0 ) { ++ if (values->n > 0) { + VipsArrayDouble *out_array; + VipsArrayInt *x_array; + VipsArrayInt *y_array; + +- out_array = vips_array_double_new( values->value, values->n ); +- x_array = vips_array_int_new( values->x_pos, values->n ); +- y_array = vips_array_int_new( values->y_pos, values->n ); ++ out_array = vips_array_double_new(values->value, values->n); ++ x_array = vips_array_int_new(values->x_pos, values->n); ++ y_array = vips_array_int_new(values->y_pos, values->n); + + /* We have to set the props via g_object_set() to stop vips + * complaining they are unset. + */ +- g_object_set( max, ++ g_object_set(max, + "out", values->value[values->n - 1], + "x", values->x_pos[values->n - 1], + "y", values->y_pos[values->n - 1], + "out_array", out_array, + "x_array", x_array, + "y_array", y_array, +- NULL ); ++ NULL); + +- vips_area_unref( VIPS_AREA( out_array ) ); +- vips_area_unref( VIPS_AREA( x_array ) ); +- vips_area_unref( VIPS_AREA( y_array ) ); ++ vips_area_unref(VIPS_AREA(out_array)); ++ vips_area_unref(VIPS_AREA(x_array)); ++ vips_area_unref(VIPS_AREA(y_array)); + } + + #ifdef DEBUG +-{ int i; +- +- printf( "vips_max_build: %d values found\n", values->n ); +- for( i = 0; i < values->n; i++ ) +- printf( "%d) %g\t%d\t%d\n", +- i, +- values->value[i], +- values->x_pos[i], values->y_pos[i] ); +-} ++ { ++ int i; ++ ++ printf("vips_max_build: %d values found\n", values->n); ++ for (i = 0; i < values->n; i++) ++ printf("%d) %g\t%d\t%d\n", ++ i, ++ values->value[i], ++ values->x_pos[i], values->y_pos[i]); ++ } + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + /* New sequence value. Make a private VipsValues for this thread. + */ + static void * +-vips_max_start( VipsStatistic *statistic ) ++vips_max_start(VipsStatistic *statistic) + { + VipsValues *values; + +- values = g_new( VipsValues, 1 ); +- vips_values_init( values, (VipsMax *) statistic ); ++ values = g_new(VipsValues, 1); ++ vips_values_init(values, (VipsMax *) statistic); + +- return( (void *) values ); ++ return ((void *) values); + } + + /* Merge the sequence value back into the per-call state. + */ + static int +-vips_max_stop( VipsStatistic *statistic, void *seq ) ++vips_max_stop(VipsStatistic *statistic, void *seq) + { + VipsMax *max = (VipsMax *) statistic; + VipsValues *values = (VipsValues *) seq; + + int i; + +- for( i = 0; i < values->n; i++ ) +- vips_values_add( &max->values, +- values->value[i], values->x_pos[i], values->y_pos[i] ); ++ for (i = 0; i < values->n; i++) ++ vips_values_add(&max->values, ++ values->value[i], values->x_pos[i], values->y_pos[i]); + +- g_free( values ); ++ g_free(values); + +- return( 0 ); ++ return (0); + } + +-/* Real max with an upper bound. ++/* Real max with an upper bound. + * + * Add values to the buffer if they are greater than the buffer minimum. If + * the buffer isn't full, there is no minimum. +@@ -303,189 +304,202 @@ vips_max_stop( VipsStatistic *statistic, void *seq ) + * + * Stop if our array fills with maxval. + */ +-#define LOOPU( TYPE, UPPER ) { \ +- TYPE *p = (TYPE *) in; \ +- TYPE m; \ +- \ +- for( i = 0; i < sz && values->n < values->size; i++ ) \ +- vips_values_add( values, p[i], x + i / bands, y ); \ +- m = values->value[0]; \ +- \ +- for( ; i < sz; i++ ) { \ +- if( p[i] > m ) { \ +- vips_values_add( values, p[i], x + i / bands, y ); \ +- m = values->value[0]; \ +- \ +- if( m >= UPPER ) { \ +- statistic->stop = TRUE; \ +- break; \ ++#define LOOPU(TYPE, UPPER) \ ++ { \ ++ TYPE *p = (TYPE *) in; \ ++ TYPE m; \ ++\ ++ for (i = 0; i < sz && values->n < values->size; i++) \ ++ vips_values_add(values, p[i], x + i / bands, y); \ ++ m = values->value[0]; \ ++\ ++ for (; i < sz; i++) { \ ++ if (p[i] > m) { \ ++ vips_values_add(values, p[i], x + i / bands, y); \ ++ m = values->value[0]; \ ++\ ++ if (m >= UPPER) { \ ++ statistic->stop = TRUE; \ ++ break; \ ++ } \ + } \ + } \ +- } \ +-} ++ } + + /* float/double max ... no limits, and we have to avoid NaN. + * + * NaN compares false to every float value, so we don't need to test for NaN +- * in the second loop. ++ * in the second loop. + */ +-#define LOOPF( TYPE ) { \ +- TYPE *p = (TYPE *) in; \ +- TYPE m; \ +- \ +- for( i = 0; i < sz && values->n < values->size; i++ ) \ +- if( !VIPS_ISNAN( p[i] ) ) \ +- vips_values_add( values, p[i], x + i / bands, y ); \ +- m = values->value[0]; \ +- \ +- for( ; i < sz; i++ ) \ +- if( p[i] > m ) { \ +- vips_values_add( values, p[i], x + i / bands, y ); \ +- m = values->value[0]; \ +- } \ +-} ++#define LOOPF(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) in; \ ++ TYPE m; \ ++\ ++ for (i = 0; i < sz && values->n < values->size; i++) \ ++ if (!VIPS_ISNAN(p[i])) \ ++ vips_values_add(values, p[i], x + i / bands, y); \ ++ m = values->value[0]; \ ++\ ++ for (; i < sz; i++) \ ++ if (p[i] > m) { \ ++ vips_values_add(values, p[i], x + i / bands, y); \ ++ m = values->value[0]; \ ++ } \ ++ } + + /* As LOOPF, but complex. Track max(mod ** 2) to avoid sqrt(). + */ +-#define LOOPC( TYPE ) { \ +- TYPE *p = (TYPE *) in; \ +- TYPE m; \ +- \ +- for( i = 0; i < sz && values->n < values->size; i++ ) { \ +- TYPE mod2 = p[0] * p[0] + p[1] * p[1]; \ +- \ +- if( !VIPS_ISNAN( mod2 ) ) \ +- vips_values_add( values, p[i], x + i / bands, y ); \ +- \ +- p += 2; \ +- } \ +- m = values->value[0]; \ +- \ +- for( ; i < sz; i++ ) { \ +- TYPE mod2 = p[0] * p[0] + p[1] * p[1]; \ +- \ +- if( mod2 > m ) { \ +- vips_values_add( values, mod2, x + i / bands, y ); \ +- m = values->value[0]; \ ++#define LOOPC(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) in; \ ++ TYPE m; \ ++\ ++ for (i = 0; i < sz && values->n < values->size; i++) { \ ++ TYPE mod2 = p[0] * p[0] + p[1] * p[1]; \ ++\ ++ if (!VIPS_ISNAN(mod2)) \ ++ vips_values_add(values, p[i], x + i / bands, y); \ ++\ ++ p += 2; \ + } \ +- \ +- p += 2; \ +- } \ +-} ++ m = values->value[0]; \ ++\ ++ for (; i < sz; i++) { \ ++ TYPE mod2 = p[0] * p[0] + p[1] * p[1]; \ ++\ ++ if (mod2 > m) { \ ++ vips_values_add(values, mod2, x + i / bands, y); \ ++ m = values->value[0]; \ ++ } \ ++\ ++ p += 2; \ ++ } \ ++ } + + /* Loop over region, adding to seq. + */ + static int +-vips_max_scan( VipsStatistic *statistic, void *seq, +- int x, int y, void *in, int n ) ++vips_max_scan(VipsStatistic *statistic, void *seq, ++ int x, int y, void *in, int n) + { + VipsValues *values = (VipsValues *) seq; +- const int bands = vips_image_get_bands( statistic->in ); ++ const int bands = vips_image_get_bands(statistic->in); + const int sz = n * bands; + + int i; + +- switch( vips_image_get_format( statistic->in ) ) { +- case VIPS_FORMAT_UCHAR: +- LOOPU( unsigned char, UCHAR_MAX ); break; +- case VIPS_FORMAT_CHAR: +- LOOPU( signed char, SCHAR_MAX ); break; +- case VIPS_FORMAT_USHORT: +- LOOPU( unsigned short, USHRT_MAX ); break; +- case VIPS_FORMAT_SHORT: +- LOOPU( signed short, SHRT_MAX ); break; +- case VIPS_FORMAT_UINT: +- LOOPU( unsigned int, UINT_MAX ); break; +- case VIPS_FORMAT_INT: +- LOOPU( signed int, INT_MAX ); break; +- +- case VIPS_FORMAT_FLOAT: +- LOOPF( float ); break; +- case VIPS_FORMAT_DOUBLE: +- LOOPF( double ); break; ++ switch (vips_image_get_format(statistic->in)) { ++ case VIPS_FORMAT_UCHAR: ++ LOOPU(unsigned char, UCHAR_MAX); ++ break; ++ case VIPS_FORMAT_CHAR: ++ LOOPU(signed char, SCHAR_MAX); ++ break; ++ case VIPS_FORMAT_USHORT: ++ LOOPU(unsigned short, USHRT_MAX); ++ break; ++ case VIPS_FORMAT_SHORT: ++ LOOPU(signed short, SHRT_MAX); ++ break; ++ case VIPS_FORMAT_UINT: ++ LOOPU(unsigned int, UINT_MAX); ++ break; ++ case VIPS_FORMAT_INT: ++ LOOPU(signed int, INT_MAX); ++ break; ++ ++ case VIPS_FORMAT_FLOAT: ++ LOOPF(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ LOOPF(double); ++ break; + + case VIPS_FORMAT_COMPLEX: +- LOOPC( float ); break; ++ LOOPC(float); ++ break; + case VIPS_FORMAT_DPCOMPLEX: +- LOOPC( double ); break; ++ LOOPC(double); ++ break; + +- default: ++ default: + g_assert_not_reached(); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_max_class_init( VipsMaxClass *class ) ++vips_max_class_init(VipsMaxClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS( class ); ++ VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "max"; +- object_class->description = _( "find image maximum" ); ++ object_class->description = _("find image maximum"); + object_class->build = vips_max_build; + + sclass->start = vips_max_start; + sclass->scan = vips_max_scan; + sclass->stop = vips_max_stop; + +- VIPS_ARG_DOUBLE( class, "out", 1, +- _( "Output" ), +- _( "Output value" ), ++ VIPS_ARG_DOUBLE(class, "out", 1, ++ _("Output"), ++ _("Output value"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsMax, out ), +- -INFINITY, INFINITY, 0.0 ); ++ G_STRUCT_OFFSET(VipsMax, out), ++ -INFINITY, INFINITY, 0.0); + +- VIPS_ARG_INT( class, "x", 2, +- _( "x" ), +- _( "Horizontal position of maximum" ), ++ VIPS_ARG_INT(class, "x", 2, ++ _("x"), ++ _("Horizontal position of maximum"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMax, x ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsMax, x), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "y", 3, +- _( "y" ), +- _( "Vertical position of maximum" ), ++ VIPS_ARG_INT(class, "y", 3, ++ _("y"), ++ _("Vertical position of maximum"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMax, y ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsMax, y), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "size", 4, +- _( "Size" ), +- _( "Number of maximum values to find" ), ++ VIPS_ARG_INT(class, "size", 4, ++ _("Size"), ++ _("Number of maximum values to find"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMax, size ), +- 1, 1000000, 10 ); ++ G_STRUCT_OFFSET(VipsMax, size), ++ 1, 1000000, 10); + +- VIPS_ARG_BOXED( class, "out_array", 6, +- _( "Output array" ), +- _( "Array of output values" ), ++ VIPS_ARG_BOXED(class, "out_array", 6, ++ _("Output array"), ++ _("Array of output values"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMax, out_array ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsMax, out_array), ++ VIPS_TYPE_ARRAY_DOUBLE); + +- VIPS_ARG_BOXED( class, "x_array", 7, +- _( "x array" ), +- _( "Array of horizontal positions" ), ++ VIPS_ARG_BOXED(class, "x_array", 7, ++ _("x array"), ++ _("Array of horizontal positions"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMax, x_array ), +- VIPS_TYPE_ARRAY_INT ); ++ G_STRUCT_OFFSET(VipsMax, x_array), ++ VIPS_TYPE_ARRAY_INT); + +- VIPS_ARG_BOXED( class, "y_array", 8, +- _( "y array" ), +- _( "Array of vertical positions" ), ++ VIPS_ARG_BOXED(class, "y_array", 8, ++ _("y array"), ++ _("Array of vertical positions"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMax, y_array ), +- VIPS_TYPE_ARRAY_INT ); ++ G_STRUCT_OFFSET(VipsMax, y_array), ++ VIPS_TYPE_ARRAY_INT); + } + + static void +-vips_max_init( VipsMax *max ) ++vips_max_init(VipsMax *max) + { + max->size = 1; + } +@@ -505,40 +519,40 @@ vips_max_init( VipsMax *max ) + * * @x_array: corresponding horizontal positions + * * @y_array: corresponding vertical positions + * +- * This operation finds the maximum value in an image. ++ * This operation finds the maximum value in an image. + * +- * By default it finds the single largest value. If @size is set >1, it will +- * find the @size largest values. It will stop searching early if has found +- * enough values. ++ * By default it finds the single largest value. If @size is set >1, it will ++ * find the @size largest values. It will stop searching early if has found ++ * enough values. + * Equal values will be sorted by y then x. + * +- * It operates on all +- * bands of the input image: use vips_stats() if you need to find an +- * maximum for each band. ++ * It operates on all ++ * bands of the input image: use vips_stats() if you need to find an ++ * maximum for each band. + * + * For complex images, this operation finds the maximum modulus. + * + * You can read out the position of the maximum with @x and @y. You can read + * out arrays of the values and positions of the top @size maxima with +- * @out_array, @x_array and @y_array. These values are returned sorted from ++ * @out_array, @x_array and @y_array. These values are returned sorted from + * largest to smallest. + * + * If there are more than @size maxima, the maxima returned will be a random +- * selection of the maxima in the image. ++ * selection of the maxima in the image. + * + * See also: vips_min(), vips_stats(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_max( VipsImage *in, double *out, ... ) ++vips_max(VipsImage *in, double *out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "max", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("max", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/measure.c b/libvips/arithmetic/measure.c +index 1dd6ce201a..f3c1a01931 100644 +--- a/libvips/arithmetic/measure.c ++++ b/libvips/arithmetic/measure.c +@@ -1,6 +1,6 @@ + /* im_measure.c + * +- * Modified: ++ * Modified: + * 19/8/94 JC + * - now uses doubles for addressing + * - could miss by up to h pixels previously! +@@ -27,28 +27,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -85,12 +85,12 @@ typedef struct _VipsMeasure { + + typedef VipsOperationClass VipsMeasureClass; + +-G_DEFINE_TYPE( VipsMeasure, vips_measure, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsMeasure, vips_measure, VIPS_TYPE_OPERATION); + + static int +-vips_measure_build( VipsObject *object ) ++vips_measure_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsMeasure *measure = (VipsMeasure *) object; + + VipsImage *ready; +@@ -101,25 +101,25 @@ vips_measure_build( VipsObject *object ) + int w, h; + int b; + +- if( VIPS_OBJECT_CLASS( vips_measure_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_measure_parent_class)->build(object)) ++ return (-1); + +- if( vips_image_decode( measure->in, &ready ) ) +- return( -1 ); +- vips_object_local( measure, ready ); ++ if (vips_image_decode(measure->in, &ready)) ++ return (-1); ++ vips_object_local(measure, ready); + +- bands = vips_image_get_bands( ready ); ++ bands = vips_image_get_bands(ready); + +- g_object_set( object, +- "out", vips_image_new_matrix( bands, measure->h * measure->v ), +- NULL ); ++ g_object_set(object, ++ "out", vips_image_new_matrix(bands, measure->h * measure->v), ++ NULL); + + /* left/top/width/height default to the size of the image. + */ +- if( !vips_object_argument_isset( object, "width" ) ) +- measure->width = vips_image_get_width( ready ); +- if( !vips_object_argument_isset( object, "height" ) ) +- measure->height = vips_image_get_height( ready ); ++ if (!vips_object_argument_isset(object, "width")) ++ measure->width = vips_image_get_width(ready); ++ if (!vips_object_argument_isset(object, "height")) ++ measure->height = vips_image_get_height(ready); + + /* How large are the patches we are to measure? + */ +@@ -131,54 +131,54 @@ vips_measure_build( VipsObject *object ) + w = (pw + 1) / 2; + h = (ph + 1) / 2; + +- for( j = 0; j < measure->v; j++ ) { +- for( i = 0; i < measure->h; i++ ) { ++ for (j = 0; j < measure->v; j++) { ++ for (i = 0; i < measure->h; i++) { + int x = measure->left + i * pw + (pw + 2) / 4; + int y = measure->top + j * ph + (ph + 2) / 4; + + double avg, dev; + +- for( b = 0; b < bands; b++ ) { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( object, 2 ); ++ for (b = 0; b < bands; b++) { ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(object, 2); + + /* Extract and measure. + */ +- if( vips_extract_area( ready, &t[0], +- x, y, w, h, NULL ) || +- vips_extract_band( t[0], &t[1], +- b, NULL ) || +- vips_avg( t[1], &avg, NULL ) || +- vips_deviate( t[1], &dev, NULL ) ) +- return( -1 ); +- +- /* Is the deviation large compared with the +- * average? This could be a clue that our +- * parameters have caused us to miss the +- * patch. Look out for averages <0, or ++ if (vips_extract_area(ready, &t[0], ++ x, y, w, h, NULL) || ++ vips_extract_band(t[0], &t[1], ++ b, NULL) || ++ vips_avg(t[1], &avg, NULL) || ++ vips_deviate(t[1], &dev, NULL)) ++ return (-1); ++ ++ /* Is the deviation large compared with the ++ * average? This could be a clue that our ++ * parameters have caused us to miss the ++ * patch. Look out for averages <0, or + * averages near zero (can get these if use + * measure on IM_TYPE_LAB images). + */ +- if( dev * 5 > VIPS_FABS( avg ) && +- VIPS_FABS( avg ) > 3 ) +- g_warning( _( "%s: " +- "patch %d x %d, " +- "band %d: " +- "avg = %g, sdev = %g" ), ++ if (dev * 5 > VIPS_FABS(avg) && ++ VIPS_FABS(avg) > 3) ++ g_warning(_("%s: " ++ "patch %d x %d, " ++ "band %d: " ++ "avg = %g, sdev = %g"), + class->nickname, +- i, j, b, avg, dev ); ++ i, j, b, avg, dev); + +- *VIPS_MATRIX( measure->out, +- b, i + j * measure->h ) = avg; ++ *VIPS_MATRIX(measure->out, ++ b, i + j * measure->h) = avg; + } + } + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_measure_class_init( VipsMeasureClass *class ) ++vips_measure_class_init(VipsMeasureClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +@@ -187,68 +187,67 @@ vips_measure_class_init( VipsMeasureClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "measure"; +- object_class->description = +- _( "measure a set of patches on a color chart" ); ++ object_class->description = ++ _("measure a set of patches on a color chart"); + object_class->build = vips_measure_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Image to measure" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Image to measure"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMeasure, in ) ); ++ G_STRUCT_OFFSET(VipsMeasure, in)); + +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output array of statistics" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsMeasure, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output array of statistics"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsMeasure, out)); + +- VIPS_ARG_INT( class, "h", 5, +- _( "Across" ), +- _( "Number of patches across chart" ), ++ VIPS_ARG_INT(class, "h", 5, ++ _("Across"), ++ _("Number of patches across chart"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMeasure, h ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsMeasure, h), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "v", 6, +- _( "Down" ), +- _( "Number of patches down chart" ), ++ VIPS_ARG_INT(class, "v", 6, ++ _("Down"), ++ _("Number of patches down chart"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMeasure, v ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsMeasure, v), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "left", 10, +- _( "Left" ), +- _( "Left edge of extract area" ), ++ VIPS_ARG_INT(class, "left", 10, ++ _("Left"), ++ _("Left edge of extract area"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMeasure, left ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsMeasure, left), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "top", 11, +- _( "Top" ), +- _( "Top edge of extract area" ), ++ VIPS_ARG_INT(class, "top", 11, ++ _("Top"), ++ _("Top edge of extract area"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMeasure, top ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsMeasure, top), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "width", 12, +- _( "Width" ), +- _( "Width of extract area" ), ++ VIPS_ARG_INT(class, "width", 12, ++ _("Width"), ++ _("Width of extract area"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMeasure, width ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsMeasure, width), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "height", 13, +- _( "Height" ), +- _( "Height of extract area" ), ++ VIPS_ARG_INT(class, "height", 13, ++ _("Height"), ++ _("Height of extract area"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMeasure, height ), +- 1, VIPS_MAX_COORD, 1 ); +- ++ G_STRUCT_OFFSET(VipsMeasure, height), ++ 1, VIPS_MAX_COORD, 1); + } + + static void +-vips_measure_init( VipsMeasure *measure ) ++vips_measure_init(VipsMeasure *measure) + { + } + +@@ -269,11 +268,11 @@ vips_measure_init( VipsMeasure *measure ) + * + * Analyse a grid of colour patches, producing an array of patch averages. + * The mask has a row for each measured patch and a column for each image +- * band. The operations issues a warning if any patch has a deviation more ++ * band. The operations issues a warning if any patch has a deviation more + * than 20% of +- * the mean. Only the central 50% of each patch is averaged. ++ * the mean. Only the central 50% of each patch is averaged. + * +- * If the chart does not fill the whole image, use the optional @left, @top, ++ * If the chart does not fill the whole image, use the optional @left, @top, + * @width, @height arguments to indicate the + * position of the chart. + * +@@ -282,14 +281,14 @@ vips_measure_init( VipsMeasure *measure ) + * Returns: 0 on success, -1 on error + */ + int +-vips_measure( VipsImage *in, VipsImage **out, int h, int v, ... ) ++vips_measure(VipsImage *in, VipsImage **out, int h, int v, ...) + { + va_list ap; + int result; + +- va_start( ap, v ); +- result = vips_call_split( "measure", ap, in, out, h, v ); +- va_end( ap ); ++ va_start(ap, v); ++ result = vips_call_split("measure", ap, in, out, h, v); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/min.c b/libvips/arithmetic/min.c +index 2888a32699..bcc931b010 100644 +--- a/libvips/arithmetic/min.c ++++ b/libvips/arithmetic/min.c +@@ -29,28 +29,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -112,7 +112,7 @@ typedef struct _VipsMin { + int x; + int y; + +- /* And the positions and values we found as VipsArrays for returning ++ /* And the positions and values we found as VipsArrays for returning + * to our caller. + */ + VipsArrayDouble *min_array; +@@ -125,48 +125,48 @@ typedef struct _VipsMin { + } VipsMin; + + static void +-vips_values_init( VipsValues *values, VipsMin *min ) ++vips_values_init(VipsValues *values, VipsMin *min) + { + values->min = min; + + values->size = min->size; + values->n = 0; +- values->value = VIPS_ARRAY( min, values->size, double ); +- values->x_pos = VIPS_ARRAY( min, values->size, int ); +- values->y_pos = VIPS_ARRAY( min, values->size, int ); ++ values->value = VIPS_ARRAY(min, values->size, double); ++ values->x_pos = VIPS_ARRAY(min, values->size, int); ++ values->y_pos = VIPS_ARRAY(min, values->size, int); + } + + /* Add a value. Do nothing if the value is too large. + */ + static void +-vips_values_add( VipsValues *values, double v, int x, int y ) ++vips_values_add(VipsValues *values, double v, int x, int y) + { + int i, j; + + /* Find insertion point. + */ +- for( i = 0; i < values->n; i++ ) { +- if( v > values->value[i] ) ++ for (i = 0; i < values->n; i++) { ++ if (v > values->value[i]) + break; + +- if( v == values->value[i] ) { +- if( y < values->y_pos[i] ) ++ if (v == values->value[i]) { ++ if (y < values->y_pos[i]) + break; + +- if( y == values->y_pos[i] ) +- if( x <= values->x_pos[i] ) ++ if (y == values->y_pos[i]) ++ if (x <= values->x_pos[i]) + break; + } + } + +- /* Array full? ++ /* Array full? + */ +- if( values->n == values->size ) { +- if( i > 0 ) { ++ if (values->n == values->size) { ++ if (i > 0) { + /* We need to move stuff to the left to make space, + * shunting the largest out. + */ +- for( j = 0; j < i - 1; j++ ) { ++ for (j = 0; j < i - 1; j++) { + values->value[j] = values->value[j + 1]; + values->x_pos[j] = values->x_pos[j + 1]; + values->y_pos[j] = values->y_pos[j + 1]; +@@ -179,7 +179,7 @@ vips_values_add( VipsValues *values, double v, int x, int y ) + else { + /* Not full, move stuff to the right into empty space. + */ +- for( j = values->n; j > i; j-- ) { ++ for (j = values->n; j > i; j--) { + values->value[j] = values->value[j - 1]; + values->x_pos[j] = values->x_pos[j - 1]; + values->y_pos[j] = values->y_pos[j - 1]; +@@ -193,108 +193,108 @@ vips_values_add( VipsValues *values, double v, int x, int y ) + + typedef VipsStatisticClass VipsMinClass; + +-G_DEFINE_TYPE( VipsMin, vips_min, VIPS_TYPE_STATISTIC ); ++G_DEFINE_TYPE(VipsMin, vips_min, VIPS_TYPE_STATISTIC); + + static int +-vips_min_build( VipsObject *object ) ++vips_min_build(VipsObject *object) + { +- VipsStatistic *statistic = VIPS_STATISTIC( object ); ++ VipsStatistic *statistic = VIPS_STATISTIC(object); + VipsMin *min = (VipsMin *) object; + VipsValues *values = &min->values; + +- vips_values_init( values, min ); ++ vips_values_init(values, min); + +- if( VIPS_OBJECT_CLASS( vips_min_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_min_parent_class)->build(object)) ++ return (-1); + + /* For speed we accumulate min ** 2 for complex. + */ +- if( vips_band_format_iscomplex( +- vips_image_get_format( statistic->in ) ) ) { ++ if (vips_band_format_iscomplex( ++ vips_image_get_format(statistic->in))) { + int i; + +- for( i = 0; i < values->n; i++ ) +- values->value[i] = sqrt( values->value[i] ); ++ for (i = 0; i < values->n; i++) ++ values->value[i] = sqrt(values->value[i]); + } + + /* Don't set if there's no value (eg. if every pixel is NaN). This + * will trigger an error later. + */ +- if( values->n > 0 ) { ++ if (values->n > 0) { + VipsArrayDouble *out_array; + VipsArrayInt *x_array; + VipsArrayInt *y_array; + +- out_array = vips_array_double_new( values->value, values->n ); +- x_array = vips_array_int_new( values->x_pos, values->n ); +- y_array = vips_array_int_new( values->y_pos, values->n ); ++ out_array = vips_array_double_new(values->value, values->n); ++ x_array = vips_array_int_new(values->x_pos, values->n); ++ y_array = vips_array_int_new(values->y_pos, values->n); + + /* We have to set the props via g_object_set() to stop vips + * complaining they are unset. + */ +- g_object_set( min, ++ g_object_set(min, + "out", values->value[values->n - 1], + "x", values->x_pos[values->n - 1], + "y", values->y_pos[values->n - 1], + "out_array", out_array, + "x_array", x_array, + "y_array", y_array, +- NULL ); ++ NULL); + +- vips_area_unref( VIPS_AREA( out_array ) ); +- vips_area_unref( VIPS_AREA( x_array ) ); +- vips_area_unref( VIPS_AREA( y_array ) ); ++ vips_area_unref(VIPS_AREA(out_array)); ++ vips_area_unref(VIPS_AREA(x_array)); ++ vips_area_unref(VIPS_AREA(y_array)); + } + + #ifdef DEBUG +-{ +- int i; ++ { ++ int i; + +- printf( "vips_min_build: %d values found\n", values->n ); +- for( i = 0; i < values->n; i++ ) +- printf( "%d) %g\t%d\t%d\n", +- i, +- values->value[i], +- values->x_pos[i], values->y_pos[i] ); +-} ++ printf("vips_min_build: %d values found\n", values->n); ++ for (i = 0; i < values->n; i++) ++ printf("%d) %g\t%d\t%d\n", ++ i, ++ values->value[i], ++ values->x_pos[i], values->y_pos[i]); ++ } + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + /* New sequence value. Make a private VipsValues for this thread. + */ + static void * +-vips_min_start( VipsStatistic *statistic ) ++vips_min_start(VipsStatistic *statistic) + { + VipsValues *values; + +- values = g_new( VipsValues, 1 ); +- vips_values_init( values, (VipsMin *) statistic ); ++ values = g_new(VipsValues, 1); ++ vips_values_init(values, (VipsMin *) statistic); + +- return( (void *) values ); ++ return ((void *) values); + } + + /* Merge the sequence value back into the per-call state. + */ + static int +-vips_min_stop( VipsStatistic *statistic, void *seq ) ++vips_min_stop(VipsStatistic *statistic, void *seq) + { + VipsMin *min = (VipsMin *) statistic; + VipsValues *values = (VipsValues *) seq; + + int i; + +- for( i = 0; i < values->n; i++ ) +- vips_values_add( &min->values, +- values->value[i], values->x_pos[i], values->y_pos[i] ); ++ for (i = 0; i < values->n; i++) ++ vips_values_add(&min->values, ++ values->value[i], values->x_pos[i], values->y_pos[i]); + +- g_free( values ); ++ g_free(values); + +- return( 0 ); ++ return (0); + } + +-/* Real min with a lower bound. ++/* Real min with a lower bound. + * + * Add values to the buffer if they are less than the buffer maximum. If + * the buffer isn't full, there is no maximum. +@@ -304,189 +304,202 @@ vips_min_stop( VipsStatistic *statistic, void *seq ) + * + * Stop if our array fills with minval. + */ +-#define LOOPU( TYPE, LOWER ) { \ +- TYPE *p = (TYPE *) in; \ +- TYPE m; \ +- \ +- for( i = 0; i < sz && values->n < values->size; i++ ) \ +- vips_values_add( values, p[i], x + i / bands, y ); \ +- m = values->value[0]; \ +- \ +- for( ; i < sz; i++ ) { \ +- if( p[i] < m ) { \ +- vips_values_add( values, p[i], x + i / bands, y ); \ +- m = values->value[0]; \ +- \ +- if( m <= LOWER ) { \ +- statistic->stop = TRUE; \ +- break; \ ++#define LOOPU(TYPE, LOWER) \ ++ { \ ++ TYPE *p = (TYPE *) in; \ ++ TYPE m; \ ++\ ++ for (i = 0; i < sz && values->n < values->size; i++) \ ++ vips_values_add(values, p[i], x + i / bands, y); \ ++ m = values->value[0]; \ ++\ ++ for (; i < sz; i++) { \ ++ if (p[i] < m) { \ ++ vips_values_add(values, p[i], x + i / bands, y); \ ++ m = values->value[0]; \ ++\ ++ if (m <= LOWER) { \ ++ statistic->stop = TRUE; \ ++ break; \ ++ } \ + } \ + } \ +- } \ +-} ++ } + + /* float/double min ... no limits, and we have to avoid NaN. + * + * NaN compares false to every float value, so we don't need to test for NaN +- * in the second loop. ++ * in the second loop. + */ +-#define LOOPF( TYPE ) { \ +- TYPE *p = (TYPE *) in; \ +- TYPE m; \ +- \ +- for( i = 0; i < sz && values->n < values->size; i++ ) \ +- if( !VIPS_ISNAN( p[i] ) ) \ +- vips_values_add( values, p[i], x + i / bands, y ); \ +- m = values->value[0]; \ +- \ +- for( ; i < sz; i++ ) \ +- if( p[i] < m ) { \ +- vips_values_add( values, p[i], x + i / bands, y ); \ +- m = values->value[0]; \ +- } \ +-} ++#define LOOPF(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) in; \ ++ TYPE m; \ ++\ ++ for (i = 0; i < sz && values->n < values->size; i++) \ ++ if (!VIPS_ISNAN(p[i])) \ ++ vips_values_add(values, p[i], x + i / bands, y); \ ++ m = values->value[0]; \ ++\ ++ for (; i < sz; i++) \ ++ if (p[i] < m) { \ ++ vips_values_add(values, p[i], x + i / bands, y); \ ++ m = values->value[0]; \ ++ } \ ++ } + + /* As LOOPF, but complex. Track min(mod ** 2) to avoid sqrt(). + */ +-#define LOOPC( TYPE ) { \ +- TYPE *p = (TYPE *) in; \ +- TYPE m; \ +- \ +- for( i = 0; i < sz && values->n < values->size; i++ ) { \ +- TYPE mod2 = p[0] * p[0] + p[1] * p[1]; \ +- \ +- if( !VIPS_ISNAN( mod2 ) ) \ +- vips_values_add( values, p[i], x + i / bands, y ); \ +- \ +- p += 2; \ +- } \ +- m = values->value[0]; \ +- \ +- for( ; i < sz; i++ ) { \ +- TYPE mod2 = p[0] * p[0] + p[1] * p[1]; \ +- \ +- if( mod2 < m ) { \ +- vips_values_add( values, mod2, x + i / bands, y ); \ +- m = values->value[0]; \ ++#define LOOPC(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) in; \ ++ TYPE m; \ ++\ ++ for (i = 0; i < sz && values->n < values->size; i++) { \ ++ TYPE mod2 = p[0] * p[0] + p[1] * p[1]; \ ++\ ++ if (!VIPS_ISNAN(mod2)) \ ++ vips_values_add(values, p[i], x + i / bands, y); \ ++\ ++ p += 2; \ + } \ +- \ +- p += 2; \ +- } \ +-} ++ m = values->value[0]; \ ++\ ++ for (; i < sz; i++) { \ ++ TYPE mod2 = p[0] * p[0] + p[1] * p[1]; \ ++\ ++ if (mod2 < m) { \ ++ vips_values_add(values, mod2, x + i / bands, y); \ ++ m = values->value[0]; \ ++ } \ ++\ ++ p += 2; \ ++ } \ ++ } + + /* Loop over region, adding to seq. + */ + static int +-vips_min_scan( VipsStatistic *statistic, void *seq, +- int x, int y, void *in, int n ) ++vips_min_scan(VipsStatistic *statistic, void *seq, ++ int x, int y, void *in, int n) + { + VipsValues *values = (VipsValues *) seq; +- const int bands = vips_image_get_bands( statistic->in ); ++ const int bands = vips_image_get_bands(statistic->in); + const int sz = n * bands; + + int i; + +- switch( vips_image_get_format( statistic->in ) ) { +- case VIPS_FORMAT_UCHAR: +- LOOPU( unsigned char, 0 ); break; +- case VIPS_FORMAT_CHAR: +- LOOPU( signed char, SCHAR_MIN ); break; +- case VIPS_FORMAT_USHORT: +- LOOPU( unsigned short, 0 ); break; +- case VIPS_FORMAT_SHORT: +- LOOPU( signed short, SHRT_MIN ); break; +- case VIPS_FORMAT_UINT: +- LOOPU( unsigned int, 0 ); break; +- case VIPS_FORMAT_INT: +- LOOPU( signed int, INT_MIN ); break; +- +- case VIPS_FORMAT_FLOAT: +- LOOPF( float ); break; +- case VIPS_FORMAT_DOUBLE: +- LOOPF( double ); break; ++ switch (vips_image_get_format(statistic->in)) { ++ case VIPS_FORMAT_UCHAR: ++ LOOPU(unsigned char, 0); ++ break; ++ case VIPS_FORMAT_CHAR: ++ LOOPU(signed char, SCHAR_MIN); ++ break; ++ case VIPS_FORMAT_USHORT: ++ LOOPU(unsigned short, 0); ++ break; ++ case VIPS_FORMAT_SHORT: ++ LOOPU(signed short, SHRT_MIN); ++ break; ++ case VIPS_FORMAT_UINT: ++ LOOPU(unsigned int, 0); ++ break; ++ case VIPS_FORMAT_INT: ++ LOOPU(signed int, INT_MIN); ++ break; ++ ++ case VIPS_FORMAT_FLOAT: ++ LOOPF(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ LOOPF(double); ++ break; + + case VIPS_FORMAT_COMPLEX: +- LOOPC( float ); break; ++ LOOPC(float); ++ break; + case VIPS_FORMAT_DPCOMPLEX: +- LOOPC( double ); break; ++ LOOPC(double); ++ break; + +- default: ++ default: + g_assert_not_reached(); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_min_class_init( VipsMinClass *class ) ++vips_min_class_init(VipsMinClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS( class ); ++ VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "min"; +- object_class->description = _( "find image minimum" ); ++ object_class->description = _("find image minimum"); + object_class->build = vips_min_build; + + sclass->start = vips_min_start; + sclass->scan = vips_min_scan; + sclass->stop = vips_min_stop; + +- VIPS_ARG_DOUBLE( class, "out", 1, +- _( "Output" ), +- _( "Output value" ), ++ VIPS_ARG_DOUBLE(class, "out", 1, ++ _("Output"), ++ _("Output value"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsMin, min ), +- -INFINITY, INFINITY, 0.0 ); ++ G_STRUCT_OFFSET(VipsMin, min), ++ -INFINITY, INFINITY, 0.0); + +- VIPS_ARG_INT( class, "x", 2, +- _( "x" ), +- _( "Horizontal position of minimum" ), ++ VIPS_ARG_INT(class, "x", 2, ++ _("x"), ++ _("Horizontal position of minimum"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMin, x ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsMin, x), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "y", 3, +- _( "y" ), +- _( "Vertical position of minimum" ), ++ VIPS_ARG_INT(class, "y", 3, ++ _("y"), ++ _("Vertical position of minimum"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMin, y ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsMin, y), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "size", 4, +- _( "Size" ), +- _( "Number of minimum values to find" ), ++ VIPS_ARG_INT(class, "size", 4, ++ _("Size"), ++ _("Number of minimum values to find"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMin, size ), +- 1, 1000000, 10 ); ++ G_STRUCT_OFFSET(VipsMin, size), ++ 1, 1000000, 10); + +- VIPS_ARG_BOXED( class, "out_array", 6, +- _( "Output array" ), +- _( "Array of output values" ), ++ VIPS_ARG_BOXED(class, "out_array", 6, ++ _("Output array"), ++ _("Array of output values"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMin, min_array ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsMin, min_array), ++ VIPS_TYPE_ARRAY_DOUBLE); + +- VIPS_ARG_BOXED( class, "x_array", 7, +- _( "x array" ), +- _( "Array of horizontal positions" ), ++ VIPS_ARG_BOXED(class, "x_array", 7, ++ _("x array"), ++ _("Array of horizontal positions"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMin, x_array ), +- VIPS_TYPE_ARRAY_INT ); ++ G_STRUCT_OFFSET(VipsMin, x_array), ++ VIPS_TYPE_ARRAY_INT); + +- VIPS_ARG_BOXED( class, "y_array", 8, +- _( "y array" ), +- _( "Array of vertical positions" ), ++ VIPS_ARG_BOXED(class, "y_array", 8, ++ _("y array"), ++ _("Array of vertical positions"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMin, y_array ), +- VIPS_TYPE_ARRAY_INT ); ++ G_STRUCT_OFFSET(VipsMin, y_array), ++ VIPS_TYPE_ARRAY_INT); + } + + static void +-vips_min_init( VipsMin *min ) ++vips_min_init(VipsMin *min) + { + min->size = 1; + } +@@ -506,41 +519,41 @@ vips_min_init( VipsMin *min ) + * * @x_array: corresponding horizontal positions + * * @y_array: corresponding vertical positions + * +- * This operation finds the minimum value in an image. ++ * This operation finds the minimum value in an image. + * +- * By default it finds the single smallest value. If @size is set >1, it will +- * find the @size smallest values. It will stop searching early if has found +- * enough values. ++ * By default it finds the single smallest value. If @size is set >1, it will ++ * find the @size smallest values. It will stop searching early if has found ++ * enough values. + * Equal values will be sorted by y then x. + * +- * It operates on all +- * bands of the input image: use vips_stats() if you need to find an +- * minimum for each band. ++ * It operates on all ++ * bands of the input image: use vips_stats() if you need to find an ++ * minimum for each band. + * + * For complex images, this operation finds the minimum modulus. + * + * You can read out the position of the minimum with @x and @y. You can read + * out arrays of the values and positions of the top @size minima with + * @out_array, @x_array and @y_array. +- * These values are returned sorted from ++ * These values are returned sorted from + * smallest to largest. + * + * If there are more than @size minima, the minima returned will be a random +- * selection of the minima in the image. ++ * selection of the minima in the image. + * + * See also: vips_min(), vips_stats(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_min( VipsImage *in, double *out, ... ) ++vips_min(VipsImage *in, double *out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "min", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("min", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/multiply.c b/libvips/arithmetic/multiply.c +index f42d092884..90b92ea072 100644 +--- a/libvips/arithmetic/multiply.c ++++ b/libvips/arithmetic/multiply.c +@@ -4,7 +4,7 @@ + * + * Author: Nicos Dessipris + * Written on: 02/05/1990 +- * Modified on: ++ * Modified on: + * 29/4/93 JC + * - now works for partial images + * 1/7/93 JC +@@ -31,28 +31,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -76,70 +76,92 @@ + typedef VipsBinary VipsMultiply; + typedef VipsBinaryClass VipsMultiplyClass; + +-G_DEFINE_TYPE( VipsMultiply, vips_multiply, VIPS_TYPE_BINARY ); ++G_DEFINE_TYPE(VipsMultiply, vips_multiply, VIPS_TYPE_BINARY); + + /* Complex multiply. + */ +-#define CLOOP( TYPE ) { \ +- TYPE * restrict left = (TYPE *) in[0]; \ +- TYPE * restrict right = (TYPE *) in[1]; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- double x1 = left[0]; \ +- double y1 = left[1]; \ +- double x2 = right[0]; \ +- double y2 = right[1]; \ +- \ +- left += 2; \ +- right += 2; \ +- \ +- q[0] = x1 * x2 - y1 * y2; \ +- q[1] = x1 * y2 + x2 * y1; \ +- \ +- q += 2; \ +- } \ +-} ++#define CLOOP(TYPE) \ ++ { \ ++ TYPE *restrict left = (TYPE *) in[0]; \ ++ TYPE *restrict right = (TYPE *) in[1]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ double x1 = left[0]; \ ++ double y1 = left[1]; \ ++ double x2 = right[0]; \ ++ double y2 = right[1]; \ ++\ ++ left += 2; \ ++ right += 2; \ ++\ ++ q[0] = x1 * x2 - y1 * y2; \ ++ q[1] = x1 * y2 + x2 * y1; \ ++\ ++ q += 2; \ ++ } \ ++ } + + /* Real multiply. + */ +-#define RLOOP( IN, OUT ) { \ +- IN * restrict left = (IN *) in[0]; \ +- IN * restrict right = (IN *) in[1]; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = left[x] * right[x]; \ +-} ++#define RLOOP(IN, OUT) \ ++ { \ ++ IN *restrict left = (IN *) in[0]; \ ++ IN *restrict right = (IN *) in[1]; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = left[x] * right[x]; \ ++ } + + static void +-vips_multiply_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_multiply_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsImage *im = arithmetic->ready[0]; +- const int sz = width * vips_image_get_bands( im ); ++ const int sz = width * vips_image_get_bands(im); + + int x; + +- /* Keep types here in sync with vips_bandfmt_multiply[] ++ /* Keep types here in sync with vips_bandfmt_multiply[] + * below. +- */ +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_CHAR: RLOOP( signed char, signed short ); break; +- case VIPS_FORMAT_UCHAR: RLOOP( unsigned char, signed short ); break; +- case VIPS_FORMAT_SHORT: RLOOP( signed short, signed int ); break; +- case VIPS_FORMAT_USHORT:RLOOP( unsigned short, signed int ); break; +- case VIPS_FORMAT_INT: RLOOP( signed int, signed int ); break; +- case VIPS_FORMAT_UINT: RLOOP( unsigned int, signed int ); break; +- case VIPS_FORMAT_FLOAT: RLOOP( float, float ); break; +- case VIPS_FORMAT_DOUBLE: RLOOP( double, double ); break; +- +- case VIPS_FORMAT_COMPLEX: CLOOP( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: CLOOP( double ); break; +- +- default: ++ */ ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_CHAR: ++ RLOOP(signed char, signed short); ++ break; ++ case VIPS_FORMAT_UCHAR: ++ RLOOP(unsigned char, signed short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ RLOOP(signed short, signed int); ++ break; ++ case VIPS_FORMAT_USHORT: ++ RLOOP(unsigned short, signed int); ++ break; ++ case VIPS_FORMAT_INT: ++ RLOOP(signed int, signed int); ++ break; ++ case VIPS_FORMAT_UINT: ++ RLOOP(unsigned int, signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ RLOOP(float, float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ RLOOP(double, double); ++ break; ++ ++ case VIPS_FORMAT_COMPLEX: ++ CLOOP(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ CLOOP(double); ++ break; ++ ++ default: + g_assert_not_reached(); +- } ++ } + } + + /* Save a bit of typing. +@@ -155,7 +177,7 @@ vips_multiply_buffer( VipsArithmetic *arithmetic, + #define D VIPS_FORMAT_DOUBLE + #define DX VIPS_FORMAT_DPCOMPLEX + +-/* Type promotion for multiplication. Sign and value preserving. Make sure ++/* Type promotion for multiplication. Sign and value preserving. Make sure + * these match the case statement in multiply_buffer() above. + */ + static const VipsBandFormat vips_multiply_format_table[10] = { +@@ -164,21 +186,21 @@ static const VipsBandFormat vips_multiply_format_table[10] = { + }; + + static void +-vips_multiply_class_init( VipsMultiplyClass *class ) ++vips_multiply_class_init(VipsMultiplyClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + object_class->nickname = "multiply"; +- object_class->description = _( "multiply two images" ); ++ object_class->description = _("multiply two images"); + + aclass->process_line = vips_multiply_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_multiply_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_multiply_format_table); + } + + static void +-vips_multiply_init( VipsMultiply *multiply ) ++vips_multiply_init(VipsMultiply *multiply) + { + } + +@@ -189,19 +211,19 @@ vips_multiply_init( VipsMultiply *multiply ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * This operation calculates @left * @right and writes the result to @out. ++ * This operation calculates @left * @right and writes the result to @out. + * + * If the images differ in size, the smaller image is enlarged to match the + * larger by adding zero pixels along the bottom and right. + * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +- * The two input images are cast up to the smallest common format (see table +- * Smallest common format in +- * arithmetic), then the ++ * The two input images are cast up to the smallest common format (see table ++ * Smallest common format in ++ * arithmetic), then the + * following table is used to determine the output type: + * + *
+@@ -266,14 +288,14 @@ vips_multiply_init( VipsMultiply *multiply ) + * Returns: 0 on success, -1 on error + */ + int +-vips_multiply( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_multiply(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "multiply", ap, left, right, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("multiply", ap, left, right, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/nary.c b/libvips/arithmetic/nary.c +index 36e7f3c72b..eaef39396e 100644 +--- a/libvips/arithmetic/nary.c ++++ b/libvips/arithmetic/nary.c +@@ -6,28 +6,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -48,52 +48,51 @@ + + #include "nary.h" + +-G_DEFINE_ABSTRACT_TYPE( VipsNary, vips_nary, VIPS_TYPE_ARITHMETIC ); ++G_DEFINE_ABSTRACT_TYPE(VipsNary, vips_nary, VIPS_TYPE_ARITHMETIC); + + static int +-vips_nary_build( VipsObject *object ) ++vips_nary_build(VipsObject *object) + { +- VipsArithmetic *arithmetic = VIPS_ARITHMETIC( object ); +- VipsNary *nary = VIPS_NARY( object ); ++ VipsArithmetic *arithmetic = VIPS_ARITHMETIC(object); ++ VipsNary *nary = VIPS_NARY(object); + +- if( nary->in ) { ++ if (nary->in) { + arithmetic->in = nary->in->data; + arithmetic->n = nary->in->n; + } + +- if( VIPS_OBJECT_CLASS( vips_nary_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_nary_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_nary_class_init( VipsNaryClass *class ) ++vips_nary_class_init(VipsNaryClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "nary"; +- vobject_class->description = _( "nary operations" ); ++ vobject_class->description = _("nary operations"); + vobject_class->build = vips_nary_build; + + /* Create properties. + */ + +- VIPS_ARG_BOXED( class, "in", 0, +- _( "Input" ), +- _( "Array of input images" ), ++ VIPS_ARG_BOXED(class, "in", 0, ++ _("Input"), ++ _("Array of input images"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsNary, in ), +- VIPS_TYPE_ARRAY_IMAGE ); +- ++ G_STRUCT_OFFSET(VipsNary, in), ++ VIPS_TYPE_ARRAY_IMAGE); + } + + static void +-vips_nary_init( VipsNary *nary ) ++vips_nary_init(VipsNary *nary) + { + /* Init our instance fields. + */ +diff --git a/libvips/arithmetic/nary.h b/libvips/arithmetic/nary.h +index abc96bfc02..af6ebd3014 100644 +--- a/libvips/arithmetic/nary.h ++++ b/libvips/arithmetic/nary.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -40,16 +40,16 @@ extern "C" { + #include "parithmetic.h" + + #define VIPS_TYPE_NARY (vips_nary_get_type()) +-#define VIPS_NARY( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), VIPS_TYPE_NARY, VipsNary )) +-#define VIPS_NARY_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), VIPS_TYPE_NARY, VipsNaryClass)) +-#define VIPS_IS_NARY( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_NARY )) +-#define VIPS_IS_NARY_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_NARY )) +-#define VIPS_NARY_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), VIPS_TYPE_NARY, VipsNaryClass )) ++#define VIPS_NARY(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), VIPS_TYPE_NARY, VipsNary)) ++#define VIPS_NARY_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), VIPS_TYPE_NARY, VipsNaryClass)) ++#define VIPS_IS_NARY(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_NARY)) ++#define VIPS_IS_NARY_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_NARY)) ++#define VIPS_NARY_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), VIPS_TYPE_NARY, VipsNaryClass)) + + typedef struct _VipsNary { + VipsArithmetic parent_instance; +@@ -62,12 +62,10 @@ typedef struct _VipsNary { + + typedef VipsArithmeticClass VipsNaryClass; + +-GType vips_nary_get_type( void ); ++GType vips_nary_get_type(void); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_NARY_H*/ +- +- +diff --git a/libvips/arithmetic/parithmetic.h b/libvips/arithmetic/parithmetic.h +index ca438241ab..516f904940 100644 +--- a/libvips/arithmetic/parithmetic.h ++++ b/libvips/arithmetic/parithmetic.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -39,23 +39,23 @@ extern "C" { + #include + + #define VIPS_TYPE_ARITHMETIC (vips_arithmetic_get_type()) +-#define VIPS_ARITHMETIC( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_ARITHMETIC, VipsArithmetic )) +-#define VIPS_ARITHMETIC_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_ARITHMETIC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_ARITHMETIC, VipsArithmetic)) ++#define VIPS_ARITHMETIC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_ARITHMETIC, VipsArithmeticClass)) ++#define VIPS_IS_ARITHMETIC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_ARITHMETIC)) ++#define VIPS_IS_ARITHMETIC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_ARITHMETIC)) ++#define VIPS_ARITHMETIC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_ARITHMETIC, VipsArithmeticClass)) +-#define VIPS_IS_ARITHMETIC( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_ARITHMETIC )) +-#define VIPS_IS_ARITHMETIC_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_ARITHMETIC )) +-#define VIPS_ARITHMETIC_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_ARITHMETIC, VipsArithmeticClass )) + + struct _VipsArithmetic; +-typedef void (*VipsArithmeticProcessFn)( struct _VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ); ++typedef void (*VipsArithmeticProcessFn)(struct _VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width); + + typedef struct _VipsArithmetic { + VipsOperation parent_instance; +@@ -104,21 +104,19 @@ typedef struct _VipsArithmeticClass { + VipsArithmeticProcessFn process_line; + } VipsArithmeticClass; + +-GType vips_arithmetic_get_type( void ); ++GType vips_arithmetic_get_type(void); + +-void vips_arithmetic_set_format_table( VipsArithmeticClass *klass, +- const VipsBandFormat *format_table ); +-void vips_arithmetic_set_vector( VipsArithmeticClass *klass ); +-VipsVector *vips_arithmetic_get_vector( VipsArithmeticClass *klass, +- VipsBandFormat fmt ); +-void vips_arithmetic_compile( VipsArithmeticClass *klass ); +-VipsVector *vips_arithmetic_get_program( VipsArithmeticClass *klass, +- VipsBandFormat fmt ); ++void vips_arithmetic_set_format_table(VipsArithmeticClass *klass, ++ const VipsBandFormat *format_table); ++void vips_arithmetic_set_vector(VipsArithmeticClass *klass); ++VipsVector *vips_arithmetic_get_vector(VipsArithmeticClass *klass, ++ VipsBandFormat fmt); ++void vips_arithmetic_compile(VipsArithmeticClass *klass); ++VipsVector *vips_arithmetic_get_program(VipsArithmeticClass *klass, ++ VipsBandFormat fmt); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_PARITHMETIC_H*/ +- +- +diff --git a/libvips/arithmetic/profile.c b/libvips/arithmetic/profile.c +index 0c3105a51b..47d321c9fe 100644 +--- a/libvips/arithmetic/profile.c ++++ b/libvips/arithmetic/profile.c +@@ -1,4 +1,4 @@ +-/* find image profiles ++/* find image profiles + * + * 11/8/99 JC + * - from im_cntlines() +@@ -16,28 +16,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -76,242 +76,242 @@ typedef struct _VipsProfile { + + /* Write profiles here. + */ +- VipsImage *columns; +- VipsImage *rows; ++ VipsImage *columns; ++ VipsImage *rows; + + } VipsProfile; + + typedef VipsStatisticClass VipsProfileClass; + +-G_DEFINE_TYPE( VipsProfile, vips_profile, VIPS_TYPE_STATISTIC ); ++G_DEFINE_TYPE(VipsProfile, vips_profile, VIPS_TYPE_STATISTIC); + + static Edges * +-edges_new( VipsProfile *profile ) ++edges_new(VipsProfile *profile) + { +- VipsStatistic *statistic = VIPS_STATISTIC( profile ); +- VipsImage *in = statistic->ready; ++ VipsStatistic *statistic = VIPS_STATISTIC(profile); ++ VipsImage *in = statistic->ready; + + Edges *edges; +- int i; +- +- if( !(edges = VIPS_NEW( profile, Edges )) ) +- return( NULL ); +- edges->column_edges = VIPS_ARRAY( profile, in->Xsize * in->Bands, int ); +- edges->row_edges = VIPS_ARRAY( profile, in->Ysize * in->Bands, int ); +- if( !edges->column_edges || +- !edges->row_edges ) +- return( NULL ); +- +- for( i = 0; i < in->Xsize * in->Bands; i++ ) +- edges->column_edges[i] = in->Ysize; +- for( i = 0; i < in->Ysize * in->Bands; i++ ) +- edges->row_edges[i] = in->Xsize; +- +- return( edges ); ++ int i; ++ ++ if (!(edges = VIPS_NEW(profile, Edges))) ++ return (NULL); ++ edges->column_edges = VIPS_ARRAY(profile, in->Xsize * in->Bands, int); ++ edges->row_edges = VIPS_ARRAY(profile, in->Ysize * in->Bands, int); ++ if (!edges->column_edges || ++ !edges->row_edges) ++ return (NULL); ++ ++ for (i = 0; i < in->Xsize * in->Bands; i++) ++ edges->column_edges[i] = in->Ysize; ++ for (i = 0; i < in->Ysize * in->Bands; i++) ++ edges->row_edges[i] = in->Xsize; ++ ++ return (edges); + } + + static int +-vips_profile_build( VipsObject *object ) ++vips_profile_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsStatistic *statistic = VIPS_STATISTIC( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsStatistic *statistic = VIPS_STATISTIC(object); + VipsProfile *profile = (VipsProfile *) object; + + int y; + +- if( statistic->in && +- vips_check_noncomplex( class->nickname, statistic->in ) ) +- return( -1 ); ++ if (statistic->in && ++ vips_check_noncomplex(class->nickname, statistic->in)) ++ return (-1); + +- g_object_set( object, ++ g_object_set(object, + "columns", vips_image_new(), + "rows", vips_image_new(), +- NULL ); ++ NULL); + + /* main edge set made on first thread start. + */ + +- if( VIPS_OBJECT_CLASS( vips_profile_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_profile_parent_class)->build(object)) ++ return (-1); + + /* Make the output image. + */ +- if( vips_image_pipelinev( profile->columns, +- VIPS_DEMAND_STYLE_ANY, statistic->ready, NULL ) || +- vips_image_pipelinev( profile->rows, +- VIPS_DEMAND_STYLE_ANY, statistic->ready, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(profile->columns, ++ VIPS_DEMAND_STYLE_ANY, statistic->ready, NULL) || ++ vips_image_pipelinev(profile->rows, ++ VIPS_DEMAND_STYLE_ANY, statistic->ready, NULL)) ++ return (-1); + profile->columns->Ysize = 1; +- profile->columns->BandFmt = VIPS_FORMAT_INT; ++ profile->columns->BandFmt = VIPS_FORMAT_INT; + profile->columns->Type = VIPS_INTERPRETATION_HISTOGRAM; + profile->rows->Xsize = 1; +- profile->rows->BandFmt = VIPS_FORMAT_INT; ++ profile->rows->BandFmt = VIPS_FORMAT_INT; + profile->rows->Type = VIPS_INTERPRETATION_HISTOGRAM; + +- if( vips_image_write_line( profile->columns, 0, +- (VipsPel *) profile->edges->column_edges ) ) +- return( -1 ); +- for( y = 0; y < profile->rows->Ysize; y++ ) +- if( vips_image_write_line( profile->rows, y, +- (VipsPel *) profile->edges->row_edges + +- y * VIPS_IMAGE_SIZEOF_PEL( profile->rows ) ) ) +- return( -1 ); ++ if (vips_image_write_line(profile->columns, 0, ++ (VipsPel *) profile->edges->column_edges)) ++ return (-1); ++ for (y = 0; y < profile->rows->Ysize; y++) ++ if (vips_image_write_line(profile->rows, y, ++ (VipsPel *) profile->edges->row_edges + ++ y * VIPS_IMAGE_SIZEOF_PEL(profile->rows))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-/* New edge accumulator. ++/* New edge accumulator. + */ + static void * +-vips_profile_start( VipsStatistic *statistic ) ++vips_profile_start(VipsStatistic *statistic) + { + VipsProfile *profile = (VipsProfile *) statistic; + + /* Make the main hist, if necessary. + */ +- if( !profile->edges ) +- profile->edges = edges_new( profile ); ++ if (!profile->edges) ++ profile->edges = edges_new(profile); + +- return( (void *) edges_new( profile ) ); ++ return ((void *) edges_new(profile)); + } + + /* We do this a lot. + */ +-#define MINBANG( V, C ) ((V) = VIPS_MIN( V, C )) ++#define MINBANG(V, C) ((V) = VIPS_MIN(V, C)) + + /* Add a line of pixels. + */ +-#define ADD_PIXELS( TYPE ) { \ +- TYPE *p; \ +- int *column_edges; \ +- int *row_edges; \ +- \ +- p = (TYPE *) in; \ +- column_edges = edges->column_edges + x * nb; \ +- row_edges = edges->row_edges + y * nb; \ +- for( i = 0; i < n; i++ ) { \ +- for( j = 0; j < nb; j++ ) { \ +- if( p[j] ) { \ +- MINBANG( column_edges[j], y ); \ +- MINBANG( row_edges[j], x + i ); \ ++#define ADD_PIXELS(TYPE) \ ++ { \ ++ TYPE *p; \ ++ int *column_edges; \ ++ int *row_edges; \ ++\ ++ p = (TYPE *) in; \ ++ column_edges = edges->column_edges + x * nb; \ ++ row_edges = edges->row_edges + y * nb; \ ++ for (i = 0; i < n; i++) { \ ++ for (j = 0; j < nb; j++) { \ ++ if (p[j]) { \ ++ MINBANG(column_edges[j], y); \ ++ MINBANG(row_edges[j], x + i); \ ++ } \ + } \ ++\ ++ p += nb; \ ++ column_edges += nb; \ + } \ +- \ +- p += nb; \ +- column_edges += nb; \ +- } \ +-} ++ } + + /* Add a region to a profile. + */ + static int +-vips_profile_scan( VipsStatistic *statistic, void *seq, +- int x, int y, void *in, int n ) ++vips_profile_scan(VipsStatistic *statistic, void *seq, ++ int x, int y, void *in, int n) + { + int nb = statistic->ready->Bands; + Edges *edges = (Edges *) seq; + int i, j; + +- switch( statistic->ready->BandFmt ) { ++ switch (statistic->ready->BandFmt) { + case VIPS_FORMAT_UCHAR: +- ADD_PIXELS( guchar ); ++ ADD_PIXELS(guchar); + break; + + case VIPS_FORMAT_CHAR: +- ADD_PIXELS( char ); ++ ADD_PIXELS(char); + break; + + case VIPS_FORMAT_USHORT: +- ADD_PIXELS( gushort ); ++ ADD_PIXELS(gushort); + break; + + case VIPS_FORMAT_SHORT: +- ADD_PIXELS( short ); ++ ADD_PIXELS(short); + break; + + case VIPS_FORMAT_UINT: +- ADD_PIXELS( guint ); ++ ADD_PIXELS(guint); + break; + + case VIPS_FORMAT_INT: +- ADD_PIXELS( int ); ++ ADD_PIXELS(int); + break; + + case VIPS_FORMAT_FLOAT: +- ADD_PIXELS( float ); ++ ADD_PIXELS(float); + break; + + case VIPS_FORMAT_DOUBLE: +- ADD_PIXELS( double ); ++ ADD_PIXELS(double); + break; + + default: + g_assert_not_reached(); + } + +- return( 0 ); ++ return (0); + } + + /* Join a sub-profile onto the main profile. + */ + static int +-vips_profile_stop( VipsStatistic *statistic, void *seq ) ++vips_profile_stop(VipsStatistic *statistic, void *seq) + { + VipsProfile *profile = (VipsProfile *) statistic; +- Edges *edges = profile->edges; ++ Edges *edges = profile->edges; + Edges *sub_edges = (Edges *) seq; + VipsImage *in = statistic->ready; + +- int i; ++ int i; + +- for( i = 0; i < in->Xsize * in->Bands; i++ ) +- MINBANG( edges->column_edges[i], sub_edges->column_edges[i] ); ++ for (i = 0; i < in->Xsize * in->Bands; i++) ++ MINBANG(edges->column_edges[i], sub_edges->column_edges[i]); + +- for( i = 0; i < in->Ysize * in->Bands; i++ ) +- MINBANG( edges->row_edges[i], sub_edges->row_edges[i] ); ++ for (i = 0; i < in->Ysize * in->Bands; i++) ++ MINBANG(edges->row_edges[i], sub_edges->row_edges[i]); + + /* Blank out sub-profile to make sure we can't add it again. + */ +- sub_edges->row_edges = NULL; +- sub_edges->column_edges = NULL; ++ sub_edges->row_edges = NULL; ++ sub_edges->column_edges = NULL; + +- return( 0 ); ++ return (0); + } + + static void +-vips_profile_class_init( VipsProfileClass *class ) ++vips_profile_class_init(VipsProfileClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS( class ); ++ VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "profile"; +- object_class->description = _( "find image profiles" ); ++ object_class->description = _("find image profiles"); + object_class->build = vips_profile_build; + + sclass->start = vips_profile_start; + sclass->scan = vips_profile_scan; + sclass->stop = vips_profile_stop; + +- VIPS_ARG_IMAGE( class, "columns", 100, +- _( "Columns" ), +- _( "First non-zero pixel in column" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsProfile, columns ) ); +- +- VIPS_ARG_IMAGE( class, "rows", 101, +- _( "Rows" ), +- _( "First non-zero pixel in row" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsProfile, rows ) ); +- ++ VIPS_ARG_IMAGE(class, "columns", 100, ++ _("Columns"), ++ _("First non-zero pixel in column"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsProfile, columns)); ++ ++ VIPS_ARG_IMAGE(class, "rows", 101, ++ _("Rows"), ++ _("First non-zero pixel in row"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsProfile, rows)); + } + + static void +-vips_profile_init( VipsProfile *profile ) ++vips_profile_init(VipsProfile *profile) + { + } + +@@ -322,9 +322,9 @@ vips_profile_init( VipsProfile *profile ) + * @rows: (out): distances from left edge + * @...: %NULL-terminated list of optional named arguments + * +- * vips_profile() searches inward from the edge of @in and finds the +- * first non-zero pixel. Pixels in @columns have the distance from the top edge +- * to the first non-zero pixel in that column, @rows has the distance from the ++ * vips_profile() searches inward from the edge of @in and finds the ++ * first non-zero pixel. Pixels in @columns have the distance from the top edge ++ * to the first non-zero pixel in that column, @rows has the distance from the + * left edge to the first non-zero pixel in that row. + * + * See also: vips_project(), vips_hist_find(). +@@ -332,15 +332,14 @@ vips_profile_init( VipsProfile *profile ) + * Returns: 0 on success, -1 on error + */ + int +-vips_profile( VipsImage *in, VipsImage **columns, VipsImage **rows, ... ) ++vips_profile(VipsImage *in, VipsImage **columns, VipsImage **rows, ...) + { + va_list ap; + int result; + +- va_start( ap, rows ); +- result = vips_call_split( "profile", ap, in, columns, rows ); +- va_end( ap ); ++ va_start(ap, rows); ++ result = vips_call_split("profile", ap, in, columns, rows); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/arithmetic/project.c b/libvips/arithmetic/project.c +index 1330cd933e..87e50c3763 100644 +--- a/libvips/arithmetic/project.c ++++ b/libvips/arithmetic/project.c +@@ -11,28 +11,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -70,14 +70,14 @@ typedef struct _VipsProject { + + /* Write sums here. + */ +- VipsImage *columns; +- VipsImage *rows; ++ VipsImage *columns; ++ VipsImage *rows; + + } VipsProject; + + typedef VipsStatisticClass VipsProjectClass; + +-G_DEFINE_TYPE( VipsProject, vips_project, VIPS_TYPE_STATISTIC ); ++G_DEFINE_TYPE(VipsProject, vips_project, VIPS_TYPE_STATISTIC); + + /* Save a bit of typing. + */ +@@ -92,183 +92,185 @@ static const VipsBandFormat vips_project_format_table[10] = { + }; + + static Histogram * +-histogram_new( VipsProject *project ) ++histogram_new(VipsProject *project) + { +- VipsStatistic *statistic = VIPS_STATISTIC( project ); +- VipsImage *in = statistic->ready; ++ VipsStatistic *statistic = VIPS_STATISTIC(project); ++ VipsImage *in = statistic->ready; + VipsBandFormat outfmt = vips_project_format_table[in->BandFmt]; +- int psize = vips_format_sizeof( outfmt ) * in->Bands; ++ int psize = vips_format_sizeof(outfmt) * in->Bands; + + Histogram *hist; + +- if( !(hist = VIPS_NEW( project, Histogram )) ) +- return( NULL ); +- hist->column_sums = VIPS_ARRAY( project, psize * in->Xsize, guchar ); +- hist->row_sums = VIPS_ARRAY( project, psize * in->Ysize, guchar ); +- if( !hist->column_sums || +- !hist->row_sums ) +- return( NULL ); ++ if (!(hist = VIPS_NEW(project, Histogram))) ++ return (NULL); ++ hist->column_sums = VIPS_ARRAY(project, psize * in->Xsize, guchar); ++ hist->row_sums = VIPS_ARRAY(project, psize * in->Ysize, guchar); ++ if (!hist->column_sums || ++ !hist->row_sums) ++ return (NULL); + +- memset( hist->column_sums, 0, psize * in->Xsize ); +- memset( hist->row_sums, 0, psize * in->Ysize ); ++ memset(hist->column_sums, 0, psize * in->Xsize); ++ memset(hist->row_sums, 0, psize * in->Ysize); + +- return( hist ); ++ return (hist); + } + + static int +-vips_project_build( VipsObject *object ) ++vips_project_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsStatistic *statistic = VIPS_STATISTIC( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsStatistic *statistic = VIPS_STATISTIC(object); + VipsProject *project = (VipsProject *) object; + + int y; + +- if( statistic->in && +- vips_check_noncomplex( class->nickname, statistic->in ) ) +- return( -1 ); ++ if (statistic->in && ++ vips_check_noncomplex(class->nickname, statistic->in)) ++ return (-1); + +- g_object_set( object, ++ g_object_set(object, + "columns", vips_image_new(), + "rows", vips_image_new(), +- NULL ); ++ NULL); + + /* main hist made on first thread start. + */ + +- if( VIPS_OBJECT_CLASS( vips_project_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_project_parent_class)->build(object)) ++ return (-1); + + /* Make the output image. + */ +- if( vips_image_pipelinev( project->columns, +- VIPS_DEMAND_STYLE_ANY, statistic->ready, NULL ) || +- vips_image_pipelinev( project->rows, +- VIPS_DEMAND_STYLE_ANY, statistic->ready, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(project->columns, ++ VIPS_DEMAND_STYLE_ANY, statistic->ready, NULL) || ++ vips_image_pipelinev(project->rows, ++ VIPS_DEMAND_STYLE_ANY, statistic->ready, NULL)) ++ return (-1); + project->columns->Ysize = 1; +- project->columns->BandFmt = ++ project->columns->BandFmt = + vips_project_format_table[statistic->ready->BandFmt]; + project->columns->Type = VIPS_INTERPRETATION_HISTOGRAM; + project->rows->Xsize = 1; +- project->rows->BandFmt = ++ project->rows->BandFmt = + vips_project_format_table[statistic->ready->BandFmt]; + project->rows->Type = VIPS_INTERPRETATION_HISTOGRAM; + +- if( vips_image_write_line( project->columns, 0, +- (VipsPel *) project->hist->column_sums ) ) +- return( -1 ); +- for( y = 0; y < project->rows->Ysize; y++ ) +- if( vips_image_write_line( project->rows, y, +- (VipsPel *) project->hist->row_sums + +- y * VIPS_IMAGE_SIZEOF_PEL( project->rows ) ) ) +- return( -1 ); ++ if (vips_image_write_line(project->columns, 0, ++ (VipsPel *) project->hist->column_sums)) ++ return (-1); ++ for (y = 0; y < project->rows->Ysize; y++) ++ if (vips_image_write_line(project->rows, y, ++ (VipsPel *) project->hist->row_sums + ++ y * VIPS_IMAGE_SIZEOF_PEL(project->rows))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Build a sub-hist, based on the main hist. + */ + static void * +-vips_project_start( VipsStatistic *statistic ) ++vips_project_start(VipsStatistic *statistic) + { + VipsProject *project = (VipsProject *) statistic; + + /* Make the main hist, if necessary. + */ +- if( !project->hist ) +- project->hist = histogram_new( project ); ++ if (!project->hist) ++ project->hist = histogram_new(project); + +- return( (void *) histogram_new( project ) ); ++ return ((void *) histogram_new(project)); + } + + /* Add a line of pixels. + */ +-#define ADD_PIXELS( OUT, IN ) { \ +- OUT *row_sums = ((OUT *) hist->row_sums) + y * nb; \ +- OUT *column_sums; \ +- IN *p; \ +- \ +- column_sums = ((OUT *) hist->column_sums) + x * nb; \ +- p = (IN *) in; \ +- for( i = 0; i < n; i++ ) { \ +- for( j = 0; j < nb; j++ ) { \ +- column_sums[j] += p[j]; \ +- row_sums[j] += p[j]; \ ++#define ADD_PIXELS(OUT, IN) \ ++ { \ ++ OUT *row_sums = ((OUT *) hist->row_sums) + y * nb; \ ++ OUT *column_sums; \ ++ IN *p; \ ++\ ++ column_sums = ((OUT *) hist->column_sums) + x * nb; \ ++ p = (IN *) in; \ ++ for (i = 0; i < n; i++) { \ ++ for (j = 0; j < nb; j++) { \ ++ column_sums[j] += p[j]; \ ++ row_sums[j] += p[j]; \ ++ } \ ++\ ++ p += nb; \ ++ column_sums += nb; \ + } \ +- \ +- p += nb; \ +- column_sums += nb; \ +- } \ +-} ++ } + + /* Add a region to a project. + */ + static int +-vips_project_scan( VipsStatistic *statistic, void *seq, +- int x, int y, void *in, int n ) ++vips_project_scan(VipsStatistic *statistic, void *seq, ++ int x, int y, void *in, int n) + { + int nb = statistic->ready->Bands; + Histogram *hist = (Histogram *) seq; + int i, j; + +- switch( statistic->ready->BandFmt ) { ++ switch (statistic->ready->BandFmt) { + case VIPS_FORMAT_UCHAR: +- ADD_PIXELS( guint, guchar ); ++ ADD_PIXELS(guint, guchar); + break; + + case VIPS_FORMAT_CHAR: +- ADD_PIXELS( int, char ); ++ ADD_PIXELS(int, char); + break; + + case VIPS_FORMAT_USHORT: +- ADD_PIXELS( guint, gushort ); ++ ADD_PIXELS(guint, gushort); + break; + + case VIPS_FORMAT_SHORT: +- ADD_PIXELS( int, short ); ++ ADD_PIXELS(int, short); + break; + + case VIPS_FORMAT_UINT: +- ADD_PIXELS( guint, guint ); ++ ADD_PIXELS(guint, guint); + break; + + case VIPS_FORMAT_INT: +- ADD_PIXELS( int, int ); ++ ADD_PIXELS(int, int); + break; + + case VIPS_FORMAT_FLOAT: +- ADD_PIXELS( double, float ); ++ ADD_PIXELS(double, float); + break; + + case VIPS_FORMAT_DOUBLE: +- ADD_PIXELS( double, double ); ++ ADD_PIXELS(double, double); + break; + + default: + g_assert_not_reached(); + } + +- return( 0 ); ++ return (0); + } + +-#define ADD_BUFFER( TYPE, Q, P, N ) { \ +- TYPE *p = (TYPE *) (P); \ +- TYPE *q = (TYPE *) (Q); \ +- int n = (N); \ +- int i; \ +- \ +- for( i = 0; i < n; i++ ) \ +- q[i] += p[i]; \ +-} ++#define ADD_BUFFER(TYPE, Q, P, N) \ ++ { \ ++ TYPE *p = (TYPE *) (P); \ ++ TYPE *q = (TYPE *) (Q); \ ++ int n = (N); \ ++ int i; \ ++\ ++ for (i = 0; i < n; i++) \ ++ q[i] += p[i]; \ ++ } + + /* Join a sub-project onto the main project. + */ + static int +-vips_project_stop( VipsStatistic *statistic, void *seq ) ++vips_project_stop(VipsStatistic *statistic, void *seq) + { + VipsProject *project = (VipsProject *) statistic; +- Histogram *hist = project->hist; ++ Histogram *hist = project->hist; + Histogram *sub_hist = (Histogram *) seq; + VipsImage *in = statistic->ready; + VipsBandFormat outfmt = vips_project_format_table[in->BandFmt]; +@@ -277,23 +279,23 @@ vips_project_stop( VipsStatistic *statistic, void *seq ) + + /* Add on sub-data. + */ +- switch( outfmt ) { ++ switch (outfmt) { + case VIPS_FORMAT_UINT: +- ADD_BUFFER( guint, +- hist->column_sums, sub_hist->column_sums, hsz ); +- ADD_BUFFER( guint, hist->row_sums, sub_hist->row_sums, vsz ); ++ ADD_BUFFER(guint, ++ hist->column_sums, sub_hist->column_sums, hsz); ++ ADD_BUFFER(guint, hist->row_sums, sub_hist->row_sums, vsz); + break; + + case VIPS_FORMAT_INT: +- ADD_BUFFER( int, +- hist->column_sums, sub_hist->column_sums, hsz ); +- ADD_BUFFER( int, hist->row_sums, sub_hist->row_sums, vsz ); ++ ADD_BUFFER(int, ++ hist->column_sums, sub_hist->column_sums, hsz); ++ ADD_BUFFER(int, hist->row_sums, sub_hist->row_sums, vsz); + break; + + case VIPS_FORMAT_DOUBLE: +- ADD_BUFFER( double, +- hist->column_sums, sub_hist->column_sums, hsz ); +- ADD_BUFFER( double, hist->row_sums, sub_hist->row_sums, vsz ); ++ ADD_BUFFER(double, ++ hist->column_sums, sub_hist->column_sums, hsz); ++ ADD_BUFFER(double, hist->row_sums, sub_hist->row_sums, vsz); + break; + + default: +@@ -302,46 +304,45 @@ vips_project_stop( VipsStatistic *statistic, void *seq ) + + /* Blank out sub-project to make sure we can't add it again. + */ +- sub_hist->column_sums = NULL; +- sub_hist->row_sums = NULL; ++ sub_hist->column_sums = NULL; ++ sub_hist->row_sums = NULL; + +- return( 0 ); ++ return (0); + } + + static void +-vips_project_class_init( VipsProjectClass *class ) ++vips_project_class_init(VipsProjectClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS( class ); ++ VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "project"; +- object_class->description = _( "find image projections" ); ++ object_class->description = _("find image projections"); + object_class->build = vips_project_build; + + sclass->start = vips_project_start; + sclass->scan = vips_project_scan; + sclass->stop = vips_project_stop; + +- VIPS_ARG_IMAGE( class, "columns", 100, +- _( "Columns" ), +- _( "Sums of columns" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsProject, columns ) ); +- +- VIPS_ARG_IMAGE( class, "rows", 101, +- _( "Rows" ), +- _( "Sums of rows" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsProject, rows ) ); +- ++ VIPS_ARG_IMAGE(class, "columns", 100, ++ _("Columns"), ++ _("Sums of columns"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsProject, columns)); ++ ++ VIPS_ARG_IMAGE(class, "rows", 101, ++ _("Rows"), ++ _("Sums of rows"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsProject, rows)); + } + + static void +-vips_project_init( VipsProject *project ) ++vips_project_init(VipsProject *project) + { + } + +@@ -363,15 +364,14 @@ vips_project_init( VipsProject *project ) + * Returns: 0 on success, -1 on error + */ + int +-vips_project( VipsImage *in, VipsImage **columns, VipsImage **rows, ... ) ++vips_project(VipsImage *in, VipsImage **columns, VipsImage **rows, ...) + { + va_list ap; + int result; + +- va_start( ap, rows ); +- result = vips_call_split( "project", ap, in, columns, rows ); +- va_end( ap ); ++ va_start(ap, rows); ++ result = vips_call_split("project", ap, in, columns, rows); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/arithmetic/relational.c b/libvips/arithmetic/relational.c +index 8eb902fc19..95a477b11a 100644 +--- a/libvips/arithmetic/relational.c ++++ b/libvips/arithmetic/relational.c +@@ -29,35 +29,35 @@ + * 1/2/12 + * - complex ==, != were broken + * 16/7/12 +- * - im1 > im2, im1 >= im2 were broken ++ * - im1 > im2, im1 >= im2 were broken + * 17/9/14 + * - im1 > im2, im1 >= im2 were still broken, but in a more subtle way + */ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -87,61 +87,83 @@ typedef struct _VipsRelational { + + typedef VipsBinaryClass VipsRelationalClass; + +-G_DEFINE_TYPE( VipsRelational, vips_relational, VIPS_TYPE_BINARY ); ++G_DEFINE_TYPE(VipsRelational, vips_relational, VIPS_TYPE_BINARY); + +-#define RLOOP( TYPE, ROP ) { \ +- TYPE * restrict left = (TYPE *) in0; \ +- TYPE * restrict right = (TYPE *) in1; \ +- VipsPel * restrict q = (VipsPel *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = (left[x] ROP right[x]) ? 255 : 0; \ +-} ++#define RLOOP(TYPE, ROP) \ ++ { \ ++ TYPE *restrict left = (TYPE *) in0; \ ++ TYPE *restrict right = (TYPE *) in1; \ ++ VipsPel *restrict q = (VipsPel *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = (left[x] ROP right[x]) ? 255 : 0; \ ++ } + +-#define CLOOP( TYPE, COP ) { \ +- TYPE * restrict left = (TYPE *) in0; \ +- TYPE * restrict right = (TYPE *) in1; \ +- VipsPel * restrict q = (VipsPel *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- q[x] = COP( left[0], left[1], right[0], right[1]) ? 255 : 0; \ +- \ +- left += 2; \ +- right += 2; \ +- } \ +-} ++#define CLOOP(TYPE, COP) \ ++ { \ ++ TYPE *restrict left = (TYPE *) in0; \ ++ TYPE *restrict right = (TYPE *) in1; \ ++ VipsPel *restrict q = (VipsPel *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ q[x] = COP(left[0], left[1], right[0], right[1]) ? 255 : 0; \ ++\ ++ left += 2; \ ++ right += 2; \ ++ } \ ++ } + +-#define SWITCH( R, C, ROP, COP ) \ +- switch( vips_image_get_format( im ) ) { \ +- case VIPS_FORMAT_UCHAR: R( unsigned char, ROP ); break; \ +- case VIPS_FORMAT_CHAR: R( signed char, ROP ); break; \ +- case VIPS_FORMAT_USHORT: R( unsigned short, ROP ); break; \ +- case VIPS_FORMAT_SHORT: R( signed short, ROP ); break; \ +- case VIPS_FORMAT_UINT: R( unsigned int, ROP ); break; \ +- case VIPS_FORMAT_INT: R( signed int, ROP ); break; \ +- case VIPS_FORMAT_FLOAT: R( float, ROP ); break; \ +- case VIPS_FORMAT_DOUBLE: R( double, ROP ); break;\ +- case VIPS_FORMAT_COMPLEX: C( float, COP ); break; \ +- case VIPS_FORMAT_DPCOMPLEX: C( double, COP ); break;\ +- \ ++#define SWITCH(R, C, ROP, COP) \ ++ switch (vips_image_get_format(im)) { \ ++ case VIPS_FORMAT_UCHAR: \ ++ R(unsigned char, ROP); \ ++ break; \ ++ case VIPS_FORMAT_CHAR: \ ++ R(signed char, ROP); \ ++ break; \ ++ case VIPS_FORMAT_USHORT: \ ++ R(unsigned short, ROP); \ ++ break; \ ++ case VIPS_FORMAT_SHORT: \ ++ R(signed short, ROP); \ ++ break; \ ++ case VIPS_FORMAT_UINT: \ ++ R(unsigned int, ROP); \ ++ break; \ ++ case VIPS_FORMAT_INT: \ ++ R(signed int, ROP); \ ++ break; \ ++ case VIPS_FORMAT_FLOAT: \ ++ R(float, ROP); \ ++ break; \ ++ case VIPS_FORMAT_DOUBLE: \ ++ R(double, ROP); \ ++ break; \ ++ case VIPS_FORMAT_COMPLEX: \ ++ C(float, COP); \ ++ break; \ ++ case VIPS_FORMAT_DPCOMPLEX: \ ++ C(double, COP); \ ++ break; \ ++\ + default: \ + g_assert_not_reached(); \ +- } ++ } + +-#define CEQUAL( x1, y1, x2, y2 ) (x1 == x2 && y1 == y2) +-#define CNOTEQ( x1, y1, x2, y2 ) (x1 != x2 || y1 != y2) +-#define CLESS( x1, y1, x2, y2 ) (x1 * x1 + y1 * y1 < x2 * x2 + y2 * y2) +-#define CLESSEQ( x1, y1, x2, y2 ) (x1 * x1 + y1 * y1 <= x2 * x2 + y2 * y2) +-#define CMORE( x1, y1, x2, y2 ) (x1 * x1 + y1 * y1 > x2 * x2 + y2 * y2) +-#define CMOREEQ( x1, y1, x2, y2 ) (x1 * x1 + y1 * y1 >= x2 * x2 + y2 * y2) ++#define CEQUAL(x1, y1, x2, y2) (x1 == x2 && y1 == y2) ++#define CNOTEQ(x1, y1, x2, y2) (x1 != x2 || y1 != y2) ++#define CLESS(x1, y1, x2, y2) (x1 * x1 + y1 * y1 < x2 * x2 + y2 * y2) ++#define CLESSEQ(x1, y1, x2, y2) (x1 * x1 + y1 * y1 <= x2 * x2 + y2 * y2) ++#define CMORE(x1, y1, x2, y2) (x1 * x1 + y1 * y1 > x2 * x2 + y2 * y2) ++#define CMOREEQ(x1, y1, x2, y2) (x1 * x1 + y1 * y1 >= x2 * x2 + y2 * y2) + + static void +-vips_relational_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_relational_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsRelational *relational = (VipsRelational *) arithmetic; + VipsImage *im = arithmetic->ready[0]; +- const int sz = width * vips_image_get_bands( im ); ++ const int sz = width * vips_image_get_bands(im); + + VipsOperationRelational op; + VipsPel *in0; +@@ -152,31 +174,31 @@ vips_relational_buffer( VipsArithmetic *arithmetic, + in1 = in[1]; + op = relational->relational; + +- if( op == VIPS_OPERATION_RELATIONAL_MORE ) { ++ if (op == VIPS_OPERATION_RELATIONAL_MORE) { + op = VIPS_OPERATION_RELATIONAL_LESS; +- VIPS_SWAP( VipsPel *, in0, in1 ); ++ VIPS_SWAP(VipsPel *, in0, in1); + } + +- if( op == VIPS_OPERATION_RELATIONAL_MOREEQ ) { ++ if (op == VIPS_OPERATION_RELATIONAL_MOREEQ) { + op = VIPS_OPERATION_RELATIONAL_LESSEQ; +- VIPS_SWAP( VipsPel *, in0, in1 ); ++ VIPS_SWAP(VipsPel *, in0, in1); + } + +- switch( op ) { +- case VIPS_OPERATION_RELATIONAL_EQUAL: +- SWITCH( RLOOP, CLOOP, ==, CEQUAL ); ++ switch (op) { ++ case VIPS_OPERATION_RELATIONAL_EQUAL: ++ SWITCH(RLOOP, CLOOP, ==, CEQUAL); + break; + + case VIPS_OPERATION_RELATIONAL_NOTEQ: +- SWITCH( RLOOP, CLOOP, !=, CNOTEQ ); ++ SWITCH(RLOOP, CLOOP, !=, CNOTEQ); + break; + +- case VIPS_OPERATION_RELATIONAL_LESS: +- SWITCH( RLOOP, CLOOP, <, CLESS ); ++ case VIPS_OPERATION_RELATIONAL_LESS: ++ SWITCH(RLOOP, CLOOP, <, CLESS); + break; + +- case VIPS_OPERATION_RELATIONAL_LESSEQ: +- SWITCH( RLOOP, CLOOP, <=, CLESSEQ ); ++ case VIPS_OPERATION_RELATIONAL_LESSEQ: ++ SWITCH(RLOOP, CLOOP, <=, CLESSEQ); + break; + + default: +@@ -203,43 +225,43 @@ static const VipsBandFormat vips_relational_format_table[10] = { + }; + + static void +-vips_relational_class_init( VipsRelationalClass *class ) ++vips_relational_class_init(VipsRelationalClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "relational"; +- object_class->description = _( "relational operation on two images" ); ++ object_class->description = _("relational operation on two images"); + + aclass->process_line = vips_relational_buffer; + +- vips_arithmetic_set_format_table( aclass, +- vips_relational_format_table ); ++ vips_arithmetic_set_format_table(aclass, ++ vips_relational_format_table); + +- VIPS_ARG_ENUM( class, "relational", 200, +- _( "Operation" ), +- _( "Relational to perform" ), ++ VIPS_ARG_ENUM(class, "relational", 200, ++ _("Operation"), ++ _("Relational to perform"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsRelational, relational ), +- VIPS_TYPE_OPERATION_RELATIONAL, +- VIPS_OPERATION_RELATIONAL_EQUAL ); ++ G_STRUCT_OFFSET(VipsRelational, relational), ++ VIPS_TYPE_OPERATION_RELATIONAL, ++ VIPS_OPERATION_RELATIONAL_EQUAL); + } + + static void +-vips_relational_init( VipsRelational *relational ) ++vips_relational_init(VipsRelational *relational) + { + } + + static int +-vips_relationalv( VipsImage *left, VipsImage *right, VipsImage **out, +- VipsOperationRelational relational, va_list ap ) ++vips_relationalv(VipsImage *left, VipsImage *right, VipsImage **out, ++ VipsOperationRelational relational, va_list ap) + { +- return( vips_call_split( "relational", ap, left, right, out, +- relational ) ); ++ return (vips_call_split("relational", ap, left, right, out, ++ relational)); + } + + /** +@@ -250,44 +272,44 @@ vips_relationalv( VipsImage *left, VipsImage *right, VipsImage **out, + * @relational: relational operation to perform + * @...: %NULL-terminated list of optional named arguments + * +- * Perform various relational operations on pairs of images. ++ * Perform various relational operations on pairs of images. + * +- * The output type is always uchar, with 0 for FALSE and 255 for TRUE. ++ * The output type is always uchar, with 0 for FALSE and 255 for TRUE. + * +- * Less-than and greater-than for complex images compare the modulus. ++ * Less-than and greater-than for complex images compare the modulus. + * + * If the images differ in size, the smaller image is enlarged to match the + * larger by adding zero pixels along the bottom and right. + * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +- * The two input images are cast up to the smallest common format (see table +- * Smallest common format in ++ * The two input images are cast up to the smallest common format (see table ++ * Smallest common format in + * arithmetic). + * + * To decide if pixels match exactly, that is have the same value in every +- * band, use vips_bandbool() after this operation to AND or OR image bands +- * together. ++ * band, use vips_bandbool() after this operation to AND or OR image bands ++ * together. + * + * See also: vips_boolean(), vips_bandbool(), vips_relational_const(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_relational( VipsImage *left, VipsImage *right, VipsImage **out, +- VipsOperationRelational relational, ... ) ++vips_relational(VipsImage *left, VipsImage *right, VipsImage **out, ++ VipsOperationRelational relational, ...) + { + va_list ap; + int result; + +- va_start( ap, relational ); +- result = vips_relationalv( left, right, out, relational, ap ); +- va_end( ap ); ++ va_start(ap, relational); ++ result = vips_relationalv(left, right, out, relational, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -303,17 +325,17 @@ vips_relational( VipsImage *left, VipsImage *right, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_equal( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_equal(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_relationalv( left, right, out, +- VIPS_OPERATION_RELATIONAL_EQUAL, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_relationalv(left, right, out, ++ VIPS_OPERATION_RELATIONAL_EQUAL, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -329,17 +351,17 @@ vips_equal( VipsImage *left, VipsImage *right, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_notequal( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_notequal(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_relationalv( left, right, out, +- VIPS_OPERATION_RELATIONAL_NOTEQ, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_relationalv(left, right, out, ++ VIPS_OPERATION_RELATIONAL_NOTEQ, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -355,17 +377,17 @@ vips_notequal( VipsImage *left, VipsImage *right, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_more( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_more(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_relationalv( left, right, out, +- VIPS_OPERATION_RELATIONAL_MORE, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_relationalv(left, right, out, ++ VIPS_OPERATION_RELATIONAL_MORE, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -381,17 +403,17 @@ vips_more( VipsImage *left, VipsImage *right, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_moreeq( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_moreeq(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_relationalv( left, right, out, +- VIPS_OPERATION_RELATIONAL_MOREEQ, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_relationalv(left, right, out, ++ VIPS_OPERATION_RELATIONAL_MOREEQ, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -407,17 +429,17 @@ vips_moreeq( VipsImage *left, VipsImage *right, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_less( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_less(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_relationalv( left, right, out, +- VIPS_OPERATION_RELATIONAL_LESS, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_relationalv(left, right, out, ++ VIPS_OPERATION_RELATIONAL_LESS, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -433,17 +455,17 @@ vips_less( VipsImage *left, VipsImage *right, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_lesseq( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_lesseq(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_relationalv( left, right, out, +- VIPS_OPERATION_RELATIONAL_LESSEQ, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_relationalv(left, right, out, ++ VIPS_OPERATION_RELATIONAL_LESSEQ, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + typedef struct _VipsRelationalConst { +@@ -454,107 +476,110 @@ typedef struct _VipsRelationalConst { + + typedef VipsUnaryConstClass VipsRelationalConstClass; + +-G_DEFINE_TYPE( VipsRelationalConst, +- vips_relational_const, VIPS_TYPE_UNARY_CONST ); +- +-#define RLOOPCI( TYPE, OP ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- int * restrict c = uconst->c_int; \ +- \ +- for( i = 0, x = 0; x < width; x++ ) \ +- for( b = 0; b < bands; b++, i++ ) \ +- out[i] = (p[i] OP c[b]) ? 255 : 0; \ +-} ++G_DEFINE_TYPE(VipsRelationalConst, ++ vips_relational_const, VIPS_TYPE_UNARY_CONST); ++ ++#define RLOOPCI(TYPE, OP) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ int *restrict c = uconst->c_int; \ ++\ ++ for (i = 0, x = 0; x < width; x++) \ ++ for (b = 0; b < bands; b++, i++) \ ++ out[i] = (p[i] OP c[b]) ? 255 : 0; \ ++ } + +-#define RLOOPCF( TYPE, OP ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- double * restrict c = uconst->c_double; \ +- \ +- for( i = 0, x = 0; x < width; x++ ) \ +- for( b = 0; b < bands; b++, i++ ) \ +- out[i] = (p[i] OP c[b]) ? 255 : 0; \ +-} ++#define RLOOPCF(TYPE, OP) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ double *restrict c = uconst->c_double; \ ++\ ++ for (i = 0, x = 0; x < width; x++) \ ++ for (b = 0; b < bands; b++, i++) \ ++ out[i] = (p[i] OP c[b]) ? 255 : 0; \ ++ } + +-#define CLOOPC( TYPE, OP ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- \ +- for( i = 0, x = 0; x < width; x++ ) { \ +- double * restrict c = uconst->c_double; \ +- \ +- for( b = 0; b < bands; b++, i++ ) { \ +- out[i] = OP( p[0], p[1], c[0], c[1]) ? 255 : 0; \ +- \ +- p += 2; \ +- c += 2; \ ++#define CLOOPC(TYPE, OP) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++\ ++ for (i = 0, x = 0; x < width; x++) { \ ++ double *restrict c = uconst->c_double; \ ++\ ++ for (b = 0; b < bands; b++, i++) { \ ++ out[i] = OP(p[0], p[1], c[0], c[1]) ? 255 : 0; \ ++\ ++ p += 2; \ ++ c += 2; \ ++ } \ + } \ +- } \ +-} ++ } + + static void +-vips_relational_const_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_relational_const_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsUnaryConst *uconst = (VipsUnaryConst *) arithmetic; + VipsRelationalConst *rconst = (VipsRelationalConst *) arithmetic; + VipsImage *im = arithmetic->ready[0]; + int bands = im->Bands; + gboolean is_int = uconst->is_int && +- vips_band_format_isint( im->BandFmt ); ++ vips_band_format_isint(im->BandFmt); + + int i, x, b; + +- switch( rconst->relational ) { ++ switch (rconst->relational) { + case VIPS_OPERATION_RELATIONAL_EQUAL: +- if( is_int ) { +- SWITCH( RLOOPCI, CLOOPC, ==, CEQUAL ); ++ if (is_int) { ++ SWITCH(RLOOPCI, CLOOPC, ==, CEQUAL); + } + else { +- SWITCH( RLOOPCF, CLOOPC, ==, CEQUAL ); ++ SWITCH(RLOOPCF, CLOOPC, ==, CEQUAL); + } + break; + + case VIPS_OPERATION_RELATIONAL_NOTEQ: +- if( is_int ) { +- SWITCH( RLOOPCI, CLOOPC, !=, CNOTEQ ); ++ if (is_int) { ++ SWITCH(RLOOPCI, CLOOPC, !=, CNOTEQ); + } + else { +- SWITCH( RLOOPCF, CLOOPC, !=, CNOTEQ ); ++ SWITCH(RLOOPCF, CLOOPC, !=, CNOTEQ); + } + break; + + case VIPS_OPERATION_RELATIONAL_LESS: +- if( is_int ) { +- SWITCH( RLOOPCI, CLOOPC, <, CLESS ); ++ if (is_int) { ++ SWITCH(RLOOPCI, CLOOPC, <, CLESS); + } + else { +- SWITCH( RLOOPCF, CLOOPC, <, CLESS ); ++ SWITCH(RLOOPCF, CLOOPC, <, CLESS); + } + break; + + case VIPS_OPERATION_RELATIONAL_LESSEQ: +- if( is_int ) { +- SWITCH( RLOOPCI, CLOOPC, <=, CLESSEQ ); ++ if (is_int) { ++ SWITCH(RLOOPCI, CLOOPC, <=, CLESSEQ); + } + else { +- SWITCH( RLOOPCF, CLOOPC, <=, CLESSEQ ); ++ SWITCH(RLOOPCF, CLOOPC, <=, CLESSEQ); + } + break; + + case VIPS_OPERATION_RELATIONAL_MORE: +- if( is_int ) { +- SWITCH( RLOOPCI, CLOOPC, >, CMORE ); ++ if (is_int) { ++ SWITCH(RLOOPCI, CLOOPC, >, CMORE); + } + else { +- SWITCH( RLOOPCF, CLOOPC, >, CMORE ); ++ SWITCH(RLOOPCF, CLOOPC, >, CMORE); + } + break; + + case VIPS_OPERATION_RELATIONAL_MOREEQ: +- if( is_int ) { +- SWITCH( RLOOPCI, CLOOPC, >=, CMOREEQ ); ++ if (is_int) { ++ SWITCH(RLOOPCI, CLOOPC, >=, CMOREEQ); + } + else { +- SWITCH( RLOOPCF, CLOOPC, >=, CMOREEQ ); ++ SWITCH(RLOOPCF, CLOOPC, >=, CMOREEQ); + } + break; + +@@ -564,58 +589,58 @@ vips_relational_const_buffer( VipsArithmetic *arithmetic, + } + + static void +-vips_relational_const_class_init( VipsRelationalConstClass *class ) ++vips_relational_const_class_init(VipsRelationalConstClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "relational_const"; +- object_class->description = +- _( "relational operations against a constant" ); ++ object_class->description = ++ _("relational operations against a constant"); + + aclass->process_line = vips_relational_const_buffer; + +- vips_arithmetic_set_format_table( aclass, +- vips_relational_format_table ); ++ vips_arithmetic_set_format_table(aclass, ++ vips_relational_format_table); + +- VIPS_ARG_ENUM( class, "relational", 200, +- _( "Operation" ), +- _( "Relational to perform" ), ++ VIPS_ARG_ENUM(class, "relational", 200, ++ _("Operation"), ++ _("Relational to perform"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsRelationalConst, relational ), +- VIPS_TYPE_OPERATION_RELATIONAL, +- VIPS_OPERATION_RELATIONAL_EQUAL ); ++ G_STRUCT_OFFSET(VipsRelationalConst, relational), ++ VIPS_TYPE_OPERATION_RELATIONAL, ++ VIPS_OPERATION_RELATIONAL_EQUAL); + } + + static void +-vips_relational_const_init( VipsRelationalConst *relational_const ) ++vips_relational_const_init(VipsRelationalConst *relational_const) + { + } + + static int +-vips_relational_constv( VipsImage *in, VipsImage **out, +- VipsOperationRelational relational, const double *c, int n, va_list ap ) ++vips_relational_constv(VipsImage *in, VipsImage **out, ++ VipsOperationRelational relational, const double *c, int n, va_list ap) + { + VipsArea *area_c; +- double *array; ++ double *array; + int result; + int i; + +- area_c = vips_area_new_array( G_TYPE_DOUBLE, sizeof( double ), n ); ++ area_c = vips_area_new_array(G_TYPE_DOUBLE, sizeof(double), n); + array = (double *) area_c->data; +- for( i = 0; i < n; i++ ) ++ for (i = 0; i < n; i++) + array[i] = c[i]; + +- result = vips_call_split( "relational_const", ap, +- in, out, relational, area_c ); ++ result = vips_call_split("relational_const", ap, ++ in, out, relational, area_c); + +- vips_area_unref( area_c ); ++ vips_area_unref(area_c); + +- return( result ); ++ return (result); + } + + /** +@@ -630,11 +655,11 @@ vips_relational_constv( VipsImage *in, VipsImage **out, + * Perform various relational operations on an image and an array of + * constants. + * +- * The output type is always uchar, with 0 for FALSE and 255 for TRUE. ++ * The output type is always uchar, with 0 for FALSE and 255 for TRUE. + * +- * If the array of constants has just one element, that constant is used for +- * all image bands. If the array has more than one element and they have +- * the same number of elements as there are bands in the image, then ++ * If the array of constants has just one element, that constant is used for ++ * all image bands. If the array has more than one element and they have ++ * the same number of elements as there are bands in the image, then + * one array element is used for each band. If the arrays have more than one + * element and the image only has a single band, the result is a many-band + * image where each band corresponds to one array element. +@@ -644,17 +669,17 @@ vips_relational_constv( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_relational_const( VipsImage *in, VipsImage **out, +- VipsOperationRelational relational, const double *c, int n, ... ) ++vips_relational_const(VipsImage *in, VipsImage **out, ++ VipsOperationRelational relational, const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_relational_constv( in, out, relational, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_relational_constv(in, out, relational, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -671,17 +696,17 @@ vips_relational_const( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_equal_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) ++vips_equal_const(VipsImage *in, VipsImage **out, const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_relational_constv( in, out, +- VIPS_OPERATION_RELATIONAL_EQUAL, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_relational_constv(in, out, ++ VIPS_OPERATION_RELATIONAL_EQUAL, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -698,18 +723,18 @@ vips_equal_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_notequal_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++vips_notequal_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_relational_constv( in, out, +- VIPS_OPERATION_RELATIONAL_NOTEQ, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_relational_constv(in, out, ++ VIPS_OPERATION_RELATIONAL_NOTEQ, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -726,17 +751,17 @@ vips_notequal_const( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_less_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) ++vips_less_const(VipsImage *in, VipsImage **out, const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_relational_constv( in, out, +- VIPS_OPERATION_RELATIONAL_LESS, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_relational_constv(in, out, ++ VIPS_OPERATION_RELATIONAL_LESS, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -753,17 +778,17 @@ vips_less_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_lesseq_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) ++vips_lesseq_const(VipsImage *in, VipsImage **out, const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_relational_constv( in, out, +- VIPS_OPERATION_RELATIONAL_LESSEQ, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_relational_constv(in, out, ++ VIPS_OPERATION_RELATIONAL_LESSEQ, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -780,17 +805,17 @@ vips_lesseq_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_more_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) ++vips_more_const(VipsImage *in, VipsImage **out, const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_relational_constv( in, out, +- VIPS_OPERATION_RELATIONAL_MORE, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_relational_constv(in, out, ++ VIPS_OPERATION_RELATIONAL_MORE, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -807,17 +832,17 @@ vips_more_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_moreeq_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) ++vips_moreeq_const(VipsImage *in, VipsImage **out, const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_relational_constv( in, out, +- VIPS_OPERATION_RELATIONAL_MOREEQ, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_relational_constv(in, out, ++ VIPS_OPERATION_RELATIONAL_MOREEQ, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -825,7 +850,7 @@ vips_moreeq_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) + * @in: input image + * @out: (out): output image + * @relational: relational operation to perform +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform various relational operations on an image and a constant. See +@@ -836,24 +861,24 @@ vips_moreeq_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_relational_const1( VipsImage *in, VipsImage **out, +- VipsOperationRelational relational, double c, ... ) ++vips_relational_const1(VipsImage *in, VipsImage **out, ++ VipsOperationRelational relational, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_relational_constv( in, out, relational, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_relational_constv(in, out, relational, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_equal_const1: (method) + * @in: input image + * @out: (out): output image +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform #VIPS_OPERATION_RELATIONAL_EQUAL on an image and a constant. See +@@ -862,24 +887,24 @@ vips_relational_const1( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_equal_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_equal_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_relational_constv( in, out, +- VIPS_OPERATION_RELATIONAL_EQUAL, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_relational_constv(in, out, ++ VIPS_OPERATION_RELATIONAL_EQUAL, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_notequal_const1: (method) + * @in: input image + * @out: (out): output image +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform #VIPS_OPERATION_RELATIONAL_NOTEQ on an image and a constant. See +@@ -888,24 +913,24 @@ vips_equal_const1( VipsImage *in, VipsImage **out, double c, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_notequal_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_notequal_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_relational_constv( in, out, +- VIPS_OPERATION_RELATIONAL_NOTEQ, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_relational_constv(in, out, ++ VIPS_OPERATION_RELATIONAL_NOTEQ, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_less_const1: (method) + * @in: input image + * @out: (out): output image +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform #VIPS_OPERATION_RELATIONAL_LESS on an image and a constant. See +@@ -914,24 +939,24 @@ vips_notequal_const1( VipsImage *in, VipsImage **out, double c, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_less_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_less_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_relational_constv( in, out, +- VIPS_OPERATION_RELATIONAL_LESS, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_relational_constv(in, out, ++ VIPS_OPERATION_RELATIONAL_LESS, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_lesseq_const1: (method) + * @in: input image + * @out: (out): output image +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform #VIPS_OPERATION_RELATIONAL_LESSEQ on an image and a constant. See +@@ -940,24 +965,24 @@ vips_less_const1( VipsImage *in, VipsImage **out, double c, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_lesseq_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_lesseq_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_relational_constv( in, out, +- VIPS_OPERATION_RELATIONAL_LESSEQ, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_relational_constv(in, out, ++ VIPS_OPERATION_RELATIONAL_LESSEQ, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_more_const1: (method) + * @in: input image + * @out: (out): output image +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform #VIPS_OPERATION_RELATIONAL_MORE on an image and a constant. See +@@ -966,24 +991,24 @@ vips_lesseq_const1( VipsImage *in, VipsImage **out, double c, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_more_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_more_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_relational_constv( in, out, +- VIPS_OPERATION_RELATIONAL_MORE, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_relational_constv(in, out, ++ VIPS_OPERATION_RELATIONAL_MORE, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_moreeq_const1: (method) + * @in: input image + * @out: (out): output image +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * + * Perform #VIPS_OPERATION_RELATIONAL_MOREEQ on an image and a constant. See +@@ -992,16 +1017,15 @@ vips_more_const1( VipsImage *in, VipsImage **out, double c, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_moreeq_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_moreeq_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_relational_constv( in, out, +- VIPS_OPERATION_RELATIONAL_MOREEQ, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_relational_constv(in, out, ++ VIPS_OPERATION_RELATIONAL_MOREEQ, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/arithmetic/remainder.c b/libvips/arithmetic/remainder.c +index 97c2b34437..8ce026d835 100644 +--- a/libvips/arithmetic/remainder.c ++++ b/libvips/arithmetic/remainder.c +@@ -22,28 +22,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -68,75 +68,93 @@ + typedef VipsBinary VipsRemainder; + typedef VipsBinaryClass VipsRemainderClass; + +-G_DEFINE_TYPE( VipsRemainder, vips_remainder, VIPS_TYPE_BINARY ); ++G_DEFINE_TYPE(VipsRemainder, vips_remainder, VIPS_TYPE_BINARY); + + static int +-vips_remainder_build( VipsObject *object ) ++vips_remainder_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsBinary *binary = (VipsBinary *) object; + +- if( binary->left && +- vips_check_noncomplex( class->nickname, binary->left ) ) +- return( -1 ); +- if( binary->right && +- vips_check_noncomplex( class->nickname, binary->right ) ) +- return( -1 ); ++ if (binary->left && ++ vips_check_noncomplex(class->nickname, binary->left)) ++ return (-1); ++ if (binary->right && ++ vips_check_noncomplex(class->nickname, binary->right)) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_remainder_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_remainder_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Integer remainder-after-division. + */ +-#define IREMAINDER( TYPE ) { \ +- TYPE * restrict p1 = (TYPE *) in[0]; \ +- TYPE * restrict p2 = (TYPE *) in[1]; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = p2[x] ? p1[x] % p2[x] : -1; \ +-} ++#define IREMAINDER(TYPE) \ ++ { \ ++ TYPE *restrict p1 = (TYPE *) in[0]; \ ++ TYPE *restrict p2 = (TYPE *) in[1]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = p2[x] ? p1[x] % p2[x] : -1; \ ++ } + + /* Float remainder-after-division. + */ +-#define FREMAINDER( TYPE ) { \ +- TYPE * restrict p1 = (TYPE *) in[0]; \ +- TYPE * restrict p2 = (TYPE *) in[1]; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- double a = p1[x]; \ +- double b = p2[x]; \ +- \ +- q[x] = b ? a - b * VIPS_FLOOR (a / b) : -1; \ +- } \ +-} ++#define FREMAINDER(TYPE) \ ++ { \ ++ TYPE *restrict p1 = (TYPE *) in[0]; \ ++ TYPE *restrict p2 = (TYPE *) in[1]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ double a = p1[x]; \ ++ double b = p2[x]; \ ++\ ++ q[x] = b ? a - b * VIPS_FLOOR(a / b) : -1; \ ++ } \ ++ } + + static void +-vips_remainder_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_remainder_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsImage *im = arithmetic->ready[0]; +- const int sz = width * vips_image_get_bands( im ); ++ const int sz = width * vips_image_get_bands(im); + + int x; + +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_CHAR: IREMAINDER( signed char ); break; +- case VIPS_FORMAT_UCHAR: IREMAINDER( unsigned char ); break; +- case VIPS_FORMAT_SHORT: IREMAINDER( signed short ); break; +- case VIPS_FORMAT_USHORT:IREMAINDER( unsigned short ); break; +- case VIPS_FORMAT_INT: IREMAINDER( signed int ); break; +- case VIPS_FORMAT_UINT: IREMAINDER( unsigned int ); break; +- case VIPS_FORMAT_FLOAT: FREMAINDER( float ); break; +- case VIPS_FORMAT_DOUBLE:FREMAINDER( double ); break; +- +- default: ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_CHAR: ++ IREMAINDER(signed char); ++ break; ++ case VIPS_FORMAT_UCHAR: ++ IREMAINDER(unsigned char); ++ break; ++ case VIPS_FORMAT_SHORT: ++ IREMAINDER(signed short); ++ break; ++ case VIPS_FORMAT_USHORT: ++ IREMAINDER(unsigned short); ++ break; ++ case VIPS_FORMAT_INT: ++ IREMAINDER(signed int); ++ break; ++ case VIPS_FORMAT_UINT: ++ IREMAINDER(unsigned int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ FREMAINDER(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ FREMAINDER(double); ++ break; ++ ++ default: + g_assert_not_reached(); +- } ++ } + } + + /* Save a bit of typing. +@@ -160,28 +178,28 @@ static const VipsBandFormat vips_remainder_format_table[10] = { + }; + + static void +-vips_remainder_class_init( VipsRemainderClass *class ) ++vips_remainder_class_init(VipsRemainderClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "remainder"; +- object_class->description = +- _( "remainder after integer division of two images" ); ++ object_class->description = ++ _("remainder after integer division of two images"); + object_class->build = vips_remainder_build; + + aclass->process_line = vips_remainder_buffer; + +- vips_arithmetic_set_format_table( aclass, +- vips_remainder_format_table ); ++ vips_arithmetic_set_format_table(aclass, ++ vips_remainder_format_table); + } + + static void +-vips_remainder_init( VipsRemainder *remainder ) ++vips_remainder_init(VipsRemainder *remainder) + { + } + +@@ -192,21 +210,21 @@ vips_remainder_init( VipsRemainder *remainder ) + * @out: (out): output #VipsImage + * @...: %NULL-terminated list of optional named arguments + * +- * This operation calculates @left % @right (remainder after integer division) +- * and writes the result to @out. The images may have any ++ * This operation calculates @left % @right (remainder after integer division) ++ * and writes the result to @out. The images may have any + * non-complex format. For float formats, vips_remainder() calculates @in1 - + * @in2 * floor (@in1 / @in2). + * + * If the images differ in size, the smaller image is enlarged to match the + * larger by adding zero pixels along the bottom and right. + * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +- * The two input images are cast up to the smallest common format (see table +- * Smallest common format in ++ * The two input images are cast up to the smallest common format (see table ++ * Smallest common format in + * arithmetic), and that format is the + * result type. + * +@@ -215,74 +233,73 @@ vips_remainder_init( VipsRemainder *remainder ) + * Returns: 0 on success, -1 on error + */ + int +-vips_remainder( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_remainder(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "remainder", ap, left, right, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("remainder", ap, left, right, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + typedef VipsUnaryConst VipsRemainderConst; + typedef VipsUnaryConstClass VipsRemainderConstClass; + +-G_DEFINE_TYPE( VipsRemainderConst, +- vips_remainder_const, VIPS_TYPE_UNARY_CONST ); ++G_DEFINE_TYPE(VipsRemainderConst, ++ vips_remainder_const, VIPS_TYPE_UNARY_CONST); + + static int +-vips_remainder_const_build( VipsObject *object ) ++vips_remainder_const_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsUnary *unary = (VipsUnary *) object; + +- if( unary->in && +- vips_check_noncomplex( class->nickname, unary->in ) ) +- return( -1 ); ++ if (unary->in && ++ vips_check_noncomplex(class->nickname, unary->in)) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_remainder_const_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_remainder_const_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Integer remainder-after-divide, per-band constant. + */ +-#define IREMAINDERCONST( TYPE ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- TYPE * restrict q = (TYPE *) out; \ +- int * restrict c = uconst->c_int; \ +- \ +- for( i = 0, x = 0; x < width; x++ ) \ +- for( b = 0; b < bands; b++, i++ ) \ +- q[i] = p[i] % c[b]; \ +-} ++#define IREMAINDERCONST(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++ int *restrict c = uconst->c_int; \ ++\ ++ for (i = 0, x = 0; x < width; x++) \ ++ for (b = 0; b < bands; b++, i++) \ ++ q[i] = p[i] % c[b]; \ ++ } + + /* Float remainder-after-divide, per-band constant. + */ +-#define FREMAINDERCONST( TYPE ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- TYPE * restrict q = (TYPE *) out; \ +- int * restrict c = uconst->c_int; \ +- \ +- for( i = 0, x = 0; x < width; x++ ) \ +- for( b = 0; b < bands; b++, i++ ) { \ +- double left = p[i]; \ +- double right = c[b]; \ +- \ +- q[i] = right ? \ +- left - right * floor( left / right ) : \ +- -1; \ +- } \ +-} ++#define FREMAINDERCONST(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++ int *restrict c = uconst->c_int; \ ++\ ++ for (i = 0, x = 0; x < width; x++) \ ++ for (b = 0; b < bands; b++, i++) { \ ++ double left = p[i]; \ ++ double right = c[b]; \ ++\ ++ q[i] = right ? left - right * floor(left / right) : -1; \ ++ } \ ++ } + + static void +-vips_remainder_const_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_remainder_const_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsUnaryConst *uconst = (VipsUnaryConst *) arithmetic; + VipsImage *im = arithmetic->ready[0]; +@@ -290,66 +307,82 @@ vips_remainder_const_buffer( VipsArithmetic *arithmetic, + + int i, x, b; + +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_CHAR: IREMAINDERCONST( signed char ); break; +- case VIPS_FORMAT_UCHAR: IREMAINDERCONST( unsigned char ); break; +- case VIPS_FORMAT_SHORT: IREMAINDERCONST( signed short ); break; +- case VIPS_FORMAT_USHORT:IREMAINDERCONST( unsigned short ); break; +- case VIPS_FORMAT_INT: IREMAINDERCONST( signed int ); break; +- case VIPS_FORMAT_UINT: IREMAINDERCONST( unsigned int ); break; +- case VIPS_FORMAT_FLOAT: FREMAINDERCONST( float ); break; +- case VIPS_FORMAT_DOUBLE:FREMAINDERCONST( double ); break; +- +- default: ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_CHAR: ++ IREMAINDERCONST(signed char); ++ break; ++ case VIPS_FORMAT_UCHAR: ++ IREMAINDERCONST(unsigned char); ++ break; ++ case VIPS_FORMAT_SHORT: ++ IREMAINDERCONST(signed short); ++ break; ++ case VIPS_FORMAT_USHORT: ++ IREMAINDERCONST(unsigned short); ++ break; ++ case VIPS_FORMAT_INT: ++ IREMAINDERCONST(signed int); ++ break; ++ case VIPS_FORMAT_UINT: ++ IREMAINDERCONST(unsigned int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ FREMAINDERCONST(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ FREMAINDERCONST(double); ++ break; ++ ++ default: + g_assert_not_reached(); +- } ++ } + } + + static void +-vips_remainder_const_class_init( VipsRemainderConstClass *class ) ++vips_remainder_const_class_init(VipsRemainderConstClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "remainder_const"; +- object_class->description = +- _( "remainder after integer division of an image " +- "and a constant" ); ++ object_class->description = ++ _("remainder after integer division of an image " ++ "and a constant"); + object_class->build = vips_remainder_const_build; + + aclass->process_line = vips_remainder_const_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_remainder_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_remainder_format_table); + } + + static void +-vips_remainder_const_init( VipsRemainderConst *remainder_const ) ++vips_remainder_const_init(VipsRemainderConst *remainder_const) + { + } + + static int +-vips_remainder_constv( VipsImage *in, VipsImage **out, +- const double *c, int n, va_list ap ) ++vips_remainder_constv(VipsImage *in, VipsImage **out, ++ const double *c, int n, va_list ap) + { + VipsArea *area_c; +- double *array; ++ double *array; + int result; + int i; + +- area_c = vips_area_new_array( G_TYPE_DOUBLE, sizeof( double ), n ); ++ area_c = vips_area_new_array(G_TYPE_DOUBLE, sizeof(double), n); + array = (double *) area_c->data; +- for( i = 0; i < n; i++ ) ++ for (i = 0; i < n; i++) + array[i] = c[i]; + +- result = vips_call_split( "remainder_const", ap, in, out, area_c ); ++ result = vips_call_split("remainder_const", ap, in, out, area_c); + +- vips_area_unref( area_c ); ++ vips_area_unref(area_c); + +- return( result ); ++ return (result); + } + + /** +@@ -360,16 +393,16 @@ vips_remainder_constv( VipsImage *in, VipsImage **out, + * @n: number of constants in @c + * @...: %NULL-terminated list of optional named arguments + * +- * This operation calculates @in % @c (remainder after division by an +- * array of constants) +- * and writes the result to @out. +- * The image may have any +- * non-complex format. For float formats, vips_remainder_const() calculates ++ * This operation calculates @in % @c (remainder after division by an ++ * array of constants) ++ * and writes the result to @out. ++ * The image may have any ++ * non-complex format. For float formats, vips_remainder_const() calculates + * @in - @c * floor (@in / @c). + * +- * If the array of constants has just one element, that constant is used for +- * all image bands. If the array has more than one element and they have +- * the same number of elements as there are bands in the image, then ++ * If the array of constants has just one element, that constant is used for ++ * all image bands. If the array has more than one element and they have ++ * the same number of elements as there are bands in the image, then + * one array element is used for each band. If the arrays have more than one + * element and the image only has a single band, the result is a many-band + * image where each band corresponds to one array element. +@@ -379,36 +412,36 @@ vips_remainder_constv( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_remainder_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++vips_remainder_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_remainder_constv( in, out, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_remainder_constv(in, out, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_remainder_const1: (method) + * @in: input image + * @out: (out): output image +- * @c: constant ++ * @c: constant + * @...: %NULL-terminated list of optional named arguments + * +- * This operation calculates @in % @c (remainder after division by a +- * constant) +- * and writes the result to @out. +- * The image may have any +- * non-complex format. For float formats, vips_remainder_const() calculates ++ * This operation calculates @in % @c (remainder after division by a ++ * constant) ++ * and writes the result to @out. ++ * The image may have any ++ * non-complex format. For float formats, vips_remainder_const() calculates + * @in - @c * floor (@in / @c). + * +- * If the array of constants has just one element, that constant is used for +- * all image bands. If the array has more than one element and they have +- * the same number of elements as there are bands in the image, then ++ * If the array of constants has just one element, that constant is used for ++ * all image bands. If the array has more than one element and they have ++ * the same number of elements as there are bands in the image, then + * one array element is used for each band. If the arrays have more than one + * element and the image only has a single band, the result is a many-band + * image where each band corresponds to one array element. +@@ -418,15 +451,14 @@ vips_remainder_const( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_remainder_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_remainder_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_remainder_constv( in, out, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_remainder_constv(in, out, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/arithmetic/round.c b/libvips/arithmetic/round.c +index 328ab515a4..6418829275 100644 +--- a/libvips/arithmetic/round.c ++++ b/libvips/arithmetic/round.c +@@ -13,28 +13,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -64,69 +64,81 @@ typedef struct _VipsRound { + + typedef VipsUnaryClass VipsRoundClass; + +-G_DEFINE_TYPE( VipsRound, vips_round, VIPS_TYPE_UNARY ); ++G_DEFINE_TYPE(VipsRound, vips_round, VIPS_TYPE_UNARY); + + static int +-vips_round_build( VipsObject *object ) ++vips_round_build(VipsObject *object) + { + VipsUnary *unary = (VipsUnary *) object; + + /* Is this one of the int types? Degenerate to vips_copy() if it + * is. + */ +- if( unary->in && +- vips_band_format_isint( unary->in->BandFmt ) ) +- return( vips_unary_copy( unary ) ); ++ if (unary->in && ++ vips_band_format_isint(unary->in->BandFmt)) ++ return (vips_unary_copy(unary)); + +- if( VIPS_OBJECT_CLASS( vips_round_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_round_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-#define LOOP( TYPE, OP ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = OP( p[x] ); \ +-} +- +-#define SWITCH( OP ) { \ +- switch( vips_image_get_format( im ) ) { \ +- case VIPS_FORMAT_COMPLEX: \ +- case VIPS_FORMAT_FLOAT: LOOP( float, OP ); break; \ +- \ +- case VIPS_FORMAT_DPCOMPLEX: \ +- case VIPS_FORMAT_DOUBLE:LOOP( double, OP ); break;\ +- \ +- default: \ +- g_assert_not_reached(); \ +- } \ +-} ++#define LOOP(TYPE, OP) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = OP(p[x]); \ ++ } ++ ++#define SWITCH(OP) \ ++ { \ ++ switch (vips_image_get_format(im)) { \ ++ case VIPS_FORMAT_COMPLEX: \ ++ case VIPS_FORMAT_FLOAT: \ ++ LOOP(float, OP); \ ++ break; \ ++\ ++ case VIPS_FORMAT_DPCOMPLEX: \ ++ case VIPS_FORMAT_DOUBLE: \ ++ LOOP(double, OP); \ ++ break; \ ++\ ++ default: \ ++ g_assert_not_reached(); \ ++ } \ ++ } + + static void +-vips_round_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_round_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsRound *round = (VipsRound *) arithmetic; + VipsImage *im = arithmetic->ready[0]; + + /* Complex just doubles the size. + */ +- const int sz = width * im->Bands * +- (vips_band_format_iscomplex( im->BandFmt ) ? 2 : 1); ++ const int sz = width * im->Bands * ++ (vips_band_format_iscomplex(im->BandFmt) ? 2 : 1); + + int x; + +- switch( round->round ) { +- case VIPS_OPERATION_ROUND_RINT: SWITCH( VIPS_RINT ); break; +- case VIPS_OPERATION_ROUND_CEIL: SWITCH( VIPS_CEIL ); break; +- case VIPS_OPERATION_ROUND_FLOOR: SWITCH( VIPS_FLOOR ); break; +- +- default: +- g_assert_not_reached(); +- } ++ switch (round->round) { ++ case VIPS_OPERATION_ROUND_RINT: ++ SWITCH(VIPS_RINT); ++ break; ++ case VIPS_OPERATION_ROUND_CEIL: ++ SWITCH(VIPS_CEIL); ++ break; ++ case VIPS_OPERATION_ROUND_FLOOR: ++ SWITCH(VIPS_FLOOR); ++ break; ++ ++ default: ++ g_assert_not_reached(); ++ } + } + + /* Save a bit of typing. +@@ -148,41 +160,41 @@ static const VipsBandFormat vips_round_format_table[10] = { + }; + + static void +-vips_round_class_init( VipsRoundClass *class ) ++vips_round_class_init(VipsRoundClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "round"; +- object_class->description = _( "perform a round function on an image" ); ++ object_class->description = _("perform a round function on an image"); + object_class->build = vips_round_build; + + aclass->process_line = vips_round_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_round_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_round_format_table); + +- VIPS_ARG_ENUM( class, "round", 200, +- _( "Round operation" ), +- _( "Rounding operation to perform" ), ++ VIPS_ARG_ENUM(class, "round", 200, ++ _("Round operation"), ++ _("Rounding operation to perform"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsRound, round ), +- VIPS_TYPE_OPERATION_ROUND, VIPS_OPERATION_ROUND_RINT ); ++ G_STRUCT_OFFSET(VipsRound, round), ++ VIPS_TYPE_OPERATION_ROUND, VIPS_OPERATION_ROUND_RINT); + } + + static void +-vips_round_init( VipsRound *round ) ++vips_round_init(VipsRound *round) + { + } + + static int +-vips_roundv( VipsImage *in, VipsImage **out, +- VipsOperationRound round, va_list ap ) ++vips_roundv(VipsImage *in, VipsImage **out, ++ VipsOperationRound round, va_list ap) + { +- return( vips_call_split( "round", ap, in, out, round ) ); ++ return (vips_call_split("round", ap, in, out, round)); + } + + /** +@@ -194,8 +206,8 @@ vips_roundv( VipsImage *in, VipsImage **out, + * + * Round to an integral value. + * +- * Copy for integer types, round float and +- * complex types. ++ * Copy for integer types, round float and ++ * complex types. + * + * The format of @out is always the same as @in, so you may wish to cast to an + * integer format afterwards. +@@ -205,16 +217,16 @@ vips_roundv( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_round( VipsImage *in, VipsImage **out, VipsOperationRound round, ... ) ++vips_round(VipsImage *in, VipsImage **out, VipsOperationRound round, ...) + { + va_list ap; + int result; + +- va_start( ap, round ); +- result = vips_roundv( in, out, round, ap ); +- va_end( ap ); ++ va_start(ap, round); ++ result = vips_roundv(in, out, round, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -223,22 +235,22 @@ vips_round( VipsImage *in, VipsImage **out, VipsOperationRound round, ... ) + * @out: (out): output #VipsImage + * @...: %NULL-terminated list of optional named arguments + * +- * Round to an integral value with #VIPS_OPERATION_ROUND_FLOOR. See +- * vips_round(). ++ * Round to an integral value with #VIPS_OPERATION_ROUND_FLOOR. See ++ * vips_round(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_floor( VipsImage *in, VipsImage **out, ... ) ++vips_floor(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_roundv( in, out, VIPS_OPERATION_ROUND_FLOOR, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_roundv(in, out, VIPS_OPERATION_ROUND_FLOOR, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -247,22 +259,22 @@ vips_floor( VipsImage *in, VipsImage **out, ... ) + * @out: (out): output #VipsImage + * @...: %NULL-terminated list of optional named arguments + * +- * Round to an integral value with #VIPS_OPERATION_ROUND_CEIL. See +- * vips_round(). ++ * Round to an integral value with #VIPS_OPERATION_ROUND_CEIL. See ++ * vips_round(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_ceil( VipsImage *in, VipsImage **out, ... ) ++vips_ceil(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_roundv( in, out, VIPS_OPERATION_ROUND_CEIL, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_roundv(in, out, VIPS_OPERATION_ROUND_CEIL, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -271,20 +283,20 @@ vips_ceil( VipsImage *in, VipsImage **out, ... ) + * @out: (out): output #VipsImage + * @...: %NULL-terminated list of optional named arguments + * +- * Round to an integral value with #VIPS_OPERATION_ROUND_RINT. See +- * vips_round(). ++ * Round to an integral value with #VIPS_OPERATION_ROUND_RINT. See ++ * vips_round(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_rint( VipsImage *in, VipsImage **out, ... ) ++vips_rint(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_roundv( in, out, VIPS_OPERATION_ROUND_RINT, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_roundv(in, out, VIPS_OPERATION_ROUND_RINT, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/sign.c b/libvips/arithmetic/sign.c +index 16795c6da8..1d92f3e0ed 100644 +--- a/libvips/arithmetic/sign.c ++++ b/libvips/arithmetic/sign.c +@@ -10,28 +10,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -55,69 +55,91 @@ + typedef VipsUnary VipsSign; + typedef VipsUnaryClass VipsSignClass; + +-G_DEFINE_TYPE( VipsSign, vips_sign, VIPS_TYPE_UNARY ); +- +-#define CSIGN( TYPE ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- TYPE * restrict q = (TYPE *) out; \ +- int x; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- TYPE re = p[0]; \ +- TYPE im = p[1]; \ +- double fac = sqrt( re * re + im * im ); \ +- \ +- p += 2; \ +- \ +- if( fac == 0.0 ) { \ +- q[0] = 0.0; \ +- q[1] = 0.0; \ ++G_DEFINE_TYPE(VipsSign, vips_sign, VIPS_TYPE_UNARY); ++ ++#define CSIGN(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ TYPE *restrict q = (TYPE *) out; \ ++ int x; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ TYPE re = p[0]; \ ++ TYPE im = p[1]; \ ++ double fac = sqrt(re * re + im * im); \ ++\ ++ p += 2; \ ++\ ++ if (fac == 0.0) { \ ++ q[0] = 0.0; \ ++ q[1] = 0.0; \ ++ } \ ++ else { \ ++ q[0] = re / fac; \ ++ q[1] = im / fac; \ ++ } \ ++\ ++ q += 2; \ + } \ +- else { \ +- q[0] = re / fac; \ +- q[1] = im / fac; \ +- } \ +- \ +- q += 2; \ +- } \ +-} ++ } + +-#define SIGN( TYPE ) { \ +- TYPE * restrict p = (TYPE *) in[0]; \ +- signed char * restrict q = (signed char *) out; \ +- int x; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- TYPE v = p[x]; \ +- \ +- if( v > 0 ) \ +- q[x] = 1; \ +- else if( v == 0 ) \ +- q[x] = 0; \ +- else \ +- q[x] = -1; \ +- } \ +-} ++#define SIGN(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in[0]; \ ++ signed char *restrict q = (signed char *) out; \ ++ int x; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ TYPE v = p[x]; \ ++\ ++ if (v > 0) \ ++ q[x] = 1; \ ++ else if (v == 0) \ ++ q[x] = 0; \ ++ else \ ++ q[x] = -1; \ ++ } \ ++ } + + static void +-vips_sign_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_sign_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { +- VipsUnary *unary = VIPS_UNARY( arithmetic ); +- const int bands = vips_image_get_bands( unary->in ); ++ VipsUnary *unary = VIPS_UNARY(arithmetic); ++ const int bands = vips_image_get_bands(unary->in); + int sz = width * bands; + +- switch( vips_image_get_format( unary->in ) ) { +- case VIPS_FORMAT_UCHAR: SIGN( unsigned char ); break; +- case VIPS_FORMAT_CHAR: SIGN( signed char ); break; +- case VIPS_FORMAT_USHORT: SIGN( unsigned short ); break; +- case VIPS_FORMAT_SHORT: SIGN( signed short ); break; +- case VIPS_FORMAT_UINT: SIGN( unsigned int ); break; +- case VIPS_FORMAT_INT: SIGN( signed int ); break; +- case VIPS_FORMAT_FLOAT: SIGN( float ); break; +- case VIPS_FORMAT_DOUBLE: SIGN( double ); break; +- case VIPS_FORMAT_COMPLEX: CSIGN( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: CSIGN( double ); break; ++ switch (vips_image_get_format(unary->in)) { ++ case VIPS_FORMAT_UCHAR: ++ SIGN(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ SIGN(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ SIGN(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ SIGN(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ SIGN(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ SIGN(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ SIGN(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ SIGN(double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ CSIGN(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ CSIGN(double); ++ break; + + default: + g_assert_not_reached(); +@@ -143,21 +165,21 @@ static const VipsBandFormat vips_sign_format_table[10] = { + }; + + static void +-vips_sign_class_init( VipsSignClass *class ) ++vips_sign_class_init(VipsSignClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + object_class->nickname = "sign"; +- object_class->description = _( "unit vector of pixel" ); ++ object_class->description = _("unit vector of pixel"); + + aclass->process_line = vips_sign_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_sign_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_sign_format_table); + } + + static void +-vips_sign_init( VipsSign *sign ) ++vips_sign_init(VipsSign *sign) + { + } + +@@ -177,14 +199,14 @@ vips_sign_init( VipsSign *sign ) + * Returns: 0 on success, -1 on error + */ + int +-vips_sign( VipsImage *in, VipsImage **out, ... ) ++vips_sign(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "sign", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("sign", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/statistic.c b/libvips/arithmetic/statistic.c +index 0eca6c5665..24997d269a 100644 +--- a/libvips/arithmetic/statistic.c ++++ b/libvips/arithmetic/statistic.c +@@ -10,28 +10,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -54,124 +54,123 @@ + + #include "statistic.h" + +-G_DEFINE_ABSTRACT_TYPE( VipsStatistic, vips_statistic, VIPS_TYPE_OPERATION ); ++G_DEFINE_ABSTRACT_TYPE(VipsStatistic, vips_statistic, VIPS_TYPE_OPERATION); + + static void * +-vips_statistic_scan_start( VipsImage *in, void *a, void *b ) ++vips_statistic_scan_start(VipsImage *in, void *a, void *b) + { +- VipsStatistic *statistic = VIPS_STATISTIC( a ); +- VipsStatisticClass *class = VIPS_STATISTIC_GET_CLASS( statistic ); ++ VipsStatistic *statistic = VIPS_STATISTIC(a); ++ VipsStatisticClass *class = VIPS_STATISTIC_GET_CLASS(statistic); + +- return( class->start( statistic ) ); ++ return (class->start(statistic)); + } + + static int +-vips_statistic_scan( VipsRegion *region, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_statistic_scan(VipsRegion *region, ++ void *seq, void *a, void *b, gboolean *stop) + { +- VipsStatistic *statistic = VIPS_STATISTIC( a ); +- VipsStatisticClass *class = VIPS_STATISTIC_GET_CLASS( statistic ); ++ VipsStatistic *statistic = VIPS_STATISTIC(a); ++ VipsStatisticClass *class = VIPS_STATISTIC_GET_CLASS(statistic); + + VipsRect *r = ®ion->valid; +- int lsk = VIPS_REGION_LSKIP( region ); ++ int lsk = VIPS_REGION_LSKIP(region); + + int y; + VipsPel *p; + +- VIPS_DEBUG_MSG( "vips_statistic_scan: %d x %d @ %d x %d\n", +- r->width, r->height, r->left, r->top ); ++ VIPS_DEBUG_MSG("vips_statistic_scan: %d x %d @ %d x %d\n", ++ r->width, r->height, r->left, r->top); + +- p = VIPS_REGION_ADDR( region, r->left, r->top ); +- for( y = 0; y < r->height; y++ ) { +- if( class->scan( statistic, +- seq, r->left, r->top + y, p, r->width ) ) +- return( -1 ); ++ p = VIPS_REGION_ADDR(region, r->left, r->top); ++ for (y = 0; y < r->height; y++) { ++ if (class->scan(statistic, ++ seq, r->left, r->top + y, p, r->width)) ++ return (-1); + p += lsk; +- } ++ } + + /* If we've requested stop, pass the message on. + */ +- if( statistic->stop ) ++ if (statistic->stop) + *stop = TRUE; + +- return( 0 ); ++ return (0); + } + + static int +-vips_statistic_scan_stop( void *seq, void *a, void *b ) ++vips_statistic_scan_stop(void *seq, void *a, void *b) + { +- VipsStatistic *statistic = VIPS_STATISTIC( a ); +- VipsStatisticClass *class = VIPS_STATISTIC_GET_CLASS( statistic ); ++ VipsStatistic *statistic = VIPS_STATISTIC(a); ++ VipsStatisticClass *class = VIPS_STATISTIC_GET_CLASS(statistic); + +- return( class->stop( statistic, seq ) ); ++ return (class->stop(statistic, seq)); + } + + static int +-vips_statistic_build( VipsObject *object ) ++vips_statistic_build(VipsObject *object) + { +- VipsStatistic *statistic = VIPS_STATISTIC( object ); +- VipsStatisticClass *sclass = VIPS_STATISTIC_GET_CLASS( statistic ); +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsStatistic *statistic = VIPS_STATISTIC(object); ++ VipsStatisticClass *sclass = VIPS_STATISTIC_GET_CLASS(statistic); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + + #ifdef DEBUG +- printf( "vips_statistic_build: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_statistic_build: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- if( VIPS_OBJECT_CLASS( vips_statistic_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_statistic_parent_class)->build(object)) ++ return (-1); + + statistic->ready = statistic->in; + +- if( vips_image_decode( statistic->ready, &t[0] ) ) +- return( -1 ); ++ if (vips_image_decode(statistic->ready, &t[0])) ++ return (-1); + statistic->ready = t[0]; + + /* If there's a format table, cast the input. + */ +- if( sclass->format_table ) { +- if( vips_cast( statistic->ready, &t[1], +- sclass->format_table[statistic->in->BandFmt], NULL ) ) +- return( -1 ); ++ if (sclass->format_table) { ++ if (vips_cast(statistic->ready, &t[1], ++ sclass->format_table[statistic->in->BandFmt], NULL)) ++ return (-1); + statistic->ready = t[1]; + } + +- if( vips_sink( statistic->ready, +- vips_statistic_scan_start, +- vips_statistic_scan, +- vips_statistic_scan_stop, +- statistic, NULL ) ) +- return( -1 ); ++ if (vips_sink(statistic->ready, ++ vips_statistic_scan_start, ++ vips_statistic_scan, ++ vips_statistic_scan_stop, ++ statistic, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_statistic_class_init( VipsStatisticClass *class ) ++vips_statistic_class_init(VipsStatisticClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "statistic"; +- vobject_class->description = _( "VIPS statistic operations" ); ++ vobject_class->description = _("VIPS statistic operations"); + vobject_class->build = vips_statistic_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 0, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 0, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsStatistic, in ) ); +- ++ G_STRUCT_OFFSET(VipsStatistic, in)); + } + + static void +-vips_statistic_init( VipsStatistic *statistic ) ++vips_statistic_init(VipsStatistic *statistic) + { + } +diff --git a/libvips/arithmetic/statistic.h b/libvips/arithmetic/statistic.h +index 7381031f55..e2aad14fbc 100644 +--- a/libvips/arithmetic/statistic.h ++++ b/libvips/arithmetic/statistic.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -38,27 +38,27 @@ extern "C" { + #include + + #define VIPS_TYPE_STATISTIC (vips_statistic_get_type()) +-#define VIPS_STATISTIC( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_STATISTIC, VipsStatistic )) +-#define VIPS_STATISTIC_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_STATISTIC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_STATISTIC, VipsStatistic)) ++#define VIPS_STATISTIC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_STATISTIC, VipsStatisticClass)) ++#define VIPS_IS_STATISTIC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_STATISTIC)) ++#define VIPS_IS_STATISTIC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_STATISTIC)) ++#define VIPS_STATISTIC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_STATISTIC, VipsStatisticClass)) +-#define VIPS_IS_STATISTIC( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_STATISTIC )) +-#define VIPS_IS_STATISTIC_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_STATISTIC )) +-#define VIPS_STATISTIC_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_STATISTIC, VipsStatisticClass )) + + typedef struct _VipsStatistic VipsStatistic; + typedef struct _VipsStatisticClass VipsStatisticClass; + +-typedef void *(*VipsStatisticStartFn)( VipsStatistic *statistic ); +-typedef int (*VipsStatisticScanFn)( VipsStatistic *statistic, +- void *seq, int x, int y, void *p, int n ); +-typedef int (*VipsStatisticStopFn)( VipsStatistic *statistic, void *seq ); ++typedef void *(*VipsStatisticStartFn)(VipsStatistic *statistic); ++typedef int (*VipsStatisticScanFn)(VipsStatistic *statistic, ++ void *seq, int x, int y, void *p, int n); ++typedef int (*VipsStatisticStopFn)(VipsStatistic *statistic, void *seq); + + struct _VipsStatistic { + VipsOperation parent_instance; +@@ -67,7 +67,7 @@ struct _VipsStatistic { + */ + VipsImage *in; + +- /* The input image cast and ready for processing. ++ /* The input image cast and ready for processing. + */ + VipsImage *ready; + +@@ -77,7 +77,7 @@ struct _VipsStatistic { + + /* Client data for the subclass. + */ +- void *a; ++ void *a; + void *b; + }; + +@@ -86,8 +86,8 @@ struct _VipsStatisticClass { + + /* Start/scan/stop, for vips_sink. + */ +- VipsStatisticStartFn start; +- VipsStatisticScanFn scan; ++ VipsStatisticStartFn start; ++ VipsStatisticScanFn scan; + VipsStatisticStopFn stop; + + /* For each input format, what output format. If NULL, no casting. +@@ -95,7 +95,7 @@ struct _VipsStatisticClass { + const VipsBandFormat *format_table; + }; + +-GType vips_statistic_get_type( void ); ++GType vips_statistic_get_type(void); + + #ifdef __cplusplus + } +diff --git a/libvips/arithmetic/stats.c b/libvips/arithmetic/stats.c +index f86852aa66..1b8a923119 100644 +--- a/libvips/arithmetic/stats.c ++++ b/libvips/arithmetic/stats.c +@@ -17,9 +17,9 @@ + - still did not init max and min correctly --- now fixed for good + + * 13/1/05 +- * - use 64 bit arithmetic ++ * - use 64 bit arithmetic + * 1/9/09 +- * - argh nope min/max was broken again for >1CPU in short pipelines on ++ * - argh nope min/max was broken again for >1CPU in short pipelines on + * some architectures + * 7/9/09 + * - rework based on new im__wrapscan() / im_max() ideas for a proper fix +@@ -31,28 +31,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -79,12 +79,12 @@ typedef struct _VipsStats { + + VipsImage *out; + +- gboolean set; /* FALSE means no value yet */ ++ gboolean set; /* FALSE means no value yet */ + } VipsStats; + + typedef VipsStatisticClass VipsStatsClass; + +-G_DEFINE_TYPE( VipsStats, vips_stats, VIPS_TYPE_STATISTIC ); ++G_DEFINE_TYPE(VipsStats, vips_stats, VIPS_TYPE_STATISTIC); + + /* Names for our columns. + */ +@@ -103,49 +103,49 @@ enum { + }; + + static int +-vips_stats_build( VipsObject *object ) ++vips_stats_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsStatistic *statistic = VIPS_STATISTIC( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsStatistic *statistic = VIPS_STATISTIC(object); + VipsStats *stats = (VipsStats *) object; + + gint64 vals, pels; + double *row0, *row; + int b, y, i; + +- if( vips_object_argument_isset( object, "in" ) ) { +- int bands = vips_image_get_bands( statistic->in ); ++ if (vips_object_argument_isset(object, "in")) { ++ int bands = vips_image_get_bands(statistic->in); + +- if( vips_check_noncomplex( class->nickname, statistic->in ) ) +- return( -1 ); ++ if (vips_check_noncomplex(class->nickname, statistic->in)) ++ return (-1); + +- g_object_set( object, +- "out", vips_image_new_matrix( COL_LAST, bands + 1 ), +- NULL ); ++ g_object_set(object, ++ "out", vips_image_new_matrix(COL_LAST, bands + 1), ++ NULL); + } + +- if( VIPS_OBJECT_CLASS( vips_stats_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_stats_parent_class)->build(object)) ++ return (-1); + +- pels = (gint64) vips_image_get_width( statistic->in ) * +- vips_image_get_height( statistic->in ); +- vals = pels * vips_image_get_bands( statistic->in ); ++ pels = (gint64) vips_image_get_width(statistic->in) * ++ vips_image_get_height(statistic->in); ++ vals = pels * vips_image_get_bands(statistic->in); + +- row0 = VIPS_MATRIX( stats->out, 0, 0 ); +- row = VIPS_MATRIX( stats->out, 0, 1 ); +- for( i = 0; i < COL_LAST; i++ ) ++ row0 = VIPS_MATRIX(stats->out, 0, 0); ++ row = VIPS_MATRIX(stats->out, 0, 1); ++ for (i = 0; i < COL_LAST; i++) + row0[i] = row[i]; + +- for( b = 1; b < vips_image_get_bands( statistic->in ); b++ ) { +- row = VIPS_MATRIX( stats->out, 0, b + 1 ); ++ for (b = 1; b < vips_image_get_bands(statistic->in); b++) { ++ row = VIPS_MATRIX(stats->out, 0, b + 1); + +- if( row[COL_MIN] < row0[COL_MIN] ) { ++ if (row[COL_MIN] < row0[COL_MIN]) { + row0[COL_MIN] = row[COL_MIN]; + row0[COL_XMIN] = row[COL_XMIN]; + row0[COL_YMIN] = row[COL_YMIN]; + } + +- if( row[COL_MAX] > row0[COL_MAX] ) { ++ if (row[COL_MAX] > row0[COL_MAX]) { + row0[COL_MAX] = row[COL_MAX]; + row0[COL_XMAX] = row[COL_XMAX]; + row0[COL_YMAX] = row[COL_YMAX]; +@@ -155,57 +155,59 @@ vips_stats_build( VipsObject *object ) + row0[COL_SUM2] += row[COL_SUM2]; + } + +- for( y = 1; y < vips_image_get_height( stats->out ); y++ ) { +- double *row = VIPS_MATRIX( stats->out, 0, y ); ++ for (y = 1; y < vips_image_get_height(stats->out); y++) { ++ double *row = VIPS_MATRIX(stats->out, 0, y); + + row[COL_AVG] = row[COL_SUM] / pels; +- row[COL_SD] = sqrt( VIPS_FABS( row[COL_SUM2] - +- (row[COL_SUM] * row[COL_SUM] / pels) ) / (pels - 1) ); ++ row[COL_SD] = sqrt(VIPS_FABS(row[COL_SUM2] - ++ (row[COL_SUM] * row[COL_SUM] / pels)) / ++ (pels - 1)); + } + + row0[COL_AVG] = row0[COL_SUM] / vals; +- row0[COL_SD] = sqrt( VIPS_FABS( row0[COL_SUM2] - +- (row0[COL_SUM] * row0[COL_SUM] / vals) ) / (vals - 1) ); ++ row0[COL_SD] = sqrt(VIPS_FABS(row0[COL_SUM2] - ++ (row0[COL_SUM] * row0[COL_SUM] / vals)) / ++ (vals - 1)); + +- return( 0 ); ++ return (0); + } + + /* Stop function. Add these little stats to the main set of stats. + */ + static int +-vips_stats_stop( VipsStatistic *statistic, void *seq ) ++vips_stats_stop(VipsStatistic *statistic, void *seq) + { +- int bands = vips_image_get_bands( statistic->in ); ++ int bands = vips_image_get_bands(statistic->in); + VipsStats *global = (VipsStats *) statistic; + VipsStats *local = (VipsStats *) seq; + + int b; + +- if( local->set && !global->set ) { +- for( b = 0; b < bands; b++ ) { +- double *p = VIPS_MATRIX( local->out, 0, b + 1 ); +- double *q = VIPS_MATRIX( global->out, 0, b + 1 ); ++ if (local->set && !global->set) { ++ for (b = 0; b < bands; b++) { ++ double *p = VIPS_MATRIX(local->out, 0, b + 1); ++ double *q = VIPS_MATRIX(global->out, 0, b + 1); + + int i; + +- for( i = 0; i < COL_LAST; i++ ) ++ for (i = 0; i < COL_LAST; i++) + q[i] = p[i]; + } + + global->set = TRUE; + } +- else if( local->set && global->set ) { +- for( b = 0; b < bands; b++ ) { +- double *p = VIPS_MATRIX( local->out, 0, b + 1 ); +- double *q = VIPS_MATRIX( global->out, 0, b + 1 ); ++ else if (local->set && global->set) { ++ for (b = 0; b < bands; b++) { ++ double *p = VIPS_MATRIX(local->out, 0, b + 1); ++ double *q = VIPS_MATRIX(global->out, 0, b + 1); + +- if( p[COL_MIN] < q[COL_MIN] ) { ++ if (p[COL_MIN] < q[COL_MIN]) { + q[COL_MIN] = p[COL_MIN]; + q[COL_XMIN] = p[COL_XMIN]; + q[COL_YMIN] = p[COL_YMIN]; + } + +- if( p[COL_MAX] > q[COL_MAX] ) { ++ if (p[COL_MAX] > q[COL_MAX]) { + q[COL_MAX] = p[COL_MAX]; + q[COL_XMAX] = p[COL_XMAX]; + q[COL_YMAX] = p[COL_YMAX]; +@@ -216,215 +218,233 @@ vips_stats_stop( VipsStatistic *statistic, void *seq ) + } + } + +- VIPS_FREEF( g_object_unref, local->out ); +- VIPS_FREEF( g_free, seq ); ++ VIPS_FREEF(g_object_unref, local->out); ++ VIPS_FREEF(g_free, seq); + +- return( 0 ); ++ return (0); + } + +-/* Start function: make a dummy local stats for the private use of this thread. ++/* Start function: make a dummy local stats for the private use of this thread. + */ + static void * +-vips_stats_start( VipsStatistic *statistic ) ++vips_stats_start(VipsStatistic *statistic) + { +- int bands = vips_image_get_bands( statistic->in ); ++ int bands = vips_image_get_bands(statistic->in); + + VipsStats *stats; + +- stats = g_new( VipsStats, 1 ); +- if( !(stats->out = vips_image_new_matrix( COL_LAST, bands + 1 )) ) { +- g_free( stats ); +- return( NULL ); ++ stats = g_new(VipsStats, 1); ++ if (!(stats->out = vips_image_new_matrix(COL_LAST, bands + 1))) { ++ g_free(stats); ++ return (NULL); + } + stats->set = FALSE; + +- return( (void *) stats ); ++ return ((void *) stats); + } + + /* We scan lines bands times to avoid repeating band loops. + * Use temp variables of same type for min/max for faster comparisons. + */ +-#define LOOP( TYPE ) { \ +- for( b = 0; b < bands; b++ ) { \ +- TYPE *p = ((TYPE *) in) + b; \ +- double *q = VIPS_MATRIX( local->out, 0, b + 1 ); \ +- TYPE small, big; \ +- double sum, sum2; \ +- int xmin, ymin; \ +- int xmax, ymax; \ +- \ +- if( local->set ) { \ +- small = q[COL_MIN]; \ +- big = q[COL_MAX]; \ +- sum = q[COL_SUM]; \ +- sum2 = q[COL_SUM2]; \ +- xmin = q[COL_XMIN]; \ +- ymin = q[COL_YMIN]; \ +- xmax = q[COL_XMAX]; \ +- ymax = q[COL_YMAX]; \ +- } \ +- else { \ +- small = p[0]; \ +- big = p[0]; \ +- sum = 0; \ +- sum2 = 0; \ +- xmin = x; \ +- ymin = y; \ +- xmax = x; \ +- ymax = y; \ +- } \ +- \ +- for( i = 0; i < n; i++ ) { \ +- TYPE value = *p; \ +- \ +- sum += value; \ +- sum2 += (double) value * (double) value; \ +- if( value > big ) { \ +- big = value; \ +- xmax = x + i; \ +- ymax = y; \ ++#define LOOP(TYPE) \ ++ { \ ++ for (b = 0; b < bands; b++) { \ ++ TYPE *p = ((TYPE *) in) + b; \ ++ double *q = VIPS_MATRIX(local->out, 0, b + 1); \ ++ TYPE small, big; \ ++ double sum, sum2; \ ++ int xmin, ymin; \ ++ int xmax, ymax; \ ++\ ++ if (local->set) { \ ++ small = q[COL_MIN]; \ ++ big = q[COL_MAX]; \ ++ sum = q[COL_SUM]; \ ++ sum2 = q[COL_SUM2]; \ ++ xmin = q[COL_XMIN]; \ ++ ymin = q[COL_YMIN]; \ ++ xmax = q[COL_XMAX]; \ ++ ymax = q[COL_YMAX]; \ + } \ +- else if( value < small ) { \ +- small = value; \ +- xmin = x + i; \ ++ else { \ ++ small = p[0]; \ ++ big = p[0]; \ ++ sum = 0; \ ++ sum2 = 0; \ ++ xmin = x; \ + ymin = y; \ ++ xmax = x; \ ++ ymax = y; \ ++ } \ ++\ ++ for (i = 0; i < n; i++) { \ ++ TYPE value = *p; \ ++\ ++ sum += value; \ ++ sum2 += (double) value * (double) value; \ ++ if (value > big) { \ ++ big = value; \ ++ xmax = x + i; \ ++ ymax = y; \ ++ } \ ++ else if (value < small) { \ ++ small = value; \ ++ xmin = x + i; \ ++ ymin = y; \ ++ } \ ++\ ++ p += bands; \ + } \ +- \ +- p += bands; \ ++\ ++ q[COL_MIN] = small; \ ++ q[COL_MAX] = big; \ ++ q[COL_SUM] = sum; \ ++ q[COL_SUM2] = sum2; \ ++ q[COL_XMIN] = xmin; \ ++ q[COL_YMIN] = ymin; \ ++ q[COL_XMAX] = xmax; \ ++ q[COL_YMAX] = ymax; \ + } \ +- \ +- q[COL_MIN] = small; \ +- q[COL_MAX] = big; \ +- q[COL_SUM] = sum; \ +- q[COL_SUM2] = sum2; \ +- q[COL_XMIN] = xmin; \ +- q[COL_YMIN] = ymin; \ +- q[COL_XMAX] = xmax; \ +- q[COL_YMAX] = ymax; \ +- } \ +- \ +- local->set = TRUE; \ +-} ++\ ++ local->set = TRUE; \ ++ } + + /* As above, but for float/double types where we have to avoid NaN. + */ +-#define LOOPF( TYPE ) { \ +- for( b = 0; b < bands; b++ ) { \ +- TYPE *p = ((TYPE *) in) + b; \ +- double *q = VIPS_MATRIX( local->out, 0, b + 1 ); \ +- TYPE small, big; \ +- double sum, sum2; \ +- int xmin, ymin; \ +- int xmax, ymax; \ +- \ +- if( local->set ) { \ +- small = q[COL_MIN]; \ +- big = q[COL_MAX]; \ +- sum = q[COL_SUM]; \ +- sum2 = q[COL_SUM2]; \ +- xmin = q[COL_XMIN]; \ +- ymin = q[COL_YMIN]; \ +- xmax = q[COL_XMAX]; \ +- ymax = q[COL_YMAX]; \ +- } \ +- else { \ +- small = p[0]; \ +- big = p[0]; \ +- sum = 0; \ +- sum2 = 0; \ +- xmin = x; \ +- ymin = y; \ +- xmax = x; \ +- ymax = y; \ +- } \ +- \ +- for( i = 0; i < n; i++ ) { \ +- TYPE value = *p; \ +- \ +- sum += value; \ +- sum2 += (double) value * (double) value; \ +- if( value > big ) { \ +- big = value; \ +- xmax = x + i; \ +- ymax = y; \ ++#define LOOPF(TYPE) \ ++ { \ ++ for (b = 0; b < bands; b++) { \ ++ TYPE *p = ((TYPE *) in) + b; \ ++ double *q = VIPS_MATRIX(local->out, 0, b + 1); \ ++ TYPE small, big; \ ++ double sum, sum2; \ ++ int xmin, ymin; \ ++ int xmax, ymax; \ ++\ ++ if (local->set) { \ ++ small = q[COL_MIN]; \ ++ big = q[COL_MAX]; \ ++ sum = q[COL_SUM]; \ ++ sum2 = q[COL_SUM2]; \ ++ xmin = q[COL_XMIN]; \ ++ ymin = q[COL_YMIN]; \ ++ xmax = q[COL_XMAX]; \ ++ ymax = q[COL_YMAX]; \ + } \ +- else if( value < small ) { \ +- small = value; \ +- xmin = x + i; \ ++ else { \ ++ small = p[0]; \ ++ big = p[0]; \ ++ sum = 0; \ ++ sum2 = 0; \ ++ xmin = x; \ + ymin = y; \ ++ xmax = x; \ ++ ymax = y; \ ++ } \ ++\ ++ for (i = 0; i < n; i++) { \ ++ TYPE value = *p; \ ++\ ++ sum += value; \ ++ sum2 += (double) value * (double) value; \ ++ if (value > big) { \ ++ big = value; \ ++ xmax = x + i; \ ++ ymax = y; \ ++ } \ ++ else if (value < small) { \ ++ small = value; \ ++ xmin = x + i; \ ++ ymin = y; \ ++ } \ ++\ ++ p += bands; \ + } \ +- \ +- p += bands; \ ++\ ++ q[COL_MIN] = small; \ ++ q[COL_MAX] = big; \ ++ q[COL_SUM] = sum; \ ++ q[COL_SUM2] = sum2; \ ++ q[COL_XMIN] = xmin; \ ++ q[COL_YMIN] = ymin; \ ++ q[COL_XMAX] = xmax; \ ++ q[COL_YMAX] = ymax; \ + } \ +- \ +- q[COL_MIN] = small; \ +- q[COL_MAX] = big; \ +- q[COL_SUM] = sum; \ +- q[COL_SUM2] = sum2; \ +- q[COL_XMIN] = xmin; \ +- q[COL_YMIN] = ymin; \ +- q[COL_XMAX] = xmax; \ +- q[COL_YMAX] = ymax; \ +- } \ +- \ +- local->set = TRUE; \ +-} ++\ ++ local->set = TRUE; \ ++ } + + /* Loop over region, accumulating a sum in *tmp. + */ + static int +-vips_stats_scan( VipsStatistic *statistic, void *seq, +- int x, int y, void *in, int n ) ++vips_stats_scan(VipsStatistic *statistic, void *seq, ++ int x, int y, void *in, int n) + { +- const int bands = vips_image_get_bands( statistic->in ); ++ const int bands = vips_image_get_bands(statistic->in); + VipsStats *local = (VipsStats *) seq; + + int b, i; + +- switch( vips_image_get_format( statistic->in ) ) { +- case VIPS_FORMAT_UCHAR: LOOP( unsigned char ); break; +- case VIPS_FORMAT_CHAR: LOOP( signed char ); break; +- case VIPS_FORMAT_USHORT: LOOP( unsigned short ); break; +- case VIPS_FORMAT_SHORT: LOOP( signed short ); break; +- case VIPS_FORMAT_UINT: LOOP( unsigned int ); break; +- case VIPS_FORMAT_INT: LOOP( signed int ); break; +- case VIPS_FORMAT_FLOAT: LOOP( float ); break; +- case VIPS_FORMAT_DOUBLE: LOOP( double ); break; +- +- default: ++ switch (vips_image_get_format(statistic->in)) { ++ case VIPS_FORMAT_UCHAR: ++ LOOP(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ LOOP(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ LOOP(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ LOOP(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ LOOP(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ LOOP(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ LOOP(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ LOOP(double); ++ break; ++ ++ default: + g_assert_not_reached(); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_stats_class_init( VipsStatsClass *class ) ++vips_stats_class_init(VipsStatsClass *class) + { + GObjectClass *gobject_class = (GObjectClass *) class; + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS( class ); ++ VipsStatisticClass *sclass = VIPS_STATISTIC_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "stats"; +- object_class->description = _( "find many image stats" ); ++ object_class->description = _("find many image stats"); + object_class->build = vips_stats_build; + + sclass->start = vips_stats_start; + sclass->scan = vips_stats_scan; + sclass->stop = vips_stats_stop; + +- VIPS_ARG_IMAGE( class, "out", 100, +- _( "Output" ), +- _( "Output array of statistics" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsStats, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 100, ++ _("Output"), ++ _("Output array of statistics"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsStats, out)); + } + + static void +-vips_stats_init( VipsStats *stats ) ++vips_stats_init(VipsStats *stats) + { + } + +@@ -435,32 +455,32 @@ vips_stats_init( VipsStats *stats ) + * @...: %NULL-terminated list of optional named arguments + * + * Find many image statistics in a single pass through the data. @out is a +- * one-band #VIPS_FORMAT_DOUBLE image of at least 10 columns by n + 1 +- * (where n is number of bands in image @in) +- * rows. Columns are statistics, and are, in order: minimum, maximum, sum, ++ * one-band #VIPS_FORMAT_DOUBLE image of at least 10 columns by n + 1 ++ * (where n is number of bands in image @in) ++ * rows. Columns are statistics, and are, in order: minimum, maximum, sum, + * sum of squares, mean, standard deviation, x coordinate of minimum, y +- * coordinate of minimum, x coordinate of maximum, y coordinate of maximum. ++ * coordinate of minimum, x coordinate of maximum, y coordinate of maximum. + * Later versions of vips_stats() may add more columns. + * +- * Row 0 has statistics for all ++ * Row 0 has statistics for all + * bands together, row 1 has stats for band 1, and so on. + * +- * If there is more than one maxima or minima, one of them will be chosen at +- * random. ++ * If there is more than one maxima or minima, one of them will be chosen at ++ * random. + * + * See also: vips_avg(), vips_min(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_stats( VipsImage *in, VipsImage **out, ... ) ++vips_stats(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "stats", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("stats", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/subtract.c b/libvips/arithmetic/subtract.c +index 3809077171..21569338c1 100644 +--- a/libvips/arithmetic/subtract.c ++++ b/libvips/arithmetic/subtract.c +@@ -4,7 +4,7 @@ + * + * Author: Nicos Dessipris + * Written on: 02/05/1990 +- * Modified on: ++ * Modified on: + * 29/4/93 J.Cupitt + * - now works for partial images + * 1/7/93 JC +@@ -35,28 +35,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -80,55 +80,67 @@ + typedef VipsBinary VipsSubtract; + typedef VipsBinaryClass VipsSubtractClass; + +-G_DEFINE_TYPE( VipsSubtract, vips_subtract, VIPS_TYPE_BINARY ); ++G_DEFINE_TYPE(VipsSubtract, vips_subtract, VIPS_TYPE_BINARY); + +-#define LOOP( IN, OUT ) { \ +- IN * restrict left = (IN *) in[0]; \ +- IN * restrict right = (IN *) in[1]; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = left[x] - right[x]; \ +-} ++#define LOOP(IN, OUT) \ ++ { \ ++ IN *restrict left = (IN *) in[0]; \ ++ IN *restrict right = (IN *) in[1]; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = left[x] - right[x]; \ ++ } + + static void +-vips_subtract_buffer( VipsArithmetic *arithmetic, +- VipsPel *out, VipsPel **in, int width ) ++vips_subtract_buffer(VipsArithmetic *arithmetic, ++ VipsPel *out, VipsPel **in, int width) + { + VipsImage *im = arithmetic->ready[0]; + + /* Complex just doubles the size. + */ +- const int sz = width * vips_image_get_bands( im ) * +- (vips_band_format_iscomplex( vips_image_get_format( im ) ) ? +- 2 : 1); ++ const int sz = width * vips_image_get_bands(im) * ++ (vips_band_format_iscomplex(vips_image_get_format(im)) ? 2 : 1); + + int x; + +- /* Keep types here in sync with bandfmt_subtract[] ++ /* Keep types here in sync with bandfmt_subtract[] + * below. +- */ +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_CHAR: LOOP( signed char, signed short ); break; +- case VIPS_FORMAT_UCHAR: LOOP( unsigned char, signed short ); break; +- case VIPS_FORMAT_SHORT: LOOP( signed short, signed int ); break; +- case VIPS_FORMAT_USHORT:LOOP( unsigned short, signed int ); break; +- case VIPS_FORMAT_INT: LOOP( signed int, signed int ); break; +- case VIPS_FORMAT_UINT: LOOP( unsigned int, signed int ); break; +- +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- LOOP( float, float ); +- break; +- +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- LOOP( double, double ); ++ */ ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_CHAR: ++ LOOP(signed char, signed short); ++ break; ++ case VIPS_FORMAT_UCHAR: ++ LOOP(unsigned char, signed short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ LOOP(signed short, signed int); ++ break; ++ case VIPS_FORMAT_USHORT: ++ LOOP(unsigned short, signed int); ++ break; ++ case VIPS_FORMAT_INT: ++ LOOP(signed int, signed int); ++ break; ++ case VIPS_FORMAT_UINT: ++ LOOP(unsigned int, signed int); ++ break; ++ ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ LOOP(float, float); ++ break; ++ ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ LOOP(double, double); + break; + +- default: ++ default: + g_assert_not_reached(); +- } ++ } + } + + /* Save a bit of typing. +@@ -153,44 +165,44 @@ static const VipsBandFormat vips_subtract_format_table[10] = { + }; + + static void +-vips_subtract_class_init( VipsSubtractClass *class ) ++vips_subtract_class_init(VipsSubtractClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + object_class->nickname = "subtract"; +- object_class->description = _( "subtract two images" ); ++ object_class->description = _("subtract two images"); + + aclass->process_line = vips_subtract_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_subtract_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_subtract_format_table); + } + + static void +-vips_subtract_init( VipsSubtract *subtract ) ++vips_subtract_init(VipsSubtract *subtract) + { + } + + /** + * vips_subtract: +- * @in1: input image +- * @in2: input image ++ * @in1: input image ++ * @in2: input image + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * This operation calculates @in1 - @in2 and writes the result to @out. ++ * This operation calculates @in1 - @in2 and writes the result to @out. + * + * If the images differ in size, the smaller image is enlarged to match the + * larger by adding zero pixels along the bottom and right. + * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +- * The two input images are cast up to the smallest common format (see table +- * Smallest common format in +- * arithmetic), then the ++ * The two input images are cast up to the smallest common format (see table ++ * Smallest common format in ++ * arithmetic), then the + * following table is used to determine the output type: + * + *
+@@ -255,14 +267,14 @@ vips_subtract_init( VipsSubtract *subtract ) + * Returns: 0 on success, -1 on error + */ + int +-vips_subtract( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_subtract(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "subtract", ap, left, right, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("subtract", ap, left, right, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/sum.c b/libvips/arithmetic/sum.c +index 0f6c113a50..054e9d7f9c 100644 +--- a/libvips/arithmetic/sum.c ++++ b/libvips/arithmetic/sum.c +@@ -6,28 +6,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,61 +51,69 @@ + typedef VipsNary VipsSum; + typedef VipsNaryClass VipsSumClass; + +-G_DEFINE_TYPE( VipsSum, vips_sum, VIPS_TYPE_NARY ); +- +-#define LOOP( IN, OUT ) { \ +- IN ** restrict p = (IN **) in; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- OUT sum; \ +- \ +- sum = p[0][x]; \ +- for( i = 1; i < n; i++ ) \ +- sum += p[i][x]; \ +- q[x] = sum; \ +- } \ +-} ++G_DEFINE_TYPE(VipsSum, vips_sum, VIPS_TYPE_NARY); ++ ++#define LOOP(IN, OUT) \ ++ { \ ++ IN **restrict p = (IN **) in; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ OUT sum; \ ++\ ++ sum = p[0][x]; \ ++ for (i = 1; i < n; i++) \ ++ sum += p[i][x]; \ ++ q[x] = sum; \ ++ } \ ++ } + + static void +-sum_buffer( VipsArithmetic *arithmetic, VipsPel *out, VipsPel **in, int width ) ++sum_buffer(VipsArithmetic *arithmetic, VipsPel *out, VipsPel **in, int width) + { + VipsImage *im = arithmetic->ready[0]; +- int n = arithmetic->n; ++ int n = arithmetic->n; + + /* Complex just doubles the size. + */ +- const int sz = width * vips_image_get_bands( im ) * +- (vips_band_format_iscomplex( vips_image_get_format( im ) ) ? +- 2 : 1); ++ const int sz = width * vips_image_get_bands(im) * ++ (vips_band_format_iscomplex(vips_image_get_format(im)) ? 2 : 1); + + int x; + int i; + +- /* Sum all input types. Keep types here in sync with ++ /* Sum all input types. Keep types here in sync with + * vips_sum_format_table[] below. + */ +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_UCHAR: +- LOOP( unsigned char, unsigned int ); break; +- case VIPS_FORMAT_CHAR: +- LOOP( signed char, signed int ); break; +- case VIPS_FORMAT_USHORT: +- LOOP( unsigned short, unsigned int ); break; +- case VIPS_FORMAT_SHORT: +- LOOP( signed short, signed int ); break; +- case VIPS_FORMAT_UINT: +- LOOP( unsigned int, unsigned int ); break; +- case VIPS_FORMAT_INT: +- LOOP( signed int, signed int ); break; +- +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- LOOP( float, float ); break; +- +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- LOOP( double, double ); break; ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_UCHAR: ++ LOOP(unsigned char, unsigned int); ++ break; ++ case VIPS_FORMAT_CHAR: ++ LOOP(signed char, signed int); ++ break; ++ case VIPS_FORMAT_USHORT: ++ LOOP(unsigned short, unsigned int); ++ break; ++ case VIPS_FORMAT_SHORT: ++ LOOP(signed short, signed int); ++ break; ++ case VIPS_FORMAT_UINT: ++ LOOP(unsigned int, unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ LOOP(signed int, signed int); ++ break; ++ ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ LOOP(float, float); ++ break; ++ ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ LOOP(double, double); ++ break; + + default: + g_assert_not_reached(); +@@ -132,35 +140,35 @@ static const VipsBandFormat vips_sum_format_table[10] = { + }; + + static void +-vips_sum_class_init( VipsSumClass *class ) ++vips_sum_class_init(VipsSumClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS( class ); ++ VipsArithmeticClass *aclass = VIPS_ARITHMETIC_CLASS(class); + + object_class->nickname = "sum"; +- object_class->description = _( "sum an array of images" ); ++ object_class->description = _("sum an array of images"); + + aclass->process_line = sum_buffer; + +- vips_arithmetic_set_format_table( aclass, vips_sum_format_table ); ++ vips_arithmetic_set_format_table(aclass, vips_sum_format_table); + } + + static void +-vips_sum_init( VipsSum *sum ) ++vips_sum_init(VipsSum *sum) + { + } + + static int +-vips_sumv( VipsImage **in, VipsImage **out, int n, va_list ap ) ++vips_sumv(VipsImage **in, VipsImage **out, int n, va_list ap) + { +- VipsArrayImage *array; ++ VipsArrayImage *array; + int result; + +- array = vips_array_image_new( in, n ); +- result = vips_call_split( "sum", ap, array, out ); +- vips_area_unref( VIPS_AREA( array ) ); ++ array = vips_array_image_new(in, n); ++ result = vips_call_split("sum", ap, array, out); ++ vips_area_unref(VIPS_AREA(array)); + +- return( result ); ++ return (result); + } + + /** +@@ -170,19 +178,19 @@ vips_sumv( VipsImage **in, VipsImage **out, int n, va_list ap ) + * @n: number of input images + * @...: %NULL-terminated list of optional named arguments + * +- * This operation sums all images in @in and writes the result to @out. ++ * This operation sums all images in @in and writes the result to @out. + * + * If the images differ in size, the smaller images are enlarged to match the + * largest by adding zero pixels along the bottom and right. + * + * If the number of bands differs, all but one of the images +- * must have one band. In this case, n-band images are formed from the ++ * must have one band. In this case, n-band images are formed from the + * one-band images by joining n copies of the one-band images together, and then + * the n-band images are operated upon. + * +- * The input images are cast up to the smallest common format (see table +- * Smallest common format in +- * arithmetic), then the ++ * The input images are cast up to the smallest common format (see table ++ * Smallest common format in ++ * arithmetic), then the + * following table is used to determine the output type: + * + *
+@@ -247,14 +255,14 @@ vips_sumv( VipsImage **in, VipsImage **out, int n, va_list ap ) + * Returns: 0 on success, -1 on error + */ + int +-vips_sum( VipsImage **in, VipsImage **out, int n, ... ) ++vips_sum(VipsImage **in, VipsImage **out, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_sumv( in, out, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_sumv(in, out, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/arithmetic/unary.c b/libvips/arithmetic/unary.c +index 4ee3c9bf3d..73aa8488cb 100644 +--- a/libvips/arithmetic/unary.c ++++ b/libvips/arithmetic/unary.c +@@ -6,28 +6,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -48,52 +48,51 @@ + + #include "unary.h" + +-G_DEFINE_ABSTRACT_TYPE( VipsUnary, vips_unary, VIPS_TYPE_ARITHMETIC ); ++G_DEFINE_ABSTRACT_TYPE(VipsUnary, vips_unary, VIPS_TYPE_ARITHMETIC); + + static int +-vips_unary_build( VipsObject *object ) ++vips_unary_build(VipsObject *object) + { +- VipsArithmetic *arithmetic = VIPS_ARITHMETIC( object ); +- VipsUnary *unary = VIPS_UNARY( object ); ++ VipsArithmetic *arithmetic = VIPS_ARITHMETIC(object); ++ VipsUnary *unary = VIPS_UNARY(object); + + arithmetic->n = 1; +- arithmetic->in = (VipsImage **) vips_object_local_array( object, 1 ); ++ arithmetic->in = (VipsImage **) vips_object_local_array(object, 1); + arithmetic->in[0] = unary->in; +- if( arithmetic->in[0] ) +- g_object_ref( arithmetic->in[0] ); ++ if (arithmetic->in[0]) ++ g_object_ref(arithmetic->in[0]); + +- if( VIPS_OBJECT_CLASS( vips_unary_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_unary_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_unary_class_init( VipsUnaryClass *class ) ++vips_unary_class_init(VipsUnaryClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "unary"; +- vobject_class->description = _( "unary operations" ); ++ vobject_class->description = _("unary operations"); + vobject_class->build = vips_unary_build; + + /* Create properties. + */ + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsUnary, in ) ); +- ++ G_STRUCT_OFFSET(VipsUnary, in)); + } + + static void +-vips_unary_init( VipsUnary *unary ) ++vips_unary_init(VipsUnary *unary) + { + /* Init our instance fields. + */ +@@ -103,16 +102,16 @@ vips_unary_init( VipsUnary *unary ) + * copy. + */ + int +-vips_unary_copy( VipsUnary *unary ) ++vips_unary_copy(VipsUnary *unary) + { +- VipsArithmetic *arithmetic = VIPS_ARITHMETIC( unary ); ++ VipsArithmetic *arithmetic = VIPS_ARITHMETIC(unary); + + /* This isn't set by arith until build(), so we have to set + * again here. + * + * Should arith set out in _init()? + */ +- g_object_set( unary, "out", vips_image_new(), NULL ); ++ g_object_set(unary, "out", vips_image_new(), NULL); + +- return( vips_image_write( unary->in, arithmetic->out ) ); ++ return (vips_image_write(unary->in, arithmetic->out)); + } +diff --git a/libvips/arithmetic/unary.h b/libvips/arithmetic/unary.h +index ce3850bf8f..783d803c12 100644 +--- a/libvips/arithmetic/unary.h ++++ b/libvips/arithmetic/unary.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -38,16 +38,16 @@ extern "C" { + #include "parithmetic.h" + + #define VIPS_TYPE_UNARY (vips_unary_get_type()) +-#define VIPS_UNARY( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), VIPS_TYPE_UNARY, VipsUnary )) +-#define VIPS_UNARY_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), VIPS_TYPE_UNARY, VipsUnaryClass)) +-#define VIPS_IS_UNARY( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_UNARY )) +-#define VIPS_IS_UNARY_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_UNARY )) +-#define VIPS_UNARY_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), VIPS_TYPE_UNARY, VipsUnaryClass )) ++#define VIPS_UNARY(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), VIPS_TYPE_UNARY, VipsUnary)) ++#define VIPS_UNARY_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), VIPS_TYPE_UNARY, VipsUnaryClass)) ++#define VIPS_IS_UNARY(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_UNARY)) ++#define VIPS_IS_UNARY_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_UNARY)) ++#define VIPS_UNARY_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), VIPS_TYPE_UNARY, VipsUnaryClass)) + + typedef struct _VipsUnary { + VipsArithmetic parent_instance; +@@ -58,14 +58,12 @@ typedef struct _VipsUnary { + + typedef VipsArithmeticClass VipsUnaryClass; + +-GType vips_unary_get_type( void ); ++GType vips_unary_get_type(void); + +-int vips_unary_copy( VipsUnary *unary ); ++int vips_unary_copy(VipsUnary *unary); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_UNARY_H*/ +- +- +diff --git a/libvips/arithmetic/unaryconst.c b/libvips/arithmetic/unaryconst.c +index 079d1a75ba..8010a4e4c7 100644 +--- a/libvips/arithmetic/unaryconst.c ++++ b/libvips/arithmetic/unaryconst.c +@@ -8,28 +8,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -50,13 +50,13 @@ + + #include "unaryconst.h" + +-G_DEFINE_ABSTRACT_TYPE( VipsUnaryConst, vips_unary_const, VIPS_TYPE_UNARY ); ++G_DEFINE_ABSTRACT_TYPE(VipsUnaryConst, vips_unary_const, VIPS_TYPE_UNARY); + + static int +-vips_unary_const_build( VipsObject *object ) ++vips_unary_const_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsArithmetic *arithmetic = VIPS_ARITHMETIC( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsArithmetic *arithmetic = VIPS_ARITHMETIC(object); + VipsUnary *unary = (VipsUnary *) object; + VipsUnaryConst *uconst = (VipsUnaryConst *) object; + +@@ -64,17 +64,17 @@ vips_unary_const_build( VipsObject *object ) + * match. + */ + uconst->n = 1; +- if( uconst->c ) +- uconst->n = VIPS_MAX( uconst->n, uconst->c->n ); +- if( unary->in ) +- uconst->n = VIPS_MAX( uconst->n, unary->in->Bands ); ++ if (uconst->c) ++ uconst->n = VIPS_MAX(uconst->n, uconst->c->n); ++ if (unary->in) ++ uconst->n = VIPS_MAX(uconst->n, unary->in->Bands); + arithmetic->base_bands = uconst->n; + +- if( unary->in && +- uconst->c ) { +- if( vips_check_vector( class->nickname, +- uconst->c->n, unary->in ) ) +- return( -1 ); ++ if (unary->in && ++ uconst->c) { ++ if (vips_check_vector(class->nickname, ++ uconst->c->n, unary->in)) ++ return (-1); + } + + /* Some operations need int constants, for example boolean AND, SHIFT +@@ -87,67 +87,66 @@ vips_unary_const_build( VipsObject *object ) + * For complex images, we double the vector length and set the + * imaginary part to 0. + */ +- if( uconst->c ) { +- gboolean is_complex = +- vips_band_format_iscomplex( unary->in->BandFmt ); ++ if (uconst->c) { ++ gboolean is_complex = ++ vips_band_format_iscomplex(unary->in->BandFmt); + int step = is_complex ? 2 : 1; + int n = step * uconst->n; + double *c = (double *) uconst->c->data; + + int i; + +- uconst->c_int = VIPS_ARRAY( object, n, int ); +- uconst->c_double = VIPS_ARRAY( object, n, double ); +- if( !uconst->c_int || +- !uconst->c_double ) +- return( -1 ); +- memset( uconst->c_int, 0, n * sizeof( int ) ); +- memset( uconst->c_double, 0, n * sizeof( double ) ); ++ uconst->c_int = VIPS_ARRAY(object, n, int); ++ uconst->c_double = VIPS_ARRAY(object, n, double); ++ if (!uconst->c_int || ++ !uconst->c_double) ++ return (-1); ++ memset(uconst->c_int, 0, n * sizeof(int)); ++ memset(uconst->c_double, 0, n * sizeof(double)); + +- for( i = 0; i < n; i += step ) +- uconst->c_double[i] = +- c[VIPS_MIN( i / step, uconst->c->n - 1)]; ++ for (i = 0; i < n; i += step) ++ uconst->c_double[i] = ++ c[VIPS_MIN(i / step, uconst->c->n - 1)]; + +- for( i = 0; i < n; i += step ) ++ for (i = 0; i < n; i += step) + uconst->c_int[i] = uconst->c_double[i]; +- ++ + uconst->is_int = TRUE; +- for( i = 0; i < n; i += step ) +- if( uconst->c_int[i] != uconst->c_double[i] ) { ++ for (i = 0; i < n; i += step) ++ if (uconst->c_int[i] != uconst->c_double[i]) { + uconst->is_int = FALSE; + break; + } + } + +- if( VIPS_OBJECT_CLASS( vips_unary_const_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_unary_const_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_unary_const_class_init( VipsUnaryConstClass *class ) ++vips_unary_const_class_init(VipsUnaryConstClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "unary_const"; +- object_class->description = _( "unary operations with a constant" ); ++ object_class->description = _("unary operations with a constant"); + object_class->build = vips_unary_const_build; + +- VIPS_ARG_BOXED( class, "c", 201, +- _( "c" ), +- _( "Array of constants" ), ++ VIPS_ARG_BOXED(class, "c", 201, ++ _("c"), ++ _("Array of constants"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsUnaryConst, c ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsUnaryConst, c), ++ VIPS_TYPE_ARRAY_DOUBLE); + } + + static void +-vips_unary_const_init( VipsUnaryConst *uconst ) ++vips_unary_const_init(VipsUnaryConst *uconst) + { + } +diff --git a/libvips/arithmetic/unaryconst.h b/libvips/arithmetic/unaryconst.h +index b2c26135a5..865c4cacfb 100644 +--- a/libvips/arithmetic/unaryconst.h ++++ b/libvips/arithmetic/unaryconst.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -38,19 +38,19 @@ extern "C" { + #include "unary.h" + + #define VIPS_TYPE_UNARY_CONST (vips_unary_const_get_type()) +-#define VIPS_UNARY_CONST( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_UNARY_CONST, VipsUnaryConst )) +-#define VIPS_UNARY_CONST_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_UNARY_CONST(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_UNARY_CONST, VipsUnaryConst)) ++#define VIPS_UNARY_CONST_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_UNARY_CONST, VipsUnaryConstClass)) ++#define VIPS_IS_UNARY_CONST(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_UNARY_CONST)) ++#define VIPS_IS_UNARY_CONST_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_UNARY_CONST)) ++#define VIPS_UNARY_CONST_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_UNARY_CONST, VipsUnaryConstClass)) +-#define VIPS_IS_UNARY_CONST( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_UNARY_CONST )) +-#define VIPS_IS_UNARY_CONST_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_UNARY_CONST )) +-#define VIPS_UNARY_CONST_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_UNARY_CONST, VipsUnaryConstClass )) + + typedef struct _VipsUnaryConst { + VipsUnary parent_instance; +@@ -76,12 +76,10 @@ typedef struct _VipsUnaryConstClass { + + } VipsUnaryConstClass; + +-GType vips_unary_const_get_type( void ); ++GType vips_unary_const_get_type(void); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_UNARY_CONST_H*/ +- +- +diff --git a/libvips/colour/CMYK2XYZ.c b/libvips/colour/CMYK2XYZ.c +index 6bbe8e6fff..0a1d5803eb 100644 +--- a/libvips/colour/CMYK2XYZ.c ++++ b/libvips/colour/CMYK2XYZ.c +@@ -7,28 +7,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -58,74 +58,74 @@ typedef struct _VipsCMYK2XYZ { + + typedef VipsColourCodeClass VipsCMYK2XYZClass; + +-G_DEFINE_TYPE( VipsCMYK2XYZ, vips_CMYK2XYZ, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsCMYK2XYZ, vips_CMYK2XYZ, VIPS_TYPE_OPERATION); + + /* Our actual processing, as a VipsColourTransformFn. + */ + static int +-vips_CMYK2XYZ_process( VipsImage *in, VipsImage **out, ... ) ++vips_CMYK2XYZ_process(VipsImage *in, VipsImage **out, ...) + { +- return( vips_icc_import( in, out, ++ return (vips_icc_import(in, out, + "embedded", TRUE, + "pcs", VIPS_PCS_XYZ, +- NULL ) ); ++ NULL)); + } + + static int +-vips_CMYK2XYZ_build( VipsObject *object ) ++vips_CMYK2XYZ_build(VipsObject *object) + { + VipsCMYK2XYZ *CMYK2XYZ = (VipsCMYK2XYZ *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + +- VipsImage *out; ++ VipsImage *out; + +- if( VIPS_OBJECT_CLASS( vips_CMYK2XYZ_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_CMYK2XYZ_parent_class)->build(object)) ++ return (-1); + + out = vips_image_new(); +- g_object_set( object, "out", out, NULL ); ++ g_object_set(object, "out", out, NULL); + +- if( vips_copy( CMYK2XYZ->in, &t[0], NULL ) || +- vips__profile_set( t[0], "cmyk" ) || +- vips__colourspace_process_n( "CMYK2XYZ", +- t[0], &t[1], 4, vips_CMYK2XYZ_process ) || +- vips_image_write( t[1], out ) ) +- return( -1 ); ++ if (vips_copy(CMYK2XYZ->in, &t[0], NULL) || ++ vips__profile_set(t[0], "cmyk") || ++ vips__colourspace_process_n("CMYK2XYZ", ++ t[0], &t[1], 4, vips_CMYK2XYZ_process) || ++ vips_image_write(t[1], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_CMYK2XYZ_class_init( VipsCMYK2XYZClass *class ) ++vips_CMYK2XYZ_class_init(VipsCMYK2XYZClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "CMYK2XYZ"; +- object_class->description = _( "transform CMYK to XYZ" ); ++ object_class->description = _("transform CMYK to XYZ"); + + object_class->build = vips_CMYK2XYZ_build; + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsCMYK2XYZ, in ) ); ++ G_STRUCT_OFFSET(VipsCMYK2XYZ, in)); + +- VIPS_ARG_IMAGE( class, "out", 100, +- _( "Output" ), +- _( "Output image" ), ++ VIPS_ARG_IMAGE(class, "out", 100, ++ _("Output"), ++ _("Output image"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsCMYK2XYZ, out ) ); ++ G_STRUCT_OFFSET(VipsCMYK2XYZ, out)); + } + + static void +-vips_CMYK2XYZ_init( VipsCMYK2XYZ *CMYK2XYZ ) ++vips_CMYK2XYZ_init(VipsCMYK2XYZ *CMYK2XYZ) + { + } + +@@ -137,14 +137,14 @@ typedef VipsColourCodeClass VipsCMYK2XYZClass; + G_DEFINE_TYPE(VipsCMYK2XYZ, vips_CMYK2XYZ, VIPS_TYPE_COLOUR_CODE); + + void +-vips_CMYK2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_CMYK2XYZ_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { + unsigned char *p = (unsigned char *) in[0]; + float *q = (float *) out; + + int i; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + float c = p[0] / 255.0; + float m = p[1] / 255.0; + float y = p[2] / 255.0; +@@ -164,26 +164,26 @@ vips_CMYK2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static void +-vips_CMYK2XYZ_class_init( VipsCMYK2XYZClass *class ) ++vips_CMYK2XYZ_class_init(VipsCMYK2XYZClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "CMYK2XYZ"; +- object_class->description = _( "transform CMYK to XYZ" ); +- ++ object_class->description = _("transform CMYK to XYZ"); ++ + colour_class->process_line = vips_CMYK2XYZ_line; + } + + static void +-vips_CMYK2XYZ_init( VipsCMYK2XYZ *CMYK2XYZ ) ++vips_CMYK2XYZ_init(VipsCMYK2XYZ *CMYK2XYZ) + { +- VipsColour *colour = VIPS_COLOUR( CMYK2XYZ ); +- VipsColourCode *code = VIPS_COLOUR_CODE( CMYK2XYZ ); ++ VipsColour *colour = VIPS_COLOUR(CMYK2XYZ); ++ VipsColourCode *code = VIPS_COLOUR_CODE(CMYK2XYZ); + + colour->interpretation = VIPS_INTERPRETATION_XYZ; + colour->format = VIPS_FORMAT_FLOAT; +@@ -205,22 +205,22 @@ vips_CMYK2XYZ_init( VipsCMYK2XYZ *CMYK2XYZ ) + * + * Turn CMYK to XYZ. If the image has an embedded ICC profile this will be + * used for the conversion. If there is no embedded profile, a generic +- * fallback profile will be used. ++ * fallback profile will be used. + * +- * Conversion is to D65 XYZ with relative intent. If you need more control ++ * Conversion is to D65 XYZ with relative intent. If you need more control + * over the process, use vips_icc_import() instead. + * + * Returns: 0 on success, -1 on error + */ + int +-vips_CMYK2XYZ( VipsImage *in, VipsImage **out, ... ) ++vips_CMYK2XYZ(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "CMYK2XYZ", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("CMYK2XYZ", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/HSV2sRGB.c b/libvips/colour/HSV2sRGB.c +index df4535fcf5..2631a9f791 100644 +--- a/libvips/colour/HSV2sRGB.c ++++ b/libvips/colour/HSV2sRGB.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -46,52 +46,51 @@ + + #define SIXTH_OF_CHAR (42.5) + +- + typedef VipsColourCode VipsHSV2sRGB; + typedef VipsColourCodeClass VipsHSV2sRGBClass; + +-G_DEFINE_TYPE( VipsHSV2sRGB, vips_HSV2sRGB, VIPS_TYPE_COLOUR_CODE ); ++G_DEFINE_TYPE(VipsHSV2sRGB, vips_HSV2sRGB, VIPS_TYPE_COLOUR_CODE); + +-static void +-vips_HSV2sRGB_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++static void ++vips_HSV2sRGB_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { + unsigned char *p = (unsigned char *) in[0]; + unsigned char *q = (unsigned char *) out; + + int i; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + float c, x, m; + + c = p[2] * p[1] / 255.0; +- x = c * (1 - VIPS_FABS( fmod( p[0] / SIXTH_OF_CHAR, 2 ) - 1 )); ++ x = c * (1 - VIPS_FABS(fmod(p[0] / SIXTH_OF_CHAR, 2) - 1)); + m = p[2] - c; + +- if( p[0] < (int) SIXTH_OF_CHAR ) { ++ if (p[0] < (int) SIXTH_OF_CHAR) { + q[0] = c + m; + q[1] = x + m; + q[2] = 0 + m; +- } +- else if( p[0] < (int) (2 * SIXTH_OF_CHAR) ) { ++ } ++ else if (p[0] < (int) (2 * SIXTH_OF_CHAR)) { + q[0] = x + m; + q[1] = c + m; + q[2] = 0 + m; +- } +- else if( p[0] < (int) (3 * SIXTH_OF_CHAR) ) { ++ } ++ else if (p[0] < (int) (3 * SIXTH_OF_CHAR)) { + q[0] = 0 + m; + q[1] = c + m; + q[2] = x + m; +- } +- else if( p[0] < (int) (4 * SIXTH_OF_CHAR) ) { ++ } ++ else if (p[0] < (int) (4 * SIXTH_OF_CHAR)) { + q[0] = 0 + m; + q[1] = x + m; + q[2] = c + m; +- } +- else if( p[0] < (int) (5 * SIXTH_OF_CHAR) ) { ++ } ++ else if (p[0] < (int) (5 * SIXTH_OF_CHAR)) { + q[0] = x + m; + q[1] = 0 + m; + q[2] = c + m; +- } ++ } + else { + q[0] = c + m; + q[1] = 0 + m; +@@ -104,22 +103,22 @@ vips_HSV2sRGB_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static void +-vips_HSV2sRGB_class_init( VipsHSV2sRGBClass *class ) ++vips_HSV2sRGB_class_init(VipsHSV2sRGBClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "HSV2sRGB"; +- object_class->description = _( "transform HSV to sRGB" ); ++ object_class->description = _("transform HSV to sRGB"); + + colour_class->process_line = vips_HSV2sRGB_line; + } + + static void +-vips_HSV2sRGB_init( VipsHSV2sRGB *HSV2sRGB ) ++vips_HSV2sRGB_init(VipsHSV2sRGB *HSV2sRGB) + { +- VipsColour *colour = VIPS_COLOUR( HSV2sRGB ); +- VipsColourCode *code = VIPS_COLOUR_CODE( HSV2sRGB ); ++ VipsColour *colour = VIPS_COLOUR(HSV2sRGB); ++ VipsColourCode *code = VIPS_COLOUR_CODE(HSV2sRGB); + + colour->interpretation = VIPS_INTERPRETATION_sRGB; + colour->format = VIPS_FORMAT_UCHAR; +@@ -140,7 +139,7 @@ vips_HSV2sRGB_init( VipsHSV2sRGB *HSV2sRGB ) + * Convert HSV to sRGB. + * + * HSV is a crude polar coordinate system for RGB images. It is provided for +- * compatibility with other image processing systems. See vips_Lab2LCh() for a ++ * compatibility with other image processing systems. See vips_Lab2LCh() for a + * much better colour space. + * + * See also: vips_sRGB2HSV(). +@@ -148,15 +147,14 @@ vips_HSV2sRGB_init( VipsHSV2sRGB *HSV2sRGB ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_HSV2sRGB( VipsImage *in, VipsImage **out, ... ) ++vips_HSV2sRGB(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "HSV2sRGB", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("HSV2sRGB", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/colour/LCh2Lab.c b/libvips/colour/LCh2Lab.c +index 27fbb4d42a..cb87da5254 100644 +--- a/libvips/colour/LCh2Lab.c ++++ b/libvips/colour/LCh2Lab.c +@@ -15,28 +15,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -55,7 +55,7 @@ + typedef VipsColourTransform VipsLCh2Lab; + typedef VipsColourTransformClass VipsLCh2LabClass; + +-G_DEFINE_TYPE( VipsLCh2Lab, vips_LCh2Lab, VIPS_TYPE_COLOUR_TRANSFORM ); ++G_DEFINE_TYPE(VipsLCh2Lab, vips_LCh2Lab, VIPS_TYPE_COLOUR_TRANSFORM); + + /** + * vips_col_Ch2ab: +@@ -67,23 +67,23 @@ G_DEFINE_TYPE( VipsLCh2Lab, vips_LCh2Lab, VIPS_TYPE_COLOUR_TRANSFORM ); + * Calculate ab from Ch, h in degrees. + */ + void +-vips_col_Ch2ab( float C, float h, float *a, float *b ) ++vips_col_Ch2ab(float C, float h, float *a, float *b) + { +- *a = C * cos( VIPS_RAD( h ) ); +- *b = C * sin( VIPS_RAD( h ) ); ++ *a = C * cos(VIPS_RAD(h)); ++ *b = C * sin(VIPS_RAD(h)); + } + + /* Process a buffer of data. + */ + static void +-vips_LCh2Lab_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) +-{ +- float * restrict p = (float *) in[0]; +- float * restrict q = (float *) out; ++vips_LCh2Lab_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) ++{ ++ float *restrict p = (float *) in[0]; ++ float *restrict q = (float *) out; + + int x; + +- for( x = 0; x < width; x++ ) { ++ for (x = 0; x < width; x++) { + float L = p[0]; + float C = p[1]; + float h = p[2]; +@@ -91,7 +91,7 @@ vips_LCh2Lab_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + + p += 3; + +- vips_col_Ch2ab( C, h, &a, &b ); ++ vips_col_Ch2ab(C, h, &a, &b); + + q[0] = L; + q[1] = a; +@@ -102,21 +102,21 @@ vips_LCh2Lab_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static void +-vips_LCh2Lab_class_init( VipsLCh2LabClass *class ) ++vips_LCh2Lab_class_init(VipsLCh2LabClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "LCh2Lab"; +- object_class->description = _( "transform LCh to Lab" ); ++ object_class->description = _("transform LCh to Lab"); + + colour_class->process_line = vips_LCh2Lab_line; + } + + static void +-vips_LCh2Lab_init( VipsLCh2Lab *LCh2Lab ) ++vips_LCh2Lab_init(VipsLCh2Lab *LCh2Lab) + { +- VipsColour *colour = VIPS_COLOUR( LCh2Lab ); ++ VipsColour *colour = VIPS_COLOUR(LCh2Lab); + + colour->interpretation = VIPS_INTERPRETATION_LAB; + } +@@ -132,14 +132,14 @@ vips_LCh2Lab_init( VipsLCh2Lab *LCh2Lab ) + * Returns: 0 on success, -1 on error + */ + int +-vips_LCh2Lab( VipsImage *in, VipsImage **out, ... ) ++vips_LCh2Lab(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "LCh2Lab", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("LCh2Lab", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/LCh2UCS.c b/libvips/colour/LCh2UCS.c +index 34b73c0a40..92581502ea 100644 +--- a/libvips/colour/LCh2UCS.c ++++ b/libvips/colour/LCh2UCS.c +@@ -11,28 +11,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,12 +51,12 @@ + typedef VipsColourTransform VipsLCh2CMC; + typedef VipsColourTransformClass VipsLCh2CMCClass; + +-G_DEFINE_TYPE( VipsLCh2CMC, vips_LCh2CMC, VIPS_TYPE_COLOUR_TRANSFORM ); ++G_DEFINE_TYPE(VipsLCh2CMC, vips_LCh2CMC, VIPS_TYPE_COLOUR_TRANSFORM); + + /* I ordered this paper from the library and it took ages. For reference, the + * recommended short formula are: + * +- * Lucs ++ * Lucs + * = 1.744 * L, L < 16 + * = (1/l) * (21.75 * ln(L) + 0.3838 * L - 38.54), otherwise + * +@@ -74,8 +74,8 @@ G_DEFINE_TYPE( VipsLCh2CMC, vips_LCh2CMC, VIPS_TYPE_COLOUR_TRANSFORM ); + * 110 - 269.5 13.87 10.93 0.140 1.000 -83 + * 269.5 - 360 0.14 5.23 0.170 1.610 233 + * +- * They have a much more complicated but slightly more accurate formula for +- * hucs. This one is pretty good, simple approximation. ++ * They have a much more complicated but slightly more accurate formula for ++ * hucs. This one is pretty good, simple approximation. + */ + + /** +@@ -87,16 +87,16 @@ G_DEFINE_TYPE( VipsLCh2CMC, vips_LCh2CMC, VIPS_TYPE_COLOUR_TRANSFORM ); + * Returns: Lcmc + */ + float +-vips_col_L2Lcmc( float L ) +-{ ++vips_col_L2Lcmc(float L) ++{ + float Lcmc; + +- if( L < 16.0 ) ++ if (L < 16.0) + Lcmc = 1.744 * L; + else +- Lcmc = 21.75 * log( L ) + 0.3838 * L - 38.54; ++ Lcmc = 21.75 * log(L) + 0.3838 * L - 38.54; + +- return( Lcmc ); ++ return (Lcmc); + } + + /** +@@ -108,15 +108,15 @@ vips_col_L2Lcmc( float L ) + * Returns: Ccmc. + */ + float +-vips_col_C2Ccmc( float C ) +-{ ++vips_col_C2Ccmc(float C) ++{ + float Ccmc; + +- Ccmc = 0.162 * C + 10.92 * log( 0.638 + 0.07216 * C ) + 4.907; +- if( Ccmc < 0 ) ++ Ccmc = 0.162 * C + 10.92 * log(0.638 + 0.07216 * C) + 4.907; ++ if (Ccmc < 0) + Ccmc = 0; + +- return( Ccmc ); ++ return (Ccmc); + } + + /** +@@ -129,27 +129,27 @@ vips_col_C2Ccmc( float C ) + * Returns: hcmc. + */ + float +-vips_col_Ch2hcmc( float C, float h ) +-{ ++vips_col_Ch2hcmc(float C, float h) ++{ + float P, D, f, g; + float k4, k5, k6, k7, k8; + float hcmc; + +- if( h < 49.1 ) { ++ if (h < 49.1) { + k4 = 133.87; + k5 = -134.5; + k6 = -.924; + k7 = 1.727; + k8 = 340.0; + } +- else if( h < 110.1 ) { ++ else if (h < 110.1) { + k4 = 11.78; + k5 = -12.7; + k6 = -.218; + k7 = 2.12; + k8 = 333.0; + } +- else if( h < 269.6 ) { ++ else if (h < 269.6) { + k4 = 13.87; + k5 = 10.93; + k6 = 0.14; +@@ -164,54 +164,54 @@ vips_col_Ch2hcmc( float C, float h ) + k8 = 233.0; + } + +- P = cos( VIPS_RAD( k7 * h + k8 ) ); +- D = k4 + k5 * P * pow( VIPS_FABS( P ), k6 ); ++ P = cos(VIPS_RAD(k7 * h + k8)); ++ D = k4 + k5 * P * pow(VIPS_FABS(P), k6); + g = C * C * C * C; +- f = sqrt( g / (g + 1900.0) ); ++ f = sqrt(g / (g + 1900.0)); + hcmc = h + D * f; + +- return( hcmc ); ++ return (hcmc); + } + + static void +-vips_LCh2CMC_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_LCh2CMC_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { + float *p = (float *) in[0]; + float *q = (float *) out; + + int x; + +- for( x = 0; x < width; x++ ) { ++ for (x = 0; x < width; x++) { + float L = p[0]; + float C = p[1]; + float h = p[2]; + + p += 3; + +- q[0] = vips_col_L2Lcmc( L ); +- q[1] = vips_col_C2Ccmc( C ); +- q[2] = vips_col_Ch2hcmc( C, h ); ++ q[0] = vips_col_L2Lcmc(L); ++ q[1] = vips_col_C2Ccmc(C); ++ q[2] = vips_col_Ch2hcmc(C, h); + + q += 3; + } + } + + static void +-vips_LCh2CMC_class_init( VipsLCh2CMCClass *class ) ++vips_LCh2CMC_class_init(VipsLCh2CMCClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "LCh2CMC"; +- object_class->description = _( "transform LCh to CMC" ); ++ object_class->description = _("transform LCh to CMC"); + + colour_class->process_line = vips_LCh2CMC_line; + } + + static void +-vips_LCh2CMC_init( VipsLCh2CMC *LCh2CMC ) ++vips_LCh2CMC_init(VipsLCh2CMC *LCh2CMC) + { +- VipsColour *colour = VIPS_COLOUR( LCh2CMC ); ++ VipsColour *colour = VIPS_COLOUR(LCh2CMC); + + colour->interpretation = VIPS_INTERPRETATION_CMC; + } +@@ -226,26 +226,26 @@ vips_LCh2CMC_init( VipsLCh2CMC *LCh2CMC ) + * + * The CMC colourspace is described in "Uniform Colour Space Based on the + * CMC(l:c) Colour-difference Formula", M R Luo and B Rigg, Journal of the +- * Society of Dyers and Colourists, vol 102, 1986. Distances in this ++ * Society of Dyers and Colourists, vol 102, 1986. Distances in this + * colourspace approximate, within 10% or so, differences in the CMC(l:c) + * colour difference formula. + * + * This operation generates CMC(1:1). For CMC(2:1), halve Lucs and double +- * Cucs. ++ * Cucs. + * +- * See also: vips_CMC2LCh(). ++ * See also: vips_CMC2LCh(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_LCh2CMC( VipsImage *in, VipsImage **out, ... ) ++vips_LCh2CMC(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "LCh2CMC", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("LCh2CMC", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/Lab2LCh.c b/libvips/colour/Lab2LCh.c +index 7ac33ff8cf..6e5daff7b4 100644 +--- a/libvips/colour/Lab2LCh.c ++++ b/libvips/colour/Lab2LCh.c +@@ -9,28 +9,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -49,66 +49,66 @@ + typedef VipsColourTransform VipsLab2LCh; + typedef VipsColourTransformClass VipsLab2LChClass; + +-G_DEFINE_TYPE( VipsLab2LCh, vips_Lab2LCh, VIPS_TYPE_COLOUR_TRANSFORM ); ++G_DEFINE_TYPE(VipsLab2LCh, vips_Lab2LCh, VIPS_TYPE_COLOUR_TRANSFORM); + + /** + * vips_col_ab2h: + * @a: CIE a + * @b: CIE b + * +- * Returns: Hue (degrees) ++ * Returns: Hue (degrees) + */ + double +-vips_col_ab2h( double a, double b ) ++vips_col_ab2h(double a, double b) + { + double h; + + /* We have to get the right quadrant! + */ +- if( a == 0 ) { +- if( b < 0.0 ) ++ if (a == 0) { ++ if (b < 0.0) + h = 270; +- else if( b == 0.0 ) ++ else if (b == 0.0) + h = 0; + else + h = 90; + } + else { +- double t = atan( b / a ); ++ double t = atan(b / a); + +- if( a > 0.0 ) +- if( b < 0.0 ) +- h = VIPS_DEG( t + VIPS_PI * 2.0 ); ++ if (a > 0.0) ++ if (b < 0.0) ++ h = VIPS_DEG(t + VIPS_PI * 2.0); + else +- h = VIPS_DEG( t ); ++ h = VIPS_DEG(t); + else +- h = VIPS_DEG( t + VIPS_PI ); ++ h = VIPS_DEG(t + VIPS_PI); + } + +- return( h ); ++ return (h); + } + + void +-vips_col_ab2Ch( float a, float b, float *C, float *h ) ++vips_col_ab2Ch(float a, float b, float *C, float *h) + { +- *h = vips_col_ab2h( a, b ); ++ *h = vips_col_ab2h(a, b); + + #ifdef HAVE_HYPOT +- *C = hypot( a, b ); ++ *C = hypot(a, b); + #else +- *C = sqrt( a * a + b * b ); ++ *C = sqrt(a * a + b * b); + #endif + } + + static void +-vips_Lab2LCh_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_Lab2LCh_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { +- float * restrict p = (float *) in[0]; +- float * restrict q = (float *) out; ++ float *restrict p = (float *) in[0]; ++ float *restrict q = (float *) out; + + int x; + +- for( x = 0; x < width; x++ ) { ++ for (x = 0; x < width; x++) { + float L = p[0]; + float a = p[1]; + float b = p[2]; +@@ -116,8 +116,8 @@ vips_Lab2LCh_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + + p += 3; + +- C = sqrt( a * a + b * b ); +- h = vips_col_ab2h( a, b ); ++ C = sqrt(a * a + b * b); ++ h = vips_col_ab2h(a, b); + + q[0] = L; + q[1] = C; +@@ -128,21 +128,21 @@ vips_Lab2LCh_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static void +-vips_Lab2LCh_class_init( VipsLab2LChClass *class ) ++vips_Lab2LCh_class_init(VipsLab2LChClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "Lab2LCh"; +- object_class->description = _( "transform Lab to LCh" ); ++ object_class->description = _("transform Lab to LCh"); + + colour_class->process_line = vips_Lab2LCh_line; + } + + static void +-vips_Lab2LCh_init( VipsLab2LCh *Lab2LCh ) ++vips_Lab2LCh_init(VipsLab2LCh *Lab2LCh) + { +- VipsColour *colour = VIPS_COLOUR( Lab2LCh ); ++ VipsColour *colour = VIPS_COLOUR(Lab2LCh); + + colour->interpretation = VIPS_INTERPRETATION_LCH; + } +@@ -158,14 +158,14 @@ vips_Lab2LCh_init( VipsLab2LCh *Lab2LCh ) + * Returns: 0 on success, -1 on error + */ + int +-vips_Lab2LCh( VipsImage *in, VipsImage **out, ... ) ++vips_Lab2LCh(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "Lab2LCh", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("Lab2LCh", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/Lab2LabQ.c b/libvips/colour/Lab2LabQ.c +index 7dd5287113..c8cde9182d 100644 +--- a/libvips/colour/Lab2LabQ.c ++++ b/libvips/colour/Lab2LabQ.c +@@ -35,28 +35,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -75,7 +75,7 @@ + typedef VipsColourCode VipsLab2LabQ; + typedef VipsColourCodeClass VipsLab2LabQClass; + +-G_DEFINE_TYPE( VipsLab2LabQ, vips_Lab2LabQ, VIPS_TYPE_COLOUR_CODE ); ++G_DEFINE_TYPE(VipsLab2LabQ, vips_Lab2LabQ, VIPS_TYPE_COLOUR_CODE); + + /* @(#) convert float Lab to packed Lab32 format 10 11 11 bits + * works only on buffers, not IMAGEs +@@ -83,38 +83,38 @@ G_DEFINE_TYPE( VipsLab2LabQ, vips_Lab2LabQ, VIPS_TYPE_COLOUR_CODE ); + * Modified: 3/5/93, 16/6/93 + */ + static void +-vips_Lab2LabQ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_Lab2LabQ_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { +- float * restrict p = (float *) in[0]; +- VipsPel * restrict q = out; ++ float *restrict p = (float *) in[0]; ++ VipsPel *restrict q = out; + + int i; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + float fval; + int lsbs; + int intv; + +- /* Scale L up to 10 bits. ++ /* Scale L up to 10 bits. + */ +- intv = VIPS_ROUND_UINT( 10.23 * p[0] ); +- intv = VIPS_CLIP( 0, intv, 1023 ); +- lsbs = (intv & 0x3) << 6; /* 00000011 -> 11000000 */ +- q[0] = intv >> 2; /* drop bot 2 bits and store */ +- +- fval = 8.0 * p[1]; /* do a */ +- intv = VIPS_RINT( fval ); +- intv = VIPS_CLIP( -1024, intv, 1023 ); +- lsbs |= (intv & 0x7) << 3; /* 00000111 -> 00111000 */ +- q[1] = intv >> 3; /* drop bot 3 bits & store */ +- +- fval = 8.0 * p[2]; /* do b */ +- intv = VIPS_RINT( fval ); +- intv = VIPS_CLIP( -1024, intv, 1023 ); ++ intv = VIPS_ROUND_UINT(10.23 * p[0]); ++ intv = VIPS_CLIP(0, intv, 1023); ++ lsbs = (intv & 0x3) << 6; /* 00000011 -> 11000000 */ ++ q[0] = intv >> 2; /* drop bot 2 bits and store */ ++ ++ fval = 8.0 * p[1]; /* do a */ ++ intv = VIPS_RINT(fval); ++ intv = VIPS_CLIP(-1024, intv, 1023); ++ lsbs |= (intv & 0x7) << 3; /* 00000111 -> 00111000 */ ++ q[1] = intv >> 3; /* drop bot 3 bits & store */ ++ ++ fval = 8.0 * p[2]; /* do b */ ++ intv = VIPS_RINT(fval); ++ intv = VIPS_CLIP(-1024, intv, 1023); + lsbs |= (intv & 0x7); + q[2] = intv >> 3; + +- q[3] = lsbs; /* store lsb band */ ++ q[3] = lsbs; /* store lsb band */ + + p += 3; + q += 4; +@@ -122,28 +122,28 @@ vips_Lab2LabQ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + void +-vips__Lab2LabQ_vec( VipsPel *out, float *in, int width ) ++vips__Lab2LabQ_vec(VipsPel *out, float *in, int width) + { +- vips_Lab2LabQ_line( NULL, out, (VipsPel **) &in, width ); ++ vips_Lab2LabQ_line(NULL, out, (VipsPel **) &in, width); + } + + static void +-vips_Lab2LabQ_class_init( VipsLab2LabQClass *class ) ++vips_Lab2LabQ_class_init(VipsLab2LabQClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "Lab2LabQ"; +- object_class->description = _( "transform float Lab to LabQ coding" ); ++ object_class->description = _("transform float Lab to LabQ coding"); + + colour_class->process_line = vips_Lab2LabQ_line; + } + + static void +-vips_Lab2LabQ_init( VipsLab2LabQ *Lab2LabQ ) ++vips_Lab2LabQ_init(VipsLab2LabQ *Lab2LabQ) + { +- VipsColour *colour = VIPS_COLOUR( Lab2LabQ ); +- VipsColourCode *code = VIPS_COLOUR_CODE( Lab2LabQ ); ++ VipsColour *colour = VIPS_COLOUR(Lab2LabQ); ++ VipsColourCode *code = VIPS_COLOUR_CODE(Lab2LabQ); + + colour->coding = VIPS_CODING_LABQ; + colour->interpretation = VIPS_INTERPRETATION_LABQ; +@@ -168,14 +168,14 @@ vips_Lab2LabQ_init( VipsLab2LabQ *Lab2LabQ ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_Lab2LabQ( VipsImage *in, VipsImage **out, ... ) ++vips_Lab2LabQ(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "Lab2LabQ", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("Lab2LabQ", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/Lab2LabS.c b/libvips/colour/Lab2LabS.c +index 7617b04e9b..31e8b25ce2 100644 +--- a/libvips/colour/Lab2LabS.c ++++ b/libvips/colour/Lab2LabS.c +@@ -11,28 +11,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,16 +51,16 @@ + typedef VipsColourCode VipsLab2LabS; + typedef VipsColourCodeClass VipsLab2LabSClass; + +-G_DEFINE_TYPE( VipsLab2LabS, vips_Lab2LabS, VIPS_TYPE_COLOUR_CODE ); ++G_DEFINE_TYPE(VipsLab2LabS, vips_Lab2LabS, VIPS_TYPE_COLOUR_CODE); + + static void +-vips_Lab2LabS_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_Lab2LabS_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { +- float * restrict p = (float *) in[0]; +- signed short * restrict q = (signed short *) out; ++ float *restrict p = (float *) in[0]; ++ signed short *restrict q = (signed short *) out; + int i; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + q[0] = p[0] * (32767.0 / 100.0); + q[1] = p[1] * (32768.0 / 128.0); + q[2] = p[2] * (32768.0 / 128.0); +@@ -71,22 +71,22 @@ vips_Lab2LabS_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static void +-vips_Lab2LabS_class_init( VipsLab2LabSClass *class ) ++vips_Lab2LabS_class_init(VipsLab2LabSClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "Lab2LabS"; +- object_class->description = _( "transform float Lab to signed short" ); ++ object_class->description = _("transform float Lab to signed short"); + + colour_class->process_line = vips_Lab2LabS_line; + } + + static void +-vips_Lab2LabS_init( VipsLab2LabS *Lab2LabS ) ++vips_Lab2LabS_init(VipsLab2LabS *Lab2LabS) + { +- VipsColour *colour = VIPS_COLOUR( Lab2LabS ); +- VipsColourCode *code = VIPS_COLOUR_CODE( Lab2LabS ); ++ VipsColour *colour = VIPS_COLOUR(Lab2LabS); ++ VipsColourCode *code = VIPS_COLOUR_CODE(Lab2LabS); + + colour->interpretation = VIPS_INTERPRETATION_LABS; + colour->format = VIPS_FORMAT_SHORT; +@@ -110,15 +110,14 @@ vips_Lab2LabS_init( VipsLab2LabS *Lab2LabS ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_Lab2LabS( VipsImage *in, VipsImage **out, ... ) ++vips_Lab2LabS(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "Lab2LabS", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("Lab2LabS", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/colour/Lab2XYZ.c b/libvips/colour/Lab2XYZ.c +index a1a9afecce..0e4c2ca56d 100644 +--- a/libvips/colour/Lab2XYZ.c ++++ b/libvips/colour/Lab2XYZ.c +@@ -19,28 +19,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -64,7 +64,7 @@ + typedef struct _VipsLab2XYZ { + VipsColourTransform parent_instance; + +- /* The colour temperature -- default to D65. ++ /* The colour temperature -- default to D65. + */ + VipsArea *temp; + +@@ -78,15 +78,15 @@ typedef struct _VipsLab2XYZ { + + typedef VipsColourTransformClass VipsLab2XYZClass; + +-G_DEFINE_TYPE( VipsLab2XYZ, vips_Lab2XYZ, VIPS_TYPE_COLOUR_TRANSFORM ); ++G_DEFINE_TYPE(VipsLab2XYZ, vips_Lab2XYZ, VIPS_TYPE_COLOUR_TRANSFORM); + + static void +-vips_col_Lab2XYZ_helper( VipsLab2XYZ *Lab2XYZ, +- float L, float a, float b, float *X, float *Y, float *Z ) ++vips_col_Lab2XYZ_helper(VipsLab2XYZ *Lab2XYZ, ++ float L, float a, float b, float *X, float *Y, float *Z) + { + double cby, tmp; + +- if( L < 8.0 ) { ++ if (L < 8.0) { + *Y = (L * Lab2XYZ->Y0) / 903.3; + cby = 7.787 * (*Y / Lab2XYZ->Y0) + 16.0 / 116.0; + } +@@ -96,13 +96,13 @@ vips_col_Lab2XYZ_helper( VipsLab2XYZ *Lab2XYZ, + } + + tmp = a / 500.0 + cby; +- if( tmp < 0.2069 ) ++ if (tmp < 0.2069) + *X = Lab2XYZ->X0 * (tmp - 0.13793) / 7.787; + else + *X = Lab2XYZ->X0 * tmp * tmp * tmp; + + tmp = cby - b / 200.0; +- if( tmp < 0.2069 ) ++ if (tmp < 0.2069) + *Z = Lab2XYZ->Z0 * (tmp - 0.13793) / 7.787; + else + *Z = Lab2XYZ->Z0 * tmp * tmp * tmp; +@@ -111,18 +111,18 @@ vips_col_Lab2XYZ_helper( VipsLab2XYZ *Lab2XYZ, + /* Process a buffer of data. + */ + static void +-vips_Lab2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_Lab2XYZ_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { + VipsLab2XYZ *Lab2XYZ = (VipsLab2XYZ *) colour; +- float * restrict p = (float *) in[0]; +- float * restrict q = (float *) out; ++ float *restrict p = (float *) in[0]; ++ float *restrict q = (float *) out; + + int x; + +- VIPS_DEBUG_MSG( "vips_Lab2XYZ_line: X0 = %g, Y0 = %g, Z0 = %g\n", +- Lab2XYZ->X0, Lab2XYZ->Y0, Lab2XYZ->Z0 ); ++ VIPS_DEBUG_MSG("vips_Lab2XYZ_line: X0 = %g, Y0 = %g, Z0 = %g\n", ++ Lab2XYZ->X0, Lab2XYZ->Y0, Lab2XYZ->Z0); + +- for( x = 0; x < width; x++ ) { ++ for (x = 0; x < width; x++) { + float L, a, b; + float X, Y, Z; + +@@ -131,7 +131,7 @@ vips_Lab2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + b = p[2]; + p += 3; + +- vips_col_Lab2XYZ_helper( Lab2XYZ, L, a, b, &X, &Y, &Z ); ++ vips_col_Lab2XYZ_helper(Lab2XYZ, L, a, b, &X, &Y, &Z); + + /* Write. + */ +@@ -143,54 +143,54 @@ vips_Lab2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static int +-vips_Lab2XYZ_build( VipsObject *object ) ++vips_Lab2XYZ_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsLab2XYZ *Lab2XYZ = (VipsLab2XYZ *) object; + +- if( Lab2XYZ->temp ) { +- if( vips_check_vector_length( class->nickname, +- Lab2XYZ->temp->n, 3 ) ) +- return( -1 ); ++ if (Lab2XYZ->temp) { ++ if (vips_check_vector_length(class->nickname, ++ Lab2XYZ->temp->n, 3)) ++ return (-1); + Lab2XYZ->X0 = ((double *) Lab2XYZ->temp->data)[0]; + Lab2XYZ->Y0 = ((double *) Lab2XYZ->temp->data)[1]; + Lab2XYZ->Z0 = ((double *) Lab2XYZ->temp->data)[2]; + } + +- if( VIPS_OBJECT_CLASS( vips_Lab2XYZ_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_Lab2XYZ_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_Lab2XYZ_class_init( VipsLab2XYZClass *class ) ++vips_Lab2XYZ_class_init(VipsLab2XYZClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "Lab2XYZ"; +- object_class->description = _( "transform CIELAB to XYZ" ); ++ object_class->description = _("transform CIELAB to XYZ"); + object_class->build = vips_Lab2XYZ_build; + + colour_class->process_line = vips_Lab2XYZ_line; + +- VIPS_ARG_BOXED( class, "temp", 110, +- _( "Temperature" ), +- _( "Color temperature" ), ++ VIPS_ARG_BOXED(class, "temp", 110, ++ _("Temperature"), ++ _("Color temperature"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsLab2XYZ, temp ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsLab2XYZ, temp), ++ VIPS_TYPE_ARRAY_DOUBLE); + } + + static void +-vips_Lab2XYZ_init( VipsLab2XYZ *Lab2XYZ ) ++vips_Lab2XYZ_init(VipsLab2XYZ *Lab2XYZ) + { +- VipsColour *colour = VIPS_COLOUR( Lab2XYZ ); ++ VipsColour *colour = VIPS_COLOUR(Lab2XYZ); + + Lab2XYZ->X0 = VIPS_D65_X0; + Lab2XYZ->Y0 = VIPS_D65_Y0; +@@ -209,22 +209,22 @@ vips_Lab2XYZ_init( VipsLab2XYZ *Lab2XYZ ) + * + * * @temp: #VipsArrayDouble, colour temperature + * +- * Turn Lab to XYZ. The colour temperature defaults to D65, but can be ++ * Turn Lab to XYZ. The colour temperature defaults to D65, but can be + * specified with @temp. + * + * Returns: 0 on success, -1 on error + */ + int +-vips_Lab2XYZ( VipsImage *in, VipsImage **out, ... ) ++vips_Lab2XYZ(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "Lab2XYZ", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("Lab2XYZ", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -237,16 +237,16 @@ vips_Lab2XYZ( VipsImage *in, VipsImage **out, ... ) + * @Z: (out): Return CIE XYZ colour + * + * Calculate XYZ from Lab, D65. +- * ++ * + * See also: vips_Lab2XYZ(). + */ + void +-vips_col_Lab2XYZ( float L, float a, float b, float *X, float *Y, float *Z ) ++vips_col_Lab2XYZ(float L, float a, float b, float *X, float *Y, float *Z) + { + VipsLab2XYZ Lab2XYZ; + + Lab2XYZ.X0 = VIPS_D65_X0; + Lab2XYZ.Y0 = VIPS_D65_Y0; + Lab2XYZ.Z0 = VIPS_D65_Z0; +- vips_col_Lab2XYZ_helper( &Lab2XYZ, L, a, b, X, Y, Z ); ++ vips_col_Lab2XYZ_helper(&Lab2XYZ, L, a, b, X, Y, Z); + } +diff --git a/libvips/colour/LabQ2Lab.c b/libvips/colour/LabQ2Lab.c +index cbe0df04db..dac275a830 100644 +--- a/libvips/colour/LabQ2Lab.c ++++ b/libvips/colour/LabQ2Lab.c +@@ -10,7 +10,7 @@ + * 9/2/95 JC + * - new im_wrapone function + * 22/5/95 JC +- * - changed char to unsigned char for RS/6000 ++ * - changed char to unsigned char for RS/6000 + * - small tidies and speed-ups + * 4/9/97 JC + * - L* = 100.0 now handled correctly +@@ -22,28 +22,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -62,7 +62,7 @@ + typedef VipsColourCode VipsLabQ2Lab; + typedef VipsColourCodeClass VipsLabQ2LabClass; + +-G_DEFINE_TYPE( VipsLabQ2Lab, vips_LabQ2Lab, VIPS_TYPE_COLOUR_CODE ); ++G_DEFINE_TYPE(VipsLabQ2Lab, vips_LabQ2Lab, VIPS_TYPE_COLOUR_CODE); + + /* imb_LabQ2Lab: CONVERT n pels from packed 32bit Lab to float values + * in a buffer +@@ -72,37 +72,37 @@ G_DEFINE_TYPE( VipsLabQ2Lab, vips_LabQ2Lab, VIPS_TYPE_COLOUR_CODE ); + * (C) K.Martinez 2/5/93 + */ + static void +-vips_LabQ2Lab_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_LabQ2Lab_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { +- signed char * restrict p = (signed char *) in[0]; +- float * restrict q = (float *) out; ++ signed char *restrict p = (signed char *) in[0]; ++ float *restrict q = (float *) out; + + int l; +- int lsbs; /* for lsbs byte */ +- int i; /* counter */ ++ int lsbs; /* for lsbs byte */ ++ int i; /* counter */ + + /* Read input with a signed pointer to get signed ab easily. + */ +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + /* Get extra bits. + */ + lsbs = ((unsigned char *) p)[3]; + + /* Build L. + */ +- l = ((unsigned char *)p)[0]; ++ l = ((unsigned char *) p)[0]; + l = (l << 2) | (lsbs >> 6); + q[0] = (float) l * (100.0 / 1023.0); + + /* Build a. + */ +- l = VIPS_LSHIFT_INT( p[1], 3) | ((lsbs >> 3) & 0x7); ++ l = VIPS_LSHIFT_INT(p[1], 3) | ((lsbs >> 3) & 0x7); + q[1] = (float) l * 0.125; + + /* And b. + */ +- l = VIPS_LSHIFT_INT( p[2], 3) | (lsbs & 0x7); +- q[2] = (float) l * 0.125; ++ l = VIPS_LSHIFT_INT(p[2], 3) | (lsbs & 0x7); ++ q[2] = (float) l * 0.125; + + p += 4; + q += 3; +@@ -110,28 +110,28 @@ vips_LabQ2Lab_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + void +-vips__LabQ2Lab_vec( float *out, VipsPel *in, int width ) ++vips__LabQ2Lab_vec(float *out, VipsPel *in, int width) + { +- vips_LabQ2Lab_line( NULL, (VipsPel *) out, &in, width ); ++ vips_LabQ2Lab_line(NULL, (VipsPel *) out, &in, width); + } + + static void +-vips_LabQ2Lab_class_init( VipsLabQ2LabClass *class ) ++vips_LabQ2Lab_class_init(VipsLabQ2LabClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "LabQ2Lab"; +- object_class->description = _( "unpack a LabQ image to float Lab" ); ++ object_class->description = _("unpack a LabQ image to float Lab"); + + colour_class->process_line = vips_LabQ2Lab_line; + } + + static void +-vips_LabQ2Lab_init( VipsLabQ2Lab *LabQ2Lab ) ++vips_LabQ2Lab_init(VipsLabQ2Lab *LabQ2Lab) + { +- VipsColour *colour = VIPS_COLOUR( LabQ2Lab ); +- VipsColourCode *code = VIPS_COLOUR_CODE( LabQ2Lab ); ++ VipsColour *colour = VIPS_COLOUR(LabQ2Lab); ++ VipsColourCode *code = VIPS_COLOUR_CODE(LabQ2Lab); + + colour->coding = VIPS_CODING_NONE; + colour->interpretation = VIPS_INTERPRETATION_LAB; +@@ -154,14 +154,14 @@ vips_LabQ2Lab_init( VipsLabQ2Lab *LabQ2Lab ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_LabQ2Lab( VipsImage *in, VipsImage **out, ... ) ++vips_LabQ2Lab(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "LabQ2Lab", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("LabQ2Lab", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/LabQ2LabS.c b/libvips/colour/LabQ2LabS.c +index 7fa2b4440a..faaa67d3df 100644 +--- a/libvips/colour/LabQ2LabS.c ++++ b/libvips/colour/LabQ2LabS.c +@@ -14,28 +14,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -53,21 +53,21 @@ + typedef VipsColourCode VipsLabQ2LabS; + typedef VipsColourCodeClass VipsLabQ2LabSClass; + +-G_DEFINE_TYPE( VipsLabQ2LabS, vips_LabQ2LabS, VIPS_TYPE_COLOUR_CODE ); ++G_DEFINE_TYPE(VipsLabQ2LabS, vips_LabQ2LabS, VIPS_TYPE_COLOUR_CODE); + + /* CONVERT n pels from packed 32bit Lab to signed short. + */ + static void +-vips_LabQ2LabS_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_LabQ2LabS_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { +- unsigned char * restrict p = (unsigned char *) in[0]; +- signed short * restrict q = (signed short *) out; ++ unsigned char *restrict p = (unsigned char *) in[0]; ++ signed short *restrict q = (signed short *) out; + + int i; + unsigned char ext; + signed short l, a, b; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + /* Get most significant 8 bits of lab. + */ + l = p[0] << 7; +@@ -95,22 +95,22 @@ vips_LabQ2LabS_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static void +-vips_LabQ2LabS_class_init( VipsLabQ2LabSClass *class ) ++vips_LabQ2LabS_class_init(VipsLabQ2LabSClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "LabQ2LabS"; +- object_class->description = _( "unpack a LabQ image to short Lab" ); ++ object_class->description = _("unpack a LabQ image to short Lab"); + + colour_class->process_line = vips_LabQ2LabS_line; + } + + static void +-vips_LabQ2LabS_init( VipsLabQ2LabS *LabQ2LabS ) ++vips_LabQ2LabS_init(VipsLabQ2LabS *LabQ2LabS) + { +- VipsColour *colour = VIPS_COLOUR( LabQ2LabS ); +- VipsColourCode *code = VIPS_COLOUR_CODE( LabQ2LabS ); ++ VipsColour *colour = VIPS_COLOUR(LabQ2LabS); ++ VipsColourCode *code = VIPS_COLOUR_CODE(LabQ2LabS); + + colour->coding = VIPS_CODING_NONE; + colour->interpretation = VIPS_INTERPRETATION_LABS; +@@ -133,14 +133,14 @@ vips_LabQ2LabS_init( VipsLabQ2LabS *LabQ2LabS ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_LabQ2LabS( VipsImage *in, VipsImage **out, ... ) ++vips_LabQ2LabS(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "LabQ2LabS", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("LabQ2LabS", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/LabQ2sRGB.c b/libvips/colour/LabQ2sRGB.c +index f8e396f64f..f2d4bb61ab 100644 +--- a/libvips/colour/LabQ2sRGB.c ++++ b/libvips/colour/LabQ2sRGB.c +@@ -28,31 +28,31 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ +- ++ + #ifdef HAVE_CONFIG_H + #include + #endif /*HAVE_CONFIG_H*/ +@@ -60,7 +60,7 @@ + + #include + #include +- ++ + #include + #include + +@@ -69,9 +69,9 @@ + typedef VipsColourCode VipsLabQ2sRGB; + typedef VipsColourCodeClass VipsLabQ2sRGBClass; + +-G_DEFINE_TYPE( VipsLabQ2sRGB, vips_LabQ2sRGB, VIPS_TYPE_COLOUR_CODE ); ++G_DEFINE_TYPE(VipsLabQ2sRGB, vips_LabQ2sRGB, VIPS_TYPE_COLOUR_CODE); + +-/* 8-bit linear -> sRGB lut. ++/* 8-bit linear -> sRGB lut. + * + * There's an extra element at the end to let us do a +1 for interpolation. + */ +@@ -81,7 +81,7 @@ static int vips_Y2v_8[256 + 1]; + */ + float vips_v2Y_8[256]; + +-/* 16-bit linear -> sRGB lut. ++/* 16-bit linear -> sRGB lut. + * + * There's an extra element at the end to let us do a +1 for interpolation. + */ +@@ -93,7 +93,7 @@ float vips_v2Y_16[65536]; + + /* Do our own indexing of the arrays below to make sure we get efficient mults. + */ +-#define INDEX( L, A, B ) (L + (A << 6) + (B << 12)) ++#define INDEX(L, A, B) (L + (A << 6) + (B << 12)) + + /* A set of LUTs for quick LabQ->sRGB transforms. + */ +@@ -101,46 +101,46 @@ static VipsPel vips_red[64 * 64 * 64]; + static VipsPel vips_green[64 * 64 * 64]; + static VipsPel vips_blue[64 * 64 * 64]; + +-/* sRGB to scRGB. ++/* sRGB to scRGB. + * + * @range is eg. 256 for 8-bit data. + */ + static int +-vips_col_sRGB2scRGB( int range, float *lut, +- int r, int g, int b, float *R, float *G, float *B ) ++vips_col_sRGB2scRGB(int range, float *lut, ++ int r, int g, int b, float *R, float *G, float *B) + { + int maxval = range - 1; + int i; + +- i = VIPS_CLIP( 0, r, maxval ); ++ i = VIPS_CLIP(0, r, maxval); + *R = lut[i]; + +- i = VIPS_CLIP( 0, g, maxval ); ++ i = VIPS_CLIP(0, g, maxval); + *G = lut[i]; + +- i = VIPS_CLIP( 0, b, maxval ); ++ i = VIPS_CLIP(0, b, maxval); + *B = lut[i]; + +- return( 0 ); ++ return (0); + } + + /* Create the sRGB linear and unlinear luts. @range is eg. 256 for 8-bit luts. + */ +-static void +-calcul_tables( int range, int *Y2v, float *v2Y ) ++static void ++calcul_tables(int range, int *Y2v, float *v2Y) + { + int i; + +- for( i = 0; i < range; i++ ) { ++ for (i = 0; i < range; i++) { + float f = (float) i / (range - 1); + float v; + +- if( f <= 0.0031308 ) +- v = 12.92 * f; ++ if (f <= 0.0031308) ++ v = 12.92 * f; + else +- v = (1.0 + 0.055) * pow( f, 1.0 / 2.4 ) - 0.055; ++ v = (1.0 + 0.055) * pow(f, 1.0 / 2.4) - 0.055; + +- Y2v[i] = VIPS_RINT( (range - 1) * v ); ++ Y2v[i] = VIPS_RINT((range - 1) * v); + } + + /* Copy the final element. This is used in the piecewise linear +@@ -148,62 +148,62 @@ calcul_tables( int range, int *Y2v, float *v2Y ) + */ + Y2v[range] = Y2v[range - 1]; + +- for( i = 0; i < range; i++ ) { ++ for (i = 0; i < range; i++) { + float f = (float) i / (range - 1); + +- if( f <= 0.04045 ) ++ if (f <= 0.04045) + v2Y[i] = f / 12.92; + else +- v2Y[i] = pow( (f + 0.055) / (1 + 0.055), 2.4 ); ++ v2Y[i] = pow((f + 0.055) / (1 + 0.055), 2.4); + } + } + + static void * +-calcul_tables_8( void *client ) ++calcul_tables_8(void *client) + { +- calcul_tables( 256, vips_Y2v_8, vips_v2Y_8 ); ++ calcul_tables(256, vips_Y2v_8, vips_v2Y_8); + +- return( NULL ); ++ return (NULL); + } + + void +-vips_col_make_tables_RGB_8( void ) ++vips_col_make_tables_RGB_8(void) + { + static GOnce once = G_ONCE_INIT; + +- VIPS_ONCE( &once, calcul_tables_8, NULL ); ++ VIPS_ONCE(&once, calcul_tables_8, NULL); + } + + int +-vips_col_sRGB2scRGB_8( int r, int g, int b, float *R, float *G, float *B ) ++vips_col_sRGB2scRGB_8(int r, int g, int b, float *R, float *G, float *B) + { + vips_col_make_tables_RGB_8(); + +- return( vips_col_sRGB2scRGB( 256, vips_v2Y_8, r, g, b, R, G, B ) ); ++ return (vips_col_sRGB2scRGB(256, vips_v2Y_8, r, g, b, R, G, B)); + } + + static void * +-calcul_tables_16( void *client ) ++calcul_tables_16(void *client) + { +- calcul_tables( 65536, vips_Y2v_16, vips_v2Y_16 ); ++ calcul_tables(65536, vips_Y2v_16, vips_v2Y_16); + +- return( NULL ); ++ return (NULL); + } + + void +-vips_col_make_tables_RGB_16( void ) ++vips_col_make_tables_RGB_16(void) + { + static GOnce once = G_ONCE_INIT; + +- VIPS_ONCE( &once, calcul_tables_16, NULL ); ++ VIPS_ONCE(&once, calcul_tables_16, NULL); + } + + int +-vips_col_sRGB2scRGB_16( int r, int g, int b, float *R, float *G, float *B ) ++vips_col_sRGB2scRGB_16(int r, int g, int b, float *R, float *G, float *B) + { + vips_col_make_tables_RGB_16(); + +- return( vips_col_sRGB2scRGB( 65536, vips_v2Y_16, r, g, b, R, G, B ) ); ++ return (vips_col_sRGB2scRGB(65536, vips_v2Y_16, r, g, b, R, G, B)); + } + + /* The matrix already includes the D65 channel weighting, so we just scale by +@@ -225,13 +225,13 @@ vips_col_sRGB2scRGB_16( int r, int g, int b, float *R, float *G, float *B ) + * See also: vips_scRGB2XYZ(). + */ + int +-vips_col_scRGB2XYZ( float R, float G, float B, float *X, float *Y, float *Z ) ++vips_col_scRGB2XYZ(float R, float G, float B, float *X, float *Y, float *Z) + { + *X = SCALE * 0.4124 * R + SCALE * 0.3576 * G + SCALE * 0.18056 * B; + *Y = SCALE * 0.2126 * R + SCALE * 0.7152 * G + SCALE * 0.07220 * B; + *Z = SCALE * 0.0193 * R + SCALE * 0.1192 * G + SCALE * 0.9505 * B; + +- return( 0 ); ++ return (0); + } + + /** +@@ -248,25 +248,25 @@ vips_col_scRGB2XYZ( float R, float G, float B, float *X, float *Y, float *Z ) + * See also: vips_XYZ2scRGB(). + */ + int +-vips_col_XYZ2scRGB( float X, float Y, float Z, float *R, float *G, float *B ) ++vips_col_XYZ2scRGB(float X, float Y, float Z, float *R, float *G, float *B) + { +- *R = 3.2406 / SCALE * X + -1.5372 / SCALE * Y + -0.4986 / SCALE * Z; +- *G = -0.9689 / SCALE * X + 1.8758 / SCALE * Y + 0.0415 / SCALE * Z; +- *B = 0.0557 / SCALE * X + -0.2040 / SCALE * Y + 1.0570 / SCALE * Z; ++ *R = 3.2406 / SCALE * X + -1.5372 / SCALE * Y + -0.4986 / SCALE * Z; ++ *G = -0.9689 / SCALE * X + 1.8758 / SCALE * Y + 0.0415 / SCALE * Z; ++ *B = 0.0557 / SCALE * X + -0.2040 / SCALE * Y + 1.0570 / SCALE * Z; + +- return( 0 ); +-} ++ return (0); ++} + +-/* Turn scRGB into sRGB. Return og=1 for out of gamut - rgb will contain an ++/* Turn scRGB into sRGB. Return og=1 for out of gamut - rgb will contain an + * approximation of the right colour. + * + * Return -1 for NaN. + */ + static int +-vips_col_scRGB2sRGB( int range, int *lut, +- float R, float G, float B, +- int *r, int *g, int *b, +- int *og_ret ) ++vips_col_scRGB2sRGB(int range, int *lut, ++ float R, float G, float B, ++ int *r, int *g, int *b, ++ int *og_ret) + { + int maxval = range - 1; + +@@ -279,28 +279,29 @@ vips_col_scRGB2sRGB( int range, int *lut, + * our clipping. + * + * Don't use isnormal(), it is false for 0.0 and for subnormal +- * numbers. ++ * numbers. + */ +- if( VIPS_ISNAN( R ) || VIPS_ISNAN( G ) || VIPS_ISNAN( B ) ) { +- *r = 0; +- *g = 0; +- *b = 0; ++ if (VIPS_ISNAN(R) || VIPS_ISNAN(G) || VIPS_ISNAN(B)) { ++ *r = 0; ++ *g = 0; ++ *b = 0; + +- return( -1 ); ++ return (-1); + } + + /* Clip range, set the out-of-gamut flag. + */ +-#define CLIP( L, V, H ) { \ +- if( (V) < (L) ) { \ +- (V) = (L); \ +- og = 1; \ +- } \ +- else if( (V) > (H) ) { \ +- (V) = (H); \ +- og = 1; \ +- } \ +-} ++#define CLIP(L, V, H) \ ++ { \ ++ if ((V) < (L)) { \ ++ (V) = (L); \ ++ og = 1; \ ++ } \ ++ else if ((V) > (H)) { \ ++ (V) = (H); \ ++ og = 1; \ ++ } \ ++ } + + /* Look up with a float index: interpolate between the nearest two + * points. +@@ -311,56 +312,56 @@ vips_col_scRGB2sRGB( int range, int *lut, + og = 0; + + Yf = R * maxval; +- CLIP( 0, Yf, maxval ); ++ CLIP(0, Yf, maxval); + Yi = (int) Yf; + v = lut[Yi] + (lut[Yi + 1] - lut[Yi]) * (Yf - Yi); +- *r = VIPS_RINT( v ); ++ *r = VIPS_RINT(v); + + Yf = G * maxval; +- CLIP( 0, Yf, maxval ); ++ CLIP(0, Yf, maxval); + Yi = (int) Yf; + v = lut[Yi] + (lut[Yi + 1] - lut[Yi]) * (Yf - Yi); +- *g = VIPS_RINT( v ); ++ *g = VIPS_RINT(v); + + Yf = B * maxval; +- CLIP( 0, Yf, maxval ); ++ CLIP(0, Yf, maxval); + Yi = (int) Yf; + v = lut[Yi] + (lut[Yi + 1] - lut[Yi]) * (Yf - Yi); +- *b = VIPS_RINT( v ); ++ *b = VIPS_RINT(v); + +- if( og_ret ) +- *og_ret = og; ++ if (og_ret) ++ *og_ret = og; + +- return( 0 ); +-} ++ return (0); ++} + + int +-vips_col_scRGB2sRGB_8( float R, float G, float B, +- int *r, int *g, int *b, int *og ) ++vips_col_scRGB2sRGB_8(float R, float G, float B, ++ int *r, int *g, int *b, int *og) + { + vips_col_make_tables_RGB_8(); + +- return( vips_col_scRGB2sRGB( 256, vips_Y2v_8, R, G, B, r, g, b, og ) ); ++ return (vips_col_scRGB2sRGB(256, vips_Y2v_8, R, G, B, r, g, b, og)); + } + + int +-vips_col_scRGB2sRGB_16( float R, float G, float B, +- int *r, int *g, int *b, int *og ) ++vips_col_scRGB2sRGB_16(float R, float G, float B, ++ int *r, int *g, int *b, int *og) + { + vips_col_make_tables_RGB_16(); + +- return( vips_col_scRGB2sRGB( 65536, vips_Y2v_16, +- R, G, B, r, g, b, og ) ); ++ return (vips_col_scRGB2sRGB(65536, vips_Y2v_16, ++ R, G, B, r, g, b, og)); + } + +-/* Turn scRGB into BW. Return or=1 for out of gamut - g will contain an ++/* Turn scRGB into BW. Return or=1 for out of gamut - g will contain an + * approximation of the right colour. + * + * Return -1 for NaN. + */ + static int +-vips_col_scRGB2BW( int range, int *lut, float R, float G, float B, +- int *g, int *og_ret ) ++vips_col_scRGB2BW(int range, int *lut, float R, float G, float B, ++ int *g, int *og_ret) + { + int maxval = range - 1; + +@@ -377,10 +378,10 @@ vips_col_scRGB2BW( int range, int *lut, float R, float G, float B, + /* Y can be Nan. Throw those values out, they will break + * our clipping. + */ +- if( VIPS_ISNAN( Y ) ) { +- *g = 0; ++ if (VIPS_ISNAN(Y)) { ++ *g = 0; + +- return( -1 ); ++ return (-1); + } + + /* Look up with a float index: interpolate between the nearest two +@@ -392,85 +393,85 @@ vips_col_scRGB2BW( int range, int *lut, float R, float G, float B, + og = 0; + + Yf = Y * maxval; +- CLIP( 0, Yf, maxval ); ++ CLIP(0, Yf, maxval); + Yi = (int) Yf; + v = lut[Yi] + (lut[Yi + 1] - lut[Yi]) * (Yf - Yi); +- *g = VIPS_RINT( v ); ++ *g = VIPS_RINT(v); + +- if( og_ret ) +- *og_ret = og; ++ if (og_ret) ++ *og_ret = og; + +- return( 0 ); +-} ++ return (0); ++} + + int +-vips_col_scRGB2BW_16( float R, float G, float B, int *g, int *og ) ++vips_col_scRGB2BW_16(float R, float G, float B, int *g, int *og) + { + vips_col_make_tables_RGB_16(); + +- return( vips_col_scRGB2BW( 65536, vips_Y2v_16, R, G, B, g, og ) ); ++ return (vips_col_scRGB2BW(65536, vips_Y2v_16, R, G, B, g, og)); + } + + int +-vips_col_scRGB2BW_8( float R, float G, float B, int *g, int *og ) ++vips_col_scRGB2BW_8(float R, float G, float B, int *g, int *og) + { + vips_col_make_tables_RGB_8(); + +- return( vips_col_scRGB2BW( 256, vips_Y2v_8, R, G, B, g, og ) ); ++ return (vips_col_scRGB2BW(256, vips_Y2v_8, R, G, B, g, og)); + } + +-/* Build Lab->disp dither tables. ++/* Build Lab->disp dither tables. + */ + static void * +-build_tables( void *client ) ++build_tables(void *client) + { +- int l, a, b; ++ int l, a, b; + int t; + +- for( l = 0; l < 64; l++ ) { +- for( a = 0; a < 64; a++ ) { +- for( b = 0; b < 64; b++ ) { +- /* Scale to lab space. +- */ +- float L = (l << 2) * (100.0/256.0); +- float A = (signed char) (a << 2); +- float B = (signed char) (b << 2); +- float X, Y, Z; +- float Rf, Gf, Bf; +- int rb, gb, bb; +- +- vips_col_Lab2XYZ( L, A, B, &X, &Y, &Z ); +- vips_col_XYZ2scRGB( X, Y, Z, &Rf, &Gf, &Bf ); +- vips_col_scRGB2sRGB_8( Rf, Gf, Bf, +- &rb, &gb, &bb, NULL ); +- +- t = INDEX( l, a, b ); +- vips_red[t] = rb; +- vips_green[t] = gb; +- vips_blue[t] = bb; +- } +- } +- } +- +- return( NULL ); ++ for (l = 0; l < 64; l++) { ++ for (a = 0; a < 64; a++) { ++ for (b = 0; b < 64; b++) { ++ /* Scale to lab space. ++ */ ++ float L = (l << 2) * (100.0 / 256.0); ++ float A = (signed char) (a << 2); ++ float B = (signed char) (b << 2); ++ float X, Y, Z; ++ float Rf, Gf, Bf; ++ int rb, gb, bb; ++ ++ vips_col_Lab2XYZ(L, A, B, &X, &Y, &Z); ++ vips_col_XYZ2scRGB(X, Y, Z, &Rf, &Gf, &Bf); ++ vips_col_scRGB2sRGB_8(Rf, Gf, Bf, ++ &rb, &gb, &bb, NULL); ++ ++ t = INDEX(l, a, b); ++ vips_red[t] = rb; ++ vips_green[t] = gb; ++ vips_blue[t] = bb; ++ } ++ } ++ } ++ ++ return (NULL); + } + + static void +-vips_col_make_tables_LabQ2sRGB( void ) ++vips_col_make_tables_LabQ2sRGB(void) + { + static GOnce once = G_ONCE_INIT; + +- VIPS_ONCE( &once, build_tables, NULL ); ++ VIPS_ONCE(&once, build_tables, NULL); + } + + /* Process a buffer of data. + */ + static void +-vips_LabQ2sRGB_line( VipsColour *colour, VipsPel *q, VipsPel **in, int width ) +-{ ++vips_LabQ2sRGB_line(VipsColour *colour, VipsPel *q, VipsPel **in, int width) ++{ + unsigned char *p = (unsigned char *) in[0]; + +- int i, t; ++ int i, t; + + /* Current error. + */ +@@ -480,22 +481,22 @@ vips_LabQ2sRGB_line( VipsColour *colour, VipsPel *q, VipsPel **in, int width ) + + vips_col_make_tables_LabQ2sRGB(); + +- for( i = 0; i < width; i++ ) { +- /* Get colour, add in error from previous pixel. ++ for (i = 0; i < width; i++) { ++ /* Get colour, add in error from previous pixel. + */ +- int L = p[0] + le; +- int A = (signed char) p[1] + ae; +- int B = (signed char) p[2] + be; ++ int L = p[0] + le; ++ int A = (signed char) p[1] + ae; ++ int B = (signed char) p[2] + be; + + p += 4; + + /* Look out for overflow. + */ +- L = VIPS_MIN( 255, L ); +- A = VIPS_MIN( 127, A ); +- B = VIPS_MIN( 127, B ); ++ L = VIPS_MIN(255, L); ++ A = VIPS_MIN(127, A); ++ B = VIPS_MIN(127, B); + +- /* Find new quant error. This will always be +ve. ++ /* Find new quant error. This will always be +ve. + */ + le = L & 3; + ae = A & 3; +@@ -503,38 +504,38 @@ vips_LabQ2sRGB_line( VipsColour *colour, VipsPel *q, VipsPel **in, int width ) + + /* Scale to 0-63. + */ +- L = (L >> 2) & 63; +- A = (A >> 2) & 63; +- B = (B >> 2) & 63; ++ L = (L >> 2) & 63; ++ A = (A >> 2) & 63; ++ B = (B >> 2) & 63; + + /* Convert to RGB. + */ +- t = INDEX( L, A, B ); +- q[0] = vips_red[t]; +- q[1] = vips_green[t]; +- q[2] = vips_blue[t]; ++ t = INDEX(L, A, B); ++ q[0] = vips_red[t]; ++ q[1] = vips_green[t]; ++ q[2] = vips_blue[t]; + +- q += 3; +- } ++ q += 3; ++ } + } + + static void +-vips_LabQ2sRGB_class_init( VipsLabQ2sRGBClass *class ) ++vips_LabQ2sRGB_class_init(VipsLabQ2sRGBClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "LabQ2sRGB"; +- object_class->description = _( "convert a LabQ image to sRGB" ); ++ object_class->description = _("convert a LabQ image to sRGB"); + + colour_class->process_line = vips_LabQ2sRGB_line; + } + + static void +-vips_LabQ2sRGB_init( VipsLabQ2sRGB *LabQ2sRGB ) ++vips_LabQ2sRGB_init(VipsLabQ2sRGB *LabQ2sRGB) + { +- VipsColour *colour = VIPS_COLOUR( LabQ2sRGB ); +- VipsColourCode *code = VIPS_COLOUR_CODE( LabQ2sRGB ); ++ VipsColour *colour = VIPS_COLOUR(LabQ2sRGB); ++ VipsColourCode *code = VIPS_COLOUR_CODE(LabQ2sRGB); + + colour->coding = VIPS_CODING_NONE; + colour->interpretation = VIPS_INTERPRETATION_sRGB; +@@ -557,14 +558,14 @@ vips_LabQ2sRGB_init( VipsLabQ2sRGB *LabQ2sRGB ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_LabQ2sRGB( VipsImage *in, VipsImage **out, ... ) ++vips_LabQ2sRGB(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "LabQ2sRGB", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("LabQ2sRGB", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/LabS2Lab.c b/libvips/colour/LabS2Lab.c +index a3aaccbbb5..c40e7d0360 100644 +--- a/libvips/colour/LabS2Lab.c ++++ b/libvips/colour/LabS2Lab.c +@@ -1,4 +1,4 @@ +-/* LabS2Lab() ++/* LabS2Lab() + * + * 12/12/02 JC + * - adapted from im_LabS2LabQ() +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -47,18 +47,18 @@ + typedef VipsColourCode VipsLabS2Lab; + typedef VipsColourCodeClass VipsLabS2LabClass; + +-G_DEFINE_TYPE( VipsLabS2Lab, vips_LabS2Lab, VIPS_TYPE_COLOUR_CODE ); ++G_DEFINE_TYPE(VipsLabS2Lab, vips_LabS2Lab, VIPS_TYPE_COLOUR_CODE); + + /* Convert n pels from signed short to Lab. + */ + static void +-vips_LabS2Lab_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_LabS2Lab_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { + signed short *p = (signed short *) in[0]; + float *q = (float *) out; + int i; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + q[0] = p[0] / (32767.0 / 100.0); + q[1] = p[1] / (32768.0 / 128.0); + q[2] = p[2] / (32768.0 / 128.0); +@@ -69,22 +69,22 @@ vips_LabS2Lab_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static void +-vips_LabS2Lab_class_init( VipsLabS2LabClass *class ) ++vips_LabS2Lab_class_init(VipsLabS2LabClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "LabS2Lab"; +- object_class->description = _( "transform signed short Lab to float" ); ++ object_class->description = _("transform signed short Lab to float"); + + colour_class->process_line = vips_LabS2Lab_line; + } + + static void +-vips_LabS2Lab_init( VipsLabS2Lab *LabS2Lab ) ++vips_LabS2Lab_init(VipsLabS2Lab *LabS2Lab) + { +- VipsColour *colour = VIPS_COLOUR( LabS2Lab ); +- VipsColourCode *code = VIPS_COLOUR_CODE( LabS2Lab ); ++ VipsColour *colour = VIPS_COLOUR(LabS2Lab); ++ VipsColourCode *code = VIPS_COLOUR_CODE(LabS2Lab); + + colour->interpretation = VIPS_INTERPRETATION_LAB; + colour->format = VIPS_FORMAT_FLOAT; +@@ -108,15 +108,14 @@ vips_LabS2Lab_init( VipsLabS2Lab *LabS2Lab ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_LabS2Lab( VipsImage *in, VipsImage **out, ... ) ++vips_LabS2Lab(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "LabS2Lab", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("LabS2Lab", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/colour/LabS2LabQ.c b/libvips/colour/LabS2LabQ.c +index 1810dbc88c..a9852ca382 100644 +--- a/libvips/colour/LabS2LabQ.c ++++ b/libvips/colour/LabS2LabQ.c +@@ -19,28 +19,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -58,44 +58,44 @@ + typedef VipsColourCode VipsLabS2LabQ; + typedef VipsColourCodeClass VipsLabS2LabQClass; + +-G_DEFINE_TYPE( VipsLabS2LabQ, vips_LabS2LabQ, VIPS_TYPE_COLOUR_CODE ); ++G_DEFINE_TYPE(VipsLabS2LabQ, vips_LabS2LabQ, VIPS_TYPE_COLOUR_CODE); + + /* Convert n pels from signed short to IM_CODING_LABQ. + */ + static void +-vips_LabS2LabQ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_LabS2LabQ_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { + signed short *p = (signed short *) in[0]; + unsigned char *q = (unsigned char *) out; + + int i; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + int l, a, b; + unsigned char ext; + +- /* Get LAB, rounding to 10, 11, 11. ++ /* Get LAB, rounding to 10, 11, 11. + */ + l = p[0] + 16; +- l = VIPS_CLIP( 0, l, 32767 ); ++ l = VIPS_CLIP(0, l, 32767); + l >>= 5; + + /* Make sure we round -ves in the right direction! + */ + a = p[1]; +- if( a >= 0 ) ++ if (a >= 0) + a += 16; + else + a -= 16; +- a = VIPS_CLIP( -32768, a, 32767 ); ++ a = VIPS_CLIP(-32768, a, 32767); + a >>= 5; + + b = p[2]; +- if( b >= 0 ) ++ if (b >= 0) + b += 16; + else + b -= 16; +- b = VIPS_CLIP( -32768, b, 32767 ); ++ b = VIPS_CLIP(-32768, b, 32767); + b >>= 5; + + p += 3; +@@ -118,22 +118,22 @@ vips_LabS2LabQ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static void +-vips_LabS2LabQ_class_init( VipsLabS2LabQClass *class ) ++vips_LabS2LabQ_class_init(VipsLabS2LabQClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "LabS2LabQ"; +- object_class->description = _( "transform short Lab to LabQ coding" ); ++ object_class->description = _("transform short Lab to LabQ coding"); + + colour_class->process_line = vips_LabS2LabQ_line; + } + + static void +-vips_LabS2LabQ_init( VipsLabS2LabQ *LabS2LabQ ) ++vips_LabS2LabQ_init(VipsLabS2LabQ *LabS2LabQ) + { +- VipsColour *colour = VIPS_COLOUR( LabS2LabQ ); +- VipsColourCode *code = VIPS_COLOUR_CODE( LabS2LabQ ); ++ VipsColour *colour = VIPS_COLOUR(LabS2LabQ); ++ VipsColourCode *code = VIPS_COLOUR_CODE(LabS2LabQ); + + colour->coding = VIPS_CODING_LABQ; + colour->interpretation = VIPS_INTERPRETATION_LABQ; +@@ -158,14 +158,14 @@ vips_LabS2LabQ_init( VipsLabS2LabQ *LabS2LabQ ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_LabS2LabQ( VipsImage *in, VipsImage **out, ... ) ++vips_LabS2LabQ(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "LabS2LabQ", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("LabS2LabQ", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/UCS2LCh.c b/libvips/colour/UCS2LCh.c +index c021e0f617..84a6708d61 100644 +--- a/libvips/colour/UCS2LCh.c ++++ b/libvips/colour/UCS2LCh.c +@@ -15,28 +15,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -61,77 +61,76 @@ static float hI[101][361]; + typedef VipsColourTransform VipsCMC2LCh; + typedef VipsColourTransformClass VipsCMC2LChClass; + +-G_DEFINE_TYPE( VipsCMC2LCh, vips_CMC2LCh, VIPS_TYPE_COLOUR_TRANSFORM ); ++G_DEFINE_TYPE(VipsCMC2LCh, vips_CMC2LCh, VIPS_TYPE_COLOUR_TRANSFORM); + +-/* Generate LI (inverse) tables. ++/* Generate LI (inverse) tables. + */ + static void +-make_LI( void ) ++make_LI(void) + { + int i; + float Ll[1001]; + +- for( i = 0; i < 1001; i++ ) +- Ll[i] = vips_col_L2Lcmc( i / 10.0 ); ++ for (i = 0; i < 1001; i++) ++ Ll[i] = vips_col_L2Lcmc(i / 10.0); + +- for( i = 0; i < 1001; i++ ) { ++ for (i = 0; i < 1001; i++) { + int j; + + /* Must be 1000, since j will be +1 on exit. + */ +- for( j = 0; j < 1000 && Ll[j] <= i / 10.0; j++ ) ++ for (j = 0; j < 1000 && Ll[j] <= i / 10.0; j++) + ; + +- LI[i] = (j - 1) / 10.0 + ++ LI[i] = (j - 1) / 10.0 + + (i / 10.0 - Ll[j - 1]) / ((Ll[j] - Ll[j - 1]) * 10.0); + } + } + +-/* Generate Ccmc table. ++/* Generate Ccmc table. + */ + static void +-make_CI( void ) ++make_CI(void) + { + int i; + float Cl[3001]; + +- for( i = 0; i < 3001; i++ ) +- Cl[i] = vips_col_C2Ccmc( i / 10.0 ); ++ for (i = 0; i < 3001; i++) ++ Cl[i] = vips_col_C2Ccmc(i / 10.0); + +- for( i = 0; i < 3001; i++ ) { ++ for (i = 0; i < 3001; i++) { + int j; + + /* Must be 3000, since j will be +1 on exit. + */ +- for( j = 0; j < 3000 && Cl[j] <= i / 10.0; j++ ) ++ for (j = 0; j < 3000 && Cl[j] <= i / 10.0; j++) + ; + +- CI[i] = (j - 1) / 10.0 + ++ CI[i] = (j - 1) / 10.0 + + (i / 10.0 - Cl[j - 1]) / ((Cl[j] - Cl[j - 1]) * 10.0); + } + } + +-/* The difficult one: hcmc. ++/* The difficult one: hcmc. + */ + static void +-make_hI( void ) ++make_hI(void) + { + int i, j; + float hl[101][361]; + +- for( i = 0; i < 361; i++ ) +- for( j = 0; j < 101; j++ ) +- hl[j][i] = vips_col_Ch2hcmc( j * 2.0, i ); ++ for (i = 0; i < 361; i++) ++ for (j = 0; j < 101; j++) ++ hl[j][i] = vips_col_Ch2hcmc(j * 2.0, i); + +- for( j = 0; j < 101; j++ ) { +- for( i = 0; i < 361; i++ ) { ++ for (j = 0; j < 101; j++) { ++ for (i = 0; i < 361; i++) { + int k; + +- for( k = 1; k < 360 && hl[j][k] <= i; k++ ) ++ for (k = 1; k < 360 && hl[j][k] <= i; k++) + ; + +- hI[j][i] = k - 1 + (i - hl[j][k - 1]) / +- (hl[j][k] - hl[j][k - 1]); ++ hI[j][i] = k - 1 + (i - hl[j][k - 1]) / (hl[j][k] - hl[j][k - 1]); + } + } + } +@@ -146,37 +145,37 @@ make_hI( void ) + * Returns: L* + */ + float +-vips_col_Lcmc2L( float Lcmc ) +-{ ++vips_col_Lcmc2L(float Lcmc) ++{ + int known; + +- known = VIPS_FLOOR( Lcmc * 10.0 ); +- known = VIPS_CLIP( 0, known, 999 ); ++ known = VIPS_FLOOR(Lcmc * 10.0); ++ known = VIPS_CLIP(0, known, 999); + +- return( LI[known] + +- (LI[known + 1] - LI[known]) * (Lcmc * 10.0 - known) ); ++ return (LI[known] + ++ (LI[known + 1] - LI[known]) * (Lcmc * 10.0 - known)); + } + + /** + * vips_col_Ccmc2C: + * @Ccmc: Ccmc + * +- * Calculate C from Ccmc using a table. ++ * Calculate C from Ccmc using a table. + * Call vips_col_make_tables_CMC() at + * least once before using this function. + * + * Returns: C. + */ + float +-vips_col_Ccmc2C( float Ccmc ) +-{ ++vips_col_Ccmc2C(float Ccmc) ++{ + int known; + +- known = VIPS_FLOOR( Ccmc * 10.0 ); +- known = VIPS_CLIP( 0, known, 2999 ); ++ known = VIPS_FLOOR(Ccmc * 10.0); ++ known = VIPS_CLIP(0, known, 2999); + +- return( CI[known] + +- (CI[known + 1] - CI[known]) * (Ccmc * 10.0 - known) ); ++ return (CI[known] + ++ (CI[known + 1] - CI[known]) * (Ccmc * 10.0 - known)); + } + + /** +@@ -191,66 +190,66 @@ vips_col_Ccmc2C( float Ccmc ) + * Returns: h. + */ + float +-vips_col_Chcmc2h( float C, float hcmc ) +-{ ++vips_col_Chcmc2h(float C, float hcmc) ++{ + int r; + int known; + + /* Which row of the table? + */ + r = (int) ((C + 1.0) / 2.0); +- r = VIPS_CLIP( 0, r, 99 ); ++ r = VIPS_CLIP(0, r, 99); + +- known = VIPS_FLOOR( hcmc ); +- known = VIPS_CLIP( 0, known, 359 ); ++ known = VIPS_FLOOR(hcmc); ++ known = VIPS_CLIP(0, known, 359); + +- return( hI[r][known] + +- (hI[r][(known + 1) % 360] - hI[r][known]) * (hcmc - known) ); ++ return (hI[r][known] + ++ (hI[r][(known + 1) % 360] - hI[r][known]) * (hcmc - known)); + } + + static void * +-tables_init( void *client ) +-{ ++tables_init(void *client) ++{ + make_LI(); + make_CI(); + make_hI(); + +- return( NULL ); ++ return (NULL); + } + + /** + * vips_col_make_tables_CMC: +- * ++ * + * Make the lookup tables for cmc. + */ + void +-vips_col_make_tables_CMC( void ) ++vips_col_make_tables_CMC(void) + { + static GOnce once = G_ONCE_INIT; + +- VIPS_ONCE( &once, tables_init, NULL ); ++ VIPS_ONCE(&once, tables_init, NULL); + } + + /* Process a buffer of data. + */ + void +-vips_CMC2LCh_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_CMC2LCh_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { + float *p = (float *) in[0]; + float *q = (float *) out; + + int x; + +- for( x = 0; x < width; x++ ) { ++ for (x = 0; x < width; x++) { + float Lcmc = p[0]; + float Ccmc = p[1]; + float hcmc = p[2]; + + /* Turn from CMC. + */ +- float C = vips_col_Ccmc2C( Ccmc ); +- float h = vips_col_Chcmc2h( C, hcmc ); +- float L = vips_col_Lcmc2L( Lcmc ); ++ float C = vips_col_Ccmc2C(Ccmc); ++ float h = vips_col_Chcmc2h(C, hcmc); ++ float L = vips_col_Lcmc2L(Lcmc); + + p += 3; + +@@ -263,21 +262,21 @@ vips_CMC2LCh_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static void +-vips_CMC2LCh_class_init( VipsCMC2LChClass *class ) ++vips_CMC2LCh_class_init(VipsCMC2LChClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "CMC2LCh"; +- object_class->description = _( "transform LCh to CMC" ); ++ object_class->description = _("transform LCh to CMC"); + + colour_class->process_line = vips_CMC2LCh_line; + } + + static void +-vips_CMC2LCh_init( VipsCMC2LCh *CMC2LCh ) ++vips_CMC2LCh_init(VipsCMC2LCh *CMC2LCh) + { +- VipsColour *colour = VIPS_COLOUR( CMC2LCh ); ++ VipsColour *colour = VIPS_COLOUR(CMC2LCh); + + vips_col_make_tables_CMC(); + colour->interpretation = VIPS_INTERPRETATION_LCH; +@@ -291,20 +290,19 @@ vips_CMC2LCh_init( VipsCMC2LCh *CMC2LCh ) + * + * Turn LCh to CMC. + * +- * See also: vips_LCh2CMC(). ++ * See also: vips_LCh2CMC(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_CMC2LCh( VipsImage *in, VipsImage **out, ... ) ++vips_CMC2LCh(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "CMC2LCh", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("CMC2LCh", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/colour/XYZ2CMYK.c b/libvips/colour/XYZ2CMYK.c +index 881458d4f6..b4b58709b0 100644 +--- a/libvips/colour/XYZ2CMYK.c ++++ b/libvips/colour/XYZ2CMYK.c +@@ -9,28 +9,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -60,73 +60,73 @@ typedef struct _VipsXYZ2CMYK { + + typedef VipsColourCodeClass VipsXYZ2CMYKClass; + +-G_DEFINE_TYPE( VipsXYZ2CMYK, vips_XYZ2CMYK, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsXYZ2CMYK, vips_XYZ2CMYK, VIPS_TYPE_OPERATION); + + /* Our actual processing, as a VipsColourTransformFn. + */ + static int +-vips_XYZ2CMYK_process( VipsImage *in, VipsImage **out, ... ) ++vips_XYZ2CMYK_process(VipsImage *in, VipsImage **out, ...) + { +- return( vips_icc_export( in, out, ++ return (vips_icc_export(in, out, + "pcs", VIPS_PCS_XYZ, +- NULL ) ); ++ NULL)); + } + + static int +-vips_XYZ2CMYK_build( VipsObject *object ) ++vips_XYZ2CMYK_build(VipsObject *object) + { + VipsXYZ2CMYK *XYZ2CMYK = (VipsXYZ2CMYK *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + +- VipsImage *out; ++ VipsImage *out; + +- if( VIPS_OBJECT_CLASS( vips_XYZ2CMYK_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_XYZ2CMYK_parent_class)->build(object)) ++ return (-1); + + out = vips_image_new(); +- g_object_set( object, "out", out, NULL ); ++ g_object_set(object, "out", out, NULL); + +- if( vips_copy( XYZ2CMYK->in, &t[0], NULL ) || +- vips__profile_set( t[0], "cmyk" ) || +- vips__colourspace_process_n( "XYZ2CMYK", +- t[0], &t[1], 3, vips_XYZ2CMYK_process ) || +- vips_image_write( t[1], out ) ) +- return( -1 ); ++ if (vips_copy(XYZ2CMYK->in, &t[0], NULL) || ++ vips__profile_set(t[0], "cmyk") || ++ vips__colourspace_process_n("XYZ2CMYK", ++ t[0], &t[1], 3, vips_XYZ2CMYK_process) || ++ vips_image_write(t[1], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_XYZ2CMYK_class_init( VipsXYZ2CMYKClass *class ) ++vips_XYZ2CMYK_class_init(VipsXYZ2CMYKClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "XYZ2CMYK"; +- object_class->description = _( "transform XYZ to CMYK" ); ++ object_class->description = _("transform XYZ to CMYK"); + + object_class->build = vips_XYZ2CMYK_build; + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsXYZ2CMYK, in ) ); ++ G_STRUCT_OFFSET(VipsXYZ2CMYK, in)); + +- VIPS_ARG_IMAGE( class, "out", 100, +- _( "Output" ), +- _( "Output image" ), ++ VIPS_ARG_IMAGE(class, "out", 100, ++ _("Output"), ++ _("Output image"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsXYZ2CMYK, out ) ); ++ G_STRUCT_OFFSET(VipsXYZ2CMYK, out)); + } + + static void +-vips_XYZ2CMYK_init( VipsXYZ2CMYK *XYZ2CMYK ) ++vips_XYZ2CMYK_init(VipsXYZ2CMYK *XYZ2CMYK) + { + } + +@@ -138,7 +138,7 @@ typedef VipsColourCodeClass VipsXYZ2CMYKClass; + G_DEFINE_TYPE(VipsXYZ2CMYK, vips_XYZ2CMYK, VIPS_TYPE_COLOUR_CODE); + + void +-vips_XYZ2CMYK_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_XYZ2CMYK_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { + float *p = (float *) in[0]; + unsigned char *q = (unsigned char *) out; +@@ -147,7 +147,7 @@ vips_XYZ2CMYK_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + + int i; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + float r = p[0] / VIPS_D65_X0; + float g = p[1] / VIPS_D65_Y0; + float b = p[2] / VIPS_D65_Z0; +@@ -155,20 +155,20 @@ vips_XYZ2CMYK_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + float c = 1.0 - r; + float m = 1.0 - g; + float y = 1.0 - b; +- float k = VIPS_MIN( c, VIPS_MIN( m, y ) ); ++ float k = VIPS_MIN(c, VIPS_MIN(m, y)); + float ik = 1.0 - k; + +- if( ik < epsilon ) { ++ if (ik < epsilon) { + q[0] = 255; + q[1] = 255; + q[2] = 255; + q[3] = 255; + } + else { +- q[0] = VIPS_CLIP( 0, 255 * (c - k) / ik, 255 ); +- q[1] = VIPS_CLIP( 0, 255 * (m - k) / ik, 255 ); +- q[2] = VIPS_CLIP( 0, 255 * (y - k) / ik, 255 ); +- q[3] = VIPS_CLIP( 0, 255 * k, 255 ); ++ q[0] = VIPS_CLIP(0, 255 * (c - k) / ik, 255); ++ q[1] = VIPS_CLIP(0, 255 * (m - k) / ik, 255); ++ q[2] = VIPS_CLIP(0, 255 * (y - k) / ik, 255); ++ q[3] = VIPS_CLIP(0, 255 * k, 255); + } + + p += 3; +@@ -177,26 +177,26 @@ vips_XYZ2CMYK_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static void +-vips_XYZ2CMYK_class_init( VipsXYZ2CMYKClass *class ) ++vips_XYZ2CMYK_class_init(VipsXYZ2CMYKClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "XYZ2CMYK"; +- object_class->description = _( "transform XYZ to CMYK" ); +- ++ object_class->description = _("transform XYZ to CMYK"); ++ + colour_class->process_line = vips_XYZ2CMYK_line; + } + + static void +-vips_XYZ2CMYK_init( VipsXYZ2CMYK *XYZ2CMYK ) ++vips_XYZ2CMYK_init(VipsXYZ2CMYK *XYZ2CMYK) + { +- VipsColour *colour = VIPS_COLOUR( XYZ2CMYK ); +- VipsColourCode *code = VIPS_COLOUR_CODE( XYZ2CMYK ); ++ VipsColour *colour = VIPS_COLOUR(XYZ2CMYK); ++ VipsColourCode *code = VIPS_COLOUR_CODE(XYZ2CMYK); + + colour->interpretation = VIPS_INTERPRETATION_CMYK; + colour->format = VIPS_FORMAT_UCHAR; +@@ -218,22 +218,22 @@ vips_XYZ2CMYK_init( VipsXYZ2CMYK *XYZ2CMYK ) + * + * Turn XYZ to CMYK. If the image has an embedded ICC profile this will be + * used for the conversion. If there is no embedded profile, a generic +- * fallback profile will be used. ++ * fallback profile will be used. + * +- * Conversion is from D65 XYZ with relative intent. If you need more control ++ * Conversion is from D65 XYZ with relative intent. If you need more control + * over the process, use vips_icc_export() instead. + * + * Returns: 0 on success, -1 on error + */ + int +-vips_XYZ2CMYK( VipsImage *in, VipsImage **out, ... ) ++vips_XYZ2CMYK(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "XYZ2CMYK", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("XYZ2CMYK", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/XYZ2Lab.c b/libvips/colour/XYZ2Lab.c +index a849d4a8b0..5e18477004 100644 +--- a/libvips/colour/XYZ2Lab.c ++++ b/libvips/colour/XYZ2Lab.c +@@ -1,4 +1,4 @@ +-/* Turn XYZ to Lab colourspace. ++/* Turn XYZ to Lab colourspace. + * + * Modifed: + * 16/11/94 JC +@@ -23,28 +23,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -62,7 +62,7 @@ + #include "pcolour.h" + + #ifndef HAVE_CBRT +-#define cbrt( X ) pow( (X), 1.0 / 3.0 ) ++#define cbrt(X) pow((X), 1.0 / 3.0) + #endif /*!HAVE_CBRT*/ + + /* Lookup table size. +@@ -74,7 +74,7 @@ static float cbrt_table[QUANT_ELEMENTS]; + typedef struct _VipsXYZ2Lab { + VipsColourTransform parent_instance; + +- /* The colour temperature -- default to D65. ++ /* The colour temperature -- default to D65. + */ + VipsArea *temp; + +@@ -88,32 +88,32 @@ typedef struct _VipsXYZ2Lab { + + typedef VipsColourTransformClass VipsXYZ2LabClass; + +-G_DEFINE_TYPE( VipsXYZ2Lab, vips_XYZ2Lab, VIPS_TYPE_COLOUR_TRANSFORM ); ++G_DEFINE_TYPE(VipsXYZ2Lab, vips_XYZ2Lab, VIPS_TYPE_COLOUR_TRANSFORM); + + static void * +-table_init( void *client ) ++table_init(void *client) + { + int i; + +- for( i = 0; i < QUANT_ELEMENTS; i++ ) { ++ for (i = 0; i < QUANT_ELEMENTS; i++) { + float Y = (double) i / QUANT_ELEMENTS; + +- if( Y < 0.008856 ) ++ if (Y < 0.008856) + cbrt_table[i] = 7.787 * Y + (16.0 / 116.0); +- else +- cbrt_table[i] = cbrt( Y ); ++ else ++ cbrt_table[i] = cbrt(Y); + } + +- return( NULL ); ++ return (NULL); + } + + static void +-vips_col_XYZ2Lab_helper( VipsXYZ2Lab *XYZ2Lab, +- float X, float Y, float Z, float *L, float *a, float *b ) ++vips_col_XYZ2Lab_helper(VipsXYZ2Lab *XYZ2Lab, ++ float X, float Y, float Z, float *L, float *a, float *b) + { + static GOnce once = G_ONCE_INIT; + +- VIPS_ONCE( &once, table_init, NULL ); ++ VIPS_ONCE(&once, table_init, NULL); + + float nX, nY, nZ; + int i; +@@ -126,15 +126,15 @@ vips_col_XYZ2Lab_helper( VipsXYZ2Lab *XYZ2Lab, + + /* CLIP is much faster than FCLIP, and we want an int result. + */ +- i = VIPS_CLIP( 0, (int) nX, QUANT_ELEMENTS - 2 ); ++ i = VIPS_CLIP(0, (int) nX, QUANT_ELEMENTS - 2); + f = nX - i; + cbx = cbrt_table[i] + f * (cbrt_table[i + 1] - cbrt_table[i]); + +- i = VIPS_CLIP( 0, (int) nY, QUANT_ELEMENTS - 2 ); ++ i = VIPS_CLIP(0, (int) nY, QUANT_ELEMENTS - 2); + f = nY - i; + cby = cbrt_table[i] + f * (cbrt_table[i + 1] - cbrt_table[i]); + +- i = VIPS_CLIP( 0, (int) nZ, QUANT_ELEMENTS - 2 ); ++ i = VIPS_CLIP(0, (int) nZ, QUANT_ELEMENTS - 2); + f = nZ - i; + cbz = cbrt_table[i] + f * (cbrt_table[i + 1] - cbrt_table[i]); + +@@ -146,7 +146,7 @@ vips_col_XYZ2Lab_helper( VipsXYZ2Lab *XYZ2Lab, + /* Process a buffer of data. + */ + static void +-vips_XYZ2Lab_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_XYZ2Lab_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { + VipsXYZ2Lab *XYZ2Lab = (VipsXYZ2Lab *) colour; + float *p = (float *) in[0]; +@@ -154,7 +154,7 @@ vips_XYZ2Lab_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + + int x; + +- for( x = 0; x < width; x++ ) { ++ for (x = 0; x < width; x++) { + float X, Y, Z; + float L, a, b; + +@@ -163,7 +163,7 @@ vips_XYZ2Lab_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + Z = p[2]; + p += 3; + +- vips_col_XYZ2Lab_helper( XYZ2Lab, X, Y, Z, &L, &a, &b ); ++ vips_col_XYZ2Lab_helper(XYZ2Lab, X, Y, Z, &L, &a, &b); + + q[0] = L; + q[1] = a; +@@ -182,69 +182,69 @@ vips_XYZ2Lab_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + * @b: (out): Return CIE Lab value + * + * Calculate XYZ from Lab, D65. +- * ++ * + * See also: vips_XYZ2Lab(). + */ + void +-vips_col_XYZ2Lab( float X, float Y, float Z, float *L, float *a, float *b ) ++vips_col_XYZ2Lab(float X, float Y, float Z, float *L, float *a, float *b) + { + VipsXYZ2Lab XYZ2Lab; + + XYZ2Lab.X0 = VIPS_D65_X0; + XYZ2Lab.Y0 = VIPS_D65_Y0; + XYZ2Lab.Z0 = VIPS_D65_Z0; +- vips_col_XYZ2Lab_helper( &XYZ2Lab, X, Y, Z, L, a, b ); ++ vips_col_XYZ2Lab_helper(&XYZ2Lab, X, Y, Z, L, a, b); + } + + static int +-vips_XYZ2Lab_build( VipsObject *object ) ++vips_XYZ2Lab_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsXYZ2Lab *XYZ2Lab = (VipsXYZ2Lab *) object; + +- if( XYZ2Lab->temp ) { +- if( vips_check_vector_length( class->nickname, +- XYZ2Lab->temp->n, 3 ) ) +- return( -1 ); ++ if (XYZ2Lab->temp) { ++ if (vips_check_vector_length(class->nickname, ++ XYZ2Lab->temp->n, 3)) ++ return (-1); + XYZ2Lab->X0 = ((double *) XYZ2Lab->temp->data)[0]; + XYZ2Lab->Y0 = ((double *) XYZ2Lab->temp->data)[1]; + XYZ2Lab->Z0 = ((double *) XYZ2Lab->temp->data)[2]; + } + +- if( VIPS_OBJECT_CLASS( vips_XYZ2Lab_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_XYZ2Lab_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_XYZ2Lab_class_init( VipsXYZ2LabClass *class ) ++vips_XYZ2Lab_class_init(VipsXYZ2LabClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "XYZ2Lab"; +- object_class->description = _( "transform XYZ to Lab" ); ++ object_class->description = _("transform XYZ to Lab"); + object_class->build = vips_XYZ2Lab_build; + + colour_class->process_line = vips_XYZ2Lab_line; + +- VIPS_ARG_BOXED( class, "temp", 110, +- _( "Temperature" ), +- _( "Colour temperature" ), ++ VIPS_ARG_BOXED(class, "temp", 110, ++ _("Temperature"), ++ _("Colour temperature"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsXYZ2Lab, temp ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsXYZ2Lab, temp), ++ VIPS_TYPE_ARRAY_DOUBLE); + } + + static void +-vips_XYZ2Lab_init( VipsXYZ2Lab *XYZ2Lab ) ++vips_XYZ2Lab_init(VipsXYZ2Lab *XYZ2Lab) + { +- VipsColour *colour = VIPS_COLOUR( XYZ2Lab ); ++ VipsColour *colour = VIPS_COLOUR(XYZ2Lab); + + XYZ2Lab->X0 = VIPS_D65_X0; + XYZ2Lab->Y0 = VIPS_D65_Y0; +@@ -264,19 +264,19 @@ vips_XYZ2Lab_init( VipsXYZ2Lab *XYZ2Lab ) + * * @temp: #VipsArrayDouble, colour temperature + * + * Turn XYZ to Lab, optionally specifying the colour temperature. @temp +- * defaults to D65. ++ * defaults to D65. + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_XYZ2Lab( VipsImage *in, VipsImage **out, ... ) ++vips_XYZ2Lab(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "XYZ2Lab", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("XYZ2Lab", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/XYZ2Yxy.c b/libvips/colour/XYZ2Yxy.c +index f166b4fb2a..eb2096da4a 100644 +--- a/libvips/colour/XYZ2Yxy.c ++++ b/libvips/colour/XYZ2Yxy.c +@@ -1,4 +1,4 @@ +-/* Turn XYZ to Yxy colourspace. ++/* Turn XYZ to Yxy colourspace. + * + * Modified: + * 29/5/02 JC +@@ -12,28 +12,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -52,17 +52,17 @@ + typedef VipsColourTransform VipsXYZ2Yxy; + typedef VipsColourTransformClass VipsXYZ2YxyClass; + +-G_DEFINE_TYPE( VipsXYZ2Yxy, vips_XYZ2Yxy, VIPS_TYPE_COLOUR_TRANSFORM ); ++G_DEFINE_TYPE(VipsXYZ2Yxy, vips_XYZ2Yxy, VIPS_TYPE_COLOUR_TRANSFORM); + + static void +-vips_XYZ2Yxy_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_XYZ2Yxy_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { +- float * restrict p = (float *) in[0]; +- float * restrict q = (float *) out; ++ float *restrict p = (float *) in[0]; ++ float *restrict q = (float *) out; + + int i; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + float X = p[0]; + float Y = p[1]; + float Z = p[2]; +@@ -72,7 +72,7 @@ vips_XYZ2Yxy_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + + p += 3; + +- x = X / total; ++ x = X / total; + y = Y / total; + + q[0] = Y; +@@ -83,21 +83,21 @@ vips_XYZ2Yxy_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static void +-vips_XYZ2Yxy_class_init( VipsXYZ2YxyClass *class ) ++vips_XYZ2Yxy_class_init(VipsXYZ2YxyClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "XYZ2Yxy"; +- object_class->description = _( "transform XYZ to Yxy" ); ++ object_class->description = _("transform XYZ to Yxy"); + + colour_class->process_line = vips_XYZ2Yxy_line; + } + + static void +-vips_XYZ2Yxy_init( VipsXYZ2Yxy *XYZ2Yxy ) ++vips_XYZ2Yxy_init(VipsXYZ2Yxy *XYZ2Yxy) + { +- VipsColour *colour = VIPS_COLOUR( XYZ2Yxy ); ++ VipsColour *colour = VIPS_COLOUR(XYZ2Yxy); + + colour->interpretation = VIPS_INTERPRETATION_YXY; + } +@@ -113,14 +113,14 @@ vips_XYZ2Yxy_init( VipsXYZ2Yxy *XYZ2Yxy ) + * Returns: 0 on success, -1 on error + */ + int +-vips_XYZ2Yxy( VipsImage *in, VipsImage **out, ... ) ++vips_XYZ2Yxy(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "XYZ2Yxy", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("XYZ2Yxy", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/XYZ2scRGB.c b/libvips/colour/XYZ2scRGB.c +index 3eeac1690c..4100fd5838 100644 +--- a/libvips/colour/XYZ2scRGB.c ++++ b/libvips/colour/XYZ2scRGB.c +@@ -1,4 +1,4 @@ +-/* Turn XYZ to scRGB colourspace. ++/* Turn XYZ to scRGB colourspace. + * + * 11/12/12 + * - from Yxy2XYZ.c +@@ -10,28 +10,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -50,33 +50,33 @@ + typedef VipsColourTransform VipsXYZ2scRGB; + typedef VipsColourTransformClass VipsXYZ2scRGBClass; + +-G_DEFINE_TYPE( VipsXYZ2scRGB, vips_XYZ2scRGB, VIPS_TYPE_COLOUR_TRANSFORM ); ++G_DEFINE_TYPE(VipsXYZ2scRGB, vips_XYZ2scRGB, VIPS_TYPE_COLOUR_TRANSFORM); + + /* We used to have the comment: + + * We've converted to sRGB without a profile. We must remove any ICC + * profile left over from import or there will be a mismatch between +- * pixel values and the attached profile. ++ * pixel values and the attached profile. + +- But this isn't right, we often call things sRGB that we know are not true ++ But this isn't right, we often call things sRGB that we know are not true + sRGB, for example: + +- vips sharpen k2.jpg x.jpg ++ vips sharpen k2.jpg x.jpg + +- sharpen will treat k2 as being in sRGB space even if that image has a ++ sharpen will treat k2 as being in sRGB space even if that image has a + profile. If we drop the profile, x.jpg is suddenly untagged. + + */ + + void +-vips_XYZ2scRGB_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_XYZ2scRGB_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { +- float * restrict p = (float *) in[0]; +- float * restrict q = (float *) out; ++ float *restrict p = (float *) in[0]; ++ float *restrict q = (float *) out; + + int i; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + float X = p[0]; + float Y = p[1]; + float Z = p[2]; +@@ -85,7 +85,7 @@ vips_XYZ2scRGB_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + + p += 3; + +- vips_col_XYZ2scRGB( X, Y, Z, &R, &G, &B ); ++ vips_col_XYZ2scRGB(X, Y, Z, &R, &G, &B); + + q[0] = R; + q[1] = G; +@@ -96,21 +96,21 @@ vips_XYZ2scRGB_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static void +-vips_XYZ2scRGB_class_init( VipsXYZ2scRGBClass *class ) ++vips_XYZ2scRGB_class_init(VipsXYZ2scRGBClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "XYZ2scRGB"; +- object_class->description = _( "transform XYZ to scRGB" ); ++ object_class->description = _("transform XYZ to scRGB"); + + colour_class->process_line = vips_XYZ2scRGB_line; + } + + static void +-vips_XYZ2scRGB_init( VipsXYZ2scRGB *XYZ2scRGB ) ++vips_XYZ2scRGB_init(VipsXYZ2scRGB *XYZ2scRGB) + { +- VipsColour *colour = VIPS_COLOUR( XYZ2scRGB ); ++ VipsColour *colour = VIPS_COLOUR(XYZ2scRGB); + + colour->interpretation = VIPS_INTERPRETATION_scRGB; + } +@@ -126,15 +126,14 @@ vips_XYZ2scRGB_init( VipsXYZ2scRGB *XYZ2scRGB ) + * Returns: 0 on success, -1 on error + */ + int +-vips_XYZ2scRGB( VipsImage *in, VipsImage **out, ... ) ++vips_XYZ2scRGB(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "XYZ2scRGB", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("XYZ2scRGB", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/colour/Yxy2XYZ.c b/libvips/colour/Yxy2XYZ.c +index 55ae24f76c..7f73b91e25 100644 +--- a/libvips/colour/Yxy2XYZ.c ++++ b/libvips/colour/Yxy2XYZ.c +@@ -1,4 +1,4 @@ +-/* Turn Yxy to XYZ colourspace. ++/* Turn Yxy to XYZ colourspace. + * + * Modified: + * 29/5/02 JC +@@ -14,28 +14,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -54,25 +54,25 @@ + typedef VipsColourTransform VipsYxy2XYZ; + typedef VipsColourTransformClass VipsYxy2XYZClass; + +-G_DEFINE_TYPE( VipsYxy2XYZ, vips_Yxy2XYZ, VIPS_TYPE_COLOUR_TRANSFORM ); ++G_DEFINE_TYPE(VipsYxy2XYZ, vips_Yxy2XYZ, VIPS_TYPE_COLOUR_TRANSFORM); + + void +-vips_Yxy2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_Yxy2XYZ_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { +- float * restrict p = (float *) in[0]; +- float * restrict q = (float *) out; ++ float *restrict p = (float *) in[0]; ++ float *restrict q = (float *) out; + + int i; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + float Y = p[0]; + float x = p[1]; + float y = p[2]; + + float X, Z; + +- if( x == 0.0 || +- y == 0.0 ) { ++ if (x == 0.0 || ++ y == 0.0) { + X = 0.0; + Z = 0.0; + } +@@ -94,21 +94,21 @@ vips_Yxy2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static void +-vips_Yxy2XYZ_class_init( VipsYxy2XYZClass *class ) ++vips_Yxy2XYZ_class_init(VipsYxy2XYZClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "Yxy2XYZ"; +- object_class->description = _( "transform Yxy to XYZ" ); ++ object_class->description = _("transform Yxy to XYZ"); + + colour_class->process_line = vips_Yxy2XYZ_line; + } + + static void +-vips_Yxy2XYZ_init( VipsYxy2XYZ *Yxy2XYZ ) ++vips_Yxy2XYZ_init(VipsYxy2XYZ *Yxy2XYZ) + { +- VipsColour *colour = VIPS_COLOUR( Yxy2XYZ ); ++ VipsColour *colour = VIPS_COLOUR(Yxy2XYZ); + + colour->interpretation = VIPS_INTERPRETATION_XYZ; + } +@@ -124,15 +124,14 @@ vips_Yxy2XYZ_init( VipsYxy2XYZ *Yxy2XYZ ) + * Returns: 0 on success, -1 on error + */ + int +-vips_Yxy2XYZ( VipsImage *in, VipsImage **out, ... ) ++vips_Yxy2XYZ(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "Yxy2XYZ", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("Yxy2XYZ", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/colour/colour.c b/libvips/colour/colour.c +index 2bef067b92..465f141ddf 100644 +--- a/libvips/colour/colour.c ++++ b/libvips/colour/colour.c +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -53,8 +53,8 @@ + * @see_also: arithmetic + * @include: vips/vips.h + * +- * These operators let you transform coordinates and images between colour +- * spaces, calculate colour differences, and move ++ * These operators let you transform coordinates and images between colour ++ * spaces, calculate colour differences, and move + * to and from device spaces. + * + * All operations process colour from the first few bands and pass other bands +@@ -66,25 +66,25 @@ + * another 8 bits of exponent, common to all channels. They are widely used in + * the HDR imaging community. + * +- * The colour functions can be divided into three main groups. First, +- * functions to transform images between the different colour spaces supported +- * by VIPS: #VIPS_INTERPRETATION_sRGB, #VIPS_INTERPRETATION_scRGB, ++ * The colour functions can be divided into three main groups. First, ++ * functions to transform images between the different colour spaces supported ++ * by VIPS: #VIPS_INTERPRETATION_sRGB, #VIPS_INTERPRETATION_scRGB, + * #VIPS_INTERPRETATION_B_W, +- * #VIPS_INTERPRETATION_XYZ, #VIPS_INTERPRETATION_YXY, +- * #VIPS_INTERPRETATION_LAB, ++ * #VIPS_INTERPRETATION_XYZ, #VIPS_INTERPRETATION_YXY, ++ * #VIPS_INTERPRETATION_LAB, + * #VIPS_INTERPRETATION_LCH, and + * #VIPS_INTERPRETATION_CMC. + * + * There are also a set of minor colourspaces which are one of the above in a + * slightly different format: +- * #VIPS_INTERPRETATION_LAB, #VIPS_INTERPRETATION_LABQ, +- * #VIPS_INTERPRETATION_LABS, #VIPS_INTERPRETATION_LCH, ++ * #VIPS_INTERPRETATION_LAB, #VIPS_INTERPRETATION_LABQ, ++ * #VIPS_INTERPRETATION_LABS, #VIPS_INTERPRETATION_LCH, + * #VIPS_INTERPRETATION_RGB16, and #VIPS_INTERPRETATION_GREY16. + * + * Use vips_colourspace() to move an image to a +- * target colourspace using the best sequence of colour transform operations. ++ * target colourspace using the best sequence of colour transform operations. + * +- * Secondly, there are a set of operations for ++ * Secondly, there are a set of operations for + * calculating colour difference metrics. Finally, VIPS wraps LittleCMS and + * uses it to provide a set of operations for reading and writing images with + * ICC profiles. +@@ -97,13 +97,13 @@ + * + * The colour spaces supported by VIPS are: + * +- * * #VIPS_INTERPRETATION_LAB -- CIELAB '76 colourspace with a D65 white. This +- * uses three floats for each band, and bands have the obvious range. ++ * * #VIPS_INTERPRETATION_LAB -- CIELAB '76 colourspace with a D65 white. This ++ * uses three floats for each band, and bands have the obvious range. + * + * There are two + * variants, #VIPS_INTERPRETATION_LABQ and #VIPS_INTERPRETATION_LABS, which + * use ints to store values. These are less precise, but can be quicker to +- * store and process. ++ * store and process. + * + * #VIPS_INTERPRETATION_LCH is the same, but with a*b* as polar coordinates. + * Hue is expressed in degrees. +@@ -112,24 +112,24 @@ + * See #VIPS_D75_X0 and friends for values for the ranges + * under various illuminants. + * +- * #VIPS_INTERPRETATION_YXY is the same, but with little x and y. ++ * #VIPS_INTERPRETATION_YXY is the same, but with little x and y. + * + * * #VIPS_INTERPRETATION_scRGB -- a linear colourspace with the sRGB + * primaries. This is useful if you need linear light and don't care +- * much what the primaries are. ++ * much what the primaries are. + * + * Linearization is performed with the usual sRGB equations, see below. + * +- * * #VIPS_INTERPRETATION_sRGB -- the standard sRGB colourspace, see: ++ * * #VIPS_INTERPRETATION_sRGB -- the standard sRGB colourspace, see: + * [wikipedia sRGB](http://en.wikipedia.org/wiki/SRGB). + * +- * This uses three 8-bit values for each of RGB. ++ * This uses three 8-bit values for each of RGB. + * + * #VIPS_INTERPRETATION_RGB16 is the same, but using three 16-bit values for + * RGB. + * + * #VIPS_INTERPRETATION_HSV is sRGB, but in polar coordinates. +- * #VIPS_INTERPRETATION_LCH is much better, only use HSV if you have to. ++ * #VIPS_INTERPRETATION_LCH is much better, only use HSV if you have to. + * + * * #VIPS_INTERPRETATION_B_W -- a monochrome image, roughly G from sRGB. + * The grey value is +@@ -138,19 +138,19 @@ + * + * #VIPS_INTERPRETATION_GREY16 is the same, but using 16-bits. + * +- * * #VIPS_INTERPRETATION_CMC -- a colour space based on the CMC(1:1) +- * colour difference measurement. This is a highly uniform colour space, +- * much better than CIELAB for expressing small differences. ++ * * #VIPS_INTERPRETATION_CMC -- a colour space based on the CMC(1:1) ++ * colour difference measurement. This is a highly uniform colour space, ++ * much better than CIELAB for expressing small differences. + * + * The CMC colourspace is described in "Uniform Colour Space Based on the + * CMC(l:c) Colour-difference Formula", M R Luo and B Rigg, Journal of the +- * Society of Dyers and Colourists, vol 102, 1986. Distances in this ++ * Society of Dyers and Colourists, vol 102, 1986. Distances in this + * colourspace approximate, within 10% or so, differences in the CMC(l:c) + * colour difference formula. + * + * You can calculate metrics like CMC(2:1) by scaling the spaces before +- * finding differences. +- * ++ * finding differences. ++ * + */ + + /* Areas under curves for Dxx. 2 degree observer. +@@ -216,154 +216,152 @@ + * Areas under curves for black body at 3250K, 2 degree observer. + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsColour, vips_colour, VIPS_TYPE_OPERATION ); ++G_DEFINE_ABSTRACT_TYPE(VipsColour, vips_colour, VIPS_TYPE_OPERATION); + + /* Maximum number of input images -- why not? + */ + #define MAX_INPUT_IMAGES (64) + + static int +-vips_colour_gen( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_colour_gen(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion **ir = (VipsRegion **) seq; +- VipsColour *colour = VIPS_COLOUR( b ); +- VipsColourClass *class = VIPS_COLOUR_GET_CLASS( colour ); +- VipsRect *r = &or->valid; ++ VipsColour *colour = VIPS_COLOUR(b); ++ VipsColourClass *class = VIPS_COLOUR_GET_CLASS(colour); ++ VipsRect *r = & or->valid; + + int i, y; + VipsPel *p[MAX_INPUT_IMAGES], *q; + +- /* +- printf( "vips_colour_gen: %s, " +- "left = %d, top = %d, width = %d, height = %d\n", +- VIPS_OBJECT_CLASS( class )->nickname, +- r->left, r->top, r->width, r->height ); +- */ ++ /* ++ printf( "vips_colour_gen: %s, " ++ "left = %d, top = %d, width = %d, height = %d\n", ++ VIPS_OBJECT_CLASS( class )->nickname, ++ r->left, r->top, r->width, r->height ); ++ */ + +- if( vips_reorder_prepare_many( or->im, ir, r ) ) +- return( -1 ); ++ if (vips_reorder_prepare_many(or->im, ir, r)) ++ return (-1); + +- VIPS_GATE_START( "vips_colour_gen: work" ); ++ VIPS_GATE_START("vips_colour_gen: work"); + +- for( y = 0; y < r->height; y++ ) { +- for( i = 0; ir[i]; i++ ) +- p[i] = VIPS_REGION_ADDR( ir[i], r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ for (i = 0; ir[i]; i++) ++ p[i] = VIPS_REGION_ADDR(ir[i], r->left, r->top + y); + p[i] = NULL; +- q = VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ q = VIPS_REGION_ADDR(or, r->left, r->top + y); + +- class->process_line( colour, q, p, r->width ); ++ class->process_line(colour, q, p, r->width); + } + +- VIPS_GATE_STOP( "vips_colour_gen: work" ); ++ VIPS_GATE_STOP("vips_colour_gen: work"); + +- VIPS_COUNT_PIXELS( or, VIPS_OBJECT_GET_CLASS( colour )->nickname ); ++ VIPS_COUNT_PIXELS(or, VIPS_OBJECT_GET_CLASS(colour)->nickname); + +- return( 0 ); ++ return (0); + } + + static int +-vips_colour_build( VipsObject *object ) ++vips_colour_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsColour *colour = VIPS_COLOUR( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsColour *colour = VIPS_COLOUR(object); + + VipsImage **in; +- VipsImage **extra_bands; ++ VipsImage **extra_bands; + VipsImage *out; + + int i; + + #ifdef DEBUG +- printf( "vips_colour_build: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_colour_build: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- if( VIPS_OBJECT_CLASS( vips_colour_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_colour_parent_class)->build(object)) ++ return (-1); + +- if( colour->n > MAX_INPUT_IMAGES ) { +- vips_error( class->nickname, +- "%s", _( "too many input images" ) ); +- return( -1 ); ++ if (colour->n > MAX_INPUT_IMAGES) { ++ vips_error(class->nickname, ++ "%s", _("too many input images")); ++ return (-1); + } +- for( i = 0; i < colour->n; i++ ) +- if( vips_image_pio_input( colour->in[i] ) ) +- return( -1 ); ++ for (i = 0; i < colour->n; i++) ++ if (vips_image_pio_input(colour->in[i])) ++ return (-1); + + /* colour->in[] must be NULL-terminated, we can use it as an arg to + * vips_start_many(). + */ +- g_assert( !colour->in[colour->n] ); ++ g_assert(!colour->in[colour->n]); + + in = colour->in; +- extra_bands = (VipsImage **) +- vips_object_local_array( object, colour->n ); ++ extra_bands = (VipsImage **) ++ vips_object_local_array(object, colour->n); + + /* If there are more than @input_bands bands, we detach and reattach + * after processing. + */ +- if( colour->input_bands > 0 ) { +- VipsImage **new_in = (VipsImage **) +- vips_object_local_array( object, colour->n ); +- +- for( i = 0; i < colour->n; i++ ) { +- if( vips_check_bands_atleast( class->nickname, +- in[i], colour->input_bands ) ) +- return( -1 ); +- +- if( in[i]->Bands > colour->input_bands ) { +- if( vips_extract_band( in[i], &new_in[i], 0, +- "n", colour->input_bands, +- NULL ) ) +- return( -1 ); ++ if (colour->input_bands > 0) { ++ VipsImage **new_in = (VipsImage **) ++ vips_object_local_array(object, colour->n); ++ ++ for (i = 0; i < colour->n; i++) { ++ if (vips_check_bands_atleast(class->nickname, ++ in[i], colour->input_bands)) ++ return (-1); ++ ++ if (in[i]->Bands > colour->input_bands) { ++ if (vips_extract_band(in[i], &new_in[i], 0, ++ "n", colour->input_bands, ++ NULL)) ++ return (-1); + } + else { + new_in[i] = in[i]; +- g_object_ref( new_in[i] ); ++ g_object_ref(new_in[i]); + } + +- if( in[i]->Bands > colour->input_bands ) +- if( vips_extract_band( in[i], &extra_bands[i], +- colour->input_bands, +- "n", in[i]->Bands - +- colour->input_bands, +- NULL ) ) +- return( -1 ); ++ if (in[i]->Bands > colour->input_bands) ++ if (vips_extract_band(in[i], &extra_bands[i], ++ colour->input_bands, ++ "n", in[i]->Bands - colour->input_bands, ++ NULL)) ++ return (-1); + } + + in = new_in; + } + + out = vips_image_new(); +- if( vips_image_pipeline_array( out, +- VIPS_DEMAND_STYLE_THINSTRIP, in ) ) { +- g_object_unref( out ); +- return( -1 ); ++ if (vips_image_pipeline_array(out, ++ VIPS_DEMAND_STYLE_THINSTRIP, in)) { ++ g_object_unref(out); ++ return (-1); + } + out->Coding = colour->coding; + out->Type = colour->interpretation; + out->BandFmt = colour->format; + out->Bands = colour->bands; + +- if( colour->profile_filename && +- vips__profile_set( out, colour->profile_filename ) ) +- return( -1 ); ++ if (colour->profile_filename && ++ vips__profile_set(out, colour->profile_filename)) ++ return (-1); + +- if( vips_image_generate( out, +- vips_start_many, vips_colour_gen, vips_stop_many, +- in, colour ) ) { +- g_object_unref( out ); +- return( -1 ); ++ if (vips_image_generate(out, ++ vips_start_many, vips_colour_gen, vips_stop_many, ++ in, colour)) { ++ g_object_unref(out); ++ return (-1); + } + + /* Reattach higher bands, if necessary. If we have more than one input +- * image, just use the first extra bands. ++ * image, just use the first extra bands. + */ +- for( i = 0; i < colour->n; i++ ) +- if( extra_bands[i] ) { ++ for (i = 0; i < colour->n; i++) ++ if (extra_bands[i]) { + VipsImage *t1, *t2; + + /* We can't just reattach the extra bands: they might +@@ -372,55 +370,55 @@ vips_colour_build( VipsObject *object ) + * the image. + */ + +- if( vips_cast( extra_bands[i], &t1, out->BandFmt, +- NULL ) ) { +- g_object_unref( out ); +- return( -1 ); ++ if (vips_cast(extra_bands[i], &t1, out->BandFmt, ++ NULL)) { ++ g_object_unref(out); ++ return (-1); + } + +- if( vips_bandjoin2( out, t1, &t2, +- NULL ) ) { +- g_object_unref( t1 ); +- g_object_unref( out ); +- return( -1 ); ++ if (vips_bandjoin2(out, t1, &t2, ++ NULL)) { ++ g_object_unref(t1); ++ g_object_unref(out); ++ return (-1); + } +- g_object_unref( out ); +- g_object_unref( t1 ); ++ g_object_unref(out); ++ g_object_unref(t1); + out = t2; + + break; + } + +- g_object_set( colour, "out", out, NULL ); ++ g_object_set(colour, "out", out, NULL); + +- return( 0 ); ++ return (0); + } + + static void +-vips_colour_class_init( VipsColourClass *class ) ++vips_colour_class_init(VipsColourClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "colour"; +- vobject_class->description = _( "color operations" ); ++ vobject_class->description = _("color operations"); + vobject_class->build = vips_colour_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "out", 100, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsColour, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 100, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsColour, out)); + } + + static void +-vips_colour_init( VipsColour *colour ) ++vips_colour_init(VipsColour *colour) + { + colour->coding = VIPS_CODING_NONE; + colour->interpretation = VIPS_INTERPRETATION_sRGB; +@@ -429,66 +427,65 @@ vips_colour_init( VipsColour *colour ) + colour->input_bands = -1; + } + +-G_DEFINE_ABSTRACT_TYPE( VipsColourTransform, vips_colour_transform, +- VIPS_TYPE_COLOUR ); ++G_DEFINE_ABSTRACT_TYPE(VipsColourTransform, vips_colour_transform, ++ VIPS_TYPE_COLOUR); + + static int +-vips_colour_transform_build( VipsObject *object ) ++vips_colour_transform_build(VipsObject *object) + { +- VipsColour *colour = VIPS_COLOUR( object ); +- VipsColourTransform *transform = VIPS_COLOUR_TRANSFORM( object ); +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 1 ); ++ VipsColour *colour = VIPS_COLOUR(object); ++ VipsColourTransform *transform = VIPS_COLOUR_TRANSFORM(object); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 1); + + /* We only process float. + */ +- if( transform->in && +- transform->in->BandFmt != VIPS_FORMAT_FLOAT ) { +- if( vips_cast_float( transform->in, &t[0], NULL ) ) +- return( -1 ); ++ if (transform->in && ++ transform->in->BandFmt != VIPS_FORMAT_FLOAT) { ++ if (vips_cast_float(transform->in, &t[0], NULL)) ++ return (-1); + } + else { + t[0] = transform->in; +- g_object_ref( t[0] ); ++ g_object_ref(t[0]); + } + +- /* We always do 3 bands -> 3 bands. ++ /* We always do 3 bands -> 3 bands. + */ + colour->input_bands = 3; + + colour->n = 1; + colour->in = t; + +- if( VIPS_OBJECT_CLASS( vips_colour_transform_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_colour_transform_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_colour_transform_class_init( VipsColourTransformClass *class ) ++vips_colour_transform_class_init(VipsColourTransformClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "space"; +- vobject_class->description = _( "color space transformations" ); ++ vobject_class->description = _("color space transformations"); + vobject_class->build = vips_colour_transform_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsColourTransform, in ) ); ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsColourTransform, in)); + } + + static void +-vips_colour_transform_init( VipsColourTransform *space ) ++vips_colour_transform_init(VipsColourTransform *space) + { +- VipsColour *colour = (VipsColour *) space; ++ VipsColour *colour = (VipsColour *) space; + + /* What we write. interpretation should be overwritten in subclass + * builds. +@@ -499,15 +496,15 @@ vips_colour_transform_init( VipsColourTransform *space ) + colour->bands = 3; + } + +-G_DEFINE_ABSTRACT_TYPE( VipsColourCode, vips_colour_code, VIPS_TYPE_COLOUR ); ++G_DEFINE_ABSTRACT_TYPE(VipsColourCode, vips_colour_code, VIPS_TYPE_COLOUR); + + static int +-vips_colour_code_build( VipsObject *object ) ++vips_colour_code_build(VipsObject *object) + { +- VipsColour *colour = VIPS_COLOUR( object ); +- VipsColourCode *code = VIPS_COLOUR_CODE( object ); +- VipsColourCodeClass *class = VIPS_COLOUR_CODE_GET_CLASS( object ); +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 6 ); ++ VipsColour *colour = VIPS_COLOUR(object); ++ VipsColourCode *code = VIPS_COLOUR_CODE(object); ++ VipsColourCodeClass *class = VIPS_COLOUR_CODE_GET_CLASS(object); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 6); + + VipsImage *in; + +@@ -515,193 +512,190 @@ vips_colour_code_build( VipsObject *object ) + + /* If this is a LABQ and the coder wants uncoded, unpack. + */ +- if( in && ++ if (in && + in->Coding == VIPS_CODING_LABQ && +- code->input_coding == VIPS_CODING_NONE ) { +- if( vips_LabQ2Lab( in, &t[0], NULL ) ) +- return( -1 ); ++ code->input_coding == VIPS_CODING_NONE) { ++ if (vips_LabQ2Lab(in, &t[0], NULL)) ++ return (-1); + in = t[0]; + } + +- if( in && +- vips_check_coding( VIPS_OBJECT_CLASS( class )->nickname, +- in, code->input_coding ) ) +- return( -1 ); ++ if (in && ++ vips_check_coding(VIPS_OBJECT_CLASS(class)->nickname, ++ in, code->input_coding)) ++ return (-1); + +- if( in && ++ if (in && + code->input_coding == VIPS_CODING_NONE && + code->input_format != VIPS_FORMAT_NOTSET && +- in->BandFmt != code->input_format ) { +- if( vips_cast( in, &t[3], code->input_format, NULL ) ) +- return( -1 ); ++ in->BandFmt != code->input_format) { ++ if (vips_cast(in, &t[3], code->input_format, NULL)) ++ return (-1); + in = t[3]; + } + +- if( in && ++ if (in && + code->input_coding == VIPS_CODING_NONE && + code->input_interpretation != VIPS_INTERPRETATION_ERROR && +- in->Type != code->input_interpretation ) { +- if( vips_colourspace( in, &t[4], +- code->input_interpretation, NULL ) ) +- return( -1 ); ++ in->Type != code->input_interpretation) { ++ if (vips_colourspace(in, &t[4], ++ code->input_interpretation, NULL)) ++ return (-1); + in = t[4]; + } + + colour->n = 1; +- colour->in = VIPS_ARRAY( object, 2, VipsImage * ); ++ colour->in = VIPS_ARRAY(object, 2, VipsImage *); + colour->in[0] = in; + colour->in[1] = NULL; + +- if( VIPS_OBJECT_CLASS( vips_colour_code_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_colour_code_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_colour_code_class_init( VipsColourCodeClass *class ) ++vips_colour_code_class_init(VipsColourCodeClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "code"; +- vobject_class->description = _( "change color coding" ); ++ vobject_class->description = _("change color coding"); + vobject_class->build = vips_colour_code_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsColourCode, in ) ); ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsColourCode, in)); + } + + static void +-vips_colour_code_init( VipsColourCode *code ) ++vips_colour_code_init(VipsColourCode *code) + { + code->input_coding = VIPS_CODING_NONE; + code->input_interpretation = VIPS_INTERPRETATION_ERROR; + code->input_format = VIPS_FORMAT_NOTSET; + } + +-G_DEFINE_ABSTRACT_TYPE( VipsColourDifference, vips_colour_difference, +- VIPS_TYPE_COLOUR ); ++G_DEFINE_ABSTRACT_TYPE(VipsColourDifference, vips_colour_difference, ++ VIPS_TYPE_COLOUR); + + static int +-vips_colour_difference_build( VipsObject *object ) ++vips_colour_difference_build(VipsObject *object) + { +- VipsColour *colour = VIPS_COLOUR( object ); +- VipsColourDifference *difference = VIPS_COLOUR_DIFFERENCE( object ); ++ VipsColour *colour = VIPS_COLOUR(object); ++ VipsColourDifference *difference = VIPS_COLOUR_DIFFERENCE(object); + + VipsImage **t; + VipsImage *left; + VipsImage *right; + +- t = (VipsImage **) vips_object_local_array( object, 12 ); ++ t = (VipsImage **) vips_object_local_array(object, 12); + + left = difference->left; + right = difference->right; + +- if( left ) { +- if( vips_image_decode( left, &t[0] ) ) +- return( -1 ); ++ if (left) { ++ if (vips_image_decode(left, &t[0])) ++ return (-1); + left = t[0]; + } + +- if( right ) { +- if( vips_image_decode( right, &t[1] ) ) +- return( -1 ); ++ if (right) { ++ if (vips_image_decode(right, &t[1])) ++ return (-1); + right = t[1]; + } + +- /* Detach and reattach any extra bands. ++ /* Detach and reattach any extra bands. + */ + colour->input_bands = 3; + +- if( left && +- left->Type != difference->interpretation ) { +- if( vips_colourspace( left, &t[6], +- difference->interpretation, NULL ) ) +- return( -1 ); ++ if (left && ++ left->Type != difference->interpretation) { ++ if (vips_colourspace(left, &t[6], ++ difference->interpretation, NULL)) ++ return (-1); + left = t[6]; + } + +- if( right && +- right->Type != difference->interpretation ) { +- if( vips_colourspace( right, &t[7], +- difference->interpretation, NULL ) ) +- return( -1 ); ++ if (right && ++ right->Type != difference->interpretation) { ++ if (vips_colourspace(right, &t[7], ++ difference->interpretation, NULL)) ++ return (-1); + right = t[7]; + } + + /* We only process float. + */ +- if( left && +- left->BandFmt != VIPS_FORMAT_FLOAT ) { +- if( vips_cast_float( left, &t[8], NULL ) ) +- return( -1 ); ++ if (left && ++ left->BandFmt != VIPS_FORMAT_FLOAT) { ++ if (vips_cast_float(left, &t[8], NULL)) ++ return (-1); + left = t[8]; + } + +- if( right && +- right->BandFmt != VIPS_FORMAT_FLOAT ) { +- if( vips_cast_float( right, &t[9], NULL ) ) +- return( -1 ); ++ if (right && ++ right->BandFmt != VIPS_FORMAT_FLOAT) { ++ if (vips_cast_float(right, &t[9], NULL)) ++ return (-1); + right = t[9]; + } + +- if( vips__sizealike( left, right, &t[10], &t[11] ) ) +- return( -1 ); ++ if (vips__sizealike(left, right, &t[10], &t[11])) ++ return (-1); + left = t[10]; + right = t[11]; + + colour->n = 2; +- colour->in = VIPS_ARRAY( object, 3, VipsImage * ); ++ colour->in = VIPS_ARRAY(object, 3, VipsImage *); + colour->in[0] = left; + colour->in[1] = right; + colour->in[2] = NULL; + +- if( VIPS_OBJECT_CLASS( vips_colour_difference_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_colour_difference_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_colour_difference_class_init( VipsColourDifferenceClass *class ) ++vips_colour_difference_class_init(VipsColourDifferenceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "difference"; +- vobject_class->description = _( "calculate color difference" ); ++ vobject_class->description = _("calculate color difference"); + vobject_class->build = vips_colour_difference_build; + +- VIPS_ARG_IMAGE( class, "left", 1, +- _( "Left" ), +- _( "Left-hand input image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsColourDifference, left ) ); +- +- VIPS_ARG_IMAGE( class, "right", 2, +- _( "Right" ), +- _( "Right-hand input image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsColourDifference, right ) ); +- ++ VIPS_ARG_IMAGE(class, "left", 1, ++ _("Left"), ++ _("Left-hand input image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsColourDifference, left)); ++ ++ VIPS_ARG_IMAGE(class, "right", 2, ++ _("Right"), ++ _("Right-hand input image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsColourDifference, right)); + } + + static void +-vips_colour_difference_init( VipsColourDifference *difference ) ++vips_colour_difference_init(VipsColourDifference *difference) + { +- VipsColour *colour = VIPS_COLOUR( difference ); ++ VipsColour *colour = VIPS_COLOUR(difference); + + colour->coding = VIPS_CODING_NONE; + colour->interpretation = VIPS_INTERPRETATION_B_W; +@@ -713,45 +707,45 @@ vips_colour_difference_init( VipsColourDifference *difference ) + * instead? + */ + void +-vips_colour_operation_init( void ) ++vips_colour_operation_init(void) + { +- extern GType vips_colourspace_get_type( void ); +- extern GType vips_Lab2XYZ_get_type( void ); +- extern GType vips_XYZ2Lab_get_type( void ); +- extern GType vips_Lab2LCh_get_type( void ); +- extern GType vips_LCh2Lab_get_type( void ); +- extern GType vips_LCh2CMC_get_type( void ); +- extern GType vips_CMC2LCh_get_type( void ); +- extern GType vips_Yxy2XYZ_get_type( void ); +- extern GType vips_XYZ2Yxy_get_type( void ); +- extern GType vips_LabQ2Lab_get_type( void ); +- extern GType vips_Lab2LabQ_get_type( void ); +- extern GType vips_LabQ2LabS_get_type( void ); +- extern GType vips_LabS2LabQ_get_type( void ); +- extern GType vips_LabS2Lab_get_type( void ); +- extern GType vips_Lab2LabS_get_type( void ); +- extern GType vips_rad2float_get_type( void ); +- extern GType vips_float2rad_get_type( void ); +- extern GType vips_LabQ2sRGB_get_type( void ); +- extern GType vips_XYZ2sRGB_get_type( void ); +- extern GType vips_sRGB2scRGB_get_type( void ); +- extern GType vips_sRGB2HSV_get_type( void ); +- extern GType vips_HSV2sRGB_get_type( void ); +- extern GType vips_scRGB2XYZ_get_type( void ); +- extern GType vips_scRGB2BW_get_type( void ); +- extern GType vips_XYZ2scRGB_get_type( void ); +- extern GType vips_scRGB2sRGB_get_type( void ); +- extern GType vips_CMYK2XYZ_get_type( void ); +- extern GType vips_XYZ2CMYK_get_type( void ); +- extern GType vips_profile_load_get_type( void ); ++ extern GType vips_colourspace_get_type(void); ++ extern GType vips_Lab2XYZ_get_type(void); ++ extern GType vips_XYZ2Lab_get_type(void); ++ extern GType vips_Lab2LCh_get_type(void); ++ extern GType vips_LCh2Lab_get_type(void); ++ extern GType vips_LCh2CMC_get_type(void); ++ extern GType vips_CMC2LCh_get_type(void); ++ extern GType vips_Yxy2XYZ_get_type(void); ++ extern GType vips_XYZ2Yxy_get_type(void); ++ extern GType vips_LabQ2Lab_get_type(void); ++ extern GType vips_Lab2LabQ_get_type(void); ++ extern GType vips_LabQ2LabS_get_type(void); ++ extern GType vips_LabS2LabQ_get_type(void); ++ extern GType vips_LabS2Lab_get_type(void); ++ extern GType vips_Lab2LabS_get_type(void); ++ extern GType vips_rad2float_get_type(void); ++ extern GType vips_float2rad_get_type(void); ++ extern GType vips_LabQ2sRGB_get_type(void); ++ extern GType vips_XYZ2sRGB_get_type(void); ++ extern GType vips_sRGB2scRGB_get_type(void); ++ extern GType vips_sRGB2HSV_get_type(void); ++ extern GType vips_HSV2sRGB_get_type(void); ++ extern GType vips_scRGB2XYZ_get_type(void); ++ extern GType vips_scRGB2BW_get_type(void); ++ extern GType vips_XYZ2scRGB_get_type(void); ++ extern GType vips_scRGB2sRGB_get_type(void); ++ extern GType vips_CMYK2XYZ_get_type(void); ++ extern GType vips_XYZ2CMYK_get_type(void); ++ extern GType vips_profile_load_get_type(void); + #ifdef HAVE_LCMS2 +- extern GType vips_icc_import_get_type( void ); +- extern GType vips_icc_export_get_type( void ); +- extern GType vips_icc_transform_get_type( void ); ++ extern GType vips_icc_import_get_type(void); ++ extern GType vips_icc_export_get_type(void); ++ extern GType vips_icc_transform_get_type(void); + #endif +- extern GType vips_dE76_get_type( void ); +- extern GType vips_dE00_get_type( void ); +- extern GType vips_dECMC_get_type( void ); ++ extern GType vips_dE76_get_type(void); ++ extern GType vips_dE00_get_type(void); ++ extern GType vips_dECMC_get_type(void); + + vips_colourspace_get_type(); + vips_Lab2XYZ_get_type(); +@@ -774,19 +768,19 @@ vips_colour_operation_init( void ) + vips_sRGB2scRGB_get_type(); + vips_scRGB2XYZ_get_type(); + vips_scRGB2BW_get_type(); +- vips_sRGB2HSV_get_type(); +- vips_HSV2sRGB_get_type(); ++ vips_sRGB2HSV_get_type(); ++ vips_HSV2sRGB_get_type(); + vips_XYZ2scRGB_get_type(); + vips_scRGB2sRGB_get_type(); + vips_CMYK2XYZ_get_type(); + vips_XYZ2CMYK_get_type(); +- vips_profile_load_get_type(); ++ vips_profile_load_get_type(); + #ifdef HAVE_LCMS2 + vips_icc_import_get_type(); + vips_icc_export_get_type(); + vips_icc_transform_get_type(); + #endif +- vips_dE76_get_type(); +- vips_dE00_get_type(); +- vips_dECMC_get_type(); ++ vips_dE76_get_type(); ++ vips_dE00_get_type(); ++ vips_dECMC_get_type(); + } +diff --git a/libvips/colour/colourspace.c b/libvips/colour/colourspace.c +index e35be9cea7..e60d259883 100644 +--- a/libvips/colour/colourspace.c ++++ b/libvips/colour/colourspace.c +@@ -12,12 +12,12 @@ + * - add "source_space", overrides source space guess + * 8/5/14 + * - oops, don't treat RGB16 as sRGB +- * 9/9/14 ++ * 9/9/14 + * - mono <-> rgb converters were not handling extra bands, thanks James + * 4/2/15 + * - much faster RGB16->sRGB path + * 17/4/15 +- * - better conversion to greyscale, see ++ * - better conversion to greyscale, see + * https://github.com/lovell/sharp/issues/193 + * 27/12/18 + * - add CMYK conversions +@@ -25,28 +25,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -69,15 +69,15 @@ + #include "pcolour.h" + + static int +-vips_scRGB2RGB16( VipsImage *in, VipsImage **out, ... ) ++vips_scRGB2RGB16(VipsImage *in, VipsImage **out, ...) + { +- return( vips_scRGB2sRGB( in, out, "depth", 16, NULL ) ); ++ return (vips_scRGB2sRGB(in, out, "depth", 16, NULL)); + } + + static int +-vips_scRGB2BW16( VipsImage *in, VipsImage **out, ... ) ++vips_scRGB2BW16(VipsImage *in, VipsImage **out, ...) + { +- return( vips_scRGB2BW( in, out, "depth", 16, NULL ) ); ++ return (vips_scRGB2BW(in, out, "depth", 16, NULL)); + } + + /* Do these two with a simple cast ... since we're just cast shifting, we can +@@ -85,27 +85,27 @@ vips_scRGB2BW16( VipsImage *in, VipsImage **out, ... ) + */ + + static int +-vips_RGB162sRGB( VipsImage *in, VipsImage **out, ... ) ++vips_RGB162sRGB(VipsImage *in, VipsImage **out, ...) + { +- if( vips_cast( in, out, VIPS_FORMAT_UCHAR, +- "shift", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_cast(in, out, VIPS_FORMAT_UCHAR, ++ "shift", TRUE, ++ NULL)) ++ return (-1); + (*out)->Type = VIPS_INTERPRETATION_sRGB; + +- return( 0 ); ++ return (0); + } + + static int +-vips_sRGB2RGB16( VipsImage *in, VipsImage **out, ... ) ++vips_sRGB2RGB16(VipsImage *in, VipsImage **out, ...) + { +- if( vips_cast( in, out, VIPS_FORMAT_USHORT, +- "shift", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_cast(in, out, VIPS_FORMAT_USHORT, ++ "shift", TRUE, ++ NULL)) ++ return (-1); + (*out)->Type = VIPS_INTERPRETATION_RGB16; + +- return( 0 ); ++ return (0); + } + + /* Process the first @n bands with @fn, detach and reattach remaining bands. +@@ -113,80 +113,80 @@ vips_sRGB2RGB16( VipsImage *in, VipsImage **out, ... ) + * Also used by CMYK2XYZ and XYZ2CMYK. + */ + int +-vips__colourspace_process_n( const char *domain, +- VipsImage *in, VipsImage **out, int n, VipsColourTransformFn fn ) ++vips__colourspace_process_n(const char *domain, ++ VipsImage *in, VipsImage **out, int n, VipsColourTransformFn fn) + { +- if( in->Bands > n ) { ++ if (in->Bands > n) { + VipsImage *scope = vips_image_new(); +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( scope ), 4 ); +- +- if( vips_extract_band( in, &t[0], 0, +- "n", n, +- NULL ) || +- vips_extract_band( in, &t[1], n, +- "n", in->Bands - n, +- NULL ) || +- fn( t[0], &t[2], NULL ) || +- vips_cast( t[1], &t[3], t[2]->BandFmt, +- NULL ) || +- vips_bandjoin2( t[2], t[3], out, NULL ) ) { +- g_object_unref( scope ); +- return( -1 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(scope), 4); ++ ++ if (vips_extract_band(in, &t[0], 0, ++ "n", n, ++ NULL) || ++ vips_extract_band(in, &t[1], n, ++ "n", in->Bands - n, ++ NULL) || ++ fn(t[0], &t[2], NULL) || ++ vips_cast(t[1], &t[3], t[2]->BandFmt, ++ NULL) || ++ vips_bandjoin2(t[2], t[3], out, NULL)) { ++ g_object_unref(scope); ++ return (-1); + } + +- g_object_unref( scope ); ++ g_object_unref(scope); + } +- else if( in->Bands == n ) { +- if( fn( in, out, NULL ) ) +- return( -1 ); ++ else if (in->Bands == n) { ++ if (fn(in, out, NULL)) ++ return (-1); + } + else { +- vips_error( domain, "%s", _( "too few bands for operation" ) ); +- return( -1 ); ++ vips_error(domain, "%s", _("too few bands for operation")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_BW2sRGB_op( VipsImage *in, VipsImage **out, ... ) ++vips_BW2sRGB_op(VipsImage *in, VipsImage **out, ...) + { + VipsImage *t[3]; + + t[0] = in; + t[1] = in; + t[2] = in; +- if( vips_bandjoin( t, out, 3, NULL ) ) +- return( -1 ); ++ if (vips_bandjoin(t, out, 3, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_BW2sRGB( VipsImage *in, VipsImage **out, ... ) ++vips_BW2sRGB(VipsImage *in, VipsImage **out, ...) + { +- if( vips__colourspace_process_n( "BW2sRGB", +- in, out, 1, vips_BW2sRGB_op ) ) +- return( -1 ); ++ if (vips__colourspace_process_n("BW2sRGB", ++ in, out, 1, vips_BW2sRGB_op)) ++ return (-1); + (*out)->Type = VIPS_INTERPRETATION_sRGB; + +- return( 0 ); ++ return (0); + } + + static int +-vips_GREY162RGB16( VipsImage *in, VipsImage **out, ... ) ++vips_GREY162RGB16(VipsImage *in, VipsImage **out, ...) + { +- if( vips__colourspace_process_n( "GREY162RGB16", +- in, out, 1, vips_BW2sRGB_op ) ) +- return( -1 ); ++ if (vips__colourspace_process_n("GREY162RGB16", ++ in, out, 1, vips_BW2sRGB_op)) ++ return (-1); + (*out)->Type = VIPS_INTERPRETATION_RGB16; + +- return( 0 ); ++ return (0); + } + +-/* Maximum number of steps we allow in a route. 10 steps should be enough +- * for anyone. ++/* Maximum number of steps we allow in a route. 10 steps should be enough ++ * for anyone. + */ + #define MAX_STEPS (10) + +@@ -241,13 +241,10 @@ static VipsColourRoute vips_colour_routes[] = { + { LAB, CMYK, { vips_Lab2XYZ, vips_XYZ2CMYK, NULL } }, + { LAB, scRGB, { vips_Lab2XYZ, vips_XYZ2scRGB, NULL } }, + { LAB, sRGB, { vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2sRGB, NULL } }, +- { LAB, HSV, { vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2sRGB, +- vips_sRGB2HSV, NULL } }, ++ { LAB, HSV, { vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2sRGB, vips_sRGB2HSV, NULL } }, + { LAB, BW, { vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2BW, NULL } }, +- { LAB, RGB16, { vips_Lab2XYZ, vips_XYZ2scRGB, +- vips_scRGB2RGB16, NULL } }, +- { LAB, GREY16, { vips_Lab2XYZ, vips_XYZ2scRGB, +- vips_scRGB2BW16, NULL } }, ++ { LAB, RGB16, { vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2RGB16, NULL } }, ++ { LAB, GREY16, { vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2BW16, NULL } }, + { LAB, YXY, { vips_Lab2XYZ, vips_XYZ2Yxy, NULL } }, + + { LABQ, XYZ, { vips_LabQ2Lab, vips_Lab2XYZ, NULL } }, +@@ -259,12 +256,9 @@ static VipsColourRoute vips_colour_routes[] = { + { LABQ, scRGB, { vips_LabQ2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, NULL } }, + { LABQ, sRGB, { vips_LabQ2sRGB, NULL } }, + { LABQ, HSV, { vips_LabQ2sRGB, vips_sRGB2HSV, NULL } }, +- { LABQ, BW, { vips_LabQ2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, +- vips_scRGB2BW, NULL } }, +- { LABQ, RGB16, { vips_LabQ2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, +- vips_scRGB2RGB16, NULL } }, +- { LABQ, GREY16, { vips_LabQ2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, +- vips_scRGB2BW16, NULL } }, ++ { LABQ, BW, { vips_LabQ2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2BW, NULL } }, ++ { LABQ, RGB16, { vips_LabQ2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2RGB16, NULL } }, ++ { LABQ, GREY16, { vips_LabQ2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2BW16, NULL } }, + { LABQ, YXY, { vips_LabQ2Lab, vips_Lab2XYZ, vips_XYZ2Yxy, NULL } }, + + { LCH, XYZ, { vips_LCh2Lab, vips_Lab2XYZ, NULL } }, +@@ -274,16 +268,11 @@ static VipsColourRoute vips_colour_routes[] = { + { LCH, LABS, { vips_LCh2Lab, vips_Lab2LabS, NULL } }, + { LCH, CMYK, { vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2CMYK, NULL } }, + { LCH, scRGB, { vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, NULL } }, +- { LCH, sRGB, { vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, +- vips_scRGB2sRGB, NULL } }, +- { LCH, HSV, { vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, +- vips_scRGB2sRGB, vips_sRGB2HSV, NULL } }, +- { LCH, BW, { vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, +- vips_scRGB2BW, NULL } }, +- { LCH, RGB16, { vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, +- vips_scRGB2RGB16, NULL } }, +- { LCH, GREY16, { vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, +- vips_scRGB2BW16, NULL } }, ++ { LCH, sRGB, { vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2sRGB, NULL } }, ++ { LCH, HSV, { vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2sRGB, vips_sRGB2HSV, NULL } }, ++ { LCH, BW, { vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2BW, NULL } }, ++ { LCH, RGB16, { vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2RGB16, NULL } }, ++ { LCH, GREY16, { vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2BW16, NULL } }, + { LCH, YXY, { vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2Yxy, NULL } }, + + { CMC, XYZ, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, NULL } }, +@@ -291,22 +280,14 @@ static VipsColourRoute vips_colour_routes[] = { + { CMC, LABQ, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2LabQ, NULL } }, + { CMC, LCH, { vips_CMC2LCh, NULL } }, + { CMC, LABS, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2LabS, NULL } }, +- { CMC, CMYK, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, +- vips_XYZ2CMYK, NULL } }, +- { CMC, scRGB, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, +- vips_XYZ2scRGB, NULL } }, +- { CMC, sRGB, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, +- vips_XYZ2scRGB, vips_scRGB2sRGB, NULL } }, +- { CMC, HSV, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, +- vips_XYZ2scRGB, vips_scRGB2sRGB, vips_sRGB2HSV, NULL } }, +- { CMC, BW, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, +- vips_XYZ2scRGB, vips_scRGB2BW, NULL } }, +- { CMC, RGB16, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, +- vips_XYZ2scRGB, vips_scRGB2RGB16, NULL } }, +- { CMC, GREY16, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, +- vips_XYZ2scRGB, vips_scRGB2BW16, NULL } }, +- { CMC, YXY, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, +- vips_XYZ2Yxy, NULL } }, ++ { CMC, CMYK, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2CMYK, NULL } }, ++ { CMC, scRGB, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, NULL } }, ++ { CMC, sRGB, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2sRGB, NULL } }, ++ { CMC, HSV, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2sRGB, vips_sRGB2HSV, NULL } }, ++ { CMC, BW, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2BW, NULL } }, ++ { CMC, RGB16, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2RGB16, NULL } }, ++ { CMC, GREY16, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2BW16, NULL } }, ++ { CMC, YXY, { vips_CMC2LCh, vips_LCh2Lab, vips_Lab2XYZ, vips_XYZ2Yxy, NULL } }, + + { LABS, XYZ, { vips_LabS2Lab, vips_Lab2XYZ, NULL } }, + { LABS, LAB, { vips_LabS2Lab, NULL } }, +@@ -315,24 +296,18 @@ static VipsColourRoute vips_colour_routes[] = { + { LABS, CMC, { vips_LabS2Lab, vips_Lab2LCh, vips_LCh2CMC, NULL } }, + { LABS, CMYK, { vips_LabS2Lab, vips_Lab2XYZ, vips_XYZ2CMYK, NULL } }, + { LABS, scRGB, { vips_LabS2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, NULL } }, +- { LABS, sRGB, { vips_LabS2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, +- vips_scRGB2sRGB, NULL } }, +- { LABS, HSV, { vips_LabS2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, +- vips_scRGB2sRGB, vips_sRGB2HSV, NULL } }, +- { LABS, BW, { vips_LabS2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, +- vips_scRGB2BW, NULL } }, +- { LABS, RGB16, { vips_LabS2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, +- vips_scRGB2RGB16, NULL } }, +- { LABS, GREY16, { vips_LabS2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, +- vips_scRGB2BW16, NULL } }, ++ { LABS, sRGB, { vips_LabS2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2sRGB, NULL } }, ++ { LABS, HSV, { vips_LabS2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2sRGB, vips_sRGB2HSV, NULL } }, ++ { LABS, BW, { vips_LabS2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2BW, NULL } }, ++ { LABS, RGB16, { vips_LabS2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2RGB16, NULL } }, ++ { LABS, GREY16, { vips_LabS2Lab, vips_Lab2XYZ, vips_XYZ2scRGB, vips_scRGB2BW16, NULL } }, + { LABS, YXY, { vips_LabS2Lab, vips_Lab2XYZ, vips_XYZ2Yxy, NULL } }, + + { scRGB, XYZ, { vips_scRGB2XYZ, NULL } }, + { scRGB, LAB, { vips_scRGB2XYZ, vips_XYZ2Lab, NULL } }, + { scRGB, LABQ, { vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LabQ, NULL } }, + { scRGB, LCH, { vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LCh, NULL } }, +- { scRGB, CMC, { vips_scRGB2XYZ, vips_XYZ2Lab, +- vips_Lab2LCh, vips_LCh2CMC, NULL } }, ++ { scRGB, CMC, { vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LCh, vips_LCh2CMC, NULL } }, + { scRGB, CMYK, { vips_scRGB2XYZ, vips_XYZ2CMYK, NULL } }, + { scRGB, sRGB, { vips_scRGB2sRGB, NULL } }, + { scRGB, HSV, { vips_scRGB2sRGB, vips_sRGB2HSV, NULL } }, +@@ -346,142 +321,98 @@ static VipsColourRoute vips_colour_routes[] = { + { CMYK, LAB, { vips_CMYK2XYZ, vips_XYZ2Lab, NULL } }, + { CMYK, LABQ, { vips_CMYK2XYZ, vips_XYZ2Lab, vips_Lab2LabQ, NULL } }, + { CMYK, LCH, { vips_CMYK2XYZ, vips_XYZ2Lab, vips_Lab2LCh, NULL } }, +- { CMYK, CMC, { vips_CMYK2XYZ, vips_XYZ2Lab, +- vips_Lab2LCh, vips_LCh2CMC, NULL } }, ++ { CMYK, CMC, { vips_CMYK2XYZ, vips_XYZ2Lab, vips_Lab2LCh, vips_LCh2CMC, NULL } }, + { CMYK, scRGB, { vips_CMYK2XYZ, vips_XYZ2scRGB, NULL } }, +- { CMYK, sRGB, { vips_CMYK2XYZ, vips_XYZ2scRGB, +- vips_scRGB2sRGB, NULL } }, +- { CMYK, HSV, { vips_CMYK2XYZ, vips_XYZ2scRGB, +- vips_scRGB2sRGB, vips_sRGB2HSV, NULL } }, ++ { CMYK, sRGB, { vips_CMYK2XYZ, vips_XYZ2scRGB, vips_scRGB2sRGB, NULL } }, ++ { CMYK, HSV, { vips_CMYK2XYZ, vips_XYZ2scRGB, vips_scRGB2sRGB, vips_sRGB2HSV, NULL } }, + { CMYK, BW, { vips_CMYK2XYZ, vips_XYZ2scRGB, vips_scRGB2BW, NULL } }, + { CMYK, LABS, { vips_CMYK2XYZ, vips_XYZ2Lab, vips_Lab2LabS, NULL } }, +- { CMYK, RGB16, { vips_CMYK2XYZ, vips_XYZ2scRGB, +- vips_scRGB2RGB16, NULL } }, +- { CMYK, GREY16, { vips_CMYK2XYZ, vips_XYZ2scRGB, +- vips_scRGB2BW16, NULL } }, ++ { CMYK, RGB16, { vips_CMYK2XYZ, vips_XYZ2scRGB, vips_scRGB2RGB16, NULL } }, ++ { CMYK, GREY16, { vips_CMYK2XYZ, vips_XYZ2scRGB, vips_scRGB2BW16, NULL } }, + { CMYK, YXY, { vips_CMYK2XYZ, vips_XYZ2Yxy, NULL } }, + + { sRGB, XYZ, { vips_sRGB2scRGB, vips_scRGB2XYZ, NULL } }, + { sRGB, LAB, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, NULL } }, +- { sRGB, LABQ, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, +- vips_Lab2LabQ, NULL } }, +- { sRGB, LCH, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, +- vips_Lab2LCh, NULL } }, +- { sRGB, CMC, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, +- vips_Lab2LCh, vips_LCh2CMC, NULL } }, +- { sRGB, CMYK, { vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2CMYK, NULL } }, ++ { sRGB, LABQ, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LabQ, NULL } }, ++ { sRGB, LCH, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LCh, NULL } }, ++ { sRGB, CMC, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LCh, vips_LCh2CMC, NULL } }, ++ { sRGB, CMYK, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2CMYK, NULL } }, + { sRGB, scRGB, { vips_sRGB2scRGB, NULL } }, + { sRGB, HSV, { vips_sRGB2HSV, NULL } }, + { sRGB, BW, { vips_sRGB2scRGB, vips_scRGB2BW, NULL } }, +- { sRGB, LABS, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, +- vips_Lab2LabS, NULL } }, ++ { sRGB, LABS, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LabS, NULL } }, + { sRGB, RGB16, { vips_sRGB2RGB16, NULL } }, + { sRGB, GREY16, { vips_sRGB2scRGB, vips_scRGB2BW16, NULL } }, + { sRGB, YXY, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Yxy, NULL } }, + + { HSV, XYZ, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, NULL } }, +- { HSV, LAB, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Lab, NULL } }, +- { HSV, LABQ, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Lab, vips_Lab2LabQ, NULL } }, +- { HSV, LCH, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Lab, vips_Lab2LCh, NULL } }, +- { HSV, CMC, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Lab, vips_Lab2LCh, vips_LCh2CMC, NULL } }, +- { HSV, CMYK, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2CMYK, NULL } }, ++ { HSV, LAB, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, NULL } }, ++ { HSV, LABQ, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LabQ, NULL } }, ++ { HSV, LCH, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LCh, NULL } }, ++ { HSV, CMC, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LCh, vips_LCh2CMC, NULL } }, ++ { HSV, CMYK, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2CMYK, NULL } }, + { HSV, scRGB, { vips_HSV2sRGB, vips_sRGB2scRGB, NULL } }, + { HSV, sRGB, { vips_HSV2sRGB, NULL } }, + { HSV, BW, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2BW, NULL } }, +- { HSV, LABS, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Lab, vips_Lab2LabS, NULL } }, ++ { HSV, LABS, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LabS, NULL } }, + { HSV, RGB16, { vips_HSV2sRGB, vips_sRGB2RGB16, NULL } }, +- { HSV, GREY16, { vips_HSV2sRGB, vips_sRGB2scRGB, +- vips_scRGB2BW16, NULL } }, +- { HSV, YXY, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Yxy, NULL } }, ++ { HSV, GREY16, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2BW16, NULL } }, ++ { HSV, YXY, { vips_HSV2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Yxy, NULL } }, + + { RGB16, XYZ, { vips_sRGB2scRGB, vips_scRGB2XYZ, NULL } }, + { RGB16, LAB, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, NULL } }, +- { RGB16, LABQ, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, +- vips_Lab2LabQ, NULL } }, +- { RGB16, LCH, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, +- vips_Lab2LCh, NULL } }, +- { RGB16, CMC, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, +- vips_Lab2LCh, vips_LCh2CMC, NULL } }, +- { RGB16, CMYK, { vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2CMYK, NULL } }, ++ { RGB16, LABQ, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LabQ, NULL } }, ++ { RGB16, LCH, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LCh, NULL } }, ++ { RGB16, CMC, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LCh, vips_LCh2CMC, NULL } }, ++ { RGB16, CMYK, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2CMYK, NULL } }, + { RGB16, scRGB, { vips_sRGB2scRGB, NULL } }, + { RGB16, sRGB, { vips_RGB162sRGB, NULL } }, + { RGB16, HSV, { vips_RGB162sRGB, vips_sRGB2HSV, NULL } }, + { RGB16, BW, { vips_sRGB2scRGB, vips_scRGB2BW, NULL } }, +- { RGB16, LABS, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, +- vips_Lab2LabS, NULL } }, ++ { RGB16, LABS, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LabS, NULL } }, + { RGB16, GREY16, { vips_sRGB2scRGB, vips_scRGB2BW16, NULL } }, + { RGB16, YXY, { vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Yxy, NULL } }, + +- { GREY16, XYZ, { vips_GREY162RGB16, vips_sRGB2scRGB, +- vips_scRGB2XYZ, NULL } }, +- { GREY16, LAB, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Lab, NULL } }, +- { GREY16, LABQ, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Lab, vips_Lab2LabQ, NULL } }, +- { GREY16, LCH, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Lab, vips_Lab2LCh, NULL } }, +- { GREY16, CMC, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Lab, vips_Lab2LCh, vips_LCh2CMC, NULL } }, +- { GREY16, CMYK, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2CMYK, NULL } }, ++ { GREY16, XYZ, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2XYZ, NULL } }, ++ { GREY16, LAB, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, NULL } }, ++ { GREY16, LABQ, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LabQ, NULL } }, ++ { GREY16, LCH, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LCh, NULL } }, ++ { GREY16, CMC, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LCh, vips_LCh2CMC, NULL } }, ++ { GREY16, CMYK, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2CMYK, NULL } }, + { GREY16, scRGB, { vips_GREY162RGB16, vips_sRGB2scRGB, NULL } }, + { GREY16, sRGB, { vips_GREY162RGB16, vips_RGB162sRGB, NULL } }, +- { GREY16, HSV, { vips_GREY162RGB16, vips_RGB162sRGB, +- vips_sRGB2HSV, NULL } }, +- { GREY16, BW, { vips_GREY162RGB16, vips_sRGB2scRGB, +- vips_scRGB2BW, NULL } }, +- { GREY16, LABS, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Lab, vips_Lab2LabS, NULL } }, ++ { GREY16, HSV, { vips_GREY162RGB16, vips_RGB162sRGB, vips_sRGB2HSV, NULL } }, ++ { GREY16, BW, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2BW, NULL } }, ++ { GREY16, LABS, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LabS, NULL } }, + { GREY16, RGB16, { vips_GREY162RGB16, NULL } }, +- { GREY16, YXY, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Yxy, NULL } }, ++ { GREY16, YXY, { vips_GREY162RGB16, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Yxy, NULL } }, + + { BW, XYZ, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, NULL } }, +- { BW, LAB, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Lab, NULL } }, +- { BW, LABQ, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Lab, vips_Lab2LabQ, NULL } }, +- { BW, LCH, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Lab, vips_Lab2LCh, NULL } }, +- { BW, CMC, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Lab, vips_Lab2LCh, vips_LCh2CMC, NULL } }, +- { BW, CMYK, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2CMYK, NULL } }, ++ { BW, LAB, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, NULL } }, ++ { BW, LABQ, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LabQ, NULL } }, ++ { BW, LCH, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LCh, NULL } }, ++ { BW, CMC, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LCh, vips_LCh2CMC, NULL } }, ++ { BW, CMYK, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2CMYK, NULL } }, + { BW, scRGB, { vips_BW2sRGB, vips_sRGB2scRGB, NULL } }, + { BW, sRGB, { vips_BW2sRGB, NULL } }, + { BW, HSV, { vips_BW2sRGB, vips_sRGB2HSV, NULL } }, +- { BW, LABS, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Lab, vips_Lab2LabS, NULL } }, ++ { BW, LABS, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Lab, vips_Lab2LabS, NULL } }, + { BW, RGB16, { vips_BW2sRGB, vips_sRGB2RGB16, NULL } }, +- { BW, GREY16, { vips_BW2sRGB, vips_sRGB2scRGB, +- vips_scRGB2BW16, NULL } }, +- { BW, YXY, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, +- vips_XYZ2Yxy, NULL } }, ++ { BW, GREY16, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2BW16, NULL } }, ++ { BW, YXY, { vips_BW2sRGB, vips_sRGB2scRGB, vips_scRGB2XYZ, vips_XYZ2Yxy, NULL } }, + + { YXY, XYZ, { vips_Yxy2XYZ, NULL } }, + { YXY, LAB, { vips_Yxy2XYZ, vips_XYZ2Lab, NULL } }, + { YXY, LABQ, { vips_Yxy2XYZ, vips_XYZ2Lab, vips_Lab2LabQ, NULL } }, + { YXY, LCH, { vips_Yxy2XYZ, vips_XYZ2Lab, vips_Lab2LCh, NULL } }, +- { YXY, CMC, { vips_Yxy2XYZ, vips_XYZ2Lab, vips_Lab2LCh, +- vips_LCh2CMC, NULL } }, ++ { YXY, CMC, { vips_Yxy2XYZ, vips_XYZ2Lab, vips_Lab2LCh, vips_LCh2CMC, NULL } }, + { YXY, LABS, { vips_Yxy2XYZ, vips_XYZ2Lab, vips_Lab2LabS, NULL } }, + { YXY, CMYK, { vips_Yxy2XYZ, vips_XYZ2CMYK, NULL } }, + { YXY, scRGB, { vips_Yxy2XYZ, vips_XYZ2scRGB, NULL } }, + { YXY, sRGB, { vips_Yxy2XYZ, vips_XYZ2scRGB, vips_scRGB2sRGB, NULL } }, +- { YXY, HSV, { vips_Yxy2XYZ, vips_XYZ2scRGB, vips_scRGB2sRGB, +- vips_sRGB2HSV, NULL } }, ++ { YXY, HSV, { vips_Yxy2XYZ, vips_XYZ2scRGB, vips_scRGB2sRGB, vips_sRGB2HSV, NULL } }, + { YXY, BW, { vips_Yxy2XYZ, vips_XYZ2scRGB, vips_scRGB2BW, NULL } }, +- { YXY, RGB16, { vips_Yxy2XYZ, vips_XYZ2scRGB, +- vips_scRGB2RGB16, NULL } }, ++ { YXY, RGB16, { vips_Yxy2XYZ, vips_XYZ2scRGB, vips_scRGB2RGB16, NULL } }, + { YXY, GREY16, { vips_Yxy2XYZ, vips_XYZ2scRGB, vips_scRGB2BW16, NULL } } + + }; +@@ -493,12 +424,12 @@ static VipsColourRoute vips_colour_routes[] = { + * vips_colourspace_issupported: (method) + * @image: input image + * +- * Test if @image is in a colourspace that vips_colourspace() can process. ++ * Test if @image is in a colourspace that vips_colourspace() can process. + * + * Returns: %TRUE if @image is in a supported colourspace. + */ + gboolean +-vips_colourspace_issupported( const VipsImage *image ) ++vips_colourspace_issupported(const VipsImage *image) + { + VipsInterpretation interpretation; + int i; +@@ -506,18 +437,17 @@ vips_colourspace_issupported( const VipsImage *image ) + /* Treat RGB as sRGB. If you want some other treatment, + * you'll need to use the icc funcs. + */ +- interpretation = vips_image_guess_interpretation( image ); +- if( interpretation == VIPS_INTERPRETATION_RGB ) ++ interpretation = vips_image_guess_interpretation(image); ++ if (interpretation == VIPS_INTERPRETATION_RGB) + interpretation = VIPS_INTERPRETATION_sRGB; + +- for( i = 0; i < VIPS_NUMBER( vips_colour_routes ); i++ ) +- if( vips_colour_routes[i].from == interpretation ) +- return( TRUE ); ++ for (i = 0; i < VIPS_NUMBER(vips_colour_routes); i++) ++ if (vips_colour_routes[i].from == interpretation) ++ return (TRUE); + +- return( FALSE ); ++ return (FALSE); + } + +- + typedef struct _VipsColourspace { + VipsOperation parent_instance; + +@@ -529,131 +459,129 @@ typedef struct _VipsColourspace { + + typedef VipsOperationClass VipsColourspaceClass; + +-G_DEFINE_TYPE( VipsColourspace, vips_colourspace, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsColourspace, vips_colourspace, VIPS_TYPE_OPERATION); + + static int +-vips_colourspace_build( VipsObject *object ) ++vips_colourspace_build(VipsObject *object) + { +- VipsColourspace *colourspace = (VipsColourspace *) object; ++ VipsColourspace *colourspace = (VipsColourspace *) object; + + int i, j; + VipsImage *x; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( object, 1 ); +- VipsImage **pipe = (VipsImage **) +- vips_object_local_array( object, MAX_STEPS ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(object, 1); ++ VipsImage **pipe = (VipsImage **) ++ vips_object_local_array(object, MAX_STEPS); + + VipsInterpretation interpretation; + + /* Verify that all input args have been set. + */ +- if( VIPS_OBJECT_CLASS( vips_colourspace_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_colourspace_parent_class)->build(object)) ++ return (-1); + + x = colourspace->in; + + /* Unpack radiance-coded images. We can't use interpretation for this, + * since rad images can be scRGB or XYZ. + */ +- if( x->Coding == VIPS_CODING_RAD ) { +- if( vips_rad2float( x, &t[0], NULL ) ) +- return( -1 ); +- x = t[0]; ++ if (x->Coding == VIPS_CODING_RAD) { ++ if (vips_rad2float(x, &t[0], NULL)) ++ return (-1); ++ x = t[0]; + } + +- if( vips_object_argument_isset( object, "source_space" ) ) ++ if (vips_object_argument_isset(object, "source_space")) + interpretation = colourspace->source_space; + else +- interpretation = vips_image_guess_interpretation( x ); ++ interpretation = vips_image_guess_interpretation(x); + + /* Treat RGB as sRGB. If you want some other treatment, + * you'll need to use the icc funcs. + */ +- if( interpretation == VIPS_INTERPRETATION_RGB ) ++ if (interpretation == VIPS_INTERPRETATION_RGB) + interpretation = VIPS_INTERPRETATION_sRGB; + + /* No conversion necessary. + */ +- if( interpretation == colourspace->space ) { +- g_object_set( colourspace, "out", vips_image_new(), NULL ); ++ if (interpretation == colourspace->space) { ++ g_object_set(colourspace, "out", vips_image_new(), NULL); + +- return( vips_image_write( colourspace->in, colourspace->out ) ); ++ return (vips_image_write(colourspace->in, colourspace->out)); + } + +- for( i = 0; i < VIPS_NUMBER( vips_colour_routes ); i++ ) +- if( vips_colour_routes[i].from == interpretation && +- vips_colour_routes[i].to == colourspace->space ) ++ for (i = 0; i < VIPS_NUMBER(vips_colour_routes); i++) ++ if (vips_colour_routes[i].from == interpretation && ++ vips_colour_routes[i].to == colourspace->space) + break; +- if( i == VIPS_NUMBER( vips_colour_routes ) ) { +- vips_error( "vips_colourspace", +- _( "no known route from '%s' to '%s'" ), +- vips_enum_nick( VIPS_TYPE_INTERPRETATION, +- interpretation ), +- vips_enum_nick( VIPS_TYPE_INTERPRETATION, +- colourspace->space ) ); +- return( -1 ); ++ if (i == VIPS_NUMBER(vips_colour_routes)) { ++ vips_error("vips_colourspace", ++ _("no known route from '%s' to '%s'"), ++ vips_enum_nick(VIPS_TYPE_INTERPRETATION, ++ interpretation), ++ vips_enum_nick(VIPS_TYPE_INTERPRETATION, ++ colourspace->space)); ++ return (-1); + } + +- for( j = 0; vips_colour_routes[i].route[j]; j++ ) { +- if( vips_colour_routes[i].route[j]( x, &pipe[j], NULL ) ) +- return( -1 ); ++ for (j = 0; vips_colour_routes[i].route[j]; j++) { ++ if (vips_colour_routes[i].route[j](x, &pipe[j], NULL)) ++ return (-1); + x = pipe[j]; + } + +- g_object_set( colourspace, "out", vips_image_new(), NULL ); +- if( vips_image_write( x, colourspace->out ) ) +- return( -1 ); ++ g_object_set(colourspace, "out", vips_image_new(), NULL); ++ if (vips_image_write(x, colourspace->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_colourspace_class_init( VipsColourspaceClass *class ) ++vips_colourspace_class_init(VipsColourspaceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "colourspace"; +- vobject_class->description = _( "convert to a new colorspace" ); ++ vobject_class->description = _("convert to a new colorspace"); + vobject_class->build = vips_colourspace_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsColourspace, in ) ); +- +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsColourspace, out ) ); +- +- VIPS_ARG_ENUM( class, "space", 6, +- _( "Space" ), +- _( "Destination color space" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsColourspace, space ), +- VIPS_TYPE_INTERPRETATION, VIPS_INTERPRETATION_sRGB ); ++ G_STRUCT_OFFSET(VipsColourspace, in)); + +- VIPS_ARG_ENUM( class, "source_space", 6, +- _( "Source space" ), +- _( "Source color space" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsColourspace, source_space ), +- VIPS_TYPE_INTERPRETATION, VIPS_INTERPRETATION_sRGB ); ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsColourspace, out)); + ++ VIPS_ARG_ENUM(class, "space", 6, ++ _("Space"), ++ _("Destination color space"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsColourspace, space), ++ VIPS_TYPE_INTERPRETATION, VIPS_INTERPRETATION_sRGB); ++ ++ VIPS_ARG_ENUM(class, "source_space", 6, ++ _("Source space"), ++ _("Source color space"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsColourspace, source_space), ++ VIPS_TYPE_INTERPRETATION, VIPS_INTERPRETATION_sRGB); + } + + static void +-vips_colourspace_init( VipsColourspace *colourspace ) ++vips_colourspace_init(VipsColourspace *colourspace) + { + colourspace->source_space = VIPS_INTERPRETATION_sRGB; + } +@@ -671,7 +599,7 @@ vips_colourspace_init( VipsColourspace *colourspace ) + * + * This operation looks at the interpretation field of @in (or uses + * @source_space, if set) and runs +- * a set of colourspace conversion functions to move it to @space. ++ * a set of colourspace conversion functions to move it to @space. + * + * For example, given an image tagged as #VIPS_INTERPRETATION_YXY, running + * vips_colourspace() with @space set to #VIPS_INTERPRETATION_LAB will +@@ -683,15 +611,15 @@ vips_colourspace_init( VipsColourspace *colourspace ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_colourspace( VipsImage *in, VipsImage **out, +- VipsInterpretation space, ... ) ++vips_colourspace(VipsImage *in, VipsImage **out, ++ VipsInterpretation space, ...) + { + va_list ap; + int result; + +- va_start( ap, space ); +- result = vips_call_split( "colourspace", ap, in, out, space ); +- va_end( ap ); ++ va_start(ap, space); ++ result = vips_call_split("colourspace", ap, in, out, space); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/dE00.c b/libvips/colour/dE00.c +index f5f6a139ee..4912f09301 100644 +--- a/libvips/colour/dE00.c ++++ b/libvips/colour/dE00.c +@@ -7,28 +7,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,7 +51,7 @@ typedef struct _VipsdE00 { + + typedef VipsColourDifferenceClass VipsdE00Class; + +-G_DEFINE_TYPE( VipsdE00, vips_dE00, VIPS_TYPE_COLOUR_DIFFERENCE ); ++G_DEFINE_TYPE(VipsdE00, vips_dE00, VIPS_TYPE_COLOUR_DIFFERENCE); + + /** + * vips_col_dE00: +@@ -62,114 +62,110 @@ G_DEFINE_TYPE( VipsdE00, vips_dE00, VIPS_TYPE_COLOUR_DIFFERENCE ); + * @a2: Input coordinate 2 + * @b2: Input coordinate 2 + * +- * CIEDE2000, from: +- * +- * Luo, Cui, Rigg, "The Development of the CIE 2000 Colour-Difference ++ * CIEDE2000, from: ++ * ++ * Luo, Cui, Rigg, "The Development of the CIE 2000 Colour-Difference + * Formula: CIEDE2000", COLOR research and application, pp 340 + * + * Returns: CIE dE2000 colour difference. + */ +-float +-vips_col_dE00( float L1, float a1, float b1, +- float L2, float a2, float b2 ) ++float ++vips_col_dE00(float L1, float a1, float b1, ++ float L2, float a2, float b2) + { +-/* Code if you want XYZ params and the colour temp used in the reference +- +- float +- vips_col_dE00( float X1, float Y1, float Z1, +- float X2, float Y2, float Z2 ) +- { +- const double X0 = 94.811; +- const double Y0 = 100.0; +- const double Z0 = 107.304; +- +-#define f(I) ((I) > 0.008856 ? \ +- cbrt( (I), 1.0 / 3.0 ) : 7.7871 * (I) + (16.0 / 116.0)) +- +- double nX1 = f( X1 / X0 ); +- double nY1 = f( Y1 / Y0 ); +- double nZ1 = f( Z1 / Z0 ); +- +- double L1 = 116 * nY1 - 16; +- double a1 = 500 * (nX1 - nY1); +- double b1 = 200 * (nY1 - nZ1); +- +- double nX2 = f( X2 / X0 ); +- double nY2 = f( Y2 / Y0 ); +- double nZ2 = f( Z2 / Z0 ); +- +- double L2 = 116 * nY2 - 16; +- double a2 = 500 * (nX2 - nY2); +- double b2 = 200 * (nY2 - nZ2); +- */ ++ /* Code if you want XYZ params and the colour temp used in the reference ++ ++ float ++ vips_col_dE00( float X1, float Y1, float Z1, ++ float X2, float Y2, float Z2 ) ++ { ++ const double X0 = 94.811; ++ const double Y0 = 100.0; ++ const double Z0 = 107.304; ++ ++ #define f(I) ((I) > 0.008856 ? \ ++ cbrt( (I), 1.0 / 3.0 ) : 7.7871 * (I) + (16.0 / 116.0)) ++ ++ double nX1 = f( X1 / X0 ); ++ double nY1 = f( Y1 / Y0 ); ++ double nZ1 = f( Z1 / Z0 ); ++ ++ double L1 = 116 * nY1 - 16; ++ double a1 = 500 * (nX1 - nY1); ++ double b1 = 200 * (nY1 - nZ1); ++ ++ double nX2 = f( X2 / X0 ); ++ double nY2 = f( Y2 / Y0 ); ++ double nZ2 = f( Z2 / Z0 ); ++ ++ double L2 = 116 * nY2 - 16; ++ double a2 = 500 * (nX2 - nY2); ++ double b2 = 200 * (nY2 - nZ2); ++ */ + + /* Chroma and mean chroma (C bar) + */ +- double C1 = sqrt( a1 * a1 + b1 * b1 ); +- double C2 = sqrt( a2 * a2 + b2 * b2 ); ++ double C1 = sqrt(a1 * a1 + b1 * b1); ++ double C2 = sqrt(a2 * a2 + b2 * b2); + double Cb = (C1 + C2) / 2; + + /* G + */ + double Cb7 = Cb * Cb * Cb * Cb * Cb * Cb * Cb; +- double G = 0.5 * (1 - sqrt( Cb7 / (Cb7 + pow( 25, 7 )) )); ++ double G = 0.5 * (1 - sqrt(Cb7 / (Cb7 + pow(25, 7)))); + + /* L', a', b', C', h' + */ + double L1d = L1; + double a1d = (1 + G) * a1; + double b1d = b1; +- double C1d = sqrt( a1d * a1d + b1d * b1d ); +- double h1d = vips_col_ab2h( a1d, b1d ); ++ double C1d = sqrt(a1d * a1d + b1d * b1d); ++ double h1d = vips_col_ab2h(a1d, b1d); + + double L2d = L2; + double a2d = (1 + G) * a2; + double b2d = b2; +- double C2d = sqrt( a2d * a2d + b2d * b2d ); +- double h2d = vips_col_ab2h( a2d, b2d ); ++ double C2d = sqrt(a2d * a2d + b2d * b2d); ++ double h2d = vips_col_ab2h(a2d, b2d); + + /* L' bar, C' bar, h' bar + */ + double Ldb = (L1d + L2d) / 2; + double Cdb = (C1d + C2d) / 2; +- double hdb = VIPS_FABS( h1d - h2d ) < 180 ? +- (h1d + h2d) / 2 : +- VIPS_FABS( h1d + h2d - 360 ) / 2; ++ double hdb = VIPS_FABS(h1d - h2d) < 180 ? (h1d + h2d) / 2 : VIPS_FABS(h1d + h2d - 360) / 2; + + /* dtheta, RC + */ + double hdbd = (hdb - 275) / 25; +- double dtheta = 30 * exp( -(hdbd * hdbd) ); ++ double dtheta = 30 * exp(-(hdbd * hdbd)); + double Cdb7 = Cdb * Cdb * Cdb * Cdb * Cdb * Cdb * Cdb; +- double RC = 2 * sqrt( Cdb7 / (Cdb7 + pow( 25, 7 )) ); ++ double RC = 2 * sqrt(Cdb7 / (Cdb7 + pow(25, 7))); + + /* RT, T. + */ +- double RT = -sin( VIPS_RAD( 2 * dtheta ) ) * RC; +- double T = 1 - +- 0.17 * cos( VIPS_RAD( hdb - 30 ) ) + +- 0.24 * cos( VIPS_RAD( 2 * hdb ) ) + +- 0.32 * cos( VIPS_RAD( 3 * hdb + 6 ) ) - +- 0.20 * cos( VIPS_RAD( 4 * hdb - 63 ) ); ++ double RT = -sin(VIPS_RAD(2 * dtheta)) * RC; ++ double T = 1 - ++ 0.17 * cos(VIPS_RAD(hdb - 30)) + ++ 0.24 * cos(VIPS_RAD(2 * hdb)) + ++ 0.32 * cos(VIPS_RAD(3 * hdb + 6)) - ++ 0.20 * cos(VIPS_RAD(4 * hdb - 63)); + + /* SL, SC, SH + */ + double Ldb50 = Ldb - 50; +- double SL = 1 + (0.015 * Ldb50 * Ldb50) / sqrt( 20 + Ldb50 * Ldb50); ++ double SL = 1 + (0.015 * Ldb50 * Ldb50) / sqrt(20 + Ldb50 * Ldb50); + double SC = 1 + 0.045 * Cdb; + double SH = 1 + 0.015 * Cdb * T; + + /* hue difference ... careful! + */ +- double dhd = VIPS_FABS( h1d - h2d ) < 180 ? +- h1d - h2d : +- 360 - (h1d - h2d); ++ double dhd = VIPS_FABS(h1d - h2d) < 180 ? h1d - h2d : 360 - (h1d - h2d); + + /* dLd, dCd dHd + */ + double dLd = L1d - L2d; + double dCd = C1d - C2d; +- double dHd = 2 * sqrt( C1d * C2d ) * sin( VIPS_RAD( dhd / 2 ) ); ++ double dHd = 2 * sqrt(C1d * C2d) * sin(VIPS_RAD(dhd / 2)); + + /* Parametric factors for viewing parameters. + */ +@@ -185,7 +181,7 @@ vips_col_dE00( float L1, float a1, float b1, + + /* dE00!! + */ +- double dE00 = sqrt( nL * nL + nC * nC + nH * nH + RT * nC * nH ); ++ double dE00 = sqrt(nL * nL + nC * nC + nH * nH + RT * nC * nH); + + /* + printf( "X1 = %g, Y1 = %g, Z1 = %g\n", X1, Y1, Z1 ); +@@ -201,14 +197,14 @@ vips_col_dE00( float L1, float a1, float b1, + printf( "dE00 = %g\n", dE00 ); + */ + +- return( dE00 ); ++ return (dE00); + } + + /* Find the difference between two buffers of LAB data. + */ + static void +-vips_dE00_line( VipsColour *colour, +- VipsPel *out, VipsPel **in, int width ) ++vips_dE00_line(VipsColour *colour, ++ VipsPel *out, VipsPel **in, int width) + { + float *p1 = (float *) in[0]; + float *p2 = (float *) in[1]; +@@ -216,9 +212,9 @@ vips_dE00_line( VipsColour *colour, + + int x; + +- for( x = 0; x < width; x++ ) { +- q[x] = vips_col_dE00( p1[0], p1[1], p1[2], +- p2[0], p2[1], p2[2] ); ++ for (x = 0; x < width; x++) { ++ q[x] = vips_col_dE00(p1[0], p1[1], p1[2], ++ p2[0], p2[1], p2[2]); + + p1 += 3; + p2 += 3; +@@ -226,21 +222,21 @@ vips_dE00_line( VipsColour *colour, + } + + static void +-vips_dE00_class_init( VipsdE00Class *class ) ++vips_dE00_class_init(VipsdE00Class *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "dE00"; +- object_class->description = _( "calculate dE00" ); ++ object_class->description = _("calculate dE00"); + + colour_class->process_line = vips_dE00_line; + } + + static void +-vips_dE00_init( VipsdE00 *dE00 ) ++vips_dE00_init(VipsdE00 *dE00) + { +- VipsColourDifference *difference = VIPS_COLOUR_DIFFERENCE( dE00 ); ++ VipsColourDifference *difference = VIPS_COLOUR_DIFFERENCE(dE00); + + difference->interpretation = VIPS_INTERPRETATION_LAB; + } +@@ -257,14 +253,14 @@ vips_dE00_init( VipsdE00 *dE00 ) + * Returns: 0 on success, -1 on error + */ + int +-vips_dE00( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_dE00(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "dE00", ap, left, right, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("dE00", ap, left, right, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/dE76.c b/libvips/colour/dE76.c +index 8403e8edfa..13fe6fa948 100644 +--- a/libvips/colour/dE76.c ++++ b/libvips/colour/dE76.c +@@ -4,7 +4,7 @@ + * 16/11/94 JC + * - partialed! + * 31/10/09 +- * - use im__colour_binary() ++ * - use im__colour_binary() + * - gtkdoc comment + * 25/10/12 + * - redone as a class +@@ -12,28 +12,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -56,7 +56,7 @@ typedef struct _VipsdE76 { + + typedef VipsColourDifferenceClass VipsdE76Class; + +-G_DEFINE_TYPE( VipsdE76, vips_dE76, VIPS_TYPE_COLOUR_DIFFERENCE ); ++G_DEFINE_TYPE(VipsdE76, vips_dE76, VIPS_TYPE_COLOUR_DIFFERENCE); + + /** + * vips_pythagoras: +@@ -70,33 +70,33 @@ G_DEFINE_TYPE( VipsdE76, vips_dE76, VIPS_TYPE_COLOUR_DIFFERENCE ); + * Pythagorean distance between two points in colour space. Lab/XYZ/CMC etc. + */ + float +-vips_pythagoras( float L1, float a1, float b1, float L2, float a2, float b2 ) ++vips_pythagoras(float L1, float a1, float b1, float L2, float a2, float b2) + { + float dL = L1 - L2; + float da = a1 - a2; + float db = b1 - b2; + +- return( sqrt( dL * dL + da * da + db * db ) ); ++ return (sqrt(dL * dL + da * da + db * db)); + } + + /* Find the difference between two buffers of LAB data. + */ + void +-vips__pythagoras_line( VipsColour *colour, +- VipsPel *out, VipsPel **in, int width ) ++vips__pythagoras_line(VipsColour *colour, ++ VipsPel *out, VipsPel **in, int width) + { +- float * restrict p1 = (float *) in[0]; +- float * restrict p2 = (float *) in[1]; +- float * restrict q = (float *) out; ++ float *restrict p1 = (float *) in[0]; ++ float *restrict p2 = (float *) in[1]; ++ float *restrict q = (float *) out; + + int x; + +- for( x = 0; x < width; x++ ) { ++ for (x = 0; x < width; x++) { + float dL = p1[0] - p2[0]; + float da = p1[1] - p2[1]; + float db = p1[2] - p2[2]; + +- q[x] = sqrt( dL * dL + da * da + db * db ); ++ q[x] = sqrt(dL * dL + da * da + db * db); + + p1 += 3; + p2 += 3; +@@ -104,21 +104,21 @@ vips__pythagoras_line( VipsColour *colour, + } + + static void +-vips_dE76_class_init( VipsdE76Class *class ) ++vips_dE76_class_init(VipsdE76Class *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "dE76"; +- object_class->description = _( "calculate dE76" ); ++ object_class->description = _("calculate dE76"); + + colour_class->process_line = vips__pythagoras_line; + } + + static void +-vips_dE76_init( VipsdE76 *dE76 ) ++vips_dE76_init(VipsdE76 *dE76) + { +- VipsColourDifference *difference = VIPS_COLOUR_DIFFERENCE( dE76 ); ++ VipsColourDifference *difference = VIPS_COLOUR_DIFFERENCE(dE76); + + difference->interpretation = VIPS_INTERPRETATION_LAB; + } +@@ -135,14 +135,14 @@ vips_dE76_init( VipsdE76 *dE76 ) + * Returns: 0 on success, -1 on error + */ + int +-vips_dE76( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_dE76(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "dE76", ap, left, right, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("dE76", ap, left, right, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/dECMC.c b/libvips/colour/dECMC.c +index 96c1440817..d45557c5e4 100644 +--- a/libvips/colour/dECMC.c ++++ b/libvips/colour/dECMC.c +@@ -7,28 +7,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -49,24 +49,24 @@ typedef struct _VipsdECMC { + + typedef VipsColourDifferenceClass VipsdECMCClass; + +-G_DEFINE_TYPE( VipsdECMC, vips_dECMC, VIPS_TYPE_COLOUR_DIFFERENCE ); ++G_DEFINE_TYPE(VipsdECMC, vips_dECMC, VIPS_TYPE_COLOUR_DIFFERENCE); + + static void +-vips_dECMC_class_init( VipsdECMCClass *class ) ++vips_dECMC_class_init(VipsdECMCClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "dECMC"; +- object_class->description = _( "calculate dECMC" ); ++ object_class->description = _("calculate dECMC"); + + colour_class->process_line = vips__pythagoras_line; + } + + static void +-vips_dECMC_init( VipsdECMC *dECMC ) ++vips_dECMC_init(VipsdECMC *dECMC) + { +- VipsColourDifference *difference = VIPS_COLOUR_DIFFERENCE( dECMC ); ++ VipsColourDifference *difference = VIPS_COLOUR_DIFFERENCE(dECMC); + + difference->interpretation = VIPS_INTERPRETATION_CMC; + } +@@ -79,7 +79,7 @@ vips_dECMC_init( VipsdECMC *dECMC ) + * @...: %NULL-terminated list of optional named arguments + * + * Calculate dE CMC. The input images are transformed to CMC colour space and +- * the euclidean distance between corresponding pixels calculated. ++ * the euclidean distance between corresponding pixels calculated. + * + * To calculate a colour difference with values for (l:c) other than (1:1), + * transform the two source images to CMC yourself, scale the channels +@@ -90,14 +90,14 @@ vips_dECMC_init( VipsdECMC *dECMC ) + * Returns: 0 on success, -1 on error + */ + int +-vips_dECMC( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++vips_dECMC(VipsImage *left, VipsImage *right, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "dECMC", ap, left, right, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("dECMC", ap, left, right, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/float2rad.c b/libvips/colour/float2rad.c +index 0360dd30e9..88d8e91a09 100644 +--- a/libvips/colour/float2rad.c ++++ b/libvips/colour/float2rad.c +@@ -3,7 +3,7 @@ + * 23/3/09 + * - from im_rad2float and Radiance sources + * 2/11/09 +- * - gtkdoc ++ * - gtkdoc + * 20/9/12 + * - redo as a class + * 13/12/12 +@@ -12,35 +12,35 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + + /* + +- Sections of this file from Greg Ward and Radiance with kind +- permission. The Radience copyright notice appears below. ++ Sections of this file from Greg Ward and Radiance with kind ++ permission. The Radience copyright notice appears below. + + */ + +@@ -116,57 +116,58 @@ + /* Begin copy-paste from Radiance sources. + */ + +-#define RED 0 +-#define GRN 1 +-#define BLU 2 +-#define CIEX 0 /* or, if input is XYZ... */ +-#define CIEY 1 +-#define CIEZ 2 +-#define EXP 3 /* exponent same for either format */ +-#define COLXS 128 /* excess used for exponent */ +-#define WHT 3 /* used for RGBPRIMS type */ ++#define RED 0 ++#define GRN 1 ++#define BLU 2 ++#define CIEX 0 /* or, if input is XYZ... */ ++#define CIEY 1 ++#define CIEZ 2 ++#define EXP 3 /* exponent same for either format */ ++#define COLXS 128 /* excess used for exponent */ ++#define WHT 3 /* used for RGBPRIMS type */ + +-#undef BYTE +-#define BYTE unsigned char /* 8-bit unsigned integer */ ++#undef BYTE ++#define BYTE unsigned char /* 8-bit unsigned integer */ + +-typedef BYTE COLR[4]; /* red, green, blue (or X,Y,Z), exponent */ ++typedef BYTE COLR[4]; /* red, green, blue (or X,Y,Z), exponent */ + + typedef float COLORV; +-typedef COLORV COLOR[3]; /* red, green, blue (or X,Y,Z) */ ++typedef COLORV COLOR[3]; /* red, green, blue (or X,Y,Z) */ + +-#define copycolor(c1,c2) ((c1)[0]=(c2)[0],(c1)[1]=(c2)[1],(c1)[2]=(c2)[2]) ++#define copycolor(c1, c2) ((c1)[0] = (c2)[0], (c1)[1] = (c2)[1], (c1)[2] = (c2)[2]) + + static void +-setcolr( COLR clr, double r, double g, double b ) /* assign a short color value */ ++setcolr(COLR clr, double r, double g, double b) /* assign a short color value */ + { +- double d; +- int e; +- +- d = r > g ? r : g; +- if (b > d) d = b; +- +- if (d <= 1e-32) { +- clr[RED] = clr[GRN] = clr[BLU] = 0; +- clr[EXP] = 0; +- return; +- } +- +- d = frexp(d, &e) * 255.9999 / d; +- +- if (r > 0.0) +- clr[RED] = r * d; +- else +- clr[RED] = 0; +- if (g > 0.0) +- clr[GRN] = g * d; +- else +- clr[GRN] = 0; +- if (b > 0.0) +- clr[BLU] = b * d; +- else +- clr[BLU] = 0; +- +- clr[EXP] = e + COLXS; ++ double d; ++ int e; ++ ++ d = r > g ? r : g; ++ if (b > d) ++ d = b; ++ ++ if (d <= 1e-32) { ++ clr[RED] = clr[GRN] = clr[BLU] = 0; ++ clr[EXP] = 0; ++ return; ++ } ++ ++ d = frexp(d, &e) * 255.9999 / d; ++ ++ if (r > 0.0) ++ clr[RED] = r * d; ++ else ++ clr[RED] = 0; ++ if (g > 0.0) ++ clr[GRN] = g * d; ++ else ++ clr[GRN] = 0; ++ if (b > 0.0) ++ clr[BLU] = b * d; ++ else ++ clr[BLU] = 0; ++ ++ clr[EXP] = e + COLXS; + } + + /* End copy-paste from Radiance sources. +@@ -175,39 +176,39 @@ setcolr( COLR clr, double r, double g, double b ) /* assign a short co + typedef VipsColourCode VipsFloat2rad; + typedef VipsColourCodeClass VipsFloat2radClass; + +-G_DEFINE_TYPE( VipsFloat2rad, vips_float2rad, VIPS_TYPE_COLOUR_CODE ); ++G_DEFINE_TYPE(VipsFloat2rad, vips_float2rad, VIPS_TYPE_COLOUR_CODE); + + static void +-vips_float2rad_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_float2rad_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { + COLOR *inp = (COLOR *) in[0]; + COLR *outbuf = (COLR *) out; + +- while( width-- > 0 ) { +- setcolr( outbuf[0], inp[0][RED], inp[0][GRN], inp[0][BLU] ); ++ while (width-- > 0) { ++ setcolr(outbuf[0], inp[0][RED], inp[0][GRN], inp[0][BLU]); + inp++; + outbuf++; + } + } + + static void +-vips_float2rad_class_init( VipsFloat2radClass *class ) ++vips_float2rad_class_init(VipsFloat2radClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "float2rad"; +- object_class->description = +- _( "transform float RGB to Radiance coding" ); ++ object_class->description = ++ _("transform float RGB to Radiance coding"); + + colour_class->process_line = vips_float2rad_line; + } + + static void +-vips_float2rad_init( VipsFloat2rad *float2rad ) ++vips_float2rad_init(VipsFloat2rad *float2rad) + { +- VipsColour *colour = VIPS_COLOUR( float2rad ); +- VipsColourCode *code = VIPS_COLOUR_CODE( float2rad ); ++ VipsColour *colour = VIPS_COLOUR(float2rad); ++ VipsColourCode *code = VIPS_COLOUR_CODE(float2rad); + + colour->coding = VIPS_CODING_RAD; + colour->interpretation = VIPS_INTERPRETATION_scRGB; +@@ -232,14 +233,14 @@ vips_float2rad_init( VipsFloat2rad *float2rad ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_float2rad( VipsImage *in, VipsImage **out, ... ) ++vips_float2rad(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "float2rad", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("float2rad", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/icc_transform.c b/libvips/colour/icc_transform.c +index 003ce42616..3a8f75022c 100644 +--- a/libvips/colour/icc_transform.c ++++ b/libvips/colour/icc_transform.c +@@ -41,7 +41,7 @@ + * 28/12/18 + * - remove warning messages from vips_icc_is_compatible_profile() since + * they can be triggered under normal circumstances +- * 17/4/19 kleisauke ++ * 17/4/19 kleisauke + * - better rejection of broken embedded profiles + * 29/3/21 [hanssonrickard] + * - add black_point_compensation +@@ -49,35 +49,35 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + + /* + #define DEBUG + */ +- ++ + #ifdef HAVE_CONFIG_H + #include + #endif /*HAVE_CONFIG_H*/ +@@ -108,7 +108,7 @@ + * @VIPS_INTENT_ABSOLUTE: absolute colorimetric rendering intent + * + * The rendering intent. #VIPS_INTENT_ABSOLUTE is best for +- * scientific work, #VIPS_INTENT_RELATIVE is usually best for ++ * scientific work, #VIPS_INTENT_RELATIVE is usually best for + * accurate communication with other imaging libraries. + */ + +@@ -118,38 +118,38 @@ + * @VIPS_PCS_XYZ: use XYZ as the Profile Connection Space + * + * Pick a Profile Connection Space for vips_icc_import() and +- * vips_icc_export(). LAB is usually best, XYZ can be more convenient in some +- * cases. ++ * vips_icc_export(). LAB is usually best, XYZ can be more convenient in some ++ * cases. + */ + + /** + * vips_icc_present: + * + * VIPS can optionally be built without the ICC library. Use this function to +- * test for its availability. ++ * test for its availability. + * + * Returns: non-zero if the ICC library is present. + */ + int +-vips_icc_present( void ) ++vips_icc_present(void) + { +- return( 1 ); ++ return (1); + } + + #define VIPS_TYPE_ICC (vips_icc_get_type()) +-#define VIPS_ICC( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_ICC, VipsIcc )) +-#define VIPS_ICC_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_ICC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_ICC, VipsIcc)) ++#define VIPS_ICC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_ICC, VipsIccClass)) ++#define VIPS_IS_ICC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_ICC)) ++#define VIPS_IS_ICC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_ICC)) ++#define VIPS_ICC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_ICC, VipsIccClass)) +-#define VIPS_IS_ICC( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_ICC )) +-#define VIPS_IS_ICC_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_ICC )) +-#define VIPS_ICC_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_ICC, VipsIccClass )) + + typedef struct _VipsIcc { + VipsColourCode parent_instance; +@@ -171,149 +171,145 @@ typedef struct _VipsIcc { + + typedef VipsColourCodeClass VipsIccClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsIcc, vips_icc, VIPS_TYPE_COLOUR_CODE ); ++G_DEFINE_ABSTRACT_TYPE(VipsIcc, vips_icc, VIPS_TYPE_COLOUR_CODE); + + /* Error from lcms. + */ + + static void +-icc_error( cmsContext context, cmsUInt32Number code, const char *text ) ++icc_error(cmsContext context, cmsUInt32Number code, const char *text) + { +- vips_error( "VipsIcc", "%s", text ); ++ vips_error("VipsIcc", "%s", text); + } + + static void +-vips_icc_dispose( GObject *gobject ) ++vips_icc_dispose(GObject *gobject) + { + VipsIcc *icc = (VipsIcc *) gobject; + +- VIPS_FREEF( cmsDeleteTransform, icc->trans ); +- VIPS_FREEF( cmsCloseProfile, icc->in_profile ); +- VIPS_FREEF( cmsCloseProfile, icc->out_profile ); ++ VIPS_FREEF(cmsDeleteTransform, icc->trans); ++ VIPS_FREEF(cmsCloseProfile, icc->in_profile); ++ VIPS_FREEF(cmsCloseProfile, icc->out_profile); + +- if( icc->in_blob ) { +- vips_area_unref( (VipsArea *) icc->in_blob ); ++ if (icc->in_blob) { ++ vips_area_unref((VipsArea *) icc->in_blob); + icc->in_blob = NULL; + } + +- if( icc->out_blob ) { +- vips_area_unref( (VipsArea *) icc->out_blob ); ++ if (icc->out_blob) { ++ vips_area_unref((VipsArea *) icc->out_blob); + icc->out_blob = NULL; + } + +- G_OBJECT_CLASS( vips_icc_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_icc_parent_class)->dispose(gobject); + } + + /* Is a profile just a pcs stub. + */ + static gboolean +-is_pcs( cmsHPROFILE profile ) ++is_pcs(cmsHPROFILE profile) + { +- return( cmsGetColorSpace( profile ) == cmsSigLabData || +- cmsGetColorSpace( profile ) == cmsSigXYZData ); ++ return (cmsGetColorSpace(profile) == cmsSigLabData || ++ cmsGetColorSpace(profile) == cmsSigXYZData); + } + + /* Info for all supported lcms profile signatures. + */ + typedef struct _VipsIccInfo { +- int signature; +- int bands; +- guint lcms_type8; +- guint lcms_type16; ++ int signature; ++ int bands; ++ guint lcms_type8; ++ guint lcms_type16; + } VipsIccInfo; + + static VipsIccInfo vips_icc_info_table[] = { +- { cmsSigGrayData, 1, TYPE_GRAY_8, TYPE_GRAY_16 }, +- +- { cmsSigRgbData, 3, TYPE_RGB_8, TYPE_RGB_16 }, +- { cmsSigLabData, 3, TYPE_Lab_8, TYPE_Lab_16 }, +- { cmsSigXYZData, 3, -1, TYPE_XYZ_16 }, +- +- { cmsSigCmykData, 4, TYPE_CMYK_8, TYPE_CMYK_16 }, +- { cmsSig4colorData, 4, TYPE_CMYK_8, TYPE_CMYK_16 }, +- { cmsSig5colorData, 5, TYPE_CMYK5_8, TYPE_CMYK5_16 }, +- { cmsSig6colorData, 6, TYPE_CMYK6_8, TYPE_CMYK6_16 }, +- { cmsSig7colorData, 7, TYPE_CMYK7_8, TYPE_CMYK7_16 }, +- { cmsSig8colorData, 8, TYPE_CMYK8_8, TYPE_CMYK8_16 }, +- { cmsSig9colorData, 9, TYPE_CMYK9_8, TYPE_CMYK9_16 }, +- { cmsSig10colorData, 10, TYPE_CMYK10_8, TYPE_CMYK10_16 }, +- { cmsSig11colorData, 11, TYPE_CMYK11_8, TYPE_CMYK11_16 }, +- { cmsSig12colorData, 12, TYPE_CMYK12_8, TYPE_CMYK12_16 }, ++ { cmsSigGrayData, 1, TYPE_GRAY_8, TYPE_GRAY_16 }, ++ ++ { cmsSigRgbData, 3, TYPE_RGB_8, TYPE_RGB_16 }, ++ { cmsSigLabData, 3, TYPE_Lab_8, TYPE_Lab_16 }, ++ { cmsSigXYZData, 3, -1, TYPE_XYZ_16 }, ++ ++ { cmsSigCmykData, 4, TYPE_CMYK_8, TYPE_CMYK_16 }, ++ { cmsSig4colorData, 4, TYPE_CMYK_8, TYPE_CMYK_16 }, ++ { cmsSig5colorData, 5, TYPE_CMYK5_8, TYPE_CMYK5_16 }, ++ { cmsSig6colorData, 6, TYPE_CMYK6_8, TYPE_CMYK6_16 }, ++ { cmsSig7colorData, 7, TYPE_CMYK7_8, TYPE_CMYK7_16 }, ++ { cmsSig8colorData, 8, TYPE_CMYK8_8, TYPE_CMYK8_16 }, ++ { cmsSig9colorData, 9, TYPE_CMYK9_8, TYPE_CMYK9_16 }, ++ { cmsSig10colorData, 10, TYPE_CMYK10_8, TYPE_CMYK10_16 }, ++ { cmsSig11colorData, 11, TYPE_CMYK11_8, TYPE_CMYK11_16 }, ++ { cmsSig12colorData, 12, TYPE_CMYK12_8, TYPE_CMYK12_16 }, + }; + + static VipsIccInfo * +-vips_icc_info( int signature ) ++vips_icc_info(int signature) + { +- int i; ++ int i; + +- for( i = 0; i < VIPS_NUMBER( vips_icc_info_table ); i++ ) +- if( vips_icc_info_table[i].signature == signature ) +- return( &vips_icc_info_table[i] ); ++ for (i = 0; i < VIPS_NUMBER(vips_icc_info_table); i++) ++ if (vips_icc_info_table[i].signature == signature) ++ return (&vips_icc_info_table[i]); + +- return( NULL ); ++ return (NULL); + } + + static int +-vips_icc_build( VipsObject *object ) ++vips_icc_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsColour *colour = (VipsColour *) object; + VipsColourCode *code = (VipsColourCode *) object; + VipsIcc *icc = (VipsIcc *) object; + + cmsUInt32Number flags; + +- if( icc->depth != 8 && +- icc->depth != 16 ) { +- vips_error( class->nickname, +- "%s", _( "depth must be 8 or 16" ) ); +- return( -1 ); ++ if (icc->depth != 8 && ++ icc->depth != 16) { ++ vips_error(class->nickname, ++ "%s", _("depth must be 8 or 16")); ++ return (-1); + } + +- if( icc->in_profile && +- code->in ) { +- int signature; +- VipsIccInfo *info; +- +- signature = cmsGetColorSpace( icc->in_profile ); +- if( !(info = vips_icc_info( signature )) ) { +- vips_error( class->nickname, +- _( "unimplemented input color space 0x%x" ), +- signature ); +- return( -1 ); ++ if (icc->in_profile && ++ code->in) { ++ int signature; ++ VipsIccInfo *info; ++ ++ signature = cmsGetColorSpace(icc->in_profile); ++ if (!(info = vips_icc_info(signature))) { ++ vips_error(class->nickname, ++ _("unimplemented input color space 0x%x"), ++ signature); ++ return (-1); + } + +- colour->input_bands = info->bands; ++ colour->input_bands = info->bands; + +- switch( signature ) { ++ switch (signature) { + case cmsSigGrayData: +- code->input_format = +- code->in->BandFmt == VIPS_FORMAT_USHORT ? +- VIPS_FORMAT_USHORT : VIPS_FORMAT_UCHAR; +- icc->in_icc_format = +- code->in->BandFmt == VIPS_FORMAT_USHORT ? +- info->lcms_type16 : info->lcms_type8; ++ code->input_format = ++ code->in->BandFmt == VIPS_FORMAT_USHORT ? VIPS_FORMAT_USHORT : VIPS_FORMAT_UCHAR; ++ icc->in_icc_format = ++ code->in->BandFmt == VIPS_FORMAT_USHORT ? info->lcms_type16 : info->lcms_type8; + break; + + case cmsSigRgbData: +- code->input_format = +- code->in->BandFmt == VIPS_FORMAT_USHORT ? +- VIPS_FORMAT_USHORT : VIPS_FORMAT_UCHAR; +- icc->in_icc_format = +- code->in->BandFmt == VIPS_FORMAT_USHORT ? +- info->lcms_type16 : info->lcms_type8; ++ code->input_format = ++ code->in->BandFmt == VIPS_FORMAT_USHORT ? VIPS_FORMAT_USHORT : VIPS_FORMAT_UCHAR; ++ icc->in_icc_format = ++ code->in->BandFmt == VIPS_FORMAT_USHORT ? info->lcms_type16 : info->lcms_type8; + break; + + case cmsSigLabData: + code->input_format = VIPS_FORMAT_FLOAT; +- code->input_interpretation = ++ code->input_interpretation = + VIPS_INTERPRETATION_LAB; + icc->in_icc_format = info->lcms_type16; + break; + + case cmsSigXYZData: + code->input_format = VIPS_FORMAT_FLOAT; +- code->input_interpretation = ++ code->input_interpretation = + VIPS_INTERPRETATION_XYZ; + icc->in_icc_format = info->lcms_type16; + break; +@@ -327,64 +323,54 @@ vips_icc_build( VipsObject *object ) + case cmsSig10colorData: + case cmsSig11colorData: + case cmsSig12colorData: +- /* Treat as forms of CMYK. +- */ +- info = vips_icc_info( +- cmsGetColorSpace( icc->in_profile ) ); +- +- code->input_format = +- code->in->BandFmt == VIPS_FORMAT_USHORT ? +- VIPS_FORMAT_USHORT : VIPS_FORMAT_UCHAR; +- icc->in_icc_format = +- code->in->BandFmt == VIPS_FORMAT_USHORT ? +- info->lcms_type16 : info->lcms_type8; ++ /* Treat as forms of CMYK. ++ */ ++ info = vips_icc_info( ++ cmsGetColorSpace(icc->in_profile)); ++ ++ code->input_format = ++ code->in->BandFmt == VIPS_FORMAT_USHORT ? VIPS_FORMAT_USHORT : VIPS_FORMAT_UCHAR; ++ icc->in_icc_format = ++ code->in->BandFmt == VIPS_FORMAT_USHORT ? info->lcms_type16 : info->lcms_type8; + break; + + default: +- g_assert_not_reached(); +- return( -1 ); ++ g_assert_not_reached(); ++ return (-1); + } + } + +- if( icc->out_profile ) { +- int signature; +- VipsIccInfo *info; ++ if (icc->out_profile) { ++ int signature; ++ VipsIccInfo *info; + +- signature = cmsGetColorSpace( icc->out_profile ); +- if( !(info = vips_icc_info( signature )) ) { +- vips_error( class->nickname, +- _( "unimplemented output color space 0x%x" ), +- signature ); +- return( -1 ); ++ signature = cmsGetColorSpace(icc->out_profile); ++ if (!(info = vips_icc_info(signature))) { ++ vips_error(class->nickname, ++ _("unimplemented output color space 0x%x"), ++ signature); ++ return (-1); + } + +- colour->bands = info->bands; ++ colour->bands = info->bands; + +- switch( signature ) { ++ switch (signature) { + case cmsSigGrayData: +- colour->interpretation = +- icc->depth == 8 ? +- VIPS_INTERPRETATION_B_W : +- VIPS_INTERPRETATION_GREY16; +- colour->format = +- icc->depth == 8 ? +- VIPS_FORMAT_UCHAR : VIPS_FORMAT_USHORT; +- icc->out_icc_format = +- icc->depth == 16 ? +- info->lcms_type16 : info->lcms_type8; ++ colour->interpretation = ++ icc->depth == 8 ? VIPS_INTERPRETATION_B_W : VIPS_INTERPRETATION_GREY16; ++ colour->format = ++ icc->depth == 8 ? VIPS_FORMAT_UCHAR : VIPS_FORMAT_USHORT; ++ icc->out_icc_format = ++ icc->depth == 16 ? info->lcms_type16 : info->lcms_type8; + break; + + case cmsSigRgbData: +- colour->interpretation = +- icc->depth == 8 ? +- VIPS_INTERPRETATION_sRGB : +- VIPS_INTERPRETATION_RGB16; +- colour->format = +- icc->depth == 8 ? +- VIPS_FORMAT_UCHAR : VIPS_FORMAT_USHORT; +- icc->out_icc_format = +- icc->depth == 16 ? +- info->lcms_type16 : info->lcms_type8; ++ colour->interpretation = ++ icc->depth == 8 ? VIPS_INTERPRETATION_sRGB : VIPS_INTERPRETATION_RGB16; ++ colour->format = ++ icc->depth == 8 ? VIPS_FORMAT_UCHAR : VIPS_FORMAT_USHORT; ++ icc->out_icc_format = ++ icc->depth == 16 ? info->lcms_type16 : info->lcms_type8; + break; + + case cmsSigLabData: +@@ -408,32 +394,30 @@ vips_icc_build( VipsObject *object ) + case cmsSig10colorData: + case cmsSig11colorData: + case cmsSig12colorData: +- /* Treat as forms of CMYK. +- */ ++ /* Treat as forms of CMYK. ++ */ + colour->interpretation = VIPS_INTERPRETATION_CMYK; +- colour->format = +- icc->depth == 8 ? +- VIPS_FORMAT_UCHAR : VIPS_FORMAT_USHORT; +- icc->out_icc_format = +- icc->depth == 16 ? +- info->lcms_type16 : info->lcms_type8; ++ colour->format = ++ icc->depth == 8 ? VIPS_FORMAT_UCHAR : VIPS_FORMAT_USHORT; ++ icc->out_icc_format = ++ icc->depth == 16 ? info->lcms_type16 : info->lcms_type8; + break; + + default: +- g_assert_not_reached(); +- return( -1 ); ++ g_assert_not_reached(); ++ return (-1); + } +- } ++ } + + /* At least one must be a device profile. + */ +- if( icc->in_profile && ++ if (icc->in_profile && + icc->out_profile && +- is_pcs( icc->in_profile ) && +- is_pcs( icc->out_profile ) ) { +- vips_error( class->nickname, +- "%s", _( "no device profile" ) ); +- return( -1 ); ++ is_pcs(icc->in_profile) && ++ is_pcs(icc->out_profile)) { ++ vips_error(class->nickname, ++ "%s", _("no device profile")); ++ return (-1); + } + + /* Use cmsFLAGS_NOCACHE to disable the 1-pixel cache and make +@@ -441,41 +425,40 @@ vips_icc_build( VipsObject *object ) + */ + flags = cmsFLAGS_NOCACHE; + +- if( icc->black_point_compensation ) ++ if (icc->black_point_compensation) + flags |= cmsFLAGS_BLACKPOINTCOMPENSATION; + +- if( !(icc->trans = cmsCreateTransform( +- icc->in_profile, icc->in_icc_format, +- icc->out_profile, icc->out_icc_format, +- icc->intent, flags )) ) +- return( -1 ); ++ if (!(icc->trans = cmsCreateTransform( ++ icc->in_profile, icc->in_icc_format, ++ icc->out_profile, icc->out_icc_format, ++ icc->intent, flags))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_icc_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_icc_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Get from an image. + */ + static VipsBlob * +-vips_icc_get_profile_image( VipsImage *image ) ++vips_icc_get_profile_image(VipsImage *image) + { + const void *data; + size_t size; + +- if( !vips_image_get_typeof( image, VIPS_META_ICC_NAME ) ) +- return( NULL ); +- if( vips_image_get_blob( image, VIPS_META_ICC_NAME, &data, &size ) ) +- return( NULL ); ++ if (!vips_image_get_typeof(image, VIPS_META_ICC_NAME)) ++ return (NULL); ++ if (vips_image_get_blob(image, VIPS_META_ICC_NAME, &data, &size)) ++ return (NULL); + +- return( vips_blob_new( NULL, data, size ) ); ++ return (vips_blob_new(NULL, data, size)); + } + + #ifdef DEBUG + static void +-vips_icc_print_profile( const char *name, cmsHPROFILE profile ) ++vips_icc_print_profile(const char *name, cmsHPROFILE profile) + { + static const cmsInfoType info_types[] = { + cmsInfoDescription, +@@ -495,53 +478,53 @@ vips_icc_print_profile( const char *name, cmsHPROFILE profile ) + cmsUInt32Number n_intents; + cmsUInt32Number *intent_codes; + char **intent_descriptions; +- +- printf( "icc profile %s: %p\n", name, profile ); +- for( i = 0; i < VIPS_NUMBER( info_types ); i++ ) { +- if( (n_bytes = cmsGetProfileInfoASCII( profile, +- info_types[i], "en", "US", +- NULL, 0 )) ) { ++ ++ printf("icc profile %s: %p\n", name, profile); ++ for (i = 0; i < VIPS_NUMBER(info_types); i++) { ++ if ((n_bytes = cmsGetProfileInfoASCII(profile, ++ info_types[i], "en", "US", ++ NULL, 0))) { + char *buffer; + +- buffer = VIPS_ARRAY( NULL, n_bytes, char ); +- (void) cmsGetProfileInfoASCII( profile, +- info_types[i], "en", "US", +- buffer, n_bytes ); +- printf( "%s: %s\n", info_names[i], buffer ); +- g_free( buffer ); ++ buffer = VIPS_ARRAY(NULL, n_bytes, char); ++ (void) cmsGetProfileInfoASCII(profile, ++ info_types[i], "en", "US", ++ buffer, n_bytes); ++ printf("%s: %s\n", info_names[i], buffer); ++ g_free(buffer); + } + } + +- printf( "profile class: %#x\n", cmsGetDeviceClass( profile ) ); +-{ +- cmsColorSpaceSignature pcs = cmsGetPCS( profile ); +- guint pcs_as_be = GUINT_TO_BE( pcs ); ++ printf("profile class: %#x\n", cmsGetDeviceClass(profile)); ++ { ++ cmsColorSpaceSignature pcs = cmsGetPCS(profile); ++ guint pcs_as_be = GUINT_TO_BE(pcs); + +- char name[5]; ++ char name[5]; + +- vips_strncpy( name, (const char *) &pcs_as_be, 5 ); +- printf( "PCS: %#x (%s)\n", pcs, name ); +-} ++ vips_strncpy(name, (const char *) &pcs_as_be, 5); ++ printf("PCS: %#x (%s)\n", pcs, name); ++ } + +- printf( "matrix shaper: %d\n", cmsIsMatrixShaper( profile ) ); +- printf( "version: %g\n", cmsGetProfileVersion( profile ) ); +- +- n_intents = cmsGetSupportedIntents( 0, NULL, NULL ); +- printf( "n_intents = %u\n", n_intents ); +- intent_codes = VIPS_ARRAY( NULL, n_intents, cmsUInt32Number ); +- intent_descriptions = VIPS_ARRAY( NULL, n_intents, char * ); +- (void) cmsGetSupportedIntents( n_intents, +- intent_codes, intent_descriptions ); +- for( i = 0; i < n_intents; i++ ) { +- printf( " %#x: %s, in CLUT = %d, out CLUT = %d\n", ++ printf("matrix shaper: %d\n", cmsIsMatrixShaper(profile)); ++ printf("version: %g\n", cmsGetProfileVersion(profile)); ++ ++ n_intents = cmsGetSupportedIntents(0, NULL, NULL); ++ printf("n_intents = %u\n", n_intents); ++ intent_codes = VIPS_ARRAY(NULL, n_intents, cmsUInt32Number); ++ intent_descriptions = VIPS_ARRAY(NULL, n_intents, char *); ++ (void) cmsGetSupportedIntents(n_intents, ++ intent_codes, intent_descriptions); ++ for (i = 0; i < n_intents; i++) { ++ printf(" %#x: %s, in CLUT = %d, out CLUT = %d\n", + intent_codes[i], intent_descriptions[i], +- cmsIsCLUT( profile, +- intent_codes[i], LCMS_USED_AS_INPUT ), +- cmsIsCLUT( profile, +- intent_codes[i], LCMS_USED_AS_OUTPUT ) ); ++ cmsIsCLUT(profile, ++ intent_codes[i], LCMS_USED_AS_INPUT), ++ cmsIsCLUT(profile, ++ intent_codes[i], LCMS_USED_AS_OUTPUT)); + } +- g_free( intent_codes ); +- g_free( intent_descriptions ); ++ g_free(intent_codes); ++ g_free(intent_descriptions); + } + #endif /*DEBUG*/ + +@@ -551,87 +534,86 @@ vips_icc_print_profile( const char *name, cmsHPROFILE profile ) + * Don't set any errors since this is used to test compatibility. + */ + static cmsHPROFILE +-vips_icc_load_profile_blob( VipsBlob *blob, +- VipsImage *image, VipsIntent intent, int direction ) ++vips_icc_load_profile_blob(VipsBlob *blob, ++ VipsImage *image, VipsIntent intent, int direction) + { + const void *data; + size_t size; + cmsHPROFILE profile; +- VipsIccInfo *info; ++ VipsIccInfo *info; + + #ifdef DEBUG +- printf( "loading %s profile, intent %s, from blob %p\n", +- direction == LCMS_USED_AS_INPUT ? _( "input" ) : _( "output" ), +- vips_enum_nick( VIPS_TYPE_INTENT, intent ), +- blob ); ++ printf("loading %s profile, intent %s, from blob %p\n", ++ direction == LCMS_USED_AS_INPUT ? _("input") : _("output"), ++ vips_enum_nick(VIPS_TYPE_INTENT, intent), ++ blob); + #endif /*DEBUG*/ + +- data = vips_blob_get( blob, &size ); +- if( !(profile = cmsOpenProfileFromMem( data, size )) ) { +- g_warning( "%s", _( "corrupt profile" ) ); +- return( NULL ); ++ data = vips_blob_get(blob, &size); ++ if (!(profile = cmsOpenProfileFromMem(data, size))) { ++ g_warning("%s", _("corrupt profile")); ++ return (NULL); + } + + #ifdef DEBUG +- vips_icc_print_profile( "loaded from blob to make", profile ); ++ vips_icc_print_profile("loaded from blob to make", profile); + #endif /*DEBUG*/ + +- if( !(info = vips_icc_info( cmsGetColorSpace( profile ) )) ) { +- VIPS_FREEF( cmsCloseProfile, profile ); +- g_warning( "%s", _( "unsupported profile" ) ); +- return( NULL ); +- } +- +- if( image && +- image->Bands < info->bands ) { +- VIPS_FREEF( cmsCloseProfile, profile ); +- g_warning( "%s", _( "profile incompatible with image" ) ); +- return( NULL ); ++ if (!(info = vips_icc_info(cmsGetColorSpace(profile)))) { ++ VIPS_FREEF(cmsCloseProfile, profile); ++ g_warning("%s", _("unsupported profile")); ++ return (NULL); ++ } ++ ++ if (image && ++ image->Bands < info->bands) { ++ VIPS_FREEF(cmsCloseProfile, profile); ++ g_warning("%s", _("profile incompatible with image")); ++ return (NULL); + } + + /* Spot the common error of an RGB profile and a CMYK image. + */ +- if( image && ++ if (image && + image->Type == VIPS_INTERPRETATION_CMYK && +- info->bands == 3 ) { +- VIPS_FREEF( cmsCloseProfile, profile ); +- g_warning( "%s", _( "profile incompatible with image" ) ); +- return( NULL ); ++ info->bands == 3) { ++ VIPS_FREEF(cmsCloseProfile, profile); ++ g_warning("%s", _("profile incompatible with image")); ++ return (NULL); + } + +- if( !cmsIsIntentSupported( profile, intent, direction ) ) { +- VIPS_FREEF( cmsCloseProfile, profile ); +- g_warning( _( "profile does not support %s %s intent" ), +- vips_enum_nick( VIPS_TYPE_INTENT, intent ), +- direction == LCMS_USED_AS_INPUT ? +- _( "input" ) : _( "output" ) ); +- return( NULL ); ++ if (!cmsIsIntentSupported(profile, intent, direction)) { ++ VIPS_FREEF(cmsCloseProfile, profile); ++ g_warning(_("profile does not support %s %s intent"), ++ vips_enum_nick(VIPS_TYPE_INTENT, intent), ++ direction == LCMS_USED_AS_INPUT ? _("input") : _("output")); ++ return (NULL); + } + +- return( profile ); ++ return (profile); + } + +-/* Verify that a blob is not corrupt and is compatible with this image. ++/* Verify that a blob is not corrupt and is compatible with this image. + * + * unref the blob if it's useless. + */ + static cmsHPROFILE +-vips_icc_verify_blob( VipsBlob **blob, +- VipsImage *image, VipsIntent intent, int direction ) ++vips_icc_verify_blob(VipsBlob **blob, ++ VipsImage *image, VipsIntent intent, int direction) + { +- if( *blob ) { ++ if (*blob) { + cmsHPROFILE profile; + +- if( !(profile = vips_icc_load_profile_blob( *blob, +- image, intent, direction )) ) { +- vips_area_unref( (VipsArea *) *blob ); ++ if (!(profile = vips_icc_load_profile_blob(*blob, ++ image, intent, direction))) { ++ vips_area_unref((VipsArea *) *blob); + *blob = NULL; + } + +- return( profile ); ++ return (profile); + } + +- return( NULL ); ++ return (NULL); + } + + /* Try to set the inport profile. We read the input profile like this: +@@ -649,63 +631,62 @@ vips_icc_verify_blob( VipsBlob **blob, + * in in_blob will need to be attached to the output image in some way. + */ + static int +-vips_icc_set_import( VipsIcc *icc, +- gboolean embedded, const char *input_profile_filename ) ++vips_icc_set_import(VipsIcc *icc, ++ gboolean embedded, const char *input_profile_filename) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( icc ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(icc); + VipsColourCode *code = (VipsColourCode *) icc; + + icc->non_standard_input_profile = FALSE; + + /* Try embedded profile. + */ +- if( code->in && +- (embedded || !input_profile_filename) ) { +- icc->in_blob = vips_icc_get_profile_image( code->in ); +- icc->in_profile = vips_icc_verify_blob( &icc->in_blob, +- code->in, icc->intent, LCMS_USED_AS_INPUT ); ++ if (code->in && ++ (embedded || !input_profile_filename)) { ++ icc->in_blob = vips_icc_get_profile_image(code->in); ++ icc->in_profile = vips_icc_verify_blob(&icc->in_blob, ++ code->in, icc->intent, LCMS_USED_AS_INPUT); + } + + /* Try profile from filename. + */ +- if( code->in && ++ if (code->in && + !icc->in_blob && +- input_profile_filename ) { +- if( +- !vips_profile_load( input_profile_filename, +- &icc->in_blob, NULL ) && +- (icc->in_profile = vips_icc_verify_blob( &icc->in_blob, +- code->in, icc->intent, LCMS_USED_AS_INPUT )) ) ++ input_profile_filename) { ++ if ( ++ !vips_profile_load(input_profile_filename, ++ &icc->in_blob, NULL) && ++ (icc->in_profile = vips_icc_verify_blob(&icc->in_blob, ++ code->in, icc->intent, LCMS_USED_AS_INPUT))) + icc->non_standard_input_profile = TRUE; + } + + /* Try built-in profile. + */ +- if( code->in && +- !icc->in_profile ) { +- const char *name = code->in->Type == VIPS_INTERPRETATION_CMYK ? +- "cmyk" : "srgb"; +- +- if( +- !vips_profile_load( name, &icc->in_blob, NULL ) && +- (icc->in_profile = vips_icc_verify_blob( &icc->in_blob, +- code->in, icc->intent, LCMS_USED_AS_INPUT )) ) ++ if (code->in && ++ !icc->in_profile) { ++ const char *name = code->in->Type == VIPS_INTERPRETATION_CMYK ? "cmyk" : "srgb"; ++ ++ if ( ++ !vips_profile_load(name, &icc->in_blob, NULL) && ++ (icc->in_profile = vips_icc_verify_blob(&icc->in_blob, ++ code->in, icc->intent, LCMS_USED_AS_INPUT))) + icc->non_standard_input_profile = TRUE; + } + +- if( !icc->in_profile ) { +- vips_error( class->nickname, "%s", _( "unable to load or " +- "find any compatible input profile" ) ); +- return( -1 ); ++ if (!icc->in_profile) { ++ vips_error(class->nickname, "%s", _("unable to load or " ++ "find any compatible input profile")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_icc_class_init( VipsIccClass *class ) ++vips_icc_class_init(VipsIccClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->dispose = vips_icc_dispose; +@@ -713,35 +694,35 @@ vips_icc_class_init( VipsIccClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "icc"; +- object_class->description = _( "transform using ICC profiles" ); ++ object_class->description = _("transform using ICC profiles"); + object_class->build = vips_icc_build; + +- VIPS_ARG_ENUM( class, "intent", 6, +- _( "Intent" ), +- _( "Rendering intent" ), ++ VIPS_ARG_ENUM(class, "intent", 6, ++ _("Intent"), ++ _("Rendering intent"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsIcc, intent ), +- VIPS_TYPE_INTENT, VIPS_INTENT_RELATIVE ); ++ G_STRUCT_OFFSET(VipsIcc, intent), ++ VIPS_TYPE_INTENT, VIPS_INTENT_RELATIVE); + +- VIPS_ARG_ENUM( class, "pcs", 6, +- _( "PCS" ), +- _( "Set Profile Connection Space" ), ++ VIPS_ARG_ENUM(class, "pcs", 6, ++ _("PCS"), ++ _("Set Profile Connection Space"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsIcc, pcs ), +- VIPS_TYPE_PCS, VIPS_PCS_LAB ); ++ G_STRUCT_OFFSET(VipsIcc, pcs), ++ VIPS_TYPE_PCS, VIPS_PCS_LAB); + +- VIPS_ARG_BOOL( class, "black_point_compensation", 7, +- _( "Black point compensation" ), +- _( "Enable black point compensation" ), ++ VIPS_ARG_BOOL(class, "black_point_compensation", 7, ++ _("Black point compensation"), ++ _("Enable black point compensation"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsIcc, black_point_compensation ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsIcc, black_point_compensation), ++ FALSE); + +- cmsSetLogErrorHandler( icc_error ); ++ cmsSetLogErrorHandler(icc_error); + } + + static void +-vips_icc_init( VipsIcc *icc ) ++vips_icc_init(VipsIcc *icc) + { + icc->intent = VIPS_INTENT_RELATIVE; + icc->pcs = VIPS_PCS_LAB; +@@ -758,30 +739,30 @@ typedef struct _VipsIccImport { + + typedef VipsIccClass VipsIccImportClass; + +-G_DEFINE_TYPE( VipsIccImport, vips_icc_import, VIPS_TYPE_ICC ); ++G_DEFINE_TYPE(VipsIccImport, vips_icc_import, VIPS_TYPE_ICC); + + static int +-vips_icc_import_build( VipsObject *object ) ++vips_icc_import_build(VipsObject *object) + { + VipsColour *colour = (VipsColour *) object; + VipsIcc *icc = (VipsIcc *) object; + VipsIccImport *import = (VipsIccImport *) object; + +- if( vips_icc_set_import( icc, +- import->embedded, import->input_profile_filename ) ) +- return( -1 ); ++ if (vips_icc_set_import(icc, ++ import->embedded, import->input_profile_filename)) ++ return (-1); + +- if( icc->pcs == VIPS_PCS_LAB ) { ++ if (icc->pcs == VIPS_PCS_LAB) { + cmsCIExyY white; +- cmsWhitePointFromTemp( &white, 6500 ); ++ cmsWhitePointFromTemp(&white, 6500); + +- icc->out_profile = cmsCreateLab4Profile( &white ); ++ icc->out_profile = cmsCreateLab4Profile(&white); + } +- else ++ else + icc->out_profile = cmsCreateXYZProfile(); + +- if( VIPS_OBJECT_CLASS( vips_icc_import_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_icc_import_parent_class)->build(object)) ++ return (-1); + + /* If we used the fallback profile, we need to attach it to the PCS + * image, since the PCS image needs a route back to device space. +@@ -789,58 +770,58 @@ vips_icc_import_build( VipsObject *object ) + * In the same way, we don't remove the embedded input profile on + * import. + */ +- if( icc->non_standard_input_profile && +- icc->in_blob ) { ++ if (icc->non_standard_input_profile && ++ icc->in_blob) { + const void *data; + size_t size; + +- data = vips_blob_get( icc->in_blob, &size ); +- vips_image_set_blob( colour->out, VIPS_META_ICC_NAME, +- NULL, data, size ); ++ data = vips_blob_get(icc->in_blob, &size); ++ vips_image_set_blob(colour->out, VIPS_META_ICC_NAME, ++ NULL, data, size); + } + +- return( 0 ); ++ return (0); + } + +-static void +-decode_lab( guint16 *fixed, float *lab, int n ) ++static void ++decode_lab(guint16 *fixed, float *lab, int n) + { + int i; + +- for( i = 0; i < n; i++ ) { +- lab[0] = (double) fixed[0] / 652.800; +- lab[1] = ((double) fixed[1] / 256.0) - 128.0; +- lab[2] = ((double) fixed[2] / 256.0) - 128.0; ++ for (i = 0; i < n; i++) { ++ lab[0] = (double) fixed[0] / 652.800; ++ lab[1] = ((double) fixed[1] / 256.0) - 128.0; ++ lab[2] = ((double) fixed[2] / 256.0) - 128.0; + +- lab += 3; +- fixed += 3; +- } ++ lab += 3; ++ fixed += 3; ++ } + } + + #define X_FAC (VIPS_D50_X0 * 32768 / (VIPS_D65_X0 * 100)) + #define Y_FAC (VIPS_D50_Y0 * 32768 / (VIPS_D65_Y0 * 100)) + #define Z_FAC (VIPS_D50_Z0 * 32768 / (VIPS_D65_Z0 * 100)) + +-static void +-decode_xyz( guint16 *fixed, float *xyz, int n ) ++static void ++decode_xyz(guint16 *fixed, float *xyz, int n) + { + int i; + +- for( i = 0; i < n; i++ ) { +- xyz[0] = (double) fixed[0] / X_FAC; +- xyz[1] = (double) fixed[1] / Y_FAC; +- xyz[2] = (double) fixed[2] / Z_FAC; ++ for (i = 0; i < n; i++) { ++ xyz[0] = (double) fixed[0] / X_FAC; ++ xyz[1] = (double) fixed[1] / Y_FAC; ++ xyz[2] = (double) fixed[2] / Z_FAC; + +- xyz += 3; +- fixed += 3; +- } ++ xyz += 3; ++ fixed += 3; ++ } + } + + /* Process a buffer of data. + */ + static void +-vips_icc_import_line( VipsColour *colour, +- VipsPel *out, VipsPel **in, int width ) ++vips_icc_import_line(VipsColour *colour, ++ VipsPel *out, VipsPel **in, int width) + { + VipsIcc *icc = (VipsIcc *) colour; + +@@ -854,55 +835,54 @@ vips_icc_import_line( VipsColour *colour, + + p = (VipsPel *) in[0]; + q = (float *) out; +- for( i = 0; i < width; i += PIXEL_BUFFER_SIZE ) { +- const int chunk = VIPS_MIN( width - i, PIXEL_BUFFER_SIZE ); ++ for (i = 0; i < width; i += PIXEL_BUFFER_SIZE) { ++ const int chunk = VIPS_MIN(width - i, PIXEL_BUFFER_SIZE); + +- cmsDoTransform( icc->trans, p, encoded, chunk ); ++ cmsDoTransform(icc->trans, p, encoded, chunk); + +- if( icc->pcs == VIPS_PCS_LAB ) +- decode_lab( encoded, q, chunk ); ++ if (icc->pcs == VIPS_PCS_LAB) ++ decode_lab(encoded, q, chunk); + else +- decode_xyz( encoded, q, chunk ); ++ decode_xyz(encoded, q, chunk); + +- p += PIXEL_BUFFER_SIZE * VIPS_IMAGE_SIZEOF_PEL( colour->in[0] ); ++ p += PIXEL_BUFFER_SIZE * VIPS_IMAGE_SIZEOF_PEL(colour->in[0]); + q += PIXEL_BUFFER_SIZE * 3; + } + } + + static void +-vips_icc_import_class_init( VipsIccImportClass *class ) ++vips_icc_import_class_init(VipsIccImportClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "icc_import"; +- object_class->description = _( "import from device with ICC profile" ); ++ object_class->description = _("import from device with ICC profile"); + object_class->build = vips_icc_import_build; + + colour_class->process_line = vips_icc_import_line; + +- VIPS_ARG_BOOL( class, "embedded", 110, +- _( "Embedded" ), +- _( "Use embedded input profile, if available" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsIccImport, embedded ), +- FALSE ); +- +- VIPS_ARG_STRING( class, "input_profile", 120, +- _( "Input profile" ), +- _( "Filename to load input profile from" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsIccImport, input_profile_filename ), +- NULL ); ++ VIPS_ARG_BOOL(class, "embedded", 110, ++ _("Embedded"), ++ _("Use embedded input profile, if available"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsIccImport, embedded), ++ FALSE); + ++ VIPS_ARG_STRING(class, "input_profile", 120, ++ _("Input profile"), ++ _("Filename to load input profile from"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsIccImport, input_profile_filename), ++ NULL); + } + + static void +-vips_icc_import_init( VipsIccImport *import ) ++vips_icc_import_init(VipsIccImport *import) + { + } + +@@ -915,12 +895,12 @@ typedef struct _VipsIccExport { + + typedef VipsIccClass VipsIccExportClass; + +-G_DEFINE_TYPE( VipsIccExport, vips_icc_export, VIPS_TYPE_ICC ); ++G_DEFINE_TYPE(VipsIccExport, vips_icc_export, VIPS_TYPE_ICC); + + static int +-vips_icc_export_build( VipsObject *object ) ++vips_icc_export_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsColour *colour = (VipsColour *) object; + VipsColourCode *code = (VipsColourCode *) object; + VipsIcc *icc = (VipsIcc *) object; +@@ -929,73 +909,73 @@ vips_icc_export_build( VipsObject *object ) + /* If icc->pcs hasn't been set and this image is tagged as XYZ, swap + * to XYZ pcs. This will save a XYZ->LAB conversion when we chain up. + */ +- if( !vips_object_argument_isset( object, "pcs" ) && ++ if (!vips_object_argument_isset(object, "pcs") && + code->in && +- code->in->Type == VIPS_INTERPRETATION_XYZ ) +- icc->pcs = VIPS_PCS_XYZ; ++ code->in->Type == VIPS_INTERPRETATION_XYZ) ++ icc->pcs = VIPS_PCS_XYZ; + +- if( icc->pcs == VIPS_PCS_LAB ) { ++ if (icc->pcs == VIPS_PCS_LAB) { + cmsCIExyY white; +- cmsWhitePointFromTemp( &white, 6500 ); ++ cmsWhitePointFromTemp(&white, 6500); + +- icc->in_profile = cmsCreateLab4Profile( &white ); ++ icc->in_profile = cmsCreateLab4Profile(&white); + } +- else ++ else + icc->in_profile = cmsCreateXYZProfile(); + +- if( code->in && +- !export->output_profile_filename ) +- icc->out_blob = vips_icc_get_profile_image( code->in ); ++ if (code->in && ++ !export->output_profile_filename) ++ icc->out_blob = vips_icc_get_profile_image(code->in); + +- if( !icc->out_blob && +- export->output_profile_filename ) { +- if( vips_profile_load( export->output_profile_filename, +- &icc->out_blob, NULL ) ) +- return( -1 ); ++ if (!icc->out_blob && ++ export->output_profile_filename) { ++ if (vips_profile_load(export->output_profile_filename, ++ &icc->out_blob, NULL)) ++ return (-1); + colour->profile_filename = export->output_profile_filename; + } + +- if( icc->out_blob && +- !(icc->out_profile = vips_icc_load_profile_blob( icc->out_blob, +- NULL, icc->intent, LCMS_USED_AS_OUTPUT )) ) { +- vips_error( class->nickname, "%s", _( "no output profile" ) ); +- return( -1 ); ++ if (icc->out_blob && ++ !(icc->out_profile = vips_icc_load_profile_blob(icc->out_blob, ++ NULL, icc->intent, LCMS_USED_AS_OUTPUT))) { ++ vips_error(class->nickname, "%s", _("no output profile")); ++ return (-1); + } + +- if( VIPS_OBJECT_CLASS( vips_icc_export_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_icc_export_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Pack a buffer of floats into lcms's fixed-point formats. Cut from + * lcms-1.0.8. + */ +-static void +-encode_lab( float *lab, guint16 *fixed, int n ) ++static void ++encode_lab(float *lab, guint16 *fixed, int n) + { + int i; + +- for( i = 0; i < n; i++ ) { ++ for (i = 0; i < n; i++) { + float L = lab[0]; + float a = lab[1]; + float b = lab[2]; + +- if( L < 0 ) ++ if (L < 0) + L = 0; +- if( L > 100. ) ++ if (L > 100.) + L = 100.; + +- if( a < -128. ) ++ if (a < -128.) + a = -128; +- if( a > 127.9961 ) ++ if (a > 127.9961) + a = 127.9961; +- if( b < -128. ) ++ if (b < -128.) + b = -128; +- if( b > 127.9961 ) ++ if (b > 127.9961) + b = 127.9961; + +- fixed[0] = L * 652.800 + 0.5; ++ fixed[0] = L * 652.800 + 0.5; + fixed[1] = (a + 128.0) * 256.0 + 0.5; + fixed[2] = (b + 128.0) * 256.0 + 0.5; + +@@ -1004,33 +984,33 @@ encode_lab( float *lab, guint16 *fixed, int n ) + } + } + +-#define MAX_ENCODEABLE_XYZ (100 * (1.0 + 32767.0 / 32768.0)) ++#define MAX_ENCODEABLE_XYZ (100 * (1.0 + 32767.0 / 32768.0)) + + // 1.15 fixed point for XYZ + +-static void +-encode_xyz( float *xyz, guint16 *fixed, int n ) ++static void ++encode_xyz(float *xyz, guint16 *fixed, int n) + { + int i; + +- for( i = 0; i < n; i++ ) { ++ for (i = 0; i < n; i++) { + float X = xyz[0]; + float Y = xyz[1]; + float Z = xyz[2]; + +- if( X < 0 ) ++ if (X < 0) + X = 0; +- if( X > MAX_ENCODEABLE_XYZ ) ++ if (X > MAX_ENCODEABLE_XYZ) + X = MAX_ENCODEABLE_XYZ; + +- if( Y < 0 ) ++ if (Y < 0) + Y = 0; +- if( Y > MAX_ENCODEABLE_XYZ ) ++ if (Y > MAX_ENCODEABLE_XYZ) + Y = MAX_ENCODEABLE_XYZ; + +- if( Z < 0 ) ++ if (Z < 0) + Z = 0; +- if( Z > MAX_ENCODEABLE_XYZ ) ++ if (Z > MAX_ENCODEABLE_XYZ) + Z = MAX_ENCODEABLE_XYZ; + + fixed[0] = X * X_FAC + 0.5; +@@ -1045,8 +1025,8 @@ encode_xyz( float *xyz, guint16 *fixed, int n ) + /* Process a buffer of data. + */ + static void +-vips_icc_export_line( VipsColour *colour, +- VipsPel *out, VipsPel **in, int width ) ++vips_icc_export_line(VipsColour *colour, ++ VipsPel *out, VipsPel **in, int width) + { + VipsIcc *icc = (VipsIcc *) colour; + +@@ -1060,54 +1040,54 @@ vips_icc_export_line( VipsColour *colour, + + p = (float *) in[0]; + q = (VipsPel *) out; +- for( x = 0; x < width; x += PIXEL_BUFFER_SIZE ) { +- const int chunk = VIPS_MIN( width - x, PIXEL_BUFFER_SIZE ); ++ for (x = 0; x < width; x += PIXEL_BUFFER_SIZE) { ++ const int chunk = VIPS_MIN(width - x, PIXEL_BUFFER_SIZE); + +- if( icc->pcs == VIPS_PCS_LAB ) +- encode_lab( p, encoded, chunk ); ++ if (icc->pcs == VIPS_PCS_LAB) ++ encode_lab(p, encoded, chunk); + else +- encode_xyz( p, encoded, chunk ); ++ encode_xyz(p, encoded, chunk); + +- cmsDoTransform( icc->trans, encoded, q, chunk ); ++ cmsDoTransform(icc->trans, encoded, q, chunk); + + p += PIXEL_BUFFER_SIZE * 3; +- q += PIXEL_BUFFER_SIZE * VIPS_IMAGE_SIZEOF_PEL( colour->out ); ++ q += PIXEL_BUFFER_SIZE * VIPS_IMAGE_SIZEOF_PEL(colour->out); + } + } + + static void +-vips_icc_export_class_init( VipsIccExportClass *class ) ++vips_icc_export_class_init(VipsIccExportClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "icc_export"; +- object_class->description = _( "output to device with ICC profile" ); ++ object_class->description = _("output to device with ICC profile"); + object_class->build = vips_icc_export_build; + + colour_class->process_line = vips_icc_export_line; + +- VIPS_ARG_STRING( class, "output_profile", 110, +- _( "Output profile" ), +- _( "Filename to load output profile from" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsIccExport, output_profile_filename ), +- NULL ); +- +- VIPS_ARG_INT( class, "depth", 130, +- _( "Depth" ), +- _( "Output device space depth in bits" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsIcc, depth ), +- 8, 16, 8 ); ++ VIPS_ARG_STRING(class, "output_profile", 110, ++ _("Output profile"), ++ _("Filename to load output profile from"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsIccExport, output_profile_filename), ++ NULL); ++ ++ VIPS_ARG_INT(class, "depth", 130, ++ _("Depth"), ++ _("Output device space depth in bits"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsIcc, depth), ++ 8, 16, 8); + } + + static void +-vips_icc_export_init( VipsIccExport *export ) ++vips_icc_export_init(VipsIccExport *export) + { + } + +@@ -1122,103 +1102,101 @@ typedef struct _VipsIccTransform { + + typedef VipsIccClass VipsIccTransformClass; + +-G_DEFINE_TYPE( VipsIccTransform, vips_icc_transform, VIPS_TYPE_ICC ); ++G_DEFINE_TYPE(VipsIccTransform, vips_icc_transform, VIPS_TYPE_ICC); + + static int +-vips_icc_transform_build( VipsObject *object ) ++vips_icc_transform_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsColour *colour = (VipsColour *) object; + VipsIcc *icc = (VipsIcc *) object; + VipsIccTransform *transform = (VipsIccTransform *) object; + +- if( vips_icc_set_import( icc, +- transform->embedded, transform->input_profile_filename ) ) +- return( -1 ); ++ if (vips_icc_set_import(icc, ++ transform->embedded, transform->input_profile_filename)) ++ return (-1); + +- if( transform->output_profile_filename ) { +- if( vips_profile_load( transform->output_profile_filename, +- &icc->out_blob, NULL ) ) +- return( -1 ); ++ if (transform->output_profile_filename) { ++ if (vips_profile_load(transform->output_profile_filename, ++ &icc->out_blob, NULL)) ++ return (-1); + colour->profile_filename = transform->output_profile_filename; + } + +- if( icc->out_blob ) +- icc->out_profile = vips_icc_load_profile_blob( icc->out_blob, +- NULL, icc->intent, LCMS_USED_AS_OUTPUT ); ++ if (icc->out_blob) ++ icc->out_profile = vips_icc_load_profile_blob(icc->out_blob, ++ NULL, icc->intent, LCMS_USED_AS_OUTPUT); + +- if( !icc->out_profile ) { +- vips_error( class->nickname, "%s", _( "no output profile" ) ); +- return( -1 ); ++ if (!icc->out_profile) { ++ vips_error(class->nickname, "%s", _("no output profile")); ++ return (-1); + } + +- if( VIPS_OBJECT_CLASS( vips_icc_transform_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_icc_transform_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Process a buffer of data. + */ + static void +-vips_icc_transform_line( VipsColour *colour, +- VipsPel *out, VipsPel **in, int width ) ++vips_icc_transform_line(VipsColour *colour, ++ VipsPel *out, VipsPel **in, int width) + { + VipsIcc *icc = (VipsIcc *) colour; + +- cmsDoTransform( icc->trans, in[0], out, width ); ++ cmsDoTransform(icc->trans, in[0], out, width); + } + + static void +-vips_icc_transform_class_init( VipsIccImportClass *class ) ++vips_icc_transform_class_init(VipsIccImportClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "icc_transform"; +- object_class->description = +- _( "transform between devices with ICC profiles" ); ++ object_class->description = ++ _("transform between devices with ICC profiles"); + object_class->build = vips_icc_transform_build; + + colour_class->process_line = vips_icc_transform_line; + +- VIPS_ARG_STRING( class, "output_profile", 110, +- _( "Output profile" ), +- _( "Filename to load output profile from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsIccTransform, output_profile_filename ), +- NULL ); +- +- VIPS_ARG_BOOL( class, "embedded", 120, +- _( "Embedded" ), +- _( "Use embedded input profile, if available" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsIccTransform, embedded ), +- FALSE ); +- +- VIPS_ARG_STRING( class, "input_profile", 130, +- _( "Input profile" ), +- _( "Filename to load input profile from" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsIccTransform, input_profile_filename ), +- NULL ); +- +- VIPS_ARG_INT( class, "depth", 140, +- _( "Depth" ), +- _( "Output device space depth in bits" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsIcc, depth ), +- 8, 16, 8 ); ++ VIPS_ARG_STRING(class, "output_profile", 110, ++ _("Output profile"), ++ _("Filename to load output profile from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsIccTransform, output_profile_filename), ++ NULL); + ++ VIPS_ARG_BOOL(class, "embedded", 120, ++ _("Embedded"), ++ _("Use embedded input profile, if available"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsIccTransform, embedded), ++ FALSE); ++ ++ VIPS_ARG_STRING(class, "input_profile", 130, ++ _("Input profile"), ++ _("Filename to load input profile from"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsIccTransform, input_profile_filename), ++ NULL); ++ ++ VIPS_ARG_INT(class, "depth", 140, ++ _("Depth"), ++ _("Output device space depth in bits"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsIcc, depth), ++ 8, 16, 8); + } + + static void +-vips_icc_transform_init( VipsIccTransform *transform ) ++vips_icc_transform_init(VipsIccTransform *transform) + { + } + +@@ -1236,7 +1214,7 @@ vips_icc_transform_init( VipsIccTransform *transform ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_icc_ac2rc( VipsImage *in, VipsImage **out, const char *profile_filename ) ++vips_icc_ac2rc(VipsImage *in, VipsImage **out, const char *profile_filename) + { + VipsImage *t; + cmsHPROFILE profile; +@@ -1247,97 +1225,97 @@ vips_icc_ac2rc( VipsImage *in, VipsImage **out, const char *profile_filename ) + int i; + + #ifdef G_OS_WIN32 +- if( !(profile = cmsOpenProfileFromFile( profile_filename, "r" )) ) +-#else /*!G_OS_WIN32*/ +- if( !(profile = cmsOpenProfileFromFile( profile_filename, "re" )) ) ++ if (!(profile = cmsOpenProfileFromFile(profile_filename, "r"))) ++#else /*!G_OS_WIN32*/ ++ if (!(profile = cmsOpenProfileFromFile(profile_filename, "re"))) + #endif /*G_OS_WIN32*/ +- return( -1 ); ++ return (-1); + + #ifdef DEBUG +- vips_icc_print_profile( profile_filename, profile ); ++ vips_icc_print_profile(profile_filename, profile); + #endif /*DEBUG*/ + +- if( !(media = cmsReadTag( profile, cmsSigMediaWhitePointTag )) ) { +- vips_error( "vips_icc_ac2rc", +- "%s", _( "unable to get media white point" ) ); +- return( -1 ); ++ if (!(media = cmsReadTag(profile, cmsSigMediaWhitePointTag))) { ++ vips_error("vips_icc_ac2rc", ++ "%s", _("unable to get media white point")); ++ return (-1); + } + + X = media->X; + Y = media->Y; + Z = media->Z; + +- cmsCloseProfile( profile ); ++ cmsCloseProfile(profile); + + /* We need XYZ so we can adjust the white balance. + */ +- if( vips_colourspace( in, &t, VIPS_INTERPRETATION_XYZ, NULL ) ) +- return( -1 ); ++ if (vips_colourspace(in, &t, VIPS_INTERPRETATION_XYZ, NULL)) ++ return (-1); + in = t; + +- if( !(add = VIPS_ARRAY( in, in->Bands, double )) || +- !(mul = VIPS_ARRAY( in, in->Bands, double )) ) +- return( -1 ); ++ if (!(add = VIPS_ARRAY(in, in->Bands, double)) || ++ !(mul = VIPS_ARRAY(in, in->Bands, double))) ++ return (-1); + + /* There might be extra bands off to the right somewhere. + */ +- for( i = 0; i < in->Bands; i++ ) ++ for (i = 0; i < in->Bands; i++) + add[i] = 0.0; + + mul[0] = VIPS_D50_X0 / (X * 100.0); + mul[1] = VIPS_D50_Y0 / (Y * 100.0); + mul[2] = VIPS_D50_Z0 / (Z * 100.0); + +- for( i = 3; i < in->Bands; i++ ) ++ for (i = 3; i < in->Bands; i++) + mul[i] = 1.0; + +- if( vips_linear( in, &t, add, mul, in->Bands, NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_linear(in, &t, add, mul, in->Bands, NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + in = t; + + *out = in; + +- return( 0 ); ++ return (0); + } + + /* TRUE if a profile is sane and is compatible with an image. + */ + gboolean +-vips_icc_is_compatible_profile( VipsImage *image, +- const void *data, size_t data_length ) ++vips_icc_is_compatible_profile(VipsImage *image, ++ const void *data, size_t data_length) + { + cmsHPROFILE profile; +- VipsIccInfo *info; ++ VipsIccInfo *info; + +- if( !(profile = cmsOpenProfileFromMem( data, data_length )) ) +- /* Corrupt profile. ++ if (!(profile = cmsOpenProfileFromMem(data, data_length))) ++ /* Corrupt profile. + */ +- return( FALSE ); ++ return (FALSE); + + #ifdef DEBUG +- vips_icc_print_profile( "from memory", profile ); ++ vips_icc_print_profile("from memory", profile); + #endif /*DEBUG*/ + +- if( !(info = vips_icc_info( cmsGetColorSpace( profile ) )) ) { +- /* Unsupported profile. +- */ +- VIPS_FREEF( cmsCloseProfile, profile ); +- return( FALSE ); +- } +- +- if( image->Bands < info->bands ) { +- /* Too few bands, +- */ +- VIPS_FREEF( cmsCloseProfile, profile ); +- return( FALSE ); ++ if (!(info = vips_icc_info(cmsGetColorSpace(profile)))) { ++ /* Unsupported profile. ++ */ ++ VIPS_FREEF(cmsCloseProfile, profile); ++ return (FALSE); ++ } ++ ++ if (image->Bands < info->bands) { ++ /* Too few bands, ++ */ ++ VIPS_FREEF(cmsCloseProfile, profile); ++ return (FALSE); + } + +- VIPS_FREEF( cmsCloseProfile, profile ); ++ VIPS_FREEF(cmsCloseProfile, profile); + +- return( TRUE ); ++ return (TRUE); + } + + #else /*!HAVE_LCMS2*/ +@@ -1345,25 +1323,25 @@ vips_icc_is_compatible_profile( VipsImage *image, + #include + + int +-vips_icc_present( void ) ++vips_icc_present(void) + { +- return( 0 ); ++ return (0); + } + + int +-vips_icc_ac2rc( VipsImage *in, VipsImage **out, const char *profile_filename ) ++vips_icc_ac2rc(VipsImage *in, VipsImage **out, const char *profile_filename) + { +- vips_error( "VipsIcc", "%s", +- _( "libvips configured without lcms support" ) ); ++ vips_error("VipsIcc", "%s", ++ _("libvips configured without lcms support")); + +- return( -1 ); ++ return (-1); + } + + gboolean +-vips_icc_is_compatible_profile( VipsImage *image, +- const void *data, size_t data_length ) ++vips_icc_is_compatible_profile(VipsImage *image, ++ const void *data, size_t data_length) + { +- return( TRUE ); ++ return (TRUE); + } + + #endif /*HAVE_LCMS2*/ +@@ -1383,19 +1361,19 @@ vips_icc_is_compatible_profile( VipsImage *image, + * * @input_profile: %gchararray, get the input profile from here + * + * Import an image from device space to D65 LAB with an ICC profile. If @pcs is +- * set to #VIPS_PCS_XYZ, use CIE XYZ PCS instead. ++ * set to #VIPS_PCS_XYZ, use CIE XYZ PCS instead. + * + * If @embedded is set, the input profile is taken from the input image + * metadata. If there is no embedded profile, +- * @input_profile_filename is used as a fall-back. ++ * @input_profile_filename is used as a fall-back. + * You can test for the + * presence of an embedded profile with + * vips_image_get_typeof() with #VIPS_META_ICC_NAME as an argument. This will +- * return %GType 0 if there is no profile. ++ * return %GType 0 if there is no profile. + * + * If @embedded is not set, the input profile is taken from + * @input_profile. If @input_profile is not supplied, the +- * metadata profile, if any, is used as a fall-back. ++ * metadata profile, if any, is used as a fall-back. + * + * If @black_point_compensation is set, LCMS black point compensation is + * enabled. +@@ -1403,16 +1381,16 @@ vips_icc_is_compatible_profile( VipsImage *image, + * Returns: 0 on success, -1 on error. + */ + int +-vips_icc_import( VipsImage *in, VipsImage **out, ... ) ++vips_icc_import(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "icc_import", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("icc_import", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -1429,12 +1407,12 @@ vips_icc_import( VipsImage *in, VipsImage **out, ... ) + * * @output_profile: %gchararray, get the output profile from here + * * @depth: %gint, depth of output image in bits + * +- * Export an image from D65 LAB to device space with an ICC profile. ++ * Export an image from D65 LAB to device space with an ICC profile. + * If @pcs is +- * set to #VIPS_PCS_XYZ, use CIE XYZ PCS instead. +- * If @output_profile is not set, use the embedded profile, if any. +- * If @output_profile is set, export with that and attach it to the output +- * image. ++ * set to #VIPS_PCS_XYZ, use CIE XYZ PCS instead. ++ * If @output_profile is not set, use the embedded profile, if any. ++ * If @output_profile is set, export with that and attach it to the output ++ * image. + * + * If @black_point_compensation is set, LCMS black point compensation is + * enabled. +@@ -1442,16 +1420,16 @@ vips_icc_import( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_icc_export( VipsImage *in, VipsImage **out, ... ) ++vips_icc_export(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "icc_export", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("icc_export", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -1480,34 +1458,34 @@ vips_icc_export( VipsImage *in, VipsImage **out, ... ) + * You can test for the + * presence of an embedded profile with + * vips_image_get_typeof() with #VIPS_META_ICC_NAME as an argument. This will +- * return %GType 0 if there is no profile. ++ * return %GType 0 if there is no profile. + * + * If @embedded is not set, the input profile is taken from + * @input_profile. If @input_profile is not supplied, the +- * metadata profile, if any, is used as a fall-back. ++ * metadata profile, if any, is used as a fall-back. + * + * If @black_point_compensation is set, LCMS black point compensation is + * enabled. + * + * The output image has the output profile attached to the #VIPS_META_ICC_NAME +- * field. ++ * field. + * +- * Use vips_icc_import() and vips_icc_export() to do either the first or ++ * Use vips_icc_import() and vips_icc_export() to do either the first or + * second half of this operation in isolation. + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_icc_transform( VipsImage *in, VipsImage **out, +- const char *output_profile, ... ) ++vips_icc_transform(VipsImage *in, VipsImage **out, ++ const char *output_profile, ...) + { + va_list ap; + int result; + +- va_start( ap, output_profile ); +- result = vips_call_split( "icc_transform", ap, +- in, out, output_profile ); +- va_end( ap ); ++ va_start(ap, output_profile); ++ result = vips_call_split("icc_transform", ap, ++ in, out, output_profile); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/pcolour.h b/libvips/colour/pcolour.h +index 5465a80e39..eeab29e1ce 100644 +--- a/libvips/colour/pcolour.h ++++ b/libvips/colour/pcolour.h +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -38,28 +38,28 @@ extern "C" { + #include + + #define VIPS_TYPE_COLOUR (vips_colour_get_type()) +-#define VIPS_COLOUR( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_COLOUR, VipsColour )) +-#define VIPS_COLOUR_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_COLOUR(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_COLOUR, VipsColour)) ++#define VIPS_COLOUR_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_COLOUR, VipsColourClass)) ++#define VIPS_IS_COLOUR(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_COLOUR)) ++#define VIPS_IS_COLOUR_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_COLOUR)) ++#define VIPS_COLOUR_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_COLOUR, VipsColourClass)) +-#define VIPS_IS_COLOUR( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_COLOUR )) +-#define VIPS_IS_COLOUR_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_COLOUR )) +-#define VIPS_COLOUR_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_COLOUR, VipsColourClass )) + + struct _VipsColour; +-typedef void (*VipsColourProcessFn)( struct _VipsColour *colour, +- VipsPel *out, VipsPel **in, int width ); ++typedef void (*VipsColourProcessFn)(struct _VipsColour *colour, ++ VipsPel *out, VipsPel **in, int width); + + typedef struct _VipsColour { + VipsOperation parent_instance; + +- /* Null-terminated array of input arguments, set these from a ++ /* Null-terminated array of input arguments, set these from a + * subclass. + */ + VipsImage **in; +@@ -68,7 +68,7 @@ typedef struct _VipsColour { + /* If this is >0, only process this many bands from the input. Extra + * bands are removed and reattached after processing. + */ +- int input_bands; ++ int input_bands; + + VipsImage *out; + +@@ -93,25 +93,25 @@ typedef struct _VipsColourClass { + + } VipsColourClass; + +-GType vips_colour_get_type( void ); ++GType vips_colour_get_type(void); + + /* A float in, float out colourspace transformation. + */ + + #define VIPS_TYPE_COLOUR_TRANSFORM (vips_colour_transform_get_type()) +-#define VIPS_COLOUR_TRANSFORM( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_COLOUR_TRANSFORM, VipsColourTransform )) +-#define VIPS_COLOUR_TRANSFORM_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_COLOUR_TRANSFORM(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_COLOUR_TRANSFORM, VipsColourTransform)) ++#define VIPS_COLOUR_TRANSFORM_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_COLOUR_TRANSFORM, VipsColourTransformClass)) ++#define VIPS_IS_COLOUR_TRANSFORM(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_COLOUR_TRANSFORM)) ++#define VIPS_IS_COLOUR_TRANSFORM_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_COLOUR_TRANSFORM)) ++#define VIPS_COLOUR_TRANSFORM_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_COLOUR_TRANSFORM, VipsColourTransformClass)) +-#define VIPS_IS_COLOUR_TRANSFORM( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_COLOUR_TRANSFORM )) +-#define VIPS_IS_COLOUR_TRANSFORM_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_COLOUR_TRANSFORM )) +-#define VIPS_COLOUR_TRANSFORM_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_COLOUR_TRANSFORM, VipsColourTransformClass )) + + typedef struct _VipsColourTransform { + VipsColour parent_instance; +@@ -125,25 +125,25 @@ typedef struct _VipsColourTransformClass { + + } VipsColourTransformClass; + +-GType vips_colour_transform_get_type( void ); ++GType vips_colour_transform_get_type(void); + + /* Change colour encoding ... either in or out is not three-band float. + */ + + #define VIPS_TYPE_COLOUR_CODE (vips_colour_code_get_type()) +-#define VIPS_COLOUR_CODE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_COLOUR_CODE, VipsColourCode )) +-#define VIPS_COLOUR_CODE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_COLOUR_CODE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_COLOUR_CODE, VipsColourCode)) ++#define VIPS_COLOUR_CODE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_COLOUR_CODE, VipsColourCodeClass)) ++#define VIPS_IS_COLOUR_CODE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_COLOUR_CODE)) ++#define VIPS_IS_COLOUR_CODE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_COLOUR_CODE)) ++#define VIPS_COLOUR_CODE_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_COLOUR_CODE, VipsColourCodeClass)) +-#define VIPS_IS_COLOUR_CODE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_COLOUR_CODE )) +-#define VIPS_IS_COLOUR_CODE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_COLOUR_CODE )) +-#define VIPS_COLOUR_CODE_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_COLOUR_CODE, VipsColourCodeClass )) + + typedef struct _VipsColourCode { + VipsColour parent_instance; +@@ -163,25 +163,25 @@ typedef struct _VipsColourCodeClass { + + } VipsColourCodeClass; + +-GType vips_colour_code_get_type( void ); ++GType vips_colour_code_get_type(void); + +-/* Difference between two colour images. ++/* Difference between two colour images. + */ + + #define VIPS_TYPE_COLOUR_DIFFERENCE (vips_colour_difference_get_type()) +-#define VIPS_COLOUR_DIFFERENCE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_COLOUR_DIFFERENCE, VipsColourDifference )) +-#define VIPS_COLOUR_DIFFERENCE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_COLOUR_DIFFERENCE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_COLOUR_DIFFERENCE, VipsColourDifference)) ++#define VIPS_COLOUR_DIFFERENCE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_COLOUR_DIFFERENCE, VipsColourDifferenceClass)) ++#define VIPS_IS_COLOUR_DIFFERENCE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_COLOUR_DIFFERENCE)) ++#define VIPS_IS_COLOUR_DIFFERENCE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_COLOUR_DIFFERENCE)) ++#define VIPS_COLOUR_DIFFERENCE_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_COLOUR_DIFFERENCE, VipsColourDifferenceClass)) +-#define VIPS_IS_COLOUR_DIFFERENCE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_COLOUR_DIFFERENCE )) +-#define VIPS_IS_COLOUR_DIFFERENCE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_COLOUR_DIFFERENCE )) +-#define VIPS_COLOUR_DIFFERENCE_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_COLOUR_DIFFERENCE, VipsColourDifferenceClass )) + + typedef struct _VipsColourDifference { + VipsColour parent_instance; +@@ -200,10 +200,10 @@ typedef struct _VipsColourDifferenceClass { + + } VipsColourDifferenceClass; + +-GType vips_colour_difference_get_type( void ); ++GType vips_colour_difference_get_type(void); + +-void vips__pythagoras_line( VipsColour *colour, +- VipsPel *out, VipsPel **in, int width ); ++void vips__pythagoras_line(VipsColour *colour, ++ VipsPel *out, VipsPel **in, int width); + + /* Colour tables for Y<->v conversion. Call vips_col_make_tables_RGB_8() and + * vips_col_make_tables_RGB_16() before use to initialize. +@@ -211,19 +211,18 @@ void vips__pythagoras_line( VipsColour *colour, + extern float vips_v2Y_8[256]; + extern float vips_v2Y_16[65536]; + +-void vips_col_make_tables_RGB_8( void ); +-void vips_col_make_tables_RGB_16( void ); ++void vips_col_make_tables_RGB_8(void); ++void vips_col_make_tables_RGB_16(void); + + /* A colour-transforming function. + */ +-typedef int (*VipsColourTransformFn)( VipsImage *in, VipsImage **out, ... ); ++typedef int (*VipsColourTransformFn)(VipsImage *in, VipsImage **out, ...); + +-int vips__colourspace_process_n( const char *domain, +- VipsImage *in, VipsImage **out, int n, VipsColourTransformFn fn ); ++int vips__colourspace_process_n(const char *domain, ++ VipsImage *in, VipsImage **out, int n, VipsColourTransformFn fn); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_PCOLOUR_H*/ +- +diff --git a/libvips/colour/profile_load.c b/libvips/colour/profile_load.c +index 8a13cddb84..d1aa2a4a73 100644 +--- a/libvips/colour/profile_load.c ++++ b/libvips/colour/profile_load.c +@@ -1,4 +1,4 @@ +-/* Load profiles as blobs. ++/* Load profiles as blobs. + * + * 10/1/19 + * - from CMYK2XYZ.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -56,126 +56,125 @@ typedef struct _VipsProfileLoad { + + typedef VipsOperationClass VipsProfileLoadClass; + +-G_DEFINE_TYPE( VipsProfileLoad, vips_profile_load, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsProfileLoad, vips_profile_load, VIPS_TYPE_OPERATION); + + static const void * +-vips_profile_fallback_get( const char *name, size_t *length ) ++vips_profile_fallback_get(const char *name, size_t *length) + { + int i; + VipsProfileFallback *fallback; + +- for( i = 0; (fallback = vips__profile_fallback_table[i]); i++ ) +- if( g_ascii_strcasecmp( fallback->name, name ) == 0 ) { ++ for (i = 0; (fallback = vips__profile_fallback_table[i]); i++) ++ if (g_ascii_strcasecmp(fallback->name, name) == 0) { + void *data; + GConverter *converter; + GConverterResult res; + gsize bytes_read; + gsize bytes_written; + +- data = g_malloc0( fallback->length ); +- converter = G_CONVERTER( g_zlib_decompressor_new( +- G_ZLIB_COMPRESSOR_FORMAT_ZLIB ) ); ++ data = g_malloc0(fallback->length); ++ converter = G_CONVERTER(g_zlib_decompressor_new( ++ G_ZLIB_COMPRESSOR_FORMAT_ZLIB)); + +- res = g_converter_convert( converter, ++ res = g_converter_convert(converter, + fallback->data, fallback->length, + data, fallback->length, + G_CONVERTER_INPUT_AT_END, +- &bytes_read, &bytes_written, NULL ); +- g_object_unref( converter ); ++ &bytes_read, &bytes_written, NULL); ++ g_object_unref(converter); + +- if( res == G_CONVERTER_FINISHED ) { ++ if (res == G_CONVERTER_FINISHED) { + *length = fallback->length; +- return( data ); +- } else { +- g_free( data ); +- g_warning( "fallback profile " +- "decompression failed" ); ++ return (data); ++ } ++ else { ++ g_free(data); ++ g_warning("fallback profile " ++ "decompression failed"); + } + } + +- return( NULL ); ++ return (NULL); + } + + static int +-vips_profile_load_build( VipsObject *object ) ++vips_profile_load_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsProfileLoad *load = (VipsProfileLoad *) object; + + size_t length; + const void *data; +- VipsBlob *profile; ++ VipsBlob *profile; + +- if( VIPS_OBJECT_CLASS( vips_profile_load_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_profile_load_parent_class)->build(object)) ++ return (-1); + +- if( g_ascii_strcasecmp( load->name, "none" ) == 0 ) ++ if (g_ascii_strcasecmp(load->name, "none") == 0) + profile = NULL; +- else if( (data = vips_profile_fallback_get( load->name, &length )) ) ++ else if ((data = vips_profile_fallback_get(load->name, &length))) + profile = vips_blob_new( +- (VipsCallbackFn) vips_area_free_cb, data, length ); +- else if( (data = vips__file_read_name( load->name, +- vips__icc_dir(), &length )) ) +- profile = vips_blob_new( +- (VipsCallbackFn) vips_area_free_cb, data, length ); ++ (VipsCallbackFn) vips_area_free_cb, data, length); ++ else if ((data = vips__file_read_name(load->name, ++ vips__icc_dir(), &length))) ++ profile = vips_blob_new( ++ (VipsCallbackFn) vips_area_free_cb, data, length); + else { +- vips_error( class->nickname, +- _( "unable to load profile \"%s\"" ), load->name ); +- return( -1 ); ++ vips_error(class->nickname, ++ _("unable to load profile \"%s\""), load->name); ++ return (-1); + } + +- g_object_set( object, "profile", profile, NULL ); ++ g_object_set(object, "profile", profile, NULL); + +- if( profile ) { +- vips_area_unref( (VipsArea *) profile ); ++ if (profile) { ++ vips_area_unref((VipsArea *) profile); + profile = NULL; + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_profile_load_class_init( VipsProfileLoadClass *class ) ++vips_profile_load_class_init(VipsProfileLoadClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "profile_load"; +- object_class->description = _( "load named ICC profile" ); ++ object_class->description = _("load named ICC profile"); + object_class->build = vips_profile_load_build; + +- VIPS_ARG_STRING( class, "name", 1, +- _( "Name" ), +- _( "Profile name" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsProfileLoad, name ), +- NULL ); +- +- VIPS_ARG_BOXED( class, "profile", 2, +- _( "Profile" ), +- _( "Loaded profile" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsProfileLoad, profile ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_STRING(class, "name", 1, ++ _("Name"), ++ _("Profile name"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsProfileLoad, name), ++ NULL); ++ ++ VIPS_ARG_BOXED(class, "profile", 2, ++ _("Profile"), ++ _("Loaded profile"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsProfileLoad, profile), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_profile_load_init( VipsProfileLoad *load ) ++vips_profile_load_init(VipsProfileLoad *load) + { + } + + /** +- * vips_profile_load: ++ * vips_profile_load: + * @name: name of profile to load + * @profile: (out): loaded profile + * @...: %NULL-terminated list of optional named arguments + * +- * Load a named profile. ++ * Load a named profile. + * + * Profiles are loaded from four sources: + * +@@ -193,43 +192,43 @@ vips_profile_load_init( VipsProfileLoad *load ) + * Returns: 0 on success, -1 on error + */ + int +-vips_profile_load( const char *name, VipsBlob **profile, ... ) ++vips_profile_load(const char *name, VipsBlob **profile, ...) + { + va_list ap; + int result; + +- va_start( ap, profile ); +- result = vips_call_split( "profile_load", ap, name, profile ); +- va_end( ap ); ++ va_start(ap, profile); ++ result = vips_call_split("profile_load", ap, name, profile); ++ va_end(ap); + +- return( result ); ++ return (result); + } + +-/* Set (or remove) a named profile on an image. ++/* Set (or remove) a named profile on an image. + */ + int +-vips__profile_set( VipsImage *image, const char *name ) ++vips__profile_set(VipsImage *image, const char *name) + { + VipsBlob *profile; + +- if( vips_profile_load( name, &profile, NULL ) ) +- return( -1 ); ++ if (vips_profile_load(name, &profile, NULL)) ++ return (-1); + +- if( profile ) { ++ if (profile) { + GValue value = { 0 }; + +- g_value_init( &value, VIPS_TYPE_BLOB ); +- g_value_set_boxed( &value, profile ); +- vips_image_set( image, VIPS_META_ICC_NAME, &value ); +- g_value_unset( &value ); ++ g_value_init(&value, VIPS_TYPE_BLOB); ++ g_value_set_boxed(&value, profile); ++ vips_image_set(image, VIPS_META_ICC_NAME, &value); ++ g_value_unset(&value); + } +- else +- vips_image_remove( image, VIPS_META_ICC_NAME ); ++ else ++ vips_image_remove(image, VIPS_META_ICC_NAME); + +- if( profile ) { +- vips_area_unref( (VipsArea *) profile ); ++ if (profile) { ++ vips_area_unref((VipsArea *) profile); + profile = NULL; + } + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/colour/profiles.h b/libvips/colour/profiles.h +index 142e4f832f..ec397c41d4 100644 +--- a/libvips/colour/profiles.h ++++ b/libvips/colour/profiles.h +@@ -10,4 +10,3 @@ typedef struct _VipsProfileFallback { + } VipsProfileFallback; + + extern VipsProfileFallback *vips__profile_fallback_table[]; +- +diff --git a/libvips/colour/rad2float.c b/libvips/colour/rad2float.c +index 727f87b03e..3d1d74f5f0 100644 +--- a/libvips/colour/rad2float.c ++++ b/libvips/colour/rad2float.c +@@ -3,7 +3,7 @@ + * 3/3/09 + * - from LabQ2Lab and Radiance sources + * 2/11/09 +- * - gtkdoc ++ * - gtkdoc + * 20/9/12 + * - redo as a class + * 13/12/12 +@@ -12,35 +12,35 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + + /* + +- Sections of this file from Greg Ward and Radiance with kind +- permission. The Radience copyright notice appears below. ++ Sections of this file from Greg Ward and Radiance with kind ++ permission. The Radience copyright notice appears below. + + */ + +@@ -116,37 +116,37 @@ + /* Begin copy-paste from Radiance sources. + */ + +-#define RED 0 +-#define GRN 1 +-#define BLU 2 +-#define CIEX 0 /* or, if input is XYZ... */ +-#define CIEY 1 +-#define CIEZ 2 +-#define EXP 3 /* exponent same for either format */ +-#define COLXS 128 /* excess used for exponent */ +-#define WHT 3 /* used for RGBPRIMS type */ ++#define RED 0 ++#define GRN 1 ++#define BLU 2 ++#define CIEX 0 /* or, if input is XYZ... */ ++#define CIEY 1 ++#define CIEZ 2 ++#define EXP 3 /* exponent same for either format */ ++#define COLXS 128 /* excess used for exponent */ ++#define WHT 3 /* used for RGBPRIMS type */ + +-#undef BYTE +-#define BYTE unsigned char /* 8-bit unsigned integer */ ++#undef BYTE ++#define BYTE unsigned char /* 8-bit unsigned integer */ + +-typedef BYTE COLR[4]; /* red, green, blue (or X,Y,Z), exponent */ ++typedef BYTE COLR[4]; /* red, green, blue (or X,Y,Z), exponent */ + + typedef float COLORV; +-typedef COLORV COLOR[3]; /* red, green, blue (or X,Y,Z) */ ++typedef COLORV COLOR[3]; /* red, green, blue (or X,Y,Z) */ + +-#define copycolor(c1,c2) ((c1)[0]=(c2)[0],(c1)[1]=(c2)[1],(c1)[2]=(c2)[2]) ++#define copycolor(c1, c2) ((c1)[0] = (c2)[0], (c1)[1] = (c2)[1], (c1)[2] = (c2)[2]) + + static void +-colr_color(COLOR col, COLR clr) /* convert short to float color */ ++colr_color(COLOR col, COLR clr) /* convert short to float color */ + { + if (clr[EXP] == 0) + col[RED] = col[GRN] = col[BLU] = 0.0; + else { +- double f = ldexp(1.0, (int)clr[EXP]-(COLXS+8)); ++ double f = ldexp(1.0, (int) clr[EXP] - (COLXS + 8)); + +- col[RED] = (clr[RED] + 0.5)*f; +- col[GRN] = (clr[GRN] + 0.5)*f; +- col[BLU] = (clr[BLU] + 0.5)*f; ++ col[RED] = (clr[RED] + 0.5) * f; ++ col[GRN] = (clr[GRN] + 0.5) * f; ++ col[BLU] = (clr[BLU] + 0.5) * f; + } + } + +@@ -156,38 +156,38 @@ colr_color(COLOR col, COLR clr) /* convert short to float color */ + typedef VipsColourCode VipsRad2float; + typedef VipsColourCodeClass VipsRad2floatClass; + +-G_DEFINE_TYPE( VipsRad2float, vips_rad2float, VIPS_TYPE_COLOUR_CODE ); ++G_DEFINE_TYPE(VipsRad2float, vips_rad2float, VIPS_TYPE_COLOUR_CODE); + + static void +-vips_rad2float_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_rad2float_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { + COLR *inp = (COLR *) in[0]; + COLOR *outbuf = (COLOR *) out; + + int i; + +- for( i = 0; i < width; i++ ) +- colr_color( outbuf[i], inp[i] ); ++ for (i = 0; i < width; i++) ++ colr_color(outbuf[i], inp[i]); + } + + static void +-vips_rad2float_class_init( VipsRad2floatClass *class ) ++vips_rad2float_class_init(VipsRad2floatClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "rad2float"; +- object_class->description = +- _( "unpack Radiance coding to float RGB" ); ++ object_class->description = ++ _("unpack Radiance coding to float RGB"); + + colour_class->process_line = vips_rad2float_line; + } + + static void +-vips_rad2float_init( VipsRad2float *rad2float ) ++vips_rad2float_init(VipsRad2float *rad2float) + { +- VipsColour *colour = VIPS_COLOUR( rad2float ); +- VipsColourCode *code = VIPS_COLOUR_CODE( rad2float ); ++ VipsColour *colour = VIPS_COLOUR(rad2float); ++ VipsColourCode *code = VIPS_COLOUR_CODE(rad2float); + + colour->coding = VIPS_CODING_NONE; + colour->interpretation = VIPS_INTERPRETATION_scRGB; +@@ -210,14 +210,14 @@ vips_rad2float_init( VipsRad2float *rad2float ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_rad2float( VipsImage *in, VipsImage **out, ... ) ++vips_rad2float(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "rad2float", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("rad2float", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/sRGB2HSV.c b/libvips/colour/sRGB2HSV.c +index 36bd55921b..2415e921dc 100644 +--- a/libvips/colour/sRGB2HSV.c ++++ b/libvips/colour/sRGB2HSV.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -45,76 +45,75 @@ + typedef VipsColourCode VipssRGB2HSV; + typedef VipsColourCodeClass VipssRGB2HSVClass; + +-G_DEFINE_TYPE( VipssRGB2HSV, vips_sRGB2HSV, VIPS_TYPE_COLOUR_CODE ); ++G_DEFINE_TYPE(VipssRGB2HSV, vips_sRGB2HSV, VIPS_TYPE_COLOUR_CODE); + + static void +-vips_sRGB2HSV_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_sRGB2HSV_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { + unsigned char *p = (unsigned char *) in[0]; + unsigned char *q = (unsigned char *) out; + + int i; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + unsigned char c_max; + unsigned char c_min; + float secondary_diff; + float wrap_around_hue; + +- if( p[1] < p[2] ) { +- if( p[2] < p[0] ) { ++ if (p[1] < p[2]) { ++ if (p[2] < p[0]) { + /* Center red (at top). + */ + c_max = p[0]; + c_min = p[1]; + secondary_diff = p[1] - p[2]; + wrap_around_hue = 255.0; +- } ++ } + else { + /* Center blue. + */ + c_max = p[2]; +- c_min = VIPS_MIN( p[1], p[0] ); ++ c_min = VIPS_MIN(p[1], p[0]); + secondary_diff = p[0] - p[1]; + wrap_around_hue = 170.0; + } +- } ++ } + else { +- if( p[1] < p[0] ) { ++ if (p[1] < p[0]) { + /* Center red (at bottom) + */ + c_max = p[0]; + c_min = p[2]; + secondary_diff = p[1] - p[2]; + wrap_around_hue = 0.0; +- } ++ } + else { + /* Center green + */ + c_max = p[1]; +- c_min = VIPS_MIN( p[2], p[0] ); ++ c_min = VIPS_MIN(p[2], p[0]); + secondary_diff = p[2] - p[0]; + wrap_around_hue = 85.0; + } + } + +- +- if( c_max == 0 ) { ++ if (c_max == 0) { + q[0] = 0; + q[1] = 0; + q[2] = 0; +- } ++ } + else { + unsigned char delta; + + q[2] = c_max; + delta = c_max - c_min; + +- if( delta == 0 ) ++ if (delta == 0) + q[0] = 0; +- else ++ else + q[0] = 42.5 * (secondary_diff / (float) delta) + +- wrap_around_hue; ++ wrap_around_hue; + + q[1] = delta * 255.0 / (float) c_max; + } +@@ -125,22 +124,22 @@ vips_sRGB2HSV_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static void +-vips_sRGB2HSV_class_init( VipssRGB2HSVClass *class ) ++vips_sRGB2HSV_class_init(VipssRGB2HSVClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "sRGB2HSV"; +- object_class->description = _( "transform sRGB to HSV" ); ++ object_class->description = _("transform sRGB to HSV"); + + colour_class->process_line = vips_sRGB2HSV_line; + } + + static void +-vips_sRGB2HSV_init( VipssRGB2HSV *sRGB2HSV ) ++vips_sRGB2HSV_init(VipssRGB2HSV *sRGB2HSV) + { +- VipsColour *colour = VIPS_COLOUR( sRGB2HSV ); +- VipsColourCode *code = VIPS_COLOUR_CODE( sRGB2HSV ); ++ VipsColour *colour = VIPS_COLOUR(sRGB2HSV); ++ VipsColourCode *code = VIPS_COLOUR_CODE(sRGB2HSV); + + colour->interpretation = VIPS_INTERPRETATION_HSV; + colour->format = VIPS_FORMAT_UCHAR; +@@ -161,7 +160,7 @@ vips_sRGB2HSV_init( VipssRGB2HSV *sRGB2HSV ) + * Convert to HSV. + * + * HSV is a crude polar coordinate system for RGB images. It is provided for +- * compatibility with other image processing systems. See vips_Lab2LCh() for a ++ * compatibility with other image processing systems. See vips_Lab2LCh() for a + * much better colour space. + * + * See also: vips_HSV2sRGB(), vips_Lab2LCh(). +@@ -169,15 +168,14 @@ vips_sRGB2HSV_init( VipssRGB2HSV *sRGB2HSV ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_sRGB2HSV( VipsImage *in, VipsImage **out, ... ) ++vips_sRGB2HSV(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "sRGB2HSV", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("sRGB2HSV", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/colour/sRGB2scRGB.c b/libvips/colour/sRGB2scRGB.c +index ae06cd49dd..0668825261 100644 +--- a/libvips/colour/sRGB2scRGB.c ++++ b/libvips/colour/sRGB2scRGB.c +@@ -23,28 +23,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -69,22 +69,22 @@ typedef struct _VipssRGB2scRGB { + + VipsImage *in; + VipsImage *out; +-} VipssRGB2scRGB; ++} VipssRGB2scRGB; + + typedef VipsOperationClass VipssRGB2scRGBClass; + +-G_DEFINE_TYPE( VipssRGB2scRGB, vips_sRGB2scRGB, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipssRGB2scRGB, vips_sRGB2scRGB, VIPS_TYPE_OPERATION); + + /* Convert a buffer of 8-bit pixels. + */ + static void +-vips_sRGB2scRGB_line_8( float * restrict q, VipsPel * restrict p, +- int extra_bands, int width ) ++vips_sRGB2scRGB_line_8(float *restrict q, VipsPel *restrict p, ++ int extra_bands, int width) + { + int i, j; + +- if( extra_bands == 0 ) { +- for( i = 0; i < width; i++ ) { ++ if (extra_bands == 0) { ++ for (i = 0; i < width; i++) { + q[0] = vips_v2Y_8[p[0]]; + q[1] = vips_v2Y_8[p[1]]; + q[2] = vips_v2Y_8[p[2]]; +@@ -93,8 +93,8 @@ vips_sRGB2scRGB_line_8( float * restrict q, VipsPel * restrict p, + q += 3; + } + } +- else if( extra_bands == 1 ) { +- for( i = 0; i < width; i++ ) { ++ else if (extra_bands == 1) { ++ for (i = 0; i < width; i++) { + q[0] = vips_v2Y_8[p[0]]; + q[1] = vips_v2Y_8[p[1]]; + q[2] = vips_v2Y_8[p[2]]; +@@ -105,7 +105,7 @@ vips_sRGB2scRGB_line_8( float * restrict q, VipsPel * restrict p, + } + } + else { +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + q[0] = vips_v2Y_8[p[0]]; + q[1] = vips_v2Y_8[p[1]]; + q[2] = vips_v2Y_8[p[2]]; +@@ -113,7 +113,7 @@ vips_sRGB2scRGB_line_8( float * restrict q, VipsPel * restrict p, + p += 3; + q += 3; + +- for( j = 0; j < extra_bands; j++ ) ++ for (j = 0; j < extra_bands; j++) + q[j] = p[j]; + p += extra_bands; + q += extra_bands; +@@ -124,13 +124,13 @@ vips_sRGB2scRGB_line_8( float * restrict q, VipsPel * restrict p, + /* Convert a buffer of 16-bit pixels. + */ + static void +-vips_sRGB2scRGB_line_16( float * restrict q, unsigned short * restrict p, +- int extra_bands, int width ) ++vips_sRGB2scRGB_line_16(float *restrict q, unsigned short *restrict p, ++ int extra_bands, int width) + { + int i, j; + +- if( extra_bands == 0 ) { +- for( i = 0; i < width; i++ ) { ++ if (extra_bands == 0) { ++ for (i = 0; i < width; i++) { + q[0] = vips_v2Y_16[p[0]]; + q[1] = vips_v2Y_16[p[1]]; + q[2] = vips_v2Y_16[p[2]]; +@@ -139,8 +139,8 @@ vips_sRGB2scRGB_line_16( float * restrict q, unsigned short * restrict p, + q += 3; + } + } +- else if( extra_bands == 1 ) { +- for( i = 0; i < width; i++ ) { ++ else if (extra_bands == 1) { ++ for (i = 0; i < width; i++) { + q[0] = vips_v2Y_16[p[0]]; + q[1] = vips_v2Y_16[p[1]]; + q[2] = vips_v2Y_16[p[2]]; +@@ -151,7 +151,7 @@ vips_sRGB2scRGB_line_16( float * restrict q, unsigned short * restrict p, + } + } + else { +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + q[0] = vips_v2Y_16[p[0]]; + q[1] = vips_v2Y_16[p[1]]; + q[2] = vips_v2Y_16[p[2]]; +@@ -159,7 +159,7 @@ vips_sRGB2scRGB_line_16( float * restrict q, unsigned short * restrict p, + p += 3; + q += 3; + +- for( j = 0; j < extra_bands; j++ ) ++ for (j = 0; j < extra_bands; j++) + q[j] = p[j] / 256.0; + p += extra_bands; + q += extra_bands; +@@ -168,134 +168,131 @@ vips_sRGB2scRGB_line_16( float * restrict q, unsigned short * restrict p, + } + + static int +-vips_sRGB2scRGB_gen( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_sRGB2scRGB_gen(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsImage *in = ir->im; + + int y; + +- if( vips_region_prepare( ir, r ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, r)) ++ return (-1); + +- VIPS_GATE_START( "vips_sRGB2scRGB_gen: work" ); ++ VIPS_GATE_START("vips_sRGB2scRGB_gen: work"); + +- if( in->BandFmt == VIPS_FORMAT_UCHAR ) { ++ if (in->BandFmt == VIPS_FORMAT_UCHAR) { + vips_col_make_tables_RGB_8(); + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( ir, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(ir, r->left, r->top + y); + float *q = (float *) +- VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ VIPS_REGION_ADDR(or, r->left, r->top + y); + +- vips_sRGB2scRGB_line_8( q, p, in->Bands - 3, r->width ); ++ vips_sRGB2scRGB_line_8(q, p, in->Bands - 3, r->width); + } + } + else { + vips_col_make_tables_RGB_16(); + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( ir, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(ir, r->left, r->top + y); + float *q = (float *) +- VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ VIPS_REGION_ADDR(or, r->left, r->top + y); + +- vips_sRGB2scRGB_line_16( q, (unsigned short *) p, +- in->Bands - 3, r->width ); ++ vips_sRGB2scRGB_line_16(q, (unsigned short *) p, ++ in->Bands - 3, r->width); + } + } + +- VIPS_GATE_STOP( "vips_sRGB2scRGB_gen: work" ); ++ VIPS_GATE_STOP("vips_sRGB2scRGB_gen: work"); + +- return( 0 ); ++ return (0); + } + + static int +-vips_sRGB2scRGB_build( VipsObject *object ) ++vips_sRGB2scRGB_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipssRGB2scRGB *sRGB2scRGB = (VipssRGB2scRGB *) object; + +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + + VipsImage *in; + VipsImage *out; + VipsBandFormat format; + +- if( VIPS_OBJECT_CLASS( vips_sRGB2scRGB_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_sRGB2scRGB_parent_class)->build(object)) ++ return (-1); + + in = sRGB2scRGB->in; +- if( vips_check_bands_atleast( class->nickname, in, 3 ) ) +- return( -1 ); +- +- format = in->Type == VIPS_INTERPRETATION_RGB16 ? +- VIPS_FORMAT_USHORT : VIPS_FORMAT_UCHAR; +- if( in->BandFmt != format ) { +- if( vips_cast( in, &t[0], format, NULL ) ) +- return( -1 ); ++ if (vips_check_bands_atleast(class->nickname, in, 3)) ++ return (-1); ++ ++ format = in->Type == VIPS_INTERPRETATION_RGB16 ? VIPS_FORMAT_USHORT : VIPS_FORMAT_UCHAR; ++ if (in->BandFmt != format) { ++ if (vips_cast(in, &t[0], format, NULL)) ++ return (-1); + } + else { + t[0] = in; +- g_object_ref( t[0] ); ++ g_object_ref(t[0]); + } + in = t[0]; + + out = vips_image_new(); +- if( vips_image_pipelinev( out, +- VIPS_DEMAND_STYLE_THINSTRIP, in, NULL ) ) { +- g_object_unref( out ); +- return( -1 ); ++ if (vips_image_pipelinev(out, ++ VIPS_DEMAND_STYLE_THINSTRIP, in, NULL)) { ++ g_object_unref(out); ++ return (-1); + } + out->Type = VIPS_INTERPRETATION_scRGB; + out->BandFmt = VIPS_FORMAT_FLOAT; + +- if( vips_image_generate( out, +- vips_start_one, vips_sRGB2scRGB_gen, vips_stop_one, +- in, sRGB2scRGB ) ) { +- g_object_unref( out ); +- return( -1 ); ++ if (vips_image_generate(out, ++ vips_start_one, vips_sRGB2scRGB_gen, vips_stop_one, ++ in, sRGB2scRGB)) { ++ g_object_unref(out); ++ return (-1); + } + +- g_object_set( object, "out", out, NULL ); ++ g_object_set(object, "out", out, NULL); + +- return( 0 ); ++ return (0); + } + + static void +-vips_sRGB2scRGB_class_init( VipssRGB2scRGBClass *class ) ++vips_sRGB2scRGB_class_init(VipssRGB2scRGBClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "sRGB2scRGB"; +- object_class->description = _( "convert an sRGB image to scRGB" ); ++ object_class->description = _("convert an sRGB image to scRGB"); + object_class->build = vips_sRGB2scRGB_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipssRGB2scRGB, in ) ); +- +- VIPS_ARG_IMAGE( class, "out", 100, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipssRGB2scRGB, out ) ); +- ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipssRGB2scRGB, in)); ++ ++ VIPS_ARG_IMAGE(class, "out", 100, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipssRGB2scRGB, out)); + } + + static void +-vips_sRGB2scRGB_init( VipssRGB2scRGB *sRGB2scRGB ) ++vips_sRGB2scRGB_init(VipssRGB2scRGB *sRGB2scRGB) + { + } + +@@ -307,8 +304,8 @@ vips_sRGB2scRGB_init( VipssRGB2scRGB *sRGB2scRGB ) + * + * Convert an sRGB image to scRGB. The input image can be 8 or 16-bit. + * +- * If the input image is tagged as #VIPS_INTERPRETATION_RGB16, any extra +- * channels after RGB are divided by 256. Thus, scRGB alpha is ++ * If the input image is tagged as #VIPS_INTERPRETATION_RGB16, any extra ++ * channels after RGB are divided by 256. Thus, scRGB alpha is + * always 0 - 255.99. + * + * See also: vips_scRGB2XYZ(), vips_scRGB2sRGB(), vips_rad2float(). +@@ -316,14 +313,14 @@ vips_sRGB2scRGB_init( VipssRGB2scRGB *sRGB2scRGB ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_sRGB2scRGB( VipsImage *in, VipsImage **out, ... ) ++vips_sRGB2scRGB(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "sRGB2scRGB", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("sRGB2scRGB", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/colour/scRGB2BW.c b/libvips/colour/scRGB2BW.c +index 7e21588f49..3ca2e83d9a 100644 +--- a/libvips/colour/scRGB2BW.c ++++ b/libvips/colour/scRGB2BW.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -57,25 +57,25 @@ typedef struct _VipsscRGB2BW { + + typedef VipsOperationClass VipsscRGB2BWClass; + +-G_DEFINE_TYPE( VipsscRGB2BW, vips_scRGB2BW, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsscRGB2BW, vips_scRGB2BW, VIPS_TYPE_OPERATION); + + /* Process a buffer of data. + */ + static void +-vips_scRGB2BW_line_8( VipsPel * restrict q, float * restrict p, +- int extra_bands, int width ) ++vips_scRGB2BW_line_8(VipsPel *restrict q, float *restrict p, ++ int extra_bands, int width) + { + int i, j; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + float R = p[0]; + float G = p[1]; + float B = p[2]; + + int g; +- int or; ++ int or ; + +- vips_col_scRGB2BW_8( R, G, B, &g, &or ); ++ vips_col_scRGB2BW_8(R, G, B, &g, & or); + + p += 3; + +@@ -83,28 +83,28 @@ vips_scRGB2BW_line_8( VipsPel * restrict q, float * restrict p, + + q += 1; + +- for( j = 0; j < extra_bands; j++ ) +- q[j] = VIPS_CLIP( 0, p[j], UCHAR_MAX ); ++ for (j = 0; j < extra_bands; j++) ++ q[j] = VIPS_CLIP(0, p[j], UCHAR_MAX); + p += extra_bands; + q += extra_bands; + } + } + + static void +-vips_scRGB2BW_line_16( unsigned short * restrict q, float * restrict p, +- int extra_bands, int width ) ++vips_scRGB2BW_line_16(unsigned short *restrict q, float *restrict p, ++ int extra_bands, int width) + { + int i, j; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + float R = p[0]; + float G = p[1]; + float B = p[2]; + + int g; +- int or; ++ int or ; + +- vips_col_scRGB2BW_16( R, G, B, &g, &or ); ++ vips_col_scRGB2BW_16(R, G, B, &g, & or); + + p += 3; + +@@ -112,69 +112,69 @@ vips_scRGB2BW_line_16( unsigned short * restrict q, float * restrict p, + + q += 1; + +- for( j = 0; j < extra_bands; j++ ) +- q[j] = VIPS_CLIP( 0, (int) (p[j] * 256.0), USHRT_MAX ); ++ for (j = 0; j < extra_bands; j++) ++ q[j] = VIPS_CLIP(0, (int) (p[j] * 256.0), USHRT_MAX); + p += extra_bands; + q += extra_bands; + } + } + + static int +-vips_scRGB2BW_gen( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_scRGB2BW_gen(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + VipsscRGB2BW *scRGB2BW = (VipsscRGB2BW *) b; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsImage *in = ir->im; + + int y; + +- if( vips_region_prepare( ir, r ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, r)) ++ return (-1); + +- VIPS_GATE_START( "vips_scRGB2BW_gen: work" ); ++ VIPS_GATE_START("vips_scRGB2BW_gen: work"); + +- for( y = 0; y < r->height; y++ ) { +- float *p = (float *) +- VIPS_REGION_ADDR( ir, r->left, r->top + y ); +- VipsPel *q = (VipsPel *) +- VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ float *p = (float *) ++ VIPS_REGION_ADDR(ir, r->left, r->top + y); ++ VipsPel *q = (VipsPel *) ++ VIPS_REGION_ADDR(or, r->left, r->top + y); + +- if( scRGB2BW->depth == 16 ) +- vips_scRGB2BW_line_16( (unsigned short *) q, p, +- in->Bands - 3, r->width ); ++ if (scRGB2BW->depth == 16) ++ vips_scRGB2BW_line_16((unsigned short *) q, p, ++ in->Bands - 3, r->width); + else +- vips_scRGB2BW_line_8( q, p, +- in->Bands - 3, r->width ); ++ vips_scRGB2BW_line_8(q, p, ++ in->Bands - 3, r->width); + } + +- VIPS_GATE_STOP( "vips_scRGB2BW_gen: work" ); ++ VIPS_GATE_STOP("vips_scRGB2BW_gen: work"); + +- return( 0 ); ++ return (0); + } + + static int +-vips_scRGB2BW_build( VipsObject *object ) ++vips_scRGB2BW_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsscRGB2BW *scRGB2BW = (VipsscRGB2BW *) object; + +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + +- VipsImage *in; ++ VipsImage *in; + VipsBandFormat format; + VipsInterpretation interpretation; +- VipsImage *out; ++ VipsImage *out; + +- if( VIPS_OBJECT_CLASS( vips_scRGB2BW_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_scRGB2BW_parent_class)->build(object)) ++ return (-1); + + in = scRGB2BW->in; +- if( vips_check_bands_atleast( class->nickname, in, 3 ) ) +- return( -1 ); ++ if (vips_check_bands_atleast(class->nickname, in, 3)) ++ return (-1); + +- switch( scRGB2BW->depth ) { ++ switch (scRGB2BW->depth) { + case 16: + interpretation = VIPS_INTERPRETATION_GREY16; + format = VIPS_FORMAT_USHORT; +@@ -186,76 +186,75 @@ vips_scRGB2BW_build( VipsObject *object ) + break; + + default: +- vips_error( class->nickname, +- "%s", _( "depth must be 8 or 16" ) ); +- return( -1 ); ++ vips_error(class->nickname, ++ "%s", _("depth must be 8 or 16")); ++ return (-1); + } + +- if( vips_cast_float( in, &t[0], NULL ) ) +- return( -1 ); ++ if (vips_cast_float(in, &t[0], NULL)) ++ return (-1); + in = t[0]; + + out = vips_image_new(); +- if( vips_image_pipelinev( out, +- VIPS_DEMAND_STYLE_THINSTRIP, in, NULL ) ) { +- g_object_unref( out ); +- return( -1 ); ++ if (vips_image_pipelinev(out, ++ VIPS_DEMAND_STYLE_THINSTRIP, in, NULL)) { ++ g_object_unref(out); ++ return (-1); + } + out->Type = interpretation; + out->BandFmt = format; + out->Bands = in->Bands - 2; + +- if( vips_image_generate( out, +- vips_start_one, vips_scRGB2BW_gen, vips_stop_one, +- in, scRGB2BW ) ) { +- g_object_unref( out ); +- return( -1 ); ++ if (vips_image_generate(out, ++ vips_start_one, vips_scRGB2BW_gen, vips_stop_one, ++ in, scRGB2BW)) { ++ g_object_unref(out); ++ return (-1); + } + +- g_object_set( object, "out", out, NULL ); ++ g_object_set(object, "out", out, NULL); + +- return( 0 ); ++ return (0); + } + + static void +-vips_scRGB2BW_class_init( VipsscRGB2BWClass *class ) ++vips_scRGB2BW_class_init(VipsscRGB2BWClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "scRGB2BW"; +- object_class->description = _( "convert scRGB to BW" ); ++ object_class->description = _("convert scRGB to BW"); + object_class->build = vips_scRGB2BW_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsscRGB2BW, in ) ); +- +- VIPS_ARG_IMAGE( class, "out", 100, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsscRGB2BW, out ) ); +- +- VIPS_ARG_INT( class, "depth", 130, +- _( "Depth" ), +- _( "Output device space depth in bits" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsscRGB2BW, depth ), +- 8, 16, 8 ); +- ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsscRGB2BW, in)); ++ ++ VIPS_ARG_IMAGE(class, "out", 100, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsscRGB2BW, out)); ++ ++ VIPS_ARG_INT(class, "depth", 130, ++ _("Depth"), ++ _("Output device space depth in bits"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsscRGB2BW, depth), ++ 8, 16, 8); + } + + static void +-vips_scRGB2BW_init( VipsscRGB2BW *scRGB2BW ) ++vips_scRGB2BW_init(VipsscRGB2BW *scRGB2BW) + { + scRGB2BW->depth = 8; + } +@@ -272,23 +271,22 @@ vips_scRGB2BW_init( VipsscRGB2BW *scRGB2BW ) + * + * Convert an scRGB image to greyscale. Set @depth to 16 to get 16-bit output. + * +- * If @depth is 16, any extra channels after RGB are +- * multiplied by 256. ++ * If @depth is 16, any extra channels after RGB are ++ * multiplied by 256. + * + * See also: vips_LabS2LabQ(), vips_sRGB2scRGB(), vips_rad2float(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_scRGB2BW( VipsImage *in, VipsImage **out, ... ) ++vips_scRGB2BW(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "scRGB2BW", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("scRGB2BW", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/colour/scRGB2XYZ.c b/libvips/colour/scRGB2XYZ.c +index 7b22043eb0..9611f2d625 100644 +--- a/libvips/colour/scRGB2XYZ.c ++++ b/libvips/colour/scRGB2XYZ.c +@@ -1,4 +1,4 @@ +-/* Turn scRGB to XYZ colourspace. ++/* Turn scRGB to XYZ colourspace. + * + * Modified: + * 29/5/02 JC +@@ -12,28 +12,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -52,17 +52,17 @@ + typedef VipsColourTransform VipsscRGB2XYZ; + typedef VipsColourTransformClass VipsscRGB2XYZClass; + +-G_DEFINE_TYPE( VipsscRGB2XYZ, vips_scRGB2XYZ, VIPS_TYPE_COLOUR_TRANSFORM ); ++G_DEFINE_TYPE(VipsscRGB2XYZ, vips_scRGB2XYZ, VIPS_TYPE_COLOUR_TRANSFORM); + + void +-vips_scRGB2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) ++vips_scRGB2XYZ_line(VipsColour *colour, VipsPel *out, VipsPel **in, int width) + { +- float * restrict p = (float *) in[0]; +- float * restrict q = (float *) out; ++ float *restrict p = (float *) in[0]; ++ float *restrict q = (float *) out; + + int i; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + float R = p[0]; + float G = p[1]; + float B = p[2]; +@@ -71,7 +71,7 @@ vips_scRGB2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + + p += 3; + +- vips_col_scRGB2XYZ( R, G, B, &X, &Y, &Z ); ++ vips_col_scRGB2XYZ(R, G, B, &X, &Y, &Z); + + q[0] = X; + q[1] = Y; +@@ -81,21 +81,21 @@ vips_scRGB2XYZ_line( VipsColour *colour, VipsPel *out, VipsPel **in, int width ) + } + + static void +-vips_scRGB2XYZ_class_init( VipsscRGB2XYZClass *class ) ++vips_scRGB2XYZ_class_init(VipsscRGB2XYZClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsColourClass *colour_class = VIPS_COLOUR_CLASS( class ); ++ VipsColourClass *colour_class = VIPS_COLOUR_CLASS(class); + + object_class->nickname = "scRGB2XYZ"; +- object_class->description = _( "transform scRGB to XYZ" ); ++ object_class->description = _("transform scRGB to XYZ"); + + colour_class->process_line = vips_scRGB2XYZ_line; + } + + static void +-vips_scRGB2XYZ_init( VipsscRGB2XYZ *scRGB2XYZ ) ++vips_scRGB2XYZ_init(VipsscRGB2XYZ *scRGB2XYZ) + { +- VipsColour *colour = VIPS_COLOUR( scRGB2XYZ ); ++ VipsColour *colour = VIPS_COLOUR(scRGB2XYZ); + + colour->interpretation = VIPS_INTERPRETATION_XYZ; + } +@@ -111,15 +111,14 @@ vips_scRGB2XYZ_init( VipsscRGB2XYZ *scRGB2XYZ ) + * Returns: 0 on success, -1 on error + */ + int +-vips_scRGB2XYZ( VipsImage *in, VipsImage **out, ... ) ++vips_scRGB2XYZ(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "scRGB2XYZ", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("scRGB2XYZ", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/colour/scRGB2sRGB.c b/libvips/colour/scRGB2sRGB.c +index df55e5de07..5b61797615 100644 +--- a/libvips/colour/scRGB2sRGB.c ++++ b/libvips/colour/scRGB2sRGB.c +@@ -31,28 +31,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -82,24 +82,24 @@ typedef struct _VipsscRGB2sRGB { + + typedef VipsOperationClass VipsscRGB2sRGBClass; + +-G_DEFINE_TYPE( VipsscRGB2sRGB, vips_scRGB2sRGB, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsscRGB2sRGB, vips_scRGB2sRGB, VIPS_TYPE_OPERATION); + + /* Process a buffer of data. + */ + static void +-vips_scRGB2sRGB_line_8( VipsPel * restrict q, float * restrict p, +- int extra_bands, int width ) ++vips_scRGB2sRGB_line_8(VipsPel *restrict q, float *restrict p, ++ int extra_bands, int width) + { + int i, j; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + float R = p[0]; + float G = p[1]; + float B = p[2]; + + int r, g, b; + +- vips_col_scRGB2sRGB_8( R, G, B, &r, &g, &b, NULL ); ++ vips_col_scRGB2sRGB_8(R, G, B, &r, &g, &b, NULL); + + p += 3; + +@@ -109,27 +109,27 @@ vips_scRGB2sRGB_line_8( VipsPel * restrict q, float * restrict p, + + q += 3; + +- for( j = 0; j < extra_bands; j++ ) +- q[j] = VIPS_CLIP( 0, p[j], UCHAR_MAX ); ++ for (j = 0; j < extra_bands; j++) ++ q[j] = VIPS_CLIP(0, p[j], UCHAR_MAX); + p += extra_bands; + q += extra_bands; + } + } + + static void +-vips_scRGB2sRGB_line_16( unsigned short * restrict q, float * restrict p, +- int extra_bands, int width ) ++vips_scRGB2sRGB_line_16(unsigned short *restrict q, float *restrict p, ++ int extra_bands, int width) + { + int i, j; + +- for( i = 0; i < width; i++ ) { ++ for (i = 0; i < width; i++) { + float R = p[0]; + float G = p[1]; + float B = p[2]; + + int r, g, b; + +- vips_col_scRGB2sRGB_16( R, G, B, &r, &g, &b, NULL ); ++ vips_col_scRGB2sRGB_16(R, G, B, &r, &g, &b, NULL); + + p += 3; + +@@ -139,69 +139,69 @@ vips_scRGB2sRGB_line_16( unsigned short * restrict q, float * restrict p, + + q += 3; + +- for( j = 0; j < extra_bands; j++ ) +- q[j] = VIPS_CLIP( 0, (int) (p[j] * 256.0), USHRT_MAX ); ++ for (j = 0; j < extra_bands; j++) ++ q[j] = VIPS_CLIP(0, (int) (p[j] * 256.0), USHRT_MAX); + p += extra_bands; + q += extra_bands; + } + } + + static int +-vips_scRGB2sRGB_gen( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_scRGB2sRGB_gen(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + VipsscRGB2sRGB *scRGB2sRGB = (VipsscRGB2sRGB *) b; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsImage *in = ir->im; + + int y; + +- if( vips_region_prepare( ir, r ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, r)) ++ return (-1); + +- VIPS_GATE_START( "vips_scRGB2sRGB_gen: work" ); ++ VIPS_GATE_START("vips_scRGB2sRGB_gen: work"); + +- for( y = 0; y < r->height; y++ ) { +- float *p = (float *) +- VIPS_REGION_ADDR( ir, r->left, r->top + y ); +- VipsPel *q = (VipsPel *) +- VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ float *p = (float *) ++ VIPS_REGION_ADDR(ir, r->left, r->top + y); ++ VipsPel *q = (VipsPel *) ++ VIPS_REGION_ADDR(or, r->left, r->top + y); + +- if( scRGB2sRGB->depth == 16 ) +- vips_scRGB2sRGB_line_16( (unsigned short *) q, p, +- in->Bands - 3, r->width ); ++ if (scRGB2sRGB->depth == 16) ++ vips_scRGB2sRGB_line_16((unsigned short *) q, p, ++ in->Bands - 3, r->width); + else +- vips_scRGB2sRGB_line_8( q, p, +- in->Bands - 3, r->width ); ++ vips_scRGB2sRGB_line_8(q, p, ++ in->Bands - 3, r->width); + } + +- VIPS_GATE_STOP( "vips_scRGB2sRGB_gen: work" ); ++ VIPS_GATE_STOP("vips_scRGB2sRGB_gen: work"); + +- return( 0 ); ++ return (0); + } + + static int +-vips_scRGB2sRGB_build( VipsObject *object ) ++vips_scRGB2sRGB_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsscRGB2sRGB *scRGB2sRGB = (VipsscRGB2sRGB *) object; + +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + +- VipsImage *in; ++ VipsImage *in; + VipsBandFormat format; + VipsInterpretation interpretation; +- VipsImage *out; ++ VipsImage *out; + +- if( VIPS_OBJECT_CLASS( vips_scRGB2sRGB_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_scRGB2sRGB_parent_class)->build(object)) ++ return (-1); + + in = scRGB2sRGB->in; +- if( vips_check_bands_atleast( class->nickname, in, 3 ) ) +- return( -1 ); ++ if (vips_check_bands_atleast(class->nickname, in, 3)) ++ return (-1); + +- switch( scRGB2sRGB->depth ) { ++ switch (scRGB2sRGB->depth) { + case 16: + interpretation = VIPS_INTERPRETATION_RGB16; + format = VIPS_FORMAT_USHORT; +@@ -213,75 +213,74 @@ vips_scRGB2sRGB_build( VipsObject *object ) + break; + + default: +- vips_error( class->nickname, +- "%s", _( "depth must be 8 or 16" ) ); +- return( -1 ); ++ vips_error(class->nickname, ++ "%s", _("depth must be 8 or 16")); ++ return (-1); + } + +- if( vips_cast_float( in, &t[0], NULL ) ) +- return( -1 ); ++ if (vips_cast_float(in, &t[0], NULL)) ++ return (-1); + in = t[0]; + + out = vips_image_new(); +- if( vips_image_pipelinev( out, +- VIPS_DEMAND_STYLE_THINSTRIP, in, NULL ) ) { +- g_object_unref( out ); +- return( -1 ); ++ if (vips_image_pipelinev(out, ++ VIPS_DEMAND_STYLE_THINSTRIP, in, NULL)) { ++ g_object_unref(out); ++ return (-1); + } + out->Type = interpretation; + out->BandFmt = format; + +- if( vips_image_generate( out, +- vips_start_one, vips_scRGB2sRGB_gen, vips_stop_one, +- in, scRGB2sRGB ) ) { +- g_object_unref( out ); +- return( -1 ); ++ if (vips_image_generate(out, ++ vips_start_one, vips_scRGB2sRGB_gen, vips_stop_one, ++ in, scRGB2sRGB)) { ++ g_object_unref(out); ++ return (-1); + } + +- g_object_set( object, "out", out, NULL ); ++ g_object_set(object, "out", out, NULL); + +- return( 0 ); ++ return (0); + } + + static void +-vips_scRGB2sRGB_class_init( VipsscRGB2sRGBClass *class ) ++vips_scRGB2sRGB_class_init(VipsscRGB2sRGBClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "scRGB2sRGB"; +- object_class->description = _( "convert an scRGB image to sRGB" ); ++ object_class->description = _("convert an scRGB image to sRGB"); + object_class->build = vips_scRGB2sRGB_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsscRGB2sRGB, in ) ); +- +- VIPS_ARG_IMAGE( class, "out", 100, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsscRGB2sRGB, out ) ); +- +- VIPS_ARG_INT( class, "depth", 130, +- _( "Depth" ), +- _( "Output device space depth in bits" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsscRGB2sRGB, depth ), +- 8, 16, 8 ); +- ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsscRGB2sRGB, in)); ++ ++ VIPS_ARG_IMAGE(class, "out", 100, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsscRGB2sRGB, out)); ++ ++ VIPS_ARG_INT(class, "depth", 130, ++ _("Depth"), ++ _("Output device space depth in bits"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsscRGB2sRGB, depth), ++ 8, 16, 8); + } + + static void +-vips_scRGB2sRGB_init( VipsscRGB2sRGB *scRGB2sRGB ) ++vips_scRGB2sRGB_init(VipsscRGB2sRGB *scRGB2sRGB) + { + scRGB2sRGB->depth = 8; + } +@@ -298,23 +297,22 @@ vips_scRGB2sRGB_init( VipsscRGB2sRGB *scRGB2sRGB ) + * + * Convert an scRGB image to sRGB. Set @depth to 16 to get 16-bit output. + * +- * If @depth is 16, any extra channels after RGB are +- * multiplied by 256. ++ * If @depth is 16, any extra channels after RGB are ++ * multiplied by 256. + * + * See also: vips_LabS2LabQ(), vips_sRGB2scRGB(), vips_rad2float(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_scRGB2sRGB( VipsImage *in, VipsImage **out, ... ) ++vips_scRGB2sRGB(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "scRGB2sRGB", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("scRGB2sRGB", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/conversion/arrayjoin.c b/libvips/conversion/arrayjoin.c +index f76cf9ce44..5cf4eab565 100644 +--- a/libvips/conversion/arrayjoin.c ++++ b/libvips/conversion/arrayjoin.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -74,52 +74,52 @@ typedef struct _VipsArrayjoin { + + typedef VipsConversionClass VipsArrayjoinClass; + +-G_DEFINE_TYPE( VipsArrayjoin, vips_arrayjoin, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsArrayjoin, vips_arrayjoin, VIPS_TYPE_CONVERSION); + + static int +-vips_arrayjoin_gen( VipsRegion *or, void *seq, +- void *a, void *b, gboolean *stop ) ++vips_arrayjoin_gen(VipsRegion * or, void *seq, ++ void *a, void *b, gboolean *stop) + { + VipsRegion **ir = (VipsRegion **) seq; + VipsArrayjoin *join = (VipsArrayjoin *) b; +- VipsConversion *conversion = VIPS_CONVERSION( join ); +- VipsRect *r = &or->valid; ++ VipsConversion *conversion = VIPS_CONVERSION(join); ++ VipsRect *r = & or->valid; + + int n; + VipsImage **in; + int i; + gboolean just_one; + +- in = vips_array_image_get( join->in, &n ); ++ in = vips_array_image_get(join->in, &n); + +- /* Does this rect fit completely within one of our inputs? ++ /* Does this rect fit completely within one of our inputs? + */ + just_one = FALSE; +- for( i = 0; i < n; i++ ) +- if( vips_rect_includesrect( &join->rects[i], r ) ) { ++ for (i = 0; i < n; i++) ++ if (vips_rect_includesrect(&join->rects[i], r)) { + just_one = TRUE; + break; + } + +- if( just_one ) { ++ if (just_one) { + /* Just needs one input, we can forward the request to that + * region. + */ +- if( vips__insert_just_one( or, ir[i], +- join->rects[i].left, join->rects[i].top ) ) +- return( -1 ); ++ if (vips__insert_just_one(or, ir[i], ++ join->rects[i].left, join->rects[i].top)) ++ return (-1); + } + else { +- /* Output requires more than one input. Paste all touching ++ /* Output requires more than one input. Paste all touching + * inputs into the output. + */ +- for( i = 0; i < n; i++ ) +- if( vips__insert_paste_region( or, ir[i], +- &join->rects[i] ) ) +- return( -1 ); ++ for (i = 0; i < n; i++) ++ if (vips__insert_paste_region(or, ir[i], ++ &join->rects[i])) ++ return (-1); + } + +- if( vips_image_is_sequential( conversion->out ) ) ++ if (vips_image_is_sequential(conversion->out)) + /* In sequential mode, we can minimise an input once our + * generate point is well past the end of it. This can save a + * lot of memory and file descriptors on large image arrays. +@@ -129,24 +129,24 @@ vips_arrayjoin_gen( VipsRegion *or, void *seq, + * + * We don't lock for minimised[], but it's harmless. + */ +- for( i = 0; i < n; i++ ) { +- int bottom_edge = VIPS_RECT_BOTTOM( &join->rects[i] ); ++ for (i = 0; i < n; i++) { ++ int bottom_edge = VIPS_RECT_BOTTOM(&join->rects[i]); + +- if( !join->minimised[i] && +- r->top > bottom_edge + 1024 ) { ++ if (!join->minimised[i] && ++ r->top > bottom_edge + 1024) { + join->minimised[i] = TRUE; +- vips_image_minimise_all( in[i] ); ++ vips_image_minimise_all(in[i]); + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_arrayjoin_build( VipsObject *object ) ++vips_arrayjoin_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsArrayjoin *join = (VipsArrayjoin *) object; + + VipsImage **in; +@@ -162,68 +162,68 @@ vips_arrayjoin_build( VipsObject *object ) + int output_height; + int i; + +- if( VIPS_OBJECT_CLASS( vips_arrayjoin_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_arrayjoin_parent_class)->build(object)) ++ return (-1); + +- in = vips_array_image_get( join->in, &n ); ++ in = vips_array_image_get(join->in, &n); + /* Array length zero means error. + */ +- if( n == 0 ) +- return( -1 ); ++ if (n == 0) ++ return (-1); + + /* Move all input images to a common format and number of bands. + */ +- format = (VipsImage **) vips_object_local_array( object, n ); +- if( vips__formatalike_vec( in, format, n ) ) +- return( -1 ); ++ format = (VipsImage **) vips_object_local_array(object, n); ++ if (vips__formatalike_vec(in, format, n)) ++ return (-1); + in = format; + + /* We have to include the number of bands in @background in our + * calculation. + */ +- band = (VipsImage **) vips_object_local_array( object, n ); +- if( vips__bandalike_vec( class->nickname, +- in, band, n, join->background->n ) ) +- return( -1 ); ++ band = (VipsImage **) vips_object_local_array(object, n); ++ if (vips__bandalike_vec(class->nickname, ++ in, band, n, join->background->n)) ++ return (-1); + in = band; + + /* Now sizealike: search for the largest image. + */ + hspacing = in[0]->Xsize; + vspacing = in[0]->Ysize; +- for( i = 1; i < n; i++ ) { +- if( in[i]->Xsize > hspacing ) ++ for (i = 1; i < n; i++) { ++ if (in[i]->Xsize > hspacing) + hspacing = in[i]->Xsize; +- if( in[i]->Ysize > vspacing ) ++ if (in[i]->Ysize > vspacing) + vspacing = in[i]->Ysize; + } + +- if( !vips_object_argument_isset( object, "hspacing" ) ) ++ if (!vips_object_argument_isset(object, "hspacing")) + join->hspacing = hspacing; +- if( !vips_object_argument_isset( object, "vspacing" ) ) ++ if (!vips_object_argument_isset(object, "vspacing")) + join->vspacing = vspacing; + + hspacing = join->hspacing; + vspacing = join->vspacing; + +- if( !vips_object_argument_isset( object, "across" ) ) ++ if (!vips_object_argument_isset(object, "across")) + join->across = n; + + /* How many images down the grid? + */ +- join->down = VIPS_ROUND_UP( n, join->across ) / join->across; ++ join->down = VIPS_ROUND_UP(n, join->across) / join->across; + + /* The output size. + */ +- output_width = hspacing * join->across + ++ output_width = hspacing * join->across + + join->shim * (join->across - 1); +- output_height = vspacing * join->down + ++ output_height = vspacing * join->down + + join->shim * (join->down - 1); + + /* Make a rect for the position of each input. + */ +- join->rects = VIPS_ARRAY( join, n, VipsRect ); +- for( i = 0; i < n; i++ ) { ++ join->rects = VIPS_ARRAY(join, n, VipsRect); ++ for (i = 0; i < n; i++) { + int x = i % join->across; + int y = i / join->across; + +@@ -235,39 +235,39 @@ vips_arrayjoin_build( VipsObject *object ) + /* In the centre of the array, we make width / height larger + * by shim. + */ +- if( x != join->across - 1 ) ++ if (x != join->across - 1) + join->rects[i].width += join->shim; +- if( y != join->down - 1 ) ++ if (y != join->down - 1) + join->rects[i].height += join->shim; + + /* The right edge of the final image is stretched to the right + * to fill the whole row. + */ +- if( i == n - 1 ) +- join->rects[i].width = ++ if (i == n - 1) ++ join->rects[i].width = + output_width - join->rects[i].left; + } + + /* A thing to track which inputs we've signalled minimise on. + */ +- join->minimised = VIPS_ARRAY( join, n, gboolean ); +- for( i = 0; i < n; i++ ) ++ join->minimised = VIPS_ARRAY(join, n, gboolean); ++ for (i = 0; i < n; i++) + join->minimised[i] = FALSE; + + /* Each image must be cropped and aligned within an @hspacing by + * @vspacing box. + */ +- size = (VipsImage **) vips_object_local_array( object, n ); +- for( i = 0; i < n; i++ ) { ++ size = (VipsImage **) vips_object_local_array(object, n); ++ for (i = 0; i < n; i++) { + int left, top; + int width, height; + +- /* Compiler warnings. ++ /* Compiler warnings. + */ + left = 0; + top = 0; + +- switch( join->halign ) { ++ switch (join->halign) { + case VIPS_ALIGN_LOW: + left = 0; + break; +@@ -285,7 +285,7 @@ vips_arrayjoin_build( VipsObject *object ) + break; + } + +- switch( join->valign ) { ++ switch (join->valign) { + case VIPS_ALIGN_LOW: + top = 0; + break; +@@ -306,125 +306,124 @@ vips_arrayjoin_build( VipsObject *object ) + width = join->rects[i].width; + height = join->rects[i].height; + +- if( vips_embed( in[i], &size[i], left, top, width, height, +- "extend", VIPS_EXTEND_BACKGROUND, +- "background", join->background, +- NULL ) ) +- return( -1 ); ++ if (vips_embed(in[i], &size[i], left, top, width, height, ++ "extend", VIPS_EXTEND_BACKGROUND, ++ "background", join->background, ++ NULL)) ++ return (-1); + } + +- if( vips_image_pipeline_array( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, size ) ) +- return( -1 ); ++ if (vips_image_pipeline_array(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, size)) ++ return (-1); + + conversion->out->Xsize = output_width; + conversion->out->Ysize = output_height; + +- if( vips_image_generate( conversion->out, +- vips_start_many, vips_arrayjoin_gen, vips_stop_many, +- size, join ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_many, vips_arrayjoin_gen, vips_stop_many, ++ size, join)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_arrayjoin_class_init( VipsArrayjoinClass *class ) ++vips_arrayjoin_class_init(VipsArrayjoinClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_arrayjoin_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_arrayjoin_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "arrayjoin"; +- vobject_class->description = _( "join an array of images" ); ++ vobject_class->description = _("join an array of images"); + vobject_class->build = vips_arrayjoin_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_BOXED( class, "in", -1, +- _( "Input" ), +- _( "Array of input images" ), ++ VIPS_ARG_BOXED(class, "in", -1, ++ _("Input"), ++ _("Array of input images"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsArrayjoin, in ), +- VIPS_TYPE_ARRAY_IMAGE ); ++ G_STRUCT_OFFSET(VipsArrayjoin, in), ++ VIPS_TYPE_ARRAY_IMAGE); + +- VIPS_ARG_INT( class, "across", 4, +- _( "Across" ), +- _( "Number of images across grid" ), ++ VIPS_ARG_INT(class, "across", 4, ++ _("Across"), ++ _("Number of images across grid"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsArrayjoin, across ), +- 1, 1000000, 1 ); ++ G_STRUCT_OFFSET(VipsArrayjoin, across), ++ 1, 1000000, 1); + +- VIPS_ARG_INT( class, "shim", 5, +- _( "Shim" ), +- _( "Pixels between images" ), ++ VIPS_ARG_INT(class, "shim", 5, ++ _("Shim"), ++ _("Pixels between images"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsArrayjoin, shim ), +- 0, 1000000, 0 ); ++ G_STRUCT_OFFSET(VipsArrayjoin, shim), ++ 0, 1000000, 0); + +- VIPS_ARG_BOXED( class, "background", 6, +- _( "Background" ), +- _( "Colour for new pixels" ), ++ VIPS_ARG_BOXED(class, "background", 6, ++ _("Background"), ++ _("Colour for new pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsArrayjoin, background ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsArrayjoin, background), ++ VIPS_TYPE_ARRAY_DOUBLE); + +- VIPS_ARG_ENUM( class, "halign", 7, +- _( "Horizontal align" ), +- _( "Align on the left, centre or right" ), ++ VIPS_ARG_ENUM(class, "halign", 7, ++ _("Horizontal align"), ++ _("Align on the left, centre or right"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsArrayjoin, halign ), +- VIPS_TYPE_ALIGN, VIPS_ALIGN_LOW ); ++ G_STRUCT_OFFSET(VipsArrayjoin, halign), ++ VIPS_TYPE_ALIGN, VIPS_ALIGN_LOW); + +- VIPS_ARG_ENUM( class, "valign", 8, +- _( "Vertical align" ), +- _( "Align on the top, centre or bottom" ), ++ VIPS_ARG_ENUM(class, "valign", 8, ++ _("Vertical align"), ++ _("Align on the top, centre or bottom"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsArrayjoin, valign ), +- VIPS_TYPE_ALIGN, VIPS_ALIGN_LOW ); ++ G_STRUCT_OFFSET(VipsArrayjoin, valign), ++ VIPS_TYPE_ALIGN, VIPS_ALIGN_LOW); + +- VIPS_ARG_INT( class, "hspacing", 9, +- _( "Horizontal spacing" ), +- _( "Horizontal spacing between images" ), ++ VIPS_ARG_INT(class, "hspacing", 9, ++ _("Horizontal spacing"), ++ _("Horizontal spacing between images"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsArrayjoin, hspacing ), +- 1, 1000000, 1 ); ++ G_STRUCT_OFFSET(VipsArrayjoin, hspacing), ++ 1, 1000000, 1); + +- VIPS_ARG_INT( class, "vspacing", 10, +- _( "Vertical spacing" ), +- _( "Vertical spacing between images" ), ++ VIPS_ARG_INT(class, "vspacing", 10, ++ _("Vertical spacing"), ++ _("Vertical spacing between images"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsArrayjoin, vspacing ), +- 1, 1000000, 1 ); +- ++ G_STRUCT_OFFSET(VipsArrayjoin, vspacing), ++ 1, 1000000, 1); + } + + static void +-vips_arrayjoin_init( VipsArrayjoin *join ) ++vips_arrayjoin_init(VipsArrayjoin *join) + { + /* Init our instance fields. + */ +- join->background = +- vips_area_new_array( G_TYPE_DOUBLE, sizeof( double ), 1 ); ++ join->background = ++ vips_area_new_array(G_TYPE_DOUBLE, sizeof(double), 1); + ((double *) (join->background->data))[0] = 0.0; + } + + static int +-vips_arrayjoinv( VipsImage **in, VipsImage **out, int n, va_list ap ) ++vips_arrayjoinv(VipsImage **in, VipsImage **out, int n, va_list ap) + { +- VipsArrayImage *array; ++ VipsArrayImage *array; + int result; + +- array = vips_array_image_new( in, n ); +- result = vips_call_split( "arrayjoin", ap, array, out ); +- vips_area_unref( VIPS_AREA( array ) ); ++ array = vips_array_image_new(in, n); ++ result = vips_call_split("arrayjoin", ap, array, out); ++ vips_area_unref(VIPS_AREA(array)); + +- return( result ); ++ return (result); + } + + /** +@@ -449,25 +448,25 @@ vips_arrayjoinv( VipsImage **in, VipsImage **out, int n, va_list ap ) + * left-to-right and top-to-bottom. @across defaults to @n. + * + * Each input image is placed with a box of size @hspacing by @vspacing +- * pixels and cropped. These default to the largest width and largest height +- * of the input images. ++ * pixels and cropped. These default to the largest width and largest height ++ * of the input images. + * + * Space between images is filled with @background. This defaults to 0 + * (black). + * +- * Images are positioned within their @hspacing by @vspacing box at low, ++ * Images are positioned within their @hspacing by @vspacing box at low, + * centre or high coordinate values, controlled by @halign and @valign. These +- * default to left-top. ++ * default to left-top. + * + * Boxes are joined and separated by @shim pixels. This defaults to 0. + * +- * If the number of bands in the input images differs, all but one of the +- * images must have one band. In this case, an n-band image is formed from the ++ * If the number of bands in the input images differs, all but one of the ++ * images must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the n-band images are operated upon. + * +- * The input images are cast up to the smallest common type (see table +- * Smallest common format in ++ * The input images are cast up to the smallest common type (see table ++ * Smallest common format in + * arithmetic). + * + * vips_colourspace() can be useful for moving the images to a common +@@ -478,14 +477,14 @@ vips_arrayjoinv( VipsImage **in, VipsImage **out, int n, va_list ap ) + * Returns: 0 on success, -1 on error + */ + int +-vips_arrayjoin( VipsImage **in, VipsImage **out, int n, ... ) ++vips_arrayjoin(VipsImage **in, VipsImage **out, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_arrayjoinv( in, out, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_arrayjoinv(in, out, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/autorot.c b/libvips/conversion/autorot.c +index f52913a742..59202cf60d 100644 +--- a/libvips/conversion/autorot.c ++++ b/libvips/conversion/autorot.c +@@ -16,28 +16,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -68,21 +68,21 @@ typedef struct _VipsAutorot { + + typedef VipsConversionClass VipsAutorotClass; + +-G_DEFINE_TYPE( VipsAutorot, vips_autorot, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsAutorot, vips_autorot, VIPS_TYPE_CONVERSION); + + static void * +-vips_autorot_remove_angle_sub( VipsImage *image, +- const char *field, GValue *value, void *my_data ) ++vips_autorot_remove_angle_sub(VipsImage *image, ++ const char *field, GValue *value, void *my_data) + { +- if( strcmp( field, "exif-ifd0-Orientation" ) == 0 ) { ++ if (strcmp(field, "exif-ifd0-Orientation") == 0) { + #ifdef DEBUG +- printf( "vips_autorot_remove_angle: %s\n", field ); ++ printf("vips_autorot_remove_angle: %s\n", field); + #endif /*DEBUG*/ + +- (void) vips_image_remove( image, field ); ++ (void) vips_image_remove(image, field); + } + +- return( NULL ); ++ return (NULL); + } + + /** +@@ -94,29 +94,29 @@ vips_autorot_remove_angle_sub( VipsImage *image, + * modifies metadata. + */ + void +-vips_autorot_remove_angle( VipsImage *image ) ++vips_autorot_remove_angle(VipsImage *image) + { +- (void) vips_image_remove( image, VIPS_META_ORIENTATION ); +- (void) vips_image_map( image, vips_autorot_remove_angle_sub, NULL ); ++ (void) vips_image_remove(image, VIPS_META_ORIENTATION); ++ (void) vips_image_map(image, vips_autorot_remove_angle_sub, NULL); + } + + static int +-vips_autorot_build( VipsObject *object ) ++vips_autorot_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsAutorot *autorot = (VipsAutorot *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 3 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 3); ++ ++ if (VIPS_OBJECT_CLASS(vips_autorot_parent_class)->build(object)) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_autorot_parent_class )->build( object ) ) +- return( -1 ); +- + VipsAngle angle; + gboolean flip; + VipsImage *in; + + in = autorot->in; + +- switch( vips_image_get_orientation( in ) ) { ++ switch (vips_image_get_orientation(in)) { + case 2: + angle = VIPS_ANGLE_D0; + flip = TRUE; +@@ -157,76 +157,75 @@ vips_autorot_build( VipsObject *object ) + angle = VIPS_ANGLE_D0; + flip = FALSE; + break; +- + } + +- g_object_set( object, ++ g_object_set(object, + "angle", angle, + "flip", flip, +- NULL ); ++ NULL); + +- if( angle != VIPS_ANGLE_D0 ) { +- if( vips_rot( in, &t[0], angle, NULL ) ) +- return( -1 ); ++ if (angle != VIPS_ANGLE_D0) { ++ if (vips_rot(in, &t[0], angle, NULL)) ++ return (-1); + in = t[0]; + } + +- if( flip ) { +- if( vips_flip( in, &t[1], VIPS_DIRECTION_HORIZONTAL, NULL ) ) +- return( -1 ); ++ if (flip) { ++ if (vips_flip(in, &t[1], VIPS_DIRECTION_HORIZONTAL, NULL)) ++ return (-1); + in = t[1]; + } + + /* We must copy before modifying metadata. + */ +- if( vips_copy( in, &t[2], NULL ) ) +- return( -1 ); ++ if (vips_copy(in, &t[2], NULL)) ++ return (-1); + in = t[2]; + +- vips_autorot_remove_angle( in ); ++ vips_autorot_remove_angle(in); + +- if( vips_image_write( in, conversion->out ) ) +- return( -1 ); ++ if (vips_image_write(in, conversion->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_autorot_class_init( VipsAutorotClass *class ) ++vips_autorot_class_init(VipsAutorotClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "autorot"; +- vobject_class->description = _( "autorotate image by exif tag" ); ++ vobject_class->description = _("autorotate image by exif tag"); + vobject_class->build = vips_autorot_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsAutorot, in ) ); ++ G_STRUCT_OFFSET(VipsAutorot, in)); + +- VIPS_ARG_ENUM( class, "angle", 6, +- _( "Angle" ), +- _( "Angle image was rotated by" ), ++ VIPS_ARG_ENUM(class, "angle", 6, ++ _("Angle"), ++ _("Angle image was rotated by"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsAutorot, angle ), +- VIPS_TYPE_ANGLE, VIPS_ANGLE_D0 ); ++ G_STRUCT_OFFSET(VipsAutorot, angle), ++ VIPS_TYPE_ANGLE, VIPS_ANGLE_D0); + +- VIPS_ARG_BOOL( class, "flip", 7, +- _( "Flip" ), +- _( "Whether the image was flipped or not" ), ++ VIPS_ARG_BOOL(class, "flip", 7, ++ _("Flip"), ++ _("Whether the image was flipped or not"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsAutorot, flip ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsAutorot, flip), ++ FALSE); + } + + static void +-vips_autorot_init( VipsAutorot *autorot ) ++vips_autorot_init(VipsAutorot *autorot) + { + autorot->angle = VIPS_ANGLE_D0; + autorot->flip = FALSE; +@@ -241,26 +240,26 @@ vips_autorot_init( VipsAutorot *autorot ) + * Optional arguments: + * + * * @angle: output #VipsAngle the image was rotated by +- * * @flip: output %gboolean whether the image was flipped ++ * * @flip: output %gboolean whether the image was flipped + * +- * Look at the image metadata and rotate and flip the image to make it +- * upright. The #VIPS_META_ORIENTATION tag is removed from @out to prevent +- * accidental double rotation. ++ * Look at the image metadata and rotate and flip the image to make it ++ * upright. The #VIPS_META_ORIENTATION tag is removed from @out to prevent ++ * accidental double rotation. + * +- * Read @angle to find the amount the image was rotated by. Read @flip to ++ * Read @angle to find the amount the image was rotated by. Read @flip to + * see if the image was also flipped. + * + * Returns: 0 on success, -1 on error + */ + int +-vips_autorot( VipsImage *in, VipsImage **out, ... ) ++vips_autorot(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "autorot", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("autorot", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/bandary.c b/libvips/conversion/bandary.c +index b7e81e4d20..acb6dffb93 100644 +--- a/libvips/conversion/bandary.c ++++ b/libvips/conversion/bandary.c +@@ -4,7 +4,7 @@ + * + * Author: N. Dessipris + * Written on: 17/04/1991 +- * Modified on : ++ * Modified on : + * 16/3/94 JC + * - rewritten for partials + * - now in ANSI C +@@ -32,28 +32,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -77,31 +77,31 @@ + + #include "bandary.h" + +-G_DEFINE_ABSTRACT_TYPE( VipsBandary, vips_bandary, VIPS_TYPE_CONVERSION ); ++G_DEFINE_ABSTRACT_TYPE(VipsBandary, vips_bandary, VIPS_TYPE_CONVERSION); + + static int +-vips_bandary_stop( void *vseq, void *a, void *b ) ++vips_bandary_stop(void *vseq, void *a, void *b) + { + VipsBandarySequence *seq = (VipsBandarySequence *) vseq; + +- if( seq->ir ) { ++ if (seq->ir) { + int i; + +- for( i = 0; seq->ir[i]; i++ ) +- VIPS_UNREF( seq->ir[i] ); +- VIPS_FREE( seq->ir ); ++ for (i = 0; seq->ir[i]; i++) ++ VIPS_UNREF(seq->ir[i]); ++ VIPS_FREE(seq->ir); + } + +- VIPS_FREE( seq->p ); +- VIPS_FREE( seq->pixels ); ++ VIPS_FREE(seq->p); ++ VIPS_FREE(seq->pixels); + +- VIPS_FREE( seq ); ++ VIPS_FREE(seq); + +- return( 0 ); ++ return (0); + } + + static void * +-vips_bandary_start( VipsImage *out, void *a, void *b ) ++vips_bandary_start(VipsImage *out, void *a, void *b) + { + VipsImage **in = (VipsImage **) a; + VipsBandary *bandary = (VipsBandary *) b; +@@ -109,8 +109,8 @@ vips_bandary_start( VipsImage *out, void *a, void *b ) + VipsBandarySequence *seq; + int i, n; + +- if( !(seq = VIPS_NEW( NULL, VipsBandarySequence )) ) +- return( NULL ); ++ if (!(seq = VIPS_NEW(NULL, VipsBandarySequence))) ++ return (NULL); + + seq->bandary = bandary; + seq->ir = NULL; +@@ -119,148 +119,148 @@ vips_bandary_start( VipsImage *out, void *a, void *b ) + + /* How many images? + */ +- for( n = 0; in[n]; n++ ) ++ for (n = 0; in[n]; n++) + ; + + /* Alocate space for region array. + */ +- if( !(seq->ir = VIPS_ARRAY( NULL, n + 1, VipsRegion * )) ) { +- vips_bandary_stop( seq, NULL, NULL ); +- return( NULL ); ++ if (!(seq->ir = VIPS_ARRAY(NULL, n + 1, VipsRegion *))) { ++ vips_bandary_stop(seq, NULL, NULL); ++ return (NULL); + } + + /* Create a set of regions. + */ +- for( i = 0; i < n; i++ ) +- if( !(seq->ir[i] = vips_region_new( in[i] )) ) { +- vips_bandary_stop( seq, NULL, NULL ); +- return( NULL ); ++ for (i = 0; i < n; i++) ++ if (!(seq->ir[i] = vips_region_new(in[i]))) { ++ vips_bandary_stop(seq, NULL, NULL); ++ return (NULL); + } + seq->ir[n] = NULL; + + /* Input pointers. + */ +- if( !(seq->p = VIPS_ARRAY( NULL, n + 1, VipsPel * )) ) { +- vips_bandary_stop( seq, NULL, NULL ); +- return( NULL ); ++ if (!(seq->p = VIPS_ARRAY(NULL, n + 1, VipsPel *))) { ++ vips_bandary_stop(seq, NULL, NULL); ++ return (NULL); + } + + /* Pixel buffer. This is used as working space by some subclasses. + */ +- if( !(seq->pixels = VIPS_ARRAY( NULL, +- n * VIPS_IMAGE_SIZEOF_PEL( bandary->ready[0] ), VipsPel )) ) { +- vips_bandary_stop( seq, NULL, NULL ); +- return( NULL ); ++ if (!(seq->pixels = VIPS_ARRAY(NULL, ++ n * VIPS_IMAGE_SIZEOF_PEL(bandary->ready[0]), VipsPel))) { ++ vips_bandary_stop(seq, NULL, NULL); ++ return (NULL); + } + +- return( seq ); ++ return (seq); + } + + static int +-vips_bandary_gen( VipsRegion *or, void *vseq, void *a, void *b, gboolean *stop ) ++vips_bandary_gen(VipsRegion * or, void *vseq, void *a, void *b, gboolean *stop) + { + VipsBandarySequence *seq = (VipsBandarySequence *) vseq; + VipsBandary *bandary = (VipsBandary *) b; +- VipsBandaryClass *class = VIPS_BANDARY_GET_CLASS( bandary ); +- VipsRect *r = &or->valid; ++ VipsBandaryClass *class = VIPS_BANDARY_GET_CLASS(bandary); ++ VipsRect *r = & or->valid; + + VipsPel *q; + int y, i; + +- if( vips_reorder_prepare_many( or->im, seq->ir, r ) ) +- return( -1 ); +- for( i = 0; i < bandary->n; i++ ) +- seq->p[i] = VIPS_REGION_ADDR( seq->ir[i], r->left, r->top ); ++ if (vips_reorder_prepare_many(or->im, seq->ir, r)) ++ return (-1); ++ for (i = 0; i < bandary->n; i++) ++ seq->p[i] = VIPS_REGION_ADDR(seq->ir[i], r->left, r->top); + seq->p[i] = NULL; +- q = VIPS_REGION_ADDR( or, r->left, r->top ); ++ q = VIPS_REGION_ADDR(or, r->left, r->top); + +- VIPS_GATE_START( "vips_bandary_gen: work" ); ++ VIPS_GATE_START("vips_bandary_gen: work"); + +- for( y = 0; y < r->height; y++ ) { +- class->process_line( seq, q, seq->p, r->width ); ++ for (y = 0; y < r->height; y++) { ++ class->process_line(seq, q, seq->p, r->width); + +- for( i = 0; i < bandary->n; i++ ) +- seq->p[i] += VIPS_REGION_LSKIP( seq->ir[i] ); +- q += VIPS_REGION_LSKIP( or ); ++ for (i = 0; i < bandary->n; i++) ++ seq->p[i] += VIPS_REGION_LSKIP(seq->ir[i]); ++ q += VIPS_REGION_LSKIP(or); + } + +- VIPS_GATE_STOP( "vips_bandary_gen: work" ); ++ VIPS_GATE_STOP("vips_bandary_gen: work"); + +- return( 0 ); ++ return (0); + } + + static int +-vips_bandary_build( VipsObject *object ) ++vips_bandary_build(VipsObject *object) + { +- VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( object ); +- VipsBandaryClass *class = VIPS_BANDARY_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); +- VipsBandary *bandary = VIPS_BANDARY( object ); ++ VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS(object); ++ VipsBandaryClass *class = VIPS_BANDARY_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); ++ VipsBandary *bandary = VIPS_BANDARY(object); + + int i; + VipsImage **decode; + VipsImage **format; + VipsImage **size; + +- if( VIPS_OBJECT_CLASS( vips_bandary_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_bandary_parent_class)->build(object)) ++ return (-1); + +- if( bandary->n <= 0 ) { +- vips_error( object_class->nickname, +- "%s", _( "no input images" ) ); +- return( -1 ); ++ if (bandary->n <= 0) { ++ vips_error(object_class->nickname, ++ "%s", _("no input images")); ++ return (-1); + } + +- decode = (VipsImage **) vips_object_local_array( object, bandary->n ); +- format = (VipsImage **) vips_object_local_array( object, bandary->n ); +- size = (VipsImage **) vips_object_local_array( object, bandary->n ); ++ decode = (VipsImage **) vips_object_local_array(object, bandary->n); ++ format = (VipsImage **) vips_object_local_array(object, bandary->n); ++ size = (VipsImage **) vips_object_local_array(object, bandary->n); + +- for( i = 0; i < bandary->n; i++ ) +- if( vips_image_decode( bandary->in[i], &decode[i] ) ) +- return( -1 ); +- if( vips__formatalike_vec( decode, format, bandary->n ) || +- vips__sizealike_vec( format, size, bandary->n ) ) +- return( -1 ); ++ for (i = 0; i < bandary->n; i++) ++ if (vips_image_decode(bandary->in[i], &decode[i])) ++ return (-1); ++ if (vips__formatalike_vec(decode, format, bandary->n) || ++ vips__sizealike_vec(format, size, bandary->n)) ++ return (-1); + bandary->ready = size; + +- if( vips_image_pipeline_array( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, bandary->ready ) ) +- return( -1 ); ++ if (vips_image_pipeline_array(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, bandary->ready)) ++ return (-1); + + conversion->out->Bands = bandary->out_bands; +- if( class->format_table ) +- conversion->out->BandFmt = ++ if (class->format_table) ++ conversion->out->BandFmt = + class->format_table[bandary->ready[0]->BandFmt]; + +- if( vips_image_generate( conversion->out, +- vips_bandary_start, vips_bandary_gen, vips_bandary_stop, +- bandary->ready, bandary ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_bandary_start, vips_bandary_gen, vips_bandary_stop, ++ bandary->ready, bandary)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_bandary_class_init( VipsBandaryClass *class ) ++vips_bandary_class_init(VipsBandaryClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_bandary_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_bandary_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "bandary"; +- vobject_class->description = _( "operations on image bands" ); ++ vobject_class->description = _("operations on image bands"); + vobject_class->build = vips_bandary_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + } + + static void +-vips_bandary_init( VipsBandary *bandary ) ++vips_bandary_init(VipsBandary *bandary) + { + bandary->out_bands = -1; + } +@@ -269,15 +269,15 @@ vips_bandary_init( VipsBandary *bandary ) + * copy. + */ + int +-vips_bandary_copy( VipsBandary *bandary ) ++vips_bandary_copy(VipsBandary *bandary) + { +- VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( bandary ); +- VipsConversion *conversion = VIPS_CONVERSION( bandary ); ++ VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS(bandary); ++ VipsConversion *conversion = VIPS_CONVERSION(bandary); + +- if( !bandary->in ) { +- vips_error( object_class->nickname, +- "%s", _( "no input images" ) ); +- return( -1 ); ++ if (!bandary->in) { ++ vips_error(object_class->nickname, ++ "%s", _("no input images")); ++ return (-1); + } + + /* This isn't set by arith until build(), so we have to set +@@ -285,7 +285,7 @@ vips_bandary_copy( VipsBandary *bandary ) + * + * Should arith set out in _init()? + */ +- g_object_set( bandary, "out", vips_image_new(), NULL ); ++ g_object_set(bandary, "out", vips_image_new(), NULL); + +- return( vips_image_write( bandary->in[0], conversion->out ) ); ++ return (vips_image_write(bandary->in[0], conversion->out)); + } +diff --git a/libvips/conversion/bandary.h b/libvips/conversion/bandary.h +index ab1283bc7d..a05a136b0a 100644 +--- a/libvips/conversion/bandary.h ++++ b/libvips/conversion/bandary.h +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -38,19 +38,19 @@ extern "C" { + #include "pconversion.h" + + #define VIPS_TYPE_BANDARY (vips_bandary_get_type()) +-#define VIPS_BANDARY( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_BANDARY, VipsBandary )) +-#define VIPS_BANDARY_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_BANDARY(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_BANDARY, VipsBandary)) ++#define VIPS_BANDARY_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_BANDARY, VipsBandaryClass)) ++#define VIPS_IS_BANDARY(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_BANDARY)) ++#define VIPS_IS_BANDARY_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_BANDARY)) ++#define VIPS_BANDARY_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_BANDARY, VipsBandaryClass)) +-#define VIPS_IS_BANDARY( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_BANDARY )) +-#define VIPS_IS_BANDARY_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_BANDARY )) +-#define VIPS_BANDARY_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_BANDARY, VipsBandaryClass )) + + struct _VipsBandary; + +@@ -73,8 +73,8 @@ typedef struct { + + } VipsBandarySequence; + +-typedef void (*VipsBandaryProcessFn)( VipsBandarySequence *seq, +- VipsPel *out, VipsPel **in, int width ); ++typedef void (*VipsBandaryProcessFn)(VipsBandarySequence *seq, ++ VipsPel *out, VipsPel **in, int width); + + typedef struct _VipsBandary { + VipsConversion parent_instance; +@@ -103,19 +103,18 @@ typedef struct _VipsBandaryClass { + VipsBandaryProcessFn process_line; + + /* For each input format, what output format. Leave NULL for output +- * format == input format. ++ * format == input format. + */ + const VipsBandFormat *format_table; + + } VipsBandaryClass; + +-GType vips_bandary_get_type( void ); ++GType vips_bandary_get_type(void); + +-int vips_bandary_copy( VipsBandary *bandary ); ++int vips_bandary_copy(VipsBandary *bandary); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS__BANDARY_H*/ +- +diff --git a/libvips/conversion/bandbool.c b/libvips/conversion/bandbool.c +index 16428f8702..33b999c5f1 100644 +--- a/libvips/conversion/bandbool.c ++++ b/libvips/conversion/bandbool.c +@@ -6,28 +6,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -58,96 +58,113 @@ typedef struct _VipsBandbool { + + typedef VipsBandaryClass VipsBandboolClass; + +-G_DEFINE_TYPE( VipsBandbool, vips_bandbool, VIPS_TYPE_BANDARY ); ++G_DEFINE_TYPE(VipsBandbool, vips_bandbool, VIPS_TYPE_BANDARY); + + static int +-vips_bandbool_build( VipsObject *object ) ++vips_bandbool_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsBandary *bandary = (VipsBandary *) object; + VipsBandbool *bandbool = (VipsBandbool *) object; + + /* << and >> don't work over bands. + */ +- if( bandbool->operation == VIPS_OPERATION_BOOLEAN_LSHIFT || +- bandbool->operation == VIPS_OPERATION_BOOLEAN_RSHIFT ) { +- vips_error( class->nickname, +- _( "operator %s not supported across image bands" ), +- vips_enum_nick( VIPS_TYPE_OPERATION_BOOLEAN, +- bandbool->operation ) ); +- return( -1 ); ++ if (bandbool->operation == VIPS_OPERATION_BOOLEAN_LSHIFT || ++ bandbool->operation == VIPS_OPERATION_BOOLEAN_RSHIFT) { ++ vips_error(class->nickname, ++ _("operator %s not supported across image bands"), ++ vips_enum_nick(VIPS_TYPE_OPERATION_BOOLEAN, ++ bandbool->operation)); ++ return (-1); + } + +- if( bandbool->in ) { +- if( vips_check_noncomplex( class->nickname, bandbool->in ) ) +- return( -1 ); ++ if (bandbool->in) { ++ if (vips_check_noncomplex(class->nickname, bandbool->in)) ++ return (-1); + + bandary->n = 1; + bandary->in = &bandbool->in; + +- if( bandbool->in->Bands == 1 ) +- return( vips_bandary_copy( bandary ) ); ++ if (bandbool->in->Bands == 1) ++ return (vips_bandary_copy(bandary)); + } + + bandary->out_bands = 1; + +- if( VIPS_OBJECT_CLASS( vips_bandbool_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_bandbool_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-#define SWITCH( I, F, OP ) \ +- switch( vips_image_get_format( im ) ) { \ +- case VIPS_FORMAT_UCHAR: I( unsigned char, OP ); break; \ +- case VIPS_FORMAT_CHAR: I( signed char, OP ); break; \ +- case VIPS_FORMAT_USHORT: I( unsigned short, OP ); break; \ +- case VIPS_FORMAT_SHORT: I( signed short, OP ); break; \ +- case VIPS_FORMAT_UINT: I( unsigned int, OP ); break; \ +- case VIPS_FORMAT_INT: I( signed int, OP ); break; \ +- case VIPS_FORMAT_FLOAT: F( float, OP ); break; \ +- case VIPS_FORMAT_DOUBLE: F( double, OP ); break;\ +- \ ++#define SWITCH(I, F, OP) \ ++ switch (vips_image_get_format(im)) { \ ++ case VIPS_FORMAT_UCHAR: \ ++ I(unsigned char, OP); \ ++ break; \ ++ case VIPS_FORMAT_CHAR: \ ++ I(signed char, OP); \ ++ break; \ ++ case VIPS_FORMAT_USHORT: \ ++ I(unsigned short, OP); \ ++ break; \ ++ case VIPS_FORMAT_SHORT: \ ++ I(signed short, OP); \ ++ break; \ ++ case VIPS_FORMAT_UINT: \ ++ I(unsigned int, OP); \ ++ break; \ ++ case VIPS_FORMAT_INT: \ ++ I(signed int, OP); \ ++ break; \ ++ case VIPS_FORMAT_FLOAT: \ ++ F(float, OP); \ ++ break; \ ++ case VIPS_FORMAT_DOUBLE: \ ++ F(double, OP); \ ++ break; \ ++\ + default: \ + g_assert_not_reached(); \ +- } +- +-#define LOOPB( TYPE, OP ) { \ +- TYPE *p = (TYPE *) in[0]; \ +- TYPE *q = (TYPE *) out; \ +- \ +- for( x = 0; x < width; x++ ) { \ +- TYPE acc; \ +- \ +- acc = p[0]; \ +- for( b = 1; b < bands; b++ ) \ +- acc = acc OP p[b]; \ +- \ +- q[x] = acc; \ +- p += bands; \ +- } \ +-} ++ } + +-#define FLOOPB( TYPE, OP ) { \ +- TYPE *p = (TYPE *) in[0]; \ +- int *q = (int *) out; \ +- \ +- for( x = 0; x < width; x++ ) { \ +- int acc; \ +- \ +- acc = (int) p[0]; \ +- for( b = 1; b < bands; b++ ) \ +- acc = acc OP ((int) p[b]); \ +- \ +- q[x] = acc; \ +- p += bands; \ +- } \ +-} ++#define LOOPB(TYPE, OP) \ ++ { \ ++ TYPE *p = (TYPE *) in[0]; \ ++ TYPE *q = (TYPE *) out; \ ++\ ++ for (x = 0; x < width; x++) { \ ++ TYPE acc; \ ++\ ++ acc = p[0]; \ ++ for (b = 1; b < bands; b++) \ ++ acc = acc OP p[b]; \ ++\ ++ q[x] = acc; \ ++ p += bands; \ ++ } \ ++ } ++ ++#define FLOOPB(TYPE, OP) \ ++ { \ ++ TYPE *p = (TYPE *) in[0]; \ ++ int *q = (int *) out; \ ++\ ++ for (x = 0; x < width; x++) { \ ++ int acc; \ ++\ ++ acc = (int) p[0]; \ ++ for (b = 1; b < bands; b++) \ ++ acc = acc OP((int) p[b]); \ ++\ ++ q[x] = acc; \ ++ p += bands; \ ++ } \ ++ } + + static void +-vips_bandbool_buffer( VipsBandarySequence *seq, +- VipsPel *out, VipsPel **in, int width ) ++vips_bandbool_buffer(VipsBandarySequence *seq, ++ VipsPel *out, VipsPel **in, int width) + { + VipsBandary *bandary = seq->bandary; + VipsBandbool *bandbool = (VipsBandbool *) bandary; +@@ -156,17 +173,17 @@ vips_bandbool_buffer( VipsBandarySequence *seq, + + int x, b; + +- switch( bandbool->operation ) { +- case VIPS_OPERATION_BOOLEAN_AND: +- SWITCH( LOOPB, FLOOPB, & ); ++ switch (bandbool->operation) { ++ case VIPS_OPERATION_BOOLEAN_AND: ++ SWITCH(LOOPB, FLOOPB, &); + break; + +- case VIPS_OPERATION_BOOLEAN_OR: +- SWITCH( LOOPB, FLOOPB, | ); ++ case VIPS_OPERATION_BOOLEAN_OR: ++ SWITCH(LOOPB, FLOOPB, |); + break; + +- case VIPS_OPERATION_BOOLEAN_EOR: +- SWITCH( LOOPB, FLOOPB, ^ ); ++ case VIPS_OPERATION_BOOLEAN_EOR: ++ SWITCH(LOOPB, FLOOPB, ^); + break; + + default: +@@ -187,7 +204,7 @@ vips_bandbool_buffer( VipsBandarySequence *seq, + #define D VIPS_FORMAT_DOUBLE + #define DX VIPS_FORMAT_DPCOMPLEX + +-/* Format conversions for boolean. ++/* Format conversions for boolean. + */ + static const VipsBandFormat vips_bandbool_format_table[10] = { + /* Band format: UC C US S UI I F X D DX */ +@@ -195,48 +212,48 @@ static const VipsBandFormat vips_bandbool_format_table[10] = { + }; + + static void +-vips_bandbool_class_init( VipsBandboolClass *class ) ++vips_bandbool_class_init(VipsBandboolClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsBandaryClass *bandary_class = VIPS_BANDARY_CLASS( class ); ++ VipsBandaryClass *bandary_class = VIPS_BANDARY_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "bandbool"; +- object_class->description = _( "boolean operation across image bands" ); ++ object_class->description = _("boolean operation across image bands"); + object_class->build = vips_bandbool_build; + + bandary_class->process_line = vips_bandbool_buffer; + bandary_class->format_table = vips_bandbool_format_table; + +- VIPS_ARG_IMAGE( class, "in", 0, +- _( "Input" ), +- _( "Input image argument" ), ++ VIPS_ARG_IMAGE(class, "in", 0, ++ _("Input"), ++ _("Input image argument"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBandbool, in ) ); ++ G_STRUCT_OFFSET(VipsBandbool, in)); + +- VIPS_ARG_ENUM( class, "boolean", 200, +- _( "Operation" ), +- _( "Boolean to perform" ), ++ VIPS_ARG_ENUM(class, "boolean", 200, ++ _("Operation"), ++ _("Boolean to perform"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBandbool, operation ), +- VIPS_TYPE_OPERATION_BOOLEAN, +- VIPS_OPERATION_BOOLEAN_AND ); ++ G_STRUCT_OFFSET(VipsBandbool, operation), ++ VIPS_TYPE_OPERATION_BOOLEAN, ++ VIPS_OPERATION_BOOLEAN_AND); + } + + static void +-vips_bandbool_init( VipsBandbool *bandbool ) ++vips_bandbool_init(VipsBandbool *bandbool) + { + bandbool->operation = VIPS_OPERATION_BOOLEAN_AND; + } + + static int +-vips_bandboolv( VipsImage *in, VipsImage **out, +- VipsOperationBoolean operation, va_list ap ) ++vips_bandboolv(VipsImage *in, VipsImage **out, ++ VipsOperationBoolean operation, va_list ap) + { +- return( vips_call_split( "bandbool", ap, in, out, operation ) ); ++ return (vips_call_split("bandbool", ap, in, out, operation)); + } + + /** +@@ -250,33 +267,33 @@ vips_bandboolv( VipsImage *in, VipsImage **out, + * example, a three-band uchar image operated on with + * #VIPS_OPERATION_BOOLEAN_AND will produce a one-band uchar image where each + * pixel is the bitwise and of the band elements of the corresponding pixel in +- * the input image. ++ * the input image. + * + * The output image is the same format as the input image for integer + * types. Float types are cast to int before processing. Complex types are not + * supported. + * +- * The output image always has one band. ++ * The output image always has one band. + * + * This operation is useful in conjuction with vips_relational(). You can use +- * it to see if all image bands match exactly. ++ * it to see if all image bands match exactly. + * + * See also: vips_boolean_const(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_bandbool( VipsImage *in, VipsImage **out, +- VipsOperationBoolean boolean, ... ) ++vips_bandbool(VipsImage *in, VipsImage **out, ++ VipsOperationBoolean boolean, ...) + { + va_list ap; + int result; + +- va_start( ap, boolean ); +- result = vips_bandboolv( in, out, boolean, ap ); +- va_end( ap ); ++ va_start(ap, boolean); ++ result = vips_bandboolv(in, out, boolean, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -291,16 +308,16 @@ vips_bandbool( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_bandand( VipsImage *in, VipsImage **out, ... ) ++vips_bandand(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_bandboolv( in, out, VIPS_OPERATION_BOOLEAN_AND, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_bandboolv(in, out, VIPS_OPERATION_BOOLEAN_AND, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -315,16 +332,16 @@ vips_bandand( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_bandor( VipsImage *in, VipsImage **out, ... ) ++vips_bandor(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_bandboolv( in, out, VIPS_OPERATION_BOOLEAN_OR, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_bandboolv(in, out, VIPS_OPERATION_BOOLEAN_OR, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -339,15 +356,14 @@ vips_bandor( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_bandeor( VipsImage *in, VipsImage **out, ... ) ++vips_bandeor(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_bandboolv( in, out, VIPS_OPERATION_BOOLEAN_EOR, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_bandboolv(in, out, VIPS_OPERATION_BOOLEAN_EOR, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/conversion/bandfold.c b/libvips/conversion/bandfold.c +index d26edf8ef9..e5326776fd 100644 +--- a/libvips/conversion/bandfold.c ++++ b/libvips/conversion/bandfold.c +@@ -1,4 +1,4 @@ +-/* Fold up x into bands. ++/* Fold up x into bands. + * + * 5/6/15 + * - from copy.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -66,17 +66,17 @@ typedef struct _VipsBandfold { + + typedef VipsConversionClass VipsBandfoldClass; + +-G_DEFINE_TYPE( VipsBandfold, vips_bandfold, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsBandfold, vips_bandfold, VIPS_TYPE_CONVERSION); + + static int +-vips_bandfold_gen( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_bandfold_gen(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsBandfold *bandfold = (VipsBandfold *) b; + VipsRegion *ir = (VipsRegion *) seq; + VipsImage *out = or->im; +- VipsRect *r = &or->valid; +- int psize = VIPS_IMAGE_SIZEOF_PEL( out ); ++ VipsRect *r = & or->valid; ++ int psize = VIPS_IMAGE_SIZEOF_PEL(out); + + VipsRect need; + int y; +@@ -85,93 +85,93 @@ vips_bandfold_gen( VipsRegion *or, + need.top = r->top; + need.width = r->width * bandfold->factor; + need.height = r->height; +- if( vips_region_prepare( ir, &need ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &need)) ++ return (-1); + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( ir, +- r->left * bandfold->factor, r->top + y ); +- VipsPel *q = VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(ir, ++ r->left * bandfold->factor, r->top + y); ++ VipsPel *q = VIPS_REGION_ADDR(or, r->left, r->top + y); + + /* We can't use vips_region_region() since we change pixel + * coordinates. + */ +- memcpy( q, p, psize * r->width ); ++ memcpy(q, p, psize * r->width); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_bandfold_build( VipsObject *object ) ++vips_bandfold_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsBandfold *bandfold = (VipsBandfold *) object; + +- if( VIPS_OBJECT_CLASS( vips_bandfold_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_bandfold_parent_class)->build(object)) ++ return (-1); + +- if( vips_image_pio_input( bandfold->in ) ) +- return( -1 ); ++ if (vips_image_pio_input(bandfold->in)) ++ return (-1); + +- if( bandfold->factor == 0 ) ++ if (bandfold->factor == 0) + bandfold->factor = bandfold->in->Xsize; +- if( bandfold->in->Xsize % bandfold->factor != 0 ) { +- vips_error( class->nickname, +- "%s", _( "@factor must be a factor of image width" ) ); +- return( -1 ); ++ if (bandfold->in->Xsize % bandfold->factor != 0) { ++ vips_error(class->nickname, ++ "%s", _("@factor must be a factor of image width")); ++ return (-1); + } + +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, bandfold->in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, bandfold->in, NULL)) ++ return (-1); + + conversion->out->Xsize /= bandfold->factor; + conversion->out->Bands *= bandfold->factor; + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_bandfold_gen, vips_stop_one, +- bandfold->in, bandfold ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_bandfold_gen, vips_stop_one, ++ bandfold->in, bandfold)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_bandfold_class_init( VipsBandfoldClass *class ) ++vips_bandfold_class_init(VipsBandfoldClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_bandfold_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_bandfold_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "bandfold"; +- vobject_class->description = _( "fold up x axis into bands" ); ++ vobject_class->description = _("fold up x axis into bands"); + vobject_class->build = vips_bandfold_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBandfold, in ) ); ++ G_STRUCT_OFFSET(VipsBandfold, in)); + +- VIPS_ARG_INT( class, "factor", 11, +- _( "Factor" ), +- _( "Fold by this factor" ), ++ VIPS_ARG_INT(class, "factor", 11, ++ _("Factor"), ++ _("Fold by this factor"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsBandfold, factor ), +- 0, 10000000, 0 ); ++ G_STRUCT_OFFSET(VipsBandfold, factor), ++ 0, 10000000, 0); + } + + static void +-vips_bandfold_init( VipsBandfold *bandfold ) ++vips_bandfold_init(VipsBandfold *bandfold) + { + /* 0 means fold by width, see above. + */ +@@ -188,24 +188,24 @@ vips_bandfold_init( VipsBandfold *bandfold ) + * + * * @factor: fold by this factor + * +- * Fold up an image horizontally: width is collapsed into bands. ++ * Fold up an image horizontally: width is collapsed into bands. + * Use @factor to set how much to fold by: @factor 3, for example, will make + * the output image three times narrower than the input, and with three times +- * as many bands. By default the whole of the input width is folded up. ++ * as many bands. By default the whole of the input width is folded up. + * + * See also: vips_csvload(), vips_bandunfold(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_bandfold( VipsImage *in, VipsImage **out, ... ) ++vips_bandfold(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "bandfold", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("bandfold", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/bandjoin.c b/libvips/conversion/bandjoin.c +index 1277cdf0b7..4e04f25d32 100644 +--- a/libvips/conversion/bandjoin.c ++++ b/libvips/conversion/bandjoin.c +@@ -4,7 +4,7 @@ + * + * Author: N. Dessipris + * Written on: 17/04/1991 +- * Modified on : ++ * Modified on : + * 16/3/94 JC + * - rewritten for partials + * - now in ANSI C +@@ -30,28 +30,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -85,11 +85,11 @@ typedef struct _VipsBandjoin { + + typedef VipsBandaryClass VipsBandjoinClass; + +-G_DEFINE_TYPE( VipsBandjoin, vips_bandjoin, VIPS_TYPE_BANDARY ); ++G_DEFINE_TYPE(VipsBandjoin, vips_bandjoin, VIPS_TYPE_BANDARY); + + static void +-vips_bandjoin_buffer( VipsBandarySequence *seq, +- VipsPel *q, VipsPel **p, int width ) ++vips_bandjoin_buffer(VipsBandarySequence *seq, ++ VipsPel *q, VipsPel **p, int width) + { + VipsBandary *bandary = seq->bandary; + VipsConversion *conversion = (VipsConversion *) bandary; +@@ -97,27 +97,27 @@ vips_bandjoin_buffer( VipsBandarySequence *seq, + + /* Output pel size. + */ +- const int ops = VIPS_IMAGE_SIZEOF_PEL( conversion->out ); ++ const int ops = VIPS_IMAGE_SIZEOF_PEL(conversion->out); + + int i; + + /* Loop for each input image. Scattered write is faster than + * scattered read. + */ +- for( i = 0; i < bandary->n; i++ ) { ++ for (i = 0; i < bandary->n; i++) { + /* Input pel size. + */ +- int ips = VIPS_IMAGE_SIZEOF_PEL( in[i] ); ++ int ips = VIPS_IMAGE_SIZEOF_PEL(in[i]); + +- VipsPel * restrict p1; +- VipsPel * restrict q1; ++ VipsPel *restrict p1; ++ VipsPel *restrict q1; + int x, z; + + q1 = q; + p1 = p[i]; + +- for( x = 0; x < width; x++ ) { +- for( z = 0; z < ips; z++ ) ++ for (x = 0; x < width; x++) { ++ for (z = 0; z < ips; z++) + q1[z] = p1[z]; + + p1 += ips; +@@ -129,78 +129,77 @@ vips_bandjoin_buffer( VipsBandarySequence *seq, + } + + static int +-vips_bandjoin_build( VipsObject *object ) ++vips_bandjoin_build(VipsObject *object) + { + VipsBandary *bandary = (VipsBandary *) object; + VipsBandjoin *bandjoin = (VipsBandjoin *) object; + +- if( bandjoin->in ) { +- bandary->in = vips_array_image_get( bandjoin->in, &bandary->n ); ++ if (bandjoin->in) { ++ bandary->in = vips_array_image_get(bandjoin->in, &bandary->n); + +- if( bandary->n == 1 ) +- return( vips_bandary_copy( bandary ) ); ++ if (bandary->n == 1) ++ return (vips_bandary_copy(bandary)); + else { + int i; + + bandary->out_bands = 0; +- for( i = 0; i < bandary->n; i++ ) +- if( bandary->in[i] ) +- bandary->out_bands += ++ for (i = 0; i < bandary->n; i++) ++ if (bandary->in[i]) ++ bandary->out_bands += + bandary->in[i]->Bands; + } + } + +- if( VIPS_OBJECT_CLASS( vips_bandjoin_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_bandjoin_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_bandjoin_class_init( VipsBandjoinClass *class ) ++vips_bandjoin_class_init(VipsBandjoinClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsBandaryClass *bandary_class = VIPS_BANDARY_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsBandaryClass *bandary_class = VIPS_BANDARY_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_bandjoin_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_bandjoin_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "bandjoin"; +- vobject_class->description = _( "bandwise join a set of images" ); ++ vobject_class->description = _("bandwise join a set of images"); + vobject_class->build = vips_bandjoin_build; + + bandary_class->process_line = vips_bandjoin_buffer; + +- VIPS_ARG_BOXED( class, "in", 0, +- _( "Input" ), +- _( "Array of input images" ), ++ VIPS_ARG_BOXED(class, "in", 0, ++ _("Input"), ++ _("Array of input images"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBandjoin, in ), +- VIPS_TYPE_ARRAY_IMAGE ); +- ++ G_STRUCT_OFFSET(VipsBandjoin, in), ++ VIPS_TYPE_ARRAY_IMAGE); + } + + static void +-vips_bandjoin_init( VipsBandjoin *bandjoin ) ++vips_bandjoin_init(VipsBandjoin *bandjoin) + { + /* Init our instance fields. + */ + } + + static int +-vips_bandjoinv( VipsImage **in, VipsImage **out, int n, va_list ap ) ++vips_bandjoinv(VipsImage **in, VipsImage **out, int n, va_list ap) + { +- VipsArrayImage *array; ++ VipsArrayImage *array; + int result; + +- array = vips_array_image_new( in, n ); +- result = vips_call_split( "bandjoin", ap, array, out ); +- vips_area_unref( VIPS_AREA( array ) ); ++ array = vips_array_image_new(in, n); ++ result = vips_call_split("bandjoin", ap, array, out); ++ vips_area_unref(VIPS_AREA(array)); + +- return( result ); ++ return (result); + } + + /** +@@ -210,18 +209,18 @@ vips_bandjoinv( VipsImage **in, VipsImage **out, int n, va_list ap ) + * @n: number of input images + * @...: %NULL-terminated list of optional named arguments + * +- * Join a set of images together, bandwise. ++ * Join a set of images together, bandwise. + * + * If the images + * have n and m bands, then the output image will have n + m + * bands, with the first n coming from the first image and the last m +- * from the second. ++ * from the second. + * + * If the images differ in size, the smaller images are enlarged to match the + * larger by adding zero pixels along the bottom and right. + * +- * The input images are cast up to the smallest common type (see table +- * Smallest common format in ++ * The input images are cast up to the smallest common type (see table ++ * Smallest common format in + * arithmetic). + * + * See also: vips_insert(). +@@ -229,16 +228,16 @@ vips_bandjoinv( VipsImage **in, VipsImage **out, int n, va_list ap ) + * Returns: 0 on success, -1 on error + */ + int +-vips_bandjoin( VipsImage **in, VipsImage **out, int n, ... ) ++vips_bandjoin(VipsImage **in, VipsImage **out, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_bandjoinv( in, out, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_bandjoinv(in, out, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -253,7 +252,7 @@ vips_bandjoin( VipsImage **in, VipsImage **out, int n, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_bandjoin2( VipsImage *in1, VipsImage *in2, VipsImage **out, ... ) ++vips_bandjoin2(VipsImage *in1, VipsImage *in2, VipsImage **out, ...) + { + va_list ap; + int result; +@@ -262,11 +261,11 @@ vips_bandjoin2( VipsImage *in1, VipsImage *in2, VipsImage **out, ... ) + in[0] = in1; + in[1] = in2; + +- va_start( ap, out ); +- result = vips_bandjoinv( in, out, 2, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_bandjoinv(in, out, 2, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + typedef struct _VipsBandjoinConst { +@@ -285,21 +284,21 @@ typedef struct _VipsBandjoinConst { + + typedef VipsBandaryClass VipsBandjoinConstClass; + +-G_DEFINE_TYPE( VipsBandjoinConst, vips_bandjoin_const, VIPS_TYPE_BANDARY ); ++G_DEFINE_TYPE(VipsBandjoinConst, vips_bandjoin_const, VIPS_TYPE_BANDARY); + + static void +-vips_bandjoin_const_finalize( GObject *object ) ++vips_bandjoin_const_finalize(GObject *object) + { + VipsBandjoinConst *bandjoin = (VipsBandjoinConst *) object; + +- VIPS_FREE( bandjoin->c_ready ); ++ VIPS_FREE(bandjoin->c_ready); + +- G_OBJECT_CLASS( vips_bandjoin_const_parent_class )->finalize( object ); ++ G_OBJECT_CLASS(vips_bandjoin_const_parent_class)->finalize(object); + } + + static void +-vips_bandjoin_const_buffer( VipsBandarySequence *seq, +- VipsPel *q, VipsPel **p, int width ) ++vips_bandjoin_const_buffer(VipsBandarySequence *seq, ++ VipsPel *q, VipsPel **p, int width) + { + VipsBandary *bandary = seq->bandary; + VipsConversion *conversion = (VipsConversion *) bandary; +@@ -308,18 +307,18 @@ vips_bandjoin_const_buffer( VipsBandarySequence *seq, + + /* Output pel size. + */ +- const int ops = VIPS_IMAGE_SIZEOF_PEL( conversion->out ); ++ const int ops = VIPS_IMAGE_SIZEOF_PEL(conversion->out); + + /* Input pel size. + */ +- const int ips = VIPS_IMAGE_SIZEOF_PEL( in ); ++ const int ips = VIPS_IMAGE_SIZEOF_PEL(in); + + /* Extra bands size. + */ +- const int ebs = ops - ips; ++ const int ebs = ops - ips; + +- VipsPel * restrict p1; +- VipsPel * restrict q1; ++ VipsPel *restrict p1; ++ VipsPel *restrict q1; + int x, z; + + q1 = q; +@@ -327,11 +326,11 @@ vips_bandjoin_const_buffer( VipsBandarySequence *seq, + + /* Special path for 8-bit RGB -> RGBA ... it's a common case. + */ +- if( ips == 3 && +- ebs == 1 ) { ++ if (ips == 3 && ++ ebs == 1) { + int c = bandjoin->c_ready[0]; + +- for( x = 0; x < width; x++ ) { ++ for (x = 0; x < width; x++) { + q1[0] = p1[0]; + q1[1] = p1[1]; + q1[2] = p1[2]; +@@ -342,14 +341,14 @@ vips_bandjoin_const_buffer( VipsBandarySequence *seq, + } + } + else { +- for( x = 0; x < width; x++ ) { +- for( z = 0; z < ips; z++ ) ++ for (x = 0; x < width; x++) { ++ for (z = 0; z < ips; z++) + q1[z] = p1[z]; + + p1 += ips; + q1 += ips; + +- for( z = 0; z < ebs; z++ ) ++ for (z = 0; z < ebs; z++) + q1[z] = bandjoin->c_ready[z]; + + q1 += ebs; +@@ -358,94 +357,91 @@ vips_bandjoin_const_buffer( VipsBandarySequence *seq, + } + + static int +-vips_bandjoin_const_build( VipsObject *object ) ++vips_bandjoin_const_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsBandary *bandary = (VipsBandary *) object; + VipsBandjoinConst *bandjoin = (VipsBandjoinConst *) object; + +- if( bandjoin->c && +- bandjoin->in ) { ++ if (bandjoin->c && ++ bandjoin->in) { + double *c; + int n; + +- c = vips_array_double_get( bandjoin->c, &n ); ++ c = vips_array_double_get(bandjoin->c, &n); + +- if( n == 0 ) +- return( vips_bandary_copy( bandary ) ); +- else ++ if (n == 0) ++ return (vips_bandary_copy(bandary)); ++ else + bandary->out_bands = bandjoin->in->Bands + n; + + bandary->n = 1; + bandary->in = &bandjoin->in; + +- if( !(bandjoin->c_ready = vips__vector_to_pels( class->nickname, +- n, bandjoin->in->BandFmt, bandjoin->in->Coding, +- c, NULL, n )) ) +- return( -1 ); +- ++ if (!(bandjoin->c_ready = vips__vector_to_pels(class->nickname, ++ n, bandjoin->in->BandFmt, bandjoin->in->Coding, ++ c, NULL, n))) ++ return (-1); + } + +- if( VIPS_OBJECT_CLASS( vips_bandjoin_const_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_bandjoin_const_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_bandjoin_const_class_init( VipsBandjoinConstClass *class ) ++vips_bandjoin_const_class_init(VipsBandjoinConstClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsBandaryClass *bandary_class = VIPS_BANDARY_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsBandaryClass *bandary_class = VIPS_BANDARY_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_bandjoin_const_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_bandjoin_const_class_init\n"); + + gobject_class->finalize = vips_bandjoin_const_finalize; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "bandjoin_const"; +- vobject_class->description = _( "append a constant band to an image" ); ++ vobject_class->description = _("append a constant band to an image"); + vobject_class->build = vips_bandjoin_const_build; + + bandary_class->process_line = vips_bandjoin_const_buffer; + +- VIPS_ARG_IMAGE( class, "in", 0, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 0, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBandjoinConst, in ) ); ++ G_STRUCT_OFFSET(VipsBandjoinConst, in)); + +- VIPS_ARG_BOXED( class, "c", 12, +- _( "Constants" ), +- _( "Array of constants to add" ), ++ VIPS_ARG_BOXED(class, "c", 12, ++ _("Constants"), ++ _("Array of constants to add"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBandjoinConst, c ), +- VIPS_TYPE_ARRAY_DOUBLE ); +- ++ G_STRUCT_OFFSET(VipsBandjoinConst, c), ++ VIPS_TYPE_ARRAY_DOUBLE); + } + + static void +-vips_bandjoin_const_init( VipsBandjoinConst *bandjoin ) ++vips_bandjoin_const_init(VipsBandjoinConst *bandjoin) + { + /* Init our instance fields. + */ + } + + static int +-vips_bandjoin_constv( VipsImage *in, VipsImage **out, +- double *c, int n, va_list ap ) ++vips_bandjoin_constv(VipsImage *in, VipsImage **out, ++ double *c, int n, va_list ap) + { +- VipsArrayDouble *array; ++ VipsArrayDouble *array; + int result; + +- array = vips_array_double_new( c, n ); +- result = vips_call_split( "bandjoin_const", ap, in, out, array ); +- vips_area_unref( VIPS_AREA( array ) ); ++ array = vips_array_double_new(c, n); ++ result = vips_call_split("bandjoin_const", ap, in, out, array); ++ vips_area_unref(VIPS_AREA(array)); + +- return( result ); ++ return (result); + } + + /** +@@ -456,23 +452,23 @@ vips_bandjoin_constv( VipsImage *in, VipsImage **out, + * @n: number of constants + * @...: %NULL-terminated list of optional named arguments + * +- * Append a set of constant bands to an image. ++ * Append a set of constant bands to an image. + * + * See also: vips_bandjoin(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_bandjoin_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) ++vips_bandjoin_const(VipsImage *in, VipsImage **out, double *c, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_bandjoin_constv( in, out, c, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_bandjoin_constv(in, out, c, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -487,16 +483,16 @@ vips_bandjoin_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_bandjoin_const1( VipsImage *in, VipsImage **out, double c, ... ) ++vips_bandjoin_const1(VipsImage *in, VipsImage **out, double c, ...) + { + va_list ap; + int result; + +- va_start( ap, c ); +- result = vips_bandjoin_constv( in, out, &c, 1, ap ); +- va_end( ap ); ++ va_start(ap, c); ++ result = vips_bandjoin_constv(in, out, &c, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -512,17 +508,17 @@ vips_bandjoin_const1( VipsImage *in, VipsImage **out, double c, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_addalpha( VipsImage *in, VipsImage **out, ... ) ++vips_addalpha(VipsImage *in, VipsImage **out, ...) + { + double max_alpha; + + max_alpha = 255.0; +- if( in->Type == VIPS_INTERPRETATION_GREY16 || +- in->Type == VIPS_INTERPRETATION_RGB16 ) ++ if (in->Type == VIPS_INTERPRETATION_GREY16 || ++ in->Type == VIPS_INTERPRETATION_RGB16) + max_alpha = 65535; + +- if( vips_bandjoin_const1( in, out, max_alpha, NULL ) ) +- return( -1 ); ++ if (vips_bandjoin_const1(in, out, max_alpha, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/conversion/bandmean.c b/libvips/conversion/bandmean.c +index 8401f650f9..4fdcd8d4a4 100644 +--- a/libvips/conversion/bandmean.c ++++ b/libvips/conversion/bandmean.c +@@ -13,28 +13,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -64,94 +64,105 @@ typedef struct _VipsBandmean { + + typedef VipsBandaryClass VipsBandmeanClass; + +-G_DEFINE_TYPE( VipsBandmean, vips_bandmean, VIPS_TYPE_BANDARY ); ++G_DEFINE_TYPE(VipsBandmean, vips_bandmean, VIPS_TYPE_BANDARY); + + /* Unsigned int types. Round, keep sum in a larger variable. + */ +-#define UILOOP( TYPE, STYPE ) { \ +- TYPE *p = (TYPE *) in[0]; \ +- TYPE *q = (TYPE *) out; \ +- \ +- for( i = 0; i < sz; i++ ) { \ +- STYPE sum; \ +- \ +- sum = 0; \ +- for( j = 0; j < bands; j++ ) \ +- sum += p[j]; \ +- q[i] = (sum + bands / 2) / bands; \ +- p += bands; \ +- } \ +-} ++#define UILOOP(TYPE, STYPE) \ ++ { \ ++ TYPE *p = (TYPE *) in[0]; \ ++ TYPE *q = (TYPE *) out; \ ++\ ++ for (i = 0; i < sz; i++) { \ ++ STYPE sum; \ ++\ ++ sum = 0; \ ++ for (j = 0; j < bands; j++) \ ++ sum += p[j]; \ ++ q[i] = (sum + bands / 2) / bands; \ ++ p += bands; \ ++ } \ ++ } + + /* Signed int types. Round, keep sum in a larger variable. + */ +-#define SILOOP( TYPE, STYPE ) { \ +- TYPE *p = (TYPE *) in[0]; \ +- TYPE *q = (TYPE *) out; \ +- \ +- for( i = 0; i < sz; i++ ) { \ +- STYPE sum; \ +- \ +- sum = 0; \ +- for( j = 0; j < bands; j++ ) \ +- sum += p[j]; \ +- q[i] = sum > 0 ? \ +- (sum + bands / 2) / bands : \ +- (sum - bands / 2) / bands; \ +- p += bands; \ +- } \ +-} ++#define SILOOP(TYPE, STYPE) \ ++ { \ ++ TYPE *p = (TYPE *) in[0]; \ ++ TYPE *q = (TYPE *) out; \ ++\ ++ for (i = 0; i < sz; i++) { \ ++ STYPE sum; \ ++\ ++ sum = 0; \ ++ for (j = 0; j < bands; j++) \ ++ sum += p[j]; \ ++ q[i] = sum > 0 ? (sum + bands / 2) / bands : (sum - bands / 2) / bands; \ ++ p += bands; \ ++ } \ ++ } + + /* Float loop. No rounding, sum in same container. + */ +-#define FLOOP( TYPE ) { \ +- TYPE *p = (TYPE *) in[0]; \ +- TYPE *q = (TYPE *) out; \ +- \ +- for( i = 0; i < sz; i++ ) { \ +- TYPE sum; \ +- \ +- sum = 0; \ +- for( j = 0; j < bands; j++ ) \ +- sum += p[j]; \ +- q[i] = sum / bands; \ +- p += bands; \ +- } \ +-} ++#define FLOOP(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) in[0]; \ ++ TYPE *q = (TYPE *) out; \ ++\ ++ for (i = 0; i < sz; i++) { \ ++ TYPE sum; \ ++\ ++ sum = 0; \ ++ for (j = 0; j < bands; j++) \ ++ sum += p[j]; \ ++ q[i] = sum / bands; \ ++ p += bands; \ ++ } \ ++ } + + static void +-vips_bandmean_buffer( VipsBandarySequence *seq, +- VipsPel *out, VipsPel **in, int width ) ++vips_bandmean_buffer(VipsBandarySequence *seq, ++ VipsPel *out, VipsPel **in, int width) + { + VipsBandary *bandary = seq->bandary; + VipsImage *im = bandary->ready[0]; + const int bands = im->Bands; +- const int sz = width * +- (vips_band_format_iscomplex( im->BandFmt ) ? 2 : 1); ++ const int sz = width * ++ (vips_band_format_iscomplex(im->BandFmt) ? 2 : 1); + + int i, j; + +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_CHAR: +- SILOOP( signed char, int ); break; +- case VIPS_FORMAT_UCHAR: +- UILOOP( unsigned char, unsigned int ); break; +- case VIPS_FORMAT_SHORT: +- SILOOP( signed short, int ); break; +- case VIPS_FORMAT_USHORT: +- UILOOP( unsigned short, unsigned int ); break; +- case VIPS_FORMAT_INT: +- SILOOP( signed int, int ); break; +- case VIPS_FORMAT_UINT: +- UILOOP( unsigned int, unsigned int ); break; +- case VIPS_FORMAT_FLOAT: +- FLOOP( float ); break; +- case VIPS_FORMAT_DOUBLE: +- FLOOP( double ); break; ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_CHAR: ++ SILOOP(signed char, int); ++ break; ++ case VIPS_FORMAT_UCHAR: ++ UILOOP(unsigned char, unsigned int); ++ break; ++ case VIPS_FORMAT_SHORT: ++ SILOOP(signed short, int); ++ break; ++ case VIPS_FORMAT_USHORT: ++ UILOOP(unsigned short, unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ SILOOP(signed int, int); ++ break; ++ case VIPS_FORMAT_UINT: ++ UILOOP(unsigned int, unsigned int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ FLOOP(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ FLOOP(double); ++ break; + case VIPS_FORMAT_COMPLEX: +- FLOOP( float ); break; ++ FLOOP(float); ++ break; + case VIPS_FORMAT_DPCOMPLEX: +- FLOOP( double ); break; ++ FLOOP(double); ++ break; + + default: + g_assert_not_reached(); +@@ -159,7 +170,7 @@ vips_bandmean_buffer( VipsBandarySequence *seq, + } + + static int +-vips_bandmean_build( VipsObject *object ) ++vips_bandmean_build(VipsObject *object) + { + VipsBandary *bandary = (VipsBandary *) object; + VipsBandmean *bandmean = (VipsBandmean *) object; +@@ -167,43 +178,43 @@ vips_bandmean_build( VipsObject *object ) + bandary->n = 1; + bandary->in = &bandmean->in; + +- if( bandmean->in && +- bandmean->in->Bands == 1 ) +- return( vips_bandary_copy( bandary ) ); ++ if (bandmean->in && ++ bandmean->in->Bands == 1) ++ return (vips_bandary_copy(bandary)); + + bandary->out_bands = 1; + +- if( VIPS_OBJECT_CLASS( vips_bandmean_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_bandmean_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_bandmean_class_init( VipsBandmeanClass *class ) ++vips_bandmean_class_init(VipsBandmeanClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsBandaryClass *bandary_class = VIPS_BANDARY_CLASS( class ); ++ VipsBandaryClass *bandary_class = VIPS_BANDARY_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "bandmean"; +- object_class->description = _( "band-wise average" ); ++ object_class->description = _("band-wise average"); + object_class->build = vips_bandmean_build; + + bandary_class->process_line = vips_bandmean_buffer; + +- VIPS_ARG_IMAGE( class, "in", 0, +- _( "Input" ), +- _( "Input image argument" ), ++ VIPS_ARG_IMAGE(class, "in", 0, ++ _("Input"), ++ _("Input image argument"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBandmean, in ) ); ++ G_STRUCT_OFFSET(VipsBandmean, in)); + } + + static void +-vips_bandmean_init( VipsBandmean *bandmean ) ++vips_bandmean_init(VipsBandmean *bandmean) + { + } + +@@ -213,8 +224,8 @@ vips_bandmean_init( VipsBandmean *bandmean ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * This operation writes a one-band image where each pixel is the average of +- * the bands for that pixel in the input image. The output band format is ++ * This operation writes a one-band image where each pixel is the average of ++ * the bands for that pixel in the input image. The output band format is + * the same as the input band format. Integer types use round-to-nearest + * averaging. + * +@@ -223,14 +234,14 @@ vips_bandmean_init( VipsBandmean *bandmean ) + * Returns: 0 on success, -1 on error + */ + int +-vips_bandmean( VipsImage *in, VipsImage **out, ... ) ++vips_bandmean(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "bandmean", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("bandmean", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/bandrank.c b/libvips/conversion/bandrank.c +index 39154b26f0..94066a08d4 100644 +--- a/libvips/conversion/bandrank.c ++++ b/libvips/conversion/bandrank.c +@@ -12,28 +12,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -63,98 +63,117 @@ typedef struct _VipsBandrank { + /* The input images. + */ + VipsArrayImage *in; +- int index; /* Pick out this one */ ++ int index; /* Pick out this one */ + } VipsBandrank; + + typedef VipsBandaryClass VipsBandrankClass; + +-G_DEFINE_TYPE( VipsBandrank, vips_bandrank, VIPS_TYPE_BANDARY ); ++G_DEFINE_TYPE(VipsBandrank, vips_bandrank, VIPS_TYPE_BANDARY); + + /* Special-case max and min (rather common). + */ +-#define FIND_MAX( TYPE ) { \ +- for( x = 0; x < sz; x++ ) { \ +- TYPE top = ((TYPE *) p[0])[x]; \ +- \ +- for( i = 1; i < bandary->n; i++ ) { \ +- TYPE v = ((TYPE *) p[i])[x]; \ +- \ +- if( v > top ) \ +- top = v; \ ++#define FIND_MAX(TYPE) \ ++ { \ ++ for (x = 0; x < sz; x++) { \ ++ TYPE top = ((TYPE *) p[0])[x]; \ ++\ ++ for (i = 1; i < bandary->n; i++) { \ ++ TYPE v = ((TYPE *) p[i])[x]; \ ++\ ++ if (v > top) \ ++ top = v; \ ++ } \ ++\ ++ ((TYPE *) q)[x] = top; \ + } \ +- \ +- ((TYPE *) q)[x] = top; \ +- } \ +-} ++ } + +-#define FIND_MIN( TYPE ) { \ +- for( x = 0; x < sz; x++ ) { \ +- TYPE bot = ((TYPE *) p[0])[x]; \ +- \ +- for( i = 1; i < bandary->n; i++ ) { \ +- TYPE v = ((TYPE *) p[i])[x]; \ +- \ +- if( v < bot ) \ +- bot = v; \ ++#define FIND_MIN(TYPE) \ ++ { \ ++ for (x = 0; x < sz; x++) { \ ++ TYPE bot = ((TYPE *) p[0])[x]; \ ++\ ++ for (i = 1; i < bandary->n; i++) { \ ++ TYPE v = ((TYPE *) p[i])[x]; \ ++\ ++ if (v < bot) \ ++ bot = v; \ ++ } \ ++\ ++ ((TYPE *) q)[x] = bot; \ + } \ +- \ +- ((TYPE *) q)[x] = bot; \ +- } \ +-} ++ } + +-#define FIND_RANK( TYPE ) { \ +- TYPE *sort = (TYPE *) sort_buffer; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- for( i = 0; i < bandary->n; i++ ) { \ +- TYPE v = ((TYPE *) p[i])[x]; \ +- \ +- /* Search for element >v. +- */\ +- for( j = 0; j < i; j++ ) \ +- if( sort[j] > v ) \ +- break; \ +- \ +- /* Move remaining elements down. +- */ \ +- for( k = i; k > j; k-- ) \ +- sort[k] = sort[k - 1]; \ +- \ +- /* Insert this element. +- */ \ +- sort[j] = v; \ ++#define FIND_RANK(TYPE) \ ++ { \ ++ TYPE *sort = (TYPE *) sort_buffer; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ for (i = 0; i < bandary->n; i++) { \ ++ TYPE v = ((TYPE *) p[i])[x]; \ ++\ ++ /* Search for element >v. \ ++ */ \ ++ for (j = 0; j < i; j++) \ ++ if (sort[j] > v) \ ++ break; \ ++\ ++ /* Move remaining elements down. \ ++ */ \ ++ for (k = i; k > j; k--) \ ++ sort[k] = sort[k - 1]; \ ++\ ++ /* Insert this element. \ ++ */ \ ++ sort[j] = v; \ ++ } \ ++\ ++ ((TYPE *) q)[x] = sort[bandrank->index]; \ + } \ +- \ +- ((TYPE *) q)[x] = sort[bandrank->index]; \ +- } \ +-} +- +-#define SWITCH( OPERATION ) \ +- switch( in[0]->BandFmt ) { \ +- case VIPS_FORMAT_UCHAR: OPERATION( unsigned char ); break; \ +- case VIPS_FORMAT_CHAR: OPERATION( signed char ); break; \ +- case VIPS_FORMAT_USHORT: OPERATION( unsigned short ); break; \ +- case VIPS_FORMAT_SHORT: OPERATION( signed short ); break; \ +- case VIPS_FORMAT_UINT: OPERATION( unsigned int ); break; \ +- case VIPS_FORMAT_INT: OPERATION( signed int ); break; \ +- case VIPS_FORMAT_FLOAT: OPERATION( float ); break; \ +- case VIPS_FORMAT_DOUBLE: OPERATION( double ); break; \ +- \ ++ } ++ ++#define SWITCH(OPERATION) \ ++ switch (in[0]->BandFmt) { \ ++ case VIPS_FORMAT_UCHAR: \ ++ OPERATION(unsigned char); \ ++ break; \ ++ case VIPS_FORMAT_CHAR: \ ++ OPERATION(signed char); \ ++ break; \ ++ case VIPS_FORMAT_USHORT: \ ++ OPERATION(unsigned short); \ ++ break; \ ++ case VIPS_FORMAT_SHORT: \ ++ OPERATION(signed short); \ ++ break; \ ++ case VIPS_FORMAT_UINT: \ ++ OPERATION(unsigned int); \ ++ break; \ ++ case VIPS_FORMAT_INT: \ ++ OPERATION(signed int); \ ++ break; \ ++ case VIPS_FORMAT_FLOAT: \ ++ OPERATION(float); \ ++ break; \ ++ case VIPS_FORMAT_DOUBLE: \ ++ OPERATION(double); \ ++ break; \ ++\ + default: \ + g_assert_not_reached(); \ +- } ++ } + + /* Sort input band elements in the stack. Needs to be big enough for + * sizeof(band-element) * number-of-images. + */ + static void +-vips_bandrank_buffer( VipsBandarySequence *seq, +- VipsPel *q, VipsPel **p, int width ) ++vips_bandrank_buffer(VipsBandarySequence *seq, ++ VipsPel *q, VipsPel **p, int width) + { + VipsBandary *bandary = seq->bandary; + VipsBandrank *bandrank = (VipsBandrank *) bandary; + VipsImage **in = bandary->ready; +- int sz = width * in[0]->Bands; ++ int sz = width * in[0]->Bands; + VipsPel *sort_buffer = seq->pixels; + + int i, j, k; +@@ -162,93 +181,92 @@ vips_bandrank_buffer( VipsBandarySequence *seq, + + /* Special-case max and min. + */ +- if( bandrank->index == 0 ) +- SWITCH( FIND_MIN ) +- else if( bandrank->index == bandary->n - 1 ) +- SWITCH( FIND_MAX ) ++ if (bandrank->index == 0) ++ SWITCH(FIND_MIN) ++ else if (bandrank->index == bandary->n - 1) ++ SWITCH(FIND_MAX) + else +- SWITCH( FIND_RANK ) ++ SWITCH(FIND_RANK) + } + + static int +-vips_bandrank_build( VipsObject *object ) ++vips_bandrank_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsBandary *bandary = (VipsBandary *) object; + VipsBandrank *bandrank = (VipsBandrank *) object; + +- if( bandrank->in ) { ++ if (bandrank->in) { + int n; +- VipsImage **in = vips_array_image_get( bandrank->in, &n ); +- VipsImage **band = (VipsImage **) +- vips_object_local_array( object, n ); ++ VipsImage **in = vips_array_image_get(bandrank->in, &n); ++ VipsImage **band = (VipsImage **) ++ vips_object_local_array(object, n); + + int i; + +- for( i = 0; i < n; i++ ) +- if( vips_check_noncomplex( class->nickname, in[i] ) ) +- return( -1 ); ++ for (i = 0; i < n; i++) ++ if (vips_check_noncomplex(class->nickname, in[i])) ++ return (-1); + +- if( n == 1 ) { ++ if (n == 1) { + bandary->in = in; + bandary->n = 1; + +- return( vips_bandary_copy( bandary ) ); ++ return (vips_bandary_copy(bandary)); + } + +- if( vips__bandalike_vec( class->nickname, in, band, n, 0 ) ) +- return( -1 ); ++ if (vips__bandalike_vec(class->nickname, in, band, n, 0)) ++ return (-1); + + bandary->in = band; + bandary->n = n; + bandary->out_bands = band[0]->Bands; + +- if( bandrank->index == -1 ) +- bandrank->index = bandary->n / 2; ++ if (bandrank->index == -1) ++ bandrank->index = bandary->n / 2; + } + +- if( VIPS_OBJECT_CLASS( vips_bandrank_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_bandrank_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_bandrank_class_init( VipsBandrankClass *class ) ++vips_bandrank_class_init(VipsBandrankClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsBandaryClass *bandary_class = VIPS_BANDARY_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsBandaryClass *bandary_class = VIPS_BANDARY_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_bandrank_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_bandrank_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "bandrank"; +- vobject_class->description = _( "band-wise rank of a set of images" ); ++ vobject_class->description = _("band-wise rank of a set of images"); + vobject_class->build = vips_bandrank_build; + + bandary_class->process_line = vips_bandrank_buffer; + +- VIPS_ARG_BOXED( class, "in", 0, +- _( "Input" ), +- _( "Array of input images" ), ++ VIPS_ARG_BOXED(class, "in", 0, ++ _("Input"), ++ _("Array of input images"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBandrank, in ), +- VIPS_TYPE_ARRAY_IMAGE ); ++ G_STRUCT_OFFSET(VipsBandrank, in), ++ VIPS_TYPE_ARRAY_IMAGE); + +- VIPS_ARG_INT( class, "index", 0, +- _( "Index" ), +- _( "Select this band element from sorted list" ), ++ VIPS_ARG_INT(class, "index", 0, ++ _("Index"), ++ _("Select this band element from sorted list"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsBandrank, index ), +- -1, 1000000, -1 ); +- ++ G_STRUCT_OFFSET(VipsBandrank, index), ++ -1, 1000000, -1); + } + + static void +-vips_bandrank_init( VipsBandrank *bandrank ) ++vips_bandrank_init(VipsBandrank *bandrank) + { + /* -1 means median. + */ +@@ -256,16 +274,16 @@ vips_bandrank_init( VipsBandrank *bandrank ) + } + + static int +-vips_bandrankv( VipsImage **in, VipsImage **out, int n, va_list ap ) ++vips_bandrankv(VipsImage **in, VipsImage **out, int n, va_list ap) + { +- VipsArrayImage *array; ++ VipsArrayImage *array; + int result; + +- array = vips_array_image_new( in, n ); +- result = vips_call_split( "bandrank", ap, array, out ); +- vips_area_unref( VIPS_AREA( array ) ); ++ array = vips_array_image_new(in, n); ++ result = vips_call_split("bandrank", ap, array, out); ++ vips_area_unref(VIPS_AREA(array)); + +- return( result ); ++ return (result); + } + + /** +@@ -279,19 +297,19 @@ vips_bandrankv( VipsImage **in, VipsImage **out, int n, va_list ap ) + * + * * @index: pick this index from list of sorted values + * +- * Sorts the images @in band-element-wise, then outputs an +- * image in which each band element is selected from the sorted list by the ++ * Sorts the images @in band-element-wise, then outputs an ++ * image in which each band element is selected from the sorted list by the + * @index parameter. For example, if @index +- * is zero, then each output band element will be the minimum of all the +- * corresponding input band elements. ++ * is zero, then each output band element will be the minimum of all the ++ * corresponding input band elements. + * +- * By default, @index is -1, meaning pick the median value. ++ * By default, @index is -1, meaning pick the median value. + * + * It works for any uncoded, non-complex image type. Images are cast up to the + * smallest common-format. + * + * Any image can have either 1 band or n bands, where n is the same for all +- * the non-1-band images. Single band images are then effectively copied to ++ * the non-1-band images. Single band images are then effectively copied to + * make n-band images. + * + * Smaller input images are expanded by adding black pixels. +@@ -301,15 +319,14 @@ vips_bandrankv( VipsImage **in, VipsImage **out, int n, va_list ap ) + * Returns: 0 on success, -1 on error + */ + int +-vips_bandrank( VipsImage **in, VipsImage **out, int n, ... ) ++vips_bandrank(VipsImage **in, VipsImage **out, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_bandrankv( in, out, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_bandrankv(in, out, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/conversion/bandunfold.c b/libvips/conversion/bandunfold.c +index 9f2777d608..62ebeef3b9 100644 +--- a/libvips/conversion/bandunfold.c ++++ b/libvips/conversion/bandunfold.c +@@ -1,4 +1,4 @@ +-/* Fold up x into bands. ++/* Fold up x into bands. + * + * 5/6/15 + * - from copy.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -66,19 +66,19 @@ typedef struct _VipsBandunfold { + + typedef VipsConversionClass VipsBandunfoldClass; + +-G_DEFINE_TYPE( VipsBandunfold, vips_bandunfold, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsBandunfold, vips_bandunfold, VIPS_TYPE_CONVERSION); + + static int +-vips_bandunfold_gen( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_bandunfold_gen(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsBandunfold *bandunfold = (VipsBandunfold *) b; + VipsRegion *ir = (VipsRegion *) seq; + VipsImage *in = ir->im; + VipsImage *out = or->im; +- VipsRect *r = &or->valid; +- int esize = VIPS_IMAGE_SIZEOF_ELEMENT( in ); +- int psize = VIPS_IMAGE_SIZEOF_PEL( out ); ++ VipsRect *r = & or->valid; ++ int esize = VIPS_IMAGE_SIZEOF_ELEMENT(in); ++ int psize = VIPS_IMAGE_SIZEOF_PEL(out); + + VipsRect need; + int y; +@@ -87,94 +87,94 @@ vips_bandunfold_gen( VipsRegion *or, + need.top = r->top; + need.width = (1 + r->width) / bandunfold->factor; + need.height = r->height; +- if( vips_region_prepare( ir, &need ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &need)) ++ return (-1); + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( ir, +- r->left / bandunfold->factor, r->top + y ) + ++ for (y = 0; y < r->height; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(ir, ++ r->left / bandunfold->factor, r->top + y) + + (r->left % bandunfold->factor) * esize; +- VipsPel *q = VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ VipsPel *q = VIPS_REGION_ADDR(or, r->left, r->top + y); + + /* We can't use vips_region_region() since we change pixel + * coordinates. + */ +- memcpy( q, p, r->width * psize ); ++ memcpy(q, p, r->width * psize); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_bandunfold_build( VipsObject *object ) ++vips_bandunfold_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsBandunfold *bandunfold = (VipsBandunfold *) object; + +- if( VIPS_OBJECT_CLASS( vips_bandunfold_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_bandunfold_parent_class)->build(object)) ++ return (-1); + +- if( vips_image_pio_input( bandunfold->in ) ) +- return( -1 ); ++ if (vips_image_pio_input(bandunfold->in)) ++ return (-1); + +- if( bandunfold->factor == 0 ) ++ if (bandunfold->factor == 0) + bandunfold->factor = bandunfold->in->Bands; +- if( bandunfold->in->Bands % bandunfold->factor != 0 ) { +- vips_error( class->nickname, +- "%s", _( "@factor must be a factor of image bands" ) ); +- return( -1 ); ++ if (bandunfold->in->Bands % bandunfold->factor != 0) { ++ vips_error(class->nickname, ++ "%s", _("@factor must be a factor of image bands")); ++ return (-1); + } + +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, bandunfold->in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, bandunfold->in, NULL)) ++ return (-1); + + conversion->out->Xsize *= bandunfold->factor; + conversion->out->Bands /= bandunfold->factor; + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_bandunfold_gen, vips_stop_one, +- bandunfold->in, bandunfold ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_bandunfold_gen, vips_stop_one, ++ bandunfold->in, bandunfold)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_bandunfold_class_init( VipsBandunfoldClass *class ) ++vips_bandunfold_class_init(VipsBandunfoldClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_bandunfold_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_bandunfold_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "bandunfold"; +- vobject_class->description = _( "unfold image bands into x axis" ); ++ vobject_class->description = _("unfold image bands into x axis"); + vobject_class->build = vips_bandunfold_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBandunfold, in ) ); ++ G_STRUCT_OFFSET(VipsBandunfold, in)); + +- VIPS_ARG_INT( class, "factor", 11, +- _( "Factor" ), +- _( "Unfold by this factor" ), ++ VIPS_ARG_INT(class, "factor", 11, ++ _("Factor"), ++ _("Unfold by this factor"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsBandunfold, factor ), +- 0, 10000000, 0 ); ++ G_STRUCT_OFFSET(VipsBandunfold, factor), ++ 0, 10000000, 0); + } + + static void +-vips_bandunfold_init( VipsBandunfold *bandunfold ) ++vips_bandunfold_init(VipsBandunfold *bandunfold) + { + /* 0 means unfold by width, see above. + */ +@@ -191,9 +191,9 @@ vips_bandunfold_init( VipsBandunfold *bandunfold ) + * + * * @factor: unfold by this factor + * +- * Unfold image bands into x axis. ++ * Unfold image bands into x axis. + * Use @factor to set how much to unfold by: @factor 3, for example, will make +- * the output image three times wider than the input, and with one third ++ * the output image three times wider than the input, and with one third + * as many bands. By default, all bands are unfolded. + * + * See also: vips_csvload(), vips_bandfold(). +@@ -201,14 +201,14 @@ vips_bandunfold_init( VipsBandunfold *bandunfold ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_bandunfold( VipsImage *in, VipsImage **out, ... ) ++vips_bandunfold(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "bandunfold", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("bandunfold", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/byteswap.c b/libvips/conversion/byteswap.c +index 0f465fba58..03bea0cca1 100644 +--- a/libvips/conversion/byteswap.c ++++ b/libvips/conversion/byteswap.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -64,154 +64,153 @@ typedef struct _VipsByteswap { + + typedef VipsConversionClass VipsByteswapClass; + +-G_DEFINE_TYPE( VipsByteswap, vips_byteswap, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsByteswap, vips_byteswap, VIPS_TYPE_CONVERSION); + + /* Swap pairs of bytes. + */ + static void +-vips_byteswap_swap2( VipsPel *in, VipsPel *out, int width, VipsImage *im ) +-{ ++vips_byteswap_swap2(VipsPel *in, VipsPel *out, int width, VipsImage *im) ++{ + guint16 *p = (guint16 *) in; + guint16 *q = (guint16 *) out; +- int sz = (VIPS_IMAGE_SIZEOF_PEL( im ) * width) / 2; ++ int sz = (VIPS_IMAGE_SIZEOF_PEL(im) * width) / 2; + +- int x; ++ int x; + +- for( x = 0; x < sz; x++ ) +- q[x] = GUINT16_SWAP_LE_BE( p[x] ); ++ for (x = 0; x < sz; x++) ++ q[x] = GUINT16_SWAP_LE_BE(p[x]); + } + + /* Swap 4- of bytes. + */ + static void +-vips_byteswap_swap4( VipsPel *in, VipsPel *out, int width, VipsImage *im ) ++vips_byteswap_swap4(VipsPel *in, VipsPel *out, int width, VipsImage *im) + { + guint32 *p = (guint32 *) in; + guint32 *q = (guint32 *) out; +- int sz = (VIPS_IMAGE_SIZEOF_PEL( im ) * width) / 4; ++ int sz = (VIPS_IMAGE_SIZEOF_PEL(im) * width) / 4; + +- int x; ++ int x; + +- for( x = 0; x < sz; x++ ) +- q[x] = GUINT32_SWAP_LE_BE( p[x] ); ++ for (x = 0; x < sz; x++) ++ q[x] = GUINT32_SWAP_LE_BE(p[x]); + } + + /* Swap 8- of bytes. + */ + static void +-vips_byteswap_swap8( VipsPel *in, VipsPel *out, int width, VipsImage *im ) ++vips_byteswap_swap8(VipsPel *in, VipsPel *out, int width, VipsImage *im) + { + guint64 *p = (guint64 *) in; + guint64 *q = (guint64 *) out; +- int sz = (VIPS_IMAGE_SIZEOF_PEL( im ) * width) / 8; ++ int sz = (VIPS_IMAGE_SIZEOF_PEL(im) * width) / 8; + +- int x; ++ int x; + +- for( x = 0; x < sz; x++ ) +- q[x] = GUINT64_SWAP_LE_BE( p[x] ); ++ for (x = 0; x < sz; x++) ++ q[x] = GUINT64_SWAP_LE_BE(p[x]); + } + +-typedef void (*SwapFn)( VipsPel *in, VipsPel *out, int width, VipsImage *im ); ++typedef void (*SwapFn)(VipsPel *in, VipsPel *out, int width, VipsImage *im); + + static SwapFn vips_byteswap_swap_fn[] = { +- NULL, /* VIPS_FORMAT_UCHAR = 0, */ +- NULL, /* VIPS_FORMAT_CHAR = 1, */ +- vips_byteswap_swap2, /* VIPS_FORMAT_USHORT = 2, */ +- vips_byteswap_swap2, /* VIPS_FORMAT_SHORT = 3, */ +- vips_byteswap_swap4, /* VIPS_FORMAT_UINT = 4, */ +- vips_byteswap_swap4, /* VIPS_FORMAT_INT = 5, */ +- vips_byteswap_swap4, /* VIPS_FORMAT_FLOAT = 6, */ +- vips_byteswap_swap4, /* VIPS_FORMAT_COMPLEX = 7, */ +- vips_byteswap_swap8, /* VIPS_FORMAT_DOUBLE = 8, */ +- vips_byteswap_swap8 /* VIPS_FORMAT_DPCOMPLEX = 9, */ ++ NULL, /* VIPS_FORMAT_UCHAR = 0, */ ++ NULL, /* VIPS_FORMAT_CHAR = 1, */ ++ vips_byteswap_swap2, /* VIPS_FORMAT_USHORT = 2, */ ++ vips_byteswap_swap2, /* VIPS_FORMAT_SHORT = 3, */ ++ vips_byteswap_swap4, /* VIPS_FORMAT_UINT = 4, */ ++ vips_byteswap_swap4, /* VIPS_FORMAT_INT = 5, */ ++ vips_byteswap_swap4, /* VIPS_FORMAT_FLOAT = 6, */ ++ vips_byteswap_swap4, /* VIPS_FORMAT_COMPLEX = 7, */ ++ vips_byteswap_swap8, /* VIPS_FORMAT_DOUBLE = 8, */ ++ vips_byteswap_swap8 /* VIPS_FORMAT_DPCOMPLEX = 9, */ + }; + + /* Byteswap, turning bands into the x axis. + */ + static int +-vips_byteswap_gen( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_byteswap_gen(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + VipsImage *im = ir->im; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + SwapFn swap = vips_byteswap_swap_fn[im->BandFmt]; + + int y; + +- g_assert( swap ); ++ g_assert(swap); + +- if( vips_region_prepare( ir, r ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, r)) ++ return (-1); + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( ir, r->left, r->top + y ); +- VipsPel *q = VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(ir, r->left, r->top + y); ++ VipsPel *q = VIPS_REGION_ADDR(or, r->left, r->top + y); + +- swap( p, q, r->width, im ); ++ swap(p, q, r->width, im); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_byteswap_build( VipsObject *object ) ++vips_byteswap_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsByteswap *byteswap = (VipsByteswap *) object; + +- if( VIPS_OBJECT_CLASS( vips_byteswap_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_byteswap_parent_class)->build(object)) ++ return (-1); + + /* Lots of images don't need swapping. + */ +- if( byteswap->in->Coding != VIPS_CODING_NONE || +- !vips_byteswap_swap_fn[byteswap->in->BandFmt] ) +- return( vips_image_write( byteswap->in, conversion->out ) ); ++ if (byteswap->in->Coding != VIPS_CODING_NONE || ++ !vips_byteswap_swap_fn[byteswap->in->BandFmt]) ++ return (vips_image_write(byteswap->in, conversion->out)); + +- if( vips_image_pio_input( byteswap->in ) ) +- return( -1 ); ++ if (vips_image_pio_input(byteswap->in)) ++ return (-1); + +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, byteswap->in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, byteswap->in, NULL)) ++ return (-1); + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_byteswap_gen, vips_stop_one, +- byteswap->in, byteswap ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_byteswap_gen, vips_stop_one, ++ byteswap->in, byteswap)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_byteswap_class_init( VipsByteswapClass *class ) ++vips_byteswap_class_init(VipsByteswapClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_byteswap_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_byteswap_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "byteswap"; +- vobject_class->description = _( "byteswap an image" ); ++ vobject_class->description = _("byteswap an image"); + vobject_class->build = vips_byteswap_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsByteswap, in ) ); +- ++ G_STRUCT_OFFSET(VipsByteswap, in)); + } + + static void +-vips_byteswap_init( VipsByteswap *byteswap ) ++vips_byteswap_init(VipsByteswap *byteswap) + { + } + +@@ -221,32 +220,32 @@ vips_byteswap_init( VipsByteswap *byteswap ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Swap the byte order in an image. ++ * Swap the byte order in an image. + * + * See also: vips_rawload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_byteswap( VipsImage *in, VipsImage **out, ... ) ++vips_byteswap(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "byteswap", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("byteswap", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /* Convenience function: swap if @swap is %TRUE, otherwise copy. + */ + int +-vips__byteswap_bool( VipsImage *in, VipsImage **out, gboolean swap ) ++vips__byteswap_bool(VipsImage *in, VipsImage **out, gboolean swap) + { +- if( swap ) +- return( vips_byteswap( in, out, NULL ) ); ++ if (swap) ++ return (vips_byteswap(in, out, NULL)); + else +- return( vips_copy( in, out, NULL ) ); ++ return (vips_copy(in, out, NULL)); + } +diff --git a/libvips/conversion/cache.c b/libvips/conversion/cache.c +index 2e9f992cf3..cc84518293 100644 +--- a/libvips/conversion/cache.c ++++ b/libvips/conversion/cache.c +@@ -1,4 +1,4 @@ +-/* vips_sink_screen() as an operation. ++/* vips_sink_screen() as an operation. + * + * 13/1/12 + * - from tilecache.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a cache of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a cache of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -54,80 +54,79 @@ typedef struct _VipsCache { + VipsConversion parent_instance; + + VipsImage *in; +- int tile_width; ++ int tile_width; + int tile_height; + int max_tiles; + } VipsCache; + + typedef VipsConversionClass VipsCacheClass; + +-G_DEFINE_TYPE( VipsCache, vips_cache, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsCache, vips_cache, VIPS_TYPE_CONVERSION); + + static int +-vips_cache_build( VipsObject *object ) ++vips_cache_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsCache *cache = (VipsCache *) object; + +- VIPS_DEBUG_MSG( "vips_cache_build\n" ); ++ VIPS_DEBUG_MSG("vips_cache_build\n"); + +- if( VIPS_OBJECT_CLASS( vips_cache_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_cache_parent_class)->build(object)) ++ return (-1); + +- if( vips_sink_screen( cache->in, conversion->out, NULL, +- cache->tile_width, cache->tile_height, cache->max_tiles, +- 0, NULL, NULL ) ) +- return( -1 ); ++ if (vips_sink_screen(cache->in, conversion->out, NULL, ++ cache->tile_width, cache->tile_height, cache->max_tiles, ++ 0, NULL, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_cache_class_init( VipsCacheClass *class ) ++vips_cache_class_init(VipsCacheClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_cache_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_cache_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "cache"; +- vobject_class->description = _( "cache an image" ); ++ vobject_class->description = _("cache an image"); + vobject_class->build = vips_cache_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsCache, in ) ); ++ G_STRUCT_OFFSET(VipsCache, in)); + +- VIPS_ARG_INT( class, "tile_width", 3, +- _( "Tile width" ), +- _( "Tile width in pixels" ), ++ VIPS_ARG_INT(class, "tile_width", 3, ++ _("Tile width"), ++ _("Tile width in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCache, tile_width ), +- 1, 1000000, 128 ); ++ G_STRUCT_OFFSET(VipsCache, tile_width), ++ 1, 1000000, 128); + +- VIPS_ARG_INT( class, "tile_height", 3, +- _( "Tile height" ), +- _( "Tile height in pixels" ), ++ VIPS_ARG_INT(class, "tile_height", 3, ++ _("Tile height"), ++ _("Tile height in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCache, tile_height ), +- 1, 1000000, 128 ); ++ G_STRUCT_OFFSET(VipsCache, tile_height), ++ 1, 1000000, 128); + +- VIPS_ARG_INT( class, "max_tiles", 3, +- _( "Max tiles" ), +- _( "Maximum number of tiles to cache" ), ++ VIPS_ARG_INT(class, "max_tiles", 3, ++ _("Max tiles"), ++ _("Maximum number of tiles to cache"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCache, max_tiles ), +- -1, 1000000, 1000 ); +- ++ G_STRUCT_OFFSET(VipsCache, max_tiles), ++ -1, 1000000, 1000); + } + + static void +-vips_cache_init( VipsCache *cache ) ++vips_cache_init(VipsCache *cache) + { + /* By default, enough pixels for two 1920 x 1080 displays. + */ +@@ -149,34 +148,34 @@ vips_cache_init( VipsCache *cache ) + * * @max_tiles: maximum number of tiles to cache + * + * This operation behaves rather like vips_copy() between images +- * @in and @out, except that it keeps a cache of computed pixels. +- * This cache is made of up to @max_tiles tiles (a value of -1 ++ * @in and @out, except that it keeps a cache of computed pixels. ++ * This cache is made of up to @max_tiles tiles (a value of -1 + * means any number of tiles), and each tile is of size @tile_width + * by @tile_height pixels. By default it will cache 250 128 x 128 pixel tiles, +- * enough for two 1920 x 1080 images. ++ * enough for two 1920 x 1080 images. + * + * This operation is a thin wrapper over vips_sink_screen(), see the +- * documentation for that operation for details. ++ * documentation for that operation for details. + * + * It uses a set of background threads to calculate pixels and the various + * active cache operations coordinate so as not to overwhelm your system. When + * a request is made for an area of pixels, the operation will block until all + * of those pixels have been calculated. Pixels are calculated with a set of +- * threads. ++ * threads. + * + * See also: vips_tilecache(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_cache( VipsImage *in, VipsImage **out, ... ) ++vips_cache(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "cache", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("cache", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/cast.c b/libvips/conversion/cast.c +index 78c1ffdaa5..89e0333a65 100644 +--- a/libvips/conversion/cast.c ++++ b/libvips/conversion/cast.c +@@ -2,7 +2,7 @@ + * + * Author: Nicos Dessipris + * Written on: 07/03/1991 +- * Modified on: ++ * Modified on: + * 04/05/1992 JC + * - works for char, uchar too + * - floating point code removed from integer clip operations +@@ -60,28 +60,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -116,432 +116,445 @@ typedef struct _VipsCast { + + typedef VipsConversionClass VipsCastClass; + +-G_DEFINE_TYPE( VipsCast, vips_cast, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsCast, vips_cast, VIPS_TYPE_CONVERSION); + + /* Cast down from an int. + */ +-#define CAST_UCHAR( X ) VIPS_CLIP( 0, (X), UCHAR_MAX ) +-#define CAST_CHAR( X ) VIPS_CLIP( SCHAR_MIN, (X), SCHAR_MAX ) +-#define CAST_USHORT( X ) VIPS_CLIP( 0, (X), USHRT_MAX ) +-#define CAST_SHORT( X ) VIPS_CLIP( SHRT_MIN, (X), SHRT_MAX ) ++#define CAST_UCHAR(X) VIPS_CLIP(0, (X), UCHAR_MAX) ++#define CAST_CHAR(X) VIPS_CLIP(SCHAR_MIN, (X), SCHAR_MAX) ++#define CAST_USHORT(X) VIPS_CLIP(0, (X), USHRT_MAX) ++#define CAST_SHORT(X) VIPS_CLIP(SHRT_MIN, (X), SHRT_MAX) + +-/* These cast down from gint64 to uint32 or int32. ++/* These cast down from gint64 to uint32 or int32. + */ +-#define CAST_UINT( X ) VIPS_CLIP( 0, (X), UINT_MAX ) +-#define CAST_INT( X ) VIPS_CLIP( INT_MIN, (X), INT_MAX ) ++#define CAST_UINT(X) VIPS_CLIP(0, (X), UINT_MAX) ++#define CAST_INT(X) VIPS_CLIP(INT_MIN, (X), INT_MAX) + + /* Rightshift an integer type, ie. sizeof(ITYPE) >= sizeof(OTYPE). + * + * If we're casting between two formats of the same size (eg. ushort to + * short), sizes can be equal. + */ +-#define SHIFT_RIGHT( ITYPE, OTYPE ) { \ +- ITYPE * restrict p = (ITYPE *) in; \ +- OTYPE * restrict q = (OTYPE *) out; \ +- int n = ((int) sizeof( ITYPE ) << 3) - ((int) sizeof( OTYPE ) << 3); \ +- \ +- g_assert( sizeof( ITYPE ) >= sizeof( OTYPE ) ); \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = p[x] >> n; \ +-} ++#define SHIFT_RIGHT(ITYPE, OTYPE) \ ++ { \ ++ ITYPE *restrict p = (ITYPE *) in; \ ++ OTYPE *restrict q = (OTYPE *) out; \ ++ int n = ((int) sizeof(ITYPE) << 3) - ((int) sizeof(OTYPE) << 3); \ ++\ ++ g_assert(sizeof(ITYPE) >= sizeof(OTYPE)); \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = p[x] >> n; \ ++ } + + /* Leftshift an integer type, ie. sizeof(ITYPE) <= sizeof(OTYPE). We need to + * copy the bottom bit up into the fresh new bits. + */ +-#define SHIFT_LEFT( ITYPE, OTYPE ) { \ +- ITYPE * restrict p = (ITYPE *) in; \ +- OTYPE * restrict q = (OTYPE *) out; \ +- int n = ((int) sizeof( OTYPE ) << 3) - ((int) sizeof( ITYPE ) << 3); \ +- \ +- g_assert( sizeof( ITYPE ) <= sizeof( OTYPE ) ); \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = (p[x] << n) | (((p[x] & 1) << n) - (p[x] & 1)); \ +-} ++#define SHIFT_LEFT(ITYPE, OTYPE) \ ++ { \ ++ ITYPE *restrict p = (ITYPE *) in; \ ++ OTYPE *restrict q = (OTYPE *) out; \ ++ int n = ((int) sizeof(OTYPE) << 3) - ((int) sizeof(ITYPE) << 3); \ ++\ ++ g_assert(sizeof(ITYPE) <= sizeof(OTYPE)); \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = (p[x] << n) | (((p[x] & 1) << n) - (p[x] & 1)); \ ++ } + +-#define SHIFT_LEFT_SIGNED( ITYPE, OTYPE ) { \ +- ITYPE * restrict p = (ITYPE *) in; \ +- OTYPE * restrict q = (OTYPE *) out; \ +- int n = ((int) sizeof( OTYPE ) << 3) - ((int) sizeof( ITYPE ) << 3); \ +- \ +- g_assert( sizeof( ITYPE ) <= sizeof( OTYPE ) ); \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = VIPS_LSHIFT_INT( p[x], n ) | \ +- (((p[x] & 1) << n) - (p[x] & 1)); \ +-} ++#define SHIFT_LEFT_SIGNED(ITYPE, OTYPE) \ ++ { \ ++ ITYPE *restrict p = (ITYPE *) in; \ ++ OTYPE *restrict q = (OTYPE *) out; \ ++ int n = ((int) sizeof(OTYPE) << 3) - ((int) sizeof(ITYPE) << 3); \ ++\ ++ g_assert(sizeof(ITYPE) <= sizeof(OTYPE)); \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = VIPS_LSHIFT_INT(p[x], n) | \ ++ (((p[x] & 1) << n) - (p[x] & 1)); \ ++ } + + /* Cast int types to an int type. We need to pass in the type of the + * intermediate value, either int or int64, or we'll have problems with uint + * sources turning -ve. + */ +-#define CAST_INT_INT( ITYPE, OTYPE, TEMP, CAST ) { \ +- ITYPE * restrict p = (ITYPE *) in; \ +- OTYPE * restrict q = (OTYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- TEMP t = (TEMP) p[x]; \ +- \ +- q[x] = CAST( t ); \ +- } \ +-} ++#define CAST_INT_INT(ITYPE, OTYPE, TEMP, CAST) \ ++ { \ ++ ITYPE *restrict p = (ITYPE *) in; \ ++ OTYPE *restrict q = (OTYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ TEMP t = (TEMP) p[x]; \ ++\ ++ q[x] = CAST(t); \ ++ } \ ++ } + +-/* Int to int handling. ++/* Int to int handling. + */ +-#define INT_INT( ITYPE, OTYPE, TEMP, CAST ) { \ +- if( cast->shift && \ +- sizeof( ITYPE ) > sizeof( OTYPE ) ) { \ +- SHIFT_RIGHT( ITYPE, OTYPE ); \ +- } \ +- else if( cast->shift ) { \ +- SHIFT_LEFT( ITYPE, OTYPE ); \ +- } \ +- else { \ +- CAST_INT_INT( ITYPE, OTYPE, TEMP, CAST ); \ +- } \ +-} +- +-/* Int to int handling for signed int types. ++#define INT_INT(ITYPE, OTYPE, TEMP, CAST) \ ++ { \ ++ if (cast->shift && \ ++ sizeof(ITYPE) > sizeof(OTYPE)) { \ ++ SHIFT_RIGHT(ITYPE, OTYPE); \ ++ } \ ++ else if (cast->shift) { \ ++ SHIFT_LEFT(ITYPE, OTYPE); \ ++ } \ ++ else { \ ++ CAST_INT_INT(ITYPE, OTYPE, TEMP, CAST); \ ++ } \ ++ } ++ ++/* Int to int handling for signed int types. + */ +-#define INT_INT_SIGNED( ITYPE, OTYPE, TEMP, CAST ) { \ +- if( cast->shift && \ +- sizeof( ITYPE ) > sizeof( OTYPE ) ) { \ +- SHIFT_RIGHT( ITYPE, OTYPE ); \ +- } \ +- else if( cast->shift ) { \ +- SHIFT_LEFT_SIGNED( ITYPE, OTYPE ); \ +- } \ +- else { \ +- CAST_INT_INT( ITYPE, OTYPE, TEMP, CAST ); \ +- } \ +-} ++#define INT_INT_SIGNED(ITYPE, OTYPE, TEMP, CAST) \ ++ { \ ++ if (cast->shift && \ ++ sizeof(ITYPE) > sizeof(OTYPE)) { \ ++ SHIFT_RIGHT(ITYPE, OTYPE); \ ++ } \ ++ else if (cast->shift) { \ ++ SHIFT_LEFT_SIGNED(ITYPE, OTYPE); \ ++ } \ ++ else { \ ++ CAST_INT_INT(ITYPE, OTYPE, TEMP, CAST); \ ++ } \ ++ } + + /* Cast float types to an int type. + * + * We need to do the range clip as double or we'll get errors for int max, + * since that can't be represented as a 32-bit float. + */ +-#define CAST_FLOAT_INT( ITYPE, OTYPE, TEMP, CAST ) { \ +- ITYPE * restrict p = (ITYPE *) in; \ +- OTYPE * restrict q = (OTYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = CAST( (double) p[x] ); \ +-} ++#define CAST_FLOAT_INT(ITYPE, OTYPE, TEMP, CAST) \ ++ { \ ++ ITYPE *restrict p = (ITYPE *) in; \ ++ OTYPE *restrict q = (OTYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = CAST((double) p[x]); \ ++ } + + /* Cast complex types to an int type. Just take the real part. + * + * We need to do the range clip as double or we'll get errors for int max, + * since that can't be represented as a 32-bit float. + */ +-#define CAST_COMPLEX_INT( ITYPE, OTYPE, TEMP, CAST ) { \ +- ITYPE * restrict p = (ITYPE *) in; \ +- OTYPE * restrict q = (OTYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- q[x] = CAST( (double) p[0] ); \ +- p += 2; \ +- } \ +-} ++#define CAST_COMPLEX_INT(ITYPE, OTYPE, TEMP, CAST) \ ++ { \ ++ ITYPE *restrict p = (ITYPE *) in; \ ++ OTYPE *restrict q = (OTYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ q[x] = CAST((double) p[0]); \ ++ p += 2; \ ++ } \ ++ } + + /* Cast non-complex types to a float type. + */ +-#define CAST_REAL_FLOAT( ITYPE, OTYPE ) { \ +- ITYPE * restrict p = (ITYPE *) in; \ +- OTYPE * restrict q = (OTYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = p[x]; \ +-} ++#define CAST_REAL_FLOAT(ITYPE, OTYPE) \ ++ { \ ++ ITYPE *restrict p = (ITYPE *) in; \ ++ OTYPE *restrict q = (OTYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = p[x]; \ ++ } + + /* Cast complex types to a float type ... just take real. + */ +-#define CAST_COMPLEX_FLOAT( ITYPE, OTYPE ) { \ +- ITYPE * restrict p = (ITYPE *) in; \ +- OTYPE * restrict q = (OTYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- q[x] = p[0]; \ +- p += 2; \ +- } \ +-} ++#define CAST_COMPLEX_FLOAT(ITYPE, OTYPE) \ ++ { \ ++ ITYPE *restrict p = (ITYPE *) in; \ ++ OTYPE *restrict q = (OTYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ q[x] = p[0]; \ ++ p += 2; \ ++ } \ ++ } + + /* Cast any non-complex to a complex type ... set imaginary to zero. + */ +-#define CAST_REAL_COMPLEX( ITYPE, OTYPE ) { \ +- ITYPE * restrict p = (ITYPE *) in; \ +- OTYPE * restrict q = (OTYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- q[0] = p[x]; \ +- q[1] = 0.0; \ +- q += 2; \ +- } \ +-} ++#define CAST_REAL_COMPLEX(ITYPE, OTYPE) \ ++ { \ ++ ITYPE *restrict p = (ITYPE *) in; \ ++ OTYPE *restrict q = (OTYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ q[0] = p[x]; \ ++ q[1] = 0.0; \ ++ q += 2; \ ++ } \ ++ } + + /* Cast any complex to a complex type. + */ +-#define CAST_COMPLEX_COMPLEX( ITYPE, OTYPE ) { \ +- ITYPE * restrict p = (ITYPE *) in; \ +- OTYPE * restrict q = (OTYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- q[0] = p[0]; \ +- q[1] = p[1]; \ +- p += 2; \ +- q += 2; \ +- } \ +-} ++#define CAST_COMPLEX_COMPLEX(ITYPE, OTYPE) \ ++ { \ ++ ITYPE *restrict p = (ITYPE *) in; \ ++ OTYPE *restrict q = (OTYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ q[0] = p[0]; \ ++ q[1] = p[1]; \ ++ p += 2; \ ++ q += 2; \ ++ } \ ++ } + +-#define BAND_SWITCH_INNER( ITYPE, INT, FLOAT, COMPLEX ) { \ +- switch( conversion->out->BandFmt ) { \ +- case VIPS_FORMAT_UCHAR: \ +- INT( ITYPE, unsigned char, int, CAST_UCHAR ); \ +- break; \ +- \ +- case VIPS_FORMAT_CHAR: \ +- INT( ITYPE, signed char, int, CAST_CHAR ); \ +- break; \ +- \ +- case VIPS_FORMAT_USHORT: \ +- INT( ITYPE, unsigned short, int, CAST_USHORT ); \ +- break; \ +- \ +- case VIPS_FORMAT_SHORT: \ +- INT( ITYPE, signed short, int, CAST_SHORT ); \ +- break; \ +- \ +- case VIPS_FORMAT_UINT: \ +- INT( ITYPE, unsigned int, gint64, CAST_UINT ); \ +- break; \ +- \ +- case VIPS_FORMAT_INT: \ +- INT( ITYPE, signed int, gint64, CAST_INT ); \ +- break; \ +- \ +- case VIPS_FORMAT_FLOAT: \ +- FLOAT( ITYPE, float ); \ +- break; \ +- \ +- case VIPS_FORMAT_DOUBLE: \ +- FLOAT( ITYPE, double ); \ +- break; \ +- \ +- case VIPS_FORMAT_COMPLEX: \ +- COMPLEX( ITYPE, float ); \ +- break; \ +- \ +- case VIPS_FORMAT_DPCOMPLEX: \ +- COMPLEX( ITYPE, double ); \ +- break; \ +- \ +- default: \ +- g_assert_not_reached(); \ +- } \ +-} ++#define BAND_SWITCH_INNER(ITYPE, INT, FLOAT, COMPLEX) \ ++ { \ ++ switch (conversion->out->BandFmt) { \ ++ case VIPS_FORMAT_UCHAR: \ ++ INT(ITYPE, unsigned char, int, CAST_UCHAR); \ ++ break; \ ++\ ++ case VIPS_FORMAT_CHAR: \ ++ INT(ITYPE, signed char, int, CAST_CHAR); \ ++ break; \ ++\ ++ case VIPS_FORMAT_USHORT: \ ++ INT(ITYPE, unsigned short, int, CAST_USHORT); \ ++ break; \ ++\ ++ case VIPS_FORMAT_SHORT: \ ++ INT(ITYPE, signed short, int, CAST_SHORT); \ ++ break; \ ++\ ++ case VIPS_FORMAT_UINT: \ ++ INT(ITYPE, unsigned int, gint64, CAST_UINT); \ ++ break; \ ++\ ++ case VIPS_FORMAT_INT: \ ++ INT(ITYPE, signed int, gint64, CAST_INT); \ ++ break; \ ++\ ++ case VIPS_FORMAT_FLOAT: \ ++ FLOAT(ITYPE, float); \ ++ break; \ ++\ ++ case VIPS_FORMAT_DOUBLE: \ ++ FLOAT(ITYPE, double); \ ++ break; \ ++\ ++ case VIPS_FORMAT_COMPLEX: \ ++ COMPLEX(ITYPE, float); \ ++ break; \ ++\ ++ case VIPS_FORMAT_DPCOMPLEX: \ ++ COMPLEX(ITYPE, double); \ ++ break; \ ++\ ++ default: \ ++ g_assert_not_reached(); \ ++ } \ ++ } + + static int +-vips_cast_gen( VipsRegion *or, void *vseq, void *a, void *b, gboolean *stop ) ++vips_cast_gen(VipsRegion * or, void *vseq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) vseq; + VipsCast *cast = (VipsCast *) b; + VipsConversion *conversion = (VipsConversion *) b; +- VipsRect *r = &or->valid; +- int sz = VIPS_REGION_N_ELEMENTS( or ); ++ VipsRect *r = & or->valid; ++ int sz = VIPS_REGION_N_ELEMENTS(or); + + int x, y; + +- if( vips_region_prepare( ir, r ) ) +- return( -1 ); +- +- VIPS_GATE_START( "vips_cast_gen: work" ); +- +- for( y = 0; y < r->height; y++ ) { +- VipsPel *in = VIPS_REGION_ADDR( ir, r->left, r->top + y ); +- VipsPel *out = VIPS_REGION_ADDR( or, r->left, r->top + y ); +- +- switch( ir->im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- BAND_SWITCH_INNER( unsigned char, +- INT_INT, +- CAST_REAL_FLOAT, +- CAST_REAL_COMPLEX ); +- break; +- +- case VIPS_FORMAT_CHAR: +- BAND_SWITCH_INNER( signed char, +- INT_INT_SIGNED, +- CAST_REAL_FLOAT, +- CAST_REAL_COMPLEX ); +- break; +- +- case VIPS_FORMAT_USHORT: +- BAND_SWITCH_INNER( unsigned short, +- INT_INT, +- CAST_REAL_FLOAT, +- CAST_REAL_COMPLEX ); +- break; +- +- case VIPS_FORMAT_SHORT: +- BAND_SWITCH_INNER( signed short, +- INT_INT_SIGNED, +- CAST_REAL_FLOAT, +- CAST_REAL_COMPLEX ); +- break; +- +- case VIPS_FORMAT_UINT: +- BAND_SWITCH_INNER( unsigned int, +- INT_INT, +- CAST_REAL_FLOAT, +- CAST_REAL_COMPLEX ); +- break; +- +- case VIPS_FORMAT_INT: +- BAND_SWITCH_INNER( signed int, +- INT_INT_SIGNED, +- CAST_REAL_FLOAT, +- CAST_REAL_COMPLEX ); +- break; +- +- case VIPS_FORMAT_FLOAT: +- BAND_SWITCH_INNER( float, +- CAST_FLOAT_INT, +- CAST_REAL_FLOAT, +- CAST_REAL_COMPLEX ); +- break; +- +- case VIPS_FORMAT_DOUBLE: +- BAND_SWITCH_INNER( double, +- CAST_FLOAT_INT, +- CAST_REAL_FLOAT, +- CAST_REAL_COMPLEX ); +- break; +- +- case VIPS_FORMAT_COMPLEX: +- BAND_SWITCH_INNER( float, +- CAST_COMPLEX_INT, +- CAST_COMPLEX_FLOAT, +- CAST_COMPLEX_COMPLEX ); +- break; +- +- case VIPS_FORMAT_DPCOMPLEX: +- BAND_SWITCH_INNER( double, +- CAST_COMPLEX_INT, +- CAST_COMPLEX_FLOAT, +- CAST_COMPLEX_COMPLEX ); +- break; +- +- default: +- g_assert_not_reached(); +- } ++ if (vips_region_prepare(ir, r)) ++ return (-1); ++ ++ VIPS_GATE_START("vips_cast_gen: work"); ++ ++ for (y = 0; y < r->height; y++) { ++ VipsPel *in = VIPS_REGION_ADDR(ir, r->left, r->top + y); ++ VipsPel *out = VIPS_REGION_ADDR(or, r->left, r->top + y); ++ ++ switch (ir->im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ BAND_SWITCH_INNER(unsigned char, ++ INT_INT, ++ CAST_REAL_FLOAT, ++ CAST_REAL_COMPLEX); ++ break; ++ ++ case VIPS_FORMAT_CHAR: ++ BAND_SWITCH_INNER(signed char, ++ INT_INT_SIGNED, ++ CAST_REAL_FLOAT, ++ CAST_REAL_COMPLEX); ++ break; ++ ++ case VIPS_FORMAT_USHORT: ++ BAND_SWITCH_INNER(unsigned short, ++ INT_INT, ++ CAST_REAL_FLOAT, ++ CAST_REAL_COMPLEX); ++ break; ++ ++ case VIPS_FORMAT_SHORT: ++ BAND_SWITCH_INNER(signed short, ++ INT_INT_SIGNED, ++ CAST_REAL_FLOAT, ++ CAST_REAL_COMPLEX); ++ break; ++ ++ case VIPS_FORMAT_UINT: ++ BAND_SWITCH_INNER(unsigned int, ++ INT_INT, ++ CAST_REAL_FLOAT, ++ CAST_REAL_COMPLEX); ++ break; ++ ++ case VIPS_FORMAT_INT: ++ BAND_SWITCH_INNER(signed int, ++ INT_INT_SIGNED, ++ CAST_REAL_FLOAT, ++ CAST_REAL_COMPLEX); ++ break; ++ ++ case VIPS_FORMAT_FLOAT: ++ BAND_SWITCH_INNER(float, ++ CAST_FLOAT_INT, ++ CAST_REAL_FLOAT, ++ CAST_REAL_COMPLEX); ++ break; ++ ++ case VIPS_FORMAT_DOUBLE: ++ BAND_SWITCH_INNER(double, ++ CAST_FLOAT_INT, ++ CAST_REAL_FLOAT, ++ CAST_REAL_COMPLEX); ++ break; ++ ++ case VIPS_FORMAT_COMPLEX: ++ BAND_SWITCH_INNER(float, ++ CAST_COMPLEX_INT, ++ CAST_COMPLEX_FLOAT, ++ CAST_COMPLEX_COMPLEX); ++ break; ++ ++ case VIPS_FORMAT_DPCOMPLEX: ++ BAND_SWITCH_INNER(double, ++ CAST_COMPLEX_INT, ++ CAST_COMPLEX_FLOAT, ++ CAST_COMPLEX_COMPLEX); ++ break; ++ ++ default: ++ g_assert_not_reached(); ++ } + } + +- VIPS_GATE_STOP( "vips_cast_gen: work" ); ++ VIPS_GATE_STOP("vips_cast_gen: work"); + +- return( 0 ); ++ return (0); + } + + static int +-vips_cast_build( VipsObject *object ) ++vips_cast_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsCast *cast = (VipsCast *) object; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(object, 2); + +- VipsImage *in; ++ VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_cast_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_cast_parent_class)->build(object)) ++ return (-1); + +- in = cast->in; ++ in = cast->in; + + /* Trivial case: fall back to copy(). + */ +- if( in->BandFmt == cast->format ) +- return( vips_image_write( in, conversion->out ) ); ++ if (in->BandFmt == cast->format) ++ return (vips_image_write(in, conversion->out)); + +- if( vips_image_decode( in, &t[0] ) ) +- return( -1 ); +- in = t[0]; ++ if (vips_image_decode(in, &t[0])) ++ return (-1); ++ in = t[0]; + + /* If @shift is on but we're not in an int format and we're going to +- * an int format, we need to cast to int first. For example, what +- * about a float image tagged as rgb16 being cast to uint8? We need ++ * an int format, we need to cast to int first. For example, what ++ * about a float image tagged as rgb16 being cast to uint8? We need + * to cast to ushort before we do the final cast to uint8. + */ +- if( cast->shift && +- !vips_band_format_isint( in->BandFmt ) && +- vips_band_format_isint( cast->format ) ) { +- if( vips_cast( in, &t[1], +- vips_image_guess_format( in ), NULL ) ) +- return( -1 ); ++ if (cast->shift && ++ !vips_band_format_isint(in->BandFmt) && ++ vips_band_format_isint(cast->format)) { ++ if (vips_cast(in, &t[1], ++ vips_image_guess_format(in), NULL)) ++ return (-1); + in = t[1]; + } + +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, in, NULL)) ++ return (-1); + + conversion->out->BandFmt = cast->format; + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_cast_gen, vips_stop_one, +- in, cast ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_cast_gen, vips_stop_one, ++ in, cast)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_cast_class_init( VipsCastClass *class ) ++vips_cast_class_init(VipsCastClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_cast_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_cast_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "cast"; +- vobject_class->description = _( "cast an image" ); ++ vobject_class->description = _("cast an image"); + vobject_class->build = vips_cast_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsCast, in ) ); ++ G_STRUCT_OFFSET(VipsCast, in)); + +- VIPS_ARG_ENUM( class, "format", 6, +- _( "Format" ), +- _( "Format to cast to" ), ++ VIPS_ARG_ENUM(class, "format", 6, ++ _("Format"), ++ _("Format to cast to"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsCast, format ), +- VIPS_TYPE_BAND_FORMAT, VIPS_FORMAT_UCHAR ); ++ G_STRUCT_OFFSET(VipsCast, format), ++ VIPS_TYPE_BAND_FORMAT, VIPS_FORMAT_UCHAR); + +- VIPS_ARG_BOOL( class, "shift", 7, +- _( "Shift" ), +- _( "Shift integer values up and down" ), ++ VIPS_ARG_BOOL(class, "shift", 7, ++ _("Shift"), ++ _("Shift integer values up and down"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCast, shift ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsCast, shift), ++ FALSE); + } + + static void +-vips_cast_init( VipsCast *cast ) ++vips_cast_init(VipsCast *cast) + { + } + + static int +-vips_castv( VipsImage *in, VipsImage **out, VipsBandFormat format, va_list ap ) ++vips_castv(VipsImage *in, VipsImage **out, VipsBandFormat format, va_list ap) + { +- return( vips_call_split( "cast", ap, in, out, format ) ); ++ return (vips_call_split("cast", ap, in, out, format)); + } + + /** +@@ -558,12 +571,12 @@ vips_castv( VipsImage *in, VipsImage **out, VipsBandFormat format, va_list ap ) + * Convert @in to @format. You can convert between any pair of formats. + * Floats are truncated (not rounded). Out of range values are clipped. + * +- * Casting from complex to real returns the real part. ++ * Casting from complex to real returns the real part. + * + * If @shift is %TRUE, integer values are shifted up and down. For example, + * casting from unsigned 8 bit to unsigned 16 bit would + * shift every value left by 8 bits. The bottom bit is copied into the new +- * bits, so 255 would become 65535. ++ * bits, so 255 would become 65535. + * + * See also: vips_scale(), vips_complexform(), vips_real(), vips_imag(), + * vips_cast_uchar(), vips_msb(). +@@ -571,16 +584,16 @@ vips_castv( VipsImage *in, VipsImage **out, VipsBandFormat format, va_list ap ) + * Returns: 0 on success, -1 on error + */ + int +-vips_cast( VipsImage *in, VipsImage **out, VipsBandFormat format, ... ) ++vips_cast(VipsImage *in, VipsImage **out, VipsBandFormat format, ...) + { + va_list ap; + int result; + +- va_start( ap, format ); +- result = vips_castv( in, out, format, ap ); +- va_end( ap ); ++ va_start(ap, format); ++ result = vips_castv(in, out, format, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -589,21 +602,21 @@ vips_cast( VipsImage *in, VipsImage **out, VipsBandFormat format, ... ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Convert @in to #VIPS_FORMAT_UCHAR. See vips_cast(). ++ * Convert @in to #VIPS_FORMAT_UCHAR. See vips_cast(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_cast_uchar( VipsImage *in, VipsImage **out, ... ) ++vips_cast_uchar(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_castv( in, out, VIPS_FORMAT_UCHAR, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_castv(in, out, VIPS_FORMAT_UCHAR, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -612,21 +625,21 @@ vips_cast_uchar( VipsImage *in, VipsImage **out, ... ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Convert @in to #VIPS_FORMAT_CHAR. See vips_cast(). ++ * Convert @in to #VIPS_FORMAT_CHAR. See vips_cast(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_cast_char( VipsImage *in, VipsImage **out, ... ) ++vips_cast_char(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_castv( in, out, VIPS_FORMAT_CHAR, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_castv(in, out, VIPS_FORMAT_CHAR, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -635,21 +648,21 @@ vips_cast_char( VipsImage *in, VipsImage **out, ... ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Convert @in to #VIPS_FORMAT_USHORT. See vips_cast(). ++ * Convert @in to #VIPS_FORMAT_USHORT. See vips_cast(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_cast_ushort( VipsImage *in, VipsImage **out, ... ) ++vips_cast_ushort(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_castv( in, out, VIPS_FORMAT_USHORT, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_castv(in, out, VIPS_FORMAT_USHORT, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -658,21 +671,21 @@ vips_cast_ushort( VipsImage *in, VipsImage **out, ... ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Convert @in to #VIPS_FORMAT_SHORT. See vips_cast(). ++ * Convert @in to #VIPS_FORMAT_SHORT. See vips_cast(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_cast_short( VipsImage *in, VipsImage **out, ... ) ++vips_cast_short(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_castv( in, out, VIPS_FORMAT_SHORT, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_castv(in, out, VIPS_FORMAT_SHORT, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -681,21 +694,21 @@ vips_cast_short( VipsImage *in, VipsImage **out, ... ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Convert @in to #VIPS_FORMAT_UINT. See vips_cast(). ++ * Convert @in to #VIPS_FORMAT_UINT. See vips_cast(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_cast_uint( VipsImage *in, VipsImage **out, ... ) ++vips_cast_uint(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_castv( in, out, VIPS_FORMAT_UINT, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_castv(in, out, VIPS_FORMAT_UINT, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -704,21 +717,21 @@ vips_cast_uint( VipsImage *in, VipsImage **out, ... ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Convert @in to #VIPS_FORMAT_INT. See vips_cast(). ++ * Convert @in to #VIPS_FORMAT_INT. See vips_cast(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_cast_int( VipsImage *in, VipsImage **out, ... ) ++vips_cast_int(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_castv( in, out, VIPS_FORMAT_INT, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_castv(in, out, VIPS_FORMAT_INT, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -727,21 +740,21 @@ vips_cast_int( VipsImage *in, VipsImage **out, ... ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Convert @in to #VIPS_FORMAT_FLOAT. See vips_cast(). ++ * Convert @in to #VIPS_FORMAT_FLOAT. See vips_cast(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_cast_float( VipsImage *in, VipsImage **out, ... ) ++vips_cast_float(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_castv( in, out, VIPS_FORMAT_FLOAT, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_castv(in, out, VIPS_FORMAT_FLOAT, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -750,21 +763,21 @@ vips_cast_float( VipsImage *in, VipsImage **out, ... ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Convert @in to #VIPS_FORMAT_DOUBLE. See vips_cast(). ++ * Convert @in to #VIPS_FORMAT_DOUBLE. See vips_cast(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_cast_double( VipsImage *in, VipsImage **out, ... ) ++vips_cast_double(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_castv( in, out, VIPS_FORMAT_DOUBLE, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_castv(in, out, VIPS_FORMAT_DOUBLE, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -773,21 +786,21 @@ vips_cast_double( VipsImage *in, VipsImage **out, ... ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Convert @in to #VIPS_FORMAT_COMPLEX. See vips_cast(). ++ * Convert @in to #VIPS_FORMAT_COMPLEX. See vips_cast(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_cast_complex( VipsImage *in, VipsImage **out, ... ) ++vips_cast_complex(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_castv( in, out, VIPS_FORMAT_COMPLEX, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_castv(in, out, VIPS_FORMAT_COMPLEX, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -796,20 +809,19 @@ vips_cast_complex( VipsImage *in, VipsImage **out, ... ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Convert @in to #VIPS_FORMAT_DPCOMPLEX. See vips_cast(). ++ * Convert @in to #VIPS_FORMAT_DPCOMPLEX. See vips_cast(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_cast_dpcomplex( VipsImage *in, VipsImage **out, ... ) ++vips_cast_dpcomplex(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_castv( in, out, VIPS_FORMAT_DPCOMPLEX, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_castv(in, out, VIPS_FORMAT_DPCOMPLEX, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/conversion/composite.cpp b/libvips/conversion/composite.cpp +index b296ea952f..7dc93cb73b 100644 +--- a/libvips/conversion/composite.cpp ++++ b/libvips/conversion/composite.cpp +@@ -19,28 +19,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -76,7 +76,7 @@ + */ + #define MAX_BANDS (64) + +-/* Uncomment to disable the vector path ... handy for debugging. ++/* Uncomment to disable the vector path ... handy for debugging. + #undef HAVE_VECTOR_ARITH + */ + +@@ -85,7 +85,7 @@ + #ifdef HAVE_VECTOR_ARITH + /* A vector of four floats. + */ +-typedef float v4f __attribute__((vector_size(4 * sizeof(float)),aligned(16))); ++typedef float v4f __attribute__((vector_size(4 * sizeof(float)), aligned(16))); + #endif /*HAVE_VECTOR_ARITH*/ + + typedef struct _VipsCompositeBase { +@@ -108,14 +108,14 @@ typedef struct _VipsCompositeBase { + */ + gboolean premultiplied; + +- /* The x and y positions for each image in the stack. There are n - 1 ++ /* The x and y positions for each image in the stack. There are n - 1 + * of these, since image 0 is always positioned at (0, 0). Set by + * subclasses. Can be NULL. + */ + int *x_offset; + int *y_offset; + +- /* A rect for the position of each input image. For each output region, ++ /* A rect for the position of each input image. For each output region, + * we composite the set of input images which intersect that area. + */ + VipsRect *subimages; +@@ -141,26 +141,26 @@ typedef VipsConversionClass VipsCompositeBaseClass; + /* We need C linkage for this. + */ + extern "C" { +-G_DEFINE_ABSTRACT_TYPE( VipsCompositeBase, vips_composite_base, +- VIPS_TYPE_CONVERSION ); ++G_DEFINE_ABSTRACT_TYPE(VipsCompositeBase, vips_composite_base, ++ VIPS_TYPE_CONVERSION); + } + + static void +-vips_composite_base_dispose( GObject *gobject ) ++vips_composite_base_dispose(GObject *gobject) + { + VipsCompositeBase *composite = (VipsCompositeBase *) gobject; + +- if( composite->in ) { +- vips_area_unref( (VipsArea *) composite->in ); ++ if (composite->in) { ++ vips_area_unref((VipsArea *) composite->in); + composite->in = NULL; + } +- if( composite->mode ) { +- vips_area_unref( (VipsArea *) composite->mode ); ++ if (composite->mode) { ++ vips_area_unref((VipsArea *) composite->mode); + composite->mode = NULL; + } +- VIPS_FREE( composite->subimages ); ++ VIPS_FREE(composite->subimages); + +- G_OBJECT_CLASS( vips_composite_base_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_composite_base_parent_class)->dispose(gobject); + } + + /* Our sequence value. +@@ -208,65 +208,66 @@ typedef struct { + * VIPS_FREEF( vips_free_aligned, ptr ); + */ + static inline void * +-vips_alloc_aligned( size_t sz, size_t align ) ++vips_alloc_aligned(size_t sz, size_t align) + { +- g_assert( !(align & (align - 1)) ); ++ g_assert(!(align & (align - 1))); + + #ifdef HAVE__ALIGNED_MALLOC +- return _aligned_malloc( sz, align ); ++ return _aligned_malloc(sz, align); + #elif defined(HAVE_POSIX_MEMALIGN) + void *ptr; +- if( posix_memalign( &ptr, align, sz ) ) return NULL; ++ if (posix_memalign(&ptr, align, sz)) ++ return NULL; + return ptr; + #elif defined(HAVE_MEMALIGN) +- return memalign( align, sz ); ++ return memalign(align, sz); + #else + #error Missing aligned alloc implementation + #endif + } + + static inline void +-vips_free_aligned( void* ptr ) ++vips_free_aligned(void *ptr) + { + #ifdef HAVE__ALIGNED_MALLOC +- _aligned_free( ptr ); ++ _aligned_free(ptr); + #else /*defined(HAVE_POSIX_MEMALIGN) || defined(HAVE_MEMALIGN)*/ +- free( ptr ); ++ free(ptr); + #endif + } + #endif /*HAVE_VECTOR_ARITH*/ + + static int +-vips_composite_stop( void *vseq, void *a, void *b ) ++vips_composite_stop(void *vseq, void *a, void *b) + { + VipsCompositeSequence *seq = (VipsCompositeSequence *) vseq; + +- if( seq->input_regions ) { +- for( int i = 0; seq->input_regions[i]; i++ ) +- VIPS_UNREF( seq->input_regions[i] ); +- VIPS_FREE( seq->input_regions ); ++ if (seq->input_regions) { ++ for (int i = 0; seq->input_regions[i]; i++) ++ VIPS_UNREF(seq->input_regions[i]); ++ VIPS_FREE(seq->input_regions); + } + +- if( seq->composite_regions ) { +- for( int i = 0; seq->composite_regions[i]; i++ ) +- VIPS_UNREF( seq->composite_regions[i] ); +- VIPS_FREE( seq->composite_regions ); ++ if (seq->composite_regions) { ++ for (int i = 0; seq->composite_regions[i]; i++) ++ VIPS_UNREF(seq->composite_regions[i]); ++ VIPS_FREE(seq->composite_regions); + } + +- VIPS_FREE( seq->enabled ); +- VIPS_FREE( seq->p ); ++ VIPS_FREE(seq->enabled); ++ VIPS_FREE(seq->p); + + #ifdef HAVE_VECTOR_ARITH +- VIPS_FREEF( vips_free_aligned, seq ); +-#else /*!defined(HAVE_VECTOR_ARITH)*/ +- VIPS_FREE( seq ); ++ VIPS_FREEF(vips_free_aligned, seq); ++#else /*!defined(HAVE_VECTOR_ARITH)*/ ++ VIPS_FREE(seq); + #endif /*HAVE_VECTOR_ARITH*/ + +- return( 0 ); ++ return (0); + } + + static void * +-vips_composite_start( VipsImage *out, void *a, void *b ) ++vips_composite_start(VipsImage *out, void *a, void *b) + { + VipsImage **in = (VipsImage **) a; + VipsCompositeBase *composite = (VipsCompositeBase *) b; +@@ -277,12 +278,12 @@ vips_composite_start( VipsImage *out, void *a, void *b ) + #ifdef HAVE_VECTOR_ARITH + /* Ensure that the memory is aligned on a 16-byte boundary. + */ +- if( !(seq = ((VipsCompositeSequence *) vips_alloc_aligned( +- sizeof( VipsCompositeSequence ), 16 ))) ) +-#else /*!defined(HAVE_VECTOR_ARITH)*/ +- if( !(seq = VIPS_NEW( NULL, VipsCompositeSequence )) ) ++ if (!(seq = ((VipsCompositeSequence *) vips_alloc_aligned( ++ sizeof(VipsCompositeSequence), 16)))) ++#else /*!defined(HAVE_VECTOR_ARITH)*/ ++ if (!(seq = VIPS_NEW(NULL, VipsCompositeSequence))) + #endif /*HAVE_VECTOR_ARITH*/ +- return( NULL ); ++ return (NULL); + + seq->composite = composite; + seq->input_regions = NULL; +@@ -291,51 +292,51 @@ vips_composite_start( VipsImage *out, void *a, void *b ) + + /* How many images? + */ +- for( n = 0; in[n]; n++ ) ++ for (n = 0; in[n]; n++) + ; + + /* Allocate space for region array. + */ +- if( !(seq->input_regions = VIPS_ARRAY( NULL, n + 1, VipsRegion * )) ) { +- vips_composite_stop( seq, NULL, NULL ); +- return( NULL ); ++ if (!(seq->input_regions = VIPS_ARRAY(NULL, n + 1, VipsRegion *))) { ++ vips_composite_stop(seq, NULL, NULL); ++ return (NULL); + } +- for( i = 0; i < n + 1; i++ ) ++ for (i = 0; i < n + 1; i++) + seq->input_regions[i] = NULL; + +- if( !(seq->composite_regions = +- VIPS_ARRAY( NULL, n + 1, VipsRegion * )) ) { +- vips_composite_stop( seq, NULL, NULL ); +- return( NULL ); ++ if (!(seq->composite_regions = ++ VIPS_ARRAY(NULL, n + 1, VipsRegion *))) { ++ vips_composite_stop(seq, NULL, NULL); ++ return (NULL); + } +- for( i = 0; i < n + 1; i++ ) ++ for (i = 0; i < n + 1; i++) + seq->composite_regions[i] = NULL; + +- seq->enabled = VIPS_ARRAY( NULL, n, int ); +- seq->p = VIPS_ARRAY( NULL, n, VipsPel * ); +- if( !seq->enabled || +- !seq->p ) { +- vips_composite_stop( seq, NULL, NULL ); +- return( NULL ); ++ seq->enabled = VIPS_ARRAY(NULL, n, int); ++ seq->p = VIPS_ARRAY(NULL, n, VipsPel *); ++ if (!seq->enabled || ++ !seq->p) { ++ vips_composite_stop(seq, NULL, NULL); ++ return (NULL); + } + + /* Create a set of regions. + */ +- for( i = 0; i < n; i++ ) { +- seq->input_regions[i] = vips_region_new( in[i] ); +- seq->composite_regions[i] = vips_region_new( in[0] ); +- +- if( !seq->input_regions[i] || +- !seq->composite_regions[i] ) { +- vips_composite_stop( seq, NULL, NULL ); +- return( NULL ); ++ for (i = 0; i < n; i++) { ++ seq->input_regions[i] = vips_region_new(in[i]); ++ seq->composite_regions[i] = vips_region_new(in[0]); ++ ++ if (!seq->input_regions[i] || ++ !seq->composite_regions[i]) { ++ vips_composite_stop(seq, NULL, NULL); ++ return (NULL); + } + } + + #ifdef HAVE_VECTOR_ARITH + /* We need a float version for the vector path. + */ +- if( composite->bands == 3 ) ++ if (composite->bands == 3) + seq->max_band_vec = (v4f){ + (float) composite->max_band[0], + (float) composite->max_band[1], +@@ -344,26 +345,26 @@ vips_composite_start( VipsImage *out, void *a, void *b ) + }; + #endif + +- return( seq ); ++ return (seq); + } + + /* For each of the supported interpretations, the maximum value of each band. + */ + static int +-vips_composite_base_max_band( VipsCompositeBase *composite, double *max_band ) ++vips_composite_base_max_band(VipsCompositeBase *composite, double *max_band) + { + double max_alpha; + int b; + + max_alpha = 255.0; +- if( composite->compositing_space == VIPS_INTERPRETATION_GREY16 || +- composite->compositing_space == VIPS_INTERPRETATION_RGB16 ) ++ if (composite->compositing_space == VIPS_INTERPRETATION_GREY16 || ++ composite->compositing_space == VIPS_INTERPRETATION_RGB16) + max_alpha = 65535.0; + +- for( b = 0; b <= composite->bands; b++ ) ++ for (b = 0; b <= composite->bands; b++) + max_band[b] = max_alpha; + +- switch( composite->compositing_space ) { ++ switch (composite->compositing_space) { + case VIPS_INTERPRETATION_XYZ: + max_band[0] = VIPS_D65_X0; + max_band[1] = VIPS_D65_Y0; +@@ -434,26 +435,26 @@ vips_composite_base_max_band( VipsCompositeBase *composite, double *max_band ) + break; + + default: +- return( -1 ); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Find the subset of our input images which intersect this region. If we are + * not in skippable mode, we must enable all layers. + */ + static void +-vips_composite_base_select( VipsCompositeSequence *seq, VipsRect *r ) ++vips_composite_base_select(VipsCompositeSequence *seq, VipsRect *r) + { +- VipsCompositeBase *composite = seq->composite; ++ VipsCompositeBase *composite = seq->composite; + int n = composite->in->area.n; + + seq->n = 0; +- for( int i = 0; i < n; i++ ) +- if( !composite->skippable || +- vips_rect_overlapsrect( r, +- &composite->subimages[i] ) ) { ++ for (int i = 0; i < n; i++) ++ if (!composite->skippable || ++ vips_rect_overlapsrect(r, ++ &composite->subimages[i])) { + seq->enabled[seq->n] = i; + seq->n += 1; + } +@@ -469,18 +470,18 @@ vips_composite_base_select( VipsCompositeSequence *seq, VipsRect *r ) + * xB colour band of source B + */ + +-/* A is the new pixel coming in, of any non-complex type T. ++/* A is the new pixel coming in, of any non-complex type T. + * + * We must scale incoming pixels to 0 - 1 by dividing by the scale[] vector. + * + * If premultipled is not set, we premultiply incoming pixels before blending. + * +- * B is the double pixel we are accumulating. ++ * B is the double pixel we are accumulating. + */ + template + static void +-vips_composite_base_blend( VipsCompositeBase *composite, +- VipsBlendMode mode, double * restrict B, T * restrict p ) ++vips_composite_base_blend(VipsCompositeBase *composite, ++ VipsBlendMode mode, double *restrict B, T *restrict p) + { + const int bands = composite->bands; + +@@ -495,11 +496,11 @@ vips_composite_base_blend( VipsCompositeBase *composite, + + /* Load and scale the pixel to 0 - 1. + */ +- for( int b = 0; b <= bands; b++ ) ++ for (int b = 0; b <= bands; b++) + A[b] = p[b] / composite->max_band[b]; + /* Not necessary, but it stops a compiler warning. + */ +- for( int b = bands + 1; b < MAX_BANDS + 1; b++ ) ++ for (int b = bands + 1; b < MAX_BANDS + 1; b++) + A[b] = 0.0; + + aA = A[bands]; +@@ -507,50 +508,50 @@ vips_composite_base_blend( VipsCompositeBase *composite, + + /* We may need to premultiply A. + */ +- if( !composite->premultiplied ) +- for( int b = 0; b < bands; b++ ) ++ if (!composite->premultiplied) ++ for (int b = 0; b < bands; b++) + A[b] *= aA; + +- switch( mode ) { ++ switch (mode) { + case VIPS_BLEND_MODE_CLEAR: + aR = 0; +- for( int b = 0; b < bands; b++ ) ++ for (int b = 0; b < bands; b++) + B[b] = 0; + break; + + case VIPS_BLEND_MODE_SOURCE: + aR = aA; +- for( int b = 0; b < bands; b++ ) ++ for (int b = 0; b < bands; b++) + B[b] = A[b]; + break; + + case VIPS_BLEND_MODE_OVER: + aR = aA + aB * (1 - aA); + t1 = 1 - aA; +- for( int b = 0; b < bands; b++ ) ++ for (int b = 0; b < bands; b++) + B[b] = A[b] + t1 * B[b]; + break; + + case VIPS_BLEND_MODE_IN: + aR = aA * aB; + // if aA == 0, then aR == 0 and so B will already be 0 +- if( aA != 0 ) +- for( int b = 0; b < bands; b++ ) ++ if (aA != 0) ++ for (int b = 0; b < bands; b++) + B[b] = A[b] * aR / aA; + break; + + case VIPS_BLEND_MODE_OUT: + aR = aA * (1 - aB); + // if aA == 0, then aR == 0 and so B will already be 0 +- if( aA != 0 ) +- for( int b = 0; b < bands; b++ ) ++ if (aA != 0) ++ for (int b = 0; b < bands; b++) + B[b] = A[b] * aR / aA; + break; + + case VIPS_BLEND_MODE_ATOP: + aR = aB; + t1 = 1 - aA; +- for( int b = 0; b < bands; b++ ) ++ for (int b = 0; b < bands; b++) + B[b] = A[b] + t1 * B[b]; + break; + +@@ -562,31 +563,31 @@ vips_composite_base_blend( VipsCompositeBase *composite, + case VIPS_BLEND_MODE_DEST_OVER: + aR = aB + aA * (1 - aB); + t1 = 1 - aB; +- for( int b = 0; b < bands; b++ ) ++ for (int b = 0; b < bands; b++) + B[b] = B[b] + t1 * A[b]; + break; + + case VIPS_BLEND_MODE_DEST_IN: + aR = aA * aB; + // B = B +- if( aB != 0 ) +- for( int b = 0; b < bands; b++ ) ++ if (aB != 0) ++ for (int b = 0; b < bands; b++) + B[b] *= aR / aB; + break; + + case VIPS_BLEND_MODE_DEST_OUT: + aR = (1 - aA) * aB; + // B = B +- // if aB is 0, then B is already 0 +- if( aB != 0 ) +- for( int b = 0; b < bands; b++ ) ++ // if aB is 0, then B is already 0 ++ if (aB != 0) ++ for (int b = 0; b < bands; b++) + B[b] *= aR / aB; + break; + + case VIPS_BLEND_MODE_DEST_ATOP: + aR = aA; + t1 = 1 - aA; +- for( int b = 0; b < bands; b++ ) ++ for (int b = 0; b < bands; b++) + B[b] = t1 * A[b] + B[b]; + break; + +@@ -594,20 +595,20 @@ vips_composite_base_blend( VipsCompositeBase *composite, + aR = aA + aB - 2 * aA * aB; + t1 = 1 - aB; + t2 = 1 - aA; +- for( int b = 0; b < bands; b++ ) ++ for (int b = 0; b < bands; b++) + B[b] = t1 * A[b] + t2 * B[b]; + break; + + case VIPS_BLEND_MODE_ADD: +- aR = VIPS_MIN( 1, aA + aB ); +- for( int b = 0; b < bands; b++ ) ++ aR = VIPS_MIN(1, aA + aB); ++ for (int b = 0; b < bands; b++) + B[b] = A[b] + B[b]; + break; + + case VIPS_BLEND_MODE_SATURATE: +- aR = VIPS_MIN( 1, aA + aB ); +- t1 = VIPS_MIN( aA, 1 - aB ); +- for( int b = 0; b < bands; b++ ) ++ aR = VIPS_MIN(1, aA + aB); ++ t1 = VIPS_MIN(aA, 1 - aB); ++ for (int b = 0; b < bands; b++) + B[b] = t1 * A[b] + B[b]; + break; + +@@ -616,99 +617,98 @@ vips_composite_base_blend( VipsCompositeBase *composite, + */ + aR = aA + aB * (1 - aA); + +- switch( mode ) { ++ switch (mode) { + case VIPS_BLEND_MODE_MULTIPLY: +- for( int b = 0; b < bands; b++ ) ++ for (int b = 0; b < bands; b++) + f[b] = A[b] * B[b]; + break; + + case VIPS_BLEND_MODE_SCREEN: +- for( int b = 0; b < bands; b++ ) ++ for (int b = 0; b < bands; b++) + f[b] = A[b] + B[b] - A[b] * B[b]; + break; + + case VIPS_BLEND_MODE_OVERLAY: +- for( int b = 0; b < bands; b++ ) +- if( B[b] <= 0.5 ) ++ for (int b = 0; b < bands; b++) ++ if (B[b] <= 0.5) + f[b] = 2 * A[b] * B[b]; +- else ++ else + f[b] = 1 - 2 * (1 - A[b]) * (1 - B[b]); + break; + + case VIPS_BLEND_MODE_DARKEN: +- for( int b = 0; b < bands; b++ ) +- f[b] = VIPS_MIN( A[b], B[b] ); ++ for (int b = 0; b < bands; b++) ++ f[b] = VIPS_MIN(A[b], B[b]); + break; + + case VIPS_BLEND_MODE_LIGHTEN: +- for( int b = 0; b < bands; b++ ) +- f[b] = VIPS_MAX( A[b], B[b] ); ++ for (int b = 0; b < bands; b++) ++ f[b] = VIPS_MAX(A[b], B[b]); + break; + + case VIPS_BLEND_MODE_COLOUR_DODGE: +- for( int b = 0; b < bands; b++ ) +- if( A[b] < 1 ) +- f[b] = VIPS_MIN( 1, B[b] / (1 - A[b]) ); +- else ++ for (int b = 0; b < bands; b++) ++ if (A[b] < 1) ++ f[b] = VIPS_MIN(1, B[b] / (1 - A[b])); ++ else + f[b] = 1; + break; + + case VIPS_BLEND_MODE_COLOUR_BURN: +- for( int b = 0; b < bands; b++ ) +- if( A[b] > 0 ) +- f[b] = 1 - VIPS_MIN( 1, +- (1 - B[b]) / A[b] ); +- else ++ for (int b = 0; b < bands; b++) ++ if (A[b] > 0) ++ f[b] = 1 - VIPS_MIN(1, (1 - B[b]) / A[b]); ++ else + f[b] = 0; + break; + + case VIPS_BLEND_MODE_HARD_LIGHT: +- for( int b = 0; b < bands; b++ ) +- if( A[b] <= 0.5 ) ++ for (int b = 0; b < bands; b++) ++ if (A[b] <= 0.5) + f[b] = 2 * A[b] * B[b]; +- else ++ else + f[b] = 1 - 2 * (1 - A[b]) * (1 - B[b]); + break; + + case VIPS_BLEND_MODE_SOFT_LIGHT: +- for( int b = 0; b < bands; b++ ) { ++ for (int b = 0; b < bands; b++) { + double g; + +- if( B[b] <= 0.25 ) +- g = ((16 * B[b] - 12) * +- B[b] + 4) * B[b]; +- else +- g = sqrt( B[b] ); ++ if (B[b] <= 0.25) ++ g = ((16 * B[b] - 12) * ++ B[b] + ++ 4) * ++ B[b]; ++ else ++ g = sqrt(B[b]); + +- if( A[b] <= 0.5 ) +- f[b] = B[b] - (1 - 2 * A[b]) * +- B[b] * (1 - B[b]); ++ if (A[b] <= 0.5) ++ f[b] = B[b] - (1 - 2 * A[b]) * B[b] * (1 - B[b]); + else +- f[b] = B[b] + (2 * A[b] - 1) * +- (g - B[b]); ++ f[b] = B[b] + (2 * A[b] - 1) * (g - B[b]); + } + break; + + case VIPS_BLEND_MODE_DIFFERENCE: +- for( int b = 0; b < bands; b++ ) +- f[b] = fabs( B[b] - A[b] ); ++ for (int b = 0; b < bands; b++) ++ f[b] = fabs(B[b] - A[b]); + break; + + case VIPS_BLEND_MODE_EXCLUSION: +- for( int b = 0; b < bands; b++ ) ++ for (int b = 0; b < bands; b++) + f[b] = A[b] + B[b] - 2 * A[b] * B[b]; + break; + + default: + g_assert_not_reached(); +- for( int b = 0; b < bands; b++ ) ++ for (int b = 0; b < bands; b++) + B[b] = 0; + } + + t1 = 1 - aB; + t2 = 1 - aA; + t3 = aA * aB; +- for( int b = 0; b < bands; b++ ) ++ for (int b = 0; b < bands; b++) + B[b] = t1 * A[b] + t2 * B[b] + t3 * f[b]; + break; + } +@@ -719,16 +719,16 @@ vips_composite_base_blend( VipsCompositeBase *composite, + /* We have a vector path with gcc's vector attr. + */ + #ifdef HAVE_VECTOR_ARITH +-/* Special path for RGBA with non-double output. This is overwhelmingly the +- * most common case, and vectorises easily. ++/* Special path for RGBA with non-double output. This is overwhelmingly the ++ * most common case, and vectorises easily. + * +- * B is the float pixel we are accumulating, A is the new pixel coming ++ * B is the float pixel we are accumulating, A is the new pixel coming + * in from memory. + */ + template + static void +-vips_composite_base_blend3( VipsCompositeSequence *seq, +- VipsBlendMode mode, v4f &B, T * restrict p ) ++vips_composite_base_blend3(VipsCompositeSequence *seq, ++ VipsBlendMode mode, v4f &B, T *restrict p) + { + VipsCompositeBase *composite = seq->composite; + +@@ -756,17 +756,17 @@ vips_composite_base_blend3( VipsCompositeSequence *seq, + + /* We may need to premultiply A. + */ +- if( !composite->premultiplied ) ++ if (!composite->premultiplied) + A *= aA; + +- /* See https://www.cairographics.org/operators for a nice summary of ++ /* See https://www.cairographics.org/operators for a nice summary of + * the operators and their meaning. + * +- * Some operators need the unpremultiplied values (eg. dest-in), so ++ * Some operators need the unpremultiplied values (eg. dest-in), so + * we have to do an extra unpremultiply/premultiply. + */ + +- switch( mode ) { ++ switch (mode) { + case VIPS_BLEND_MODE_CLEAR: + aR = 0; + B[0] = 0; +@@ -788,14 +788,14 @@ vips_composite_base_blend3( VipsCompositeSequence *seq, + case VIPS_BLEND_MODE_IN: + aR = aA * aB; + // if aA == 0, then aR == 0 and so B will already be 0 +- if( aA != 0 ) ++ if (aA != 0) + B = A * aR / aA; + break; + + case VIPS_BLEND_MODE_OUT: + aR = aA * (1 - aB); + // if aA == 0, then aR == 0 and so B will already be 0 +- if( aA != 0 ) ++ if (aA != 0) + B = A * aR / aA; + break; + +@@ -818,16 +818,16 @@ vips_composite_base_blend3( VipsCompositeSequence *seq, + + case VIPS_BLEND_MODE_DEST_IN: + aR = aA * aB; +- // if aB is 0, then B is already 0 +- if( aB != 0 ) ++ // if aB is 0, then B is already 0 ++ if (aB != 0) + B *= aR / aB; + break; + + case VIPS_BLEND_MODE_DEST_OUT: + aR = (1 - aA) * aB; + // B = B +- // if aB is 0, then B is already 0 +- if( aB != 0 ) ++ // if aB is 0, then B is already 0 ++ if (aB != 0) + B *= aR / aB; + break; + +@@ -845,13 +845,13 @@ vips_composite_base_blend3( VipsCompositeSequence *seq, + break; + + case VIPS_BLEND_MODE_ADD: +- aR = VIPS_MIN( 1, aA + aB ); ++ aR = VIPS_MIN(1, aA + aB); + B = A + B; + break; + + case VIPS_BLEND_MODE_SATURATE: +- aR = VIPS_MIN( 1, aA + aB ); +- t1 = VIPS_MIN( aA, 1 - aB ); ++ aR = VIPS_MIN(1, aA + aB); ++ t1 = VIPS_MIN(aA, 1 - aB); + B = t1 * A + B; + break; + +@@ -860,7 +860,7 @@ vips_composite_base_blend3( VipsCompositeSequence *seq, + */ + aR = aA + aB * (1 - aA); + +- switch( mode ) { ++ switch (mode) { + case VIPS_BLEND_MODE_MULTIPLY: + f = A * B; + break; +@@ -870,54 +870,44 @@ vips_composite_base_blend3( VipsCompositeSequence *seq, + break; + + case VIPS_BLEND_MODE_OVERLAY: +- f = B <= 0.5 ? +- 2 * A * B : +- 1 - 2 * (1 - A) * (1 - B); ++ f = B <= 0.5 ? 2 * A * B : 1 - 2 * (1 - A) * (1 - B); + break; + + case VIPS_BLEND_MODE_DARKEN: +- f = VIPS_MIN( A, B ); ++ f = VIPS_MIN(A, B); + break; + + case VIPS_BLEND_MODE_LIGHTEN: +- f = VIPS_MAX( A, B ); ++ f = VIPS_MAX(A, B); + break; + + case VIPS_BLEND_MODE_COLOUR_DODGE: +- f = A < 1 ? +- VIPS_MIN( 1, B / (1 - A) ) : +- 1; ++ f = A < 1 ? VIPS_MIN(1, B / (1 - A)) : 1; + break; + + case VIPS_BLEND_MODE_COLOUR_BURN: +- f = A > 0 ? +- 1 - VIPS_MIN( 1, (1 - B) / A ) : +- 0; ++ f = A > 0 ? 1 - VIPS_MIN(1, (1 - B) / A) : 0; + break; + + case VIPS_BLEND_MODE_HARD_LIGHT: +- f = A <= 0.5 ? +- 2 * A * B : +- 1 - 2 * (1 - A) * (1 - B); ++ f = A <= 0.5 ? 2 * A * B : 1 - 2 * (1 - A) * (1 - B); + break; + + case VIPS_BLEND_MODE_SOFT_LIGHT: + /* You can't sqrt a vector, so we must loop. + */ +- for( int b = 0; b < 3; b++ ) { ++ for (int b = 0; b < 3; b++) { + double g; + +- if( B[b] <= 0.25 ) ++ if (B[b] <= 0.25) + g = ((16 * B[b] - 12) * B[b] + 4) * B[b]; +- else +- g = sqrt( B[b] ); ++ else ++ g = sqrt(B[b]); + +- if( A[b] <= 0.5 ) +- f[b] = B[b] - (1 - 2 * A[b]) * +- B[b] * (1 - B[b]); ++ if (A[b] <= 0.5) ++ f[b] = B[b] - (1 - 2 * A[b]) * B[b] * (1 - B[b]); + else +- f[b] = B[b] + (2 * A[b] - 1) * +- (g - B[b]); ++ f[b] = B[b] + (2 * A[b] - 1) * (g - B[b]); + } + break; + +@@ -935,7 +925,7 @@ vips_composite_base_blend3( VipsCompositeSequence *seq, + + /* Stop compiler warnings. + */ +- for( int b = 0; b < 3; b++ ) ++ for (int b = 0; b < 3; b++) + B[b] = 0; + f = A; + } +@@ -955,59 +945,59 @@ vips_composite_base_blend3( VipsCompositeSequence *seq, + * for example float. + */ + template +-static void +-vips_combine_pixels( VipsCompositeSequence *seq, VipsPel *q ) ++static void ++vips_combine_pixels(VipsCompositeSequence *seq, VipsPel *q) + { + VipsCompositeBase *composite = seq->composite; + VipsBlendMode *mode = (VipsBlendMode *) composite->mode->area.data; + int n_mode = composite->mode->area.n; + int n = seq->n; + int bands = composite->bands; +- T * restrict tq = (T * restrict) q; +- T ** restrict tp = (T ** restrict) seq->p; ++ T *restrict tq = (T *restrict) q; ++ T **restrict tp = (T * *restrict) seq->p; + + double B[MAX_BANDS + 1]; + double aB; + + /* Load and scale the base pixel to 0 - 1. + */ +- for( int b = 0; b <= bands; b++ ) ++ for (int b = 0; b <= bands; b++) + B[b] = tp[0][b] / composite->max_band[b]; + + aB = B[bands]; +- if( !composite->premultiplied ) +- for( int b = 0; b < bands; b++ ) ++ if (!composite->premultiplied) ++ for (int b = 0; b < bands; b++) + B[b] *= aB; + +- for( int i = 1; i < n; i++ ) { ++ for (int i = 1; i < n; i++) { + int j = seq->enabled[i]; + VipsBlendMode m = n_mode == 1 ? mode[0] : mode[j - 1]; + +- vips_composite_base_blend( composite, m, B, tp[i] ); ++ vips_composite_base_blend(composite, m, B, tp[i]); + } + + /* Unpremultiply, if necessary. + */ +- if( !composite->premultiplied ) { ++ if (!composite->premultiplied) { + double aR = B[bands]; + +- if( aR == 0 ) +- for( int b = 0; b < bands; b++ ) ++ if (aR == 0) ++ for (int b = 0; b < bands; b++) + B[b] = 0; + else +- for( int b = 0; b < bands; b++ ) ++ for (int b = 0; b < bands; b++) + B[b] = B[b] / aR; + } + + /* Write back as a full range pixel, clipping to range. + */ +- for( int b = 0; b <= bands; b++ ) { ++ for (int b = 0; b <= bands; b++) { + double v; + + v = B[b] * composite->max_band[b]; +- if( min_T != 0 || +- max_T != 0 ) { +- v = VIPS_CLIP( min_T, v, max_T ); ++ if (min_T != 0 || ++ max_T != 0) { ++ v = VIPS_CLIP(min_T, v, max_T); + } + + tq[b] = v; +@@ -1015,20 +1005,20 @@ vips_combine_pixels( VipsCompositeSequence *seq, VipsPel *q ) + } + + #ifdef HAVE_VECTOR_ARITH +-/* Three band (four with alpha) vector case. Non-double output. min_T and ++/* Three band (four with alpha) vector case. Non-double output. min_T and + * max_T are the numeric range for this type. 0, 0 means no limit, + * for example float. + */ + template +-static void +-vips_combine_pixels3( VipsCompositeSequence *seq, VipsPel *q ) ++static void ++vips_combine_pixels3(VipsCompositeSequence *seq, VipsPel *q) + { + VipsCompositeBase *composite = seq->composite; + VipsBlendMode *mode = (VipsBlendMode *) composite->mode->area.data; + int n_mode = composite->mode->area.n; + int n = seq->n; +- T * restrict tq = (T * restrict) q; +- T ** restrict tp = (T ** restrict) seq->p; ++ T *restrict tq = (T *restrict) q; ++ T **restrict tp = (T * *restrict) seq->p; + + v4f B; + float aB; +@@ -1043,25 +1033,25 @@ vips_combine_pixels3( VipsCompositeSequence *seq, VipsPel *q ) + B /= seq->max_band_vec; + aB = B[3]; + +- if( !composite->premultiplied ) { ++ if (!composite->premultiplied) { + B *= aB; + B[3] = aB; + } + +- for( int i = 1; i < n; i++ ) { ++ for (int i = 1; i < n; i++) { + int j = seq->enabled[i]; + VipsBlendMode m = n_mode == 1 ? mode[0] : mode[j - 1]; + +- vips_composite_base_blend3( seq, m, B, tp[i] ); ++ vips_composite_base_blend3(seq, m, B, tp[i]); + } + + /* Unpremultiply, if necessary. + */ +- if( !composite->premultiplied ) { ++ if (!composite->premultiplied) { + float aR = B[3]; + +- if( aR == 0 ) +- for( int b = 0; b < 3; b++ ) ++ if (aR == 0) ++ for (int b = 0; b < 3; b++) + B[b] = 0; + else { + B /= aR; +@@ -1072,12 +1062,12 @@ vips_combine_pixels3( VipsCompositeSequence *seq, VipsPel *q ) + /* Write back as a full range pixel, clipping to range. + */ + B *= seq->max_band_vec; +- if( min_T != 0 || +- max_T != 0 ) { ++ if (min_T != 0 || ++ max_T != 0) { + float low = min_T; + float high = max_T; + +- B = VIPS_CLIP( low, B, high ); ++ B = VIPS_CLIP(low, B, high); + } + + tq[0] = B[0]; +@@ -1088,44 +1078,44 @@ vips_combine_pixels3( VipsCompositeSequence *seq, VipsPel *q ) + #endif /*HAVE_VECTOR_ARITH*/ + + static int +-vips_composite_base_gen( VipsRegion *output_region, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_composite_base_gen(VipsRegion *output_region, ++ void *vseq, void *a, void *b, gboolean *stop) + { + VipsCompositeSequence *seq = (VipsCompositeSequence *) vseq; + VipsCompositeBase *composite = (VipsCompositeBase *) b; + VipsRect *r = &output_region->valid; +- int ps = VIPS_IMAGE_SIZEOF_PEL( output_region->im ); ++ int ps = VIPS_IMAGE_SIZEOF_PEL(output_region->im); + +- VIPS_DEBUG_MSG( "vips_composite_base_gen: at %d x %d, size %d x %d\n", +- r->left, r->top, r->width, r->height ); ++ VIPS_DEBUG_MSG("vips_composite_base_gen: at %d x %d, size %d x %d\n", ++ r->left, r->top, r->width, r->height); + + /* Find the subset of our input images which intersect this region. + */ +- vips_composite_base_select( seq, r ); ++ vips_composite_base_select(seq, r); + +- VIPS_DEBUG_MSG( " selected %d images\n", seq->n ); ++ VIPS_DEBUG_MSG(" selected %d images\n", seq->n); + + /* Is there just one? We can prepare directly to output and return. + */ +- if( seq->n == 1 ) { ++ if (seq->n == 1) { + /* This can only be the background image, since it's the only + * image which exactly fills the whole output. + */ +- g_assert( seq->enabled[0] == 0 ); ++ g_assert(seq->enabled[0] == 0); + +- if( vips_region_prepare( seq->input_regions[0], r ) ) +- return( -1 ); +- if( vips_region_region( output_region, seq->input_regions[0], +- r, r->left, r->top ) ) +- return( -1 ); ++ if (vips_region_prepare(seq->input_regions[0], r)) ++ return (-1); ++ if (vips_region_region(output_region, seq->input_regions[0], ++ r, r->left, r->top)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Prepare the appropriate parts into our set of composite + * regions. + */ +- for( int i = 0; i < seq->n; i++ ) { ++ for (int i = 0; i < seq->n; i++) { + int j = seq->enabled[i]; + + VipsRect hit; +@@ -1134,13 +1124,13 @@ vips_composite_base_gen( VipsRegion *output_region, + /* Set the composite region up to be a bit of memory at the + * right position. + */ +- if( vips_region_buffer( seq->composite_regions[j], r ) ) +- return( -1 ); ++ if (vips_region_buffer(seq->composite_regions[j], r)) ++ return (-1); + + /* Clip against this subimage position and size. + */ + hit = *r; +- vips_rect_intersectrect( &hit, &composite->subimages[j], &hit ); ++ vips_rect_intersectrect(&hit, &composite->subimages[j], &hit); + + /* Translate request to subimage coordinates. + */ +@@ -1151,155 +1141,133 @@ vips_composite_base_gen( VipsRegion *output_region, + /* If the request is smaller than the target region, there + * will be some gaps. We must make sure these are zero. + */ +- if( request.width < r->width || +- request.height < r->height ) +- vips_region_black( seq->composite_regions[j] ); ++ if (request.width < r->width || ++ request.height < r->height) ++ vips_region_black(seq->composite_regions[j]); + + /* And render the right part of the input image to the + * composite region. + * + * If we are not in skippable mode, we can be completely +- * outside the subimage area. ++ * outside the subimage area. + */ +- if( !vips_rect_isempty( &request ) ) { +- VIPS_DEBUG_MSG( " fetching pixels for input %d\n", j ); +- if( vips_region_prepare_to( seq->input_regions[j], +- seq->composite_regions[j], &request, +- hit.left, hit.top ) ) +- return( -1 ); ++ if (!vips_rect_isempty(&request)) { ++ VIPS_DEBUG_MSG(" fetching pixels for input %d\n", j); ++ if (vips_region_prepare_to(seq->input_regions[j], ++ seq->composite_regions[j], &request, ++ hit.left, hit.top)) ++ return (-1); + } + } + +- VIPS_GATE_START( "vips_composite_base_gen: work" ); ++ VIPS_GATE_START("vips_composite_base_gen: work"); + +- for( int y = 0; y < r->height; y++ ) { ++ for (int y = 0; y < r->height; y++) { + VipsPel *q; + +- for( int i = 0; i < seq->n; i++ ) { ++ for (int i = 0; i < seq->n; i++) { + int j = seq->enabled[i]; + +- seq->p[i] = VIPS_REGION_ADDR( seq->composite_regions[j], +- r->left, r->top + y ); ++ seq->p[i] = VIPS_REGION_ADDR(seq->composite_regions[j], ++ r->left, r->top + y); + } +- q = VIPS_REGION_ADDR( output_region, r->left, r->top + y ); ++ q = VIPS_REGION_ADDR(output_region, r->left, r->top + y); + +- for( int x = 0; x < r->width; x++ ) { +- switch( seq->input_regions[0]->im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: ++ for (int x = 0; x < r->width; x++) { ++ switch (seq->input_regions[0]->im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: + #ifdef HAVE_VECTOR_ARITH +- if( composite->bands == 3 ) +- vips_combine_pixels3 +- +- ( seq, q ); ++ if (composite->bands == 3) ++ vips_combine_pixels3(seq, q); + else +-#endif +- vips_combine_pixels +- +- ( seq, q ); ++#endif ++ vips_combine_pixels(seq, q); + break; + +- case VIPS_FORMAT_CHAR: +- vips_combine_pixels +- +- ( seq, q ); +- break; ++ case VIPS_FORMAT_CHAR: ++ vips_combine_pixels(seq, q); ++ break; + +- case VIPS_FORMAT_USHORT: ++ case VIPS_FORMAT_USHORT: + #ifdef HAVE_VECTOR_ARITH +- if( composite->bands == 3 ) +- vips_combine_pixels3 +- +- ( seq, q ); ++ if (composite->bands == 3) ++ vips_combine_pixels3(seq, q); + else +-#endif +- vips_combine_pixels +- +- ( seq, q ); +- break; +- +- case VIPS_FORMAT_SHORT: +- vips_combine_pixels +- +- ( seq, q ); +- break; +- +- case VIPS_FORMAT_UINT: +- vips_combine_pixels +- +- ( seq, q ); +- break; +- +- case VIPS_FORMAT_INT: +- vips_combine_pixels +- +- ( seq, q ); +- break; ++#endif ++ vips_combine_pixels(seq, q); ++ break; ++ ++ case VIPS_FORMAT_SHORT: ++ vips_combine_pixels(seq, q); ++ break; ++ ++ case VIPS_FORMAT_UINT: ++ vips_combine_pixels(seq, q); ++ break; ++ ++ case VIPS_FORMAT_INT: ++ vips_combine_pixels(seq, q); ++ break; + + case VIPS_FORMAT_FLOAT: + #ifdef HAVE_VECTOR_ARITH +- if( composite->bands == 3 ) +- vips_combine_pixels3 +- +- ( seq, q ); ++ if (composite->bands == 3) ++ vips_combine_pixels3(seq, q); + else +-#endif +- vips_combine_pixels +- +- ( seq, q ); ++#endif ++ vips_combine_pixels(seq, q); + break; + + case VIPS_FORMAT_DOUBLE: +- vips_combine_pixels +- +- ( seq, q ); ++ vips_combine_pixels(seq, q); + break; + + default: + g_assert_not_reached(); +- return( -1 ); ++ return (-1); + } + +- for( int i = 0; i < seq->n; i++ ) ++ for (int i = 0; i < seq->n; i++) + seq->p[i] += ps; + q += ps; + } + } + +- VIPS_GATE_STOP( "vips_composite_base_gen: work" ); ++ VIPS_GATE_STOP("vips_composite_base_gen: work"); + +- return( 0 ); ++ return (0); + } + +-/* Is a mode "skippable"? ++/* Is a mode "skippable"? + * + * Skippable modes are ones where a black (0, 0, 0, 0) layer placed over the +- * base image and composited has no effect. ++ * base image and composited has no effect. + * + * If all the modes in our stack are skippable, we can avoid compositing the + * whole stack for every request. + */ + static gboolean +-vips_composite_mode_skippable( VipsBlendMode mode ) ++vips_composite_mode_skippable(VipsBlendMode mode) + { +- switch( mode ) { ++ switch (mode) { + case VIPS_BLEND_MODE_CLEAR: + case VIPS_BLEND_MODE_SOURCE: + case VIPS_BLEND_MODE_IN: + case VIPS_BLEND_MODE_OUT: + case VIPS_BLEND_MODE_DEST_IN: + case VIPS_BLEND_MODE_DEST_ATOP: +- return( FALSE ); ++ return (FALSE); + + default: +- return( TRUE ); ++ return (TRUE); + } + } + + static int +-vips_composite_base_build( VipsObject *object ) ++vips_composite_base_build(VipsObject *object) + { +- VipsObjectClass *klass = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *klass = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsCompositeBase *composite = (VipsCompositeBase *) object; + + int n; +@@ -1309,215 +1277,207 @@ vips_composite_base_build( VipsObject *object ) + VipsImage **compositing; + VipsImage **format; + +- if( VIPS_OBJECT_CLASS( vips_composite_base_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_composite_base_parent_class)->build(object)) ++ return (-1); + + n = composite->in->area.n; + +- if( n <= 0 ) { +- vips_error( klass->nickname, "%s", _( "no input images" ) ); +- return( -1 ); ++ if (n <= 0) { ++ vips_error(klass->nickname, "%s", _("no input images")); ++ return (-1); + } +- if( composite->mode->area.n != n - 1 && +- composite->mode->area.n != 1 ) { +- vips_error( klass->nickname, _( "must be 1 or %d blend modes" ), +- n - 1 ); +- return( -1 ); ++ if (composite->mode->area.n != n - 1 && ++ composite->mode->area.n != 1) { ++ vips_error(klass->nickname, _("must be 1 or %d blend modes"), ++ n - 1); ++ return (-1); + } + mode = (VipsBlendMode *) composite->mode->area.data; + composite->skippable = TRUE; +- for( int i = 0; i < composite->mode->area.n; i++ ) { +- if( mode[i] < 0 || +- mode[i] >= VIPS_BLEND_MODE_LAST ) { +- vips_error( klass->nickname, +- _( "blend mode index %d (%d) invalid" ), +- i, mode[i] ); +- return( -1 ); ++ for (int i = 0; i < composite->mode->area.n; i++) { ++ if (mode[i] < 0 || ++ mode[i] >= VIPS_BLEND_MODE_LAST) { ++ vips_error(klass->nickname, ++ _("blend mode index %d (%d) invalid"), ++ i, mode[i]); ++ return (-1); + } + +- if( !vips_composite_mode_skippable( mode[i] ) ) ++ if (!vips_composite_mode_skippable(mode[i])) + composite->skippable = FALSE; + } + + in = (VipsImage **) composite->in->area.data; + +- /* Make a set of rects for the positions of the input images. Image 0 ++ /* Make a set of rects for the positions of the input images. Image 0 + * (the background) is always at (0, 0). + */ +- if( !(composite->subimages = +- VIPS_ARRAY( NULL, n, VipsRect )) ) +- return( -1 ); +- for( int i = 0; i < n; i++ ) { ++ if (!(composite->subimages = ++ VIPS_ARRAY(NULL, n, VipsRect))) ++ return (-1); ++ for (int i = 0; i < n; i++) { + composite->subimages[i].left = 0; + composite->subimages[i].top = 0; + composite->subimages[i].width = in[i]->Xsize; + composite->subimages[i].height = in[i]->Ysize; + } + +- /* Position all images, if x/y is set. Image 0 ++ /* Position all images, if x/y is set. Image 0 + * (the background) is always at (0, 0). + */ +- if( composite->x_offset && +- composite->y_offset ) +- for( int i = 1; i < n; i++ ) { +- composite->subimages[i].left = ++ if (composite->x_offset && ++ composite->y_offset) ++ for (int i = 1; i < n; i++) { ++ composite->subimages[i].left = + composite->x_offset[i - 1]; +- composite->subimages[i].top = ++ composite->subimages[i].top = + composite->y_offset[i - 1]; + } + +- decode = (VipsImage **) vips_object_local_array( object, n ); +- for( int i = 0; i < n; i++ ) +- if( vips_image_decode( in[i], &decode[i] ) ) +- return( -1 ); ++ decode = (VipsImage **) vips_object_local_array(object, n); ++ for (int i = 0; i < n; i++) ++ if (vips_image_decode(in[i], &decode[i])) ++ return (-1); + in = decode; + +- /* Add a solid alpha to any images missing one. ++ /* Add a solid alpha to any images missing one. + */ +- for( int i = n - 1; i >= 0; i-- ) +- if( !vips_image_hasalpha( in[i] ) ) { ++ for (int i = n - 1; i >= 0; i--) ++ if (!vips_image_hasalpha(in[i])) { + VipsImage *x; + +- if( vips_addalpha( in[i], &x, (void *) NULL ) ) +- return( -1 ); +- g_object_unref( in[i] ); ++ if (vips_addalpha(in[i], &x, (void *) NULL)) ++ return (-1); ++ g_object_unref(in[i]); + in[i] = x; + } + +- /* Transform to compositing space. It defaults to sRGB or B_W, usually ++ /* Transform to compositing space. It defaults to sRGB or B_W, usually + * 8 bit, but 16 bit if any inputs are 16 bit. + */ +- if( !vips_object_argument_isset( object, "compositing_space" ) ) { ++ if (!vips_object_argument_isset(object, "compositing_space")) { + gboolean all_grey; + gboolean any_16; + + all_grey = TRUE; +- for( int i = 0; i < n; i++ ) +- if( in[i]->Bands > 2 ) { ++ for (int i = 0; i < n; i++) ++ if (in[i]->Bands > 2) { + all_grey = FALSE; + break; + } + + any_16 = FALSE; +- for( int i = 0; i < n; i++ ) +- if( in[i]->Type == VIPS_INTERPRETATION_GREY16 || +- in[i]->Type == VIPS_INTERPRETATION_RGB16 ) { ++ for (int i = 0; i < n; i++) ++ if (in[i]->Type == VIPS_INTERPRETATION_GREY16 || ++ in[i]->Type == VIPS_INTERPRETATION_RGB16) { + any_16 = TRUE; + break; + } + +- composite->compositing_space = any_16 ? +- (all_grey ? +- VIPS_INTERPRETATION_GREY16 : +- VIPS_INTERPRETATION_RGB16) : +- (all_grey ? +- VIPS_INTERPRETATION_B_W : +- VIPS_INTERPRETATION_sRGB); ++ composite->compositing_space = any_16 ? (all_grey ? VIPS_INTERPRETATION_GREY16 : VIPS_INTERPRETATION_RGB16) : (all_grey ? VIPS_INTERPRETATION_B_W : VIPS_INTERPRETATION_sRGB); + } + + compositing = (VipsImage **) +- vips_object_local_array( object, n ); +- for( int i = 0; i < n; i++ ) +- if( vips_colourspace( in[i], &compositing[i], +- composite->compositing_space, (void *) NULL ) ) +- return( -1 ); ++ vips_object_local_array(object, n); ++ for (int i = 0; i < n; i++) ++ if (vips_colourspace(in[i], &compositing[i], ++ composite->compositing_space, (void *) NULL)) ++ return (-1); + in = compositing; + + /* Check that they all now match in bands. This can fail for some + * input combinations. + */ +- for( int i = 1; i < n; i++ ) +- if( in[i]->Bands != in[0]->Bands ) { +- vips_error( klass->nickname, +- "%s", _( "images do not have same " +- "numbers of bands" ) ); +- return( -1 ); ++ for (int i = 1; i < n; i++) ++ if (in[i]->Bands != in[0]->Bands) { ++ vips_error(klass->nickname, ++ "%s", _("images do not have same " ++ "numbers of bands")); ++ return (-1); + } + +- if( in[0]->Bands > MAX_BANDS ) { +- vips_error( klass->nickname, +- "%s", _( "too many input bands" ) ); +- return( -1 ); ++ if (in[0]->Bands > MAX_BANDS) { ++ vips_error(klass->nickname, ++ "%s", _("too many input bands")); ++ return (-1); + } + + composite->bands = in[0]->Bands - 1; + + /* Set the max for each band now we know bands and compositing space. + */ +- if( vips_composite_base_max_band( composite, composite->max_band ) ) { +- vips_error( klass->nickname, +- "%s", _( "unsupported compositing space" ) ); +- return( -1 ); ++ if (vips_composite_base_max_band(composite, composite->max_band)) { ++ vips_error(klass->nickname, ++ "%s", _("unsupported compositing space")); ++ return (-1); + } + + /* Transform the input images to match in format. We may have +- * mixed float and double, for example. ++ * mixed float and double, for example. + */ +- format = (VipsImage **) vips_object_local_array( object, n ); +- if( vips__formatalike_vec( in, format, n ) ) +- return( -1 ); ++ format = (VipsImage **) vips_object_local_array(object, n); ++ if (vips__formatalike_vec(in, format, n)) ++ return (-1); + in = format; + + /* We want locality, so that we only prepare a few subimages each + * time. + */ +- if( vips_image_pipeline_array( conversion->out, +- VIPS_DEMAND_STYLE_SMALLTILE, in ) ) +- return( -1 ); ++ if (vips_image_pipeline_array(conversion->out, ++ VIPS_DEMAND_STYLE_SMALLTILE, in)) ++ return (-1); + + /* The output image is always the size of the base image. + */ + conversion->out->Xsize = in[0]->Xsize; + conversion->out->Ysize = in[0]->Ysize; + +- if( vips_image_generate( conversion->out, +- vips_composite_start, +- vips_composite_base_gen, +- vips_composite_stop, +- in, composite ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_composite_start, ++ vips_composite_base_gen, ++ vips_composite_stop, ++ in, composite)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_composite_base_class_init( VipsCompositeBaseClass *klass ) ++vips_composite_base_class_init(VipsCompositeBaseClass *klass) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( klass ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( klass ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( klass ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(klass); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(klass); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(klass); + +- VIPS_DEBUG_MSG( "vips_composite_base_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_composite_base_class_init\n"); + + gobject_class->dispose = vips_composite_base_dispose; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "composite_base"; +- vobject_class->description = _( "blend images together" ); ++ vobject_class->description = _("blend images together"); + vobject_class->build = vips_composite_base_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_ENUM( klass, "compositing_space", 10, +- _( "Compositing space" ), +- _( "Composite images in this colour space" ), ++ VIPS_ARG_ENUM(klass, "compositing_space", 10, ++ _("Compositing space"), ++ _("Composite images in this colour space"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCompositeBase, compositing_space ), +- VIPS_TYPE_INTERPRETATION, VIPS_INTERPRETATION_sRGB ); ++ G_STRUCT_OFFSET(VipsCompositeBase, compositing_space), ++ VIPS_TYPE_INTERPRETATION, VIPS_INTERPRETATION_sRGB); + +- VIPS_ARG_BOOL( klass, "premultiplied", 11, +- _( "Premultiplied" ), +- _( "Images have premultiplied alpha" ), ++ VIPS_ARG_BOOL(klass, "premultiplied", 11, ++ _("Premultiplied"), ++ _("Images have premultiplied alpha"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCompositeBase, premultiplied ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsCompositeBase, premultiplied), ++ FALSE); + } + + static void +-vips_composite_base_init( VipsCompositeBase *composite ) ++vips_composite_base_init(VipsCompositeBase *composite) + { + composite->compositing_space = VIPS_INTERPRETATION_sRGB; + } +@@ -1540,132 +1500,130 @@ typedef VipsCompositeBaseClass VipsCompositeClass; + /* We need C linkage for this. + */ + extern "C" { +-G_DEFINE_TYPE( VipsComposite, vips_composite, vips_composite_base_get_type() ); ++G_DEFINE_TYPE(VipsComposite, vips_composite, vips_composite_base_get_type()); + } + + static int +-vips_composite_build( VipsObject *object ) ++vips_composite_build(VipsObject *object) + { +- VipsObjectClass *klass = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *klass = VIPS_OBJECT_GET_CLASS(object); + VipsCompositeBase *base = (VipsCompositeBase *) object; + VipsComposite *composite = (VipsComposite *) object; + + int n; + + n = 0; +- if( vips_object_argument_isset( object, "in" ) ) ++ if (vips_object_argument_isset(object, "in")) + n = base->in->area.n; + +- if( vips_object_argument_isset( object, "x" ) ) { +- if( composite->x->area.n != n - 1 ) { +- vips_error( klass->nickname, +- _( "must be %d x coordinates" ), n - 1 ); +- return( -1 ); ++ if (vips_object_argument_isset(object, "x")) { ++ if (composite->x->area.n != n - 1) { ++ vips_error(klass->nickname, ++ _("must be %d x coordinates"), n - 1); ++ return (-1); + } + base->x_offset = (int *) composite->x->area.data; + } + +- if( vips_object_argument_isset( object, "y" ) ) { +- if( composite->y->area.n != n - 1 ) { +- vips_error( klass->nickname, +- _( "must be %d y coordinates" ), n - 1 ); +- return( -1 ); ++ if (vips_object_argument_isset(object, "y")) { ++ if (composite->y->area.n != n - 1) { ++ vips_error(klass->nickname, ++ _("must be %d y coordinates"), n - 1); ++ return (-1); + } + base->y_offset = (int *) composite->y->area.data; + } + +- if( VIPS_OBJECT_CLASS( vips_composite_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_composite_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_composite_class_init( VipsCompositeClass *klass ) ++vips_composite_class_init(VipsCompositeClass *klass) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( klass ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( klass ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( klass ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(klass); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(klass); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(klass); + +- VIPS_DEBUG_MSG( "vips_composite_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_composite_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "composite"; + vobject_class->description = +- _( "blend an array of images with an array of blend modes" ); ++ _("blend an array of images with an array of blend modes"); + vobject_class->build = vips_composite_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_BOXED( klass, "in", 0, +- _( "Inputs" ), +- _( "Array of input images" ), ++ VIPS_ARG_BOXED(klass, "in", 0, ++ _("Inputs"), ++ _("Array of input images"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsCompositeBase, in ), +- VIPS_TYPE_ARRAY_IMAGE ); ++ G_STRUCT_OFFSET(VipsCompositeBase, in), ++ VIPS_TYPE_ARRAY_IMAGE); + +- VIPS_ARG_BOXED( klass, "mode", 3, +- _( "Blend modes" ), +- _( "Array of VipsBlendMode to join with" ), ++ VIPS_ARG_BOXED(klass, "mode", 3, ++ _("Blend modes"), ++ _("Array of VipsBlendMode to join with"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsCompositeBase, mode ), +- VIPS_TYPE_ARRAY_INT ); ++ G_STRUCT_OFFSET(VipsCompositeBase, mode), ++ VIPS_TYPE_ARRAY_INT); + +- VIPS_ARG_BOXED( klass, "x", 4, +- _( "x coordinates" ), +- _( "Array of x coordinates to join at" ), ++ VIPS_ARG_BOXED(klass, "x", 4, ++ _("x coordinates"), ++ _("Array of x coordinates to join at"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsComposite, x ), +- VIPS_TYPE_ARRAY_INT ); ++ G_STRUCT_OFFSET(VipsComposite, x), ++ VIPS_TYPE_ARRAY_INT); + +- VIPS_ARG_BOXED( klass, "y", 5, +- _( "y coordinates" ), +- _( "Array of y coordinates to join at" ), ++ VIPS_ARG_BOXED(klass, "y", 5, ++ _("y coordinates"), ++ _("Array of y coordinates to join at"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsComposite, y ), +- VIPS_TYPE_ARRAY_INT ); +- ++ G_STRUCT_OFFSET(VipsComposite, y), ++ VIPS_TYPE_ARRAY_INT); + } + + static void +-vips_composite_init( VipsComposite *composite ) ++vips_composite_init(VipsComposite *composite) + { + } + + static int +-vips_compositev( VipsImage **in, VipsImage **out, int n, int *mode, va_list ap ) ++vips_compositev(VipsImage **in, VipsImage **out, int n, int *mode, va_list ap) + { + VipsArrayImage *image_array; + VipsArrayInt *mode_array; + int result; + +- image_array = vips_array_image_new( in, n ); +- mode_array = vips_array_int_new( mode, n - 1 ); +- result = vips_call_split( "composite", ap, +- image_array, out, mode_array ); +- vips_area_unref( VIPS_AREA( image_array ) ); +- vips_area_unref( VIPS_AREA( mode_array ) ); ++ image_array = vips_array_image_new(in, n); ++ mode_array = vips_array_int_new(mode, n - 1); ++ result = vips_call_split("composite", ap, ++ image_array, out, mode_array); ++ vips_area_unref(VIPS_AREA(image_array)); ++ vips_area_unref(VIPS_AREA(mode_array)); + +- return( result ); ++ return (result); + } + + /* See conversion.c for the doc comment. + */ + + int +-vips_composite( VipsImage **in, VipsImage **out, int n, int *mode, ... ) ++vips_composite(VipsImage **in, VipsImage **out, int n, int *mode, ...) + { + va_list ap; + int result; + +- va_start( ap, mode ); +- result = vips_compositev( in, out, n, mode, ap ); +- va_end( ap ); ++ va_start(ap, mode); ++ result = vips_compositev(in, out, n, mode, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + typedef struct _VipsComposite2 { +@@ -1684,94 +1642,93 @@ typedef VipsCompositeBaseClass VipsComposite2Class; + /* We need C linkage for this. + */ + extern "C" { +-G_DEFINE_TYPE( VipsComposite2, vips_composite2, vips_composite_base_get_type() ); ++G_DEFINE_TYPE(VipsComposite2, vips_composite2, vips_composite_base_get_type()); + } + + static int +-vips_composite2_build( VipsObject *object ) ++vips_composite2_build(VipsObject *object) + { + VipsCompositeBase *base = (VipsCompositeBase *) object; + VipsComposite2 *composite2 = (VipsComposite2 *) object; + +- if( composite2->overlay && +- composite2->base ) { ++ if (composite2->overlay && ++ composite2->base) { + VipsImage *in[3]; + int mode[1]; + + in[0] = composite2->base; + in[1] = composite2->overlay; + in[2] = NULL; +- base->in = vips_array_image_new( in, 2 ); ++ base->in = vips_array_image_new(in, 2); + + mode[0] = (int) composite2->mode; +- base->mode = vips_array_int_new( mode, 1 ); ++ base->mode = vips_array_int_new(mode, 1); + } + + base->x_offset = &composite2->x; + base->y_offset = &composite2->y; + +- if( VIPS_OBJECT_CLASS( vips_composite2_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_composite2_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_composite2_class_init( VipsCompositeClass *klass ) ++vips_composite2_class_init(VipsCompositeClass *klass) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( klass ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( klass ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( klass ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(klass); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(klass); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(klass); + +- VIPS_DEBUG_MSG( "vips_composite_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_composite_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "composite2"; + vobject_class->description = +- _( "blend a pair of images with a blend mode" ); ++ _("blend a pair of images with a blend mode"); + vobject_class->build = vips_composite2_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( klass, "base", 0, +- _( "Base" ), +- _( "Base image" ), ++ VIPS_ARG_IMAGE(klass, "base", 0, ++ _("Base"), ++ _("Base image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsComposite2, base ) ); ++ G_STRUCT_OFFSET(VipsComposite2, base)); + +- VIPS_ARG_IMAGE( klass, "overlay", 1, +- _( "Overlay" ), +- _( "Overlay image" ), ++ VIPS_ARG_IMAGE(klass, "overlay", 1, ++ _("Overlay"), ++ _("Overlay image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsComposite2, overlay ) ); ++ G_STRUCT_OFFSET(VipsComposite2, overlay)); + +- VIPS_ARG_ENUM( klass, "mode", 3, +- _( "Blend mode" ), +- _( "VipsBlendMode to join with" ), ++ VIPS_ARG_ENUM(klass, "mode", 3, ++ _("Blend mode"), ++ _("VipsBlendMode to join with"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsComposite2, mode ), +- VIPS_TYPE_BLEND_MODE, VIPS_BLEND_MODE_OVER ); ++ G_STRUCT_OFFSET(VipsComposite2, mode), ++ VIPS_TYPE_BLEND_MODE, VIPS_BLEND_MODE_OVER); + +- VIPS_ARG_INT( klass, "x", 4, +- _( "x" ), +- _( "x position of overlay" ), ++ VIPS_ARG_INT(klass, "x", 4, ++ _("x"), ++ _("x position of overlay"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsComposite2, x ), +- -VIPS_MAX_COORD, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsComposite2, x), ++ -VIPS_MAX_COORD, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( klass, "y", 5, +- _( "y" ), +- _( "y position of overlay" ), ++ VIPS_ARG_INT(klass, "y", 5, ++ _("y"), ++ _("y position of overlay"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsComposite2, y ), +- -VIPS_MAX_COORD, VIPS_MAX_COORD, 0 ); +- ++ G_STRUCT_OFFSET(VipsComposite2, y), ++ -VIPS_MAX_COORD, VIPS_MAX_COORD, 0); + } + + static void +-vips_composite2_init( VipsComposite2 *composite2 ) ++vips_composite2_init(VipsComposite2 *composite2) + { + } + +@@ -1779,8 +1736,8 @@ vips_composite2_init( VipsComposite2 *composite2 ) + */ + + int +-vips_composite2( VipsImage *base, VipsImage *overlay, VipsImage **out, +- VipsBlendMode mode, ... ) ++vips_composite2(VipsImage *base, VipsImage *overlay, VipsImage **out, ++ VipsBlendMode mode, ...) + { + va_list ap; + int result; +@@ -1793,15 +1750,14 @@ vips_composite2( VipsImage *base, VipsImage *overlay, VipsImage **out, + /* Triggers a clang compiler warning because mode might not be an int. + * I think the warning is harmless for all platforms we care about. + */ +- va_start( ap, mode ); ++ va_start(ap, mode); + +- g_assert( sizeof( mode ) == sizeof( int ) ); ++ g_assert(sizeof(mode) == sizeof(int)); + + #pragma GCC diagnostic pop + +- result = vips_call_split( "composite2", ap, base, overlay, out, mode ); +- va_end( ap ); ++ result = vips_call_split("composite2", ap, base, overlay, out, mode); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/conversion/conversion.c b/libvips/conversion/conversion.c +index 5886b617d1..2da303da5e 100644 +--- a/libvips/conversion/conversion.c ++++ b/libvips/conversion/conversion.c +@@ -6,28 +6,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -49,7 +49,7 @@ + + #include "pconversion.h" + +-/** ++/** + * SECTION: conversion + * @short_description: convert images in some way: change band format, change header, insert, extract, join + * @see_also: resample +@@ -84,36 +84,36 @@ + * * @x: #VipsArrayInt, position of subimages + * * @y: #VipsArrayInt, position of subimages + * +- * Composite an array of images together. ++ * Composite an array of images together. + * + * Images are placed in a stack, with @in[0] at the bottom and @in[@n - 1] at +- * the top. Pixels are blended together working from the bottom upwards, with ++ * the top. Pixels are blended together working from the bottom upwards, with + * the blend mode at each step being set by the corresponding #VipsBlendMode + * in @mode. + * + * Images are transformed to a compositing space before processing. This is + * #VIPS_INTERPRETATION_sRGB, #VIPS_INTERPRETATION_B_W, +- * #VIPS_INTERPRETATION_RGB16, or #VIPS_INTERPRETATION_GREY16 +- * by default, depending on +- * how many bands and bits the input images have. You can select any other ++ * #VIPS_INTERPRETATION_RGB16, or #VIPS_INTERPRETATION_GREY16 ++ * by default, depending on ++ * how many bands and bits the input images have. You can select any other + * space, such as #VIPS_INTERPRETATION_LAB or #VIPS_INTERPRETATION_scRGB. + * +- * The output image is in the compositing space. It will always be +- * #VIPS_FORMAT_FLOAT unless one of the inputs is #VIPS_FORMAT_DOUBLE, in ++ * The output image is in the compositing space. It will always be ++ * #VIPS_FORMAT_FLOAT unless one of the inputs is #VIPS_FORMAT_DOUBLE, in + * which case the output will be double as well. + * + * Complex images are not supported. + * + * The output image will always have an alpha band. A solid alpha is +- * added to any input missing an alpha. ++ * added to any input missing an alpha. + * + * The images do not need to match in size or format. They will be expanded to + * the smallest common size and format in the usual way. Images are positioned +- * using the @x and @y parameters, if set. ++ * using the @x and @y parameters, if set. + * + * Image are normally treated as unpremultiplied, so this operation can be used + * directly on PNG images. If your images have been through vips_premultiply(), +- * set @premultiplied. ++ * set @premultiplied. + * + * See also: vips_insert(). + * +@@ -168,7 +168,7 @@ + * @VIPS_BLEND_MODE_DIFFERENCE: difference of the two + * @VIPS_BLEND_MODE_EXCLUSION: somewhat like DIFFERENCE, but lower-contrast + * +- * The various Porter-Duff and PDF blend modes. See vips_composite(), ++ * The various Porter-Duff and PDF blend modes. See vips_composite(), + * for example. + * + * The Cairo docs have a nice explanation of all the blend modes: +@@ -178,7 +178,7 @@ + * The non-separable modes are not implemented. + */ + +-/** ++/** + * VipsAlign: + * @VIPS_ALIGN_LOW: align low coordinate edge + * @VIPS_ALIGN_CENTRE: align centre +@@ -192,7 +192,7 @@ + * See also: vips_join(). + */ + +-/** ++/** + * VipsAngle: + * @VIPS_ANGLE_D0: no rotate + * @VIPS_ANGLE_D90: 90 degrees clockwise +@@ -206,7 +206,7 @@ + * See also: vips_rot(). + */ + +-/** ++/** + * VipsInteresting: + * @VIPS_INTERESTING_NONE: do nothing + * @VIPS_INTERESTING_CENTRE: just take the centre +@@ -222,7 +222,7 @@ + * + * #VIPS_INTERESTING_NONE and #VIPS_INTERESTING_LOW mean the same -- the + * crop is positioned at the top or left. #VIPS_INTERESTING_HIGH positions at +- * the bottom or right. ++ * the bottom or right. + * + * See also: vips_smartcrop(). + */ +@@ -239,16 +239,16 @@ + * @VIPS_COMPASS_DIRECTION_SOUTH_WEST: south-west + * @VIPS_COMPASS_DIRECTION_NORTH_WEST: north-west + * +- * A direction on a compass. Used for vips_gravity(), for example. ++ * A direction on a compass. Used for vips_gravity(), for example. + */ + + /** + * VipsAngle45: + * @VIPS_ANGLE45_D0: no rotate +- * @VIPS_ANGLE45_D45: 45 degrees clockwise ++ * @VIPS_ANGLE45_D45: 45 degrees clockwise + * @VIPS_ANGLE45_D90: 90 degrees clockwise + * @VIPS_ANGLE45_D135: 135 degrees clockwise +- * @VIPS_ANGLE45_D180: 180 degrees ++ * @VIPS_ANGLE45_D180: 180 degrees + * @VIPS_ANGLE45_D225: 135 degrees anti-clockwise + * @VIPS_ANGLE45_D270: 90 degrees anti-clockwise + * @VIPS_ANGLE45_D315: 45 degrees anti-clockwise +@@ -260,7 +260,7 @@ + * See also: vips_rot45(). + */ + +-/** ++/** + * VipsExtend: + * @VIPS_EXTEND_BLACK: extend with black (all 0) pixels + * @VIPS_EXTEND_COPY: copy the image edges +@@ -272,9 +272,9 @@ + * See vips_embed(), vips_conv(), vips_affine() and so on. + * + * When the edges of an image are extended, you can specify +- * how you want the extension done. ++ * how you want the extension done. + * +- * #VIPS_EXTEND_BLACK --- new pixels are black, ie. all bits are zero. ++ * #VIPS_EXTEND_BLACK --- new pixels are black, ie. all bits are zero. + * + * #VIPS_EXTEND_COPY --- each new pixel takes the value of the nearest edge + * pixel +@@ -288,68 +288,68 @@ + * + * #VIPS_EXTEND_BACKGROUND --- colour set from the @background property + * +- * We have to specify the exact value of each enum member since we have to ++ * We have to specify the exact value of each enum member since we have to + * keep these frozen for back compat with vips7. + * + * See also: vips_embed(). + */ + +-/** ++/** + * VipsDirection: +- * @VIPS_DIRECTION_HORIZONTAL: left-right ++ * @VIPS_DIRECTION_HORIZONTAL: left-right + * @VIPS_DIRECTION_VERTICAL: top-bottom + * + * See vips_flip(), vips_join() and so on. + * + * Operations like vips_flip() need to be told whether to flip left-right or +- * top-bottom. ++ * top-bottom. + * + * See also: vips_flip(), vips_join(). + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsConversion, vips_conversion, VIPS_TYPE_OPERATION ); ++G_DEFINE_ABSTRACT_TYPE(VipsConversion, vips_conversion, VIPS_TYPE_OPERATION); + + static int +-vips_conversion_build( VipsObject *object ) ++vips_conversion_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + + #ifdef DEBUG +- printf( "vips_conversion_build: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_conversion_build: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- g_object_set( conversion, "out", vips_image_new(), NULL ); ++ g_object_set(conversion, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_conversion_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_conversion_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_conversion_class_init( VipsConversionClass *class ) ++vips_conversion_class_init(VipsConversionClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "conversion"; +- vobject_class->description = _( "conversion operations" ); ++ vobject_class->description = _("conversion operations"); + vobject_class->build = vips_conversion_build; + +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsConversion, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsConversion, out)); + } + + static void +-vips_conversion_init( VipsConversion *conversion ) ++vips_conversion_init(VipsConversion *conversion) + { + } + +@@ -357,62 +357,62 @@ vips_conversion_init( VipsConversion *conversion ) + * instead? + */ + void +-vips_conversion_operation_init( void ) ++vips_conversion_operation_init(void) + { +- extern GType vips_copy_get_type( void ); +- extern GType vips_tile_cache_get_type( void ); +- extern GType vips_line_cache_get_type( void ); +- extern GType vips_sequential_get_type( void ); +- extern GType vips_cache_get_type( void ); +- extern GType vips_embed_get_type( void ); +- extern GType vips_gravity_get_type( void ); +- extern GType vips_flip_get_type( void ); +- extern GType vips_insert_get_type( void ); +- extern GType vips_join_get_type( void ); +- extern GType vips_arrayjoin_get_type( void ); +- extern GType vips_extract_area_get_type( void ); +- extern GType vips_crop_get_type( void ); +- extern GType vips_smartcrop_get_type( void ); +- extern GType vips_extract_band_get_type( void ); +- extern GType vips_replicate_get_type( void ); +- extern GType vips_cast_get_type( void ); +- extern GType vips_bandjoin_get_type( void ); +- extern GType vips_bandjoin_const_get_type( void ); +- extern GType vips_bandrank_get_type( void ); +- extern GType vips_black_get_type( void ); +- extern GType vips_rot_get_type( void ); +- extern GType vips_rot45_get_type( void ); +- extern GType vips_autorot_get_type( void ); +- extern GType vips_ifthenelse_get_type( void ); +- extern GType vips_switch_get_type( void ); +- extern GType vips_recomb_get_type( void ); +- extern GType vips_bandmean_get_type( void ); +- extern GType vips_bandfold_get_type( void ); +- extern GType vips_bandunfold_get_type( void ); +- extern GType vips_flatten_get_type( void ); +- extern GType vips_premultiply_get_type( void ); +- extern GType vips_unpremultiply_get_type( void ); +- extern GType vips_bandbool_get_type( void ); +- extern GType vips_gaussnoise_get_type( void ); +- extern GType vips_grid_get_type( void ); +- extern GType vips_transpose3d_get_type( void ); +- extern GType vips_scale_get_type( void ); +- extern GType vips_wrap_get_type( void ); +- extern GType vips_zoom_get_type( void ); +- extern GType vips_subsample_get_type( void ); +- extern GType vips_msb_get_type( void ); +- extern GType vips_byteswap_get_type( void ); +- extern GType vips_xyz_get_type( void ); +- extern GType vips_falsecolour_get_type( void ); +- extern GType vips_gamma_get_type( void ); +- extern GType vips_composite_get_type( void ); +- extern GType vips_composite2_get_type( void ); ++ extern GType vips_copy_get_type(void); ++ extern GType vips_tile_cache_get_type(void); ++ extern GType vips_line_cache_get_type(void); ++ extern GType vips_sequential_get_type(void); ++ extern GType vips_cache_get_type(void); ++ extern GType vips_embed_get_type(void); ++ extern GType vips_gravity_get_type(void); ++ extern GType vips_flip_get_type(void); ++ extern GType vips_insert_get_type(void); ++ extern GType vips_join_get_type(void); ++ extern GType vips_arrayjoin_get_type(void); ++ extern GType vips_extract_area_get_type(void); ++ extern GType vips_crop_get_type(void); ++ extern GType vips_smartcrop_get_type(void); ++ extern GType vips_extract_band_get_type(void); ++ extern GType vips_replicate_get_type(void); ++ extern GType vips_cast_get_type(void); ++ extern GType vips_bandjoin_get_type(void); ++ extern GType vips_bandjoin_const_get_type(void); ++ extern GType vips_bandrank_get_type(void); ++ extern GType vips_black_get_type(void); ++ extern GType vips_rot_get_type(void); ++ extern GType vips_rot45_get_type(void); ++ extern GType vips_autorot_get_type(void); ++ extern GType vips_ifthenelse_get_type(void); ++ extern GType vips_switch_get_type(void); ++ extern GType vips_recomb_get_type(void); ++ extern GType vips_bandmean_get_type(void); ++ extern GType vips_bandfold_get_type(void); ++ extern GType vips_bandunfold_get_type(void); ++ extern GType vips_flatten_get_type(void); ++ extern GType vips_premultiply_get_type(void); ++ extern GType vips_unpremultiply_get_type(void); ++ extern GType vips_bandbool_get_type(void); ++ extern GType vips_gaussnoise_get_type(void); ++ extern GType vips_grid_get_type(void); ++ extern GType vips_transpose3d_get_type(void); ++ extern GType vips_scale_get_type(void); ++ extern GType vips_wrap_get_type(void); ++ extern GType vips_zoom_get_type(void); ++ extern GType vips_subsample_get_type(void); ++ extern GType vips_msb_get_type(void); ++ extern GType vips_byteswap_get_type(void); ++ extern GType vips_xyz_get_type(void); ++ extern GType vips_falsecolour_get_type(void); ++ extern GType vips_gamma_get_type(void); ++ extern GType vips_composite_get_type(void); ++ extern GType vips_composite2_get_type(void); + + vips_copy_get_type(); +- vips_tile_cache_get_type(); +- vips_line_cache_get_type(); +- vips_sequential_get_type(); +- vips_cache_get_type(); ++ vips_tile_cache_get_type(); ++ vips_line_cache_get_type(); ++ vips_sequential_get_type(); ++ vips_cache_get_type(); + vips_embed_get_type(); + vips_gravity_get_type(); + vips_flip_get_type(); +@@ -433,27 +433,27 @@ vips_conversion_operation_init( void ) + vips_rot45_get_type(); + vips_autorot_get_type(); + vips_ifthenelse_get_type(); +- vips_switch_get_type(); +- vips_recomb_get_type(); +- vips_bandmean_get_type(); +- vips_bandfold_get_type(); +- vips_bandunfold_get_type(); +- vips_flatten_get_type(); +- vips_premultiply_get_type(); +- vips_unpremultiply_get_type(); +- vips_bandbool_get_type(); +- vips_gaussnoise_get_type(); +- vips_grid_get_type(); +- vips_transpose3d_get_type(); +- vips_scale_get_type(); +- vips_wrap_get_type(); +- vips_zoom_get_type(); +- vips_subsample_get_type(); +- vips_msb_get_type(); +- vips_byteswap_get_type(); +- vips_xyz_get_type(); +- vips_falsecolour_get_type(); +- vips_gamma_get_type(); +- vips_composite_get_type(); +- vips_composite2_get_type(); ++ vips_switch_get_type(); ++ vips_recomb_get_type(); ++ vips_bandmean_get_type(); ++ vips_bandfold_get_type(); ++ vips_bandunfold_get_type(); ++ vips_flatten_get_type(); ++ vips_premultiply_get_type(); ++ vips_unpremultiply_get_type(); ++ vips_bandbool_get_type(); ++ vips_gaussnoise_get_type(); ++ vips_grid_get_type(); ++ vips_transpose3d_get_type(); ++ vips_scale_get_type(); ++ vips_wrap_get_type(); ++ vips_zoom_get_type(); ++ vips_subsample_get_type(); ++ vips_msb_get_type(); ++ vips_byteswap_get_type(); ++ vips_xyz_get_type(); ++ vips_falsecolour_get_type(); ++ vips_gamma_get_type(); ++ vips_composite_get_type(); ++ vips_composite2_get_type(); + } +diff --git a/libvips/conversion/copy.c b/libvips/conversion/copy.c +index 312a51fc73..f04c93c56a 100644 +--- a/libvips/conversion/copy.c ++++ b/libvips/conversion/copy.c +@@ -1,9 +1,9 @@ +-/* Copy an image. ++/* Copy an image. + * + * Copyright: 1990, N. Dessipris, based on im_powtra() + * Author: Nicos Dessipris + * Written on: 02/05/1990 +- * Modified on: ++ * Modified on: + * 23/4/93 J.Cupitt + * - adapted to work with partial images + * 30/6/93 JC +@@ -58,28 +58,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -119,7 +119,7 @@ typedef struct _VipsCopy { + int xoffset; + int yoffset; + int bands; +- VipsBandFormat format; ++ VipsBandFormat format; + VipsCoding coding; + int width; + int height; +@@ -128,41 +128,41 @@ typedef struct _VipsCopy { + + typedef VipsConversionClass VipsCopyClass; + +-G_DEFINE_TYPE( VipsCopy, vips_copy, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsCopy, vips_copy, VIPS_TYPE_CONVERSION); + + static int +-vips_copy_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop ) ++vips_copy_gen(VipsRegion * or, void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + +- if( vips_region_prepare( ir, r ) || +- vips_region_region( or, ir, r, r->left, r->top ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, r) || ++ vips_region_region(or, ir, r, r->left, r->top)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* The props we copy, if set, from the operation to the image. + */ + static const char *vips_copy_names[] = { +- "interpretation", +- "xres", +- "yres", +- "xoffset", ++ "interpretation", ++ "xres", ++ "yres", ++ "xoffset", + "yoffset", +- "bands", +- "format", +- "coding", +- "width", ++ "bands", ++ "format", ++ "coding", ++ "width", + "height" +-}; ++}; + + static int +-vips_copy_build( VipsObject *object ) ++vips_copy_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsCopy *copy = (VipsCopy *) object; + + guint64 pel_size_before; +@@ -170,19 +170,19 @@ vips_copy_build( VipsObject *object ) + VipsImage copy_of_fields; + int i; + +- if( VIPS_OBJECT_CLASS( vips_copy_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_copy_parent_class)->build(object)) ++ return (-1); + +- if( vips_image_pio_input( copy->in ) ) +- return( -1 ); ++ if (vips_image_pio_input(copy->in)) ++ return (-1); + +- if( copy->swap ) +- g_warning( "%s", +- _( "copy swap is deprecated, use byteswap instead" ) ); ++ if (copy->swap) ++ g_warning("%s", ++ _("copy swap is deprecated, use byteswap instead")); + +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, copy->in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, copy->in, NULL)) ++ return (-1); + + /* Take a copy of all the basic header fields. We use this for + * sanity-checking the changes our caller has made. +@@ -191,168 +191,170 @@ vips_copy_build( VipsObject *object ) + + /* Use props to adjust header fields. + */ +- for( i = 0; i < VIPS_NUMBER( vips_copy_names ); i++ ) { ++ for (i = 0; i < VIPS_NUMBER(vips_copy_names); i++) { + const char *name = vips_copy_names[i]; + + GParamSpec *pspec; + VipsArgumentClass *argument_class; + VipsArgumentInstance *argument_instance; + +- if( vips_object_get_argument( object, name, +- &pspec, &argument_class, &argument_instance ) ) +- return( -1 ); ++ if (vips_object_get_argument(object, name, ++ &pspec, &argument_class, &argument_instance)) ++ return (-1); + +- if( argument_instance->assigned ) { +- GType type = G_PARAM_SPEC_VALUE_TYPE( pspec ); +- GValue value = { 0, }; ++ if (argument_instance->assigned) { ++ GType type = G_PARAM_SPEC_VALUE_TYPE(pspec); ++ GValue value = { ++ 0, ++ }; + +- g_value_init( &value, type ); +- g_object_get_property( G_OBJECT( object ), +- name, &value ); ++ g_value_init(&value, type); ++ g_object_get_property(G_OBJECT(object), ++ name, &value); + + #ifdef VIPS_DEBUG +-{ +- char *str; ++ { ++ char *str; + +- str = g_strdup_value_contents( &value ); +- printf( "vips_copy_build: %s = %s\n", name, str ); +- g_free( str ); +-} ++ str = g_strdup_value_contents(&value); ++ printf("vips_copy_build: %s = %s\n", name, str); ++ g_free(str); ++ } + #endif /* VIPS_DEBUG */ + +- g_object_set_property( G_OBJECT( conversion->out ), +- name, &value ); +- g_value_unset( &value ); ++ g_object_set_property(G_OBJECT(conversion->out), ++ name, &value); ++ g_value_unset(&value); + } + } + + /* Disallow changes which alter sizeof(pel). + */ +- pel_size_before = VIPS_IMAGE_SIZEOF_PEL( ©_of_fields ); +- pel_size_after = VIPS_IMAGE_SIZEOF_PEL( conversion->out ); +- if( pel_size_after != pel_size_before ) { +- vips_error( class->nickname, +- "%s", _( "must not change pel size" ) ); +- return( -1 ); ++ pel_size_before = VIPS_IMAGE_SIZEOF_PEL(©_of_fields); ++ pel_size_after = VIPS_IMAGE_SIZEOF_PEL(conversion->out); ++ if (pel_size_after != pel_size_before) { ++ vips_error(class->nickname, ++ "%s", _("must not change pel size")); ++ return (-1); + } + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_copy_gen, vips_stop_one, +- copy->in, copy ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_copy_gen, vips_stop_one, ++ copy->in, copy)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_copy_class_init( VipsCopyClass *class ) ++vips_copy_class_init(VipsCopyClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_copy_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_copy_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "copy"; +- vobject_class->description = _( "copy an image" ); ++ vobject_class->description = _("copy an image"); + vobject_class->build = vips_copy_build; + + /* We use copy to make fresh vipsimages to stop sharing, so don't + * cache it. Plus copy is cheap. + */ +- operation_class->flags = +- VIPS_OPERATION_SEQUENTIAL | ++ operation_class->flags = ++ VIPS_OPERATION_SEQUENTIAL | + VIPS_OPERATION_NOCACHE; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsCopy, in ) ); ++ G_STRUCT_OFFSET(VipsCopy, in)); + +- VIPS_ARG_BOOL( class, "swap", 2, +- _( "Swap" ), +- _( "Swap bytes in image between little and big-endian" ), ++ VIPS_ARG_BOOL(class, "swap", 2, ++ _("Swap"), ++ _("Swap bytes in image between little and big-endian"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsCopy, swap ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsCopy, swap), ++ FALSE); + +- VIPS_ARG_INT( class, "width", 3, +- _( "Width" ), +- _( "Image width in pixels" ), ++ VIPS_ARG_INT(class, "width", 3, ++ _("Width"), ++ _("Image width in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCopy, width ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsCopy, width), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "height", 4, +- _( "Height" ), +- _( "Image height in pixels" ), ++ VIPS_ARG_INT(class, "height", 4, ++ _("Height"), ++ _("Image height in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCopy, height ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsCopy, height), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "bands", 5, +- _( "Bands" ), +- _( "Number of bands in image" ), ++ VIPS_ARG_INT(class, "bands", 5, ++ _("Bands"), ++ _("Number of bands in image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCopy, bands ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsCopy, bands), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_ENUM( class, "format", 6, +- _( "Format" ), +- _( "Pixel format in image" ), ++ VIPS_ARG_ENUM(class, "format", 6, ++ _("Format"), ++ _("Pixel format in image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCopy, format ), +- VIPS_TYPE_BAND_FORMAT, VIPS_FORMAT_UCHAR ); ++ G_STRUCT_OFFSET(VipsCopy, format), ++ VIPS_TYPE_BAND_FORMAT, VIPS_FORMAT_UCHAR); + +- VIPS_ARG_ENUM( class, "coding", 7, +- _( "Coding" ), +- _( "Pixel coding" ), ++ VIPS_ARG_ENUM(class, "coding", 7, ++ _("Coding"), ++ _("Pixel coding"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCopy, coding ), +- VIPS_TYPE_CODING, VIPS_CODING_NONE ); ++ G_STRUCT_OFFSET(VipsCopy, coding), ++ VIPS_TYPE_CODING, VIPS_CODING_NONE); + +- VIPS_ARG_ENUM( class, "interpretation", 8, +- _( "Interpretation" ), +- _( "Pixel interpretation" ), ++ VIPS_ARG_ENUM(class, "interpretation", 8, ++ _("Interpretation"), ++ _("Pixel interpretation"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCopy, interpretation ), +- VIPS_TYPE_INTERPRETATION, VIPS_INTERPRETATION_MULTIBAND ); ++ G_STRUCT_OFFSET(VipsCopy, interpretation), ++ VIPS_TYPE_INTERPRETATION, VIPS_INTERPRETATION_MULTIBAND); + +- VIPS_ARG_DOUBLE( class, "xres", 9, +- _( "Xres" ), +- _( "Horizontal resolution in pixels/mm" ), ++ VIPS_ARG_DOUBLE(class, "xres", 9, ++ _("Xres"), ++ _("Horizontal resolution in pixels/mm"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCopy, xres ), +- -0.0, 1000000, 0 ); ++ G_STRUCT_OFFSET(VipsCopy, xres), ++ -0.0, 1000000, 0); + +- VIPS_ARG_DOUBLE( class, "yres", 10, +- _( "Yres" ), +- _( "Vertical resolution in pixels/mm" ), ++ VIPS_ARG_DOUBLE(class, "yres", 10, ++ _("Yres"), ++ _("Vertical resolution in pixels/mm"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCopy, yres ), +- -0.0, 1000000, 0 ); ++ G_STRUCT_OFFSET(VipsCopy, yres), ++ -0.0, 1000000, 0); + +- VIPS_ARG_INT( class, "xoffset", 11, +- _( "Xoffset" ), +- _( "Horizontal offset of origin" ), ++ VIPS_ARG_INT(class, "xoffset", 11, ++ _("Xoffset"), ++ _("Horizontal offset of origin"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCopy, xoffset ), +- -VIPS_MAX_COORD, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsCopy, xoffset), ++ -VIPS_MAX_COORD, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "yoffset", 12, +- _( "Yoffset" ), +- _( "Vertical offset of origin" ), ++ VIPS_ARG_INT(class, "yoffset", 12, ++ _("Yoffset"), ++ _("Vertical offset of origin"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCopy, yoffset ), +- -VIPS_MAX_COORD, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsCopy, yoffset), ++ -VIPS_MAX_COORD, VIPS_MAX_COORD, 0); + } + + static void +-vips_copy_init( VipsCopy *copy ) ++vips_copy_init(VipsCopy *copy) + { + /* Init our instance fields. + */ +@@ -377,7 +379,7 @@ vips_copy_init( VipsCopy *copy ) + * * @xoffset: %gint, set image xoffset + * * @yoffset: %gint, set image yoffset + * +- * Copy an image, optionally modifying the header. VIPS copies images by ++ * Copy an image, optionally modifying the header. VIPS copies images by + * copying pointers, so this operation is instant, even for very large images. + * + * You can optionally change any or all header fields during the copy. You can +@@ -385,21 +387,21 @@ vips_copy_init( VipsCopy *copy ) + * you can turn a 4-band uchar image into a 2-band ushort image, but you + * cannot change a 100 x 100 RGB image into a 300 x 100 mono image. + * +- * See also: vips_byteswap(), vips_bandfold(), vips_bandunfold(). ++ * See also: vips_byteswap(), vips_bandfold(), vips_bandunfold(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_copy( VipsImage *in, VipsImage **out, ... ) ++vips_copy(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "copy", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("copy", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -408,11 +410,11 @@ vips_copy( VipsImage *in, VipsImage **out, ... ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * A simple convenience function to copy an image to a file, then copy +- * again to output. If the image is already a file, just copy straight ++ * A simple convenience function to copy an image to a file, then copy ++ * again to output. If the image is already a file, just copy straight + * through. + * +- * The file is allocated with vips_image_new_temp_file(). ++ * The file is allocated with vips_image_new_temp_file(). + * The file is automatically deleted when @out is closed. + * + * See also: vips_copy(), vips_image_new_temp_file(). +@@ -421,21 +423,21 @@ vips_copy( VipsImage *in, VipsImage **out, ... ) + */ + + int +-vips_copy_file( VipsImage *in, VipsImage **out, ... ) ++vips_copy_file(VipsImage *in, VipsImage **out, ...) + { + VipsImage *file; + +- if( vips_image_isfile( in ) ) +- return( vips_copy( in, out, NULL ) ); ++ if (vips_image_isfile(in)) ++ return (vips_copy(in, out, NULL)); + +- if( !(file = vips_image_new_temp_file( "%s.v" )) ) +- return( -1 ); +- if( vips_image_write( in, file ) || +- vips_image_pio_input( file ) ) { +- g_object_unref( file ); +- return( -1 ); ++ if (!(file = vips_image_new_temp_file("%s.v"))) ++ return (-1); ++ if (vips_image_write(in, file) || ++ vips_image_pio_input(file)) { ++ g_object_unref(file); ++ return (-1); + } + *out = file; + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/conversion/embed.c b/libvips/conversion/embed.c +index c10fc77839..7344c0d0ab 100644 +--- a/libvips/conversion/embed.c ++++ b/libvips/conversion/embed.c +@@ -2,11 +2,11 @@ + * + * Author: J. Cupitt + * Written on: 21/2/95 +- * Modified on: ++ * Modified on: + * 6/4/04 + * - added extend pixels from edge mode + * - sets Xoffset / Yoffset to x / y +- * 15/4/04 ++ * 15/4/04 + * - added replicate and mirror modes + * 4/3/05 + * - added solid white mode +@@ -31,28 +31,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -92,10 +92,10 @@ typedef struct _VipsEmbedBase { + */ + VipsPel *ink; + +- /* Geometry calculations. ++ /* Geometry calculations. + */ +- VipsRect rout; /* Whole output area */ +- VipsRect rsub; /* Rect occupied by image */ ++ VipsRect rout; /* Whole output area */ ++ VipsRect rsub; /* Rect occupied by image */ + + /* The 8 border pieces. The 4 borders strictly up/down/left/right of + * the main image, and the 4 corner pieces. +@@ -110,30 +110,30 @@ typedef struct _VipsEmbedBase { + + typedef VipsConversionClass VipsEmbedBaseClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsEmbedBase, vips_embed_base, VIPS_TYPE_CONVERSION ); ++G_DEFINE_ABSTRACT_TYPE(VipsEmbedBase, vips_embed_base, VIPS_TYPE_CONVERSION); + + /* r is the bit we are trying to paint, guaranteed to be entirely within + * border area i. Set out to be the edge of the image we need to paint the + * pixels in r. + */ + static void +-vips_embed_base_find_edge( VipsEmbedBase *base, +- VipsRect *r, int i, VipsRect *out ) ++vips_embed_base_find_edge(VipsEmbedBase *base, ++ VipsRect *r, int i, VipsRect *out) + { + /* Expand the border by 1 pixel, intersect with the image area, and we + * get the edge. Usually too much though: eg. we could make the entire + * right edge. + */ + *out = base->border[i]; +- vips_rect_marginadjust( out, 1 ); +- vips_rect_intersectrect( out, &base->rsub, out ); ++ vips_rect_marginadjust(out, 1); ++ vips_rect_intersectrect(out, &base->rsub, out); + + /* Usually too much though: eg. we could make the entire + * right edge. If we're strictly up/down/left/right of the image, we + * can trim. + */ +- if( i == 0 || +- i == 2 ) { ++ if (i == 0 || ++ i == 2) { + VipsRect extend; + + /* Above or below. +@@ -141,10 +141,10 @@ vips_embed_base_find_edge( VipsEmbedBase *base, + extend = *r; + extend.top = 0; + extend.height = base->height; +- vips_rect_intersectrect( out, &extend, out ); ++ vips_rect_intersectrect(out, &extend, out); + } +- if( i == 1 || +- i == 3 ) { ++ if (i == 1 || ++ i == 3) { + VipsRect extend; + + /* Left or right. +@@ -152,40 +152,40 @@ vips_embed_base_find_edge( VipsEmbedBase *base, + extend = *r; + extend.left = 0; + extend.width = base->width; +- vips_rect_intersectrect( out, &extend, out ); ++ vips_rect_intersectrect(out, &extend, out); + } + } + + /* Copy a single pixel sideways into a line of pixels. + */ + static void +-vips_embed_base_copy_pixel( VipsEmbedBase *base, +- VipsPel *q, VipsPel *p, int n ) ++vips_embed_base_copy_pixel(VipsEmbedBase *base, ++ VipsPel *q, VipsPel *p, int n) + { +- const int bs = VIPS_IMAGE_SIZEOF_PEL( base->in ); ++ const int bs = VIPS_IMAGE_SIZEOF_PEL(base->in); + + int x, b; + +- for( x = 0; x < n; x++ ) +- for( b = 0; b < bs; b++ ) ++ for (x = 0; x < n; x++) ++ for (b = 0; b < bs; b++) + *q++ = p[b]; + } + +-/* Paint r of region or. It's a border area, lying entirely within +- * base->border[i]. p points to the top-left source pixel to fill with. ++/* Paint r of region or. It's a border area, lying entirely within ++ * base->border[i]. p points to the top-left source pixel to fill with. + * plsk is the line stride. + */ + static void +-vips_embed_base_paint_edge( VipsEmbedBase *base, +- VipsRegion *or, int i, VipsRect *r, VipsPel *p, int plsk ) ++vips_embed_base_paint_edge(VipsEmbedBase *base, ++ VipsRegion * or, int i, VipsRect *r, VipsPel *p, int plsk) + { +- const int bs = VIPS_IMAGE_SIZEOF_PEL( base->in ); ++ const int bs = VIPS_IMAGE_SIZEOF_PEL(base->in); + + VipsRect todo; + VipsPel *q; + int y; + +- VIPS_GATE_START( "vips_embed_base_paint_edge: work" ); ++ VIPS_GATE_START("vips_embed_base_paint_edge: work"); + + /* Pixels left to paint. + */ +@@ -194,43 +194,43 @@ vips_embed_base_paint_edge( VipsEmbedBase *base, + /* Corner pieces ... copy the single pixel to paint the top line of + * todo, then use the line copier below to paint the rest of it. + */ +- if( i > 3 ) { +- q = VIPS_REGION_ADDR( or, todo.left, todo.top ); +- vips_embed_base_copy_pixel( base, q, p, todo.width ); ++ if (i > 3) { ++ q = VIPS_REGION_ADDR(or, todo.left, todo.top); ++ vips_embed_base_copy_pixel(base, q, p, todo.width); + + p = q; + todo.top += 1; + todo.height -= 1; + } + +- if( i == 1 || i == 3 ) { ++ if (i == 1 || i == 3) { + /* Vertical line of pixels to copy. + */ +- for( y = 0; y < todo.height; y++ ) { +- q = VIPS_REGION_ADDR( or, todo.left, todo.top + y ); +- vips_embed_base_copy_pixel( base, q, p, todo.width ); ++ for (y = 0; y < todo.height; y++) { ++ q = VIPS_REGION_ADDR(or, todo.left, todo.top + y); ++ vips_embed_base_copy_pixel(base, q, p, todo.width); + p += plsk; + } + } + else { + /* Horizontal line of pixels to copy. + */ +- for( y = 0; y < todo.height; y++ ) { +- q = VIPS_REGION_ADDR( or, todo.left, todo.top + y ); +- memcpy( q, p, bs * todo.width ); ++ for (y = 0; y < todo.height; y++) { ++ q = VIPS_REGION_ADDR(or, todo.left, todo.top + y); ++ memcpy(q, p, bs * todo.width); + } + } + +- VIPS_GATE_STOP( "vips_embed_base_paint_edge: work" ); ++ VIPS_GATE_STOP("vips_embed_base_paint_edge: work"); + } + + static int +-vips_embed_base_gen( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_embed_base_gen(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + VipsEmbedBase *base = (VipsEmbedBase *) b; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + + VipsRect ovl; + int i; +@@ -240,82 +240,82 @@ vips_embed_base_gen( VipsRegion *or, + /* Entirely within the input image? Generate the subimage and copy + * pointers. + */ +- if( vips_rect_includesrect( &base->rsub, r ) ) { ++ if (vips_rect_includesrect(&base->rsub, r)) { + VipsRect need; + + need = *r; + need.left -= base->x; + need.top -= base->y; +- if( vips_region_prepare( ir, &need ) || +- vips_region_region( or, ir, r, need.left, need.top ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &need) || ++ vips_region_region(or, ir, r, need.left, need.top)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +- /* Does any of the input image appear in the area we have been asked ++ /* Does any of the input image appear in the area we have been asked + * to make? Paste it in. + */ +- vips_rect_intersectrect( r, &base->rsub, &ovl ); +- if( !vips_rect_isempty( &ovl ) ) { ++ vips_rect_intersectrect(r, &base->rsub, &ovl); ++ if (!vips_rect_isempty(&ovl)) { + /* Paint the bits coming from the input image. + */ + ovl.left -= base->x; + ovl.top -= base->y; +- if( vips_region_prepare_to( ir, or, &ovl, +- ovl.left + base->x, ovl.top + base->y ) ) +- return( -1 ); ++ if (vips_region_prepare_to(ir, or, &ovl, ++ ovl.left + base->x, ovl.top + base->y)) ++ return (-1); + ovl.left += base->x; + ovl.top += base->y; + } + +- switch( base->extend ) { ++ switch (base->extend) { + case VIPS_EXTEND_BLACK: + case VIPS_EXTEND_WHITE: +- VIPS_GATE_START( "vips_embed_base_gen: work1" ); ++ VIPS_GATE_START("vips_embed_base_gen: work1"); + + /* Paint the borders a solid value. + */ +- for( i = 0; i < 8; i++ ) +- vips_region_paint( or, &base->border[i], +- base->extend == 0 ? 0 : 255 ); ++ for (i = 0; i < 8; i++) ++ vips_region_paint(or, &base->border[i], ++ base->extend == 0 ? 0 : 255); + +- VIPS_GATE_STOP( "vips_embed_base_gen: work1" ); ++ VIPS_GATE_STOP("vips_embed_base_gen: work1"); + + break; + + case VIPS_EXTEND_BACKGROUND: +- VIPS_GATE_START( "vips_embed_base_gen: work2" ); ++ VIPS_GATE_START("vips_embed_base_gen: work2"); + + /* Paint the borders a solid value. + */ +- for( i = 0; i < 8; i++ ) +- vips_region_paint_pel( or, &base->border[i], base->ink ); ++ for (i = 0; i < 8; i++) ++ vips_region_paint_pel(or, &base->border[i], base->ink); + +- VIPS_GATE_STOP( "vips_embed_base_gen: work2" ); ++ VIPS_GATE_STOP("vips_embed_base_gen: work2"); + + break; + + case VIPS_EXTEND_COPY: + /* Extend the borders. + */ +- for( i = 0; i < 8; i++ ) { ++ for (i = 0; i < 8; i++) { + VipsRect todo; + VipsRect edge; + +- vips_rect_intersectrect( r, &base->border[i], &todo ); +- if( !vips_rect_isempty( &todo ) ) { +- vips_embed_base_find_edge( base, +- &todo, i, &edge ); ++ vips_rect_intersectrect(r, &base->border[i], &todo); ++ if (!vips_rect_isempty(&todo)) { ++ vips_embed_base_find_edge(base, ++ &todo, i, &edge); + + /* Did we paint any of the input image? If we + * did, we can fetch the edge pixels from + * that. + */ +- if( !vips_rect_isempty( &ovl ) ) { +- p = VIPS_REGION_ADDR( or, +- edge.left, edge.top ); +- plsk = VIPS_REGION_LSKIP( or ); ++ if (!vips_rect_isempty(&ovl)) { ++ p = VIPS_REGION_ADDR(or, ++ edge.left, edge.top); ++ plsk = VIPS_REGION_LSKIP(or); + } + else { + /* No pixels painted ... fetch +@@ -323,85 +323,78 @@ vips_embed_base_gen( VipsRegion *or, + */ + edge.left -= base->x; + edge.top -= base->y; +- if( vips_region_prepare( ir, &edge ) ) +- return( -1 ); +- p = VIPS_REGION_ADDR( ir, +- edge.left, edge.top ); +- plsk = VIPS_REGION_LSKIP( ir ); ++ if (vips_region_prepare(ir, &edge)) ++ return (-1); ++ p = VIPS_REGION_ADDR(ir, ++ edge.left, edge.top); ++ plsk = VIPS_REGION_LSKIP(ir); + } + +- vips_embed_base_paint_edge( base, +- or, i, &todo, p, plsk ); ++ vips_embed_base_paint_edge(base, ++ or, i, &todo, p, plsk); + } + } + + break; + +- default: ++ default: + g_assert_not_reached(); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_embed_base_build( VipsObject *object ) ++vips_embed_base_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsEmbedBase *base = (VipsEmbedBase *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 7 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 7); + + VipsRect want; + +- if( VIPS_OBJECT_CLASS( vips_embed_base_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_embed_base_parent_class)->build(object)) ++ return (-1); + + /* nip2 can generate this quite often ... just copy. + */ +- if( base->x == 0 && +- base->y == 0 && +- base->width == base->in->Xsize && +- base->height == base->in->Ysize ) +- return( vips_image_write( base->in, conversion->out ) ); +- +- if( !vips_object_argument_isset( object, "extend" ) && +- vips_object_argument_isset( object, "background" ) ) +- base->extend = VIPS_EXTEND_BACKGROUND; +- +- if( base->extend == VIPS_EXTEND_BACKGROUND ) +- if( !(base->ink = vips__vector_to_ink( +- class->nickname, base->in, +- VIPS_AREA( base->background )->data, NULL, +- VIPS_AREA( base->background )->n )) ) +- return( -1 ); +- +- switch( base->extend ) { +- case VIPS_EXTEND_REPEAT: +-{ ++ if (base->x == 0 && ++ base->y == 0 && ++ base->width == base->in->Xsize && ++ base->height == base->in->Ysize) ++ return (vips_image_write(base->in, conversion->out)); ++ ++ if (!vips_object_argument_isset(object, "extend") && ++ vips_object_argument_isset(object, "background")) ++ base->extend = VIPS_EXTEND_BACKGROUND; ++ ++ if (base->extend == VIPS_EXTEND_BACKGROUND) ++ if (!(base->ink = vips__vector_to_ink( ++ class->nickname, base->in, ++ VIPS_AREA(base->background)->data, NULL, ++ VIPS_AREA(base->background)->n))) ++ return (-1); ++ ++ switch (base->extend) { ++ case VIPS_EXTEND_REPEAT: { + /* Clock arithmetic: we want negative x/y to wrap around + * nicely. + */ +- const int nx = base->x < 0 ? +- -base->x % base->in->Xsize : +- base->in->Xsize - base->x % base->in->Xsize; +- const int ny = base->y < 0 ? +- -base->y % base->in->Ysize : +- base->in->Ysize - base->y % base->in->Ysize; +- +- if( vips_replicate( base->in, &t[0], +- base->width / base->in->Xsize + 2, +- base->height / base->in->Ysize + 2, NULL ) || +- vips_extract_area( t[0], &t[1], +- nx, ny, base->width, base->height, NULL ) || +- vips_image_write( t[1], conversion->out ) ) +- return( -1 ); ++ const int nx = base->x < 0 ? -base->x % base->in->Xsize : base->in->Xsize - base->x % base->in->Xsize; ++ const int ny = base->y < 0 ? -base->y % base->in->Ysize : base->in->Ysize - base->y % base->in->Ysize; + +-} +- break; ++ if (vips_replicate(base->in, &t[0], ++ base->width / base->in->Xsize + 2, ++ base->height / base->in->Ysize + 2, NULL) || ++ vips_extract_area(t[0], &t[1], ++ nx, ny, base->width, base->height, NULL) || ++ vips_image_write(t[1], conversion->out)) ++ return (-1); + +- case VIPS_EXTEND_MIRROR: +-{ ++ } break; ++ ++ case VIPS_EXTEND_MIRROR: { + /* As repeat, but the tiles are twice the size because of + * mirroring. + */ +@@ -411,47 +404,46 @@ vips_embed_base_build( VipsObject *object ) + const int nx = base->x < 0 ? -base->x % w2 : w2 - base->x % w2; + const int ny = base->y < 0 ? -base->y % h2 : h2 - base->y % h2; + +- if( ++ if ( + /* Make a 2x2 mirror tile. + */ +- vips_flip( base->in, &t[0], +- VIPS_DIRECTION_HORIZONTAL, NULL ) || +- vips_join( base->in, t[0], &t[1], +- VIPS_DIRECTION_HORIZONTAL, NULL ) || +- vips_flip( t[1], &t[2], +- VIPS_DIRECTION_VERTICAL, NULL ) || +- vips_join( t[1], t[2], &t[3], +- VIPS_DIRECTION_VERTICAL, NULL ) || ++ vips_flip(base->in, &t[0], ++ VIPS_DIRECTION_HORIZONTAL, NULL) || ++ vips_join(base->in, t[0], &t[1], ++ VIPS_DIRECTION_HORIZONTAL, NULL) || ++ vips_flip(t[1], &t[2], ++ VIPS_DIRECTION_VERTICAL, NULL) || ++ vips_join(t[1], t[2], &t[3], ++ VIPS_DIRECTION_VERTICAL, NULL) || + + /* Repeat, then cut out the centre. + */ +- vips_replicate( t[3], &t[4], +- base->width / t[3]->Xsize + 2, +- base->height / t[3]->Ysize + 2, NULL ) || +- vips_extract_area( t[4], &t[5], +- nx, ny, base->width, base->height, NULL ) || ++ vips_replicate(t[3], &t[4], ++ base->width / t[3]->Xsize + 2, ++ base->height / t[3]->Ysize + 2, NULL) || ++ vips_extract_area(t[4], &t[5], ++ nx, ny, base->width, base->height, NULL) || + + /* Overwrite the centre with the in, much faster + * for centre pixels. + */ +- vips_insert( t[5], base->in, &t[6], +- base->x, base->y, NULL ) || ++ vips_insert(t[5], base->in, &t[6], ++ base->x, base->y, NULL) || + +- vips_image_write( t[6], conversion->out ) ) +- return( -1 ); +-} +- break; ++ vips_image_write(t[6], conversion->out)) ++ return (-1); ++ } break; + + case VIPS_EXTEND_BLACK: + case VIPS_EXTEND_WHITE: + case VIPS_EXTEND_BACKGROUND: + case VIPS_EXTEND_COPY: + /* embed is used in many places. We don't really care about +- * geometry, so use ANY to avoid disturbing all pipelines. ++ * geometry, so use ANY to avoid disturbing all pipelines. + */ +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_ANY, base->in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_ANY, base->in, NULL)) ++ return (-1); + + conversion->out->Xsize = base->width; + conversion->out->Ysize = base->height; +@@ -469,16 +461,16 @@ vips_embed_base_build( VipsObject *object ) + want.top = base->y; + want.width = base->in->Xsize; + want.height = base->in->Ysize; +- vips_rect_intersectrect( &want, &base->rout, &base->rsub ); ++ vips_rect_intersectrect(&want, &base->rout, &base->rsub); + +- /* FIXME ... actually, it can't. base_find_edge() will fail +- * if rsub is empty. Make this more general at some point ++ /* FIXME ... actually, it can't. base_find_edge() will fail ++ * if rsub is empty. Make this more general at some point + * and remove this test. + */ +- if( vips_rect_isempty( &base->rsub ) ) { +- vips_error( class->nickname, +- "%s", _( "bad dimensions" ) ); +- return( -1 ); ++ if (vips_rect_isempty(&base->rsub)) { ++ vips_error(class->nickname, ++ "%s", _("bad dimensions")); ++ return (-1); + } + + /* Edge rects of new pixels ... top, right, bottom, left. Order +@@ -489,24 +481,24 @@ vips_embed_base_build( VipsObject *object ) + base->border[0].width = base->rsub.width; + base->border[0].height = base->rsub.top; + +- base->border[1].left = VIPS_RECT_RIGHT( &base->rsub ); ++ base->border[1].left = VIPS_RECT_RIGHT(&base->rsub); + base->border[1].top = base->rsub.top; +- base->border[1].width = conversion->out->Xsize - +- VIPS_RECT_RIGHT( &base->rsub ); ++ base->border[1].width = conversion->out->Xsize - ++ VIPS_RECT_RIGHT(&base->rsub); + base->border[1].height = base->rsub.height; + +- base->border[2].left = base->rsub.left; +- base->border[2].top = VIPS_RECT_BOTTOM( &base->rsub ); ++ base->border[2].left = base->rsub.left; ++ base->border[2].top = VIPS_RECT_BOTTOM(&base->rsub); + base->border[2].width = base->rsub.width; +- base->border[2].height = conversion->out->Ysize - +- VIPS_RECT_BOTTOM( &base->rsub ); ++ base->border[2].height = conversion->out->Ysize - ++ VIPS_RECT_BOTTOM(&base->rsub); + +- base->border[3].left = 0; ++ base->border[3].left = 0; + base->border[3].top = base->rsub.top; + base->border[3].width = base->rsub.left; + base->border[3].height = base->rsub.height; + +- /* Corner rects. Top-left, top-right, bottom-right, ++ /* Corner rects. Top-left, top-right, bottom-right, + * bottom-left. Order important. + */ + base->border[4].left = 0; +@@ -514,29 +506,29 @@ vips_embed_base_build( VipsObject *object ) + base->border[4].width = base->rsub.left; + base->border[4].height = base->rsub.top; + +- base->border[5].left = VIPS_RECT_RIGHT( &base->rsub ); ++ base->border[5].left = VIPS_RECT_RIGHT(&base->rsub); + base->border[5].top = 0; +- base->border[5].width = conversion->out->Xsize - +- VIPS_RECT_RIGHT( &base->rsub ); ++ base->border[5].width = conversion->out->Xsize - ++ VIPS_RECT_RIGHT(&base->rsub); + base->border[5].height = base->rsub.top; + +- base->border[6].left = VIPS_RECT_RIGHT( &base->rsub ); +- base->border[6].top = VIPS_RECT_BOTTOM( &base->rsub ); +- base->border[6].width = conversion->out->Xsize - +- VIPS_RECT_RIGHT( &base->rsub ); +- base->border[6].height = conversion->out->Ysize - +- VIPS_RECT_BOTTOM( &base->rsub ); ++ base->border[6].left = VIPS_RECT_RIGHT(&base->rsub); ++ base->border[6].top = VIPS_RECT_BOTTOM(&base->rsub); ++ base->border[6].width = conversion->out->Xsize - ++ VIPS_RECT_RIGHT(&base->rsub); ++ base->border[6].height = conversion->out->Ysize - ++ VIPS_RECT_BOTTOM(&base->rsub); + + base->border[7].left = 0; +- base->border[7].top = VIPS_RECT_BOTTOM( &base->rsub ); ++ base->border[7].top = VIPS_RECT_BOTTOM(&base->rsub); + base->border[7].width = base->rsub.left; +- base->border[7].height = conversion->out->Ysize - +- VIPS_RECT_BOTTOM( &base->rsub ); ++ base->border[7].height = conversion->out->Ysize - ++ VIPS_RECT_BOTTOM(&base->rsub); + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_embed_base_gen, vips_stop_one, +- base->in, base ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_embed_base_gen, vips_stop_one, ++ base->in, base)) ++ return (-1); + + break; + +@@ -544,68 +536,67 @@ vips_embed_base_build( VipsObject *object ) + g_assert_not_reached(); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_embed_base_class_init( VipsEmbedBaseClass *class ) ++vips_embed_base_class_init(VipsEmbedBaseClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_embed_base_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_embed_base_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "embed_base"; +- vobject_class->description = _( "embed an image in a larger image" ); ++ vobject_class->description = _("embed an image in a larger image"); + vobject_class->build = vips_embed_base_build; + + /* Not seq with mirror. + */ + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsEmbedBase, in ) ); ++ G_STRUCT_OFFSET(VipsEmbedBase, in)); + +- VIPS_ARG_INT( class, "width", 5, +- _( "Width" ), +- _( "Image width in pixels" ), ++ VIPS_ARG_INT(class, "width", 5, ++ _("Width"), ++ _("Image width in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsEmbedBase, width ), +- 1, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsEmbedBase, width), ++ 1, 1000000000, 1); + +- VIPS_ARG_INT( class, "height", 6, +- _( "Height" ), +- _( "Image height in pixels" ), ++ VIPS_ARG_INT(class, "height", 6, ++ _("Height"), ++ _("Image height in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsEmbedBase, height ), +- 1, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsEmbedBase, height), ++ 1, 1000000000, 1); + +- VIPS_ARG_ENUM( class, "extend", 7, +- _( "Extend" ), +- _( "How to generate the extra pixels" ), ++ VIPS_ARG_ENUM(class, "extend", 7, ++ _("Extend"), ++ _("How to generate the extra pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsEmbedBase, extend ), +- VIPS_TYPE_EXTEND, VIPS_EXTEND_BLACK ); ++ G_STRUCT_OFFSET(VipsEmbedBase, extend), ++ VIPS_TYPE_EXTEND, VIPS_EXTEND_BLACK); + +- VIPS_ARG_BOXED( class, "background", 12, +- _( "Background" ), +- _( "Color for background pixels" ), ++ VIPS_ARG_BOXED(class, "background", 12, ++ _("Background"), ++ _("Color for background pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsEmbedBase, background ), +- VIPS_TYPE_ARRAY_DOUBLE ); +- ++ G_STRUCT_OFFSET(VipsEmbedBase, background), ++ VIPS_TYPE_ARRAY_DOUBLE); + } + + static void +-vips_embed_base_init( VipsEmbedBase *base ) ++vips_embed_base_init(VipsEmbedBase *base) + { + base->extend = VIPS_EXTEND_BLACK; +- base->background = vips_array_double_newv( 1, 0.0 ); ++ base->background = vips_array_double_newv(1, 0.0); + } + + /* Embed with specified x, y +@@ -620,10 +611,10 @@ typedef struct _VipsEmbed { + + typedef VipsConversionClass VipsEmbedClass; + +-G_DEFINE_TYPE( VipsEmbed, vips_embed, vips_embed_base_get_type() ); ++G_DEFINE_TYPE(VipsEmbed, vips_embed, vips_embed_base_get_type()); + + static int +-vips_embed_build( VipsObject *object ) ++vips_embed_build(VipsObject *object) + { + VipsEmbedBase *base = (VipsEmbedBase *) object; + VipsEmbed *embed = (VipsEmbed *) object; +@@ -633,45 +624,44 @@ vips_embed_build( VipsObject *object ) + base->x = embed->x; + base->y = embed->y; + +- if( VIPS_OBJECT_CLASS( vips_embed_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_embed_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_embed_class_init( VipsEmbedClass *class ) ++vips_embed_class_init(VipsEmbedClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_embed_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_embed_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "embed"; +- vobject_class->description = _( "embed an image in a larger image" ); ++ vobject_class->description = _("embed an image in a larger image"); + vobject_class->build = vips_embed_build; + +- VIPS_ARG_INT( class, "x", 3, +- _( "x" ), +- _( "Left edge of input in output" ), ++ VIPS_ARG_INT(class, "x", 3, ++ _("x"), ++ _("Left edge of input in output"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsEmbed, x ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsEmbed, x), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_INT( class, "y", 4, +- _( "y" ), +- _( "Top edge of input in output" ), ++ VIPS_ARG_INT(class, "y", 4, ++ _("y"), ++ _("Top edge of input in output"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsEmbed, y ), +- -1000000000, 1000000000, 0 ); +- ++ G_STRUCT_OFFSET(VipsEmbed, y), ++ -1000000000, 1000000000, 0); + } + + static void +-vips_embed_init( VipsEmbed *embed ) ++vips_embed_init(VipsEmbed *embed) + { + } + +@@ -690,28 +680,28 @@ vips_embed_init( VipsEmbed *embed ) + * * @extend: #VipsExtend to generate the edge pixels (default: black) + * * @background: #VipsArrayDouble colour for edge pixels + * +- * The opposite of vips_extract_area(): embed @in within an image of size +- * @width by @height at position @x, @y. ++ * The opposite of vips_extract_area(): embed @in within an image of size ++ * @width by @height at position @x, @y. + * + * @extend +- * controls what appears in the new pels, see #VipsExtend. ++ * controls what appears in the new pels, see #VipsExtend. + * + * See also: vips_extract_area(), vips_insert(). +- * ++ * + * Returns: 0 on success, -1 on error. + */ + int +-vips_embed( VipsImage *in, VipsImage **out, +- int x, int y, int width, int height, ... ) ++vips_embed(VipsImage *in, VipsImage **out, ++ int x, int y, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "embed", ap, in, out, x, y, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("embed", ap, in, out, x, y, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /* Embed with a general direction. +@@ -725,19 +715,19 @@ typedef struct _VipsGravity { + + typedef VipsConversionClass VipsGravityClass; + +-G_DEFINE_TYPE( VipsGravity, vips_gravity, vips_embed_base_get_type() ); ++G_DEFINE_TYPE(VipsGravity, vips_gravity, vips_embed_base_get_type()); + + static int +-vips_gravity_build( VipsObject *object ) ++vips_gravity_build(VipsObject *object) + { + VipsEmbedBase *base = (VipsEmbedBase *) object; + VipsGravity *gravity = (VipsGravity *) object; + +- if( vips_object_argument_isset( object, "in" ) && +- vips_object_argument_isset( object, "width" ) && +- vips_object_argument_isset( object, "height" ) && +- vips_object_argument_isset( object, "direction" ) ) { +- switch( gravity->direction ) { ++ if (vips_object_argument_isset(object, "in") && ++ vips_object_argument_isset(object, "width") && ++ vips_object_argument_isset(object, "height") && ++ vips_object_argument_isset(object, "direction")) { ++ switch (gravity->direction) { + case VIPS_COMPASS_DIRECTION_CENTRE: + base->x = (base->width - base->in->Xsize) / 2; + base->y = (base->height - base->in->Ysize) / 2; +@@ -785,42 +775,41 @@ vips_gravity_build( VipsObject *object ) + + default: + g_assert_not_reached(); +- + } + } + +- if( VIPS_OBJECT_CLASS( vips_gravity_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_gravity_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_gravity_class_init( VipsGravityClass *class ) ++vips_gravity_class_init(VipsGravityClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_gravity_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_gravity_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "gravity"; +- vobject_class->description = _( "place an image within a larger " +- "image with a certain gravity" ); ++ vobject_class->description = _("place an image within a larger " ++ "image with a certain gravity"); + vobject_class->build = vips_gravity_build; + +- VIPS_ARG_ENUM( class, "direction", 3, +- _( "Direction" ), +- _( "Direction to place image within width/height" ), ++ VIPS_ARG_ENUM(class, "direction", 3, ++ _("Direction"), ++ _("Direction to place image within width/height"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGravity, direction ), +- VIPS_TYPE_COMPASS_DIRECTION, VIPS_COMPASS_DIRECTION_CENTRE ); ++ G_STRUCT_OFFSET(VipsGravity, direction), ++ VIPS_TYPE_COMPASS_DIRECTION, VIPS_COMPASS_DIRECTION_CENTRE); + } + + static void +-vips_gravity_init( VipsGravity *gravity ) ++vips_gravity_init(VipsGravity *gravity) + { + gravity->direction = VIPS_COMPASS_DIRECTION_CENTRE; + } +@@ -839,27 +828,27 @@ vips_gravity_init( VipsGravity *gravity ) + * * @extend: #VipsExtend to generate the edge pixels (default: black) + * * @background: #VipsArrayDouble colour for edge pixels + * +- * The opposite of vips_extract_area(): place @in within an image of size +- * @width by @height at a certain gravity. ++ * The opposite of vips_extract_area(): place @in within an image of size ++ * @width by @height at a certain gravity. + * + * @extend +- * controls what appears in the new pels, see #VipsExtend. ++ * controls what appears in the new pels, see #VipsExtend. + * + * See also: vips_extract_area(), vips_insert(). +- * ++ * + * Returns: 0 on success, -1 on error. + */ + int +-vips_gravity( VipsImage *in, VipsImage **out, +- VipsCompassDirection direction, int width, int height, ... ) ++vips_gravity(VipsImage *in, VipsImage **out, ++ VipsCompassDirection direction, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "gravity", ap, in, out, +- direction, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("gravity", ap, in, out, ++ direction, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/extract.c b/libvips/conversion/extract.c +index defa53d292..30a7b794e5 100644 +--- a/libvips/conversion/extract.c ++++ b/libvips/conversion/extract.c +@@ -41,28 +41,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -103,13 +103,13 @@ typedef struct _VipsExtractArea { + + typedef VipsConversionClass VipsExtractAreaClass; + +-G_DEFINE_TYPE( VipsExtractArea, vips_extract_area, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsExtractArea, vips_extract_area, VIPS_TYPE_CONVERSION); + + /* Extract an area. Can just use pointers. + */ + static int +-vips_extract_area_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++vips_extract_area_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + VipsExtractArea *extract = (VipsExtractArea *) b; +@@ -121,121 +121,119 @@ vips_extract_area_gen( VipsRegion *or, void *seq, void *a, void *b, + iarea = or->valid; + iarea.left += extract->left; + iarea.top += extract->top; +- if( vips_region_prepare( ir, &iarea ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &iarea)) ++ return (-1); + + /* Attach or to ir. + */ +- if( vips_region_region( or, ir, &or->valid, iarea.left, iarea.top ) ) +- return( -1 ); +- +- return( 0 ); ++ if (vips_region_region(or, ir, & or->valid, iarea.left, iarea.top)) ++ return (-1); ++ ++ return (0); + } + + static int +-vips_extract_area_build( VipsObject *object ) ++vips_extract_area_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsExtractArea *extract = (VipsExtractArea *) object; + +- if( VIPS_OBJECT_CLASS( vips_extract_area_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_extract_area_parent_class)->build(object)) ++ return (-1); + +- if( extract->left + extract->width > extract->in->Xsize || ++ if (extract->left + extract->width > extract->in->Xsize || + extract->top + extract->height > extract->in->Ysize || + extract->left < 0 || extract->top < 0 || +- extract->width <= 0 || extract->height <= 0 ) { +- vips_error( class->nickname, "%s", _( "bad extract area" ) ); +- return( -1 ); ++ extract->width <= 0 || extract->height <= 0) { ++ vips_error(class->nickname, "%s", _("bad extract area")); ++ return (-1); + } + +- if( vips_image_pio_input( extract->in ) || +- vips_check_coding_known( class->nickname, extract->in ) ) +- return( -1 ); ++ if (vips_image_pio_input(extract->in) || ++ vips_check_coding_known(class->nickname, extract->in)) ++ return (-1); + +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, extract->in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, extract->in, NULL)) ++ return (-1); + +- conversion->out->Xsize = extract->width; +- conversion->out->Ysize = extract->height; +- conversion->out->Xoffset = -extract->left; +- conversion->out->Yoffset = -extract->top; ++ conversion->out->Xsize = extract->width; ++ conversion->out->Ysize = extract->height; ++ conversion->out->Xoffset = -extract->left; ++ conversion->out->Yoffset = -extract->top; + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_extract_area_gen, vips_stop_one, +- extract->in, extract ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_extract_area_gen, vips_stop_one, ++ extract->in, extract)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_extract_area_class_init( VipsExtractAreaClass *class ) ++vips_extract_area_class_init(VipsExtractAreaClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_extract_area_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_extract_area_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "extract_area"; +- vobject_class->description = _( "extract an area from an image" ); ++ vobject_class->description = _("extract an area from an image"); + vobject_class->build = vips_extract_area_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "input", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "input", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsExtractArea, in ) ); ++ G_STRUCT_OFFSET(VipsExtractArea, in)); + +- VIPS_ARG_INT( class, "left", 3, +- _( "Left" ), +- _( "Left edge of extract area" ), ++ VIPS_ARG_INT(class, "left", 3, ++ _("Left"), ++ _("Left edge of extract area"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsExtractArea, left ), +- -VIPS_MAX_COORD, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsExtractArea, left), ++ -VIPS_MAX_COORD, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "top", 4, +- _( "Top" ), +- _( "Top edge of extract area" ), ++ VIPS_ARG_INT(class, "top", 4, ++ _("Top"), ++ _("Top edge of extract area"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsExtractArea, top ), +- -VIPS_MAX_COORD, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsExtractArea, top), ++ -VIPS_MAX_COORD, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "width", 5, +- _( "Width" ), +- _( "Width of extract area" ), ++ VIPS_ARG_INT(class, "width", 5, ++ _("Width"), ++ _("Width of extract area"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsExtractArea, width ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsExtractArea, width), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "height", 6, +- _( "Height" ), +- _( "Height of extract area" ), ++ VIPS_ARG_INT(class, "height", 6, ++ _("Height"), ++ _("Height of extract area"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsExtractArea, height ), +- 1, VIPS_MAX_COORD, 1 ); +- ++ G_STRUCT_OFFSET(VipsExtractArea, height), ++ 1, VIPS_MAX_COORD, 1); + } + + #ifdef __EMSCRIPTEN__ + static void +-vips_crop_init_adapter( VipsExtractArea *extract, void *dummy ) ++vips_crop_init_adapter(VipsExtractArea *extract, void *dummy) + { +- vips_extract_area_init( extract ); ++ vips_extract_area_init(extract); + } + #endif + + static void +-vips_extract_area_init( VipsExtractArea *extract ) ++vips_extract_area_init(VipsExtractArea *extract) + { + } + +@@ -252,49 +250,49 @@ vips_extract_area_init( VipsExtractArea *extract ) + * Extract an area from an image. The area must fit within @in. + * + * See also: vips_extract_bands(), vips_smartcrop(). +- * ++ * + * Returns: 0 on success, -1 on error. + */ + int +-vips_extract_area( VipsImage *in, VipsImage **out, +- int left, int top, int width, int height, ... ) ++vips_extract_area(VipsImage *in, VipsImage **out, ++ int left, int top, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "extract_area", ap, in, out, +- left, top, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("extract_area", ap, in, out, ++ left, top, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /* A synonym for extract_area. + */ + + GType +-vips_crop_get_type( void ) ++vips_crop_get_type(void) + { + static gsize gtype_id = 0; + +- if( g_once_init_enter( >ype_id ) ) { +- GType new_type = g_type_register_static_simple( VIPS_TYPE_CONVERSION, +- g_intern_static_string( "crop" ), +- sizeof( VipsExtractAreaClass ), +- (GClassInitFunc)(void (*)(void)) vips_extract_area_class_intern_init, +- sizeof( VipsExtractArea ), ++ if (g_once_init_enter(>ype_id)) { ++ GType new_type = g_type_register_static_simple(VIPS_TYPE_CONVERSION, ++ g_intern_static_string("crop"), ++ sizeof(VipsExtractAreaClass), ++ (GClassInitFunc) (void (*)(void)) vips_extract_area_class_intern_init, ++ sizeof(VipsExtractArea), + #ifdef __EMSCRIPTEN__ + (GInstanceInitFunc) vips_crop_init_adapter, + #else +- (GInstanceInitFunc)(void (*)(void)) vips_extract_area_init, ++ (GInstanceInitFunc) (void (*)(void)) vips_extract_area_init, + #endif +- (GTypeFlags) 0 ); ++ (GTypeFlags) 0); + +- g_once_init_leave( >ype_id, new_type ); ++ g_once_init_leave(>ype_id, new_type); + } + +- return( (GType) gtype_id ); ++ return ((GType) gtype_id); + } + + /** +@@ -307,25 +305,25 @@ vips_crop_get_type( void ) + * @height: height of area to extract + * @...: %NULL-terminated list of optional named arguments + * +- * A synonym for vips_extract_area(). ++ * A synonym for vips_extract_area(). + * + * See also: vips_extract_bands(), vips_smartcrop(). +- * ++ * + * Returns: 0 on success, -1 on error. + */ + int +-vips_crop( VipsImage *in, VipsImage **out, +- int left, int top, int width, int height, ... ) ++vips_crop(VipsImage *in, VipsImage **out, ++ int left, int top, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "crop", ap, in, out, +- left, top, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("crop", ap, in, out, ++ left, top, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + typedef struct _VipsExtractBand { +@@ -341,27 +339,27 @@ typedef struct _VipsExtractBand { + + typedef VipsBandaryClass VipsExtractBandClass; + +-G_DEFINE_TYPE( VipsExtractBand, vips_extract_band, VIPS_TYPE_BANDARY ); ++G_DEFINE_TYPE(VipsExtractBand, vips_extract_band, VIPS_TYPE_BANDARY); + + static void +-vips_extract_band_buffer( VipsBandarySequence *seq, +- VipsPel *out, VipsPel **in, int width ) ++vips_extract_band_buffer(VipsBandarySequence *seq, ++ VipsPel *out, VipsPel **in, int width) + { + VipsBandary *bandary = seq->bandary; + VipsConversion *conversion = (VipsConversion *) bandary; + VipsExtractBand *extract = (VipsExtractBand *) bandary; + VipsImage *im = bandary->ready[0]; +- int es = VIPS_IMAGE_SIZEOF_ELEMENT( im ); +- int ips = VIPS_IMAGE_SIZEOF_PEL( im ); +- const int ops = VIPS_IMAGE_SIZEOF_PEL( conversion->out ); ++ int es = VIPS_IMAGE_SIZEOF_ELEMENT(im); ++ int ips = VIPS_IMAGE_SIZEOF_PEL(im); ++ const int ops = VIPS_IMAGE_SIZEOF_PEL(conversion->out); + + VipsPel *p, *q; + int x, z; + + p = in[0] + extract->band * es; + q = out; +- for( x = 0; x < width; x++ ) { +- for( z = 0; z < ops; z++ ) ++ for (x = 0; x < width; x++) { ++ for (z = 0; z < ops; z++) + q[z] = p[z]; + + p += ips; +@@ -370,81 +368,79 @@ vips_extract_band_buffer( VipsBandarySequence *seq, + } + + static int +-vips_extract_band_build( VipsObject *object ) ++vips_extract_band_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsBandary *bandary = (VipsBandary *) object; + VipsExtractBand *extract = (VipsExtractBand *) object; + +- if( extract->in ) { +- int bands; ++ if (extract->in) { ++ int bands; + +- vips_image_decode_predict( extract->in, &bands, NULL ); ++ vips_image_decode_predict(extract->in, &bands, NULL); + + bandary->n = 1; + bandary->in = &extract->in; + bandary->out_bands = extract->n; + +- if( extract->band + extract->n > bands ) { +- vips_error( class->nickname, +- "%s", _( "bad extract band" ) ); +- return( -1 ); ++ if (extract->band + extract->n > bands) { ++ vips_error(class->nickname, ++ "%s", _("bad extract band")); ++ return (-1); + } + +- if( extract->band == 0 && +- extract->n == bands ) +- return( vips_bandary_copy( bandary ) ); ++ if (extract->band == 0 && ++ extract->n == bands) ++ return (vips_bandary_copy(bandary)); + } + +- if( VIPS_OBJECT_CLASS( vips_extract_band_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_extract_band_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_extract_band_class_init( VipsExtractBandClass *class ) ++vips_extract_band_class_init(VipsExtractBandClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsBandaryClass *bandary_class = VIPS_BANDARY_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsBandaryClass *bandary_class = VIPS_BANDARY_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_extract_band_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_extract_band_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "extract_band"; +- vobject_class->description = _( "extract band from an image" ); ++ vobject_class->description = _("extract band from an image"); + vobject_class->build = vips_extract_band_build; + + bandary_class->process_line = vips_extract_band_buffer; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsExtractBand, in ) ); ++ G_STRUCT_OFFSET(VipsExtractBand, in)); + +- VIPS_ARG_INT( class, "band", 3, +- _( "Band" ), +- _( "Band to extract" ), ++ VIPS_ARG_INT(class, "band", 3, ++ _("Band"), ++ _("Band to extract"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsExtractBand, band ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsExtractBand, band), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "n", 4, +- _( "n" ), +- _( "Number of bands to extract" ), ++ VIPS_ARG_INT(class, "n", 4, ++ _("n"), ++ _("Number of bands to extract"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsExtractBand, n ), +- 1, VIPS_MAX_COORD, 1 ); +- ++ G_STRUCT_OFFSET(VipsExtractBand, n), ++ 1, VIPS_MAX_COORD, 1); + } + + static void +-vips_extract_band_init( VipsExtractBand *extract ) ++vips_extract_band_init(VipsExtractBand *extract) + { + extract->n = 1; + } +@@ -463,18 +459,18 @@ vips_extract_band_init( VipsExtractBand *extract ) + * Extract a band or bands from an image. Extracting out of range is an error. + * + * See also: vips_extract_area(). +- * ++ * + * Returns: 0 on success, -1 on error. + */ + int +-vips_extract_band( VipsImage *in, VipsImage **out, int band, ... ) ++vips_extract_band(VipsImage *in, VipsImage **out, int band, ...) + { + va_list ap; + int result; + +- va_start( ap, band ); +- result = vips_call_split( "extract_band", ap, in, out, band ); +- va_end( ap ); ++ va_start(ap, band); ++ result = vips_call_split("extract_band", ap, in, out, band); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/falsecolour.c b/libvips/conversion/falsecolour.c +index 8c95f9e672..55190f14ca 100644 +--- a/libvips/conversion/falsecolour.c ++++ b/libvips/conversion/falsecolour.c +@@ -14,34 +14,34 @@ + * - force input to mono 8-bit for the user + * 1/8/13 + * - redone as a class +- * 23/1/14 ++ * 23/1/14 + * - oops, was not auto-getting and casting the first band + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -66,7 +66,7 @@ typedef struct _VipsFalsecolour { + + typedef VipsConversionClass VipsFalsecolourClass; + +-G_DEFINE_TYPE( VipsFalsecolour, vips_falsecolour, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsFalsecolour, vips_falsecolour, VIPS_TYPE_CONVERSION); + + /* Falsecolour scale nicked from a PET scan. + */ +@@ -330,73 +330,71 @@ static unsigned char vips_falsecolour_pet[][3] = { + }; + + static int +-vips_falsecolour_build( VipsObject *object ) ++vips_falsecolour_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsFalsecolour *falsecolour = (VipsFalsecolour *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 5 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 5); + +- if( VIPS_OBJECT_CLASS( vips_falsecolour_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_falsecolour_parent_class)->build(object)) ++ return (-1); + +- if( !(t[0] = vips_image_new_from_memory( +- (void *) vips_falsecolour_pet, +- sizeof( vips_falsecolour_pet ), +- 1, VIPS_NUMBER( vips_falsecolour_pet ), 3, +- VIPS_FORMAT_UCHAR )) ) +- return( -1 ); ++ if (!(t[0] = vips_image_new_from_memory( ++ (void *) vips_falsecolour_pet, ++ sizeof(vips_falsecolour_pet), ++ 1, VIPS_NUMBER(vips_falsecolour_pet), 3, ++ VIPS_FORMAT_UCHAR))) ++ return (-1); + + /* Force to mono 8-bit. Don't use vips_colourspace() to go to B_W, we + * want to work for images which aren't in a recognised space, like + * MULTIBAND. + */ +- if( vips_image_decode( falsecolour->in, &t[1] ) || +- vips_extract_band( t[1], &t[2], 0, NULL ) || +- vips_cast( t[2], &t[3], VIPS_FORMAT_UCHAR, NULL ) || +- vips_maplut( t[3], &t[4], t[0], NULL ) || +- vips_image_write( t[4], conversion->out ) ) +- return( -1 ); +- +- return( 0 ); ++ if (vips_image_decode(falsecolour->in, &t[1]) || ++ vips_extract_band(t[1], &t[2], 0, NULL) || ++ vips_cast(t[2], &t[3], VIPS_FORMAT_UCHAR, NULL) || ++ vips_maplut(t[3], &t[4], t[0], NULL) || ++ vips_image_write(t[4], conversion->out)) ++ return (-1); ++ ++ return (0); + } + + static void +-vips_falsecolour_class_init( VipsFalsecolourClass *class ) ++vips_falsecolour_class_init(VipsFalsecolourClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "falsecolour"; +- vobject_class->description = _( "false-color an image" ); ++ vobject_class->description = _("false-color an image"); + vobject_class->build = vips_falsecolour_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 0, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 0, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsFalsecolour, in ) ); +- ++ G_STRUCT_OFFSET(VipsFalsecolour, in)); + } + + static void +-vips_falsecolour_init( VipsFalsecolour *falsecolour ) ++vips_falsecolour_init(VipsFalsecolour *falsecolour) + { + } + + /** + * vips_falsecolour: (method) +- * @in: input image ++ * @in: input image + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Force @in to 1 band, 8-bit, then transform to ++ * Force @in to 1 band, 8-bit, then transform to + * a 3-band 8-bit image with a false colour + * map. The map is supposed to make small differences in brightness more + * obvious. +@@ -406,14 +404,14 @@ vips_falsecolour_init( VipsFalsecolour *falsecolour ) + * Returns: 0 on success, -1 on error + */ + int +-vips_falsecolour( VipsImage *in, VipsImage **out, ... ) ++vips_falsecolour(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "falsecolour", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("falsecolour", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/flatten.c b/libvips/conversion/flatten.c +index b0278df1ea..92ef892f94 100644 +--- a/libvips/conversion/flatten.c ++++ b/libvips/conversion/flatten.c +@@ -4,7 +4,7 @@ + * Written on: 18/6/12 + * + * 4/1/14 +- * - better rounding ++ * - better rounding + * 9/5/15 + * - add max_alpha to match vips_premultiply() etc. + * 25/5/16 +@@ -15,28 +15,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -81,364 +81,368 @@ typedef struct _VipsFlatten { + + typedef VipsConversionClass VipsFlattenClass; + +-G_DEFINE_TYPE( VipsFlatten, vips_flatten, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsFlatten, vips_flatten, VIPS_TYPE_CONVERSION); + + /* Flatten with black background. + */ +-#define VIPS_FLATTEN_BLACK_INT( TYPE ) { \ +- TYPE * restrict p = (TYPE *) in; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < width; x++ ) { \ +- TYPE alpha = p[bands - 1]; \ +- int b; \ +- \ +- for( b = 0; b < bands - 1; b++ ) \ +- q[b] = (p[b] * alpha) / max_alpha; \ +- \ +- p += bands; \ +- q += bands - 1; \ +- } \ +-} ++#define VIPS_FLATTEN_BLACK_INT(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < width; x++) { \ ++ TYPE alpha = p[bands - 1]; \ ++ int b; \ ++\ ++ for (b = 0; b < bands - 1; b++) \ ++ q[b] = (p[b] * alpha) / max_alpha; \ ++\ ++ p += bands; \ ++ q += bands - 1; \ ++ } \ ++ } + + /* Same, but with float arithmetic. Necessary for short/int to prevent + * overflow. + */ +-#define VIPS_FLATTEN_BLACK_FLOAT( TYPE ) { \ +- TYPE * restrict p = (TYPE *) in; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < width; x++ ) { \ +- TYPE alpha = p[bands - 1]; \ +- int b; \ +- \ +- for( b = 0; b < bands - 1; b++ ) \ +- q[b] = ((double) p[b] * alpha) / max_alpha; \ +- \ +- p += bands; \ +- q += bands - 1; \ +- } \ +-} ++#define VIPS_FLATTEN_BLACK_FLOAT(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < width; x++) { \ ++ TYPE alpha = p[bands - 1]; \ ++ int b; \ ++\ ++ for (b = 0; b < bands - 1; b++) \ ++ q[b] = ((double) p[b] * alpha) / max_alpha; \ ++\ ++ p += bands; \ ++ q += bands - 1; \ ++ } \ ++ } + + /* Flatten with any background. + */ +-#define VIPS_FLATTEN_INT( TYPE ) { \ +- TYPE * restrict p = (TYPE *) in; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < width; x++ ) { \ +- TYPE alpha = p[bands - 1]; \ +- TYPE nalpha = max_alpha - alpha; \ +- TYPE * restrict bg = (TYPE *) flatten->ink; \ +- int b; \ +- \ +- for( b = 0; b < bands - 1; b++ ) \ +- q[b] = (p[b] * alpha + bg[b] * nalpha) / max_alpha; \ +- \ +- p += bands; \ +- q += bands - 1; \ +- } \ +-} ++#define VIPS_FLATTEN_INT(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < width; x++) { \ ++ TYPE alpha = p[bands - 1]; \ ++ TYPE nalpha = max_alpha - alpha; \ ++ TYPE *restrict bg = (TYPE *) flatten->ink; \ ++ int b; \ ++\ ++ for (b = 0; b < bands - 1; b++) \ ++ q[b] = (p[b] * alpha + bg[b] * nalpha) / max_alpha; \ ++\ ++ p += bands; \ ++ q += bands - 1; \ ++ } \ ++ } + +-#define VIPS_FLATTEN_FLOAT( TYPE ) { \ +- TYPE * restrict p = (TYPE *) in; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < width; x++ ) { \ +- TYPE alpha = p[bands - 1]; \ +- TYPE nalpha = max_alpha - alpha; \ +- TYPE * restrict bg = (TYPE *) flatten->ink; \ +- int b; \ +- \ +- for( b = 0; b < bands - 1; b++ ) \ +- q[b] = ((double) p[b] * alpha + \ +- (double) bg[b] * nalpha) / max_alpha; \ +- \ +- p += bands; \ +- q += bands - 1; \ +- } \ +-} ++#define VIPS_FLATTEN_FLOAT(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < width; x++) { \ ++ TYPE alpha = p[bands - 1]; \ ++ TYPE nalpha = max_alpha - alpha; \ ++ TYPE *restrict bg = (TYPE *) flatten->ink; \ ++ int b; \ ++\ ++ for (b = 0; b < bands - 1; b++) \ ++ q[b] = ((double) p[b] * alpha + \ ++ (double) bg[b] * nalpha) / \ ++ max_alpha; \ ++\ ++ p += bands; \ ++ q += bands - 1; \ ++ } \ ++ } + + static int +-vips_flatten_black_gen( VipsRegion *or, void *vseq, void *a, void *b, +- gboolean *stop ) ++vips_flatten_black_gen(VipsRegion * or, void *vseq, void *a, void *b, ++ gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) vseq; + VipsFlatten *flatten = (VipsFlatten *) b; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int width = r->width; +- int bands = ir->im->Bands; ++ int bands = ir->im->Bands; + double max_alpha = flatten->max_alpha; + + int x, y; + +- if( vips_region_prepare( ir, r ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, r)) ++ return (-1); + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *in = VIPS_REGION_ADDR( ir, r->left, r->top + y ); +- VipsPel *out = VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *in = VIPS_REGION_ADDR(ir, r->left, r->top + y); ++ VipsPel *out = VIPS_REGION_ADDR(or, r->left, r->top + y); + +- switch( ir->im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- VIPS_FLATTEN_BLACK_INT( unsigned char ); +- break; ++ switch (ir->im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ VIPS_FLATTEN_BLACK_INT(unsigned char); ++ break; + +- case VIPS_FORMAT_CHAR: +- VIPS_FLATTEN_BLACK_INT( signed char ); +- break; ++ case VIPS_FORMAT_CHAR: ++ VIPS_FLATTEN_BLACK_INT(signed char); ++ break; + +- case VIPS_FORMAT_USHORT: +- VIPS_FLATTEN_BLACK_FLOAT( unsigned short ); +- break; ++ case VIPS_FORMAT_USHORT: ++ VIPS_FLATTEN_BLACK_FLOAT(unsigned short); ++ break; + +- case VIPS_FORMAT_SHORT: +- VIPS_FLATTEN_BLACK_FLOAT( signed short ); +- break; ++ case VIPS_FORMAT_SHORT: ++ VIPS_FLATTEN_BLACK_FLOAT(signed short); ++ break; + +- case VIPS_FORMAT_UINT: +- VIPS_FLATTEN_BLACK_FLOAT( unsigned int ); +- break; ++ case VIPS_FORMAT_UINT: ++ VIPS_FLATTEN_BLACK_FLOAT(unsigned int); ++ break; + +- case VIPS_FORMAT_INT: +- VIPS_FLATTEN_BLACK_FLOAT( signed int ); +- break; ++ case VIPS_FORMAT_INT: ++ VIPS_FLATTEN_BLACK_FLOAT(signed int); ++ break; + +- case VIPS_FORMAT_FLOAT: +- VIPS_FLATTEN_BLACK_FLOAT( float ); +- break; ++ case VIPS_FORMAT_FLOAT: ++ VIPS_FLATTEN_BLACK_FLOAT(float); ++ break; + +- case VIPS_FORMAT_DOUBLE: +- VIPS_FLATTEN_BLACK_FLOAT( double ); +- break; ++ case VIPS_FORMAT_DOUBLE: ++ VIPS_FLATTEN_BLACK_FLOAT(double); ++ break; + +- case VIPS_FORMAT_COMPLEX: +- case VIPS_FORMAT_DPCOMPLEX: +- default: +- g_assert_not_reached(); +- } ++ case VIPS_FORMAT_COMPLEX: ++ case VIPS_FORMAT_DPCOMPLEX: ++ default: ++ g_assert_not_reached(); ++ } + } + +- return( 0 ); ++ return (0); + } + + /* Any background. + */ + static int +-vips_flatten_gen( VipsRegion *or, void *vseq, void *a, void *b, +- gboolean *stop ) ++vips_flatten_gen(VipsRegion * or, void *vseq, void *a, void *b, ++ gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) vseq; + VipsFlatten *flatten = (VipsFlatten *) b; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int width = r->width; +- int bands = ir->im->Bands; ++ int bands = ir->im->Bands; + double max_alpha = flatten->max_alpha; + + int x, y; + +- if( vips_region_prepare( ir, r ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, r)) ++ return (-1); + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *in = VIPS_REGION_ADDR( ir, r->left, r->top + y ); +- VipsPel *out = VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *in = VIPS_REGION_ADDR(ir, r->left, r->top + y); ++ VipsPel *out = VIPS_REGION_ADDR(or, r->left, r->top + y); + +- switch( ir->im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- VIPS_FLATTEN_INT( unsigned char ); +- break; ++ switch (ir->im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ VIPS_FLATTEN_INT(unsigned char); ++ break; + +- case VIPS_FORMAT_CHAR: +- VIPS_FLATTEN_INT( signed char ); +- break; ++ case VIPS_FORMAT_CHAR: ++ VIPS_FLATTEN_INT(signed char); ++ break; + +- case VIPS_FORMAT_USHORT: +- VIPS_FLATTEN_FLOAT( unsigned short ); +- break; ++ case VIPS_FORMAT_USHORT: ++ VIPS_FLATTEN_FLOAT(unsigned short); ++ break; + +- case VIPS_FORMAT_SHORT: +- VIPS_FLATTEN_FLOAT( signed short ); +- break; ++ case VIPS_FORMAT_SHORT: ++ VIPS_FLATTEN_FLOAT(signed short); ++ break; + +- case VIPS_FORMAT_UINT: +- VIPS_FLATTEN_FLOAT( unsigned int ); +- break; ++ case VIPS_FORMAT_UINT: ++ VIPS_FLATTEN_FLOAT(unsigned int); ++ break; + +- case VIPS_FORMAT_INT: +- VIPS_FLATTEN_FLOAT( signed int ); +- break; ++ case VIPS_FORMAT_INT: ++ VIPS_FLATTEN_FLOAT(signed int); ++ break; + +- case VIPS_FORMAT_FLOAT: +- VIPS_FLATTEN_FLOAT( float ); +- break; ++ case VIPS_FORMAT_FLOAT: ++ VIPS_FLATTEN_FLOAT(float); ++ break; + +- case VIPS_FORMAT_DOUBLE: +- VIPS_FLATTEN_FLOAT( double ); +- break; ++ case VIPS_FORMAT_DOUBLE: ++ VIPS_FLATTEN_FLOAT(double); ++ break; + +- case VIPS_FORMAT_COMPLEX: +- case VIPS_FORMAT_DPCOMPLEX: +- default: +- g_assert_not_reached(); +- } ++ case VIPS_FORMAT_COMPLEX: ++ case VIPS_FORMAT_DPCOMPLEX: ++ default: ++ g_assert_not_reached(); ++ } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_flatten_build( VipsObject *object ) ++vips_flatten_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsFlatten *flatten = (VipsFlatten *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); + + VipsImage *in; + int i; + gboolean black; + VipsBandFormat original_format; + +- if( VIPS_OBJECT_CLASS( vips_flatten_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_flatten_parent_class)->build(object)) ++ return (-1); + +- in = flatten->in; ++ in = flatten->in; + +- if( vips_image_decode( in, &t[0] ) ) +- return( -1 ); +- in = t[0]; ++ if (vips_image_decode(in, &t[0])) ++ return (-1); ++ in = t[0]; + + /* Trivial case: fall back to copy(). + */ +- if( in->Bands == 1 ) +- return( vips_image_write( in, conversion->out ) ); ++ if (in->Bands == 1) ++ return (vips_image_write(in, conversion->out)); + +- if( vips_check_noncomplex( class->nickname, in ) ) +- return( -1 ); ++ if (vips_check_noncomplex(class->nickname, in)) ++ return (-1); + + /* Is max-alpha unset? Default to the correct value for this + * interpretation. + */ +- if( !vips_object_argument_isset( object, "max_alpha" ) ) +- if( in->Type == VIPS_INTERPRETATION_GREY16 || +- in->Type == VIPS_INTERPRETATION_RGB16 ) ++ if (!vips_object_argument_isset(object, "max_alpha")) ++ if (in->Type == VIPS_INTERPRETATION_GREY16 || ++ in->Type == VIPS_INTERPRETATION_RGB16) + flatten->max_alpha = 65535; + + /* Is max_alpha less than the numeric range of this image? If it is, +- * we can get int overflow. ++ * we can get int overflow. + * + * This is not a common case, so efficiency is not so important. + * Cast to double, then cast back to the input type right at the end. + */ + original_format = VIPS_FORMAT_NOTSET; +- if( vips_band_format_isint( in->BandFmt ) && +- flatten->max_alpha < +- vips_image_get_format_max( in->BandFmt ) ) { ++ if (vips_band_format_isint(in->BandFmt) && ++ flatten->max_alpha < ++ vips_image_get_format_max(in->BandFmt)) { + original_format = in->BandFmt; +- if( vips_cast( in, &t[1], VIPS_FORMAT_DOUBLE, NULL ) ) +- return( -1 ); ++ if (vips_cast(in, &t[1], VIPS_FORMAT_DOUBLE, NULL)) ++ return (-1); + in = t[1]; + } + + t[2] = vips_image_new(); +- if( vips_image_pipelinev( t[2], +- VIPS_DEMAND_STYLE_THINSTRIP, in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(t[2], ++ VIPS_DEMAND_STYLE_THINSTRIP, in, NULL)) ++ return (-1); + t[2]->Bands -= 1; + + /* Is the background black? We have a special path for this. + */ + black = TRUE; +- for( i = 0; i < VIPS_AREA( flatten->background )->n; i++ ) { +- const double *background = +- vips_array_double_get( flatten->background, NULL ); ++ for (i = 0; i < VIPS_AREA(flatten->background)->n; i++) { ++ const double *background = ++ vips_array_double_get(flatten->background, NULL); + +- if( background[i] != 0.0 ) { ++ if (background[i] != 0.0) { + black = FALSE; + break; + } + } + +- if( black ) { +- if( vips_image_generate( t[2], +- vips_start_one, vips_flatten_black_gen, vips_stop_one, +- in, flatten ) ) +- return( -1 ); ++ if (black) { ++ if (vips_image_generate(t[2], ++ vips_start_one, vips_flatten_black_gen, vips_stop_one, ++ in, flatten)) ++ return (-1); + in = t[2]; + } + else { + /* Convert the background to the image's format. + */ +- if( !(flatten->ink = vips__vector_to_ink( class->nickname, t[2], +- VIPS_AREA( flatten->background )->data, NULL, +- VIPS_AREA( flatten->background )->n )) ) +- return( -1 ); +- +- if( vips_image_generate( t[2], +- vips_start_one, vips_flatten_gen, vips_stop_one, +- in, flatten ) ) +- return( -1 ); ++ if (!(flatten->ink = vips__vector_to_ink(class->nickname, t[2], ++ VIPS_AREA(flatten->background)->data, NULL, ++ VIPS_AREA(flatten->background)->n))) ++ return (-1); ++ ++ if (vips_image_generate(t[2], ++ vips_start_one, vips_flatten_gen, vips_stop_one, ++ in, flatten)) ++ return (-1); + in = t[2]; + } + +- if( original_format != VIPS_FORMAT_NOTSET ) { +- if( vips_cast( in, &t[3], original_format, NULL ) ) +- return( -1 ); ++ if (original_format != VIPS_FORMAT_NOTSET) { ++ if (vips_cast(in, &t[3], original_format, NULL)) ++ return (-1); + in = t[3]; + } + +- if( vips_image_write( in, conversion->out ) ) +- return( -1 ); ++ if (vips_image_write(in, conversion->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_flatten_class_init( VipsFlattenClass *class ) ++vips_flatten_class_init(VipsFlattenClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_flatten_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_flatten_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "flatten"; +- vobject_class->description = _( "flatten alpha out of an image" ); ++ vobject_class->description = _("flatten alpha out of an image"); + vobject_class->build = vips_flatten_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsFlatten, in ) ); ++ G_STRUCT_OFFSET(VipsFlatten, in)); + +- VIPS_ARG_BOXED( class, "background", 2, +- _( "Background" ), +- _( "Background value" ), ++ VIPS_ARG_BOXED(class, "background", 2, ++ _("Background"), ++ _("Background value"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsFlatten, background ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsFlatten, background), ++ VIPS_TYPE_ARRAY_DOUBLE); + +- VIPS_ARG_DOUBLE( class, "max_alpha", 115, +- _( "Maximum alpha" ), +- _( "Maximum value of alpha channel" ), ++ VIPS_ARG_DOUBLE(class, "max_alpha", 115, ++ _("Maximum alpha"), ++ _("Maximum value of alpha channel"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsFlatten, max_alpha ), +- 0, 100000000, 255 ); +- ++ G_STRUCT_OFFSET(VipsFlatten, max_alpha), ++ 0, 100000000, 255); + } + + static void +-vips_flatten_init( VipsFlatten *flatten ) ++vips_flatten_init(VipsFlatten *flatten) + { +- flatten->background = vips_array_double_newv( 1, 0.0 ); +- flatten->max_alpha= 255.0; ++ flatten->background = vips_array_double_newv(1, 0.0); ++ flatten->max_alpha = 255.0; + } + + /** +@@ -449,21 +453,21 @@ vips_flatten_init( VipsFlatten *flatten ) + * + * Optional arguments: + * +- * * @background: #VipsArrayDouble colour for new pixels ++ * * @background: #VipsArrayDouble colour for new pixels + * * @max_alpha: %gdouble, maximum value for alpha + * + * Take the last band of @in as an alpha and use it to blend the +- * remaining channels with @background. ++ * remaining channels with @background. + * + * The alpha channel is 0 - @max_alpha, + * where 1 means 100% image and 0 +- * means 100% background. ++ * means 100% background. + * Non-complex images only. +- * @background defaults to zero (black). ++ * @background defaults to zero (black). + * + * @max_alpha has the default value 255, or 65535 for images tagged as + * #VIPS_INTERPRETATION_RGB16 or +- * #VIPS_INTERPRETATION_GREY16. ++ * #VIPS_INTERPRETATION_GREY16. + * + * Useful for flattening PNG images to RGB. + * +@@ -472,14 +476,14 @@ vips_flatten_init( VipsFlatten *flatten ) + * Returns: 0 on success, -1 on error + */ + int +-vips_flatten( VipsImage *in, VipsImage **out, ... ) ++vips_flatten(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "flatten", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("flatten", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/flip.c b/libvips/conversion/flip.c +index e9e14b94aa..f5e7f0382e 100644 +--- a/libvips/conversion/flip.c ++++ b/libvips/conversion/flip.c +@@ -8,7 +8,7 @@ + * - yuk! needs rewriting + * 21/12/94 JC + * - rewritten +- * 14/4/04 ++ * 14/4/04 + * - sets Xoffset / Yoffset + * 24/3/09 + * - added IM_CODING_RAD support +@@ -21,28 +21,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -80,21 +80,21 @@ typedef struct _VipsFlip { + + typedef VipsConversionClass VipsFlipClass; + +-G_DEFINE_TYPE( VipsFlip, vips_flip, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsFlip, vips_flip, VIPS_TYPE_CONVERSION); + + static int +-vips_flip_vertical_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++vips_flip_vertical_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsRect in; + VipsPel *p, *q; + int y; + + int le = r->left; + int to = r->top; +- int bo = VIPS_RECT_BOTTOM( r ); ++ int bo = VIPS_RECT_BOTTOM(r); + + int ls; + int psk, qsk; +@@ -106,33 +106,33 @@ vips_flip_vertical_gen( VipsRegion *or, void *seq, void *a, void *b, + + /* Ask for input we need. + */ +- if( vips_region_prepare( ir, &in ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &in)) ++ return (-1); + + /* Loop, copying and reversing lines. + */ +- p = VIPS_REGION_ADDR( ir, le, in.top + in.height - 1 ); +- q = VIPS_REGION_ADDR( or, le, to ); +- psk = VIPS_REGION_LSKIP( ir ); +- qsk = VIPS_REGION_LSKIP( or ); +- ls = VIPS_REGION_SIZEOF_LINE( or ); ++ p = VIPS_REGION_ADDR(ir, le, in.top + in.height - 1); ++ q = VIPS_REGION_ADDR(or, le, to); ++ psk = VIPS_REGION_LSKIP(ir); ++ qsk = VIPS_REGION_LSKIP(or); ++ ls = VIPS_REGION_SIZEOF_LINE(or); + +- for( y = to; y < bo; y++ ) { +- memcpy( q, p, ls ); ++ for (y = to; y < bo; y++) { ++ memcpy(q, p, ls); + + p -= psk; + q += qsk; + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_flip_horizontal_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++vips_flip_horizontal_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsRect in; + VipsPel *p, *q; + int x, y, z; +@@ -142,7 +142,7 @@ vips_flip_horizontal_gen( VipsRegion *or, void *seq, void *a, void *b, + int to = r->top; + int bo = VIPS_RECT_BOTTOM(r); + +- int ps = VIPS_IMAGE_SIZEOF_PEL( ir->im ); /* sizeof pel */ ++ int ps = VIPS_IMAGE_SIZEOF_PEL(ir->im); /* sizeof pel */ + + int hgt = ir->im->Xsize - r->width; + +@@ -155,23 +155,23 @@ vips_flip_horizontal_gen( VipsRegion *or, void *seq, void *a, void *b, + + /* Find x of final pixel in input area. + */ +- lastx = VIPS_RECT_RIGHT( &in ) - 1; ++ lastx = VIPS_RECT_RIGHT(&in) - 1; + + /* Ask for input we need. + */ +- if( vips_region_prepare( ir, &in ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &in)) ++ return (-1); + + /* Loop, copying and reversing lines. + */ +- for( y = to; y < bo; y++ ) { +- p = VIPS_REGION_ADDR( ir, lastx, y ); +- q = VIPS_REGION_ADDR( or, le, y ); ++ for (y = to; y < bo; y++) { ++ p = VIPS_REGION_ADDR(ir, lastx, y); ++ q = VIPS_REGION_ADDR(or, le, y); + +- for( x = le; x < ri; x++ ) { ++ for (x = le; x < ri; x++) { + /* Copy the pel. + */ +- for( z = 0; z < ps; z++ ) ++ for (z = 0; z < ps; z++) + q[z] = p[z]; + + /* Skip forwards in out, back in in. +@@ -181,28 +181,28 @@ vips_flip_horizontal_gen( VipsRegion *or, void *seq, void *a, void *b, + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_flip_build( VipsObject *object ) ++vips_flip_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsFlip *flip = (VipsFlip *) object; + + VipsGenerateFn generate_fn; + +- if( VIPS_OBJECT_CLASS( vips_flip_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_flip_parent_class)->build(object)) ++ return (-1); + +- if( vips_image_pio_input( flip->in ) ) +- return( -1 ); ++ if (vips_image_pio_input(flip->in)) ++ return (-1); + +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, flip->in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, flip->in, NULL)) ++ return (-1); + +- if( flip->direction == VIPS_DIRECTION_HORIZONTAL ) { ++ if (flip->direction == VIPS_DIRECTION_HORIZONTAL) { + generate_fn = vips_flip_horizontal_gen; + conversion->out->Xoffset = flip->in->Xsize; + conversion->out->Yoffset = 0; +@@ -213,45 +213,45 @@ vips_flip_build( VipsObject *object ) + conversion->out->Yoffset = flip->in->Ysize; + } + +- if( vips_image_generate( conversion->out, +- vips_start_one, generate_fn, vips_stop_one, +- flip->in, flip ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, generate_fn, vips_stop_one, ++ flip->in, flip)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_flip_class_init( VipsFlipClass *class ) ++vips_flip_class_init(VipsFlipClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_flip_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_flip_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "flip"; +- vobject_class->description = _( "flip an image" ); ++ vobject_class->description = _("flip an image"); + vobject_class->build = vips_flip_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsFlip, in ) ); ++ G_STRUCT_OFFSET(VipsFlip, in)); + +- VIPS_ARG_ENUM( class, "direction", 6, +- _( "Direction" ), +- _( "Direction to flip image" ), ++ VIPS_ARG_ENUM(class, "direction", 6, ++ _("Direction"), ++ _("Direction to flip image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsFlip, direction ), +- VIPS_TYPE_DIRECTION, VIPS_DIRECTION_HORIZONTAL ); ++ G_STRUCT_OFFSET(VipsFlip, direction), ++ VIPS_TYPE_DIRECTION, VIPS_DIRECTION_HORIZONTAL); + } + + static void +-vips_flip_init( VipsFlip *flip ) ++vips_flip_init(VipsFlip *flip) + { + } + +@@ -269,14 +269,14 @@ vips_flip_init( VipsFlip *flip ) + * Returns: 0 on success, -1 on error + */ + int +-vips_flip( VipsImage *in, VipsImage **out, VipsDirection direction, ... ) ++vips_flip(VipsImage *in, VipsImage **out, VipsDirection direction, ...) + { + va_list ap; + int result; + +- va_start( ap, direction ); +- result = vips_call_split( "flip", ap, in, out, direction ); +- va_end( ap ); ++ va_start(ap, direction); ++ result = vips_call_split("flip", ap, in, out, direction); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/gamma.c b/libvips/conversion/gamma.c +index 0f86f1d98a..58ade687e5 100644 +--- a/libvips/conversion/gamma.c ++++ b/libvips/conversion/gamma.c +@@ -1,7 +1,7 @@ + /* Raise an image to a gamma factor + * + * Copyright: 1990, N. Dessipris. +- * ++ * + * Written on: 19/07/1990 + * Modified on: + * 19/6/95 JC +@@ -19,28 +19,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -64,7 +64,7 @@ typedef struct _VipsGamma { + + typedef VipsConversionClass VipsGammaClass; + +-G_DEFINE_TYPE( VipsGamma, vips_gamma, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsGamma, vips_gamma, VIPS_TYPE_CONVERSION); + + /* For each input format, what we normalise the pow() about. + */ +@@ -82,87 +82,85 @@ static double vips_gamma_maxval[10] = { + }; + + static int +-vips_gamma_build( VipsObject *object ) ++vips_gamma_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsGamma *gamma = (VipsGamma *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 5 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 5); + VipsImage *in = gamma->in; + double scale; + +- if( VIPS_OBJECT_CLASS( vips_gamma_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_gamma_parent_class)->build(object)) ++ return (-1); + +- scale = pow( vips_gamma_maxval[in->BandFmt], +- 1.0 / gamma->exponent ) / +- vips_gamma_maxval[in->BandFmt]; ++ scale = pow(vips_gamma_maxval[in->BandFmt], ++ 1.0 / gamma->exponent) / ++ vips_gamma_maxval[in->BandFmt]; + +- if( in->BandFmt == VIPS_FORMAT_UCHAR || +- in->BandFmt == VIPS_FORMAT_USHORT ) { +- if( vips_identity( &t[0], ++ if (in->BandFmt == VIPS_FORMAT_UCHAR || ++ in->BandFmt == VIPS_FORMAT_USHORT) { ++ if (vips_identity(&t[0], + "ushort", in->BandFmt == VIPS_FORMAT_USHORT, +- NULL ) || +- vips_pow_const1( t[0], &t[1], +- 1.0 / gamma->exponent, NULL ) || +- vips_linear1( t[1], &t[2], 1.0 / scale, 0, NULL ) || +- vips_cast( t[2], &t[3], in->BandFmt, NULL ) || +- vips_maplut( in, &t[4], t[3], NULL ) || +- vips_image_write( t[4], conversion->out ) ) +- return( -1 ); +- } ++ NULL) || ++ vips_pow_const1(t[0], &t[1], ++ 1.0 / gamma->exponent, NULL) || ++ vips_linear1(t[1], &t[2], 1.0 / scale, 0, NULL) || ++ vips_cast(t[2], &t[3], in->BandFmt, NULL) || ++ vips_maplut(in, &t[4], t[3], NULL) || ++ vips_image_write(t[4], conversion->out)) ++ return (-1); ++ } + else { +- if( vips_pow_const1( in, &t[1], +- 1.0 / gamma->exponent, NULL ) || +- vips_linear1( t[1], &t[2], 1.0 / scale, 0, NULL ) || +- vips_cast( t[2], &t[3], in->BandFmt, NULL ) || +- vips_image_write( t[3], conversion->out ) ) +- return( -1 ); +- } +- +- return( 0 ); ++ if (vips_pow_const1(in, &t[1], ++ 1.0 / gamma->exponent, NULL) || ++ vips_linear1(t[1], &t[2], 1.0 / scale, 0, NULL) || ++ vips_cast(t[2], &t[3], in->BandFmt, NULL) || ++ vips_image_write(t[3], conversion->out)) ++ return (-1); ++ } ++ ++ return (0); + } + + static void +-vips_gamma_class_init( VipsGammaClass *class ) ++vips_gamma_class_init(VipsGammaClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "gamma"; +- vobject_class->description = _( "gamma an image" ); ++ vobject_class->description = _("gamma an image"); + vobject_class->build = vips_gamma_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGamma, in ) ); ++ G_STRUCT_OFFSET(VipsGamma, in)); + +- VIPS_ARG_DOUBLE( class, "exponent", 2, +- _( "Exponent" ), +- _( "Gamma factor" ), ++ VIPS_ARG_DOUBLE(class, "exponent", 2, ++ _("Exponent"), ++ _("Gamma factor"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsGamma, exponent ), +- 0.000001, 1000.0, 2.4 ); +- ++ G_STRUCT_OFFSET(VipsGamma, exponent), ++ 0.000001, 1000.0, 2.4); + } + + static void +-vips_gamma_init( VipsGamma *gamma ) ++vips_gamma_init(VipsGamma *gamma) + { + gamma->exponent = 1.0 / 2.4; + } + + /** + * vips_gamma: (method) +- * @in: input image ++ * @in: input image + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +@@ -171,21 +169,21 @@ vips_gamma_init( VipsGamma *gamma ) + * * @exponent: gamma, default 1.0 / 2.4 + * + * Calculate @in ** (1 / @exponent), normalising to the maximum range of the +- * input type. For float types use 1.0 as the maximum. ++ * input type. For float types use 1.0 as the maximum. + * + * See also: vips_identity(), vips_pow_const1(), vips_maplut() + * + * Returns: 0 on success, -1 on error + */ + int +-vips_gamma( VipsImage *in, VipsImage **out, ... ) ++vips_gamma(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "gamma", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("gamma", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/grid.c b/libvips/conversion/grid.c +index b61246e014..d1ea028cdf 100644 +--- a/libvips/conversion/grid.c ++++ b/libvips/conversion/grid.c +@@ -12,28 +12,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -63,15 +63,15 @@ typedef struct _VipsGrid { + + typedef VipsConversionClass VipsGridClass; + +-G_DEFINE_TYPE( VipsGrid, vips_grid, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsGrid, vips_grid, VIPS_TYPE_CONVERSION); + + static int +-vips_grid_gen( VipsRegion *or, void *vseq, void *a, void *b, +- gboolean *stop ) ++vips_grid_gen(VipsRegion * or, void *vseq, void *a, void *b, ++ gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) vseq; + VipsGrid *grid = (VipsGrid *) b; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int twidth = grid->in->Xsize; + int theight = grid->tile_height; + +@@ -92,7 +92,7 @@ vips_grid_gen( VipsRegion *or, void *vseq, void *a, void *b, + + /* If the request fits inside a single tile, we can just pointer-copy. + */ +- if( vips_rect_includesrect( &tile, r ) ) { ++ if (vips_rect_includesrect(&tile, r)) { + VipsRect irect; + + /* Translate request to input space. +@@ -102,15 +102,15 @@ vips_grid_gen( VipsRegion *or, void *vseq, void *a, void *b, + irect.top -= ys; + irect.top += grid->across * ys + theight * (xs / twidth); + +- if( vips_region_prepare( ir, &irect ) || +- vips_region_region( or, ir, r, irect.left, irect.top ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &irect) || ++ vips_region_region(or, ir, r, irect.left, irect.top)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +- for( y = ys; y < VIPS_RECT_BOTTOM( r ); y += theight ) +- for( x = xs; x < VIPS_RECT_RIGHT( r ); x += twidth ) { ++ for (y = ys; y < VIPS_RECT_BOTTOM(r); y += theight) ++ for (x = xs; x < VIPS_RECT_RIGHT(r); x += twidth) { + VipsRect paint; + VipsRect input; + +@@ -124,9 +124,9 @@ vips_grid_gen( VipsRegion *or, void *vseq, void *a, void *b, + /* Which parts touch the area of the output we are + * building. + */ +- vips_rect_intersectrect( &tile, r, &paint ); ++ vips_rect_intersectrect(&tile, r, &paint); + +- g_assert( !vips_rect_isempty( &paint ) ); ++ g_assert(!vips_rect_isempty(&paint)); + + /* Translate back to ir coordinates. + */ +@@ -137,95 +137,94 @@ vips_grid_gen( VipsRegion *or, void *vseq, void *a, void *b, + + /* Render into or. + */ +- if( vips_region_prepare_to( ir, or, &input, +- paint.left, paint.top ) ) +- return( -1 ); ++ if (vips_region_prepare_to(ir, or, &input, ++ paint.left, paint.top)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_grid_build( VipsObject *object ) ++vips_grid_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsGrid *grid = (VipsGrid *) object; + +- if( VIPS_OBJECT_CLASS( vips_grid_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_grid_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_coding_known( class->nickname, grid->in ) || +- vips_image_pio_input( grid->in ) ) +- return( -1 ); ++ if (vips_check_coding_known(class->nickname, grid->in) || ++ vips_image_pio_input(grid->in)) ++ return (-1); + +- if( grid->in->Ysize % grid->tile_height != 0 || +- grid->in->Ysize / grid->tile_height != +- grid->across * grid->down ) { +- vips_error( class->nickname, "%s", _( "bad grid geometry" ) ); +- return( -1 ); ++ if (grid->in->Ysize % grid->tile_height != 0 || ++ grid->in->Ysize / grid->tile_height != ++ grid->across * grid->down) { ++ vips_error(class->nickname, "%s", _("bad grid geometry")); ++ return (-1); + } + + /* We can render small tiles with pointer copies. + */ +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_SMALLTILE, grid->in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_SMALLTILE, grid->in, NULL)) ++ return (-1); + conversion->out->Xsize = grid->in->Xsize * grid->across; + conversion->out->Ysize = grid->tile_height * grid->down; + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_grid_gen, vips_stop_one, +- grid->in, grid ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_grid_gen, vips_stop_one, ++ grid->in, grid)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_grid_class_init( VipsGridClass *class ) ++vips_grid_class_init(VipsGridClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "grid"; +- vobject_class->description = _( "grid an image" ); ++ vobject_class->description = _("grid an image"); + vobject_class->build = vips_grid_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGrid, in ) ); ++ G_STRUCT_OFFSET(VipsGrid, in)); + +- VIPS_ARG_INT( class, "tile_height", 3, +- _( "Tile height" ), +- _( "Chop into tiles this high" ), ++ VIPS_ARG_INT(class, "tile_height", 3, ++ _("Tile height"), ++ _("Chop into tiles this high"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGrid, tile_height ), +- 1, 10000000, 128 ); ++ G_STRUCT_OFFSET(VipsGrid, tile_height), ++ 1, 10000000, 128); + +- VIPS_ARG_INT( class, "across", 4, +- _( "Across" ), +- _( "Number of tiles across" ), ++ VIPS_ARG_INT(class, "across", 4, ++ _("Across"), ++ _("Number of tiles across"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGrid, across ), +- 1, 10000000, 1 ); ++ G_STRUCT_OFFSET(VipsGrid, across), ++ 1, 10000000, 1); + +- VIPS_ARG_INT( class, "down", 5, +- _( "Down" ), +- _( "Number of tiles down" ), ++ VIPS_ARG_INT(class, "down", 5, ++ _("Down"), ++ _("Number of tiles down"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGrid, down ), +- 1, 10000000, 1 ); +- ++ G_STRUCT_OFFSET(VipsGrid, down), ++ 1, 10000000, 1); + } + + static void +-vips_grid_init( VipsGrid *grid ) ++vips_grid_init(VipsGrid *grid) + { + grid->tile_height = 128; + grid->across = 1; +@@ -241,7 +240,7 @@ vips_grid_init( VipsGrid *grid ) + * @down: tiles down + * @...: %NULL-terminated list of optional named arguments + * +- * Chop a tall thin image up into a set of tiles, lay the tiles out in a grid. ++ * Chop a tall thin image up into a set of tiles, lay the tiles out in a grid. + * + * The input image should be a very tall, thin image containing a list of + * smaller images. Volumetric or time-sequence images are often laid out like +@@ -251,23 +250,23 @@ vips_grid_init( VipsGrid *grid ) + * + * Supplying @tile_height, @across and @down is not strictly necessary, we + * only really need two of these. Requiring three is a double-check that the +- * image has the expected geometry. ++ * image has the expected geometry. + * + * See also: vips_embed(), vips_insert(), vips_join(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_grid( VipsImage *in, VipsImage **out, +- int tile_height, int across, int down, ... ) ++vips_grid(VipsImage *in, VipsImage **out, ++ int tile_height, int across, int down, ...) + { + va_list ap; + int result; + +- va_start( ap, down ); +- result = vips_call_split( "grid", ap, +- in, out, tile_height, across, down ); +- va_end( ap ); ++ va_start(ap, down); ++ result = vips_call_split("grid", ap, ++ in, out, tile_height, across, down); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/ifthenelse.c b/libvips/conversion/ifthenelse.c +index 169d7ee1f1..dbb87d8083 100644 +--- a/libvips/conversion/ifthenelse.c ++++ b/libvips/conversion/ifthenelse.c +@@ -29,28 +29,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -88,113 +88,139 @@ typedef struct _VipsIfthenelse { + + typedef VipsConversionClass VipsIfthenelseClass; + +-G_DEFINE_TYPE( VipsIfthenelse, vips_ifthenelse, VIPS_TYPE_CONVERSION ); +- +-#define IBLEND1( TYPE ) { \ +- TYPE *a = (TYPE *) ap; \ +- TYPE *b = (TYPE *) bp; \ +- TYPE *q = (TYPE *) qp; \ +- \ +- for( i = 0, x = 0; x < n; i++, x += bands ) { \ +- const int v = c[i]; \ +- \ +- for( z = x; z < x + bands; z++ ) \ +- q[z] = (v * a[z] + (255 - v) * b[z] + 128) / 255; \ +- } \ +-} ++G_DEFINE_TYPE(VipsIfthenelse, vips_ifthenelse, VIPS_TYPE_CONVERSION); ++ ++#define IBLEND1(TYPE) \ ++ { \ ++ TYPE *a = (TYPE *) ap; \ ++ TYPE *b = (TYPE *) bp; \ ++ TYPE *q = (TYPE *) qp; \ ++\ ++ for (i = 0, x = 0; x < n; i++, x += bands) { \ ++ const int v = c[i]; \ ++\ ++ for (z = x; z < x + bands; z++) \ ++ q[z] = (v * a[z] + (255 - v) * b[z] + 128) / 255; \ ++ } \ ++ } + +-#define IBLENDN( TYPE ) { \ +- TYPE *a = (TYPE *) ap; \ +- TYPE *b = (TYPE *) bp; \ +- TYPE *q = (TYPE *) qp; \ +- \ +- for( x = 0; x < n; x += bands ) { \ +- for( z = x; z < x + bands; z++ ) { \ +- const int v = c[z]; \ +- \ +- q[z] = (v * a[z] + (255 - v) * b[z] + 128) / 255; \ ++#define IBLENDN(TYPE) \ ++ { \ ++ TYPE *a = (TYPE *) ap; \ ++ TYPE *b = (TYPE *) bp; \ ++ TYPE *q = (TYPE *) qp; \ ++\ ++ for (x = 0; x < n; x += bands) { \ ++ for (z = x; z < x + bands; z++) { \ ++ const int v = c[z]; \ ++\ ++ q[z] = (v * a[z] + (255 - v) * b[z] + 128) / 255; \ ++ } \ + } \ +- } \ +-} ++ } + +-#define FBLEND1( TYPE ) { \ +- TYPE *a = (TYPE *) ap; \ +- TYPE *b = (TYPE *) bp; \ +- TYPE *q = (TYPE *) qp; \ +- \ +- for( i = 0, x = 0; x < n; i++, x += bands ) { \ +- const double v = c[i] / 255.0; \ +- \ +- for( z = x; z < x + bands; z++ ) \ +- q[z] = v * a[z] + (1.0 - v) * b[z]; \ +- } \ +-} ++#define FBLEND1(TYPE) \ ++ { \ ++ TYPE *a = (TYPE *) ap; \ ++ TYPE *b = (TYPE *) bp; \ ++ TYPE *q = (TYPE *) qp; \ ++\ ++ for (i = 0, x = 0; x < n; i++, x += bands) { \ ++ const double v = c[i] / 255.0; \ ++\ ++ for (z = x; z < x + bands; z++) \ ++ q[z] = v * a[z] + (1.0 - v) * b[z]; \ ++ } \ ++ } + +-#define FBLENDN( TYPE ) { \ +- TYPE *a = (TYPE *) ap; \ +- TYPE *b = (TYPE *) bp; \ +- TYPE *q = (TYPE *) qp; \ +- \ +- for( x = 0; x < n; x += bands ) { \ +- for( z = x; z < x + bands; z++ ) { \ +- const double v = c[z] / 255.0; \ +- \ +- q[z] = v * a[z] + (1.0 - v) * b[z]; \ ++#define FBLENDN(TYPE) \ ++ { \ ++ TYPE *a = (TYPE *) ap; \ ++ TYPE *b = (TYPE *) bp; \ ++ TYPE *q = (TYPE *) qp; \ ++\ ++ for (x = 0; x < n; x += bands) { \ ++ for (z = x; z < x + bands; z++) { \ ++ const double v = c[z] / 255.0; \ ++\ ++ q[z] = v * a[z] + (1.0 - v) * b[z]; \ ++ } \ + } \ +- } \ +-} ++ } + +-#define CBLEND1( TYPE ) { \ +- TYPE *a = (TYPE *) ap; \ +- TYPE *b = (TYPE *) bp; \ +- TYPE *q = (TYPE *) qp; \ +- \ +- for( i = 0, x = 0; x < n; i++, x += bands ) { \ +- const double v = c[i] / 255.0; \ +- \ +- for( z = x; z < x + 2 * bands; z++ ) \ +- q[z] = v * a[z] + (1.0 - v) * b[z]; \ +- } \ +-} ++#define CBLEND1(TYPE) \ ++ { \ ++ TYPE *a = (TYPE *) ap; \ ++ TYPE *b = (TYPE *) bp; \ ++ TYPE *q = (TYPE *) qp; \ ++\ ++ for (i = 0, x = 0; x < n; i++, x += bands) { \ ++ const double v = c[i] / 255.0; \ ++\ ++ for (z = x; z < x + 2 * bands; z++) \ ++ q[z] = v * a[z] + (1.0 - v) * b[z]; \ ++ } \ ++ } + +-#define CBLENDN( TYPE ) { \ +- TYPE *a = (TYPE *) ap; \ +- TYPE *b = (TYPE *) bp; \ +- TYPE *q = (TYPE *) qp; \ +- \ +- for( x = 0; x < n; x += bands ) { \ +- for( z = x; z < x + bands; z++ ) { \ +- const double v = c[z] / 255.0; \ +- \ +- q[2 * z] = v * a[2 * z] + (1.0 - v) * b[2 * z]; \ +- q[2 * z + 1] = v * a[2 * z + 1] + \ +- (1.0 - v) * b[2 * z + 1]; \ ++#define CBLENDN(TYPE) \ ++ { \ ++ TYPE *a = (TYPE *) ap; \ ++ TYPE *b = (TYPE *) bp; \ ++ TYPE *q = (TYPE *) qp; \ ++\ ++ for (x = 0; x < n; x += bands) { \ ++ for (z = x; z < x + bands; z++) { \ ++ const double v = c[z] / 255.0; \ ++\ ++ q[2 * z] = v * a[2 * z] + (1.0 - v) * b[2 * z]; \ ++ q[2 * z + 1] = v * a[2 * z + 1] + \ ++ (1.0 - v) * b[2 * z + 1]; \ ++ } \ + } \ +- } \ +-} ++ } + + /* Blend with a 1-band conditional image. + */ + static void +-vips_blend1_buffer( VipsPel *qp, +- VipsPel *c, VipsPel *ap, VipsPel *bp, int width, +- VipsImage *im ) ++vips_blend1_buffer(VipsPel *qp, ++ VipsPel *c, VipsPel *ap, VipsPel *bp, int width, ++ VipsImage *im) + { + int i, x, z; + const int bands = im->Bands; + const int n = width * bands; + +- switch( im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: IBLEND1( unsigned char ); break; +- case VIPS_FORMAT_CHAR: IBLEND1( signed char ); break; +- case VIPS_FORMAT_USHORT: IBLEND1( unsigned short ); break; +- case VIPS_FORMAT_SHORT: IBLEND1( signed short ); break; +- case VIPS_FORMAT_UINT: IBLEND1( unsigned int ); break; +- case VIPS_FORMAT_INT: IBLEND1( signed int ); break; +- case VIPS_FORMAT_FLOAT: FBLEND1( float ); break; +- case VIPS_FORMAT_DOUBLE: FBLEND1( double ); break; +- case VIPS_FORMAT_COMPLEX: CBLEND1( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: CBLEND1( double ); break; ++ switch (im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ IBLEND1(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ IBLEND1(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ IBLEND1(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ IBLEND1(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ IBLEND1(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ IBLEND1(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ FBLEND1(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ FBLEND1(double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ CBLEND1(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ CBLEND1(double); ++ break; + + default: + g_assert_not_reached(); +@@ -204,25 +230,45 @@ vips_blend1_buffer( VipsPel *qp, + /* Blend with a many band conditional image. + */ + static void +-vips_blendn_buffer( VipsPel *qp, +- VipsPel *c, VipsPel *ap, VipsPel *bp, int width, +- VipsImage *im ) ++vips_blendn_buffer(VipsPel *qp, ++ VipsPel *c, VipsPel *ap, VipsPel *bp, int width, ++ VipsImage *im) + { + int x, z; + const int bands = im->Bands; + const int n = width * bands; + +- switch( im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: IBLENDN( unsigned char ); break; +- case VIPS_FORMAT_CHAR: IBLENDN( signed char ); break; +- case VIPS_FORMAT_USHORT: IBLENDN( unsigned short ); break; +- case VIPS_FORMAT_SHORT: IBLENDN( signed short ); break; +- case VIPS_FORMAT_UINT: IBLENDN( unsigned int ); break; +- case VIPS_FORMAT_INT: IBLENDN( signed int ); break; +- case VIPS_FORMAT_FLOAT: FBLENDN( float ); break; +- case VIPS_FORMAT_DOUBLE: FBLENDN( double ); break; +- case VIPS_FORMAT_COMPLEX: CBLENDN( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: CBLENDN( double ); break; ++ switch (im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ IBLENDN(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ IBLENDN(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ IBLENDN(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ IBLENDN(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ IBLENDN(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ IBLENDN(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ FBLENDN(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ FBLENDN(double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ CBLENDN(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ CBLENDN(double); ++ break; + + default: + g_assert_not_reached(); +@@ -230,14 +276,14 @@ vips_blendn_buffer( VipsPel *qp, + } + + static int +-vips_blend_gen( VipsRegion *or, void *seq, void *client1, void *client2, +- gboolean *stop ) ++vips_blend_gen(VipsRegion * or, void *seq, void *client1, void *client2, ++ gboolean *stop) + { + VipsRegion **ir = (VipsRegion **) seq; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; + int to = r->top; +- int bo = VIPS_RECT_BOTTOM( r ); ++ int bo = VIPS_RECT_BOTTOM(r); + + VipsImage *c = ir[2]->im; + VipsImage *a = ir[0]->im; +@@ -245,79 +291,79 @@ vips_blend_gen( VipsRegion *or, void *seq, void *client1, void *client2, + int x, y; + int all0, all255; + +- if( vips_region_prepare( ir[2], r ) ) +- return( -1 ); ++ if (vips_region_prepare(ir[2], r)) ++ return (-1); + + /* Is the conditional all zero or all 255? We can avoid asking + * for one of the inputs to be calculated. + */ +- all0 = *VIPS_REGION_ADDR( ir[2], le, to ) == 0; +- all255 = *VIPS_REGION_ADDR( ir[2], le, to ) == 255; +- for( y = to; y < bo; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( ir[2], le, y ); ++ all0 = *VIPS_REGION_ADDR(ir[2], le, to) == 0; ++ all255 = *VIPS_REGION_ADDR(ir[2], le, to) == 255; ++ for (y = to; y < bo; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(ir[2], le, y); + int width = r->width * c->Bands; + +- for( x = 0; x < width; x++ ) { ++ for (x = 0; x < width; x++) { + all0 &= p[x] == 0; + all255 &= p[x] == 255; + } + +- if( !all0 && !all255 ) ++ if (!all0 && !all255) + break; + } + +- if( all255 ) { ++ if (all255) { + /* All 255. Point or at the then image. + */ +- if( vips_region_prepare( ir[0], r ) || +- vips_region_region( or, ir[0], r, r->left, r->top ) ) +- return( -1 ); ++ if (vips_region_prepare(ir[0], r) || ++ vips_region_region(or, ir[0], r, r->left, r->top)) ++ return (-1); + } +- else if( all0 ) { ++ else if (all0) { + /* All zero. Point or at the else image. + */ +- if( vips_region_prepare( ir[1], r ) || +- vips_region_region( or, ir[1], r, r->left, r->top ) ) +- return( -1 ); ++ if (vips_region_prepare(ir[1], r) || ++ vips_region_region(or, ir[1], r, r->left, r->top)) ++ return (-1); + } + else { +- /* Mix of set and clear ... ask for both then and else parts ++ /* Mix of set and clear ... ask for both then and else parts + * and interleave. + * + * We can't use vips_reorder_prepare_many() since we always + * want the c image first. + */ +- if( vips_region_prepare( ir[0], r ) || +- vips_region_prepare( ir[1], r ) ) +- return( -1 ); +- +- for( y = to; y < bo; y++ ) { +- VipsPel *ap = VIPS_REGION_ADDR( ir[0], le, y ); +- VipsPel *bp = VIPS_REGION_ADDR( ir[1], le, y ); +- VipsPel *cp = VIPS_REGION_ADDR( ir[2], le, y ); +- VipsPel *q = VIPS_REGION_ADDR( or, le, y ); +- +- if( c->Bands == 1 ) +- vips_blend1_buffer( q, cp, ap, bp, +- r->width, a ); ++ if (vips_region_prepare(ir[0], r) || ++ vips_region_prepare(ir[1], r)) ++ return (-1); ++ ++ for (y = to; y < bo; y++) { ++ VipsPel *ap = VIPS_REGION_ADDR(ir[0], le, y); ++ VipsPel *bp = VIPS_REGION_ADDR(ir[1], le, y); ++ VipsPel *cp = VIPS_REGION_ADDR(ir[2], le, y); ++ VipsPel *q = VIPS_REGION_ADDR(or, le, y); ++ ++ if (c->Bands == 1) ++ vips_blend1_buffer(q, cp, ap, bp, ++ r->width, a); + else +- vips_blendn_buffer( q, cp, ap, bp, +- r->width, a ); ++ vips_blendn_buffer(q, cp, ap, bp, ++ r->width, a); + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_ifthenelse_gen( VipsRegion *or, void *seq, void *client1, void *client2, +- gboolean *stop ) ++vips_ifthenelse_gen(VipsRegion * or, void *seq, void *client1, void *client2, ++ gboolean *stop) + { + VipsRegion **ir = (VipsRegion **) seq; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; + int to = r->top; +- int bo = VIPS_RECT_BOTTOM( r ); ++ int bo = VIPS_RECT_BOTTOM(r); + + VipsImage *c = ir[2]->im; + VipsImage *a = ir[0]->im; +@@ -327,99 +373,97 @@ vips_ifthenelse_gen( VipsRegion *or, void *seq, void *client1, void *client2, + + int all0, alln0; + +- if( c->Bands == 1 ) { ++ if (c->Bands == 1) { + /* Copying PEL-sized units with a one-band conditional. + */ +- size = VIPS_IMAGE_SIZEOF_PEL( a ); ++ size = VIPS_IMAGE_SIZEOF_PEL(a); + width = r->width; + } + else { + /* Copying ELEMENT sized-units with an n-band conditional. + */ +- size = VIPS_IMAGE_SIZEOF_ELEMENT( a ); ++ size = VIPS_IMAGE_SIZEOF_ELEMENT(a); + width = r->width * a->Bands; + } + +- if( vips_region_prepare( ir[2], r ) ) +- return( -1 ); ++ if (vips_region_prepare(ir[2], r)) ++ return (-1); + + /* Is the conditional all zero or all non-zero? We can avoid asking + * for one of the inputs to be calculated. + */ +- all0 = *VIPS_REGION_ADDR( ir[2], le, to ) == 0; +- alln0 = *VIPS_REGION_ADDR( ir[2], le, to ) != 0; +- for( y = to; y < bo; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( ir[2], le, y ); ++ all0 = *VIPS_REGION_ADDR(ir[2], le, to) == 0; ++ alln0 = *VIPS_REGION_ADDR(ir[2], le, to) != 0; ++ for (y = to; y < bo; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(ir[2], le, y); + +- for( x = 0; x < width; x++ ) { ++ for (x = 0; x < width; x++) { + all0 &= p[x] == 0; + alln0 &= p[x] != 0; + } + +- if( !all0 && !alln0 ) ++ if (!all0 && !alln0) + break; + } + +- if( alln0 ) { ++ if (alln0) { + /* All non-zero. Point or at the then image. + */ +- if( vips_region_prepare( ir[0], r ) || +- vips_region_region( or, ir[0], r, r->left, r->top ) ) +- return( -1 ); ++ if (vips_region_prepare(ir[0], r) || ++ vips_region_region(or, ir[0], r, r->left, r->top)) ++ return (-1); + } +- else if( all0 ) { ++ else if (all0) { + /* All zero. Point or at the else image. + */ +- if( vips_region_prepare( ir[1], r ) || +- vips_region_region( or, ir[1], r, r->left, r->top ) ) +- return( -1 ); ++ if (vips_region_prepare(ir[1], r) || ++ vips_region_region(or, ir[1], r, r->left, r->top)) ++ return (-1); + } + else { +- /* Mix of set and clear ... ask for both then and else parts ++ /* Mix of set and clear ... ask for both then and else parts + * and interleave. + */ +- if( vips_region_prepare( ir[0], r ) || +- vips_region_prepare( ir[1], r ) ) +- return( -1 ); +- +- for( y = to; y < bo; y++ ) { +- VipsPel *ap = VIPS_REGION_ADDR( ir[0], le, y ); +- VipsPel *bp = VIPS_REGION_ADDR( ir[1], le, y ); +- VipsPel *cp = VIPS_REGION_ADDR( ir[2], le, y ); +- VipsPel *q = VIPS_REGION_ADDR( or, le, y ); +- +- for( x = 0, i = 0; i < width; i++, x += size ) +- if( cp[i] ) +- for( z = x; z < x + size; z++ ) ++ if (vips_region_prepare(ir[0], r) || ++ vips_region_prepare(ir[1], r)) ++ return (-1); ++ ++ for (y = to; y < bo; y++) { ++ VipsPel *ap = VIPS_REGION_ADDR(ir[0], le, y); ++ VipsPel *bp = VIPS_REGION_ADDR(ir[1], le, y); ++ VipsPel *cp = VIPS_REGION_ADDR(ir[2], le, y); ++ VipsPel *q = VIPS_REGION_ADDR(or, le, y); ++ ++ for (x = 0, i = 0; i < width; i++, x += size) ++ if (cp[i]) ++ for (z = x; z < x + size; z++) + q[z] = ap[z]; + else +- for( z = x; z < x + size; z++ ) ++ for (z = x; z < x + size; z++) + q[z] = bp[z]; + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_ifthenelse_build( VipsObject *object ) ++vips_ifthenelse_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsIfthenelse *ifthenelse = (VipsIfthenelse *) object; +- VipsGenerateFn generate_fn = ifthenelse->blend ? +- vips_blend_gen : vips_ifthenelse_gen; +- +- VipsImage **band = (VipsImage **) vips_object_local_array( object, 3 ); +- VipsImage **size = (VipsImage **) vips_object_local_array( object, 3 ); +- VipsImage **format = +- (VipsImage **) vips_object_local_array( object, 3 ); ++ VipsGenerateFn generate_fn = ifthenelse->blend ? vips_blend_gen : vips_ifthenelse_gen; + ++ VipsImage **band = (VipsImage **) vips_object_local_array(object, 3); ++ VipsImage **size = (VipsImage **) vips_object_local_array(object, 3); ++ VipsImage **format = ++ (VipsImage **) vips_object_local_array(object, 3); + + VipsImage *all[3]; + +- if( VIPS_OBJECT_CLASS( vips_ifthenelse_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_ifthenelse_parent_class)->build(object)) ++ return (-1); + + /* We have to have the condition image last since we want the output + * image to inherit its properties from the then/else parts. +@@ -434,79 +478,79 @@ vips_ifthenelse_build( VipsObject *object ) + + /* Cast our input images up to a common bands and size. + */ +- if( vips__bandalike_vec( class->nickname, all, band, 3, 0 ) || +- vips__sizealike_vec( band, size, 3 ) ) +- return( -1 ); ++ if (vips__bandalike_vec(class->nickname, all, band, 3, 0) || ++ vips__sizealike_vec(band, size, 3)) ++ return (-1); + + /* Condition is cast to uchar, then/else to a common type. + */ +- if( size[2]->BandFmt != VIPS_FORMAT_UCHAR ) { +- if( vips_cast( size[2], &format[2], VIPS_FORMAT_UCHAR, NULL ) ) +- return( -1 ); ++ if (size[2]->BandFmt != VIPS_FORMAT_UCHAR) { ++ if (vips_cast(size[2], &format[2], VIPS_FORMAT_UCHAR, NULL)) ++ return (-1); + } + else { + format[2] = size[2]; +- g_object_ref( format[2] ); ++ g_object_ref(format[2]); + } + +- if( vips__formatalike_vec( size, format, 2 ) ) +- return( -1 ); ++ if (vips__formatalike_vec(size, format, 2)) ++ return (-1); + +- if( vips_image_pipeline_array( conversion->out, +- VIPS_DEMAND_STYLE_SMALLTILE, format ) ) +- return( -1 ); ++ if (vips_image_pipeline_array(conversion->out, ++ VIPS_DEMAND_STYLE_SMALLTILE, format)) ++ return (-1); + +- if( vips_image_generate( conversion->out, +- vips_start_many, generate_fn, vips_stop_many, +- format, ifthenelse ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_many, generate_fn, vips_stop_many, ++ format, ifthenelse)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_ifthenelse_class_init( VipsIfthenelseClass *class ) ++vips_ifthenelse_class_init(VipsIfthenelseClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_ifthenelse_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_ifthenelse_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "ifthenelse"; +- vobject_class->description = _( "ifthenelse an image" ); ++ vobject_class->description = _("ifthenelse an image"); + vobject_class->build = vips_ifthenelse_build; + +- VIPS_ARG_IMAGE( class, "cond", -2, +- _( "Condition" ), +- _( "Condition input image" ), ++ VIPS_ARG_IMAGE(class, "cond", -2, ++ _("Condition"), ++ _("Condition input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsIfthenelse, cond ) ); ++ G_STRUCT_OFFSET(VipsIfthenelse, cond)); + +- VIPS_ARG_IMAGE( class, "in1", -1, +- _( "Then image" ), +- _( "Source for TRUE pixels" ), ++ VIPS_ARG_IMAGE(class, "in1", -1, ++ _("Then image"), ++ _("Source for TRUE pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsIfthenelse, in1 ) ); ++ G_STRUCT_OFFSET(VipsIfthenelse, in1)); + +- VIPS_ARG_IMAGE( class, "in2", 0, +- _( "Else image" ), +- _( "Source for FALSE pixels" ), ++ VIPS_ARG_IMAGE(class, "in2", 0, ++ _("Else image"), ++ _("Source for FALSE pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsIfthenelse, in2 ) ); ++ G_STRUCT_OFFSET(VipsIfthenelse, in2)); + +- VIPS_ARG_BOOL( class, "blend", 4, +- _( "Blend" ), +- _( "Blend smoothly between then and else parts" ), ++ VIPS_ARG_BOOL(class, "blend", 4, ++ _("Blend"), ++ _("Blend smoothly between then and else parts"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsIfthenelse, blend ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsIfthenelse, blend), ++ FALSE); + } + + static void +-vips_ifthenelse_init( VipsIfthenelse *ifthenelse ) ++vips_ifthenelse_init(VipsIfthenelse *ifthenelse) + { + } + +@@ -522,12 +566,12 @@ vips_ifthenelse_init( VipsIfthenelse *ifthenelse ) + * + * * @blend: blend smoothly between @in1 and @in2 + * +- * This operation scans the condition image @cond ++ * This operation scans the condition image @cond + * and uses it to select pixels from either the then image @in1 or the else + * image @in2. Non-zero means @in1, 0 means @in2. + * + * Any image can have either 1 band or n bands, where n is the same for all +- * the non-1-band images. Single band images are then effectively copied to ++ * the non-1-band images. Single band images are then effectively copied to + * make n-band images. + * + * Images @in1 and @in2 are cast up to the smallest common format. @cond is +@@ -546,15 +590,15 @@ vips_ifthenelse_init( VipsIfthenelse *ifthenelse ) + * Returns: 0 on success, -1 on error + */ + int +-vips_ifthenelse( VipsImage *cond, VipsImage *in1, VipsImage *in2, +- VipsImage **out, ... ) ++vips_ifthenelse(VipsImage *cond, VipsImage *in1, VipsImage *in2, ++ VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "ifthenelse", ap, cond, in1, in2, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("ifthenelse", ap, cond, in1, in2, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/insert.c b/libvips/conversion/insert.c +index 7714a84c6f..d2430733a9 100644 +--- a/libvips/conversion/insert.c ++++ b/libvips/conversion/insert.c +@@ -4,7 +4,7 @@ + * + * Author: J. Cupitt + * Written on: 02/08/1990 +- * Modified on : ++ * Modified on : + * 31/8/93 JC + * - ANSIfied + * - Nicos' reformatting undone. Grr! +@@ -34,28 +34,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -103,7 +103,7 @@ typedef struct _VipsInsert { + /* Geometry. + */ + VipsRect rout; /* Output space */ +- VipsRect rimage[2]; /* Position of input in output */ ++ VipsRect rimage[2]; /* Position of input in output */ + + /* TRUE if we've minimised an input. + */ +@@ -113,14 +113,14 @@ typedef struct _VipsInsert { + + typedef VipsConversionClass VipsInsertClass; + +-G_DEFINE_TYPE( VipsInsert, vips_insert, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsInsert, vips_insert, VIPS_TYPE_CONVERSION); + + /* Trivial case: we just need pels from one of the inputs. + * + * Also used by vips_arrayjoin. + */ + int +-vips__insert_just_one( VipsRegion *or, VipsRegion *ir, int x, int y ) ++vips__insert_just_one(VipsRegion * or, VipsRegion *ir, int x, int y) + { + VipsRect need; + +@@ -129,32 +129,32 @@ vips__insert_just_one( VipsRegion *or, VipsRegion *ir, int x, int y ) + need = or->valid; + need.left -= x; + need.top -= y; +- if( vips_region_prepare( ir, &need ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &need)) ++ return (-1); + + /* Attach our output to it. + */ +- if( vips_region_region( or, ir, &or->valid, need.left, need.top ) ) +- return( -1 ); ++ if (vips_region_region(or, ir, & or->valid, need.left, need.top)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-/* Paste in parts of ir that fall within or --- ir is an input REGION for an ++/* Paste in parts of ir that fall within or --- ir is an input REGION for an + * image positioned at pos within or. + * + * Also used by vips_arrayjoin. + */ + int +-vips__insert_paste_region( VipsRegion *or, VipsRegion *ir, VipsRect *pos ) ++vips__insert_paste_region(VipsRegion * or, VipsRegion *ir, VipsRect *pos) + { + VipsRect ovl; + + /* Does any of the sub-image appear in the area we have been asked + * to make? + */ +- vips_rect_intersectrect( &or->valid, pos, &ovl ); +- if( !vips_rect_isempty( &ovl ) ) { ++ vips_rect_intersectrect(& or->valid, pos, &ovl); ++ if (!vips_rect_isempty(&ovl)) { + /* Find the part of in we need. + */ + ovl.left -= pos->left; +@@ -162,95 +162,95 @@ vips__insert_paste_region( VipsRegion *or, VipsRegion *ir, VipsRect *pos ) + + /* Paint this area of pixels into or. + */ +- if( vips_region_prepare_to( ir, or, &ovl, +- ovl.left + pos->left, ovl.top + pos->top ) ) +- return( -1 ); ++ if (vips_region_prepare_to(ir, or, &ovl, ++ ovl.left + pos->left, ovl.top + pos->top)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_insert_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop ) ++vips_insert_gen(VipsRegion * or, void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion **ir = (VipsRegion **) seq; +- VipsRect *r = &or->valid; +- VipsInsert *insert = (VipsInsert *) b; +- VipsConversion *conversion = VIPS_CONVERSION( insert ); ++ VipsRect *r = & or->valid; ++ VipsInsert *insert = (VipsInsert *) b; ++ VipsConversion *conversion = VIPS_CONVERSION(insert); + + int i; + + /* Three cases: + * + * 1. If r is entirely within sub, we can just paint from sub. +- * 2. If r is entirely within main and does not touch sub, we can ++ * 2. If r is entirely within main and does not touch sub, we can + * paint from main. + * 3. We must paint from both, and the background. + */ +- if( vips_rect_includesrect( &insert->rimage[1], r ) ) { ++ if (vips_rect_includesrect(&insert->rimage[1], r)) { + /* Just the subimage. + */ +- if( vips__insert_just_one( or, ir[1], +- insert->rimage[1].left, insert->rimage[1].top ) ) +- return( -1 ); ++ if (vips__insert_just_one(or, ir[1], ++ insert->rimage[1].left, insert->rimage[1].top)) ++ return (-1); + } +- else if( vips_rect_includesrect( &insert->rimage[0], r ) && +- !vips_rect_overlapsrect( &insert->rimage[1], r ) ) { ++ else if (vips_rect_includesrect(&insert->rimage[0], r) && ++ !vips_rect_overlapsrect(&insert->rimage[1], r)) { + /* Just the main image. + */ +- if( vips__insert_just_one( or, ir[0], +- insert->rimage[0].left, insert->rimage[0].top ) ) +- return( -1 ); ++ if (vips__insert_just_one(or, ir[0], ++ insert->rimage[0].left, insert->rimage[0].top)) ++ return (-1); + } + else { +- /* Output requires both (or neither) input. If it is not +- * entirely inside both the main and the sub, then there is +- * going to be some background. ++ /* Output requires both (or neither) input. If it is not ++ * entirely inside both the main and the sub, then there is ++ * going to be some background. + */ +- vips_region_paint_pel( or, r, insert->ink ); ++ vips_region_paint_pel(or, r, insert->ink); + + /* Paste the background first. + */ +- for( i = 0; i < 2; i++ ) +- if( vips__insert_paste_region( or, ir[i], +- &insert->rimage[i] ) ) +- return( -1 ); ++ for (i = 0; i < 2; i++) ++ if (vips__insert_paste_region(or, ir[i], ++ &insert->rimage[i])) ++ return (-1); + } + + /* See arrayjoin for almost this code again. Move into conversion.c? + */ +- if( vips_image_is_sequential( conversion->out ) ) +- for( i = 0; i < 2; i++ ) { +- int bottom_edge = +- VIPS_RECT_BOTTOM( &insert->rimage[i] ); ++ if (vips_image_is_sequential(conversion->out)) ++ for (i = 0; i < 2; i++) { ++ int bottom_edge = ++ VIPS_RECT_BOTTOM(&insert->rimage[i]); + + /* 1024 is a generous margin. 256 is too small. + */ +- if( !insert->minimised[i] && +- r->top > bottom_edge + 1024 ) { ++ if (!insert->minimised[i] && ++ r->top > bottom_edge + 1024) { + insert->minimised[i] = TRUE; +- vips_image_minimise_all( insert->processed[i] ); ++ vips_image_minimise_all(insert->processed[i]); + } + } + +- return( 0 ); ++ return (0); + } + + /* Make a pair of vector constants into a set of formatted pixels. bands can +- * be 3 while n is 1, meaning expand the constant to the number of bands. ++ * be 3 while n is 1, meaning expand the constant to the number of bands. + * imag can be NULL, meaning all zero for the imaginary component. + */ + VipsPel * +-vips__vector_to_pels( const char *domain, +- int bands, VipsBandFormat format, VipsCoding coding, +- double *real, double *imag, int n ) ++vips__vector_to_pels(const char *domain, ++ int bands, VipsBandFormat format, VipsCoding coding, ++ double *real, double *imag, int n) + { + /* Run our pipeline relative to this. + */ +- VipsImage *context = vips_image_new(); ++ VipsImage *context = vips_image_new(); + +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( context ), 8 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(context), 8); + + VipsImage *in; + double *ones; +@@ -258,134 +258,134 @@ vips__vector_to_pels( const char *domain, + int i; + + #ifdef VIPS_DEBUG +- printf( "vips__vector_to_pels: starting\n" ); ++ printf("vips__vector_to_pels: starting\n"); + #endif /*VIPS_DEBUG*/ + +- ones = VIPS_ARRAY( context, n, double ); +- for( i = 0; i < n; i++ ) ++ ones = VIPS_ARRAY(context, n, double); ++ for (i = 0; i < n; i++) + ones[i] = 1.0; + + /* Make the real and imaginary parts. + */ +- if( vips_black( &t[0], 1, 1, "bands", bands, NULL ) || +- vips_linear( t[0], &t[1], ones, real, n, NULL ) ) { +- g_object_unref( context ); +- return( NULL ); ++ if (vips_black(&t[0], 1, 1, "bands", bands, NULL) || ++ vips_linear(t[0], &t[1], ones, real, n, NULL)) { ++ g_object_unref(context); ++ return (NULL); + } + in = t[1]; + +- if( imag ) { +- if( vips_black( &t[2], 1, 1, "bands", bands, NULL ) || +- vips_linear( t[2], &t[3], ones, imag, n, NULL ) || +- vips_complexform( in, t[3], &t[4], NULL ) ) { +- g_object_unref( context ); +- return( NULL ); ++ if (imag) { ++ if (vips_black(&t[2], 1, 1, "bands", bands, NULL) || ++ vips_linear(t[2], &t[3], ones, imag, n, NULL) || ++ vips_complexform(in, t[3], &t[4], NULL)) { ++ g_object_unref(context); ++ return (NULL); + } + in = t[4]; + } + +- /* Cast to the output type and coding. ++ /* Cast to the output type and coding. + */ +- if( vips_cast( in, &t[5], format, NULL ) || +- vips_image_encode( t[5], &t[6], coding ) ) { +- g_object_unref( context ); +- return( NULL ); ++ if (vips_cast(in, &t[5], format, NULL) || ++ vips_image_encode(t[5], &t[6], coding)) { ++ g_object_unref(context); ++ return (NULL); + } + in = t[6]; + +- /* Write to memory, copy to output buffer. ++ /* Write to memory, copy to output buffer. + */ +- vips_image_set_int( in, "hide-progress", 1 ); +- if( !(t[7] = vips_image_new_memory()) || +- vips_image_write( in, t[7] ) ) { +- g_object_unref( context ); +- return( NULL ); ++ vips_image_set_int(in, "hide-progress", 1); ++ if (!(t[7] = vips_image_new_memory()) || ++ vips_image_write(in, t[7])) { ++ g_object_unref(context); ++ return (NULL); + } + in = t[7]; + +- if( !(result = +- VIPS_ARRAY( NULL, VIPS_IMAGE_SIZEOF_PEL( in ), VipsPel )) ) { +- g_object_unref( context ); +- return( NULL ); ++ if (!(result = ++ VIPS_ARRAY(NULL, VIPS_IMAGE_SIZEOF_PEL(in), VipsPel))) { ++ g_object_unref(context); ++ return (NULL); + } + +- memcpy( result, in->data, VIPS_IMAGE_SIZEOF_PEL( in ) ); ++ memcpy(result, in->data, VIPS_IMAGE_SIZEOF_PEL(in)); + + #ifdef VIPS_DEBUG +-{ +- int i; +- +- printf( "vips__vector_to_ink:\n" ); +- printf( "\t(real, imag) = " ); +- for( i = 0; i < n; i++ ) +- printf( "(%g, %g) ", real[i], imag ? imag[i] : 0 ); +- printf( "\n" ); +- printf( "\tink = " ); +- for( i = 0; i < VIPS_IMAGE_SIZEOF_PEL( in ); i++ ) +- printf( "%d ", result[i] ); +- printf( "\n" ); +-} ++ { ++ int i; ++ ++ printf("vips__vector_to_ink:\n"); ++ printf("\t(real, imag) = "); ++ for (i = 0; i < n; i++) ++ printf("(%g, %g) ", real[i], imag ? imag[i] : 0); ++ printf("\n"); ++ printf("\tink = "); ++ for (i = 0; i < VIPS_IMAGE_SIZEOF_PEL(in); i++) ++ printf("%d ", result[i]); ++ printf("\n"); ++ } + #endif /*VIPS_DEBUG*/ + +- g_object_unref( context ); ++ g_object_unref(context); + +- return( result ); ++ return (result); + } + + static void +-vips__vector_to_ink_cb( VipsObject *object, char *buf ) ++vips__vector_to_ink_cb(VipsObject *object, char *buf) + { +- g_free( buf ); ++ g_free(buf); + } + + /* Calculate a pixel for an image from a vec of double. Valid while im is +- * valid. ++ * valid. + */ + VipsPel * +-vips__vector_to_ink( const char *domain, +- VipsImage *im, double *real, double *imag, int n ) ++vips__vector_to_ink(const char *domain, ++ VipsImage *im, double *real, double *imag, int n) + { +- int bands; ++ int bands; + VipsBandFormat format; + VipsPel *result; + +- vips_image_decode_predict( im, &bands, &format ); ++ vips_image_decode_predict(im, &bands, &format); + +- if( !(result = vips__vector_to_pels( domain, +- bands, format, im->Coding, real, imag, n )) ) +- return( NULL ); ++ if (!(result = vips__vector_to_pels(domain, ++ bands, format, im->Coding, real, imag, n))) ++ return (NULL); + +- g_signal_connect( im, "postclose", +- G_CALLBACK( vips__vector_to_ink_cb ), result ); ++ g_signal_connect(im, "postclose", ++ G_CALLBACK(vips__vector_to_ink_cb), result); + +- return( result ); ++ return (result); + } + + static int +-vips_insert_build( VipsObject *object ) ++vips_insert_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsInsert *insert = (VipsInsert *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 6 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 6); + +- if( VIPS_OBJECT_CLASS( vips_insert_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_insert_parent_class)->build(object)) ++ return (-1); + +- if( vips_image_pio_input( insert->main ) || +- vips_image_pio_input( insert->sub ) || +- vips_check_bands_1orn( class->nickname, +- insert->main, insert->sub ) || +- vips_check_coding_known( class->nickname, insert->main ) || +- vips_check_coding_same( class->nickname, +- insert->main, insert->sub ) ) +- return( -1 ); ++ if (vips_image_pio_input(insert->main) || ++ vips_image_pio_input(insert->sub) || ++ vips_check_bands_1orn(class->nickname, ++ insert->main, insert->sub) || ++ vips_check_coding_known(class->nickname, insert->main) || ++ vips_check_coding_same(class->nickname, ++ insert->main, insert->sub)) ++ return (-1); + + /* Cast our input images up to a common format and bands. + */ +- if( vips__formatalike( insert->main, insert->sub, &t[0], &t[1] ) || +- vips__bandalike( class->nickname, t[0], t[1], &t[2], &t[3] ) ) +- return( -1 ); ++ if (vips__formatalike(insert->main, insert->sub, &t[0], &t[1]) || ++ vips__bandalike(class->nickname, t[0], t[1], &t[2], &t[3])) ++ return (-1); + insert->processed[0] = t[2]; + insert->processed[1] = t[3]; + +@@ -393,11 +393,11 @@ vips_insert_build( VipsObject *object ) + * horizontally to make a large image), we don't want mem use to shoot + * up. SMALLTILE will guarantee we keep small and local. + */ +- if( vips_image_pipeline_array( conversion->out, +- VIPS_DEMAND_STYLE_SMALLTILE, insert->processed ) ) +- return( -1 ); ++ if (vips_image_pipeline_array(conversion->out, ++ VIPS_DEMAND_STYLE_SMALLTILE, insert->processed)) ++ return (-1); + +- /* Calculate geometry. ++ /* Calculate geometry. + */ + insert->rimage[0].left = 0; + insert->rimage[0].top = 0; +@@ -409,11 +409,11 @@ vips_insert_build( VipsObject *object ) + insert->rimage[1].width = insert->processed[1]->Xsize; + insert->rimage[1].height = insert->processed[1]->Ysize; + +- if( insert->expand ) { ++ if (insert->expand) { + /* Expand output to bounding box of these two. + */ +- vips_rect_unionrect( &insert->rimage[0], &insert->rimage[1], +- &insert->rout ); ++ vips_rect_unionrect(&insert->rimage[0], &insert->rimage[1], ++ &insert->rout); + + /* Translate origin to top LH corner of rout. + */ +@@ -424,92 +424,92 @@ vips_insert_build( VipsObject *object ) + insert->rout.left = 0; + insert->rout.top = 0; + } +- else ++ else + insert->rout = insert->rimage[0]; + + conversion->out->Xsize = insert->rout.width; + conversion->out->Ysize = insert->rout.height; + +- if( !(insert->ink = vips__vector_to_ink( +- class->nickname, conversion->out, +- (double *) VIPS_ARRAY_ADDR( insert->background, 0 ), NULL, +- VIPS_AREA( insert->background )->n )) ) +- return( -1 ); ++ if (!(insert->ink = vips__vector_to_ink( ++ class->nickname, conversion->out, ++ (double *) VIPS_ARRAY_ADDR(insert->background, 0), NULL, ++ VIPS_AREA(insert->background)->n))) ++ return (-1); + +- if( vips_image_generate( conversion->out, +- vips_start_many, vips_insert_gen, vips_stop_many, +- insert->processed, insert ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_many, vips_insert_gen, vips_stop_many, ++ insert->processed, insert)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_insert_class_init( VipsInsertClass *class ) ++vips_insert_class_init(VipsInsertClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_insert_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_insert_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "insert"; +- vobject_class->description = +- _( "insert image @sub into @main at @x, @y" ); ++ vobject_class->description = ++ _("insert image @sub into @main at @x, @y"); + vobject_class->build = vips_insert_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "main", 0, +- _( "Main" ), +- _( "Main input image" ), ++ VIPS_ARG_IMAGE(class, "main", 0, ++ _("Main"), ++ _("Main input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsInsert, main ) ); ++ G_STRUCT_OFFSET(VipsInsert, main)); + +- VIPS_ARG_IMAGE( class, "sub", 1, +- _( "Sub-image" ), +- _( "Sub-image to insert into main image" ), ++ VIPS_ARG_IMAGE(class, "sub", 1, ++ _("Sub-image"), ++ _("Sub-image to insert into main image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsInsert, sub ) ); ++ G_STRUCT_OFFSET(VipsInsert, sub)); + +- VIPS_ARG_INT( class, "x", 3, +- _( "X" ), +- _( "Left edge of sub in main" ), ++ VIPS_ARG_INT(class, "x", 3, ++ _("X"), ++ _("Left edge of sub in main"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsInsert, x ), +- -VIPS_MAX_COORD, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsInsert, x), ++ -VIPS_MAX_COORD, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "y", 4, +- _( "Y" ), +- _( "Top edge of sub in main" ), ++ VIPS_ARG_INT(class, "y", 4, ++ _("Y"), ++ _("Top edge of sub in main"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsInsert, y ), +- -VIPS_MAX_COORD, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsInsert, y), ++ -VIPS_MAX_COORD, VIPS_MAX_COORD, 0); + +- VIPS_ARG_BOOL( class, "expand", 5, +- _( "Expand" ), +- _( "Expand output to hold all of both inputs" ), ++ VIPS_ARG_BOOL(class, "expand", 5, ++ _("Expand"), ++ _("Expand output to hold all of both inputs"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsInsert, expand ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsInsert, expand), ++ FALSE); + +- VIPS_ARG_BOXED( class, "background", 6, +- _( "Background" ), +- _( "Color for new pixels" ), ++ VIPS_ARG_BOXED(class, "background", 6, ++ _("Background"), ++ _("Color for new pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsInsert, background ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsInsert, background), ++ VIPS_TYPE_ARRAY_DOUBLE); + } + + static void +-vips_insert_init( VipsInsert *insert ) ++vips_insert_init(VipsInsert *insert) + { + /* Init our instance fields. + */ +- insert->background = vips_array_double_newv( 1, 0.0 ); ++ insert->background = vips_array_double_newv(1, 0.0); + } + + /** +@@ -526,23 +526,23 @@ vips_insert_init( VipsInsert *insert ) + * * @expand: expand output to hold whole of both images + * * @background: colour for new pixels + * +- * Insert @sub into @main at position @x, @y. ++ * Insert @sub into @main at position @x, @y. + * + * Normally @out shows the whole of @main. If @expand is #TRUE then @out is +- * made large enough to hold all of @main and @sub. ++ * made large enough to hold all of @main and @sub. + * Any areas of @out not coming from +- * either @main or @sub are set to @background (default 0). ++ * either @main or @sub are set to @background (default 0). + * + * If @sub overlaps @main, +- * @sub will appear on top of @main. ++ * @sub will appear on top of @main. + * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +- * The two input images are cast up to the smallest common type (see table +- * Smallest common format in ++ * The two input images are cast up to the smallest common type (see table ++ * Smallest common format in + * arithmetic). + * + * See also: vips_join(), vips_embed(), vips_extract_area(). +@@ -550,15 +550,15 @@ vips_insert_init( VipsInsert *insert ) + * Returns: 0 on success, -1 on error + */ + int +-vips_insert( VipsImage *main, VipsImage *sub, VipsImage **out, +- int x, int y, ... ) ++vips_insert(VipsImage *main, VipsImage *sub, VipsImage **out, ++ int x, int y, ...) + { + va_list ap; + int result; + +- va_start( ap, y ); +- result = vips_call_split( "insert", ap, main, sub, out, x, y ); +- va_end( ap ); ++ va_start(ap, y); ++ result = vips_call_split("insert", ap, main, sub, out, x, y); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/join.c b/libvips/conversion/join.c +index f1e8b5bfce..f6fd4a767c 100644 +--- a/libvips/conversion/join.c ++++ b/libvips/conversion/join.c +@@ -14,7 +14,7 @@ + * - bug in checking of image compatibility fixed + * 23/10/95 JC + * - rewritten in terms of im_insert() +- * 14/4/04 ++ * 14/4/04 + * - sets Xoffset / Yoffset + * 1/2/10 + * - gtkdoc +@@ -27,28 +27,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -87,30 +87,30 @@ typedef struct _VipsJoin { + + typedef VipsConversionClass VipsJoinClass; + +-G_DEFINE_TYPE( VipsJoin, vips_join, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsJoin, vips_join, VIPS_TYPE_CONVERSION); + + static int +-vips_join_build( VipsObject *object ) ++vips_join_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsJoin *join = (VipsJoin *) object; + + int x, y; + VipsImage *t; + +- if( VIPS_OBJECT_CLASS( vips_join_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_join_parent_class)->build(object)) ++ return (-1); + + /* Stop compiler warnings. + */ + x = 0; + y = 0; + +- switch( join->direction ) { ++ switch (join->direction) { + case VIPS_DIRECTION_HORIZONTAL: + x = join->in1->Xsize + join->shim; + +- switch( join->align ) { ++ switch (join->align) { + case VIPS_ALIGN_LOW: + y = 0; + break; +@@ -132,7 +132,7 @@ vips_join_build( VipsObject *object ) + case VIPS_DIRECTION_VERTICAL: + y = join->in1->Ysize + join->shim; + +- switch( join->align ) { ++ switch (join->align) { + case VIPS_ALIGN_LOW: + x = 0; + break; +@@ -155,29 +155,29 @@ vips_join_build( VipsObject *object ) + g_assert_not_reached(); + } + +- if( vips_insert( join->in1, join->in2, &t, x, y, +- "expand", TRUE, +- "background", join->background, +- NULL ) ) +- return( -1 ); ++ if (vips_insert(join->in1, join->in2, &t, x, y, ++ "expand", TRUE, ++ "background", join->background, ++ NULL)) ++ return (-1); + +- if( !join->expand ) { ++ if (!join->expand) { + VipsImage *t2; + int left, top, width, height; + +- switch( join->direction ) { ++ switch (join->direction) { + case VIPS_DIRECTION_HORIZONTAL: + left = 0; +- top = VIPS_MAX( 0, y ) - y; ++ top = VIPS_MAX(0, y) - y; + width = t->Xsize; +- height = VIPS_MIN( join->in1->Ysize, join->in2->Ysize ); ++ height = VIPS_MIN(join->in1->Ysize, join->in2->Ysize); + break; + + case VIPS_DIRECTION_VERTICAL: +- left = VIPS_MAX( 0, x ) - x; ++ left = VIPS_MAX(0, x) - x; + top = 0; +- width = VIPS_MIN( join->in1->Xsize, join->in2->Xsize ); +- height = t->Ysize; ++ width = VIPS_MIN(join->in1->Xsize, join->in2->Xsize); ++ height = t->Ysize; + break; + + default: +@@ -191,110 +191,110 @@ vips_join_build( VipsObject *object ) + height = 0; + } + +- if( left != 0 || ++ if (left != 0 || + top != 0 || + width != t->Xsize || +- height != t->Ysize ) { +- if( vips_extract_area( t, &t2, +- left, top, width, height, NULL ) ) { +- g_object_unref( t ); +- return( -1 ); ++ height != t->Ysize) { ++ if (vips_extract_area(t, &t2, ++ left, top, width, height, NULL)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + + t = t2; + } + } + +- if( vips_image_write( t, conversion->out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_image_write(t, conversion->out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + static void +-vips_join_class_init( VipsJoinClass *class ) ++vips_join_class_init(VipsJoinClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_join_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_join_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "join"; +- vobject_class->description = _( "join a pair of images" ); ++ vobject_class->description = _("join a pair of images"); + vobject_class->build = vips_join_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in1", 0, +- _( "in1" ), +- _( "First input image" ), ++ VIPS_ARG_IMAGE(class, "in1", 0, ++ _("in1"), ++ _("First input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsJoin, in1 ) ); ++ G_STRUCT_OFFSET(VipsJoin, in1)); + +- VIPS_ARG_IMAGE( class, "in2", 1, +- _( "in2" ), +- _( "Second input image" ), ++ VIPS_ARG_IMAGE(class, "in2", 1, ++ _("in2"), ++ _("Second input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsJoin, in2 ) ); ++ G_STRUCT_OFFSET(VipsJoin, in2)); + +- VIPS_ARG_ENUM( class, "direction", 3, +- _( "Direction" ), +- _( "Join left-right or up-down" ), ++ VIPS_ARG_ENUM(class, "direction", 3, ++ _("Direction"), ++ _("Join left-right or up-down"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsJoin, direction ), +- VIPS_TYPE_DIRECTION, VIPS_DIRECTION_HORIZONTAL ); ++ G_STRUCT_OFFSET(VipsJoin, direction), ++ VIPS_TYPE_DIRECTION, VIPS_DIRECTION_HORIZONTAL); + +- VIPS_ARG_BOOL( class, "expand", 4, +- _( "Expand" ), +- _( "Expand output to hold all of both inputs" ), ++ VIPS_ARG_BOOL(class, "expand", 4, ++ _("Expand"), ++ _("Expand output to hold all of both inputs"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsJoin, expand ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsJoin, expand), ++ FALSE); + +- VIPS_ARG_INT( class, "shim", 5, +- _( "Shim" ), +- _( "Pixels between images" ), ++ VIPS_ARG_INT(class, "shim", 5, ++ _("Shim"), ++ _("Pixels between images"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsJoin, shim ), +- 0, 1000000, 0 ); ++ G_STRUCT_OFFSET(VipsJoin, shim), ++ 0, 1000000, 0); + +- VIPS_ARG_BOXED( class, "background", 6, +- _( "Background" ), +- _( "Colour for new pixels" ), ++ VIPS_ARG_BOXED(class, "background", 6, ++ _("Background"), ++ _("Colour for new pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsJoin, background ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsJoin, background), ++ VIPS_TYPE_ARRAY_DOUBLE); + +- VIPS_ARG_ENUM( class, "align", 7, +- _( "Align" ), +- _( "Align on the low, centre or high coordinate edge" ), ++ VIPS_ARG_ENUM(class, "align", 7, ++ _("Align"), ++ _("Align on the low, centre or high coordinate edge"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsJoin, align ), +- VIPS_TYPE_ALIGN, VIPS_ALIGN_LOW ); ++ G_STRUCT_OFFSET(VipsJoin, align), ++ VIPS_TYPE_ALIGN, VIPS_ALIGN_LOW); + } + + static void +-vips_join_init( VipsJoin *join ) ++vips_join_init(VipsJoin *join) + { + /* Init our instance fields. + */ +- join->background = +- vips_area_new_array( G_TYPE_DOUBLE, sizeof( double ), 1 ); ++ join->background = ++ vips_area_new_array(G_TYPE_DOUBLE, sizeof(double), 1); + ((double *) (join->background->data))[0] = 0.0; + } + + /** + * vips_join: +- * @in1: first input image +- * @in2: second input image ++ * @in1: first input image ++ * @in2: second input image + * @out: (out): output image + * @direction: join horizontally or vertically + * @...: %NULL-terminated list of optional named arguments +@@ -306,7 +306,7 @@ vips_join_init( VipsJoin *join ) + * * @background: background ink colour + * * @align: low, centre or high alignment + * +- * Join @in1 and @in2 together, left-right or up-down depending on the value ++ * Join @in1 and @in2 together, left-right or up-down depending on the value + * of @direction. + * + * If one is taller or wider than the +@@ -320,14 +320,14 @@ vips_join_init( VipsJoin *join ) + * present in either @in1 or @in2. + * + * Use @shim to set the spacing between the images. By default this is 0. +- * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +- * The two input images are cast up to the smallest common type (see table +- * Smallest common format in ++ * The two input images are cast up to the smallest common type (see table ++ * Smallest common format in + * arithmetic). + * + * If you are going to be joining many thousands of images in a regular +@@ -338,15 +338,15 @@ vips_join_init( VipsJoin *join ) + * Returns: 0 on success, -1 on error + */ + int +-vips_join( VipsImage *in1, VipsImage *in2, VipsImage **out, +- VipsDirection direction, ... ) ++vips_join(VipsImage *in1, VipsImage *in2, VipsImage **out, ++ VipsDirection direction, ...) + { + va_list ap; + int result; + +- va_start( ap, direction ); +- result = vips_call_split( "join", ap, in1, in2, out, direction ); +- va_end( ap ); ++ va_start(ap, direction); ++ result = vips_call_split("join", ap, in1, in2, out, direction); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/msb.c b/libvips/conversion/msb.c +index 87986631d6..2fc6b21e92 100644 +--- a/libvips/conversion/msb.c ++++ b/libvips/conversion/msb.c +@@ -20,28 +20,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -62,7 +62,7 @@ typedef struct _VipsMsb { + /* Params. + */ + VipsImage *in; +- int band; ++ int band; + + /* Initial input offset. + */ +@@ -80,34 +80,34 @@ typedef struct _VipsMsb { + + typedef VipsConversionClass VipsMsbClass; + +-G_DEFINE_TYPE( VipsMsb, vips_msb, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsMsb, vips_msb, VIPS_TYPE_CONVERSION); + + static int +-vips_msb_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop ) ++vips_msb_gen(VipsRegion * or, void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + VipsMsb *msb = (VipsMsb *) b; + VipsConversion *conversion = (VipsConversion *) msb; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; + int to = r->top; +- int bo = VIPS_RECT_BOTTOM( r ); ++ int bo = VIPS_RECT_BOTTOM(r); + int sz = r->width * conversion->out->Bands; + + int x, y, i; + +- if( vips_region_prepare( ir, r ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, r)) ++ return (-1); + +- for( y = to; y < bo; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( ir, le, y ); +- VipsPel *q = VIPS_REGION_ADDR( or, le, y ); ++ for (y = to; y < bo; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(ir, le, y); ++ VipsPel *q = VIPS_REGION_ADDR(or, le, y); + +- if( msb->in->Coding == VIPS_CODING_LABQ && +- msb->band == -1 ) { ++ if (msb->in->Coding == VIPS_CODING_LABQ && ++ msb->band == -1) { + /* LABQ, no sub-band select. + */ +- for( x = 0; x < r->width; x++ ) { ++ for (x = 0; x < r->width; x++) { + q[0] = p[0]; + q[1] = 0x80 ^ p[1]; + q[2] = 0x80 ^ p[2]; +@@ -116,21 +116,21 @@ vips_msb_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop ) + p += 3; + } + } +- else if( msb->sign ) { ++ else if (msb->sign) { + /* Copy, converting signed to unsigned. + */ + p += msb->offset; +- for( i = 0; i < sz; i++ ) { ++ for (i = 0; i < sz; i++) { + q[i] = 0x80 ^ *p; + + p += msb->instep; + } + } + else { +- /* Just pick out bytes. ++ /* Just pick out bytes. + */ + p += msb->offset; +- for( i = 0; i < sz; i++ ) { ++ for (i = 0; i < sz; i++) { + q[i] = *p; + + p += msb->instep; +@@ -138,125 +138,122 @@ vips_msb_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop ) + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_msb_build( VipsObject *object ) ++vips_msb_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsConversion *conversion = (VipsConversion *) object; + VipsMsb *msb = (VipsMsb *) object; + + int vbands; + +- if( VIPS_OBJECT_CLASS( vips_msb_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_msb_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_coding_noneorlabq( class->nickname, msb->in ) || +- vips_check_int( class->nickname, msb->in ) ) +- return( -1 ); ++ if (vips_check_coding_noneorlabq(class->nickname, msb->in) || ++ vips_check_int(class->nickname, msb->in)) ++ return (-1); + + /* Effective number of bands this image has. + */ +- vbands = msb->in->Coding == VIPS_CODING_LABQ ? +- 3 : msb->in->Bands; ++ vbands = msb->in->Coding == VIPS_CODING_LABQ ? 3 : msb->in->Bands; + +- if( msb->band > vbands - 1 ) { +- vips_error( class->nickname, "%s", _( "bad band" ) ); +- return( -1 ); ++ if (msb->band > vbands - 1) { ++ vips_error(class->nickname, "%s", _("bad band")); ++ return (-1); + } + + /* Step to next input element. + */ +- msb->instep = VIPS_IMAGE_SIZEOF_ELEMENT( msb->in ); ++ msb->instep = VIPS_IMAGE_SIZEOF_ELEMENT(msb->in); + + /* Offset into first band element of high order byte. + */ +- msb->offset = vips_amiMSBfirst() ? +- 0 : VIPS_IMAGE_SIZEOF_ELEMENT( msb->in ) - 1; ++ msb->offset = vips_amiMSBfirst() ? 0 : VIPS_IMAGE_SIZEOF_ELEMENT(msb->in) - 1; + + /* If we're picking out a band, they need scaling up. + */ +- if( msb->band != -1 ) { +- msb->offset += VIPS_IMAGE_SIZEOF_ELEMENT( msb->in ) * ++ if (msb->band != -1) { ++ msb->offset += VIPS_IMAGE_SIZEOF_ELEMENT(msb->in) * + msb->band; + msb->instep *= msb->in->Bands; + } + + /* May need to flip sign if we're picking out a band from labq. + */ +- if( msb->in->Coding == VIPS_CODING_LABQ && +- msb->band > 0 ) ++ if (msb->in->Coding == VIPS_CODING_LABQ && ++ msb->band > 0) + msb->sign = TRUE; +- if( msb->in->Coding == VIPS_CODING_NONE && +- !vips_band_format_isuint( msb->in->BandFmt ) ) ++ if (msb->in->Coding == VIPS_CODING_NONE && ++ !vips_band_format_isuint(msb->in->BandFmt)) + msb->sign = TRUE; + +- if( msb->band == -1 && +- msb->in->BandFmt == VIPS_FORMAT_UCHAR ) +- return( vips_image_write( msb->in, conversion->out ) ); +- if( msb->band == 0 && ++ if (msb->band == -1 && ++ msb->in->BandFmt == VIPS_FORMAT_UCHAR) ++ return (vips_image_write(msb->in, conversion->out)); ++ if (msb->band == 0 && + msb->in->Bands == 1 && +- msb->in->BandFmt == VIPS_FORMAT_UCHAR ) +- return( vips_image_write( msb->in, conversion->out ) ); ++ msb->in->BandFmt == VIPS_FORMAT_UCHAR) ++ return (vips_image_write(msb->in, conversion->out)); + +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, msb->in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, msb->in, NULL)) ++ return (-1); + +- if( msb->band != -1 ) ++ if (msb->band != -1) + conversion->out->Bands = 1; +- else ++ else + conversion->out->Bands = vbands; + conversion->out->BandFmt = VIPS_FORMAT_UCHAR; + conversion->out->Coding = VIPS_CODING_NONE; +- if( conversion->out->Bands == 1 ) ++ if (conversion->out->Bands == 1) + conversion->out->Type = VIPS_INTERPRETATION_B_W; + else + conversion->out->Type = VIPS_INTERPRETATION_MULTIBAND; + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_msb_gen, vips_stop_one, msb->in, msb ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_msb_gen, vips_stop_one, msb->in, msb)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_msb_class_init( VipsMsbClass *class ) ++vips_msb_class_init(VipsMsbClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "msb"; +- vobject_class->description = +- _( "pick most-significant byte from an image" ); ++ vobject_class->description = ++ _("pick most-significant byte from an image"); + vobject_class->build = vips_msb_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 0, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 0, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMsb, in ) ); ++ G_STRUCT_OFFSET(VipsMsb, in)); + +- VIPS_ARG_INT( class, "band", 3, +- _( "Band" ), +- _( "Band to msb" ), ++ VIPS_ARG_INT(class, "band", 3, ++ _("Band"), ++ _("Band to msb"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMsb, band ), +- 0, 100000000, 0 ); +- ++ G_STRUCT_OFFSET(VipsMsb, band), ++ 0, 100000000, 0); + } + + static void +-vips_msb_init( VipsMsb *msb ) ++vips_msb_init(VipsMsb *msb) + { + msb->band = -1; + } +@@ -274,24 +271,23 @@ vips_msb_init( VipsMsb *msb ) + * Turn any integer image to 8-bit unsigned char by discarding all but the most + * significant byte. Signed values are converted to unsigned by adding 128. + * +- * Use @band to make a one-band 8-bit image. ++ * Use @band to make a one-band 8-bit image. + * + * This operator also works for LABQ coding. + * + * See also: vips_scale(), vips_cast(). +- * ++ * + * Returns: 0 on success, -1 on error. + */ + int +-vips_msb( VipsImage *in, VipsImage **out, ... ) ++vips_msb(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "msb", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("msb", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/conversion/pconversion.h b/libvips/conversion/pconversion.h +index d94d7ae48f..c06a192975 100644 +--- a/libvips/conversion/pconversion.h ++++ b/libvips/conversion/pconversion.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -38,19 +38,19 @@ extern "C" { + #include + + #define VIPS_TYPE_CONVERSION (vips_conversion_get_type()) +-#define VIPS_CONVERSION( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_CONVERSION, VipsConversion )) +-#define VIPS_CONVERSION_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_CONVERSION(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_CONVERSION, VipsConversion)) ++#define VIPS_CONVERSION_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_CONVERSION, VipsConversionClass)) ++#define VIPS_IS_CONVERSION(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_CONVERSION)) ++#define VIPS_IS_CONVERSION_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_CONVERSION)) ++#define VIPS_CONVERSION_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_CONVERSION, VipsConversionClass)) +-#define VIPS_IS_CONVERSION( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_CONVERSION )) +-#define VIPS_IS_CONVERSION_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_CONVERSION )) +-#define VIPS_CONVERSION_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_CONVERSION, VipsConversionClass )) + + typedef struct _VipsConversion { + VipsOperation parent_instance; +@@ -66,12 +66,10 @@ typedef struct _VipsConversionClass { + + } VipsConversionClass; + +-GType vips_conversion_get_type( void ); ++GType vips_conversion_get_type(void); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_PCONVERSION_H*/ +- +- +diff --git a/libvips/conversion/premultiply.c b/libvips/conversion/premultiply.c +index cc960cdb1d..e5136e9b5c 100644 +--- a/libvips/conversion/premultiply.c ++++ b/libvips/conversion/premultiply.c +@@ -13,28 +13,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -69,210 +69,211 @@ typedef struct _VipsPremultiply { + + typedef VipsConversionClass VipsPremultiplyClass; + +-G_DEFINE_TYPE( VipsPremultiply, vips_premultiply, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsPremultiply, vips_premultiply, VIPS_TYPE_CONVERSION); + + /* Premultiply an n-band image. + */ +-#define PRE_MANY( IN, OUT ) { \ +- IN * restrict p = (IN *) in; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < width; x++ ) { \ +- IN alpha = p[bands - 1]; \ +- IN clip_alpha = VIPS_CLIP( 0, alpha, max_alpha ); \ +- OUT nalpha = (OUT) clip_alpha / max_alpha; \ +- \ +- for( i = 0; i < bands - 1; i++ ) \ +- q[i] = p[i] * nalpha; \ +- q[i] = alpha; \ +- \ +- p += bands; \ +- q += bands; \ +- } \ +-} ++#define PRE_MANY(IN, OUT) \ ++ { \ ++ IN *restrict p = (IN *) in; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < width; x++) { \ ++ IN alpha = p[bands - 1]; \ ++ IN clip_alpha = VIPS_CLIP(0, alpha, max_alpha); \ ++ OUT nalpha = (OUT) clip_alpha / max_alpha; \ ++\ ++ for (i = 0; i < bands - 1; i++) \ ++ q[i] = p[i] * nalpha; \ ++ q[i] = alpha; \ ++\ ++ p += bands; \ ++ q += bands; \ ++ } \ ++ } + + /* Special case for RGBA, it's very common. + */ +-#define PRE_RGBA( IN, OUT ) { \ +- IN * restrict p = (IN *) in; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < width; x++ ) { \ +- IN alpha = p[3]; \ +- IN clip_alpha = VIPS_CLIP( 0, alpha, max_alpha ); \ +- OUT nalpha = (OUT) clip_alpha / max_alpha; \ +- \ +- q[0] = p[0] * nalpha; \ +- q[1] = p[1] * nalpha; \ +- q[2] = p[2] * nalpha; \ +- q[3] = alpha; \ +- \ +- p += 4; \ +- q += 4; \ +- } \ +-} ++#define PRE_RGBA(IN, OUT) \ ++ { \ ++ IN *restrict p = (IN *) in; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < width; x++) { \ ++ IN alpha = p[3]; \ ++ IN clip_alpha = VIPS_CLIP(0, alpha, max_alpha); \ ++ OUT nalpha = (OUT) clip_alpha / max_alpha; \ ++\ ++ q[0] = p[0] * nalpha; \ ++ q[1] = p[1] * nalpha; \ ++ q[2] = p[2] * nalpha; \ ++ q[3] = alpha; \ ++\ ++ p += 4; \ ++ q += 4; \ ++ } \ ++ } + +-#define PRE( IN, OUT ) { \ +- if( bands == 4 ) { \ +- PRE_RGBA( IN, OUT ); \ +- } \ +- else { \ +- PRE_MANY( IN, OUT ); \ +- } \ +-} ++#define PRE(IN, OUT) \ ++ { \ ++ if (bands == 4) { \ ++ PRE_RGBA(IN, OUT); \ ++ } \ ++ else { \ ++ PRE_MANY(IN, OUT); \ ++ } \ ++ } + + static int +-vips_premultiply_gen( VipsRegion *or, void *vseq, void *a, void *b, +- gboolean *stop ) ++vips_premultiply_gen(VipsRegion * or, void *vseq, void *a, void *b, ++ gboolean *stop) + { + VipsPremultiply *premultiply = (VipsPremultiply *) b; + VipsRegion *ir = (VipsRegion *) vseq; + VipsImage *im = ir->im; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int width = r->width; +- int bands = im->Bands; ++ int bands = im->Bands; + double max_alpha = premultiply->max_alpha; + + int x, y, i; + +- if( vips_region_prepare( ir, r ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, r)) ++ return (-1); + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *in = VIPS_REGION_ADDR( ir, r->left, r->top + y ); +- VipsPel *out = VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *in = VIPS_REGION_ADDR(ir, r->left, r->top + y); ++ VipsPel *out = VIPS_REGION_ADDR(or, r->left, r->top + y); + +- switch( im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- PRE( unsigned char, float ); +- break; ++ switch (im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ PRE(unsigned char, float); ++ break; + +- case VIPS_FORMAT_CHAR: +- PRE( signed char, float ); +- break; ++ case VIPS_FORMAT_CHAR: ++ PRE(signed char, float); ++ break; + +- case VIPS_FORMAT_USHORT: +- PRE( unsigned short, float ); +- break; ++ case VIPS_FORMAT_USHORT: ++ PRE(unsigned short, float); ++ break; + +- case VIPS_FORMAT_SHORT: +- PRE( signed short, float ); +- break; ++ case VIPS_FORMAT_SHORT: ++ PRE(signed short, float); ++ break; + +- case VIPS_FORMAT_UINT: +- PRE( unsigned int, float ); +- break; ++ case VIPS_FORMAT_UINT: ++ PRE(unsigned int, float); ++ break; + +- case VIPS_FORMAT_INT: +- PRE( signed int, float ); +- break; ++ case VIPS_FORMAT_INT: ++ PRE(signed int, float); ++ break; + +- case VIPS_FORMAT_FLOAT: +- PRE( float, float ); +- break; ++ case VIPS_FORMAT_FLOAT: ++ PRE(float, float); ++ break; + +- case VIPS_FORMAT_DOUBLE: +- PRE( double, double ); +- break; ++ case VIPS_FORMAT_DOUBLE: ++ PRE(double, double); ++ break; + +- case VIPS_FORMAT_COMPLEX: +- case VIPS_FORMAT_DPCOMPLEX: +- default: +- g_assert_not_reached(); +- } ++ case VIPS_FORMAT_COMPLEX: ++ case VIPS_FORMAT_DPCOMPLEX: ++ default: ++ g_assert_not_reached(); ++ } + } + +- return( 0 ); ++ return (0); + } + +- + static int +-vips_premultiply_build( VipsObject *object ) ++vips_premultiply_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsPremultiply *premultiply = (VipsPremultiply *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 1 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 1); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_premultiply_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_premultiply_parent_class)->build(object)) ++ return (-1); + +- in = premultiply->in; ++ in = premultiply->in; + +- if( vips_image_decode( in, &t[0] ) ) +- return( -1 ); +- in = t[0]; ++ if (vips_image_decode(in, &t[0])) ++ return (-1); ++ in = t[0]; + + /* Trivial case: fall back to copy(). + */ +- if( in->Bands == 1 ) +- return( vips_image_write( in, conversion->out ) ); ++ if (in->Bands == 1) ++ return (vips_image_write(in, conversion->out)); + +- if( vips_check_noncomplex( class->nickname, in ) ) +- return( -1 ); ++ if (vips_check_noncomplex(class->nickname, in)) ++ return (-1); + +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, in, NULL)) ++ return (-1); + + /* Is max-alpha unset? Default to the correct value for this + * interpretation. + */ +- if( !vips_object_argument_isset( object, "max_alpha" ) ) +- if( in->Type == VIPS_INTERPRETATION_GREY16 || +- in->Type == VIPS_INTERPRETATION_RGB16 ) ++ if (!vips_object_argument_isset(object, "max_alpha")) ++ if (in->Type == VIPS_INTERPRETATION_GREY16 || ++ in->Type == VIPS_INTERPRETATION_RGB16) + premultiply->max_alpha = 65535; + +- if( in->BandFmt == VIPS_FORMAT_DOUBLE ) ++ if (in->BandFmt == VIPS_FORMAT_DOUBLE) + conversion->out->BandFmt = VIPS_FORMAT_DOUBLE; + else + conversion->out->BandFmt = VIPS_FORMAT_FLOAT; + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_premultiply_gen, vips_stop_one, +- in, premultiply ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_premultiply_gen, vips_stop_one, ++ in, premultiply)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_premultiply_class_init( VipsPremultiplyClass *class ) ++vips_premultiply_class_init(VipsPremultiplyClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_premultiply_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_premultiply_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "premultiply"; +- vobject_class->description = _( "premultiply image alpha" ); ++ vobject_class->description = _("premultiply image alpha"); + vobject_class->build = vips_premultiply_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsPremultiply, in ) ); ++ G_STRUCT_OFFSET(VipsPremultiply, in)); + +- VIPS_ARG_DOUBLE( class, "max_alpha", 115, +- _( "Maximum alpha" ), +- _( "Maximum value of alpha channel" ), ++ VIPS_ARG_DOUBLE(class, "max_alpha", 115, ++ _("Maximum alpha"), ++ _("Maximum value of alpha channel"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsPremultiply, max_alpha ), +- 0, 100000000, 255 ); ++ G_STRUCT_OFFSET(VipsPremultiply, max_alpha), ++ 0, 100000000, 255); + } + + static void +-vips_premultiply_init( VipsPremultiply *premultiply ) ++vips_premultiply_init(VipsPremultiply *premultiply) + { + premultiply->max_alpha = 255.0; + } +@@ -287,19 +288,19 @@ vips_premultiply_init( VipsPremultiply *premultiply ) + * + * * @max_alpha: %gdouble, maximum value for alpha + * +- * Premultiplies any alpha channel. ++ * Premultiplies any alpha channel. + * The final band is taken to be the alpha + * and the bands are transformed as: + * + * |[ +- * alpha = clip( 0, in[in.bands - 1], @max_alpha ); +- * norm = alpha / @max_alpha; ++ * alpha = clip( 0, in[in.bands - 1], @max_alpha ); ++ * norm = alpha / @max_alpha; + * out = [in[0] * norm, ..., in[in.bands - 1] * norm, alpha]; + * ]| + * +- * So for an N-band image, the first N - 1 bands are multiplied by the clipped +- * and normalised final band, the final band is clipped. +- * If there is only a single band, ++ * So for an N-band image, the first N - 1 bands are multiplied by the clipped ++ * and normalised final band, the final band is clipped. ++ * If there is only a single band, + * the image is passed through unaltered. + * + * The result is +@@ -308,7 +309,7 @@ vips_premultiply_init( VipsPremultiply *premultiply ) + * + * @max_alpha has the default value 255, or 65535 for images tagged as + * #VIPS_INTERPRETATION_RGB16 or +- * #VIPS_INTERPRETATION_GREY16. ++ * #VIPS_INTERPRETATION_GREY16. + * + * Non-complex images only. + * +@@ -317,14 +318,14 @@ vips_premultiply_init( VipsPremultiply *premultiply ) + * Returns: 0 on success, -1 on error + */ + int +-vips_premultiply( VipsImage *in, VipsImage **out, ... ) ++vips_premultiply(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "premultiply", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("premultiply", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/recomb.c b/libvips/conversion/recomb.c +index 06ac950589..526dfbfee3 100644 +--- a/libvips/conversion/recomb.c ++++ b/libvips/conversion/recomb.c +@@ -11,28 +11,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -60,7 +60,7 @@ typedef struct _VipsRecomb { + VipsImage *in; + VipsImage *m; + +- /* Our input matrix as a one-band double. ++ /* Our input matrix as a one-band double. + */ + VipsImage *coeff; + +@@ -68,37 +68,38 @@ typedef struct _VipsRecomb { + + typedef VipsConversionClass VipsRecombClass; + +-G_DEFINE_TYPE( VipsRecomb, vips_recomb, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsRecomb, vips_recomb, VIPS_TYPE_CONVERSION); + + /* Inner loop. + */ +-#define LOOP( IN, OUT ) { \ +- IN * restrict p = (IN *) in; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < or->valid.width; x++ ) { \ +- double * restrict m = VIPS_MATRIX( recomb->coeff, 0, 0 ); \ +- \ +- for( v = 0; v < mheight; v++ ) { \ +- double t; \ +- \ +- t = 0.0; \ +- \ +- for( u = 0; u < mwidth; u++ ) \ +- t += m[u] * p[u]; \ +- \ +- q[v] = (OUT) t; \ +- m += mwidth; \ ++#define LOOP(IN, OUT) \ ++ { \ ++ IN *restrict p = (IN *) in; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < or->valid.width; x++) { \ ++ double *restrict m = VIPS_MATRIX(recomb->coeff, 0, 0); \ ++\ ++ for (v = 0; v < mheight; v++) { \ ++ double t; \ ++\ ++ t = 0.0; \ ++\ ++ for (u = 0; u < mwidth; u++) \ ++ t += m[u] * p[u]; \ ++\ ++ q[v] = (OUT) t; \ ++ m += mwidth; \ ++ } \ ++\ ++ p += mwidth; \ ++ q += mheight; \ + } \ +- \ +- p += mwidth; \ +- q += mheight; \ +- } \ +-} ++ } + + static int +-vips_recomb_gen( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_recomb_gen(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + VipsRecomb *recomb = (VipsRecomb *) b; +@@ -108,127 +109,143 @@ vips_recomb_gen( VipsRegion *or, + + int y, x, u, v; + +- if( vips_region_prepare( ir, &or->valid ) ) +- return( -1 ); +- +- for( y = 0; y < or->valid.height; y++ ) { +- VipsPel *in = VIPS_REGION_ADDR( ir, +- or->valid.left, or->valid.top + y ); +- VipsPel *out = VIPS_REGION_ADDR( or, +- or->valid.left, or->valid.top + y ); +- +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_UCHAR: LOOP( unsigned char, float ); break; +- case VIPS_FORMAT_CHAR: LOOP( signed char, float ); break; +- case VIPS_FORMAT_USHORT:LOOP( unsigned short, float ); break; +- case VIPS_FORMAT_SHORT: LOOP( signed short, float ); break; +- case VIPS_FORMAT_UINT: LOOP( unsigned int, float ); break; +- case VIPS_FORMAT_INT: LOOP( signed int, float ); break; +- case VIPS_FORMAT_FLOAT: LOOP( float, float ); break; +- case VIPS_FORMAT_DOUBLE:LOOP( double, double ); break; ++ if (vips_region_prepare(ir, & or->valid)) ++ return (-1); ++ ++ for (y = 0; y < or->valid.height; y++) { ++ VipsPel *in = VIPS_REGION_ADDR(ir, ++ or->valid.left, or->valid.top + y); ++ VipsPel *out = VIPS_REGION_ADDR(or, ++ or->valid.left, or->valid.top + y); ++ ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_UCHAR: ++ LOOP(unsigned char, float); ++ break; ++ case VIPS_FORMAT_CHAR: ++ LOOP(signed char, float); ++ break; ++ case VIPS_FORMAT_USHORT: ++ LOOP(unsigned short, float); ++ break; ++ case VIPS_FORMAT_SHORT: ++ LOOP(signed short, float); ++ break; ++ case VIPS_FORMAT_UINT: ++ LOOP(unsigned int, float); ++ break; ++ case VIPS_FORMAT_INT: ++ LOOP(signed int, float); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ LOOP(float, float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ LOOP(double, double); ++ break; + + default: + g_assert_not_reached(); + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_recomb_build( VipsObject *object ) ++vips_recomb_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsConversion *conversion = (VipsConversion *) object; + VipsRecomb *recomb = (VipsRecomb *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_recomb_parent_class )->build( object ) ) +- return( -1 ); +- +- in = recomb->in; +- +- if( vips_image_decode( in, &t[0] ) ) +- return( -1 ); +- in = t[0]; +- +- if( vips_check_noncomplex( class->nickname, in ) ) +- return( -1 ); +- if( vips_image_pio_input( recomb->m ) || +- vips_check_uncoded( class->nickname, recomb->m ) || +- vips_check_noncomplex( class->nickname, recomb->m ) || +- vips_check_mono( class->nickname, recomb->m ) ) +- return( -1 ); +- if( in->Bands != recomb->m->Xsize ) { +- vips_error( class->nickname, +- "%s", _( "bands in must equal matrix width" ) ); +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_recomb_parent_class)->build(object)) ++ return (-1); ++ ++ in = recomb->in; ++ ++ if (vips_image_decode(in, &t[0])) ++ return (-1); ++ in = t[0]; ++ ++ if (vips_check_noncomplex(class->nickname, in)) ++ return (-1); ++ if (vips_image_pio_input(recomb->m) || ++ vips_check_uncoded(class->nickname, recomb->m) || ++ vips_check_noncomplex(class->nickname, recomb->m) || ++ vips_check_mono(class->nickname, recomb->m)) ++ return (-1); ++ if (in->Bands != recomb->m->Xsize) { ++ vips_error(class->nickname, ++ "%s", _("bands in must equal matrix width")); ++ return (-1); + } + +- if( vips_check_matrix( class->nickname, recomb->m, &t[1] ) ) +- return( -1 ); +- recomb->coeff = t[1]; ++ if (vips_check_matrix(class->nickname, recomb->m, &t[1])) ++ return (-1); ++ recomb->coeff = t[1]; + +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, in, NULL)) ++ return (-1); + + conversion->out->Bands = recomb->m->Ysize; +- if( vips_band_format_isint( in->BandFmt ) ) ++ if (vips_band_format_isint(in->BandFmt)) + conversion->out->BandFmt = VIPS_FORMAT_FLOAT; + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_recomb_gen, vips_stop_one, +- in, recomb ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_recomb_gen, vips_stop_one, ++ in, recomb)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_recomb_class_init( VipsRecombClass *class ) ++vips_recomb_class_init(VipsRecombClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "recomb"; +- object_class->description = _( "linear recombination with matrix" ); ++ object_class->description = _("linear recombination with matrix"); + object_class->build = vips_recomb_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 0, +- _( "Input" ), +- _( "Input image argument" ), ++ VIPS_ARG_IMAGE(class, "in", 0, ++ _("Input"), ++ _("Input image argument"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsRecomb, in ) ); ++ G_STRUCT_OFFSET(VipsRecomb, in)); + +- VIPS_ARG_IMAGE( class, "m", 102, +- _( "M" ), +- _( "Matrix of coefficients" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsRecomb, m ) ); ++ VIPS_ARG_IMAGE(class, "m", 102, ++ _("M"), ++ _("Matrix of coefficients"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsRecomb, m)); + } + + static void +-vips_recomb_init( VipsRecomb *recomb ) ++vips_recomb_init(VipsRecomb *recomb) + { + } + +-/** ++/** + * vips_recomb: (method) + * @in: input image + * @out: (out): output image + * @m: recombination matrix + * @...: %NULL-terminated list of optional named arguments + * +- * This operation recombines an image's bands. Each pixel in @in is treated as ++ * This operation recombines an image's bands. Each pixel in @in is treated as + * an n-element vector, where n is the number of bands in @in, and multipled by + * the n x m matrix @m to produce the m-band image @out. + * +@@ -242,14 +259,14 @@ vips_recomb_init( VipsRecomb *recomb ) + * Returns: 0 on success, -1 on error + */ + int +-vips_recomb( VipsImage *in, VipsImage **out, VipsImage *m, ... ) ++vips_recomb(VipsImage *in, VipsImage **out, VipsImage *m, ...) + { + va_list ap; + int result; + +- va_start( ap, m ); +- result = vips_call_split( "recomb", ap, in, out, m ); +- va_end( ap ); ++ va_start(ap, m); ++ result = vips_call_split("recomb", ap, in, out, m); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/replicate.c b/libvips/conversion/replicate.c +index 1ad47b779e..249441b63d 100644 +--- a/libvips/conversion/replicate.c ++++ b/libvips/conversion/replicate.c +@@ -1,6 +1,6 @@ + /* replicate an image x times horizontally and vertically + * +- * JC, 30 sep 03 ++ * JC, 30 sep 03 + * + * 15/4/04 + * - some optimisations for some cases +@@ -12,28 +12,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -70,15 +70,15 @@ typedef struct _VipsReplicate { + + typedef VipsConversionClass VipsReplicateClass; + +-G_DEFINE_TYPE( VipsReplicate, vips_replicate, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsReplicate, vips_replicate, VIPS_TYPE_CONVERSION); + + static int +-vips_replicate_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++vips_replicate_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + VipsImage *in = (VipsImage *) a; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int twidth = in->Xsize; + int theight = in->Ysize; + +@@ -99,7 +99,7 @@ vips_replicate_gen( VipsRegion *or, void *seq, void *a, void *b, + + /* If the request fits inside a single tile, we can just pointer-copy. + */ +- if( vips_rect_includesrect( &tile, r ) ) { ++ if (vips_rect_includesrect(&tile, r)) { + VipsRect irect; + + /* Translate request to input space. +@@ -107,17 +107,17 @@ vips_replicate_gen( VipsRegion *or, void *seq, void *a, void *b, + irect = *r; + irect.left -= xs; + irect.top -= ys; +- if( vips_region_prepare( ir, &irect ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &irect)) ++ return (-1); + +- if( vips_region_region( or, ir, r, irect.left, irect.top ) ) +- return( -1 ); ++ if (vips_region_region(or, ir, r, irect.left, irect.top)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +- for( y = ys; y < VIPS_RECT_BOTTOM( r ); y += theight ) +- for( x = xs; x < VIPS_RECT_RIGHT( r ); x += twidth ) { ++ for (y = ys; y < VIPS_RECT_BOTTOM(r); y += theight) ++ for (x = xs; x < VIPS_RECT_RIGHT(r); x += twidth) { + VipsRect paint; + + /* Whole tile at x, y +@@ -130,92 +130,91 @@ vips_replicate_gen( VipsRegion *or, void *seq, void *a, void *b, + /* Which parts touch the area of the output we are + * building. + */ +- vips_rect_intersectrect( &tile, r, &paint ); ++ vips_rect_intersectrect(&tile, r, &paint); + + /* Translate back to ir coordinates. + */ + paint.left -= x; + paint.top -= y; + +- g_assert( !vips_rect_isempty( &paint ) ); ++ g_assert(!vips_rect_isempty(&paint)); + + /* Render into or. + */ +- if( vips_region_prepare_to( ir, or, &paint, +- paint.left + x, +- paint.top + y ) ) +- return( -1 ); ++ if (vips_region_prepare_to(ir, or, &paint, ++ paint.left + x, ++ paint.top + y)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_replicate_build( VipsObject *object ) ++vips_replicate_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsReplicate *replicate = (VipsReplicate *) object; + +- if( VIPS_OBJECT_CLASS( vips_replicate_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_replicate_parent_class)->build(object)) ++ return (-1); + +- if( vips_image_pio_input( replicate->in ) ) +- return( -1 ); ++ if (vips_image_pio_input(replicate->in)) ++ return (-1); + +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_SMALLTILE, replicate->in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_SMALLTILE, replicate->in, NULL)) ++ return (-1); + + conversion->out->Xsize *= replicate->across; + conversion->out->Ysize *= replicate->down; + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_replicate_gen, vips_stop_one, +- replicate->in, replicate ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_replicate_gen, vips_stop_one, ++ replicate->in, replicate)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_replicate_class_init( VipsReplicateClass *class ) ++vips_replicate_class_init(VipsReplicateClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_replicate_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_replicate_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "replicate"; +- vobject_class->description = _( "replicate an image" ); ++ vobject_class->description = _("replicate an image"); + vobject_class->build = vips_replicate_build; + +- VIPS_ARG_IMAGE( class, "in", 0, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 0, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsReplicate, in ) ); ++ G_STRUCT_OFFSET(VipsReplicate, in)); + +- VIPS_ARG_INT( class, "across", 4, +- _( "Across" ), +- _( "Repeat this many times horizontally" ), ++ VIPS_ARG_INT(class, "across", 4, ++ _("Across"), ++ _("Repeat this many times horizontally"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsReplicate, across ), +- 1, 1000000, 1 ); ++ G_STRUCT_OFFSET(VipsReplicate, across), ++ 1, 1000000, 1); + +- VIPS_ARG_INT( class, "down", 5, +- _( "Down" ), +- _( "Repeat this many times vertically" ), ++ VIPS_ARG_INT(class, "down", 5, ++ _("Down"), ++ _("Repeat this many times vertically"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsReplicate, down ), +- 1, 1000000, 1 ); +- ++ G_STRUCT_OFFSET(VipsReplicate, down), ++ 1, 1000000, 1); + } + + static void +-vips_replicate_init( VipsReplicate *replicate ) ++vips_replicate_init(VipsReplicate *replicate) + { + } + +@@ -234,14 +233,14 @@ vips_replicate_init( VipsReplicate *replicate ) + * Returns: 0 on success, -1 on error + */ + int +-vips_replicate( VipsImage *in, VipsImage **out, int across, int down, ... ) ++vips_replicate(VipsImage *in, VipsImage **out, int across, int down, ...) + { + va_list ap; + int result; + +- va_start( ap, down ); +- result = vips_call_split( "replicate", ap, in, out, across, down ); +- va_end( ap ); ++ va_start(ap, down); ++ result = vips_call_split("replicate", ap, in, out, across, down); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/rot.c b/libvips/conversion/rot.c +index b1e0b6bb6b..bdfb9dbf1f 100644 +--- a/libvips/conversion/rot.c ++++ b/libvips/conversion/rot.c +@@ -2,7 +2,7 @@ + * + * Copyright: 1991, N. Dessipris + * Written on: 28/10/91 +- * Updated on: 2/4/92, J.Cupitt ++ * Updated on: 2/4/92, J.Cupitt + * bugs in im_la90rot fixed, now works for any type. + * 19/7/93 JC + * - IM_CODING_LABQ allowed now +@@ -28,34 +28,34 @@ + * - rewrite as a class + * 7/3/17 + * - added 90/180/270 convenience functions +- * 10/11/22 alantudyk ++ * 10/11/22 alantudyk + * - swapped memcpy() in d180 for a loop + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -93,18 +93,18 @@ typedef struct _VipsRot { + + typedef VipsConversionClass VipsRotClass; + +-G_DEFINE_TYPE( VipsRot, vips_rot, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsRot, vips_rot, VIPS_TYPE_CONVERSION); + + static int +-vips_rot90_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++vips_rot90_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + VipsImage *in = (VipsImage *) a; + + /* Output area. + */ +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; + int ri = VIPS_RECT_RIGHT(r); + int to = r->top; +@@ -124,29 +124,29 @@ vips_rot90_gen( VipsRegion *or, void *seq, void *a, void *b, + need.top = in->Ysize - ri; + need.width = r->height; + need.height = r->width; +- if( vips_region_prepare( ir, &need ) ) +- return( -1 ); +- ++ if (vips_region_prepare(ir, &need)) ++ return (-1); ++ + /* Find PEL size and line skip for ir. + */ +- ps = VIPS_IMAGE_SIZEOF_PEL( in ); +- ls = VIPS_REGION_LSKIP( ir ); ++ ps = VIPS_IMAGE_SIZEOF_PEL(in); ++ ls = VIPS_REGION_LSKIP(ir); + + /* Rotate the bit we now have. + */ +- for( y = to; y < bo; y++ ) { ++ for (y = to; y < bo; y++) { + /* Start of this output line. + */ +- VipsPel *q = VIPS_REGION_ADDR( or, le, y ); ++ VipsPel *q = VIPS_REGION_ADDR(or, le, y); + + /* Corresponding position in ir. + */ +- VipsPel *p = VIPS_REGION_ADDR( ir, +- need.left + y - to, +- need.top + need.height - 1 ); ++ VipsPel *p = VIPS_REGION_ADDR(ir, ++ need.left + y - to, ++ need.top + need.height - 1); + +- for( x = le; x < ri; x++ ) { +- for( i = 0; i < ps; i++ ) ++ for (x = le; x < ri; x++) { ++ for (i = 0; i < ps; i++) + q[i] = p[i]; + + q += ps; +@@ -154,19 +154,19 @@ vips_rot90_gen( VipsRegion *or, void *seq, void *a, void *b, + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_rot180_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++vips_rot180_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + VipsImage *in = (VipsImage *) a; + + /* Output area. + */ +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; + int ri = VIPS_RECT_RIGHT(r); + int to = r->top; +@@ -186,30 +186,30 @@ vips_rot180_gen( VipsRegion *or, void *seq, void *a, void *b, + need.top = in->Ysize - bo; + need.width = r->width; + need.height = r->height; +- if( vips_region_prepare( ir, &need ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &need)) ++ return (-1); + + /* Find PEL size and line skip for ir. + */ +- ps = VIPS_IMAGE_SIZEOF_PEL( in ); ++ ps = VIPS_IMAGE_SIZEOF_PEL(in); + + /* Rotate the bit we now have. + */ +- for( y = to; y < bo; y++ ) { ++ for (y = to; y < bo; y++) { + /* Start of this output line. + */ +- VipsPel *q = VIPS_REGION_ADDR( or, le, y ); ++ VipsPel *q = VIPS_REGION_ADDR(or, le, y); + + /* Corresponding position in ir. + */ +- VipsPel *p = VIPS_REGION_ADDR( ir, +- need.left + need.width - 1, +- need.top + need.height - (y - to) - 1 ); ++ VipsPel *p = VIPS_REGION_ADDR(ir, ++ need.left + need.width - 1, ++ need.top + need.height - (y - to) - 1); + + /* Blap across! + */ +- for( x = le; x < ri; x++ ) { +- for( i = 0; i < ps; i++ ) ++ for (x = le; x < ri; x++) { ++ for (i = 0; i < ps; i++) + q[i] = p[i]; + + q += ps; +@@ -217,19 +217,19 @@ vips_rot180_gen( VipsRegion *or, void *seq, void *a, void *b, + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_rot270_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++vips_rot270_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + VipsImage *in = (VipsImage *) a; + + /* Output area. + */ +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; + int ri = VIPS_RECT_RIGHT(r); + int to = r->top; +@@ -249,29 +249,29 @@ vips_rot270_gen( VipsRegion *or, void *seq, void *a, void *b, + need.top = le; + need.width = r->height; + need.height = r->width; +- if( vips_region_prepare( ir, &need ) ) +- return( -1 ); +- ++ if (vips_region_prepare(ir, &need)) ++ return (-1); ++ + /* Find PEL size and line skip for ir. + */ +- ps = VIPS_IMAGE_SIZEOF_PEL( in ); +- ls = VIPS_REGION_LSKIP( ir ); ++ ps = VIPS_IMAGE_SIZEOF_PEL(in); ++ ls = VIPS_REGION_LSKIP(ir); + + /* Rotate the bit we now have. + */ +- for( y = to; y < bo; y++ ) { ++ for (y = to; y < bo; y++) { + /* Start of this output line. + */ +- VipsPel *q = VIPS_REGION_ADDR( or, le, y ); ++ VipsPel *q = VIPS_REGION_ADDR(or, le, y); + + /* Corresponding position in ir. + */ +- VipsPel *p = VIPS_REGION_ADDR( ir, ++ VipsPel *p = VIPS_REGION_ADDR(ir, + need.left + need.width - (y - to) - 1, +- need.top ); ++ need.top); + +- for( x = le; x < ri; x++ ) { +- for( i = 0; i < ps; i++ ) ++ for (x = le; x < ri; x++) { ++ for (i = 0; i < ps; i++) + q[i] = p[i]; + + q += ps; +@@ -279,35 +279,33 @@ vips_rot270_gen( VipsRegion *or, void *seq, void *a, void *b, + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_rot_build( VipsObject *object ) ++vips_rot_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsRot *rot = (VipsRot *) object; + + VipsGenerateFn generate_fn; + VipsDemandStyle hint; + +- if( VIPS_OBJECT_CLASS( vips_rot_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_rot_parent_class)->build(object)) ++ return (-1); + +- if( rot->angle == VIPS_ANGLE_D0 ) +- return( vips_image_write( rot->in, conversion->out ) ); ++ if (rot->angle == VIPS_ANGLE_D0) ++ return (vips_image_write(rot->in, conversion->out)); + +- if( vips_image_pio_input( rot->in ) ) +- return( -1 ); ++ if (vips_image_pio_input(rot->in)) ++ return (-1); + +- hint = rot->angle == VIPS_ANGLE_D180 ? +- VIPS_DEMAND_STYLE_THINSTRIP : +- VIPS_DEMAND_STYLE_SMALLTILE; ++ hint = rot->angle == VIPS_ANGLE_D180 ? VIPS_DEMAND_STYLE_THINSTRIP : VIPS_DEMAND_STYLE_SMALLTILE; + +- if( vips_image_pipelinev( conversion->out, hint, rot->in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, hint, rot->in, NULL)) ++ return (-1); + +- switch( rot->angle ) { ++ switch (rot->angle) { + case VIPS_ANGLE_D90: + generate_fn = vips_rot90_gen; + conversion->out->Xsize = rot->in->Ysize; +@@ -338,52 +336,52 @@ vips_rot_build( VipsObject *object ) + generate_fn = NULL; + } + +- if( vips_image_generate( conversion->out, +- vips_start_one, generate_fn, vips_stop_one, +- rot->in, rot ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, generate_fn, vips_stop_one, ++ rot->in, rot)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_rot_class_init( VipsRotClass *class ) ++vips_rot_class_init(VipsRotClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_rot_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_rot_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "rot"; +- vobject_class->description = _( "rotate an image" ); ++ vobject_class->description = _("rotate an image"); + vobject_class->build = vips_rot_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsRot, in ) ); ++ G_STRUCT_OFFSET(VipsRot, in)); + +- VIPS_ARG_ENUM( class, "angle", 6, +- _( "Angle" ), +- _( "Angle to rotate image" ), ++ VIPS_ARG_ENUM(class, "angle", 6, ++ _("Angle"), ++ _("Angle to rotate image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsRot, angle ), +- VIPS_TYPE_ANGLE, VIPS_ANGLE_D90 ); ++ G_STRUCT_OFFSET(VipsRot, angle), ++ VIPS_TYPE_ANGLE, VIPS_ANGLE_D90); + } + + static void +-vips_rot_init( VipsRot *rot ) ++vips_rot_init(VipsRot *rot) + { + } + + static int +-vips_rotv( VipsImage *in, VipsImage **out, VipsAngle angle, va_list ap ) ++vips_rotv(VipsImage *in, VipsImage **out, VipsAngle angle, va_list ap) + { +- return( vips_call_split( "rot", ap, in, out, angle ) ); ++ return (vips_call_split("rot", ap, in, out, angle)); + } + + /** +@@ -395,24 +393,24 @@ vips_rotv( VipsImage *in, VipsImage **out, VipsAngle angle, va_list ap ) + * + * Rotate @in by a multiple of 90 degrees. + * +- * Use vips_similarity() to rotate by an arbitary angle. vips_rot45() is +- * useful for rotating convolution masks by 45 degrees. ++ * Use vips_similarity() to rotate by an arbitary angle. vips_rot45() is ++ * useful for rotating convolution masks by 45 degrees. + * + * See also: vips_flip(), vips_similarity(), vips_rot45(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_rot( VipsImage *in, VipsImage **out, VipsAngle angle, ... ) ++vips_rot(VipsImage *in, VipsImage **out, VipsAngle angle, ...) + { + va_list ap; + int result; + +- va_start( ap, angle ); +- result = vips_rotv( in, out, angle, ap ); +- va_end( ap ); ++ va_start(ap, angle); ++ result = vips_rotv(in, out, angle, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -428,16 +426,16 @@ vips_rot( VipsImage *in, VipsImage **out, VipsAngle angle, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_rot90( VipsImage *in, VipsImage **out, ... ) ++vips_rot90(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_rotv( in, out, VIPS_ANGLE_D90, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_rotv(in, out, VIPS_ANGLE_D90, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -453,16 +451,16 @@ vips_rot90( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_rot180( VipsImage *in, VipsImage **out, ... ) ++vips_rot180(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_rotv( in, out, VIPS_ANGLE_D180, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_rotv(in, out, VIPS_ANGLE_D180, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -478,14 +476,14 @@ vips_rot180( VipsImage *in, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error + */ + int +-vips_rot270( VipsImage *in, VipsImage **out, ... ) ++vips_rot270(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_rotv( in, out, VIPS_ANGLE_D270, ap ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_rotv(in, out, VIPS_ANGLE_D270, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/rot45.c b/libvips/conversion/rot45.c +index 42d581ed3a..d5df3115e0 100644 +--- a/libvips/conversion/rot45.c ++++ b/libvips/conversion/rot45.c +@@ -13,33 +13,33 @@ + * 1/12/10 + * - allow any size mask for the 90 degree rot45ates by using im_rot4590(). + * 12/10/13 +- * - rewritten as a class ++ * - rewritten as a class + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -77,43 +77,44 @@ typedef struct _VipsRot45 { + + typedef VipsConversionClass VipsRot45Class; + +-G_DEFINE_TYPE( VipsRot45, vips_rot45, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsRot45, vips_rot45, VIPS_TYPE_CONVERSION); + +-#define COPY( Q, P ) { \ +- VipsPel *q = (Q); \ +- VipsPel *p = (P); \ +- int b;\ +- \ +- for( b = 0; b < ps; b++ )\ +- q[b] = p[b];\ +-} ++#define COPY(Q, P) \ ++ { \ ++ VipsPel *q = (Q); \ ++ VipsPel *p = (P); \ ++ int b; \ ++\ ++ for (b = 0; b < ps; b++) \ ++ q[b] = p[b]; \ ++ } + +-#define ASSIGN( Xout, Yout, Xin, Yin ) \ +- COPY( VIPS_IMAGE_ADDR( out, Xout, Yout ), \ +- VIPS_IMAGE_ADDR( in, Xin, Yin ) ) ++#define ASSIGN(Xout, Yout, Xin, Yin) \ ++ COPY(VIPS_IMAGE_ADDR(out, Xout, Yout), \ ++ VIPS_IMAGE_ADDR(in, Xin, Yin)) + +-#define POINT_TO_TEMP( q, Xin, Yin ) \ +- COPY( q, VIPS_IMAGE_ADDR( in, Xin, Yin ) ) ++#define POINT_TO_TEMP(q, Xin, Yin) \ ++ COPY(q, VIPS_IMAGE_ADDR(in, Xin, Yin)) + +-#define TEMP_TO_POINT( Xout, Yout, p ) \ +- COPY( VIPS_IMAGE_ADDR( out, Xout, Yout ), p ) ++#define TEMP_TO_POINT(Xout, Yout, p) \ ++ COPY(VIPS_IMAGE_ADDR(out, Xout, Yout), p) + + /* This can work inplace, ie. in == out is allowed. + */ + static void +-vips_rot45_rot45( VipsImage *out, VipsImage *in ) ++vips_rot45_rot45(VipsImage *out, VipsImage *in) + { +- size_t ps = VIPS_IMAGE_SIZEOF_PEL( in ); +- VipsPel *temp = VIPS_ARRAY( in, ps, VipsPel ); +- int size = in->Xsize; ++ size_t ps = VIPS_IMAGE_SIZEOF_PEL(in); ++ VipsPel *temp = VIPS_ARRAY(in, ps, VipsPel); ++ int size = in->Xsize; + int size_2 = size / 2; + + int x, y; + +- g_assert( in->Xsize == in->Ysize ); +- g_assert( out->Xsize == out->Ysize ); +- g_assert( in->Xsize == out->Xsize ); +- g_assert( in->Xsize % 2 == 1 ); ++ g_assert(in->Xsize == in->Ysize); ++ g_assert(out->Xsize == out->Ysize); ++ g_assert(in->Xsize == out->Xsize); ++ g_assert(in->Xsize % 2 == 1); + + /* Split the square into 8 triangles. Loop over the top-left one, + * reflect to index the others. +@@ -122,119 +123,119 @@ vips_rot45_rot45( VipsImage *out, VipsImage *in ) + * 8 1 2 3 3 + * 8 8 x 4 4 + * 7 7 6 5 4 +- * 7 6 6 5 5 ++ * 7 6 6 5 5 + * + * do the centre separately. + */ + +- for( y = 0; y < size_2; y++ ) +- for( x = y; x < size_2; x++ ) { ++ for (y = 0; y < size_2; y++) ++ for (x = y; x < size_2; x++) { + /* Save 1, it goes into 2 at the end. + */ +- POINT_TO_TEMP( temp, x, y ); ++ POINT_TO_TEMP(temp, x, y); + + /* Fill 1 from 8. + */ +- ASSIGN( x, y, +- y, size_2 - (x - y) ); ++ ASSIGN(x, y, ++ y, size_2 - (x - y)); + + /* 8 from 7. + */ +- ASSIGN( y, size_2 - (x - y), +- y, (size - 1) - x ); ++ ASSIGN(y, size_2 - (x - y), ++ y, (size - 1) - x); + + /* 7 from 6. + */ +- ASSIGN( y, (size - 1) - x, +- size_2 - (x - y), (size - 1) - y ); ++ ASSIGN(y, (size - 1) - x, ++ size_2 - (x - y), (size - 1) - y); + + /* 6 from 5. + */ +- ASSIGN( size_2 - (x - y), (size - 1) - y, +- (size - 1) - x, (size - 1) - y ); ++ ASSIGN(size_2 - (x - y), (size - 1) - y, ++ (size - 1) - x, (size - 1) - y); + +- /* 5 from 4. ++ /* 5 from 4. + */ +- ASSIGN( (size - 1) - x, (size - 1) - y, +- (size - 1) - y, (x - y) + size_2 ); ++ ASSIGN((size - 1) - x, (size - 1) - y, ++ (size - 1) - y, (x - y) + size_2); + +- /* 4 from 3. ++ /* 4 from 3. + */ +- ASSIGN( (size - 1) - y, (x - y) + size_2, +- (size - 1) - y, x ); ++ ASSIGN((size - 1) - y, (x - y) + size_2, ++ (size - 1) - y, x); + + /* 3 from 2. + */ +- ASSIGN( (size - 1) - y, x, +- (x - y) + size_2, y ); ++ ASSIGN((size - 1) - y, x, ++ (x - y) + size_2, y); + +- /* 2 from saved 1. ++ /* 2 from saved 1. + */ +- TEMP_TO_POINT( (x - y) + size_2, y, temp ); ++ TEMP_TO_POINT((x - y) + size_2, y, temp); + } + + /* Centre. + */ +- ASSIGN( size_2, size_2, size_2, size_2 ); ++ ASSIGN(size_2, size_2, size_2, size_2); + } + + static int +-vips_rot45_build( VipsObject *object ) ++vips_rot45_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsRot45 *rot45 = (VipsRot45 *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_rot45_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_rot45_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_oddsquare( class->nickname, rot45->in ) ) +- return( -1 ); ++ if (vips_check_oddsquare(class->nickname, rot45->in)) ++ return (-1); + +- if( rot45->angle == VIPS_ANGLE45_D0 ) +- return( vips_image_write( rot45->in, conversion->out ) ); ++ if (rot45->angle == VIPS_ANGLE45_D0) ++ return (vips_image_write(rot45->in, conversion->out)); + +- if( !(t[1] = vips_image_copy_memory( rot45->in )) ) +- return( -1 ); ++ if (!(t[1] = vips_image_copy_memory(rot45->in))) ++ return (-1); + in = t[1]; + + t[0] = vips_image_new_memory(); +- if( vips_image_pipelinev( t[0], +- VIPS_DEMAND_STYLE_ANY, rot45->in, NULL ) ) +- return( -1 ); +- if( vips_image_write_prepare( t[0] ) ) +- return( -1 ); ++ if (vips_image_pipelinev(t[0], ++ VIPS_DEMAND_STYLE_ANY, rot45->in, NULL)) ++ return (-1); ++ if (vips_image_write_prepare(t[0])) ++ return (-1); + +- switch( rot45->angle ) { ++ switch (rot45->angle) { + case VIPS_ANGLE45_D315: +- vips_rot45_rot45( t[0], in ); ++ vips_rot45_rot45(t[0], in); + in = t[0]; +- ++ + case VIPS_ANGLE45_D270: +- vips_rot45_rot45( t[0], in ); ++ vips_rot45_rot45(t[0], in); + in = t[0]; + + case VIPS_ANGLE45_D225: +- vips_rot45_rot45( t[0], in ); ++ vips_rot45_rot45(t[0], in); + in = t[0]; + + case VIPS_ANGLE45_D180: +- vips_rot45_rot45( t[0], in ); ++ vips_rot45_rot45(t[0], in); + in = t[0]; + + case VIPS_ANGLE45_D135: +- vips_rot45_rot45( t[0], in ); ++ vips_rot45_rot45(t[0], in); + in = t[0]; + + case VIPS_ANGLE45_D90: +- vips_rot45_rot45( t[0], in ); ++ vips_rot45_rot45(t[0], in); + in = t[0]; + + case VIPS_ANGLE45_D45: +- vips_rot45_rot45( t[0], in ); ++ vips_rot45_rot45(t[0], in); + in = t[0]; + break; + +@@ -242,43 +243,43 @@ vips_rot45_build( VipsObject *object ) + g_assert_not_reached(); + } + +- if( vips_image_write( in, conversion->out ) ) +- return( -1 ); ++ if (vips_image_write(in, conversion->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_rot45_class_init( VipsRot45Class *class ) ++vips_rot45_class_init(VipsRot45Class *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_rot45_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_rot45_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "rot45"; +- vobject_class->description = _( "rotate an image" ); ++ vobject_class->description = _("rotate an image"); + vobject_class->build = vips_rot45_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsRot45, in ) ); ++ G_STRUCT_OFFSET(VipsRot45, in)); + +- VIPS_ARG_ENUM( class, "angle", 6, +- _( "Angle" ), +- _( "Angle to rotate image" ), ++ VIPS_ARG_ENUM(class, "angle", 6, ++ _("Angle"), ++ _("Angle to rotate image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsRot45, angle ), +- VIPS_TYPE_ANGLE45, VIPS_ANGLE45_D45 ); ++ G_STRUCT_OFFSET(VipsRot45, angle), ++ VIPS_TYPE_ANGLE45, VIPS_ANGLE45_D45); + } + + static void +-vips_rot45_init( VipsRot45 *rot45 ) ++vips_rot45_init(VipsRot45 *rot45) + { + rot45->angle = VIPS_ANGLE45_D45; + } +@@ -294,24 +295,24 @@ vips_rot45_init( VipsRot45 *rot45 ) + * * @angle: #VipsAngle45 rotation angle + * + * Rotate @in by a multiple of 45 degrees. Odd-length sides and square images +- * only. ++ * only. + * + * This operation is useful for rotating convolution masks. Use +- * vips_similarity() to rotate images by arbitrary angles. ++ * vips_similarity() to rotate images by arbitrary angles. + * + * See also: vips_rot(), vips_similarity(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_rot45( VipsImage *in, VipsImage **out, ... ) ++vips_rot45(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "rot45", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("rot45", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/scale.c b/libvips/conversion/scale.c +index 5bc3c75eaf..8cd30756ef 100644 +--- a/libvips/conversion/scale.c ++++ b/libvips/conversion/scale.c +@@ -2,7 +2,7 @@ + * + * Author: John Cupitt + * Written on: 22/4/93 +- * Modified on: ++ * Modified on: + * 30/6/93 JC + * - adapted for partial v2 + * - ANSI +@@ -22,34 +22,34 @@ + * - use linear uchar mode + * 14/7/14 + * - round to nearest on uchar output +- * 29/12/18 kleisauke +- * - ... and round to nearest in log mode too ++ * 29/12/18 kleisauke ++ * - ... and round to nearest in log mode too + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -78,48 +78,48 @@ typedef struct _VipsScale { + + typedef VipsConversionClass VipsScaleClass; + +-G_DEFINE_TYPE( VipsScale, vips_scale, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsScale, vips_scale, VIPS_TYPE_CONVERSION); + + static int +-vips_scale_build( VipsObject *object ) ++vips_scale_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsScale *scale = (VipsScale *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 7 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 7); + + double mx; + double mn; + +- if( VIPS_OBJECT_CLASS( vips_scale_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_scale_parent_class)->build(object)) ++ return (-1); + +- if( vips_stats( scale->in, &t[0], NULL ) ) +- return( -1 ); +- mn = *VIPS_MATRIX( t[0], 0, 0 ); +- mx = *VIPS_MATRIX( t[0], 1, 0 ); ++ if (vips_stats(scale->in, &t[0], NULL)) ++ return (-1); ++ mn = *VIPS_MATRIX(t[0], 0, 0); ++ mx = *VIPS_MATRIX(t[0], 1, 0); + +- if( mn == mx ) { ++ if (mn == mx) { + /* Range of zero: just return black. + */ +- if( vips_black( &t[1], scale->in->Xsize, scale->in->Ysize, +- "bands", scale->in->Bands, +- NULL ) || +- vips_image_write( t[1], conversion->out ) ) +- return( -1 ); ++ if (vips_black(&t[1], scale->in->Xsize, scale->in->Ysize, ++ "bands", scale->in->Bands, ++ NULL) || ++ vips_image_write(t[1], conversion->out)) ++ return (-1); + } +- else if( scale->log ) { +- double f = 255.0 / log10( 1.0 + pow( mx, scale->exp ) ); ++ else if (scale->log) { ++ double f = 255.0 / log10(1.0 + pow(mx, scale->exp)); + +- if( vips_pow_const1( scale->in, &t[2], scale->exp, NULL ) || +- vips_linear1( t[2], &t[3], 1.0, 1.0, NULL ) || +- vips_log10( t[3], &t[4], NULL ) || ++ if (vips_pow_const1(scale->in, &t[2], scale->exp, NULL) || ++ vips_linear1(t[2], &t[3], 1.0, 1.0, NULL) || ++ vips_log10(t[3], &t[4], NULL) || + /* Add 0.5 to get round to nearest. + */ +- vips_linear1( t[4], &t[5], f, 0.5, +- "uchar", TRUE, +- NULL ) || +- vips_image_write( t[5], conversion->out ) ) +- return( -1 ); ++ vips_linear1(t[4], &t[5], f, 0.5, ++ "uchar", TRUE, ++ NULL) || ++ vips_image_write(t[5], conversion->out)) ++ return (-1); + } + else { + double f = 255.0 / (mx - mn); +@@ -128,53 +128,52 @@ vips_scale_build( VipsObject *object ) + */ + double a = -(mn * f) + 0.5; + +- if( vips_linear1( scale->in, &t[2], f, a, +- "uchar", TRUE, +- NULL ) || +- vips_image_write( t[2], conversion->out ) ) +- return( -1 ); ++ if (vips_linear1(scale->in, &t[2], f, a, ++ "uchar", TRUE, ++ NULL) || ++ vips_image_write(t[2], conversion->out)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_scale_class_init( VipsScaleClass *class ) ++vips_scale_class_init(VipsScaleClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "scale"; +- vobject_class->description = _( "scale an image to uchar" ); ++ vobject_class->description = _("scale an image to uchar"); + vobject_class->build = vips_scale_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsScale, in ) ); ++ G_STRUCT_OFFSET(VipsScale, in)); + +- VIPS_ARG_BOOL( class, "log", 3, +- _( "Log" ), +- _( "Log scale" ), ++ VIPS_ARG_BOOL(class, "log", 3, ++ _("Log"), ++ _("Log scale"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsScale, log ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsScale, log), ++ FALSE); + +- VIPS_ARG_DOUBLE( class, "exp", 3, +- _( "Exponent" ), +- _( "Exponent for log scale" ), ++ VIPS_ARG_DOUBLE(class, "exp", 3, ++ _("Exponent"), ++ _("Exponent for log scale"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsScale, exp ), +- 0.00001, 10000, 0.25 ); +- ++ G_STRUCT_OFFSET(VipsScale, exp), ++ 0.00001, 10000, 0.25); + } + + static void +-vips_scale_init( VipsScale *scale ) ++vips_scale_init(VipsScale *scale) + { + scale->exp = 0.25; + } +@@ -194,7 +193,7 @@ vips_scale_init( VipsScale *scale ) + * as unsigned 8-bit, scaled so that the maximum value is 255 and the + * minimum is zero. + * +- * If @log is set, transform with log10(1.0 + pow(x, @exp)) + .5, ++ * If @log is set, transform with log10(1.0 + pow(x, @exp)) + .5, + * then scale so max == 255. By default, @exp is 0.25. + * + * See also: vips_cast(). +@@ -202,14 +201,14 @@ vips_scale_init( VipsScale *scale ) + * Returns: 0 on success, -1 on error + */ + int +-vips_scale( VipsImage *in, VipsImage **out, ... ) ++vips_scale(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "scale", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("scale", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/sequential.c b/libvips/conversion/sequential.c +index 01e5b747e1..65c768c560 100644 +--- a/libvips/conversion/sequential.c ++++ b/libvips/conversion/sequential.c +@@ -1,7 +1,7 @@ +-/* Like copy, but ensure sequential access. ++/* Like copy, but ensure sequential access. + * + * Handy with sequential for loading files formats which are strictly +- * top-to-bottom, like PNG. ++ * top-to-bottom, like PNG. + * + * 15/2/12 + * - from VipsForeignLoad +@@ -29,28 +29,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a cache of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a cache of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -99,100 +99,100 @@ typedef struct _VipsSequential { + + typedef VipsConversionClass VipsSequentialClass; + +-G_DEFINE_TYPE( VipsSequential, vips_sequential, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsSequential, vips_sequential, VIPS_TYPE_CONVERSION); + + static void +-vips_sequential_dispose( GObject *gobject ) ++vips_sequential_dispose(GObject *gobject) + { + VipsSequential *sequential = (VipsSequential *) gobject; + +- VIPS_FREEF( vips_g_mutex_free, sequential->lock ); ++ VIPS_FREEF(vips_g_mutex_free, sequential->lock); + +- G_OBJECT_CLASS( vips_sequential_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_sequential_parent_class)->dispose(gobject); + } + + static int +-vips_sequential_generate( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_sequential_generate(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsSequential *sequential = (VipsSequential *) b; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsRegion *ir = (VipsRegion *) seq; + +- if( sequential->trace ) +- printf( "vips_sequential_generate %p: " +- "request for line %d, height %d\n", +- sequential, r->top, r->height ); ++ if (sequential->trace) ++ printf("vips_sequential_generate %p: " ++ "request for line %d, height %d\n", ++ sequential, r->top, r->height); + +- VIPS_GATE_START( "vips_sequential_generate: wait" ); ++ VIPS_GATE_START("vips_sequential_generate: wait"); + +- vips__worker_lock( sequential->lock ); ++ vips__worker_lock(sequential->lock); + +- VIPS_GATE_STOP( "vips_sequential_generate: wait" ); ++ VIPS_GATE_STOP("vips_sequential_generate: wait"); + + /* If we've seen an error, everything must stop. + */ +- if( sequential->error ) { +- g_mutex_unlock( sequential->lock ); +- return( -1 ); ++ if (sequential->error) { ++ g_mutex_unlock(sequential->lock); ++ return (-1); + } + +- if( r->top > sequential->y_pos ) { +- /* This is a request for something some way down the image. +- * Probably the operation is something like extract_area and +- * we should skip the initial part of the image. In fact, ++ if (r->top > sequential->y_pos) { ++ /* This is a request for something some way down the image. ++ * Probably the operation is something like extract_area and ++ * we should skip the initial part of the image. In fact, + * we read to cache, since it may be useful. + */ + VipsRect area; + +- if( sequential->trace ) +- printf( "vips_sequential_generate %p: " +- "skipping to line %d ...\n", +- sequential, r->top ); ++ if (sequential->trace) ++ printf("vips_sequential_generate %p: " ++ "skipping to line %d ...\n", ++ sequential, r->top); + + area.left = 0; + area.top = sequential->y_pos; + area.width = 1; + area.height = r->top - sequential->y_pos; +- if( vips_region_prepare( ir, &area ) ) { ++ if (vips_region_prepare(ir, &area)) { + sequential->error = -1; +- g_mutex_unlock( sequential->lock ); +- return( -1 ); ++ g_mutex_unlock(sequential->lock); ++ return (-1); + } + +- sequential->y_pos = VIPS_RECT_BOTTOM( &area ); ++ sequential->y_pos = VIPS_RECT_BOTTOM(&area); + } + + /* This is a request for old or present pixels -- serve from cache. + * This may trigger further, sequential reads. + */ +- if( vips_region_prepare( ir, r ) || +- vips_region_region( or, ir, r, r->left, r->top ) ) { ++ if (vips_region_prepare(ir, r) || ++ vips_region_region(or, ir, r, r->left, r->top)) { + sequential->error = -1; +- g_mutex_unlock( sequential->lock ); +- return( -1 ); ++ g_mutex_unlock(sequential->lock); ++ return (-1); + } + +- sequential->y_pos = +- VIPS_MAX( sequential->y_pos, VIPS_RECT_BOTTOM( r ) ); ++ sequential->y_pos = ++ VIPS_MAX(sequential->y_pos, VIPS_RECT_BOTTOM(r)); + +- g_mutex_unlock( sequential->lock ); ++ g_mutex_unlock(sequential->lock); + +- return( 0 ); ++ return (0); + } + + static int +-vips_sequential_build( VipsObject *object ) ++vips_sequential_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsSequential *sequential = (VipsSequential *) object; + + VipsImage *t; + +- VIPS_DEBUG_MSG( "vips_sequential_build\n" ); ++ VIPS_DEBUG_MSG("vips_sequential_build\n"); + +- if( VIPS_OBJECT_CLASS( vips_sequential_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_sequential_parent_class)->build(object)) ++ return (-1); + + /* We've gone forwards and backwards on sequential caches being + * persistent. Persistent caches can be useful if you want to eg. +@@ -202,72 +202,71 @@ vips_sequential_build( VipsObject *object ) + * On balance, if you want to make many crops from one source, use a + * RANDOM image. + */ +- if( vips_linecache( sequential->in, &t, +- "tile_height", sequential->tile_height, +- "access", VIPS_ACCESS_SEQUENTIAL, +- NULL ) ) +- return( -1 ); +- +- vips_object_local( object, t ); +- +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, t, NULL ) ) +- return( -1 ); +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_sequential_generate, vips_stop_one, +- t, sequential ) ) +- return( -1 ); +- +- return( 0 ); ++ if (vips_linecache(sequential->in, &t, ++ "tile_height", sequential->tile_height, ++ "access", VIPS_ACCESS_SEQUENTIAL, ++ NULL)) ++ return (-1); ++ ++ vips_object_local(object, t); ++ ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, t, NULL)) ++ return (-1); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_sequential_generate, vips_stop_one, ++ t, sequential)) ++ return (-1); ++ ++ return (0); + } + + static void +-vips_sequential_class_init( VipsSequentialClass *class ) ++vips_sequential_class_init(VipsSequentialClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_sequential_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_sequential_class_init\n"); + + gobject_class->dispose = vips_sequential_dispose; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "sequential"; +- vobject_class->description = _( "check sequential access" ); ++ vobject_class->description = _("check sequential access"); + vobject_class->build = vips_sequential_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsSequential, in ) ); ++ G_STRUCT_OFFSET(VipsSequential, in)); + +- VIPS_ARG_INT( class, "tile_height", 3, +- _( "Tile height" ), +- _( "Tile height in pixels" ), ++ VIPS_ARG_INT(class, "tile_height", 3, ++ _("Tile height"), ++ _("Tile height in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSequential, tile_height ), +- 1, 1000000, 1 ); ++ G_STRUCT_OFFSET(VipsSequential, tile_height), ++ 1, 1000000, 1); + +- VIPS_ARG_ENUM( class, "access", 6, +- _( "Strategy" ), +- _( "Expected access pattern" ), ++ VIPS_ARG_ENUM(class, "access", 6, ++ _("Strategy"), ++ _("Expected access pattern"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsSequential, access ), +- VIPS_TYPE_ACCESS, VIPS_ACCESS_SEQUENTIAL ); ++ G_STRUCT_OFFSET(VipsSequential, access), ++ VIPS_TYPE_ACCESS, VIPS_ACCESS_SEQUENTIAL); + +- VIPS_ARG_BOOL( class, "trace", 2, +- _( "Trace" ), +- _( "Trace pixel requests" ), ++ VIPS_ARG_BOOL(class, "trace", 2, ++ _("Trace"), ++ _("Trace pixel requests"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsSequential, trace ), +- TRUE ); +- ++ G_STRUCT_OFFSET(VipsSequential, trace), ++ TRUE); + } + + static void +-vips_sequential_init( VipsSequential *sequential ) ++vips_sequential_init(VipsSequential *sequential) + { + sequential->lock = vips_g_mutex_new(); + sequential->tile_height = 1; +@@ -287,8 +286,8 @@ vips_sequential_init( VipsSequential *sequential ) + * + * This operation behaves rather like vips_copy() between images + * @in and @out, except that it checks that pixels on @in are only requested +- * top-to-bottom. This operation is useful for loading file formats which are +- * strictly top-to-bottom, like PNG. ++ * top-to-bottom. This operation is useful for loading file formats which are ++ * strictly top-to-bottom, like PNG. + * + * @strip_height can be used to set the size of the tiles that + * vips_sequential() uses. The default value is 1. +@@ -298,14 +297,14 @@ vips_sequential_init( VipsSequential *sequential ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_sequential( VipsImage *in, VipsImage **out, ... ) ++vips_sequential(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "sequential", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("sequential", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/smartcrop.c b/libvips/conversion/smartcrop.c +index ab9283201b..702528cd88 100644 +--- a/libvips/conversion/smartcrop.c ++++ b/libvips/conversion/smartcrop.c +@@ -18,28 +18,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -75,29 +75,29 @@ typedef struct _VipsSmartcrop { + + typedef VipsConversionClass VipsSmartcropClass; + +-G_DEFINE_TYPE( VipsSmartcrop, vips_smartcrop, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsSmartcrop, vips_smartcrop, VIPS_TYPE_CONVERSION); + + static int +-vips_smartcrop_score( VipsSmartcrop *smartcrop, VipsImage *in, +- int left, int top, int width, int height, double *score ) ++vips_smartcrop_score(VipsSmartcrop *smartcrop, VipsImage *in, ++ int left, int top, int width, int height, double *score) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( smartcrop ), 2 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(smartcrop), 2); + +- if( vips_extract_area( in, &t[0], left, top, width, height, NULL ) || +- vips_hist_find( t[0], &t[1], NULL ) || +- vips_hist_entropy( t[1], score, NULL ) ) +- return( -1 ); ++ if (vips_extract_area(in, &t[0], left, top, width, height, NULL) || ++ vips_hist_find(t[0], &t[1], NULL) || ++ vips_hist_entropy(t[1], score, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Entropy-style smartcrop. Repeatedly discard low interest areas. This should +- * be faster for very large images. ++ * be faster for very large images. + */ + static int +-vips_smartcrop_entropy( VipsSmartcrop *smartcrop, +- VipsImage *in, int *left, int *top ) ++vips_smartcrop_entropy(VipsSmartcrop *smartcrop, ++ VipsImage *in, int *left, int *top) + { + int max_slice_size; + int width; +@@ -111,99 +111,99 @@ vips_smartcrop_entropy( VipsSmartcrop *smartcrop, + /* How much do we trim by each iteration? Aim for 8 steps in the axis + * that needs trimming most. + */ +- max_slice_size = VIPS_MAX( +- ceil( (width - smartcrop->width) / 8.0 ), +- ceil( (height - smartcrop->height) / 8.0 ) ); ++ max_slice_size = VIPS_MAX( ++ ceil((width - smartcrop->width) / 8.0), ++ ceil((height - smartcrop->height) / 8.0)); + +- /* Repeatedly take a slice off width and height until we ++ /* Repeatedly take a slice off width and height until we + * reach the target. + */ +- while( width > smartcrop->width || +- height > smartcrop->height ) { +- const int slice_width = +- VIPS_MIN( width - smartcrop->width, max_slice_size ); +- const int slice_height = +- VIPS_MIN( height - smartcrop->height, max_slice_size ); +- +- if( slice_width > 0 ) { ++ while (width > smartcrop->width || ++ height > smartcrop->height) { ++ const int slice_width = ++ VIPS_MIN(width - smartcrop->width, max_slice_size); ++ const int slice_height = ++ VIPS_MIN(height - smartcrop->height, max_slice_size); ++ ++ if (slice_width > 0) { + double left_score; + double right_score; + +- if( vips_smartcrop_score( smartcrop, in, +- *left, *top, +- slice_width, height, &left_score ) ) +- return( -1 ); ++ if (vips_smartcrop_score(smartcrop, in, ++ *left, *top, ++ slice_width, height, &left_score)) ++ return (-1); + +- if( vips_smartcrop_score( smartcrop, in, +- *left + width - slice_width, *top, +- slice_width, height, &right_score ) ) +- return( -1 ); ++ if (vips_smartcrop_score(smartcrop, in, ++ *left + width - slice_width, *top, ++ slice_width, height, &right_score)) ++ return (-1); + + width -= slice_width; +- if( left_score < right_score ) ++ if (left_score < right_score) + *left += slice_width; + } + +- if( slice_height > 0 ) { ++ if (slice_height > 0) { + double top_score; + double bottom_score; + +- if( vips_smartcrop_score( smartcrop, in, +- *left, *top, +- width, slice_height, &top_score ) ) +- return( -1 ); ++ if (vips_smartcrop_score(smartcrop, in, ++ *left, *top, ++ width, slice_height, &top_score)) ++ return (-1); + +- if( vips_smartcrop_score( smartcrop, in, +- *left, *top + height - slice_height, +- width, slice_height, &bottom_score ) ) +- return( -1 ); ++ if (vips_smartcrop_score(smartcrop, in, ++ *left, *top + height - slice_height, ++ width, slice_height, &bottom_score)) ++ return (-1); + + height -= slice_height; +- if( top_score < bottom_score ) ++ if (top_score < bottom_score) + *top += slice_height; + } + } + +- return( 0 ); ++ return (0); + } + + /* Calculate sqrt(b1^2 + b2^2 ...) + */ + static int +-pythagoras( VipsSmartcrop *smartcrop, VipsImage *in, VipsImage **out ) ++pythagoras(VipsSmartcrop *smartcrop, VipsImage *in, VipsImage **out) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( smartcrop ), +- 2 * in->Bands + 1 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(smartcrop), ++ 2 * in->Bands + 1); + + int i; + +- for( i = 0; i < in->Bands; i++ ) +- if( vips_extract_band( in, &t[i], i, NULL ) ) +- return( -1 ); ++ for (i = 0; i < in->Bands; i++) ++ if (vips_extract_band(in, &t[i], i, NULL)) ++ return (-1); + +- for( i = 0; i < in->Bands; i++ ) +- if( vips_multiply( t[i], t[i], &t[i + in->Bands], NULL ) ) +- return( -1 ); ++ for (i = 0; i < in->Bands; i++) ++ if (vips_multiply(t[i], t[i], &t[i + in->Bands], NULL)) ++ return (-1); + +- if( vips_sum( &t[in->Bands], &t[2 * in->Bands], in->Bands, NULL ) || +- vips_pow_const1( t[2 * in->Bands], out, 0.5, NULL ) ) +- return( -1 ); ++ if (vips_sum(&t[in->Bands], &t[2 * in->Bands], in->Bands, NULL) || ++ vips_pow_const1(t[2 * in->Bands], out, 0.5, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_smartcrop_attention( VipsSmartcrop *smartcrop, +- VipsImage *in, int *left, int *top ) ++vips_smartcrop_attention(VipsSmartcrop *smartcrop, ++ VipsImage *in, int *left, int *top) + { + /* From smartcrop.js. + */ +- static double skin_vector[] = {-0.78, -0.57, -0.44}; +- static double ones[] = {1.0, 1.0, 1.0}; ++ static double skin_vector[] = { -0.78, -0.57, -0.44 }; ++ static double ones[] = { 1.0, 1.0, 1.0 }; + +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( smartcrop ), 24 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(smartcrop), 24); + + double hscale; + double vscale; +@@ -217,68 +217,70 @@ vips_smartcrop_attention( VipsSmartcrop *smartcrop, + */ + hscale = 32.0 / in->Xsize; + vscale = 32.0 / in->Ysize; +- sigma = VIPS_MAX( sqrt( pow( smartcrop->width * hscale, 2 ) + +- pow( smartcrop->height * vscale, 2 ) ) / 10, 1.0 ); +- if ( vips_resize( in, &t[17], hscale, +- "vscale", vscale, +- NULL ) ) +- return( -1 ); ++ sigma = VIPS_MAX(sqrt(pow(smartcrop->width * hscale, 2) + ++ pow(smartcrop->height * vscale, 2)) / ++ 10, ++ 1.0); ++ if (vips_resize(in, &t[17], hscale, ++ "vscale", vscale, ++ NULL)) ++ return (-1); + + /* Simple edge detect. + */ +- if( !(t[21] = vips_image_new_matrixv( 3, 3, +- 0.0, -1.0, 0.0, +- -1.0, 4.0, -1.0, +- 0.0, -1.0, 0.0 )) ) +- return( -1 ); ++ if (!(t[21] = vips_image_new_matrixv(3, 3, ++ 0.0, -1.0, 0.0, ++ -1.0, 4.0, -1.0, ++ 0.0, -1.0, 0.0))) ++ return (-1); + + /* Convert to XYZ and just use the first three bands. + */ +- if( vips_colourspace( t[17], &t[0], VIPS_INTERPRETATION_XYZ, NULL ) || +- vips_extract_band( t[0], &t[1], 0, "n", 3, NULL ) ) +- return( -1 ); ++ if (vips_colourspace(t[17], &t[0], VIPS_INTERPRETATION_XYZ, NULL) || ++ vips_extract_band(t[0], &t[1], 0, "n", 3, NULL)) ++ return (-1); + +- /* Edge detect on Y. ++ /* Edge detect on Y. + */ +- if( vips_extract_band( t[1], &t[2], 1, NULL ) || +- vips_conv( t[2], &t[3], t[21], ++ if (vips_extract_band(t[1], &t[2], 1, NULL) || ++ vips_conv(t[2], &t[3], t[21], + "precision", VIPS_PRECISION_INTEGER, +- NULL ) || +- vips_linear1( t[3], &t[4], 5.0, 0.0, NULL ) || +- vips_abs( t[4], &t[14], NULL ) ) +- return( -1 ); ++ NULL) || ++ vips_linear1(t[3], &t[4], 5.0, 0.0, NULL) || ++ vips_abs(t[4], &t[14], NULL)) ++ return (-1); + + /* Look for skin colours. Taken from smartcrop.js. + */ +- if( ++ if ( + /* Normalise to magnitude of colour in XYZ. + */ +- pythagoras( smartcrop, t[1], &t[5] ) || +- vips_divide( t[1], t[5], &t[6], NULL ) || ++ pythagoras(smartcrop, t[1], &t[5]) || ++ vips_divide(t[1], t[5], &t[6], NULL) || + + /* Distance from skin point. + */ +- vips_linear( t[6], &t[7], ones, skin_vector, 3, NULL ) || +- pythagoras( smartcrop, t[7], &t[8] ) || ++ vips_linear(t[6], &t[7], ones, skin_vector, 3, NULL) || ++ pythagoras(smartcrop, t[7], &t[8]) || + + /* Rescale to 100 - 0 score. + */ +- vips_linear1( t[8], &t[9], -100.0, 100.0, NULL ) || ++ vips_linear1(t[8], &t[9], -100.0, 100.0, NULL) || + + /* Ignore dark areas. + */ +- vips_more_const1( t[2], &t[10], 5.0, NULL ) || +- !(t[11] = vips_image_new_from_image1( t[10], 0.0 )) || +- vips_ifthenelse( t[10], t[9], t[11], &t[15], NULL ) ) +- return( -1 ); ++ vips_more_const1(t[2], &t[10], 5.0, NULL) || ++ !(t[11] = vips_image_new_from_image1(t[10], 0.0)) || ++ vips_ifthenelse(t[10], t[9], t[11], &t[15], NULL)) ++ return (-1); + + /* Look for saturated areas. + */ +- if( vips_colourspace( t[1], &t[12], +- VIPS_INTERPRETATION_LAB, NULL ) || +- vips_extract_band( t[12], &t[13], 1, NULL ) || +- vips_ifthenelse( t[10], t[13], t[11], &t[16], NULL ) ) +- return( -1 ); ++ if (vips_colourspace(t[1], &t[12], ++ VIPS_INTERPRETATION_LAB, NULL) || ++ vips_extract_band(t[12], &t[13], 1, NULL) || ++ vips_ifthenelse(t[10], t[13], t[11], &t[16], NULL)) ++ return (-1); + + /* Sum, blur and find maxpos. + * +@@ -287,59 +289,58 @@ vips_smartcrop_attention( VipsSmartcrop *smartcrop, + * function. + */ + +- if( vips_sum( &t[14], &t[18], 3, NULL ) || +- vips_gaussblur( t[18], &t[19], sigma, NULL ) || +- vips_max( t[19], &max, "x", &x_pos, "y", &y_pos, NULL ) ) +- return( -1 ); ++ if (vips_sum(&t[14], &t[18], 3, NULL) || ++ vips_gaussblur(t[18], &t[19], sigma, NULL) || ++ vips_max(t[19], &max, "x", &x_pos, "y", &y_pos, NULL)) ++ return (-1); + + /* Centre the crop over the max. + */ +- *left = VIPS_CLIP( 0, +- x_pos / hscale - smartcrop->width / 2, +- in->Xsize - smartcrop->width ); +- *top = VIPS_CLIP( 0, +- y_pos / vscale - smartcrop->height / 2, +- in->Ysize - smartcrop->height ); +- +- return( 0 ); ++ *left = VIPS_CLIP(0, ++ x_pos / hscale - smartcrop->width / 2, ++ in->Xsize - smartcrop->width); ++ *top = VIPS_CLIP(0, ++ y_pos / vscale - smartcrop->height / 2, ++ in->Ysize - smartcrop->height); ++ ++ return (0); + } + + static int +-vips_smartcrop_build( VipsObject *object ) ++vips_smartcrop_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsSmartcrop *smartcrop = (VipsSmartcrop *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + + VipsImage *in; + int left; + int top; + +- if( VIPS_OBJECT_CLASS( vips_smartcrop_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_smartcrop_parent_class)->build(object)) ++ return (-1); + +- if( smartcrop->width > smartcrop->in->Xsize || ++ if (smartcrop->width > smartcrop->in->Xsize || + smartcrop->height > smartcrop->in->Ysize || +- smartcrop->width <= 0 || smartcrop->height <= 0 ) { +- vips_error( class->nickname, "%s", _( "bad extract area" ) ); +- return( -1 ); ++ smartcrop->width <= 0 || smartcrop->height <= 0) { ++ vips_error(class->nickname, "%s", _("bad extract area")); ++ return (-1); + } + + in = smartcrop->in; + + /* If there's an alpha, we have to premultiply before searching for + * content. There could be stuff in transparent areas which we don't +- * want to consider. ++ * want to consider. + */ +- if( vips_image_hasalpha( in ) ) { +- if( vips_premultiply( in, &t[0], NULL ) ) +- return( -1 ); ++ if (vips_image_hasalpha(in)) { ++ if (vips_premultiply(in, &t[0], NULL)) ++ return (-1); + in = t[0]; + } + +- switch( smartcrop->interesting ) { ++ switch (smartcrop->interesting) { + case VIPS_INTERESTING_NONE: + case VIPS_INTERESTING_LOW: + left = 0; +@@ -352,13 +353,13 @@ vips_smartcrop_build( VipsObject *object ) + break; + + case VIPS_INTERESTING_ENTROPY: +- if( vips_smartcrop_entropy( smartcrop, in, &left, &top ) ) +- return( -1 ); ++ if (vips_smartcrop_entropy(smartcrop, in, &left, &top)) ++ return (-1); + break; + + case VIPS_INTERESTING_ATTENTION: +- if( vips_smartcrop_attention( smartcrop, in, &left, &top ) ) +- return( -1 ); ++ if (vips_smartcrop_attention(smartcrop, in, &left, &top)) ++ return (-1); + break; + + case VIPS_INTERESTING_HIGH: +@@ -383,61 +384,60 @@ vips_smartcrop_build( VipsObject *object ) + break; + } + +- if( vips_extract_area( smartcrop->in, &t[1], +- left, top, +- smartcrop->width, smartcrop->height, NULL ) || +- vips_image_write( t[1], conversion->out ) ) +- return( -1 ); ++ if (vips_extract_area(smartcrop->in, &t[1], ++ left, top, ++ smartcrop->width, smartcrop->height, NULL) || ++ vips_image_write(t[1], conversion->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_smartcrop_class_init( VipsSmartcropClass *class ) ++vips_smartcrop_class_init(VipsSmartcropClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_smartcrop_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_smartcrop_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "smartcrop"; +- vobject_class->description = _( "extract an area from an image" ); ++ vobject_class->description = _("extract an area from an image"); + vobject_class->build = vips_smartcrop_build; + +- VIPS_ARG_IMAGE( class, "input", 0, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "input", 0, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsSmartcrop, in ) ); ++ G_STRUCT_OFFSET(VipsSmartcrop, in)); + +- VIPS_ARG_INT( class, "width", 4, +- _( "Width" ), +- _( "Width of extract area" ), ++ VIPS_ARG_INT(class, "width", 4, ++ _("Width"), ++ _("Width of extract area"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsSmartcrop, width ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsSmartcrop, width), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "height", 5, +- _( "Height" ), +- _( "Height of extract area" ), ++ VIPS_ARG_INT(class, "height", 5, ++ _("Height"), ++ _("Height of extract area"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsSmartcrop, height ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsSmartcrop, height), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_ENUM( class, "interesting", 6, +- _( "Interesting" ), +- _( "How to measure interestingness" ), ++ VIPS_ARG_ENUM(class, "interesting", 6, ++ _("Interesting"), ++ _("How to measure interestingness"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSmartcrop, interesting ), +- VIPS_TYPE_INTERESTING, VIPS_INTERESTING_ATTENTION ); +- ++ G_STRUCT_OFFSET(VipsSmartcrop, interesting), ++ VIPS_TYPE_INTERESTING, VIPS_INTERESTING_ATTENTION); + } + + static void +-vips_smartcrop_init( VipsSmartcrop *smartcrop ) ++vips_smartcrop_init(VipsSmartcrop *smartcrop) + { + smartcrop->interesting = VIPS_INTERESTING_ATTENTION; + } +@@ -454,7 +454,7 @@ vips_smartcrop_init( VipsSmartcrop *smartcrop ) + * + * * @interesting: #VipsInteresting to use to find interesting areas (default: #VIPS_INTERESTING_ATTENTION) + * +- * Crop an image down to a specified width and height by removing boring parts. ++ * Crop an image down to a specified width and height by removing boring parts. + * + * Use @interesting to pick the method vips uses to decide which bits of the + * image should be kept. +@@ -463,18 +463,18 @@ vips_smartcrop_init( VipsSmartcrop *smartcrop ) + * within the input image. + * + * See also: vips_extract_area(). +- * ++ * + * Returns: 0 on success, -1 on error. + */ + int +-vips_smartcrop( VipsImage *in, VipsImage **out, int width, int height, ... ) ++vips_smartcrop(VipsImage *in, VipsImage **out, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "smartcrop", ap, in, out, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("smartcrop", ap, in, out, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/subsample.c b/libvips/conversion/subsample.c +index 3518cd6636..77783656f4 100644 +--- a/libvips/conversion/subsample.c ++++ b/libvips/conversion/subsample.c +@@ -19,28 +19,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -60,7 +60,7 @@ typedef struct _VipsSubsample { + VipsConversion parent_instance; + + VipsImage *in; +- int xfac; ++ int xfac; + int yfac; + gboolean point; + +@@ -68,28 +68,28 @@ typedef struct _VipsSubsample { + + typedef VipsConversionClass VipsSubsampleClass; + +-G_DEFINE_TYPE( VipsSubsample, vips_subsample, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsSubsample, vips_subsample, VIPS_TYPE_CONVERSION); + + /* Maximum width of input we ask for. + */ + #define VIPS_MAX_WIDTH (100) + +-/* Subsample a VipsRegion. We fetch in VIPS_MAX_WIDTH pixel-wide strips, ++/* Subsample a VipsRegion. We fetch in VIPS_MAX_WIDTH pixel-wide strips, + * left-to-right across the input. + */ + static int +-vips_subsample_line_gen( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_subsample_line_gen(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + VipsSubsample *subsample = (VipsSubsample *) b; + VipsImage *in = (VipsImage *) a; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; +- int ri = VIPS_RECT_RIGHT( r ); ++ int ri = VIPS_RECT_RIGHT(r); + int to = r->top; +- int bo = VIPS_RECT_BOTTOM( r ); +- int ps = VIPS_IMAGE_SIZEOF_PEL( in ); ++ int bo = VIPS_RECT_BOTTOM(r); ++ int ps = VIPS_IMAGE_SIZEOF_PEL(in); + int owidth = VIPS_MAX_WIDTH / subsample->xfac; + + VipsRect s; +@@ -98,18 +98,18 @@ vips_subsample_line_gen( VipsRegion *or, + + /* Loop down the region. + */ +- for( y = to; y < bo; y++ ) { +- VipsPel *q = VIPS_REGION_ADDR( or, le, y ); ++ for (y = to; y < bo; y++) { ++ VipsPel *q = VIPS_REGION_ADDR(or, le, y); + VipsPel *p; + + /* Loop across the region, in owidth sized pieces. + */ +- for( x = le; x < ri; x += owidth ) { ++ for (x = le; x < ri; x += owidth) { + /* How many pixels do we make this time? + */ +- int ow = VIPS_MIN( owidth, ri - x ); ++ int ow = VIPS_MIN(owidth, ri - x); + +- /* Ask for this many from input ... can save a ++ /* Ask for this many from input ... can save a + * little here! + */ + int iw = ow * subsample->xfac - (subsample->xfac - 1); +@@ -120,14 +120,14 @@ vips_subsample_line_gen( VipsRegion *or, + s.top = y * subsample->yfac; + s.width = iw; + s.height = 1; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + + /* Append new pels to output. + */ +- p = VIPS_REGION_ADDR( ir, s.left, s.top ); +- for( z = 0; z < ow; z++ ) { +- for( k = 0; k < ps; k++ ) ++ p = VIPS_REGION_ADDR(ir, s.left, s.top); ++ for (z = 0; z < ow; z++) { ++ for (k = 0; k < ps; k++) + q[k] = p[k]; + + q += ps; +@@ -136,24 +136,24 @@ vips_subsample_line_gen( VipsRegion *or, + } + } + +- return( 0 ); ++ return (0); + } + + /* Fetch one pixel at a time ... good for very large shrinks. + */ + static int +-vips_subsample_point_gen( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_subsample_point_gen(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + VipsSubsample *subsample = (VipsSubsample *) b; + VipsImage *in = (VipsImage *) a; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; +- int ri = VIPS_RECT_RIGHT( r ); ++ int ri = VIPS_RECT_RIGHT(r); + int to = r->top; + int bo = VIPS_RECT_BOTTOM(r); +- int ps = VIPS_IMAGE_SIZEOF_PEL( in ); ++ int ps = VIPS_IMAGE_SIZEOF_PEL(in); + + VipsRect s; + int x, y; +@@ -161,62 +161,62 @@ vips_subsample_point_gen( VipsRegion *or, + + /* Loop down the region. + */ +- for( y = to; y < bo; y++ ) { +- VipsPel *q = VIPS_REGION_ADDR( or, le, y ); ++ for (y = to; y < bo; y++) { ++ VipsPel *q = VIPS_REGION_ADDR(or, le, y); + VipsPel *p; + + /* Loop across the region, in owidth sized pieces. + */ +- for( x = le; x < ri; x++ ) { ++ for (x = le; x < ri; x++) { + /* Ask for input. + */ + s.left = x * subsample->xfac; + s.top = y * subsample->yfac; + s.width = 1; + s.height = 1; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + + /* Append new pels to output. + */ +- p = VIPS_REGION_ADDR( ir, s.left, s.top ); +- for( k = 0; k < ps; k++ ) ++ p = VIPS_REGION_ADDR(ir, s.left, s.top); ++ for (k = 0; k < ps; k++) + q[k] = p[k]; + q += ps; + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_subsample_build( VipsObject *object ) ++vips_subsample_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsSubsample *subsample = (VipsSubsample *) object; + + VipsGenerateFn subsample_fn; + +- if( VIPS_OBJECT_CLASS( vips_subsample_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_subsample_parent_class)->build(object)) ++ return (-1); + +- g_assert( subsample->xfac > 0 ); +- g_assert( subsample->yfac > 0 ); ++ g_assert(subsample->xfac > 0); ++ g_assert(subsample->yfac > 0); + +- if( subsample->xfac == 1 && +- subsample->yfac == 1 ) +- return( vips_image_write( subsample->in, conversion->out ) ); +- if( vips_image_pio_input( subsample->in ) || +- vips_check_coding_known( class->nickname, subsample->in ) ) +- return( -1 ); ++ if (subsample->xfac == 1 && ++ subsample->yfac == 1) ++ return (vips_image_write(subsample->in, conversion->out)); ++ if (vips_image_pio_input(subsample->in) || ++ vips_check_coding_known(class->nickname, subsample->in)) ++ return (-1); + + /* Set demand hints. We want THINSTRIP, as we will be demanding a + * large area of input for each output line. + */ +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, subsample->in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, subsample->in, NULL)) ++ return (-1); + + /* Prepare output. Note: we round the output width down! + */ +@@ -224,78 +224,77 @@ vips_subsample_build( VipsObject *object ) + conversion->out->Ysize = subsample->in->Ysize / subsample->yfac; + conversion->out->Xres = subsample->in->Xres / subsample->xfac; + conversion->out->Yres = subsample->in->Yres / subsample->yfac; +- if( conversion->out->Xsize <= 0 || +- conversion->out->Ysize <= 0 ) { +- vips_error( class->nickname, +- "%s", _( "image has shrunk to nothing" ) ); +- return( -1 ); ++ if (conversion->out->Xsize <= 0 || ++ conversion->out->Ysize <= 0) { ++ vips_error(class->nickname, ++ "%s", _("image has shrunk to nothing")); ++ return (-1); + } + +- /* Generate! If this is a very large shrink, then it's probably faster +- * to do it a pixel at a time. ++ /* Generate! If this is a very large shrink, then it's probably faster ++ * to do it a pixel at a time. + */ +- if( subsample->point || +- subsample->xfac > 10 ) ++ if (subsample->point || ++ subsample->xfac > 10) + subsample_fn = vips_subsample_point_gen; +- else ++ else + subsample_fn = vips_subsample_line_gen; + +- if( vips_image_generate( conversion->out, +- vips_start_one, subsample_fn, vips_stop_one, +- subsample->in, subsample ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, subsample_fn, vips_stop_one, ++ subsample->in, subsample)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_subsample_class_init( VipsSubsampleClass *class ) ++vips_subsample_class_init(VipsSubsampleClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "subsample"; +- vobject_class->description = _( "subsample an image" ); ++ vobject_class->description = _("subsample an image"); + vobject_class->build = vips_subsample_build; + + /* We don't work well as sequential: we can easily skip the first few + * scanlines, and that confuses vips_sequential(). + */ + +- VIPS_ARG_IMAGE( class, "input", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "input", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsSubsample, in ) ); ++ G_STRUCT_OFFSET(VipsSubsample, in)); + +- VIPS_ARG_INT( class, "xfac", 3, +- _( "Xfac" ), +- _( "Horizontal subsample factor" ), ++ VIPS_ARG_INT(class, "xfac", 3, ++ _("Xfac"), ++ _("Horizontal subsample factor"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsSubsample, xfac ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsSubsample, xfac), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "yfac", 4, +- _( "Yfac" ), +- _( "Vertical subsample factor" ), ++ VIPS_ARG_INT(class, "yfac", 4, ++ _("Yfac"), ++ _("Vertical subsample factor"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsSubsample, yfac ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsSubsample, yfac), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_BOOL( class, "point", 5, +- _( "Point" ), +- _( "Point sample" ), ++ VIPS_ARG_BOOL(class, "point", 5, ++ _("Point"), ++ _("Point sample"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSubsample, point ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsSubsample, point), ++ FALSE); + } + + static void +-vips_subsample_init( VipsSubsample *subsample ) ++vips_subsample_init(VipsSubsample *subsample) + { + } + +@@ -318,22 +317,22 @@ vips_subsample_init( VipsSubsample *subsample ) + * from @in and then subsample that line. For large shrinks it will fetch + * single pixels. + * +- * If @point is set, @in will always be sampled in points. This can be faster ++ * If @point is set, @in will always be sampled in points. This can be faster + * if the previous operations in the pipeline are very slow. + * + * See also: vips_affine(), vips_shrink(), vips_zoom(). +- * ++ * + * Returns: 0 on success, -1 on error. + */ + int +-vips_subsample( VipsImage *in, VipsImage **out, int xfac, int yfac, ... ) ++vips_subsample(VipsImage *in, VipsImage **out, int xfac, int yfac, ...) + { + va_list ap; + int result; + +- va_start( ap, yfac ); +- result = vips_call_split( "subsample", ap, in, out, xfac, yfac ); +- va_end( ap ); ++ va_start(ap, yfac); ++ result = vips_call_split("subsample", ap, in, out, xfac, yfac); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/switch.c b/libvips/conversion/switch.c +index 5ec749f572..554b525f63 100644 +--- a/libvips/conversion/switch.c ++++ b/libvips/conversion/switch.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -55,56 +55,56 @@ typedef struct _VipsSwitch { + + typedef VipsOperationClass VipsSwitchClass; + +-G_DEFINE_TYPE( VipsSwitch, vips_switch, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsSwitch, vips_switch, VIPS_TYPE_OPERATION); + +-static int +-vips_switch_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++static int ++vips_switch_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + VipsRegion **ar = (VipsRegion **) seq; + VipsSwitch *swit = (VipsSwitch *) b; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + + int x, y, i; +- VipsPel * restrict q; ++ VipsPel *restrict q; + size_t qls; +- VipsPel * restrict p[256]; ++ VipsPel *restrict p[256]; + size_t ls[256]; + +- if( vips_reorder_prepare_many( or->im, ar, r ) ) +- return( -1 ); ++ if (vips_reorder_prepare_many(or->im, ar, r)) ++ return (-1); + +- g_assert( ar[0]->im->BandFmt == VIPS_FORMAT_UCHAR ); +- g_assert( ar[0]->im->Bands == 1 ); ++ g_assert(ar[0]->im->BandFmt == VIPS_FORMAT_UCHAR); ++ g_assert(ar[0]->im->Bands == 1); + +- for( i = 0; i < swit->n; i++ ) { +- p[i] = VIPS_REGION_ADDR( ar[i], r->left, r->top ); +- ls[i] = VIPS_REGION_LSKIP( ar[i] ); ++ for (i = 0; i < swit->n; i++) { ++ p[i] = VIPS_REGION_ADDR(ar[i], r->left, r->top); ++ ls[i] = VIPS_REGION_LSKIP(ar[i]); + } + +- q = VIPS_REGION_ADDR( or, r->left, r->top ); +- qls = VIPS_REGION_LSKIP( or ); +- for( y = 0; y < r->height; y++ ) { +- for( x = 0; x < r->width; x++ ) { +- for( i = 0; i < swit->n; i++ ) +- if( p[i][x] ) ++ q = VIPS_REGION_ADDR(or, r->left, r->top); ++ qls = VIPS_REGION_LSKIP(or); ++ for (y = 0; y < r->height; y++) { ++ for (x = 0; x < r->width; x++) { ++ for (i = 0; i < swit->n; i++) ++ if (p[i][x]) + break; + + q[x] = i; + } + + q += qls; +- for( i = 0; i < swit->n; i++ ) ++ for (i = 0; i < swit->n; i++) + p[i] += ls[i]; + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_switch_build( VipsObject *object ) ++vips_switch_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsSwitch *swit = (VipsSwitch *) object; + + VipsImage **tests; +@@ -114,114 +114,113 @@ vips_switch_build( VipsObject *object ) + VipsImage **size; + int i; + +- g_object_set( object, "out", vips_image_new(), NULL ); ++ g_object_set(object, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_switch_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_switch_parent_class)->build(object)) ++ return (-1); + + /* 255 rather than 256, since we want to reserve +1 as the no + * match value. + */ +- tests = vips_area_get_data( &swit->tests->area, +- NULL, &swit->n, NULL, NULL ); +- if( swit->n > 255 || +- swit->n < 1 ) { +- vips_error( class->nickname, "%s", _( "bad number of tests" ) ); +- return( -1 ); ++ tests = vips_area_get_data(&swit->tests->area, ++ NULL, &swit->n, NULL, NULL); ++ if (swit->n > 255 || ++ swit->n < 1) { ++ vips_error(class->nickname, "%s", _("bad number of tests")); ++ return (-1); + } + +- decode = (VipsImage **) vips_object_local_array( object, swit->n ); +- format = (VipsImage **) vips_object_local_array( object, swit->n ); +- band = (VipsImage **) vips_object_local_array( object, swit->n + 1 ); +- size = (VipsImage **) vips_object_local_array( object, swit->n + 1 ); ++ decode = (VipsImage **) vips_object_local_array(object, swit->n); ++ format = (VipsImage **) vips_object_local_array(object, swit->n); ++ band = (VipsImage **) vips_object_local_array(object, swit->n + 1); ++ size = (VipsImage **) vips_object_local_array(object, swit->n + 1); + + /* Decode RAD/LABQ etc. + */ +- for( i = 0; i < swit->n; i++ ) +- if( vips_image_decode( tests[i], &decode[i] ) ) +- return( -1 ); ++ for (i = 0; i < swit->n; i++) ++ if (vips_image_decode(tests[i], &decode[i])) ++ return (-1); + tests = decode; + + /* Must be uchar. + */ +- for( i = 0; i < swit->n; i++ ) +- if( vips_cast_uchar( tests[i], &format[i], NULL ) ) +- return( -1 ); ++ for (i = 0; i < swit->n; i++) ++ if (vips_cast_uchar(tests[i], &format[i], NULL)) ++ return (-1); + tests = format; + + /* Images must match in size and bands. + */ +- if( vips__bandalike_vec( class->nickname, tests, band, swit->n, 1 ) || +- vips__sizealike_vec( band, size, swit->n ) ) +- return( -1 ); ++ if (vips__bandalike_vec(class->nickname, tests, band, swit->n, 1) || ++ vips__sizealike_vec(band, size, swit->n)) ++ return (-1); + tests = size; + +- if( tests[0]->Bands > 1 ) { +- vips_error( class->nickname, +- "%s", _( "test images not 1-band" ) ); +- return( -1 ); ++ if (tests[0]->Bands > 1) { ++ vips_error(class->nickname, ++ "%s", _("test images not 1-band")); ++ return (-1); + } + +- if( vips_image_pipeline_array( swit->out, +- VIPS_DEMAND_STYLE_THINSTRIP, tests ) ) +- return( -1 ); ++ if (vips_image_pipeline_array(swit->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, tests)) ++ return (-1); + +- if( vips_image_generate( swit->out, +- vips_start_many, vips_switch_gen, vips_stop_many, +- tests, swit ) ) +- return( -1 ); ++ if (vips_image_generate(swit->out, ++ vips_start_many, vips_switch_gen, vips_stop_many, ++ tests, swit)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_switch_class_init( VipsSwitchClass *class ) ++vips_switch_class_init(VipsSwitchClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "switch"; +- object_class->description = +- _( "find the index of the first non-zero pixel in tests" ); ++ object_class->description = ++ _("find the index of the first non-zero pixel in tests"); + object_class->build = vips_switch_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_BOXED( class, "tests", 1, +- _( "Tests" ), +- _( "Table of images to test" ), ++ VIPS_ARG_BOXED(class, "tests", 1, ++ _("Tests"), ++ _("Table of images to test"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsSwitch, tests ), +- VIPS_TYPE_ARRAY_IMAGE ); +- +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsSwitch, out ) ); +- ++ G_STRUCT_OFFSET(VipsSwitch, tests), ++ VIPS_TYPE_ARRAY_IMAGE); ++ ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsSwitch, out)); + } + + static void +-vips_switch_init( VipsSwitch *swit ) ++vips_switch_init(VipsSwitch *swit) + { + } + + static int +-vips_switchv( VipsImage **tests, VipsImage **out, int n, va_list ap ) ++vips_switchv(VipsImage **tests, VipsImage **out, int n, va_list ap) + { +- VipsArrayImage *tests_array; ++ VipsArrayImage *tests_array; + int result; + +- tests_array = vips_array_image_new( tests, n ); +- result = vips_call_split( "switch", ap, tests_array, out ); +- vips_area_unref( VIPS_AREA( tests_array ) ); ++ tests_array = vips_array_image_new(tests, n); ++ result = vips_call_split("switch", ap, tests_array, out); ++ vips_area_unref(VIPS_AREA(tests_array)); + +- return( result ); ++ return (result); + } + + /** +@@ -231,13 +230,13 @@ vips_switchv( VipsImage **tests, VipsImage **out, int n, va_list ap ) + * @n: number of input images + * @...: %NULL-terminated list of optional named arguments + * +- * The @tests images are evaluated and at each point the index of the first +- * non-zero value is written to @out. If all @tests are false, the value +- * (@n + 1) is written. ++ * The @tests images are evaluated and at each point the index of the first ++ * non-zero value is written to @out. If all @tests are false, the value ++ * (@n + 1) is written. + * + * Images in @tests must have one band. They are expanded to the + * bounding box of the set of images in @tests, and that size is used for +- * @out. @tests can have up to 255 elements. ++ * @out. @tests can have up to 255 elements. + * + * Combine with vips_case() to make an efficient multi-way vips_ifthenelse(). + * +@@ -246,15 +245,14 @@ vips_switchv( VipsImage **tests, VipsImage **out, int n, va_list ap ) + * Returns: 0 on success, -1 on error + */ + int +-vips_switch( VipsImage **tests, VipsImage **out, int n, ... ) ++vips_switch(VipsImage **tests, VipsImage **out, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_switchv( tests, out, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_switchv(tests, out, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/conversion/tilecache.c b/libvips/conversion/tilecache.c +index 72453810cb..7d939daa68 100644 +--- a/libvips/conversion/tilecache.c ++++ b/libvips/conversion/tilecache.c +@@ -1,6 +1,6 @@ + /* Simple tile or line cache. + * +- * This isn't the same as the sinkscreen cache: we don't sub-divide, and we ++ * This isn't the same as the sinkscreen cache: we don't sub-divide, and we + * single-thread our callee. + * + * 23/8/06 +@@ -39,28 +39,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a cache of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a cache of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -86,7 +86,7 @@ + + /* A tile in cache can be in one of three states: + * +- * DATA - the tile holds valid pixels ++ * DATA - the tile holds valid pixels + * CALC - some thread somewhere is calculating it + * PEND - some thread somewhere wants it + */ +@@ -103,25 +103,25 @@ typedef struct _VipsTile { + + VipsTileState state; + +- VipsRegion *region; /* Region with private mem for data */ ++ VipsRegion *region; /* Region with private mem for data */ + + /* We count how many threads are relying on this tile. This tile can't + * be flushed if ref_count > 0. + */ +- int ref_count; ++ int ref_count; + + /* Tile position. Just use left/top to calculate a hash. This is the + * key for the hash table. Don't use region->valid in case the region + * pointer is NULL. + */ +- VipsRect pos; ++ VipsRect pos; + } VipsTile; + + typedef struct _VipsBlockCache { + VipsConversion parent_instance; + + VipsImage *in; +- int tile_width; ++ int tile_width; + int tile_height; + int max_tiles; + +@@ -129,79 +129,79 @@ typedef struct _VipsBlockCache { + gboolean threaded; + gboolean persistent; + +- int ntiles; /* Current cache size */ +- GMutex *lock; /* Lock everything here */ +- GCond *new_tile; /* A new tile is ready */ +- GHashTable *tiles; /* Tiles, hashed by coordinates */ +- GQueue *recycle; /* Queue of unreffed tiles to reuse */ ++ int ntiles; /* Current cache size */ ++ GMutex *lock; /* Lock everything here */ ++ GCond *new_tile; /* A new tile is ready */ ++ GHashTable *tiles; /* Tiles, hashed by coordinates */ ++ GQueue *recycle; /* Queue of unreffed tiles to reuse */ + } VipsBlockCache; + + typedef VipsConversionClass VipsBlockCacheClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsBlockCache, vips_block_cache, +- VIPS_TYPE_CONVERSION ); ++G_DEFINE_ABSTRACT_TYPE(VipsBlockCache, vips_block_cache, ++ VIPS_TYPE_CONVERSION); + + #define VIPS_TYPE_BLOCK_CACHE (vips_block_cache_get_type()) + + static void +-vips_block_cache_drop_all( VipsBlockCache *cache ) ++vips_block_cache_drop_all(VipsBlockCache *cache) + { + /* FIXME this is a disaster if active threads are working on tiles. We + * should have something to block new requests, and only dispose once + * all tiles are unreffed. + */ +- g_hash_table_remove_all( cache->tiles ); ++ g_hash_table_remove_all(cache->tiles); + } + + static void +-vips_block_cache_dispose( GObject *gobject ) ++vips_block_cache_dispose(GObject *gobject) + { + VipsBlockCache *cache = (VipsBlockCache *) gobject; + +- vips_block_cache_drop_all( cache ); +- VIPS_FREEF( vips_g_mutex_free, cache->lock ); +- VIPS_FREEF( vips_g_cond_free, cache->new_tile ); ++ vips_block_cache_drop_all(cache); ++ VIPS_FREEF(vips_g_mutex_free, cache->lock); ++ VIPS_FREEF(vips_g_cond_free, cache->new_tile); + +- if( cache->tiles ) +- g_assert( g_hash_table_size( cache->tiles ) == 0 ); +- VIPS_FREEF( g_hash_table_destroy, cache->tiles ); +- VIPS_FREEF( g_queue_free, cache->recycle ); ++ if (cache->tiles) ++ g_assert(g_hash_table_size(cache->tiles) == 0); ++ VIPS_FREEF(g_hash_table_destroy, cache->tiles); ++ VIPS_FREEF(g_queue_free, cache->recycle); + +- G_OBJECT_CLASS( vips_block_cache_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_block_cache_parent_class)->dispose(gobject); + } + + static int +-vips_tile_move( VipsTile *tile, int x, int y ) ++vips_tile_move(VipsTile *tile, int x, int y) + { + /* We are changing x/y and therefore the hash value. We must unlink + * from the old hash position and relink at the new place. + */ +- g_hash_table_steal( tile->cache->tiles, &tile->pos ); ++ g_hash_table_steal(tile->cache->tiles, &tile->pos); + + tile->pos.left = x; + tile->pos.top = y; + tile->pos.width = tile->cache->tile_width; + tile->pos.height = tile->cache->tile_height; + +- g_hash_table_insert( tile->cache->tiles, &tile->pos, tile ); ++ g_hash_table_insert(tile->cache->tiles, &tile->pos, tile); + +- if( vips_region_buffer( tile->region, &tile->pos ) ) +- return( -1 ); ++ if (vips_region_buffer(tile->region, &tile->pos)) ++ return (-1); + + /* No data yet, but someone must want it. + */ + tile->state = VIPS_TILE_STATE_PEND; + +- return( 0 ); ++ return (0); + } + + static VipsTile * +-vips_tile_new( VipsBlockCache *cache, int x, int y ) ++vips_tile_new(VipsBlockCache *cache, int x, int y) + { + VipsTile *tile; + +- if( !(tile = VIPS_NEW( NULL, VipsTile )) ) +- return( NULL ); ++ if (!(tile = VIPS_NEW(NULL, VipsTile))) ++ return (NULL); + + tile->cache = cache; + tile->state = VIPS_TILE_STATE_PEND; +@@ -211,30 +211,30 @@ vips_tile_new( VipsBlockCache *cache, int x, int y ) + tile->pos.top = y; + tile->pos.width = cache->tile_width; + tile->pos.height = cache->tile_height; +- g_hash_table_insert( cache->tiles, &tile->pos, tile ); +- g_queue_push_tail( tile->cache->recycle, tile ); +- g_assert( cache->ntiles >= 0 ); ++ g_hash_table_insert(cache->tiles, &tile->pos, tile); ++ g_queue_push_tail(tile->cache->recycle, tile); ++ g_assert(cache->ntiles >= 0); + cache->ntiles += 1; + +- if( !(tile->region = vips_region_new( cache->in )) ) { +- g_hash_table_remove( cache->tiles, &tile->pos ); +- return( NULL ); ++ if (!(tile->region = vips_region_new(cache->in))) { ++ g_hash_table_remove(cache->tiles, &tile->pos); ++ return (NULL); + } + +- vips__region_no_ownership( tile->region ); ++ vips__region_no_ownership(tile->region); + +- if( vips_tile_move( tile, x, y ) ) { +- g_hash_table_remove( cache->tiles, &tile->pos ); +- return( NULL ); ++ if (vips_tile_move(tile, x, y)) { ++ g_hash_table_remove(cache->tiles, &tile->pos); ++ return (NULL); + } + +- return( tile ); ++ return (tile); + } + + /* Do we have a tile in the cache? + */ + static VipsTile * +-vips_tile_search( VipsBlockCache *cache, int x, int y ) ++vips_tile_search(VipsBlockCache *cache, int x, int y) + { + VipsRect pos; + VipsTile *tile; +@@ -243,241 +243,243 @@ vips_tile_search( VipsBlockCache *cache, int x, int y ) + pos.top = y; + pos.width = cache->tile_width; + pos.height = cache->tile_height; +- tile = (VipsTile *) g_hash_table_lookup( cache->tiles, &pos ); ++ tile = (VipsTile *) g_hash_table_lookup(cache->tiles, &pos); + +- return( tile ); ++ return (tile); + } + + static void +-vips_tile_find_is_topper( gpointer element, gpointer user_data ) ++vips_tile_find_is_topper(gpointer element, gpointer user_data) + { + VipsTile *this = (VipsTile *) element; + VipsTile **best = (VipsTile **) user_data; + +- if( !*best || +- this->pos.top < (*best)->pos.top ) ++ if (!*best || ++ this->pos.top < (*best)->pos.top) + *best = this; + } + + /* Search the recycle list for the topmost tile. + */ + static VipsTile * +-vips_tile_find_topmost( GQueue *recycle ) ++vips_tile_find_topmost(GQueue *recycle) + { + VipsTile *tile; + + tile = NULL; +- g_queue_foreach( recycle, vips_tile_find_is_topper, &tile ); ++ g_queue_foreach(recycle, vips_tile_find_is_topper, &tile); + +- return( tile ); ++ return (tile); + } + +-/* Find existing tile, make a new tile, or if we have a full set of tiles, ++/* Find existing tile, make a new tile, or if we have a full set of tiles, + * reuse one. + */ + static VipsTile * +-vips_tile_find( VipsBlockCache *cache, int x, int y ) ++vips_tile_find(VipsBlockCache *cache, int x, int y) + { + VipsTile *tile; + + /* In cache already? + */ +- if( (tile = vips_tile_search( cache, x, y )) ) { +- VIPS_DEBUG_MSG_RED( "vips_tile_find: " +- "tile %d x %d in cache\n", x, y ); +- return( tile ); ++ if ((tile = vips_tile_search(cache, x, y))) { ++ VIPS_DEBUG_MSG_RED("vips_tile_find: " ++ "tile %d x %d in cache\n", ++ x, y); ++ return (tile); + } + + /* VipsBlockCache not full? + */ +- if( cache->max_tiles == -1 || +- cache->ntiles < cache->max_tiles ) { +- VIPS_DEBUG_MSG_RED( "vips_tile_find: " +- "making new tile at %d x %d\n", x, y ); +- if( !(tile = vips_tile_new( cache, x, y )) ) +- return( NULL ); +- +- return( tile ); ++ if (cache->max_tiles == -1 || ++ cache->ntiles < cache->max_tiles) { ++ VIPS_DEBUG_MSG_RED("vips_tile_find: " ++ "making new tile at %d x %d\n", ++ x, y); ++ if (!(tile = vips_tile_new(cache, x, y))) ++ return (NULL); ++ ++ return (tile); + } + + /* Reuse an old one, if there are any. We just peek the tile pointer, + * it is removed from the recycle list later on _ref. + */ +- if( cache->recycle ) { +- if( cache->access == VIPS_ACCESS_RANDOM ) +- tile = g_queue_peek_head( cache->recycle ); ++ if (cache->recycle) { ++ if (cache->access == VIPS_ACCESS_RANDOM) ++ tile = g_queue_peek_head(cache->recycle); + else + /* This is slower :( We have to search the recycle + * queue. + */ +- tile = vips_tile_find_topmost( cache->recycle ); ++ tile = vips_tile_find_topmost(cache->recycle); + } + +- if( !tile ) { ++ if (!tile) { + /* There are no tiles we can reuse -- we have to make another + * for now. They will get culled down again next time around. + */ +- if( !(tile = vips_tile_new( cache, x, y )) ) +- return( NULL ); ++ if (!(tile = vips_tile_new(cache, x, y))) ++ return (NULL); + +- return( tile ); ++ return (tile); + } + +- VIPS_DEBUG_MSG_RED( "vips_tile_find: reusing tile %d x %d\n", +- tile->pos.left, tile->pos.top ); ++ VIPS_DEBUG_MSG_RED("vips_tile_find: reusing tile %d x %d\n", ++ tile->pos.left, tile->pos.top); + +- if( vips_tile_move( tile, x, y ) ) +- return( NULL ); ++ if (vips_tile_move(tile, x, y)) ++ return (NULL); + +- return( tile ); ++ return (tile); + } + +-static gboolean +-vips_tile_unlocked( gpointer key, gpointer value, gpointer user_data ) ++static gboolean ++vips_tile_unlocked(gpointer key, gpointer value, gpointer user_data) + { + VipsTile *tile = (VipsTile *) value; + +- return( !tile->ref_count ); ++ return (!tile->ref_count); + } + + static void +-vips_block_cache_minimise( VipsImage *image, VipsBlockCache *cache ) ++vips_block_cache_minimise(VipsImage *image, VipsBlockCache *cache) + { +- VIPS_DEBUG_MSG( "vips_block_cache_minimise:\n" ); ++ VIPS_DEBUG_MSG("vips_block_cache_minimise:\n"); + +- g_mutex_lock( cache->lock ); ++ g_mutex_lock(cache->lock); + + /* We can't drop tiles that are in use. + */ +- g_hash_table_foreach_remove( cache->tiles, +- vips_tile_unlocked, NULL ); ++ g_hash_table_foreach_remove(cache->tiles, ++ vips_tile_unlocked, NULL); + +- g_mutex_unlock( cache->lock ); ++ g_mutex_unlock(cache->lock); + } + + static int +-vips_block_cache_build( VipsObject *object ) ++vips_block_cache_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsBlockCache *cache = (VipsBlockCache *) object; + +- VIPS_DEBUG_MSG( "vips_block_cache_build:\n" ); ++ VIPS_DEBUG_MSG("vips_block_cache_build:\n"); + +- if( VIPS_OBJECT_CLASS( vips_block_cache_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_block_cache_parent_class)->build(object)) ++ return (-1); + +- VIPS_DEBUG_MSG( "vips_block_cache_build: max size = %g MB\n", ++ VIPS_DEBUG_MSG("vips_block_cache_build: max size = %g MB\n", + (cache->max_tiles * cache->tile_width * cache->tile_height * +- VIPS_IMAGE_SIZEOF_PEL( cache->in )) / (1024 * 1024.0) ); ++ VIPS_IMAGE_SIZEOF_PEL(cache->in)) / ++ (1024 * 1024.0)); + +- if( !cache->persistent ) +- g_signal_connect( conversion->out, "minimise", +- G_CALLBACK( vips_block_cache_minimise ), cache ); ++ if (!cache->persistent) ++ g_signal_connect(conversion->out, "minimise", ++ G_CALLBACK(vips_block_cache_minimise), cache); + +- return( 0 ); ++ return (0); + } + + static void +-vips_block_cache_class_init( VipsBlockCacheClass *class ) ++vips_block_cache_class_init(VipsBlockCacheClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_block_cache_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_block_cache_class_init\n"); + + gobject_class->dispose = vips_block_cache_dispose; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "blockcache"; +- vobject_class->description = _( "cache an image" ); ++ vobject_class->description = _("cache an image"); + vobject_class->build = vips_block_cache_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBlockCache, in ) ); ++ G_STRUCT_OFFSET(VipsBlockCache, in)); + +- VIPS_ARG_INT( class, "tile_height", 4, +- _( "Tile height" ), +- _( "Tile height in pixels" ), ++ VIPS_ARG_INT(class, "tile_height", 4, ++ _("Tile height"), ++ _("Tile height in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsBlockCache, tile_height ), +- 1, 1000000, 128 ); ++ G_STRUCT_OFFSET(VipsBlockCache, tile_height), ++ 1, 1000000, 128); + +- VIPS_ARG_ENUM( class, "access", 6, +- _( "Access" ), +- _( "Expected access pattern" ), ++ VIPS_ARG_ENUM(class, "access", 6, ++ _("Access"), ++ _("Expected access pattern"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsBlockCache, access ), +- VIPS_TYPE_ACCESS, VIPS_ACCESS_RANDOM ); ++ G_STRUCT_OFFSET(VipsBlockCache, access), ++ VIPS_TYPE_ACCESS, VIPS_ACCESS_RANDOM); + +- VIPS_ARG_BOOL( class, "threaded", 7, +- _( "Threaded" ), +- _( "Allow threaded access" ), ++ VIPS_ARG_BOOL(class, "threaded", 7, ++ _("Threaded"), ++ _("Allow threaded access"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsBlockCache, threaded ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsBlockCache, threaded), ++ FALSE); + +- VIPS_ARG_BOOL( class, "persistent", 8, +- _( "Persistent" ), +- _( "Keep cache between evaluations" ), ++ VIPS_ARG_BOOL(class, "persistent", 8, ++ _("Persistent"), ++ _("Keep cache between evaluations"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsBlockCache, persistent ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsBlockCache, persistent), ++ FALSE); + } + + static unsigned int +-vips_rect_hash( VipsRect *pos ) ++vips_rect_hash(VipsRect *pos) + { + guint hash; + + /* We could shift down by the tile size? + * + * X discrimination is more important than Y, since +- * most tiles will have a similar Y. ++ * most tiles will have a similar Y. + */ + hash = (guint) pos->left ^ ((guint) pos->top << 16); + +- return( hash ); ++ return (hash); + } + +-static gboolean +-vips_rect_equal( VipsRect *a, VipsRect *b ) ++static gboolean ++vips_rect_equal(VipsRect *a, VipsRect *b) + { +- return( a->left == b->left && a->top == b->top ); ++ return (a->left == b->left && a->top == b->top); + } + + static void +-vips_tile_destroy( VipsTile *tile ) ++vips_tile_destroy(VipsTile *tile) + { + VipsBlockCache *cache = tile->cache; + +- VIPS_DEBUG_MSG_RED( "vips_tile_destroy: tile %d, %d (%p)\n", +- tile->pos.left, tile->pos.top, tile ); ++ VIPS_DEBUG_MSG_RED("vips_tile_destroy: tile %d, %d (%p)\n", ++ tile->pos.left, tile->pos.top, tile); + + /* 0 ref tiles should be on the recycle list. + */ +- g_assert( tile->ref_count == 0 ); +- g_assert( g_queue_find( tile->cache->recycle, tile ) ); +- g_queue_remove( cache->recycle, tile ); ++ g_assert(tile->ref_count == 0); ++ g_assert(g_queue_find(tile->cache->recycle, tile)); ++ g_queue_remove(cache->recycle, tile); + + cache->ntiles -= 1; +- g_assert( cache->ntiles >= 0 ); ++ g_assert(cache->ntiles >= 0); + tile->cache = NULL; + +- VIPS_UNREF( tile->region ); ++ VIPS_UNREF(tile->region); + +- g_free( tile ); ++ g_free(tile); + } + + static void +-vips_block_cache_init( VipsBlockCache *cache ) ++vips_block_cache_init(VipsBlockCache *cache) + { + cache->tile_width = 128; + cache->tile_height = 128; +@@ -489,11 +491,11 @@ vips_block_cache_init( VipsBlockCache *cache ) + cache->ntiles = 0; + cache->lock = vips_g_mutex_new(); + cache->new_tile = vips_g_cond_new(); +- cache->tiles = g_hash_table_new_full( +- (GHashFunc) vips_rect_hash, ++ cache->tiles = g_hash_table_new_full( ++ (GHashFunc) vips_rect_hash, + (GEqualFunc) vips_rect_equal, + NULL, +- (GDestroyNotify) vips_tile_destroy ); ++ (GDestroyNotify) vips_tile_destroy); + cache->recycle = g_queue_new(); + } + +@@ -504,54 +506,54 @@ typedef struct _VipsTileCache { + + typedef VipsBlockCacheClass VipsTileCacheClass; + +-G_DEFINE_TYPE( VipsTileCache, vips_tile_cache, VIPS_TYPE_BLOCK_CACHE ); ++G_DEFINE_TYPE(VipsTileCache, vips_tile_cache, VIPS_TYPE_BLOCK_CACHE); + + static void +-vips_tile_unref( VipsTile *tile ) ++vips_tile_unref(VipsTile *tile) + { +- g_assert( tile->ref_count > 0 ); ++ g_assert(tile->ref_count > 0); + + tile->ref_count -= 1; + +- if( tile->ref_count == 0 ) { ++ if (tile->ref_count == 0) { + /* Place at the end of the recycle queue. We pop from the + * front when selecting an unused tile for reuse. + */ +- g_assert( !g_queue_find( tile->cache->recycle, tile ) ); ++ g_assert(!g_queue_find(tile->cache->recycle, tile)); + +- g_queue_push_tail( tile->cache->recycle, tile ); ++ g_queue_push_tail(tile->cache->recycle, tile); + } + } + + static void +-vips_tile_ref( VipsTile *tile ) ++vips_tile_ref(VipsTile *tile) + { + tile->ref_count += 1; + +- g_assert( tile->ref_count > 0 ); ++ g_assert(tile->ref_count > 0); + +- if( tile->ref_count == 1 ) { +- g_assert( g_queue_find( tile->cache->recycle, tile ) ); ++ if (tile->ref_count == 1) { ++ g_assert(g_queue_find(tile->cache->recycle, tile)); + +- g_queue_remove( tile->cache->recycle, tile ); ++ g_queue_remove(tile->cache->recycle, tile); + } + } + + static void +-vips_tile_cache_unref( GSList *work ) ++vips_tile_cache_unref(GSList *work) + { + GSList *p; + +- for( p = work; p; p = p->next ) +- vips_tile_unref( (VipsTile *) p->data ); ++ for (p = work; p; p = p->next) ++ vips_tile_unref((VipsTile *) p->data); + +- g_slist_free( work ); ++ g_slist_free(work); + } + + /* Make a set of work tiles. + */ + static GSList * +-vips_tile_cache_ref( VipsBlockCache *cache, VipsRect *r ) ++vips_tile_cache_ref(VipsBlockCache *cache, VipsRect *r) + { + const int tw = cache->tile_width; + const int th = cache->tile_height; +@@ -568,48 +570,49 @@ vips_tile_cache_ref( VipsBlockCache *cache, VipsRect *r ) + /* Ref all the tiles we will need. + */ + work = NULL; +- for( y = ys; y < VIPS_RECT_BOTTOM( r ); y += th ) +- for( x = xs; x < VIPS_RECT_RIGHT( r ); x += tw ) { +- if( !(tile = vips_tile_find( cache, x, y )) ) { +- vips_tile_cache_unref( work ); +- return( NULL ); ++ for (y = ys; y < VIPS_RECT_BOTTOM(r); y += th) ++ for (x = xs; x < VIPS_RECT_RIGHT(r); x += tw) { ++ if (!(tile = vips_tile_find(cache, x, y))) { ++ vips_tile_cache_unref(work); ++ return (NULL); + } + +- vips_tile_ref( tile ); ++ vips_tile_ref(tile); + + /* We must append, since we want to keep tile ordering + * for sequential sources. + */ +- work = g_slist_append( work, tile ); ++ work = g_slist_append(work, tile); + +- VIPS_DEBUG_MSG_RED( "vips_tile_cache_ref: " +- "tile %d, %d (%p)\n", x, y, tile ); ++ VIPS_DEBUG_MSG_RED("vips_tile_cache_ref: " ++ "tile %d, %d (%p)\n", ++ x, y, tile); + } + +- return( work ); ++ return (work); + } + + static void +-vips_tile_paste( VipsTile *tile, VipsRegion *or ) ++vips_tile_paste(VipsTile *tile, VipsRegion * or) + { + VipsRect hit; + + /* The part of the tile that we need. + */ +- vips_rect_intersectrect( &or->valid, &tile->pos, &hit ); +- if( !vips_rect_isempty( &hit ) ) +- vips_region_copy( tile->region, or, &hit, hit.left, hit.top ); ++ vips_rect_intersectrect(& or->valid, &tile->pos, &hit); ++ if (!vips_rect_isempty(&hit)) ++ vips_region_copy(tile->region, or, &hit, hit.left, hit.top); + } + + /* Also called from vips_line_cache_gen(), beware. + */ + static int +-vips_tile_cache_gen( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_tile_cache_gen(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *in = (VipsRegion *) seq; + VipsBlockCache *cache = (VipsBlockCache *) b; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + + VipsTile *tile; + GSList *work; +@@ -618,43 +621,44 @@ vips_tile_cache_gen( VipsRegion *or, + + result = 0; + +- VIPS_GATE_START( "vips_tile_cache_gen: wait1" ); ++ VIPS_GATE_START("vips_tile_cache_gen: wait1"); + +- vips__worker_lock( cache->lock ); ++ vips__worker_lock(cache->lock); + +- VIPS_GATE_STOP( "vips_tile_cache_gen: wait1" ); ++ VIPS_GATE_STOP("vips_tile_cache_gen: wait1"); + +- VIPS_DEBUG_MSG_RED( "vips_tile_cache_gen: " +- "left = %d, top = %d, width = %d, height = %d\n", +- r->left, r->top, r->width, r->height ); ++ VIPS_DEBUG_MSG_RED("vips_tile_cache_gen: " ++ "left = %d, top = %d, width = %d, height = %d\n", ++ r->left, r->top, r->width, r->height); + + /* Ref all the tiles we will need. + */ +- work = vips_tile_cache_ref( cache, r ); ++ work = vips_tile_cache_ref(cache, r); + +- while( work ) { ++ while (work) { + /* Search for data tiles: easy, we can just paste those in. + */ +- for(;;) { +- for( p = work; p; p = p->next ) { ++ for (;;) { ++ for (p = work; p; p = p->next) { + tile = (VipsTile *) p->data; + +- if( tile->state == VIPS_TILE_STATE_DATA ) ++ if (tile->state == VIPS_TILE_STATE_DATA) + break; + } + +- if( !p ) ++ if (!p) + break; + +- VIPS_DEBUG_MSG_RED( "vips_tile_cache_gen: " +- "pasting %p\n", tile ); ++ VIPS_DEBUG_MSG_RED("vips_tile_cache_gen: " ++ "pasting %p\n", ++ tile); + +- vips_tile_paste( tile, or ); ++ vips_tile_paste(tile, or); + + /* We're done with this tile. + */ +- work = g_slist_remove( work, tile ); +- vips_tile_unref( tile ); ++ work = g_slist_remove(work, tile); ++ vips_tile_unref(tile); + } + + /* Calculate the first PEND tile we find on the work list. We +@@ -662,39 +666,40 @@ vips_tile_cache_gen( VipsRegion *or, + * DATA tiles might heve been made available by other threads + * and we want to get them out of the way as soon as we can. + */ +- for( p = work; p; p = p->next ) { ++ for (p = work; p; p = p->next) { + tile = (VipsTile *) p->data; + +- if( tile->state == VIPS_TILE_STATE_PEND ) { ++ if (tile->state == VIPS_TILE_STATE_PEND) { + tile->state = VIPS_TILE_STATE_CALC; + +- VIPS_DEBUG_MSG_RED( "vips_tile_cache_gen: " +- "calc of %p\n", tile ); ++ VIPS_DEBUG_MSG_RED("vips_tile_cache_gen: " ++ "calc of %p\n", ++ tile); + + /* In threaded mode, we let other threads run + * while we calc this tile. In non-threaded + * mode, we keep the lock and make 'em wait. + */ +- if( cache->threaded ) +- g_mutex_unlock( cache->lock ); ++ if (cache->threaded) ++ g_mutex_unlock(cache->lock); + + /* Don't compute if we've seen an error + * previously. + */ +- if( !result ) +- result = vips_region_prepare_to( in, +- tile->region, +- &tile->pos, +- tile->pos.left, tile->pos.top ); ++ if (!result) ++ result = vips_region_prepare_to(in, ++ tile->region, ++ &tile->pos, ++ tile->pos.left, tile->pos.top); + +- if( cache->threaded ) { +- VIPS_GATE_START( "vips_tile_cache_gen: " +- "wait2" ); ++ if (cache->threaded) { ++ VIPS_GATE_START("vips_tile_cache_gen: " ++ "wait2"); + +- g_mutex_lock( cache->lock ); ++ g_mutex_lock(cache->lock); + +- VIPS_GATE_STOP( "vips_tile_cache_gen: " +- "wait2" ); ++ VIPS_GATE_STOP("vips_tile_cache_gen: " ++ "wait2"); + } + + /* If there was an error calculating this +@@ -702,27 +707,28 @@ vips_tile_cache_gen( VipsRegion *or, + * calculation. We have to stop so we can + * support things like --fail on jpegload. + * +- * Don't return early, we'd deadlock. ++ * Don't return early, we'd deadlock. + */ +- if( result ) { +- VIPS_DEBUG_MSG_RED( ++ if (result) { ++ VIPS_DEBUG_MSG_RED( + "vips_tile_cache_gen: " +- "error on tile %p\n", tile ); ++ "error on tile %p\n", ++ tile); + +- g_warning( _( "error in tile %d x %d" ), +- tile->pos.left, tile->pos.top ); ++ g_warning(_("error in tile %d x %d"), ++ tile->pos.left, tile->pos.top); + +- vips_region_black( tile->region ); ++ vips_region_black(tile->region); + + *stop = TRUE; + } + + tile->state = VIPS_TILE_STATE_DATA; + +- /* Let everyone know there's a new DATA tile. ++ /* Let everyone know there's a new DATA tile. + * They need to all check their work lists. + */ +- g_cond_broadcast( cache->new_tile ); ++ g_cond_broadcast(cache->new_tile); + + break; + } +@@ -733,92 +739,90 @@ vips_tile_cache_gen( VipsRegion *or, + * + * We must block until the CALC tiles we need are done. + */ +- if( !p && +- work ) { +- for( p = work; p; p = p->next ) { ++ if (!p && ++ work) { ++ for (p = work; p; p = p->next) { + tile = (VipsTile *) p->data; + +- g_assert( tile->state == VIPS_TILE_STATE_CALC ); ++ g_assert(tile->state == VIPS_TILE_STATE_CALC); + } + +- VIPS_DEBUG_MSG_RED( "vips_tile_cache_gen: waiting\n" ); ++ VIPS_DEBUG_MSG_RED("vips_tile_cache_gen: waiting\n"); + +- VIPS_GATE_START( "vips_tile_cache_gen: wait3" ); ++ VIPS_GATE_START("vips_tile_cache_gen: wait3"); + +- g_cond_wait( cache->new_tile, cache->lock ); ++ g_cond_wait(cache->new_tile, cache->lock); + +- VIPS_GATE_STOP( "vips_tile_cache_gen: wait3" ); ++ VIPS_GATE_STOP("vips_tile_cache_gen: wait3"); + +- VIPS_DEBUG_MSG( "vips_tile_cache_gen: awake!\n" ); ++ VIPS_DEBUG_MSG("vips_tile_cache_gen: awake!\n"); + } + } + +- g_mutex_unlock( cache->lock ); ++ g_mutex_unlock(cache->lock); + +- return( result ); ++ return (result); + } + + static int +-vips_tile_cache_build( VipsObject *object ) ++vips_tile_cache_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsBlockCache *block_cache = (VipsBlockCache *) object; + VipsTileCache *cache = (VipsTileCache *) object; + +- VIPS_DEBUG_MSG( "vips_tile_cache_build\n" ); ++ VIPS_DEBUG_MSG("vips_tile_cache_build\n"); + +- if( VIPS_OBJECT_CLASS( vips_tile_cache_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_tile_cache_parent_class)->build(object)) ++ return (-1); + +- if( vips_image_pio_input( block_cache->in ) ) +- return( -1 ); ++ if (vips_image_pio_input(block_cache->in)) ++ return (-1); + +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_SMALLTILE, block_cache->in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_SMALLTILE, block_cache->in, NULL)) ++ return (-1); + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_tile_cache_gen, vips_stop_one, +- block_cache->in, cache ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_tile_cache_gen, vips_stop_one, ++ block_cache->in, cache)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_tile_cache_class_init( VipsTileCacheClass *class ) ++vips_tile_cache_class_init(VipsTileCacheClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_tile_cache_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_tile_cache_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "tilecache"; +- vobject_class->description = _( "cache an image as a set of tiles" ); ++ vobject_class->description = _("cache an image as a set of tiles"); + vobject_class->build = vips_tile_cache_build; + +- VIPS_ARG_INT( class, "tile_width", 3, +- _( "Tile width" ), +- _( "Tile width in pixels" ), ++ VIPS_ARG_INT(class, "tile_width", 3, ++ _("Tile width"), ++ _("Tile width in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsBlockCache, tile_width ), +- 1, 1000000, 128 ); ++ G_STRUCT_OFFSET(VipsBlockCache, tile_width), ++ 1, 1000000, 128); + +- VIPS_ARG_INT( class, "max_tiles", 5, +- _( "Max tiles" ), +- _( "Maximum number of tiles to cache" ), ++ VIPS_ARG_INT(class, "max_tiles", 5, ++ _("Max tiles"), ++ _("Maximum number of tiles to cache"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsBlockCache, max_tiles ), +- -1, 1000000, 1000 ); +- ++ G_STRUCT_OFFSET(VipsBlockCache, max_tiles), ++ -1, 1000000, 1000); + } + + static void +-vips_tile_cache_init( VipsTileCache *cache ) ++vips_tile_cache_init(VipsTileCache *cache) + { + } + +@@ -838,17 +842,17 @@ vips_tile_cache_init( VipsTileCache *cache ) + * * @persistent: don't drop cache at end of computation + * + * This operation behaves rather like vips_copy() between images +- * @in and @out, except that it keeps a cache of computed pixels. +- * This cache is made of up to @max_tiles tiles (a value of -1 ++ * @in and @out, except that it keeps a cache of computed pixels. ++ * This cache is made of up to @max_tiles tiles (a value of -1 + * means any number of tiles), and each tile is of size @tile_width +- * by @tile_height pixels. ++ * by @tile_height pixels. + * +- * Each cache tile is made with a single call to +- * vips_region_prepare(). ++ * Each cache tile is made with a single call to ++ * vips_region_prepare(). + * + * When the cache fills, a tile is chosen for reuse. If @access is +- * #VIPS_ACCESS_RANDOM, then the least-recently-used tile is reused. If +- * @access is #VIPS_ACCESS_SEQUENTIAL ++ * #VIPS_ACCESS_RANDOM, then the least-recently-used tile is reused. If ++ * @access is #VIPS_ACCESS_SEQUENTIAL + * the top-most tile is reused. + * + * By default, @tile_width and @tile_height are 128 pixels, and the operation +@@ -866,16 +870,16 @@ vips_tile_cache_init( VipsTileCache *cache ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_tilecache( VipsImage *in, VipsImage **out, ... ) ++vips_tilecache(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "tilecache", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("tilecache", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + typedef struct _VipsLineCache { +@@ -885,39 +889,38 @@ typedef struct _VipsLineCache { + + typedef VipsBlockCacheClass VipsLineCacheClass; + +-G_DEFINE_TYPE( VipsLineCache, vips_line_cache, VIPS_TYPE_BLOCK_CACHE ); ++G_DEFINE_TYPE(VipsLineCache, vips_line_cache, VIPS_TYPE_BLOCK_CACHE); + + static int +-vips_line_cache_gen( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_line_cache_gen(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsBlockCache *block_cache = (VipsBlockCache *) b; + +- VIPS_GATE_START( "vips_line_cache_gen: wait" ); ++ VIPS_GATE_START("vips_line_cache_gen: wait"); + +- vips__worker_lock( block_cache->lock ); ++ vips__worker_lock(block_cache->lock); + +- VIPS_GATE_STOP( "vips_line_cache_gen: wait" ); ++ VIPS_GATE_STOP("vips_line_cache_gen: wait"); + + /* We size up the cache to the largest request. + */ +- if( or->valid.height > +- block_cache->max_tiles * block_cache->tile_height ) { +- block_cache->max_tiles = ++ if (or->valid.height > block_cache->max_tiles * block_cache->tile_height) { ++ block_cache->max_tiles = + 1 + (or->valid.height / block_cache->tile_height); +- VIPS_DEBUG_MSG( "vips_line_cache_gen: bumped max_tiles to %d\n", +- block_cache->max_tiles ); ++ VIPS_DEBUG_MSG("vips_line_cache_gen: bumped max_tiles to %d\n", ++ block_cache->max_tiles); + } + +- g_mutex_unlock( block_cache->lock ); ++ g_mutex_unlock(block_cache->lock); + +- return( vips_tile_cache_gen( or, seq, a, b, stop ) ); ++ return (vips_tile_cache_gen(or, seq, a, b, stop)); + } + + static int +-vips_line_cache_build( VipsObject *object ) ++vips_line_cache_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsBlockCache *block_cache = (VipsBlockCache *) object; + VipsLineCache *cache = (VipsLineCache *) object; + +@@ -925,74 +928,73 @@ vips_line_cache_build( VipsObject *object ) + int tile_height; + int n_lines; + +- VIPS_DEBUG_MSG( "vips_line_cache_build\n" ); ++ VIPS_DEBUG_MSG("vips_line_cache_build\n"); + +- if( !vips_object_argument_isset( object, "access" ) ) ++ if (!vips_object_argument_isset(object, "access")) + block_cache->access = VIPS_ACCESS_SEQUENTIAL; + +- if( VIPS_OBJECT_CLASS( vips_line_cache_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_line_cache_parent_class)->build(object)) ++ return (-1); + + /* This can go up with request size, see vips_line_cache_gen(). + */ +- vips_get_tile_size( block_cache->in, +- &tile_width, &tile_height, &n_lines ); ++ vips_get_tile_size(block_cache->in, ++ &tile_width, &tile_height, &n_lines); + block_cache->tile_width = block_cache->in->Xsize; + + /* Output has two buffers n_lines height, so 2 * n_lines is the maximum +- * non-locality from threading. Double again for conv, rounding, etc. ++ * non-locality from threading. Double again for conv, rounding, etc. + * + * tile_height can be huge for things like tiff read, where we can + * have a whole strip in a single tile ... we still need to have a + * minimum of two strips, so we can handle requests that straddle a + * tile boundary. + */ +- block_cache->max_tiles = VIPS_MAX( 2, +- 4 * n_lines / block_cache->tile_height ); +- +- VIPS_DEBUG_MSG( "vips_line_cache_build: n_lines = %d\n", +- n_lines ); +- VIPS_DEBUG_MSG( "vips_line_cache_build: max_tiles = %d\n", +- block_cache->max_tiles ); +- VIPS_DEBUG_MSG( "vips_line_cache_build: tile_height = %d\n", +- block_cache->tile_height ); +- VIPS_DEBUG_MSG( "vips_line_cache_build: max size = %g MB\n", +- (block_cache->max_tiles * +- block_cache->tile_width * +- block_cache->tile_height * +- VIPS_IMAGE_SIZEOF_PEL( block_cache->in )) / (1024 * 1024.0) ); +- +- if( vips_image_pio_input( block_cache->in ) ) +- return( -1 ); +- +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, block_cache->in, NULL ) ) +- return( -1 ); +- +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_line_cache_gen, vips_stop_one, +- block_cache->in, cache ) ) +- return( -1 ); +- +- return( 0 ); ++ block_cache->max_tiles = VIPS_MAX(2, ++ 4 * n_lines / block_cache->tile_height); ++ ++ VIPS_DEBUG_MSG("vips_line_cache_build: n_lines = %d\n", ++ n_lines); ++ VIPS_DEBUG_MSG("vips_line_cache_build: max_tiles = %d\n", ++ block_cache->max_tiles); ++ VIPS_DEBUG_MSG("vips_line_cache_build: tile_height = %d\n", ++ block_cache->tile_height); ++ VIPS_DEBUG_MSG("vips_line_cache_build: max size = %g MB\n", ++ (block_cache->max_tiles * ++ block_cache->tile_width * ++ block_cache->tile_height * ++ VIPS_IMAGE_SIZEOF_PEL(block_cache->in)) / ++ (1024 * 1024.0)); ++ ++ if (vips_image_pio_input(block_cache->in)) ++ return (-1); ++ ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, block_cache->in, NULL)) ++ return (-1); ++ ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_line_cache_gen, vips_stop_one, ++ block_cache->in, cache)) ++ return (-1); ++ ++ return (0); + } + + static void +-vips_line_cache_class_init( VipsLineCacheClass *class ) ++vips_line_cache_class_init(VipsLineCacheClass *class) + { +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_line_cache_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_line_cache_class_init\n"); + + vobject_class->nickname = "linecache"; +- vobject_class->description = _( "cache an image as a set of lines" ); ++ vobject_class->description = _("cache an image as a set of lines"); + vobject_class->build = vips_line_cache_build; +- + } + + static void +-vips_line_cache_init( VipsLineCache *cache ) ++vips_line_cache_init(VipsLineCache *cache) + { + } + +@@ -1009,17 +1011,17 @@ vips_line_cache_init( VipsLineCache *cache ) + * * @threaded: allow many threads + * + * This operation behaves rather like vips_copy() between images +- * @in and @out, except that it keeps a cache of computed scanlines. ++ * @in and @out, except that it keeps a cache of computed scanlines. + * + * The number of lines cached is enough for a small amount of non-local +- * access. ++ * access. + * +- * Each cache tile is made with a single call to +- * vips_region_prepare(). ++ * Each cache tile is made with a single call to ++ * vips_region_prepare(). + * + * When the cache fills, a tile is chosen for reuse. If @access is +- * #VIPS_ACCESS_RANDOM, then the least-recently-used tile is reused. If +- * @access is #VIPS_ACCESS_SEQUENTIAL, then ++ * #VIPS_ACCESS_RANDOM, then the least-recently-used tile is reused. If ++ * @access is #VIPS_ACCESS_SEQUENTIAL, then + * the top-most tile is reused. @access defaults to #VIPS_ACCESS_RANDOM. + * + * @tile_height can be used to set the size of the strips that +@@ -1029,19 +1031,19 @@ vips_line_cache_init( VipsLineCache *cache ) + * you set @threaded to %TRUE, vips_linecache() will allow many threads to + * calculate tiles at once and share the cache between them. + * +- * See also: vips_cache(), vips_tilecache(). ++ * See also: vips_cache(), vips_tilecache(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_linecache( VipsImage *in, VipsImage **out, ... ) ++vips_linecache(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "linecache", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("linecache", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/transpose3d.c b/libvips/conversion/transpose3d.c +index 46d2a63b26..39b9518291 100644 +--- a/libvips/conversion/transpose3d.c ++++ b/libvips/conversion/transpose3d.c +@@ -1,33 +1,33 @@ + /* vips_transpose3d + * + * 30/4/18 +- * - from grid.c ++ * - from grid.c + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -55,26 +55,26 @@ typedef struct _VipsTranspose3d { + + typedef VipsConversionClass VipsTranspose3dClass; + +-G_DEFINE_TYPE( VipsTranspose3d, vips_transpose3d, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsTranspose3d, vips_transpose3d, VIPS_TYPE_CONVERSION); + + static int +-vips_transpose3d_gen( VipsRegion *or, void *vseq, void *a, void *b, +- gboolean *stop ) ++vips_transpose3d_gen(VipsRegion * or, void *vseq, void *a, void *b, ++ gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) vseq; + VipsImage *in = (VipsImage *) a; + VipsTranspose3d *transpose3d = (VipsTranspose3d *) b; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + + int output_page_height = in->Ysize / transpose3d->page_height; + + int y; + VipsRect tile; +- ++ + tile = *r; + tile.height = 1; + +- for( y = 0; y < r->height; y++ ) { ++ for (y = 0; y < r->height; y++) { + /* y in output. + */ + int yo = r->top + y; +@@ -99,88 +99,86 @@ vips_transpose3d_gen( VipsRegion *or, void *vseq, void *a, void *b, + + /* Render into or. + */ +- if( vips_region_prepare_to( ir, or, &tile, tile.left, yo ) ) +- return( -1 ); ++ if (vips_region_prepare_to(ir, or, &tile, tile.left, yo)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_transpose3d_build( VipsObject *object ) ++vips_transpose3d_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsTranspose3d *transpose3d = (VipsTranspose3d *) object; + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_transpose3d_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_transpose3d_parent_class)->build(object)) ++ return (-1); + + in = transpose3d->in; + +- if( vips_check_coding_known( class->nickname, in ) || +- vips_image_pio_input( in ) ) +- return( -1 ); ++ if (vips_check_coding_known(class->nickname, in) || ++ vips_image_pio_input(in)) ++ return (-1); + +- if( !vips_object_argument_isset( object, "page_height" ) ) { +- if( vips_image_get_int( in, +- VIPS_META_PAGE_HEIGHT, &transpose3d->page_height ) ) +- return( -1 ); ++ if (!vips_object_argument_isset(object, "page_height")) { ++ if (vips_image_get_int(in, ++ VIPS_META_PAGE_HEIGHT, &transpose3d->page_height)) ++ return (-1); + } + +- if( transpose3d->page_height <= 0 || +- in->Ysize % transpose3d->page_height != 0 ) { +- vips_error( class->nickname, "%s", _( "bad page_height" ) ); +- return( -1 ); ++ if (transpose3d->page_height <= 0 || ++ in->Ysize % transpose3d->page_height != 0) { ++ vips_error(class->nickname, "%s", _("bad page_height")); ++ return (-1); + } + +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_SMALLTILE, in, NULL ) ) +- return( -1 ); +- vips_image_set_int( conversion->out, +- VIPS_META_PAGE_HEIGHT, in->Ysize / transpose3d->page_height ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_SMALLTILE, in, NULL)) ++ return (-1); ++ vips_image_set_int(conversion->out, ++ VIPS_META_PAGE_HEIGHT, in->Ysize / transpose3d->page_height); + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_transpose3d_gen, vips_stop_one, +- in, transpose3d ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_transpose3d_gen, vips_stop_one, ++ in, transpose3d)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_transpose3d_class_init( VipsTranspose3dClass *class ) ++vips_transpose3d_class_init(VipsTranspose3dClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "transpose3d"; +- vobject_class->description = _( "transpose3d an image" ); ++ vobject_class->description = _("transpose3d an image"); + vobject_class->build = vips_transpose3d_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsTranspose3d, in ) ); ++ G_STRUCT_OFFSET(VipsTranspose3d, in)); + +- VIPS_ARG_INT( class, "page_height", 3, +- _( "Page height" ), +- _( "Height of each input page" ), ++ VIPS_ARG_INT(class, "page_height", 3, ++ _("Page height"), ++ _("Height of each input page"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsTranspose3d, page_height ), +- 0, 10000000, 0 ); +- ++ G_STRUCT_OFFSET(VipsTranspose3d, page_height), ++ 0, 10000000, 0); + } + + static void +-vips_transpose3d_init( VipsTranspose3d *transpose3d ) ++vips_transpose3d_init(VipsTranspose3d *transpose3d) + { + } + +@@ -194,33 +192,33 @@ vips_transpose3d_init( VipsTranspose3d *transpose3d ) + * + * * @page_height: %gint, size of each input page + * +- * Transpose a volumetric image. ++ * Transpose a volumetric image. + * + * Volumetric images are very tall, thin images, with the metadata item +- * #VIPS_META_PAGE_HEIGHT set to the height of each sub-image. ++ * #VIPS_META_PAGE_HEIGHT set to the height of each sub-image. + * + * This operation swaps the two major dimensions, so that page N in the + * output contains the Nth scanline, in order, from each input page. + * + * You can override the #VIPS_META_PAGE_HEIGHT metadata item with the optional +- * @page_height parameter. ++ * @page_height parameter. + * + * #VIPS_META_PAGE_HEIGHT in the output image is the number of pages in the +- * input image. ++ * input image. + * + * See also: vips_grid(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_transpose3d( VipsImage *in, VipsImage **out, ... ) ++vips_transpose3d(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "transpose3d", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("transpose3d", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/unpremultiply.c b/libvips/conversion/unpremultiply.c +index 2bab161a61..132b924440 100644 +--- a/libvips/conversion/unpremultiply.c ++++ b/libvips/conversion/unpremultiply.c +@@ -15,28 +15,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -72,274 +72,277 @@ typedef struct _VipsUnpremultiply { + + typedef VipsConversionClass VipsUnpremultiplyClass; + +-G_DEFINE_TYPE( VipsUnpremultiply, vips_unpremultiply, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsUnpremultiply, vips_unpremultiply, VIPS_TYPE_CONVERSION); + + /* Unpremultiply an N-band image. Don't use clip_alpha to calculate factor: we + * want over and undershoots on alpha and RGB to cancel. + */ +-#define UNPRE_MANY( IN, OUT ) { \ +- IN * restrict p = (IN *) in; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < width; x++ ) { \ +- IN alpha = p[alpha_band]; \ +- OUT factor = alpha == 0 ? 0 : max_alpha / alpha; \ +- \ +- for( i = 0; i < alpha_band; i++ ) \ +- q[i] = factor * p[i]; \ +- q[alpha_band] = VIPS_CLIP( 0, alpha, max_alpha ); \ +- for( i = alpha_band + 1; i < bands; i++ ) \ +- q[i] = p[i]; \ +- \ +- p += bands; \ +- q += bands; \ +- } \ +-} ++#define UNPRE_MANY(IN, OUT) \ ++ { \ ++ IN *restrict p = (IN *) in; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < width; x++) { \ ++ IN alpha = p[alpha_band]; \ ++ OUT factor = alpha == 0 ? 0 : max_alpha / alpha; \ ++\ ++ for (i = 0; i < alpha_band; i++) \ ++ q[i] = factor * p[i]; \ ++ q[alpha_band] = VIPS_CLIP(0, alpha, max_alpha); \ ++ for (i = alpha_band + 1; i < bands; i++) \ ++ q[i] = p[i]; \ ++\ ++ p += bands; \ ++ q += bands; \ ++ } \ ++ } + + /* Unpremultiply an RGB (four band) image. + */ +-#define UNPRE_RGBA( IN, OUT ) { \ +- IN * restrict p = (IN *) in; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < width; x++ ) { \ +- IN alpha = p[3]; \ +- OUT factor = alpha == 0 ? 0 : max_alpha / alpha; \ +- \ +- q[0] = factor * p[0]; \ +- q[1] = factor * p[1]; \ +- q[2] = factor * p[2]; \ +- q[3] = VIPS_CLIP( 0, alpha, max_alpha ); \ +- \ +- p += 4; \ +- q += 4; \ +- } \ +-} ++#define UNPRE_RGBA(IN, OUT) \ ++ { \ ++ IN *restrict p = (IN *) in; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < width; x++) { \ ++ IN alpha = p[3]; \ ++ OUT factor = alpha == 0 ? 0 : max_alpha / alpha; \ ++\ ++ q[0] = factor * p[0]; \ ++ q[1] = factor * p[1]; \ ++ q[2] = factor * p[2]; \ ++ q[3] = VIPS_CLIP(0, alpha, max_alpha); \ ++\ ++ p += 4; \ ++ q += 4; \ ++ } \ ++ } + +-#define UNPRE( IN, OUT ) { \ +- if( bands == 4 ) { \ +- UNPRE_RGBA( IN, OUT ); \ +- } \ +- else { \ +- UNPRE_MANY( IN, OUT ); \ +- } \ +-} ++#define UNPRE(IN, OUT) \ ++ { \ ++ if (bands == 4) { \ ++ UNPRE_RGBA(IN, OUT); \ ++ } \ ++ else { \ ++ UNPRE_MANY(IN, OUT); \ ++ } \ ++ } + + /* For float-style images, we need to check for alpha near zero, or we'll get + * +/- Inf in the output. + */ +-#define FUNPRE_MANY( IN, OUT ) { \ +- IN * restrict p = (IN *) in; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < width; x++ ) { \ +- IN alpha = p[alpha_band]; \ +- OUT factor = VIPS_ABS( alpha ) < 0.01 ? 0 : max_alpha / alpha; \ +- \ +- for( i = 0; i < alpha_band; i++ ) \ +- q[i] = factor * p[i]; \ +- q[alpha_band] = VIPS_CLIP( 0, alpha, max_alpha ); \ +- for( i = alpha_band + 1; i < bands; i++ ) \ +- q[i] = p[i]; \ +- \ +- p += bands; \ +- q += bands; \ +- } \ +-} ++#define FUNPRE_MANY(IN, OUT) \ ++ { \ ++ IN *restrict p = (IN *) in; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < width; x++) { \ ++ IN alpha = p[alpha_band]; \ ++ OUT factor = VIPS_ABS(alpha) < 0.01 ? 0 : max_alpha / alpha; \ ++\ ++ for (i = 0; i < alpha_band; i++) \ ++ q[i] = factor * p[i]; \ ++ q[alpha_band] = VIPS_CLIP(0, alpha, max_alpha); \ ++ for (i = alpha_band + 1; i < bands; i++) \ ++ q[i] = p[i]; \ ++\ ++ p += bands; \ ++ q += bands; \ ++ } \ ++ } + +-#define FUNPRE_RGBA( IN, OUT ) { \ +- IN * restrict p = (IN *) in; \ +- OUT * restrict q = (OUT *) out; \ +- \ +- for( x = 0; x < width; x++ ) { \ +- IN alpha = p[3]; \ +- OUT factor = VIPS_ABS( alpha ) < 0.01 ? 0 : max_alpha / alpha; \ +- \ +- q[0] = factor * p[0]; \ +- q[1] = factor * p[1]; \ +- q[2] = factor * p[2]; \ +- q[3] = VIPS_CLIP( 0, alpha, max_alpha ); \ +- \ +- p += 4; \ +- q += 4; \ +- } \ +-} ++#define FUNPRE_RGBA(IN, OUT) \ ++ { \ ++ IN *restrict p = (IN *) in; \ ++ OUT *restrict q = (OUT *) out; \ ++\ ++ for (x = 0; x < width; x++) { \ ++ IN alpha = p[3]; \ ++ OUT factor = VIPS_ABS(alpha) < 0.01 ? 0 : max_alpha / alpha; \ ++\ ++ q[0] = factor * p[0]; \ ++ q[1] = factor * p[1]; \ ++ q[2] = factor * p[2]; \ ++ q[3] = VIPS_CLIP(0, alpha, max_alpha); \ ++\ ++ p += 4; \ ++ q += 4; \ ++ } \ ++ } + +-#define FUNPRE( IN, OUT ) { \ +- if( bands == 4 ) { \ +- FUNPRE_RGBA( IN, OUT ); \ +- } \ +- else { \ +- FUNPRE_MANY( IN, OUT ); \ +- } \ +-} ++#define FUNPRE(IN, OUT) \ ++ { \ ++ if (bands == 4) { \ ++ FUNPRE_RGBA(IN, OUT); \ ++ } \ ++ else { \ ++ FUNPRE_MANY(IN, OUT); \ ++ } \ ++ } + + static int +-vips_unpremultiply_gen( VipsRegion *or, void *vseq, void *a, void *b, +- gboolean *stop ) ++vips_unpremultiply_gen(VipsRegion * or, void *vseq, void *a, void *b, ++ gboolean *stop) + { + VipsUnpremultiply *unpremultiply = (VipsUnpremultiply *) b; + VipsRegion *ir = (VipsRegion *) vseq; + VipsImage *im = ir->im; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int width = r->width; +- int bands = im->Bands; ++ int bands = im->Bands; + double max_alpha = unpremultiply->max_alpha; + int alpha_band = unpremultiply->alpha_band; + + int x, y, i; + +- if( vips_region_prepare( ir, r ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, r)) ++ return (-1); + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *in = VIPS_REGION_ADDR( ir, r->left, r->top + y ); +- VipsPel *out = VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *in = VIPS_REGION_ADDR(ir, r->left, r->top + y); ++ VipsPel *out = VIPS_REGION_ADDR(or, r->left, r->top + y); + +- switch( im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- UNPRE( unsigned char, float ); +- break; ++ switch (im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ UNPRE(unsigned char, float); ++ break; + +- case VIPS_FORMAT_CHAR: +- UNPRE( signed char, float ); +- break; ++ case VIPS_FORMAT_CHAR: ++ UNPRE(signed char, float); ++ break; + +- case VIPS_FORMAT_USHORT: +- UNPRE( unsigned short, float ); +- break; ++ case VIPS_FORMAT_USHORT: ++ UNPRE(unsigned short, float); ++ break; + +- case VIPS_FORMAT_SHORT: +- UNPRE( signed short, float ); +- break; ++ case VIPS_FORMAT_SHORT: ++ UNPRE(signed short, float); ++ break; + +- case VIPS_FORMAT_UINT: +- UNPRE( unsigned int, float ); +- break; ++ case VIPS_FORMAT_UINT: ++ UNPRE(unsigned int, float); ++ break; + +- case VIPS_FORMAT_INT: +- UNPRE( signed int, float ); +- break; ++ case VIPS_FORMAT_INT: ++ UNPRE(signed int, float); ++ break; + +- case VIPS_FORMAT_FLOAT: +- FUNPRE( float, float ); +- break; ++ case VIPS_FORMAT_FLOAT: ++ FUNPRE(float, float); ++ break; + +- case VIPS_FORMAT_DOUBLE: +- FUNPRE( double, double ); +- break; ++ case VIPS_FORMAT_DOUBLE: ++ FUNPRE(double, double); ++ break; + +- case VIPS_FORMAT_COMPLEX: +- case VIPS_FORMAT_DPCOMPLEX: +- default: +- g_assert_not_reached(); +- } ++ case VIPS_FORMAT_COMPLEX: ++ case VIPS_FORMAT_DPCOMPLEX: ++ default: ++ g_assert_not_reached(); ++ } + } + +- return( 0 ); ++ return (0); + } + +- + static int +-vips_unpremultiply_build( VipsObject *object ) ++vips_unpremultiply_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsUnpremultiply *unpremultiply = (VipsUnpremultiply *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 1 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 1); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_unpremultiply_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_unpremultiply_parent_class)->build(object)) ++ return (-1); + +- in = unpremultiply->in; ++ in = unpremultiply->in; + +- if( vips_image_decode( in, &t[0] ) ) +- return( -1 ); +- in = t[0]; ++ if (vips_image_decode(in, &t[0])) ++ return (-1); ++ in = t[0]; + + /* Trivial case: fall back to copy(). + */ +- if( in->Bands == 1 ) +- return( vips_image_write( in, conversion->out ) ); ++ if (in->Bands == 1) ++ return (vips_image_write(in, conversion->out)); + +- if( vips_check_noncomplex( class->nickname, in ) ) +- return( -1 ); ++ if (vips_check_noncomplex(class->nickname, in)) ++ return (-1); + +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_THINSTRIP, in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, in, NULL)) ++ return (-1); + + /* Is max-alpha unset? Default to the correct value for this + * interpretation. + */ +- if( !vips_object_argument_isset( object, "max_alpha" ) ) +- if( in->Type == VIPS_INTERPRETATION_GREY16 || +- in->Type == VIPS_INTERPRETATION_RGB16 ) ++ if (!vips_object_argument_isset(object, "max_alpha")) ++ if (in->Type == VIPS_INTERPRETATION_GREY16 || ++ in->Type == VIPS_INTERPRETATION_RGB16) + unpremultiply->max_alpha = 65535; + +- /* Is alpha-band unset? Default to the final band for this image. ++ /* Is alpha-band unset? Default to the final band for this image. + */ +- if( !vips_object_argument_isset( object, "alpha_band" ) ) ++ if (!vips_object_argument_isset(object, "alpha_band")) + unpremultiply->alpha_band = in->Bands - 1; + +- if( in->BandFmt == VIPS_FORMAT_DOUBLE ) ++ if (in->BandFmt == VIPS_FORMAT_DOUBLE) + conversion->out->BandFmt = VIPS_FORMAT_DOUBLE; + else + conversion->out->BandFmt = VIPS_FORMAT_FLOAT; + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_unpremultiply_gen, vips_stop_one, +- in, unpremultiply ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_unpremultiply_gen, vips_stop_one, ++ in, unpremultiply)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_unpremultiply_class_init( VipsUnpremultiplyClass *class ) ++vips_unpremultiply_class_init(VipsUnpremultiplyClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_unpremultiply_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_unpremultiply_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "unpremultiply"; +- vobject_class->description = _( "unpremultiply image alpha" ); ++ vobject_class->description = _("unpremultiply image alpha"); + vobject_class->build = vips_unpremultiply_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsUnpremultiply, in ) ); ++ G_STRUCT_OFFSET(VipsUnpremultiply, in)); + +- VIPS_ARG_DOUBLE( class, "max_alpha", 115, +- _( "Maximum alpha" ), +- _( "Maximum value of alpha channel" ), ++ VIPS_ARG_DOUBLE(class, "max_alpha", 115, ++ _("Maximum alpha"), ++ _("Maximum value of alpha channel"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsUnpremultiply, max_alpha ), +- 0, 100000000, 255 ); ++ G_STRUCT_OFFSET(VipsUnpremultiply, max_alpha), ++ 0, 100000000, 255); + +- VIPS_ARG_INT( class, "alpha_band", 116, +- _( "Alpha band" ), +- _( "Unpremultiply with this alpha" ), ++ VIPS_ARG_INT(class, "alpha_band", 116, ++ _("Alpha band"), ++ _("Unpremultiply with this alpha"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsUnpremultiply, alpha_band ), +- 0, 100000000, 3 ); +- ++ G_STRUCT_OFFSET(VipsUnpremultiply, alpha_band), ++ 0, 100000000, 3); + } + + static void +-vips_unpremultiply_init( VipsUnpremultiply *unpremultiply ) ++vips_unpremultiply_init(VipsUnpremultiply *unpremultiply) + { + unpremultiply->max_alpha = 255.0; + } +@@ -355,21 +358,21 @@ vips_unpremultiply_init( VipsUnpremultiply *unpremultiply ) + * * @max_alpha: %gdouble, maximum value for alpha + * * @alpha_band: %gint, band containing alpha data + * +- * Unpremultiplies any alpha channel. +- * Band @alpha_band (by default the final band) contains the alpha and all ++ * Unpremultiplies any alpha channel. ++ * Band @alpha_band (by default the final band) contains the alpha and all + * other bands are transformed as: + * + * |[ +- * alpha = (int) clip( 0, in[in.bands - 1], @max_alpha ); +- * norm = (double) alpha / @max_alpha; ++ * alpha = (int) clip( 0, in[in.bands - 1], @max_alpha ); ++ * norm = (double) alpha / @max_alpha; + * if( alpha == 0 ) + * out = [0, ..., 0, alpha]; + * else + * out = [in[0] / norm, ..., in[in.bands - 1] / norm, alpha]; + * ]| + * +- * So for an N-band image, the first N - 1 bands are divided by the clipped +- * and normalised final band, the final band is clipped. ++ * So for an N-band image, the first N - 1 bands are divided by the clipped ++ * and normalised final band, the final band is clipped. + * If there is only a single band, the image is passed through unaltered. + * + * The result is +@@ -378,7 +381,7 @@ vips_unpremultiply_init( VipsUnpremultiply *unpremultiply ) + * + * @max_alpha has the default value 255, or 65535 for images tagged as + * #VIPS_INTERPRETATION_RGB16 or +- * #VIPS_INTERPRETATION_GREY16. ++ * #VIPS_INTERPRETATION_GREY16. + * + * Non-complex images only. + * +@@ -387,14 +390,14 @@ vips_unpremultiply_init( VipsUnpremultiply *unpremultiply ) + * Returns: 0 on success, -1 on error + */ + int +-vips_unpremultiply( VipsImage *in, VipsImage **out, ... ) ++vips_unpremultiply(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "unpremultiply", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("unpremultiply", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/conversion/wrap.c b/libvips/conversion/wrap.c +index ab92b362d3..80298b0a49 100644 +--- a/libvips/conversion/wrap.c ++++ b/libvips/conversion/wrap.c +@@ -6,7 +6,7 @@ + * 2/2/10 + * - rewritten in terms of im_replicate()/im_extract_area() + * - gtkdoc +- * - allows any x/y ++ * - allows any x/y + * 31/5/13 + * - redone as a class + * - added rotquad behaviour if x/y not set +@@ -14,28 +14,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -60,85 +60,80 @@ typedef struct _VipsWrap { + + typedef VipsConversionClass VipsWrapClass; + +-G_DEFINE_TYPE( VipsWrap, vips_wrap, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsWrap, vips_wrap, VIPS_TYPE_CONVERSION); + + static int +-vips_wrap_build( VipsObject *object ) ++vips_wrap_build(VipsObject *object) + { +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsWrap *wrap = (VipsWrap *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 7 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 7); + + int x; + int y; + +- if( VIPS_OBJECT_CLASS( vips_wrap_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_wrap_parent_class)->build(object)) ++ return (-1); + +- if( !vips_object_argument_isset( object, "x" ) ) ++ if (!vips_object_argument_isset(object, "x")) + wrap->x = wrap->in->Xsize / 2; +- if( !vips_object_argument_isset( object, "y" ) ) ++ if (!vips_object_argument_isset(object, "y")) + wrap->y = wrap->in->Ysize / 2; + + /* Clock arithmetic: we want negative x/y to wrap around + * nicely. + */ +- x = wrap->x < 0 ? +- -wrap->x % wrap->in->Xsize : +- wrap->in->Xsize - wrap->x % wrap->in->Xsize; +- y = wrap->y < 0 ? +- -wrap->y % wrap->in->Ysize : +- wrap->in->Ysize - wrap->y % wrap->in->Ysize; +- +- if( vips_replicate( wrap->in, &t[0], 2, 2, NULL ) || +- vips_extract_area( t[0], &t[1], +- x, y, wrap->in->Xsize, wrap->in->Ysize, NULL ) || +- vips_image_write( t[1], conversion->out ) ) +- return( -1 ); ++ x = wrap->x < 0 ? -wrap->x % wrap->in->Xsize : wrap->in->Xsize - wrap->x % wrap->in->Xsize; ++ y = wrap->y < 0 ? -wrap->y % wrap->in->Ysize : wrap->in->Ysize - wrap->y % wrap->in->Ysize; ++ ++ if (vips_replicate(wrap->in, &t[0], 2, 2, NULL) || ++ vips_extract_area(t[0], &t[1], ++ x, y, wrap->in->Xsize, wrap->in->Ysize, NULL) || ++ vips_image_write(t[1], conversion->out)) ++ return (-1); + + conversion->out->Xoffset = x; + conversion->out->Yoffset = y; + +- return( 0 ); ++ return (0); + } + + static void +-vips_wrap_class_init( VipsWrapClass *class ) ++vips_wrap_class_init(VipsWrapClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "wrap"; +- vobject_class->description = _( "wrap image origin" ); ++ vobject_class->description = _("wrap image origin"); + vobject_class->build = vips_wrap_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsWrap, in ) ); ++ G_STRUCT_OFFSET(VipsWrap, in)); + +- VIPS_ARG_INT( class, "x", 3, +- _( "x" ), +- _( "Left edge of input in output" ), ++ VIPS_ARG_INT(class, "x", 3, ++ _("x"), ++ _("Left edge of input in output"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsWrap, x ), +- -VIPS_MAX_COORD, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsWrap, x), ++ -VIPS_MAX_COORD, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "y", 4, +- _( "y" ), +- _( "Top edge of input in output" ), ++ VIPS_ARG_INT(class, "y", 4, ++ _("y"), ++ _("Top edge of input in output"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsWrap, y ), +- -VIPS_MAX_COORD, VIPS_MAX_COORD, 0 ); +- ++ G_STRUCT_OFFSET(VipsWrap, y), ++ -VIPS_MAX_COORD, VIPS_MAX_COORD, 0); + } + + static void +-vips_wrap_init( VipsWrap *wrap ) ++vips_wrap_init(VipsWrap *wrap) + { + } + +@@ -155,22 +150,21 @@ vips_wrap_init( VipsWrap *wrap ) + * + * Slice an image up and move the segments about so that the pixel that was + * at 0, 0 is now at @x, @y. If @x and @y are not set, they default to the +- * centre of the image. ++ * centre of the image. + * + * See also: vips_embed(), vips_replicate(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_wrap( VipsImage *in, VipsImage **out, ... ) ++vips_wrap(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "wrap", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("wrap", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/conversion/zoom.c b/libvips/conversion/zoom.c +index b5825f469a..4d80ca235e 100644 +--- a/libvips/conversion/zoom.c ++++ b/libvips/conversion/zoom.c +@@ -13,7 +13,7 @@ + * 30/8/96 JC + * - sets demand_hint + * 10/2/00 JC +- * - check for integer overflow in zoom facs ... was happening with ip's ++ * - check for integer overflow in zoom facs ... was happening with ip's + * zoom on large images + * 3/8/02 JC + * - fall back to im_copy() for x & y factors == 1 +@@ -27,33 +27,33 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +-/* +-#define DEBUG ++/* ++#define DEBUG + #define DEBUG_VERBOSE + */ + +@@ -78,23 +78,23 @@ typedef struct _VipsZoom { + */ + VipsImage *in; + +- int xfac; /* Scale factors */ ++ int xfac; /* Scale factors */ + int yfac; + + } VipsZoom; + + typedef VipsConversionClass VipsZoomClass; + +-G_DEFINE_TYPE( VipsZoom, vips_zoom, VIPS_TYPE_CONVERSION ); ++G_DEFINE_TYPE(VipsZoom, vips_zoom, VIPS_TYPE_CONVERSION); + + /* Paint the part of the region containing only whole pels. + */ + static void +-vips_zoom_paint_whole( VipsRegion *or, VipsRegion *ir, VipsZoom *zoom, +- const int left, const int right, const int top, const int bottom ) ++vips_zoom_paint_whole(VipsRegion * or, VipsRegion *ir, VipsZoom *zoom, ++ const int left, const int right, const int top, const int bottom) + { +- const int ps = VIPS_IMAGE_SIZEOF_PEL( ir->im ); +- const int ls = VIPS_REGION_LSKIP( or ); ++ const int ps = VIPS_IMAGE_SIZEOF_PEL(ir->im); ++ const int ls = VIPS_REGION_LSKIP(or); + const int rs = ps * (right - left); + + /* Transform to ir coordinates. +@@ -108,27 +108,27 @@ vips_zoom_paint_whole( VipsRegion *or, VipsRegion *ir, VipsZoom *zoom, + + /* We know this! + */ +- g_assert( right > left && bottom > top && ++ g_assert(right > left && bottom > top && + right % zoom->xfac == 0 && + left % zoom->xfac == 0 && + top % zoom->yfac == 0 && +- bottom % zoom->yfac == 0 ); ++ bottom % zoom->yfac == 0); + + /* Loop over input, as we know we are all whole. + */ +- for( y = itop; y < ibottom; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( ir, ileft, y ); +- VipsPel *q = VIPS_REGION_ADDR( or, left, y * zoom->yfac ); ++ for (y = itop; y < ibottom; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(ir, ileft, y); ++ VipsPel *q = VIPS_REGION_ADDR(or, left, y * zoom->yfac); + VipsPel *r; + + /* Expand the first line of pels. + */ + r = q; +- for( x = ileft; x < iright; x++ ) { ++ for (x = ileft; x < iright; x++) { + /* Copy each pel xfac times. + */ +- for( z = 0; z < zoom->xfac; z++ ) { +- for( i = 0; i < ps; i++ ) ++ for (z = 0; z < zoom->xfac; z++) { ++ for (i = 0; i < ps; i++) + r[i] = p[i]; + + r += ps; +@@ -140,8 +140,8 @@ vips_zoom_paint_whole( VipsRegion *or, VipsRegion *ir, VipsZoom *zoom, + /* Copy the expanded line yfac-1 times. + */ + r = q + ls; +- for( z = 1; z < zoom->yfac; z++ ) { +- memcpy( r, q, rs ); ++ for (z = 1; z < zoom->yfac; z++) { ++ memcpy(r, q, rs); + r += ls; + } + } +@@ -150,11 +150,11 @@ vips_zoom_paint_whole( VipsRegion *or, VipsRegion *ir, VipsZoom *zoom, + /* Paint the part of the region containing only part-pels. + */ + static void +-vips_zoom_paint_part( VipsRegion *or, VipsRegion *ir, VipsZoom *zoom, +- const int left, const int right, const int top, const int bottom ) ++vips_zoom_paint_part(VipsRegion * or, VipsRegion *ir, VipsZoom *zoom, ++ const int left, const int right, const int top, const int bottom) + { +- const int ps = VIPS_IMAGE_SIZEOF_PEL( ir->im ); +- const int ls = VIPS_REGION_LSKIP( or ); ++ const int ps = VIPS_IMAGE_SIZEOF_PEL(ir->im); ++ const int ls = VIPS_REGION_LSKIP(or); + const int rs = ps * (right - left); + + /* Start position in input. +@@ -168,19 +168,19 @@ vips_zoom_paint_part( VipsRegion *or, VipsRegion *ir, VipsZoom *zoom, + const int ptbound = (iy + 1) * zoom->yfac - top; + const int ptbot = bottom - top; + +- int yt = VIPS_MIN( ptbound, ptbot ); ++ int yt = VIPS_MIN(ptbound, ptbot); + + int x, y, z, i; + + /* Only know this. + */ +- g_assert( right - left >= 0 && bottom - top >= 0 ); ++ g_assert(right - left >= 0 && bottom - top >= 0); + + /* Have to loop over output. + */ +- for( y = top; y < bottom; ) { +- VipsPel *p = VIPS_REGION_ADDR( ir, ix, y / zoom->yfac ); +- VipsPel *q = VIPS_REGION_ADDR( or, left, y ); ++ for (y = top; y < bottom;) { ++ VipsPel *p = VIPS_REGION_ADDR(ir, ix, y / zoom->yfac); ++ VipsPel *q = VIPS_REGION_ADDR(or, left, y); + VipsPel *r; + + /* Output pels until we jump the input pointer. +@@ -190,17 +190,17 @@ vips_zoom_paint_part( VipsRegion *or, VipsRegion *ir, VipsZoom *zoom, + /* Loop for this output line. + */ + r = q; +- for( x = left; x < right; x++ ) { ++ for (x = left; x < right; x++) { + /* Copy 1 pel. + */ +- for( i = 0; i < ps; i++ ) ++ for (i = 0; i < ps; i++) + r[i] = p[i]; + r += ps; + + /* Move input if on boundary. + */ + --xt; +- if( xt == 0 ) { ++ if (xt == 0) { + xt = zoom->xfac; + p += ps; + } +@@ -210,8 +210,8 @@ vips_zoom_paint_part( VipsRegion *or, VipsRegion *ir, VipsZoom *zoom, + * boundary, or we hit bottom. + */ + r = q + ls; +- for( z = 1; z < yt; z++ ) { +- memcpy( r, q, rs ); ++ for (z = 1; z < yt; z++) { ++ memcpy(r, q, rs); + r += ls; + } + +@@ -228,15 +228,15 @@ vips_zoom_paint_part( VipsRegion *or, VipsRegion *ir, VipsZoom *zoom, + /* Zoom a VipsRegion. + */ + static int +-vips_zoom_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop ) ++vips_zoom_gen(VipsRegion * or, void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + VipsZoom *zoom = (VipsZoom *) b; + + /* Output area we are building. + */ +- const VipsRect *r = &or->valid; +- const int ri = VIPS_RECT_RIGHT( r ); ++ const VipsRect *r = & or->valid; ++ const int ri = VIPS_RECT_RIGHT(r); + const int bo = VIPS_RECT_BOTTOM(r); + + VipsRect s; +@@ -244,154 +244,153 @@ vips_zoom_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop ) + int width, height; + + #ifdef DEBUG_VERBOSE +- printf( "vips_zoom_gen: left=%d, top=%d, width=%d, height=%d\n", +- r->left, r->top, r->width, r->height ); ++ printf("vips_zoom_gen: left=%d, top=%d, width=%d, height=%d\n", ++ r->left, r->top, r->width, r->height); + #endif /*DEBUG_VERBOSE*/ + + /* Area of input we need. We have to round out, as we may have + * part-pixels all around the edges. + */ +- left = VIPS_ROUND_DOWN( r->left, zoom->xfac ); +- right = VIPS_ROUND_UP( ri, zoom->xfac ); +- top = VIPS_ROUND_DOWN( r->top, zoom->yfac ); +- bottom = VIPS_ROUND_UP( bo, zoom->yfac ); ++ left = VIPS_ROUND_DOWN(r->left, zoom->xfac); ++ right = VIPS_ROUND_UP(ri, zoom->xfac); ++ top = VIPS_ROUND_DOWN(r->top, zoom->yfac); ++ bottom = VIPS_ROUND_UP(bo, zoom->yfac); + width = right - left; + height = bottom - top; + s.left = left / zoom->xfac; + s.top = top / zoom->yfac; + s.width = width / zoom->xfac; + s.height = height / zoom->yfac; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); +- ++ if (vips_region_prepare(ir, &s)) ++ return (-1); ++ + /* Find the part of the output (if any) which uses only whole pels. + */ +- left = VIPS_ROUND_UP( r->left, zoom->xfac ); +- right = VIPS_ROUND_DOWN( ri, zoom->xfac ); +- top = VIPS_ROUND_UP( r->top, zoom->yfac ); +- bottom = VIPS_ROUND_DOWN( bo, zoom->yfac ); ++ left = VIPS_ROUND_UP(r->left, zoom->xfac); ++ right = VIPS_ROUND_DOWN(ri, zoom->xfac); ++ top = VIPS_ROUND_UP(r->top, zoom->yfac); ++ bottom = VIPS_ROUND_DOWN(bo, zoom->yfac); + width = right - left; + height = bottom - top; + + /* Stage 1: we just paint the whole pels in the centre of the region. + * As we know they are not clipped, we can do it quickly. + */ +- if( width > 0 && height > 0 ) +- vips_zoom_paint_whole( or, ir, zoom, left, right, top, bottom ); ++ if (width > 0 && height > 0) ++ vips_zoom_paint_whole(or, ir, zoom, left, right, top, bottom); + + /* Just fractional pixels left. Paint in the top, left, right and + * bottom parts. + */ +- if( top - r->top > 0 ) ++ if (top - r->top > 0) + /* Some top pixels. + */ +- vips_zoom_paint_part( or, ir, zoom, +- r->left, ri, r->top, VIPS_MIN( top, bo ) ); +- if( left - r->left > 0 && height > 0 ) ++ vips_zoom_paint_part(or, ir, zoom, ++ r->left, ri, r->top, VIPS_MIN(top, bo)); ++ if (left - r->left > 0 && height > 0) + /* Left pixels. + */ +- vips_zoom_paint_part( or, ir, zoom, +- r->left, VIPS_MIN( left, ri ), top, bottom ); +- if( ri - right > 0 && height > 0 ) ++ vips_zoom_paint_part(or, ir, zoom, ++ r->left, VIPS_MIN(left, ri), top, bottom); ++ if (ri - right > 0 && height > 0) + /* Right pixels. + */ +- vips_zoom_paint_part( or, ir, zoom, +- VIPS_MAX( right, r->left ), ri, top, bottom ); +- if( bo - bottom > 0 && height >= 0 ) ++ vips_zoom_paint_part(or, ir, zoom, ++ VIPS_MAX(right, r->left), ri, top, bottom); ++ if (bo - bottom > 0 && height >= 0) + /* Bottom pixels. + */ +- vips_zoom_paint_part( or, ir, zoom, +- r->left, ri, VIPS_MAX( bottom, r->top ), bo ); ++ vips_zoom_paint_part(or, ir, zoom, ++ r->left, ri, VIPS_MAX(bottom, r->top), bo); + +- return( 0 ); ++ return (0); + } + + static int +-vips_zoom_build( VipsObject *object ) ++vips_zoom_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConversion *conversion = VIPS_CONVERSION( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConversion *conversion = VIPS_CONVERSION(object); + VipsZoom *zoom = (VipsZoom *) object; + +- if( VIPS_OBJECT_CLASS( vips_zoom_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_zoom_parent_class)->build(object)) ++ return (-1); ++ ++ g_assert(zoom->xfac > 0); ++ g_assert(zoom->yfac > 0); + +- g_assert( zoom->xfac > 0 ); +- g_assert( zoom->yfac > 0 ); +- + /* Make sure we won't get integer overflow. + */ +- if( (double) zoom->in->Xsize * zoom->xfac > (double) INT_MAX / 2 || +- (double) zoom->in->Ysize * zoom->yfac > (double) INT_MAX / 2 ) { +- vips_error( class->nickname, +- "%s", _( "zoom factors too large" ) ); +- return( -1 ); ++ if ((double) zoom->in->Xsize * zoom->xfac > (double) INT_MAX / 2 || ++ (double) zoom->in->Ysize * zoom->yfac > (double) INT_MAX / 2) { ++ vips_error(class->nickname, ++ "%s", _("zoom factors too large")); ++ return (-1); + } +- if( zoom->xfac == 1 && +- zoom->yfac == 1 ) +- return( vips_image_write( zoom->in, conversion->out ) ); ++ if (zoom->xfac == 1 && ++ zoom->yfac == 1) ++ return (vips_image_write(zoom->in, conversion->out)); + +- if( vips_image_pio_input( zoom->in ) || +- vips_check_coding_known( class->nickname, zoom->in ) ) +- return( -1 ); ++ if (vips_image_pio_input(zoom->in) || ++ vips_check_coding_known(class->nickname, zoom->in)) ++ return (-1); + + /* Set demand hints. THINSTRIP will prevent us from using + * vips_zoom_paint_whole() much ... so go for FATSTRIP. + */ +- if( vips_image_pipelinev( conversion->out, +- VIPS_DEMAND_STYLE_FATSTRIP, zoom->in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(conversion->out, ++ VIPS_DEMAND_STYLE_FATSTRIP, zoom->in, NULL)) ++ return (-1); + conversion->out->Xsize = zoom->in->Xsize * zoom->xfac; + conversion->out->Ysize = zoom->in->Ysize * zoom->yfac; + +- if( vips_image_generate( conversion->out, +- vips_start_one, vips_zoom_gen, vips_stop_one, +- zoom->in, zoom ) ) +- return( -1 ); ++ if (vips_image_generate(conversion->out, ++ vips_start_one, vips_zoom_gen, vips_stop_one, ++ zoom->in, zoom)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_zoom_class_init( VipsZoomClass *class ) ++vips_zoom_class_init(VipsZoomClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "zoom"; +- vobject_class->description = _( "zoom an image" ); ++ vobject_class->description = _("zoom an image"); + vobject_class->build = vips_zoom_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "input", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "input", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsZoom, in ) ); ++ G_STRUCT_OFFSET(VipsZoom, in)); + +- VIPS_ARG_INT( class, "xfac", 3, +- _( "Xfac" ), +- _( "Horizontal zoom factor" ), ++ VIPS_ARG_INT(class, "xfac", 3, ++ _("Xfac"), ++ _("Horizontal zoom factor"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsZoom, xfac ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsZoom, xfac), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "yfac", 4, +- _( "Yfac" ), +- _( "Vertical zoom factor" ), ++ VIPS_ARG_INT(class, "yfac", 4, ++ _("Yfac"), ++ _("Vertical zoom factor"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsZoom, yfac ), +- 1, VIPS_MAX_COORD, 1 ); +- ++ G_STRUCT_OFFSET(VipsZoom, yfac), ++ 1, VIPS_MAX_COORD, 1); + } + + static void +-vips_zoom_init( VipsZoom *zoom ) ++vips_zoom_init(VipsZoom *zoom) + { + } + +@@ -407,18 +406,18 @@ vips_zoom_init( VipsZoom *zoom ) + * zoom. + * + * See also: vips_affine(), vips_subsample(). +- * ++ * + * Returns: 0 on success, -1 on error. + */ + int +-vips_zoom( VipsImage *in, VipsImage **out, int xfac, int yfac, ... ) ++vips_zoom(VipsImage *in, VipsImage **out, int xfac, int yfac, ...) + { + va_list ap; + int result; + +- va_start( ap, yfac ); +- result = vips_call_split( "zoom", ap, in, out, xfac, yfac ); +- va_end( ap ); ++ va_start(ap, yfac); ++ result = vips_call_split("zoom", ap, in, out, xfac, yfac); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/convolution/canny.c b/libvips/convolution/canny.c +index 3bd446eaef..e4944c912d 100644 +--- a/libvips/convolution/canny.c ++++ b/libvips/convolution/canny.c +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -49,8 +49,8 @@ typedef struct _VipsCanny { + VipsImage *in; + VipsImage *out; + +- double sigma; +- VipsPrecision precision; ++ double sigma; ++ VipsPrecision precision; + + /* Need an image vector for start_many. + */ +@@ -59,232 +59,237 @@ typedef struct _VipsCanny { + + typedef VipsOperationClass VipsCannyClass; + +-G_DEFINE_TYPE( VipsCanny, vips_canny, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsCanny, vips_canny, VIPS_TYPE_OPERATION); + + /* Simple 2x2 -1/+1 difference. For uchar, we try to hit the vector path and + * use an offset rather than -ves. Otherwise it's float or double output. + */ + static int +-vips_canny_gradient( VipsImage *in, VipsImage **Gx, VipsImage **Gy ) ++vips_canny_gradient(VipsImage *in, VipsImage **Gx, VipsImage **Gy) + { + VipsImage *scope; + VipsImage **t; + VipsPrecision precision; + + scope = vips_image_new(); +- t = (VipsImage **) vips_object_local_array( (VipsObject *) scope, 2 ); ++ t = (VipsImage **) vips_object_local_array((VipsObject *) scope, 2); + +- t[0] = vips_image_new_matrixv( 2, 2, ++ t[0] = vips_image_new_matrixv(2, 2, + -1.0, 1.0, +- -1.0, 1.0 ); ++ -1.0, 1.0); + +- if( in->BandFmt == VIPS_FORMAT_UCHAR ) { ++ if (in->BandFmt == VIPS_FORMAT_UCHAR) { + precision = VIPS_PRECISION_INTEGER; +- vips_image_set_double( t[0], "offset", 128.0 ); ++ vips_image_set_double(t[0], "offset", 128.0); + } +- else ++ else + precision = VIPS_PRECISION_FLOAT; + +- if( vips_conv( in, Gx, t[0], "precision", precision, NULL ) || +- vips_rot90( t[0], &t[1], NULL ) || +- vips_conv( in, Gy, t[1], "precision", precision, NULL ) ) { +- g_object_unref( scope ); +- return( -1 ); ++ if (vips_conv(in, Gx, t[0], "precision", precision, NULL) || ++ vips_rot90(t[0], &t[1], NULL) || ++ vips_conv(in, Gy, t[1], "precision", precision, NULL)) { ++ g_object_unref(scope); ++ return (-1); + } + +- g_object_unref( scope ); ++ g_object_unref(scope); + +- return( 0 ); ++ return (0); + } + + /* LUT for calculating atan2() with +/- 4 bits of precision in each axis. + */ + static VipsPel vips_canny_polar_atan2[256]; + +-/* For the uchar path, gx/gy are -128 to +127, and we need -8 to +7 for the +- * atan2 LUT. ++/* For the uchar path, gx/gy are -128 to +127, and we need -8 to +7 for the ++ * atan2 LUT. + * + * For G, we should calculate sqrt( gx * gx + gy * gy ), however we are only + * interested in relative magnitude (max of sqrt), so we can skip the sqrt + * itself. We need a result that will fit in 0 - 255, so shift down. + */ +-#define POLAR_UCHAR { \ +- for( x = 0; x < r->width; x++ ) { \ +- for( band = 0; band < Gx->Bands; band++ ) { \ +- int gx = p1[band] - 128; \ +- int gy = p2[band] - 128; \ +- \ +- int i = ((gx >> 4) & 0xf) | (gy & 0xf0); \ +- \ +- q[0] = (gx * gx + gy * gy + 256) >> 9; \ +- q[1] = vips_canny_polar_atan2[i]; \ +- \ +- q += 2; \ ++#define POLAR_UCHAR \ ++ { \ ++ for (x = 0; x < r->width; x++) { \ ++ for (band = 0; band < Gx->Bands; band++) { \ ++ int gx = p1[band] - 128; \ ++ int gy = p2[band] - 128; \ ++\ ++ int i = ((gx >> 4) & 0xf) | (gy & 0xf0); \ ++\ ++ q[0] = (gx * gx + gy * gy + 256) >> 9; \ ++ q[1] = vips_canny_polar_atan2[i]; \ ++\ ++ q += 2; \ ++ } \ ++\ ++ p1 += Gx->Bands; \ ++ p2 += Gx->Bands; \ + } \ +- \ +- p1 += Gx->Bands; \ +- p2 += Gx->Bands; \ +- } \ +-} ++ } + + /* Float/double path. We keep the same ranges as the uchar path to reduce +- * confusion. ++ * confusion. + */ +-#define POLAR( TYPE ) { \ +- TYPE *tp1 = (TYPE *) p1; \ +- TYPE *tp2 = (TYPE *) p2; \ +- TYPE *tq = (TYPE *) q; \ +- \ +- for( x = 0; x < r->width; x++ ) { \ +- for( band = 0; band < Gx->Bands; band++ ) { \ +- double gx = tp1[band]; \ +- double gy = tp2[band]; \ +- double theta = VIPS_DEG( atan2( gx, gy ) ); \ +- \ +- tq[0] = (gx * gx + gy * gy + 256.0) / 512.0; \ +- tq[1] = 256.0 * fmod( theta + 360.0, 360.0 ) / 360.0; \ +- \ +- tq += 2; \ ++#define POLAR(TYPE) \ ++ { \ ++ TYPE *tp1 = (TYPE *) p1; \ ++ TYPE *tp2 = (TYPE *) p2; \ ++ TYPE *tq = (TYPE *) q; \ ++\ ++ for (x = 0; x < r->width; x++) { \ ++ for (band = 0; band < Gx->Bands; band++) { \ ++ double gx = tp1[band]; \ ++ double gy = tp2[band]; \ ++ double theta = VIPS_DEG(atan2(gx, gy)); \ ++\ ++ tq[0] = (gx * gx + gy * gy + 256.0) / 512.0; \ ++ tq[1] = 256.0 * fmod(theta + 360.0, 360.0) / 360.0; \ ++\ ++ tq += 2; \ ++ } \ ++\ ++ tp1 += Gx->Bands; \ ++ tp2 += Gx->Bands; \ + } \ +- \ +- tp1 += Gx->Bands; \ +- tp2 += Gx->Bands; \ +- } \ +-} ++ } + + static int +-vips_canny_polar_generate( VipsRegion *or, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_canny_polar_generate(VipsRegion * or, ++ void *vseq, void *a, void *b, gboolean *stop) + { + VipsRegion **in = (VipsRegion **) vseq; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsImage *Gx = in[0]->im; + +- int x, y, band; ++ int x, y, band; + +- if( vips_reorder_prepare_many( or->im, in, r ) ) +- return( -1 ); ++ if (vips_reorder_prepare_many(or->im, in, r)) ++ return (-1); + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *p1 = (VipsPel * restrict) +- VIPS_REGION_ADDR( in[0], r->left, r->top + y ); +- VipsPel *p2 = (VipsPel * restrict) +- VIPS_REGION_ADDR( in[1], r->left, r->top + y ); +- VipsPel *q = (VipsPel * restrict) +- VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *p1 = (VipsPel *restrict) ++ VIPS_REGION_ADDR(in[0], r->left, r->top + y); ++ VipsPel *p2 = (VipsPel *restrict) ++ VIPS_REGION_ADDR(in[1], r->left, r->top + y); ++ VipsPel *q = (VipsPel *restrict) ++ VIPS_REGION_ADDR(or, r->left, r->top + y); + +- switch( Gx->BandFmt ) { ++ switch (Gx->BandFmt) { + case VIPS_FORMAT_UCHAR: + POLAR_UCHAR; + break; + + case VIPS_FORMAT_FLOAT: +- POLAR( float ); ++ POLAR(float); + break; + + case VIPS_FORMAT_DOUBLE: +- POLAR( double ); ++ POLAR(double); + break; + + default: +- g_assert( FALSE ); ++ g_assert(FALSE); + } + } + +- return( 0 ); ++ return (0); + } + + static void * +-vips_atan2_init( void *null ) ++vips_atan2_init(void *null) + { + int i; + +- for( i = 0; i < 256; i++ ) { ++ for (i = 0; i < 256; i++) { + /* Use the bottom 4 bits for x, the top 4 for y. The double + * shift does sign extension, assuming 2s complement. + */ +- int bits = sizeof( int ) * 8 - 4; ++ int bits = sizeof(int) * 8 - 4; + int x = ((i & 0xf) << bits) >> bits; + int y = ((i >> 4) & 0x0f) << bits >> bits; +- double theta = VIPS_DEG( atan2( x, y ) ) + 360; ++ double theta = VIPS_DEG(atan2(x, y)) + 360; + + vips_canny_polar_atan2[i] = 256 * theta / 360; + } + +- return( NULL ); ++ return (NULL); + } + + /* Calculate G/theta from Gx/Gy. We code theta as 0-256 for 0-360 + * and skip the sqrt on G. + * + * For a white disc on a black background, theta is 0 at the top, 64 on the +- * left, 128 on the right and 192 on the right edge. ++ * left, 128 on the right and 192 on the right edge. + */ + static int +-vips_canny_polar( VipsImage **args, VipsImage **out ) ++vips_canny_polar(VipsImage **args, VipsImage **out) + { + static GOnce once = G_ONCE_INIT; + +- g_once( &once, vips_atan2_init, NULL ); ++ g_once(&once, vips_atan2_init, NULL); + + *out = vips_image_new(); +- if( vips_image_pipeline_array( *out, +- VIPS_DEMAND_STYLE_THINSTRIP, args ) ) +- return( -1 ); ++ if (vips_image_pipeline_array(*out, ++ VIPS_DEMAND_STYLE_THINSTRIP, args)) ++ return (-1); + (*out)->Bands *= 2; + +- if( vips_image_generate( *out, +- vips_start_many, vips_canny_polar_generate, vips_stop_many, +- args, NULL ) ) +- return( -1 ); ++ if (vips_image_generate(*out, ++ vips_start_many, vips_canny_polar_generate, vips_stop_many, ++ args, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-#define THIN( TYPE ) { \ +- TYPE *tp = (TYPE *) p; \ +- TYPE *tq = (TYPE *) q; \ +- \ +- for( x = 0; x < r->width; x++ ) { \ +- for( band = 0; band < out_bands; band++ ) { \ +- TYPE G = tp[lsk + psk]; \ +- TYPE theta = tp[lsk + psk + 1]; \ +- int low_theta = ((int) (theta / 32)) & 0x7; \ +- int high_theta = (low_theta + 1) & 0x7; \ +- TYPE residual = theta - low_theta * 32; \ +- TYPE lowa = tp[offset[low_theta]]; \ +- TYPE lowb = tp[offset[high_theta]]; \ +- TYPE low = (lowa * (32 - residual) + \ +- lowb * residual) / 32; \ +- TYPE higha = tp[offset[(low_theta + 4) & 0x7]]; \ +- TYPE highb = tp[offset[(high_theta + 4) & 0x7]]; \ +- TYPE high = (higha * (32 - residual) + \ +- highb * residual) / 32; \ +- \ +- if( G <= low || \ +- G < high ) \ +- G = 0; \ +- \ +- tq[band] = G; \ +- \ +- tp += 2; \ ++#define THIN(TYPE) \ ++ { \ ++ TYPE *tp = (TYPE *) p; \ ++ TYPE *tq = (TYPE *) q; \ ++\ ++ for (x = 0; x < r->width; x++) { \ ++ for (band = 0; band < out_bands; band++) { \ ++ TYPE G = tp[lsk + psk]; \ ++ TYPE theta = tp[lsk + psk + 1]; \ ++ int low_theta = ((int) (theta / 32)) & 0x7; \ ++ int high_theta = (low_theta + 1) & 0x7; \ ++ TYPE residual = theta - low_theta * 32; \ ++ TYPE lowa = tp[offset[low_theta]]; \ ++ TYPE lowb = tp[offset[high_theta]]; \ ++ TYPE low = (lowa * (32 - residual) + \ ++ lowb * residual) / \ ++ 32; \ ++ TYPE higha = tp[offset[(low_theta + 4) & 0x7]]; \ ++ TYPE highb = tp[offset[(high_theta + 4) & 0x7]]; \ ++ TYPE high = (higha * (32 - residual) + \ ++ highb * residual) / \ ++ 32; \ ++\ ++ if (G <= low || \ ++ G < high) \ ++ G = 0; \ ++\ ++ tq[band] = G; \ ++\ ++ tp += 2; \ ++ } \ ++\ ++ tq += out_bands; \ + } \ +- \ +- tq += out_bands; \ +- } \ +-} ++ } + + static int +-vips_canny_thin_generate( VipsRegion *or, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_canny_thin_generate(VipsRegion * or, ++ void *vseq, void *a, void *b, gboolean *stop) + { + VipsRegion *in = (VipsRegion *) vseq; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsImage *im = in->im; + int out_bands = or->im->Bands; + + VipsRect rect; +- int x, y, band; ++ int x, y, band; + int lsk; + int psk; + +@@ -293,13 +298,13 @@ vips_canny_thin_generate( VipsRegion *or, + rect = *r; + rect.width += 2; + rect.height += 2; +- if( vips_region_prepare( in, &rect ) ) +- return( -1 ); ++ if (vips_region_prepare(in, &rect)) ++ return (-1); + + /* These are in typed units. + */ +- lsk = VIPS_REGION_LSKIP( in ) / VIPS_IMAGE_SIZEOF_ELEMENT( im ); +- psk = VIPS_IMAGE_SIZEOF_PEL( im ) / VIPS_IMAGE_SIZEOF_ELEMENT( im ); ++ lsk = VIPS_REGION_LSKIP(in) / VIPS_IMAGE_SIZEOF_ELEMENT(im); ++ psk = VIPS_IMAGE_SIZEOF_PEL(im) / VIPS_IMAGE_SIZEOF_ELEMENT(im); + + /* For each of the 8 directions, the offset to get to that pixel from + * the top-left of the 3x3. +@@ -319,154 +324,153 @@ vips_canny_thin_generate( VipsRegion *or, + offset[6] = lsk + 2 * psk; + offset[7] = 2 * psk; + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *p = (VipsPel * restrict) +- VIPS_REGION_ADDR( in, r->left, r->top + y ); +- VipsPel *q = (VipsPel * restrict) +- VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *p = (VipsPel *restrict) ++ VIPS_REGION_ADDR(in, r->left, r->top + y); ++ VipsPel *q = (VipsPel *restrict) ++ VIPS_REGION_ADDR(or, r->left, r->top + y); + +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_UCHAR: +- THIN( unsigned char ); ++ THIN(unsigned char); + break; + + case VIPS_FORMAT_FLOAT: +- THIN( float ); ++ THIN(float); + break; + + case VIPS_FORMAT_DOUBLE: +- THIN( double ); ++ THIN(double); + break; + + default: +- g_assert( FALSE ); ++ g_assert(FALSE); + } + } + +- return( 0 ); ++ return (0); + } + + /* Remove non-maximal edges. At each point, compare the G to the G in either + * direction and 0 it if it's not the largest. + */ + static int +-vips_canny_thin( VipsImage *in, VipsImage **out ) ++vips_canny_thin(VipsImage *in, VipsImage **out) + { + *out = vips_image_new(); +- if( vips_image_pipelinev( *out, +- VIPS_DEMAND_STYLE_THINSTRIP, in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(*out, ++ VIPS_DEMAND_STYLE_THINSTRIP, in, NULL)) ++ return (-1); + (*out)->Bands /= 2; + (*out)->Xsize -= 2; + (*out)->Ysize -= 2; + +- if( vips_image_generate( *out, +- vips_start_one, vips_canny_thin_generate, vips_stop_one, +- in, NULL ) ) +- return( -1 ); ++ if (vips_image_generate(*out, ++ vips_start_one, vips_canny_thin_generate, vips_stop_one, ++ in, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_canny_build( VipsObject *object ) ++vips_canny_build(VipsObject *object) + { + VipsCanny *canny = (VipsCanny *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 6 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 6); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_canny_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_canny_parent_class)->build(object)) ++ return (-1); + + in = canny->in; + +- if( vips_gaussblur( in, &t[0], canny->sigma, +- "precision", canny->precision, +- NULL ) ) +- return( -1 ); ++ if (vips_gaussblur(in, &t[0], canny->sigma, ++ "precision", canny->precision, ++ NULL)) ++ return (-1); + in = t[0]; + +- if( vips_canny_gradient( in, &t[1], &t[2] ) ) +- return( -1 ); ++ if (vips_canny_gradient(in, &t[1], &t[2])) ++ return (-1); + + /* Form (G, theta). + */ + canny->args[0] = t[1]; + canny->args[1] = t[2]; + canny->args[2] = NULL; +- if( vips_canny_polar( canny->args, &t[3] ) ) +- return( -1 ); ++ if (vips_canny_polar(canny->args, &t[3])) ++ return (-1); + in = t[3]; + + /* Expand by two pixels all around, then thin in the direction of the + * gradient. + */ +- if( vips_embed( in, &t[4], 1, 1, in->Xsize + 2, in->Ysize + 2, +- "extend", VIPS_EXTEND_COPY, +- NULL ) ) +- return( -1 ); ++ if (vips_embed(in, &t[4], 1, 1, in->Xsize + 2, in->Ysize + 2, ++ "extend", VIPS_EXTEND_COPY, ++ NULL)) ++ return (-1); + +- if( vips_canny_thin( t[4], &t[5] ) ) +- return( -1 ); ++ if (vips_canny_thin(t[4], &t[5])) ++ return (-1); + in = t[5]; + +- g_object_set( object, "out", vips_image_new(), NULL ); ++ g_object_set(object, "out", vips_image_new(), NULL); + +- if( vips_image_write( in, canny->out ) ) +- return( -1 ); ++ if (vips_image_write(in, canny->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_canny_class_init( VipsCannyClass *class ) ++vips_canny_class_init(VipsCannyClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "canny"; +- object_class->description = _( "Canny edge detector" ); ++ object_class->description = _("Canny edge detector"); + object_class->build = vips_canny_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsCanny, in ) ); ++ G_STRUCT_OFFSET(VipsCanny, in)); + +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsCanny, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsCanny, out)); + +- VIPS_ARG_DOUBLE( class, "sigma", 10, +- _( "Sigma" ), +- _( "Sigma of Gaussian" ), ++ VIPS_ARG_DOUBLE(class, "sigma", 10, ++ _("Sigma"), ++ _("Sigma of Gaussian"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCanny, sigma ), +- 0.01, 1000, 1.4 ); +- +- VIPS_ARG_ENUM( class, "precision", 103, +- _( "Precision" ), +- _( "Convolve with this precision" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCanny, precision ), +- VIPS_TYPE_PRECISION, VIPS_PRECISION_FLOAT ); ++ G_STRUCT_OFFSET(VipsCanny, sigma), ++ 0.01, 1000, 1.4); + ++ VIPS_ARG_ENUM(class, "precision", 103, ++ _("Precision"), ++ _("Convolve with this precision"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsCanny, precision), ++ VIPS_TYPE_PRECISION, VIPS_PRECISION_FLOAT); + } + + static void +-vips_canny_init( VipsCanny *canny ) ++vips_canny_init(VipsCanny *canny) + { +- canny->sigma = 1.4; ++ canny->sigma = 1.4; + canny->precision = VIPS_PRECISION_FLOAT; + } + +@@ -484,31 +488,31 @@ vips_canny_init( VipsCanny *canny ) + * Find edges by Canny's method: The maximum of the derivative of the gradient + * in the direction of the gradient. Output is float, except for uchar input, + * where output is uchar, and double input, where output is double. Non-complex +- * images only. ++ * images only. + * + * Use @sigma to control the scale over which gradient is measured. 1.4 is + * usually a good value. + * + * Use @precision to set the precision of edge detection. For uchar images, +- * setting this to #VIPS_PRECISION_INTEGER will make edge detection much +- * faster, but sacrifice some sensitivity. ++ * setting this to #VIPS_PRECISION_INTEGER will make edge detection much ++ * faster, but sacrifice some sensitivity. + * +- * You will probably need to process the output further to eliminate weak +- * edges. ++ * You will probably need to process the output further to eliminate weak ++ * edges. + * + * See also: vips_sobel(). +- * ++ * + * Returns: 0 on success, -1 on error. + */ +-int +-vips_canny( VipsImage *in, VipsImage **out, ... ) ++int ++vips_canny(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "canny", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("canny", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/convolution/compass.c b/libvips/convolution/compass.c +index fedb6b8963..f0a7f5212e 100644 +--- a/libvips/convolution/compass.c ++++ b/libvips/convolution/compass.c +@@ -1,6 +1,6 @@ + /* repeatedly convolve with a rotating mask + * +- * 23/10/13 ++ * 23/10/13 + * - from vips_conv() + * 8/5/17 + * - default to float ... int will often lose precision and should not be +@@ -11,28 +11,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -50,85 +50,85 @@ + typedef struct { + VipsConvolution parent_instance; + +- int times; +- VipsAngle45 angle; +- VipsCombine combine; +- VipsPrecision precision; +- int layers; +- int cluster; ++ int times; ++ VipsAngle45 angle; ++ VipsCombine combine; ++ VipsPrecision precision; ++ int layers; ++ int cluster; + } VipsCompass; + + typedef VipsConvolutionClass VipsCompassClass; + +-G_DEFINE_TYPE( VipsCompass, vips_compass, VIPS_TYPE_CONVOLUTION ); ++G_DEFINE_TYPE(VipsCompass, vips_compass, VIPS_TYPE_CONVOLUTION); + + static int +-vips_compass_build( VipsObject *object ) ++vips_compass_build(VipsObject *object) + { + VipsConvolution *convolution = (VipsConvolution *) object; + VipsCompass *compass = (VipsCompass *) object; + VipsImage **masks; + VipsImage *mask; + VipsImage **images; +- int i; ++ int i; + VipsImage **abs; + VipsImage **combine; + VipsImage *x; + +- g_object_set( compass, "out", vips_image_new(), NULL ); ++ g_object_set(compass, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_compass_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_compass_parent_class)->build(object)) ++ return (-1); + +- masks = (VipsImage **) +- vips_object_local_array( object, compass->times ); +- images = (VipsImage **) +- vips_object_local_array( object, compass->times ); +- abs = (VipsImage **) +- vips_object_local_array( object, compass->times ); +- combine = (VipsImage **) +- vips_object_local_array( object, compass->times ); ++ masks = (VipsImage **) ++ vips_object_local_array(object, compass->times); ++ images = (VipsImage **) ++ vips_object_local_array(object, compass->times); ++ abs = (VipsImage **) ++ vips_object_local_array(object, compass->times); ++ combine = (VipsImage **) ++ vips_object_local_array(object, compass->times); + + mask = convolution->M; +- for( i = 0; i < compass->times; i++ ) { +- if( vips_conv( convolution->in, &images[i], mask, +- "precision", compass->precision, +- "layers", compass->layers, +- "cluster", compass->cluster, +- NULL ) ) +- return( -1 ); +- if( vips_rot45( mask, &masks[i], +- "angle", compass->angle, +- NULL ) ) +- return( -1 ); ++ for (i = 0; i < compass->times; i++) { ++ if (vips_conv(convolution->in, &images[i], mask, ++ "precision", compass->precision, ++ "layers", compass->layers, ++ "cluster", compass->cluster, ++ NULL)) ++ return (-1); ++ if (vips_rot45(mask, &masks[i], ++ "angle", compass->angle, ++ NULL)) ++ return (-1); + + mask = masks[i]; + } + +- for( i = 0; i < compass->times; i++ ) +- if( vips_abs( images[i], &abs[i], NULL ) ) +- return( -1 ); ++ for (i = 0; i < compass->times; i++) ++ if (vips_abs(images[i], &abs[i], NULL)) ++ return (-1); + +- switch( compass->combine ) { ++ switch (compass->combine) { + case VIPS_COMBINE_MAX: +- if( vips_bandrank( abs, &combine[0], compass->times, +- "index", compass->times - 1, +- NULL ) ) +- return( -1 ); ++ if (vips_bandrank(abs, &combine[0], compass->times, ++ "index", compass->times - 1, ++ NULL)) ++ return (-1); + x = combine[0]; + break; + + case VIPS_COMBINE_MIN: +- if( vips_bandrank( abs, &combine[0], compass->times, +- "index", 0, +- NULL ) ) +- return( -1 ); ++ if (vips_bandrank(abs, &combine[0], compass->times, ++ "index", 0, ++ NULL)) ++ return (-1); + x = combine[0]; + break; + + case VIPS_COMBINE_SUM: +- if( vips_sum( abs, &combine[0], compass->times, NULL ) ) +- return( -1 ); ++ if (vips_sum(abs, &combine[0], compass->times, NULL)) ++ return (-1); + x = combine[0]; + break; + +@@ -140,71 +140,70 @@ vips_compass_build( VipsObject *object ) + x = NULL; + } + +- if( vips_image_write( x, convolution->out ) ) +- return( -1 ); ++ if (vips_image_write(x, convolution->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_compass_class_init( VipsCompassClass *class ) ++vips_compass_class_init(VipsCompassClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "compass"; +- object_class->description = _( "convolve with rotating mask" ); ++ object_class->description = _("convolve with rotating mask"); + object_class->build = vips_compass_build; + +- VIPS_ARG_INT( class, "times", 101, +- _( "Times" ), +- _( "Rotate and convolve this many times" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCompass, times ), +- 1, 1000, 2 ); +- +- VIPS_ARG_ENUM( class, "angle", 103, +- _( "Angle" ), +- _( "Rotate mask by this much between convolutions" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCompass, angle ), +- VIPS_TYPE_ANGLE45, VIPS_ANGLE45_D90 ); +- +- VIPS_ARG_ENUM( class, "combine", 104, +- _( "Combine" ), +- _( "Combine convolution results like this" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCompass, combine ), +- VIPS_TYPE_COMBINE, VIPS_COMBINE_MAX ); +- +- VIPS_ARG_ENUM( class, "precision", 203, +- _( "Precision" ), +- _( "Convolve with this precision" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCompass, precision ), +- VIPS_TYPE_PRECISION, VIPS_PRECISION_FLOAT ); +- +- VIPS_ARG_INT( class, "layers", 204, +- _( "Layers" ), +- _( "Use this many layers in approximation" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCompass, layers ), +- 1, 1000, 5 ); +- +- VIPS_ARG_INT( class, "cluster", 205, +- _( "Cluster" ), +- _( "Cluster lines closer than this in approximation" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsCompass, cluster ), +- 1, 100, 1 ); +- ++ VIPS_ARG_INT(class, "times", 101, ++ _("Times"), ++ _("Rotate and convolve this many times"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsCompass, times), ++ 1, 1000, 2); ++ ++ VIPS_ARG_ENUM(class, "angle", 103, ++ _("Angle"), ++ _("Rotate mask by this much between convolutions"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsCompass, angle), ++ VIPS_TYPE_ANGLE45, VIPS_ANGLE45_D90); ++ ++ VIPS_ARG_ENUM(class, "combine", 104, ++ _("Combine"), ++ _("Combine convolution results like this"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsCompass, combine), ++ VIPS_TYPE_COMBINE, VIPS_COMBINE_MAX); ++ ++ VIPS_ARG_ENUM(class, "precision", 203, ++ _("Precision"), ++ _("Convolve with this precision"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsCompass, precision), ++ VIPS_TYPE_PRECISION, VIPS_PRECISION_FLOAT); ++ ++ VIPS_ARG_INT(class, "layers", 204, ++ _("Layers"), ++ _("Use this many layers in approximation"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsCompass, layers), ++ 1, 1000, 5); ++ ++ VIPS_ARG_INT(class, "cluster", 205, ++ _("Cluster"), ++ _("Cluster lines closer than this in approximation"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsCompass, cluster), ++ 1, 100, 1); + } + + static void +-vips_compass_init( VipsCompass *compass ) ++vips_compass_init(VipsCompass *compass) + { + compass->times = 2; + compass->angle = VIPS_ANGLE45_D90; +@@ -238,15 +237,15 @@ vips_compass_init( VipsCompass *compass ) + * + * Returns: 0 on success, -1 on error. + */ +-int +-vips_compass( VipsImage *in, VipsImage **out, VipsImage *mask, ... ) ++int ++vips_compass(VipsImage *in, VipsImage **out, VipsImage *mask, ...) + { + va_list ap; + int result; + +- va_start( ap, mask ); +- result = vips_call_split( "compass", ap, in, out, mask ); +- va_end( ap ); ++ va_start(ap, mask); ++ result = vips_call_split("compass", ap, in, out, mask); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/convolution/conv.c b/libvips/convolution/conv.c +index d2a0b0373c..5a5894641d 100644 +--- a/libvips/convolution/conv.c ++++ b/libvips/convolution/conv.c +@@ -1,6 +1,6 @@ + /* convolution + * +- * 12/8/13 ++ * 12/8/13 + * - from vips_hist_cum() + * 8/5/17 + * - default to float ... int will often lose precision and should not be +@@ -9,28 +9,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -49,112 +49,111 @@ + typedef struct { + VipsConvolution parent_instance; + +- VipsPrecision precision; +- int layers; +- int cluster; ++ VipsPrecision precision; ++ int layers; ++ int cluster; + } VipsConv; + + typedef VipsConvolutionClass VipsConvClass; + +-G_DEFINE_TYPE( VipsConv, vips_conv, VIPS_TYPE_CONVOLUTION ); ++G_DEFINE_TYPE(VipsConv, vips_conv, VIPS_TYPE_CONVOLUTION); + + static int +-vips_conv_build( VipsObject *object ) ++vips_conv_build(VipsObject *object) + { + VipsConvolution *convolution = (VipsConvolution *) object; + VipsConv *conv = (VipsConv *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_conv_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_conv_parent_class)->build(object)) ++ return (-1); + +- g_object_set( conv, "out", vips_image_new(), NULL ); ++ g_object_set(conv, "out", vips_image_new(), NULL); + + in = convolution->in; + + /* + printf( "vips_conv_build: convolving with:\n" ); +- vips_matrixprint( convolution->M, NULL ); +- */ ++ vips_matrixprint( convolution->M, NULL ); ++ */ + + /* Unpack for processing. + */ +- if( vips_image_decode( in, &t[0] ) ) +- return( -1 ); ++ if (vips_image_decode(in, &t[0])) ++ return (-1); + in = t[0]; + +- switch( conv->precision ) { ++ switch (conv->precision) { + case VIPS_PRECISION_FLOAT: +- if( vips_convf( in, &t[1], convolution->M, NULL ) || +- vips_image_write( t[1], convolution->out ) ) +- return( -1 ); ++ if (vips_convf(in, &t[1], convolution->M, NULL) || ++ vips_image_write(t[1], convolution->out)) ++ return (-1); + break; + + case VIPS_PRECISION_INTEGER: +- if( vips_convi( in, &t[1], convolution->M, NULL ) || +- vips_image_write( t[1], convolution->out ) ) +- return( -1 ); ++ if (vips_convi(in, &t[1], convolution->M, NULL) || ++ vips_image_write(t[1], convolution->out)) ++ return (-1); + break; + + case VIPS_PRECISION_APPROXIMATE: +- if( vips_conva( in, &t[1], convolution->M, +- "layers", conv->layers, +- "cluster", conv->cluster, +- NULL ) || +- vips_image_write( t[1], convolution->out ) ) +- return( -1 ); ++ if (vips_conva(in, &t[1], convolution->M, ++ "layers", conv->layers, ++ "cluster", conv->cluster, ++ NULL) || ++ vips_image_write(t[1], convolution->out)) ++ return (-1); + break; + + default: + g_assert_not_reached(); + } + +- vips_reorder_margin_hint( convolution->out, +- convolution->M->Xsize * convolution->M->Ysize ); ++ vips_reorder_margin_hint(convolution->out, ++ convolution->M->Xsize * convolution->M->Ysize); + +- return( 0 ); ++ return (0); + } + + static void +-vips_conv_class_init( VipsConvClass *class ) ++vips_conv_class_init(VipsConvClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "conv"; +- object_class->description = _( "convolution operation" ); ++ object_class->description = _("convolution operation"); + object_class->build = vips_conv_build; + +- VIPS_ARG_ENUM( class, "precision", 103, +- _( "Precision" ), +- _( "Convolve with this precision" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsConv, precision ), +- VIPS_TYPE_PRECISION, VIPS_PRECISION_FLOAT ); +- +- VIPS_ARG_INT( class, "layers", 104, +- _( "Layers" ), +- _( "Use this many layers in approximation" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsConv, layers ), +- 1, 1000, 5 ); +- +- VIPS_ARG_INT( class, "cluster", 105, +- _( "Cluster" ), +- _( "Cluster lines closer than this in approximation" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsConv, cluster ), +- 1, 100, 1 ); +- ++ VIPS_ARG_ENUM(class, "precision", 103, ++ _("Precision"), ++ _("Convolve with this precision"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsConv, precision), ++ VIPS_TYPE_PRECISION, VIPS_PRECISION_FLOAT); ++ ++ VIPS_ARG_INT(class, "layers", 104, ++ _("Layers"), ++ _("Use this many layers in approximation"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsConv, layers), ++ 1, 1000, 5); ++ ++ VIPS_ARG_INT(class, "cluster", 105, ++ _("Cluster"), ++ _("Cluster lines closer than this in approximation"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsConv, cluster), ++ 1, 100, 1); + } + + static void +-vips_conv_init( VipsConv *conv ) ++vips_conv_init(VipsConv *conv) + { + conv->precision = VIPS_PRECISION_FLOAT; + conv->layers = 5; +@@ -174,7 +173,7 @@ vips_conv_init( VipsConv *conv ) + * * @layers: %gint, number of layers for approximation + * * @cluster: %gint, cluster lines closer than this distance + * +- * Convolution. ++ * Convolution. + * + * Perform a convolution of @in with @mask. + * Each output pixel is calculated as: +@@ -183,33 +182,33 @@ vips_conv_init( VipsConv *conv ) + * sigma[i]{pixel[i] * mask[i]} / scale + offset + * ]| + * +- * where scale and offset are part of @mask. ++ * where scale and offset are part of @mask. + * +- * By default, @precision is +- * #VIPS_PRECISION_FLOAT. The output image ++ * By default, @precision is ++ * #VIPS_PRECISION_FLOAT. The output image + * is always #VIPS_FORMAT_FLOAT unless @in is #VIPS_FORMAT_DOUBLE, in which case +- * @out is also #VIPS_FORMAT_DOUBLE. ++ * @out is also #VIPS_FORMAT_DOUBLE. + * +- * If @precision is #VIPS_PRECISION_INTEGER, then ++ * If @precision is #VIPS_PRECISION_INTEGER, then + * elements of @mask are converted to + * integers before convolution, using rint(), +- * and the output image +- * always has the same #VipsBandFormat as the input image. ++ * and the output image ++ * always has the same #VipsBandFormat as the input image. + * +- * For #VIPS_FORMAT_UCHAR images and #VIPS_PRECISION_INTEGER @precision, ++ * For #VIPS_FORMAT_UCHAR images and #VIPS_PRECISION_INTEGER @precision, + * vips_conv() uses a fast vector path based on +- * fixed-point arithmetic. This can produce slightly different results. ++ * fixed-point arithmetic. This can produce slightly different results. + * Disable the vector path with `--vips-novector` or `VIPS_NOVECTOR` or + * vips_vector_set_enabled(). + * + * If @precision is #VIPS_PRECISION_APPROXIMATE then, like +- * #VIPS_PRECISION_INTEGER, @mask is converted to int before convolution, and +- * the output image +- * always has the same #VipsBandFormat as the input image. ++ * #VIPS_PRECISION_INTEGER, @mask is converted to int before convolution, and ++ * the output image ++ * always has the same #VipsBandFormat as the input image. + * + * Larger values for @layers give more accurate + * results, but are slower. As @layers approaches the mask radius, the +- * accuracy will become close to exact convolution and the speed will drop to ++ * accuracy will become close to exact convolution and the speed will drop to + * match. For many large masks, such as Gaussian, @n_layers need be only 10% of + * this value and accuracy will still be good. + * +@@ -220,15 +219,15 @@ vips_conv_init( VipsConv *conv ) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_conv( VipsImage *in, VipsImage **out, VipsImage *mask, ... ) ++int ++vips_conv(VipsImage *in, VipsImage **out, VipsImage *mask, ...) + { + va_list ap; + int result; + +- va_start( ap, mask ); +- result = vips_call_split( "conv", ap, in, out, mask ); +- va_end( ap ); ++ va_start(ap, mask); ++ result = vips_call_split("conv", ap, in, out, mask); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/convolution/conva.c b/libvips/convolution/conva.c +index e6d05ab103..58ba7a00b1 100644 +--- a/libvips/convolution/conva.c ++++ b/libvips/convolution/conva.c +@@ -1,10 +1,10 @@ + /* conva ... approximate convolution + * +- * This operation does an approximate convolution. ++ * This operation does an approximate convolution. + * + * Author: John Cupitt & Nicolas Robidoux + * Written on: 31/5/11 +- * Modified on: ++ * Modified on: + * 31/5/11 + * - from im_aconvsep() + * 10/7/16 +@@ -13,28 +13,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -44,7 +44,7 @@ + + http://incubator.quasimondo.com/processing/stackblur.pde + +- This thing is a little like stackblur, but generalised to any 2D ++ This thing is a little like stackblur, but generalised to any 2D + convolution. + + */ +@@ -70,10 +70,10 @@ sys 0m0.100s + $ vips im_max abs.v + 2.70833 + +- - are we handling mask offset correctly? ++ - are we handling mask offset correctly? + +- - could we do better with an h and a v cumulativization image? we might +- not need the huge intermediate we have now, since any line sum an be ++ - could we do better with an h and a v cumulativization image? we might ++ not need the huge intermediate we have now, since any line sum an be + found with simple indexing + + */ +@@ -102,7 +102,7 @@ sys 0m0.100s + #include "pconvolution.h" + + /* Maximum number of boxes we can break the mask into. Don't have this too +- * high, it'll make the instance huge, and gobject has a 64kb limit. ++ * high, it'll make the instance huge, and gobject has a 64kb limit. + */ + #define MAX_LINES (1000) + +@@ -115,7 +115,7 @@ sys 0m0.100s + */ + typedef struct _HLine { + /* Start is the left-most pixel in the line, end is one beyond the +- * right-most pixel. ++ * right-most pixel. + */ + int start; + int end; +@@ -141,7 +141,7 @@ typedef struct _Edge { + /* An element of a vline. + */ + typedef struct _VElement { +- /* band is the index into hline[] we add, row is the row we take ++ /* band is the index into hline[] we add, row is the row we take + * it from. + */ + int band; +@@ -162,7 +162,7 @@ typedef struct _VLine { + int end; + } VLine; + +-/* A set of boxes. ++/* A set of boxes. + */ + typedef struct { + VipsConvolution parent_instance; +@@ -188,7 +188,7 @@ typedef struct { + */ + Edge edge[MAX_EDGES]; + +- /* Scale and sum a set of hlines to make the final value. ++ /* Scale and sum a set of hlines to make the final value. + */ + int n_velement; + VElement velement[MAX_LINES]; +@@ -202,30 +202,30 @@ typedef struct { + + typedef VipsConvolutionClass VipsConvaClass; + +-G_DEFINE_TYPE( VipsConva, vips_conva, VIPS_TYPE_CONVOLUTION ); ++G_DEFINE_TYPE(VipsConva, vips_conva, VIPS_TYPE_CONVOLUTION); + + /* Euclid's algorithm. Use this to common up mults. + */ + static int +-gcd( int a, int b ) ++gcd(int a, int b) + { +- if( b == 0 ) +- return( abs( a ) ); ++ if (b == 0) ++ return (abs(a)); + else +- return( gcd( b, a % b ) ); ++ return (gcd(b, a % b)); + } + + static void +-vips_conva_hline_start( VipsConva *conva, int x ) ++vips_conva_hline_start(VipsConva *conva, int x) + { + conva->hline[conva->n_hline].start = x; + conva->hline[conva->n_hline].weight = 1; + } + + static int +-vips_conva_hline_end( VipsConva *conva, int x, int y, int factor ) ++vips_conva_hline_end(VipsConva *conva, int x, int y, int factor) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( conva ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(conva); + + conva->hline[conva->n_hline].end = x; + +@@ -233,80 +233,80 @@ vips_conva_hline_end( VipsConva *conva, int x, int y, int factor ) + conva->velement[conva->n_velement].band = conva->n_hline; + conva->velement[conva->n_velement].factor = factor; + +- if( conva->n_hline >= MAX_LINES - 1 ) { +- vips_error( class->nickname, "%s", _( "mask too complex" ) ); +- return( -1 ); ++ if (conva->n_hline >= MAX_LINES - 1) { ++ vips_error(class->nickname, "%s", _("mask too complex")); ++ return (-1); + } + conva->n_hline += 1; + +- if( conva->n_velement >= MAX_LINES - 1 ) { +- vips_error( class->nickname, "%s", _( "mask too complex" ) ); +- return( -1 ); ++ if (conva->n_velement >= MAX_LINES - 1) { ++ vips_error(class->nickname, "%s", _("mask too complex")); ++ return (-1); + } + conva->n_velement += 1; + +- return( 0 ); ++ return (0); + } + + #ifdef DEBUG + static void +-vips_conva_hprint( VipsConva *conva ) ++vips_conva_hprint(VipsConva *conva) + { + int x, y; + +- printf( "hlines:\n" ); +- printf( " n b r f w\n" ); +- for( y = 0; y < conva->n_velement; y++ ) { ++ printf("hlines:\n"); ++ printf(" n b r f w\n"); ++ for (y = 0; y < conva->n_velement; y++) { + int b = conva->velement[y].band; + +- printf( "%4d %3d %3d %2d %3d ", +- y, b, +- conva->velement[y].row, ++ printf("%4d %3d %3d %2d %3d ", ++ y, b, ++ conva->velement[y].row, + conva->velement[y].factor, +- conva->hline[b].weight ); +- for( x = 0; x < 45; x++ ) { ++ conva->hline[b].weight); ++ for (x = 0; x < 45; x++) { + int rx = x * (conva->iM->Xsize + 1) / 45; + +- if( rx >= conva->hline[b].start && +- rx < conva->hline[b].end ) +- printf( "#" ); ++ if (rx >= conva->hline[b].start && ++ rx < conva->hline[b].end) ++ printf("#"); + else +- printf( " " ); ++ printf(" "); + } +- printf( " %3d .. %3d\n", +- conva->hline[b].start, conva->hline[b].end ); ++ printf(" %3d .. %3d\n", ++ conva->hline[b].start, conva->hline[b].end); + } + } + + static void +-vips_conva_vprint( VipsConva *conva ) ++vips_conva_vprint(VipsConva *conva) + { + int y; + +- printf( "%d vlines:\n", conva->n_vline ); +- printf( " n b f s e\n" ); +- for( y = 0; y < conva->n_vline; y++ ) +- printf( "%4d %2d %2d == %3d .. %3d\n", y, +- conva->vline[y].band, +- conva->vline[y].factor, +- conva->vline[y].start, +- conva->vline[y].end ); +- +- printf( "divisor = %d\n", conva->divisor ); +- printf( "rounding = %d\n", conva->rounding ); +- printf( "offset = %d\n", conva->offset ); +- printf( "max_line = %d\n", conva->max_line ); ++ printf("%d vlines:\n", conva->n_vline); ++ printf(" n b f s e\n"); ++ for (y = 0; y < conva->n_vline; y++) ++ printf("%4d %2d %2d == %3d .. %3d\n", y, ++ conva->vline[y].band, ++ conva->vline[y].factor, ++ conva->vline[y].start, ++ conva->vline[y].end); ++ ++ printf("divisor = %d\n", conva->divisor); ++ printf("rounding = %d\n", conva->rounding); ++ printf("offset = %d\n", conva->offset); ++ printf("max_line = %d\n", conva->max_line); + } + #endif /*DEBUG*/ + + /* Break the mask into a set of hlines. + */ + static int +-vips_conva_decompose_hlines( VipsConva *conva ) ++vips_conva_decompose_hlines(VipsConva *conva) + { + VipsImage *iM = conva->iM; + const int size = iM->Xsize * iM->Ysize; +- double *coeff = VIPS_MATRIX( iM, 0, 0 ); ++ double *coeff = VIPS_MATRIX(iM, 0, 0); + + double max; + double min; +@@ -319,31 +319,31 @@ vips_conva_decompose_hlines( VipsConva *conva ) + */ + max = 0; + min = 0; +- for( n = 0; n < size; n++ ) { +- max = VIPS_MAX( max, coeff[n] ); +- min = VIPS_MIN( min, coeff[n] ); ++ for (n = 0; n < size; n++) { ++ max = VIPS_MAX(max, coeff[n]); ++ min = VIPS_MIN(min, coeff[n]); + } + +- VIPS_DEBUG_MSG( "vips_conva_decompose_hlines: min = %g, max = %g\n", +- min, max ); ++ VIPS_DEBUG_MSG("vips_conva_decompose_hlines: min = %g, max = %g\n", ++ min, max); + + /* The zero axis must fall on a layer boundary. Estimate the + * depth, find n-lines-above-zero, get exact depth, then calculate a + * fixed n-lines which includes any negative parts. + */ + depth = (max - min) / conva->layers; +- layers_above = VIPS_CEIL( max / depth ); ++ layers_above = VIPS_CEIL(max / depth); + depth = max / layers_above; +- layers_below = VIPS_FLOOR( min / depth ); ++ layers_below = VIPS_FLOOR(min / depth); + conva->layers = layers_above - layers_below; + +- VIPS_DEBUG_MSG( "vips_conva_decompose_hlines: depth = %g, layers = %d\n", +- depth, conva->layers ); ++ VIPS_DEBUG_MSG("vips_conva_decompose_hlines: depth = %g, layers = %d\n", ++ depth, conva->layers); + + /* For each layer, generate a set of lines which are inside the + * perimeter. Work down from the top. + */ +- for( z = 0; z < conva->layers; z++ ) { ++ for (z = 0; z < conva->layers; z++) { + /* How deep we are into the mask, as a double we can test + * against. Add half the layer depth so we can easily find >50% + * mask elements. +@@ -355,75 +355,75 @@ vips_conva_decompose_hlines( VipsConva *conva ) + */ + int z_positive = z < layers_above; + +- for( y = 0; y < iM->Ysize; y++ ) { ++ for (y = 0; y < iM->Ysize; y++) { + int inside; + + /* Start outside the perimeter. + */ + inside = 0; + +- for( x = 0; x < iM->Xsize; x++ ) { ++ for (x = 0; x < iM->Xsize; x++) { + double c = coeff[x + y * iM->Xsize]; + +- /* The vertical line from mask[x, y] to 0 is +- * inside. Is our current square (x, y) part ++ /* The vertical line from mask[x, y] to 0 is ++ * inside. Is our current square (x, y) part + * of that line? + */ +- if( (z_positive && c >= z_ph) || +- (!z_positive && c <= z_ph) ) { +- if( !inside ) { +- vips_conva_hline_start( conva, +- x ); ++ if ((z_positive && c >= z_ph) || ++ (!z_positive && c <= z_ph)) { ++ if (!inside) { ++ vips_conva_hline_start(conva, ++ x); + inside = 1; + } + } + else { +- if( inside ) { +- if( vips_conva_hline_end( conva, +- x, y, +- z_positive ? 1 : -1 ) ) +- return( -1 ); ++ if (inside) { ++ if (vips_conva_hline_end(conva, ++ x, y, ++ z_positive ? 1 : -1)) ++ return (-1); + inside = 0; + } + } + } + +- if( inside && +- vips_conva_hline_end( conva, +- iM->Xsize, y, z_positive ? 1 : -1 ) ) +- return( -1 ); ++ if (inside && ++ vips_conva_hline_end(conva, ++ iM->Xsize, y, z_positive ? 1 : -1)) ++ return (-1); + } + } + + #ifdef DEBUG +- VIPS_DEBUG_MSG( "vips_conva_decompose_hlines: generated %d hlines\n", +- conva->n_hline ); +- vips_conva_hprint( conva ); ++ VIPS_DEBUG_MSG("vips_conva_decompose_hlines: generated %d hlines\n", ++ conva->n_hline); ++ vips_conva_hprint(conva); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + /* The 'distance' between a pair of hlines. + */ + static int +-vips_conva_distance( VipsConva *conva, int a, int b ) ++vips_conva_distance(VipsConva *conva, int a, int b) + { +- g_assert( conva->hline[a].weight > 0 && conva->hline[b].weight > 0 ); ++ g_assert(conva->hline[a].weight > 0 && conva->hline[b].weight > 0); + +- return( abs( conva->hline[a].start - conva->hline[b].start ) + +- abs( conva->hline[a].end - conva->hline[b].end ) ); ++ return (abs(conva->hline[a].start - conva->hline[b].start) + ++ abs(conva->hline[a].end - conva->hline[b].end)); + } + + /* Merge two hlines. Line b is deleted, and any refs to b in vlines updated to + * point at a. + */ + static void +-vips_conva_merge( VipsConva *conva, int a, int b ) ++vips_conva_merge(VipsConva *conva, int a, int b) + { + int i; + +- /* Scale weights. ++ /* Scale weights. + */ + int fa = conva->hline[a].weight; + int fb = conva->hline[b].weight; +@@ -431,16 +431,16 @@ vips_conva_merge( VipsConva *conva, int a, int b ) + + /* New endpoints. + */ +- conva->hline[a].start += w * ++ conva->hline[a].start += w * + (conva->hline[b].start - conva->hline[a].start); +- conva->hline[a].end += w * ++ conva->hline[a].end += w * + (conva->hline[b].end - conva->hline[a].end); + conva->hline[a].weight += conva->hline[b].weight; + + /* Update velement refs to b to refer to a instead. + */ +- for( i = 0; i < conva->n_velement; i++ ) +- if( conva->velement[i].band == b ) ++ for (i = 0; i < conva->n_velement; i++) ++ if (conva->velement[i].band == b) + conva->velement[i].band = a; + + /* Mark b to be deleted. +@@ -449,12 +449,12 @@ vips_conva_merge( VipsConva *conva, int a, int b ) + } + + static int +-edge_sortfn( const void *p1, const void *p2 ) ++edge_sortfn(const void *p1, const void *p2) + { + Edge *a = (Edge *) p1; + Edge *b = (Edge *) p2; + +- return( a->d - b->d ); ++ return (a->d - b->d); + } + + /* Cluster in batches. Return non-zero if we merged some lines. +@@ -463,14 +463,14 @@ edge_sortfn( const void *p1, const void *p2 ) + * it's far faster. + */ + static int +-vips_conva_cluster2( VipsConva *conva ) ++vips_conva_cluster2(VipsConva *conva) + { + int i, j, k; + int worst; + int worst_i; + int merged; + +- for( i = 0; i < MAX_EDGES; i++ ) { ++ for (i = 0; i < MAX_EDGES; i++) { + conva->edge[i].a = -1; + conva->edge[i].b = -1; + conva->edge[i].d = 99999; +@@ -478,26 +478,26 @@ vips_conva_cluster2( VipsConva *conva ) + worst_i = 0; + worst = conva->edge[worst_i].d; + +- for( i = 0; i < conva->n_hline; i++ ) { +- if( conva->hline[i].weight == 0 ) ++ for (i = 0; i < conva->n_hline; i++) { ++ if (conva->hline[i].weight == 0) + continue; + +- for( j = i + 1; j < conva->n_hline; j++ ) { ++ for (j = i + 1; j < conva->n_hline; j++) { + int distance; + +- if( conva->hline[j].weight == 0 ) ++ if (conva->hline[j].weight == 0) + continue; + +- distance = vips_conva_distance( conva, i, j ); +- if( distance < worst ) { ++ distance = vips_conva_distance(conva, i, j); ++ if (distance < worst) { + conva->edge[worst_i].a = i; + conva->edge[worst_i].b = j; + conva->edge[worst_i].d = distance; + + worst_i = 0; + worst = conva->edge[worst_i].d; +- for( k = 0; k < MAX_EDGES; k++ ) +- if( conva->edge[k].d > worst ) { ++ for (k = 0; k < MAX_EDGES; k++) ++ if (conva->edge[k].d > worst) { + worst = conva->edge[k].d; + worst_i = k; + } +@@ -507,64 +507,64 @@ vips_conva_cluster2( VipsConva *conva ) + + /* Sort to get closest first. + */ +- qsort( conva->edge, MAX_EDGES, sizeof( Edge ), edge_sortfn ); ++ qsort(conva->edge, MAX_EDGES, sizeof(Edge), edge_sortfn); + + /* + printf( "edges:\n" ); + printf( " n a b d:\n" ); + for( i = 0; i < MAX_EDGES; i++ ) +- printf( "%2i) %3d %3d %3d\n", i, ++ printf( "%2i) %3d %3d %3d\n", i, + conva->edge[i].a, conva->edge[i].b, conva->edge[i].d ); + */ + + /* Merge from the top down. + */ + merged = 0; +- for( k = 0; k < MAX_EDGES; k++ ) { ++ for (k = 0; k < MAX_EDGES; k++) { + Edge *edge = &conva->edge[k]; + +- if( edge->d > conva->cluster ) ++ if (edge->d > conva->cluster) + break; + + /* Has been removed, see loop below. + */ +- if( edge->a == -1 ) ++ if (edge->a == -1) + continue; + +- vips_conva_merge( conva, edge->a, edge->b ); ++ vips_conva_merge(conva, edge->a, edge->b); + merged = 1; + + /* Nodes a and b have vanished or been moved. Remove any edges + * which refer to them from the edge list, + */ +- for( i = k; i < MAX_EDGES; i++ ) { ++ for (i = k; i < MAX_EDGES; i++) { + Edge *edgei = &conva->edge[i]; + +- if( edgei->a == edge->a || ++ if (edgei->a == edge->a || + edgei->b == edge->a || + edgei->a == edge->b || +- edgei->b == edge->b ) ++ edgei->b == edge->b) + edgei->a = -1; + } + } + +- return( merged ); ++ return (merged); + } + + /* Renumber after clustering. We will have removed a lot of hlines ... shuffle + * the rest down, adjust all the vline references. + */ + static void +-vips_conva_renumber( VipsConva *conva ) ++vips_conva_renumber(VipsConva *conva) + { + int i, j; + +- VIPS_DEBUG_MSG( "vips_conva_renumber: renumbering ...\n" ); ++ VIPS_DEBUG_MSG("vips_conva_renumber: renumbering ...\n"); + + /* Loop for all zero-weight hlines. + */ +- for( i = 0; i < conva->n_hline; ) { +- if( conva->hline[i].weight > 0 ) { ++ for (i = 0; i < conva->n_hline;) { ++ if (conva->hline[i].weight > 0) { + i++; + continue; + } +@@ -572,82 +572,81 @@ vips_conva_renumber( VipsConva *conva ) + /* We move hlines i + 1 down, so we need to adjust all + * band[] refs to match. + */ +- for( j = 0; j < conva->n_velement; j++ ) +- if( conva->velement[j].band > i ) ++ for (j = 0; j < conva->n_velement; j++) ++ if (conva->velement[j].band > i) + conva->velement[j].band -= 1; + +- memmove( conva->hline + i, conva->hline + i + 1, +- sizeof( HLine ) * (conva->n_hline - i - 1) ); ++ memmove(conva->hline + i, conva->hline + i + 1, ++ sizeof(HLine) * (conva->n_hline - i - 1)); + conva->n_hline -= 1; + } + +- +- VIPS_DEBUG_MSG( "vips_conva_renumber: ... %d hlines remain\n", +- conva->n_hline ); ++ VIPS_DEBUG_MSG("vips_conva_renumber: ... %d hlines remain\n", ++ conva->n_hline); + } + + /* Sort by band, then factor, then row. + */ + static int +-velement_sortfn( const void *p1, const void *p2 ) ++velement_sortfn(const void *p1, const void *p2) + { + VElement *a = (VElement *) p1; + VElement *b = (VElement *) p2; + +- if( a->band != b->band ) +- return( a->band - b->band ); ++ if (a->band != b->band) ++ return (a->band - b->band); + +- if( a->factor != b->factor ) +- return( a->factor - b->factor ); ++ if (a->factor != b->factor) ++ return (a->factor - b->factor); + +- return( a->row - b->row ); ++ return (a->row - b->row); + } + + static void +-vips_conva_vline( VipsConva *conva ) ++vips_conva_vline(VipsConva *conva) + { + int y, z; + +- VIPS_DEBUG_MSG( "vips_conva_vline: forming vlines ...\n" ); ++ VIPS_DEBUG_MSG("vips_conva_vline: forming vlines ...\n"); + + /* Sort to get elements which could form a vline together. + */ +- qsort( conva->velement, conva->n_velement, sizeof( VElement ), +- velement_sortfn ); ++ qsort(conva->velement, conva->n_velement, sizeof(VElement), ++ velement_sortfn); + + #ifdef DEBUG +- vips_conva_hprint( conva ); ++ vips_conva_hprint(conva); + #endif /*DEBUG*/ + + /* If two lines have the same row and band, we can join them and knock + * up the factor instead. + */ +- for( y = 0; y < conva->n_velement; y++ ) { +- for( z = y + 1; z < conva->n_velement; z++ ) +- if( conva->velement[z].band != +- conva->velement[y].band || +- conva->velement[z].row != +- conva->velement[y].row ) ++ for (y = 0; y < conva->n_velement; y++) { ++ for (z = y + 1; z < conva->n_velement; z++) ++ if (conva->velement[z].band != ++ conva->velement[y].band || ++ conva->velement[z].row != ++ conva->velement[y].row) + break; + + /* We need to keep the sign of the old factor. + */ +- if( conva->velement[y].factor > 0 ) ++ if (conva->velement[y].factor > 0) + conva->velement[y].factor = z - y; + else + conva->velement[y].factor = y - z; +- memmove( conva->velement + y + 1, conva->velement + z, +- sizeof( VElement ) * (conva->n_velement - z) ); ++ memmove(conva->velement + y + 1, conva->velement + z, ++ sizeof(VElement) * (conva->n_velement - z)); + conva->n_velement -= z - y - 1; + } + + #ifdef DEBUG +- printf( "after commoning up, %d velement remain\n", conva->n_velement ); +- vips_conva_hprint( conva ); ++ printf("after commoning up, %d velement remain\n", conva->n_velement); ++ vips_conva_hprint(conva); + #endif /*DEBUG*/ + + conva->n_vline = 0; +- for( y = 0; y < conva->n_velement; ) { ++ for (y = 0; y < conva->n_velement;) { + int n = conva->n_vline; + + /* Start of a line. +@@ -658,13 +657,13 @@ vips_conva_vline( VipsConva *conva ) + + /* Search for the end of this line. + */ +- for( z = y + 1; z < conva->n_velement; z++ ) +- if( conva->velement[z].band != ++ for (z = y + 1; z < conva->n_velement; z++) ++ if (conva->velement[z].band != + conva->vline[n].band || +- conva->velement[z].factor != ++ conva->velement[z].factor != + conva->vline[n].factor || +- conva->velement[z].row != +- conva->vline[n].start + z - y ) ++ conva->velement[z].row != ++ conva->vline[n].start + z - y) + break; + + /* So the line ends at the previously examined element. We +@@ -676,54 +675,55 @@ vips_conva_vline( VipsConva *conva ) + y = z; + } + +- VIPS_DEBUG_MSG( "vips_conva_vline: found %d vlines\n", conva->n_vline ); ++ VIPS_DEBUG_MSG("vips_conva_vline: found %d vlines\n", conva->n_vline); + } + + /* Break a mask into boxes. + */ + static int +-vips_conva_decompose_boxes( VipsConva *conva ) ++vips_conva_decompose_boxes(VipsConva *conva) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( conva ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(conva); + VipsImage *iM = conva->iM; +- double *coeff = VIPS_MATRIX( iM, 0, 0 ); ++ double *coeff = VIPS_MATRIX(iM, 0, 0); + const int size = iM->Xsize * iM->Ysize; +- double scale = vips_image_get_scale( iM ); +- double offset = vips_image_get_offset( iM ); ++ double scale = vips_image_get_scale(iM); ++ double offset = vips_image_get_offset(iM); + + double sum; + double area; + int x, y, z; + +- if( vips_conva_decompose_hlines( conva ) ) +- return( -1 ); ++ if (vips_conva_decompose_hlines(conva)) ++ return (-1); + + /* Cluster to find groups of lines. + */ +- VIPS_DEBUG_MSG( "vips_conva_decompose_boxes: " +- "clustering hlines with thresh %d ...\n", conva->cluster ); +- while( vips_conva_cluster2( conva ) ) ++ VIPS_DEBUG_MSG("vips_conva_decompose_boxes: " ++ "clustering hlines with thresh %d ...\n", ++ conva->cluster); ++ while (vips_conva_cluster2(conva)) + ; + + /* Renumber to remove holes created by clustering. + */ +- vips_conva_renumber( conva ); ++ vips_conva_renumber(conva); + + /* Find a set of vlines for the remaining hlines. + */ +- vips_conva_vline( conva ); ++ vips_conva_vline(conva); + + /* Find the area of the lines and the length of the longest hline. We + * find the absolute area, we don't want -ves to cancel. + */ + area = 0; + conva->max_line = 0; +- for( y = 0; y < conva->n_velement; y++ ) { ++ for (y = 0; y < conva->n_velement; y++) { + x = conva->velement[y].band; + z = conva->hline[x].end - conva->hline[x].start; + +- area += abs( conva->velement[y].factor * z ); +- if( z > conva->max_line ) ++ area += abs(conva->velement[y].factor * z); ++ if (z > conva->max_line) + conva->max_line = z; + } + +@@ -732,36 +732,36 @@ vips_conva_decompose_boxes( VipsConva *conva ) + * factor 1 lines as we can and to reduce the chance of overflow. + */ + x = conva->velement[0].factor; +- for( y = 1; y < conva->n_velement; y++ ) +- x = gcd( x, conva->velement[y].factor ); +- for( y = 0; y < conva->n_velement; y++ ) ++ for (y = 1; y < conva->n_velement; y++) ++ x = gcd(x, conva->velement[y].factor); ++ for (y = 0; y < conva->n_velement; y++) + conva->velement[y].factor /= x; + area *= x; + + /* Find the area of the original mask. Again, don't let -ves cancel. + */ + sum = 0; +- for( z = 0; z < size; z++ ) +- sum += fabs( coeff[z] ); ++ for (z = 0; z < size; z++) ++ sum += fabs(coeff[z]); + +- conva->divisor = VIPS_RINT( area * scale / sum ); ++ conva->divisor = VIPS_RINT(area * scale / sum); + conva->rounding = (conva->divisor + 1) / 2; + conva->offset = offset; + + #ifdef DEBUG +- vips_conva_hprint( conva ); +- vips_conva_vprint( conva ); ++ vips_conva_hprint(conva); ++ vips_conva_vprint(conva); + #endif /*DEBUG*/ + + /* With 512x512 tiles, each hline requires 3mb of intermediate per + * thread ... 300 lines is about a gb per thread, ouch. + */ +- if( conva->n_hline > 150 ) { +- vips_error( class->nickname, "%s", _( "mask too complex" ) ); +- return( -1 ); ++ if (conva->n_hline > 150) { ++ vips_error(class->nickname, "%s", _("mask too complex")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Our sequence value. +@@ -769,106 +769,108 @@ vips_conva_decompose_boxes( VipsConva *conva ) + typedef struct { + VipsConva *conva; + +- VipsRegion *ir; /* Input region */ ++ VipsRegion *ir; /* Input region */ + +- /* Offsets for start and stop. ++ /* Offsets for start and stop. + */ +- int *start; ++ int *start; + int *end; + +- int last_stride; /* Avoid recalcing offsets, if we can */ ++ int last_stride; /* Avoid recalcing offsets, if we can */ + +- /* The rolling sums. int for integer types, double for floating point ++ /* The rolling sums. int for integer types, double for floating point + * types. + */ +- void *sum; ++ void *sum; + } VipsConvaSeq; + + /* Free a sequence value. + */ + static int +-vips_conva_stop( void *vseq, void *a, void *b ) ++vips_conva_stop(void *vseq, void *a, void *b) + { + VipsConvaSeq *seq = (VipsConvaSeq *) vseq; + +- VIPS_UNREF( seq->ir ); ++ VIPS_UNREF(seq->ir); + +- return( 0 ); ++ return (0); + } + + /* Convolution start function. + */ + static void * +-vips_conva_start( VipsImage *out, void *a, void *b ) ++vips_conva_start(VipsImage *out, void *a, void *b) + { + VipsImage *in = (VipsImage *) a; + VipsConva *conva = (VipsConva *) b; + + VipsConvaSeq *seq; + +- seq = VIPS_NEW( out, VipsConvaSeq ); ++ seq = VIPS_NEW(out, VipsConvaSeq); + seq->conva = conva; +- seq->ir = vips_region_new( in ); ++ seq->ir = vips_region_new(in); + + /* n_velement should be the largest possible dimension. + */ +- g_assert( conva->n_velement >= conva->n_hline ); +- g_assert( conva->n_velement >= conva->n_vline ); ++ g_assert(conva->n_velement >= conva->n_hline); ++ g_assert(conva->n_velement >= conva->n_vline); + +- seq->start = VIPS_ARRAY( out, conva->n_velement, int ); +- seq->end = VIPS_ARRAY( out, conva->n_velement, int ); ++ seq->start = VIPS_ARRAY(out, conva->n_velement, int); ++ seq->end = VIPS_ARRAY(out, conva->n_velement, int); + +- if( vips_band_format_isint( out->BandFmt ) ) +- seq->sum = VIPS_ARRAY( out, conva->n_velement, int ); ++ if (vips_band_format_isint(out->BandFmt)) ++ seq->sum = VIPS_ARRAY(out, conva->n_velement, int); + else +- seq->sum = VIPS_ARRAY( out, conva->n_velement, double ); ++ seq->sum = VIPS_ARRAY(out, conva->n_velement, double); + seq->last_stride = -1; + +- return( seq ); ++ return (seq); + } + + /* The h and v loops are very similar, but also annoyingly different. Keep + * them separate for easy debugging. + */ + +-#define HCONV( IN, OUT ) \ +-G_STMT_START { \ +- for( i = 0; i < bands; i++ ) { \ +- OUT *seq_sum = (OUT *) seq->sum; \ +- \ +- IN *p; \ +- OUT *q; \ +- \ +- p = i + (IN *) VIPS_REGION_ADDR( ir, r->left, r->top + y ); \ +- q = i * n_hline + \ +- (OUT *) VIPS_REGION_ADDR( or, r->left, r->top + y ); \ +- \ +- for( z = 0; z < n_hline; z++ ) { \ +- seq_sum[z] = 0; \ +- for( x = conva->hline[z].start; \ +- x < conva->hline[z].end; x++ ) \ +- seq_sum[z] += p[x * istride]; \ +- q[z] = seq_sum[z]; \ +- } \ +- q += ostride; \ +- \ +- for( x = 1; x < r->width; x++ ) { \ +- for( z = 0; z < n_hline; z++ ) { \ +- seq_sum[z] += p[seq->end[z]]; \ +- seq_sum[z] -= p[seq->start[z]]; \ ++#define HCONV(IN, OUT) \ ++ G_STMT_START \ ++ { \ ++ for (i = 0; i < bands; i++) { \ ++ OUT *seq_sum = (OUT *) seq->sum; \ ++\ ++ IN *p; \ ++ OUT *q; \ ++\ ++ p = i + (IN *) VIPS_REGION_ADDR(ir, r->left, r->top + y); \ ++ q = i * n_hline + \ ++ (OUT *) VIPS_REGION_ADDR(or, r->left, r->top + y); \ ++\ ++ for (z = 0; z < n_hline; z++) { \ ++ seq_sum[z] = 0; \ ++ for (x = conva->hline[z].start; \ ++ x < conva->hline[z].end; x++) \ ++ seq_sum[z] += p[x * istride]; \ + q[z] = seq_sum[z]; \ + } \ +- p += istride; \ + q += ostride; \ ++\ ++ for (x = 1; x < r->width; x++) { \ ++ for (z = 0; z < n_hline; z++) { \ ++ seq_sum[z] += p[seq->end[z]]; \ ++ seq_sum[z] -= p[seq->start[z]]; \ ++ q[z] = seq_sum[z]; \ ++ } \ ++ p += istride; \ ++ q += ostride; \ ++ } \ + } \ + } \ +-} G_STMT_END ++ G_STMT_END + + /* Do horizontal masks ... we scan the mask along scanlines. + */ + static int +-vips_conva_hgenerate( VipsRegion *or, void *vseq, +- void *a, void *b, gboolean *stop ) ++vips_conva_hgenerate(VipsRegion * or, void *vseq, ++ void *a, void *b, gboolean *stop) + { + VipsConvaSeq *seq = (VipsConvaSeq *) vseq; + VipsImage *in = (VipsImage *) a; +@@ -877,12 +879,11 @@ vips_conva_hgenerate( VipsRegion *or, void *vseq, + VipsRegion *ir = seq->ir; + const int n_hline = conva->n_hline; + VipsImage *iM = conva->iM; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + + /* Double the bands (notionally) for complex. + */ +- int bands = vips_band_format_iscomplex( in->BandFmt ) ? +- 2 * in->Bands : in->Bands; ++ int bands = vips_band_format_iscomplex(in->BandFmt) ? 2 * in->Bands : in->Bands; + + VipsRect s; + int x, y, z, i; +@@ -894,71 +895,71 @@ vips_conva_hgenerate( VipsRegion *or, void *vseq, + */ + s = *r; + s.width += iM->Xsize - 1; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + +- istride = VIPS_IMAGE_SIZEOF_PEL( in ) / +- VIPS_IMAGE_SIZEOF_ELEMENT( in ); +- ostride = VIPS_IMAGE_SIZEOF_PEL( or->im ) / +- VIPS_IMAGE_SIZEOF_ELEMENT( or->im ); ++ istride = VIPS_IMAGE_SIZEOF_PEL(in) / ++ VIPS_IMAGE_SIZEOF_ELEMENT(in); ++ ostride = VIPS_IMAGE_SIZEOF_PEL(or->im) / ++ VIPS_IMAGE_SIZEOF_ELEMENT(or->im); + +- /* Init offset array. ++ /* Init offset array. + */ +- if( seq->last_stride != istride ) { ++ if (seq->last_stride != istride) { + seq->last_stride = istride; + +- for( z = 0; z < n_hline; z++ ) { ++ for (z = 0; z < n_hline; z++) { + seq->start[z] = conva->hline[z].start * istride; + seq->end[z] = conva->hline[z].end * istride; + } + } + +- for( y = 0; y < r->height; y++ ) { +- switch( in->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- if( conva->max_line < 256 ) +- HCONV( unsigned char, unsigned short ); ++ for (y = 0; y < r->height; y++) { ++ switch (in->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ if (conva->max_line < 256) ++ HCONV(unsigned char, unsigned short); + else +- HCONV( unsigned char, unsigned int ); ++ HCONV(unsigned char, unsigned int); + break; + +- case VIPS_FORMAT_CHAR: +- if( conva->max_line < 256 ) +- HCONV( signed char, signed short ); ++ case VIPS_FORMAT_CHAR: ++ if (conva->max_line < 256) ++ HCONV(signed char, signed short); + else +- HCONV( signed char, signed int ); ++ HCONV(signed char, signed int); + break; + +- case VIPS_FORMAT_USHORT: +- HCONV( unsigned short, unsigned int ); ++ case VIPS_FORMAT_USHORT: ++ HCONV(unsigned short, unsigned int); + break; + +- case VIPS_FORMAT_SHORT: +- HCONV( signed short, signed int ); ++ case VIPS_FORMAT_SHORT: ++ HCONV(signed short, signed int); + break; + +- case VIPS_FORMAT_UINT: +- HCONV( unsigned int, unsigned int ); ++ case VIPS_FORMAT_UINT: ++ HCONV(unsigned int, unsigned int); + break; + +- case VIPS_FORMAT_INT: +- HCONV( signed int, signed int ); ++ case VIPS_FORMAT_INT: ++ HCONV(signed int, signed int); + break; + +- case VIPS_FORMAT_FLOAT: +- HCONV( float, float ); ++ case VIPS_FORMAT_FLOAT: ++ HCONV(float, float); + break; + +- case VIPS_FORMAT_DOUBLE: +- HCONV( double, double ); ++ case VIPS_FORMAT_DOUBLE: ++ HCONV(double, double); + break; + +- case VIPS_FORMAT_COMPLEX: +- HCONV( float, float ); ++ case VIPS_FORMAT_COMPLEX: ++ HCONV(float, float); + break; + +- case VIPS_FORMAT_DPCOMPLEX: +- HCONV( double, double ); ++ case VIPS_FORMAT_DPCOMPLEX: ++ HCONV(double, double); + break; + + default: +@@ -966,130 +967,140 @@ vips_conva_hgenerate( VipsRegion *or, void *vseq, + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_conva_horizontal( VipsConva *conva, VipsImage *in, VipsImage **out ) ++vips_conva_horizontal(VipsConva *conva, VipsImage *in, VipsImage **out) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( conva ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(conva); + + /* Prepare output. Consider a 7x7 mask and a 7x7 image --- the output + * would be 1x1. + */ +- *out = vips_image_new(); +- if( vips_image_pipelinev( *out, +- VIPS_DEMAND_STYLE_SMALLTILE, in, NULL ) ) +- return( -1 ); ++ *out = vips_image_new(); ++ if (vips_image_pipelinev(*out, ++ VIPS_DEMAND_STYLE_SMALLTILE, in, NULL)) ++ return (-1); + + (*out)->Xsize -= conva->iM->Xsize - 1; +- if( (*out)->Xsize <= 0 ) { +- vips_error( class->nickname, +- "%s", _( "image too small for mask" ) ); +- return( -1 ); ++ if ((*out)->Xsize <= 0) { ++ vips_error(class->nickname, ++ "%s", _("image too small for mask")); ++ return (-1); + } + (*out)->Bands *= conva->n_hline; + + /* Short u?char lines can use u?short intermediate. + */ +- if( vips_band_format_isuint( in->BandFmt ) ) +- (*out)->BandFmt = conva->max_line < 256 ? +- VIPS_FORMAT_USHORT : VIPS_FORMAT_UINT; +- else if( vips_band_format_isint( in->BandFmt ) ) +- (*out)->BandFmt = conva->max_line < 256 ? +- VIPS_FORMAT_SHORT : VIPS_FORMAT_INT; +- +- if( vips_image_generate( *out, +- vips_conva_start, vips_conva_hgenerate, vips_conva_stop, +- in, conva ) ) +- return( -1 ); +- +- return( 0 ); ++ if (vips_band_format_isuint(in->BandFmt)) ++ (*out)->BandFmt = conva->max_line < 256 ? VIPS_FORMAT_USHORT : VIPS_FORMAT_UINT; ++ else if (vips_band_format_isint(in->BandFmt)) ++ (*out)->BandFmt = conva->max_line < 256 ? VIPS_FORMAT_SHORT : VIPS_FORMAT_INT; ++ ++ if (vips_image_generate(*out, ++ vips_conva_start, vips_conva_hgenerate, vips_conva_stop, ++ in, conva)) ++ return (-1); ++ ++ return (0); + } + +-#define CLIP_UCHAR( V ) \ +-G_STMT_START { \ +- if( (V) < 0 ) \ +- (V) = 0; \ +- else if( (V) > UCHAR_MAX ) \ +- (V) = UCHAR_MAX; \ +-} G_STMT_END +- +-#define CLIP_CHAR( V ) \ +-G_STMT_START { \ +- if( (V) < SCHAR_MIN ) \ +- (V) = SCHAR_MIN; \ +- else if( (V) > SCHAR_MAX ) \ +- (V) = SCHAR_MAX; \ +-} G_STMT_END +- +-#define CLIP_USHORT( V ) \ +-G_STMT_START { \ +- if( (V) < 0 ) \ +- (V) = 0; \ +- else if( (V) > USHRT_MAX ) \ +- (V) = USHRT_MAX; \ +-} G_STMT_END +- +-#define CLIP_SHORT( V ) \ +-G_STMT_START { \ +- if( (V) < SHRT_MIN ) \ +- (V) = SHRT_MIN; \ +- else if( (V) > SHRT_MAX ) \ +- (V) = SHRT_MAX; \ +-} G_STMT_END +- +-#define CLIP_NONE( V ) {} +- +-#define VCONV( ACC, IN, OUT, CLIP ) \ +-G_STMT_START { \ +- for( x = 0; x < sz; x++ ) { \ +- ACC *seq_sum = (ACC *) seq->sum; \ +- \ +- IN *p; \ +- OUT *q; \ +- ACC sum; \ +- \ +- p = x * conva->n_hline + \ +- (IN *) VIPS_REGION_ADDR( ir, r->left, r->top ); \ +- q = x + (OUT *) VIPS_REGION_ADDR( or, r->left, r->top ); \ +- \ +- sum = 0; \ +- for( z = 0; z < n_vline; z++ ) { \ +- seq_sum[z] = 0; \ +- for( k = conva->vline[z].start; \ +- k < conva->vline[z].end; k++ ) \ +- seq_sum[z] += p[k * istride + \ +- conva->vline[z].band]; \ +- sum += conva->vline[z].factor * seq_sum[z]; \ +- } \ +- sum = (sum + conva->rounding) / conva->divisor + conva->offset; \ +- CLIP( sum ); \ +- *q = sum; \ +- q += ostride; \ +- \ +- for( y = 1; y < r->height; y++ ) { \ +- sum = 0;\ +- for( z = 0; z < n_vline; z++ ) { \ +- seq_sum[z] += p[seq->end[z]]; \ +- seq_sum[z] -= p[seq->start[z]]; \ ++#define CLIP_UCHAR(V) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < 0) \ ++ (V) = 0; \ ++ else if ((V) > UCHAR_MAX) \ ++ (V) = UCHAR_MAX; \ ++ } \ ++ G_STMT_END ++ ++#define CLIP_CHAR(V) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < SCHAR_MIN) \ ++ (V) = SCHAR_MIN; \ ++ else if ((V) > SCHAR_MAX) \ ++ (V) = SCHAR_MAX; \ ++ } \ ++ G_STMT_END ++ ++#define CLIP_USHORT(V) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < 0) \ ++ (V) = 0; \ ++ else if ((V) > USHRT_MAX) \ ++ (V) = USHRT_MAX; \ ++ } \ ++ G_STMT_END ++ ++#define CLIP_SHORT(V) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < SHRT_MIN) \ ++ (V) = SHRT_MIN; \ ++ else if ((V) > SHRT_MAX) \ ++ (V) = SHRT_MAX; \ ++ } \ ++ G_STMT_END ++ ++#define CLIP_NONE(V) \ ++ { \ ++ } ++ ++#define VCONV(ACC, IN, OUT, CLIP) \ ++ G_STMT_START \ ++ { \ ++ for (x = 0; x < sz; x++) { \ ++ ACC *seq_sum = (ACC *) seq->sum; \ ++\ ++ IN *p; \ ++ OUT *q; \ ++ ACC sum; \ ++\ ++ p = x * conva->n_hline + \ ++ (IN *) VIPS_REGION_ADDR(ir, r->left, r->top); \ ++ q = x + (OUT *) VIPS_REGION_ADDR(or, r->left, r->top); \ ++\ ++ sum = 0; \ ++ for (z = 0; z < n_vline; z++) { \ ++ seq_sum[z] = 0; \ ++ for (k = conva->vline[z].start; \ ++ k < conva->vline[z].end; k++) \ ++ seq_sum[z] += p[k * istride + \ ++ conva->vline[z].band]; \ + sum += conva->vline[z].factor * seq_sum[z]; \ + } \ +- p += istride; \ +- sum = (sum + conva->rounding) / conva->divisor + \ +- conva->offset; \ +- CLIP( sum ); \ ++ sum = (sum + conva->rounding) / conva->divisor + conva->offset; \ ++ CLIP(sum); \ + *q = sum; \ + q += ostride; \ ++\ ++ for (y = 1; y < r->height; y++) { \ ++ sum = 0; \ ++ for (z = 0; z < n_vline; z++) { \ ++ seq_sum[z] += p[seq->end[z]]; \ ++ seq_sum[z] -= p[seq->start[z]]; \ ++ sum += conva->vline[z].factor * seq_sum[z]; \ ++ } \ ++ p += istride; \ ++ sum = (sum + conva->rounding) / conva->divisor + \ ++ conva->offset; \ ++ CLIP(sum); \ ++ *q = sum; \ ++ q += ostride; \ ++ } \ + } \ + } \ +-} G_STMT_END ++ G_STMT_END + +-/* Do vertical masks ... we scan the mask down columns of pixels. ++/* Do vertical masks ... we scan the mask down columns of pixels. + */ + static int +-vips_conva_vgenerate( VipsRegion *or, void *vseq, +- void *a, void *b, gboolean *stop ) ++vips_conva_vgenerate(VipsRegion * or, void *vseq, ++ void *a, void *b, gboolean *stop) + { + VipsConvaSeq *seq = (VipsConvaSeq *) vseq; + VipsImage *in = (VipsImage *) a; +@@ -1099,12 +1110,11 @@ vips_conva_vgenerate( VipsRegion *or, void *vseq, + VipsRegion *ir = seq->ir; + const int n_vline = conva->n_vline; + VipsImage *iM = conva->iM; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + + /* Double the width (notionally) for complex. + */ +- int sz = vips_band_format_iscomplex( in->BandFmt ) ? +- 2 * VIPS_REGION_N_ELEMENTS( or ) : VIPS_REGION_N_ELEMENTS( or ); ++ int sz = vips_band_format_iscomplex(in->BandFmt) ? 2 * VIPS_REGION_N_ELEMENTS(or) : VIPS_REGION_N_ELEMENTS(or); + + VipsRect s; + int x, y, z, k; +@@ -1116,199 +1126,198 @@ vips_conva_vgenerate( VipsRegion *or, void *vseq, + */ + s = *r; + s.height += iM->Ysize - 1; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + +- istride = VIPS_REGION_LSKIP( ir ) / +- VIPS_IMAGE_SIZEOF_ELEMENT( in ); +- ostride = VIPS_REGION_LSKIP( or ) / +- VIPS_IMAGE_SIZEOF_ELEMENT( convolution->out ); ++ istride = VIPS_REGION_LSKIP(ir) / ++ VIPS_IMAGE_SIZEOF_ELEMENT(in); ++ ostride = VIPS_REGION_LSKIP(or) / ++ VIPS_IMAGE_SIZEOF_ELEMENT(convolution->out); + +- /* Init offset array. ++ /* Init offset array. + */ +- if( seq->last_stride != istride ) { ++ if (seq->last_stride != istride) { + seq->last_stride = istride; + +- for( z = 0; z < n_vline; z++ ) { +- seq->start[z] = conva->vline[z].band + ++ for (z = 0; z < n_vline; z++) { ++ seq->start[z] = conva->vline[z].band + + conva->vline[z].start * istride; +- seq->end[z] = conva->vline[z].band + ++ seq->end[z] = conva->vline[z].band + + conva->vline[z].end * istride; + } + } + +- switch( convolution->in->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- if( conva->max_line < 256 ) +- VCONV( unsigned int, \ +- unsigned short, unsigned char, CLIP_UCHAR ); ++ switch (convolution->in->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ if (conva->max_line < 256) ++ VCONV(unsigned int, ++ unsigned short, unsigned char, CLIP_UCHAR); + else +- VCONV( unsigned int, \ +- unsigned int, unsigned char, CLIP_UCHAR ); ++ VCONV(unsigned int, ++ unsigned int, unsigned char, CLIP_UCHAR); + break; + +- case VIPS_FORMAT_CHAR: +- if( conva->max_line < 256 ) +- VCONV( signed int, \ +- signed short, signed char, CLIP_CHAR ); ++ case VIPS_FORMAT_CHAR: ++ if (conva->max_line < 256) ++ VCONV(signed int, ++ signed short, signed char, CLIP_CHAR); + else +- VCONV( signed int, \ +- signed int, signed char, CLIP_CHAR ); ++ VCONV(signed int, ++ signed int, signed char, CLIP_CHAR); + break; + +- case VIPS_FORMAT_USHORT: +- VCONV( unsigned int, \ +- unsigned int, unsigned short, CLIP_USHORT ); ++ case VIPS_FORMAT_USHORT: ++ VCONV(unsigned int, ++ unsigned int, unsigned short, CLIP_USHORT); + break; + +- case VIPS_FORMAT_SHORT: +- VCONV( signed int, signed int, signed short, CLIP_SHORT ); ++ case VIPS_FORMAT_SHORT: ++ VCONV(signed int, signed int, signed short, CLIP_SHORT); + break; + +- case VIPS_FORMAT_UINT: +- VCONV( unsigned int, unsigned int, unsigned int, CLIP_NONE ); ++ case VIPS_FORMAT_UINT: ++ VCONV(unsigned int, unsigned int, unsigned int, CLIP_NONE); + break; + +- case VIPS_FORMAT_INT: +- VCONV( signed int, signed int, signed int, CLIP_NONE ); ++ case VIPS_FORMAT_INT: ++ VCONV(signed int, signed int, signed int, CLIP_NONE); + break; + +- case VIPS_FORMAT_FLOAT: +- VCONV( float, float, float, CLIP_NONE ); ++ case VIPS_FORMAT_FLOAT: ++ VCONV(float, float, float, CLIP_NONE); + break; + +- case VIPS_FORMAT_DOUBLE: +- VCONV( double, double, double, CLIP_NONE ); ++ case VIPS_FORMAT_DOUBLE: ++ VCONV(double, double, double, CLIP_NONE); + break; + +- case VIPS_FORMAT_COMPLEX: +- VCONV( float, float, float, CLIP_NONE ); ++ case VIPS_FORMAT_COMPLEX: ++ VCONV(float, float, float, CLIP_NONE); + break; + +- case VIPS_FORMAT_DPCOMPLEX: +- VCONV( double, double, double, CLIP_NONE ); ++ case VIPS_FORMAT_DPCOMPLEX: ++ VCONV(double, double, double, CLIP_NONE); + break; + + default: + g_assert_not_reached(); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_conva_vertical( VipsConva *conva, VipsImage *in, VipsImage **out ) ++vips_conva_vertical(VipsConva *conva, VipsImage *in, VipsImage **out) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( conva ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(conva); + VipsConvolution *convolution = (VipsConvolution *) conva; + + /* Prepare output. Consider a 7x7 mask and a 7x7 image --- the output + * would be 1x1. + */ +- *out = vips_image_new(); +- if( vips_image_pipelinev( *out, +- VIPS_DEMAND_STYLE_SMALLTILE, in, NULL ) ) +- return( -1 ); ++ *out = vips_image_new(); ++ if (vips_image_pipelinev(*out, ++ VIPS_DEMAND_STYLE_SMALLTILE, in, NULL)) ++ return (-1); + + (*out)->Ysize -= conva->iM->Ysize - 1; +- if( (*out)->Ysize <= 0 ) { +- vips_error( class->nickname, +- "%s", _( "image too small for mask" ) ); +- return( -1 ); ++ if ((*out)->Ysize <= 0) { ++ vips_error(class->nickname, ++ "%s", _("image too small for mask")); ++ return (-1); + } + (*out)->Bands = convolution->in->Bands; + (*out)->BandFmt = convolution->in->BandFmt; + +- if( vips_image_generate( *out, +- vips_conva_start, vips_conva_vgenerate, vips_conva_stop, +- in, conva ) ) +- return( -1 ); ++ if (vips_image_generate(*out, ++ vips_conva_start, vips_conva_vgenerate, vips_conva_stop, ++ in, conva)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_conva_build( VipsObject *object ) ++vips_conva_build(VipsObject *object) + { + VipsConvolution *convolution = (VipsConvolution *) object; + VipsConva *conva = (VipsConva *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_conva_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_conva_parent_class)->build(object)) ++ return (-1); + + /* An int version of our mask. + */ +- if( vips__image_intize( convolution->M, &t[0] ) ) +- return( -1 ); +- conva->iM = t[0]; ++ if (vips__image_intize(convolution->M, &t[0])) ++ return (-1); ++ conva->iM = t[0]; + + #ifdef DEBUG +- printf( "vips_conva_build: iM =\n" ); +- vips_matrixprint( conva->iM, NULL ); ++ printf("vips_conva_build: iM =\n"); ++ vips_matrixprint(conva->iM, NULL); + #endif /*DEBUG*/ + + in = convolution->in; + +- if( vips_conva_decompose_boxes( conva ) ) +- return( -1 ); ++ if (vips_conva_decompose_boxes(conva)) ++ return (-1); + +- g_object_set( conva, "out", vips_image_new(), NULL ); +- if( +- vips_embed( in, &t[1], +- t[0]->Xsize / 2, +- t[0]->Ysize / 2, +- in->Xsize + t[0]->Xsize - 1, ++ g_object_set(conva, "out", vips_image_new(), NULL); ++ if ( ++ vips_embed(in, &t[1], ++ t[0]->Xsize / 2, ++ t[0]->Ysize / 2, ++ in->Xsize + t[0]->Xsize - 1, + in->Ysize + t[0]->Ysize - 1, + "extend", VIPS_EXTEND_COPY, +- NULL ) || +- vips_conva_horizontal( conva, t[1], &t[2] ) || +- vips_conva_vertical( conva, t[2], &t[3] ) || +- vips_image_write( t[3], convolution->out ) ) +- return( -1 ); ++ NULL) || ++ vips_conva_horizontal(conva, t[1], &t[2]) || ++ vips_conva_vertical(conva, t[2], &t[3]) || ++ vips_image_write(t[3], convolution->out)) ++ return (-1); + + convolution->out->Xoffset = 0; + convolution->out->Yoffset = 0; + +- return( 0 ); ++ return (0); + } + + static void +-vips_conva_class_init( VipsConvaClass *class ) ++vips_conva_class_init(VipsConvaClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "conva"; +- object_class->description = _( "approximate integer convolution" ); ++ object_class->description = _("approximate integer convolution"); + object_class->build = vips_conva_build; + +- VIPS_ARG_INT( class, "layers", 104, +- _( "Layers" ), +- _( "Use this many layers in approximation" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsConva, layers ), +- 1, 1000, 5 ); +- +- VIPS_ARG_INT( class, "cluster", 105, +- _( "Cluster" ), +- _( "Cluster lines closer than this in approximation" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsConva, cluster ), +- 1, 100, 1 ); +- ++ VIPS_ARG_INT(class, "layers", 104, ++ _("Layers"), ++ _("Use this many layers in approximation"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsConva, layers), ++ 1, 1000, 5); ++ ++ VIPS_ARG_INT(class, "cluster", 105, ++ _("Cluster"), ++ _("Cluster lines closer than this in approximation"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsConva, cluster), ++ 1, 100, 1); + } + + static void +-vips_conva_init( VipsConva *conva ) ++vips_conva_init(VipsConva *conva) + { +- conva->layers = 5; +- conva->cluster = 1; ++ conva->layers = 5; ++ conva->cluster = 1; + } + + /** +@@ -1324,17 +1333,17 @@ vips_conva_init( VipsConva *conva ) + * * @cluster: %gint, cluster lines closer than this distance + * + * Perform an approximate integer convolution of @in with @mask. +- * This is a low-level operation, see +- * vips_conv() for something more convenient. ++ * This is a low-level operation, see ++ * vips_conv() for something more convenient. + * +- * The output image +- * always has the same #VipsBandFormat as the input image. ++ * The output image ++ * always has the same #VipsBandFormat as the input image. + * Elements of @mask are converted to + * integers before convolution. + * + * Larger values for @layers give more accurate + * results, but are slower. As @layers approaches the mask radius, the +- * accuracy will become close to exact convolution and the speed will drop to ++ * accuracy will become close to exact convolution and the speed will drop to + * match. For many large masks, such as Gaussian, @layers need be only 10% of + * this value and accuracy will still be good. + * +@@ -1345,16 +1354,15 @@ vips_conva_init( VipsConva *conva ) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_conva( VipsImage *in, VipsImage **out, VipsImage *mask, ... ) ++int ++vips_conva(VipsImage *in, VipsImage **out, VipsImage *mask, ...) + { + va_list ap; + int result; + +- va_start( ap, mask ); +- result = vips_call_split( "conva", ap, in, out, mask ); +- va_end( ap ); ++ va_start(ap, mask); ++ result = vips_call_split("conva", ap, in, out, mask); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/convolution/convasep.c b/libvips/convolution/convasep.c +index d0c94094b0..9bee52dd81 100644 +--- a/libvips/convolution/convasep.c ++++ b/libvips/convolution/convasep.c +@@ -1,10 +1,10 @@ + /* convasep ... separable approximate convolution + * +- * This operation does an approximate, seperable convolution. ++ * This operation does an approximate, seperable convolution. + * + * Author: John Cupitt & Nicolas Robidoux + * Written on: 31/5/11 +- * Modified on: ++ * Modified on: + * 31/5/11 + * - from im_conv() + * 5/7/16 +@@ -13,28 +13,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -44,7 +44,7 @@ + + http://incubator.quasimondo.com/processing/stackblur.pde + +- This thing is a little like stackblur, but generalised to any separable ++ This thing is a little like stackblur, but generalised to any separable + mask. + + */ +@@ -53,16 +53,16 @@ + + TODO + +- - how about making a cumulative image and then subtracting points in ++ - how about making a cumulative image and then subtracting points in + that, rather than keeping a set of running totals + + faster? + +- we could then use orc to write a bit of code to implement this set ++ we could then use orc to write a bit of code to implement this set + of lines + +- stackoverflow has an algorithm for cumulativization using SIMD and +- threads, see that font rasterization with rust piece on medium by ++ stackoverflow has an algorithm for cumulativization using SIMD and ++ threads, see that font rasterization with rust piece on medium by + ralph levien + + */ +@@ -96,12 +96,12 @@ + /* Euclid's algorithm. Use this to common up mults. + */ + static int +-gcd( int a, int b ) ++gcd(int a, int b) + { +- if( b == 0 ) +- return( abs( a ) ); ++ if (b == 0) ++ return (abs(a)); + else +- return( gcd( b, a % b ) ); ++ return (gcd(b, a % b)); + } + + typedef struct { +@@ -113,8 +113,8 @@ typedef struct { + int rounding; + int offset; + +- /* The "width" of the mask, ie. n for our 1xn or nx1 argument, plus +- * an int version of our mask. ++ /* The "width" of the mask, ie. n for our 1xn or nx1 argument, plus ++ * an int version of our mask. + */ + int width; + VipsImage *iM; +@@ -132,40 +132,40 @@ typedef struct { + + typedef VipsConvolutionClass VipsConvasepClass; + +-G_DEFINE_TYPE( VipsConvasep, vips_convasep, VIPS_TYPE_CONVOLUTION ); ++G_DEFINE_TYPE(VipsConvasep, vips_convasep, VIPS_TYPE_CONVOLUTION); + + static void +-vips_convasep_line_start( VipsConvasep *convasep, int x, int factor ) ++vips_convasep_line_start(VipsConvasep *convasep, int x, int factor) + { + convasep->start[convasep->n_lines] = x; + convasep->factor[convasep->n_lines] = factor; + } + + static int +-vips_convasep_line_end( VipsConvasep *convasep, int x ) ++vips_convasep_line_end(VipsConvasep *convasep, int x) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( convasep ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(convasep); + + convasep->end[convasep->n_lines] = x; + +- if( convasep->n_lines >= MAX_LINES - 1 ) { +- vips_error( class->nickname, "%s", _( "mask too complex" ) ); +- return( -1 ); ++ if (convasep->n_lines >= MAX_LINES - 1) { ++ vips_error(class->nickname, "%s", _("mask too complex")); ++ return (-1); + } + convasep->n_lines += 1; + +- return( 0 ); ++ return (0); + } + + /* Break a mask into lines. + */ + static int +-vips_convasep_decompose( VipsConvasep *convasep ) ++vips_convasep_decompose(VipsConvasep *convasep) + { + VipsImage *iM = convasep->iM; +- double *coeff = (double *) VIPS_IMAGE_ADDR( iM, 0, 0 ); +- double scale = vips_image_get_scale( iM ); +- double offset = vips_image_get_offset( iM ); ++ double *coeff = (double *) VIPS_IMAGE_ADDR(iM, 0, 0); ++ double scale = vips_image_get_scale(iM); ++ double offset = vips_image_get_offset(iM); + + double max; + double min; +@@ -177,17 +177,18 @@ vips_convasep_decompose( VipsConvasep *convasep ) + int layers_below; + int z, n, x; + +- VIPS_DEBUG_MSG( "vips_convasep_decompose: " +- "breaking into %d layers ...\n", convasep->layers ); ++ VIPS_DEBUG_MSG("vips_convasep_decompose: " ++ "breaking into %d layers ...\n", ++ convasep->layers); + + /* Find mask range. We must always include the zero axis in the mask. + */ + max = 0; + min = 0; +- for( x = 0; x < convasep->width; x++ ) { +- if( coeff[x] > max ) ++ for (x = 0; x < convasep->width; x++) { ++ if (coeff[x] > max) + max = coeff[x]; +- if( coeff[x] < min ) ++ if (coeff[x] < min) + min = coeff[x]; + } + +@@ -196,17 +197,17 @@ vips_convasep_decompose( VipsConvasep *convasep ) + * fixed n-lines which includes any negative parts. + */ + depth = (max - min) / convasep->layers; +- layers_above = ceil( max / depth ); ++ layers_above = ceil(max / depth); + depth = max / layers_above; +- layers_below = floor( min / depth ); ++ layers_below = floor(min / depth); + layers = layers_above - layers_below; + +- VIPS_DEBUG_MSG( "depth = %g, layers = %d\n", depth, layers ); ++ VIPS_DEBUG_MSG("depth = %g, layers = %d\n", depth, layers); + + /* For each layer, generate a set of lines which are inside the + * perimeter. Work down from the top. + */ +- for( z = 0; z < layers; z++ ) { ++ for (z = 0; z < layers; z++) { + double y = max - (1 + z) * depth; + + /* y plus half depth ... ie. the layer midpoint. +@@ -224,37 +225,37 @@ vips_convasep_decompose( VipsConvasep *convasep ) + */ + inside = 0; + +- for( x = 0; x < convasep->width; x++ ) { ++ for (x = 0; x < convasep->width; x++) { + /* The vertical line from mask[z] to 0 is inside. Is + * our current square (x, y) part of that line? + */ +- if( (y_positive && coeff[x] >= y_ph) || +- (!y_positive && coeff[x] <= y_ph) ) { +- if( !inside ) { +- vips_convasep_line_start( convasep, x, +- y_positive ? 1 : -1 ); ++ if ((y_positive && coeff[x] >= y_ph) || ++ (!y_positive && coeff[x] <= y_ph)) { ++ if (!inside) { ++ vips_convasep_line_start(convasep, x, ++ y_positive ? 1 : -1); + inside = 1; + } + } +- else if( inside ) { +- if( vips_convasep_line_end( convasep, x ) ) +- return( -1 ); ++ else if (inside) { ++ if (vips_convasep_line_end(convasep, x)) ++ return (-1); + inside = 0; + } + } + +- if( inside && +- vips_convasep_line_end( convasep, convasep->width ) ) +- return( -1 ); ++ if (inside && ++ vips_convasep_line_end(convasep, convasep->width)) ++ return (-1); + } + + /* Can we common up any lines? Search for lines with identical + * start/end. + */ +- for( z = 0; z < convasep->n_lines; z++ ) { +- for( n = z + 1; n < convasep->n_lines; n++ ) { +- if( convasep->start[z] == convasep->start[n] && +- convasep->end[z] == convasep->end[n] ) { ++ for (z = 0; z < convasep->n_lines; z++) { ++ for (n = z + 1; n < convasep->n_lines; n++) { ++ if (convasep->start[z] == convasep->start[n] && ++ convasep->end[z] == convasep->end[n]) { + convasep->factor[z] += convasep->factor[n]; + + /* n can be deleted. Do this in a separate +@@ -267,9 +268,9 @@ vips_convasep_decompose( VipsConvasep *convasep ) + + /* Now we can remove all factor 0 lines. + */ +- for( z = 0; z < convasep->n_lines; z++ ) { +- if( convasep->factor[z] == 0 ) { +- for( x = z; x < convasep->n_lines; x++ ) { ++ for (z = 0; z < convasep->n_lines; z++) { ++ if (convasep->factor[z] == 0) { ++ for (x = z; x < convasep->n_lines; x++) { + convasep->start[x] = convasep->start[x + 1]; + convasep->end[x] = convasep->end[x + 1]; + convasep->factor[x] = convasep->factor[x + 1]; +@@ -281,8 +282,8 @@ vips_convasep_decompose( VipsConvasep *convasep ) + /* Find the area of the lines. + */ + area = 0; +- for( z = 0; z < convasep->n_lines; z++ ) +- area += convasep->factor[z] * ++ for (z = 0; z < convasep->n_lines; z++) ++ area += convasep->factor[z] * + (convasep->end[z] - convasep->start[z]); + + /* Strength reduction: if all lines are divisible by n, we can move +@@ -290,20 +291,20 @@ vips_convasep_decompose( VipsConvasep *convasep ) + * factor 1 lines as we can and to reduce the chance of overflow. + */ + x = convasep->factor[0]; +- for( z = 1; z < convasep->n_lines; z++ ) +- x = gcd( x, convasep->factor[z] ); +- for( z = 0; z < convasep->n_lines; z++ ) ++ for (z = 1; z < convasep->n_lines; z++) ++ x = gcd(x, convasep->factor[z]); ++ for (z = 0; z < convasep->n_lines; z++) + convasep->factor[z] /= x; + area *= x; + + /* Find the area of the original mask. + */ + sum = 0; +- for( z = 0; z < convasep->width; z++ ) ++ for (z = 0; z < convasep->width; z++) + sum += coeff[z]; + +- convasep->divisor = VIPS_RINT( sum * area / scale ); +- if( convasep->divisor == 0 ) ++ convasep->divisor = VIPS_RINT(sum * area / scale); ++ if (convasep->divisor == 0) + convasep->divisor = 1; + convasep->rounding = (convasep->divisor + 1) / 2; + convasep->offset = offset; +@@ -311,25 +312,25 @@ vips_convasep_decompose( VipsConvasep *convasep ) + #ifdef DEBUG + /* ASCII-art layer drawing. + */ +- printf( "lines:\n" ); +- for( z = 0; z < convasep->n_lines; z++ ) { +- printf( "%3d - %2d x ", z, convasep->factor[z] ); +- for( x = 0; x < 55; x++ ) { ++ printf("lines:\n"); ++ for (z = 0; z < convasep->n_lines; z++) { ++ printf("%3d - %2d x ", z, convasep->factor[z]); ++ for (x = 0; x < 55; x++) { + int rx = x * (convasep->width + 1) / 55; + +- if( rx >= convasep->start[z] && rx < convasep->end[z] ) +- printf( "#" ); ++ if (rx >= convasep->start[z] && rx < convasep->end[z]) ++ printf("#"); + else +- printf( " " ); ++ printf(" "); + } +- printf( " %3d .. %3d\n", convasep->start[z], convasep->end[z] ); ++ printf(" %3d .. %3d\n", convasep->start[z], convasep->end[z]); + } +- printf( "divisor = %d\n", convasep->divisor ); +- printf( "rounding = %d\n", convasep->rounding ); +- printf( "offset = %d\n", convasep->offset ); ++ printf("divisor = %d\n", convasep->divisor); ++ printf("rounding = %d\n", convasep->rounding); ++ printf("offset = %d\n", convasep->offset); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + /* Our sequence value. +@@ -337,201 +338,213 @@ vips_convasep_decompose( VipsConvasep *convasep ) + typedef struct { + VipsConvasep *convasep; + +- VipsRegion *ir; /* Input region */ ++ VipsRegion *ir; /* Input region */ + +- int *start; /* Offsets for start and stop */ ++ int *start; /* Offsets for start and stop */ + int *end; + + /* The sums for each line. int for integer types, double for floating + * point types. + */ +- int *isum; +- double *dsum; ++ int *isum; ++ double *dsum; + +- int last_stride; /* Avoid recalcing offsets, if we can */ ++ int last_stride; /* Avoid recalcing offsets, if we can */ + } VipsConvasepSeq; + + /* Free a sequence value. + */ + static int +-vips_convasep_stop( void *vseq, void *a, void *b ) ++vips_convasep_stop(void *vseq, void *a, void *b) + { + VipsConvasepSeq *seq = (VipsConvasepSeq *) vseq; + +- VIPS_UNREF( seq->ir ); +- VIPS_FREE( seq->start ); +- VIPS_FREE( seq->end ); +- VIPS_FREE( seq->isum ); +- VIPS_FREE( seq->dsum ); ++ VIPS_UNREF(seq->ir); ++ VIPS_FREE(seq->start); ++ VIPS_FREE(seq->end); ++ VIPS_FREE(seq->isum); ++ VIPS_FREE(seq->dsum); + +- return( 0 ); ++ return (0); + } + + /* Convolution start function. + */ + static void * +-vips_convasep_start( VipsImage *out, void *a, void *b ) ++vips_convasep_start(VipsImage *out, void *a, void *b) + { + VipsImage *in = (VipsImage *) a; + VipsConvasep *convasep = (VipsConvasep *) b; + + VipsConvasepSeq *seq; + +- if( !(seq = VIPS_NEW( out, VipsConvasepSeq )) ) +- return( NULL ); ++ if (!(seq = VIPS_NEW(out, VipsConvasepSeq))) ++ return (NULL); + + /* Init! + */ + seq->convasep = convasep; +- seq->ir = vips_region_new( in ); +- seq->start = VIPS_ARRAY( NULL, convasep->n_lines, int ); +- seq->end = VIPS_ARRAY( NULL, convasep->n_lines, int ); ++ seq->ir = vips_region_new(in); ++ seq->start = VIPS_ARRAY(NULL, convasep->n_lines, int); ++ seq->end = VIPS_ARRAY(NULL, convasep->n_lines, int); + seq->isum = NULL; + seq->dsum = NULL; +- if( vips_band_format_isint( out->BandFmt ) ) +- seq->isum = VIPS_ARRAY( NULL, convasep->n_lines, int ); ++ if (vips_band_format_isint(out->BandFmt)) ++ seq->isum = VIPS_ARRAY(NULL, convasep->n_lines, int); + else +- seq->dsum = VIPS_ARRAY( NULL, convasep->n_lines, double ); ++ seq->dsum = VIPS_ARRAY(NULL, convasep->n_lines, double); + seq->last_stride = -1; + +- if( !seq->ir || +- !seq->start || +- !seq->end || +- (!seq->isum && !seq->dsum) ) { +- vips_convasep_stop( seq, in, convasep ); +- return( NULL ); ++ if (!seq->ir || ++ !seq->start || ++ !seq->end || ++ (!seq->isum && !seq->dsum)) { ++ vips_convasep_stop(seq, in, convasep); ++ return (NULL); + } + +- return( seq ); ++ return (seq); + } + +-#define CLIP_UCHAR( V ) \ +-G_STMT_START { \ +- if( (V) < 0 ) \ +- (V) = 0; \ +- else if( (V) > UCHAR_MAX ) \ +- (V) = UCHAR_MAX; \ +-} G_STMT_END +- +-#define CLIP_CHAR( V ) \ +-G_STMT_START { \ +- if( (V) < SCHAR_MIN ) \ +- (V) = SCHAR_MIN; \ +- else if( (V) > SCHAR_MAX ) \ +- (V) = SCHAR_MAX; \ +-} G_STMT_END +- +-#define CLIP_USHORT( V ) \ +-G_STMT_START { \ +- if( (V) < 0 ) \ +- (V) = 0; \ +- else if( (V) > USHRT_MAX ) \ +- (V) = USHRT_MAX; \ +-} G_STMT_END +- +-#define CLIP_SHORT( V ) \ +-G_STMT_START { \ +- if( (V) < SHRT_MIN ) \ +- (V) = SHRT_MIN; \ +- else if( (V) > SHRT_MAX ) \ +- (V) = SHRT_MAX; \ +-} G_STMT_END +- +-#define CLIP_NONE( V ) {} ++#define CLIP_UCHAR(V) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < 0) \ ++ (V) = 0; \ ++ else if ((V) > UCHAR_MAX) \ ++ (V) = UCHAR_MAX; \ ++ } \ ++ G_STMT_END ++ ++#define CLIP_CHAR(V) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < SCHAR_MIN) \ ++ (V) = SCHAR_MIN; \ ++ else if ((V) > SCHAR_MAX) \ ++ (V) = SCHAR_MAX; \ ++ } \ ++ G_STMT_END ++ ++#define CLIP_USHORT(V) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < 0) \ ++ (V) = 0; \ ++ else if ((V) > USHRT_MAX) \ ++ (V) = USHRT_MAX; \ ++ } \ ++ G_STMT_END ++ ++#define CLIP_SHORT(V) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < SHRT_MIN) \ ++ (V) = SHRT_MIN; \ ++ else if ((V) > SHRT_MAX) \ ++ (V) = SHRT_MAX; \ ++ } \ ++ G_STMT_END ++ ++#define CLIP_NONE(V) \ ++ { \ ++ } + + /* The h and v loops are very similar, but also annoyingly different. Keep + * them separate for easy debugging. + */ + +-#define HCONV_INT( TYPE, CLIP ) { \ +- for( i = 0; i < bands; i++ ) { \ +- int *isum = seq->isum; \ +- \ +- TYPE *q; \ +- TYPE *p; \ +- int sum; \ +- \ +- p = i + (TYPE *) VIPS_REGION_ADDR( ir, r->left, r->top + y ); \ +- q = i + (TYPE *) VIPS_REGION_ADDR( or, r->left, r->top + y ); \ +- \ +- sum = 0; \ +- for( z = 0; z < n_lines; z++ ) { \ +- isum[z] = 0; \ +- for( x = seq->start[z]; x < seq->end[z]; x += istride ) \ +- isum[z] += p[x]; \ +- sum += convasep->factor[z] * isum[z]; \ +- } \ +- \ +- /* Don't add offset ... we only want to do that once, do it on \ +- * the vertical pass. \ +- */ \ +- sum = (sum + convasep->rounding) / convasep->divisor; \ +- CLIP( sum ); \ +- *q = sum; \ +- q += ostride; \ +- \ +- for( x = 1; x < r->width; x++ ) { \ ++#define HCONV_INT(TYPE, CLIP) \ ++ { \ ++ for (i = 0; i < bands; i++) { \ ++ int *isum = seq->isum; \ ++\ ++ TYPE *q; \ ++ TYPE *p; \ ++ int sum; \ ++\ ++ p = i + (TYPE *) VIPS_REGION_ADDR(ir, r->left, r->top + y); \ ++ q = i + (TYPE *) VIPS_REGION_ADDR(or, r->left, r->top + y); \ ++\ + sum = 0; \ +- for( z = 0; z < n_lines; z++ ) { \ +- isum[z] += p[seq->end[z]]; \ +- isum[z] -= p[seq->start[z]]; \ ++ for (z = 0; z < n_lines; z++) { \ ++ isum[z] = 0; \ ++ for (x = seq->start[z]; x < seq->end[z]; x += istride) \ ++ isum[z] += p[x]; \ + sum += convasep->factor[z] * isum[z]; \ + } \ +- p += istride; \ ++\ ++ /* Don't add offset ... we only want to do that once, do it on \ ++ * the vertical pass. \ ++ */ \ + sum = (sum + convasep->rounding) / convasep->divisor; \ +- CLIP( sum ); \ ++ CLIP(sum); \ + *q = sum; \ + q += ostride; \ ++\ ++ for (x = 1; x < r->width; x++) { \ ++ sum = 0; \ ++ for (z = 0; z < n_lines; z++) { \ ++ isum[z] += p[seq->end[z]]; \ ++ isum[z] -= p[seq->start[z]]; \ ++ sum += convasep->factor[z] * isum[z]; \ ++ } \ ++ p += istride; \ ++ sum = (sum + convasep->rounding) / convasep->divisor; \ ++ CLIP(sum); \ ++ *q = sum; \ ++ q += ostride; \ ++ } \ + } \ +- } \ +-} ++ } + +-#define HCONV_FLOAT( TYPE ) { \ +- for( i = 0; i < bands; i++ ) { \ +- double *dsum = seq->dsum; \ +- \ +- TYPE *q; \ +- TYPE *p; \ +- double sum; \ +- \ +- p = i + (TYPE *) VIPS_REGION_ADDR( ir, r->left, r->top + y ); \ +- q = i + (TYPE *) VIPS_REGION_ADDR( or, r->left, r->top + y ); \ +- \ +- sum = 0; \ +- for( z = 0; z < n_lines; z++ ) { \ +- dsum[z] = 0; \ +- for( x = seq->start[z]; x < seq->end[z]; x += istride ) \ +- dsum[z] += p[x]; \ +- sum += convasep->factor[z] * dsum[z]; \ +- } \ +- \ +- /* Don't add offset ... we only want to do that once, do it on \ +- * the vertical pass. \ +- */ \ +- sum = sum / convasep->divisor; \ +- *q = sum; \ +- q += ostride; \ +- \ +- for( x = 1; x < r->width; x++ ) { \ ++#define HCONV_FLOAT(TYPE) \ ++ { \ ++ for (i = 0; i < bands; i++) { \ ++ double *dsum = seq->dsum; \ ++\ ++ TYPE *q; \ ++ TYPE *p; \ ++ double sum; \ ++\ ++ p = i + (TYPE *) VIPS_REGION_ADDR(ir, r->left, r->top + y); \ ++ q = i + (TYPE *) VIPS_REGION_ADDR(or, r->left, r->top + y); \ ++\ + sum = 0; \ +- for( z = 0; z < n_lines; z++ ) { \ +- dsum[z] += p[seq->end[z]]; \ +- dsum[z] -= p[seq->start[z]]; \ ++ for (z = 0; z < n_lines; z++) { \ ++ dsum[z] = 0; \ ++ for (x = seq->start[z]; x < seq->end[z]; x += istride) \ ++ dsum[z] += p[x]; \ + sum += convasep->factor[z] * dsum[z]; \ + } \ +- p += istride; \ ++\ ++ /* Don't add offset ... we only want to do that once, do it on \ ++ * the vertical pass. \ ++ */ \ + sum = sum / convasep->divisor; \ + *q = sum; \ + q += ostride; \ ++\ ++ for (x = 1; x < r->width; x++) { \ ++ sum = 0; \ ++ for (z = 0; z < n_lines; z++) { \ ++ dsum[z] += p[seq->end[z]]; \ ++ dsum[z] -= p[seq->start[z]]; \ ++ sum += convasep->factor[z] * dsum[z]; \ ++ } \ ++ p += istride; \ ++ sum = sum / convasep->divisor; \ ++ *q = sum; \ ++ q += ostride; \ ++ } \ + } \ +- } \ +-} ++ } + + /* Do horizontal masks ... we scan the mask along scanlines. + */ + static int +-vips_convasep_generate_horizontal( VipsRegion *or, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_convasep_generate_horizontal(VipsRegion * or, ++ void *vseq, void *a, void *b, gboolean *stop) + { + VipsConvasepSeq *seq = (VipsConvasepSeq *) vseq; + VipsImage *in = (VipsImage *) a; +@@ -540,12 +553,11 @@ vips_convasep_generate_horizontal( VipsRegion *or, + + VipsRegion *ir = seq->ir; + const int n_lines = convasep->n_lines; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + + /* Double the bands (notionally) for complex. + */ +- int bands = vips_band_format_iscomplex( in->BandFmt ) ? +- 2 * in->Bands : in->Bands; ++ int bands = vips_band_format_iscomplex(in->BandFmt) ? 2 * in->Bands : in->Bands; + + VipsRect s; + int x, y, z, i; +@@ -557,62 +569,62 @@ vips_convasep_generate_horizontal( VipsRegion *or, + */ + s = *r; + s.width += convasep->width - 1; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + + /* Stride can be different for the vertical case, keep this here for + * ease of direction change. + */ +- istride = VIPS_IMAGE_SIZEOF_PEL( in ) / +- VIPS_IMAGE_SIZEOF_ELEMENT( in ); +- ostride = VIPS_IMAGE_SIZEOF_PEL( convolution->out ) / +- VIPS_IMAGE_SIZEOF_ELEMENT( convolution->out ); ++ istride = VIPS_IMAGE_SIZEOF_PEL(in) / ++ VIPS_IMAGE_SIZEOF_ELEMENT(in); ++ ostride = VIPS_IMAGE_SIZEOF_PEL(convolution->out) / ++ VIPS_IMAGE_SIZEOF_ELEMENT(convolution->out); + +- /* Init offset array. ++ /* Init offset array. + */ +- if( seq->last_stride != istride ) { ++ if (seq->last_stride != istride) { + seq->last_stride = istride; + +- for( z = 0; z < n_lines; z++ ) { ++ for (z = 0; z < n_lines; z++) { + seq->start[z] = convasep->start[z] * istride; + seq->end[z] = convasep->end[z] * istride; + } + } + +- for( y = 0; y < r->height; y++ ) { +- switch( in->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- HCONV_INT( unsigned char, CLIP_UCHAR ); ++ for (y = 0; y < r->height; y++) { ++ switch (in->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ HCONV_INT(unsigned char, CLIP_UCHAR); + break; + +- case VIPS_FORMAT_CHAR: +- HCONV_INT( signed char, CLIP_CHAR ); ++ case VIPS_FORMAT_CHAR: ++ HCONV_INT(signed char, CLIP_CHAR); + break; + +- case VIPS_FORMAT_USHORT: +- HCONV_INT( unsigned short, CLIP_USHORT ); ++ case VIPS_FORMAT_USHORT: ++ HCONV_INT(unsigned short, CLIP_USHORT); + break; + +- case VIPS_FORMAT_SHORT: +- HCONV_INT( signed short, CLIP_SHORT ); ++ case VIPS_FORMAT_SHORT: ++ HCONV_INT(signed short, CLIP_SHORT); + break; + +- case VIPS_FORMAT_UINT: +- HCONV_INT( unsigned int, CLIP_NONE ); ++ case VIPS_FORMAT_UINT: ++ HCONV_INT(unsigned int, CLIP_NONE); + break; + +- case VIPS_FORMAT_INT: +- HCONV_INT( signed int, CLIP_NONE ); ++ case VIPS_FORMAT_INT: ++ HCONV_INT(signed int, CLIP_NONE); + break; + +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- HCONV_FLOAT( float ); ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ HCONV_FLOAT(float); + break; + +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- HCONV_FLOAT( double ); ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ HCONV_FLOAT(double); + break; + + default: +@@ -620,93 +632,95 @@ vips_convasep_generate_horizontal( VipsRegion *or, + } + } + +- return( 0 ); ++ return (0); + } + +-#define VCONV_INT( TYPE, CLIP ) { \ +- for( x = 0; x < sz; x++ ) { \ +- int *isum = seq->isum; \ +- \ +- TYPE *q; \ +- TYPE *p; \ +- int sum; \ +- \ +- p = x + (TYPE *) VIPS_REGION_ADDR( ir, r->left, r->top ); \ +- q = x + (TYPE *) VIPS_REGION_ADDR( or, r->left, r->top ); \ +- \ +- sum = 0; \ +- for( z = 0; z < n_lines; z++ ) { \ +- isum[z] = 0; \ +- for( y = seq->start[z]; y < seq->end[z]; y += istride ) \ +- isum[z] += p[y]; \ +- sum += convasep->factor[z] * isum[z]; \ +- } \ +- sum = (sum + convasep->rounding) / convasep->divisor + \ +- convasep->offset; \ +- CLIP( sum ); \ +- *q = sum; \ +- q += ostride; \ +- \ +- for( y = 1; y < r->height; y++ ) { \ ++#define VCONV_INT(TYPE, CLIP) \ ++ { \ ++ for (x = 0; x < sz; x++) { \ ++ int *isum = seq->isum; \ ++\ ++ TYPE *q; \ ++ TYPE *p; \ ++ int sum; \ ++\ ++ p = x + (TYPE *) VIPS_REGION_ADDR(ir, r->left, r->top); \ ++ q = x + (TYPE *) VIPS_REGION_ADDR(or, r->left, r->top); \ ++\ + sum = 0; \ +- for( z = 0; z < n_lines; z++ ) { \ +- isum[z] += p[seq->end[z]]; \ +- isum[z] -= p[seq->start[z]]; \ ++ for (z = 0; z < n_lines; z++) { \ ++ isum[z] = 0; \ ++ for (y = seq->start[z]; y < seq->end[z]; y += istride) \ ++ isum[z] += p[y]; \ + sum += convasep->factor[z] * isum[z]; \ + } \ +- p += istride; \ + sum = (sum + convasep->rounding) / convasep->divisor + \ + convasep->offset; \ +- CLIP( sum ); \ ++ CLIP(sum); \ + *q = sum; \ + q += ostride; \ ++\ ++ for (y = 1; y < r->height; y++) { \ ++ sum = 0; \ ++ for (z = 0; z < n_lines; z++) { \ ++ isum[z] += p[seq->end[z]]; \ ++ isum[z] -= p[seq->start[z]]; \ ++ sum += convasep->factor[z] * isum[z]; \ ++ } \ ++ p += istride; \ ++ sum = (sum + convasep->rounding) / convasep->divisor + \ ++ convasep->offset; \ ++ CLIP(sum); \ ++ *q = sum; \ ++ q += ostride; \ ++ } \ + } \ +- } \ +-} ++ } + +-#define VCONV_FLOAT( TYPE ) { \ +- for( x = 0; x < sz; x++ ) { \ +- double *dsum = seq->dsum; \ +- \ +- TYPE *q; \ +- TYPE *p; \ +- double sum; \ +- \ +- p = x + (TYPE *) VIPS_REGION_ADDR( ir, r->left, r->top ); \ +- q = x + (TYPE *) VIPS_REGION_ADDR( or, r->left, r->top ); \ +- \ +- sum = 0; \ +- for( z = 0; z < n_lines; z++ ) { \ +- dsum[z] = 0; \ +- for( y = seq->start[z]; y < seq->end[z]; y += istride ) \ +- dsum[z] += p[y]; \ +- sum += convasep->factor[z] * dsum[z]; \ +- } \ +- sum = sum / convasep->divisor + convasep->offset; \ +- *q = sum; \ +- q += ostride; \ +- \ +- for( y = 1; y < r->height; y++ ) { \ ++#define VCONV_FLOAT(TYPE) \ ++ { \ ++ for (x = 0; x < sz; x++) { \ ++ double *dsum = seq->dsum; \ ++\ ++ TYPE *q; \ ++ TYPE *p; \ ++ double sum; \ ++\ ++ p = x + (TYPE *) VIPS_REGION_ADDR(ir, r->left, r->top); \ ++ q = x + (TYPE *) VIPS_REGION_ADDR(or, r->left, r->top); \ ++\ + sum = 0; \ +- for( z = 0; z < n_lines; z++ ) { \ +- dsum[z] += p[seq->end[z]]; \ +- dsum[z] -= p[seq->start[z]]; \ ++ for (z = 0; z < n_lines; z++) { \ ++ dsum[z] = 0; \ ++ for (y = seq->start[z]; y < seq->end[z]; y += istride) \ ++ dsum[z] += p[y]; \ + sum += convasep->factor[z] * dsum[z]; \ + } \ +- p += istride; \ + sum = sum / convasep->divisor + convasep->offset; \ + *q = sum; \ + q += ostride; \ ++\ ++ for (y = 1; y < r->height; y++) { \ ++ sum = 0; \ ++ for (z = 0; z < n_lines; z++) { \ ++ dsum[z] += p[seq->end[z]]; \ ++ dsum[z] -= p[seq->start[z]]; \ ++ sum += convasep->factor[z] * dsum[z]; \ ++ } \ ++ p += istride; \ ++ sum = sum / convasep->divisor + convasep->offset; \ ++ *q = sum; \ ++ q += ostride; \ ++ } \ + } \ +- } \ +-} ++ } + + /* Do vertical masks ... we scan the mask down columns of pixels. Copy-paste + * from above with small changes. + */ + static int +-vips_convasep_generate_vertical( VipsRegion *or, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_convasep_generate_vertical(VipsRegion * or, ++ void *vseq, void *a, void *b, gboolean *stop) + { + VipsConvasepSeq *seq = (VipsConvasepSeq *) vseq; + VipsImage *in = (VipsImage *) a; +@@ -715,12 +729,11 @@ vips_convasep_generate_vertical( VipsRegion *or, + + VipsRegion *ir = seq->ir; + const int n_lines = convasep->n_lines; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + + /* Double the width (notionally) for complex. + */ +- int sz = vips_band_format_iscomplex( in->BandFmt ) ? +- 2 * VIPS_REGION_N_ELEMENTS( or ) : VIPS_REGION_N_ELEMENTS( or ); ++ int sz = vips_band_format_iscomplex(in->BandFmt) ? 2 * VIPS_REGION_N_ELEMENTS(or) : VIPS_REGION_N_ELEMENTS(or); + + VipsRect s; + int x, y, z; +@@ -732,83 +745,83 @@ vips_convasep_generate_vertical( VipsRegion *or, + */ + s = *r; + s.height += convasep->width - 1; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + + /* Stride can be different for the vertical case, keep this here for + * ease of direction change. + */ +- istride = VIPS_REGION_LSKIP( ir ) / VIPS_IMAGE_SIZEOF_ELEMENT( in ); +- ostride = VIPS_REGION_LSKIP( or ) / +- VIPS_IMAGE_SIZEOF_ELEMENT( convolution->out ); ++ istride = VIPS_REGION_LSKIP(ir) / VIPS_IMAGE_SIZEOF_ELEMENT(in); ++ ostride = VIPS_REGION_LSKIP(or) / ++ VIPS_IMAGE_SIZEOF_ELEMENT(convolution->out); + +- /* Init offset array. ++ /* Init offset array. + */ +- if( seq->last_stride != istride ) { ++ if (seq->last_stride != istride) { + seq->last_stride = istride; + +- for( z = 0; z < n_lines; z++ ) { ++ for (z = 0; z < n_lines; z++) { + seq->start[z] = convasep->start[z] * istride; + seq->end[z] = convasep->end[z] * istride; + } + } + +- switch( in->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- VCONV_INT( unsigned char, CLIP_UCHAR ); ++ switch (in->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ VCONV_INT(unsigned char, CLIP_UCHAR); + break; + +- case VIPS_FORMAT_CHAR: +- VCONV_INT( signed char, CLIP_CHAR ); ++ case VIPS_FORMAT_CHAR: ++ VCONV_INT(signed char, CLIP_CHAR); + break; + +- case VIPS_FORMAT_USHORT: +- VCONV_INT( unsigned short, CLIP_USHORT ); ++ case VIPS_FORMAT_USHORT: ++ VCONV_INT(unsigned short, CLIP_USHORT); + break; + +- case VIPS_FORMAT_SHORT: +- VCONV_INT( signed short, CLIP_SHORT ); ++ case VIPS_FORMAT_SHORT: ++ VCONV_INT(signed short, CLIP_SHORT); + break; + +- case VIPS_FORMAT_UINT: +- VCONV_INT( unsigned int, CLIP_NONE ); ++ case VIPS_FORMAT_UINT: ++ VCONV_INT(unsigned int, CLIP_NONE); + break; + +- case VIPS_FORMAT_INT: +- VCONV_INT( signed int, CLIP_NONE ); ++ case VIPS_FORMAT_INT: ++ VCONV_INT(signed int, CLIP_NONE); + break; + +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- VCONV_FLOAT( float ); ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ VCONV_FLOAT(float); + break; + +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- VCONV_FLOAT( double ); ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ VCONV_FLOAT(double); + break; + + default: + g_assert_not_reached(); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_convasep_pass( VipsConvasep *convasep, +- VipsImage *in, VipsImage **out, VipsDirection direction ) ++vips_convasep_pass(VipsConvasep *convasep, ++ VipsImage *in, VipsImage **out, VipsDirection direction) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( convasep ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(convasep); + + VipsGenerateFn gen; + +- *out = vips_image_new(); +- if( vips_image_pipelinev( *out, +- VIPS_DEMAND_STYLE_SMALLTILE, in, NULL ) ) +- return( -1 ); ++ *out = vips_image_new(); ++ if (vips_image_pipelinev(*out, ++ VIPS_DEMAND_STYLE_SMALLTILE, in, NULL)) ++ return (-1); + +- if( direction == VIPS_DIRECTION_HORIZONTAL ) { ++ if (direction == VIPS_DIRECTION_HORIZONTAL) { + (*out)->Xsize -= convasep->width - 1; + gen = vips_convasep_generate_horizontal; + } +@@ -817,99 +830,98 @@ vips_convasep_pass( VipsConvasep *convasep, + gen = vips_convasep_generate_vertical; + } + +- if( (*out)->Xsize <= 0 || +- (*out)->Ysize <= 0 ) { +- vips_error( class->nickname, +- "%s", _( "image too small for mask" ) ); +- return( -1 ); ++ if ((*out)->Xsize <= 0 || ++ (*out)->Ysize <= 0) { ++ vips_error(class->nickname, ++ "%s", _("image too small for mask")); ++ return (-1); + } + +- if( vips_image_generate( *out, +- vips_convasep_start, gen, vips_convasep_stop, in, convasep ) ) +- return( -1 ); ++ if (vips_image_generate(*out, ++ vips_convasep_start, gen, vips_convasep_stop, in, convasep)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-static int +-vips_convasep_build( VipsObject *object ) ++static int ++vips_convasep_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsConvolution *convolution = (VipsConvolution *) object; + VipsConvasep *convasep = (VipsConvasep *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_convasep_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_convasep_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_separable( class->nickname, convolution->M ) ) +- return( -1 ); ++ if (vips_check_separable(class->nickname, convolution->M)) ++ return (-1); + + /* An int version of our mask. + */ +- if( vips__image_intize( convolution->M, &t[3] ) ) +- return( -1 ); +- convasep->iM = t[3]; ++ if (vips__image_intize(convolution->M, &t[3])) ++ return (-1); ++ convasep->iM = t[3]; + convasep->width = convasep->iM->Xsize * convasep->iM->Ysize; + in = convolution->in; + +- if( vips_convasep_decompose( convasep ) ) +- return( -1 ); ++ if (vips_convasep_decompose(convasep)) ++ return (-1); + +- g_object_set( convasep, "out", vips_image_new(), NULL ); +- if( +- vips_embed( in, &t[0], +- convasep->width / 2, +- convasep->width / 2, +- in->Xsize + convasep->width - 1, ++ g_object_set(convasep, "out", vips_image_new(), NULL); ++ if ( ++ vips_embed(in, &t[0], ++ convasep->width / 2, ++ convasep->width / 2, ++ in->Xsize + convasep->width - 1, + in->Ysize + convasep->width - 1, + "extend", VIPS_EXTEND_COPY, +- NULL ) || +- vips_convasep_pass( convasep, +- t[0], &t[1], VIPS_DIRECTION_HORIZONTAL ) || +- vips_convasep_pass( convasep, +- t[1], &t[2], VIPS_DIRECTION_VERTICAL ) || +- vips_image_write( t[2], convolution->out ) ) +- return( -1 ); ++ NULL) || ++ vips_convasep_pass(convasep, ++ t[0], &t[1], VIPS_DIRECTION_HORIZONTAL) || ++ vips_convasep_pass(convasep, ++ t[1], &t[2], VIPS_DIRECTION_VERTICAL) || ++ vips_image_write(t[2], convolution->out)) ++ return (-1); + + convolution->out->Xoffset = 0; + convolution->out->Yoffset = 0; + +- vips_reorder_margin_hint( convolution->out, +- convolution->M->Xsize * convolution->M->Ysize ); ++ vips_reorder_margin_hint(convolution->out, ++ convolution->M->Xsize * convolution->M->Ysize); + +- return( 0 ); ++ return (0); + } + + static void +-vips_convasep_class_init( VipsConvasepClass *class ) ++vips_convasep_class_init(VipsConvasepClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "convasep"; +- object_class->description = +- _( "approximate separable integer convolution" ); ++ object_class->description = ++ _("approximate separable integer convolution"); + object_class->build = vips_convasep_build; + +- VIPS_ARG_INT( class, "layers", 104, +- _( "Layers" ), +- _( "Use this many layers in approximation" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsConvasep, layers ), +- 1, 1000, 5 ); +- ++ VIPS_ARG_INT(class, "layers", 104, ++ _("Layers"), ++ _("Use this many layers in approximation"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsConvasep, layers), ++ 1, 1000, 5); + } + + static void +-vips_convasep_init( VipsConvasep *convasep ) ++vips_convasep_init(VipsConvasep *convasep) + { +- convasep->layers = 5; ++ convasep->layers = 5; + convasep->n_lines = 0; + } + +@@ -924,38 +936,37 @@ vips_convasep_init( VipsConvasep *convasep ) + * + * * @layers: %gint, number of layers for approximation + * +- * Approximate separable integer convolution. This is a low-level operation, see +- * vips_convsep() for something more convenient. ++ * Approximate separable integer convolution. This is a low-level operation, see ++ * vips_convsep() for something more convenient. + * +- * The image is convolved twice: once with @mask and then again with @mask +- * rotated by 90 degrees. +- * @mask must be 1xn or nx1 elements. ++ * The image is convolved twice: once with @mask and then again with @mask ++ * rotated by 90 degrees. ++ * @mask must be 1xn or nx1 elements. + * Elements of @mask are converted to + * integers before convolution. + * + * Larger values for @layers give more accurate + * results, but are slower. As @layers approaches the mask radius, the +- * accuracy will become close to exact convolution and the speed will drop to ++ * accuracy will become close to exact convolution and the speed will drop to + * match. For many large masks, such as Gaussian, @layers need be only 10% of + * this value and accuracy will still be good. + * +- * The output image +- * always has the same #VipsBandFormat as the input image. ++ * The output image ++ * always has the same #VipsBandFormat as the input image. + * + * See also: vips_convsep(). + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_convasep( VipsImage *in, VipsImage **out, VipsImage *mask, ... ) ++int ++vips_convasep(VipsImage *in, VipsImage **out, VipsImage *mask, ...) + { + va_list ap; + int result; + +- va_start( ap, mask ); +- result = vips_call_split( "convasep", ap, in, out, mask ); +- va_end( ap ); ++ va_start(ap, mask); ++ result = vips_call_split("convasep", ap, in, out, mask); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/convolution/convf.c b/libvips/convolution/convf.c +index 455a3215fe..b172a1183a 100644 +--- a/libvips/convolution/convf.c ++++ b/libvips/convolution/convf.c +@@ -16,15 +16,15 @@ + * - evalend callbacks + * - more typedef + * 9/3/01 JC +- * - redone from im_conv() ++ * - redone from im_conv() + * 27/7/01 JC + * - rejects masks with scale == 0 +- * 7/4/04 ++ * 7/4/04 + * - now uses im_embed() with edge stretching on the input, not + * the output + * - sets Xoffset / Yoffset + * 11/11/05 +- * - simpler inner loop avoids gcc4 bug ++ * - simpler inner loop avoids gcc4 bug + * 12/11/09 + * - only rebuild the buffer offsets if bpl changes + * - tiny speedups and cleanups +@@ -55,28 +55,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -99,100 +99,101 @@ typedef struct { + /* We make a smaller version of the mask with the zeros squeezed out. + */ + int nnz; /* Number of non-zero mask elements */ +- double *coeff; /* Array of non-zero mask coefficients */ +- int *coeff_pos; /* Index of each nnz element in mask->coeff */ ++ double *coeff; /* Array of non-zero mask coefficients */ ++ int *coeff_pos; /* Index of each nnz element in mask->coeff */ + } VipsConvf; + + typedef VipsConvolutionClass VipsConvfClass; + +-G_DEFINE_TYPE( VipsConvf, vips_convf, VIPS_TYPE_CONVOLUTION ); ++G_DEFINE_TYPE(VipsConvf, vips_convf, VIPS_TYPE_CONVOLUTION); + + /* Our sequence value. + */ + typedef struct { + VipsConvf *convf; +- VipsRegion *ir; /* Input region */ ++ VipsRegion *ir; /* Input region */ + +- int *offsets; /* Offsets for each non-zero matrix element */ ++ int *offsets; /* Offsets for each non-zero matrix element */ + +- int last_bpl; /* Avoid recalcing offsets, if we can */ ++ int last_bpl; /* Avoid recalcing offsets, if we can */ + } VipsConvfSequence; + + /* Free a sequence value. + */ + static int +-vips_convf_stop( void *vseq, void *a, void *b ) ++vips_convf_stop(void *vseq, void *a, void *b) + { + VipsConvfSequence *seq = (VipsConvfSequence *) vseq; + +- VIPS_UNREF( seq->ir ); ++ VIPS_UNREF(seq->ir); + +- return( 0 ); ++ return (0); + } + + /* Convolution start function. + */ + static void * +-vips_convf_start( VipsImage *out, void *a, void *b ) ++vips_convf_start(VipsImage *out, void *a, void *b) + { + VipsImage *in = (VipsImage *) a; + VipsConvf *convf = (VipsConvf *) b; + VipsConvfSequence *seq; + +- if( !(seq = VIPS_NEW( out, VipsConvfSequence )) ) +- return( NULL ); ++ if (!(seq = VIPS_NEW(out, VipsConvfSequence))) ++ return (NULL); + + seq->convf = convf; + seq->ir = NULL; + seq->last_bpl = -1; + +- seq->ir = vips_region_new( in ); +- if( !(seq->offsets = VIPS_ARRAY( out, convf->nnz, int )) ) { +- vips_convf_stop( seq, in, convf ); +- return( NULL ); ++ seq->ir = vips_region_new(in); ++ if (!(seq->offsets = VIPS_ARRAY(out, convf->nnz, int))) { ++ vips_convf_stop(seq, in, convf); ++ return (NULL); + } + +- return( (void *) seq ); ++ return ((void *) seq); + } + +-#define CONV_FLOAT( ITYPE, OTYPE ) { \ +- ITYPE * restrict p = (ITYPE *) VIPS_REGION_ADDR( ir, le, y ); \ +- OTYPE * restrict q = (OTYPE *) VIPS_REGION_ADDR( or, le, y ); \ +- int * restrict offsets = seq->offsets; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- double sum; \ +- int i; \ +- \ +- sum = offset; \ +- for ( i = 0; i < nnz; i++ ) \ +- sum += t[i] * p[offsets[i]]; \ +- \ +- q[x] = sum; \ +- p += 1; \ +- } \ +-} ++#define CONV_FLOAT(ITYPE, OTYPE) \ ++ { \ ++ ITYPE *restrict p = (ITYPE *) VIPS_REGION_ADDR(ir, le, y); \ ++ OTYPE *restrict q = (OTYPE *) VIPS_REGION_ADDR(or, le, y); \ ++ int *restrict offsets = seq->offsets; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ double sum; \ ++ int i; \ ++\ ++ sum = offset; \ ++ for (i = 0; i < nnz; i++) \ ++ sum += t[i] * p[offsets[i]]; \ ++\ ++ q[x] = sum; \ ++ p += 1; \ ++ } \ ++ } + + /* Convolve! + */ + static int +-vips_convf_gen( VipsRegion *or, void *vseq, void *a, void *b, gboolean *stop ) ++vips_convf_gen(VipsRegion * or, void *vseq, void *a, void *b, gboolean *stop) + { + VipsConvfSequence *seq = (VipsConvfSequence *) vseq; + VipsConvf *convf = (VipsConvf *) b; + VipsConvolution *convolution = (VipsConvolution *) convf; + VipsImage *M = convolution->M; +- double offset = vips_image_get_offset( M ); ++ double offset = vips_image_get_offset(M); + VipsImage *in = (VipsImage *) a; + VipsRegion *ir = seq->ir; +- double * restrict t = convf->coeff; ++ double *restrict t = convf->coeff; + const int nnz = convf->nnz; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; + int to = r->top; +- int bo = VIPS_RECT_BOTTOM( r ); +- int sz = VIPS_REGION_N_ELEMENTS( or ) * +- (vips_band_format_iscomplex( in->BandFmt ) ? 2 : 1); ++ int bo = VIPS_RECT_BOTTOM(r); ++ int sz = VIPS_REGION_N_ELEMENTS(or) * ++ (vips_band_format_iscomplex(in->BandFmt) ? 2 : 1); + + VipsRect s; + int x, y, z, i; +@@ -203,63 +204,63 @@ vips_convf_gen( VipsRegion *or, void *vseq, void *a, void *b, gboolean *stop ) + s = *r; + s.width += M->Xsize - 1; + s.height += M->Ysize - 1; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + +- /* Fill offset array. Only do this if the bpl has changed since the ++ /* Fill offset array. Only do this if the bpl has changed since the + * previous vips_region_prepare(). + */ +- if( seq->last_bpl != VIPS_REGION_LSKIP( ir ) ) { +- seq->last_bpl = VIPS_REGION_LSKIP( ir ); ++ if (seq->last_bpl != VIPS_REGION_LSKIP(ir)) { ++ seq->last_bpl = VIPS_REGION_LSKIP(ir); + +- for( i = 0; i < nnz; i++ ) { ++ for (i = 0; i < nnz; i++) { + z = convf->coeff_pos[i]; + x = z % M->Xsize; + y = z / M->Xsize; + +- seq->offsets[i] = +- (VIPS_REGION_ADDR( ir, x + le, y + to ) - +- VIPS_REGION_ADDR( ir, le, to )) / +- VIPS_IMAGE_SIZEOF_ELEMENT( ir->im ); ++ seq->offsets[i] = ++ (VIPS_REGION_ADDR(ir, x + le, y + to) - ++ VIPS_REGION_ADDR(ir, le, to)) / ++ VIPS_IMAGE_SIZEOF_ELEMENT(ir->im); + } + } + +- VIPS_GATE_START( "vips_convf_gen: work" ); ++ VIPS_GATE_START("vips_convf_gen: work"); + +- for( y = to; y < bo; y++ ) { +- switch( in->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- CONV_FLOAT( unsigned char, float ); ++ for (y = to; y < bo; y++) { ++ switch (in->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ CONV_FLOAT(unsigned char, float); + break; + +- case VIPS_FORMAT_CHAR: +- CONV_FLOAT( signed char, float ); ++ case VIPS_FORMAT_CHAR: ++ CONV_FLOAT(signed char, float); + break; + +- case VIPS_FORMAT_USHORT: +- CONV_FLOAT( unsigned short, float ); ++ case VIPS_FORMAT_USHORT: ++ CONV_FLOAT(unsigned short, float); + break; + +- case VIPS_FORMAT_SHORT: +- CONV_FLOAT( signed short, float ); ++ case VIPS_FORMAT_SHORT: ++ CONV_FLOAT(signed short, float); + break; + +- case VIPS_FORMAT_UINT: +- CONV_FLOAT( unsigned int, float ); ++ case VIPS_FORMAT_UINT: ++ CONV_FLOAT(unsigned int, float); + break; + +- case VIPS_FORMAT_INT: +- CONV_FLOAT( signed int, float ); ++ case VIPS_FORMAT_INT: ++ CONV_FLOAT(signed int, float); + break; + +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- CONV_FLOAT( float, float ); ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ CONV_FLOAT(float, float); + break; + +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- CONV_FLOAT( double, double ); ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ CONV_FLOAT(double, double); + break; + + default: +@@ -267,19 +268,19 @@ vips_convf_gen( VipsRegion *or, void *vseq, void *a, void *b, gboolean *stop ) + } + } + +- VIPS_GATE_STOP( "vips_convf_gen: work" ); ++ VIPS_GATE_STOP("vips_convf_gen: work"); + +- VIPS_COUNT_PIXELS( or, "vips_convf_gen" ); ++ VIPS_COUNT_PIXELS(or, "vips_convf_gen"); + +- return( 0 ); ++ return (0); + } + + static int +-vips_convf_build( VipsObject *object ) ++vips_convf_build(VipsObject *object) + { + VipsConvolution *convolution = (VipsConvolution *) object; + VipsConvf *convf = (VipsConvf *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); + + VipsImage *in; + VipsImage *M; +@@ -288,27 +289,27 @@ vips_convf_build( VipsObject *object ) + int i; + double scale; + +- if( VIPS_OBJECT_CLASS( vips_convf_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_convf_parent_class)->build(object)) ++ return (-1); + + M = convolution->M; +- coeff = (double *) VIPS_IMAGE_ADDR( M, 0, 0 ); ++ coeff = (double *) VIPS_IMAGE_ADDR(M, 0, 0); + ne = M->Xsize * M->Ysize; + + /* Bake the scale into the mask. + */ +- scale = vips_image_get_scale( M ); +- for( i = 0; i < ne; i++ ) ++ scale = vips_image_get_scale(M); ++ for (i = 0; i < ne; i++) + coeff[i] /= scale; + +- if( !(convf->coeff = VIPS_ARRAY( object, ne, double )) || +- !(convf->coeff_pos = VIPS_ARRAY( object, ne, int )) ) +- return( -1 ); ++ if (!(convf->coeff = VIPS_ARRAY(object, ne, double)) || ++ !(convf->coeff_pos = VIPS_ARRAY(object, ne, int))) ++ return (-1); + + /* Find non-zero mask elements. + */ +- for( i = 0; i < ne; i++ ) +- if( coeff[i] ) { ++ for (i = 0; i < ne; i++) ++ if (coeff[i]) { + convf->coeff[convf->nnz] = coeff[i]; + convf->coeff_pos[convf->nnz] = i; + convf->nnz += 1; +@@ -317,7 +318,7 @@ vips_convf_build( VipsObject *object ) + /* Was the whole mask zero? We must have at least 1 element in there: + * set it to zero. + */ +- if( convf->nnz == 0 ) { ++ if (convf->nnz == 0) { + convf->coeff[0] = 0; + convf->coeff_pos[0] = 0; + convf->nnz = 1; +@@ -325,18 +326,18 @@ vips_convf_build( VipsObject *object ) + + in = convolution->in; + +- if( vips_embed( in, &t[0], +- M->Xsize / 2, M->Ysize / 2, +- in->Xsize + M->Xsize - 1, in->Ysize + M->Ysize - 1, +- "extend", VIPS_EXTEND_COPY, +- NULL ) ) +- return( -1 ); +- in = t[0]; ++ if (vips_embed(in, &t[0], ++ M->Xsize / 2, M->Ysize / 2, ++ in->Xsize + M->Xsize - 1, in->Ysize + M->Ysize - 1, ++ "extend", VIPS_EXTEND_COPY, ++ NULL)) ++ return (-1); ++ in = t[0]; + +- g_object_set( convf, "out", vips_image_new(), NULL ); +- if( vips_image_pipelinev( convolution->out, +- VIPS_DEMAND_STYLE_SMALLTILE, in, NULL ) ) +- return( -1 ); ++ g_object_set(convf, "out", vips_image_new(), NULL); ++ if (vips_image_pipelinev(convolution->out, ++ VIPS_DEMAND_STYLE_SMALLTILE, in, NULL)) ++ return (-1); + + convolution->out->Xoffset = 0; + convolution->out->Yoffset = 0; +@@ -344,37 +345,37 @@ vips_convf_build( VipsObject *object ) + /* Prepare output. Consider a 7x7 mask and a 7x7 image --- the output + * would be 1x1. + */ +- if( vips_band_format_isint( in->BandFmt ) ) ++ if (vips_band_format_isint(in->BandFmt)) + convolution->out->BandFmt = VIPS_FORMAT_FLOAT; + convolution->out->Xsize -= M->Xsize - 1; + convolution->out->Ysize -= M->Ysize - 1; + +- if( vips_image_generate( convolution->out, +- vips_convf_start, vips_convf_gen, vips_convf_stop, in, convf ) ) +- return( -1 ); ++ if (vips_image_generate(convolution->out, ++ vips_convf_start, vips_convf_gen, vips_convf_stop, in, convf)) ++ return (-1); + + convolution->out->Xoffset = -M->Xsize / 2; + convolution->out->Yoffset = -M->Ysize / 2; + +- return( 0 ); ++ return (0); + } + + static void +-vips_convf_class_init( VipsConvfClass *class ) ++vips_convf_class_init(VipsConvfClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + + object_class->nickname = "convf"; +- object_class->description = _( "float convolution operation" ); ++ object_class->description = _("float convolution operation"); + object_class->build = vips_convf_build; + } + + static void +-vips_convf_init( VipsConvf *convf ) ++vips_convf_init(VipsConvf *convf) + { +- convf->nnz = 0; +- convf->coeff = NULL; +- convf->coeff_pos = NULL; ++ convf->nnz = 0; ++ convf->coeff = NULL; ++ convf->coeff_pos = NULL; + } + + /** +@@ -385,31 +386,30 @@ vips_convf_init( VipsConvf *convf ) + * @...: %NULL-terminated list of optional named arguments + * + * Convolution. This is a low-level operation, see vips_conv() for something +- * more convenient. ++ * more convenient. + * + * Perform a convolution of @in with @mask. + * Each output pixel is + * calculated as sigma[i]{pixel[i] * mask[i]} / scale + offset, where scale +- * and offset are part of @mask. ++ * and offset are part of @mask. + * +- * The convolution is performed with floating-point arithmetic. The output image ++ * The convolution is performed with floating-point arithmetic. The output image + * is always #VIPS_FORMAT_FLOAT unless @in is #VIPS_FORMAT_DOUBLE, in which case +- * @out is also #VIPS_FORMAT_DOUBLE. ++ * @out is also #VIPS_FORMAT_DOUBLE. + * + * See also: vips_conv(). + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_convf( VipsImage *in, VipsImage **out, VipsImage *mask, ... ) ++int ++vips_convf(VipsImage *in, VipsImage **out, VipsImage *mask, ...) + { + va_list ap; + int result; + +- va_start( ap, mask ); +- result = vips_call_split( "convf", ap, in, out, mask ); +- va_end( ap ); ++ va_start(ap, mask); ++ result = vips_call_split("convf", ap, in, out, mask); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/convolution/convi.c b/libvips/convolution/convi.c +index f5a4d693a0..836d9788ac 100644 +--- a/libvips/convolution/convi.c ++++ b/libvips/convolution/convi.c +@@ -30,12 +30,12 @@ + * - slightly better range clipping + * 27/7/01 JC + * - reject masks with scale == 0 +- * 7/4/04 ++ * 7/4/04 + * - im_conv() now uses im_embed() with edge stretching on the input, not + * the output + * - sets Xoffset / Yoffset + * 11/11/05 +- * - simpler inner loop avoids gcc4 bug ++ * - simpler inner loop avoids gcc4 bug + * 7/11/07 + * - new evalstart/end callbacks + * 12/5/08 +@@ -75,39 +75,39 @@ + * 2/7/17 + * - remove pts for a small speedup + * 12/10/17 +- * - fix leak of vectors, thanks MHeimbuc ++ * - fix leak of vectors, thanks MHeimbuc + * 14/10/17 + * - switch to half-float for vector path + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +-/* ++/* + #define DEBUG + #define DEBUG_PIXELS + #define DEBUG_COMPILE +@@ -131,29 +131,29 @@ + */ + #define MAX_PASS (20) + +-/* A pass with a vector. ++/* A pass with a vector. + */ + typedef struct { +- int first; /* The index of the first mask coff we use */ +- int last; /* The index of the last mask coff we use */ ++ int first; /* The index of the first mask coff we use */ ++ int last; /* The index of the last mask coff we use */ + +- int r; /* Set previous result in this var */ ++ int r; /* Set previous result in this var */ + +- /* The code we generate for this section of the mask. ++ /* The code we generate for this section of the mask. + */ +- VipsVector *vector; ++ VipsVector *vector; + } Pass; + + typedef struct { + VipsConvolution parent_instance; + +- int n_point; /* w * h for our matrix */ ++ int n_point; /* w * h for our matrix */ + + /* We make a smaller version of the mask with the zeros squeezed out. + */ + int nnz; /* Number of non-zero mask elements */ + int *coeff; /* Array of non-zero mask coefficients */ +- int *coeff_pos; /* Index of each nnz element in mask->coeff */ ++ int *coeff_pos; /* Index of each nnz element in mask->coeff */ + + /* And a half float version for the vector path. mant has the signed + * 8-bit mantissas in [-1, +1), sexp has the exponent shift after the +@@ -166,89 +166,89 @@ typedef struct { + + /* The set of passes we need for this mask. + */ +- int n_pass; ++ int n_pass; + Pass pass[MAX_PASS]; + + /* Code for the final clip back to 8 bits. + */ +- int r; +- VipsVector *vector; ++ int r; ++ VipsVector *vector; + } VipsConvi; + + typedef VipsConvolutionClass VipsConviClass; + +-G_DEFINE_TYPE( VipsConvi, vips_convi, VIPS_TYPE_CONVOLUTION ); ++G_DEFINE_TYPE(VipsConvi, vips_convi, VIPS_TYPE_CONVOLUTION); + + /* Our sequence value. + */ + typedef struct { + VipsConvi *convi; +- VipsRegion *ir; /* Input region */ ++ VipsRegion *ir; /* Input region */ + +- int *offsets; /* Offsets for each non-zero matrix element */ ++ int *offsets; /* Offsets for each non-zero matrix element */ + +- int last_bpl; /* Avoid recalcing offsets, if we can */ ++ int last_bpl; /* Avoid recalcing offsets, if we can */ + + /* We need a pair of intermediate buffers to keep the results of each +- * vector conv pass. ++ * vector conv pass. + */ + short *t1; + short *t2; + } VipsConviSequence; + + static void +-vips_convi_compile_free( VipsConvi *convi ) ++vips_convi_compile_free(VipsConvi *convi) + { + int i; + +- for( i = 0; i < convi->n_pass; i++ ) +- VIPS_FREEF( vips_vector_free, convi->pass[i].vector ); ++ for (i = 0; i < convi->n_pass; i++) ++ VIPS_FREEF(vips_vector_free, convi->pass[i].vector); + convi->n_pass = 0; +- VIPS_FREEF( vips_vector_free, convi->vector ); ++ VIPS_FREEF(vips_vector_free, convi->vector); + } + + static void +-vips_convi_dispose( GObject *gobject ) ++vips_convi_dispose(GObject *gobject) + { + VipsConvi *convi = (VipsConvi *) gobject; + + #ifdef DEBUG +- printf( "vips_convi_dispose: " ); +- vips_object_print_name( VIPS_OBJECT( gobject ) ); +- printf( "\n" ); ++ printf("vips_convi_dispose: "); ++ vips_object_print_name(VIPS_OBJECT(gobject)); ++ printf("\n"); + #endif /*DEBUG*/ + +- vips_convi_compile_free( convi ); ++ vips_convi_compile_free(convi); + +- G_OBJECT_CLASS( vips_convi_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_convi_parent_class)->dispose(gobject); + } + + /* Free a sequence value. + */ + static int +-vips_convi_stop( void *vseq, void *a, void *b ) ++vips_convi_stop(void *vseq, void *a, void *b) + { + VipsConviSequence *seq = (VipsConviSequence *) vseq; + +- VIPS_UNREF( seq->ir ); +- VIPS_FREE( seq->offsets ); +- VIPS_FREE( seq->t1 ); +- VIPS_FREE( seq->t2 ); ++ VIPS_UNREF(seq->ir); ++ VIPS_FREE(seq->offsets); ++ VIPS_FREE(seq->t1); ++ VIPS_FREE(seq->t2); + +- return( 0 ); ++ return (0); + } + + /* Convolution start function. + */ + static void * +-vips_convi_start( VipsImage *out, void *a, void *b ) ++vips_convi_start(VipsImage *out, void *a, void *b) + { + VipsImage *in = (VipsImage *) a; + VipsConvi *convi = (VipsConvi *) b; + VipsConviSequence *seq; + +- if( !(seq = VIPS_NEW( out, VipsConviSequence )) ) +- return( NULL ); ++ if (!(seq = VIPS_NEW(out, VipsConviSequence))) ++ return (NULL); + + seq->convi = convi; + seq->ir = NULL; +@@ -257,49 +257,49 @@ vips_convi_start( VipsImage *out, void *a, void *b ) + seq->t1 = NULL; + seq->t2 = NULL; + +- seq->ir = vips_region_new( in ); ++ seq->ir = vips_region_new(in); + + /* C mode. + */ +- if( convi->nnz ) { +- if( !(seq->offsets = VIPS_ARRAY( NULL, convi->nnz, int )) ) { +- vips_convi_stop( seq, in, convi ); +- return( NULL ); ++ if (convi->nnz) { ++ if (!(seq->offsets = VIPS_ARRAY(NULL, convi->nnz, int))) { ++ vips_convi_stop(seq, in, convi); ++ return (NULL); + } + } + + /* Vector mode. + */ +- if( convi->n_pass ) { +- seq->t1 = VIPS_ARRAY( NULL, VIPS_IMAGE_N_ELEMENTS( in ), short ); +- seq->t2 = VIPS_ARRAY( NULL, VIPS_IMAGE_N_ELEMENTS( in ), short ); +- +- if( !seq->t1 || +- !seq->t2 ) { +- vips_convi_stop( seq, in, convi ); +- return( NULL ); ++ if (convi->n_pass) { ++ seq->t1 = VIPS_ARRAY(NULL, VIPS_IMAGE_N_ELEMENTS(in), short); ++ seq->t2 = VIPS_ARRAY(NULL, VIPS_IMAGE_N_ELEMENTS(in), short); ++ ++ if (!seq->t1 || ++ !seq->t2) { ++ vips_convi_stop(seq, in, convi); ++ return (NULL); + } + } + +- return( (void *) seq ); ++ return ((void *) seq); + } + +-#define TEMP( N, S ) vips_vector_temporary( v, (char *) N, S ) +-#define PARAM( N, S ) vips_vector_parameter( v, (char *) N, S ) +-#define SCANLINE( N, P, S ) vips_vector_source_scanline( v, (char *) N, P, S ) +-#define CONST( N, V, S ) vips_vector_constant( v, (char *) N, V, S ) +-#define ASM2( OP, A, B ) vips_vector_asm2( v, (char *) OP, A, B ) +-#define ASM3( OP, A, B, C ) vips_vector_asm3( v, (char *) OP, A, B, C ) ++#define TEMP(N, S) vips_vector_temporary(v, (char *) N, S) ++#define PARAM(N, S) vips_vector_parameter(v, (char *) N, S) ++#define SCANLINE(N, P, S) vips_vector_source_scanline(v, (char *) N, P, S) ++#define CONST(N, V, S) vips_vector_constant(v, (char *) N, V, S) ++#define ASM2(OP, A, B) vips_vector_asm2(v, (char *) OP, A, B) ++#define ASM3(OP, A, B, C) vips_vector_asm3(v, (char *) OP, A, B, C) + + /* Generate code for a section of the mask. first is the index we start +- * at, we set last to the index of the last one we use before we run ++ * at, we set last to the index of the last one we use before we run + * out of intermediates / constants / parameters / sources or mask + * coefficients. + * + * 0 for success, -1 on error. + */ + static int +-vips_convi_compile_section( VipsConvi *convi, VipsImage *in, Pass *pass ) ++vips_convi_compile_section(VipsConvi *convi, VipsImage *in, Pass *pass) + { + VipsConvolution *convolution = (VipsConvolution *) convi; + VipsImage *M = convolution->M; +@@ -308,35 +308,35 @@ vips_convi_compile_section( VipsConvi *convi, VipsImage *in, Pass *pass ) + int i; + + #ifdef DEBUG_COMPILE +- printf( "starting pass %d\n", pass->first ); ++ printf("starting pass %d\n", pass->first); + #endif /*DEBUG_COMPILE*/ + +- pass->vector = v = vips_vector_new( "convi", 2 ); ++ pass->vector = v = vips_vector_new("convi", 2); + + /* "r" is the array of sums from the previous pass (if any). + */ +- pass->r = vips_vector_source_name( v, "r", 2 ); ++ pass->r = vips_vector_source_name(v, "r", 2); + + /* The value we fetch from the image, the accumulated sum. + */ +- TEMP( "value", 2 ); +- TEMP( "valueb", 1 ); +- TEMP( "sum", 2 ); ++ TEMP("value", 2); ++ TEMP("valueb", 1); ++ TEMP("sum", 2); + + /* Init the sum. If this is the first pass, it's a constant. If this +- * is a later pass, we have to init the sum from the result +- * of the previous pass. ++ * is a later pass, we have to init the sum from the result ++ * of the previous pass. + */ +- if( pass->first == 0 ) { ++ if (pass->first == 0) { + char rnd[256]; + +- CONST( rnd, 1 << (convi->exp - 1), 2 ); +- ASM2( "loadpw", "sum", rnd ); ++ CONST(rnd, 1 << (convi->exp - 1), 2); ++ ASM2("loadpw", "sum", rnd); + } +- else +- ASM2( "loadw", "sum", "r" ); ++ else ++ ASM2("loadw", "sum", "r"); + +- for( i = pass->first; i < convi->n_point; i++ ) { ++ for (i = pass->first; i < convi->n_point; i++) { + int x = i % M->Xsize; + int y = i / M->Xsize; + +@@ -348,44 +348,44 @@ vips_convi_compile_section( VipsConvi *convi, VipsImage *in, Pass *pass ) + + /* Exclude zero elements. + */ +- if( !convi->mant[i] ) ++ if (!convi->mant[i]) + continue; + + /* The source. sl0 is the first scanline in the mask. + */ +- SCANLINE( source, y, 1 ); ++ SCANLINE(source, y, 1); + + /* Load with an offset. Only for non-first-columns though. + */ +- if( x == 0 ) +- ASM2( "convubw", "value", source ); ++ if (x == 0) ++ ASM2("convubw", "value", source); + else { +- CONST( off, in->Bands * x, 1 ); +- ASM3( "loadoffb", "valueb", source, off ); +- ASM2( "convubw", "value", "valueb" ); ++ CONST(off, in->Bands * x, 1); ++ ASM3("loadoffb", "valueb", source, off); ++ ASM2("convubw", "value", "valueb"); + } + + /* We need a signed multiply, so the image pixel needs to + * become a signed 16-bit value. We know only the bottom 8 bits + * of the image and coefficient are interesting, so we can take +- * the bottom half of a 16x16->32 multiply. ++ * the bottom half of a 16x16->32 multiply. + */ +- CONST( coeff, convi->mant[i], 2 ); +- ASM3( "mullw", "value", "value", coeff ); ++ CONST(coeff, convi->mant[i], 2); ++ ASM3("mullw", "value", "value", coeff); + + /* Shift right before add to prevent overflow on large masks. + */ +- CONST( sexp, convi->sexp, 2 ); +- CONST( rnd, 1 << (convi->sexp - 1), 2 ); +- ASM3( "addw", "value", "value", rnd ); +- ASM3( "shrsw", "value", "value", sexp ); ++ CONST(sexp, convi->sexp, 2); ++ CONST(rnd, 1 << (convi->sexp - 1), 2); ++ ASM3("addw", "value", "value", rnd); ++ ASM3("shrsw", "value", "value", sexp); + + /* We accumulate the signed 16-bit result in sum. Saturated +- * add. ++ * add. + */ +- ASM3( "addssw", "sum", "sum", "value" ); ++ ASM3("addssw", "sum", "sum", "value"); + +- if( vips_vector_full( v ) ) ++ if (vips_vector_full(v)) + break; + } + +@@ -393,94 +393,94 @@ vips_convi_compile_section( VipsConvi *convi, VipsImage *in, Pass *pass ) + + /* And write to our intermediate buffer. + */ +- ASM2( "copyw", "d1", "sum" ); ++ ASM2("copyw", "d1", "sum"); + +- if( !vips_vector_compile( v ) ) +- return( -1 ); ++ if (!vips_vector_compile(v)) ++ return (-1); + + #ifdef DEBUG_COMPILE +- printf( "done coeffs %d to %d\n", pass->first, pass->last ); +- vips_vector_print( v ); ++ printf("done coeffs %d to %d\n", pass->first, pass->last); ++ vips_vector_print(v); + #endif /*DEBUG_COMPILE*/ + +- return( 0 ); ++ return (0); + } + +-/* Generate code for the final 16->8 conversion. ++/* Generate code for the final 16->8 conversion. + * + * 0 for success, -1 on error. + */ + static int +-vips_convi_compile_clip( VipsConvi *convi ) ++vips_convi_compile_clip(VipsConvi *convi) + { + VipsConvolution *convolution = (VipsConvolution *) convi; + VipsImage *M = convolution->M; +- int offset = VIPS_RINT( vips_image_get_offset( M ) ); ++ int offset = VIPS_RINT(vips_image_get_offset(M)); + + VipsVector *v; + char exp[256]; + char off[256]; + +- convi->vector = v = vips_vector_new( "convi", 1 ); ++ convi->vector = v = vips_vector_new("convi", 1); + +- /* "r" is the array of sums we clip down. ++ /* "r" is the array of sums we clip down. + */ +- convi->r = vips_vector_source_name( v, "r", 2 ); ++ convi->r = vips_vector_source_name(v, "r", 2); + + /* The value we fetch from the image. + */ +- TEMP( "value", 2 ); ++ TEMP("value", 2); + +- CONST( exp, convi->exp, 2 ); +- ASM3( "shrsw", "value", "r", exp ); ++ CONST(exp, convi->exp, 2); ++ ASM3("shrsw", "value", "r", exp); + +- CONST( off, offset, 2 ); +- ASM3( "addw", "value", "value", off ); ++ CONST(off, offset, 2); ++ ASM3("addw", "value", "value", off); + +- ASM2( "convsuswb", "d1", "value" ); ++ ASM2("convsuswb", "d1", "value"); + +- if( !vips_vector_compile( v ) ) +- return( -1 ); ++ if (!vips_vector_compile(v)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_convi_compile( VipsConvi *convi, VipsImage *in ) ++vips_convi_compile(VipsConvi *convi, VipsImage *in) + { + int i; + Pass *pass; + + /* Generate passes until we've used up the whole mask. + */ +- for( i = 0;; ) { ++ for (i = 0;;) { + /* Allocate space for another pass. + */ +- if( convi->n_pass == MAX_PASS ) +- return( -1 ); ++ if (convi->n_pass == MAX_PASS) ++ return (-1); + pass = &convi->pass[convi->n_pass]; + convi->n_pass += 1; + + pass->first = i; + pass->r = -1; + +- if( vips_convi_compile_section( convi, in, pass ) ) +- return( -1 ); ++ if (vips_convi_compile_section(convi, in, pass)) ++ return (-1); + i = pass->last + 1; + +- if( i >= convi->n_point ) ++ if (i >= convi->n_point) + break; + } + +- if( vips_convi_compile_clip( convi ) ) +- return( -1 ); ++ if (vips_convi_compile_clip(convi)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_convi_gen_vector( VipsRegion *or, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_convi_gen_vector(VipsRegion * or, ++ void *vseq, void *a, void *b, gboolean *stop) + { + VipsConviSequence *seq = (VipsConviSequence *) vseq; + VipsConvi *convi = (VipsConvi *) b; +@@ -488,7 +488,7 @@ vips_convi_gen_vector( VipsRegion *or, + VipsImage *M = convolution->M; + VipsImage *in = (VipsImage *) a; + VipsRegion *ir = seq->ir; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int ne = r->width * in->Bands; + + VipsRect s; +@@ -497,8 +497,8 @@ vips_convi_gen_vector( VipsRegion *or, + VipsExecutor clip; + + #ifdef DEBUG_PIXELS +- printf( "vips_convi_gen_vector: generating %d x %d at %d x %d\n", +- r->width, r->height, r->left, r->top ); ++ printf("vips_convi_gen_vector: generating %d x %d at %d x %d\n", ++ r->width, r->height, r->left, r->top); + #endif /*DEBUG_PIXELS*/ + + /* Prepare the section of the input image we need. A little larger +@@ -507,175 +507,186 @@ vips_convi_gen_vector( VipsRegion *or, + s = *r; + s.width += M->Xsize - 1; + s.height += M->Ysize - 1; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); ++ ++ for (i = 0; i < convi->n_pass; i++) ++ vips_executor_set_program(&executor[i], ++ convi->pass[i].vector, ne); ++ vips_executor_set_program(&clip, convi->vector, ne); + +- for( i = 0; i < convi->n_pass; i++ ) +- vips_executor_set_program( &executor[i], +- convi->pass[i].vector, ne ); +- vips_executor_set_program( &clip, convi->vector, ne ); ++ VIPS_GATE_START("vips_convi_gen_vector: work"); + +- VIPS_GATE_START( "vips_convi_gen_vector: work" ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *q = VIPS_REGION_ADDR(or, r->left, r->top + y); + +- for( y = 0; y < r->height; y ++ ) { +- VipsPel *q = VIPS_REGION_ADDR( or, r->left, r->top + y ); +- + #ifdef DEBUG_PIXELS +-{ +- int h, v; +- +- printf( "before convolve: x = %d, y = %d\n", +- r->left, r->top + y ); +- for( v = 0; v < M->Ysize; v++ ) { +- for( h = 0; h < M->Xsize; h++ ) +- printf( "%3d ", *VIPS_REGION_ADDR( ir, +- r->left + h, r->top + y + v ) ); +- printf( "\n" ); ++ { ++ int h, v; ++ ++ printf("before convolve: x = %d, y = %d\n", ++ r->left, r->top + y); ++ for (v = 0; v < M->Ysize; v++) { ++ for (h = 0; h < M->Xsize; h++) ++ printf("%3d ", *VIPS_REGION_ADDR(ir, r->left + h, r->top + y + v)); ++ printf("\n"); ++ } + } +-} + #endif /*DEBUG_PIXELS*/ + + /* We run our n passes to generate this scanline. + */ +- for( i = 0; i < convi->n_pass; i++ ) { +- Pass *pass = &convi->pass[i]; ++ for (i = 0; i < convi->n_pass; i++) { ++ Pass *pass = &convi->pass[i]; + +- vips_executor_set_scanline( &executor[i], +- ir, r->left, r->top + y ); +- vips_executor_set_array( &executor[i], +- pass->r, seq->t1 ); +- vips_executor_set_destination( &executor[i], seq->t2 ); +- vips_executor_run( &executor[i] ); ++ vips_executor_set_scanline(&executor[i], ++ ir, r->left, r->top + y); ++ vips_executor_set_array(&executor[i], ++ pass->r, seq->t1); ++ vips_executor_set_destination(&executor[i], seq->t2); ++ vips_executor_run(&executor[i]); + +- VIPS_SWAP( signed short *, seq->t1, seq->t2 ); ++ VIPS_SWAP(signed short *, seq->t1, seq->t2); + } + + #ifdef DEBUG_PIXELS +- printf( "before clip: %d\n", ((signed short *) seq->t1)[0] ); ++ printf("before clip: %d\n", ((signed short *) seq->t1)[0]); + #endif /*DEBUG_PIXELS*/ + +- vips_executor_set_array( &clip, convi->r, seq->t1 ); +- vips_executor_set_destination( &clip, q ); +- vips_executor_run( &clip ); ++ vips_executor_set_array(&clip, convi->r, seq->t1); ++ vips_executor_set_destination(&clip, q); ++ vips_executor_run(&clip); + + #ifdef DEBUG_PIXELS +- printf( "after clip: %d\n", +- *VIPS_REGION_ADDR( or, r->left, r->top + y ) ); ++ printf("after clip: %d\n", ++ *VIPS_REGION_ADDR(or, r->left, r->top + y)); + #endif /*DEBUG_PIXELS*/ + } + +- VIPS_GATE_STOP( "vips_convi_gen_vector: work" ); ++ VIPS_GATE_STOP("vips_convi_gen_vector: work"); + +- VIPS_COUNT_PIXELS( or, "vips_convi_gen_vector" ); ++ VIPS_COUNT_PIXELS(or, "vips_convi_gen_vector"); + +- return( 0 ); ++ return (0); + } + + /* INT inner loops. + */ +-#define CONV_INT( TYPE, CLIP ) { \ +- TYPE * restrict p = (TYPE *) VIPS_REGION_ADDR( ir, le, y ); \ +- TYPE * restrict q = (TYPE *) VIPS_REGION_ADDR( or, le, y ); \ +- int * restrict offsets = seq->offsets; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- int sum; \ +- int i; \ +- \ +- sum = 0; \ +- for ( i = 0; i < nnz; i++ ) \ +- sum += t[i] * p[offsets[i]]; \ +- \ +- sum = ((sum + rounding) / scale) + offset; \ +- \ +- CLIP; \ +- \ +- q[x] = sum; \ +- p += 1; \ +- } \ +-} ++#define CONV_INT(TYPE, CLIP) \ ++ { \ ++ TYPE *restrict p = (TYPE *) VIPS_REGION_ADDR(ir, le, y); \ ++ TYPE *restrict q = (TYPE *) VIPS_REGION_ADDR(or, le, y); \ ++ int *restrict offsets = seq->offsets; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ int sum; \ ++ int i; \ ++\ ++ sum = 0; \ ++ for (i = 0; i < nnz; i++) \ ++ sum += t[i] * p[offsets[i]]; \ ++\ ++ sum = ((sum + rounding) / scale) + offset; \ ++\ ++ CLIP; \ ++\ ++ q[x] = sum; \ ++ p += 1; \ ++ } \ ++ } + + /* FLOAT inner loops. + */ +-#define CONV_FLOAT( TYPE ) { \ +- TYPE * restrict p = (TYPE *) VIPS_REGION_ADDR( ir, le, y ); \ +- TYPE * restrict q = (TYPE *) VIPS_REGION_ADDR( or, le, y ); \ +- int * restrict offsets = seq->offsets; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- double sum; \ +- int i; \ +- \ +- sum = 0; \ +- for ( i = 0; i < nnz; i++ ) \ +- sum += t[i] * p[offsets[i]]; \ +- \ +- sum = (sum / scale) + offset; \ +- \ +- q[x] = sum; \ +- p += 1; \ +- } \ +-} ++#define CONV_FLOAT(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) VIPS_REGION_ADDR(ir, le, y); \ ++ TYPE *restrict q = (TYPE *) VIPS_REGION_ADDR(or, le, y); \ ++ int *restrict offsets = seq->offsets; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ double sum; \ ++ int i; \ ++\ ++ sum = 0; \ ++ for (i = 0; i < nnz; i++) \ ++ sum += t[i] * p[offsets[i]]; \ ++\ ++ sum = (sum / scale) + offset; \ ++\ ++ q[x] = sum; \ ++ p += 1; \ ++ } \ ++ } + + /* Various integer range clips. Record over/under flows. + */ +-#define CLIP_UCHAR( V ) \ +-G_STMT_START { \ +- if( (V) < 0 ) \ +- (V) = 0; \ +- else if( (V) > UCHAR_MAX ) \ +- (V) = UCHAR_MAX; \ +-} G_STMT_END +- +-#define CLIP_CHAR( V ) \ +-G_STMT_START { \ +- if( (V) < SCHAR_MIN ) \ +- (V) = SCHAR_MIN; \ +- else if( (V) > SCHAR_MAX ) \ +- (V) = SCHAR_MAX; \ +-} G_STMT_END +- +-#define CLIP_USHORT( V ) \ +-G_STMT_START { \ +- if( (V) < 0 ) \ +- (V) = 0; \ +- else if( (V) > USHRT_MAX ) \ +- (V) = USHRT_MAX; \ +-} G_STMT_END +- +-#define CLIP_SHORT( V ) \ +-G_STMT_START { \ +- if( (V) < SHRT_MIN ) \ +- (V) = SHRT_MIN; \ +- else if( (V) > SHRT_MAX ) \ +- (V) = SHRT_MAX; \ +-} G_STMT_END +- +-#define CLIP_NONE( V ) {} ++#define CLIP_UCHAR(V) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < 0) \ ++ (V) = 0; \ ++ else if ((V) > UCHAR_MAX) \ ++ (V) = UCHAR_MAX; \ ++ } \ ++ G_STMT_END ++ ++#define CLIP_CHAR(V) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < SCHAR_MIN) \ ++ (V) = SCHAR_MIN; \ ++ else if ((V) > SCHAR_MAX) \ ++ (V) = SCHAR_MAX; \ ++ } \ ++ G_STMT_END ++ ++#define CLIP_USHORT(V) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < 0) \ ++ (V) = 0; \ ++ else if ((V) > USHRT_MAX) \ ++ (V) = USHRT_MAX; \ ++ } \ ++ G_STMT_END ++ ++#define CLIP_SHORT(V) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < SHRT_MIN) \ ++ (V) = SHRT_MIN; \ ++ else if ((V) > SHRT_MAX) \ ++ (V) = SHRT_MAX; \ ++ } \ ++ G_STMT_END ++ ++#define CLIP_NONE(V) \ ++ { \ ++ } + + /* Convolve! + */ + static int +-vips_convi_gen( VipsRegion *or, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_convi_gen(VipsRegion * or, ++ void *vseq, void *a, void *b, gboolean *stop) + { + VipsConviSequence *seq = (VipsConviSequence *) vseq; + VipsConvi *convi = (VipsConvi *) b; + VipsConvolution *convolution = (VipsConvolution *) convi; + VipsImage *M = convolution->M; +- int scale = VIPS_RINT( vips_image_get_scale( M ) ); ++ int scale = VIPS_RINT(vips_image_get_scale(M)); + int rounding = scale / 2; +- int offset = VIPS_RINT( vips_image_get_offset( M ) ); ++ int offset = VIPS_RINT(vips_image_get_offset(M)); + VipsImage *in = (VipsImage *) a; + VipsRegion *ir = seq->ir; +- int * restrict t = convi->coeff; ++ int *restrict t = convi->coeff; + const int nnz = convi->nnz; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; + int to = r->top; +- int bo = VIPS_RECT_BOTTOM( r ); +- int sz = VIPS_REGION_N_ELEMENTS( or ) * +- (vips_band_format_iscomplex( in->BandFmt ) ? 2 : 1); ++ int bo = VIPS_RECT_BOTTOM(r); ++ int sz = VIPS_REGION_N_ELEMENTS(or) * ++ (vips_band_format_iscomplex(in->BandFmt) ? 2 : 1); + + VipsRect s; + int x, y, z, i; +@@ -686,63 +697,63 @@ vips_convi_gen( VipsRegion *or, + s = *r; + s.width += M->Xsize - 1; + s.height += M->Ysize - 1; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + +- /* Fill offset array. Only do this if the bpl has changed since the ++ /* Fill offset array. Only do this if the bpl has changed since the + * previous vips_region_prepare(). + */ +- if( seq->last_bpl != VIPS_REGION_LSKIP( ir ) ) { +- seq->last_bpl = VIPS_REGION_LSKIP( ir ); ++ if (seq->last_bpl != VIPS_REGION_LSKIP(ir)) { ++ seq->last_bpl = VIPS_REGION_LSKIP(ir); + +- for( i = 0; i < nnz; i++ ) { ++ for (i = 0; i < nnz; i++) { + z = convi->coeff_pos[i]; + x = z % M->Xsize; + y = z / M->Xsize; + +- seq->offsets[i] = +- (VIPS_REGION_ADDR( ir, x + le, y + to ) - +- VIPS_REGION_ADDR( ir, le, to )) / +- VIPS_IMAGE_SIZEOF_ELEMENT( ir->im ); ++ seq->offsets[i] = ++ (VIPS_REGION_ADDR(ir, x + le, y + to) - ++ VIPS_REGION_ADDR(ir, le, to)) / ++ VIPS_IMAGE_SIZEOF_ELEMENT(ir->im); + } + } + +- VIPS_GATE_START( "vips_convi_gen: work" ); ++ VIPS_GATE_START("vips_convi_gen: work"); + +- for( y = to; y < bo; y++ ) { +- switch( in->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- CONV_INT( unsigned char, CLIP_UCHAR( sum ) ); ++ for (y = to; y < bo; y++) { ++ switch (in->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ CONV_INT(unsigned char, CLIP_UCHAR(sum)); + break; + +- case VIPS_FORMAT_CHAR: +- CONV_INT( signed char, CLIP_CHAR( sum ) ); ++ case VIPS_FORMAT_CHAR: ++ CONV_INT(signed char, CLIP_CHAR(sum)); + break; + +- case VIPS_FORMAT_USHORT: +- CONV_INT( unsigned short, CLIP_USHORT( sum ) ); ++ case VIPS_FORMAT_USHORT: ++ CONV_INT(unsigned short, CLIP_USHORT(sum)); + break; + +- case VIPS_FORMAT_SHORT: +- CONV_INT( signed short, CLIP_SHORT( sum ) ); ++ case VIPS_FORMAT_SHORT: ++ CONV_INT(signed short, CLIP_SHORT(sum)); + break; + +- case VIPS_FORMAT_UINT: +- CONV_INT( unsigned int, CLIP_NONE( sum ) ); ++ case VIPS_FORMAT_UINT: ++ CONV_INT(unsigned int, CLIP_NONE(sum)); + break; + +- case VIPS_FORMAT_INT: +- CONV_INT( signed int, CLIP_NONE( sum ) ); ++ case VIPS_FORMAT_INT: ++ CONV_INT(signed int, CLIP_NONE(sum)); + break; + +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- CONV_FLOAT( float ); ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ CONV_FLOAT(float); + break; + +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- CONV_FLOAT( double ); ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ CONV_FLOAT(double); + break; + + default: +@@ -750,11 +761,11 @@ vips_convi_gen( VipsRegion *or, + } + } + +- VIPS_GATE_STOP( "vips_convi_gen: work" ); ++ VIPS_GATE_STOP("vips_convi_gen: work"); + +- VIPS_COUNT_PIXELS( or, "vips_convi_gen" ); ++ VIPS_COUNT_PIXELS(or, "vips_convi_gen"); + +- return( 0 ); ++ return (0); + } + + /* Make an int version of a mask. +@@ -763,7 +774,7 @@ vips_convi_gen( VipsRegion *or, + * effect. + */ + int +-vips__image_intize( VipsImage *in, VipsImage **out ) ++vips__image_intize(VipsImage *in, VipsImage **out) + { + VipsImage *t; + int x, y; +@@ -772,11 +783,11 @@ vips__image_intize( VipsImage *in, VipsImage **out ) + double out_offset; + int int_result; + +- if( vips_check_matrix( "vips2imask", in, &t ) ) +- return( -1 ); +- if( !(*out = vips_image_new_matrix( t->Xsize, t->Ysize )) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_check_matrix("vips2imask", in, &t)) ++ return (-1); ++ if (!(*out = vips_image_new_matrix(t->Xsize, t->Ysize))) { ++ g_object_unref(t); ++ return (-1); + } + + /* We want to make an intmask which has the same input to output ratio +@@ -790,42 +801,42 @@ vips__image_intize( VipsImage *in, VipsImage **out ) + * be? + */ + double_result = 0; +- for( y = 0; y < t->Ysize; y++ ) +- for( x = 0; x < t->Xsize; x++ ) +- double_result += *VIPS_MATRIX( t, x, y ); +- double_result /= vips_image_get_scale( t ); +- +- for( y = 0; y < t->Ysize; y++ ) +- for( x = 0; x < t->Xsize; x++ ) +- *VIPS_MATRIX( *out, x, y ) = +- VIPS_RINT( *VIPS_MATRIX( t, x, y ) ); +- +- out_scale = VIPS_RINT( vips_image_get_scale( t ) ); +- if( out_scale == 0 ) ++ for (y = 0; y < t->Ysize; y++) ++ for (x = 0; x < t->Xsize; x++) ++ double_result += *VIPS_MATRIX(t, x, y); ++ double_result /= vips_image_get_scale(t); ++ ++ for (y = 0; y < t->Ysize; y++) ++ for (x = 0; x < t->Xsize; x++) ++ *VIPS_MATRIX(*out, x, y) = ++ VIPS_RINT(*VIPS_MATRIX(t, x, y)); ++ ++ out_scale = VIPS_RINT(vips_image_get_scale(t)); ++ if (out_scale == 0) + out_scale = 1; +- out_offset = VIPS_RINT( vips_image_get_offset( t ) ); ++ out_offset = VIPS_RINT(vips_image_get_offset(t)); + + /* Now convolve a 1 everywhere image with the int version we've made, + * what do we get? + */ + int_result = 0; +- for( y = 0; y < t->Ysize; y++ ) +- for( x = 0; x < t->Xsize; x++ ) +- int_result += *VIPS_MATRIX( *out, x, y ); ++ for (y = 0; y < t->Ysize; y++) ++ for (x = 0; x < t->Xsize; x++) ++ int_result += *VIPS_MATRIX(*out, x, y); + int_result /= out_scale; + +- /* And adjust the scale to get as close to a match as we can. ++ /* And adjust the scale to get as close to a match as we can. + */ +- out_scale = VIPS_RINT( out_scale + (int_result - double_result) ); +- if( out_scale == 0 ) ++ out_scale = VIPS_RINT(out_scale + (int_result - double_result)); ++ if (out_scale == 0) + out_scale = 1; + +- vips_image_set_double( *out, "scale", out_scale ); +- vips_image_set_double( *out, "offset", out_offset ); ++ vips_image_set_double(*out, "scale", out_scale); ++ vips_image_set_double(*out, "offset", out_offset); + +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + /* Make an int version of a mask. Each element is 8.8 float, with the same +@@ -834,7 +845,7 @@ vips__image_intize( VipsImage *in, VipsImage **out ) + * @out is a w x h int array. + */ + static int +-vips_convi_intize( VipsConvi *convi, VipsImage *M ) ++vips_convi_intize(VipsConvi *convi, VipsImage *M) + { + VipsImage *t; + double scale; +@@ -844,40 +855,40 @@ vips_convi_intize( VipsConvi *convi, VipsImage *M ) + int shift; + int i; + +- if( vips_check_matrix( "vips2imask", M, &t ) ) +- return( -1 ); ++ if (vips_check_matrix("vips2imask", M, &t)) ++ return (-1); + + /* Bake the scale into the mask to make a double version. + */ +- scale = vips_image_get_scale( t ); +- if( !(scaled = VIPS_ARRAY( convi, convi->n_point, double )) ) { +- g_object_unref( t ); +- return( -1 ); ++ scale = vips_image_get_scale(t); ++ if (!(scaled = VIPS_ARRAY(convi, convi->n_point, double))) { ++ g_object_unref(t); ++ return (-1); + } +- for( i = 0; i < convi->n_point; i++ ) +- scaled[i] = VIPS_MATRIX( t, 0, 0 )[i] / scale; +- g_object_unref( t ); ++ for (i = 0; i < convi->n_point; i++) ++ scaled[i] = VIPS_MATRIX(t, 0, 0)[i] / scale; ++ g_object_unref(t); + + #ifdef DEBUG_COMPILE +-{ +- int x, y; +- +- printf( "vips_convi_intize: double version\n" ); +- for( y = 0; y < t->Ysize; y++ ) { +- printf( "\t" ); +- for( x = 0; x < t->Xsize; x++ ) +- printf( "%g ", scaled[y * t->Xsize + x] ); +- printf( "\n" ); ++ { ++ int x, y; ++ ++ printf("vips_convi_intize: double version\n"); ++ for (y = 0; y < t->Ysize; y++) { ++ printf("\t"); ++ for (x = 0; x < t->Xsize; x++) ++ printf("%g ", scaled[y * t->Xsize + x]); ++ printf("\n"); ++ } + } +-} + #endif /*DEBUG_COMPILE*/ + + mx = scaled[0]; + mn = scaled[0]; +- for( i = 1; i < convi->n_point; i++ ) { +- if( scaled[i] > mx ) ++ for (i = 1; i < convi->n_point; i++) { ++ if (scaled[i] > mx) + mx = scaled[i]; +- if( scaled[i] < mn ) ++ if (scaled[i] < mn) + mn = scaled[i]; + } + +@@ -886,117 +897,117 @@ vips_convi_intize( VipsConvi *convi, VipsImage *M ) + * + * Add one so we round up stuff exactly on x.0. We multiply by 128 + * later, so 1.0 (for example) would become 128, which is outside +- * signed 8 bit. ++ * signed 8 bit. + */ +- shift = ceil( log2( mx ) + 1 ); ++ shift = ceil(log2(mx) + 1); + + /* We need to sum n_points, so we have to shift right before adding a +- * new value to make sure we have enough range. ++ * new value to make sure we have enough range. + */ +- convi->sexp = ceil( log2( convi->n_point ) ); +- if( convi->sexp > 10 ) { +- g_info( "vips_convi_intize: mask too large" ); +- return( -1 ); ++ convi->sexp = ceil(log2(convi->n_point)); ++ if (convi->sexp > 10) { ++ g_info("vips_convi_intize: mask too large"); ++ return (-1); + } + + /* With that already done, the final shift must be ... + */ + convi->exp = 7 - shift - convi->sexp; + +- if( !(convi->mant = VIPS_ARRAY( convi, convi->n_point, int )) ) +- return( -1 ); +- for( i = 0; i < convi->n_point; i++ ) { +- /* 128 since this is signed. ++ if (!(convi->mant = VIPS_ARRAY(convi, convi->n_point, int))) ++ return (-1); ++ for (i = 0; i < convi->n_point; i++) { ++ /* 128 since this is signed. + */ +- convi->mant[i] = VIPS_RINT( 128 * scaled[i] * pow(2, -shift) ); ++ convi->mant[i] = VIPS_RINT(128 * scaled[i] * pow(2, -shift)); + +- if( convi->mant[i] < -128 || +- convi->mant[i] > 127 ) { +- g_info( "vips_convi_intize: mask range too large" ); +- return( -1 ); ++ if (convi->mant[i] < -128 || ++ convi->mant[i] > 127) { ++ g_info("vips_convi_intize: mask range too large"); ++ return (-1); + } + } + + #ifdef DEBUG_COMPILE +-{ +- int x, y; +- +- printf( "vips_convi_intize:\n" ); +- printf( "sexp = %d\n", convi->sexp ); +- printf( "exp = %d\n", convi->exp ); +- for( y = 0; y < t->Ysize; y++ ) { +- printf( "\t" ); +- for( x = 0; x < t->Xsize; x++ ) +- printf( "%4d ", convi->mant[y * t->Xsize + x] ); +- printf( "\n" ); ++ { ++ int x, y; ++ ++ printf("vips_convi_intize:\n"); ++ printf("sexp = %d\n", convi->sexp); ++ printf("exp = %d\n", convi->exp); ++ for (y = 0; y < t->Ysize; y++) { ++ printf("\t"); ++ for (x = 0; x < t->Xsize; x++) ++ printf("%4d ", convi->mant[y * t->Xsize + x]); ++ printf("\n"); ++ } + } +-} + #endif /*DEBUG_COMPILE*/ + + /* Verify accuracy. + */ +-{ +- double true_sum; +- int int_sum; +- int true_value; +- int int_value; +- +- true_sum = 0.0; +- int_sum = 0; +- for( i = 0; i < convi->n_point; i++ ) { +- int value; +- +- true_sum += 128 * scaled[i]; +- value = 128 * convi->mant[i]; +- value = (value + (1 << (convi->sexp - 1))) >> convi->sexp; +- int_sum += value; +- int_sum = VIPS_CLIP( SHRT_MIN, int_sum, SHRT_MAX ); +- } ++ { ++ double true_sum; ++ int int_sum; ++ int true_value; ++ int int_value; ++ ++ true_sum = 0.0; ++ int_sum = 0; ++ for (i = 0; i < convi->n_point; i++) { ++ int value; ++ ++ true_sum += 128 * scaled[i]; ++ value = 128 * convi->mant[i]; ++ value = (value + (1 << (convi->sexp - 1))) >> convi->sexp; ++ int_sum += value; ++ int_sum = VIPS_CLIP(SHRT_MIN, int_sum, SHRT_MAX); ++ } + +- true_value = VIPS_CLIP( 0, true_sum, 255 ); ++ true_value = VIPS_CLIP(0, true_sum, 255); + +- if( convi->exp > 0 ) +- int_value = (int_sum + (1 << (convi->exp - 1))) >> convi->exp; +- else +- int_value = VIPS_LSHIFT_INT( int_sum, convi->exp ); +- int_value = VIPS_CLIP( 0, int_value, 255 ); ++ if (convi->exp > 0) ++ int_value = (int_sum + (1 << (convi->exp - 1))) >> convi->exp; ++ else ++ int_value = VIPS_LSHIFT_INT(int_sum, convi->exp); ++ int_value = VIPS_CLIP(0, int_value, 255); + +- if( VIPS_ABS( true_value - int_value ) > 2 ) { +- g_info( "vips_convi_intize: too inaccurate" ); +- return( -1 ); ++ if (VIPS_ABS(true_value - int_value) > 2) { ++ g_info("vips_convi_intize: too inaccurate"); ++ return (-1); ++ } + } +-} + +- return( 0 ); ++ return (0); + } + + static int +-vips_convi_build( VipsObject *object ) ++vips_convi_build(VipsObject *object) + { + VipsConvolution *convolution = (VipsConvolution *) object; + VipsConvi *convi = (VipsConvi *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); + + VipsImage *in; + VipsImage *M; + VipsGenerateFn generate; + double *coeff; +- int i; ++ int i; + +- if( VIPS_OBJECT_CLASS( vips_convi_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_convi_parent_class)->build(object)) ++ return (-1); + + in = convolution->in; + M = convolution->M; + convi->n_point = M->Xsize * M->Ysize; + +- if( vips_embed( in, &t[0], +- M->Xsize / 2, M->Ysize / 2, +- in->Xsize + M->Xsize - 1, in->Ysize + M->Ysize - 1, +- "extend", VIPS_EXTEND_COPY, +- NULL ) ) +- return( -1 ); +- in = t[0]; ++ if (vips_embed(in, &t[0], ++ M->Xsize / 2, M->Ysize / 2, ++ in->Xsize + M->Xsize - 1, in->Ysize + M->Ysize - 1, ++ "extend", VIPS_EXTEND_COPY, ++ NULL)) ++ return (-1); ++ in = t[0]; + + /* Default to the C path. + */ +@@ -1004,58 +1015,58 @@ vips_convi_build( VipsObject *object ) + + /* For uchar input, try to make a vector path. + */ +- if( vips_vector_isenabled() && +- in->BandFmt == VIPS_FORMAT_UCHAR ) { +- if( !vips_convi_intize( convi, M ) && +- !vips_convi_compile( convi, in ) ) { ++ if (vips_vector_isenabled() && ++ in->BandFmt == VIPS_FORMAT_UCHAR) { ++ if (!vips_convi_intize(convi, M) && ++ !vips_convi_compile(convi, in)) { + generate = vips_convi_gen_vector; +- g_info( "convi: using vector path" ); ++ g_info("convi: using vector path"); + } + else +- vips_convi_compile_free( convi ); ++ vips_convi_compile_free(convi); + } + + /* Make the data for the C path. + */ +- if( generate == vips_convi_gen ) { +- g_info( "convi: using C path" ); ++ if (generate == vips_convi_gen) { ++ g_info("convi: using C path"); + + /* Make an int version of our mask. + */ +- if( vips__image_intize( M, &t[1] ) ) +- return( -1 ); ++ if (vips__image_intize(M, &t[1])) ++ return (-1); + M = t[1]; + +- coeff = VIPS_MATRIX( M, 0, 0 ); +- if( !(convi->coeff = VIPS_ARRAY( object, convi->n_point, int )) || +- !(convi->coeff_pos = +- VIPS_ARRAY( object, convi->n_point, int )) ) +- return( -1 ); ++ coeff = VIPS_MATRIX(M, 0, 0); ++ if (!(convi->coeff = VIPS_ARRAY(object, convi->n_point, int)) || ++ !(convi->coeff_pos = ++ VIPS_ARRAY(object, convi->n_point, int))) ++ return (-1); + +- /* Squeeze out zero mask elements. ++ /* Squeeze out zero mask elements. + */ + convi->nnz = 0; +- for( i = 0; i < convi->n_point; i++ ) +- if( coeff[i] ) { ++ for (i = 0; i < convi->n_point; i++) ++ if (coeff[i]) { + convi->coeff[convi->nnz] = coeff[i]; + convi->coeff_pos[convi->nnz] = i; + convi->nnz += 1; + } + +- /* Was the whole mask zero? We must have at least 1 element ++ /* Was the whole mask zero? We must have at least 1 element + * in there: set it to zero. + */ +- if( convi->nnz == 0 ) { ++ if (convi->nnz == 0) { + convi->coeff[0] = 0; + convi->coeff_pos[0] = 0; + convi->nnz = 1; + } + } + +- g_object_set( convi, "out", vips_image_new(), NULL ); +- if( vips_image_pipelinev( convolution->out, +- VIPS_DEMAND_STYLE_SMALLTILE, in, NULL ) ) +- return( -1 ); ++ g_object_set(convi, "out", vips_image_new(), NULL); ++ if (vips_image_pipelinev(convolution->out, ++ VIPS_DEMAND_STYLE_SMALLTILE, in, NULL)) ++ return (-1); + + /* Prepare output. Consider a 7x7 mask and a 7x7 image --- the output + * would be 1x1. +@@ -1063,35 +1074,35 @@ vips_convi_build( VipsObject *object ) + convolution->out->Xsize -= M->Xsize - 1; + convolution->out->Ysize -= M->Ysize - 1; + +- if( vips_image_generate( convolution->out, +- vips_convi_start, generate, vips_convi_stop, in, convi ) ) +- return( -1 ); ++ if (vips_image_generate(convolution->out, ++ vips_convi_start, generate, vips_convi_stop, in, convi)) ++ return (-1); + + convolution->out->Xoffset = -M->Xsize / 2; + convolution->out->Yoffset = -M->Ysize / 2; + +- return( 0 ); ++ return (0); + } + + static void +-vips_convi_class_init( VipsConviClass *class ) ++vips_convi_class_init(VipsConviClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->dispose = vips_convi_dispose; + + object_class->nickname = "convi"; +- object_class->description = _( "int convolution operation" ); ++ object_class->description = _("int convolution operation"); + object_class->build = vips_convi_build; + } + + static void +-vips_convi_init( VipsConvi *convi ) ++vips_convi_init(VipsConvi *convi) + { +- convi->nnz = 0; +- convi->coeff = NULL; +- convi->coeff_pos = NULL; ++ convi->nnz = 0; ++ convi->coeff = NULL; ++ convi->coeff_pos = NULL; + } + + /** +@@ -1101,20 +1112,20 @@ vips_convi_init( VipsConvi *convi ) + * @mask: convolve with this mask + * @...: %NULL-terminated list of optional named arguments + * +- * Integer convolution. This is a low-level operation, see vips_conv() for +- * something more convenient. ++ * Integer convolution. This is a low-level operation, see vips_conv() for ++ * something more convenient. + * + * @mask is converted to an integer mask with rint() of each element, rint of +- * scale and rint of offset. Each output pixel is then calculated as ++ * scale and rint of offset. Each output pixel is then calculated as + * + * |[ + * sigma[i]{pixel[i] * mask[i]} / scale + offset + * ]| + * +- * The output image always has the same #VipsBandFormat as the input image. ++ * The output image always has the same #VipsBandFormat as the input image. + * + * For #VIPS_FORMAT_UCHAR images, vips_convi() uses a fast vector path based on +- * half-float arithmetic. This can produce slightly different results. ++ * half-float arithmetic. This can produce slightly different results. + * Disable the vector path with `--vips-novector` or `VIPS_NOVECTOR` or + * vips_vector_set_enabled(). + * +@@ -1122,16 +1133,15 @@ vips_convi_init( VipsConvi *convi ) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_convi( VipsImage *in, VipsImage **out, VipsImage *mask, ... ) ++int ++vips_convi(VipsImage *in, VipsImage **out, VipsImage *mask, ...) + { + va_list ap; + int result; + +- va_start( ap, mask ); +- result = vips_call_split( "convi", ap, in, out, mask ); +- va_end( ap ); ++ va_start(ap, mask); ++ result = vips_call_split("convi", ap, in, out, mask); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/convolution/convolution.c b/libvips/convolution/convolution.c +index f958894cbd..782fec7197 100644 +--- a/libvips/convolution/convolution.c ++++ b/libvips/convolution/convolution.c +@@ -8,28 +8,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,7 +51,7 @@ + + #include "pconvolution.h" + +-/** ++/** + * SECTION: convolution + * @short_description: convolve and correlate images + * @stability: Stable +@@ -62,16 +62,16 @@ + * + */ + +-/** ++/** + * VipsPrecision: + * @VIPS_PRECISION_INTEGER: int everywhere + * @VIPS_PRECISION_FLOAT: float everywhere + * @VIPS_PRECISION_APPROXIMATE: approximate integer output + * +- * How accurate an operation should be. ++ * How accurate an operation should be. + */ + +-/** ++/** + * VipsCombine: + * @VIPS_COMBINE_MAX: take the maximum of the possible values + * @VIPS_COMBINE_SUM: sum all the values +@@ -80,45 +80,44 @@ + * How to combine values. See vips_compass(), for example. + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsConvolution, vips_convolution, +- VIPS_TYPE_OPERATION ); ++G_DEFINE_ABSTRACT_TYPE(VipsConvolution, vips_convolution, ++ VIPS_TYPE_OPERATION); + + static int +-vips_convolution_build( VipsObject *object ) ++vips_convolution_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsConvolution *convolution = VIPS_CONVOLUTION( object ); +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsConvolution *convolution = VIPS_CONVOLUTION(object); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + + #ifdef DEBUG +- printf( "vips_convolution_build: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_convolution_build: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- if( VIPS_OBJECT_CLASS( vips_convolution_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_convolution_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_matrix( class->nickname, convolution->mask, &t[0] ) ) +- return( -1 ); ++ if (vips_check_matrix(class->nickname, convolution->mask, &t[0])) ++ return (-1); + convolution->M = t[0]; + +- return( 0 ); ++ return (0); + } + + static void +-vips_convolution_class_init( VipsConvolutionClass *class ) ++vips_convolution_class_init(VipsConvolutionClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "convolution"; +- vobject_class->description = _( "convolution operations" ); ++ vobject_class->description = _("convolution operations"); + vobject_class->build = vips_convolution_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; +@@ -126,28 +125,27 @@ vips_convolution_class_init( VipsConvolutionClass *class ) + /* Inputs set by subclassess. + */ + +- VIPS_ARG_IMAGE( class, "in", 0, +- _( "Input" ), +- _( "Input image argument" ), ++ VIPS_ARG_IMAGE(class, "in", 0, ++ _("Input"), ++ _("Input image argument"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsConvolution, in ) ); ++ G_STRUCT_OFFSET(VipsConvolution, in)); + +- VIPS_ARG_IMAGE( class, "out", 10, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsConvolution, out ) ); +- +- VIPS_ARG_IMAGE( class, "mask", 20, +- _( "Mask" ), +- _( "Input matrix image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsConvolution, mask ) ); ++ VIPS_ARG_IMAGE(class, "out", 10, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsConvolution, out)); + ++ VIPS_ARG_IMAGE(class, "mask", 20, ++ _("Mask"), ++ _("Input matrix image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsConvolution, mask)); + } + + static void +-vips_convolution_init( VipsConvolution *convolution ) ++vips_convolution_init(VipsConvolution *convolution) + { + } + +@@ -155,33 +153,33 @@ vips_convolution_init( VipsConvolution *convolution ) + * instead? + */ + void +-vips_convolution_operation_init( void ) ++vips_convolution_operation_init(void) + { +- extern GType vips_conv_get_type( void ); +- extern GType vips_conva_get_type( void ); +- extern GType vips_convf_get_type( void ); +- extern GType vips_convi_get_type( void ); +- extern GType vips_convsep_get_type( void ); +- extern GType vips_convasep_get_type( void ); +- extern GType vips_compass_get_type( void ); +- extern GType vips_fastcor_get_type( void ); +- extern GType vips_spcor_get_type( void ); +- extern GType vips_sharpen_get_type( void ); +- extern GType vips_gaussblur_get_type( void ); +- extern GType vips_sobel_get_type( void ); +- extern GType vips_canny_get_type( void ); +- +- vips_conv_get_type(); +- vips_conva_get_type(); +- vips_convf_get_type(); +- vips_convi_get_type(); +- vips_compass_get_type(); +- vips_convsep_get_type(); +- vips_convasep_get_type(); +- vips_fastcor_get_type(); +- vips_spcor_get_type(); +- vips_sharpen_get_type(); +- vips_gaussblur_get_type(); +- vips_canny_get_type(); +- vips_sobel_get_type(); ++ extern GType vips_conv_get_type(void); ++ extern GType vips_conva_get_type(void); ++ extern GType vips_convf_get_type(void); ++ extern GType vips_convi_get_type(void); ++ extern GType vips_convsep_get_type(void); ++ extern GType vips_convasep_get_type(void); ++ extern GType vips_compass_get_type(void); ++ extern GType vips_fastcor_get_type(void); ++ extern GType vips_spcor_get_type(void); ++ extern GType vips_sharpen_get_type(void); ++ extern GType vips_gaussblur_get_type(void); ++ extern GType vips_sobel_get_type(void); ++ extern GType vips_canny_get_type(void); ++ ++ vips_conv_get_type(); ++ vips_conva_get_type(); ++ vips_convf_get_type(); ++ vips_convi_get_type(); ++ vips_compass_get_type(); ++ vips_convsep_get_type(); ++ vips_convasep_get_type(); ++ vips_fastcor_get_type(); ++ vips_spcor_get_type(); ++ vips_sharpen_get_type(); ++ vips_gaussblur_get_type(); ++ vips_canny_get_type(); ++ vips_sobel_get_type(); + } +diff --git a/libvips/convolution/convsep.c b/libvips/convolution/convsep.c +index 3596cc41a3..7a6aa3e83d 100644 +--- a/libvips/convolution/convsep.c ++++ b/libvips/convolution/convsep.c +@@ -1,6 +1,6 @@ + /* convolve twice, rotating the mask + * +- * 23/10/13 ++ * 23/10/13 + * - from vips_convsep() + * 8/5/17 + * - default to float ... int will often lose precision and should not be +@@ -9,28 +9,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -48,109 +48,108 @@ + typedef struct { + VipsConvolution parent_instance; + +- VipsPrecision precision; +- int layers; +- int cluster; ++ VipsPrecision precision; ++ int layers; ++ int cluster; + } VipsConvsep; + + typedef VipsConvolutionClass VipsConvsepClass; + +-G_DEFINE_TYPE( VipsConvsep, vips_convsep, VIPS_TYPE_CONVOLUTION ); ++G_DEFINE_TYPE(VipsConvsep, vips_convsep, VIPS_TYPE_CONVOLUTION); + + static int +-vips_convsep_build( VipsObject *object ) ++vips_convsep_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsConvolution *convolution = (VipsConvolution *) object; + VipsConvsep *convsep = (VipsConvsep *) object; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( object, 4 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(object, 4); + + VipsImage *in; + +- g_object_set( convsep, "out", vips_image_new(), NULL ); ++ g_object_set(convsep, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_convsep_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_convsep_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_separable( class->nickname, convolution->M ) ) +- return( -1 ); ++ if (vips_check_separable(class->nickname, convolution->M)) ++ return (-1); + + in = convolution->in; + +- if( convsep->precision == VIPS_PRECISION_APPROXIMATE ) { +- if( vips_convasep( in, &t[0], convolution->M, +- "layers", convsep->layers, +- NULL ) ) +- return( -1 ); ++ if (convsep->precision == VIPS_PRECISION_APPROXIMATE) { ++ if (vips_convasep(in, &t[0], convolution->M, ++ "layers", convsep->layers, ++ NULL)) ++ return (-1); + in = t[0]; + } +- else { ++ else { + /* Take a copy, since we must set the offset. + */ +- if( vips_rot( convolution->M, &t[0], VIPS_ANGLE_D90, NULL ) || +- vips_copy( t[0], &t[3], NULL ) ) +- return( -1 ); +- vips_image_set_double( t[3], "offset", 0 ); ++ if (vips_rot(convolution->M, &t[0], VIPS_ANGLE_D90, NULL) || ++ vips_copy(t[0], &t[3], NULL)) ++ return (-1); ++ vips_image_set_double(t[3], "offset", 0); + +- if( vips_conv( in, &t[1], convolution->M, ++ if (vips_conv(in, &t[1], convolution->M, + "precision", convsep->precision, + "layers", convsep->layers, + "cluster", convsep->cluster, +- NULL ) || +- vips_conv( t[1], &t[2], t[3], ++ NULL) || ++ vips_conv(t[1], &t[2], t[3], + "precision", convsep->precision, + "layers", convsep->layers, + "cluster", convsep->cluster, +- NULL ) ) +- return( -1 ); ++ NULL)) ++ return (-1); + in = t[2]; + } + +- if( vips_image_write( in, convolution->out ) ) +- return( -1 ); ++ if (vips_image_write(in, convolution->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_convsep_class_init( VipsConvsepClass *class ) ++vips_convsep_class_init(VipsConvsepClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "convsep"; +- object_class->description = _( "seperable convolution operation" ); ++ object_class->description = _("seperable convolution operation"); + object_class->build = vips_convsep_build; + +- VIPS_ARG_ENUM( class, "precision", 203, +- _( "Precision" ), +- _( "Convolve with this precision" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsConvsep, precision ), +- VIPS_TYPE_PRECISION, VIPS_PRECISION_FLOAT ); +- +- VIPS_ARG_INT( class, "layers", 204, +- _( "Layers" ), +- _( "Use this many layers in approximation" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsConvsep, layers ), +- 1, 1000, 5 ); +- +- VIPS_ARG_INT( class, "cluster", 205, +- _( "Cluster" ), +- _( "Cluster lines closer than this in approximation" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsConvsep, cluster ), +- 1, 100, 1 ); +- ++ VIPS_ARG_ENUM(class, "precision", 203, ++ _("Precision"), ++ _("Convolve with this precision"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsConvsep, precision), ++ VIPS_TYPE_PRECISION, VIPS_PRECISION_FLOAT); ++ ++ VIPS_ARG_INT(class, "layers", 204, ++ _("Layers"), ++ _("Use this many layers in approximation"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsConvsep, layers), ++ 1, 1000, 5); ++ ++ VIPS_ARG_INT(class, "cluster", 205, ++ _("Cluster"), ++ _("Cluster lines closer than this in approximation"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsConvsep, cluster), ++ 1, 100, 1); + } + + static void +-vips_convsep_init( VipsConvsep *convsep ) ++vips_convsep_init(VipsConvsep *convsep) + { + convsep->precision = VIPS_PRECISION_FLOAT; + convsep->layers = 5; +@@ -173,9 +172,9 @@ vips_convsep_init( VipsConvsep *convsep ) + * Perform a separable convolution of @in with @mask. + * See vips_conv() for a detailed description. + * +- * The mask must be 1xn or nx1 elements. ++ * The mask must be 1xn or nx1 elements. + * +- * The image is convolved twice: once with @mask and then again with @mask ++ * The image is convolved twice: once with @mask and then again with @mask + * rotated by 90 degrees. This is much faster for certain types of mask + * (gaussian blur, for example) than doing a full 2D convolution. + * +@@ -183,15 +182,15 @@ vips_convsep_init( VipsConvsep *convsep ) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_convsep( VipsImage *in, VipsImage **out, VipsImage *mask, ... ) ++int ++vips_convsep(VipsImage *in, VipsImage **out, VipsImage *mask, ...) + { + va_list ap; + int result; + +- va_start( ap, mask ); +- result = vips_call_split( "convsep", ap, in, out, mask ); +- va_end( ap ); ++ va_start(ap, mask); ++ result = vips_call_split("convsep", ap, in, out, mask); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/convolution/correlation.c b/libvips/convolution/correlation.c +index e0317f2ee4..6e673d24b5 100644 +--- a/libvips/convolution/correlation.c ++++ b/libvips/convolution/correlation.c +@@ -1,4 +1,4 @@ +-/* base class for correlation ++/* base class for correlation + * + * 7/11/13 + * - from convolution.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -45,18 +45,18 @@ + #include "pconvolution.h" + #include "correlation.h" + +-G_DEFINE_ABSTRACT_TYPE( VipsCorrelation, vips_correlation, +- VIPS_TYPE_OPERATION ); ++G_DEFINE_ABSTRACT_TYPE(VipsCorrelation, vips_correlation, ++ VIPS_TYPE_OPERATION); + + static int +-vips_correlation_gen( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_correlation_gen(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + VipsCorrelation *correlation = (VipsCorrelation *) b; +- VipsCorrelationClass *cclass = +- VIPS_CORRELATION_GET_CLASS( correlation ); +- VipsRect *r = &or->valid; ++ VipsCorrelationClass *cclass = ++ VIPS_CORRELATION_GET_CLASS(correlation); ++ VipsRect *r = & or->valid; + + VipsRect irect; + +@@ -67,107 +67,105 @@ vips_correlation_gen( VipsRegion *or, + irect.width = r->width + correlation->ref_ready->Xsize - 1; + irect.height = r->height + correlation->ref_ready->Ysize - 1; + +- if( vips_region_prepare( ir, &irect ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &irect)) ++ return (-1); + +- cclass->correlation( correlation, ir, or ); ++ cclass->correlation(correlation, ir, or); + +- return( 0 ); ++ return (0); + } + + static int +-vips_correlation_build( VipsObject *object ) ++vips_correlation_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsCorrelationClass *cclass = VIPS_CORRELATION_CLASS( class ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsCorrelationClass *cclass = VIPS_CORRELATION_CLASS(class); + VipsCorrelation *correlation = (VipsCorrelation *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 6 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 6); + +- if( VIPS_OBJECT_CLASS( vips_correlation_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_correlation_parent_class)->build(object)) ++ return (-1); + + /* Stretch input out. + */ +- if( vips_embed( correlation->in, &t[0], +- correlation->ref->Xsize / 2, correlation->ref->Ysize / 2, +- correlation->in->Xsize + correlation->ref->Xsize - 1, +- correlation->in->Ysize + correlation->ref->Ysize - 1, +- "extend", VIPS_EXTEND_COPY, +- NULL ) ) +- return( -1 ); +- if( vips__formatalike( t[0], correlation->ref, &t[1], &t[2] ) || +- vips__bandalike( class->nickname, t[1], t[2], &t[3], &t[4] ) || +- !(t[5] = vips_image_copy_memory( t[4] )) ) +- return( -1 ); ++ if (vips_embed(correlation->in, &t[0], ++ correlation->ref->Xsize / 2, correlation->ref->Ysize / 2, ++ correlation->in->Xsize + correlation->ref->Xsize - 1, ++ correlation->in->Ysize + correlation->ref->Ysize - 1, ++ "extend", VIPS_EXTEND_COPY, ++ NULL)) ++ return (-1); ++ if (vips__formatalike(t[0], correlation->ref, &t[1], &t[2]) || ++ vips__bandalike(class->nickname, t[1], t[2], &t[3], &t[4]) || ++ !(t[5] = vips_image_copy_memory(t[4]))) ++ return (-1); + + correlation->in_ready = t[3]; + correlation->ref_ready = t[5]; + +- g_object_set( object, "out", vips_image_new(), NULL ); ++ g_object_set(object, "out", vips_image_new(), NULL); + + /* FATSTRIP is good for us as THINSTRIP will cause + * too many recalculations on overlaps. + */ +- if( vips_image_pipelinev( correlation->out, +- VIPS_DEMAND_STYLE_FATSTRIP, +- correlation->in_ready, correlation->ref_ready, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(correlation->out, ++ VIPS_DEMAND_STYLE_FATSTRIP, ++ correlation->in_ready, correlation->ref_ready, NULL)) ++ return (-1); + correlation->out->Xsize = correlation->in->Xsize; + correlation->out->Ysize = correlation->in->Ysize; +- correlation->out->BandFmt = ++ correlation->out->BandFmt = + cclass->format_table[correlation->in_ready->BandFmt]; +- if( cclass->pre_generate && +- cclass->pre_generate( correlation ) ) +- return( -1 ); +- if( vips_image_generate( correlation->out, +- vips_start_one, vips_correlation_gen, vips_stop_one, +- correlation->in_ready, correlation ) ) +- return( -1 ); +- +- vips_reorder_margin_hint( correlation->out, +- correlation->ref->Xsize * correlation->ref->Ysize ); +- +- return( 0 ); ++ if (cclass->pre_generate && ++ cclass->pre_generate(correlation)) ++ return (-1); ++ if (vips_image_generate(correlation->out, ++ vips_start_one, vips_correlation_gen, vips_stop_one, ++ correlation->in_ready, correlation)) ++ return (-1); ++ ++ vips_reorder_margin_hint(correlation->out, ++ correlation->ref->Xsize * correlation->ref->Ysize); ++ ++ return (0); + } + + static void +-vips_correlation_class_init( VipsCorrelationClass *class ) ++vips_correlation_class_init(VipsCorrelationClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "correlation"; +- object_class->description = _( "correlation operation" ); ++ object_class->description = _("correlation operation"); + object_class->build = vips_correlation_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 0, +- _( "Input" ), +- _( "Input image argument" ), ++ VIPS_ARG_IMAGE(class, "in", 0, ++ _("Input"), ++ _("Input image argument"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsCorrelation, in ) ); +- +- VIPS_ARG_IMAGE( class, "ref", 10, +- _( "Mask" ), +- _( "Input reference image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsCorrelation, ref ) ); ++ G_STRUCT_OFFSET(VipsCorrelation, in)); + +- VIPS_ARG_IMAGE( class, "out", 20, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsCorrelation, out ) ); ++ VIPS_ARG_IMAGE(class, "ref", 10, ++ _("Mask"), ++ _("Input reference image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsCorrelation, ref)); + ++ VIPS_ARG_IMAGE(class, "out", 20, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsCorrelation, out)); + } + + static void +-vips_correlation_init( VipsCorrelation *correlation ) ++vips_correlation_init(VipsCorrelation *correlation) + { + } +diff --git a/libvips/convolution/correlation.h b/libvips/convolution/correlation.h +index 65db60d98a..4b6120f22f 100644 +--- a/libvips/convolution/correlation.h ++++ b/libvips/convolution/correlation.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -38,19 +38,19 @@ extern "C" { + #include + + #define VIPS_TYPE_CORRELATION (vips_correlation_get_type()) +-#define VIPS_CORRELATION( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_CORRELATION, VipsCorrelation )) +-#define VIPS_CORRELATION_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_CORRELATION(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_CORRELATION, VipsCorrelation)) ++#define VIPS_CORRELATION_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_CORRELATION, VipsCorrelationClass)) ++#define VIPS_IS_CORRELATION(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_CORRELATION)) ++#define VIPS_IS_CORRELATION_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_CORRELATION)) ++#define VIPS_CORRELATION_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_CORRELATION, VipsCorrelationClass)) +-#define VIPS_IS_CORRELATION( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_CORRELATION )) +-#define VIPS_IS_CORRELATION_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_CORRELATION )) +-#define VIPS_CORRELATION_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_CORRELATION, VipsCorrelationClass )) + + typedef struct { + VipsOperation parent_instance; +@@ -72,25 +72,23 @@ typedef struct { + typedef struct { + VipsOperationClass parent_class; + +- /* For each upcast input format, what output format. ++ /* For each upcast input format, what output format. + */ + const VipsBandFormat *format_table; + + /* Run just before generate. The subclass can fill in some stuff. + */ +- int (*pre_generate)( VipsCorrelation * ); ++ int (*pre_generate)(VipsCorrelation *); + +- void (*correlation)( VipsCorrelation *, +- VipsRegion *in, VipsRegion *out ); ++ void (*correlation)(VipsCorrelation *, ++ VipsRegion *in, VipsRegion *out); + + } VipsCorrelationClass; + +-GType vips_correlation_get_type( void ); ++GType vips_correlation_get_type(void); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_PCORRELATION_H*/ +- +- +diff --git a/libvips/convolution/fastcor.c b/libvips/convolution/fastcor.c +index 10f29de8ff..9a0d1747c4 100644 +--- a/libvips/convolution/fastcor.c ++++ b/libvips/convolution/fastcor.c +@@ -12,7 +12,7 @@ + * 21/2/95 JC + * - partialed + * - speed-ups +- * 7/4/04 ++ * 7/4/04 + * - now uses im_embed() with edge stretching on the output + * - sets Xoffset / Yoffset + * 8/3/06 JC +@@ -28,28 +28,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -69,119 +69,120 @@ + typedef VipsCorrelationClass VipsFastcor; + typedef VipsCorrelationClass VipsFastcorClass; + +-G_DEFINE_TYPE( VipsFastcor, vips_fastcor, VIPS_TYPE_CORRELATION ); +- +-#define CORR_INT( TYPE ) { \ +- for( y = 0; y < r->height; y++ ) { \ +- unsigned int *q = (unsigned int *) \ +- VIPS_REGION_ADDR( out, r->left, r->top + y ); \ +- \ +- for( x = 0; x < r->width; x++ ) \ +- for( b = 0; b < bands; b++ ) { \ +- TYPE *p1 = (TYPE *) ref->data; \ +- TYPE *p2 = (TYPE *) VIPS_REGION_ADDR( in, \ +- r->left + x, r->top + y ); \ +- \ +- unsigned int sum; \ +- \ +- sum = 0; \ +- for( j = 0; j < ref->Ysize; j++ ) { \ +- for( i = b; i < sz; i += bands ) { \ +- int t = p1[i] - p2[i]; \ +- \ +- sum += t * t; \ ++G_DEFINE_TYPE(VipsFastcor, vips_fastcor, VIPS_TYPE_CORRELATION); ++ ++#define CORR_INT(TYPE) \ ++ { \ ++ for (y = 0; y < r->height; y++) { \ ++ unsigned int *q = (unsigned int *) \ ++ VIPS_REGION_ADDR(out, r->left, r->top + y); \ ++\ ++ for (x = 0; x < r->width; x++) \ ++ for (b = 0; b < bands; b++) { \ ++ TYPE *p1 = (TYPE *) ref->data; \ ++ TYPE *p2 = (TYPE *) VIPS_REGION_ADDR(in, \ ++ r->left + x, r->top + y); \ ++\ ++ unsigned int sum; \ ++\ ++ sum = 0; \ ++ for (j = 0; j < ref->Ysize; j++) { \ ++ for (i = b; i < sz; i += bands) { \ ++ int t = p1[i] - p2[i]; \ ++\ ++ sum += t * t; \ ++ } \ ++\ ++ p1 += sz; \ ++ p2 += lsk; \ + } \ +- \ +- p1 += sz; \ +- p2 += lsk; \ ++\ ++ *q++ = sum; \ + } \ +- \ +- *q++ = sum; \ +- } \ +- } \ +-} +- +-#define CORR_FLOAT( TYPE ) { \ +- for( y = 0; y < r->height; y++ ) { \ +- TYPE *q = (TYPE *) \ +- VIPS_REGION_ADDR( out, r->left, r->top + y ); \ +- \ +- for( x = 0; x < r->width; x++ ) \ +- for( b = 0; b < bands; b++ ) { \ +- TYPE *p_ref = (TYPE *) ref->data; \ +- TYPE *p_in = (TYPE *) VIPS_REGION_ADDR( in, \ +- r->left + x, r->top + y ); \ +- \ +- TYPE sum; \ +- \ +- sum = 0; \ +- for( j = 0; j < ref->Ysize; j++ ) { \ +- for( i = b; i < sz; i += bands ) { \ +- TYPE dif = p_ref[i] - p_in[i]; \ +- \ +- sum += dif * dif; \ ++ } \ ++ } ++ ++#define CORR_FLOAT(TYPE) \ ++ { \ ++ for (y = 0; y < r->height; y++) { \ ++ TYPE *q = (TYPE *) \ ++ VIPS_REGION_ADDR(out, r->left, r->top + y); \ ++\ ++ for (x = 0; x < r->width; x++) \ ++ for (b = 0; b < bands; b++) { \ ++ TYPE *p_ref = (TYPE *) ref->data; \ ++ TYPE *p_in = (TYPE *) VIPS_REGION_ADDR(in, \ ++ r->left + x, r->top + y); \ ++\ ++ TYPE sum; \ ++\ ++ sum = 0; \ ++ for (j = 0; j < ref->Ysize; j++) { \ ++ for (i = b; i < sz; i += bands) { \ ++ TYPE dif = p_ref[i] - p_in[i]; \ ++\ ++ sum += dif * dif; \ ++ } \ ++\ ++ p_ref += sz; \ ++ p_in += lsk; \ + } \ +- \ +- p_ref += sz; \ +- p_in += lsk; \ ++\ ++ *q++ = sum; \ + } \ +- \ +- *q++ = sum; \ +- } \ +- } \ +-} ++ } \ ++ } + + static void +-vips_fastcor_correlation( VipsCorrelation *correlation, +- VipsRegion *in, VipsRegion *out ) ++vips_fastcor_correlation(VipsCorrelation *correlation, ++ VipsRegion *in, VipsRegion *out) + { + VipsRect *r = &out->valid; + VipsImage *ref = correlation->ref_ready; +- int bands = vips_band_format_iscomplex( ref->BandFmt ) ? +- ref->Bands * 2 : ref->Bands; +- int sz = ref->Xsize * bands; +- int lsk = VIPS_REGION_LSKIP( in ) / VIPS_IMAGE_SIZEOF_ELEMENT( in->im ); ++ int bands = vips_band_format_iscomplex(ref->BandFmt) ? ref->Bands * 2 : ref->Bands; ++ int sz = ref->Xsize * bands; ++ int lsk = VIPS_REGION_LSKIP(in) / VIPS_IMAGE_SIZEOF_ELEMENT(in->im); + + int x, y, i, j, b; + +- switch( vips_image_get_format( ref ) ) { +- case VIPS_FORMAT_CHAR: +- CORR_INT( signed char ); +- break; ++ switch (vips_image_get_format(ref)) { ++ case VIPS_FORMAT_CHAR: ++ CORR_INT(signed char); ++ break; + +- case VIPS_FORMAT_UCHAR: +- CORR_INT( unsigned char ); +- break; ++ case VIPS_FORMAT_UCHAR: ++ CORR_INT(unsigned char); ++ break; + +- case VIPS_FORMAT_SHORT: +- CORR_INT( signed short ); +- break; ++ case VIPS_FORMAT_SHORT: ++ CORR_INT(signed short); ++ break; + +- case VIPS_FORMAT_USHORT: +- CORR_INT( unsigned short ); +- break; ++ case VIPS_FORMAT_USHORT: ++ CORR_INT(unsigned short); ++ break; + +- case VIPS_FORMAT_INT: +- CORR_INT( signed int ); +- break; ++ case VIPS_FORMAT_INT: ++ CORR_INT(signed int); ++ break; + +- case VIPS_FORMAT_UINT: +- CORR_INT( unsigned int ); +- break; ++ case VIPS_FORMAT_UINT: ++ CORR_INT(unsigned int); ++ break; + +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- CORR_FLOAT( float ); +- break; ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ CORR_FLOAT(float); ++ break; + +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- CORR_FLOAT( double ); ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ CORR_FLOAT(double); + break; + +- default: ++ default: + g_assert_not_reached(); +- } ++ } + } + + /* Save a bit of typing. +@@ -197,7 +198,7 @@ vips_fastcor_correlation( VipsCorrelation *correlation, + #define D VIPS_FORMAT_DOUBLE + #define DX VIPS_FORMAT_DPCOMPLEX + +-/* Type promotion for multiplication. Sign and value preserving. Make sure ++/* Type promotion for multiplication. Sign and value preserving. Make sure + * these match the case statement in multiply_buffer() above. + */ + static const VipsBandFormat vips_fastcor_format_table[10] = { +@@ -206,20 +207,20 @@ static const VipsBandFormat vips_fastcor_format_table[10] = { + }; + + static void +-vips_fastcor_class_init( VipsFastcorClass *class ) ++vips_fastcor_class_init(VipsFastcorClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsCorrelationClass *cclass = VIPS_CORRELATION_CLASS( class ); ++ VipsCorrelationClass *cclass = VIPS_CORRELATION_CLASS(class); + + object_class->nickname = "fastcor"; +- object_class->description = _( "fast correlation" ); ++ object_class->description = _("fast correlation"); + + cclass->format_table = vips_fastcor_format_table; + cclass->correlation = vips_fastcor_correlation; + } + + static void +-vips_fastcor_init( VipsFastcor *fastcor ) ++vips_fastcor_init(VipsFastcor *fastcor) + { + } + +@@ -233,19 +234,19 @@ vips_fastcor_init( VipsFastcor *fastcor ) + * Calculate a fast correlation surface. + * + * @ref is placed at every position in @in and the sum of squares of +- * differences calculated. ++ * differences calculated. + * + * The output +- * image is the same size as the input. Extra input edge pixels are made by +- * copying the existing edges outwards. ++ * image is the same size as the input. Extra input edge pixels are made by ++ * copying the existing edges outwards. + * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * + * The output type is uint if both inputs are integer, float if both are float +- * or complex, and double if either is double or double complex. ++ * or complex, and double if either is double or double complex. + * In other words, the output type is just large enough to hold the whole + * range of possible values. + * +@@ -253,15 +254,15 @@ vips_fastcor_init( VipsFastcor *fastcor ) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_fastcor( VipsImage *in, VipsImage *ref, VipsImage **out, ... ) ++int ++vips_fastcor(VipsImage *in, VipsImage *ref, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "fastcor", ap, in, ref, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("fastcor", ap, in, ref, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/convolution/gaussblur.c b/libvips/convolution/gaussblur.c +index 924fe6283b..7a1acaabbc 100644 +--- a/libvips/convolution/gaussblur.c ++++ b/libvips/convolution/gaussblur.c +@@ -1,5 +1,5 @@ +-/* Gaussian blur. +- * ++/* Gaussian blur. ++ * + * 15/11/13 + * - from vips_sharpen() + * 19/11/14 +@@ -11,28 +11,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -57,118 +57,117 @@ typedef struct _VipsGaussblur { + VipsImage *in; + VipsImage *out; + +- gdouble sigma; +- gdouble min_ampl; +- VipsPrecision precision; ++ gdouble sigma; ++ gdouble min_ampl; ++ VipsPrecision precision; + + } VipsGaussblur; + + typedef VipsOperationClass VipsGaussblurClass; + +-G_DEFINE_TYPE( VipsGaussblur, vips_gaussblur, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsGaussblur, vips_gaussblur, VIPS_TYPE_OPERATION); + + static int +-vips_gaussblur_build( VipsObject *object ) ++vips_gaussblur_build(VipsObject *object) + { + VipsGaussblur *gaussblur = (VipsGaussblur *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + +- if( VIPS_OBJECT_CLASS( vips_gaussblur_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_gaussblur_parent_class)->build(object)) ++ return (-1); + + /* vips_gaussmat() will make a 1x1 pixel mask for anything smaller than + * this. + */ +- if( gaussblur->sigma < 0.2 ) { +- if( vips_copy( gaussblur->in, &t[1], NULL ) ) +- return( -1 ); ++ if (gaussblur->sigma < 0.2) { ++ if (vips_copy(gaussblur->in, &t[1], NULL)) ++ return (-1); + } + else { +- if( vips_gaussmat( &t[0], +- gaussblur->sigma, gaussblur->min_ampl, +- "separable", TRUE, +- "precision", gaussblur->precision, +- NULL ) ) +- return( -1 ); ++ if (vips_gaussmat(&t[0], ++ gaussblur->sigma, gaussblur->min_ampl, ++ "separable", TRUE, ++ "precision", gaussblur->precision, ++ NULL)) ++ return (-1); + + #ifdef DEBUG +- printf( "gaussblur: blurring with:\n" ); +- vips_matrixprint( t[0], NULL ); ++ printf("gaussblur: blurring with:\n"); ++ vips_matrixprint(t[0], NULL); + #endif /*DEBUG*/ + +- g_info( "gaussblur mask width %d", t[0]->Xsize ); ++ g_info("gaussblur mask width %d", t[0]->Xsize); + +- if( vips_convsep( gaussblur->in, &t[1], t[0], +- "precision", gaussblur->precision, +- NULL ) ) +- return( -1 ); ++ if (vips_convsep(gaussblur->in, &t[1], t[0], ++ "precision", gaussblur->precision, ++ NULL)) ++ return (-1); + } + +- g_object_set( object, "out", vips_image_new(), NULL ); ++ g_object_set(object, "out", vips_image_new(), NULL); + +- if( vips_image_write( t[1], gaussblur->out ) ) +- return( -1 ); ++ if (vips_image_write(t[1], gaussblur->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_gaussblur_class_init( VipsGaussblurClass *class ) ++vips_gaussblur_class_init(VipsGaussblurClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "gaussblur"; +- object_class->description = _( "gaussian blur" ); ++ object_class->description = _("gaussian blur"); + object_class->build = vips_gaussblur_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGaussblur, in ) ); ++ G_STRUCT_OFFSET(VipsGaussblur, in)); + +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsGaussblur, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsGaussblur, out)); + +- VIPS_ARG_DOUBLE( class, "sigma", 3, +- _( "Sigma" ), +- _( "Sigma of Gaussian" ), ++ VIPS_ARG_DOUBLE(class, "sigma", 3, ++ _("Sigma"), ++ _("Sigma of Gaussian"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGaussblur, sigma ), +- 0.0, 1000, 1.5 ); ++ G_STRUCT_OFFSET(VipsGaussblur, sigma), ++ 0.0, 1000, 1.5); + +- VIPS_ARG_DOUBLE( class, "min_ampl", 3, +- _( "Minimum amplitude" ), +- _( "Minimum amplitude of Gaussian" ), ++ VIPS_ARG_DOUBLE(class, "min_ampl", 3, ++ _("Minimum amplitude"), ++ _("Minimum amplitude of Gaussian"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsGaussblur, min_ampl ), +- 0.001, 1.0, 0.2 ); +- +- VIPS_ARG_ENUM( class, "precision", 4, +- _( "Precision" ), +- _( "Convolve with this precision" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsGaussblur, precision ), +- VIPS_TYPE_PRECISION, VIPS_PRECISION_INTEGER ); ++ G_STRUCT_OFFSET(VipsGaussblur, min_ampl), ++ 0.001, 1.0, 0.2); + ++ VIPS_ARG_ENUM(class, "precision", 4, ++ _("Precision"), ++ _("Convolve with this precision"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsGaussblur, precision), ++ VIPS_TYPE_PRECISION, VIPS_PRECISION_INTEGER); + } + + static void +-vips_gaussblur_init( VipsGaussblur *gaussblur ) ++vips_gaussblur_init(VipsGaussblur *gaussblur) + { +- gaussblur->sigma = 1.5; ++ gaussblur->sigma = 1.5; + gaussblur->min_ampl = 0.2; +- gaussblur->precision = VIPS_PRECISION_INTEGER; ++ gaussblur->precision = VIPS_PRECISION_INTEGER; + } + + /** +@@ -185,21 +184,21 @@ vips_gaussblur_init( VipsGaussblur *gaussblur ) + * + * This operator runs vips_gaussmat() and vips_convsep() for you on an image. + * Set @min_ampl smaller to generate a larger, more accurate mask. Set @sigma +- * larger to make the blur more blurry. ++ * larger to make the blur more blurry. + * + * See also: vips_gaussmat(), vips_convsep(). +- * ++ * + * Returns: 0 on success, -1 on error. + */ +-int +-vips_gaussblur( VipsImage *in, VipsImage **out, double sigma, ... ) ++int ++vips_gaussblur(VipsImage *in, VipsImage **out, double sigma, ...) + { + va_list ap; + int result; + +- va_start( ap, sigma ); +- result = vips_call_split( "gaussblur", ap, in, out, sigma ); +- va_end( ap ); ++ va_start(ap, sigma); ++ result = vips_call_split("gaussblur", ap, in, out, sigma); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/convolution/pconvolution.h b/libvips/convolution/pconvolution.h +index 22413010e7..a342edf859 100644 +--- a/libvips/convolution/pconvolution.h ++++ b/libvips/convolution/pconvolution.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -38,19 +38,19 @@ extern "C" { + #include + + #define VIPS_TYPE_CONVOLUTION (vips_convolution_get_type()) +-#define VIPS_CONVOLUTION( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_CONVOLUTION, VipsConvolution )) +-#define VIPS_CONVOLUTION_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_CONVOLUTION(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_CONVOLUTION, VipsConvolution)) ++#define VIPS_CONVOLUTION_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_CONVOLUTION, VipsConvolutionClass)) ++#define VIPS_IS_CONVOLUTION(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_CONVOLUTION)) ++#define VIPS_IS_CONVOLUTION_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_CONVOLUTION)) ++#define VIPS_CONVOLUTION_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_CONVOLUTION, VipsConvolutionClass)) +-#define VIPS_IS_CONVOLUTION( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_CONVOLUTION )) +-#define VIPS_IS_CONVOLUTION_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_CONVOLUTION )) +-#define VIPS_CONVOLUTION_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_CONVOLUTION, VipsConvolutionClass )) + + typedef struct _VipsConvolution VipsConvolution; + +@@ -71,12 +71,10 @@ typedef struct _VipsConvolutionClass { + + } VipsConvolutionClass; + +-GType vips_convolution_get_type( void ); ++GType vips_convolution_get_type(void); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_PCONVOLUTION_H*/ +- +- +diff --git a/libvips/convolution/sharpen.c b/libvips/convolution/sharpen.c +index 596d2b1215..ce8c79a996 100644 +--- a/libvips/convolution/sharpen.c ++++ b/libvips/convolution/sharpen.c +@@ -1,8 +1,8 @@ + /* Cored sharpen of LABQ image. +- * ++ * + * Returns 0 on success and -1 on error + * +- * Copyright: 1995 A. Abbood ++ * Copyright: 1995 A. Abbood + * Author: A. Abbood + * Written on: 30/01/1995 + * 15/5/95 JC +@@ -22,7 +22,7 @@ + * - fix for band extract index changed + * 21/4/04 + * - switched to gaussian mask and radius +- * 20/11/04 ++ * 20/11/04 + * - uses extract_bands() to remove and reattach ab for slight speedup + * - accepts LabS as well as LabQ for slight speedup + * - small code tidies +@@ -45,28 +45,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -91,7 +91,7 @@ typedef struct _VipsSharpen { + VipsImage *in; + VipsImage *out; + +- double sigma; ++ double sigma; + double x1; + double y2; + double y3; +@@ -100,7 +100,7 @@ typedef struct _VipsSharpen { + + /* The lut we build. + */ +- int *lut; ++ int *lut; + + /* We used to have a radius control. + */ +@@ -110,33 +110,33 @@ typedef struct _VipsSharpen { + + typedef VipsOperationClass VipsSharpenClass; + +-G_DEFINE_TYPE( VipsSharpen, vips_sharpen, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsSharpen, vips_sharpen, VIPS_TYPE_OPERATION); + + static int +-vips_sharpen_generate( VipsRegion *or, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_sharpen_generate(VipsRegion * or, ++ void *vseq, void *a, void *b, gboolean *stop) + { + VipsRegion **in = (VipsRegion **) vseq; + VipsSharpen *sharpen = (VipsSharpen *) b; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int *lut = sharpen->lut; + +- int x, y; ++ int x, y; + +- if( vips_reorder_prepare_many( or->im, in, r ) ) +- return( -1 ); ++ if (vips_reorder_prepare_many(or->im, in, r)) ++ return (-1); + +- VIPS_GATE_START( "vips_sharpen_generate: work" ); ++ VIPS_GATE_START("vips_sharpen_generate: work"); + +- for( y = 0; y < r->height; y++ ) { +- short *p1 = (short * restrict) +- VIPS_REGION_ADDR( in[0], r->left, r->top + y ); +- short *p2 = (short * restrict) +- VIPS_REGION_ADDR( in[1], r->left, r->top + y ); +- short *q = (short * restrict) +- VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ short *p1 = (short *restrict) ++ VIPS_REGION_ADDR(in[0], r->left, r->top + y); ++ short *p2 = (short *restrict) ++ VIPS_REGION_ADDR(in[1], r->left, r->top + y); ++ short *q = (short *restrict) ++ VIPS_REGION_ADDR(or, r->left, r->top + y); + +- for( x = 0; x < r->width; x++ ) { ++ for (x = 0; x < r->width; x++) { + int v1 = p1[x]; + int v2 = p2[x]; + +@@ -148,244 +148,243 @@ vips_sharpen_generate( VipsRegion *or, + + int out; + +- g_assert( diff + 32768 >= 0 ); +- g_assert( diff + 32768 < 65536 ); ++ g_assert(diff + 32768 >= 0); ++ g_assert(diff + 32768 < 65536); + + out = v1 + lut[diff + 32768]; +- +- if( out < 0 ) ++ ++ if (out < 0) + out = 0; +- if( out > 32767 ) ++ if (out > 32767) + out = 32767; + + q[x] = out; + } + } + +- VIPS_GATE_STOP( "vips_sharpen_generate: work" ); ++ VIPS_GATE_STOP("vips_sharpen_generate: work"); + +- return( 0 ); ++ return (0); + } + + static int +-vips_sharpen_build( VipsObject *object ) ++vips_sharpen_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsSharpen *sharpen = (VipsSharpen *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 8 ); +- VipsImage **args = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 8); ++ VipsImage **args = (VipsImage **) vips_object_local_array(object, 2); + + VipsImage *in; + VipsInterpretation old_interpretation; + int i; + +- VIPS_GATE_START( "vips_sharpen_build: build" ); ++ VIPS_GATE_START("vips_sharpen_build: build"); + +- if( VIPS_OBJECT_CLASS( vips_sharpen_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_sharpen_parent_class)->build(object)) ++ return (-1); + + /* We used to have a radius control. If that's set but sigma isn't, + * use it to set a reasonable value for sigma. + */ +- if( !vips_object_argument_isset( object, "sigma" ) && +- vips_object_argument_isset( object, "radius" ) ) ++ if (!vips_object_argument_isset(object, "sigma") && ++ vips_object_argument_isset(object, "radius")) + sharpen->sigma = 1 + sharpen->radius / 2; + +- in = sharpen->in; ++ in = sharpen->in; + + old_interpretation = in->Type; +- if( vips_colourspace( in, &t[0], VIPS_INTERPRETATION_LABS, NULL ) ) +- return( -1 ); ++ if (vips_colourspace(in, &t[0], VIPS_INTERPRETATION_LABS, NULL)) ++ return (-1); + in = t[0]; + +- if( vips_check_uncoded( class->nickname, in ) || +- vips_check_bands_atleast( class->nickname, in, 3 ) || +- vips_check_format( class->nickname, in, VIPS_FORMAT_SHORT ) ) +- return( -1 ); ++ if (vips_check_uncoded(class->nickname, in) || ++ vips_check_bands_atleast(class->nickname, in, 3) || ++ vips_check_format(class->nickname, in, VIPS_FORMAT_SHORT)) ++ return (-1); + +- /* Stop at 10% of max ... a bit mean. We always sharpen a short, +- * so there's no point using a float mask. ++ /* Stop at 10% of max ... a bit mean. We always sharpen a short, ++ * so there's no point using a float mask. + */ +- if( vips_gaussmat( &t[1], sharpen->sigma, 0.1, +- "separable", TRUE, +- "precision", VIPS_PRECISION_INTEGER, +- NULL ) ) +- return( -1 ); ++ if (vips_gaussmat(&t[1], sharpen->sigma, 0.1, ++ "separable", TRUE, ++ "precision", VIPS_PRECISION_INTEGER, ++ NULL)) ++ return (-1); + + #ifdef DEBUG +- printf( "sharpen: blurring with:\n" ); +- vips_matrixprint( t[1], NULL ); ++ printf("sharpen: blurring with:\n"); ++ vips_matrixprint(t[1], NULL); + #endif /*DEBUG*/ + + /* Index with the signed difference between two 0 - 32767 images. + */ +- if( !(sharpen->lut = VIPS_ARRAY( object, 65536, int )) ) +- return( -1 ); ++ if (!(sharpen->lut = VIPS_ARRAY(object, 65536, int))) ++ return (-1); + +- for( i = 0; i < 65536; i++ ) { ++ for (i = 0; i < 65536; i++) { + /* Rescale to +/- 100. + */ + double v = (i - 32767) / 327.67; + double y; + +- if( v < -sharpen->x1 ) ++ if (v < -sharpen->x1) + /* Left of -x1. + */ + y = (v + sharpen->x1) * sharpen->m2 + + -sharpen->x1 * sharpen->m1; +- else if( v < sharpen->x1 ) ++ else if (v < sharpen->x1) + /* Centre section. + */ + y = v * sharpen->m1; +- else ++ else + /* Right of x1. + */ + y = (v - sharpen->x1) * sharpen->m2 + + sharpen->x1 * sharpen->m1; + +- if( y < -sharpen->y3 ) ++ if (y < -sharpen->y3) + y = -sharpen->y3; +- if( y > sharpen->y2 ) ++ if (y > sharpen->y2) + y = sharpen->y2; + +- sharpen->lut[i] = VIPS_RINT( y * 327.67 ); ++ sharpen->lut[i] = VIPS_RINT(y * 327.67); + } + + #ifdef DEBUG +-{ +- VipsImage *mat; +- +- mat = vips_image_new_matrix( 65536, 1 ); +- for( i = 0; i < 65536; i++ ) +- *VIPS_MATRIX( mat, i, 0 ) = sharpen->lut[i]; +- vips_image_write_to_file( mat, "x.v", NULL ); +- printf( "lut written to x.v\n" ); +- g_object_unref( mat ); +-} ++ { ++ VipsImage *mat; ++ ++ mat = vips_image_new_matrix(65536, 1); ++ for (i = 0; i < 65536; i++) ++ *VIPS_MATRIX(mat, i, 0) = sharpen->lut[i]; ++ vips_image_write_to_file(mat, "x.v", NULL); ++ printf("lut written to x.v\n"); ++ g_object_unref(mat); ++ } + #endif /*DEBUG*/ + + /* Extract L and the rest, convolve L. + */ +- if( vips_extract_band( in, &args[0], 0, NULL ) || +- vips_extract_band( in, &t[3], 1, "n", in->Bands - 1, NULL ) || +- vips_convsep( args[0], &args[1], t[1], ++ if (vips_extract_band(in, &args[0], 0, NULL) || ++ vips_extract_band(in, &t[3], 1, "n", in->Bands - 1, NULL) || ++ vips_convsep(args[0], &args[1], t[1], + "precision", VIPS_PRECISION_INTEGER, +- NULL ) ) +- return( -1 ); ++ NULL)) ++ return (-1); + + t[5] = vips_image_new(); +- if( vips_image_pipeline_array( t[5], +- VIPS_DEMAND_STYLE_FATSTRIP, args ) ) +- return( -1 ); ++ if (vips_image_pipeline_array(t[5], ++ VIPS_DEMAND_STYLE_FATSTRIP, args)) ++ return (-1); + +- if( vips_image_generate( t[5], +- vips_start_many, vips_sharpen_generate, vips_stop_many, +- args, sharpen ) ) +- return( -1 ); ++ if (vips_image_generate(t[5], ++ vips_start_many, vips_sharpen_generate, vips_stop_many, ++ args, sharpen)) ++ return (-1); + +- g_object_set( object, "out", vips_image_new(), NULL ); ++ g_object_set(object, "out", vips_image_new(), NULL); + + /* Reattach the rest. + */ +- if( vips_bandjoin2( t[5], t[3], &t[6], NULL ) || +- vips_colourspace( t[6], &t[7], old_interpretation, NULL ) || +- vips_image_write( t[7], sharpen->out ) ) +- return( -1 ); ++ if (vips_bandjoin2(t[5], t[3], &t[6], NULL) || ++ vips_colourspace(t[6], &t[7], old_interpretation, NULL) || ++ vips_image_write(t[7], sharpen->out)) ++ return (-1); + +- VIPS_GATE_STOP( "vips_sharpen_build: build" ); ++ VIPS_GATE_STOP("vips_sharpen_build: build"); + +- return( 0 ); ++ return (0); + } + + static void +-vips_sharpen_class_init( VipsSharpenClass *class ) ++vips_sharpen_class_init(VipsSharpenClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "sharpen"; +- object_class->description = _( "unsharp masking for print" ); ++ object_class->description = _("unsharp masking for print"); + object_class->build = vips_sharpen_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsSharpen, in ) ); ++ G_STRUCT_OFFSET(VipsSharpen, in)); + +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsSharpen, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsSharpen, out)); + +- VIPS_ARG_DOUBLE( class, "sigma", 3, +- _( "Sigma" ), +- _( "Sigma of Gaussian" ), ++ VIPS_ARG_DOUBLE(class, "sigma", 3, ++ _("Sigma"), ++ _("Sigma of Gaussian"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSharpen, sigma ), +- 0.000001, 10000.0, 0.5 ); ++ G_STRUCT_OFFSET(VipsSharpen, sigma), ++ 0.000001, 10000.0, 0.5); + +- VIPS_ARG_DOUBLE( class, "x1", 5, +- _( "x1" ), +- _( "Flat/jaggy threshold" ), ++ VIPS_ARG_DOUBLE(class, "x1", 5, ++ _("x1"), ++ _("Flat/jaggy threshold"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSharpen, x1 ), +- 0, 1000000, 2.0 ); ++ G_STRUCT_OFFSET(VipsSharpen, x1), ++ 0, 1000000, 2.0); + +- VIPS_ARG_DOUBLE( class, "y2", 6, +- _( "y2" ), +- _( "Maximum brightening" ), ++ VIPS_ARG_DOUBLE(class, "y2", 6, ++ _("y2"), ++ _("Maximum brightening"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSharpen, y2 ), +- 0, 1000000, 10 ); ++ G_STRUCT_OFFSET(VipsSharpen, y2), ++ 0, 1000000, 10); + +- VIPS_ARG_DOUBLE( class, "y3", 7, +- _( "y3" ), +- _( "Maximum darkening" ), ++ VIPS_ARG_DOUBLE(class, "y3", 7, ++ _("y3"), ++ _("Maximum darkening"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSharpen, y3 ), +- 0, 1000000, 20 ); ++ G_STRUCT_OFFSET(VipsSharpen, y3), ++ 0, 1000000, 20); + +- VIPS_ARG_DOUBLE( class, "m1", 8, +- _( "m1" ), +- _( "Slope for flat areas" ), ++ VIPS_ARG_DOUBLE(class, "m1", 8, ++ _("m1"), ++ _("Slope for flat areas"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSharpen, m1 ), +- 0, 1000000, 0.0 ); ++ G_STRUCT_OFFSET(VipsSharpen, m1), ++ 0, 1000000, 0.0); + +- VIPS_ARG_DOUBLE( class, "m2", 9, +- _( "m2" ), +- _( "Slope for jaggy areas" ), ++ VIPS_ARG_DOUBLE(class, "m2", 9, ++ _("m2"), ++ _("Slope for jaggy areas"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSharpen, m2 ), +- 0, 1000000, 3.0 ); ++ G_STRUCT_OFFSET(VipsSharpen, m2), ++ 0, 1000000, 3.0); + + /* We used to have a radius control. + */ +- VIPS_ARG_INT( class, "radius", 3, +- _( "Radius" ), +- _( "Radius of Gaussian" ), ++ VIPS_ARG_INT(class, "radius", 3, ++ _("Radius"), ++ _("Radius of Gaussian"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsSharpen, radius ), +- 1, 100, 1 ); +- ++ G_STRUCT_OFFSET(VipsSharpen, radius), ++ 1, 100, 1); + } + + static void +-vips_sharpen_init( VipsSharpen *sharpen ) ++vips_sharpen_init(VipsSharpen *sharpen) + { + sharpen->sigma = 0.5; + sharpen->x1 = 2.0; +- sharpen->y2 = 10.0; +- sharpen->y3 = 20.0; +- sharpen->m1 = 0.0; ++ sharpen->y2 = 10.0; ++ sharpen->y3 = 20.0; ++ sharpen->m1 = 0.0; + sharpen->m2 = 3.0; + } + +@@ -405,7 +404,7 @@ vips_sharpen_init( VipsSharpen *sharpen ) + * * @m2: slope for jaggy areas + * + * Selectively sharpen the L channel of a LAB image. The input image is +- * transformed to #VIPS_INTERPRETATION_LABS. ++ * transformed to #VIPS_INTERPRETATION_LABS. + * + * The operation performs a gaussian blur and subtracts from @in to generate a + * high-frequency signal. This signal is passed through a lookup table formed +@@ -416,12 +415,12 @@ vips_sharpen_init( VipsSharpen *sharpen ) + * |[ + * . ^ + * . y2 |- - - - - ----------- +- * . | / ++ * . | / + * . | / slope m2 +- * . | .../ +- * . -x1 | ... | ++ * . | .../ ++ * . -x1 | ... | + * . -------------------...----------------------> +- * . | ... | x1 ++ * . | ... | x1 + * . |... slope m1 + * . / | + * . / m2 | +@@ -444,29 +443,29 @@ vips_sharpen_init( VipsSharpen *sharpen ) + * m2 == 3 (some sharpening in jaggy areas) + * ]| + * +- * If you want more or less sharpening, we suggest you just change the +- * m2 parameter. ++ * If you want more or less sharpening, we suggest you just change the ++ * m2 parameter. + * +- * The @sigma parameter changes the width of the fringe and can be +- * adjusted according to the output printing resolution. As an approximate +- * guideline, use 0.5 for 4 pixels/mm (display resolution), +- * 1.0 for 12 pixels/mm and 1.5 for 16 pixels/mm (300 dpi == 12 +- * pixels/mm). These figures refer to the image raster, not the half-tone ++ * The @sigma parameter changes the width of the fringe and can be ++ * adjusted according to the output printing resolution. As an approximate ++ * guideline, use 0.5 for 4 pixels/mm (display resolution), ++ * 1.0 for 12 pixels/mm and 1.5 for 16 pixels/mm (300 dpi == 12 ++ * pixels/mm). These figures refer to the image raster, not the half-tone + * resolution. + * + * See also: vips_conv(). +- * ++ * + * Returns: 0 on success, -1 on error. + */ +-int +-vips_sharpen( VipsImage *in, VipsImage **out, ... ) ++int ++vips_sharpen(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "sharpen", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("sharpen", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/convolution/sobel.c b/libvips/convolution/sobel.c +index 9324dbdd2b..5d15695dd2 100644 +--- a/libvips/convolution/sobel.c ++++ b/libvips/convolution/sobel.c +@@ -1,33 +1,33 @@ + /* Sobel edge detector +- * ++ * + * 2/2/18 + * - from vips_sobel() + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -59,50 +59,50 @@ typedef struct _VipsSobel { + + typedef VipsOperationClass VipsSobelClass; + +-G_DEFINE_TYPE( VipsSobel, vips_sobel, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsSobel, vips_sobel, VIPS_TYPE_OPERATION); + + static int +-vips_sobel_uchar_gen( VipsRegion *or, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_sobel_uchar_gen(VipsRegion * or, ++ void *vseq, void *a, void *b, gboolean *stop) + { + VipsRegion **in = (VipsRegion **) vseq; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int sz = r->width * in[0]->im->Bands; + + int x, y; + +- if( vips_reorder_prepare_many( or->im, in, r ) ) +- return( -1 ); ++ if (vips_reorder_prepare_many(or->im, in, r)) ++ return (-1); + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *p1 = (VipsPel * restrict) +- VIPS_REGION_ADDR( in[0], r->left, r->top + y ); +- VipsPel *p2 = (VipsPel * restrict) +- VIPS_REGION_ADDR( in[1], r->left, r->top + y ); +- VipsPel *q = (VipsPel * restrict) +- VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *p1 = (VipsPel *restrict) ++ VIPS_REGION_ADDR(in[0], r->left, r->top + y); ++ VipsPel *p2 = (VipsPel *restrict) ++ VIPS_REGION_ADDR(in[1], r->left, r->top + y); ++ VipsPel *q = (VipsPel *restrict) ++ VIPS_REGION_ADDR(or, r->left, r->top + y); + +- for( x = 0; x < sz; x++ ) { ++ for (x = 0; x < sz; x++) { + int v1 = 2 * (p1[x] - 128); + int v2 = 2 * (p2[x] - 128); +- int v = VIPS_ABS( v1 ) + VIPS_ABS( v2 ); ++ int v = VIPS_ABS(v1) + VIPS_ABS(v2); + + q[x] = v > 255 ? 255 : v; + } + } + +- return( 0 ); ++ return (0); + } + + /* Fast uchar path. + */ + static int +-vips_sobel_build_uchar( VipsSobel *sobel ) ++vips_sobel_build_uchar(VipsSobel *sobel) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( sobel ), 20 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(sobel), 20); + +- g_info( "vips_sobel: uchar path" ); ++ g_info("vips_sobel: uchar path"); + + /* Sobel is separable, but it's so small there's no speed to be gained, + * and doing it one pass lets us keep more precision. +@@ -110,119 +110,118 @@ vips_sobel_build_uchar( VipsSobel *sobel ) + * Divide the result by 2 to prevent overflow, since our result will be + * just 8 bits. + */ +- t[1] = vips_image_new_matrixv( 3, 3, +- 1.0, 2.0, 1.0, +- 0.0, 0.0, 0.0, +- -1.0, -2.0, -1.0 ); +- vips_image_set_double( t[1], "offset", 128.0 ); +- vips_image_set_double( t[1], "scale", 2.0 ); +- if( vips_conv( sobel->in, &t[3], t[1], +- "precision", VIPS_PRECISION_INTEGER, +- NULL ) ) +- return( -1 ); +- +- if( vips_rot90( t[1], &t[5], NULL ) || +- vips_conv( sobel->in, &t[7], t[5], ++ t[1] = vips_image_new_matrixv(3, 3, ++ 1.0, 2.0, 1.0, ++ 0.0, 0.0, 0.0, ++ -1.0, -2.0, -1.0); ++ vips_image_set_double(t[1], "offset", 128.0); ++ vips_image_set_double(t[1], "scale", 2.0); ++ if (vips_conv(sobel->in, &t[3], t[1], ++ "precision", VIPS_PRECISION_INTEGER, ++ NULL)) ++ return (-1); ++ ++ if (vips_rot90(t[1], &t[5], NULL) || ++ vips_conv(sobel->in, &t[7], t[5], + "precision", VIPS_PRECISION_INTEGER, +- NULL ) ) +- return( -1 ); ++ NULL)) ++ return (-1); + +- g_object_set( sobel, "out", vips_image_new(), NULL ); ++ g_object_set(sobel, "out", vips_image_new(), NULL); + + sobel->args[0] = t[3]; + sobel->args[1] = t[7]; + sobel->args[2] = NULL; +- if( vips_image_pipeline_array( sobel->out, +- VIPS_DEMAND_STYLE_FATSTRIP, sobel->args ) ) +- return( -1 ); ++ if (vips_image_pipeline_array(sobel->out, ++ VIPS_DEMAND_STYLE_FATSTRIP, sobel->args)) ++ return (-1); + +- if( vips_image_generate( sobel->out, +- vips_start_many, vips_sobel_uchar_gen, vips_stop_many, +- sobel->args, NULL ) ) +- return( -1 ); ++ if (vips_image_generate(sobel->out, ++ vips_start_many, vips_sobel_uchar_gen, vips_stop_many, ++ sobel->args, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Works for any format, but slower. + */ + static int +-vips_sobel_build_float( VipsSobel *sobel ) ++vips_sobel_build_float(VipsSobel *sobel) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( sobel ), 20 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(sobel), 20); + +- g_info( "vips_sobel: float path" ); ++ g_info("vips_sobel: float path"); + +- t[1] = vips_image_new_matrixv( 3, 3, +- 1.0, 2.0, 1.0, +- 0.0, 0.0, 0.0, +- -1.0, -2.0, -1.0 ); +- if( vips_rot90( t[1], &t[2], NULL ) || +- vips_conv( sobel->in, &t[3], t[1], NULL ) || +- vips_conv( sobel->in, &t[7], t[2], NULL ) ) +- return( -1 ); ++ t[1] = vips_image_new_matrixv(3, 3, ++ 1.0, 2.0, 1.0, ++ 0.0, 0.0, 0.0, ++ -1.0, -2.0, -1.0); ++ if (vips_rot90(t[1], &t[2], NULL) || ++ vips_conv(sobel->in, &t[3], t[1], NULL) || ++ vips_conv(sobel->in, &t[7], t[2], NULL)) ++ return (-1); + +- if( vips_abs( t[3], &t[9], NULL ) || +- vips_abs( t[7], &t[10], NULL ) || +- vips_add( t[9], t[10], &t[11], NULL ) || +- vips_cast( t[11], &t[12], sobel->in->BandFmt, NULL ) ) +- return( -1 ); ++ if (vips_abs(t[3], &t[9], NULL) || ++ vips_abs(t[7], &t[10], NULL) || ++ vips_add(t[9], t[10], &t[11], NULL) || ++ vips_cast(t[11], &t[12], sobel->in->BandFmt, NULL)) ++ return (-1); + +- g_object_set( sobel, "out", vips_image_new(), NULL ); ++ g_object_set(sobel, "out", vips_image_new(), NULL); + +- if( vips_image_write( t[12], sobel->out ) ) +- return( -1 ); ++ if (vips_image_write(t[12], sobel->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_sobel_build( VipsObject *object ) ++vips_sobel_build(VipsObject *object) + { + VipsSobel *sobel = (VipsSobel *) object; + +- if( sobel->in->BandFmt == VIPS_FORMAT_UCHAR ) { +- if( vips_sobel_build_uchar( sobel ) ) +- return( -1 ); ++ if (sobel->in->BandFmt == VIPS_FORMAT_UCHAR) { ++ if (vips_sobel_build_uchar(sobel)) ++ return (-1); + } + else { +- if( vips_sobel_build_float( sobel ) ) +- return( -1 ); ++ if (vips_sobel_build_float(sobel)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_sobel_class_init( VipsSobelClass *class ) ++vips_sobel_class_init(VipsSobelClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "sobel"; +- object_class->description = _( "Sobel edge detector" ); ++ object_class->description = _("Sobel edge detector"); + object_class->build = vips_sobel_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsSobel, in ) ); +- +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsSobel, out ) ); ++ G_STRUCT_OFFSET(VipsSobel, in)); + ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsSobel, out)); + } + + static void +-vips_sobel_init( VipsSobel *sobel ) ++vips_sobel_init(VipsSobel *sobel) + { + } + +@@ -235,18 +234,18 @@ vips_sobel_init( VipsSobel *sobel ) + * Simple Sobel edge detector. + * + * See also: vips_canny(). +- * ++ * + * Returns: 0 on success, -1 on error. + */ +-int +-vips_sobel( VipsImage *in, VipsImage **out, ... ) ++int ++vips_sobel(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "sobel", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("sobel", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/convolution/spcor.c b/libvips/convolution/spcor.c +index 371f00a814..cb9d944cb2 100644 +--- a/libvips/convolution/spcor.c ++++ b/libvips/convolution/spcor.c +@@ -5,13 +5,13 @@ + * + * Author: Nicos Dessipris + * Written on: 02/05/1990 +- * Modified on : ++ * Modified on : + * 20/2/95 JC + * - updated + * - ANSIfied, a little + * 21/2/95 JC + * - rewritten +- * - partialed ++ * - partialed + * - speed-ups + * - new correlation coefficient (see above), from Niblack "An + * Introduction to Digital Image Processing", Prentice/Hall, pp 138. +@@ -42,28 +42,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -87,129 +87,129 @@ typedef struct _VipsSpcor { + */ + double *rmean; + +- /* Per band sqrt(sumij (ref(i,j)-mean(ref))^2) ++ /* Per band sqrt(sumij (ref(i,j)-mean(ref))^2) + */ + double *c1; +-} VipsSpcor; ++} VipsSpcor; + + typedef VipsCorrelationClass VipsSpcorClass; + +-G_DEFINE_TYPE( VipsSpcor, vips_spcor, VIPS_TYPE_CORRELATION ); ++G_DEFINE_TYPE(VipsSpcor, vips_spcor, VIPS_TYPE_CORRELATION); + + static int +-vips_spcor_pre_generate( VipsCorrelation *correlation ) ++vips_spcor_pre_generate(VipsCorrelation *correlation) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( correlation ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(correlation); + VipsSpcor *spcor = (VipsSpcor *) correlation; + VipsImage *ref = correlation->ref_ready; + int bands = ref->Bands; +- VipsImage **b = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( spcor ), bands ); +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( spcor ), 2 ); +- VipsImage **b2 = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( spcor ), bands ); +- +- int i; ++ VipsImage **b = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(spcor), bands); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(spcor), 2); ++ VipsImage **b2 = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(spcor), bands); ++ ++ int i; + double *offset; + double *scale; + +- if( vips_check_noncomplex( class->nickname, ref ) ) +- return( -1 ); ++ if (vips_check_noncomplex(class->nickname, ref)) ++ return (-1); + + /* Per-band mean. + */ +- if( !(spcor->rmean = VIPS_ARRAY( spcor, bands, double )) || +- !(spcor->c1 = VIPS_ARRAY( spcor, bands, double )) ) +- return( -1 ); +- for( i = 0; i < bands; i++ ) +- if( vips_extract_band( ref, &b[i], i, NULL ) || +- vips_avg( b[i], &spcor->rmean[i], NULL ) ) +- return( -1 ); +- +- /* Per band sqrt(sumij (ref(i,j)-mean(ref))^2) ++ if (!(spcor->rmean = VIPS_ARRAY(spcor, bands, double)) || ++ !(spcor->c1 = VIPS_ARRAY(spcor, bands, double))) ++ return (-1); ++ for (i = 0; i < bands; i++) ++ if (vips_extract_band(ref, &b[i], i, NULL) || ++ vips_avg(b[i], &spcor->rmean[i], NULL)) ++ return (-1); ++ ++ /* Per band sqrt(sumij (ref(i,j)-mean(ref))^2) + */ +- if( !(offset = VIPS_ARRAY( spcor, bands, double )) || +- !(scale = VIPS_ARRAY( spcor, bands, double )) ) +- return( -1 ); +- for( i = 0; i < bands; i++ ) { ++ if (!(offset = VIPS_ARRAY(spcor, bands, double)) || ++ !(scale = VIPS_ARRAY(spcor, bands, double))) ++ return (-1); ++ for (i = 0; i < bands; i++) { + offset[i] = -spcor->rmean[i]; + scale[i] = 1.0; + } +- if( vips_linear( ref, &t[0], scale, offset, bands, NULL ) || +- vips_multiply( t[0], t[0], &t[1], NULL ) ) +- return( -1 ); +- for( i = 0; i < bands; i++ ) +- if( vips_extract_band( t[1], &b2[i], i, NULL ) || +- vips_avg( b2[i], &spcor->c1[i], NULL ) ) +- return( -1 ); +- for( i = 0; i < bands; i++ ) { ++ if (vips_linear(ref, &t[0], scale, offset, bands, NULL) || ++ vips_multiply(t[0], t[0], &t[1], NULL)) ++ return (-1); ++ for (i = 0; i < bands; i++) ++ if (vips_extract_band(t[1], &b2[i], i, NULL) || ++ vips_avg(b2[i], &spcor->c1[i], NULL)) ++ return (-1); ++ for (i = 0; i < bands; i++) { + spcor->c1[i] *= ref->Xsize * ref->Ysize; +- spcor->c1[i] = sqrt( spcor->c1[i] ); ++ spcor->c1[i] = sqrt(spcor->c1[i]); + } + +- return( 0 ); ++ return (0); + } + +-#define LOOP( IN ) { \ +- IN *r1 = ((IN *) ref->data) + b; \ +- IN *p1 = ((IN *) p) + b; \ +- int in_lsk = lsk / sizeof( IN ); \ +- IN *r1a; \ +- IN *p1a; \ +- \ +- /* Mean of area of in corresponding to ref. \ +- */ \ +- p1a = p1; \ +- sum1 = 0.0; \ +- for( j = 0; j < ref->Ysize; j++ ) { \ +- for( i = 0; i < sz; i += bands ) \ +- sum1 += p1a[i]; \ +- p1a += in_lsk; \ +- } \ +- imean = sum1 / VIPS_IMAGE_N_PELS( ref ); \ +- \ +- /* Calculate sum-of-squares-of-differences for this window on \ +- * in, and also sum-of-products-of-differences from mean. \ +- */ \ +- p1a = p1; \ +- r1a = r1; \ +- sum2 = 0.0; \ +- sum3 = 0.0; \ +- for( j = 0; j < ref->Ysize; j++ ) { \ +- for( i = 0; i < sz; i += bands ) { \ +- /* Reference pel and input pel. \ +- */ \ +- IN ip = p1a[i]; \ +- IN rp = r1a[i]; \ +- \ +- /* Accumulate sum-of-squares-of-differences for \ +- * input image. \ +- */ \ +- double t = ip - imean; \ +- sum2 += t * t; \ +- \ +- /* Accumulate product-of-difference from mean. \ +- */ \ +- sum3 += (rp - spcor->rmean[b]) * t; \ ++#define LOOP(IN) \ ++ { \ ++ IN *r1 = ((IN *) ref->data) + b; \ ++ IN *p1 = ((IN *) p) + b; \ ++ int in_lsk = lsk / sizeof(IN); \ ++ IN *r1a; \ ++ IN *p1a; \ ++\ ++ /* Mean of area of in corresponding to ref. \ ++ */ \ ++ p1a = p1; \ ++ sum1 = 0.0; \ ++ for (j = 0; j < ref->Ysize; j++) { \ ++ for (i = 0; i < sz; i += bands) \ ++ sum1 += p1a[i]; \ ++ p1a += in_lsk; \ + } \ +- \ +- p1a += in_lsk; \ +- r1a += sz; \ +- } \ +-} ++ imean = sum1 / VIPS_IMAGE_N_PELS(ref); \ ++\ ++ /* Calculate sum-of-squares-of-differences for this window on \ ++ * in, and also sum-of-products-of-differences from mean. \ ++ */ \ ++ p1a = p1; \ ++ r1a = r1; \ ++ sum2 = 0.0; \ ++ sum3 = 0.0; \ ++ for (j = 0; j < ref->Ysize; j++) { \ ++ for (i = 0; i < sz; i += bands) { \ ++ /* Reference pel and input pel. \ ++ */ \ ++ IN ip = p1a[i]; \ ++ IN rp = r1a[i]; \ ++\ ++ /* Accumulate sum-of-squares-of-differences for \ ++ * input image. \ ++ */ \ ++ double t = ip - imean; \ ++ sum2 += t * t; \ ++\ ++ /* Accumulate product-of-difference from mean. \ ++ */ \ ++ sum3 += (rp - spcor->rmean[b]) * t; \ ++ } \ ++\ ++ p1a += in_lsk; \ ++ r1a += sz; \ ++ } \ ++ } + + static void +-vips_spcor_correlation( VipsCorrelation *correlation, +- VipsRegion *in, VipsRegion *out ) ++vips_spcor_correlation(VipsCorrelation *correlation, ++ VipsRegion *in, VipsRegion *out) + { + VipsSpcor *spcor = (VipsSpcor *) correlation; + VipsRect *r = &out->valid; + VipsImage *ref = correlation->ref_ready; +- int bands = vips_band_format_iscomplex( ref->BandFmt ) ? +- ref->Bands * 2 : ref->Bands; +- int sz = ref->Xsize * bands; +- int lsk = VIPS_REGION_LSKIP( in ); ++ int bands = vips_band_format_iscomplex(ref->BandFmt) ? ref->Bands * 2 : ref->Bands; ++ int sz = ref->Xsize * bands; ++ int lsk = VIPS_REGION_LSKIP(in); + + int x, y, b, j, i; + +@@ -218,48 +218,48 @@ vips_spcor_correlation( VipsCorrelation *correlation, + double sum2, sum3; + double c2, cc; + +- for( y = 0; y < r->height; y++ ) { +- float *q = (float *) +- VIPS_REGION_ADDR( out, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ float *q = (float *) ++ VIPS_REGION_ADDR(out, r->left, r->top + y); + +- for( x = 0; x < r->width; x++ ) { +- VipsPel *p = +- VIPS_REGION_ADDR( in, r->left + x, r->top + y ); ++ for (x = 0; x < r->width; x++) { ++ VipsPel *p = ++ VIPS_REGION_ADDR(in, r->left + x, r->top + y); + +- for( b = 0; b < bands; b++ ) { +- switch( vips_image_get_format( ref ) ) { +- case VIPS_FORMAT_UCHAR: +- LOOP( unsigned char ); ++ for (b = 0; b < bands; b++) { ++ switch (vips_image_get_format(ref)) { ++ case VIPS_FORMAT_UCHAR: ++ LOOP(unsigned char); + break; + +- case VIPS_FORMAT_CHAR: +- LOOP( signed char ); ++ case VIPS_FORMAT_CHAR: ++ LOOP(signed char); + break; + +- case VIPS_FORMAT_USHORT: +- LOOP( unsigned short ); ++ case VIPS_FORMAT_USHORT: ++ LOOP(unsigned short); + break; + +- case VIPS_FORMAT_SHORT: +- LOOP( signed short ); ++ case VIPS_FORMAT_SHORT: ++ LOOP(signed short); + break; + +- case VIPS_FORMAT_UINT: +- LOOP( unsigned int ); +- break; ++ case VIPS_FORMAT_UINT: ++ LOOP(unsigned int); ++ break; + +- case VIPS_FORMAT_INT: +- LOOP( signed int ); +- break; ++ case VIPS_FORMAT_INT: ++ LOOP(signed int); ++ break; + +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- LOOP( float ); +- break; ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ LOOP(float); ++ break; + +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- LOOP( double ); ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ LOOP(double); + break; + + default: +@@ -271,9 +271,9 @@ vips_spcor_correlation( VipsCorrelation *correlation, + sum3 = 0; + } + +- c2 = spcor->c1[b] * sqrt( sum2 ); ++ c2 = spcor->c1[b] * sqrt(sum2); + +- if( c2 == 0.0 ) ++ if (c2 == 0.0) + /* Something like constant ref. + * We regard this as uncorrelated. + */ +@@ -306,13 +306,13 @@ static const VipsBandFormat vips_spcor_format_table[10] = { + }; + + static void +-vips_spcor_class_init( VipsSpcorClass *class ) ++vips_spcor_class_init(VipsSpcorClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsCorrelationClass *cclass = VIPS_CORRELATION_CLASS( class ); ++ VipsCorrelationClass *cclass = VIPS_CORRELATION_CLASS(class); + + object_class->nickname = "spcor"; +- object_class->description = _( "spatial correlation" ); ++ object_class->description = _("spatial correlation"); + + cclass->format_table = vips_spcor_format_table; + cclass->pre_generate = vips_spcor_pre_generate; +@@ -320,7 +320,7 @@ vips_spcor_class_init( VipsSpcorClass *class ) + } + + static void +-vips_spcor_init( VipsSpcor *spcor ) ++vips_spcor_init(VipsSpcor *spcor) + { + } + +@@ -338,8 +338,8 @@ vips_spcor_init( VipsSpcor *spcor ) + * image is always float. + * + * The output +- * image is the same size as the input. Extra input edge pixels are made by +- * copying the existing edges outwards. ++ * image is the same size as the input. Extra input edge pixels are made by ++ * copying the existing edges outwards. + * + * The correlation coefficient is calculated as: + * +@@ -352,11 +352,11 @@ vips_spcor_init( VipsSpcor *spcor ) + * + * where inkl is the area of @in centred at position (k,l). + * +- * from Niblack "An Introduction to Digital Image Processing", ++ * from Niblack "An Introduction to Digital Image Processing", + * Prentice/Hall, pp 138. + * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +@@ -367,15 +367,15 @@ vips_spcor_init( VipsSpcor *spcor ) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_spcor( VipsImage *in, VipsImage *ref, VipsImage **out, ... ) ++int ++vips_spcor(VipsImage *in, VipsImage *ref, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "spcor", ap, in, ref, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("spcor", ap, in, ref, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/black.c b/libvips/create/black.c +index eca309999d..28a34aaee9 100644 +--- a/libvips/create/black.c ++++ b/libvips/create/black.c +@@ -22,28 +22,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -77,89 +77,89 @@ typedef struct _VipsBlack { + + typedef VipsCreateClass VipsBlackClass; + +-G_DEFINE_TYPE( VipsBlack, vips_black, VIPS_TYPE_CREATE ); ++G_DEFINE_TYPE(VipsBlack, vips_black, VIPS_TYPE_CREATE); + + static int +-vips_black_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++vips_black_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { +- /* +- VipsRect *r = &or->valid; ++ /* ++ VipsRect *r = &or->valid; + +- printf( "vips_black_gen: " +- "left = %d, top = %d, width = %d, height = %d\n", +- r->left, r->top, r->width, r->height ); +- */ ++ printf( "vips_black_gen: " ++ "left = %d, top = %d, width = %d, height = %d\n", ++ r->left, r->top, r->width, r->height ); ++ */ + +- vips_region_black( or ); ++ vips_region_black(or); + +- return( 0 ); ++ return (0); + } + + static int +-vips_black_build( VipsObject *object ) ++vips_black_build(VipsObject *object) + { +- VipsCreate *create = VIPS_CREATE( object ); ++ VipsCreate *create = VIPS_CREATE(object); + VipsBlack *black = (VipsBlack *) object; + +- if( VIPS_OBJECT_CLASS( vips_black_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_black_parent_class)->build(object)) ++ return (-1); + +- vips_image_init_fields( create->out, +- black->width, black->height, black->bands, ++ vips_image_init_fields(create->out, ++ black->width, black->height, black->bands, + VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, +- VIPS_INTERPRETATION_MULTIBAND, +- 1.0, 1.0 ); +- if( vips_image_pipelinev( create->out, +- VIPS_DEMAND_STYLE_ANY, NULL ) ) +- return( -1 ); ++ VIPS_INTERPRETATION_MULTIBAND, ++ 1.0, 1.0); ++ if (vips_image_pipelinev(create->out, ++ VIPS_DEMAND_STYLE_ANY, NULL)) ++ return (-1); + +- if( vips_image_generate( create->out, +- NULL, vips_black_gen, NULL, NULL, NULL ) ) +- return( -1 ); ++ if (vips_image_generate(create->out, ++ NULL, vips_black_gen, NULL, NULL, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_black_class_init( VipsBlackClass *class ) ++vips_black_class_init(VipsBlackClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_black_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_black_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "black"; +- vobject_class->description = _( "make a black image" ); ++ vobject_class->description = _("make a black image"); + vobject_class->build = vips_black_build; + +- VIPS_ARG_INT( class, "width", 4, +- _( "Width" ), +- _( "Image width in pixels" ), ++ VIPS_ARG_INT(class, "width", 4, ++ _("Width"), ++ _("Image width in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBlack, width ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsBlack, width), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "height", 5, +- _( "Height" ), +- _( "Image height in pixels" ), ++ VIPS_ARG_INT(class, "height", 5, ++ _("Height"), ++ _("Image height in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBlack, height ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsBlack, height), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "bands", 6, +- _( "Bands" ), +- _( "Number of bands in image" ), ++ VIPS_ARG_INT(class, "bands", 6, ++ _("Bands"), ++ _("Number of bands in image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsBlack, bands ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsBlack, bands), ++ 1, VIPS_MAX_COORD, 1); + } + + static void +-vips_black_init( VipsBlack *black ) ++vips_black_init(VipsBlack *black) + { + black->bands = 1; + } +@@ -182,14 +182,14 @@ vips_black_init( VipsBlack *black ) + * Returns: 0 on success, -1 on error + */ + int +-vips_black( VipsImage **out, int width, int height, ... ) ++vips_black(VipsImage **out, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "black", ap, out, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("black", ap, out, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/buildlut.c b/libvips/create/buildlut.c +index a92b8c6037..bf7226fdb0 100644 +--- a/libvips/create/buildlut.c ++++ b/libvips/create/buildlut.c +@@ -1,4 +1,4 @@ +-/* Build a LUT from a set of x/y points. ++/* Build a LUT from a set of x/y points. + * + * Written on: 26/9/06 + * - from im_invertlut() +@@ -20,28 +20,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -67,122 +67,122 @@ typedef struct _VipsBuildlut { + + /* Input image. + */ +- VipsImage *in; ++ VipsImage *in; + + /* .. and cast to a matrix. + */ + VipsImage *mat; + +- int xlow; /* Index 0 in output is this x */ +- int lut_size; /* Number of output elements to generate */ +- double **data; /* Matrix row pointers */ +- double *buf; /* Output buffer */ ++ int xlow; /* Index 0 in output is this x */ ++ int lut_size; /* Number of output elements to generate */ ++ double **data; /* Matrix row pointers */ ++ double *buf; /* Output buffer */ + } VipsBuildlut; + + typedef VipsCreateClass VipsBuildlutClass; + +-G_DEFINE_TYPE( VipsBuildlut, vips_buildlut, VIPS_TYPE_CREATE ); ++G_DEFINE_TYPE(VipsBuildlut, vips_buildlut, VIPS_TYPE_CREATE); + + static void +-vips_buildlut_dispose( GObject *gobject ) ++vips_buildlut_dispose(GObject *gobject) + { + VipsBuildlut *lut = (VipsBuildlut *) gobject; + +- VIPS_FREE( lut->data ); +- VIPS_FREE( lut->buf ); +- VIPS_UNREF( lut->mat ); ++ VIPS_FREE(lut->data); ++ VIPS_FREE(lut->buf); ++ VIPS_UNREF(lut->mat); + +- G_OBJECT_CLASS( vips_buildlut_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_buildlut_parent_class)->dispose(gobject); + } + + /* Use this to sort our input rows by the first column. + */ + static int +-vips_buildlut_compare( const void *a, const void *b ) ++vips_buildlut_compare(const void *a, const void *b) + { + double **r1 = (double **) a; + double **r2 = (double **) b; + + double diff = r1[0][0] - r2[0][0]; + +- if( diff > 0 ) +- return( 1 ); +- else if( diff == 0 ) +- return( 0 ); +- else +- return( -1 ); ++ if (diff > 0) ++ return (1); ++ else if (diff == 0) ++ return (0); ++ else ++ return (-1); + } + + static int +-vips_buildlut_build_init( VipsBuildlut *lut ) ++vips_buildlut_build_init(VipsBuildlut *lut) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( lut ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(lut); + + int y; + int xlow, xhigh; + + /* Need xlow and xhigh to get the size of the LUT we build. + */ +- xlow = xhigh = *VIPS_MATRIX( lut->mat, 0, 0 ); +- for( y = 0; y < lut->mat->Ysize; y++ ) { +- double v = *VIPS_MATRIX( lut->mat, 0, y ); +- ++ xlow = xhigh = *VIPS_MATRIX(lut->mat, 0, 0); ++ for (y = 0; y < lut->mat->Ysize; y++) { ++ double v = *VIPS_MATRIX(lut->mat, 0, y); ++ + /* Allow for being a bit off. + */ +- if( VIPS_FABS( v - VIPS_RINT( v ) ) > 0.001 ) { +- vips_error( class->nickname, +- _( "x value row %d not an int" ), y ); +- return( -1 ); ++ if (VIPS_FABS(v - VIPS_RINT(v)) > 0.001) { ++ vips_error(class->nickname, ++ _("x value row %d not an int"), y); ++ return (-1); + } + +- v = VIPS_RINT( v ); ++ v = VIPS_RINT(v); + +- if( v < xlow ) ++ if (v < xlow) + xlow = v; +- if( v > xhigh ) ++ if (v > xhigh) + xhigh = v; + } + lut->xlow = xlow; + lut->lut_size = xhigh - xlow + 1; + +- if( lut->lut_size < 1 ) { +- vips_error( class->nickname, "%s", _( "x range too small" ) ); +- return( -1 ); ++ if (lut->lut_size < 1) { ++ vips_error(class->nickname, "%s", _("x range too small")); ++ return (-1); + } + +- if( !(lut->data = VIPS_ARRAY( NULL, lut->mat->Ysize, double * )) ) +- return( -1 ); +- for( y = 0; y < lut->mat->Ysize; y++ ) +- lut->data[y] = VIPS_MATRIX( lut->mat, 0, y ); ++ if (!(lut->data = VIPS_ARRAY(NULL, lut->mat->Ysize, double *))) ++ return (-1); ++ for (y = 0; y < lut->mat->Ysize; y++) ++ lut->data[y] = VIPS_MATRIX(lut->mat, 0, y); + +- if( !(lut->buf = VIPS_ARRAY( NULL, +- lut->lut_size * (lut->mat->Xsize - 1), double )) ) +- return( -1 ); ++ if (!(lut->buf = VIPS_ARRAY(NULL, ++ lut->lut_size * (lut->mat->Xsize - 1), double))) ++ return (-1); + + /* Sort by 1st column in input. + */ +- qsort( lut->data, lut->mat->Ysize, +- sizeof( double * ), vips_buildlut_compare ); ++ qsort(lut->data, lut->mat->Ysize, ++ sizeof(double *), vips_buildlut_compare); + + #ifdef DEBUG +- printf( "Input table, sorted by 1st column\n" ); +- for( y = 0; y < lut->mat->Ysize; y++ ) { ++ printf("Input table, sorted by 1st column\n"); ++ for (y = 0; y < lut->mat->Ysize; y++) { + int x; + +- printf( "%.4d ", y ); ++ printf("%.4d ", y); + +- for( x = 0; x < lut->mat->Xsize; x++ ) +- printf( "%.9f ", lut->data[y][x] ); ++ for (x = 0; x < lut->mat->Xsize; x++) ++ printf("%.9f ", lut->data[y][x]); + +- printf( "\n" ); ++ printf("\n"); + } + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + static int +-vips_buildlut_build_create( VipsBuildlut *lut ) ++vips_buildlut_build_create(VipsBuildlut *lut) + { + const int xlow = lut->xlow; + const VipsImage *mat = lut->mat; +@@ -195,17 +195,17 @@ vips_buildlut_build_create( VipsBuildlut *lut ) + + /* Do each output channel separately. + */ +- for( b = 0; b < bands; b++ ) { +- for( i = 0; i < ysize - 1; i++ ) { +- const int x1 = VIPS_RINT( lut->data[i][0] ); +- const int x2 = VIPS_RINT( lut->data[i + 1][0] ); ++ for (b = 0; b < bands; b++) { ++ for (i = 0; i < ysize - 1; i++) { ++ const int x1 = VIPS_RINT(lut->data[i][0]); ++ const int x2 = VIPS_RINT(lut->data[i + 1][0]); + const int dx = x2 - x1; + const double y1 = lut->data[i][b + 1]; + const double y2 = lut->data[i + 1][b + 1]; + const double dy = y2 - y1; + +- for( x = 0; x < dx; x++ ) +- lut->buf[b + (x + x1 - xlow) * bands] = ++ for (x = 0; x < dx; x++) ++ lut->buf[b + (x + x1 - xlow) * bands] = + y1 + x * dy / dx; + } + +@@ -215,60 +215,59 @@ vips_buildlut_build_create( VipsBuildlut *lut ) + lut->data[ysize - 1][b + 1]; + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_buildlut_build( VipsObject *object ) ++vips_buildlut_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsCreate *create = VIPS_CREATE( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsCreate *create = VIPS_CREATE(object); + VipsBuildlut *lut = (VipsBuildlut *) object; + +- if( VIPS_OBJECT_CLASS( vips_buildlut_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_buildlut_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_matrix( class->nickname, lut->in, &lut->mat ) ) +- return( -1 ); ++ if (vips_check_matrix(class->nickname, lut->in, &lut->mat)) ++ return (-1); + +- if( vips_buildlut_build_init( lut ) || +- vips_buildlut_build_create( lut ) ) +- return( -1 ); ++ if (vips_buildlut_build_init(lut) || ++ vips_buildlut_build_create(lut)) ++ return (-1); + +- vips_image_init_fields( create->out, +- lut->lut_size, 1, lut->mat->Xsize - 1, +- VIPS_FORMAT_DOUBLE, VIPS_CODING_NONE, +- VIPS_INTERPRETATION_HISTOGRAM, 1.0, 1.0 ); +- if( vips_image_write_line( create->out, 0, (VipsPel *) lut->buf ) ) +- return( -1 ); ++ vips_image_init_fields(create->out, ++ lut->lut_size, 1, lut->mat->Xsize - 1, ++ VIPS_FORMAT_DOUBLE, VIPS_CODING_NONE, ++ VIPS_INTERPRETATION_HISTOGRAM, 1.0, 1.0); ++ if (vips_image_write_line(create->out, 0, (VipsPel *) lut->buf)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_buildlut_class_init( VipsBuildlutClass *class ) ++vips_buildlut_class_init(VipsBuildlutClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->dispose = vips_buildlut_dispose; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "buildlut"; +- vobject_class->description = _( "build a look-up table" ); ++ vobject_class->description = _("build a look-up table"); + vobject_class->build = vips_buildlut_build; + +- VIPS_ARG_IMAGE( class, "in", 0, +- _( "Input" ), +- _( "Matrix of XY coordinates" ), ++ VIPS_ARG_IMAGE(class, "in", 0, ++ _("Input"), ++ _("Matrix of XY coordinates"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsBuildlut, in ) ); +- ++ G_STRUCT_OFFSET(VipsBuildlut, in)); + } + + static void +-vips_buildlut_init( VipsBuildlut *lut ) ++vips_buildlut_init(VipsBuildlut *lut) + { + } + +@@ -280,7 +279,7 @@ vips_buildlut_init( VipsBuildlut *lut ) + * + * This operation builds a lookup table from a set of points. Intermediate + * values are generated by piecewise linear interpolation. The lookup table is +- * always of type #VIPS_FORMAT_DOUBLE, use vips_cast() to change it to the ++ * always of type #VIPS_FORMAT_DOUBLE, use vips_cast() to change it to the + * type you need. + * + * For example, consider this 2 x 2 matrix of (x, y) coordinates: +@@ -297,7 +296,7 @@ vips_buildlut_init( VipsBuildlut *lut ) + * + * + * +- * ++ * + * We then generate: + * + * +@@ -329,8 +328,8 @@ vips_buildlut_init( VipsBuildlut *lut ) + * + * This is then written as the output image, with the left column giving the + * index in the image to place the value. +- * +- * The (x, y) points don't need to be sorted: we do that. You can have ++ * ++ * The (x, y) points don't need to be sorted: we do that. You can have + * several Ys, each becomes a band in the output LUT. You don't need to + * start at zero, any integer will do, including negatives. + * +@@ -339,14 +338,14 @@ vips_buildlut_init( VipsBuildlut *lut ) + * Returns: 0 on success, -1 on error + */ + int +-vips_buildlut( VipsImage *in, VipsImage **out, ... ) ++vips_buildlut(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "buildlut", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("buildlut", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/create.c b/libvips/create/create.c +index 751bb1f488..6573063de0 100644 +--- a/libvips/create/create.c ++++ b/libvips/create/create.c +@@ -6,28 +6,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,7 +51,7 @@ + #include "point.h" + #include "pmask.h" + +-/** ++/** + * SECTION: create + * @short_description: create images in various ways + * @stability: Stable +@@ -63,11 +63,11 @@ + * The im_benchmark() operations are for testing the VIPS SMP system. + */ + +-/** ++/** + * VipsTextWrap: + * @VIPS_TEXT_WRAP_WORD: wrap at word boundaries + * @VIPS_TEXT_WRAP_CHAR: wrap at character boundaries +- * @VIPS_TEXT_WRAP_WORD_CHAR: wrap at word boundaries, but fall back to ++ * @VIPS_TEXT_WRAP_WORD_CHAR: wrap at word boundaries, but fall back to + * character boundaries if there is not enough space for a full word + * @VIPS_TEXT_WRAP_NONE: no wrapping + * +@@ -77,113 +77,112 @@ + * See also: vips_text(). + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsCreate, vips_create, VIPS_TYPE_OPERATION ); ++G_DEFINE_ABSTRACT_TYPE(VipsCreate, vips_create, VIPS_TYPE_OPERATION); + + static int +-vips_create_build( VipsObject *object ) ++vips_create_build(VipsObject *object) + { +- VipsCreate *create = VIPS_CREATE( object ); ++ VipsCreate *create = VIPS_CREATE(object); + + #ifdef DEBUG +- printf( "vips_create_build: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_create_build: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- g_object_set( create, "out", vips_image_new(), NULL ); ++ g_object_set(create, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_create_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_create_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_create_class_init( VipsCreateClass *class ) ++vips_create_class_init(VipsCreateClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "create"; +- vobject_class->description = _( "create operations" ); ++ vobject_class->description = _("create operations"); + vobject_class->build = vips_create_build; + +- VIPS_ARG_IMAGE( class, "out", 1, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsCreate, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 1, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsCreate, out)); + } + + static void +-vips_create_init( VipsCreate *create ) ++vips_create_init(VipsCreate *create) + { + } + + void +-vips_create_operation_init( void ) ++vips_create_operation_init(void) + { +- extern GType vips_black_get_type( void ); +- extern GType vips_gaussmat_get_type( void ); +- extern GType vips_logmat_get_type( void ); +- extern GType vips_gaussnoise_get_type( void ); ++ extern GType vips_black_get_type(void); ++ extern GType vips_gaussmat_get_type(void); ++ extern GType vips_logmat_get_type(void); ++ extern GType vips_gaussnoise_get_type(void); + #ifdef HAVE_PANGOCAIRO +- extern GType vips_text_get_type( void ); ++ extern GType vips_text_get_type(void); + #endif /*HAVE_PANGOCAIRO*/ +- extern GType vips_xyz_get_type( void ); +- extern GType vips_eye_get_type( void ); +- extern GType vips_grey_get_type( void ); +- extern GType vips_zone_get_type( void ); +- extern GType vips_sines_get_type( void ); +- extern GType vips_buildlut_get_type( void ); +- extern GType vips_invertlut_get_type( void ); +- extern GType vips_tonelut_get_type( void ); +- extern GType vips_identity_get_type( void ); +- extern GType vips_mask_butterworth_get_type( void ); +- extern GType vips_mask_butterworth_ring_get_type( void ); +- extern GType vips_mask_butterworth_band_get_type( void ); +- extern GType vips_mask_gaussian_get_type( void ); +- extern GType vips_mask_gaussian_ring_get_type( void ); +- extern GType vips_mask_gaussian_band_get_type( void ); +- extern GType vips_mask_ideal_get_type( void ); +- extern GType vips_mask_ideal_ring_get_type( void ); +- extern GType vips_mask_ideal_band_get_type( void ); +- extern GType vips_mask_fractal_get_type( void ); +- extern GType vips_fractsurf_get_type( void ); +- extern GType vips_worley_get_type( void ); +- extern GType vips_perlin_get_type( void ); ++ extern GType vips_xyz_get_type(void); ++ extern GType vips_eye_get_type(void); ++ extern GType vips_grey_get_type(void); ++ extern GType vips_zone_get_type(void); ++ extern GType vips_sines_get_type(void); ++ extern GType vips_buildlut_get_type(void); ++ extern GType vips_invertlut_get_type(void); ++ extern GType vips_tonelut_get_type(void); ++ extern GType vips_identity_get_type(void); ++ extern GType vips_mask_butterworth_get_type(void); ++ extern GType vips_mask_butterworth_ring_get_type(void); ++ extern GType vips_mask_butterworth_band_get_type(void); ++ extern GType vips_mask_gaussian_get_type(void); ++ extern GType vips_mask_gaussian_ring_get_type(void); ++ extern GType vips_mask_gaussian_band_get_type(void); ++ extern GType vips_mask_ideal_get_type(void); ++ extern GType vips_mask_ideal_ring_get_type(void); ++ extern GType vips_mask_ideal_band_get_type(void); ++ extern GType vips_mask_fractal_get_type(void); ++ extern GType vips_fractsurf_get_type(void); ++ extern GType vips_worley_get_type(void); ++ extern GType vips_perlin_get_type(void); + + vips_black_get_type(); + vips_gaussmat_get_type(); + vips_logmat_get_type(); +- vips_gaussnoise_get_type(); ++ vips_gaussnoise_get_type(); + #ifdef HAVE_PANGOCAIRO +- vips_text_get_type(); ++ vips_text_get_type(); + #endif /*HAVE_PANGOCAIRO*/ +- vips_xyz_get_type(); +- vips_eye_get_type(); +- vips_grey_get_type(); +- vips_zone_get_type(); +- vips_sines_get_type(); +- vips_buildlut_get_type(); +- vips_invertlut_get_type(); +- vips_tonelut_get_type(); +- vips_identity_get_type(); +- vips_mask_ideal_get_type(); +- vips_mask_ideal_ring_get_type(); +- vips_mask_ideal_band_get_type(); +- vips_mask_butterworth_get_type(); +- vips_mask_butterworth_ring_get_type(); +- vips_mask_butterworth_band_get_type(); +- vips_mask_gaussian_get_type(); +- vips_mask_gaussian_ring_get_type(); +- vips_mask_gaussian_band_get_type(); +- vips_mask_fractal_get_type(); +- vips_fractsurf_get_type(); +- vips_worley_get_type(); +- vips_perlin_get_type(); ++ vips_xyz_get_type(); ++ vips_eye_get_type(); ++ vips_grey_get_type(); ++ vips_zone_get_type(); ++ vips_sines_get_type(); ++ vips_buildlut_get_type(); ++ vips_invertlut_get_type(); ++ vips_tonelut_get_type(); ++ vips_identity_get_type(); ++ vips_mask_ideal_get_type(); ++ vips_mask_ideal_ring_get_type(); ++ vips_mask_ideal_band_get_type(); ++ vips_mask_butterworth_get_type(); ++ vips_mask_butterworth_ring_get_type(); ++ vips_mask_butterworth_band_get_type(); ++ vips_mask_gaussian_get_type(); ++ vips_mask_gaussian_ring_get_type(); ++ vips_mask_gaussian_band_get_type(); ++ vips_mask_fractal_get_type(); ++ vips_fractsurf_get_type(); ++ vips_worley_get_type(); ++ vips_perlin_get_type(); + } +- +diff --git a/libvips/create/eye.c b/libvips/create/eye.c +index eecfc20631..d748f7fb6c 100644 +--- a/libvips/create/eye.c ++++ b/libvips/create/eye.c +@@ -17,28 +17,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -70,55 +70,54 @@ typedef struct _VipsEye { + + typedef VipsPointClass VipsEyeClass; + +-G_DEFINE_TYPE( VipsEye, vips_eye, VIPS_TYPE_POINT ); ++G_DEFINE_TYPE(VipsEye, vips_eye, VIPS_TYPE_POINT); + + static float +-vips_eye_point( VipsPoint *point, int x, int y ) ++vips_eye_point(VipsPoint *point, int x, int y) + { + VipsEye *eye = (VipsEye *) point; + + /* VIPS_MAX to prevent /0. + */ +- int max_x = VIPS_MAX( point->width - 1, 1 ); +- int max_y = VIPS_MAX( point->height - 1, 1 ); ++ int max_x = VIPS_MAX(point->width - 1, 1); ++ int max_y = VIPS_MAX(point->height - 1, 1); + + double c = eye->factor * VIPS_PI / (2 * max_x); + double h = max_y * max_y; + +- return( y * y * cos( c * x * x ) / h ); ++ return (y * y * cos(c * x * x) / h); + } + + static void +-vips_eye_class_init( VipsEyeClass *class ) ++vips_eye_class_init(VipsEyeClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsPointClass *point_class = VIPS_POINT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsPointClass *point_class = VIPS_POINT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "eye"; +- vobject_class->description = +- _( "make an image showing the eye's spatial response" ); ++ vobject_class->description = ++ _("make an image showing the eye's spatial response"); + + point_class->point = vips_eye_point; + +- VIPS_ARG_DOUBLE( class, "factor", 6, +- _( "Factor" ), +- _( "Maximum spatial frequency" ), ++ VIPS_ARG_DOUBLE(class, "factor", 6, ++ _("Factor"), ++ _("Maximum spatial frequency"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsEye, factor ), +- 0.0, 1.0, 0.5 ); ++ G_STRUCT_OFFSET(VipsEye, factor), ++ 0.0, 1.0, 0.5); + } + + static void +-vips_eye_init( VipsEye *eye ) ++vips_eye_init(VipsEye *eye) + { + eye->factor = 0.5; + } + +- + /** + * vips_eye: + * @out: (out): output image +@@ -131,25 +130,25 @@ vips_eye_init( VipsEye *eye ) + * * @factor: maximum spatial frequency + * * @uchar: output a uchar image + * +- * Create a test pattern with increasing spatial frequence in X and +- * amplitude in Y. @factor should be between 0 and 1 and determines the ++ * Create a test pattern with increasing spatial frequence in X and ++ * amplitude in Y. @factor should be between 0 and 1 and determines the + * maximum spatial frequency. + * +- * Set @uchar to output a uchar image. ++ * Set @uchar to output a uchar image. + * + * See also: vips_zone(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_eye( VipsImage **out, int width, int height, ... ) ++vips_eye(VipsImage **out, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "eye", ap, out, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("eye", ap, out, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/fractsurf.c b/libvips/create/fractsurf.c +index f43285a6ea..417795a50d 100644 +--- a/libvips/create/fractsurf.c ++++ b/libvips/create/fractsurf.c +@@ -14,28 +14,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -62,72 +62,71 @@ typedef struct _VipsFractsurf { + + typedef VipsCreateClass VipsFractsurfClass; + +-G_DEFINE_TYPE( VipsFractsurf, vips_fractsurf, VIPS_TYPE_CREATE ); ++G_DEFINE_TYPE(VipsFractsurf, vips_fractsurf, VIPS_TYPE_CREATE); + + static int +-vips_fractsurf_build( VipsObject *object ) ++vips_fractsurf_build(VipsObject *object) + { +- VipsCreate *create = VIPS_CREATE( object ); ++ VipsCreate *create = VIPS_CREATE(object); + VipsFractsurf *fractsurf = (VipsFractsurf *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 5 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 5); + +- if( VIPS_OBJECT_CLASS( vips_fractsurf_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_fractsurf_parent_class)->build(object)) ++ return (-1); + +- if( vips_gaussnoise( &t[0], fractsurf->width, fractsurf->height, ++ if (vips_gaussnoise(&t[0], fractsurf->width, fractsurf->height, + "mean", 0.0, + "sigma", 1.0, +- NULL ) || +- vips_mask_fractal( &t[1], fractsurf->width, fractsurf->height, +- fractsurf->fractal_dimension, NULL ) || +- vips_freqmult( t[0], t[1], &t[2], NULL ) || +- vips_image_write( t[2], create->out ) ) +- return( -1 ); +- +- return( 0 ); ++ NULL) || ++ vips_mask_fractal(&t[1], fractsurf->width, fractsurf->height, ++ fractsurf->fractal_dimension, NULL) || ++ vips_freqmult(t[0], t[1], &t[2], NULL) || ++ vips_image_write(t[2], create->out)) ++ return (-1); ++ ++ return (0); + } + + static void +-vips_fractsurf_class_init( VipsFractsurfClass *class ) ++vips_fractsurf_class_init(VipsFractsurfClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "fractsurf"; +- vobject_class->description = _( "make a fractal surface" ); ++ vobject_class->description = _("make a fractal surface"); + vobject_class->build = vips_fractsurf_build; + +- VIPS_ARG_INT( class, "width", 4, +- _( "Width" ), +- _( "Image width in pixels" ), ++ VIPS_ARG_INT(class, "width", 4, ++ _("Width"), ++ _("Image width in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsFractsurf, width ), +- 1, VIPS_MAX_COORD, 64 ); ++ G_STRUCT_OFFSET(VipsFractsurf, width), ++ 1, VIPS_MAX_COORD, 64); + +- VIPS_ARG_INT( class, "height", 5, +- _( "Height" ), +- _( "Image height in pixels" ), ++ VIPS_ARG_INT(class, "height", 5, ++ _("Height"), ++ _("Image height in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsFractsurf, height ), +- 1, VIPS_MAX_COORD, 64 ); ++ G_STRUCT_OFFSET(VipsFractsurf, height), ++ 1, VIPS_MAX_COORD, 64); + +- VIPS_ARG_DOUBLE( class, "fractal_dimension", 8, +- _( "Fractal dimension" ), +- _( "Fractal dimension" ), ++ VIPS_ARG_DOUBLE(class, "fractal_dimension", 8, ++ _("Fractal dimension"), ++ _("Fractal dimension"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsFractsurf, fractal_dimension ), +- 2.0, 3.0, 2.5 ); +- ++ G_STRUCT_OFFSET(VipsFractsurf, fractal_dimension), ++ 2.0, 3.0, 2.5); + } + + static void +-vips_fractsurf_init( VipsFractsurf *fractsurf ) ++vips_fractsurf_init(VipsFractsurf *fractsurf) + { +- fractsurf->width = 64; +- fractsurf->height = 64; ++ fractsurf->width = 64; ++ fractsurf->height = 64; + fractsurf->fractal_dimension = 2.5; + } + +@@ -139,7 +138,7 @@ vips_fractsurf_init( VipsFractsurf *fractsurf ) + * @fractal_dimension: fractal dimension + * @...: %NULL-terminated list of optional named arguments + * +- * Generate an image of size @width by @height and fractal dimension ++ * Generate an image of size @width by @height and fractal dimension + * @fractal_dimension. The dimension should be between 2 and 3. + * + * See also: vips_gaussnoise(), vips_mask_fractal(). +@@ -147,16 +146,16 @@ vips_fractsurf_init( VipsFractsurf *fractsurf ) + * Returns: 0 on success, -1 on error + */ + int +-vips_fractsurf( VipsImage **out, +- int width, int height, double fractal_dimension, ... ) ++vips_fractsurf(VipsImage **out, ++ int width, int height, double fractal_dimension, ...) + { + va_list ap; + int result; + +- va_start( ap, fractal_dimension ); +- result = vips_call_split( "fractsurf", ap, +- out, width, height, fractal_dimension ); +- va_end( ap ); ++ va_start(ap, fractal_dimension); ++ result = vips_call_split("fractsurf", ap, ++ out, width, height, fractal_dimension); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/gaussmat.c b/libvips/create/gaussmat.c +index c53ef57535..316545e072 100644 +--- a/libvips/create/gaussmat.c ++++ b/libvips/create/gaussmat.c +@@ -14,7 +14,7 @@ + * 21/10/10 + * - gtkdoc + * 20/10/13 +- * - redone as a class ++ * - redone as a class + * 16/12/14 + * - default to int output to match vips_conv() + * - use @precision, not @integer +@@ -25,28 +25,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -75,8 +75,8 @@ typedef struct _VipsGaussmat { + double min_ampl; + + gboolean separable; +- gboolean integer; /* Deprecated */ +- VipsPrecision precision; ++ gboolean integer; /* Deprecated */ ++ VipsPrecision precision; + + } VipsGaussmat; + +@@ -85,141 +85,140 @@ typedef struct _VipsGaussmatClass { + + } VipsGaussmatClass; + +-G_DEFINE_TYPE( VipsGaussmat, vips_gaussmat, VIPS_TYPE_CREATE ); ++G_DEFINE_TYPE(VipsGaussmat, vips_gaussmat, VIPS_TYPE_CREATE); + + /* Don't allow mask radius to go over this. + */ + #define MASK_SANITY (5000) + + static int +-vips_gaussmat_build( VipsObject *object ) ++vips_gaussmat_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsCreate *create = VIPS_CREATE( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsCreate *create = VIPS_CREATE(object); + VipsGaussmat *gaussmat = (VipsGaussmat *) object; +- double sig2 = 2. * gaussmat->sigma * gaussmat->sigma; +- int max_x = VIPS_CLIP( 0, 8 * gaussmat->sigma, MASK_SANITY ); ++ double sig2 = 2. * gaussmat->sigma * gaussmat->sigma; ++ int max_x = VIPS_CLIP(0, 8 * gaussmat->sigma, MASK_SANITY); + + int x, y; +- int width, height; +- double sum; ++ int width, height; ++ double sum; + +- if( VIPS_OBJECT_CLASS( vips_gaussmat_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_gaussmat_parent_class)->build(object)) ++ return (-1); + + /* The old, deprecated @integer property has been deliberately set to + * FALSE and they've not used the new @precision property ... switch + * to float to help them out. + */ +- if( vips_object_argument_isset( object, "integer" ) && +- !vips_object_argument_isset( object, "precision" ) && +- !gaussmat->integer ) ++ if (vips_object_argument_isset(object, "integer") && ++ !vips_object_argument_isset(object, "precision") && ++ !gaussmat->integer) + gaussmat->precision = VIPS_PRECISION_FLOAT; + +- /* Find the size of the mask. Limit the mask size to 10k x 10k for ++ /* Find the size of the mask. Limit the mask size to 10k x 10k for + * sanity. We allow x == 0, meaning a 1x1 mask. + */ +- for( x = 0; x < max_x; x++ ) { +- double v = exp( - ((double)(x * x)) / sig2 ); ++ for (x = 0; x < max_x; x++) { ++ double v = exp(-((double) (x * x)) / sig2); + +- if( v < gaussmat->min_ampl ) ++ if (v < gaussmat->min_ampl) + break; + } +- if( x >= MASK_SANITY ) { +- vips_error( class->nickname, "%s", _( "mask too large" ) ); +- return( -1 ); ++ if (x >= MASK_SANITY) { ++ vips_error(class->nickname, "%s", _("mask too large")); ++ return (-1); + } +- width = 2 * VIPS_MAX( x - 1, 0 ) + 1; +- height = gaussmat->separable ? 1 : width; ++ width = 2 * VIPS_MAX(x - 1, 0) + 1; ++ height = gaussmat->separable ? 1 : width; + +- vips_image_init_fields( create->out, +- width, height, 1, +- VIPS_FORMAT_DOUBLE, VIPS_CODING_NONE, ++ vips_image_init_fields(create->out, ++ width, height, 1, ++ VIPS_FORMAT_DOUBLE, VIPS_CODING_NONE, + VIPS_INTERPRETATION_MULTIBAND, +- 1.0, 1.0 ); +- if( vips_image_pipelinev( create->out, VIPS_DEMAND_STYLE_ANY, NULL ) || +- vips_image_write_prepare( create->out ) ) +- return( -1 ); ++ 1.0, 1.0); ++ if (vips_image_pipelinev(create->out, VIPS_DEMAND_STYLE_ANY, NULL) || ++ vips_image_write_prepare(create->out)) ++ return (-1); + + sum = 0.0; +- for( y = 0; y < height; y++ ) { +- for( x = 0; x < width; x++ ) { ++ for (y = 0; y < height; y++) { ++ for (x = 0; x < width; x++) { + int xo = x - width / 2; + int yo = y - height / 2; + double distance = xo * xo + yo * yo; +- double v = exp( -distance / sig2 ); ++ double v = exp(-distance / sig2); + +- if( gaussmat->precision != VIPS_PRECISION_FLOAT ) +- v = VIPS_RINT( 20 * v ); ++ if (gaussmat->precision != VIPS_PRECISION_FLOAT) ++ v = VIPS_RINT(20 * v); + +- *VIPS_MATRIX( create->out, x, y ) = v; +- sum += v; ++ *VIPS_MATRIX(create->out, x, y) = v; ++ sum += v; + } + } + +- /* Make sure we can't make sum == 0: it'd certainly cause /0 later. ++ /* Make sure we can't make sum == 0: it'd certainly cause /0 later. + */ +- if( sum == 0 ) ++ if (sum == 0) + sum = 1; + +- vips_image_set_double( create->out, "scale", sum ); +- vips_image_set_double( create->out, "offset", 0.0 ); ++ vips_image_set_double(create->out, "scale", sum); ++ vips_image_set_double(create->out, "offset", 0.0); + +- return( 0 ); ++ return (0); + } + + static void +-vips_gaussmat_class_init( VipsGaussmatClass *class ) ++vips_gaussmat_class_init(VipsGaussmatClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "gaussmat"; +- vobject_class->description = _( "make a gaussian image" ); ++ vobject_class->description = _("make a gaussian image"); + vobject_class->build = vips_gaussmat_build; + +- VIPS_ARG_DOUBLE( class, "sigma", 2, +- _( "Sigma" ), +- _( "Sigma of Gaussian" ), ++ VIPS_ARG_DOUBLE(class, "sigma", 2, ++ _("Sigma"), ++ _("Sigma of Gaussian"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGaussmat, sigma ), +- 0.000001, 10000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsGaussmat, sigma), ++ 0.000001, 10000.0, 1.0); + +- VIPS_ARG_DOUBLE( class, "min_ampl", 3, +- _( "Minimum amplitude" ), +- _( "Minimum amplitude of Gaussian" ), ++ VIPS_ARG_DOUBLE(class, "min_ampl", 3, ++ _("Minimum amplitude"), ++ _("Minimum amplitude of Gaussian"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGaussmat, min_ampl ), +- 0.000001, 10000.0, 0.1 ); ++ G_STRUCT_OFFSET(VipsGaussmat, min_ampl), ++ 0.000001, 10000.0, 0.1); + +- VIPS_ARG_BOOL( class, "separable", 4, +- _( "Separable" ), +- _( "Generate separable Gaussian" ), ++ VIPS_ARG_BOOL(class, "separable", 4, ++ _("Separable"), ++ _("Generate separable Gaussian"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsGaussmat, separable ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsGaussmat, separable), ++ FALSE); + +- VIPS_ARG_BOOL( class, "integer", 5, +- _( "Integer" ), +- _( "Generate integer Gaussian" ), ++ VIPS_ARG_BOOL(class, "integer", 5, ++ _("Integer"), ++ _("Generate integer Gaussian"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsGaussmat, integer ), +- FALSE ); +- +- VIPS_ARG_ENUM( class, "precision", 6, +- _( "Precision" ), +- _( "Generate with this precision" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsGaussmat, precision ), +- VIPS_TYPE_PRECISION, VIPS_PRECISION_INTEGER ); ++ G_STRUCT_OFFSET(VipsGaussmat, integer), ++ FALSE); + ++ VIPS_ARG_ENUM(class, "precision", 6, ++ _("Precision"), ++ _("Generate with this precision"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsGaussmat, precision), ++ VIPS_TYPE_PRECISION, VIPS_PRECISION_INTEGER); + } + + static void +-vips_gaussmat_init( VipsGaussmat *gaussmat ) ++vips_gaussmat_init(VipsGaussmat *gaussmat) + { + gaussmat->sigma = 1; + gaussmat->min_ampl = 0.1; +@@ -238,9 +237,9 @@ vips_gaussmat_init( VipsGaussmat *gaussmat ) + * * @separable: generate a separable gaussian + * * @precision: #VipsPrecision for @out + * +- * Creates a circularly symmetric Gaussian image of radius +- * @sigma. The size of the mask is determined by the variable @min_ampl; +- * if for instance the value .1 is entered this means that the produced mask ++ * Creates a circularly symmetric Gaussian image of radius ++ * @sigma. The size of the mask is determined by the variable @min_ampl; ++ * if for instance the value .1 is entered this means that the produced mask + * is clipped at values less than 10 percent of the maximum amplitude. + * + * The program uses the following equation: +@@ -251,10 +250,10 @@ vips_gaussmat_init( VipsGaussmat *gaussmat ) + * 1.0, unless @precision is #VIPS_PRECISION_INTEGER. + * + * If @separable is set, only the centre horizontal is generated. This is +- * useful for separable convolutions. ++ * useful for separable convolutions. + * +- * If @precision is #VIPS_PRECISION_INTEGER, an integer gaussian is generated. +- * This is useful for integer convolutions. ++ * If @precision is #VIPS_PRECISION_INTEGER, an integer gaussian is generated. ++ * This is useful for integer convolutions. + * + * "scale" is set to the sum of all the mask elements. + * +@@ -263,14 +262,14 @@ vips_gaussmat_init( VipsGaussmat *gaussmat ) + * Returns: 0 on success, -1 on error + */ + int +-vips_gaussmat( VipsImage **out, double sigma, double min_ampl, ... ) ++vips_gaussmat(VipsImage **out, double sigma, double min_ampl, ...) + { + va_list ap; + int result; + +- va_start( ap, min_ampl ); +- result = vips_call_split( "gaussmat", ap, out, sigma, min_ampl ); +- va_end( ap ); ++ va_start(ap, min_ampl); ++ result = vips_call_split("gaussmat", ap, out, sigma, min_ampl); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/gaussnoise.c b/libvips/create/gaussnoise.c +index 8f17565cca..026109ce64 100644 +--- a/libvips/create/gaussnoise.c ++++ b/libvips/create/gaussnoise.c +@@ -30,28 +30,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -83,129 +83,128 @@ typedef struct _VipsGaussnoise { + + typedef VipsCreateClass VipsGaussnoiseClass; + +-G_DEFINE_TYPE( VipsGaussnoise, vips_gaussnoise, VIPS_TYPE_CREATE ); ++G_DEFINE_TYPE(VipsGaussnoise, vips_gaussnoise, VIPS_TYPE_CREATE); + + static int +-vips_gaussnoise_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++vips_gaussnoise_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + VipsGaussnoise *gaussnoise = (VipsGaussnoise *) a; +- int sz = VIPS_REGION_N_ELEMENTS( or ); ++ int sz = VIPS_REGION_N_ELEMENTS(or); + + int y; + +- for( y = 0; y < or->valid.height; y++ ) { +- float *q = (float *) VIPS_REGION_ADDR( or, +- or->valid.left, y + or->valid.top ); ++ for (y = 0; y < or->valid.height; y++) { ++ float *q = (float *) VIPS_REGION_ADDR(or, ++ or->valid.left, y + or->valid.top); + + int x; + +- for( x = 0; x < sz; x++ ) { ++ for (x = 0; x < sz; x++) { + guint32 seed; + double sum; + int i; + + seed = gaussnoise->seed; +- seed = vips__random_add( seed, or->valid.left + x ); +- seed = vips__random_add( seed, or->valid.top + y ); ++ seed = vips__random_add(seed, or->valid.left + x); ++ seed = vips__random_add(seed, or->valid.top + y); + + sum = 0.0; +- for( i = 0; i < 12; i++ ) { +- seed = vips__random( seed ); ++ for (i = 0; i < 12; i++) { ++ seed = vips__random(seed); + sum += (double) seed / UINT_MAX; + } + +- q[x] = (sum - 6.0) * gaussnoise->sigma + ++ q[x] = (sum - 6.0) * gaussnoise->sigma + + gaussnoise->mean; + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_gaussnoise_build( VipsObject *object ) ++vips_gaussnoise_build(VipsObject *object) + { +- VipsCreate *create = VIPS_CREATE( object ); ++ VipsCreate *create = VIPS_CREATE(object); + VipsGaussnoise *gaussnoise = (VipsGaussnoise *) object; + +- if( VIPS_OBJECT_CLASS( vips_gaussnoise_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_gaussnoise_parent_class)->build(object)) ++ return (-1); + +- vips_image_init_fields( create->out, ++ vips_image_init_fields(create->out, + gaussnoise->width, gaussnoise->height, 1, + VIPS_FORMAT_FLOAT, VIPS_CODING_NONE, +- VIPS_INTERPRETATION_MULTIBAND, 1.0, 1.0 ); ++ VIPS_INTERPRETATION_MULTIBAND, 1.0, 1.0); + +- if( vips_image_pipelinev( create->out, VIPS_DEMAND_STYLE_ANY, NULL ) || +- vips_image_generate( create->out, +- NULL, vips_gaussnoise_gen, NULL, gaussnoise, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(create->out, VIPS_DEMAND_STYLE_ANY, NULL) || ++ vips_image_generate(create->out, ++ NULL, vips_gaussnoise_gen, NULL, gaussnoise, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_gaussnoise_class_init( VipsGaussnoiseClass *class ) ++vips_gaussnoise_class_init(VipsGaussnoiseClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + VipsOperationClass *operation_class = (VipsOperationClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "gaussnoise"; +- vobject_class->description = _( "make a gaussnoise image" ); ++ vobject_class->description = _("make a gaussnoise image"); + vobject_class->build = vips_gaussnoise_build; + + /* We want a new set of numbers each time. + */ + operation_class->flags |= VIPS_OPERATION_NOCACHE; + +- VIPS_ARG_INT( class, "width", 4, +- _( "Width" ), +- _( "Image width in pixels" ), ++ VIPS_ARG_INT(class, "width", 4, ++ _("Width"), ++ _("Image width in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGaussnoise, width ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsGaussnoise, width), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "height", 5, +- _( "Height" ), +- _( "Image height in pixels" ), ++ VIPS_ARG_INT(class, "height", 5, ++ _("Height"), ++ _("Image height in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGaussnoise, height ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsGaussnoise, height), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_DOUBLE( class, "mean", 6, +- _( "Mean" ), +- _( "Mean of pixels in generated image" ), ++ VIPS_ARG_DOUBLE(class, "mean", 6, ++ _("Mean"), ++ _("Mean of pixels in generated image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsGaussnoise, mean ), +- -10000000, 1000000, 128 ); ++ G_STRUCT_OFFSET(VipsGaussnoise, mean), ++ -10000000, 1000000, 128); + +- VIPS_ARG_DOUBLE( class, "sigma", 6, +- _( "Sigma" ), +- _( "Standard deviation of pixels in generated image" ), ++ VIPS_ARG_DOUBLE(class, "sigma", 6, ++ _("Sigma"), ++ _("Standard deviation of pixels in generated image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsGaussnoise, sigma ), +- 0, 100000, 30 ); ++ G_STRUCT_OFFSET(VipsGaussnoise, sigma), ++ 0, 100000, 30); + +- VIPS_ARG_INT( class, "seed", 7, +- _( "Seed" ), +- _( "Random number seed" ), ++ VIPS_ARG_INT(class, "seed", 7, ++ _("Seed"), ++ _("Random number seed"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsGaussnoise, seed ), +- INT_MIN, INT_MAX, 0 ); +- ++ G_STRUCT_OFFSET(VipsGaussnoise, seed), ++ INT_MIN, INT_MAX, 0); + } + + static void +-vips_gaussnoise_init( VipsGaussnoise *gaussnoise ) ++vips_gaussnoise_init(VipsGaussnoise *gaussnoise) + { + gaussnoise->mean = 128.0; + gaussnoise->sigma = 30.0; +- gaussnoise->seed = UINT_MAX * g_random_double(); ++ gaussnoise->seed = UINT_MAX * g_random_double(); + } + + /** +@@ -221,7 +220,7 @@ vips_gaussnoise_init( VipsGaussnoise *gaussnoise ) + * * @sigma: standard deviation of generated pixels + * + * Make a one band float image of gaussian noise with the specified +- * distribution. The noise distribution is created by averaging 12 random ++ * distribution. The noise distribution is created by averaging 12 random + * numbers with the appropriate weights. + * + * See also: vips_black(), vips_xyz(), vips_text(). +@@ -229,14 +228,14 @@ vips_gaussnoise_init( VipsGaussnoise *gaussnoise ) + * Returns: 0 on success, -1 on error + */ + int +-vips_gaussnoise( VipsImage **out, int width, int height, ... ) ++vips_gaussnoise(VipsImage **out, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "gaussnoise", ap, out, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("gaussnoise", ap, out, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/grey.c b/libvips/create/grey.c +index a8b055aaaf..ac7e0482ff 100644 +--- a/libvips/create/grey.c ++++ b/libvips/create/grey.c +@@ -24,28 +24,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -71,30 +71,30 @@ + typedef VipsPoint VipsGrey; + typedef VipsPointClass VipsGreyClass; + +-G_DEFINE_TYPE( VipsGrey, vips_grey, VIPS_TYPE_POINT ); ++G_DEFINE_TYPE(VipsGrey, vips_grey, VIPS_TYPE_POINT); + + static float +-vips_grey_point( VipsPoint *point, int x, int y ) ++vips_grey_point(VipsPoint *point, int x, int y) + { +- return( (double) x / (point->width - 1) ); ++ return ((double) x / (point->width - 1)); + } + + static void +-vips_grey_class_init( VipsGreyClass *class ) ++vips_grey_class_init(VipsGreyClass *class) + { +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsPointClass *point_class = VIPS_POINT_CLASS( class ); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsPointClass *point_class = VIPS_POINT_CLASS(class); + + vobject_class->nickname = "grey"; +- vobject_class->description = _( "make a grey ramp image" ); ++ vobject_class->description = _("make a grey ramp image"); + + point_class->point = vips_grey_point; +- point_class->min = 0.0; +- point_class->max = 1.0; ++ point_class->min = 0.0; ++ point_class->max = 1.0; + } + + static void +-vips_grey_init( VipsGrey *grey ) ++vips_grey_init(VipsGrey *grey) + { + } + +@@ -113,21 +113,21 @@ vips_grey_init( VipsGrey *grey ) + * right-most 1. Intermediate pixels are a linear ramp. + * + * Set @uchar to output a uchar image with the leftmost pixel 0 and the +- * rightmost 255. ++ * rightmost 255. + * + * See also: vips_xyz(), vips_identity(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_grey( VipsImage **out, int width, int height, ... ) ++vips_grey(VipsImage **out, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "grey", ap, out, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("grey", ap, out, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/identity.c b/libvips/create/identity.c +index 9d0b887f49..f6aa9af06c 100644 +--- a/libvips/create/identity.c ++++ b/libvips/create/identity.c +@@ -4,7 +4,7 @@ + * + * Author N. Dessipris + * Written on 11/03/1991 +- * Updated on: ++ * Updated on: + * 18/6/93 JC + * - im_outcheck() call added + * - ANSIfied +@@ -18,28 +18,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -67,102 +67,102 @@ typedef struct _VipsIdentity { + + typedef VipsCreateClass VipsIdentityClass; + +-G_DEFINE_TYPE( VipsIdentity, vips_identity, VIPS_TYPE_CREATE ); +- +-#define IDENTITY( TYPE ) { \ +- TYPE *q = (TYPE *) VIPS_REGION_ADDR( or, le, 0 ); \ +- \ +- for( x = le; x < ri; x++ ) { \ +- for( i = 0; i < identity->bands; i++ ) \ +- q[i] = x; \ +- \ +- q += identity->bands; \ +- } \ +-} ++G_DEFINE_TYPE(VipsIdentity, vips_identity, VIPS_TYPE_CREATE); ++ ++#define IDENTITY(TYPE) \ ++ { \ ++ TYPE *q = (TYPE *) VIPS_REGION_ADDR(or, le, 0); \ ++\ ++ for (x = le; x < ri; x++) { \ ++ for (i = 0; i < identity->bands; i++) \ ++ q[i] = x; \ ++\ ++ q += identity->bands; \ ++ } \ ++ } + + static int +-vips_identity_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++vips_identity_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + VipsIdentity *identity = (VipsIdentity *) a; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; +- int ri = VIPS_RECT_RIGHT( r ); ++ int ri = VIPS_RECT_RIGHT(r); + + int x, i; + +- if( identity->ushort ) { +- IDENTITY( unsigned short ); ++ if (identity->ushort) { ++ IDENTITY(unsigned short); + } + else { +- IDENTITY( unsigned char ); ++ IDENTITY(unsigned char); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_identity_build( VipsObject *object ) ++vips_identity_build(VipsObject *object) + { +- VipsCreate *create = VIPS_CREATE( object ); ++ VipsCreate *create = VIPS_CREATE(object); + VipsIdentity *identity = (VipsIdentity *) object; + +- if( VIPS_OBJECT_CLASS( vips_identity_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_identity_parent_class)->build(object)) ++ return (-1); + +- vips_image_init_fields( create->out, +- identity->ushort ? identity->size : 256, 1, identity->bands, +- identity->ushort ? VIPS_FORMAT_USHORT : VIPS_FORMAT_UCHAR, ++ vips_image_init_fields(create->out, ++ identity->ushort ? identity->size : 256, 1, identity->bands, ++ identity->ushort ? VIPS_FORMAT_USHORT : VIPS_FORMAT_UCHAR, + VIPS_CODING_NONE, VIPS_INTERPRETATION_HISTOGRAM, +- 1.0, 1.0 ); ++ 1.0, 1.0); + +- if( vips_image_pipelinev( create->out, VIPS_DEMAND_STYLE_ANY, NULL ) || +- vips_image_generate( create->out, +- NULL, vips_identity_gen, NULL, identity, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(create->out, VIPS_DEMAND_STYLE_ANY, NULL) || ++ vips_image_generate(create->out, ++ NULL, vips_identity_gen, NULL, identity, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_identity_class_init( VipsIdentityClass *class ) ++vips_identity_class_init(VipsIdentityClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "identity"; +- vobject_class->description = +- _( "make a 1D image where pixel values are indexes" ); ++ vobject_class->description = ++ _("make a 1D image where pixel values are indexes"); + vobject_class->build = vips_identity_build; + +- VIPS_ARG_INT( class, "bands", 3, +- _( "Bands" ), +- _( "Number of bands in LUT" ), ++ VIPS_ARG_INT(class, "bands", 3, ++ _("Bands"), ++ _("Number of bands in LUT"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsIdentity, bands ), +- 1, 100000, 1 ); ++ G_STRUCT_OFFSET(VipsIdentity, bands), ++ 1, 100000, 1); + +- VIPS_ARG_BOOL( class, "ushort", 4, +- _( "Ushort" ), +- _( "Create a 16-bit LUT" ), ++ VIPS_ARG_BOOL(class, "ushort", 4, ++ _("Ushort"), ++ _("Create a 16-bit LUT"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsIdentity, ushort ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsIdentity, ushort), ++ FALSE); + +- VIPS_ARG_INT( class, "size", 5, +- _( "Size" ), +- _( "Size of 16-bit LUT" ), ++ VIPS_ARG_INT(class, "size", 5, ++ _("Size"), ++ _("Size of 16-bit LUT"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsIdentity, size ), +- 1, 65536, 65536 ); +- ++ G_STRUCT_OFFSET(VipsIdentity, size), ++ 1, 65536, 65536); + } + + static void +-vips_identity_init( VipsIdentity *identity ) ++vips_identity_init(VipsIdentity *identity) + { + identity->bands = 1; + identity->ushort = FALSE; +@@ -182,29 +182,29 @@ vips_identity_init( VipsIdentity *identity ) + * + * Creates an identity lookup table, ie. one which will leave an image + * unchanged when applied with vips_maplut(). Each entry in the table has a +- * value equal to its position. ++ * value equal to its position. + * + * Use the arithmetic operations on these tables to make LUTs representing +- * arbitrary functions. ++ * arbitrary functions. + * +- * Normally LUTs are 8-bit. Set @ushort to create a 16-bit table. ++ * Normally LUTs are 8-bit. Set @ushort to create a 16-bit table. + * + * Normally 16-bit tables have 65536 entries. You can set this smaller with +- * @size. ++ * @size. + * + * See also: vips_xyz(), vips_maplut(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_identity( VipsImage **out, ... ) ++vips_identity(VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "identity", ap, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("identity", ap, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/invertlut.c b/libvips/create/invertlut.c +index ff5761f3b0..8df5c8fb36 100644 +--- a/libvips/create/invertlut.c ++++ b/libvips/create/invertlut.c +@@ -16,28 +16,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -71,108 +71,108 @@ typedef struct _VipsInvertlut { + */ + VipsImage *mat; + +- int size; /* Number of output elements to generate */ ++ int size; /* Number of output elements to generate */ + +- double **data; /* Rows of unpacked matrix */ +- double *buf; /* Output buffer */ ++ double **data; /* Rows of unpacked matrix */ ++ double *buf; /* Output buffer */ + } VipsInvertlut; + + typedef VipsCreateClass VipsInvertlutClass; + +-G_DEFINE_TYPE( VipsInvertlut, vips_invertlut, VIPS_TYPE_CREATE ); ++G_DEFINE_TYPE(VipsInvertlut, vips_invertlut, VIPS_TYPE_CREATE); + + static void +-vips_invertlut_dispose( GObject *gobject ) ++vips_invertlut_dispose(GObject *gobject) + { + VipsInvertlut *lut = (VipsInvertlut *) gobject; + +- VIPS_FREE( lut->data ); +- VIPS_FREE( lut->buf ); +- VIPS_UNREF( lut->mat ); ++ VIPS_FREE(lut->data); ++ VIPS_FREE(lut->buf); ++ VIPS_UNREF(lut->mat); + +- G_OBJECT_CLASS( vips_invertlut_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_invertlut_parent_class)->dispose(gobject); + } + + /* Use this to sort our input rows by the first column. + */ + static int +-compare( const void *a, const void *b ) ++compare(const void *a, const void *b) + { + double **r1 = (double **) a; + double **r2 = (double **) b; + + double diff = r1[0][0] - r2[0][0]; + +- if( diff > 0 ) +- return( 1 ); +- else if( diff == 0 ) +- return( 0 ); +- else +- return( -1 ); ++ if (diff > 0) ++ return (1); ++ else if (diff == 0) ++ return (0); ++ else ++ return (-1); + } + + static int +-vips_invertlut_build_init( VipsInvertlut *lut ) ++vips_invertlut_build_init(VipsInvertlut *lut) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( lut ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(lut); + + int x, y; + +- if( !lut->mat || ++ if (!lut->mat || + lut->mat->Xsize < 2 || +- lut->mat->Ysize < 1 ) { +- vips_error( class->nickname, "%s", _( "bad input matrix" ) ); +- return( -1 ); ++ lut->mat->Ysize < 1) { ++ vips_error(class->nickname, "%s", _("bad input matrix")); ++ return (-1); + } +- if( lut->size < 1 || +- lut->size > 65536 ) { +- vips_error( class->nickname, "%s", _( "bad size" ) ); +- return( -1 ); ++ if (lut->size < 1 || ++ lut->size > 65536) { ++ vips_error(class->nickname, "%s", _("bad size")); ++ return (-1); + } + +- if( !(lut->buf = +- VIPS_ARRAY( NULL, lut->size * (lut->mat->Xsize - 1), double )) ) +- return( -1 ); ++ if (!(lut->buf = ++ VIPS_ARRAY(NULL, lut->size * (lut->mat->Xsize - 1), double))) ++ return (-1); + +- if( !(lut->data = VIPS_ARRAY( NULL, lut->mat->Ysize, double * )) ) +- return( -1 ); +- for( y = 0; y < lut->mat->Ysize; y++ ) +- lut->data[y] = VIPS_MATRIX( lut->mat, 0, y ); ++ if (!(lut->data = VIPS_ARRAY(NULL, lut->mat->Ysize, double *))) ++ return (-1); ++ for (y = 0; y < lut->mat->Ysize; y++) ++ lut->data[y] = VIPS_MATRIX(lut->mat, 0, y); + + /* Sanity check for data range. + */ +- for( y = 0; y < lut->mat->Ysize; y++ ) +- for( x = 0; x < lut->mat->Xsize; x++ ) +- if( lut->data[y][x] > 1.0 || +- lut->data[y][x] < 0.0 ) { +- vips_error( class->nickname, +- _( "element (%d, %d) is %g, " +- "outside range [0,1]" ), +- x, y, lut->data[y][x] ); +- return( -1 ); ++ for (y = 0; y < lut->mat->Ysize; y++) ++ for (x = 0; x < lut->mat->Xsize; x++) ++ if (lut->data[y][x] > 1.0 || ++ lut->data[y][x] < 0.0) { ++ vips_error(class->nickname, ++ _("element (%d, %d) is %g, " ++ "outside range [0,1]"), ++ x, y, lut->data[y][x]); ++ return (-1); + } + + /* Sort by 1st column in input. + */ +- qsort( lut->data, lut->mat->Ysize, sizeof( double * ), compare ); ++ qsort(lut->data, lut->mat->Ysize, sizeof(double *), compare); + + #ifdef DEBUG +- printf( "Input table, sorted by 1st column\n" ); +- for( y = 0; y < lut->mat->Ysize; y++ ) { +- printf( "%.4d ", y ); ++ printf("Input table, sorted by 1st column\n"); ++ for (y = 0; y < lut->mat->Ysize; y++) { ++ printf("%.4d ", y); + +- for( x = 0; x < lut->mat->Xsize; x++ ) +- printf( "%.9f ", lut->data[y][x] ); ++ for (x = 0; x < lut->mat->Xsize; x++) ++ printf("%.9f ", lut->data[y][x]); + +- printf( "\n" ); ++ printf("\n"); + } + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + static int +-vips_invertlut_build_create( VipsInvertlut *lut ) ++vips_invertlut_build_create(VipsInvertlut *lut) + { + int bands = lut->mat->Xsize - 1; + int height = lut->mat->Ysize; +@@ -181,7 +181,7 @@ vips_invertlut_build_create( VipsInvertlut *lut ) + + /* Do each output channel separately. + */ +- for( b = 0; b < bands; b++ ) { ++ for (b = 0; b < bands; b++) { + /* The first and last lut positions we know real values for. + */ + int first = lut->data[0][b + 1] * (lut->size - 1); +@@ -191,7 +191,7 @@ vips_invertlut_build_create( VipsInvertlut *lut ) + + /* Extrapolate bottom and top segments to (0,0) and (1,1). + */ +- for( k = 0; k < first; k++ ) { ++ for (k = 0; k < first; k++) { + /* Have this inside the loop to avoid /0 errors if + * first == 0. + */ +@@ -200,7 +200,7 @@ vips_invertlut_build_create( VipsInvertlut *lut ) + lut->buf[b + k * bands] = k * fac; + } + +- for( k = last; k < lut->size; k++ ) { ++ for (k = last; k < lut->size; k++) { + /* Inside the loop to avoid /0 errors for last == + * (size - 1). + */ +@@ -213,7 +213,7 @@ vips_invertlut_build_create( VipsInvertlut *lut ) + + /* Interpolate the data sections. + */ +- for( k = first; k < last; k++ ) { ++ for (k = first; k < last; k++) { + /* Where we're at in the [0,1] range. + */ + double ki = (double) k / (lut->size - 1); +@@ -224,10 +224,10 @@ vips_invertlut_build_create( VipsInvertlut *lut ) + /* Search for the lowest real value < ki. There may + * not be one: if not, just use 0. Tiny error. + */ +- for( j = height - 1; j >= 0; j-- ) +- if( lut->data[j][b + 1] < ki ) ++ for (j = height - 1; j >= 0; j--) ++ if (lut->data[j][b + 1] < ki) + break; +- if( j == -1 ) ++ if (j == -1) + j = 0; + + /* Interpolate k as being between row data[j] and row +@@ -241,67 +241,66 @@ vips_invertlut_build_create( VipsInvertlut *lut ) + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_invertlut_build( VipsObject *object ) ++vips_invertlut_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsCreate *create = VIPS_CREATE( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsCreate *create = VIPS_CREATE(object); + VipsInvertlut *lut = (VipsInvertlut *) object; + +- if( VIPS_OBJECT_CLASS( vips_invertlut_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_invertlut_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_matrix( class->nickname, lut->in, &lut->mat ) ) +- return( -1 ); ++ if (vips_check_matrix(class->nickname, lut->in, &lut->mat)) ++ return (-1); + +- if( vips_invertlut_build_init( lut ) || +- vips_invertlut_build_create( lut ) ) +- return( -1 ); ++ if (vips_invertlut_build_init(lut) || ++ vips_invertlut_build_create(lut)) ++ return (-1); + +- vips_image_init_fields( create->out, +- lut->size, 1, lut->mat->Xsize - 1, ++ vips_image_init_fields(create->out, ++ lut->size, 1, lut->mat->Xsize - 1, + VIPS_FORMAT_DOUBLE, VIPS_CODING_NONE, +- VIPS_INTERPRETATION_HISTOGRAM, 1.0, 1.0 ); +- if( vips_image_write_line( create->out, 0, (VipsPel *) lut->buf ) ) +- return( -1 ); ++ VIPS_INTERPRETATION_HISTOGRAM, 1.0, 1.0); ++ if (vips_image_write_line(create->out, 0, (VipsPel *) lut->buf)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_invertlut_class_init( VipsInvertlutClass *class ) ++vips_invertlut_class_init(VipsInvertlutClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->dispose = vips_invertlut_dispose; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "invertlut"; +- vobject_class->description = _( "build an inverted look-up table" ); ++ vobject_class->description = _("build an inverted look-up table"); + vobject_class->build = vips_invertlut_build; + +- VIPS_ARG_IMAGE( class, "in", 0, +- _( "Input" ), +- _( "Matrix of XY coordinates" ), ++ VIPS_ARG_IMAGE(class, "in", 0, ++ _("Input"), ++ _("Matrix of XY coordinates"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsInvertlut, in ) ); ++ G_STRUCT_OFFSET(VipsInvertlut, in)); + +- VIPS_ARG_INT( class, "size", 5, +- _( "Size" ), +- _( "LUT size to generate" ), ++ VIPS_ARG_INT(class, "size", 5, ++ _("Size"), ++ _("LUT size to generate"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsInvertlut, size ), +- 1, 1000000, 256 ); +- ++ G_STRUCT_OFFSET(VipsInvertlut, size), ++ 1, 1000000, 256); + } + + static void +-vips_invertlut_init( VipsInvertlut *lut ) ++vips_invertlut_init(VipsInvertlut *lut) + { + lut->size = 256; + } +@@ -365,14 +364,14 @@ vips_invertlut_init( VipsInvertlut *lut ) + * Returns: 0 on success, -1 on error + */ + int +-vips_invertlut( VipsImage *in, VipsImage **out, ... ) ++vips_invertlut(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "invertlut", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("invertlut", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/logmat.c b/libvips/create/logmat.c +index 3039d89425..714f14298e 100644 +--- a/libvips/create/logmat.c ++++ b/libvips/create/logmat.c +@@ -21,28 +21,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -71,8 +71,8 @@ typedef struct _VipsLogmat { + double min_ampl; + + gboolean separable; +- gboolean integer; /* Deprecated */ +- VipsPrecision precision; ++ gboolean integer; /* Deprecated */ ++ VipsPrecision precision; + + } VipsLogmat; + +@@ -81,161 +81,160 @@ typedef struct _VipsLogmatClass { + + } VipsLogmatClass; + +-G_DEFINE_TYPE( VipsLogmat, vips_logmat, VIPS_TYPE_CREATE ); ++G_DEFINE_TYPE(VipsLogmat, vips_logmat, VIPS_TYPE_CREATE); + + static int +-vips_logmat_build( VipsObject *object ) ++vips_logmat_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsCreate *create = VIPS_CREATE( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsCreate *create = VIPS_CREATE(object); + VipsLogmat *logmat = (VipsLogmat *) object; +- double sig2 = logmat->sigma * logmat->sigma; ++ double sig2 = logmat->sigma * logmat->sigma; + +- double last; ++ double last; + int x, y; +- int width, height; +- double sum; ++ int width, height; ++ double sum; + +- if( VIPS_OBJECT_CLASS( vips_logmat_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_logmat_parent_class)->build(object)) ++ return (-1); + + /* The old, deprecated @integer property has been deliberately set to + * FALSE and they've not used the new @precision property ... switch + * to float to help them out. + */ +- if( vips_object_argument_isset( object, "integer" ) && +- !vips_object_argument_isset( object, "precision" ) && +- !logmat->integer ) ++ if (vips_object_argument_isset(object, "integer") && ++ !vips_object_argument_isset(object, "precision") && ++ !logmat->integer) + logmat->precision = VIPS_PRECISION_FLOAT; + +- if( vips_check_precision_intfloat( class->nickname, +- logmat->precision ) ) +- return( -1 ); ++ if (vips_check_precision_intfloat(class->nickname, ++ logmat->precision)) ++ return (-1); + +- /* Find the size of the mask. We want to eval the mask out to the +- * flat zero part, ie. beyond the minimum and to the point where it ++ /* Find the size of the mask. We want to eval the mask out to the ++ * flat zero part, ie. beyond the minimum and to the point where it + * comes back up towards zero. + */ + last = 0.0; +- for( x = 0; x < 5000; x++ ) { ++ for (x = 0; x < 5000; x++) { + const double distance = x * x; + double val; + + /* Handbook of Pattern Recognition and image processing + * by Young and Fu AP 1986 pp 220-221 + * temp = (1.0 / (2.0 * IM_PI * sig4)) * +- (2.0 - (distance / sig2)) * ++ (2.0 - (distance / sig2)) * + exp( (-1.0) * distance / (2.0 * sig2) ) + + .. use 0.5 to normalise + */ +- val = 0.5 * +- (2.0 - (distance / sig2)) * +- exp( -distance / (2.0 * sig2) ); ++ val = 0.5 * ++ (2.0 - (distance / sig2)) * ++ exp(-distance / (2.0 * sig2)); + + /* Stop when change in value (ie. difference from the last +- * point) is positive (ie. we are going up) and absolute value ++ * point) is positive (ie. we are going up) and absolute value + * is less than the min. + */ +- if( val - last >= 0 && +- VIPS_FABS( val ) < logmat->min_ampl ) ++ if (val - last >= 0 && ++ VIPS_FABS(val) < logmat->min_ampl) + break; + + last = val; + } +- if( x == 5000 ) { +- vips_error( class->nickname, "%s", _( "mask too large" ) ); +- return( -1 ); ++ if (x == 5000) { ++ vips_error(class->nickname, "%s", _("mask too large")); ++ return (-1); + } + + width = x * 2 + 1; +- height = logmat->separable ? 1 : width; ++ height = logmat->separable ? 1 : width; + +- vips_image_init_fields( create->out, +- width, height, 1, +- VIPS_FORMAT_DOUBLE, VIPS_CODING_NONE, ++ vips_image_init_fields(create->out, ++ width, height, 1, ++ VIPS_FORMAT_DOUBLE, VIPS_CODING_NONE, + VIPS_INTERPRETATION_MULTIBAND, +- 1.0, 1.0 ); +- if( vips_image_pipelinev( create->out, VIPS_DEMAND_STYLE_ANY, NULL ) || +- vips_image_write_prepare( create->out ) ) +- return( -1 ); ++ 1.0, 1.0); ++ if (vips_image_pipelinev(create->out, VIPS_DEMAND_STYLE_ANY, NULL) || ++ vips_image_write_prepare(create->out)) ++ return (-1); + + sum = 0.0; +- for( y = 0; y < height; y++ ) { +- for( x = 0; x < width; x++ ) { ++ for (y = 0; y < height; y++) { ++ for (x = 0; x < width; x++) { + int xo = x - width / 2; + int yo = y - height / 2; + double distance = xo * xo + yo * yo; + double v = 0.5 * + (2.0 - (distance / sig2)) * +- exp( -distance / (2.0 * sig2) ); ++ exp(-distance / (2.0 * sig2)); + +- if( logmat->precision == VIPS_PRECISION_INTEGER ) +- v = VIPS_RINT( 20 * v ); ++ if (logmat->precision == VIPS_PRECISION_INTEGER) ++ v = VIPS_RINT(20 * v); + +- *VIPS_MATRIX( create->out, x, y ) = v; +- sum += v; ++ *VIPS_MATRIX(create->out, x, y) = v; ++ sum += v; + } + } + +- vips_image_set_double( create->out, "scale", sum ); +- vips_image_set_double( create->out, "offset", 0.0 ); ++ vips_image_set_double(create->out, "scale", sum); ++ vips_image_set_double(create->out, "offset", 0.0); + +- return( 0 ); ++ return (0); + } + + static void +-vips_logmat_class_init( VipsLogmatClass *class ) ++vips_logmat_class_init(VipsLogmatClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "logmat"; +- vobject_class->description = _( "make a Laplacian of Gaussian image" ); ++ vobject_class->description = _("make a Laplacian of Gaussian image"); + vobject_class->build = vips_logmat_build; + +- VIPS_ARG_DOUBLE( class, "sigma", 2, +- _( "Radius" ), +- _( "Radius of Gaussian" ), ++ VIPS_ARG_DOUBLE(class, "sigma", 2, ++ _("Radius"), ++ _("Radius of Gaussian"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsLogmat, sigma ), +- 0.000001, 10000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsLogmat, sigma), ++ 0.000001, 10000.0, 1.0); + +- VIPS_ARG_DOUBLE( class, "min_ampl", 3, +- _( "Width" ), +- _( "Minimum amplitude of Gaussian" ), ++ VIPS_ARG_DOUBLE(class, "min_ampl", 3, ++ _("Width"), ++ _("Minimum amplitude of Gaussian"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsLogmat, min_ampl ), +- 0.000001, 10000.0, 0.1 ); ++ G_STRUCT_OFFSET(VipsLogmat, min_ampl), ++ 0.000001, 10000.0, 0.1); + +- VIPS_ARG_BOOL( class, "separable", 4, +- _( "Separable" ), +- _( "Generate separable Gaussian" ), ++ VIPS_ARG_BOOL(class, "separable", 4, ++ _("Separable"), ++ _("Generate separable Gaussian"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsLogmat, separable ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsLogmat, separable), ++ FALSE); + +- VIPS_ARG_BOOL( class, "integer", 5, +- _( "Integer" ), +- _( "Generate integer Gaussian" ), ++ VIPS_ARG_BOOL(class, "integer", 5, ++ _("Integer"), ++ _("Generate integer Gaussian"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsLogmat, integer ), +- FALSE ); +- +- VIPS_ARG_ENUM( class, "precision", 6, +- _( "Precision" ), +- _( "Generate with this precision" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsLogmat, precision ), +- VIPS_TYPE_PRECISION, VIPS_PRECISION_INTEGER ); ++ G_STRUCT_OFFSET(VipsLogmat, integer), ++ FALSE); + ++ VIPS_ARG_ENUM(class, "precision", 6, ++ _("Precision"), ++ _("Generate with this precision"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsLogmat, precision), ++ VIPS_TYPE_PRECISION, VIPS_PRECISION_INTEGER); + } + + static void +-vips_logmat_init( VipsLogmat *logmat ) ++vips_logmat_init(VipsLogmat *logmat) + { + logmat->sigma = 1; + logmat->min_ampl = 0.1; +@@ -254,30 +253,30 @@ vips_logmat_init( VipsLogmat *logmat ) + * * @separable: generate a separable mask + * * @precision: #VipsPrecision for @out + * +- * Creates a circularly symmetric Laplacian of Gaussian mask +- * of radius +- * @sigma. The size of the mask is determined by the variable @min_ampl; +- * if for instance the value .1 is entered this means that the produced mask +- * is clipped at values within 10 persent of zero, and where the change ++ * Creates a circularly symmetric Laplacian of Gaussian mask ++ * of radius ++ * @sigma. The size of the mask is determined by the variable @min_ampl; ++ * if for instance the value .1 is entered this means that the produced mask ++ * is clipped at values within 10 persent of zero, and where the change + * between mask elements is less than 10%. + * +- * The program uses the following equation: (from Handbook of Pattern ++ * The program uses the following equation: (from Handbook of Pattern + * Recognition and image processing by Young and Fu, AP 1986 pages 220-221): + * + * H(r) = (1 / (2 * M_PI * s4)) * +- * (2 - (r2 / s2)) * ++ * (2 - (r2 / s2)) * + * exp(-r2 / (2 * s2)) + * +- * where s2 = @sigma * @sigma, s4 = s2 * s2, r2 = r * r. ++ * where s2 = @sigma * @sigma, s4 = s2 * s2, r2 = r * r. + * +- * The generated mask has odd size and its maximum value is normalised to ++ * The generated mask has odd size and its maximum value is normalised to + * 1.0, unless @precision is #VIPS_PRECISION_INTEGER. + * + * If @separable is set, only the centre horizontal is generated. This is +- * useful for separable convolutions. ++ * useful for separable convolutions. + * +- * If @precision is #VIPS_PRECISION_INTEGER, an integer mask is generated. +- * This is useful for integer convolutions. ++ * If @precision is #VIPS_PRECISION_INTEGER, an integer mask is generated. ++ * This is useful for integer convolutions. + * + * "scale" is set to the sum of all the mask elements. + * +@@ -286,14 +285,14 @@ vips_logmat_init( VipsLogmat *logmat ) + * Returns: 0 on success, -1 on error + */ + int +-vips_logmat( VipsImage **out, double sigma, double min_ampl, ... ) ++vips_logmat(VipsImage **out, double sigma, double min_ampl, ...) + { + va_list ap; + int result; + +- va_start( ap, min_ampl ); +- result = vips_call_split( "logmat", ap, out, sigma, min_ampl ); +- va_end( ap ); ++ va_start(ap, min_ampl); ++ result = vips_call_split("logmat", ap, out, sigma, min_ampl); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/mask.c b/libvips/create/mask.c +index 212015d4f5..c7596e3697 100644 +--- a/libvips/create/mask.c ++++ b/libvips/create/mask.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,24 +51,24 @@ + #include "point.h" + #include "pmask.h" + +-G_DEFINE_ABSTRACT_TYPE( VipsMask, vips_mask, VIPS_TYPE_POINT ); ++G_DEFINE_ABSTRACT_TYPE(VipsMask, vips_mask, VIPS_TYPE_POINT); + + static float +-vips_mask_point( VipsPoint *point, int x, int y ) ++vips_mask_point(VipsPoint *point, int x, int y) + { +- VipsMask *mask = VIPS_MASK( point ); +- VipsMaskClass *class = VIPS_MASK_GET_CLASS( point ); ++ VipsMask *mask = VIPS_MASK(point); ++ VipsMaskClass *class = VIPS_MASK_GET_CLASS(point); + + /* VIPS_MAX to prevent /0. + */ +- int half_width = VIPS_MAX( point->width / 2, 1 ); +- int half_height = VIPS_MAX( point->height / 2, 1 ); ++ int half_width = VIPS_MAX(point->width / 2, 1); ++ int half_height = VIPS_MAX(point->height / 2, 1); + + double result; + + /* Move centre for an optical transform mask. + */ +- if( !mask->optical ) { ++ if (!mask->optical) { + x = (x + half_width) % point->width; + y = (y + half_height) % point->height; + } +@@ -76,9 +76,9 @@ vips_mask_point( VipsPoint *point, int x, int y ) + x = x - half_width; + y = y - half_height; + +- if( !mask->nodc && ++ if (!mask->nodc && + x == 0 && +- y == 0 ) ++ y == 0) + /* DC component is always 1. + */ + result = 1.0; +@@ -88,61 +88,59 @@ vips_mask_point( VipsPoint *point, int x, int y ) + dx = (double) x / half_width; + dy = (double) y / half_height; + +- result = class->point( mask, dx, dy ); ++ result = class->point(mask, dx, dy); + + /* Invert filter sense for a highpass filter, or to swap +- * band-pass for band-reject. ++ * band-pass for band-reject. + */ +- if( mask->reject ) ++ if (mask->reject) + result = 1.0 - result; + } + +- return( result ); ++ return (result); + } + + static void +-vips_mask_class_init( VipsMaskClass *class ) ++vips_mask_class_init(VipsMaskClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsPointClass *point_class = VIPS_POINT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsPointClass *point_class = VIPS_POINT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "mask"; +- vobject_class->description = _( "base class for frequency filters" ); ++ vobject_class->description = _("base class for frequency filters"); + + point_class->point = vips_mask_point; +- point_class->min = 0.0; +- point_class->max = 1.0; ++ point_class->min = 0.0; ++ point_class->max = 1.0; + point_class->interpretation = VIPS_INTERPRETATION_FOURIER; + +- VIPS_ARG_BOOL( class, "optical", 5, +- _( "Optical" ), +- _( "Rotate quadrants to optical space" ), ++ VIPS_ARG_BOOL(class, "optical", 5, ++ _("Optical"), ++ _("Rotate quadrants to optical space"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMask, optical ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsMask, optical), ++ FALSE); + +- VIPS_ARG_BOOL( class, "reject", 5, +- _( "Reject" ), +- _( "Invert the sense of the filter" ), ++ VIPS_ARG_BOOL(class, "reject", 5, ++ _("Reject"), ++ _("Invert the sense of the filter"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMask, reject ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsMask, reject), ++ FALSE); + +- VIPS_ARG_BOOL( class, "nodc", 5, +- _( "Nodc" ), +- _( "Remove DC component" ), ++ VIPS_ARG_BOOL(class, "nodc", 5, ++ _("Nodc"), ++ _("Remove DC component"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMask, nodc ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsMask, nodc), ++ FALSE); + } + + static void +-vips_mask_init( VipsMask *mask ) ++vips_mask_init(VipsMask *mask) + { + } +- +diff --git a/libvips/create/mask_butterworth.c b/libvips/create/mask_butterworth.c +index e34cdc5041..4510b154a9 100644 +--- a/libvips/create/mask_butterworth.c ++++ b/libvips/create/mask_butterworth.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,11 +51,11 @@ + #include "point.h" + #include "pmask.h" + +-G_DEFINE_TYPE( VipsMaskButterworth, vips_mask_butterworth, +- VIPS_TYPE_MASK ); ++G_DEFINE_TYPE(VipsMaskButterworth, vips_mask_butterworth, ++ VIPS_TYPE_MASK); + + static double +-vips_mask_butterworth_point( VipsMask *mask, double dx, double dy ) ++vips_mask_butterworth_point(VipsMask *mask, double dx, double dy) + { + VipsMaskButterworth *butterworth = (VipsMaskButterworth *) mask; + double order = butterworth->order; +@@ -66,52 +66,51 @@ vips_mask_butterworth_point( VipsMask *mask, double dx, double dy ) + double fc2 = fc * fc; + double d = dx * dx + dy * dy; + +- if( d == 0 ) +- return( 0 ); ++ if (d == 0) ++ return (0); + else +- return( 1.0 / (1.0 + cnst * pow( fc2 / d, order )) ); ++ return (1.0 / (1.0 + cnst * pow(fc2 / d, order))); + } + + static void +-vips_mask_butterworth_class_init( VipsMaskButterworthClass *class ) ++vips_mask_butterworth_class_init(VipsMaskButterworthClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsMaskClass *mask_class = VIPS_MASK_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsMaskClass *mask_class = VIPS_MASK_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "mask_butterworth"; +- vobject_class->description = _( "make a butterworth filter" ); ++ vobject_class->description = _("make a butterworth filter"); + + mask_class->point = vips_mask_butterworth_point; + +- VIPS_ARG_DOUBLE( class, "order", 6, +- _( "Order" ), +- _( "Filter order" ), ++ VIPS_ARG_DOUBLE(class, "order", 6, ++ _("Order"), ++ _("Filter order"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskButterworth, order ), +- 1.0, 1000000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsMaskButterworth, order), ++ 1.0, 1000000.0, 1.0); + +- VIPS_ARG_DOUBLE( class, "frequency_cutoff", 7, +- _( "Frequency cutoff" ), +- _( "Frequency cutoff" ), ++ VIPS_ARG_DOUBLE(class, "frequency_cutoff", 7, ++ _("Frequency cutoff"), ++ _("Frequency cutoff"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskButterworth, frequency_cutoff ), +- 0.0, 1000000.0, 0.5 ); ++ G_STRUCT_OFFSET(VipsMaskButterworth, frequency_cutoff), ++ 0.0, 1000000.0, 0.5); + +- VIPS_ARG_DOUBLE( class, "amplitude_cutoff", 8, +- _( "Amplitude cutoff" ), +- _( "Amplitude cutoff" ), ++ VIPS_ARG_DOUBLE(class, "amplitude_cutoff", 8, ++ _("Amplitude cutoff"), ++ _("Amplitude cutoff"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskButterworth, amplitude_cutoff ), +- 0.0, 1.0, 0.5 ); +- ++ G_STRUCT_OFFSET(VipsMaskButterworth, amplitude_cutoff), ++ 0.0, 1.0, 0.5); + } + + static void +-vips_mask_butterworth_init( VipsMaskButterworth *butterworth ) ++vips_mask_butterworth_init(VipsMaskButterworth *butterworth) + { + butterworth->order = 1.0; + butterworth->frequency_cutoff = 0.5; +@@ -140,24 +139,24 @@ vips_mask_butterworth_init( VipsMaskButterworth *butterworth ) + * positioned at @frequency_cutoff, where @frequency_cutoff is in + * range 0 - 1. The shape of the curve is controlled by + * @order --- higher values give a sharper transition. See Gonzalez and Wintz, +- * Digital Image Processing, 1987. ++ * Digital Image Processing, 1987. + * +- * See also: vips_mask_ideal(). ++ * See also: vips_mask_ideal(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_mask_butterworth( VipsImage **out, int width, int height, +- double order, double frequency_cutoff, double amplitude_cutoff, ... ) ++vips_mask_butterworth(VipsImage **out, int width, int height, ++ double order, double frequency_cutoff, double amplitude_cutoff, ...) + { + va_list ap; + int result; + +- va_start( ap, amplitude_cutoff ); +- result = vips_call_split( "mask_butterworth", ap, +- out, width, height, +- order, frequency_cutoff, amplitude_cutoff ); +- va_end( ap ); ++ va_start(ap, amplitude_cutoff); ++ result = vips_call_split("mask_butterworth", ap, ++ out, width, height, ++ order, frequency_cutoff, amplitude_cutoff); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/mask_butterworth_band.c b/libvips/create/mask_butterworth_band.c +index b164a69b82..e23c53077a 100644 +--- a/libvips/create/mask_butterworth_band.c ++++ b/libvips/create/mask_butterworth_band.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -64,14 +64,14 @@ typedef struct _VipsMaskButterworthBand { + + typedef VipsMaskClass VipsMaskButterworthBandClass; + +-G_DEFINE_TYPE( VipsMaskButterworthBand, vips_mask_butterworth_band, +- VIPS_TYPE_MASK ); ++G_DEFINE_TYPE(VipsMaskButterworthBand, vips_mask_butterworth_band, ++ VIPS_TYPE_MASK); + + static double +-vips_mask_butterworth_band_point( VipsMask *mask, +- double dx, double dy ) ++vips_mask_butterworth_band_point(VipsMask *mask, ++ double dx, double dy) + { +- VipsMaskButterworthBand *butterworth_band = ++ VipsMaskButterworthBand *butterworth_band = + (VipsMaskButterworthBand *) mask; + double order = butterworth_band->order; + double fcx = butterworth_band->frequency_cutoff_x; +@@ -83,72 +83,69 @@ vips_mask_butterworth_band_point( VipsMask *mask, + + /* Normalise the amplitude at (fcx, fcy) to 1.0. + */ +- double cnsta = 1.0 / (1.0 + 1.0 / (1.0 + +- cnst * pow( 4.0 * (fcx * fcx + fcy * fcy) / r2, order ))); ++ double cnsta = 1.0 / (1.0 + 1.0 / (1.0 + cnst * pow(4.0 * (fcx * fcx + fcy * fcy) / r2, order))); + + double d1 = (dx - fcx) * (dx - fcx) + (dy - fcy) * (dy - fcy); + double d2 = (dx + fcx) * (dx + fcx) + (dy + fcy) * (dy + fcy); + +- return( cnsta * (1.0 / (1.0 + cnst * pow( d1 / r2, order )) + +- 1.0 / (1.0 + cnst * pow( d2 / r2, order ))) ); ++ return (cnsta * (1.0 / (1.0 + cnst * pow(d1 / r2, order)) + 1.0 / (1.0 + cnst * pow(d2 / r2, order)))); + } + + static void +-vips_mask_butterworth_band_class_init( +- VipsMaskButterworthBandClass *class ) ++vips_mask_butterworth_band_class_init( ++ VipsMaskButterworthBandClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsMaskClass *mask_class = VIPS_MASK_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsMaskClass *mask_class = VIPS_MASK_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "mask_butterworth_band"; +- vobject_class->description = _( "make a butterworth_band filter" ); ++ vobject_class->description = _("make a butterworth_band filter"); + + mask_class->point = vips_mask_butterworth_band_point; + +- VIPS_ARG_DOUBLE( class, "order", 6, +- _( "Order" ), +- _( "Filter order" ), ++ VIPS_ARG_DOUBLE(class, "order", 6, ++ _("Order"), ++ _("Filter order"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskButterworthBand, order ), +- 1.0, 1000000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsMaskButterworthBand, order), ++ 1.0, 1000000.0, 1.0); + +- VIPS_ARG_DOUBLE( class, "frequency_cutoff_x", 7, +- _( "Frequency cutoff x" ), +- _( "Frequency cutoff x" ), ++ VIPS_ARG_DOUBLE(class, "frequency_cutoff_x", 7, ++ _("Frequency cutoff x"), ++ _("Frequency cutoff x"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskButterworthBand, frequency_cutoff_x ), +- 0.0, 1000000.0, 0.5 ); ++ G_STRUCT_OFFSET(VipsMaskButterworthBand, frequency_cutoff_x), ++ 0.0, 1000000.0, 0.5); + +- VIPS_ARG_DOUBLE( class, "frequency_cutoff_y", 8, +- _( "Frequency cutoff y" ), +- _( "Frequency cutoff y" ), ++ VIPS_ARG_DOUBLE(class, "frequency_cutoff_y", 8, ++ _("Frequency cutoff y"), ++ _("Frequency cutoff y"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskButterworthBand, frequency_cutoff_y ), +- 0.0, 1000000.0, 0.5 ); ++ G_STRUCT_OFFSET(VipsMaskButterworthBand, frequency_cutoff_y), ++ 0.0, 1000000.0, 0.5); + +- VIPS_ARG_DOUBLE( class, "radius", 9, +- _( "Radius" ), +- _( "Radius of circle" ), ++ VIPS_ARG_DOUBLE(class, "radius", 9, ++ _("Radius"), ++ _("Radius of circle"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskButterworthBand, radius ), +- 0.0, 1000000.0, 0.1 ); ++ G_STRUCT_OFFSET(VipsMaskButterworthBand, radius), ++ 0.0, 1000000.0, 0.1); + +- VIPS_ARG_DOUBLE( class, "amplitude_cutoff", 10, +- _( "Amplitude cutoff" ), +- _( "Amplitude cutoff" ), ++ VIPS_ARG_DOUBLE(class, "amplitude_cutoff", 10, ++ _("Amplitude cutoff"), ++ _("Amplitude cutoff"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskButterworthBand, amplitude_cutoff ), +- 0.0, 1.0, 0.5 ); +- ++ G_STRUCT_OFFSET(VipsMaskButterworthBand, amplitude_cutoff), ++ 0.0, 1.0, 0.5); + } + + static void +-vips_mask_butterworth_band_init( +- VipsMaskButterworthBand *butterworth_band ) ++vips_mask_butterworth_band_init( ++ VipsMaskButterworthBand *butterworth_band) + { + butterworth_band->order = 1.0; + butterworth_band->frequency_cutoff_x = 0.5; +@@ -163,7 +160,7 @@ vips_mask_butterworth_band_init( + * @width: image size + * @height: image size + * @order: filter order +- * @frequency_cutoff_x: band position ++ * @frequency_cutoff_x: band position + * @frequency_cutoff_y: band position + * @radius: band radius + * @amplitude_cutoff: amplitude threshold +@@ -176,31 +173,31 @@ vips_mask_butterworth_band_init( + * * @optical: coordinates in optical space + * * @uchar: output a uchar image + * +- * Make an butterworth band-pass or band-reject filter, that is, one with a +- * variable, smooth transition positioned at @frequency_cutoff_x, ++ * Make an butterworth band-pass or band-reject filter, that is, one with a ++ * variable, smooth transition positioned at @frequency_cutoff_x, + * @frequency_cutoff_y, of radius @radius. + * The shape of the curve is controlled by + * @order --- higher values give a sharper transition. See Gonzalez and Wintz, +- * Digital Image Processing, 1987. ++ * Digital Image Processing, 1987. + * +- * See also: vips_mask_ideal(). ++ * See also: vips_mask_ideal(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_mask_butterworth_band( VipsImage **out, int width, int height, +- double order, double frequency_cutoff_x, double frequency_cutoff_y, +- double radius, double amplitude_cutoff, ... ) ++vips_mask_butterworth_band(VipsImage **out, int width, int height, ++ double order, double frequency_cutoff_x, double frequency_cutoff_y, ++ double radius, double amplitude_cutoff, ...) + { + va_list ap; + int result; + +- va_start( ap, amplitude_cutoff ); +- result = vips_call_split( "mask_butterworth_band", ap, +- out, width, height, +- order, frequency_cutoff_x, frequency_cutoff_y, radius, +- amplitude_cutoff ); +- va_end( ap ); ++ va_start(ap, amplitude_cutoff); ++ result = vips_call_split("mask_butterworth_band", ap, ++ out, width, height, ++ order, frequency_cutoff_x, frequency_cutoff_y, radius, ++ amplitude_cutoff); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/mask_butterworth_ring.c b/libvips/create/mask_butterworth_ring.c +index bb4b4a6bd8..7fc39a7e8d 100644 +--- a/libvips/create/mask_butterworth_ring.c ++++ b/libvips/create/mask_butterworth_ring.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -60,16 +60,16 @@ typedef struct _VipsMaskButterworthRing { + + typedef VipsMaskButterworthClass VipsMaskButterworthRingClass; + +-G_DEFINE_TYPE( VipsMaskButterworthRing, vips_mask_butterworth_ring, +- VIPS_TYPE_MASK_BUTTERWORTH ); ++G_DEFINE_TYPE(VipsMaskButterworthRing, vips_mask_butterworth_ring, ++ VIPS_TYPE_MASK_BUTTERWORTH); + + static double +-vips_mask_butterworth_ring_point( VipsMask *mask, +- double dx, double dy ) ++vips_mask_butterworth_ring_point(VipsMask *mask, ++ double dx, double dy) + { +- VipsMaskButterworth *butterworth = ++ VipsMaskButterworth *butterworth = + (VipsMaskButterworth *) mask; +- VipsMaskButterworthRing *butterworth_ring = ++ VipsMaskButterworthRing *butterworth_ring = + (VipsMaskButterworthRing *) mask; + + double order = butterworth->order; +@@ -79,41 +79,39 @@ vips_mask_butterworth_ring_point( VipsMask *mask, + + double df = ringwidth / 2.0; + double cnst = (1.0 / ac) - 1.0; +- double df2 = df * df; +- double dist = sqrt( dx * dx + dy * dy ); ++ double df2 = df * df; ++ double dist = sqrt(dx * dx + dy * dy); + +- return( 1.0 / (1.0 + cnst * pow( +- (dist - fc) * (dist - fc) / df2, order )) ); ++ return (1.0 / (1.0 + cnst * pow((dist - fc) * (dist - fc) / df2, order))); + } + + static void +-vips_mask_butterworth_ring_class_init( +- VipsMaskButterworthRingClass *class ) ++vips_mask_butterworth_ring_class_init( ++ VipsMaskButterworthRingClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsMaskClass *mask_class = VIPS_MASK_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsMaskClass *mask_class = VIPS_MASK_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "mask_butterworth_ring"; +- vobject_class->description = _( "make a butterworth ring filter" ); ++ vobject_class->description = _("make a butterworth ring filter"); + + mask_class->point = vips_mask_butterworth_ring_point; + +- VIPS_ARG_DOUBLE( class, "ringwidth", 20, +- _( "Ringwidth" ), +- _( "Ringwidth" ), ++ VIPS_ARG_DOUBLE(class, "ringwidth", 20, ++ _("Ringwidth"), ++ _("Ringwidth"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskButterworthRing, ringwidth ), +- 0.0, 1000000.0, 0.1 ); +- ++ G_STRUCT_OFFSET(VipsMaskButterworthRing, ringwidth), ++ 0.0, 1000000.0, 0.1); + } + + static void +-vips_mask_butterworth_ring_init( +- VipsMaskButterworthRing *butterworth_ring ) ++vips_mask_butterworth_ring_init( ++ VipsMaskButterworthRing *butterworth_ring) + { + butterworth_ring->ringwidth = 0.1; + } +@@ -136,31 +134,31 @@ vips_mask_butterworth_ring_init( + * * @optical: coordinates in optical space + * * @uchar: output a uchar image + * +- * Make a butterworth ring-pass or ring-reject filter, that is, one with a ++ * Make a butterworth ring-pass or ring-reject filter, that is, one with a + * variable, + * smooth transition +- * positioned at @frequency_cutoff of width @width, where @frequency_cutoff is ++ * positioned at @frequency_cutoff of width @width, where @frequency_cutoff is + * in the range 0 - 1. The shape of the curve is controlled by + * @order --- higher values give a sharper transition. See Gonzalez and Wintz, +- * Digital Image Processing, 1987. ++ * Digital Image Processing, 1987. + * +- * See also: vips_mask_ideal(). ++ * See also: vips_mask_ideal(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_mask_butterworth_ring( VipsImage **out, int width, int height, +- double order, double frequency_cutoff, double amplitude_cutoff, +- double ringwidth, ... ) ++vips_mask_butterworth_ring(VipsImage **out, int width, int height, ++ double order, double frequency_cutoff, double amplitude_cutoff, ++ double ringwidth, ...) + { + va_list ap; + int result; + +- va_start( ap, ringwidth ); +- result = vips_call_split( "mask_butterworth_ring", ap, +- out, width, height, +- order, frequency_cutoff, amplitude_cutoff, ringwidth ); +- va_end( ap ); ++ va_start(ap, ringwidth); ++ result = vips_call_split("mask_butterworth_ring", ap, ++ out, width, height, ++ order, frequency_cutoff, amplitude_cutoff, ringwidth); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/mask_fractal.c b/libvips/create/mask_fractal.c +index a48c39ca19..4764ce535d 100644 +--- a/libvips/create/mask_fractal.c ++++ b/libvips/create/mask_fractal.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -60,46 +60,45 @@ typedef struct _VipsMaskFractal { + + typedef VipsMaskClass VipsMaskFractalClass; + +-G_DEFINE_TYPE( VipsMaskFractal, vips_mask_fractal, +- VIPS_TYPE_MASK ); ++G_DEFINE_TYPE(VipsMaskFractal, vips_mask_fractal, ++ VIPS_TYPE_MASK); + + static double +-vips_mask_fractal_point( VipsMask *mask, double dx, double dy ) ++vips_mask_fractal_point(VipsMask *mask, double dx, double dy) + { + VipsMaskFractal *fractal = (VipsMaskFractal *) mask; + double fd = (fractal->fractal_dimension - 4.0) / 2.0; + + double d2 = dx * dx + dy * dy; + +- return( pow( d2, fd ) ); ++ return (pow(d2, fd)); + } + + static void +-vips_mask_fractal_class_init( VipsMaskFractalClass *class ) ++vips_mask_fractal_class_init(VipsMaskFractalClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsMaskClass *mask_class = VIPS_MASK_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsMaskClass *mask_class = VIPS_MASK_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "mask_fractal"; +- vobject_class->description = _( "make fractal filter" ); ++ vobject_class->description = _("make fractal filter"); + + mask_class->point = vips_mask_fractal_point; + +- VIPS_ARG_DOUBLE( class, "fractal_dimension", 8, +- _( "Fractal dimension" ), +- _( "Fractal dimension" ), ++ VIPS_ARG_DOUBLE(class, "fractal_dimension", 8, ++ _("Fractal dimension"), ++ _("Fractal dimension"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskFractal, fractal_dimension ), +- 2.0, 3.0, 2.5 ); +- ++ G_STRUCT_OFFSET(VipsMaskFractal, fractal_dimension), ++ 2.0, 3.0, 2.5); + } + + static void +-vips_mask_fractal_init( VipsMaskFractal *fractal ) ++vips_mask_fractal_init(VipsMaskFractal *fractal) + { + fractal->fractal_dimension = 2.5; + } +@@ -120,23 +119,23 @@ vips_mask_fractal_init( VipsMaskFractal *fractal ) + * * @uchar: output a uchar image + * + * This operation should be used to create fractal images by filtering the +- * power spectrum of Gaussian white noise. See vips_gaussnoise(). ++ * power spectrum of Gaussian white noise. See vips_gaussnoise(). + * + * See also: vips_mask_ideal(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_mask_fractal( VipsImage **out, int width, int height, +- double fractal_dimension, ... ) ++vips_mask_fractal(VipsImage **out, int width, int height, ++ double fractal_dimension, ...) + { + va_list ap; + int result; + +- va_start( ap, fractal_dimension ); +- result = vips_call_split( "mask_fractal", ap, out, width, height, +- fractal_dimension ); +- va_end( ap ); ++ va_start(ap, fractal_dimension); ++ result = vips_call_split("mask_fractal", ap, out, width, height, ++ fractal_dimension); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/mask_gaussian.c b/libvips/create/mask_gaussian.c +index 2ea768eb28..6ba505bf26 100644 +--- a/libvips/create/mask_gaussian.c ++++ b/libvips/create/mask_gaussian.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,55 +51,54 @@ + #include "point.h" + #include "pmask.h" + +-G_DEFINE_TYPE( VipsMaskGaussian, vips_mask_gaussian, VIPS_TYPE_MASK ); ++G_DEFINE_TYPE(VipsMaskGaussian, vips_mask_gaussian, VIPS_TYPE_MASK); + + static double +-vips_mask_gaussian_point( VipsMask *mask, double dx, double dy ) ++vips_mask_gaussian_point(VipsMask *mask, double dx, double dy) + { + VipsMaskGaussian *gaussian = (VipsMaskGaussian *) mask; + double fc = gaussian->frequency_cutoff; + double ac = gaussian->amplitude_cutoff; + +- double cnst = log( ac ); ++ double cnst = log(ac); + double fc2 = fc * fc; + double dist2 = (dx * dx + dy * dy) / fc2; + +- return( 1.0 - exp( cnst * dist2 ) ); ++ return (1.0 - exp(cnst * dist2)); + } + + static void +-vips_mask_gaussian_class_init( VipsMaskGaussianClass *class ) ++vips_mask_gaussian_class_init(VipsMaskGaussianClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsMaskClass *mask_class = VIPS_MASK_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsMaskClass *mask_class = VIPS_MASK_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "mask_gaussian"; +- vobject_class->description = _( "make a gaussian filter" ); ++ vobject_class->description = _("make a gaussian filter"); + + mask_class->point = vips_mask_gaussian_point; + +- VIPS_ARG_DOUBLE( class, "frequency_cutoff", 7, +- _( "Frequency cutoff" ), +- _( "Frequency cutoff" ), ++ VIPS_ARG_DOUBLE(class, "frequency_cutoff", 7, ++ _("Frequency cutoff"), ++ _("Frequency cutoff"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskGaussian, frequency_cutoff ), +- 0.0, 1000000.0, 0.5 ); ++ G_STRUCT_OFFSET(VipsMaskGaussian, frequency_cutoff), ++ 0.0, 1000000.0, 0.5); + +- VIPS_ARG_DOUBLE( class, "amplitude_cutoff", 8, +- _( "Amplitude cutoff" ), +- _( "Amplitude cutoff" ), ++ VIPS_ARG_DOUBLE(class, "amplitude_cutoff", 8, ++ _("Amplitude cutoff"), ++ _("Amplitude cutoff"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskGaussian, amplitude_cutoff ), +- 0.0, 1.0, 0.5 ); +- ++ G_STRUCT_OFFSET(VipsMaskGaussian, amplitude_cutoff), ++ 0.0, 1.0, 0.5); + } + + static void +-vips_mask_gaussian_init( VipsMaskGaussian *gaussian ) ++vips_mask_gaussian_init(VipsMaskGaussian *gaussian) + { + gaussian->frequency_cutoff = 0.5; + gaussian->amplitude_cutoff = 0.5; +@@ -124,21 +123,21 @@ vips_mask_gaussian_init( VipsMaskGaussian *gaussian ) + * Make a gaussian high- or low-pass filter, that is, one with a variable, + * smooth transition positioned at @frequency_cutoff. + * +- * See also: vips_mask_ideal(). ++ * See also: vips_mask_ideal(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_mask_gaussian( VipsImage **out, int width, int height, +- double frequency_cutoff, double amplitude_cutoff, ... ) ++vips_mask_gaussian(VipsImage **out, int width, int height, ++ double frequency_cutoff, double amplitude_cutoff, ...) + { + va_list ap; + int result; + +- va_start( ap, amplitude_cutoff ); +- result = vips_call_split( "mask_gaussian", ap, out, width, height, +- frequency_cutoff, amplitude_cutoff ); +- va_end( ap ); ++ va_start(ap, amplitude_cutoff); ++ result = vips_call_split("mask_gaussian", ap, out, width, height, ++ frequency_cutoff, amplitude_cutoff); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/mask_gaussian_band.c b/libvips/create/mask_gaussian_band.c +index bc0a6bb25b..fb4831fdb1 100644 +--- a/libvips/create/mask_gaussian_band.c ++++ b/libvips/create/mask_gaussian_band.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -63,10 +63,10 @@ typedef struct _VipsMaskGaussianBand { + + typedef VipsMaskClass VipsMaskGaussianBandClass; + +-G_DEFINE_TYPE( VipsMaskGaussianBand, vips_mask_gaussian_band, VIPS_TYPE_MASK ); ++G_DEFINE_TYPE(VipsMaskGaussianBand, vips_mask_gaussian_band, VIPS_TYPE_MASK); + + static double +-vips_mask_gaussian_band_point( VipsMask *mask, double dx, double dy ) ++vips_mask_gaussian_band_point(VipsMask *mask, double dx, double dy) + { + VipsMaskGaussianBand *gaussian_band = (VipsMaskGaussianBand *) mask; + +@@ -75,66 +75,64 @@ vips_mask_gaussian_band_point( VipsMask *mask, double dx, double dy ) + double r2 = gaussian_band->radius * gaussian_band->radius; + double ac = gaussian_band->amplitude_cutoff; + +- double cnst = log( ac ); ++ double cnst = log(ac); + + double d1 = (dx - fcx) * (dx - fcx) + (dy - fcy) * (dy - fcy); + double d2 = (dx + fcx) * (dx + fcx) + (dy + fcy) * (dy + fcy); + + /* Normalise the amplitude at (fcx, fcy) to 1.0. + */ +- double cnsta = 1.0 / (1.0 + +- exp( cnst * 4.0 * (fcx * fcx + fcy * fcy) / r2 )); ++ double cnsta = 1.0 / (1.0 + exp(cnst * 4.0 * (fcx * fcx + fcy * fcy) / r2)); + +- return( cnsta * (exp( cnst * d1 / r2 ) + exp( cnst * d2 / r2 )) ); ++ return (cnsta * (exp(cnst * d1 / r2) + exp(cnst * d2 / r2))); + } + + static void +-vips_mask_gaussian_band_class_init( VipsMaskGaussianBandClass *class ) ++vips_mask_gaussian_band_class_init(VipsMaskGaussianBandClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsMaskClass *mask_class = VIPS_MASK_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsMaskClass *mask_class = VIPS_MASK_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "mask_gaussian_band"; +- vobject_class->description = _( "make a gaussian filter" ); ++ vobject_class->description = _("make a gaussian filter"); + + mask_class->point = vips_mask_gaussian_band_point; + +- VIPS_ARG_DOUBLE( class, "frequency_cutoff_x", 7, +- _( "Frequency cutoff x" ), +- _( "Frequency cutoff x" ), ++ VIPS_ARG_DOUBLE(class, "frequency_cutoff_x", 7, ++ _("Frequency cutoff x"), ++ _("Frequency cutoff x"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskGaussianBand, frequency_cutoff_x ), +- 0.0, 1000000.0, 0.5 ); ++ G_STRUCT_OFFSET(VipsMaskGaussianBand, frequency_cutoff_x), ++ 0.0, 1000000.0, 0.5); + +- VIPS_ARG_DOUBLE( class, "frequency_cutoff_y", 8, +- _( "Frequency cutoff y" ), +- _( "Frequency cutoff y" ), ++ VIPS_ARG_DOUBLE(class, "frequency_cutoff_y", 8, ++ _("Frequency cutoff y"), ++ _("Frequency cutoff y"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskGaussianBand, frequency_cutoff_y ), +- 0.0, 1000000.0, 0.5 ); ++ G_STRUCT_OFFSET(VipsMaskGaussianBand, frequency_cutoff_y), ++ 0.0, 1000000.0, 0.5); + +- VIPS_ARG_DOUBLE( class, "radius", 9, +- _( "Radius" ), +- _( "Radius of circle" ), ++ VIPS_ARG_DOUBLE(class, "radius", 9, ++ _("Radius"), ++ _("Radius of circle"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskGaussianBand, radius ), +- 0.0, 1000000.0, 0.1 ); ++ G_STRUCT_OFFSET(VipsMaskGaussianBand, radius), ++ 0.0, 1000000.0, 0.1); + +- VIPS_ARG_DOUBLE( class, "amplitude_cutoff", 10, +- _( "Amplitude cutoff" ), +- _( "Amplitude cutoff" ), ++ VIPS_ARG_DOUBLE(class, "amplitude_cutoff", 10, ++ _("Amplitude cutoff"), ++ _("Amplitude cutoff"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskGaussianBand, amplitude_cutoff ), +- 0.0, 1.0, 0.5 ); +- ++ G_STRUCT_OFFSET(VipsMaskGaussianBand, amplitude_cutoff), ++ 0.0, 1.0, 0.5); + } + + static void +-vips_mask_gaussian_band_init( VipsMaskGaussianBand *gaussian_band ) ++vips_mask_gaussian_band_init(VipsMaskGaussianBand *gaussian_band) + { + gaussian_band->frequency_cutoff_x = 0.5; + gaussian_band->frequency_cutoff_x = 0.5; +@@ -147,7 +145,7 @@ vips_mask_gaussian_band_init( VipsMaskGaussianBand *gaussian_band ) + * @out: (out): output image + * @width: image size + * @height: image size +- * @frequency_cutoff_x: band position ++ * @frequency_cutoff_x: band position + * @frequency_cutoff_y: band position + * @radius: band radius + * @amplitude_cutoff: amplitude threshold +@@ -160,27 +158,27 @@ vips_mask_gaussian_band_init( VipsMaskGaussianBand *gaussian_band ) + * * @optical: coordinates in optical space + * * @uchar: output a uchar image + * +- * Make a gaussian band-pass or band-reject filter, that is, one with a +- * variable, smooth transition positioned at @frequency_cutoff_x, ++ * Make a gaussian band-pass or band-reject filter, that is, one with a ++ * variable, smooth transition positioned at @frequency_cutoff_x, + * @frequency_cutoff_y, of radius @radius. + * +- * See also: vips_mask_ideal(). ++ * See also: vips_mask_ideal(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_mask_gaussian_band( VipsImage **out, int width, int height, +- double frequency_cutoff_x, double frequency_cutoff_y, double radius, +- double amplitude_cutoff, ... ) ++vips_mask_gaussian_band(VipsImage **out, int width, int height, ++ double frequency_cutoff_x, double frequency_cutoff_y, double radius, ++ double amplitude_cutoff, ...) + { + va_list ap; + int result; + +- va_start( ap, amplitude_cutoff ); +- result = vips_call_split( "mask_gaussian_band", ap, out, width, height, +- frequency_cutoff_x, frequency_cutoff_y, radius, +- amplitude_cutoff ); +- va_end( ap ); ++ va_start(ap, amplitude_cutoff); ++ result = vips_call_split("mask_gaussian_band", ap, out, width, height, ++ frequency_cutoff_x, frequency_cutoff_y, radius, ++ amplitude_cutoff); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/mask_gaussian_ring.c b/libvips/create/mask_gaussian_ring.c +index 736f799707..7a40e78fdb 100644 +--- a/libvips/create/mask_gaussian_ring.c ++++ b/libvips/create/mask_gaussian_ring.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -60,14 +60,14 @@ typedef struct _VipsMaskGaussianRing { + + typedef VipsMaskGaussianClass VipsMaskGaussianRingClass; + +-G_DEFINE_TYPE( VipsMaskGaussianRing, vips_mask_gaussian_ring, +- VIPS_TYPE_MASK_GAUSSIAN ); ++G_DEFINE_TYPE(VipsMaskGaussianRing, vips_mask_gaussian_ring, ++ VIPS_TYPE_MASK_GAUSSIAN); + + static double +-vips_mask_gaussian_ring_point( VipsMask *mask, double dx, double dy ) ++vips_mask_gaussian_ring_point(VipsMask *mask, double dx, double dy) + { + VipsMaskGaussian *gaussian = (VipsMaskGaussian *) mask; +- VipsMaskGaussianRing *gaussian_ring = ++ VipsMaskGaussianRing *gaussian_ring = + (VipsMaskGaussianRing *) mask; + + double fc = gaussian->frequency_cutoff; +@@ -75,39 +75,38 @@ vips_mask_gaussian_ring_point( VipsMask *mask, double dx, double dy ) + double ringwidth = gaussian_ring->ringwidth; + + double df = ringwidth / 2.0; +- double df2 = df * df; +- double cnst = log( ac ); +- double dist = sqrt( dx * dx + dy * dy ); ++ double df2 = df * df; ++ double cnst = log(ac); ++ double dist = sqrt(dx * dx + dy * dy); + +- return( exp( cnst * (dist - fc) * (dist - fc) / df2 ) ); ++ return (exp(cnst * (dist - fc) * (dist - fc) / df2)); + } + + static void +-vips_mask_gaussian_ring_class_init( VipsMaskGaussianRingClass *class ) ++vips_mask_gaussian_ring_class_init(VipsMaskGaussianRingClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsMaskClass *mask_class = VIPS_MASK_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsMaskClass *mask_class = VIPS_MASK_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "mask_gaussian_ring"; +- vobject_class->description = _( "make a gaussian ring filter" ); ++ vobject_class->description = _("make a gaussian ring filter"); + + mask_class->point = vips_mask_gaussian_ring_point; + +- VIPS_ARG_DOUBLE( class, "ringwidth", 20, +- _( "Ringwidth" ), +- _( "Ringwidth" ), ++ VIPS_ARG_DOUBLE(class, "ringwidth", 20, ++ _("Ringwidth"), ++ _("Ringwidth"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskGaussianRing, ringwidth ), +- 0.0, 1000000.0, 0.5 ); +- ++ G_STRUCT_OFFSET(VipsMaskGaussianRing, ringwidth), ++ 0.0, 1000000.0, 0.5); + } + + static void +-vips_mask_gaussian_ring_init( VipsMaskGaussianRing *gaussian_ring ) ++vips_mask_gaussian_ring_init(VipsMaskGaussianRing *gaussian_ring) + { + gaussian_ring->ringwidth = 0.5; + } +@@ -129,27 +128,27 @@ vips_mask_gaussian_ring_init( VipsMaskGaussianRing *gaussian_ring ) + * * @optical: coordinates in optical space + * * @uchar: output a uchar image + * +- * Make a gaussian ring-pass or ring-reject filter, that is, one with a ++ * Make a gaussian ring-pass or ring-reject filter, that is, one with a + * variable, smooth transition positioned at @frequency_cutoff of width +- * @ringwidth. ++ * @ringwidth. + * +- * See also: vips_mask_ideal(). ++ * See also: vips_mask_ideal(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_mask_gaussian_ring( VipsImage **out, int width, int height, +- double frequency_cutoff, double amplitude_cutoff, double ringwidth, +- ... ) ++vips_mask_gaussian_ring(VipsImage **out, int width, int height, ++ double frequency_cutoff, double amplitude_cutoff, double ringwidth, ++ ...) + { + va_list ap; + int result; + +- va_start( ap, ringwidth ); +- result = vips_call_split( "mask_gaussian_ring", +- ap, out, width, height, +- frequency_cutoff, amplitude_cutoff, ringwidth ); +- va_end( ap ); ++ va_start(ap, ringwidth); ++ result = vips_call_split("mask_gaussian_ring", ++ ap, out, width, height, ++ frequency_cutoff, amplitude_cutoff, ringwidth); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/mask_ideal.c b/libvips/create/mask_ideal.c +index a03f8b8cbd..c141ae4910 100644 +--- a/libvips/create/mask_ideal.c ++++ b/libvips/create/mask_ideal.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,10 +51,10 @@ + #include "point.h" + #include "pmask.h" + +-G_DEFINE_TYPE( VipsMaskIdeal, vips_mask_ideal, VIPS_TYPE_MASK ); ++G_DEFINE_TYPE(VipsMaskIdeal, vips_mask_ideal, VIPS_TYPE_MASK); + + static double +-vips_mask_ideal_point( VipsMask *mask, double dx, double dy ) ++vips_mask_ideal_point(VipsMask *mask, double dx, double dy) + { + VipsMaskIdeal *ideal = (VipsMaskIdeal *) mask; + double fc = ideal->frequency_cutoff; +@@ -62,35 +62,34 @@ vips_mask_ideal_point( VipsMask *mask, double dx, double dy ) + double dist2 = dx * dx + dy * dy; + double fc2 = fc * fc; + +- return( dist2 <= fc2 ? 0.0 : 1.0 ); ++ return (dist2 <= fc2 ? 0.0 : 1.0); + } + + static void +-vips_mask_ideal_class_init( VipsMaskIdealClass *class ) ++vips_mask_ideal_class_init(VipsMaskIdealClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsMaskClass *mask_class = VIPS_MASK_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsMaskClass *mask_class = VIPS_MASK_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "mask_ideal"; +- vobject_class->description = _( "make an ideal filter" ); ++ vobject_class->description = _("make an ideal filter"); + + mask_class->point = vips_mask_ideal_point; + +- VIPS_ARG_DOUBLE( class, "frequency_cutoff", 6, +- _( "Frequency cutoff" ), +- _( "Frequency cutoff" ), ++ VIPS_ARG_DOUBLE(class, "frequency_cutoff", 6, ++ _("Frequency cutoff"), ++ _("Frequency cutoff"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskIdeal, frequency_cutoff ), +- 0.0, 1000000.0, 0.5 ); +- ++ G_STRUCT_OFFSET(VipsMaskIdeal, frequency_cutoff), ++ 0.0, 1000000.0, 0.5); + } + + static void +-vips_mask_ideal_init( VipsMaskIdeal *ideal ) ++vips_mask_ideal_init(VipsMaskIdeal *ideal) + { + ideal->frequency_cutoff = 0.5; + } +@@ -114,44 +113,44 @@ vips_mask_ideal_init( VipsMaskIdeal *ideal ) + * positioned at @frequency_cutoff, where @frequency_cutoff is in + * the range 0 - 1. + * +- * This operation creates a one-band float image of the specified size. ++ * This operation creates a one-band float image of the specified size. + * The image has +- * values in the range [0, 1] and is typically used for multiplying against ++ * values in the range [0, 1] and is typically used for multiplying against + * frequency domain images to filter them. + * Masks are created with the DC component at (0, 0). The DC pixel always + * has the value 1.0. + * +- * Set @nodc to not set the DC pixel. ++ * Set @nodc to not set the DC pixel. + * + * Set @optical to position the DC component in the centre of the image. This +- * makes the mask suitable for multiplying against optical Fourier transforms. +- * See vips_wrap(). ++ * makes the mask suitable for multiplying against optical Fourier transforms. ++ * See vips_wrap(). + * + * Set @reject to invert the sense of +- * the filter. For example, low-pass becomes low-reject. ++ * the filter. For example, low-pass becomes low-reject. + * + * Set @uchar to output an 8-bit unsigned char image rather than a + * float image. In this case, pixels are in the range [0 - 255]. + * +- * See also: vips_mask_ideal(), vips_mask_ideal_ring(), +- * vips_mask_ideal_band(), vips_mask_butterworth(), +- * vips_mask_butterworth_ring(), vips_mask_butterworth_band(), +- * vips_mask_gaussian(), vips_mask_gaussian_ring(), +- * vips_mask_gaussian_band(). ++ * See also: vips_mask_ideal(), vips_mask_ideal_ring(), ++ * vips_mask_ideal_band(), vips_mask_butterworth(), ++ * vips_mask_butterworth_ring(), vips_mask_butterworth_band(), ++ * vips_mask_gaussian(), vips_mask_gaussian_ring(), ++ * vips_mask_gaussian_band(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_mask_ideal( VipsImage **out, int width, int height, +- double frequency_cutoff, ... ) ++vips_mask_ideal(VipsImage **out, int width, int height, ++ double frequency_cutoff, ...) + { + va_list ap; + int result; + +- va_start( ap, frequency_cutoff ); +- result = vips_call_split( "mask_ideal", ap, out, width, height, +- frequency_cutoff ); +- va_end( ap ); ++ va_start(ap, frequency_cutoff); ++ result = vips_call_split("mask_ideal", ap, out, width, height, ++ frequency_cutoff); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/mask_ideal_band.c b/libvips/create/mask_ideal_band.c +index 38760c882c..4c81b793d4 100644 +--- a/libvips/create/mask_ideal_band.c ++++ b/libvips/create/mask_ideal_band.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -62,11 +62,11 @@ typedef struct _VipsMaskIdealBand { + + typedef VipsMaskClass VipsMaskIdealBandClass; + +-G_DEFINE_TYPE( VipsMaskIdealBand, vips_mask_ideal_band, +- VIPS_TYPE_MASK ); ++G_DEFINE_TYPE(VipsMaskIdealBand, vips_mask_ideal_band, ++ VIPS_TYPE_MASK); + + static double +-vips_mask_ideal_band_point( VipsMask *mask, double dx, double dy ) ++vips_mask_ideal_band_point(VipsMask *mask, double dx, double dy) + { + VipsMaskIdealBand *ideal_band = (VipsMaskIdealBand *) mask; + double fcx = ideal_band->frequency_cutoff_x; +@@ -76,49 +76,48 @@ vips_mask_ideal_band_point( VipsMask *mask, double dx, double dy ) + double d1 = (dx - fcx) * (dx - fcx) + (dy - fcy) * (dy - fcy); + double d2 = (dx + fcx) * (dx + fcx) + (dy + fcy) * (dy + fcy); + +- return( (d1 < r2 || d2 < r2) ? 1.0 : 0.0 ); ++ return ((d1 < r2 || d2 < r2) ? 1.0 : 0.0); + } + + static void +-vips_mask_ideal_band_class_init( VipsMaskIdealBandClass *class ) ++vips_mask_ideal_band_class_init(VipsMaskIdealBandClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsMaskClass *mask_class = VIPS_MASK_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsMaskClass *mask_class = VIPS_MASK_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "mask_ideal_band"; +- vobject_class->description = _( "make an ideal band filter" ); ++ vobject_class->description = _("make an ideal band filter"); + + mask_class->point = vips_mask_ideal_band_point; + +- VIPS_ARG_DOUBLE( class, "frequency_cutoff_x", 6, +- _( "Frequency cutoff x" ), +- _( "Frequency cutoff x" ), ++ VIPS_ARG_DOUBLE(class, "frequency_cutoff_x", 6, ++ _("Frequency cutoff x"), ++ _("Frequency cutoff x"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskIdealBand, frequency_cutoff_x ), +- 0.0, 1000000.0, 0.5 ); ++ G_STRUCT_OFFSET(VipsMaskIdealBand, frequency_cutoff_x), ++ 0.0, 1000000.0, 0.5); + +- VIPS_ARG_DOUBLE( class, "frequency_cutoff_y", 7, +- _( "Frequency cutoff y" ), +- _( "Frequency cutoff y" ), ++ VIPS_ARG_DOUBLE(class, "frequency_cutoff_y", 7, ++ _("Frequency cutoff y"), ++ _("Frequency cutoff y"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskIdealBand, frequency_cutoff_y ), +- 0.0, 1000000.0, 0.5 ); ++ G_STRUCT_OFFSET(VipsMaskIdealBand, frequency_cutoff_y), ++ 0.0, 1000000.0, 0.5); + +- VIPS_ARG_DOUBLE( class, "radius", 8, +- _( "Radius" ), +- _( "Radius of circle" ), ++ VIPS_ARG_DOUBLE(class, "radius", 8, ++ _("Radius"), ++ _("Radius of circle"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskIdealBand, radius ), +- 0.0, 1000000.0, 0.1 ); +- ++ G_STRUCT_OFFSET(VipsMaskIdealBand, radius), ++ 0.0, 1000000.0, 0.1); + } + + static void +-vips_mask_ideal_band_init( VipsMaskIdealBand *ideal_band ) ++vips_mask_ideal_band_init(VipsMaskIdealBand *ideal_band) + { + ideal_band->frequency_cutoff_x = 0.5; + ideal_band->frequency_cutoff_y = 0.5; +@@ -142,26 +141,26 @@ vips_mask_ideal_band_init( VipsMaskIdealBand *ideal_band ) + * * @optical: coordinates in optical space + * * @uchar: output a uchar image + * +- * Make an ideal band-pass or band-reject filter, that is, one with a +- * sharp cutoff around the point @frequency_cutoff_x, @frequency_cutoff_y, +- * of size @radius. ++ * Make an ideal band-pass or band-reject filter, that is, one with a ++ * sharp cutoff around the point @frequency_cutoff_x, @frequency_cutoff_y, ++ * of size @radius. + * + * See also: vips_mask_ideal(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_mask_ideal_band( VipsImage **out, int width, int height, +- double frequency_cutoff_x, double frequency_cutoff_y, +- double radius, ... ) ++vips_mask_ideal_band(VipsImage **out, int width, int height, ++ double frequency_cutoff_x, double frequency_cutoff_y, ++ double radius, ...) + { + va_list ap; + int result; + +- va_start( ap, radius ); +- result = vips_call_split( "mask_ideal_band", ap, out, width, height, +- frequency_cutoff_x, frequency_cutoff_y, radius ); +- va_end( ap ); ++ va_start(ap, radius); ++ result = vips_call_split("mask_ideal_band", ap, out, width, height, ++ frequency_cutoff_x, frequency_cutoff_y, radius); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/mask_ideal_ring.c b/libvips/create/mask_ideal_ring.c +index 4d716bc2b9..ea75133595 100644 +--- a/libvips/create/mask_ideal_ring.c ++++ b/libvips/create/mask_ideal_ring.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -60,11 +60,11 @@ typedef struct _VipsMaskIdealRing { + + typedef VipsMaskIdealClass VipsMaskIdealRingClass; + +-G_DEFINE_TYPE( VipsMaskIdealRing, vips_mask_ideal_ring, +- VIPS_TYPE_MASK_IDEAL ); ++G_DEFINE_TYPE(VipsMaskIdealRing, vips_mask_ideal_ring, ++ VIPS_TYPE_MASK_IDEAL); + + static double +-vips_mask_ideal_ring_point( VipsMask *mask, double dx, double dy ) ++vips_mask_ideal_ring_point(VipsMask *mask, double dx, double dy) + { + VipsMaskIdeal *ideal = (VipsMaskIdeal *) mask; + VipsMaskIdealRing *ideal_ring = (VipsMaskIdealRing *) mask; +@@ -76,35 +76,34 @@ vips_mask_ideal_ring_point( VipsMask *mask, double dx, double dy ) + double fc2_1 = (fc - df) * (fc - df); + double fc2_2 = (fc + df) * (fc + df); + +- return( dist2 > fc2_1 && dist2 < fc2_2 ? 1.0 : 0.0 ); ++ return (dist2 > fc2_1 && dist2 < fc2_2 ? 1.0 : 0.0); + } + + static void +-vips_mask_ideal_ring_class_init( VipsMaskIdealClass *class ) ++vips_mask_ideal_ring_class_init(VipsMaskIdealClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsMaskClass *mask_class = VIPS_MASK_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsMaskClass *mask_class = VIPS_MASK_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "mask_ideal_ring"; +- vobject_class->description = _( "make an ideal ring filter" ); ++ vobject_class->description = _("make an ideal ring filter"); + + mask_class->point = vips_mask_ideal_ring_point; + +- VIPS_ARG_DOUBLE( class, "ringwidth", 20, +- _( "Ringwidth" ), +- _( "Ringwidth" ), ++ VIPS_ARG_DOUBLE(class, "ringwidth", 20, ++ _("Ringwidth"), ++ _("Ringwidth"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaskIdealRing, ringwidth ), +- 0.0, 1000000.0, 0.5 ); +- ++ G_STRUCT_OFFSET(VipsMaskIdealRing, ringwidth), ++ 0.0, 1000000.0, 0.5); + } + + static void +-vips_mask_ideal_ring_init( VipsMaskIdealRing *ideal_ring ) ++vips_mask_ideal_ring_init(VipsMaskIdealRing *ideal_ring) + { + ideal_ring->ringwidth = 0.5; + } +@@ -125,25 +124,25 @@ vips_mask_ideal_ring_init( VipsMaskIdealRing *ideal_ring ) + * * @optical: coordinates in optical space + * * @uchar: output a uchar image + * +- * Make an ideal ring-pass or ring-reject filter, that is, one with a sharp +- * ring positioned at @frequency_cutoff of width @width, where ++ * Make an ideal ring-pass or ring-reject filter, that is, one with a sharp ++ * ring positioned at @frequency_cutoff of width @width, where + * @frequency_cutoff and @width are expressed as the range 0 - 1. + * +- * See also: vips_mask_ideal(). ++ * See also: vips_mask_ideal(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_mask_ideal_ring( VipsImage **out, int width, int height, +- double frequency_cutoff, double ringwidth, ... ) ++vips_mask_ideal_ring(VipsImage **out, int width, int height, ++ double frequency_cutoff, double ringwidth, ...) + { + va_list ap; + int result; + +- va_start( ap, ringwidth ); +- result = vips_call_split( "mask_ideal_ring", ap, out, width, height, +- frequency_cutoff, ringwidth ); +- va_end( ap ); ++ va_start(ap, ringwidth); ++ result = vips_call_split("mask_ideal_ring", ap, out, width, height, ++ frequency_cutoff, ringwidth); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/pcreate.h b/libvips/create/pcreate.h +index 05df4a9205..c9409c4e82 100644 +--- a/libvips/create/pcreate.h ++++ b/libvips/create/pcreate.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -36,19 +36,19 @@ extern "C" { + #endif /*__cplusplus*/ + + #define VIPS_TYPE_CREATE (vips_create_get_type()) +-#define VIPS_CREATE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_CREATE, VipsCreate )) +-#define VIPS_CREATE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_CREATE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_CREATE, VipsCreate)) ++#define VIPS_CREATE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_CREATE, VipsCreateClass)) ++#define VIPS_IS_CREATE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_CREATE)) ++#define VIPS_IS_CREATE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_CREATE)) ++#define VIPS_CREATE_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_CREATE, VipsCreateClass)) +-#define VIPS_IS_CREATE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_CREATE )) +-#define VIPS_IS_CREATE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_CREATE )) +-#define VIPS_CREATE_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_CREATE, VipsCreateClass )) + + typedef struct _VipsCreate { + VipsOperation parent_instance; +@@ -64,12 +64,10 @@ typedef struct _VipsCreateClass { + + } VipsCreateClass; + +-GType vips_create_get_type( void ); ++GType vips_create_get_type(void); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_PCREATE_H*/ +- +- +diff --git a/libvips/create/perlin.c b/libvips/create/perlin.c +index ccd8920bb1..c08c2b68cd 100644 +--- a/libvips/create/perlin.c ++++ b/libvips/create/perlin.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -69,7 +69,7 @@ typedef struct _VipsPerlinClass { + + } VipsPerlinClass; + +-G_DEFINE_TYPE( VipsPerlin, vips_perlin, VIPS_TYPE_CREATE ); ++G_DEFINE_TYPE(VipsPerlin, vips_perlin, VIPS_TYPE_CREATE); + + /* cos and sin from an angle in 0 - 255. + */ +@@ -92,16 +92,16 @@ typedef struct _Sequence { + + } Sequence; + +-/* Generate a 3 x 3 grid of cells around a point. ++/* Generate a 3 x 3 grid of cells around a point. + */ + static void +-vips_perlin_create_cells( VipsPerlin *perlin, +- float gx[4], float gy[4], int cell_x, int cell_y ) ++vips_perlin_create_cells(VipsPerlin *perlin, ++ float gx[4], float gy[4], int cell_x, int cell_y) + { + int x, y; + +- for( y = 0; y < 2; y++ ) +- for( x = 0; x < 2; x++ ) { ++ for (y = 0; y < 2; y++) ++ for (x = 0; x < 2; x++) { + int ci = x + y * 2; + + guint32 seed; +@@ -118,13 +118,13 @@ vips_perlin_create_cells( VipsPerlin *perlin, + * around so that our output will tesselate. + */ + +- if( cy >= perlin->cells_down ) ++ if (cy >= perlin->cells_down) + cy = 0; +- seed = vips__random_add( seed, cy ); ++ seed = vips__random_add(seed, cy); + +- if( cx >= perlin->cells_across ) ++ if (cx >= perlin->cells_across) + cx = 0; +- seed = vips__random_add( seed, cx ); ++ seed = vips__random_add(seed, cx); + + angle = (seed ^ (seed >> 8) ^ (seed >> 16)) & 0xff; + +@@ -134,74 +134,74 @@ vips_perlin_create_cells( VipsPerlin *perlin, + } + + static int +-vips_perlin_stop( void *vseq, void *a, void *b ) ++vips_perlin_stop(void *vseq, void *a, void *b) + { + Sequence *seq = (Sequence *) vseq; + +- VIPS_FREE( seq ); ++ VIPS_FREE(seq); + +- return( 0 ); ++ return (0); + } + + static void * +-vips_perlin_start( VipsImage *out, void *a, void *b ) ++vips_perlin_start(VipsImage *out, void *a, void *b) + { + VipsPerlin *perlin = (VipsPerlin *) b; + + Sequence *seq; + +- if( !(seq = VIPS_NEW( NULL, Sequence )) ) +- return( NULL ); ++ if (!(seq = VIPS_NEW(NULL, Sequence))) ++ return (NULL); + + seq->perlin = perlin; + seq->cell_x = -1; + seq->cell_y = -1; + +- return( seq ); ++ return (seq); + } + + /* Smooth linear interpolation, 0 <= x <= 1. + * + * https://en.wikipedia.org/wiki/Smoothstep + */ +-static float +-smootherstep( float x ) ++static float ++smootherstep(float x) + { +- return( x * x * x * (x * (x * 6 - 15) + 10) ); ++ return (x * x * x * (x * (x * 6 - 15) + 10)); + } + + static int +-vips_perlin_gen( VipsRegion *or, void *vseq, void *a, void *b, +- gboolean *stop ) ++vips_perlin_gen(VipsRegion * or, void *vseq, void *a, void *b, ++ gboolean *stop) + { + VipsPerlin *perlin = (VipsPerlin *) a; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + Sequence *seq = (Sequence *) vseq; + + int x, y; + +- for( y = 0; y < r->height; y++ ) { +- float *fq = (float *) +- VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ float *fq = (float *) ++ VIPS_REGION_ADDR(or, r->left, r->top + y); + VipsPel *q = (VipsPel *) fq; + +- for( x = 0; x < r->width; x++ ) { ++ for (x = 0; x < r->width; x++) { + int cs = perlin->cell_size; + int cell_x = (r->left + x) / cs; + int cell_y = (r->top + y) / cs; + float dx = (x + r->left - cell_x * cs) / (float) cs; + float dy = (y + r->top - cell_y * cs) / (float) cs; +- float sx = smootherstep( dx ); +- float sy = smootherstep( dy ); ++ float sx = smootherstep(dx); ++ float sy = smootherstep(dy); + + float n0, n1; + float ix0, ix1; + float p; + +- if( cell_x != seq->cell_x || +- cell_y != seq->cell_y ) { +- vips_perlin_create_cells( perlin, +- seq->gx, seq->gy, cell_x, cell_y ); ++ if (cell_x != seq->cell_x || ++ cell_y != seq->cell_y) { ++ vips_perlin_create_cells(perlin, ++ seq->gx, seq->gy, cell_x, cell_y); + seq->cell_x = cell_x; + seq->cell_y = cell_y; + } +@@ -216,119 +216,118 @@ vips_perlin_gen( VipsRegion *or, void *vseq, void *a, void *b, + + p = ix0 + sy * (ix1 - ix0); + +- if( perlin->uchar ) ++ if (perlin->uchar) + q[x] = 128 * p + 128; + else + fq[x] = p; + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_perlin_build( VipsObject *object ) ++vips_perlin_build(VipsObject *object) + { +- VipsCreate *create = VIPS_CREATE( object ); ++ VipsCreate *create = VIPS_CREATE(object); + VipsPerlin *perlin = (VipsPerlin *) object; + +- if( VIPS_OBJECT_CLASS( vips_perlin_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_perlin_parent_class)->build(object)) ++ return (-1); + + /* Be careful if width is a multiple of cell_size. + */ +- perlin->cells_across = +- VIPS_ROUND_UP( perlin->width, perlin->cell_size ) / ++ perlin->cells_across = ++ VIPS_ROUND_UP(perlin->width, perlin->cell_size) / + perlin->cell_size; +- perlin->cells_down = +- VIPS_ROUND_UP( perlin->height, perlin->cell_size ) / ++ perlin->cells_down = ++ VIPS_ROUND_UP(perlin->height, perlin->cell_size) / + perlin->cell_size; + +- vips_image_init_fields( create->out, ++ vips_image_init_fields(create->out, + perlin->width, perlin->height, 1, +- perlin->uchar ? VIPS_FORMAT_UCHAR : VIPS_FORMAT_FLOAT, ++ perlin->uchar ? VIPS_FORMAT_UCHAR : VIPS_FORMAT_FLOAT, + VIPS_CODING_NONE, VIPS_INTERPRETATION_MULTIBAND, +- 1.0, 1.0 ); +- if( vips_image_pipelinev( create->out, VIPS_DEMAND_STYLE_ANY, NULL ) || +- vips_image_generate( create->out, +- vips_perlin_start, vips_perlin_gen, vips_perlin_stop, +- perlin, NULL ) ) +- return( -1 ); +- +- return( 0 ); ++ 1.0, 1.0); ++ if (vips_image_pipelinev(create->out, VIPS_DEMAND_STYLE_ANY, NULL) || ++ vips_image_generate(create->out, ++ vips_perlin_start, vips_perlin_gen, vips_perlin_stop, ++ perlin, NULL)) ++ return (-1); ++ ++ return (0); + } + + static void * +-vips_perlin_make_tables( void *client ) ++vips_perlin_make_tables(void *client) + { + int i; + +- for( i = 0; i < 256; i++ ) { ++ for (i = 0; i < 256; i++) { + double angle = 2 * VIPS_PI * i / 256.0; + +- vips_perlin_cos[i] = cos( angle ); +- vips_perlin_sin[i] = sin( angle ); ++ vips_perlin_cos[i] = cos(angle); ++ vips_perlin_sin[i] = sin(angle); + } + +- return( NULL ); ++ return (NULL); + } + + static void +-vips_perlin_class_init( VipsPerlinClass *class ) ++vips_perlin_class_init(VipsPerlinClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + static GOnce once = G_ONCE_INIT; + +- VIPS_ONCE( &once, vips_perlin_make_tables, NULL ); ++ VIPS_ONCE(&once, vips_perlin_make_tables, NULL); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "perlin"; +- vobject_class->description = _( "make a perlin noise image" ); ++ vobject_class->description = _("make a perlin noise image"); + vobject_class->build = vips_perlin_build; + +- VIPS_ARG_INT( class, "width", 2, +- _( "Width" ), +- _( "Image width in pixels" ), ++ VIPS_ARG_INT(class, "width", 2, ++ _("Width"), ++ _("Image width in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsPerlin, width ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsPerlin, width), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "height", 3, +- _( "Height" ), +- _( "Image height in pixels" ), ++ VIPS_ARG_INT(class, "height", 3, ++ _("Height"), ++ _("Image height in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsPerlin, height ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsPerlin, height), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "cell_size", 3, +- _( "Cell size" ), +- _( "Size of Perlin cells" ), ++ VIPS_ARG_INT(class, "cell_size", 3, ++ _("Cell size"), ++ _("Size of Perlin cells"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsPerlin, cell_size ), +- 1, VIPS_MAX_COORD, 256 ); ++ G_STRUCT_OFFSET(VipsPerlin, cell_size), ++ 1, VIPS_MAX_COORD, 256); + +- VIPS_ARG_BOOL( class, "uchar", 4, +- _( "Uchar" ), +- _( "Output an unsigned char image" ), ++ VIPS_ARG_BOOL(class, "uchar", 4, ++ _("Uchar"), ++ _("Output an unsigned char image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsPerlin, uchar ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsPerlin, uchar), ++ FALSE); + +- VIPS_ARG_INT( class, "seed", 5, +- _( "Seed" ), +- _( "Random number seed" ), ++ VIPS_ARG_INT(class, "seed", 5, ++ _("Seed"), ++ _("Random number seed"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsPerlin, seed ), +- INT_MIN, INT_MAX, 0 ); +- ++ G_STRUCT_OFFSET(VipsPerlin, seed), ++ INT_MIN, INT_MAX, 0); + } + + static void +-vips_perlin_init( VipsPerlin *perlin ) ++vips_perlin_init(VipsPerlin *perlin) + { + perlin->cell_size = 256; + perlin->seed = UINT_MAX * g_random_double(); +@@ -355,23 +354,22 @@ vips_perlin_init( VipsPerlin *perlin ) + * + * If @width and @height are multiples of @cell_size, the image will tessellate. + * +- * Normally, output pixels are #VIPS_FORMAT_FLOAT in the range [-1, +1]. Set +- * @uchar to output a uchar image with pixels in [0, 255]. ++ * Normally, output pixels are #VIPS_FORMAT_FLOAT in the range [-1, +1]. Set ++ * @uchar to output a uchar image with pixels in [0, 255]. + * + * See also: vips_worley(), vips_fractsurf(), vips_gaussnoise(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_perlin( VipsImage **out, int width, int height, ... ) ++vips_perlin(VipsImage **out, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "perlin", ap, out, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("perlin", ap, out, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/create/pmask.h b/libvips/create/pmask.h +index 4171c9ebd9..9ea1bd1df2 100644 +--- a/libvips/create/pmask.h ++++ b/libvips/create/pmask.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -42,19 +42,19 @@ extern "C" { + #endif /*VIPS_MASK*/ + + #define VIPS_TYPE_MASK (vips_mask_get_type()) +-#define VIPS_MASK( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_MASK, VipsMask )) +-#define VIPS_MASK_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_MASK(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_MASK, VipsMask)) ++#define VIPS_MASK_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_MASK, VipsMaskClass)) ++#define VIPS_IS_MASK(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_MASK)) ++#define VIPS_IS_MASK_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_MASK)) ++#define VIPS_MASK_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_MASK, VipsMaskClass)) +-#define VIPS_IS_MASK( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_MASK )) +-#define VIPS_IS_MASK_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_MASK )) +-#define VIPS_MASK_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_MASK, VipsMaskClass )) + + typedef struct _VipsMask { + VipsPoint parent_instance; +@@ -68,26 +68,26 @@ typedef struct _VipsMask { + typedef struct _VipsMaskClass { + VipsPointClass parent_class; + +- double (*point)( VipsMask *, double, double ); ++ double (*point)(VipsMask *, double, double); + + } VipsMaskClass; + +-GType vips_mask_get_type( void ); ++GType vips_mask_get_type(void); + + #define VIPS_TYPE_MASK_IDEAL (vips_mask_ideal_get_type()) +-#define VIPS_MASK_IDEAL( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_MASK_IDEAL, VipsMaskIdeal )) +-#define VIPS_MASK_IDEAL_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_MASK_IDEAL(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_MASK_IDEAL, VipsMaskIdeal)) ++#define VIPS_MASK_IDEAL_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_MASK_IDEAL, VipsMaskIdealClass)) ++#define VIPS_IS_MASK_IDEAL(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_MASK_IDEAL)) ++#define VIPS_IS_MASK_IDEAL_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_MASK_IDEAL)) ++#define VIPS_MASK_IDEAL_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_MASK_IDEAL, VipsMaskIdealClass)) +-#define VIPS_IS_MASK_IDEAL( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_MASK_IDEAL )) +-#define VIPS_IS_MASK_IDEAL_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_MASK_IDEAL )) +-#define VIPS_MASK_IDEAL_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_MASK_IDEAL, VipsMaskIdealClass )) + + typedef struct _VipsMaskIdeal { + VipsMask parent_instance; +@@ -98,22 +98,22 @@ typedef struct _VipsMaskIdeal { + + typedef VipsMaskClass VipsMaskIdealClass; + +-GType vips_mask_ideal_get_type( void ); ++GType vips_mask_ideal_get_type(void); + + #define VIPS_TYPE_MASK_BUTTERWORTH (vips_mask_butterworth_get_type()) +-#define VIPS_MASK_BUTTERWORTH( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_MASK_BUTTERWORTH, VipsMaskButterworth )) +-#define VIPS_MASK_BUTTERWORTH_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_MASK_BUTTERWORTH(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_MASK_BUTTERWORTH, VipsMaskButterworth)) ++#define VIPS_MASK_BUTTERWORTH_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_MASK_BUTTERWORTH, VipsMaskButterworthClass)) ++#define VIPS_IS_MASK_BUTTERWORTH(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_MASK_BUTTERWORTH)) ++#define VIPS_IS_MASK_BUTTERWORTH_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_MASK_BUTTERWORTH)) ++#define VIPS_MASK_BUTTERWORTH_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_MASK_BUTTERWORTH, VipsMaskButterworthClass)) +-#define VIPS_IS_MASK_BUTTERWORTH( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_MASK_BUTTERWORTH )) +-#define VIPS_IS_MASK_BUTTERWORTH_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_MASK_BUTTERWORTH )) +-#define VIPS_MASK_BUTTERWORTH_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_MASK_BUTTERWORTH, VipsMaskButterworthClass )) + + typedef struct _VipsMaskButterworth { + VipsMask parent_instance; +@@ -126,22 +126,22 @@ typedef struct _VipsMaskButterworth { + + typedef VipsMaskClass VipsMaskButterworthClass; + +-GType vips_mask_butterworth_get_type( void ); ++GType vips_mask_butterworth_get_type(void); + + #define VIPS_TYPE_MASK_GAUSSIAN (vips_mask_gaussian_get_type()) +-#define VIPS_MASK_GAUSSIAN( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_MASK_GAUSSIAN, VipsMaskGaussian )) +-#define VIPS_MASK_GAUSSIAN_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_MASK_GAUSSIAN(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_MASK_GAUSSIAN, VipsMaskGaussian)) ++#define VIPS_MASK_GAUSSIAN_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_MASK_GAUSSIAN, VipsMaskGaussianClass)) ++#define VIPS_IS_MASK_GAUSSIAN(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_MASK_GAUSSIAN)) ++#define VIPS_IS_MASK_GAUSSIAN_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_MASK_GAUSSIAN)) ++#define VIPS_MASK_GAUSSIAN_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_MASK_GAUSSIAN, VipsMaskGaussianClass)) +-#define VIPS_IS_MASK_GAUSSIAN( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_MASK_GAUSSIAN )) +-#define VIPS_IS_MASK_GAUSSIAN_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_MASK_GAUSSIAN )) +-#define VIPS_MASK_GAUSSIAN_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_MASK_GAUSSIAN, VipsMaskGaussianClass )) + + typedef struct _VipsMaskGaussian { + VipsMask parent_instance; +@@ -153,7 +153,7 @@ typedef struct _VipsMaskGaussian { + + typedef VipsMaskClass VipsMaskGaussianClass; + +-GType vips_mask_gaussian_get_type( void ); ++GType vips_mask_gaussian_get_type(void); + + #ifdef __cplusplus + } +diff --git a/libvips/create/point.c b/libvips/create/point.c +index 31f68c6aea..c5e25a0b3e 100644 +--- a/libvips/create/point.c ++++ b/libvips/create/point.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -49,63 +49,63 @@ + #include "pcreate.h" + #include "point.h" + +-G_DEFINE_ABSTRACT_TYPE( VipsPoint, vips_point, VIPS_TYPE_CREATE ); ++G_DEFINE_ABSTRACT_TYPE(VipsPoint, vips_point, VIPS_TYPE_CREATE); + + static int +-vips_point_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++vips_point_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + VipsPoint *point = (VipsPoint *) a; +- VipsPointClass *class = VIPS_POINT_GET_CLASS( point ); +- VipsRect *r = &or->valid; ++ VipsPointClass *class = VIPS_POINT_GET_CLASS(point); ++ VipsRect *r = & or->valid; + + int x, y; + +- for( y = 0; y < r->height; y++ ) { ++ for (y = 0; y < r->height; y++) { + int ay = r->top + y; +- float *q = (float *) VIPS_REGION_ADDR( or, r->left, ay ); ++ float *q = (float *) VIPS_REGION_ADDR(or, r->left, ay); + +- for( x = 0; x < r->width; x++ ) +- q[x] = class->point( point, r->left + x, ay ); ++ for (x = 0; x < r->width; x++) ++ q[x] = class->point(point, r->left + x, ay); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_point_build( VipsObject *object ) ++vips_point_build(VipsObject *object) + { +- VipsCreate *create = VIPS_CREATE( object ); +- VipsPoint *point = VIPS_POINT( object ); +- VipsPointClass *class = VIPS_POINT_GET_CLASS( point ); +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); ++ VipsCreate *create = VIPS_CREATE(object); ++ VipsPoint *point = VIPS_POINT(object); ++ VipsPointClass *class = VIPS_POINT_GET_CLASS(point); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_point_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_point_parent_class)->build(object)) ++ return (-1); + + t[0] = vips_image_new(); +- vips_image_init_fields( t[0], ++ vips_image_init_fields(t[0], + point->width, point->height, 1, + VIPS_FORMAT_FLOAT, VIPS_CODING_NONE, class->interpretation, +- 1.0, 1.0 ); +- if( vips_image_pipelinev( t[0], VIPS_DEMAND_STYLE_ANY, NULL ) || +- vips_image_generate( t[0], +- NULL, vips_point_gen, NULL, point, NULL ) ) +- return( -1 ); ++ 1.0, 1.0); ++ if (vips_image_pipelinev(t[0], VIPS_DEMAND_STYLE_ANY, NULL) || ++ vips_image_generate(t[0], ++ NULL, vips_point_gen, NULL, point, NULL)) ++ return (-1); + in = t[0]; + +- if( point->uchar ) { ++ if (point->uchar) { + float min = class->min; + float max = class->max; + float range = max - min; + +- if( vips_linear1( in, &t[2], +- 255.0 / range, -min * 255.0 / range, +- "uchar", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_linear1(in, &t[2], ++ 255.0 / range, -min * 255.0 / range, ++ "uchar", TRUE, ++ NULL)) ++ return (-1); + in = t[2]; + + /* We don't want FOURIER or whatever in this case. +@@ -113,55 +113,53 @@ vips_point_build( VipsObject *object ) + in->Type = VIPS_INTERPRETATION_MULTIBAND; + } + +- if( vips_image_write( in, create->out ) ) +- return( -1 ); ++ if (vips_image_write(in, create->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_point_class_init( VipsPointClass *class ) ++vips_point_class_init(VipsPointClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "point"; +- vobject_class->description = _( "make a point image" ); ++ vobject_class->description = _("make a point image"); + vobject_class->build = vips_point_build; + +- class->point = NULL; +- class->min = -1.0; +- class->max = 1.0; ++ class->point = NULL; ++ class->min = -1.0; ++ class->max = 1.0; + class->interpretation = VIPS_INTERPRETATION_MULTIBAND; + +- VIPS_ARG_INT( class, "width", 2, +- _( "Width" ), +- _( "Image width in pixels" ), ++ VIPS_ARG_INT(class, "width", 2, ++ _("Width"), ++ _("Image width in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsPoint, width ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsPoint, width), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "height", 3, +- _( "Height" ), +- _( "Image height in pixels" ), ++ VIPS_ARG_INT(class, "height", 3, ++ _("Height"), ++ _("Image height in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsPoint, height ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsPoint, height), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_BOOL( class, "uchar", 4, +- _( "Uchar" ), +- _( "Output an unsigned char image" ), ++ VIPS_ARG_BOOL(class, "uchar", 4, ++ _("Uchar"), ++ _("Output an unsigned char image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsPoint, uchar ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsPoint, uchar), ++ FALSE); + } + + static void +-vips_point_init( VipsPoint *point ) ++vips_point_init(VipsPoint *point) + { + } +- +diff --git a/libvips/create/point.h b/libvips/create/point.h +index c4635bda74..c989f0ffca 100644 +--- a/libvips/create/point.h ++++ b/libvips/create/point.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -36,19 +36,19 @@ extern "C" { + #endif /*__cplusplus*/ + + #define VIPS_TYPE_POINT (vips_point_get_type()) +-#define VIPS_POINT( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_POINT, VipsPoint )) +-#define VIPS_POINT_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_POINT(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_POINT, VipsPoint)) ++#define VIPS_POINT_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_POINT, VipsPointClass)) ++#define VIPS_IS_POINT(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_POINT)) ++#define VIPS_IS_POINT_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_POINT)) ++#define VIPS_POINT_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_POINT, VipsPointClass)) +-#define VIPS_IS_POINT( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_POINT )) +-#define VIPS_IS_POINT_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_POINT )) +-#define VIPS_POINT_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_POINT, VipsPointClass )) + + typedef struct _VipsPoint { + VipsCreate parent_instance; +@@ -63,14 +63,14 @@ typedef struct _VipsPoint { + typedef struct _VipsPointClass { + VipsCreateClass parent_class; + +- float (*point)( VipsPoint *, int, int ); ++ float (*point)(VipsPoint *, int, int); + float min; + float max; +- VipsInterpretation interpretation; ++ VipsInterpretation interpretation; + + } VipsPointClass; + +-GType vips_point_get_type( void ); ++GType vips_point_get_type(void); + + #ifdef __cplusplus + } +diff --git a/libvips/create/sines.c b/libvips/create/sines.c +index 80833ef940..dca6484e1f 100644 +--- a/libvips/create/sines.c ++++ b/libvips/create/sines.c +@@ -1,4 +1,4 @@ +-/* creates a 2d sinewave ++/* creates a 2d sinewave + * + * Copyright: 1990, N. Dessipris. + * +@@ -16,28 +16,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -74,72 +74,71 @@ typedef struct _VipsSines { + + typedef VipsPointClass VipsSinesClass; + +-G_DEFINE_TYPE( VipsSines, vips_sines, VIPS_TYPE_POINT ); ++G_DEFINE_TYPE(VipsSines, vips_sines, VIPS_TYPE_POINT); + + static float +-vips_sines_point( VipsPoint *point, int x, int y ) ++vips_sines_point(VipsPoint *point, int x, int y) + { + VipsSines *sines = (VipsSines *) point; + +- return( cos( sines->c * (x * sines->costheta - y * sines->sintheta) ) ); ++ return (cos(sines->c * (x * sines->costheta - y * sines->sintheta))); + } + + static int +-vips_sines_build( VipsObject *object ) ++vips_sines_build(VipsObject *object) + { +- VipsPoint *point = VIPS_POINT( object ); ++ VipsPoint *point = VIPS_POINT(object); + VipsSines *sines = (VipsSines *) object; + + double theta; + double factor; + +- if( VIPS_OBJECT_CLASS( vips_sines_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_sines_parent_class)->build(object)) ++ return (-1); + +- theta = sines->hfreq == 0.0 ? +- VIPS_PI / 2.0 : atan( sines->vfreq / sines->hfreq ); +- factor = sqrt( sines->hfreq * sines->hfreq + +- sines->vfreq * sines->vfreq ); +- sines->costheta = cos( theta ); +- sines->sintheta = sin( theta ); ++ theta = sines->hfreq == 0.0 ? VIPS_PI / 2.0 : atan(sines->vfreq / sines->hfreq); ++ factor = sqrt(sines->hfreq * sines->hfreq + ++ sines->vfreq * sines->vfreq); ++ sines->costheta = cos(theta); ++ sines->sintheta = sin(theta); + sines->c = factor * VIPS_PI * 2.0 / point->width; + +- return( 0 ); ++ return (0); + } + + static void +-vips_sines_class_init( VipsSinesClass *class ) ++vips_sines_class_init(VipsSinesClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsPointClass *point_class = VIPS_POINT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsPointClass *point_class = VIPS_POINT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "sines"; +- vobject_class->description = _( "make a 2D sine wave" ); ++ vobject_class->description = _("make a 2D sine wave"); + vobject_class->build = vips_sines_build; + + point_class->point = vips_sines_point; + +- VIPS_ARG_DOUBLE( class, "hfreq", 6, +- _( "hfreq" ), +- _( "Horizontal spatial frequency" ), ++ VIPS_ARG_DOUBLE(class, "hfreq", 6, ++ _("hfreq"), ++ _("Horizontal spatial frequency"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSines, hfreq ), +- 0.0, 10000.0, 0.5 ); ++ G_STRUCT_OFFSET(VipsSines, hfreq), ++ 0.0, 10000.0, 0.5); + +- VIPS_ARG_DOUBLE( class, "vfreq", 7, +- _( "vfreq" ), +- _( "Vertical spatial frequency" ), ++ VIPS_ARG_DOUBLE(class, "vfreq", 7, ++ _("vfreq"), ++ _("Vertical spatial frequency"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSines, vfreq ), +- 0.0, 10000.0, 0.5 ); ++ G_STRUCT_OFFSET(VipsSines, vfreq), ++ 0.0, 10000.0, 0.5); + } + + static void +-vips_sines_init( VipsSines *sines ) ++vips_sines_init(VipsSines *sines) + { + sines->hfreq = 0.5; + sines->vfreq = 0.5; +@@ -159,7 +158,7 @@ vips_sines_init( VipsSines *sines ) + * * @uchar: output a uchar image + * + * Creates a float one band image of the a sine waveform in two +- * dimensions. ++ * dimensions. + * + * The number of horizontal and vertical spatial frequencies are + * determined by the variables @hfreq and @vfreq respectively. The +@@ -169,21 +168,21 @@ vips_sines_init( VipsSines *sines ) + * If horfreq and verfreq are integers the resultant image is periodical + * and therfore the Fourier transform does not present spikes + * +- * Pixels are normally in [-1, +1], set @uchar to output [0, 255]. +- * +- * See also: vips_grey(), vips_xyz(). ++ * Pixels are normally in [-1, +1], set @uchar to output [0, 255]. ++ * ++ * See also: vips_grey(), vips_xyz(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_sines( VipsImage **out, int width, int height, ... ) ++vips_sines(VipsImage **out, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "sines", ap, out, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("sines", ap, out, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/text.c b/libvips/create/text.c +index 9157c71a97..1bd2991598 100644 +--- a/libvips/create/text.c ++++ b/libvips/create/text.c +@@ -12,17 +12,17 @@ + * - gtkdoc + * 3/6/13 + * - rewrite as a class +- * 20/9/15 leiyangyou +- * - add @spacing ++ * 20/9/15 leiyangyou ++ * - add @spacing + * 29/5/17 + * - don't set "font" if unset, it breaks caching + * 16/7/17 gargsms + * - implement auto fitting of text inside bounds + * 12/3/18 +- * - better fitting of fonts with overhanging edges, thanks Adrià +- * 26/4/18 fangqiao ++ * - better fitting of fonts with overhanging edges, thanks Adrià ++ * 26/4/18 fangqiao + * - add fontfile option +- * 5/12/18 ++ * 5/12/18 + * - fitting mode could set wrong dpi + * - fitting mode leaked + * 16/3/19 +@@ -41,28 +41,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -117,11 +117,11 @@ typedef struct _VipsText { + + typedef VipsCreateClass VipsTextClass; + +-G_DEFINE_TYPE( VipsText, vips_text, VIPS_TYPE_CREATE ); ++G_DEFINE_TYPE(VipsText, vips_text, VIPS_TYPE_CREATE); + + /* ... single-thread vips_text_fontfiles with this. + */ +-static GMutex *vips_text_lock = NULL; ++static GMutex *vips_text_lock = NULL; + + /* All the fontfiles we've loaded. fontconfig lets you add a fontfile + * repeatedly, and we obviously don't want that. +@@ -129,20 +129,20 @@ static GMutex *vips_text_lock = NULL; + static GHashTable *vips_text_fontfiles = NULL; + + static void +-vips_text_dispose( GObject *gobject ) ++vips_text_dispose(GObject *gobject) + { + VipsText *text = (VipsText *) gobject; + +- VIPS_UNREF( text->layout ); +- VIPS_UNREF( text->context ); ++ VIPS_UNREF(text->layout); ++ VIPS_UNREF(text->context); + +- G_OBJECT_CLASS( vips_text_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_text_parent_class)->dispose(gobject); + } + + static PangoLayout * +-text_layout_new( PangoContext *context, ++text_layout_new(PangoContext *context, + const char *text, const char *font, int width, int spacing, +- VipsAlign align, VipsTextWrap wrap, gboolean justify ) ++ VipsAlign align, VipsTextWrap wrap, gboolean justify) + { + PangoLayout *layout; + PangoFontDescription *font_description; +@@ -150,18 +150,18 @@ text_layout_new( PangoContext *context, + PangoWrapMode pwrap; + int pwidth; + +- layout = pango_layout_new( context ); +- pango_layout_set_markup( layout, text, -1 ); ++ layout = pango_layout_new(context); ++ pango_layout_set_markup(layout, text, -1); + +- font_description = pango_font_description_from_string( font ); +- pango_layout_set_font_description( layout, font_description ); +- pango_font_description_free( font_description ); +- pango_layout_set_justify( layout, justify ); ++ font_description = pango_font_description_from_string(font); ++ pango_layout_set_font_description(layout, font_description); ++ pango_font_description_free(font_description); ++ pango_layout_set_justify(layout, justify); + +- if( spacing > 0 ) +- pango_layout_set_spacing( layout, spacing * PANGO_SCALE ); ++ if (spacing > 0) ++ pango_layout_set_spacing(layout, spacing * PANGO_SCALE); + +- switch( align ) { ++ switch (align) { + case VIPS_ALIGN_LOW: + palign = PANGO_ALIGN_LEFT; + break; +@@ -178,9 +178,9 @@ text_layout_new( PangoContext *context, + palign = PANGO_ALIGN_LEFT; + break; + } +- pango_layout_set_alignment( layout, palign ); ++ pango_layout_set_alignment(layout, palign); + +- switch( wrap ) { ++ switch (wrap) { + case VIPS_TEXT_WRAP_NONE: + pwrap = PANGO_WRAP_WORD_CHAR; + pwidth = -1; +@@ -203,64 +203,64 @@ text_layout_new( PangoContext *context, + break; + } + +- pango_layout_set_wrap( layout, pwrap ); ++ pango_layout_set_wrap(layout, pwrap); + +- if( pwidth > 0 ) +- pango_layout_set_width( layout, width * PANGO_SCALE ); ++ if (pwidth > 0) ++ pango_layout_set_width(layout, width * PANGO_SCALE); + +- return( layout ); ++ return (layout); + } + + static int +-vips_text_get_extents( VipsText *text, VipsRect *extents ) ++vips_text_get_extents(VipsText *text, VipsRect *extents) + { + PangoRectangle ink_rect; + PangoRectangle logical_rect; + +- pango_cairo_font_map_set_resolution( +- PANGO_CAIRO_FONT_MAP( text->fontmap ), text->dpi ); ++ pango_cairo_font_map_set_resolution( ++ PANGO_CAIRO_FONT_MAP(text->fontmap), text->dpi); + +- VIPS_UNREF( text->layout ); +- if( !(text->layout = text_layout_new( text->context, +- text->text, text->font, +- text->width, text->spacing, text->align, text->wrap, +- text->justify )) ) +- return( -1 ); ++ VIPS_UNREF(text->layout); ++ if (!(text->layout = text_layout_new(text->context, ++ text->text, text->font, ++ text->width, text->spacing, text->align, text->wrap, ++ text->justify))) ++ return (-1); + +- pango_layout_get_pixel_extents( text->layout, +- &ink_rect, &logical_rect ); ++ pango_layout_get_pixel_extents(text->layout, ++ &ink_rect, &logical_rect); + extents->left = ink_rect.x; + extents->top = ink_rect.y; + extents->width = ink_rect.width; + extents->height = ink_rect.height; + + #ifdef DEBUG +- printf( "vips_text_get_extents: dpi = %d\n", text->dpi ); +- printf( " ink left = %d, top = %d, width = %d, height = %d\n", +- ink_rect.x, ink_rect.y, ink_rect.width, ink_rect.height ); +- printf( " logical left = %d, top = %d, width = %d, height = %d\n", +- logical_rect.x, logical_rect.y, +- logical_rect.width, logical_rect.height ); ++ printf("vips_text_get_extents: dpi = %d\n", text->dpi); ++ printf(" ink left = %d, top = %d, width = %d, height = %d\n", ++ ink_rect.x, ink_rect.y, ink_rect.width, ink_rect.height); ++ printf(" logical left = %d, top = %d, width = %d, height = %d\n", ++ logical_rect.x, logical_rect.y, ++ logical_rect.width, logical_rect.height); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + /* Return -ve for extents too small, +ve for extents too large. + */ + static int +-vips_text_rect_difference( VipsRect *target, VipsRect *extents ) ++vips_text_rect_difference(VipsRect *target, VipsRect *extents) + { +- if( vips_rect_includesrect( target, extents ) ) +- return( -1 ); ++ if (vips_rect_includesrect(target, extents)) ++ return (-1); + else +- return( 1 ); ++ return (1); + } + + /* Adjust text->dpi to try to fit to the bounding box. + */ + static int +-vips_text_autofit( VipsText *text ) ++vips_text_autofit(VipsText *text) + { + VipsRect target; + VipsRect extents; +@@ -282,26 +282,26 @@ vips_text_autofit( VipsText *text ) + previous_difference = 0; + + #ifdef DEBUG +- printf( "vips_text_autofit: " +- "target left = %d, top = %d, width = %d, height = %d\n", +- target.left, target.top, target.width, target.height ); ++ printf("vips_text_autofit: " ++ "target left = %d, top = %d, width = %d, height = %d\n", ++ target.left, target.top, target.width, target.height); + #endif /*DEBUG*/ + +- for(;;) { +- if( vips_text_get_extents( text, &extents ) ) +- return( -1 ); ++ for (;;) { ++ if (vips_text_get_extents(text, &extents)) ++ return (-1); + target.left = extents.left; + target.top = extents.top; +- difference = vips_text_rect_difference( &target, &extents ); ++ difference = vips_text_rect_difference(&target, &extents); + +- if( previous_dpi == -1 ) { ++ if (previous_dpi == -1) { + previous_dpi = text->dpi; + previous_difference = difference; + } + + /* Stop if we straddle the target. + */ +- if( difference != previous_difference ) ++ if (difference != previous_difference) + break; + + previous_difference = difference; +@@ -311,12 +311,12 @@ vips_text_autofit( VipsText *text ) + + /* This can happen with fixed-size fonts. + */ +- if( text->dpi < 2 || +- text->dpi > 10000 ) ++ if (text->dpi < 2 || ++ text->dpi > 10000) + break; + } + +- if( difference < 0 ) { ++ if (difference < 0) { + /* We've been coming down. + */ + lower_dpi = text->dpi; +@@ -328,22 +328,22 @@ vips_text_autofit( VipsText *text ) + } + + #ifdef DEBUG +- printf( "vips_text_autofit: lower dpi = %d, upper dpi = %d\n", +- lower_dpi, upper_dpi ); ++ printf("vips_text_autofit: lower dpi = %d, upper dpi = %d\n", ++ lower_dpi, upper_dpi); + #endif /*DEBUG*/ + + /* Refine lower and upper until they are almost touching. + */ +- while( upper_dpi - lower_dpi > 1 && +- difference != 0 ) { ++ while (upper_dpi - lower_dpi > 1 && ++ difference != 0) { + text->dpi = (upper_dpi + lower_dpi) / 2; +- if( vips_text_get_extents( text, &extents ) ) +- return( -1 ); ++ if (vips_text_get_extents(text, &extents)) ++ return (-1); + target.left = extents.left; + target.top = extents.top; +- difference = vips_text_rect_difference( &target, &extents ); ++ difference = vips_text_rect_difference(&target, &extents); + +- if( difference < 0 ) ++ if (difference < 0) + lower_dpi = text->dpi; + else + upper_dpi = text->dpi; +@@ -353,26 +353,26 @@ vips_text_autofit( VipsText *text ) + * and we can use upper. Otherwise we are straddling the target and we + * must take lower. + */ +- if( difference == 0 ) ++ if (difference == 0) + text->dpi = upper_dpi; +- else ++ else + text->dpi = lower_dpi; +- g_object_set( text, "autofit_dpi", text->dpi, NULL ); ++ g_object_set(text, "autofit_dpi", text->dpi, NULL); + + #ifdef DEBUG +- printf( "vips_text_autofit: final dpi = %d\n", text->dpi ); ++ printf("vips_text_autofit: final dpi = %d\n", text->dpi); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + static int +-vips_text_build( VipsObject *object ) ++vips_text_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsCreate *create = VIPS_CREATE( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsCreate *create = VIPS_CREATE(object); + VipsText *text = (VipsText *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 3 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 3); + + VipsRect extents; + VipsImage *image; +@@ -380,259 +380,258 @@ vips_text_build( VipsObject *object ) + cairo_t *cr; + cairo_status_t status; + +- if( VIPS_OBJECT_CLASS( vips_text_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_text_parent_class)->build(object)) ++ return (-1); + +- if( !pango_parse_markup( text->text, -1, 0, NULL, NULL, NULL, NULL ) ) { +- vips_error( class->nickname, +- "%s", _( "invalid markup in text" ) ); +- return( -1 ); ++ if (!pango_parse_markup(text->text, -1, 0, NULL, NULL, NULL, NULL)) { ++ vips_error(class->nickname, ++ "%s", _("invalid markup in text")); ++ return (-1); + } + + text->fontmap = pango_cairo_font_map_get_default(); + text->context = pango_font_map_create_context( +- PANGO_FONT_MAP( text->fontmap ) ); ++ PANGO_FONT_MAP(text->fontmap)); + +- g_mutex_lock( vips_text_lock ); ++ g_mutex_lock(vips_text_lock); + +- if( !vips_text_fontfiles ) +- vips_text_fontfiles = +- g_hash_table_new( g_str_hash, g_str_equal ); ++ if (!vips_text_fontfiles) ++ vips_text_fontfiles = ++ g_hash_table_new(g_str_hash, g_str_equal); + + #ifdef HAVE_FONTCONFIG +- if( text->fontfile && +- !g_hash_table_lookup( vips_text_fontfiles, text->fontfile ) ) { ++ if (text->fontfile && ++ !g_hash_table_lookup(vips_text_fontfiles, text->fontfile)) { + /* This can fail if you eg. add the same font from two + * different files. Just warn. + */ +- if( !FcConfigAppFontAddFile( NULL, +- (const FcChar8 *) text->fontfile ) ) +- g_warning( _( "unable to load fontfile \"%s\"" ), +- text->fontfile ); +- g_hash_table_insert( vips_text_fontfiles, ++ if (!FcConfigAppFontAddFile(NULL, ++ (const FcChar8 *) text->fontfile)) ++ g_warning(_("unable to load fontfile \"%s\""), ++ text->fontfile); ++ g_hash_table_insert(vips_text_fontfiles, + text->fontfile, +- g_strdup( text->fontfile ) ); ++ g_strdup(text->fontfile)); + + /* We need to inform that pango should invalidate its + * fontconfig cache whenever any changes are made. + */ +- if( PANGO_IS_FC_FONT_MAP( text->fontmap ) ) ++ if (PANGO_IS_FC_FONT_MAP(text->fontmap)) + pango_fc_font_map_cache_clear( +- PANGO_FC_FONT_MAP( text->fontmap ) ); ++ PANGO_FC_FONT_MAP(text->fontmap)); + } +-#else /*!HAVE_FONTCONFIG*/ +- if( text->fontfile ) +- g_warning( "%s", +- _( "ignoring fontfile (no fontconfig support)" ) ); ++#else /*!HAVE_FONTCONFIG*/ ++ if (text->fontfile) ++ g_warning("%s", ++ _("ignoring fontfile (no fontconfig support)")); + #endif /*HAVE_FONTCONFIG*/ + +- g_mutex_unlock( vips_text_lock ); ++ g_mutex_unlock(vips_text_lock); + +- /* If our caller set height and not dpi, we adjust dpi until ++ /* If our caller set height and not dpi, we adjust dpi until + * we get a fit. + */ +- if( vips_object_argument_isset( object, "height" ) && +- !vips_object_argument_isset( object, "dpi" ) ) { +- if( vips_text_autofit( text ) ) +- return( -1 ); ++ if (vips_object_argument_isset(object, "height") && ++ !vips_object_argument_isset(object, "dpi")) { ++ if (vips_text_autofit(text)) ++ return (-1); + } + + /* Layout. Can fail for "", for example. + */ +- if( vips_text_get_extents( text, &extents ) ) +- return( -1 ); ++ if (vips_text_get_extents(text, &extents)) ++ return (-1); + +- if( extents.width == 0 || +- extents.height == 0 ) { +- vips_error( class->nickname, "%s", _( "no text to render" ) ); +- return( -1 ); ++ if (extents.width == 0 || ++ extents.height == 0) { ++ vips_error(class->nickname, "%s", _("no text to render")); ++ return (-1); + } + + image = t[0] = vips_image_new_memory(); +- vips_image_init_fields( image, +- extents.width, extents.height, 4, +- VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, ++ vips_image_init_fields(image, ++ extents.width, extents.height, 4, ++ VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, + VIPS_INTERPRETATION_sRGB, +- text->dpi / 25.4, text->dpi / 25.4 ); ++ text->dpi / 25.4, text->dpi / 25.4); + image->Xoffset = extents.left; + image->Yoffset = extents.top; + +- if( vips_image_pipelinev( image, VIPS_DEMAND_STYLE_ANY, NULL ) || +- vips_image_write_prepare( image ) ) +- return( -1 ); ++ if (vips_image_pipelinev(image, VIPS_DEMAND_STYLE_ANY, NULL) || ++ vips_image_write_prepare(image)) ++ return (-1); + +- surface = cairo_image_surface_create_for_data( +- VIPS_IMAGE_ADDR( image, 0, 0 ), ++ surface = cairo_image_surface_create_for_data( ++ VIPS_IMAGE_ADDR(image, 0, 0), + CAIRO_FORMAT_ARGB32, + image->Xsize, image->Ysize, +- VIPS_IMAGE_SIZEOF_LINE( image ) ); +- +- status = cairo_surface_status( surface ); +- if( status ) { +- cairo_surface_destroy( surface ); +- vips_error( class->nickname, +- "%s", cairo_status_to_string( status ) ); +- return( -1 ); ++ VIPS_IMAGE_SIZEOF_LINE(image)); ++ ++ status = cairo_surface_status(surface); ++ if (status) { ++ cairo_surface_destroy(surface); ++ vips_error(class->nickname, ++ "%s", cairo_status_to_string(status)); ++ return (-1); + } + +- cr = cairo_create( surface ); +- cairo_surface_destroy( surface ); ++ cr = cairo_create(surface); ++ cairo_surface_destroy(surface); + +- cairo_translate( cr, -extents.left, -extents.top ); ++ cairo_translate(cr, -extents.left, -extents.top); + +- pango_cairo_show_layout( cr, text->layout ); ++ pango_cairo_show_layout(cr, text->layout); + +- cairo_destroy( cr ); ++ cairo_destroy(cr); + +- if( text->rgba ) { ++ if (text->rgba) { + int y; + +- /* Cairo makes pre-multipled BRGA -- we must byteswap and ++ /* Cairo makes pre-multipled BRGA -- we must byteswap and + * unpremultiply. + */ +- for( y = 0; y < image->Ysize; y++ ) +- vips__premultiplied_bgra2rgba( +- (guint32 *) +- VIPS_IMAGE_ADDR( image, 0, y ), +- image->Xsize ); ++ for (y = 0; y < image->Ysize; y++) ++ vips__premultiplied_bgra2rgba( ++ (guint32 *) ++ VIPS_IMAGE_ADDR(image, 0, y), ++ image->Xsize); + } + else { + /* We just want the alpha channel. + */ +- if( vips_extract_band( image, &t[1], 3, NULL ) || +- vips_copy( t[1], &t[2], ++ if (vips_extract_band(image, &t[1], 3, NULL) || ++ vips_copy(t[1], &t[2], + "interpretation", VIPS_INTERPRETATION_MULTIBAND, +- NULL ) ) +- return( -1 ); ++ NULL)) ++ return (-1); + image = t[2]; + } + +- if( vips_image_write( image, create->out ) ) +- return( -1 ); ++ if (vips_image_write(image, create->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void * +-vips_text_make_lock( void *client ) ++vips_text_make_lock(void *client) + { +- if( !vips_text_lock ) ++ if (!vips_text_lock) + vips_text_lock = vips_g_mutex_new(); + +- return( NULL ); ++ return (NULL); + } + + static void +-vips_text_class_init( VipsTextClass *class ) ++vips_text_class_init(VipsTextClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + static GOnce once = G_ONCE_INIT; + +- VIPS_ONCE( &once, vips_text_make_lock, NULL ); ++ VIPS_ONCE(&once, vips_text_make_lock, NULL); + + gobject_class->dispose = vips_text_dispose; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "text"; +- vobject_class->description = _( "make a text image" ); ++ vobject_class->description = _("make a text image"); + vobject_class->build = vips_text_build; + +- VIPS_ARG_STRING( class, "text", 4, +- _( "Text" ), +- _( "Text to render" ), ++ VIPS_ARG_STRING(class, "text", 4, ++ _("Text"), ++ _("Text to render"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsText, text ), +- NULL ); ++ G_STRUCT_OFFSET(VipsText, text), ++ NULL); + +- VIPS_ARG_STRING( class, "font", 5, +- _( "Font" ), +- _( "Font to render with" ), ++ VIPS_ARG_STRING(class, "font", 5, ++ _("Font"), ++ _("Font to render with"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsText, font ), +- NULL ); ++ G_STRUCT_OFFSET(VipsText, font), ++ NULL); + +- VIPS_ARG_INT( class, "width", 6, +- _( "Width" ), +- _( "Maximum image width in pixels" ), ++ VIPS_ARG_INT(class, "width", 6, ++ _("Width"), ++ _("Maximum image width in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsText, width ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsText, width), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "height", 7, +- _( "Height" ), +- _( "Maximum image height in pixels" ), ++ VIPS_ARG_INT(class, "height", 7, ++ _("Height"), ++ _("Maximum image height in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsText, height ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsText, height), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_ENUM( class, "align", 8, +- _( "Align" ), +- _( "Align on the low, centre or high edge" ), ++ VIPS_ARG_ENUM(class, "align", 8, ++ _("Align"), ++ _("Align on the low, centre or high edge"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsText, align ), +- VIPS_TYPE_ALIGN, VIPS_ALIGN_LOW ); ++ G_STRUCT_OFFSET(VipsText, align), ++ VIPS_TYPE_ALIGN, VIPS_ALIGN_LOW); + +- VIPS_ARG_BOOL( class, "justify", 9, +- _( "Justify" ), +- _( "Justify lines" ), ++ VIPS_ARG_BOOL(class, "justify", 9, ++ _("Justify"), ++ _("Justify lines"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsText, justify ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsText, justify), ++ FALSE); + +- VIPS_ARG_INT( class, "dpi", 10, +- _( "DPI" ), +- _( "DPI to render at" ), ++ VIPS_ARG_INT(class, "dpi", 10, ++ _("DPI"), ++ _("DPI to render at"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsText, dpi ), +- 1, 1000000, 72 ); ++ G_STRUCT_OFFSET(VipsText, dpi), ++ 1, 1000000, 72); + +- VIPS_ARG_INT( class, "autofit_dpi", 11, +- _( "Autofit DPI" ), +- _( "DPI selected by autofit" ), ++ VIPS_ARG_INT(class, "autofit_dpi", 11, ++ _("Autofit DPI"), ++ _("DPI selected by autofit"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsText, dpi ), +- 1, 1000000, 72 ); ++ G_STRUCT_OFFSET(VipsText, dpi), ++ 1, 1000000, 72); + +- VIPS_ARG_INT( class, "spacing", 12, +- _( "Spacing" ), +- _( "Line spacing" ), ++ VIPS_ARG_INT(class, "spacing", 12, ++ _("Spacing"), ++ _("Line spacing"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsText, spacing ), +- 0, 1000000, 0 ); ++ G_STRUCT_OFFSET(VipsText, spacing), ++ 0, 1000000, 0); + +- VIPS_ARG_STRING( class, "fontfile", 13, +- _( "Font file" ), +- _( "Load this font file" ), ++ VIPS_ARG_STRING(class, "fontfile", 13, ++ _("Font file"), ++ _("Load this font file"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsText, fontfile ), +- NULL ); ++ G_STRUCT_OFFSET(VipsText, fontfile), ++ NULL); + +- VIPS_ARG_BOOL( class, "rgba", 14, +- _( "RGBA" ), +- _( "Enable RGBA output" ), ++ VIPS_ARG_BOOL(class, "rgba", 14, ++ _("RGBA"), ++ _("Enable RGBA output"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsText, rgba ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsText, rgba), ++ FALSE); + +- VIPS_ARG_ENUM( class, "wrap", 15, +- _( "Wrap" ), +- _( "Wrap lines on word or character boundaries" ), ++ VIPS_ARG_ENUM(class, "wrap", 15, ++ _("Wrap"), ++ _("Wrap lines on word or character boundaries"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsText, wrap ), +- VIPS_TYPE_TEXT_WRAP, VIPS_TEXT_WRAP_WORD ); +- ++ G_STRUCT_OFFSET(VipsText, wrap), ++ VIPS_TYPE_TEXT_WRAP, VIPS_TEXT_WRAP_WORD); + } + + static void +-vips_text_init( VipsText *text ) ++vips_text_init(VipsText *text) + { + text->align = VIPS_ALIGN_LOW; + text->dpi = 72; + text->wrap = VIPS_TEXT_WRAP_WORD; +- VIPS_SETSTR( text->font, "sans 12" ); ++ VIPS_SETSTR(text->font, "sans 12"); + } + + #endif /*HAVE_PANGOCAIRO*/ +@@ -652,7 +651,7 @@ vips_text_init( VipsText *text ) + * * @align: #VipsAlign, set justification alignment + * * @justify: %gboolean, justify lines + * * @dpi: %gint, render at this resolution +- * * @autofit_dpi: %gint, read out auto-fitted DPI ++ * * @autofit_dpi: %gint, read out auto-fitted DPI + * * @rgba: %gboolean, enable RGBA output + * * @spacing: %gint, space lines by this in points + * * @wrap: #VipsTextWrap, wrap lines on characters or words +@@ -674,26 +673,26 @@ vips_text_init( VipsText *text ) + * You can specify a font to load with @fontfile. You'll need to also set the + * name of the font with @font. + * +- * @width is the number of pixels to word-wrap at. By default, lines of text +- * wider than this will be broken at word boundaries. ++ * @width is the number of pixels to word-wrap at. By default, lines of text ++ * wider than this will be broken at word boundaries. + * Use @wrap to set lines to wrap on word or character boundaries, or to +- * disable line breaks. ++ * disable line breaks. + * + * Set @justify to turn on line justification. + * @align can be used to set the alignment style for multi-line +- * text to the low (left) edge centre, or high (right) edge. Note that the ++ * text to the low (left) edge centre, or high (right) edge. Note that the + * output image can be wider than @width if there are no +- * word breaks, or narrower if the lines don't break exactly at @width. ++ * word breaks, or narrower if the lines don't break exactly at @width. + * + * @height is the maximum number of pixels high the generated text can be. This +- * only takes effect when @dpi is not set, and @width is set, making a box. +- * In this case, vips_text() will search for a @dpi and set of line breaks ++ * only takes effect when @dpi is not set, and @width is set, making a box. ++ * In this case, vips_text() will search for a @dpi and set of line breaks + * which will just fit the text into @width and @height. + * +- * You can use @autofit_dpi to read out the DPI selected by auto fit. ++ * You can use @autofit_dpi to read out the DPI selected by auto fit. + * + * @dpi sets the resolution to render at. "sans 12" at 72 dpi draws characters +- * approximately 12 pixels high. ++ * approximately 12 pixels high. + * + * @spacing sets the line spacing, in points. It would typically be something + * like font size times 1.2. +@@ -707,14 +706,14 @@ vips_text_init( VipsText *text ) + * Returns: 0 on success, -1 on error + */ + int +-vips_text( VipsImage **out, const char *text, ... ) ++vips_text(VipsImage **out, const char *text, ...) + { + va_list ap; + int result; + +- va_start( ap, text ); +- result = vips_call_split( "text", ap, out, text ); +- va_end( ap ); ++ va_start(ap, text); ++ result = vips_call_split("text", ap, out, text); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/tonelut.c b/libvips/create/tonelut.c +index e9904abc4a..84589b7631 100644 +--- a/libvips/create/tonelut.c ++++ b/libvips/create/tonelut.c +@@ -1,4 +1,4 @@ +-/* Build a tone curve. ++/* Build a tone curve. + * + * Author: John Cupitt + * Written on: 18/7/1995 +@@ -19,28 +19,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -63,7 +63,7 @@ typedef struct _VipsTonelut { + /* Parameters for tone curve formation. + */ + double Lb, Lw; +- double Ps, Pm, Ph; ++ double Ps, Pm, Ph; + double S, M, H; + + /* Range we process. +@@ -78,103 +78,103 @@ typedef struct _VipsTonelut { + + typedef VipsCreateClass VipsTonelutClass; + +-G_DEFINE_TYPE( VipsTonelut, vips_tonelut, VIPS_TYPE_CREATE ); ++G_DEFINE_TYPE(VipsTonelut, vips_tonelut, VIPS_TYPE_CREATE); + + /* Calculate shadow curve. + */ + static double +-shad( VipsTonelut *lut, double x ) ++shad(VipsTonelut *lut, double x) + { + double x1 = (x - lut->Lb) / (lut->Ls - lut->Lb); + double x2 = (x - lut->Ls) / (lut->Lm - lut->Ls); + + double out; + +- if( x < lut->Lb ) ++ if (x < lut->Lb) + out = 0; +- else if( x < lut->Ls ) ++ else if (x < lut->Ls) + out = 3.0 * x1 * x1 - 2.0 * x1 * x1 * x1; +- else if( x < lut->Lm ) ++ else if (x < lut->Lm) + out = 1.0 - 3.0 * x2 * x2 + 2.0 * x2 * x2 * x2; +- else ++ else + out = 0; + +- return( out ); ++ return (out); + } + + /* Calculate mid-tone curve. + */ + static double +-mid( VipsTonelut *lut, double x ) ++mid(VipsTonelut *lut, double x) + { + double x1 = (x - lut->Ls) / (lut->Lm - lut->Ls); + double x2 = (x - lut->Lm) / (lut->Lh - lut->Lm); + + double out; + +- if( x < lut->Ls ) ++ if (x < lut->Ls) + out = 0; +- else if( x < lut->Lm ) ++ else if (x < lut->Lm) + out = 3.0 * x1 * x1 - 2.0 * x1 * x1 * x1; +- else if( x < lut->Lh ) ++ else if (x < lut->Lh) + out = 1.0 - 3.0 * x2 * x2 + 2.0 * x2 * x2 * x2; +- else ++ else + out = 0; + +- return( out ); ++ return (out); + } + + /* Calculate highlight curve. + */ + static double +-high( VipsTonelut *lut, double x ) ++high(VipsTonelut *lut, double x) + { + double x1 = (x - lut->Lm) / (lut->Lh - lut->Lm); + double x2 = (x - lut->Lh) / (lut->Lw - lut->Lh); + + double out; + +- if( x < lut->Lm ) ++ if (x < lut->Lm) + out = 0; +- else if( x < lut->Lh ) ++ else if (x < lut->Lh) + out = 3.0 * x1 * x1 - 2.0 * x1 * x1 * x1; +- else if( x < lut->Lw ) ++ else if (x < lut->Lw) + out = 1.0 - 3.0 * x2 * x2 + 2.0 * x2 * x2 * x2; +- else ++ else + out = 0; + +- return( out ); ++ return (out); + } + + /* Generate a point on the tone curve. Everything is 0-100. + */ + static double +-tone_curve( VipsTonelut *lut, double x ) ++tone_curve(VipsTonelut *lut, double x) + { + double out; + +- out = x + +- lut->S * shad( lut, x ) + +- lut->M * mid( lut, x ) + +- lut->H * high( lut, x ); +- +- return( out ); ++ out = x + ++ lut->S * shad(lut, x) + ++ lut->M * mid(lut, x) + ++ lut->H * high(lut, x); ++ ++ return (out); + } + + static int +-vips_tonelut_build( VipsObject *object ) ++vips_tonelut_build(VipsObject *object) + { +- VipsCreate *create = VIPS_CREATE( object ); ++ VipsCreate *create = VIPS_CREATE(object); + VipsTonelut *lut = (VipsTonelut *) object; + +- int i; ++ int i; + unsigned short buf[65536]; + +- if( VIPS_OBJECT_CLASS( vips_tonelut_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_tonelut_parent_class)->build(object)) ++ return (-1); + +- g_assert( lut->in_max > 0 && lut->in_max < 65536 ); +- g_assert( lut->out_max > 0 && lut->out_max < 65536 ); ++ g_assert(lut->in_max > 0 && lut->in_max < 65536); ++ g_assert(lut->out_max > 0 && lut->out_max < 65536); + + /* Note derived params. + */ +@@ -184,13 +184,13 @@ vips_tonelut_build( VipsObject *object ) + + /* Generate curve. + */ +- for( i = 0; i <= lut->in_max; i++ ) { +- int v = (lut->out_max / 100.0) * +- tone_curve( lut, 100.0 * i / lut->in_max ); ++ for (i = 0; i <= lut->in_max; i++) { ++ int v = (lut->out_max / 100.0) * ++ tone_curve(lut, 100.0 * i / lut->in_max); + +- if( v < 0 ) ++ if (v < 0) + v = 0; +- else if( v > lut->out_max ) ++ else if (v > lut->out_max) + v = lut->out_max; + + buf[i] = v; +@@ -198,124 +198,123 @@ vips_tonelut_build( VipsObject *object ) + + /* Make the output image. + */ +- vips_image_init_fields( create->out, +- lut->in_max + 1, 1, 1, +- VIPS_FORMAT_USHORT, VIPS_CODING_NONE, +- VIPS_INTERPRETATION_HISTOGRAM, 1.0, 1.0 ); +- if( vips_image_write_line( create->out, 0, (VipsPel *) buf ) ) +- return( -1 ); +- +- return( 0 ); ++ vips_image_init_fields(create->out, ++ lut->in_max + 1, 1, 1, ++ VIPS_FORMAT_USHORT, VIPS_CODING_NONE, ++ VIPS_INTERPRETATION_HISTOGRAM, 1.0, 1.0); ++ if (vips_image_write_line(create->out, 0, (VipsPel *) buf)) ++ return (-1); ++ ++ return (0); + } + + static void +-vips_tonelut_class_init( VipsTonelutClass *class ) ++vips_tonelut_class_init(VipsTonelutClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "tonelut"; +- vobject_class->description = _( "build a look-up table" ); ++ vobject_class->description = _("build a look-up table"); + vobject_class->build = vips_tonelut_build; + +- VIPS_ARG_INT( class, "in_max", 4, +- _( "In-max" ), +- _( "Size of LUT to build" ), ++ VIPS_ARG_INT(class, "in_max", 4, ++ _("In-max"), ++ _("Size of LUT to build"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsTonelut, in_max ), +- 1, 65535, 32767 ); ++ G_STRUCT_OFFSET(VipsTonelut, in_max), ++ 1, 65535, 32767); + +- VIPS_ARG_INT( class, "out_max", 5, +- _( "Out-max" ), +- _( "Maximum value in output LUT" ), ++ VIPS_ARG_INT(class, "out_max", 5, ++ _("Out-max"), ++ _("Maximum value in output LUT"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsTonelut, out_max ), +- 1, 65535, 32767 ); ++ G_STRUCT_OFFSET(VipsTonelut, out_max), ++ 1, 65535, 32767); + +- VIPS_ARG_DOUBLE( class, "Lb", 6, +- _( "Black point" ), +- _( "Lowest value in output" ), ++ VIPS_ARG_DOUBLE(class, "Lb", 6, ++ _("Black point"), ++ _("Lowest value in output"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsTonelut, Lb ), +- 0, 100, 0 ); ++ G_STRUCT_OFFSET(VipsTonelut, Lb), ++ 0, 100, 0); + +- VIPS_ARG_DOUBLE( class, "Lw", 7, +- _( "White point" ), +- _( "Highest value in output" ), ++ VIPS_ARG_DOUBLE(class, "Lw", 7, ++ _("White point"), ++ _("Highest value in output"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsTonelut, Lw ), +- 0, 100, 100 ); ++ G_STRUCT_OFFSET(VipsTonelut, Lw), ++ 0, 100, 100); + +- VIPS_ARG_DOUBLE( class, "Ps", 8, +- _( "Shadow point" ), +- _( "Position of shadow" ), ++ VIPS_ARG_DOUBLE(class, "Ps", 8, ++ _("Shadow point"), ++ _("Position of shadow"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsTonelut, Ps ), +- 0, 1, 0.2 ); ++ G_STRUCT_OFFSET(VipsTonelut, Ps), ++ 0, 1, 0.2); + +- VIPS_ARG_DOUBLE( class, "Pm", 9, +- _( "Mid-tone point" ), +- _( "Position of mid-tones" ), ++ VIPS_ARG_DOUBLE(class, "Pm", 9, ++ _("Mid-tone point"), ++ _("Position of mid-tones"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsTonelut, Pm ), +- 0, 1, 0.5 ); ++ G_STRUCT_OFFSET(VipsTonelut, Pm), ++ 0, 1, 0.5); + +- VIPS_ARG_DOUBLE( class, "Ph", 10, +- _( "Highlight point" ), +- _( "Position of highlights" ), ++ VIPS_ARG_DOUBLE(class, "Ph", 10, ++ _("Highlight point"), ++ _("Position of highlights"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsTonelut, Ph ), +- 0, 1, 0.8 ); ++ G_STRUCT_OFFSET(VipsTonelut, Ph), ++ 0, 1, 0.8); + +- VIPS_ARG_DOUBLE( class, "S", 11, +- _( "Shadow adjust" ), +- _( "Adjust shadows by this much" ), ++ VIPS_ARG_DOUBLE(class, "S", 11, ++ _("Shadow adjust"), ++ _("Adjust shadows by this much"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsTonelut, S ), +- -30, 30, 0 ); ++ G_STRUCT_OFFSET(VipsTonelut, S), ++ -30, 30, 0); + +- VIPS_ARG_DOUBLE( class, "M", 12, +- _( "Mid-tone adjust" ), +- _( "Adjust mid-tones by this much" ), ++ VIPS_ARG_DOUBLE(class, "M", 12, ++ _("Mid-tone adjust"), ++ _("Adjust mid-tones by this much"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsTonelut, M ), +- -30, 30, 0 ); ++ G_STRUCT_OFFSET(VipsTonelut, M), ++ -30, 30, 0); + +- VIPS_ARG_DOUBLE( class, "H", 13, +- _( "Highlight adjust" ), +- _( "Adjust highlights by this much" ), ++ VIPS_ARG_DOUBLE(class, "H", 13, ++ _("Highlight adjust"), ++ _("Adjust highlights by this much"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsTonelut, H ), +- -30, 30, 0 ); +- ++ G_STRUCT_OFFSET(VipsTonelut, H), ++ -30, 30, 0); + } + + static void +-vips_tonelut_init( VipsTonelut *lut ) ++vips_tonelut_init(VipsTonelut *lut) + { +- lut->in_max = 32767; +- lut->out_max = 32767; +- lut->Lb = 0.0; +- lut->Lw = 100.0; +- lut->Ps = 0.2; +- lut->Pm = 0.5; +- lut->Ph = 0.8; +- lut->S = 0.0; +- lut->M = 0.0; +- lut->H = 0.0; ++ lut->in_max = 32767; ++ lut->out_max = 32767; ++ lut->Lb = 0.0; ++ lut->Lw = 100.0; ++ lut->Ps = 0.2; ++ lut->Pm = 0.5; ++ lut->Ph = 0.8; ++ lut->S = 0.0; ++ lut->M = 0.0; ++ lut->H = 0.0; + } + + /** + * vips_tonelut: +- * @out: (out): output image ++ * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * + * Optional arguments: + * +- * * @in_max: input range ++ * * @in_max: input range + * * @out_max: output range + * * @Lb: black-point [0-100] + * * @Lw: white-point [0-100] +@@ -326,29 +325,28 @@ vips_tonelut_init( VipsTonelut *lut ) + * * @M: mid-tone adjustment (+/- 30) + * * @H: highlight adjustment (+/- 30) + * +- * vips_tonelut() generates a tone curve for the adjustment of image ++ * vips_tonelut() generates a tone curve for the adjustment of image + * levels. It is mostly designed for adjusting the L* part of a LAB image in + * a way suitable for print work, but you can use it for other things too. + * +- * The curve is an unsigned 16-bit image with (@in_max + 1) entries, ++ * The curve is an unsigned 16-bit image with (@in_max + 1) entries, + * each in the range [0, @out_max]. + * +- * @Lb, @Lw are expressed as 0-100, as in LAB colour space. You +- * specify the scaling for the input and output images with the @in_max and ++ * @Lb, @Lw are expressed as 0-100, as in LAB colour space. You ++ * specify the scaling for the input and output images with the @in_max and + * @out_max parameters. + * + * Returns: 0 on success, -1 on error + */ + int +-vips_tonelut( VipsImage **out, ... ) ++vips_tonelut(VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "tonelut", ap, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("tonelut", ap, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/create/worley.c b/libvips/create/worley.c +index fd912cf620..f1ed909fea 100644 +--- a/libvips/create/worley.c ++++ b/libvips/create/worley.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -71,7 +71,7 @@ typedef struct _VipsWorleyClass { + + } VipsWorleyClass; + +-G_DEFINE_TYPE( VipsWorley, vips_worley, VIPS_TYPE_CREATE ); ++G_DEFINE_TYPE(VipsWorley, vips_worley, VIPS_TYPE_CREATE); + + #define MAX_FEATURES (10) + +@@ -107,16 +107,16 @@ typedef struct _Sequence { + + } Sequence; + +-/* Generate a 3 x 3 grid of cells around a point. ++/* Generate a 3 x 3 grid of cells around a point. + */ + static void +-vips_worley_create_cells( VipsWorley *worley, +- Cell cells[9], int cell_x, int cell_y ) ++vips_worley_create_cells(VipsWorley *worley, ++ Cell cells[9], int cell_x, int cell_y) + { + int x, y; + +- for( y = 0; y < 3; y++ ) +- for( x = 0; x < 3; x++ ) { ++ for (y = 0; y < 3; y++) ++ for (x = 0; x < 3; x++) { + Cell *cell = &cells[x + y * 3]; + + guint32 seed; +@@ -133,77 +133,77 @@ vips_worley_create_cells( VipsWorley *worley, + /* When we calculate the seed for this cell, we wrap + * around so that our output will tesselate. + */ +- if( cell->cell_x >= worley->cells_across ) ++ if (cell->cell_x >= worley->cells_across) + value = 0; +- else if( cell->cell_x < 0 ) ++ else if (cell->cell_x < 0) + value = worley->cells_across - 1; +- else ++ else + value = cell->cell_x; +- seed = vips__random_add( seed, value ); ++ seed = vips__random_add(seed, value); + +- if( cell->cell_y >= worley->cells_down ) ++ if (cell->cell_y >= worley->cells_down) + value = 0; +- else if( cell->cell_y < 0 ) ++ else if (cell->cell_y < 0) + value = worley->cells_down - 1; +- else ++ else + value = cell->cell_y; +- seed = vips__random_add( seed, value ); ++ seed = vips__random_add(seed, value); + + /* [1, MAX_FEATURES) + */ + cell->n_features = (seed % (MAX_FEATURES - 1)) + 1; + +- for( j = 0; j < cell->n_features; j++ ) { +- seed = vips__random( seed ); +- cell->feature_x[j] = +- cell->cell_x * worley->cell_size + ++ for (j = 0; j < cell->n_features; j++) { ++ seed = vips__random(seed); ++ cell->feature_x[j] = ++ cell->cell_x * worley->cell_size + + seed % worley->cell_size; + +- seed = vips__random( seed ); +- cell->feature_y[j] = +- cell->cell_y * worley->cell_size + ++ seed = vips__random(seed); ++ cell->feature_y[j] = ++ cell->cell_y * worley->cell_size + + seed % worley->cell_size; + } + } + } + + static int +-vips_worley_stop( void *vseq, void *a, void *b ) ++vips_worley_stop(void *vseq, void *a, void *b) + { + Sequence *seq = (Sequence *) vseq; + +- VIPS_FREE( seq ); ++ VIPS_FREE(seq); + +- return( 0 ); ++ return (0); + } + + static void * +-vips_worley_start( VipsImage *out, void *a, void *b ) ++vips_worley_start(VipsImage *out, void *a, void *b) + { + VipsWorley *worley = (VipsWorley *) b; + + Sequence *seq; + +- if( !(seq = VIPS_NEW( NULL, Sequence )) ) +- return( NULL ); ++ if (!(seq = VIPS_NEW(NULL, Sequence))) ++ return (NULL); + + seq->worley = worley; + seq->cell_x = -1; + seq->cell_y = -1; + +- return( seq ); ++ return (seq); + } + + static float +-vips_hypot( int x, int y ) ++vips_hypot(int x, int y) + { + /* Faster than hypot() for int args. + */ +- return( sqrt( x * x + y * y ) ); ++ return (sqrt(x * x + y * y)); + } + + static float +-vips_worley_distance( VipsWorley *worley, Cell cells[9], int x, int y ) ++vips_worley_distance(VipsWorley *worley, Cell cells[9], int x, int y) + { + float distance; + +@@ -211,131 +211,130 @@ vips_worley_distance( VipsWorley *worley, Cell cells[9], int x, int y ) + + distance = worley->cell_size * 1.5; + +- for( i = 0; i < 9; i++ ) { ++ for (i = 0; i < 9; i++) { + Cell *cell = &cells[i]; + +- for( j = 0; j < cell->n_features; j++ ) { +- float d = vips_hypot( +- x - cell->feature_x[j], +- y - cell->feature_y[j] ); ++ for (j = 0; j < cell->n_features; j++) { ++ float d = vips_hypot( ++ x - cell->feature_x[j], ++ y - cell->feature_y[j]); + +- distance = VIPS_MIN( distance, d ); ++ distance = VIPS_MIN(distance, d); + } + } + +- return( distance ); ++ return (distance); + } + + static int +-vips_worley_gen( VipsRegion *or, void *vseq, void *a, void *b, +- gboolean *stop ) ++vips_worley_gen(VipsRegion * or, void *vseq, void *a, void *b, ++ gboolean *stop) + { + VipsWorley *worley = (VipsWorley *) a; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + Sequence *seq = (Sequence *) vseq; + + int x, y; + +- for( y = 0; y < r->height; y++ ) { +- float *q = (float *) VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ float *q = (float *) VIPS_REGION_ADDR(or, r->left, r->top + y); + +- for( x = 0; x < r->width; x++ ) { ++ for (x = 0; x < r->width; x++) { + int cell_x = (r->left + x) / worley->cell_size; + int cell_y = (r->top + y) / worley->cell_size; + +- if( cell_x != seq->cell_x || +- cell_y != seq->cell_y ) { +- vips_worley_create_cells( worley, +- seq->cells, cell_x, cell_y ); ++ if (cell_x != seq->cell_x || ++ cell_y != seq->cell_y) { ++ vips_worley_create_cells(worley, ++ seq->cells, cell_x, cell_y); + seq->cell_x = cell_x; + seq->cell_y = cell_y; + } + +- q[x] = vips_worley_distance( worley, seq->cells, +- r->left + x, r->top + y ); ++ q[x] = vips_worley_distance(worley, seq->cells, ++ r->left + x, r->top + y); + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_worley_build( VipsObject *object ) ++vips_worley_build(VipsObject *object) + { +- VipsCreate *create = VIPS_CREATE( object ); ++ VipsCreate *create = VIPS_CREATE(object); + VipsWorley *worley = (VipsWorley *) object; + +- if( VIPS_OBJECT_CLASS( vips_worley_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_worley_parent_class)->build(object)) ++ return (-1); + + /* Be careful if width is a multiple of cell_size. + */ +- worley->cells_across = +- VIPS_ROUND_UP( worley->width, worley->cell_size ) / ++ worley->cells_across = ++ VIPS_ROUND_UP(worley->width, worley->cell_size) / + worley->cell_size; +- worley->cells_down = +- VIPS_ROUND_UP( worley->height, worley->cell_size ) / ++ worley->cells_down = ++ VIPS_ROUND_UP(worley->height, worley->cell_size) / + worley->cell_size; + +- vips_image_init_fields( create->out, ++ vips_image_init_fields(create->out, + worley->width, worley->height, 1, +- VIPS_FORMAT_FLOAT, VIPS_CODING_NONE, ++ VIPS_FORMAT_FLOAT, VIPS_CODING_NONE, + VIPS_INTERPRETATION_MULTIBAND, +- 1.0, 1.0 ); +- if( vips_image_pipelinev( create->out, VIPS_DEMAND_STYLE_ANY, NULL ) || +- vips_image_generate( create->out, +- vips_worley_start, vips_worley_gen, vips_worley_stop, +- worley, NULL ) ) +- return( -1 ); +- +- return( 0 ); ++ 1.0, 1.0); ++ if (vips_image_pipelinev(create->out, VIPS_DEMAND_STYLE_ANY, NULL) || ++ vips_image_generate(create->out, ++ vips_worley_start, vips_worley_gen, vips_worley_stop, ++ worley, NULL)) ++ return (-1); ++ ++ return (0); + } + + static void +-vips_worley_class_init( VipsWorleyClass *class ) ++vips_worley_class_init(VipsWorleyClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "worley"; +- vobject_class->description = _( "make a worley noise image" ); ++ vobject_class->description = _("make a worley noise image"); + vobject_class->build = vips_worley_build; + +- VIPS_ARG_INT( class, "width", 2, +- _( "Width" ), +- _( "Image width in pixels" ), ++ VIPS_ARG_INT(class, "width", 2, ++ _("Width"), ++ _("Image width in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsWorley, width ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsWorley, width), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "height", 3, +- _( "Height" ), +- _( "Image height in pixels" ), ++ VIPS_ARG_INT(class, "height", 3, ++ _("Height"), ++ _("Image height in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsWorley, height ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsWorley, height), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "cell_size", 3, +- _( "Cell size" ), +- _( "Size of Worley cells" ), ++ VIPS_ARG_INT(class, "cell_size", 3, ++ _("Cell size"), ++ _("Size of Worley cells"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsWorley, cell_size ), +- 1, VIPS_MAX_COORD, 256 ); ++ G_STRUCT_OFFSET(VipsWorley, cell_size), ++ 1, VIPS_MAX_COORD, 256); + +- VIPS_ARG_INT( class, "seed", 4, +- _( "Seed" ), +- _( "Random number seed" ), ++ VIPS_ARG_INT(class, "seed", 4, ++ _("Seed"), ++ _("Random number seed"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsWorley, seed ), +- INT_MIN, INT_MAX, 0 ); +- ++ G_STRUCT_OFFSET(VipsWorley, seed), ++ INT_MIN, INT_MAX, 0); + } + + static void +-vips_worley_init( VipsWorley *worley ) ++vips_worley_init(VipsWorley *worley) + { + worley->cell_size = 256; + worley->seed = UINT_MAX * g_random_double(); +@@ -366,15 +365,14 @@ vips_worley_init( VipsWorley *worley ) + * Returns: 0 on success, -1 on error + */ + int +-vips_worley( VipsImage **out, int width, int height, ... ) ++vips_worley(VipsImage **out, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "worley", ap, out, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("worley", ap, out, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/create/xyz.c b/libvips/create/xyz.c +index 2b59eb8884..c0724ac249 100644 +--- a/libvips/create/xyz.c ++++ b/libvips/create/xyz.c +@@ -1,4 +1,4 @@ +-/* make an xy index image ++/* make an xy index image + * + * 21/4/04 + * - from im_grey +@@ -10,28 +10,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -69,163 +69,162 @@ typedef struct _VipsXyz { + + typedef VipsCreateClass VipsXyzClass; + +-G_DEFINE_TYPE( VipsXyz, vips_xyz, VIPS_TYPE_CREATE ); ++G_DEFINE_TYPE(VipsXyz, vips_xyz, VIPS_TYPE_CREATE); + + static int +-vips_xyz_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++vips_xyz_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + VipsXyz *xyz = (VipsXyz *) a; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; + int to = r->top; +- int ri = VIPS_RECT_RIGHT( r ); +- int bo = VIPS_RECT_BOTTOM( r ); ++ int ri = VIPS_RECT_RIGHT(r); ++ int bo = VIPS_RECT_BOTTOM(r); + + int x, y, i; + +- for( y = to; y < bo; y++ ) { +- unsigned int *q = (unsigned int *) +- VIPS_REGION_ADDR( or, le, y ); ++ for (y = to; y < bo; y++) { ++ unsigned int *q = (unsigned int *) ++ VIPS_REGION_ADDR(or, le, y); + + unsigned int dims[5]; + int r; + int h; + +- h = xyz->height * xyz->csize * xyz->dsize; ++ h = xyz->height * xyz->csize * xyz->dsize; + dims[4] = y / h; + r = y % h; + +- h /= xyz->dsize; ++ h /= xyz->dsize; + dims[3] = r / h; + r %= h; + +- h /= xyz->csize; ++ h /= xyz->csize; + dims[2] = r / h; + r %= h; + + dims[1] = r; + +- for( x = le; x < ri; x++ ) { ++ for (x = le; x < ri; x++) { + dims[0] = x; +- for( i = 0; i < xyz->dimensions; i++ ) ++ for (i = 0; i < xyz->dimensions; i++) + q[i] = dims[i]; + + q += xyz->dimensions; + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_xyz_build( VipsObject *object ) ++vips_xyz_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsCreate *create = VIPS_CREATE( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsCreate *create = VIPS_CREATE(object); + VipsXyz *xyz = (VipsXyz *) object; + + double d; + int ysize; + +- if( VIPS_OBJECT_CLASS( vips_xyz_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_xyz_parent_class)->build(object)) ++ return (-1); + +- if( (vips_object_argument_isset( object, "dsize" ) && +- !vips_object_argument_isset( object, "csize" )) || +- (vips_object_argument_isset( object, "esize" ) && +- !vips_object_argument_isset( object, "dsize" )) ) { +- vips_error( class->nickname, "%s", +- _( "lower dimensions not set" ) ); +- return( -1 ); ++ if ((vips_object_argument_isset(object, "dsize") && ++ !vips_object_argument_isset(object, "csize")) || ++ (vips_object_argument_isset(object, "esize") && ++ !vips_object_argument_isset(object, "dsize"))) { ++ vips_error(class->nickname, "%s", ++ _("lower dimensions not set")); ++ return (-1); + } + +- if( vips_object_argument_isset( object, "csize" ) ) { ++ if (vips_object_argument_isset(object, "csize")) { + xyz->dimensions += 1; + +- if( vips_object_argument_isset( object, "dsize" ) ) { ++ if (vips_object_argument_isset(object, "dsize")) { + xyz->dimensions += 1; + +- if( vips_object_argument_isset( object, "esize" ) ) ++ if (vips_object_argument_isset(object, "esize")) + xyz->dimensions += 1; + } + } + +- d = (double) xyz->height * xyz->csize * xyz->dsize * xyz->esize; +- if( d > INT_MAX ) { +- vips_error( class->nickname, "%s", _( "image too large" ) ); +- return( -1 ); ++ d = (double) xyz->height * xyz->csize * xyz->dsize * xyz->esize; ++ if (d > INT_MAX) { ++ vips_error(class->nickname, "%s", _("image too large")); ++ return (-1); + } + ysize = d; + +- vips_image_init_fields( create->out, +- xyz->width, ysize, xyz->dimensions, ++ vips_image_init_fields(create->out, ++ xyz->width, ysize, xyz->dimensions, + VIPS_FORMAT_UINT, VIPS_CODING_NONE, + VIPS_INTERPRETATION_MULTIBAND, +- 1.0, 1.0 ); +- if( vips_image_pipelinev( create->out, VIPS_DEMAND_STYLE_ANY, NULL ) || +- vips_image_generate( create->out, +- NULL, vips_xyz_gen, NULL, xyz, NULL ) ) +- return( -1 ); ++ 1.0, 1.0); ++ if (vips_image_pipelinev(create->out, VIPS_DEMAND_STYLE_ANY, NULL) || ++ vips_image_generate(create->out, ++ NULL, vips_xyz_gen, NULL, xyz, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_xyz_class_init( VipsXyzClass *class ) ++vips_xyz_class_init(VipsXyzClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_xyz_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_xyz_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "xyz"; +- vobject_class->description = +- _( "make an image where pixel values are coordinates" ); ++ vobject_class->description = ++ _("make an image where pixel values are coordinates"); + vobject_class->build = vips_xyz_build; + +- VIPS_ARG_INT( class, "width", 4, +- _( "Width" ), +- _( "Image width in pixels" ), ++ VIPS_ARG_INT(class, "width", 4, ++ _("Width"), ++ _("Image width in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsXyz, width ), +- 1, VIPS_MAX_COORD, 64 ); ++ G_STRUCT_OFFSET(VipsXyz, width), ++ 1, VIPS_MAX_COORD, 64); + +- VIPS_ARG_INT( class, "height", 5, +- _( "Height" ), +- _( "Image height in pixels" ), ++ VIPS_ARG_INT(class, "height", 5, ++ _("Height"), ++ _("Image height in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsXyz, height ), +- 1, VIPS_MAX_COORD, 64 ); ++ G_STRUCT_OFFSET(VipsXyz, height), ++ 1, VIPS_MAX_COORD, 64); + +- VIPS_ARG_INT( class, "csize", 6, +- _( "csize" ), +- _( "Size of third dimension" ), ++ VIPS_ARG_INT(class, "csize", 6, ++ _("csize"), ++ _("Size of third dimension"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsXyz, csize ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsXyz, csize), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "dsize", 7, +- _( "dsize" ), +- _( "Size of fourth dimension" ), ++ VIPS_ARG_INT(class, "dsize", 7, ++ _("dsize"), ++ _("Size of fourth dimension"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsXyz, dsize ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsXyz, dsize), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "esize", 8, +- _( "esize" ), +- _( "Size of fifth dimension" ), ++ VIPS_ARG_INT(class, "esize", 8, ++ _("esize"), ++ _("Size of fifth dimension"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsXyz, esize ), +- 1, VIPS_MAX_COORD, 1 ); +- ++ G_STRUCT_OFFSET(VipsXyz, esize), ++ 1, VIPS_MAX_COORD, 1); + } + + static void +-vips_xyz_init( VipsXyz *xyz ) ++vips_xyz_init(VipsXyz *xyz) + { + xyz->width = 64; + xyz->height = 64; +@@ -250,28 +249,28 @@ vips_xyz_init( VipsXyz *xyz ) + * + * Create a two-band uint32 image where the elements in the first band have the + * value of their x coordinate and elements in the second band have their y +- * coordinate. ++ * coordinate. + * + * You can make any image where the value of a pixel is a function of its (x, +- * y) coordinate by combining this operator with the arithmetic operators. ++ * y) coordinate by combining this operator with the arithmetic operators. + * + * Set @csize, @dsize, @esize to generate higher dimensions and add more + * bands. The extra dimensions are placed down the vertical axis. Use +- * vips_grid() to change the layout. ++ * vips_grid() to change the layout. + * + * See also: vips_grey(), vips_grid(), vips_identity(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_xyz( VipsImage **out, int width, int height, ... ) ++vips_xyz(VipsImage **out, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "xyz", ap, out, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("xyz", ap, out, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/create/zone.c b/libvips/create/zone.c +index 4c3bb6f5e8..58b44c09ee 100644 +--- a/libvips/create/zone.c ++++ b/libvips/create/zone.c +@@ -17,28 +17,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -64,10 +64,10 @@ + typedef VipsPoint VipsZone; + typedef VipsPointClass VipsZoneClass; + +-G_DEFINE_TYPE( VipsZone, vips_zone, VIPS_TYPE_POINT ); ++G_DEFINE_TYPE(VipsZone, vips_zone, VIPS_TYPE_POINT); + + static float +-vips_zone_point( VipsPoint *point, int x, int y ) ++vips_zone_point(VipsPoint *point, int x, int y) + { + VipsZone *zone = (VipsZone *) point; + +@@ -77,23 +77,23 @@ vips_zone_point( VipsPoint *point, int x, int y ) + int v2 = (y - hheight) * (y - hheight); + double c = VIPS_PI / zone->width; + +- return( cos( c * (v2 + h2) ) ); ++ return (cos(c * (v2 + h2))); + } + + static void +-vips_zone_class_init( VipsZoneClass *class ) ++vips_zone_class_init(VipsZoneClass *class) + { +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsPointClass *point_class = VIPS_POINT_CLASS( class ); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsPointClass *point_class = VIPS_POINT_CLASS(class); + + vobject_class->nickname = "zone"; +- vobject_class->description = _( "make a zone plate" ); ++ vobject_class->description = _("make a zone plate"); + + point_class->point = vips_zone_point; + } + + static void +-vips_zone_init( VipsZone *zone ) ++vips_zone_init(VipsZone *zone) + { + } + +@@ -108,23 +108,23 @@ vips_zone_init( VipsZone *zone ) + * + * * @uchar: output a uchar image + * +- * Create a one-band image of a zone plate. ++ * Create a one-band image of a zone plate. + * +- * Pixels are normally in [-1, +1], set @uchar to output [0, 255]. ++ * Pixels are normally in [-1, +1], set @uchar to output [0, 255]. + * + * See also: vips_eye(), vips_xyz(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_zone( VipsImage **out, int width, int height, ... ) ++vips_zone(VipsImage **out, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "zone", ap, out, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("zone", ap, out, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/deprecated/arith_dispatch.c b/libvips/deprecated/arith_dispatch.c +index 2445409b90..f41c2ca2b1 100644 +--- a/libvips/deprecated/arith_dispatch.c ++++ b/libvips/deprecated/arith_dispatch.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,139 +43,139 @@ + /* One image in, one out. + */ + static im_arg_desc one_in_one_out[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Two images in, one out. + */ + static im_arg_desc two_in_one_out[] = { +- IM_INPUT_IMAGE( "in1" ), +- IM_INPUT_IMAGE( "in2" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in1"), ++ IM_INPUT_IMAGE("in2"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Image in, number out. + */ + static im_arg_desc image_in_num_out[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_DOUBLE( "value" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_DOUBLE("value") + }; + + /* Args for im_recomb. + */ + static im_arg_desc recomb_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DMASK( "matrix" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DMASK("matrix") + }; + + /* Call im_recomb via arg vector. + */ + static int +-recomb_vec( im_object *argv ) ++recomb_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_recomb( argv[0], argv[1], mo->mask ) ); ++ return (im_recomb(argv[0], argv[1], mo->mask)); + } + + /* Description of im_recomb. + */ + static im_function recomb_desc = { +- "im_recomb", /* Name */ ++ "im_recomb", /* Name */ + "linear recombination with mask", +- IM_FN_PIO, /* Flags */ +- recomb_vec, /* Dispatch function */ +- IM_NUMBER( recomb_args ), /* Size of arg list */ +- recomb_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ recomb_vec, /* Dispatch function */ ++ IM_NUMBER(recomb_args), /* Size of arg list */ ++ recomb_args /* Arg list */ + }; + + /* Call im_abs via arg vector. + */ + static int +-abs_vec( im_object *argv ) ++abs_vec(im_object *argv) + { +- return( im_abs( argv[0], argv[1] ) ); ++ return (im_abs(argv[0], argv[1])); + } + + /* Description of im_abs. +- */ ++ */ + static im_function abs_desc = { +- "im_abs", /* Name */ +- N_( "absolute value" ), /* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- abs_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_abs", /* Name */ ++ N_("absolute value"), /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ abs_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_add via arg vector. + */ + static int +-add_vec( im_object *argv ) ++add_vec(im_object *argv) + { +- return( im_add( argv[0], argv[1], argv[2] ) ); ++ return (im_add(argv[0], argv[1], argv[2])); + } + + /* Description of im_add. +- */ ++ */ + static im_function add_desc = { +- "im_add", /* Name */ +- N_( "add two images" ), /* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- add_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ "im_add", /* Name */ ++ N_("add two images"), /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ add_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_avg via arg vector. + */ + static int +-avg_vec( im_object *argv ) ++avg_vec(im_object *argv) + { + double f; + +- if( im_avg( argv[0], &f ) ) +- return( -1 ); ++ if (im_avg(argv[0], &f)) ++ return (-1); + + *((double *) argv[1]) = f; +- return( 0 ); ++ return (0); + } + + /* Description of im_avg. +- */ ++ */ + static im_function avg_desc = { +- "im_avg", /* Name */ +- N_( "average value of image" ), /* Description */ +- IM_FN_PIO, /* Flags */ +- avg_vec, /* Dispatch function */ +- IM_NUMBER( image_in_num_out ), /* Size of arg list */ +- image_in_num_out /* Arg list */ ++ "im_avg", /* Name */ ++ N_("average value of image"), /* Description */ ++ IM_FN_PIO, /* Flags */ ++ avg_vec, /* Dispatch function */ ++ IM_NUMBER(image_in_num_out), /* Size of arg list */ ++ image_in_num_out /* Arg list */ + }; + + /* Args to im_point. + */ + static im_arg_desc point_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_INPUT_INTERPOLATE( "interpolate" ), +- IM_INPUT_DOUBLE( "x" ), +- IM_INPUT_DOUBLE( "y" ), +- IM_INPUT_INT( "band" ), +- IM_OUTPUT_DOUBLE( "out" ) ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_INTERPOLATE("interpolate"), ++ IM_INPUT_DOUBLE("x"), ++ IM_INPUT_DOUBLE("y"), ++ IM_INPUT_INT("band"), ++ IM_OUTPUT_DOUBLE("out") + }; + + /* Call im_point via arg vector. + */ + static int +-point_vec( im_object *argv ) ++point_vec(im_object *argv) + { +- VipsInterpolate *interpolate = VIPS_INTERPOLATE( argv[1] ); ++ VipsInterpolate *interpolate = VIPS_INTERPOLATE(argv[1]); + double x = *((double *) argv[2]); + double y = *((double *) argv[3]); + int band = *((int *) argv[4]); + +- return( im_point( argv[0], interpolate, x, y, band, argv[5] ) ); ++ return (im_point(argv[0], interpolate, x, y, band, argv[5])); + } + + /* Description of im_point. +@@ -185,696 +185,696 @@ static im_function point_desc = { + "interpolate value at single point", + IM_FN_PIO, + point_vec, +- IM_NUMBER( point_args ), ++ IM_NUMBER(point_args), + point_args + }; + + /* Args to im_point_bilinear. + */ + static im_arg_desc point_bilinear_args[] = { +- IM_INPUT_IMAGE ("in"), +- IM_INPUT_DOUBLE("x"), +- IM_INPUT_DOUBLE("y"), +- IM_INPUT_INT("band"), +- IM_OUTPUT_DOUBLE("val") ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_DOUBLE("x"), ++ IM_INPUT_DOUBLE("y"), ++ IM_INPUT_INT("band"), ++ IM_OUTPUT_DOUBLE("val") + }; + + /* Call im_point_bilinear via arg vector. + */ + static int +-point_bilinear_vec( im_object *argv ) ++point_bilinear_vec(im_object *argv) + { +- return im_point_bilinear( argv[0], *(double*)argv[1], *(double*)argv[2], *(int*)argv[3], argv[4] ); ++ return im_point_bilinear(argv[0], *(double *) argv[1], *(double *) argv[2], *(int *) argv[3], argv[4]); + } + + /* Description of im_point_bilinear. + */ + static im_function point_bilinear_desc = { +- "im_point_bilinear", +- "interpolate value at single point, linearly", +- IM_FN_PIO, +- point_bilinear_vec, +- IM_NUMBER( point_bilinear_args ), +- point_bilinear_args ++ "im_point_bilinear", ++ "interpolate value at single point, linearly", ++ IM_FN_PIO, ++ point_bilinear_vec, ++ IM_NUMBER(point_bilinear_args), ++ point_bilinear_args + }; + + /* Call im_deviate via arg vector. + */ + static int +-deviate_vec( im_object *argv ) ++deviate_vec(im_object *argv) + { + double f; + +- if( im_deviate( argv[0], &f ) ) +- return( -1 ); ++ if (im_deviate(argv[0], &f)) ++ return (-1); + + *((double *) argv[1]) = f; +- return( 0 ); ++ return (0); + } + + /* Description of im_deviate. +- */ ++ */ + static im_function deviate_desc = { +- "im_deviate", /* Name */ +- N_( "standard deviation of image" ), /* Description */ +- IM_FN_PIO, /* Flags */ +- deviate_vec, /* Dispatch function */ +- IM_NUMBER( image_in_num_out ), /* Size of arg list */ +- image_in_num_out /* Arg list */ ++ "im_deviate", /* Name */ ++ N_("standard deviation of image"), /* Description */ ++ IM_FN_PIO, /* Flags */ ++ deviate_vec, /* Dispatch function */ ++ IM_NUMBER(image_in_num_out), /* Size of arg list */ ++ image_in_num_out /* Arg list */ + }; + + /* Call im_exp10tra via arg vector. + */ + static int +-exp10tra_vec( im_object *argv ) ++exp10tra_vec(im_object *argv) + { +- return( im_exp10tra( argv[0], argv[1] ) ); ++ return (im_exp10tra(argv[0], argv[1])); + } + + /* Description of im_exp10tra. +- */ ++ */ + static im_function exp10tra_desc = { +- "im_exp10tra", /* Name */ +- N_( "10^pel of image" ), /* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- exp10tra_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_exp10tra", /* Name */ ++ N_("10^pel of image"), /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ exp10tra_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_exptra via arg vector. + */ + static int +-exptra_vec( im_object *argv ) ++exptra_vec(im_object *argv) + { +- return( im_exptra( argv[0], argv[1] ) ); ++ return (im_exptra(argv[0], argv[1])); + } + + /* Description of im_exptra. +- */ ++ */ + static im_function exptra_desc = { +- "im_exptra", /* Name */ +- N_( "e^pel of image" ), /* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- exptra_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_exptra", /* Name */ ++ N_("e^pel of image"), /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ exptra_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Args for im_powtra(). + */ + static im_arg_desc powtra_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLE( "x" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLE("x") + }; + + /* Call im_expntra via arg vector. + */ + static int +-expntra_vec( im_object *argv ) ++expntra_vec(im_object *argv) + { + double a = *((double *) argv[2]); + +- return( im_expntra( argv[0], argv[1], a ) ); ++ return (im_expntra(argv[0], argv[1], a)); + } + + /* Description of im_expntra. +- */ ++ */ + static im_function expntra_desc = { +- "im_expntra", /* Name */ +- N_( "x^pel of image" ), /* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- expntra_vec, /* Dispatch function */ +- IM_NUMBER( powtra_args ), /* Size of arg list */ +- powtra_args /* Arg list */ ++ "im_expntra", /* Name */ ++ N_("x^pel of image"), /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ expntra_vec, /* Dispatch function */ ++ IM_NUMBER(powtra_args), /* Size of arg list */ ++ powtra_args /* Arg list */ + }; + + /* Args for im_expntra_vec(). + */ + static im_arg_desc expntra_vec_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLEVEC( "v" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLEVEC("v") + }; + + /* Call im_expntra_vec() via arg vector. + */ + static int +-expntra_vec_vec( im_object *argv ) ++expntra_vec_vec(im_object *argv) + { + im_doublevec_object *rv = (im_doublevec_object *) argv[2]; + +- return( im_expntra_vec( argv[0], argv[1], rv->n, rv->vec ) ); ++ return (im_expntra_vec(argv[0], argv[1], rv->n, rv->vec)); + } + + /* Description of im_expntra_vec. +- */ ++ */ + static im_function expntra_vec_desc = { +- "im_expntra_vec", /* Name */ +- N_( "[x,y,z]^pel of image" ), /* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- expntra_vec_vec, /* Dispatch function */ +- IM_NUMBER( expntra_vec_args ), /* Size of arg list */ +- expntra_vec_args /* Arg list */ ++ "im_expntra_vec", /* Name */ ++ N_("[x,y,z]^pel of image"), /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ expntra_vec_vec, /* Dispatch function */ ++ IM_NUMBER(expntra_vec_args), /* Size of arg list */ ++ expntra_vec_args /* Arg list */ + }; + + /* Call im_divide via arg vector. + */ + static int +-divide_vec( im_object *argv ) ++divide_vec(im_object *argv) + { +- return( im_divide( argv[0], argv[1], argv[2] ) ); ++ return (im_divide(argv[0], argv[1], argv[2])); + } + + /* Description of im_divide. +- */ ++ */ + static im_function divide_desc = { +- "im_divide", /* Name */ +- N_( "divide two images" ), +- IM_FN_PIO, /* Flags */ +- divide_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ "im_divide", /* Name */ ++ N_("divide two images"), ++ IM_FN_PIO, /* Flags */ ++ divide_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_invert via arg vector. + */ + static int +-invert_vec( im_object *argv ) ++invert_vec(im_object *argv) + { +- return( im_invert( argv[0], argv[1] ) ); ++ return (im_invert(argv[0], argv[1])); + } + + /* Description of im_invert. +- */ ++ */ + static im_function invert_desc = { +- "im_invert", /* Name */ +- N_( "photographic negative" ), /* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- invert_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_invert", /* Name */ ++ N_("photographic negative"), /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ invert_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Args for im_lintra(). + */ + static im_arg_desc lintra_args[] = { +- IM_INPUT_DOUBLE( "a" ), +- IM_INPUT_IMAGE( "in" ), +- IM_INPUT_DOUBLE( "b" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_DOUBLE("a"), ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_DOUBLE("b"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Call im_lintra() via arg vector. + */ + static int +-lintra_vec( im_object *argv ) ++lintra_vec(im_object *argv) + { + double a = *((double *) argv[0]); + double b = *((double *) argv[2]); + +- return( im_lintra( a, argv[1], b, argv[3] ) ); ++ return (im_lintra(a, argv[1], b, argv[3])); + } + + /* Description of im_lintra(). +- */ ++ */ + static im_function lintra_desc = { +- "im_lintra", /* Name */ +- N_( "calculate a*in + b = outfile" ), +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- lintra_vec, /* Dispatch function */ +- IM_NUMBER( lintra_args ), /* Size of arg list */ +- lintra_args /* Arg list */ ++ "im_lintra", /* Name */ ++ N_("calculate a*in + b = outfile"), ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ lintra_vec, /* Dispatch function */ ++ IM_NUMBER(lintra_args), /* Size of arg list */ ++ lintra_args /* Arg list */ + }; + + /* Args for im_lintra_vec(). + */ + static im_arg_desc lintra_vec_args[] = { +- IM_INPUT_DOUBLEVEC( "a" ), +- IM_INPUT_IMAGE( "in" ), +- IM_INPUT_DOUBLEVEC( "b" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_DOUBLEVEC("a"), ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_DOUBLEVEC("b"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Call im_lintra_vec() via arg vector. + */ + static int +-lintra_vec_vec( im_object *argv ) ++lintra_vec_vec(im_object *argv) + { + im_doublevec_object *dva = (im_doublevec_object *) argv[0]; + im_doublevec_object *dvb = (im_doublevec_object *) argv[2]; + +- if( dva->n != dvb->n ) { +- im_error( "im_lintra_vec", +- "%s", _( "vectors not equal length" ) ); +- return( -1 ); ++ if (dva->n != dvb->n) { ++ im_error("im_lintra_vec", ++ "%s", _("vectors not equal length")); ++ return (-1); + } + +- return( im_lintra_vec( dva->n, dva->vec, argv[1], dvb->vec, argv[3] ) ); ++ return (im_lintra_vec(dva->n, dva->vec, argv[1], dvb->vec, argv[3])); + } + + /* Description of im_lintra_vec(). +- */ ++ */ + static im_function lintra_vec_desc = { +- "im_lintra_vec", /* Name */ +- N_( "calculate a*in + b -> out, a and b vectors" ), ++ "im_lintra_vec", /* Name */ ++ N_("calculate a*in + b -> out, a and b vectors"), + IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- lintra_vec_vec, /* Dispatch function */ +- IM_NUMBER( lintra_vec_args ), /* Size of arg list */ +- lintra_vec_args /* Arg list */ ++ lintra_vec_vec, /* Dispatch function */ ++ IM_NUMBER(lintra_vec_args), /* Size of arg list */ ++ lintra_vec_args /* Arg list */ + }; + + /* Call im_log10tra via arg vector. + */ + static int +-log10tra_vec( im_object *argv ) ++log10tra_vec(im_object *argv) + { +- return( im_log10tra( argv[0], argv[1] ) ); ++ return (im_log10tra(argv[0], argv[1])); + } + + /* Description of im_log10tra. +- */ ++ */ + static im_function log10tra_desc = { +- "im_log10tra", /* Name */ +- N_( "log10 of image" ), /* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- log10tra_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_log10tra", /* Name */ ++ N_("log10 of image"), /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ log10tra_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_logtra via arg vector. + */ + static int +-logtra_vec( im_object *argv ) ++logtra_vec(im_object *argv) + { +- return( im_logtra( argv[0], argv[1] ) ); ++ return (im_logtra(argv[0], argv[1])); + } + + /* Description of im_logtra. +- */ ++ */ + static im_function logtra_desc = { +- "im_logtra", /* Name */ +- N_( "ln of image" ), /* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- logtra_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_logtra", /* Name */ ++ N_("ln of image"), /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ logtra_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_tantra via arg vector. + */ + static int +-tantra_vec( im_object *argv ) ++tantra_vec(im_object *argv) + { +- return( im_tantra( argv[0], argv[1] ) ); ++ return (im_tantra(argv[0], argv[1])); + } + + /* Description of im_tantra. +- */ ++ */ + static im_function tantra_desc = { +- "im_tantra", /* Name */ +- N_( "tan of image (angles in degrees)" ), +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- tantra_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_tantra", /* Name */ ++ N_("tan of image (angles in degrees)"), ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ tantra_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_atantra via arg vector. + */ + static int +-atantra_vec( im_object *argv ) ++atantra_vec(im_object *argv) + { +- return( im_atantra( argv[0], argv[1] ) ); ++ return (im_atantra(argv[0], argv[1])); + } + + /* Description of im_atantra. +- */ ++ */ + static im_function atantra_desc = { +- "im_atantra", /* Name */ +- N_( "atan of image (result in degrees)" ), +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- atantra_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_atantra", /* Name */ ++ N_("atan of image (result in degrees)"), ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ atantra_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_costra via arg vector. + */ + static int +-costra_vec( im_object *argv ) ++costra_vec(im_object *argv) + { +- return( im_costra( argv[0], argv[1] ) ); ++ return (im_costra(argv[0], argv[1])); + } + + /* Description of im_costra. +- */ ++ */ + static im_function costra_desc = { +- "im_costra", /* Name */ +- N_( "cos of image (angles in degrees)" ), +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- costra_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_costra", /* Name */ ++ N_("cos of image (angles in degrees)"), ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ costra_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_acostra via arg vector. + */ + static int +-acostra_vec( im_object *argv ) ++acostra_vec(im_object *argv) + { +- return( im_acostra( argv[0], argv[1] ) ); ++ return (im_acostra(argv[0], argv[1])); + } + + /* Description of im_acostra. +- */ ++ */ + static im_function acostra_desc = { +- "im_acostra", /* Name */ +- N_( "acos of image (result in degrees)" ), +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- acostra_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_acostra", /* Name */ ++ N_("acos of image (result in degrees)"), ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ acostra_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_ceil via arg vector. + */ + static int +-ceil_vec( im_object *argv ) ++ceil_vec(im_object *argv) + { +- return( im_ceil( argv[0], argv[1] ) ); ++ return (im_ceil(argv[0], argv[1])); + } + + /* Description of im_ceil. +- */ ++ */ + static im_function ceil_desc = { +- "im_ceil", /* Name */ +- N_( "round to smallest integer value not less than" ), +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- ceil_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_ceil", /* Name */ ++ N_("round to smallest integer value not less than"), ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ ceil_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_floor via arg vector. + */ + static int +-floor_vec( im_object *argv ) ++floor_vec(im_object *argv) + { +- return( im_floor( argv[0], argv[1] ) ); ++ return (im_floor(argv[0], argv[1])); + } + + /* Description of im_floor. +- */ ++ */ + static im_function floor_desc = { +- "im_floor", /* Name */ +- N_( "round to largest integer value not greater than" ), +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- floor_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_floor", /* Name */ ++ N_("round to largest integer value not greater than"), ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ floor_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_rint via arg vector. + */ + static int +-rint_vec( im_object *argv ) ++rint_vec(im_object *argv) + { +- return( im_rint( argv[0], argv[1] ) ); ++ return (im_rint(argv[0], argv[1])); + } + + /* Description of im_rint. +- */ ++ */ + static im_function rint_desc = { +- "im_rint", /* Name */ +- N_( "round to nearest integer value" ), +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- rint_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_rint", /* Name */ ++ N_("round to nearest integer value"), ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ rint_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_sintra via arg vector. + */ + static int +-sintra_vec( im_object *argv ) ++sintra_vec(im_object *argv) + { +- return( im_sintra( argv[0], argv[1] ) ); ++ return (im_sintra(argv[0], argv[1])); + } + + /* Description of im_sintra. +- */ ++ */ + static im_function sintra_desc = { +- "im_sintra", /* Name */ +- N_( "sin of image (angles in degrees)" ), +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- sintra_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_sintra", /* Name */ ++ N_("sin of image (angles in degrees)"), ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ sintra_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_bandmean via arg vector. + */ + static int +-bandmean_vec( im_object *argv ) ++bandmean_vec(im_object *argv) + { +- return( im_bandmean( argv[0], argv[1] ) ); ++ return (im_bandmean(argv[0], argv[1])); + } + + /* Description of im_bandmean. +- */ ++ */ + static im_function bandmean_desc = { +- "im_bandmean", /* Name */ +- N_( "average image bands" ), +- IM_FN_PIO, /* Flags */ +- bandmean_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_bandmean", /* Name */ ++ N_("average image bands"), ++ IM_FN_PIO, /* Flags */ ++ bandmean_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_sign via arg vector. + */ + static int +-sign_vec( im_object *argv ) ++sign_vec(im_object *argv) + { +- return( im_sign( argv[0], argv[1] ) ); ++ return (im_sign(argv[0], argv[1])); + } + + /* Description of im_sign. +- */ ++ */ + static im_function sign_desc = { +- "im_sign", /* Name */ +- N_( "unit vector in direction of value" ), +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- sign_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_sign", /* Name */ ++ N_("unit vector in direction of value"), ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ sign_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_asintra via arg vector. + */ + static int +-asintra_vec( im_object *argv ) ++asintra_vec(im_object *argv) + { +- return( im_asintra( argv[0], argv[1] ) ); ++ return (im_asintra(argv[0], argv[1])); + } + + /* Description of im_asintra. +- */ ++ */ + static im_function asintra_desc = { +- "im_asintra", /* Name */ +- N_( "asin of image (result in degrees)" ), +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- asintra_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_asintra", /* Name */ ++ N_("asin of image (result in degrees)"), ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ asintra_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_max via arg vector. + */ + static int +-max_vec( im_object *argv ) ++max_vec(im_object *argv) + { + double f; + +- if( im_max( argv[0], &f ) ) +- return( -1 ); ++ if (im_max(argv[0], &f)) ++ return (-1); + *((double *) argv[1]) = f; + +- return( 0 ); ++ return (0); + } + + /* Description of im_max. +- */ ++ */ + static im_function max_desc = { +- "im_max", /* Name */ +- N_( "maximum value of image" ), /* Description */ +- IM_FN_PIO, /* Flags */ +- max_vec, /* Dispatch function */ +- IM_NUMBER( image_in_num_out ), /* Size of arg list */ +- image_in_num_out /* Arg list */ ++ "im_max", /* Name */ ++ N_("maximum value of image"), /* Description */ ++ IM_FN_PIO, /* Flags */ ++ max_vec, /* Dispatch function */ ++ IM_NUMBER(image_in_num_out), /* Size of arg list */ ++ image_in_num_out /* Arg list */ + }; + + /* Args for maxpos (and minpos). + */ + static im_arg_desc maxpos_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_COMPLEX( "position" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_COMPLEX("position") + }; + + /* Call im_maxpos via arg vector. + */ + static int +-maxpos_vec( im_object *argv ) ++maxpos_vec(im_object *argv) + { + double f; + int x, y; + +- if( im_maxpos( argv[0], &x, &y, &f ) ) +- return( -1 ); ++ if (im_maxpos(argv[0], &x, &y, &f)) ++ return (-1); + + ((double *) argv[1])[0] = x; + ((double *) argv[1])[1] = y; + +- return( 0 ); ++ return (0); + } + + /* Description of im_maxpos. +- */ ++ */ + static im_function maxpos_desc = { +- "im_maxpos", /* Name */ +- N_( "position of maximum value of image" ), +- 0, /* Flags */ +- maxpos_vec, /* Dispatch function */ +- IM_NUMBER( maxpos_args ), /* Size of arg list */ +- maxpos_args /* Arg list */ ++ "im_maxpos", /* Name */ ++ N_("position of maximum value of image"), ++ 0, /* Flags */ ++ maxpos_vec, /* Dispatch function */ ++ IM_NUMBER(maxpos_args), /* Size of arg list */ ++ maxpos_args /* Arg list */ + }; + + /* Args to im_maxpos_avg. + */ + static im_arg_desc maxpos_avg_args[] = { +- IM_INPUT_IMAGE ("in"), +- IM_OUTPUT_DOUBLE("x"), +- IM_OUTPUT_DOUBLE("y"), +- IM_OUTPUT_DOUBLE("out") ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_DOUBLE("x"), ++ IM_OUTPUT_DOUBLE("y"), ++ IM_OUTPUT_DOUBLE("out") + }; + + /* Call im_maxpos_avg via arg vector. + */ + static int +-maxpos_avg_vec( im_object *argv ) ++maxpos_avg_vec(im_object *argv) + { +- return im_maxpos_avg( argv[0], argv[1], argv[2], argv[3] ); ++ return im_maxpos_avg(argv[0], argv[1], argv[2], argv[3]); + } + + /* Description of im_maxpos_avg. + */ + static im_function maxpos_avg_desc = { +- "im_maxpos_avg", +- N_( "position of maximum value of image, averaging in case of draw" ), +- IM_FN_PIO, +- maxpos_avg_vec, +- IM_NUMBER( maxpos_avg_args ), +- maxpos_avg_args ++ "im_maxpos_avg", ++ N_("position of maximum value of image, averaging in case of draw"), ++ IM_FN_PIO, ++ maxpos_avg_vec, ++ IM_NUMBER(maxpos_avg_args), ++ maxpos_avg_args + }; + + /* Args to im_min/maxpos_vec. + */ + static im_arg_desc maxpos_vec_args[] = { +- IM_INPUT_IMAGE ("in"), +- IM_INPUT_INT ("n"), +- IM_OUTPUT_INTVEC("xes"), +- IM_OUTPUT_INTVEC("yes"), +- IM_OUTPUT_DOUBLEVEC("maxima") ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_INT("n"), ++ IM_OUTPUT_INTVEC("xes"), ++ IM_OUTPUT_INTVEC("yes"), ++ IM_OUTPUT_DOUBLEVEC("maxima") + }; + + /* Call im_maxpos_vec via arg vector. + */ + static int +-maxpos_vec_vec( im_object *argv ) ++maxpos_vec_vec(im_object *argv) + { +- int n = *((int *) argv[1]); +- im_intvec_object *xes = argv[2]; +- im_intvec_object *yes = argv[3]; +- im_doublevec_object *maxima = argv[4]; +- +- xes->vec = IM_ARRAY( NULL, n, int ); +- xes->n = n; +- yes->vec = IM_ARRAY( NULL, n, int ); +- yes->n = n; +- maxima->vec = IM_ARRAY( NULL, n, double ); +- maxima->n = n; +- if( !xes->vec || !yes->vec || !maxima->vec || +- im_maxpos_vec( argv[0], xes->vec, yes->vec, maxima->vec, n ) ) +- return -1; +- +- return 0; ++ int n = *((int *) argv[1]); ++ im_intvec_object *xes = argv[2]; ++ im_intvec_object *yes = argv[3]; ++ im_doublevec_object *maxima = argv[4]; ++ ++ xes->vec = IM_ARRAY(NULL, n, int); ++ xes->n = n; ++ yes->vec = IM_ARRAY(NULL, n, int); ++ yes->n = n; ++ maxima->vec = IM_ARRAY(NULL, n, double); ++ maxima->n = n; ++ if (!xes->vec || !yes->vec || !maxima->vec || ++ im_maxpos_vec(argv[0], xes->vec, yes->vec, maxima->vec, n)) ++ return -1; ++ ++ return 0; + } + + /* Description of im_maxpos_vec. + */ + static im_function maxpos_vec_desc = { +- "im_maxpos_vec", +- N_( "position and value of n maxima of image" ), +- IM_FN_PIO, +- maxpos_vec_vec, +- IM_NUMBER( maxpos_vec_args ), +- maxpos_vec_args ++ "im_maxpos_vec", ++ N_("position and value of n maxima of image"), ++ IM_FN_PIO, ++ maxpos_vec_vec, ++ IM_NUMBER(maxpos_vec_args), ++ maxpos_vec_args + }; + + /* Call im_minpos_vec via arg vector. + */ + static int +-minpos_vec_vec( im_object *argv ) ++minpos_vec_vec(im_object *argv) + { +- int n = *((int *) argv[1]); +- im_intvec_object *xes = argv[2]; +- im_intvec_object *yes = argv[3]; +- im_doublevec_object *minima = argv[4]; +- +- xes->vec = IM_ARRAY( NULL, n, int ); +- xes->n = n; +- yes->vec = IM_ARRAY( NULL, n, int ); +- yes->n = n; +- minima->vec = IM_ARRAY( NULL, n, double ); +- minima->n = n; +- if( !xes->vec || !yes->vec || !minima->vec || +- im_minpos_vec( argv[0], xes->vec, yes->vec, minima->vec, n ) ) +- return -1; +- +- return 0; ++ int n = *((int *) argv[1]); ++ im_intvec_object *xes = argv[2]; ++ im_intvec_object *yes = argv[3]; ++ im_doublevec_object *minima = argv[4]; ++ ++ xes->vec = IM_ARRAY(NULL, n, int); ++ xes->n = n; ++ yes->vec = IM_ARRAY(NULL, n, int); ++ yes->n = n; ++ minima->vec = IM_ARRAY(NULL, n, double); ++ minima->n = n; ++ if (!xes->vec || !yes->vec || !minima->vec || ++ im_minpos_vec(argv[0], xes->vec, yes->vec, minima->vec, n)) ++ return -1; ++ ++ return 0; + } + + /* Description of im_minpos_vec. + */ + static im_function minpos_vec_desc = { +- "im_minpos_vec", +- N_( "position and value of n minima of image" ), +- IM_FN_PIO, +- minpos_vec_vec, +- IM_NUMBER( maxpos_vec_args ), +- maxpos_vec_args ++ "im_minpos_vec", ++ N_("position and value of n minima of image"), ++ IM_FN_PIO, ++ minpos_vec_vec, ++ IM_NUMBER(maxpos_vec_args), ++ maxpos_vec_args + }; + + /* Args for measure. + */ + static im_arg_desc measure_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_DMASK( "mask" ), +- IM_INPUT_INT( "x" ), +- IM_INPUT_INT( "y" ), +- IM_INPUT_INT( "w" ), +- IM_INPUT_INT( "h" ), +- IM_INPUT_INT( "h_patches" ), +- IM_INPUT_INT( "v_patches" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_DMASK("mask"), ++ IM_INPUT_INT("x"), ++ IM_INPUT_INT("y"), ++ IM_INPUT_INT("w"), ++ IM_INPUT_INT("h"), ++ IM_INPUT_INT("h_patches"), ++ IM_INPUT_INT("v_patches") + }; + + /* Call im_measure via arg vector. + */ + static int +-measure_vec( im_object *argv ) ++measure_vec(im_object *argv) + { + im_mask_object *mo = argv[1]; + +@@ -886,333 +886,333 @@ measure_vec( im_object *argv ) + int u = *((int *) argv[6]); + int v = *((int *) argv[7]); + +- if( !(mo->mask = +- im_measure_area( argv[0], +- x, y, w, h, u, v, NULL, 0, mo->name )) ) { +- return( -1 ); ++ if (!(mo->mask = ++ im_measure_area(argv[0], ++ x, y, w, h, u, v, NULL, 0, mo->name))) { ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Description of im_measure. + */ + static im_function measure_desc = { +- "im_measure", /* Name */ +- N_( "measure averages of a grid of patches" ), +- IM_FN_PIO, /* Flags */ +- measure_vec, /* Dispatch function */ +- IM_NUMBER( measure_args ), /* Size of arg list */ +- measure_args /* Arg list */ ++ "im_measure", /* Name */ ++ N_("measure averages of a grid of patches"), ++ IM_FN_PIO, /* Flags */ ++ measure_vec, /* Dispatch function */ ++ IM_NUMBER(measure_args), /* Size of arg list */ ++ measure_args /* Arg list */ + }; + + /* Call im_min via arg vector. + */ + static int +-min_vec( im_object *argv ) ++min_vec(im_object *argv) + { + double f; + +- if( im_min( argv[0], &f ) ) +- return( -1 ); ++ if (im_min(argv[0], &f)) ++ return (-1); + *((double *) argv[1]) = f; + +- return( 0 ); ++ return (0); + } + + /* Description of im_min. +- */ ++ */ + static im_function min_desc = { +- "im_min", /* Name */ +- N_( "minimum value of image" ), /* Description */ +- IM_FN_PIO, /* Flags */ +- min_vec, /* Dispatch function */ +- IM_NUMBER( image_in_num_out ), /* Size of arg list */ +- image_in_num_out /* Arg list */ ++ "im_min", /* Name */ ++ N_("minimum value of image"), /* Description */ ++ IM_FN_PIO, /* Flags */ ++ min_vec, /* Dispatch function */ ++ IM_NUMBER(image_in_num_out), /* Size of arg list */ ++ image_in_num_out /* Arg list */ + }; + + /* Call im_minpos via arg vector. + */ + static int +-minpos_vec( im_object *argv ) ++minpos_vec(im_object *argv) + { + double f; + int x, y; + +- if( im_minpos( argv[0], &x, &y, &f ) ) +- return( -1 ); ++ if (im_minpos(argv[0], &x, &y, &f)) ++ return (-1); + + ((double *) argv[1])[0] = x; + ((double *) argv[1])[1] = y; + +- return( 0 ); ++ return (0); + } + + /* Description of im_minpos. +- */ ++ */ + static im_function minpos_desc = { +- "im_minpos", /* Name */ +- N_( "position of minimum value of image" ), +- 0, /* Flags */ +- minpos_vec, /* Dispatch function */ +- IM_NUMBER( maxpos_args ), /* Size of arg list */ +- maxpos_args /* Arg list */ ++ "im_minpos", /* Name */ ++ N_("position of minimum value of image"), ++ 0, /* Flags */ ++ minpos_vec, /* Dispatch function */ ++ IM_NUMBER(maxpos_args), /* Size of arg list */ ++ maxpos_args /* Arg list */ + }; + + /* Call im_remainder via arg vector. + */ + static int +-remainder_vec( im_object *argv ) ++remainder_vec(im_object *argv) + { +- return( im_remainder( argv[0], argv[1], argv[2] ) ); ++ return (im_remainder(argv[0], argv[1], argv[2])); + } + + /* Description of im_remainder. +- */ ++ */ + static im_function remainder_desc = { +- "im_remainder", /* Name */ +- N_( "remainder after integer division" ), /* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- remainder_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ "im_remainder", /* Name */ ++ N_("remainder after integer division"), /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ remainder_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_remainderconst via arg vector. + */ + static int +-remainderconst_vec( im_object *argv ) ++remainderconst_vec(im_object *argv) + { + double c = *((double *) argv[2]); + +- return( im_remainderconst( argv[0], argv[1], c ) ); ++ return (im_remainderconst(argv[0], argv[1], c)); + } + + /* Args for im_remainderconst(). + */ + static im_arg_desc remainderconst_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLE( "x" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLE("x") + }; + + /* Description of im_remainderconst. +- */ ++ */ + static im_function remainderconst_desc = { +- "im_remainderconst", /* Name */ +- N_( "remainder after integer division by a constant" ),/* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- remainderconst_vec, /* Dispatch function */ +- IM_NUMBER( remainderconst_args ),/* Size of arg list */ +- remainderconst_args /* Arg list */ ++ "im_remainderconst", /* Name */ ++ N_("remainder after integer division by a constant"), /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ remainderconst_vec, /* Dispatch function */ ++ IM_NUMBER(remainderconst_args), /* Size of arg list */ ++ remainderconst_args /* Arg list */ + }; + + /* Call im_remainder_vec via arg vector. + */ + static int +-remainder_vec_vec( im_object *argv ) ++remainder_vec_vec(im_object *argv) + { + im_doublevec_object *dv = (im_doublevec_object *) argv[2]; + +- return( im_remainder_vec( argv[0], argv[1], dv->n, dv->vec ) ); ++ return (im_remainder_vec(argv[0], argv[1], dv->n, dv->vec)); + } + + /* Args for im_remainder_vec(). + */ + static im_arg_desc remainder_vec_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLEVEC( "x" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLEVEC("x") + }; + + /* Description of im_remainder_vec. +- */ ++ */ + static im_function remainder_vec_desc = { +- "im_remainder_vec", /* Name */ +- N_( "remainder after integer division by a vector of constants" ), +- /* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- remainder_vec_vec, /* Dispatch function */ +- IM_NUMBER( remainder_vec_args ),/* Size of arg list */ +- remainder_vec_args /* Arg list */ ++ "im_remainder_vec", /* Name */ ++ N_("remainder after integer division by a vector of constants"), ++ /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ remainder_vec_vec, /* Dispatch function */ ++ IM_NUMBER(remainder_vec_args), /* Size of arg list */ ++ remainder_vec_args /* Arg list */ + }; + + /* Call im_multiply via arg vector. + */ + static int +-multiply_vec( im_object *argv ) ++multiply_vec(im_object *argv) + { +- return( im_multiply( argv[0], argv[1], argv[2] ) ); ++ return (im_multiply(argv[0], argv[1], argv[2])); + } + + /* Description of im_multiply. +- */ ++ */ + static im_function multiply_desc = { +- "im_multiply", /* Name */ +- N_( "multiply two images" ), /* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- multiply_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ "im_multiply", /* Name */ ++ N_("multiply two images"), /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ multiply_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_powtra() via arg vector. + */ + static int +-powtra_vec( im_object *argv ) ++powtra_vec(im_object *argv) + { + double a = *((double *) argv[2]); + +- return( im_powtra( argv[0], argv[1], a ) ); ++ return (im_powtra(argv[0], argv[1], a)); + } + + /* Description of im_powtra(). +- */ ++ */ + static im_function powtra_desc = { +- "im_powtra", /* Name */ +- N_( "pel^x of image" ), +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- powtra_vec, /* Dispatch function */ +- IM_NUMBER( powtra_args ), /* Size of arg list */ +- powtra_args /* Arg list */ ++ "im_powtra", /* Name */ ++ N_("pel^x of image"), ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ powtra_vec, /* Dispatch function */ ++ IM_NUMBER(powtra_args), /* Size of arg list */ ++ powtra_args /* Arg list */ + }; + + /* Call im_powtra_vec() via arg vector. + */ + static int +-powtra_vec_vec( im_object *argv ) ++powtra_vec_vec(im_object *argv) + { + im_doublevec_object *rv = (im_doublevec_object *) argv[2]; + +- return( im_powtra_vec( argv[0], argv[1], rv->n, rv->vec ) ); ++ return (im_powtra_vec(argv[0], argv[1], rv->n, rv->vec)); + } + + /* Description of im_powtra_vec(). +- */ ++ */ + static im_function powtra_vec_desc = { +- "im_powtra_vec", /* Name */ +- N_( "pel^[x,y,z] of image" ), +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- powtra_vec_vec, /* Dispatch function */ +- IM_NUMBER( expntra_vec_args ), /* Size of arg list */ +- expntra_vec_args /* Arg list */ ++ "im_powtra_vec", /* Name */ ++ N_("pel^[x,y,z] of image"), ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ powtra_vec_vec, /* Dispatch function */ ++ IM_NUMBER(expntra_vec_args), /* Size of arg list */ ++ expntra_vec_args /* Arg list */ + }; + + /* Args for im_stats. + */ + static im_arg_desc stats_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_DMASK_STATS( "statistics" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_DMASK_STATS("statistics") + }; + + /* Call im_stats() via arg vector. + */ + static int +-stats_vec( im_object *argv ) ++stats_vec(im_object *argv) + { + im_mask_object *mo = argv[1]; + +- if( !(mo->mask = im_stats( argv[0] )) ) +- return( -1 ); ++ if (!(mo->mask = im_stats(argv[0]))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_stats(). +- */ ++ */ + static im_function stats_desc = { +- "im_stats", /* Name */ +- N_( "many image statistics in one pass" ), +- IM_FN_PIO, /* Flags */ +- stats_vec, /* Dispatch function */ +- IM_NUMBER( stats_args ), /* Size of arg list */ +- stats_args /* Arg list */ ++ "im_stats", /* Name */ ++ N_("many image statistics in one pass"), ++ IM_FN_PIO, /* Flags */ ++ stats_vec, /* Dispatch function */ ++ IM_NUMBER(stats_args), /* Size of arg list */ ++ stats_args /* Arg list */ + }; + + /* Call im_subtract via arg vector. + */ + static int +-subtract_vec( im_object *argv ) ++subtract_vec(im_object *argv) + { +- return( im_subtract( argv[0], argv[1], argv[2] ) ); ++ return (im_subtract(argv[0], argv[1], argv[2])); + } + + /* Description of im_subtract. +- */ ++ */ + static im_function subtract_desc = { +- "im_subtract", /* Name */ +- N_( "subtract two images" ), /* Description */ +- IM_FN_PIO, /* Flags */ +- subtract_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ "im_subtract", /* Name */ ++ N_("subtract two images"), /* Description */ ++ IM_FN_PIO, /* Flags */ ++ subtract_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Args for im_linreg. + */ + static im_arg_desc linreg_args[] = { +- IM_INPUT_IMAGEVEC( "ins" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLEVEC( "xs" ) ++ IM_INPUT_IMAGEVEC("ins"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLEVEC("xs") + }; + + /* Call im_linreg() via arg vector. + */ + static int +-linreg_vec( im_object *argv ) ++linreg_vec(im_object *argv) + { + #define FUNCTION_NAME "im_linreg_vec" +- im_imagevec_object *ins_vec= (im_imagevec_object*) argv[0]; +- im_doublevec_object *xs_vec= (im_doublevec_object*) argv[2]; +- IMAGE *out= (IMAGE*) argv[1]; +- IMAGE **ins= IM_ARRAY( out, ins_vec-> n + 1, IMAGE* ); +- int i; +- +- if( ! ins ) +- return -1; +- +- for( i= 0; i < ins_vec-> n; ++i ) +- ins[ i ]= ins_vec-> vec[ i ]; +- +- ins[ ins_vec-> n ]= NULL; +- +- if( xs_vec-> n != ins_vec-> n ){ +- im_error( FUNCTION_NAME, "image vector and x vector differ in length" ); +- return -1; +- } +- return im_linreg( ins, out, xs_vec-> vec ); ++ im_imagevec_object *ins_vec = (im_imagevec_object *) argv[0]; ++ im_doublevec_object *xs_vec = (im_doublevec_object *) argv[2]; ++ IMAGE *out = (IMAGE *) argv[1]; ++ IMAGE **ins = IM_ARRAY(out, ins_vec->n + 1, IMAGE *); ++ int i; ++ ++ if (!ins) ++ return -1; ++ ++ for (i = 0; i < ins_vec->n; ++i) ++ ins[i] = ins_vec->vec[i]; ++ ++ ins[ins_vec->n] = NULL; ++ ++ if (xs_vec->n != ins_vec->n) { ++ im_error(FUNCTION_NAME, "image vector and x vector differ in length"); ++ return -1; ++ } ++ return im_linreg(ins, out, xs_vec->vec); + + #undef FUNCTION_NAME + } + + /* Description of im_linreg(). +- */ ++ */ + static im_function linreg_desc = { +- "im_linreg", /* Name */ +- N_( "pixelwise linear regression" ), +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- linreg_vec, /* Dispatch function */ +- IM_NUMBER( linreg_args ), /* Size of arg list */ +- linreg_args /* Arg list */ ++ "im_linreg", /* Name */ ++ N_("pixelwise linear regression"), ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ linreg_vec, /* Dispatch function */ ++ IM_NUMBER(linreg_args), /* Size of arg list */ ++ linreg_args /* Arg list */ + }; + + /* Call im_cross_phase via arg vector. + */ + static int +-cross_phase_vec( im_object *argv ) ++cross_phase_vec(im_object *argv) + { +- return( im_cross_phase( argv[0], argv[1], argv[2] ) ); ++ return (im_cross_phase(argv[0], argv[1], argv[2])); + } + + /* Description of im_cross_phase. +- */ ++ */ + static im_function cross_phase_desc = { +- "im_cross_phase", /* Name */ +- N_( "phase of cross power spectrum of two complex images" ), /* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- cross_phase_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ "im_cross_phase", /* Name */ ++ N_("phase of cross power spectrum of two complex images"), /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ cross_phase_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Package up all these functions. +@@ -1224,9 +1224,9 @@ static im_function *arith_list[] = { + &asintra_desc, + &atantra_desc, + &avg_desc, +- &point_desc, +- &point_bilinear_desc, +- &bandmean_desc, ++ &point_desc, ++ &point_bilinear_desc, ++ &bandmean_desc, + &ceil_desc, + &costra_desc, + &cross_phase_desc, +@@ -1270,6 +1270,6 @@ static im_function *arith_list[] = { + */ + im_package im__arithmetic = { + "arithmetic", +- IM_NUMBER( arith_list ), ++ IM_NUMBER(arith_list), + arith_list + }; +diff --git a/libvips/deprecated/cimg_dispatch.c b/libvips/deprecated/cimg_dispatch.c +index 32c7a73fa7..08aaeae377 100644 +--- a/libvips/deprecated/cimg_dispatch.c ++++ b/libvips/deprecated/cimg_dispatch.c +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -39,113 +39,113 @@ + #include + + static int +-greyc_vec( im_object *argv ) ++greyc_vec(im_object *argv) + { +- IMAGE *src = (IMAGE *) argv[0]; +- IMAGE *dst = (IMAGE *) argv[1]; +- +- int iterations = *((int *) argv[2]); +- double amplitude = *((double *) argv[3]); +- double sharpness = *((double *) argv[4]); +- double anisotropy = *((double *) argv[5]); +- double alpha = *((double *) argv[6]); ++ IMAGE *src = (IMAGE *) argv[0]; ++ IMAGE *dst = (IMAGE *) argv[1]; ++ ++ int iterations = *((int *) argv[2]); ++ double amplitude = *((double *) argv[3]); ++ double sharpness = *((double *) argv[4]); ++ double anisotropy = *((double *) argv[5]); ++ double alpha = *((double *) argv[6]); + double sigma = *((double *) argv[7]); +- double dl = *((double *) argv[8]); +- double da = *((double *) argv[9]); +- double gauss_prec = *((double *) argv[10]); +- int interpolation = *((int *) argv[11]); +- int fast_approx = *((int *) argv[12]); +- +- if( im_greyc_mask( src, dst, NULL, +- iterations, +- amplitude, sharpness, anisotropy, +- alpha, sigma, +- dl, da, gauss_prec, +- interpolation, fast_approx ) ) +- return( -1 ); +- +- return( 0 ); ++ double dl = *((double *) argv[8]); ++ double da = *((double *) argv[9]); ++ double gauss_prec = *((double *) argv[10]); ++ int interpolation = *((int *) argv[11]); ++ int fast_approx = *((int *) argv[12]); ++ ++ if (im_greyc_mask(src, dst, NULL, ++ iterations, ++ amplitude, sharpness, anisotropy, ++ alpha, sigma, ++ dl, da, gauss_prec, ++ interpolation, fast_approx)) ++ return (-1); ++ ++ return (0); + } + + static im_arg_desc greyc_arg_types[] = { +- IM_INPUT_IMAGE( "src" ), +- IM_OUTPUT_IMAGE( "dst" ), +- IM_INPUT_INT( "iterations" ), +- IM_INPUT_DOUBLE( "amplitude" ), +- IM_INPUT_DOUBLE( "sharpness" ), +- IM_INPUT_DOUBLE( "anisotropy" ), +- IM_INPUT_DOUBLE( "alpha" ), +- IM_INPUT_DOUBLE( "sigma" ), +- IM_INPUT_DOUBLE( "dl" ), +- IM_INPUT_DOUBLE( "da" ), +- IM_INPUT_DOUBLE( "gauss_prec" ), +- IM_INPUT_INT( "interpolation" ), +- IM_INPUT_INT( "fast_approx" ) ++ IM_INPUT_IMAGE("src"), ++ IM_OUTPUT_IMAGE("dst"), ++ IM_INPUT_INT("iterations"), ++ IM_INPUT_DOUBLE("amplitude"), ++ IM_INPUT_DOUBLE("sharpness"), ++ IM_INPUT_DOUBLE("anisotropy"), ++ IM_INPUT_DOUBLE("alpha"), ++ IM_INPUT_DOUBLE("sigma"), ++ IM_INPUT_DOUBLE("dl"), ++ IM_INPUT_DOUBLE("da"), ++ IM_INPUT_DOUBLE("gauss_prec"), ++ IM_INPUT_INT("interpolation"), ++ IM_INPUT_INT("fast_approx") + }; + + static im_function greyc_desc = { +- "im_greyc", /* Name */ +- "noise-removing filter", /* Description */ +- (im_fn_flags) (IM_FN_TRANSFORM | IM_FN_PIO),/* Flags */ +- greyc_vec, /* Dispatch function */ +- IM_NUMBER( greyc_arg_types ), /* Size of arg list */ +- greyc_arg_types /* Arg list */ ++ "im_greyc", /* Name */ ++ "noise-removing filter", /* Description */ ++ (im_fn_flags) (IM_FN_TRANSFORM | IM_FN_PIO), /* Flags */ ++ greyc_vec, /* Dispatch function */ ++ IM_NUMBER(greyc_arg_types), /* Size of arg list */ ++ greyc_arg_types /* Arg list */ + }; + + static int +-greyc_mask_vec( im_object *argv ) ++greyc_mask_vec(im_object *argv) + { +- IMAGE *src = (IMAGE *) argv[0]; +- IMAGE *dst = (IMAGE *) argv[1]; +- IMAGE *mask = (IMAGE *) argv[2]; +- +- int iterations = *((int *) argv[3]); +- double amplitude = *((double *) argv[4]); +- double sharpness = *((double *) argv[5]); +- double anisotropy = *((double *) argv[6]); +- double alpha = *((double *) argv[7]); ++ IMAGE *src = (IMAGE *) argv[0]; ++ IMAGE *dst = (IMAGE *) argv[1]; ++ IMAGE *mask = (IMAGE *) argv[2]; ++ ++ int iterations = *((int *) argv[3]); ++ double amplitude = *((double *) argv[4]); ++ double sharpness = *((double *) argv[5]); ++ double anisotropy = *((double *) argv[6]); ++ double alpha = *((double *) argv[7]); + double sigma = *((double *) argv[8]); +- double dl = *((double *) argv[9]); +- double da = *((double *) argv[10]); +- double gauss_prec = *((double *) argv[11]); +- int interpolation = *((int *) argv[12]); +- int fast_approx = *((int *) argv[13]); +- +- if( im_greyc_mask( src, dst, mask, +- iterations, +- amplitude, sharpness, anisotropy, +- alpha, sigma, +- dl, da, gauss_prec, +- interpolation, fast_approx ) ) +- return( -1 ); +- +- return( 0 ); ++ double dl = *((double *) argv[9]); ++ double da = *((double *) argv[10]); ++ double gauss_prec = *((double *) argv[11]); ++ int interpolation = *((int *) argv[12]); ++ int fast_approx = *((int *) argv[13]); ++ ++ if (im_greyc_mask(src, dst, mask, ++ iterations, ++ amplitude, sharpness, anisotropy, ++ alpha, sigma, ++ dl, da, gauss_prec, ++ interpolation, fast_approx)) ++ return (-1); ++ ++ return (0); + } + + static im_arg_desc greyc_mask_arg_types[] = { +- IM_INPUT_IMAGE( "src" ), +- IM_OUTPUT_IMAGE( "dst" ), +- IM_INPUT_IMAGE( "mask" ), +- IM_INPUT_INT( "iterations" ), +- IM_INPUT_DOUBLE( "amplitude" ), +- IM_INPUT_DOUBLE( "sharpness" ), +- IM_INPUT_DOUBLE( "anisotropy" ), +- IM_INPUT_DOUBLE( "alpha" ), +- IM_INPUT_DOUBLE( "sigma" ), +- IM_INPUT_DOUBLE( "dl" ), +- IM_INPUT_DOUBLE( "da" ), +- IM_INPUT_DOUBLE( "gauss_prec" ), +- IM_INPUT_INT( "interpolation" ), +- IM_INPUT_INT( "fast_approx" ) ++ IM_INPUT_IMAGE("src"), ++ IM_OUTPUT_IMAGE("dst"), ++ IM_INPUT_IMAGE("mask"), ++ IM_INPUT_INT("iterations"), ++ IM_INPUT_DOUBLE("amplitude"), ++ IM_INPUT_DOUBLE("sharpness"), ++ IM_INPUT_DOUBLE("anisotropy"), ++ IM_INPUT_DOUBLE("alpha"), ++ IM_INPUT_DOUBLE("sigma"), ++ IM_INPUT_DOUBLE("dl"), ++ IM_INPUT_DOUBLE("da"), ++ IM_INPUT_DOUBLE("gauss_prec"), ++ IM_INPUT_INT("interpolation"), ++ IM_INPUT_INT("fast_approx") + }; + + static im_function greyc_mask_desc = { +- "im_greyc_mask", /* Name */ +- "noise-removing filter, with a mask", /* Description */ +- (im_fn_flags) (IM_FN_TRANSFORM | IM_FN_PIO),/* Flags */ +- greyc_mask_vec, /* Dispatch function */ +- IM_NUMBER( greyc_mask_arg_types ),/* Size of arg list */ +- greyc_mask_arg_types /* Arg list */ ++ "im_greyc_mask", /* Name */ ++ "noise-removing filter, with a mask", /* Description */ ++ (im_fn_flags) (IM_FN_TRANSFORM | IM_FN_PIO), /* Flags */ ++ greyc_mask_vec, /* Dispatch function */ ++ IM_NUMBER(greyc_mask_arg_types), /* Size of arg list */ ++ greyc_mask_arg_types /* Arg list */ + }; + + static im_function *function_list[] = { +@@ -157,6 +157,6 @@ static im_function *function_list[] = { + */ + im_package im__cimg = { + "cimg", +- IM_NUMBER( function_list ), ++ IM_NUMBER(function_list), + function_list + }; +diff --git a/libvips/deprecated/colour_dispatch.c b/libvips/deprecated/colour_dispatch.c +index 54ea45e596..94f4fa1020 100644 +--- a/libvips/deprecated/colour_dispatch.c ++++ b/libvips/deprecated/colour_dispatch.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,907 +43,907 @@ + /* One image in, one out. + */ + static im_arg_desc one_in_one_out[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Two images in, one out. + */ + static im_arg_desc two_in_one_out[] = { +- IM_INPUT_IMAGE( "in1" ), +- IM_INPUT_IMAGE( "in2" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in1"), ++ IM_INPUT_IMAGE("in2"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Call im_sRGB2XYZ via arg vector. + */ + static int +-sRGB2XYZ_vec( im_object *argv ) ++sRGB2XYZ_vec(im_object *argv) + { +- return( im_sRGB2XYZ( argv[0], argv[1] ) ); ++ return (im_sRGB2XYZ(argv[0], argv[1])); + } + + /* Description of im_sRGB2XYZ. +- */ ++ */ + static im_function sRGB2XYZ_desc = { +- "im_sRGB2XYZ", /* Name */ +- "convert sRGB to XYZ", /* Description */ +- IM_FN_PIO, /* Flags */ +- sRGB2XYZ_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_sRGB2XYZ", /* Name */ ++ "convert sRGB to XYZ", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ sRGB2XYZ_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_XYZ2sRGB via arg vector. + */ + static int +-XYZ2sRGB_vec( im_object *argv ) ++XYZ2sRGB_vec(im_object *argv) + { +- return( im_XYZ2sRGB( argv[0], argv[1] ) ); ++ return (im_XYZ2sRGB(argv[0], argv[1])); + } + + /* Description of im_XYZ2sRGB. +- */ ++ */ + static im_function XYZ2sRGB_desc = { +- "im_XYZ2sRGB", /* Name */ +- "convert XYZ to sRGB", /* Description */ +- IM_FN_PIO, /* Flags */ +- XYZ2sRGB_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_XYZ2sRGB", /* Name */ ++ "convert XYZ to sRGB", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ XYZ2sRGB_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_LCh2Lab via arg vector. + */ + static int +-LCh2Lab_vec( im_object *argv ) ++LCh2Lab_vec(im_object *argv) + { +- return( im_LCh2Lab( argv[0], argv[1] ) ); ++ return (im_LCh2Lab(argv[0], argv[1])); + } + + /* Description of im_LCh2Lab. +- */ ++ */ + static im_function LCh2Lab_desc = { +- "im_LCh2Lab", /* Name */ +- "convert LCh to Lab", /* Description */ +- IM_FN_PIO, /* Flags */ +- LCh2Lab_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_LCh2Lab", /* Name */ ++ "convert LCh to Lab", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ LCh2Lab_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_LabQ2XYZ via arg vector. + */ + static int +-LabQ2XYZ_vec( im_object *argv ) ++LabQ2XYZ_vec(im_object *argv) + { +- return( im_LabQ2XYZ( argv[0], argv[1] ) ); ++ return (im_LabQ2XYZ(argv[0], argv[1])); + } + + /* Description of im_LabQ2XYZ. +- */ ++ */ + static im_function LabQ2XYZ_desc = { +- "im_LabQ2XYZ", /* Name */ +- "convert LabQ to XYZ", /* Description */ +- IM_FN_PIO, /* Flags */ +- LabQ2XYZ_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_LabQ2XYZ", /* Name */ ++ "convert LabQ to XYZ", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ LabQ2XYZ_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_LCh2UCS via arg vector. + */ + static int +-LCh2UCS_vec( im_object *argv ) ++LCh2UCS_vec(im_object *argv) + { +- return( im_LCh2UCS( argv[0], argv[1] ) ); ++ return (im_LCh2UCS(argv[0], argv[1])); + } + + /* Description of im_LCh2UCS. +- */ ++ */ + static im_function LCh2UCS_desc = { +- "im_LCh2UCS", /* Name */ +- "convert LCh to UCS", /* Description */ +- IM_FN_PIO, /* Flags */ +- LCh2UCS_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_LCh2UCS", /* Name */ ++ "convert LCh to UCS", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ LCh2UCS_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_Lab2LCh via arg vector. + */ + static int +-Lab2LCh_vec( im_object *argv ) ++Lab2LCh_vec(im_object *argv) + { +- return( im_Lab2LCh( argv[0], argv[1] ) ); ++ return (im_Lab2LCh(argv[0], argv[1])); + } + + /* Description of im_Lab2LCh. +- */ ++ */ + static im_function Lab2LCh_desc = { +- "im_Lab2LCh", /* Name */ +- "convert Lab to LCh", /* Description */ +- IM_FN_PIO, /* Flags */ +- Lab2LCh_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_Lab2LCh", /* Name */ ++ "convert Lab to LCh", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ Lab2LCh_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_Lab2LabQ() via arg vector. + */ + static int +-Lab2LabQ_vec( im_object *argv ) ++Lab2LabQ_vec(im_object *argv) + { +- return( im_Lab2LabQ( argv[0], argv[1] ) ); ++ return (im_Lab2LabQ(argv[0], argv[1])); + } + + /* Description of im_Lab2LabQ. +- */ ++ */ + static im_function Lab2LabQ_desc = { +- "im_Lab2LabQ", /* Name */ +- "convert Lab to LabQ", /* Description */ +- IM_FN_PIO, /* Flags */ +- Lab2LabQ_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_Lab2LabQ", /* Name */ ++ "convert Lab to LabQ", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ Lab2LabQ_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_Lab2XYZ() via arg vector. + */ + static int +-Lab2XYZ_vec( im_object *argv ) ++Lab2XYZ_vec(im_object *argv) + { +- return( im_Lab2XYZ( argv[0], argv[1] ) ); ++ return (im_Lab2XYZ(argv[0], argv[1])); + } + + /* Description of im_Lab2XYZ. +- */ ++ */ + static im_function Lab2XYZ_desc = { +- "im_Lab2XYZ", /* Name */ +- "convert D65 Lab to XYZ", /* Description */ +- IM_FN_PIO, /* Flags */ +- Lab2XYZ_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_Lab2XYZ", /* Name */ ++ "convert D65 Lab to XYZ", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ Lab2XYZ_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + static int +-icc_present_vec( im_object *argv ) ++icc_present_vec(im_object *argv) + { + int *present = ((int *) argv[0]); + + *present = im_icc_present(); + +- return( 0 ); ++ return (0); + } + + static im_arg_desc icc_present_args[] = { +- IM_OUTPUT_INT( "present" ) ++ IM_OUTPUT_INT("present") + }; + + /* Description of im_icc_present. +- */ ++ */ + static im_function icc_present_desc = { +- "im_icc_present", /* Name */ ++ "im_icc_present", /* Name */ + "test for presence of ICC library", /* Description */ +- 0, /* Flags */ +- icc_present_vec, /* Dispatch function */ +- IM_NUMBER( icc_present_args ), /* Size of arg list */ +- icc_present_args /* Arg list */ ++ 0, /* Flags */ ++ icc_present_vec, /* Dispatch function */ ++ IM_NUMBER(icc_present_args), /* Size of arg list */ ++ icc_present_args /* Arg list */ + }; + + static int +-icc_transform_vec( im_object *argv ) ++icc_transform_vec(im_object *argv) + { + int intent = *((int *) argv[4]); + +- return( im_icc_transform( argv[0], argv[1], +- argv[2], argv[3], intent ) ); ++ return (im_icc_transform(argv[0], argv[1], ++ argv[2], argv[3], intent)); + } + + static im_arg_desc icc_transform_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_STRING( "input_profile" ), +- IM_INPUT_STRING( "output_profile" ), +- IM_INPUT_INT( "intent" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_STRING("input_profile"), ++ IM_INPUT_STRING("output_profile"), ++ IM_INPUT_INT("intent") + }; + + /* Description of im_icc_transform. +- */ ++ */ + static im_function icc_transform_desc = { +- "im_icc_transform", /* Name */ ++ "im_icc_transform", /* Name */ + "convert between two device images with a pair of ICC profiles", +- /* Description */ +- IM_FN_PIO, /* Flags */ +- icc_transform_vec, /* Dispatch function */ +- IM_NUMBER( icc_transform_args ), /* Size of arg list */ +- icc_transform_args /* Arg list */ ++ /* Description */ ++ IM_FN_PIO, /* Flags */ ++ icc_transform_vec, /* Dispatch function */ ++ IM_NUMBER(icc_transform_args), /* Size of arg list */ ++ icc_transform_args /* Arg list */ + }; + + static int +-icc_import_embedded_vec( im_object *argv ) ++icc_import_embedded_vec(im_object *argv) + { + int intent = *((int *) argv[2]); + +- return( im_icc_import_embedded( argv[0], argv[1], intent ) ); ++ return (im_icc_import_embedded(argv[0], argv[1], intent)); + } + + static im_arg_desc icc_import_embedded_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "intent" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("intent") + }; + + /* Description of im_icc_import_embedded. +- */ ++ */ + static im_function icc_import_embedded_desc = { +- "im_icc_import_embedded", /* Name */ +- "convert a device image to float LAB using the embedded profile", +- /* Description */ +- IM_FN_PIO, /* Flags */ +- icc_import_embedded_vec, /* Dispatch function */ +- IM_NUMBER( icc_import_embedded_args ), /* Size of arg list */ +- icc_import_embedded_args /* Arg list */ ++ "im_icc_import_embedded", /* Name */ ++ "convert a device image to float LAB using the embedded profile", ++ /* Description */ ++ IM_FN_PIO, /* Flags */ ++ icc_import_embedded_vec, /* Dispatch function */ ++ IM_NUMBER(icc_import_embedded_args), /* Size of arg list */ ++ icc_import_embedded_args /* Arg list */ + }; + + static int +-icc_import_vec( im_object *argv ) ++icc_import_vec(im_object *argv) + { + int intent = *((int *) argv[3]); + +- return( im_icc_import( argv[0], argv[1], +- argv[2], intent ) ); ++ return (im_icc_import(argv[0], argv[1], ++ argv[2], intent)); + } + + static im_arg_desc icc_import_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_STRING( "input_profile" ), +- IM_INPUT_INT( "intent" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_STRING("input_profile"), ++ IM_INPUT_INT("intent") + }; + + /* Description of im_icc_import. +- */ ++ */ + static im_function icc_import_desc = { +- "im_icc_import", /* Name */ +- "convert a device image to float LAB with an ICC profile", +- /* Description */ +- IM_FN_PIO, /* Flags */ +- icc_import_vec, /* Dispatch function */ +- IM_NUMBER( icc_import_args ), /* Size of arg list */ +- icc_import_args /* Arg list */ ++ "im_icc_import", /* Name */ ++ "convert a device image to float LAB with an ICC profile", ++ /* Description */ ++ IM_FN_PIO, /* Flags */ ++ icc_import_vec, /* Dispatch function */ ++ IM_NUMBER(icc_import_args), /* Size of arg list */ ++ icc_import_args /* Arg list */ + }; + + static int +-icc_export_depth_vec( im_object *argv ) ++icc_export_depth_vec(im_object *argv) + { + int intent = *((int *) argv[4]); + int depth = *((int *) argv[2]); + +- return( im_icc_export_depth( argv[0], argv[1], +- depth, argv[3], intent ) ); ++ return (im_icc_export_depth(argv[0], argv[1], ++ depth, argv[3], intent)); + } + + static im_arg_desc icc_export_depth_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "depth" ), +- IM_INPUT_STRING( "output_profile" ), +- IM_INPUT_INT( "intent" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("depth"), ++ IM_INPUT_STRING("output_profile"), ++ IM_INPUT_INT("intent") + }; + + /* Description of im_icc_export_depth. +- */ ++ */ + static im_function icc_export_depth_desc = { +- "im_icc_export_depth", /* Name */ +- "convert a float LAB to device space with an ICC profile", +- /* Description */ +- IM_FN_PIO, /* Flags */ +- icc_export_depth_vec, /* Dispatch function */ +- IM_NUMBER( icc_export_depth_args ), /* Size of arg list */ +- icc_export_depth_args /* Arg list */ ++ "im_icc_export_depth", /* Name */ ++ "convert a float LAB to device space with an ICC profile", ++ /* Description */ ++ IM_FN_PIO, /* Flags */ ++ icc_export_depth_vec, /* Dispatch function */ ++ IM_NUMBER(icc_export_depth_args), /* Size of arg list */ ++ icc_export_depth_args /* Arg list */ + }; + + static int +-icc_ac2rc_vec( im_object *argv ) ++icc_ac2rc_vec(im_object *argv) + { +- return( im_icc_ac2rc( argv[0], argv[1], argv[2] ) ); ++ return (im_icc_ac2rc(argv[0], argv[1], argv[2])); + } + + static im_arg_desc icc_ac2rc_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_STRING( "profile" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_STRING("profile") + }; + + /* Description of im_icc_ac2rc. +- */ ++ */ + static im_function icc_ac2rc_desc = { +- "im_icc_ac2rc", /* Name */ +- "convert LAB from AC to RC using an ICC profile", +- /* Description */ +- IM_FN_PIO, /* Flags */ +- icc_ac2rc_vec, /* Dispatch function */ +- IM_NUMBER( icc_ac2rc_args ), /* Size of arg list */ +- icc_ac2rc_args /* Arg list */ ++ "im_icc_ac2rc", /* Name */ ++ "convert LAB from AC to RC using an ICC profile", ++ /* Description */ ++ IM_FN_PIO, /* Flags */ ++ icc_ac2rc_vec, /* Dispatch function */ ++ IM_NUMBER(icc_ac2rc_args), /* Size of arg list */ ++ icc_ac2rc_args /* Arg list */ + }; + + static int +-Lab2XYZ_temp_vec( im_object *argv ) ++Lab2XYZ_temp_vec(im_object *argv) + { + double X0 = *((double *) argv[2]); + double Y0 = *((double *) argv[3]); + double Z0 = *((double *) argv[4]); + +- return( im_Lab2XYZ_temp( argv[0], argv[1], X0, Y0, Z0 ) ); ++ return (im_Lab2XYZ_temp(argv[0], argv[1], X0, Y0, Z0)); + } + + static im_arg_desc temp_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLE( "X0" ), +- IM_INPUT_DOUBLE( "Y0" ), +- IM_INPUT_DOUBLE( "Z0" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLE("X0"), ++ IM_INPUT_DOUBLE("Y0"), ++ IM_INPUT_DOUBLE("Z0") + }; + + /* Description of im_Lab2XYZ_temp. +- */ ++ */ + static im_function Lab2XYZ_temp_desc = { +- "im_Lab2XYZ_temp", /* Name */ ++ "im_Lab2XYZ_temp", /* Name */ + "convert Lab to XYZ, with a specified colour temperature", +- /* Description */ +- IM_FN_PIO, /* Flags */ +- Lab2XYZ_temp_vec, /* Dispatch function */ +- IM_NUMBER( temp_args ), /* Size of arg list */ +- temp_args /* Arg list */ ++ /* Description */ ++ IM_FN_PIO, /* Flags */ ++ Lab2XYZ_temp_vec, /* Dispatch function */ ++ IM_NUMBER(temp_args), /* Size of arg list */ ++ temp_args /* Arg list */ + }; + + /* Call im_Lab2UCS() via arg vector. + */ + static int +-Lab2UCS_vec( im_object *argv ) ++Lab2UCS_vec(im_object *argv) + { +- return( im_Lab2UCS( argv[0], argv[1] ) ); ++ return (im_Lab2UCS(argv[0], argv[1])); + } + + /* Description of im_Lab2UCS. +- */ ++ */ + static im_function Lab2UCS_desc = { +- "im_Lab2UCS", /* Name */ +- "convert Lab to UCS", /* Description */ +- IM_FN_PIO, /* Flags */ +- Lab2UCS_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_Lab2UCS", /* Name */ ++ "convert Lab to UCS", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ Lab2UCS_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_LabQ2Lab() via arg vector. + */ + static int +-LabQ2Lab_vec( im_object *argv ) ++LabQ2Lab_vec(im_object *argv) + { +- return( im_LabQ2Lab( argv[0], argv[1] ) ); ++ return (im_LabQ2Lab(argv[0], argv[1])); + } + + /* Description of im_LabQ2Lab. +- */ ++ */ + static im_function LabQ2Lab_desc = { +- "im_LabQ2Lab", /* Name */ +- "convert LabQ to Lab", /* Description */ +- IM_FN_PIO, /* Flags */ +- LabQ2Lab_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_LabQ2Lab", /* Name */ ++ "convert LabQ to Lab", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ LabQ2Lab_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_rad2float() via arg vector. + */ + static int +-rad2float_vec( im_object *argv ) ++rad2float_vec(im_object *argv) + { +- return( im_rad2float( argv[0], argv[1] ) ); ++ return (im_rad2float(argv[0], argv[1])); + } + + /* Description of im_rad2float. +- */ ++ */ + static im_function rad2float_desc = { +- "im_rad2float", /* Name */ +- "convert Radiance packed to float", /* Description */ +- IM_FN_PIO, /* Flags */ +- rad2float_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_rad2float", /* Name */ ++ "convert Radiance packed to float", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ rad2float_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_float2rad() via arg vector. + */ + static int +-float2rad_vec( im_object *argv ) ++float2rad_vec(im_object *argv) + { +- return( im_float2rad( argv[0], argv[1] ) ); ++ return (im_float2rad(argv[0], argv[1])); + } + + /* Description of im_float2rad +- */ ++ */ + static im_function float2rad_desc = { +- "im_float2rad", /* Name */ +- "convert float to Radiance packed", /* Description */ +- IM_FN_PIO, /* Flags */ +- float2rad_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_float2rad", /* Name */ ++ "convert float to Radiance packed", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ float2rad_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_LabQ2LabS() via arg vector. + */ + static int +-LabQ2LabS_vec( im_object *argv ) ++LabQ2LabS_vec(im_object *argv) + { +- return( im_LabQ2LabS( argv[0], argv[1] ) ); ++ return (im_LabQ2LabS(argv[0], argv[1])); + } + + /* Description of im_LabQ2LabS. +- */ ++ */ + static im_function LabQ2LabS_desc = { +- "im_LabQ2LabS", /* Name */ +- "convert LabQ to LabS", /* Description */ +- IM_FN_PIO, /* Flags */ +- LabQ2LabS_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_LabQ2LabS", /* Name */ ++ "convert LabQ to LabS", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ LabQ2LabS_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_Lab2LabS() via arg vector. + */ + static int +-Lab2LabS_vec( im_object *argv ) ++Lab2LabS_vec(im_object *argv) + { +- return( im_Lab2LabS( argv[0], argv[1] ) ); ++ return (im_Lab2LabS(argv[0], argv[1])); + } + + /* Description of im_Lab2LabS. +- */ ++ */ + static im_function Lab2LabS_desc = { +- "im_Lab2LabS", /* Name */ +- "convert Lab to LabS", /* Description */ +- IM_FN_PIO, /* Flags */ +- Lab2LabS_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_Lab2LabS", /* Name */ ++ "convert Lab to LabS", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ Lab2LabS_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_LabS2Lab() via arg vector. + */ + static int +-LabS2Lab_vec( im_object *argv ) ++LabS2Lab_vec(im_object *argv) + { +- return( im_LabS2Lab( argv[0], argv[1] ) ); ++ return (im_LabS2Lab(argv[0], argv[1])); + } + + /* Description of im_LabS2Lab. +- */ ++ */ + static im_function LabS2Lab_desc = { +- "im_LabS2Lab", /* Name */ +- "convert LabS to Lab", /* Description */ +- IM_FN_PIO, /* Flags */ +- LabS2Lab_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_LabS2Lab", /* Name */ ++ "convert LabS to Lab", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ LabS2Lab_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_LabS2LabQ() via arg vector. + */ + static int +-LabS2LabQ_vec( im_object *argv ) ++LabS2LabQ_vec(im_object *argv) + { +- return( im_LabS2LabQ( argv[0], argv[1] ) ); ++ return (im_LabS2LabQ(argv[0], argv[1])); + } + + /* Description of im_LabS2LabQ. +- */ ++ */ + static im_function LabS2LabQ_desc = { +- "im_LabS2LabQ", /* Name */ +- "convert LabS to LabQ", /* Description */ +- IM_FN_PIO, /* Flags */ +- LabS2LabQ_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_LabS2LabQ", /* Name */ ++ "convert LabS to LabQ", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ LabS2LabQ_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_UCS2XYZ() via arg vector. + */ + static int +-UCS2XYZ_vec( im_object *argv ) ++UCS2XYZ_vec(im_object *argv) + { +- return( im_UCS2XYZ( argv[0], argv[1] ) ); ++ return (im_UCS2XYZ(argv[0], argv[1])); + } + + /* Description of im_UCS2XYZ. +- */ ++ */ + static im_function UCS2XYZ_desc = { +- "im_UCS2XYZ", /* Name */ +- "convert UCS to XYZ", /* Description */ +- IM_FN_PIO, /* Flags */ +- UCS2XYZ_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_UCS2XYZ", /* Name */ ++ "convert UCS to XYZ", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ UCS2XYZ_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_UCS2LCh() via arg vector. + */ + static int +-UCS2LCh_vec( im_object *argv ) ++UCS2LCh_vec(im_object *argv) + { +- return( im_UCS2LCh( argv[0], argv[1] ) ); ++ return (im_UCS2LCh(argv[0], argv[1])); + } + + /* Description of im_UCS2LCh. +- */ ++ */ + static im_function UCS2LCh_desc = { +- "im_UCS2LCh", /* Name */ +- "convert UCS to LCh", /* Description */ +- IM_FN_PIO, /* Flags */ +- UCS2LCh_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_UCS2LCh", /* Name */ ++ "convert UCS to LCh", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ UCS2LCh_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_UCS2Lab() via arg vector. + */ + static int +-UCS2Lab_vec( im_object *argv ) ++UCS2Lab_vec(im_object *argv) + { +- return( im_UCS2Lab( argv[0], argv[1] ) ); ++ return (im_UCS2Lab(argv[0], argv[1])); + } + + /* Description of im_UCS2Lab. +- */ ++ */ + static im_function UCS2Lab_desc = { +- "im_UCS2Lab", /* Name */ +- "convert UCS to Lab", /* Description */ +- IM_FN_PIO, /* Flags */ +- UCS2Lab_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_UCS2Lab", /* Name */ ++ "convert UCS to Lab", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ UCS2Lab_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_Yxy2XYZ via arg vector. + */ + static int +-Yxy2XYZ_vec( im_object *argv ) ++Yxy2XYZ_vec(im_object *argv) + { +- return( im_Yxy2XYZ( argv[0], argv[1] ) ); ++ return (im_Yxy2XYZ(argv[0], argv[1])); + } + + /* Description of im_Yxy2XYZ. +- */ ++ */ + static im_function Yxy2XYZ_desc = { +- "im_Yxy2XYZ", /* Name */ +- "convert Yxy to XYZ", /* Description */ +- IM_FN_PIO, /* Flags */ +- Yxy2XYZ_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_Yxy2XYZ", /* Name */ ++ "convert Yxy to XYZ", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ Yxy2XYZ_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_XYZ2Yxy via arg vector. + */ + static int +-XYZ2Yxy_vec( im_object *argv ) ++XYZ2Yxy_vec(im_object *argv) + { +- return( im_XYZ2Yxy( argv[0], argv[1] ) ); ++ return (im_XYZ2Yxy(argv[0], argv[1])); + } + + /* Description of im_XYZ2Yxy. +- */ ++ */ + static im_function XYZ2Yxy_desc = { +- "im_XYZ2Yxy", /* Name */ +- "convert XYZ to Yxy", /* Description */ +- IM_FN_PIO, /* Flags */ +- XYZ2Yxy_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_XYZ2Yxy", /* Name */ ++ "convert XYZ to Yxy", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ XYZ2Yxy_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_XYZ2Lab via arg vector. + */ + static int +-XYZ2Lab_vec( im_object *argv ) ++XYZ2Lab_vec(im_object *argv) + { +- return( im_XYZ2Lab( argv[0], argv[1] ) ); ++ return (im_XYZ2Lab(argv[0], argv[1])); + } + + /* Description of im_XYZ2Lab. +- */ ++ */ + static im_function XYZ2Lab_desc = { +- "im_XYZ2Lab", /* Name */ +- "convert D65 XYZ to Lab", /* Description */ +- IM_FN_PIO, /* Flags */ +- XYZ2Lab_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_XYZ2Lab", /* Name */ ++ "convert D65 XYZ to Lab", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ XYZ2Lab_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + static int +-XYZ2Lab_temp_vec( im_object *argv ) ++XYZ2Lab_temp_vec(im_object *argv) + { + double X0 = *((double *) argv[2]); + double Y0 = *((double *) argv[3]); + double Z0 = *((double *) argv[4]); + +- return( im_XYZ2Lab_temp( argv[0], argv[1], X0, Y0, Z0 ) ); ++ return (im_XYZ2Lab_temp(argv[0], argv[1], X0, Y0, Z0)); + } + + /* Description of im_XYZ2Lab_temp. +- */ ++ */ + static im_function XYZ2Lab_temp_desc = { +- "im_XYZ2Lab_temp", /* Name */ +- "convert XYZ to Lab, with a specified colour temperature", +- /* Description */ +- IM_FN_PIO, /* Flags */ +- XYZ2Lab_temp_vec, /* Dispatch function */ +- IM_NUMBER( temp_args ), /* Size of arg list */ +- temp_args /* Arg list */ ++ "im_XYZ2Lab_temp", /* Name */ ++ "convert XYZ to Lab, with a specified colour temperature", ++ /* Description */ ++ IM_FN_PIO, /* Flags */ ++ XYZ2Lab_temp_vec, /* Dispatch function */ ++ IM_NUMBER(temp_args), /* Size of arg list */ ++ temp_args /* Arg list */ + }; + + /* Call im_XYZ2UCS() via arg vector. + */ + static int +-XYZ2UCS_vec( im_object *argv ) ++XYZ2UCS_vec(im_object *argv) + { +- return( im_XYZ2UCS( argv[0], argv[1] ) ); ++ return (im_XYZ2UCS(argv[0], argv[1])); + } + + /* Description of im_XYZ2UCS. +- */ ++ */ + static im_function XYZ2UCS_desc = { +- "im_XYZ2UCS", /* Name */ +- "convert XYZ to UCS", /* Description */ +- IM_FN_PIO, /* Flags */ +- XYZ2UCS_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_XYZ2UCS", /* Name */ ++ "convert XYZ to UCS", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ XYZ2UCS_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Args to XYZ2disp and disp2XYZ. + */ + static im_arg_desc XYZ2disp_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DISPLAY( "disp" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DISPLAY("disp") + }; + + /* Call im_XYZ2disp() via arg vector. + */ + static int +-XYZ2disp_vec( im_object *argv ) ++XYZ2disp_vec(im_object *argv) + { +- return( im_XYZ2disp( argv[0], argv[1], argv[2] ) ); ++ return (im_XYZ2disp(argv[0], argv[1], argv[2])); + } + + /* Description of im_XYZ2disp. +- */ ++ */ + static im_function XYZ2disp_desc = { +- "im_XYZ2disp", /* Name */ +- "convert XYZ to displayble", /* Description */ +- IM_FN_PIO, /* Flags */ +- XYZ2disp_vec, /* Dispatch function */ +- IM_NUMBER( XYZ2disp_args ), /* Size of arg list */ +- XYZ2disp_args /* Arg list */ ++ "im_XYZ2disp", /* Name */ ++ "convert XYZ to displayble", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ XYZ2disp_vec, /* Dispatch function */ ++ IM_NUMBER(XYZ2disp_args), /* Size of arg list */ ++ XYZ2disp_args /* Arg list */ + }; + + /* Call im_Lab2disp() via arg vector. + */ + static int +-Lab2disp_vec( im_object *argv ) ++Lab2disp_vec(im_object *argv) + { +- return( im_Lab2disp( argv[0], argv[1], argv[2] ) ); ++ return (im_Lab2disp(argv[0], argv[1], argv[2])); + } + + /* Description of im_Lab2disp. +- */ ++ */ + static im_function Lab2disp_desc = { +- "im_Lab2disp", /* Name */ +- "convert Lab to displayable", /* Description */ +- IM_FN_PIO, /* Flags */ +- Lab2disp_vec, /* Dispatch function */ +- IM_NUMBER( XYZ2disp_args ), /* Size of arg list */ +- XYZ2disp_args /* Arg list */ ++ "im_Lab2disp", /* Name */ ++ "convert Lab to displayable", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ Lab2disp_vec, /* Dispatch function */ ++ IM_NUMBER(XYZ2disp_args), /* Size of arg list */ ++ XYZ2disp_args /* Arg list */ + }; + + /* Call im_LabQ2disp() via arg vector. + */ + static int +-LabQ2disp_vec( im_object *argv ) ++LabQ2disp_vec(im_object *argv) + { +- return( im_LabQ2disp( argv[0], argv[1], argv[2] ) ); ++ return (im_LabQ2disp(argv[0], argv[1], argv[2])); + } + + /* Description of im_LabQ2disp. +- */ ++ */ + static im_function LabQ2disp_desc = { +- "im_LabQ2disp", /* Name */ +- "convert LabQ to displayable", /* Description */ +- IM_FN_PIO, /* Flags */ +- LabQ2disp_vec, /* Dispatch function */ +- IM_NUMBER( XYZ2disp_args ), /* Size of arg list */ +- XYZ2disp_args /* Arg list */ ++ "im_LabQ2disp", /* Name */ ++ "convert LabQ to displayable", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ LabQ2disp_vec, /* Dispatch function */ ++ IM_NUMBER(XYZ2disp_args), /* Size of arg list */ ++ XYZ2disp_args /* Arg list */ + }; + + /* Call im_dE00_fromLab() via arg vector. + */ + static int +-dE00_fromLab_vec( im_object *argv ) ++dE00_fromLab_vec(im_object *argv) + { +- return( im_dE00_fromLab( argv[0], argv[1], argv[2] ) ); ++ return (im_dE00_fromLab(argv[0], argv[1], argv[2])); + } + + /* Description of im_dE00_fromLab. +- */ ++ */ + static im_function dE00_fromLab_desc = { +- "im_dE00_fromLab", /* Name */ ++ "im_dE00_fromLab", /* Name */ + "calculate delta-E CIE2000 for two Lab images", +- IM_FN_PIO, /* Flags */ +- dE00_fromLab_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ dE00_fromLab_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_dECMC_fromLab() via arg vector. + */ + static int +-dECMC_fromLab_vec( im_object *argv ) ++dECMC_fromLab_vec(im_object *argv) + { +- return( im_dECMC_fromLab( argv[0], argv[1], argv[2] ) ); ++ return (im_dECMC_fromLab(argv[0], argv[1], argv[2])); + } + + /* Description of im_dECMC_fromLab. +- */ ++ */ + static im_function dECMC_fromLab_desc = { +- "im_dECMC_fromLab", /* Name */ ++ "im_dECMC_fromLab", /* Name */ + "calculate delta-E CMC(1:1) for two Lab images", +- IM_FN_PIO, /* Flags */ +- dECMC_fromLab_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ dECMC_fromLab_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_dE_fromXYZ() via arg vector. + */ + static int +-dE_fromXYZ_vec( im_object *argv ) ++dE_fromXYZ_vec(im_object *argv) + { +- return( im_dE_fromXYZ( argv[0], argv[1], argv[2] ) ); ++ return (im_dE_fromXYZ(argv[0], argv[1], argv[2])); + } + + /* Description of im_dE_fromXYZ. +- */ ++ */ + static im_function dE_fromXYZ_desc = { +- "im_dE_fromXYZ", /* Name */ ++ "im_dE_fromXYZ", /* Name */ + "calculate delta-E for two XYZ images", +- IM_FN_PIO, /* Flags */ +- dE_fromXYZ_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ dE_fromXYZ_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_dE_fromLab() via arg vector. + */ + static int +-dE_fromLab_vec( im_object *argv ) ++dE_fromLab_vec(im_object *argv) + { +- return( im_dE_fromLab( argv[0], argv[1], argv[2] ) ); ++ return (im_dE_fromLab(argv[0], argv[1], argv[2])); + } + + /* Description of im_dE_fromLab. +- */ ++ */ + static im_function dE_fromLab_desc = { +- "im_dE_fromLab", /* Name */ ++ "im_dE_fromLab", /* Name */ + "calculate delta-E for two Lab images", +- IM_FN_PIO, /* Flags */ +- dE_fromLab_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ dE_fromLab_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Two images in, one out. + */ + static im_arg_desc dE_fromdisp_args[] = { +- IM_INPUT_IMAGE( "in1" ), +- IM_INPUT_IMAGE( "in2" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DISPLAY( "disp" ) ++ IM_INPUT_IMAGE("in1"), ++ IM_INPUT_IMAGE("in2"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DISPLAY("disp") + }; + + /* Call im_dE_fromdisp() via arg vector. + */ + static int +-dE_fromdisp_vec( im_object *argv ) ++dE_fromdisp_vec(im_object *argv) + { +- return( im_dE_fromdisp( argv[0], argv[1], argv[2], argv[3] ) ); ++ return (im_dE_fromdisp(argv[0], argv[1], argv[2], argv[3])); + } + + /* Description of im_dE_fromdisp. +- */ ++ */ + static im_function dE_fromdisp_desc = { +- "im_dE_fromdisp", /* Name */ ++ "im_dE_fromdisp", /* Name */ + "calculate delta-E for two displayable images", +- IM_FN_PIO, /* Flags */ +- dE_fromdisp_vec, /* Dispatch function */ +- IM_NUMBER( dE_fromdisp_args ), /* Size of arg list */ +- dE_fromdisp_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ dE_fromdisp_vec, /* Dispatch function */ ++ IM_NUMBER(dE_fromdisp_args), /* Size of arg list */ ++ dE_fromdisp_args /* Arg list */ + }; + + /* Call im_dECMC_fromdisp() via arg vector. + */ + static int +-dECMC_fromdisp_vec( im_object *argv ) ++dECMC_fromdisp_vec(im_object *argv) + { +- return( im_dECMC_fromdisp( argv[0], argv[1], argv[2], argv[3] ) ); ++ return (im_dECMC_fromdisp(argv[0], argv[1], argv[2], argv[3])); + } + + /* Description of im_dECMC_fromdisp. +- */ ++ */ + static im_function dECMC_fromdisp_desc = { +- "im_dECMC_fromdisp", /* Name */ ++ "im_dECMC_fromdisp", /* Name */ + "calculate delta-E CMC(1:1) for two displayable images", +- IM_FN_PIO, /* Flags */ +- dECMC_fromdisp_vec, /* Dispatch function */ +- IM_NUMBER( dE_fromdisp_args ), /* Size of arg list */ +- dE_fromdisp_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ dECMC_fromdisp_vec, /* Dispatch function */ ++ IM_NUMBER(dE_fromdisp_args), /* Size of arg list */ ++ dE_fromdisp_args /* Arg list */ + }; + + /* Call im_disp2XYZ() via arg vector. + */ + static int +-disp2XYZ_vec( im_object *argv ) ++disp2XYZ_vec(im_object *argv) + { +- return( im_disp2XYZ( argv[0], argv[1], argv[2] ) ); ++ return (im_disp2XYZ(argv[0], argv[1], argv[2])); + } + + /* Description of im_disp2XYZ. +- */ ++ */ + static im_function disp2XYZ_desc = { +- "im_disp2XYZ", /* Name */ +- "convert displayable to XYZ", /* Description */ +- IM_FN_PIO, /* Flags */ +- disp2XYZ_vec, /* Dispatch function */ +- IM_NUMBER( XYZ2disp_args ), /* Size of arg list */ +- XYZ2disp_args /* Arg list */ ++ "im_disp2XYZ", /* Name */ ++ "convert displayable to XYZ", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ disp2XYZ_vec, /* Dispatch function */ ++ IM_NUMBER(XYZ2disp_args), /* Size of arg list */ ++ XYZ2disp_args /* Arg list */ + }; + + /* Call im_disp2Lab() via arg vector. + */ + static int +-disp2Lab_vec( im_object *argv ) ++disp2Lab_vec(im_object *argv) + { +- return( im_disp2Lab( argv[0], argv[1], argv[2] ) ); ++ return (im_disp2Lab(argv[0], argv[1], argv[2])); + } + + /* Description of im_disp2Lab. +- */ ++ */ + static im_function disp2Lab_desc = { +- "im_disp2Lab", /* Name */ +- "convert displayable to Lab", /* Description */ +- IM_FN_PIO, /* Flags */ +- disp2Lab_vec, /* Dispatch function */ +- IM_NUMBER( XYZ2disp_args ), /* Size of arg list */ +- XYZ2disp_args /* Arg list */ ++ "im_disp2Lab", /* Name */ ++ "convert displayable to Lab", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ disp2Lab_vec, /* Dispatch function */ ++ IM_NUMBER(XYZ2disp_args), /* Size of arg list */ ++ XYZ2disp_args /* Arg list */ + }; + + static im_arg_desc morph_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DMASK( "greyscale" ), +- IM_INPUT_DOUBLE( "L_offset" ), +- IM_INPUT_DOUBLE( "L_scale" ), +- IM_INPUT_DOUBLE( "a_scale" ), +- IM_INPUT_DOUBLE( "b_scale" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DMASK("greyscale"), ++ IM_INPUT_DOUBLE("L_offset"), ++ IM_INPUT_DOUBLE("L_scale"), ++ IM_INPUT_DOUBLE("a_scale"), ++ IM_INPUT_DOUBLE("b_scale") + }; + + static int +-morph_vec( im_object *argv ) ++morph_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + double L_offset = *((double *) argv[3]); +@@ -951,17 +951,17 @@ morph_vec( im_object *argv ) + double a_scale = *((double *) argv[5]); + double b_scale = *((double *) argv[6]); + +- return( im_lab_morph( argv[0], argv[1], +- mo->mask, L_offset, L_scale, a_scale, b_scale ) ); ++ return (im_lab_morph(argv[0], argv[1], ++ mo->mask, L_offset, L_scale, a_scale, b_scale)); + } + + static im_function morph_desc = { +- "im_lab_morph", /* Name */ +- "morph colourspace of a LAB image", +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- morph_vec, /* Dispatch function */ +- IM_NUMBER( morph_args ), /* Size of arg list */ +- morph_args /* Arg list */ ++ "im_lab_morph", /* Name */ ++ "morph colourspace of a LAB image", ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ morph_vec, /* Dispatch function */ ++ IM_NUMBER(morph_args), /* Size of arg list */ ++ morph_args /* Arg list */ + }; + + /* Package up all these functions. +@@ -1016,6 +1016,6 @@ static im_function *colour_list[] = { + */ + im_package im__colour = { + "colour", +- IM_NUMBER( colour_list ), ++ IM_NUMBER(colour_list), + colour_list + }; +diff --git a/libvips/deprecated/conver_dispatch.c b/libvips/deprecated/conver_dispatch.c +index edfd01631d..79a63187df 100644 +--- a/libvips/deprecated/conver_dispatch.c ++++ b/libvips/deprecated/conver_dispatch.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -39,35 +39,35 @@ + #include + + static int +-system_vec( im_object *argv ) ++system_vec(im_object *argv) + { + IMAGE *in = argv[0]; + char *cmd = argv[1]; + char **out = (char **) &argv[2]; + +- if( im_system( in, cmd, out ) ) +- return( -1 ); ++ if (im_system(in, cmd, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static im_arg_desc system_args[] = { +- IM_INPUT_IMAGE( "im" ), +- IM_INPUT_STRING( "command" ), +- IM_OUTPUT_STRING( "output" ) ++ IM_INPUT_IMAGE("im"), ++ IM_INPUT_STRING("command"), ++ IM_OUTPUT_STRING("output") + }; + + static im_function system_desc = { + "im_system", /* Name */ +- "run command on image", /* Description */ +- 0, /* Flags */ +- system_vec, /* Dispatch function */ +- IM_NUMBER( system_args ), /* Size of arg list */ +- system_args /* Arg list */ ++ "run command on image", /* Description */ ++ 0, /* Flags */ ++ system_vec, /* Dispatch function */ ++ IM_NUMBER(system_args), /* Size of arg list */ ++ system_args /* Arg list */ + }; + + static int +-system_image_vec( im_object *argv ) ++system_image_vec(im_object *argv) + { + IMAGE *in = argv[0]; + IMAGE *out = argv[1]; +@@ -78,123 +78,123 @@ system_image_vec( im_object *argv ) + + IMAGE *out_image; + +- if( !(out_image = im_system_image( in, +- in_format, out_format, cmd, log )) ) { +- im_error( "im_system_image", "%s", *log ); +- return( -1 ); ++ if (!(out_image = im_system_image(in, ++ in_format, out_format, cmd, log))) { ++ im_error("im_system_image", "%s", *log); ++ return (-1); + } + +- if( im_copy( out_image, out ) || +- im_add_close_callback( out, +- (im_callback_fn) im_close, out_image, NULL ) ) { +- im_close( out_image ); +- return( -1 ); ++ if (im_copy(out_image, out) || ++ im_add_close_callback(out, ++ (im_callback_fn) im_close, out_image, NULL)) { ++ im_close(out_image); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static im_arg_desc system_image_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_STRING( "in_format" ), +- IM_INPUT_STRING( "out_format" ), +- IM_INPUT_STRING( "command" ), +- IM_OUTPUT_STRING( "log" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_STRING("in_format"), ++ IM_INPUT_STRING("out_format"), ++ IM_INPUT_STRING("command"), ++ IM_OUTPUT_STRING("log") + }; + + static im_function system_image_desc = { +- "im_system_image", /* Name */ +- "run command on image, with image output",/* Description */ +- 0, /* Flags */ +- system_image_vec, /* Dispatch function */ +- IM_NUMBER( system_image_args ), /* Size of arg list */ +- system_image_args /* Arg list */ ++ "im_system_image", /* Name */ ++ "run command on image, with image output", /* Description */ ++ 0, /* Flags */ ++ system_image_vec, /* Dispatch function */ ++ IM_NUMBER(system_image_args), /* Size of arg list */ ++ system_image_args /* Arg list */ + }; + + static int +-subsample_vec( im_object *argv ) ++subsample_vec(im_object *argv) + { + IMAGE *in = argv[0]; + IMAGE *out = argv[1]; + int xsh = *((int *) argv[2]); + int ysh = *((int *) argv[3]); + +- if( im_subsample( in, out, xsh, ysh ) ) +- return( -1 ); ++ if (im_subsample(in, out, xsh, ysh)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static im_arg_desc subsample_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "xshrink" ), +- IM_INPUT_INT( "yshrink" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("xshrink"), ++ IM_INPUT_INT("yshrink") + }; + + static im_function subsample_desc = { +- "im_subsample", /* Name */ +- "subsample image by integer factors", /* Description */ +- IM_FN_PIO, /* Flags */ +- subsample_vec, /* Dispatch function */ +- IM_NUMBER( subsample_args ), /* Size of arg list */ +- subsample_args /* Arg list */ ++ "im_subsample", /* Name */ ++ "subsample image by integer factors", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ subsample_vec, /* Dispatch function */ ++ IM_NUMBER(subsample_args), /* Size of arg list */ ++ subsample_args /* Arg list */ + }; + + /* Args for im_gaussnoise. + */ + static im_arg_desc gaussnoise_args[] = { +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "xsize" ), +- IM_INPUT_INT( "ysize" ), +- IM_INPUT_DOUBLE( "mean" ), +- IM_INPUT_DOUBLE( "sigma" ) ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("xsize"), ++ IM_INPUT_INT("ysize"), ++ IM_INPUT_DOUBLE("mean"), ++ IM_INPUT_DOUBLE("sigma") + }; + + /* Call im_gaussnoise via arg vector. + */ + static int +-gaussnoise_vec( im_object *argv ) ++gaussnoise_vec(im_object *argv) + { + int xsize = *((int *) argv[1]); + int ysize = *((int *) argv[2]); + double mean = *((double *) argv[3]); + double sigma = *((double *) argv[4]); + +- if( im_gaussnoise( argv[0], xsize, ysize, mean, sigma ) ) +- return( -1 ); +- +- return( 0 ); ++ if (im_gaussnoise(argv[0], xsize, ysize, mean, sigma)) ++ return (-1); ++ ++ return (0); + } + + /* Description of im_gaussnoise. +- */ ++ */ + static im_function gaussnoise_desc = { +- "im_gaussnoise", /* Name */ ++ "im_gaussnoise", /* Name */ + "generate image of gaussian noise with specified statistics", + IM_FN_PIO | IM_FN_NOCACHE, /* Flags */ +- gaussnoise_vec, /* Dispatch function */ +- IM_NUMBER( gaussnoise_args ), /* Size of arg list */ +- gaussnoise_args /* Arg list */ ++ gaussnoise_vec, /* Dispatch function */ ++ IM_NUMBER(gaussnoise_args), /* Size of arg list */ ++ gaussnoise_args /* Arg list */ + }; + + /* Args to im_extract. + */ + static im_arg_desc extract_args[] = { +- IM_INPUT_IMAGE( "input" ), +- IM_OUTPUT_IMAGE( "output" ), +- IM_INPUT_INT( "left" ), +- IM_INPUT_INT( "top" ), +- IM_INPUT_INT( "width" ), +- IM_INPUT_INT( "height" ), +- IM_INPUT_INT( "band" ) ++ IM_INPUT_IMAGE("input"), ++ IM_OUTPUT_IMAGE("output"), ++ IM_INPUT_INT("left"), ++ IM_INPUT_INT("top"), ++ IM_INPUT_INT("width"), ++ IM_INPUT_INT("height"), ++ IM_INPUT_INT("band") + }; + + /* Call im_extract via arg vector. + */ + static int +-extract_vec( im_object *argv ) ++extract_vec(im_object *argv) + { + int left = *((int *) argv[2]); + int top = *((int *) argv[3]); +@@ -202,133 +202,133 @@ extract_vec( im_object *argv ) + int height = *((int *) argv[5]); + int band = *((int *) argv[6]); + +- return( im_extract_areabands( argv[0], argv[1], +- left, top, width, height, band, 1 ) ); ++ return (im_extract_areabands(argv[0], argv[1], ++ left, top, width, height, band, 1)); + } + + /* Description of im_extract. + */ + static im_function extract_desc = { +- "im_extract", /* Name */ +- "extract area/band", /* Description */ +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- extract_vec, /* Dispatch function */ +- IM_NUMBER( extract_args ), /* Size of arg list */ +- extract_args /* Arg list */ ++ "im_extract", /* Name */ ++ "extract area/band", /* Description */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ extract_vec, /* Dispatch function */ ++ IM_NUMBER(extract_args), /* Size of arg list */ ++ extract_args /* Arg list */ + }; + + /* Args to im_extract_area. + */ + static im_arg_desc extract_area_args[] = { +- IM_INPUT_IMAGE( "input" ), +- IM_OUTPUT_IMAGE( "output" ), +- IM_INPUT_INT( "left" ), +- IM_INPUT_INT( "top" ), +- IM_INPUT_INT( "width" ), +- IM_INPUT_INT( "height" ) ++ IM_INPUT_IMAGE("input"), ++ IM_OUTPUT_IMAGE("output"), ++ IM_INPUT_INT("left"), ++ IM_INPUT_INT("top"), ++ IM_INPUT_INT("width"), ++ IM_INPUT_INT("height") + }; + + /* Call im_extract_area via arg vector. + */ + static int +-extract_area_vec( im_object *argv ) ++extract_area_vec(im_object *argv) + { + int x = *((int *) argv[2]); + int y = *((int *) argv[3]); + int w = *((int *) argv[4]); + int h = *((int *) argv[5]); + +- return( im_extract_area( argv[0], argv[1], x, y, w, h ) ); ++ return (im_extract_area(argv[0], argv[1], x, y, w, h)); + } + + /* Description of im_extract_area. + */ + static im_function extract_area_desc = { +- "im_extract_area", /* Name */ +- "extract area", /* Description */ +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- extract_area_vec, /* Dispatch function */ +- IM_NUMBER( extract_area_args ), /* Size of arg list */ +- extract_area_args /* Arg list */ ++ "im_extract_area", /* Name */ ++ "extract area", /* Description */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ extract_area_vec, /* Dispatch function */ ++ IM_NUMBER(extract_area_args), /* Size of arg list */ ++ extract_area_args /* Arg list */ + }; + + /* Args to im_extract_bands. + */ + static im_arg_desc extract_bands_args[] = { +- IM_INPUT_IMAGE( "input" ), +- IM_OUTPUT_IMAGE( "output" ), +- IM_INPUT_INT( "band" ), +- IM_INPUT_INT( "nbands" ), ++ IM_INPUT_IMAGE("input"), ++ IM_OUTPUT_IMAGE("output"), ++ IM_INPUT_INT("band"), ++ IM_INPUT_INT("nbands"), + }; + + /* Call im_extract_bands via arg vector. + */ + static int +-extract_bands_vec( im_object *argv ) ++extract_bands_vec(im_object *argv) + { + int chsel = *((int *) argv[2]); + int nbands = *((int *) argv[3]); + +- return( im_extract_bands( argv[0], argv[1], chsel, nbands ) ); ++ return (im_extract_bands(argv[0], argv[1], chsel, nbands)); + } + + /* Description of im_extract_bands. + */ + static im_function extract_bands_desc = { +- "im_extract_bands", /* Name */ +- "extract several bands", /* Description */ +- IM_FN_PIO, /* Flags */ +- extract_bands_vec, /* Dispatch function */ +- IM_NUMBER( extract_bands_args ),/* Size of arg list */ +- extract_bands_args /* Arg list */ ++ "im_extract_bands", /* Name */ ++ "extract several bands", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ extract_bands_vec, /* Dispatch function */ ++ IM_NUMBER(extract_bands_args), /* Size of arg list */ ++ extract_bands_args /* Arg list */ + }; + + /* Args to im_extract_band. + */ + static im_arg_desc extract_band_args[] = { +- IM_INPUT_IMAGE( "input" ), +- IM_OUTPUT_IMAGE( "output" ), +- IM_INPUT_INT( "band" ) ++ IM_INPUT_IMAGE("input"), ++ IM_OUTPUT_IMAGE("output"), ++ IM_INPUT_INT("band") + }; + + /* Call im_extract_band via arg vector. + */ + static int +-extract_band_vec( im_object *argv ) ++extract_band_vec(im_object *argv) + { + int chsel = *((int *) argv[2]); + +- return( im_extract_band( argv[0], argv[1], chsel ) ); ++ return (im_extract_band(argv[0], argv[1], chsel)); + } + + /* Description of im_extract_band. + */ + static im_function extract_band_desc = { +- "im_extract_band", /* Name */ +- "extract band", /* Description */ +- IM_FN_PIO, /* Flags */ +- extract_band_vec, /* Dispatch function */ +- IM_NUMBER( extract_band_args ), /* Size of arg list */ +- extract_band_args /* Arg list */ ++ "im_extract_band", /* Name */ ++ "extract band", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ extract_band_vec, /* Dispatch function */ ++ IM_NUMBER(extract_band_args), /* Size of arg list */ ++ extract_band_args /* Arg list */ + }; + + /* Args to im_extract_areabands. + */ + static im_arg_desc extract_areabands_args[] = { +- IM_INPUT_IMAGE( "input" ), +- IM_OUTPUT_IMAGE( "output" ), +- IM_INPUT_INT( "left" ), +- IM_INPUT_INT( "top" ), +- IM_INPUT_INT( "width" ), +- IM_INPUT_INT( "height" ), +- IM_INPUT_INT( "band" ), +- IM_INPUT_INT( "nbands" ) ++ IM_INPUT_IMAGE("input"), ++ IM_OUTPUT_IMAGE("output"), ++ IM_INPUT_INT("left"), ++ IM_INPUT_INT("top"), ++ IM_INPUT_INT("width"), ++ IM_INPUT_INT("height"), ++ IM_INPUT_INT("band"), ++ IM_INPUT_INT("nbands") + }; + + /* Call im_extract_areabands via arg vector. + */ + static int +-extract_areabands_vec( im_object *argv ) ++extract_areabands_vec(im_object *argv) + { + int left = *((int *) argv[2]); + int top = *((int *) argv[3]); +@@ -337,283 +337,283 @@ extract_areabands_vec( im_object *argv ) + int band = *((int *) argv[6]); + int nbands = *((int *) argv[7]); + +- return( im_extract_areabands( argv[0], argv[1], +- left, top, width, height, band, nbands ) ); ++ return (im_extract_areabands(argv[0], argv[1], ++ left, top, width, height, band, nbands)); + } + + /* Description of im_extract_areabands. + */ + static im_function extract_areabands_desc = { +- "im_extract_areabands", /* Name */ +- "extract area and bands", /* Description */ +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- extract_areabands_vec, /* Dispatch function */ +- IM_NUMBER( extract_areabands_args ),/* Size of arg list */ +- extract_areabands_args /* Arg list */ ++ "im_extract_areabands", /* Name */ ++ "extract area and bands", /* Description */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ extract_areabands_vec, /* Dispatch function */ ++ IM_NUMBER(extract_areabands_args), /* Size of arg list */ ++ extract_areabands_args /* Arg list */ + }; + + /* One image in, one out. + */ + static im_arg_desc one_in_one_out[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Two images in, one out. + */ + static im_arg_desc two_in_one_out[] = { +- IM_INPUT_IMAGE( "in1" ), +- IM_INPUT_IMAGE( "in2" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in1"), ++ IM_INPUT_IMAGE("in2"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Call im_bandjoin via arg vector. + */ + static int +-bandjoin_vec( im_object *argv ) ++bandjoin_vec(im_object *argv) + { +- return( im_bandjoin( argv[0], argv[1], argv[2] ) ); ++ return (im_bandjoin(argv[0], argv[1], argv[2])); + } + + /* Description of im_bandjoin. + */ + static im_function bandjoin_desc = { +- "im_bandjoin", /* Name */ +- "bandwise join of two images", /* Description */ +- IM_FN_PIO, /* Flags */ +- bandjoin_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ "im_bandjoin", /* Name */ ++ "bandwise join of two images", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ bandjoin_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + static im_arg_desc gbandjoin_args[] = { +- IM_INPUT_IMAGEVEC( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGEVEC("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + static int +-gbandjoin_vec( im_object *argv ) ++gbandjoin_vec(im_object *argv) + { + im_imagevec_object *iv = (im_imagevec_object *) argv[0]; + +- return( im_gbandjoin( iv->vec, argv[1], iv->n ) ); ++ return (im_gbandjoin(iv->vec, argv[1], iv->n)); + } + + static im_function gbandjoin_desc = { +- "im_gbandjoin", /* Name */ +- "bandwise join of many images", /* Description */ +- IM_FN_PIO, /* Flags */ +- gbandjoin_vec, /* Dispatch function */ +- IM_NUMBER( gbandjoin_args ), /* Size of arg list */ +- gbandjoin_args /* Arg list */ ++ "im_gbandjoin", /* Name */ ++ "bandwise join of many images", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ gbandjoin_vec, /* Dispatch function */ ++ IM_NUMBER(gbandjoin_args), /* Size of arg list */ ++ gbandjoin_args /* Arg list */ + }; + + /* Args to im_text. + */ + static im_arg_desc text_args[] = { +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_STRING( "text" ), +- IM_INPUT_STRING( "font" ), +- IM_INPUT_INT( "width" ), +- IM_INPUT_INT( "alignment" ), +- IM_INPUT_INT( "dpi" ) ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_STRING("text"), ++ IM_INPUT_STRING("font"), ++ IM_INPUT_INT("width"), ++ IM_INPUT_INT("alignment"), ++ IM_INPUT_INT("dpi") + }; + + /* Call im_text via arg vector. + */ + static int +-text_vec( im_object *argv ) ++text_vec(im_object *argv) + { + int width = *((int *) argv[3]); + int alignment = *((int *) argv[4]); + int dpi = *((int *) argv[5]); + +- return( im_text( argv[0], argv[1], argv[2], width, alignment, dpi ) ); ++ return (im_text(argv[0], argv[1], argv[2], width, alignment, dpi)); + } + + /* Description of im_text. + */ + static im_function text_desc = { +- "im_text", /* Name */ +- "generate text image", /* Description */ +- IM_FN_PIO, /* Flags */ +- text_vec, /* Dispatch function */ +- IM_NUMBER( text_args ), /* Size of arg list */ +- text_args /* Arg list */ ++ "im_text", /* Name */ ++ "generate text image", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ text_vec, /* Dispatch function */ ++ IM_NUMBER(text_args), /* Size of arg list */ ++ text_args /* Arg list */ + }; + + /* Args to im_black. + */ + static im_arg_desc black_args[] = { +- IM_OUTPUT_IMAGE( "output" ), +- IM_INPUT_INT( "x_size" ), +- IM_INPUT_INT( "y_size" ), +- IM_INPUT_INT( "bands" ) ++ IM_OUTPUT_IMAGE("output"), ++ IM_INPUT_INT("x_size"), ++ IM_INPUT_INT("y_size"), ++ IM_INPUT_INT("bands") + }; + + /* Call im_black via arg vector. + */ + static int +-black_vec( im_object *argv ) ++black_vec(im_object *argv) + { + int xs = *((int *) argv[1]); + int ys = *((int *) argv[2]); + int bands = *((int *) argv[3]); + +- return( im_black( argv[0], xs, ys, bands ) ); ++ return (im_black(argv[0], xs, ys, bands)); + } + + /* Description of im_black. + */ + static im_function black_desc = { +- "im_black", /* Name */ +- "generate black image", /* Description */ +- IM_FN_PIO, /* Flags */ +- black_vec, /* Dispatch function */ +- IM_NUMBER( black_args ), /* Size of arg list */ +- black_args /* Arg list */ ++ "im_black", /* Name */ ++ "generate black image", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ black_vec, /* Dispatch function */ ++ IM_NUMBER(black_args), /* Size of arg list */ ++ black_args /* Arg list */ + }; + + /* Args to im_clip2fmt. + */ + static im_arg_desc clip2fmt_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "ofmt" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("ofmt") + }; + + /* Call im_clip2fmt via arg vector. + */ + static int +-clip2fmt_vec( im_object *argv ) ++clip2fmt_vec(im_object *argv) + { + int ofmt = *((int *) argv[2]); + +- return( im_clip2fmt( argv[0], argv[1], ofmt ) ); ++ return (im_clip2fmt(argv[0], argv[1], ofmt)); + } + + /* Description of im_clip2fmt. + */ + static im_function clip2fmt_desc = { +- "im_clip2fmt", /* Name */ +- "convert image format to ofmt", /* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- clip2fmt_vec, /* Dispatch function */ +- IM_NUMBER( clip2fmt_args ), /* Size of arg list */ +- clip2fmt_args /* Arg list */ ++ "im_clip2fmt", /* Name */ ++ "convert image format to ofmt", /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ clip2fmt_vec, /* Dispatch function */ ++ IM_NUMBER(clip2fmt_args), /* Size of arg list */ ++ clip2fmt_args /* Arg list */ + }; + + /* Call im_c2rect via arg vector. + */ + static int +-c2rect_vec( im_object *argv ) ++c2rect_vec(im_object *argv) + { +- return( im_c2rect( argv[0], argv[1] ) ); ++ return (im_c2rect(argv[0], argv[1])); + } + + /* Description of im_c2rect. + */ + static im_function c2rect_desc = { +- "im_c2rect", /* Name */ ++ "im_c2rect", /* Name */ + "convert phase and amplitude to real and imaginary", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- c2rect_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ c2rect_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_c2amph via arg vector. + */ + static int +-c2amph_vec( im_object *argv ) ++c2amph_vec(im_object *argv) + { +- return( im_c2amph( argv[0], argv[1] ) ); ++ return (im_c2amph(argv[0], argv[1])); + } + + /* Description of im_c2amph. + */ + static im_function c2amph_desc = { +- "im_c2amph", /* Name */ ++ "im_c2amph", /* Name */ + "convert real and imaginary to phase and amplitude", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- c2amph_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ c2amph_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_ri2c via arg vector. + */ + static int +-ri2c_vec( im_object *argv ) ++ri2c_vec(im_object *argv) + { +- return( im_ri2c( argv[0], argv[1], argv[2] ) ); ++ return (im_ri2c(argv[0], argv[1], argv[2])); + } + + /* Description of im_ri2c. + */ + static im_function ri2c_desc = { +- "im_ri2c", /* Name */ ++ "im_ri2c", /* Name */ + "join two non-complex images to form complex", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- ri2c_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ ri2c_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_c2imag via arg vector. + */ + static int +-c2imag_vec( im_object *argv ) ++c2imag_vec(im_object *argv) + { +- return( im_c2imag( argv[0], argv[1] ) ); ++ return (im_c2imag(argv[0], argv[1])); + } + + /* Description of im_c2imag. + */ + static im_function c2imag_desc = { +- "im_c2imag", /* Name */ ++ "im_c2imag", /* Name */ + "extract imaginary part of complex image", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- c2imag_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ c2imag_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_c2real via arg vector. + */ + static int +-c2real_vec( im_object *argv ) ++c2real_vec(im_object *argv) + { +- return( im_c2real( argv[0], argv[1] ) ); ++ return (im_c2real(argv[0], argv[1])); + } + + /* Description of im_c2real. + */ + static im_function c2real_desc = { +- "im_c2real", /* Name */ ++ "im_c2real", /* Name */ + "extract real part of complex image", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- c2real_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ c2real_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Args to im_copy_set. + */ + static im_arg_desc copy_set_args[] = { +- IM_INPUT_IMAGE( "input" ), +- IM_OUTPUT_IMAGE( "output" ), +- IM_INPUT_INT( "Type" ), +- IM_INPUT_DOUBLE( "Xres" ), +- IM_INPUT_DOUBLE( "Yres" ), +- IM_INPUT_INT( "Xoffset" ), +- IM_INPUT_INT( "Yoffset" ) ++ IM_INPUT_IMAGE("input"), ++ IM_OUTPUT_IMAGE("output"), ++ IM_INPUT_INT("Type"), ++ IM_INPUT_DOUBLE("Xres"), ++ IM_INPUT_DOUBLE("Yres"), ++ IM_INPUT_INT("Xoffset"), ++ IM_INPUT_INT("Yoffset") + }; + + /* Call im_copy_set via arg vector. + */ + static int +-copy_set_vec( im_object *argv ) ++copy_set_vec(im_object *argv) + { + int Type = *((int *) argv[2]); + float Xres = *((double *) argv[3]); +@@ -621,113 +621,113 @@ copy_set_vec( im_object *argv ) + int Xoffset = *((int *) argv[5]); + int Yoffset = *((int *) argv[6]); + +- return( im_copy_set( argv[0], argv[1], +- Type, Xres, Yres, Xoffset, Yoffset ) ); ++ return (im_copy_set(argv[0], argv[1], ++ Type, Xres, Yres, Xoffset, Yoffset)); + } + + /* Description of im_copy_set. + */ + static im_function copy_set_desc = { +- "im_copy_set", /* Name */ ++ "im_copy_set", /* Name */ + "copy image, setting informational fields", + + /* Can't set PTOP ... we don't want to zap the LUT, we want the real + * image. + */ +- IM_FN_PIO, /* Flags */ ++ IM_FN_PIO, /* Flags */ + +- copy_set_vec, /* Dispatch function */ +- IM_NUMBER( copy_set_args ), /* Size of arg list */ +- copy_set_args /* Arg list */ ++ copy_set_vec, /* Dispatch function */ ++ IM_NUMBER(copy_set_args), /* Size of arg list */ ++ copy_set_args /* Arg list */ + }; + + /* Args to im_copy_set_meta. + */ + static im_arg_desc copy_set_meta_args[] = { +- IM_INPUT_IMAGE( "input" ), +- IM_OUTPUT_IMAGE( "output" ), +- IM_INPUT_STRING( "field" ), +- IM_INPUT_GVALUE( "value" ) ++ IM_INPUT_IMAGE("input"), ++ IM_OUTPUT_IMAGE("output"), ++ IM_INPUT_STRING("field"), ++ IM_INPUT_GVALUE("value") + }; + + /* Call im_copy_set_meta via arg vector. + */ + static int +-copy_set_meta_vec( im_object *argv ) ++copy_set_meta_vec(im_object *argv) + { + const char *field = argv[2]; + GValue *value = argv[3]; + +- return( im_copy_set_meta( argv[0], argv[1], field, value ) ); ++ return (im_copy_set_meta(argv[0], argv[1], field, value)); + } + + /* Description of im_copy_set_meta. + */ + static im_function copy_set_meta_desc = { +- "im_copy_set_meta", /* Name */ ++ "im_copy_set_meta", /* Name */ + "copy image, setting a meta field", + + /* Can't set PTOP ... we don't want to zap the LUT, we want the real + * image. + */ +- IM_FN_PIO, /* Flags */ ++ IM_FN_PIO, /* Flags */ + +- copy_set_meta_vec, /* Dispatch function */ +- IM_NUMBER( copy_set_meta_args ),/* Size of arg list */ +- copy_set_meta_args /* Arg list */ ++ copy_set_meta_vec, /* Dispatch function */ ++ IM_NUMBER(copy_set_meta_args), /* Size of arg list */ ++ copy_set_meta_args /* Arg list */ + }; + + /* Args to im_copy_morph. + */ + static im_arg_desc copy_morph_args[] = { +- IM_INPUT_IMAGE( "input" ), +- IM_OUTPUT_IMAGE( "output" ), +- IM_INPUT_INT( "Bands" ), +- IM_INPUT_INT( "BandFmt" ), +- IM_INPUT_INT( "Coding" ) ++ IM_INPUT_IMAGE("input"), ++ IM_OUTPUT_IMAGE("output"), ++ IM_INPUT_INT("Bands"), ++ IM_INPUT_INT("BandFmt"), ++ IM_INPUT_INT("Coding") + }; + + /* Call im_copy_morph via arg vector. + */ + static int +-copy_morph_vec( im_object *argv ) ++copy_morph_vec(im_object *argv) + { + int Bands = *((int *) argv[2]); + int BandFmt = *((int *) argv[3]); + int Coding = *((int *) argv[4]); + +- return( im_copy_morph( argv[0], argv[1], +- Bands, BandFmt, Coding ) ); ++ return (im_copy_morph(argv[0], argv[1], ++ Bands, BandFmt, Coding)); + } + + /* Description of im_copy_morph. + */ + static im_function copy_morph_desc = { +- "im_copy_morph", /* Name */ ++ "im_copy_morph", /* Name */ + "copy image, setting pixel layout", + + /* Can't set PTOP ... we don't want to zap the LUT, we want the real + * image. + */ +- IM_FN_PIO, /* Flags */ ++ IM_FN_PIO, /* Flags */ + +- copy_morph_vec, /* Dispatch function */ +- IM_NUMBER( copy_morph_args ), /* Size of arg list */ +- copy_morph_args /* Arg list */ ++ copy_morph_vec, /* Dispatch function */ ++ IM_NUMBER(copy_morph_args), /* Size of arg list */ ++ copy_morph_args /* Arg list */ + }; + + /* Call im_copy via arg vector. + */ + static int +-copy_vec( im_object *argv ) ++copy_vec(im_object *argv) + { +- return( im_copy( argv[0], argv[1] ) ); ++ return (im_copy(argv[0], argv[1])); + } + + /* Description of im_copy. + */ + static im_function copy_desc = { +- "im_copy", /* Name */ ++ "im_copy", /* Name */ + "copy image", + + /* Can't set PTOP ... we don't want to zap the LUT, we want the real +@@ -737,533 +737,533 @@ static im_function copy_desc = { + */ + IM_FN_PIO | IM_FN_NOCACHE, + +- copy_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ copy_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_copy_file via arg vector. + */ + static int +-copy_file_vec( im_object *argv ) ++copy_file_vec(im_object *argv) + { +- return( im_copy_file( argv[0], argv[1] ) ); ++ return (im_copy_file(argv[0], argv[1])); + } + + /* Description of im_copy_file. + */ + static im_function copy_file_desc = { +- "im_copy_file", /* Name */ ++ "im_copy_file", /* Name */ + "copy image to a file and return that", + + /* Can't set PTOP ... we don't want to zap the LUT, we want the real + * image. + */ +- IM_FN_PIO, /* Flags */ ++ IM_FN_PIO, /* Flags */ + +- copy_file_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ copy_file_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_copy_swap via arg vector. + */ + static int +-copy_swap_vec( im_object *argv ) ++copy_swap_vec(im_object *argv) + { +- return( im_copy_swap( argv[0], argv[1] ) ); ++ return (im_copy_swap(argv[0], argv[1])); + } + + /* Description of im_copy_swap. + */ + static im_function copy_swap_desc = { +- "im_copy_swap", /* Name */ ++ "im_copy_swap", /* Name */ + "copy image, swapping byte order", + + /* Can't set PTOP ... we don't want to zap the LUT, we want the real + * image. + */ +- IM_FN_PIO, /* Flags */ ++ IM_FN_PIO, /* Flags */ + +- copy_swap_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ copy_swap_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_fliphor via arg vector. + */ + static int +-fliphor_vec( im_object *argv ) ++fliphor_vec(im_object *argv) + { +- return( im_fliphor( argv[0], argv[1] ) ); ++ return (im_fliphor(argv[0], argv[1])); + } + + /* Description of im_fliphor. + */ + static im_function fliphor_desc = { +- "im_fliphor", /* Name */ ++ "im_fliphor", /* Name */ + "flip image left-right", +- IM_FN_PIO, /* Flags */ +- fliphor_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ fliphor_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_flipver via arg vector. + */ + static int +-flipver_vec( im_object *argv ) ++flipver_vec(im_object *argv) + { +- return( im_flipver( argv[0], argv[1] ) ); ++ return (im_flipver(argv[0], argv[1])); + } + + /* Description of im_flipver. + */ + static im_function flipver_desc = { +- "im_flipver", /* Name */ ++ "im_flipver", /* Name */ + "flip image top-bottom", +- IM_FN_PIO, /* Flags */ +- flipver_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ flipver_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_falsecolour via arg vector. + */ + static int +-falsecolour_vec( im_object *argv ) ++falsecolour_vec(im_object *argv) + { +- return( im_falsecolour( argv[0], argv[1] ) ); ++ return (im_falsecolour(argv[0], argv[1])); + } + + /* Description of im_falsecolour. + */ + static im_function falsecolour_desc = { +- "im_falsecolour", /* Name */ ++ "im_falsecolour", /* Name */ + "turn luminance changes into chrominance changes", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- falsecolour_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ falsecolour_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Args for im_insert. + */ + static im_arg_desc insert_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_INPUT_IMAGE( "sub" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "x" ), +- IM_INPUT_INT( "y" ) ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_IMAGE("sub"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("x"), ++ IM_INPUT_INT("y") + }; + + /* Call im_insert via arg vector. + */ + static int +-insert_vec( im_object *argv ) ++insert_vec(im_object *argv) + { + int x = *((int *) argv[3]); + int y = *((int *) argv[4]); + +- return( im_insert( argv[0], argv[1], argv[2], x, y ) ); ++ return (im_insert(argv[0], argv[1], argv[2], x, y)); + } + + /* Description of im_insert. + */ + static im_function insert_desc = { +- "im_insert", /* Name */ ++ "im_insert", /* Name */ + "insert sub-image into main image at position", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- insert_vec, /* Dispatch function */ +- IM_NUMBER( insert_args ), /* Size of arg list */ +- insert_args /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ insert_vec, /* Dispatch function */ ++ IM_NUMBER(insert_args), /* Size of arg list */ ++ insert_args /* Arg list */ + }; + + /* Args for im_insertset. + */ + static im_arg_desc insertset_args[] = { +- IM_INPUT_IMAGE( "main" ), +- IM_INPUT_IMAGE( "sub" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INTVEC( "x" ), +- IM_INPUT_INTVEC( "y" ) ++ IM_INPUT_IMAGE("main"), ++ IM_INPUT_IMAGE("sub"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INTVEC("x"), ++ IM_INPUT_INTVEC("y") + }; + + /* Call im_insertplaceset via arg vector. + */ + static int +-insertset_vec( im_object *argv ) ++insertset_vec(im_object *argv) + { + im_intvec_object *xv = (im_intvec_object *) argv[3]; + im_intvec_object *yv = (im_intvec_object *) argv[4]; + +- if( xv->n != yv->n ) { +- im_error( "im_insertset", "%s", +- _( "vectors not same length" ) ); +- return( -1 ); ++ if (xv->n != yv->n) { ++ im_error("im_insertset", "%s", ++ _("vectors not same length")); ++ return (-1); + } + +- if( im_insertset( argv[0], argv[1], argv[2], xv->n, xv->vec, yv->vec ) ) +- return( -1 ); ++ if (im_insertset(argv[0], argv[1], argv[2], xv->n, xv->vec, yv->vec)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_insertset. +- */ ++ */ + static im_function insertset_desc = { +- "im_insertset", /* Name */ ++ "im_insertset", /* Name */ + "insert sub into main at every position in x, y", +- 0, /* Flags */ +- insertset_vec, /* Dispatch function */ +- IM_NUMBER( insertset_args ), /* Size of arg list */ +- insertset_args /* Arg list */ ++ 0, /* Flags */ ++ insertset_vec, /* Dispatch function */ ++ IM_NUMBER(insertset_args), /* Size of arg list */ ++ insertset_args /* Arg list */ + }; + + /* Call im_insert_noexpand via arg vector. + */ + static int +-insert_noexpand_vec( im_object *argv ) ++insert_noexpand_vec(im_object *argv) + { + int x = *((int *) argv[3]); + int y = *((int *) argv[4]); + +- return( im_insert_noexpand( argv[0], argv[1], argv[2], x, y ) ); ++ return (im_insert_noexpand(argv[0], argv[1], argv[2], x, y)); + } + + /* Description of im_insert_noexpand. + */ + static im_function insert_noexpand_desc = { +- "im_insert_noexpand", /* Name */ ++ "im_insert_noexpand", /* Name */ + "insert sub-image into main image at position, no expansion", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- insert_noexpand_vec, /* Dispatch function */ +- IM_NUMBER( insert_args ), /* Size of arg list */ +- insert_args /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ insert_noexpand_vec, /* Dispatch function */ ++ IM_NUMBER(insert_args), /* Size of arg list */ ++ insert_args /* Arg list */ + }; + + /* Call im_rot180 via arg vector. + */ + static int +-rot180_vec( im_object *argv ) ++rot180_vec(im_object *argv) + { +- return( im_rot180( argv[0], argv[1] ) ); ++ return (im_rot180(argv[0], argv[1])); + } + + /* Description of im_rot180. + */ + static im_function rot180_desc = { +- "im_rot180", /* Name */ ++ "im_rot180", /* Name */ + "rotate image 180 degrees", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- rot180_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ rot180_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_rot90 via arg vector. + */ + static int +-rot90_vec( im_object *argv ) ++rot90_vec(im_object *argv) + { +- return( im_rot90( argv[0], argv[1] ) ); ++ return (im_rot90(argv[0], argv[1])); + } + + /* Description of im_rot90. + */ + static im_function rot90_desc = { +- "im_rot90", /* Name */ ++ "im_rot90", /* Name */ + "rotate image 90 degrees clockwise", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- rot90_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ rot90_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_rot270 via arg vector. + */ + static int +-rot270_vec( im_object *argv ) ++rot270_vec(im_object *argv) + { +- return( im_rot270( argv[0], argv[1] ) ); ++ return (im_rot270(argv[0], argv[1])); + } + + /* Description of im_rot270. + */ + static im_function rot270_desc = { +- "im_rot270", /* Name */ ++ "im_rot270", /* Name */ + "rotate image 270 degrees clockwise", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- rot270_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ rot270_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_lrjoin via arg vector. + */ + static int +-lrjoin_vec( im_object *argv ) ++lrjoin_vec(im_object *argv) + { +- return( im_lrjoin( argv[0], argv[1], argv[2] ) ); ++ return (im_lrjoin(argv[0], argv[1], argv[2])); + } + + /* Description of im_lrjoin. + */ + static im_function lrjoin_desc = { +- "im_lrjoin", /* Name */ ++ "im_lrjoin", /* Name */ + "join two images left-right", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- lrjoin_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ lrjoin_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_tbjoin via arg vector. + */ + static int +-tbjoin_vec( im_object *argv ) ++tbjoin_vec(im_object *argv) + { +- return( im_tbjoin( argv[0], argv[1], argv[2] ) ); ++ return (im_tbjoin(argv[0], argv[1], argv[2])); + } + + /* Description of im_tbjoin. + */ + static im_function tbjoin_desc = { +- "im_tbjoin", /* Name */ ++ "im_tbjoin", /* Name */ + "join two images top-bottom", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- tbjoin_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ tbjoin_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_scale via arg vector. + */ + static int +-scale_vec( im_object *argv ) ++scale_vec(im_object *argv) + { +- return( im_scale( argv[0], argv[1] ) ); ++ return (im_scale(argv[0], argv[1])); + } + + /* Description of im_scale. + */ + static im_function scale_desc = { +- "im_scale", /* Name */ ++ "im_scale", /* Name */ + "scale image linearly to fit range 0-255", +- IM_FN_PIO, /* Flags */ +- scale_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ scale_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_scaleps via arg vector. + */ + static int +-scaleps_vec( im_object *argv ) ++scaleps_vec(im_object *argv) + { +- return( im_scaleps( argv[0], argv[1] ) ); ++ return (im_scaleps(argv[0], argv[1])); + } + + /* Description of im_scaleps. + */ + static im_function scaleps_desc = { +- "im_scaleps", /* Name */ ++ "im_scaleps", /* Name */ + "logarithmic scale of image to fit range 0-255", +- 0, /* Flags */ +- scaleps_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ 0, /* Flags */ ++ scaleps_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Args to im_grid. + */ + static im_arg_desc grid_args[] = { +- IM_INPUT_IMAGE( "input" ), +- IM_OUTPUT_IMAGE( "output" ), +- IM_INPUT_INT( "tile_height" ), +- IM_INPUT_INT( "across" ), +- IM_INPUT_INT( "down" ) ++ IM_INPUT_IMAGE("input"), ++ IM_OUTPUT_IMAGE("output"), ++ IM_INPUT_INT("tile_height"), ++ IM_INPUT_INT("across"), ++ IM_INPUT_INT("down") + }; + + /* Call im_grid via arg vector. + */ + static int +-grid_vec( im_object *argv ) ++grid_vec(im_object *argv) + { + int tile_height = *((int *) argv[2]); + int across = *((int *) argv[3]); + int down = *((int *) argv[4]); + +- return( im_grid( argv[0], argv[1], tile_height, across, down ) ); ++ return (im_grid(argv[0], argv[1], tile_height, across, down)); + } + + /* Description of im_grid. + */ + static im_function grid_desc = { +- "im_grid", /* Name */ ++ "im_grid", /* Name */ + "chop a tall thin image into a grid of images", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- grid_vec, /* Dispatch function */ +- IM_NUMBER( grid_args ), /* Size of arg list */ +- grid_args /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ grid_vec, /* Dispatch function */ ++ IM_NUMBER(grid_args), /* Size of arg list */ ++ grid_args /* Arg list */ + }; + + /* Args to im_replicate. + */ + static im_arg_desc replicate_args[] = { +- IM_INPUT_IMAGE( "input" ), +- IM_OUTPUT_IMAGE( "output" ), +- IM_INPUT_INT( "across" ), +- IM_INPUT_INT( "down" ) ++ IM_INPUT_IMAGE("input"), ++ IM_OUTPUT_IMAGE("output"), ++ IM_INPUT_INT("across"), ++ IM_INPUT_INT("down") + }; + + /* Call im_replicate via arg vector. + */ + static int +-replicate_vec( im_object *argv ) ++replicate_vec(im_object *argv) + { + int across = *((int *) argv[2]); + int down = *((int *) argv[3]); + +- return( im_replicate( argv[0], argv[1], across, down ) ); ++ return (im_replicate(argv[0], argv[1], across, down)); + } + + /* Description of im_replicate. + */ + static im_function replicate_desc = { +- "im_replicate", /* Name */ ++ "im_replicate", /* Name */ + "replicate an image horizontally and vertically", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- replicate_vec, /* Dispatch function */ +- IM_NUMBER( replicate_args ), /* Size of arg list */ +- replicate_args /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ replicate_vec, /* Dispatch function */ ++ IM_NUMBER(replicate_args), /* Size of arg list */ ++ replicate_args /* Arg list */ + }; + + /* Args to im_zoom. + */ + static im_arg_desc zoom_args[] = { +- IM_INPUT_IMAGE( "input" ), +- IM_OUTPUT_IMAGE( "output" ), +- IM_INPUT_INT( "xfac" ), +- IM_INPUT_INT( "yfac" ) ++ IM_INPUT_IMAGE("input"), ++ IM_OUTPUT_IMAGE("output"), ++ IM_INPUT_INT("xfac"), ++ IM_INPUT_INT("yfac") + }; + + /* Call im_zoom via arg vector. + */ + static int +-zoom_vec( im_object *argv ) ++zoom_vec(im_object *argv) + { + int xfac = *((int *) argv[2]); + int yfac = *((int *) argv[3]); + +- return( im_zoom( argv[0], argv[1], xfac, yfac ) ); ++ return (im_zoom(argv[0], argv[1], xfac, yfac)); + } + + /* Description of im_zoom. + */ + static im_function zoom_desc = { +- "im_zoom", /* Name */ ++ "im_zoom", /* Name */ + "simple zoom of an image by integer factors", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- zoom_vec, /* Dispatch function */ +- IM_NUMBER( zoom_args ), /* Size of arg list */ +- zoom_args /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ zoom_vec, /* Dispatch function */ ++ IM_NUMBER(zoom_args), /* Size of arg list */ ++ zoom_args /* Arg list */ + }; + + /* Call im_msb via arg vector. + */ + static int +-msb_vec (im_object * argv) ++msb_vec(im_object *argv) + { +- return im_msb (argv[0], argv[1]); ++ return im_msb(argv[0], argv[1]); + } + + /* Description of im_msb. + */ + static im_function msb_desc = { +- "im_msb", /* Name */ +- "convert to uchar by discarding bits", +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- msb_vec, /* Dispatch function */ +- IM_NUMBER (one_in_one_out), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_msb", /* Name */ ++ "convert to uchar by discarding bits", ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ msb_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Args to im_msb_band. + */ + static im_arg_desc msb_band_args[] = { +- IM_INPUT_IMAGE ("in"), +- IM_OUTPUT_IMAGE ("out"), +- IM_INPUT_INT ("band") ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("band") + }; + + /* Call im_msb_band via arg vector. + */ + static int +-msb_band_vec (im_object * argv) ++msb_band_vec(im_object *argv) + { +- IMAGE *in = (IMAGE *) argv[0]; +- IMAGE *out = (IMAGE *) argv[1]; +- int *band = (int *) argv[2]; ++ IMAGE *in = (IMAGE *) argv[0]; ++ IMAGE *out = (IMAGE *) argv[1]; ++ int *band = (int *) argv[2]; + +- return im_msb_band (in, out, *band); ++ return im_msb_band(in, out, *band); + } + + /* Description of im_msb_band. + */ + static im_function msb_band_desc = { +- "im_msb_band", /* Name */ +- "convert to single band uchar by discarding bits", +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- msb_band_vec, /* Dispatch function */ +- IM_NUMBER (msb_band_args), /* Size of arg list */ +- msb_band_args /* Arg list */ ++ "im_msb_band", /* Name */ ++ "convert to single band uchar by discarding bits", ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ msb_band_vec, /* Dispatch function */ ++ IM_NUMBER(msb_band_args), /* Size of arg list */ ++ msb_band_args /* Arg list */ + }; + + /* Args to im_wrap. + */ + static im_arg_desc wrap_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "x" ), +- IM_INPUT_INT( "y" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("x"), ++ IM_INPUT_INT("y") + }; + + /* Call im_wrap via arg vector. + */ + static int +-wrap_vec (im_object * argv) ++wrap_vec(im_object *argv) + { +- return im_wrap( argv[0], argv[1], *(int*)argv[2], *(int*)argv[3] ); ++ return im_wrap(argv[0], argv[1], *(int *) argv[2], *(int *) argv[3]); + } + + /* Description of im_wrap. + */ + static im_function wrap_desc = { +- "im_wrap", /* Name */ +- "shift image origin, wrapping at sides", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- wrap_vec, /* Dispatch function */ +- IM_NUMBER (wrap_args), /* Size of arg list */ +- wrap_args /* Arg list */ ++ "im_wrap", /* Name */ ++ "shift image origin, wrapping at sides", ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ wrap_vec, /* Dispatch function */ ++ IM_NUMBER(wrap_args), /* Size of arg list */ ++ wrap_args /* Arg list */ + }; + + /* Args for im_embed. + */ + static im_arg_desc embed_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "type" ), +- IM_INPUT_INT( "x" ), +- IM_INPUT_INT( "y" ), +- IM_INPUT_INT( "width" ), +- IM_INPUT_INT( "height" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("type"), ++ IM_INPUT_INT("x"), ++ IM_INPUT_INT("y"), ++ IM_INPUT_INT("width"), ++ IM_INPUT_INT("height") + }; + + /* Call im_embed via arg vector. + */ + static int +-embed_vec( im_object *argv ) ++embed_vec(im_object *argv) + { + int type = *((int *) argv[2]); + int x = *((int *) argv[3]); +@@ -1271,18 +1271,18 @@ embed_vec( im_object *argv ) + int width = *((int *) argv[5]); + int height = *((int *) argv[6]); + +- return( im_embed( argv[0], argv[1], type, x, y, width, height ) ); ++ return (im_embed(argv[0], argv[1], type, x, y, width, height)); + } + + /* Description of im_embed. +- */ ++ */ + static im_function embed_desc = { +- "im_embed", /* Name */ +- "embed in within a set of borders", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- embed_vec, /* Dispatch function */ +- IM_NUMBER( embed_args ), /* Size of arg list */ +- embed_args /* Arg list */ ++ "im_embed", /* Name */ ++ "embed in within a set of borders", ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ embed_vec, /* Dispatch function */ ++ IM_NUMBER(embed_args), /* Size of arg list */ ++ embed_args /* Arg list */ + }; + + /* Package up all these functions. +@@ -1317,8 +1317,8 @@ static im_function *conv_list[] = { + &insert_noexpand_desc, + &embed_desc, + &lrjoin_desc, +- &msb_desc, +- &msb_band_desc, ++ &msb_desc, ++ &msb_band_desc, + &replicate_desc, + &ri2c_desc, + &rot180_desc, +@@ -1339,6 +1339,6 @@ static im_function *conv_list[] = { + */ + im_package im__conversion = { + "conversion", +- IM_NUMBER( conv_list ), ++ IM_NUMBER(conv_list), + conv_list + }; +diff --git a/libvips/deprecated/convol_dispatch.c b/libvips/deprecated/convol_dispatch.c +index 5ae40f9f4e..c26c73d3e7 100644 +--- a/libvips/deprecated/convol_dispatch.c ++++ b/libvips/deprecated/convol_dispatch.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,96 +43,96 @@ + /* One image in, one out. + */ + static im_arg_desc one_in_one_out[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Two images in, one out. + */ + static im_arg_desc two_in_one_out[] = { +- IM_INPUT_IMAGE( "in1" ), +- IM_INPUT_IMAGE( "in2" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in1"), ++ IM_INPUT_IMAGE("in2"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Args to im_addgnoise. + */ + static im_arg_desc addgnoise_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLE( "sigma" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLE("sigma") + }; + + /* Call im_addgnoise via arg vector. + */ + static int +-addgnoise_vec( im_object *argv ) ++addgnoise_vec(im_object *argv) + { + double sigma = *((double *) argv[2]); + +- return( im_addgnoise( argv[0], argv[1], sigma ) ); ++ return (im_addgnoise(argv[0], argv[1], sigma)); + } + + /* Description of im_addgnoise. +- */ ++ */ + static im_function addgnoise_desc = { +- "im_addgnoise", /* Name */ ++ "im_addgnoise", /* Name */ + "add gaussian noise with mean 0 and std. dev. sigma", +- IM_FN_PIO, /* Flags */ +- addgnoise_vec, /* Dispatch function */ +- IM_NUMBER( addgnoise_args ), /* Size of arg list */ +- addgnoise_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ addgnoise_vec, /* Dispatch function */ ++ IM_NUMBER(addgnoise_args), /* Size of arg list */ ++ addgnoise_args /* Arg list */ + }; + + /* Args to im_contrast_surface. + */ + static im_arg_desc contrast_surface_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "half_win_size" ), +- IM_INPUT_INT( "spacing" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("half_win_size"), ++ IM_INPUT_INT("spacing") + }; + + /* Call im_contrast_surface via arg vector. + */ + static int +-contrast_surface_vec( im_object *argv ) ++contrast_surface_vec(im_object *argv) + { + int half_win_size = *((int *) argv[2]); + int spacing = *((int *) argv[3]); + +- return( im_contrast_surface( argv[0], argv[1], +- half_win_size, spacing ) ); ++ return (im_contrast_surface(argv[0], argv[1], ++ half_win_size, spacing)); + } + + /* Description of im_contrast_surface. +- */ ++ */ + static im_function contrast_surface_desc = { +- "im_contrast_surface", /* Name */ ++ "im_contrast_surface", /* Name */ + "find high-contrast points in an image", +- IM_FN_PIO, /* Flags */ +- contrast_surface_vec, /* Dispatch function */ +- IM_NUMBER( contrast_surface_args ),/* Size of arg list */ +- contrast_surface_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ contrast_surface_vec, /* Dispatch function */ ++ IM_NUMBER(contrast_surface_args), /* Size of arg list */ ++ contrast_surface_args /* Arg list */ + }; + + /* Args to im_sharpen. + */ + static im_arg_desc sharpen_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "mask_size" ), +- IM_INPUT_DOUBLE( "x1" ), +- IM_INPUT_DOUBLE( "y2" ), +- IM_INPUT_DOUBLE( "y3" ), +- IM_INPUT_DOUBLE( "m1" ), +- IM_INPUT_DOUBLE( "m2" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("mask_size"), ++ IM_INPUT_DOUBLE("x1"), ++ IM_INPUT_DOUBLE("y2"), ++ IM_INPUT_DOUBLE("y3"), ++ IM_INPUT_DOUBLE("m1"), ++ IM_INPUT_DOUBLE("m2") + }; + + /* Call im_sharpen via arg vector. + */ + static int +-sharpen_vec( im_object *argv ) ++sharpen_vec(im_object *argv) + { + int mask_size = *((int *) argv[2]); + double x1 = *((double *) argv[3]); +@@ -141,340 +141,340 @@ sharpen_vec( im_object *argv ) + double m1 = *((double *) argv[6]); + double m2 = *((double *) argv[7]); + +- return( im_sharpen( argv[0], argv[1], mask_size, x1, x2, x3, m1, m2 ) ); ++ return (im_sharpen(argv[0], argv[1], mask_size, x1, x2, x3, m1, m2)); + } + + /* Description of im_sharpen. +- */ ++ */ + static im_function sharpen_desc = { +- "im_sharpen", /* Name */ ++ "im_sharpen", /* Name */ + "sharpen high frequencies of L channel of LabQ", +- IM_FN_PIO, /* Flags */ +- sharpen_vec, /* Dispatch function */ +- IM_NUMBER( sharpen_args ), /* Size of arg list */ +- sharpen_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ sharpen_vec, /* Dispatch function */ ++ IM_NUMBER(sharpen_args), /* Size of arg list */ ++ sharpen_args /* Arg list */ + }; + + /* Args for convolver with imask. + */ + static im_arg_desc conv_imask[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_IMASK( "matrix" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_IMASK("matrix") + }; + + /* Args for convolver with dmask. + */ + static im_arg_desc conv_dmask[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DMASK( "matrix" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DMASK("matrix") + }; + + /* Call im_compass via arg vector. + */ + static int +-compass_vec( im_object *argv ) ++compass_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_compass( argv[0], argv[1], mo->mask ) ); ++ return (im_compass(argv[0], argv[1], mo->mask)); + } + + /* Description of im_compass. +- */ ++ */ + static im_function compass_desc = { +- "im_compass", /* Name */ ++ "im_compass", /* Name */ + "convolve with 8-way rotating integer mask", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- compass_vec, /* Dispatch function */ +- IM_NUMBER( conv_imask ), /* Size of arg list */ +- conv_imask /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ compass_vec, /* Dispatch function */ ++ IM_NUMBER(conv_imask), /* Size of arg list */ ++ conv_imask /* Arg list */ + }; + + /* Call im_conv via arg vector. + */ + static int +-conv_vec( im_object *argv ) ++conv_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_conv( argv[0], argv[1], mo->mask ) ); ++ return (im_conv(argv[0], argv[1], mo->mask)); + } + + /* Description of im_conv. +- */ ++ */ + static im_function conv_desc = { +- "im_conv", /* Name */ ++ "im_conv", /* Name */ + "convolve", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- conv_vec, /* Dispatch function */ +- IM_NUMBER( conv_imask ), /* Size of arg list */ +- conv_imask /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ conv_vec, /* Dispatch function */ ++ IM_NUMBER(conv_imask), /* Size of arg list */ ++ conv_imask /* Arg list */ + }; + + /* Call im_conv_f via arg vector. + */ + static int +-conv_f_vec( im_object *argv ) ++conv_f_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_conv_f( argv[0], argv[1], mo->mask ) ); ++ return (im_conv_f(argv[0], argv[1], mo->mask)); + } + + /* Description of im_conv_f. +- */ ++ */ + static im_function conv_f_desc = { +- "im_conv_f", /* Name */ ++ "im_conv_f", /* Name */ + "convolve, with DOUBLEMASK", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- conv_f_vec, /* Dispatch function */ +- IM_NUMBER( conv_dmask ), /* Size of arg list */ +- conv_dmask /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ conv_f_vec, /* Dispatch function */ ++ IM_NUMBER(conv_dmask), /* Size of arg list */ ++ conv_dmask /* Arg list */ + }; + + /* Call im_convsep via arg vector. + */ + static int +-convsep_vec( im_object *argv ) ++convsep_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_convsep( argv[0], argv[1], mo->mask ) ); ++ return (im_convsep(argv[0], argv[1], mo->mask)); + } + + /* Description of im_convsep. +- */ ++ */ + static im_function convsep_desc = { +- "im_convsep", /* Name */ ++ "im_convsep", /* Name */ + "seperable convolution", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- convsep_vec, /* Dispatch function */ +- IM_NUMBER( conv_imask ), /* Size of arg list */ +- conv_imask /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ convsep_vec, /* Dispatch function */ ++ IM_NUMBER(conv_imask), /* Size of arg list */ ++ conv_imask /* Arg list */ + }; + + /* Call im_convsep_f via arg vector. + */ + static int +-convsep_f_vec( im_object *argv ) ++convsep_f_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_convsep_f( argv[0], argv[1], mo->mask ) ); ++ return (im_convsep_f(argv[0], argv[1], mo->mask)); + } + + /* Description of im_convsep_f. +- */ ++ */ + static im_function convsep_f_desc = { +- "im_convsep_f", /* Name */ ++ "im_convsep_f", /* Name */ + "seperable convolution, with DOUBLEMASK", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- convsep_f_vec, /* Dispatch function */ +- IM_NUMBER( conv_dmask ), /* Size of arg list */ +- conv_dmask /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ convsep_f_vec, /* Dispatch function */ ++ IM_NUMBER(conv_dmask), /* Size of arg list */ ++ conv_dmask /* Arg list */ + }; + + /* Call im_fastcor via arg vector. + */ + static int +-fastcor_vec( im_object *argv ) ++fastcor_vec(im_object *argv) + { +- return( im_fastcor( argv[0], argv[1], argv[2] ) ); ++ return (im_fastcor(argv[0], argv[1], argv[2])); + } + + /* Description of im_fastcor. +- */ ++ */ + static im_function fastcor_desc = { +- "im_fastcor", /* Name */ ++ "im_fastcor", /* Name */ + "fast correlate in2 within in1", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- fastcor_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ fastcor_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_grad_x via arg vector. + */ + static int +-grad_x_vec( im_object *argv ) ++grad_x_vec(im_object *argv) + { +- return( im_grad_x( argv[0], argv[1] ) ); ++ return (im_grad_x(argv[0], argv[1])); + } + + /* Description of im_grad_x. +- */ ++ */ + static im_function grad_x_desc = { +- "im_grad_x", /* Name */ ++ "im_grad_x", /* Name */ + "horizontal difference image", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- grad_x_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ grad_x_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_grad_y via arg vector. + */ + static int +-grad_y_vec( im_object *argv ) ++grad_y_vec(im_object *argv) + { +- return( im_grad_y( argv[0], argv[1] ) ); ++ return (im_grad_y(argv[0], argv[1])); + } + + /* Description of im_grad_y. +- */ ++ */ + static im_function grad_y_desc = { +- "im_grad_y", /* Name */ ++ "im_grad_y", /* Name */ + "vertical difference image", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- grad_y_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ grad_y_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_gradcor via arg vector. + */ + static int +-gradcor_vec( im_object *argv ) ++gradcor_vec(im_object *argv) + { +- return( im_gradcor( argv[0], argv[1], argv[2] ) ); ++ return (im_gradcor(argv[0], argv[1], argv[2])); + } + + /* Description of im_gradcor. +- */ ++ */ + static im_function gradcor_desc = { +- "im_gradcor", /* Name */ ++ "im_gradcor", /* Name */ + "non-normalised correlation of gradient of in2 within in1", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- gradcor_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ gradcor_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_gradient via arg vector. + */ + static int +-gradient_vec( im_object *argv ) ++gradient_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_gradient( argv[0], argv[1], mo->mask ) ); ++ return (im_gradient(argv[0], argv[1], mo->mask)); + } + + /* Description of im_gradient. +- */ ++ */ + static im_function gradient_desc = { +- "im_gradient", /* Name */ ++ "im_gradient", /* Name */ + "convolve with 2-way rotating mask", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- gradient_vec, /* Dispatch function */ +- IM_NUMBER( conv_imask ), /* Size of arg list */ +- conv_imask /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ gradient_vec, /* Dispatch function */ ++ IM_NUMBER(conv_imask), /* Size of arg list */ ++ conv_imask /* Arg list */ + }; + + /* Call im_lindetect via arg vector. + */ + static int +-lindetect_vec( im_object *argv ) ++lindetect_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_lindetect( argv[0], argv[1], mo->mask ) ); ++ return (im_lindetect(argv[0], argv[1], mo->mask)); + } + + /* Description of im_lindetect. +- */ ++ */ + static im_function lindetect_desc = { +- "im_lindetect", /* Name */ ++ "im_lindetect", /* Name */ + "convolve with 4-way rotating mask", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- lindetect_vec, /* Dispatch function */ +- IM_NUMBER( conv_imask ), /* Size of arg list */ +- conv_imask /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ lindetect_vec, /* Dispatch function */ ++ IM_NUMBER(conv_imask), /* Size of arg list */ ++ conv_imask /* Arg list */ + }; + + /* Call im_spcor via arg vector. + */ + static int +-spcor_vec( im_object *argv ) ++spcor_vec(im_object *argv) + { +- return( im_spcor( argv[0], argv[1], argv[2] ) ); ++ return (im_spcor(argv[0], argv[1], argv[2])); + } + + /* Description of im_spcor. +- */ ++ */ + static im_function spcor_desc = { +- "im_spcor", /* Name */ ++ "im_spcor", /* Name */ + "normalised correlation of in2 within in1", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- spcor_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ spcor_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Args for im_aconv(). + */ + static im_arg_desc aconv_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DMASK( "matrix" ), +- IM_INPUT_INT( "n_layers" ), +- IM_INPUT_INT( "cluster" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DMASK("matrix"), ++ IM_INPUT_INT("n_layers"), ++ IM_INPUT_INT("cluster") + }; + + /* Call im_aconv via arg vector. + */ + static int +-aconv_vec( im_object *argv ) ++aconv_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + int n_layers = *((int *) argv[3]); + int cluster = *((int *) argv[4]); + +- return( im_aconv( argv[0], argv[1], mo->mask, n_layers, cluster ) ); ++ return (im_aconv(argv[0], argv[1], mo->mask, n_layers, cluster)); + } + + /* Description of im_aconv. +- */ ++ */ + static im_function aconv_desc = { +- "im_aconv", /* Name */ ++ "im_aconv", /* Name */ + "approximate convolution", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- aconv_vec, /* Dispatch function */ +- IM_NUMBER( aconv_args ), /* Size of arg list */ +- aconv_args /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ aconv_vec, /* Dispatch function */ ++ IM_NUMBER(aconv_args), /* Size of arg list */ ++ aconv_args /* Arg list */ + }; + + /* Args for im_aconvsep(). + */ + static im_arg_desc aconvsep_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DMASK( "matrix" ), +- IM_INPUT_INT( "n_layers" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DMASK("matrix"), ++ IM_INPUT_INT("n_layers") + }; + + /* Call im_aconvsep via arg vector. + */ + static int +-aconvsep_vec( im_object *argv ) ++aconvsep_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + int n_layers = *((int *) argv[3]); + +- return( im_aconvsep( argv[0], argv[1], mo->mask, n_layers ) ); ++ return (im_aconvsep(argv[0], argv[1], mo->mask, n_layers)); + } + + /* Description of im_aconvsep. +- */ ++ */ + static im_function aconvsep_desc = { +- "im_aconvsep", /* Name */ ++ "im_aconvsep", /* Name */ + "approximate separable convolution", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- aconvsep_vec, /* Dispatch function */ +- IM_NUMBER( aconvsep_args ), /* Size of arg list */ +- aconvsep_args /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ aconvsep_vec, /* Dispatch function */ ++ IM_NUMBER(aconvsep_args), /* Size of arg list */ ++ aconvsep_args /* Arg list */ + }; + + /* Package up all these functions. +@@ -490,10 +490,10 @@ static im_function *convol_list[] = { + &convsep_desc, + &convsep_f_desc, + &fastcor_desc, +- &gradcor_desc, ++ &gradcor_desc, + &gradient_desc, +- &grad_x_desc, +- &grad_y_desc, ++ &grad_x_desc, ++ &grad_y_desc, + &lindetect_desc, + &sharpen_desc, + &spcor_desc, +@@ -503,6 +503,6 @@ static im_function *convol_list[] = { + */ + im_package im__convolution = { + "convolution", +- IM_NUMBER( convol_list ), ++ IM_NUMBER(convol_list), + convol_list + }; +diff --git a/libvips/deprecated/cooc_funcs.c b/libvips/deprecated/cooc_funcs.c +index 5a87bbfc05..d63c7a9c2c 100644 +--- a/libvips/deprecated/cooc_funcs.c ++++ b/libvips/deprecated/cooc_funcs.c +@@ -6,8 +6,8 @@ + * @(#) Usage: + * @(#) int im_cooc_matrix(im, m, xpos, ypos, xsize, ysize, dx, dy, sym_flag) + * @(#) IMAGE *im, *m; +- * @(#) int xpos, ypos, xsize, ysize; location of the box within im +- * @(#) int dx, dy; displacements ++ * @(#) int xpos, ypos, xsize, ysize; location of the box within im ++ * @(#) int dx, dy; displacements + * @(#) int sym_flag; + * @(#) + * @(#) int im_cooc_asm(m, asmoment) +@@ -35,33 +35,33 @@ + * - extern decls removed + * - im_incheck() calls added + * 28/5/97 JC +- * - protos added :( ++ * - protos added :( + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -77,8 +77,8 @@ + #include + #include + +-static +-int im_cooc_sym(IMAGE *im, IMAGE *m, int xpos, int ypos, int xsize, int ysize, int dx, int dy) ++static int ++im_cooc_sym(IMAGE *im, IMAGE *m, int xpos, int ypos, int xsize, int ysize, int dx, int dy) + { + VipsPel *input, *cpinput; + int *buf, *pnt, *cpnt; +@@ -90,69 +90,67 @@ int im_cooc_sym(IMAGE *im, IMAGE *m, int xpos, int ypos, int xsize, int ysize, i + int norm; + + if (im_iocheck(im, m) == -1) +- return( -1 ); +- if ((im->Bands != 1)||(im->BandFmt != IM_BANDFMT_UCHAR)) { +- im_error( "im_cooc_sym", "%s", _( "Unable to accept input") ); +- return(-1); +- } +- if ( (xpos + xsize + dx > im->Xsize)|| (ypos + ysize + dy > im->Ysize) ) { +- im_error( "im_cooc_sym", "%s", _( "wrong args") ); +- return(-1); } ++ return (-1); ++ if ((im->Bands != 1) || (im->BandFmt != IM_BANDFMT_UCHAR)) { ++ im_error("im_cooc_sym", "%s", _("Unable to accept input")); ++ return (-1); ++ } ++ if ((xpos + xsize + dx > im->Xsize) || (ypos + ysize + dy > im->Ysize)) { ++ im_error("im_cooc_sym", "%s", _("wrong args")); ++ return (-1); ++ } + if (im_cp_desc(m, im) == -1) +- return( -1 ); ++ return (-1); + m->Xsize = 256; + m->Ysize = 256; + m->BandFmt = IM_BANDFMT_DOUBLE; + m->Type = IM_TYPE_B_W; + if (im_setupout(m) == -1) +- return( -1 ); +-/* malloc space to keep the read values */ +- buf = (int *)calloc( (unsigned)m->Xsize*m->Ysize, sizeof(int) ); +- line = (double *)calloc( (unsigned)m->Xsize * m->Bands, sizeof(double)); +- if ( (buf == NULL) || (line == NULL) ) { +- im_error( "im_cooc_sym", "%s", _( "calloc failed") ); +- return(-1); } ++ return (-1); ++ /* malloc space to keep the read values */ ++ buf = (int *) calloc((unsigned) m->Xsize * m->Ysize, sizeof(int)); ++ line = (double *) calloc((unsigned) m->Xsize * m->Bands, sizeof(double)); ++ if ((buf == NULL) || (line == NULL)) { ++ im_error("im_cooc_sym", "%s", _("calloc failed")); ++ return (-1); ++ } + input = im->data; +- input += ( ypos * im->Xsize + xpos ); ++ input += (ypos * im->Xsize + xpos); + offset = dy * im->Xsize + dx; +- for ( y=0; yXsize; +- for ( x=0; xXsize * tempB; + (*(buf + bufofst))++; + bufofst = tempB + m->Xsize * tempA; + (*(buf + bufofst))++; + cpinput++; +- } + } ++ } + + norm = xsize * ysize * 2; + pnt = buf; +- for ( y=0; yYsize; y++ ) +- { ++ for (y = 0; y < m->Ysize; y++) { + cpnt = pnt; + pnt += m->Xsize; + cpline = line; +- for (x=0; xXsize; x++) +- *cpline++ = (double)(*cpnt++)/(double)norm; +- if (im_writeline( y, m, (VipsPel *) line ) == -1) +- { +- im_error( "im_cooc_sym", "%s", _( "unable to im_writeline") ); +- return(-1); +- } ++ for (x = 0; x < m->Xsize; x++) ++ *cpline++ = (double) (*cpnt++) / (double) norm; ++ if (im_writeline(y, m, (VipsPel *) line) == -1) { ++ im_error("im_cooc_sym", "%s", _("unable to im_writeline")); ++ return (-1); + } +- free((char*)buf); +- free((char*)line); +- return(0); ++ } ++ free((char *) buf); ++ free((char *) line); ++ return (0); + } + +-static +-int im_cooc_ord(IMAGE *im, IMAGE *m, int xpos, int ypos, int xsize, int ysize, int dx, int dy) ++static int ++im_cooc_ord(IMAGE *im, IMAGE *m, int xpos, int ypos, int xsize, int ysize, int dx, int dy) + { + VipsPel *input, *cpinput; + int *buf, *pnt, *cpnt; +@@ -164,302 +162,285 @@ int im_cooc_ord(IMAGE *im, IMAGE *m, int xpos, int ypos, int xsize, int ysize, i + int norm; + + if (im_iocheck(im, m) == -1) +- return( -1 ); +- if ((im->Bands != 1)||(im->BandFmt != IM_BANDFMT_UCHAR)) +- { +- im_error( "im_cooc_ord", "%s", _( "Unable to accept input") ); +- return(-1); +- } +- if ( (xpos + xsize + dx > im->Xsize)|| (ypos + ysize + dy > im->Ysize) ) { +- im_error( "im_cooc_ord", "%s", _( "wrong args") ); +- return(-1); } ++ return (-1); ++ if ((im->Bands != 1) || (im->BandFmt != IM_BANDFMT_UCHAR)) { ++ im_error("im_cooc_ord", "%s", _("Unable to accept input")); ++ return (-1); ++ } ++ if ((xpos + xsize + dx > im->Xsize) || (ypos + ysize + dy > im->Ysize)) { ++ im_error("im_cooc_ord", "%s", _("wrong args")); ++ return (-1); ++ } + if (im_cp_desc(m, im) == -1) +- return( -1 ); ++ return (-1); + m->Xsize = 256; + m->Ysize = 256; + m->BandFmt = IM_BANDFMT_DOUBLE; + if (im_setupout(m) == -1) +- return( -1 ); +-/* malloc space to keep the read values */ +- buf = (int *)calloc( (unsigned)m->Xsize*m->Ysize, sizeof(int) ); +- line = (double *)calloc( (unsigned)m->Xsize * m->Bands, sizeof(double)); +- if ( (buf == NULL) || (line == NULL) ) { +- im_error( "im_cooc_ord", "%s", _( "calloc failed") ); +- return(-1); } ++ return (-1); ++ /* malloc space to keep the read values */ ++ buf = (int *) calloc((unsigned) m->Xsize * m->Ysize, sizeof(int)); ++ line = (double *) calloc((unsigned) m->Xsize * m->Bands, sizeof(double)); ++ if ((buf == NULL) || (line == NULL)) { ++ im_error("im_cooc_ord", "%s", _("calloc failed")); ++ return (-1); ++ } + input = im->data; +- input += ( ypos * im->Xsize + xpos ); ++ input += (ypos * im->Xsize + xpos); + offset = dy * im->Xsize + dx; +- for ( y=0; yXsize; +- for ( x=0; xXsize * tempB; + (*(buf + bufofst))++; + cpinput++; +- } + } ++ } + + norm = xsize * ysize; + pnt = buf; +- for ( y=0; yYsize; y++ ) +- { ++ for (y = 0; y < m->Ysize; y++) { + cpnt = pnt; + pnt += m->Xsize; + cpline = line; +- for (x=0; xXsize; x++) +- *cpline++ = (double)(*cpnt++)/(double)norm; +- if (im_writeline( y, m, (PEL *) line ) == -1) +- { +- im_error( "im_cooc_ord", "%s", _( "unable to im_writeline") ); +- return(-1); +- } ++ for (x = 0; x < m->Xsize; x++) ++ *cpline++ = (double) (*cpnt++) / (double) norm; ++ if (im_writeline(y, m, (PEL *) line) == -1) { ++ im_error("im_cooc_ord", "%s", _("unable to im_writeline")); ++ return (-1); + } +- free((char*)buf); +- free((char*)line); +- return(0); ++ } ++ free((char *) buf); ++ free((char *) line); ++ return (0); + } + + /* Keep the coocurrence matrix as a 256x256x1 double image */ + +-int +-im_cooc_matrix( IMAGE *im, IMAGE *m, +- int xp, int yp, int xs, int ys, int dx, int dy, int flag ) ++int ++im_cooc_matrix(IMAGE *im, IMAGE *m, ++ int xp, int yp, int xs, int ys, int dx, int dy, int flag) + { + if (flag == 0) +- return( im_cooc_ord(im, m, xp, yp, xs, ys, dx, dy) ); +- else if (flag == 1) /* symmetrical cooc */ +- return( im_cooc_sym(im, m, xp, yp, xs, ys, dx, dy) ); +- else { +- im_error( "im_cooc_matrix", "%s", _( "wrong flag!") ); +- return(-1); } ++ return (im_cooc_ord(im, m, xp, yp, xs, ys, dx, dy)); ++ else if (flag == 1) /* symmetrical cooc */ ++ return (im_cooc_sym(im, m, xp, yp, xs, ys, dx, dy)); ++ else { ++ im_error("im_cooc_matrix", "%s", _("wrong flag!")); ++ return (-1); ++ } + } + + /* Calculate contrast, asmoment, entropy and correlation + */ +-int +-im_cooc_asm( IMAGE *m, double *asmoment ) ++int ++im_cooc_asm(IMAGE *m, double *asmoment) + { + double temp, tmpasm, *pnt; + int i; + +- if( im_incheck( m ) ) +- return( -1 ); ++ if (im_incheck(m)) ++ return (-1); + +- if (m->Xsize != 256 || m->Ysize != 256 || +- m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) +- { +- im_error( "im_cooc_asm", "%s", _( "unable to accept input") ); +- return(-1); +- } ++ if (m->Xsize != 256 || m->Ysize != 256 || ++ m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) { ++ im_error("im_cooc_asm", "%s", _("unable to accept input")); ++ return (-1); ++ } + tmpasm = 0.0; +- pnt = (double*)m->data; +- for(i=0; iXsize * m->Ysize; i++) +- { ++ pnt = (double *) m->data; ++ for (i = 0; i < m->Xsize * m->Ysize; i++) { + temp = *pnt++; + tmpasm += temp * temp; +- } ++ } + *asmoment = tmpasm; +- return(0); ++ return (0); + } + +-int +-im_cooc_contrast( IMAGE *m, double *contrast ) ++int ++im_cooc_contrast(IMAGE *m, double *contrast) + { + double dtemp, tmpcon, *pnt, *cpnt; + int x, y; + +- if( im_incheck( m ) ) +- return( -1 ); ++ if (im_incheck(m)) ++ return (-1); + +- if (m->Xsize != 256 || m->Ysize != 256 || +- m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) +- { +- im_error( "im_cooc_contrast", "%s", _( "unable to accept input") ); +- return(-1); +- } ++ if (m->Xsize != 256 || m->Ysize != 256 || ++ m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) { ++ im_error("im_cooc_contrast", "%s", _("unable to accept input")); ++ return (-1); ++ } + tmpcon = 0.0; +- pnt = (double*)m->data; +- for(y=0; yYsize; y++) +- { ++ pnt = (double *) m->data; ++ for (y = 0; y < m->Ysize; y++) { + cpnt = pnt; + pnt += m->Xsize; +- for(x=0; xXsize; x++) +- { +- dtemp = (double)( (y-x)*(y-x) ); ++ for (x = 0; x < m->Xsize; x++) { ++ dtemp = (double) ((y - x) * (y - x)); + tmpcon += dtemp * (*cpnt); + cpnt++; +- } + } ++ } + + *contrast = tmpcon; +- return(0); ++ return (0); + } + + /* buffer contains the frequency distributions f[i] */ + /* Note that sum(f[i]) = 1.0 and that the */ + /* cooccurence matrix is symmetrical */ +-static void ++static void + stats(double *buffer, int size, double *pmean, double *pstd) + { + double mean, std; + register int i; +- double sumf; /* calculates the sum of f[i] */ +- double temp; /* temporary variable */ ++ double sumf; /* calculates the sum of f[i] */ ++ double temp; /* temporary variable */ + double *pbuffer; +- double sumf2; /* calculates the sum of f[i]^2 */ ++ double sumf2; /* calculates the sum of f[i]^2 */ + double correction; /* calulates the correction term for the variance */ +- double variance; /* = (sumf2 - correction)/n, n=sum(f[i]) = 1 */ +- +- mean = 0.0; std = 0.0; +- sumf = 0.0; sumf2 = 0.0; ++ double variance; /* = (sumf2 - correction)/n, n=sum(f[i]) = 1 */ ++ ++ mean = 0.0; ++ std = 0.0; ++ sumf = 0.0; ++ sumf2 = 0.0; + pbuffer = buffer; +- for (i=0; iXsize != 256 || m->Ysize != 256 || +- m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) +- { +- im_error( "im_cooc_correlation", "%s", _( "unable to accept input") ); +- return(-1); +- } +- row = (double*)calloc( (unsigned)m->Ysize, sizeof(double)); +- col = (double*)calloc( (unsigned)m->Xsize, sizeof(double)); +- if ( row == NULL || col == NULL ) +- { +- im_error( "im_cooc_correlation", "%s", _( "unable to calloc") ); +- return(-1); +- } +- pbuf = (double*)m->data; +- for(j=0; jYsize; j++) +- { ++ if (im_incheck(m)) ++ return (-1); ++ ++ if (m->Xsize != 256 || m->Ysize != 256 || ++ m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) { ++ im_error("im_cooc_correlation", "%s", _("unable to accept input")); ++ return (-1); ++ } ++ row = (double *) calloc((unsigned) m->Ysize, sizeof(double)); ++ col = (double *) calloc((unsigned) m->Xsize, sizeof(double)); ++ if (row == NULL || col == NULL) { ++ im_error("im_cooc_correlation", "%s", _("unable to calloc")); ++ return (-1); ++ } ++ pbuf = (double *) m->data; ++ for (j = 0; j < m->Ysize; j++) { + cpbuf = pbuf; + pbuf += m->Xsize; +- sum=0.0; +- for(i=0; iXsize; i++) ++ sum = 0.0; ++ for (i = 0; i < m->Xsize; i++) + sum += *cpbuf++; +- *(row+j) = sum; +- } ++ *(row + j) = sum; ++ } + +- pbuf = (double*)m->data; +- for(j=0; jYsize; j++) +- { ++ pbuf = (double *) m->data; ++ for (j = 0; j < m->Ysize; j++) { + cpbuf = pbuf; + pbuf++; +- sum=0.0; +- for(i=0; iXsize; i++) +- { ++ sum = 0.0; ++ for (i = 0; i < m->Xsize; i++) { + sum += *cpbuf; + cpbuf += m->Xsize; +- } +- *(col+j) = sum; + } ++ *(col + j) = sum; ++ } + + stats(row, m->Ysize, &mrow, &stdrow); + +- stats(col, m->Ysize ,&mcol, &stdcol); ++ stats(col, m->Ysize, &mcol, &stdcol); + #ifdef DEBUG + fprintf(stderr, "rows: mean=%f std=%f\ncols: mean=%f std=%f\n", +-mrow, stdrow, mcol, stdcol); ++ mrow, stdrow, mcol, stdcol); + #endif + tmpcor = 0.0; +- pbuf = (double*)m->data; +- for(j=0; jYsize; j++) +- { ++ pbuf = (double *) m->data; ++ for (j = 0; j < m->Ysize; j++) { + cpbuf = pbuf; + pbuf += m->Xsize; +- for(i=0; iXsize; i++) +- { ++ for (i = 0; i < m->Xsize; i++) { + dtemp = *cpbuf; +- tmpcor += ( ((double)i)*((double)j)*dtemp); ++ tmpcor += (((double) i) * ((double) j) * dtemp); + cpbuf++; +- } + } ++ } + #ifdef DEBUG + fprintf(stderr, "tmpcor=%f\n", tmpcor); + #endif +- if ( (stdcol==0.0)||(stdrow==0) ) +- { +- im_error( "im_cooc_correlation", "%s", _( "zero std") ); +- return(-1); +- } +- tmpcor = (tmpcor-(mcol*mrow))/(stdcol*stdrow); ++ if ((stdcol == 0.0) || (stdrow == 0)) { ++ im_error("im_cooc_correlation", "%s", _("zero std")); ++ return (-1); ++ } ++ tmpcor = (tmpcor - (mcol * mrow)) / (stdcol * stdrow); + *correlation = tmpcor; +- free((char*)row); free((char*)col); +- return(0); ++ free((char *) row); ++ free((char *) col); ++ return (0); + } + +-int +-im_cooc_entropy( IMAGE *m, double *entropy ) ++int ++im_cooc_entropy(IMAGE *m, double *entropy) + { + double *pbuf, *pbufstart; + double *cpbuf; +- register int i,j; ++ register int i, j; + double tmpent, dtemp; + double val; + +- if( im_incheck( m ) ) +- return( -1 ); ++ if (im_incheck(m)) ++ return (-1); + +- if (m->Xsize != 256 || m->Ysize != 256 || +- m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) +- { +- im_error( "im_cooc_entropy", "%s", _( "unable to accept input") ); +- return(-1); +- } +- pbufstart = (double*)m->data; ++ if (m->Xsize != 256 || m->Ysize != 256 || ++ m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) { ++ im_error("im_cooc_entropy", "%s", _("unable to accept input")); ++ return (-1); ++ } ++ pbufstart = (double *) m->data; + + tmpent = 0.0; + pbuf = pbufstart; +- for(j=0; jYsize; j++) +- { ++ for (j = 0; j < m->Ysize; j++) { + cpbuf = pbuf; + pbuf += m->Xsize; +- for(i=0; iXsize; i++) +- { +- if(*cpbuf != 0) +- { ++ for (i = 0; i < m->Xsize; i++) { ++ if (*cpbuf != 0) { + dtemp = *cpbuf; +- tmpent += (dtemp*log10(dtemp)); +- } +- cpbuf++; ++ tmpent += (dtemp * log10(dtemp)); + } ++ cpbuf++; + } +- val = tmpent*(-1); ++ } ++ val = tmpent * (-1); + + #ifdef DEBUG +- fprintf(stderr,"ENT=%f\nwhich is %f bits\n", val, val/log10(2.0) ); ++ fprintf(stderr, "ENT=%f\nwhich is %f bits\n", val, val / log10(2.0)); + #endif +- *entropy = (val/log10(2.0)); +- return(0); ++ *entropy = (val / log10(2.0)); ++ return (0); + } +diff --git a/libvips/deprecated/deprecated_dispatch.c b/libvips/deprecated/deprecated_dispatch.c +index 1211b18927..d2f6f8b518 100644 +--- a/libvips/deprecated/deprecated_dispatch.c ++++ b/libvips/deprecated/deprecated_dispatch.c +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -42,166 +42,166 @@ + /* One image in, one out. + */ + static im_arg_desc one_in_one_out[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + static im_arg_desc quadratic_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_IMAGE( "coeff" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_IMAGE("coeff") + }; + + static int +-quadratic_vec( im_object *argv ) ++quadratic_vec(im_object *argv) + { +- return( im_quadratic( argv[0], argv[1], argv[2] ) ); ++ return (im_quadratic(argv[0], argv[1], argv[2])); + } + + static im_function quadratic_desc = { +- "im_quadratic", /* Name */ ++ "im_quadratic", /* Name */ + "transform via quadratic", +- IM_FN_PIO, /* Flags */ +- quadratic_vec, /* Dispatch function */ +- IM_NUMBER( quadratic_args ), /* Size of arg list */ +- quadratic_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ quadratic_vec, /* Dispatch function */ ++ IM_NUMBER(quadratic_args), /* Size of arg list */ ++ quadratic_args /* Arg list */ + }; + + /* Two images in, one out. + */ + static im_arg_desc two_in_one_out[] = { +- IM_INPUT_IMAGE( "in1" ), +- IM_INPUT_IMAGE( "in2" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in1"), ++ IM_INPUT_IMAGE("in2"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Call im_clip via arg vector. + */ + static int +-clip_vec( im_object *argv ) ++clip_vec(im_object *argv) + { +- return( im_clip( argv[0], argv[1] ) ); ++ return (im_clip(argv[0], argv[1])); + } + + /* Description of im_clip. + */ + static im_function clip_desc = { +- "im_clip", /* Name */ ++ "im_clip", /* Name */ + "convert to unsigned 8-bit integer", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- clip_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ clip_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_c2ps via arg vector. + */ + static int +-c2ps_vec( im_object *argv ) ++c2ps_vec(im_object *argv) + { +- return( im_c2ps( argv[0], argv[1] ) ); ++ return (im_c2ps(argv[0], argv[1])); + } + + /* Description of im_c2ps. + */ + static im_function c2ps_desc = { +- "im_c2ps", /* Name */ ++ "im_c2ps", /* Name */ + "find power spectrum of complex image", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- c2ps_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ c2ps_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Args for im_lhisteq. + */ + static im_arg_desc lhisteq_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "width" ), +- IM_INPUT_INT( "height" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("width"), ++ IM_INPUT_INT("height") + }; + + /* Args for im_stdif. + */ + static im_arg_desc stdif_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLE( "a" ), +- IM_INPUT_DOUBLE( "m0" ), +- IM_INPUT_DOUBLE( "b" ), +- IM_INPUT_DOUBLE( "s0" ), +- IM_INPUT_INT( "xw" ), +- IM_INPUT_INT( "yw" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLE("a"), ++ IM_INPUT_DOUBLE("m0"), ++ IM_INPUT_DOUBLE("b"), ++ IM_INPUT_DOUBLE("s0"), ++ IM_INPUT_INT("xw"), ++ IM_INPUT_INT("yw") + }; + + /* Args to im_erode. + */ + static im_arg_desc erode_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_IMASK( "mask" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_IMASK("mask") + }; + + /* Args to im_rank. + */ + static im_arg_desc rank_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "xsize" ), +- IM_INPUT_INT( "ysize" ), +- IM_INPUT_INT( "n" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("xsize"), ++ IM_INPUT_INT("ysize"), ++ IM_INPUT_INT("n") + }; + + /* Args for convolver with imask. + */ + static im_arg_desc conv_imask[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_IMASK( "matrix" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_IMASK("matrix") + }; + + /* Args for convolver with dmask. + */ + static im_arg_desc conv_dmask[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DMASK( "matrix" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DMASK("matrix") + }; + + /* Call im_cmulnorm via arg vector. + */ + static int +-cmulnorm_vec( im_object *argv ) ++cmulnorm_vec(im_object *argv) + { +- return( im_cmulnorm( argv[0], argv[1], argv[2] ) ); ++ return (im_cmulnorm(argv[0], argv[1], argv[2])); + } + + /* Description of im_cmulnorm. +- */ ++ */ + static im_function cmulnorm_desc = { +- "im_cmulnorm", /* Name */ +- N_( "multiply two complex images, normalising output" ), +- IM_FN_PIO, /* Flags */ +- cmulnorm_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ "im_cmulnorm", /* Name */ ++ N_("multiply two complex images, normalising output"), ++ IM_FN_PIO, /* Flags */ ++ cmulnorm_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Four images in, one out. + */ + static im_arg_desc fav4_args[] = { +- IM_INPUT_IMAGE( "in1" ), +- IM_INPUT_IMAGE( "in2" ), +- IM_INPUT_IMAGE( "in3" ), +- IM_INPUT_IMAGE( "in4" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in1"), ++ IM_INPUT_IMAGE("in2"), ++ IM_INPUT_IMAGE("in3"), ++ IM_INPUT_IMAGE("in4"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Call im_fav4 via arg vector. + */ + static int +-fav4_vec( im_object *argv ) ++fav4_vec(im_object *argv) + { + IMAGE *buf[4]; + +@@ -210,107 +210,107 @@ fav4_vec( im_object *argv ) + buf[2] = argv[2]; + buf[3] = argv[3]; + +- return( im_fav4( &buf[0], argv[4] ) ); ++ return (im_fav4(&buf[0], argv[4])); + } + + /* Description of im_fav4. +- */ ++ */ + static im_function fav4_desc = { +- "im_fav4", /* Name */ +- N_( "average of 4 images" ), +- 0, /* Flags */ +- fav4_vec, /* Dispatch function */ +- IM_NUMBER( fav4_args ), /* Size of arg list */ +- fav4_args /* Arg list */ ++ "im_fav4", /* Name */ ++ N_("average of 4 images"), ++ 0, /* Flags */ ++ fav4_vec, /* Dispatch function */ ++ IM_NUMBER(fav4_args), /* Size of arg list */ ++ fav4_args /* Arg list */ + }; + + /* Args for im_gadd(). + */ + static im_arg_desc gadd_args[] = { +- IM_INPUT_DOUBLE( "a" ), +- IM_INPUT_IMAGE( "in1" ), +- IM_INPUT_DOUBLE( "b" ), +- IM_INPUT_IMAGE( "in2" ), +- IM_INPUT_DOUBLE( "c" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_DOUBLE("a"), ++ IM_INPUT_IMAGE("in1"), ++ IM_INPUT_DOUBLE("b"), ++ IM_INPUT_IMAGE("in2"), ++ IM_INPUT_DOUBLE("c"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Call im_gadd() via arg vector. + */ + static int +-gadd_vec( im_object *argv ) ++gadd_vec(im_object *argv) + { + double a = *((double *) argv[0]); + double b = *((double *) argv[2]); + double c = *((double *) argv[4]); + +- return( im_gadd( a, argv[1], b, argv[3], c, argv[5] ) ); ++ return (im_gadd(a, argv[1], b, argv[3], c, argv[5])); + } + + /* Description of im_gadd(). +- */ ++ */ + static im_function gadd_desc = { +- "im_gadd", /* Name */ +- N_( "calculate a*in1 + b*in2 + c = outfile" ), +- 0, /* Flags */ +- gadd_vec, /* Dispatch function */ +- IM_NUMBER( gadd_args ), /* Size of arg list */ +- gadd_args /* Arg list */ ++ "im_gadd", /* Name */ ++ N_("calculate a*in1 + b*in2 + c = outfile"), ++ 0, /* Flags */ ++ gadd_vec, /* Dispatch function */ ++ IM_NUMBER(gadd_args), /* Size of arg list */ ++ gadd_args /* Arg list */ + }; + + /* Args for im_litecor(). + */ + static im_arg_desc litecor_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_INPUT_IMAGE( "white" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "clip" ), +- IM_INPUT_DOUBLE( "factor" ) ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_IMAGE("white"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("clip"), ++ IM_INPUT_DOUBLE("factor") + }; + + /* Call im_litecor() via arg vector. + */ + static int +-litecor_vec( im_object *argv ) ++litecor_vec(im_object *argv) + { + int clip = *((int *) argv[3]); + double factor = *((double *) argv[4]); + +- return( im_litecor( argv[0], argv[1], argv[2], clip, factor ) ); ++ return (im_litecor(argv[0], argv[1], argv[2], clip, factor)); + } + + /* Description of im_litecor(). +- */ ++ */ + static im_function litecor_desc = { +- "im_litecor", /* Name */ +- N_( "calculate max(white)*factor*(in/white), if clip == 1" ), +- 0, /* Flags */ +- litecor_vec, /* Dispatch function */ +- IM_NUMBER( litecor_args ), /* Size of arg list */ +- litecor_args /* Arg list */ ++ "im_litecor", /* Name */ ++ N_("calculate max(white)*factor*(in/white), if clip == 1"), ++ 0, /* Flags */ ++ litecor_vec, /* Dispatch function */ ++ IM_NUMBER(litecor_args), /* Size of arg list */ ++ litecor_args /* Arg list */ + }; + + /* affine args + */ + static im_arg_desc affine_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLE( "a" ), +- IM_INPUT_DOUBLE( "b" ), +- IM_INPUT_DOUBLE( "c" ), +- IM_INPUT_DOUBLE( "d" ), +- IM_INPUT_DOUBLE( "dx" ), +- IM_INPUT_DOUBLE( "dy" ), +- IM_INPUT_INT( "x" ), +- IM_INPUT_INT( "y" ), +- IM_INPUT_INT( "w" ), +- IM_INPUT_INT( "h" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLE("a"), ++ IM_INPUT_DOUBLE("b"), ++ IM_INPUT_DOUBLE("c"), ++ IM_INPUT_DOUBLE("d"), ++ IM_INPUT_DOUBLE("dx"), ++ IM_INPUT_DOUBLE("dy"), ++ IM_INPUT_INT("x"), ++ IM_INPUT_INT("y"), ++ IM_INPUT_INT("w"), ++ IM_INPUT_INT("h") + }; + + /* Call im_affine via arg vector. + */ + static int +-affine_vec( im_object *argv ) ++affine_vec(im_object *argv) + { + double a = *((double *) argv[2]); + double b = *((double *) argv[3]); +@@ -323,74 +323,74 @@ affine_vec( im_object *argv ) + int w = *((int *) argv[10]); + int h = *((int *) argv[11]); + +- return( im_affine( argv[0], argv[1], a, b, c, d, dx, dy, x, y, w, h ) ); ++ return (im_affine(argv[0], argv[1], a, b, c, d, dx, dy, x, y, w, h)); + } + + /* Description of im_affine. +- */ ++ */ + static im_function affine_desc = { +- "im_affine", /* Name */ ++ "im_affine", /* Name */ + "affine transform", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- affine_vec, /* Dispatch function */ +- IM_NUMBER( affine_args ), /* Size of arg list */ +- affine_args /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ affine_vec, /* Dispatch function */ ++ IM_NUMBER(affine_args), /* Size of arg list */ ++ affine_args /* Arg list */ + }; + + /* similarity args + */ + static im_arg_desc similarity_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLE( "a" ), +- IM_INPUT_DOUBLE( "b" ), +- IM_INPUT_DOUBLE( "dx" ), +- IM_INPUT_DOUBLE( "dy" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLE("a"), ++ IM_INPUT_DOUBLE("b"), ++ IM_INPUT_DOUBLE("dx"), ++ IM_INPUT_DOUBLE("dy") + }; + + /* Call im_similarity via arg vector. + */ + static int +-similarity_vec( im_object *argv ) ++similarity_vec(im_object *argv) + { + double a = *((double *) argv[2]); + double b = *((double *) argv[3]); + double dx = *((double *) argv[4]); + double dy = *((double *) argv[5]); + +- return( im_similarity( argv[0], argv[1], a, b, dx, dy ) ); ++ return (im_similarity(argv[0], argv[1], a, b, dx, dy)); + } + + /* Description of im_similarity. +- */ ++ */ + static im_function similarity_desc = { +- "im_similarity", /* Name */ ++ "im_similarity", /* Name */ + "similarity transformation", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- similarity_vec, /* Dispatch function */ +- IM_NUMBER( similarity_args ), /* Size of arg list */ +- similarity_args /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ similarity_vec, /* Dispatch function */ ++ IM_NUMBER(similarity_args), /* Size of arg list */ ++ similarity_args /* Arg list */ + }; + + /* similarity_area args + */ + static im_arg_desc similarity_area_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLE( "a" ), +- IM_INPUT_DOUBLE( "b" ), +- IM_INPUT_DOUBLE( "dx" ), +- IM_INPUT_DOUBLE( "dy" ), +- IM_INPUT_INT( "x" ), +- IM_INPUT_INT( "y" ), +- IM_INPUT_INT( "w" ), +- IM_INPUT_INT( "h" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLE("a"), ++ IM_INPUT_DOUBLE("b"), ++ IM_INPUT_DOUBLE("dx"), ++ IM_INPUT_DOUBLE("dy"), ++ IM_INPUT_INT("x"), ++ IM_INPUT_INT("y"), ++ IM_INPUT_INT("w"), ++ IM_INPUT_INT("h") + }; + + /* Call im_similarity_area via arg vector. + */ + static int +-similarity_area_vec( im_object *argv ) ++similarity_area_vec(im_object *argv) + { + double a = *((double *) argv[2]); + double b = *((double *) argv[3]); +@@ -401,385 +401,385 @@ similarity_area_vec( im_object *argv ) + int w = *((int *) argv[8]); + int h = *((int *) argv[9]); + +- return( im_similarity_area( argv[0], argv[1], a, b, dx, dy, +- x, y, w, h ) ); ++ return (im_similarity_area(argv[0], argv[1], a, b, dx, dy, ++ x, y, w, h)); + } + + /* Description of im_similarity_area. +- */ ++ */ + static im_function similarity_area_desc = { +- "im_similarity_area", /* Name */ ++ "im_similarity_area", /* Name */ + "output area xywh of similarity transformation", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- similarity_area_vec, /* Dispatch function */ +- IM_NUMBER( similarity_area_args ), /* Size of arg list */ +- similarity_area_args /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ similarity_area_vec, /* Dispatch function */ ++ IM_NUMBER(similarity_area_args), /* Size of arg list */ ++ similarity_area_args /* Arg list */ + }; + + static int +-icc_export_vec( im_object *argv ) ++icc_export_vec(im_object *argv) + { + int intent = *((int *) argv[3]); + +- return( im_icc_export( argv[0], argv[1], +- argv[2], intent ) ); ++ return (im_icc_export(argv[0], argv[1], ++ argv[2], intent)); + } + + static im_arg_desc icc_export_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_STRING( "output_profile" ), +- IM_INPUT_INT( "intent" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_STRING("output_profile"), ++ IM_INPUT_INT("intent") + }; + + /* Description of im_icc_export. +- */ ++ */ + static im_function icc_export_desc = { +- "im_icc_export", /* Name */ +- "convert a float LAB to an 8-bit device image with an ICC profile", +- /* Description */ +- IM_FN_PIO, /* Flags */ +- icc_export_vec, /* Dispatch function */ +- IM_NUMBER( icc_export_args ), /* Size of arg list */ +- icc_export_args /* Arg list */ ++ "im_icc_export", /* Name */ ++ "convert a float LAB to an 8-bit device image with an ICC profile", ++ /* Description */ ++ IM_FN_PIO, /* Flags */ ++ icc_export_vec, /* Dispatch function */ ++ IM_NUMBER(icc_export_args), /* Size of arg list */ ++ icc_export_args /* Arg list */ + }; + + /* Args for im_segment(). + */ + static im_arg_desc segment_args[] = { +- IM_INPUT_IMAGE( "test" ), +- IM_OUTPUT_IMAGE( "mask" ), +- IM_OUTPUT_INT( "segments" ) ++ IM_INPUT_IMAGE("test"), ++ IM_OUTPUT_IMAGE("mask"), ++ IM_OUTPUT_INT("segments") + }; + + /* Call im_segment() via arg vector. + */ + static int +-segment_vec( im_object *argv ) ++segment_vec(im_object *argv) + { + IMAGE *test = argv[0]; + IMAGE *mask = argv[1]; + int *serial = (int *) argv[2]; + +- return( im_segment( test, mask, serial ) ); ++ return (im_segment(test, mask, serial)); + } + + /* Description of im_segment(). +- */ ++ */ + static im_function segment_desc = { +- "im_segment", /* Name */ ++ "im_segment", /* Name */ + "number continuous regions in an image", +- 0, /* Flags */ +- segment_vec, /* Dispatch function */ +- IM_NUMBER( segment_args ),/* Size of arg list */ +- segment_args /* Arg list */ ++ 0, /* Flags */ ++ segment_vec, /* Dispatch function */ ++ IM_NUMBER(segment_args), /* Size of arg list */ ++ segment_args /* Arg list */ + }; + + static int +-print_vec( im_object *argv ) ++print_vec(im_object *argv) + { + const char *message = argv[0]; + char **out = (char **) &argv[1]; + +- if( im_print( message ) ) +- return( -1 ); +- *out = im_strdup( NULL, "printed" ); ++ if (im_print(message)) ++ return (-1); ++ *out = im_strdup(NULL, "printed"); + +- return( 0 ); ++ return (0); + } + + static im_arg_desc print_arg_types[] = { +- IM_INPUT_STRING( "message" ), +- IM_OUTPUT_STRING( "result" ) ++ IM_INPUT_STRING("message"), ++ IM_OUTPUT_STRING("result") + }; + + static im_function print_desc = { +- "im_print", /* Name */ ++ "im_print", /* Name */ + "print string to stdout", /* Description */ +- 0, /* Flags */ +- print_vec, /* Dispatch function */ +- IM_NUMBER( print_arg_types ), /* Size of arg list */ +- print_arg_types /* Arg list */ ++ 0, /* Flags */ ++ print_vec, /* Dispatch function */ ++ IM_NUMBER(print_arg_types), /* Size of arg list */ ++ print_arg_types /* Arg list */ + }; + + /* Call im_clip2dcm via arg vector. + */ + static int +-clip2dcm_vec( im_object *argv ) ++clip2dcm_vec(im_object *argv) + { +- return( im_clip2dcm( argv[0], argv[1] ) ); ++ return (im_clip2dcm(argv[0], argv[1])); + } + + /* Description of im_clip2dcm. + */ + static im_function clip2dcm_desc = { +- "im_clip2dcm", /* Name */ ++ "im_clip2dcm", /* Name */ + "convert to double complex", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- clip2dcm_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ clip2dcm_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_clip2cm via arg vector. + */ + static int +-clip2cm_vec( im_object *argv ) ++clip2cm_vec(im_object *argv) + { +- return( im_clip2cm( argv[0], argv[1] ) ); ++ return (im_clip2cm(argv[0], argv[1])); + } + + /* Description of im_clip2cm. + */ + static im_function clip2cm_desc = { +- "im_clip2cm", /* Name */ ++ "im_clip2cm", /* Name */ + "convert to complex", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- clip2cm_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ clip2cm_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_clip2us via arg vector. + */ + static int +-clip2us_vec( im_object *argv ) ++clip2us_vec(im_object *argv) + { +- return( im_clip2us( argv[0], argv[1] ) ); ++ return (im_clip2us(argv[0], argv[1])); + } + + /* Description of im_clip2us. + */ + static im_function clip2us_desc = { +- "im_clip2us", /* Name */ ++ "im_clip2us", /* Name */ + "convert to unsigned 16-bit integer", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- clip2us_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ clip2us_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_clip2ui via arg vector. + */ + static int +-clip2ui_vec( im_object *argv ) ++clip2ui_vec(im_object *argv) + { +- return( im_clip2ui( argv[0], argv[1] ) ); ++ return (im_clip2ui(argv[0], argv[1])); + } + + /* Description of im_clip2ui. + */ + static im_function clip2ui_desc = { +- "im_clip2ui", /* Name */ ++ "im_clip2ui", /* Name */ + "convert to unsigned 32-bit integer", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- clip2ui_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ clip2ui_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_clip2s via arg vector. + */ + static int +-clip2s_vec( im_object *argv ) ++clip2s_vec(im_object *argv) + { +- return( im_clip2s( argv[0], argv[1] ) ); ++ return (im_clip2s(argv[0], argv[1])); + } + + /* Description of im_clip2s. + */ + static im_function clip2s_desc = { +- "im_clip2s", /* Name */ ++ "im_clip2s", /* Name */ + "convert to signed 16-bit integer", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- clip2s_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ clip2s_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_clip2i via arg vector. + */ + static int +-clip2i_vec( im_object *argv ) ++clip2i_vec(im_object *argv) + { +- return( im_clip2i( argv[0], argv[1] ) ); ++ return (im_clip2i(argv[0], argv[1])); + } + + /* Description of im_clip2i. + */ + static im_function clip2i_desc = { +- "im_clip2i", /* Name */ ++ "im_clip2i", /* Name */ + "convert to signed 32-bit integer", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- clip2i_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ clip2i_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_clip2d via arg vector. + */ + static int +-clip2d_vec( im_object *argv ) ++clip2d_vec(im_object *argv) + { +- return( im_clip2d( argv[0], argv[1] ) ); ++ return (im_clip2d(argv[0], argv[1])); + } + + /* Description of im_clip2d. + */ + static im_function clip2d_desc = { +- "im_clip2d", /* Name */ ++ "im_clip2d", /* Name */ + "convert to double-precision float", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- clip2d_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ clip2d_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_clip2f via arg vector. + */ + static int +-clip2f_vec( im_object *argv ) ++clip2f_vec(im_object *argv) + { +- return( im_clip2f( argv[0], argv[1] ) ); ++ return (im_clip2f(argv[0], argv[1])); + } + + /* Description of im_clip2f. + */ + static im_function clip2f_desc = { +- "im_clip2f", /* Name */ ++ "im_clip2f", /* Name */ + "convert to single-precision float", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- clip2f_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ clip2f_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_clip2c via arg vector. + */ + static int +-clip2c_vec( im_object *argv ) ++clip2c_vec(im_object *argv) + { +- return( im_clip2c( argv[0], argv[1] ) ); ++ return (im_clip2c(argv[0], argv[1])); + } + + /* Description of im_clip2c. + */ + static im_function clip2c_desc = { +- "im_clip2c", /* Name */ ++ "im_clip2c", /* Name */ + "convert to signed 8-bit integer", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- clip2c_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ clip2c_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Args to im_thresh. + */ + static im_arg_desc thresh_args[] = { +- IM_INPUT_IMAGE( "input" ), +- IM_OUTPUT_IMAGE( "output" ), +- IM_INPUT_DOUBLE( "threshold" ) ++ IM_INPUT_IMAGE("input"), ++ IM_OUTPUT_IMAGE("output"), ++ IM_INPUT_DOUBLE("threshold") + }; + + /* Call im_thresh via arg vector. + */ + static int +-thresh_vec( im_object *argv ) ++thresh_vec(im_object *argv) + { + double t1 = *((double *) argv[2]); + +- return( im_thresh( argv[0], argv[1], t1 ) ); ++ return (im_thresh(argv[0], argv[1], t1)); + } + + /* Description of im_thresh. + */ + static im_function thresh_desc = { +- "im_thresh", /* Name */ ++ "im_thresh", /* Name */ + "slice an image at a threshold", +- 0, /* Flags */ +- thresh_vec, /* Dispatch function */ +- IM_NUMBER( thresh_args ), /* Size of arg list */ +- thresh_args /* Arg list */ ++ 0, /* Flags */ ++ thresh_vec, /* Dispatch function */ ++ IM_NUMBER(thresh_args), /* Size of arg list */ ++ thresh_args /* Arg list */ + }; + + /* Args to im_slice. + */ + static im_arg_desc slice_args[] = { +- IM_INPUT_IMAGE( "input" ), +- IM_OUTPUT_IMAGE( "output" ), +- IM_INPUT_DOUBLE( "thresh1" ), +- IM_INPUT_DOUBLE( "thresh2" ) ++ IM_INPUT_IMAGE("input"), ++ IM_OUTPUT_IMAGE("output"), ++ IM_INPUT_DOUBLE("thresh1"), ++ IM_INPUT_DOUBLE("thresh2") + }; + + /* Call im_slice via arg vector. + */ + static int +-slice_vec( im_object *argv ) ++slice_vec(im_object *argv) + { + double t1 = *((double *) argv[2]); + double t2 = *((double *) argv[3]); + +- return( im_slice( argv[0], argv[1], t1, t2 ) ); ++ return (im_slice(argv[0], argv[1], t1, t2)); + } + + /* Description of im_slice. + */ + static im_function slice_desc = { +- "im_slice", /* Name */ ++ "im_slice", /* Name */ + "slice an image using two thresholds", +- 0, /* Flags */ +- slice_vec, /* Dispatch function */ +- IM_NUMBER( slice_args ), /* Size of arg list */ +- slice_args /* Arg list */ ++ 0, /* Flags */ ++ slice_vec, /* Dispatch function */ ++ IM_NUMBER(slice_args), /* Size of arg list */ ++ slice_args /* Arg list */ + }; + + /* Args for im_convsub. + */ + static im_arg_desc convsub_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_IMASK( "matrix" ), +- IM_INPUT_INT( "xskip" ), +- IM_INPUT_INT( "yskip" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_IMASK("matrix"), ++ IM_INPUT_INT("xskip"), ++ IM_INPUT_INT("yskip") + }; + + /* Call im_convsub via arg vector. + */ + static int +-convsub_vec( im_object *argv ) ++convsub_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + int xskip = *((int *) argv[3]); + int yskip = *((int *) argv[4]); + +- return( im_convsub( argv[0], argv[1], mo->mask, xskip, yskip ) ); ++ return (im_convsub(argv[0], argv[1], mo->mask, xskip, yskip)); + } + + /* Description of im_convsub. +- */ ++ */ + static im_function convsub_desc = { +- "im_convsub", /* Name */ ++ "im_convsub", /* Name */ + "convolve uchar to uchar, sub-sampling by xskip, yskip", +- IM_FN_TRANSFORM, /* Flags */ +- convsub_vec, /* Dispatch function */ +- IM_NUMBER( convsub_args ), /* Size of arg list */ +- convsub_args /* Arg list */ ++ IM_FN_TRANSFORM, /* Flags */ ++ convsub_vec, /* Dispatch function */ ++ IM_NUMBER(convsub_args), /* Size of arg list */ ++ convsub_args /* Arg list */ + }; + + /* Args to im_bernd. + */ + static im_arg_desc bernd_args[] = { +- IM_INPUT_STRING( "tiffname" ), +- IM_INPUT_INT( "left" ), +- IM_INPUT_INT( "top" ), +- IM_INPUT_INT( "width" ), +- IM_INPUT_INT( "height" ) ++ IM_INPUT_STRING("tiffname"), ++ IM_INPUT_INT("left"), ++ IM_INPUT_INT("top"), ++ IM_INPUT_INT("width"), ++ IM_INPUT_INT("height") + }; + + /* Call im_bernd via arg vector. + */ + static int +-bernd_vec( im_object *argv ) ++bernd_vec(im_object *argv) + { + char *name = argv[0]; + int left = *((int *) argv[1]); +@@ -787,35 +787,35 @@ bernd_vec( im_object *argv ) + int width = *((int *) argv[3]); + int height = *((int *) argv[4]); + +- return( im_bernd( name, left, top, width, height ) ); ++ return (im_bernd(name, left, top, width, height)); + } + + /* Description of im_bernd. + */ + static im_function bernd_desc = { +- "im_bernd", /* Name */ +- "extract from pyramid as jpeg", /* Description */ +- 0, /* Flags */ +- bernd_vec, /* Dispatch function */ +- IM_NUMBER( bernd_args ), /* Size of arg list */ +- bernd_args /* Arg list */ ++ "im_bernd", /* Name */ ++ "extract from pyramid as jpeg", /* Description */ ++ 0, /* Flags */ ++ bernd_vec, /* Dispatch function */ ++ IM_NUMBER(bernd_args), /* Size of arg list */ ++ bernd_args /* Arg list */ + }; + + /* Args for im_line. + */ + static im_arg_desc line_args[] = { +- IM_RW_IMAGE( "im" ), +- IM_INPUT_INT( "x1" ), +- IM_INPUT_INT( "y1" ), +- IM_INPUT_INT( "x2" ), +- IM_INPUT_INT( "y2" ), +- IM_INPUT_INT( "pelval" ) ++ IM_RW_IMAGE("im"), ++ IM_INPUT_INT("x1"), ++ IM_INPUT_INT("y1"), ++ IM_INPUT_INT("x2"), ++ IM_INPUT_INT("y2"), ++ IM_INPUT_INT("pelval") + }; + + /* Call im_line via arg vector. + */ + static int +-line_vec( im_object *argv ) ++line_vec(im_object *argv) + { + int x1 = *((int *) argv[1]); + int y1 = *((int *) argv[2]); +@@ -823,269 +823,269 @@ line_vec( im_object *argv ) + int y2 = *((int *) argv[4]); + int pel = *((int *) argv[5]); + +- return( im_line( argv[0], x1, y1, x2, y2, pel ) ); ++ return (im_line(argv[0], x1, y1, x2, y2, pel)); + } + + /* Description of im_line. +- */ ++ */ + static im_function line_desc = { +- "im_line", /* Name */ ++ "im_line", /* Name */ + "draw line between points (x1,y1) and (x2,y2)", +- 0, /* Flags */ +- line_vec, /* Dispatch function */ +- IM_NUMBER( line_args ), /* Size of arg list */ +- line_args /* Arg list */ ++ 0, /* Flags */ ++ line_vec, /* Dispatch function */ ++ IM_NUMBER(line_args), /* Size of arg list */ ++ line_args /* Arg list */ + }; + + /* Args for im_resize_linear. + */ + static im_arg_desc resize_linear_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "X" ), +- IM_INPUT_INT( "Y" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("X"), ++ IM_INPUT_INT("Y") + }; + + /* Call im_resize_linear via arg vector. + */ + static int +-resize_linear_vec( im_object *argv ) ++resize_linear_vec(im_object *argv) + { + int X = *((int *) argv[2]); + int Y = *((int *) argv[3]); + +- return( im_resize_linear( argv[0], argv[1], X, Y ) ); ++ return (im_resize_linear(argv[0], argv[1], X, Y)); + } + + /* Description of im_resize_linear. +- */ ++ */ + static im_function resize_linear_desc = { +- "im_resize_linear", /* Name */ ++ "im_resize_linear", /* Name */ + "resize to X by Y pixels with linear interpolation", +- 0, /* Flags */ +- resize_linear_vec, /* Dispatch function */ +- IM_NUMBER( resize_linear_args ), /* Size of arg list */ +- resize_linear_args /* Arg list */ ++ 0, /* Flags */ ++ resize_linear_vec, /* Dispatch function */ ++ IM_NUMBER(resize_linear_args), /* Size of arg list */ ++ resize_linear_args /* Arg list */ + }; + + /* Args for im_insertplaceset. + */ + static im_arg_desc insertplaceset_args[] = { +- IM_INPUT_IMAGE( "main" ), +- IM_INPUT_IMAGE( "sub" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INTVEC( "x" ), +- IM_INPUT_INTVEC( "y" ) ++ IM_INPUT_IMAGE("main"), ++ IM_INPUT_IMAGE("sub"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INTVEC("x"), ++ IM_INPUT_INTVEC("y") + }; + + /* Call im_insertplaceplaceset via arg vector. + */ + static int +-insertplaceset_vec( im_object *argv ) ++insertplaceset_vec(im_object *argv) + { + im_intvec_object *xv = (im_intvec_object *) argv[3]; + im_intvec_object *yv = (im_intvec_object *) argv[4]; + +- if( xv->n != yv->n ) { +- im_error( "im_insertplaceset", "%s", +- _( "vectors not same length" ) ); +- return( -1 ); ++ if (xv->n != yv->n) { ++ im_error("im_insertplaceset", "%s", ++ _("vectors not same length")); ++ return (-1); + } + +- if( im_insertset( argv[0], argv[1], argv[2], xv->n, xv->vec, yv->vec ) ) +- return( -1 ); ++ if (im_insertset(argv[0], argv[1], argv[2], xv->n, xv->vec, yv->vec)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_insertplaceset. +- */ ++ */ + static im_function insertplaceset_desc = { +- "im_insertplaceset", /* Name */ ++ "im_insertplaceset", /* Name */ + "insert sub into main at every position in x, y", +- 0, /* Flags */ +- insertplaceset_vec, /* Dispatch function */ +- IM_NUMBER( insertplaceset_args ), /* Size of arg list */ +- insertplaceset_args /* Arg list */ ++ 0, /* Flags */ ++ insertplaceset_vec, /* Dispatch function */ ++ IM_NUMBER(insertplaceset_args), /* Size of arg list */ ++ insertplaceset_args /* Arg list */ + }; + + /* Call im_spcor_raw via arg vector. + */ + static int +-spcor_raw_vec( im_object *argv ) ++spcor_raw_vec(im_object *argv) + { +- return( im_spcor_raw( argv[0], argv[1], argv[2] ) ); ++ return (im_spcor_raw(argv[0], argv[1], argv[2])); + } + + /* Description of im_spcor_raw. +- */ ++ */ + static im_function spcor_raw_desc = { +- "im_spcor_raw", /* Name */ ++ "im_spcor_raw", /* Name */ + "normalised correlation of in2 within in1, no black padding", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- spcor_raw_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ spcor_raw_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_gradcor_raw via arg vector. + */ + static int +-gradcor_raw_vec( im_object *argv ) ++gradcor_raw_vec(im_object *argv) + { +- return( im_gradcor_raw( argv[0], argv[1], argv[2] ) ); ++ return (im_gradcor_raw(argv[0], argv[1], argv[2])); + } + + /* Description of im_gradcor_raw. +- */ ++ */ + static im_function gradcor_raw_desc = { +- "im_gradcor_raw", /* Name */ ++ "im_gradcor_raw", /* Name */ + "non-normalised correlation of gradient of in2 within in1, no padding", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- gradcor_raw_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ gradcor_raw_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_fastcor_raw via arg vector. + */ + static int +-fastcor_raw_vec( im_object *argv ) ++fastcor_raw_vec(im_object *argv) + { +- return( im_fastcor_raw( argv[0], argv[1], argv[2] ) ); ++ return (im_fastcor_raw(argv[0], argv[1], argv[2])); + } + + /* Description of im_fastcor_raw. +- */ ++ */ + static im_function fastcor_raw_desc = { +- "im_fastcor_raw", /* Name */ ++ "im_fastcor_raw", /* Name */ + "fast correlate in2 within in1, no border", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- fastcor_raw_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ fastcor_raw_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_convsepf_raw via arg vector. + */ + static int +-convsepf_raw_vec( im_object *argv ) ++convsepf_raw_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_convsepf_raw( argv[0], argv[1], mo->mask ) ); ++ return (im_convsepf_raw(argv[0], argv[1], mo->mask)); + } + + /* Description of im_convsepf_raw. +- */ ++ */ + static im_function convsepf_raw_desc = { +- "im_convsepf_raw", /* Name */ ++ "im_convsepf_raw", /* Name */ + "seperable convolution, with DOUBLEMASK, no border", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- convsepf_raw_vec, /* Dispatch function */ +- IM_NUMBER( conv_dmask ), /* Size of arg list */ +- conv_dmask /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ convsepf_raw_vec, /* Dispatch function */ ++ IM_NUMBER(conv_dmask), /* Size of arg list */ ++ conv_dmask /* Arg list */ + }; + + /* Call im_convsep_raw via arg vector. + */ + static int +-convsep_raw_vec( im_object *argv ) ++convsep_raw_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_convsep_raw( argv[0], argv[1], mo->mask ) ); ++ return (im_convsep_raw(argv[0], argv[1], mo->mask)); + } + + /* Description of im_convsep_raw. +- */ ++ */ + static im_function convsep_raw_desc = { +- "im_convsep_raw", /* Name */ ++ "im_convsep_raw", /* Name */ + "seperable convolution, no border", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- convsep_raw_vec, /* Dispatch function */ +- IM_NUMBER( conv_imask ), /* Size of arg list */ +- conv_imask /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ convsep_raw_vec, /* Dispatch function */ ++ IM_NUMBER(conv_imask), /* Size of arg list */ ++ conv_imask /* Arg list */ + }; + + /* Call im_convf_raw via arg vector. + */ + static int +-convf_raw_vec( im_object *argv ) ++convf_raw_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_convf_raw( argv[0], argv[1], mo->mask ) ); ++ return (im_convf_raw(argv[0], argv[1], mo->mask)); + } + + /* Description of im_convf_raw. +- */ ++ */ + static im_function convf_raw_desc = { +- "im_convf_raw", /* Name */ ++ "im_convf_raw", /* Name */ + "convolve, with DOUBLEMASK, no border", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- convf_raw_vec, /* Dispatch function */ +- IM_NUMBER( conv_dmask ), /* Size of arg list */ +- conv_dmask /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ convf_raw_vec, /* Dispatch function */ ++ IM_NUMBER(conv_dmask), /* Size of arg list */ ++ conv_dmask /* Arg list */ + }; + + /* Call im_conv_raw via arg vector. + */ + static int +-conv_raw_vec( im_object *argv ) ++conv_raw_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_conv_raw( argv[0], argv[1], mo->mask ) ); ++ return (im_conv_raw(argv[0], argv[1], mo->mask)); + } + + /* Description of im_conv_raw. +- */ ++ */ + static im_function conv_raw_desc = { +- "im_conv_raw", /* Name */ ++ "im_conv_raw", /* Name */ + "convolve, no border", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- conv_raw_vec, /* Dispatch function */ +- IM_NUMBER( conv_imask ), /* Size of arg list */ +- conv_imask /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ conv_raw_vec, /* Dispatch function */ ++ IM_NUMBER(conv_imask), /* Size of arg list */ ++ conv_imask /* Arg list */ + }; + + /* Args to im_contrast_surface_raw. + */ + static im_arg_desc contrast_surface_raw_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "half_win_size" ), +- IM_INPUT_INT( "spacing" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("half_win_size"), ++ IM_INPUT_INT("spacing") + }; + + /* Call im_contrast_surface_raw via arg vector. + */ + static int +-contrast_surface_raw_vec( im_object *argv ) ++contrast_surface_raw_vec(im_object *argv) + { + int half_win_size = *((int *) argv[2]); + int spacing = *((int *) argv[3]); + +- return( im_contrast_surface_raw( argv[0], argv[1], +- half_win_size, spacing ) ); ++ return (im_contrast_surface_raw(argv[0], argv[1], ++ half_win_size, spacing)); + } + + /* Description of im_contrast_surface_raw. +- */ ++ */ + static im_function contrast_surface_raw_desc = { +- "im_contrast_surface_raw", /* Name */ ++ "im_contrast_surface_raw", /* Name */ + "find high-contrast points in an image", +- IM_FN_PIO, /* Flags */ +- contrast_surface_raw_vec, /* Dispatch function */ +- IM_NUMBER( contrast_surface_raw_args ),/* Size of arg list */ +- contrast_surface_raw_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ contrast_surface_raw_vec, /* Dispatch function */ ++ IM_NUMBER(contrast_surface_raw_args), /* Size of arg list */ ++ contrast_surface_raw_args /* Arg list */ + }; + + /* Call im_stdif_raw via arg vector. + */ + static int +-stdif_raw_vec( im_object *argv ) ++stdif_raw_vec(im_object *argv) + { + double a = *((double *) argv[2]); + double m0 = *((double *) argv[3]); +@@ -1094,197 +1094,197 @@ stdif_raw_vec( im_object *argv ) + int xw = *((int *) argv[6]); + int yw = *((int *) argv[7]); + +- return( im_stdif_raw( argv[0], argv[1], a, m0, b, s0, xw, yw ) ); ++ return (im_stdif_raw(argv[0], argv[1], a, m0, b, s0, xw, yw)); + } + + /* Description of im_stdif. +- */ ++ */ + static im_function stdif_raw_desc = { +- "im_stdif_raw", /* Name */ ++ "im_stdif_raw", /* Name */ + "statistical differencing, no border", +- IM_FN_PIO, /* Flags */ +- stdif_raw_vec, /* Dispatch function */ +- IM_NUMBER( stdif_args ), /* Size of arg list */ +- stdif_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ stdif_raw_vec, /* Dispatch function */ ++ IM_NUMBER(stdif_args), /* Size of arg list */ ++ stdif_args /* Arg list */ + }; + + /* Call im_lhisteq_raw via arg vector. + */ + static int +-lhisteq_raw_vec( im_object *argv ) ++lhisteq_raw_vec(im_object *argv) + { + int xw = *((int *) argv[2]); + int yw = *((int *) argv[3]); + +- return( im_lhisteq_raw( argv[0], argv[1], xw, yw ) ); ++ return (im_lhisteq_raw(argv[0], argv[1], xw, yw)); + } + + /* Description of im_lhisteq_raw. +- */ ++ */ + static im_function lhisteq_raw_desc = { +- "im_lhisteq_raw", /* Name */ ++ "im_lhisteq_raw", /* Name */ + "local histogram equalisation, no border", +- IM_FN_PIO, /* Flags */ +- lhisteq_raw_vec, /* Dispatch function */ +- IM_NUMBER( lhisteq_args ), /* Size of arg list */ +- lhisteq_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ lhisteq_raw_vec, /* Dispatch function */ ++ IM_NUMBER(lhisteq_args), /* Size of arg list */ ++ lhisteq_args /* Arg list */ + }; + + /* Call im_rank_raw via arg vector. + */ + static int +-rank_raw_vec( im_object *argv ) ++rank_raw_vec(im_object *argv) + { + int xsize = *((int *) argv[2]); + int ysize = *((int *) argv[3]); + int n = *((int *) argv[4]); + +- return( im_rank_raw( argv[0], argv[1], xsize, ysize, n ) ); ++ return (im_rank_raw(argv[0], argv[1], xsize, ysize, n)); + } + + /* Description of im_rank_raw. +- */ ++ */ + static im_function rank_raw_desc = { +- "im_rank_raw", /* Name */ ++ "im_rank_raw", /* Name */ + "rank filter nth element of xsize/ysize window, no border", +- IM_FN_PIO, /* Flags */ +- rank_raw_vec, /* Dispatch function */ +- IM_NUMBER( rank_args ), /* Size of arg list */ +- rank_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ rank_raw_vec, /* Dispatch function */ ++ IM_NUMBER(rank_args), /* Size of arg list */ ++ rank_args /* Arg list */ + }; + + /* Call im_erode_raw via arg vector. + */ + static int +-erode_raw_vec( im_object *argv ) ++erode_raw_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_erode_raw( argv[0], argv[1], mo->mask ) ); ++ return (im_erode_raw(argv[0], argv[1], mo->mask)); + } + + /* Description of im_erode_raw. +- */ ++ */ + static im_function erode_raw_desc = { +- "im_erode_raw", /* Name */ ++ "im_erode_raw", /* Name */ + "erode image with mask", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- erode_raw_vec, /* Dispatch function */ +- IM_NUMBER( erode_args ), /* Size of arg list */ +- erode_args /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ erode_raw_vec, /* Dispatch function */ ++ IM_NUMBER(erode_args), /* Size of arg list */ ++ erode_args /* Arg list */ + }; + + /* Call im_dilate_raw via arg vector. + */ + static int +-dilate_raw_vec( im_object *argv ) ++dilate_raw_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_dilate_raw( argv[0], argv[1], mo->mask ) ); ++ return (im_dilate_raw(argv[0], argv[1], mo->mask)); + } + + /* Description of im_dilate_raw. +- */ ++ */ + static im_function dilate_raw_desc = { +- "im_dilate_raw", /* Name */ ++ "im_dilate_raw", /* Name */ + "dilate image with mask", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- dilate_raw_vec, /* Dispatch function */ +- IM_NUMBER( erode_args ), /* Size of arg list */ +- erode_args /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ dilate_raw_vec, /* Dispatch function */ ++ IM_NUMBER(erode_args), /* Size of arg list */ ++ erode_args /* Arg list */ + }; + + /* Call im_convsepf via arg vector. + */ + static int +-convsepf_vec( im_object *argv ) ++convsepf_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_convsepf( argv[0], argv[1], mo->mask ) ); ++ return (im_convsepf(argv[0], argv[1], mo->mask)); + } + + /* Description of im_convsepf. +- */ ++ */ + static im_function convsepf_desc = { +- "im_convsepf", /* Name */ ++ "im_convsepf", /* Name */ + "seperable convolution, with DOUBLEMASK", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- convsepf_vec, /* Dispatch function */ +- IM_NUMBER( conv_dmask ), /* Size of arg list */ +- conv_dmask /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ convsepf_vec, /* Dispatch function */ ++ IM_NUMBER(conv_dmask), /* Size of arg list */ ++ conv_dmask /* Arg list */ + }; + + /* Call im_convf via arg vector. + */ + static int +-convf_vec( im_object *argv ) ++convf_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_convf( argv[0], argv[1], mo->mask ) ); ++ return (im_convf(argv[0], argv[1], mo->mask)); + } + + /* Description of im_convf. +- */ ++ */ + static im_function convf_desc = { +- "im_convf", /* Name */ ++ "im_convf", /* Name */ + "convolve, with DOUBLEMASK", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- convf_vec, /* Dispatch function */ +- IM_NUMBER( conv_dmask ), /* Size of arg list */ +- conv_dmask /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ convf_vec, /* Dispatch function */ ++ IM_NUMBER(conv_dmask), /* Size of arg list */ ++ conv_dmask /* Arg list */ + }; + + /* Args for im_circle. + */ + static im_arg_desc circle_args[] = { +- IM_RW_IMAGE( "image" ), +- IM_INPUT_INT( "cx" ), +- IM_INPUT_INT( "cy" ), +- IM_INPUT_INT( "radius" ), +- IM_INPUT_INT( "intensity" ) ++ IM_RW_IMAGE("image"), ++ IM_INPUT_INT("cx"), ++ IM_INPUT_INT("cy"), ++ IM_INPUT_INT("radius"), ++ IM_INPUT_INT("intensity") + }; + + /* Call im_circle via arg vector. + */ + static int +-circle_vec( im_object *argv ) ++circle_vec(im_object *argv) + { + int cx = *((int *) argv[1]); + int cy = *((int *) argv[2]); + int radius = *((int *) argv[3]); + int intensity = *((int *) argv[4]); + +- return( im_circle( argv[0], cx, cy, radius, intensity ) ); ++ return (im_circle(argv[0], cx, cy, radius, intensity)); + } + + /* Description of im_circle. +- */ ++ */ + static im_function circle_desc = { +- "im_circle", /* Name */ ++ "im_circle", /* Name */ + "plot circle on image", +- 0, /* Flags */ +- circle_vec, /* Dispatch function */ +- IM_NUMBER( circle_args ), /* Size of arg list */ +- circle_args /* Arg list */ ++ 0, /* Flags */ ++ circle_vec, /* Dispatch function */ ++ IM_NUMBER(circle_args), /* Size of arg list */ ++ circle_args /* Arg list */ + }; + + /* Args for im_flood_blob_copy(). + */ + static im_arg_desc flood_blob_copy_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "start_x" ), +- IM_INPUT_INT( "start_y" ), +- IM_INPUT_DOUBLEVEC( "ink" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("start_x"), ++ IM_INPUT_INT("start_y"), ++ IM_INPUT_DOUBLEVEC("ink") + }; + + /* Call im_flood_blob_copy() via arg vector. + */ + static int +-flood_blob_copy_vec( im_object *argv ) ++flood_blob_copy_vec(im_object *argv) + { + IMAGE *in = argv[0]; + IMAGE *out = argv[1]; +@@ -1294,38 +1294,38 @@ flood_blob_copy_vec( im_object *argv ) + + PEL *ink; + +- if( !(ink = im__vector_to_ink( "im_flood_blob_copy", +- in, dv->n, dv->vec )) ) +- return( -1 ); ++ if (!(ink = im__vector_to_ink("im_flood_blob_copy", ++ in, dv->n, dv->vec))) ++ return (-1); + +- return( im_flood_blob_copy( in, out, start_x, start_y, ink ) ); ++ return (im_flood_blob_copy(in, out, start_x, start_y, ink)); + } + + /* Description of im_flood_blob_copy(). +- */ ++ */ + static im_function flood_blob_copy_desc = { +- "im_flood_blob_copy", /* Name */ ++ "im_flood_blob_copy", /* Name */ + "flood with ink from start_x, start_y while pixel == start pixel", +- 0, /* Flags */ +- flood_blob_copy_vec, /* Dispatch function */ +- IM_NUMBER( flood_blob_copy_args ),/* Size of arg list */ +- flood_blob_copy_args /* Arg list */ ++ 0, /* Flags */ ++ flood_blob_copy_vec, /* Dispatch function */ ++ IM_NUMBER(flood_blob_copy_args), /* Size of arg list */ ++ flood_blob_copy_args /* Arg list */ + }; + + /* Args for im_flood_copy(). + */ + static im_arg_desc flood_copy_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "start_x" ), +- IM_INPUT_INT( "start_y" ), +- IM_INPUT_DOUBLEVEC( "ink" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("start_x"), ++ IM_INPUT_INT("start_y"), ++ IM_INPUT_DOUBLEVEC("ink") + }; + + /* Call im_flood_copy() via arg vector. + */ + static int +-flood_copy_vec( im_object *argv ) ++flood_copy_vec(im_object *argv) + { + IMAGE *in = argv[0]; + IMAGE *out = argv[1]; +@@ -1335,39 +1335,39 @@ flood_copy_vec( im_object *argv ) + + PEL *ink; + +- if( !(ink = im__vector_to_ink( "im_flood_copy", +- in, dv->n, dv->vec )) ) +- return( -1 ); ++ if (!(ink = im__vector_to_ink("im_flood_copy", ++ in, dv->n, dv->vec))) ++ return (-1); + +- return( im_flood_copy( in, out, start_x, start_y, ink ) ); ++ return (im_flood_copy(in, out, start_x, start_y, ink)); + } + + /* Description of im_flood_copy(). +- */ ++ */ + static im_function flood_copy_desc = { +- "im_flood_copy", /* Name */ ++ "im_flood_copy", /* Name */ + "flood with ink from start_x, start_y while pixel == start pixel", +- 0, /* Flags */ +- flood_copy_vec, /* Dispatch function */ +- IM_NUMBER( flood_copy_args ),/* Size of arg list */ +- flood_copy_args /* Arg list */ ++ 0, /* Flags */ ++ flood_copy_vec, /* Dispatch function */ ++ IM_NUMBER(flood_copy_args), /* Size of arg list */ ++ flood_copy_args /* Arg list */ + }; + + /* Args for im_flood_other_copy(). + */ + static im_arg_desc flood_other_copy_args[] = { +- IM_INPUT_IMAGE( "test" ), +- IM_INPUT_IMAGE( "mark" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "start_x" ), +- IM_INPUT_INT( "start_y" ), +- IM_INPUT_INT( "serial" ) ++ IM_INPUT_IMAGE("test"), ++ IM_INPUT_IMAGE("mark"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("start_x"), ++ IM_INPUT_INT("start_y"), ++ IM_INPUT_INT("serial") + }; + + /* Call im_flood_other_copy() via arg vector. + */ + static int +-flood_other_copy_vec( im_object *argv ) ++flood_other_copy_vec(im_object *argv) + { + IMAGE *test = argv[0]; + IMAGE *mark = argv[1]; +@@ -1376,861 +1376,860 @@ flood_other_copy_vec( im_object *argv ) + int start_y = *((int *) argv[4]); + int serial = *((int *) argv[5]); + +- return( im_flood_other_copy( test, mark, out, +- start_x, start_y, serial ) ); ++ return (im_flood_other_copy(test, mark, out, ++ start_x, start_y, serial)); + } + + /* Description of im_flood_other_copy(). +- */ ++ */ + static im_function flood_other_copy_desc = { +- "im_flood_other_copy", /* Name */ ++ "im_flood_other_copy", /* Name */ + "flood mark with serial from start_x, start_y while pixel == start pixel", +- 0, /* Flags */ +- flood_other_copy_vec, /* Dispatch function */ +- IM_NUMBER( flood_other_copy_args ),/* Size of arg list */ +- flood_other_copy_args /* Arg list */ ++ 0, /* Flags */ ++ flood_other_copy_vec, /* Dispatch function */ ++ IM_NUMBER(flood_other_copy_args), /* Size of arg list */ ++ flood_other_copy_args /* Arg list */ + }; + + /* Args for im_insertplace. + */ + static im_arg_desc insertplace_args[] = { +- IM_RW_IMAGE( "main" ), +- IM_INPUT_IMAGE( "sub" ), +- IM_INPUT_INT( "x" ), +- IM_INPUT_INT( "y" ) ++ IM_RW_IMAGE("main"), ++ IM_INPUT_IMAGE("sub"), ++ IM_INPUT_INT("x"), ++ IM_INPUT_INT("y") + }; + + /* Call im_insertplace via arg vector. + */ + static int +-insertplace_vec( im_object *argv ) ++insertplace_vec(im_object *argv) + { + int x = *((int *) argv[2]); + int y = *((int *) argv[3]); + +- return( im_insertplace( argv[0], argv[1], x, y ) ); ++ return (im_insertplace(argv[0], argv[1], x, y)); + } + + /* Description of im_insertplace. +- */ ++ */ + static im_function insertplace_desc = { +- "im_insertplace", /* Name */ ++ "im_insertplace", /* Name */ + "draw image sub inside image main at position (x,y)", +- 0, /* Flags */ +- insertplace_vec, /* Dispatch function */ +- IM_NUMBER( insertplace_args ), /* Size of arg list */ +- insertplace_args /* Arg list */ ++ 0, /* Flags */ ++ insertplace_vec, /* Dispatch function */ ++ IM_NUMBER(insertplace_args), /* Size of arg list */ ++ insertplace_args /* Arg list */ + }; + + /* Used to be called im_remainderconst_vec, stupidly. + */ + static int +-remainderconst_vec_vec( im_object *argv ) ++remainderconst_vec_vec(im_object *argv) + { + im_doublevec_object *dv = (im_doublevec_object *) argv[2]; + +- return( im_remainder_vec( argv[0], argv[1], dv->n, dv->vec ) ); ++ return (im_remainder_vec(argv[0], argv[1], dv->n, dv->vec)); + } + + static im_arg_desc remainderconst_vec_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLEVEC( "x" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLEVEC("x") + }; + + static im_function remainderconst_vec_desc = { +- "im_remainderconst_vec", /* Name */ +- N_( "remainder after integer division by a vector of constants" ), +- /* Description */ +- IM_FN_PIO | IM_FN_PTOP, /* Flags */ +- remainderconst_vec_vec, /* Dispatch function */ +- IM_NUMBER( remainderconst_vec_args ),/* Size of arg list */ +- remainderconst_vec_args /* Arg list */ ++ "im_remainderconst_vec", /* Name */ ++ N_("remainder after integer division by a vector of constants"), ++ /* Description */ ++ IM_FN_PIO | IM_FN_PTOP, /* Flags */ ++ remainderconst_vec_vec, /* Dispatch function */ ++ IM_NUMBER(remainderconst_vec_args), /* Size of arg list */ ++ remainderconst_vec_args /* Arg list */ + }; + + /* Args to im_mask2vips. + */ + static im_arg_desc mask2vips_args[] = { +- IM_INPUT_DMASK( "input" ), +- IM_OUTPUT_IMAGE( "output" ), ++ IM_INPUT_DMASK("input"), ++ IM_OUTPUT_IMAGE("output"), + }; + + /* Call im_mask2vips via arg vector. + */ + static int +-mask2vips_vec( im_object *argv ) ++mask2vips_vec(im_object *argv) + { + im_mask_object *mo = argv[0]; + +- return( im_mask2vips( mo->mask, argv[1] ) ); ++ return (im_mask2vips(mo->mask, argv[1])); + } + + /* Description of im_mask2vips. + */ + static im_function mask2vips_desc = { +- "im_mask2vips", /* Name */ ++ "im_mask2vips", /* Name */ + "convert DOUBLEMASK to VIPS image", +- 0, /* Flags */ +- mask2vips_vec, /* Dispatch function */ +- IM_NUMBER( mask2vips_args ), /* Size of arg list */ +- mask2vips_args /* Arg list */ ++ 0, /* Flags */ ++ mask2vips_vec, /* Dispatch function */ ++ IM_NUMBER(mask2vips_args), /* Size of arg list */ ++ mask2vips_args /* Arg list */ + }; + + /* Args to im_vips2mask. + */ + static im_arg_desc vips2mask_args[] = { +- IM_INPUT_IMAGE( "input" ), +- IM_OUTPUT_DMASK( "output" ), ++ IM_INPUT_IMAGE("input"), ++ IM_OUTPUT_DMASK("output"), + }; + + /* Call im_vips2mask via arg vector. + */ + static int +-vips2mask_vec( im_object *argv ) ++vips2mask_vec(im_object *argv) + { + im_mask_object *mo = argv[1]; + +- if( !(mo->mask = im_vips2mask( argv[0], mo->name )) ) +- return( -1 ); ++ if (!(mo->mask = im_vips2mask(argv[0], mo->name))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_vips2mask. + */ + static im_function vips2mask_desc = { +- "im_vips2mask", /* Name */ ++ "im_vips2mask", /* Name */ + "convert VIPS image to DOUBLEMASK", +- 0, /* Flags */ +- vips2mask_vec, /* Dispatch function */ +- IM_NUMBER( vips2mask_args ), /* Size of arg list */ +- vips2mask_args /* Arg list */ ++ 0, /* Flags */ ++ vips2mask_vec, /* Dispatch function */ ++ IM_NUMBER(vips2mask_args), /* Size of arg list */ ++ vips2mask_args /* Arg list */ + }; + + /* One image plus one constant in, one image out. + */ + static im_arg_desc int_in_one_out[] = { +- IM_INPUT_IMAGE( "in1" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "c" ) ++ IM_INPUT_IMAGE("in1"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("c") + }; + + /* One image plus one constant in, one image out. + */ + static im_arg_desc double_in_one_out[] = { +- IM_INPUT_IMAGE( "in1" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLE( "c" ) ++ IM_INPUT_IMAGE("in1"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLE("c") + }; + + /* One image plus doublevec in, one image out. + */ + static im_arg_desc vec_in_one_out[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLEVEC( "vec" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLEVEC("vec") + }; + + /* Call im_andimage via arg vector. + */ + static int +-andimage_vec( im_object *argv ) ++andimage_vec(im_object *argv) + { +- return( im_andimage( argv[0], argv[1], argv[2] ) ); ++ return (im_andimage(argv[0], argv[1], argv[2])); + } + + /* Description of im_andimage. +- */ ++ */ + static im_function andimage_desc = { +- "im_andimage", /* Name */ +- "bitwise and of two images", /* Description */ +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- andimage_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ "im_andimage", /* Name */ ++ "bitwise and of two images", /* Description */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ andimage_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_andimageconst via arg vector. + */ + static int +-andimageconst_vec( im_object *argv ) ++andimageconst_vec(im_object *argv) + { + int c = *((int *) argv[2]); + +- return( im_andimageconst( argv[0], argv[1], c ) ); ++ return (im_andimageconst(argv[0], argv[1], c)); + } + + /* Description of im_andconst. +- */ ++ */ + static im_function andimageconst_desc = { +- "im_andimageconst", /* Name */ ++ "im_andimageconst", /* Name */ + "bitwise and of an image with a constant", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- andimageconst_vec, /* Dispatch function */ +- IM_NUMBER( int_in_one_out ), /* Size of arg list */ +- int_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ andimageconst_vec, /* Dispatch function */ ++ IM_NUMBER(int_in_one_out), /* Size of arg list */ ++ int_in_one_out /* Arg list */ + }; + + /* Call im_andimage_vec via arg vector. + */ + static int +-andimage_vec_vec( im_object *argv ) ++andimage_vec_vec(im_object *argv) + { + im_doublevec_object *rv = (im_doublevec_object *) argv[2]; + +- return( im_andimage_vec( argv[0], argv[1], rv->n, rv->vec ) ); ++ return (im_andimage_vec(argv[0], argv[1], rv->n, rv->vec)); + } + + /* Description of im_andimageconst. +- */ ++ */ + static im_function andimage_vec_desc = { +- "im_andimage_vec", /* Name */ ++ "im_andimage_vec", /* Name */ + "bitwise and of an image with a vector constant", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- andimage_vec_vec, /* Dispatch function */ +- IM_NUMBER( vec_in_one_out ), /* Size of arg list */ +- vec_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ andimage_vec_vec, /* Dispatch function */ ++ IM_NUMBER(vec_in_one_out), /* Size of arg list */ ++ vec_in_one_out /* Arg list */ + }; + + /* Call im_orimage via arg vector. + */ + static int +-orimage_vec( im_object *argv ) ++orimage_vec(im_object *argv) + { +- return( im_orimage( argv[0], argv[1], argv[2] ) ); ++ return (im_orimage(argv[0], argv[1], argv[2])); + } + + /* Description of im_orimage. +- */ ++ */ + static im_function orimage_desc = { +- "im_orimage", /* Name */ +- "bitwise or of two images", /* Description */ ++ "im_orimage", /* Name */ ++ "bitwise or of two images", /* Description */ + IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- orimage_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ orimage_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_orimageconst via arg vector. + */ + static int +-orimageconst_vec( im_object *argv ) ++orimageconst_vec(im_object *argv) + { + int c = *((int *) argv[2]); + +- return( im_orimageconst( argv[0], argv[1], c ) ); ++ return (im_orimageconst(argv[0], argv[1], c)); + } + + /* Description of im_orimageconst. +- */ ++ */ + static im_function orimageconst_desc = { +- "im_orimageconst", /* Name */ ++ "im_orimageconst", /* Name */ + "bitwise or of an image with a constant", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- orimageconst_vec, /* Dispatch function */ +- IM_NUMBER( int_in_one_out ), /* Size of arg list */ +- int_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ orimageconst_vec, /* Dispatch function */ ++ IM_NUMBER(int_in_one_out), /* Size of arg list */ ++ int_in_one_out /* Arg list */ + }; + + /* Call im_orimage_vec via arg vector. + */ + static int +-orimage_vec_vec( im_object *argv ) ++orimage_vec_vec(im_object *argv) + { + im_doublevec_object *rv = (im_doublevec_object *) argv[2]; + +- return( im_orimage_vec( argv[0], argv[1], rv->n, rv->vec ) ); ++ return (im_orimage_vec(argv[0], argv[1], rv->n, rv->vec)); + } + + /* Description of im_orimage_vec. +- */ ++ */ + static im_function orimage_vec_desc = { +- "im_orimage_vec", /* Name */ ++ "im_orimage_vec", /* Name */ + "bitwise or of an image with a vector constant", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- orimage_vec_vec, /* Dispatch function */ +- IM_NUMBER( vec_in_one_out ), /* Size of arg list */ +- vec_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ orimage_vec_vec, /* Dispatch function */ ++ IM_NUMBER(vec_in_one_out), /* Size of arg list */ ++ vec_in_one_out /* Arg list */ + }; + + /* Call im_eorimage via arg vector. + */ + static int +-eorimage_vec( im_object *argv ) ++eorimage_vec(im_object *argv) + { +- return( im_eorimage( argv[0], argv[1], argv[2] ) ); ++ return (im_eorimage(argv[0], argv[1], argv[2])); + } + + /* Description of im_eorimage. +- */ ++ */ + static im_function eorimage_desc = { +- "im_eorimage", /* Name */ +- "bitwise eor of two images", /* Description */ +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- eorimage_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ "im_eorimage", /* Name */ ++ "bitwise eor of two images", /* Description */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ eorimage_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_eorimageconst via arg vector. + */ + static int +-eorimageconst_vec( im_object *argv ) ++eorimageconst_vec(im_object *argv) + { + int c = *((int *) argv[2]); + +- return( im_eorimageconst( argv[0], argv[1], c ) ); ++ return (im_eorimageconst(argv[0], argv[1], c)); + } + + /* Description of im_eorimageconst. +- */ ++ */ + static im_function eorimageconst_desc = { +- "im_eorimageconst", /* Name */ ++ "im_eorimageconst", /* Name */ + "bitwise eor of an image with a constant", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- eorimageconst_vec, /* Dispatch function */ +- IM_NUMBER( int_in_one_out ), /* Size of arg list */ +- int_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ eorimageconst_vec, /* Dispatch function */ ++ IM_NUMBER(int_in_one_out), /* Size of arg list */ ++ int_in_one_out /* Arg list */ + }; + + /* Call im_eorimage_vec via arg vector. + */ + static int +-eorimage_vec_vec( im_object *argv ) ++eorimage_vec_vec(im_object *argv) + { + im_doublevec_object *rv = (im_doublevec_object *) argv[2]; + +- return( im_eorimage_vec( argv[0], argv[1], rv->n, rv->vec ) ); ++ return (im_eorimage_vec(argv[0], argv[1], rv->n, rv->vec)); + } + + /* Description of im_eorimage_vec. +- */ ++ */ + static im_function eorimage_vec_desc = { +- "im_eorimage_vec", /* Name */ ++ "im_eorimage_vec", /* Name */ + "bitwise eor of an image with a vector constant", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- eorimage_vec_vec, /* Dispatch function */ +- IM_NUMBER( vec_in_one_out ), /* Size of arg list */ +- vec_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ eorimage_vec_vec, /* Dispatch function */ ++ IM_NUMBER(vec_in_one_out), /* Size of arg list */ ++ vec_in_one_out /* Arg list */ + }; + + /* Call im_shiftleft via arg vector. + */ + static int +-shiftleft_vec( im_object *argv ) ++shiftleft_vec(im_object *argv) + { + int n = *((int *) argv[2]); + +- return( im_shiftleft( argv[0], argv[1], n ) ); ++ return (im_shiftleft(argv[0], argv[1], n)); + } + + /* Description of im_shiftleft. +- */ ++ */ + static im_function shiftleft_desc = { +- "im_shiftleft", /* Name */ ++ "im_shiftleft", /* Name */ + "shift image n bits to left", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- shiftleft_vec, /* Dispatch function */ +- IM_NUMBER( int_in_one_out ), /* Size of arg list */ +- int_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ shiftleft_vec, /* Dispatch function */ ++ IM_NUMBER(int_in_one_out), /* Size of arg list */ ++ int_in_one_out /* Arg list */ + }; + + /* Call im_shiftleft_vec via arg vector. + */ + static int +-shiftleft_vec_vec( im_object *argv ) ++shiftleft_vec_vec(im_object *argv) + { + im_doublevec_object *rv = (im_doublevec_object *) argv[2]; + +- return( im_shiftleft_vec( argv[0], argv[1], rv->n, rv->vec ) ); ++ return (im_shiftleft_vec(argv[0], argv[1], rv->n, rv->vec)); + } + + /* Description of im_shiftleft_vec. +- */ ++ */ + static im_function shiftleft_vec_desc = { +- "im_shiftleft_vec", /* Name */ ++ "im_shiftleft_vec", /* Name */ + "shift image array bits to left", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- shiftleft_vec_vec, /* Dispatch function */ +- IM_NUMBER( vec_in_one_out ), /* Size of arg list */ +- vec_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ shiftleft_vec_vec, /* Dispatch function */ ++ IM_NUMBER(vec_in_one_out), /* Size of arg list */ ++ vec_in_one_out /* Arg list */ + }; + + /* Call im_shiftright via arg vector. + */ + static int +-shiftright_vec( im_object *argv ) ++shiftright_vec(im_object *argv) + { + int n = *((int *) argv[2]); + +- return( im_shiftright( argv[0], argv[1], n ) ); ++ return (im_shiftright(argv[0], argv[1], n)); + } + + /* Description of im_shiftright. +- */ ++ */ + static im_function shiftright_desc = { +- "im_shiftright", /* Name */ ++ "im_shiftright", /* Name */ + "shift integer image n bits to right", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- shiftright_vec, /* Dispatch function */ +- IM_NUMBER( int_in_one_out ), /* Size of arg list */ +- int_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ shiftright_vec, /* Dispatch function */ ++ IM_NUMBER(int_in_one_out), /* Size of arg list */ ++ int_in_one_out /* Arg list */ + }; + + /* Call im_shiftright_vec via arg vector. + */ + static int +-shiftright_vec_vec( im_object *argv ) ++shiftright_vec_vec(im_object *argv) + { + im_doublevec_object *rv = (im_doublevec_object *) argv[2]; + +- return( im_shiftright_vec( argv[0], argv[1], rv->n, rv->vec ) ); ++ return (im_shiftright_vec(argv[0], argv[1], rv->n, rv->vec)); + } + + /* Description of im_shiftright_vec. +- */ ++ */ + static im_function shiftright_vec_desc = { +- "im_shiftright_vec", /* Name */ ++ "im_shiftright_vec", /* Name */ + "shift image array bits to right", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- shiftright_vec_vec, /* Dispatch function */ +- IM_NUMBER( vec_in_one_out ), /* Size of arg list */ +- vec_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ shiftright_vec_vec, /* Dispatch function */ ++ IM_NUMBER(vec_in_one_out), /* Size of arg list */ ++ vec_in_one_out /* Arg list */ + }; + + /* Call im_equal via arg vector. + */ + static int +-equal_vec( im_object *argv ) ++equal_vec(im_object *argv) + { +- return( im_equal( argv[0], argv[1], argv[2] ) ); ++ return (im_equal(argv[0], argv[1], argv[2])); + } + + /* Description of im_equal. +- */ ++ */ + static im_function equal_desc = { +- "im_equal", /* Name */ +- "two images equal in value", /* Description */ +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- equal_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ "im_equal", /* Name */ ++ "two images equal in value", /* Description */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ equal_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_equalconst via arg vector. + */ + static int +-equalconst_vec( im_object *argv ) ++equalconst_vec(im_object *argv) + { + double c = *((double *) argv[2]); + +- return( im_equalconst( argv[0], argv[1], c ) ); ++ return (im_equalconst(argv[0], argv[1], c)); + } + + /* Description of im_equalconst. +- */ ++ */ + static im_function equalconst_desc = { +- "im_equalconst", /* Name */ +- "image equals const", /* Description */ +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- equalconst_vec, /* Dispatch function */ +- IM_NUMBER( double_in_one_out ), /* Size of arg list */ +- double_in_one_out /* Arg list */ ++ "im_equalconst", /* Name */ ++ "image equals const", /* Description */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ equalconst_vec, /* Dispatch function */ ++ IM_NUMBER(double_in_one_out), /* Size of arg list */ ++ double_in_one_out /* Arg list */ + }; + + /* Call im_equal_vec via arg vector. + */ + static int +-equal_vec_vec( im_object *argv ) ++equal_vec_vec(im_object *argv) + { + im_doublevec_object *rv = (im_doublevec_object *) argv[2]; + +- return( im_equal_vec( argv[0], argv[1], rv->n, rv->vec ) ); ++ return (im_equal_vec(argv[0], argv[1], rv->n, rv->vec)); + } + + /* Description of im_equal_vec. +- */ ++ */ + static im_function equal_vec_desc = { +- "im_equal_vec", /* Name */ +- "image equals doublevec", /* Description */ +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- equal_vec_vec, /* Dispatch function */ +- IM_NUMBER( vec_in_one_out ), /* Size of arg list */ +- vec_in_one_out /* Arg list */ ++ "im_equal_vec", /* Name */ ++ "image equals doublevec", /* Description */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ equal_vec_vec, /* Dispatch function */ ++ IM_NUMBER(vec_in_one_out), /* Size of arg list */ ++ vec_in_one_out /* Arg list */ + }; + + /* Call im_notequal via arg vector. + */ + static int +-notequal_vec( im_object *argv ) ++notequal_vec(im_object *argv) + { +- return( im_notequal( argv[0], argv[1], argv[2] ) ); ++ return (im_notequal(argv[0], argv[1], argv[2])); + } + + /* Description of im_notequal. +- */ ++ */ + static im_function notequal_desc = { +- "im_notequal", /* Name */ +- "two images not equal in value",/* Description */ +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- notequal_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ "im_notequal", /* Name */ ++ "two images not equal in value", /* Description */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ notequal_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_notequalconst via arg vector. + */ + static int +-notequalconst_vec( im_object *argv ) ++notequalconst_vec(im_object *argv) + { + double c = *((double *) argv[2]); + +- return( im_notequalconst( argv[0], argv[1], c ) ); ++ return (im_notequalconst(argv[0], argv[1], c)); + } + + /* Description of im_notequalconst. +- */ ++ */ + static im_function notequalconst_desc = { +- "im_notequalconst", /* Name */ +- "image does not equal const", /* Description */ +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- notequalconst_vec, /* Dispatch function */ +- IM_NUMBER( double_in_one_out ), /* Size of arg list */ +- double_in_one_out /* Arg list */ ++ "im_notequalconst", /* Name */ ++ "image does not equal const", /* Description */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ notequalconst_vec, /* Dispatch function */ ++ IM_NUMBER(double_in_one_out), /* Size of arg list */ ++ double_in_one_out /* Arg list */ + }; + + /* Call im_notequal_vec via arg vector. + */ + static int +-notequal_vec_vec( im_object *argv ) ++notequal_vec_vec(im_object *argv) + { + im_doublevec_object *rv = (im_doublevec_object *) argv[2]; + +- return( im_notequal_vec( argv[0], argv[1], rv->n, rv->vec ) ); ++ return (im_notequal_vec(argv[0], argv[1], rv->n, rv->vec)); + } + + /* Description of im_notequal_vec. +- */ ++ */ + static im_function notequal_vec_desc = { +- "im_notequal_vec", /* Name */ +- "image does not equal doublevec", /* Description */ +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- notequal_vec_vec, /* Dispatch function */ +- IM_NUMBER( vec_in_one_out ), /* Size of arg list */ +- vec_in_one_out /* Arg list */ ++ "im_notequal_vec", /* Name */ ++ "image does not equal doublevec", /* Description */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ notequal_vec_vec, /* Dispatch function */ ++ IM_NUMBER(vec_in_one_out), /* Size of arg list */ ++ vec_in_one_out /* Arg list */ + }; + + /* Call im_less via arg vector. + */ + static int +-less_vec( im_object *argv ) ++less_vec(im_object *argv) + { +- return( im_less( argv[0], argv[1], argv[2] ) ); ++ return (im_less(argv[0], argv[1], argv[2])); + } + + /* Description of im_less. +- */ ++ */ + static im_function less_desc = { +- "im_less", /* Name */ +- "in1 less than in2 in value", /* Description */ +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- less_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ "im_less", /* Name */ ++ "in1 less than in2 in value", /* Description */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ less_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_lessconst via arg vector. + */ + static int +-lessconst_vec( im_object *argv ) ++lessconst_vec(im_object *argv) + { + double c = *((double *) argv[2]); + +- return( im_lessconst( argv[0], argv[1], c ) ); ++ return (im_lessconst(argv[0], argv[1], c)); + } + + /* Description of im_lessconst. +- */ ++ */ + static im_function lessconst_desc = { +- "im_lessconst", /* Name */ +- "in less than const", /* Description */ +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- lessconst_vec, /* Dispatch function */ +- IM_NUMBER( double_in_one_out ), /* Size of arg list */ +- double_in_one_out /* Arg list */ ++ "im_lessconst", /* Name */ ++ "in less than const", /* Description */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ lessconst_vec, /* Dispatch function */ ++ IM_NUMBER(double_in_one_out), /* Size of arg list */ ++ double_in_one_out /* Arg list */ + }; + + /* Call im_less_vec via arg vector. + */ + static int +-less_vec_vec( im_object *argv ) ++less_vec_vec(im_object *argv) + { + im_doublevec_object *rv = (im_doublevec_object *) argv[2]; + +- return( im_less_vec( argv[0], argv[1], rv->n, rv->vec ) ); ++ return (im_less_vec(argv[0], argv[1], rv->n, rv->vec)); + } + + /* Description of im_less_vec. +- */ ++ */ + static im_function less_vec_desc = { +- "im_less_vec", /* Name */ +- "in less than doublevec", /* Description */ +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- less_vec_vec, /* Dispatch function */ +- IM_NUMBER( vec_in_one_out ), /* Size of arg list */ +- vec_in_one_out /* Arg list */ ++ "im_less_vec", /* Name */ ++ "in less than doublevec", /* Description */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ less_vec_vec, /* Dispatch function */ ++ IM_NUMBER(vec_in_one_out), /* Size of arg list */ ++ vec_in_one_out /* Arg list */ + }; + + /* Call im_more via arg vector. + */ + static int +-more_vec( im_object *argv ) ++more_vec(im_object *argv) + { +- return( im_more( argv[0], argv[1], argv[2] ) ); ++ return (im_more(argv[0], argv[1], argv[2])); + } + + /* Description of im_more. +- */ ++ */ + static im_function more_desc = { +- "im_more", /* Name */ +- "in1 more than in2 in value", /* Description */ +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- more_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ "im_more", /* Name */ ++ "in1 more than in2 in value", /* Description */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ more_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_moreconst via arg vector. + */ + static int +-moreconst_vec( im_object *argv ) ++moreconst_vec(im_object *argv) + { + double c = *((double *) argv[2]); + +- return( im_moreconst( argv[0], argv[1], c ) ); ++ return (im_moreconst(argv[0], argv[1], c)); + } + + /* Description of im_moreconst. +- */ ++ */ + static im_function moreconst_desc = { +- "im_moreconst", /* Name */ +- "in more than const", /* Description */ +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- moreconst_vec, /* Dispatch function */ +- IM_NUMBER( double_in_one_out ), /* Size of arg list */ +- double_in_one_out /* Arg list */ ++ "im_moreconst", /* Name */ ++ "in more than const", /* Description */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ moreconst_vec, /* Dispatch function */ ++ IM_NUMBER(double_in_one_out), /* Size of arg list */ ++ double_in_one_out /* Arg list */ + }; + + /* Call im_more_vec via arg vector. + */ + static int +-more_vec_vec( im_object *argv ) ++more_vec_vec(im_object *argv) + { + im_doublevec_object *rv = (im_doublevec_object *) argv[2]; + +- return( im_more_vec( argv[0], argv[1], rv->n, rv->vec ) ); ++ return (im_more_vec(argv[0], argv[1], rv->n, rv->vec)); + } + + /* Description of im_more_vec. +- */ ++ */ + static im_function more_vec_desc = { +- "im_more_vec", /* Name */ +- "in more than doublevec", /* Description */ +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- more_vec_vec, /* Dispatch function */ +- IM_NUMBER( vec_in_one_out ), /* Size of arg list */ +- vec_in_one_out /* Arg list */ ++ "im_more_vec", /* Name */ ++ "in more than doublevec", /* Description */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ more_vec_vec, /* Dispatch function */ ++ IM_NUMBER(vec_in_one_out), /* Size of arg list */ ++ vec_in_one_out /* Arg list */ + }; + + /* Call im_moreeq via arg vector. + */ + static int +-moreeq_vec( im_object *argv ) ++moreeq_vec(im_object *argv) + { +- return( im_moreeq( argv[0], argv[1], argv[2] ) ); ++ return (im_moreeq(argv[0], argv[1], argv[2])); + } + + /* Description of im_moreeq. +- */ ++ */ + static im_function moreeq_desc = { +- "im_moreeq", /* Name */ ++ "im_moreeq", /* Name */ + "in1 more than or equal to in2 in value", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- moreeq_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ moreeq_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_moreeqconst via arg vector. + */ + static int +-moreeqconst_vec( im_object *argv ) ++moreeqconst_vec(im_object *argv) + { + double c = *((double *) argv[2]); + +- return( im_moreeqconst( argv[0], argv[1], c ) ); ++ return (im_moreeqconst(argv[0], argv[1], c)); + } + + /* Description of im_moreeqconst. +- */ ++ */ + static im_function moreeqconst_desc = { +- "im_moreeqconst", /* Name */ ++ "im_moreeqconst", /* Name */ + "in more than or equal to const", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- moreeqconst_vec, /* Dispatch function */ +- IM_NUMBER( double_in_one_out ), /* Size of arg list */ +- double_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ moreeqconst_vec, /* Dispatch function */ ++ IM_NUMBER(double_in_one_out), /* Size of arg list */ ++ double_in_one_out /* Arg list */ + }; + + /* Call im_moreeq_vec via arg vector. + */ + static int +-moreeq_vec_vec( im_object *argv ) ++moreeq_vec_vec(im_object *argv) + { + im_doublevec_object *rv = (im_doublevec_object *) argv[2]; + +- return( im_moreeq_vec( argv[0], argv[1], rv->n, rv->vec ) ); ++ return (im_moreeq_vec(argv[0], argv[1], rv->n, rv->vec)); + } + + /* Description of im_moreeq_vec. +- */ ++ */ + static im_function moreeq_vec_desc = { +- "im_moreeq_vec", /* Name */ ++ "im_moreeq_vec", /* Name */ + "in more than or equal to doublevec", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- moreeq_vec_vec, /* Dispatch function */ +- IM_NUMBER( vec_in_one_out ), /* Size of arg list */ +- vec_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ moreeq_vec_vec, /* Dispatch function */ ++ IM_NUMBER(vec_in_one_out), /* Size of arg list */ ++ vec_in_one_out /* Arg list */ + }; + + /* Call im_lesseq via arg vector. + */ + static int +-lesseq_vec( im_object *argv ) ++lesseq_vec(im_object *argv) + { +- return( im_lesseq( argv[0], argv[1], argv[2] ) ); ++ return (im_lesseq(argv[0], argv[1], argv[2])); + } + + /* Description of im_lesseq. +- */ ++ */ + static im_function lesseq_desc = { +- "im_lesseq", /* Name */ ++ "im_lesseq", /* Name */ + "in1 less than or equal to in2 in value", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- lesseq_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ lesseq_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_lesseqconst via arg vector. + */ + static int +-lesseqconst_vec( im_object *argv ) ++lesseqconst_vec(im_object *argv) + { + double c = *((double *) argv[2]); + +- return( im_lesseqconst( argv[0], argv[1], c ) ); ++ return (im_lesseqconst(argv[0], argv[1], c)); + } + + /* Description of im_lesseqconst. +- */ ++ */ + static im_function lesseqconst_desc = { +- "im_lesseqconst", /* Name */ ++ "im_lesseqconst", /* Name */ + "in less than or equal to const", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- lesseqconst_vec, /* Dispatch function */ +- IM_NUMBER( double_in_one_out ), /* Size of arg list */ +- double_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ lesseqconst_vec, /* Dispatch function */ ++ IM_NUMBER(double_in_one_out), /* Size of arg list */ ++ double_in_one_out /* Arg list */ + }; + + /* Call im_lesseq_vec via arg vector. + */ + static int +-lesseq_vec_vec( im_object *argv ) ++lesseq_vec_vec(im_object *argv) + { + im_doublevec_object *rv = (im_doublevec_object *) argv[2]; + +- return( im_lesseq_vec( argv[0], argv[1], rv->n, rv->vec ) ); ++ return (im_lesseq_vec(argv[0], argv[1], rv->n, rv->vec)); + } + + /* Description of im_lesseq_vec. +- */ ++ */ + static im_function lesseq_vec_desc = { +- "im_lesseq_vec", /* Name */ ++ "im_lesseq_vec", /* Name */ + "in less than or equal to doublevec", +- IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- lesseq_vec_vec, /* Dispatch function */ +- IM_NUMBER( vec_in_one_out ), /* Size of arg list */ +- vec_in_one_out /* Arg list */ ++ IM_FN_PTOP | IM_FN_PIO, /* Flags */ ++ lesseq_vec_vec, /* Dispatch function */ ++ IM_NUMBER(vec_in_one_out), /* Size of arg list */ ++ vec_in_one_out /* Arg list */ + }; + + /* If-then-else args. + */ + static im_arg_desc ifthenelse_args[] = { +- IM_INPUT_IMAGE( "cond" ), +- IM_INPUT_IMAGE( "in1" ), +- IM_INPUT_IMAGE( "in2" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("cond"), ++ IM_INPUT_IMAGE("in1"), ++ IM_INPUT_IMAGE("in2"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Call im_blend via arg vector. + */ + static int +-blend_vec( im_object *argv ) ++blend_vec(im_object *argv) + { +- return( im_blend( argv[0], argv[1], argv[2], argv[3] ) ); ++ return (im_blend(argv[0], argv[1], argv[2], argv[3])); + } + + /* Description of im_blend. +- */ ++ */ + static im_function blend_desc = { +- "im_blend", /* Name */ ++ "im_blend", /* Name */ + "use cond image to blend between images in1 and in2", + IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- blend_vec, /* Dispatch function */ +- IM_NUMBER( ifthenelse_args ), /* Size of arg list */ +- ifthenelse_args /* Arg list */ ++ blend_vec, /* Dispatch function */ ++ IM_NUMBER(ifthenelse_args), /* Size of arg list */ ++ ifthenelse_args /* Arg list */ + }; + + /* Call im_ifthenelse via arg vector. + */ + static int +-ifthenelse_vec( im_object *argv ) ++ifthenelse_vec(im_object *argv) + { +- return( im_ifthenelse( argv[0], argv[1], argv[2], argv[3] ) ); ++ return (im_ifthenelse(argv[0], argv[1], argv[2], argv[3])); + } + + /* Description of im_ifthenelse. +- */ ++ */ + static im_function ifthenelse_desc = { +- "im_ifthenelse", /* Name */ ++ "im_ifthenelse", /* Name */ + "use cond image to choose pels from image in1 or in2", + IM_FN_PTOP | IM_FN_PIO, /* Flags */ +- ifthenelse_vec, /* Dispatch function */ +- IM_NUMBER( ifthenelse_args ), /* Size of arg list */ +- ifthenelse_args /* Arg list */ ++ ifthenelse_vec, /* Dispatch function */ ++ IM_NUMBER(ifthenelse_args), /* Size of arg list */ ++ ifthenelse_args /* Arg list */ + }; + + /* Call im_argb2rgba() via arg vector. + */ + static int +-argb2rgba_vec( im_object *argv ) ++argb2rgba_vec(im_object *argv) + { +- return( im_argb2rgba( argv[0], argv[1] ) ); ++ return (im_argb2rgba(argv[0], argv[1])); + } + + /* Description of im_argb2rgba. +- */ ++ */ + static im_function argb2rgba_desc = { +- "im_argb2rgba", /* Name */ +- "convert pre-multipled argb to png-style rgba", /* Description */ +- IM_FN_PIO, /* Flags */ +- argb2rgba_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_argb2rgba", /* Name */ ++ "convert pre-multipled argb to png-style rgba", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ argb2rgba_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + +- + /* Package up all these functions. + */ + static im_function *deprecated_list[] = { +@@ -2272,7 +2271,7 @@ static im_function *deprecated_list[] = { + &convsepf_raw_desc, + &convsep_raw_desc, + &fastcor_raw_desc, +- &gradcor_raw_desc, ++ &gradcor_raw_desc, + &spcor_raw_desc, + &lhisteq_raw_desc, + &stdif_raw_desc, +@@ -2326,6 +2325,6 @@ static im_function *deprecated_list[] = { + */ + im_package im__deprecated = { + "deprecated", +- IM_NUMBER( deprecated_list ), ++ IM_NUMBER(deprecated_list), + deprecated_list + }; +diff --git a/libvips/deprecated/dispatch_types.c b/libvips/deprecated/dispatch_types.c +index 6e58bd425b..21834ce49f 100644 +--- a/libvips/deprecated/dispatch_types.c ++++ b/libvips/deprecated/dispatch_types.c +@@ -11,28 +11,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -50,7 +50,7 @@ + #include + #include + +-/* String containing each of the characters which can be used within a ++/* String containing each of the characters which can be used within a + * single command line argument to separate the elements of a vector. + */ + #define VEC_SEPS " " +@@ -58,296 +58,296 @@ + /* Init function for input displays. Just a stub nowadays. + */ + static int +-input_display_init( im_object *obj, char *str ) ++input_display_init(im_object *obj, char *str) + { + *obj = NULL; + +- return( 0 ); ++ return (0); + } + + /* Input display type. + */ + im_type_desc im__input_display = { +- IM_TYPE_DISPLAY, /* It's a display */ +- 0, /* No storage needed */ +- IM_TYPE_ARG, /* It requires a command-line arg */ +- input_display_init, /* Init function */ ++ IM_TYPE_DISPLAY, /* It's a display */ ++ 0, /* No storage needed */ ++ IM_TYPE_ARG, /* It requires a command-line arg */ ++ input_display_init, /* Init function */ + NULL /* Destroy function */ + }; + + /* Output display type. + */ + im_type_desc im__output_display = { +- IM_TYPE_DISPLAY, /* It's a display */ +- sizeof( void * ), /* Memory to allocate */ +- IM_TYPE_OUTPUT, /* Output object */ +- NULL, /* Init function */ +- NULL /* Destroy function */ ++ IM_TYPE_DISPLAY, /* It's a display */ ++ sizeof(void *), /* Memory to allocate */ ++ IM_TYPE_OUTPUT, /* Output object */ ++ NULL, /* Init function */ ++ NULL /* Destroy function */ + }; + + /* Init function for input images. + */ + static int +-input_image_init( im_object *obj, char *str ) ++input_image_init(im_object *obj, char *str) + { + IMAGE **im = (IMAGE **) obj; + +- return( !(*im = vips__deprecated_open_read( str, FALSE )) ); ++ return (!(*im = vips__deprecated_open_read(str, FALSE))); + } + + /* Input image type. + */ + im_type_desc im__input_image = { +- IM_TYPE_IMAGE, /* It's an image */ +- 0, /* No storage needed */ +- IM_TYPE_ARG, /* It requires a command-line arg */ +- (im_init_obj_fn) input_image_init,/* Init function */ +- (im_dest_obj_fn) im_close /* Destroy function */ ++ IM_TYPE_IMAGE, /* It's an image */ ++ 0, /* No storage needed */ ++ IM_TYPE_ARG, /* It requires a command-line arg */ ++ (im_init_obj_fn) input_image_init, /* Init function */ ++ (im_dest_obj_fn) im_close /* Destroy function */ + }; + + /* Init function for output images. + */ + static int +-output_image_init( im_object *obj, char *str ) ++output_image_init(im_object *obj, char *str) + { + IMAGE **im = (IMAGE **) obj; + +- return( !(*im = vips__deprecated_open_write( str )) ); ++ return (!(*im = vips__deprecated_open_write(str))); + } + + /* Output image type. + */ + im_type_desc im__output_image = { +- IM_TYPE_IMAGE, /* It's an image */ +- 0, /* No storage to be allocated */ +- IM_TYPE_OUTPUT | IM_TYPE_ARG, /* Flags! */ +- (im_init_obj_fn) output_image_init,/* Init function */ +- (im_dest_obj_fn) im_close /* Destroy function */ ++ IM_TYPE_IMAGE, /* It's an image */ ++ 0, /* No storage to be allocated */ ++ IM_TYPE_OUTPUT | IM_TYPE_ARG, /* Flags! */ ++ (im_init_obj_fn) output_image_init, /* Init function */ ++ (im_dest_obj_fn) im_close /* Destroy function */ + }; + + /* Init function for RW images. + */ + static int +-rw_image_init( im_object *obj, char *str ) ++rw_image_init(im_object *obj, char *str) + { + IMAGE **im = (IMAGE **) obj; + +- return( !(*im = im_open( str, "rw" )) ); ++ return (!(*im = im_open(str, "rw"))); + } + + /* RW image type. + */ + im_type_desc im__rw_image = { +- IM_TYPE_IMAGE, /* It's an image */ +- 0, /* No storage to be allocated */ +- IM_TYPE_ARG | IM_TYPE_RW, /* Read-write object, needs an arg */ +- (im_init_obj_fn) rw_image_init, /* Init function */ +- (im_dest_obj_fn) im_close /* Destroy function */ ++ IM_TYPE_IMAGE, /* It's an image */ ++ 0, /* No storage to be allocated */ ++ IM_TYPE_ARG | IM_TYPE_RW, /* Read-write object, needs an arg */ ++ (im_init_obj_fn) rw_image_init, /* Init function */ ++ (im_dest_obj_fn) im_close /* Destroy function */ + }; + + /* im_imagevec_object destroy function. + */ + static int +-imagevec_dest( im_object obj ) ++imagevec_dest(im_object obj) + { + im_imagevec_object *iv = obj; + +- if( iv->vec ) { ++ if (iv->vec) { + int i; + +- for( i = 0; i < iv->n; i++ ) +- if( iv->vec[i] ) { +- im_close( iv->vec[i] ); ++ for (i = 0; i < iv->n; i++) ++ if (iv->vec[i]) { ++ im_close(iv->vec[i]); + iv->vec[i] = NULL; + } + +- g_free( iv->vec ); ++ g_free(iv->vec); + iv->vec = NULL; + iv->n = 0; + } + +- return( 0 ); ++ return (0); + } + + /* Init function for imagevec input. + */ + static int +-input_imagevec_init( im_object *obj, char *str ) ++input_imagevec_init(im_object *obj, char *str) + { + im_imagevec_object *iv = *obj; + char **strv; + int nargs; + int i; + +- strv = g_strsplit( str, VEC_SEPS, -1 ); +- nargs = g_strv_length( strv ); ++ strv = g_strsplit(str, VEC_SEPS, -1); ++ nargs = g_strv_length(strv); + +- if( !(iv->vec = VIPS_ARRAY( NULL, nargs, IMAGE * )) ) { +- g_strfreev( strv ); +- return( -1 ); ++ if (!(iv->vec = VIPS_ARRAY(NULL, nargs, IMAGE *))) { ++ g_strfreev(strv); ++ return (-1); + } + iv->n = nargs; + + /* Must NULL them out in case we fail halfway though opening them all. + */ +- for( i = 0; i < nargs; i++ ) ++ for (i = 0; i < nargs; i++) + iv->vec[i] = NULL; + +- for( i = 0; i < nargs; i++ ) +- if( !(iv->vec[i] = im_open( strv[i], "rd" )) ) { +- g_strfreev( strv ); +- return( -1 ); ++ for (i = 0; i < nargs; i++) ++ if (!(iv->vec[i] = im_open(strv[i], "rd"))) { ++ g_strfreev(strv); ++ return (-1); + } + +- g_strfreev( strv ); ++ g_strfreev(strv); + +- return( 0 ); ++ return (0); + } + + /* Input image vector type. + */ + im_type_desc im__input_imagevec = { +- IM_TYPE_IMAGEVEC, /* It's an array of IMAGE */ +- sizeof( im_imagevec_object ), /* Memory to allocate in vec build */ +- IM_TYPE_ARG, /* It requires a command-line arg */ ++ IM_TYPE_IMAGEVEC, /* It's an array of IMAGE */ ++ sizeof(im_imagevec_object), /* Memory to allocate in vec build */ ++ IM_TYPE_ARG, /* It requires a command-line arg */ + input_imagevec_init, /* Init function */ +- imagevec_dest /* Destroy function */ ++ imagevec_dest /* Destroy function */ + }; + + /* Init function for masks. "str" can be NULL for output masks. + */ + static int +-mask_init( im_object *obj, char *str ) ++mask_init(im_object *obj, char *str) + { + im_mask_object *mo = *obj; + + /* Install string, clear mask. + */ +- if( str && !(mo->name = im_strdup( NULL, str )) ) +- return( -1 ); ++ if (str && !(mo->name = im_strdup(NULL, str))) ++ return (-1); + mo->mask = NULL; + +- return( 0 ); ++ return (0); + } + + /* Init function for input dmasks. As above, but read in the mask. + */ + static int +-dmask_init( im_object *obj, char *str ) ++dmask_init(im_object *obj, char *str) + { + im_mask_object *mo = *obj; + +- if( mask_init( obj, str ) ) +- return( -1 ); +- if( !(mo->mask = im_read_dmask( str )) ) +- return( -1 ); ++ if (mask_init(obj, str)) ++ return (-1); ++ if (!(mo->mask = im_read_dmask(str))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-/* Init function for input imasks. ++/* Init function for input imasks. + */ + static int +-imask_init( im_object *obj, char *str ) ++imask_init(im_object *obj, char *str) + { + im_mask_object *mo = *obj; + +- if( mask_init( obj, str ) ) +- return( -1 ); +- if( !(mo->mask = im_read_imask( str )) ) +- return( -1 ); ++ if (mask_init(obj, str)) ++ return (-1); ++ if (!(mo->mask = im_read_imask(str))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* DOUBLEMASK destroy function. + */ + static int +-dmask_dest( im_object obj ) ++dmask_dest(im_object obj) + { + im_mask_object *mo = obj; + +- VIPS_FREE( mo->name ); +- VIPS_FREEF( im_free_dmask, mo->mask ); ++ VIPS_FREE(mo->name); ++ VIPS_FREEF(im_free_dmask, mo->mask); + +- return( 0 ); ++ return (0); + } + + /* INTMASK destroy function. + */ + static int +-imask_dest( im_object obj ) ++imask_dest(im_object obj) + { + im_mask_object *mo = obj; + +- VIPS_FREE( mo->name ); +- VIPS_FREEF( im_free_imask, mo->mask ); ++ VIPS_FREE(mo->name); ++ VIPS_FREEF(im_free_imask, mo->mask); + +- return( 0 ); ++ return (0); + } + + /* As above, but save the mask first. + */ + static int +-save_dmask_dest( im_object obj ) ++save_dmask_dest(im_object obj) + { + im_mask_object *mo = obj; + +- if( mo->mask && im_write_dmask( mo->mask ) ) +- return( -1 ); +- return( dmask_dest( obj ) ); ++ if (mo->mask && im_write_dmask(mo->mask)) ++ return (-1); ++ return (dmask_dest(obj)); + } + + /* As above, but save the mask first. + */ + static int +-save_imask_dest( im_object obj ) ++save_imask_dest(im_object obj) + { + im_mask_object *mo = obj; + +- if( mo->mask && im_write_imask( mo->mask ) ) +- return( -1 ); +- return( imask_dest( obj ) ); ++ if (mo->mask && im_write_imask(mo->mask)) ++ return (-1); ++ return (imask_dest(obj)); + } + + /* Output dmask type. + */ + im_type_desc im__output_dmask = { +- IM_TYPE_DMASK, /* It's a mask */ +- sizeof( im_mask_object ), /* Storage for mask object */ +- IM_TYPE_OUTPUT | IM_TYPE_ARG, /* Flags */ +- mask_init, /* Init function */ +- save_dmask_dest /* Save and destroy function */ ++ IM_TYPE_DMASK, /* It's a mask */ ++ sizeof(im_mask_object), /* Storage for mask object */ ++ IM_TYPE_OUTPUT | IM_TYPE_ARG, /* Flags */ ++ mask_init, /* Init function */ ++ save_dmask_dest /* Save and destroy function */ + }; + + /* Input dmask type. + */ + im_type_desc im__input_dmask = { + IM_TYPE_DMASK, /* It's a mask */ +- sizeof( im_mask_object ), /* Storage for mask object */ ++ sizeof(im_mask_object), /* Storage for mask object */ + IM_TYPE_ARG, /* It requires a command-line arg */ +- dmask_init, /* Init function */ +- dmask_dest /* Destroy function */ ++ dmask_init, /* Init function */ ++ dmask_dest /* Destroy function */ + }; + + /* Output imask type. + */ + im_type_desc im__output_imask = { +- IM_TYPE_IMASK, /* It's a mask */ +- sizeof( im_mask_object ), /* Storage for mask object */ +- IM_TYPE_OUTPUT | IM_TYPE_ARG, /* Flags */ +- mask_init, /* Init function */ +- save_imask_dest /* Save and destroy function */ ++ IM_TYPE_IMASK, /* It's a mask */ ++ sizeof(im_mask_object), /* Storage for mask object */ ++ IM_TYPE_OUTPUT | IM_TYPE_ARG, /* Flags */ ++ mask_init, /* Init function */ ++ save_imask_dest /* Save and destroy function */ + }; + + /* Input imask type. + */ + im_type_desc im__input_imask = { + IM_TYPE_IMASK, /* It's a mask */ +- sizeof( im_mask_object ), /* Storage for mask object */ ++ sizeof(im_mask_object), /* Storage for mask object */ + IM_TYPE_ARG, /* It requires a command-line arg */ +- imask_init, /* Init function */ +- imask_dest /* Destroy function */ ++ imask_init, /* Init function */ ++ imask_dest /* Destroy function */ + }; + + /* Output dmask to screen type. Set a `print' function to get actual output. +@@ -355,282 +355,282 @@ im_type_desc im__input_imask = { + */ + im_type_desc im__output_dmask_screen = { + IM_TYPE_DMASK, /* It's a mask */ +- sizeof( im_mask_object ), /* Storage for mask object */ ++ sizeof(im_mask_object), /* Storage for mask object */ + IM_TYPE_OUTPUT, /* It's an output argument */ +- mask_init, /* Init function */ +- dmask_dest /* Destroy function */ ++ mask_init, /* Init function */ ++ dmask_dest /* Destroy function */ + }; + + /* Init function for double input. + */ + static int +-input_double_init( im_object *obj, char *str ) ++input_double_init(im_object *obj, char *str) + { + double *d = (double *) *obj; + +- *d = g_ascii_strtod( str, NULL ); ++ *d = g_ascii_strtod(str, NULL); + +- return( 0 ); ++ return (0); + } + + /* Input double type. + */ + im_type_desc im__input_double = { +- IM_TYPE_DOUBLE, /* It's a double */ +- sizeof( double ), /* Memory to allocate */ +- IM_TYPE_ARG, /* It requires a command-line arg */ +- input_double_init, /* Init function */ +- NULL /* Destroy function */ ++ IM_TYPE_DOUBLE, /* It's a double */ ++ sizeof(double), /* Memory to allocate */ ++ IM_TYPE_ARG, /* It requires a command-line arg */ ++ input_double_init, /* Init function */ ++ NULL /* Destroy function */ + }; + + /* im_doublevec_object destroy function. + */ + static int +-doublevec_dest( im_object obj ) ++doublevec_dest(im_object obj) + { + im_doublevec_object *dv = obj; + +- if( dv->vec ) { +- g_free( dv->vec ); ++ if (dv->vec) { ++ g_free(dv->vec); + dv->vec = NULL; + dv->n = 0; + } + +- return( 0 ); ++ return (0); + } + + /* Init function for doublevec input. + */ + static int +-input_doublevec_init( im_object *obj, char *str ) ++input_doublevec_init(im_object *obj, char *str) + { + im_doublevec_object *dv = *obj; + char **strv; + int nargs; + int i; + +- strv = g_strsplit( str, VEC_SEPS, -1 ); +- nargs = g_strv_length( strv ); ++ strv = g_strsplit(str, VEC_SEPS, -1); ++ nargs = g_strv_length(strv); + +- if( !(dv->vec = VIPS_ARRAY( NULL, nargs, double )) ) { +- g_strfreev( strv ); +- return( -1 ); ++ if (!(dv->vec = VIPS_ARRAY(NULL, nargs, double))) { ++ g_strfreev(strv); ++ return (-1); + } + dv->n = nargs; + +- for( i = 0; i < nargs; i++ ) { +- dv->vec[i] = g_ascii_strtod( strv[i], NULL ); +- if( errno ) { +- vips_error_system( errno, "input_doublevec_init", +- _( "bad double \"%s\"" ), strv[i] ); +- g_strfreev( strv ); +- return( -1 ); ++ for (i = 0; i < nargs; i++) { ++ dv->vec[i] = g_ascii_strtod(strv[i], NULL); ++ if (errno) { ++ vips_error_system(errno, "input_doublevec_init", ++ _("bad double \"%s\""), strv[i]); ++ g_strfreev(strv); ++ return (-1); + } + } + +- g_strfreev( strv ); ++ g_strfreev(strv); + +- return( 0 ); ++ return (0); + } + + /* Input double vector type. + */ + im_type_desc im__input_doublevec = { +- IM_TYPE_DOUBLEVEC, /* It's an array of double */ +- sizeof( im_doublevec_object ), /* Memory to allocate in vec build */ +- IM_TYPE_ARG, /* It requires a command-line arg */ +- input_doublevec_init, /* Init function */ +- doublevec_dest /* Destroy function */ ++ IM_TYPE_DOUBLEVEC, /* It's an array of double */ ++ sizeof(im_doublevec_object), /* Memory to allocate in vec build */ ++ IM_TYPE_ARG, /* It requires a command-line arg */ ++ input_doublevec_init, /* Init function */ ++ doublevec_dest /* Destroy function */ + }; + + /* Print function for doublevec output. + */ + int +-im__dvprint( im_object obj ) ++im__dvprint(im_object obj) + { + im_doublevec_object *dv = obj; + int i; + +- for( i = 0; i < dv->n; i++ ) +- printf( "%G ", dv->vec[i] ); +- printf( "\n" ); ++ for (i = 0; i < dv->n; i++) ++ printf("%G ", dv->vec[i]); ++ printf("\n"); + +- return( 0 ); ++ return (0); + } + + /* Output double vector type. + */ + im_type_desc im__output_doublevec = { +- IM_TYPE_DOUBLEVEC, /* It's an array of double */ +- sizeof( im_doublevec_object ), /* Memory to allocate in vec build */ +- IM_TYPE_OUTPUT, /* Output type */ +- NULL, /* Init function */ +- doublevec_dest /* Destroy function */ ++ IM_TYPE_DOUBLEVEC, /* It's an array of double */ ++ sizeof(im_doublevec_object), /* Memory to allocate in vec build */ ++ IM_TYPE_OUTPUT, /* Output type */ ++ NULL, /* Init function */ ++ doublevec_dest /* Destroy function */ + }; + + /* im_intvec_object destroy function. + */ + static int +-intvec_dest( im_object obj ) ++intvec_dest(im_object obj) + { + im_intvec_object *iv = obj; + +- if( iv->vec ) { +- g_free( iv->vec ); ++ if (iv->vec) { ++ g_free(iv->vec); + iv->vec = NULL; + iv->n = 0; + } + +- return( 0 ); ++ return (0); + } + + /* Init function for intvec input. + */ + static int +-input_intvec_init( im_object *obj, char *str ) ++input_intvec_init(im_object *obj, char *str) + { + im_intvec_object *iv = *obj; + char **strv; + int nargs; + int i; + +- strv = g_strsplit( str, VEC_SEPS, -1 ); +- nargs = g_strv_length( strv ); ++ strv = g_strsplit(str, VEC_SEPS, -1); ++ nargs = g_strv_length(strv); + +- if( !(iv->vec = VIPS_ARRAY( NULL, nargs, int )) ) { +- g_strfreev( strv ); +- return( -1 ); ++ if (!(iv->vec = VIPS_ARRAY(NULL, nargs, int))) { ++ g_strfreev(strv); ++ return (-1); + } + iv->n = nargs; + +- for( i = 0; i < nargs; i++ ) { +- long int val= strtol( strv[i], NULL, 10 ); ++ for (i = 0; i < nargs; i++) { ++ long int val = strtol(strv[i], NULL, 10); + +- if( errno ) { +- vips_error_system( errno, "input_intvec_init", +- _( "bad integer \"%s\"" ), strv[i] ); +- g_strfreev( strv ); +- return( -1 ); ++ if (errno) { ++ vips_error_system(errno, "input_intvec_init", ++ _("bad integer \"%s\""), strv[i]); ++ g_strfreev(strv); ++ return (-1); ++ } ++ if (INT_MAX < val || INT_MIN > val) { ++ vips_error("input_intvec_init", ++ "%ld overflows integer type", val); + } +- if( INT_MAX < val || INT_MIN > val ) { +- vips_error( "input_intvec_init", +- "%ld overflows integer type", val ); +- } + iv->vec[i] = (int) val; + } + +- g_strfreev( strv ); ++ g_strfreev(strv); + +- return( 0 ); ++ return (0); + } + + /* Input int vector type. + */ + im_type_desc im__input_intvec = { +- IM_TYPE_INTVEC, /* It's an array of int */ +- sizeof( im_intvec_object ), /* Memory to allocate in vec build */ +- IM_TYPE_ARG, /* It requires a command-line arg */ +- input_intvec_init, /* Init function */ +- intvec_dest /* Destroy function */ ++ IM_TYPE_INTVEC, /* It's an array of int */ ++ sizeof(im_intvec_object), /* Memory to allocate in vec build */ ++ IM_TYPE_ARG, /* It requires a command-line arg */ ++ input_intvec_init, /* Init function */ ++ intvec_dest /* Destroy function */ + }; + + /* Print function for intvec output. + */ + int +-im__ivprint( im_object obj ) ++im__ivprint(im_object obj) + { + im_intvec_object *iv = obj; + int i; + +- for( i = 0; i < iv->n; i++ ) +- printf( "%d ", iv->vec[i] ); +- printf( "\n" ); ++ for (i = 0; i < iv->n; i++) ++ printf("%d ", iv->vec[i]); ++ printf("\n"); + +- return( 0 ); ++ return (0); + } + + /* Output int vector type. + */ + im_type_desc im__output_intvec = { +- IM_TYPE_INTVEC, /* It's an array of int */ +- sizeof( im_intvec_object ), /* Memory to allocate in vec build */ +- IM_TYPE_OUTPUT, /* Output arg */ +- (im_init_obj_fn)NULL, /* Init function */ +- (im_dest_obj_fn)intvec_dest /* Destroy function */ ++ IM_TYPE_INTVEC, /* It's an array of int */ ++ sizeof(im_intvec_object), /* Memory to allocate in vec build */ ++ IM_TYPE_OUTPUT, /* Output arg */ ++ (im_init_obj_fn) NULL, /* Init function */ ++ (im_dest_obj_fn) intvec_dest /* Destroy function */ + }; + + /* Init function for int input. + */ + static int +-input_int_init( im_object *obj, char *str ) ++input_int_init(im_object *obj, char *str) + { + int *i = (int *) *obj; + +- if( sscanf( str, "%d", i ) != 1 ) { +- vips_error( "input_int", "%s", _( "bad format" ) ); +- return( -1 ); ++ if (sscanf(str, "%d", i) != 1) { ++ vips_error("input_int", "%s", _("bad format")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Input int type. + */ + im_type_desc im__input_int = { +- IM_TYPE_INT, /* It's an int */ +- sizeof( int ), /* Memory to allocate */ +- IM_TYPE_ARG, /* It requires a command-line arg */ +- input_int_init, /* Init function */ +- NULL /* Destroy function */ ++ IM_TYPE_INT, /* It's an int */ ++ sizeof(int), /* Memory to allocate */ ++ IM_TYPE_ARG, /* It requires a command-line arg */ ++ input_int_init, /* Init function */ ++ NULL /* Destroy function */ + }; + + /* Init function for string input. + */ + static int +-input_string_init( im_object *obj, char *str ) ++input_string_init(im_object *obj, char *str) + { +- if( !(*obj = (im_object) im_strdup( NULL, str )) ) +- return( -1 ); ++ if (!(*obj = (im_object) im_strdup(NULL, str))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Input string type. + */ + im_type_desc im__input_string = { +- IM_TYPE_STRING, /* It's a string */ +- 0, /* Memory to allocate */ +- IM_TYPE_ARG, /* It requires a command-line arg */ +- input_string_init, /* Init function */ +- vips_free /* Destroy function */ ++ IM_TYPE_STRING, /* It's a string */ ++ 0, /* Memory to allocate */ ++ IM_TYPE_ARG, /* It requires a command-line arg */ ++ input_string_init, /* Init function */ ++ vips_free /* Destroy function */ + }; + + /* Output string type. + */ + im_type_desc im__output_string = { +- IM_TYPE_STRING, /* It's a string */ ++ IM_TYPE_STRING, /* It's a string */ + 0, /* Memory to allocate */ +- IM_TYPE_OUTPUT, /* It's an output argument */ +- NULL, /* Init function */ +- vips_free /* Destroy function */ ++ IM_TYPE_OUTPUT, /* It's an output argument */ ++ NULL, /* Init function */ ++ vips_free /* Destroy function */ + }; + + /* Output double type. + */ + im_type_desc im__output_double = { +- IM_TYPE_DOUBLE, /* It's a double */ +- sizeof( double ), /* Memory to allocate */ +- IM_TYPE_OUTPUT, /* It's an output argument */ +- NULL, /* Init function */ +- NULL /* Destroy function */ ++ IM_TYPE_DOUBLE, /* It's a double */ ++ sizeof(double), /* Memory to allocate */ ++ IM_TYPE_OUTPUT, /* It's an output argument */ ++ NULL, /* Init function */ ++ NULL /* Destroy function */ + }; + + /* Output complex type. + */ + im_type_desc im__output_complex = { +- IM_TYPE_COMPLEX, /* It's a complex */ +- 2 * sizeof( double ), /* Memory to allocate */ +- IM_TYPE_OUTPUT, /* It's an output argument */ ++ IM_TYPE_COMPLEX, /* It's a complex */ ++ 2 * sizeof(double), /* Memory to allocate */ ++ IM_TYPE_OUTPUT, /* It's an output argument */ + NULL, /* Init function */ + NULL /* Destroy function */ + }; +@@ -638,87 +638,87 @@ im_type_desc im__output_complex = { + /* Output int type. + */ + im_type_desc im__output_int = { +- IM_TYPE_INT, /* It's an int */ +- sizeof( int ), /* Memory to allocate */ +- IM_TYPE_OUTPUT, /* It's an output argument */ +- NULL, /* Init function */ +- NULL /* Destroy function */ ++ IM_TYPE_INT, /* It's an int */ ++ sizeof(int), /* Memory to allocate */ ++ IM_TYPE_OUTPUT, /* It's an output argument */ ++ NULL, /* Init function */ ++ NULL /* Destroy function */ + }; + + /* Print function for int output. + */ + int +-im__iprint( im_object obj ) ++im__iprint(im_object obj) + { + int *i = (int *) obj; + +- printf( "%d\n", *i ); ++ printf("%d\n", *i); + +- return( 0 ); ++ return (0); + } + + /* Print function for string output. + */ + int +-im__sprint( im_object obj ) ++im__sprint(im_object obj) + { + char *s = (char *) obj; + +- printf( "%s\n", s ); ++ printf("%s\n", s); + +- return( 0 ); ++ return (0); + } + + /* Print function for double output. + */ + int +-im__dprint( im_object obj ) ++im__dprint(im_object obj) + { + double *d = (double *) obj; + +- printf( "%G\n", *d ); ++ printf("%G\n", *d); + +- return( 0 ); ++ return (0); + } + + /* Print function for complex output. + */ + int +-im__cprint( im_object obj ) ++im__cprint(im_object obj) + { + double *d = (double *) obj; + +- printf( "%G %G\n", d[0], d[1] ); ++ printf("%G %G\n", d[0], d[1]); + +- return( 0 ); ++ return (0); + } + + /* Statistics to stdout. + */ + int +-im__dmsprint( im_object obj ) ++im__dmsprint(im_object obj) + { + DOUBLEMASK *mask = ((im_mask_object *) obj)->mask; + double *row; + int i, j; + +- /* Print statistics band stats eg: 2 bands:b 0,1 ++ /* Print statistics band stats eg: 2 bands:b 0,1 + */ +- printf( "band minimum maximum sum " +- "sum^2 mean deviation\n" ); +- for( j = 0; j < mask->ysize; j++ ) { ++ printf("band minimum maximum sum " ++ "sum^2 mean deviation\n"); ++ for (j = 0; j < mask->ysize; j++) { + row = mask->coeff + j * mask->xsize; +- if( j == 0 ) +- printf( "all" ); ++ if (j == 0) ++ printf("all"); + else +- printf( "%2d ", j ); ++ printf("%2d ", j); + +- for( i = 0; i < 6; i++ ) +- printf( "%12g", row[i] ); +- printf( "\n" ); ++ for (i = 0; i < 6; i++) ++ printf("%12g", row[i]); ++ printf("\n"); + } + +- return( 0 ); ++ return (0); + } + + /* GValue +@@ -728,71 +728,71 @@ im__dmsprint( im_object obj ) + * whatever later. + */ + static int +-input_gvalue_init( im_object *obj, char *str ) ++input_gvalue_init(im_object *obj, char *str) + { + GValue *value = *obj; + +- g_value_init( value, G_TYPE_STRING ); +- g_value_set_string( value, str ); ++ g_value_init(value, G_TYPE_STRING); ++ g_value_set_string(value, str); + +- return( 0 ); ++ return (0); + } + + static int +-gvalue_free( im_object obj ) ++gvalue_free(im_object obj) + { + GValue *value = obj; + + /* If it's just zeros (built but not used) we'll get an error if we + * unset(). + */ +- if( G_IS_VALUE( value ) ) +- g_value_unset( value ); ++ if (G_IS_VALUE(value)) ++ g_value_unset(value); + +- return( 0 ); ++ return (0); + } + + /* Input GValue type. + */ + im_type_desc im__input_gvalue = { +- IM_TYPE_GVALUE, +- sizeof( GValue ), /* Need some storage */ +- IM_TYPE_ARG, /* It requires a command-line arg */ +- (im_init_obj_fn) input_gvalue_init, /* Init function */ +- (im_dest_obj_fn) gvalue_free /* Destroy function */ ++ IM_TYPE_GVALUE, ++ sizeof(GValue), /* Need some storage */ ++ IM_TYPE_ARG, /* It requires a command-line arg */ ++ (im_init_obj_fn) input_gvalue_init, /* Init function */ ++ (im_dest_obj_fn) gvalue_free /* Destroy function */ + }; + + int +-im__gprint( im_object obj ) ++im__gprint(im_object obj) + { + GValue *value = obj; + char *str_value; + +- str_value = g_strdup_value_contents( value ); +- printf( "%s\n", str_value ); +- g_free( str_value ); ++ str_value = g_strdup_value_contents(value); ++ printf("%s\n", str_value); ++ g_free(str_value); + +- return( 0 ); ++ return (0); + } + + /* Init function for output gvalue. Just init to zero. + */ + static int +-output_gvalue_init( im_object *obj ) ++output_gvalue_init(im_object *obj) + { + GValue *value = *obj; + +- memset( value, 0, sizeof( GValue ) ); ++ memset(value, 0, sizeof(GValue)); + +- return( 0 ); ++ return (0); + } + + im_type_desc im__output_gvalue = { +- IM_TYPE_GVALUE, +- sizeof( GValue ), /* Need some storage */ +- IM_TYPE_OUTPUT, /* No arg needed (just print) */ +- (im_init_obj_fn) output_gvalue_init, /* Init function */ +- (im_dest_obj_fn) gvalue_free /* Destroy function */ ++ IM_TYPE_GVALUE, ++ sizeof(GValue), /* Need some storage */ ++ IM_TYPE_OUTPUT, /* No arg needed (just print) */ ++ (im_init_obj_fn) output_gvalue_init, /* Init function */ ++ (im_dest_obj_fn) gvalue_free /* Destroy function */ + }; + + /* Init function for input interpolate. +@@ -800,38 +800,37 @@ im_type_desc im__output_gvalue = { + * This is used as a helper function by the C++ interface, so amke it public. + */ + int +-vips__input_interpolate_init( im_object *obj, char *str ) ++vips__input_interpolate_init(im_object *obj, char *str) + { +- GType type = g_type_from_name( "VipsInterpolate" ); +- VipsObjectClass *class = VIPS_OBJECT_CLASS( g_type_class_ref( type ) ); ++ GType type = g_type_from_name("VipsInterpolate"); ++ VipsObjectClass *class = VIPS_OBJECT_CLASS(g_type_class_ref(type)); + VipsObject *object; + +- g_assert( class ); ++ g_assert(class); + +- if( !(object = vips_object_new_from_string( class, str )) ) +- return( -1 ); +- if( vips_object_build( object ) ) { +- g_object_unref( object ); +- return( -1 ); ++ if (!(object = vips_object_new_from_string(class, str))) ++ return (-1); ++ if (vips_object_build(object)) { ++ g_object_unref(object); ++ return (-1); + } + *obj = object; + +- return( 0 ); ++ return (0); + } + + static int +-input_interpolate_dest( im_object obj ) ++input_interpolate_dest(im_object obj) + { +- g_object_unref( (GObject *) obj ); ++ g_object_unref((GObject *) obj); + +- return( 0 ); ++ return (0); + } + + im_type_desc im__input_interpolate = { +- IM_TYPE_INTERPOLATE, +- 0, /* No storage required */ +- IM_TYPE_ARG, /* It requires a command-line arg */ +- vips__input_interpolate_init, /* Init function */ +- input_interpolate_dest /* Destroy function */ ++ IM_TYPE_INTERPOLATE, ++ 0, /* No storage required */ ++ IM_TYPE_ARG, /* It requires a command-line arg */ ++ vips__input_interpolate_init, /* Init function */ ++ input_interpolate_dest /* Destroy function */ + }; +- +diff --git a/libvips/deprecated/fits.c b/libvips/deprecated/fits.c +index ac91294e70..425c8ada35 100644 +--- a/libvips/deprecated/fits.c ++++ b/libvips/deprecated/fits.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -46,34 +46,34 @@ + #include + + int +-im_fits2vips( const char *filename, VipsImage *out ) ++im_fits2vips(const char *filename, VipsImage *out) + { + VipsImage *t; + +- if( vips_fitsload( filename, &t, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_fitsload(filename, &t, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + int +-im_vips2fits( VipsImage *in, const char *filename ) ++im_vips2fits(VipsImage *in, const char *filename) + { +- if( vips_fitssave( in, filename, NULL ) ) +- return( -1 ); ++ if (vips_fitssave(in, filename, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-isfits( const char *name ) ++isfits(const char *name) + { +- return( vips_foreign_is_a( "fitsload", name ) ); ++ return (vips_foreign_is_a("fitsload", name)); + } + + static const char *fits_suffs[] = { ".fits", NULL }; +@@ -84,13 +84,13 @@ typedef VipsFormat VipsFormatFits; + typedef VipsFormatClass VipsFormatFitsClass; + + static void +-vips_format_fits_class_init( VipsFormatFitsClass *class ) ++vips_format_fits_class_init(VipsFormatFitsClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsFormatClass *format_class = (VipsFormatClass *) class; + + object_class->nickname = "fits"; +- object_class->description = _( "FITS" ); ++ object_class->description = _("FITS"); + + format_class->is_a = isfits; + format_class->load = im_fits2vips; +@@ -99,9 +99,8 @@ vips_format_fits_class_init( VipsFormatFitsClass *class ) + } + + static void +-vips_format_fits_init( VipsFormatFits *object ) ++vips_format_fits_init(VipsFormatFits *object) + { + } + +-G_DEFINE_TYPE( VipsFormatFits, vips_format_fits, VIPS_TYPE_FORMAT ); +- ++G_DEFINE_TYPE(VipsFormatFits, vips_format_fits, VIPS_TYPE_FORMAT); +diff --git a/libvips/deprecated/format.c b/libvips/deprecated/format.c +index 753c92d7aa..866f540ff6 100644 +--- a/libvips/deprecated/format.c ++++ b/libvips/deprecated/format.c +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -39,25 +39,25 @@ + #include + #include + +-/* To iterate over supported formats, we build a temp list of subclasses of ++/* To iterate over supported formats, we build a temp list of subclasses of + * VipsFormat, sort by priority, iterate, and free. + */ + + static void * +-format_add_class( VipsFormatClass *format, GSList **formats ) ++format_add_class(VipsFormatClass *format, GSList **formats) + { +- if( !G_TYPE_IS_ABSTRACT( G_OBJECT_CLASS_TYPE( format ) ) ) ++ if (!G_TYPE_IS_ABSTRACT(G_OBJECT_CLASS_TYPE(format))) + /* Append so we don't reverse the list of formats. + */ +- *formats = g_slist_append( *formats, format ); ++ *formats = g_slist_append(*formats, format); + +- return( NULL ); ++ return (NULL); + } + + static gint +-format_compare( VipsFormatClass *a, VipsFormatClass *b ) ++format_compare(VipsFormatClass *a, VipsFormatClass *b) + { +- return( b->priority - a->priority ); ++ return (b->priority - a->priority); + } + + /** +@@ -67,7 +67,7 @@ format_compare( VipsFormatClass *a, VipsFormatClass *b ) + * @b: user data + * + * Apply a function to every %VipsFormatClass that VIPS knows about. Formats +- * are presented to the function in priority order. ++ * are presented to the function in priority order. + * + * Like all VIPS map functions, if @fn returns %NULL, iteration continues. If + * it returns non-%NULL, iteration terminates and that value is returned. The +@@ -78,67 +78,66 @@ format_compare( VipsFormatClass *a, VipsFormatClass *b ) + * Returns: the result of iteration + */ + void * +-vips_format_map( VSListMap2Fn fn, void *a, void *b ) ++vips_format_map(VSListMap2Fn fn, void *a, void *b) + { + GSList *formats; + void *result; + + formats = NULL; +- (void) vips_class_map_all( g_type_from_name( "VipsFormat" ), +- (VipsClassMapFn) format_add_class, (void *) &formats ); ++ (void) vips_class_map_all(g_type_from_name("VipsFormat"), ++ (VipsClassMapFn) format_add_class, (void *) &formats); + +- formats = g_slist_sort( formats, (GCompareFunc) format_compare ); +- result = im_slist_map2( formats, fn, a, b ); +- g_slist_free( formats ); ++ formats = g_slist_sort(formats, (GCompareFunc) format_compare); ++ result = im_slist_map2(formats, fn, a, b); ++ g_slist_free(formats); + +- return( result ); ++ return (result); + } + + /* Abstract base class for image formats. + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsFormat, vips_format, VIPS_TYPE_OBJECT ); ++G_DEFINE_ABSTRACT_TYPE(VipsFormat, vips_format, VIPS_TYPE_OBJECT); + + static void +-vips_format_summary_class( VipsObjectClass *object_class, VipsBuf *buf ) ++vips_format_summary_class(VipsObjectClass *object_class, VipsBuf *buf) + { +- VipsFormatClass *class = VIPS_FORMAT_CLASS( object_class ); ++ VipsFormatClass *class = VIPS_FORMAT_CLASS(object_class); + +- VIPS_OBJECT_CLASS( vips_format_parent_class )-> +- summary_class( object_class, buf ); +- vips_buf_appends( buf, ", " ); ++ VIPS_OBJECT_CLASS(vips_format_parent_class)->summary_class(object_class, buf); ++ vips_buf_appends(buf, ", "); + +- if( class->suffs ) { ++ if (class->suffs) { + const char **p; + +- vips_buf_appends( buf, "(" ); +- for( p = class->suffs; *p; p++ ) { +- vips_buf_appendf( buf, "%s", *p ); +- if( p[1] ) +- vips_buf_appends( buf, ", " ); ++ vips_buf_appends(buf, "("); ++ for (p = class->suffs; *p; p++) { ++ vips_buf_appendf(buf, "%s", *p); ++ if (p[1]) ++ vips_buf_appends(buf, ", "); + } +- vips_buf_appends( buf, ") " ); ++ vips_buf_appends(buf, ") "); + } + +- if( class->is_a ) +- vips_buf_appends( buf, "is_a " ); +- if( class->header ) +- vips_buf_appends( buf, "header " ); +- if( class->load ) +- vips_buf_appends( buf, "load " ); +- if( class->save ) +- vips_buf_appends( buf, "save " ); +- if( class->get_flags ) +- vips_buf_appends( buf, "get_flags " ); ++ if (class->is_a) ++ vips_buf_appends(buf, "is_a "); ++ if (class->header) ++ vips_buf_appends(buf, "header "); ++ if (class->load) ++ vips_buf_appends(buf, "load "); ++ if (class->save) ++ vips_buf_appends(buf, "save "); ++ if (class->get_flags) ++ vips_buf_appends(buf, "get_flags "); + } + + static void +-vips_format_class_init( VipsFormatClass *class ) ++vips_format_class_init(VipsFormatClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + + object_class->nickname = "format"; +- object_class->description = _( "VIPS file formats" ); ++ object_class->description = _("VIPS file formats"); + object_class->summary_class = vips_format_summary_class; + + /* Hide from UI. +@@ -147,7 +146,7 @@ vips_format_class_init( VipsFormatClass *class ) + } + + static void +-vips_format_init( VipsFormat *object ) ++vips_format_init(VipsFormat *object) + { + } + +@@ -156,14 +155,14 @@ vips_format_init( VipsFormat *object ) + * @format: format to test + * @filename: file to test + * +- * Get a set of flags for this file. ++ * Get a set of flags for this file. + * + * Returns: flags for this format and file + */ + VipsFormatFlags +-vips_format_get_flags( VipsFormatClass *format, const char *filename ) ++vips_format_get_flags(VipsFormatClass *format, const char *filename) + { +- return( format->get_flags ? format->get_flags( filename ) : 0 ); ++ return (format->get_flags ? format->get_flags(filename) : 0); + } + + /* VIPS format class. +@@ -172,54 +171,54 @@ vips_format_get_flags( VipsFormatClass *format, const char *filename ) + static const char *vips_suffs[] = { ".v", ".vips", NULL }; + + int +-im_isvips( const char *filename ) ++im_isvips(const char *filename) + { + unsigned char buf[4]; + +- if( im__get_bytes( filename, buf, 4 ) == 4 ) { +- if( buf[0] == 0x08 && buf[1] == 0xf2 && +- buf[2] == 0xa6 && buf[3] == 0xb6 ) ++ if (im__get_bytes(filename, buf, 4) == 4) { ++ if (buf[0] == 0x08 && buf[1] == 0xf2 && ++ buf[2] == 0xa6 && buf[3] == 0xb6) + /* SPARC-order VIPS image. + */ +- return( 1 ); +- else if( buf[3] == 0x08 && buf[2] == 0xf2 && +- buf[1] == 0xa6 && buf[0] == 0xb6 ) ++ return (1); ++ else if (buf[3] == 0x08 && buf[2] == 0xf2 && ++ buf[1] == 0xa6 && buf[0] == 0xb6) + /* INTEL-order VIPS image. + */ +- return( 1 ); ++ return (1); + } + +- return( 0 ); ++ return (0); + } + + static int +-file2vips( const char *filename, IMAGE *out ) ++file2vips(const char *filename, IMAGE *out) + { + IMAGE *im; + +- if( !(im = im_open_local( out, filename, "r" )) || +- im_copy( im, out ) ) +- return( -1 ); ++ if (!(im = im_open_local(out, filename, "r")) || ++ im_copy(im, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static VipsFormatFlags +-vips_flags( const char *filename ) ++vips_flags(const char *filename) + { + VipsFormatFlags flags; + unsigned char buf[4]; + + flags = VIPS_FORMAT_PARTIAL; + +- if( im__get_bytes( filename, buf, 4 ) == 4 && +- buf[0] == 0x08 && ++ if (im__get_bytes(filename, buf, 4) == 4 && ++ buf[0] == 0x08 && + buf[1] == 0xf2 && +- buf[2] == 0xa6 && +- buf[3] == 0xb6 ) ++ buf[2] == 0xa6 && ++ buf[3] == 0xb6) + flags |= VIPS_FORMAT_BIGENDIAN; + +- return( flags ); ++ return (flags); + } + + /* Vips format adds no new members. +@@ -228,19 +227,19 @@ typedef VipsFormat VipsFormatVips; + typedef VipsFormatClass VipsFormatVipsClass; + + static int +-vips_format_vips_save( VipsImage *image, const char *filename ) ++vips_format_vips_save(VipsImage *image, const char *filename) + { +- return( vips_image_write_to_file( image, filename, NULL ) ); ++ return (vips_image_write_to_file(image, filename, NULL)); + } + + static void +-vips_format_vips_class_init( VipsFormatVipsClass *class ) ++vips_format_vips_class_init(VipsFormatVipsClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsFormatClass *format_class = (VipsFormatClass *) class; + + object_class->nickname = "vips"; +- object_class->description = _( "VIPS" ); ++ object_class->description = _("VIPS"); + + format_class->priority = 200; + format_class->is_a = im_isvips; +@@ -252,79 +251,79 @@ vips_format_vips_class_init( VipsFormatVipsClass *class ) + } + + static void +-vips_format_vips_init( VipsFormatVips *object ) ++vips_format_vips_init(VipsFormatVips *object) + { + } + +-G_DEFINE_TYPE( VipsFormatVips, vips_format_vips, VIPS_TYPE_FORMAT ); ++G_DEFINE_TYPE(VipsFormatVips, vips_format_vips, VIPS_TYPE_FORMAT); + + /* Called on startup: register the base vips formats. + */ + void +-im__format_init( void ) ++im__format_init(void) + { +- extern GType vips_format_csv_get_type( void ); +- extern GType vips_format_ppm_get_type( void ); +- extern GType vips_format_analyze_get_type( void ); +- extern GType vips_format_rad_get_type( void ); ++ extern GType vips_format_csv_get_type(void); ++ extern GType vips_format_ppm_get_type(void); ++ extern GType vips_format_analyze_get_type(void); ++ extern GType vips_format_rad_get_type(void); + + vips_format_vips_get_type(); + #ifdef HAVE_JPEG +- extern GType vips_format_jpeg_get_type( void ); ++ extern GType vips_format_jpeg_get_type(void); + vips_format_jpeg_get_type(); + #endif /*HAVE_JPEG*/ + #ifdef HAVE_PNG +- extern GType vips_format_png_get_type( void ); ++ extern GType vips_format_png_get_type(void); + vips_format_png_get_type(); + #endif /*HAVE_PNG*/ + #ifdef HAVE_LIBWEBP +- extern GType vips_format_webp_get_type( void ); ++ extern GType vips_format_webp_get_type(void); + vips_format_webp_get_type(); + #endif /*HAVE_LIBWEBP*/ + vips_format_csv_get_type(); + vips_format_ppm_get_type(); + vips_format_analyze_get_type(); + #ifdef HAVE_OPENEXR +- extern GType vips_format_exr_get_type( void ); ++ extern GType vips_format_exr_get_type(void); + vips_format_exr_get_type(); + #endif /*HAVE_OPENEXR*/ + #ifdef HAVE_MATIO +- extern GType vips_format_mat_get_type( void ); ++ extern GType vips_format_mat_get_type(void); + vips_format_mat_get_type(); + #endif /*HAVE_MATIO*/ + #ifdef HAVE_CFITSIO +- extern GType vips_format_fits_get_type( void ); ++ extern GType vips_format_fits_get_type(void); + vips_format_fits_get_type(); + #endif /*HAVE_CFITSIO*/ + vips_format_rad_get_type(); + #ifdef HAVE_MAGICK +- extern GType vips_format_magick_get_type( void ); ++ extern GType vips_format_magick_get_type(void); + vips_format_magick_get_type(); + #endif /*HAVE_MAGICK*/ + #ifdef HAVE_TIFF +- extern GType vips_format_tiff_get_type( void ); ++ extern GType vips_format_tiff_get_type(void); + vips_format_tiff_get_type(); + #endif /*HAVE_TIFF*/ +- extern GType vips_format_openslide_get_type( void ); ++ extern GType vips_format_openslide_get_type(void); + vips_format_openslide_get_type(); +- extern GType vips_format_nifti_get_type( void ); ++ extern GType vips_format_nifti_get_type(void); + vips_format_nifti_get_type(); + } + + /* Can this format open this file? + */ + static void * +-format_for_file_sub( VipsFormatClass *format, +- const char *name, const char *filename ) ++format_for_file_sub(VipsFormatClass *format, ++ const char *name, const char *filename) + { +- if( format->is_a ) { +- if( format->is_a( filename ) ) +- return( format ); ++ if (format->is_a) { ++ if (format->is_a(filename)) ++ return (format); + } +- else if( im_filename_suffix_match( filename, format->suffs ) ) +- return( format ); ++ else if (im_filename_suffix_match(filename, format->suffs)) ++ return (format); + +- return( NULL ); ++ return (NULL); + } + + /** +@@ -338,44 +337,44 @@ format_for_file_sub( VipsFormatClass *format, + * Returns: a format on success, %NULL on error + */ + VipsFormatClass * +-vips_format_for_file( const char *filename ) ++vips_format_for_file(const char *filename) + { + char name[FILENAME_MAX]; + char options[FILENAME_MAX]; + VipsFormatClass *format; + +- /* Break any options off the name ... eg. "fred.tif:jpeg,tile" ++ /* Break any options off the name ... eg. "fred.tif:jpeg,tile" + * etc. + */ +- im_filename_split( filename, name, options ); ++ im_filename_split(filename, name, options); + +- if( !im_existsf( "%s", name ) ) { +- im_error( "VipsFormat", _( "file \"%s\" not found" ), name ); +- return( NULL ); ++ if (!im_existsf("%s", name)) { ++ im_error("VipsFormat", _("file \"%s\" not found"), name); ++ return (NULL); + } + +- if( !(format = (VipsFormatClass *) vips_format_map( +- (VSListMap2Fn) format_for_file_sub, +- (void *) filename, (void *) name )) ) { +- im_error( "VipsFormat", +- _( "file \"%s\" not a known format" ), name ); +- return( NULL ); ++ if (!(format = (VipsFormatClass *) vips_format_map( ++ (VSListMap2Fn) format_for_file_sub, ++ (void *) filename, (void *) name))) { ++ im_error("VipsFormat", ++ _("file \"%s\" not a known format"), name); ++ return (NULL); + } + +- return( format ); ++ return (format); + } + + /* Can we write this filename with this format? Ignore formats without a save + * method. + */ + static void * +-format_for_name_sub( VipsFormatClass *format, const char *name ) ++format_for_name_sub(VipsFormatClass *format, const char *name) + { +- if( format->save && +- im_filename_suffix_match( name, format->suffs ) ) +- return( format ); ++ if (format->save && ++ im_filename_suffix_match(name, format->suffs)) ++ return (format); + +- return( NULL ); ++ return (NULL); + } + + /** +@@ -389,21 +388,21 @@ format_for_name_sub( VipsFormatClass *format, const char *name ) + * Returns: a format on success, %NULL on error + */ + VipsFormatClass * +-vips_format_for_name( const char *filename ) ++vips_format_for_name(const char *filename) + { + VipsFormatClass *format; + +- if( !(format = (VipsFormatClass *) vips_format_map( +- (VSListMap2Fn) format_for_name_sub, +- (void *) filename, NULL )) ) { +- im_error( "VipsFormat", +- _( "\"%s\" is not a supported image format." ), +- filename ); ++ if (!(format = (VipsFormatClass *) vips_format_map( ++ (VSListMap2Fn) format_for_name_sub, ++ (void *) filename, NULL))) { ++ im_error("VipsFormat", ++ _("\"%s\" is not a supported image format."), ++ filename); + +- return( NULL ); ++ return (NULL); + } + +- return( format ); ++ return (format); + } + + /** +@@ -418,15 +417,15 @@ vips_format_for_name( const char *filename ) + * Returns: 0 on success, -1 on error + */ + int +-vips_format_read( const char *filename, IMAGE *out ) ++vips_format_read(const char *filename, IMAGE *out) + { + VipsFormatClass *format; + +- if( !(format = vips_format_for_file( filename )) || +- format->load( filename, out ) ) +- return( -1 ); ++ if (!(format = vips_format_for_file(filename)) || ++ format->load(filename, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /** +@@ -441,13 +440,13 @@ vips_format_read( const char *filename, IMAGE *out ) + * Returns: 0 on success, -1 on error + */ + int +-vips_format_write( IMAGE *in, const char *filename ) ++vips_format_write(IMAGE *in, const char *filename) + { + VipsFormatClass *format; + +- if( !(format = vips_format_for_name( filename )) || +- format->save( in, filename ) ) +- return( -1 ); ++ if (!(format = vips_format_for_name(filename)) || ++ format->save(in, filename)) ++ return (-1); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/deprecated/format_dispatch.c b/libvips/deprecated/format_dispatch.c +index c463729d70..8bcb9fc521 100644 +--- a/libvips/deprecated/format_dispatch.c ++++ b/libvips/deprecated/format_dispatch.c +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -39,404 +39,404 @@ + #include + + static int +-jpeg2vips_vec( im_object *argv ) ++jpeg2vips_vec(im_object *argv) + { + char *in = argv[0]; + IMAGE *out = argv[1]; + +- if( im_jpeg2vips( in, out ) ) +- return( -1 ); ++ if (im_jpeg2vips(in, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static im_arg_desc jpeg2vips_args[] = { +- IM_INPUT_STRING( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_STRING("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + static im_function jpeg2vips_desc = { +- "im_jpeg2vips", /* Name */ +- "convert from jpeg", /* Description */ +- 0, /* Flags */ +- jpeg2vips_vec, /* Dispatch function */ +- IM_NUMBER( jpeg2vips_args ), /* Size of arg list */ +- jpeg2vips_args /* Arg list */ ++ "im_jpeg2vips", /* Name */ ++ "convert from jpeg", /* Description */ ++ 0, /* Flags */ ++ jpeg2vips_vec, /* Dispatch function */ ++ IM_NUMBER(jpeg2vips_args), /* Size of arg list */ ++ jpeg2vips_args /* Arg list */ + }; + + static int +-vips2dz_vec( im_object *argv ) ++vips2dz_vec(im_object *argv) + { + IMAGE *in = argv[0]; + char *out = argv[1]; + +- if( im_vips2dz( in, out ) ) +- return( -1 ); ++ if (im_vips2dz(in, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static im_arg_desc vips2dz_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_INPUT_STRING( "out" ) ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_STRING("out") + }; + + static im_function vips2dz_desc = { +- "im_vips2dz", /* Name */ +- "save as deepzoom", /* Description */ +- 0, /* Flags */ +- vips2dz_vec, /* Dispatch function */ +- IM_NUMBER( vips2dz_args ), /* Size of arg list */ +- vips2dz_args /* Arg list */ ++ "im_vips2dz", /* Name */ ++ "save as deepzoom", /* Description */ ++ 0, /* Flags */ ++ vips2dz_vec, /* Dispatch function */ ++ IM_NUMBER(vips2dz_args), /* Size of arg list */ ++ vips2dz_args /* Arg list */ + }; + + static int +-vips2jpeg_vec( im_object *argv ) ++vips2jpeg_vec(im_object *argv) + { + IMAGE *in = argv[0]; + char *out = argv[1]; + +- if( im_vips2jpeg( in, out ) ) +- return( -1 ); ++ if (im_vips2jpeg(in, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static im_arg_desc vips2jpeg_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_INPUT_STRING( "out" ) ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_STRING("out") + }; + + static im_function vips2jpeg_desc = { +- "im_vips2jpeg", /* Name */ +- "convert to jpeg", /* Description */ +- 0, /* Flags */ +- vips2jpeg_vec, /* Dispatch function */ +- IM_NUMBER( vips2jpeg_args ), /* Size of arg list */ +- vips2jpeg_args /* Arg list */ ++ "im_vips2jpeg", /* Name */ ++ "convert to jpeg", /* Description */ ++ 0, /* Flags */ ++ vips2jpeg_vec, /* Dispatch function */ ++ IM_NUMBER(vips2jpeg_args), /* Size of arg list */ ++ vips2jpeg_args /* Arg list */ + }; + + static int +-vips2mimejpeg_vec( im_object *argv ) ++vips2mimejpeg_vec(im_object *argv) + { + IMAGE *in = argv[0]; + int qfac = *((int *) argv[1]); + +- if( im_vips2mimejpeg( in, qfac ) ) +- return( -1 ); ++ if (im_vips2mimejpeg(in, qfac)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static im_arg_desc vips2mimejpeg_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_INPUT_INT( "qfac" ) ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_INT("qfac") + }; + + static im_function vips2mimejpeg_desc = { +- "im_vips2mimejpeg", /* Name */ ++ "im_vips2mimejpeg", /* Name */ + "convert to jpeg as mime type on stdout", /* Description */ +- 0, /* Flags */ +- vips2mimejpeg_vec, /* Dispatch function */ +- IM_NUMBER( vips2mimejpeg_args ), /* Size of arg list */ +- vips2mimejpeg_args /* Arg list */ ++ 0, /* Flags */ ++ vips2mimejpeg_vec, /* Dispatch function */ ++ IM_NUMBER(vips2mimejpeg_args), /* Size of arg list */ ++ vips2mimejpeg_args /* Arg list */ + }; + + /* Args for vips2png. + */ + static im_arg_desc vips2png_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_INPUT_STRING( "out" ) ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_STRING("out") + }; + + /* Call im_vips2png via arg vector. + */ + static int +-vips2png_vec( im_object *argv ) ++vips2png_vec(im_object *argv) + { +- return( im_vips2png( argv[0], argv[1] ) ); ++ return (im_vips2png(argv[0], argv[1])); + } + + /* Description of im_vips2png. + */ + static im_function vips2png_desc = { +- "im_vips2png", /* Name */ ++ "im_vips2png", /* Name */ + "convert VIPS image to PNG file", /* Description */ + 0, +- vips2png_vec, /* Dispatch function */ +- IM_NUMBER( vips2png_args ), /* Size of arg list */ +- vips2png_args /* Arg list */ ++ vips2png_vec, /* Dispatch function */ ++ IM_NUMBER(vips2png_args), /* Size of arg list */ ++ vips2png_args /* Arg list */ + }; + + /* Args for png2vips. + */ + static im_arg_desc png2vips_args[] = { +- IM_INPUT_STRING( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_STRING("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Call im_png2vips via arg vector. + */ + static int +-png2vips_vec( im_object *argv ) ++png2vips_vec(im_object *argv) + { +- return( im_png2vips( argv[0], argv[1] ) ); ++ return (im_png2vips(argv[0], argv[1])); + } + + /* Description of im_png2vips. + */ + static im_function png2vips_desc = { +- "im_png2vips", /* Name */ ++ "im_png2vips", /* Name */ + "convert PNG file to VIPS image", /* Description */ + 0, +- png2vips_vec, /* Dispatch function */ +- IM_NUMBER( png2vips_args ), /* Size of arg list */ +- png2vips_args /* Arg list */ ++ png2vips_vec, /* Dispatch function */ ++ IM_NUMBER(png2vips_args), /* Size of arg list */ ++ png2vips_args /* Arg list */ + }; + + /* Args for exr2vips. + */ + static im_arg_desc exr2vips_args[] = { +- IM_INPUT_STRING( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_STRING("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Call im_exr2vips via arg vector. + */ + static int +-exr2vips_vec( im_object *argv ) ++exr2vips_vec(im_object *argv) + { +- return( im_exr2vips( argv[0], argv[1] ) ); ++ return (im_exr2vips(argv[0], argv[1])); + } + + /* Description of im_exr2vips. + */ + static im_function exr2vips_desc = { +- "im_exr2vips", /* Name */ ++ "im_exr2vips", /* Name */ + "convert an OpenEXR file to VIPS", /* Description */ + 0, +- exr2vips_vec, /* Dispatch function */ +- IM_NUMBER( exr2vips_args ), /* Size of arg list */ +- exr2vips_args /* Arg list */ ++ exr2vips_vec, /* Dispatch function */ ++ IM_NUMBER(exr2vips_args), /* Size of arg list */ ++ exr2vips_args /* Arg list */ + }; + + /* Args for vips2tiff. + */ + static im_arg_desc vips2tiff_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_INPUT_STRING( "out" ) ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_STRING("out") + }; + + /* Call im_vips2tiff via arg vector. + */ + static int +-vips2tiff_vec( im_object *argv ) ++vips2tiff_vec(im_object *argv) + { +- return( im_vips2tiff( argv[0], argv[1] ) ); ++ return (im_vips2tiff(argv[0], argv[1])); + } + + /* Description of im_vips2tiff. + */ + static im_function vips2tiff_desc = { +- "im_vips2tiff", /* Name */ ++ "im_vips2tiff", /* Name */ + "convert VIPS image to TIFF file", /* Description */ + 0, +- vips2tiff_vec, /* Dispatch function */ +- IM_NUMBER( vips2tiff_args ), /* Size of arg list */ +- vips2tiff_args /* Arg list */ ++ vips2tiff_vec, /* Dispatch function */ ++ IM_NUMBER(vips2tiff_args), /* Size of arg list */ ++ vips2tiff_args /* Arg list */ + }; + + /* Args for magick2vips. + */ + static im_arg_desc magick2vips_args[] = { +- IM_INPUT_STRING( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_STRING("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Call im_magick2vips via arg vector. + */ + static int +-magick2vips_vec( im_object *argv ) ++magick2vips_vec(im_object *argv) + { +- return( im_magick2vips( argv[0], argv[1] ) ); ++ return (im_magick2vips(argv[0], argv[1])); + } + + /* Description of im_magick2vips. + */ + static im_function magick2vips_desc = { +- "im_magick2vips", /* Name */ +- "load file with libMagick", /* Description */ ++ "im_magick2vips", /* Name */ ++ "load file with libMagick", /* Description */ + 0, +- magick2vips_vec, /* Dispatch function */ +- IM_NUMBER( magick2vips_args ), /* Size of arg list */ +- magick2vips_args /* Arg list */ ++ magick2vips_vec, /* Dispatch function */ ++ IM_NUMBER(magick2vips_args), /* Size of arg list */ ++ magick2vips_args /* Arg list */ + }; + + /* Args for tiff2vips. + */ + static im_arg_desc tiff2vips_args[] = { +- IM_INPUT_STRING( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_STRING("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Call im_tiff2vips via arg vector. + */ + static int +-tiff2vips_vec( im_object *argv ) ++tiff2vips_vec(im_object *argv) + { +- return( im_tiff2vips( argv[0], argv[1] ) ); ++ return (im_tiff2vips(argv[0], argv[1])); + } + + /* Description of im_tiff2vips. + */ + static im_function tiff2vips_desc = { +- "im_tiff2vips", /* Name */ ++ "im_tiff2vips", /* Name */ + "convert TIFF file to VIPS image", /* Description */ + 0, +- tiff2vips_vec, /* Dispatch function */ +- IM_NUMBER( tiff2vips_args ), /* Size of arg list */ +- tiff2vips_args /* Arg list */ ++ tiff2vips_vec, /* Dispatch function */ ++ IM_NUMBER(tiff2vips_args), /* Size of arg list */ ++ tiff2vips_args /* Arg list */ + }; + + static int +-analyze2vips_vec( im_object *argv ) ++analyze2vips_vec(im_object *argv) + { +- const char *in = argv[0]; +- IMAGE *out = argv[1]; ++ const char *in = argv[0]; ++ IMAGE *out = argv[1]; + +- return( im_analyze2vips( in, out ) ); ++ return (im_analyze2vips(in, out)); + } + + static im_arg_desc analyze2vips_arg_types[] = { +- IM_INPUT_STRING( "filename" ), +- IM_OUTPUT_IMAGE( "im" ) ++ IM_INPUT_STRING("filename"), ++ IM_OUTPUT_IMAGE("im") + }; + + static im_function analyze2vips_desc = { +- "im_analyze2vips", /* Name */ +- "read a file in analyze format",/* Description */ +- 0, /* Flags */ +- analyze2vips_vec, /* Dispatch function */ +- IM_NUMBER( analyze2vips_arg_types ),/* Size of arg list */ +- analyze2vips_arg_types /* Arg list */ ++ "im_analyze2vips", /* Name */ ++ "read a file in analyze format", /* Description */ ++ 0, /* Flags */ ++ analyze2vips_vec, /* Dispatch function */ ++ IM_NUMBER(analyze2vips_arg_types), /* Size of arg list */ ++ analyze2vips_arg_types /* Arg list */ + }; + + static int +-csv2vips_vec( im_object *argv ) ++csv2vips_vec(im_object *argv) + { +- const char *in = argv[0]; +- IMAGE *out = argv[1]; ++ const char *in = argv[0]; ++ IMAGE *out = argv[1]; + +- return( im_csv2vips( in, out ) ); ++ return (im_csv2vips(in, out)); + } + + static im_arg_desc csv2vips_arg_types[] = { +- IM_INPUT_STRING( "filename" ), +- IM_OUTPUT_IMAGE( "im" ) ++ IM_INPUT_STRING("filename"), ++ IM_OUTPUT_IMAGE("im") + }; + + static im_function csv2vips_desc = { +- "im_csv2vips", /* Name */ +- "read a file in csv format",/* Description */ +- 0, /* Flags */ +- csv2vips_vec, /* Dispatch function */ +- IM_NUMBER( csv2vips_arg_types ),/* Size of arg list */ +- csv2vips_arg_types /* Arg list */ ++ "im_csv2vips", /* Name */ ++ "read a file in csv format", /* Description */ ++ 0, /* Flags */ ++ csv2vips_vec, /* Dispatch function */ ++ IM_NUMBER(csv2vips_arg_types), /* Size of arg list */ ++ csv2vips_arg_types /* Arg list */ + }; + + static int +-vips2csv_vec( im_object *argv ) ++vips2csv_vec(im_object *argv) + { +- IMAGE *in = argv[0]; +- const char *filename = argv[1]; ++ IMAGE *in = argv[0]; ++ const char *filename = argv[1]; + +- return( im_vips2csv( in, filename ) ); ++ return (im_vips2csv(in, filename)); + } + + static im_arg_desc vips2csv_arg_types[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_INPUT_STRING( "filename" ) ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_STRING("filename") + }; + + static im_function vips2csv_desc = { +- "im_vips2csv", /* Name */ +- "write an image in csv format", /* Description */ +- 0, /* Flags */ +- vips2csv_vec, /* Dispatch function */ +- IM_NUMBER( vips2csv_arg_types ),/* Size of arg list */ +- vips2csv_arg_types /* Arg list */ ++ "im_vips2csv", /* Name */ ++ "write an image in csv format", /* Description */ ++ 0, /* Flags */ ++ vips2csv_vec, /* Dispatch function */ ++ IM_NUMBER(vips2csv_arg_types), /* Size of arg list */ ++ vips2csv_arg_types /* Arg list */ + }; + + static int +-ppm2vips_vec( im_object *argv ) ++ppm2vips_vec(im_object *argv) + { +- const char *in = argv[0]; +- IMAGE *out = argv[1]; ++ const char *in = argv[0]; ++ IMAGE *out = argv[1]; + +- return( im_ppm2vips( in, out ) ); ++ return (im_ppm2vips(in, out)); + } + + static im_arg_desc ppm2vips_arg_types[] = { +- IM_INPUT_STRING( "filename" ), +- IM_OUTPUT_IMAGE( "im" ) ++ IM_INPUT_STRING("filename"), ++ IM_OUTPUT_IMAGE("im") + }; + + static im_function ppm2vips_desc = { +- "im_ppm2vips", /* Name */ +- "read a file in pbm/pgm/ppm format", /* Description */ +- 0, /* Flags */ +- ppm2vips_vec, /* Dispatch function */ +- IM_NUMBER( ppm2vips_arg_types ),/* Size of arg list */ +- ppm2vips_arg_types /* Arg list */ ++ "im_ppm2vips", /* Name */ ++ "read a file in pbm/pgm/ppm format", /* Description */ ++ 0, /* Flags */ ++ ppm2vips_vec, /* Dispatch function */ ++ IM_NUMBER(ppm2vips_arg_types), /* Size of arg list */ ++ ppm2vips_arg_types /* Arg list */ + }; + + static int +-vips2ppm_vec( im_object *argv ) ++vips2ppm_vec(im_object *argv) + { +- IMAGE *im = argv[0]; +- const char *filename = argv[1]; ++ IMAGE *im = argv[0]; ++ const char *filename = argv[1]; + +- return( im_vips2ppm( im, filename ) ); ++ return (im_vips2ppm(im, filename)); + } + + static im_arg_desc vips2ppm_arg_types[] = { +- IM_INPUT_IMAGE( "im" ), +- IM_INPUT_STRING( "filename" ) ++ IM_INPUT_IMAGE("im"), ++ IM_INPUT_STRING("filename") + }; + + static im_function vips2ppm_desc = { +- "im_vips2ppm", /* Name */ +- "write a file in pbm/pgm/ppm format", /* Description */ +- 0, /* Flags */ +- vips2ppm_vec, /* Dispatch function */ +- IM_NUMBER( vips2ppm_arg_types ),/* Size of arg list */ +- vips2ppm_arg_types /* Arg list */ ++ "im_vips2ppm", /* Name */ ++ "write a file in pbm/pgm/ppm format", /* Description */ ++ 0, /* Flags */ ++ vips2ppm_vec, /* Dispatch function */ ++ IM_NUMBER(vips2ppm_arg_types), /* Size of arg list */ ++ vips2ppm_arg_types /* Arg list */ + }; + + static int +-fits2vips_vec( im_object *argv ) ++fits2vips_vec(im_object *argv) + { + char *in = argv[0]; + IMAGE *out = argv[1]; + +- if( im_fits2vips( in, out ) ) +- return( -1 ); ++ if (im_fits2vips(in, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static im_arg_desc fits2vips_args[] = { +- IM_INPUT_STRING( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_STRING("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + static im_function fits2vips_desc = { +- "im_fits2vips", /* Name */ +- "convert from fits", /* Description */ +- 0, /* Flags */ +- fits2vips_vec, /* Dispatch function */ +- IM_NUMBER( fits2vips_args ), /* Size of arg list */ +- fits2vips_args /* Arg list */ ++ "im_fits2vips", /* Name */ ++ "convert from fits", /* Description */ ++ 0, /* Flags */ ++ fits2vips_vec, /* Dispatch function */ ++ IM_NUMBER(fits2vips_args), /* Size of arg list */ ++ fits2vips_args /* Arg list */ + }; + + /* Package up all these functions. +@@ -464,6 +464,6 @@ static im_function *list[] = { + */ + im_package im__format = { + "format", +- IM_NUMBER( list ), ++ IM_NUMBER(list), + list + }; +diff --git a/libvips/deprecated/freq_dispatch.c b/libvips/deprecated/freq_dispatch.c +index b428608c2a..e532d53a85 100644 +--- a/libvips/deprecated/freq_dispatch.c ++++ b/libvips/deprecated/freq_dispatch.c +@@ -7,28 +7,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -46,36 +46,36 @@ + /* One image in, one out. + */ + static im_arg_desc one_in_one_out[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Two images in, one out. + */ + static im_arg_desc two_in_one_out[] = { +- IM_INPUT_IMAGE( "in1" ), +- IM_INPUT_IMAGE( "in2" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in1"), ++ IM_INPUT_IMAGE("in2"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Args to im_create_fmask(). + */ + static im_arg_desc create_fmask_args[] = { +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "width" ), +- IM_INPUT_INT( "height" ), +- IM_INPUT_INT( "type" ), +- IM_INPUT_DOUBLE( "p1" ), +- IM_INPUT_DOUBLE( "p2" ), +- IM_INPUT_DOUBLE( "p3" ), +- IM_INPUT_DOUBLE( "p4" ), +- IM_INPUT_DOUBLE( "p5" ) ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("width"), ++ IM_INPUT_INT("height"), ++ IM_INPUT_INT("type"), ++ IM_INPUT_DOUBLE("p1"), ++ IM_INPUT_DOUBLE("p2"), ++ IM_INPUT_DOUBLE("p3"), ++ IM_INPUT_DOUBLE("p4"), ++ IM_INPUT_DOUBLE("p5") + }; + + /* Call im_create_fmask via arg vector. + */ + static int +-create_fmask_vec( im_object *argv ) ++create_fmask_vec(im_object *argv) + { + int width = *((int *) argv[1]); + int height = *((int *) argv[2]); +@@ -86,38 +86,38 @@ create_fmask_vec( im_object *argv ) + double p4 = *((double *) argv[7]); + double p5 = *((double *) argv[8]); + +- return( im_create_fmask( argv[0], width, height, +- type, p1, p2, p3, p4, p5 ) ); ++ return (im_create_fmask(argv[0], width, height, ++ type, p1, p2, p3, p4, p5)); + } + + /* Description of im_create_fmask. +- */ ++ */ + static im_function create_fmask_desc = { +- "im_create_fmask", /* Name */ ++ "im_create_fmask", /* Name */ + "create frequency domain filter mask", +- 0, /* Flags */ +- create_fmask_vec, /* Dispatch function */ +- IM_NUMBER( create_fmask_args ), /* Size of arg list */ +- create_fmask_args /* Arg list */ ++ 0, /* Flags */ ++ create_fmask_vec, /* Dispatch function */ ++ IM_NUMBER(create_fmask_args), /* Size of arg list */ ++ create_fmask_args /* Arg list */ + }; + + /* Args to im_flt_image_freq(). + */ + static im_arg_desc flt_image_freq_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "type" ), +- IM_INPUT_DOUBLE( "p1" ), +- IM_INPUT_DOUBLE( "p2" ), +- IM_INPUT_DOUBLE( "p3" ), +- IM_INPUT_DOUBLE( "p4" ), +- IM_INPUT_DOUBLE( "p5" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("type"), ++ IM_INPUT_DOUBLE("p1"), ++ IM_INPUT_DOUBLE("p2"), ++ IM_INPUT_DOUBLE("p3"), ++ IM_INPUT_DOUBLE("p4"), ++ IM_INPUT_DOUBLE("p5") + }; + + /* Call im_flt_image_freq via arg vector. + */ + static int +-flt_image_freq_vec( im_object *argv ) ++flt_image_freq_vec(im_object *argv) + { + int type = *((int *) argv[2]); + double p1 = *((double *) argv[3]); +@@ -126,190 +126,190 @@ flt_image_freq_vec( im_object *argv ) + double p4 = *((double *) argv[6]); + double p5 = *((double *) argv[7]); + +- return( im_flt_image_freq( argv[0], argv[1], +- type, p1, p2, p3, p4, p5 ) ); ++ return (im_flt_image_freq(argv[0], argv[1], ++ type, p1, p2, p3, p4, p5)); + } + + /* Description of im_flt_image_freq. +- */ ++ */ + static im_function flt_image_freq_desc = { +- "im_flt_image_freq", /* Name */ ++ "im_flt_image_freq", /* Name */ + "frequency domain filter image", +- 0, /* Flags */ +- flt_image_freq_vec, /* Dispatch function */ +- IM_NUMBER( flt_image_freq_args ), /* Size of arg list */ +- flt_image_freq_args /* Arg list */ ++ 0, /* Flags */ ++ flt_image_freq_vec, /* Dispatch function */ ++ IM_NUMBER(flt_image_freq_args), /* Size of arg list */ ++ flt_image_freq_args /* Arg list */ + }; + + /* Args to im_fractsurf(). + */ + static im_arg_desc fractsurf_args[] = { +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "size" ), +- IM_INPUT_DOUBLE( "dimension" ) ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("size"), ++ IM_INPUT_DOUBLE("dimension") + }; + + /* Call im_fractsurf via arg vector. + */ + static int +-fractsurf_vec( im_object *argv ) ++fractsurf_vec(im_object *argv) + { + int size = *((int *) argv[1]); + double dim = *((double *) argv[2]); + +- return( im_fractsurf( argv[0], size, dim ) ); ++ return (im_fractsurf(argv[0], size, dim)); + } + + /* Description of im_fractsurf. +- */ ++ */ + static im_function fractsurf_desc = { +- "im_fractsurf", /* Name */ ++ "im_fractsurf", /* Name */ + "generate a fractal surface of given dimension", +- IM_FN_TRANSFORM, /* Flags */ +- fractsurf_vec, /* Dispatch function */ +- IM_NUMBER( fractsurf_args ), /* Size of arg list */ +- fractsurf_args /* Arg list */ ++ IM_FN_TRANSFORM, /* Flags */ ++ fractsurf_vec, /* Dispatch function */ ++ IM_NUMBER(fractsurf_args), /* Size of arg list */ ++ fractsurf_args /* Arg list */ + }; + + /* Args to im_freqflt(). + */ + static im_arg_desc freqflt_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_INPUT_IMAGE( "mask" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_IMAGE("mask"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Call im_freqflt via arg vector. + */ + static int +-freqflt_vec( im_object *argv ) ++freqflt_vec(im_object *argv) + { +- return( im_freqflt( argv[0], argv[1], argv[2] ) ); ++ return (im_freqflt(argv[0], argv[1], argv[2])); + } + + /* Description of im_freqflt. +- */ ++ */ + static im_function freqflt_desc = { +- "im_freqflt", /* Name */ ++ "im_freqflt", /* Name */ + "frequency-domain filter of in with mask", +- IM_FN_TRANSFORM, /* Flags */ +- freqflt_vec, /* Dispatch function */ +- IM_NUMBER( freqflt_args ), /* Size of arg list */ +- freqflt_args /* Arg list */ ++ IM_FN_TRANSFORM, /* Flags */ ++ freqflt_vec, /* Dispatch function */ ++ IM_NUMBER(freqflt_args), /* Size of arg list */ ++ freqflt_args /* Arg list */ + }; + + /* Call im_disp_ps via arg vector. + */ + static int +-disp_ps_vec( im_object *argv ) ++disp_ps_vec(im_object *argv) + { +- return( im_disp_ps( argv[0], argv[1] ) ); ++ return (im_disp_ps(argv[0], argv[1])); + } + + /* Description of im_disp_ps. +- */ ++ */ + static im_function disp_ps_desc = { +- "im_disp_ps", /* Name */ ++ "im_disp_ps", /* Name */ + "make displayable power spectrum", +- IM_FN_TRANSFORM, /* Flags */ +- disp_ps_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_TRANSFORM, /* Flags */ ++ disp_ps_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_rotquad via arg vector. + */ + static int +-rotquad_vec( im_object *argv ) ++rotquad_vec(im_object *argv) + { +- return( im_rotquad( argv[0], argv[1] ) ); ++ return (im_rotquad(argv[0], argv[1])); + } + + /* Description of im_rotquad. +- */ ++ */ + static im_function rotquad_desc = { +- "im_rotquad", /* Name */ ++ "im_rotquad", /* Name */ + "rotate image quadrants to move origin to centre", +- IM_FN_TRANSFORM, /* Flags */ +- rotquad_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_TRANSFORM, /* Flags */ ++ rotquad_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_fwfft via arg vector. + */ + static int +-fwfft_vec( im_object *argv ) ++fwfft_vec(im_object *argv) + { +- return( im_fwfft( argv[0], argv[1] ) ); ++ return (im_fwfft(argv[0], argv[1])); + } + + /* Description of im_fwfft. +- */ ++ */ + static im_function fwfft_desc = { +- "im_fwfft", /* Name */ ++ "im_fwfft", /* Name */ + "forward fast-fourier transform", +- IM_FN_TRANSFORM, /* Flags */ +- fwfft_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_TRANSFORM, /* Flags */ ++ fwfft_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_invfft via arg vector. + */ + static int +-invfft_vec( im_object *argv ) ++invfft_vec(im_object *argv) + { +- return( im_invfft( argv[0], argv[1] ) ); ++ return (im_invfft(argv[0], argv[1])); + } + + /* Description of im_invfft. +- */ ++ */ + static im_function invfft_desc = { +- "im_invfft", /* Name */ ++ "im_invfft", /* Name */ + "inverse fast-fourier transform", +- IM_FN_TRANSFORM, /* Flags */ +- invfft_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_TRANSFORM, /* Flags */ ++ invfft_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_invfftr via arg vector. + */ + static int +-invfftr_vec( im_object *argv ) ++invfftr_vec(im_object *argv) + { +- return( im_invfftr( argv[0], argv[1] ) ); ++ return (im_invfftr(argv[0], argv[1])); + } + + /* Description of im_invfftr. +- */ ++ */ + static im_function invfftr_desc = { +- "im_invfftr", /* Name */ ++ "im_invfftr", /* Name */ + "real part of inverse fast-fourier transform", +- IM_FN_TRANSFORM, /* Flags */ +- invfftr_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ IM_FN_TRANSFORM, /* Flags */ ++ invfftr_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_phasecor_fft via arg vector. + */ + static int +-phasecor_fft_vec( im_object *argv ) ++phasecor_fft_vec(im_object *argv) + { +- return( im_phasecor_fft( argv[0], argv[1], argv[2] ) ); ++ return (im_phasecor_fft(argv[0], argv[1], argv[2])); + } + + /* Description of im_phasecor_fft. +- */ ++ */ + static im_function phasecor_fft_desc = { +- "im_phasecor_fft", /* Name */ ++ "im_phasecor_fft", /* Name */ + "non-normalised correlation of gradient of in2 within in1", +- IM_FN_TRANSFORM, /* Flags */ +- phasecor_fft_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ IM_FN_TRANSFORM, /* Flags */ ++ phasecor_fft_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Package up all these functions. +@@ -331,6 +331,6 @@ static im_function *freq_list[] = { + */ + im_package im__freq_filt = { + "freq_filt", +- IM_NUMBER( freq_list ), ++ IM_NUMBER(freq_list), + freq_list + }; +diff --git a/libvips/deprecated/glds_funcs.c b/libvips/deprecated/glds_funcs.c +index a9e6aeb9b3..5164592964 100644 +--- a/libvips/deprecated/glds_funcs.c ++++ b/libvips/deprecated/glds_funcs.c +@@ -37,28 +37,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -76,9 +76,9 @@ + + /* Keep the greylevel difference matrix as a 256x1 double image */ + +-int +-im_glds_matrix( IMAGE *im, IMAGE *m, +- int xpos, int ypos, int xsize, int ysize, int dx, int dy ) ++int ++im_glds_matrix(IMAGE *im, IMAGE *m, ++ int xpos, int ypos, int xsize, int ysize, int dx, int dy) + { + PEL *in, *cpin; + int *b, *pb; +@@ -89,166 +89,167 @@ im_glds_matrix( IMAGE *im, IMAGE *m, + int norm; + + if (im_iocheck(im, m) == -1) +- return( -1 ); ++ return (-1); + +- if ((im->Bands != 1)||(im->BandFmt != IM_BANDFMT_UCHAR)) { +- im_error( "im_glds_matrix", "%s", _( "Wrong input") ); +- return(-1); } ++ if ((im->Bands != 1) || (im->BandFmt != IM_BANDFMT_UCHAR)) { ++ im_error("im_glds_matrix", "%s", _("Wrong input")); ++ return (-1); ++ } + +- if ( (xpos + xsize + dx > im->Xsize)|| (ypos + ysize + dy > im->Ysize) ) { +- im_error( "im_glds_matrix", "%s", _( "wrong args") ); +- return(-1); } ++ if ((xpos + xsize + dx > im->Xsize) || (ypos + ysize + dy > im->Ysize)) { ++ im_error("im_glds_matrix", "%s", _("wrong args")); ++ return (-1); ++ } + + if (im_cp_desc(m, im) == -1) +- return( -1 ); +- m->Xsize = 256; ++ return (-1); ++ m->Xsize = 256; + m->Ysize = 1; + m->BandFmt = IM_BANDFMT_DOUBLE; + m->Type = IM_TYPE_B_W; + + if (im_setupout(m) == -1) +- return( -1 ); ++ return (-1); + +- b = (int *)calloc( (unsigned)m->Xsize, sizeof(int) ); +- l = (double *)calloc( (unsigned)m->Xsize, sizeof(double)); +- if ( (b == NULL) || (l == NULL) ) { +- im_error( "im_glds_matrix", "%s", _( "calloc failed") ); +- return(-1); } ++ b = (int *) calloc((unsigned) m->Xsize, sizeof(int)); ++ l = (double *) calloc((unsigned) m->Xsize, sizeof(double)); ++ if ((b == NULL) || (l == NULL)) { ++ im_error("im_glds_matrix", "%s", _("calloc failed")); ++ return (-1); ++ } + +- in = (PEL*)im->data; +- in += ( ypos * im->Xsize + xpos ); ++ in = (PEL *) im->data; ++ in += (ypos * im->Xsize + xpos); + ofs = dy * im->Xsize + dx; +- for ( y=0; yXsize; +- for ( x=0; xXsize; x++) +- *pl++ = ((double)(*pb++))/(double)norm; +- if (im_writeline( 0, m, (PEL *) l ) == -1) +- return( -1 ); +- +- free((char*)b); free((char*)l); +- return(0); ++ for (x = 0; x < m->Xsize; x++) ++ *pl++ = ((double) (*pb++)) / (double) norm; ++ if (im_writeline(0, m, (PEL *) l) == -1) ++ return (-1); ++ ++ free((char *) b); ++ free((char *) l); ++ return (0); + } + + /* @(#) Calculates the asmoment of the sglds matrix held by m + */ +-int +-im_glds_asm( IMAGE *m, double *asmoment ) ++int ++im_glds_asm(IMAGE *m, double *asmoment) + { + double temp, tmpasm, *in; +- int i; ++ int i; + +- if( im_incheck( m ) ) +- return( -1 ); ++ if (im_incheck(m)) ++ return (-1); + +- if (m->Xsize != 256 || m->Ysize != 1 || +- m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) { +- im_error( "im_glds_asm", "%s", _( "unable to accept input") ); +- return(-1);} ++ if (m->Xsize != 256 || m->Ysize != 1 || ++ m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) { ++ im_error("im_glds_asm", "%s", _("unable to accept input")); ++ return (-1); ++ } + tmpasm = 0.0; +- in = (double*)m->data; +- for(i=0; iXsize; i++) +- { ++ in = (double *) m->data; ++ for (i = 0; i < m->Xsize; i++) { + temp = *in++; +- tmpasm += (temp*temp); +- } ++ tmpasm += (temp * temp); ++ } + *asmoment = tmpasm; +- return(0); ++ return (0); + } + + /* @(#) Calculates the contrast of the coocurence matrix passed in buffer + */ +-int +-im_glds_contrast( IMAGE *m, double *contrast ) ++int ++im_glds_contrast(IMAGE *m, double *contrast) + { + double tmpcon, *in; +- int i; ++ int i; + +- if( im_incheck( m ) ) +- return( -1 ); ++ if (im_incheck(m)) ++ return (-1); + +- if (m->Xsize != 256 || m->Ysize != 1 || +- m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) { +- im_error( "im_glds_contrast", "%s", _( "wrong input") ); +- return(-1); } ++ if (m->Xsize != 256 || m->Ysize != 1 || ++ m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) { ++ im_error("im_glds_contrast", "%s", _("wrong input")); ++ return (-1); ++ } + tmpcon = 0.0; +- in = (double*)m->data; +- for(i=0; iXsize; i++) +- { +- tmpcon += ( ((double)i)*((double)i)*(*in) ); ++ in = (double *) m->data; ++ for (i = 0; i < m->Xsize; i++) { ++ tmpcon += (((double) i) * ((double) i) * (*in)); + in++; +- } ++ } + *contrast = tmpcon; +- return(0); ++ return (0); + } + + /* @(#) Calculates the entropy of the glds vector passed in buffer + * @(#) Function returns the entropy based on log base 2. + */ +-int +-im_glds_entropy( IMAGE *m, double *entropy ) ++int ++im_glds_entropy(IMAGE *m, double *entropy) + { + double tmpent, dtemp, *in; +- int i; ++ int i; + +- if( im_incheck( m ) ) +- return( -1 ); ++ if (im_incheck(m)) ++ return (-1); + +- if (m->Xsize != 256 || m->Ysize != 1 || +- m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) { +- im_error( "im_glds_entropy", "%s", _( "wrong input") ); +- return(-1); } ++ if (m->Xsize != 256 || m->Ysize != 1 || ++ m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) { ++ im_error("im_glds_entropy", "%s", _("wrong input")); ++ return (-1); ++ } + tmpent = 0.0; +- in = (double*)m->data; +- for(i=0; iXsize; i++) +- { +- if(*in != 0) +- { +- dtemp = *in; +- tmpent += (dtemp*log10(dtemp)); +- } +- in++; ++ in = (double *) m->data; ++ for (i = 0; i < m->Xsize; i++) { ++ if (*in != 0) { ++ dtemp = *in; ++ tmpent += (dtemp * log10(dtemp)); + } +- *entropy = ((-1)*tmpent/log10(2.0)); +- return(0); ++ in++; ++ } ++ *entropy = ((-1) * tmpent / log10(2.0)); ++ return (0); + } + + /* @(#) Calculates the mean of the sglds matrix passed in m + */ +-int +-im_glds_mean( IMAGE *m, double *mean ) ++int ++im_glds_mean(IMAGE *m, double *mean) + { + double tmpmean, *in; +- int i; ++ int i; + +- if( im_incheck( m ) ) +- return( -1 ); ++ if (im_incheck(m)) ++ return (-1); + +- if (m->Xsize != 256 || m->Ysize != 1 || +- m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) { +- im_error( "im_glds_mean", "%s", _( "wrong input") ); +- return(-1); } ++ if (m->Xsize != 256 || m->Ysize != 1 || ++ m->Bands != 1 || m->BandFmt != IM_BANDFMT_DOUBLE) { ++ im_error("im_glds_mean", "%s", _("wrong input")); ++ return (-1); ++ } + tmpmean = 0.0; +- in = (double*)m->data; +- for(i=0; iXsize; i++) +- { +- tmpmean += ( ((double)i)*(*in) ); ++ in = (double *) m->data; ++ for (i = 0; i < m->Xsize; i++) { ++ tmpmean += (((double) i) * (*in)); + in++; +- } +- tmpmean = tmpmean/((double)m->Xsize); ++ } ++ tmpmean = tmpmean / ((double) m->Xsize); + *mean = tmpmean; +- return(0); ++ return (0); + } +diff --git a/libvips/deprecated/hist_dispatch.c b/libvips/deprecated/hist_dispatch.c +index 9cedd61e76..156af8a70c 100644 +--- a/libvips/deprecated/hist_dispatch.c ++++ b/libvips/deprecated/hist_dispatch.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,446 +43,446 @@ + /* One image in, one out. + */ + static im_arg_desc one_in_one_out[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Args for im_gammacorrect. + */ + static im_arg_desc gammacorrect_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLE( "exponent" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLE("exponent") + }; + + /* Call im_gammacorrect via arg vector. + */ + static int +-gammacorrect_vec( im_object *argv ) ++gammacorrect_vec(im_object *argv) + { + double exp = *((double *) argv[2]); + +- return( im_gammacorrect( argv[0], argv[1], exp ) ); ++ return (im_gammacorrect(argv[0], argv[1], exp)); + } + + /* Description of im_gammacorrect. +- */ ++ */ + static im_function gammacorrect_desc = { +- "im_gammacorrect", /* Name */ +- "gamma-correct image", /* Description */ +- IM_FN_PIO, /* Flags */ +- gammacorrect_vec, /* Dispatch function */ +- IM_NUMBER( gammacorrect_args ), /* Size of arg list */ +- gammacorrect_args /* Arg list */ ++ "im_gammacorrect", /* Name */ ++ "gamma-correct image", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ gammacorrect_vec, /* Dispatch function */ ++ IM_NUMBER(gammacorrect_args), /* Size of arg list */ ++ gammacorrect_args /* Arg list */ + }; + + /* Image plus number in, image out. + */ + static im_arg_desc heq_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "band_number" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("band_number") + }; + + /* Call im_heq via arg vector. + */ + static int +-heq_vec( im_object *argv ) ++heq_vec(im_object *argv) + { + int bn = *((int *) argv[2]); + +- return( im_heq( argv[0], argv[1], bn ) ); ++ return (im_heq(argv[0], argv[1], bn)); + } + + /* Description of im_heq. +- */ ++ */ + static im_function heq_desc = { +- "im_heq", /* Name */ +- "histogram-equalise image", /* Description */ +- IM_FN_PIO, /* Flags */ +- heq_vec, /* Dispatch function */ +- IM_NUMBER( heq_args ), /* Size of arg list */ +- heq_args /* Arg list */ ++ "im_heq", /* Name */ ++ "histogram-equalise image", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ heq_vec, /* Dispatch function */ ++ IM_NUMBER(heq_args), /* Size of arg list */ ++ heq_args /* Arg list */ + }; + + static im_arg_desc histindexed_args[] = { +- IM_INPUT_IMAGE( "index" ), +- IM_INPUT_IMAGE( "value" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("index"), ++ IM_INPUT_IMAGE("value"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Call im_histindexed via arg vector. + */ + static int +-histindexed_vec( im_object *argv ) ++histindexed_vec(im_object *argv) + { +- return( im_hist_indexed( argv[0], argv[1], argv[2] ) ); ++ return (im_hist_indexed(argv[0], argv[1], argv[2])); + } + + /* Description of im_histindexed. +- */ ++ */ + static im_function histindexed_desc = { +- "im_hist_indexed", /* Name */ +- "make a histogram with an index image", /* Description */ +- IM_FN_PIO, /* Flags */ +- histindexed_vec, /* Dispatch function */ +- IM_NUMBER( histindexed_args ), /* Size of arg list */ +- histindexed_args /* Arg list */ ++ "im_hist_indexed", /* Name */ ++ "make a histogram with an index image", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ histindexed_vec, /* Dispatch function */ ++ IM_NUMBER(histindexed_args), /* Size of arg list */ ++ histindexed_args /* Arg list */ + }; + + /* Call im_hist via arg vector. + */ + static int +-hist_vec( im_object *argv ) ++hist_vec(im_object *argv) + { + int bn = *((int *) argv[2]); + +- return( im_hist( argv[0], argv[1], bn ) ); ++ return (im_hist(argv[0], argv[1], bn)); + } + + /* Description of im_hist. +- */ ++ */ + static im_function hist_desc = { +- "im_hist", /* Name */ +- "find and graph histogram of image", /* Description */ +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- hist_vec, /* Dispatch function */ +- IM_NUMBER( heq_args ), /* Size of arg list */ +- heq_args /* Arg list */ ++ "im_hist", /* Name */ ++ "find and graph histogram of image", /* Description */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ hist_vec, /* Dispatch function */ ++ IM_NUMBER(heq_args), /* Size of arg list */ ++ heq_args /* Arg list */ + }; + + /* Call im_histcum via arg vector. + */ + static int +-histcum_vec( im_object *argv ) ++histcum_vec(im_object *argv) + { +- return( im_histcum( argv[0], argv[1] ) ); ++ return (im_histcum(argv[0], argv[1])); + } + + /* Description of im_histcum. +- */ ++ */ + static im_function histcum_desc = { +- "im_histcum", /* Name */ +- "turn histogram to cumulative histogram",/* Description */ +- IM_FN_PIO, /* Flags */ +- histcum_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_histcum", /* Name */ ++ "turn histogram to cumulative histogram", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ histcum_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_histnorm via arg vector. + */ + static int +-histnorm_vec( im_object *argv ) ++histnorm_vec(im_object *argv) + { +- return( im_histnorm( argv[0], argv[1] ) ); ++ return (im_histnorm(argv[0], argv[1])); + } + + /* Description of im_histcum. +- */ ++ */ + static im_function histnorm_desc = { +- "im_histnorm", /* Name */ +- "form normalised histogram",/* Description */ +- IM_FN_PIO, /* Flags */ +- histnorm_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_histnorm", /* Name */ ++ "form normalised histogram", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ histnorm_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_histeq via arg vector. + */ + static int +-histeq_vec( im_object *argv ) ++histeq_vec(im_object *argv) + { +- return( im_histeq( argv[0], argv[1] ) ); ++ return (im_histeq(argv[0], argv[1])); + } + + /* Description of im_histeq. +- */ ++ */ + static im_function histeq_desc = { +- "im_histeq", /* Name */ +- "form histogram equalistion LUT",/* Description */ +- IM_FN_PIO, /* Flags */ +- histeq_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_histeq", /* Name */ ++ "form histogram equalistion LUT", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ histeq_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_histgr via arg vector. + */ + static int +-histgr_vec( im_object *argv ) ++histgr_vec(im_object *argv) + { + int bn = *((int *) argv[2]); + +- return( im_histgr( argv[0], argv[1], bn ) ); ++ return (im_histgr(argv[0], argv[1], bn)); + } + + /* Description of im_histgr. +- */ ++ */ + static im_function histgr_desc = { +- "im_histgr", /* Name */ +- "find histogram of image", /* Description */ +- IM_FN_TRANSFORM, /* Flags */ +- histgr_vec, /* Dispatch function */ +- IM_NUMBER( heq_args ), /* Size of arg list */ +- heq_args /* Arg list */ ++ "im_histgr", /* Name */ ++ "find histogram of image", /* Description */ ++ IM_FN_TRANSFORM, /* Flags */ ++ histgr_vec, /* Dispatch function */ ++ IM_NUMBER(heq_args), /* Size of arg list */ ++ heq_args /* Arg list */ + }; + + /* Call im_histnD() via arg vector. + */ + static int +-histnD_vec( im_object *argv ) ++histnD_vec(im_object *argv) + { + int bins = *((int *) argv[2]); + +- return( im_histnD( argv[0], argv[1], bins ) ); ++ return (im_histnD(argv[0], argv[1], bins)); + } + + /* Args for im_histnD(). + */ + static im_arg_desc histnD_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "bins" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("bins") + }; + + /* Description of im_histnD(). +- */ ++ */ + static im_function histnD_desc = { +- "im_histnD", /* Name */ +- "find 1D, 2D or 3D histogram of image", /* Description */ +- IM_FN_TRANSFORM, /* Flags */ +- histnD_vec, /* Dispatch function */ +- IM_NUMBER( histnD_args ), /* Size of arg list */ +- histnD_args /* Arg list */ ++ "im_histnD", /* Name */ ++ "find 1D, 2D or 3D histogram of image", /* Description */ ++ IM_FN_TRANSFORM, /* Flags */ ++ histnD_vec, /* Dispatch function */ ++ IM_NUMBER(histnD_args), /* Size of arg list */ ++ histnD_args /* Arg list */ + }; + + /* Call im_histplot via arg vector. + */ + static int +-histplot_vec( im_object *argv ) ++histplot_vec(im_object *argv) + { +- return( im_histplot( argv[0], argv[1] ) ); ++ return (im_histplot(argv[0], argv[1])); + } + + /* Description of im_histplot. +- */ ++ */ + static im_function histplot_desc = { +- "im_histplot", /* Name */ +- "plot graph of histogram", /* Description */ +- IM_FN_PIO, /* Flags */ +- histplot_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ "im_histplot", /* Name */ ++ "plot graph of histogram", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ histplot_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Args for im_histspec. + */ + static im_arg_desc histspec_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_INPUT_IMAGE( "ref" ), +- IM_OUTPUT_IMAGE( "out" ), ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_IMAGE("ref"), ++ IM_OUTPUT_IMAGE("out"), + }; + + /* Call im_histspec via arg vector. + */ + static int +-histspec_vec( im_object *argv ) ++histspec_vec(im_object *argv) + { +- return( im_histspec( argv[0], argv[1], argv[2] ) ); ++ return (im_histspec(argv[0], argv[1], argv[2])); + } + + /* Description of im_histspec. +- */ ++ */ + static im_function histspec_desc = { +- "im_histspec", /* Name */ ++ "im_histspec", /* Name */ + "find histogram which will make pdf of in match ref", +- 0, /* Flags */ +- histspec_vec, /* Dispatch function */ +- IM_NUMBER( histspec_args ), /* Size of arg list */ +- histspec_args /* Arg list */ ++ 0, /* Flags */ ++ histspec_vec, /* Dispatch function */ ++ IM_NUMBER(histspec_args), /* Size of arg list */ ++ histspec_args /* Arg list */ + }; + + /* Call im_hsp via arg vector. + */ + static int +-hsp_vec( im_object *argv ) ++hsp_vec(im_object *argv) + { +- return( im_hsp( argv[0], argv[1], argv[2] ) ); ++ return (im_hsp(argv[0], argv[1], argv[2])); + } + + /* Description of im_hsp. +- */ ++ */ + static im_function hsp_desc = { +- "im_hsp", /* Name */ ++ "im_hsp", /* Name */ + "match stats of in to stats of ref", +- 0, /* Flags */ +- hsp_vec, /* Dispatch function */ +- IM_NUMBER( histspec_args ), /* Size of arg list */ +- histspec_args /* Arg list */ ++ 0, /* Flags */ ++ hsp_vec, /* Dispatch function */ ++ IM_NUMBER(histspec_args), /* Size of arg list */ ++ histspec_args /* Arg list */ + }; + + /* Args for im_identity. + */ + static im_arg_desc identity_args[] = { +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "nbands" ) ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("nbands") + }; + + /* Call im_identity via arg vector. + */ + static int +-identity_vec( im_object *argv ) ++identity_vec(im_object *argv) + { + int nb = *((int *) argv[1]); + +- return( im_identity( argv[0], nb ) ); ++ return (im_identity(argv[0], nb)); + } + + /* Description of im_identity. +- */ ++ */ + static im_function identity_desc = { +- "im_identity", /* Name */ ++ "im_identity", /* Name */ + "generate identity histogram", +- 0, /* Flags */ +- identity_vec, /* Dispatch function */ +- IM_NUMBER( identity_args ), /* Size of arg list */ +- identity_args /* Arg list */ ++ 0, /* Flags */ ++ identity_vec, /* Dispatch function */ ++ IM_NUMBER(identity_args), /* Size of arg list */ ++ identity_args /* Arg list */ + }; + + /* Args for im_identity_ushort. + */ + static im_arg_desc identity_ushort_args[] = { +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "nbands" ), +- IM_INPUT_INT( "size" ) ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("nbands"), ++ IM_INPUT_INT("size") + }; + + /* Call im_identity_ushort via arg vector. + */ + static int +-identity_ushort_vec( im_object *argv ) ++identity_ushort_vec(im_object *argv) + { + int nb = *((int *) argv[1]); + int sz = *((int *) argv[2]); + +- return( im_identity_ushort( argv[0], nb, sz ) ); ++ return (im_identity_ushort(argv[0], nb, sz)); + } + + /* Description of im_identity_ushort. +- */ ++ */ + static im_function identity_ushort_desc = { +- "im_identity_ushort", /* Name */ ++ "im_identity_ushort", /* Name */ + "generate ushort identity histogram", +- 0, /* Flags */ +- identity_ushort_vec, /* Dispatch function */ +- IM_NUMBER( identity_ushort_args ), /* Size of arg list */ +- identity_ushort_args /* Arg list */ ++ 0, /* Flags */ ++ identity_ushort_vec, /* Dispatch function */ ++ IM_NUMBER(identity_ushort_args), /* Size of arg list */ ++ identity_ushort_args /* Arg list */ + }; + + /* Args for im_lhisteq. + */ + static im_arg_desc lhisteq_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "width" ), +- IM_INPUT_INT( "height" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("width"), ++ IM_INPUT_INT("height") + }; + + /* Call im_lhisteq via arg vector. + */ + static int +-lhisteq_vec( im_object *argv ) ++lhisteq_vec(im_object *argv) + { + int xw = *((int *) argv[2]); + int yw = *((int *) argv[3]); + +- return( im_lhisteq( argv[0], argv[1], xw, yw ) ); ++ return (im_lhisteq(argv[0], argv[1], xw, yw)); + } + + /* Description of im_lhisteq. +- */ ++ */ + static im_function lhisteq_desc = { +- "im_lhisteq", /* Name */ ++ "im_lhisteq", /* Name */ + "local histogram equalisation", +- IM_FN_PIO, /* Flags */ +- lhisteq_vec, /* Dispatch function */ +- IM_NUMBER( lhisteq_args ), /* Size of arg list */ +- lhisteq_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ lhisteq_vec, /* Dispatch function */ ++ IM_NUMBER(lhisteq_args), /* Size of arg list */ ++ lhisteq_args /* Arg list */ + }; + + /* Args for im_maplut. + */ + static im_arg_desc maplut_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_IMAGE( "lut" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_IMAGE("lut") + }; + + /* Call im_maplut via arg vector. + */ + static int +-maplut_vec( im_object *argv ) ++maplut_vec(im_object *argv) + { +- return( im_maplut( argv[0], argv[1], argv[2] ) ); ++ return (im_maplut(argv[0], argv[1], argv[2])); + } + + /* Description of im_maplut. +- */ ++ */ + static im_function maplut_desc = { +- "im_maplut", /* Name */ ++ "im_maplut", /* Name */ + "map image through LUT", +- IM_FN_PIO, /* Flags */ +- maplut_vec, /* Dispatch function */ +- IM_NUMBER( maplut_args ), /* Size of arg list */ +- maplut_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ maplut_vec, /* Dispatch function */ ++ IM_NUMBER(maplut_args), /* Size of arg list */ ++ maplut_args /* Arg list */ + }; + + /* Call im_project() via arg vector. + */ + static int +-project_vec( im_object *argv ) ++project_vec(im_object *argv) + { +- return( im_project( argv[0], argv[1], argv[2] ) ); ++ return (im_project(argv[0], argv[1], argv[2])); + } + + /* Args for im_project(). + */ + static im_arg_desc project_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "hout" ), +- IM_OUTPUT_IMAGE( "vout" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("hout"), ++ IM_OUTPUT_IMAGE("vout") + }; + + /* Description of im_project(). +- */ ++ */ + static im_function project_desc = { +- "im_project", /* Name */ +- "find horizontal and vertical projections of an image", +- IM_FN_TRANSFORM, /* Flags */ +- project_vec, /* Dispatch function */ +- IM_NUMBER( project_args ), /* Size of arg list */ +- project_args /* Arg list */ ++ "im_project", /* Name */ ++ "find horizontal and vertical projections of an image", ++ IM_FN_TRANSFORM, /* Flags */ ++ project_vec, /* Dispatch function */ ++ IM_NUMBER(project_args), /* Size of arg list */ ++ project_args /* Arg list */ + }; + + /* Args for im_stdif. + */ + static im_arg_desc stdif_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLE( "a" ), +- IM_INPUT_DOUBLE( "m0" ), +- IM_INPUT_DOUBLE( "b" ), +- IM_INPUT_DOUBLE( "s0" ), +- IM_INPUT_INT( "xw" ), +- IM_INPUT_INT( "yw" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLE("a"), ++ IM_INPUT_DOUBLE("m0"), ++ IM_INPUT_DOUBLE("b"), ++ IM_INPUT_DOUBLE("s0"), ++ IM_INPUT_INT("xw"), ++ IM_INPUT_INT("yw") + }; + + /* Call im_stdif via arg vector. + */ + static int +-stdif_vec( im_object *argv ) ++stdif_vec(im_object *argv) + { + double a = *((double *) argv[2]); + double m0 = *((double *) argv[3]); +@@ -491,96 +491,96 @@ stdif_vec( im_object *argv ) + int xw = *((int *) argv[6]); + int yw = *((int *) argv[7]); + +- return( im_stdif( argv[0], argv[1], a, m0, b, s0, xw, yw ) ); ++ return (im_stdif(argv[0], argv[1], a, m0, b, s0, xw, yw)); + } + + /* Description of im_stdif. +- */ ++ */ + static im_function stdif_desc = { +- "im_stdif", /* Name */ ++ "im_stdif", /* Name */ + "statistical differencing", +- IM_FN_PIO, /* Flags */ +- stdif_vec, /* Dispatch function */ +- IM_NUMBER( stdif_args ), /* Size of arg list */ +- stdif_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ stdif_vec, /* Dispatch function */ ++ IM_NUMBER(stdif_args), /* Size of arg list */ ++ stdif_args /* Arg list */ + }; + + /* Args for im_buildlut. + */ + static im_arg_desc buildlut_args[] = { +- IM_INPUT_DMASK( "xyes" ), +- IM_OUTPUT_IMAGE( "lut" ) ++ IM_INPUT_DMASK("xyes"), ++ IM_OUTPUT_IMAGE("lut") + }; + + /* Call im_buildlut via arg vector. + */ + static int +-buildlut_vec( im_object *argv ) ++buildlut_vec(im_object *argv) + { + im_mask_object *mi = argv[0]; + +- return( im_buildlut( mi->mask, argv[1] ) ); ++ return (im_buildlut(mi->mask, argv[1])); + } + + /* Description of im_buildlut. +- */ ++ */ + static im_function buildlut_desc = { +- "im_buildlut", /* Name */ ++ "im_buildlut", /* Name */ + "generate LUT table from set of x/y positions", +- 0, /* Flags */ +- buildlut_vec, /* Dispatch function */ +- IM_NUMBER( buildlut_args ),/* Size of arg list */ +- buildlut_args /* Arg list */ ++ 0, /* Flags */ ++ buildlut_vec, /* Dispatch function */ ++ IM_NUMBER(buildlut_args), /* Size of arg list */ ++ buildlut_args /* Arg list */ + }; + + /* Args for im_invertlut. + */ + static im_arg_desc invertlut_args[] = { +- IM_INPUT_DMASK( "measures" ), +- IM_OUTPUT_IMAGE( "lut" ), +- IM_INPUT_INT( "lut_size" ) ++ IM_INPUT_DMASK("measures"), ++ IM_OUTPUT_IMAGE("lut"), ++ IM_INPUT_INT("lut_size") + }; + + /* Call im_invertlut via arg vector. + */ + static int +-invertlut_vec( im_object *argv ) ++invertlut_vec(im_object *argv) + { + im_mask_object *mi = argv[0]; + int lut_size = *((int *) argv[2]); + +- return( im_invertlut( mi->mask, argv[1], lut_size ) ); ++ return (im_invertlut(mi->mask, argv[1], lut_size)); + } + + /* Description of im_invertlut. +- */ ++ */ + static im_function invertlut_desc = { +- "im_invertlut", /* Name */ ++ "im_invertlut", /* Name */ + "generate correction table from set of measures", +- 0, /* Flags */ +- invertlut_vec, /* Dispatch function */ +- IM_NUMBER( invertlut_args ),/* Size of arg list */ +- invertlut_args /* Arg list */ ++ 0, /* Flags */ ++ invertlut_vec, /* Dispatch function */ ++ IM_NUMBER(invertlut_args), /* Size of arg list */ ++ invertlut_args /* Arg list */ + }; + + /* Args for im_tone_build. + */ + static im_arg_desc tone_build_args[] = { +- IM_OUTPUT_IMAGE( "hist" ), +- IM_INPUT_DOUBLE( "Lb" ), +- IM_INPUT_DOUBLE( "Lw" ), +- IM_INPUT_DOUBLE( "Ps" ), +- IM_INPUT_DOUBLE( "Pm" ), +- IM_INPUT_DOUBLE( "Ph" ), +- IM_INPUT_DOUBLE( "S" ), +- IM_INPUT_DOUBLE( "M" ), +- IM_INPUT_DOUBLE( "H" ) ++ IM_OUTPUT_IMAGE("hist"), ++ IM_INPUT_DOUBLE("Lb"), ++ IM_INPUT_DOUBLE("Lw"), ++ IM_INPUT_DOUBLE("Ps"), ++ IM_INPUT_DOUBLE("Pm"), ++ IM_INPUT_DOUBLE("Ph"), ++ IM_INPUT_DOUBLE("S"), ++ IM_INPUT_DOUBLE("M"), ++ IM_INPUT_DOUBLE("H") + }; + + /* Call im_tone_build via arg vector. + */ + static int +-tone_build_vec( im_object *argv ) ++tone_build_vec(im_object *argv) + { + double Lb = *((double *) argv[1]); + double Lw = *((double *) argv[2]); +@@ -591,40 +591,40 @@ tone_build_vec( im_object *argv ) + double M = *((double *) argv[7]); + double H = *((double *) argv[8]); + +- return( im_tone_build( argv[0], Lb, Lw, Ps, Pm, Ph, S, M, H ) ); ++ return (im_tone_build(argv[0], Lb, Lw, Ps, Pm, Ph, S, M, H)); + } + + /* Description of im_tone_build. +- */ ++ */ + static im_function tone_build_desc = { +- "im_tone_build", /* Name */ ++ "im_tone_build", /* Name */ + "create LUT for tone adjustment of LabS images", +- 0, /* Flags */ +- tone_build_vec, /* Dispatch function */ +- IM_NUMBER( tone_build_args ), /* Size of arg list */ +- tone_build_args /* Arg list */ ++ 0, /* Flags */ ++ tone_build_vec, /* Dispatch function */ ++ IM_NUMBER(tone_build_args), /* Size of arg list */ ++ tone_build_args /* Arg list */ + }; + + /* Args for im_tone_build_range. + */ + static im_arg_desc tone_build_range_args[] = { +- IM_OUTPUT_IMAGE( "hist" ), +- IM_INPUT_INT( "in_max" ), +- IM_INPUT_INT( "out_max" ), +- IM_INPUT_DOUBLE( "Lb" ), +- IM_INPUT_DOUBLE( "Lw" ), +- IM_INPUT_DOUBLE( "Ps" ), +- IM_INPUT_DOUBLE( "Pm" ), +- IM_INPUT_DOUBLE( "Ph" ), +- IM_INPUT_DOUBLE( "S" ), +- IM_INPUT_DOUBLE( "M" ), +- IM_INPUT_DOUBLE( "H" ) ++ IM_OUTPUT_IMAGE("hist"), ++ IM_INPUT_INT("in_max"), ++ IM_INPUT_INT("out_max"), ++ IM_INPUT_DOUBLE("Lb"), ++ IM_INPUT_DOUBLE("Lw"), ++ IM_INPUT_DOUBLE("Ps"), ++ IM_INPUT_DOUBLE("Pm"), ++ IM_INPUT_DOUBLE("Ph"), ++ IM_INPUT_DOUBLE("S"), ++ IM_INPUT_DOUBLE("M"), ++ IM_INPUT_DOUBLE("H") + }; + + /* Call im_tone_build_range via arg vector. + */ + static int +-tone_build_range_vec( im_object *argv ) ++tone_build_range_vec(im_object *argv) + { + int in_max = *((int *) argv[1]); + int out_max = *((int *) argv[2]); +@@ -637,38 +637,38 @@ tone_build_range_vec( im_object *argv ) + double M = *((double *) argv[9]); + double H = *((double *) argv[10]); + +- return( im_tone_build_range( argv[0], in_max, out_max, +- Lb, Lw, Ps, Pm, Ph, S, M, H ) ); ++ return (im_tone_build_range(argv[0], in_max, out_max, ++ Lb, Lw, Ps, Pm, Ph, S, M, H)); + } + + /* Description of im_tone_build_range. +- */ ++ */ + static im_function tone_build_range_desc = { +- "im_tone_build_range", /* Name */ ++ "im_tone_build_range", /* Name */ + "create LUT for tone adjustment", +- 0, /* Flags */ +- tone_build_range_vec, /* Dispatch function */ +- IM_NUMBER( tone_build_range_args ),/* Size of arg list */ +- tone_build_range_args /* Arg list */ ++ 0, /* Flags */ ++ tone_build_range_vec, /* Dispatch function */ ++ IM_NUMBER(tone_build_range_args), /* Size of arg list */ ++ tone_build_range_args /* Arg list */ + }; + + /* Args for im_tone_analyse. + */ + static im_arg_desc tone_analyse_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "hist" ), +- IM_INPUT_DOUBLE( "Ps" ), +- IM_INPUT_DOUBLE( "Pm" ), +- IM_INPUT_DOUBLE( "Ph" ), +- IM_INPUT_DOUBLE( "S" ), +- IM_INPUT_DOUBLE( "M" ), +- IM_INPUT_DOUBLE( "H" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("hist"), ++ IM_INPUT_DOUBLE("Ps"), ++ IM_INPUT_DOUBLE("Pm"), ++ IM_INPUT_DOUBLE("Ph"), ++ IM_INPUT_DOUBLE("S"), ++ IM_INPUT_DOUBLE("M"), ++ IM_INPUT_DOUBLE("H") + }; + + /* Call im_tone_analyse via arg vector. + */ + static int +-tone_analyse_vec( im_object *argv ) ++tone_analyse_vec(im_object *argv) + { + double Ps = *((double *) argv[2]); + double Pm = *((double *) argv[3]); +@@ -677,102 +677,102 @@ tone_analyse_vec( im_object *argv ) + double M = *((double *) argv[6]); + double H = *((double *) argv[7]); + +- return( im_tone_analyse( argv[0], argv[1], Ps, Pm, Ph, S, M, H ) ); ++ return (im_tone_analyse(argv[0], argv[1], Ps, Pm, Ph, S, M, H)); + } + + /* Description of im_tone_analyse. +- */ ++ */ + static im_function tone_analyse_desc = { +- "im_tone_analyse", /* Name */ ++ "im_tone_analyse", /* Name */ + "analyse in and create LUT for tone adjustment", +- 0, /* Flags */ +- tone_analyse_vec, /* Dispatch function */ +- IM_NUMBER( tone_analyse_args ), /* Size of arg list */ +- tone_analyse_args /* Arg list */ ++ 0, /* Flags */ ++ tone_analyse_vec, /* Dispatch function */ ++ IM_NUMBER(tone_analyse_args), /* Size of arg list */ ++ tone_analyse_args /* Arg list */ + }; + + /* Args for im_ismonotonic. + */ + static im_arg_desc ismonotonic_args[] = { +- IM_INPUT_IMAGE( "lut" ), +- IM_OUTPUT_INT( "mono" ) ++ IM_INPUT_IMAGE("lut"), ++ IM_OUTPUT_INT("mono") + }; + + /* Call im_ismonotonic via arg vector. + */ + static int +-ismonotonic_vec( im_object *argv ) ++ismonotonic_vec(im_object *argv) + { + int *res = (int *) argv[1]; + +- return( im_ismonotonic( argv[0], res ) ); ++ return (im_ismonotonic(argv[0], res)); + } + + /* Description of im_ismonotonic. +- */ ++ */ + static im_function ismonotonic_desc = { +- "im_ismonotonic", /* Name */ ++ "im_ismonotonic", /* Name */ + "test LUT for monotonicity", +- 0, /* Flags */ +- ismonotonic_vec, /* Dispatch function */ +- IM_NUMBER( ismonotonic_args ), /* Size of arg list */ +- ismonotonic_args /* Arg list */ ++ 0, /* Flags */ ++ ismonotonic_vec, /* Dispatch function */ ++ IM_NUMBER(ismonotonic_args), /* Size of arg list */ ++ ismonotonic_args /* Arg list */ + }; + + /* Args for im_tone_map + */ + static im_arg_desc tone_map_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_IMAGE( "lut" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_IMAGE("lut") + }; + + /* Call im_tone_map via arg vector. + */ + static int +-tone_map_vec( im_object *argv ) ++tone_map_vec(im_object *argv) + { +- return( im_tone_map( argv[0], argv[1], argv[2] ) ); ++ return (im_tone_map(argv[0], argv[1], argv[2])); + } + + /* Description of im_tone_map. +- */ ++ */ + static im_function tone_map_desc = { +- "im_tone_map", /* Name */ ++ "im_tone_map", /* Name */ + "map L channel of LabS or LabQ image through LUT", +- IM_FN_PIO, /* Flags */ +- tone_map_vec, /* Dispatch function */ +- IM_NUMBER( tone_map_args ),/* Size of arg list */ +- tone_map_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ tone_map_vec, /* Dispatch function */ ++ IM_NUMBER(tone_map_args), /* Size of arg list */ ++ tone_map_args /* Arg list */ + }; + + /* Args for im_mpercent. + */ + static im_arg_desc mpercent_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_INPUT_DOUBLE( "percent" ), +- IM_OUTPUT_INT( "thresh" ) ++ IM_INPUT_IMAGE("in"), ++ IM_INPUT_DOUBLE("percent"), ++ IM_OUTPUT_INT("thresh") + }; + + /* Call im_mpercent via arg vector. + */ + static int +-mpercent_vec( im_object *argv ) ++mpercent_vec(im_object *argv) + { + double percent = *((double *) argv[1]); + +- return( im_mpercent( argv[0], percent, argv[2] ) ); ++ return (im_mpercent(argv[0], percent, argv[2])); + } + + /* Description of im_mpercent. +- */ ++ */ + static im_function mpercent_desc = { +- "im_mpercent", /* Name */ ++ "im_mpercent", /* Name */ + "find threshold above which there are percent values", +- 0, /* Flags */ +- mpercent_vec, /* Dispatch function */ +- IM_NUMBER( mpercent_args ), /* Size of arg list */ +- mpercent_args /* Arg list */ ++ 0, /* Flags */ ++ mpercent_vec, /* Dispatch function */ ++ IM_NUMBER(mpercent_args), /* Size of arg list */ ++ mpercent_args /* Arg list */ + }; + + /* Package up all these functions. +@@ -810,6 +810,6 @@ static im_function *hist_list[] = { + */ + im_package im__histograms_lut = { + "histograms_lut", +- IM_NUMBER( hist_list ), ++ IM_NUMBER(hist_list), + hist_list + }; +diff --git a/libvips/deprecated/im_align_bands.c b/libvips/deprecated/im_align_bands.c +index 5f24b63b7f..89b7f20c64 100644 +--- a/libvips/deprecated/im_align_bands.c ++++ b/libvips/deprecated/im_align_bands.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -47,53 +47,53 @@ + * @out: output image + * + * This operation uses im_phasecor_fft() to find an integer displacement to +- * align all image bands band 0. It is very slow and not very accurate. ++ * align all image bands band 0. It is very slow and not very accurate. + * + * Use im_estpar() in preference: it's fast and accurate. +- * ++ * + * See also: im_global_balancef(), im_remosaic(). + * + * Returns: 0 on success, -1 on error + */ +-int im_align_bands( IMAGE *in, IMAGE *out ){ ++int ++im_align_bands(IMAGE *in, IMAGE *out) ++{ + #define FUNCTION_NAME "im_align_bands" +- if( im_piocheck( in, out )) +- return -1; +- +- if( 1 == in-> Bands ) +- return im_copy( in, out ); +- { +- IMAGE **bands= IM_ARRAY( out, 2 * in-> Bands, IMAGE* ); +- IMAGE **wrapped_bands= bands + in-> Bands; +- double x= 0.0; +- double y= 0.0; +- int i; +- +- if( ! bands || im_open_local_array( out, bands, in-> Bands, FUNCTION_NAME ": bands", "p" ) +- || im_open_local_array( out, wrapped_bands + 1, in-> Bands - 1, FUNCTION_NAME ": wrapped_bands", "p" )) +- return -1; +- +- for( i= 0; i < in-> Bands; ++i ) +- if( im_extract_band( in, bands[i], i )) +- return -1; +- +- wrapped_bands[ 0 ]= bands[0]; +- +- for( i= 1; i < in-> Bands; ++i ){ +- IMAGE *temp= im_open( FUNCTION_NAME ": temp", "t" ); +- double this_x, this_y, val; +- +- if( ! temp || im_phasecor_fft( bands[i-1], bands[i], temp ) +- || im_maxpos_avg( temp, & this_x, & this_y, & val ) || im_close( temp )) +- return -1; +- +- x+= this_x; +- y+= this_y; +- +- if( im_wrap( bands[i], wrapped_bands[i], (int) x, (int) y )) +- return -1; +- } +- return im_gbandjoin( wrapped_bands, out, in-> Bands ); +- } ++ if (im_piocheck(in, out)) ++ return -1; ++ ++ if (1 == in->Bands) ++ return im_copy(in, out); ++ { ++ IMAGE **bands = IM_ARRAY(out, 2 * in->Bands, IMAGE *); ++ IMAGE **wrapped_bands = bands + in->Bands; ++ double x = 0.0; ++ double y = 0.0; ++ int i; ++ ++ if (!bands || im_open_local_array(out, bands, in->Bands, FUNCTION_NAME ": bands", "p") || im_open_local_array(out, wrapped_bands + 1, in->Bands - 1, FUNCTION_NAME ": wrapped_bands", "p")) ++ return -1; ++ ++ for (i = 0; i < in->Bands; ++i) ++ if (im_extract_band(in, bands[i], i)) ++ return -1; ++ ++ wrapped_bands[0] = bands[0]; ++ ++ for (i = 1; i < in->Bands; ++i) { ++ IMAGE *temp = im_open(FUNCTION_NAME ": temp", "t"); ++ double this_x, this_y, val; ++ ++ if (!temp || im_phasecor_fft(bands[i - 1], bands[i], temp) || im_maxpos_avg(temp, &this_x, &this_y, &val) || im_close(temp)) ++ return -1; ++ ++ x += this_x; ++ y += this_y; ++ ++ if (im_wrap(bands[i], wrapped_bands[i], (int) x, (int) y)) ++ return -1; ++ } ++ return im_gbandjoin(wrapped_bands, out, in->Bands); ++ } + #undef FUNCTION_NAME + } +diff --git a/libvips/deprecated/im_analyze2vips.c b/libvips/deprecated/im_analyze2vips.c +index 5d770c49b7..631307efdb 100644 +--- a/libvips/deprecated/im_analyze2vips.c ++++ b/libvips/deprecated/im_analyze2vips.c +@@ -1,33 +1,33 @@ + /* Read a Analyze file. Old-style header (so called 7.5 format). +- * ++ * + * 14/12/11 + * - just a compat stub now + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -44,32 +44,32 @@ + #include + + static VipsFormatFlags +-analyze_flags( const char *filename ) ++analyze_flags(const char *filename) + { +- return( (VipsFormatFlags) +- vips_foreign_flags( "analyzeload", filename ) ); ++ return ((VipsFormatFlags) ++ vips_foreign_flags("analyzeload", filename)); + } + + static int +-isanalyze( const char *filename ) ++isanalyze(const char *filename) + { +- return( vips_foreign_is_a( "analyzeload", filename ) ); ++ return (vips_foreign_is_a("analyzeload", filename)); + } + + int +-im_analyze2vips( const char *filename, IMAGE *out ) ++im_analyze2vips(const char *filename, IMAGE *out) + { + VipsImage *t; + +- if( vips_analyzeload( filename, &t, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_analyzeload(filename, &t, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + static const char *analyze_suffs[] = { ".img", ".hdr", NULL }; +@@ -78,13 +78,13 @@ typedef VipsFormat VipsFormatAnalyze; + typedef VipsFormatClass VipsFormatAnalyzeClass; + + static void +-vips_format_analyze_class_init( VipsFormatAnalyzeClass *class ) ++vips_format_analyze_class_init(VipsFormatAnalyzeClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsFormatClass *format_class = (VipsFormatClass *) class; + + object_class->nickname = "analyze"; +- object_class->description = _( "Analyze 6.0" ); ++ object_class->description = _("Analyze 6.0"); + + format_class->is_a = isanalyze; + format_class->load = im_analyze2vips; +@@ -93,9 +93,8 @@ vips_format_analyze_class_init( VipsFormatAnalyzeClass *class ) + } + + static void +-vips_format_analyze_init( VipsFormatAnalyze *object ) ++vips_format_analyze_init(VipsFormatAnalyze *object) + { + } + +-G_DEFINE_TYPE( VipsFormatAnalyze, vips_format_analyze, VIPS_TYPE_FORMAT ); +- ++G_DEFINE_TYPE(VipsFormatAnalyze, vips_format_analyze, VIPS_TYPE_FORMAT); +diff --git a/libvips/deprecated/im_benchmark.c b/libvips/deprecated/im_benchmark.c +index 8fdc88a8cd..174e0812c8 100644 +--- a/libvips/deprecated/im_benchmark.c ++++ b/libvips/deprecated/im_benchmark.c +@@ -10,28 +10,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -57,13 +57,13 @@ This is adapted from the system used to generate images for POD: + http://cima.ng-london.org.uk/~john/POD + + Images from a 10k by 10k studio digital camera are colour processed, resized, +-cropped and sharpened. ++cropped and sharpened. + +-The original POD script was written in nip (see below). This operation is a ++The original POD script was written in nip (see below). This operation is a + reimplementation in vanilla C to make it easier to run (and less fragile!). + + This thing was originally processing images off a remote server over a 100mbit +-network. No attempt was made to make it quick (there was no point): you ++network. No attempt was made to make it quick (there was no point): you + could make it a lot faster very easily. + + ------ benchmark in nip2 ----------- +@@ -81,7 +81,7 @@ width = parse_pint argv?7; + height = parse_pint argv?8; + sharp = parse_pint argv?9; + +-// scale down by this much to undo photographic's relativisation ++// scale down by this much to undo photographic's relativisation + darken = Vector [1.18, 1, 1]; + + // fudge factor in XYZ to get a match under NGC lights on uv-durable paper +@@ -106,32 +106,32 @@ sharpen_params_table = [ + D652D50 = recomb D652D50_direct; + + stage_crop in +- = extract_area crop_left crop_top crop_width crop_height in, ++ = extract_area crop_left crop_top crop_width crop_height in, + crop_id != 0 + = in; + + // fit within a width / height +-stage_shrink image ++stage_shrink image + = image, factor > 1; // never upscale + = resize factor factor Interpolate.BILINEAR image + { +- hfactor = width / get_width image; +- vfactor = height / get_height image; +- factor = min_pair hfactor vfactor; ++ hfactor = width / get_width image; ++ vfactor = height / get_height image; ++ factor = min_pair hfactor vfactor; + } + + // unphotoize, go to xyz, convert to D50, adjust white point, back to lab + stage_colour in +- = if in?0 > 99 then Vector [100, 0, 0] else in''' ++ = if in?0 > 99 then Vector [100, 0, 0] else in''' + { + // back to absolute +- in' = in / darken; ++ in' = in / darken; + + xyz = colour_transform_to Image_type.XYZ in'; + + xyz' = D652D50 xyz * white_point_adjust * brighten; + +- in'' = colour_transform_to Image_type.LAB xyz'; ++ in'' = colour_transform_to Image_type.LAB xyz'; + + // shadows down + in''' = in'' + blacks_down; +@@ -145,7 +145,7 @@ stage_sharp in + } + + // This was: +-// ++// + // stage_srgb in + // = (icc_export 8 "$VIPSHOME/share/nip2/data/sRGB.icm" 1 @ + // colour_transform_to Image_type.LABQ) in; +@@ -155,8 +155,8 @@ stage_sharp in + stage_srgb in + = colour_transform_to Image_type.sRGB in; + +-main = (get_image @ stage_srgb @ +- stage_sharp @ stage_colour @ stage_shrink @ stage_crop @ ++main = (get_image @ stage_srgb @ ++ stage_sharp @ stage_colour @ stage_shrink @ stage_crop @ + colour_transform_to Image_type.LAB @ Image_file) image_path; + ------ benchmark in nip2 ----------- + +@@ -166,7 +166,7 @@ main = (get_image @ stage_srgb @ + * these together to get a CPU-bound operation. + */ + static int +-benchmark( IMAGE *in, IMAGE *out ) ++benchmark(IMAGE *in, IMAGE *out) + { + IMAGE *t[18]; + double one[3] = { 1.0, 1.0, 1.0 }; +@@ -175,64 +175,63 @@ benchmark( IMAGE *in, IMAGE *out ) + double whitepoint[3] = { 1.06, 1.0, 1.01 }; + double shadow[3] = { -2, 0, 0 }; + double white[3] = { 100, 0, 0 }; +- DOUBLEMASK *d652d50 = im_create_dmaskv( "d652d50", 3, 3, ++ DOUBLEMASK *d652d50 = im_create_dmaskv("d652d50", 3, 3, + 1.13529, -0.0604663, -0.0606321, + 0.0975399, 0.935024, -0.0256156, +- -0.0336428, 0.0414702, 0.994135 ); ++ -0.0336428, 0.0414702, 0.994135); + +- im_add_close_callback( out, +- (im_callback_fn) im_free_dmask, d652d50, NULL ); ++ im_add_close_callback(out, ++ (im_callback_fn) im_free_dmask, d652d50, NULL); + +- return( ++ return ( + /* Set of descriptors for this operation. + */ +- im_open_local_array( out, t, 18, "im_benchmark", "p" ) || ++ im_open_local_array(out, t, 18, "im_benchmark", "p") || + + /* Unpack to float. + */ +- im_LabQ2Lab( in, t[0] ) || ++ im_LabQ2Lab(in, t[0]) || + + /* Crop 100 pixels off all edges. + */ +- im_extract_area( t[0], t[1], +- 100, 100, t[0]->Xsize - 200, t[0]->Ysize - 200 ) || ++ im_extract_area(t[0], t[1], ++ 100, 100, t[0]->Xsize - 200, t[0]->Ysize - 200) || + + /* Shrink by 10%, bilinear interp. + */ +- im_affinei_all( t[1], t[2], ++ im_affinei_all(t[1], t[2], + vips_interpolate_bilinear_static(), +- 0.9, 0, 0, 0.9, +- 0, 0 ) || ++ 0.9, 0, 0, 0.9, ++ 0, 0) || + + /* Find L ~= 100 areas (white surround). + */ +- im_extract_band( t[2], t[3], 0 ) || +- im_moreconst( t[3], t[4], 99 ) || ++ im_extract_band(t[2], t[3], 0) || ++ im_moreconst(t[3], t[4], 99) || + + /* Adjust white point and shadows. + */ +- im_lintra_vec( 3, darken, t[2], zero, t[5] ) || +- im_Lab2XYZ( t[5], t[6] ) || +- im_recomb( t[6], t[7], d652d50 ) || +- im_lintra_vec( 3, whitepoint, t[7], zero, t[8] ) || +- im_lintra( 1.5, t[8], 0.0, t[9] ) || +- im_XYZ2Lab( t[9], t[10] ) || +- im_lintra_vec( 3, one, t[10], shadow, t[11] ) || ++ im_lintra_vec(3, darken, t[2], zero, t[5]) || ++ im_Lab2XYZ(t[5], t[6]) || ++ im_recomb(t[6], t[7], d652d50) || ++ im_lintra_vec(3, whitepoint, t[7], zero, t[8]) || ++ im_lintra(1.5, t[8], 0.0, t[9]) || ++ im_XYZ2Lab(t[9], t[10]) || ++ im_lintra_vec(3, one, t[10], shadow, t[11]) || + + /* Make a solid white image. + */ +- im_black( t[12], t[4]->Xsize, t[4]->Ysize, 3 ) || +- im_lintra_vec( 3, zero, t[12], white, t[13] ) || ++ im_black(t[12], t[4]->Xsize, t[4]->Ysize, 3) || ++ im_lintra_vec(3, zero, t[12], white, t[13]) || + + /* Reattach border. + */ +- im_ifthenelse( t[4], t[13], t[11], t[14] ) || ++ im_ifthenelse(t[4], t[13], t[11], t[14]) || + + /* Sharpen. + */ +- im_Lab2LabQ( t[14], t[15] ) || +- im_sharpen( t[15], out, 11, 2.5, 40, 20, 0.5, 1.5 ) +- ); ++ im_Lab2LabQ(t[14], t[15]) || ++ im_sharpen(t[15], out, 11, 2.5, 40, 20, 0.5, 1.5)); + } + + /** +@@ -254,30 +253,30 @@ benchmark( IMAGE *in, IMAGE *out ) + * Returns: 0 on success, -1 on error + */ + int +-im_benchmarkn( IMAGE *in, IMAGE *out, int n ) ++im_benchmarkn(IMAGE *in, IMAGE *out, int n) + { + IMAGE *t[2]; + +- if( n == 0 ) ++ if (n == 0) + /* To sRGB. + */ +- return( im_LabQ2disp( in, out, im_col_displays( 7 ) ) ); +- else +- return( im_open_local_array( out, t, 2, "benchmarkn", "p" ) || +- benchmark( in, t[0] ) || ++ return (im_LabQ2disp(in, out, im_col_displays(7))); ++ else ++ return (im_open_local_array(out, t, 2, "benchmarkn", "p") || ++ benchmark(in, t[0]) || + + /* Expand back to the original size again ... + * benchmark does a 200 pixel crop plus a 10% shrink, + * so if we chain many of them together the image gets + * too small. + */ +- im_affinei_all( t[0], t[1], ++ im_affinei_all(t[0], t[1], + vips_interpolate_bilinear_static(), +- (double) in->Xsize / t[0]->Xsize, 0, 0, +- (double) in->Ysize / t[0]->Ysize, +- 0, 0 ) || ++ (double) in->Xsize / t[0]->Xsize, 0, 0, ++ (double) in->Ysize / t[0]->Ysize, ++ 0, 0) || + +- im_benchmarkn( t[1], out, n - 1 ) ); ++ im_benchmarkn(t[1], out, n - 1)); + } + + /** +@@ -293,14 +292,12 @@ im_benchmarkn( IMAGE *in, IMAGE *out, int n ) + * Returns: 0 on success, -1 on error + */ + int +-im_benchmark2( IMAGE *in, double *out ) ++im_benchmark2(IMAGE *in, double *out) + { +- IMAGE *t; ++ IMAGE *t; + +- return( +- !(t = im_open_local( in, "benchmarkn", "p" )) || +- im_benchmarkn( in, t, 1 ) || +- im_avg( t, out ) +- ); ++ return ( ++ !(t = im_open_local(in, "benchmarkn", "p")) || ++ im_benchmarkn(in, t, 1) || ++ im_avg(t, out)); + } +- +diff --git a/libvips/deprecated/im_bernd.c b/libvips/deprecated/im_bernd.c +index f11b021557..4b140f852b 100644 +--- a/libvips/deprecated/im_bernd.c ++++ b/libvips/deprecated/im_bernd.c +@@ -1,7 +1,7 @@ + /* @(#) Extract a tile from a pyramid as a jpeg + * @(#) +- * @(#) int +- * @(#) im_bernd( const char *tiffname, ++ * @(#) int ++ * @(#) im_bernd( const char *tiffname, + * @(#) int x, int y, int w, int h ) + * @(#) + * @(#) +@@ -18,28 +18,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -55,39 +55,39 @@ + #include + + static int +-extract( IMAGE *in, int x, int y, int w, int h ) ++extract(IMAGE *in, int x, int y, int w, int h) + { + IMAGE *t1; + int len; + char *buf; + +- if( !(t1 = im_open_local( in, "im_bernd:2", "p" )) || +- im_extract_area( in, t1, x, y, w, h ) || +- im_vips2bufjpeg( t1, in, 75, &buf, &len ) ) +- return( -1 ); ++ if (!(t1 = im_open_local(in, "im_bernd:2", "p")) || ++ im_extract_area(in, t1, x, y, w, h) || ++ im_vips2bufjpeg(t1, in, 75, &buf, &len)) ++ return (-1); + +- if( fwrite( buf, sizeof( char ), len, stdout ) != (size_t) len ) { +- im_error( "im_bernd", "%s", _( "error writing output" ) ); +- return( -1 ); ++ if (fwrite(buf, sizeof(char), len, stdout) != (size_t) len) { ++ im_error("im_bernd", "%s", _("error writing output")); ++ return (-1); + } +- fflush( stdout ); ++ fflush(stdout); + +- return( 0 ); ++ return (0); + } + + int +-im_bernd( const char *tiffname, int x, int y, int w, int h ) ++im_bernd(const char *tiffname, int x, int y, int w, int h) + { + IMAGE *in; + +- if( !(in = im_open( "im_bernd:1", "p" )) ) +- return( -1 ); +- if( im_tiff2vips( tiffname, in ) || +- extract( in, x, y, w, h ) ) { +- im_close( in ); +- return( -1 ); ++ if (!(in = im_open("im_bernd:1", "p"))) ++ return (-1); ++ if (im_tiff2vips(tiffname, in) || ++ extract(in, x, y, w, h)) { ++ im_close(in); ++ return (-1); + } +- im_close( in ); ++ im_close(in); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/deprecated/im_clamp.c b/libvips/deprecated/im_clamp.c +index 98234c2dbd..aa74a5b645 100644 +--- a/libvips/deprecated/im_clamp.c ++++ b/libvips/deprecated/im_clamp.c +@@ -14,28 +14,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -52,72 +52,74 @@ + #include + + int +-im_clamp( IMAGE *in, IMAGE *out, IMAGE *black, int hstep, int vstep ) +-{ PEL *p, *blk, *bline, *bexp; +-PEL *q, *outbuf; +-int rep; +-int x, y, bnd; +-int temp, blacky, newblacky; +- +-if( im_iocheck( in, out ) ) +- return( -1 ); +-if( in->Bbits != 8 || +- in->Coding != IM_CODING_NONE || in->BandFmt != IM_BANDFMT_UCHAR ) { +- im_error( "im_clamp", "%s", _( "bad input format" ) ); +- return( -1 ); +-} +-if( black->Bbits != 8 || +- black->Coding != IM_CODING_NONE || black->BandFmt != IM_BANDFMT_UCHAR ) { +- im_error( "im_clamp", "%s", _( "bad black format" ) ); +- return( -1 ); +-} +- +-/* Set up the output header. +- */ +-if( im_cp_desc( out, in ) ) +- return( -1 ); +-if( im_setupout( out ) ) +- return( -1 ); ++im_clamp(IMAGE *in, IMAGE *out, IMAGE *black, int hstep, int vstep) ++{ ++ PEL *p, *blk, *bline, *bexp; ++ PEL *q, *outbuf; ++ int rep; ++ int x, y, bnd; ++ int temp, blacky, newblacky; ++ ++ if (im_iocheck(in, out)) ++ return (-1); ++ if (in->Bbits != 8 || ++ in->Coding != IM_CODING_NONE || in->BandFmt != IM_BANDFMT_UCHAR) { ++ im_error("im_clamp", "%s", _("bad input format")); ++ return (-1); ++ } ++ if (black->Bbits != 8 || ++ black->Coding != IM_CODING_NONE || black->BandFmt != IM_BANDFMT_UCHAR) { ++ im_error("im_clamp", "%s", _("bad black format")); ++ return (-1); ++ } + +-/* Make buffer for expanded black line +- */ +-if( !(bline = (PEL *) im_malloc( out, black->Bands * hstep * in->Xsize )) ) +- return( -1 ); +-/* Make buffer we write to. +- */ +-if( !(outbuf = (PEL *) im_malloc( out, out->Bands * out->Xsize )) ) +- return( -1 ); +-blacky = -1; +-p = (PEL *) in->data; +- +-for( y = 0; y < in->Ysize; y++ ) { +- /* calc corresponding black line - get new one if different */ +- newblacky = (vstep * black->Ysize - in->Ysize + y)/vstep; +- if( newblacky != blacky){ +- blacky = newblacky; +- /* time to expand a new black line */ +- blk = (PEL *) (black->data + +- black->Xsize * black->Bands * blacky); +- for(bexp = bline, x = 0; x < black->Xsize; x++){ +- for(rep = 0; rep < hstep; rep++) +- for(q=blk, bnd = 0; bnd < in->Bands; bnd++) +- *bexp++ = *q++; +- blk += black->Bands; ++ /* Set up the output header. ++ */ ++ if (im_cp_desc(out, in)) ++ return (-1); ++ if (im_setupout(out)) ++ return (-1); ++ ++ /* Make buffer for expanded black line ++ */ ++ if (!(bline = (PEL *) im_malloc(out, black->Bands * hstep * in->Xsize))) ++ return (-1); ++ /* Make buffer we write to. ++ */ ++ if (!(outbuf = (PEL *) im_malloc(out, out->Bands * out->Xsize))) ++ return (-1); ++ blacky = -1; ++ p = (PEL *) in->data; ++ ++ for (y = 0; y < in->Ysize; y++) { ++ /* calc corresponding black line - get new one if different */ ++ newblacky = (vstep * black->Ysize - in->Ysize + y) / vstep; ++ if (newblacky != blacky) { ++ blacky = newblacky; ++ /* time to expand a new black line */ ++ blk = (PEL *) (black->data + ++ black->Xsize * black->Bands * blacky); ++ for (bexp = bline, x = 0; x < black->Xsize; x++) { ++ for (rep = 0; rep < hstep; rep++) ++ for (q = blk, bnd = 0; bnd < in->Bands; bnd++) ++ *bexp++ = *q++; ++ blk += black->Bands; ++ } + } +- } + +- /* correct a line of image */ +- bexp = bline; +- q = outbuf; +- for( x = 0; x < (out->Bands * out->Xsize); x++ ) { +- temp = ((int) *p++ - *bexp++); +- if( temp < 0 ) temp = 0; +- *q++ = (PEL)temp; ++ /* correct a line of image */ ++ bexp = bline; ++ q = outbuf; ++ for (x = 0; x < (out->Bands * out->Xsize); x++) { ++ temp = ((int) *p++ - *bexp++); ++ if (temp < 0) ++ temp = 0; ++ *q++ = (PEL) temp; + } + +- if( im_writeline( y, out, outbuf ) ) +- return( -1 ); +-} /* end of a line */ ++ if (im_writeline(y, out, outbuf)) ++ return (-1); ++ } /* end of a line */ + +-return( 0 ); ++ return (0); + } +diff --git a/libvips/deprecated/im_cmulnorm.c b/libvips/deprecated/im_cmulnorm.c +index 67783459d6..d61b29699f 100644 +--- a/libvips/deprecated/im_cmulnorm.c ++++ b/libvips/deprecated/im_cmulnorm.c +@@ -4,7 +4,7 @@ + * + * Author: Nicos Dessipris + * Written on: 02/05/1990 +- * Modified on: ++ * Modified on: + * 15/4/97 JC + * - thrown away and redone in terms of im_multiply() + * 9/7/02 JC +@@ -16,28 +16,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -60,24 +60,24 @@ + * + * im_cmulnorm() multiplies two complex images. The complex output is + * normalised to 1 by dividing both the real and the imaginary part of each +- * pel with the norm. This is useful for phase correlation. ++ * pel with the norm. This is useful for phase correlation. + * +- * This operation used to be important, but now simply calls im_multiply() ++ * This operation used to be important, but now simply calls im_multiply() + * then im_sign(). + * + * See also: im_multiply(), im_sign(). + * + * Returns: 0 on success, -1 on error + */ +-int +-im_cmulnorm( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_cmulnorm(IMAGE *in1, IMAGE *in2, IMAGE *out) + { + IMAGE *t1; + +- if( !(t1 = im_open_local( out, "im_cmulnorm:1", "p" )) || +- im_multiply( in1, in2, t1 ) || +- im_sign( t1, out ) ) +- return( -1 ); +- +- return( 0 ); ++ if (!(t1 = im_open_local(out, "im_cmulnorm:1", "p")) || ++ im_multiply(in1, in2, t1) || ++ im_sign(t1, out)) ++ return (-1); ++ ++ return (0); + } +diff --git a/libvips/deprecated/im_convsub.c b/libvips/deprecated/im_convsub.c +index 6936d68345..3e6f8b9b39 100644 +--- a/libvips/deprecated/im_convsub.c ++++ b/libvips/deprecated/im_convsub.c +@@ -16,33 +16,33 @@ + * + * Author: Nicos Dessipris + * Written on: 29/04/1991 +- * Modified on: ++ * Modified on: + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -59,313 +59,299 @@ + #include + + /* Create multiplication luts for all non zero elements of the original mask; +- * which is kept in buffer of length buffersize +- * cnt is needed for freeing luts ++ * which is kept in buffer of length buffersize ++ * cnt is needed for freeing luts + */ + static int +-im__create_int_luts( int *buffer, int buffersize, +- int **orig_luts, int **luts, int *cnt ) ++im__create_int_luts(int *buffer, int buffersize, ++ int **orig_luts, int **luts, int *cnt) + { + int *pbuffer; + int *buf1, *buf2, *pbuf1, *pbuf2; + int i, j; + int min, max; +- int mark; /* used to mark the buffer mark = max+1 */ ++ int mark; /* used to mark the buffer mark = max+1 */ + int counter; /* counts the no of unique elms in mask; returned in cnt*/ + +- buf1 = (int*)calloc( (unsigned)buffersize, sizeof(int) ); +- buf2 = (int*)calloc( (unsigned)buffersize, sizeof(int) ); +- if ( ( buf1 == NULL ) || ( buf2 == NULL ) ) +- { +- im_error( "im_create_int_luts", "%s", _( "calloc failed (1)") ); +- return( -1 ); +- } ++ buf1 = (int *) calloc((unsigned) buffersize, sizeof(int)); ++ buf2 = (int *) calloc((unsigned) buffersize, sizeof(int)); ++ if ((buf1 == NULL) || (buf2 == NULL)) { ++ im_error("im_create_int_luts", "%s", _("calloc failed (1)")); ++ return (-1); ++ } + + pbuffer = buffer; + pbuf1 = buf1; + /* find max and copy mask to buf1 */ + max = *pbuffer; +- for ( i=0; i < buffersize; i++ ) +- { +- if ( *pbuffer > max ) ++ for (i = 0; i < buffersize; i++) { ++ if (*pbuffer > max) + max = *pbuffer; + *pbuf1++ = *pbuffer++; +- } ++ } + mark = max + 1; + pbuf1 = buf1; + pbuf2 = buf2; + counter = 0; +-/* find a min at a time; put it into buf2 and mark all values of +- * buf1 equal to found min, to INT_MAX +- */ +- for ( i=0; i < buffersize; i++ ) +- { ++ /* find a min at a time; put it into buf2 and mark all values of ++ * buf1 equal to found min, to INT_MAX ++ */ ++ for (i = 0; i < buffersize; i++) { + min = mark + 1; /* force min to be greater than mark */ + pbuf1 = buf1; + /* find a min */ +- for ( j=0; j < buffersize; j++ ) +- { +- if ( *pbuf1 < min ) ++ for (j = 0; j < buffersize; j++) { ++ if (*pbuf1 < min) + min = *pbuf1; + pbuf1++; +- } +- if ( min == mark ) /* all min are found */ ++ } ++ if (min == mark) /* all min are found */ + break; + *pbuf2++ = min; + counter++; + pbuf1 = buf1; +- for ( j=0; j < buffersize; j++ ) /* mark values equal to min */ +- { +- if ( *pbuf1 == min ) ++ for (j = 0; j < buffersize; j++) /* mark values equal to min */ ++ { ++ if (*pbuf1 == min) + *pbuf1 = mark; + pbuf1++; +- } +- } +-/* buf2 should keep now counter unique values of the mask, descending order +- * Malloc counter luts and initialise them +- */ ++ } ++ } ++ /* buf2 should keep now counter unique values of the mask, descending order ++ * Malloc counter luts and initialise them ++ */ + pbuf2 = buf2; +- for ( i=0; ixsize * m->ysize */ ++ int os; /* size of an input line of data */ ++ int ms; /* is m->xsize * m->ysize */ + int **lut_orig, **lut; + int lutcnt = 0; + int rounding, sum; + int tempsize; + +-/* Check input, output and vars */ +- if ((xskip < 1)||(yskip < 1)) +- { +- im_error( "im_convsub", "%s", _( "xskip and yskip must be >= 1") ); +- return(-1); +- } ++ /* Check input, output and vars */ ++ if ((xskip < 1) || (yskip < 1)) { ++ im_error("im_convsub", "%s", _("xskip and yskip must be >= 1")); ++ return (-1); ++ } + if (im_iocheck(in, out) == -1) +- return( -1 ); +- +- if ( (in->Coding != IM_CODING_NONE)|| +- (in->BandFmt != IM_BANDFMT_UCHAR) ) +- { +- im_error( "im_convsub", "%s", _( "nput should be unsigned char uncoded") ); +- return(-1); +- } ++ return (-1); ++ ++ if ((in->Coding != IM_CODING_NONE) || ++ (in->BandFmt != IM_BANDFMT_UCHAR)) { ++ im_error("im_convsub", "%s", _("nput should be unsigned char uncoded")); ++ return (-1); ++ } + +-/* Prepare output */ ++ /* Prepare output */ + if (im_cp_desc(out, in) == -1) +- return( -1 ); +- tempsize = in->Xsize/xskip; +- while ( 1 ) +- { +- if ( tempsize * xskip + m->xsize < in->Xsize ) ++ return (-1); ++ tempsize = in->Xsize / xskip; ++ while (1) { ++ if (tempsize * xskip + m->xsize < in->Xsize) + break; + else + tempsize--; +- if ( tempsize < 0 ) ++ if (tempsize < 0) + break; +- } +- out->Xsize = tempsize; +- tempsize = in->Ysize/yskip; +- while ( 1 ) +- { +- if ( tempsize * yskip + m->ysize < in->Ysize ) ++ } ++ out->Xsize = tempsize; ++ tempsize = in->Ysize / yskip; ++ while (1) { ++ if (tempsize * yskip + m->ysize < in->Ysize) + break; + else + tempsize--; +- if ( tempsize < 0 ) ++ if (tempsize < 0) + break; +- } +- out->Ysize = tempsize; +- if ( ( out->Xsize < 2 )||( out->Ysize < 2 ) ) { +- im_error( "im_convsub", "%s", _( "too small output sizes") ); +- return(-1); ++ } ++ out->Ysize = tempsize; ++ if ((out->Xsize < 2) || (out->Ysize < 2)) { ++ im_error("im_convsub", "%s", _("too small output sizes")); ++ return (-1); + } + +- if( im_setupout(out) == -1) +- return(-1); ++ if (im_setupout(out) == -1) ++ return (-1); + +-/* Malloc one line of output data */ ++ /* Malloc one line of output data */ + os = out->Xsize * out->Bands; +- if ( (line=(PEL*)calloc( (unsigned)os, sizeof(char))) == NULL) { +- im_error( "im_convsub", "%s", _( "unable to calloc(1)") ); +- return(-1); ++ if ((line = (PEL *) calloc((unsigned) os, sizeof(char))) == NULL) { ++ im_error("im_convsub", "%s", _("unable to calloc(1)")); ++ return (-1); + } +- +-/* Malloc pointers and put them at correct location */ ++ ++ /* Malloc pointers and put them at correct location */ + ms = m->xsize * m->ysize; +- count = 0; /* exclude the non-zero elms */ ++ count = 0; /* exclude the non-zero elms */ + pm = m->coeff; +- for ( i=0; idata; ++ /* copy the non-zero elms of the original mask and set pointers */ ++ i = 0; ++ input = (PEL *) in->data; + pm = m->coeff; + pnewm = newm; +- for (y=0; yysize; y++) +- { +- for (x=0; xxsize; x++) +- { +- if ( *pm != 0 ) +- { ++ for (y = 0; y < m->ysize; y++) { ++ for (x = 0; x < m->xsize; x++) { ++ if (*pm != 0) { + *pnewm++ = *pm; +- pnt[i] = (input +(x + y*in->Xsize) * in->Bands); ++ pnt[i] = (input + (x + y * in->Xsize) * in->Bands); + i++; +- } +- pm++; + } ++ pm++; + } ++ } + +- if ( i != count ) { +- im_error( "im_convsub", "%s", _( "impossible state") ); +- return(-1); } ++ if (i != count) { ++ im_error("im_convsub", "%s", _("impossible state")); ++ return (-1); ++ } + +-/* Malloc pointers; not all lut_orig are used necessarily */ +- lut_orig = (int**)calloc((unsigned)count, sizeof(int**) ); +- lut = (int**)calloc((unsigned)count, sizeof(int**) ); +- if ( (lut == NULL) || (lut_orig == NULL) ) { +- im_error( "im_conv", "%s", _( "unable to calloc(1)") ); +- return(-1); } ++ /* Malloc pointers; not all lut_orig are used necessarily */ ++ lut_orig = (int **) calloc((unsigned) count, sizeof(int **)); ++ lut = (int **) calloc((unsigned) count, sizeof(int **)); ++ if ((lut == NULL) || (lut_orig == NULL)) { ++ im_error("im_conv", "%s", _("unable to calloc(1)")); ++ return (-1); ++ } + +-/* Create luts; count is needed for freeing pointers. Not all lut_orig are used +- * if zero elms are detected. +- */ +- if ( im__create_int_luts(newm, count, lut_orig, lut, &lutcnt ) == -1 ) +- { +- im_error( "im_convsub", "%s", _( "im_create_int_luts failed") ); +- return(-1); +- } ++ /* Create luts; count is needed for freeing pointers. Not all lut_orig are used ++ * if zero elms are detected. ++ */ ++ if (im__create_int_luts(newm, count, lut_orig, lut, &lutcnt) == -1) { ++ im_error("im_convsub", "%s", _("im_create_int_luts failed")); ++ return (-1); ++ } + +- rounding = m->scale/2; ++ rounding = m->scale / 2; + +-/* Output out->Ysize processed lines */ +- for(y=0; y < out->Ysize; y++) +- { ++ /* Output out->Ysize processed lines */ ++ for (y = 0; y < out->Ysize; y++) { + cpline = line; +- for (i=0; iXsize * in->Bands * yskip ); +- } ++ /* skip yskip input lines */ ++ pnt[i] += (in->Xsize * in->Bands * yskip); ++ } + + /* process out->Xsize points */ +- for( x = 0; x < out->Xsize; x++ ) +- { +- for (i=0; iXsize; x++) { ++ for (i = 0; i < count; i++) { /* skip xskip elms */ + cpnt2[i] = cpnt1[i]; + cpnt1[i] += xskip * in->Bands; +- } +- for ( b=0; bBands; b++ ) +- { ++ } ++ for (b = 0; b < out->Bands; b++) { + sum = 0; +- for (i=0; iscale ) + m->offset; +- +- if ( sum < (int)0 ) +- { n_clipped++; sum = (int)0; } +- else if ( sum > (int)255) +- { p_clipped++; sum = (int)255; } +- *cpline++ = (unsigned char)sum; + } ++ sum = ((sum + rounding) / m->scale) + m->offset; ++ ++ if (sum < (int) 0) { ++ n_clipped++; ++ sum = (int) 0; ++ } ++ else if (sum > (int) 255) { ++ p_clipped++; ++ sum = (int) 255; ++ } ++ *cpline++ = (unsigned char) sum; + } ++ } + + /* Output the calculated line */ +- if ( im_writeline(y, out, (PEL*)line) == -1 ) +- { +- free((char*)line); free((char*)newm); +- free((char*)pnts); +- free((char*)cpnt1s); free((char*)cpnt2s); +- for ( i=0; inickname = "csv"; +- object_class->description = _( "CSV" ); ++ object_class->description = _("CSV"); + + format_class->load = im_csv2vips; + format_class->save = im_vips2csv; +@@ -116,8 +116,8 @@ vips_format_csv_class_init( VipsFormatCsvClass *class ) + } + + static void +-vips_format_csv_init( VipsFormatCsv *object ) ++vips_format_csv_init(VipsFormatCsv *object) + { + } + +-G_DEFINE_TYPE( VipsFormatCsv, vips_format_csv, VIPS_TYPE_FORMAT ); ++G_DEFINE_TYPE(VipsFormatCsv, vips_format_csv, VIPS_TYPE_FORMAT); +diff --git a/libvips/deprecated/im_debugim.c b/libvips/deprecated/im_debugim.c +index b8b8ee2a2b..67e5be0554 100644 +--- a/libvips/deprecated/im_debugim.c ++++ b/libvips/deprecated/im_debugim.c +@@ -3,7 +3,7 @@ + * @(#) For debuging only + * @(#) is either memory mapped or in a buffer. + * @(#) +- * @(#) void ++ * @(#) void + * @(#) im_debugim( in ) + * @(#) IMAGE *in; + * @(#) +@@ -24,28 +24,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -59,78 +59,101 @@ + #include + #include + +-int +-im_debugim( IMAGE *in ) ++int ++im_debugim(IMAGE *in) + { +-/* Check our args. */ +- if( im_incheck( in ) ) +- return( -1 ); +- if( in->Coding != IM_CODING_NONE ) { +- im_error( "im_debugim", "%s", _( "input must be uncoded" ) ); +- return( -1 ); ++ /* Check our args. */ ++ if (im_incheck(in)) ++ return (-1); ++ if (in->Coding != IM_CODING_NONE) { ++ im_error("im_debugim", "%s", _("input must be uncoded")); ++ return (-1); + } + + /* What type? First define the loop we want to perform for all types. */ + #define loopuc(TYPE) \ +- { TYPE *p = (TYPE *) in->data; \ ++ { \ ++ TYPE *p = (TYPE *) in->data; \ + int x, y, z; \ +- \ +- for ( y=0; yYsize; y++ ) {\ +- for ( x=0; xXsize; x++ ) {\ +- for ( z=0; zBands; z++ ) {\ +- fprintf(stderr, "%4d", (TYPE)*p++ );\ ++\ ++ for (y = 0; y < in->Ysize; y++) { \ ++ for (x = 0; x < in->Xsize; x++) { \ ++ for (z = 0; z < in->Bands; z++) { \ ++ fprintf(stderr, "%4d", (TYPE) *p++); \ + } \ + } \ +- fprintf(stderr, "\n");\ ++ fprintf(stderr, "\n"); \ + } \ +- } ++ } + + #define loop(TYPE) \ +- { TYPE *p = (TYPE *) in->data; \ ++ { \ ++ TYPE *p = (TYPE *) in->data; \ + int x, y, z; \ +- \ +- for ( y=0; yYsize; y++ ) {\ +- for ( x=0; xXsize; x++ ) {\ +- for ( z=0; zBands; z++ ) {\ +- fprintf(stderr, "%g\t", (double)*p++ );\ ++\ ++ for (y = 0; y < in->Ysize; y++) { \ ++ for (x = 0; x < in->Xsize; x++) { \ ++ for (z = 0; z < in->Bands; z++) { \ ++ fprintf(stderr, "%g\t", (double) *p++); \ + } \ + } \ +- fprintf(stderr, "\n");\ ++ fprintf(stderr, "\n"); \ + } \ +- } ++ } + + #define loopcmplx(TYPE) \ +- { TYPE *p = (TYPE *) in->data; \ ++ { \ ++ TYPE *p = (TYPE *) in->data; \ + int x, y, z; \ +- \ +- for ( y=0; yYsize; y++ ) {\ +- for ( x=0; xXsize; x++ ) {\ +- for ( z=0; zBands; z++ ) {\ +- fprintf(stderr,"re=%g\t",(double)*p++);\ +- fprintf(stderr,"im=%g\t",(double)*p++);\ ++\ ++ for (y = 0; y < in->Ysize; y++) { \ ++ for (x = 0; x < in->Xsize; x++) { \ ++ for (z = 0; z < in->Bands; z++) { \ ++ fprintf(stderr, "re=%g\t", (double) *p++); \ ++ fprintf(stderr, "im=%g\t", (double) *p++); \ + } \ + } \ +- fprintf(stderr, "\n");\ ++ fprintf(stderr, "\n"); \ + } \ +- } +- +-/* Now generate code for all types. */ +- switch( in->BandFmt ) { +- case IM_BANDFMT_UCHAR: loopuc(unsigned char); break; +- case IM_BANDFMT_CHAR: loop(char); break; +- case IM_BANDFMT_USHORT: loop(unsigned short); break; +- case IM_BANDFMT_SHORT: loop(short); break; +- case IM_BANDFMT_UINT: loop(unsigned int); break; +- case IM_BANDFMT_INT: loop(int); break; +- case IM_BANDFMT_FLOAT: loop(float); break; +- case IM_BANDFMT_DOUBLE: loop(double); break; +- case IM_BANDFMT_COMPLEX: loopcmplx(float); break; +- case IM_BANDFMT_DPCOMPLEX: loopcmplx(double); break; +- +- default: +- im_error( "im_debugim", "%s", _( "unknown input format") ); +- return( -1 ); + } + +- return( 0 ); ++ /* Now generate code for all types. */ ++ switch (in->BandFmt) { ++ case IM_BANDFMT_UCHAR: ++ loopuc(unsigned char); ++ break; ++ case IM_BANDFMT_CHAR: ++ loop(char); ++ break; ++ case IM_BANDFMT_USHORT: ++ loop(unsigned short); ++ break; ++ case IM_BANDFMT_SHORT: ++ loop(short); ++ break; ++ case IM_BANDFMT_UINT: ++ loop(unsigned int); ++ break; ++ case IM_BANDFMT_INT: ++ loop(int); ++ break; ++ case IM_BANDFMT_FLOAT: ++ loop(float); ++ break; ++ case IM_BANDFMT_DOUBLE: ++ loop(double); ++ break; ++ case IM_BANDFMT_COMPLEX: ++ loopcmplx(float); ++ break; ++ case IM_BANDFMT_DPCOMPLEX: ++ loopcmplx(double); ++ break; ++ ++ default: ++ im_error("im_debugim", "%s", _("unknown input format")); ++ return (-1); ++ } ++ ++ return (0); + } +diff --git a/libvips/deprecated/im_dif_std.c b/libvips/deprecated/im_dif_std.c +index 0de404ae1a..1c75b32f23 100644 +--- a/libvips/deprecated/im_dif_std.c ++++ b/libvips/deprecated/im_dif_std.c +@@ -10,28 +10,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -48,44 +48,47 @@ + #include + #include + +-static int +-im__mean_std_int_buffer( int *buffer, int size, +- double *pmean, double *pstd ) ++static int ++im__mean_std_int_buffer(int *buffer, int size, ++ double *pmean, double *pstd) + { + double mean, std; + register int i; +- int sumf; ++ int sumf; + int temp; + int *pbuffer; + int sumf2; + double correction; /* calulates the correction term for the variance */ +- double variance; /* = (sumf2 - correction)/n */ +- ++ double variance; /* = (sumf2 - correction)/n */ ++ + if (size <= 0) { +- im_error( "im_mean_std_int_buffer", "%s", _( "wrong args") ); +- return(-1); ++ im_error("im_mean_std_int_buffer", "%s", _("wrong args")); ++ return (-1); + } + +- mean = 0.0; std = 0.0; +- sumf = 0; sumf2 = 0; ++ mean = 0.0; ++ std = 0.0; ++ sumf = 0; ++ sumf2 = 0; + pbuffer = buffer; +- for (i=0; iBands != 1)||(im->BandFmt != IM_BANDFMT_UCHAR)) { +- im_error( "im_dif_std", "%s", _( "Unable to accept input") ); +- return(-1);} +- if ( (xpos + xsize + dx > im->Xsize)|| (ypos + ysize + dy > im->Ysize) ) { +- im_error( "im_dif_std", "%s", _( "wrong args") ); +- return(-1); } ++ if ((im->Bands != 1) || (im->BandFmt != IM_BANDFMT_UCHAR)) { ++ im_error("im_dif_std", "%s", _("Unable to accept input")); ++ return (-1); ++ } ++ if ((xpos + xsize + dx > im->Xsize) || (ypos + ysize + dy > im->Ysize)) { ++ im_error("im_dif_std", "%s", _("wrong args")); ++ return (-1); ++ } + + bufsize = xsize * ysize; +- buf = (int *)calloc( (unsigned)bufsize, sizeof(int) ); +- if ( buf == NULL ) { +- im_error( "im_dif_std", "%s", _( "calloc failed") ); +- return(-1); } +- input = (PEL*)im->data; +- input += ( ypos * im->Xsize + xpos ); ++ buf = (int *) calloc((unsigned) bufsize, sizeof(int)); ++ if (buf == NULL) { ++ im_error("im_dif_std", "%s", _("calloc failed")); ++ return (-1); ++ } ++ input = (PEL *) im->data; ++ input += (ypos * im->Xsize + xpos); + ofst = dy * im->Xsize + dx; + pbuf = buf; +- for ( y=0; yXsize; +- for ( x=0; xnickname = "exr"; +- object_class->description = _( "OpenEXR" ); ++ object_class->description = _("OpenEXR"); + + format_class->is_a = isexr; + format_class->load = im_exr2vips; +@@ -111,9 +111,8 @@ vips_format_exr_class_init( VipsFormatExrClass *class ) + } + + static void +-vips_format_exr_init( VipsFormatExr *object ) ++vips_format_exr_init(VipsFormatExr *object) + { + } + +-G_DEFINE_TYPE( VipsFormatExr, vips_format_exr, VIPS_TYPE_FORMAT ); +- ++G_DEFINE_TYPE(VipsFormatExr, vips_format_exr, VIPS_TYPE_FORMAT); +diff --git a/libvips/deprecated/im_fav4.c b/libvips/deprecated/im_fav4.c +index a9cf26ca34..0cfc62c08a 100644 +--- a/libvips/deprecated/im_fav4.c ++++ b/libvips/deprecated/im_fav4.c +@@ -4,28 +4,28 @@ Copyright (C) 1992, Kirk Martinez, History of Art Dept, Birkbeck College + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -48,50 +48,50 @@ Copyright (C) 1992, Kirk Martinez, History of Art Dept, Birkbeck College + * @in: array of 4 input #IMAGE s + * @out: output #IMAGE + * +- * Average four identical images. ++ * Average four identical images. + * + * Deprecated. +-*/ ++ */ + int +-im_fav4( IMAGE **in, IMAGE *out) ++im_fav4(IMAGE **in, IMAGE *out) + { + PEL *result, *buffer, *p1, *p2, *p3, *p4; +- int x,y; ++ int x, y; + int linebytes, PICY; + +-/* check IMAGEs parameters +-*/ +-if(im_iocheck(in[1], out)) return(-1); +- +-/* BYTE images only! +-*/ +-if( (in[0]->BandFmt != IM_BANDFMT_CHAR) && (in[0]->BandFmt != IM_BANDFMT_UCHAR)) return(-1); +- +-if ( im_cp_desc(out, in[1]) == -1) /* copy image descriptors */ +- return(-1); +-if ( im_setupout(out) == -1) +- return(-1); +- +-linebytes = in[0]->Xsize * in[0]->Bands; +-PICY = in[0]->Ysize; +-buffer = (PEL*)im_malloc(NULL,linebytes); +-memset(buffer, 0, linebytes); +- +- p1 = (PEL*)in[0]->data; +- p2 = (PEL*)in[1]->data; +- p3 = (PEL*)in[2]->data; +- p4 = (PEL*)in[3]->data; +- +-for (y = 0; y < PICY; y++) +- { +- result = buffer; +- /* average 4 pels with rounding, for whole line*/ +- for (x = 0; x < linebytes; x++) { +- *result++ = (PEL)((int)((int)*p1++ + (int)*p2++ + (int)*p3++ + (int)*p4++ +2) >> 2); ++ /* check IMAGEs parameters ++ */ ++ if (im_iocheck(in[1], out)) ++ return (-1); ++ ++ /* BYTE images only! ++ */ ++ if ((in[0]->BandFmt != IM_BANDFMT_CHAR) && (in[0]->BandFmt != IM_BANDFMT_UCHAR)) ++ return (-1); ++ ++ if (im_cp_desc(out, in[1]) == -1) /* copy image descriptors */ ++ return (-1); ++ if (im_setupout(out) == -1) ++ return (-1); ++ ++ linebytes = in[0]->Xsize * in[0]->Bands; ++ PICY = in[0]->Ysize; ++ buffer = (PEL *) im_malloc(NULL, linebytes); ++ memset(buffer, 0, linebytes); ++ ++ p1 = (PEL *) in[0]->data; ++ p2 = (PEL *) in[1]->data; ++ p3 = (PEL *) in[2]->data; ++ p4 = (PEL *) in[3]->data; ++ ++ for (y = 0; y < PICY; y++) { ++ result = buffer; ++ /* average 4 pels with rounding, for whole line*/ ++ for (x = 0; x < linebytes; x++) { ++ *result++ = (PEL) ((int) ((int) *p1++ + (int) *p2++ + (int) *p3++ + (int) *p4++ + 2) >> 2); + } +- im_writeline(y,out, buffer); ++ im_writeline(y, out, buffer); + } +-im_free(buffer); +-return(0); ++ im_free(buffer); ++ return (0); + } +- +diff --git a/libvips/deprecated/im_freq_mask.c b/libvips/deprecated/im_freq_mask.c +index c24d9904f2..09eae93ea7 100644 +--- a/libvips/deprecated/im_freq_mask.c ++++ b/libvips/deprecated/im_freq_mask.c +@@ -4,35 +4,35 @@ + * Written on: Nov 1991 + * Updated on: Dec 1991 + * 20/9/95 JC +- * - modernised ++ * - modernised + * 22/3/10 + * - gtkdoc + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,189 +51,189 @@ + + /* Make a mask image. + */ +-static int +-build_freq_mask( IMAGE *out, int xs, int ys, ImMaskType flag, va_list ap ) ++static int ++build_freq_mask(IMAGE *out, int xs, int ys, ImMaskType flag, va_list ap) + { + /* May be fewer than 4 args ... but extract them all anyway. Should be + * safe. + */ +- double p0 = va_arg( ap, double ); +- double p1 = va_arg( ap, double ); +- double p2 = va_arg( ap, double ); +- double p3 = va_arg( ap, double ); +- double p4 = va_arg( ap, double ); ++ double p0 = va_arg(ap, double); ++ double p1 = va_arg(ap, double); ++ double p2 = va_arg(ap, double); ++ double p3 = va_arg(ap, double); ++ double p4 = va_arg(ap, double); + + VipsImage *t; + +- switch( flag ) { ++ switch (flag) { + case IM_MASK_IDEAL_HIGHPASS: +- if( vips_mask_ideal( &t, xs, ys, p0, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_ideal(&t, xs, ys, p0, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_IDEAL_LOWPASS: +- if( vips_mask_ideal( &t, xs, ys, p0, +- "reject", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_ideal(&t, xs, ys, p0, ++ "reject", TRUE, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_BUTTERWORTH_HIGHPASS: +- if( vips_mask_butterworth( &t, xs, ys, p0, p1, p2, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_butterworth(&t, xs, ys, p0, p1, p2, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_BUTTERWORTH_LOWPASS: +- if( vips_mask_butterworth( &t, xs, ys, p0, p1, p2, +- "reject", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_butterworth(&t, xs, ys, p0, p1, p2, ++ "reject", TRUE, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_GAUSS_HIGHPASS: +- if( vips_mask_gaussian( &t, xs, ys, p0, p1, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_gaussian(&t, xs, ys, p0, p1, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_GAUSS_LOWPASS: +- if( vips_mask_gaussian( &t, xs, ys, p0, p1, +- "reject", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_gaussian(&t, xs, ys, p0, p1, ++ "reject", TRUE, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_IDEAL_RINGPASS: +- if( vips_mask_ideal_ring( &t, xs, ys, p0, p1, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_ideal_ring(&t, xs, ys, p0, p1, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_IDEAL_RINGREJECT: +- if( vips_mask_ideal_ring( &t, xs, ys, p0, p1, +- "reject", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_ideal_ring(&t, xs, ys, p0, p1, ++ "reject", TRUE, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_BUTTERWORTH_RINGPASS: +- if( vips_mask_butterworth_ring( &t, xs, ys, p0, p1, p2, p3, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_butterworth_ring(&t, xs, ys, p0, p1, p2, p3, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_BUTTERWORTH_RINGREJECT: +- if( vips_mask_butterworth_ring( &t, xs, ys, p0, p1, p2, p3, +- "reject", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_butterworth_ring(&t, xs, ys, p0, p1, p2, p3, ++ "reject", TRUE, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_GAUSS_RINGPASS: +- if( vips_mask_gaussian_ring( &t, xs, ys, p0, p1, p2, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_gaussian_ring(&t, xs, ys, p0, p1, p2, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_GAUSS_RINGREJECT: +- if( vips_mask_gaussian_ring( &t, xs, ys, p0, p1, p2, +- "reject", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_gaussian_ring(&t, xs, ys, p0, p1, p2, ++ "reject", TRUE, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_FRACTAL_FLT: +- if( vips_mask_fractal( &t, xs, ys, p0, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_fractal(&t, xs, ys, p0, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_IDEAL_BANDPASS: +- if( vips_mask_ideal_band( &t, xs, ys, p0, p1, p2, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_ideal_band(&t, xs, ys, p0, p1, p2, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_IDEAL_BANDREJECT: +- if( vips_mask_ideal_band( &t, xs, ys, p0, p1, p2, +- "reject", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_ideal_band(&t, xs, ys, p0, p1, p2, ++ "reject", TRUE, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_BUTTERWORTH_BANDPASS: +- if( vips_mask_butterworth_band( &t, xs, ys, p0, p1, p2, p3, p4, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_butterworth_band(&t, xs, ys, p0, p1, p2, p3, p4, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_BUTTERWORTH_BANDREJECT: +- if( vips_mask_butterworth_band( &t, xs, ys, p0, p1, p2, p3, p4, +- "reject", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_butterworth_band(&t, xs, ys, p0, p1, p2, p3, p4, ++ "reject", TRUE, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_GAUSS_BANDPASS: +- if( vips_mask_gaussian_band( &t, xs, ys, p0, p1, p2, p3, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_gaussian_band(&t, xs, ys, p0, p1, p2, p3, ++ NULL)) ++ return (-1); + break; + + case IM_MASK_GAUSS_BANDREJECT: +- if( vips_mask_gaussian_band( &t, xs, ys, p0, p1, p2, p3, +- "reject", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_mask_gaussian_band(&t, xs, ys, p0, p1, p2, p3, ++ "reject", TRUE, ++ NULL)) ++ return (-1); + break; + + default: +- im_error( "im_freq_mask", "%s", _( "unimplemented mask type" ) ); +- return( -1 ); ++ im_error("im_freq_mask", "%s", _("unimplemented mask type")); ++ return (-1); + } + +- if( im_copy( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (im_copy(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_flt_image_freq( IMAGE *in, IMAGE *out, ImMaskType flag, ... ) ++int ++im_flt_image_freq(IMAGE *in, IMAGE *out, ImMaskType flag, ...) + { +- IMAGE *mask = im_open_local( out, "tempmask", "p" ); ++ IMAGE *mask = im_open_local(out, "tempmask", "p"); + va_list ap; + +- if( !mask ) +- return( -1 ); ++ if (!mask) ++ return (-1); + + /* Generate mask. + */ +- va_start( ap, flag ); +- if( build_freq_mask( mask, in->Xsize, in->Ysize, flag, ap ) ) +- return( -1 ); +- va_end( ap ); ++ va_start(ap, flag); ++ if (build_freq_mask(mask, in->Xsize, in->Ysize, flag, ap)) ++ return (-1); ++ va_end(ap); + +- if( im_freqflt( in, mask, out ) ) +- return( -1 ); ++ if (im_freqflt(in, mask, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-im_create_fmask( IMAGE *out, int xsize, int ysize, ImMaskType flag, ... ) ++im_create_fmask(IMAGE *out, int xsize, int ysize, ImMaskType flag, ...) + { + va_list ap; + +- va_start( ap, flag ); +- if( build_freq_mask( out, xsize, ysize, flag, ap ) ) +- return( -1 ); +- va_end( ap ); ++ va_start(ap, flag); ++ if (build_freq_mask(out, xsize, ysize, flag, ap)) ++ return (-1); ++ va_end(ap); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/deprecated/im_gadd.c b/libvips/deprecated/im_gadd.c +index 8f13aa3f6c..416a0bd2b7 100644 +--- a/libvips/deprecated/im_gadd.c ++++ b/libvips/deprecated/im_gadd.c +@@ -1,10 +1,10 @@ +-/* @(#) Generalised addition of two vasari images using the routines ++/* @(#) Generalised addition of two vasari images using the routines + * @(#) im_gaddim or im_gfadd + * @(#) Convention to ease the complilation time. + * @(#) Function im_gadd() assumes that the both input files + * @(#) are either memory mapped or in a buffer. + * @(#) Images must have the same no of bands and must not be complex +- * @(#) No check for overflow is carried out. ++ * @(#) No check for overflow is carried out. + * @(#) + * @(#) int im_gadd(a, in1, b, in2, c, out) + * @(#) IMAGE *in1, *in2, *out; +@@ -17,33 +17,33 @@ + * + * Author: Nicos Dessipris + * Written on: 02/05/1990 +- * Modified on: ++ * Modified on: + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -70,59 +70,60 @@ int im_gaddim(double a, IMAGE *in1, double b, IMAGE *in2, double c, IMAGE *out); + * + * Deprecated. + */ +-int im_gadd(double a, IMAGE *in1, double b, IMAGE *in2, double c, IMAGE *out) ++int ++im_gadd(double a, IMAGE *in1, double b, IMAGE *in2, double c, IMAGE *out) + { + int flagint = 0; + int flagfloat = 0; + int value = 0; + +- switch(in1->BandFmt) { +- case IM_BANDFMT_UCHAR: +- case IM_BANDFMT_CHAR: +- case IM_BANDFMT_USHORT: +- case IM_BANDFMT_SHORT: +- case IM_BANDFMT_UINT: +- case IM_BANDFMT_INT: +- flagint = 1; +- break; +- case IM_BANDFMT_FLOAT: +- case IM_BANDFMT_DOUBLE: +- flagfloat = 1; +- break; +- default: im_error("im_gadd","%s", _("Unable to accept image1")); +- return(-1); +- } +- switch(in2->BandFmt) { +- case IM_BANDFMT_UCHAR: +- case IM_BANDFMT_CHAR: +- case IM_BANDFMT_USHORT: +- case IM_BANDFMT_SHORT: +- case IM_BANDFMT_UINT: +- case IM_BANDFMT_INT: +- flagint = 1; +- break; +- case IM_BANDFMT_FLOAT: +- case IM_BANDFMT_DOUBLE: +- flagfloat = 1; +- break; +- default: im_error("im_gadd","%s", _("Unable to accept image1")); +- return(-1); +- } ++ switch (in1->BandFmt) { ++ case IM_BANDFMT_UCHAR: ++ case IM_BANDFMT_CHAR: ++ case IM_BANDFMT_USHORT: ++ case IM_BANDFMT_SHORT: ++ case IM_BANDFMT_UINT: ++ case IM_BANDFMT_INT: ++ flagint = 1; ++ break; ++ case IM_BANDFMT_FLOAT: ++ case IM_BANDFMT_DOUBLE: ++ flagfloat = 1; ++ break; ++ default: ++ im_error("im_gadd", "%s", _("Unable to accept image1")); ++ return (-1); ++ } ++ switch (in2->BandFmt) { ++ case IM_BANDFMT_UCHAR: ++ case IM_BANDFMT_CHAR: ++ case IM_BANDFMT_USHORT: ++ case IM_BANDFMT_SHORT: ++ case IM_BANDFMT_UINT: ++ case IM_BANDFMT_INT: ++ flagint = 1; ++ break; ++ case IM_BANDFMT_FLOAT: ++ case IM_BANDFMT_DOUBLE: ++ flagfloat = 1; ++ break; ++ default: ++ im_error("im_gadd", "%s", _("Unable to accept image1")); ++ return (-1); ++ } + /* Select output routines */ +- if (flagfloat == 1) +- { ++ if (flagfloat == 1) { + value = im_gfadd(a, in1, b, in2, c, out); + if (value == -1) +- return(-1); +- } +- else if (flagint == 1) +- { ++ return (-1); ++ } ++ else if (flagint == 1) { + value = im_gaddim(a, in1, b, in2, c, out); + if (value == -1) +- return(-1); +- } +- else +- assert( 0 ); ++ return (-1); ++ } ++ else ++ assert(0); + +- return(0); ++ return (0); + } +diff --git a/libvips/deprecated/im_gaddim.c b/libvips/deprecated/im_gaddim.c +index 93433d53eb..5b10e69747 100644 +--- a/libvips/deprecated/im_gaddim.c ++++ b/libvips/deprecated/im_gaddim.c +@@ -1,11 +1,11 @@ +-/* @(#) Generalised addition of two vasari images. ++/* @(#) Generalised addition of two vasari images. + * @(#)Inputs, outputs are neither float nor double + * @(#) Result at each point is a*in1 + b*in2 + c + * @(#) Result depends on inputs, rounding is carried out; + * @(#) Function im_gaddim() assumes that the both input files + * @(#) are either memory mapped or in a buffer. + * @(#) Images must have the same no of bands and must not be complex +- * @(#) No check for overflow is done; ++ * @(#) No check for overflow is done; + * @(#) + * @(#) int im_gaddim(a, in1, b, in2, c, out) + * @(#) double a, b, c; +@@ -23,28 +23,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -64,178 +64,247 @@ + */ + + /* uchar char ushort short uint int */ +-static int array[6][6] = { +-/* uchar */ { 2, 3, 2, 3, 4, 5 }, +-/* char */ { 3, 3, 3, 3, 5, 5 }, +-/* ushort */ { 2, 3, 2, 3, 4, 5 }, +-/* short */ { 3, 3, 3, 3, 5, 5 }, +-/* uint */ { 4, 5, 4, 5, 4, 5 }, +-/* int */ { 5, 5, 5, 5, 5, 5 } +- }; +- +-#define select_tmp2_for_out_int(OUT) \ +- case IM_BANDFMT_UCHAR: select_tmp1_for_out_int(unsigned char, OUT); break; \ +- case IM_BANDFMT_CHAR: select_tmp1_for_out_int(signed char, OUT); break; \ +- case IM_BANDFMT_USHORT: select_tmp1_for_out_int(unsigned short, OUT); break; \ +- case IM_BANDFMT_SHORT: select_tmp1_for_out_int(signed short, OUT); break; \ +- case IM_BANDFMT_UINT: select_tmp1_for_out_int(unsigned int, OUT); break; \ +- case IM_BANDFMT_INT: select_tmp1_for_out_int(signed int, OUT); break; \ ++static int array[6][6] = { ++ /* uchar */ { 2, 3, 2, 3, 4, 5 }, ++ /* char */ { 3, 3, 3, 3, 5, 5 }, ++ /* ushort */ { 2, 3, 2, 3, 4, 5 }, ++ /* short */ { 3, 3, 3, 3, 5, 5 }, ++ /* uint */ { 4, 5, 4, 5, 4, 5 }, ++ /* int */ { 5, 5, 5, 5, 5, 5 } ++}; ++ ++#define select_tmp2_for_out_int(OUT) \ ++ case IM_BANDFMT_UCHAR: \ ++ select_tmp1_for_out_int(unsigned char, OUT); \ ++ break; \ ++ case IM_BANDFMT_CHAR: \ ++ select_tmp1_for_out_int(signed char, OUT); \ ++ break; \ ++ case IM_BANDFMT_USHORT: \ ++ select_tmp1_for_out_int(unsigned short, OUT); \ ++ break; \ ++ case IM_BANDFMT_SHORT: \ ++ select_tmp1_for_out_int(signed short, OUT); \ ++ break; \ ++ case IM_BANDFMT_UINT: \ ++ select_tmp1_for_out_int(unsigned int, OUT); \ ++ break; \ ++ case IM_BANDFMT_INT: \ ++ select_tmp1_for_out_int(signed int, OUT); \ ++ break; \ + \ +- default: \ +- im_error("im_gaddim","Wrong tmp2 format(1)"); \ +- free( line); \ +- return(-1); +- +-#define select_tmp1_for_out_int(IN2, OUT) \ +- switch(tmp1->BandFmt) { \ +- case IM_BANDFMT_UINT: loop(unsigned int, IN2, OUT); break; \ +- case IM_BANDFMT_INT: loop(int, IN2, OUT); break; \ +- default: im_error("im_gaddim","Wrong tmp2 format(2)");\ +- free( line);\ +- return(-1); \ ++ default: \ ++ im_error("im_gaddim", "Wrong tmp2 format(1)"); \ ++ free(line); \ ++ return (-1); ++ ++#define select_tmp1_for_out_int(IN2, OUT) \ ++ switch (tmp1->BandFmt) { \ ++ case IM_BANDFMT_UINT: \ ++ loop(unsigned int, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_INT: \ ++ loop(int, IN2, OUT); \ ++ break; \ ++ default: \ ++ im_error("im_gaddim", "Wrong tmp2 format(2)"); \ ++ free(line); \ ++ return (-1); \ + } + +-#define select_tmp2_for_out_short(OUT) \ +- case IM_BANDFMT_UCHAR: select_tmp1_for_out_short(unsigned char, OUT); break; \ +- case IM_BANDFMT_CHAR: select_tmp1_for_out_short(signed char, OUT); break; \ +- case IM_BANDFMT_USHORT: select_tmp1_for_out_short(unsigned short, OUT); break; \ +- case IM_BANDFMT_SHORT: select_tmp1_for_out_short(signed short, OUT); break; \ +- default: g_assert( 0 ); +-#define select_tmp1_for_out_short(IN2, OUT) \ +- switch(tmp1->BandFmt) { \ +- case IM_BANDFMT_UCHAR: loop(unsigned char, IN2, OUT); break; \ +- case IM_BANDFMT_CHAR: loop(signed char, IN2, OUT); break; \ +- case IM_BANDFMT_USHORT: loop(unsigned short, IN2, OUT); break; \ +- case IM_BANDFMT_SHORT: loop(signed short, IN2, OUT); break; \ +- default: im_error("im_gaddim","Wrong image1 format(4)");\ +- free( line);\ +- return(-1); \ ++#define select_tmp2_for_out_short(OUT) \ ++ case IM_BANDFMT_UCHAR: \ ++ select_tmp1_for_out_short(unsigned char, OUT); \ ++ break; \ ++ case IM_BANDFMT_CHAR: \ ++ select_tmp1_for_out_short(signed char, OUT); \ ++ break; \ ++ case IM_BANDFMT_USHORT: \ ++ select_tmp1_for_out_short(unsigned short, OUT); \ ++ break; \ ++ case IM_BANDFMT_SHORT: \ ++ select_tmp1_for_out_short(signed short, OUT); \ ++ break; \ ++ default: \ ++ g_assert(0); ++#define select_tmp1_for_out_short(IN2, OUT) \ ++ switch (tmp1->BandFmt) { \ ++ case IM_BANDFMT_UCHAR: \ ++ loop(unsigned char, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_CHAR: \ ++ loop(signed char, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_USHORT: \ ++ loop(unsigned short, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_SHORT: \ ++ loop(signed short, IN2, OUT); \ ++ break; \ ++ default: \ ++ im_error("im_gaddim", "Wrong image1 format(4)"); \ ++ free(line); \ ++ return (-1); \ + } + +- +- +- + /** + * im_gaddim: + * + * Deprecated. + */ +-int im_gaddim(double a, IMAGE *in1, double b, IMAGE *in2, double c, IMAGE *out) ++int ++im_gaddim(double a, IMAGE *in1, double b, IMAGE *in2, double c, IMAGE *out) + { + static int fmt[] = { IM_BANDFMT_UCHAR, IM_BANDFMT_CHAR, +- IM_BANDFMT_USHORT, IM_BANDFMT_SHORT, ++ IM_BANDFMT_USHORT, IM_BANDFMT_SHORT, + IM_BANDFMT_UINT, IM_BANDFMT_INT }; + int y, x; + int first, second, result; + IMAGE *tmp1, *tmp2; + PEL *line; +- int os; /* size of a line of output image */ ++ int os; /* size of a line of output image */ + +-/* fd, data filename must have been set before the function is called +- * Check whether they are set properly */ +- if ((im_iocheck(in1, out) == -1) || (im_iocheck(in2, out) == -1)) +- { +- return(-1); +- } +-/* Checks the arguments entered in in and prepares out */ +- if ( (in1->Xsize != in2->Xsize) || (in1->Ysize != in2->Ysize) || +- (in1->Bands != in2->Bands) || (in1->Coding != in2->Coding) ) +- { im_error("im_gaddim"," Input images differ"); return(-1); } +- if (in1->Coding != IM_CODING_NONE) +- { im_error("im_gaddim"," images must be uncoded"); return(-1);} +- +- switch(in1->BandFmt) { +- case IM_BANDFMT_UCHAR: first = 0; break; +- case IM_BANDFMT_CHAR: first = 1; break; +- case IM_BANDFMT_USHORT: first = 2; break; +- case IM_BANDFMT_SHORT: first = 3; break; +- case IM_BANDFMT_UINT: first = 4; break; +- case IM_BANDFMT_INT: first = 5; break; +- default: im_error("im_gaddim"," Unable to accept image1"); +- return(-1); +- } +- switch(in2->BandFmt) { +- case IM_BANDFMT_UCHAR: second = 0; break; +- case IM_BANDFMT_CHAR: second = 1; break; +- case IM_BANDFMT_USHORT: second = 2; break; +- case IM_BANDFMT_SHORT: second = 3; break; +- case IM_BANDFMT_UINT: second = 4; break; +- case IM_BANDFMT_INT: second = 5; break; +- default: im_error("im_gaddim"," Unable to accept image2"); +- return(-1); +- } +-/* Define the output */ ++ /* fd, data filename must have been set before the function is called ++ * Check whether they are set properly */ ++ if ((im_iocheck(in1, out) == -1) || (im_iocheck(in2, out) == -1)) { ++ return (-1); ++ } ++ /* Checks the arguments entered in in and prepares out */ ++ if ((in1->Xsize != in2->Xsize) || (in1->Ysize != in2->Ysize) || ++ (in1->Bands != in2->Bands) || (in1->Coding != in2->Coding)) { ++ im_error("im_gaddim", " Input images differ"); ++ return (-1); ++ } ++ if (in1->Coding != IM_CODING_NONE) { ++ im_error("im_gaddim", " images must be uncoded"); ++ return (-1); ++ } ++ ++ switch (in1->BandFmt) { ++ case IM_BANDFMT_UCHAR: ++ first = 0; ++ break; ++ case IM_BANDFMT_CHAR: ++ first = 1; ++ break; ++ case IM_BANDFMT_USHORT: ++ first = 2; ++ break; ++ case IM_BANDFMT_SHORT: ++ first = 3; ++ break; ++ case IM_BANDFMT_UINT: ++ first = 4; ++ break; ++ case IM_BANDFMT_INT: ++ first = 5; ++ break; ++ default: ++ im_error("im_gaddim", " Unable to accept image1"); ++ return (-1); ++ } ++ switch (in2->BandFmt) { ++ case IM_BANDFMT_UCHAR: ++ second = 0; ++ break; ++ case IM_BANDFMT_CHAR: ++ second = 1; ++ break; ++ case IM_BANDFMT_USHORT: ++ second = 2; ++ break; ++ case IM_BANDFMT_SHORT: ++ second = 3; ++ break; ++ case IM_BANDFMT_UINT: ++ second = 4; ++ break; ++ case IM_BANDFMT_INT: ++ second = 5; ++ break; ++ default: ++ im_error("im_gaddim", " Unable to accept image2"); ++ return (-1); ++ } ++ /* Define the output */ + result = array[first][second]; + +-/* Prepare the output header */ +- if ( im_cp_desc(out, in1) == -1) +- { im_error("im_gaddim"," im_cp_desc failed"); return(-1); } ++ /* Prepare the output header */ ++ if (im_cp_desc(out, in1) == -1) { ++ im_error("im_gaddim", " im_cp_desc failed"); ++ return (-1); ++ } + out->BandFmt = fmt[result]; + +- if( im_setupout(out) == -1) +- { im_error("im_gaddim"," im_setupout failed"); return(-1); } ++ if (im_setupout(out) == -1) { ++ im_error("im_gaddim", " im_setupout failed"); ++ return (-1); ++ } + +-/* Order in1 and in2 */ +- if ( first >= second ) +- { tmp1 = in1; tmp2 = in2; } +- else +- { tmp1 = in2; tmp2 = in1; } ++ /* Order in1 and in2 */ ++ if (first >= second) { ++ tmp1 = in1; ++ tmp2 = in2; ++ } ++ else { ++ tmp1 = in2; ++ tmp2 = in1; ++ } + +-/* Define what we do for each band element type. */ ++ /* Define what we do for each band element type. */ + + #define loop(IN1, IN2, OUT) \ +- { IN1 *input1 = (IN1 *) tmp1->data; \ +- IN2 *input2 = (IN2 *) tmp2->data; \ +- \ +- for (y=0; y Ysize; y++) {\ +- OUT *cpline = (OUT*)line; \ +- for (x=0; xdata; \ ++ IN2 *input2 = (IN2 *) tmp2->data; \ ++\ ++ for (y = 0; y < out->Ysize; y++) { \ ++ OUT *cpline = (OUT *) line; \ ++ for (x = 0; x < os; x++) \ ++ *cpline++ = (OUT) (a * (*input1++) + b * (*input2++) + c + 0.5); \ ++ if (im_writeline(y, out, line) == -1) { \ ++ free(line); \ ++ return (-1); \ ++ } \ ++ } \ + } + + os = out->Xsize * out->Bands; +- line = (PEL *) calloc ( (unsigned)os, sizeof(double) ); +- if (line == NULL) +- { +- im_error("im_gaddim"," Unable to calloc"); +- return(-1); ++ line = (PEL *) calloc((unsigned) os, sizeof(double)); ++ if (line == NULL) { ++ im_error("im_gaddim", " Unable to calloc"); ++ return (-1); ++ } ++ ++ switch (out->BandFmt) { ++ case IM_BANDFMT_INT: ++ switch (tmp2->BandFmt) { ++ select_tmp2_for_out_int(int); + } ++ break; + +- switch (out->BandFmt) { +- case IM_BANDFMT_INT: +- switch (tmp2->BandFmt) { +- select_tmp2_for_out_int(int); +- } +- break; +- +- case IM_BANDFMT_UINT: +- switch (tmp2->BandFmt) { +- select_tmp2_for_out_int(unsigned int); +- } +- break; +- case IM_BANDFMT_SHORT: +- switch (tmp2->BandFmt) { +- select_tmp2_for_out_short(short); +- } +- break; +- case IM_BANDFMT_USHORT: +- switch (tmp2->BandFmt) { +- select_tmp2_for_out_short(unsigned short); +- } +- break; +- default: +- im_error("im_gaddim"," Impossible output state"); +- free( line); +- return(-1); ++ case IM_BANDFMT_UINT: ++ switch (tmp2->BandFmt) { ++ select_tmp2_for_out_int(unsigned int); ++ } ++ break; ++ case IM_BANDFMT_SHORT: ++ switch (tmp2->BandFmt) { ++ select_tmp2_for_out_short(short); + } ++ break; ++ case IM_BANDFMT_USHORT: ++ switch (tmp2->BandFmt) { ++ select_tmp2_for_out_short(unsigned short); ++ } ++ break; ++ default: ++ im_error("im_gaddim", " Impossible output state"); ++ free(line); ++ return (-1); ++ } + +- free( line); ++ free(line); + +- return(0); ++ return (0); + } +diff --git a/libvips/deprecated/im_gfadd.c b/libvips/deprecated/im_gfadd.c +index aff6c2c5ef..ac7dd2114c 100644 +--- a/libvips/deprecated/im_gfadd.c ++++ b/libvips/deprecated/im_gfadd.c +@@ -17,7 +17,7 @@ + * + * Author: Nicos Dessipris + * Written on: 02/05/1990 +- * Modified on: ++ * Modified on: + * 15/6/93 J.Cupitt + * - externs removed + * - casts added to please ANSI C +@@ -26,28 +26,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -65,286 +65,402 @@ + + /* uchar char ushort short uint int float double */ + static int array[8][8] = { +-/* uchar */ { 0, 0, 0, 0, 0, 0, 0, 1 }, +-/* char */ { 0, 0, 0, 0, 0, 0, 0, 1 }, +-/* ushort */ { 0, 0, 0, 0, 0, 0, 0, 1 }, +-/* short */ { 0, 0, 0, 0, 0, 0, 0, 1 }, +-/* uint */ { 0, 0, 0, 0, 0, 0, 0, 1 }, +-/* int */ { 0, 0, 0, 0, 0, 0, 0, 1 }, +-/* float */ { 0, 0, 0, 0, 0, 0, 0, 1 }, +-/* double */ { 1, 1, 1, 1, 1, 1, 1, 1 } +- }; +- +-#define select_outdouble(IN2, OUT)\ +- switch(tmp1->BandFmt) {\ +- case IM_BANDFMT_DOUBLE: loop(double, IN2, OUT); break;\ +- default: im_error("im_gfadd","Wrong tmp1 format(d)");\ +- free( line); return( -1 );\ ++ /* uchar */ { 0, 0, 0, 0, 0, 0, 0, 1 }, ++ /* char */ { 0, 0, 0, 0, 0, 0, 0, 1 }, ++ /* ushort */ { 0, 0, 0, 0, 0, 0, 0, 1 }, ++ /* short */ { 0, 0, 0, 0, 0, 0, 0, 1 }, ++ /* uint */ { 0, 0, 0, 0, 0, 0, 0, 1 }, ++ /* int */ { 0, 0, 0, 0, 0, 0, 0, 1 }, ++ /* float */ { 0, 0, 0, 0, 0, 0, 0, 1 }, ++ /* double */ { 1, 1, 1, 1, 1, 1, 1, 1 } ++}; ++ ++#define select_outdouble(IN2, OUT) \ ++ switch (tmp1->BandFmt) { \ ++ case IM_BANDFMT_DOUBLE: \ ++ loop(double, IN2, OUT); \ ++ break; \ ++ default: \ ++ im_error("im_gfadd", "Wrong tmp1 format(d)"); \ ++ free(line); \ ++ return (-1); \ + } + +-#define outfloat_2uchar(IN2, OUT)\ +- case IM_BANDFMT_UCHAR: loop(unsigned char, IN2, OUT); break;\ +- case IM_BANDFMT_CHAR: loop(signed char, IN2, OUT); break;\ +- case IM_BANDFMT_USHORT: loop(unsigned short, IN2, OUT); break;\ +- case IM_BANDFMT_SHORT: loop(signed short, IN2, OUT); break;\ +- case IM_BANDFMT_UINT: loop(unsigned int, IN2, OUT); break;\ +- case IM_BANDFMT_INT: loop(signed int, IN2, OUT); break;\ +- case IM_BANDFMT_FLOAT: loop(float, IN2, OUT); break; +- +-#define outfloat_2char(IN2, OUT)\ +- case IM_BANDFMT_CHAR: loop(signed char, IN2, OUT); break;\ +- case IM_BANDFMT_USHORT: loop(unsigned short, IN2, OUT); break;\ +- case IM_BANDFMT_SHORT: loop(signed short, IN2, OUT); break;\ +- case IM_BANDFMT_UINT: loop(unsigned int, IN2, OUT); break;\ +- case IM_BANDFMT_INT: loop(signed int, IN2, OUT); break;\ +- case IM_BANDFMT_FLOAT: loop(float, IN2, OUT); break; +- +-#define outfloat_2ushort(IN2, OUT)\ +- case IM_BANDFMT_USHORT: loop(unsigned short, IN2, OUT); break;\ +- case IM_BANDFMT_SHORT: loop(signed short, IN2, OUT); break;\ +- case IM_BANDFMT_UINT: loop(unsigned int, IN2, OUT); break;\ +- case IM_BANDFMT_INT: loop(signed int, IN2, OUT); break;\ +- case IM_BANDFMT_FLOAT: loop(float, IN2, OUT); break; +- +-#define outfloat_2short(IN2, OUT)\ +- case IM_BANDFMT_SHORT: loop(signed short, IN2, OUT); break;\ +- case IM_BANDFMT_UINT: loop(unsigned int, IN2, OUT); break;\ +- case IM_BANDFMT_INT: loop(signed int, IN2, OUT); break;\ +- case IM_BANDFMT_FLOAT: loop(float, IN2, OUT); break; +- +-#define outfloat_2uint(IN2, OUT)\ +- case IM_BANDFMT_UINT: loop(unsigned int, IN2, OUT); break;\ +- case IM_BANDFMT_INT: loop(signed int, IN2, OUT); break;\ +- case IM_BANDFMT_FLOAT: loop(float, IN2, OUT); break; +- +-#define outfloat_2int(IN2, OUT)\ +- case IM_BANDFMT_INT: loop(signed int, IN2, OUT); break;\ +- case IM_BANDFMT_FLOAT: loop(float, IN2, OUT); break; +- +-#define outfloat_2float(IN2, OUT)\ +- case IM_BANDFMT_FLOAT: loop(float, IN2, OUT); break; ++#define outfloat_2uchar(IN2, OUT) \ ++ case IM_BANDFMT_UCHAR: \ ++ loop(unsigned char, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_CHAR: \ ++ loop(signed char, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_USHORT: \ ++ loop(unsigned short, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_SHORT: \ ++ loop(signed short, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_UINT: \ ++ loop(unsigned int, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_INT: \ ++ loop(signed int, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_FLOAT: \ ++ loop(float, IN2, OUT); \ ++ break; ++ ++#define outfloat_2char(IN2, OUT) \ ++ case IM_BANDFMT_CHAR: \ ++ loop(signed char, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_USHORT: \ ++ loop(unsigned short, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_SHORT: \ ++ loop(signed short, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_UINT: \ ++ loop(unsigned int, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_INT: \ ++ loop(signed int, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_FLOAT: \ ++ loop(float, IN2, OUT); \ ++ break; ++ ++#define outfloat_2ushort(IN2, OUT) \ ++ case IM_BANDFMT_USHORT: \ ++ loop(unsigned short, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_SHORT: \ ++ loop(signed short, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_UINT: \ ++ loop(unsigned int, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_INT: \ ++ loop(signed int, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_FLOAT: \ ++ loop(float, IN2, OUT); \ ++ break; ++ ++#define outfloat_2short(IN2, OUT) \ ++ case IM_BANDFMT_SHORT: \ ++ loop(signed short, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_UINT: \ ++ loop(unsigned int, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_INT: \ ++ loop(signed int, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_FLOAT: \ ++ loop(float, IN2, OUT); \ ++ break; ++ ++#define outfloat_2uint(IN2, OUT) \ ++ case IM_BANDFMT_UINT: \ ++ loop(unsigned int, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_INT: \ ++ loop(signed int, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_FLOAT: \ ++ loop(float, IN2, OUT); \ ++ break; ++ ++#define outfloat_2int(IN2, OUT) \ ++ case IM_BANDFMT_INT: \ ++ loop(signed int, IN2, OUT); \ ++ break; \ ++ case IM_BANDFMT_FLOAT: \ ++ loop(float, IN2, OUT); \ ++ break; ++ ++#define outfloat_2float(IN2, OUT) \ ++ case IM_BANDFMT_FLOAT: \ ++ loop(float, IN2, OUT); \ ++ break; + + /** + * im_gfadd: + * + * Deprecated. + */ +-int im_gfadd(double a, IMAGE *in1, double b, IMAGE *in2, double c, IMAGE *out) ++int ++im_gfadd(double a, IMAGE *in1, double b, IMAGE *in2, double c, IMAGE *out) + { + static int fmt[] = { IM_BANDFMT_FLOAT, IM_BANDFMT_DOUBLE }; + int y, x; + int first, second, result; + IMAGE *tmp1, *tmp2; + PEL *line; +- int os; /* size of a line of output image */ +- +-/* fd, data filename must have been set before the function is called +- * Check whether they are set properly */ +- if ((im_iocheck(in1, out) == -1) || (im_iocheck(in2, out) == -1)) +- { im_error("im_gfadd"," im_iocheck failed"); return( -1 ); } +-/* Checks the arguments entered in in and prepares out */ +- if ( (in1->Xsize != in2->Xsize) || (in1->Ysize != in2->Ysize) || +- (in1->Bands != in2->Bands) || (in1->Coding != in2->Coding) ) +- { im_error("im_gfadd"," Input images differ"); return( -1 );} +- if (in1->Coding != IM_CODING_NONE) +- { im_error("im_gfadd"," images are coded"); return( -1 ); } +- +- switch(in1->BandFmt) { +- case IM_BANDFMT_UCHAR: first = 0; break; +- case IM_BANDFMT_CHAR: first = 1; break; +- case IM_BANDFMT_USHORT: first = 2; break; +- case IM_BANDFMT_SHORT: first = 3; break; +- case IM_BANDFMT_UINT: first = 4; break; +- case IM_BANDFMT_INT: first = 5; break; +- case IM_BANDFMT_FLOAT: first = 6; break; +- case IM_BANDFMT_DOUBLE: first = 7; break; +- default: im_error("im_gfadd"," unable to accept image1"); +- return( -1 ); +- } +- switch(in2->BandFmt) { +- case IM_BANDFMT_UCHAR: second = 0; break; +- case IM_BANDFMT_CHAR: second = 1; break; +- case IM_BANDFMT_USHORT: second = 2; break; +- case IM_BANDFMT_SHORT: second = 3; break; +- case IM_BANDFMT_UINT: second = 4; break; +- case IM_BANDFMT_INT: second = 5; break; +- case IM_BANDFMT_FLOAT: second = 6; break; +- case IM_BANDFMT_DOUBLE: second = 7; break; +- default: im_error("im_gfadd"," unable to accept image2"); +- return( -1 ); +- } +-/* Define the output */ ++ int os; /* size of a line of output image */ ++ ++ /* fd, data filename must have been set before the function is called ++ * Check whether they are set properly */ ++ if ((im_iocheck(in1, out) == -1) || (im_iocheck(in2, out) == -1)) { ++ im_error("im_gfadd", " im_iocheck failed"); ++ return (-1); ++ } ++ /* Checks the arguments entered in in and prepares out */ ++ if ((in1->Xsize != in2->Xsize) || (in1->Ysize != in2->Ysize) || ++ (in1->Bands != in2->Bands) || (in1->Coding != in2->Coding)) { ++ im_error("im_gfadd", " Input images differ"); ++ return (-1); ++ } ++ if (in1->Coding != IM_CODING_NONE) { ++ im_error("im_gfadd", " images are coded"); ++ return (-1); ++ } ++ ++ switch (in1->BandFmt) { ++ case IM_BANDFMT_UCHAR: ++ first = 0; ++ break; ++ case IM_BANDFMT_CHAR: ++ first = 1; ++ break; ++ case IM_BANDFMT_USHORT: ++ first = 2; ++ break; ++ case IM_BANDFMT_SHORT: ++ first = 3; ++ break; ++ case IM_BANDFMT_UINT: ++ first = 4; ++ break; ++ case IM_BANDFMT_INT: ++ first = 5; ++ break; ++ case IM_BANDFMT_FLOAT: ++ first = 6; ++ break; ++ case IM_BANDFMT_DOUBLE: ++ first = 7; ++ break; ++ default: ++ im_error("im_gfadd", " unable to accept image1"); ++ return (-1); ++ } ++ switch (in2->BandFmt) { ++ case IM_BANDFMT_UCHAR: ++ second = 0; ++ break; ++ case IM_BANDFMT_CHAR: ++ second = 1; ++ break; ++ case IM_BANDFMT_USHORT: ++ second = 2; ++ break; ++ case IM_BANDFMT_SHORT: ++ second = 3; ++ break; ++ case IM_BANDFMT_UINT: ++ second = 4; ++ break; ++ case IM_BANDFMT_INT: ++ second = 5; ++ break; ++ case IM_BANDFMT_FLOAT: ++ second = 6; ++ break; ++ case IM_BANDFMT_DOUBLE: ++ second = 7; ++ break; ++ default: ++ im_error("im_gfadd", " unable to accept image2"); ++ return (-1); ++ } ++ /* Define the output */ + result = array[first][second]; +-/* Prepare output */ +- if ( im_cp_desc(out, in1) == -1) +- { im_error("im_gfadd"," im_cp_desc failed"); return( -1 ); } ++ /* Prepare output */ ++ if (im_cp_desc(out, in1) == -1) { ++ im_error("im_gfadd", " im_cp_desc failed"); ++ return (-1); ++ } + out->BandFmt = fmt[result]; +- if( im_setupout(out) == -1) +- { im_error("im_gfadd"," im_setupout failed"); return( -1 ); } +- +-/* Order in1 and in2 */ +- if ( first >= second ) +- { tmp1 = in1; tmp2 = in2; } +- else +- { tmp1 = in2; tmp2 = in1; } +- +-/* Define what we do for each band element type. */ +- +-#define loop(IN1, IN2, OUT)\ +- { IN1 *input1 = (IN1 *) tmp1->data;\ +- IN2 *input2 = (IN2 *) tmp2->data;\ +- \ +- for (y=0; y Ysize; y++) {\ +- OUT *cpline = (OUT*)line;\ +- for (x=0; x= second) { ++ tmp1 = in1; ++ tmp2 = in2; ++ } ++ else { ++ tmp1 = in2; ++ tmp2 = in1; ++ } ++ ++ /* Define what we do for each band element type. */ ++ ++#define loop(IN1, IN2, OUT) \ ++ { \ ++ IN1 *input1 = (IN1 *) tmp1->data; \ ++ IN2 *input2 = (IN2 *) tmp2->data; \ ++\ ++ for (y = 0; y < out->Ysize; y++) { \ ++ OUT *cpline = (OUT *) line; \ ++ for (x = 0; x < os; x++) \ ++ *cpline++ = (a * ((OUT) *input1++) + \ ++ b * ((OUT) *input2++) + c); \ ++ if (im_writeline(y, out, line)) { \ ++ im_error("im_gfadd", " im_writeline failed"); \ ++ free(line); \ ++ return (-1); \ ++ } \ ++ } \ + } + + os = out->Xsize * out->Bands; +- line = (PEL *) calloc ( (unsigned)os, sizeof(double) ); +- if (line == NULL) +- { im_error("im_gfadd"," unable to calloc"); return( -1 ); } +- +- switch (out->BandFmt) { +- case IM_BANDFMT_DOUBLE: +- switch (tmp2->BandFmt) { +- case IM_BANDFMT_UCHAR: +- select_outdouble(unsigned char, double); +- break; +- +- case IM_BANDFMT_CHAR: +- select_outdouble(signed char, double); +- break; +- +- case IM_BANDFMT_USHORT: +- select_outdouble(unsigned short, double); +- break; +- +- case IM_BANDFMT_SHORT: +- select_outdouble(signed short, double); +- break; +- +- case IM_BANDFMT_UINT: +- select_outdouble(unsigned int, double); +- break; +- +- case IM_BANDFMT_INT: +- select_outdouble(signed int, double); +- break; +- +- case IM_BANDFMT_FLOAT: +- select_outdouble(float, double); +- break; +- +- case IM_BANDFMT_DOUBLE: +- select_outdouble(double, double); +- break; +- +- default: +- im_error("im_gfadd","Wrong tmp2 format(d)"); +- free( line ); +- return( -1 ); +- } ++ line = (PEL *) calloc((unsigned) os, sizeof(double)); ++ if (line == NULL) { ++ im_error("im_gfadd", " unable to calloc"); ++ return (-1); ++ } ++ ++ switch (out->BandFmt) { ++ case IM_BANDFMT_DOUBLE: ++ switch (tmp2->BandFmt) { ++ case IM_BANDFMT_UCHAR: ++ select_outdouble(unsigned char, double); ++ break; ++ ++ case IM_BANDFMT_CHAR: ++ select_outdouble(signed char, double); ++ break; ++ ++ case IM_BANDFMT_USHORT: ++ select_outdouble(unsigned short, double); ++ break; ++ ++ case IM_BANDFMT_SHORT: ++ select_outdouble(signed short, double); ++ break; ++ ++ case IM_BANDFMT_UINT: ++ select_outdouble(unsigned int, double); ++ break; ++ ++ case IM_BANDFMT_INT: ++ select_outdouble(signed int, double); ++ break; + ++ case IM_BANDFMT_FLOAT: ++ select_outdouble(float, double); + break; + +- case IM_BANDFMT_FLOAT : +- switch (tmp2->BandFmt) { +- case IM_BANDFMT_UCHAR: +- switch (tmp1->BandFmt) { ++ case IM_BANDFMT_DOUBLE: ++ select_outdouble(double, double); ++ break; ++ ++ default: ++ im_error("im_gfadd", "Wrong tmp2 format(d)"); ++ free(line); ++ return (-1); ++ } ++ ++ break; ++ ++ case IM_BANDFMT_FLOAT: ++ switch (tmp2->BandFmt) { ++ case IM_BANDFMT_UCHAR: ++ switch (tmp1->BandFmt) { + outfloat_2uchar(unsigned char, float); + +- default: +- im_error("im_gfadd"," Error (a)"); +- free( line ); +- return( -1 ); +- } +- break; ++ default: ++ im_error("im_gfadd", " Error (a)"); ++ free(line); ++ return (-1); ++ } ++ break; + +- case IM_BANDFMT_CHAR: +- switch (tmp1->BandFmt) { ++ case IM_BANDFMT_CHAR: ++ switch (tmp1->BandFmt) { + outfloat_2char(signed char, float); + +- default: +- im_error("im_gfadd"," Error (b)"); +- free( line); return( -1 ); +- } +- break; ++ default: ++ im_error("im_gfadd", " Error (b)"); ++ free(line); ++ return (-1); ++ } ++ break; + +- case IM_BANDFMT_USHORT: +- switch (tmp1->BandFmt) { ++ case IM_BANDFMT_USHORT: ++ switch (tmp1->BandFmt) { + outfloat_2ushort(unsigned short, float); + +- default: +- im_error("im_gfadd"," Error (c)"); +- free( line); return( -1 ); +- } +- break; ++ default: ++ im_error("im_gfadd", " Error (c)"); ++ free(line); ++ return (-1); ++ } ++ break; + +- case IM_BANDFMT_SHORT: +- switch (tmp1->BandFmt) { ++ case IM_BANDFMT_SHORT: ++ switch (tmp1->BandFmt) { + outfloat_2short(signed short, float); + +- default: +- im_error("im_gfadd"," Error (d)"); +- free( line); return( -1 ); +- } +- break; ++ default: ++ im_error("im_gfadd", " Error (d)"); ++ free(line); ++ return (-1); ++ } ++ break; + +- case IM_BANDFMT_UINT: +- switch (tmp1->BandFmt) { ++ case IM_BANDFMT_UINT: ++ switch (tmp1->BandFmt) { + outfloat_2uint(unsigned int, float); + +- default: +- im_error("im_gfadd"," Error (e)"); +- free( line); return( -1 ); +- } +- break; +- +- case IM_BANDFMT_INT: +- switch (tmp1->BandFmt) { +- outfloat_2int(signed int, float); +- +- default: +- im_error("im_gfadd"," Error (f)"); +- free( line ); +- return( -1 ); +- } +- break; +- +- case IM_BANDFMT_FLOAT: +- switch (tmp1->BandFmt) { +- outfloat_2float(float, float); +- +- default: +- im_error("im_gfadd"," Error (g)"); +- free( line ); +- return( -1 ); +- } +- break; +- +- default: +- im_error("im_gfadd"," Wrong tmp2 format(f)"); +- free( line ); +- return( -1 ); ++ default: ++ im_error("im_gfadd", " Error (e)"); ++ free(line); ++ return (-1); + } ++ break; + ++ case IM_BANDFMT_INT: ++ switch (tmp1->BandFmt) { ++ outfloat_2int(signed int, float); ++ ++ default: ++ im_error("im_gfadd", " Error (f)"); ++ free(line); ++ return (-1); ++ } ++ break; ++ ++ case IM_BANDFMT_FLOAT: ++ switch (tmp1->BandFmt) { ++ outfloat_2float(float, float); ++ ++ default: ++ im_error("im_gfadd", " Error (g)"); ++ free(line); ++ return (-1); ++ } + break; + + default: +- im_error("im_gfadd"," Impossible output state"); +- free( line ); +- return( -1 ); ++ im_error("im_gfadd", " Wrong tmp2 format(f)"); ++ free(line); ++ return (-1); + } + +- free( line ); ++ break; ++ ++ default: ++ im_error("im_gfadd", " Impossible output state"); ++ free(line); ++ return (-1); ++ } ++ ++ free(line); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/deprecated/im_gradcor.c b/libvips/deprecated/im_gradcor.c +index 3f67c36cee..d8244011ba 100644 +--- a/libvips/deprecated/im_gradcor.c ++++ b/libvips/deprecated/im_gradcor.c +@@ -11,32 +11,31 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +- + #ifdef HAVE_CONFIG_H + #include + #endif /*HAVE_CONFIG_H*/ +@@ -47,35 +46,33 @@ + #include + #include + +- + typedef struct { +- REGION *reg; +- int *region_xgrad; +- int *region_ygrad; +- size_t region_xgrad_area; +- size_t region_ygrad_area; +-} +-gradcor_seq_t; +- +-static void *gradcor_start( IMAGE *out, void *vptr_large, void *unrequired ); +-static int gradcor_stop( void *vptr_seq, void *unrequired, void *unreq2 ); +-static int gradcor_gen( REGION *to_make, void *vptr_seq, void *unrequired, void *vptr_grads ); +- +-#define XGRAD_GEN_DECLARATION( TYPE ) static int xgrad_gen_ ## TYPE( REGION *to_make, void *vptr_make_from, void *unrequired, void *unreq2 ) +-#define YGRAD_GEN_DECLARATION( TYPE ) static int ygrad_gen_ ## TYPE( REGION *to_make, void *vptr_make_from, void *unrequired, void *unreq2 ) +- +-XGRAD_GEN_DECLARATION( guint8 ); +-YGRAD_GEN_DECLARATION( guint8 ); +-XGRAD_GEN_DECLARATION( gint8 ); +-YGRAD_GEN_DECLARATION( gint8 ); +-XGRAD_GEN_DECLARATION( guint16 ); +-YGRAD_GEN_DECLARATION( guint16 ); +-XGRAD_GEN_DECLARATION( gint16 ); +-YGRAD_GEN_DECLARATION( gint16 ); +-XGRAD_GEN_DECLARATION( guint32 ); +-YGRAD_GEN_DECLARATION( guint32 ); +-XGRAD_GEN_DECLARATION( gint32 ); +-YGRAD_GEN_DECLARATION( gint32 ); ++ REGION *reg; ++ int *region_xgrad; ++ int *region_ygrad; ++ size_t region_xgrad_area; ++ size_t region_ygrad_area; ++} gradcor_seq_t; ++ ++static void *gradcor_start(IMAGE *out, void *vptr_large, void *unrequired); ++static int gradcor_stop(void *vptr_seq, void *unrequired, void *unreq2); ++static int gradcor_gen(REGION *to_make, void *vptr_seq, void *unrequired, void *vptr_grads); ++ ++#define XGRAD_GEN_DECLARATION(TYPE) static int xgrad_gen_##TYPE(REGION *to_make, void *vptr_make_from, void *unrequired, void *unreq2) ++#define YGRAD_GEN_DECLARATION(TYPE) static int ygrad_gen_##TYPE(REGION *to_make, void *vptr_make_from, void *unrequired, void *unreq2) ++ ++XGRAD_GEN_DECLARATION(guint8); ++YGRAD_GEN_DECLARATION(guint8); ++XGRAD_GEN_DECLARATION(gint8); ++YGRAD_GEN_DECLARATION(gint8); ++XGRAD_GEN_DECLARATION(guint16); ++YGRAD_GEN_DECLARATION(guint16); ++XGRAD_GEN_DECLARATION(gint16); ++YGRAD_GEN_DECLARATION(gint16); ++XGRAD_GEN_DECLARATION(guint32); ++YGRAD_GEN_DECLARATION(guint32); ++XGRAD_GEN_DECLARATION(gint32); ++YGRAD_GEN_DECLARATION(gint32); + #if 0 + XGRAD_GEN_DECLARATION( float ); + YGRAD_GEN_DECLARATION( float ); +@@ -83,44 +80,43 @@ XGRAD_GEN_DECLARATION( double ); + YGRAD_GEN_DECLARATION( double ); + #endif + +-int im_gradcor_raw( IMAGE *large, IMAGE *small, IMAGE *out ){ ++int ++im_gradcor_raw(IMAGE *large, IMAGE *small, IMAGE *out) ++{ + #define FUNCTION_NAME "im_gradcor_raw" + +- if( im_piocheck( large, out ) || im_pincheck( small ) ) +- return -1; +- +- if( im_check_uncoded( "im_gradcor", large ) || +- im_check_mono( "im_gradcor", large ) || +- im_check_uncoded( "im_gradcor", small ) || +- im_check_mono( "im_gradcor", small ) || +- im_check_format_same( "im_gradcor", large, small ) || +- im_check_int( "im_gradcor", large ) ) +- return( -1 ); +- +- if( large-> Xsize < small-> Xsize || large-> Ysize < small-> Ysize ){ +- im_error( FUNCTION_NAME, "second image must be smaller than first" ); +- return -1; +- } +- if( im_cp_desc( out, large ) ) +- return -1; +- +- out-> Xsize= 1 + large-> Xsize - small-> Xsize; +- out-> Ysize= 1 + large-> Ysize - small-> Ysize; +- out-> BandFmt= IM_BANDFMT_FLOAT; +- +- if( im_demand_hint( out, IM_FATSTRIP, large, NULL ) ) +- return -1; +- +- { +- IMAGE *xgrad= im_open_local( out, FUNCTION_NAME ": xgrad", "t" ); +- IMAGE *ygrad= im_open_local( out, FUNCTION_NAME ": ygrad", "t" ); +- IMAGE **grads= im_allocate_input_array( out, xgrad, ygrad, NULL ); +- +- return ! xgrad || ! ygrad || ! grads +- || im_grad_x( small, xgrad ) +- || im_grad_y( small, ygrad ) +- || im_generate( out, gradcor_start, gradcor_gen, gradcor_stop, (void*) large, (void*) grads ); +- } ++ if (im_piocheck(large, out) || im_pincheck(small)) ++ return -1; ++ ++ if (im_check_uncoded("im_gradcor", large) || ++ im_check_mono("im_gradcor", large) || ++ im_check_uncoded("im_gradcor", small) || ++ im_check_mono("im_gradcor", small) || ++ im_check_format_same("im_gradcor", large, small) || ++ im_check_int("im_gradcor", large)) ++ return (-1); ++ ++ if (large->Xsize < small->Xsize || large->Ysize < small->Ysize) { ++ im_error(FUNCTION_NAME, "second image must be smaller than first"); ++ return -1; ++ } ++ if (im_cp_desc(out, large)) ++ return -1; ++ ++ out->Xsize = 1 + large->Xsize - small->Xsize; ++ out->Ysize = 1 + large->Ysize - small->Ysize; ++ out->BandFmt = IM_BANDFMT_FLOAT; ++ ++ if (im_demand_hint(out, IM_FATSTRIP, large, NULL)) ++ return -1; ++ ++ { ++ IMAGE *xgrad = im_open_local(out, FUNCTION_NAME ": xgrad", "t"); ++ IMAGE *ygrad = im_open_local(out, FUNCTION_NAME ": ygrad", "t"); ++ IMAGE **grads = im_allocate_input_array(out, xgrad, ygrad, NULL); ++ ++ return !xgrad || !ygrad || !grads || im_grad_x(small, xgrad) || im_grad_y(small, ygrad) || im_generate(out, gradcor_start, gradcor_gen, gradcor_stop, (void *) large, (void *) grads); ++ } + #undef FUNCTION_NAME + } + +@@ -136,13 +132,13 @@ int im_gradcor_raw( IMAGE *large, IMAGE *small, IMAGE *out ){ + * calculated. One-band, integer images only. @in and @ref must have the + * same #VipsBandFmt. The output + * image is always %IM_BANDFMT_FLOAT. @ref must be smaller than @in. The output +- * image is the same size as the input. ++ * image is the same size as the input. + * +- * The method takes the gradient images of the two images then takes the ++ * The method takes the gradient images of the two images then takes the + * dot-product correlation of the two vector images. + * The vector expression of this method is my (tcv) own creation. It is + * equivalent to the complex-number method of: +- * ++ * + * ARGYRIOU, V. et al. 2003. Estimation of sub-pixel motion using + * gradient cross correlation. Electronics Letters, 39 (13). + * +@@ -150,24 +146,24 @@ int im_gradcor_raw( IMAGE *large, IMAGE *small, IMAGE *out ){ + * + * Returns: 0 on success, -1 on error + */ +-int +-im_gradcor( IMAGE *in, IMAGE *ref, IMAGE *out ) ++int ++im_gradcor(IMAGE *in, IMAGE *ref, IMAGE *out) + { + #define FUNCTION_NAME "im_gradcor" +- IMAGE *t1 = im_open_local( out, FUNCTION_NAME " intermediate", "p" ); ++ IMAGE *t1 = im_open_local(out, FUNCTION_NAME " intermediate", "p"); + +- if( !t1 || +- im_embed( in, t1, 1, +- ref->Xsize / 2, ref->Ysize / 2, +- in->Xsize + ref->Xsize - 1, +- in->Ysize + ref->Ysize - 1 ) || +- im_gradcor_raw( t1, ref, out ) ) +- return( -1 ); ++ if (!t1 || ++ im_embed(in, t1, 1, ++ ref->Xsize / 2, ref->Ysize / 2, ++ in->Xsize + ref->Xsize - 1, ++ in->Ysize + ref->Ysize - 1) || ++ im_gradcor_raw(t1, ref, out)) ++ return (-1); + + out->Xoffset = 0; + out->Yoffset = 0; + +- return( 0 ); ++ return (0); + #undef FUNCTION_NAME + } + +@@ -190,46 +186,48 @@ im_gradcor( IMAGE *in, IMAGE *ref, IMAGE *out ) + * + * Returns: 0 on success, -1 on error + */ +-int im_grad_x( IMAGE *in, IMAGE *out ){ ++int ++im_grad_x(IMAGE *in, IMAGE *out) ++{ + #define FUNCTION_NAME "im_grad_x" + +- if( im_piocheck( in, out ) ) +- return -1; ++ if (im_piocheck(in, out)) ++ return -1; + +- if( im_check_uncoded( "im_grad_x", in ) || +- im_check_mono( "im_grad_x", in ) || +- im_check_int( "im_grad_x", in ) ) +- return( -1 ); +- if( im_cp_desc( out, in ) ) +- return -1; ++ if (im_check_uncoded("im_grad_x", in) || ++ im_check_mono("im_grad_x", in) || ++ im_check_int("im_grad_x", in)) ++ return (-1); ++ if (im_cp_desc(out, in)) ++ return -1; + +- -- out-> Xsize; +- out-> BandFmt= IM_BANDFMT_INT; /* do not change without updating im_gradcor() */ ++ --out->Xsize; ++ out->BandFmt = IM_BANDFMT_INT; /* do not change without updating im_gradcor() */ + +- if( im_demand_hint( out, IM_THINSTRIP, in, NULL ) ) +- return -1; ++ if (im_demand_hint(out, IM_THINSTRIP, in, NULL)) ++ return -1; + +-#define RETURN_GENERATE( TYPE ) return im_generate( out, im_start_one, xgrad_gen_ ## TYPE, im_stop_one, (void*) in, NULL ) ++#define RETURN_GENERATE(TYPE) return im_generate(out, im_start_one, xgrad_gen_##TYPE, im_stop_one, (void *) in, NULL) + +- switch( in-> BandFmt ){ ++ switch (in->BandFmt) { + +- case IM_BANDFMT_UCHAR: +- RETURN_GENERATE( guint8 ); ++ case IM_BANDFMT_UCHAR: ++ RETURN_GENERATE(guint8); + +- case IM_BANDFMT_CHAR: +- RETURN_GENERATE( gint8 ); ++ case IM_BANDFMT_CHAR: ++ RETURN_GENERATE(gint8); + +- case IM_BANDFMT_USHORT: +- RETURN_GENERATE( guint16 ); ++ case IM_BANDFMT_USHORT: ++ RETURN_GENERATE(guint16); + +- case IM_BANDFMT_SHORT: +- RETURN_GENERATE( gint16 ); ++ case IM_BANDFMT_SHORT: ++ RETURN_GENERATE(gint16); + +- case IM_BANDFMT_UINT: +- RETURN_GENERATE( guint32 ); ++ case IM_BANDFMT_UINT: ++ RETURN_GENERATE(guint32); + +- case IM_BANDFMT_INT: +- RETURN_GENERATE( gint32 ); ++ case IM_BANDFMT_INT: ++ RETURN_GENERATE(gint32); + #if 0 + case IM_BANDFMT_FLOAT: + RETURN_GENERATE( float ); +@@ -237,17 +235,16 @@ int im_grad_x( IMAGE *in, IMAGE *out ){ + RETURN_GENERATE( double ); + #endif + #undef RETURN_GENERATE +- default: +- g_assert( 0 ); +- } ++ default: ++ g_assert(0); ++ } + +- /* Keep gcc happy. +- */ +- return 0; ++ /* Keep gcc happy. ++ */ ++ return 0; + #undef FUNCTION_NAME + } + +- + /** + * im_grad_y: + * @in: input image +@@ -267,47 +264,49 @@ int im_grad_x( IMAGE *in, IMAGE *out ){ + * + * Returns: 0 on success, -1 on error + */ +-int im_grad_y( IMAGE *in, IMAGE *out ){ ++int ++im_grad_y(IMAGE *in, IMAGE *out) ++{ + #define FUNCTION_NAME "im_grad_y" + +- if( im_piocheck( in, out ) ) +- return -1; ++ if (im_piocheck(in, out)) ++ return -1; + +- if( im_check_uncoded( "im_grad_y", in ) || +- im_check_mono( "im_grad_y", in ) || +- im_check_int( "im_grad_y", in ) ) +- return( -1 ); ++ if (im_check_uncoded("im_grad_y", in) || ++ im_check_mono("im_grad_y", in) || ++ im_check_int("im_grad_y", in)) ++ return (-1); + +- if( im_cp_desc( out, in ) ) +- return -1; ++ if (im_cp_desc(out, in)) ++ return -1; + +- -- out-> Ysize; +- out-> BandFmt= IM_BANDFMT_INT; /* do not change without updating im_gradcor() */ ++ --out->Ysize; ++ out->BandFmt = IM_BANDFMT_INT; /* do not change without updating im_gradcor() */ + +- if( im_demand_hint( out, IM_FATSTRIP, in, NULL ) ) +- return -1; ++ if (im_demand_hint(out, IM_FATSTRIP, in, NULL)) ++ return -1; + +-#define RETURN_GENERATE( TYPE ) return im_generate( out, im_start_one, ygrad_gen_ ## TYPE, im_stop_one, (void*) in, NULL ) ++#define RETURN_GENERATE(TYPE) return im_generate(out, im_start_one, ygrad_gen_##TYPE, im_stop_one, (void *) in, NULL) + +- switch( in-> BandFmt ){ ++ switch (in->BandFmt) { + +- case IM_BANDFMT_UCHAR: +- RETURN_GENERATE( guint8 ); ++ case IM_BANDFMT_UCHAR: ++ RETURN_GENERATE(guint8); + +- case IM_BANDFMT_CHAR: +- RETURN_GENERATE( gint8 ); ++ case IM_BANDFMT_CHAR: ++ RETURN_GENERATE(gint8); + +- case IM_BANDFMT_USHORT: +- RETURN_GENERATE( guint16 ); ++ case IM_BANDFMT_USHORT: ++ RETURN_GENERATE(guint16); + +- case IM_BANDFMT_SHORT: +- RETURN_GENERATE( gint16 ); ++ case IM_BANDFMT_SHORT: ++ RETURN_GENERATE(gint16); + +- case IM_BANDFMT_UINT: +- RETURN_GENERATE( guint32 ); ++ case IM_BANDFMT_UINT: ++ RETURN_GENERATE(guint32); + +- case IM_BANDFMT_INT: +- RETURN_GENERATE( gint32 ); ++ case IM_BANDFMT_INT: ++ RETURN_GENERATE(gint32); + #if 0 + case IM_BANDFMT_FLOAT: + RETURN_GENERATE( float ); +@@ -315,263 +314,271 @@ int im_grad_y( IMAGE *in, IMAGE *out ){ + RETURN_GENERATE( double ); + #endif + #undef RETURN_GENERATE +- default: +- g_assert( 0 ); +- } ++ default: ++ g_assert(0); ++ } + +- /* Keep gcc happy. +- */ +- return 0; ++ /* Keep gcc happy. ++ */ ++ return 0; + #undef FUNCTION_NAME + } + +-static void *gradcor_start( IMAGE *out, void *vptr_large, void *unrequired ){ +- +- gradcor_seq_t *seq= IM_NEW( NULL, gradcor_seq_t ); +- if( ! seq ) +- return NULL; +- +- seq-> region_xgrad= (int*) NULL; +- seq-> region_ygrad= (int*) NULL; +- seq-> region_xgrad_area= 0; +- seq-> region_ygrad_area= 0; ++static void * ++gradcor_start(IMAGE *out, void *vptr_large, void *unrequired) ++{ + +- seq-> reg= im_region_create( (IMAGE*) vptr_large ); +- if( ! seq-> reg ){ +- im_free( (void*) seq ); +- return NULL; +- } +- return (void*) seq; ++ gradcor_seq_t *seq = IM_NEW(NULL, gradcor_seq_t); ++ if (!seq) ++ return NULL; ++ ++ seq->region_xgrad = (int *) NULL; ++ seq->region_ygrad = (int *) NULL; ++ seq->region_xgrad_area = 0; ++ seq->region_ygrad_area = 0; ++ ++ seq->reg = im_region_create((IMAGE *) vptr_large); ++ if (!seq->reg) { ++ im_free((void *) seq); ++ return NULL; ++ } ++ return (void *) seq; + } + +-static int gradcor_stop( void *vptr_seq, void *unrequired, void *unreq2 ){ +- +- gradcor_seq_t *seq= (gradcor_seq_t*) vptr_seq; +- if( seq ){ +- im_free( (void*) seq-> region_xgrad ); +- im_free( (void*) seq-> region_ygrad ); +- im_region_free( seq-> reg ); +- seq-> region_xgrad= (int*) NULL; +- seq-> region_ygrad= (int*) NULL; +- seq-> reg= (REGION*) NULL; +- im_free( (void*) seq ); +- } +- return 0; +-} ++static int ++gradcor_stop(void *vptr_seq, void *unrequired, void *unreq2) ++{ + +-static int gradcor_gen( REGION *to_make, void *vptr_seq, void *unrequired, void *vptr_grads ){ +- +- gradcor_seq_t *seq= (gradcor_seq_t*) vptr_seq; +- REGION *make_from= seq-> reg; +- +- IMAGE **grads= (IMAGE**) vptr_grads; +- IMAGE *small_xgrad= grads[0]; +- IMAGE *small_ygrad= grads[1]; +- +- Rect require= { +- to_make-> valid. left, +- to_make-> valid. top, +- to_make-> valid. width + small_xgrad-> Xsize, +- to_make-> valid. height + small_ygrad-> Ysize +- }; +- size_t region_xgrad_width= require. width - 1; +- size_t region_ygrad_height= require. height - 1; +- +- if( im_prepare( make_from, &require ) ) +- return -1; +- +-#define FILL_BUFFERS( TYPE ) /* fill region_xgrad */ \ +- { \ +- TYPE *reading= (TYPE*) IM_REGION_ADDR( make_from, require. left, require. top ); \ +- size_t read_skip= ( IM_REGION_LSKIP( make_from ) / sizeof(TYPE) ) - region_xgrad_width; \ +- size_t area_need= region_xgrad_width * require. height; \ +- \ +- if( seq-> region_xgrad_area < area_need ){ \ +- free( seq-> region_xgrad ); \ +- seq-> region_xgrad= malloc( area_need * sizeof(int) ); \ +- if( ! seq-> region_xgrad ) \ +- return -1; \ +- seq-> region_xgrad_area= area_need; \ +- } \ +- { \ +- int *writing= seq-> region_xgrad; \ +- int *write_end= writing + area_need; \ +- int *write_stop; \ +- for( ; writing < write_end; reading+= read_skip ) \ +- for( write_stop= writing + region_xgrad_width; writing < write_stop; ++reading, ++writing ) \ +- *writing= reading[1] - reading[0]; \ +- } \ +- } \ +- { /* fill region_ygrad */ \ +- TYPE *reading= (TYPE*) IM_REGION_ADDR( make_from, require. left, require. top ); \ +- size_t read_line= IM_REGION_LSKIP( make_from ) / sizeof(TYPE); \ +- size_t read_skip= read_line - require. width; \ +- size_t area_need= require. width * region_ygrad_height; \ +- \ +- if( seq-> region_ygrad_area < area_need ){ \ +- free( seq-> region_ygrad ); \ +- seq-> region_ygrad= malloc( area_need * sizeof(int) ); \ +- if( ! seq-> region_ygrad ) \ +- return -1; \ +- seq-> region_ygrad_area= area_need; \ +- } \ +- { \ +- int *writing= seq-> region_ygrad; \ +- int *write_end= writing + area_need; \ +- int *write_stop; \ +- for( ; writing < write_end; reading+= read_skip ) \ +- for( write_stop= writing + require. width; writing < write_stop; ++reading, ++writing ) \ +- *writing= reading[ read_line ] - reading[0]; \ +- } \ +- } +- switch( make_from-> im-> BandFmt ){ +- case IM_BANDFMT_UCHAR: +- FILL_BUFFERS( unsigned char ) +- break; +- case IM_BANDFMT_CHAR: +- FILL_BUFFERS( signed char ) +- break; +- case IM_BANDFMT_USHORT: +- FILL_BUFFERS( unsigned short int ) +- break; +- case IM_BANDFMT_SHORT: +- FILL_BUFFERS( signed short int ) +- break; +- case IM_BANDFMT_UINT: +- FILL_BUFFERS( unsigned int ) +- break; +- case IM_BANDFMT_INT: +- FILL_BUFFERS( signed int ) +- break; +- default: +- g_assert( 0 ); +- } +- { /* write to output */ +- size_t write_skip= IM_REGION_LSKIP( to_make ) / sizeof( float ); +- float *writing= (float*) IM_REGION_ADDR_TOPLEFT( to_make ); +- float *write_end= writing + write_skip * to_make-> valid. height; +- float *write_stop; +- size_t write_width= to_make-> valid. width; +- +- size_t small_xgrad_width= small_xgrad-> Xsize; +- size_t small_ygrad_width= small_ygrad-> Xsize; +- int *small_xgrad_end= (int*) small_xgrad-> data + small_xgrad_width * small_xgrad-> Ysize; +- int *small_ygrad_end= (int*) small_ygrad-> data + small_ygrad_width * small_ygrad-> Ysize; +- +- int *region_xgrad_start= seq-> region_xgrad; +- int *region_ygrad_start= seq-> region_ygrad; +- size_t region_xgrad_start_skip= region_xgrad_width - write_width; +- size_t region_ygrad_start_skip= require. width - write_width; +- +- size_t region_xgrad_read_skip= region_xgrad_width - small_xgrad_width; +- size_t region_ygrad_read_skip= require. width - small_ygrad_width; +- +- write_skip-= write_width; +- +- for( ; writing < write_end; writing+= write_skip, region_xgrad_start+= region_xgrad_start_skip, region_ygrad_start+= region_ygrad_start_skip ) +- for( write_stop= writing + write_width; writing < write_stop; ++writing, ++region_xgrad_start, ++region_ygrad_start ){ +- gint64 sum= 0; +- { +- int *small_xgrad_read= (int*) small_xgrad-> data; +- int *small_xgrad_stop; +- int *region_xgrad_read= region_xgrad_start; +- +- for( ; small_xgrad_read < small_xgrad_end; region_xgrad_read+= region_xgrad_read_skip ) +- for( small_xgrad_stop= small_xgrad_read + small_xgrad_width; small_xgrad_read < small_xgrad_stop; ++small_xgrad_read, ++region_xgrad_read ) +- sum+= *small_xgrad_read * *region_xgrad_read; +- } +- { +- int *small_ygrad_read= (int*) small_ygrad-> data; +- int *small_ygrad_stop; +- int *region_ygrad_read= region_ygrad_start; +- +- for( ; small_ygrad_read < small_ygrad_end; region_ygrad_read+= region_ygrad_read_skip ) +- for( small_ygrad_stop= small_ygrad_read + small_ygrad_width; small_ygrad_read < small_ygrad_stop; ++small_ygrad_read, ++region_ygrad_read ) +- sum+= *small_ygrad_read * *region_ygrad_read; +- } +- *writing= sum; +- } +- } +- return 0; ++ gradcor_seq_t *seq = (gradcor_seq_t *) vptr_seq; ++ if (seq) { ++ im_free((void *) seq->region_xgrad); ++ im_free((void *) seq->region_ygrad); ++ im_region_free(seq->reg); ++ seq->region_xgrad = (int *) NULL; ++ seq->region_ygrad = (int *) NULL; ++ seq->reg = (REGION *) NULL; ++ im_free((void *) seq); ++ } ++ return 0; + } + +-#define XGRAD_GEN_DEFINITION( TYPE ) \ +-static int xgrad_gen_ ## TYPE( REGION *to_make, void *vptr_make_from, void *unrequired, void *unreq2 ){ \ +- \ +- REGION *make_from= (REGION*) vptr_make_from; \ +- Rect require= { \ +- to_make-> valid. left, \ +- to_make-> valid. top, \ +- to_make-> valid. width + 1, \ +- to_make-> valid. height \ +- }; \ +- if( im_prepare( make_from, &require ) ) \ +- return -1; \ +- \ +- { \ +- int *writing= (int*) IM_REGION_ADDR_TOPLEFT( to_make ); \ +- size_t write_skip= IM_REGION_LSKIP( to_make ) / sizeof(int); \ +- int *write_end= writing + write_skip * to_make-> valid. height; \ +- size_t write_width= to_make-> valid. width; \ +- int *write_stop; \ +- \ +- TYPE *reading= (TYPE*) IM_REGION_ADDR( make_from, require. left, require. top ); \ +- size_t read_skip= ( IM_REGION_LSKIP( make_from ) / sizeof(TYPE) ) - write_width; \ +- \ +- write_skip-= write_width; \ +- \ +- for( ; writing < write_end; writing+= write_skip, reading+= read_skip ) \ +- for( write_stop= writing + write_width; writing < write_stop; ++writing, ++reading ) \ +- *writing= (int)( reading[1] - reading[0] ); \ +- } \ +- return 0; \ +-} ++static int ++gradcor_gen(REGION *to_make, void *vptr_seq, void *unrequired, void *vptr_grads) ++{ + +-#define YGRAD_GEN_DEFINITION( TYPE ) \ +-static int ygrad_gen_ ## TYPE( REGION *to_make, void *vptr_make_from, void *unrequired, void *unreq2 ){ \ +- \ +- REGION *make_from= (REGION*) vptr_make_from; \ +- Rect require= { \ +- to_make-> valid. left, \ +- to_make-> valid. top, \ +- to_make-> valid. width, \ +- to_make-> valid. height + 1 \ +- }; \ +- if( im_prepare( make_from, &require ) ) \ +- return -1; \ +- \ +- { \ +- int *writing= (int*) IM_REGION_ADDR_TOPLEFT( to_make ); \ +- size_t write_skip= IM_REGION_LSKIP( to_make ) / sizeof(int); \ +- int *write_end= writing + write_skip * to_make-> valid. height; \ +- size_t write_width= to_make-> valid. width; \ +- int *write_stop; \ +- \ +- TYPE *reading= (TYPE*) IM_REGION_ADDR( make_from, require. left, require. top ); \ +- size_t read_line= IM_REGION_LSKIP( make_from ) / sizeof(TYPE); \ +- size_t read_skip= read_line - write_width; \ +- \ +- write_skip-= write_width; \ +- \ +- for( ; writing < write_end; writing+= write_skip, reading+= read_skip ) \ +- for( write_stop= writing + write_width; writing < write_stop; ++writing, ++reading ) \ +- *writing= (int)( reading[ read_line ] - reading[0] ); \ +- } \ +- return 0; \ ++ gradcor_seq_t *seq = (gradcor_seq_t *) vptr_seq; ++ REGION *make_from = seq->reg; ++ ++ IMAGE **grads = (IMAGE **) vptr_grads; ++ IMAGE *small_xgrad = grads[0]; ++ IMAGE *small_ygrad = grads[1]; ++ ++ Rect require = { ++ to_make->valid.left, ++ to_make->valid.top, ++ to_make->valid.width + small_xgrad->Xsize, ++ to_make->valid.height + small_ygrad->Ysize ++ }; ++ size_t region_xgrad_width = require.width - 1; ++ size_t region_ygrad_height = require.height - 1; ++ ++ if (im_prepare(make_from, &require)) ++ return -1; ++ ++#define FILL_BUFFERS(TYPE) /* fill region_xgrad */ \ ++ { \ ++ TYPE *reading = (TYPE *) IM_REGION_ADDR(make_from, require.left, require.top); \ ++ size_t read_skip = (IM_REGION_LSKIP(make_from) / sizeof(TYPE)) - region_xgrad_width; \ ++ size_t area_need = region_xgrad_width * require.height; \ ++\ ++ if (seq->region_xgrad_area < area_need) { \ ++ free(seq->region_xgrad); \ ++ seq->region_xgrad = malloc(area_need * sizeof(int)); \ ++ if (!seq->region_xgrad) \ ++ return -1; \ ++ seq->region_xgrad_area = area_need; \ ++ } \ ++ { \ ++ int *writing = seq->region_xgrad; \ ++ int *write_end = writing + area_need; \ ++ int *write_stop; \ ++ for (; writing < write_end; reading += read_skip) \ ++ for (write_stop = writing + region_xgrad_width; writing < write_stop; ++reading, ++writing) \ ++ *writing = reading[1] - reading[0]; \ ++ } \ ++ } \ ++ { /* fill region_ygrad */ \ ++ TYPE *reading = (TYPE *) IM_REGION_ADDR(make_from, require.left, require.top); \ ++ size_t read_line = IM_REGION_LSKIP(make_from) / sizeof(TYPE); \ ++ size_t read_skip = read_line - require.width; \ ++ size_t area_need = require.width * region_ygrad_height; \ ++\ ++ if (seq->region_ygrad_area < area_need) { \ ++ free(seq->region_ygrad); \ ++ seq->region_ygrad = malloc(area_need * sizeof(int)); \ ++ if (!seq->region_ygrad) \ ++ return -1; \ ++ seq->region_ygrad_area = area_need; \ ++ } \ ++ { \ ++ int *writing = seq->region_ygrad; \ ++ int *write_end = writing + area_need; \ ++ int *write_stop; \ ++ for (; writing < write_end; reading += read_skip) \ ++ for (write_stop = writing + require.width; writing < write_stop; ++reading, ++writing) \ ++ *writing = reading[read_line] - reading[0]; \ ++ } \ ++ } ++ switch (make_from->im->BandFmt) { ++ case IM_BANDFMT_UCHAR: ++ FILL_BUFFERS(unsigned char) ++ break; ++ case IM_BANDFMT_CHAR: ++ FILL_BUFFERS(signed char) ++ break; ++ case IM_BANDFMT_USHORT: ++ FILL_BUFFERS(unsigned short int) ++ break; ++ case IM_BANDFMT_SHORT: ++ FILL_BUFFERS(signed short int) ++ break; ++ case IM_BANDFMT_UINT: ++ FILL_BUFFERS(unsigned int) ++ break; ++ case IM_BANDFMT_INT: ++ FILL_BUFFERS(signed int) ++ break; ++ default: ++ g_assert(0); ++ } ++ { /* write to output */ ++ size_t write_skip = IM_REGION_LSKIP(to_make) / sizeof(float); ++ float *writing = (float *) IM_REGION_ADDR_TOPLEFT(to_make); ++ float *write_end = writing + write_skip * to_make->valid.height; ++ float *write_stop; ++ size_t write_width = to_make->valid.width; ++ ++ size_t small_xgrad_width = small_xgrad->Xsize; ++ size_t small_ygrad_width = small_ygrad->Xsize; ++ int *small_xgrad_end = (int *) small_xgrad->data + small_xgrad_width * small_xgrad->Ysize; ++ int *small_ygrad_end = (int *) small_ygrad->data + small_ygrad_width * small_ygrad->Ysize; ++ ++ int *region_xgrad_start = seq->region_xgrad; ++ int *region_ygrad_start = seq->region_ygrad; ++ size_t region_xgrad_start_skip = region_xgrad_width - write_width; ++ size_t region_ygrad_start_skip = require.width - write_width; ++ ++ size_t region_xgrad_read_skip = region_xgrad_width - small_xgrad_width; ++ size_t region_ygrad_read_skip = require.width - small_ygrad_width; ++ ++ write_skip -= write_width; ++ ++ for (; writing < write_end; writing += write_skip, region_xgrad_start += region_xgrad_start_skip, region_ygrad_start += region_ygrad_start_skip) ++ for (write_stop = writing + write_width; writing < write_stop; ++writing, ++region_xgrad_start, ++region_ygrad_start) { ++ gint64 sum = 0; ++ { ++ int *small_xgrad_read = (int *) small_xgrad->data; ++ int *small_xgrad_stop; ++ int *region_xgrad_read = region_xgrad_start; ++ ++ for (; small_xgrad_read < small_xgrad_end; region_xgrad_read += region_xgrad_read_skip) ++ for (small_xgrad_stop = small_xgrad_read + small_xgrad_width; small_xgrad_read < small_xgrad_stop; ++small_xgrad_read, ++region_xgrad_read) ++ sum += *small_xgrad_read * *region_xgrad_read; ++ } ++ { ++ int *small_ygrad_read = (int *) small_ygrad->data; ++ int *small_ygrad_stop; ++ int *region_ygrad_read = region_ygrad_start; ++ ++ for (; small_ygrad_read < small_ygrad_end; region_ygrad_read += region_ygrad_read_skip) ++ for (small_ygrad_stop = small_ygrad_read + small_ygrad_width; small_ygrad_read < small_ygrad_stop; ++small_ygrad_read, ++region_ygrad_read) ++ sum += *small_ygrad_read * *region_ygrad_read; ++ } ++ *writing = sum; ++ } ++ } ++ return 0; + } + +-XGRAD_GEN_DEFINITION( guint8 ) +-YGRAD_GEN_DEFINITION( guint8 ) +-XGRAD_GEN_DEFINITION( gint8 ) +-YGRAD_GEN_DEFINITION( gint8 ) +-XGRAD_GEN_DEFINITION( guint16 ) +-YGRAD_GEN_DEFINITION( guint16 ) +-XGRAD_GEN_DEFINITION( gint16 ) +-YGRAD_GEN_DEFINITION( gint16 ) +-XGRAD_GEN_DEFINITION( guint32 ) +-YGRAD_GEN_DEFINITION( guint32 ) +-XGRAD_GEN_DEFINITION( gint32 ) +-YGRAD_GEN_DEFINITION( gint32 ) ++#define XGRAD_GEN_DEFINITION(TYPE) \ ++ static int xgrad_gen_##TYPE(REGION *to_make, void *vptr_make_from, void *unrequired, void *unreq2) \ ++ { \ ++\ ++ REGION *make_from = (REGION *) vptr_make_from; \ ++ Rect require = { \ ++ to_make->valid.left, \ ++ to_make->valid.top, \ ++ to_make->valid.width + 1, \ ++ to_make->valid.height \ ++ }; \ ++ if (im_prepare(make_from, &require)) \ ++ return -1; \ ++\ ++ { \ ++ int *writing = (int *) IM_REGION_ADDR_TOPLEFT(to_make); \ ++ size_t write_skip = IM_REGION_LSKIP(to_make) / sizeof(int); \ ++ int *write_end = writing + write_skip * to_make->valid.height; \ ++ size_t write_width = to_make->valid.width; \ ++ int *write_stop; \ ++\ ++ TYPE *reading = (TYPE *) IM_REGION_ADDR(make_from, require.left, require.top); \ ++ size_t read_skip = (IM_REGION_LSKIP(make_from) / sizeof(TYPE)) - write_width; \ ++\ ++ write_skip -= write_width; \ ++\ ++ for (; writing < write_end; writing += write_skip, reading += read_skip) \ ++ for (write_stop = writing + write_width; writing < write_stop; ++writing, ++reading) \ ++ *writing = (int) (reading[1] - reading[0]); \ ++ } \ ++ return 0; \ ++ } ++ ++#define YGRAD_GEN_DEFINITION(TYPE) \ ++ static int ygrad_gen_##TYPE(REGION *to_make, void *vptr_make_from, void *unrequired, void *unreq2) \ ++ { \ ++\ ++ REGION *make_from = (REGION *) vptr_make_from; \ ++ Rect require = { \ ++ to_make->valid.left, \ ++ to_make->valid.top, \ ++ to_make->valid.width, \ ++ to_make->valid.height + 1 \ ++ }; \ ++ if (im_prepare(make_from, &require)) \ ++ return -1; \ ++\ ++ { \ ++ int *writing = (int *) IM_REGION_ADDR_TOPLEFT(to_make); \ ++ size_t write_skip = IM_REGION_LSKIP(to_make) / sizeof(int); \ ++ int *write_end = writing + write_skip * to_make->valid.height; \ ++ size_t write_width = to_make->valid.width; \ ++ int *write_stop; \ ++\ ++ TYPE *reading = (TYPE *) IM_REGION_ADDR(make_from, require.left, require.top); \ ++ size_t read_line = IM_REGION_LSKIP(make_from) / sizeof(TYPE); \ ++ size_t read_skip = read_line - write_width; \ ++\ ++ write_skip -= write_width; \ ++\ ++ for (; writing < write_end; writing += write_skip, reading += read_skip) \ ++ for (write_stop = writing + write_width; writing < write_stop; ++writing, ++reading) \ ++ *writing = (int) (reading[read_line] - reading[0]); \ ++ } \ ++ return 0; \ ++ } ++ ++XGRAD_GEN_DEFINITION(guint8) ++YGRAD_GEN_DEFINITION(guint8) ++XGRAD_GEN_DEFINITION(gint8) ++YGRAD_GEN_DEFINITION(gint8) ++XGRAD_GEN_DEFINITION(guint16) ++YGRAD_GEN_DEFINITION(guint16) ++XGRAD_GEN_DEFINITION(gint16) ++YGRAD_GEN_DEFINITION(gint16) ++XGRAD_GEN_DEFINITION(guint32) ++YGRAD_GEN_DEFINITION(guint32) ++XGRAD_GEN_DEFINITION(gint32) ++YGRAD_GEN_DEFINITION(gint32) + #if 0 + XGRAD_GEN_DEFINITION( float ) + YGRAD_GEN_DEFINITION( float ) +diff --git a/libvips/deprecated/im_jpeg2vips.c b/libvips/deprecated/im_jpeg2vips.c +index bd26401ceb..637b249d00 100644 +--- a/libvips/deprecated/im_jpeg2vips.c ++++ b/libvips/deprecated/im_jpeg2vips.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -52,7 +52,7 @@ + #include "../foreign/pforeign.h" + + static int +-jpeg2vips( const char *name, IMAGE *out, gboolean header_only ) ++jpeg2vips(const char *name, IMAGE *out, gboolean header_only) + { + char filename[FILENAME_MAX]; + char mode[FILENAME_MAX]; +@@ -68,26 +68,26 @@ jpeg2vips( const char *name, IMAGE *out, gboolean header_only ) + + /* Parse the filename. + */ +- im_filename_split( name, filename, mode ); ++ im_filename_split(name, filename, mode); + p = &mode[0]; + shrink = 1; + seq = 0; +- if( (q = im_getnextoption( &p )) ) { +- shrink = atoi( q ); +- +- if( shrink != 1 && shrink != 2 && +- shrink != 4 && shrink != 8 ) { +- im_error( "im_jpeg2vips", +- _( "bad shrink factor %d" ), shrink ); +- return( -1 ); ++ if ((q = im_getnextoption(&p))) { ++ shrink = atoi(q); ++ ++ if (shrink != 1 && shrink != 2 && ++ shrink != 4 && shrink != 8) { ++ im_error("im_jpeg2vips", ++ _("bad shrink factor %d"), shrink); ++ return (-1); + } + } +- if( (q = im_getnextoption( &p )) ) { +- if( im_isprefix( "fail", q ) ) ++ if ((q = im_getnextoption(&p))) { ++ if (im_isprefix("fail", q)) + fail_on_warn = TRUE; + } +- if( (q = im_getnextoption( &p )) ) { +- if( im_isprefix( "seq", q ) ) ++ if ((q = im_getnextoption(&p))) { ++ if (im_isprefix("seq", q)) + seq = 1; + } + +@@ -96,86 +96,86 @@ jpeg2vips( const char *name, IMAGE *out, gboolean header_only ) + * like that. + */ + +- /* We need to be compatible with the pre-sequential mode ++ /* We need to be compatible with the pre-sequential mode + * im_jpeg2vips(). This returned a "t" if given a "p" image, since it + * used writeline. + * + * If we're writing the image to a "p", switch it to a "t". + */ + +- if( !header_only && ++ if (!header_only && + !seq && +- out->dtype == VIPS_IMAGE_PARTIAL ) { +- if( vips__image_wio_output( out ) ) +- return( -1 ); ++ out->dtype == VIPS_IMAGE_PARTIAL) { ++ if (vips__image_wio_output(out)) ++ return (-1); + } + + #ifdef HAVE_JPEG +-{ +- VipsSource *source; +- +- if( !(source = vips_source_new_from_file( filename )) ) +- return( -1 ); +- if( vips__jpeg_read_source( source, out, +- header_only, shrink, fail_on_warn, FALSE, FALSE ) ) { +- VIPS_UNREF( source ); +- return( -1 ); ++ { ++ VipsSource *source; ++ ++ if (!(source = vips_source_new_from_file(filename))) ++ return (-1); ++ if (vips__jpeg_read_source(source, out, ++ header_only, shrink, fail_on_warn, FALSE, FALSE)) { ++ VIPS_UNREF(source); ++ return (-1); ++ } ++ VIPS_UNREF(source); + } +- VIPS_UNREF( source ); +-} + #else +- vips_error( "im_jpeg2vips", +- "%s", _( "no JPEG support in your libvips" ) ); ++ vips_error("im_jpeg2vips", ++ "%s", _("no JPEG support in your libvips")); + +- return( -1 ); ++ return (-1); + #endif /*HAVE_JPEG*/ + +- return( 0 ); ++ return (0); + } + + int +-im_jpeg2vips( const char *name, IMAGE *out ) ++im_jpeg2vips(const char *name, IMAGE *out) + { +- return( jpeg2vips( name, out, FALSE ) ); ++ return (jpeg2vips(name, out, FALSE)); + } + + /* By having a separate header func, we get lazy.c to open via disc/mem. + */ + static int +-im_jpeg2vips_header( const char *name, IMAGE *out ) ++im_jpeg2vips_header(const char *name, IMAGE *out) + { +- return( jpeg2vips( name, out, TRUE ) ); ++ return (jpeg2vips(name, out, TRUE)); + } + + int +-im_bufjpeg2vips( void *buf, size_t len, IMAGE *out, gboolean header_only ) ++im_bufjpeg2vips(void *buf, size_t len, IMAGE *out, gboolean header_only) + { + VipsImage *t; + +- /* header_only is now automatic ... this call will only decompress on ++ /* header_only is now automatic ... this call will only decompress on + * pixel access. + */ + +- if( vips_jpegload_buffer( buf, len, &t, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_jpegload_buffer(buf, len, &t, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + static int +-isjpeg( const char *name ) ++isjpeg(const char *name) + { + char filename[FILENAME_MAX]; + char mode[FILENAME_MAX]; + +- im_filename_split( name, filename, mode ); ++ im_filename_split(name, filename, mode); + +- return( vips_foreign_is_a( "jpegload", filename ) ); ++ return (vips_foreign_is_a("jpegload", filename)); + } + + static const char *jpeg_suffs[] = { ".jpg", ".jpeg", ".jpe", NULL }; +@@ -186,13 +186,13 @@ typedef VipsFormat VipsFormatJpeg; + typedef VipsFormatClass VipsFormatJpegClass; + + static void +-vips_format_jpeg_class_init( VipsFormatJpegClass *class ) ++vips_format_jpeg_class_init(VipsFormatJpegClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsFormatClass *format_class = (VipsFormatClass *) class; + + object_class->nickname = "jpeg"; +- object_class->description = _( "JPEG" ); ++ object_class->description = _("JPEG"); + + format_class->is_a = isjpeg; + format_class->header = im_jpeg2vips_header; +@@ -202,8 +202,8 @@ vips_format_jpeg_class_init( VipsFormatJpegClass *class ) + } + + static void +-vips_format_jpeg_init( VipsFormatJpeg *object ) ++vips_format_jpeg_init(VipsFormatJpeg *object) + { + } + +-G_DEFINE_TYPE( VipsFormatJpeg, vips_format_jpeg, VIPS_TYPE_FORMAT ); ++G_DEFINE_TYPE(VipsFormatJpeg, vips_format_jpeg, VIPS_TYPE_FORMAT); +diff --git a/libvips/deprecated/im_lab_morph.c b/libvips/deprecated/im_lab_morph.c +index eaf7c3a444..e44f83ebc0 100644 +--- a/libvips/deprecated/im_lab_morph.c ++++ b/libvips/deprecated/im_lab_morph.c +@@ -9,28 +9,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -49,30 +49,29 @@ + #include + + int +-im__colour_unary( const char *domain, ++im__colour_unary(const char *domain, + IMAGE *in, IMAGE *out, VipsType type, +- im_wrapone_fn buffer_fn, void *a, void *b ) ++ im_wrapone_fn buffer_fn, void *a, void *b) + { + IMAGE *t[1]; + +- if( im_check_uncoded( domain, in ) || +- im_check_bands( domain, in, 3 ) || +- im_open_local_array( out, t, 1, domain, "p" ) || +- im_clip2fmt( in, t[0], IM_BANDFMT_FLOAT ) ) +- return( -1 ); ++ if (im_check_uncoded(domain, in) || ++ im_check_bands(domain, in, 3) || ++ im_open_local_array(out, t, 1, domain, "p") || ++ im_clip2fmt(in, t[0], IM_BANDFMT_FLOAT)) ++ return (-1); + +- if( im_cp_desc( out, t[0] ) ) +- return( -1 ); ++ if (im_cp_desc(out, t[0])) ++ return (-1); + out->Type = type; + +- if( im_wrapone( t[0], out, +- (im_wrapone_fn) buffer_fn, a, b ) ) +- return( -1 ); ++ if (im_wrapone(t[0], out, ++ (im_wrapone_fn) buffer_fn, a, b)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +- + typedef struct { + IMAGE *in, *out; + +@@ -83,10 +82,10 @@ typedef struct { + } Params; + + static int +-morph_init( Params *parm, ++morph_init(Params *parm, + IMAGE *in, IMAGE *out, +- double L_scale, double L_offset, +- DOUBLEMASK *mask, double a_scale, double b_scale ) ++ double L_scale, double L_offset, ++ DOUBLEMASK *mask, double a_scale, double b_scale) + { + int i, j; + +@@ -97,27 +96,27 @@ morph_init( Params *parm, + parm->a_scale = a_scale; + parm->b_scale = b_scale; + +- if( mask->xsize != 3 || mask->ysize < 1 || mask->ysize > 100 ) { +- im_error( "im_lab_morph", "%s", +- _( "bad greyscale mask size" ) ); +- return( -1 ); ++ if (mask->xsize != 3 || mask->ysize < 1 || mask->ysize > 100) { ++ im_error("im_lab_morph", "%s", ++ _("bad greyscale mask size")); ++ return (-1); + } +- for( i = 0; i < mask->ysize; i++ ) { +- double L = mask->coeff[i*3]; +- double a = mask->coeff[i*3 + 1]; +- double b = mask->coeff[i*3 + 2]; +- +- if( L < 0 || L > 100 || a < -120 || a > 120 || +- b < -120 || b > 120 ) { +- im_error( "im_lab_morph", +- _( "bad greyscale mask value, row %d" ), i ); +- return( -1 ); ++ for (i = 0; i < mask->ysize; i++) { ++ double L = mask->coeff[i * 3]; ++ double a = mask->coeff[i * 3 + 1]; ++ double b = mask->coeff[i * 3 + 2]; ++ ++ if (L < 0 || L > 100 || a < -120 || a > 120 || ++ b < -120 || b > 120) { ++ im_error("im_lab_morph", ++ _("bad greyscale mask value, row %d"), i); ++ return (-1); + } + } + + /* Generate a/b offsets. + */ +- for( i = 0; i <= 100; i++ ) { ++ for (i = 0; i <= 100; i++) { + double L_low = 0; + double a_low = 0; + double b_low = 0; +@@ -129,12 +128,12 @@ morph_init( Params *parm, + /* Search for greyscale L just below i. Don't assume sorted by + * L*. + */ +- for( j = 0; j < mask->ysize; j++ ) { +- double L = mask->coeff[j*3]; +- double a = mask->coeff[j*3 + 1]; +- double b = mask->coeff[j*3 + 2]; ++ for (j = 0; j < mask->ysize; j++) { ++ double L = mask->coeff[j * 3]; ++ double a = mask->coeff[j * 3 + 1]; ++ double b = mask->coeff[j * 3 + 2]; + +- if( L < i && L > L_low ) { ++ if (L < i && L > L_low) { + L_low = L; + a_low = a; + b_low = b; +@@ -143,12 +142,12 @@ morph_init( Params *parm, + + /* Search for greyscale L just above i. + */ +- for( j = mask->ysize - 1; j >= 0; j-- ) { +- double L = mask->coeff[j*3]; +- double a = mask->coeff[j*3 + 1]; +- double b = mask->coeff[j*3 + 2]; ++ for (j = mask->ysize - 1; j >= 0; j--) { ++ double L = mask->coeff[j * 3]; ++ double a = mask->coeff[j * 3 + 1]; ++ double b = mask->coeff[j * 3 + 2]; + +- if( L >= i && L < L_high ) { ++ if (L >= i && L < L_high) { + L_high = L; + a_high = a; + b_high = b; +@@ -157,42 +156,42 @@ morph_init( Params *parm, + + /* Interpolate. + */ +- parm->a_offset[i] = a_low + ++ parm->a_offset[i] = a_low + + (a_high - a_low) * ((i - L_low) / (L_high - L_low)); +- parm->b_offset[i] = b_low + ++ parm->b_offset[i] = b_low + + (b_high - b_low) * ((i - L_low) / (L_high - L_low)); + } + +- return( 0 ); ++ return (0); + } + + static void +-morph_buffer( float *in, float *out, int width, Params *parm ) ++morph_buffer(float *in, float *out, int width, Params *parm) + { + int x; + +- for( x = 0; x < width; x++ ) { +- double L = in[0]; +- double a = in[1]; +- double b = in[2]; +- +- L = IM_CLIP( 0, L, 100 ); +- a -= parm->a_offset[(int) L]; +- b -= parm->b_offset[(int) L]; +- +- L = (L + parm->L_offset) * parm->L_scale; +- L = IM_CLIP( 0, L, 100 ); +- +- a *= parm->a_scale; +- b *= parm->b_scale; +- +- out[0] = L; +- out[1] = a; +- out[2] = b; +- +- in += 3; +- out += 3; +- } ++ for (x = 0; x < width; x++) { ++ double L = in[0]; ++ double a = in[1]; ++ double b = in[2]; ++ ++ L = IM_CLIP(0, L, 100); ++ a -= parm->a_offset[(int) L]; ++ b -= parm->b_offset[(int) L]; ++ ++ L = (L + parm->L_offset) * parm->L_scale; ++ L = IM_CLIP(0, L, 100); ++ ++ a *= parm->a_scale; ++ b *= parm->b_scale; ++ ++ out[0] = L; ++ out[1] = a; ++ out[2] = b; ++ ++ in += 3; ++ out += 3; ++ } + } + + /** +@@ -209,7 +208,7 @@ morph_buffer( float *in, float *out, int width, Params *parm ) + * mapping, or correction of greyscales on some printers. + * + * We perform three adjustments: +- * ++ * + * + * + * +@@ -248,8 +247,8 @@ morph_buffer( float *in, float *out, int width, Params *parm ) + * + * + * Interpolation from this makes cast corrector. The top and tail are +- * interpolated towards [0, 0, 0] and [100, 0, 0], intermediate values are +- * interpolated along straight lines fitted between the specified points. ++ * interpolated towards [0, 0, 0] and [100, 0, 0], intermediate values are ++ * interpolated along straight lines fitted between the specified points. + * Rows may be in any order (ie. they need not be sorted on L*). + * + * Each pixel is displaced in a/b by the amount specified for that L in the +@@ -259,7 +258,7 @@ morph_buffer( float *in, float *out, int width, Params *parm ) + * + * + * L* +- * ++ * + * Pass in scale and offset for L. L' = (L + offset) * scale. + * + * +@@ -267,7 +266,7 @@ morph_buffer( float *in, float *out, int width, Params *parm ) + * + * saturation + * +- * scale a and b by these amounts, eg. 1.5 increases saturation. ++ * scale a and b by these amounts, eg. 1.5 increases saturation. + * + * + * +@@ -278,33 +277,33 @@ morph_buffer( float *in, float *out, int width, Params *parm ) + * Returns: 0 on success, -1 on error. + */ + int +-im_lab_morph( IMAGE *in, IMAGE *out, +- DOUBLEMASK *mask, +- double L_offset, double L_scale, +- double a_scale, double b_scale ) ++im_lab_morph(IMAGE *in, IMAGE *out, ++ DOUBLEMASK *mask, ++ double L_offset, double L_scale, ++ double a_scale, double b_scale) + { + Params *parm; + +- /* Recurse for coded images. +- */ +- if( in->Coding == IM_CODING_LABQ ) { ++ /* Recurse for coded images. ++ */ ++ if (in->Coding == IM_CODING_LABQ) { + IMAGE *t[2]; + +- if( im_open_local_array( out, t, 2, "im_lab_morph", "p" ) || +- im_LabQ2Lab( in, t[0] ) || +- im_lab_morph( t[0], t[1], +- mask, L_offset, L_scale, a_scale, b_scale ) || +- im_Lab2LabQ( t[1], out ) ) +- return( -1 ); ++ if (im_open_local_array(out, t, 2, "im_lab_morph", "p") || ++ im_LabQ2Lab(in, t[0]) || ++ im_lab_morph(t[0], t[1], ++ mask, L_offset, L_scale, a_scale, b_scale) || ++ im_Lab2LabQ(t[1], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +- if( !(parm = IM_NEW( out, Params )) || +- morph_init( parm, +- in, out, L_scale, L_offset, mask, a_scale, b_scale ) ) +- return( -1 ); ++ if (!(parm = IM_NEW(out, Params)) || ++ morph_init(parm, ++ in, out, L_scale, L_offset, mask, a_scale, b_scale)) ++ return (-1); + +- return( im__colour_unary( "im_lab_morph", in, out, IM_TYPE_LAB, +- (im_wrapone_fn) morph_buffer, parm, NULL ) ); ++ return (im__colour_unary("im_lab_morph", in, out, IM_TYPE_LAB, ++ (im_wrapone_fn) morph_buffer, parm, NULL)); + } +diff --git a/libvips/deprecated/im_line.c b/libvips/deprecated/im_line.c +index b127983852..14f7798302 100644 +--- a/libvips/deprecated/im_line.c ++++ b/libvips/deprecated/im_line.c +@@ -17,28 +17,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -54,101 +54,99 @@ + #include + #include + +-int im_line(image, x1, y1, x2, y2, pelval) ++int ++im_line(image, x1, y1, x2, y2, pelval) + IMAGE *image; +-int x1, x2, y1, y2, pelval; ++int x1, x2, y1, y2, pelval; + { + +-double x, y, dx, dy, m; +-long offset; +-double signx, signy; +- +- if( im_rwcheck( image ) ) +- return( -1 ); +-/* check coordinates */ +-if ( (x1 > image->Xsize)||(x1<0)||(y1 > image->Ysize)||(y1<0) +- ||(x2 > image->Xsize)||(x2<0)||(y2 > image->Ysize)||(y2<0) ) { +- im_error( "im_line", "%s", _( "invalid line cooordinates") ); +- return(-1); } +-if ((pelval > 255)||(pelval < 0)) { +- im_error( "im_line", "%s", _( "line intensity between 0 and 255") ); +- return(-1); } +- +-if (image->Bands != 1) { +- im_error( "im_line", "%s", _( "image should have one band only") ); +- return(-1); } +- +-dx = (double)(x2 - x1); +-dy = (double)(y2 - y1); +- +-if (dx < 0.0) +- signx = -1.0; +-else +- signx = 1.0; +- +-if (dy < 0.0) +- signy = -1.0; +-else +- signy = 1.0; +- +-if (dx == 0.0) +- { +- x = x1; y = y1; +- while (y != y2) +- { +- offset = (int)(x+.5) + ((int)(y +.5)) * image->Xsize; +- *(image->data + offset) = (PEL)pelval; +- y += signy; ++ double x, y, dx, dy, m; ++ long offset; ++ double signx, signy; ++ ++ if (im_rwcheck(image)) ++ return (-1); ++ /* check coordinates */ ++ if ((x1 > image->Xsize) || (x1 < 0) || (y1 > image->Ysize) || (y1 < 0) || (x2 > image->Xsize) || (x2 < 0) || (y2 > image->Ysize) || (y2 < 0)) { ++ im_error("im_line", "%s", _("invalid line cooordinates")); ++ return (-1); ++ } ++ if ((pelval > 255) || (pelval < 0)) { ++ im_error("im_line", "%s", _("line intensity between 0 and 255")); ++ return (-1); ++ } ++ ++ if (image->Bands != 1) { ++ im_error("im_line", "%s", _("image should have one band only")); ++ return (-1); ++ } ++ ++ dx = (double) (x2 - x1); ++ dy = (double) (y2 - y1); ++ ++ if (dx < 0.0) ++ signx = -1.0; ++ else ++ signx = 1.0; ++ ++ if (dy < 0.0) ++ signy = -1.0; ++ else ++ signy = 1.0; ++ ++ if (dx == 0.0) { ++ x = x1; ++ y = y1; ++ while (y != y2) { ++ offset = (int) (x + .5) + ((int) (y + .5)) * image->Xsize; ++ *(image->data + offset) = (PEL) pelval; ++ y += signy; + } +- /* Draw point (x2, y2) */ +- offset = x2 + y2 * image->Xsize; +- *(image->data + offset) = (PEL)pelval; +- return(0); ++ /* Draw point (x2, y2) */ ++ offset = x2 + y2 * image->Xsize; ++ *(image->data + offset) = (PEL) pelval; ++ return (0); + } + +-if (dy == 0.0) +- { +- y = y1; x = x1; +- while (x != x2) +- { +- offset = (int)(x+.5) + ((int)(y +.5)) * image->Xsize; +- *(image->data + offset) = (PEL)pelval; +- x += signx; ++ if (dy == 0.0) { ++ y = y1; ++ x = x1; ++ while (x != x2) { ++ offset = (int) (x + .5) + ((int) (y + .5)) * image->Xsize; ++ *(image->data + offset) = (PEL) pelval; ++ x += signx; + } +- /* Draw point (x2, y2) */ +- offset = x2 + y2 * image->Xsize; +- *(image->data + offset) = (PEL)pelval; +- return(0); ++ /* Draw point (x2, y2) */ ++ offset = x2 + y2 * image->Xsize; ++ *(image->data + offset) = (PEL) pelval; ++ return (0); + } + +-if (fabs(dy) < fabs(dx)) +- { +- m = fabs(dy/dx)*signy; +- y = y1; +- x = x1; +- while (x != x2) +- { +- offset = (int)(x+.5) + ((int)(y +.5)) * image->Xsize; +- *(image->data + offset) = (PEL)pelval; +- x += signx; +- y += m; ++ if (fabs(dy) < fabs(dx)) { ++ m = fabs(dy / dx) * signy; ++ y = y1; ++ x = x1; ++ while (x != x2) { ++ offset = (int) (x + .5) + ((int) (y + .5)) * image->Xsize; ++ *(image->data + offset) = (PEL) pelval; ++ x += signx; ++ y += m; + } + } +-else +- { +- m = fabs(dx/dy)*signx; +- x = x1; y = y1; +- while (y != y2) +- { +- offset = (int)(x+.5) + ((int)(y +.5)) * image->Xsize; +- *(image->data + offset) = (PEL)pelval; +- x += m; +- y += signy; ++ else { ++ m = fabs(dx / dy) * signx; ++ x = x1; ++ y = y1; ++ while (y != y2) { ++ offset = (int) (x + .5) + ((int) (y + .5)) * image->Xsize; ++ *(image->data + offset) = (PEL) pelval; ++ x += m; ++ y += signy; + } + } +-/* Draw point (x2, y2) */ +-offset = x2 + y2 * image->Xsize; +-*(image->data + offset) = (PEL)pelval; +- im_invalidate( image ); +-return(0); ++ /* Draw point (x2, y2) */ ++ offset = x2 + y2 * image->Xsize; ++ *(image->data + offset) = (PEL) pelval; ++ im_invalidate(image); ++ return (0); + } +diff --git a/libvips/deprecated/im_linreg.c b/libvips/deprecated/im_linreg.c +index 01ef4c4dde..dce3ed1085 100644 +--- a/libvips/deprecated/im_linreg.c ++++ b/libvips/deprecated/im_linreg.c +@@ -14,32 +14,31 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +- + #ifdef HAVE_CONFIG_H + #include + #endif /* HAVE_CONFIG_H */ +@@ -52,371 +51,384 @@ + + typedef struct { + +- unsigned int n; +- double *xs; +- double *difs; +- double mean; +- double nsig2; +- double err_term; ++ unsigned int n; ++ double *xs; ++ double *difs; ++ double mean; ++ double nsig2; ++ double err_term; + + } x_set; + +-#define LINREG_SEQ( TYPE ) typedef struct { \ +- REGION **regs; \ +- TYPE **ptrs; \ +- size_t *skips; \ +-} linreg_seq_ ## TYPE +- +-LINREG_SEQ( gint8 ); +-LINREG_SEQ( guint8 ); +-LINREG_SEQ( gint16 ); +-LINREG_SEQ( guint16 ); +-LINREG_SEQ( gint32 ); +-LINREG_SEQ( guint32 ); +-LINREG_SEQ( float ); +-LINREG_SEQ( double ); +- +-static x_set *x_anal( IMAGE *im, double *xs, unsigned int n ); +- +-#define LINREG_START_DECL( TYPE ) static void * linreg_start_ ## TYPE( IMAGE *, void *, void * ); +-#define LINREG_GEN_DECL( TYPE ) static int linreg_gen_ ## TYPE( REGION *, void *, void *, void * ); +-#define LINREG_STOP_DECL( TYPE ) static int linreg_stop_ ## TYPE( void *, void *, void * ); +-#define INCR_ALL_DECL( TYPE ) static void incr_all_ ## TYPE( TYPE **ptrs, unsigned int n ) +-#define SKIP_ALL_DECL( TYPE ) static void skip_all_ ## TYPE( TYPE **ptrs, size_t *skips, unsigned int n ) +- +-LINREG_START_DECL( gint8 ); +-LINREG_START_DECL( guint8 ); +-LINREG_START_DECL( gint16 ); +-LINREG_START_DECL( guint16 ); +-LINREG_START_DECL( gint32 ); +-LINREG_START_DECL( guint32 ); +-LINREG_START_DECL( float ); +-LINREG_START_DECL( double ); +- +-LINREG_GEN_DECL( gint8 ); +-LINREG_GEN_DECL( guint8 ); +-LINREG_GEN_DECL( gint16 ); +-LINREG_GEN_DECL( guint16 ); +-LINREG_GEN_DECL( gint32 ); +-LINREG_GEN_DECL( guint32 ); +-LINREG_GEN_DECL( float ); +-LINREG_GEN_DECL( double ); +- +-LINREG_STOP_DECL( gint8 ); +-LINREG_STOP_DECL( guint8 ); +-LINREG_STOP_DECL( gint16 ); +-LINREG_STOP_DECL( guint16 ); +-LINREG_STOP_DECL( gint32 ); +-LINREG_STOP_DECL( guint32 ); +-LINREG_STOP_DECL( float ); +-LINREG_STOP_DECL( double ); +- +-INCR_ALL_DECL( gint8 ); +-INCR_ALL_DECL( guint8 ); +-INCR_ALL_DECL( gint16 ); +-INCR_ALL_DECL( guint16 ); +-INCR_ALL_DECL( gint32 ); +-INCR_ALL_DECL( guint32 ); +-INCR_ALL_DECL( float ); +-INCR_ALL_DECL( double ); +- +-SKIP_ALL_DECL( gint8 ); +-SKIP_ALL_DECL( guint8 ); +-SKIP_ALL_DECL( gint16 ); +-SKIP_ALL_DECL( guint16 ); +-SKIP_ALL_DECL( gint32 ); +-SKIP_ALL_DECL( guint32 ); +-SKIP_ALL_DECL( float ); +-SKIP_ALL_DECL( double ); +- +- +-/** ++#define LINREG_SEQ(TYPE) \ ++ typedef struct { \ ++ REGION **regs; \ ++ TYPE **ptrs; \ ++ size_t *skips; \ ++ } linreg_seq_##TYPE ++ ++LINREG_SEQ(gint8); ++LINREG_SEQ(guint8); ++LINREG_SEQ(gint16); ++LINREG_SEQ(guint16); ++LINREG_SEQ(gint32); ++LINREG_SEQ(guint32); ++LINREG_SEQ(float); ++LINREG_SEQ(double); ++ ++static x_set *x_anal(IMAGE *im, double *xs, unsigned int n); ++ ++#define LINREG_START_DECL(TYPE) static void *linreg_start_##TYPE(IMAGE *, void *, void *); ++#define LINREG_GEN_DECL(TYPE) static int linreg_gen_##TYPE(REGION *, void *, void *, void *); ++#define LINREG_STOP_DECL(TYPE) static int linreg_stop_##TYPE(void *, void *, void *); ++#define INCR_ALL_DECL(TYPE) static void incr_all_##TYPE(TYPE **ptrs, unsigned int n) ++#define SKIP_ALL_DECL(TYPE) static void skip_all_##TYPE(TYPE **ptrs, size_t *skips, unsigned int n) ++ ++LINREG_START_DECL(gint8); ++LINREG_START_DECL(guint8); ++LINREG_START_DECL(gint16); ++LINREG_START_DECL(guint16); ++LINREG_START_DECL(gint32); ++LINREG_START_DECL(guint32); ++LINREG_START_DECL(float); ++LINREG_START_DECL(double); ++ ++LINREG_GEN_DECL(gint8); ++LINREG_GEN_DECL(guint8); ++LINREG_GEN_DECL(gint16); ++LINREG_GEN_DECL(guint16); ++LINREG_GEN_DECL(gint32); ++LINREG_GEN_DECL(guint32); ++LINREG_GEN_DECL(float); ++LINREG_GEN_DECL(double); ++ ++LINREG_STOP_DECL(gint8); ++LINREG_STOP_DECL(guint8); ++LINREG_STOP_DECL(gint16); ++LINREG_STOP_DECL(guint16); ++LINREG_STOP_DECL(gint32); ++LINREG_STOP_DECL(guint32); ++LINREG_STOP_DECL(float); ++LINREG_STOP_DECL(double); ++ ++INCR_ALL_DECL(gint8); ++INCR_ALL_DECL(guint8); ++INCR_ALL_DECL(gint16); ++INCR_ALL_DECL(guint16); ++INCR_ALL_DECL(gint32); ++INCR_ALL_DECL(guint32); ++INCR_ALL_DECL(float); ++INCR_ALL_DECL(double); ++ ++SKIP_ALL_DECL(gint8); ++SKIP_ALL_DECL(guint8); ++SKIP_ALL_DECL(gint16); ++SKIP_ALL_DECL(guint16); ++SKIP_ALL_DECL(gint32); ++SKIP_ALL_DECL(guint32); ++SKIP_ALL_DECL(float); ++SKIP_ALL_DECL(double); ++ ++/** + * im_linreg: + * @ins: NULL-terminated array of input images + * @out: results of analysis + * @xs: X position of each image (pixel value is Y) + * +- * Function to find perform pixelwise linear regression on an array of ++ * Function to find perform pixelwise linear regression on an array of + * single band images. The output is a seven-band douuble image + * + * TODO: figure out how this works and fix up these docs! + */ +-int im_linreg( IMAGE **ins, IMAGE *out, double *xs ){ ++int ++im_linreg(IMAGE **ins, IMAGE *out, double *xs) ++{ + #define FUNCTION_NAME "im_linreg" +- int n; +- x_set *x_vals; +- +- if( im_poutcheck( out ) ) +- return( -1 ); +- +- for( n= 0; ins[ n ]; ++n ){ +-/* +- if( ! isfinite( xs[ n ] ) ){ +- im_error( FUNCTION_NAME, "invalid argument" ); +- return( -1 ); +- } +-*/ +- if( im_pincheck( ins[ n ] ) ) +- return( -1 ); +- +- if( 1 != ins[ n ]-> Bands ){ +- im_error( FUNCTION_NAME, "image is not single band" ); +- return( -1 ); +- } +- if( ins[ n ]-> Coding ){ +- im_error( FUNCTION_NAME, "image is not uncoded" ); +- return( -1 ); +- } +- if( n ){ +- if( ins[ n ]-> BandFmt != ins[ 0 ]-> BandFmt ){ +- im_error( FUNCTION_NAME, "image band formats differ" ); +- return( -1 ); +- } +- } +- else { +- if( vips_band_format_iscomplex( ins[ 0 ]->BandFmt ) ){ +- im_error( FUNCTION_NAME, "image has non-scalar band format" ); +- return( -1 ); +- } +- } +- if( n && ( ins[ n ]-> Xsize != ins[ 0 ]-> Xsize +- || ins[ n ]-> Ysize != ins[ 0 ]-> Ysize ) ){ +- +- im_error( FUNCTION_NAME, "image sizes differ" ); +- return( -1 ); +- } +- } +- if( n < 3 ){ +- im_error( FUNCTION_NAME, "not enough input images" ); +- return( -1 ); +- } +- if( im_cp_desc_array( out, ins ) ) +- return( -1 ); +- +- out-> Bands= 7; +- out-> BandFmt= IM_BANDFMT_DOUBLE; +- out-> Type= 0; +- +- if( im_demand_hint_array( out, IM_THINSTRIP, ins ) ) +- return( -1 ); +- +- x_vals= x_anal( out, xs, n ); +- +- if( ! x_vals ) +- return( -1 ); +- +- switch( ins[ 0 ]-> BandFmt ){ +-#define LINREG_RET( TYPE ) return im_generate( out, linreg_start_ ## TYPE, linreg_gen_ ## TYPE, linreg_stop_ ## TYPE, ins, x_vals ) +- +- case IM_BANDFMT_CHAR: +- LINREG_RET( gint8 ); +- +- case IM_BANDFMT_UCHAR: +- LINREG_RET( guint8 ); +- +- case IM_BANDFMT_SHORT: +- LINREG_RET( gint16 ); +- +- case IM_BANDFMT_USHORT: +- LINREG_RET( guint16 ); +- +- case IM_BANDFMT_INT: +- LINREG_RET( gint32 ); +- +- case IM_BANDFMT_UINT: +- LINREG_RET( guint32 ); +- +- case IM_BANDFMT_FLOAT: +- LINREG_RET( float ); +- +- case IM_BANDFMT_DOUBLE: +- LINREG_RET( double ); +- +- default: /* keep -Wall happy */ +- return( -1 ); +- } ++ int n; ++ x_set *x_vals; ++ ++ if (im_poutcheck(out)) ++ return (-1); ++ ++ for (n = 0; ins[n]; ++n) { ++ /* ++ if( ! isfinite( xs[ n ] ) ){ ++ im_error( FUNCTION_NAME, "invalid argument" ); ++ return( -1 ); ++ } ++ */ ++ if (im_pincheck(ins[n])) ++ return (-1); ++ ++ if (1 != ins[n]->Bands) { ++ im_error(FUNCTION_NAME, "image is not single band"); ++ return (-1); ++ } ++ if (ins[n]->Coding) { ++ im_error(FUNCTION_NAME, "image is not uncoded"); ++ return (-1); ++ } ++ if (n) { ++ if (ins[n]->BandFmt != ins[0]->BandFmt) { ++ im_error(FUNCTION_NAME, "image band formats differ"); ++ return (-1); ++ } ++ } ++ else { ++ if (vips_band_format_iscomplex(ins[0]->BandFmt)) { ++ im_error(FUNCTION_NAME, "image has non-scalar band format"); ++ return (-1); ++ } ++ } ++ if (n && (ins[n]->Xsize != ins[0]->Xsize || ins[n]->Ysize != ins[0]->Ysize)) { ++ ++ im_error(FUNCTION_NAME, "image sizes differ"); ++ return (-1); ++ } ++ } ++ if (n < 3) { ++ im_error(FUNCTION_NAME, "not enough input images"); ++ return (-1); ++ } ++ if (im_cp_desc_array(out, ins)) ++ return (-1); ++ ++ out->Bands = 7; ++ out->BandFmt = IM_BANDFMT_DOUBLE; ++ out->Type = 0; ++ ++ if (im_demand_hint_array(out, IM_THINSTRIP, ins)) ++ return (-1); ++ ++ x_vals = x_anal(out, xs, n); ++ ++ if (!x_vals) ++ return (-1); ++ ++ switch (ins[0]->BandFmt) { ++#define LINREG_RET(TYPE) return im_generate(out, linreg_start_##TYPE, linreg_gen_##TYPE, linreg_stop_##TYPE, ins, x_vals) ++ ++ case IM_BANDFMT_CHAR: ++ LINREG_RET(gint8); ++ ++ case IM_BANDFMT_UCHAR: ++ LINREG_RET(guint8); ++ ++ case IM_BANDFMT_SHORT: ++ LINREG_RET(gint16); ++ ++ case IM_BANDFMT_USHORT: ++ LINREG_RET(guint16); ++ ++ case IM_BANDFMT_INT: ++ LINREG_RET(gint32); ++ ++ case IM_BANDFMT_UINT: ++ LINREG_RET(guint32); ++ ++ case IM_BANDFMT_FLOAT: ++ LINREG_RET(float); ++ ++ case IM_BANDFMT_DOUBLE: ++ LINREG_RET(double); ++ ++ default: /* keep -Wall happy */ ++ return (-1); ++ } + #undef FUNCTION_NAME + } + +-static x_set *x_anal( IMAGE *im, double *xs, unsigned int n ){ +- unsigned int i; +- +- x_set *x_vals= IM_NEW( im, x_set ); +- +- if( ! x_vals ) +- return( NULL ); +- +- x_vals-> xs= IM_ARRAY( im, 2 * n, double ); ++static x_set * ++x_anal(IMAGE *im, double *xs, unsigned int n) ++{ ++ unsigned int i; + +- if( ! x_vals-> xs ) +- return( NULL ); ++ x_set *x_vals = IM_NEW(im, x_set); + +- x_vals-> difs= x_vals-> xs + n; +- x_vals-> n= n; +- x_vals-> mean= 0.0; ++ if (!x_vals) ++ return (NULL); + +- for( i= 0; i < n; ++i ){ +- x_vals-> xs[ i ]= xs[ i ]; +- x_vals-> mean+= xs[ i ]; +- } +- x_vals-> mean/= n; +- x_vals-> nsig2= 0.0; ++ x_vals->xs = IM_ARRAY(im, 2 * n, double); + +- for( i= 0; i < n; ++i ){ +- x_vals-> difs[ i ]= xs[ i ] - x_vals-> mean; +- x_vals-> nsig2+= x_vals-> difs[ i ] * x_vals-> difs[ i ]; +- } +- x_vals-> err_term= ( 1.0 / (double) n ) + ( ( x_vals-> mean * x_vals-> mean ) / x_vals-> nsig2 ); ++ if (!x_vals->xs) ++ return (NULL); + +- return( x_vals ); +-} +- +-#define LINREG_START_DEFN( TYPE ) static void *linreg_start_ ## TYPE( IMAGE *out, void *a, void *b ){ \ +- IMAGE **ins= (IMAGE **) a; \ +- x_set *x_vals= (x_set *) b; \ +- linreg_seq_ ## TYPE *seq= IM_NEW( out, linreg_seq_ ## TYPE ); \ +- \ +- if( ! seq ) \ +- return NULL; \ +- \ +- seq-> regs= im_start_many( NULL, ins, NULL ); \ +- seq-> ptrs= IM_ARRAY( out, x_vals-> n, TYPE* ); \ +- seq-> skips= IM_ARRAY( out, x_vals-> n, size_t ); \ +- \ +- if( ! seq-> ptrs || ! seq-> regs || ! seq-> skips ){ \ +- linreg_stop_ ## TYPE( seq, NULL, NULL ); \ +- return NULL; \ +- } \ +- return (void *) seq; \ +-} ++ x_vals->difs = x_vals->xs + n; ++ x_vals->n = n; ++ x_vals->mean = 0.0; + +-#define N ( (double) n ) +-#define y(a) ( (double) (* seq-> ptrs[(a)] ) ) +-#define x(a) ( (double) ( x_vals-> xs[(a)] ) ) +-#define xd(a) ( (double) ( x_vals-> difs[(a)] ) ) +-#define Sxd2 ( x_vals-> nsig2 ) +-#define mean_x ( x_vals-> mean ) +-#define mean_y ( out[0] ) +-#define dev_y ( out[1] ) +-#define y_x0 ( out[2] ) +-#define d_y_x0 ( out[3] ) +-#define dy_dx ( out[4] ) +-#define d_dy_dx ( out[5] ) +-#define R ( out[6] ) +- +-#define LINREG_GEN_DEFN( TYPE ) static int linreg_gen_ ## TYPE( REGION *to_make, void *vseq, void *unrequired, void *b ){ \ +- linreg_seq_ ## TYPE *seq= (linreg_seq_ ## TYPE *) vseq; \ +- x_set *x_vals= (x_set *) b; \ +- unsigned int n= x_vals-> n; \ +- double *out= (double*) IM_REGION_ADDR_TOPLEFT( to_make ); \ +- size_t out_skip= IM_REGION_LSKIP( to_make ) / sizeof( double ); \ +- double *out_end= out + out_skip * to_make-> valid. height; \ +- double *out_stop; \ +- size_t out_n= IM_REGION_N_ELEMENTS( to_make ); \ +- unsigned int i; \ +- \ +- out_skip-= out_n; \ +- \ +- if( im_prepare_many( seq-> regs, & to_make-> valid ) ) \ +- return -1; \ +- \ +- for( i= 0; i < n; ++i ){ \ +- seq-> ptrs[ i ]= (TYPE*) IM_REGION_ADDR( seq-> regs[ i ], to_make-> valid. left, to_make-> valid. top ); \ +- seq-> skips[ i ]= ( IM_REGION_LSKIP( seq-> regs[ i ] ) / sizeof( TYPE ) ) - IM_REGION_N_ELEMENTS( seq-> regs[ i ] ); \ +- } \ +- \ +- for( ; out < out_end; out+= out_skip, skip_all_ ## TYPE( seq-> ptrs, seq-> skips, n ) ) \ +- for( out_stop= out + out_n; out < out_stop; out+= 7, incr_all_ ## TYPE( seq-> ptrs, n ) ){ \ +- double Sy= 0.0; \ +- double Sxd_y= 0.0; \ +- double Syd2= 0.0; \ +- double Sxd_yd= 0.0; \ +- double Se2= 0.0; \ +- \ +- for( i= 0; i < n; ++i ){ \ +- Sy+= y(i); \ +- Sxd_y+= xd(i) * y(i); \ +- } \ +- mean_y= Sy / N; \ +- dy_dx= Sxd_y / Sxd2; \ +- y_x0= mean_y - dy_dx * mean_x; \ +- \ +- for( i= 0; i < n; ++i ){ \ +- double yd= y(i) - mean_y; \ +- double e= y(i) - dy_dx * x(i) - y_x0; \ +- Syd2+= yd * yd; \ +- Sxd_yd+= xd(i) * yd; \ +- Se2+= e * e; \ +- } \ +- dev_y= sqrt( Syd2 / N ); \ +- Se2/= ( N - 2.0 ); \ +- d_dy_dx= sqrt( Se2 / Sxd2 ); \ +- d_y_x0= sqrt( Se2 * x_vals-> err_term ); \ +- R= Sxd_yd / sqrt( Sxd2 * Syd2 ); \ +- } \ +- return 0; \ +-} ++ for (i = 0; i < n; ++i) { ++ x_vals->xs[i] = xs[i]; ++ x_vals->mean += xs[i]; ++ } ++ x_vals->mean /= n; ++ x_vals->nsig2 = 0.0; + +-#define LINREG_STOP_DEFN( TYPE ) static int linreg_stop_ ## TYPE( void *vseq, void *a, void *b ){ \ +- linreg_seq_ ## TYPE *seq = (linreg_seq_ ## TYPE *) vseq; \ +- if( seq-> regs ) \ +- im_stop_many( seq-> regs, NULL, NULL ); \ +- return 0; \ +-} +- +-#define INCR_ALL_DEFN( TYPE ) static void incr_all_ ## TYPE( TYPE **ptrs, unsigned int n ){ \ +- TYPE **stop= ptrs + n; \ +- for( ; ptrs < stop; ++ptrs ) \ +- ++*ptrs; \ +-} ++ for (i = 0; i < n; ++i) { ++ x_vals->difs[i] = xs[i] - x_vals->mean; ++ x_vals->nsig2 += x_vals->difs[i] * x_vals->difs[i]; ++ } ++ x_vals->err_term = (1.0 / (double) n) + ((x_vals->mean * x_vals->mean) / x_vals->nsig2); + +-#define SKIP_ALL_DEFN( TYPE ) static void skip_all_ ## TYPE( TYPE **ptrs, size_t *skips, unsigned int n ){ \ +- TYPE **stop= ptrs + n; \ +- for( ; ptrs < stop; ++ptrs, ++skips ) \ +- *ptrs+= *skips; \ ++ return (x_vals); + } + +-LINREG_START_DEFN( gint8 ); +-LINREG_START_DEFN( guint8 ); +-LINREG_START_DEFN( gint16 ); +-LINREG_START_DEFN( guint16 ); +-LINREG_START_DEFN( gint32 ); +-LINREG_START_DEFN( guint32 ); +-LINREG_START_DEFN( float ); +-LINREG_START_DEFN( double ); +- +-LINREG_GEN_DEFN( gint8 ); +-LINREG_GEN_DEFN( guint8 ); +-LINREG_GEN_DEFN( gint16 ); +-LINREG_GEN_DEFN( guint16 ); +-LINREG_GEN_DEFN( gint32 ); +-LINREG_GEN_DEFN( guint32 ); +-LINREG_GEN_DEFN( float ); +-LINREG_GEN_DEFN( double ); +- +-LINREG_STOP_DEFN( gint8 ); +-LINREG_STOP_DEFN( guint8 ); +-LINREG_STOP_DEFN( gint16 ); +-LINREG_STOP_DEFN( guint16 ); +-LINREG_STOP_DEFN( gint32 ); +-LINREG_STOP_DEFN( guint32 ); +-LINREG_STOP_DEFN( float ); +-LINREG_STOP_DEFN( double ); +- +-INCR_ALL_DEFN( gint8 ); +-INCR_ALL_DEFN( guint8 ); +-INCR_ALL_DEFN( gint16 ); +-INCR_ALL_DEFN( guint16 ); +-INCR_ALL_DEFN( gint32 ); +-INCR_ALL_DEFN( guint32 ); +-INCR_ALL_DEFN( float ); +-INCR_ALL_DEFN( double ); +- +-SKIP_ALL_DEFN( gint8 ); +-SKIP_ALL_DEFN( guint8 ); +-SKIP_ALL_DEFN( gint16 ); +-SKIP_ALL_DEFN( guint16 ); +-SKIP_ALL_DEFN( gint32 ); +-SKIP_ALL_DEFN( guint32 ); +-SKIP_ALL_DEFN( float ); +-SKIP_ALL_DEFN( double ); ++#define LINREG_START_DEFN(TYPE) \ ++ static void *linreg_start_##TYPE(IMAGE *out, void *a, void *b) \ ++ { \ ++ IMAGE **ins = (IMAGE **) a; \ ++ x_set *x_vals = (x_set *) b; \ ++ linreg_seq_##TYPE *seq = IM_NEW(out, linreg_seq_##TYPE); \ ++\ ++ if (!seq) \ ++ return NULL; \ ++\ ++ seq->regs = im_start_many(NULL, ins, NULL); \ ++ seq->ptrs = IM_ARRAY(out, x_vals->n, TYPE *); \ ++ seq->skips = IM_ARRAY(out, x_vals->n, size_t); \ ++\ ++ if (!seq->ptrs || !seq->regs || !seq->skips) { \ ++ linreg_stop_##TYPE(seq, NULL, NULL); \ ++ return NULL; \ ++ } \ ++ return (void *) seq; \ ++ } ++ ++#define N ((double) n) ++#define y(a) ((double) (*seq->ptrs[(a)])) ++#define x(a) ((double) (x_vals->xs[(a)])) ++#define xd(a) ((double) (x_vals->difs[(a)])) ++#define Sxd2 (x_vals->nsig2) ++#define mean_x (x_vals->mean) ++#define mean_y (out[0]) ++#define dev_y (out[1]) ++#define y_x0 (out[2]) ++#define d_y_x0 (out[3]) ++#define dy_dx (out[4]) ++#define d_dy_dx (out[5]) ++#define R (out[6]) ++ ++#define LINREG_GEN_DEFN(TYPE) \ ++ static int linreg_gen_##TYPE(REGION *to_make, void *vseq, void *unrequired, void *b) \ ++ { \ ++ linreg_seq_##TYPE *seq = (linreg_seq_##TYPE *) vseq; \ ++ x_set *x_vals = (x_set *) b; \ ++ unsigned int n = x_vals->n; \ ++ double *out = (double *) IM_REGION_ADDR_TOPLEFT(to_make); \ ++ size_t out_skip = IM_REGION_LSKIP(to_make) / sizeof(double); \ ++ double *out_end = out + out_skip * to_make->valid.height; \ ++ double *out_stop; \ ++ size_t out_n = IM_REGION_N_ELEMENTS(to_make); \ ++ unsigned int i; \ ++\ ++ out_skip -= out_n; \ ++\ ++ if (im_prepare_many(seq->regs, &to_make->valid)) \ ++ return -1; \ ++\ ++ for (i = 0; i < n; ++i) { \ ++ seq->ptrs[i] = (TYPE *) IM_REGION_ADDR(seq->regs[i], to_make->valid.left, to_make->valid.top); \ ++ seq->skips[i] = (IM_REGION_LSKIP(seq->regs[i]) / sizeof(TYPE)) - IM_REGION_N_ELEMENTS(seq->regs[i]); \ ++ } \ ++\ ++ for (; out < out_end; out += out_skip, skip_all_##TYPE(seq->ptrs, seq->skips, n)) \ ++ for (out_stop = out + out_n; out < out_stop; out += 7, incr_all_##TYPE(seq->ptrs, n)) { \ ++ double Sy = 0.0; \ ++ double Sxd_y = 0.0; \ ++ double Syd2 = 0.0; \ ++ double Sxd_yd = 0.0; \ ++ double Se2 = 0.0; \ ++\ ++ for (i = 0; i < n; ++i) { \ ++ Sy += y(i); \ ++ Sxd_y += xd(i) * y(i); \ ++ } \ ++ mean_y = Sy / N; \ ++ dy_dx = Sxd_y / Sxd2; \ ++ y_x0 = mean_y - dy_dx * mean_x; \ ++\ ++ for (i = 0; i < n; ++i) { \ ++ double yd = y(i) - mean_y; \ ++ double e = y(i) - dy_dx * x(i) - y_x0; \ ++ Syd2 += yd * yd; \ ++ Sxd_yd += xd(i) * yd; \ ++ Se2 += e * e; \ ++ } \ ++ dev_y = sqrt(Syd2 / N); \ ++ Se2 /= (N - 2.0); \ ++ d_dy_dx = sqrt(Se2 / Sxd2); \ ++ d_y_x0 = sqrt(Se2 * x_vals->err_term); \ ++ R = Sxd_yd / sqrt(Sxd2 * Syd2); \ ++ } \ ++ return 0; \ ++ } ++ ++#define LINREG_STOP_DEFN(TYPE) \ ++ static int linreg_stop_##TYPE(void *vseq, void *a, void *b) \ ++ { \ ++ linreg_seq_##TYPE *seq = (linreg_seq_##TYPE *) vseq; \ ++ if (seq->regs) \ ++ im_stop_many(seq->regs, NULL, NULL); \ ++ return 0; \ ++ } ++ ++#define INCR_ALL_DEFN(TYPE) \ ++ static void incr_all_##TYPE(TYPE **ptrs, unsigned int n) \ ++ { \ ++ TYPE **stop = ptrs + n; \ ++ for (; ptrs < stop; ++ptrs) \ ++ ++*ptrs; \ ++ } ++ ++#define SKIP_ALL_DEFN(TYPE) \ ++ static void skip_all_##TYPE(TYPE **ptrs, size_t *skips, unsigned int n) \ ++ { \ ++ TYPE **stop = ptrs + n; \ ++ for (; ptrs < stop; ++ptrs, ++skips) \ ++ *ptrs += *skips; \ ++ } ++ ++LINREG_START_DEFN(gint8); ++LINREG_START_DEFN(guint8); ++LINREG_START_DEFN(gint16); ++LINREG_START_DEFN(guint16); ++LINREG_START_DEFN(gint32); ++LINREG_START_DEFN(guint32); ++LINREG_START_DEFN(float); ++LINREG_START_DEFN(double); ++ ++LINREG_GEN_DEFN(gint8); ++LINREG_GEN_DEFN(guint8); ++LINREG_GEN_DEFN(gint16); ++LINREG_GEN_DEFN(guint16); ++LINREG_GEN_DEFN(gint32); ++LINREG_GEN_DEFN(guint32); ++LINREG_GEN_DEFN(float); ++LINREG_GEN_DEFN(double); ++ ++LINREG_STOP_DEFN(gint8); ++LINREG_STOP_DEFN(guint8); ++LINREG_STOP_DEFN(gint16); ++LINREG_STOP_DEFN(guint16); ++LINREG_STOP_DEFN(gint32); ++LINREG_STOP_DEFN(guint32); ++LINREG_STOP_DEFN(float); ++LINREG_STOP_DEFN(double); ++ ++INCR_ALL_DEFN(gint8); ++INCR_ALL_DEFN(guint8); ++INCR_ALL_DEFN(gint16); ++INCR_ALL_DEFN(guint16); ++INCR_ALL_DEFN(gint32); ++INCR_ALL_DEFN(guint32); ++INCR_ALL_DEFN(float); ++INCR_ALL_DEFN(double); ++ ++SKIP_ALL_DEFN(gint8); ++SKIP_ALL_DEFN(guint8); ++SKIP_ALL_DEFN(gint16); ++SKIP_ALL_DEFN(guint16); ++SKIP_ALL_DEFN(gint32); ++SKIP_ALL_DEFN(guint32); ++SKIP_ALL_DEFN(float); ++SKIP_ALL_DEFN(double); +diff --git a/libvips/deprecated/im_litecor.c b/libvips/deprecated/im_litecor.c +index b0af4368d3..ea5e35c455 100644 +--- a/libvips/deprecated/im_litecor.c ++++ b/libvips/deprecated/im_litecor.c +@@ -1,4 +1,4 @@ +-/* @(#) Function to perform lighting correction. ++/* @(#) Function to perform lighting correction. + * @(#) One band IM_BANDFMT_UCHAR images only. Always writes UCHAR. + * @(#) + * @(#) Function im_litecor() assumes that imin +@@ -9,7 +9,7 @@ + * @(#) int clip; + * @(#) double factor; + * @(#) +- * @(#) clip==1 ++ * @(#) clip==1 + * @(#) - Compute max(white)*factor*(image/white), Clip to 255. + * @(#) clip==0 + * @(#) - Compute factor for you. +@@ -32,28 +32,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -73,8 +73,9 @@ + * If maximum output is < 255 do the light correction without scaling + */ + static int +-im_litecor0( IMAGE *in, IMAGE *white, IMAGE *out ) +-{ PEL *p, *w; ++im_litecor0(IMAGE *in, IMAGE *white, IMAGE *out) ++{ ++ PEL *p, *w; + PEL *q, *bu; + int c; + int x, y; +@@ -85,56 +86,56 @@ im_litecor0( IMAGE *in, IMAGE *white, IMAGE *out ) + double max; + int wtmp, maxw, maxout, temp; + +- /* Check white is some simple multiple of image. ++ /* Check white is some simple multiple of image. + */ +- if( xrat < 1.0 || xrat != xstep || yrat < 1.0 || yrat != ystep ) { +- im_error( "im_litecor", "white not simple scale of image" ); +- return( -1 ); ++ if (xrat < 1.0 || xrat != xstep || yrat < 1.0 || yrat != ystep) { ++ im_error("im_litecor", "white not simple scale of image"); ++ return (-1); + } + +- /* Find the maximum of the white. ++ /* Find the maximum of the white. + */ +- if( im_max( white, &max ) ) +- return( -1 ); +- maxw = (int)max; ++ if (im_max(white, &max)) ++ return (-1); ++ maxw = (int) max; + +- /* Set up the output header. ++ /* Set up the output header. + */ +- if( im_cp_desc( out, in ) ) +- return( -1 ); +- if( im_setupout( out ) ) +- return( -1 ); ++ if (im_cp_desc(out, in)) ++ return (-1); ++ if (im_setupout(out)) ++ return (-1); + +- /* Make buffer for outputting to. ++ /* Make buffer for outputting to. + */ +- if( !(bu = (PEL *) im_malloc( out, out->Xsize )) ) +- return( -1 ); ++ if (!(bu = (PEL *) im_malloc(out, out->Xsize))) ++ return (-1); + + /* Find largest value we might generate if factor == 1.0 + */ + maxout = -1; + p = (PEL *) in->data; +- for( y = 0; y < in->Ysize; y++ ) { ++ for (y = 0; y < in->Ysize; y++) { + /* Point w to the start of the line in the white + * corresponding to the line we are about to correct. c counts + * up to xstep; each time it wraps, we should move w on one. + */ +- w = (PEL *) (white->data + white->Xsize * (int)(y/ystep)); ++ w = (PEL *) (white->data + white->Xsize * (int) (y / ystep)); + c = 0; + +- /* Scan along line. ++ /* Scan along line. + */ +- for( x = 0; x < out->Xsize; x++ ) { +- wtmp = (int)*w; +- temp = ( maxw * (int) *p++ + (wtmp>>1) ) / wtmp; +- if (temp > maxout ) ++ for (x = 0; x < out->Xsize; x++) { ++ wtmp = (int) *w; ++ temp = (maxw * (int) *p++ + (wtmp >> 1)) / wtmp; ++ if (temp > maxout) + maxout = temp; + + /* Move white pointer on if necessary. */ + c++; +- if( c == xstep ) { +- w++; +- c = 0; ++ if (c == xstep) { ++ w++; ++ c = 0; + } + } + } +@@ -143,69 +144,68 @@ im_litecor0( IMAGE *in, IMAGE *white, IMAGE *out ) + * maxout + */ + p = (PEL *) in->data; +- if (maxout <= 255 ) /* no need for rescaling output */ +- { +- for( y = 0; y < in->Ysize; y++ ) +- { ++ if (maxout <= 255) /* no need for rescaling output */ ++ { ++ for (y = 0; y < in->Ysize; y++) { + q = bu; +- w = (PEL *) (white->data + +- white->Xsize * (int)(y/ystep)); ++ w = (PEL *) (white->data + ++ white->Xsize * (int) (y / ystep)); + c = 0; + + /* Scan along line. */ +- for( x = 0; x < in->Xsize; x++ ) +- { +- wtmp = (int)*w; +- *q++ = (PEL) +- ( ( maxw * (int) *p++ + (wtmp>>1) ) / wtmp ); ++ for (x = 0; x < in->Xsize; x++) { ++ wtmp = (int) *w; ++ *q++ = (PEL) ((maxw * (int) *p++ + (wtmp >> 1)) / wtmp); + /* Move white pointer on if necessary. + */ + c++; +- if( c == xstep ) { w++; c = 0; } ++ if (c == xstep) { ++ w++; ++ c = 0; + } +- if( im_writeline( y, out, bu ) ) +- { ++ } ++ if (im_writeline(y, out, bu)) { + im_error("im_litecor", "im_writeline failed"); +- return( -1 ); +- } ++ return (-1); + } + } +- else /* rescale output wrt maxout */ +- { +- for( y = 0; y < in->Ysize; y++ ) +- { ++ } ++ else /* rescale output wrt maxout */ ++ { ++ for (y = 0; y < in->Ysize; y++) { + q = bu; +- w = (PEL *) (white->data + +- white->Xsize * (int)(y/ystep)); ++ w = (PEL *) (white->data + ++ white->Xsize * (int) (y / ystep)); + c = 0; + + /* Scan along line. */ +- for( x = 0; x < in->Xsize; x++ ) +- { +- wtmp = maxout * ((int)*w); +- *q++ = (PEL) +- ( ( maxw * (int) *p++ * 255 + (wtmp>>1)) / wtmp ); ++ for (x = 0; x < in->Xsize; x++) { ++ wtmp = maxout * ((int) *w); ++ *q++ = (PEL) ((maxw * (int) *p++ * 255 + (wtmp >> 1)) / wtmp); + /* Move white pointer on if necessary. + */ + c++; +- if( c == xstep ) { w++; c = 0; } ++ if (c == xstep) { ++ w++; ++ c = 0; + } +- if( im_writeline( y, out, bu ) ) +- { ++ } ++ if (im_writeline(y, out, bu)) { + im_error("im_litecor", "im_writeline failed"); +- return( -1 ); +- } ++ return (-1); + } + } ++ } + +- return( 0 ); ++ return (0); + } + + /* Clip all corrected values above 255, if any. + */ + static int +-im_litecor1( IMAGE *in, IMAGE *white, IMAGE *out, double factor ) +-{ PEL *p, *w; ++im_litecor1(IMAGE *in, IMAGE *white, IMAGE *out, double factor) ++{ ++ PEL *p, *w; + PEL *q, *bu; + int c; + int x, y; +@@ -217,64 +217,64 @@ im_litecor1( IMAGE *in, IMAGE *white, IMAGE *out, double factor ) + double maxw, temp; + int nclipped = 0; + +- /* Check white is some simple multiple of image. ++ /* Check white is some simple multiple of image. + */ +- if( xrat < 1.0 || xrat != xstep || yrat < 1.0 || yrat != ystep ) { +- im_error( "im_litecor", "white not simple scale of image" ); +- return( -1 ); ++ if (xrat < 1.0 || xrat != xstep || yrat < 1.0 || yrat != ystep) { ++ im_error("im_litecor", "white not simple scale of image"); ++ return (-1); + } + +- /* Find the maximum of the white. ++ /* Find the maximum of the white. + */ +- if( im_max( white, &max ) ) +- return( -1 ); ++ if (im_max(white, &max)) ++ return (-1); + maxw = max; + +- /* Set up the output header. ++ /* Set up the output header. + */ +- if( im_cp_desc( out, in ) ) +- return( -1 ); +- if( im_setupout( out ) ) +- return( -1 ); ++ if (im_cp_desc(out, in)) ++ return (-1); ++ if (im_setupout(out)) ++ return (-1); + +- /* Make buffer we write to. ++ /* Make buffer we write to. + */ +- if( !(bu = (PEL *) im_malloc( out, out->Xsize )) ) +- return( -1 ); ++ if (!(bu = (PEL *) im_malloc(out, out->Xsize))) ++ return (-1); + +- /* Loop through sorting max output ++ /* Loop through sorting max output + */ + p = (PEL *) in->data; +- for( y = 0; y < in->Ysize; y++ ) { ++ for (y = 0; y < in->Ysize; y++) { + q = bu; +- w = (PEL *) (white->data + white->Xsize * (int)(y / ystep)); ++ w = (PEL *) (white->data + white->Xsize * (int) (y / ystep)); + c = 0; + +- for( x = 0; x < out->Xsize; x++ ) { +- temp = ((factor * maxw * (int) *p++)/((int) *w)) + 0.5; +- if( temp > 255.0 ) { +- temp = 255; +- nclipped++; ++ for (x = 0; x < out->Xsize; x++) { ++ temp = ((factor * maxw * (int) *p++) / ((int) *w)) + 0.5; ++ if (temp > 255.0) { ++ temp = 255; ++ nclipped++; + } + *q++ = temp; + + /* Move white pointer on if necessary. + */ + c++; +- if( c == xstep ) { +- w++; +- c = 0; ++ if (c == xstep) { ++ w++; ++ c = 0; + } + } + +- if( im_writeline( y, out, bu ) ) +- return( -1 ); ++ if (im_writeline(y, out, bu)) ++ return (-1); + } + +- if( nclipped ) +- im_warn( "im_litecor", "%d pels over 255 clipped", nclipped ); ++ if (nclipped) ++ im_warn("im_litecor", "%d pels over 255 clipped", nclipped); + +- return( 0 ); ++ return (0); + } + + /* Lighting correction. One band uchar images only. +@@ -283,31 +283,31 @@ im_litecor1( IMAGE *in, IMAGE *white, IMAGE *out, double factor ) + * parameters. + */ + int +-im_litecor( IMAGE *in, IMAGE *white, IMAGE *out, int clip, double factor ) +-{ /* Check our args. +- */ +- if( im_iocheck( in, out ) ) +- return( -1 ); +- if( in->Bands != 1 || +- in->Coding != IM_CODING_NONE || in->BandFmt != IM_BANDFMT_UCHAR ) { +- im_error( "im_litecor", "bad input format" ); +- return( -1 ); ++im_litecor(IMAGE *in, IMAGE *white, IMAGE *out, int clip, double factor) ++{ /* Check our args. ++ */ ++ if (im_iocheck(in, out)) ++ return (-1); ++ if (in->Bands != 1 || ++ in->Coding != IM_CODING_NONE || in->BandFmt != IM_BANDFMT_UCHAR) { ++ im_error("im_litecor", "bad input format"); ++ return (-1); + } +- if( white->Bands != 1 || +- white->Coding != IM_CODING_NONE || white->BandFmt != IM_BANDFMT_UCHAR ) { +- im_error( "im_litecor", "bad white format" ); +- return( -1 ); ++ if (white->Bands != 1 || ++ white->Coding != IM_CODING_NONE || white->BandFmt != IM_BANDFMT_UCHAR) { ++ im_error("im_litecor", "bad white format"); ++ return (-1); + } + +- switch( clip ) { ++ switch (clip) { + case 1: +- return( im_litecor1( in, white, out, factor ) ); +- +- case 0: +- return( im_litecor0( in, white, out ) ); ++ return (im_litecor1(in, white, out, factor)); ++ ++ case 0: ++ return (im_litecor0(in, white, out)); + + default: +- im_error( "im_litecor", "unknown flag %d", clip ); +- return( -1 ); ++ im_error("im_litecor", "unknown flag %d", clip); ++ return (-1); + } + } +diff --git a/libvips/deprecated/im_magick2vips.c b/libvips/deprecated/im_magick2vips.c +index 6eafd9e9da..18e28e1e86 100644 +--- a/libvips/deprecated/im_magick2vips.c ++++ b/libvips/deprecated/im_magick2vips.c +@@ -1,33 +1,33 @@ + /* Read a file using libMagick +- * ++ * + * 17/12/11 + * - just a stub + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -46,24 +46,24 @@ + #include "../foreign/pforeign.h" + + int +-im_magick2vips( const char *filename, IMAGE *out ) ++im_magick2vips(const char *filename, IMAGE *out) + { + #ifdef HAVE_MAGICK + /* Old behaviour was always to read all frames. + */ +- return( vips__magick_read( filename, out, NULL, 0, -1 ) ); ++ return (vips__magick_read(filename, out, NULL, 0, -1)); + #else +- vips_error( "im_magick2vips", +- "%s", _( "no libMagick support in your libvips" ) ); ++ vips_error("im_magick2vips", ++ "%s", _("no libMagick support in your libvips")); + +- return( -1 ); ++ return (-1); + #endif /*HAVE_MAGICK*/ + } + + static int +-ismagick( const char *filename ) ++ismagick(const char *filename) + { +- return( vips_foreign_is_a( "magickload", filename ) ); ++ return (vips_foreign_is_a("magickload", filename)); + } + + static const char *magick_suffs[] = { NULL }; +@@ -74,13 +74,13 @@ typedef VipsFormat VipsFormatMagick; + typedef VipsFormatClass VipsFormatMagickClass; + + static void +-vips_format_magick_class_init( VipsFormatMagickClass *class ) ++vips_format_magick_class_init(VipsFormatMagickClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsFormatClass *format_class = (VipsFormatClass *) class; + + object_class->nickname = "magick"; +- object_class->description = _( "libMagick-supported" ); ++ object_class->description = _("libMagick-supported"); + + format_class->is_a = ismagick; + format_class->load = im_magick2vips; +@@ -93,28 +93,28 @@ vips_format_magick_class_init( VipsFormatMagickClass *class ) + } + + static void +-vips_format_magick_init( VipsFormatMagick *object ) ++vips_format_magick_init(VipsFormatMagick *object) + { + } + +-G_DEFINE_TYPE( VipsFormatMagick, vips_format_magick, VIPS_TYPE_FORMAT ); ++G_DEFINE_TYPE(VipsFormatMagick, vips_format_magick, VIPS_TYPE_FORMAT); + + int +-im_bufmagick2vips( void *buf, size_t len, IMAGE *out, gboolean header_only ) ++im_bufmagick2vips(void *buf, size_t len, IMAGE *out, gboolean header_only) + { + VipsImage *t; + +- /* header_only is automatic ... this call will only decompress on ++ /* header_only is automatic ... this call will only decompress on + * pixel access. + */ + +- if( vips_magickload_buffer( buf, len, &t, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_magickload_buffer(buf, len, &t, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/deprecated/im_mask2vips.c b/libvips/deprecated/im_mask2vips.c +index b83095abd5..6ce42e16d8 100644 +--- a/libvips/deprecated/im_mask2vips.c ++++ b/libvips/deprecated/im_mask2vips.c +@@ -11,28 +11,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -59,64 +59,63 @@ + * Returns: 0 on success, -1 on error + */ + int +-im_mask2vips( DOUBLEMASK *in, IMAGE *out ) ++im_mask2vips(DOUBLEMASK *in, IMAGE *out) + { + int x, y; + double *buf, *p, *q; + + /* Check the mask. + */ +- if( !in || +- !in->coeff ) { +- im_error( "im_mask2vips", "%s", _( "bad input mask" ) ); +- return( -1 ); ++ if (!in || ++ !in->coeff) { ++ im_error("im_mask2vips", "%s", _("bad input mask")); ++ return (-1); + } + + /* Make the output image. + */ +- im_initdesc( out, in->xsize, in->ysize, 1, +- IM_BBITS_DOUBLE, IM_BANDFMT_DOUBLE, +- IM_CODING_NONE, +- IM_TYPE_B_W, +- 1.0, 1.0, +- 0, 0 ); +- if( im_setupout( out ) ) +- return( -1 ); ++ im_initdesc(out, in->xsize, in->ysize, 1, ++ IM_BBITS_DOUBLE, IM_BANDFMT_DOUBLE, ++ IM_CODING_NONE, ++ IM_TYPE_B_W, ++ 1.0, 1.0, ++ 0, 0); ++ if (im_setupout(out)) ++ return (-1); + + /* Make an output buffer. + */ +- if( !(buf = IM_ARRAY( out, in->xsize, double )) ) +- return( -1 ); ++ if (!(buf = IM_ARRAY(out, in->xsize, double))) ++ return (-1); + + /* Write! + */ +- for( p = in->coeff, y = 0; y < out->Ysize; y++ ) { ++ for (p = in->coeff, y = 0; y < out->Ysize; y++) { + q = buf; + +- for( x = 0; x < out->Xsize; x++ ) ++ for (x = 0; x < out->Xsize; x++) + *q++ = *p++; + +- if( im_writeline( y, out, (void *) buf ) ) +- return( -1 ); ++ if (im_writeline(y, out, (void *) buf)) ++ return (-1); + } + +- vips_image_set_double( out, "scale", in->scale ); +- vips_image_set_double( out, "offset", in->offset ); ++ vips_image_set_double(out, "scale", in->scale); ++ vips_image_set_double(out, "offset", in->offset); + +- return( 0 ); ++ return (0); + } + + int +-im_imask2vips( INTMASK *in, IMAGE *out ) ++im_imask2vips(INTMASK *in, IMAGE *out) + { + DOUBLEMASK *d; + int result; + +- if( !(d = im_imask2dmask( in, in->filename )) ) +- return( -1 ); +- result = im_mask2vips( d, out ); +- im_free_dmask( d ); ++ if (!(d = im_imask2dmask(in, in->filename))) ++ return (-1); ++ result = im_mask2vips(d, out); ++ im_free_dmask(d); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/deprecated/im_matcat.c b/libvips/deprecated/im_matcat.c +index 681ad3ff65..26d9bf6069 100644 +--- a/libvips/deprecated/im_matcat.c ++++ b/libvips/deprecated/im_matcat.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -58,7 +58,7 @@ + * Returns: the joined mask on success, or NULL on error. + */ + DOUBLEMASK * +-im_matcat( DOUBLEMASK *top, DOUBLEMASK *bottom, const char *filename ) ++im_matcat(DOUBLEMASK *top, DOUBLEMASK *bottom, const char *filename) + { + int newxsize, newysize; + DOUBLEMASK *mat; +@@ -66,10 +66,10 @@ im_matcat( DOUBLEMASK *top, DOUBLEMASK *bottom, const char *filename ) + + /* matrices must be same width + */ +- if( top->xsize != bottom->xsize ) { +- im_error( "im_matcat", "%s", +- _( "matrices must be same width" ) ); +- return( NULL ); ++ if (top->xsize != bottom->xsize) { ++ im_error("im_matcat", "%s", ++ _("matrices must be same width")); ++ return (NULL); + } + + newxsize = top->xsize; +@@ -77,16 +77,16 @@ im_matcat( DOUBLEMASK *top, DOUBLEMASK *bottom, const char *filename ) + + /* Allocate output matrix. + */ +- if( !(mat = im_create_dmask( filename, newxsize, newysize )) ) +- return( NULL ); ++ if (!(mat = im_create_dmask(filename, newxsize, newysize))) ++ return (NULL); + + /* copy first matrix then add second on the end + */ +- memcpy( mat->coeff, top->coeff, +- top->xsize * top->ysize * sizeof( double ) ); ++ memcpy(mat->coeff, top->coeff, ++ top->xsize * top->ysize * sizeof(double)); + out = mat->coeff + top->xsize * top->ysize; +- memcpy( out, bottom->coeff, +- bottom->xsize * bottom->ysize * sizeof( double ) ); ++ memcpy(out, bottom->coeff, ++ bottom->xsize * bottom->ysize * sizeof(double)); + +- return( mat ); ++ return (mat); + } +diff --git a/libvips/deprecated/im_matinv.c b/libvips/deprecated/im_matinv.c +index 8bf12340c5..13a6a042f8 100644 +--- a/libvips/deprecated/im_matinv.c ++++ b/libvips/deprecated/im_matinv.c +@@ -16,28 +16,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -54,24 +54,22 @@ + #include + #include + +-#define TOO_SMALL ( 2.0 * DBL_MIN ) ++#define TOO_SMALL (2.0 * DBL_MIN) + /* DBL_MIN is smallest *normalized* double precision float */ + +-#define MATRIX( mask, i, j ) ( (mask)-> coeff[ (j) + (i) * (mask)-> xsize ] ) ++#define MATRIX(mask, i, j) ((mask)->coeff[(j) + (i) * (mask)->xsize]) + /* use DOUBLEMASK or INTMASK as matrix type */ + +-static int ++static int + mat_inv_lu( +- DOUBLEMASK *inv, +- const DOUBLEMASK *lu +- ); ++ DOUBLEMASK *inv, ++ const DOUBLEMASK *lu); + +-static int +-mat_inv_direct( +- DOUBLEMASK *inv, +- const DOUBLEMASK *mat, +- const char *function_name +- ); ++static int ++mat_inv_direct( ++ DOUBLEMASK *inv, ++ const DOUBLEMASK *mat, ++ const char *function_name); + + /** + * im_lu_decomp: +@@ -83,17 +81,17 @@ mat_inv_direct( + * + * It calculates the PLU decomposition, storing the upper and diagonal parts + * of U, together with the lower parts of L, as an NxN matrix in the first +- * N rows of the new matrix. The diagonal parts of L are all set to unity +- * and are not stored. ++ * N rows of the new matrix. The diagonal parts of L are all set to unity ++ * and are not stored. + * +- * The final row of the new #DOUBLEMASK has only integer entries, which ++ * The final row of the new #DOUBLEMASK has only integer entries, which + * represent the row-wise permutations made by the permuatation matrix P. + * + * The scale and offset members of the input #DOUBLEMASK are ignored. + * + * See: + * +- * PRESS, W. et al, 1992. Numerical Recipies in C; The Art of Scientific ++ * PRESS, W. et al, 1992. Numerical Recipies in C; The Art of Scientific + * Computing, 2nd ed. Cambridge: Cambridge University Press, pp. 43-50. + * + * See also: im_mattrn(), im_matinv(). +@@ -102,118 +100,118 @@ mat_inv_direct( + */ + + DOUBLEMASK * +-im_lu_decomp( +- const DOUBLEMASK *mat, +- const char *name +-){ ++im_lu_decomp( ++ const DOUBLEMASK *mat, ++ const char *name) ++{ + #define FUNCTION_NAME "im_lu_decomp" + +- int i, j, k; +- double *row_scale; +- DOUBLEMASK *lu; +- +- if( mat-> xsize != mat-> ysize ){ +- im_error( FUNCTION_NAME, "non-square matrix" ); +- return NULL; +- } +-#define N ( mat -> xsize ) +- +- lu= im_create_dmask( name, N, N + 1 ); +- row_scale= IM_ARRAY( NULL, N, double ); +- +- if( ! row_scale || ! lu ){ +- im_free_dmask( lu ); +- im_free( row_scale ); +- return NULL; +- } +- /* copy all coefficients and then perform decomposition in-place */ +- +- memcpy( lu-> coeff, mat-> coeff, N * N * sizeof( double ) ); +- +-#define LU( i, j ) MATRIX( lu, (i), (j) ) +-#define perm ( lu-> coeff + N * N ) +- +- for( i= 0; i < N; ++i ){ +- +- row_scale[ i ]= 0.0; +- +- for( j= 0; j < N; ++j ){ +- double abs_val= fabs( LU( i, j ) ); +- +- /* find largest in each ROW */ +- +- if( abs_val > row_scale[ i ] ) +- row_scale[ i ]= abs_val; +- } +- if( ! row_scale[ i ] ){ +- im_error( FUNCTION_NAME, "singular matrix" ); +- im_free_dmask( lu ); +- im_free( row_scale ); +- return NULL; +- } +- /* fill array with scaling factors for each ROW */ +- +- row_scale[ i ]= 1.0 / row_scale[ i ]; +- } +- for( j= 0; j < N; ++j ){ /* loop over COLs */ +- double max= -1.0; +- int i_of_max; +- +- /* not needed, but stops a compiler warning */ +- i_of_max= 0; +- +- /* loop over ROWS in upper-half, except diagonal */ +- +- for( i= 0; i < j; ++i ) +- for( k= 0; k < i; ++k ) +- LU( i, j )-= LU( i, k ) * LU( k, j ); +- +- /* loop over ROWS in diagonal and lower-half */ +- +- for( i= j; i < N; ++i ){ +- double abs_val; +- +- for( k= 0; k < j; ++k ) +- LU( i, j )-= LU( i, k ) * LU( k, j ); +- +- /* find largest element in each COLUMN scaled so that */ +- /* largest in each ROW is 1.0 */ +- +- abs_val= row_scale[ i ] * fabs( LU( i, j ) ); +- +- if( abs_val > max ){ +- max= abs_val; +- i_of_max= i; +- } +- } +- if( fabs( LU( i_of_max, j ) ) < TOO_SMALL ){ +- /* divisor is near zero */ +- im_error( FUNCTION_NAME, "singular or near-singular matrix" ); +- im_free_dmask( lu ); +- im_free( row_scale ); +- return NULL; +- } +- if( i_of_max != j ){ +- /* swap ROWS */ +- +- for( k= 0; k < N; ++k ){ +- double temp= LU( j, k ); +- LU( j, k )= LU( i_of_max, k ); +- LU( i_of_max, k )= temp; +- } +- row_scale[ i_of_max ]= row_scale[ j ]; +- /* no need to copy this scale back up - we won't use it */ +- } +- /* record permutation */ +- perm[ j ]= i_of_max; +- +- /* divide by best (largest scaled) pivot found */ +- for( i= j + 1; i < N; ++i ) +- LU( i, j )/= LU( j, j ); +- } +- im_free( row_scale ); +- +- return lu; ++ int i, j, k; ++ double *row_scale; ++ DOUBLEMASK *lu; ++ ++ if (mat->xsize != mat->ysize) { ++ im_error(FUNCTION_NAME, "non-square matrix"); ++ return NULL; ++ } ++#define N (mat->xsize) ++ ++ lu = im_create_dmask(name, N, N + 1); ++ row_scale = IM_ARRAY(NULL, N, double); ++ ++ if (!row_scale || !lu) { ++ im_free_dmask(lu); ++ im_free(row_scale); ++ return NULL; ++ } ++ /* copy all coefficients and then perform decomposition in-place */ ++ ++ memcpy(lu->coeff, mat->coeff, N * N * sizeof(double)); ++ ++#define LU(i, j) MATRIX(lu, (i), (j)) ++#define perm (lu->coeff + N * N) ++ ++ for (i = 0; i < N; ++i) { ++ ++ row_scale[i] = 0.0; ++ ++ for (j = 0; j < N; ++j) { ++ double abs_val = fabs(LU(i, j)); ++ ++ /* find largest in each ROW */ ++ ++ if (abs_val > row_scale[i]) ++ row_scale[i] = abs_val; ++ } ++ if (!row_scale[i]) { ++ im_error(FUNCTION_NAME, "singular matrix"); ++ im_free_dmask(lu); ++ im_free(row_scale); ++ return NULL; ++ } ++ /* fill array with scaling factors for each ROW */ ++ ++ row_scale[i] = 1.0 / row_scale[i]; ++ } ++ for (j = 0; j < N; ++j) { /* loop over COLs */ ++ double max = -1.0; ++ int i_of_max; ++ ++ /* not needed, but stops a compiler warning */ ++ i_of_max = 0; ++ ++ /* loop over ROWS in upper-half, except diagonal */ ++ ++ for (i = 0; i < j; ++i) ++ for (k = 0; k < i; ++k) ++ LU(i, j) -= LU(i, k) * LU(k, j); ++ ++ /* loop over ROWS in diagonal and lower-half */ ++ ++ for (i = j; i < N; ++i) { ++ double abs_val; ++ ++ for (k = 0; k < j; ++k) ++ LU(i, j) -= LU(i, k) * LU(k, j); ++ ++ /* find largest element in each COLUMN scaled so that */ ++ /* largest in each ROW is 1.0 */ ++ ++ abs_val = row_scale[i] * fabs(LU(i, j)); ++ ++ if (abs_val > max) { ++ max = abs_val; ++ i_of_max = i; ++ } ++ } ++ if (fabs(LU(i_of_max, j)) < TOO_SMALL) { ++ /* divisor is near zero */ ++ im_error(FUNCTION_NAME, "singular or near-singular matrix"); ++ im_free_dmask(lu); ++ im_free(row_scale); ++ return NULL; ++ } ++ if (i_of_max != j) { ++ /* swap ROWS */ ++ ++ for (k = 0; k < N; ++k) { ++ double temp = LU(j, k); ++ LU(j, k) = LU(i_of_max, k); ++ LU(i_of_max, k) = temp; ++ } ++ row_scale[i_of_max] = row_scale[j]; ++ /* no need to copy this scale back up - we won't use it */ ++ } ++ /* record permutation */ ++ perm[j] = i_of_max; ++ ++ /* divide by best (largest scaled) pivot found */ ++ for (i = j + 1; i < N; ++i) ++ LU(i, j) /= LU(j, j); ++ } ++ im_free(row_scale); ++ ++ return lu; + + #undef N + #undef LU +@@ -232,7 +230,7 @@ im_lu_decomp( + * + * See: + * +- * PRESS, W. et al, 1992. Numerical Recipies in C; The Art of Scientific ++ * PRESS, W. et al, 1992. Numerical Recipies in C; The Art of Scientific + * Computing, 2nd ed. Cambridge: Cambridge University Press, pp. 43-50. + * + * See also: im_mattrn(), im_matinv(). +@@ -240,42 +238,42 @@ im_lu_decomp( + * Returns: the decomposed matrix on success, or NULL on error. + */ + +-int +-im_lu_solve( +- const DOUBLEMASK *lu, +- double *vec +-){ ++int ++im_lu_solve( ++ const DOUBLEMASK *lu, ++ double *vec) ++{ + #define FUNCTION_NAME "im_lu_solve" +- int i, j; +- +- if( lu-> xsize + 1 != lu-> ysize ){ +- im_error( FUNCTION_NAME, "not an LU decomposed matrix" ); +- return -1; +- } +-#define N ( lu -> xsize ) +-#define LU( i, j ) MATRIX( lu, (i), (j) ) +-#define perm ( lu-> coeff + N * N ) +- +- for( i= 0; i < N; ++i ){ +- int i_perm= perm[ i ]; +- +- if( i_perm != i ){ +- double temp= vec[ i ]; +- vec[ i ]= vec[ i_perm ]; +- vec[ i_perm ]= temp; +- } +- for( j= 0; j < i; ++j ) +- vec[ i ]-= LU( i, j ) * vec [ j ]; +- } +- +- for( i= N - 1; i >= 0; --i ){ +- +- for( j= i + 1; j < N; ++j ) +- vec[ i ]-= LU( i, j ) * vec [ j ]; +- +- vec[ i ]/= LU( i, i ); +- } +- return 0; ++ int i, j; ++ ++ if (lu->xsize + 1 != lu->ysize) { ++ im_error(FUNCTION_NAME, "not an LU decomposed matrix"); ++ return -1; ++ } ++#define N (lu->xsize) ++#define LU(i, j) MATRIX(lu, (i), (j)) ++#define perm (lu->coeff + N * N) ++ ++ for (i = 0; i < N; ++i) { ++ int i_perm = perm[i]; ++ ++ if (i_perm != i) { ++ double temp = vec[i]; ++ vec[i] = vec[i_perm]; ++ vec[i_perm] = temp; ++ } ++ for (j = 0; j < i; ++j) ++ vec[i] -= LU(i, j) * vec[j]; ++ } ++ ++ for (i = N - 1; i >= 0; --i) { ++ ++ for (j = i + 1; j < N; ++j) ++ vec[i] -= LU(i, j) * vec[j]; ++ ++ vec[i] /= LU(i, i); ++ } ++ return 0; + + #undef LU + #undef perm +@@ -288,7 +286,7 @@ im_lu_solve( + * @mat: matrix to invert + * @filename: name for output matrix + * +- * Allocate, and return a pointer to, a DOUBLEMASK representing the ++ * Allocate, and return a pointer to, a DOUBLEMASK representing the + * inverse of the matrix represented in @mat. Give it the filename + * member @filename. Returns NULL on error. Scale and offset are ignored. + * +@@ -297,42 +295,42 @@ im_lu_solve( + * Returns: the inverted matrix on success, or %NULL on error. + */ + DOUBLEMASK * +-im_matinv( +- const DOUBLEMASK *mat, +- const char *filename +-){ ++im_matinv( ++ const DOUBLEMASK *mat, ++ const char *filename) ++{ + #define FUNCTION_NAME "im_matinv" + +- DOUBLEMASK *inv; +- +- if( mat-> xsize != mat-> ysize ){ +- im_error( FUNCTION_NAME, "non-square matrix" ); +- return NULL; +- } +-#define N ( mat -> xsize ) +- inv= im_create_dmask( filename, N, N ); +- if( ! inv ) +- return NULL; +- +- if( N < 4 ){ +- if( mat_inv_direct( inv, (const DOUBLEMASK *) mat, FUNCTION_NAME ) ){ +- im_free_dmask( inv ); +- return NULL; +- } +- return inv; +- } +- else { +- DOUBLEMASK *lu= im_lu_decomp( mat, "temp" ); +- +- if( ! lu || mat_inv_lu( inv, (const DOUBLEMASK*) lu ) ){ +- im_free_dmask( lu ); +- im_free_dmask( inv ); +- return NULL; +- } +- im_free_dmask( lu ); +- +- return inv; +- } ++ DOUBLEMASK *inv; ++ ++ if (mat->xsize != mat->ysize) { ++ im_error(FUNCTION_NAME, "non-square matrix"); ++ return NULL; ++ } ++#define N (mat->xsize) ++ inv = im_create_dmask(filename, N, N); ++ if (!inv) ++ return NULL; ++ ++ if (N < 4) { ++ if (mat_inv_direct(inv, (const DOUBLEMASK *) mat, FUNCTION_NAME)) { ++ im_free_dmask(inv); ++ return NULL; ++ } ++ return inv; ++ } ++ else { ++ DOUBLEMASK *lu = im_lu_decomp(mat, "temp"); ++ ++ if (!lu || mat_inv_lu(inv, (const DOUBLEMASK *) lu)) { ++ im_free_dmask(lu); ++ im_free_dmask(inv); ++ return NULL; ++ } ++ im_free_dmask(lu); ++ ++ return inv; ++ } + #undef N + #undef FUNCTION_NAME + } +@@ -341,7 +339,7 @@ im_matinv( + * im_matinv_inplace: + * @mat: matrix to invert + * +- * Invert the matrix represented by the DOUBLEMASK @mat, and store ++ * Invert the matrix represented by the DOUBLEMASK @mat, and store + * it in the place of @mat. Scale and offset + * are ignored. + * +@@ -350,40 +348,40 @@ im_matinv( + * Returns: 0 on success, or -1 on error. + */ + int +-im_matinv_inplace( +- DOUBLEMASK *mat +-){ ++im_matinv_inplace( ++ DOUBLEMASK *mat) ++{ + #define FUNCTION_NAME "im_matinv_inplace" +- int to_return= 0; +- +- if( mat-> xsize != mat-> ysize ){ +- im_error( FUNCTION_NAME, "non-square matrix" ); +- return -1; +- } +-#define N ( mat -> xsize ) +- if( N < 4 ){ +- DOUBLEMASK *dup= im_dup_dmask( mat, "temp" ); +- if( ! dup ) +- return -1; +- +- to_return= mat_inv_direct( mat, (const DOUBLEMASK*) dup, FUNCTION_NAME ); +- +- im_free_dmask( dup ); +- +- return to_return; +- } +- { +- DOUBLEMASK *lu; +- +- lu= im_lu_decomp( mat, "temp" ); +- +- if( ! lu || mat_inv_lu( mat, (const DOUBLEMASK*) lu ) ) +- to_return= -1; +- +- im_free_dmask( lu ); +- +- return to_return; +- } ++ int to_return = 0; ++ ++ if (mat->xsize != mat->ysize) { ++ im_error(FUNCTION_NAME, "non-square matrix"); ++ return -1; ++ } ++#define N (mat->xsize) ++ if (N < 4) { ++ DOUBLEMASK *dup = im_dup_dmask(mat, "temp"); ++ if (!dup) ++ return -1; ++ ++ to_return = mat_inv_direct(mat, (const DOUBLEMASK *) dup, FUNCTION_NAME); ++ ++ im_free_dmask(dup); ++ ++ return to_return; ++ } ++ { ++ DOUBLEMASK *lu; ++ ++ lu = im_lu_decomp(mat, "temp"); ++ ++ if (!lu || mat_inv_lu(mat, (const DOUBLEMASK *) lu)) ++ to_return = -1; ++ ++ im_free_dmask(lu); ++ ++ return to_return; ++ } + #undef N + #undef FUNCTION_NAME + } +@@ -391,132 +389,129 @@ im_matinv_inplace( + /* Invert a square size x size matrix stored in matrix[][] + * result is returned in the same matrix + */ +-int +-im_invmat( +- double **matrix, +- int size +- ){ ++int ++im_invmat( ++ double **matrix, ++ int size) ++{ + +- DOUBLEMASK *mat= im_create_dmask( "temp", size, size ); +- int i; +- int to_return= 0; ++ DOUBLEMASK *mat = im_create_dmask("temp", size, size); ++ int i; ++ int to_return = 0; + +- for( i= 0; i < size; ++i ) +- memcpy( mat-> coeff + i * size, matrix[ i ], size * sizeof( double ) ); ++ for (i = 0; i < size; ++i) ++ memcpy(mat->coeff + i * size, matrix[i], size * sizeof(double)); + +- to_return= im_matinv_inplace( mat ); ++ to_return = im_matinv_inplace(mat); + +- if( ! to_return ) +- for( i= 0; i < size; ++i ) +- memcpy( matrix[ i ], mat-> coeff + i * size, size * sizeof( double ) ); ++ if (!to_return) ++ for (i = 0; i < size; ++i) ++ memcpy(matrix[i], mat->coeff + i * size, size * sizeof(double)); + +- im_free_dmask( mat ); ++ im_free_dmask(mat); + +- return to_return; ++ return to_return; + } + + static int + mat_inv_lu( +- DOUBLEMASK *inv, +- const DOUBLEMASK *lu +-){ +-#define N ( lu-> xsize ) +-#define INV( i, j ) MATRIX( inv, (i), (j) ) ++ DOUBLEMASK *inv, ++ const DOUBLEMASK *lu) ++{ ++#define N (lu->xsize) ++#define INV(i, j) MATRIX(inv, (i), (j)) + +- int i, j; +- double *vec= IM_ARRAY( NULL, N, double ); ++ int i, j; ++ double *vec = IM_ARRAY(NULL, N, double); + +- if( ! vec ) +- return -1; ++ if (!vec) ++ return -1; + +- for( j= 0; j < N; ++j ){ +- +- for( i= 0; i < N; ++i ) +- vec[ i ]= 0.0; ++ for (j = 0; j < N; ++j) { + +- vec[ j ]= 1.0; ++ for (i = 0; i < N; ++i) ++ vec[i] = 0.0; + +- im_lu_solve( lu, vec ); ++ vec[j] = 1.0; + +- for( i= 0; i < N; ++i ) +- INV( i, j )= vec[ i ]; +- } +- im_free( vec ); ++ im_lu_solve(lu, vec); + +- inv-> scale= 1.0; +- inv-> offset= 0.0; ++ for (i = 0; i < N; ++i) ++ INV(i, j) = vec[i]; ++ } ++ im_free(vec); + +- return 0; ++ inv->scale = 1.0; ++ inv->offset = 0.0; ++ ++ return 0; + + #undef N + #undef INV + } + +-static int +-mat_inv_direct( +- DOUBLEMASK *inv, +- const DOUBLEMASK *mat, +- const char *function_name +-){ +-#define N ( mat -> xsize ) +-#define MAT( i, j ) MATRIX( mat, (i), (j) ) +-#define INV( i, j ) MATRIX( inv, (i), (j) ) +- +- inv-> scale= 1.0; +- inv-> offset= 0.0; +- +- switch( N ){ +- case 1: { +- if( fabs( MAT( 0, 0 ) ) < TOO_SMALL ){ +- im_error( function_name, "singular or near-singular matrix" ); +- return -1; +- } +- INV( 0, 0 )= 1.0 / MAT( 0, 0 ); +- return 0; +- } +- case 2: { +- double det= MAT( 0, 0 ) * MAT( 1, 1 ) - MAT( 0, 1 ) * MAT( 1, 0 ); +- +- if( fabs( det ) < TOO_SMALL ){ +- im_error( function_name, "singular or near-singular matrix" ); +- return -1; +- } +- INV( 0, 0 )= MAT( 1, 1 ) / det; +- INV( 0, 1 )= -MAT( 0, 1 ) / det; +- INV( 1, 0 )= -MAT( 1, 0 ) / det; +- INV( 1, 1 )= MAT( 0, 0 ) / det; +- +- return 0; +- } +- case 3: { +- double det= MAT( 0, 0 ) * ( MAT( 1, 1 ) * MAT( 2, 2 ) - MAT( 1, 2 ) * MAT( 2, 1 ) ) +- - MAT( 0, 1 ) * ( MAT( 1, 0 ) * MAT( 2, 2 ) - MAT( 1, 2 ) * MAT( 2, 0 ) ) +- + MAT( 0, 2 ) * ( MAT( 1, 0 ) * MAT( 2, 1 ) - MAT( 1, 1 ) * MAT( 2, 0 ) ); +- +- if( fabs( det ) < TOO_SMALL ){ +- im_error( function_name, "singular or near-singular matrix" ); +- return -1; +- } +- INV( 0, 0 )= ( MAT( 1, 1 ) * MAT( 2, 2 ) - MAT( 1, 2 ) * MAT( 2, 1 ) ) / det; +- INV( 0, 1 )= ( MAT( 0, 2 ) * MAT( 2, 1 ) - MAT( 0, 1 ) * MAT( 2, 2 ) ) / det; +- INV( 0, 2 )= ( MAT( 0, 1 ) * MAT( 1, 2 ) - MAT( 0, 2 ) * MAT( 1, 1 ) ) / det; +- +- INV( 1, 0 )= ( MAT( 1, 2 ) * MAT( 2, 0 ) - MAT( 1, 0 ) * MAT( 2, 2 ) ) / det; +- INV( 1, 1 )= ( MAT( 0, 0 ) * MAT( 2, 2 ) - MAT( 0, 2 ) * MAT( 2, 0 ) ) / det; +- INV( 1, 2 )= ( MAT( 0, 2 ) * MAT( 1, 0 ) - MAT( 0, 0 ) * MAT( 1, 2 ) ) / det; +- +- INV( 2, 0 )= ( MAT( 1, 0 ) * MAT( 2, 1 ) - MAT( 1, 1 ) * MAT( 2, 0 ) ) / det; +- INV( 2, 1 )= ( MAT( 0, 1 ) * MAT( 2, 0 ) - MAT( 0, 0 ) * MAT( 2, 1 ) ) / det; +- INV( 2, 2 )= ( MAT( 0, 0 ) * MAT( 1, 1 ) - MAT( 0, 1 ) * MAT( 1, 0 ) ) / det; +- +- return 0; +- } +- default: +- return -1; +- } ++static int ++mat_inv_direct( ++ DOUBLEMASK *inv, ++ const DOUBLEMASK *mat, ++ const char *function_name) ++{ ++#define N (mat->xsize) ++#define MAT(i, j) MATRIX(mat, (i), (j)) ++#define INV(i, j) MATRIX(inv, (i), (j)) ++ ++ inv->scale = 1.0; ++ inv->offset = 0.0; ++ ++ switch (N) { ++ case 1: { ++ if (fabs(MAT(0, 0)) < TOO_SMALL) { ++ im_error(function_name, "singular or near-singular matrix"); ++ return -1; ++ } ++ INV(0, 0) = 1.0 / MAT(0, 0); ++ return 0; ++ } ++ case 2: { ++ double det = MAT(0, 0) * MAT(1, 1) - MAT(0, 1) * MAT(1, 0); ++ ++ if (fabs(det) < TOO_SMALL) { ++ im_error(function_name, "singular or near-singular matrix"); ++ return -1; ++ } ++ INV(0, 0) = MAT(1, 1) / det; ++ INV(0, 1) = -MAT(0, 1) / det; ++ INV(1, 0) = -MAT(1, 0) / det; ++ INV(1, 1) = MAT(0, 0) / det; ++ ++ return 0; ++ } ++ case 3: { ++ double det = MAT(0, 0) * (MAT(1, 1) * MAT(2, 2) - MAT(1, 2) * MAT(2, 1)) - MAT(0, 1) * (MAT(1, 0) * MAT(2, 2) - MAT(1, 2) * MAT(2, 0)) + MAT(0, 2) * (MAT(1, 0) * MAT(2, 1) - MAT(1, 1) * MAT(2, 0)); ++ ++ if (fabs(det) < TOO_SMALL) { ++ im_error(function_name, "singular or near-singular matrix"); ++ return -1; ++ } ++ INV(0, 0) = (MAT(1, 1) * MAT(2, 2) - MAT(1, 2) * MAT(2, 1)) / det; ++ INV(0, 1) = (MAT(0, 2) * MAT(2, 1) - MAT(0, 1) * MAT(2, 2)) / det; ++ INV(0, 2) = (MAT(0, 1) * MAT(1, 2) - MAT(0, 2) * MAT(1, 1)) / det; ++ ++ INV(1, 0) = (MAT(1, 2) * MAT(2, 0) - MAT(1, 0) * MAT(2, 2)) / det; ++ INV(1, 1) = (MAT(0, 0) * MAT(2, 2) - MAT(0, 2) * MAT(2, 0)) / det; ++ INV(1, 2) = (MAT(0, 2) * MAT(1, 0) - MAT(0, 0) * MAT(1, 2)) / det; ++ ++ INV(2, 0) = (MAT(1, 0) * MAT(2, 1) - MAT(1, 1) * MAT(2, 0)) / det; ++ INV(2, 1) = (MAT(0, 1) * MAT(2, 0) - MAT(0, 0) * MAT(2, 1)) / det; ++ INV(2, 2) = (MAT(0, 0) * MAT(1, 1) - MAT(0, 1) * MAT(1, 0)) / det; ++ ++ return 0; ++ } ++ default: ++ return -1; ++ } + + #undef N + #undef MAT + #undef INV + } +- +diff --git a/libvips/deprecated/im_matmul.c b/libvips/deprecated/im_matmul.c +index 8e52310054..01bc4f247b 100644 +--- a/libvips/deprecated/im_matmul.c ++++ b/libvips/deprecated/im_matmul.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -45,7 +45,7 @@ + + /** + * im_matmul: +- * @in1: input matrix ++ * @in1: input matrix + * @in2: input matrix + * @filename: name for output matrix + * +@@ -59,8 +59,8 @@ + * Returns: the result matrix on success, or %NULL on error. + */ + DOUBLEMASK * +-im_matmul( DOUBLEMASK *in1, DOUBLEMASK *in2, const char *name ) +-{ ++im_matmul(DOUBLEMASK *in1, DOUBLEMASK *in2, const char *name) ++{ + int xc, yc, col; + double sum; + DOUBLEMASK *mat; +@@ -69,32 +69,32 @@ im_matmul( DOUBLEMASK *in1, DOUBLEMASK *in2, const char *name ) + + /* Check matrix sizes. + */ +- if( in1->xsize != in2->ysize ) { +- im_error( "im_matmul", "%s", _( "bad sizes" ) ); +- return( NULL ); ++ if (in1->xsize != in2->ysize) { ++ im_error("im_matmul", "%s", _("bad sizes")); ++ return (NULL); + } + + /* Allocate output matrix. + */ +- if( !(mat = im_create_dmask( name, in2->xsize, in1->ysize )) ) +- return( NULL ); ++ if (!(mat = im_create_dmask(name, in2->xsize, in1->ysize))) ++ return (NULL); + + /* Multiply. + */ + out = mat->coeff; + s1 = in1->coeff; + +- for( yc = 0; yc < in1->ysize; yc++ ) { ++ for (yc = 0; yc < in1->ysize; yc++) { + s2 = in2->coeff; + +- for( col = 0; col < in2->xsize; col++ ) { ++ for (col = 0; col < in2->xsize; col++) { + /* Get ready to sweep a row. + */ + sum = 0.0; + a = s1; + b = s2; + +- for( sum = 0.0, xc = 0; xc < in1->xsize; xc++ ) { ++ for (sum = 0.0, xc = 0; xc < in1->xsize; xc++) { + sum += *a++ * *b; + b += in2->xsize; + } +@@ -106,5 +106,5 @@ im_matmul( DOUBLEMASK *in1, DOUBLEMASK *in2, const char *name ) + s1 += in1->xsize; + } + +- return( mat ); ++ return (mat); + } +diff --git a/libvips/deprecated/im_mattrn.c b/libvips/deprecated/im_mattrn.c +index aed0355551..750e8cb6a8 100644 +--- a/libvips/deprecated/im_mattrn.c ++++ b/libvips/deprecated/im_mattrn.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,7 +43,7 @@ + + /** + * im_mattrn: +- * @in: input matrix ++ * @in: input matrix + * @filename: name for output matrix + * + * Transposes the input matrix. +@@ -54,16 +54,16 @@ + * Returns: the result matrix on success, or %NULL on error. + */ + DOUBLEMASK * +-im_mattrn( DOUBLEMASK *in, const char *name ) +-{ ++im_mattrn(DOUBLEMASK *in, const char *name) ++{ + int xc, yc; + DOUBLEMASK *mat; + double *out, *a, *b; + + /* Allocate output matrix. + */ +- if( !(mat = im_create_dmask( name, in->ysize, in->xsize )) ) +- return( NULL ); ++ if (!(mat = im_create_dmask(name, in->ysize, in->xsize))) ++ return (NULL); + mat->scale = in->scale; + mat->offset = in->offset; + +@@ -72,10 +72,10 @@ im_mattrn( DOUBLEMASK *in, const char *name ) + out = mat->coeff; + a = in->coeff; + +- for( yc = 0; yc < mat->ysize; yc++ ) { ++ for (yc = 0; yc < mat->ysize; yc++) { + b = a; + +- for( xc = 0; xc < mat->xsize; xc++ ) { ++ for (xc = 0; xc < mat->xsize; xc++) { + *out++ = *b; + b += in->xsize; + } +@@ -83,5 +83,5 @@ im_mattrn( DOUBLEMASK *in, const char *name ) + a++; + } + +- return( mat ); ++ return (mat); + } +diff --git a/libvips/deprecated/im_maxpos_avg.c b/libvips/deprecated/im_maxpos_avg.c +index 09b559ad88..3dc75dd82a 100644 +--- a/libvips/deprecated/im_maxpos_avg.c ++++ b/libvips/deprecated/im_maxpos_avg.c +@@ -23,28 +23,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -80,135 +80,138 @@ typedef struct _Maxposavg { + /* New sequence value. + */ + static void * +-maxposavg_start( IMAGE *in, void *a, void *b ) ++maxposavg_start(IMAGE *in, void *a, void *b) + { + Maxposavg *global_maxposavg = (Maxposavg *) b; + Maxposavg *maxposavg; + +- if( !(maxposavg = IM_NEW( NULL, Maxposavg )) ) +- return( NULL ); ++ if (!(maxposavg = IM_NEW(NULL, Maxposavg))) ++ return (NULL); + *maxposavg = *global_maxposavg; + +- return( (void *) maxposavg ); ++ return ((void *) maxposavg); + } + + /* Merge the sequence value back into the per-call state. + */ + static int +-maxposavg_stop( void *seq, void *a, void *b ) ++maxposavg_stop(void *seq, void *a, void *b) + { + Maxposavg *global_maxposavg = (Maxposavg *) b; + Maxposavg *maxposavg = (Maxposavg *) seq; + + /* Merge. + */ +- if( maxposavg->occurences == 0 ) { ++ if (maxposavg->occurences == 0) { + } +- else if( maxposavg->max > global_maxposavg->max ) ++ else if (maxposavg->max > global_maxposavg->max) + *global_maxposavg = *maxposavg; +- else if( maxposavg->max == global_maxposavg->max ) { ++ else if (maxposavg->max == global_maxposavg->max) { + global_maxposavg->xpos += maxposavg->xpos; + global_maxposavg->ypos += maxposavg->ypos; + global_maxposavg->occurences += maxposavg->occurences; + } + +- im_free( seq ); ++ im_free(seq); + +- return( 0 ); ++ return (0); + } + + /* int loop. + */ +-#define ILOOP( TYPE ) { \ +- TYPE *p = (TYPE *) in; \ +- TYPE m; \ +- \ +- m = max; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- TYPE v = p[x]; \ +- \ +- if( occurences == 0 || v > m ) { \ +- m = v; \ +- xpos = r->left + x / reg->im->Bands; \ +- ypos = r->top + y; \ +- occurences = 1; \ +- } \ +- else if( v == m ) { \ +- xpos += r->left + x / reg->im->Bands; \ +- ypos += r->top + y; \ +- occurences += 1; \ ++#define ILOOP(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) in; \ ++ TYPE m; \ ++\ ++ m = max; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ TYPE v = p[x]; \ ++\ ++ if (occurences == 0 || v > m) { \ ++ m = v; \ ++ xpos = r->left + x / reg->im->Bands; \ ++ ypos = r->top + y; \ ++ occurences = 1; \ ++ } \ ++ else if (v == m) { \ ++ xpos += r->left + x / reg->im->Bands; \ ++ ypos += r->top + y; \ ++ occurences += 1; \ ++ } \ + } \ +- } \ +- \ +- max = m; \ +-} ++\ ++ max = m; \ ++ } + + /* float/double loop ... avoid NaN. + */ +-#define FLOOP( TYPE ) { \ +- TYPE *p = (TYPE *) in; \ +- TYPE m; \ +- \ +- m = max; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- TYPE v = p[x]; \ +- \ +- if( isnan( v ) ) { \ +- } \ +- else if( occurences == 0 || v > m ) { \ +- m = v; \ +- xpos = r->left + x / reg->im->Bands; \ +- ypos = r->top + y; \ +- occurences = 1; \ +- } \ +- else if( v == m ) { \ +- xpos += r->left + x / reg->im->Bands; \ +- ypos += r->top + y; \ +- occurences += 1; \ ++#define FLOOP(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) in; \ ++ TYPE m; \ ++\ ++ m = max; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ TYPE v = p[x]; \ ++\ ++ if (isnan(v)) { \ ++ } \ ++ else if (occurences == 0 || v > m) { \ ++ m = v; \ ++ xpos = r->left + x / reg->im->Bands; \ ++ ypos = r->top + y; \ ++ occurences = 1; \ ++ } \ ++ else if (v == m) { \ ++ xpos += r->left + x / reg->im->Bands; \ ++ ypos += r->top + y; \ ++ occurences += 1; \ ++ } \ + } \ +- } \ +- \ +- max = m; \ +-} ++\ ++ max = m; \ ++ } + + /* complex/dpcomplex loop ... avoid NaN. + */ +-#define CLOOP( TYPE ) { \ +- TYPE *p = (TYPE *) in; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- double mod, re, im; \ +- \ +- re = p[0]; \ +- im = p[1]; \ +- p += 2; \ +- mod = re * re + im * im; \ +- \ +- if( isnan( mod ) ) { \ +- } \ +- else if( occurences == 0 || mod > max ) { \ +- max = mod; \ +- xpos = r->left + x / reg->im->Bands; \ +- ypos = r->top + y; \ +- occurences = 1; \ ++#define CLOOP(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) in; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ double mod, re, im; \ ++\ ++ re = p[0]; \ ++ im = p[1]; \ ++ p += 2; \ ++ mod = re * re + im * im; \ ++\ ++ if (isnan(mod)) { \ ++ } \ ++ else if (occurences == 0 || mod > max) { \ ++ max = mod; \ ++ xpos = r->left + x / reg->im->Bands; \ ++ ypos = r->top + y; \ ++ occurences = 1; \ ++ } \ ++ else if (mod == max) { \ ++ xpos += r->left + x / reg->im->Bands; \ ++ ypos += r->top + y; \ ++ occurences += 1; \ ++ } \ + } \ +- else if( mod == max ) { \ +- xpos += r->left + x / reg->im->Bands; \ +- ypos += r->top + y; \ +- occurences += 1; \ +- } \ +- } \ +-} ++ } + + /* Loop over region, adding to seq. + */ + static int +-maxposavg_scan( REGION *reg, void *seq, void *a, void *b, gboolean *stop ) ++maxposavg_scan(REGION *reg, void *seq, void *a, void *b, gboolean *stop) + { + const Rect *r = ®->valid; +- const int sz = IM_REGION_N_ELEMENTS( reg ); ++ const int sz = IM_REGION_N_ELEMENTS(reg); + Maxposavg *maxposavg = (Maxposavg *) seq; + + int x, y; +@@ -220,35 +223,55 @@ maxposavg_scan( REGION *reg, void *seq, void *a, void *b, gboolean *stop ) + max = maxposavg->max; + occurences = maxposavg->occurences; + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *in = VIPS_REGION_ADDR( reg, r->left, r->top + y ); +- +- switch( reg->im->BandFmt ) { +- case IM_BANDFMT_UCHAR: ILOOP( unsigned char ); break; +- case IM_BANDFMT_CHAR: ILOOP( signed char ); break; +- case IM_BANDFMT_USHORT: ILOOP( unsigned short ); break; +- case IM_BANDFMT_SHORT: ILOOP( signed short ); break; +- case IM_BANDFMT_UINT: ILOOP( unsigned int ); break; +- case IM_BANDFMT_INT: ILOOP( signed int ); break; +- case IM_BANDFMT_FLOAT: FLOOP( float ); break; +- case IM_BANDFMT_DOUBLE: FLOOP( double ); break; +- case IM_BANDFMT_COMPLEX: CLOOP( float ); break; +- case IM_BANDFMT_DPCOMPLEX: CLOOP( double ); break; +- +- default: +- g_assert( 0 ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *in = VIPS_REGION_ADDR(reg, r->left, r->top + y); ++ ++ switch (reg->im->BandFmt) { ++ case IM_BANDFMT_UCHAR: ++ ILOOP(unsigned char); ++ break; ++ case IM_BANDFMT_CHAR: ++ ILOOP(signed char); ++ break; ++ case IM_BANDFMT_USHORT: ++ ILOOP(unsigned short); ++ break; ++ case IM_BANDFMT_SHORT: ++ ILOOP(signed short); ++ break; ++ case IM_BANDFMT_UINT: ++ ILOOP(unsigned int); ++ break; ++ case IM_BANDFMT_INT: ++ ILOOP(signed int); ++ break; ++ case IM_BANDFMT_FLOAT: ++ FLOOP(float); ++ break; ++ case IM_BANDFMT_DOUBLE: ++ FLOOP(double); ++ break; ++ case IM_BANDFMT_COMPLEX: ++ CLOOP(float); ++ break; ++ case IM_BANDFMT_DPCOMPLEX: ++ CLOOP(double); ++ break; ++ ++ default: ++ g_assert(0); + } +- } ++ } + + maxposavg->xpos = xpos; + maxposavg->ypos = ypos; + maxposavg->max = max; + maxposavg->occurences = occurences; + +- return( 0 ); ++ return (0); + } + +-/** ++/** + * im_maxpos_avg: + * @im: image to scan + * @xpos: returned X position +@@ -256,7 +279,7 @@ maxposavg_scan( REGION *reg, void *seq, void *a, void *b, gboolean *stop ) + * @out: returned value + * + * Function to find the maximum of an image. Returns coords and value at +- * double precision. In the event of a draw, returns average of all ++ * double precision. In the event of a draw, returns average of all + * drawing coords. + * + * See also: im_maxpos(), im_min(), im_stats(). +@@ -264,43 +287,42 @@ maxposavg_scan( REGION *reg, void *seq, void *a, void *b, gboolean *stop ) + * Returns: 0 on success, -1 on error + */ + int +-im_maxpos_avg( IMAGE *in, double *xpos, double *ypos, double *out ) ++im_maxpos_avg(IMAGE *in, double *xpos, double *ypos, double *out) + { + Maxposavg *global_maxposavg; + +- if( im_pincheck( in ) || +- im_check_uncoded( "im_maxpos_avg", in ) ) +- return( -1 ); ++ if (im_pincheck(in) || ++ im_check_uncoded("im_maxpos_avg", in)) ++ return (-1); + +- if( !(global_maxposavg = IM_NEW( in, Maxposavg )) ) +- return( -1 ); ++ if (!(global_maxposavg = IM_NEW(in, Maxposavg))) ++ return (-1); + global_maxposavg->occurences = 0; + +- if( vips_sink( in, maxposavg_start, maxposavg_scan, maxposavg_stop, +- in, global_maxposavg ) ) +- return( -1 ); ++ if (vips_sink(in, maxposavg_start, maxposavg_scan, maxposavg_stop, ++ in, global_maxposavg)) ++ return (-1); + +- if( global_maxposavg->occurences == 0 ) { ++ if (global_maxposavg->occurences == 0) { + *xpos = nan(""); + *ypos = nan(""); + *out = nan(""); +- } ++ } + else { + /* Back to modulus. + */ +- if( vips_band_format_iscomplex( in->BandFmt ) ) +- global_maxposavg->max = sqrt( global_maxposavg->max ); ++ if (vips_band_format_iscomplex(in->BandFmt)) ++ global_maxposavg->max = sqrt(global_maxposavg->max); + +- if( xpos ) +- *xpos = (double) global_maxposavg->xpos / ++ if (xpos) ++ *xpos = (double) global_maxposavg->xpos / + global_maxposavg->occurences; +- if( ypos ) +- *ypos = (double) global_maxposavg->ypos / ++ if (ypos) ++ *ypos = (double) global_maxposavg->ypos / + global_maxposavg->occurences; +- if( out ) ++ if (out) + *out = global_maxposavg->max; + } + +- return( 0 ); ++ return (0); + } +- +diff --git a/libvips/deprecated/im_maxpos_subpel.c b/libvips/deprecated/im_maxpos_subpel.c +index 3e21d7da35..978c5843e2 100644 +--- a/libvips/deprecated/im_maxpos_subpel.c ++++ b/libvips/deprecated/im_maxpos_subpel.c +@@ -10,28 +10,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -44,15 +44,14 @@ + #include + #include + +- +-#define MOST_OF( A, B ) ( (A) > 0.9 * (B) ) +-#define LITTLE_OF( A, B ) ( (B) < 0.1 * (B) ) ++#define MOST_OF(A, B) ((A) > 0.9 * (B)) ++#define LITTLE_OF(A, B) ((B) < 0.1 * (B)) + + /** + * im_maxpos_subpel: + * @in: input image +- * @x: output position of maximum +- * @y: output position of maximum ++ * @x: output position of maximum ++ * @y: output position of maximum + * + * This function implements: + * +@@ -89,81 +88,82 @@ + * Returns: 0 on success, -1 on error + */ + +-int im_maxpos_subpel( IMAGE *in, double *x, double *y ){ ++int ++im_maxpos_subpel(IMAGE *in, double *x, double *y) ++{ + #define FUNCTION_NAME "im_maxpos_subpel" + +- int xs[5]; +- int ys[5]; +- double vals[5]; +- int xa, ya, xb, yb; +- double vxa, vya, vxb, vyb; +- +- if( im_maxpos_vec( in, xs, ys, vals, 5 )) +- return -1; +- +-#define WRAP_TEST_RETURN() \ +- \ +- /* wrap around if we have alignment -1 < d <= 0 */ \ +- /* (change it to: size - 1 <= d < size ) */ \ +- \ +- if( ! xa && in-> Xsize - 1 == xb ) \ +- xa= in-> Xsize; \ +- \ +- else if( ! xb && in-> Xsize - 1 == xa ) \ +- xb= in-> Xsize; \ +- \ +- if( ! ya && in-> Ysize - 1 == yb ) \ +- ya= in-> Ysize; \ +- \ +- else if( ! yb && in-> Ysize - 1 == ya ) \ +- yb= in-> Ysize; \ +- \ +- if( 1 == abs( xb - xa ) && 1 == abs( yb - ya )){ \ +- *x= ((double)xa) + ((double)( xb - xa )) * ( vxb / ( vxa + vxb )); \ +- *y= ((double)ya) + ((double)( yb - ya )) * ( vyb / ( vya + vyb )); \ +- return 0; \ +- } +- +-#define TEST3( A, B ) \ +- if( xs[0] == xs[A] && ys[0] == ys[B] ){ \ +- xa= xs[0]; \ +- ya= ys[0]; \ +- xb= xs[B]; \ +- yb= ys[A]; \ +- vxa= vals[0]; \ +- vya= vals[0]; \ +- vxb= vals[B]; \ +- vyb= vals[A]; \ +- WRAP_TEST_RETURN() \ +- } +- +- TEST3( 1, 2 ) +- TEST3( 2, 1 ) +- +- if( MOST_OF( vals[1], vals[0] ) && MOST_OF( vals[2], vals[0] ) +- && MOST_OF( vals[3], vals[0] ) && LITTLE_OF( vals[4], vals[0] )){ +- +-#define TEST4( A, B, C, D, E, F, G, H ) \ +- if( xs[A] == xs[B] && xs[C] == xs[D] && ys[E] == ys[F] && ys[G] == ys[H] ){ \ +- xa= xs[A]; \ +- xb= xs[C]; \ +- ya= ys[E]; \ +- yb= ys[G]; \ +- vxa= vals[A] + vals[B]; \ +- vxb= vals[C] + vals[D]; \ +- vya= vals[E] + vals[F]; \ +- vyb= vals[G] + vals[H]; \ +- WRAP_TEST_RETURN() \ +- } +- +- TEST4( 0, 3, 1, 2, 0, 1, 2, 3 ) +- TEST4( 0, 1, 2, 3, 0, 3, 1, 2 ) +- TEST4( 0, 3, 1, 2, 0, 2, 1, 3 ) +- TEST4( 0, 2, 1, 3, 0, 3, 1, 2 ) +- } +- +- im_warn( FUNCTION_NAME, "registration performed to nearest pixel only: correlation does not have the expected distribution for sub-pixel registration" ); +- *x= (double) xs[0]; +- *y= (double) ys[0]; +- return 0; ++ int xs[5]; ++ int ys[5]; ++ double vals[5]; ++ int xa, ya, xb, yb; ++ double vxa, vya, vxb, vyb; ++ ++ if (im_maxpos_vec(in, xs, ys, vals, 5)) ++ return -1; ++ ++#define WRAP_TEST_RETURN() \ ++\ ++ /* wrap around if we have alignment -1 < d <= 0 */ \ ++ /* (change it to: size - 1 <= d < size ) */ \ ++\ ++ if (!xa && in->Xsize - 1 == xb) \ ++ xa = in->Xsize; \ ++\ ++ else if (!xb && in->Xsize - 1 == xa) \ ++ xb = in->Xsize; \ ++\ ++ if (!ya && in->Ysize - 1 == yb) \ ++ ya = in->Ysize; \ ++\ ++ else if (!yb && in->Ysize - 1 == ya) \ ++ yb = in->Ysize; \ ++\ ++ if (1 == abs(xb - xa) && 1 == abs(yb - ya)) { \ ++ *x = ((double) xa) + ((double) (xb - xa)) * (vxb / (vxa + vxb)); \ ++ *y = ((double) ya) + ((double) (yb - ya)) * (vyb / (vya + vyb)); \ ++ return 0; \ ++ } ++ ++#define TEST3(A, B) \ ++ if (xs[0] == xs[A] && ys[0] == ys[B]) { \ ++ xa = xs[0]; \ ++ ya = ys[0]; \ ++ xb = xs[B]; \ ++ yb = ys[A]; \ ++ vxa = vals[0]; \ ++ vya = vals[0]; \ ++ vxb = vals[B]; \ ++ vyb = vals[A]; \ ++ WRAP_TEST_RETURN() \ ++ } ++ ++ TEST3(1, 2) ++ TEST3(2, 1) ++ ++ if (MOST_OF(vals[1], vals[0]) && MOST_OF(vals[2], vals[0]) && MOST_OF(vals[3], vals[0]) && LITTLE_OF(vals[4], vals[0])) { ++ ++#define TEST4(A, B, C, D, E, F, G, H) \ ++ if (xs[A] == xs[B] && xs[C] == xs[D] && ys[E] == ys[F] && ys[G] == ys[H]) { \ ++ xa = xs[A]; \ ++ xb = xs[C]; \ ++ ya = ys[E]; \ ++ yb = ys[G]; \ ++ vxa = vals[A] + vals[B]; \ ++ vxb = vals[C] + vals[D]; \ ++ vya = vals[E] + vals[F]; \ ++ vyb = vals[G] + vals[H]; \ ++ WRAP_TEST_RETURN() \ ++ } ++ ++ TEST4(0, 3, 1, 2, 0, 1, 2, 3) ++ TEST4(0, 1, 2, 3, 0, 3, 1, 2) ++ TEST4(0, 3, 1, 2, 0, 2, 1, 3) ++ TEST4(0, 2, 1, 3, 0, 3, 1, 2) ++ } ++ ++ im_warn(FUNCTION_NAME, "registration performed to nearest pixel only: correlation does not have the expected distribution for sub-pixel registration"); ++ *x = (double) xs[0]; ++ *y = (double) ys[0]; ++ return 0; + } +diff --git a/libvips/deprecated/im_measure.c b/libvips/deprecated/im_measure.c +index 1d119a8866..e15dd2faec 100644 +--- a/libvips/deprecated/im_measure.c ++++ b/libvips/deprecated/im_measure.c +@@ -1,6 +1,6 @@ + /* im_measure.c + * +- * Modified: ++ * Modified: + * 19/8/94 JC + * - now uses doubles for addressing + * - could miss by up to h pixels previously! +@@ -26,28 +26,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -65,10 +65,10 @@ + /* Measure into array. + */ + static int +-measure_patches( IMAGE *im, double *coeff, +- int left, int top, int width, int height, +- int u, int v, int *sel, int nsel ) +-{ ++measure_patches(IMAGE *im, double *coeff, ++ int left, int top, int width, int height, ++ int u, int v, int *sel, int nsel) ++{ + IMAGE *tmp; + int patch; + int i, j; +@@ -88,19 +88,19 @@ measure_patches( IMAGE *im, double *coeff, + + /* Loop through sel, picking out areas to measure. + */ +- for( j = 0, patch = 0; patch < nsel; patch++ ) { ++ for (j = 0, patch = 0; patch < nsel; patch++) { + /* Sanity check. Is the patch number sensible? + */ +- if( sel[patch] <= 0 || sel[patch] > u * v ) { +- im_error( "im_measure", +- _( "patch %d is out of range" ), +- sel[patch] ); +- return( 1 ); ++ if (sel[patch] <= 0 || sel[patch] > u * v) { ++ im_error("im_measure", ++ _("patch %d is out of range"), ++ sel[patch]); ++ return (1); + } + + /* Patch coordinates. + */ +- m = (sel[patch] - 1) % u; ++ m = (sel[patch] - 1) % u; + n = (sel[patch] - 1) / u; + + /* Move sub to correct position. +@@ -110,21 +110,21 @@ measure_patches( IMAGE *im, double *coeff, + + /* Loop through bands. + */ +- for( i = 0; i < im->Bands; i++, j++ ) { ++ for (i = 0; i < im->Bands; i++, j++) { + /* Make temp buffer to extract to. + */ +- if( !(tmp = im_open( "patch", "t" )) ) +- return( -1 ); +- ++ if (!(tmp = im_open("patch", "t"))) ++ return (-1); ++ + /* Extract and measure. + */ +- if( im_extract_areabands( im, tmp, x, y, w, h, i, 1 ) || +- im_avg( tmp, &avg ) || +- im_deviate( tmp, &dev ) ) { +- im_close( tmp ); +- return( -1 ); ++ if (im_extract_areabands(im, tmp, x, y, w, h, i, 1) || ++ im_avg(tmp, &avg) || ++ im_deviate(tmp, &dev)) { ++ im_close(tmp); ++ return (-1); + } +- im_close( tmp ); ++ im_close(tmp); + + /* Is the deviation large compared with the average? + * This could be a clue that our parameters have +@@ -132,11 +132,11 @@ measure_patches( IMAGE *im, double *coeff, + * <0, or averages near zero (can get these if use + * im_measure() on IM_TYPE_LAB images). + */ +- if( dev * 5 > fabs( avg ) && fabs( avg ) > 3 ) +- im_warn( "im_measure", +- _( "patch %d, band %d: " +- "avg = %g, sdev = %g" ), +- patch, i, avg, dev ); ++ if (dev * 5 > fabs(avg) && fabs(avg) > 3) ++ im_warn("im_measure", ++ _("patch %d, band %d: " ++ "avg = %g, sdev = %g"), ++ patch, i, avg, dev); + + /* Save results. + */ +@@ -144,93 +144,93 @@ measure_patches( IMAGE *im, double *coeff, + } + } + +- return( 0 ); ++ return (0); + } + + static DOUBLEMASK * +-internal_im_measure_area( IMAGE *im, +- int left, int top, int width, int height, +- int u, int v, +- int *sel, int nsel, const char *name ) +-{ ++internal_im_measure_area(IMAGE *im, ++ int left, int top, int width, int height, ++ int u, int v, ++ int *sel, int nsel, const char *name) ++{ + DOUBLEMASK *mask; + +- if( im_check_uncoded( "im_measure", im ) || +- im_check_noncomplex( "im_measure", im ) ) +- return( NULL ); ++ if (im_check_uncoded("im_measure", im) || ++ im_check_noncomplex("im_measure", im)) ++ return (NULL); + + /* Default to all patches if sel == NULL. + */ +- if( sel == NULL ) { ++ if (sel == NULL) { + int i; + + nsel = u * v; +- if( !(sel = IM_ARRAY( im, nsel, int )) ) +- return( NULL ); +- for( i = 0; i < nsel; i++ ) ++ if (!(sel = IM_ARRAY(im, nsel, int))) ++ return (NULL); ++ for (i = 0; i < nsel; i++) + sel[i] = i + 1; + } + + /* What size mask do we need? + */ +- if( !(mask = im_create_dmask( name, im->Bands, nsel )) ) +- return( NULL ); ++ if (!(mask = im_create_dmask(name, im->Bands, nsel))) ++ return (NULL); + + /* Perform measure and return. + */ +- if( measure_patches( im, mask->coeff, left, top, width, height, +- u, v, sel, nsel ) ) { +- im_free_dmask( mask ); +- return( NULL ); ++ if (measure_patches(im, mask->coeff, left, top, width, height, ++ u, v, sel, nsel)) { ++ im_free_dmask(mask); ++ return (NULL); + } + +- return( mask ); ++ return (mask); + } + + DOUBLEMASK * +-im_measure_area( IMAGE *im, +- int left, int top, int width, int height, +- int u, int v, +- int *sel, int nsel, const char *name ) ++im_measure_area(IMAGE *im, ++ int left, int top, int width, int height, ++ int u, int v, ++ int *sel, int nsel, const char *name) + { + DOUBLEMASK *mask; + VipsImage *t; + + /* The old im_measure() worked on labq. + */ +- if( im->Coding == IM_CODING_LABQ ) { +- if( !(t = im_open( "measure-temp", "p" )) ) +- return( NULL ); +- if( im_LabQ2Lab( im, t ) || +- !(mask = im_measure_area( t, +- left, top, width, height, +- u, v, +- sel, nsel, name )) ) { +- g_object_unref( t ); +- return( NULL ); ++ if (im->Coding == IM_CODING_LABQ) { ++ if (!(t = im_open("measure-temp", "p"))) ++ return (NULL); ++ if (im_LabQ2Lab(im, t) || ++ !(mask = im_measure_area(t, ++ left, top, width, height, ++ u, v, ++ sel, nsel, name))) { ++ g_object_unref(t); ++ return (NULL); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( mask ); ++ return (mask); + } + +- if( sel ) +- return( internal_im_measure_area( im, +- left, top, width, height, u, v, sel, nsel, name ) ); ++ if (sel) ++ return (internal_im_measure_area(im, ++ left, top, width, height, u, v, sel, nsel, name)); + else { +- if( vips_measure( im, &t, u, v, +- "left", left, +- "top", top, +- "width", width, +- "height", height, +- NULL ) ) +- return( NULL ); +- if( !(mask = im_vips2mask( t, name )) ) { +- g_object_unref( t ); +- return( NULL ); ++ if (vips_measure(im, &t, u, v, ++ "left", left, ++ "top", top, ++ "width", width, ++ "height", height, ++ NULL)) ++ return (NULL); ++ if (!(mask = im_vips2mask(t, name))) { ++ g_object_unref(t); ++ return (NULL); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( mask ); ++ return (mask); + } + } +diff --git a/libvips/deprecated/im_nifti2vips.c b/libvips/deprecated/im_nifti2vips.c +index 951616a94c..874b9cbc12 100644 +--- a/libvips/deprecated/im_nifti2vips.c ++++ b/libvips/deprecated/im_nifti2vips.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,50 +51,50 @@ + #include + + static int +-im_nifti2vips( const char *name, IMAGE *out ) ++im_nifti2vips(const char *name, IMAGE *out) + { + VipsImage *t; + +- if( vips_niftiload( name, &t, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_niftiload(name, &t, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-static const char *nifti_suffs[] = { +- ".nii", ".nii.gz", +- ".hdr", ".hdr.gz", +- ".img", ".img.gz", +- ".nia", ".nia.gz", +- NULL ++static const char *nifti_suffs[] = { ++ ".nii", ".nii.gz", ++ ".hdr", ".hdr.gz", ++ ".img", ".img.gz", ++ ".nia", ".nia.gz", ++ NULL + }; + + static VipsFormatFlags +-nifti_flags( const char *name ) ++nifti_flags(const char *name) + { + char filename[FILENAME_MAX]; + char mode[FILENAME_MAX]; + +- im_filename_split( name, filename, mode ); ++ im_filename_split(name, filename, mode); + +- return( (VipsFormatFlags) +- vips_foreign_flags( "niftiload", filename ) ); ++ return ((VipsFormatFlags) ++ vips_foreign_flags("niftiload", filename)); + } + + static int +-isnifti( const char *name ) ++isnifti(const char *name) + { + char filename[FILENAME_MAX]; + char mode[FILENAME_MAX]; + +- im_filename_split( name, filename, mode ); ++ im_filename_split(name, filename, mode); + +- return( vips_foreign_is_a( "niftiload", filename ) ); ++ return (vips_foreign_is_a("niftiload", filename)); + } + + /* nifti format adds no new members. +@@ -103,13 +103,13 @@ typedef VipsFormat VipsFormatNifti; + typedef VipsFormatClass VipsFormatNiftiClass; + + static void +-vips_format_nifti_class_init( VipsFormatNiftiClass *class ) ++vips_format_nifti_class_init(VipsFormatNiftiClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsFormatClass *format_class = (VipsFormatClass *) class; + + object_class->nickname = "im_nifti"; +- object_class->description = _( "NIfTI" ); ++ object_class->description = _("NIfTI"); + + format_class->priority = 100; + format_class->is_a = isnifti; +@@ -119,9 +119,8 @@ vips_format_nifti_class_init( VipsFormatNiftiClass *class ) + } + + static void +-vips_format_nifti_init( VipsFormatNifti *object ) ++vips_format_nifti_init(VipsFormatNifti *object) + { + } + +-G_DEFINE_TYPE( VipsFormatNifti, vips_format_nifti, VIPS_TYPE_FORMAT ); +- ++G_DEFINE_TYPE(VipsFormatNifti, vips_format_nifti, VIPS_TYPE_FORMAT); +diff --git a/libvips/deprecated/im_openslide2vips.c b/libvips/deprecated/im_openslide2vips.c +index f9a58244aa..516570b403 100644 +--- a/libvips/deprecated/im_openslide2vips.c ++++ b/libvips/deprecated/im_openslide2vips.c +@@ -10,28 +10,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -55,7 +55,7 @@ + #include + + static int +-im_openslide2vips( const char *name, IMAGE *out ) ++im_openslide2vips(const char *name, IMAGE *out) + { + char filename[FILENAME_MAX]; + char mode[FILENAME_MAX]; +@@ -65,67 +65,67 @@ im_openslide2vips( const char *name, IMAGE *out ) + char *endptr; + VipsImage *t; + +- im_filename_split( name, filename, mode ); ++ im_filename_split(name, filename, mode); + level = 0; + associated = NULL; + p = &mode[0]; +- if( (q = im_getnextoption( &p )) ) { +- level = strtoul( q, &endptr, 10 ); +- if( *endptr ) { +- vips_error( "openslide2vips", "%s", +- _( "level must be a number" ) ); +- return( -1 ); ++ if ((q = im_getnextoption(&p))) { ++ level = strtoul(q, &endptr, 10); ++ if (*endptr) { ++ vips_error("openslide2vips", "%s", ++ _("level must be a number")); ++ return (-1); + } + } +- if( (q = im_getnextoption( &p )) ) ++ if ((q = im_getnextoption(&p))) + associated = q; + +- if( vips_openslideload( filename, &t, +- "level", level, +- "associated", associated, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_openslideload(filename, &t, ++ "level", level, ++ "associated", associated, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-static const char *openslide_suffs[] = { +- ".svs", /* Aperio */ +- ".vms", ".vmu", ".ndpi", /* Hamamatsu */ +- ".scn", /* Leica */ +- ".mrxs", /* MIRAX */ +- ".svslide", /* Sakura */ +- ".tif", /* Trestle */ +- ".bif", /* Ventana */ ++static const char *openslide_suffs[] = { ++ ".svs", /* Aperio */ ++ ".vms", ".vmu", ".ndpi", /* Hamamatsu */ ++ ".scn", /* Leica */ ++ ".mrxs", /* MIRAX */ ++ ".svslide", /* Sakura */ ++ ".tif", /* Trestle */ ++ ".bif", /* Ventana */ + NULL + }; + + static VipsFormatFlags +-openslide_flags( const char *name ) ++openslide_flags(const char *name) + { + char filename[FILENAME_MAX]; + char mode[FILENAME_MAX]; + +- im_filename_split( name, filename, mode ); ++ im_filename_split(name, filename, mode); + +- return( (VipsFormatFlags) +- vips_foreign_flags( "openslideload", filename ) ); ++ return ((VipsFormatFlags) ++ vips_foreign_flags("openslideload", filename)); + } + + static int +-isopenslide( const char *name ) ++isopenslide(const char *name) + { + char filename[FILENAME_MAX]; + char mode[FILENAME_MAX]; + +- im_filename_split( name, filename, mode ); ++ im_filename_split(name, filename, mode); + +- return( vips_foreign_is_a( "openslideload", filename ) ); ++ return (vips_foreign_is_a("openslideload", filename)); + } + + /* openslide format adds no new members. +@@ -134,13 +134,13 @@ typedef VipsFormat VipsFormatOpenslide; + typedef VipsFormatClass VipsFormatOpenslideClass; + + static void +-vips_format_openslide_class_init( VipsFormatOpenslideClass *class ) ++vips_format_openslide_class_init(VipsFormatOpenslideClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsFormatClass *format_class = (VipsFormatClass *) class; + + object_class->nickname = "im_openslide"; +- object_class->description = _( "Openslide" ); ++ object_class->description = _("Openslide"); + + format_class->priority = 100; + format_class->is_a = isopenslide; +@@ -150,9 +150,8 @@ vips_format_openslide_class_init( VipsFormatOpenslideClass *class ) + } + + static void +-vips_format_openslide_init( VipsFormatOpenslide *object ) ++vips_format_openslide_init(VipsFormatOpenslide *object) + { + } + +-G_DEFINE_TYPE( VipsFormatOpenslide, vips_format_openslide, VIPS_TYPE_FORMAT ); +- ++G_DEFINE_TYPE(VipsFormatOpenslide, vips_format_openslide, VIPS_TYPE_FORMAT); +diff --git a/libvips/deprecated/im_png2vips.c b/libvips/deprecated/im_png2vips.c +index 9fca8a5f73..1e90aa5c2b 100644 +--- a/libvips/deprecated/im_png2vips.c ++++ b/libvips/deprecated/im_png2vips.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -49,29 +49,29 @@ + #include "../foreign/pforeign.h" + + int +-im_png2vips( const char *name, IMAGE *out ) ++im_png2vips(const char *name, IMAGE *out) + { + char filename[FILENAME_MAX]; + char mode[FILENAME_MAX]; + VipsImage *x; + +- im_filename_split( name, filename, mode ); ++ im_filename_split(name, filename, mode); + +- if( vips_pngload( filename, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- VIPS_UNREF( x ); +- return( -1 ); ++ if (vips_pngload(filename, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ VIPS_UNREF(x); ++ return (-1); + } +- VIPS_UNREF( x ); ++ VIPS_UNREF(x); + +- return( 0 ); ++ return (0); + } + + static int +-ispng( const char *filename ) ++ispng(const char *filename) + { +- return( vips_foreign_is_a( "pngload", filename ) ); ++ return (vips_foreign_is_a("pngload", filename)); + } + + static const char *png_suffs[] = { ".png", NULL }; +@@ -80,13 +80,13 @@ typedef VipsFormat VipsFormatPng; + typedef VipsFormatClass VipsFormatPngClass; + + static void +-vips_format_png_class_init( VipsFormatPngClass *class ) ++vips_format_png_class_init(VipsFormatPngClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsFormatClass *format_class = (VipsFormatClass *) class; + + object_class->nickname = "png"; +- object_class->description = _( "PNG" ); ++ object_class->description = _("PNG"); + + format_class->is_a = ispng; + format_class->load = im_png2vips; +@@ -95,9 +95,8 @@ vips_format_png_class_init( VipsFormatPngClass *class ) + } + + static void +-vips_format_png_init( VipsFormatPng *object ) ++vips_format_png_init(VipsFormatPng *object) + { + } + +-G_DEFINE_TYPE( VipsFormatPng, vips_format_png, VIPS_TYPE_FORMAT ); +- ++G_DEFINE_TYPE(VipsFormatPng, vips_format_png, VIPS_TYPE_FORMAT); +diff --git a/libvips/deprecated/im_point_bilinear.c b/libvips/deprecated/im_point_bilinear.c +index 6c91c0fccf..96788dd2c2 100644 +--- a/libvips/deprecated/im_point_bilinear.c ++++ b/libvips/deprecated/im_point_bilinear.c +@@ -12,28 +12,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -63,37 +63,37 @@ + * + * Returns: 0 on success, -1 on error + */ +-int +-im_point( IMAGE *im, VipsInterpolate *interpolate, +- double x, double y, int band, double *out ) ++int ++im_point(IMAGE *im, VipsInterpolate *interpolate, ++ double x, double y, int band, double *out) + { + IMAGE *mem; + IMAGE *t[2]; + +- if( band >= im->Bands || +- x < 0.0 || y < 0.0 || +- x > im->Xsize || y > im->Ysize ) { +- im_error( "im_point_bilinear", "%s", +- _( "coords outside image" ) ); +- return( -1 ); ++ if (band >= im->Bands || ++ x < 0.0 || y < 0.0 || ++ x > im->Xsize || y > im->Ysize) { ++ im_error("im_point_bilinear", "%s", ++ _("coords outside image")); ++ return (-1); + } + +- if( !(mem = im_open( "im_point", "p" )) ) +- return( -1 ); +- if( im_open_local_array( mem, t, 2, "im_point", "p" ) || +- im_extract_band( im, t[0], band ) || +- im_affinei( t[0], t[1], ++ if (!(mem = im_open("im_point", "p"))) ++ return (-1); ++ if (im_open_local_array(mem, t, 2, "im_point", "p") || ++ im_extract_band(im, t[0], band) || ++ im_affinei(t[0], t[1], + interpolate, + 1, 0, 0, 1, +- floor( x ) - x, floor( y ) - y, +- floor( x ), floor( y ), 1, 1 ) || +- im_avg( t[1], out ) ) { +- im_close( mem ); +- return( -1 ); ++ floor(x) - x, floor(y) - y, ++ floor(x), floor(y), 1, 1) || ++ im_avg(t[1], out)) { ++ im_close(mem); ++ return (-1); + } +- im_close( mem ); ++ im_close(mem); + +- return( 0 ); ++ return (0); + } + + /** +@@ -105,16 +105,15 @@ im_point( IMAGE *im, VipsInterpolate *interpolate, + * @out: return interpolated value + * + * Find the value at (@x,@y) in given band of image. +- * Use bilinear interpolation if @x or @y are non-integral. ++ * Use bilinear interpolation if @x or @y are non-integral. + * + * See also: im_avg(), im_point(). + * + * Returns: 0 on success, -1 on error + */ +-int +-im_point_bilinear( IMAGE *im, double x, double y, int band, double *out ) ++int ++im_point_bilinear(IMAGE *im, double x, double y, int band, double *out) + { +- return( im_point( im, vips_interpolate_bilinear_static(), +- x, y, band, out ) ); ++ return (im_point(im, vips_interpolate_bilinear_static(), ++ x, y, band, out)); + } +- +diff --git a/libvips/deprecated/im_ppm2vips.c b/libvips/deprecated/im_ppm2vips.c +index fdc782d580..85702f2640 100644 +--- a/libvips/deprecated/im_ppm2vips.c ++++ b/libvips/deprecated/im_ppm2vips.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -40,32 +40,32 @@ + #include + + int +-im_ppm2vips( const char *filename, IMAGE *out ) ++im_ppm2vips(const char *filename, IMAGE *out) + { + VipsImage *t; + +- if( vips_ppmload( filename, &t, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_ppmload(filename, &t, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + static int +-isppm( const char *filename ) ++isppm(const char *filename) + { +- return( vips_foreign_is_a( "ppmload", filename ) ); ++ return (vips_foreign_is_a("ppmload", filename)); + } + + static VipsFormatFlags +-ppm_flags( const char *filename ) ++ppm_flags(const char *filename) + { +- return( (VipsFormatFlags) +- vips_foreign_flags( "ppmload", filename ) ); ++ return ((VipsFormatFlags) ++ vips_foreign_flags("ppmload", filename)); + } + + static const char *ppm_suffs[] = { ".ppm", ".pgm", ".pbm", ".pfm", NULL }; +@@ -76,13 +76,13 @@ typedef VipsFormat VipsFormatPpm; + typedef VipsFormatClass VipsFormatPpmClass; + + static void +-vips_format_ppm_class_init( VipsFormatPpmClass *class ) ++vips_format_ppm_class_init(VipsFormatPpmClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsFormatClass *format_class = (VipsFormatClass *) class; + + object_class->nickname = "ppm"; +- object_class->description = _( "PPM/PBM/PNM/PFM" ); ++ object_class->description = _("PPM/PBM/PNM/PFM"); + + format_class->is_a = isppm; + format_class->load = im_ppm2vips; +@@ -92,9 +92,8 @@ vips_format_ppm_class_init( VipsFormatPpmClass *class ) + } + + static void +-vips_format_ppm_init( VipsFormatPpm *object ) ++vips_format_ppm_init(VipsFormatPpm *object) + { + } + +-G_DEFINE_TYPE( VipsFormatPpm, vips_format_ppm, VIPS_TYPE_FORMAT ); +- ++G_DEFINE_TYPE(VipsFormatPpm, vips_format_ppm, VIPS_TYPE_FORMAT); +diff --git a/libvips/deprecated/im_print.c b/libvips/deprecated/im_print.c +index fd2b13c37b..28a64a6002 100644 +--- a/libvips/deprecated/im_print.c ++++ b/libvips/deprecated/im_print.c +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -42,9 +42,9 @@ + * language bindings. + */ + int +-im_print( const char *message ) ++im_print(const char *message) + { +- printf( "%s\n", message ); ++ printf("%s\n", message); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/deprecated/im_printlines.c b/libvips/deprecated/im_printlines.c +index f033c78996..177a6ac222 100644 +--- a/libvips/deprecated/im_printlines.c ++++ b/libvips/deprecated/im_printlines.c +@@ -21,28 +21,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -56,94 +56,116 @@ + #include + #include + +-/* Useful: Call a macro with the name, type pairs for all VIPS functions. ++/* Useful: Call a macro with the name, type pairs for all VIPS functions. + */ + #define im_for_all_types() \ +- case IM_BANDFMT_UCHAR: loopuc(unsigned char); break; \ +- case IM_BANDFMT_CHAR: loop(char); break; \ +- case IM_BANDFMT_USHORT: loop(unsigned short); break; \ +- case IM_BANDFMT_SHORT: loop(short); break; \ +- case IM_BANDFMT_UINT: loop(unsigned int); break; \ +- case IM_BANDFMT_INT: loop(int); break; \ +- case IM_BANDFMT_FLOAT: loop(float); break; \ +- case IM_BANDFMT_DOUBLE: loop(double); break; \ +- case IM_BANDFMT_COMPLEX: loopcmplx(float); break; \ +- case IM_BANDFMT_DPCOMPLEX: loopcmplx(double); break; +- +-int +-im_printlines( IMAGE *in ) ++ case IM_BANDFMT_UCHAR: \ ++ loopuc(unsigned char); \ ++ break; \ ++ case IM_BANDFMT_CHAR: \ ++ loop(char); \ ++ break; \ ++ case IM_BANDFMT_USHORT: \ ++ loop(unsigned short); \ ++ break; \ ++ case IM_BANDFMT_SHORT: \ ++ loop(short); \ ++ break; \ ++ case IM_BANDFMT_UINT: \ ++ loop(unsigned int); \ ++ break; \ ++ case IM_BANDFMT_INT: \ ++ loop(int); \ ++ break; \ ++ case IM_BANDFMT_FLOAT: \ ++ loop(float); \ ++ break; \ ++ case IM_BANDFMT_DOUBLE: \ ++ loop(double); \ ++ break; \ ++ case IM_BANDFMT_COMPLEX: \ ++ loopcmplx(float); \ ++ break; \ ++ case IM_BANDFMT_DPCOMPLEX: \ ++ loopcmplx(double); \ ++ break; ++ ++int ++im_printlines(IMAGE *in) + { +- if( im_incheck( in ) ) +- return( -1 ); +- if( in->Coding != IM_CODING_NONE ) { +- im_error( "im_printlines", "%s", _( "input must be uncoded" ) ); +- return( -1 ); ++ if (im_incheck(in)) ++ return (-1); ++ if (in->Coding != IM_CODING_NONE) { ++ im_error("im_printlines", "%s", _("input must be uncoded")); ++ return (-1); + } +- if( !in->data ) { +- im_error( "im_debugim", "%s", _( "unsuitable image type" ) ); +- return( -1 ); ++ if (!in->data) { ++ im_error("im_debugim", "%s", _("unsuitable image type")); ++ return (-1); + } + + /* What type? First define the loop we want to perform for all types. */ + #define loopuc(TYPE) \ +- { TYPE *p = (TYPE *) in->data; \ ++ { \ ++ TYPE *p = (TYPE *) in->data; \ + int x, y, z; \ +- \ +- for ( y=0; yYsize; y++ ) {\ ++\ ++ for (y = 0; y < in->Ysize; y++) { \ + fprintf(stderr, "line:%5d\n", y); \ +- for ( x=0; xXsize; x++ ) {\ ++ for (x = 0; x < in->Xsize; x++) { \ + fprintf(stderr, "%5d", x); \ +- for ( z=0; zBands; z++ ) {\ +- fprintf(stderr, "\t%4d", (TYPE)*p++ );\ ++ for (z = 0; z < in->Bands; z++) { \ ++ fprintf(stderr, "\t%4d", (TYPE) *p++); \ + } \ + fprintf(stderr, "\n"); \ + } \ + } \ +- } ++ } + + #define loop(TYPE) \ +- { TYPE *p = (TYPE *) in->data; \ ++ { \ ++ TYPE *p = (TYPE *) in->data; \ + int x, y, z; \ +- \ +- for ( y=0; yYsize; y++ ) {\ ++\ ++ for (y = 0; y < in->Ysize; y++) { \ + fprintf(stderr, "line:%5d\n", y); \ +- for ( x=0; xXsize; x++ ) {\ ++ for (x = 0; x < in->Xsize; x++) { \ + fprintf(stderr, "%5d", x); \ +- for ( z=0; zBands; z++ ) {\ +- fprintf(stderr, "\t%f", (double)*p++ );\ ++ for (z = 0; z < in->Bands; z++) { \ ++ fprintf(stderr, "\t%f", (double) *p++); \ + } \ + fprintf(stderr, "\n"); \ + } \ + } \ +- } ++ } + + #define loopcmplx(TYPE) \ +- { TYPE *p = (TYPE *) in->data; \ ++ { \ ++ TYPE *p = (TYPE *) in->data; \ + int x, y, z; \ +- \ +- for ( y=0; yYsize; y++ ) {\ ++\ ++ for (y = 0; y < in->Ysize; y++) { \ + fprintf(stderr, "line:%5d\n", y); \ +- for ( x=0; xXsize; x++ ) {\ ++ for (x = 0; x < in->Xsize; x++) { \ + fprintf(stderr, "%5d", x); \ +- for ( z=0; zBands; z++ ) {\ +- fprintf(stderr,"\t%f",(double)*p++);\ +- fprintf(stderr,"\t%f",(double)*p++);\ ++ for (z = 0; z < in->Bands; z++) { \ ++ fprintf(stderr, "\t%f", (double) *p++); \ ++ fprintf(stderr, "\t%f", (double) *p++); \ + } \ +- fprintf(stderr, "\n");\ ++ fprintf(stderr, "\n"); \ + } \ + } \ +- } ++ } + +-/* Now generate code for all types. */ +- switch( in->BandFmt ) { ++ /* Now generate code for all types. */ ++ switch (in->BandFmt) { + im_for_all_types(); +- default: { +- im_error( "im_printlines", "%s", +- _( "unknown input format" ) ); +- return( -1 ); +- } ++ default: { ++ im_error("im_printlines", "%s", ++ _("unknown input format")); ++ return (-1); ++ } + } + +- return( 0 ); +- ++ return (0); + } +diff --git a/libvips/deprecated/im_resize_linear.c b/libvips/deprecated/im_resize_linear.c +index 3054cc46ba..4073522e01 100644 +--- a/libvips/deprecated/im_resize_linear.c ++++ b/libvips/deprecated/im_resize_linear.c +@@ -13,28 +13,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -52,140 +52,154 @@ + + /* What we do for each pel. + */ +-#define LOOP( TYPE ) \ +- if( Xint >= 0 && Yint >=0 && \ +- Xint < in->Xsize-1 && Yint < in->Ysize-1 ) \ +- for( bb = 0; bb < in->Bands; bb++ ) { \ ++#define LOOP(TYPE) \ ++ if (Xint >= 0 && Yint >= 0 && \ ++ Xint < in->Xsize - 1 && Yint < in->Ysize - 1) \ ++ for (bb = 0; bb < in->Bands; bb++) { \ + TYPE s1 = *((TYPE *) p); \ + TYPE s2 = *((TYPE *) (p + ips)); \ + TYPE s3 = *((TYPE *) (p + ils)); \ + TYPE s4 = *((TYPE *) (p + ips + ils)); \ + TYPE *t = (TYPE *) q; \ +- \ +- *t = (1-dx)*(1-dy)*s1 + dx*(1-dy)*s2 + \ +- dy*(1-dx)*s3 + dx*dy*s4; \ +- \ ++\ ++ *t = (1 - dx) * (1 - dy) * s1 + dx * (1 - dy) * s2 + \ ++ dy * (1 - dx) * s3 + dx * dy * s4; \ ++\ + p += ies; \ + q += oes; \ + } \ +- else if( Xint == in->Xsize-1 && Yint >= 0 && Yint < in->Ysize - 1 ) \ +- for( bb = 0; bb < in->Bands; bb++ ) { \ ++ else if (Xint == in->Xsize - 1 && Yint >= 0 && Yint < in->Ysize - 1) \ ++ for (bb = 0; bb < in->Bands; bb++) { \ + TYPE s1 = *((TYPE *) p); \ + TYPE s3 = *((TYPE *) (p + ils)); \ + TYPE *t = (TYPE *) q; \ +- \ +- *t = (1-dy)*s1 + dy*s3; \ +- \ ++\ ++ *t = (1 - dy) * s1 + dy * s3; \ ++\ + p += ies; \ + q += oes; \ + } \ +- else if( Yint == in->Ysize-1 && Xint >= 0 && Xint < in->Xsize - 1 ) \ +- for( bb = 0; bb < in->Bands; bb++ ) { \ ++ else if (Yint == in->Ysize - 1 && Xint >= 0 && Xint < in->Xsize - 1) \ ++ for (bb = 0; bb < in->Bands; bb++) { \ + TYPE s1 = *((TYPE *) p); \ + TYPE s2 = *((TYPE *) (p + ips)); \ + TYPE *t = (TYPE *) q; \ +- \ +- *t = (1-dx)*s1 + dx*s2; \ +- \ ++\ ++ *t = (1 - dx) * s1 + dx * s2; \ ++\ + p += ies; \ + q += oes; \ + } \ +- else \ +- for( bb = 0; bb < in->Bands; bb++ ) { \ ++ else \ ++ for (bb = 0; bb < in->Bands; bb++) { \ + unsigned char s1 = *((unsigned char *) p); \ + TYPE *t = (TYPE *) q; \ +- \ ++\ + *t = s1; \ +- \ ++\ + p += ies; \ + q += oes; \ +- } ++ } + +-int +-im_resize_linear( IMAGE *in, IMAGE *out, int X, int Y ) ++int ++im_resize_linear(IMAGE *in, IMAGE *out, int X, int Y) + { +- double dx, dy, xscale, yscale; +- double Xnew, Ynew; /* inv. coord. of the interpolated pt */ ++ double dx, dy, xscale, yscale; ++ double Xnew, Ynew; /* inv. coord. of the interpolated pt */ + +- int x, y; +- int Xint, Yint; +- int bb; ++ int x, y; ++ int Xint, Yint; ++ int bb; + +- PEL *input, *opline; +- PEL *q, *p; ++ PEL *input, *opline; ++ PEL *q, *p; + +- int ils, ips, ies; /* Input and output line, pel and */ +- int ols, oes; /* element sizes */ ++ int ils, ips, ies; /* Input and output line, pel and */ ++ int ols, oes; /* element sizes */ + +- if( im_iocheck( in, out ) ) +- return( -1 ); +- if( vips_band_format_iscomplex( in->BandFmt ) ) { +- im_error( "im_lowpass", "%s", _( "non-complex input only" ) ); +- return( -1 ); ++ if (im_iocheck(in, out)) ++ return (-1); ++ if (vips_band_format_iscomplex(in->BandFmt)) { ++ im_error("im_lowpass", "%s", _("non-complex input only")); ++ return (-1); + } +- if( in->Coding != IM_CODING_NONE ) { +- im_error("im_lowpass: ", "%s", _( "put should be uncoded") ); +- return( -1 ); ++ if (in->Coding != IM_CODING_NONE) { ++ im_error("im_lowpass: ", "%s", _("put should be uncoded")); ++ return (-1); + } +- if( im_cp_desc( out, in ) ) +- return( -1 ); ++ if (im_cp_desc(out, in)) ++ return (-1); + + out->Xsize = X; + out->Ysize = Y; + +- if( im_setupout( out ) ) +- return( -1 ); +- +- ils = IM_IMAGE_SIZEOF_LINE( in ); +- ips = IM_IMAGE_SIZEOF_PEL( in ); +- ies = IM_IMAGE_SIZEOF_ELEMENT( in ); +- +- ols = IM_IMAGE_SIZEOF_LINE( out ); +- oes = IM_IMAGE_SIZEOF_ELEMENT( out ); +- +-/* buffer lines +-***************/ +- if( !(opline = IM_ARRAY( out, ols, PEL )) ) +- return( -1 ); +- +-/* Resampling +-*************/ +- input = (PEL*) in->data; +- xscale = ((double)in->Xsize-1)/(X-1); +- yscale = ((double)in->Ysize-1)/(Y-1); +- +-for (y=0; yBandFmt ) { +- case IM_BANDFMT_UCHAR: LOOP( unsigned char); break; +- case IM_BANDFMT_USHORT: LOOP( unsigned short ); break; +- case IM_BANDFMT_UINT: LOOP( unsigned int ); break; +- case IM_BANDFMT_CHAR: LOOP( signed char ); break; +- case IM_BANDFMT_SHORT: LOOP( signed short ); break; +- case IM_BANDFMT_INT: LOOP( signed int ); break; +- case IM_BANDFMT_FLOAT: LOOP( float ); break; +- case IM_BANDFMT_DOUBLE: LOOP( double ); break; +- +- default: +- im_error( "im_lowpass", "%s", _( "unsupported image type" ) ); +- return( -1 ); +- /*NOTREACHED*/ ++ if (im_setupout(out)) ++ return (-1); ++ ++ ils = IM_IMAGE_SIZEOF_LINE(in); ++ ips = IM_IMAGE_SIZEOF_PEL(in); ++ ies = IM_IMAGE_SIZEOF_ELEMENT(in); ++ ++ ols = IM_IMAGE_SIZEOF_LINE(out); ++ oes = IM_IMAGE_SIZEOF_ELEMENT(out); ++ ++ /* buffer lines ++ ***************/ ++ if (!(opline = IM_ARRAY(out, ols, PEL))) ++ return (-1); ++ ++ /* Resampling ++ *************/ ++ input = (PEL *) in->data; ++ xscale = ((double) in->Xsize - 1) / (X - 1); ++ yscale = ((double) in->Ysize - 1) / (Y - 1); ++ ++ for (y = 0; y < Y; y++) { ++ q = opline; ++ for (x = 0; x < X; x++) { ++ Xnew = x * xscale; ++ Ynew = y * yscale; ++ Xint = floor(Xnew); ++ Yint = floor(Ynew); ++ dx = Xnew - Xint; ++ dy = Ynew - Yint; ++ p = input + Xint * ips + Yint * ils; ++ ++ switch (in->BandFmt) { ++ case IM_BANDFMT_UCHAR: ++ LOOP(unsigned char); ++ break; ++ case IM_BANDFMT_USHORT: ++ LOOP(unsigned short); ++ break; ++ case IM_BANDFMT_UINT: ++ LOOP(unsigned int); ++ break; ++ case IM_BANDFMT_CHAR: ++ LOOP(signed char); ++ break; ++ case IM_BANDFMT_SHORT: ++ LOOP(signed short); ++ break; ++ case IM_BANDFMT_INT: ++ LOOP(signed int); ++ break; ++ case IM_BANDFMT_FLOAT: ++ LOOP(float); ++ break; ++ case IM_BANDFMT_DOUBLE: ++ LOOP(double); ++ break; ++ ++ default: ++ im_error("im_lowpass", "%s", _("unsupported image type")); ++ return (-1); ++ /*NOTREACHED*/ ++ } ++ } ++ ++ if (im_writeline(y, out, opline)) ++ return (-1); + } +- } +- +- if (im_writeline(y, out, opline) ) +- return(-1); +- } +-return(0); ++ return (0); + } +diff --git a/libvips/deprecated/im_setbox.c b/libvips/deprecated/im_setbox.c +index 9d00141fa1..ac403f1d52 100644 +--- a/libvips/deprecated/im_setbox.c ++++ b/libvips/deprecated/im_setbox.c +@@ -15,28 +15,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -50,7 +50,8 @@ + #include + #include + +-void im_setbox(IMAGE_BOX *pbox, int xst, int yst, int xsiz, int ysiz, int ch_select) ++void ++im_setbox(IMAGE_BOX *pbox, int xst, int yst, int xsiz, int ysiz, int ch_select) + { + pbox->xstart = xst; + pbox->ystart = yst; +diff --git a/libvips/deprecated/im_simcontr.c b/libvips/deprecated/im_simcontr.c +index e7d032fe81..89c8800958 100644 +--- a/libvips/deprecated/im_simcontr.c ++++ b/libvips/deprecated/im_simcontr.c +@@ -14,28 +14,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -63,77 +63,75 @@ + * + * Returns: 0 on success, -1 on error + */ +-int +-im_simcontr( IMAGE *out, int xsize, int ysize ) ++int ++im_simcontr(IMAGE *out, int xsize, int ysize) + { + int x, y; + unsigned char *line1, *line2, *cpline; + +- +-/* Check input args */ +- if( im_outcheck( out ) ) +- return( -1 ); +- +-/* Set now image properly */ +- im_initdesc(out, xsize, ysize, 1, IM_BBITS_BYTE, IM_BANDFMT_UCHAR, +- IM_CODING_NONE, IM_TYPE_B_W, 1.0, 1.0, 0, 0 ); +- +-/* Set up image checking whether the output is a buffer or a file */ +- if (im_setupout( out ) == -1 ) +- return( -1 ); +-/* Create data */ +- line1 = (unsigned char *)calloc((unsigned)xsize, sizeof(char)); +- line2 = (unsigned char *)calloc((unsigned)xsize, sizeof(char)); +- if ( (line1 == NULL) || (line2 == NULL) ) { +- im_error( "im_simcontr", "%s", _( "calloc failed") ); +- return(-1); } ++ /* Check input args */ ++ if (im_outcheck(out)) ++ return (-1); ++ ++ /* Set now image properly */ ++ im_initdesc(out, xsize, ysize, 1, IM_BBITS_BYTE, IM_BANDFMT_UCHAR, ++ IM_CODING_NONE, IM_TYPE_B_W, 1.0, 1.0, 0, 0); ++ ++ /* Set up image checking whether the output is a buffer or a file */ ++ if (im_setupout(out) == -1) ++ return (-1); ++ /* Create data */ ++ line1 = (unsigned char *) calloc((unsigned) xsize, sizeof(char)); ++ line2 = (unsigned char *) calloc((unsigned) xsize, sizeof(char)); ++ if ((line1 == NULL) || (line2 == NULL)) { ++ im_error("im_simcontr", "%s", _("calloc failed")); ++ return (-1); ++ } + + cpline = line1; +- for (x=0; xCoding != IM_CODING_NONE ) +- { +- im_error( "im_slice", "%s", _( "input should be uncoded") ); +- return( -1 ); +- } +- +-/* Set up the output header. */ +- if( im_cp_desc( out, in ) ) +- { +- im_error( "im_slice", "%s", _( "im_cp_desc failed") ); +- return( -1 ); +- } ++ /* Check our args. */ ++ if (im_iocheck(in, out)) { ++ im_error("im_slice", "%s", _("im_iocheck failed")); ++ return (-1); ++ } ++ if (in->Coding != IM_CODING_NONE) { ++ im_error("im_slice", "%s", _("input should be uncoded")); ++ return (-1); ++ } ++ ++ /* Set up the output header. */ ++ if (im_cp_desc(out, in)) { ++ im_error("im_slice", "%s", _("im_cp_desc failed")); ++ return (-1); ++ } + out->BandFmt = IM_BANDFMT_UCHAR; +- if( im_setupout( out ) ) +- { +- im_error( "im_slice", "%s", _( "im_setupout failed") ); +- return( -1 ); +- } +- +- if ( t1 <= t2 ) +- { thresh1 = t1; thresh2 = t2; } +- else +- { thresh1 = t2; thresh2 = t1; } +-/* Make buffer for building o/p in. */ ++ if (im_setupout(out)) { ++ im_error("im_slice", "%s", _("im_setupout failed")); ++ return (-1); ++ } ++ ++ if (t1 <= t2) { ++ thresh1 = t1; ++ thresh2 = t2; ++ } ++ else { ++ thresh1 = t2; ++ thresh2 = t1; ++ } ++ /* Make buffer for building o/p in. */ + epl = in->Xsize * in->Bands; +- s = epl * sizeof( PEL ); +- if( (bu = (PEL *) im_malloc( out, (unsigned)s )) == NULL ) +- return( -1 ); ++ s = epl * sizeof(PEL); ++ if ((bu = (PEL *) im_malloc(out, (unsigned) s)) == NULL) ++ return (-1); + + /* Define what we do for each band element type. */ +-#define im_slice_loop(TYPE)\ +- { TYPE *a = (TYPE *) in->data;\ +- \ +- for( y = 0; y < in->Ysize; y++ ) {\ +- PEL *b = bu;\ +- \ +- for( x = 0; x < in->Xsize; x++ )\ +- for( z = 0; z < in->Bands; z++ ) {\ +- double f = (double) *a++;\ +- if ( f <= thresh1)\ +- *b++ = (PEL)DARK;\ +- else if ( f > thresh2 )\ +- *b++ = (PEL)BRIGHT;\ ++#define im_slice_loop(TYPE) \ ++ { \ ++ TYPE *a = (TYPE *) in->data; \ ++\ ++ for (y = 0; y < in->Ysize; y++) { \ ++ PEL *b = bu; \ ++\ ++ for (x = 0; x < in->Xsize; x++) \ ++ for (z = 0; z < in->Bands; z++) { \ ++ double f = (double) *a++; \ ++ if (f <= thresh1) \ ++ *b++ = (PEL) DARK; \ ++ else if (f > thresh2) \ ++ *b++ = (PEL) BRIGHT; \ + else \ +- *b++ = (PEL)GREY;\ +- }\ +- \ +- if( im_writeline( y, out, bu ) )\ +- return( -1 );\ +- }\ ++ *b++ = (PEL) GREY; \ ++ } \ ++\ ++ if (im_writeline(y, out, bu)) \ ++ return (-1); \ ++ } \ + } + +-/* Do the above for all image types. */ +- switch( in->BandFmt ) { +- im_for_all_types( im_slice_loop ); ++ /* Do the above for all image types. */ ++ switch (in->BandFmt) { ++ im_for_all_types(im_slice_loop); + + default: +- im_error( "im_slice", "%s", _( "Unknown input format") ); +- return( -1 ); ++ im_error("im_slice", "%s", _("Unknown input format")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/deprecated/im_spatres.c b/libvips/deprecated/im_spatres.c +index d454aa632f..6e3d3117a3 100644 +--- a/libvips/deprecated/im_spatres.c ++++ b/libvips/deprecated/im_spatres.c +@@ -17,28 +17,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -54,93 +54,94 @@ + #include + #include + +-int +-im_spatres( IMAGE *in, IMAGE *out, int step ) ++int ++im_spatres(IMAGE *in, IMAGE *out, int step) + { +- int x, y; /* horizontal and vertical direction */ +- int z; /* 0 <= z < channel */ ++ int x, y; /* horizontal and vertical direction */ ++ int z; /* 0 <= z < channel */ + int i, j; + int rounding, step2, sum; + unsigned char *values; + unsigned char *input, *cpinput, *cp2input, *line, *cpline, *pnt, *cpnt; + int os; + +-/* Check args */ +- if ( step < 1 ) { +- im_error( "im_spatres", _( "Invalid step %d" ), step ); +- return(-1);} ++ /* Check args */ ++ if (step < 1) { ++ im_error("im_spatres", _("Invalid step %d"), step); ++ return (-1); ++ } + +- if ( (in->Xsize/step == 0)||(in->Ysize/step == 0) ) +- {im_error("im_spatres", _( "Invalid step %d" ), step);return(-1);} ++ if ((in->Xsize / step == 0) || (in->Ysize / step == 0)) { ++ im_error("im_spatres", _("Invalid step %d"), step); ++ return (-1); ++ } + + if (im_iocheck(in, out) == -1) +- return( -1 ); +- +- if((in->Coding != IM_CODING_NONE)||(in->BandFmt !=IM_BANDFMT_UCHAR)) { +- im_error( "im_spatres", "%s", _( "wrong input") ); +- return(-1); } +- +-/* Prepare output */ +- if (im_cp_desc(out, in) == -1) +- return( -1 ); +- out->Xsize = in->Xsize - in->Xsize%step; +- out->Ysize = in->Ysize - in->Ysize%step; +- +- if( im_setupout(out) == -1) +- return( -1 ); ++ return (-1); ++ ++ if ((in->Coding != IM_CODING_NONE) || (in->BandFmt != IM_BANDFMT_UCHAR)) { ++ im_error("im_spatres", "%s", _("wrong input")); ++ return (-1); ++ } ++ ++ /* Prepare output */ ++ if (im_cp_desc(out, in) == -1) ++ return (-1); ++ out->Xsize = in->Xsize - in->Xsize % step; ++ out->Ysize = in->Ysize - in->Ysize % step; ++ ++ if (im_setupout(out) == -1) ++ return (-1); + + /* Malloc buffer for one 'line' of input data */ + os = in->Xsize * in->Bands; +- line = (unsigned char *)calloc((unsigned)os, sizeof(char)); ++ line = (unsigned char *) calloc((unsigned) os, sizeof(char)); + /* Malloc space for values */ +- values = (unsigned char *)calloc((unsigned)out->Bands, sizeof(char)); +- if ( line == NULL || values == NULL ) { +- im_error( "im_spatres", "%s", _( "calloc failed") ); +- return(-1); } ++ values = (unsigned char *) calloc((unsigned) out->Bands, sizeof(char)); ++ if (line == NULL || values == NULL) { ++ im_error("im_spatres", "%s", _("calloc failed")); ++ return (-1); ++ } + + step2 = step * step; +- rounding = step2/2; +- input = (unsigned char *)in->data; +- for ( y = 0; y < out->Ysize; y += step ) +- { ++ rounding = step2 / 2; ++ input = (unsigned char *) in->data; ++ for (y = 0; y < out->Ysize; y += step) { + cpinput = input; + input += os * step; + /* do the x loop out->Xsize / step times */ + cpline = line; +- for (x = 0; x < out->Xsize; x += step) +- { ++ for (x = 0; x < out->Xsize; x += step) { + cp2input = cpinput; + cpinput += step * out->Bands; /* ??? */ +- for ( z = 0; z < out->Bands; z++ ) +- { ++ for (z = 0; z < out->Bands; z++) { + pnt = cp2input + z; + sum = 0; +- for ( j = 0; j < step; j++ ) +- { ++ for (j = 0; j < step; j++) { + cpnt = pnt; + pnt += os; +- for ( i = 0; i < step; i++ ) +- { +- sum += (int)*cpnt; ++ for (i = 0; i < step; i++) { ++ sum += (int) *cpnt; + cpnt += out->Bands; +- } + } +- *(values + z) = (PEL)((sum + rounding)/step2); + } ++ *(values + z) = (PEL) ((sum + rounding) / step2); ++ } + /* for this x, write step*bands data */ +- for ( j = 0; j < step; j++ ) +- for ( z = 0; z < out->Bands; z++ ) ++ for (j = 0; j < step; j++) ++ for (z = 0; z < out->Bands; z++) + *cpline++ = *(values + z); +- } ++ } + /* line is now ready. Write now step lines */ + for (j = 0; j < step; j++) +- if ( im_writeline ( y+j, out, (PEL *)line ) == -1 ) +- { +- free ( (char *)line ); free ( (char *)values ); +- return( -1 ); +- } +- } /* end of the for (..y..) loop */ +- +- free ( (char *)line ); free ( (char *)values ); +- return(0); ++ if (im_writeline(y + j, out, (PEL *) line) == -1) { ++ free((char *) line); ++ free((char *) values); ++ return (-1); ++ } ++ } /* end of the for (..y..) loop */ ++ ++ free((char *) line); ++ free((char *) values); ++ return (0); + } +diff --git a/libvips/deprecated/im_stretch3.c b/libvips/deprecated/im_stretch3.c +index f9e8bd1f52..c9269adc9b 100644 +--- a/libvips/deprecated/im_stretch3.c ++++ b/libvips/deprecated/im_stretch3.c +@@ -27,28 +27,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -70,8 +70,8 @@ typedef struct { + IMAGE *in; + double dx, dy; + +- int xoff, yoff; /* Mask we start with for this disp. */ +- int mask[34][4]; /* Fixed-point masks for each output pixel */ ++ int xoff, yoff; /* Mask we start with for this disp. */ ++ int mask[34][4]; /* Fixed-point masks for each output pixel */ + } StretchInfo; + + /* Per-thread info. +@@ -84,43 +84,43 @@ typedef struct seq_info { + } SeqInfo; + + static int +-stretch_stop( void *vseq, void *a, void *b ) ++stretch_stop(void *vseq, void *a, void *b) + { + SeqInfo *seq = (SeqInfo *) vseq; + +- IM_FREEF( im_region_free, seq->ir ); ++ IM_FREEF(im_region_free, seq->ir); + +- return( 0 ); ++ return (0); + } + + static void * +-stretch_start( IMAGE *out, void *a, void *b ) ++stretch_start(IMAGE *out, void *a, void *b) + { + IMAGE *in = (IMAGE *) a; + StretchInfo *sin = (StretchInfo *) b; + SeqInfo *seq; + +- if( !(seq = IM_NEW( out, SeqInfo )) ) +- return( NULL ); ++ if (!(seq = IM_NEW(out, SeqInfo))) ++ return (NULL); + +- seq->sin = sin; +- seq->ir = im_region_create( in ); +- seq->lsk = IM_IMAGE_N_ELEMENTS( out ); +- seq->buf = IM_ARRAY( out, 4*seq->lsk, unsigned short ); ++ seq->sin = sin; ++ seq->ir = im_region_create(in); ++ seq->lsk = IM_IMAGE_N_ELEMENTS(out); ++ seq->buf = IM_ARRAY(out, 4 * seq->lsk, unsigned short); + +- if( !seq->buf || !seq->ir ) { +- stretch_stop( seq, NULL, NULL ); +- return( NULL ); ++ if (!seq->buf || !seq->ir) { ++ stretch_stop(seq, NULL, NULL); ++ return (NULL); + } + +- return( (void *)seq ); ++ return ((void *) seq); + } + + /* Stretch a line of pels into a line in the buffer. + */ + static void +-make_xline( StretchInfo *sin, +- unsigned short *p, unsigned short *q, int w, int m ) ++make_xline(StretchInfo *sin, ++ unsigned short *p, unsigned short *q, int w, int m) + { + int bands = sin->in->Bands; + int tot; +@@ -128,20 +128,20 @@ make_xline( StretchInfo *sin, + + /* Offsets for subsequent pixels. + */ +- int o1 = 1*bands; +- int o2 = 2*bands; +- int o3 = 3*bands; ++ int o1 = 1 * bands; ++ int o2 = 2 * bands; ++ int o3 = 3 * bands; + +- for( x = 0; x < w; x++ ) { ++ for (x = 0; x < w; x++) { + int *mask = &sin->mask[m][0]; + unsigned short *p1 = p; + + /* Loop for this pel. + */ +- for( b = 0; b < bands; b++ ) { +- tot = p1[0]*mask[0] + p1[o1]*mask[1] + +- p1[o2]*mask[2] + p1[o3]*mask[3]; +- tot = IM_MAX( 0, tot ); ++ for (b = 0; b < bands; b++) { ++ tot = p1[0] * mask[0] + p1[o1] * mask[1] + ++ p1[o2] * mask[2] + p1[o3] * mask[3]; ++ tot = IM_MAX(0, tot); + p1++; + *q++ = (tot + 16384) >> 15; + } +@@ -149,7 +149,7 @@ make_xline( StretchInfo *sin, + /* Move to next mask. + */ + m++; +- if( m == 34 ) ++ if (m == 34) + /* Back to mask 0, reuse this input pel. + */ + m = 0; +@@ -164,8 +164,8 @@ make_xline( StretchInfo *sin, + * a line in p, boff is [0,1,2,3] for which buffer line is mask[3]. + */ + static void +-make_yline( StretchInfo *sin, int lsk, int boff, +- unsigned short *p, unsigned short *q, int w, int m ) ++make_yline(StretchInfo *sin, int lsk, int boff, ++ unsigned short *p, unsigned short *q, int w, int m) + { + int bands = sin->in->Bands; + int we = w * bands; +@@ -175,27 +175,27 @@ make_yline( StretchInfo *sin, int lsk, int boff, + + /* Offsets for subsequent pixels. Down a line each time. + */ +- int o0 = lsk*boff; +- int o1 = lsk*((boff + 1) % 4); +- int o2 = lsk*((boff + 2) % 4); +- int o3 = lsk*((boff + 3) % 4); +- +- for( x = 0; x < we; x++ ) { +- tot = p[o0]*mask[0] + p[o1]*mask[1] + +- p[o2]*mask[2] + p[o3]*mask[3]; +- tot = IM_MAX( 0, tot ); ++ int o0 = lsk * boff; ++ int o1 = lsk * ((boff + 1) % 4); ++ int o2 = lsk * ((boff + 2) % 4); ++ int o3 = lsk * ((boff + 3) % 4); ++ ++ for (x = 0; x < we; x++) { ++ tot = p[o0] * mask[0] + p[o1] * mask[1] + ++ p[o2] * mask[2] + p[o3] * mask[3]; ++ tot = IM_MAX(0, tot); + p++; + *q++ = (tot + 16384) >> 15; + } + } + + static int +-stretch_gen( REGION *or, void *vseq, void *a, void *b ) +-{ ++stretch_gen(REGION * or, void *vseq, void *a, void *b) ++{ + SeqInfo *seq = (SeqInfo *) vseq; + StretchInfo *sin = (StretchInfo *) b; + REGION *ir = seq->ir; +- Rect *r = &or->valid; ++ Rect *r = & or->valid; + Rect r1; + int x, y; + +@@ -203,93 +203,93 @@ stretch_gen( REGION *or, void *vseq, void *a, void *b ) + */ + int xstart = (r->left + sin->xoff) % 34; + +- /* What part of input do we need for this output? ++ /* What part of input do we need for this output? + */ + r1.left = r->left - (r->left + sin->xoff) / 34; + r1.top = r->top; +- x = IM_RECT_RIGHT( r ); ++ x = IM_RECT_RIGHT(r); + x = x - (x + sin->xoff) / 34 + 3; + r1.width = x - r1.left; + r1.height = r->height + 3; +- if( im_prepare( ir, &r1 ) ) +- return( -1 ); +- ++ if (im_prepare(ir, &r1)) ++ return (-1); ++ + /* Fill the first three lines of the buffer. + */ +- for( y = 0; y < 3; y++ ) { +- unsigned short *p = (unsigned short *) +- IM_REGION_ADDR( ir, r1.left, y + r1.top ); +- unsigned short *q = seq->buf + seq->lsk*y; ++ for (y = 0; y < 3; y++) { ++ unsigned short *p = (unsigned short *) ++ IM_REGION_ADDR(ir, r1.left, y + r1.top); ++ unsigned short *q = seq->buf + seq->lsk * y; + +- make_xline( sin, p, q, r->width, xstart ); ++ make_xline(sin, p, q, r->width, xstart); + } + + /* Loop for subsequent lines: stretch a new line of x pels, and + * interpolate a line of output from the 3 previous xes plus this new + * one. + */ +- for( y = 0; y < r->height; y++ ) { ++ for (y = 0; y < r->height; y++) { + /* Next line of fresh input pels. + */ +- unsigned short *p = (unsigned short *) +- IM_REGION_ADDR( ir, r1.left, y + r1.top + 3 ); ++ unsigned short *p = (unsigned short *) ++ IM_REGION_ADDR(ir, r1.left, y + r1.top + 3); + + /* Next line we fill in the buffer. + */ +- int boff = (y + 3)%4; +- unsigned short *q = seq->buf + boff*seq->lsk; ++ int boff = (y + 3) % 4; ++ unsigned short *q = seq->buf + boff * seq->lsk; + + /* Line we write in output. + */ +- unsigned short *q1 = (unsigned short *) +- IM_REGION_ADDR( or, r->left, y + r->top ); ++ unsigned short *q1 = (unsigned short *) ++ IM_REGION_ADDR(or, r->left, y + r->top); + + /* Process this new xline. + */ +- make_xline( sin, p, q, r->width, xstart ); ++ make_xline(sin, p, q, r->width, xstart); + + /* Generate new output line. + */ +- make_yline( sin, seq->lsk, boff, +- seq->buf, q1, r->width, sin->yoff ); ++ make_yline(sin, seq->lsk, boff, ++ seq->buf, q1, r->width, sin->yoff); + } + +- return( 0 ); ++ return (0); + } + + int +-im_stretch3( IMAGE *in, IMAGE *out, double dx, double dy ) ++im_stretch3(IMAGE *in, IMAGE *out, double dx, double dy) + { + StretchInfo *sin; + int i; +- +- /* Check our args. ++ ++ /* Check our args. + */ +- if( in->Coding != IM_CODING_NONE || in->BandFmt != IM_BANDFMT_USHORT ) { +- im_error( "im_stretch3", +- "%s", _( "not uncoded unsigned short" ) ); +- return( -1 ); +- } +- if( dx < 0 || dx >= 1.0 || dy < 0 || dy >= 1.0 ) { +- im_error( "im_stretch3", +- "%s", _( "displacements out of range [0,1)" ) ); +- return( -1 ); ++ if (in->Coding != IM_CODING_NONE || in->BandFmt != IM_BANDFMT_USHORT) { ++ im_error("im_stretch3", ++ "%s", _("not uncoded unsigned short")); ++ return (-1); ++ } ++ if (dx < 0 || dx >= 1.0 || dy < 0 || dy >= 1.0) { ++ im_error("im_stretch3", ++ "%s", _("displacements out of range [0,1)")); ++ return (-1); + } +- if( im_piocheck( in, out ) ) +- return( -1 ); ++ if (im_piocheck(in, out)) ++ return (-1); + +- /* Prepare the output image. ++ /* Prepare the output image. + */ +- if( im_cp_desc( out, in ) ) +- return( -1 ); +- out->Xsize = 34*(in->Xsize / 33) + in->Xsize%33 - 3; +- out->Ysize = in->Ysize - 3; ++ if (im_cp_desc(out, in)) ++ return (-1); ++ out->Xsize = 34 * (in->Xsize / 33) + in->Xsize % 33 - 3; ++ out->Ysize = in->Ysize - 3; + +- if( im_demand_hint( out, IM_FATSTRIP, in, NULL ) ) +- return( -1 ); ++ if (im_demand_hint(out, IM_FATSTRIP, in, NULL)) ++ return (-1); + +- if( !(sin = IM_NEW( out, StretchInfo )) ) +- return( -1 ); ++ if (!(sin = IM_NEW(out, StretchInfo))) ++ return (-1); + + /* Save parameters. + */ +@@ -299,18 +299,18 @@ im_stretch3( IMAGE *in, IMAGE *out, double dx, double dy ) + + /* Generate masks. + */ +- for( i = 0; i < 34; i++ ) { +- double d = (34.0 - i)/34.0; +- +- double y0 = 2.0*d*d - d - d*d*d; +- double y1 = 1.0 - 2.0*d*d + d*d*d; +- double y2 = d + d*d - d*d*d; +- double y3 = -d*d + d*d*d; +- +- sin->mask[i][0] = IM_RINT( y0 * 32768 ); +- sin->mask[i][1] = IM_RINT( y1 * 32768 ); +- sin->mask[i][2] = IM_RINT( y2 * 32768 ); +- sin->mask[i][3] = IM_RINT( y3 * 32768 ); ++ for (i = 0; i < 34; i++) { ++ double d = (34.0 - i) / 34.0; ++ ++ double y0 = 2.0 * d * d - d - d * d * d; ++ double y1 = 1.0 - 2.0 * d * d + d * d * d; ++ double y2 = d + d * d - d * d * d; ++ double y3 = -d * d + d * d * d; ++ ++ sin->mask[i][0] = IM_RINT(y0 * 32768); ++ sin->mask[i][1] = IM_RINT(y1 * 32768); ++ sin->mask[i][2] = IM_RINT(y2 * 32768); ++ sin->mask[i][3] = IM_RINT(y3 * 32768); + } + + /* Which mask do we start with to apply these offsets? +@@ -318,9 +318,9 @@ im_stretch3( IMAGE *in, IMAGE *out, double dx, double dy ) + sin->xoff = (dx * 33.0) + 0.5; + sin->yoff = (dy * 33.0) + 0.5; + +- if( im_generate( out, +- stretch_start, stretch_gen, stretch_stop, in, sin ) ) +- return( -1 ); ++ if (im_generate(out, ++ stretch_start, stretch_gen, stretch_stop, in, sin)) ++ return (-1); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/deprecated/im_thresh.c b/libvips/deprecated/im_thresh.c +index a473c70843..5d7ce3cf48 100644 +--- a/libvips/deprecated/im_thresh.c ++++ b/libvips/deprecated/im_thresh.c +@@ -12,33 +12,33 @@ + * + * Author: N. Dessipris, J. Cupitt + * Written on: 15/03/1991 +- * Modified on : ++ * Modified on : + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -57,74 +57,91 @@ + #define BRIGHT 255 + #define DARK 0 + #define im_for_all_types(A) \ +- case IM_BANDFMT_UCHAR: A(unsigned char); break; \ +- case IM_BANDFMT_CHAR: A(signed char); break; \ +- case IM_BANDFMT_USHORT: A(unsigned short); break; \ +- case IM_BANDFMT_SHORT: A(signed short); break; \ +- case IM_BANDFMT_UINT: A(unsigned int); break; \ +- case IM_BANDFMT_INT: A(signed int); break; \ +- case IM_BANDFMT_FLOAT: A(float); break; \ +- case IM_BANDFMT_DOUBLE: A(double); break; ++ case IM_BANDFMT_UCHAR: \ ++ A(unsigned char); \ ++ break; \ ++ case IM_BANDFMT_CHAR: \ ++ A(signed char); \ ++ break; \ ++ case IM_BANDFMT_USHORT: \ ++ A(unsigned short); \ ++ break; \ ++ case IM_BANDFMT_SHORT: \ ++ A(signed short); \ ++ break; \ ++ case IM_BANDFMT_UINT: \ ++ A(unsigned int); \ ++ break; \ ++ case IM_BANDFMT_INT: \ ++ A(signed int); \ ++ break; \ ++ case IM_BANDFMT_FLOAT: \ ++ A(float); \ ++ break; \ ++ case IM_BANDFMT_DOUBLE: \ ++ A(double); \ ++ break; + + /* Replacement for im_thresh */ + int +-im_thresh( in, out, threshold ) ++im_thresh(in, out, threshold) + IMAGE *in, *out; + double threshold; +-{ ++{ + int x, y; +- PEL *bu; /* Buffer we write to */ +- int s, epl; /* Size and els per line */ +- +-/* Check our args. */ +- if( im_iocheck( in, out ) ) +- return( -1 ); +- if( in->Coding != IM_CODING_NONE ) { +- im_error( "im_thresh", "%s", _( "input should be uncoded") ); +- return(-1); ++ PEL *bu; /* Buffer we write to */ ++ int s, epl; /* Size and els per line */ ++ ++ /* Check our args. */ ++ if (im_iocheck(in, out)) ++ return (-1); ++ if (in->Coding != IM_CODING_NONE) { ++ im_error("im_thresh", "%s", _("input should be uncoded")); ++ return (-1); + } + +-/* Set up the output header. */ +- if( im_cp_desc( out, in ) ) +- return( -1 ); ++ /* Set up the output header. */ ++ if (im_cp_desc(out, in)) ++ return (-1); + out->BandFmt = IM_BANDFMT_UCHAR; +- if( im_setupout( out ) ) +- return( -1 ); ++ if (im_setupout(out)) ++ return (-1); + +-/* Make buffer for building o/p in. */ ++ /* Make buffer for building o/p in. */ + epl = in->Xsize * in->Bands; +- s = epl * sizeof( PEL ); +- if( (bu = (PEL *) im_malloc( out, (unsigned)s )) == NULL ) +- return( -1 ); ++ s = epl * sizeof(PEL); ++ if ((bu = (PEL *) im_malloc(out, (unsigned) s)) == NULL) ++ return (-1); + + /* Define what we do for each band element type. */ +-#define im_thresh_loop(TYPE)\ +- { TYPE *a = (TYPE *) in->data;\ +- \ +- for( y = 0; y < in->Ysize; y++ ) {\ +- PEL *b = bu;\ +- \ +- for( x = 0; x < epl; x++ ) {\ +- double f = (double) *a++;\ +- if ( f >= threshold)\ +- *b++ = (PEL)BRIGHT;\ +- else\ +- *b++ = (PEL)DARK;\ +- }\ +- \ +- if( im_writeline( y, out, bu ) ) \ +- return( -1 );\ +- }\ ++#define im_thresh_loop(TYPE) \ ++ { \ ++ TYPE *a = (TYPE *) in->data; \ ++\ ++ for (y = 0; y < in->Ysize; y++) { \ ++ PEL *b = bu; \ ++\ ++ for (x = 0; x < epl; x++) { \ ++ double f = (double) *a++; \ ++ if (f >= threshold) \ ++ *b++ = (PEL) BRIGHT; \ ++ else \ ++ *b++ = (PEL) DARK; \ ++ } \ ++\ ++ if (im_writeline(y, out, bu)) \ ++ return (-1); \ ++ } \ + } + +-/* Do the above for all image types. */ +- switch( in->BandFmt ) { +- im_for_all_types( im_thresh_loop ); ++ /* Do the above for all image types. */ ++ switch (in->BandFmt) { ++ im_for_all_types(im_thresh_loop); + + default: +- im_error( "im_thresh", "%s", _( "Unknown input format") ); +- return( -1 ); ++ im_error("im_thresh", "%s", _("Unknown input format")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/deprecated/im_tiff2vips.c b/libvips/deprecated/im_tiff2vips.c +index 022ffb366c..30be07804d 100644 +--- a/libvips/deprecated/im_tiff2vips.c ++++ b/libvips/deprecated/im_tiff2vips.c +@@ -7,32 +7,32 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +-/* ++/* + #define DEBUG + */ + +@@ -54,58 +54,58 @@ + + #ifdef HAVE_TIFF + static gboolean +-im_istifftiled( const char *filename ) ++im_istifftiled(const char *filename) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( FALSE ); +- result = vips__istiff_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (FALSE); ++ result = vips__istiff_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static int +-im_tiff_read_header( const char *filename, VipsImage *out, +- int page, int n, gboolean autorotate ) ++im_tiff_read_header(const char *filename, VipsImage *out, ++ int page, int n, gboolean autorotate) + { + VipsSource *source; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( -1 ); +- if( vips__tiff_read_header_source( source, out, +- page, n, autorotate, -1, VIPS_FAIL_ON_ERROR ) ) { +- VIPS_UNREF( source ); +- return( -1 ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (-1); ++ if (vips__tiff_read_header_source(source, out, ++ page, n, autorotate, -1, VIPS_FAIL_ON_ERROR)) { ++ VIPS_UNREF(source); ++ return (-1); + } +- VIPS_UNREF( source ); ++ VIPS_UNREF(source); + +- return( 0 ); ++ return (0); + } + + static int +-im_tiff_read( const char *filename, VipsImage *out, +- int page, int n, gboolean autorotate ) ++im_tiff_read(const char *filename, VipsImage *out, ++ int page, int n, gboolean autorotate) + { + VipsSource *source; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( -1 ); +- if( vips__tiff_read_source( source, out, +- page, n, autorotate, -1, VIPS_FAIL_ON_ERROR ) ) { +- VIPS_UNREF( source ); +- return( -1 ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (-1); ++ if (vips__tiff_read_source(source, out, ++ page, n, autorotate, -1, VIPS_FAIL_ON_ERROR)) { ++ VIPS_UNREF(source); ++ return (-1); + } +- VIPS_UNREF( source ); ++ VIPS_UNREF(source); + +- return( 0 ); ++ return (0); + } + #endif /*HAVE_TIFF*/ + + static int +-tiff2vips( const char *name, IMAGE *out, gboolean header_only ) ++tiff2vips(const char *name, IMAGE *out, gboolean header_only) + { + #ifdef HAVE_TIFF + char filename[FILENAME_MAX]; +@@ -114,20 +114,20 @@ tiff2vips( const char *name, IMAGE *out, gboolean header_only ) + int page; + int seq; + +- im_filename_split( name, filename, mode ); ++ im_filename_split(name, filename, mode); + + page = 0; + seq = 0; + p = &mode[0]; +- if( (q = im_getnextoption( &p )) ) { +- page = atoi( q ); ++ if ((q = im_getnextoption(&p))) { ++ page = atoi(q); + } +- if( (q = im_getnextoption( &p )) ) { +- if( im_isprefix( "seq", q ) ) ++ if ((q = im_getnextoption(&p))) { ++ if (im_isprefix("seq", q)) + seq = 1; + } + +- /* We need to be compatible with the pre-sequential mode ++ /* We need to be compatible with the pre-sequential mode + * im_tiff2vips(). This returned a "t" if given a "p" image, since it + * used writeline. + * +@@ -138,67 +138,67 @@ tiff2vips( const char *name, IMAGE *out, gboolean header_only ) + * malloc if all we are doing is looking at fields. + */ + +- if( !header_only && ++ if (!header_only && + !seq && +- !im_istifftiled( filename ) && +- out->dtype == VIPS_IMAGE_PARTIAL ) { +- if( vips__image_wio_output( out ) ) +- return( -1 ); ++ !im_istifftiled(filename) && ++ out->dtype == VIPS_IMAGE_PARTIAL) { ++ if (vips__image_wio_output(out)) ++ return (-1); + } + +- if( header_only ) { +- if( im_tiff_read_header( filename, out, page, 1, FALSE ) ) +- return( -1 ); ++ if (header_only) { ++ if (im_tiff_read_header(filename, out, page, 1, FALSE)) ++ return (-1); + } + else { +- if( im_tiff_read( filename, out, page, 1, FALSE ) ) +- return( -1 ); ++ if (im_tiff_read(filename, out, page, 1, FALSE)) ++ return (-1); + } + #else +- vips_error( "im_tiff2vips", +- "%s", _( "no TIFF support in your libvips" ) ); ++ vips_error("im_tiff2vips", ++ "%s", _("no TIFF support in your libvips")); + +- return( -1 ); ++ return (-1); + #endif /*HAVE_TIFF*/ + +- return( 0 ); ++ return (0); + } + + int +-im_tiff2vips( const char *name, IMAGE *out ) ++im_tiff2vips(const char *name, IMAGE *out) + { +- return( tiff2vips( name, out, FALSE ) ); ++ return (tiff2vips(name, out, FALSE)); + } + + /* By having a separate header func, we get lazy.c to open via disc/mem. + */ + static int +-im_tiff2vips_header( const char *name, IMAGE *out ) ++im_tiff2vips_header(const char *name, IMAGE *out) + { +- return( tiff2vips( name, out, TRUE ) ); ++ return (tiff2vips(name, out, TRUE)); + } + + static VipsFormatFlags +-tiff_flags( const char *name ) ++tiff_flags(const char *name) + { + char filename[FILENAME_MAX]; + char mode[FILENAME_MAX]; + +- im_filename_split( name, filename, mode ); ++ im_filename_split(name, filename, mode); + +- return( (VipsFormatFlags) +- vips_foreign_flags( "tiffload", filename ) ); ++ return ((VipsFormatFlags) ++ vips_foreign_flags("tiffload", filename)); + } + + static int +-istiff( const char *name ) ++istiff(const char *name) + { + char filename[FILENAME_MAX]; + char mode[FILENAME_MAX]; + +- im_filename_split( name, filename, mode ); ++ im_filename_split(name, filename, mode); + +- return( vips_foreign_is_a( "tiffload", filename ) ); ++ return (vips_foreign_is_a("tiffload", filename)); + } + + static const char *tiff_suffs[] = { ".tif", ".tiff", NULL }; +@@ -207,13 +207,13 @@ typedef VipsFormat VipsFormatTiff; + typedef VipsFormatClass VipsFormatTiffClass; + + static void +-vips_format_tiff_class_init( VipsFormatTiffClass *class ) ++vips_format_tiff_class_init(VipsFormatTiffClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsFormatClass *format_class = (VipsFormatClass *) class; + + object_class->nickname = "tiff"; +- object_class->description = _( "TIFF" ); ++ object_class->description = _("TIFF"); + + format_class->is_a = istiff; + format_class->header = im_tiff2vips_header; +@@ -224,8 +224,8 @@ vips_format_tiff_class_init( VipsFormatTiffClass *class ) + } + + static void +-vips_format_tiff_init( VipsFormatTiff *object ) ++vips_format_tiff_init(VipsFormatTiff *object) + { + } + +-G_DEFINE_TYPE( VipsFormatTiff, vips_format_tiff, VIPS_TYPE_FORMAT ); ++G_DEFINE_TYPE(VipsFormatTiff, vips_format_tiff, VIPS_TYPE_FORMAT); +diff --git a/libvips/deprecated/im_video_test.c b/libvips/deprecated/im_video_test.c +index d2a359dafa..968cb48e6e 100644 +--- a/libvips/deprecated/im_video_test.c ++++ b/libvips/deprecated/im_video_test.c +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -47,13 +47,12 @@ + * Returns: 0 on success, -1 on error + */ + int +-im_video_test( IMAGE *im, int brightness, int error ) ++im_video_test(IMAGE *im, int brightness, int error) + { +- if( error ) { +- im_error( "im_video_test", "%s", _( "error requested" ) ); +- return( -1 ); ++ if (error) { ++ im_error("im_video_test", "%s", _("error requested")); ++ return (-1); + } + else +- return( im_gaussnoise( im, 720, 576, brightness, 20 ) ); ++ return (im_gaussnoise(im, 720, 576, brightness, 20)); + } +- +diff --git a/libvips/deprecated/im_vips2csv.c b/libvips/deprecated/im_vips2csv.c +index fd114354c8..7e165224b5 100644 +--- a/libvips/deprecated/im_vips2csv.c ++++ b/libvips/deprecated/im_vips2csv.c +@@ -1,33 +1,33 @@ + /* Write a csv file. +- * ++ * + * 16/12/11 + * - just a stub + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -39,8 +39,8 @@ + #include + #include + +-int +-im_vips2csv( IMAGE *in, const char *filename ) ++int ++im_vips2csv(IMAGE *in, const char *filename) + { + char *separator = "\t"; + +@@ -50,15 +50,15 @@ im_vips2csv( IMAGE *in, const char *filename ) + + /* Parse mode string. + */ +- im_filename_split( filename, name, mode ); ++ im_filename_split(filename, name, mode); + p = &mode[0]; +- while( (q = im_getnextoption( &p )) ) { +- if( im_isprefix( "sep", q ) && (r = im_getsuboption( q )) ) ++ while ((q = im_getnextoption(&p))) { ++ if (im_isprefix("sep", q) && (r = im_getsuboption(q))) + separator = r; + } + +- if( vips_csvsave( in, name, "separator", separator, NULL ) ) +- return( -1 ); ++ if (vips_csvsave(in, name, "separator", separator, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/deprecated/im_vips2dz.c b/libvips/deprecated/im_vips2dz.c +index 0383ddd562..f587652902 100644 +--- a/libvips/deprecated/im_vips2dz.c ++++ b/libvips/deprecated/im_vips2dz.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -48,7 +48,7 @@ + #include + + int +-im_vips2dz( IMAGE *in, const char *filename ) ++im_vips2dz(IMAGE *in, const char *filename) + { + char *p, *q; + char name[FILENAME_MAX]; +@@ -56,13 +56,13 @@ im_vips2dz( IMAGE *in, const char *filename ) + char buf[FILENAME_MAX]; + + int i; +- VipsForeignDzLayout layout = VIPS_FOREIGN_DZ_LAYOUT_DZ; ++ VipsForeignDzLayout layout = VIPS_FOREIGN_DZ_LAYOUT_DZ; + char *suffix = ".jpeg"; + int overlap = 0; + int tile_size = 256; +- VipsForeignDzDepth depth = VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL; ++ VipsForeignDzDepth depth = VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL; + gboolean centre = FALSE; +- VipsAngle angle = VIPS_ANGLE_D0; ++ VipsAngle angle = VIPS_ANGLE_D0; + + /* We can't use im_filename_split() --- it assumes that we have a + * filename with an extension before the ':', and filename here is +@@ -70,60 +70,60 @@ im_vips2dz( IMAGE *in, const char *filename ) + * + * Just split on the first ':'. + */ +- im_strncpy( name, filename, FILENAME_MAX ); +- if( (p = strchr( name, ':' )) ) { ++ im_strncpy(name, filename, FILENAME_MAX); ++ if ((p = strchr(name, ':'))) { + *p = '\0'; +- im_strncpy( mode, p + 1, FILENAME_MAX ); ++ im_strncpy(mode, p + 1, FILENAME_MAX); + } +- else +- strcpy( mode, "" ); ++ else ++ strcpy(mode, ""); + +- strcpy( buf, mode ); ++ strcpy(buf, mode); + p = &buf[0]; + +- if( (q = im_getnextoption( &p )) ) { +- if( (i = vips_enum_from_nick( "im_vips2dz", +- VIPS_TYPE_FOREIGN_DZ_LAYOUT, q )) < 0 ) +- return( -1 ); ++ if ((q = im_getnextoption(&p))) { ++ if ((i = vips_enum_from_nick("im_vips2dz", ++ VIPS_TYPE_FOREIGN_DZ_LAYOUT, q)) < 0) ++ return (-1); + layout = i; + } + +- if( (q = im_getnextoption( &p )) ) +- suffix = g_strdup( q ); +- if( (q = im_getnextoption( &p )) ) +- overlap = atoi( q ); +- if( (q = im_getnextoption( &p )) ) +- tile_size = atoi( q ); +- +- if( (q = im_getnextoption( &p )) ) { +- if( (i = vips_enum_from_nick( "im_vips2dz", +- VIPS_TYPE_FOREIGN_DZ_DEPTH, q )) < 0 ) +- return( -1 ); ++ if ((q = im_getnextoption(&p))) ++ suffix = g_strdup(q); ++ if ((q = im_getnextoption(&p))) ++ overlap = atoi(q); ++ if ((q = im_getnextoption(&p))) ++ tile_size = atoi(q); ++ ++ if ((q = im_getnextoption(&p))) { ++ if ((i = vips_enum_from_nick("im_vips2dz", ++ VIPS_TYPE_FOREIGN_DZ_DEPTH, q)) < 0) ++ return (-1); + depth = i; + } + +- if( (q = im_getnextoption( &p )) ) { +- if( im_isprefix( "cen", q ) ) ++ if ((q = im_getnextoption(&p))) { ++ if (im_isprefix("cen", q)) + centre = TRUE; + } + +- if( (q = im_getnextoption( &p )) ) { +- if( (i = vips_enum_from_nick( "im_vips2dz", +- VIPS_TYPE_ANGLE, q )) < 0 ) +- return( -1 ); ++ if ((q = im_getnextoption(&p))) { ++ if ((i = vips_enum_from_nick("im_vips2dz", ++ VIPS_TYPE_ANGLE, q)) < 0) ++ return (-1); + angle = i; + } + +- if( vips_dzsave( in, name, +- "layout", layout, +- "suffix", suffix, +- "overlap", overlap, +- "tile_size", tile_size, +- "depth", depth, +- "centre", centre, +- "angle", angle, +- NULL ) ) +- return( -1 ); +- +- return( 0 ); ++ if (vips_dzsave(in, name, ++ "layout", layout, ++ "suffix", suffix, ++ "overlap", overlap, ++ "tile_size", tile_size, ++ "depth", depth, ++ "centre", centre, ++ "angle", angle, ++ NULL)) ++ return (-1); ++ ++ return (0); + } +diff --git a/libvips/deprecated/im_vips2jpeg.c b/libvips/deprecated/im_vips2jpeg.c +index a8249d0aae..b90bcd08b7 100644 +--- a/libvips/deprecated/im_vips2jpeg.c ++++ b/libvips/deprecated/im_vips2jpeg.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -50,9 +50,9 @@ + #include + + int +-im_vips2jpeg( IMAGE *in, const char *filename ) ++im_vips2jpeg(IMAGE *in, const char *filename) + { +- int qfac = 75; ++ int qfac = 75; + + /* profile has to default to NULL, meaning "no param". If we default + * to "none" we will not attach the profile from the metadata. +@@ -67,46 +67,46 @@ im_vips2jpeg( IMAGE *in, const char *filename ) + + /* Parse mode from filename. + */ +- im_filename_split( filename, name, mode ); +- strcpy( buf, mode ); ++ im_filename_split(filename, name, mode); ++ strcpy(buf, mode); + p = &buf[0]; +- if( (q = im_getnextoption( &p )) ) { +- if( strcmp( q, "" ) != 0 ) +- qfac = atoi( mode ); ++ if ((q = im_getnextoption(&p))) { ++ if (strcmp(q, "") != 0) ++ qfac = atoi(mode); + } +- if( (q = im_getnextoption( &p )) ) { +- if( strcmp( q, "" ) != 0 ) ++ if ((q = im_getnextoption(&p))) { ++ if (strcmp(q, "") != 0) + profile = q; + } +- if( (q = im_getnextoption( &p )) ) { +- im_error( "im_vips2jpeg", +- _( "unknown extra options \"%s\"" ), q ); +- return( -1 ); ++ if ((q = im_getnextoption(&p))) { ++ im_error("im_vips2jpeg", ++ _("unknown extra options \"%s\""), q); ++ return (-1); + } + +- return( vips_jpegsave( in, name, +- "Q", qfac, "profile", profile, NULL ) ); ++ return (vips_jpegsave(in, name, ++ "Q", qfac, "profile", profile, NULL)); + } + + int +-im_vips2bufjpeg( IMAGE *in, IMAGE *out, int qfac, char **obuf, int *olen ) ++im_vips2bufjpeg(IMAGE *in, IMAGE *out, int qfac, char **obuf, int *olen) + { + size_t len; + +- if( vips_jpegsave_buffer( in, (void **) obuf, &len, "Q", qfac, NULL ) ) +- return( -1 ); +- if( out ) +- im_add_callback( out, "close", +- (im_callback_fn) vips_free, obuf, NULL ); ++ if (vips_jpegsave_buffer(in, (void **) obuf, &len, "Q", qfac, NULL)) ++ return (-1); ++ if (out) ++ im_add_callback(out, "close", ++ (im_callback_fn) vips_free, obuf, NULL); + +- if( olen ) ++ if (olen) + *olen = len; + +- return( 0 ); ++ return (0); + } + + int +-im_vips2mimejpeg( IMAGE *in, int qfac ) ++im_vips2mimejpeg(IMAGE *in, int qfac) + { +- return( vips_jpegsave_mime( in, "Q", qfac, NULL ) ); ++ return (vips_jpegsave_mime(in, "Q", qfac, NULL)); + } +diff --git a/libvips/deprecated/im_vips2mask.c b/libvips/deprecated/im_vips2mask.c +index e4f2226852..8a1cb0dbd7 100644 +--- a/libvips/deprecated/im_vips2mask.c ++++ b/libvips/deprecated/im_vips2mask.c +@@ -7,7 +7,7 @@ + * 16/10/06 + * - allow 1xn-band images too + * 23/2/07 +- * - oop, broken for nx1 m-band images ++ * - oop, broken for nx1 m-band images + * - now casts to double for you + * 1/2/10 + * - gtkdoc +@@ -15,28 +15,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -53,7 +53,7 @@ + /** + * im_vips2mask: + * @in: input image +- * @filename: name for output mask ++ * @filename: name for output mask + * + * Make a mask from an image. All images are cast to %IM_BANDFMT_DOUBLE + * before processing. There are two cases for handling bands: +@@ -69,77 +69,77 @@ + * Returns: a #DOUBLEMASK with @outname set as the name, or NULL on error + */ + DOUBLEMASK * +-im_vips2mask( IMAGE *in, const char *filename ) ++im_vips2mask(IMAGE *in, const char *filename) + { + int width, height; + DOUBLEMASK *out; + + /* double* only: cast if necessary. + */ +- if( in->BandFmt != IM_BANDFMT_DOUBLE ) { ++ if (in->BandFmt != IM_BANDFMT_DOUBLE) { + IMAGE *t; + +- if( !(t = im_open( "im_vips2mask", "p" )) ) +- return( NULL ); +- if( im_clip2fmt( in, t, IM_BANDFMT_DOUBLE ) || +- !(out = im_vips2mask( t, filename )) ) { +- im_close( t ); +- return( NULL ); ++ if (!(t = im_open("im_vips2mask", "p"))) ++ return (NULL); ++ if (im_clip2fmt(in, t, IM_BANDFMT_DOUBLE) || ++ !(out = im_vips2mask(t, filename))) { ++ im_close(t); ++ return (NULL); + } +- im_close( t ); ++ im_close(t); + +- return( out ); ++ return (out); + } + + /* Check the image. + */ +- if( im_incheck( in ) || +- im_check_uncoded( "im_vips2mask", in ) ) +- return( NULL ); ++ if (im_incheck(in) || ++ im_check_uncoded("im_vips2mask", in)) ++ return (NULL); + +- if( in->Bands == 1 ) { ++ if (in->Bands == 1) { + width = in->Xsize; + height = in->Ysize; + } +- else if( in->Xsize == 1 ) { ++ else if (in->Xsize == 1) { + width = in->Bands; + height = in->Ysize; + } +- else if( in->Ysize == 1 ) { ++ else if (in->Ysize == 1) { + width = in->Xsize; + height = in->Bands; + } + else { +- im_error( "im_vips2mask", +- "%s", _( "one band, nx1, or 1xn images only" ) ); +- return( NULL ); ++ im_error("im_vips2mask", ++ "%s", _("one band, nx1, or 1xn images only")); ++ return (NULL); + } + +- if( !(out = im_create_dmask( filename, width, height )) ) +- return( NULL ); +- if( in->Bands > 1 && in->Ysize == 1 ) { ++ if (!(out = im_create_dmask(filename, width, height))) ++ return (NULL); ++ if (in->Bands > 1 && in->Ysize == 1) { + double *data = (double *) in->data; + int x, y; + + /* Need to transpose: the image is RGBRGBRGB, we need RRRGGGBBB. + */ +- for( y = 0; y < height; y++ ) +- for( x = 0; x < width; x++ ) ++ for (y = 0; y < height; y++) ++ for (x = 0; x < width; x++) + out->coeff[x + y * width] = + data[x * height + y]; + } + else +- memcpy( out->coeff, in->data, +- width * height * sizeof( double ) ); ++ memcpy(out->coeff, in->data, ++ width * height * sizeof(double)); + +- out->scale = vips_image_get_scale( in ); +- out->offset = vips_image_get_offset( in ); ++ out->scale = vips_image_get_scale(in); ++ out->offset = vips_image_get_offset(in); + +- return( out ); ++ return (out); + } + + INTMASK * +-im_vips2imask( IMAGE *in, const char *filename ) ++im_vips2imask(IMAGE *in, const char *filename) + { + int width, height; + INTMASK *out; +@@ -151,48 +151,48 @@ im_vips2imask( IMAGE *in, const char *filename ) + + /* double* only: cast if necessary. + */ +- if( in->BandFmt != IM_BANDFMT_DOUBLE ) { ++ if (in->BandFmt != IM_BANDFMT_DOUBLE) { + IMAGE *t; + +- if( !(t = im_open( "im_vips2imask", "p" )) ) +- return( NULL ); +- if( im_clip2fmt( in, t, IM_BANDFMT_DOUBLE ) || +- !(out = im_vips2imask( t, filename )) ) { +- im_close( t ); +- return( NULL ); ++ if (!(t = im_open("im_vips2imask", "p"))) ++ return (NULL); ++ if (im_clip2fmt(in, t, IM_BANDFMT_DOUBLE) || ++ !(out = im_vips2imask(t, filename))) { ++ im_close(t); ++ return (NULL); + } +- im_close( t ); ++ im_close(t); + +- return( out ); ++ return (out); + } + + /* Check the image. + */ +- if( im_incheck( in ) || +- im_check_uncoded( "im_vips2imask", in ) ) +- return( NULL ); ++ if (im_incheck(in) || ++ im_check_uncoded("im_vips2imask", in)) ++ return (NULL); + +- if( in->Bands == 1 ) { ++ if (in->Bands == 1) { + width = in->Xsize; + height = in->Ysize; + } +- else if( in->Xsize == 1 ) { ++ else if (in->Xsize == 1) { + width = in->Bands; + height = in->Ysize; + } +- else if( in->Ysize == 1 ) { ++ else if (in->Ysize == 1) { + width = in->Xsize; + height = in->Bands; + } + else { +- im_error( "im_vips2imask", +- "%s", _( "one band, nx1, or 1xn images only" ) ); +- return( NULL ); ++ im_error("im_vips2imask", ++ "%s", _("one band, nx1, or 1xn images only")); ++ return (NULL); + } + + data = (double *) in->data; +- if( !(out = im_create_imask( filename, width, height )) ) +- return( NULL ); ++ if (!(out = im_create_imask(filename, width, height))) ++ return (NULL); + + /* We want to make an intmask which has the same input to output ratio + * as the double image. +@@ -205,43 +205,42 @@ im_vips2imask( IMAGE *in, const char *filename ) + * be? + */ + double_result = 0; +- for( y = 0; y < height; y++ ) +- for( x = 0; x < width; x++ ) ++ for (y = 0; y < height; y++) ++ for (x = 0; x < width; x++) + double_result += data[x + width * y]; +- double_result /= vips_image_get_scale( in ); ++ double_result /= vips_image_get_scale(in); + +- for( y = 0; y < height; y++ ) +- for( x = 0; x < width; x++ ) +- if( in->Bands > 1 && in->Ysize == 1 ) +- /* Need to transpose: the image is RGBRGBRGB, ++ for (y = 0; y < height; y++) ++ for (x = 0; x < width; x++) ++ if (in->Bands > 1 && in->Ysize == 1) ++ /* Need to transpose: the image is RGBRGBRGB, + * we need RRRGGGBBB. + */ + out->coeff[x + y * width] = +- VIPS_RINT( data[x * height + y] ); ++ VIPS_RINT(data[x * height + y]); + else + out->coeff[x + y * width] = +- VIPS_RINT( data[x + y * width] ); ++ VIPS_RINT(data[x + y * width]); + +- out->scale = VIPS_RINT( vips_image_get_scale( in ) ); +- if( out->scale == 0 ) ++ out->scale = VIPS_RINT(vips_image_get_scale(in)); ++ if (out->scale == 0) + out->scale = 1; +- out->offset = VIPS_RINT( vips_image_get_offset( in ) ); ++ out->offset = VIPS_RINT(vips_image_get_offset(in)); + + /* Now convolve a 1 everywhere image with the int version we've made, + * what do we get? + */ + int_result = 0; +- for( y = 0; y < height; y++ ) +- for( x = 0; x < width; x++ ) ++ for (y = 0; y < height; y++) ++ for (x = 0; x < width; x++) + int_result += out->coeff[x + width * y]; + int_result /= out->scale; + +- /* And adjust the scale to get as close to a match as we can. ++ /* And adjust the scale to get as close to a match as we can. + */ +- out->scale = VIPS_RINT( out->scale + (int_result - double_result) ); +- if( out->scale == 0 ) ++ out->scale = VIPS_RINT(out->scale + (int_result - double_result)); ++ if (out->scale == 0) + out->scale = 1; + +- return( out ); ++ return (out); + } +- +diff --git a/libvips/deprecated/im_vips2png.c b/libvips/deprecated/im_vips2png.c +index cad807717e..d4e6c1e888 100644 +--- a/libvips/deprecated/im_vips2png.c ++++ b/libvips/deprecated/im_vips2png.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -50,10 +50,10 @@ + #include + + int +-im_vips2png( IMAGE *in, const char *filename ) ++im_vips2png(IMAGE *in, const char *filename) + { +- int compression; +- int interlace; ++ int compression; ++ int interlace; + + char *p, *q; + +@@ -63,33 +63,33 @@ im_vips2png( IMAGE *in, const char *filename ) + + /* Extract write mode from filename and parse. + */ +- im_filename_split( filename, name, mode ); +- strcpy( buf, mode ); ++ im_filename_split(filename, name, mode); ++ strcpy(buf, mode); + p = &buf[0]; + compression = 6; + interlace = 0; +- if( (q = im_getnextoption( &p )) ) +- compression = atoi( q ); +- if( (q = im_getnextoption( &p )) ) +- interlace = atoi( q ); ++ if ((q = im_getnextoption(&p))) ++ compression = atoi(q); ++ if ((q = im_getnextoption(&p))) ++ interlace = atoi(q); + +- return( vips_pngsave( in, name, +- "compression", compression, "interlace", interlace, NULL ) ); ++ return (vips_pngsave(in, name, ++ "compression", compression, "interlace", interlace, NULL)); + } + + int +-im_vips2bufpng( IMAGE *in, IMAGE *out, +- int compression, int interlace, char **obuf, size_t *olen ) ++im_vips2bufpng(IMAGE *in, IMAGE *out, ++ int compression, int interlace, char **obuf, size_t *olen) + { +- if( vips_pngsave_buffer( in, (void **) obuf, olen, +- "compression", compression, +- "interlace", interlace, +- NULL ) ) +- return( -1 ); ++ if (vips_pngsave_buffer(in, (void **) obuf, olen, ++ "compression", compression, ++ "interlace", interlace, ++ NULL)) ++ return (-1); + +- if( out ) +- im_add_callback( out, "close", +- (im_callback_fn) vips_free, obuf, NULL ); ++ if (out) ++ im_add_callback(out, "close", ++ (im_callback_fn) vips_free, obuf, NULL); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/deprecated/im_vips2ppm.c b/libvips/deprecated/im_vips2ppm.c +index 16024a03bb..6480536be3 100644 +--- a/libvips/deprecated/im_vips2ppm.c ++++ b/libvips/deprecated/im_vips2ppm.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -42,7 +42,7 @@ + #include + + int +-im_vips2ppm( IMAGE *in, const char *filename ) ++im_vips2ppm(IMAGE *in, const char *filename) + { + int ascii; + char name[FILENAME_MAX]; +@@ -54,19 +54,19 @@ im_vips2ppm( IMAGE *in, const char *filename ) + + /* Extract write mode from filename. + */ +- im_filename_split( filename, name, mode ); +- if( strcmp( mode, "" ) != 0 ) { +- if( im_isprefix( "binary", mode ) ) ++ im_filename_split(filename, name, mode); ++ if (strcmp(mode, "") != 0) { ++ if (im_isprefix("binary", mode)) + ascii = 0; +- else if( im_isprefix( "ascii", mode ) ) ++ else if (im_isprefix("ascii", mode)) + ascii = 1; + else { +- im_error( "im_vips2ppm", +- "%s", _( "bad mode string, " +- "should be \"binary\" or \"ascii\"" ) ); +- return( -1 ); ++ im_error("im_vips2ppm", ++ "%s", _("bad mode string, " ++ "should be \"binary\" or \"ascii\"")); ++ return (-1); + } + } + +- return( vips_ppmsave( in, name, "ascii", ascii, NULL ) ); ++ return (vips_ppmsave(in, name, "ascii", ascii, NULL)); + } +diff --git a/libvips/deprecated/im_vips2tiff.c b/libvips/deprecated/im_vips2tiff.c +index 4491a1f417..3fabe5b242 100644 +--- a/libvips/deprecated/im_vips2tiff.c ++++ b/libvips/deprecated/im_vips2tiff.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -48,155 +48,160 @@ + #include + + int +-im_vips2tiff( IMAGE *in, const char *filename ) ++im_vips2tiff(IMAGE *in, const char *filename) + { + char *p, *q, *r; + char name[FILENAME_MAX]; + char mode[FILENAME_MAX]; + char buf[FILENAME_MAX]; + +- VipsForeignTiffCompression compression = ++ VipsForeignTiffCompression compression = + VIPS_FOREIGN_TIFF_COMPRESSION_NONE; +- int Q = 75; ++ int Q = 75; + VipsForeignTiffPredictor predictor = VIPS_FOREIGN_TIFF_PREDICTOR_NONE; + char *profile = NULL; +- gboolean tile = FALSE; ++ gboolean tile = FALSE; + int tile_width = 128; + int tile_height = 128; + gboolean pyramid = FALSE; + gboolean squash = FALSE; +- VipsForeignTiffResunit resunit = VIPS_FOREIGN_TIFF_RESUNIT_CM; ++ VipsForeignTiffResunit resunit = VIPS_FOREIGN_TIFF_RESUNIT_CM; + double xres = in->Xres * 10.0; + double yres = in->Yres * 10.0; + gboolean bigtiff = FALSE; + +- im_filename_split( filename, name, mode ); +- strcpy( buf, mode ); ++ im_filename_split(filename, name, mode); ++ strcpy(buf, mode); + p = &buf[0]; +- if( (q = im_getnextoption( &p )) ) { +- if( im_isprefix( "none", q ) ) ++ if ((q = im_getnextoption(&p))) { ++ if (im_isprefix("none", q)) + compression = VIPS_FOREIGN_TIFF_COMPRESSION_NONE; +- else if( im_isprefix( "packbits", q ) ) ++ else if (im_isprefix("packbits", q)) + compression = VIPS_FOREIGN_TIFF_COMPRESSION_PACKBITS; +- else if( im_isprefix( "ccittfax4", q ) ) ++ else if (im_isprefix("ccittfax4", q)) + compression = VIPS_FOREIGN_TIFF_COMPRESSION_CCITTFAX4; +- else if( im_isprefix( "lzw", q ) ) { ++ else if (im_isprefix("lzw", q)) { + compression = VIPS_FOREIGN_TIFF_COMPRESSION_LZW; + +- if( (r = im_getsuboption( q )) ) { ++ if ((r = im_getsuboption(q))) { + int i; + +- if( sscanf( r, "%d", &i ) != 1 ) { +- im_error( "im_vips2tiff", +- "%s", _( "bad predictor " +- "parameter" ) ); +- return( -1 ); ++ if (sscanf(r, "%d", &i) != 1) { ++ im_error("im_vips2tiff", ++ "%s", _("bad predictor " ++ "parameter")); ++ return (-1); + } + predictor = i; + } + } +- else if( im_isprefix( "deflate", q ) ) { ++ else if (im_isprefix("deflate", q)) { + compression = VIPS_FOREIGN_TIFF_COMPRESSION_DEFLATE; + +- if( (r = im_getsuboption( q )) ) { ++ if ((r = im_getsuboption(q))) { + int i; + +- if( sscanf( r, "%d", &i ) != 1 ) { +- im_error( "im_vips2tiff", +- "%s", _( "bad predictor " +- "parameter" ) ); +- return( -1 ); ++ if (sscanf(r, "%d", &i) != 1) { ++ im_error("im_vips2tiff", ++ "%s", _("bad predictor " ++ "parameter")); ++ return (-1); + } + predictor = i; + } + } +- else if( im_isprefix( "jpeg", q ) ) { ++ else if (im_isprefix("jpeg", q)) { + compression = VIPS_FOREIGN_TIFF_COMPRESSION_JPEG; + +- if( (r = im_getsuboption( q )) ) +- if( sscanf( r, "%d", &Q ) != 1 ) { +- im_error( "im_vips2tiff", +- "%s", _( "bad JPEG quality " +- "parameter" ) ); +- return( -1 ); ++ if ((r = im_getsuboption(q))) ++ if (sscanf(r, "%d", &Q) != 1) { ++ im_error("im_vips2tiff", ++ "%s", _("bad JPEG quality " ++ "parameter")); ++ return (-1); + } + } + else { +- im_error( "im_vips2tiff", _( "unknown compression mode " +- "\"%s\"\nshould be one of \"none\", " +- "\"packbits\", \"ccittfax4\", \"lzw\", " +- "\"deflate\" or \"jpeg\"" ), q ); +- return( -1 ); ++ im_error("im_vips2tiff", _("unknown compression mode " ++ "\"%s\"\nshould be one of \"none\", " ++ "\"packbits\", \"ccittfax4\", \"lzw\", " ++ "\"deflate\" or \"jpeg\""), ++ q); ++ return (-1); + } + } + +- if( (q = im_getnextoption( &p )) ) { +- if( im_isprefix( "tile", q ) ) { ++ if ((q = im_getnextoption(&p))) { ++ if (im_isprefix("tile", q)) { + tile = TRUE; + +- if( (r = im_getsuboption( q )) ) { +- if( sscanf( r, "%dx%d", +- &tile_width, &tile_height ) != 2 ) { +- im_error( "im_vips2tiff", "%s", +- _( "bad tile sizes" ) ); +- return( -1 ); ++ if ((r = im_getsuboption(q))) { ++ if (sscanf(r, "%dx%d", ++ &tile_width, &tile_height) != 2) { ++ im_error("im_vips2tiff", "%s", ++ _("bad tile sizes")); ++ return (-1); + } + } + } +- else if( im_isprefix( "strip", q ) ) ++ else if (im_isprefix("strip", q)) + tile = FALSE; + else { +- im_error( "im_vips2tiff", _( "unknown layout mode " +- "\"%s\"\nshould be one of \"tile\" or " +- "\"strip\"" ), q ); +- return( -1 ); ++ im_error("im_vips2tiff", _("unknown layout mode " ++ "\"%s\"\nshould be one of \"tile\" or " ++ "\"strip\""), ++ q); ++ return (-1); + } + } + +- if( (q = im_getnextoption( &p )) ) { +- if( im_isprefix( "pyramid", q ) ) ++ if ((q = im_getnextoption(&p))) { ++ if (im_isprefix("pyramid", q)) + pyramid = TRUE; +- else if( im_isprefix( "flat", q ) ) ++ else if (im_isprefix("flat", q)) + pyramid = FALSE; + else { +- im_error( "im_vips2tiff", _( "unknown multi-res mode " +- "\"%s\"\nshould be one of \"flat\" or " +- "\"pyramid\"" ), q ); +- return( -1 ); ++ im_error("im_vips2tiff", _("unknown multi-res mode " ++ "\"%s\"\nshould be one of \"flat\" or " ++ "\"pyramid\""), ++ q); ++ return (-1); + } + } + +- if( (q = im_getnextoption( &p )) ) { +- if( im_isprefix( "onebit", q ) ) ++ if ((q = im_getnextoption(&p))) { ++ if (im_isprefix("onebit", q)) + squash = TRUE; +- else if( im_isprefix( "manybit", q ) ) ++ else if (im_isprefix("manybit", q)) + squash = FALSE; + else { +- im_error( "im_vips2tiff", _( "unknown format " +- "\"%s\"\nshould be one of \"onebit\" or " +- "\"manybit\"" ), q ); +- return( -1 ); ++ im_error("im_vips2tiff", _("unknown format " ++ "\"%s\"\nshould be one of \"onebit\" or " ++ "\"manybit\""), ++ q); ++ return (-1); + } + } + +- if( (q = im_getnextoption( &p )) ) { +- if( im_isprefix( "res_cm", q ) ) ++ if ((q = im_getnextoption(&p))) { ++ if (im_isprefix("res_cm", q)) + resunit = VIPS_FOREIGN_TIFF_RESUNIT_CM; +- else if( im_isprefix( "res_inch", q ) ) ++ else if (im_isprefix("res_inch", q)) + resunit = VIPS_FOREIGN_TIFF_RESUNIT_INCH; + else { +- im_error( "im_vips2tiff", _( "unknown resolution unit " +- "\"%s\"\nshould be one of \"res_cm\" or " +- "\"res_inch\"" ), q ); +- return( -1 ); ++ im_error("im_vips2tiff", _("unknown resolution unit " ++ "\"%s\"\nshould be one of \"res_cm\" or " ++ "\"res_inch\""), ++ q); ++ return (-1); + } + +- if( (r = im_getsuboption( q )) ) { +- if( sscanf( r, "%lfx%lf", &xres, &yres ) != 2 ) { +- if( sscanf( r, "%lf", &xres ) != 1 ) { +- im_error( "im_vips2tiff", "%s", +- _( "bad resolution values" ) ); +- return( -1 ); ++ if ((r = im_getsuboption(q))) { ++ if (sscanf(r, "%lfx%lf", &xres, &yres) != 2) { ++ if (sscanf(r, "%lf", &xres) != 1) { ++ im_error("im_vips2tiff", "%s", ++ _("bad resolution values")); ++ return (-1); + } + + yres = xres; +@@ -206,41 +211,41 @@ im_vips2tiff( IMAGE *in, const char *filename ) + * user specifies ",res_inch:72x72" then they are + * using pixels/inch instead and we must convert. + */ +- if( resunit == VIPS_FOREIGN_TIFF_RESUNIT_INCH ) { ++ if (resunit == VIPS_FOREIGN_TIFF_RESUNIT_INCH) { + xres /= 2.54; + yres /= 2.54; + } + } + } + +- if( (q = im_getnextoption( &p )) && strcmp( q, "" ) != 0 ) +- profile = im_strdup( NULL, q ); ++ if ((q = im_getnextoption(&p)) && strcmp(q, "") != 0) ++ profile = im_strdup(NULL, q); + +- if( (q = im_getnextoption( &p )) && strcmp( q, "8" ) == 0 ) ++ if ((q = im_getnextoption(&p)) && strcmp(q, "8") == 0) + bigtiff = TRUE; + +- if( (q = im_getnextoption( &p )) ) { +- im_error( "im_vips2tiff", +- _( "unknown extra options \"%s\"" ), q ); +- return( -1 ); ++ if ((q = im_getnextoption(&p))) { ++ im_error("im_vips2tiff", ++ _("unknown extra options \"%s\""), q); ++ return (-1); + } + +- if( vips_tiffsave( in, name, +- "compression", compression, +- "Q", Q, +- "predictor", predictor, +- "profile", profile, +- "tile", tile, +- "tile_width", tile_width, +- "tile_height", tile_height, +- "pyramid", pyramid, +- "squash", squash, +- "resunit", resunit, +- "xres", xres, +- "yres", yres, +- "bigtiff", bigtiff, +- NULL ) ) +- return( -1 ); +- +- return( 0 ); ++ if (vips_tiffsave(in, name, ++ "compression", compression, ++ "Q", Q, ++ "predictor", predictor, ++ "profile", profile, ++ "tile", tile, ++ "tile_width", tile_width, ++ "tile_height", tile_height, ++ "pyramid", pyramid, ++ "squash", squash, ++ "resunit", resunit, ++ "xres", xres, ++ "yres", yres, ++ "bigtiff", bigtiff, ++ NULL)) ++ return (-1); ++ ++ return (0); + } +diff --git a/libvips/deprecated/im_vips2webp.c b/libvips/deprecated/im_vips2webp.c +index 5ea625a287..98d43e8c01 100644 +--- a/libvips/deprecated/im_vips2webp.c ++++ b/libvips/deprecated/im_vips2webp.c +@@ -1,27 +1,27 @@ + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -44,10 +44,10 @@ + #include + + int +-im_vips2webp( IMAGE *in, const char *filename ) ++im_vips2webp(IMAGE *in, const char *filename) + { +- int compression; +- int lossless; ++ int compression; ++ int lossless; + + char *p, *q; + +@@ -55,17 +55,16 @@ im_vips2webp( IMAGE *in, const char *filename ) + char mode[FILENAME_MAX]; + char buf[FILENAME_MAX]; + +- im_filename_split( filename, name, mode ); +- strcpy( buf, mode ); ++ im_filename_split(filename, name, mode); ++ strcpy(buf, mode); + p = &buf[0]; + compression = 6; + lossless = 0; +- if( (q = im_getnextoption( &p )) ) +- compression = atoi( q ); +- if( (q = im_getnextoption( &p )) ) +- lossless = atoi( q ); ++ if ((q = im_getnextoption(&p))) ++ compression = atoi(q); ++ if ((q = im_getnextoption(&p))) ++ lossless = atoi(q); + +- return( vips_webpsave( in, name, +- "Q", compression, "lossless", lossless, NULL ) ); ++ return (vips_webpsave(in, name, ++ "Q", compression, "lossless", lossless, NULL)); + } +- +diff --git a/libvips/deprecated/im_webp2vips.c b/libvips/deprecated/im_webp2vips.c +index 3adb594603..98e3a3f60f 100644 +--- a/libvips/deprecated/im_webp2vips.c ++++ b/libvips/deprecated/im_webp2vips.c +@@ -1,27 +1,27 @@ + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,70 +43,70 @@ + #include "../foreign/pforeign.h" + + static int +-webp2vips( const char *name, IMAGE *out, gboolean header_only ) ++webp2vips(const char *name, IMAGE *out, gboolean header_only) + { + char filename[FILENAME_MAX]; + char mode[FILENAME_MAX]; + +- im_filename_split( name, filename, mode ); ++ im_filename_split(name, filename, mode); + + #ifdef HAVE_LIBWEBP +-{ +- VipsSource *source; +- int result; +- +- if( !(source = vips_source_new_from_file( filename )) ) +- return( -1 ); +- if( header_only ) +- result = vips__webp_read_header_source( source, out, 0, 1, 1 ); +- else +- result = vips__webp_read_source( source, out, 0, 1, 1 ); +- VIPS_UNREF( source ); +- +- if( result ) +- return( result ); +-} ++ { ++ VipsSource *source; ++ int result; ++ ++ if (!(source = vips_source_new_from_file(filename))) ++ return (-1); ++ if (header_only) ++ result = vips__webp_read_header_source(source, out, 0, 1, 1); ++ else ++ result = vips__webp_read_source(source, out, 0, 1, 1); ++ VIPS_UNREF(source); ++ ++ if (result) ++ return (result); ++ } + #else +- vips_error( "im_webp2vips", +- "%s", _( "no webp support in your libvips" ) ); ++ vips_error("im_webp2vips", ++ "%s", _("no webp support in your libvips")); + +- return( -1 ); ++ return (-1); + #endif /*HAVE_LIBWEBP*/ + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips__iswebp( const char *filename ) ++vips__iswebp(const char *filename) + { + gboolean result; + + #ifdef HAVE_LIBWEBP + VipsSource *source; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( FALSE ); +- result = vips__iswebp_source( source ); +- VIPS_UNREF( source ); +-#else /*!HAVE_LIBWEBP*/ ++ if (!(source = vips_source_new_from_file(filename))) ++ return (FALSE); ++ result = vips__iswebp_source(source); ++ VIPS_UNREF(source); ++#else /*!HAVE_LIBWEBP*/ + result = -1; + #endif /*HAVE_LIBWEBP*/ + +- return( result ); ++ return (result); + } + + int +-im_webp2vips( const char *name, IMAGE *out ) ++im_webp2vips(const char *name, IMAGE *out) + { +- return( webp2vips( name, out, FALSE ) ); ++ return (webp2vips(name, out, FALSE)); + } + + #ifdef HAVE_LIBWEBP + + static int +-im_webp2vips_header( const char *name, IMAGE *out ) ++im_webp2vips_header(const char *name, IMAGE *out) + { +- return( webp2vips( name, out, TRUE ) ); ++ return (webp2vips(name, out, TRUE)); + } + + static const char *webp_suffs[] = { ".webp", NULL }; +@@ -115,13 +115,13 @@ typedef VipsFormat VipsFormatWebp; + typedef VipsFormatClass VipsFormatWebpClass; + + static void +-vips_format_webp_class_init( VipsFormatWebpClass *class ) ++vips_format_webp_class_init(VipsFormatWebpClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsFormatClass *format_class = (VipsFormatClass *) class; + + object_class->nickname = "webp"; +- object_class->description = _( "webp" ); ++ object_class->description = _("webp"); + + format_class->is_a = vips__iswebp; + format_class->header = im_webp2vips_header; +@@ -131,11 +131,10 @@ vips_format_webp_class_init( VipsFormatWebpClass *class ) + } + + static void +-vips_format_webp_init( VipsFormatWebp *object ) ++vips_format_webp_init(VipsFormatWebp *object) + { + } + +-G_DEFINE_TYPE( VipsFormatWebp, vips_format_webp, VIPS_TYPE_FORMAT ); ++G_DEFINE_TYPE(VipsFormatWebp, vips_format_webp, VIPS_TYPE_FORMAT); + + #endif /*HAVE_LIBWEBP*/ +- +diff --git a/libvips/deprecated/im_zerox.c b/libvips/deprecated/im_zerox.c +index fa3242faf2..b943b6257f 100644 +--- a/libvips/deprecated/im_zerox.c ++++ b/libvips/deprecated/im_zerox.c +@@ -4,7 +4,7 @@ + * + * Author: Nicos Dessipris + * Written on: 12/02/1990 +- * Modified on : ++ * Modified on : + * 1/2/95 JC + * - rewritten for PIO + * - some bugs removed +@@ -17,28 +17,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -53,68 +53,79 @@ + #include + #include + +-#define LOOP( TYPE ) { \ +- for( i = 0; i < ne; i++ ) { \ +- TYPE p1 = ((TYPE *)p)[i]; \ +- TYPE p2 = ((TYPE *)p)[i + ba]; \ +- \ +- if( flag == 1 && p1 > 0 && p2 <= 0 ) \ +- q[i] = 255; \ +- else if( flag == -1 && p1 < 0 && p2 >= 0 ) \ +- q[i] = 255; \ +- else \ +- q[i] = 0; \ +- } \ +-} ++#define LOOP(TYPE) \ ++ { \ ++ for (i = 0; i < ne; i++) { \ ++ TYPE p1 = ((TYPE *) p)[i]; \ ++ TYPE p2 = ((TYPE *) p)[i + ba]; \ ++\ ++ if (flag == 1 && p1 > 0 && p2 <= 0) \ ++ q[i] = 255; \ ++ else if (flag == -1 && p1 < 0 && p2 >= 0) \ ++ q[i] = 255; \ ++ else \ ++ q[i] = 0; \ ++ } \ ++ } + + /* Zerox generate function. + */ + static int +-zerox_gen( REGION *or, void *seq, void *a, void *b ) ++zerox_gen(REGION * or, void *seq, void *a, void *b) + { + REGION *ir = (REGION *) seq; + IMAGE *in = (IMAGE *) a; +- int flag = GPOINTER_TO_INT( b ); ++ int flag = GPOINTER_TO_INT(b); + Rect irect; +- Rect *r = &or->valid; ++ Rect *r = & or->valid; + +- /* Range of pixels we loop over. ++ /* Range of pixels we loop over. + */ + int le = r->left; + int to = r->top; +- int bo = IM_RECT_BOTTOM( r ); ++ int bo = IM_RECT_BOTTOM(r); + int ba = in->Bands; + int ne = ba * r->width; + + int i, y; + +- /* We need to be able to see one pixel to the right. ++ /* We need to be able to see one pixel to the right. + */ + irect.top = r->top; + irect.left = r->left; + irect.width = r->width + 1; + irect.height = r->height; +- if( im_prepare( ir, &irect ) ) +- return( -1 ); +- +- for( y = to; y < bo; y++ ) { +- VipsPel *p = IM_REGION_ADDR( ir, le, y ); +- VipsPel *q = IM_REGION_ADDR( or, le, y ); +- +- switch( in->BandFmt ) { +- case IM_BANDFMT_CHAR: LOOP( signed char ); break; +- case IM_BANDFMT_SHORT: LOOP( signed short ); break; +- case IM_BANDFMT_INT: LOOP( signed int ); break; +- case IM_BANDFMT_FLOAT: LOOP( float ); break; +- case IM_BANDFMT_DOUBLE: LOOP( double ); break; ++ if (im_prepare(ir, &irect)) ++ return (-1); ++ ++ for (y = to; y < bo; y++) { ++ VipsPel *p = IM_REGION_ADDR(ir, le, y); ++ VipsPel *q = IM_REGION_ADDR(or, le, y); ++ ++ switch (in->BandFmt) { ++ case IM_BANDFMT_CHAR: ++ LOOP(signed char); ++ break; ++ case IM_BANDFMT_SHORT: ++ LOOP(signed short); ++ break; ++ case IM_BANDFMT_INT: ++ LOOP(signed int); ++ break; ++ case IM_BANDFMT_FLOAT: ++ LOOP(float); ++ break; ++ case IM_BANDFMT_DOUBLE: ++ LOOP(double); ++ break; + + default: +- g_assert( 0 ); ++ g_assert(0); + } + } + +- return( 0 ); +-} ++ return (0); ++} + + /** + * im_zerox: +@@ -122,63 +133,63 @@ zerox_gen( REGION *or, void *seq, void *a, void *b ) + * @out: output image + * @sign: detect positive or negative zero crossings + * +- * im_zerox() detects the positive or negative zero crossings @in, ++ * im_zerox() detects the positive or negative zero crossings @in, + * depending on @sign. If @sign is -1, negative zero crossings are returned, + * if @sign is 1, positive zero crossings are returned. + * + * The output image is byte with zero crossing set to 255 and all other values +- * set to zero. Input can have any number of channels, and be any non-complex ++ * set to zero. Input can have any number of channels, and be any non-complex + * type. + * + * See also: im_conv(), im_rot90. + * + * Returns: 0 on success, -1 on error + */ +-int +-im_zerox( IMAGE *in, IMAGE *out, int sign ) ++int ++im_zerox(IMAGE *in, IMAGE *out, int sign) + { + IMAGE *t1; + +- if( sign != -1 && sign != 1 ) { +- im_error( "im_zerox", "%s", _( "flag not -1 or 1" ) ); +- return( -1 ); ++ if (sign != -1 && sign != 1) { ++ im_error("im_zerox", "%s", _("flag not -1 or 1")); ++ return (-1); + } +- if( in->Xsize < 2 ) { +- im_error( "im_zerox", "%s", _( "image too narrow" ) ); +- return( -1 ); ++ if (in->Xsize < 2) { ++ im_error("im_zerox", "%s", _("image too narrow")); ++ return (-1); + } +- if( !(t1 = im_open_local( out, "im_zerox" , "p" )) || +- im_piocheck( in, t1 ) || +- im_check_uncoded( "im_zerox", in ) || +- im_check_noncomplex( "im_zerox", in ) ) +- return( -1 ); +- if( vips_bandfmt_isuint( in->BandFmt ) ) ++ if (!(t1 = im_open_local(out, "im_zerox", "p")) || ++ im_piocheck(in, t1) || ++ im_check_uncoded("im_zerox", in) || ++ im_check_noncomplex("im_zerox", in)) ++ return (-1); ++ if (vips_bandfmt_isuint(in->BandFmt)) + /* Unsigned type, therefore there will be no zero-crossings. + */ +- return( im_black( out, in->Xsize, in->Ysize, in->Bands ) ); ++ return (im_black(out, in->Xsize, in->Ysize, in->Bands)); + + /* Force output to be BYTE. Output is narrower than input by 1 pixel. + */ +- if( im_cp_desc( t1, in ) ) +- return( -1 ); ++ if (im_cp_desc(t1, in)) ++ return (-1); + t1->BandFmt = IM_BANDFMT_UCHAR; + t1->Xsize -= 1; + + /* Set hints - THINSTRIP is ok with us. + */ +- if( im_demand_hint( t1, IM_THINSTRIP, NULL ) ) +- return( -1 ); ++ if (im_demand_hint(t1, IM_THINSTRIP, NULL)) ++ return (-1); + + /* Generate image. + */ +- if( im_generate( t1, im_start_one, zerox_gen, im_stop_one, +- in, GINT_TO_POINTER( sign ) ) ) +- return( -1 ); ++ if (im_generate(t1, im_start_one, zerox_gen, im_stop_one, ++ in, GINT_TO_POINTER(sign))) ++ return (-1); + + /* Now embed it in a larger image. + */ +- if( im_embed( t1, out, 0, 0, 0, in->Xsize, in->Ysize ) ) +- return( -1 ); ++ if (im_embed(t1, out, 0, 0, 0, in->Xsize, in->Ysize)) ++ return (-1); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/deprecated/inplace_dispatch.c b/libvips/deprecated/inplace_dispatch.c +index 3acd5a7e54..fe7e9b139a 100644 +--- a/libvips/deprecated/inplace_dispatch.c ++++ b/libvips/deprecated/inplace_dispatch.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -44,149 +44,165 @@ + * valid. + */ + VipsPel * +-im__vector_to_ink( const char *domain, IMAGE *im, int n, double *vec ) ++im__vector_to_ink(const char *domain, IMAGE *im, int n, double *vec) + { + IMAGE *t[3]; + double *zeros; + int i; + +- if( im_check_vector( domain, n, im ) ) +- return( NULL ); +- if( im_open_local_array( im, t, 3, domain, "t" ) || +- !(zeros = IM_ARRAY( im, n, double )) ) +- return( NULL ); +- for( i = 0; i < n; i++ ) ++ if (im_check_vector(domain, n, im)) ++ return (NULL); ++ if (im_open_local_array(im, t, 3, domain, "t") || ++ !(zeros = IM_ARRAY(im, n, double))) ++ return (NULL); ++ for (i = 0; i < n; i++) + zeros[i] = 0.0; + +- if( im_black( t[0], 1, 1, im->Bands ) || +- im_lintra_vec( n, zeros, t[0], vec, t[1] ) || +- im_clip2fmt( t[1], t[2], im->BandFmt ) ) +- return( NULL ); ++ if (im_black(t[0], 1, 1, im->Bands) || ++ im_lintra_vec(n, zeros, t[0], vec, t[1]) || ++ im_clip2fmt(t[1], t[2], im->BandFmt)) ++ return (NULL); + +- return( t[2]->data ); ++ return (t[2]->data); + } + + double * +-im__ink_to_vector( const char *domain, IMAGE *im, VipsPel *ink ) ++im__ink_to_vector(const char *domain, IMAGE *im, VipsPel *ink) + { + double *vec; + int i; + +- if( im_check_uncoded( "im__ink_to_vector", im ) || +- im_check_noncomplex( "im__ink_to_vector", im ) ) +- return( NULL ); +- if( !(vec = IM_ARRAY( NULL, im->Bands, double )) ) +- return( NULL ); ++ if (im_check_uncoded("im__ink_to_vector", im) || ++ im_check_noncomplex("im__ink_to_vector", im)) ++ return (NULL); ++ if (!(vec = IM_ARRAY(NULL, im->Bands, double))) ++ return (NULL); + +-#define READ( TYPE ) \ ++#define READ(TYPE) \ + vec[i] = ((TYPE *) ink)[i]; + +- for( i = 0; i < im->Bands; i++ ) +- switch( im->BandFmt ) { +- case IM_BANDFMT_UCHAR: READ( unsigned char ); break; +- case IM_BANDFMT_CHAR: READ( signed char ); break; +- case IM_BANDFMT_USHORT: READ( unsigned short ); break; +- case IM_BANDFMT_SHORT: READ( signed short ); break; +- case IM_BANDFMT_UINT: READ( unsigned int ); break; +- case IM_BANDFMT_INT: READ( signed int ); break; +- case IM_BANDFMT_FLOAT: READ( float ); break; +- case IM_BANDFMT_DOUBLE: READ( double ); break; ++ for (i = 0; i < im->Bands; i++) ++ switch (im->BandFmt) { ++ case IM_BANDFMT_UCHAR: ++ READ(unsigned char); ++ break; ++ case IM_BANDFMT_CHAR: ++ READ(signed char); ++ break; ++ case IM_BANDFMT_USHORT: ++ READ(unsigned short); ++ break; ++ case IM_BANDFMT_SHORT: ++ READ(signed short); ++ break; ++ case IM_BANDFMT_UINT: ++ READ(unsigned int); ++ break; ++ case IM_BANDFMT_INT: ++ READ(signed int); ++ break; ++ case IM_BANDFMT_FLOAT: ++ READ(float); ++ break; ++ case IM_BANDFMT_DOUBLE: ++ READ(double); ++ break; + + default: +- g_assert( 0 ); ++ g_assert(0); + } + +- return( vec ); ++ return (vec); + } + + /* Args for im_draw_image. + */ + static im_arg_desc draw_image_args[] = { +- IM_RW_IMAGE( "image" ), +- IM_INPUT_IMAGE( "sub" ), +- IM_INPUT_INT( "x" ), +- IM_INPUT_INT( "y" ) ++ IM_RW_IMAGE("image"), ++ IM_INPUT_IMAGE("sub"), ++ IM_INPUT_INT("x"), ++ IM_INPUT_INT("y") + }; + + /* Call im_draw_image via arg vector. + */ + static int +-draw_image_vec( im_object *argv ) ++draw_image_vec(im_object *argv) + { + int x = *((int *) argv[2]); + int y = *((int *) argv[3]); + +- return( im_draw_image( argv[0], argv[1], x, y ) ); ++ return (im_draw_image(argv[0], argv[1], x, y)); + } + + /* Description of im_draw_image. +- */ ++ */ + static im_function draw_image_desc = { +- "im_draw_image", /* Name */ ++ "im_draw_image", /* Name */ + "draw image sub inside image main at position (x,y)", +- 0, /* Flags */ +- draw_image_vec, /* Dispatch function */ +- IM_NUMBER( draw_image_args ), /* Size of arg list */ +- draw_image_args /* Arg list */ ++ 0, /* Flags */ ++ draw_image_vec, /* Dispatch function */ ++ IM_NUMBER(draw_image_args), /* Size of arg list */ ++ draw_image_args /* Arg list */ + }; + + /* Args for im_lineset. + */ + static im_arg_desc lineset_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_IMAGE( "mask" ), +- IM_INPUT_IMAGE( "ink" ), +- IM_INPUT_INTVEC( "x1" ), +- IM_INPUT_INTVEC( "y1" ), +- IM_INPUT_INTVEC( "x2" ), +- IM_INPUT_INTVEC( "y2" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_IMAGE("mask"), ++ IM_INPUT_IMAGE("ink"), ++ IM_INPUT_INTVEC("x1"), ++ IM_INPUT_INTVEC("y1"), ++ IM_INPUT_INTVEC("x2"), ++ IM_INPUT_INTVEC("y2") + }; + + /* Call im_lineset via arg vector. + */ + static int +-lineset_vec( im_object *argv ) ++lineset_vec(im_object *argv) + { + im_intvec_object *x1v = (im_intvec_object *) argv[4]; + im_intvec_object *y1v = (im_intvec_object *) argv[5]; + im_intvec_object *x2v = (im_intvec_object *) argv[6]; + im_intvec_object *y2v = (im_intvec_object *) argv[7]; + +- if( x1v->n != y1v->n || x1v->n != x2v->n || x1v->n != y2v->n ) { +- im_error( "im_lineset", "%s", _( "vectors not same length" ) ); +- return( -1 ); ++ if (x1v->n != y1v->n || x1v->n != x2v->n || x1v->n != y2v->n) { ++ im_error("im_lineset", "%s", _("vectors not same length")); ++ return (-1); + } + +- return( im_lineset( argv[0], argv[1], argv[2], argv[3], +- x1v->n, x1v->vec, y1v->vec, x2v->vec, y2v->vec ) ); ++ return (im_lineset(argv[0], argv[1], argv[2], argv[3], ++ x1v->n, x1v->vec, y1v->vec, x2v->vec, y2v->vec)); + } + + /* Description of im_lineset. +- */ ++ */ + static im_function lineset_desc = { +- "im_lineset", /* Name */ ++ "im_lineset", /* Name */ + "draw line between points (x1,y1) and (x2,y2)", +- 0, /* Flags */ +- lineset_vec, /* Dispatch function */ +- IM_NUMBER( lineset_args ), /* Size of arg list */ +- lineset_args /* Arg list */ ++ 0, /* Flags */ ++ lineset_vec, /* Dispatch function */ ++ IM_NUMBER(lineset_args), /* Size of arg list */ ++ lineset_args /* Arg list */ + }; + + /* Args for im_draw_mask. + */ + static im_arg_desc draw_mask_args[] = { +- IM_RW_IMAGE( "image" ), +- IM_INPUT_IMAGE( "mask" ), +- IM_INPUT_INT( "x" ), +- IM_INPUT_INT( "y" ), +- IM_INPUT_DOUBLEVEC( "ink" ) ++ IM_RW_IMAGE("image"), ++ IM_INPUT_IMAGE("mask"), ++ IM_INPUT_INT("x"), ++ IM_INPUT_INT("y"), ++ IM_INPUT_DOUBLEVEC("ink") + }; + + /* Call im_draw_mask via arg vector. + */ + static int +-draw_mask_vec( im_object *argv ) ++draw_mask_vec(im_object *argv) + { + IMAGE *image = argv[0]; + IMAGE *mask = argv[1]; +@@ -196,37 +212,37 @@ draw_mask_vec( im_object *argv ) + + VipsPel *ink; + +- if( !(ink = im__vector_to_ink( "im_draw_mask", +- image, dv->n, dv->vec )) ) +- return( -1 ); ++ if (!(ink = im__vector_to_ink("im_draw_mask", ++ image, dv->n, dv->vec))) ++ return (-1); + +- return( im_draw_mask( image, mask, x, y, ink ) ); ++ return (im_draw_mask(image, mask, x, y, ink)); + } + + /* Description of im_draw_mask. +- */ ++ */ + static im_function draw_mask_desc = { +- "im_draw_mask", /* Name */ ++ "im_draw_mask", /* Name */ + "draw mask sub inside image main at position (x,y)", +- 0, /* Flags */ +- draw_mask_vec, /* Dispatch function */ +- IM_NUMBER( draw_mask_args ), /* Size of arg list */ +- draw_mask_args /* Arg list */ ++ 0, /* Flags */ ++ draw_mask_vec, /* Dispatch function */ ++ IM_NUMBER(draw_mask_args), /* Size of arg list */ ++ draw_mask_args /* Arg list */ + }; + + /* Args for im_draw_flood_blob(). + */ + static im_arg_desc draw_flood_blob_args[] = { +- IM_RW_IMAGE( "image" ), +- IM_INPUT_INT( "x" ), +- IM_INPUT_INT( "y" ), +- IM_INPUT_DOUBLEVEC( "ink" ) ++ IM_RW_IMAGE("image"), ++ IM_INPUT_INT("x"), ++ IM_INPUT_INT("y"), ++ IM_INPUT_DOUBLEVEC("ink") + }; + + /* Call im_draw_flood_blob() via arg vector. + */ + static int +-draw_flood_blob_vec( im_object *argv ) ++draw_flood_blob_vec(im_object *argv) + { + IMAGE *image = argv[0]; + int x = *((int *) argv[1]); +@@ -235,37 +251,37 @@ draw_flood_blob_vec( im_object *argv ) + + VipsPel *ink; + +- if( !(ink = im__vector_to_ink( "im_draw_flood_blob", +- image, dv->n, dv->vec )) ) +- return( -1 ); ++ if (!(ink = im__vector_to_ink("im_draw_flood_blob", ++ image, dv->n, dv->vec))) ++ return (-1); + +- return( im_draw_flood_blob( image, x, y, ink, NULL ) ); ++ return (im_draw_flood_blob(image, x, y, ink, NULL)); + } + + /* Description of im_draw_flood_blob(). +- */ ++ */ + static im_function draw_flood_blob_desc = { +- "im_draw_flood_blob", /* Name */ ++ "im_draw_flood_blob", /* Name */ + "flood with ink from x, y while pixel == start", +- 0, /* Flags */ +- draw_flood_blob_vec, /* Dispatch function */ +- IM_NUMBER( draw_flood_blob_args ),/* Size of arg list */ +- draw_flood_blob_args /* Arg list */ ++ 0, /* Flags */ ++ draw_flood_blob_vec, /* Dispatch function */ ++ IM_NUMBER(draw_flood_blob_args), /* Size of arg list */ ++ draw_flood_blob_args /* Arg list */ + }; + + /* Args for im_draw_flood(). + */ + static im_arg_desc draw_flood_args[] = { +- IM_RW_IMAGE( "image" ), +- IM_INPUT_INT( "x" ), +- IM_INPUT_INT( "y" ), +- IM_INPUT_DOUBLEVEC( "ink" ) ++ IM_RW_IMAGE("image"), ++ IM_INPUT_INT("x"), ++ IM_INPUT_INT("y"), ++ IM_INPUT_DOUBLEVEC("ink") + }; + + /* Call im_draw_flood() via arg vector. + */ + static int +-draw_flood_vec( im_object *argv ) ++draw_flood_vec(im_object *argv) + { + IMAGE *image = argv[0]; + int x = *((int *) argv[1]); +@@ -274,38 +290,38 @@ draw_flood_vec( im_object *argv ) + + VipsPel *ink; + +- if( !(ink = im__vector_to_ink( "im_draw_flood", +- image, dv->n, dv->vec )) ) +- return( -1 ); ++ if (!(ink = im__vector_to_ink("im_draw_flood", ++ image, dv->n, dv->vec))) ++ return (-1); + +- return( im_draw_flood( image, x, y, ink, NULL ) ); ++ return (im_draw_flood(image, x, y, ink, NULL)); + } + + /* Description of im_draw_flood(). +- */ ++ */ + static im_function draw_flood_desc = { +- "im_draw_flood", /* Name */ ++ "im_draw_flood", /* Name */ + "flood with ink from x, y while pixel != ink", +- 0, /* Flags */ +- draw_flood_vec, /* Dispatch function */ +- IM_NUMBER( draw_flood_args ),/* Size of arg list */ +- draw_flood_args /* Arg list */ ++ 0, /* Flags */ ++ draw_flood_vec, /* Dispatch function */ ++ IM_NUMBER(draw_flood_args), /* Size of arg list */ ++ draw_flood_args /* Arg list */ + }; + + /* Args for im_draw_flood_other(). + */ + static im_arg_desc draw_flood_other_args[] = { +- IM_RW_IMAGE( "image" ), +- IM_INPUT_IMAGE( "test" ), +- IM_INPUT_INT( "x" ), +- IM_INPUT_INT( "y" ), +- IM_INPUT_INT( "serial" ) ++ IM_RW_IMAGE("image"), ++ IM_INPUT_IMAGE("test"), ++ IM_INPUT_INT("x"), ++ IM_INPUT_INT("y"), ++ IM_INPUT_INT("serial") + }; + + /* Call im_draw_flood_other() via arg vector. + */ + static int +-draw_flood_other_vec( im_object *argv ) ++draw_flood_other_vec(im_object *argv) + { + IMAGE *image = argv[0]; + IMAGE *test = argv[1]; +@@ -313,33 +329,33 @@ draw_flood_other_vec( im_object *argv ) + int y = *((int *) argv[3]); + int serial = *((int *) argv[4]); + +- return( im_draw_flood_other( image, test, x, y, serial, NULL ) ); ++ return (im_draw_flood_other(image, test, x, y, serial, NULL)); + } + + /* Description of im_draw_flood_other(). +- */ ++ */ + static im_function draw_flood_other_desc = { +- "im_draw_flood_other", /* Name */ ++ "im_draw_flood_other", /* Name */ + "flood image with serial from x, y while pixel == start", +- 0, /* Flags */ +- draw_flood_other_vec, /* Dispatch function */ +- IM_NUMBER( draw_flood_other_args ),/* Size of arg list */ +- draw_flood_other_args /* Arg list */ ++ 0, /* Flags */ ++ draw_flood_other_vec, /* Dispatch function */ ++ IM_NUMBER(draw_flood_other_args), /* Size of arg list */ ++ draw_flood_other_args /* Arg list */ + }; + + /* Args for im_draw_point. + */ + static im_arg_desc draw_point_args[] = { +- IM_RW_IMAGE( "image" ), +- IM_INPUT_INT( "x" ), +- IM_INPUT_INT( "y" ), +- IM_INPUT_DOUBLEVEC( "ink" ) ++ IM_RW_IMAGE("image"), ++ IM_INPUT_INT("x"), ++ IM_INPUT_INT("y"), ++ IM_INPUT_DOUBLEVEC("ink") + }; + + /* Call im_draw_point via arg vector. + */ + static int +-draw_point_vec( im_object *argv ) ++draw_point_vec(im_object *argv) + { + IMAGE *image = argv[0]; + int x = *((int *) argv[1]); +@@ -348,37 +364,37 @@ draw_point_vec( im_object *argv ) + + VipsPel *ink; + +- if( !(ink = im__vector_to_ink( "im_draw_point", +- image, dv->n, dv->vec )) ) +- return( -1 ); ++ if (!(ink = im__vector_to_ink("im_draw_point", ++ image, dv->n, dv->vec))) ++ return (-1); + +- return( im_draw_point( image, x, y, ink ) ); ++ return (im_draw_point(image, x, y, ink)); + } + + /* Description of im_draw_point. +- */ ++ */ + static im_function draw_point_desc = { +- "im_draw_point", /* Name */ ++ "im_draw_point", /* Name */ + "draw point on image", +- 0, /* Flags */ +- draw_point_vec, /* Dispatch function */ +- IM_NUMBER( draw_point_args ), /* Size of arg list */ +- draw_point_args /* Arg list */ ++ 0, /* Flags */ ++ draw_point_vec, /* Dispatch function */ ++ IM_NUMBER(draw_point_args), /* Size of arg list */ ++ draw_point_args /* Arg list */ + }; + + /* Args for im_read_point. + */ + static im_arg_desc read_point_args[] = { +- IM_INPUT_IMAGE( "image" ), +- IM_INPUT_INT( "x" ), +- IM_INPUT_INT( "y" ), +- IM_OUTPUT_DOUBLEVEC( "ink" ) ++ IM_INPUT_IMAGE("image"), ++ IM_INPUT_INT("x"), ++ IM_INPUT_INT("y"), ++ IM_OUTPUT_DOUBLEVEC("ink") + }; + + /* Call im_read_point via arg vector. + */ + static int +-read_point_vec( im_object *argv ) ++read_point_vec(im_object *argv) + { + IMAGE *image = argv[0]; + int x = *((int *) argv[1]); +@@ -387,41 +403,41 @@ read_point_vec( im_object *argv ) + + VipsPel *ink; + +- if( !(ink = IM_ARRAY( image, IM_IMAGE_SIZEOF_PEL( image ), VipsPel )) || +- im_read_point( image, x, y, ink ) || +- !(dv->vec = im__ink_to_vector( "im_read_point", image, ink )) ) +- return( -1 ); ++ if (!(ink = IM_ARRAY(image, IM_IMAGE_SIZEOF_PEL(image), VipsPel)) || ++ im_read_point(image, x, y, ink) || ++ !(dv->vec = im__ink_to_vector("im_read_point", image, ink))) ++ return (-1); + dv->n = image->Bands; + +- return( 0 ); ++ return (0); + } + + /* Description of im_read_point. +- */ ++ */ + static im_function read_point_desc = { +- "im_read_point", /* Name */ ++ "im_read_point", /* Name */ + "read point from image", +- 0, /* Flags */ +- read_point_vec, /* Dispatch function */ +- IM_NUMBER( read_point_args ), /* Size of arg list */ +- read_point_args /* Arg list */ ++ 0, /* Flags */ ++ read_point_vec, /* Dispatch function */ ++ IM_NUMBER(read_point_args), /* Size of arg list */ ++ read_point_args /* Arg list */ + }; + + /* Args for im_draw_line. + */ + static im_arg_desc draw_line_args[] = { +- IM_RW_IMAGE( "image" ), +- IM_INPUT_INT( "x1" ), +- IM_INPUT_INT( "y1" ), +- IM_INPUT_INT( "x2" ), +- IM_INPUT_INT( "y2" ), +- IM_INPUT_DOUBLEVEC( "ink" ) ++ IM_RW_IMAGE("image"), ++ IM_INPUT_INT("x1"), ++ IM_INPUT_INT("y1"), ++ IM_INPUT_INT("x2"), ++ IM_INPUT_INT("y2"), ++ IM_INPUT_DOUBLEVEC("ink") + }; + + /* Call im_draw_line via arg vector. + */ + static int +-draw_line_vec( im_object *argv ) ++draw_line_vec(im_object *argv) + { + IMAGE *image = argv[0]; + int x1 = *((int *) argv[1]); +@@ -432,38 +448,38 @@ draw_line_vec( im_object *argv ) + + VipsPel *ink; + +- if( !(ink = im__vector_to_ink( "im_draw_line", +- image, dv->n, dv->vec )) ) +- return( -1 ); ++ if (!(ink = im__vector_to_ink("im_draw_line", ++ image, dv->n, dv->vec))) ++ return (-1); + +- return( im_draw_line( image, x1, y1, x2, y2, ink ) ); ++ return (im_draw_line(image, x1, y1, x2, y2, ink)); + } + + /* Description of im_draw_line. +- */ ++ */ + static im_function draw_line_desc = { +- "im_draw_line", /* Name */ ++ "im_draw_line", /* Name */ + "draw line on image", +- 0, /* Flags */ +- draw_line_vec, /* Dispatch function */ +- IM_NUMBER( draw_line_args ), /* Size of arg list */ +- draw_line_args /* Arg list */ ++ 0, /* Flags */ ++ draw_line_vec, /* Dispatch function */ ++ IM_NUMBER(draw_line_args), /* Size of arg list */ ++ draw_line_args /* Arg list */ + }; + + /* Args for im_draw_smudge. + */ + static im_arg_desc draw_smudge_args[] = { +- IM_RW_IMAGE( "image" ), +- IM_INPUT_INT( "left" ), +- IM_INPUT_INT( "top" ), +- IM_INPUT_INT( "width" ), +- IM_INPUT_INT( "height" ) ++ IM_RW_IMAGE("image"), ++ IM_INPUT_INT("left"), ++ IM_INPUT_INT("top"), ++ IM_INPUT_INT("width"), ++ IM_INPUT_INT("height") + }; + + /* Call im_draw_smudge via arg vector. + */ + static int +-draw_smudge_vec( im_object *argv ) ++draw_smudge_vec(im_object *argv) + { + IMAGE *image = argv[0]; + int left = *((int *) argv[1]); +@@ -471,36 +487,36 @@ draw_smudge_vec( im_object *argv ) + int width = *((int *) argv[3]); + int height = *((int *) argv[4]); + +- return( im_draw_smudge( image, left, top, width, height ) ); ++ return (im_draw_smudge(image, left, top, width, height)); + } + + /* Description of im_draw_smudge. +- */ ++ */ + static im_function draw_smudge_desc = { +- "im_draw_smudge", /* Name */ ++ "im_draw_smudge", /* Name */ + "smudge part of an image", +- 0, /* Flags */ +- draw_smudge_vec, /* Dispatch function */ +- IM_NUMBER( draw_smudge_args ), /* Size of arg list */ +- draw_smudge_args /* Arg list */ ++ 0, /* Flags */ ++ draw_smudge_vec, /* Dispatch function */ ++ IM_NUMBER(draw_smudge_args), /* Size of arg list */ ++ draw_smudge_args /* Arg list */ + }; + + /* Args for im_draw_rect. + */ + static im_arg_desc draw_rect_args[] = { +- IM_RW_IMAGE( "image" ), +- IM_INPUT_INT( "left" ), +- IM_INPUT_INT( "top" ), +- IM_INPUT_INT( "width" ), +- IM_INPUT_INT( "height" ), +- IM_INPUT_INT( "fill" ), +- IM_INPUT_DOUBLEVEC( "ink" ) ++ IM_RW_IMAGE("image"), ++ IM_INPUT_INT("left"), ++ IM_INPUT_INT("top"), ++ IM_INPUT_INT("width"), ++ IM_INPUT_INT("height"), ++ IM_INPUT_INT("fill"), ++ IM_INPUT_DOUBLEVEC("ink") + }; + + /* Call im_draw_rect via arg vector. + */ + static int +-draw_rect_vec( im_object *argv ) ++draw_rect_vec(im_object *argv) + { + IMAGE *image = argv[0]; + int left = *((int *) argv[1]); +@@ -512,39 +528,39 @@ draw_rect_vec( im_object *argv ) + + VipsPel *ink; + +- if( !(ink = im__vector_to_ink( "im_draw_rect", +- image, dv->n, dv->vec )) ) +- return( -1 ); ++ if (!(ink = im__vector_to_ink("im_draw_rect", ++ image, dv->n, dv->vec))) ++ return (-1); + +- return( im_draw_rect( image, left, top, width, height, fill, ink ) ); ++ return (im_draw_rect(image, left, top, width, height, fill, ink)); + } + + /* Description of im_draw_rect. +- */ ++ */ + static im_function draw_rect_desc = { +- "im_draw_rect", /* Name */ ++ "im_draw_rect", /* Name */ + "draw rect on image", +- 0, /* Flags */ +- draw_rect_vec, /* Dispatch function */ +- IM_NUMBER( draw_rect_args ), /* Size of arg list */ +- draw_rect_args /* Arg list */ ++ 0, /* Flags */ ++ draw_rect_vec, /* Dispatch function */ ++ IM_NUMBER(draw_rect_args), /* Size of arg list */ ++ draw_rect_args /* Arg list */ + }; + + /* Args for im_draw_circle. + */ + static im_arg_desc draw_circle_args[] = { +- IM_RW_IMAGE( "image" ), +- IM_INPUT_INT( "cx" ), +- IM_INPUT_INT( "cy" ), +- IM_INPUT_INT( "radius" ), +- IM_INPUT_INT( "fill" ), +- IM_INPUT_DOUBLEVEC( "ink" ) ++ IM_RW_IMAGE("image"), ++ IM_INPUT_INT("cx"), ++ IM_INPUT_INT("cy"), ++ IM_INPUT_INT("radius"), ++ IM_INPUT_INT("fill"), ++ IM_INPUT_DOUBLEVEC("ink") + }; + + /* Call im_draw_circle via arg vector. + */ + static int +-draw_circle_vec( im_object *argv ) ++draw_circle_vec(im_object *argv) + { + IMAGE *image = argv[0]; + int cx = *((int *) argv[1]); +@@ -555,22 +571,22 @@ draw_circle_vec( im_object *argv ) + + VipsPel *ink; + +- if( !(ink = im__vector_to_ink( "im_draw_circle", +- image, dv->n, dv->vec )) ) +- return( -1 ); ++ if (!(ink = im__vector_to_ink("im_draw_circle", ++ image, dv->n, dv->vec))) ++ return (-1); + +- return( im_draw_circle( image, cx, cy, radius, fill, ink ) ); ++ return (im_draw_circle(image, cx, cy, radius, fill, ink)); + } + + /* Description of im_draw_circle. +- */ ++ */ + static im_function draw_circle_desc = { +- "im_draw_circle", /* Name */ ++ "im_draw_circle", /* Name */ + "draw circle on image", +- 0, /* Flags */ +- draw_circle_vec, /* Dispatch function */ +- IM_NUMBER( draw_circle_args ), /* Size of arg list */ +- draw_circle_args /* Arg list */ ++ 0, /* Flags */ ++ draw_circle_vec, /* Dispatch function */ ++ IM_NUMBER(draw_circle_args), /* Size of arg list */ ++ draw_circle_args /* Arg list */ + }; + + /* Package up all these functions. +@@ -594,6 +610,6 @@ static im_function *inplace_list[] = { + */ + im_package im__inplace = { + "inplace", +- IM_NUMBER( inplace_list ), ++ IM_NUMBER(inplace_list), + inplace_list + }; +diff --git a/libvips/deprecated/lazy.c b/libvips/deprecated/lazy.c +index 47cc5c3117..2197a82be2 100644 +--- a/libvips/deprecated/lazy.c ++++ b/libvips/deprecated/lazy.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,9 +51,9 @@ + #include + + static gboolean +-vips_format_is_vips( VipsFormatClass *format ) ++vips_format_is_vips(VipsFormatClass *format) + { +- return( strcmp( VIPS_OBJECT_CLASS( format )->nickname, "vips" ) == 0 ); ++ return (strcmp(VIPS_OBJECT_CLASS(format)->nickname, "vips") == 0); + } + + /* Lazy open. +@@ -63,48 +63,48 @@ vips_format_is_vips( VipsFormatClass *format ) + */ + typedef struct { + VipsImage *image; +- VipsFormatClass *format;/* Read in pixels with this */ +- char *filename; /* Get pixels from here */ +- gboolean sequential; /* Sequential read requested */ ++ VipsFormatClass *format; /* Read in pixels with this */ ++ char *filename; /* Get pixels from here */ ++ gboolean sequential; /* Sequential read requested */ + +- VipsImage *real; /* The real decompressed image */ ++ VipsImage *real; /* The real decompressed image */ + } Lazy; + + static void +-lazy_free_cb( VipsImage *image, Lazy *lazy ) ++lazy_free_cb(VipsImage *image, Lazy *lazy) + { +- VIPS_DEBUG_MSG( "lazy_free: %p \"%s\"\n", lazy, lazy->filename ); ++ VIPS_DEBUG_MSG("lazy_free: %p \"%s\"\n", lazy, lazy->filename); + +- g_free( lazy->filename ); +- VIPS_UNREF( lazy->real ); +- g_free( lazy ); ++ g_free(lazy->filename); ++ VIPS_UNREF(lazy->real); ++ g_free(lazy); + } + + static Lazy * +-lazy_new( VipsImage *image, +- VipsFormatClass *format, const char *filename, gboolean sequential ) ++lazy_new(VipsImage *image, ++ VipsFormatClass *format, const char *filename, gboolean sequential) + { + Lazy *lazy; + +- lazy = g_new( Lazy, 1 ); +- VIPS_DEBUG_MSG( "lazy_new: %p \"%s\"\n", lazy, filename ); ++ lazy = g_new(Lazy, 1); ++ VIPS_DEBUG_MSG("lazy_new: %p \"%s\"\n", lazy, filename); + lazy->image = image; + lazy->format = format; +- lazy->filename = g_strdup( filename ); ++ lazy->filename = g_strdup(filename); + lazy->sequential = sequential; + lazy->real = NULL; +- g_signal_connect( image, "close", G_CALLBACK( lazy_free_cb ), lazy ); ++ g_signal_connect(image, "close", G_CALLBACK(lazy_free_cb), lazy); + +- return( lazy ); ++ return (lazy); + } + + static size_t +-disc_threshold( void ) ++disc_threshold(void) + { + static gboolean done = FALSE; + static size_t threshold; + +- if( !done ) { ++ if (!done) { + const char *env; + + done = TRUE; +@@ -113,23 +113,23 @@ disc_threshold( void ) + */ + threshold = 100 * 1024 * 1024; + +- if( (env = g_getenv( "IM_DISC_THRESHOLD" )) ) +- threshold = vips__parse_size( env ); ++ if ((env = g_getenv("IM_DISC_THRESHOLD"))) ++ threshold = vips__parse_size(env); + +- if( vips__disc_threshold ) +- threshold = vips__parse_size( vips__disc_threshold ); ++ if (vips__disc_threshold) ++ threshold = vips__parse_size(vips__disc_threshold); + +- VIPS_DEBUG_MSG( "disc_threshold: %zd bytes\n", threshold ); ++ VIPS_DEBUG_MSG("disc_threshold: %zd bytes\n", threshold); + } + +- return( threshold ); ++ return (threshold); + } + + /* Make the real underlying image: either a direct disc file, or a temp file + * somewhere. + */ + static VipsImage * +-lazy_real_image( Lazy *lazy ) ++lazy_real_image(Lazy *lazy) + { + VipsImage *real; + +@@ -140,102 +140,102 @@ lazy_real_image( Lazy *lazy ) + * - the uncompressed image will be larger than disc_threshold() + */ + real = NULL; +- if( !lazy->sequential && +- disc_threshold() && +- !(vips_format_get_flags( lazy->format, lazy->filename ) & ++ if (!lazy->sequential && ++ disc_threshold() && ++ !(vips_format_get_flags(lazy->format, lazy->filename) & + VIPS_FORMAT_PARTIAL) && +- VIPS_IMAGE_SIZEOF_IMAGE( lazy->image ) > disc_threshold() ) +- if( !(real = vips_image_new_temp_file( "%s.v" )) ) +- return( NULL ); ++ VIPS_IMAGE_SIZEOF_IMAGE(lazy->image) > disc_threshold()) ++ if (!(real = vips_image_new_temp_file("%s.v"))) ++ return (NULL); + + /* Otherwise, fall back to a "p". + */ +- if( !real && +- !(real = vips_image_new()) ) +- return( NULL ); ++ if (!real && ++ !(real = vips_image_new())) ++ return (NULL); + +- return( real ); ++ return (real); + } + + /* Our start function ... do the lazy open, if necessary, and return a region + * on the new image. + */ + static void * +-open_lazy_start( VipsImage *out, void *a, void *dummy ) ++open_lazy_start(VipsImage *out, void *a, void *dummy) + { + Lazy *lazy = (Lazy *) a; + +- if( !lazy->real ) { +- if( !(lazy->real = lazy_real_image( lazy )) || +- lazy->format->load( lazy->filename, lazy->real ) || +- vips_image_pio_input( lazy->real ) ) { +- VIPS_UNREF( lazy->real ); +- return( NULL ); ++ if (!lazy->real) { ++ if (!(lazy->real = lazy_real_image(lazy)) || ++ lazy->format->load(lazy->filename, lazy->real) || ++ vips_image_pio_input(lazy->real)) { ++ VIPS_UNREF(lazy->real); ++ return (NULL); + } + } + +- return( vips_region_new( lazy->real ) ); ++ return (vips_region_new(lazy->real)); + } + + /* Just copy. + */ + static int +-open_lazy_generate( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++open_lazy_generate(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + +- /* Ask for input we need. +- */ +- if( vips_region_prepare( ir, r ) ) +- return( -1 ); ++ /* Ask for input we need. ++ */ ++ if (vips_region_prepare(ir, r)) ++ return (-1); + +- /* Attach output region to that. +- */ +- if( vips_region_region( or, ir, r, r->left, r->top ) ) +- return( -1 ); ++ /* Attach output region to that. ++ */ ++ if (vips_region_region(or, ir, r, r->left, r->top)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Lazy open ... init the header with the first OpenLazyFn, delay actually + * decoding pixels with the second OpenLazyFn until the first generate(). + */ + static int +-vips_image_open_lazy( VipsImage *image, +- VipsFormatClass *format, const char *filename, gboolean sequential ) ++vips_image_open_lazy(VipsImage *image, ++ VipsFormatClass *format, const char *filename, gboolean sequential) + { + Lazy *lazy; + +- lazy = lazy_new( image, format, filename, sequential ); ++ lazy = lazy_new(image, format, filename, sequential); + + /* Is there a ->header() function? We need to do a lazy load. + */ +- if( format->header ) { +- /* Read header fields to init the return image. ++ if (format->header) { ++ /* Read header fields to init the return image. + */ +- if( format->header( filename, image ) ) +- return( -1 ); ++ if (format->header(filename, image)) ++ return (-1); + +- /* Then 'start' creates the real image and 'gen' paints 'image' ++ /* Then 'start' creates the real image and 'gen' paints 'image' + * with pixels from the real image on demand. + */ +- if( vips_image_pipelinev( image, image->dhint, NULL ) || +- vips_image_generate( image, +- open_lazy_start, open_lazy_generate, +- vips_stop_one, lazy, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(image, image->dhint, NULL) || ++ vips_image_generate(image, ++ open_lazy_start, open_lazy_generate, ++ vips_stop_one, lazy, NULL)) ++ return (-1); + } +- else if( format->load ) { +- if( format->load( filename, image ) ) +- return( -1 ); ++ else if (format->load) { ++ if (format->load(filename, image)) ++ return (-1); + } + else +- g_assert( 0 ); ++ g_assert(0); + +- return( 0 ); ++ return (0); + } + + /* Lazy save. +@@ -246,49 +246,49 @@ vips_image_open_lazy( VipsImage *image, + * parameters here. + */ + +-typedef int (*VipsSaveFn)( VipsImage *image, const char *filename ); ++typedef int (*VipsSaveFn)(VipsImage *image, const char *filename); + + typedef struct { +- VipsSaveFn save_fn; /* Save function */ ++ VipsSaveFn save_fn; /* Save function */ + char *filename; /* Save args */ + } SaveBlock; + + /* From "written" callback: invoke a delayed save. + */ + static void +-vips_image_save_cb( VipsImage *image, int *result, SaveBlock *sb ) ++vips_image_save_cb(VipsImage *image, int *result, SaveBlock *sb) + { +- if( sb->save_fn( image, sb->filename ) ) ++ if (sb->save_fn(image, sb->filename)) + *result = -1; + +- g_free( sb->filename ); +- g_free( sb ); ++ g_free(sb->filename); ++ g_free(sb); + } + + static void +-vips_attach_save( VipsImage *image, VipsSaveFn save_fn, const char *filename ) ++vips_attach_save(VipsImage *image, VipsSaveFn save_fn, const char *filename) + { + SaveBlock *sb; + +- sb = g_new( SaveBlock, 1 ); ++ sb = g_new(SaveBlock, 1); + sb->save_fn = save_fn; +- sb->filename = g_strdup( filename ); +- g_signal_connect( image, "written", +- G_CALLBACK( vips_image_save_cb ), sb ); ++ sb->filename = g_strdup(filename); ++ g_signal_connect(image, "written", ++ G_CALLBACK(vips_image_save_cb), sb); + } + + IMAGE * +-vips__deprecated_open_read( const char *filename, gboolean sequential ) ++vips__deprecated_open_read(const char *filename, gboolean sequential) + { + VipsFormatClass *format; + +- if( !(format = vips_format_for_file( filename )) ) +- return( NULL ); ++ if (!(format = vips_format_for_file(filename))) ++ return (NULL); + +- if( vips_format_is_vips( format ) ) { ++ if (vips_format_is_vips(format)) { + /* For vips format, we can just the main vips path. + */ +- return( vips_image_new_mode( filename, "rd" ) ); ++ return (vips_image_new_mode(filename, "rd")); + } + else { + /* For non-vips formats we must go via the old VipsFormat +@@ -298,33 +298,33 @@ vips__deprecated_open_read( const char *filename, gboolean sequential ) + IMAGE *image; + + image = vips_image_new(); +- if( vips_image_open_lazy( image, format, +- filename, sequential ) ) { +- g_object_unref( image ); +- return( NULL ); ++ if (vips_image_open_lazy(image, format, ++ filename, sequential)) { ++ g_object_unref(image); ++ return (NULL); + } + + /* Yuk. Can't g_object_set() filename since it's after + * construct. Just zap the new filename in. + */ +- VIPS_SETSTR( image->filename, filename ); ++ VIPS_SETSTR(image->filename, filename); + +- return( image ); ++ return (image); + } + } + + IMAGE * +-vips__deprecated_open_write( const char *filename ) ++vips__deprecated_open_write(const char *filename) + { + VipsFormatClass *format; + +- if( !(format = vips_format_for_name( filename )) ) +- return( NULL ); ++ if (!(format = vips_format_for_name(filename))) ++ return (NULL); + +- if( vips_format_is_vips( format ) ) ++ if (vips_format_is_vips(format)) + /* For vips format, we can just the main vips path. + */ +- return( vips_image_new_mode( filename, "w" ) ); ++ return (vips_image_new_mode(filename, "w")); + else { + /* For non-vips formats we must go via the old VipsFormat + * system to make sure we support the "filename:options" +@@ -332,10 +332,10 @@ vips__deprecated_open_write( const char *filename ) + */ + IMAGE *image; + +- if( !(image = vips_image_new()) ) +- return( NULL ); +- vips_attach_save( image, +- format->save, filename ); +- return( image ); ++ if (!(image = vips_image_new())) ++ return (NULL); ++ vips_attach_save(image, ++ format->save, filename); ++ return (image); + } + } +diff --git a/libvips/deprecated/mask_dispatch.c b/libvips/deprecated/mask_dispatch.c +index babbf9a614..2968584407 100644 +--- a/libvips/deprecated/mask_dispatch.c ++++ b/libvips/deprecated/mask_dispatch.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,531 +43,531 @@ + /* One matrix in, one out. + */ + static im_arg_desc one_in_one_out[] = { +- IM_INPUT_DMASK( "in" ), +- IM_OUTPUT_DMASK( "out" ) ++ IM_INPUT_DMASK("in"), ++ IM_OUTPUT_DMASK("out") + }; + + /* Two matricies in, one out. + */ + static im_arg_desc two_in_one_out[] = { +- IM_INPUT_DMASK( "in1" ), +- IM_INPUT_DMASK( "in2" ), +- IM_OUTPUT_DMASK( "out" ) ++ IM_INPUT_DMASK("in1"), ++ IM_INPUT_DMASK("in2"), ++ IM_OUTPUT_DMASK("out") + }; + + /* Call im_matinv via arg vector. + */ + static int +-matinv_vec( im_object *argv ) ++matinv_vec(im_object *argv) + { + im_mask_object *in = argv[0]; + im_mask_object *out = argv[1]; + +- if( !(out->mask = +- im_matinv( in->mask, out->name )) ) +- return( -1 ); ++ if (!(out->mask = ++ im_matinv(in->mask, out->name))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_matinv. +- */ ++ */ + static im_function matinv_desc = { +- "im_matinv", /* Name */ ++ "im_matinv", /* Name */ + "invert matrix", +- 0, /* Flags */ +- matinv_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ 0, /* Flags */ ++ matinv_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_mattrn via arg vector. + */ + static int +-mattrn_vec( im_object *argv ) ++mattrn_vec(im_object *argv) + { + im_mask_object *in = argv[0]; + im_mask_object *out = argv[1]; + +- if( !(out->mask = +- im_mattrn( in->mask, out->name )) ) +- return( -1 ); ++ if (!(out->mask = ++ im_mattrn(in->mask, out->name))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_mattrn. +- */ ++ */ + static im_function mattrn_desc = { +- "im_mattrn", /* Name */ ++ "im_mattrn", /* Name */ + "transpose matrix", +- 0, /* Flags */ +- mattrn_vec, /* Dispatch function */ +- IM_NUMBER( one_in_one_out ), /* Size of arg list */ +- one_in_one_out /* Arg list */ ++ 0, /* Flags */ ++ mattrn_vec, /* Dispatch function */ ++ IM_NUMBER(one_in_one_out), /* Size of arg list */ ++ one_in_one_out /* Arg list */ + }; + + /* Call im_matcat via arg vector. + */ + static int +-matcat_vec( im_object *argv ) ++matcat_vec(im_object *argv) + { + im_mask_object *in1 = argv[0]; + im_mask_object *in2 = argv[1]; + im_mask_object *out = argv[2]; + +- if( !(out->mask = +- im_matcat( in1->mask, in2->mask, out->name )) ) +- return( -1 ); ++ if (!(out->mask = ++ im_matcat(in1->mask, in2->mask, out->name))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_matcat. +- */ ++ */ + static im_function matcat_desc = { +- "im_matcat", /* Name */ ++ "im_matcat", /* Name */ + "append matrix in2 to the end of matrix in1", +- 0, /* Flags */ +- matcat_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ 0, /* Flags */ ++ matcat_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Call im_matmul via arg vector. + */ + static int +-matmul_vec( im_object *argv ) ++matmul_vec(im_object *argv) + { + im_mask_object *in1 = argv[0]; + im_mask_object *in2 = argv[1]; + im_mask_object *out = argv[2]; + +- if( !(out->mask = +- im_matmul( in1->mask, in2->mask, out->name )) ) +- return( -1 ); ++ if (!(out->mask = ++ im_matmul(in1->mask, in2->mask, out->name))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_matmul. +- */ ++ */ + static im_function matmul_desc = { +- "im_matmul", /* Name */ ++ "im_matmul", /* Name */ + "multiply matrix in1 by matrix in2", +- 0, /* Flags */ +- matmul_vec, /* Dispatch function */ +- IM_NUMBER( two_in_one_out ), /* Size of arg list */ +- two_in_one_out /* Arg list */ ++ 0, /* Flags */ ++ matmul_vec, /* Dispatch function */ ++ IM_NUMBER(two_in_one_out), /* Size of arg list */ ++ two_in_one_out /* Arg list */ + }; + + /* Args for im_read_dmask() + */ + static im_arg_desc read_dmask_args[] = { +- IM_INPUT_STRING( "filename" ), +- IM_OUTPUT_DMASK( "mask" ) ++ IM_INPUT_STRING("filename"), ++ IM_OUTPUT_DMASK("mask") + }; + + /* Call im_read_dmask via arg vector. + */ + static int +-read_dmask_vec( im_object *argv ) ++read_dmask_vec(im_object *argv) + { + im_mask_object *mo = argv[1]; + +- if( !(mo->mask = im_read_dmask( argv[0] )) ) +- return( -1 ); ++ if (!(mo->mask = im_read_dmask(argv[0]))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_read_dmask(). +- */ ++ */ + static im_function read_dmask_desc = { +- "im_read_dmask", /* Name */ ++ "im_read_dmask", /* Name */ + "read matrix of double from file", +- 0, /* Flags */ +- read_dmask_vec, /* Dispatch function */ +- IM_NUMBER( read_dmask_args ), /* Size of arg list */ +- read_dmask_args /* Arg list */ ++ 0, /* Flags */ ++ read_dmask_vec, /* Dispatch function */ ++ IM_NUMBER(read_dmask_args), /* Size of arg list */ ++ read_dmask_args /* Arg list */ + }; + + /* Args for im_gauss_dmask. + */ + static im_arg_desc gauss_dmask_args[] = { +- IM_OUTPUT_DMASK( "mask" ), +- IM_INPUT_DOUBLE( "sigma" ), +- IM_INPUT_DOUBLE( "min_amp" ) ++ IM_OUTPUT_DMASK("mask"), ++ IM_INPUT_DOUBLE("sigma"), ++ IM_INPUT_DOUBLE("min_amp") + }; + + /* Call im_gauss_dmask via arg vector. + */ + static int +-gauss_dmask_vec( im_object *argv ) ++gauss_dmask_vec(im_object *argv) + { + im_mask_object *mo = argv[0]; + double sigma = *((double *) argv[1]); + double min_amp = *((double *) argv[2]); + +- if( !(mo->mask = +- im_gauss_dmask( mo->name, sigma, min_amp )) ) +- return( -1 ); +- +- return( 0 ); ++ if (!(mo->mask = ++ im_gauss_dmask(mo->name, sigma, min_amp))) ++ return (-1); ++ ++ return (0); + } + + /* Description of im_gauss_dmask. +- */ ++ */ + static im_function gauss_dmask_desc = { +- "im_gauss_dmask", /* Name */ ++ "im_gauss_dmask", /* Name */ + "generate gaussian DOUBLEMASK", +- 0, /* Flags */ +- gauss_dmask_vec, /* Dispatch function */ +- IM_NUMBER( gauss_dmask_args ), /* Size of arg list */ +- gauss_dmask_args /* Arg list */ ++ 0, /* Flags */ ++ gauss_dmask_vec, /* Dispatch function */ ++ IM_NUMBER(gauss_dmask_args), /* Size of arg list */ ++ gauss_dmask_args /* Arg list */ + }; + + /* Call im_gauss_dmask_sep via arg vector. + */ + static int +-gauss_dmask_sep_vec( im_object *argv ) ++gauss_dmask_sep_vec(im_object *argv) + { + im_mask_object *mo = argv[0]; + double sigma = *((double *) argv[1]); + double min_amp = *((double *) argv[2]); + +- if( !(mo->mask = +- im_gauss_dmask_sep( mo->name, sigma, min_amp )) ) +- return( -1 ); +- +- return( 0 ); ++ if (!(mo->mask = ++ im_gauss_dmask_sep(mo->name, sigma, min_amp))) ++ return (-1); ++ ++ return (0); + } + + /* Description of im_gauss_dmask_sep. +- */ ++ */ + static im_function gauss_dmask_sep_desc = { +- "im_gauss_dmask_sep", /* Name */ ++ "im_gauss_dmask_sep", /* Name */ + "generate separable gaussian DOUBLEMASK", +- 0, /* Flags */ +- gauss_dmask_sep_vec, /* Dispatch function */ +- IM_NUMBER( gauss_dmask_args ), /* Size of arg list */ +- gauss_dmask_args /* Arg list */ ++ 0, /* Flags */ ++ gauss_dmask_sep_vec, /* Dispatch function */ ++ IM_NUMBER(gauss_dmask_args), /* Size of arg list */ ++ gauss_dmask_args /* Arg list */ + }; + + /* Args for im_gauss_imask. + */ + static im_arg_desc gauss_imask_args[] = { +- IM_OUTPUT_IMASK( "mask" ), +- IM_INPUT_DOUBLE( "sigma" ), +- IM_INPUT_DOUBLE( "min_amp" ) ++ IM_OUTPUT_IMASK("mask"), ++ IM_INPUT_DOUBLE("sigma"), ++ IM_INPUT_DOUBLE("min_amp") + }; + + /* Call im_gauss_imask via arg vector. + */ + static int +-gauss_imask_vec( im_object *argv ) ++gauss_imask_vec(im_object *argv) + { + im_mask_object *mo = argv[0]; + double sigma = *((double *) argv[1]); + double min_amp = *((double *) argv[2]); + +- if( !(mo->mask = +- im_gauss_imask( mo->name, sigma, min_amp )) ) +- return( -1 ); +- +- return( 0 ); ++ if (!(mo->mask = ++ im_gauss_imask(mo->name, sigma, min_amp))) ++ return (-1); ++ ++ return (0); + } + + /* Description of im_gauss_imask. +- */ ++ */ + static im_function gauss_imask_desc = { +- "im_gauss_imask", /* Name */ ++ "im_gauss_imask", /* Name */ + "generate gaussian INTMASK", +- 0, /* Flags */ +- gauss_imask_vec, /* Dispatch function */ +- IM_NUMBER( gauss_imask_args ), /* Size of arg list */ +- gauss_imask_args /* Arg list */ ++ 0, /* Flags */ ++ gauss_imask_vec, /* Dispatch function */ ++ IM_NUMBER(gauss_imask_args), /* Size of arg list */ ++ gauss_imask_args /* Arg list */ + }; + + /* Call im_gauss_imask_sep via arg vector. + */ + static int +-gauss_imask_sep_vec( im_object *argv ) ++gauss_imask_sep_vec(im_object *argv) + { + im_mask_object *mo = argv[0]; + double sigma = *((double *) argv[1]); + double min_amp = *((double *) argv[2]); + +- if( !(mo->mask = +- im_gauss_imask_sep( mo->name, sigma, min_amp )) ) +- return( -1 ); +- +- return( 0 ); ++ if (!(mo->mask = ++ im_gauss_imask_sep(mo->name, sigma, min_amp))) ++ return (-1); ++ ++ return (0); + } + + /* Description of im_gauss_imask_sep. +- */ ++ */ + static im_function gauss_imask_sep_desc = { +- "im_gauss_imask_sep", /* Name */ ++ "im_gauss_imask_sep", /* Name */ + "generate separable gaussian INTMASK", +- 0, /* Flags */ +- gauss_imask_sep_vec, /* Dispatch function */ +- IM_NUMBER( gauss_imask_args ), /* Size of arg list */ +- gauss_imask_args /* Arg list */ ++ 0, /* Flags */ ++ gauss_imask_sep_vec, /* Dispatch function */ ++ IM_NUMBER(gauss_imask_args), /* Size of arg list */ ++ gauss_imask_args /* Arg list */ + }; + + /* Args for im_log_imask. + */ + static im_arg_desc log_imask_args[] = { +- IM_OUTPUT_IMASK( "mask" ), +- IM_INPUT_DOUBLE( "sigma" ), +- IM_INPUT_DOUBLE( "min_amp" ) ++ IM_OUTPUT_IMASK("mask"), ++ IM_INPUT_DOUBLE("sigma"), ++ IM_INPUT_DOUBLE("min_amp") + }; + + /* Call im_log_imask via arg vector. + */ + static int +-log_imask_vec( im_object *argv ) ++log_imask_vec(im_object *argv) + { + im_mask_object *mo = argv[0]; + double sigma = *((double *) argv[1]); + double min_amp = *((double *) argv[2]); + +- if( !(mo->mask = +- im_log_imask( mo->name, sigma, min_amp )) ) +- return( -1 ); ++ if (!(mo->mask = ++ im_log_imask(mo->name, sigma, min_amp))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_log_imask. +- */ ++ */ + static im_function log_imask_desc = { +- "im_log_imask", /* Name */ ++ "im_log_imask", /* Name */ + "generate laplacian of gaussian INTMASK", +- 0, /* Flags */ +- log_imask_vec, /* Dispatch function */ +- IM_NUMBER( log_imask_args ), /* Size of arg list */ +- log_imask_args /* Arg list */ ++ 0, /* Flags */ ++ log_imask_vec, /* Dispatch function */ ++ IM_NUMBER(log_imask_args), /* Size of arg list */ ++ log_imask_args /* Arg list */ + }; + + /* Args for im_log_dmask. + */ + static im_arg_desc log_dmask_args[] = { +- IM_OUTPUT_DMASK( "maskfile" ), +- IM_INPUT_DOUBLE( "sigma" ), +- IM_INPUT_DOUBLE( "min_amp" ) ++ IM_OUTPUT_DMASK("maskfile"), ++ IM_INPUT_DOUBLE("sigma"), ++ IM_INPUT_DOUBLE("min_amp") + }; + + /* Call im_log_dmask via arg vector. + */ + static int +-log_dmask_vec( im_object *argv ) ++log_dmask_vec(im_object *argv) + { + im_mask_object *mo = argv[0]; + double sigma = *((double *) argv[1]); + double min_amp = *((double *) argv[2]); + +- if( !(mo->mask = +- im_log_dmask( mo->name, sigma, min_amp )) ) +- return( -1 ); ++ if (!(mo->mask = ++ im_log_dmask(mo->name, sigma, min_amp))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_log_dmask. +- */ ++ */ + static im_function log_dmask_desc = { +- "im_log_dmask", /* Name */ ++ "im_log_dmask", /* Name */ + "generate laplacian of gaussian DOUBLEMASK", +- 0, /* Flags */ +- log_dmask_vec, /* Dispatch function */ +- IM_NUMBER( log_dmask_args ), /* Size of arg list */ +- log_dmask_args /* Arg list */ ++ 0, /* Flags */ ++ log_dmask_vec, /* Dispatch function */ ++ IM_NUMBER(log_dmask_args), /* Size of arg list */ ++ log_dmask_args /* Arg list */ + }; + + static im_arg_desc imask_args[] = { +- IM_INPUT_IMASK( "in" ), +- IM_OUTPUT_IMASK( "out" ) ++ IM_INPUT_IMASK("in"), ++ IM_OUTPUT_IMASK("out") + }; + + static im_arg_desc dmask_args[] = { +- IM_INPUT_DMASK( "in" ), +- IM_OUTPUT_DMASK( "out" ) ++ IM_INPUT_DMASK("in"), ++ IM_OUTPUT_DMASK("out") + }; + + /* Call im_rotate_imask45 via arg vector. + */ + static int +-rotate_imask45_vec( im_object *argv ) ++rotate_imask45_vec(im_object *argv) + { + im_mask_object *min = argv[0]; + im_mask_object *mout = argv[1]; + +- if( !(mout->mask = im_rotate_imask45( min->mask, mout->name )) ) +- return( -1 ); ++ if (!(mout->mask = im_rotate_imask45(min->mask, mout->name))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_rotate_imask45. +- */ ++ */ + static im_function rotate_imask45_desc = { +- "im_rotate_imask45", /* Name */ ++ "im_rotate_imask45", /* Name */ + "rotate INTMASK clockwise by 45 degrees", +- 0, /* Flags */ +- rotate_imask45_vec, /* Dispatch function */ +- IM_NUMBER( imask_args ), /* Size of arg list */ +- imask_args /* Arg list */ ++ 0, /* Flags */ ++ rotate_imask45_vec, /* Dispatch function */ ++ IM_NUMBER(imask_args), /* Size of arg list */ ++ imask_args /* Arg list */ + }; + + /* Call im_rotate_imask90 via arg vector. + */ + static int +-rotate_imask90_vec( im_object *argv ) ++rotate_imask90_vec(im_object *argv) + { + im_mask_object *min = argv[0]; + im_mask_object *mout = argv[1]; + +- if( !(mout->mask = im_rotate_imask90( min->mask, mout->name )) ) +- return( -1 ); ++ if (!(mout->mask = im_rotate_imask90(min->mask, mout->name))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_rotate_imask90. +- */ ++ */ + static im_function rotate_imask90_desc = { +- "im_rotate_imask90", /* Name */ ++ "im_rotate_imask90", /* Name */ + "rotate INTMASK clockwise by 90 degrees", +- 0, /* Flags */ +- rotate_imask90_vec, /* Dispatch function */ +- IM_NUMBER( imask_args ), /* Size of arg list */ +- imask_args /* Arg list */ ++ 0, /* Flags */ ++ rotate_imask90_vec, /* Dispatch function */ ++ IM_NUMBER(imask_args), /* Size of arg list */ ++ imask_args /* Arg list */ + }; + + /* Call im_rotate_dmask45 via arg vector. + */ + static int +-rotate_dmask45_vec( im_object *argv ) ++rotate_dmask45_vec(im_object *argv) + { + im_mask_object *min = argv[0]; + im_mask_object *mout = argv[1]; + +- if( !(mout->mask = im_rotate_dmask45( min->mask, mout->name )) ) +- return( -1 ); ++ if (!(mout->mask = im_rotate_dmask45(min->mask, mout->name))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_rotate_dmask45. +- */ ++ */ + static im_function rotate_dmask45_desc = { +- "im_rotate_dmask45", /* Name */ ++ "im_rotate_dmask45", /* Name */ + "rotate DOUBLEMASK clockwise by 45 degrees", +- 0, /* Flags */ +- rotate_dmask45_vec, /* Dispatch function */ +- IM_NUMBER( dmask_args ), /* Size of arg list */ +- dmask_args /* Arg list */ ++ 0, /* Flags */ ++ rotate_dmask45_vec, /* Dispatch function */ ++ IM_NUMBER(dmask_args), /* Size of arg list */ ++ dmask_args /* Arg list */ + }; + + /* Call im_rotate_dmask90 via arg vector. + */ + static int +-rotate_dmask90_vec( im_object *argv ) ++rotate_dmask90_vec(im_object *argv) + { + im_mask_object *min = argv[0]; + im_mask_object *mout = argv[1]; + +- if( !(mout->mask = im_rotate_dmask90( min->mask, mout->name )) ) +- return( -1 ); ++ if (!(mout->mask = im_rotate_dmask90(min->mask, mout->name))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_rotate_dmask90. +- */ ++ */ + static im_function rotate_dmask90_desc = { +- "im_rotate_dmask90", /* Name */ ++ "im_rotate_dmask90", /* Name */ + "rotate DOUBLEMASK clockwise by 90 degrees", +- 0, /* Flags */ +- rotate_dmask90_vec, /* Dispatch function */ +- IM_NUMBER( dmask_args ), /* Size of arg list */ +- dmask_args /* Arg list */ ++ 0, /* Flags */ ++ rotate_dmask90_vec, /* Dispatch function */ ++ IM_NUMBER(dmask_args), /* Size of arg list */ ++ dmask_args /* Arg list */ + }; + + static int +-imask_xsize_vec( im_object *argv ) ++imask_xsize_vec(im_object *argv) + { +- *( (int*) argv[1] )= ( (INTMASK*) ( ( (im_mask_object*) argv[0] )-> mask ) )-> xsize; +- return 0; ++ *((int *) argv[1]) = ((INTMASK *) (((im_mask_object *) argv[0])->mask))->xsize; ++ return 0; + } + + static int +-imask_ysize_vec( im_object *argv ) ++imask_ysize_vec(im_object *argv) + { +- *( (int*) argv[1] )= ( (INTMASK*) ( ( (im_mask_object*) argv[0] )-> mask ) )-> ysize; +- return 0; ++ *((int *) argv[1]) = ((INTMASK *) (((im_mask_object *) argv[0])->mask))->ysize; ++ return 0; + } + + static int +-dmask_xsize_vec( im_object *argv ) ++dmask_xsize_vec(im_object *argv) + { +- *( (int*) argv[1] )= ( (DOUBLEMASK*) ( ( (im_mask_object*) argv[0] )-> mask ) )-> xsize; +- return 0; ++ *((int *) argv[1]) = ((DOUBLEMASK *) (((im_mask_object *) argv[0])->mask))->xsize; ++ return 0; + } + + static int +-dmask_ysize_vec( im_object *argv ) ++dmask_ysize_vec(im_object *argv) + { +- *( (int*) argv[1] )= ( (DOUBLEMASK*) ( ( (im_mask_object*) argv[0] )-> mask ) )-> ysize; +- return 0; ++ *((int *) argv[1]) = ((DOUBLEMASK *) (((im_mask_object *) argv[0])->mask))->ysize; ++ return 0; + } + + static im_arg_desc imask_size_args[] = { +- IM_INPUT_IMASK( "mask" ), +- IM_OUTPUT_INT( "size" ) ++ IM_INPUT_IMASK("mask"), ++ IM_OUTPUT_INT("size") + }; + + static im_arg_desc dmask_size_args[] = { +- IM_INPUT_DMASK( "mask" ), +- IM_OUTPUT_INT( "size" ) ++ IM_INPUT_DMASK("mask"), ++ IM_OUTPUT_INT("size") + }; + + static im_function imask_xsize_desc = { +- "im_imask_xsize", /* Name */ +- "horizontal size of an intmask", /* Description */ +- 0, /* Flags */ +- imask_xsize_vec, /* Dispatch function */ +- IM_NUMBER( imask_size_args ), /* Size of arg list */ +- imask_size_args /* Arg list */ ++ "im_imask_xsize", /* Name */ ++ "horizontal size of an intmask", /* Description */ ++ 0, /* Flags */ ++ imask_xsize_vec, /* Dispatch function */ ++ IM_NUMBER(imask_size_args), /* Size of arg list */ ++ imask_size_args /* Arg list */ + }; + + static im_function imask_ysize_desc = { +- "im_imask_ysize", /* Name */ +- "vertical size of an intmask", /* Description */ +- 0, /* Flags */ +- imask_ysize_vec, /* Dispatch function */ +- IM_NUMBER( imask_size_args ), /* Size of arg list */ +- imask_size_args /* Arg list */ ++ "im_imask_ysize", /* Name */ ++ "vertical size of an intmask", /* Description */ ++ 0, /* Flags */ ++ imask_ysize_vec, /* Dispatch function */ ++ IM_NUMBER(imask_size_args), /* Size of arg list */ ++ imask_size_args /* Arg list */ + }; + + static im_function dmask_xsize_desc = { +- "im_dmask_xsize", /* Name */ +- "horizontal size of a doublemask", /* Description */ +- 0, /* Flags */ +- dmask_xsize_vec, /* Dispatch function */ +- IM_NUMBER( dmask_size_args ), /* Size of arg list */ +- dmask_size_args /* Arg list */ ++ "im_dmask_xsize", /* Name */ ++ "horizontal size of a doublemask", /* Description */ ++ 0, /* Flags */ ++ dmask_xsize_vec, /* Dispatch function */ ++ IM_NUMBER(dmask_size_args), /* Size of arg list */ ++ dmask_size_args /* Arg list */ + }; + + static im_function dmask_ysize_desc = { +- "im_dmask_ysize", /* Name */ +- "vertical size of a doublemask", /* Description */ +- 0, /* Flags */ +- dmask_ysize_vec, /* Dispatch function */ +- IM_NUMBER( dmask_size_args ), /* Size of arg list */ +- dmask_size_args /* Arg list */ ++ "im_dmask_ysize", /* Name */ ++ "vertical size of a doublemask", /* Description */ ++ 0, /* Flags */ ++ dmask_ysize_vec, /* Dispatch function */ ++ IM_NUMBER(dmask_size_args), /* Size of arg list */ ++ dmask_size_args /* Arg list */ + }; + + /* Package up all these functions. +@@ -579,10 +579,10 @@ static im_function *mask_list[] = { + &log_imask_desc, + &gauss_imask_desc, + &gauss_imask_sep_desc, +- &dmask_xsize_desc, +- &dmask_ysize_desc, +- &imask_xsize_desc, +- &imask_ysize_desc, ++ &dmask_xsize_desc, ++ &dmask_ysize_desc, ++ &imask_xsize_desc, ++ &imask_ysize_desc, + &read_dmask_desc, + &rotate_dmask45_desc, + &rotate_dmask90_desc, +@@ -598,6 +598,6 @@ static im_function *mask_list[] = { + */ + im_package im__mask = { + "mask", +- IM_NUMBER( mask_list ), ++ IM_NUMBER(mask_list), + mask_list + }; +diff --git a/libvips/deprecated/matalloc.c b/libvips/deprecated/matalloc.c +index dd4b40f020..27c04ab28f 100644 +--- a/libvips/deprecated/matalloc.c ++++ b/libvips/deprecated/matalloc.c +@@ -15,7 +15,7 @@ + #include + #include + +-#define TINY 1.0e-200 ++#define TINY 1.0e-200 + + /* @(#) Allocates and returns an pointer at the beginning of + * @(#) an integer array array[nl,nh] or +@@ -25,17 +25,17 @@ + * @(#) Right call + * @(#) int *im_ivector(nl, nh) + * @(#) int nl, nh; +- * @(#) returns a pointer to an int array or NULL on error ++ * @(#) returns a pointer to an int array or NULL on error + * @(#) + * @(#) Right call + * @(#) float *im_fvector(nl, nh) + * @(#) int nl, nh; +- * @(#) returns a pointer to a float array or NULL on error ++ * @(#) returns a pointer to a float array or NULL on error + * @(#) + * @(#) Right call + * @(#) double *im_dvector(nl, nh) + * @(#) int nl, nh; +- * @(#) returns a pointer to a double array or NULL on error ++ * @(#) returns a pointer to a double array or NULL on error + * @(#) + * @(#) The following functions free the array allocated by the functions above + * @(#) +@@ -58,65 +58,70 @@ im_ivector(int nl, int nh) + { + int *v; + +- v = (int *)im_malloc(NULL,(unsigned)(nh - nl + 1) * sizeof(int)); ++ v = (int *) im_malloc(NULL, (unsigned) (nh - nl + 1) * sizeof(int)); + if (v == NULL) +- return(NULL); ++ return (NULL); + else +- return(v-nl); ++ return (v - nl); + } + +-float *im_fvector(int nl, int nh) ++float * ++im_fvector(int nl, int nh) + { + float *v; + +- v = (float *)im_malloc(NULL,(unsigned)(nh - nl + 1) * sizeof(float)); ++ v = (float *) im_malloc(NULL, (unsigned) (nh - nl + 1) * sizeof(float)); + if (v == NULL) +- return(NULL); ++ return (NULL); + else +- return(v-nl); ++ return (v - nl); + } + +-double *im_dvector(int nl, int nh) ++double * ++im_dvector(int nl, int nh) + { + double *v; + +- v = (double *)im_malloc(NULL,(unsigned)(nh - nl + 1) * sizeof(double)); ++ v = (double *) im_malloc(NULL, (unsigned) (nh - nl + 1) * sizeof(double)); + if (v == NULL) +- return(NULL); ++ return (NULL); + else +- return(v-nl); ++ return (v - nl); + } + +-void im_free_ivector(int *v, int nl, int nh) ++void ++im_free_ivector(int *v, int nl, int nh) + { +- im_free((char*) (v+nl)); ++ im_free((char *) (v + nl)); + } + +-void im_free_fvector(float *v, int nl, int nh) ++void ++im_free_fvector(float *v, int nl, int nh) + { +- im_free((char*) (v+nl)); ++ im_free((char *) (v + nl)); + } + +-void im_free_dvector(double *v, int nl, int nh) ++void ++im_free_dvector(double *v, int nl, int nh) + { +- im_free((char*) (v+nl)); ++ im_free((char *) (v + nl)); + } + + /* @(#) Allocates and returns an pointer at the beginning of + * @(#) an int, float or double, two dimensional matrix[nrl,nrh][ncl,nch] +- * @(#) ++ * @(#) + * @(#) Right call + * @(#) int **im_imat_alloc(nrl, nrh, ncl, nch) + * @(#) int nrl, nrh, ncl, nch; +- * @(#) returns a pointer to an int matrix or NULL on error ++ * @(#) returns a pointer to an int matrix or NULL on error + * @(#) + * @(#) float **im_fmat_alloc(nrl, nrh, ncl, nch) + * @(#) int nrl, nrh, ncl, nch; +- * @(#) returns a pointer to an int matrix or NULL on error ++ * @(#) returns a pointer to an int matrix or NULL on error + * @(#) + * @(#) double **im_dmat_alloc(nrl, nrh, ncl, nch) + * @(#) int nrl, nrh, ncl, nch; +- * @(#) returns a pointer to a double matrix or NULL on error ++ * @(#) returns a pointer to a double matrix or NULL on error + * @(#) + * @(#) The following routines free the matrix allocated by the functions above + * @(#) void im_free_imat(m, nrl, nrh, ncl, nch) +@@ -132,89 +137,92 @@ void im_free_dvector(double *v, int nl, int nh) + * @(#) int nrl, nrh, ncl, nch; + * @(#) + */ +-int **im_imat_alloc(int nrl, int nrh, int ncl, int nch) ++int ** ++im_imat_alloc(int nrl, int nrh, int ncl, int nch) + { + int i; + int **m; + +- m = (int**)im_malloc(NULL,(unsigned)(nrh-nrl+1) * sizeof(int *)); ++ m = (int **) im_malloc(NULL, (unsigned) (nrh - nrl + 1) * sizeof(int *)); + if (m == NULL) +- return(NULL); ++ return (NULL); + m -= nrl; + +- for (i=nrl; i<=nrh; i++) +- { +- m[i] = (int *)im_malloc(NULL,(unsigned) (nch-ncl+1) * sizeof(int)); ++ for (i = nrl; i <= nrh; i++) { ++ m[i] = (int *) im_malloc(NULL, (unsigned) (nch - ncl + 1) * sizeof(int)); + if (m[i] == NULL) +- return(NULL); ++ return (NULL); + m[i] -= ncl; +- } ++ } + return (m); + } + +-void im_free_imat(int **m, int nrl, int nrh, int ncl, int nch) ++void ++im_free_imat(int **m, int nrl, int nrh, int ncl, int nch) + { + int i; + +- for (i=nrh; i>=nrl; i--) +- im_free((char*) (m[i]+ncl)); +- im_free((char*) (m+nrl)); ++ for (i = nrh; i >= nrl; i--) ++ im_free((char *) (m[i] + ncl)); ++ im_free((char *) (m + nrl)); + } + +-float **im_fmat_alloc(int nrl, int nrh, int ncl, int nch) ++float ** ++im_fmat_alloc(int nrl, int nrh, int ncl, int nch) + { + int i; + float **m; + +- m = (float**)im_malloc(NULL,(unsigned)(nrh-nrl+1) * sizeof(float *)); ++ m = (float **) im_malloc(NULL, (unsigned) (nrh - nrl + 1) * sizeof(float *)); + if (m == NULL) +- return(NULL); ++ return (NULL); + m -= nrl; + +- for (i=nrl; i<=nrh; i++) +- { +- m[i] = (float *)im_malloc(NULL,(unsigned) (nch-ncl+1) * sizeof(float)); ++ for (i = nrl; i <= nrh; i++) { ++ m[i] = (float *) im_malloc(NULL, (unsigned) (nch - ncl + 1) * sizeof(float)); + if (m[i] == NULL) +- return(NULL); ++ return (NULL); + m[i] -= ncl; +- } ++ } + return (m); + } + +-void im_free_fmat(float **m, int nrl, int nrh, int ncl, int nch) ++void ++im_free_fmat(float **m, int nrl, int nrh, int ncl, int nch) + { + int i; + +- for (i=nrh; i>=nrl; i--) +- im_free((char*) (m[i]+ncl)); +- im_free((char*) (m+nrl)); ++ for (i = nrh; i >= nrl; i--) ++ im_free((char *) (m[i] + ncl)); ++ im_free((char *) (m + nrl)); + } + +-double **im_dmat_alloc(int nrl, int nrh, int ncl, int nch) ++double ** ++im_dmat_alloc(int nrl, int nrh, int ncl, int nch) + { + int i; + double **m; + +- m = (double**)im_malloc(NULL,(unsigned)(nrh-nrl+1) * sizeof(double *)); ++ m = (double **) im_malloc(NULL, (unsigned) (nrh - nrl + 1) * sizeof(double *)); + if (m == NULL) +- return(NULL); ++ return (NULL); + m -= nrl; + +- for (i=nrl; i<=nrh; i++) +- { +- m[i] = (double *)im_malloc(NULL,(unsigned) (nch-ncl+1) * sizeof(double)); ++ for (i = nrl; i <= nrh; i++) { ++ m[i] = (double *) im_malloc(NULL, (unsigned) (nch - ncl + 1) * sizeof(double)); + if (m[i] == NULL) +- return(NULL); ++ return (NULL); + m[i] -= ncl; +- } ++ } + return (m); + } + +-void im_free_dmat(double **m, int nrl, int nrh, int ncl, int nch) ++void ++im_free_dmat(double **m, int nrl, int nrh, int ncl, int nch) + { + int i; + +- for (i=nrh; i>=nrl; i--) +- im_free((char*) (m[i]+ncl)); +- im_free((char*) (m+nrl)); ++ for (i = nrh; i >= nrl; i--) ++ im_free((char *) (m[i] + ncl)); ++ im_free((char *) (m + nrl)); + } +diff --git a/libvips/deprecated/matlab.c b/libvips/deprecated/matlab.c +index 7a6a1d0a8f..1633caa933 100644 +--- a/libvips/deprecated/matlab.c ++++ b/libvips/deprecated/matlab.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -40,25 +40,25 @@ + #include + + int +-im_mat2vips( const char *filename, IMAGE *out ) ++im_mat2vips(const char *filename, IMAGE *out) + { + VipsImage *t; + +- if( vips_matload( filename, &t, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_matload(filename, &t, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + static int +-ismat( const char *filename ) ++ismat(const char *filename) + { +- return( vips_foreign_is_a( "matload", filename ) ); ++ return (vips_foreign_is_a("matload", filename)); + } + + static const char *mat_suffs[] = { ".mat", NULL }; +@@ -67,13 +67,13 @@ typedef VipsFormat VipsFormatMat; + typedef VipsFormatClass VipsFormatMatClass; + + static void +-vips_format_mat_class_init( VipsFormatMatClass *class ) ++vips_format_mat_class_init(VipsFormatMatClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsFormatClass *format_class = (VipsFormatClass *) class; + + object_class->nickname = "mat"; +- object_class->description = _( "Matlab" ); ++ object_class->description = _("Matlab"); + + format_class->is_a = ismat; + format_class->load = im_mat2vips; +@@ -82,9 +82,8 @@ vips_format_mat_class_init( VipsFormatMatClass *class ) + } + + static void +-vips_format_mat_init( VipsFormatMat *object ) ++vips_format_mat_init(VipsFormatMat *object) + { + } + +-G_DEFINE_TYPE( VipsFormatMat, vips_format_mat, VIPS_TYPE_FORMAT ); +- ++G_DEFINE_TYPE(VipsFormatMat, vips_format_mat, VIPS_TYPE_FORMAT); +diff --git a/libvips/deprecated/morph_dispatch.c b/libvips/deprecated/morph_dispatch.c +index 01446166cb..8397dbbf15 100644 +--- a/libvips/deprecated/morph_dispatch.c ++++ b/libvips/deprecated/morph_dispatch.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,249 +43,249 @@ + /* Args to im_profile. + */ + static im_arg_desc profile_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "direction" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("direction") + }; + + /* Call im_profile via arg vector. + */ + static int +-profile_vec( im_object *argv ) ++profile_vec(im_object *argv) + { + int dir = *((int *) argv[2]); + +- return( im_profile( argv[0], argv[1], dir ) ); ++ return (im_profile(argv[0], argv[1], dir)); + } + + /* Description of im_profile. +- */ ++ */ + static im_function profile_desc = { +- "im_profile", /* Name */ +- "find first horizontal/vertical edge", /* Descr. */ +- IM_FN_TRANSFORM, /* Flags */ +- profile_vec, /* Dispatch function */ +- IM_NUMBER( profile_args ), /* Size of arg list */ +- profile_args /* Arg list */ ++ "im_profile", /* Name */ ++ "find first horizontal/vertical edge", /* Descr. */ ++ IM_FN_TRANSFORM, /* Flags */ ++ profile_vec, /* Dispatch function */ ++ IM_NUMBER(profile_args), /* Size of arg list */ ++ profile_args /* Arg list */ + }; + + /* Args to im_erode. + */ + static im_arg_desc erode_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_IMASK( "mask" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_IMASK("mask") + }; + + /* Call im_dilate via arg vector. + */ + static int +-dilate_vec( im_object *argv ) ++dilate_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_dilate( argv[0], argv[1], mo->mask ) ); ++ return (im_dilate(argv[0], argv[1], mo->mask)); + } + + /* Description of im_dilate. +- */ ++ */ + static im_function dilate_desc = { +- "im_dilate", /* Name */ ++ "im_dilate", /* Name */ + "dilate image with mask, adding a black border", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- dilate_vec, /* Dispatch function */ +- IM_NUMBER( erode_args ), /* Size of arg list */ +- erode_args /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ dilate_vec, /* Dispatch function */ ++ IM_NUMBER(erode_args), /* Size of arg list */ ++ erode_args /* Arg list */ + }; + + /* Call im_erode via arg vector. + */ + static int +-erode_vec( im_object *argv ) ++erode_vec(im_object *argv) + { + im_mask_object *mo = argv[2]; + +- return( im_erode( argv[0], argv[1], mo->mask ) ); ++ return (im_erode(argv[0], argv[1], mo->mask)); + } + + /* Description of im_erode. +- */ ++ */ + static im_function erode_desc = { +- "im_erode", /* Name */ ++ "im_erode", /* Name */ + "erode image with mask, adding a black border", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- erode_vec, /* Dispatch function */ +- IM_NUMBER( erode_args ), /* Size of arg list */ +- erode_args /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ erode_vec, /* Dispatch function */ ++ IM_NUMBER(erode_args), /* Size of arg list */ ++ erode_args /* Arg list */ + }; + + /* Args to im_cntlines. + */ + static im_arg_desc cntlines_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_DOUBLE( "nlines" ), +- IM_INPUT_INT( "direction" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_DOUBLE("nlines"), ++ IM_INPUT_INT("direction") + }; + + /* Call im_cntlines via arg vector. + */ + static int +-cntlines_vec( im_object *argv ) ++cntlines_vec(im_object *argv) + { + double *out = (double *) argv[1]; + int dir = *((int *) argv[2]); + +- return( im_cntlines( argv[0], out, dir ) ); ++ return (im_cntlines(argv[0], out, dir)); + } + + /* Description of im_cntlines. +- */ ++ */ + static im_function cntlines_desc = { +- "im_cntlines", /* Name */ ++ "im_cntlines", /* Name */ + "count horizontal or vertical lines", +- 0, /* Flags */ +- cntlines_vec, /* Dispatch function */ +- IM_NUMBER( cntlines_args ), /* Size of arg list */ +- cntlines_args /* Arg list */ ++ 0, /* Flags */ ++ cntlines_vec, /* Dispatch function */ ++ IM_NUMBER(cntlines_args), /* Size of arg list */ ++ cntlines_args /* Arg list */ + }; + + /* Args to im_rank. + */ + static im_arg_desc rank_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "xsize" ), +- IM_INPUT_INT( "ysize" ), +- IM_INPUT_INT( "n" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("xsize"), ++ IM_INPUT_INT("ysize"), ++ IM_INPUT_INT("n") + }; + + /* Call im_rank via arg vector. + */ + static int +-rank_vec( im_object *argv ) ++rank_vec(im_object *argv) + { + int xsize = *((int *) argv[2]); + int ysize = *((int *) argv[3]); + int n = *((int *) argv[4]); + +- return( im_rank( argv[0], argv[1], xsize, ysize, n ) ); ++ return (im_rank(argv[0], argv[1], xsize, ysize, n)); + } + + /* Description of im_rank. +- */ ++ */ + static im_function rank_desc = { +- "im_rank", /* Name */ ++ "im_rank", /* Name */ + "rank filter nth element of xsize/ysize window", +- IM_FN_PIO, /* Flags */ +- rank_vec, /* Dispatch function */ +- IM_NUMBER( rank_args ), /* Size of arg list */ +- rank_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ rank_vec, /* Dispatch function */ ++ IM_NUMBER(rank_args), /* Size of arg list */ ++ rank_args /* Arg list */ + }; + + /* Args for im_zerox. + */ + static im_arg_desc zerox_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "flag" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("flag") + }; + + /* Call im_zerox via arg vector. + */ + static int +-zerox_vec( im_object *argv ) ++zerox_vec(im_object *argv) + { + int flag = *((int *) argv[2]); + +- return( im_zerox( argv[0], argv[1], flag ) ); ++ return (im_zerox(argv[0], argv[1], flag)); + } + + /* Description of im_zerox. +- */ ++ */ + static im_function zerox_desc = { +- "im_zerox", /* Name */ ++ "im_zerox", /* Name */ + "find +ve or -ve zero crossings in image", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- zerox_vec, /* Dispatch function */ +- IM_NUMBER( zerox_args ), /* Size of arg list */ +- zerox_args /* Arg list */ ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ zerox_vec, /* Dispatch function */ ++ IM_NUMBER(zerox_args), /* Size of arg list */ ++ zerox_args /* Arg list */ + }; + + static im_arg_desc maxvalue_args[] = { +- IM_INPUT_IMAGEVEC( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGEVEC("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + static int +-maxvalue_vec( im_object *argv ) ++maxvalue_vec(im_object *argv) + { + im_imagevec_object *iv = (im_imagevec_object *) argv[0]; + +- return( im_maxvalue( iv->vec, argv[1], iv->n ) ); ++ return (im_maxvalue(iv->vec, argv[1], iv->n)); + } + + static im_function maxvalue_desc = { +- "im_maxvalue", /* Name */ +- "point-wise maximum value", /* Description */ +- IM_FN_PIO, /* Flags */ +- maxvalue_vec, /* Dispatch function */ +- IM_NUMBER( maxvalue_args ), /* Size of arg list */ +- maxvalue_args /* Arg list */ ++ "im_maxvalue", /* Name */ ++ "point-wise maximum value", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ maxvalue_vec, /* Dispatch function */ ++ IM_NUMBER(maxvalue_args), /* Size of arg list */ ++ maxvalue_args /* Arg list */ + }; + + static im_arg_desc rank_image_args[] = { +- IM_INPUT_IMAGEVEC( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "index" ) ++ IM_INPUT_IMAGEVEC("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("index") + }; + + static int +-rank_image_vec( im_object *argv ) ++rank_image_vec(im_object *argv) + { + im_imagevec_object *iv = (im_imagevec_object *) argv[0]; + int index = *((int *) argv[2]); + +- return( im_rank_image( iv->vec, argv[1], iv->n, index ) ); ++ return (im_rank_image(iv->vec, argv[1], iv->n, index)); + } + + static im_function rank_image_desc = { +- "im_rank_image", /* Name */ ++ "im_rank_image", /* Name */ + "point-wise pixel rank", /* Description */ +- IM_FN_PIO, /* Flags */ +- rank_image_vec, /* Dispatch function */ +- IM_NUMBER( rank_image_args ), /* Size of arg list */ +- rank_image_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ rank_image_vec, /* Dispatch function */ ++ IM_NUMBER(rank_image_args), /* Size of arg list */ ++ rank_image_args /* Arg list */ + }; + + /* Args for im_label_regions(). + */ + static im_arg_desc label_regions_args[] = { +- IM_INPUT_IMAGE( "test" ), +- IM_OUTPUT_IMAGE( "mask" ), +- IM_OUTPUT_INT( "segments" ) ++ IM_INPUT_IMAGE("test"), ++ IM_OUTPUT_IMAGE("mask"), ++ IM_OUTPUT_INT("segments") + }; + + /* Call im_label_regions() via arg vector. + */ + static int +-label_regions_vec( im_object *argv ) ++label_regions_vec(im_object *argv) + { + IMAGE *test = argv[0]; + IMAGE *mask = argv[1]; + int *serial = (int *) argv[2]; + +- return( im_label_regions( test, mask, serial ) ); ++ return (im_label_regions(test, mask, serial)); + } + + /* Description of im_label_regions(). +- */ ++ */ + static im_function label_regions_desc = { +- "im_label_regions", /* Name */ ++ "im_label_regions", /* Name */ + "number continuous regions in an image", +- 0, /* Flags */ +- label_regions_vec, /* Dispatch function */ +- IM_NUMBER( label_regions_args ),/* Size of arg list */ +- label_regions_args /* Arg list */ ++ 0, /* Flags */ ++ label_regions_vec, /* Dispatch function */ ++ IM_NUMBER(label_regions_args), /* Size of arg list */ ++ label_regions_args /* Arg list */ + }; + + /* Package up all these functions. +@@ -306,6 +306,6 @@ static im_function *morph_list[] = { + */ + im_package im__morphology = { + "morphology", +- IM_NUMBER( morph_list ), ++ IM_NUMBER(morph_list), + morph_list + }; +diff --git a/libvips/deprecated/mosaicing_dispatch.c b/libvips/deprecated/mosaicing_dispatch.c +index 899e868df6..709fede578 100644 +--- a/libvips/deprecated/mosaicing_dispatch.c ++++ b/libvips/deprecated/mosaicing_dispatch.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -45,73 +45,73 @@ + /* Merge args. + */ + static im_arg_desc merge_args[] = { +- IM_INPUT_IMAGE( "ref" ), +- IM_INPUT_IMAGE( "sec" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "dx" ), +- IM_INPUT_INT( "dy" ), +- IM_INPUT_INT( "mwidth" ) ++ IM_INPUT_IMAGE("ref"), ++ IM_INPUT_IMAGE("sec"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("dx"), ++ IM_INPUT_INT("dy"), ++ IM_INPUT_INT("mwidth") + }; + + /* Merge1 args. + */ + static im_arg_desc merge1_args[] = { +- IM_INPUT_IMAGE( "ref" ), +- IM_INPUT_IMAGE( "sec" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "xr1" ), +- IM_INPUT_INT( "yr1" ), +- IM_INPUT_INT( "xs1" ), +- IM_INPUT_INT( "ys1" ), +- IM_INPUT_INT( "xr2" ), +- IM_INPUT_INT( "yr2" ), +- IM_INPUT_INT( "xs2" ), +- IM_INPUT_INT( "ys2" ), +- IM_INPUT_INT( "mwidth" ) ++ IM_INPUT_IMAGE("ref"), ++ IM_INPUT_IMAGE("sec"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("xr1"), ++ IM_INPUT_INT("yr1"), ++ IM_INPUT_INT("xs1"), ++ IM_INPUT_INT("ys1"), ++ IM_INPUT_INT("xr2"), ++ IM_INPUT_INT("yr2"), ++ IM_INPUT_INT("xs2"), ++ IM_INPUT_INT("ys2"), ++ IM_INPUT_INT("mwidth") + }; + + /* Mosaic args. + */ + static im_arg_desc mosaic_args[] = { +- IM_INPUT_IMAGE( "ref" ), +- IM_INPUT_IMAGE( "sec" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "bandno" ), +- IM_INPUT_INT( "xr" ), +- IM_INPUT_INT( "yr" ), +- IM_INPUT_INT( "xs" ), +- IM_INPUT_INT( "ys" ), +- IM_INPUT_INT( "halfcorrelation" ), +- IM_INPUT_INT( "halfarea" ), +- IM_INPUT_INT( "balancetype" ), // Deprecated +- IM_INPUT_INT( "mwidth" ) ++ IM_INPUT_IMAGE("ref"), ++ IM_INPUT_IMAGE("sec"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("bandno"), ++ IM_INPUT_INT("xr"), ++ IM_INPUT_INT("yr"), ++ IM_INPUT_INT("xs"), ++ IM_INPUT_INT("ys"), ++ IM_INPUT_INT("halfcorrelation"), ++ IM_INPUT_INT("halfarea"), ++ IM_INPUT_INT("balancetype"), // Deprecated ++ IM_INPUT_INT("mwidth") + }; + + /* Mosaic1 args. + */ + static im_arg_desc mosaic1_args[] = { +- IM_INPUT_IMAGE( "ref" ), +- IM_INPUT_IMAGE( "sec" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "bandno" ), // Deprecated +- IM_INPUT_INT( "xr1" ), +- IM_INPUT_INT( "yr1" ), +- IM_INPUT_INT( "xs1" ), +- IM_INPUT_INT( "ys1" ), +- IM_INPUT_INT( "xr2" ), +- IM_INPUT_INT( "yr2" ), +- IM_INPUT_INT( "xs2" ), +- IM_INPUT_INT( "ys2" ), +- IM_INPUT_INT( "halfcorrelation" ), +- IM_INPUT_INT( "halfarea" ), +- IM_INPUT_INT( "balancetype" ), // Deprecated +- IM_INPUT_INT( "mwidth" ) ++ IM_INPUT_IMAGE("ref"), ++ IM_INPUT_IMAGE("sec"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("bandno"), // Deprecated ++ IM_INPUT_INT("xr1"), ++ IM_INPUT_INT("yr1"), ++ IM_INPUT_INT("xs1"), ++ IM_INPUT_INT("ys1"), ++ IM_INPUT_INT("xr2"), ++ IM_INPUT_INT("yr2"), ++ IM_INPUT_INT("xs2"), ++ IM_INPUT_INT("ys2"), ++ IM_INPUT_INT("halfcorrelation"), ++ IM_INPUT_INT("halfarea"), ++ IM_INPUT_INT("balancetype"), // Deprecated ++ IM_INPUT_INT("mwidth") + }; + + /* Call im_lrmosaic via arg vector. + */ + static int +-lrmosaic_vec( im_object *argv ) ++lrmosaic_vec(im_object *argv) + { + int bandno = *((int *) argv[3]); + int xr = *((int *) argv[4]); +@@ -122,17 +122,17 @@ lrmosaic_vec( im_object *argv ) + int halfarea = *((int *) argv[9]); + int mwidth = *((int *) argv[11]); + +- return( vips__lrmosaic( argv[0], argv[1], argv[2], +- bandno, +- xr, yr, xs, ys, ++ return (vips__lrmosaic(argv[0], argv[1], argv[2], ++ bandno, ++ xr, yr, xs, ys, + halfcorrelation, halfarea, +- mwidth ) ); ++ mwidth)); + } + + /* Call im_lrmosaic1 via arg vector. + */ + static int +-lrmosaic1_vec( im_object *argv ) ++lrmosaic1_vec(im_object *argv) + { + int xr1 = *((int *) argv[4]); + int yr1 = *((int *) argv[5]); +@@ -146,47 +146,47 @@ lrmosaic1_vec( im_object *argv ) + int halfarea = *((int *) argv[13]); + int mwidth = *((int *) argv[15]); + +- return( im_lrmosaic1( argv[0], argv[1], argv[2], +- 0, +- xr1, yr1, xs1, ys1, +- xr2, yr2, xs2, ys2, ++ return (im_lrmosaic1(argv[0], argv[1], argv[2], ++ 0, ++ xr1, yr1, xs1, ys1, ++ xr2, yr2, xs2, ys2, + halfcorrelation, halfarea, +- 0, mwidth ) ); ++ 0, mwidth)); + } + + /* Description of im_lrmosaic. +- */ ++ */ + static im_function lrmosaic_desc = { +- "im_lrmosaic", /* Name */ +- "left-right mosaic of ref and sec",/* Description */ +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- lrmosaic_vec, /* Dispatch function */ +- IM_NUMBER( mosaic_args ), /* Size of arg list */ +- mosaic_args /* Arg list */ ++ "im_lrmosaic", /* Name */ ++ "left-right mosaic of ref and sec", /* Description */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ lrmosaic_vec, /* Dispatch function */ ++ IM_NUMBER(mosaic_args), /* Size of arg list */ ++ mosaic_args /* Arg list */ + }; + + static im_arg_desc find_overlap_args[] = { +- IM_INPUT_IMAGE( "ref" ), +- IM_INPUT_IMAGE( "sec" ), +- IM_INPUT_INT( "bandno" ), +- IM_INPUT_INT( "xr" ), +- IM_INPUT_INT( "yr" ), +- IM_INPUT_INT( "xs" ), +- IM_INPUT_INT( "ys" ), +- IM_INPUT_INT( "halfcorrelation" ), +- IM_INPUT_INT( "halfarea" ), +- IM_OUTPUT_INT( "dx0" ), +- IM_OUTPUT_INT( "dy0" ), +- IM_OUTPUT_DOUBLE( "scale1" ), +- IM_OUTPUT_DOUBLE( "angle1" ), +- IM_OUTPUT_DOUBLE( "dx1" ), +- IM_OUTPUT_DOUBLE( "dy1" ) ++ IM_INPUT_IMAGE("ref"), ++ IM_INPUT_IMAGE("sec"), ++ IM_INPUT_INT("bandno"), ++ IM_INPUT_INT("xr"), ++ IM_INPUT_INT("yr"), ++ IM_INPUT_INT("xs"), ++ IM_INPUT_INT("ys"), ++ IM_INPUT_INT("halfcorrelation"), ++ IM_INPUT_INT("halfarea"), ++ IM_OUTPUT_INT("dx0"), ++ IM_OUTPUT_INT("dy0"), ++ IM_OUTPUT_DOUBLE("scale1"), ++ IM_OUTPUT_DOUBLE("angle1"), ++ IM_OUTPUT_DOUBLE("dx1"), ++ IM_OUTPUT_DOUBLE("dy1") + }; + + /* Call im__find_lroverlap via arg vector. + */ + static int +-find_lroverlap_vec( im_object *argv ) ++find_lroverlap_vec(im_object *argv) + { + int bandno = *((int *) argv[2]); + int xr = *((int *) argv[3]); +@@ -205,44 +205,44 @@ find_lroverlap_vec( im_object *argv ) + IMAGE *t; + int result; + +- if( !(t = im_open( "find_lroverlap_vec", "p" )) ) +- return( -1 ); +- result = vips__find_lroverlap( argv[0], argv[1], t, +- bandno, +- xr, yr, xs, ys, ++ if (!(t = im_open("find_lroverlap_vec", "p"))) ++ return (-1); ++ result = vips__find_lroverlap(argv[0], argv[1], t, ++ bandno, ++ xr, yr, xs, ys, + halfcorrelation, halfarea, +- dx0, dy0, scale1, angle1, dx1, dy1 ); +- im_close( t ); ++ dx0, dy0, scale1, angle1, dx1, dy1); ++ im_close(t); + +- return( result ); ++ return (result); + } + + /* Description of im__find_lroverlap. +- */ ++ */ + static im_function find_lroverlap_desc = { +- "im__find_lroverlap", /* Name */ +- "search for left-right overlap of ref and sec",/* Description */ +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- find_lroverlap_vec, /* Dispatch function */ +- IM_NUMBER( find_overlap_args ), /* Size of arg list */ +- find_overlap_args /* Arg list */ ++ "im__find_lroverlap", /* Name */ ++ "search for left-right overlap of ref and sec", /* Description */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ find_lroverlap_vec, /* Dispatch function */ ++ IM_NUMBER(find_overlap_args), /* Size of arg list */ ++ find_overlap_args /* Arg list */ + }; + + /* Description of im_lrmosaic1. +- */ ++ */ + static im_function lrmosaic1_desc = { +- "im_lrmosaic1", /* Name */ +- "first-order left-right mosaic of ref and sec",/* Description */ +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- lrmosaic1_vec, /* Dispatch function */ +- IM_NUMBER( mosaic1_args ), /* Size of arg list */ +- mosaic1_args /* Arg list */ ++ "im_lrmosaic1", /* Name */ ++ "first-order left-right mosaic of ref and sec", /* Description */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ lrmosaic1_vec, /* Dispatch function */ ++ IM_NUMBER(mosaic1_args), /* Size of arg list */ ++ mosaic1_args /* Arg list */ + }; + + /* Call im_tbmosaic via arg vector. + */ + static int +-tbmosaic_vec( im_object *argv ) ++tbmosaic_vec(im_object *argv) + { + int bandno = *((int *) argv[3]); + int x1 = *((int *) argv[4]); +@@ -253,17 +253,17 @@ tbmosaic_vec( im_object *argv ) + int halfarea = *((int *) argv[9]); + int mwidth = *((int *) argv[11]); + +- return( vips__tbmosaic( argv[0], argv[1], argv[2], +- bandno, +- x1, y1, x2, y2, ++ return (vips__tbmosaic(argv[0], argv[1], argv[2], ++ bandno, ++ x1, y1, x2, y2, + halfcorrelation, halfarea, +- mwidth ) ); ++ mwidth)); + } + + /* Call im_tbmosaic1 via arg vector. + */ + static int +-tbmosaic1_vec( im_object *argv ) ++tbmosaic1_vec(im_object *argv) + { + int xr1 = *((int *) argv[4]); + int yr1 = *((int *) argv[5]); +@@ -277,18 +277,18 @@ tbmosaic1_vec( im_object *argv ) + int halfarea = *((int *) argv[13]); + int mwidth = *((int *) argv[15]); + +- return( im_tbmosaic1( argv[0], argv[1], argv[2], +- 0, +- xr1, yr1, xs1, ys1, +- xr2, yr2, xs2, ys2, ++ return (im_tbmosaic1(argv[0], argv[1], argv[2], ++ 0, ++ xr1, yr1, xs1, ys1, ++ xr2, yr2, xs2, ys2, + halfcorrelation, halfarea, +- 0, mwidth ) ); ++ 0, mwidth)); + } + + /* Call im__find_tboverlap via arg vector. + */ + static int +-find_tboverlap_vec( im_object *argv ) ++find_tboverlap_vec(im_object *argv) + { + int bandno = *((int *) argv[2]); + int xr = *((int *) argv[3]); +@@ -307,67 +307,67 @@ find_tboverlap_vec( im_object *argv ) + IMAGE *t; + int result; + +- if( !(t = im_open( "find_tboverlap_vec", "p" )) ) +- return( -1 ); +- result = vips__find_tboverlap( argv[0], argv[1], t, +- bandno, +- xr, yr, xs, ys, ++ if (!(t = im_open("find_tboverlap_vec", "p"))) ++ return (-1); ++ result = vips__find_tboverlap(argv[0], argv[1], t, ++ bandno, ++ xr, yr, xs, ys, + halfcorrelation, halfarea, +- dx0, dy0, scale1, angle1, dx1, dy1 ); +- im_close( t ); ++ dx0, dy0, scale1, angle1, dx1, dy1); ++ im_close(t); + +- return( result ); ++ return (result); + } + + /* Description of im__find_tboverlap. +- */ ++ */ + static im_function find_tboverlap_desc = { +- "im__find_tboverlap", /* Name */ +- "search for top-bottom overlap of ref and sec",/* Description */ +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- find_tboverlap_vec, /* Dispatch function */ +- IM_NUMBER( find_overlap_args ), /* Size of arg list */ +- find_overlap_args /* Arg list */ ++ "im__find_tboverlap", /* Name */ ++ "search for top-bottom overlap of ref and sec", /* Description */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ find_tboverlap_vec, /* Dispatch function */ ++ IM_NUMBER(find_overlap_args), /* Size of arg list */ ++ find_overlap_args /* Arg list */ + }; + + /* Description of im_tbmosaic. +- */ ++ */ + static im_function tbmosaic_desc = { +- "im_tbmosaic", /* Name */ +- "top-bottom mosaic of in1 and in2",/* Description */ +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- tbmosaic_vec, /* Dispatch function */ +- IM_NUMBER( mosaic_args ), /* Size of arg list */ +- mosaic_args /* Arg list */ ++ "im_tbmosaic", /* Name */ ++ "top-bottom mosaic of in1 and in2", /* Description */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ tbmosaic_vec, /* Dispatch function */ ++ IM_NUMBER(mosaic_args), /* Size of arg list */ ++ mosaic_args /* Arg list */ + }; + + /* Description of im_tbmosaic1. +- */ ++ */ + static im_function tbmosaic1_desc = { +- "im_tbmosaic1", /* Name */ +- "first-order top-bottom mosaic of ref and sec",/* Description */ +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- tbmosaic1_vec, /* Dispatch function */ +- IM_NUMBER( mosaic1_args ), /* Size of arg list */ +- mosaic1_args /* Arg list */ ++ "im_tbmosaic1", /* Name */ ++ "first-order top-bottom mosaic of ref and sec", /* Description */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ tbmosaic1_vec, /* Dispatch function */ ++ IM_NUMBER(mosaic1_args), /* Size of arg list */ ++ mosaic1_args /* Arg list */ + }; + + /* Call im_lrmerge via arg vector. + */ + static int +-lrmerge_vec( im_object *argv ) ++lrmerge_vec(im_object *argv) + { + int dx = *((int *) argv[3]); + int dy = *((int *) argv[4]); + int mwidth = *((int *) argv[5]); + +- return( im_lrmerge( argv[0], argv[1], argv[2], dx, dy, mwidth ) ); ++ return (im_lrmerge(argv[0], argv[1], argv[2], dx, dy, mwidth)); + } + + /* Call im_lrmerge1 via arg vector. + */ + static int +-lrmerge1_vec( im_object *argv ) ++lrmerge1_vec(im_object *argv) + { + int xr1 = *((int *) argv[3]); + int yr1 = *((int *) argv[4]); +@@ -379,49 +379,49 @@ lrmerge1_vec( im_object *argv ) + int ys2 = *((int *) argv[10]); + int mwidth = *((int *) argv[11]); + +- return( im_lrmerge1( argv[0], argv[1], argv[2], +- xr1, yr1, xs1, ys1, +- xr2, yr2, xs2, ys2, mwidth ) ); ++ return (im_lrmerge1(argv[0], argv[1], argv[2], ++ xr1, yr1, xs1, ys1, ++ xr2, yr2, xs2, ys2, mwidth)); + } + + /* Description of im_lrmerge. +- */ ++ */ + static im_function lrmerge_desc = { +- "im_lrmerge", /* Name */ +- "left-right merge of in1 and in2",/* Description */ +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- lrmerge_vec, /* Dispatch function */ +- IM_NUMBER( merge_args ), /* Size of arg list */ +- merge_args /* Arg list */ ++ "im_lrmerge", /* Name */ ++ "left-right merge of in1 and in2", /* Description */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ lrmerge_vec, /* Dispatch function */ ++ IM_NUMBER(merge_args), /* Size of arg list */ ++ merge_args /* Arg list */ + }; + + /* Description of im_lrmerge1. +- */ ++ */ + static im_function lrmerge1_desc = { +- "im_lrmerge1", /* Name */ +- "first-order left-right merge of ref and sec",/* Description */ +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- lrmerge1_vec, /* Dispatch function */ +- IM_NUMBER( merge1_args ), /* Size of arg list */ +- merge1_args /* Arg list */ ++ "im_lrmerge1", /* Name */ ++ "first-order left-right merge of ref and sec", /* Description */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ lrmerge1_vec, /* Dispatch function */ ++ IM_NUMBER(merge1_args), /* Size of arg list */ ++ merge1_args /* Arg list */ + }; + + /* Call im_tbmerge via arg vector. + */ + static int +-tbmerge_vec( im_object *argv ) ++tbmerge_vec(im_object *argv) + { + int dx = *((int *) argv[3]); + int dy = *((int *) argv[4]); + int mwidth = *((int *) argv[5]); + +- return( im_tbmerge( argv[0], argv[1], argv[2], dx, dy, mwidth ) ); ++ return (im_tbmerge(argv[0], argv[1], argv[2], dx, dy, mwidth)); + } + + /* Call im_tbmerge1 via arg vector. + */ + static int +-tbmerge1_vec( im_object *argv ) ++tbmerge1_vec(im_object *argv) + { + int xr1 = *((int *) argv[3]); + int yr1 = *((int *) argv[4]); +@@ -433,53 +433,53 @@ tbmerge1_vec( im_object *argv ) + int ys2 = *((int *) argv[10]); + int mwidth = *((int *) argv[11]); + +- return( im_tbmerge1( argv[0], argv[1], argv[2], +- xr1, yr1, xs1, ys1, +- xr2, yr2, xs2, ys2, mwidth ) ); ++ return (im_tbmerge1(argv[0], argv[1], argv[2], ++ xr1, yr1, xs1, ys1, ++ xr2, yr2, xs2, ys2, mwidth)); + } + + /* Description of im_tbmerge. +- */ ++ */ + static im_function tbmerge_desc = { +- "im_tbmerge", /* Name */ +- "top-bottom merge of in1 and in2",/* Description */ +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- tbmerge_vec, /* Dispatch function */ +- IM_NUMBER( merge_args ), /* Size of arg list */ +- merge_args /* Arg list */ ++ "im_tbmerge", /* Name */ ++ "top-bottom merge of in1 and in2", /* Description */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ tbmerge_vec, /* Dispatch function */ ++ IM_NUMBER(merge_args), /* Size of arg list */ ++ merge_args /* Arg list */ + }; + + /* Description of im_tbmerge1. +- */ ++ */ + static im_function tbmerge1_desc = { +- "im_tbmerge1", /* Name */ +- "first-order top-bottom merge of in1 and in2",/* Description */ +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- tbmerge1_vec, /* Dispatch function */ +- IM_NUMBER( merge1_args ), /* Size of arg list */ +- merge1_args /* Arg list */ ++ "im_tbmerge1", /* Name */ ++ "first-order top-bottom merge of in1 and in2", /* Description */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ tbmerge1_vec, /* Dispatch function */ ++ IM_NUMBER(merge1_args), /* Size of arg list */ ++ merge1_args /* Arg list */ + }; + + /* match_linear args + */ + static im_arg_desc match_linear_args[] = { +- IM_INPUT_IMAGE( "ref" ), +- IM_INPUT_IMAGE( "sec" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "xref1" ), +- IM_INPUT_INT( "yref1" ), +- IM_INPUT_INT( "xsec1" ), +- IM_INPUT_INT( "ysec1" ), +- IM_INPUT_INT( "xref2" ), +- IM_INPUT_INT( "yref2" ), +- IM_INPUT_INT( "xsec2" ), +- IM_INPUT_INT( "ysec2" ) ++ IM_INPUT_IMAGE("ref"), ++ IM_INPUT_IMAGE("sec"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("xref1"), ++ IM_INPUT_INT("yref1"), ++ IM_INPUT_INT("xsec1"), ++ IM_INPUT_INT("ysec1"), ++ IM_INPUT_INT("xref2"), ++ IM_INPUT_INT("yref2"), ++ IM_INPUT_INT("xsec2"), ++ IM_INPUT_INT("ysec2") + }; + + /* Call im_match_linear via arg vector. + */ + static int +-match_linear_vec( im_object *argv ) ++match_linear_vec(im_object *argv) + { + int xref1 = *((int *) argv[3]); + int yref1 = *((int *) argv[4]); +@@ -490,44 +490,44 @@ match_linear_vec( im_object *argv ) + int xsec2 = *((int *) argv[9]); + int ysec2 = *((int *) argv[10]); + +- return( im_match_linear( argv[0], argv[1], argv[2], +- xref1, yref1, xsec1, ysec1, +- xref2, yref2, xsec2, ysec2 ) ); ++ return (im_match_linear(argv[0], argv[1], argv[2], ++ xref1, yref1, xsec1, ysec1, ++ xref2, yref2, xsec2, ysec2)); + } + + /* Description of im_match_linear. +- */ ++ */ + static im_function match_linear_desc = { +- "im_match_linear", /* Name */ ++ "im_match_linear", /* Name */ + "resample ref so that tie-points match", +- IM_FN_PIO, /* Flags */ +- match_linear_vec, /* Dispatch function */ +- IM_NUMBER( match_linear_args ), /* Size of arg list */ +- match_linear_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ match_linear_vec, /* Dispatch function */ ++ IM_NUMBER(match_linear_args), /* Size of arg list */ ++ match_linear_args /* Arg list */ + }; + + /* match_linear_search args + */ + static im_arg_desc match_linear_search_args[] = { +- IM_INPUT_IMAGE( "ref" ), +- IM_INPUT_IMAGE( "sec" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "xref1" ), +- IM_INPUT_INT( "yref1" ), +- IM_INPUT_INT( "xsec1" ), +- IM_INPUT_INT( "ysec1" ), +- IM_INPUT_INT( "xref2" ), +- IM_INPUT_INT( "yref2" ), +- IM_INPUT_INT( "xsec2" ), +- IM_INPUT_INT( "ysec2" ), +- IM_INPUT_INT( "hwindowsize" ), +- IM_INPUT_INT( "hsearchsize" ) ++ IM_INPUT_IMAGE("ref"), ++ IM_INPUT_IMAGE("sec"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("xref1"), ++ IM_INPUT_INT("yref1"), ++ IM_INPUT_INT("xsec1"), ++ IM_INPUT_INT("ysec1"), ++ IM_INPUT_INT("xref2"), ++ IM_INPUT_INT("yref2"), ++ IM_INPUT_INT("xsec2"), ++ IM_INPUT_INT("ysec2"), ++ IM_INPUT_INT("hwindowsize"), ++ IM_INPUT_INT("hsearchsize") + }; + + /* Call im_match_linear_search via arg vector. + */ + static int +-match_linear_search_vec( im_object *argv ) ++match_linear_search_vec(im_object *argv) + { + int xref1 = *((int *) argv[3]); + int yref1 = *((int *) argv[4]); +@@ -540,43 +540,43 @@ match_linear_search_vec( im_object *argv ) + int hwin = *((int *) argv[11]); + int hsrch = *((int *) argv[12]); + +- return( im_match_linear_search( argv[0], argv[1], argv[2], +- xref1, yref1, xsec1, ysec1, ++ return (im_match_linear_search(argv[0], argv[1], argv[2], ++ xref1, yref1, xsec1, ysec1, + xref2, yref2, xsec2, ysec2, +- hwin, hsrch ) ); ++ hwin, hsrch)); + } + + /* Description of im_match_linear_search. +- */ ++ */ + static im_function match_linear_search_desc = { +- "im_match_linear_search", /* Name */ ++ "im_match_linear_search", /* Name */ + "search sec, then resample so that tie-points match", +- IM_FN_PIO, /* Flags */ +- match_linear_search_vec, /* Dispatch function */ +- IM_NUMBER( match_linear_search_args ),/* Size of arg list */ +- match_linear_search_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ match_linear_search_vec, /* Dispatch function */ ++ IM_NUMBER(match_linear_search_args), /* Size of arg list */ ++ match_linear_search_args /* Arg list */ + }; + + /* correl args + */ + static im_arg_desc correl_args[] = { +- IM_INPUT_IMAGE( "ref" ), +- IM_INPUT_IMAGE( "sec" ), +- IM_INPUT_INT( "xref" ), +- IM_INPUT_INT( "yref" ), +- IM_INPUT_INT( "xsec" ), +- IM_INPUT_INT( "ysec" ), +- IM_INPUT_INT( "hwindowsize" ), +- IM_INPUT_INT( "hsearchsize" ), +- IM_OUTPUT_DOUBLE( "correlation" ), +- IM_OUTPUT_INT( "x" ), +- IM_OUTPUT_INT( "y" ) ++ IM_INPUT_IMAGE("ref"), ++ IM_INPUT_IMAGE("sec"), ++ IM_INPUT_INT("xref"), ++ IM_INPUT_INT("yref"), ++ IM_INPUT_INT("xsec"), ++ IM_INPUT_INT("ysec"), ++ IM_INPUT_INT("hwindowsize"), ++ IM_INPUT_INT("hsearchsize"), ++ IM_OUTPUT_DOUBLE("correlation"), ++ IM_OUTPUT_INT("x"), ++ IM_OUTPUT_INT("y") + }; + + /* Call im_correl via arg vector. + */ + static int +-correl_vec( im_object *argv ) ++correl_vec(im_object *argv) + { + int xref = *((int *) argv[2]); + int yref = *((int *) argv[3]); +@@ -588,140 +588,144 @@ correl_vec( im_object *argv ) + int *y = (int *) argv[9]; + double *correlation = (double *) argv[10]; + +- return( vips__correl( argv[0], argv[1], +- xref, yref, xsec, ysec, cor, area, correlation, x, y ) ); ++ return (vips__correl(argv[0], argv[1], ++ xref, yref, xsec, ysec, cor, area, correlation, x, y)); + } + + /* Description of im_correl. +- */ ++ */ + static im_function correl_desc = { +- "im_correl", /* Name */ ++ "im_correl", /* Name */ + "search area around sec for match for area around ref", +- IM_FN_PIO, /* Flags */ +- correl_vec, /* Dispatch function */ +- IM_NUMBER( correl_args ), /* Size of arg list */ +- correl_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ correl_vec, /* Dispatch function */ ++ IM_NUMBER(correl_args), /* Size of arg list */ ++ correl_args /* Arg list */ + }; + + /* global_balance args + */ + static im_arg_desc global_balance_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLE( "gamma" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLE("gamma") + }; + + /* Call im_global_balance via arg vector. + */ + static int +-global_balance_vec( im_object *argv ) ++global_balance_vec(im_object *argv) + { + double gamma = *((double *) argv[2]); + +- return( im_global_balance( argv[0], argv[1], gamma ) ); ++ return (im_global_balance(argv[0], argv[1], gamma)); + } + + /* Description of im_global_balance. +- */ ++ */ + static im_function global_balance_desc = { +- "im_global_balance", /* Name */ ++ "im_global_balance", /* Name */ + "automatically rebuild mosaic with balancing", + IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- global_balance_vec, /* Dispatch function */ +- IM_NUMBER( global_balance_args ), /* Size of arg list */ +- global_balance_args /* Arg list */ ++ global_balance_vec, /* Dispatch function */ ++ IM_NUMBER(global_balance_args), /* Size of arg list */ ++ global_balance_args /* Arg list */ + }; + + /* Call im_global_balancef via arg vector. + */ + static int +-global_balancef_vec( im_object *argv ) ++global_balancef_vec(im_object *argv) + { + double gamma = *((double *) argv[2]); + +- return( im_global_balancef( argv[0], argv[1], gamma ) ); ++ return (im_global_balancef(argv[0], argv[1], gamma)); + } + + /* Description of im_global_balancef. +- */ ++ */ + static im_function global_balancef_desc = { +- "im_global_balancef", /* Name */ ++ "im_global_balancef", /* Name */ + "automatically rebuild mosaic with balancing, float output", + IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- global_balancef_vec, /* Dispatch function */ +- IM_NUMBER( global_balance_args ), /* Size of arg list */ +- global_balance_args /* Arg list */ ++ global_balancef_vec, /* Dispatch function */ ++ IM_NUMBER(global_balance_args), /* Size of arg list */ ++ global_balance_args /* Arg list */ + }; + + /* remosaic args + */ + static im_arg_desc remosaic_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_STRING( "old_str" ), +- IM_INPUT_STRING( "new_str" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_STRING("old_str"), ++ IM_INPUT_STRING("new_str") + }; + + /* Call im_remosaic via arg vector. + */ + static int +-remosaic_vec( im_object *argv ) ++remosaic_vec(im_object *argv) + { +- return( im_remosaic( argv[0], argv[1], argv[2], argv[3] ) ); ++ return (im_remosaic(argv[0], argv[1], argv[2], argv[3])); + } + + /* Description of im_remosaic. +- */ ++ */ + static im_function remosaic_desc = { +- "im_remosaic", /* Name */ ++ "im_remosaic", /* Name */ + "automatically rebuild mosaic with new files", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- remosaic_vec, /* Dispatch function */ +- IM_NUMBER( remosaic_args ),/* Size of arg list */ +- remosaic_args /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ remosaic_vec, /* Dispatch function */ ++ IM_NUMBER(remosaic_args), /* Size of arg list */ ++ remosaic_args /* Arg list */ + }; + +-static int align_bands_vec( im_object *argv ){ +- return im_align_bands( (IMAGE*)argv[0], (IMAGE*)argv[1] ); ++static int ++align_bands_vec(im_object *argv) ++{ ++ return im_align_bands((IMAGE *) argv[0], (IMAGE *) argv[1]); + } + +-static im_arg_desc align_bands_arg_types[]= { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++static im_arg_desc align_bands_arg_types[] = { ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out") + }; + +-static im_function align_bands_desc= { +- "im_align_bands", +- "align the bands of an image", +- 0, +- align_bands_vec, +- IM_NUMBER( align_bands_arg_types ), +- align_bands_arg_types ++static im_function align_bands_desc = { ++ "im_align_bands", ++ "align the bands of an image", ++ 0, ++ align_bands_vec, ++ IM_NUMBER(align_bands_arg_types), ++ align_bands_arg_types + }; + +-static int maxpos_subpel_vec( im_object *argv ){ +- return im_maxpos_subpel( (IMAGE*)argv[0], (double*)argv[1], (double*)argv[2] ); ++static int ++maxpos_subpel_vec(im_object *argv) ++{ ++ return im_maxpos_subpel((IMAGE *) argv[0], (double *) argv[1], (double *) argv[2]); + } + +-static im_arg_desc maxpos_subpel_arg_types[]= { +- IM_INPUT_IMAGE( "im" ), +- IM_OUTPUT_DOUBLE( "x" ), +- IM_OUTPUT_DOUBLE( "y" ) ++static im_arg_desc maxpos_subpel_arg_types[] = { ++ IM_INPUT_IMAGE("im"), ++ IM_OUTPUT_DOUBLE("x"), ++ IM_OUTPUT_DOUBLE("y") + }; + +-static im_function maxpos_subpel_desc= { +- "im_maxpos_subpel", +- "subpixel position of maximum of (phase correlation) image", +- IM_FN_PIO, +- maxpos_subpel_vec, +- IM_NUMBER( maxpos_subpel_arg_types ), +- maxpos_subpel_arg_types ++static im_function maxpos_subpel_desc = { ++ "im_maxpos_subpel", ++ "subpixel position of maximum of (phase correlation) image", ++ IM_FN_PIO, ++ maxpos_subpel_vec, ++ IM_NUMBER(maxpos_subpel_arg_types), ++ maxpos_subpel_arg_types + }; + + /* Package up all these functions. + */ + static im_function *mos_list[] = { +- &align_bands_desc, ++ &align_bands_desc, + &correl_desc, + &find_lroverlap_desc, + &find_tboverlap_desc, +@@ -733,7 +737,7 @@ static im_function *mos_list[] = { + &lrmosaic1_desc, + &match_linear_desc, + &match_linear_search_desc, +- &maxpos_subpel_desc, ++ &maxpos_subpel_desc, + &remosaic_desc, + &tbmerge_desc, + &tbmerge1_desc, +@@ -745,6 +749,6 @@ static im_function *mos_list[] = { + */ + im_package im__mosaicing = { + "mosaicing", +- IM_NUMBER( mos_list ), ++ IM_NUMBER(mos_list), + mos_list + }; +diff --git a/libvips/deprecated/other_dispatch.c b/libvips/deprecated/other_dispatch.c +index f36a74df2d..741a98e78b 100644 +--- a/libvips/deprecated/other_dispatch.c ++++ b/libvips/deprecated/other_dispatch.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,301 +43,301 @@ + /* Args for im_sines. + */ + static im_arg_desc sines_args[] = { +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "xsize" ), +- IM_INPUT_INT( "ysize" ), +- IM_INPUT_DOUBLE( "horfreq" ), +- IM_INPUT_DOUBLE( "verfreq" ) ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("xsize"), ++ IM_INPUT_INT("ysize"), ++ IM_INPUT_DOUBLE("horfreq"), ++ IM_INPUT_DOUBLE("verfreq") + }; + + /* Call im_sines via arg vector. + */ + static int +-sines_vec( im_object *argv ) ++sines_vec(im_object *argv) + { + int xsize = *((int *) argv[1]); + int ysize = *((int *) argv[2]); + double horfreq = *((double *) argv[3]); + double verfreq = *((double *) argv[4]); + +- return( im_sines( argv[0], xsize, ysize, horfreq, verfreq ) ); ++ return (im_sines(argv[0], xsize, ysize, horfreq, verfreq)); + } + + /* Description of im_sines. +- */ ++ */ + static im_function sines_desc = { +- "im_sines", /* Name */ ++ "im_sines", /* Name */ + "generate 2D sine image", +- 0, /* Flags */ +- sines_vec, /* Dispatch function */ +- IM_NUMBER( sines_args ), /* Size of arg list */ +- sines_args /* Arg list */ ++ 0, /* Flags */ ++ sines_vec, /* Dispatch function */ ++ IM_NUMBER(sines_args), /* Size of arg list */ ++ sines_args /* Arg list */ + }; + + /* Args for im_eye. + */ + static im_arg_desc eye_args[] = { +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "xsize" ), +- IM_INPUT_INT( "ysize" ), +- IM_INPUT_DOUBLE( "factor" ) ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("xsize"), ++ IM_INPUT_INT("ysize"), ++ IM_INPUT_DOUBLE("factor") + }; + + /* Call im_eye via arg vector. + */ + static int +-eye_vec( im_object *argv ) ++eye_vec(im_object *argv) + { + int xsize = *((int *) argv[1]); + int ysize = *((int *) argv[2]); + double factor = *((double *) argv[3]); + +- return( im_eye( argv[0], xsize, ysize, factor ) ); ++ return (im_eye(argv[0], xsize, ysize, factor)); + } + + /* Description of im_eye. +- */ ++ */ + static im_function eye_desc = { +- "im_eye", /* Name */ ++ "im_eye", /* Name */ + "generate IM_BANDFMT_UCHAR [0,255] frequency/amplitude image", +- 0, /* Flags */ +- eye_vec, /* Dispatch function */ +- IM_NUMBER( eye_args ), /* Size of arg list */ +- eye_args /* Arg list */ ++ 0, /* Flags */ ++ eye_vec, /* Dispatch function */ ++ IM_NUMBER(eye_args), /* Size of arg list */ ++ eye_args /* Arg list */ + }; + + /* Call im_feye via arg vector. + */ + static int +-feye_vec( im_object *argv ) ++feye_vec(im_object *argv) + { + int xsize = *((int *) argv[1]); + int ysize = *((int *) argv[2]); + double factor = *((double *) argv[3]); + +- return( im_feye( argv[0], xsize, ysize, factor ) ); ++ return (im_feye(argv[0], xsize, ysize, factor)); + } + + /* Description of im_feye. +- */ ++ */ + static im_function feye_desc = { +- "im_feye", /* Name */ ++ "im_feye", /* Name */ + "generate IM_BANDFMT_FLOAT [-1,1] frequency/amplitude image", +- 0, /* Flags */ +- feye_vec, /* Dispatch function */ +- IM_NUMBER( eye_args ), /* Size of arg list */ +- eye_args /* Arg list */ ++ 0, /* Flags */ ++ feye_vec, /* Dispatch function */ ++ IM_NUMBER(eye_args), /* Size of arg list */ ++ eye_args /* Arg list */ + }; + + /* Args for im_zone. + */ + static im_arg_desc zone_args[] = { +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "size" ) ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("size") + }; + + /* Call im_zone via arg vector. + */ + static int +-zone_vec( im_object *argv ) ++zone_vec(im_object *argv) + { + int size = *((int *) argv[1]); + +- return( im_zone( argv[0], size ) ); ++ return (im_zone(argv[0], size)); + } + + /* Description of im_zone. +- */ ++ */ + static im_function zone_desc = { +- "im_zone", /* Name */ ++ "im_zone", /* Name */ + "generate IM_BANDFMT_UCHAR [0,255] zone plate image", /* Description */ +- 0, /* Flags */ +- zone_vec, /* Dispatch function */ +- IM_NUMBER( zone_args ), /* Size of arg list */ +- zone_args /* Arg list */ ++ 0, /* Flags */ ++ zone_vec, /* Dispatch function */ ++ IM_NUMBER(zone_args), /* Size of arg list */ ++ zone_args /* Arg list */ + }; + + /* Call im_fzone via arg vector. + */ + static int +-fzone_vec( im_object *argv ) ++fzone_vec(im_object *argv) + { + int size = *((int *) argv[1]); + +- return( im_fzone( argv[0], size ) ); ++ return (im_fzone(argv[0], size)); + } + + /* Description of im_fzone. +- */ ++ */ + static im_function fzone_desc = { +- "im_fzone", /* Name */ ++ "im_fzone", /* Name */ + "generate IM_BANDFMT_FLOAT [-1,1] zone plate image", /* Description */ +- 0, /* Flags */ +- fzone_vec, /* Dispatch function */ +- IM_NUMBER( zone_args ), /* Size of arg list */ +- zone_args /* Arg list */ ++ 0, /* Flags */ ++ fzone_vec, /* Dispatch function */ ++ IM_NUMBER(zone_args), /* Size of arg list */ ++ zone_args /* Arg list */ + }; + + /* Args for im_benchmark. + */ + static im_arg_desc benchmark_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out") + }; + + /* Call im_benchmark via arg vector. + */ + static int +-benchmark_vec( im_object *argv ) ++benchmark_vec(im_object *argv) + { +- return( im_benchmarkn( argv[0], argv[1], 1 ) ); ++ return (im_benchmarkn(argv[0], argv[1], 1)); + } + + /* Description of im_benchmark. +- */ ++ */ + static im_function benchmark_desc = { +- "im_benchmark", /* Name */ ++ "im_benchmark", /* Name */ + "do something complicated for testing", /* Description */ +- IM_FN_PIO, /* Flags */ +- benchmark_vec, /* Dispatch function */ +- IM_NUMBER( benchmark_args ), /* Size of arg list */ +- benchmark_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ benchmark_vec, /* Dispatch function */ ++ IM_NUMBER(benchmark_args), /* Size of arg list */ ++ benchmark_args /* Arg list */ + }; + + /* Args for im_benchmark2. + */ + static im_arg_desc benchmark2_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_DOUBLE( "value" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_DOUBLE("value") + }; + + /* Call im_benchmark2 via arg vector. + */ + static int +-benchmark2_vec( im_object *argv ) ++benchmark2_vec(im_object *argv) + { +- double f; ++ double f; + +- if( im_benchmark2( argv[0], &f ) ) +- return( -1 ); ++ if (im_benchmark2(argv[0], &f)) ++ return (-1); + +- *((double *) argv[1]) = f; ++ *((double *) argv[1]) = f; + +- return( 0 ); ++ return (0); + } + + /* Description of im_benchmark2. + */ + static im_function benchmark2_desc = { +- "im_benchmark2", /* Name */ +- "do something complicated for testing", /* Description */ +- IM_FN_PIO, /* Flags */ +- benchmark2_vec, /* Dispatch function */ +- IM_NUMBER( benchmark2_args ), /* Size of arg list */ +- benchmark2_args /* Arg list */ ++ "im_benchmark2", /* Name */ ++ "do something complicated for testing", /* Description */ ++ IM_FN_PIO, /* Flags */ ++ benchmark2_vec, /* Dispatch function */ ++ IM_NUMBER(benchmark2_args), /* Size of arg list */ ++ benchmark2_args /* Arg list */ + }; + + /* Args for im_benchmarkn. + */ + static im_arg_desc benchmarkn_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "n" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("n") + }; + + /* Call im_benchmarkn via arg vector. + */ + static int +-benchmarkn_vec( im_object *argv ) ++benchmarkn_vec(im_object *argv) + { + int n = *((int *) argv[2]); + +- return( im_benchmarkn( argv[0], argv[1], n ) ); ++ return (im_benchmarkn(argv[0], argv[1], n)); + } + + /* Description of im_benchmarkn. +- */ ++ */ + static im_function benchmarkn_desc = { +- "im_benchmarkn", /* Name */ ++ "im_benchmarkn", /* Name */ + "do something complicated for testing", /* Description */ +- IM_FN_PIO, /* Flags */ +- benchmarkn_vec, /* Dispatch function */ +- IM_NUMBER( benchmarkn_args ), /* Size of arg list */ +- benchmarkn_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ benchmarkn_vec, /* Dispatch function */ ++ IM_NUMBER(benchmarkn_args), /* Size of arg list */ ++ benchmarkn_args /* Arg list */ + }; + + /* Args for im_grey. + */ + static im_arg_desc grey_args[] = { +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "xsize" ), +- IM_INPUT_INT( "ysize" ) ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("xsize"), ++ IM_INPUT_INT("ysize") + }; + + /* Call im_grey via arg vector. + */ + static int +-grey_vec( im_object *argv ) ++grey_vec(im_object *argv) + { + int xsize = *((int *) argv[1]); + int ysize = *((int *) argv[2]); + +- return( im_grey( argv[0], xsize, ysize ) ); ++ return (im_grey(argv[0], xsize, ysize)); + } + + /* Description of im_grey. +- */ ++ */ + static im_function grey_desc = { +- "im_grey", /* Name */ ++ "im_grey", /* Name */ + "generate IM_BANDFMT_UCHAR [0,255] grey scale image", /* Description */ +- 0, /* Flags */ +- grey_vec, /* Dispatch function */ +- IM_NUMBER( grey_args ), /* Size of arg list */ +- grey_args /* Arg list */ ++ 0, /* Flags */ ++ grey_vec, /* Dispatch function */ ++ IM_NUMBER(grey_args), /* Size of arg list */ ++ grey_args /* Arg list */ + }; + + /* Call im_fgrey via arg vector. + */ + static int +-fgrey_vec( im_object *argv ) ++fgrey_vec(im_object *argv) + { + int xsize = *((int *) argv[1]); + int ysize = *((int *) argv[2]); + +- return( im_fgrey( argv[0], xsize, ysize ) ); ++ return (im_fgrey(argv[0], xsize, ysize)); + } + + /* Description of im_fgrey. +- */ ++ */ + static im_function fgrey_desc = { +- "im_fgrey", /* Name */ ++ "im_fgrey", /* Name */ + "generate IM_BANDFMT_FLOAT [0,1] grey scale image", /* Description */ +- 0, /* Flags */ +- fgrey_vec, /* Dispatch function */ +- IM_NUMBER( grey_args ), /* Size of arg list */ +- grey_args /* Arg list */ ++ 0, /* Flags */ ++ fgrey_vec, /* Dispatch function */ ++ IM_NUMBER(grey_args), /* Size of arg list */ ++ grey_args /* Arg list */ + }; + + /* Call im_make_xy via arg vector. + */ + static int +-make_xy_vec( im_object *argv ) ++make_xy_vec(im_object *argv) + { + int xsize = *((int *) argv[1]); + int ysize = *((int *) argv[2]); + +- return( im_make_xy( argv[0], xsize, ysize ) ); ++ return (im_make_xy(argv[0], xsize, ysize)); + } + + /* Description of im_make_xy. +- */ ++ */ + static im_function make_xy_desc = { +- "im_make_xy", /* Name */ ++ "im_make_xy", /* Name */ + "generate image with pixel value equal to coordinate", /* Description */ +- 0, /* Flags */ +- make_xy_vec, /* Dispatch function */ +- IM_NUMBER( grey_args ), /* Size of arg list */ +- grey_args /* Arg list */ ++ 0, /* Flags */ ++ make_xy_vec, /* Dispatch function */ ++ IM_NUMBER(grey_args), /* Size of arg list */ ++ grey_args /* Arg list */ + }; + + /* Package up all these functions. +@@ -360,6 +360,6 @@ static im_function *other_list[] = { + */ + im_package im__other = { + "other", +- IM_NUMBER( other_list ), ++ IM_NUMBER(other_list), + other_list + }; +diff --git a/libvips/deprecated/package.c b/libvips/deprecated/package.c +index 97182337f8..a99fa8b061 100644 +--- a/libvips/deprecated/package.c ++++ b/libvips/deprecated/package.c +@@ -14,28 +14,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -84,457 +84,457 @@ extern im_package im__video; + /* im_guess_prefix() args. + */ + static im_arg_desc guess_prefix_args[] = { +- IM_INPUT_STRING( "argv0" ), +- IM_INPUT_STRING( "env_name" ), +- IM_OUTPUT_STRING( "PREFIX" ) ++ IM_INPUT_STRING("argv0"), ++ IM_INPUT_STRING("env_name"), ++ IM_OUTPUT_STRING("PREFIX") + }; + + /* Call im_guess_prefix() via arg vector. + */ + static int +-guess_prefix_vec( im_object *argv ) ++guess_prefix_vec(im_object *argv) + { +- const char *prefix = vips_guess_prefix( argv[0], argv[1] ); ++ const char *prefix = vips_guess_prefix(argv[0], argv[1]); + +- if( !prefix ) { ++ if (!prefix) { + argv[2] = NULL; +- return( -1 ); ++ return (-1); + } + +- argv[2] = im_strdup( NULL, prefix ); ++ argv[2] = im_strdup(NULL, prefix); + +- return( 0 ); ++ return (0); + } + + /* Description of im_guess_prefix. +- */ ++ */ + static im_function guess_prefix_desc = { +- "im_guess_prefix", /* Name */ +- "guess install area", /* Description */ +- 0, /* Flags */ +- guess_prefix_vec, /* Dispatch function */ +- VIPS_NUMBER( guess_prefix_args ), /* Size of arg list */ +- guess_prefix_args /* Arg list */ ++ "im_guess_prefix", /* Name */ ++ "guess install area", /* Description */ ++ 0, /* Flags */ ++ guess_prefix_vec, /* Dispatch function */ ++ VIPS_NUMBER(guess_prefix_args), /* Size of arg list */ ++ guess_prefix_args /* Arg list */ + }; + + /* im_guess_libdir() args. + */ + static im_arg_desc guess_libdir_args[] = { +- IM_INPUT_STRING( "argv0" ), +- IM_INPUT_STRING( "env_name" ), +- IM_OUTPUT_STRING( "LIBDIR" ) ++ IM_INPUT_STRING("argv0"), ++ IM_INPUT_STRING("env_name"), ++ IM_OUTPUT_STRING("LIBDIR") + }; + + /* Call im_guess_libdir() via arg vector. + */ + static int +-guess_libdir_vec( im_object *argv ) ++guess_libdir_vec(im_object *argv) + { +- const char *libdir = vips_guess_libdir( argv[0], argv[1] ); ++ const char *libdir = vips_guess_libdir(argv[0], argv[1]); + +- if( !libdir ) { ++ if (!libdir) { + argv[2] = NULL; +- return( -1 ); ++ return (-1); + } + +- argv[2] = im_strdup( NULL, libdir ); ++ argv[2] = im_strdup(NULL, libdir); + +- return( 0 ); ++ return (0); + } + + /* Description of im_guess_libdir. +- */ ++ */ + static im_function guess_libdir_desc = { +- "im_guess_libdir", /* Name */ +- "guess library area", /* Description */ +- 0, /* Flags */ +- guess_libdir_vec, /* Dispatch function */ +- VIPS_NUMBER( guess_libdir_args ),/* Size of arg list */ +- guess_libdir_args /* Arg list */ ++ "im_guess_libdir", /* Name */ ++ "guess library area", /* Description */ ++ 0, /* Flags */ ++ guess_libdir_vec, /* Dispatch function */ ++ VIPS_NUMBER(guess_libdir_args), /* Size of arg list */ ++ guess_libdir_args /* Arg list */ + }; + + /* im_header_int() args. + */ + static im_arg_desc header_int_args[] = { +- IM_INPUT_STRING( "field" ), +- IM_INPUT_IMAGE( "image" ), +- IM_OUTPUT_INT( "value" ) ++ IM_INPUT_STRING("field"), ++ IM_INPUT_IMAGE("image"), ++ IM_OUTPUT_INT("value") + }; + + /* Call im_header_int() via arg vector. + */ + static int +-header_int_vec( im_object *argv ) ++header_int_vec(im_object *argv) + { +- return( im_header_int( (IMAGE *) argv[1], (const char *) argv[0], +- (int *) argv[2] ) ); ++ return (im_header_int((IMAGE *) argv[1], (const char *) argv[0], ++ (int *) argv[2])); + } + + /* Description of im_header_int(). +- */ ++ */ + static im_function header_int_desc = { +- "im_header_int", /* Name */ +- "extract int fields from header", /* Description */ +- 0, /* Flags */ +- header_int_vec, /* Dispatch function */ +- VIPS_NUMBER( header_int_args ), /* Size of arg list */ +- header_int_args /* Arg list */ ++ "im_header_int", /* Name */ ++ "extract int fields from header", /* Description */ ++ 0, /* Flags */ ++ header_int_vec, /* Dispatch function */ ++ VIPS_NUMBER(header_int_args), /* Size of arg list */ ++ header_int_args /* Arg list */ + }; + + /* im_header_get_typeof() args. + */ + static im_arg_desc header_get_typeof_args[] = { +- IM_INPUT_STRING( "field" ), +- IM_INPUT_IMAGE( "image" ), +- IM_OUTPUT_INT( "gtype" ) ++ IM_INPUT_STRING("field"), ++ IM_INPUT_IMAGE("image"), ++ IM_OUTPUT_INT("gtype") + }; + + /* Call im_header_get_typeof() via arg vector. + */ + static int +-header_get_typeof_vec( im_object *argv ) ++header_get_typeof_vec(im_object *argv) + { + int *out = (int *) argv[2]; + +- *out = im_header_get_typeof( (IMAGE *) argv[1], +- (const char *) argv[0] ); ++ *out = im_header_get_typeof((IMAGE *) argv[1], ++ (const char *) argv[0]); + +- return( 0 ); ++ return (0); + } + + /* Description of im_header_get_typeof(). +- */ ++ */ + static im_function header_get_typeof_desc = { +- "im_header_get_typeof", /* Name */ +- "return field type", /* Description */ +- 0, /* Flags */ +- header_get_typeof_vec, /* Dispatch function */ +- VIPS_NUMBER( header_get_typeof_args ),/* Size of arg list */ +- header_get_typeof_args /* Arg list */ ++ "im_header_get_typeof", /* Name */ ++ "return field type", /* Description */ ++ 0, /* Flags */ ++ header_get_typeof_vec, /* Dispatch function */ ++ VIPS_NUMBER(header_get_typeof_args), /* Size of arg list */ ++ header_get_typeof_args /* Arg list */ + }; + + /* im_header_double() args. + */ + static im_arg_desc header_double_args[] = { +- IM_INPUT_STRING( "field" ), +- IM_INPUT_IMAGE( "image" ), +- IM_OUTPUT_DOUBLE( "value" ) ++ IM_INPUT_STRING("field"), ++ IM_INPUT_IMAGE("image"), ++ IM_OUTPUT_DOUBLE("value") + }; + + /* Call im_header_double() via arg vector. + */ + static int +-header_double_vec( im_object *argv ) ++header_double_vec(im_object *argv) + { +- return( im_header_double( (IMAGE *) argv[1], (const char *) argv[0], +- (double *) argv[2] ) ); ++ return (im_header_double((IMAGE *) argv[1], (const char *) argv[0], ++ (double *) argv[2])); + } + + /* Description of im_header_double(). +- */ ++ */ + static im_function header_double_desc = { +- "im_header_double", /* Name */ +- "extract double fields from header", /* Description */ +- 0, /* Flags */ +- header_double_vec, /* Dispatch function */ +- VIPS_NUMBER( header_double_args ), /* Size of arg list */ +- header_double_args /* Arg list */ ++ "im_header_double", /* Name */ ++ "extract double fields from header", /* Description */ ++ 0, /* Flags */ ++ header_double_vec, /* Dispatch function */ ++ VIPS_NUMBER(header_double_args), /* Size of arg list */ ++ header_double_args /* Arg list */ + }; + + /* im_header_string() args. + */ + static im_arg_desc header_string_args[] = { +- IM_INPUT_STRING( "field" ), +- IM_INPUT_IMAGE( "image" ), +- IM_OUTPUT_STRING( "value" ) ++ IM_INPUT_STRING("field"), ++ IM_INPUT_IMAGE("image"), ++ IM_OUTPUT_STRING("value") + }; + + /* Call im_header_string() via arg vector. + */ + static int +-header_string_vec( im_object *argv ) ++header_string_vec(im_object *argv) + { + char **out = (char **) &argv[2]; + + /* Actually, we call im_header_as_string(), so we can do any field and + * not just the string-valued ones. + */ +- if( im_header_as_string( (IMAGE *) argv[1], +- (const char *) argv[0], out ) ) +- return( -1 ); ++ if (im_header_as_string((IMAGE *) argv[1], ++ (const char *) argv[0], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_header_string(). +- */ ++ */ + static im_function header_string_desc = { +- "im_header_string", /* Name */ +- "extract fields from headers as strings", /* Description */ +- 0, /* Flags */ +- header_string_vec, /* Dispatch function */ +- VIPS_NUMBER( header_string_args ),/* Size of arg list */ +- header_string_args /* Arg list */ ++ "im_header_string", /* Name */ ++ "extract fields from headers as strings", /* Description */ ++ 0, /* Flags */ ++ header_string_vec, /* Dispatch function */ ++ VIPS_NUMBER(header_string_args), /* Size of arg list */ ++ header_string_args /* Arg list */ + }; + + /* im_history_get() args. + */ + static im_arg_desc history_get_args[] = { +- IM_INPUT_IMAGE( "image" ), +- IM_OUTPUT_STRING( "history" ) ++ IM_INPUT_IMAGE("image"), ++ IM_OUTPUT_STRING("history") + }; + + /* Call im_history_get() via arg vector. + */ + static int +-history_get_vec( im_object *argv ) ++history_get_vec(im_object *argv) + { + char **out = (char **) &argv[1]; + const char *str; + +- if( !(str = im_history_get( (IMAGE *) argv[0] )) || +- !(*out = im_strdup( NULL, str )) ) +- return( -1 ); ++ if (!(str = im_history_get((IMAGE *) argv[0])) || ++ !(*out = im_strdup(NULL, str))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_history_get(). +- */ ++ */ + static im_function history_get_desc = { +- "im_history_get", /* Name */ +- "return the image history as a string", /* Description */ +- 0, /* Flags */ +- history_get_vec, /* Dispatch function */ +- VIPS_NUMBER( history_get_args ),/* Size of arg list */ +- history_get_args /* Arg list */ ++ "im_history_get", /* Name */ ++ "return the image history as a string", /* Description */ ++ 0, /* Flags */ ++ history_get_vec, /* Dispatch function */ ++ VIPS_NUMBER(history_get_args), /* Size of arg list */ ++ history_get_args /* Arg list */ + }; + + /* im_getext() args. + */ + static im_arg_desc getext_args[] = { +- IM_INPUT_IMAGE( "image" ), +- IM_OUTPUT_STRING( "history" ) ++ IM_INPUT_IMAGE("image"), ++ IM_OUTPUT_STRING("history") + }; + + /* Call im_getext() via arg vector. + */ + static int +-getext_vec( im_object *argv ) ++getext_vec(im_object *argv) + { + void **out = (void **) &argv[1]; + int size; + + /* void/char confusion is fine. + */ +- if( !(*out = im__read_extension_block( (IMAGE *) argv[0], &size )) ) +- return( -1 ); ++ if (!(*out = im__read_extension_block((IMAGE *) argv[0], &size))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_getext(). +- */ ++ */ + static im_function getext_desc = { +- "im_getext", /* Name */ +- "return the image metadata XML as a string", /* Description */ +- 0, /* Flags */ +- getext_vec, /* Dispatch function */ +- VIPS_NUMBER( getext_args ), /* Size of arg list */ +- getext_args /* Arg list */ ++ "im_getext", /* Name */ ++ "return the image metadata XML as a string", /* Description */ ++ 0, /* Flags */ ++ getext_vec, /* Dispatch function */ ++ VIPS_NUMBER(getext_args), /* Size of arg list */ ++ getext_args /* Arg list */ + }; + + /* im_printdesc() args. + */ + static im_arg_desc printdesc_args[] = { +- IM_INPUT_IMAGE( "image" ), ++ IM_INPUT_IMAGE("image"), + }; + + /* Call im_printdesc() via arg vector. + */ + static int +-printdesc_vec( im_object *argv ) ++printdesc_vec(im_object *argv) + { +- vips_object_print_dump( VIPS_OBJECT( argv[0] ) ); ++ vips_object_print_dump(VIPS_OBJECT(argv[0])); + +- return( 0 ); ++ return (0); + } + + /* Description of im_printdesc(). +- */ ++ */ + static im_function printdesc_desc = { +- "im_printdesc", /* Name */ +- "print an image header to stdout", /* Description */ +- 0, /* Flags */ +- printdesc_vec, /* Dispatch function */ +- VIPS_NUMBER( printdesc_args ), /* Size of arg list */ +- printdesc_args /* Arg list */ ++ "im_printdesc", /* Name */ ++ "print an image header to stdout", /* Description */ ++ 0, /* Flags */ ++ printdesc_vec, /* Dispatch function */ ++ VIPS_NUMBER(printdesc_args), /* Size of arg list */ ++ printdesc_args /* Arg list */ + }; + + /* im_version_string() args. + */ + static im_arg_desc version_string_args[] = { +- IM_OUTPUT_STRING( "version" ) ++ IM_OUTPUT_STRING("version") + }; + + /* Call im_version_string() via arg vector. + */ + static int +-version_string_vec( im_object *argv ) ++version_string_vec(im_object *argv) + { +- if( !(argv[0] = im_strdup( NULL, vips_version_string() )) ) +- return( -1 ); ++ if (!(argv[0] = im_strdup(NULL, vips_version_string()))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_version_string. +- */ ++ */ + static im_function version_string_desc = { +- "im_version_string", /* Name */ +- "VIPS version string", /* Description */ +- 0, /* Flags */ +- version_string_vec, /* Dispatch function */ +- VIPS_NUMBER( version_string_args ),/* Size of arg list */ +- version_string_args /* Arg list */ ++ "im_version_string", /* Name */ ++ "VIPS version string", /* Description */ ++ 0, /* Flags */ ++ version_string_vec, /* Dispatch function */ ++ VIPS_NUMBER(version_string_args), /* Size of arg list */ ++ version_string_args /* Arg list */ + }; + + /* im_version() args. + */ + static im_arg_desc version_args[] = { +- IM_INPUT_INT( "flag" ), +- IM_OUTPUT_INT( "version" ) ++ IM_INPUT_INT("flag"), ++ IM_OUTPUT_INT("version") + }; + + /* Call im_version() via arg vector. + */ + static int +-version_vec( im_object *argv ) ++version_vec(im_object *argv) + { + int flag = *((int *) argv[0]); + int *out = ((int *) argv[1]); + +- int version = vips_version( flag ); ++ int version = vips_version(flag); + +- if( version < 0 ) +- return( -1 ); ++ if (version < 0) ++ return (-1); + + *out = version; + +- return( 0 ); ++ return (0); + } + + /* Description of im_version. +- */ ++ */ + static im_function version_desc = { +- "im_version", /* Name */ +- "VIPS version number", /* Description */ +- 0, /* Flags */ +- version_vec, /* Dispatch function */ +- VIPS_NUMBER( version_args ), /* Size of arg list */ +- version_args /* Arg list */ ++ "im_version", /* Name */ ++ "VIPS version number", /* Description */ ++ 0, /* Flags */ ++ version_vec, /* Dispatch function */ ++ VIPS_NUMBER(version_args), /* Size of arg list */ ++ version_args /* Arg list */ + }; + + /* im_concurrency_get() args. + */ + static im_arg_desc concurrency_get_args[] = { +- IM_OUTPUT_INT( "concurrency" ) ++ IM_OUTPUT_INT("concurrency") + }; + + /* Call im_concurrency_get() via arg vector. + */ + static int +-concurrency_get_vec( im_object *argv ) ++concurrency_get_vec(im_object *argv) + { + int *out = ((int *) argv[0]); + + *out = vips_concurrency_get(); + +- return( 0 ); ++ return (0); + } + + /* Description of im_concurrency_get. +- */ ++ */ + static im_function concurrency_get_desc = { +- "im_concurrency_get", /* Name */ +- "get concurrency level", /* Description */ +- 0, /* Flags */ +- concurrency_get_vec, /* Dispatch function */ +- VIPS_NUMBER( concurrency_get_args ), /* Size of arg list */ +- concurrency_get_args /* Arg list */ ++ "im_concurrency_get", /* Name */ ++ "get concurrency level", /* Description */ ++ 0, /* Flags */ ++ concurrency_get_vec, /* Dispatch function */ ++ VIPS_NUMBER(concurrency_get_args), /* Size of arg list */ ++ concurrency_get_args /* Arg list */ + }; + + /* im_cache() args. + */ + static im_arg_desc cache_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "tile_width" ), +- IM_INPUT_INT( "tile_height" ), +- IM_INPUT_INT( "max_tiles" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("tile_width"), ++ IM_INPUT_INT("tile_height"), ++ IM_INPUT_INT("max_tiles") + }; + + /* Call im_cache() via arg vector. + */ + static int +-cache_vec( im_object *argv ) ++cache_vec(im_object *argv) + { + int tile_width = *((int *) argv[2]); + int tile_height = *((int *) argv[3]); + int max_tiles = *((int *) argv[4]); + +- return( im_cache( argv[0], argv[1], +- tile_width, tile_height, max_tiles ) ); ++ return (im_cache(argv[0], argv[1], ++ tile_width, tile_height, max_tiles)); + } + + /* Description of im_cache. +- */ ++ */ + static im_function cache_desc = { +- "im_cache", /* Name */ +- "cache results of an operation",/* Description */ +- 0, /* Flags */ +- cache_vec, /* Dispatch function */ +- VIPS_NUMBER( cache_args ), /* Size of arg list */ +- cache_args /* Arg list */ ++ "im_cache", /* Name */ ++ "cache results of an operation", /* Description */ ++ 0, /* Flags */ ++ cache_vec, /* Dispatch function */ ++ VIPS_NUMBER(cache_args), /* Size of arg list */ ++ cache_args /* Arg list */ + }; + + static int +-tile_cache_random_vec( im_object *argv ) ++tile_cache_random_vec(im_object *argv) + { + int tile_width = *((int *) argv[2]); + int tile_height = *((int *) argv[3]); + int max_tiles = *((int *) argv[4]); + +- return( im_tile_cache_random( argv[0], argv[1], +- tile_width, tile_height, max_tiles ) ); ++ return (im_tile_cache_random(argv[0], argv[1], ++ tile_width, tile_height, max_tiles)); + } + + /* Description of im_cache. +- */ ++ */ + static im_function tile_cache_random_desc = { +- "im_tile_cache_random", /* Name */ +- "cache results of an operation",/* Description */ +- 0, /* Flags */ +- tile_cache_random_vec, /* Dispatch function */ +- VIPS_NUMBER( cache_args ), /* Size of arg list */ +- cache_args /* Arg list */ ++ "im_tile_cache_random", /* Name */ ++ "cache results of an operation", /* Description */ ++ 0, /* Flags */ ++ tile_cache_random_vec, /* Dispatch function */ ++ VIPS_NUMBER(cache_args), /* Size of arg list */ ++ cache_args /* Arg list */ + }; + + /* im_binfile() args. + */ + static im_arg_desc binfile_args[] = { +- IM_INPUT_STRING( "filename" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "width" ), +- IM_INPUT_INT( "height" ), +- IM_INPUT_INT( "bands" ), +- IM_INPUT_INT( "offset" ) ++ IM_INPUT_STRING("filename"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("width"), ++ IM_INPUT_INT("height"), ++ IM_INPUT_INT("bands"), ++ IM_INPUT_INT("offset") + }; + + /* Call im_binfile() via arg vector. + */ + static int +-binfile_vec( im_object *argv ) ++binfile_vec(im_object *argv) + { + int width = *((int *) argv[2]); + int height = *((int *) argv[3]); +@@ -542,26 +542,26 @@ binfile_vec( im_object *argv ) + int offset = *((int *) argv[5]); + VipsImage *im; + +- if( !(im = vips_image_new_from_file_raw( argv[0], +- width, height, bands, offset )) ) +- return( -1 ); +- vips_object_local( argv[1], im ); ++ if (!(im = vips_image_new_from_file_raw(argv[0], ++ width, height, bands, offset))) ++ return (-1); ++ vips_object_local(argv[1], im); + +- if( im_copy( im, argv[1] ) ) +- return( -1 ); ++ if (im_copy(im, argv[1])) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Description of im_binfile. +- */ ++ */ + static im_function binfile_desc = { +- "im_binfile", /* Name */ +- "open a headerless binary file",/* Description */ +- 0, /* Flags */ +- binfile_vec, /* Dispatch function */ +- VIPS_NUMBER( binfile_args ), /* Size of arg list */ +- binfile_args /* Arg list */ ++ "im_binfile", /* Name */ ++ "open a headerless binary file", /* Description */ ++ 0, /* Flags */ ++ binfile_vec, /* Dispatch function */ ++ VIPS_NUMBER(binfile_args), /* Size of arg list */ ++ binfile_args /* Arg list */ + }; + + /* Package up iofuncs functions. +@@ -588,7 +588,7 @@ static im_function *iofuncs_list[] = { + */ + static im_package im__iofuncs = { + "iofuncs", +- VIPS_NUMBER( iofuncs_list ), ++ VIPS_NUMBER(iofuncs_list), + iofuncs_list + }; + +@@ -618,9 +618,9 @@ static im_package *built_in[] = { + /* How we represent a loaded plugin. + */ + typedef struct _Plugin { +- GModule *module; /* As loaded by g_module_open() */ +- char *name; /* Name we loaded */ +- im_package *pack; /* Package table */ ++ GModule *module; /* As loaded by g_module_open() */ ++ char *name; /* Name we loaded */ ++ im_package *pack; /* Package table */ + } Plugin; + + /* List of loaded plugins. +@@ -630,103 +630,104 @@ static GSList *plugin_list = NULL; + /* Free a plugin. + */ + static int +-plugin_free( Plugin *plug ) ++plugin_free(Plugin *plug) + { + char *name = plug->name ? plug->name : ""; + +- if( plug->module ) { +- if( !g_module_close( plug->module ) ) { +- vips_error( "plugin", +- _( "unable to close plugin \"%s\"" ), name ); +- vips_error( "plugin", "%s", g_module_error() ); +- return( -1 ); ++ if (plug->module) { ++ if (!g_module_close(plug->module)) { ++ vips_error("plugin", ++ _("unable to close plugin \"%s\""), name); ++ vips_error("plugin", "%s", g_module_error()); ++ return (-1); + } + + plug->module = NULL; + } +- VIPS_FREE( plug->name ); ++ VIPS_FREE(plug->name); + plug->pack = NULL; +- g_free( plug ); ++ g_free(plug); + +- plugin_list = g_slist_remove( plugin_list, plug ); ++ plugin_list = g_slist_remove(plugin_list, plug); + +- return( 0 ); ++ return (0); + } + #endif /*ENABLE_MODULES*/ + + /* Load a plugin. + */ + im_package * +-im_load_plugin( const char *name ) ++im_load_plugin(const char *name) + { + #ifdef ENABLE_MODULES + Plugin *plug; + + #ifdef DEBUG +- printf( "im_load_plugin: \"%s\"\n", name ); ++ printf("im_load_plugin: \"%s\"\n", name); + #endif /*DEBUG*/ + +- if( !g_module_supported() ) { +- vips_error( "plugin", +- "%s", _( "plugins not supported on this platform" ) ); +- return( NULL ); ++ if (!g_module_supported()) { ++ vips_error("plugin", ++ "%s", _("plugins not supported on this platform")); ++ return (NULL); + } + + /* Build a new plugin. + */ +- plug = VIPS_NEW( NULL, Plugin ); ++ plug = VIPS_NEW(NULL, Plugin); + plug->module = NULL; +- plug->name = g_strdup( name ); ++ plug->name = g_strdup(name); + plug->pack = NULL; +- plugin_list = g_slist_prepend( plugin_list, plug ); ++ plugin_list = g_slist_prepend(plugin_list, plug); + + /* Open library. + */ +- if( !(plug->module = g_module_open( name, 0 )) ) { +- vips_error( "plugin", +- _( "unable to open plugin \"%s\"" ), name ); +- vips_error( "plugin", "%s", g_module_error() ); +- plugin_free( plug ); ++ if (!(plug->module = g_module_open(name, 0))) { ++ vips_error("plugin", ++ _("unable to open plugin \"%s\""), name); ++ vips_error("plugin", "%s", g_module_error()); ++ plugin_free(plug); + +- return( NULL ); ++ return (NULL); + } + + /* Find package. + */ + /* Bizarre double-cast stops a bogus gcc 4.1 compiler warning. + */ +- if( !g_module_symbol( plug->module, +- "package_table", (gpointer *) ((void *) &plug->pack) ) ) { +- vips_error( "plugin", +- _( "unable to find symbol \"package_table\" " +- "in plugin \"%s\"" ), name ); +- vips_error( "plugin", "%s", g_module_error() ); +- plugin_free( plug ); +- +- return( NULL ); ++ if (!g_module_symbol(plug->module, ++ "package_table", (gpointer *) ((void *) &plug->pack))) { ++ vips_error("plugin", ++ _("unable to find symbol \"package_table\" " ++ "in plugin \"%s\""), ++ name); ++ vips_error("plugin", "%s", g_module_error()); ++ plugin_free(plug); ++ ++ return (NULL); + } + + /* Sanity check. + */ +- if( !plug->pack->name || plug->pack->nfuncs < 0 || +- plug->pack->nfuncs > 10000 ) { +- vips_error( "plugin", +- _( "corrupted package table in plugin \"%s\"" ), name ); +- plugin_free( plug ); ++ if (!plug->pack->name || plug->pack->nfuncs < 0 || ++ plug->pack->nfuncs > 10000) { ++ vips_error("plugin", ++ _("corrupted package table in plugin \"%s\""), name); ++ plugin_free(plug); + +- return( NULL ); ++ return (NULL); + } + + #ifdef DEBUG +- printf( "added package \"%s\"\n", plug->pack->name ); ++ printf("added package \"%s\"\n", plug->pack->name); + #endif /*DEBUG*/ + +- return( plug->pack ); +-#else /*!ENABLE_MODULES*/ +- vips_error( "plugin", +- "%s", _( "libvips built without modules support" ) ); ++ return (plug->pack); ++#else /*!ENABLE_MODULES*/ ++ vips_error("plugin", ++ "%s", _("libvips built without modules support")); + +- return( NULL ); ++ return (NULL); + #endif /*ENABLE_MODULES*/ + } + +@@ -734,77 +735,77 @@ im_load_plugin( const char *name ) + * any probs. + */ + int +-im_load_plugins( const char *fmt, ... ) ++im_load_plugins(const char *fmt, ...) + { + #ifdef ENABLE_MODULES +- va_list ap; +- char dir_name[VIPS_PATH_MAX]; +- GDir *dir; ++ va_list ap; ++ char dir_name[VIPS_PATH_MAX]; ++ GDir *dir; + const char *name; +- int result; ++ int result; + + /* Silently succeed if we can't do modules. + */ +- if( !g_module_supported() ) +- return( 0 ); ++ if (!g_module_supported()) ++ return (0); + +- va_start( ap, fmt ); +- (void) im_vsnprintf( dir_name, VIPS_PATH_MAX - 1, fmt, ap ); +- va_end( ap ); ++ va_start(ap, fmt); ++ (void) im_vsnprintf(dir_name, VIPS_PATH_MAX - 1, fmt, ap); ++ va_end(ap); + + #ifdef DEBUG +- printf( "im_load_plugins: searching \"%s\"\n", dir_name ); ++ printf("im_load_plugins: searching \"%s\"\n", dir_name); + #endif /*DEBUG*/ + +- if( !(dir = g_dir_open( dir_name, 0, NULL )) ) ++ if (!(dir = g_dir_open(dir_name, 0, NULL))) + /* Silent success for dir not there. + */ +- return( 0 ); ++ return (0); + +- result = 0; +- while( (name = g_dir_read_name( dir )) ) +- if( im_ispostfix( name, ".plg" ) ) { ++ result = 0; ++ while ((name = g_dir_read_name(dir))) ++ if (im_ispostfix(name, ".plg")) { + char path[VIPS_PATH_MAX]; + +- im_snprintf( path, VIPS_PATH_MAX - 1, +- "%s" G_DIR_SEPARATOR_S "%s", dir_name, name ); +- if( !im_load_plugin( path ) ) ++ im_snprintf(path, VIPS_PATH_MAX - 1, ++ "%s" G_DIR_SEPARATOR_S "%s", dir_name, name); ++ if (!im_load_plugin(path)) + result = -1; +- } +- g_dir_close( dir ); ++ } ++ g_dir_close(dir); + +- return( result ); +-#else /*!ENABLE_MODULES*/ ++ return (result); ++#else /*!ENABLE_MODULES*/ + /* Silently succeed if we can't do modules. + */ +- return( 0 ); ++ return (0); + #endif /*ENABLE_MODULES*/ + } + + /* Close all loaded plugins. + */ + int +-im_close_plugins( void ) ++im_close_plugins(void) + { + #ifdef ENABLE_MODULES +- while( plugin_list ) +- if( plugin_free( (Plugin *) plugin_list->data ) ) +- return( -1 ); ++ while (plugin_list) ++ if (plugin_free((Plugin *) plugin_list->data)) ++ return (-1); + #endif /*ENABLE_MODULES*/ + +- return( 0 ); ++ return (0); + } + + #ifdef ENABLE_MODULES + /* Apply a user-function to a plugin package. + */ + static void * +-apply_plugin( Plugin *plug, VSListMap2Fn fn, void *a ) ++apply_plugin(Plugin *plug, VSListMap2Fn fn, void *a) + { +- if( !plug->pack ) +- return( NULL ); ++ if (!plug->pack) ++ return (NULL); + else +- return( fn( plug->pack, a, NULL ) ); ++ return (fn(plug->pack, a, NULL)); + } + #endif /*ENABLE_MODULES*/ + +@@ -812,198 +813,198 @@ apply_plugin( Plugin *plug, VSListMap2Fn fn, void *a ) + * overriding of VIPS functions. + */ + void * +-im_map_packages( VSListMap2Fn fn, void *a ) ++im_map_packages(VSListMap2Fn fn, void *a) + { + #ifdef ENABLE_MODULES +- void *r = im_slist_map2( plugin_list, +- (VSListMap2Fn) apply_plugin, (void *) fn, a ); +-#else /*!ENABLE_MODULES*/ ++ void *r = im_slist_map2(plugin_list, ++ (VSListMap2Fn) apply_plugin, (void *) fn, a); ++#else /*!ENABLE_MODULES*/ + void *r = NULL; + #endif /*ENABLE_MODULES*/ + + /* If not there, try main VIPS package list. + */ +- if( !r ) { ++ if (!r) { + int i; + +- for( i = 0; i < VIPS_NUMBER( built_in ); i++ ) +- if( (r = fn( built_in[i], a, NULL )) ) +- return( r ); ++ for (i = 0; i < VIPS_NUMBER(built_in); i++) ++ if ((r = fn(built_in[i], a, NULL))) ++ return (r); + } + +- return( r ); ++ return (r); + } + + /* Search a package for a function. + */ + static im_function * +-search_package( im_package *pack, const char *name ) ++search_package(im_package *pack, const char *name) + { + int i; + +- for( i = 0; i < pack->nfuncs; i++ ) +- if( strcmp( pack->table[i]->name, name ) == 0 ) +- return( pack->table[i] ); ++ for (i = 0; i < pack->nfuncs; i++) ++ if (strcmp(pack->table[i]->name, name) == 0) ++ return (pack->table[i]); + +- return( NULL ); ++ return (NULL); + } + + /* Search all packages for a function. + */ + im_function * +-im_find_function( const char *name ) ++im_find_function(const char *name) + { +- im_function *fn = im_map_packages( +- (VSListMap2Fn) search_package, (void *) name ); ++ im_function *fn = im_map_packages( ++ (VSListMap2Fn) search_package, (void *) name); + +- if( !fn ) { +- vips_error( "im_find_function", _( "\"%s\" not found" ), name ); +- return( NULL ); ++ if (!fn) { ++ vips_error("im_find_function", _("\"%s\" not found"), name); ++ return (NULL); + } + +- return( fn ); ++ return (fn); + } + + /* Test for package is of name. + */ + static im_package * +-package_name( im_package *pack, const char *name ) ++package_name(im_package *pack, const char *name) + { +- if( strcmp( pack->name, name ) == 0 ) +- return( pack ); ++ if (strcmp(pack->name, name) == 0) ++ return (pack); + +- return( NULL ); ++ return (NULL); + } + + /* Find a package. + */ + im_package * +-im_find_package( const char *name ) ++im_find_package(const char *name) + { +- im_package *pack = im_map_packages( +- (VSListMap2Fn) package_name, (void *) name ); ++ im_package *pack = im_map_packages( ++ (VSListMap2Fn) package_name, (void *) name); + +- if( !pack ) { +- vips_error( "im_find_package", _( "\"%s\" not found" ), name ); +- return( NULL ); ++ if (!pack) { ++ vips_error("im_find_package", _("\"%s\" not found"), name); ++ return (NULL); + } + +- return( pack ); ++ return (pack); + } + + /* Test for package contains a function. + */ + static im_package * +-package_function( im_package *pack, const char *name ) ++package_function(im_package *pack, const char *name) + { +- if( search_package( pack, name ) ) +- return( pack ); ++ if (search_package(pack, name)) ++ return (pack); + else +- return( NULL ); ++ return (NULL); + } + + /* Find a function's package by name. + */ + im_package * +-im_package_of_function( const char *name ) ++im_package_of_function(const char *name) + { +- im_package *pack = im_map_packages( +- (VSListMap2Fn) package_function, (void *) name ); ++ im_package *pack = im_map_packages( ++ (VSListMap2Fn) package_function, (void *) name); + +- if( !pack ) { +- vips_error( "im_package_of_function", +- _( "\"%s\" not found" ), name ); +- return( NULL ); ++ if (!pack) { ++ vips_error("im_package_of_function", ++ _("\"%s\" not found"), name); ++ return (NULL); + } + +- return( pack ); ++ return (pack); + } + + /* Free any store we allocated for the argument list. + */ + int +-im_free_vargv( im_function *fn, im_object *vargv ) ++im_free_vargv(im_function *fn, im_object *vargv) + { + int i; + int vargc = fn->argc; + + /* Free all elements. + */ +- for( i = 0; i < vargc; i++ ) +- if( vargv[i] ) { ++ for (i = 0; i < vargc; i++) ++ if (vargv[i]) { + /* If there is local storage, free it. + */ +- if( fn->argv[i].desc->size != 0 ) +- g_free( vargv[i] ); ++ if (fn->argv[i].desc->size != 0) ++ g_free(vargv[i]); + + /* NULL out pointer. + */ + vargv[i] = NULL; + } + +- return( 0 ); ++ return (0); + } + + /* Allocate any local store the args will need; NULL out all others. + */ + int +-im_allocate_vargv( im_function *fn, im_object *vargv ) ++im_allocate_vargv(im_function *fn, im_object *vargv) + { + int i; + int vargc = fn->argc; + + /* NULL out all pointers. + */ +- for( i = 0; i < vargc; i++ ) ++ for (i = 0; i < vargc; i++) + vargv[i] = NULL; + + /* Allocate any space we will need. + */ +- for( i = 0; i < vargc; i++ ) { ++ for (i = 0; i < vargc; i++) { + int sz = fn->argv[i].desc->size; + +- if( sz != 0 ) +- if( !(vargv[i] = vips_malloc( NULL, sz )) ) { ++ if (sz != 0) ++ if (!(vargv[i] = vips_malloc(NULL, sz))) { + /* Free anything we did allocate. + */ +- (void) im_free_vargv( fn, vargv ); +- return( -1 ); ++ (void) im_free_vargv(fn, vargv); ++ return (-1); + } + + /* Zero memory. + */ +- memset( vargv[i], 0, sz ); ++ memset(vargv[i], 0, sz); + } + +- return( 0 ); ++ return (0); + } + + /* Destroy the objects in the arg list. + */ + static int +-destroy_args( im_function *fn, im_object *vargv ) ++destroy_args(im_function *fn, im_object *vargv) + { + int i; + int vargc = fn->argc; + + /* Destroy all elements with destroy functions. + */ +- for( i = 0; i < vargc; i++ ) +- if( vargv[i] ) ++ for (i = 0; i < vargc; i++) ++ if (vargv[i]) + /* If there's a destroy function for this type, + * trigger it. + */ +- if( fn->argv[i].desc->dest && +- fn->argv[i].desc->dest( vargv[i] ) ) +- return( -1 ); ++ if (fn->argv[i].desc->dest && ++ fn->argv[i].desc->dest(vargv[i])) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Init an im_object array from a set of command-line arguments. + */ + static int +-build_args( im_function *fn, im_object *vargv, int argc, char **argv ) ++build_args(im_function *fn, im_object *vargv, int argc, char **argv) + { + im_arg_desc *arg = fn->argv; + int vargc = fn->argc; +@@ -1012,135 +1013,135 @@ build_args( im_function *fn, im_object *vargv, int argc, char **argv ) + + /* Loop, constructing each im_arg. + */ +- for( i = 0, j = 0; i < vargc; i++ ) { ++ for (i = 0, j = 0; i < vargc; i++) { + /* Find type for this arg. + */ + im_type_desc *type = arg[i].desc; + + /* Do we need to use up a command line argument? + */ +- if( type->flags & IM_TYPE_ARG ) { +- if( !argv[j] ) { +- vips_error( "im_run_command", +- "%s", _( "too few arguments" ) ); +- return( -1 ); ++ if (type->flags & IM_TYPE_ARG) { ++ if (!argv[j]) { ++ vips_error("im_run_command", ++ "%s", _("too few arguments")); ++ return (-1); + } + str = argv[j++]; + + /* Init object. + */ +- if( type->init && type->init( &vargv[i], str ) ) +- return( -1 ); ++ if (type->init && type->init(&vargv[i], str)) ++ return (-1); + } + else { + /* Init object with no arg. + */ +- if( type->init && type->init( &vargv[i], "no arg" ) ) +- return( -1 ); ++ if (type->init && type->init(&vargv[i], "no arg")) ++ return (-1); + } + } + + /* Have we used up all the command-line args? + */ +- if( argv[j] ) { +- vips_error( "im_run_command", "%s", _( "too many arguments" ) ); +- return( -1 ); ++ if (argv[j]) { ++ vips_error("im_run_command", "%s", _("too many arguments")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Make a region on sub, closed by callback on main. + */ + static int +-region_local_image( IMAGE *main, IMAGE *sub ) ++region_local_image(IMAGE *main, IMAGE *sub) + { + VipsRegion *reg; + +- if( !(reg = vips_region_new( sub )) ) +- return( -1 ); +- vips_object_local( main, reg ); +- +- return( 0 ); ++ if (!(reg = vips_region_new(sub))) ++ return (-1); ++ vips_object_local(main, reg); ++ ++ return (0); + } + +-/* vargv[i] is an output image on a PIO function ... make all input images ++/* vargv[i] is an output image on a PIO function ... make all input images + * depend on it. + */ + static int +-note_dependencies( im_function *fn, im_object *vargv, int i ) ++note_dependencies(im_function *fn, im_object *vargv, int i) + { + int j; + +- for( j = 0; j < fn->argc; j++ ) { ++ for (j = 0; j < fn->argc; j++) { + im_type_desc *type = fn->argv[j].desc; + +- if( !(type->flags & IM_TYPE_OUTPUT) ) { +- if( strcmp( type->type, IM_TYPE_IMAGE ) == 0 ) { +- if( region_local_image( vargv[i], vargv[j] ) ) +- return( -1 ); ++ if (!(type->flags & IM_TYPE_OUTPUT)) { ++ if (strcmp(type->type, IM_TYPE_IMAGE) == 0) { ++ if (region_local_image(vargv[i], vargv[j])) ++ return (-1); + } +- else if( strcmp( type->type, IM_TYPE_IMAGEVEC ) == 0 ) { ++ else if (strcmp(type->type, IM_TYPE_IMAGEVEC) == 0) { + im_imagevec_object *iv = vargv[j]; + int k; + +- for( k = 0; k < iv->n; k++ ) +- if( region_local_image( vargv[i], +- iv->vec[k] ) ) +- return( -1 ); ++ for (k = 0; k < iv->n; k++) ++ if (region_local_image(vargv[i], ++ iv->vec[k])) ++ return (-1); + } + } + } + +- return( 0 ); ++ return (0); + } + + /* Call all defined print functions. + */ + static int +-print_args( im_function *fn, im_object *vargv ) ++print_args(im_function *fn, im_object *vargv) + { + int i; + int vargc = fn->argc; + + /* Print all elements. + */ +- for( i = 0; i < vargc; i++ ) +- if( fn->argv[i].print && vargv[i] ) +- if( fn->argv[i].print( vargv[i] ) ) +- return( -1 ); ++ for (i = 0; i < vargc; i++) ++ if (fn->argv[i].print && vargv[i]) ++ if (fn->argv[i].print(vargv[i])) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Add to the hist of all output images. + */ + static int +-add_hist( im_function *fn, im_object *vargv, int argc, char **argv ) ++add_hist(im_function *fn, im_object *vargv, int argc, char **argv) + { + int i; + int vargc = fn->argc; + + /* Search for output images. + */ +- for( i = 0; i < vargc; i++ ) +- if( strcmp( fn->argv[i].desc->type, IM_TYPE_IMAGE ) == 0 && +- (fn->argv[i].desc->flags & IM_TYPE_OUTPUT) ) +- if( im_updatehist( vargv[i], fn->name, argc, argv ) ) +- return( -1 ); ++ for (i = 0; i < vargc; i++) ++ if (strcmp(fn->argv[i].desc->type, IM_TYPE_IMAGE) == 0 && ++ (fn->argv[i].desc->flags & IM_TYPE_OUTPUT)) ++ if (im_updatehist(vargv[i], fn->name, argc, argv)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Call a VIPS function. + */ + static int +-dispatch_function( im_function *fn, im_object *vargv, int argc, char **argv ) ++dispatch_function(im_function *fn, im_object *vargv, int argc, char **argv) + { + /* Init memory from command line arguments. + */ +- if( build_args( fn, vargv, argc, argv ) ) +- return( -1 ); ++ if (build_args(fn, vargv, argc, argv)) ++ return (-1); + + /* If this is a PIO function, we need to make sure that we close + * the input images after the output images, since the output image +@@ -1153,43 +1154,43 @@ dispatch_function( im_function *fn, im_object *vargv, int argc, char **argv ) + * - create a region on the input, closed by a + * close callback on the output image + */ +- if( fn->flags & IM_FN_PIO ) { ++ if (fn->flags & IM_FN_PIO) { + int i; + +- for( i = 0; i < fn->argc; i++ ) { ++ for (i = 0; i < fn->argc; i++) { + im_type_desc *type = fn->argv[i].desc; + +- if( type->flags & IM_TYPE_OUTPUT && +- strcmp( type->type, IM_TYPE_IMAGE ) == 0 ) +- if( note_dependencies( fn, vargv, i ) ) +- return( -1 ); ++ if (type->flags & IM_TYPE_OUTPUT && ++ strcmp(type->type, IM_TYPE_IMAGE) == 0) ++ if (note_dependencies(fn, vargv, i)) ++ return (-1); + } + } + + /* Call function. + */ +- if( fn->disp( vargv ) ) +- return( -1 ); ++ if (fn->disp(vargv)) ++ return (-1); + + /* Print output. + */ +- if( print_args( fn, vargv ) ) +- return( -1 ); ++ if (print_args(fn, vargv)) ++ return (-1); + + /* Add to history of all output images. + */ +- if( add_hist( fn, vargv, argc, argv ) ) +- return( -1 ); ++ if (add_hist(fn, vargv, argc, argv)) ++ return (-1); + + /* All ok! + */ +- return( 0 ); ++ return (0); + } + + /* Run a command. + */ + int +-im_run_command( char *name, int argc, char **argv ) ++im_run_command(char *name, int argc, char **argv) + { + static im_object object_array[IM_MAX_ARGS]; + im_object *vargv = object_array; +@@ -1197,27 +1198,27 @@ im_run_command( char *name, int argc, char **argv ) + + /* Search packages for a matching function. + */ +- if( !(fn = im_find_function( name )) ) +- return( -1 ); ++ if (!(fn = im_find_function(name))) ++ return (-1); + + /* Allocate space for arguments. + */ +- if( im_allocate_vargv( fn, vargv ) ) +- return( -1 ); ++ if (im_allocate_vargv(fn, vargv)) ++ return (-1); + + /* Call it. +- */ +- if( dispatch_function( fn, vargv, argc, argv ) ) { +- destroy_args( fn, vargv ); +- im_free_vargv( fn, vargv ); +- return( -1 ); ++ */ ++ if (dispatch_function(fn, vargv, argc, argv)) { ++ destroy_args(fn, vargv); ++ im_free_vargv(fn, vargv); ++ return (-1); + } + + /* Clean up and exit. + */ +- if( destroy_args( fn, vargv ) ) +- return( -1 ); +- im_free_vargv( fn, vargv ); ++ if (destroy_args(fn, vargv)) ++ return (-1); ++ im_free_vargv(fn, vargv); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/deprecated/radiance.c b/libvips/deprecated/radiance.c +index a513d88696..ea6d38452c 100644 +--- a/libvips/deprecated/radiance.c ++++ b/libvips/deprecated/radiance.c +@@ -1,4 +1,4 @@ +-/* Read Radiance (.hdr) files ++/* Read Radiance (.hdr) files + * + * 20/12/11 + * - just a compat stub +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -40,31 +40,31 @@ + #include + + int +-im_rad2vips( const char *filename, IMAGE *out ) ++im_rad2vips(const char *filename, IMAGE *out) + { + VipsImage *t; + +- if( vips_radload( filename, &t, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_radload(filename, &t, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + static int +-israd( const char *filename ) ++israd(const char *filename) + { +- return( vips_foreign_is_a( "radload", filename ) ); ++ return (vips_foreign_is_a("radload", filename)); + } + + int +-im_vips2rad( IMAGE *in, const char *filename ) ++im_vips2rad(IMAGE *in, const char *filename) + { +- return( vips_radsave( in, filename, NULL ) ); ++ return (vips_radsave(in, filename, NULL)); + } + + static const char *rad_suffs[] = { ".hdr", NULL }; +@@ -73,13 +73,13 @@ typedef VipsFormat VipsFormatRad; + typedef VipsFormatClass VipsFormatRadClass; + + static void +-vips_format_rad_class_init( VipsFormatRadClass *class ) ++vips_format_rad_class_init(VipsFormatRadClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsFormatClass *format_class = (VipsFormatClass *) class; + + object_class->nickname = "rad"; +- object_class->description = _( "Radiance" ); ++ object_class->description = _("Radiance"); + + format_class->is_a = israd; + format_class->load = im_rad2vips; +@@ -88,9 +88,8 @@ vips_format_rad_class_init( VipsFormatRadClass *class ) + } + + static void +-vips_format_rad_init( VipsFormatRad *object ) ++vips_format_rad_init(VipsFormatRad *object) + { + } + +-G_DEFINE_TYPE( VipsFormatRad, vips_format_rad, VIPS_TYPE_FORMAT ); +- ++G_DEFINE_TYPE(VipsFormatRad, vips_format_rad, VIPS_TYPE_FORMAT); +diff --git a/libvips/deprecated/raw.c b/libvips/deprecated/raw.c +index 627f202b2c..b486346c98 100644 +--- a/libvips/deprecated/raw.c ++++ b/libvips/deprecated/raw.c +@@ -1,33 +1,33 @@ + /* Read raw image. Just a wrapper over im_binfile(). +- * ++ * + * 15/12/11 + * - just a compat stub now + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -44,26 +44,26 @@ + #include + + int +-im_raw2vips( const char *filename, IMAGE *out, +- int width, int height, int bpp, int offset ) ++im_raw2vips(const char *filename, IMAGE *out, ++ int width, int height, int bpp, int offset) + { + VipsImage *t; + +- if( vips_rawload( filename, &t, width, height, bpp, +- "offset", offset, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_rawload(filename, &t, width, height, bpp, ++ "offset", offset, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + int +-im_vips2raw( IMAGE *in, int fd ) ++im_vips2raw(IMAGE *in, int fd) + { +- return( vips_rawsave_fd( in, fd, NULL ) ); ++ return (vips_rawsave_fd(in, fd, NULL)); + } +diff --git a/libvips/deprecated/rename.c b/libvips/deprecated/rename.c +index b312386e21..c7da367421 100644 +--- a/libvips/deprecated/rename.c ++++ b/libvips/deprecated/rename.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -41,383 +41,381 @@ + #include + #include + +-int +-im_remainderconst_vec( IMAGE *in, IMAGE *out, int n, double *c ) ++int ++im_remainderconst_vec(IMAGE *in, IMAGE *out, int n, double *c) + { +- return( im_remainder_vec( in, out, n, c ) ); ++ return (im_remainder_vec(in, out, n, c)); + } + +-int +-im_and_vec( IMAGE *in, IMAGE *out, int n, double *c ) ++int ++im_and_vec(IMAGE *in, IMAGE *out, int n, double *c) + { +- return( im_andimage_vec( in, out, n, c ) ); ++ return (im_andimage_vec(in, out, n, c)); + } + +-int +-im_or_vec( IMAGE *in, IMAGE *out, int n, double *c ) ++int ++im_or_vec(IMAGE *in, IMAGE *out, int n, double *c) + { +- return( im_orimage_vec( in, out, n, c ) ); ++ return (im_orimage_vec(in, out, n, c)); + } + +-int +-im_eor_vec( IMAGE *in, IMAGE *out, int n, double *c ) ++int ++im_eor_vec(IMAGE *in, IMAGE *out, int n, double *c) + { +- return( im_eorimage_vec( in, out, n, c ) ); ++ return (im_eorimage_vec(in, out, n, c)); + } + +-int +-im_andconst( IMAGE *in, IMAGE *out, double c ) ++int ++im_andconst(IMAGE *in, IMAGE *out, double c) + { +- return( im_andimageconst( in, out, c ) ); ++ return (im_andimageconst(in, out, c)); + } + +-int +-im_orconst( IMAGE *in, IMAGE *out, double c ) ++int ++im_orconst(IMAGE *in, IMAGE *out, double c) + { +- return( im_orimageconst( in, out, c ) ); ++ return (im_orimageconst(in, out, c)); + } + +-int +-im_eorconst( IMAGE *in, IMAGE *out, double c ) ++int ++im_eorconst(IMAGE *in, IMAGE *out, double c) + { +- return( im_eorimageconst( in, out, c ) ); ++ return (im_eorimageconst(in, out, c)); + } + +-void +-im_errormsg( const char *fmt, ... ) +-{ ++void ++im_errormsg(const char *fmt, ...) ++{ + va_list ap; + +- va_start( ap, fmt ); +- im_verror( "untranslated", fmt, ap ); +- va_end( ap ); ++ va_start(ap, fmt); ++ im_verror("untranslated", fmt, ap); ++ va_end(ap); + } + +-void +-im_verrormsg( const char *fmt, va_list ap ) +-{ +- im_verror( "untranslated", fmt, ap ); ++void ++im_verrormsg(const char *fmt, va_list ap) ++{ ++ im_verror("untranslated", fmt, ap); + } + + void +-im_errormsg_system( int err, const char *fmt, ... ) ++im_errormsg_system(int err, const char *fmt, ...) + { + va_list ap; + +- va_start( ap, fmt ); +- im_verror_system( err, "untranslated", fmt, ap ); +- va_end( ap ); ++ va_start(ap, fmt); ++ im_verror_system(err, "untranslated", fmt, ap); ++ va_end(ap); + } + +-void +-im_diagnostics( const char *fmt, ... ) +-{ ++void ++im_diagnostics(const char *fmt, ...) ++{ + va_list ap; + +- va_start( ap, fmt ); +- im_vdiag( "untranslated", fmt, ap ); +- va_end( ap ); ++ va_start(ap, fmt); ++ im_vdiag("untranslated", fmt, ap); ++ va_end(ap); + } + +-void +-im_warning( const char *fmt, ... ) ++void ++im_warning(const char *fmt, ...) + { + va_list ap; + +- va_start( ap, fmt ); +- im_vwarn( "untranslated", fmt, ap ); +- va_end( ap ); ++ va_start(ap, fmt); ++ im_vwarn("untranslated", fmt, ap); ++ va_end(ap); + } + +-int +-im_affine( IMAGE *in, IMAGE *out, +- double a, double b, double c, double d, double dx, double dy, +- int ox, int oy, int ow, int oh ) ++int ++im_affine(IMAGE *in, IMAGE *out, ++ double a, double b, double c, double d, double dx, double dy, ++ int ox, int oy, int ow, int oh) + { +- return( im_affinei( in, out, +- vips_interpolate_bilinear_static(), +- a, b, c, d, dx, dy, +- ox, oy, ow, oh ) ); ++ return (im_affinei(in, out, ++ vips_interpolate_bilinear_static(), ++ a, b, c, d, dx, dy, ++ ox, oy, ow, oh)); + } + +-int +-im_similarity_area( IMAGE *in, IMAGE *out, +- double a, double b, double dx, double dy, +- int ox, int oy, int ow, int oh ) ++int ++im_similarity_area(IMAGE *in, IMAGE *out, ++ double a, double b, double dx, double dy, ++ int ox, int oy, int ow, int oh) + { +- return( im_affinei( in, out, +- vips_interpolate_bilinear_static(), +- a, -b, b, a, dx, dy, +- ox, oy, ow, oh ) ); ++ return (im_affinei(in, out, ++ vips_interpolate_bilinear_static(), ++ a, -b, b, a, dx, dy, ++ ox, oy, ow, oh)); + } + +-int +-im_similarity( IMAGE *in, IMAGE *out, +- double a, double b, double dx, double dy ) ++int ++im_similarity(IMAGE *in, IMAGE *out, ++ double a, double b, double dx, double dy) + { +- return( im_affinei_all( in, out, +- vips_interpolate_bilinear_static(), +- a, -b, b, a, dx, dy ) ); ++ return (im_affinei_all(in, out, ++ vips_interpolate_bilinear_static(), ++ a, -b, b, a, dx, dy)); + } + + DOUBLEMASK * +-im_measure( IMAGE *im, IMAGE_BOX *box, int h, int v, +- int *sel, int nsel, const char *name ) ++im_measure(IMAGE *im, IMAGE_BOX *box, int h, int v, ++ int *sel, int nsel, const char *name) + { +- return( im_measure_area( im, ++ return (im_measure_area(im, + box->xstart, + box->ystart, + box->xsize, + box->ysize, +- h, v, sel, nsel, name ) ); ++ h, v, sel, nsel, name)); + } + + int +-im_extract( IMAGE *in, IMAGE *out, IMAGE_BOX *box ) +-{ +- if( box->chsel == -1 ) +- return( im_extract_areabands( in, out, ++im_extract(IMAGE *in, IMAGE *out, IMAGE_BOX *box) ++{ ++ if (box->chsel == -1) ++ return (im_extract_areabands(in, out, + box->xstart, box->ystart, box->xsize, box->ysize, +- 0, in->Bands ) ); ++ 0, in->Bands)); + else +- return( im_extract_areabands( in, out, ++ return (im_extract_areabands(in, out, + box->xstart, box->ystart, box->xsize, box->ysize, +- box->chsel, 1 ) ); ++ box->chsel, 1)); + } + + /* The public proto has this in the argument. + */ +-typedef void (*notify_fn)( IMAGE *, Rect *, void * ); ++typedef void (*notify_fn)(IMAGE *, Rect *, void *); + + int +-im_render_fade( IMAGE *in, IMAGE *out, IMAGE *mask, +- int width, int height, int max, ++im_render_fade(IMAGE *in, IMAGE *out, IMAGE *mask, ++ int width, int height, int max, + int fps, int steps, + int priority, +- notify_fn notify, void *client ) ++ notify_fn notify, void *client) + { +- return( im_render_priority( in, out, mask, +- width, height, max, ++ return (im_render_priority(in, out, mask, ++ width, height, max, + priority, +- notify, client ) ); ++ notify, client)); + } + + int +-im_render( IMAGE *in, IMAGE *out, IMAGE *mask, +- int width, int height, int max, +- notify_fn notify, void *client ) ++im_render(IMAGE *in, IMAGE *out, IMAGE *mask, ++ int width, int height, int max, ++ notify_fn notify, void *client) + { +- return( im_render_priority( in, out, mask, +- width, height, max, +- 0, +- notify, client ) ); ++ return (im_render_priority(in, out, mask, ++ width, height, max, ++ 0, ++ notify, client)); + } + + int +-im_makerw( IMAGE *im ) ++im_makerw(IMAGE *im) + { +- return( im_rwcheck( im ) ); ++ return (im_rwcheck(im)); + } + + int +-im_icc_export( IMAGE *in, IMAGE *out, +- const char *output_profile_filename, int intent ) +-{ +- return( im_icc_export_depth( in, out, +- 8, output_profile_filename, (VipsIntent) intent ) ); ++im_icc_export(IMAGE *in, IMAGE *out, ++ const char *output_profile_filename, int intent) ++{ ++ return (im_icc_export_depth(in, out, ++ 8, output_profile_filename, (VipsIntent) intent)); + } + +-int +-im_segment( IMAGE *test, IMAGE *mask, int *segments ) ++int ++im_segment(IMAGE *test, IMAGE *mask, int *segments) + { +- return( im_label_regions( test, mask, segments ) ); ++ return (im_label_regions(test, mask, segments)); + } + +-int +-im_convf( IMAGE *in, IMAGE *out, DOUBLEMASK *mask ) ++int ++im_convf(IMAGE *in, IMAGE *out, DOUBLEMASK *mask) + { +- return( im_conv_f( in, out, mask ) ); ++ return (im_conv_f(in, out, mask)); + } + + int +-im_convf_raw( IMAGE *in, IMAGE *out, DOUBLEMASK *mask ) ++im_convf_raw(IMAGE *in, IMAGE *out, DOUBLEMASK *mask) + { +- return( im_conv_f_raw( in, out, mask ) ); ++ return (im_conv_f_raw(in, out, mask)); + } + +-int +-im_convsepf( IMAGE *in, IMAGE *out, DOUBLEMASK *mask ) ++int ++im_convsepf(IMAGE *in, IMAGE *out, DOUBLEMASK *mask) + { +- return( im_convsep_f( in, out, mask ) ); ++ return (im_convsep_f(in, out, mask)); + } + + int +-im_convsepf_raw( IMAGE *in, IMAGE *out, DOUBLEMASK *mask ) ++im_convsepf_raw(IMAGE *in, IMAGE *out, DOUBLEMASK *mask) + { +- return( im_convsep_f_raw( in, out, mask ) ); ++ return (im_convsep_f_raw(in, out, mask)); + } + + gboolean +-im_isint( IMAGE *im ) ++im_isint(IMAGE *im) + { +- return( vips_bandfmt_isint( im->BandFmt ) ); ++ return (vips_bandfmt_isint(im->BandFmt)); + } + + gboolean +-im_isuint( IMAGE *im ) +-{ +- return( vips_bandfmt_isuint( im->BandFmt ) ); ++im_isuint(IMAGE *im) ++{ ++ return (vips_bandfmt_isuint(im->BandFmt)); + } + + gboolean +-im_isfloat( IMAGE *im ) ++im_isfloat(IMAGE *im) + { +- return( vips_bandfmt_isfloat( im->BandFmt ) ); ++ return (vips_bandfmt_isfloat(im->BandFmt)); + } + + gboolean +-im_iscomplex( IMAGE *im ) +-{ +- return( vips_band_format_iscomplex( im->BandFmt ) ); ++im_iscomplex(IMAGE *im) ++{ ++ return (vips_band_format_iscomplex(im->BandFmt)); + } + + gboolean +-im_isscalar( IMAGE *im ) ++im_isscalar(IMAGE *im) + { +- return( !im_iscomplex( im ) ); ++ return (!im_iscomplex(im)); + } + +-int +-im_c2ps( IMAGE *in, IMAGE *out ) ++int ++im_c2ps(IMAGE *in, IMAGE *out) + { +- return( im_abs( in, out ) ); ++ return (im_abs(in, out)); + } + + int +-im_clip( IMAGE *in, IMAGE *out ) ++im_clip(IMAGE *in, IMAGE *out) + { +- return( im_clip2fmt( in, out, IM_BANDFMT_UCHAR ) ); ++ return (im_clip2fmt(in, out, IM_BANDFMT_UCHAR)); + } + + int +-im_clip2c( IMAGE *in, IMAGE *out ) ++im_clip2c(IMAGE *in, IMAGE *out) + { +- return( im_clip2fmt( in, out, IM_BANDFMT_CHAR ) ); ++ return (im_clip2fmt(in, out, IM_BANDFMT_CHAR)); + } + + int +-im_clip2us( IMAGE *in, IMAGE *out ) ++im_clip2us(IMAGE *in, IMAGE *out) + { +- return( im_clip2fmt( in, out, IM_BANDFMT_USHORT ) ); ++ return (im_clip2fmt(in, out, IM_BANDFMT_USHORT)); + } + + int +-im_clip2s( IMAGE *in, IMAGE *out ) ++im_clip2s(IMAGE *in, IMAGE *out) + { +- return( im_clip2fmt( in, out, IM_BANDFMT_SHORT ) ); ++ return (im_clip2fmt(in, out, IM_BANDFMT_SHORT)); + } + + int +-im_clip2ui( IMAGE *in, IMAGE *out ) ++im_clip2ui(IMAGE *in, IMAGE *out) + { +- return( im_clip2fmt( in, out, IM_BANDFMT_UINT ) ); ++ return (im_clip2fmt(in, out, IM_BANDFMT_UINT)); + } + + int +-im_clip2i( IMAGE *in, IMAGE *out ) ++im_clip2i(IMAGE *in, IMAGE *out) + { +- return( im_clip2fmt( in, out, IM_BANDFMT_INT ) ); ++ return (im_clip2fmt(in, out, IM_BANDFMT_INT)); + } + + int +-im_clip2f( IMAGE *in, IMAGE *out ) ++im_clip2f(IMAGE *in, IMAGE *out) + { +- return( im_clip2fmt( in, out, IM_BANDFMT_FLOAT ) ); ++ return (im_clip2fmt(in, out, IM_BANDFMT_FLOAT)); + } + + int +-im_clip2d( IMAGE *in, IMAGE *out ) ++im_clip2d(IMAGE *in, IMAGE *out) + { +- return( im_clip2fmt( in, out, IM_BANDFMT_DOUBLE ) ); ++ return (im_clip2fmt(in, out, IM_BANDFMT_DOUBLE)); + } + + int +-im_clip2cm( IMAGE *in, IMAGE *out ) ++im_clip2cm(IMAGE *in, IMAGE *out) + { +- return( im_clip2fmt( in, out, IM_BANDFMT_COMPLEX ) ); ++ return (im_clip2fmt(in, out, IM_BANDFMT_COMPLEX)); + } + + int +-im_clip2dcm( IMAGE *in, IMAGE *out ) ++im_clip2dcm(IMAGE *in, IMAGE *out) + { +- return( im_clip2fmt( in, out, IM_BANDFMT_DPCOMPLEX ) ); ++ return (im_clip2fmt(in, out, IM_BANDFMT_DPCOMPLEX)); + } + + int +-im_copy_from( IMAGE *in, IMAGE *out, im_arch_type architecture ) ++im_copy_from(IMAGE *in, IMAGE *out, im_arch_type architecture) + { +- switch( architecture ) { ++ switch (architecture) { + case IM_ARCH_NATIVE: +- return( im_copy( in, out ) ); ++ return (im_copy(in, out)); + + case IM_ARCH_BYTE_SWAPPED: +- return( im_copy_swap( in, out ) ); ++ return (im_copy_swap(in, out)); + + case IM_ARCH_LSB_FIRST: +- return( im_amiMSBfirst() ? +- im_copy_swap( in, out ) : im_copy( in, out ) ); ++ return (im_amiMSBfirst() ? im_copy_swap(in, out) : im_copy(in, out)); + + case IM_ARCH_MSB_FIRST: +- return( im_amiMSBfirst() ? +- im_copy( in, out ) : im_copy_swap( in, out ) ); ++ return (im_amiMSBfirst() ? im_copy(in, out) : im_copy_swap(in, out)); + + default: +- im_error( "im_copy_from", +- _( "bad architecture: %d" ), architecture ); +- return( -1 ); ++ im_error("im_copy_from", ++ _("bad architecture: %d"), architecture); ++ return (-1); + } + } + + /* Check whether arch corresponds to native byte order. + */ + gboolean +-im_isnative( im_arch_type arch ) +-{ +- switch( arch ) { +- case IM_ARCH_NATIVE: +- return( TRUE ); +- case IM_ARCH_BYTE_SWAPPED: +- return( FALSE ); +- case IM_ARCH_LSB_FIRST: +- return( !im_amiMSBfirst() ); +- case IM_ARCH_MSB_FIRST: +- return( im_amiMSBfirst() ); ++im_isnative(im_arch_type arch) ++{ ++ switch (arch) { ++ case IM_ARCH_NATIVE: ++ return (TRUE); ++ case IM_ARCH_BYTE_SWAPPED: ++ return (FALSE); ++ case IM_ARCH_LSB_FIRST: ++ return (!im_amiMSBfirst()); ++ case IM_ARCH_MSB_FIRST: ++ return (im_amiMSBfirst()); + + default: +- g_assert( 0 ); +- } ++ g_assert(0); ++ } + + /* Keep -Wall happy. + */ +- return( -1 ); ++ return (-1); + } + + int +-im_iterate( IMAGE *im, ++im_iterate(IMAGE *im, + im_start_fn start, im_generate_fn generate, im_stop_fn stop, +- void *b, void *c ) ++ void *b, void *c) + { +- return( vips_sink( im, start, (VipsGenerateFn) generate, stop, b, c ) ); ++ return (vips_sink(im, start, (VipsGenerateFn) generate, stop, b, c)); + } + + int +-im_render_priority( IMAGE *in, IMAGE *out, IMAGE *mask, +- int width, int height, int max, ++im_render_priority(IMAGE *in, IMAGE *out, IMAGE *mask, ++ int width, int height, int max, + int priority, +- notify_fn notify, void *client ) ++ notify_fn notify, void *client) + { +- return( vips_sink_screen( in, out, mask, +- width, height, max, priority, notify, client ) ); ++ return (vips_sink_screen(in, out, mask, ++ width, height, max, priority, notify, client)); + } + + /** +@@ -428,7 +426,7 @@ im_render_priority( IMAGE *in, IMAGE *out, IMAGE *mask, + * @radius: circle radius + * @intensity: value to draw + * +- * Draws a circle on a 1-band 8-bit image. ++ * Draws a circle on a 1-band 8-bit image. + * + * This an inplace operation, so @im is changed. It does not thread and will + * not work well as part of a pipeline. On 32-bit machines it will be limited +@@ -438,20 +436,20 @@ im_render_priority( IMAGE *in, IMAGE *out, IMAGE *mask, + * + * Returns: 0 on success, or -1 on error. + */ +-int +-im_circle( IMAGE *im, int cx, int cy, int radius, int intensity ) ++int ++im_circle(IMAGE *im, int cx, int cy, int radius, int intensity) + { + PEL ink[1]; + +- if( im_rwcheck( im ) || +- im_check_uncoded( "im_circle", im ) || +- im_check_mono( "im_circle", im ) || +- im_check_format( "im_circle", im, IM_BANDFMT_UCHAR ) ) +- return( -1 ); ++ if (im_rwcheck(im) || ++ im_check_uncoded("im_circle", im) || ++ im_check_mono("im_circle", im) || ++ im_check_format("im_circle", im, IM_BANDFMT_UCHAR)) ++ return (-1); + + ink[0] = intensity; + +- return( im_draw_circle( im, cx, cy, radius, FALSE, ink ) ); ++ return (im_draw_circle(im, cx, cy, radius, FALSE, ink)); + } + + /* A flood blob we can call from nip. Grr! Should be a way to wrap these +@@ -459,118 +457,118 @@ im_circle( IMAGE *im, int cx, int cy, int radius, int intensity ) + */ + + int +-im_flood_copy( IMAGE *in, IMAGE *out, int x, int y, PEL *ink ) ++im_flood_copy(IMAGE *in, IMAGE *out, int x, int y, PEL *ink) + { + IMAGE *t; + +- if( !(t = im_open_local( out, "im_flood_blob_copy", "t" )) || +- im_copy( in, t ) || +- im_flood( t, x, y, ink, NULL ) || +- im_copy( t, out ) ) +- return( -1 ); ++ if (!(t = im_open_local(out, "im_flood_blob_copy", "t")) || ++ im_copy(in, t) || ++ im_flood(t, x, y, ink, NULL) || ++ im_copy(t, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-im_flood_blob_copy( IMAGE *in, IMAGE *out, int x, int y, PEL *ink ) ++im_flood_blob_copy(IMAGE *in, IMAGE *out, int x, int y, PEL *ink) + { + IMAGE *t; + +- if( !(t = im_open_local( out, "im_flood_blob_copy", "t" )) || +- im_copy( in, t ) || +- im_flood_blob( t, x, y, ink, NULL ) || +- im_copy( t, out ) ) +- return( -1 ); ++ if (!(t = im_open_local(out, "im_flood_blob_copy", "t")) || ++ im_copy(in, t) || ++ im_flood_blob(t, x, y, ink, NULL) || ++ im_copy(t, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-im_flood_other_copy( IMAGE *test, IMAGE *mark, IMAGE *out, +- int x, int y, int serial ) ++im_flood_other_copy(IMAGE *test, IMAGE *mark, IMAGE *out, ++ int x, int y, int serial) + { + IMAGE *t; + +- if( !(t = im_open_local( out, "im_flood_other_copy", "t" )) || +- im_copy( mark, t ) || +- im_flood_other( test, t, x, y, serial, NULL ) || +- im_copy( t, out ) ) +- return( -1 ); ++ if (!(t = im_open_local(out, "im_flood_other_copy", "t")) || ++ im_copy(mark, t) || ++ im_flood_other(test, t, x, y, serial, NULL) || ++ im_copy(t, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-im_paintrect( IMAGE *im, Rect *r, PEL *ink ) ++im_paintrect(IMAGE *im, Rect *r, PEL *ink) + { +- return( im_draw_rect( im, +- r->left, r->top, r->width, r->height, 1, ink ) ); ++ return (im_draw_rect(im, ++ r->left, r->top, r->width, r->height, 1, ink)); + } + + int +-im_insertplace( IMAGE *main, IMAGE *sub, int x, int y ) ++im_insertplace(IMAGE *main, IMAGE *sub, int x, int y) + { +- return( im_draw_image( main, sub, x, y ) ); ++ return (im_draw_image(main, sub, x, y)); + } + +-int +-im_fastline( IMAGE *im, int x1, int y1, int x2, int y2, PEL *pel ) ++int ++im_fastline(IMAGE *im, int x1, int y1, int x2, int y2, PEL *pel) + { +- return( im_draw_line( im, x1, y1, x2, y2, pel ) ); ++ return (im_draw_line(im, x1, y1, x2, y2, pel)); + } + +-int +-im_fastlineuser( IMAGE *im, +- int x1, int y1, int x2, int y2, +- VipsPlotFn fn, void *client1, void *client2, void *client3 ) ++int ++im_fastlineuser(IMAGE *im, ++ int x1, int y1, int x2, int y2, ++ VipsPlotFn fn, void *client1, void *client2, void *client3) + { +- return( im_draw_line_user( im, x1, y1, x2, y2, +- fn, client1, client2, client3 ) ); ++ return (im_draw_line_user(im, x1, y1, x2, y2, ++ fn, client1, client2, client3)); + } + + int +-im_plotmask( IMAGE *im, int ix, int iy, PEL *ink, PEL *mask, Rect *r ) ++im_plotmask(IMAGE *im, int ix, int iy, PEL *ink, PEL *mask, Rect *r) + { + IMAGE *mask_im; + +- if( !(mask_im = im_image( mask, +- r->width, r->height, 1, IM_BANDFMT_UCHAR )) ) +- return( -1 ); +- if( im_draw_mask( im, mask_im, ix + r->left, iy + r->top, ink ) ) { +- im_close( mask_im ); +- return( -1 ); ++ if (!(mask_im = im_image(mask, ++ r->width, r->height, 1, IM_BANDFMT_UCHAR))) ++ return (-1); ++ if (im_draw_mask(im, mask_im, ix + r->left, iy + r->top, ink)) { ++ im_close(mask_im); ++ return (-1); + } +- im_close( mask_im ); ++ im_close(mask_im); + +- return( 0 ); ++ return (0); + } + +-int +-im_readpoint( IMAGE *im, int x, int y, PEL *pel ) ++int ++im_readpoint(IMAGE *im, int x, int y, PEL *pel) + { +- return( im_read_point( im, x, y, pel ) ); ++ return (im_read_point(im, x, y, pel)); + } + +-int +-im_plotpoint( IMAGE *im, int x, int y, PEL *pel ) ++int ++im_plotpoint(IMAGE *im, int x, int y, PEL *pel) + { +- return( im_draw_point( im, x, y, pel ) ); ++ return (im_draw_point(im, x, y, pel)); + } + + /* Smear a section of an IMAGE. As above, but shift it left a bit. + */ + int +-im_smear( IMAGE *im, int ix, int iy, Rect *r ) +-{ ++im_smear(IMAGE *im, int ix, int iy, Rect *r) ++{ + int x, y, a, b, c; + int ba = im->Bands; + int el = ba * im->Xsize; + Rect area, image, clipped; +- double total[ 256 ]; ++ double total[256]; + +- if( im_rwcheck( im ) ) +- return( -1 ); ++ if (im_rwcheck(im)) ++ return (-1); + + /* Don't do the margins. + */ +@@ -581,75 +579,74 @@ im_smear( IMAGE *im, int ix, int iy, Rect *r ) + image.top = 0; + image.width = im->Xsize; + image.height = im->Ysize; +- im_rect_marginadjust( &image, -1 ); ++ im_rect_marginadjust(&image, -1); + image.left--; +- im_rect_intersectrect( &area, &image, &clipped ); ++ im_rect_intersectrect(&area, &image, &clipped); + + /* Any left? + */ +- if( im_rect_isempty( &clipped ) ) +- return( 0 ); ++ if (im_rect_isempty(&clipped)) ++ return (0); + + /* What we do for each type. + */ + #define SMEAR(TYPE) \ +- for( y = clipped.top; y < clipped.top + clipped.height; y++ ) \ +- for( x = clipped.left; \ +- x < clipped.left + clipped.width; x++ ) { \ ++ for (y = clipped.top; y < clipped.top + clipped.height; y++) \ ++ for (x = clipped.left; \ ++ x < clipped.left + clipped.width; x++) { \ + TYPE *to = (TYPE *) im->data + x * ba + y * el; \ + TYPE *from = to - el; \ + TYPE *f; \ +- \ +- for( a = 0; a < ba; a++ ) \ ++\ ++ for (a = 0; a < ba; a++) \ + total[a] = 0.0; \ +- \ +- for( a = 0; a < 3; a++ ) { \ ++\ ++ for (a = 0; a < 3; a++) { \ + f = from; \ +- for( b = 0; b < 3; b++ ) \ +- for( c = 0; c < ba; c++ ) \ ++ for (b = 0; b < 3; b++) \ ++ for (c = 0; c < ba; c++) \ + total[c] += *f++; \ + from += el; \ + } \ +- \ +- for( a = 0; a < ba; a++ ) \ +- to[a] = (40 * (double) to[a+ba] + total[a]) \ +- / 49.0; \ ++\ ++ for (a = 0; a < ba; a++) \ ++ to[a] = (40 * (double) to[a + ba] + total[a]) / 49.0; \ + } + + /* Loop through the remaining pixels. + */ +- switch( im->BandFmt ) { +- case IM_BANDFMT_UCHAR: +- SMEAR(unsigned char); +- break; ++ switch (im->BandFmt) { ++ case IM_BANDFMT_UCHAR: ++ SMEAR(unsigned char); ++ break; + +- case IM_BANDFMT_CHAR: +- SMEAR(char); +- break; ++ case IM_BANDFMT_CHAR: ++ SMEAR(char); ++ break; + +- case IM_BANDFMT_USHORT: +- SMEAR(unsigned short); +- break; ++ case IM_BANDFMT_USHORT: ++ SMEAR(unsigned short); ++ break; + +- case IM_BANDFMT_SHORT: +- SMEAR(short); +- break; ++ case IM_BANDFMT_SHORT: ++ SMEAR(short); ++ break; + +- case IM_BANDFMT_UINT: +- SMEAR(unsigned int); +- break; ++ case IM_BANDFMT_UINT: ++ SMEAR(unsigned int); ++ break; + +- case IM_BANDFMT_INT: +- SMEAR(int); +- break; ++ case IM_BANDFMT_INT: ++ SMEAR(int); ++ break; + +- case IM_BANDFMT_FLOAT: +- SMEAR(float); +- break; ++ case IM_BANDFMT_FLOAT: ++ SMEAR(float); ++ break; + +- case IM_BANDFMT_DOUBLE: +- SMEAR(double); +- break; ++ case IM_BANDFMT_DOUBLE: ++ SMEAR(double); ++ break; + + /* Do complex types too. Just treat as float and double, but with + * twice the number of bands. +@@ -675,55 +672,55 @@ im_smear( IMAGE *im, int ix, int iy, Rect *r ) + break; + + default: +- im_error( "im_smear", "%s", _( "unknown band format" ) ); +- return( -1 ); ++ im_error("im_smear", "%s", _("unknown band format")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + int +-im_smudge( VipsImage *image, int ix, int iy, Rect *r ) ++im_smudge(VipsImage *image, int ix, int iy, Rect *r) + { +- return( im_draw_smudge( image, +- r->left + ix, r->top + iy, r->width, r->height ) ); ++ return (im_draw_smudge(image, ++ r->left + ix, r->top + iy, r->width, r->height)); + } + +-int +-im_flood( IMAGE *im, int x, int y, PEL *ink, Rect *dout ) ++int ++im_flood(IMAGE *im, int x, int y, PEL *ink, Rect *dout) + { +- return( im_draw_flood( im, x, y, ink, dout ) ); ++ return (im_draw_flood(im, x, y, ink, dout)); + } + +-int +-im_flood_blob( IMAGE *im, int x, int y, PEL *ink, Rect *dout ) ++int ++im_flood_blob(IMAGE *im, int x, int y, PEL *ink, Rect *dout) + { +- return( im_draw_flood_blob( im, x, y, ink, dout ) ); ++ return (im_draw_flood_blob(im, x, y, ink, dout)); + } + +-int +-im_flood_other( IMAGE *test, IMAGE *mark, +- int x, int y, int serial, Rect *dout ) ++int ++im_flood_other(IMAGE *test, IMAGE *mark, ++ int x, int y, int serial, Rect *dout) + { +- return( im_draw_flood_other( mark, test, x, y, serial, dout ) ); ++ return (im_draw_flood_other(mark, test, x, y, serial, dout)); + } + + int +-vips_check_coding_rad( const char *domain, VipsImage *im ) ++vips_check_coding_rad(const char *domain, VipsImage *im) + { +- return( vips_check_coding( domain, im, VIPS_CODING_RAD ) ); ++ return (vips_check_coding(domain, im, VIPS_CODING_RAD)); + } + + int +-vips_check_coding_labq( const char *domain, VipsImage *im ) ++vips_check_coding_labq(const char *domain, VipsImage *im) + { +- return( vips_check_coding( domain, im, VIPS_CODING_LABQ ) ); ++ return (vips_check_coding(domain, im, VIPS_CODING_LABQ)); + } + + int +-vips_check_bands_3ormore( const char *domain, VipsImage *im ) ++vips_check_bands_3ormore(const char *domain, VipsImage *im) + { +- return( vips_check_bands_atleast( domain, im, 3 ) ); ++ return (vips_check_bands_atleast(domain, im, 3)); + } + + /* The old vips_info() stuff, now replaced by g_warning() / g_info(). +@@ -732,73 +729,73 @@ vips_check_bands_3ormore( const char *domain, VipsImage *im ) + int vips__info = 0; + + void +-vips_info_set( gboolean info ) ++vips_info_set(gboolean info) + { + vips__info = info; + +- if( info ) { ++ if (info) { + const char *old; + char *new; + +- old = g_getenv( "G_MESSAGES_DEBUG" ); +- if( !old ) ++ old = g_getenv("G_MESSAGES_DEBUG"); ++ if (!old) + old = ""; +- new = g_strdup_printf( "%s VIPS", old ); +- g_setenv( "G_MESSAGES_DEBUG", new, TRUE ); +- g_free( new ); ++ new = g_strdup_printf("%s VIPS", old); ++ g_setenv("G_MESSAGES_DEBUG", new, TRUE); ++ g_free(new); + } + } + +-void +-vips_vinfo( const char *domain, const char *fmt, va_list ap ) +-{ +- if( vips__info ) { +- g_mutex_lock( vips__global_lock ); +- (void) fprintf( stderr, _( "%s: " ), _( "info" ) ); +- if( domain ) +- (void) fprintf( stderr, _( "%s: " ), domain ); +- (void) vfprintf( stderr, fmt, ap ); +- (void) fprintf( stderr, "\n" ); +- g_mutex_unlock( vips__global_lock ); ++void ++vips_vinfo(const char *domain, const char *fmt, va_list ap) ++{ ++ if (vips__info) { ++ g_mutex_lock(vips__global_lock); ++ (void) fprintf(stderr, _("%s: "), _("info")); ++ if (domain) ++ (void) fprintf(stderr, _("%s: "), domain); ++ (void) vfprintf(stderr, fmt, ap); ++ (void) fprintf(stderr, "\n"); ++ g_mutex_unlock(vips__global_lock); + } + } + +-void +-vips_info( const char *domain, const char *fmt, ... ) ++void ++vips_info(const char *domain, const char *fmt, ...) + { + va_list ap; + +- va_start( ap, fmt ); +- vips_vinfo( domain, fmt, ap ); +- va_end( ap ); +-} +- +-void +-vips_vwarn( const char *domain, const char *fmt, va_list ap ) +-{ +- if( !g_getenv( "IM_WARNING" ) && +- !g_getenv( "VIPS_WARNING" ) ) { +- g_mutex_lock( vips__global_lock ); +- (void) fprintf( stderr, _( "%s: " ), _( "vips warning" ) ); +- if( domain ) +- (void) fprintf( stderr, _( "%s: " ), domain ); +- (void) vfprintf( stderr, fmt, ap ); +- (void) fprintf( stderr, "\n" ); +- g_mutex_unlock( vips__global_lock ); ++ va_start(ap, fmt); ++ vips_vinfo(domain, fmt, ap); ++ va_end(ap); ++} ++ ++void ++vips_vwarn(const char *domain, const char *fmt, va_list ap) ++{ ++ if (!g_getenv("IM_WARNING") && ++ !g_getenv("VIPS_WARNING")) { ++ g_mutex_lock(vips__global_lock); ++ (void) fprintf(stderr, _("%s: "), _("vips warning")); ++ if (domain) ++ (void) fprintf(stderr, _("%s: "), domain); ++ (void) vfprintf(stderr, fmt, ap); ++ (void) fprintf(stderr, "\n"); ++ g_mutex_unlock(vips__global_lock); + } + +- if( vips__fatal ) +- vips_error_exit( "vips__fatal" ); ++ if (vips__fatal) ++ vips_error_exit("vips__fatal"); + } + +-void +-vips_warn( const char *domain, const char *fmt, ... ) +-{ ++void ++vips_warn(const char *domain, const char *fmt, ...) ++{ + va_list ap; + +- va_start( ap, fmt ); +- vips_vwarn( domain, fmt, ap ); +- va_end( ap ); ++ va_start(ap, fmt); ++ vips_vwarn(domain, fmt, ap); ++ va_end(ap); + } + + /** +@@ -808,18 +805,17 @@ vips_warn( const char *domain, const char *fmt, ... ) + * This function is deprecated. Use vips_autorot() instead. + */ + VipsAngle +-vips_autorot_get_angle( VipsImage *im ) ++vips_autorot_get_angle(VipsImage *im) + { +- return( VIPS_ANGLE_D0 ); ++ return (VIPS_ANGLE_D0); + } + + /* The old vips_free(), now replaced by g_free() and vips_area_free_cb(). + */ + int +-vips_free( void *buf ) ++vips_free(void *buf) + { +- g_free( buf ); ++ g_free(buf); + +- return( 0 ); ++ return (0); + } +- +diff --git a/libvips/deprecated/resample_dispatch.c b/libvips/deprecated/resample_dispatch.c +index 4329ff4ceb..511235d489 100644 +--- a/libvips/deprecated/resample_dispatch.c ++++ b/libvips/deprecated/resample_dispatch.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -45,62 +45,62 @@ + /* Args to im_rightshift_size. + */ + static im_arg_desc rightshift_size_args[] = { +- IM_INPUT_IMAGE ("in"), +- IM_OUTPUT_IMAGE ("out"), +- IM_INPUT_INT ("xshift"), +- IM_INPUT_INT ("yshift"), +- IM_INPUT_INT ("band_fmt") ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("xshift"), ++ IM_INPUT_INT("yshift"), ++ IM_INPUT_INT("band_fmt") + }; + + /* Call im_rightshift_size via arg vector. + */ + static int +-rightshift_size_vec (im_object * argv) ++rightshift_size_vec(im_object *argv) + { +- IMAGE *in = (IMAGE *) argv[0]; +- IMAGE *out = (IMAGE *) argv[1]; +- int *xshift = (int *) argv[2]; +- int *yshift = (int *) argv[3]; +- int *band_fmt = (int *) argv[4]; ++ IMAGE *in = (IMAGE *) argv[0]; ++ IMAGE *out = (IMAGE *) argv[1]; ++ int *xshift = (int *) argv[2]; ++ int *yshift = (int *) argv[3]; ++ int *band_fmt = (int *) argv[4]; + +- return im_rightshift_size (in, out, *xshift, *yshift, *band_fmt ); ++ return im_rightshift_size(in, out, *xshift, *yshift, *band_fmt); + } + + /* Description of im_rightshift_size. + */ + static im_function rightshift_size_desc = { +- "im_rightshift_size", /* Name */ +- "decrease size by a power-of-two factor", +- IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ +- rightshift_size_vec, /* Dispatch function */ +- IM_NUMBER (rightshift_size_args), /* Size of arg list */ +- rightshift_size_args /* Arg list */ ++ "im_rightshift_size", /* Name */ ++ "decrease size by a power-of-two factor", ++ IM_FN_PIO | IM_FN_TRANSFORM, /* Flags */ ++ rightshift_size_vec, /* Dispatch function */ ++ IM_NUMBER(rightshift_size_args), /* Size of arg list */ ++ rightshift_size_args /* Arg list */ + }; + + /* affinei args + */ + static im_arg_desc affinei_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INTERPOLATE( "interpolate" ), +- IM_INPUT_DOUBLE( "a" ), +- IM_INPUT_DOUBLE( "b" ), +- IM_INPUT_DOUBLE( "c" ), +- IM_INPUT_DOUBLE( "d" ), +- IM_INPUT_DOUBLE( "dx" ), +- IM_INPUT_DOUBLE( "dy" ), +- IM_INPUT_INT( "x" ), +- IM_INPUT_INT( "y" ), +- IM_INPUT_INT( "w" ), +- IM_INPUT_INT( "h" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INTERPOLATE("interpolate"), ++ IM_INPUT_DOUBLE("a"), ++ IM_INPUT_DOUBLE("b"), ++ IM_INPUT_DOUBLE("c"), ++ IM_INPUT_DOUBLE("d"), ++ IM_INPUT_DOUBLE("dx"), ++ IM_INPUT_DOUBLE("dy"), ++ IM_INPUT_INT("x"), ++ IM_INPUT_INT("y"), ++ IM_INPUT_INT("w"), ++ IM_INPUT_INT("h") + }; + + /* Call im_affinei via arg vector. + */ + static int +-affinei_vec( im_object *argv ) ++affinei_vec(im_object *argv) + { +- VipsInterpolate *interpolate = VIPS_INTERPOLATE( argv[2] ); ++ VipsInterpolate *interpolate = VIPS_INTERPOLATE(argv[2]); + double a = *((double *) argv[3]); + double b = *((double *) argv[4]); + double c = *((double *) argv[5]); +@@ -112,41 +112,41 @@ affinei_vec( im_object *argv ) + int w = *((int *) argv[11]); + int h = *((int *) argv[12]); + +- return( im_affinei( argv[0], argv[1], interpolate, +- a, b, c, d, dx, dy, x, y, w, h ) ); ++ return (im_affinei(argv[0], argv[1], interpolate, ++ a, b, c, d, dx, dy, x, y, w, h)); + } + + /* Description of im_affinei. +- */ ++ */ + static im_function affinei_desc = { +- "im_affinei", /* Name */ ++ "im_affinei", /* Name */ + "affine transform", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- affinei_vec, /* Dispatch function */ +- IM_NUMBER( affinei_args ), /* Size of arg list */ +- affinei_args /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ affinei_vec, /* Dispatch function */ ++ IM_NUMBER(affinei_args), /* Size of arg list */ ++ affinei_args /* Arg list */ + }; + + /* affinei_all args + */ + static im_arg_desc affinei_all_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INTERPOLATE( "interpolate" ), +- IM_INPUT_DOUBLE( "a" ), +- IM_INPUT_DOUBLE( "b" ), +- IM_INPUT_DOUBLE( "c" ), +- IM_INPUT_DOUBLE( "d" ), +- IM_INPUT_DOUBLE( "dx" ), +- IM_INPUT_DOUBLE( "dy" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INTERPOLATE("interpolate"), ++ IM_INPUT_DOUBLE("a"), ++ IM_INPUT_DOUBLE("b"), ++ IM_INPUT_DOUBLE("c"), ++ IM_INPUT_DOUBLE("d"), ++ IM_INPUT_DOUBLE("dx"), ++ IM_INPUT_DOUBLE("dy") + }; + + /* Call im_affinei_all via arg vector. + */ + static int +-affinei_all_vec( im_object *argv ) ++affinei_all_vec(im_object *argv) + { +- VipsInterpolate *interpolate = VIPS_INTERPOLATE( argv[2] ); ++ VipsInterpolate *interpolate = VIPS_INTERPOLATE(argv[2]); + double a = *((double *) argv[3]); + double b = *((double *) argv[4]); + double c = *((double *) argv[5]); +@@ -154,81 +154,81 @@ affinei_all_vec( im_object *argv ) + double dx = *((double *) argv[7]); + double dy = *((double *) argv[8]); + +- return( im_affinei_all( argv[0], argv[1], interpolate, +- a, b, c, d, dx, dy ) ); ++ return (im_affinei_all(argv[0], argv[1], interpolate, ++ a, b, c, d, dx, dy)); + } + + /* Description of im_affinei_all. +- */ ++ */ + static im_function affinei_all_desc = { +- "im_affinei_all", /* Name */ ++ "im_affinei_all", /* Name */ + "affine transform of whole image", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- affinei_all_vec, /* Dispatch function */ +- IM_NUMBER( affinei_all_args ), /* Size of arg list */ +- affinei_all_args /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ affinei_all_vec, /* Dispatch function */ ++ IM_NUMBER(affinei_all_args), /* Size of arg list */ ++ affinei_all_args /* Arg list */ + }; + + /* Args for im_shrink. + */ + static im_arg_desc shrink_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLE( "xfac" ), +- IM_INPUT_DOUBLE( "yfac" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLE("xfac"), ++ IM_INPUT_DOUBLE("yfac") + }; + + /* Call im_shrink via arg vector. + */ + static int +-shrink_vec( im_object *argv ) ++shrink_vec(im_object *argv) + { + double xshrink = *((double *) argv[2]); + double yshrink = *((double *) argv[3]); + +- return( im_shrink( argv[0], argv[1], xshrink, yshrink ) ); ++ return (im_shrink(argv[0], argv[1], xshrink, yshrink)); + } + + /* Description of im_shrink. +- */ ++ */ + static im_function shrink_desc = { +- "im_shrink", /* Name */ ++ "im_shrink", /* Name */ + "shrink image by xfac, yfac times", +- IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ +- shrink_vec, /* Dispatch function */ +- IM_NUMBER( shrink_args ), /* Size of arg list */ +- shrink_args /* Arg list */ ++ IM_FN_TRANSFORM | IM_FN_PIO, /* Flags */ ++ shrink_vec, /* Dispatch function */ ++ IM_NUMBER(shrink_args), /* Size of arg list */ ++ shrink_args /* Arg list */ + }; + + /* Args to im_stretch3. + */ + static im_arg_desc stretch3_args[] = { +- IM_INPUT_IMAGE( "in" ), +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_DOUBLE( "xdisp" ), +- IM_INPUT_DOUBLE( "ydisp" ) ++ IM_INPUT_IMAGE("in"), ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_DOUBLE("xdisp"), ++ IM_INPUT_DOUBLE("ydisp") + }; + + /* Call im_stretch3 via arg vector. + */ + static int +-stretch3_vec( im_object *argv ) ++stretch3_vec(im_object *argv) + { + double xdisp = *((int *) argv[2]); + double ydisp = *((int *) argv[3]); + +- return( im_stretch3( argv[0], argv[1], xdisp, ydisp ) ); ++ return (im_stretch3(argv[0], argv[1], xdisp, ydisp)); + } + + /* Description of im_stretch3. +- */ ++ */ + static im_function stretch3_desc = { +- "im_stretch3", /* Name */ ++ "im_stretch3", /* Name */ + "stretch 3%, sub-pixel displace by xdisp/ydisp", +- IM_FN_PIO, /* Flags */ +- stretch3_vec, /* Dispatch function */ +- IM_NUMBER( stretch3_args ), /* Size of arg list */ +- stretch3_args /* Arg list */ ++ IM_FN_PIO, /* Flags */ ++ stretch3_vec, /* Dispatch function */ ++ IM_NUMBER(stretch3_args), /* Size of arg list */ ++ stretch3_args /* Arg list */ + }; + + /* Package up all these functions. +@@ -245,6 +245,6 @@ static im_function *resample_list[] = { + */ + im_package im__resample = { + "resample", +- IM_NUMBER( resample_list ), ++ IM_NUMBER(resample_list), + resample_list + }; +diff --git a/libvips/deprecated/rotmask.c b/libvips/deprecated/rotmask.c +index 3389bae755..48968f0ef6 100644 +--- a/libvips/deprecated/rotmask.c ++++ b/libvips/deprecated/rotmask.c +@@ -16,28 +16,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -59,97 +59,97 @@ + + /* The type of the vips operations we support. + */ +-typedef int (*vips_fn)( IMAGE *in, IMAGE *out ); ++typedef int (*vips_fn)(IMAGE *in, IMAGE *out); + + /* Pass a mask through a vips operation, eg. im_rot90(). + */ + static INTMASK * +-vapplyimask( INTMASK *in, const char *name, vips_fn fn ) ++vapplyimask(INTMASK *in, const char *name, vips_fn fn) + { + IMAGE *x; + IMAGE *t[2]; + DOUBLEMASK *d[2]; + INTMASK *out; + +- if( !(x = im_open( name, "p" )) ) +- return( NULL ); +- if( !(d[0] = im_local_dmask( x, im_imask2dmask( in, name ) )) || +- im_open_local_array( x, t, 2, name, "p" ) || +- im_mask2vips( d[0], t[0] ) || +- fn( t[0], t[1] ) || +- !(d[1] = im_local_dmask( x, im_vips2mask( t[1], name ) )) || +- !(out = im_dmask2imask( d[1], name )) ) { +- im_close( x ); +- return( NULL ); ++ if (!(x = im_open(name, "p"))) ++ return (NULL); ++ if (!(d[0] = im_local_dmask(x, im_imask2dmask(in, name))) || ++ im_open_local_array(x, t, 2, name, "p") || ++ im_mask2vips(d[0], t[0]) || ++ fn(t[0], t[1]) || ++ !(d[1] = im_local_dmask(x, im_vips2mask(t[1], name))) || ++ !(out = im_dmask2imask(d[1], name))) { ++ im_close(x); ++ return (NULL); + } +- im_close( x ); ++ im_close(x); + + out->scale = in->scale; + out->offset = in->offset; + +- return( out ); ++ return (out); + } + + static DOUBLEMASK * +-vapplydmask( DOUBLEMASK *in, const char *name, vips_fn fn ) ++vapplydmask(DOUBLEMASK *in, const char *name, vips_fn fn) + { + IMAGE *x; + IMAGE *t[2]; + DOUBLEMASK *out; + +- if( !(x = im_open( name, "p" )) ) +- return( NULL ); +- if( im_open_local_array( x, t, 2, name, "p" ) || +- im_mask2vips( in, t[0] ) || +- fn( t[0], t[1] ) || +- !(out = im_vips2mask( t[1], name )) ) { +- im_close( x ); +- return( NULL ); ++ if (!(x = im_open(name, "p"))) ++ return (NULL); ++ if (im_open_local_array(x, t, 2, name, "p") || ++ im_mask2vips(in, t[0]) || ++ fn(t[0], t[1]) || ++ !(out = im_vips2mask(t[1], name))) { ++ im_close(x); ++ return (NULL); + } +- im_close( x ); ++ im_close(x); + + out->scale = in->scale; + out->offset = in->offset; + +- return( out ); ++ return (out); + } + + INTMASK * +-im_rotate_imask90( INTMASK *in, const char *filename ) ++im_rotate_imask90(INTMASK *in, const char *filename) + { +- return( vapplyimask( in, filename, im_rot90 ) ); ++ return (vapplyimask(in, filename, im_rot90)); + } + + DOUBLEMASK * +-im_rotate_dmask90( DOUBLEMASK *in, const char *filename ) ++im_rotate_dmask90(DOUBLEMASK *in, const char *filename) + { +- return( vapplydmask( in, filename, im_rot90 ) ); ++ return (vapplydmask(in, filename, im_rot90)); + } + +-static int +-im_rot45( IMAGE *in, IMAGE *out ) ++static int ++im_rot45(IMAGE *in, IMAGE *out) + { + VipsImage *t; + +- if( vips_rot45( in, &t, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_rot45(in, &t, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + INTMASK * +-im_rotate_imask45( INTMASK *in, const char *filename ) ++im_rotate_imask45(INTMASK *in, const char *filename) + { +- return( vapplyimask( in, filename, im_rot45 ) ); ++ return (vapplyimask(in, filename, im_rot45)); + } + + DOUBLEMASK * +-im_rotate_dmask45( DOUBLEMASK *in, const char *filename ) ++im_rotate_dmask45(DOUBLEMASK *in, const char *filename) + { +- return( vapplydmask( in, filename, im_rot45 ) ); ++ return (vapplydmask(in, filename, im_rot45)); + } +diff --git a/libvips/deprecated/rw_mask.c b/libvips/deprecated/rw_mask.c +index d070bbc2d5..057d95d317 100644 +--- a/libvips/deprecated/rw_mask.c ++++ b/libvips/deprecated/rw_mask.c +@@ -11,10 +11,10 @@ + * - Code tidied up, better error recovery. + * - Bugs fixed in im_dup_*mask. No longer coredump. + * - Bugs fixed in im_write_*mask. Now work for non-square matricies. +- * - im_copy_*mask_matrix, im_copy_matrix_*mask added: copy VIPS mask ++ * - im_copy_*mask_matrix, im_copy_matrix_*mask added: copy VIPS mask + * structures into Numerical Recipies in C style matricies and vice + * versa. Both structures should have been built before copy attempted. +- * See im_create_*mask, im_*mat_alloc. The matrix should be indexed by 0 ++ * See im_create_*mask, im_*mat_alloc. The matrix should be indexed by 0 + * to size-1. + * 9/7/93 JC + * - some ANSIfication and tidies +@@ -43,7 +43,7 @@ + * 1/9/09 + * - move im_print_*mask() here + * 12/11/09 +- * - reading a float mask with im_read_imask() produced an incorrect ++ * - reading a float mask with im_read_imask() produced an incorrect + * error messagge + * 21/10/10 + * - gtk-doc +@@ -58,28 +58,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -106,11 +106,11 @@ + * @coeff: array of mask elements + * @filename: the file this mask was read from, or should be written to + * +- * An integer mask. ++ * An integer mask. + * + * @scale lets the mask represent fractional values: for + * example, in integer convolution (see im_conv()) the result of the +- * convolution is divided by @scale and then added to @offset before being ++ * convolution is divided by @scale and then added to @offset before being + * written to the output image. + * + * @scale and @offset default to 1 and 0. Various functions, such as +@@ -128,10 +128,10 @@ + * @coeff: array of mask elements + * @filename: the file this mask was read from, or should be written to + * +- * A floating-point mask. ++ * A floating-point mask. + * + * As with #INTMASK, in convolution (see im_convf()) the result of the +- * convolution is divided by @scale and then added to @offset before being ++ * convolution is divided by @scale and then added to @offset before being + * written to the output image. + * + * @scale and @offset default to 1.0 and 0.0. Various functions, such as +@@ -156,16 +156,16 @@ + * Returns: zero. + */ + int +-im_free_imask( INTMASK *in ) +-{ +- if( !in ) +- return( 0 ); ++im_free_imask(INTMASK *in) ++{ ++ if (!in) ++ return (0); + +- IM_FREE( in->coeff ); +- IM_FREE( in->filename ); +- IM_FREE( in ); ++ IM_FREE(in->coeff); ++ IM_FREE(in->filename); ++ IM_FREE(in); + +- return( 0 ); ++ return (0); + } + + /** +@@ -180,16 +180,16 @@ im_free_imask( INTMASK *in ) + * Returns: zero. + */ + int +-im_free_dmask( DOUBLEMASK *in ) ++im_free_dmask(DOUBLEMASK *in) + { +- if( !in ) +- return( 0 ); ++ if (!in) ++ return (0); + +- IM_FREE( in->coeff ); +- IM_FREE( in->filename ); +- IM_FREE( in ); ++ IM_FREE(in->coeff); ++ IM_FREE(in->filename); ++ IM_FREE(in); + +- return( 0 ); ++ return (0); + } + + /** +@@ -198,29 +198,29 @@ im_free_dmask( DOUBLEMASK *in ) + * @xsize: mask width + * @ysize: mask height + * +- * Create an empty imask. You need to loop over @coeff to set the values. ++ * Create an empty imask. You need to loop over @coeff to set the values. + * + * See also: im_create_imaskv(). + * + * Returns: The newly-allocated mask. + */ + INTMASK * +-im_create_imask( const char *filename, int xsize, int ysize ) +-{ ++im_create_imask(const char *filename, int xsize, int ysize) ++{ + INTMASK *out; + int size = xsize * ysize; + + /* Check args. + */ +- if( xsize <= 0 || ysize <= 0 || filename == NULL ) { +- im_error( "im_create_imask", "%s", _( "bad arguments" ) ); +- return( NULL ); ++ if (xsize <= 0 || ysize <= 0 || filename == NULL) { ++ im_error("im_create_imask", "%s", _("bad arguments")); ++ return (NULL); + } + + /* Allocate and initialise structure. + */ +- if( !(out = IM_NEW( NULL, INTMASK )) ) +- return( NULL ); ++ if (!(out = IM_NEW(NULL, INTMASK))) ++ return (NULL); + out->coeff = NULL; + out->filename = NULL; + out->scale = 1; +@@ -228,19 +228,19 @@ im_create_imask( const char *filename, int xsize, int ysize ) + out->xsize = 0; + out->ysize = 0; + +- if( !(out->coeff = IM_ARRAY( NULL, size, int )) ) { +- im_free_imask( out ); +- return( NULL ); ++ if (!(out->coeff = IM_ARRAY(NULL, size, int))) { ++ im_free_imask(out); ++ return (NULL); + } +- (void) memset( (char *) out->coeff, 0, size * sizeof( int ) ); +- if( !(out->filename = im_strdup( NULL, filename )) ) { +- im_free_imask( out ); +- return( NULL ); ++ (void) memset((char *) out->coeff, 0, size * sizeof(int)); ++ if (!(out->filename = im_strdup(NULL, filename))) { ++ im_free_imask(out); ++ return (NULL); + } +- out->xsize = xsize; ++ out->xsize = xsize; + out->ysize = ysize; + +- return( out ); ++ return (out); + } + + /** +@@ -257,22 +257,22 @@ im_create_imask( const char *filename, int xsize, int ysize ) + * Returns: The newly-allocated mask. + */ + INTMASK * +-im_create_imaskv( const char *filename, int xsize, int ysize, ... ) ++im_create_imaskv(const char *filename, int xsize, int ysize, ...) + { + va_list ap; + + INTMASK *out; + int i; + +- if( !(out = im_create_imask( filename, xsize, ysize )) ) +- return( NULL ); ++ if (!(out = im_create_imask(filename, xsize, ysize))) ++ return (NULL); + +- va_start( ap, ysize ); +- for( i = 0; i < xsize * ysize; i++ ) +- out->coeff[i] = va_arg( ap, int ); +- va_end( ap ); ++ va_start(ap, ysize); ++ for (i = 0; i < xsize * ysize; i++) ++ out->coeff[i] = va_arg(ap, int); ++ va_end(ap); + +- return( out ); ++ return (out); + } + + /** +@@ -281,29 +281,29 @@ im_create_imaskv( const char *filename, int xsize, int ysize, ... ) + * @xsize: mask width + * @ysize: mask height + * +- * Create an empty dmask. You need to loop over @coeff to set the values. ++ * Create an empty dmask. You need to loop over @coeff to set the values. + * + * See also: im_create_dmaskv(), im_vips2mask(). + * + * Returns: The newly-allocated mask. + */ + DOUBLEMASK * +-im_create_dmask( const char *filename, int xsize, int ysize ) +-{ ++im_create_dmask(const char *filename, int xsize, int ysize) ++{ + DOUBLEMASK *out; + int size = xsize * ysize; + + /* Check args. + */ +- if( xsize <= 0 || ysize <= 0 || filename == NULL ) { +- im_error( "im_create_dmask", "%s", _( "bad arguments" ) ); +- return( NULL ); ++ if (xsize <= 0 || ysize <= 0 || filename == NULL) { ++ im_error("im_create_dmask", "%s", _("bad arguments")); ++ return (NULL); + } + + /* Allocate and initialise structure. + */ +- if( !(out = IM_NEW( NULL, DOUBLEMASK )) ) +- return( NULL ); ++ if (!(out = IM_NEW(NULL, DOUBLEMASK))) ++ return (NULL); + out->coeff = NULL; + out->filename = NULL; + out->scale = 1.0; +@@ -311,19 +311,19 @@ im_create_dmask( const char *filename, int xsize, int ysize ) + out->xsize = 0; + out->ysize = 0; + +- if( !(out->coeff = IM_ARRAY( NULL, size, double )) ) { +- im_free_dmask( out ); +- return( NULL ); ++ if (!(out->coeff = IM_ARRAY(NULL, size, double))) { ++ im_free_dmask(out); ++ return (NULL); + } +- (void) memset( (char *) out->coeff, 0, size * sizeof( double ) ); +- if( !(out->filename = im_strdup( NULL, filename )) ) { +- im_free_dmask( out ); +- return( NULL ); ++ (void) memset((char *) out->coeff, 0, size * sizeof(double)); ++ if (!(out->filename = im_strdup(NULL, filename))) { ++ im_free_dmask(out); ++ return (NULL); + } +- out->xsize = xsize; ++ out->xsize = xsize; + out->ysize = ysize; + +- return( out ); ++ return (out); + } + + /** +@@ -340,81 +340,81 @@ im_create_dmask( const char *filename, int xsize, int ysize ) + * Returns: The newly-allocated mask. + */ + DOUBLEMASK * +-im_create_dmaskv( const char *filename, int xsize, int ysize, ... ) +-{ ++im_create_dmaskv(const char *filename, int xsize, int ysize, ...) ++{ + va_list ap; + + DOUBLEMASK *out; + int i; + +- if( !(out = im_create_dmask( filename, xsize, ysize )) ) +- return( NULL ); ++ if (!(out = im_create_dmask(filename, xsize, ysize))) ++ return (NULL); + +- va_start( ap, ysize ); +- for( i = 0; i < xsize * ysize; i++ ) +- out->coeff[i] = va_arg( ap, double ); +- va_end( ap ); ++ va_start(ap, ysize); ++ for (i = 0; i < xsize * ysize; i++) ++ out->coeff[i] = va_arg(ap, double); ++ va_end(ap); + +- return( out ); ++ return (out); + } + +-/* Read a line from a file! ++/* Read a line from a file! + */ + static int +-get_line( FILE *fp, char *buf ) ++get_line(FILE *fp, char *buf) + { +- if( !fgets( buf, MAX_LINE, fp ) ) { +- im_error( "read_mask", "%s", _( "unexpected EOF" ) ); +- return( -1 ); ++ if (!fgets(buf, MAX_LINE, fp)) { ++ im_error("read_mask", "%s", _("unexpected EOF")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* width, height, optional scale, optional offset. + */ + static int +-read_header( FILE *fp, int *xs, int *ys, double *scale, double *offset ) ++read_header(FILE *fp, int *xs, int *ys, double *scale, double *offset) + { + char buf[MAX_LINE]; + char *p, *q; + double v[4]; + int i; + +- /* Read the first line: should contain size and optional +- * scale + offset. ++ /* Read the first line: should contain size and optional ++ * scale + offset. + */ +- if( get_line( fp, buf ) ) +- return( -1 ); ++ if (get_line(fp, buf)) ++ return (-1); + + /* Read as space separated doubles. \n is in the break list because + * our line will (usually) have a trailing \n which we want to count + * as whitespace. + */ +- p = buf; +- for( i = 0, p = buf; +- i < 4 && (q = im_break_token( p, " \";,\t\n" )); +- i++, p = q ) +- v[i] = g_ascii_strtod( p, NULL ); +- +- if( (i != 2 && i != 4) || +- ceil( v[0] ) != v[0] || +- ceil( v[1] ) != v[1] || ++ p = buf; ++ for (i = 0, p = buf; ++ i < 4 && (q = im_break_token(p, " \";,\t\n")); ++ i++, p = q) ++ v[i] = g_ascii_strtod(p, NULL); ++ ++ if ((i != 2 && i != 4) || ++ ceil(v[0]) != v[0] || ++ ceil(v[1]) != v[1] || + v[0] <= 0 || +- v[1] <= 0 ) { +- im_error( "read_header", +- "%s", _( "error reading matrix header" ) ); +- return( -1 ); ++ v[1] <= 0) { ++ im_error("read_header", ++ "%s", _("error reading matrix header")); ++ return (-1); + } +- if( i == 4 && v[2] == 0 ) { +- im_error( "read_header", +- "%s", _( "scale should be non-zero" ) ); +- return( -1 ); ++ if (i == 4 && v[2] == 0) { ++ im_error("read_header", ++ "%s", _("scale should be non-zero")); ++ return (-1); + } + + *xs = v[0]; + *ys = v[1]; +- if( i == 2 ) { ++ if (i == 2) { + *scale = 1.0; + *offset = 0.0; + } +@@ -423,7 +423,7 @@ read_header( FILE *fp, int *xs, int *ys, double *scale, double *offset ) + *offset = v[3]; + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -433,18 +433,18 @@ read_header( FILE *fp, int *xs, int *ys, double *scale, double *offset ) + * Reads a matrix from a file. + * + * Matrix files have a simple format that's supposed to be easy to create with +- * a text editor or a spreadsheet. ++ * a text editor or a spreadsheet. + * + * The first line has four numbers for width, height, scale and + * offset (scale and offset may be omitted, in which case they default to 1.0 + * and 0.0). Scale must be non-zero. Width and height must be positive +- * integers. The numbers are separated by any mixture of spaces, commas, +- * tabs and quotation marks ("). The scale and offset fields may be ++ * integers. The numbers are separated by any mixture of spaces, commas, ++ * tabs and quotation marks ("). The scale and offset fields may be + * floating-point, and must use '.' + * as a decimal separator. + * + * Subsequent lines each hold one line of matrix data, with numbers again +- * separated by any mixture of spaces, commas, ++ * separated by any mixture of spaces, commas, + * tabs and quotation marks ("). The numbers may be floating-point, and must + * use '.' + * as a decimal separator. +@@ -457,7 +457,7 @@ read_header( FILE *fp, int *xs, int *ys, double *scale, double *offset ) + * Returns: the loaded mask on success, or NULL on error. + */ + DOUBLEMASK * +-im_read_dmask( const char *filename ) ++im_read_dmask(const char *filename) + { + FILE *fp; + double sc, off; +@@ -466,37 +466,37 @@ im_read_dmask( const char *filename ) + int x, y, i; + char buf[MAX_LINE]; + +- if( !(fp = im__file_open_read( filename, NULL, TRUE )) ) +- return( NULL ); ++ if (!(fp = im__file_open_read(filename, NULL, TRUE))) ++ return (NULL); + +- if( read_header( fp, &xs, &ys, &sc, &off ) ) { +- fclose( fp ); +- return( NULL ); ++ if (read_header(fp, &xs, &ys, &sc, &off)) { ++ fclose(fp); ++ return (NULL); + } + +- if( !(out = im_create_dmask( filename, xs, ys )) ) { +- fclose( fp ); +- return( NULL ); ++ if (!(out = im_create_dmask(filename, xs, ys))) { ++ fclose(fp); ++ return (NULL); + } + out->scale = sc; + out->offset = off; + +- for( i = 0, y = 0; y < ys; y++ ) { ++ for (i = 0, y = 0; y < ys; y++) { + char *p; + +- if( get_line( fp, buf ) ) { +- im_free_dmask( out ); +- fclose( fp ); +- return( NULL ); ++ if (get_line(fp, buf)) { ++ im_free_dmask(out); ++ fclose(fp); ++ return (NULL); + } + +- for( p = buf, x = 0; p && x < xs; +- x++, i++, p = im_break_token( p, " \t,\";" ) ) +- out->coeff[i] = g_ascii_strtod( p, NULL ); ++ for (p = buf, x = 0; p && x < xs; ++ x++, i++, p = im_break_token(p, " \t,\";")) ++ out->coeff[i] = g_ascii_strtod(p, NULL); + } +- fclose( fp ); ++ fclose(fp); + +- return( out ); ++ return (out); + } + + /** +@@ -514,48 +514,48 @@ im_read_dmask( const char *filename ) + * Returns: the loaded mask on success, or NULL on error. + */ + INTMASK * +-im_read_imask( const char *filename ) ++im_read_imask(const char *filename) + { + DOUBLEMASK *dmask; + INTMASK *imask; + int i; + +- if( !(dmask = im_read_dmask( filename )) ) +- return( NULL ); ++ if (!(dmask = im_read_dmask(filename))) ++ return (NULL); + +- if( ceil( dmask->scale ) != dmask->scale || +- ceil( dmask->offset ) != dmask->offset ) { +- im_error( "im_read_imask", +- "%s", _( "scale and offset should be int" ) ); +- im_free_dmask( dmask ); ++ if (ceil(dmask->scale) != dmask->scale || ++ ceil(dmask->offset) != dmask->offset) { ++ im_error("im_read_imask", ++ "%s", _("scale and offset should be int")); ++ im_free_dmask(dmask); + +- return( NULL ); ++ return (NULL); + } + +- for( i = 0; i < dmask->xsize * dmask->ysize; i++ ) +- if( ceil( dmask->coeff[i] ) != dmask->coeff[i] ) { +- im_error( "im_read_imask", _( "ceofficient at " +- "position (%d, %d) is not int" ), ++ for (i = 0; i < dmask->xsize * dmask->ysize; i++) ++ if (ceil(dmask->coeff[i]) != dmask->coeff[i]) { ++ im_error("im_read_imask", _("ceofficient at " ++ "position (%d, %d) is not int"), + i % dmask->xsize, +- i / dmask->xsize ); +- im_free_dmask( dmask ); ++ i / dmask->xsize); ++ im_free_dmask(dmask); + +- return( NULL ); ++ return (NULL); + } + +- if( !(imask = im_create_imask( filename, +- dmask->xsize, dmask->ysize )) ) { +- im_free_dmask( dmask ); +- return( NULL ); ++ if (!(imask = im_create_imask(filename, ++ dmask->xsize, dmask->ysize))) { ++ im_free_dmask(dmask); ++ return (NULL); + } + imask->scale = dmask->scale; + imask->offset = dmask->offset; +- for( i = 0; i < dmask->xsize * dmask->ysize; i++ ) ++ for (i = 0; i < dmask->xsize * dmask->ysize; i++) + imask->coeff[i] = dmask->coeff[i]; + +- im_free_dmask( dmask ); ++ im_free_dmask(dmask); + +- return( imask ); ++ return (imask); + } + + /** +@@ -570,49 +570,49 @@ im_read_imask( const char *filename ) + * Returns: the converted mask, or NULL on error. + */ + INTMASK * +-im_scale_dmask( DOUBLEMASK *in, const char *filename ) ++im_scale_dmask(DOUBLEMASK *in, const char *filename) + { + const int size = in->xsize * in->ysize; + + INTMASK *out; +- double maxval, dsum; ++ double maxval, dsum; + int i; + int isum; + +- if( im_check_dmask( "im_scale_dmask", in ) || +- !(out = im_create_imask( filename, in->xsize, in->ysize )) ) +- return( NULL ); ++ if (im_check_dmask("im_scale_dmask", in) || ++ !(out = im_create_imask(filename, in->xsize, in->ysize))) ++ return (NULL); + + /* Find mask max. + */ + maxval = in->coeff[0]; +- for( i = 0; i < size; i++ ) +- if( in->coeff[i] > maxval ) ++ for (i = 0; i < size; i++) ++ if (in->coeff[i] > maxval) + maxval = in->coeff[i]; + + /* Copy and scale, setting max to 20. + */ +- for( i = 0; i < size; i++ ) +- out->coeff[i] = IM_RINT( in->coeff[i] * 20.0 / maxval ); ++ for (i = 0; i < size; i++) ++ out->coeff[i] = IM_RINT(in->coeff[i] * 20.0 / maxval); + out->offset = in->offset; + + /* Set the scale to match the adjustment to max. + */ + isum = 0; + dsum = 0.0; +- for( i = 0; i < size; i++ ) { +- isum += out->coeff[i]; ++ for (i = 0; i < size; i++) { ++ isum += out->coeff[i]; + dsum += in->coeff[i]; + } + +- if( dsum == in->scale ) ++ if (dsum == in->scale) + out->scale = isum; +- else if( dsum == 0.0 ) ++ else if (dsum == 0.0) + out->scale = 1.0; + else +- out->scale = IM_RINT( in->scale * isum / dsum ); ++ out->scale = IM_RINT(in->scale * isum / dsum); + +- return( out ); ++ return (out); + } + + /** +@@ -620,30 +620,30 @@ im_scale_dmask( DOUBLEMASK *in, const char *filename ) + * @in: mask to convert + * @filename: filename for returned mask + * +- * Make an imask from the dmask, rounding to nearest. ++ * Make an imask from the dmask, rounding to nearest. + * + * See also: im_scale_dmask(). + * + * Returns: the converted mask, or NULL on error. + */ + INTMASK * +-im_dmask2imask( DOUBLEMASK *in, const char *filename ) ++im_dmask2imask(DOUBLEMASK *in, const char *filename) + { + const int size = in->xsize * in->ysize; + + INTMASK *out; + int i; + +- if( im_check_dmask( "im_dmask2imask", in ) || +- !(out = im_create_imask( filename, in->xsize, in->ysize )) ) +- return( NULL ); ++ if (im_check_dmask("im_dmask2imask", in) || ++ !(out = im_create_imask(filename, in->xsize, in->ysize))) ++ return (NULL); + +- for( i = 0; i < size; i++ ) +- out->coeff[i] = IM_RINT( in->coeff[i] ); +- out->offset = IM_RINT( in->offset ); +- out->scale = IM_RINT( in->scale ); ++ for (i = 0; i < size; i++) ++ out->coeff[i] = IM_RINT(in->coeff[i]); ++ out->offset = IM_RINT(in->offset); ++ out->scale = IM_RINT(in->scale); + +- return( out ); ++ return (out); + } + + /** +@@ -658,23 +658,23 @@ im_dmask2imask( DOUBLEMASK *in, const char *filename ) + * Returns: the converted mask, or NULL on error. + */ + DOUBLEMASK * +-im_imask2dmask( INTMASK *in, const char *filename ) ++im_imask2dmask(INTMASK *in, const char *filename) + { + const int size = in->xsize * in->ysize; + + DOUBLEMASK *out; + int i; + +- if( im_check_imask( "im_imask2dmask", in ) || +- !(out = im_create_dmask( filename, in->xsize, in->ysize )) ) +- return( NULL ); ++ if (im_check_imask("im_imask2dmask", in) || ++ !(out = im_create_dmask(filename, in->xsize, in->ysize))) ++ return (NULL); + +- for( i = 0; i < size; i++ ) ++ for (i = 0; i < size; i++) + out->coeff[i] = in->coeff[i]; + out->offset = in->offset; + out->scale = in->scale; + +- return( out ); ++ return (out); + } + + /** +@@ -688,19 +688,19 @@ im_imask2dmask( INTMASK *in, const char *filename ) + * + * Returns: 0 on success, or -1 on error. + */ +-void +-im_norm_dmask( DOUBLEMASK *mask ) +-{ ++void ++im_norm_dmask(DOUBLEMASK *mask) ++{ + const int n = mask->xsize * mask->ysize; + const double scale = (mask->scale == 0) ? 0 : (1.0 / mask->scale); + + int i; + +- if( im_check_dmask( "im_norm_dmask", mask ) || +- (1.0 == scale && 0.0 == mask->offset) ) ++ if (im_check_dmask("im_norm_dmask", mask) || ++ (1.0 == scale && 0.0 == mask->offset)) + return; + +- for( i = 0; i < n; i++ ) ++ for (i = 0; i < n; i++) + mask->coeff[i] = mask->coeff[i] * scale + mask->offset; + + mask->scale = 1.0; +@@ -719,22 +719,22 @@ im_norm_dmask( DOUBLEMASK *mask ) + * Returns: the mask copy, or NULL on error. + */ + INTMASK * +-im_dup_imask( INTMASK *in, const char *filename ) ++im_dup_imask(INTMASK *in, const char *filename) + { + INTMASK *out; + int i; + +- if( im_check_imask( "im_dup_imask", in ) || +- !(out = im_create_imask( filename, in->xsize, in->ysize )) ) +- return( NULL ); ++ if (im_check_imask("im_dup_imask", in) || ++ !(out = im_create_imask(filename, in->xsize, in->ysize))) ++ return (NULL); + +- out->offset = in->offset; ++ out->offset = in->offset; + out->scale = in->scale; + +- for( i = 0; i < in->xsize * in->ysize; i++ ) ++ for (i = 0; i < in->xsize * in->ysize; i++) + out->coeff[i] = in->coeff[i]; + +- return( out ); ++ return (out); + } + + /** +@@ -749,49 +749,49 @@ im_dup_imask( INTMASK *in, const char *filename ) + * Returns: the mask copy, or NULL on error. + */ + DOUBLEMASK * +-im_dup_dmask( DOUBLEMASK *in, const char *filename ) ++im_dup_dmask(DOUBLEMASK *in, const char *filename) + { + DOUBLEMASK *out; + int i; + +- if( im_check_dmask( "im_dup_dmask", in ) || +- !(out = im_create_dmask( filename, in->xsize, in->ysize )) ) +- return( NULL ); ++ if (im_check_dmask("im_dup_dmask", in) || ++ !(out = im_create_dmask(filename, in->xsize, in->ysize))) ++ return (NULL); + +- out->offset = in->offset; ++ out->offset = in->offset; + out->scale = in->scale; + +- for( i = 0; i < in->xsize * in->ysize; i++ ) ++ for (i = 0; i < in->xsize * in->ysize; i++) + out->coeff[i] = in->coeff[i]; + +- return( out ); ++ return (out); + } + + /* Write to file. + */ +-static int +-write_line( FILE *fp, const char *fmt, ... ) ++static int ++write_line(FILE *fp, const char *fmt, ...) + { + va_list ap; + +- va_start( ap, fmt ); +- if( !vfprintf( fp, fmt, ap ) ) { +- im_error( "write_mask", "%s", _( "write error, disc full?" ) ); +- return( -1 ); ++ va_start(ap, fmt); ++ if (!vfprintf(fp, fmt, ap)) { ++ im_error("write_mask", "%s", _("write error, disc full?")); ++ return (-1); + } +- va_end( ap ); ++ va_end(ap); + +- return( 0 ); ++ return (0); + } + +-static int +-write_double( FILE *fp, double d ) ++static int ++write_double(FILE *fp, double d) + { + char buf[G_ASCII_DTOSTR_BUF_SIZE]; + +- fprintf( fp, "%s", g_ascii_dtostr( buf, sizeof( buf ), d ) ); ++ fprintf(fp, "%s", g_ascii_dtostr(buf, sizeof(buf), d)); + +- return( 0 ); ++ return (0); + } + + /** +@@ -806,36 +806,36 @@ write_double( FILE *fp, double d ) + * + * Returns: 0 on success, or -1 on error. + */ +-int +-im_write_imask_name( INTMASK *in, const char *filename ) ++int ++im_write_imask_name(INTMASK *in, const char *filename) + { + FILE *fp; + int x, y, i; + +- if( im_check_imask( "im_write_imask_name", in ) || +- !(fp = im__file_open_write( filename, TRUE )) ) +- return( -1 ); ++ if (im_check_imask("im_write_imask_name", in) || ++ !(fp = im__file_open_write(filename, TRUE))) ++ return (-1); + +- if( write_line( fp, "%d %d", in->xsize, in->ysize ) ) { +- fclose( fp ); +- return( -1 ); ++ if (write_line(fp, "%d %d", in->xsize, in->ysize)) { ++ fclose(fp); ++ return (-1); + } +- if( in->scale != 1 || in->offset != 0 ) +- write_line( fp, " %d %d", in->scale, in->offset ); +- write_line( fp, "\n" ); ++ if (in->scale != 1 || in->offset != 0) ++ write_line(fp, " %d %d", in->scale, in->offset); ++ write_line(fp, "\n"); + +- for( i = 0, y = 0; y < in->ysize; y++ ) { +- for( x = 0; x < in->xsize; x++, i++ ) +- write_line( fp, "%d ", in->coeff[i] ); ++ for (i = 0, y = 0; y < in->ysize; y++) { ++ for (x = 0; x < in->xsize; x++, i++) ++ write_line(fp, "%d ", in->coeff[i]); + +- if( write_line( fp, "\n" ) ) { +- fclose( fp ); +- return( -1 ); ++ if (write_line(fp, "\n")) { ++ fclose(fp); ++ return (-1); + } + } +- fclose( fp ); ++ fclose(fp); + +- return( 0 ); ++ return (0); + } + + /** +@@ -848,15 +848,15 @@ im_write_imask_name( INTMASK *in, const char *filename ) + * + * Returns: 0 on success, or -1 on error. + */ +-int +-im_write_imask( INTMASK *in ) ++int ++im_write_imask(INTMASK *in) + { +- if( !in->filename ) { +- im_error( "im_write_imask", "%s", _( "filename not set" ) ); +- return( -1 ); ++ if (!in->filename) { ++ im_error("im_write_imask", "%s", _("filename not set")); ++ return (-1); + } + +- return( im_write_imask_name( in, in->filename ) ); ++ return (im_write_imask_name(in, in->filename)); + } + + /** +@@ -871,42 +871,42 @@ im_write_imask( INTMASK *in ) + * + * Returns: 0 on success, or -1 on error. + */ +-int +-im_write_dmask_name( DOUBLEMASK *in, const char *filename ) ++int ++im_write_dmask_name(DOUBLEMASK *in, const char *filename) + { + FILE *fp; + int x, y, i; + +- if( im_check_dmask( "im_write_dmask_name", in ) || +- !(fp = im__file_open_write( filename, TRUE )) ) +- return( -1 ); ++ if (im_check_dmask("im_write_dmask_name", in) || ++ !(fp = im__file_open_write(filename, TRUE))) ++ return (-1); + +- if( write_line( fp, "%d %d", in->xsize, in->ysize ) ) { +- fclose( fp ); +- return( -1 ); ++ if (write_line(fp, "%d %d", in->xsize, in->ysize)) { ++ fclose(fp); ++ return (-1); + } +- if( in->scale != 1.0 || in->offset != 0.0 ) { +- write_line( fp, " " ); +- write_double( fp, in->scale ); +- write_line( fp, " " ); +- write_double( fp, in->offset ); ++ if (in->scale != 1.0 || in->offset != 0.0) { ++ write_line(fp, " "); ++ write_double(fp, in->scale); ++ write_line(fp, " "); ++ write_double(fp, in->offset); + } +- write_line( fp, "\n" ); ++ write_line(fp, "\n"); + +- for( i = 0, y = 0; y < in->ysize; y++ ) { +- for( x = 0; x < in->xsize; x++, i++ ) { +- write_double( fp, in->coeff[i] ); +- write_line( fp, " " ); ++ for (i = 0, y = 0; y < in->ysize; y++) { ++ for (x = 0; x < in->xsize; x++, i++) { ++ write_double(fp, in->coeff[i]); ++ write_line(fp, " "); + } + +- if( write_line( fp, "\n" ) ) { +- fclose( fp ); +- return( -1 ); ++ if (write_line(fp, "\n")) { ++ fclose(fp); ++ return (-1); + } + } +- fclose( fp ); ++ fclose(fp); + +- return( 0 ); ++ return (0); + } + + /** +@@ -920,68 +920,67 @@ im_write_dmask_name( DOUBLEMASK *in, const char *filename ) + * + * Returns: 0 on success, or -1 on error. + */ +-int +-im_write_dmask( DOUBLEMASK *in ) ++int ++im_write_dmask(DOUBLEMASK *in) + { +- if( !in->filename ) { +- im_error( "im_write_dmask", "%s", _( "filename not set" ) ); +- return( -1 ); ++ if (!in->filename) { ++ im_error("im_write_dmask", "%s", _("filename not set")); ++ return (-1); + } + +- return( im_write_dmask_name( in, in->filename ) ); ++ return (im_write_dmask_name(in, in->filename)); + } + + /* Copy an imask into a matrix. Only used internally by matrix package for + * invert. + */ +-void +-im_copy_imask_matrix( INTMASK *mask, int **matrix ) +-{ ++void ++im_copy_imask_matrix(INTMASK *mask, int **matrix) ++{ + int x, y; + int *p = mask->coeff; + +- for( y = 0; y < mask->ysize; y++ ) +- for( x = 0; x < mask->xsize; x++ ) ++ for (y = 0; y < mask->ysize; y++) ++ for (x = 0; x < mask->xsize; x++) + matrix[x][y] = *p++; + } + +- + /* Copy a matrix into an imask. + */ +-void +-im_copy_matrix_imask( int **matrix, INTMASK *mask ) +-{ ++void ++im_copy_matrix_imask(int **matrix, INTMASK *mask) ++{ + int x, y; + int *p = mask->coeff; + +- for( y = 0; y < mask->ysize; y++ ) +- for( x = 0; x < mask->xsize; x++ ) ++ for (y = 0; y < mask->ysize; y++) ++ for (x = 0; x < mask->xsize; x++) + *p++ = matrix[x][y]; + } + + /* Copy a dmask into a matrix. + */ +-void +-im_copy_dmask_matrix( DOUBLEMASK *mask, double **matrix ) +-{ ++void ++im_copy_dmask_matrix(DOUBLEMASK *mask, double **matrix) ++{ + int x, y; + double *p = mask->coeff; + +- for( y = 0; y < mask->ysize; y++ ) +- for( x = 0; x < mask->xsize; x++ ) ++ for (y = 0; y < mask->ysize; y++) ++ for (x = 0; x < mask->xsize; x++) + matrix[x][y] = *p++; + } + + /* Copy a matrix to a dmask. + */ +-void +-im_copy_matrix_dmask( double **matrix, DOUBLEMASK *mask ) +-{ ++void ++im_copy_matrix_dmask(double **matrix, DOUBLEMASK *mask) ++{ + int x, y; + double *p = mask->coeff; + +- for( y = 0; y < mask->ysize; y++ ) +- for( x = 0; x < mask->xsize; x++ ) ++ for (y = 0; y < mask->ysize; y++) ++ for (x = 0; x < mask->xsize; x++) + *p++ = matrix[x][y]; + } + +@@ -993,19 +992,19 @@ im_copy_matrix_dmask( double **matrix, DOUBLEMASK *mask ) + * + * See also: im_print_dmask(). + */ +-void +-im_print_imask( INTMASK *in ) ++void ++im_print_imask(INTMASK *in) + { +- int i, j, k; ++ int i, j, k; + +- printf( "%s: %d %d %d %d\n", +- in->filename, in->xsize, in->ysize, in->scale, in->offset ); ++ printf("%s: %d %d %d %d\n", ++ in->filename, in->xsize, in->ysize, in->scale, in->offset); + +- for( k = 0, j = 0; j < in->ysize; j++ ) { +- for( i = 0; i < in->xsize; i++, k++ ) +- printf( "%d\t", in->coeff[k] ); ++ for (k = 0, j = 0; j < in->ysize; j++) { ++ for (i = 0; i < in->xsize; i++, k++) ++ printf("%d\t", in->coeff[k]); + +- printf( "\n" ); ++ printf("\n"); + } + } + +@@ -1017,19 +1016,19 @@ im_print_imask( INTMASK *in ) + * + * See also: im_print_imask(). + */ +-void +-im_print_dmask( DOUBLEMASK *in ) ++void ++im_print_dmask(DOUBLEMASK *in) + { +- int i, j, k; ++ int i, j, k; + +- printf( "%s: %d %d %f %f\n", +- in->filename, in->xsize, in->ysize, in->scale, in->offset ); ++ printf("%s: %d %d %f %f\n", ++ in->filename, in->xsize, in->ysize, in->scale, in->offset); + +- for( k = 0, j = 0; j < in->ysize; j++ ) { +- for( i = 0; i < in->xsize; i++, k++ ) +- printf( "%f\t", in->coeff[k] ); ++ for (k = 0, j = 0; j < in->ysize; j++) { ++ for (i = 0; i < in->xsize; i++, k++) ++ printf("%f\t", in->coeff[k]); + +- printf( "\n" ); ++ printf("\n"); + } + } + +@@ -1046,18 +1045,18 @@ im_print_dmask( DOUBLEMASK *in ) + * Returns: the mask, or NULL on error. + */ + DOUBLEMASK * +-im_local_dmask( VipsImage *out, DOUBLEMASK *mask ) ++im_local_dmask(VipsImage *out, DOUBLEMASK *mask) + { +- if( im_check_dmask( "im_local_dmask", mask ) ) +- return( NULL ); ++ if (im_check_dmask("im_local_dmask", mask)) ++ return (NULL); + +- if( im_add_close_callback( out, +- (im_callback_fn) im_free_dmask, mask, NULL ) ) { +- im_free_dmask( mask ); +- return( NULL ); ++ if (im_add_close_callback(out, ++ (im_callback_fn) im_free_dmask, mask, NULL)) { ++ im_free_dmask(mask); ++ return (NULL); + } + +- return( mask ); ++ return (mask); + } + + /** +@@ -1073,16 +1072,16 @@ im_local_dmask( VipsImage *out, DOUBLEMASK *mask ) + * Returns: the mask, or NULL on error. + */ + INTMASK * +-im_local_imask( VipsImage *out, INTMASK *mask ) ++im_local_imask(VipsImage *out, INTMASK *mask) + { +- if( im_check_imask( "im_local_dmask", mask ) ) +- return( NULL ); ++ if (im_check_imask("im_local_dmask", mask)) ++ return (NULL); + +- if( im_add_close_callback( out, +- (im_callback_fn) im_free_imask, mask, NULL ) ) { +- im_free_imask( mask ); +- return( NULL ); ++ if (im_add_close_callback(out, ++ (im_callback_fn) im_free_imask, mask, NULL)) { ++ im_free_imask(mask); ++ return (NULL); + } + +- return( mask ); ++ return (mask); + } +diff --git a/libvips/deprecated/tone.c b/libvips/deprecated/tone.c +index 4cdf43553e..5810b6b24c 100644 +--- a/libvips/deprecated/tone.c ++++ b/libvips/deprecated/tone.c +@@ -17,28 +17,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -61,7 +61,7 @@ + * @lut: look-up table + * + * Map the first channel of @in through @lut. If @in is IM_CODING_LABQ, unpack +- * to LABS, map L and then repack. ++ * to LABS, map L and then repack. + * + * @in should be a LABS or LABQ image for this to work + * sensibly. +@@ -71,62 +71,62 @@ + * Returns: 0 on success, -1 on error + */ + int +-im_tone_map( IMAGE *in, IMAGE *out, IMAGE *lut ) ++im_tone_map(IMAGE *in, IMAGE *out, IMAGE *lut) + { + IMAGE *t[8]; + +- if( im_check_hist( "im_tone_map", lut ) || +- im_open_local_array( out, t, 8, "im_tone_map", "p" ) ) +- return( -1 ); ++ if (im_check_hist("im_tone_map", lut) || ++ im_open_local_array(out, t, 8, "im_tone_map", "p")) ++ return (-1); + + /* If in is IM_CODING_LABQ, unpack. + */ +- if( in->Coding == IM_CODING_LABQ ) { +- if( im_LabQ2LabS( in, t[0] ) ) +- return( -1 ); ++ if (in->Coding == IM_CODING_LABQ) { ++ if (im_LabQ2LabS(in, t[0])) ++ return (-1); + } + else + t[0] = in; + + /* Split into bands. + */ +- if( im_extract_band( t[0], t[1], 0 ) ) +- return( -1 ); +- if( t[0]->Bands > 1 ) { +- if( im_extract_bands( t[0], t[2], 1, t[0]->Bands - 1 ) ) +- return( -1 ); ++ if (im_extract_band(t[0], t[1], 0)) ++ return (-1); ++ if (t[0]->Bands > 1) { ++ if (im_extract_bands(t[0], t[2], 1, t[0]->Bands - 1)) ++ return (-1); + } + + /* Map L. + */ +- if( im_maplut( t[1], t[3], lut ) ) +- return( -1 ); ++ if (im_maplut(t[1], t[3], lut)) ++ return (-1); + +- /* Recombine bands. ++ /* Recombine bands. + */ +- if( t[0]->Bands > 1 ) { +- if( im_bandjoin( t[3], t[2], t[4] ) ) +- return( -1 ); ++ if (t[0]->Bands > 1) { ++ if (im_bandjoin(t[3], t[2], t[4])) ++ return (-1); + } + else + t[4] = t[3]; + + /* If input was LabQ, repack. + */ +- if( in->Coding == IM_CODING_LABQ ) { +- if( im_LabS2LabQ( t[4], t[5] ) ) +- return( -1 ); ++ if (in->Coding == IM_CODING_LABQ) { ++ if (im_LabS2LabQ(t[4], t[5])) ++ return (-1); + } +- else ++ else + t[5] = t[4]; +- +- return( im_copy( t[4], out ) ); ++ ++ return (im_copy(t[4], out)); + } + + /** + * im_tone_analyse: +- * @in: input image +- * @out: output image ++ * @in: input image ++ * @out: output image + * @Ps: shadow point (eg. 0.2) + * @Pm: mid-tone point (eg. 0.5) + * @Ph: highlight point (eg. 0.8) +@@ -141,48 +141,48 @@ im_tone_map( IMAGE *in, IMAGE *out, IMAGE *lut ) + * + * Returns: 0 on success, -1 on error + */ +-int +-im_tone_analyse( +- IMAGE *in, +- IMAGE *out, ++int ++im_tone_analyse( ++ IMAGE *in, ++ IMAGE *out, + double Ps, double Pm, double Ph, +- double S, double M, double H ) ++ double S, double M, double H) + { + IMAGE *t[4]; + int low, high; + double Lb, Lw; + +- if( im_open_local_array( out, t, 4, "im_tone_map", "p" ) ) +- return( -1 ); ++ if (im_open_local_array(out, t, 4, "im_tone_map", "p")) ++ return (-1); + + /* If in is IM_CODING_LABQ, unpack. + */ +- if( in->Coding == IM_CODING_LABQ ) { +- if( im_LabQ2LabS( in, t[0] ) ) +- return( -1 ); ++ if (in->Coding == IM_CODING_LABQ) { ++ if (im_LabQ2LabS(in, t[0])) ++ return (-1); + } + else + t[0] = in; + + /* Should now be 3-band short. + */ +- if( im_check_uncoded( "im_tone_analyse", t[0] ) || +- im_check_bands( "im_tone_analyse", t[0], 3 ) || +- im_check_format( "im_tone_analyse", t[0], IM_BANDFMT_SHORT ) ) +- return( -1 ); ++ if (im_check_uncoded("im_tone_analyse", t[0]) || ++ im_check_bands("im_tone_analyse", t[0], 3) || ++ im_check_format("im_tone_analyse", t[0], IM_BANDFMT_SHORT)) ++ return (-1); + +- if( im_extract_band( t[0], t[1], 0 ) || +- im_clip2fmt( t[1], t[2], IM_BANDFMT_USHORT ) ) +- return( -1 ); ++ if (im_extract_band(t[0], t[1], 0) || ++ im_clip2fmt(t[1], t[2], IM_BANDFMT_USHORT)) ++ return (-1); + +- if( im_mpercent( t[2], 0.1 / 100.0, &high ) || +- im_mpercent( t[2], 99.9 / 100.0, &low ) ) +- return( -1 ); ++ if (im_mpercent(t[2], 0.1 / 100.0, &high) || ++ im_mpercent(t[2], 99.9 / 100.0, &low)) ++ return (-1); + + Lb = 100 * low / 32768; + Lw = 100 * high / 32768; + +- im_diag( "im_tone_analyse", "set Lb = %g, Lw = %g", Lb, Lw ); ++ im_diag("im_tone_analyse", "set Lb = %g, Lw = %g", Lb, Lw); + +- return( im_tone_build( out, Lb, Lw, Ps, Pm, Ph, S, M, H ) ); ++ return (im_tone_build(out, Lb, Lw, Ps, Pm, Ph, S, M, H)); + } +diff --git a/libvips/deprecated/video_dispatch.c b/libvips/deprecated/video_dispatch.c +index 0aac1d10ae..4c03e5532a 100644 +--- a/libvips/deprecated/video_dispatch.c ++++ b/libvips/deprecated/video_dispatch.c +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -38,7 +38,7 @@ + #include + #include + +-/** ++/** + * SECTION: video + * @short_description: various video grabbers + * @see_also: image +@@ -49,75 +49,73 @@ + */ + + static int +-video_v4l1_vec( im_object *argv ) ++video_v4l1_vec(im_object *argv) + { +- IMAGE *out = argv[0]; +- char *device = (char *) argv[1]; +- int channel = *((int*)argv[2]); +- int brightness = *((int*)argv[3]); +- int colour = *((int*)argv[4]); +- int contrast = *((int*)argv[5]); +- int hue = *((int*)argv[6]); +- int ngrabs = *((int*)argv[7]); +- +- return( im_video_v4l1( out, device, +- channel, brightness, colour, contrast, hue, ngrabs ) ); ++ IMAGE *out = argv[0]; ++ char *device = (char *) argv[1]; ++ int channel = *((int *) argv[2]); ++ int brightness = *((int *) argv[3]); ++ int colour = *((int *) argv[4]); ++ int contrast = *((int *) argv[5]); ++ int hue = *((int *) argv[6]); ++ int ngrabs = *((int *) argv[7]); ++ ++ return (im_video_v4l1(out, device, ++ channel, brightness, colour, contrast, hue, ngrabs)); + } + + static im_arg_desc video_v4l1_arg_types[] = { +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_STRING( "device" ), +- IM_INPUT_INT( "channel" ), +- IM_INPUT_INT( "brightness" ), +- IM_INPUT_INT( "colour" ), +- IM_INPUT_INT( "contrast" ), +- IM_INPUT_INT( "hue" ), +- IM_INPUT_INT( "ngrabs" ) ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_STRING("device"), ++ IM_INPUT_INT("channel"), ++ IM_INPUT_INT("brightness"), ++ IM_INPUT_INT("colour"), ++ IM_INPUT_INT("contrast"), ++ IM_INPUT_INT("hue"), ++ IM_INPUT_INT("ngrabs") + }; + + static im_function video_v4l1_desc = { +- "im_video_v4l1", /* Name */ +- "grab a video frame with v4l1", /* Description */ +- IM_FN_NOCACHE, /* Flags */ +- video_v4l1_vec, /* Dispatch function */ +- IM_NUMBER( video_v4l1_arg_types ), /* Size of arg list */ +- video_v4l1_arg_types /* Arg list */ ++ "im_video_v4l1", /* Name */ ++ "grab a video frame with v4l1", /* Description */ ++ IM_FN_NOCACHE, /* Flags */ ++ video_v4l1_vec, /* Dispatch function */ ++ IM_NUMBER(video_v4l1_arg_types), /* Size of arg list */ ++ video_v4l1_arg_types /* Arg list */ + }; + + static int +-video_test_vec( im_object *argv ) ++video_test_vec(im_object *argv) + { +- IMAGE *out = argv[0]; +- int brightness = *((int*)argv[1]); +- int error = *((int*)argv[2]); ++ IMAGE *out = argv[0]; ++ int brightness = *((int *) argv[1]); ++ int error = *((int *) argv[2]); + +- return( im_video_test( out, brightness, error ) ); ++ return (im_video_test(out, brightness, error)); + } + + static im_arg_desc video_test_arg_types[] = { +- IM_OUTPUT_IMAGE( "out" ), +- IM_INPUT_INT( "brightness" ), +- IM_INPUT_INT( "error" ) ++ IM_OUTPUT_IMAGE("out"), ++ IM_INPUT_INT("brightness"), ++ IM_INPUT_INT("error") + }; + + static im_function video_test_desc = { +- "im_video_test", /* Name */ +- "test video grabber", /* Description */ +- IM_FN_NOCACHE, /* Flags */ +- video_test_vec, /* Dispatch function */ +- IM_NUMBER( video_test_arg_types ), /* Size of arg list */ +- video_test_arg_types /* Arg list */ ++ "im_video_test", /* Name */ ++ "test video grabber", /* Description */ ++ IM_FN_NOCACHE, /* Flags */ ++ video_test_vec, /* Dispatch function */ ++ IM_NUMBER(video_test_arg_types), /* Size of arg list */ ++ video_test_arg_types /* Arg list */ + }; + + static im_function *video_list[] = { +- &video_test_desc, +- &video_v4l1_desc ++ &video_test_desc, ++ &video_v4l1_desc + }; + + im_package im__video = { +- "video", /* Package name */ +- IM_NUMBER( video_list ), /* Function list */ +- video_list ++ "video", /* Package name */ ++ IM_NUMBER(video_list), /* Function list */ ++ video_list + }; +- +- +diff --git a/libvips/deprecated/vips7compat.c b/libvips/deprecated/vips7compat.c +index 128a91199b..84a73ac9cf 100644 +--- a/libvips/deprecated/vips7compat.c ++++ b/libvips/deprecated/vips7compat.c +@@ -1,33 +1,33 @@ + /* compat stuff for vips7 +- * ++ * + * 4/3/11 +- * - hacked up ++ * - hacked up + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -73,92 +73,92 @@ + * C:\fixtures\2569067123_aca715a2ee_o.jpg + * -> C:\fixtures\2569067123_aca715a2ee_o.jpg "" + * +- * vips8 handles this in a much better way :( ++ * vips8 handles this in a much better way :( + */ + void +-im_filename_split( const char *path, char *name, char *mode ) ++im_filename_split(const char *path, char *name, char *mode) + { +- char *p; ++ char *p; + size_t len; + +- vips_strncpy( name, path, FILENAME_MAX ); +- strcpy( mode, "" ); ++ vips_strncpy(name, path, FILENAME_MAX); ++ strcpy(mode, ""); + +- if( (len = strlen( name )) == 0 ) +- return; ++ if ((len = strlen(name)) == 0) ++ return; + + /* Search backwards towards start, stopping at each ':' char. + */ +- for( p = name + len - 1; p > name; p -= 1 ) +- if( *p == ':' ) { ++ for (p = name + len - 1; p > name; p -= 1) ++ if (*p == ':') { + char *q; + + /* We are skipping back over the file extension, + * isalnum() is probably sufficient. + */ +- for( q = p - 1; isalnum( *q ) && q > name; q -= 1 ) ++ for (q = p - 1; isalnum(*q) && q > name; q -= 1) + ; + +- if( *q == '.' ) { ++ if (*q == '.') { + break; + } + + /* All the way back to the start? We probably have a + * filename with no extension, eg. "I180:" + */ +- if( q == name ) ++ if (q == name) + break; + + /* .. or we could hit a dirsep. Allow win or nix + * separators. + */ +- if( *q == '/' || +- *q == '\\' ) ++ if (*q == '/' || ++ *q == '\\') + break; + } + + /* Ignore a ':' in column 1, it's probably a drive letter on a +- * Windows path. ++ * Windows path. + */ +- if( *p == ':' && +- p - name != 1 ) { +- vips_strncpy( mode, p + 1, FILENAME_MAX ); +- *p = '\0'; +- } ++ if (*p == ':' && ++ p - name != 1) { ++ vips_strncpy(mode, p + 1, FILENAME_MAX); ++ *p = '\0'; ++ } + } + +-/** ++/** + * vips_path_filename7: + * @path: path to split + * + * Return the filename part of a vips7 path. For testing only. + */ + char * +-vips_path_filename7( const char *path ) ++vips_path_filename7(const char *path) + { + char name[FILENAME_MAX]; + char mode[FILENAME_MAX]; + +- im_filename_split( path, name, mode ); ++ im_filename_split(path, name, mode); + +- return( g_strdup( name ) ); ++ return (g_strdup(name)); + } + +-/** ++/** + * vips_path_mode7: + * @path: path to split + * + * Return the mode part of a vips7 path. For testing only. + */ + char * +-vips_path_mode7( const char *path ) ++vips_path_mode7(const char *path) + { + char name[FILENAME_MAX]; + char mode[FILENAME_MAX]; + +- im_filename_split( path, name, mode ); ++ im_filename_split(path, name, mode); + +- return( g_strdup( mode ) ); ++ return (g_strdup(mode)); + } + + /* Skip any leading path stuff. Horrible: if this is a filename which came +@@ -170,12 +170,12 @@ vips_path_mode7( const char *path ) + * either, just return the filename. + */ + const char * +-im_skip_dir( const char *path ) ++im_skip_dir(const char *path) + { + char name[FILENAME_MAX]; + char mode[FILENAME_MAX]; +- const char *p; +- const char *q; ++ const char *p; ++ const char *q; + + const char native_dir_sep = G_DIR_SEPARATOR; + const char non_native_dir_sep = native_dir_sep == '/' ? '\\' : '/'; +@@ -183,55 +183,55 @@ im_skip_dir( const char *path ) + /* Remove any trailing save modifiers: we don't want '/' or '\' in the + * modifier confusing us. + */ +- im_filename_split( path, name, mode ); ++ im_filename_split(path, name, mode); + + /* The '\0' char at the end of the string. + */ +- p = name + strlen( name ); ++ p = name + strlen(name); + + /* Search back for the first native dir sep, or failing that, the first + * non-native dir sep. + */ +- for( q = p; q > name && q[-1] != native_dir_sep; q-- ) ++ for (q = p; q > name && q[-1] != native_dir_sep; q--) + ; +- if( q == name ) +- for( q = p; q > name && q[-1] != non_native_dir_sep; q-- ) ++ if (q == name) ++ for (q = p; q > name && q[-1] != non_native_dir_sep; q--) + ; + +- return( path + (q - name) ); ++ return (path + (q - name)); + } + + /* Extract suffix from filename, ignoring any mode string. Suffix should be + * FILENAME_MAX chars. Include the "." character, if any. + */ + void +-im_filename_suffix( const char *path, char *suffix ) ++im_filename_suffix(const char *path, char *suffix) + { + char name[FILENAME_MAX]; + char mode[FILENAME_MAX]; +- char *p; ++ char *p; + +- im_filename_split( path, name, mode ); +- if( (p = strrchr( name, '.' )) ) +- strcpy( suffix, p ); +- else +- strcpy( suffix, "" ); ++ im_filename_split(path, name, mode); ++ if ((p = strrchr(name, '.'))) ++ strcpy(suffix, p); ++ else ++ strcpy(suffix, ""); + } + + /* Does a filename have one of a set of suffixes. Ignore case. + */ + int +-im_filename_suffix_match( const char *path, const char *suffixes[] ) ++im_filename_suffix_match(const char *path, const char *suffixes[]) + { + char suffix[FILENAME_MAX]; + const char **p; + +- im_filename_suffix( path, suffix ); +- for( p = suffixes; *p; p++ ) +- if( g_ascii_strcasecmp( suffix, *p ) == 0 ) +- return( 1 ); ++ im_filename_suffix(path, suffix); ++ for (p = suffixes; *p; p++) ++ if (g_ascii_strcasecmp(suffix, *p) == 0) ++ return (1); + +- return( 0 ); ++ return (0); + } + + /* p points to the start of a buffer ... move it on through the buffer (ready +@@ -239,61 +239,61 @@ im_filename_suffix_match( const char *path, const char *suffixes[] ) + * missing). ',' characters inside options can be escaped with a '\'. + */ + char * +-im_getnextoption( char **in ) ++im_getnextoption(char **in) + { +- char *p; +- char *q; ++ char *p; ++ char *q; + +- p = *in; +- q = p; ++ p = *in; ++ q = p; + +- if( !p || !*p ) +- return( NULL ); ++ if (!p || !*p) ++ return (NULL); + + /* Find the next ',' not prefixed with a '\'. If the first character + * of p is ',', there can't be a previous escape character. + */ +- for(;;) { +- if( !(p = strchr( p, ',' )) ) ++ for (;;) { ++ if (!(p = strchr(p, ','))) + break; +- if( p == q ) ++ if (p == q) + break; +- if( p[-1] != '\\' ) ++ if (p[-1] != '\\') + break; + + p += 1; + } + +- if( p ) { +- /* Another option follows this one .. set up to pick that out +- * next time. +- */ +- *p = '\0'; +- *in = p + 1; +- } +- else { +- /* This is the last one. +- */ +- *in = NULL; +- } ++ if (p) { ++ /* Another option follows this one .. set up to pick that out ++ * next time. ++ */ ++ *p = '\0'; ++ *in = p + 1; ++ } ++ else { ++ /* This is the last one. ++ */ ++ *in = NULL; ++ } + +- if( strlen( q ) > 0 ) +- return( q ); +- else +- return( NULL ); ++ if (strlen(q) > 0) ++ return (q); ++ else ++ return (NULL); + } + + /* Get a suboption string, or NULL. + */ + char * +-im_getsuboption( const char *buf ) ++im_getsuboption(const char *buf) + { +- char *p, *q, *r; ++ char *p, *q, *r; + +- if( !(p = strchr( buf, ':' )) ) ++ if (!(p = strchr(buf, ':'))) + /* No suboption. + */ +- return( NULL ); ++ return (NULL); + + /* Step over the ':'. + */ +@@ -301,76 +301,76 @@ im_getsuboption( const char *buf ) + + /* Need to unescape any \, pairs. Shift stuff down one if we find one. + */ +- for( q = p; *q; q++ ) +- if( q[0] == '\\' && q[1] == ',' ) +- for( r = q; *r; r++ ) ++ for (q = p; *q; q++) ++ if (q[0] == '\\' && q[1] == ',') ++ for (r = q; *r; r++) + r[0] = r[1]; + +- return( p ); ++ return (p); + } + + VipsImage * +-im_open( const char *filename, const char *mode ) ++im_open(const char *filename, const char *mode) + { + VipsImage *image; + +- vips_check_init(); ++ vips_check_init(); + + /* We have to go via the old VipsFormat system so we can support the + * "filename:option" syntax. + * + * Use "rs" to turn on seq mode. + */ +- if( strcmp( mode, "r" ) == 0 || +- strcmp( mode, "rd" ) == 0 ) { +- if( !(image = vips__deprecated_open_read( filename, FALSE )) ) +- return( NULL ); ++ if (strcmp(mode, "r") == 0 || ++ strcmp(mode, "rd") == 0) { ++ if (!(image = vips__deprecated_open_read(filename, FALSE))) ++ return (NULL); + } +- else if( strcmp( mode, "rs" ) == 0 ) { +- if( !(image = vips__deprecated_open_read( filename, TRUE )) ) +- return( NULL ); ++ else if (strcmp(mode, "rs") == 0) { ++ if (!(image = vips__deprecated_open_read(filename, TRUE))) ++ return (NULL); + } +- else if( strcmp( mode, "w" ) == 0 ) { +- if( !(image = vips__deprecated_open_write( filename )) ) +- return( NULL ); ++ else if (strcmp(mode, "w") == 0) { ++ if (!(image = vips__deprecated_open_write(filename))) ++ return (NULL); + } + else { +- if( !(image = vips_image_new_mode( filename, mode )) ) +- return( NULL ); ++ if (!(image = vips_image_new_mode(filename, mode))) ++ return (NULL); + } + +- return( image ); ++ return (image); + } + + /* Just for compatibility. New code should use vips_object_local() directly. + */ + VipsImage * +-im_open_local( VipsImage *parent, +- const char *filename, const char *mode ) ++im_open_local(VipsImage *parent, ++ const char *filename, const char *mode) + { + VipsImage *image; + +- if( !(image = im_open( filename, mode )) ) +- return( NULL ); +- vips_object_local( parent, image ); ++ if (!(image = im_open(filename, mode))) ++ return (NULL); ++ vips_object_local(parent, image); + +- return( image ); ++ return (image); + } + + /* Just for compatibility. New code should use vips_object_local_array(). + */ + int +-im_open_local_array( VipsImage *parent, ++im_open_local_array(VipsImage *parent, + VipsImage **images, int n, +- const char *filename, const char *mode ) ++ const char *filename, const char *mode) + { + int i; + +- for( i = 0; i < n; i++ ) +- if( !(images[i] = im_open_local( parent, filename, mode )) ) +- return( -1 ); ++ for (i = 0; i < n; i++) ++ if (!(images[i] = im_open_local(parent, filename, mode))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + typedef struct { +@@ -380,110 +380,110 @@ typedef struct { + } Callback; + + static void +-im_add_callback_cb( VipsImage *im, Callback *callback ) ++im_add_callback_cb(VipsImage *im, Callback *callback) + { +- if( callback->fn( callback->a, callback->b ) ) +- vips_image_set_kill( im, TRUE ); ++ if (callback->fn(callback->a, callback->b)) ++ vips_image_set_kill(im, TRUE); + } + +-int +-im_add_callback( VipsImage *im, +- const char *name, im_callback_fn fn, void *a, void *b ) ++int ++im_add_callback(VipsImage *im, ++ const char *name, im_callback_fn fn, void *a, void *b) + { + Callback *callback; + +- callback = VIPS_NEW( VIPS_OBJECT( im ), Callback ); ++ callback = VIPS_NEW(VIPS_OBJECT(im), Callback); + callback->fn = fn; + callback->a = a; + callback->b = b; +- g_signal_connect( im, name, +- G_CALLBACK( im_add_callback_cb ), callback ); ++ g_signal_connect(im, name, ++ G_CALLBACK(im_add_callback_cb), callback); + +- return( 0 ); ++ return (0); + } + + static void +-im_add_callback_cb1( VipsImage *im, void *x, Callback *callback ) ++im_add_callback_cb1(VipsImage *im, void *x, Callback *callback) + { +- if( callback->fn( callback->a, callback->b ) ) +- vips_image_set_kill( im, TRUE ); ++ if (callback->fn(callback->a, callback->b)) ++ vips_image_set_kill(im, TRUE); + } + +-int +-im_add_callback1( VipsImage *im, +- const char *name, im_callback_fn fn, void *a, void *b ) ++int ++im_add_callback1(VipsImage *im, ++ const char *name, im_callback_fn fn, void *a, void *b) + { + Callback *callback; + +- callback = VIPS_NEW( VIPS_OBJECT( im ), Callback ); ++ callback = VIPS_NEW(VIPS_OBJECT(im), Callback); + callback->fn = fn; + callback->a = a; + callback->b = b; +- g_signal_connect( im, name, +- G_CALLBACK( im_add_callback_cb1 ), callback ); ++ g_signal_connect(im, name, ++ G_CALLBACK(im_add_callback_cb1), callback); + +- return( 0 ); ++ return (0); + } + + /* Make something local to an image descriptor ... pass in a constructor + * and a destructor, plus three args. + */ + void * +-im_local( IMAGE *im, +- im_construct_fn cons, im_callback_fn dest, void *a, void *b, void *c ) ++im_local(IMAGE *im, ++ im_construct_fn cons, im_callback_fn dest, void *a, void *b, void *c) + { + void *obj; + +- if( !im ) { +- im_error( "im_local", "%s", _( "NULL image descriptor" ) ); +- return( NULL ); ++ if (!im) { ++ im_error("im_local", "%s", _("NULL image descriptor")); ++ return (NULL); ++ } ++ ++ if (!(obj = cons(a, b, c))) ++ return (NULL); ++ if (im_add_close_callback(im, (im_callback_fn) dest, obj, a)) { ++ dest(obj, a); ++ return (NULL); + } + +- if( !(obj = cons( a, b, c )) ) +- return( NULL ); +- if( im_add_close_callback( im, (im_callback_fn) dest, obj, a ) ) { +- dest( obj, a ); +- return( NULL ); +- } +- +- return( obj ); ++ return (obj); + } + + /* Make an array of things local to a descriptor ... eg. make 6 local temp + * images. + */ + int +-im_local_array( IMAGE *im, void **out, int n, +- im_construct_fn cons, im_callback_fn dest, void *a, void *b, void *c ) ++im_local_array(IMAGE *im, void **out, int n, ++ im_construct_fn cons, im_callback_fn dest, void *a, void *b, void *c) + { + int i; + +- for( i = 0; i < n; i++ ) +- if( !(out[i] = im_local( im, cons, dest, a, b, c )) ) +- return( -1 ); ++ for (i = 0; i < n; i++) ++ if (!(out[i] = im_local(im, cons, dest, a, b, c))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-im_close( VipsImage *im ) ++im_close(VipsImage *im) + { +- g_object_unref( im ); ++ g_object_unref(im); + +- return( 0 ); ++ return (0); + } + + /* edvips.c needs this + */ + VipsImage * +-im_init( const char *filename ) ++im_init(const char *filename) + { + VipsImage *image; + + image = vips_image_new(); +- IM_SETSTR( image->filename, filename ); ++ IM_SETSTR(image->filename, filename); + +- return( image ); ++ return (image); + } + + /* We can't do this with a rename macro since the C++ interface needs +@@ -492,76 +492,91 @@ im_init( const char *filename ) + * As a result our fancy ABI check will not work with the vips7 interface. + */ + int +-im_init_world( const char *argv0 ) ++im_init_world(const char *argv0) + { +- return( vips_init( argv0 ) ); ++ return (vips_init(argv0)); + } + + /* Prettyprint various header fields. Just for vips7 compat, use + * vips_enum_value() instead. + */ +-const char *im_Type2char( VipsInterpretation type ) +- { return( vips_enum_string( VIPS_TYPE_INTERPRETATION, type ) ); } +-const char *im_BandFmt2char( VipsBandFormat format ) +- { return( vips_enum_string( VIPS_TYPE_BAND_FORMAT, format ) ); } +-const char *im_Coding2char( VipsCoding coding ) +- { return( vips_enum_string( VIPS_TYPE_CODING, coding ) ); } +-const char *im_dtype2char( VipsImageType n ) +- { return( vips_enum_string( VIPS_TYPE_IMAGE_TYPE, n ) ); } +-const char *im_dhint2char( VipsDemandStyle style ) +- { return( vips_enum_string( VIPS_TYPE_DEMAND_STYLE, style ) ); } ++const char * ++im_Type2char(VipsInterpretation type) ++{ ++ return (vips_enum_string(VIPS_TYPE_INTERPRETATION, type)); ++} ++const char * ++im_BandFmt2char(VipsBandFormat format) ++{ ++ return (vips_enum_string(VIPS_TYPE_BAND_FORMAT, format)); ++} ++const char * ++im_Coding2char(VipsCoding coding) ++{ ++ return (vips_enum_string(VIPS_TYPE_CODING, coding)); ++} ++const char * ++im_dtype2char(VipsImageType n) ++{ ++ return (vips_enum_string(VIPS_TYPE_IMAGE_TYPE, n)); ++} ++const char * ++im_dhint2char(VipsDemandStyle style) ++{ ++ return (vips_enum_string(VIPS_TYPE_DEMAND_STYLE, style)); ++} + + /* Old names for enums, for compat. + */ + static const char *im_Type[] = { +- "IM_TYPE_MULTIBAND", /* 0 */ +- "IM_TYPE_B_W", /* 1 */ +- "LUMINACE", /* 2 */ +- "XRAY", /* 3 */ +- "IR", /* 4 */ +- "YUV", /* 5 */ +- "RED_ONLY", /* 6 */ +- "GREEN_ONLY", /* 7 */ +- "BLUE_ONLY", /* 8 */ +- "POWER_SPECTRUM", /* 9 */ +- "IM_TYPE_HISTOGRAM", /* 10 */ +- "LUT", /* 11 */ +- "IM_TYPE_XYZ", /* 12 */ +- "IM_TYPE_LAB", /* 13 */ +- "CMC", /* 14 */ +- "IM_TYPE_CMYK", /* 15 */ +- "IM_TYPE_LABQ", /* 15 */ +- "IM_TYPE_RGB", /* 17 */ +- "IM_TYPE_UCS", /* 18 */ +- "IM_TYPE_LCH", /* 19 */ +- "IM_TYPE_LABS", /* 20 */ +- "", /* 21 */ +- "IM_TYPE_sRGB", /* 22 */ +- "IM_TYPE_YXY", /* 23 */ +- "IM_TYPE_FOURIER", /* 24 */ +- "IM_TYPE_RGB16", /* 25 */ +- "IM_TYPE_GREY16", /* 26 */ ++ "IM_TYPE_MULTIBAND", /* 0 */ ++ "IM_TYPE_B_W", /* 1 */ ++ "LUMINACE", /* 2 */ ++ "XRAY", /* 3 */ ++ "IR", /* 4 */ ++ "YUV", /* 5 */ ++ "RED_ONLY", /* 6 */ ++ "GREEN_ONLY", /* 7 */ ++ "BLUE_ONLY", /* 8 */ ++ "POWER_SPECTRUM", /* 9 */ ++ "IM_TYPE_HISTOGRAM", /* 10 */ ++ "LUT", /* 11 */ ++ "IM_TYPE_XYZ", /* 12 */ ++ "IM_TYPE_LAB", /* 13 */ ++ "CMC", /* 14 */ ++ "IM_TYPE_CMYK", /* 15 */ ++ "IM_TYPE_LABQ", /* 15 */ ++ "IM_TYPE_RGB", /* 17 */ ++ "IM_TYPE_UCS", /* 18 */ ++ "IM_TYPE_LCH", /* 19 */ ++ "IM_TYPE_LABS", /* 20 */ ++ "", /* 21 */ ++ "IM_TYPE_sRGB", /* 22 */ ++ "IM_TYPE_YXY", /* 23 */ ++ "IM_TYPE_FOURIER", /* 24 */ ++ "IM_TYPE_RGB16", /* 25 */ ++ "IM_TYPE_GREY16", /* 26 */ + NULL + }; + + static const char *im_BandFmt[] = { +- "IM_BANDFMT_UCHAR", +- "IM_BANDFMT_CHAR", +- "IM_BANDFMT_USHORT", +- "IM_BANDFMT_SHORT", +- "IM_BANDFMT_UINT", +- "IM_BANDFMT_INT", +- "IM_BANDFMT_FLOAT", +- "IM_BANDFMT_COMPLEX", +- "IM_BANDFMT_DOUBLE", ++ "IM_BANDFMT_UCHAR", ++ "IM_BANDFMT_CHAR", ++ "IM_BANDFMT_USHORT", ++ "IM_BANDFMT_SHORT", ++ "IM_BANDFMT_UINT", ++ "IM_BANDFMT_INT", ++ "IM_BANDFMT_FLOAT", ++ "IM_BANDFMT_COMPLEX", ++ "IM_BANDFMT_DOUBLE", + "IM_BANDFMT_DPCOMPLEX", + NULL + }; + + static const char *im_Coding[] = { +- "IM_CODING_NONE", +- "COLQUANT8", +- "IM_CODING_LABQ", ++ "IM_CODING_NONE", ++ "COLQUANT8", ++ "IM_CODING_LABQ", + "IM_CODING_LABQ_COMPRESSED", + "RGB_COMPRESSED", + "LUM_COMPRESSED", +@@ -570,21 +585,21 @@ static const char *im_Coding[] = { + }; + + static const char *im_dtype[] = { +- "IM_NONE", +- "IM_SETBUF", +- "IM_SETBUF_FOREIGN", +- "IM_OPENIN", +- "IM_MMAPIN", +- "IM_MMAPINRW", +- "IM_OPENOUT", ++ "IM_NONE", ++ "IM_SETBUF", ++ "IM_SETBUF_FOREIGN", ++ "IM_OPENIN", ++ "IM_MMAPIN", ++ "IM_MMAPINRW", ++ "IM_OPENOUT", + "IM_PARTIAL", + NULL + }; + + static const char *im_dhint[] = { +- "IM_SMALLTILE", +- "IM_FATSTRIP", +- "IM_THINSTRIP", ++ "IM_SMALLTILE", ++ "IM_FATSTRIP", ++ "IM_THINSTRIP", + "IM_ANY", + NULL + }; +@@ -593,47 +608,70 @@ static const char *im_dhint[] = { + * names. + */ + static int +-lookup_enum( GType type, const char *names[], const char *name ) ++lookup_enum(GType type, const char *names[], const char *name) + { + GEnumClass *class; + GEnumValue *value; + int i; + +- class = g_type_class_ref( type ); +- if( (value = g_enum_get_value_by_nick( class, name )) ) +- return( value->value ); +- if( (value = g_enum_get_value_by_name( class, name )) ) +- return( value->value ); ++ class = g_type_class_ref(type); ++ if ((value = g_enum_get_value_by_nick(class, name))) ++ return (value->value); ++ if ((value = g_enum_get_value_by_name(class, name))) ++ return (value->value); + +- for( i = 0; names[i]; i++ ) +- if( g_ascii_strcasecmp( names[i], name ) == 0 ) +- return( i ); ++ for (i = 0; names[i]; i++) ++ if (g_ascii_strcasecmp(names[i], name) == 0) ++ return (i); + +- return( -1 ); ++ return (-1); + } + +-VipsInterpretation im_char2Type( const char *str ) +- { return( lookup_enum( VIPS_TYPE_INTERPRETATION, im_Type, str ) ); } +-VipsBandFormat im_char2BandFmt( const char *str ) +- { return( lookup_enum( VIPS_TYPE_BAND_FORMAT, im_BandFmt, str ) ); } +-VipsCoding im_char2Coding( const char *str ) +- { return( lookup_enum( VIPS_TYPE_CODING, im_Coding, str ) ); } +-VipsImageType im_char2dtype( const char *str ) +- { return( lookup_enum( VIPS_TYPE_IMAGE_TYPE, im_dtype, str ) ); } +-VipsDemandStyle im_char2dhint( const char *str ) +- { return( lookup_enum( VIPS_TYPE_DEMAND_STYLE, im_dhint, str ) ); } ++VipsInterpretation ++im_char2Type(const char *str) ++{ ++ return (lookup_enum(VIPS_TYPE_INTERPRETATION, im_Type, str)); ++} ++VipsBandFormat ++im_char2BandFmt(const char *str) ++{ ++ return (lookup_enum(VIPS_TYPE_BAND_FORMAT, im_BandFmt, str)); ++} ++VipsCoding ++im_char2Coding(const char *str) ++{ ++ return (lookup_enum(VIPS_TYPE_CODING, im_Coding, str)); ++} ++VipsImageType ++im_char2dtype(const char *str) ++{ ++ return (lookup_enum(VIPS_TYPE_IMAGE_TYPE, im_dtype, str)); ++} ++VipsDemandStyle ++im_char2dhint(const char *str) ++{ ++ return (lookup_enum(VIPS_TYPE_DEMAND_STYLE, im_dhint, str)); ++} + + /* Totally useless now. + */ +-const char *im_Compression2char( int n ) { return( "NONE" ); } +-int im_char2Compression( const char *str ) { return( -1 ); } ++const char * ++im_Compression2char(int n) ++{ ++ return ("NONE"); ++} ++int ++im_char2Compression(const char *str) ++{ ++ return (-1); ++} + + /* Wrap one / many is being replaced by a class thing. + */ + + typedef struct { +- im_wrapmany_fn fn; /* Function we call */ +- void *a, *b; /* User values for function */ ++ im_wrapmany_fn fn; /* Function we call */ ++ void *a, *b; /* User values for function */ + } Bundle; + + /* Maximum number of input images -- why not? +@@ -643,7 +681,7 @@ typedef struct { + /* Convert a VipsRegion. + */ + static int +-process_region( VipsRegion *or, void *seq, void *a, void *b ) ++process_region(VipsRegion * or, void *seq, void *a, void *b) + { + VipsRegion **ir = (VipsRegion **) seq; + Bundle *bun = (Bundle *) b; +@@ -653,78 +691,78 @@ process_region( VipsRegion *or, void *seq, void *a, void *b ) + + /* Prepare all input regions and make buffer pointers. + */ +- if( vips_reorder_prepare_many( or->im, ir, &or->valid ) ) +- return( -1 ); +- for( i = 0; ir[i]; i++ ) +- p[i] = (PEL *) VIPS_REGION_ADDR( ir[i], +- or->valid.left, or->valid.top ); ++ if (vips_reorder_prepare_many(or->im, ir, & or->valid)) ++ return (-1); ++ for (i = 0; ir[i]; i++) ++ p[i] = (PEL *) VIPS_REGION_ADDR(ir[i], ++ or->valid.left, or->valid.top); + p[i] = NULL; +- q = (PEL *) VIPS_REGION_ADDR( or, or->valid.left, or->valid.top ); ++ q = (PEL *) VIPS_REGION_ADDR(or, or->valid.left, or->valid.top); + + /* Convert linewise. + */ +- for( y = 0; y < or->valid.height; y++ ) { ++ for (y = 0; y < or->valid.height; y++) { + PEL *p1[MAX_INPUT_IMAGES]; + + /* Make a copy of p[] which the buffer function can mess up if + * it wants. + */ +- for( i = 0; ir[i]; i++ ) ++ for (i = 0; ir[i]; i++) + p1[i] = p[i]; + + /* Bizarre double-cast stops a bogus gcc 4.1 compiler warning. + */ +- bun->fn( (void **) ((void *)p1), q, +- or->valid.width, bun->a, bun->b ); ++ bun->fn((void **) ((void *) p1), q, ++ or->valid.width, bun->a, bun->b); + + /* Move pointers on. + */ +- for( i = 0; ir[i]; i++ ) +- p[i] += VIPS_REGION_LSKIP( ir[i] ); +- q += VIPS_REGION_LSKIP( or ); ++ for (i = 0; ir[i]; i++) ++ p[i] += VIPS_REGION_LSKIP(ir[i]); ++ q += VIPS_REGION_LSKIP(or); + } + +- return( 0 ); ++ return (0); + } + + /* Make a copy of an array of input images. + */ + static IMAGE ** +-dupims( IMAGE *out, IMAGE **in ) ++dupims(IMAGE *out, IMAGE **in) + { + IMAGE **new; + int i, n; + +- for( n = 0; in[n]; n++ ) ++ for (n = 0; in[n]; n++) + ; +- new = VIPS_ARRAY( VIPS_OBJECT( out ), n + 1, IMAGE * ); +- for( i = 0; i < n; i++ ) ++ new = VIPS_ARRAY(VIPS_OBJECT(out), n + 1, IMAGE *); ++ for (i = 0; i < n; i++) + new[i] = in[i]; + new[n] = NULL; + +- return( new ); ++ return (new); + } + + int +-im_wrapmany( IMAGE **in, IMAGE *out, im_wrapmany_fn fn, void *a, void *b ) ++im_wrapmany(IMAGE **in, IMAGE *out, im_wrapmany_fn fn, void *a, void *b) + { + Bundle *bun; + int i, n; + + /* Count input images. + */ +- for( n = 0; in[n]; n++ ) ++ for (n = 0; in[n]; n++) + ; +- if( n >= MAX_INPUT_IMAGES - 1 ) { +- vips_error( "im_wrapmany", "%s", _( "too many input images" ) ); +- return( -1 ); ++ if (n >= MAX_INPUT_IMAGES - 1) { ++ vips_error("im_wrapmany", "%s", _("too many input images")); ++ return (-1); + } + + /* Save args. + */ +- bun = VIPS_NEW( VIPS_OBJECT( out ), Bundle ); +- if( !(in = dupims( out, in )) ) +- return( -1 ); ++ bun = VIPS_NEW(VIPS_OBJECT(out), Bundle); ++ if (!(in = dupims(out, in))) ++ return (-1); + bun->fn = fn; + bun->a = a; + bun->b = b; +@@ -732,82 +770,85 @@ im_wrapmany( IMAGE **in, IMAGE *out, im_wrapmany_fn fn, void *a, void *b ) + /* Check descriptors --- make sure that our caller has done this + * correctly. + */ +- for( i = 0; i < n; i++ ) { +- if( in[i]->Xsize != out->Xsize || in[i]->Ysize != out->Ysize ) { +- vips_error( "im_wrapmany", +- "%s", _( "descriptors differ in size" ) ); +- return( -1 ); ++ for (i = 0; i < n; i++) { ++ if (in[i]->Xsize != out->Xsize || in[i]->Ysize != out->Ysize) { ++ vips_error("im_wrapmany", ++ "%s", _("descriptors differ in size")); ++ return (-1); + } + + /* Check io style. + */ +- if( vips_image_pio_input( in[i] ) ) +- return( -1 ); ++ if (vips_image_pio_input(in[i])) ++ return (-1); + } + + /* Don't call vips_image_pipeline_array(), we don't want to copy + * fields. + */ +- vips__demand_hint_array( out, VIPS_DEMAND_STYLE_THINSTRIP, in ); +- if( vips__reorder_set_input( out, in ) ) +- return( -1 ); ++ vips__demand_hint_array(out, VIPS_DEMAND_STYLE_THINSTRIP, in); ++ if (vips__reorder_set_input(out, in)) ++ return (-1); + + /* Generate! + */ +- if( vips_image_generate( out, +- vips_start_many, (VipsGenerateFn) process_region, +- vips_stop_many, in, bun ) ) +- return( -1 ); ++ if (vips_image_generate(out, ++ vips_start_many, (VipsGenerateFn) process_region, ++ vips_stop_many, in, bun)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-wrapone_gen( void **ins, void *out, int width, Bundle *bun, void *dummy ) ++wrapone_gen(void **ins, void *out, int width, Bundle *bun, void *dummy) + { +- ((im_wrapone_fn) (bun->fn)) (ins[0], out, width, bun->a, bun->b ); ++ ((im_wrapone_fn) (bun->fn))(ins[0], out, width, bun->a, bun->b); + } + + int +-im_wrapone( IMAGE *in, IMAGE *out, im_wrapone_fn fn, void *a, void *b ) ++im_wrapone(IMAGE *in, IMAGE *out, im_wrapone_fn fn, void *a, void *b) + { + Bundle *bun; + IMAGE *invec[2]; + + /* Heh, yuk. We cast back above. + */ +- bun = VIPS_NEW( VIPS_OBJECT( out ), Bundle ); ++ bun = VIPS_NEW(VIPS_OBJECT(out), Bundle); + bun->fn = (im_wrapmany_fn) fn; + bun->a = a; + bun->b = b; +- invec[0] = in; invec[1] = NULL; ++ invec[0] = in; ++ invec[1] = NULL; + +- return( im_wrapmany( invec, out, +- (im_wrapmany_fn) wrapone_gen, bun, NULL ) ); ++ return (im_wrapmany(invec, out, ++ (im_wrapmany_fn) wrapone_gen, bun, NULL)); + } + + static void +-wraptwo_gen( void **ins, void *out, int width, Bundle *bun, void *dummy ) ++wraptwo_gen(void **ins, void *out, int width, Bundle *bun, void *dummy) + { +- ((im_wraptwo_fn) (bun->fn)) (ins[0], ins[1], out, +- width, bun->a, bun->b ); ++ ((im_wraptwo_fn) (bun->fn))(ins[0], ins[1], out, ++ width, bun->a, bun->b); + } + + int +-im_wraptwo( IMAGE *in1, IMAGE *in2, IMAGE *out, +- im_wraptwo_fn fn, void *a, void *b ) ++im_wraptwo(IMAGE *in1, IMAGE *in2, IMAGE *out, ++ im_wraptwo_fn fn, void *a, void *b) + { + Bundle *bun; + IMAGE *invec[3]; + +- bun = VIPS_NEW( VIPS_OBJECT( out ), Bundle ); ++ bun = VIPS_NEW(VIPS_OBJECT(out), Bundle); + bun->fn = (im_wrapmany_fn) fn; + bun->a = a; + bun->b = b; +- invec[0] = in1; invec[1] = in2; invec[2] = NULL; ++ invec[0] = in1; ++ invec[1] = in2; ++ invec[2] = NULL; + +- return( im_wrapmany( invec, out, +- (im_wrapmany_fn) wraptwo_gen, bun, NULL ) ); ++ return (im_wrapmany(invec, out, ++ (im_wrapmany_fn) wraptwo_gen, bun, NULL)); + } + + /* Save a bit of typing. +@@ -827,68 +868,67 @@ im_wraptwo( IMAGE *in1, IMAGE *in2, IMAGE *out, + * full range of both. + */ + static int bandfmt_largest[6][6] = { +- /* UC C US S UI I */ +-/* UC */ { UC, S, US, S, UI, I }, +-/* C */ { S, C, I, S, I, I }, +-/* US */ { US, I, US, I, UI, I }, +-/* S */ { S, S, I, S, I, I }, +-/* UI */ { UI, I, UI, I, UI, I }, +-/* I */ { I, I, I, I, I, I } ++ /* UC C US S UI I */ ++ /* UC */ { UC, S, US, S, UI, I }, ++ /* C */ { S, C, I, S, I, I }, ++ /* US */ { US, I, US, I, UI, I }, ++ /* S */ { S, S, I, S, I, I }, ++ /* UI */ { UI, I, UI, I, UI, I }, ++ /* I */ { I, I, I, I, I, I } + }; + + /* For two formats, find one which can represent the full range of both. + */ + static VipsBandFmt +-im__format_common( VipsBandFmt in1, VipsBandFmt in2 ) ++im__format_common(VipsBandFmt in1, VipsBandFmt in2) + { +- if( vips_band_format_iscomplex( in1 ) || +- vips_band_format_iscomplex( in2 ) ) { ++ if (vips_band_format_iscomplex(in1) || ++ vips_band_format_iscomplex(in2)) { + /* What kind of complex? + */ +- if( in1 == IM_BANDFMT_DPCOMPLEX || in2 == IM_BANDFMT_DPCOMPLEX ) +- /* Output will be DPCOMPLEX. ++ if (in1 == IM_BANDFMT_DPCOMPLEX || in2 == IM_BANDFMT_DPCOMPLEX) ++ /* Output will be DPCOMPLEX. + */ +- return( IM_BANDFMT_DPCOMPLEX ); ++ return (IM_BANDFMT_DPCOMPLEX); + else +- return( IM_BANDFMT_COMPLEX ); +- ++ return (IM_BANDFMT_COMPLEX); + } +- else if( vips_bandfmt_isfloat( in1 ) || +- vips_bandfmt_isfloat( in2 ) ) { ++ else if (vips_bandfmt_isfloat(in1) || ++ vips_bandfmt_isfloat(in2)) { + /* What kind of float? + */ +- if( in1 == IM_BANDFMT_DOUBLE || in2 == IM_BANDFMT_DOUBLE ) +- return( IM_BANDFMT_DOUBLE ); ++ if (in1 == IM_BANDFMT_DOUBLE || in2 == IM_BANDFMT_DOUBLE) ++ return (IM_BANDFMT_DOUBLE); + else +- return( IM_BANDFMT_FLOAT ); ++ return (IM_BANDFMT_FLOAT); + } +- else ++ else + /* Must be int+int -> int. + */ +- return( bandfmt_largest[in1][in2] ); ++ return (bandfmt_largest[in1][in2]); + } + + int +-im__formatalike_vec( IMAGE **in, IMAGE **out, int n ) ++im__formatalike_vec(IMAGE **in, IMAGE **out, int n) + { + int i; + VipsBandFmt fmt; + +- g_assert( n >= 1 ); ++ g_assert(n >= 1); + + fmt = in[0]->BandFmt; +- for( i = 1; i < n; i++ ) +- fmt = im__format_common( fmt, in[i]->BandFmt ); ++ for (i = 1; i < n; i++) ++ fmt = im__format_common(fmt, in[i]->BandFmt); + +- for( i = 0; i < n; i++ ) +- if( im_clip2fmt( in[i], out[i], fmt ) ) +- return( -1 ); ++ for (i = 0; i < n; i++) ++ if (im_clip2fmt(in[i], out[i], fmt)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-im__formatalike( IMAGE *in1, IMAGE *in2, IMAGE *out1, IMAGE *out2 ) ++im__formatalike(IMAGE *in1, IMAGE *in2, IMAGE *out1, IMAGE *out2) + { + IMAGE *in[2]; + IMAGE *out[2]; +@@ -898,55 +938,55 @@ im__formatalike( IMAGE *in1, IMAGE *in2, IMAGE *out1, IMAGE *out2 ) + out[0] = out1; + out[1] = out2; + +- return( im__formatalike_vec( in, out, 2 ) ); ++ return (im__formatalike_vec(in, out, 2)); + } + + /* Make an n-band image. Input 1 or n bands. + */ + int +-im__bandup( const char *domain, IMAGE *in, IMAGE *out, int n ) ++im__bandup(const char *domain, IMAGE *in, IMAGE *out, int n) + { + IMAGE *bands[256]; + int i; + +- if( in->Bands == n ) +- return( vips_image_write( in, out ) ); +- if( in->Bands != 1 ) { +- im_error( domain, _( "not one band or %d bands" ), n ); +- return( -1 ); ++ if (in->Bands == n) ++ return (vips_image_write(in, out)); ++ if (in->Bands != 1) { ++ im_error(domain, _("not one band or %d bands"), n); ++ return (-1); + } +- if( n > 256 || n < 1 ) { +- im_error( domain, "%s", _( "bad bands" ) ); +- return( -1 ); ++ if (n > 256 || n < 1) { ++ im_error(domain, "%s", _("bad bands")); ++ return (-1); + } + +- for( i = 0; i < n; i++ ) ++ for (i = 0; i < n; i++) + bands[i] = in; + +- return( im_gbandjoin( bands, out, n ) ); ++ return (im_gbandjoin(bands, out, n)); + } + + int +-im__bandalike_vec( const char *domain, IMAGE **in, IMAGE **out, int n ) ++im__bandalike_vec(const char *domain, IMAGE **in, IMAGE **out, int n) + { + int i; + int max_bands; + +- g_assert( n >= 1 ); ++ g_assert(n >= 1); + + max_bands = in[0]->Bands; +- for( i = 1; i < n; i++ ) +- max_bands = IM_MAX( max_bands, in[i]->Bands ); +- for( i = 0; i < n; i++ ) +- if( im__bandup( domain, in[i], out[i], max_bands ) ) +- return( -1 ); ++ for (i = 1; i < n; i++) ++ max_bands = IM_MAX(max_bands, in[i]->Bands); ++ for (i = 0; i < n; i++) ++ if (im__bandup(domain, in[i], out[i], max_bands)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-im__bandalike( const char *domain, +- IMAGE *in1, IMAGE *in2, IMAGE *out1, IMAGE *out2 ) ++im__bandalike(const char *domain, ++ IMAGE *in1, IMAGE *in2, IMAGE *out1, IMAGE *out2) + { + IMAGE *in[2]; + IMAGE *out[2]; +@@ -955,2472 +995,2471 @@ im__bandalike( const char *domain, + in[1] = in2; + out[0] = out1; + out[1] = out2; +- if( im__bandalike_vec( domain, in, out, 2 ) ) +- return( -1 ); ++ if (im__bandalike_vec(domain, in, out, 2)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + VipsVector * +-im__init_program( VipsVector *vectors[IM_BANDFMT_LAST], +- VipsBandFmt format_table[IM_BANDFMT_LAST], VipsBandFmt fmt ) ++im__init_program(VipsVector *vectors[IM_BANDFMT_LAST], ++ VipsBandFmt format_table[IM_BANDFMT_LAST], VipsBandFmt fmt) + { + int isize = im__sizeof_bandfmt[fmt]; + int osize = im__sizeof_bandfmt[format_table[fmt]]; + + VipsVector *v; + +- v = vips_vector_new( "binary arith", osize ); ++ v = vips_vector_new("binary arith", osize); + +- vips_vector_source_name( v, "s1", isize ); +- vips_vector_source_name( v, "s2", isize ); +- vips_vector_temporary( v, "t1", osize ); +- vips_vector_temporary( v, "t2", osize ); ++ vips_vector_source_name(v, "s1", isize); ++ vips_vector_source_name(v, "s2", isize); ++ vips_vector_temporary(v, "t1", osize); ++ vips_vector_temporary(v, "t2", osize); + + vectors[fmt] = v; + +- return( v ); ++ return (v); + } + + void +-im__compile_programs( VipsVector *vectors[IM_BANDFMT_LAST] ) ++im__compile_programs(VipsVector *vectors[IM_BANDFMT_LAST]) + { + int fmt; + +- for( fmt = 0; fmt < IM_BANDFMT_LAST; fmt++ ) { +- if( vectors[fmt] && +- !vips_vector_compile( vectors[fmt] ) ) +- IM_FREEF( vips_vector_free, vectors[fmt] ); ++ for (fmt = 0; fmt < IM_BANDFMT_LAST; fmt++) { ++ if (vectors[fmt] && ++ !vips_vector_compile(vectors[fmt])) ++ IM_FREEF(vips_vector_free, vectors[fmt]); + } + + #ifdef DEBUG +- printf( "im__compile_programs: " ); +- for( fmt = 0; fmt < IM_BANDFMT_LAST; fmt++ ) +- if( vectors[fmt] ) +- printf( "%s ", im_BandFmt2char( fmt ) ); +- printf( "\n" ); ++ printf("im__compile_programs: "); ++ for (fmt = 0; fmt < IM_BANDFMT_LAST; fmt++) ++ if (vectors[fmt]) ++ printf("%s ", im_BandFmt2char(fmt)); ++ printf("\n"); + #endif /*DEBUG*/ + } + +-int +-im_add( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_add(IMAGE *in1, IMAGE *in2, IMAGE *out) + { + VipsImage *x; + +- if( vips_call( "add", in1, in2, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_call("add", in1, in2, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_subtract( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_subtract(IMAGE *in1, IMAGE *in2, IMAGE *out) + { + VipsImage *x; + +- if( vips_call( "subtract", in1, in2, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_call("subtract", in1, in2, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_multiply( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_multiply(IMAGE *in1, IMAGE *in2, IMAGE *out) + { + VipsImage *x; + +- if( vips_call( "multiply", in1, in2, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_call("multiply", in1, in2, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_divide( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_divide(IMAGE *in1, IMAGE *in2, IMAGE *out) + { + VipsImage *x; + +- if( vips_call( "divide", in1, in2, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_call("divide", in1, in2, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_avg( IMAGE *in, double *out ) ++im_avg(IMAGE *in, double *out) + { +- return( vips_avg( in, out, NULL ) ); ++ return (vips_avg(in, out, NULL)); + } + + int +-im_deviate( IMAGE *in, double *out ) ++im_deviate(IMAGE *in, double *out) + { +- return( vips_deviate( in, out, NULL ) ); ++ return (vips_deviate(in, out, NULL)); + } + +-int im_generate( VipsImage *im, ++int ++im_generate(VipsImage *im, + im_start_fn start, im_generate_fn generate, im_stop_fn stop, +- void *a, void *b ) ++ void *a, void *b) + { +- return( vips_image_generate( im, +- start, (VipsGenerateFn) generate, stop, a, b ) ); ++ return (vips_image_generate(im, ++ start, (VipsGenerateFn) generate, stop, a, b)); + } + + int +-im_minpos( IMAGE *in, int *xpos, int *ypos, double *out ) ++im_minpos(IMAGE *in, int *xpos, int *ypos, double *out) + { +- return( vips_min( in, out, "x", xpos, "y", ypos, NULL ) ); ++ return (vips_min(in, out, "x", xpos, "y", ypos, NULL)); + } + + int +-im_min( IMAGE *in, double *out ) ++im_min(IMAGE *in, double *out) + { +- return( im_minpos( in, NULL, NULL, out ) ); ++ return (im_minpos(in, NULL, NULL, out)); + } + + int +-im_maxpos( IMAGE *in, int *xpos, int *ypos, double *out ) ++im_maxpos(IMAGE *in, int *xpos, int *ypos, double *out) + { +- return( vips_max( in, out, "x", xpos, "y", ypos, NULL ) ); ++ return (vips_max(in, out, "x", xpos, "y", ypos, NULL)); + } + + int +-im_max( IMAGE *in, double *out ) ++im_max(IMAGE *in, double *out) + { +- return( im_maxpos( in, NULL, NULL, out ) ); ++ return (im_maxpos(in, NULL, NULL, out)); + } + + #define MAX_IMAGES 100 + int +-im_demand_hint (IMAGE * im, VipsDemandStyle hint, ...) ++im_demand_hint(IMAGE *im, VipsDemandStyle hint, ...) + { +- va_list ap; +- int i; +- IMAGE *ar[MAX_IMAGES]; ++ va_list ap; ++ int i; ++ IMAGE *ar[MAX_IMAGES]; + +- va_start (ap, hint); +- for (i = 0; i < MAX_IMAGES && (ar[i] = va_arg (ap, IMAGE *)); i++) +- ; +- va_end (ap); +- if (i == MAX_IMAGES) +- { +- im_error ("im_demand_hint", "%s", _("too many images")); +- return (-1); +- } ++ va_start(ap, hint); ++ for (i = 0; i < MAX_IMAGES && (ar[i] = va_arg(ap, IMAGE *)); i++) ++ ; ++ va_end(ap); ++ if (i == MAX_IMAGES) { ++ im_error("im_demand_hint", "%s", _("too many images")); ++ return (-1); ++ } + +- vips__demand_hint_array (im, hint, ar); ++ vips__demand_hint_array(im, hint, ar); + +- return (0); ++ return (0); + } + + int +-im_cp_descv (IMAGE * im, ...) ++im_cp_descv(IMAGE *im, ...) + { +- va_list ap; +- int i; +- IMAGE *ar[MAX_IMAGES]; ++ va_list ap; ++ int i; ++ IMAGE *ar[MAX_IMAGES]; + +- va_start (ap, im); +- for (i = 0; i < MAX_IMAGES && (ar[i] = va_arg (ap, IMAGE *)); i++) +- ; +- va_end (ap); +- if (i == MAX_IMAGES) +- { +- im_error ("im_cp_descv", "%s", _("too many images")); +- return (-1); +- } ++ va_start(ap, im); ++ for (i = 0; i < MAX_IMAGES && (ar[i] = va_arg(ap, IMAGE *)); i++) ++ ; ++ va_end(ap); ++ if (i == MAX_IMAGES) { ++ im_error("im_cp_descv", "%s", _("too many images")); ++ return (-1); ++ } + +- return (vips__image_copy_fields_array (im, ar)); ++ return (vips__image_copy_fields_array(im, ar)); + } + + int +-im_cp_desc(IMAGE *out, IMAGE *in ) ++im_cp_desc(IMAGE *out, IMAGE *in) + { +- return( im_cp_descv( out, in, NULL)); ++ return (im_cp_descv(out, in, NULL)); + } + +-int +-im_copy_set( IMAGE *in, IMAGE *out, +- VipsType type, float xres, float yres, int xoffset, int yoffset ) ++int ++im_copy_set(IMAGE *in, IMAGE *out, ++ VipsType type, float xres, float yres, int xoffset, int yoffset) + { + VipsImage *x; + +- if( vips_copy( in, &x, +- "interpretation", type, +- "xres", xres, +- "yres", yres, +- "xoffset", xoffset, +- "yoffset", yoffset, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_copy(in, &x, ++ "interpretation", type, ++ "xres", xres, ++ "yres", yres, ++ "xoffset", xoffset, ++ "yoffset", yoffset, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_copy_morph( IMAGE *in, IMAGE *out, +- int bands, VipsBandFmt bandfmt, VipsCoding coding ) ++int ++im_copy_morph(IMAGE *in, IMAGE *out, ++ int bands, VipsBandFmt bandfmt, VipsCoding coding) + { + VipsImage *x; + +- if( vips_copy( in, &x, +- "bands", bands, +- "format", bandfmt, +- "coding", coding, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_copy(in, &x, ++ "bands", bands, ++ "format", bandfmt, ++ "coding", coding, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_copy( IMAGE *in, IMAGE *out ) ++im_copy(IMAGE *in, IMAGE *out) + { +- return( vips_image_write( in, out ) ); ++ return (vips_image_write(in, out)); + } + + int +-im_copy_swap( IMAGE *in, IMAGE *out ) ++im_copy_swap(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_byteswap( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_byteswap(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_copy_set_meta( IMAGE *in, IMAGE *out, const char *field, GValue *value ) ++im_copy_set_meta(IMAGE *in, IMAGE *out, const char *field, GValue *value) + { +- if( vips_image_write( in, out ) ) +- return( -1 ); +- (void) im_meta_set( out, field, value ); ++ if (vips_image_write(in, out)) ++ return (-1); ++ (void) im_meta_set(out, field, value); + +- return( 0 ); ++ return (0); + } + + int +-im_copy_native( IMAGE *in, IMAGE *out, gboolean is_msb_first ) ++im_copy_native(IMAGE *in, IMAGE *out, gboolean is_msb_first) + { +- if( is_msb_first != im_amiMSBfirst() ) +- return( im_copy_swap( in, out ) ); ++ if (is_msb_first != im_amiMSBfirst()) ++ return (im_copy_swap(in, out)); + else +- return( vips_image_write( in, out ) ); ++ return (vips_image_write(in, out)); + } + + int +-im_embed( IMAGE *in, IMAGE *out, int type, int x, int y, int width, int height ) ++im_embed(IMAGE *in, IMAGE *out, int type, int x, int y, int width, int height) + { + VipsImage *t; + +- if( vips_embed( in, &t, x, y, width, height, +- "extend", type, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_embed(in, &t, x, y, width, height, ++ "extend", type, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_fliphor( IMAGE *in, IMAGE *out ) ++int ++im_fliphor(IMAGE *in, IMAGE *out) + { + VipsImage *t; + +- if( vips_flip( in, &t, VIPS_DIRECTION_HORIZONTAL, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_flip(in, &t, VIPS_DIRECTION_HORIZONTAL, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_rot90( IMAGE *in, IMAGE *out ) ++int ++im_rot90(IMAGE *in, IMAGE *out) + { + VipsImage *t; + +- if( vips_rot( in, &t, VIPS_ANGLE_D90, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_rot(in, &t, VIPS_ANGLE_D90, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_rot180( IMAGE *in, IMAGE *out ) ++int ++im_rot180(IMAGE *in, IMAGE *out) + { + VipsImage *t; + +- if( vips_rot( in, &t, VIPS_ANGLE_D180, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_rot(in, &t, VIPS_ANGLE_D180, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_rot270( IMAGE *in, IMAGE *out ) ++int ++im_rot270(IMAGE *in, IMAGE *out) + { + VipsImage *t; + +- if( vips_rot( in, &t, VIPS_ANGLE_D270, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_rot(in, &t, VIPS_ANGLE_D270, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_flipver( IMAGE *in, IMAGE *out ) ++int ++im_flipver(IMAGE *in, IMAGE *out) + { + VipsImage *t; + +- if( vips_flip( in, &t, VIPS_DIRECTION_VERTICAL, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_flip(in, &t, VIPS_DIRECTION_VERTICAL, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_insert( IMAGE *main, IMAGE *sub, IMAGE *out, int x, int y ) ++int ++im_insert(IMAGE *main, IMAGE *sub, IMAGE *out, int x, int y) + { + VipsImage *t; + +- if( vips_insert( main, sub, &t, x, y, +- "expand", TRUE, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_insert(main, sub, &t, x, y, ++ "expand", TRUE, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_insert_noexpand( IMAGE *main, IMAGE *sub, IMAGE *out, int x, int y ) ++int ++im_insert_noexpand(IMAGE *main, IMAGE *sub, IMAGE *out, int x, int y) + { + VipsImage *t; + +- if( vips_insert( main, sub, &t, x, y, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_insert(main, sub, &t, x, y, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_lrjoin( IMAGE *left, IMAGE *right, IMAGE *out ) ++int ++im_lrjoin(IMAGE *left, IMAGE *right, IMAGE *out) + { + VipsImage *t; + +- if( vips_join( left, right, &t, VIPS_DIRECTION_HORIZONTAL, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_join(left, right, &t, VIPS_DIRECTION_HORIZONTAL, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_tbjoin( IMAGE *left, IMAGE *right, IMAGE *out ) ++int ++im_tbjoin(IMAGE *left, IMAGE *right, IMAGE *out) + { + VipsImage *t; + +- if( vips_join( left, right, &t, VIPS_DIRECTION_VERTICAL, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_join(left, right, &t, VIPS_DIRECTION_VERTICAL, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + int +-im_extract_area( IMAGE *in, IMAGE *out, +- int left, int top, int width, int height ) ++im_extract_area(IMAGE *in, IMAGE *out, ++ int left, int top, int width, int height) + { + VipsImage *t; + +- if( vips_extract_area( in, &t, left, top, width, height, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_extract_area(in, &t, left, top, width, height, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_extract_bands( IMAGE *in, IMAGE *out, int band, int nbands ) ++int ++im_extract_bands(IMAGE *in, IMAGE *out, int band, int nbands) + { + VipsImage *t; + +- if( vips_extract_band( in, &t, band, +- "n", nbands, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_extract_band(in, &t, band, ++ "n", nbands, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_extract_band( IMAGE *in, IMAGE *out, int band ) ++int ++im_extract_band(IMAGE *in, IMAGE *out, int band) + { +- return( im_extract_bands( in, out, band, 1 ) ); ++ return (im_extract_bands(in, out, band, 1)); + } + + int +-im_extract_areabands( IMAGE *in, IMAGE *out, +- int left, int top, int width, int height, int band, int nbands ) ++im_extract_areabands(IMAGE *in, IMAGE *out, ++ int left, int top, int width, int height, int band, int nbands) + { + VipsImage *t1, *t2; + +- if( vips_extract_area( in, &t1, left, top, width, height, +- NULL ) ) +- return( -1 ); ++ if (vips_extract_area(in, &t1, left, top, width, height, ++ NULL)) ++ return (-1); + +- if( vips_extract_band( t1, &t2, band, +- "n", nbands, +- NULL ) ) { +- g_object_unref( t1 ); +- return( -1 ); ++ if (vips_extract_band(t1, &t2, band, ++ "n", nbands, ++ NULL)) { ++ g_object_unref(t1); ++ return (-1); + } +- g_object_unref( t1 ); ++ g_object_unref(t1); + +- if( vips_image_write( t2, out ) ) { +- g_object_unref( t2 ); +- return( -1 ); ++ if (vips_image_write(t2, out)) { ++ g_object_unref(t2); ++ return (-1); + } +- g_object_unref( t2 ); ++ g_object_unref(t2); + +- return( 0 ); ++ return (0); + } + +-int +-im_replicate( IMAGE *in, IMAGE *out, int across, int down ) ++int ++im_replicate(IMAGE *in, IMAGE *out, int across, int down) + { + VipsImage *t; + +- if( vips_replicate( in, &t, across, down, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_replicate(in, &t, across, down, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_clip2fmt( IMAGE *in, IMAGE *out, VipsBandFmt fmt ) ++int ++im_clip2fmt(IMAGE *in, IMAGE *out, VipsBandFmt fmt) + { + VipsImage *t; + +- if( vips_cast( in, &t, fmt, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_cast(in, &t, fmt, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-size_t +-im_ref_string_get_length( const GValue *value ) ++size_t ++im_ref_string_get_length(const GValue *value) + { + size_t length; + +- (void) vips_value_get_ref_string( value, &length ); ++ (void) vips_value_get_ref_string(value, &length); + +- return( length ); ++ return (length); + } + +-int +-im_bandjoin( VipsImage *in1, VipsImage *in2, VipsImage *out ) ++int ++im_bandjoin(VipsImage *in1, VipsImage *in2, VipsImage *out) + { + VipsImage *t; + +- if( vips_bandjoin2( in1, in2, &t, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_bandjoin2(in1, in2, &t, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_gbandjoin( VipsImage **in, VipsImage *out, int n ) ++int ++im_gbandjoin(VipsImage **in, VipsImage *out, int n) + { + VipsImage *t; + +- if( vips_bandjoin( in, &t, n, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_bandjoin(in, &t, n, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + int +-im_rank_image( VipsImage **in, VipsImage *out, int n, int index ) ++im_rank_image(VipsImage **in, VipsImage *out, int n, int index) + { + VipsImage *t; + +- if( vips_bandrank( in, &t, n, +- "index", index, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_bandrank(in, &t, n, ++ "index", index, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + int +-im_maxvalue( IMAGE **in, IMAGE *out, int n ) ++im_maxvalue(IMAGE **in, IMAGE *out, int n) + { +- return( im_rank_image( in, out, n, n - 1 ) ); ++ return (im_rank_image(in, out, n, n - 1)); + } + +-int +-im_invert( IMAGE *in, IMAGE *out ) ++int ++im_invert(IMAGE *in, IMAGE *out) + { + VipsImage *t; + +- if( vips_invert( in, &t, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_invert(in, &t, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_sign( IMAGE *in, IMAGE *out ) ++int ++im_sign(IMAGE *in, IMAGE *out) + { + VipsImage *t; + +- if( vips_sign( in, &t, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_sign(in, &t, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_abs( IMAGE *in, IMAGE *out ) ++int ++im_abs(IMAGE *in, IMAGE *out) + { + VipsImage *t; + +- if( vips_abs( in, &t, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_abs(in, &t, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_bandmean( IMAGE *in, IMAGE *out ) ++int ++im_bandmean(IMAGE *in, IMAGE *out) + { + VipsImage *t; + +- if( vips_bandmean( in, &t, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_bandmean(in, &t, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_lintra( double a, IMAGE *in, double b, IMAGE *out ) ++int ++im_lintra(double a, IMAGE *in, double b, IMAGE *out) + { + VipsImage *t; + +- if( vips_linear1( in, &t, a, b, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_linear1(in, &t, a, b, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_lintra_vec( int n, double *a, IMAGE *in, double *b, IMAGE *out ) ++int ++im_lintra_vec(int n, double *a, IMAGE *in, double *b, IMAGE *out) + { + VipsImage *t; + +- if( vips_linear( in, &t, a, b, n, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_linear(in, &t, a, b, n, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_black( IMAGE *out, int x, int y, int bands ) ++int ++im_black(IMAGE *out, int x, int y, int bands) + { + VipsImage *t; + +- if( vips_black( &t, x, y, +- "bands", bands, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_black(&t, x, y, ++ "bands", bands, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_identity_ushort( VipsImage *lut, int bands, int sz ) ++int ++im_identity_ushort(VipsImage *lut, int bands, int sz) + { + VipsImage *t; + +- if( vips_identity( &t, +- "bands", bands, +- "ushort", TRUE, +- "size", sz, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, lut ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_identity(&t, ++ "bands", bands, ++ "ushort", TRUE, ++ "size", sz, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, lut)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_identity( VipsImage *lut, int bands ) ++int ++im_identity(VipsImage *lut, int bands) + { + VipsImage *t; + +- if( vips_identity( &t, +- "bands", bands, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, lut ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_identity(&t, ++ "bands", bands, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, lut)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_gaussnoise( VipsImage *out, int x, int y, double mean, double sigma ) ++int ++im_gaussnoise(VipsImage *out, int x, int y, double mean, double sigma) + { + VipsImage *t; + +- if( vips_gaussnoise( &t, x, y, +- "mean", mean, +- "sigma", sigma, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_gaussnoise(&t, x, y, ++ "mean", mean, ++ "sigma", sigma, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_grid( VipsImage *in, VipsImage *out, int tile_height, int across, int down ) ++int ++im_grid(VipsImage *in, VipsImage *out, int tile_height, int across, int down) + { + VipsImage *t; + +- if( vips_grid( in, &t, tile_height, across, down, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_grid(in, &t, tile_height, across, down, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_scale( VipsImage *in, VipsImage *out ) ++int ++im_scale(VipsImage *in, VipsImage *out) + { + VipsImage *t; + +- if( vips_scale( in, &t, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_scale(in, &t, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_msb( VipsImage *in, VipsImage *out ) ++int ++im_msb(VipsImage *in, VipsImage *out) + { + VipsImage *t; + +- if( vips_msb( in, &t, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_msb(in, &t, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_msb_band( VipsImage *in, VipsImage *out, int band ) ++int ++im_msb_band(VipsImage *in, VipsImage *out, int band) + { + VipsImage *t; + +- if( vips_msb( in, &t, "band", band, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_msb(in, &t, "band", band, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + int +-im_make_xy( IMAGE *out, const int xsize, const int ysize ) ++im_make_xy(IMAGE *out, const int xsize, const int ysize) + { + VipsImage *t; + +- if( vips_xyz( &t, xsize, ysize, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_xyz(&t, xsize, ysize, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + int +-im_zone( IMAGE *out, int size ) ++im_zone(IMAGE *out, int size) + { + VipsImage *t; + +- if( vips_zone( &t, size, size, +- "uchar", TRUE, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_zone(&t, size, size, ++ "uchar", TRUE, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + int +-im_fzone( IMAGE *out, int size ) ++im_fzone(IMAGE *out, int size) + { + VipsImage *t; + +- if( vips_zone( &t, size, size, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_zone(&t, size, size, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_sines( IMAGE *out, int xsize, int ysize, double horfreq, double verfreq ) ++int ++im_sines(IMAGE *out, int xsize, int ysize, double horfreq, double verfreq) + { + VipsImage *t; + +- if( vips_sines( &t, xsize, ysize, +- "hfreq", horfreq, +- "vfreq", verfreq, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_sines(&t, xsize, ysize, ++ "hfreq", horfreq, ++ "vfreq", verfreq, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_text( IMAGE *out, const char *text, const char *font, +- int width, int align, int dpi ) ++int ++im_text(IMAGE *out, const char *text, const char *font, ++ int width, int align, int dpi) + { + VipsImage *t; + +- if( vips_text( &t, text, +- "font", font, +- "width", width, +- "align", align, +- "dpi", dpi, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_text(&t, text, ++ "font", font, ++ "width", width, ++ "align", align, ++ "dpi", dpi, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_system( VipsImage *im, const char *cmd, char **out ) ++int ++im_system(VipsImage *im, const char *cmd, char **out) + { + VipsArea *area; + VipsImage **array; + char *str; + +- area = vips_area_new_array_object( 1 ); ++ area = vips_area_new_array_object(1); + array = (VipsImage **) area->data; + array[0] = im; + +- if( vips_system( cmd, +- "in", area, +- "in_format", "%s.v", +- "log", &str, +- NULL ) ) { +- vips_area_unref( area ); +- return( -1 ); ++ if (vips_system(cmd, ++ "in", area, ++ "in_format", "%s.v", ++ "log", &str, ++ NULL)) { ++ vips_area_unref(area); ++ return (-1); + } + +- vips_area_unref( area ); ++ vips_area_unref(area); + +- if( out ) ++ if (out) + *out = str; + +- return( 0 ); ++ return (0); + } + + VipsImage * +-im_system_image( VipsImage *im, ++im_system_image(VipsImage *im, + const char *in_format, const char *out_format, const char *cmd_format, +- char **log ) ++ char **log) + { + VipsArrayImage *array; + char *str; +- VipsImage *out; ++ VipsImage *out; + +- array = vips_array_image_newv( 1, im ); ++ array = vips_array_image_newv(1, im); + + /* im will be unreffed when area is unreffed. + */ +- g_object_ref( im ); ++ g_object_ref(im); + +- if( vips_system( cmd_format, +- "in", array, +- "out", &out, +- "in_format", in_format, +- "out_format", out_format, +- "log", &str, +- NULL ) ) { +- vips_area_unref( VIPS_AREA( array ) ); +- return( NULL ); ++ if (vips_system(cmd_format, ++ "in", array, ++ "out", &out, ++ "in_format", in_format, ++ "out_format", out_format, ++ "log", &str, ++ NULL)) { ++ vips_area_unref(VIPS_AREA(array)); ++ return (NULL); + } + +- vips_area_unref( VIPS_AREA( array ) ); ++ vips_area_unref(VIPS_AREA(array)); + +- if( log ) ++ if (log) + *log = str; + else +- g_free( str ); ++ g_free(str); + +- return( out ); ++ return (out); + } + + int +-im_wrap( IMAGE *in, IMAGE *out, int x, int y ) ++im_wrap(IMAGE *in, IMAGE *out, int x, int y) + { + VipsImage *t; + +- if( vips_wrap( in, &t, "x", x, "y", y, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_wrap(in, &t, "x", x, "y", y, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + int +-im_rotquad( IMAGE *in, IMAGE *out ) ++im_rotquad(IMAGE *in, IMAGE *out) + { +- return( im_wrap( in, out, in->Xsize / 2, in->Ysize / 2 ) ); ++ return (im_wrap(in, out, in->Xsize / 2, in->Ysize / 2)); + } + +-int +-im_scaleps( VipsImage *in, VipsImage *out ) ++int ++im_scaleps(VipsImage *in, VipsImage *out) + { + VipsImage *t; + +- if( vips_scale( in, &t, "log", TRUE, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_scale(in, &t, "log", TRUE, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_zoom( VipsImage *in, VipsImage *out, int xfac, int yfac ) ++int ++im_zoom(VipsImage *in, VipsImage *out, int xfac, int yfac) + { + VipsImage *t; + +- if( vips_zoom( in, &t, xfac, yfac, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_zoom(in, &t, xfac, yfac, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_subsample( VipsImage *in, VipsImage *out, int xfac, int yfac ) ++int ++im_subsample(VipsImage *in, VipsImage *out, int xfac, int yfac) + { + VipsImage *t; + +- if( vips_subsample( in, &t, xfac, yfac, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_subsample(in, &t, xfac, yfac, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + static int +-vips__math( VipsImage *in, VipsImage *out, VipsOperationMath math ) ++vips__math(VipsImage *in, VipsImage *out, VipsOperationMath math) + { + VipsImage *t; + +- if( vips_math( in, &t, math, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_math(in, &t, math, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_sintra( IMAGE *in, IMAGE *out ) ++int ++im_sintra(IMAGE *in, IMAGE *out) + { +- return( vips__math( in, out, VIPS_OPERATION_MATH_SIN ) ); ++ return (vips__math(in, out, VIPS_OPERATION_MATH_SIN)); + } + +-int +-im_costra( IMAGE *in, IMAGE *out ) ++int ++im_costra(IMAGE *in, IMAGE *out) + { +- return( vips__math( in, out, VIPS_OPERATION_MATH_COS ) ); ++ return (vips__math(in, out, VIPS_OPERATION_MATH_COS)); + } + +-int +-im_tantra( IMAGE *in, IMAGE *out ) ++int ++im_tantra(IMAGE *in, IMAGE *out) + { +- return( vips__math( in, out, VIPS_OPERATION_MATH_TAN ) ); ++ return (vips__math(in, out, VIPS_OPERATION_MATH_TAN)); + } + +-int +-im_asintra( IMAGE *in, IMAGE *out ) ++int ++im_asintra(IMAGE *in, IMAGE *out) + { +- return( vips__math( in, out, VIPS_OPERATION_MATH_ASIN ) ); ++ return (vips__math(in, out, VIPS_OPERATION_MATH_ASIN)); + } + +-int +-im_acostra( IMAGE *in, IMAGE *out ) ++int ++im_acostra(IMAGE *in, IMAGE *out) + { +- return( vips__math( in, out, VIPS_OPERATION_MATH_ACOS ) ); ++ return (vips__math(in, out, VIPS_OPERATION_MATH_ACOS)); + } + +-int +-im_atantra( IMAGE *in, IMAGE *out ) ++int ++im_atantra(IMAGE *in, IMAGE *out) + { +- return( vips__math( in, out, VIPS_OPERATION_MATH_ATAN ) ); ++ return (vips__math(in, out, VIPS_OPERATION_MATH_ATAN)); + } + +-int +-im_logtra( IMAGE *in, IMAGE *out ) ++int ++im_logtra(IMAGE *in, IMAGE *out) + { +- return( vips__math( in, out, VIPS_OPERATION_MATH_LOG ) ); ++ return (vips__math(in, out, VIPS_OPERATION_MATH_LOG)); + } + +-int +-im_log10tra( IMAGE *in, IMAGE *out ) ++int ++im_log10tra(IMAGE *in, IMAGE *out) + { +- return( vips__math( in, out, VIPS_OPERATION_MATH_LOG10 ) ); ++ return (vips__math(in, out, VIPS_OPERATION_MATH_LOG10)); + } + +-int +-im_exptra( IMAGE *in, IMAGE *out ) ++int ++im_exptra(IMAGE *in, IMAGE *out) + { +- return( vips__math( in, out, VIPS_OPERATION_MATH_EXP ) ); ++ return (vips__math(in, out, VIPS_OPERATION_MATH_EXP)); + } + +-int +-im_exp10tra( IMAGE *in, IMAGE *out ) ++int ++im_exp10tra(IMAGE *in, IMAGE *out) + { +- return( vips__math( in, out, VIPS_OPERATION_MATH_EXP10 ) ); ++ return (vips__math(in, out, VIPS_OPERATION_MATH_EXP10)); + } + + DOUBLEMASK * +-im_stats( VipsImage *in ) ++im_stats(VipsImage *in) + { + VipsImage *t; + DOUBLEMASK *msk; + +- if( vips_stats( in, &t, +- NULL ) ) +- return( NULL ); +- if( !(msk = im_vips2mask( t, "im_stats" )) ) { +- g_object_unref( t ); +- return( NULL ); ++ if (vips_stats(in, &t, ++ NULL)) ++ return (NULL); ++ if (!(msk = im_vips2mask(t, "im_stats"))) { ++ g_object_unref(t); ++ return (NULL); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( msk ); ++ return (msk); + } + + DOUBLEMASK * +-im_gauss_dmask( const char *filename, double sigma, double min_ampl ) ++im_gauss_dmask(const char *filename, double sigma, double min_ampl) + { + VipsImage *t; + DOUBLEMASK *msk; + +- if( vips_gaussmat( &t, sigma, min_ampl, +- "precision", VIPS_PRECISION_FLOAT, +- NULL ) ) +- return( NULL ); +- if( !(msk = im_vips2mask( t, filename )) ) { +- g_object_unref( t ); +- return( NULL ); ++ if (vips_gaussmat(&t, sigma, min_ampl, ++ "precision", VIPS_PRECISION_FLOAT, ++ NULL)) ++ return (NULL); ++ if (!(msk = im_vips2mask(t, filename))) { ++ g_object_unref(t); ++ return (NULL); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( msk ); ++ return (msk); + } + + DOUBLEMASK * +-im_gauss_dmask_sep( const char *filename, double sigma, double min_ampl ) ++im_gauss_dmask_sep(const char *filename, double sigma, double min_ampl) + { + VipsImage *t; + DOUBLEMASK *msk; + +- if( vips_gaussmat( &t, sigma, min_ampl, +- "precision", VIPS_PRECISION_FLOAT, +- "separable", TRUE, +- NULL ) ) +- return( NULL ); +- if( !(msk = im_vips2mask( t, filename )) ) { +- g_object_unref( t ); +- return( NULL ); ++ if (vips_gaussmat(&t, sigma, min_ampl, ++ "precision", VIPS_PRECISION_FLOAT, ++ "separable", TRUE, ++ NULL)) ++ return (NULL); ++ if (!(msk = im_vips2mask(t, filename))) { ++ g_object_unref(t); ++ return (NULL); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( msk ); ++ return (msk); + } + + INTMASK * +-im_gauss_imask( const char *filename, double sigma, double min_ampl ) ++im_gauss_imask(const char *filename, double sigma, double min_ampl) + { + VipsImage *t; + INTMASK *msk; + +- if( vips_gaussmat( &t, sigma, min_ampl, NULL ) ) +- return( NULL ); +- if( !(msk = im_vips2imask( t, filename )) ) { +- g_object_unref( t ); +- return( NULL ); ++ if (vips_gaussmat(&t, sigma, min_ampl, NULL)) ++ return (NULL); ++ if (!(msk = im_vips2imask(t, filename))) { ++ g_object_unref(t); ++ return (NULL); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( msk ); ++ return (msk); + } + + INTMASK * +-im_gauss_imask_sep( const char *filename, double sigma, double min_ampl ) ++im_gauss_imask_sep(const char *filename, double sigma, double min_ampl) + { + VipsImage *t; + INTMASK *msk; + +- if( vips_gaussmat( &t, sigma, min_ampl, +- "separable", TRUE, +- NULL ) ) +- return( NULL ); +- if( !(msk = im_vips2imask( t, filename )) ) { +- g_object_unref( t ); +- return( NULL ); ++ if (vips_gaussmat(&t, sigma, min_ampl, ++ "separable", TRUE, ++ NULL)) ++ return (NULL); ++ if (!(msk = im_vips2imask(t, filename))) { ++ g_object_unref(t); ++ return (NULL); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( msk ); ++ return (msk); + } + + INTMASK * +-im_log_imask( const char *filename, double sigma, double min_ampl ) ++im_log_imask(const char *filename, double sigma, double min_ampl) + { + VipsImage *t; + INTMASK *msk; + +- if( vips_logmat( &t, sigma, min_ampl, NULL ) ) +- return( NULL ); +- if( !(msk = im_vips2imask( t, filename )) ) { +- g_object_unref( t ); +- return( NULL ); ++ if (vips_logmat(&t, sigma, min_ampl, NULL)) ++ return (NULL); ++ if (!(msk = im_vips2imask(t, filename))) { ++ g_object_unref(t); ++ return (NULL); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( msk ); ++ return (msk); + } + + DOUBLEMASK * +-im_log_dmask( const char *filename, double sigma, double min_ampl ) ++im_log_dmask(const char *filename, double sigma, double min_ampl) + { + VipsImage *t; + DOUBLEMASK *msk; + +- if( vips_logmat( &t, sigma, min_ampl, +- "precision", VIPS_PRECISION_FLOAT, +- NULL ) ) +- return( NULL ); +- if( !(msk = im_vips2mask( t, filename )) ) { +- g_object_unref( t ); +- return( NULL ); ++ if (vips_logmat(&t, sigma, min_ampl, ++ "precision", VIPS_PRECISION_FLOAT, ++ NULL)) ++ return (NULL); ++ if (!(msk = im_vips2mask(t, filename))) { ++ g_object_unref(t); ++ return (NULL); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( msk ); ++ return (msk); + } + +-int +-im_recomb( IMAGE *in, IMAGE *out, DOUBLEMASK *recomb ) ++int ++im_recomb(IMAGE *in, IMAGE *out, DOUBLEMASK *recomb) + { + VipsImage *t1, *t2; + +- if( !(t1 = vips_image_new()) || +- im_mask2vips( recomb, t1 ) ) +- return( -1 ); +- if( vips_recomb( in, &t2, t1, +- NULL ) ) { +- g_object_unref( t1 ); +- return( -1 ); ++ if (!(t1 = vips_image_new()) || ++ im_mask2vips(recomb, t1)) ++ return (-1); ++ if (vips_recomb(in, &t2, t1, ++ NULL)) { ++ g_object_unref(t1); ++ return (-1); + } +- g_object_unref( t1 ); +- if( vips_image_write( t2, out ) ) { +- g_object_unref( t2 ); +- return( -1 ); ++ g_object_unref(t1); ++ if (vips_image_write(t2, out)) { ++ g_object_unref(t2); ++ return (-1); + } +- g_object_unref( t2 ); ++ g_object_unref(t2); + +- return( 0 ); ++ return (0); + } + +-int +-im_compass( VipsImage *in, VipsImage *out, INTMASK *mask ) ++int ++im_compass(VipsImage *in, VipsImage *out, INTMASK *mask) + { + VipsImage *t1, *t2; + +- if( !(t1 = vips_image_new()) || +- im_imask2vips( mask, t1 ) ) +- return( -1 ); +- if( vips_compass( in, &t2, t1, +- "times", 8, +- "angle", VIPS_ANGLE45_D45, +- "precision", VIPS_PRECISION_INTEGER, +- NULL ) ) { +- g_object_unref( t1 ); +- return( -1 ); ++ if (!(t1 = vips_image_new()) || ++ im_imask2vips(mask, t1)) ++ return (-1); ++ if (vips_compass(in, &t2, t1, ++ "times", 8, ++ "angle", VIPS_ANGLE45_D45, ++ "precision", VIPS_PRECISION_INTEGER, ++ NULL)) { ++ g_object_unref(t1); ++ return (-1); + } +- g_object_unref( t1 ); +- if( vips_image_write( t2, out ) ) { +- g_object_unref( t2 ); +- return( -1 ); ++ g_object_unref(t1); ++ if (vips_image_write(t2, out)) { ++ g_object_unref(t2); ++ return (-1); + } +- g_object_unref( t2 ); ++ g_object_unref(t2); + +- return( 0 ); ++ return (0); + } + +-int +-im_lindetect( IMAGE *in, IMAGE *out, INTMASK *mask ) ++int ++im_lindetect(IMAGE *in, IMAGE *out, INTMASK *mask) + { + VipsImage *t1, *t2; + +- if( !(t1 = vips_image_new()) || +- im_imask2vips( mask, t1 ) ) +- return( -1 ); +- if( vips_compass( in, &t2, t1, +- "times", 4, +- "angle", VIPS_ANGLE45_D45, +- "precision", VIPS_PRECISION_INTEGER, +- NULL ) ) { +- g_object_unref( t1 ); +- return( -1 ); ++ if (!(t1 = vips_image_new()) || ++ im_imask2vips(mask, t1)) ++ return (-1); ++ if (vips_compass(in, &t2, t1, ++ "times", 4, ++ "angle", VIPS_ANGLE45_D45, ++ "precision", VIPS_PRECISION_INTEGER, ++ NULL)) { ++ g_object_unref(t1); ++ return (-1); + } +- g_object_unref( t1 ); +- if( vips_image_write( t2, out ) ) { +- g_object_unref( t2 ); +- return( -1 ); ++ g_object_unref(t1); ++ if (vips_image_write(t2, out)) { ++ g_object_unref(t2); ++ return (-1); + } +- g_object_unref( t2 ); ++ g_object_unref(t2); + +- return( 0 ); ++ return (0); + } + + int +-im_gradient( IMAGE *in, IMAGE *out, INTMASK *mask ) ++im_gradient(IMAGE *in, IMAGE *out, INTMASK *mask) + { + VipsImage *t1, *t2; + +- if( !(t1 = vips_image_new()) || +- im_imask2vips( mask, t1 ) ) +- return( -1 ); +- if( vips_compass( in, &t2, t1, +- "times", 2, +- "angle", VIPS_ANGLE45_D90, +- "combine", VIPS_COMBINE_SUM, +- "precision", VIPS_PRECISION_INTEGER, +- NULL ) ) { +- g_object_unref( t1 ); +- return( -1 ); ++ if (!(t1 = vips_image_new()) || ++ im_imask2vips(mask, t1)) ++ return (-1); ++ if (vips_compass(in, &t2, t1, ++ "times", 2, ++ "angle", VIPS_ANGLE45_D90, ++ "combine", VIPS_COMBINE_SUM, ++ "precision", VIPS_PRECISION_INTEGER, ++ NULL)) { ++ g_object_unref(t1); ++ return (-1); + } +- g_object_unref( t1 ); +- if( vips_image_write( t2, out ) ) { +- g_object_unref( t2 ); +- return( -1 ); ++ g_object_unref(t1); ++ if (vips_image_write(t2, out)) { ++ g_object_unref(t2); ++ return (-1); + } +- g_object_unref( t2 ); ++ g_object_unref(t2); + +- return( 0 ); ++ return (0); + } + + int +-im_convsep_raw( IMAGE *in, IMAGE *out, INTMASK *mask ) ++im_convsep_raw(IMAGE *in, IMAGE *out, INTMASK *mask) + { +- im_error( "im_convsep_raw", "no compat function" ); +- return( -1 ); ++ im_error("im_convsep_raw", "no compat function"); ++ return (-1); + } + +-int +-im_convsep( IMAGE *in, IMAGE *out, INTMASK *mask ) ++int ++im_convsep(IMAGE *in, IMAGE *out, INTMASK *mask) + { + VipsImage *t1, *t2; + +- if( !(t1 = vips_image_new()) || +- im_imask2vips( mask, t1 ) ) +- return( -1 ); +- if( vips_convsep( in, &t2, t1, +- "precision", VIPS_PRECISION_INTEGER, +- NULL ) ) { +- g_object_unref( t1 ); +- return( -1 ); ++ if (!(t1 = vips_image_new()) || ++ im_imask2vips(mask, t1)) ++ return (-1); ++ if (vips_convsep(in, &t2, t1, ++ "precision", VIPS_PRECISION_INTEGER, ++ NULL)) { ++ g_object_unref(t1); ++ return (-1); + } +- g_object_unref( t1 ); +- if( vips_image_write( t2, out ) ) { +- g_object_unref( t2 ); +- return( -1 ); ++ g_object_unref(t1); ++ if (vips_image_write(t2, out)) { ++ g_object_unref(t2); ++ return (-1); + } +- g_object_unref( t2 ); ++ g_object_unref(t2); + +- return( 0 ); ++ return (0); + } + + int +-im_convsep_f_raw( IMAGE *in, IMAGE *out, DOUBLEMASK *mask ) ++im_convsep_f_raw(IMAGE *in, IMAGE *out, DOUBLEMASK *mask) + { +- im_error( "im_convsep_raw", "no compat function" ); +- return( -1 ); ++ im_error("im_convsep_raw", "no compat function"); ++ return (-1); + } + +-int +-im_convsep_f( IMAGE *in, IMAGE *out, DOUBLEMASK *mask ) ++int ++im_convsep_f(IMAGE *in, IMAGE *out, DOUBLEMASK *mask) + { + VipsImage *t1, *t2; + +- if( !(t1 = vips_image_new()) || +- im_mask2vips( mask, t1 ) ) +- return( -1 ); +- if( vips_convsep( in, &t2, t1, NULL ) ) { +- g_object_unref( t1 ); +- return( -1 ); ++ if (!(t1 = vips_image_new()) || ++ im_mask2vips(mask, t1)) ++ return (-1); ++ if (vips_convsep(in, &t2, t1, NULL)) { ++ g_object_unref(t1); ++ return (-1); + } +- g_object_unref( t1 ); +- if( vips_image_write( t2, out ) ) { +- g_object_unref( t2 ); +- return( -1 ); ++ g_object_unref(t1); ++ if (vips_image_write(t2, out)) { ++ g_object_unref(t2); ++ return (-1); + } +- g_object_unref( t2 ); ++ g_object_unref(t2); + +- return( 0 ); ++ return (0); + } + +-int +-im_conv( VipsImage *in, VipsImage *out, INTMASK *mask ) ++int ++im_conv(VipsImage *in, VipsImage *out, INTMASK *mask) + { + VipsImage *t1, *t2; + +- if( !(t1 = vips_image_new()) || +- im_imask2vips( mask, t1 ) ) +- return( -1 ); +- if( vips_convi( in, &t2, t1, +- NULL ) ) { +- g_object_unref( t1 ); +- return( -1 ); ++ if (!(t1 = vips_image_new()) || ++ im_imask2vips(mask, t1)) ++ return (-1); ++ if (vips_convi(in, &t2, t1, ++ NULL)) { ++ g_object_unref(t1); ++ return (-1); + } +- g_object_unref( t1 ); +- if( vips_image_write( t2, out ) ) { +- g_object_unref( t2 ); +- return( -1 ); ++ g_object_unref(t1); ++ if (vips_image_write(t2, out)) { ++ g_object_unref(t2); ++ return (-1); + } +- g_object_unref( t2 ); ++ g_object_unref(t2); + +- return( 0 ); ++ return (0); + } + + int +-im_conv_raw( VipsImage *in, VipsImage *out, INTMASK *mask ) ++im_conv_raw(VipsImage *in, VipsImage *out, INTMASK *mask) + { +- im_error( "im_conv_raw", "no compat function" ); +- return( -1 ); ++ im_error("im_conv_raw", "no compat function"); ++ return (-1); + } + +-int +-im_conv_f( VipsImage *in, VipsImage *out, DOUBLEMASK *mask ) ++int ++im_conv_f(VipsImage *in, VipsImage *out, DOUBLEMASK *mask) + { + VipsImage *t1, *t2; + +- if( !(t1 = vips_image_new()) || +- im_mask2vips( mask, t1 ) ) +- return( -1 ); +- if( vips_convf( in, &t2, t1, +- NULL ) ) { +- g_object_unref( t1 ); +- return( -1 ); ++ if (!(t1 = vips_image_new()) || ++ im_mask2vips(mask, t1)) ++ return (-1); ++ if (vips_convf(in, &t2, t1, ++ NULL)) { ++ g_object_unref(t1); ++ return (-1); + } +- g_object_unref( t1 ); +- if( vips_image_write( t2, out ) ) { +- g_object_unref( t2 ); +- return( -1 ); ++ g_object_unref(t1); ++ if (vips_image_write(t2, out)) { ++ g_object_unref(t2); ++ return (-1); + } +- g_object_unref( t2 ); ++ g_object_unref(t2); + +- return( 0 ); ++ return (0); + } + +-int +-im_aconvsep( VipsImage *in, VipsImage *out, DOUBLEMASK *mask, int n_layers ) ++int ++im_aconvsep(VipsImage *in, VipsImage *out, DOUBLEMASK *mask, int n_layers) + { + VipsImage *t1, *t2; + +- if( !(t1 = vips_image_new()) || +- im_mask2vips( mask, t1 ) ) +- return( -1 ); +- if( vips_convasep( in, &t2, t1, +- "layers", n_layers, +- NULL ) ) { +- g_object_unref( t1 ); +- return( -1 ); ++ if (!(t1 = vips_image_new()) || ++ im_mask2vips(mask, t1)) ++ return (-1); ++ if (vips_convasep(in, &t2, t1, ++ "layers", n_layers, ++ NULL)) { ++ g_object_unref(t1); ++ return (-1); + } +- g_object_unref( t1 ); +- if( vips_image_write( t2, out ) ) { +- g_object_unref( t2 ); +- return( -1 ); ++ g_object_unref(t1); ++ if (vips_image_write(t2, out)) { ++ g_object_unref(t2); ++ return (-1); + } +- g_object_unref( t2 ); ++ g_object_unref(t2); + +- return( 0 ); ++ return (0); + } + +-int +-im_aconv( VipsImage *in, VipsImage *out, +- DOUBLEMASK *mask, int n_layers, int cluster ) ++int ++im_aconv(VipsImage *in, VipsImage *out, ++ DOUBLEMASK *mask, int n_layers, int cluster) + { + VipsImage *t1, *t2; + +- if( !(t1 = vips_image_new()) || +- im_mask2vips( mask, t1 ) ) +- return( -1 ); +- if( vips_conva( in, &t2, t1, +- "layers", n_layers, +- "cluster", cluster, +- NULL ) ) { +- g_object_unref( t1 ); +- return( -1 ); ++ if (!(t1 = vips_image_new()) || ++ im_mask2vips(mask, t1)) ++ return (-1); ++ if (vips_conva(in, &t2, t1, ++ "layers", n_layers, ++ "cluster", cluster, ++ NULL)) { ++ g_object_unref(t1); ++ return (-1); + } +- g_object_unref( t1 ); +- if( vips_image_write( t2, out ) ) { +- g_object_unref( t2 ); +- return( -1 ); ++ g_object_unref(t1); ++ if (vips_image_write(t2, out)) { ++ g_object_unref(t2); ++ return (-1); + } +- g_object_unref( t2 ); ++ g_object_unref(t2); + +- return( 0 ); ++ return (0); + } + + int +-im_conv_f_raw( VipsImage *in, VipsImage *out, DOUBLEMASK *mask ) ++im_conv_f_raw(VipsImage *in, VipsImage *out, DOUBLEMASK *mask) + { +- im_error( "im_conv_f_raw", "no compat function" ); +- return( -1 ); ++ im_error("im_conv_f_raw", "no compat function"); ++ return (-1); + } + + int +-im_addgnoise( IMAGE *in, IMAGE *out, double sigma ) ++im_addgnoise(IMAGE *in, IMAGE *out, double sigma) + { + IMAGE *t; + +- if( !(t = im_open_local( out, "im_addgnoise", "p" )) || +- im_gaussnoise( t, in->Xsize, in->Ysize, 0, sigma ) || +- im_add( in, t, out ) ) +- return( -1 ); ++ if (!(t = im_open_local(out, "im_addgnoise", "p")) || ++ im_gaussnoise(t, in->Xsize, in->Ysize, 0, sigma) || ++ im_add(in, t, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-im_contrast_surface_raw( IMAGE *in, IMAGE *out, int half_win_size, int spacing ) ++im_contrast_surface_raw(IMAGE *in, IMAGE *out, int half_win_size, int spacing) + { +- im_error( "im_contrast_surface_raw", "no compat function" ); +- return( -1 ); ++ im_error("im_contrast_surface_raw", "no compat function"); ++ return (-1); + } + + /* This replaces some custom code in 7.36 and earlier. The hand-made one was +- * slower for spacing == 1, though faster for large values of spacing. ++ * slower for spacing == 1, though faster for large values of spacing. + * +- * Not worth maintaining a special operator for. ++ * Not worth maintaining a special operator for. + */ + int +-im_contrast_surface( IMAGE *in, IMAGE *out, int half_win_size, int spacing ) ++im_contrast_surface(IMAGE *in, IMAGE *out, int half_win_size, int spacing) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 10 ); +- int size = half_win_size * 2; ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(out), 10); ++ int size = half_win_size * 2; + + int x, y; + +- t[0] = vips_image_new_matrixv( 1, 2, -1.0, 1.0 ); +- t[1] = vips_image_new_matrixv( 2, 1, -1.0, 1.0 ); +- t[8] = vips_image_new_matrix( size, size ); ++ t[0] = vips_image_new_matrixv(1, 2, -1.0, 1.0); ++ t[1] = vips_image_new_matrixv(2, 1, -1.0, 1.0); ++ t[8] = vips_image_new_matrix(size, size); + +- for( y = 0; y < size; y++ ) +- for( x = 0; x < size; x++ ) +- *VIPS_MATRIX( t[8], x, y ) = 1.0; ++ for (y = 0; y < size; y++) ++ for (x = 0; x < size; x++) ++ *VIPS_MATRIX(t[8], x, y) = 1.0; + +- if( vips_conv( in, &t[2], t[0], ++ if (vips_conv(in, &t[2], t[0], + "precision", VIPS_PRECISION_INTEGER, +- NULL ) || +- vips_conv( in, &t[3], t[1], ++ NULL) || ++ vips_conv(in, &t[3], t[1], + "precision", VIPS_PRECISION_INTEGER, +- NULL ) || +- vips_abs( t[2], &t[4], NULL ) || +- vips_abs( t[3], &t[5], NULL ) || +- vips_add( t[4], t[5], &t[6], NULL ) || +- vips_conv( t[6], &t[7], t[8], ++ NULL) || ++ vips_abs(t[2], &t[4], NULL) || ++ vips_abs(t[3], &t[5], NULL) || ++ vips_add(t[4], t[5], &t[6], NULL) || ++ vips_conv(t[6], &t[7], t[8], + "precision", VIPS_PRECISION_INTEGER, +- NULL ) || +- vips_subsample( t[7], &t[9], spacing, spacing, NULL ) || +- vips_image_write( t[9], out ) ) +- return( -1 ); ++ NULL) || ++ vips_subsample(t[7], &t[9], spacing, spacing, NULL) || ++ vips_image_write(t[9], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-im_spcor_raw( IMAGE *in, IMAGE *ref, IMAGE *out ) ++im_spcor_raw(IMAGE *in, IMAGE *ref, IMAGE *out) + { +- im_error( "im_spcor_raw", "no compat function" ); +- return( -1 ); ++ im_error("im_spcor_raw", "no compat function"); ++ return (-1); + } + + int +-im_spcor( IMAGE *in, IMAGE *ref, IMAGE *out ) ++im_spcor(IMAGE *in, IMAGE *ref, IMAGE *out) + { + VipsImage *x; + +- if( vips_call( "spcor", in, ref, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_call("spcor", in, ref, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_fastcor_raw( IMAGE *in, IMAGE *ref, IMAGE *out ) ++im_fastcor_raw(IMAGE *in, IMAGE *ref, IMAGE *out) + { +- im_error( "im_fastcor_raw", "no compat function" ); +- return( -1 ); ++ im_error("im_fastcor_raw", "no compat function"); ++ return (-1); + } + + int +-im_fastcor( IMAGE *in, IMAGE *ref, IMAGE *out ) ++im_fastcor(IMAGE *in, IMAGE *ref, IMAGE *out) + { + VipsImage *x; + +- if( vips_call( "fastcor", in, ref, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_call("fastcor", in, ref, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_sharpen( IMAGE *in, IMAGE *out, +- int mask_size, +- double x1, double y2, double y3, +- double m1, double m2 ) ++im_sharpen(IMAGE *in, IMAGE *out, ++ int mask_size, ++ double x1, double y2, double y3, ++ double m1, double m2) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 2 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(out), 2); + + /* im_sharpen() always recoded as labq and im_benchmark() depends +- * upon this behaviour. ++ * upon this behaviour. + */ +- if( vips_call( "sharpen", in, &t[0], +- "sigma", mask_size / 4.0, +- "x1", x1, +- "y2", y2, +- "y3", y3, +- "m1", m1, +- "m2", m2, +- NULL ) || +- vips_colourspace( t[0], &t[1], +- VIPS_INTERPRETATION_LABQ, NULL ) || +- vips_image_write( t[1], out ) ) +- return( -1 ); +- +- return( 0 ); ++ if (vips_call("sharpen", in, &t[0], ++ "sigma", mask_size / 4.0, ++ "x1", x1, ++ "y2", y2, ++ "y3", y3, ++ "m1", m1, ++ "m2", m2, ++ NULL) || ++ vips_colourspace(t[0], &t[1], ++ VIPS_INTERPRETATION_LABQ, NULL) || ++ vips_image_write(t[1], out)) ++ return (-1); ++ ++ return (0); + } + + static int +-vips__round( VipsImage *in, VipsImage *out, VipsOperationRound round ) ++vips__round(VipsImage *in, VipsImage *out, VipsOperationRound round) + { + VipsImage *t; + +- if( vips_round( in, &t, round, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_round(in, &t, round, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_rint( IMAGE *in, IMAGE *out ) ++int ++im_rint(IMAGE *in, IMAGE *out) + { +- return( vips__round( in, out, VIPS_OPERATION_ROUND_RINT ) ); ++ return (vips__round(in, out, VIPS_OPERATION_ROUND_RINT)); + } + +-int +-im_floor( IMAGE *in, IMAGE *out ) ++int ++im_floor(IMAGE *in, IMAGE *out) + { +- return( vips__round( in, out, VIPS_OPERATION_ROUND_FLOOR ) ); ++ return (vips__round(in, out, VIPS_OPERATION_ROUND_FLOOR)); + } + +-int +-im_ceil( IMAGE *in, IMAGE *out ) ++int ++im_ceil(IMAGE *in, IMAGE *out) + { +- return( vips__round( in, out, VIPS_OPERATION_ROUND_CEIL ) ); ++ return (vips__round(in, out, VIPS_OPERATION_ROUND_CEIL)); + } + +-static int +-vips__relational( IMAGE *in1, IMAGE *in2, IMAGE *out, +- VipsOperationRelational relational ) ++static int ++vips__relational(IMAGE *in1, IMAGE *in2, IMAGE *out, ++ VipsOperationRelational relational) + { + VipsImage *t; + +- if( vips_relational( in1, in2, &t, relational, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_relational(in1, in2, &t, relational, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_equal( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_equal(IMAGE *in1, IMAGE *in2, IMAGE *out) + { +- return( vips__relational( in1, in2, out, +- VIPS_OPERATION_RELATIONAL_EQUAL ) ); ++ return (vips__relational(in1, in2, out, ++ VIPS_OPERATION_RELATIONAL_EQUAL)); + } + +-int +-im_notequal( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_notequal(IMAGE *in1, IMAGE *in2, IMAGE *out) + { +- return( vips__relational( in1, in2, out, +- VIPS_OPERATION_RELATIONAL_NOTEQ ) ); ++ return (vips__relational(in1, in2, out, ++ VIPS_OPERATION_RELATIONAL_NOTEQ)); + } + +-int +-im_less( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_less(IMAGE *in1, IMAGE *in2, IMAGE *out) + { +- return( vips__relational( in1, in2, out, +- VIPS_OPERATION_RELATIONAL_LESS ) ); ++ return (vips__relational(in1, in2, out, ++ VIPS_OPERATION_RELATIONAL_LESS)); + } + +-int +-im_lesseq( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_lesseq(IMAGE *in1, IMAGE *in2, IMAGE *out) + { +- return( vips__relational( in1, in2, out, +- VIPS_OPERATION_RELATIONAL_LESSEQ ) ); ++ return (vips__relational(in1, in2, out, ++ VIPS_OPERATION_RELATIONAL_LESSEQ)); + } + +-int +-im_more( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_more(IMAGE *in1, IMAGE *in2, IMAGE *out) + { +- return( vips__relational( in1, in2, out, +- VIPS_OPERATION_RELATIONAL_MORE ) ); ++ return (vips__relational(in1, in2, out, ++ VIPS_OPERATION_RELATIONAL_MORE)); + } + +-int +-im_moreeq( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_moreeq(IMAGE *in1, IMAGE *in2, IMAGE *out) + { +- return( vips__relational( in1, in2, out, +- VIPS_OPERATION_RELATIONAL_MOREEQ ) ); ++ return (vips__relational(in1, in2, out, ++ VIPS_OPERATION_RELATIONAL_MOREEQ)); + } + +-static int +-vips__relational_vec( IMAGE *in, IMAGE *out, +- VipsOperationRelational relational, double *c, int n ) ++static int ++vips__relational_vec(IMAGE *in, IMAGE *out, ++ VipsOperationRelational relational, double *c, int n) + { + VipsImage *t; + +- if( vips_relational_const( in, &t, relational, c, n, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_relational_const(in, &t, relational, c, n, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_equal_vec( VipsImage *in, VipsImage *out, int n, double *c ) ++int ++im_equal_vec(VipsImage *in, VipsImage *out, int n, double *c) + { +- return( vips__relational_vec( in, out, +- VIPS_OPERATION_RELATIONAL_EQUAL, c, n ) ); ++ return (vips__relational_vec(in, out, ++ VIPS_OPERATION_RELATIONAL_EQUAL, c, n)); + } + +-int +-im_notequal_vec( VipsImage *in, VipsImage *out, int n, double *c ) ++int ++im_notequal_vec(VipsImage *in, VipsImage *out, int n, double *c) + { +- return( vips__relational_vec( in, out, +- VIPS_OPERATION_RELATIONAL_NOTEQ, c, n ) ); ++ return (vips__relational_vec(in, out, ++ VIPS_OPERATION_RELATIONAL_NOTEQ, c, n)); + } + +-int +-im_less_vec( VipsImage *in, VipsImage *out, int n, double *c ) ++int ++im_less_vec(VipsImage *in, VipsImage *out, int n, double *c) + { +- return( vips__relational_vec( in, out, +- VIPS_OPERATION_RELATIONAL_LESS, c, n ) ); ++ return (vips__relational_vec(in, out, ++ VIPS_OPERATION_RELATIONAL_LESS, c, n)); + } + +-int +-im_lesseq_vec( VipsImage *in, VipsImage *out, int n, double *c ) ++int ++im_lesseq_vec(VipsImage *in, VipsImage *out, int n, double *c) + { +- return( vips__relational_vec( in, out, +- VIPS_OPERATION_RELATIONAL_LESSEQ, c, n ) ); ++ return (vips__relational_vec(in, out, ++ VIPS_OPERATION_RELATIONAL_LESSEQ, c, n)); + } + +-int +-im_more_vec( VipsImage *in, VipsImage *out, int n, double *c ) ++int ++im_more_vec(VipsImage *in, VipsImage *out, int n, double *c) + { +- return( vips__relational_vec( in, out, +- VIPS_OPERATION_RELATIONAL_MORE, c, n ) ); ++ return (vips__relational_vec(in, out, ++ VIPS_OPERATION_RELATIONAL_MORE, c, n)); + } + +-int +-im_moreeq_vec( VipsImage *in, VipsImage *out, int n, double *c ) ++int ++im_moreeq_vec(VipsImage *in, VipsImage *out, int n, double *c) + { +- return( vips__relational_vec( in, out, +- VIPS_OPERATION_RELATIONAL_MOREEQ, c, n ) ); ++ return (vips__relational_vec(in, out, ++ VIPS_OPERATION_RELATIONAL_MOREEQ, c, n)); + } + +-int +-im_equalconst( IMAGE *in, IMAGE *out, double c ) ++int ++im_equalconst(IMAGE *in, IMAGE *out, double c) + { +- return( im_equal_vec( in, out, 1, &c ) ); ++ return (im_equal_vec(in, out, 1, &c)); + } + + int +-im_notequalconst( IMAGE *in, IMAGE *out, double c ) ++im_notequalconst(IMAGE *in, IMAGE *out, double c) + { +- return( im_notequal_vec( in, out, 1, &c ) ); ++ return (im_notequal_vec(in, out, 1, &c)); + } + + int +-im_lessconst( IMAGE *in, IMAGE *out, double c ) ++im_lessconst(IMAGE *in, IMAGE *out, double c) + { +- return( im_less_vec( in, out, 1, &c ) ); ++ return (im_less_vec(in, out, 1, &c)); + } + + int +-im_lesseqconst( IMAGE *in, IMAGE *out, double c ) ++im_lesseqconst(IMAGE *in, IMAGE *out, double c) + { +- return( im_lesseq_vec( in, out, 1, &c ) ); ++ return (im_lesseq_vec(in, out, 1, &c)); + } + + int +-im_moreconst( IMAGE *in, IMAGE *out, double c ) ++im_moreconst(IMAGE *in, IMAGE *out, double c) + { +- return( im_more_vec( in, out, 1, &c ) ); ++ return (im_more_vec(in, out, 1, &c)); + } + + int +-im_moreeqconst( IMAGE *in, IMAGE *out, double c ) ++im_moreeqconst(IMAGE *in, IMAGE *out, double c) + { +- return( im_moreeq_vec( in, out, 1, &c ) ); ++ return (im_moreeq_vec(in, out, 1, &c)); + } + +-int +-im_remainder( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_remainder(IMAGE *in1, IMAGE *in2, IMAGE *out) + { + VipsImage *t; + +- if( vips_remainder( in1, in2, &t, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_remainder(in1, in2, &t, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_remainder_vec( IMAGE *in, IMAGE *out, int n, double *c ) ++int ++im_remainder_vec(IMAGE *in, IMAGE *out, int n, double *c) + { + VipsImage *t; + +- if( vips_remainder_const( in, &t, c, n, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_remainder_const(in, &t, c, n, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_remainderconst( IMAGE *in, IMAGE *out, double c ) ++int ++im_remainderconst(IMAGE *in, IMAGE *out, double c) + { +- return( im_remainder_vec( in, out, 1, &c ) ); ++ return (im_remainder_vec(in, out, 1, &c)); + } + +-static int +-vips__boolean( IMAGE *in1, IMAGE *in2, IMAGE *out, +- VipsOperationBoolean boolean ) ++static int ++vips__boolean(IMAGE *in1, IMAGE *in2, IMAGE *out, ++ VipsOperationBoolean boolean) + { + VipsImage *t; + +- if( vips_boolean( in1, in2, &t, boolean, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_boolean(in1, in2, &t, boolean, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_andimage( VipsImage *in1, VipsImage *in2, VipsImage *out ) ++int ++im_andimage(VipsImage *in1, VipsImage *in2, VipsImage *out) + { +- return( vips__boolean( in1, in2, out, VIPS_OPERATION_BOOLEAN_AND ) ); ++ return (vips__boolean(in1, in2, out, VIPS_OPERATION_BOOLEAN_AND)); + } + +-int +-im_orimage( VipsImage *in1, VipsImage *in2, VipsImage *out ) ++int ++im_orimage(VipsImage *in1, VipsImage *in2, VipsImage *out) + { +- return( vips__boolean( in1, in2, out, VIPS_OPERATION_BOOLEAN_OR ) ); ++ return (vips__boolean(in1, in2, out, VIPS_OPERATION_BOOLEAN_OR)); + } + +-int +-im_eorimage( VipsImage *in1, VipsImage *in2, VipsImage *out ) ++int ++im_eorimage(VipsImage *in1, VipsImage *in2, VipsImage *out) + { +- return( vips__boolean( in1, in2, out, VIPS_OPERATION_BOOLEAN_EOR ) ); ++ return (vips__boolean(in1, in2, out, VIPS_OPERATION_BOOLEAN_EOR)); + } + +-static int +-vips__boolean_vec( IMAGE *in, IMAGE *out, +- VipsOperationBoolean boolean, double *c, int n ) ++static int ++vips__boolean_vec(IMAGE *in, IMAGE *out, ++ VipsOperationBoolean boolean, double *c, int n) + { + VipsImage *t; + +- if( vips_boolean_const( in, &t, boolean, c, n, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_boolean_const(in, &t, boolean, c, n, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_andimage_vec( VipsImage *in, VipsImage *out, int n, double *c ) ++int ++im_andimage_vec(VipsImage *in, VipsImage *out, int n, double *c) + { +- return( vips__boolean_vec( in, out, +- VIPS_OPERATION_BOOLEAN_AND, c, n ) ); ++ return (vips__boolean_vec(in, out, ++ VIPS_OPERATION_BOOLEAN_AND, c, n)); + } + +-int +-im_orimage_vec( VipsImage *in, VipsImage *out, int n, double *c ) ++int ++im_orimage_vec(VipsImage *in, VipsImage *out, int n, double *c) + { +- return( vips__boolean_vec( in, out, +- VIPS_OPERATION_BOOLEAN_OR, c, n ) ); ++ return (vips__boolean_vec(in, out, ++ VIPS_OPERATION_BOOLEAN_OR, c, n)); + } + +-int +-im_eorimage_vec( VipsImage *in, VipsImage *out, int n, double *c ) ++int ++im_eorimage_vec(VipsImage *in, VipsImage *out, int n, double *c) + { +- return( vips__boolean_vec( in, out, +- VIPS_OPERATION_BOOLEAN_EOR, c, n ) ); ++ return (vips__boolean_vec(in, out, ++ VIPS_OPERATION_BOOLEAN_EOR, c, n)); + } + +-int +-im_shiftleft_vec( IMAGE *in, IMAGE *out, int n, double *c ) ++int ++im_shiftleft_vec(IMAGE *in, IMAGE *out, int n, double *c) + { +- return( vips__boolean_vec( in, out, +- VIPS_OPERATION_BOOLEAN_LSHIFT, c, n ) ); ++ return (vips__boolean_vec(in, out, ++ VIPS_OPERATION_BOOLEAN_LSHIFT, c, n)); + } + +-int +-im_shiftright_vec( IMAGE *in, IMAGE *out, int n, double *c ) ++int ++im_shiftright_vec(IMAGE *in, IMAGE *out, int n, double *c) + { +- return( vips__boolean_vec( in, out, +- VIPS_OPERATION_BOOLEAN_RSHIFT, c, n ) ); ++ return (vips__boolean_vec(in, out, ++ VIPS_OPERATION_BOOLEAN_RSHIFT, c, n)); + } + +-int +-im_andimageconst( IMAGE *in, IMAGE *out, double c ) ++int ++im_andimageconst(IMAGE *in, IMAGE *out, double c) + { +- return( im_andimage_vec( in, out, 1, &c ) ); ++ return (im_andimage_vec(in, out, 1, &c)); + } + +-int +-im_orimageconst( IMAGE *in, IMAGE *out, double c ) ++int ++im_orimageconst(IMAGE *in, IMAGE *out, double c) + { +- return( im_orimage_vec( in, out, 1, &c ) ); ++ return (im_orimage_vec(in, out, 1, &c)); + } + +-int +-im_eorimageconst( IMAGE *in, IMAGE *out, double c ) ++int ++im_eorimageconst(IMAGE *in, IMAGE *out, double c) + { +- return( im_eorimage_vec( in, out, 1, &c ) ); ++ return (im_eorimage_vec(in, out, 1, &c)); + } + +-int +-im_shiftleft( IMAGE *in, IMAGE *out, int n ) ++int ++im_shiftleft(IMAGE *in, IMAGE *out, int n) + { + double c = n; + +- return( im_shiftleft_vec( in, out, 1, &c ) ); ++ return (im_shiftleft_vec(in, out, 1, &c)); + } + +-int +-im_shiftright( IMAGE *in, IMAGE *out, int n ) ++int ++im_shiftright(IMAGE *in, IMAGE *out, int n) + { + double c = n; + +- return( im_shiftright_vec( in, out, 1, &c ) ); ++ return (im_shiftright_vec(in, out, 1, &c)); + } + +-static int +-vips__math2_vec( IMAGE *in, IMAGE *out, +- VipsOperationMath2 math2, double *c, int n ) ++static int ++vips__math2_vec(IMAGE *in, IMAGE *out, ++ VipsOperationMath2 math2, double *c, int n) + { + VipsImage *t; + +- if( vips_math2_const( in, &t, math2, c, n, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_math2_const(in, &t, math2, c, n, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_powtra_vec( VipsImage *in, VipsImage *out, int n, double *c ) ++int ++im_powtra_vec(VipsImage *in, VipsImage *out, int n, double *c) + { +- return( vips__math2_vec( in, out, VIPS_OPERATION_MATH2_POW, c, n ) ); ++ return (vips__math2_vec(in, out, VIPS_OPERATION_MATH2_POW, c, n)); + } + +-int +-im_powtra( IMAGE *in, IMAGE *out, double c ) ++int ++im_powtra(IMAGE *in, IMAGE *out, double c) + { +- return( im_powtra_vec( in, out, 1, &c ) ); ++ return (im_powtra_vec(in, out, 1, &c)); + } + +-int +-im_expntra_vec( IMAGE *in, IMAGE *out, int n, double *c ) ++int ++im_expntra_vec(IMAGE *in, IMAGE *out, int n, double *c) + { +- return( vips__math2_vec( in, out, VIPS_OPERATION_MATH2_WOP, c, n ) ); ++ return (vips__math2_vec(in, out, VIPS_OPERATION_MATH2_WOP, c, n)); + } + +-int +-im_expntra( IMAGE *in, IMAGE *out, double c ) ++int ++im_expntra(IMAGE *in, IMAGE *out, double c) + { +- return( im_expntra_vec( in, out, 1, &c ) ); ++ return (im_expntra_vec(in, out, 1, &c)); + } + +-int +-im_ifthenelse( VipsImage *c, VipsImage *a, VipsImage *b, VipsImage *out ) ++int ++im_ifthenelse(VipsImage *c, VipsImage *a, VipsImage *b, VipsImage *out) + { + VipsImage *t; + +- if( vips_ifthenelse( c, a, b, &t, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_ifthenelse(c, a, b, &t, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_blend( VipsImage *c, VipsImage *a, VipsImage *b, VipsImage *out ) ++int ++im_blend(VipsImage *c, VipsImage *a, VipsImage *b, VipsImage *out) + { + VipsImage *t; + +- if( vips_ifthenelse( c, a, b, &t, +- "blend", TRUE, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_ifthenelse(c, a, b, &t, ++ "blend", TRUE, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + static int +-vips__complex( VipsImage *in, VipsImage *out, VipsOperationComplex cmplx ) ++vips__complex(VipsImage *in, VipsImage *out, VipsOperationComplex cmplx) + { + VipsImage *t; + +- if( vips_complex( in, &t, cmplx, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_complex(in, &t, cmplx, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_c2amph( IMAGE *in, IMAGE *out ) ++int ++im_c2amph(IMAGE *in, IMAGE *out) + { +- return( vips__complex( in, out, VIPS_OPERATION_COMPLEX_POLAR ) ); ++ return (vips__complex(in, out, VIPS_OPERATION_COMPLEX_POLAR)); + } + +-int +-im_c2rect( IMAGE *in, IMAGE *out ) ++int ++im_c2rect(IMAGE *in, IMAGE *out) + { +- return( vips__complex( in, out, VIPS_OPERATION_COMPLEX_RECT ) ); ++ return (vips__complex(in, out, VIPS_OPERATION_COMPLEX_RECT)); + } + + static int +-vips__complexget( VipsImage *in, VipsImage *out, VipsOperationComplexget get ) ++vips__complexget(VipsImage *in, VipsImage *out, VipsOperationComplexget get) + { + VipsImage *t; + +- if( vips_complexget( in, &t, get, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_complexget(in, &t, get, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_c2real( IMAGE *in, IMAGE *out ) ++int ++im_c2real(IMAGE *in, IMAGE *out) + { +- return( vips__complexget( in, out, VIPS_OPERATION_COMPLEXGET_REAL ) ); ++ return (vips__complexget(in, out, VIPS_OPERATION_COMPLEXGET_REAL)); + } + +-int +-im_c2imag( IMAGE *in, IMAGE *out ) ++int ++im_c2imag(IMAGE *in, IMAGE *out) + { +- return( vips__complexget( in, out, VIPS_OPERATION_COMPLEXGET_IMAG ) ); ++ return (vips__complexget(in, out, VIPS_OPERATION_COMPLEXGET_IMAG)); + } + +-int +-im_ri2c( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_ri2c(IMAGE *in1, IMAGE *in2, IMAGE *out) + { + VipsImage *x; + +- if( vips_call( "complexform", in1, in2, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_call("complexform", in1, in2, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_cache( VipsImage *in, VipsImage *out, +- int width, int height, int max ) ++im_cache(VipsImage *in, VipsImage *out, ++ int width, int height, int max) + { +- return( vips_sink_screen( in, out, NULL, +- width, height, max, 0, NULL, NULL ) ); ++ return (vips_sink_screen(in, out, NULL, ++ width, height, max, 0, NULL, NULL)); + } + + int +-im_argb2rgba( VipsImage *in, VipsImage *out ) ++im_argb2rgba(VipsImage *in, VipsImage *out) + { + /* No longer exists, just a null op. + */ +- return( vips_image_write( in, out ) ); ++ return (vips_image_write(in, out)); + } + + int +-im_shrink( VipsImage *in, VipsImage *out, double xshrink, double yshrink ) ++im_shrink(VipsImage *in, VipsImage *out, double xshrink, double yshrink) + { + VipsImage *x; + +- if( vips_shrink( in, &x, xshrink, yshrink, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_shrink(in, &x, xshrink, yshrink, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_eye( IMAGE *out, const int xsize, const int ysize, const double factor ) ++im_eye(IMAGE *out, const int xsize, const int ysize, const double factor) + { + VipsImage *x; + +- if( vips_eye( &x, xsize, ysize, +- "factor", factor, +- "uchar", TRUE, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_eye(&x, xsize, ysize, ++ "factor", factor, ++ "uchar", TRUE, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_feye( IMAGE *out, const int xsize, const int ysize, const double factor ) ++im_feye(IMAGE *out, const int xsize, const int ysize, const double factor) + { + VipsImage *x; + +- if( vips_eye( &x, xsize, ysize, +- "factor", factor, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_eye(&x, xsize, ysize, ++ "factor", factor, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_grey( IMAGE *out, const int xsize, const int ysize ) ++im_grey(IMAGE *out, const int xsize, const int ysize) + { + VipsImage *x; + +- if( vips_grey( &x, xsize, ysize, +- "uchar", TRUE, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_grey(&x, xsize, ysize, ++ "uchar", TRUE, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_fgrey( IMAGE *out, const int xsize, const int ysize ) ++im_fgrey(IMAGE *out, const int xsize, const int ysize) + { + VipsImage *x; + +- if( vips_grey( &x, xsize, ysize, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_grey(&x, xsize, ysize, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_buildlut( DOUBLEMASK *input, VipsImage *out ) ++im_buildlut(DOUBLEMASK *input, VipsImage *out) + { + VipsImage *mat; + VipsImage *x; + + mat = vips_image_new(); +- if( im_mask2vips( input, mat ) ) +- return( -1 ); +- if( vips_buildlut( mat, &x, +- NULL ) ) { +- g_object_unref( mat ); +- return( -1 ); ++ if (im_mask2vips(input, mat)) ++ return (-1); ++ if (vips_buildlut(mat, &x, ++ NULL)) { ++ g_object_unref(mat); ++ return (-1); + } +- g_object_unref( mat ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ g_object_unref(mat); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_invertlut( DOUBLEMASK *input, VipsImage *out, int size ) ++im_invertlut(DOUBLEMASK *input, VipsImage *out, int size) + { + VipsImage *mat; + VipsImage *x; + + mat = vips_image_new(); +- if( im_mask2vips( input, mat ) ) +- return( -1 ); +- if( vips_invertlut( mat, &x, +- "size", size, +- NULL ) ) { +- g_object_unref( mat ); +- return( -1 ); ++ if (im_mask2vips(input, mat)) ++ return (-1); ++ if (vips_invertlut(mat, &x, ++ "size", size, ++ NULL)) { ++ g_object_unref(mat); ++ return (-1); + } +- g_object_unref( mat ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ g_object_unref(mat); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_tone_build_range( IMAGE *out, ++int ++im_tone_build_range(IMAGE *out, + int in_max, int out_max, + double Lb, double Lw, +- double Ps, double Pm, double Ph, +- double S, double M, double H ) ++ double Ps, double Pm, double Ph, ++ double S, double M, double H) + { + VipsImage *t; + +- if( vips_tonelut( &t, +- "in_max", in_max, +- "out_max", out_max, +- "Lb", Lb, +- "Lw", Lw, +- "Ps", Ps, +- "Pm", Pm, +- "Ph", Ph, +- "S", S, +- "M", M, +- "H", H, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); +- } +- g_object_unref( t ); +- +- return( 0 ); +-} +- +-int +-im_tone_build( IMAGE *out, ++ if (vips_tonelut(&t, ++ "in_max", in_max, ++ "out_max", out_max, ++ "Lb", Lb, ++ "Lw", Lw, ++ "Ps", Ps, ++ "Pm", Pm, ++ "Ph", Ph, ++ "S", S, ++ "M", M, ++ "H", H, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); ++ } ++ g_object_unref(t); ++ ++ return (0); ++} ++ ++int ++im_tone_build(IMAGE *out, + double Lb, double Lw, +- double Ps, double Pm, double Ph, +- double S, double M, double H ) ++ double Ps, double Pm, double Ph, ++ double S, double M, double H) + { + IMAGE *t1; + +- if( !(t1 = im_open_local( out, "im_tone_build", "p" )) || +- im_tone_build_range( t1, 32767, 32767, +- Lb, Lw, Ps, Pm, Ph, S, M, H ) || +- im_clip2fmt( t1, out, IM_BANDFMT_SHORT ) ) +- return( -1 ); ++ if (!(t1 = im_open_local(out, "im_tone_build", "p")) || ++ im_tone_build_range(t1, 32767, 32767, ++ Lb, Lw, Ps, Pm, Ph, S, M, H) || ++ im_clip2fmt(t1, out, IM_BANDFMT_SHORT)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-im_rightshift_size( IMAGE *in, IMAGE *out, +- int xshift, int yshift, int band_fmt ) ++im_rightshift_size(IMAGE *in, IMAGE *out, ++ int xshift, int yshift, int band_fmt) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 2 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(out), 2); + +- if( vips_shrink( in, &t[0], 1 << xshift, 1 << yshift, NULL ) || +- vips_cast( t[0], &t[1], band_fmt, NULL ) || +- vips_image_write( t[1], out ) ) +- return( -1 ); ++ if (vips_shrink(in, &t[0], 1 << xshift, 1 << yshift, NULL) || ++ vips_cast(t[0], &t[1], band_fmt, NULL) || ++ vips_image_write(t[1], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_Lab2XYZ_temp( IMAGE *in, IMAGE *out, double X0, double Y0, double Z0 ) ++int ++im_Lab2XYZ_temp(IMAGE *in, IMAGE *out, double X0, double Y0, double Z0) + { + VipsArea *temp; + VipsImage *x; + +- temp = VIPS_AREA( vips_array_double_newv( 3, X0, Y0, Z0 ) ); +- if( vips_Lab2XYZ( in, &x, "temp", temp, NULL ) ) { +- vips_area_unref( temp ); +- return( -1 ); ++ temp = VIPS_AREA(vips_array_double_newv(3, X0, Y0, Z0)); ++ if (vips_Lab2XYZ(in, &x, "temp", temp, NULL)) { ++ vips_area_unref(temp); ++ return (-1); + } +- vips_area_unref( temp ); ++ vips_area_unref(temp); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_Lab2XYZ( IMAGE *in, IMAGE *out ) ++int ++im_Lab2XYZ(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_Lab2XYZ( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_Lab2XYZ(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_XYZ2Lab_temp( IMAGE *in, IMAGE *out, double X0, double Y0, double Z0 ) ++int ++im_XYZ2Lab_temp(IMAGE *in, IMAGE *out, double X0, double Y0, double Z0) + { + double ary[3]; + VipsArea *temp; +@@ -3429,443 +3468,443 @@ im_XYZ2Lab_temp( IMAGE *in, IMAGE *out, double X0, double Y0, double Z0 ) + ary[0] = X0; + ary[1] = Y0; + ary[2] = Z0; +- temp = VIPS_AREA( vips_array_double_new( ary, 3 ) ); +- if( vips_XYZ2Lab( in, &x, "temp", temp, NULL ) ) { +- vips_area_unref( temp ); +- return( -1 ); ++ temp = VIPS_AREA(vips_array_double_new(ary, 3)); ++ if (vips_XYZ2Lab(in, &x, "temp", temp, NULL)) { ++ vips_area_unref(temp); ++ return (-1); + } +- vips_area_unref( temp ); ++ vips_area_unref(temp); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_XYZ2Lab( IMAGE *in, IMAGE *out ) ++int ++im_XYZ2Lab(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_XYZ2Lab( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_XYZ2Lab(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_Lab2LCh( IMAGE *in, IMAGE *out ) ++int ++im_Lab2LCh(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_Lab2LCh( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_Lab2LCh(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_LCh2Lab( IMAGE *in, IMAGE *out ) ++int ++im_LCh2Lab(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_LCh2Lab( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_LCh2Lab(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_LCh2UCS( IMAGE *in, IMAGE *out ) ++int ++im_LCh2UCS(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_LCh2CMC( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_LCh2CMC(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_UCS2LCh( IMAGE *in, IMAGE *out ) ++int ++im_UCS2LCh(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_CMC2LCh( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_CMC2LCh(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_XYZ2Yxy( IMAGE *in, IMAGE *out ) ++int ++im_XYZ2Yxy(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_XYZ2Yxy( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_XYZ2Yxy(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_Yxy2XYZ( IMAGE *in, IMAGE *out ) ++int ++im_Yxy2XYZ(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_Yxy2XYZ( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_Yxy2XYZ(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_float2rad( IMAGE *in, IMAGE *out ) ++int ++im_float2rad(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_float2rad( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_float2rad(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_rad2float( IMAGE *in, IMAGE *out ) ++int ++im_rad2float(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_rad2float( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_rad2float(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_Lab2LabQ( IMAGE *in, IMAGE *out ) ++int ++im_Lab2LabQ(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_Lab2LabQ( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_Lab2LabQ(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_LabQ2Lab( IMAGE *in, IMAGE *out ) ++int ++im_LabQ2Lab(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_LabQ2Lab( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_LabQ2Lab(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_Lab2LabS( IMAGE *in, IMAGE *out ) ++int ++im_Lab2LabS(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_Lab2LabS( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_Lab2LabS(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_LabS2Lab( IMAGE *in, IMAGE *out ) ++int ++im_LabS2Lab(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_LabS2Lab( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_LabS2Lab(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_LabQ2LabS( IMAGE *in, IMAGE *out ) ++int ++im_LabQ2LabS(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_LabQ2LabS( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_LabQ2LabS(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_LabS2LabQ( IMAGE *in, IMAGE *out ) ++int ++im_LabS2LabQ(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_LabS2LabQ( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_LabS2LabQ(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_Lab2disp( IMAGE *in, IMAGE *out, struct im_col_display *disp ) +-{ ++int ++im_Lab2disp(IMAGE *in, IMAGE *out, struct im_col_display *disp) ++{ + IMAGE *t[1]; + +- if( im_open_local_array( out, t, 1, "im_Lab2disp:1", "p" ) || +- im_Lab2XYZ( in, t[0] ) || +- im_XYZ2disp( t[0], out, disp ) ) +- return( -1 ); ++ if (im_open_local_array(out, t, 1, "im_Lab2disp:1", "p") || ++ im_Lab2XYZ(in, t[0]) || ++ im_XYZ2disp(t[0], out, disp)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_dECMC_fromdisp( IMAGE *im1, IMAGE *im2, +- IMAGE *out, struct im_col_display *d ) +-{ ++int ++im_dECMC_fromdisp(IMAGE *im1, IMAGE *im2, ++ IMAGE *out, struct im_col_display *d) ++{ + IMAGE *t[4]; + +- if( im_open_local_array( out, t, 4, "im_dECMC_fromdisp:1", "p" ) || +- im_disp2XYZ( im1, t[0], d ) || +- im_XYZ2Lab( t[0], t[1] ) || +- im_disp2XYZ( im2, t[2], d ) || +- im_XYZ2Lab( t[2], t[3] ) || +- im_dECMC_fromLab( t[1], t[3], out ) ) +- return( -1 ); ++ if (im_open_local_array(out, t, 4, "im_dECMC_fromdisp:1", "p") || ++ im_disp2XYZ(im1, t[0], d) || ++ im_XYZ2Lab(t[0], t[1]) || ++ im_disp2XYZ(im2, t[2], d) || ++ im_XYZ2Lab(t[2], t[3]) || ++ im_dECMC_fromLab(t[1], t[3], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_dE_fromdisp( IMAGE *im1, IMAGE *im2, IMAGE *out, struct im_col_display *d ) ++int ++im_dE_fromdisp(IMAGE *im1, IMAGE *im2, IMAGE *out, struct im_col_display *d) + { + IMAGE *t[2]; + +- if( im_open_local_array( out, t, 2, "im_dE_fromdisp:1", "p" ) || +- im_disp2XYZ( im1, t[0], d ) || +- im_disp2XYZ( im2, t[1], d ) || +- im_dE_fromXYZ( t[0], t[1], out ) ) +- return( -1 ); ++ if (im_open_local_array(out, t, 2, "im_dE_fromdisp:1", "p") || ++ im_disp2XYZ(im1, t[0], d) || ++ im_disp2XYZ(im2, t[1], d) || ++ im_dE_fromXYZ(t[0], t[1], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_disp2Lab( IMAGE *in, IMAGE *out, struct im_col_display *d ) ++int ++im_disp2Lab(IMAGE *in, IMAGE *out, struct im_col_display *d) + { + VipsImage *t[1]; + +- if( im_open_local_array( out, t, 1, "im_disp2Lab:1", "p" ) || +- im_disp2XYZ( in, t[0], d ) || +- im_XYZ2Lab( t[0], out ) ) +- return( -1 ); +- +- return( 0 ); ++ if (im_open_local_array(out, t, 1, "im_disp2Lab:1", "p") || ++ im_disp2XYZ(in, t[0], d) || ++ im_XYZ2Lab(t[0], out)) ++ return (-1); ++ ++ return (0); + } + +-int +-im_sRGB2XYZ( IMAGE *in, IMAGE *out ) ++int ++im_sRGB2XYZ(IMAGE *in, IMAGE *out) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( (VipsObject *) out, 2 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array((VipsObject *) out, 2); + +- if( vips_sRGB2scRGB( in, &t[0], NULL ) || +- vips_scRGB2XYZ( t[0], &t[1], NULL ) || +- vips_image_write( t[1], out ) ) +- return( -1 ); ++ if (vips_sRGB2scRGB(in, &t[0], NULL) || ++ vips_scRGB2XYZ(t[0], &t[1], NULL) || ++ vips_image_write(t[1], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_XYZ2sRGB( IMAGE *in, IMAGE *out ) ++int ++im_XYZ2sRGB(IMAGE *in, IMAGE *out) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( (VipsObject *) out, 2 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array((VipsObject *) out, 2); + +- if( vips_XYZ2scRGB( in, &t[0], NULL ) || +- vips_scRGB2sRGB( t[0], &t[1], NULL ) || +- vips_image_write( t[1], out ) ) +- return( -1 ); ++ if (vips_XYZ2scRGB(in, &t[0], NULL) || ++ vips_scRGB2sRGB(t[0], &t[1], NULL) || ++ vips_image_write(t[1], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_LabQ2sRGB( IMAGE *in, IMAGE *out ) ++int ++im_LabQ2sRGB(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_LabQ2sRGB( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_LabQ2sRGB(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_icc_transform( VipsImage *in, VipsImage *out, ++int ++im_icc_transform(VipsImage *in, VipsImage *out, + const char *input_profile_filename, + const char *output_profile_filename, +- VipsIntent intent ) ++ VipsIntent intent) + { + VipsImage *x; + +- if( vips_icc_transform( in, &x, output_profile_filename, +- "input_profile", input_profile_filename, +- "intent", intent, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_icc_transform(in, &x, output_profile_filename, ++ "input_profile", input_profile_filename, ++ "intent", intent, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_icc_import( VipsImage *in, VipsImage *out, +- const char *input_profile_filename, VipsIntent intent ) ++int ++im_icc_import(VipsImage *in, VipsImage *out, ++ const char *input_profile_filename, VipsIntent intent) + { + VipsImage *x; + +- if( vips_icc_import( in, &x, +- "input_profile", input_profile_filename, +- "intent", intent, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_icc_import(in, &x, ++ "input_profile", input_profile_filename, ++ "intent", intent, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_icc_import_embedded( VipsImage *in, VipsImage *out, VipsIntent intent ) ++int ++im_icc_import_embedded(VipsImage *in, VipsImage *out, VipsIntent intent) + { + VipsImage *x; + +- if( vips_icc_import( in, &x, +- "embedded", TRUE, +- "intent", intent, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_icc_import(in, &x, ++ "embedded", TRUE, ++ "intent", intent, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_icc_export_depth( VipsImage *in, VipsImage *out, int depth, +- const char *output_profile_filename, VipsIntent intent ) ++int ++im_icc_export_depth(VipsImage *in, VipsImage *out, int depth, ++ const char *output_profile_filename, VipsIntent intent) + { + VipsImage *x; + +- if( vips_icc_export( in, &x, +- "output_profile", output_profile_filename, +- "depth", depth, +- "intent", intent, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_icc_export(in, &x, ++ "output_profile", output_profile_filename, ++ "depth", depth, ++ "intent", intent, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + /** +@@ -3877,677 +3916,677 @@ im_icc_export_depth( VipsImage *in, VipsImage *out, int depth, + * + * Returns: 0 on success, -1 on error. + */ +-int +-im_LabQ2XYZ( IMAGE *in, IMAGE *out ) +-{ ++int ++im_LabQ2XYZ(IMAGE *in, IMAGE *out) ++{ + IMAGE *t[1]; + +- if( im_open_local_array( out, t, 1, "im_LabQ2XYZ:1", "p" ) || +- im_LabQ2Lab( in, t[0] ) || +- im_Lab2XYZ( t[0], out ) ) +- return( -1 ); ++ if (im_open_local_array(out, t, 1, "im_LabQ2XYZ:1", "p") || ++ im_LabQ2Lab(in, t[0]) || ++ im_Lab2XYZ(t[0], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_Lab2UCS( IMAGE *in, IMAGE *out ) +-{ ++int ++im_Lab2UCS(IMAGE *in, IMAGE *out) ++{ + IMAGE *t[1]; + +- if( im_open_local_array( out, t, 1, "im_Lab2UCS:1", "p" ) || +- im_Lab2LCh( in, t[0] ) || +- im_LCh2UCS( t[0], out ) ) +- return( -1 ); ++ if (im_open_local_array(out, t, 1, "im_Lab2UCS:1", "p") || ++ im_Lab2LCh(in, t[0]) || ++ im_LCh2UCS(t[0], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_UCS2Lab( IMAGE *in, IMAGE *out ) +-{ ++int ++im_UCS2Lab(IMAGE *in, IMAGE *out) ++{ + IMAGE *t[1]; + +- if( im_open_local_array( out, t, 1, "im_UCS2Lab:1", "p" ) || +- im_UCS2LCh( in, t[0] ) || +- im_LCh2Lab( t[0], out ) ) +- return( -1 ); ++ if (im_open_local_array(out, t, 1, "im_UCS2Lab:1", "p") || ++ im_UCS2LCh(in, t[0]) || ++ im_LCh2Lab(t[0], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_UCS2XYZ( IMAGE *in, IMAGE *out ) ++int ++im_UCS2XYZ(IMAGE *in, IMAGE *out) + { + IMAGE *t[1]; + +- if( im_open_local_array( out, t, 1, "im_UCS2XYZ:1", "p" ) || +- im_UCS2Lab( in, t[0] ) || +- im_Lab2XYZ( t[0], out ) ) +- return( -1 ); ++ if (im_open_local_array(out, t, 1, "im_UCS2XYZ:1", "p") || ++ im_UCS2Lab(in, t[0]) || ++ im_Lab2XYZ(t[0], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_XYZ2UCS( IMAGE *in, IMAGE *out ) +-{ ++int ++im_XYZ2UCS(IMAGE *in, IMAGE *out) ++{ + IMAGE *t[1]; + +- if( im_open_local_array( out, t, 1, "im_XYZ2UCS:1", "p" ) || +- im_XYZ2Lab( in, t[0] ) || +- im_Lab2UCS( t[0], out ) ) +- return( -1 ); ++ if (im_open_local_array(out, t, 1, "im_XYZ2UCS:1", "p") || ++ im_XYZ2Lab(in, t[0]) || ++ im_Lab2UCS(t[0], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_dE_fromXYZ( IMAGE *in1, IMAGE *in2, IMAGE *out ) +-{ ++int ++im_dE_fromXYZ(IMAGE *in1, IMAGE *in2, IMAGE *out) ++{ + IMAGE *t[2]; + +- if( im_open_local_array( out, t, 2, "im_dE_fromXYZ:1", "p" ) || +- im_XYZ2Lab( in1, t[0] ) || +- im_XYZ2Lab( in2, t[1] ) || +- im_dE_fromLab( t[0], t[1], out ) ) +- return( -1 ); ++ if (im_open_local_array(out, t, 2, "im_dE_fromXYZ:1", "p") || ++ im_XYZ2Lab(in1, t[0]) || ++ im_XYZ2Lab(in2, t[1]) || ++ im_dE_fromLab(t[0], t[1], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_dE_fromLab( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_dE_fromLab(IMAGE *in1, IMAGE *in2, IMAGE *out) + { + VipsImage *x; + +- if( vips_dE76( in1, in2, &x, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_dE76(in1, in2, &x, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_dECMC_fromLab( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_dECMC_fromLab(IMAGE *in1, IMAGE *in2, IMAGE *out) + { + VipsImage *x; + +- if( vips_dECMC( in1, in2, &x, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_dECMC(in1, in2, &x, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_dE00_fromLab( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_dE00_fromLab(IMAGE *in1, IMAGE *in2, IMAGE *out) + { + VipsImage *x; + +- if( vips_dE00( in1, in2, &x, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_dE00(in1, in2, &x, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_icc_ac2rc( VipsImage *in, VipsImage *out, const char *profile_filename ) ++im_icc_ac2rc(VipsImage *in, VipsImage *out, const char *profile_filename) + { + VipsImage *x; + +- if( vips_icc_ac2rc( in, &x, profile_filename ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_icc_ac2rc(in, &x, profile_filename)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_quadratic( IMAGE *in, IMAGE *out, IMAGE *coeff ) ++int ++im_quadratic(IMAGE *in, IMAGE *out, IMAGE *coeff) + { + VipsImage *x; + +- if( vips_quadratic( in, &x, coeff, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_quadratic(in, &x, coeff, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_maxpos_vec( VipsImage *im, int *xpos, int *ypos, double *maxima, int n ) ++int ++im_maxpos_vec(VipsImage *im, int *xpos, int *ypos, double *maxima, int n) + { + double max; + VipsArrayDouble *out_array; + VipsArrayInt *x_array; + VipsArrayInt *y_array; + +- if( vips_max( im, &max, +- "size", n, +- "out_array", &out_array, +- "x_array", &x_array, +- "y_array", &y_array, +- NULL ) ) +- return( -1 ); ++ if (vips_max(im, &max, ++ "size", n, ++ "out_array", &out_array, ++ "x_array", &x_array, ++ "y_array", &y_array, ++ NULL)) ++ return (-1); + +- memcpy( xpos, VIPS_ARRAY_ADDR( x_array, 0 ), n * sizeof( int ) ); +- memcpy( ypos, VIPS_ARRAY_ADDR( y_array, 0 ), n * sizeof( int ) ); +- memcpy( maxima, VIPS_ARRAY_ADDR( out_array, 0 ), n * sizeof( double ) ); ++ memcpy(xpos, VIPS_ARRAY_ADDR(x_array, 0), n * sizeof(int)); ++ memcpy(ypos, VIPS_ARRAY_ADDR(y_array, 0), n * sizeof(int)); ++ memcpy(maxima, VIPS_ARRAY_ADDR(out_array, 0), n * sizeof(double)); + +- vips_area_unref( VIPS_AREA( out_array ) ); +- vips_area_unref( VIPS_AREA( x_array ) ); +- vips_area_unref( VIPS_AREA( y_array ) ); ++ vips_area_unref(VIPS_AREA(out_array)); ++ vips_area_unref(VIPS_AREA(x_array)); ++ vips_area_unref(VIPS_AREA(y_array)); + +- return( 0 ); ++ return (0); + } + +-int +-im_minpos_vec( VipsImage *im, int *xpos, int *ypos, double *minima, int n ) ++int ++im_minpos_vec(VipsImage *im, int *xpos, int *ypos, double *minima, int n) + { + double min; + VipsArrayDouble *out_array; + VipsArrayInt *x_array; + VipsArrayInt *y_array; + +- if( vips_min( im, &min, +- "size", n, +- "out_array", &out_array, +- "x_array", &x_array, +- "y_array", &y_array, +- NULL ) ) +- return( -1 ); ++ if (vips_min(im, &min, ++ "size", n, ++ "out_array", &out_array, ++ "x_array", &x_array, ++ "y_array", &y_array, ++ NULL)) ++ return (-1); + +- memcpy( xpos, VIPS_ARRAY_ADDR( x_array, 0 ), n * sizeof( int ) ); +- memcpy( ypos, VIPS_ARRAY_ADDR( y_array, 0 ), n * sizeof( int ) ); +- memcpy( minima, VIPS_ARRAY_ADDR( out_array, 0 ), n * sizeof( double ) ); ++ memcpy(xpos, VIPS_ARRAY_ADDR(x_array, 0), n * sizeof(int)); ++ memcpy(ypos, VIPS_ARRAY_ADDR(y_array, 0), n * sizeof(int)); ++ memcpy(minima, VIPS_ARRAY_ADDR(out_array, 0), n * sizeof(double)); + +- vips_area_unref( VIPS_AREA( out_array ) ); +- vips_area_unref( VIPS_AREA( x_array ) ); +- vips_area_unref( VIPS_AREA( y_array ) ); ++ vips_area_unref(VIPS_AREA(out_array)); ++ vips_area_unref(VIPS_AREA(x_array)); ++ vips_area_unref(VIPS_AREA(y_array)); + +- return( 0 ); ++ return (0); + } + +-int +-im_cross_phase( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_cross_phase(IMAGE *in1, IMAGE *in2, IMAGE *out) + { + VipsImage *x; + +- if( vips_call( "cross_phase", in1, in2, &x, NULL ) ) +- return( -1 ); ++ if (vips_call("cross_phase", in1, in2, &x, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_maplut( IMAGE *in, IMAGE *out, IMAGE *lut ) ++int ++im_maplut(IMAGE *in, IMAGE *out, IMAGE *lut) + { + VipsImage *x; + +- if( vips_maplut( in, &x, lut, NULL ) ) +- return( -1 ); ++ if (vips_maplut(in, &x, lut, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_ismonotonic( IMAGE *lut, int *out ) ++im_ismonotonic(IMAGE *lut, int *out) + { + gboolean monotonic; + +- if( vips_hist_ismonotonic( lut, &monotonic, NULL ) ) +- return( -1 ); ++ if (vips_hist_ismonotonic(lut, &monotonic, NULL)) ++ return (-1); + +- *out = monotonic ? 255 : 0; ++ *out = monotonic ? 255 : 0; + +- return( 0 ); ++ return (0); + } + +-int +-im_histcum( IMAGE *in, IMAGE *out ) ++int ++im_histcum(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_hist_cum( in, &x, NULL ) ) +- return( -1 ); ++ if (vips_hist_cum(in, &x, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_histnorm( IMAGE *in, IMAGE *out ) ++int ++im_histnorm(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_hist_norm( in, &x, NULL ) ) +- return( -1 ); ++ if (vips_hist_norm(in, &x, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_histeq( IMAGE *in, IMAGE *out ) ++int ++im_histeq(IMAGE *in, IMAGE *out) + { + IMAGE *t1; + +- if( !(t1 = im_open_local( out, "im_histeq", "p" )) || +- im_histcum( in, t1 ) || +- im_histnorm( t1, out ) ) +- return( -1 ); ++ if (!(t1 = im_open_local(out, "im_histeq", "p")) || ++ im_histcum(in, t1) || ++ im_histnorm(t1, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_heq( VipsImage *in, VipsImage *out, int bandno ) ++int ++im_heq(VipsImage *in, VipsImage *out, int bandno) + { + VipsImage *x; + +- if( vips_hist_equal( in, &x, "band", bandno, NULL ) ) +- return( -1 ); ++ if (vips_hist_equal(in, &x, "band", bandno, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_hist( IMAGE *in, IMAGE *out, int bandno ) ++int ++im_hist(IMAGE *in, IMAGE *out, int bandno) + { + IMAGE *hist; + +- if( !(hist = im_open_local( out, "im_hist", "p" )) || +- im_histgr( in, hist, bandno ) || +- im_histplot( hist, out ) ) +- return( -1 ); ++ if (!(hist = im_open_local(out, "im_hist", "p")) || ++ im_histgr(in, hist, bandno) || ++ im_histplot(hist, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_histgr( IMAGE *in, IMAGE *out, int bandno ) ++int ++im_histgr(IMAGE *in, IMAGE *out, int bandno) + { + VipsImage *x; + +- if( vips_hist_find( in, &x, +- "band", bandno, +- NULL ) ) +- return( -1 ); ++ if (vips_hist_find(in, &x, ++ "band", bandno, ++ NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_stdif( IMAGE *in, IMAGE *out, +- double a, double m0, double b, double s0, +- int width, int height ) ++int ++im_stdif(IMAGE *in, IMAGE *out, ++ double a, double m0, double b, double s0, ++ int width, int height) + { + VipsImage *x; + +- if( vips_stdif( in, &x, width, height, +- "a", a, +- "b", b, +- "m0", m0, +- "s0", s0, +- NULL ) ) +- return( -1 ); ++ if (vips_stdif(in, &x, width, height, ++ "a", a, ++ "b", b, ++ "m0", m0, ++ "s0", s0, ++ NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_lhisteq( VipsImage *in, VipsImage *out, int width, int height ) ++int ++im_lhisteq(VipsImage *in, VipsImage *out, int width, int height) + { + VipsImage *x; + +- if( vips_hist_local( in, &x, width, height, NULL ) ) +- return( -1 ); ++ if (vips_hist_local(in, &x, width, height, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_histnD( VipsImage *in, VipsImage *out, int bins ) ++int ++im_histnD(VipsImage *in, VipsImage *out, int bins) + { + VipsImage *x; + +- if( vips_hist_find_ndim( in, &x, +- "bins", bins, +- NULL ) ) +- return( -1 ); ++ if (vips_hist_find_ndim(in, &x, ++ "bins", bins, ++ NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_hist_indexed( VipsImage *index, VipsImage *value, VipsImage *out ) ++int ++im_hist_indexed(VipsImage *index, VipsImage *value, VipsImage *out) + { + VipsImage *x; + +- if( vips_hist_find_indexed( value, index, &x, NULL ) ) +- return( -1 ); ++ if (vips_hist_find_indexed(value, index, &x, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_project( IMAGE *in, IMAGE *hout, IMAGE *vout ) ++int ++im_project(IMAGE *in, IMAGE *hout, IMAGE *vout) + { + VipsImage *x, *y; + +- if( vips_project( in, &x, &y, NULL ) ) +- return( -1 ); ++ if (vips_project(in, &x, &y, NULL)) ++ return (-1); + +- if( vips_image_write( x, hout ) ) { +- g_object_unref( x ); +- g_object_unref( y ); +- return( -1 ); ++ if (vips_image_write(x, hout)) { ++ g_object_unref(x); ++ g_object_unref(y); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- if( vips_image_write( y, vout ) ) { +- g_object_unref( y ); +- return( -1 ); ++ if (vips_image_write(y, vout)) { ++ g_object_unref(y); ++ return (-1); + } +- g_object_unref( y ); ++ g_object_unref(y); + +- return( 0 ); ++ return (0); + } + +-int +-im_profile( IMAGE *in, IMAGE *out, int dir ) ++int ++im_profile(IMAGE *in, IMAGE *out, int dir) + { + VipsImage *columns, *rows; + VipsImage *t1, *t2; + +- if( vips_profile( in, &columns, &rows, NULL ) ) +- return( -1 ); +- if( dir == 0 ) { ++ if (vips_profile(in, &columns, &rows, NULL)) ++ return (-1); ++ if (dir == 0) { + t1 = columns; +- g_object_unref( rows ); ++ g_object_unref(rows); + } + else { + t1 = rows; +- g_object_unref( columns ); ++ g_object_unref(columns); + } + +- if( vips_cast( t1, &t2, VIPS_FORMAT_USHORT, NULL ) ) { +- g_object_unref( t1 ); +- return( -1 ); ++ if (vips_cast(t1, &t2, VIPS_FORMAT_USHORT, NULL)) { ++ g_object_unref(t1); ++ return (-1); + } +- g_object_unref( t1 ); ++ g_object_unref(t1); + +- if( vips_image_write( t2, out ) ) { +- g_object_unref( t2 ); +- return( -1 ); ++ if (vips_image_write(t2, out)) { ++ g_object_unref(t2); ++ return (-1); + } +- g_object_unref( t2 ); ++ g_object_unref(t2); + +- return( 0 ); ++ return (0); + } + + int +-im_erode( IMAGE *in, IMAGE *out, INTMASK *mask ) ++im_erode(IMAGE *in, IMAGE *out, INTMASK *mask) + { + VipsImage *t1, *t2; + +- if( !(t1 = vips_image_new()) || +- im_imask2vips( mask, t1 ) ) +- return( -1 ); ++ if (!(t1 = vips_image_new()) || ++ im_imask2vips(mask, t1)) ++ return (-1); + +- if( vips_morph( in, &t2, t1, VIPS_OPERATION_MORPHOLOGY_ERODE, +- NULL ) ) { +- g_object_unref( t1 ); +- return( -1 ); ++ if (vips_morph(in, &t2, t1, VIPS_OPERATION_MORPHOLOGY_ERODE, ++ NULL)) { ++ g_object_unref(t1); ++ return (-1); + } +- g_object_unref( t1 ); ++ g_object_unref(t1); + +- if( vips_image_write( t2, out ) ) { +- g_object_unref( t2 ); +- return( -1 ); ++ if (vips_image_write(t2, out)) { ++ g_object_unref(t2); ++ return (-1); + } +- g_object_unref( t2 ); ++ g_object_unref(t2); + +- return( 0 ); ++ return (0); + } + + int +-im_erode_raw( IMAGE *in, IMAGE *out, INTMASK *m ) ++im_erode_raw(IMAGE *in, IMAGE *out, INTMASK *m) + { +- return( im_erode( in, out, m ) ); ++ return (im_erode(in, out, m)); + } + + int +-im_dilate( IMAGE *in, IMAGE *out, INTMASK *mask ) ++im_dilate(IMAGE *in, IMAGE *out, INTMASK *mask) + { + VipsImage *t1, *t2; + +- if( !(t1 = vips_image_new()) || +- im_imask2vips( mask, t1 ) ) +- return( -1 ); ++ if (!(t1 = vips_image_new()) || ++ im_imask2vips(mask, t1)) ++ return (-1); + +- if( vips_morph( in, &t2, t1, VIPS_OPERATION_MORPHOLOGY_DILATE, +- NULL ) ) { +- g_object_unref( t1 ); +- return( -1 ); ++ if (vips_morph(in, &t2, t1, VIPS_OPERATION_MORPHOLOGY_DILATE, ++ NULL)) { ++ g_object_unref(t1); ++ return (-1); + } +- g_object_unref( t1 ); ++ g_object_unref(t1); + +- if( vips_image_write( t2, out ) ) { +- g_object_unref( t2 ); +- return( -1 ); ++ if (vips_image_write(t2, out)) { ++ g_object_unref(t2); ++ return (-1); + } +- g_object_unref( t2 ); ++ g_object_unref(t2); + +- return( 0 ); ++ return (0); + } + + int +-im_dilate_raw( IMAGE *in, IMAGE *out, INTMASK *m ) ++im_dilate_raw(IMAGE *in, IMAGE *out, INTMASK *m) + { +- return( im_dilate( in, out, m ) ); ++ return (im_dilate(in, out, m)); + } + + int +-im_mpercent( IMAGE *in, double percent, int *out ) ++im_mpercent(IMAGE *in, double percent, int *out) + { +- if( vips_percent( in, percent * 100.0, out, NULL ) ) +- return( -1 ); ++ if (vips_percent(in, percent * 100.0, out, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-im_mpercent_hist( IMAGE *in, double percent, int *out ) ++im_mpercent_hist(IMAGE *in, double percent, int *out) + { + /* Hard to do this in a wrapper. + */ +- vips_error( "im_mpercent_hist", "%s", _( "no compat implemented" ) ); ++ vips_error("im_mpercent_hist", "%s", _("no compat implemented")); + +- return( -1 ); ++ return (-1); + } + +-int +-im_hsp( IMAGE *in, IMAGE *ref, IMAGE *out ) ++int ++im_hsp(IMAGE *in, IMAGE *ref, IMAGE *out) + { + IMAGE *t[3]; + +- if( im_open_local_array( out, t, 3, "im_hsp", "p" ) || +- im_histgr( in, t[0], -1 ) || +- im_histgr( ref, t[1], -1 ) || +- im_histspec( t[0], t[1], t[2] ) || +- im_maplut( in, out, t[2] ) ) +- return( -1 ); ++ if (im_open_local_array(out, t, 3, "im_hsp", "p") || ++ im_histgr(in, t[0], -1) || ++ im_histgr(ref, t[1], -1) || ++ im_histspec(t[0], t[1], t[2]) || ++ im_maplut(in, out, t[2])) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-match( VipsImage *in, VipsImage *ref, VipsImage *out ) ++match(VipsImage *in, VipsImage *ref, VipsImage *out) + { + VipsImage *x; + +- if( vips_hist_match( in, ref, &x, NULL ) ) +- return( -1 ); ++ if (vips_hist_match(in, ref, &x, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_histspec( IMAGE *in, IMAGE *ref, IMAGE *out ) ++int ++im_histspec(IMAGE *in, IMAGE *ref, IMAGE *out) + { + IMAGE *t[5]; + guint64 px; + int fmt; + +- if( im_check_uint( "im_histspec", in ) || +- im_check_uint( "im_histspec", ref ) ) +- return( -1 ); ++ if (im_check_uint("im_histspec", in) || ++ im_check_uint("im_histspec", ref)) ++ return (-1); + +- if( im_open_local_array( out, t, 5, "im_histspec", "p" ) || +- im_histeq( in, t[0] ) || +- im_histeq( ref, t[2] ) || +- match( t[0], t[2], t[4] ) ) +- return( -1 ); ++ if (im_open_local_array(out, t, 5, "im_histspec", "p") || ++ im_histeq(in, t[0]) || ++ im_histeq(ref, t[2]) || ++ match(t[0], t[2], t[4])) ++ return (-1); + +- px = VIPS_IMAGE_N_PELS( t[4] ); +- if( px <= 256 ) ++ px = VIPS_IMAGE_N_PELS(t[4]); ++ if (px <= 256) + fmt = IM_BANDFMT_UCHAR; +- else if( px <= 65536 ) ++ else if (px <= 65536) + fmt = IM_BANDFMT_USHORT; +- else ++ else + fmt = IM_BANDFMT_UINT; + +- if( im_clip2fmt( t[4], out, fmt ) ) +- return( -1 ); ++ if (im_clip2fmt(t[4], out, fmt)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_falsecolour( IMAGE *in, IMAGE *out ) ++int ++im_falsecolour(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_falsecolour( in, &x, NULL ) ) +- return( -1 ); ++ if (vips_falsecolour(in, &x, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_gammacorrect( IMAGE *in, IMAGE *out, double exponent ) ++int ++im_gammacorrect(IMAGE *in, IMAGE *out, double exponent) + { + VipsImage *x; + +- if( vips_gamma( in, &x, +- "exponent", 1.0 / exponent, +- NULL ) ) +- return( -1 ); ++ if (vips_gamma(in, &x, ++ "exponent", 1.0 / exponent, ++ NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + /* This is used by the carrierwave shrinker to cache the +@@ -4556,117 +4595,117 @@ im_gammacorrect( IMAGE *in, IMAGE *out, double exponent ) + * We use the vips8 threaded tilecache to avoid a deadlock: suppose thread1, + * evaluating the top block of the output is delayed, and thread2, evaluating + * the second block gets here first (this can happen on a heavily-loaded +- * system). ++ * system). + * + * With an unthreaded tilecache (as we had before), thread2 will get + * the cache lock and start evaling the second block of the shrink. When it + * reaches the png reader it will stall until the first block has been used ... +- * but it never will, since thread1 will block on this cache lock. ++ * but it never will, since thread1 will block on this cache lock. + * + * This function is only used in this place (I think), so it's OK to +- * hard-wire this to be a sequential threaded cache. ++ * hard-wire this to be a sequential threaded cache. + */ + int +-im_tile_cache( IMAGE *in, IMAGE *out, +- int tile_width, int tile_height, int max_tiles ) ++im_tile_cache(IMAGE *in, IMAGE *out, ++ int tile_width, int tile_height, int max_tiles) + { + VipsImage *x; + +- if( vips_tilecache( in, &x, +- "tile_width", tile_width, +- "tile_height", tile_height, +- "max_tiles", max_tiles, +- "access", VIPS_ACCESS_SEQUENTIAL, +- "threaded", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_tilecache(in, &x, ++ "tile_width", tile_width, ++ "tile_height", tile_height, ++ "max_tiles", max_tiles, ++ "access", VIPS_ACCESS_SEQUENTIAL, ++ "threaded", TRUE, ++ NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + /* This is the one used by nip2's menu for caching images. Random access and +- * persistent. ++ * persistent. + */ + int +-im_tile_cache_random( IMAGE *in, IMAGE *out, +- int tile_width, int tile_height, int max_tiles ) ++im_tile_cache_random(IMAGE *in, IMAGE *out, ++ int tile_width, int tile_height, int max_tiles) + { + VipsImage *x; + +- if( vips_tilecache( in, &x, +- "tile_width", tile_width, +- "tile_height", tile_height, +- "max_tiles", max_tiles, +- "access", VIPS_ACCESS_RANDOM, +- "persistent", TRUE, +- "threaded", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_tilecache(in, &x, ++ "tile_width", tile_width, ++ "tile_height", tile_height, ++ "max_tiles", max_tiles, ++ "access", VIPS_ACCESS_RANDOM, ++ "persistent", TRUE, ++ "threaded", TRUE, ++ NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-static int +-im__affinei( VipsImage *in, VipsImage *out, +- VipsInterpolate *interpolate, VipsTransformation *trn ) ++static int ++im__affinei(VipsImage *in, VipsImage *out, ++ VipsInterpolate *interpolate, VipsTransformation *trn) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 2 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(out), 2); + + VipsArea *oarea; + gboolean repack; + +- oarea = VIPS_AREA( vips_array_int_newv( 4, ++ oarea = VIPS_AREA(vips_array_int_newv(4, + trn->oarea.left, trn->oarea.top, +- trn->oarea.width, trn->oarea.height ) ); ++ trn->oarea.width, trn->oarea.height)); + + /* vips7 affine would repack labq and im_benchmark() depends upon + * this. + */ + repack = in->Coding == IM_CODING_LABQ; + +- if( vips_affine( in, &t[0], +- trn->a, trn->b, trn->c, trn->d, +- "interpolate", interpolate, +- "oarea", oarea, +- "odx", trn->odx, +- "ody", trn->ody, +- NULL ) ) { +- vips_area_unref( oarea ); +- return( -1 ); +- } +- vips_area_unref( oarea ); ++ if (vips_affine(in, &t[0], ++ trn->a, trn->b, trn->c, trn->d, ++ "interpolate", interpolate, ++ "oarea", oarea, ++ "odx", trn->odx, ++ "ody", trn->ody, ++ NULL)) { ++ vips_area_unref(oarea); ++ return (-1); ++ } ++ vips_area_unref(oarea); + in = t[0]; + +- if( repack ) { +- if( vips_colourspace( in, &t[1], +- VIPS_INTERPRETATION_LABQ, NULL ) ) +- return( -1 ); ++ if (repack) { ++ if (vips_colourspace(in, &t[1], ++ VIPS_INTERPRETATION_LABQ, NULL)) ++ return (-1); + in = t[1]; + } + +- if( vips_image_write( in, out ) ) +- return( -1 ); ++ if (vips_image_write(in, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-im_affinei( VipsImage *in, VipsImage *out, VipsInterpolate *interpolate, +- double a, double b, double c, double d, double odx, double ody, +- int ox, int oy, int ow, int oh ) ++int ++im_affinei(VipsImage *in, VipsImage *out, VipsInterpolate *interpolate, ++ double a, double b, double c, double d, double odx, double ody, ++ int ox, int oy, int ow, int oh) + { + VipsTransformation trn; + +@@ -4689,12 +4728,12 @@ im_affinei( VipsImage *in, VipsImage *out, VipsInterpolate *interpolate, + trn.odx = odx; + trn.ody = ody; + +- return( im__affinei( in, out, interpolate, &trn ) ); ++ return (im__affinei(in, out, interpolate, &trn)); + } + +-int +-im_affinei_all( VipsImage *in, VipsImage *out, VipsInterpolate *interpolate, +- double a, double b, double c, double d, double odx, double ody ) ++int ++im_affinei_all(VipsImage *in, VipsImage *out, VipsInterpolate *interpolate, ++ double a, double b, double c, double d, double odx, double ody) + { + VipsTransformation trn; + +@@ -4711,240 +4750,239 @@ im_affinei_all( VipsImage *in, VipsImage *out, VipsInterpolate *interpolate, + trn.odx = odx; + trn.ody = ody; + +- vips__transform_set_area( &trn ); ++ vips__transform_set_area(&trn); + +- return( im__affinei( in, out, interpolate, &trn ) ); ++ return (im__affinei(in, out, interpolate, &trn)); + } + + /* Still needed by some parts of mosaic. + */ +-int +-vips__affine( VipsImage *in, VipsImage *out, VipsTransformation *trn ) ++int ++vips__affine(VipsImage *in, VipsImage *out, VipsTransformation *trn) + { +- return( im__affinei( in, out, +- vips_interpolate_bilinear_static(), trn ) ); ++ return (im__affinei(in, out, ++ vips_interpolate_bilinear_static(), trn)); + } + + int +-im_copy_file( IMAGE *in, IMAGE *out ) ++im_copy_file(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_copy_file( in, &x, NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_copy_file(in, &x, NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_video_v4l1( IMAGE *im, const char *device, +- int channel, int brightness, int colour, int contrast, int hue, +- int ngrabs ) ++im_video_v4l1(IMAGE *im, const char *device, ++ int channel, int brightness, int colour, int contrast, int hue, ++ int ngrabs) + { +- im_error( "im_video_v4l1", +- "%s", _( "compiled without im_video_v4l1 support" ) ); +- return( -1 ); ++ im_error("im_video_v4l1", ++ "%s", _("compiled without im_video_v4l1 support")); ++ return (-1); + } + +-int +-im_fwfft( IMAGE *in, IMAGE *out ) ++int ++im_fwfft(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_fwfft( in, &x, NULL ) ) +- return( -1 ); ++ if (vips_fwfft(in, &x, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_invfft( IMAGE *in, IMAGE *out ) ++int ++im_invfft(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_invfft( in, &x, NULL ) ) +- return( -1 ); ++ if (vips_invfft(in, &x, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_invfftr( IMAGE *in, IMAGE *out ) ++int ++im_invfftr(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_invfft( in, &x, +- "real", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_invfft(in, &x, ++ "real", TRUE, ++ NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_freqflt( IMAGE *in, IMAGE *mask, IMAGE *out ) ++int ++im_freqflt(IMAGE *in, IMAGE *mask, IMAGE *out) + { + VipsImage *x; + +- if( vips_freqmult( in, mask, &x, NULL ) ) +- return( -1 ); ++ if (vips_freqmult(in, mask, &x, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_disp_ps( IMAGE *in, IMAGE *out ) ++int ++im_disp_ps(IMAGE *in, IMAGE *out) + { + VipsImage *t; + +- if( vips_spectrum( in, &t, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_spectrum(in, &t, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_fractsurf( IMAGE *out, int size, double frd ) ++int ++im_fractsurf(IMAGE *out, int size, double frd) + { + VipsImage *t; + +- if( vips_fractsurf( &t, size, size, frd, NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_fractsurf(&t, size, size, frd, NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + +-int +-im_phasecor_fft( IMAGE *in1, IMAGE *in2, IMAGE *out ) ++int ++im_phasecor_fft(IMAGE *in1, IMAGE *in2, IMAGE *out) + { + VipsImage *x; + +- if( vips_phasecor( in1, in2, &x, NULL ) ) +- return( -1 ); ++ if (vips_phasecor(in1, in2, &x, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_cntlines( VipsImage *im, double *nolines, int flag ) ++int ++im_cntlines(VipsImage *im, double *nolines, int flag) + { +- return( vips_countlines( im, nolines, +- flag == 0 ? +- VIPS_DIRECTION_HORIZONTAL : VIPS_DIRECTION_VERTICAL, +- NULL ) ); ++ return (vips_countlines(im, nolines, ++ flag == 0 ? VIPS_DIRECTION_HORIZONTAL : VIPS_DIRECTION_VERTICAL, ++ NULL)); + } + + int +-im_label_regions( IMAGE *test, IMAGE *mask, int *segments ) ++im_label_regions(IMAGE *test, IMAGE *mask, int *segments) + { + VipsImage *x; + +- if( vips_labelregions( test, &x, "segments", segments, NULL ) ) +- return( -1 ); ++ if (vips_labelregions(test, &x, "segments", segments, NULL)) ++ return (-1); + +- if( vips_image_write( x, mask ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, mask)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_rank( IMAGE *in, IMAGE *out, int width, int height, int index ) ++int ++im_rank(IMAGE *in, IMAGE *out, int width, int height, int index) + { + VipsImage *x; + +- if( vips_rank( in, &x, width, height, index, NULL ) ) +- return( -1 ); ++ if (vips_rank(in, &x, width, height, index, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_rank_raw( IMAGE *in, IMAGE *out, int width, int height, int index ) ++im_rank_raw(IMAGE *in, IMAGE *out, int width, int height, int index) + { +- im_error( "im_rank_raw", "no compat function" ); +- return( -1 ); ++ im_error("im_rank_raw", "no compat function"); ++ return (-1); + } + + int +-im_draw_circle( VipsImage *image, +- int x, int y, int radius, gboolean fill, VipsPel *ink ) ++im_draw_circle(VipsImage *image, ++ int x, int y, int radius, gboolean fill, VipsPel *ink) + { + double *vec; + int n; + +- if( !(vec = vips__ink_to_vector( "im_draw_circle", image, ink, &n )) ) +- return( -1 ); ++ if (!(vec = vips__ink_to_vector("im_draw_circle", image, ink, &n))) ++ return (-1); + +- return( vips_draw_circle( image, vec, n, x, y, radius, ++ return (vips_draw_circle(image, vec, n, x, y, radius, + "fill", fill, +- NULL ) ); ++ NULL)); + } + +-int +-im_draw_line( VipsImage *image, int x1, int y1, int x2, int y2, VipsPel *ink ) ++int ++im_draw_line(VipsImage *image, int x1, int y1, int x2, int y2, VipsPel *ink) + { + double *vec; + int n; + +- if( !(vec = vips__ink_to_vector( "im_draw_line", image, ink, &n )) ) +- return( -1 ); ++ if (!(vec = vips__ink_to_vector("im_draw_line", image, ink, &n))) ++ return (-1); + +- return( vips_draw_line( image, vec, n, x1, y1, x2, y2, NULL ) ); ++ return (vips_draw_line(image, vec, n, x1, y1, x2, y2, NULL)); + } + + typedef struct _Line { +@@ -4955,17 +4993,17 @@ typedef struct _Line { + } Line; + + static void +-draw_line_wrapper( VipsImage *image, int x, int y, void *client ) ++draw_line_wrapper(VipsImage *image, int x, int y, void *client) + { + Line *line = (Line *) client; + +- line->plot( image, x, y, line->a, line->b, line->c ); ++ line->plot(image, x, y, line->a, line->b, line->c); + } + +-int +-im_draw_line_user( VipsImage *image, +- int x1, int y1, int x2, int y2, +- VipsPlotFn plot, void *a, void *b, void *c ) ++int ++im_draw_line_user(VipsImage *image, ++ int x1, int y1, int x2, int y2, ++ VipsPlotFn plot, void *a, void *b, void *c) + { + Line line; + +@@ -4974,84 +5012,84 @@ im_draw_line_user( VipsImage *image, + line.b = b; + line.c = c; + +- vips__draw_line_direct( image, x1, y1, x2, y2, +- draw_line_wrapper, &line ); +- +- return( 0 ); ++ vips__draw_line_direct(image, x1, y1, x2, y2, ++ draw_line_wrapper, &line); ++ ++ return (0); + } + + int +-im_draw_mask( VipsImage *image, VipsImage *mask, int x, int y, VipsPel *ink ) ++im_draw_mask(VipsImage *image, VipsImage *mask, int x, int y, VipsPel *ink) + { + /* Direct call, since this has to be very quick. + */ +- return( vips__draw_mask_direct( image, mask, ink, x, y ) ); ++ return (vips__draw_mask_direct(image, mask, ink, x, y)); + } + + int +-im_draw_image( VipsImage *image, VipsImage *sub, int x, int y ) ++im_draw_image(VipsImage *image, VipsImage *sub, int x, int y) + { +- return( vips_draw_image( image, sub, x, y, NULL ) ); ++ return (vips_draw_image(image, sub, x, y, NULL)); + } + + int +-im_draw_rect( IMAGE *image, +- int left, int top, int width, int height, int fill, VipsPel *ink ) ++im_draw_rect(IMAGE *image, ++ int left, int top, int width, int height, int fill, VipsPel *ink) + { + double *vec; + int n; + +- if( !(vec = vips__ink_to_vector( "im_draw_rect", image, ink, &n )) ) +- return( -1 ); ++ if (!(vec = vips__ink_to_vector("im_draw_rect", image, ink, &n))) ++ return (-1); + +- return( vips_draw_rect( image, vec, n, left, top, width, height, +- "fill", fill, +- NULL ) ); ++ return (vips_draw_rect(image, vec, n, left, top, width, height, ++ "fill", fill, ++ NULL)); + } + + int +-im_draw_point( VipsImage *image, int x, int y, VipsPel *ink ) ++im_draw_point(VipsImage *image, int x, int y, VipsPel *ink) + { + double *vec; + int n; + +- if( !(vec = vips__ink_to_vector( "im_draw_rect", image, ink, &n )) ) +- return( -1 ); ++ if (!(vec = vips__ink_to_vector("im_draw_rect", image, ink, &n))) ++ return (-1); + +- return( vips_draw_point( image, vec, n, x, y, NULL ) ); ++ return (vips_draw_point(image, vec, n, x, y, NULL)); + } + + int +-im_draw_smudge( VipsImage *im, int left, int top, int width, int height ) ++im_draw_smudge(VipsImage *im, int left, int top, int width, int height) + { +- return( vips_draw_smudge( im, left, top, width, height, NULL ) ); ++ return (vips_draw_smudge(im, left, top, width, height, NULL)); + } + + int +-im_read_point( VipsImage *image, int x, int y, VipsPel *ink ) ++im_read_point(VipsImage *image, int x, int y, VipsPel *ink) + { + double *vector; + int n; + VipsPel *pixel_vector; + +- if( vips_getpoint( image, &vector, &n, x, y, NULL ) ) +- return( -1 ); ++ if (vips_getpoint(image, &vector, &n, x, y, NULL)) ++ return (-1); + +- if( !(pixel_vector = vips__vector_to_ink( "im_read_point", +- image, vector, NULL, n )) ) { +- g_free( vector ); +- return( -1 ); ++ if (!(pixel_vector = vips__vector_to_ink("im_read_point", ++ image, vector, NULL, n))) { ++ g_free(vector); ++ return (-1); + } + +- memcpy( ink, pixel_vector, VIPS_IMAGE_SIZEOF_PEL( image ) ); ++ memcpy(ink, pixel_vector, VIPS_IMAGE_SIZEOF_PEL(image)); + +- g_free( vector ); ++ g_free(vector); + +- return( 0 ); ++ return (0); + } + + int +-im_draw_flood( IMAGE *image, int x, int y, VipsPel *ink, Rect *dout ) ++im_draw_flood(IMAGE *image, int x, int y, VipsPel *ink, Rect *dout) + { + double *vec; + int n; +@@ -5060,29 +5098,29 @@ im_draw_flood( IMAGE *image, int x, int y, VipsPel *ink, Rect *dout ) + int width; + int height; + +- if( !(vec = vips__ink_to_vector( "im_draw_flood", image, ink, &n )) ) +- return( -1 ); ++ if (!(vec = vips__ink_to_vector("im_draw_flood", image, ink, &n))) ++ return (-1); + +- if( vips_draw_flood( image, vec, n, x, y, +- "left", &left, +- "top", &top, +- "width", &width, +- "height", &height, +- NULL ) ) +- return( -1 ); ++ if (vips_draw_flood(image, vec, n, x, y, ++ "left", &left, ++ "top", &top, ++ "width", &width, ++ "height", &height, ++ NULL)) ++ return (-1); + +- if( dout ) { +- dout->left = left; +- dout->top = top; +- dout->width = width; +- dout->height = height; ++ if (dout) { ++ dout->left = left; ++ dout->top = top; ++ dout->width = width; ++ dout->height = height; + } + +- return( 0 ); ++ return (0); + } + + int +-im_draw_flood_blob( IMAGE *image, int x, int y, VipsPel *ink, Rect *dout ) ++im_draw_flood_blob(IMAGE *image, int x, int y, VipsPel *ink, Rect *dout) + { + double *vec; + int n; +@@ -5091,422 +5129,422 @@ im_draw_flood_blob( IMAGE *image, int x, int y, VipsPel *ink, Rect *dout ) + int width; + int height; + +- if( !(vec = vips__ink_to_vector( "im_draw_flood", image, ink, &n )) ) +- return( -1 ); ++ if (!(vec = vips__ink_to_vector("im_draw_flood", image, ink, &n))) ++ return (-1); + +- if( vips_draw_flood( image, vec, n, x, y, +- "equal", TRUE, +- "left", &left, +- "top", &top, +- "width", &width, +- "height", &height, +- NULL ) ) +- return( -1 ); ++ if (vips_draw_flood(image, vec, n, x, y, ++ "equal", TRUE, ++ "left", &left, ++ "top", &top, ++ "width", &width, ++ "height", &height, ++ NULL)) ++ return (-1); + +- if( dout ) { +- dout->left = left; +- dout->top = top; +- dout->width = width; +- dout->height = height; ++ if (dout) { ++ dout->left = left; ++ dout->top = top; ++ dout->width = width; ++ dout->height = height; + } + +- return( 0 ); ++ return (0); + } + + int +-im_draw_flood_other( IMAGE *image, +- IMAGE *test, int x, int y, int serial, Rect *dout ) ++im_draw_flood_other(IMAGE *image, ++ IMAGE *test, int x, int y, int serial, Rect *dout) + { + int left; + int top; + int width; + int height; + +- if( vips_draw_flood1( image, serial, x, y, +- "test", test, +- "equal", TRUE, +- "left", &left, +- "top", &top, +- "width", &width, +- "height", &height, +- NULL ) ) +- return( -1 ); ++ if (vips_draw_flood1(image, serial, x, y, ++ "test", test, ++ "equal", TRUE, ++ "left", &left, ++ "top", &top, ++ "width", &width, ++ "height", &height, ++ NULL)) ++ return (-1); + +- if( dout ) { +- dout->left = left; +- dout->top = top; +- dout->width = width; +- dout->height = height; +- } ++ if (dout) { ++ dout->left = left; ++ dout->top = top; ++ dout->width = width; ++ dout->height = height; ++ } + +- return( 0 ); ++ return (0); + } + + int +-im_lineset( IMAGE *in, IMAGE *out, IMAGE *mask, IMAGE *ink, +- int n, int *x1v, int *y1v, int *x2v, int *y2v ) ++im_lineset(IMAGE *in, IMAGE *out, IMAGE *mask, IMAGE *ink, ++ int n, int *x1v, int *y1v, int *x2v, int *y2v) + { + Rect mask_rect; + int i; + +- if( mask->Bands != 1 || mask->BandFmt != IM_BANDFMT_UCHAR || +- mask->Coding != IM_CODING_NONE ) { +- im_error( "im_lineset", +- "%s", _( "mask image not 1 band 8 bit uncoded" ) ); +- return( -1 ); ++ if (mask->Bands != 1 || mask->BandFmt != IM_BANDFMT_UCHAR || ++ mask->Coding != IM_CODING_NONE) { ++ im_error("im_lineset", ++ "%s", _("mask image not 1 band 8 bit uncoded")); ++ return (-1); + } +- if( ink->Bands != in->Bands || ink->BandFmt != in->BandFmt || +- ink->Coding != in->Coding ) { +- im_error( "im_lineset", +- "%s", _( "ink image does not match in image" ) ); +- return( -1 ); ++ if (ink->Bands != in->Bands || ink->BandFmt != in->BandFmt || ++ ink->Coding != in->Coding) { ++ im_error("im_lineset", ++ "%s", _("ink image does not match in image")); ++ return (-1); + } +- if( ink->Xsize != 1 || ink->Ysize != 1 ) { +- im_error( "im_lineset", "%s", _( "ink image not 1x1 pixels" ) ); +- return( -1 ); ++ if (ink->Xsize != 1 || ink->Ysize != 1) { ++ im_error("im_lineset", "%s", _("ink image not 1x1 pixels")); ++ return (-1); + } + + /* Copy the image then fastline to it ... this will render to a "t" + * usually. + */ +- if( vips_image_write( in, out ) ) +- return( -1 ); ++ if (vips_image_write(in, out)) ++ return (-1); + + mask_rect.left = mask->Xsize / 2; + mask_rect.top = mask->Ysize / 2; + mask_rect.width = mask->Xsize; + mask_rect.height = mask->Ysize; + +- if( im_incheck( ink ) || +- im_incheck( mask ) ) +- return( -1 ); ++ if (im_incheck(ink) || ++ im_incheck(mask)) ++ return (-1); + +- for( i = 0; i < n; i++ ) { +- if( im_fastlineuser( out, x1v[i], y1v[i], x2v[i], y2v[i], +- (VipsPlotFn) im_plotmask, ink->data, mask->data, &mask_rect ) ) +- return( -1 ); ++ for (i = 0; i < n; i++) { ++ if (im_fastlineuser(out, x1v[i], y1v[i], x2v[i], y2v[i], ++ (VipsPlotFn) im_plotmask, ink->data, mask->data, &mask_rect)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + int +-im_match_linear_search( IMAGE *ref, IMAGE *sec, IMAGE *out, +- int xr1, int yr1, int xs1, int ys1, ++im_match_linear_search(IMAGE *ref, IMAGE *sec, IMAGE *out, ++ int xr1, int yr1, int xs1, int ys1, + int xr2, int yr2, int xs2, int ys2, +- int hwindowsize, int hsearchsize ) ++ int hwindowsize, int hsearchsize) + { + VipsImage *x; + +- if( vips_match( ref, sec, &x, +- xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, +- "search", TRUE, +- "hwindow", hwindowsize, +- "harea", hsearchsize, +- NULL ) ) +- return( -1 ); ++ if (vips_match(ref, sec, &x, ++ xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, ++ "search", TRUE, ++ "hwindow", hwindowsize, ++ "harea", hsearchsize, ++ NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_match_linear( IMAGE *ref, IMAGE *sec, IMAGE *out, +- int xr1, int yr1, int xs1, int ys1, +- int xr2, int yr2, int xs2, int ys2 ) +-{ ++im_match_linear(IMAGE *ref, IMAGE *sec, IMAGE *out, ++ int xr1, int yr1, int xs1, int ys1, ++ int xr2, int yr2, int xs2, int ys2) ++{ + VipsImage *x; + +- if( vips_match( ref, sec, &x, +- xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, +- NULL ) ) +- return( -1 ); ++ if (vips_match(ref, sec, &x, ++ xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, ++ NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_global_balance( IMAGE *in, IMAGE *out, double gamma ) ++im_global_balance(IMAGE *in, IMAGE *out, double gamma) + { + VipsImage *x; + +- if( vips_globalbalance( in, &x, +- "gamma", gamma, +- "int_output", TRUE, +- NULL ) ) +- return( -1 ); ++ if (vips_globalbalance(in, &x, ++ "gamma", gamma, ++ "int_output", TRUE, ++ NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + +-int +-im_histplot( IMAGE *in, IMAGE *out ) ++int ++im_histplot(IMAGE *in, IMAGE *out) + { + VipsImage *x; + +- if( vips_hist_plot( in, &x, NULL ) ) +- return( -1 ); ++ if (vips_hist_plot(in, &x, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_global_balancef( IMAGE *in, IMAGE *out, double gamma ) ++im_global_balancef(IMAGE *in, IMAGE *out, double gamma) + { + VipsImage *x; + +- if( vips_globalbalance( in, &x, +- "gamma", gamma, +- NULL ) ) +- return( -1 ); ++ if (vips_globalbalance(in, &x, ++ "gamma", gamma, ++ NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_remosaic( IMAGE *in, IMAGE *out, const char *old_str, const char *new_str ) ++im_remosaic(IMAGE *in, IMAGE *out, const char *old_str, const char *new_str) + { + VipsImage *x; + +- if( vips_remosaic( in, &x, old_str, new_str, NULL ) ) +- return( -1 ); ++ if (vips_remosaic(in, &x, old_str, new_str, NULL)) ++ return (-1); + +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_lrmosaic( IMAGE *ref, IMAGE *sec, IMAGE *out, ++im_lrmosaic(IMAGE *ref, IMAGE *sec, IMAGE *out, + int bandno, + int xref, int yref, int xsec, int ysec, +- int hwindowsize, int hsearchsize, ++ int hwindowsize, int hsearchsize, + int balancetype, +- int mwidth ) ++ int mwidth) + { + VipsImage *x; + +- if( vips_mosaic( ref, sec, &x, VIPS_DIRECTION_HORIZONTAL, +- xref, yref, xsec, ysec, +- "hwindow", hwindowsize, +- "harea", hsearchsize, +- "mblend", mwidth, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_mosaic(ref, sec, &x, VIPS_DIRECTION_HORIZONTAL, ++ xref, yref, xsec, ysec, ++ "hwindow", hwindowsize, ++ "harea", hsearchsize, ++ "mblend", mwidth, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_lrmosaic1( IMAGE *ref, IMAGE *sec, IMAGE *out, ++im_lrmosaic1(IMAGE *ref, IMAGE *sec, IMAGE *out, + int bandno, +- int xr1, int yr1, int xs1, int ys1, ++ int xr1, int yr1, int xs1, int ys1, + int xr2, int yr2, int xs2, int ys2, + int hwindowsize, int hsearchsize, + int balancetype, +- int mwidth ) +-{ ++ int mwidth) ++{ + VipsImage *x; + +- if( vips_mosaic1( ref, sec, &x, VIPS_DIRECTION_HORIZONTAL, +- xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, +- "search", TRUE, +- "hwindow", hwindowsize, +- "harea", hsearchsize, +- "mblend", mwidth, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_mosaic1(ref, sec, &x, VIPS_DIRECTION_HORIZONTAL, ++ xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, ++ "search", TRUE, ++ "hwindow", hwindowsize, ++ "harea", hsearchsize, ++ "mblend", mwidth, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_tbmosaic( IMAGE *ref, IMAGE *sec, IMAGE *out, ++im_tbmosaic(IMAGE *ref, IMAGE *sec, IMAGE *out, + int bandno, + int xref, int yref, int xsec, int ysec, +- int hwindowsize, int hsearchsize, ++ int hwindowsize, int hsearchsize, + int balancetype, +- int mwidth ) ++ int mwidth) + { + VipsImage *x; + +- if( vips_mosaic( ref, sec, &x, VIPS_DIRECTION_VERTICAL, +- xref, yref, xsec, ysec, +- "hwindow", hwindowsize, +- "harea", hsearchsize, +- "mblend", mwidth, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_mosaic(ref, sec, &x, VIPS_DIRECTION_VERTICAL, ++ xref, yref, xsec, ysec, ++ "hwindow", hwindowsize, ++ "harea", hsearchsize, ++ "mblend", mwidth, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_tbmosaic1( IMAGE *ref, IMAGE *sec, IMAGE *out, ++im_tbmosaic1(IMAGE *ref, IMAGE *sec, IMAGE *out, + int bandno, +- int xr1, int yr1, int xs1, int ys1, ++ int xr1, int yr1, int xs1, int ys1, + int xr2, int yr2, int xs2, int ys2, + int hwindowsize, int hsearchsize, + int balancetype, +- int mwidth ) +-{ ++ int mwidth) ++{ + VipsImage *x; + +- if( vips_mosaic1( ref, sec, &x, VIPS_DIRECTION_VERTICAL, +- xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, +- "search", TRUE, +- "hwindow", hwindowsize, +- "harea", hsearchsize, +- "mblend", mwidth, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_mosaic1(ref, sec, &x, VIPS_DIRECTION_VERTICAL, ++ xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, ++ "search", TRUE, ++ "hwindow", hwindowsize, ++ "harea", hsearchsize, ++ "mblend", mwidth, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_correl( VipsImage *ref, VipsImage *sec, ++im_correl(VipsImage *ref, VipsImage *sec, + int xref, int yref, int xsec, int ysec, + int hwindowsize, int hsearchsize, +- double *correlation, int *x, int *y ) ++ double *correlation, int *x, int *y) + { +- return( vips__correl( ref, sec, xref, yref, xsec, ysec, +- hwindowsize, hsearchsize, correlation, x, y ) ); ++ return (vips__correl(ref, sec, xref, yref, xsec, ysec, ++ hwindowsize, hsearchsize, correlation, x, y)); + } + + int +-im_lrmerge( IMAGE *ref, IMAGE *sec, IMAGE *out, +- int dx, int dy, int mwidth ) ++im_lrmerge(IMAGE *ref, IMAGE *sec, IMAGE *out, ++ int dx, int dy, int mwidth) + { + VipsImage *x; + +- if( vips_merge( ref, sec, &x, VIPS_DIRECTION_HORIZONTAL, dx, dy, +- "mblend", mwidth, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_merge(ref, sec, &x, VIPS_DIRECTION_HORIZONTAL, dx, dy, ++ "mblend", mwidth, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_lrmerge1( IMAGE *ref, IMAGE *sec, IMAGE *out, +- int xr1, int yr1, int xs1, int ys1, ++im_lrmerge1(IMAGE *ref, IMAGE *sec, IMAGE *out, ++ int xr1, int yr1, int xs1, int ys1, + int xr2, int yr2, int xs2, int ys2, +- int mwidth ) ++ int mwidth) + { + VipsImage *x; + +- if( vips_mosaic1( ref, sec, &x, VIPS_DIRECTION_HORIZONTAL, +- xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, +- "mblend", mwidth, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_mosaic1(ref, sec, &x, VIPS_DIRECTION_HORIZONTAL, ++ xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, ++ "mblend", mwidth, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_tbmerge( IMAGE *ref, IMAGE *sec, IMAGE *out, +- int dx, int dy, int mwidth ) ++im_tbmerge(IMAGE *ref, IMAGE *sec, IMAGE *out, ++ int dx, int dy, int mwidth) + { + VipsImage *x; + +- if( vips_merge( ref, sec, &x, VIPS_DIRECTION_VERTICAL, dx, dy, +- "mblend", mwidth, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_merge(ref, sec, &x, VIPS_DIRECTION_VERTICAL, dx, dy, ++ "mblend", mwidth, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + int +-im_tbmerge1( IMAGE *ref, IMAGE *sec, IMAGE *out, +- int xr1, int yr1, int xs1, int ys1, ++im_tbmerge1(IMAGE *ref, IMAGE *sec, IMAGE *out, ++ int xr1, int yr1, int xs1, int ys1, + int xr2, int yr2, int xs2, int ys2, +- int mwidth ) ++ int mwidth) + { + VipsImage *x; + +- if( vips_mosaic1( ref, sec, &x, VIPS_DIRECTION_VERTICAL, +- xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, +- "mblend", mwidth, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_mosaic1(ref, sec, &x, VIPS_DIRECTION_VERTICAL, ++ xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, ++ "mblend", mwidth, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + /* The common part of most binary conversion +@@ -5514,41 +5552,41 @@ im_tbmerge1( IMAGE *ref, IMAGE *sec, IMAGE *out, + * + * - check in and out + * - cast in1 and in2 up to a common format +- * - equalise bands ++ * - equalise bands + * - make an input array + * - return the matched images in vec[0] and vec[1] + * + * A left-over, remove soon. + */ + IMAGE ** +-im__insert_base( const char *domain, +- IMAGE *in1, IMAGE *in2, IMAGE *out ) ++im__insert_base(const char *domain, ++ IMAGE *in1, IMAGE *in2, IMAGE *out) + { + IMAGE *t[4]; + IMAGE **vec; + +- if( im_piocheck( in1, out ) || +- im_pincheck( in2 ) || +- im_check_bands_1orn( domain, in1, in2 ) || +- im_check_coding_known( domain, in1 ) || +- im_check_coding_same( domain, in1, in2 ) ) +- return( NULL ); ++ if (im_piocheck(in1, out) || ++ im_pincheck(in2) || ++ im_check_bands_1orn(domain, in1, in2) || ++ im_check_coding_known(domain, in1) || ++ im_check_coding_same(domain, in1, in2)) ++ return (NULL); + + /* Cast our input images up to a common format and bands. + */ +- if( im_open_local_array( out, t, 4, domain, "p" ) || +- im__formatalike( in1, in2, t[0], t[1] ) || +- im__bandalike( domain, t[0], t[1], t[2], t[3] ) || +- !(vec = im_allocate_input_array( out, t[2], t[3], NULL )) ) +- return( NULL ); ++ if (im_open_local_array(out, t, 4, domain, "p") || ++ im__formatalike(in1, in2, t[0], t[1]) || ++ im__bandalike(domain, t[0], t[1], t[2], t[3]) || ++ !(vec = im_allocate_input_array(out, t[2], t[3], NULL))) ++ return (NULL); + + /* Generate the output. + */ +- if( im_cp_descv( out, vec[0], vec[1], NULL ) || +- im_demand_hint_array( out, IM_SMALLTILE, vec ) ) +- return( NULL ); ++ if (im_cp_descv(out, vec[0], vec[1], NULL) || ++ im_demand_hint_array(out, IM_SMALLTILE, vec)) ++ return (NULL); + +- return( vec ); ++ return (vec); + } + + /** +@@ -5562,18 +5600,18 @@ im__insert_base( const char *domain, + * + * Insert @sub repeatedly into @main at the positions listed in the arrays @x, + * @y of length @n. @out is the same +- * size as @main. @sub is clipped against the edges of @main. ++ * size as @main. @sub is clipped against the edges of @main. + * + * This operation is fast for large @n, but will use a memory buffer the size + * of @out. It's useful for things like making scatter plots. + * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +- * The two input images are cast up to the smallest common type (see table +- * Smallest common format in ++ * The two input images are cast up to the smallest common type (see table ++ * Smallest common format in + * arithmetic). + * + * See also: im_insert(), im_lrjoin(). +@@ -5581,203 +5619,202 @@ im__insert_base( const char *domain, + * Returns: 0 on success, -1 on error + */ + int +-im_insertset( IMAGE *main, IMAGE *sub, IMAGE *out, int n, int *x, int *y ) ++im_insertset(IMAGE *main, IMAGE *sub, IMAGE *out, int n, int *x, int *y) + { + IMAGE **vec; + IMAGE *t; + int i; + +- if( !(vec = im__insert_base( "im_insert", main, sub, out )) ) +- return( -1 ); ++ if (!(vec = im__insert_base("im_insert", main, sub, out))) ++ return (-1); + + /* Copy to a memory image, zap that, then copy to out. + */ +- if( !(t = im_open_local( out, "im_insertset", "t" )) || +- im_copy( vec[0], t ) ) +- return( -1 ); ++ if (!(t = im_open_local(out, "im_insertset", "t")) || ++ im_copy(vec[0], t)) ++ return (-1); + +- for( i = 0; i < n; i++ ) +- if( im_insertplace( t, vec[1], x[i], y[i] ) ) +- return( -1 ); ++ for (i = 0; i < n; i++) ++ if (im_insertplace(t, vec[1], x[i], y[i])) ++ return (-1); + +- if( im_copy( t, out ) ) +- return( -1 ); ++ if (im_copy(t, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* We had this entry point in earlier libvipses, hilariously. + */ + int +-vips__init( const char *argv0 ) ++vips__init(const char *argv0) + { +- return( vips_init( argv0 ) ); ++ return (vips_init(argv0)); + } + + int +-im_greyc_mask( IMAGE *in, IMAGE *out, IMAGE *mask, ++im_greyc_mask(IMAGE *in, IMAGE *out, IMAGE *mask, + int iterations, + float amplitude, float sharpness, float anisotropy, + float alpha, float sigma, + float dl, float da, float gauss_prec, +- int interpolation, int fast_approx ) ++ int interpolation, int fast_approx) + { +- vips_error( "im_greyc_mask", +- "This function is no longer in the core library" ); ++ vips_error("im_greyc_mask", ++ "This function is no longer in the core library"); + +- return( -1 ); ++ return (-1); + } + + int +-vips_check_imask( const char *domain, INTMASK *mask ) ++vips_check_imask(const char *domain, INTMASK *mask) + { +- if( !mask || +- mask->xsize > 1000 || +- mask->ysize > 1000 || +- mask->xsize <= 0 || +- mask->ysize <= 0 || +- mask->scale == 0 || +- !mask->coeff ) { +- vips_error( domain, "%s", _( "nonsense mask parameters" ) ); +- return( -1 ); ++ if (!mask || ++ mask->xsize > 1000 || ++ mask->ysize > 1000 || ++ mask->xsize <= 0 || ++ mask->ysize <= 0 || ++ mask->scale == 0 || ++ !mask->coeff) { ++ vips_error(domain, "%s", _("nonsense mask parameters")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + int +-vips_check_dmask( const char *domain, DOUBLEMASK *mask ) ++vips_check_dmask(const char *domain, DOUBLEMASK *mask) + { +- if( !mask || +- mask->xsize > 1000 || +- mask->ysize > 1000 || +- mask->xsize <= 0 || +- mask->ysize <= 0 || +- mask->scale == 0 || +- !mask->coeff ) { +- vips_error( domain, "%s", _( "nonsense mask parameters" ) ); +- return( -1 ); ++ if (!mask || ++ mask->xsize > 1000 || ++ mask->ysize > 1000 || ++ mask->xsize <= 0 || ++ mask->ysize <= 0 || ++ mask->scale == 0 || ++ !mask->coeff) { ++ vips_error(domain, "%s", _("nonsense mask parameters")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + int +-vips_check_dmask_1d( const char *domain, DOUBLEMASK *mask ) ++vips_check_dmask_1d(const char *domain, DOUBLEMASK *mask) + { +- if( vips_check_dmask( domain, mask ) ) +- return( -1 ); +- if( mask->xsize != 1 && +- mask->ysize != 1 ) { +- vips_error( domain, "%s", _( "mask must be 1D" ) ); +- return( -1 ); ++ if (vips_check_dmask(domain, mask)) ++ return (-1); ++ if (mask->xsize != 1 && ++ mask->ysize != 1) { ++ vips_error(domain, "%s", _("mask must be 1D")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + GOptionGroup * +-vips_get_option_group( void ) ++vips_get_option_group(void) + { + static GOptionGroup *option_group = NULL; + +- if( !option_group ) { +- option_group = g_option_group_new( "vips", +- _( "VIPS Options" ), _( "Show VIPS options" ), +- NULL, NULL ); +- vips_add_option_entries( option_group ); ++ if (!option_group) { ++ option_group = g_option_group_new("vips", ++ _("VIPS Options"), _("Show VIPS options"), ++ NULL, NULL); ++ vips_add_option_entries(option_group); + } + +- return( option_group ); ++ return (option_group); + } + + /* We used to use this for system() back in the day. But it's awkward to make + * it work properly on win32, so this is now deprecated. + */ + FILE * +-vips_popenf( const char *fmt, const char *mode, ... ) ++vips_popenf(const char *fmt, const char *mode, ...) + { +- vips_error( "popenf", "%s", _( "deprecated" ) ); +- return( NULL ); ++ vips_error("popenf", "%s", _("deprecated")); ++ return (NULL); + } + + /* We used to use this for getpoint(), but since it was the only caller in + * vips8 it's now deprecated. + */ + double * +-vips__ink_to_vector( const char *domain, VipsImage *im, VipsPel *ink, int *n ) ++vips__ink_to_vector(const char *domain, VipsImage *im, VipsPel *ink, int *n) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( im ), 6 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(im), 6); + + double *result; + + #ifdef VIPS_DEBUG +- printf( "vips__ink_to_vector: starting\n" ); ++ printf("vips__ink_to_vector: starting\n"); + #endif /*VIPS_DEBUG*/ + + /* Wrap a VipsImage around ink. + */ +- t[0] = vips_image_new_from_memory( ink, VIPS_IMAGE_SIZEOF_PEL( im ), +- 1, 1, VIPS_IMAGE_SIZEOF_PEL( im ), VIPS_FORMAT_UCHAR ); +- if( vips_copy( t[0], &t[1], +- "bands", im->Bands, +- "format", im->BandFmt, +- "coding", im->Coding, +- "interpretation", im->Type, +- NULL ) ) +- return( NULL ); ++ t[0] = vips_image_new_from_memory(ink, VIPS_IMAGE_SIZEOF_PEL(im), ++ 1, 1, VIPS_IMAGE_SIZEOF_PEL(im), VIPS_FORMAT_UCHAR); ++ if (vips_copy(t[0], &t[1], ++ "bands", im->Bands, ++ "format", im->BandFmt, ++ "coding", im->Coding, ++ "interpretation", im->Type, ++ NULL)) ++ return (NULL); + + /* The image may be coded .. unpack to double. + */ +- if( vips_image_decode( t[1], &t[2] ) || +- vips_cast( t[2], &t[3], VIPS_FORMAT_DOUBLE, NULL ) ) +- return( NULL ); ++ if (vips_image_decode(t[1], &t[2]) || ++ vips_cast(t[2], &t[3], VIPS_FORMAT_DOUBLE, NULL)) ++ return (NULL); + +- /* To a mem buffer, then copy to out. ++ /* To a mem buffer, then copy to out. + */ +- if( !(t[4] = vips_image_new_memory()) || +- vips_image_write( t[3], t[4] ) ) +- return( NULL ); ++ if (!(t[4] = vips_image_new_memory()) || ++ vips_image_write(t[3], t[4])) ++ return (NULL); + +- if( !(result = VIPS_ARRAY( im, t[4]->Bands, double )) ) +- return( NULL ); +- memcpy( result, t[4]->data, VIPS_IMAGE_SIZEOF_PEL( t[4] ) ); +- *n = t[4]->Bands; ++ if (!(result = VIPS_ARRAY(im, t[4]->Bands, double))) ++ return (NULL); ++ memcpy(result, t[4]->data, VIPS_IMAGE_SIZEOF_PEL(t[4])); ++ *n = t[4]->Bands; + + #ifdef VIPS_DEBUG +-{ +- int i; ++ { ++ int i; + +- printf( "vips__ink_to_vector:\n" ); +- printf( "\tink = " ); +- for( i = 0; i < n; i++ ) +- printf( "%d ", ink[i] ); +- printf( "\n" ); ++ printf("vips__ink_to_vector:\n"); ++ printf("\tink = "); ++ for (i = 0; i < n; i++) ++ printf("%d ", ink[i]); ++ printf("\n"); + +- printf( "\tvec = " ); +- for( i = 0; i < *n; i++ ) +- printf( "%g ", result[i] ); +- printf( "\n" ); +-} ++ printf("\tvec = "); ++ for (i = 0; i < *n; i++) ++ printf("%g ", result[i]); ++ printf("\n"); ++ } + #endif /*VIPS_DEBUG*/ + +- return( result ); ++ return (result); + } + + /* Old API. Just a compat stub now. + */ + VipsWindow * +-vips_window_ref( VipsImage *im, int top, int height ) ++vips_window_ref(VipsImage *im, int top, int height) + { +- return( NULL ); ++ return (NULL); + } + + /* Deprecated. + */ + size_t +-vips__get_sizeof_vipsobject( void ) ++vips__get_sizeof_vipsobject(void) + { +- return( sizeof( VipsObject ) ); ++ return (sizeof(VipsObject)); + } +- +diff --git a/libvips/draw/draw.c b/libvips/draw/draw.c +index a60ac2d34c..149ff5808d 100644 +--- a/libvips/draw/draw.c ++++ b/libvips/draw/draw.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -45,7 +45,7 @@ + + #include "pdraw.h" + +-/** ++/** + * SECTION: draw + * @short_description: drawing operations: flood, paste, line, circle + * @stability: Stable +@@ -53,10 +53,10 @@ + * + * These operations directly modify the image. They do not thread, on 32-bit + * machines they will be limited to 2GB images, and a little care needs to be +- * taken if you use them as part of an image pipeline. ++ * taken if you use them as part of an image pipeline. + * They are mostly supposed to be useful for paintbox-style programs. + * +- * libvips operations are all functional: they take zero or more existing input ++ * libvips operations are all functional: they take zero or more existing input + * images and generate zero or more new output images. Images are + * never altered, you always create new images. This means libvips can cache + * and thread very aggressively. +@@ -68,15 +68,15 @@ + * need to draw 1,000 straight lines, a 1,000 operation-deep pipeline is going + * to be a slow way to do it. This is where the draw operations come in. + * +- * To use these operations, use vips_image_copy_memory() to make a private +- * memory copy of the image you want to modify, then call a ++ * To use these operations, use vips_image_copy_memory() to make a private ++ * memory copy of the image you want to modify, then call a + * series of draw operations. + * + * Once you are done drawing, return to normal use of vips operations. Any time +- * you want to start drawing again, you'll need to copy again. ++ * you want to start drawing again, you'll need to copy again. + */ + +-/** ++/** + * VipsCombineMode: + * @VIPS_COMBINE_MODE_SET: set pixels to the new value + * @VIPS_COMBINE_MODE_ADD: add pixels +@@ -84,75 +84,74 @@ + * See vips_draw_image() and so on. + * + * Operations like vips_draw_image() need to be told how to combine images +- * from two sources. ++ * from two sources. + * + * See also: vips_join(). + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsDraw, vips_draw, VIPS_TYPE_OPERATION ); ++G_DEFINE_ABSTRACT_TYPE(VipsDraw, vips_draw, VIPS_TYPE_OPERATION); + + static int +-vips_draw_build( VipsObject *object ) ++vips_draw_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsDraw *draw = VIPS_DRAW( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsDraw *draw = VIPS_DRAW(object); + + #ifdef DEBUG +- printf( "vips_draw_build: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_draw_build: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- if( VIPS_OBJECT_CLASS( vips_draw_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_draw_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_coding_known( class->nickname, draw->image ) || +- vips_image_inplace( draw->image ) ) +- return( -1 ); ++ if (vips_check_coding_known(class->nickname, draw->image) || ++ vips_image_inplace(draw->image)) ++ return (-1); + +- draw->lsize = VIPS_IMAGE_SIZEOF_LINE( draw->image ); +- draw->psize = VIPS_IMAGE_SIZEOF_PEL( draw->image ); ++ draw->lsize = VIPS_IMAGE_SIZEOF_LINE(draw->image); ++ draw->psize = VIPS_IMAGE_SIZEOF_PEL(draw->image); + draw->noclip = FALSE; + +- return( 0 ); ++ return (0); + } + + static void +-vips_draw_class_init( VipsDrawClass *class ) ++vips_draw_class_init(VipsDrawClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "draw"; +- vobject_class->description = _( "draw operations" ); ++ vobject_class->description = _("draw operations"); + vobject_class->build = vips_draw_build; + +- VIPS_ARG_IMAGE( class, "image", 1, +- _( "Image" ), +- _( "Image to draw on" ), +- VIPS_ARGUMENT_REQUIRED_INPUT | VIPS_ARGUMENT_MODIFY, +- G_STRUCT_OFFSET( VipsDraw, image ) ); +- ++ VIPS_ARG_IMAGE(class, "image", 1, ++ _("Image"), ++ _("Image to draw on"), ++ VIPS_ARGUMENT_REQUIRED_INPUT | VIPS_ARGUMENT_MODIFY, ++ G_STRUCT_OFFSET(VipsDraw, image)); + } + + static void +-vips_draw_init( VipsDraw *draw ) ++vips_draw_init(VipsDraw *draw) + { + } + + void +-vips_draw_operation_init( void ) ++vips_draw_operation_init(void) + { +- extern GType vips_draw_rect_get_type( void ); +- extern GType vips_draw_image_get_type( void ); +- extern GType vips_draw_mask_get_type( void ); +- extern GType vips_draw_line_get_type( void ); +- extern GType vips_draw_circle_get_type( void ); +- extern GType vips_draw_flood_get_type( void ); +- extern GType vips_draw_smudge_get_type( void ); ++ extern GType vips_draw_rect_get_type(void); ++ extern GType vips_draw_image_get_type(void); ++ extern GType vips_draw_mask_get_type(void); ++ extern GType vips_draw_line_get_type(void); ++ extern GType vips_draw_circle_get_type(void); ++ extern GType vips_draw_flood_get_type(void); ++ extern GType vips_draw_smudge_get_type(void); + + vips_draw_rect_get_type(); + vips_draw_image_get_type(); +@@ -162,4 +161,3 @@ vips_draw_operation_init( void ) + vips_draw_flood_get_type(); + vips_draw_smudge_get_type(); + } +- +diff --git a/libvips/draw/draw_circle.c b/libvips/draw/draw_circle.c +index 018ec080be..5232599317 100644 +--- a/libvips/draw/draw_circle.c ++++ b/libvips/draw/draw_circle.c +@@ -23,28 +23,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -73,26 +73,26 @@ typedef struct _VipsDrawCircle { + typedef struct _VipsDrawCircleClass { + VipsDrawinkClass parent_class; + +-} VipsDrawCircleClass; ++} VipsDrawCircleClass; + +-G_DEFINE_TYPE( VipsDrawCircle, vips_draw_circle, VIPS_TYPE_DRAWINK ); ++G_DEFINE_TYPE(VipsDrawCircle, vips_draw_circle, VIPS_TYPE_DRAWINK); + + void +-vips__draw_circle_direct( VipsImage *image, int cx, int cy, int r, +- VipsDrawScanline draw_scanline, void *client ) ++vips__draw_circle_direct(VipsImage *image, int cx, int cy, int r, ++ VipsDrawScanline draw_scanline, void *client) + { + int x, y, d; + + y = r; + d = 3 - 2 * r; + +- for( x = 0; x < y; x++ ) { +- draw_scanline( image, cy + y, cx - x, cx + x, 0, client ); +- draw_scanline( image, cy - y, cx - x, cx + x, 1, client ); +- draw_scanline( image, cy + x, cx - y, cx + y, 2, client ); +- draw_scanline( image, cy - x, cx - y, cx + y, 3, client ); ++ for (x = 0; x < y; x++) { ++ draw_scanline(image, cy + y, cx - x, cx + x, 0, client); ++ draw_scanline(image, cy - y, cx - x, cx + x, 1, client); ++ draw_scanline(image, cy + x, cx - y, cx + y, 2, client); ++ draw_scanline(image, cy - x, cx - y, cx + y, 3, client); + +- if( d < 0 ) ++ if (d < 0) + d += 4 * x + 6; + else { + d += 4 * (x - y) + 10; +@@ -100,88 +100,88 @@ vips__draw_circle_direct( VipsImage *image, int cx, int cy, int r, + } + } + +- if( x == y ) { +- draw_scanline( image, cy + y, cx - x, cx + x, 0, client ); +- draw_scanline( image, cy - y, cx - x, cx + x, 1, client ); +- draw_scanline( image, cy + x, cx - y, cx + y, 2, client ); +- draw_scanline( image, cy - x, cx - y, cx + y, 3, client ); ++ if (x == y) { ++ draw_scanline(image, cy + y, cx - x, cx + x, 0, client); ++ draw_scanline(image, cy - y, cx - x, cx + x, 1, client); ++ draw_scanline(image, cy + x, cx - y, cx + y, 2, client); ++ draw_scanline(image, cy - x, cx - y, cx + y, 3, client); + } + } + + static inline void +-vips_draw_circle_draw_point( VipsImage *image, int x, int y, void *client ) ++vips_draw_circle_draw_point(VipsImage *image, int x, int y, void *client) + { +- VipsPel *ink = (VipsPel *) client; +- VipsPel *q = VIPS_IMAGE_ADDR( image, x, y ); +- int psize = VIPS_IMAGE_SIZEOF_PEL( image ); ++ VipsPel *ink = (VipsPel *) client; ++ VipsPel *q = VIPS_IMAGE_ADDR(image, x, y); ++ int psize = VIPS_IMAGE_SIZEOF_PEL(image); + +- int j; ++ int j; + + /* Faster than memcopy() for n < about 20. + */ +- for( j = 0; j < psize; j++ ) ++ for (j = 0; j < psize; j++) + q[j] = ink[j]; + } + + /* Paint endpoints, with clip. + */ +-static void +-vips_draw_circle_draw_endpoints_clip( VipsImage *image, +- int y, int x1, int x2, int quadrant, void *client ) ++static void ++vips_draw_circle_draw_endpoints_clip(VipsImage *image, ++ int y, int x1, int x2, int quadrant, void *client) + { +- if( y >= 0 && +- y < image->Ysize ) { +- if( x1 >=0 && +- x1 < image->Xsize ) +- vips_draw_circle_draw_point( image, x1, y, client ); +- if( x2 >=0 && +- x2 < image->Xsize ) +- vips_draw_circle_draw_point( image, x2, y, client ); ++ if (y >= 0 && ++ y < image->Ysize) { ++ if (x1 >= 0 && ++ x1 < image->Xsize) ++ vips_draw_circle_draw_point(image, x1, y, client); ++ if (x2 >= 0 && ++ x2 < image->Xsize) ++ vips_draw_circle_draw_point(image, x2, y, client); + } + } + + /* Paint endpoints, no clip. + */ +-static void +-vips_draw_circle_draw_endpoints_noclip( VipsImage *image, +- int y, int x1, int x2, int quadrant, void *client ) ++static void ++vips_draw_circle_draw_endpoints_noclip(VipsImage *image, ++ int y, int x1, int x2, int quadrant, void *client) + { +- vips_draw_circle_draw_point( image, x1, y, client ); +- vips_draw_circle_draw_point( image, x2, y, client ); ++ vips_draw_circle_draw_point(image, x1, y, client); ++ vips_draw_circle_draw_point(image, x2, y, client); + } + + /* Paint scanline. + */ +-static void +-vips_draw_circle_draw_scanline( VipsImage *image, +- int y, int x1, int x2, int quadrant, void *client ) ++static void ++vips_draw_circle_draw_scanline(VipsImage *image, ++ int y, int x1, int x2, int quadrant, void *client) + { +- VipsPel *ink = (VipsPel *) client; +- int psize = VIPS_IMAGE_SIZEOF_PEL( image ); ++ VipsPel *ink = (VipsPel *) client; ++ int psize = VIPS_IMAGE_SIZEOF_PEL(image); + + VipsPel *q; + int len; + int i, j; + +- g_assert( x1 <= x2 ); ++ g_assert(x1 <= x2); + +- if( y < 0 || +- y >= image->Ysize ) ++ if (y < 0 || ++ y >= image->Ysize) + return; +- if( x1 < 0 && +- x2 < 0 ) ++ if (x1 < 0 && ++ x2 < 0) + return; +- if( x1 >= image->Xsize && +- x2 >= image->Xsize ) ++ if (x1 >= image->Xsize && ++ x2 >= image->Xsize) + return; +- x1 = VIPS_CLIP( 0, x1, image->Xsize - 1 ); +- x2 = VIPS_CLIP( 0, x2, image->Xsize - 1 ); ++ x1 = VIPS_CLIP(0, x1, image->Xsize - 1); ++ x2 = VIPS_CLIP(0, x2, image->Xsize - 1); + +- q = VIPS_IMAGE_ADDR( image, x1, y ); ++ q = VIPS_IMAGE_ADDR(image, x1, y); + len = x2 - x1 + 1; + +- for( i = 0; i < len; i++ ) { +- for( j = 0; j < psize; j++ ) ++ for (i = 0; i < len; i++) { ++ for (j = 0; j < psize; j++) + q[j] = ink[j]; + + q += psize; +@@ -189,97 +189,95 @@ vips_draw_circle_draw_scanline( VipsImage *image, + } + + static int +-vips_draw_circle_build( VipsObject *object ) ++vips_draw_circle_build(VipsObject *object) + { +- VipsDraw *draw = VIPS_DRAW( object ); +- VipsDrawink *drawink = VIPS_DRAWINK( object ); ++ VipsDraw *draw = VIPS_DRAW(object); ++ VipsDrawink *drawink = VIPS_DRAWINK(object); + VipsDrawCircle *circle = (VipsDrawCircle *) object; + + VipsDrawScanline draw_scanline; + +- if( VIPS_OBJECT_CLASS( vips_draw_circle_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_draw_circle_parent_class)->build(object)) ++ return (-1); + +- if( circle->fill ) ++ if (circle->fill) + draw_scanline = vips_draw_circle_draw_scanline; +- else if( circle->cx - circle->radius >= 0 && ++ else if (circle->cx - circle->radius >= 0 && + circle->cx + circle->radius < draw->image->Xsize && +- circle->cy - circle->radius >= 0 && +- circle->cy + circle->radius < draw->image->Ysize ) +- draw_scanline = vips_draw_circle_draw_endpoints_noclip; +- else +- draw_scanline = vips_draw_circle_draw_endpoints_clip; ++ circle->cy - circle->radius >= 0 && ++ circle->cy + circle->radius < draw->image->Ysize) ++ draw_scanline = vips_draw_circle_draw_endpoints_noclip; ++ else ++ draw_scanline = vips_draw_circle_draw_endpoints_clip; + +- vips__draw_circle_direct( draw->image, ++ vips__draw_circle_direct(draw->image, + circle->cx, circle->cy, circle->radius, +- draw_scanline, drawink->pixel_ink ); ++ draw_scanline, drawink->pixel_ink); + +- return( 0 ); ++ return (0); + } + + static void +-vips_draw_circle_class_init( VipsDrawCircleClass *class ) ++vips_draw_circle_class_init(VipsDrawCircleClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "draw_circle"; +- vobject_class->description = _( "draw a circle on an image" ); ++ vobject_class->description = _("draw a circle on an image"); + vobject_class->build = vips_draw_circle_build; + +- VIPS_ARG_INT( class, "cx", 3, +- _( "cx" ), +- _( "Centre of draw_circle" ), ++ VIPS_ARG_INT(class, "cx", 3, ++ _("cx"), ++ _("Centre of draw_circle"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawCircle, cx ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawCircle, cx), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_INT( class, "cy", 4, +- _( "cy" ), +- _( "Centre of draw_circle" ), ++ VIPS_ARG_INT(class, "cy", 4, ++ _("cy"), ++ _("Centre of draw_circle"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawCircle, cy ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawCircle, cy), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_INT( class, "radius", 5, +- _( "Radius" ), +- _( "Radius in pixels" ), ++ VIPS_ARG_INT(class, "radius", 5, ++ _("Radius"), ++ _("Radius in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawCircle, radius ), +- 0, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawCircle, radius), ++ 0, 1000000000, 0); + +- VIPS_ARG_BOOL( class, "fill", 6, +- _( "Fill" ), +- _( "Draw a solid object" ), ++ VIPS_ARG_BOOL(class, "fill", 6, ++ _("Fill"), ++ _("Draw a solid object"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsDrawCircle, fill ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsDrawCircle, fill), ++ FALSE); + } + + static void +-vips_draw_circle_init( VipsDrawCircle *circle ) ++vips_draw_circle_init(VipsDrawCircle *circle) + { + circle->fill = FALSE; + } + + static int +-vips_draw_circlev( VipsImage *image, +- double *ink, int n, int cx, int cy, int radius, va_list ap ) ++vips_draw_circlev(VipsImage *image, ++ double *ink, int n, int cx, int cy, int radius, va_list ap) + { + VipsArea *area_ink; + int result; + +- area_ink = VIPS_AREA( vips_array_double_new( ink, n ) ); +- result = vips_call_split( "draw_circle", ap, +- image, area_ink, cx, cy, radius ); +- vips_area_unref( area_ink ); ++ area_ink = VIPS_AREA(vips_array_double_new(ink, n)); ++ result = vips_call_split("draw_circle", ap, ++ image, area_ink, cx, cy, radius); ++ vips_area_unref(area_ink); + +- return( result ); ++ return (result); + } + + /** +@@ -299,24 +297,24 @@ vips_draw_circlev( VipsImage *image, + * Draws a circle on @image. If @fill is %TRUE then the circle is filled, + * otherwise a 1-pixel-wide perimeter is drawn. + * +- * @ink is an array of double containing values to draw. ++ * @ink is an array of double containing values to draw. + * + * See also: vips_draw_circle1(), vips_draw_line(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_draw_circle( VipsImage *image, +- double *ink, int n, int cx, int cy, int radius, ... ) ++vips_draw_circle(VipsImage *image, ++ double *ink, int n, int cx, int cy, int radius, ...) + { + va_list ap; + int result; + +- va_start( ap, radius ); +- result = vips_draw_circlev( image, ink, n, cx, cy, radius, ap ); +- va_end( ap ); ++ va_start(ap, radius); ++ result = vips_draw_circlev(image, ink, n, cx, cy, radius, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -332,26 +330,25 @@ vips_draw_circle( VipsImage *image, + * + * * @fill: fill the draw_circle + * +- * As vips_draw_circle(), but just takes a single double for @ink. ++ * As vips_draw_circle(), but just takes a single double for @ink. + * + * See also: vips_draw_circle(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_draw_circle1( VipsImage *image, +- double ink, int cx, int cy, int radius, ... ) ++vips_draw_circle1(VipsImage *image, ++ double ink, int cx, int cy, int radius, ...) + { + double array_ink[1]; + va_list ap; + int result; + +- array_ink[0] = ink; ++ array_ink[0] = ink; + +- va_start( ap, radius ); +- result = vips_draw_circlev( image, array_ink, 1, cx, cy, radius, ap ); +- va_end( ap ); ++ va_start(ap, radius); ++ result = vips_draw_circlev(image, array_ink, 1, cx, cy, radius, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/draw/draw_flood.c b/libvips/draw/draw_flood.c +index 800f387347..8ac5068f19 100644 +--- a/libvips/draw/draw_flood.c ++++ b/libvips/draw/draw_flood.c +@@ -1,9 +1,9 @@ + /* draw_flood-fill + * + * JC 30/8/97 +- * - VIPSified, cleaned up, from "John Robinson's prog to fill ++ * - VIPSified, cleaned up, from "John Robinson's prog to fill + * enclosed areas" +- * - something Kirk gave me, so thanks John ++ * - something Kirk gave me, so thanks John + * JC 1/10/97 + * - swapped inner memcmp/cpy for a loop ... faster for small pixels + * 13/7/02 JC +@@ -36,28 +36,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -75,14 +75,14 @@ + + #include "drawink.h" + +-/* Size of a scanline buffer. We allocate a list of these to hold scanlines ++/* Size of a scanline buffer. We allocate a list of these to hold scanlines + * we need to visit. + */ + #define PBUFSIZE (1000) + + /* A scanline we know could contain pixels connected to us. + * +- * Dir is the direction of connection: +1 means y is increasing, ie. the line ++ * Dir is the direction of connection: +1 means y is increasing, ie. the line + * above this one is filled. -1 if y is decreasing. + */ + typedef struct { +@@ -103,7 +103,7 @@ typedef struct _Buffer { + } Buffer; + + /* What we track during a flood. We have this in a separate struct so that we +- * can support vips__draw_flood_direct() ... a fast path for ++ * can support vips__draw_flood_direct() ... a fast path for + * vips_labelregions() that avoids all of the GObject call overhead. This + * gives a huge speedup, >x10 in many cases. + */ +@@ -114,7 +114,7 @@ typedef struct _Flood { + + /* Draw pixels here, can be equal to test. + */ +- VipsImage *image; ++ VipsImage *image; + + /* Sizeof pel in test. + */ +@@ -144,7 +144,7 @@ typedef struct _Flood { + /* Record bounding box of modified pixels. + */ + int left; +- int right; ++ int right; + int top; + int bottom; + +@@ -153,32 +153,32 @@ typedef struct _Flood { + Buffer *in; + Buffer *out; + +-} Flood; ++} Flood; + + /* Alloc a new buffer. + */ + static Buffer * +-buffer_build( void ) ++buffer_build(void) + { + Buffer *buf; + +- buf = g_new( Buffer, 1 ); ++ buf = g_new(Buffer, 1); + buf->next = NULL; + buf->n = 0; + +- return( buf ); ++ return (buf); + } + + /* Free a chain of buffers. + */ + static void +-buffer_free( Buffer *buf ) ++buffer_free(Buffer *buf) + { +- while( buf ) { ++ while (buf) { + Buffer *p; + + p = buf->next; +- g_free( buf ); ++ g_free(buf); + buf = p; + } + } +@@ -187,19 +187,19 @@ buffer_free( Buffer *buf ) + * the new head buffer. + */ + static Buffer * +-buffer_add( Buffer *buf, Flood *flood, int x1, int x2, int y, int dir ) ++buffer_add(Buffer *buf, Flood *flood, int x1, int x2, int y, int dir) + { + /* Clip against image size. + */ +- if( y < 0 || +- y >= flood->test->Ysize ) +- return( buf ); +- x1 = VIPS_CLIP( 0, x1, flood->test->Xsize - 1 ); +- x2 = VIPS_CLIP( 0, x2, flood->test->Xsize - 1 ); +- if( x2 - x1 < 0 ) +- return( buf ); +- +- if( buf->n == PBUFSIZE ) { ++ if (y < 0 || ++ y >= flood->test->Ysize) ++ return (buf); ++ x1 = VIPS_CLIP(0, x1, flood->test->Xsize - 1); ++ x2 = VIPS_CLIP(0, x2, flood->test->Xsize - 1); ++ if (x2 - x1 < 0) ++ return (buf); ++ ++ if (buf->n == PBUFSIZE) { + Buffer *new; + + new = buffer_build(); +@@ -213,123 +213,123 @@ buffer_add( Buffer *buf, Flood *flood, int x1, int x2, int y, int dir ) + buf->scan[buf->n].dir = dir; + buf->n += 1; + +- return( buf ); ++ return (buf); + } + + /* Is p "connected"? ie. is equal to or not equal to flood->edge, depending on + * whether we are flooding to the edge boundary or flooding edge-coloured +- * pixels. p is a pel in @test. ++ * pixels. p is a pel in @test. + */ + static gboolean +-flood_connected( Flood *flood, VipsPel *p ) ++flood_connected(Flood *flood, VipsPel *p) + { +- int j; ++ int j; + +- for( j = 0; j < flood->tsize; j++ ) +- if( p[j] != flood->edge[j] ) ++ for (j = 0; j < flood->tsize; j++) ++ if (p[j] != flood->edge[j]) + break; + + /* If flood->equal, true if point == edge. + */ +- return( flood->equal ^ (j < flood->tsize) ); ++ return (flood->equal ^ (j < flood->tsize)); + } + +-/* Is p painted? p is a pel in @image. ++/* Is p painted? p is a pel in @image. + */ + static gboolean +-flood_painted( Flood *flood, VipsPel *p ) ++flood_painted(Flood *flood, VipsPel *p) + { +- int j; ++ int j; + +- for( j = 0; j < flood->psize; j++ ) +- if( p[j] != flood->ink[j] ) ++ for (j = 0; j < flood->psize; j++) ++ if (p[j] != flood->ink[j]) + break; + +- return( j == flood->psize ); ++ return (j == flood->psize); + } + + static void +-flood_pel( Flood *flood, VipsPel *q ) ++flood_pel(Flood *flood, VipsPel *q) + { +- int j; ++ int j; + + /* Faster than memcopy() for n < about 20. + */ +- for( j = 0; j < flood->psize; j++ ) ++ for (j = 0; j < flood->psize; j++) + q[j] = flood->ink[j]; + } + + /* Fill a scanline between points x1 and x2 inclusive. x1 < x2. + */ +-static void +-flood_draw_scanline( Flood *flood, int y, int x1, int x2 ) ++static void ++flood_draw_scanline(Flood *flood, int y, int x1, int x2) + { + VipsPel *p; + int i; + int len; + +- g_assert( x1 <= x2 ); ++ g_assert(x1 <= x2); + +- if( y < 0 || +- y >= flood->image->Ysize ) ++ if (y < 0 || ++ y >= flood->image->Ysize) + return; +- if( x1 < 0 && +- x2 < 0 ) ++ if (x1 < 0 && ++ x2 < 0) + return; +- if( x1 >= flood->image->Xsize && +- x2 >= flood->image->Xsize ) ++ if (x1 >= flood->image->Xsize && ++ x2 >= flood->image->Xsize) + return; +- x1 = VIPS_CLIP( 0, x1, flood->image->Xsize - 1 ); +- x2 = VIPS_CLIP( 0, x2, flood->image->Xsize - 1 ); ++ x1 = VIPS_CLIP(0, x1, flood->image->Xsize - 1); ++ x2 = VIPS_CLIP(0, x2, flood->image->Xsize - 1); + +- p = VIPS_IMAGE_ADDR( flood->image, x1, y ); ++ p = VIPS_IMAGE_ADDR(flood->image, x1, y); + len = x2 - x1 + 1; + +- for( i = 0; i < len; i++ ) { +- flood_pel( flood, p ); ++ for (i = 0; i < len; i++) { ++ flood_pel(flood, p); + p += flood->psize; + } + } + +-/* Fill left and right, return the endpoints. The start point (x, y) must be ++/* Fill left and right, return the endpoints. The start point (x, y) must be + * connected and unpainted. + */ +-static void +-flood_scanline( Flood *flood, int x, int y, int *x1, int *x2 ) ++static void ++flood_scanline(Flood *flood, int x, int y, int *x1, int *x2) + { + const int width = flood->test->Xsize; + + int i; + +- g_assert( flood_connected( flood, +- VIPS_IMAGE_ADDR( flood->test, x, y ) ) ); +- g_assert( !flood_painted( flood, +- VIPS_IMAGE_ADDR( flood->image, x, y ) ) ); ++ g_assert(flood_connected(flood, ++ VIPS_IMAGE_ADDR(flood->test, x, y))); ++ g_assert(!flood_painted(flood, ++ VIPS_IMAGE_ADDR(flood->image, x, y))); + + /* Search to the right for the first non-connected pixel. If the start + * pixel is unpainted, we know all the intervening pixels must be + * unpainted too. + */ +- if( x < width ) { +- VipsPel *p = VIPS_IMAGE_ADDR( flood->test, x + 1, y ); ++ if (x < width) { ++ VipsPel *p = VIPS_IMAGE_ADDR(flood->test, x + 1, y); + +- for( i = x + 1; i < width; i++ ) { +- if( !flood_connected( flood, p ) ) ++ for (i = x + 1; i < width; i++) { ++ if (!flood_connected(flood, p)) + break; + p += flood->tsize; + } + *x2 = i - 1; + } +- else ++ else + *x2 = width; + + /* Search left. + */ +- if( x > 0 ) { +- VipsPel *p = VIPS_IMAGE_ADDR( flood->test, x - 1, y ); ++ if (x > 0) { ++ VipsPel *p = VIPS_IMAGE_ADDR(flood->test, x - 1, y); + +- for( i = x - 1; i >= 0; i-- ) { +- if( !flood_connected( flood, p ) ) ++ for (i = x - 1; i >= 0; i--) { ++ if (!flood_connected(flood, p)) + break; + p -= flood->tsize; + } +@@ -340,31 +340,31 @@ flood_scanline( Flood *flood, int x, int y, int *x1, int *x2 ) + + /* Paint the range we discovered. + */ +- flood_draw_scanline( flood, y, *x1, *x2 ); ++ flood_draw_scanline(flood, y, *x1, *x2); + +- flood->left = VIPS_MIN( flood->left, *x1 ); +- flood->right = VIPS_MAX( flood->right, *x2 ); +- flood->top = VIPS_MIN( flood->top, y ); +- flood->bottom = VIPS_MAX( flood->bottom, y ); ++ flood->left = VIPS_MIN(flood->left, *x1); ++ flood->right = VIPS_MAX(flood->right, *x2); ++ flood->top = VIPS_MIN(flood->top, y); ++ flood->bottom = VIPS_MAX(flood->bottom, y); + } + +-/* We know the line below or above us is filled between x1 and x2. Search our ++/* We know the line below or above us is filled between x1 and x2. Search our + * line in this range looking for an edge pixel we can flood from. + */ + static void +-flood_around( Flood *flood, Scan *scan ) ++flood_around(Flood *flood, Scan *scan) + { + VipsPel *p; + int x; + +- g_assert( scan->dir == 1 || +- scan->dir == -1 ); ++ g_assert(scan->dir == 1 || ++ scan->dir == -1); + +- for( p = VIPS_IMAGE_ADDR( flood->test, scan->x1, scan->y ), +- x = scan->x1; +- x <= scan->x2; +- p += flood->tsize, x++ ) { +- if( flood_connected( flood, p ) ) { ++ for (p = VIPS_IMAGE_ADDR(flood->test, scan->x1, scan->y), ++ x = scan->x1; ++ x <= scan->x2; ++ p += flood->tsize, x++) { ++ if (flood_connected(flood, p)) { + int x1a; + int x2a; + +@@ -372,72 +372,72 @@ flood_around( Flood *flood, Scan *scan ) + * to check for painted. Otherwise we can get stuck in + * connected loops. + */ +- if( flood->image != flood->test ) { +- VipsPel *mp = VIPS_IMAGE_ADDR( +- flood->image, x, scan->y ); ++ if (flood->image != flood->test) { ++ VipsPel *mp = VIPS_IMAGE_ADDR( ++ flood->image, x, scan->y); + +- if( flood_painted( flood, mp ) ) ++ if (flood_painted(flood, mp)) + continue; + } + +- flood_scanline( flood, x, scan->y, &x1a, &x2a ); ++ flood_scanline(flood, x, scan->y, &x1a, &x2a); + + /* Our new scanline can have up to three more + * scanlines connected to it: above, below left, below + * right. + */ +- if( x1a < scan->x1 - 1 ) +- flood->out = buffer_add( flood->out, flood, +- x1a, scan->x1 - 2, +- scan->y - scan->dir, -scan->dir ); +- if( x2a > scan->x2 + 1 ) +- flood->out = buffer_add( flood->out, flood, +- scan->x2 + 2, x2a, +- scan->y - scan->dir, -scan->dir ); +- flood->out = buffer_add( flood->out, flood, +- x1a, x2a, scan->y + scan->dir, +- scan->dir ); ++ if (x1a < scan->x1 - 1) ++ flood->out = buffer_add(flood->out, flood, ++ x1a, scan->x1 - 2, ++ scan->y - scan->dir, -scan->dir); ++ if (x2a > scan->x2 + 1) ++ flood->out = buffer_add(flood->out, flood, ++ scan->x2 + 2, x2a, ++ scan->y - scan->dir, -scan->dir); ++ flood->out = buffer_add(flood->out, flood, ++ x1a, x2a, scan->y + scan->dir, ++ scan->dir); + + x = x2a + 1; +- p = VIPS_IMAGE_ADDR( flood->test, x, scan->y ); ++ p = VIPS_IMAGE_ADDR(flood->test, x, scan->y); + } + } + } + + static void +-flood_all( Flood *flood, int x, int y ) ++flood_all(Flood *flood, int x, int y) + { + int x1, x2; + + /* Test start pixel ... nothing to do? + */ +- if( !flood_connected( flood, VIPS_IMAGE_ADDR( flood->test, x, y ) ) ) ++ if (!flood_connected(flood, VIPS_IMAGE_ADDR(flood->test, x, y))) + return; + + flood->in = buffer_build(); + flood->out = buffer_build(); + +- flood_scanline( flood, x, y, &x1, &x2 ); +- flood->in = buffer_add( flood->in, flood, x1, x2, y + 1, 1 ); +- flood->in = buffer_add( flood->in, flood, x1, x2, y - 1, -1 ); ++ flood_scanline(flood, x, y, &x1, &x2); ++ flood->in = buffer_add(flood->in, flood, x1, x2, y + 1, 1); ++ flood->in = buffer_add(flood->in, flood, x1, x2, y - 1, -1); + +- while( flood->in->n ) { ++ while (flood->in->n) { + Buffer *p; + +- for( p = flood->in; p; p = p->next ) { ++ for (p = flood->in; p; p = p->next) { + int i; + +- for( i = 0; i < p->n; i++ ) +- flood_around( flood, &p->scan[i] ); ++ for (i = 0; i < p->n; i++) ++ flood_around(flood, &p->scan[i]); + + p->n = 0; + } + +- VIPS_SWAP( Buffer *, flood->in, flood->out ); ++ VIPS_SWAP(Buffer *, flood->in, flood->out); + } + +- VIPS_FREEF( buffer_free, flood->in ); +- VIPS_FREEF( buffer_free, flood->out ); ++ VIPS_FREEF(buffer_free, flood->in); ++ VIPS_FREEF(buffer_free, flood->out); + } + + /* Base class. +@@ -451,8 +451,8 @@ typedef struct _VipsDrawFlood { + int y; + VipsImage *test; + gboolean equal; +- int left; +- int top; ++ int left; ++ int top; + int width; + int height; + +@@ -460,167 +460,166 @@ typedef struct _VipsDrawFlood { + + typedef VipsDrawinkClass VipsDrawFloodClass; + +-G_DEFINE_TYPE( VipsDrawFlood, vips_draw_flood, VIPS_TYPE_DRAWINK ); ++G_DEFINE_TYPE(VipsDrawFlood, vips_draw_flood, VIPS_TYPE_DRAWINK); + + static int +-vips_draw_flood_build( VipsObject *object ) ++vips_draw_flood_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsDraw *draw = VIPS_DRAW( object ); +- VipsDrawink *drawink = VIPS_DRAWINK( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsDraw *draw = VIPS_DRAW(object); ++ VipsDrawink *drawink = VIPS_DRAWINK(object); + VipsDrawFlood *drawflood = (VipsDrawFlood *) object; + +- Flood flood; +- int j; ++ Flood flood; ++ int j; + +- if( VIPS_OBJECT_CLASS( vips_draw_flood_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_draw_flood_parent_class)->build(object)) ++ return (-1); + + /* @test defaults to @image. + */ +- if( !vips_object_argument_isset( object, "test" ) ) ++ if (!vips_object_argument_isset(object, "test")) + /* Setting input params like this will break caching, but we + * don't cache draw ops anyway. + */ +- g_object_set( object, "test", draw->image, NULL ); ++ g_object_set(object, "test", draw->image, NULL); + +- if( vips_image_wio_input( drawflood->test ) || +- vips_check_coding_known( class->nickname, drawflood->test ) || +- vips_check_size_same( class->nickname, +- drawflood->test, draw->image ) ) +- return( -1 ); ++ if (vips_image_wio_input(drawflood->test) || ++ vips_check_coding_known(class->nickname, drawflood->test) || ++ vips_check_size_same(class->nickname, ++ drawflood->test, draw->image)) ++ return (-1); + + flood.test = drawflood->test; + flood.image = draw->image; +- flood.tsize = VIPS_IMAGE_SIZEOF_PEL( flood.test ); ++ flood.tsize = VIPS_IMAGE_SIZEOF_PEL(flood.test); + flood.equal = drawflood->equal; +- flood.psize = VIPS_IMAGE_SIZEOF_PEL( flood.image ); ++ flood.psize = VIPS_IMAGE_SIZEOF_PEL(flood.image); + flood.ink = drawink->pixel_ink; +- flood.lsize = VIPS_IMAGE_SIZEOF_LINE( flood.image ); ++ flood.lsize = VIPS_IMAGE_SIZEOF_LINE(flood.image); + flood.left = drawflood->x; + flood.right = drawflood->x; + flood.top = drawflood->y; + flood.bottom = drawflood->y; + +- if( flood.equal ) { ++ if (flood.equal) { + /* Edge is set by colour of the start pixel in @test. + */ +- if( !(flood.edge = VIPS_ARRAY( object, flood.tsize, VipsPel )) ) +- return( -1 ); +- memcpy( flood.edge, +- VIPS_IMAGE_ADDR( flood.test, +- drawflood->x, drawflood->y ), +- flood.tsize ); +- +- /* If @test and @image are the same and edge == ink, we'll ++ if (!(flood.edge = VIPS_ARRAY(object, flood.tsize, VipsPel))) ++ return (-1); ++ memcpy(flood.edge, ++ VIPS_IMAGE_ADDR(flood.test, ++ drawflood->x, drawflood->y), ++ flood.tsize); ++ ++ /* If @test and @image are the same and edge == ink, we'll + * never stop :-( or rather, there's nothing to do. + */ +- if( flood.test == flood.image ) { +- for( j = 0; j < flood.tsize; j++ ) +- if( flood.edge[j] != flood.ink[j] ) ++ if (flood.test == flood.image) { ++ for (j = 0; j < flood.tsize; j++) ++ if (flood.edge[j] != flood.ink[j]) + break; + +- if( j != flood.tsize ) +- flood_all( &flood, drawflood->x, drawflood->y ); ++ if (j != flood.tsize) ++ flood_all(&flood, drawflood->x, drawflood->y); + } + else +- flood_all( &flood, drawflood->x, drawflood->y ); ++ flood_all(&flood, drawflood->x, drawflood->y); + } + else { + /* Flood to ink colour. We need to be able to compare @test to +- * @ink. ++ * @ink. + */ +- if( !(flood.edge = vips__vector_to_ink( class->nickname, +- flood.test, +- VIPS_ARRAY_ADDR( drawink->ink, 0 ), NULL, +- VIPS_AREA( drawink->ink )->n )) ) +- return( -1 ); ++ if (!(flood.edge = vips__vector_to_ink(class->nickname, ++ flood.test, ++ VIPS_ARRAY_ADDR(drawink->ink, 0), NULL, ++ VIPS_AREA(drawink->ink)->n))) ++ return (-1); + +- flood_all( &flood, drawflood->x, drawflood->y ); ++ flood_all(&flood, drawflood->x, drawflood->y); + } + +- g_object_set( object, +- "left", flood.left, +- "top", flood.top, ++ g_object_set(object, ++ "left", flood.left, ++ "top", flood.top, + "width", flood.right - flood.left + 1, + "height", flood.bottom - flood.top + 1, +- NULL ); ++ NULL); + +- return( 0 ); ++ return (0); + } + + static void +-vips_draw_flood_class_init( VipsDrawFloodClass *class ) ++vips_draw_flood_class_init(VipsDrawFloodClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "draw_flood"; +- vobject_class->description = _( "flood-fill an area" ); ++ vobject_class->description = _("flood-fill an area"); + vobject_class->build = vips_draw_flood_build; + +- VIPS_ARG_INT( class, "x", 3, +- _( "x" ), +- _( "DrawFlood start point" ), ++ VIPS_ARG_INT(class, "x", 3, ++ _("x"), ++ _("DrawFlood start point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawFlood, x ), +- 0, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawFlood, x), ++ 0, 1000000000, 0); + +- VIPS_ARG_INT( class, "y", 4, +- _( "y" ), +- _( "DrawFlood start point" ), ++ VIPS_ARG_INT(class, "y", 4, ++ _("y"), ++ _("DrawFlood start point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawFlood, y ), +- 0, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawFlood, y), ++ 0, 1000000000, 0); + +- VIPS_ARG_IMAGE( class, "test", 5, +- _( "Test" ), +- _( "Test pixels in this image" ), ++ VIPS_ARG_IMAGE(class, "test", 5, ++ _("Test"), ++ _("Test pixels in this image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsDrawFlood, test ) ); ++ G_STRUCT_OFFSET(VipsDrawFlood, test)); + +- VIPS_ARG_BOOL( class, "equal", 6, +- _( "Equal" ), +- _( "DrawFlood while equal to edge" ), ++ VIPS_ARG_BOOL(class, "equal", 6, ++ _("Equal"), ++ _("DrawFlood while equal to edge"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsDrawFlood, equal ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsDrawFlood, equal), ++ FALSE); + +- VIPS_ARG_INT( class, "left", 7, +- _( "Left" ), +- _( "Left edge of modified area" ), ++ VIPS_ARG_INT(class, "left", 7, ++ _("Left"), ++ _("Left edge of modified area"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsDrawFlood, left ), +- 0, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawFlood, left), ++ 0, 1000000000, 0); + +- VIPS_ARG_INT( class, "top", 8, +- _( "Top" ), +- _( "Top edge of modified area" ), ++ VIPS_ARG_INT(class, "top", 8, ++ _("Top"), ++ _("Top edge of modified area"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsDrawFlood, top ), +- 0, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawFlood, top), ++ 0, 1000000000, 0); + +- VIPS_ARG_INT( class, "width", 9, +- _( "Width" ), +- _( "Width of modified area" ), ++ VIPS_ARG_INT(class, "width", 9, ++ _("Width"), ++ _("Width of modified area"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsDrawFlood, width ), +- 0, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawFlood, width), ++ 0, 1000000000, 0); + +- VIPS_ARG_INT( class, "height", 10, +- _( "Height" ), +- _( "Height of modified area" ), ++ VIPS_ARG_INT(class, "height", 10, ++ _("Height"), ++ _("Height of modified area"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsDrawFlood, height ), +- 0, 1000000000, 0 ); +- ++ G_STRUCT_OFFSET(VipsDrawFlood, height), ++ 0, 1000000000, 0); + } + + static void +-vips_draw_flood_init( VipsDrawFlood *draw_flood ) ++vips_draw_flood_init(VipsDrawFlood *draw_flood) + { + } + +@@ -634,58 +633,58 @@ vips_draw_flood_init( VipsDrawFlood *draw_flood ) + * "equal", TRUE, + * NULL ) + * +- * image must be 1-band int. ++ * image must be 1-band int. + */ + int +-vips__draw_flood_direct( VipsImage *image, VipsImage *test, +- int serial, int x, int y ) ++vips__draw_flood_direct(VipsImage *image, VipsImage *test, ++ int serial, int x, int y) + { +- Flood flood; +- +- if( vips_check_format( "vips__draw_flood_direct", +- image, VIPS_FORMAT_INT ) || +- vips_check_mono( "vips__draw_flood_direct", image ) || +- vips_check_coding_known( "vips__draw_flood_direct", test ) || +- vips_check_size_same( "vips__draw_flood_direct", +- test, image ) || +- vips_image_wio_input( test ) || +- vips_image_inplace( image ) ) +- return( -1 ); ++ Flood flood; ++ ++ if (vips_check_format("vips__draw_flood_direct", ++ image, VIPS_FORMAT_INT) || ++ vips_check_mono("vips__draw_flood_direct", image) || ++ vips_check_coding_known("vips__draw_flood_direct", test) || ++ vips_check_size_same("vips__draw_flood_direct", ++ test, image) || ++ vips_image_wio_input(test) || ++ vips_image_inplace(image)) ++ return (-1); + + flood.test = test; + flood.image = image; +- flood.tsize = VIPS_IMAGE_SIZEOF_PEL( test ); ++ flood.tsize = VIPS_IMAGE_SIZEOF_PEL(test); + flood.equal = TRUE; +- flood.psize = VIPS_IMAGE_SIZEOF_PEL( image ); ++ flood.psize = VIPS_IMAGE_SIZEOF_PEL(image); + flood.ink = (VipsPel *) &serial; +- flood.lsize = VIPS_IMAGE_SIZEOF_LINE( image ); ++ flood.lsize = VIPS_IMAGE_SIZEOF_LINE(image); + flood.left = x; + flood.right = x; + flood.top = y; + flood.bottom = y; + +- if( !(flood.edge = VIPS_ARRAY( image, flood.tsize, VipsPel )) ) +- return( -1 ); +- memcpy( flood.edge, +- VIPS_IMAGE_ADDR( test, x, y ), flood.tsize ); ++ if (!(flood.edge = VIPS_ARRAY(image, flood.tsize, VipsPel))) ++ return (-1); ++ memcpy(flood.edge, ++ VIPS_IMAGE_ADDR(test, x, y), flood.tsize); + +- flood_all( &flood, x, y ); ++ flood_all(&flood, x, y); + +- return( 0 ); ++ return (0); + } + + static int +-vips_draw_floodv( VipsImage *image, +- double *ink, int n, int x, int y, va_list ap ) ++vips_draw_floodv(VipsImage *image, ++ double *ink, int n, int x, int y, va_list ap) + { + VipsArea *area_ink; + int result; + +- area_ink = VIPS_AREA( vips_array_double_new( ink, n ) ); +- result = vips_call_split( "draw_flood", ap, image, area_ink, x, y ); +- vips_area_unref( area_ink ); ++ area_ink = VIPS_AREA(vips_array_double_new(ink, n)); ++ result = vips_call_split("draw_flood", ap, image, area_ink, x, y); ++ vips_area_unref(area_ink); + +- return( result ); ++ return (result); + } + + /** +@@ -713,31 +712,31 @@ vips_draw_floodv( VipsImage *image, + * If @equal is set, it instead searches for pixels which are equal to the + * start point and fills them with @ink. + * +- * Normally it will test and set pixels in @image. If @test is set, it will ++ * Normally it will test and set pixels in @image. If @test is set, it will + * test pixels in @test and set pixels in @image. This lets you search an +- * image (@test) for continuous areas of pixels without modifying it. ++ * image (@test) for continuous areas of pixels without modifying it. + * + * @left, @top, @width, @height output the bounding box of the modified +- * pixels. ++ * pixels. + * +- * @ink is an array of double containing values to draw. ++ * @ink is an array of double containing values to draw. + * + * See also: vips_draw_flood1(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_draw_flood( VipsImage *image, +- double *ink, int n, int x, int y, ... ) ++vips_draw_flood(VipsImage *image, ++ double *ink, int n, int x, int y, ...) + { + va_list ap; + int result; + +- va_start( ap, y ); +- result = vips_draw_floodv( image, ink, n, x, y, ap ); +- va_end( ap ); ++ va_start(ap, y); ++ result = vips_draw_floodv(image, ink, n, x, y, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -757,24 +756,24 @@ vips_draw_flood( VipsImage *image, + * * @width: output width of bounding box of modified area + * * @height: output height of bounding box of modified area + * +- * As vips_draw_flood(), but just takes a single double for @ink. ++ * As vips_draw_flood(), but just takes a single double for @ink. + * + * See also: vips_draw_flood(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_draw_flood1( VipsImage *image, double ink, int x, int y, ... ) ++vips_draw_flood1(VipsImage *image, double ink, int x, int y, ...) + { + double array_ink[1]; + va_list ap; + int result; + +- array_ink[0] = ink; ++ array_ink[0] = ink; + +- va_start( ap, y ); +- result = vips_draw_floodv( image, array_ink, 1, x, y, ap ); +- va_end( ap ); ++ va_start(ap, y); ++ result = vips_draw_floodv(image, array_ink, 1, x, y, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/draw/draw_image.c b/libvips/draw/draw_image.c +index d77f5e1fd7..aa7b684d6d 100644 +--- a/libvips/draw/draw_image.c ++++ b/libvips/draw/draw_image.c +@@ -32,28 +32,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -80,70 +80,80 @@ typedef struct _VipsDrawImage { + VipsImage *sub; + int x; + int y; +- VipsCombineMode mode; ++ VipsCombineMode mode; + + } VipsDrawImage; + + typedef struct _VipsDrawImageClass { + VipsDrawClass parent_class; + +-} VipsDrawImageClass; +- +-G_DEFINE_TYPE( VipsDrawImage, vips_draw_image, VIPS_TYPE_DRAW ); +- +-#define LOOP( TYPE, TEMP, MIN, MAX ) { \ +- TYPE * restrict pt = (TYPE *) p; \ +- TYPE * restrict qt = (TYPE *) q; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- TEMP v; \ +- \ +- v = pt[x] + qt[x]; \ +- \ +- qt[x] = VIPS_CLIP( MIN, v, MAX ); \ +- } \ +-} ++} VipsDrawImageClass; ++ ++G_DEFINE_TYPE(VipsDrawImage, vips_draw_image, VIPS_TYPE_DRAW); ++ ++#define LOOP(TYPE, TEMP, MIN, MAX) \ ++ { \ ++ TYPE *restrict pt = (TYPE *) p; \ ++ TYPE *restrict qt = (TYPE *) q; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ TEMP v; \ ++\ ++ v = pt[x] + qt[x]; \ ++\ ++ qt[x] = VIPS_CLIP(MIN, v, MAX); \ ++ } \ ++ } + +-#define LOOPF( TYPE ) { \ +- TYPE * restrict pt = (TYPE *) p; \ +- TYPE * restrict qt = (TYPE *) q; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- qt[x] += pt[x]; \ +-} ++#define LOOPF(TYPE) \ ++ { \ ++ TYPE *restrict pt = (TYPE *) p; \ ++ TYPE *restrict qt = (TYPE *) q; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ qt[x] += pt[x]; \ ++ } + + static void +-vips_draw_image_mode_add( VipsDrawImage *draw_image, VipsImage *im, +- VipsPel *q, VipsPel *p, int n ) ++vips_draw_image_mode_add(VipsDrawImage *draw_image, VipsImage *im, ++ VipsPel *q, VipsPel *p, int n) + { + /* Complex just doubles the size. + */ +- const int sz = n * im->Bands * +- (vips_band_format_iscomplex( im->BandFmt ) ? 2 : 1); ++ const int sz = n * im->Bands * ++ (vips_band_format_iscomplex(im->BandFmt) ? 2 : 1); + + int x; + +- switch( im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- LOOP( unsigned char, int, 0, UCHAR_MAX ); break; +- case VIPS_FORMAT_CHAR: +- LOOP( signed char, int, SCHAR_MIN, SCHAR_MAX ); break; +- case VIPS_FORMAT_USHORT: +- LOOP( unsigned short, int, 0, USHRT_MAX ); break; +- case VIPS_FORMAT_SHORT: +- LOOP( signed short, int, SCHAR_MIN, SCHAR_MAX ); break; +- case VIPS_FORMAT_UINT: +- LOOP( unsigned int, gint64, 0, UINT_MAX ); break; +- case VIPS_FORMAT_INT: +- LOOP( signed int, gint64, INT_MIN, INT_MAX ); break; +- +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- LOOPF( float ); break; +- +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- LOOPF( double ); break; ++ switch (im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ LOOP(unsigned char, int, 0, UCHAR_MAX); ++ break; ++ case VIPS_FORMAT_CHAR: ++ LOOP(signed char, int, SCHAR_MIN, SCHAR_MAX); ++ break; ++ case VIPS_FORMAT_USHORT: ++ LOOP(unsigned short, int, 0, USHRT_MAX); ++ break; ++ case VIPS_FORMAT_SHORT: ++ LOOP(signed short, int, SCHAR_MIN, SCHAR_MAX); ++ break; ++ case VIPS_FORMAT_UINT: ++ LOOP(unsigned int, gint64, 0, UINT_MAX); ++ break; ++ case VIPS_FORMAT_INT: ++ LOOP(signed int, gint64, INT_MIN, INT_MAX); ++ break; ++ ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ LOOPF(float); ++ break; ++ ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ LOOPF(double); ++ break; + + default: + g_assert_not_reached(); +@@ -151,43 +161,43 @@ vips_draw_image_mode_add( VipsDrawImage *draw_image, VipsImage *im, + } + + static int +-vips_draw_image_build( VipsObject *object ) ++vips_draw_image_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsDraw *draw = VIPS_DRAW( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsDraw *draw = VIPS_DRAW(object); + VipsDrawImage *draw_image = (VipsDrawImage *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 3 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 3); + + VipsImage *im; + VipsRect image_rect; +- VipsRect sub_rect; ++ VipsRect sub_rect; + VipsRect clip_rect; + +- if( VIPS_OBJECT_CLASS( vips_draw_image_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_draw_image_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_coding_known( class->nickname, draw->image ) || +- vips_check_coding_same( class->nickname, +- draw->image, draw_image->sub ) || +- vips_check_bands_1orn_unary( class->nickname, +- draw_image->sub, draw->image->Bands ) ) +- return( -1 ); ++ if (vips_check_coding_known(class->nickname, draw->image) || ++ vips_check_coding_same(class->nickname, ++ draw->image, draw_image->sub) || ++ vips_check_bands_1orn_unary(class->nickname, ++ draw_image->sub, draw->image->Bands)) ++ return (-1); + +- /* SET will work for any matching coding, but every other mode needs +- * uncoded images. ++ /* SET will work for any matching coding, but every other mode needs ++ * uncoded images. + */ +- if( draw_image->mode != VIPS_COMBINE_MODE_SET && +- vips_check_uncoded( class->nickname, draw->image ) ) +- return( -1 ); ++ if (draw_image->mode != VIPS_COMBINE_MODE_SET && ++ vips_check_uncoded(class->nickname, draw->image)) ++ return (-1); + + /* Cast sub to match main in bands and format. + */ + im = draw_image->sub; +- if( im->Coding == VIPS_CODING_NONE ) { +- if( vips__bandup( class->nickname, +- im, &t[0], draw->image->Bands ) || +- vips_cast( t[0], &t[1], draw->image->BandFmt, NULL ) ) +- return( -1 ); ++ if (im->Coding == VIPS_CODING_NONE) { ++ if (vips__bandup(class->nickname, ++ im, &t[0], draw->image->Bands) || ++ vips_cast(t[0], &t[1], draw->image->BandFmt, NULL)) ++ return (-1); + + im = t[1]; + } +@@ -202,90 +212,89 @@ vips_draw_image_build( VipsObject *object ) + sub_rect.top = draw_image->y; + sub_rect.width = im->Xsize; + sub_rect.height = im->Ysize; +- vips_rect_intersectrect( &image_rect, &sub_rect, &clip_rect ); ++ vips_rect_intersectrect(&image_rect, &sub_rect, &clip_rect); + +- if( !vips_rect_isempty( &clip_rect ) ) { ++ if (!vips_rect_isempty(&clip_rect)) { + VipsPel *p, *q; + int y; + +- if( vips_image_wio_input( im ) ) +- return( -1 ); ++ if (vips_image_wio_input(im)) ++ return (-1); + +- p = VIPS_IMAGE_ADDR( im, +- clip_rect.left - draw_image->x, +- clip_rect.top - draw_image->y ); +- q = VIPS_IMAGE_ADDR( draw->image, +- clip_rect.left, clip_rect.top ); ++ p = VIPS_IMAGE_ADDR(im, ++ clip_rect.left - draw_image->x, ++ clip_rect.top - draw_image->y); ++ q = VIPS_IMAGE_ADDR(draw->image, ++ clip_rect.left, clip_rect.top); + +- for( y = 0; y < clip_rect.height; y++ ) { +- switch( draw_image->mode ) { ++ for (y = 0; y < clip_rect.height; y++) { ++ switch (draw_image->mode) { + case VIPS_COMBINE_MODE_SET: +- memcpy( (char *) q, (char *) p, +- clip_rect.width * +- VIPS_IMAGE_SIZEOF_PEL( im ) ); ++ memcpy((char *) q, (char *) p, ++ clip_rect.width * ++ VIPS_IMAGE_SIZEOF_PEL(im)); + break; + + case VIPS_COMBINE_MODE_ADD: +- vips_draw_image_mode_add( draw_image, +- im, q, p, clip_rect.width ); ++ vips_draw_image_mode_add(draw_image, ++ im, q, p, clip_rect.width); + break; + + default: + g_assert_not_reached(); + } + +- p += VIPS_IMAGE_SIZEOF_LINE( im ); +- q += VIPS_IMAGE_SIZEOF_LINE( draw->image ); ++ p += VIPS_IMAGE_SIZEOF_LINE(im); ++ q += VIPS_IMAGE_SIZEOF_LINE(draw->image); + } + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_draw_image_class_init( VipsDrawImageClass *class ) ++vips_draw_image_class_init(VipsDrawImageClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "draw_image"; +- vobject_class->description = _( "paint an image into another image" ); ++ vobject_class->description = _("paint an image into another image"); + vobject_class->build = vips_draw_image_build; + +- VIPS_ARG_IMAGE( class, "sub", 5, +- _( "Sub-image" ), +- _( "Sub-image to insert into main image" ), ++ VIPS_ARG_IMAGE(class, "sub", 5, ++ _("Sub-image"), ++ _("Sub-image to insert into main image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawImage, sub ) ); ++ G_STRUCT_OFFSET(VipsDrawImage, sub)); + +- VIPS_ARG_INT( class, "x", 6, +- _( "x" ), +- _( "Draw image here" ), ++ VIPS_ARG_INT(class, "x", 6, ++ _("x"), ++ _("Draw image here"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawImage, x ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawImage, x), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_INT( class, "y", 7, +- _( "y" ), +- _( "Draw image here" ), ++ VIPS_ARG_INT(class, "y", 7, ++ _("y"), ++ _("Draw image here"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawImage, y ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawImage, y), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_ENUM( class, "mode", 8, +- _( "Mode" ), +- _( "Combining mode" ), ++ VIPS_ARG_ENUM(class, "mode", 8, ++ _("Mode"), ++ _("Combining mode"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsDrawImage, mode ), +- VIPS_TYPE_COMBINE_MODE, VIPS_COMBINE_MODE_SET ); +- ++ G_STRUCT_OFFSET(VipsDrawImage, mode), ++ VIPS_TYPE_COMBINE_MODE, VIPS_COMBINE_MODE_SET); + } + + static void +-vips_draw_image_init( VipsDrawImage *draw_image ) ++vips_draw_image_init(VipsDrawImage *draw_image) + { + draw_image->mode = VIPS_COMBINE_MODE_SET; + } +@@ -300,29 +309,29 @@ vips_draw_image_init( VipsDrawImage *draw_image ) + * + * Optional arguments: + * +- * * @mode: how to combine pixels ++ * * @mode: how to combine pixels + * +- * Draw @sub on top of @image at position @x, @y. The two images must have the ++ * Draw @sub on top of @image at position @x, @y. The two images must have the + * same Coding. If @sub has 1 band, the bands will be duplicated to match the + * number of bands in @image. @sub will be converted to @image's format, see + * vips_cast(). + * +- * Use @mode to set how pixels are combined. If you use +- * #VIPS_COMBINE_MODE_ADD, both images muct be uncoded. ++ * Use @mode to set how pixels are combined. If you use ++ * #VIPS_COMBINE_MODE_ADD, both images muct be uncoded. + * + * See also: vips_draw_mask(), vips_insert(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_draw_image( VipsImage *image, VipsImage *sub, int x, int y, ... ) ++vips_draw_image(VipsImage *image, VipsImage *sub, int x, int y, ...) + { + va_list ap; + int result; + +- va_start( ap, y ); +- result = vips_call_split( "draw_image", ap, image, sub, x, y ); +- va_end( ap ); ++ va_start(ap, y); ++ result = vips_call_split("draw_image", ap, image, sub, x, y); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/draw/draw_line.c b/libvips/draw/draw_line.c +index 35f3bf5f92..a1d10447d4 100644 +--- a/libvips/draw/draw_line.c ++++ b/libvips/draw/draw_line.c +@@ -26,28 +26,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -77,13 +77,13 @@ typedef struct _VipsDrawLine { + typedef struct _VipsDrawLineClass { + VipsDrawinkClass parent_class; + +-} VipsDrawLineClass; ++} VipsDrawLineClass; + +-G_DEFINE_TYPE( VipsDrawLine, vips_draw_line, VIPS_TYPE_DRAWINK ); ++G_DEFINE_TYPE(VipsDrawLine, vips_draw_line, VIPS_TYPE_DRAWINK); + + void +-vips__draw_line_direct( VipsImage *image, int x1, int y1, int x2, int y2, +- VipsDrawPoint draw_point, void *client ) ++vips__draw_line_direct(VipsImage *image, int x1, int y1, int x2, int y2, ++ VipsDrawPoint draw_point, void *client) + { + int dx, dy; + int x, y, err; +@@ -91,117 +91,117 @@ vips__draw_line_direct( VipsImage *image, int x1, int y1, int x2, int y2, + dx = x2 - x1; + dy = y2 - y1; + +- /* Swap endpoints to reduce number of cases. ++ /* Swap endpoints to reduce number of cases. + */ +- if( abs( dx ) >= abs( dy ) && +- dx < 0 ) { +- /* Swap to get all x greater or equal cases going to the ++ if (abs(dx) >= abs(dy) && ++ dx < 0) { ++ /* Swap to get all x greater or equal cases going to the + * right. Do diagonals here .. just have up and right and down + * and right now. + */ +- VIPS_SWAP( int, x1, x2 ); +- VIPS_SWAP( int, y1, y2 ); ++ VIPS_SWAP(int, x1, x2); ++ VIPS_SWAP(int, y1, y2); + } +- else if( abs( dx ) < abs( dy ) && +- dy < 0 ) { ++ else if (abs(dx) < abs(dy) && ++ dy < 0) { + /* Swap to get all y greater cases going down the screen. + */ +- VIPS_SWAP( int, x1, x2 ); +- VIPS_SWAP( int, y1, y2 ); ++ VIPS_SWAP(int, x1, x2); ++ VIPS_SWAP(int, y1, y2); + } + + dx = x2 - x1; + dy = y2 - y1; + +- x = x1; ++ x = x1; + y = y1; + + /* Special case: zero width and height is single point. + */ +- if( dx == 0 && +- dy == 0 ) +- draw_point( image, x, y, client ); ++ if (dx == 0 && ++ dy == 0) ++ draw_point(image, x, y, client); + /* Special case vertical and horizontal lines for speed. + */ +- else if( dx == 0 ) { ++ else if (dx == 0) { + /* Vertical line going down. + */ +- for( ; y <= y2; y++ ) +- draw_point( image, x, y, client ); ++ for (; y <= y2; y++) ++ draw_point(image, x, y, client); + } +- else if( dy == 0 ) { ++ else if (dy == 0) { + /* Horizontal line to the right. + */ +- for( ; x <= x2; x++ ) +- draw_point( image, x, y, client ); ++ for (; x <= x2; x++) ++ draw_point(image, x, y, client); + } + /* Special case diagonal lines. + */ +- else if( abs( dy ) == abs( dx ) && +- dy > 0 ) { ++ else if (abs(dy) == abs(dx) && ++ dy > 0) { + /* Diagonal line going down and right. + */ +- for( ; x <= x2; x++, y++ ) +- draw_point( image, x, y, client ); ++ for (; x <= x2; x++, y++) ++ draw_point(image, x, y, client); + } +- else if( abs( dy ) == abs( dx ) && +- dy < 0 ) { ++ else if (abs(dy) == abs(dx) && ++ dy < 0) { + /* Diagonal line going up and right. + */ +- for( ; x <= x2; x++, y-- ) +- draw_point( image, x, y, client ); ++ for (; x <= x2; x++, y--) ++ draw_point(image, x, y, client); + } +- else if( abs( dy ) < abs( dx ) && +- dy > 0 ) { ++ else if (abs(dy) < abs(dx) && ++ dy > 0) { + /* Between -45 and 0 degrees. + */ +- for( err = 0; x <= x2; x++ ) { +- draw_point( image, x, y, client ); ++ for (err = 0; x <= x2; x++) { ++ draw_point(image, x, y, client); + + err += dy; +- if( err >= dx ) { ++ if (err >= dx) { + err -= dx; + y++; + } + } + } +- else if( abs( dy ) < abs( dx ) && +- dy < 0 ) { ++ else if (abs(dy) < abs(dx) && ++ dy < 0) { + /* Between 0 and 45 degrees. + */ +- for( err = 0; x <= x2; x++ ) { +- draw_point( image, x, y, client ); ++ for (err = 0; x <= x2; x++) { ++ draw_point(image, x, y, client); + + err -= dy; +- if( err >= dx ) { ++ if (err >= dx) { + err -= dx; + y--; + } + } + } +- else if( abs( dy ) > abs( dx ) && +- dx > 0 ) { ++ else if (abs(dy) > abs(dx) && ++ dx > 0) { + /* Between -45 and -90 degrees. + */ +- for( err = 0; y <= y2; y++ ) { +- draw_point( image, x, y, client ); ++ for (err = 0; y <= y2; y++) { ++ draw_point(image, x, y, client); + + err += dx; +- if( err >= dy ) { ++ if (err >= dy) { + err -= dy; + x++; + } + } + } +- else if( abs( dy ) > abs( dx ) && +- dx < 0 ) { ++ else if (abs(dy) > abs(dx) && ++ dx < 0) { + /* Between -90 and -135 degrees. + */ +- for( err = 0; y <= y2; y++ ) { +- draw_point( image, x, y, client ); ++ for (err = 0; y <= y2; y++) { ++ draw_point(image, x, y, client); + + err -= dx; +- if( err >= dy ) { ++ if (err >= dy) { + err -= dy; + x--; + } +@@ -212,122 +212,121 @@ vips__draw_line_direct( VipsImage *image, int x1, int y1, int x2, int y2, + } + + static void +-vips_draw_line_draw_point_noclip( VipsImage *image, int x, int y, void *client ) ++vips_draw_line_draw_point_noclip(VipsImage *image, int x, int y, void *client) + { +- VipsPel *ink = (VipsPel *) client; +- VipsPel *q = VIPS_IMAGE_ADDR( image, x, y ); +- int psize = VIPS_IMAGE_SIZEOF_PEL( image ); ++ VipsPel *ink = (VipsPel *) client; ++ VipsPel *q = VIPS_IMAGE_ADDR(image, x, y); ++ int psize = VIPS_IMAGE_SIZEOF_PEL(image); + +- int j; ++ int j; + + /* Faster than memcopy() for n < about 20. + */ +- for( j = 0; j < psize; j++ ) ++ for (j = 0; j < psize; j++) + q[j] = ink[j]; + } + + static void +-vips_draw_line_draw_point_clip( VipsImage *image, int x, int y, void *client ) ++vips_draw_line_draw_point_clip(VipsImage *image, int x, int y, void *client) + { +- if( x >= 0 && ++ if (x >= 0 && + x < image->Xsize && + y >= 0 && +- y < image->Ysize ) +- vips_draw_line_draw_point_noclip( image, x, y, client ); ++ y < image->Ysize) ++ vips_draw_line_draw_point_noclip(image, x, y, client); + } + + static int +-vips_draw_line_build( VipsObject *object ) ++vips_draw_line_build(VipsObject *object) + { +- VipsDraw *draw = VIPS_DRAW( object ); +- VipsDrawink *drawink = VIPS_DRAWINK( object ); ++ VipsDraw *draw = VIPS_DRAW(object); ++ VipsDrawink *drawink = VIPS_DRAWINK(object); + VipsDrawLine *line = (VipsDrawLine *) object; + + VipsDrawPoint draw_point; + +- if( VIPS_OBJECT_CLASS( vips_draw_line_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_draw_line_parent_class)->build(object)) ++ return (-1); + +- if( line->x1 < draw->image->Xsize && ++ if (line->x1 < draw->image->Xsize && + line->x1 >= 0 && +- line->x2 < draw->image->Xsize && ++ line->x2 < draw->image->Xsize && + line->x2 >= 0 && +- line->y1 < draw->image->Ysize && ++ line->y1 < draw->image->Ysize && + line->y1 >= 0 && +- line->y2 < draw->image->Ysize && +- line->y2 >= 0 ) ++ line->y2 < draw->image->Ysize && ++ line->y2 >= 0) + draw_point = vips_draw_line_draw_point_noclip; + else + draw_point = vips_draw_line_draw_point_clip; + +- vips__draw_line_direct( draw->image, ++ vips__draw_line_direct(draw->image, + line->x1, line->y1, line->x2, line->y2, +- draw_point, drawink->pixel_ink ); ++ draw_point, drawink->pixel_ink); + +- return( 0 ); ++ return (0); + } + + static void +-vips_draw_line_class_init( VipsDrawLineClass *class ) ++vips_draw_line_class_init(VipsDrawLineClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "draw_line"; +- vobject_class->description = _( "draw a line on an image" ); ++ vobject_class->description = _("draw a line on an image"); + vobject_class->build = vips_draw_line_build; + +- VIPS_ARG_INT( class, "x1", 3, +- _( "x1" ), +- _( "Start of draw_line" ), ++ VIPS_ARG_INT(class, "x1", 3, ++ _("x1"), ++ _("Start of draw_line"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawLine, x1 ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawLine, x1), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_INT( class, "y1", 4, +- _( "y1" ), +- _( "Start of draw_line" ), ++ VIPS_ARG_INT(class, "y1", 4, ++ _("y1"), ++ _("Start of draw_line"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawLine, y1 ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawLine, y1), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_INT( class, "x2", 5, +- _( "x2" ), +- _( "End of draw_line" ), ++ VIPS_ARG_INT(class, "x2", 5, ++ _("x2"), ++ _("End of draw_line"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawLine, x2 ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawLine, x2), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_INT( class, "y2", 6, +- _( "y2" ), +- _( "End of draw_line" ), ++ VIPS_ARG_INT(class, "y2", 6, ++ _("y2"), ++ _("End of draw_line"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawLine, y2 ), +- -1000000000, 1000000000, 0 ); +- ++ G_STRUCT_OFFSET(VipsDrawLine, y2), ++ -1000000000, 1000000000, 0); + } + + static void +-vips_draw_line_init( VipsDrawLine *draw_line ) ++vips_draw_line_init(VipsDrawLine *draw_line) + { + } + + static int +-vips_draw_linev( VipsImage *image, +- double *ink, int n, int x1, int y1, int x2, int y2, va_list ap ) ++vips_draw_linev(VipsImage *image, ++ double *ink, int n, int x1, int y1, int x2, int y2, va_list ap) + { + VipsArea *area_ink; + int result; + +- area_ink = VIPS_AREA( vips_array_double_new( ink, n ) ); +- result = vips_call_split( "draw_line", ap, +- image, area_ink, x1, y1, x2, y2 ); +- vips_area_unref( area_ink ); ++ area_ink = VIPS_AREA(vips_array_double_new(ink, n)); ++ result = vips_call_split("draw_line", ap, ++ image, area_ink, x1, y1, x2, y2); ++ vips_area_unref(area_ink); + +- return( result ); ++ return (result); + } + + /** +@@ -341,26 +340,26 @@ vips_draw_linev( VipsImage *image, + * @y2: end of draw_line + * @...: %NULL-terminated list of optional named arguments + * +- * Draws a 1-pixel-wide line on an image. ++ * Draws a 1-pixel-wide line on an image. + * +- * @ink is an array of double containing values to draw. ++ * @ink is an array of double containing values to draw. + * +- * See also: vips_draw_line1(), vips_draw_circle(), vips_draw_mask(). ++ * See also: vips_draw_line1(), vips_draw_circle(), vips_draw_mask(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_draw_line( VipsImage *image, +- double *ink, int n, int x1, int y1, int x2, int y2, ... ) ++vips_draw_line(VipsImage *image, ++ double *ink, int n, int x1, int y1, int x2, int y2, ...) + { + va_list ap; + int result; + +- va_start( ap, y2 ); +- result = vips_draw_linev( image, ink, n, x1, y1, x2, y2, ap ); +- va_end( ap ); ++ va_start(ap, y2); ++ result = vips_draw_linev(image, ink, n, x1, y1, x2, y2, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -373,25 +372,25 @@ vips_draw_line( VipsImage *image, + * @y2: end of draw_line + * @...: %NULL-terminated list of optional named arguments + * +- * As vips_draw_line(), but just take a single double for @ink. ++ * As vips_draw_line(), but just take a single double for @ink. + * + * See also: vips_draw_line(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_draw_line1( VipsImage *image, +- double ink, int x1, int y1, int x2, int y2, ... ) ++vips_draw_line1(VipsImage *image, ++ double ink, int x1, int y1, int x2, int y2, ...) + { + double array_ink[1]; + va_list ap; + int result; + +- array_ink[0] = ink; ++ array_ink[0] = ink; + +- va_start( ap, y2 ); +- result = vips_draw_linev( image, array_ink, 1, x1, y1, x2, y2, ap ); +- va_end( ap ); ++ va_start(ap, y2); ++ result = vips_draw_linev(image, array_ink, 1, x1, y1, x2, y2, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/draw/draw_mask.c b/libvips/draw/draw_mask.c +index 284b5aa076..2a37028069 100644 +--- a/libvips/draw/draw_mask.c ++++ b/libvips/draw/draw_mask.c +@@ -24,28 +24,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -80,151 +80,157 @@ typedef struct _VipsDrawMask { + typedef struct _VipsDrawMaskClass { + VipsDrawinkClass parent_class; + +-} VipsDrawMaskClass; ++} VipsDrawMaskClass; + +-G_DEFINE_TYPE( VipsDrawMask, vips_draw_mask, VIPS_TYPE_DRAWINK ); ++G_DEFINE_TYPE(VipsDrawMask, vips_draw_mask, VIPS_TYPE_DRAWINK); + + /* Paint ink into an 8 or 16 bit integer image. + */ +-#define IBLEND( TYPE, TO, INK ) { \ +- TYPE *tto = (TYPE *) (TO); \ +- TYPE *tink = (TYPE *) (INK); \ +- \ +- int x, i, j; \ +- \ +- for( j = 0, x = 0; x < width; x++ ) \ +- for( i = 0; i < bands; i++, j++ ) \ +- tto[j] = (tink[i] * m[x] + \ +- tto[j] * (255 - m[x])) / 255; \ +-} ++#define IBLEND(TYPE, TO, INK) \ ++ { \ ++ TYPE *tto = (TYPE *) (TO); \ ++ TYPE *tink = (TYPE *) (INK); \ ++\ ++ int x, i, j; \ ++\ ++ for (j = 0, x = 0; x < width; x++) \ ++ for (i = 0; i < bands; i++, j++) \ ++ tto[j] = (tink[i] * m[x] + \ ++ tto[j] * (255 - m[x])) / \ ++ 255; \ ++ } + + /* Do the blend with doubles. + */ +-#define DBLEND( TYPE, TO, INK ) { \ +- TYPE *tto = (TYPE *) (TO); \ +- TYPE *tink = (TYPE *) (INK); \ +- \ +- int x, i, j; \ +- \ +- for( j = 0, x = 0; x < width; x++ ) \ +- for( i = 0; i < bands; i++, j++ ) \ +- tto[j] = ((double) tink[i] * m[x] + \ +- (double) tto[j] * (255 - m[x])) / 255; \ +-} ++#define DBLEND(TYPE, TO, INK) \ ++ { \ ++ TYPE *tto = (TYPE *) (TO); \ ++ TYPE *tink = (TYPE *) (INK); \ ++\ ++ int x, i, j; \ ++\ ++ for (j = 0, x = 0; x < width; x++) \ ++ for (i = 0; i < bands; i++, j++) \ ++ tto[j] = ((double) tink[i] * m[x] + \ ++ (double) tto[j] * (255 - m[x])) / \ ++ 255; \ ++ } + + /* Blend of complex. + */ +-#define CBLEND( TYPE, TO, INK ) { \ +- TYPE *tto = (TYPE *) (TO); \ +- TYPE *tink = (TYPE *) (INK); \ +- \ +- int x, i, j; \ +- \ +- for( j = 0, x = 0; x < width; x++ ) \ +- for( i = 0; i < bands * 2; i += 2, j += 2 ) { \ +- tto[j] = ((double) tink[i] * m[x] + \ +- (double) tto[j] * (255 - m[x])) / 255;\ +- tto[j + 1] = ((double) tink[i + 1] * m[x] + \ +- (double) tto[j + 1] * (255 - m[x])) / \ +- 255;\ +- } \ +-} ++#define CBLEND(TYPE, TO, INK) \ ++ { \ ++ TYPE *tto = (TYPE *) (TO); \ ++ TYPE *tink = (TYPE *) (INK); \ ++\ ++ int x, i, j; \ ++\ ++ for (j = 0, x = 0; x < width; x++) \ ++ for (i = 0; i < bands * 2; i += 2, j += 2) { \ ++ tto[j] = ((double) tink[i] * m[x] + \ ++ (double) tto[j] * (255 - m[x])) / \ ++ 255; \ ++ tto[j + 1] = ((double) tink[i + 1] * m[x] + \ ++ (double) tto[j + 1] * (255 - m[x])) / \ ++ 255; \ ++ } \ ++ } + + static int +-vips_draw_mask_draw_labq( VipsImage *image, VipsImage *mask, VipsPel *ink, +- VipsRect *image_clip, VipsRect *mask_clip ) ++vips_draw_mask_draw_labq(VipsImage *image, VipsImage *mask, VipsPel *ink, ++ VipsRect *image_clip, VipsRect *mask_clip) + { + int width = image_clip->width; + int height = image_clip->height; +- int bands = image->Bands; ++ int bands = image->Bands; + + float *lab_buffer; + int y; + +- if( !(lab_buffer = VIPS_ARRAY( NULL, width * 3, float )) ) +- return( -1 ); ++ if (!(lab_buffer = VIPS_ARRAY(NULL, width * 3, float))) ++ return (-1); + +- for( y = 0; y < height; y++ ) { +- VipsPel *to = VIPS_IMAGE_ADDR( image, +- image_clip->left, +- y + image_clip->top ); +- VipsPel *m = VIPS_IMAGE_ADDR( mask, +- mask_clip->left, +- y + mask_clip->top ); ++ for (y = 0; y < height; y++) { ++ VipsPel *to = VIPS_IMAGE_ADDR(image, ++ image_clip->left, ++ y + image_clip->top); ++ VipsPel *m = VIPS_IMAGE_ADDR(mask, ++ mask_clip->left, ++ y + mask_clip->top); + +- vips__LabQ2Lab_vec( lab_buffer, to, width ); +- DBLEND( float, lab_buffer, (double *) ink ); +- vips__Lab2LabQ_vec( to, lab_buffer, width ); ++ vips__LabQ2Lab_vec(lab_buffer, to, width); ++ DBLEND(float, lab_buffer, (double *) ink); ++ vips__Lab2LabQ_vec(to, lab_buffer, width); + } + +- g_free( lab_buffer ); ++ g_free(lab_buffer); + +- return( 0 ); ++ return (0); + } + + static int +-vips_draw_mask_draw( VipsImage *image, VipsImage *mask, VipsPel *ink, +- VipsRect *image_clip, VipsRect *mask_clip ) ++vips_draw_mask_draw(VipsImage *image, VipsImage *mask, VipsPel *ink, ++ VipsRect *image_clip, VipsRect *mask_clip) + { + int width = image_clip->width; + int height = image_clip->height; +- int bands = image->Bands; ++ int bands = image->Bands; + + int y; + +- for( y = 0; y < height; y++ ) { +- VipsPel *to = VIPS_IMAGE_ADDR( image, +- image_clip->left, y + image_clip->top ); +- VipsPel *m = VIPS_IMAGE_ADDR( mask, +- mask_clip->left, y + mask_clip->top ); ++ for (y = 0; y < height; y++) { ++ VipsPel *to = VIPS_IMAGE_ADDR(image, ++ image_clip->left, y + image_clip->top); ++ VipsPel *m = VIPS_IMAGE_ADDR(mask, ++ mask_clip->left, y + mask_clip->top); + +- switch( image->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- IBLEND( unsigned char, to, ink ); ++ switch (image->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ IBLEND(unsigned char, to, ink); + break; + +- case VIPS_FORMAT_CHAR: +- IBLEND( signed char, to, ink ); ++ case VIPS_FORMAT_CHAR: ++ IBLEND(signed char, to, ink); + break; + +- case VIPS_FORMAT_USHORT: +- IBLEND( unsigned short, to, ink ); ++ case VIPS_FORMAT_USHORT: ++ IBLEND(unsigned short, to, ink); + break; + +- case VIPS_FORMAT_SHORT: +- IBLEND( signed short, to, ink ); ++ case VIPS_FORMAT_SHORT: ++ IBLEND(signed short, to, ink); + break; + +- case VIPS_FORMAT_UINT: +- DBLEND( unsigned int, to, ink ); ++ case VIPS_FORMAT_UINT: ++ DBLEND(unsigned int, to, ink); + break; + +- case VIPS_FORMAT_INT: +- DBLEND( signed int, to, ink ); ++ case VIPS_FORMAT_INT: ++ DBLEND(signed int, to, ink); + break; + +- case VIPS_FORMAT_FLOAT: +- DBLEND( float, to, ink ); ++ case VIPS_FORMAT_FLOAT: ++ DBLEND(float, to, ink); + break; + + case VIPS_FORMAT_DOUBLE: +- DBLEND( double, to, ink ); ++ DBLEND(double, to, ink); + break; + + case VIPS_FORMAT_COMPLEX: +- CBLEND( float, to, ink ); ++ CBLEND(float, to, ink); + break; + + case VIPS_FORMAT_DPCOMPLEX: +- CBLEND( double, to, ink ); ++ CBLEND(double, to, ink); + break; + + default: +- g_assert_not_reached(); ++ g_assert_not_reached(); + } + } + +- return( 0 ); ++ return (0); + } + + /* Direct path for draw-mask-along-line or draw-mask-along-circle. We want to +@@ -233,22 +239,22 @@ vips_draw_mask_draw( VipsImage *image, VipsImage *mask, VipsPel *ink, + * The vips7 im_draw_mask() wrapper calls this as well. + */ + int +-vips__draw_mask_direct( VipsImage *image, VipsImage *mask, +- VipsPel *ink, int x, int y ) ++vips__draw_mask_direct(VipsImage *image, VipsImage *mask, ++ VipsPel *ink, int x, int y) + { + VipsRect image_rect; + VipsRect area_rect; + VipsRect image_clip; + VipsRect mask_clip; + +- if( vips_check_coding_noneorlabq( "draw_mask_direct", image ) || +- vips_image_inplace( image ) || +- vips_image_wio_input( mask ) || +- vips_check_mono( "draw_mask_direct", mask ) || +- vips_check_uncoded( "draw_mask_direct", mask ) || +- vips_check_format( "draw_mask_direct", +- mask, VIPS_FORMAT_UCHAR ) ) +- return( -1 ); ++ if (vips_check_coding_noneorlabq("draw_mask_direct", image) || ++ vips_image_inplace(image) || ++ vips_image_wio_input(mask) || ++ vips_check_mono("draw_mask_direct", mask) || ++ vips_check_uncoded("draw_mask_direct", mask) || ++ vips_check_format("draw_mask_direct", ++ mask, VIPS_FORMAT_UCHAR)) ++ return (-1); + + /* Find the area we draw on the image. + */ +@@ -260,7 +266,7 @@ vips__draw_mask_direct( VipsImage *image, VipsImage *mask, + image_rect.top = 0; + image_rect.width = image->Xsize; + image_rect.height = image->Ysize; +- vips_rect_intersectrect( &area_rect, &image_rect, &image_clip ); ++ vips_rect_intersectrect(&area_rect, &image_rect, &image_clip); + + /* And the area of the mask image we use. + */ +@@ -268,97 +274,96 @@ vips__draw_mask_direct( VipsImage *image, VipsImage *mask, + mask_clip.left -= x; + mask_clip.top -= y; + +- if( !vips_rect_isempty( &image_clip ) ) +- switch( image->Coding ) { ++ if (!vips_rect_isempty(&image_clip)) ++ switch (image->Coding) { + case VIPS_CODING_LABQ: +- if( vips_draw_mask_draw_labq( image, mask, ink, +- &image_clip, &mask_clip ) ) +- return( -1 ); ++ if (vips_draw_mask_draw_labq(image, mask, ink, ++ &image_clip, &mask_clip)) ++ return (-1); + break; + + case VIPS_CODING_NONE: +- if( vips_draw_mask_draw( image, mask, ink, +- &image_clip, &mask_clip ) ) +- return( -1 ); ++ if (vips_draw_mask_draw(image, mask, ink, ++ &image_clip, &mask_clip)) ++ return (-1); + break; + + default: + g_assert_not_reached(); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_draw_mask_build( VipsObject *object ) ++vips_draw_mask_build(VipsObject *object) + { +- VipsDraw *draw = VIPS_DRAW( object ); +- VipsDrawink *drawink = VIPS_DRAWINK( object ); ++ VipsDraw *draw = VIPS_DRAW(object); ++ VipsDrawink *drawink = VIPS_DRAWINK(object); + VipsDrawMask *mask = (VipsDrawMask *) object; + +- if( VIPS_OBJECT_CLASS( vips_draw_mask_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_draw_mask_parent_class)->build(object)) ++ return (-1); + +- if( vips__draw_mask_direct( draw->image, mask->mask, drawink->pixel_ink, +- mask->x, mask->y ) ) +- return( -1 ) ; ++ if (vips__draw_mask_direct(draw->image, mask->mask, drawink->pixel_ink, ++ mask->x, mask->y)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_draw_mask_class_init( VipsDrawMaskClass *class ) ++vips_draw_mask_class_init(VipsDrawMaskClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "draw_mask"; +- vobject_class->description = _( "draw a mask on an image" ); ++ vobject_class->description = _("draw a mask on an image"); + vobject_class->build = vips_draw_mask_build; + +- VIPS_ARG_IMAGE( class, "mask", 5, +- _( "Mask" ), +- _( "Mask of pixels to draw" ), ++ VIPS_ARG_IMAGE(class, "mask", 5, ++ _("Mask"), ++ _("Mask of pixels to draw"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawMask, mask ) ); ++ G_STRUCT_OFFSET(VipsDrawMask, mask)); + +- VIPS_ARG_INT( class, "x", 6, +- _( "x" ), +- _( "Draw mask here" ), ++ VIPS_ARG_INT(class, "x", 6, ++ _("x"), ++ _("Draw mask here"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawMask, x ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawMask, x), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_INT( class, "y", 7, +- _( "y" ), +- _( "Draw mask here" ), ++ VIPS_ARG_INT(class, "y", 7, ++ _("y"), ++ _("Draw mask here"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawMask, y ), +- -1000000000, 1000000000, 0 ); +- ++ G_STRUCT_OFFSET(VipsDrawMask, y), ++ -1000000000, 1000000000, 0); + } + + static void +-vips_draw_mask_init( VipsDrawMask *draw_mask ) ++vips_draw_mask_init(VipsDrawMask *draw_mask) + { + } + + static int +-vips_draw_maskv( VipsImage *image, +- double *ink, int n, VipsImage *mask, int x, int y, va_list ap ) ++vips_draw_maskv(VipsImage *image, ++ double *ink, int n, VipsImage *mask, int x, int y, va_list ap) + { + VipsArea *area_ink; + int result; + +- area_ink = VIPS_AREA( vips_array_double_new( ink, n ) ); +- result = vips_call_split( "draw_mask", ap, +- image, area_ink, mask, x, y ); +- vips_area_unref( area_ink ); ++ area_ink = VIPS_AREA(vips_array_double_new(ink, n)); ++ result = vips_call_split("draw_mask", ap, ++ image, area_ink, mask, x, y); ++ vips_area_unref(area_ink); + +- return( result ); ++ return (result); + } + + /** +@@ -373,27 +378,27 @@ vips_draw_maskv( VipsImage *image, + * + * Draw @mask on the image. @mask is a monochrome 8-bit image with 0/255 + * for transparent or @ink coloured points. Intermediate values blend the ink +- * with the pixel. Use with vips_text() to draw text on an image. Use in a +- * vips_draw_line() subclass to draw an object along a line. ++ * with the pixel. Use with vips_text() to draw text on an image. Use in a ++ * vips_draw_line() subclass to draw an object along a line. + * +- * @ink is an array of double containing values to draw. ++ * @ink is an array of double containing values to draw. + * + * See also: vips_text(), vips_draw_line(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_draw_mask( VipsImage *image, +- double *ink, int n, VipsImage *mask, int x, int y, ... ) ++vips_draw_mask(VipsImage *image, ++ double *ink, int n, VipsImage *mask, int x, int y, ...) + { + va_list ap; + int result; + +- va_start( ap, y ); +- result = vips_draw_maskv( image, ink, n, mask, x, y, ap ); +- va_end( ap ); ++ va_start(ap, y); ++ result = vips_draw_maskv(image, ink, n, mask, x, y, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -405,25 +410,25 @@ vips_draw_mask( VipsImage *image, + * @y: draw mask here + * @...: %NULL-terminated list of optional named arguments + * +- * As vips_draw_mask(), but just takes a single double for @ink. ++ * As vips_draw_mask(), but just takes a single double for @ink. + * + * See also: vips_draw_mask(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_draw_mask1( VipsImage *image, +- double ink, VipsImage *mask, int x, int y, ... ) ++vips_draw_mask1(VipsImage *image, ++ double ink, VipsImage *mask, int x, int y, ...) + { + double array_ink[1]; + va_list ap; + int result; + +- array_ink[0] = ink; ++ array_ink[0] = ink; + +- va_start( ap, y ); +- result = vips_draw_maskv( image, array_ink, 1, mask, x, y, ap ); +- va_end( ap ); ++ va_start(ap, y); ++ result = vips_draw_maskv(image, array_ink, 1, mask, x, y, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/draw/draw_rect.c b/libvips/draw/draw_rect.c +index 59b9475c80..695f95edf0 100644 +--- a/libvips/draw/draw_rect.c ++++ b/libvips/draw/draw_rect.c +@@ -1,4 +1,4 @@ +-/* Fill Rect r of image im with pels of colour ink. ++/* Fill Rect r of image im with pels of colour ink. + * + * Copyright: J. Cupitt + * Written: 15/06/1992 +@@ -17,34 +17,34 @@ + * - renamed as im_draw_rect() for consistency + * 27/9/10 + * - memcpy() subsequent lines of the rect +- * 10/2/14 ++ * 10/2/14 + * - redo as a class + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -71,23 +71,23 @@ typedef struct _VipsDrawRect { + int top; + int width; + int height; +- gboolean fill; ++ gboolean fill; + + } VipsDrawRect; + + typedef struct _VipsDrawRectClass { + VipsDrawinkClass parent_class; + +-} VipsDrawRectClass; ++} VipsDrawRectClass; + +-G_DEFINE_TYPE( VipsDrawRect, vips_draw_rect, VIPS_TYPE_DRAWINK ); ++G_DEFINE_TYPE(VipsDrawRect, vips_draw_rect, VIPS_TYPE_DRAWINK); + + static int +-vips_draw_rect_build( VipsObject *object ) ++vips_draw_rect_build(VipsObject *object) + { +- VipsDraw *draw = VIPS_DRAW( object ); +- VipsDrawink *drawink = VIPS_DRAWINK( object ); +- VipsArea *ink = VIPS_AREA( drawink->ink ); ++ VipsDraw *draw = VIPS_DRAW(object); ++ VipsDrawink *drawink = VIPS_DRAWINK(object); ++ VipsArea *ink = VIPS_AREA(drawink->ink); + VipsDrawRect *draw_rect = (VipsDrawRect *) object; + int left = draw_rect->left; + int top = draw_rect->top; +@@ -95,29 +95,29 @@ vips_draw_rect_build( VipsObject *object ) + int height = draw_rect->height; + + VipsRect image; +- VipsRect rect; ++ VipsRect rect; + VipsRect clip; + +- if( VIPS_OBJECT_CLASS( vips_draw_rect_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_draw_rect_parent_class)->build(object)) ++ return (-1); + + /* Also use a solid fill for very narrow unfilled rects. + */ +- if( !draw_rect->fill && ++ if (!draw_rect->fill && + width > 2 && +- height > 2 ) +- return( vips_draw_rect( draw->image, +- ink->data, ink->n, +- left, top, width, 1, NULL ) || +- vips_draw_rect( draw->image, +- ink->data, ink->n, +- left + width - 1, top, 1, height, NULL ) || +- vips_draw_rect( draw->image, +- ink->data, ink->n, +- left, top + height - 1, width, 1, NULL ) || +- vips_draw_rect( draw->image, +- ink->data, ink->n, +- left, top, 1, height, NULL ) ); ++ height > 2) ++ return (vips_draw_rect(draw->image, ++ ink->data, ink->n, ++ left, top, width, 1, NULL) || ++ vips_draw_rect(draw->image, ++ ink->data, ink->n, ++ left + width - 1, top, 1, height, NULL) || ++ vips_draw_rect(draw->image, ++ ink->data, ink->n, ++ left, top + height - 1, width, 1, NULL) || ++ vips_draw_rect(draw->image, ++ ink->data, ink->n, ++ left, top, 1, height, NULL)); + + image.left = 0; + image.top = 0; +@@ -127,11 +127,11 @@ vips_draw_rect_build( VipsObject *object ) + rect.top = top; + rect.width = width; + rect.height = height; +- vips_rect_intersectrect( &rect, &image, &clip ); ++ vips_rect_intersectrect(&rect, &image, &clip); + +- if( !vips_rect_isempty( &clip ) ) { +- VipsPel *to = +- VIPS_IMAGE_ADDR( draw->image, clip.left, clip.top ); ++ if (!vips_rect_isempty(&clip)) { ++ VipsPel *to = ++ VIPS_IMAGE_ADDR(draw->image, clip.left, clip.top); + + VipsPel *q; + int x, y; +@@ -141,90 +141,89 @@ vips_draw_rect_build( VipsObject *object ) + */ + + q = to; +- for( x = 0; x < clip.width; x++ ) { +- vips__drawink_pel( drawink, q ); ++ for (x = 0; x < clip.width; x++) { ++ vips__drawink_pel(drawink, q); + q += draw->psize; + } + + q = to + draw->lsize; +- for( y = 1; y < clip.height; y++ ) { +- memcpy( q, to, clip.width * draw->psize ); ++ for (y = 1; y < clip.height; y++) { ++ memcpy(q, to, clip.width * draw->psize); + q += draw->lsize; + } + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_draw_rect_class_init( VipsDrawRectClass *class ) ++vips_draw_rect_class_init(VipsDrawRectClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "draw_rect"; +- vobject_class->description = _( "paint a rectangle on an image" ); ++ vobject_class->description = _("paint a rectangle on an image"); + vobject_class->build = vips_draw_rect_build; + +- VIPS_ARG_INT( class, "left", 6, +- _( "Left" ), +- _( "Rect to fill" ), ++ VIPS_ARG_INT(class, "left", 6, ++ _("Left"), ++ _("Rect to fill"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawRect, left ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawRect, left), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_INT( class, "top", 7, +- _( "Top" ), +- _( "Rect to fill" ), ++ VIPS_ARG_INT(class, "top", 7, ++ _("Top"), ++ _("Rect to fill"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawRect, top ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawRect, top), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_INT( class, "width", 8, +- _( "Width" ), +- _( "Rect to fill" ), ++ VIPS_ARG_INT(class, "width", 8, ++ _("Width"), ++ _("Rect to fill"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawRect, width ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawRect, width), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_INT( class, "height", 9, +- _( "Height" ), +- _( "Rect to fill" ), ++ VIPS_ARG_INT(class, "height", 9, ++ _("Height"), ++ _("Rect to fill"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawRect, height ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawRect, height), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_BOOL( class, "fill", 10, +- _( "Fill" ), +- _( "Draw a solid object" ), ++ VIPS_ARG_BOOL(class, "fill", 10, ++ _("Fill"), ++ _("Draw a solid object"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsDrawRect, fill ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsDrawRect, fill), ++ FALSE); + } + + static void +-vips_draw_rect_init( VipsDrawRect *draw_rect ) ++vips_draw_rect_init(VipsDrawRect *draw_rect) + { + } + + static int +-vips_draw_rectv( VipsImage *image, +- double *ink, int n, int left, int top, int width, int height, +- va_list ap ) ++vips_draw_rectv(VipsImage *image, ++ double *ink, int n, int left, int top, int width, int height, ++ va_list ap) + { + VipsArea *area_ink; + int result; + +- area_ink = VIPS_AREA( vips_array_double_new( ink, n ) ); +- result = vips_call_split( "draw_rect", ap, +- image, area_ink, left, top, width, height ); +- vips_area_unref( area_ink ); ++ area_ink = VIPS_AREA(vips_array_double_new(ink, n)); ++ result = vips_call_split("draw_rect", ap, ++ image, area_ink, left, top, width, height); ++ vips_area_unref(area_ink); + +- return( result ); ++ return (result); + } + + /** +@@ -250,18 +249,18 @@ vips_draw_rectv( VipsImage *image, + * Returns: 0 on success, or -1 on error. + */ + int +-vips_draw_rect( VipsImage *image, +- double *ink, int n, int left, int top, int width, int height, ... ) ++vips_draw_rect(VipsImage *image, ++ double *ink, int n, int left, int top, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_draw_rectv( image, +- ink, n, left, top, width, height, ap ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_draw_rectv(image, ++ ink, n, left, top, width, height, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -278,28 +277,28 @@ vips_draw_rect( VipsImage *image, + * + * * @fill: fill the rect + * +- * As vips_draw_rect(), but just take a single double for @ink. ++ * As vips_draw_rect(), but just take a single double for @ink. + * + * See also: vips_draw_rect(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_draw_rect1( VipsImage *image, +- double ink, int left, int top, int width, int height, ... ) ++vips_draw_rect1(VipsImage *image, ++ double ink, int left, int top, int width, int height, ...) + { + double array_ink[1]; + va_list ap; + int result; + +- array_ink[0] = ink; ++ array_ink[0] = ink; + +- va_start( ap, height ); +- result = vips_draw_rectv( image, +- array_ink, 1, left, top, width, height, ap ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_draw_rectv(image, ++ array_ink, 1, left, top, width, height, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -318,16 +317,16 @@ vips_draw_rect1( VipsImage *image, + * Returns: 0 on success, or -1 on error. + */ + int +-vips_draw_point( VipsImage *image, double *ink, int n, int x, int y, ... ) ++vips_draw_point(VipsImage *image, double *ink, int n, int x, int y, ...) + { + va_list ap; + int result; + +- va_start( ap, y ); +- result = vips_draw_rectv( image, ink, n, x, y, 1, 1, ap ); +- va_end( ap ); ++ va_start(ap, y); ++ result = vips_draw_rectv(image, ink, n, x, y, 1, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -338,25 +337,24 @@ vips_draw_point( VipsImage *image, double *ink, int n, int x, int y, ... ) + * @y: point to draw + * @...: %NULL-terminated list of optional named arguments + * +- * As vips_draw_point(), but just take a single double for @ink. ++ * As vips_draw_point(), but just take a single double for @ink. + * + * See also: vips_draw_point(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_draw_point1( VipsImage *image, double ink, int x, int y, ... ) ++vips_draw_point1(VipsImage *image, double ink, int x, int y, ...) + { + double array_ink[1]; + va_list ap; + int result; + +- array_ink[0] = ink; ++ array_ink[0] = ink; + +- va_start( ap, y ); +- result = vips_draw_rectv( image, array_ink, 1, x, y, 1, 1, ap ); +- va_end( ap ); ++ va_start(ap, y); ++ result = vips_draw_rectv(image, array_ink, 1, x, y, 1, 1, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/draw/draw_smudge.c b/libvips/draw/draw_smudge.c +index 17df68946d..ef7a18fa1b 100644 +--- a/libvips/draw/draw_smudge.c ++++ b/libvips/draw/draw_smudge.c +@@ -1,4 +1,4 @@ +-/* Smudge a piece of image. ++/* Smudge a piece of image. + * + * Copyright: J. Cupitt + * Written: 15/06/1992 +@@ -24,28 +24,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -77,15 +77,15 @@ typedef struct _VipsDrawSmudge { + typedef struct _VipsDrawSmudgeClass { + VipsDrawClass parent_class; + +-} VipsDrawSmudgeClass; ++} VipsDrawSmudgeClass; + +-G_DEFINE_TYPE( VipsDrawSmudge, vips_draw_smudge, VIPS_TYPE_DRAW ); ++G_DEFINE_TYPE(VipsDrawSmudge, vips_draw_smudge, VIPS_TYPE_DRAW); + + static int +-vips_draw_smudge_build( VipsObject *object ) ++vips_draw_smudge_build(VipsObject *object) + { +- VipsDraw *draw = VIPS_DRAW( object ); +- VipsImage *im = draw->image; ++ VipsDraw *draw = VIPS_DRAW(object); ++ VipsImage *im = draw->image; + VipsDrawSmudge *smudge = (VipsDrawSmudge *) object; + int left = smudge->left; + int top = smudge->top; +@@ -94,18 +94,16 @@ vips_draw_smudge_build( VipsObject *object ) + + /* Double bands for complex images. + */ +- int bands = vips_image_get_bands( draw->image ) * +- (vips_band_format_iscomplex( vips_image_get_format( im ) ) ? +- 2 : 1); +- int elements = bands * vips_image_get_width( im ); ++ int bands = vips_image_get_bands(draw->image) * ++ (vips_band_format_iscomplex(vips_image_get_format(im)) ? 2 : 1); ++ int elements = bands * vips_image_get_width(im); + + VipsRect area, image, clipped; + double *total; + int x, y, i, j, b; + +- if( VIPS_OBJECT_CLASS( vips_draw_smudge_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_draw_smudge_parent_class)->build(object)) ++ return (-1); + + area.left = left; + area.top = top; +@@ -118,113 +116,132 @@ vips_draw_smudge_build( VipsObject *object ) + image.top = 0; + image.width = im->Xsize; + image.height = im->Ysize; +- vips_rect_marginadjust( &image, -1 ); ++ vips_rect_marginadjust(&image, -1); + +- vips_rect_intersectrect( &area, &image, &clipped ); +- if( vips_rect_isempty( &clipped ) ) +- return( 0 ); ++ vips_rect_intersectrect(&area, &image, &clipped); ++ if (vips_rect_isempty(&clipped)) ++ return (0); + +- if( !(total = VIPS_ARRAY( im, bands, double )) ) +- return( -1 ); ++ if (!(total = VIPS_ARRAY(im, bands, double))) ++ return (-1); + + /* What we do for each type. + */ +-#define SMUDGE( TYPE ) \ +- for( y = 0; y < clipped.height; y++ ) { \ ++#define SMUDGE(TYPE) \ ++ for (y = 0; y < clipped.height; y++) { \ + TYPE *q; \ + TYPE *p; \ +- \ +- q = (TYPE *) VIPS_IMAGE_ADDR( im, \ +- clipped.left, clipped.top + y ); \ ++\ ++ q = (TYPE *) VIPS_IMAGE_ADDR(im, \ ++ clipped.left, clipped.top + y); \ + p = q - elements - bands; \ +- for( x = 0; x < clipped.width; x++ ) { \ ++ for (x = 0; x < clipped.width; x++) { \ + TYPE *p1, *p2; \ +- \ +- for( b = 0; b < bands; b++ ) \ ++\ ++ for (b = 0; b < bands; b++) \ + total[b] = 0.0; \ +- \ ++\ + p1 = p; \ +- for( i = 0; i < 3; i++ ) { \ ++ for (i = 0; i < 3; i++) { \ + p2 = p1; \ +- for( j = 0; j < 3; j++ ) \ +- for( b = 0; b < bands; b++ ) \ ++ for (j = 0; j < 3; j++) \ ++ for (b = 0; b < bands; b++) \ + total[b] += *p2++; \ +- \ ++\ + p1 += elements; \ + } \ +- \ +- for( b = 0; b < bands; b++ ) \ ++\ ++ for (b = 0; b < bands; b++) \ + q[b] = (16 * (double) q[b] + total[b]) / 25.0; \ +- \ ++\ + p += bands; \ + q += bands; \ + } \ + } + +- switch( vips_image_get_format( im ) ) { +- case VIPS_FORMAT_UCHAR: SMUDGE( unsigned char ); break; +- case VIPS_FORMAT_CHAR: SMUDGE( char ); break; +- case VIPS_FORMAT_USHORT: SMUDGE( unsigned short ); break; +- case VIPS_FORMAT_SHORT: SMUDGE( short ); break; +- case VIPS_FORMAT_UINT: SMUDGE( unsigned int ); break; +- case VIPS_FORMAT_INT: SMUDGE( int ); break; +- case VIPS_FORMAT_FLOAT: SMUDGE( float ); break; +- case VIPS_FORMAT_DOUBLE: SMUDGE( double ); break; +- case VIPS_FORMAT_COMPLEX: SMUDGE( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: SMUDGE( double ); break; ++ switch (vips_image_get_format(im)) { ++ case VIPS_FORMAT_UCHAR: ++ SMUDGE(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ SMUDGE(char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ SMUDGE(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ SMUDGE(short); ++ break; ++ case VIPS_FORMAT_UINT: ++ SMUDGE(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ SMUDGE(int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ SMUDGE(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ SMUDGE(double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ SMUDGE(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ SMUDGE(double); ++ break; + + default: + g_assert_not_reached(); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_draw_smudge_class_init( VipsDrawSmudgeClass *class ) ++vips_draw_smudge_class_init(VipsDrawSmudgeClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "draw_smudge"; +- vobject_class->description = _( "blur a rectangle on an image" ); ++ vobject_class->description = _("blur a rectangle on an image"); + vobject_class->build = vips_draw_smudge_build; + +- VIPS_ARG_INT( class, "left", 6, +- _( "Left" ), +- _( "Rect to fill" ), ++ VIPS_ARG_INT(class, "left", 6, ++ _("Left"), ++ _("Rect to fill"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawSmudge, left ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawSmudge, left), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_INT( class, "top", 7, +- _( "Top" ), +- _( "Rect to fill" ), ++ VIPS_ARG_INT(class, "top", 7, ++ _("Top"), ++ _("Rect to fill"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawSmudge, top ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawSmudge, top), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_INT( class, "width", 8, +- _( "Width" ), +- _( "Rect to fill" ), ++ VIPS_ARG_INT(class, "width", 8, ++ _("Width"), ++ _("Rect to fill"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawSmudge, width ), +- -1000000000, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsDrawSmudge, width), ++ -1000000000, 1000000000, 0); + +- VIPS_ARG_INT( class, "height", 9, +- _( "Height" ), +- _( "Rect to fill" ), ++ VIPS_ARG_INT(class, "height", 9, ++ _("Height"), ++ _("Rect to fill"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawSmudge, height ), +- -1000000000, 1000000000, 0 ); +- ++ G_STRUCT_OFFSET(VipsDrawSmudge, height), ++ -1000000000, 1000000000, 0); + } + + static void +-vips_draw_smudge_init( VipsDrawSmudge *draw_smudge ) ++vips_draw_smudge_init(VipsDrawSmudge *draw_smudge) + { + } + +@@ -238,23 +255,23 @@ vips_draw_smudge_init( VipsDrawSmudge *draw_smudge ) + * @...: %NULL-terminated list of optional named arguments + * + * Smudge a section of @image. Each pixel in the area @left, @top, @width, +- * @height is replaced by the average of the surrounding 3x3 pixels. ++ * @height is replaced by the average of the surrounding 3x3 pixels. + * + * See also: vips_draw_line(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_draw_smudge( VipsImage *image, +- int left, int top, int width, int height, ... ) ++vips_draw_smudge(VipsImage *image, ++ int left, int top, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "draw_smudge", ap, +- image, left, top, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("draw_smudge", ap, ++ image, left, top, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/draw/drawink.c b/libvips/draw/drawink.c +index dd12b33158..1fabf64d73 100644 +--- a/libvips/draw/drawink.c ++++ b/libvips/draw/drawink.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -45,66 +45,65 @@ + + #include "drawink.h" + +-G_DEFINE_ABSTRACT_TYPE( VipsDrawink, vips_drawink, VIPS_TYPE_DRAW ); ++G_DEFINE_ABSTRACT_TYPE(VipsDrawink, vips_drawink, VIPS_TYPE_DRAW); + + static int +-vips_drawink_build( VipsObject *object ) ++vips_drawink_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsDraw *draw = VIPS_DRAW( object ); +- VipsDrawink *drawink = VIPS_DRAWINK( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsDraw *draw = VIPS_DRAW(object); ++ VipsDrawink *drawink = VIPS_DRAWINK(object); + + #ifdef DEBUG +- printf( "vips_drawink_build: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_drawink_build: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- if( VIPS_OBJECT_CLASS( vips_drawink_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_drawink_parent_class)->build(object)) ++ return (-1); + +- if( drawink->ink && +- !(drawink->pixel_ink = vips__vector_to_ink( class->nickname, +- draw->image, +- VIPS_ARRAY_ADDR( drawink->ink, 0 ), NULL, +- VIPS_AREA( drawink->ink )->n )) ) +- return( -1 ); ++ if (drawink->ink && ++ !(drawink->pixel_ink = vips__vector_to_ink(class->nickname, ++ draw->image, ++ VIPS_ARRAY_ADDR(drawink->ink, 0), NULL, ++ VIPS_AREA(drawink->ink)->n))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_drawink_class_init( VipsDrawinkClass *class ) ++vips_drawink_class_init(VipsDrawinkClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "drawink"; +- vobject_class->description = _( "draw with ink operations" ); ++ vobject_class->description = _("draw with ink operations"); + vobject_class->build = vips_drawink_build; + +- VIPS_ARG_BOXED( class, "ink", 2, +- _( "Ink" ), +- _( "Color for pixels" ), ++ VIPS_ARG_BOXED(class, "ink", 2, ++ _("Ink"), ++ _("Color for pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsDrawink, ink ), +- VIPS_TYPE_ARRAY_DOUBLE ); +- ++ G_STRUCT_OFFSET(VipsDrawink, ink), ++ VIPS_TYPE_ARRAY_DOUBLE); + } + + static void +-vips_drawink_init( VipsDrawink *drawink ) ++vips_drawink_init(VipsDrawink *drawink) + { +- drawink->ink = vips_array_double_newv( 1, 0.0 ); ++ drawink->ink = vips_array_double_newv(1, 0.0); + } + + /* Fill a scanline between points x1 and x2 inclusive. x1 < x2. + */ + int +-vips__drawink_scanline( VipsDrawink *drawink, int y, int x1, int x2 ) ++vips__drawink_scanline(VipsDrawink *drawink, int y, int x1, int x2) + { + VipsDraw *draw = (VipsDraw *) drawink; + +@@ -112,29 +111,27 @@ vips__drawink_scanline( VipsDrawink *drawink, int y, int x1, int x2 ) + int i; + int len; + +- g_assert( x1 <= x2 ); +- +- if( y < 0 || +- y >= draw->image->Ysize ) +- return( 0 ); +- if( x1 < 0 && +- x2 < 0 ) +- return( 0 ); +- if( x1 >= draw->image->Xsize && +- x2 >= draw->image->Xsize ) +- return( 0 ); +- x1 = VIPS_CLIP( 0, x1, draw->image->Xsize - 1 ); +- x2 = VIPS_CLIP( 0, x2, draw->image->Xsize - 1 ); +- +- mp = VIPS_IMAGE_ADDR( draw->image, x1, y ); ++ g_assert(x1 <= x2); ++ ++ if (y < 0 || ++ y >= draw->image->Ysize) ++ return (0); ++ if (x1 < 0 && ++ x2 < 0) ++ return (0); ++ if (x1 >= draw->image->Xsize && ++ x2 >= draw->image->Xsize) ++ return (0); ++ x1 = VIPS_CLIP(0, x1, draw->image->Xsize - 1); ++ x2 = VIPS_CLIP(0, x2, draw->image->Xsize - 1); ++ ++ mp = VIPS_IMAGE_ADDR(draw->image, x1, y); + len = x2 - x1 + 1; + +- for( i = 0; i < len; i++ ) { +- vips__drawink_pel( drawink, mp ); ++ for (i = 0; i < len; i++) { ++ vips__drawink_pel(drawink, mp); + mp += draw->psize; + } + +- return( 0 ); ++ return (0); + } +- +- +diff --git a/libvips/draw/drawink.h b/libvips/draw/drawink.h +index 9f1dfcfa01..42ef643c41 100644 +--- a/libvips/draw/drawink.h ++++ b/libvips/draw/drawink.h +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -38,19 +38,19 @@ extern "C" { + #include "pdraw.h" + + #define VIPS_TYPE_DRAWINK (vips_drawink_get_type()) +-#define VIPS_DRAWINK( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_DRAWINK, VipsDrawink )) +-#define VIPS_DRAWINK_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_DRAWINK(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_DRAWINK, VipsDrawink)) ++#define VIPS_DRAWINK_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_DRAWINK, VipsDrawinkClass)) ++#define VIPS_IS_DRAWINK(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_DRAWINK)) ++#define VIPS_IS_DRAWINK_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_DRAWINK)) ++#define VIPS_DRAWINK_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_DRAWINK, VipsDrawinkClass)) +-#define VIPS_IS_DRAWINK( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_DRAWINK )) +-#define VIPS_IS_DRAWINK_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_DRAWINK )) +-#define VIPS_DRAWINK_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_DRAWINK, VipsDrawinkClass )) + + typedef struct _VipsDrawink { + VipsDraw parent_instance; +@@ -67,59 +67,59 @@ typedef struct _VipsDrawinkClass { + + } VipsDrawinkClass; + +-GType vips_drawink_get_type( void ); ++GType vips_drawink_get_type(void); + + static inline int +-vips__drawink_pel( VipsDrawink *drawink, VipsPel *q ) ++vips__drawink_pel(VipsDrawink *drawink, VipsPel *q) + { + VipsDraw *draw = (VipsDraw *) drawink; + +- int j; ++ int j; + + /* Faster than memcopy() for n < about 20. + */ +- for( j = 0; j < draw->psize; j++ ) ++ for (j = 0; j < draw->psize; j++) + q[j] = drawink->pixel_ink[j]; + +- return( 0 ); ++ return (0); + } + + /* Paint, with clip. + */ +-static inline int +-vips__drawink_pel_clip( VipsDrawink *drawink, int x, int y ) ++static inline int ++vips__drawink_pel_clip(VipsDrawink *drawink, int x, int y) + { + VipsDraw *draw = (VipsDraw *) drawink; + +- if( x < 0 || +- x >= draw->image->Xsize ) +- return( 0 ); +- if( y < 0 || +- y >= draw->image->Ysize ) +- return( 0 ); ++ if (x < 0 || ++ x >= draw->image->Xsize) ++ return (0); ++ if (y < 0 || ++ y >= draw->image->Ysize) ++ return (0); + +- vips__drawink_pel( drawink, VIPS_IMAGE_ADDR( draw->image, x, y ) ); ++ vips__drawink_pel(drawink, VIPS_IMAGE_ADDR(draw->image, x, y)); + +- return( 0 ); ++ return (0); + } + + /* Is p painted? + */ + static inline gboolean +-vips__drawink_painted( VipsDrawink *drawink, VipsPel *p ) ++vips__drawink_painted(VipsDrawink *drawink, VipsPel *p) + { + VipsDraw *draw = (VipsDraw *) drawink; + +- int j; ++ int j; + +- for( j = 0; j < draw->psize; j++ ) +- if( p[j] != drawink->pixel_ink[j] ) ++ for (j = 0; j < draw->psize; j++) ++ if (p[j] != drawink->pixel_ink[j]) + break; + +- return( j == draw->psize ); ++ return (j == draw->psize); + } + +-int vips__drawink_scanline( VipsDrawink *drawink, int y, int x1, int x2 ); ++int vips__drawink_scanline(VipsDrawink *drawink, int y, int x1, int x2); + + #ifdef __cplusplus + } +diff --git a/libvips/draw/pdraw.h b/libvips/draw/pdraw.h +index 21a51ccf1d..84347c16e9 100644 +--- a/libvips/draw/pdraw.h ++++ b/libvips/draw/pdraw.h +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -36,33 +36,33 @@ extern "C" { + #endif /*__cplusplus*/ + + #define VIPS_TYPE_DRAW (vips_draw_get_type()) +-#define VIPS_DRAW( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_DRAW, VipsDraw )) +-#define VIPS_DRAW_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_DRAW(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_DRAW, VipsDraw)) ++#define VIPS_DRAW_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_DRAW, VipsDrawClass)) ++#define VIPS_IS_DRAW(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_DRAW)) ++#define VIPS_IS_DRAW_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_DRAW)) ++#define VIPS_DRAW_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_DRAW, VipsDrawClass)) +-#define VIPS_IS_DRAW( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_DRAW )) +-#define VIPS_IS_DRAW_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_DRAW )) +-#define VIPS_DRAW_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_DRAW, VipsDrawClass )) + + typedef struct _VipsDraw { + VipsOperation parent_instance; + + /* Parameters. + */ +- VipsImage *image; /* Draw here */ ++ VipsImage *image; /* Draw here */ + + /* Derived stuff. + */ + size_t lsize; + size_t psize; + +- /* If the object to draw is entirely within the image, we have a ++ /* If the object to draw is entirely within the image, we have a + * faster noclip path. + */ + gboolean noclip; +@@ -73,7 +73,7 @@ typedef struct _VipsDrawClass { + + } VipsDrawClass; + +-GType vips_draw_get_type( void ); ++GType vips_draw_get_type(void); + + #ifdef __cplusplus + } +diff --git a/libvips/foreign/analyze2vips.c b/libvips/foreign/analyze2vips.c +index 45da49720a..c3950ad5f9 100644 +--- a/libvips/foreign/analyze2vips.c ++++ b/libvips/foreign/analyze2vips.c +@@ -1,5 +1,5 @@ + /* Read a Analyze file. Old-style header (so called 7.5 format). +- * ++ * + * 3/8/05 + * - dbh.h header from Ralph Myers + * 22/8/05 +@@ -16,28 +16,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -71,163 +71,163 @@ typedef enum { + BYTE, + SHORT, + INT, +- FLOAT, ++ FLOAT, + STRING + } Type; + + /* A field in the dsr header. + */ + typedef struct { +- const char *name; /* Eg. "header_key.sizeof_hdr" */ ++ const char *name; /* Eg. "header_key.sizeof_hdr" */ + Type type; +- glong offset; /* Offset in struct */ +- int len; /* Sizeof ... useful for string types */ ++ glong offset; /* Offset in struct */ ++ int len; /* Sizeof ... useful for string types */ + } Field; + + static Field dsr_header[] = { +- { "dsr-header_key.sizeof_hdr", INT, +- G_STRUCT_OFFSET( struct dsr, hk.sizeof_hdr ), 4 }, +- { "dsr-header_key.data_type", STRING, +- G_STRUCT_OFFSET( struct dsr, hk.data_type ), 10 }, +- { "dsr-header_key.db_name", STRING, +- G_STRUCT_OFFSET( struct dsr, hk.db_name ), 18 }, +- { "dsr-header_key.extents", INT, +- G_STRUCT_OFFSET( struct dsr, hk.extents ), 4 }, +- { "dsr-header_key.session_error", SHORT, +- G_STRUCT_OFFSET( struct dsr, hk.session_error ), 2 }, +- { "dsr-header_key.regular", BYTE, +- G_STRUCT_OFFSET( struct dsr, hk.regular ), 1 }, +- { "dsr-header_key.hkey_un0", BYTE, +- G_STRUCT_OFFSET( struct dsr, hk.hkey_un0 ), 1 }, +- +- { "dsr-image_dimension.dim[0]", SHORT, +- G_STRUCT_OFFSET( struct dsr, dime.dim[0] ), 2 }, +- { "dsr-image_dimension.dim[1]", SHORT, +- G_STRUCT_OFFSET( struct dsr, dime.dim[1] ), 2 }, +- { "dsr-image_dimension.dim[2]", SHORT, +- G_STRUCT_OFFSET( struct dsr, dime.dim[2] ), 2 }, +- { "dsr-image_dimension.dim[3]", SHORT, +- G_STRUCT_OFFSET( struct dsr, dime.dim[3] ), 2 }, +- { "dsr-image_dimension.dim[4]", SHORT, +- G_STRUCT_OFFSET( struct dsr, dime.dim[4] ), 2 }, +- { "dsr-image_dimension.dim[5]", SHORT, +- G_STRUCT_OFFSET( struct dsr, dime.dim[5] ), 2 }, +- { "dsr-image_dimension.dim[6]", SHORT, +- G_STRUCT_OFFSET( struct dsr, dime.dim[6] ), 2 }, +- { "dsr-image_dimension.dim[7]", SHORT, +- G_STRUCT_OFFSET( struct dsr, dime.dim[7] ), 2 }, +- { "dsr-image_dimension.vox_units[0]", BYTE, +- G_STRUCT_OFFSET( struct dsr, dime.vox_units[0] ), 1 }, +- { "dsr-image_dimension.vox_units[1]", BYTE, +- G_STRUCT_OFFSET( struct dsr, dime.vox_units[1] ), 1 }, +- { "dsr-image_dimension.vox_units[2]", BYTE, +- G_STRUCT_OFFSET( struct dsr, dime.vox_units[2] ), 1 }, +- { "dsr-image_dimension.vox_units[3]", BYTE, +- G_STRUCT_OFFSET( struct dsr, dime.vox_units[3] ), 1 }, +- { "dsr-image_dimension.cal_units[0]", BYTE, +- G_STRUCT_OFFSET( struct dsr, dime.cal_units[0] ), 1 }, +- { "dsr-image_dimension.cal_units[1]", BYTE, +- G_STRUCT_OFFSET( struct dsr, dime.cal_units[1] ), 1 }, +- { "dsr-image_dimension.cal_units[2]", BYTE, +- G_STRUCT_OFFSET( struct dsr, dime.cal_units[2] ), 1 }, +- { "dsr-image_dimension.cal_units[3]", BYTE, +- G_STRUCT_OFFSET( struct dsr, dime.cal_units[3] ), 1 }, +- { "dsr-image_dimension.cal_units[4]", BYTE, +- G_STRUCT_OFFSET( struct dsr, dime.cal_units[4] ), 1 }, +- { "dsr-image_dimension.cal_units[5]", BYTE, +- G_STRUCT_OFFSET( struct dsr, dime.cal_units[5] ), 1 }, +- { "dsr-image_dimension.cal_units[6]", BYTE, +- G_STRUCT_OFFSET( struct dsr, dime.cal_units[6] ), 1 }, +- { "dsr-image_dimension.cal_units[7]", BYTE, +- G_STRUCT_OFFSET( struct dsr, dime.cal_units[7] ), 1 }, +- { "dsr-image_dimension.data_type", SHORT, +- G_STRUCT_OFFSET( struct dsr, dime.datatype ), 2 }, +- { "dsr-image_dimension.bitpix", SHORT, +- G_STRUCT_OFFSET( struct dsr, dime.bitpix ), 2 }, +- { "dsr-image_dimension.dim_un0", SHORT, +- G_STRUCT_OFFSET( struct dsr, dime.dim_un0 ), 2 }, +- { "dsr-image_dimension.pixdim[0]", FLOAT, +- G_STRUCT_OFFSET( struct dsr, dime.pixdim[0] ), 4 }, +- { "dsr-image_dimension.pixdim[1]", FLOAT, +- G_STRUCT_OFFSET( struct dsr, dime.pixdim[1] ), 4 }, +- { "dsr-image_dimension.pixdim[2]", FLOAT, +- G_STRUCT_OFFSET( struct dsr, dime.pixdim[2] ), 4 }, +- { "dsr-image_dimension.pixdim[3]", FLOAT, +- G_STRUCT_OFFSET( struct dsr, dime.pixdim[3] ), 4 }, +- { "dsr-image_dimension.pixdim[4]", FLOAT, +- G_STRUCT_OFFSET( struct dsr, dime.pixdim[4] ), 4 }, +- { "dsr-image_dimension.pixdim[5]", FLOAT, +- G_STRUCT_OFFSET( struct dsr, dime.pixdim[5] ), 4 }, +- { "dsr-image_dimension.pixdim[6]", FLOAT, +- G_STRUCT_OFFSET( struct dsr, dime.pixdim[6] ), 4 }, +- { "dsr-image_dimension.pixdim[7]", FLOAT, +- G_STRUCT_OFFSET( struct dsr, dime.pixdim[7] ), 4 }, +- { "dsr-image_dimension.vox_offset", FLOAT, +- G_STRUCT_OFFSET( struct dsr, dime.vox_offset ), 4 }, +- { "dsr-image_dimension.cal_max", FLOAT, +- G_STRUCT_OFFSET( struct dsr, dime.cal_max ), 4 }, +- { "dsr-image_dimension.cal_min", FLOAT, +- G_STRUCT_OFFSET( struct dsr, dime.cal_min ), 4 }, +- { "dsr-image_dimension.compressed", INT, +- G_STRUCT_OFFSET( struct dsr, dime.compressed ), 4 }, +- { "dsr-image_dimension.verified", INT, +- G_STRUCT_OFFSET( struct dsr, dime.verified ), 4 }, +- { "dsr-image_dimension.glmax", INT, +- G_STRUCT_OFFSET( struct dsr, dime.glmax ), 4 }, +- { "dsr-image_dimension.glmin", INT, +- G_STRUCT_OFFSET( struct dsr, dime.glmin ), 4 }, +- +- { "dsr-data_history.descrip", STRING, +- G_STRUCT_OFFSET( struct dsr, hist.descrip ), 80 }, +- { "dsr-data_history.aux_file", STRING, +- G_STRUCT_OFFSET( struct dsr, hist.aux_file ), 24 }, +- { "dsr-data_history.orient", BYTE, +- G_STRUCT_OFFSET( struct dsr, hist.orient ), 1 }, +- { "dsr-data_history.originator", STRING, +- G_STRUCT_OFFSET( struct dsr, hist.originator ), 10 }, +- { "dsr-data_history.generated", STRING, +- G_STRUCT_OFFSET( struct dsr, hist.generated ), 10 }, +- { "dsr-data_history.scannum", STRING, +- G_STRUCT_OFFSET( struct dsr, hist.scannum ), 10 }, +- { "dsr-data_history.patient_id", STRING, +- G_STRUCT_OFFSET( struct dsr, hist.patient_id ), 10 }, +- { "dsr-data_history.exp_date", STRING, +- G_STRUCT_OFFSET( struct dsr, hist.exp_date ), 10 }, +- { "dsr-data_history.exp_time", STRING, +- G_STRUCT_OFFSET( struct dsr, hist.exp_time ), 10 }, +- { "dsr-data_history.hist_un0", STRING, +- G_STRUCT_OFFSET( struct dsr, hist.hist_un0 ), 3 }, +- { "dsr-data_history.views", INT, +- G_STRUCT_OFFSET( struct dsr, hist.views ), 4 }, +- { "dsr-data_history.vols_added", INT, +- G_STRUCT_OFFSET( struct dsr, hist.vols_added ), 4 }, +- { "dsr-data_history.start_field", INT, +- G_STRUCT_OFFSET( struct dsr, hist.start_field ), 4 }, +- { "dsr-data_history.field_skip", INT, +- G_STRUCT_OFFSET( struct dsr, hist.field_skip ), 4 }, +- { "dsr-data_history.omax", INT, +- G_STRUCT_OFFSET( struct dsr, hist.omax ), 4 }, +- { "dsr-data_history.omin", INT, +- G_STRUCT_OFFSET( struct dsr, hist.omin ), 4 }, +- { "dsr-data_history.smax", INT, +- G_STRUCT_OFFSET( struct dsr, hist.smax ), 4 }, +- { "dsr-data_history.smin", INT, +- G_STRUCT_OFFSET( struct dsr, hist.smin ), 4 } ++ { "dsr-header_key.sizeof_hdr", INT, ++ G_STRUCT_OFFSET(struct dsr, hk.sizeof_hdr), 4 }, ++ { "dsr-header_key.data_type", STRING, ++ G_STRUCT_OFFSET(struct dsr, hk.data_type), 10 }, ++ { "dsr-header_key.db_name", STRING, ++ G_STRUCT_OFFSET(struct dsr, hk.db_name), 18 }, ++ { "dsr-header_key.extents", INT, ++ G_STRUCT_OFFSET(struct dsr, hk.extents), 4 }, ++ { "dsr-header_key.session_error", SHORT, ++ G_STRUCT_OFFSET(struct dsr, hk.session_error), 2 }, ++ { "dsr-header_key.regular", BYTE, ++ G_STRUCT_OFFSET(struct dsr, hk.regular), 1 }, ++ { "dsr-header_key.hkey_un0", BYTE, ++ G_STRUCT_OFFSET(struct dsr, hk.hkey_un0), 1 }, ++ ++ { "dsr-image_dimension.dim[0]", SHORT, ++ G_STRUCT_OFFSET(struct dsr, dime.dim[0]), 2 }, ++ { "dsr-image_dimension.dim[1]", SHORT, ++ G_STRUCT_OFFSET(struct dsr, dime.dim[1]), 2 }, ++ { "dsr-image_dimension.dim[2]", SHORT, ++ G_STRUCT_OFFSET(struct dsr, dime.dim[2]), 2 }, ++ { "dsr-image_dimension.dim[3]", SHORT, ++ G_STRUCT_OFFSET(struct dsr, dime.dim[3]), 2 }, ++ { "dsr-image_dimension.dim[4]", SHORT, ++ G_STRUCT_OFFSET(struct dsr, dime.dim[4]), 2 }, ++ { "dsr-image_dimension.dim[5]", SHORT, ++ G_STRUCT_OFFSET(struct dsr, dime.dim[5]), 2 }, ++ { "dsr-image_dimension.dim[6]", SHORT, ++ G_STRUCT_OFFSET(struct dsr, dime.dim[6]), 2 }, ++ { "dsr-image_dimension.dim[7]", SHORT, ++ G_STRUCT_OFFSET(struct dsr, dime.dim[7]), 2 }, ++ { "dsr-image_dimension.vox_units[0]", BYTE, ++ G_STRUCT_OFFSET(struct dsr, dime.vox_units[0]), 1 }, ++ { "dsr-image_dimension.vox_units[1]", BYTE, ++ G_STRUCT_OFFSET(struct dsr, dime.vox_units[1]), 1 }, ++ { "dsr-image_dimension.vox_units[2]", BYTE, ++ G_STRUCT_OFFSET(struct dsr, dime.vox_units[2]), 1 }, ++ { "dsr-image_dimension.vox_units[3]", BYTE, ++ G_STRUCT_OFFSET(struct dsr, dime.vox_units[3]), 1 }, ++ { "dsr-image_dimension.cal_units[0]", BYTE, ++ G_STRUCT_OFFSET(struct dsr, dime.cal_units[0]), 1 }, ++ { "dsr-image_dimension.cal_units[1]", BYTE, ++ G_STRUCT_OFFSET(struct dsr, dime.cal_units[1]), 1 }, ++ { "dsr-image_dimension.cal_units[2]", BYTE, ++ G_STRUCT_OFFSET(struct dsr, dime.cal_units[2]), 1 }, ++ { "dsr-image_dimension.cal_units[3]", BYTE, ++ G_STRUCT_OFFSET(struct dsr, dime.cal_units[3]), 1 }, ++ { "dsr-image_dimension.cal_units[4]", BYTE, ++ G_STRUCT_OFFSET(struct dsr, dime.cal_units[4]), 1 }, ++ { "dsr-image_dimension.cal_units[5]", BYTE, ++ G_STRUCT_OFFSET(struct dsr, dime.cal_units[5]), 1 }, ++ { "dsr-image_dimension.cal_units[6]", BYTE, ++ G_STRUCT_OFFSET(struct dsr, dime.cal_units[6]), 1 }, ++ { "dsr-image_dimension.cal_units[7]", BYTE, ++ G_STRUCT_OFFSET(struct dsr, dime.cal_units[7]), 1 }, ++ { "dsr-image_dimension.data_type", SHORT, ++ G_STRUCT_OFFSET(struct dsr, dime.datatype), 2 }, ++ { "dsr-image_dimension.bitpix", SHORT, ++ G_STRUCT_OFFSET(struct dsr, dime.bitpix), 2 }, ++ { "dsr-image_dimension.dim_un0", SHORT, ++ G_STRUCT_OFFSET(struct dsr, dime.dim_un0), 2 }, ++ { "dsr-image_dimension.pixdim[0]", FLOAT, ++ G_STRUCT_OFFSET(struct dsr, dime.pixdim[0]), 4 }, ++ { "dsr-image_dimension.pixdim[1]", FLOAT, ++ G_STRUCT_OFFSET(struct dsr, dime.pixdim[1]), 4 }, ++ { "dsr-image_dimension.pixdim[2]", FLOAT, ++ G_STRUCT_OFFSET(struct dsr, dime.pixdim[2]), 4 }, ++ { "dsr-image_dimension.pixdim[3]", FLOAT, ++ G_STRUCT_OFFSET(struct dsr, dime.pixdim[3]), 4 }, ++ { "dsr-image_dimension.pixdim[4]", FLOAT, ++ G_STRUCT_OFFSET(struct dsr, dime.pixdim[4]), 4 }, ++ { "dsr-image_dimension.pixdim[5]", FLOAT, ++ G_STRUCT_OFFSET(struct dsr, dime.pixdim[5]), 4 }, ++ { "dsr-image_dimension.pixdim[6]", FLOAT, ++ G_STRUCT_OFFSET(struct dsr, dime.pixdim[6]), 4 }, ++ { "dsr-image_dimension.pixdim[7]", FLOAT, ++ G_STRUCT_OFFSET(struct dsr, dime.pixdim[7]), 4 }, ++ { "dsr-image_dimension.vox_offset", FLOAT, ++ G_STRUCT_OFFSET(struct dsr, dime.vox_offset), 4 }, ++ { "dsr-image_dimension.cal_max", FLOAT, ++ G_STRUCT_OFFSET(struct dsr, dime.cal_max), 4 }, ++ { "dsr-image_dimension.cal_min", FLOAT, ++ G_STRUCT_OFFSET(struct dsr, dime.cal_min), 4 }, ++ { "dsr-image_dimension.compressed", INT, ++ G_STRUCT_OFFSET(struct dsr, dime.compressed), 4 }, ++ { "dsr-image_dimension.verified", INT, ++ G_STRUCT_OFFSET(struct dsr, dime.verified), 4 }, ++ { "dsr-image_dimension.glmax", INT, ++ G_STRUCT_OFFSET(struct dsr, dime.glmax), 4 }, ++ { "dsr-image_dimension.glmin", INT, ++ G_STRUCT_OFFSET(struct dsr, dime.glmin), 4 }, ++ ++ { "dsr-data_history.descrip", STRING, ++ G_STRUCT_OFFSET(struct dsr, hist.descrip), 80 }, ++ { "dsr-data_history.aux_file", STRING, ++ G_STRUCT_OFFSET(struct dsr, hist.aux_file), 24 }, ++ { "dsr-data_history.orient", BYTE, ++ G_STRUCT_OFFSET(struct dsr, hist.orient), 1 }, ++ { "dsr-data_history.originator", STRING, ++ G_STRUCT_OFFSET(struct dsr, hist.originator), 10 }, ++ { "dsr-data_history.generated", STRING, ++ G_STRUCT_OFFSET(struct dsr, hist.generated), 10 }, ++ { "dsr-data_history.scannum", STRING, ++ G_STRUCT_OFFSET(struct dsr, hist.scannum), 10 }, ++ { "dsr-data_history.patient_id", STRING, ++ G_STRUCT_OFFSET(struct dsr, hist.patient_id), 10 }, ++ { "dsr-data_history.exp_date", STRING, ++ G_STRUCT_OFFSET(struct dsr, hist.exp_date), 10 }, ++ { "dsr-data_history.exp_time", STRING, ++ G_STRUCT_OFFSET(struct dsr, hist.exp_time), 10 }, ++ { "dsr-data_history.hist_un0", STRING, ++ G_STRUCT_OFFSET(struct dsr, hist.hist_un0), 3 }, ++ { "dsr-data_history.views", INT, ++ G_STRUCT_OFFSET(struct dsr, hist.views), 4 }, ++ { "dsr-data_history.vols_added", INT, ++ G_STRUCT_OFFSET(struct dsr, hist.vols_added), 4 }, ++ { "dsr-data_history.start_field", INT, ++ G_STRUCT_OFFSET(struct dsr, hist.start_field), 4 }, ++ { "dsr-data_history.field_skip", INT, ++ G_STRUCT_OFFSET(struct dsr, hist.field_skip), 4 }, ++ { "dsr-data_history.omax", INT, ++ G_STRUCT_OFFSET(struct dsr, hist.omax), 4 }, ++ { "dsr-data_history.omin", INT, ++ G_STRUCT_OFFSET(struct dsr, hist.omin), 4 }, ++ { "dsr-data_history.smax", INT, ++ G_STRUCT_OFFSET(struct dsr, hist.smax), 4 }, ++ { "dsr-data_history.smin", INT, ++ G_STRUCT_OFFSET(struct dsr, hist.smin), 4 } + }; + + /* Given a filename, generate the names for the header and the image data. + * +- * Eg. ++ * Eg. + * "fred" -> "fred.hdr", "fred.img" + * "fred.img" -> "fred.hdr", "fred.img" + */ + static void +-generate_filenames( const char *path, char *header, char *image ) ++generate_filenames(const char *path, char *header, char *image) + { + const char *olds[] = { ".img", ".hdr" }; + +- vips__change_suffix( path, header, FILENAME_MAX, ".hdr", olds, 2 ); +- vips__change_suffix( path, image, FILENAME_MAX, ".img", olds, 2 ); ++ vips__change_suffix(path, header, FILENAME_MAX, ".hdr", olds, 2); ++ vips__change_suffix(path, image, FILENAME_MAX, ".img", olds, 2); + } + + /* str is a str which may not be NULL-terminated. Return a pointer to a static +@@ -235,60 +235,54 @@ generate_filenames( const char *path, char *header, char *image ) + * Also, make sure the string is plain ascii. + */ + static char * +-getstr( int mx, const char *str ) ++getstr(int mx, const char *str) + { + static char buf[256]; + int i; + +- g_assert( mx < 256 ); ++ g_assert(mx < 256); + +- vips_strncpy( buf, str, mx ); +- buf[mx]= '\0'; ++ vips_strncpy(buf, str, mx); ++ buf[mx] = '\0'; + + /* How annoying, patient_id has some funny ctrlchars in that mess up + * xml encode later. + */ +- for( i = 0; i < mx && buf[i]; i++ ) +- if( !isascii( buf[i] ) || buf[i] < 32 ) ++ for (i = 0; i < mx && buf[i]; i++) ++ if (!isascii(buf[i]) || buf[i] < 32) + buf[i] = '@'; + +- return( buf ); ++ return (buf); + } + + #ifdef DEBUG + static void +-print_dsr( struct dsr *d ) ++print_dsr(struct dsr *d) + { + int i; + +- for( i = 0; i < VIPS_NUMBER( dsr_header ); i++ ) { +- printf( "%s = ", dsr_header[i].name ); ++ for (i = 0; i < VIPS_NUMBER(dsr_header); i++) { ++ printf("%s = ", dsr_header[i].name); + +- switch( dsr_header[i].type ) { ++ switch (dsr_header[i].type) { + case BYTE: +- printf( "%d\n", G_STRUCT_MEMBER( char, d, +- dsr_header[i].offset ) ); ++ printf("%d\n", G_STRUCT_MEMBER(char, d, dsr_header[i].offset)); + break; + + case SHORT: +- printf( "%d\n", G_STRUCT_MEMBER( short, d, +- dsr_header[i].offset ) ); ++ printf("%d\n", G_STRUCT_MEMBER(short, d, dsr_header[i].offset)); + break; + + case INT: +- printf( "%d\n", G_STRUCT_MEMBER( int, d, +- dsr_header[i].offset ) ); ++ printf("%d\n", G_STRUCT_MEMBER(int, d, dsr_header[i].offset)); + break; + +- case FLOAT: +- printf( "%g\n", G_STRUCT_MEMBER( float, d, +- dsr_header[i].offset ) ); ++ case FLOAT: ++ printf("%g\n", G_STRUCT_MEMBER(float, d, dsr_header[i].offset)); + break; + + case STRING: +- printf( "\"%s\"\n", getstr( dsr_header[i].len, +- &G_STRUCT_MEMBER( char, d, +- dsr_header[i].offset ) ) ); ++ printf("\"%s\"\n", getstr(dsr_header[i].len, &G_STRUCT_MEMBER(char, d, dsr_header[i].offset))); + break; + + default: +@@ -299,47 +293,46 @@ print_dsr( struct dsr *d ) + #endif /*DEBUG*/ + + static struct dsr * +-read_header( const char *header ) ++read_header(const char *header) + { + struct dsr *d; + size_t len; + +- if( !(d = (struct dsr *) vips__file_read_name( header, NULL, &len )) ) +- return( NULL ); ++ if (!(d = (struct dsr *) vips__file_read_name(header, NULL, &len))) ++ return (NULL); + +- if( len != sizeof( struct dsr ) ) { +- vips_error( "analyze2vips", +- "%s", _( "header file size incorrect" ) ); +- g_free( d ); +- return( NULL ); ++ if (len != sizeof(struct dsr)) { ++ vips_error("analyze2vips", ++ "%s", _("header file size incorrect")); ++ g_free(d); ++ return (NULL); + } + + /* Ouch! Should check at configure time I guess. + */ +- g_assert( sizeof( struct dsr ) == 348 ); ++ g_assert(sizeof(struct dsr) == 348); + +- /* dsr headers are always SPARC byte order (MSB first). Do we need to ++ /* dsr headers are always SPARC byte order (MSB first). Do we need to + * swap? + */ +- if( !vips_amiMSBfirst() ) { ++ if (!vips_amiMSBfirst()) { + int i; + +- for( i = 0; i < VIPS_NUMBER( dsr_header ); i++ ) { ++ for (i = 0; i < VIPS_NUMBER(dsr_header); i++) { + unsigned char *p; + +- +- switch( dsr_header[i].type ) { ++ switch (dsr_header[i].type) { + case SHORT: +- p = &G_STRUCT_MEMBER( unsigned char, d, +- dsr_header[i].offset ); +- vips__copy_2byte( TRUE, p, p ); ++ p = &G_STRUCT_MEMBER(unsigned char, d, ++ dsr_header[i].offset); ++ vips__copy_2byte(TRUE, p, p); + break; + + case INT: +- case FLOAT: +- p = &G_STRUCT_MEMBER( unsigned char, d, +- dsr_header[i].offset ); +- vips__copy_4byte( TRUE, p, p ); ++ case FLOAT: ++ p = &G_STRUCT_MEMBER(unsigned char, d, ++ dsr_header[i].offset); ++ vips__copy_4byte(TRUE, p, p); + break; + + case BYTE: +@@ -352,29 +345,29 @@ read_header( const char *header ) + } + } + +- if( (int) len != d->hk.sizeof_hdr ) { +- vips_error( "analyze2vips", +- "%s", _( "header size incorrect" ) ); +- g_free( d ); +- return( NULL ); ++ if ((int) len != d->hk.sizeof_hdr) { ++ vips_error("analyze2vips", ++ "%s", _("header size incorrect")); ++ g_free(d); ++ return (NULL); + } + +- return( d ); ++ return (d); + } + + /* Try to get VIPS header properties from a dsr. + */ + static int +-get_vips_properties( struct dsr *d, +- int *width, int *height, int *bands, VipsBandFormat *fmt ) ++get_vips_properties(struct dsr *d, ++ int *width, int *height, int *bands, VipsBandFormat *fmt) + { + int i; + +- if( d->dime.dim[0] < 2 || d->dime.dim[0] > 7 ) { +- vips_error( "analyze2vips", +- _( "%d-dimensional images not supported" ), +- d->dime.dim[0] ); +- return( -1 ); ++ if (d->dime.dim[0] < 2 || d->dime.dim[0] > 7) { ++ vips_error("analyze2vips", ++ _("%d-dimensional images not supported"), ++ d->dime.dim[0]); ++ return (-1); + } + + /* Size of base 2d images. +@@ -382,12 +375,12 @@ get_vips_properties( struct dsr *d, + *width = d->dime.dim[1]; + *height = d->dime.dim[2]; + +- for( i = 3; i <= d->dime.dim[0]; i++ ) ++ for (i = 3; i <= d->dime.dim[0]; i++) + *height *= d->dime.dim[i]; + + /* Check it's a datatype we can handle. + */ +- switch( d->dime.datatype ) { ++ switch (d->dime.datatype) { + case DT_UNSIGNED_CHAR: + *bands = 1; + *fmt = VIPS_FORMAT_UCHAR; +@@ -424,60 +417,60 @@ get_vips_properties( struct dsr *d, + break; + + default: +- vips_error( "analyze2vips", +- _( "datatype %d not supported" ), d->dime.datatype ); +- return( -1 ); ++ vips_error("analyze2vips", ++ _("datatype %d not supported"), d->dime.datatype); ++ return (-1); + } + + #ifdef DEBUG +- printf( "get_vips_properties: width = %d\n", *width ); +- printf( "get_vips_properties: height = %d\n", *height ); +- printf( "get_vips_properties: bands = %d\n", *bands ); +- printf( "get_vips_properties: fmt = %d\n", *fmt ); ++ printf("get_vips_properties: width = %d\n", *width); ++ printf("get_vips_properties: height = %d\n", *height); ++ printf("get_vips_properties: bands = %d\n", *bands); ++ printf("get_vips_properties: fmt = %d\n", *fmt); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + static void +-attach_meta( VipsImage *out, struct dsr *d ) ++attach_meta(VipsImage *out, struct dsr *d) + { + int i; + +- vips_image_set_blob( out, "dsr", +- (VipsCallbackFn) vips_area_free_cb, d, d->hk.sizeof_hdr ); ++ vips_image_set_blob(out, "dsr", ++ (VipsCallbackFn) vips_area_free_cb, d, d->hk.sizeof_hdr); + +- for( i = 0; i < VIPS_NUMBER( dsr_header ); i++ ) { +- switch( dsr_header[i].type ) { ++ for (i = 0; i < VIPS_NUMBER(dsr_header); i++) { ++ switch (dsr_header[i].type) { + case BYTE: +- vips_image_set_int( out, dsr_header[i].name, +- G_STRUCT_MEMBER( char, d, +- dsr_header[i].offset ) ); ++ vips_image_set_int(out, dsr_header[i].name, ++ G_STRUCT_MEMBER(char, d, ++ dsr_header[i].offset)); + break; + + case SHORT: +- vips_image_set_int( out, dsr_header[i].name, +- G_STRUCT_MEMBER( short, d, +- dsr_header[i].offset ) ); ++ vips_image_set_int(out, dsr_header[i].name, ++ G_STRUCT_MEMBER(short, d, ++ dsr_header[i].offset)); + break; + + case INT: +- vips_image_set_int( out, dsr_header[i].name, +- G_STRUCT_MEMBER( int, d, +- dsr_header[i].offset ) ); ++ vips_image_set_int(out, dsr_header[i].name, ++ G_STRUCT_MEMBER(int, d, ++ dsr_header[i].offset)); + break; + +- case FLOAT: +- vips_image_set_double( out, dsr_header[i].name, +- G_STRUCT_MEMBER( float, d, +- dsr_header[i].offset ) ); ++ case FLOAT: ++ vips_image_set_double(out, dsr_header[i].name, ++ G_STRUCT_MEMBER(float, d, ++ dsr_header[i].offset)); + break; + + case STRING: +- vips_image_set_string( out, dsr_header[i].name, +- getstr( dsr_header[i].len, +- &G_STRUCT_MEMBER( char, d, +- dsr_header[i].offset ) ) ); ++ vips_image_set_string(out, dsr_header[i].name, ++ getstr(dsr_header[i].len, ++ &G_STRUCT_MEMBER(char, d, ++ dsr_header[i].offset))); + break; + + default: +@@ -487,7 +480,7 @@ attach_meta( VipsImage *out, struct dsr *d ) + } + + int +-vips__isanalyze( const char *filename ) ++vips__isanalyze(const char *filename) + { + char header[FILENAME_MAX]; + char image[FILENAME_MAX]; +@@ -497,31 +490,31 @@ vips__isanalyze( const char *filename ) + VipsBandFormat fmt; + int result; + +- generate_filenames( filename, header, image ); +- if( !vips_existsf( "%s", header ) ) +- return( 0 ); ++ generate_filenames(filename, header, image); ++ if (!vips_existsf("%s", header)) ++ return (0); + + vips_error_freeze(); +- d = read_header( header ); ++ d = read_header(header); + vips_error_thaw(); +- if( !d ) +- return( 0 ); ++ if (!d) ++ return (0); + + #ifdef DEBUG +- print_dsr( d ); ++ print_dsr(d); + #endif /*DEBUG*/ + + vips_error_freeze(); +- result = get_vips_properties( d, &width, &height, &bands, &fmt ); ++ result = get_vips_properties(d, &width, &height, &bands, &fmt); + vips_error_thaw(); + +- g_free( d ); ++ g_free(d); + +- return( result == 0 ); ++ return (result == 0); + } + + int +-vips__analyze_read_header( const char *filename, VipsImage *out ) ++vips__analyze_read_header(const char *filename, VipsImage *out) + { + char header[FILENAME_MAX]; + char image[FILENAME_MAX]; +@@ -530,74 +523,73 @@ vips__analyze_read_header( const char *filename, VipsImage *out ) + int bands; + VipsBandFormat fmt; + +- generate_filenames( filename, header, image ); +- if( !(d = read_header( header )) ) +- return( -1 ); ++ generate_filenames(filename, header, image); ++ if (!(d = read_header(header))) ++ return (-1); + + #ifdef DEBUG +- print_dsr( d ); ++ print_dsr(d); + #endif /*DEBUG*/ + +- if( get_vips_properties( d, &width, &height, &bands, &fmt ) ) { +- g_free( d ); +- return( -1 ); ++ if (get_vips_properties(d, &width, &height, &bands, &fmt)) { ++ g_free(d); ++ return (-1); + } + +- vips_image_init_fields( out, +- width, height, bands, fmt, +- VIPS_CODING_NONE, +- bands == 1 ? +- VIPS_INTERPRETATION_B_W : VIPS_INTERPRETATION_sRGB, +- 1.0, 1.0 ); ++ vips_image_init_fields(out, ++ width, height, bands, fmt, ++ VIPS_CODING_NONE, ++ bands == 1 ? VIPS_INTERPRETATION_B_W : VIPS_INTERPRETATION_sRGB, ++ 1.0, 1.0); + +- attach_meta( out, d ); ++ attach_meta(out, d); + +- if( vips_image_pipelinev( out, VIPS_DEMAND_STYLE_THINSTRIP, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(out, VIPS_DEMAND_STYLE_THINSTRIP, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-vips__analyze_read( const char *filename, VipsImage *out ) ++vips__analyze_read(const char *filename, VipsImage *out) + { + char header[FILENAME_MAX]; + char image[FILENAME_MAX]; + struct dsr *d; + VipsImage *x = vips_image_new(); +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( x ), 3 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(x), 3); + int width, height; + int bands; + VipsBandFormat fmt; + +- generate_filenames( filename, header, image ); +- if( !(d = read_header( header )) ) { +- g_object_unref( x ); +- return( -1 ); ++ generate_filenames(filename, header, image); ++ if (!(d = read_header(header))) { ++ g_object_unref(x); ++ return (-1); + } +- attach_meta( out, d ); ++ attach_meta(out, d); + + #ifdef DEBUG +- print_dsr( d ); ++ print_dsr(d); + #endif /*DEBUG*/ + +- if( get_vips_properties( d, &width, &height, &bands, &fmt ) || +- !(t[0] = vips_image_new_from_file_raw( image, width, height, +- bands * vips_format_sizeof( fmt ), 0 )) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (get_vips_properties(d, &width, &height, &bands, &fmt) || ++ !(t[0] = vips_image_new_from_file_raw(image, width, height, ++ bands * vips_format_sizeof(fmt), 0))) { ++ g_object_unref(x); ++ return (-1); + } + +- if( vips_copy( t[0], &t[1], "bands", bands, "format", fmt, NULL ) || +- vips__byteswap_bool( t[1], &t[2], !vips_amiMSBfirst() ) || +- vips_image_write( t[2], out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_copy(t[0], &t[1], "bands", bands, "format", fmt, NULL) || ++ vips__byteswap_bool(t[1], &t[2], !vips_amiMSBfirst()) || ++ vips_image_write(t[2], out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + #endif /*HAVE_ANALYZE*/ +diff --git a/libvips/foreign/analyzeload.c b/libvips/foreign/analyzeload.c +index e2fc47cde3..06f79979e0 100644 +--- a/libvips/foreign/analyzeload.c ++++ b/libvips/foreign/analyzeload.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -57,59 +57,59 @@ typedef struct _VipsForeignLoadAnalyze { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadAnalyze; + + typedef VipsForeignLoadClass VipsForeignLoadAnalyzeClass; + +-G_DEFINE_TYPE( VipsForeignLoadAnalyze, vips_foreign_load_analyze, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_TYPE(VipsForeignLoadAnalyze, vips_foreign_load_analyze, ++ VIPS_TYPE_FOREIGN_LOAD); + + static VipsForeignFlags +-vips_foreign_load_analyze_get_flags_filename( const char *filename ) ++vips_foreign_load_analyze_get_flags_filename(const char *filename) + { +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static VipsForeignFlags +-vips_foreign_load_analyze_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_analyze_get_flags(VipsForeignLoad *load) + { +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static int +-vips_foreign_load_analyze_header( VipsForeignLoad *load ) ++vips_foreign_load_analyze_header(VipsForeignLoad *load) + { + VipsForeignLoadAnalyze *analyze = (VipsForeignLoadAnalyze *) load; + +- if( vips__analyze_read_header( analyze->filename, load->out ) ) +- return( -1 ); ++ if (vips__analyze_read_header(analyze->filename, load->out)) ++ return (-1); + +- VIPS_SETSTR( load->out->filename, analyze->filename ); ++ VIPS_SETSTR(load->out->filename, analyze->filename); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_analyze_load( VipsForeignLoad *load ) ++vips_foreign_load_analyze_load(VipsForeignLoad *load) + { + VipsForeignLoadAnalyze *analyze = (VipsForeignLoadAnalyze *) load; + +- if( vips__analyze_read( analyze->filename, load->real ) ) +- return( -1 ); ++ if (vips__analyze_read(analyze->filename, load->real)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static const char *vips_foreign_analyze_suffs[] = { ".img", ".hdr", NULL }; + + static void +-vips_foreign_load_analyze_class_init( VipsForeignLoadAnalyzeClass *class ) ++vips_foreign_load_analyze_class_init(VipsForeignLoadAnalyzeClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -117,9 +117,9 @@ vips_foreign_load_analyze_class_init( VipsForeignLoadAnalyzeClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "analyzeload"; +- object_class->description = _( "load an Analyze6 image" ); ++ object_class->description = _("load an Analyze6 image"); + +- /* This is fuzzed, but you're unlikely to want to use it on ++ /* This is fuzzed, but you're unlikely to want to use it on + * untrusted files. + */ + operation_class->flags |= VIPS_OPERATION_UNTRUSTED; +@@ -131,22 +131,22 @@ vips_foreign_load_analyze_class_init( VipsForeignLoadAnalyzeClass *class ) + foreign_class->priority = -50; + + load_class->is_a = vips__isanalyze; +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_analyze_get_flags_filename; + load_class->get_flags = vips_foreign_load_analyze_get_flags; + load_class->header = vips_foreign_load_analyze_header; + load_class->load = vips_foreign_load_analyze_load; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadAnalyze, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadAnalyze, filename), ++ NULL); + } + + static void +-vips_foreign_load_analyze_init( VipsForeignLoadAnalyze *analyze ) ++vips_foreign_load_analyze_init(VipsForeignLoadAnalyze *analyze) + { + } + +@@ -171,14 +171,14 @@ vips_foreign_load_analyze_init( VipsForeignLoadAnalyze *analyze ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_analyzeload( const char *filename, VipsImage **out, ... ) ++vips_analyzeload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "analyzeload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("analyzeload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/cairo.c b/libvips/foreign/cairo.c +index 689fdc54b5..4df4a509f1 100644 +--- a/libvips/foreign/cairo.c ++++ b/libvips/foreign/cairo.c +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -40,55 +40,55 @@ + * See also openslide's argb2rgba(). + */ + void +-vips__premultiplied_bgra2rgba( guint32 * restrict p, int n ) ++vips__premultiplied_bgra2rgba(guint32 *restrict p, int n) + { + int x; + +- for( x = 0; x < n; x++ ) { +- guint32 bgra = GUINT32_FROM_BE( p[x] ); ++ for (x = 0; x < n; x++) { ++ guint32 bgra = GUINT32_FROM_BE(p[x]); + guint8 a = bgra & 0xff; + +- guint32 rgba; ++ guint32 rgba; + +- if( a == 0 || +- a == 255 ) +- rgba = ++ if (a == 0 || ++ a == 255) ++ rgba = + (bgra & 0x00ff00ff) | +- (bgra & 0x0000ff00) << 16 | +- (bgra & 0xff000000) >> 16; +- else +- /* Undo premultiplication. +- */ +- rgba = +- ((255 * ((bgra >> 8) & 0xff) / a) << 24) | +- ((255 * ((bgra >> 16) & 0xff) / a) << 16) | +- ((255 * ((bgra >> 24) & 0xff) / a) << 8) | +- a; +- +- p[x] = GUINT32_TO_BE( rgba ); ++ (bgra & 0x0000ff00) << 16 | ++ (bgra & 0xff000000) >> 16; ++ else ++ /* Undo premultiplication. ++ */ ++ rgba = ++ ((255 * ((bgra >> 8) & 0xff) / a) << 24) | ++ ((255 * ((bgra >> 16) & 0xff) / a) << 16) | ++ ((255 * ((bgra >> 24) & 0xff) / a) << 8) | ++ a; ++ ++ p[x] = GUINT32_TO_BE(rgba); + } + } + + /* Unpremultiplied RGBA (vips convention) to cairo-style premul BGRA. + */ + void +-vips__rgba2bgra_premultiplied( guint32 * restrict p, int n ) ++vips__rgba2bgra_premultiplied(guint32 *restrict p, int n) + { + int x; + +- for( x = 0; x < n; x++ ) { +- guint32 rgba = GUINT32_FROM_BE( p[x] ); ++ for (x = 0; x < n; x++) { ++ guint32 rgba = GUINT32_FROM_BE(p[x]); + guint8 a = rgba & 0xff; + +- guint32 bgra; ++ guint32 bgra; + +- if( a == 0 ) ++ if (a == 0) + bgra = 0; +- else if( a == 255 ) ++ else if (a == 255) + bgra = (rgba & 0x00ff00ff) | + (rgba & 0x0000ff00) << 16 | + (rgba & 0xff000000) >> 16; +- else { ++ else { + int r = (rgba >> 24) & 0xff; + int g = (rgba >> 16) & 0xff; + int b = (rgba >> 8) & 0xff; +@@ -97,32 +97,32 @@ vips__rgba2bgra_premultiplied( guint32 * restrict p, int n ) + g = ((g * a) + 128) >> 8; + b = ((b * a) + 128) >> 8; + +- bgra = (b << 24) | (g << 16) | (r << 8) | a; ++ bgra = (b << 24) | (g << 16) | (r << 8) | a; + } + +- p[x] = GUINT32_TO_BE( bgra ); ++ p[x] = GUINT32_TO_BE(bgra); + } + } + + /* Convert from PDFium-style BGRA to RGBA. + */ + void +-vips__bgra2rgba( guint32 * restrict p, int n ) ++vips__bgra2rgba(guint32 *restrict p, int n) + { +- int x; ++ int x; + +- for( x = 0; x < n; x++ ) { +- guint32 bgra = GUINT32_FROM_BE( p[x] ); ++ for (x = 0; x < n; x++) { ++ guint32 bgra = GUINT32_FROM_BE(p[x]); + +- guint rgba; ++ guint rgba; + +- /* Leave G and A, swap R and B. +- */ +- rgba = +- (bgra & 0x00ff00ff) | +- (bgra & 0x0000ff00) << 16 | +- (bgra & 0xff000000) >> 16; ++ /* Leave G and A, swap R and B. ++ */ ++ rgba = ++ (bgra & 0x00ff00ff) | ++ (bgra & 0x0000ff00) << 16 | ++ (bgra & 0xff000000) >> 16; + +- p[x] = GUINT32_TO_BE( rgba ); +- } ++ p[x] = GUINT32_TO_BE(rgba); ++ } + } +diff --git a/libvips/foreign/cgifsave.c b/libvips/foreign/cgifsave.c +index 32ece4e52f..83c3f26217 100644 +--- a/libvips/foreign/cgifsave.c ++++ b/libvips/foreign/cgifsave.c +@@ -7,28 +7,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* +- +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -57,9 +57,9 @@ + /* The modes we work in. + * + * VIPS_FOREIGN_SAVE_CGIF_MODE_GLOBAL: +- * +- * Each frame is dithered to single global colour table taken from the +- * input image "gif-palette" metadata item. ++ * ++ * Each frame is dithered to single global colour table taken from the ++ * input image "gif-palette" metadata item. + * + * VIPS_FOREIGN_SAVE_CGIF_MODE_LOCAL: + * +@@ -90,7 +90,7 @@ typedef struct _VipsForeignSaveCgif { + /* Derived write params. + */ + VipsForeignSaveCgifMode mode; +- VipsImage *in; /* Not a reference */ ++ VipsImage *in; /* Not a reference */ + int *delay; + int delay_length; + int loop; +@@ -102,8 +102,8 @@ typedef struct _VipsForeignSaveCgif { + + /* The frame we are building, the y position in the frame. + */ +- int frame_width; +- int frame_height; ++ int frame_width; ++ int frame_height; + VipsPel *frame_bytes; + int write_y; + int page_number; +@@ -113,7 +113,7 @@ typedef struct _VipsForeignSaveCgif { + VipsQuantiseAttr *attr; + VipsQuantiseResult *quantisation_result; + +- /* The palette we used for the previous frame. This can be equal to ++ /* The palette we used for the previous frame. This can be equal to + * quantisation_result if we used the global palette for the previous + * frame, so don't free this. + */ +@@ -128,7 +128,7 @@ typedef struct _VipsForeignSaveCgif { + VipsPel *index; + + /* The previous RGBA frame (needed for transparency trick). +- */ ++ */ + VipsPel *previous_frame; + + /* The frame as written by libcgif. +@@ -141,64 +141,62 @@ typedef struct _VipsForeignSaveCgif { + + typedef VipsForeignSaveClass VipsForeignSaveCgifClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveCgif, vips_foreign_save_cgif, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSaveCgif, vips_foreign_save_cgif, ++ VIPS_TYPE_FOREIGN_SAVE); + + static void +-vips_foreign_save_cgif_dispose( GObject *gobject ) ++vips_foreign_save_cgif_dispose(GObject *gobject) + { + VipsForeignSaveCgif *cgif = (VipsForeignSaveCgif *) gobject; + +- g_info( "cgifsave: %d frames", cgif->page_number ); +- g_info( "cgifsave: %d unique palettes", cgif->n_palettes_generated ); ++ g_info("cgifsave: %d frames", cgif->page_number); ++ g_info("cgifsave: %d unique palettes", cgif->n_palettes_generated); + +- VIPS_FREEF( cgif_close, cgif->cgif_context ); ++ VIPS_FREEF(cgif_close, cgif->cgif_context); + +- VIPS_FREEF( vips__quantise_result_destroy, cgif->quantisation_result ); +- VIPS_FREEF( vips__quantise_result_destroy, cgif-> +- free_quantisation_result ); +- VIPS_FREEF( vips__quantise_attr_destroy, cgif->attr ); ++ VIPS_FREEF(vips__quantise_result_destroy, cgif->quantisation_result); ++ VIPS_FREEF(vips__quantise_result_destroy, cgif->free_quantisation_result); ++ VIPS_FREEF(vips__quantise_attr_destroy, cgif->attr); + +- VIPS_UNREF( cgif->target ); ++ VIPS_UNREF(cgif->target); + +- VIPS_FREE( cgif->index ); +- VIPS_FREE( cgif->frame_bytes ); +- VIPS_FREE( cgif->previous_frame ); ++ VIPS_FREE(cgif->index); ++ VIPS_FREE(cgif->frame_bytes); ++ VIPS_FREE(cgif->previous_frame); + +- G_OBJECT_CLASS( vips_foreign_save_cgif_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_cgif_parent_class)->dispose(gobject); + } + +-static int +-vips__cgif_write( void *client, const uint8_t *buffer, const size_t length ) ++static int ++vips__cgif_write(void *client, const uint8_t *buffer, const size_t length) + { +- VipsTarget *target = VIPS_TARGET( client ); ++ VipsTarget *target = VIPS_TARGET(client); + +- return vips_target_write( target, +- (const void *) buffer, (size_t) length ); ++ return vips_target_write(target, ++ (const void *) buffer, (size_t) length); + } + +-/* Set pixels in index transparent if they are equal RGB to the previous ++/* Set pixels in index transparent if they are equal RGB to the previous + * frame. + * + * In combination with the GIF transparency optimization this leads to + * less difference between frames and therefore improves the compression ratio. + */ + static void +-vips_foreign_save_cgif_set_transparent( VipsForeignSaveCgif *cgif, +- VipsPel *old, VipsPel *new, VipsPel *index, int n_pels, int trans ) ++vips_foreign_save_cgif_set_transparent(VipsForeignSaveCgif *cgif, ++ VipsPel *old, VipsPel *new, VipsPel *index, int n_pels, int trans) + { + int sq_maxerror = cgif->interframe_maxerror * cgif->interframe_maxerror; + + int i; + +- for( i = 0; i < n_pels; i++ ) { ++ for (i = 0; i < n_pels; i++) { + /* Alpha must match + */ +- if( old[3] == new[3] ) { ++ if (old[3] == new[3]) { + /* Both transparent ... no need to check RGB. + */ +- if( !old[3] && !new[3] ) ++ if (!old[3] && !new[3]) + index[i] = trans; + else { + /* Compare RGB. +@@ -207,12 +205,12 @@ vips_foreign_save_cgif_set_transparent( VipsForeignSaveCgif *cgif, + const int dG = old[1] - new[1]; + const int dB = old[2] - new[2]; + +- if( dR * dR + dG * dG + dB * dB <= sq_maxerror ) ++ if (dR * dR + dG * dG + dB * dB <= sq_maxerror) + index[i] = trans; + } + } + +- if( index[i] != trans ) { ++ if (index[i] != trans) { + old[0] = new[0]; + old[1] = new[1]; + old[2] = new[2]; +@@ -225,27 +223,27 @@ vips_foreign_save_cgif_set_transparent( VipsForeignSaveCgif *cgif, + } + + static double +-vips__cgif_compare_palettes( const VipsQuantisePalette *new, +- const VipsQuantisePalette *old ) ++vips__cgif_compare_palettes(const VipsQuantisePalette *new, ++ const VipsQuantisePalette *old) + { + int i, j; + double best_dist, dist, rd, gd, bd; + double total_dist; + +- g_assert( new->count <= 256 ); +- g_assert( old->count <= 256 ); ++ g_assert(new->count <= 256); ++ g_assert(old->count <= 256); + + total_dist = 0; +- for( i = 0; i < new->count; i++ ) { ++ for (i = 0; i < new->count; i++) { + best_dist = 255 * 255 * 3; + +- for( j = 0; j < old->count; j++ ) { +- if( new->entries[i].a ) { ++ for (j = 0; j < old->count; j++) { ++ if (new->entries[i].a) { + /* The new entry is solid. + * If the old entry is transparent, ignore it. + * Otherwise, compare RGB. +- */ +- if( !old->entries[j].a ) ++ */ ++ if (!old->entries[j].a) + continue; + + rd = new->entries[i].r - old->entries[j].r; +@@ -253,19 +251,19 @@ vips__cgif_compare_palettes( const VipsQuantisePalette *new, + bd = new->entries[i].b - old->entries[j].b; + dist = rd * rd + gd * gd + bd * bd; + +- best_dist = VIPS_MIN( best_dist, dist ); ++ best_dist = VIPS_MIN(best_dist, dist); + + /* We found the closest entry + */ +- if( best_dist == 0 ) ++ if (best_dist == 0) + break; +- } ++ } + else { + /* The new entry is transparent. + * If the old entry is transparent too, it's + * the closest color. Otherwise, ignore it. + */ +- if( !old->entries[j].a ) { ++ if (!old->entries[j].a) { + best_dist = 0; + break; + } +@@ -275,23 +273,23 @@ vips__cgif_compare_palettes( const VipsQuantisePalette *new, + total_dist += best_dist; + } + +- return( sqrt( total_dist / (3 * new->count) ) ); ++ return (sqrt(total_dist / (3 * new->count))); + } + + /* Extract the generated palette as RGB. + */ + static void +-vips_foreign_save_cgif_get_rgb_palette( VipsForeignSaveCgif *cgif, +- VipsQuantiseResult *quantisation_result, VipsPel *rgb ) ++vips_foreign_save_cgif_get_rgb_palette(VipsForeignSaveCgif *cgif, ++ VipsQuantiseResult *quantisation_result, VipsPel *rgb) + { +- const VipsQuantisePalette *lp = +- vips__quantise_get_palette( quantisation_result ); ++ const VipsQuantisePalette *lp = ++ vips__quantise_get_palette(quantisation_result); + + int i; + +- g_assert( lp->count <= 256 ); ++ g_assert(lp->count <= 256); + +- for( i = 0; i < lp->count; i++ ) { ++ for (i = 0; i < lp->count; i++) { + rgb[0] = lp->entries[i].r; + rgb[1] = lp->entries[i].g; + rgb[2] = lp->entries[i].b; +@@ -301,27 +299,27 @@ vips_foreign_save_cgif_get_rgb_palette( VipsForeignSaveCgif *cgif, + } + + int +-vips_foreign_save_cgif_pick_quantiser( VipsForeignSaveCgif *cgif, ++vips_foreign_save_cgif_pick_quantiser(VipsForeignSaveCgif *cgif, + VipsQuantiseImage *image, +- VipsQuantiseResult **result, gboolean *use_local ) ++ VipsQuantiseResult **result, gboolean *use_local) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( cgif ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(cgif); + + VipsQuantiseResult *this_result; + +- if( vips__quantise_image_quantize_fixed( image, cgif->attr, +- &this_result ) ) { +- vips_error( class->nickname, "%s", _( "quantisation failed" ) ); +- return( -1 ); ++ if (vips__quantise_image_quantize_fixed(image, cgif->attr, ++ &this_result)) { ++ vips_error(class->nickname, "%s", _("quantisation failed")); ++ return (-1); + } + + /* No global quantiser set up yet? Use this result. + */ +- if( !cgif->quantisation_result ) { ++ if (!cgif->quantisation_result) { + #ifdef DEBUG_VERBOSE +- printf( "vips_foreign_save_cgif_pick_quantiser: " +- "global palette from first frame\n" ); +-#endif/*DEBUG_VERBOSE*/ ++ printf("vips_foreign_save_cgif_pick_quantiser: " ++ "global palette from first frame\n"); ++#endif /*DEBUG_VERBOSE*/ + + cgif->quantisation_result = this_result; + cgif->n_palettes_generated += 1; +@@ -333,56 +331,56 @@ vips_foreign_save_cgif_pick_quantiser( VipsForeignSaveCgif *cgif, + /* Compare the palette we just made to the palette + * for the previous frame, and to the global palette. + */ +- const VipsQuantisePalette *global = vips__quantise_get_palette( +- cgif->quantisation_result ); +- const VipsQuantisePalette *this = vips__quantise_get_palette( +- this_result ); +- const VipsQuantisePalette *prev = vips__quantise_get_palette( +- cgif->previous_quantisation_result ); +- +- double global_diff = +- vips__cgif_compare_palettes( this, global ); +- double prev_diff = (prev == global) ? global_diff : +- vips__cgif_compare_palettes( this, prev ); ++ const VipsQuantisePalette *global = vips__quantise_get_palette( ++ cgif->quantisation_result); ++ const VipsQuantisePalette *this = vips__quantise_get_palette( ++ this_result); ++ const VipsQuantisePalette *prev = vips__quantise_get_palette( ++ cgif->previous_quantisation_result); ++ ++ double global_diff = ++ vips__cgif_compare_palettes(this, global); ++ double prev_diff = (prev == global) ? global_diff : vips__cgif_compare_palettes(this, prev); + + #ifdef DEBUG_VERBOSE +- printf( "vips_foreign_save_cgif_write_frame: " +- "this -> global distance = %g\n", +- global_diff ); +- printf( "vips_foreign_save_cgif_write_frame: " +- "this -> prev distance = %g\n", +- prev_diff ); +- printf( "vips_foreign_save_cgif_write_frame: " +- "threshold = %g\n", cgif->interpalette_maxerror ); +-#endif/*DEBUG_VERBOSE*/ +- +- if( global_diff <= prev_diff && +- global_diff < cgif->interpalette_maxerror ) { ++ printf("vips_foreign_save_cgif_write_frame: " ++ "this -> global distance = %g\n", ++ global_diff); ++ printf("vips_foreign_save_cgif_write_frame: " ++ "this -> prev distance = %g\n", ++ prev_diff); ++ printf("vips_foreign_save_cgif_write_frame: " ++ "threshold = %g\n", ++ cgif->interpalette_maxerror); ++#endif /*DEBUG_VERBOSE*/ ++ ++ if (global_diff <= prev_diff && ++ global_diff < cgif->interpalette_maxerror) { + /* Global is good enough, use that. + */ + #ifdef DEBUG_VERBOSE +- printf( "vips_foreign_save_cgif_write_frame: " +- "using global palette\n" ); +-#endif/*DEBUG_VERBOSE*/ ++ printf("vips_foreign_save_cgif_write_frame: " ++ "using global palette\n"); ++#endif /*DEBUG_VERBOSE*/ + +- VIPS_FREEF( vips__quantise_result_destroy, +- this_result ); +- VIPS_FREEF( vips__quantise_result_destroy, +- cgif->free_quantisation_result ); ++ VIPS_FREEF(vips__quantise_result_destroy, ++ this_result); ++ VIPS_FREEF(vips__quantise_result_destroy, ++ cgif->free_quantisation_result); + + *result = cgif->quantisation_result; + *use_local = FALSE; + } +- else if( prev_diff < cgif->interpalette_maxerror ) { ++ else if (prev_diff < cgif->interpalette_maxerror) { + /* Previous is good enough, use that again. + */ + #ifdef DEBUG_VERBOSE +- printf( "vips_foreign_save_cgif_write_frame: " +- "using previous palette\n" ); +-#endif/*DEBUG_VERBOSE*/ ++ printf("vips_foreign_save_cgif_write_frame: " ++ "using previous palette\n"); ++#endif /*DEBUG_VERBOSE*/ + +- VIPS_FREEF( vips__quantise_result_destroy, +- this_result ); ++ VIPS_FREEF(vips__quantise_result_destroy, ++ this_result); + + *result = cgif->previous_quantisation_result; + *use_local = TRUE; +@@ -392,12 +390,12 @@ vips_foreign_save_cgif_pick_quantiser( VipsForeignSaveCgif *cgif, + * palette. + */ + #ifdef DEBUG_VERBOSE +- printf( "vips_foreign_save_cgif_write_frame: " +- "using new local palette\n" ); +-#endif/*DEBUG_VERBOSE*/ ++ printf("vips_foreign_save_cgif_write_frame: " ++ "using new local palette\n"); ++#endif /*DEBUG_VERBOSE*/ + +- VIPS_FREEF( vips__quantise_result_destroy, +- cgif->free_quantisation_result ); ++ VIPS_FREEF(vips__quantise_result_destroy, ++ cgif->free_quantisation_result); + cgif->free_quantisation_result = this_result; + cgif->n_palettes_generated += 1; + +@@ -408,20 +406,20 @@ vips_foreign_save_cgif_pick_quantiser( VipsForeignSaveCgif *cgif, + + cgif->previous_quantisation_result = *result; + +- return( 0 ); ++ return (0); + } + + /* We have a complete frame --- write! + */ + static int +-vips_foreign_save_cgif_write_frame( VipsForeignSaveCgif *cgif ) ++vips_foreign_save_cgif_write_frame(VipsForeignSaveCgif *cgif) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( cgif ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(cgif); + int n_pels = cgif->frame_height * cgif->frame_width; + + gboolean has_transparency; + gboolean has_alpha_constraint; +- VipsPel * restrict p; ++ VipsPel *restrict p; + int i; + VipsQuantiseImage *image; + gboolean use_local; +@@ -432,10 +430,10 @@ vips_foreign_save_cgif_write_frame( VipsForeignSaveCgif *cgif ) + VipsPel palette_rgb[256 * 3]; + + #ifdef DEBUG_VERBOSE +- printf( "vips_foreign_save_cgif_write_frame: %d\n", cgif->page_number ); +-#endif/*DEBUG_VERBOSE*/ ++ printf("vips_foreign_save_cgif_write_frame: %d\n", cgif->page_number); ++#endif /*DEBUG_VERBOSE*/ + +- /* Threshold the alpha channel. ++ /* Threshold the alpha channel. + * + * Also, check if the alpha channel of the current frame matches the + * frame before. +@@ -447,8 +445,8 @@ vips_foreign_save_cgif_write_frame( VipsForeignSaveCgif *cgif ) + */ + p = cgif->frame_bytes; + has_alpha_constraint = FALSE; +- for( i = 0; i < n_pels; i++ ) { +- if( p[3] >= 128 ) ++ for (i = 0; i < n_pels; i++) { ++ if (p[3] >= 128) + p[3] = 255; + else { + /* Helps the quantiser generate a better palette. +@@ -458,8 +456,8 @@ vips_foreign_save_cgif_write_frame( VipsForeignSaveCgif *cgif ) + p[2] = 0; + p[3] = 0; + +- if( cgif->page_number > 0 && +- cgif->previous_frame[i * 4 + 3] ) ++ if (cgif->page_number > 0 && ++ cgif->previous_frame[i * 4 + 3]) + has_alpha_constraint = TRUE; + } + +@@ -468,55 +466,54 @@ vips_foreign_save_cgif_write_frame( VipsForeignSaveCgif *cgif ) + + /* Set up new frame for libimagequant. + */ +- image = vips__quantise_image_create_rgba( cgif->attr, +- cgif->frame_bytes, cgif->frame_width, cgif->frame_height, 0 ); ++ image = vips__quantise_image_create_rgba(cgif->attr, ++ cgif->frame_bytes, cgif->frame_width, cgif->frame_height, 0); + +- if( cgif->mode == VIPS_FOREIGN_SAVE_CGIF_MODE_LOCAL || +- !cgif->quantisation_result ) { ++ if (cgif->mode == VIPS_FOREIGN_SAVE_CGIF_MODE_LOCAL || ++ !cgif->quantisation_result) { + /* Reoptimising each frame, or no global palette set up yet. + */ +- if( vips_foreign_save_cgif_pick_quantiser( cgif, +- image, &quantisation_result, &use_local ) ) +- return( -1 ); ++ if (vips_foreign_save_cgif_pick_quantiser(cgif, ++ image, &quantisation_result, &use_local)) ++ return (-1); + } + else { + quantisation_result = cgif->quantisation_result; + use_local = FALSE; + } + +- lp = vips__quantise_get_palette( quantisation_result ); ++ lp = vips__quantise_get_palette(quantisation_result); + /* If there's a transparent pixel, it's always first. + */ + has_transparency = lp->entries[0].a == 0; + n_colours = lp->count; +- vips_foreign_save_cgif_get_rgb_palette( cgif, +- quantisation_result, palette_rgb ); ++ vips_foreign_save_cgif_get_rgb_palette(cgif, ++ quantisation_result, palette_rgb); + + /* Dither frame into @index. + */ +- vips__quantise_set_dithering_level( quantisation_result, cgif->dither ); +- if( vips__quantise_write_remapped_image( quantisation_result, +- image, cgif->index, n_pels ) ) { +- vips_error( class->nickname, "%s", _( "dither failed" ) ); +- VIPS_FREEF( vips__quantise_image_destroy, image ); +- return( -1 ); ++ vips__quantise_set_dithering_level(quantisation_result, cgif->dither); ++ if (vips__quantise_write_remapped_image(quantisation_result, ++ image, cgif->index, n_pels)) { ++ vips_error(class->nickname, "%s", _("dither failed")); ++ VIPS_FREEF(vips__quantise_image_destroy, image); ++ return (-1); + } + +- VIPS_FREEF( vips__quantise_image_destroy, image ); ++ VIPS_FREEF(vips__quantise_image_destroy, image); + + /* Set up cgif on first use. + */ +- if( !cgif->cgif_context ) { ++ if (!cgif->cgif_context) { + #ifdef HAVE_CGIF_ATTR_NO_LOOP +- cgif->cgif_config.attrFlags = +- CGIF_ATTR_IS_ANIMATED | ++ cgif->cgif_config.attrFlags = ++ CGIF_ATTR_IS_ANIMATED | + (cgif->loop == 1 ? CGIF_ATTR_NO_LOOP : 0); +- cgif->cgif_config.numLoops = cgif->loop > 1 ? +- cgif->loop - 1 : cgif->loop; +-#else /*!HAVE_CGIF_ATTR_NO_LOOP*/ ++ cgif->cgif_config.numLoops = cgif->loop > 1 ? cgif->loop - 1 : cgif->loop; ++#else /*!HAVE_CGIF_ATTR_NO_LOOP*/ + cgif->cgif_config.attrFlags = CGIF_ATTR_IS_ANIMATED; + cgif->cgif_config.numLoops = cgif->loop; +-#endif/*HAVE_CGIF_ATTR_NO_LOOP*/ ++#endif /*HAVE_CGIF_ATTR_NO_LOOP*/ + + cgif->cgif_config.width = cgif->frame_width; + cgif->cgif_config.height = cgif->frame_height; +@@ -525,21 +522,21 @@ vips_foreign_save_cgif_write_frame( VipsForeignSaveCgif *cgif ) + cgif->cgif_config.pWriteFn = vips__cgif_write; + cgif->cgif_config.pContext = (void *) cgif->target; + +- cgif->cgif_context = cgif_newgif( &cgif->cgif_config ); ++ cgif->cgif_context = cgif_newgif(&cgif->cgif_config); + } + + /* Allow cgif to optimise by adding transparency. These optimisations + * will be automatically disabled if they are not possible. + */ +- frame_config.genFlags = +- CGIF_FRAME_GEN_USE_TRANSPARENCY | ++ frame_config.genFlags = ++ CGIF_FRAME_GEN_USE_TRANSPARENCY | + CGIF_FRAME_GEN_USE_DIFF_WINDOW; + frame_config.attrFlags = 0; + +- /* Switch per-frame alpha channel on. Index 0 is used for pixels ++ /* Switch per-frame alpha channel on. Index 0 is used for pixels + * with alpha channel. + */ +- if( has_transparency ) { ++ if (has_transparency) { + frame_config.attrFlags |= CGIF_FRAME_ATTR_HAS_ALPHA; + frame_config.transIndex = 0; + } +@@ -547,15 +544,15 @@ vips_foreign_save_cgif_write_frame( VipsForeignSaveCgif *cgif ) + /* Pixels which are equal to pixels in the previous frame can be made + * transparent, provided no alpha channel constraint is present. + */ +- if( cgif->page_number > 0 && +- !has_alpha_constraint ) { ++ if (cgif->page_number > 0 && ++ !has_alpha_constraint) { + int trans = has_transparency ? 0 : n_colours; + +- vips_foreign_save_cgif_set_transparent( cgif, +- cgif->previous_frame, cgif->frame_bytes, cgif->index, +- n_pels, trans ); ++ vips_foreign_save_cgif_set_transparent(cgif, ++ cgif->previous_frame, cgif->frame_bytes, cgif->index, ++ n_pels, trans); + +- if( has_transparency ) ++ if (has_transparency) + frame_config.attrFlags &= ~CGIF_FRAME_ATTR_HAS_ALPHA; + frame_config.attrFlags |= CGIF_FRAME_ATTR_HAS_SET_TRANS; + frame_config.transIndex = trans; +@@ -563,106 +560,105 @@ vips_foreign_save_cgif_write_frame( VipsForeignSaveCgif *cgif ) + else { + /* Take a copy of the RGBA frame. + */ +- memcpy( cgif->previous_frame, cgif->frame_bytes, 4 * n_pels ); ++ memcpy(cgif->previous_frame, cgif->frame_bytes, 4 * n_pels); + } + +- if( cgif->delay && +- cgif->page_number < cgif->delay_length ) +- frame_config.delay = +- VIPS_RINT( cgif->delay[cgif->page_number] / 10.0 ); ++ if (cgif->delay && ++ cgif->page_number < cgif->delay_length) ++ frame_config.delay = ++ VIPS_RINT(cgif->delay[cgif->page_number] / 10.0); + + /* Attach a local palette, if we need one. + */ +- if( use_local ) { ++ if (use_local) { + frame_config.attrFlags |= CGIF_FRAME_ATTR_USE_LOCAL_TABLE; + frame_config.pLocalPalette = palette_rgb; + frame_config.numLocalPaletteEntries = n_colours; + } + + /* Write an interlaced GIF, if requested. +- */ +- if( cgif->interlace ) { ++ */ ++ if (cgif->interlace) { + #ifdef HAVE_CGIF_FRAME_ATTR_INTERLACED + frame_config.attrFlags |= CGIF_FRAME_ATTR_INTERLACED; +-#else /*!HAVE_CGIF_FRAME_ATTR_INTERLACED*/ +- g_warning( "%s: cgif >= v0.3.0 required for interlaced GIF write", class->nickname ); ++#else /*!HAVE_CGIF_FRAME_ATTR_INTERLACED*/ ++ g_warning("%s: cgif >= v0.3.0 required for interlaced GIF write", class->nickname); + #endif /*HAVE_CGIF_FRAME_ATTR_INTERLACED*/ + } + + /* Write frame to cgif. + */ + frame_config.pImageData = cgif->index; +- cgif_addframe( cgif->cgif_context, &frame_config ); ++ cgif_addframe(cgif->cgif_context, &frame_config); + +- return( 0 ); ++ return (0); + } + + /* Another chunk of pixels have arrived from the pipeline. Add to frame, and + * if the frame completes, compress and write to the target. + */ + static int +-vips_foreign_save_cgif_sink_disc( VipsRegion *region, VipsRect *area, void *a ) ++vips_foreign_save_cgif_sink_disc(VipsRegion *region, VipsRect *area, void *a) + { + VipsForeignSaveCgif *cgif = (VipsForeignSaveCgif *) a; +- int line_size = cgif->frame_width * 4; ++ int line_size = cgif->frame_width * 4; + +- int y; ++ int y; + + #ifdef DEBUG_VERBOSE +- printf( "vips_foreign_save_cgif_sink_disc: strip at %d, height %d\n", +- area->top, area->height ); +-#endif/*DEBUG_VERBOSE*/ ++ printf("vips_foreign_save_cgif_sink_disc: strip at %d, height %d\n", ++ area->top, area->height); ++#endif /*DEBUG_VERBOSE*/ + +- for( y = 0; y < area->height; y++ ) { +- memcpy( cgif->frame_bytes + cgif->write_y * line_size, +- VIPS_REGION_ADDR( region, 0, area->top + y ), +- line_size ); +- cgif->write_y += 1; ++ for (y = 0; y < area->height; y++) { ++ memcpy(cgif->frame_bytes + cgif->write_y * line_size, ++ VIPS_REGION_ADDR(region, 0, area->top + y), ++ line_size); ++ cgif->write_y += 1; + +- if( cgif->write_y >= cgif->frame_height ) { +- if( vips_foreign_save_cgif_write_frame( cgif ) ) +- return( -1 ); ++ if (cgif->write_y >= cgif->frame_height) { ++ if (vips_foreign_save_cgif_write_frame(cgif)) ++ return (-1); + + cgif->write_y = 0; + cgif->page_number += 1; +- } +- } ++ } ++ } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_cgif_build( VipsObject *object ) ++vips_foreign_save_cgif_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveCgif *cgif = (VipsForeignSaveCgif *) object; +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( cgif ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(cgif); + VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( cgif ), 2 ); ++ vips_object_local_array(VIPS_OBJECT(cgif), 2); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_cgif_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_cgif_parent_class)->build(object)) ++ return (-1); + + cgif->in = save->ready; + + /* libimagequant only works with RGBA images. + */ +- if( !vips_image_hasalpha( cgif->in ) ) { +- if( vips_addalpha( cgif->in, &t[1], NULL ) ) +- return( -1 ); ++ if (!vips_image_hasalpha(cgif->in)) { ++ if (vips_addalpha(cgif->in, &t[1], NULL)) ++ return (-1); + cgif->in = t[1]; + } + + /* Animation properties. + */ +- if( vips_image_get_typeof( cgif->in, "delay" ) ) +- vips_image_get_array_int( cgif->in, "delay", +- &cgif->delay, &cgif->delay_length ); +- if( vips_image_get_typeof( cgif->in, "loop" ) ) +- vips_image_get_int( cgif->in, "loop", &cgif->loop ); ++ if (vips_image_get_typeof(cgif->in, "delay")) ++ vips_image_get_array_int(cgif->in, "delay", ++ &cgif->delay, &cgif->delay_length); ++ if (vips_image_get_typeof(cgif->in, "loop")) ++ vips_image_get_int(cgif->in, "loop", &cgif->loop); + +- cgif->frame_height = vips_image_get_page_height( cgif->in ); ++ cgif->frame_height = vips_image_get_page_height(cgif->in); + cgif->frame_width = cgif->in->Xsize; + + /* Reject images that exceed the pixel limit of libimagequant, +@@ -671,27 +667,27 @@ vips_foreign_save_cgif_build( VipsObject *object ) + * Frame width * height will fit in an int, though frame size will + * need at least a uint. + */ +- if( (guint64) cgif->frame_width * cgif->frame_height > INT_MAX / 4 || +- cgif->frame_width > 65535 || +- cgif->frame_height > 65535 ) { +- vips_error( class->nickname, "%s", _( "frame too large" ) ); +- return( -1 ); ++ if ((guint64) cgif->frame_width * cgif->frame_height > INT_MAX / 4 || ++ cgif->frame_width > 65535 || ++ cgif->frame_height > 65535) { ++ vips_error(class->nickname, "%s", _("frame too large")); ++ return (-1); + } + + /* This RGBA frame as a contiguous buffer. + */ +- cgif->frame_bytes = g_malloc0( (size_t) 4 * +- cgif->frame_width * cgif->frame_height ); ++ cgif->frame_bytes = g_malloc0((size_t) 4 * ++ cgif->frame_width * cgif->frame_height); + + /* The previous RGBA frame (for spotting pixels which haven't changed). + */ +- cgif->previous_frame = g_malloc0( (size_t) 4 * +- cgif->frame_width * cgif->frame_height ); ++ cgif->previous_frame = g_malloc0((size_t) 4 * ++ cgif->frame_width * cgif->frame_height); + + /* The frame index buffer. + */ +- cgif->index = g_malloc0( (size_t) cgif->frame_width * +- cgif->frame_height ); ++ cgif->index = g_malloc0((size_t) cgif->frame_width * ++ cgif->frame_height); + + /* Set up libimagequant. + */ +@@ -699,29 +695,29 @@ vips_foreign_save_cgif_build( VipsObject *object ) + /* Limit the number of colours to 255 so there is always one index + * free for transparency optimization. + */ +- vips__quantise_set_max_colors( cgif->attr, +- VIPS_MIN( 255, 1 << cgif->bitdepth ) ); +- vips__quantise_set_quality( cgif->attr, 0, 100 ); +- vips__quantise_set_speed( cgif->attr, 11 - cgif->effort ); ++ vips__quantise_set_max_colors(cgif->attr, ++ VIPS_MIN(255, 1 << cgif->bitdepth)); ++ vips__quantise_set_quality(cgif->attr, 0, 100); ++ vips__quantise_set_speed(cgif->attr, 11 - cgif->effort); + + /* Read the palette on the input if we've not been asked to + * reoptimise. + */ +- if( !cgif->reoptimise && +- vips_image_get_typeof( cgif->in, "gif-palette" ) ) { +- if( vips_image_get_array_int( cgif->in, "gif-palette", +- &cgif->palette, &cgif->n_colours ) ) +- return( -1 ); +- +- if( cgif->n_colours > 256 ) { +- vips_error( class->nickname, +- "%s", _( "gif-palette too large" ) ); +- return( -1 ); ++ if (!cgif->reoptimise && ++ vips_image_get_typeof(cgif->in, "gif-palette")) { ++ if (vips_image_get_array_int(cgif->in, "gif-palette", ++ &cgif->palette, &cgif->n_colours)) ++ return (-1); ++ ++ if (cgif->n_colours > 256) { ++ vips_error(class->nickname, ++ "%s", _("gif-palette too large")); ++ return (-1); + } + } + +- if( cgif->palette ) { +- /* Make a fake image from the input palette, and quantise that. ++ if (cgif->palette) { ++ /* Make a fake image from the input palette, and quantise that. + * Add a zero pixel (transparent) in case the input image has + * transparency. + * +@@ -730,41 +726,41 @@ vips_foreign_save_cgif_build( VipsObject *object ) + guint32 fake_image[257]; + VipsQuantiseImage *image; + +- memcpy( fake_image, cgif->palette, +- cgif->n_colours * sizeof( int ) ); ++ memcpy(fake_image, cgif->palette, ++ cgif->n_colours * sizeof(int)); + fake_image[cgif->n_colours] = 0; +- image = vips__quantise_image_create_rgba( cgif->attr, +- fake_image, cgif->n_colours + 1, 1, 0 ); +- +- if( vips__quantise_image_quantize_fixed( image, +- cgif->attr, &cgif->quantisation_result ) ) { +- vips_error( class->nickname, +- "%s", _( "quantisation failed" ) ); +- return( -1 ); ++ image = vips__quantise_image_create_rgba(cgif->attr, ++ fake_image, cgif->n_colours + 1, 1, 0); ++ ++ if (vips__quantise_image_quantize_fixed(image, ++ cgif->attr, &cgif->quantisation_result)) { ++ vips_error(class->nickname, ++ "%s", _("quantisation failed")); ++ return (-1); + } + +- VIPS_FREEF( vips__quantise_image_destroy, image ); ++ VIPS_FREEF(vips__quantise_image_destroy, image); + } + + /* Global mode if there's an input palette, or palette maxerror is + * huge. + */ +- if( cgif->palette || +- cgif->interpalette_maxerror > 255 ) +- cgif->mode = VIPS_FOREIGN_SAVE_CGIF_MODE_GLOBAL; ++ if (cgif->palette || ++ cgif->interpalette_maxerror > 255) ++ cgif->mode = VIPS_FOREIGN_SAVE_CGIF_MODE_GLOBAL; + else +- cgif->mode = VIPS_FOREIGN_SAVE_CGIF_MODE_LOCAL; ++ cgif->mode = VIPS_FOREIGN_SAVE_CGIF_MODE_LOCAL; + +- if( vips_sink_disc( cgif->in, +- vips_foreign_save_cgif_sink_disc, cgif ) ) +- return( -1 ); ++ if (vips_sink_disc(cgif->in, ++ vips_foreign_save_cgif_sink_disc, cgif)) ++ return (-1); + +- VIPS_FREEF( cgif_close, cgif->cgif_context ); ++ VIPS_FREEF(cgif_close, cgif->cgif_context); + +- if( vips_target_end( cgif->target ) ) +- return( -1 ); ++ if (vips_target_end(cgif->target)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static const char *vips__save_cgif_suffs[] = { ".gif", NULL }; +@@ -779,9 +775,9 @@ static VipsBandFormat bandfmt_gif[10] = { + }; + + static void +-vips_foreign_save_cgif_class_init( VipsForeignSaveCgifClass *class ) ++vips_foreign_save_cgif_class_init(VipsForeignSaveCgifClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; +@@ -791,7 +787,7 @@ vips_foreign_save_cgif_class_init( VipsForeignSaveCgifClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "gifsave_base"; +- object_class->description = _( "save as gif" ); ++ object_class->description = _("save as gif"); + object_class->build = vips_foreign_save_cgif_build; + + foreign_class->suffs = vips__save_cgif_suffs; +@@ -799,59 +795,58 @@ vips_foreign_save_cgif_class_init( VipsForeignSaveCgifClass *class ) + save_class->saveable = VIPS_SAVEABLE_RGBA_ONLY; + save_class->format_table = bandfmt_gif; + +- VIPS_ARG_DOUBLE( class, "dither", 10, +- _( "Dithering" ), +- _( "Amount of dithering" ), ++ VIPS_ARG_DOUBLE(class, "dither", 10, ++ _("Dithering"), ++ _("Amount of dithering"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveCgif, dither ), +- 0.0, 1.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsForeignSaveCgif, dither), ++ 0.0, 1.0, 1.0); + +- VIPS_ARG_INT( class, "effort", 11, +- _( "Effort" ), +- _( "Quantisation effort" ), ++ VIPS_ARG_INT(class, "effort", 11, ++ _("Effort"), ++ _("Quantisation effort"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveCgif, effort ), +- 1, 10, 7 ); ++ G_STRUCT_OFFSET(VipsForeignSaveCgif, effort), ++ 1, 10, 7); + +- VIPS_ARG_INT( class, "bitdepth", 12, +- _( "Bit depth" ), +- _( "Number of bits per pixel" ), ++ VIPS_ARG_INT(class, "bitdepth", 12, ++ _("Bit depth"), ++ _("Number of bits per pixel"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveCgif, bitdepth ), +- 1, 8, 8 ); ++ G_STRUCT_OFFSET(VipsForeignSaveCgif, bitdepth), ++ 1, 8, 8); + +- VIPS_ARG_DOUBLE( class, "interframe_maxerror", 13, +- _( "Maximum inter-frame error" ), +- _( "Maximum inter-frame error for transparency" ), ++ VIPS_ARG_DOUBLE(class, "interframe_maxerror", 13, ++ _("Maximum inter-frame error"), ++ _("Maximum inter-frame error for transparency"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveCgif, interframe_maxerror ), +- 0, 32, 0.0 ); ++ G_STRUCT_OFFSET(VipsForeignSaveCgif, interframe_maxerror), ++ 0, 32, 0.0); + +- VIPS_ARG_BOOL( class, "reoptimise", 14, +- _( "Reoptimise palettes" ), +- _( "Reoptimise colour palettes" ), ++ VIPS_ARG_BOOL(class, "reoptimise", 14, ++ _("Reoptimise palettes"), ++ _("Reoptimise colour palettes"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveCgif, reoptimise ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveCgif, reoptimise), ++ FALSE); + +- VIPS_ARG_DOUBLE( class, "interpalette_maxerror", 15, +- _( "Maximum inter-palette error" ), +- _( "Maximum inter-palette error for palette reusage" ), ++ VIPS_ARG_DOUBLE(class, "interpalette_maxerror", 15, ++ _("Maximum inter-palette error"), ++ _("Maximum inter-palette error for palette reusage"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveCgif, interpalette_maxerror ), +- 0, 256, 3.0 ); ++ G_STRUCT_OFFSET(VipsForeignSaveCgif, interpalette_maxerror), ++ 0, 256, 3.0); + +- VIPS_ARG_BOOL( class, "interlace", 16, +- _( "Interlaced" ), +- _( "Generate an interlaced (progressive) GIF" ), ++ VIPS_ARG_BOOL(class, "interlace", 16, ++ _("Interlaced"), ++ _("Generate an interlaced (progressive) GIF"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveCgif, interlace ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsForeignSaveCgif, interlace), ++ FALSE); + } + + static void +-vips_foreign_save_cgif_init( VipsForeignSaveCgif *gif ) ++vips_foreign_save_cgif_init(VipsForeignSaveCgif *gif) + { + gif->dither = 1.0; + gif->effort = 7; +@@ -871,31 +866,30 @@ typedef struct _VipsForeignSaveCgifTarget { + + typedef VipsForeignSaveCgifClass VipsForeignSaveCgifTargetClass; + +-G_DEFINE_TYPE( VipsForeignSaveCgifTarget, vips_foreign_save_cgif_target, +- vips_foreign_save_cgif_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveCgifTarget, vips_foreign_save_cgif_target, ++ vips_foreign_save_cgif_get_type()); + + static int +-vips_foreign_save_cgif_target_build( VipsObject *object ) ++vips_foreign_save_cgif_target_build(VipsObject *object) + { + VipsForeignSaveCgif *gif = (VipsForeignSaveCgif *) object; +- VipsForeignSaveCgifTarget *target = ++ VipsForeignSaveCgifTarget *target = + (VipsForeignSaveCgifTarget *) object; + + gif->target = target->target; +- g_object_ref( gif->target ); ++ g_object_ref(gif->target); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_cgif_target_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_cgif_target_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_cgif_target_class_init( +- VipsForeignSaveCgifTargetClass *class ) ++vips_foreign_save_cgif_target_class_init( ++ VipsForeignSaveCgifTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -904,17 +898,16 @@ vips_foreign_save_cgif_target_class_init( + object_class->nickname = "gifsave_target"; + object_class->build = vips_foreign_save_cgif_target_build; + +- VIPS_ARG_OBJECT( class, "target", 1, +- _( "Target" ), +- _( "Target to save to" ), ++ VIPS_ARG_OBJECT(class, "target", 1, ++ _("Target"), ++ _("Target to save to"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveCgifTarget, target ), +- VIPS_TYPE_TARGET ); +- ++ G_STRUCT_OFFSET(VipsForeignSaveCgifTarget, target), ++ VIPS_TYPE_TARGET); + } + + static void +-vips_foreign_save_cgif_target_init( VipsForeignSaveCgifTarget *target ) ++vips_foreign_save_cgif_target_init(VipsForeignSaveCgifTarget *target) + { + } + +@@ -925,29 +918,28 @@ typedef struct _VipsForeignSaveCgifFile { + + typedef VipsForeignSaveCgifClass VipsForeignSaveCgifFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveCgifFile, vips_foreign_save_cgif_file, +- vips_foreign_save_cgif_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveCgifFile, vips_foreign_save_cgif_file, ++ vips_foreign_save_cgif_get_type()); + + static int +-vips_foreign_save_cgif_file_build( VipsObject *object ) ++vips_foreign_save_cgif_file_build(VipsObject *object) + { + VipsForeignSaveCgif *gif = (VipsForeignSaveCgif *) object; + VipsForeignSaveCgifFile *file = (VipsForeignSaveCgifFile *) object; + +- if( !(gif->target = vips_target_new_to_file( file->filename )) ) +- return( -1 ); ++ if (!(gif->target = vips_target_new_to_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_cgif_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_cgif_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_cgif_file_class_init( VipsForeignSaveCgifFileClass *class ) ++vips_foreign_save_cgif_file_class_init(VipsForeignSaveCgifFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -956,16 +948,16 @@ vips_foreign_save_cgif_file_class_init( VipsForeignSaveCgifFileClass *class ) + object_class->nickname = "gifsave"; + object_class->build = vips_foreign_save_cgif_file_build; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveCgifFile, filename ), +- NULL ); ++ G_STRUCT_OFFSET(VipsForeignSaveCgifFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_cgif_file_init( VipsForeignSaveCgifFile *file ) ++vips_foreign_save_cgif_file_init(VipsForeignSaveCgifFile *file) + { + } + +@@ -976,37 +968,36 @@ typedef struct _VipsForeignSaveCgifBuffer { + + typedef VipsForeignSaveCgifClass VipsForeignSaveCgifBufferClass; + +-G_DEFINE_TYPE( VipsForeignSaveCgifBuffer, vips_foreign_save_cgif_buffer, +- vips_foreign_save_cgif_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveCgifBuffer, vips_foreign_save_cgif_buffer, ++ vips_foreign_save_cgif_get_type()); + + static int +-vips_foreign_save_cgif_buffer_build( VipsObject *object ) ++vips_foreign_save_cgif_buffer_build(VipsObject *object) + { + VipsForeignSaveCgif *gif = (VipsForeignSaveCgif *) object; +- VipsForeignSaveCgifBuffer *buffer = ++ VipsForeignSaveCgifBuffer *buffer = + (VipsForeignSaveCgifBuffer *) object; + + VipsBlob *blob; + +- if( !(gif->target = vips_target_new_to_memory()) ) +- return( -1 ); ++ if (!(gif->target = vips_target_new_to_memory())) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_cgif_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_cgif_buffer_parent_class)->build(object)) ++ return (-1); + +- g_object_get( gif->target, "blob", &blob, NULL ); +- g_object_set( buffer, "buffer", blob, NULL ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ g_object_get(gif->target, "blob", &blob, NULL); ++ g_object_set(buffer, "buffer", blob, NULL); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_cgif_buffer_class_init( +- VipsForeignSaveCgifBufferClass *class ) ++vips_foreign_save_cgif_buffer_class_init( ++ VipsForeignSaveCgifBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -1015,16 +1006,16 @@ vips_foreign_save_cgif_buffer_class_init( + object_class->nickname = "gifsave_buffer"; + object_class->build = vips_foreign_save_cgif_buffer_build; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to save to" ), ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to save to"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsForeignSaveCgifBuffer, buf ), +- VIPS_TYPE_BLOB ); ++ G_STRUCT_OFFSET(VipsForeignSaveCgifBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_save_cgif_buffer_init( VipsForeignSaveCgifBuffer *buffer ) ++vips_foreign_save_cgif_buffer_init(VipsForeignSaveCgifBuffer *buffer) + { + } + +@@ -1076,16 +1067,16 @@ vips_foreign_save_cgif_buffer_init( VipsForeignSaveCgifBuffer *buffer ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_gifsave( VipsImage *in, const char *filename, ... ) ++vips_gifsave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "gifsave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("gifsave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -1117,7 +1108,7 @@ vips_gifsave( VipsImage *in, const char *filename, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_gifsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++vips_gifsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + { + va_list ap; + VipsArea *area; +@@ -1125,23 +1116,23 @@ vips_gifsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) + + area = NULL; + +- va_start( ap, len ); +- result = vips_call_split( "gifsave_buffer", ap, in, &area ); +- va_end( ap ); ++ va_start(ap, len); ++ result = vips_call_split("gifsave_buffer", ap, in, &area); ++ va_end(ap); + +- if( !result && +- area ) { +- if( buf ) { ++ if (!result && ++ area) { ++ if (buf) { + *buf = area->data; + area->free_fn = NULL; + } +- if( len ) ++ if (len) + *len = area->length; + +- vips_area_unref( area ); ++ vips_area_unref(area); + } + +- return( result ); ++ return (result); + } + + /** +@@ -1168,14 +1159,14 @@ vips_gifsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_gifsave_target( VipsImage *in, VipsTarget *target, ... ) ++vips_gifsave_target(VipsImage *in, VipsTarget *target, ...) + { + va_list ap; + int result; + +- va_start( ap, target ); +- result = vips_call_split( "gifsave_target", ap, in, target ); +- va_end( ap ); ++ va_start(ap, target); ++ result = vips_call_split("gifsave_target", ap, in, target); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/csvload.c b/libvips/foreign/csvload.c +index 6ffffd9acb..14ddcd46b5 100644 +--- a/libvips/foreign/csvload.c ++++ b/libvips/foreign/csvload.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -98,42 +98,41 @@ typedef struct _VipsForeignLoadCsv { + + typedef VipsForeignLoadClass VipsForeignLoadCsvClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadCsv, vips_foreign_load_csv, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadCsv, vips_foreign_load_csv, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_csv_dispose( GObject *gobject ) ++vips_foreign_load_csv_dispose(GObject *gobject) + { + VipsForeignLoadCsv *csv = (VipsForeignLoadCsv *) gobject; + +- VIPS_UNREF( csv->source ); +- VIPS_UNREF( csv->sbuf ); +- VIPS_FREE( csv->linebuf ); ++ VIPS_UNREF(csv->source); ++ VIPS_UNREF(csv->sbuf); ++ VIPS_FREE(csv->linebuf); + +- G_OBJECT_CLASS( vips_foreign_load_csv_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_csv_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_load_csv_build( VipsObject *object ) ++vips_foreign_load_csv_build(VipsObject *object) + { + VipsForeignLoadCsv *csv = (VipsForeignLoadCsv *) object; + + int i; + const char *p; + +- if( !(csv->sbuf = vips_sbuf_new_from_source( csv->source )) ) +- return( -1 ); ++ if (!(csv->sbuf = vips_sbuf_new_from_source(csv->source))) ++ return (-1); + +- /* Make our char maps. ++ /* Make our char maps. + */ +- for( i = 0; i < 256; i++ ) { ++ for (i = 0; i < 256; i++) { + csv->whitemap[i] = 0; + csv->sepmap[i] = 0; + } +- for( p = csv->whitespace; *p; p++ ) ++ for (p = csv->whitespace; *p; p++) + csv->whitemap[(int) *p] = 1; +- for( p = csv->separator; *p; p++ ) ++ for (p = csv->separator; *p; p++) + csv->sepmap[(int) *p] = 1; + + /* \n must not be in the maps or we'll get very confused. +@@ -141,40 +140,39 @@ vips_foreign_load_csv_build( VipsObject *object ) + csv->sepmap[(int) '\n'] = 0; + csv->whitemap[(int) '\n'] = 0; + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_csv_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_csv_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static VipsForeignFlags +-vips_foreign_load_csv_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_csv_get_flags(VipsForeignLoad *load) + { +- return( 0 ); ++ return (0); + } + + /* Skip to the start of the next block of non-whitespace. + * + * Result: !white, \n, EOF + */ +-static int +-vips_foreign_load_csv_skip_white( VipsForeignLoadCsv *csv ) ++static int ++vips_foreign_load_csv_skip_white(VipsForeignLoadCsv *csv) + { +- int ch; ++ int ch; + + do { +- ch = VIPS_SBUF_GETC( csv->sbuf ); +- } while( ch != EOF && +- ch != '\n' && +- csv->whitemap[ch] ); ++ ch = VIPS_SBUF_GETC(csv->sbuf); ++ } while (ch != EOF && ++ ch != '\n' && ++ csv->whitemap[ch]); + +- VIPS_SBUF_UNGETC( csv->sbuf ); ++ VIPS_SBUF_UNGETC(csv->sbuf); + +- return( ch ); ++ return (ch); + } + +-/* We have just seen " (open quotes). Skip to just after the matching close ++/* We have just seen " (open quotes). Skip to just after the matching close + * quotes. + * + * If there is no matching close quotes before the end of the line, don't +@@ -182,34 +180,34 @@ vips_foreign_load_csv_skip_white( VipsForeignLoadCsv *csv ) + * + * Result: ", \n, EOF + */ +-static int +-vips_foreign_load_csv_skip_quoted( VipsForeignLoadCsv *csv ) ++static int ++vips_foreign_load_csv_skip_quoted(VipsForeignLoadCsv *csv) + { +- int ch; ++ int ch; + + do { +- ch = VIPS_SBUF_GETC( csv->sbuf ); ++ ch = VIPS_SBUF_GETC(csv->sbuf); + + /* Ignore \" (actually \anything) in strings. + */ +- if( ch == '\\' ) +- ch = VIPS_SBUF_GETC( csv->sbuf ); +- else if( ch == '"' ) ++ if (ch == '\\') ++ ch = VIPS_SBUF_GETC(csv->sbuf); ++ else if (ch == '"') + break; +- } while( ch != EOF && +- ch != '\n' ); ++ } while (ch != EOF && ++ ch != '\n'); + +- if( ch == '\n' ) +- VIPS_SBUF_UNGETC( csv->sbuf ); ++ if (ch == '\n') ++ VIPS_SBUF_UNGETC(csv->sbuf); + +- return( ch ); ++ return (ch); + } + +-/* Fetch the next item (not whitespace, separator or \n), as a string. The ++/* Fetch the next item (not whitespace, separator or \n), as a string. The + * returned string is valid until the next call to fetch item. NULL for EOF. + */ + static const char * +-vips_foreign_load_csv_fetch_item( VipsForeignLoadCsv *csv ) ++vips_foreign_load_csv_fetch_item(VipsForeignLoadCsv *csv) + { + int write_point; + int space_remaining; +@@ -220,11 +218,11 @@ vips_foreign_load_csv_fetch_item( VipsForeignLoadCsv *csv ) + space_remaining = MAX_ITEM_SIZE - 1; + write_point = 0; + +- while( (ch = VIPS_SBUF_GETC( csv->sbuf )) != -1 && ++ while ((ch = VIPS_SBUF_GETC(csv->sbuf)) != -1 && + ch != '\n' && + !csv->whitemap[ch] && + !csv->sepmap[ch] && +- space_remaining > 0 ) { ++ space_remaining > 0) { + csv->item[write_point] = ch; + write_point += 1; + space_remaining -= 1; +@@ -233,35 +231,35 @@ vips_foreign_load_csv_fetch_item( VipsForeignLoadCsv *csv ) + + /* If we hit EOF immediately, return EOF. + */ +- if( ch == -1 && +- write_point == 0 ) +- return( NULL ); ++ if (ch == -1 && ++ write_point == 0) ++ return (NULL); + +- /* If we filled the item buffer without seeing the end of the item, ++ /* If we filled the item buffer without seeing the end of the item, + * read up to the item end. + */ +- while( ch != -1 && ++ while (ch != -1 && + ch != '\n' && + !csv->whitemap[ch] && +- !csv->sepmap[ch] ) +- ch = VIPS_SBUF_GETC( csv->sbuf ); ++ !csv->sepmap[ch]) ++ ch = VIPS_SBUF_GETC(csv->sbuf); + + /* We've (probably) read the end of item character. Push it bakc. + */ +- if( ch == '\n' || ++ if (ch == '\n' || + csv->whitemap[ch] || +- csv->sepmap[ch] ) +- VIPS_SBUF_UNGETC( csv->sbuf ); ++ csv->sepmap[ch]) ++ VIPS_SBUF_UNGETC(csv->sbuf); + +- return( csv->item ); ++ return (csv->item); + } + + /* Read a single item. The syntax is: + * +- * element : ++ * element : + * whitespace* item whitespace* [EOF|EOL|separator] + * +- * item : ++ * item : + * double | + * "anything" | + * empty +@@ -272,7 +270,7 @@ vips_foreign_load_csv_fetch_item( VipsForeignLoadCsv *csv ) + * Result: sep, \n, EOF + */ + static int +-vips_foreign_load_csv_read_double( VipsForeignLoadCsv *csv, double *out ) ++vips_foreign_load_csv_read_double(VipsForeignLoadCsv *csv, double *out) + { + int ch; + +@@ -280,47 +278,47 @@ vips_foreign_load_csv_read_double( VipsForeignLoadCsv *csv, double *out ) + */ + *out = 0; + +- ch = vips_foreign_load_csv_skip_white( csv ); +- if( ch == EOF || +- ch == '\n' ) +- return( ch ); ++ ch = vips_foreign_load_csv_skip_white(csv); ++ if (ch == EOF || ++ ch == '\n') ++ return (ch); + +- if( ch == '"' ) { +- (void) VIPS_SBUF_GETC( csv->sbuf ); +- ch = vips_foreign_load_csv_skip_quoted( csv ); ++ if (ch == '"') { ++ (void) VIPS_SBUF_GETC(csv->sbuf); ++ ch = vips_foreign_load_csv_skip_quoted(csv); + } +- else if( !csv->sepmap[ch] ) { ++ else if (!csv->sepmap[ch]) { + const char *item; + +- item = vips_foreign_load_csv_fetch_item( csv ); +- if( !item ) +- return( EOF ); ++ item = vips_foreign_load_csv_fetch_item(csv); ++ if (!item) ++ return (EOF); + +- if( vips_strtod( item, out ) ) +- /* Only a warning, since (for example) exported ++ if (vips_strtod(item, out)) ++ /* Only a warning, since (for example) exported + * spreadsheets will often have text or date fields. + */ +- g_warning( _( "bad number, line %d, column %d" ), +- csv->lineno, csv->colno ); ++ g_warning(_("bad number, line %d, column %d"), ++ csv->lineno, csv->colno); + } + +- ch = vips_foreign_load_csv_skip_white( csv ); +- if( ch == EOF || +- ch == '\n' ) +- return( ch ); ++ ch = vips_foreign_load_csv_skip_white(csv); ++ if (ch == EOF || ++ ch == '\n') ++ return (ch); + +- /* If it's a separator, we have to step over it. ++ /* If it's a separator, we have to step over it. + */ +- if( csv->sepmap[ch] ) +- (void) VIPS_SBUF_GETC( csv->sbuf ); ++ if (csv->sepmap[ch]) ++ (void) VIPS_SBUF_GETC(csv->sbuf); + +- return( ch ); ++ return (ch); + } + + static int +-vips_foreign_load_csv_header( VipsForeignLoad *load ) ++vips_foreign_load_csv_header(VipsForeignLoad *load) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( load ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(load); + VipsForeignLoadCsv *csv = (VipsForeignLoadCsv *) load; + + int i; +@@ -331,17 +329,17 @@ vips_foreign_load_csv_header( VipsForeignLoad *load ) + + /* Rewind. + */ +- vips_sbuf_unbuffer( csv->sbuf ); +- if( vips_source_rewind( csv->source ) ) +- return( -1 ); ++ vips_sbuf_unbuffer(csv->sbuf); ++ if (vips_source_rewind(csv->source)) ++ return (-1); + + /* Skip the first few lines. + */ +- for( i = 0; i < csv->skip; i++ ) +- if( !vips_sbuf_get_line( csv->sbuf ) ) { +- vips_error( class->nickname, +- "%s", _( "unexpected end of file" ) ); +- return( -1 ); ++ for (i = 0; i < csv->skip; i++) ++ if (!vips_sbuf_get_line(csv->sbuf)) { ++ vips_error(class->nickname, ++ "%s", _("unexpected end of file")); ++ return (-1); + } + + /* Parse the first line to get the number of columns. +@@ -350,40 +348,40 @@ vips_foreign_load_csv_header( VipsForeignLoad *load ) + csv->colno = 0; + do { + csv->colno += 1; +- ch = vips_foreign_load_csv_read_double( csv, &value ); +- } while( ch != '\n' && +- ch != EOF ); ++ ch = vips_foreign_load_csv_read_double(csv, &value); ++ } while (ch != '\n' && ++ ch != EOF); + width = csv->colno; + +- if( !(csv->linebuf = VIPS_ARRAY( NULL, width, double )) ) +- return( -1 ); ++ if (!(csv->linebuf = VIPS_ARRAY(NULL, width, double))) ++ return (-1); + + /* If @lines is -1, we must scan the whole file to get the height. + */ +- if( csv->lines == -1 ) +- for( height = 0; vips_sbuf_get_line( csv->sbuf ); height++ ) ++ if (csv->lines == -1) ++ for (height = 0; vips_sbuf_get_line(csv->sbuf); height++) + ; +- else ++ else + height = csv->lines; + +- vips_image_init_fields( load->out, +- width, height, 1, +- VIPS_FORMAT_DOUBLE, +- VIPS_CODING_NONE, VIPS_INTERPRETATION_B_W, 1.0, 1.0 ); +- if( vips_image_pipelinev( load->out, +- VIPS_DEMAND_STYLE_THINSTRIP, NULL ) ) +- return( -1 ); ++ vips_image_init_fields(load->out, ++ width, height, 1, ++ VIPS_FORMAT_DOUBLE, ++ VIPS_CODING_NONE, VIPS_INTERPRETATION_B_W, 1.0, 1.0); ++ if (vips_image_pipelinev(load->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, NULL)) ++ return (-1); + +- VIPS_SETSTR( load->out->filename, +- vips_connection_filename( VIPS_CONNECTION( csv->source ) ) ); ++ VIPS_SETSTR(load->out->filename, ++ vips_connection_filename(VIPS_CONNECTION(csv->source))); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_csv_load( VipsForeignLoad *load ) ++vips_foreign_load_csv_load(VipsForeignLoad *load) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( load ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(load); + VipsForeignLoadCsv *csv = (VipsForeignLoadCsv *) load; + + int i; +@@ -392,29 +390,29 @@ vips_foreign_load_csv_load( VipsForeignLoad *load ) + + /* Rewind. + */ +- vips_sbuf_unbuffer( csv->sbuf ); +- if( vips_source_rewind( csv->source ) ) +- return( -1 ); ++ vips_sbuf_unbuffer(csv->sbuf); ++ if (vips_source_rewind(csv->source)) ++ return (-1); + + /* Skip the first few lines. + */ +- for( i = 0; i < csv->skip; i++ ) +- if( !vips_sbuf_get_line( csv->sbuf ) ) { +- vips_error( class->nickname, +- "%s", _( "unexpected end of file" ) ); +- return( -1 ); ++ for (i = 0; i < csv->skip; i++) ++ if (!vips_sbuf_get_line(csv->sbuf)) { ++ vips_error(class->nickname, ++ "%s", _("unexpected end of file")); ++ return (-1); + } + +- vips_image_init_fields( load->real, +- load->out->Xsize, load->out->Ysize, 1, +- VIPS_FORMAT_DOUBLE, +- VIPS_CODING_NONE, VIPS_INTERPRETATION_B_W, 1.0, 1.0 ); +- if( vips_image_pipelinev( load->real, +- VIPS_DEMAND_STYLE_THINSTRIP, NULL ) ) +- return( -1 ); ++ vips_image_init_fields(load->real, ++ load->out->Xsize, load->out->Ysize, 1, ++ VIPS_FORMAT_DOUBLE, ++ VIPS_CODING_NONE, VIPS_INTERPRETATION_B_W, 1.0, 1.0); ++ if (vips_image_pipelinev(load->real, ++ VIPS_DEMAND_STYLE_THINSTRIP, NULL)) ++ return (-1); + + csv->lineno = csv->skip + 1; +- for( y = 0; y < load->real->Ysize; y++ ) { ++ for (y = 0; y < load->real->Ysize; y++) { + csv->colno = 0; + + /* Not needed, but stops a used-before-set compiler warning. +@@ -423,28 +421,28 @@ vips_foreign_load_csv_load( VipsForeignLoad *load ) + + /* Some lines may be shorter. + */ +- memset( csv->linebuf, 0, load->real->Xsize * sizeof( double ) ); ++ memset(csv->linebuf, 0, load->real->Xsize * sizeof(double)); + +- for( x = 0; x < load->real->Xsize; x++ ) { ++ for (x = 0; x < load->real->Xsize; x++) { + double value; + + csv->colno += 1; +- ch = vips_foreign_load_csv_read_double( csv, &value ); +- if( ch == EOF && +- load->fail_on >= VIPS_FAIL_ON_TRUNCATED ) { +- vips_error( class->nickname, +- "%s", _( "unexpected end of file" ) ); +- return( -1 ); ++ ch = vips_foreign_load_csv_read_double(csv, &value); ++ if (ch == EOF && ++ load->fail_on >= VIPS_FAIL_ON_TRUNCATED) { ++ vips_error(class->nickname, ++ "%s", _("unexpected end of file")); ++ return (-1); + } +- if( ch == '\n' && +- x != load->real->Xsize - 1 ) { +- vips_error( class->nickname, +- _( "line %d has only %d columns" ), +- csv->lineno, csv->colno ); ++ if (ch == '\n' && ++ x != load->real->Xsize - 1) { ++ vips_error(class->nickname, ++ _("line %d has only %d columns"), ++ csv->lineno, csv->colno); + /* Unequal length lines, but no EOF. + */ +- if( load->fail_on >= VIPS_FAIL_ON_ERROR ) +- return( -1 ); ++ if (load->fail_on >= VIPS_FAIL_ON_ERROR) ++ return (-1); + } + + csv->linebuf[x] = value; +@@ -452,25 +450,25 @@ vips_foreign_load_csv_load( VipsForeignLoad *load ) + + /* Step over the line separator. + */ +- if( ch == '\n' ) { +- (void) VIPS_SBUF_GETC( csv->sbuf ); ++ if (ch == '\n') { ++ (void) VIPS_SBUF_GETC(csv->sbuf); + csv->lineno += 1; + } + +- if( vips_image_write_line( load->real, y, +- (VipsPel *) csv->linebuf ) ) +- return( -1 ); ++ if (vips_image_write_line(load->real, y, ++ (VipsPel *) csv->linebuf)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_csv_class_init( VipsForeignLoadCsvClass *class ) ++vips_foreign_load_csv_class_init(VipsForeignLoadCsvClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->dispose = vips_foreign_load_csv_dispose; +@@ -478,10 +476,10 @@ vips_foreign_load_csv_class_init( VipsForeignLoadCsvClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "csvload_base"; +- object_class->description = _( "load csv" ); ++ object_class->description = _("load csv"); + object_class->build = vips_foreign_load_csv_build; + +- /* This is fuzzed, but you're unlikely to want to use it on ++ /* This is fuzzed, but you're unlikely to want to use it on + * untrusted files. + */ + operation_class->flags |= VIPS_OPERATION_UNTRUSTED; +@@ -490,41 +488,41 @@ vips_foreign_load_csv_class_init( VipsForeignLoadCsvClass *class ) + load_class->header = vips_foreign_load_csv_header; + load_class->load = vips_foreign_load_csv_load; + +- VIPS_ARG_INT( class, "skip", 20, +- _( "Skip" ), +- _( "Skip this many lines at the start of the file" ), ++ VIPS_ARG_INT(class, "skip", 20, ++ _("Skip"), ++ _("Skip this many lines at the start of the file"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadCsv, skip ), +- 0, 10000000, 0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadCsv, skip), ++ 0, 10000000, 0); + +- VIPS_ARG_INT( class, "lines", 21, +- _( "Lines" ), +- _( "Read this many lines from the file" ), ++ VIPS_ARG_INT(class, "lines", 21, ++ _("Lines"), ++ _("Read this many lines from the file"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadCsv, lines ), +- -1, 10000000, 0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadCsv, lines), ++ -1, 10000000, 0); + +- VIPS_ARG_STRING( class, "whitespace", 22, +- _( "Whitespace" ), +- _( "Set of whitespace characters" ), ++ VIPS_ARG_STRING(class, "whitespace", 22, ++ _("Whitespace"), ++ _("Set of whitespace characters"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadCsv, whitespace ), +- " " ); ++ G_STRUCT_OFFSET(VipsForeignLoadCsv, whitespace), ++ " "); + +- VIPS_ARG_STRING( class, "separator", 23, +- _( "Separator" ), +- _( "Set of separator characters" ), ++ VIPS_ARG_STRING(class, "separator", 23, ++ _("Separator"), ++ _("Set of separator characters"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadCsv, separator ), +- ";,\t" ); ++ G_STRUCT_OFFSET(VipsForeignLoadCsv, separator), ++ ";,\t"); + } + + static void +-vips_foreign_load_csv_init( VipsForeignLoadCsv *csv ) ++vips_foreign_load_csv_init(VipsForeignLoadCsv *csv) + { + csv->lines = -1; +- csv->whitespace = g_strdup( " " ); +- csv->separator = g_strdup( ";,\t" ); ++ csv->whitespace = g_strdup(" "); ++ csv->separator = g_strdup(";,\t"); + } + + typedef struct _VipsForeignLoadCsvFile { +@@ -538,31 +536,30 @@ typedef struct _VipsForeignLoadCsvFile { + + typedef VipsForeignLoadCsvClass VipsForeignLoadCsvFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadCsvFile, vips_foreign_load_csv_file, +- vips_foreign_load_csv_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadCsvFile, vips_foreign_load_csv_file, ++ vips_foreign_load_csv_get_type()); + + static VipsForeignFlags +-vips_foreign_load_csv_file_get_flags_filename( const char *filename ) ++vips_foreign_load_csv_file_get_flags_filename(const char *filename) + { +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_csv_file_build( VipsObject *object ) ++vips_foreign_load_csv_file_build(VipsObject *object) + { + VipsForeignLoadCsv *csv = (VipsForeignLoadCsv *) object; + VipsForeignLoadCsvFile *file = (VipsForeignLoadCsvFile *) object; + +- if( file->filename ) +- if( !(csv->source = +- vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename) ++ if (!(csv->source = ++ vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_csv_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_csv_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static const char *vips_foreign_load_csv_suffs[] = { +@@ -571,9 +568,9 @@ static const char *vips_foreign_load_csv_suffs[] = { + }; + + static void +-vips_foreign_load_csv_file_class_init( VipsForeignLoadCsvFileClass *class ) ++vips_foreign_load_csv_file_class_init(VipsForeignLoadCsvFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -586,20 +583,19 @@ vips_foreign_load_csv_file_class_init( VipsForeignLoadCsvFileClass *class ) + + foreign_class->suffs = vips_foreign_load_csv_suffs; + +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_csv_file_get_flags_filename; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadCsvFile, filename ), +- NULL ); +- ++ G_STRUCT_OFFSET(VipsForeignLoadCsvFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_csv_file_init( VipsForeignLoadCsvFile *file ) ++vips_foreign_load_csv_file_init(VipsForeignLoadCsvFile *file) + { + } + +@@ -612,43 +608,42 @@ typedef struct _VipsForeignLoadCsvSource { + + typedef VipsForeignLoadCsvClass VipsForeignLoadCsvSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadCsvSource, vips_foreign_load_csv_source, +- vips_foreign_load_csv_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadCsvSource, vips_foreign_load_csv_source, ++ vips_foreign_load_csv_get_type()); + + static int +-vips_foreign_load_csv_source_build( VipsObject *object ) ++vips_foreign_load_csv_source_build(VipsObject *object) + { + VipsForeignLoadCsv *csv = (VipsForeignLoadCsv *) object; + VipsForeignLoadCsvSource *source = (VipsForeignLoadCsvSource *) object; + +- if( source->source ) { ++ if (source->source) { + csv->source = source->source; +- g_object_ref( csv->source ); ++ g_object_ref(csv->source); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_csv_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_csv_source_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_csv_source_is_a_source( VipsSource *source ) ++vips_foreign_load_csv_source_is_a_source(VipsSource *source) + { + /* Detecting CSV files automatically is tricky. Define this method to + * prevent a warning, but users will need to run the csv loader + * explicitly. + */ +- return( FALSE ); ++ return (FALSE); + } + + static void +-vips_foreign_load_csv_source_class_init( VipsForeignLoadCsvFileClass *class ) ++vips_foreign_load_csv_source_class_init(VipsForeignLoadCsvFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -661,17 +656,16 @@ vips_foreign_load_csv_source_class_init( VipsForeignLoadCsvFileClass *class ) + + load_class->is_a_source = vips_foreign_load_csv_source_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadCsvSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadCsvSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_csv_source_init( VipsForeignLoadCsvSource *source ) ++vips_foreign_load_csv_source_init(VipsForeignLoadCsvSource *source) + { + } + +@@ -689,26 +683,26 @@ vips_foreign_load_csv_source_init( VipsForeignLoadCsvSource *source ) + * * @separator: set of separator characters + * * @fail_on: #VipsFailOn, types of read error to fail on + * +- * Load a CSV (comma-separated values) file. The output image is always 1 ++ * Load a CSV (comma-separated values) file. The output image is always 1 + * band (monochrome), #VIPS_FORMAT_DOUBLE. Use vips_bandfold() to turn +- * RGBRGBRGB mono images into colour iamges. ++ * RGBRGBRGB mono images into colour iamges. + * +- * Items in lines can be either floating point numbers in the C locale, or ++ * Items in lines can be either floating point numbers in the C locale, or + * strings enclosed in double-quotes ("), or empty. + * You can use a backslash (\) within the quotes to escape special characters, + * such as quote marks. + * +- * @skip sets the number of lines to skip at the start of the file. ++ * @skip sets the number of lines to skip at the start of the file. + * Default zero. + * +- * @lines sets the number of lines to read from the file. Default -1, ++ * @lines sets the number of lines to read from the file. Default -1, + * meaning read all lines to end of file. + * +- * @whitespace sets the skippable whitespace characters. ++ * @whitespace sets the skippable whitespace characters. + * Default space. + * Whitespace characters are always run together. + * +- * @separator sets the characters that separate fields. ++ * @separator sets the characters that separate fields. + * Default ;,tab. Separators are never run together. + * + * Use @fail_on to set the type of error that will cause load to fail. By +@@ -719,16 +713,16 @@ vips_foreign_load_csv_source_init( VipsForeignLoadCsvSource *source ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_csvload( const char *filename, VipsImage **out, ... ) ++vips_csvload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "csvload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("csvload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -745,22 +739,21 @@ vips_csvload( const char *filename, VipsImage **out, ... ) + * * @separator: set of separator characters + * * @fail_on: #VipsFailOn, types of read error to fail on + * +- * Exactly as vips_csvload(), but read from a source. ++ * Exactly as vips_csvload(), but read from a source. + * + * See also: vips_csvload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_csvload_source( VipsSource *source, VipsImage **out, ... ) ++vips_csvload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "csvload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("csvload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/foreign/csvsave.c b/libvips/foreign/csvsave.c +index a1c13e578c..cace5764b4 100644 +--- a/libvips/foreign/csvsave.c ++++ b/libvips/foreign/csvsave.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -61,126 +61,137 @@ typedef struct _VipsForeignSaveCsv { + + typedef VipsForeignSaveClass VipsForeignSaveCsvClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveCsv, vips_foreign_save_csv, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSaveCsv, vips_foreign_save_csv, ++ VIPS_TYPE_FOREIGN_SAVE); + + static void +-vips_foreign_save_csv_dispose( GObject *gobject ) ++vips_foreign_save_csv_dispose(GObject *gobject) + { + VipsForeignSaveCsv *csv = (VipsForeignSaveCsv *) gobject; + +- VIPS_UNREF( csv->target ); ++ VIPS_UNREF(csv->target); + +- G_OBJECT_CLASS( vips_foreign_save_csv_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_csv_parent_class)->dispose(gobject); + } + +-#define PRINT_INT( TYPE ) { \ +- TYPE *pt = (TYPE *) p; \ +- \ +- for( x = 0; x < image->Xsize; x++ ) { \ +- if( x > 0 ) \ +- vips_target_writes( csv->target, csv->separator ); \ +- vips_target_writef( csv->target, "%d", pt[x] ); \ +- } \ +-} ++#define PRINT_INT(TYPE) \ ++ { \ ++ TYPE *pt = (TYPE *) p; \ ++\ ++ for (x = 0; x < image->Xsize; x++) { \ ++ if (x > 0) \ ++ vips_target_writes(csv->target, csv->separator); \ ++ vips_target_writef(csv->target, "%d", pt[x]); \ ++ } \ ++ } + +-#define PRINT_FLOAT( TYPE ) { \ +- TYPE *pt = (TYPE *) p; \ +- char buf[G_ASCII_DTOSTR_BUF_SIZE]; \ +- \ +- for( x = 0; x < image->Xsize; x++ ) { \ +- if( x > 0 ) \ +- vips_target_writes( csv->target, csv->separator ); \ +- g_ascii_dtostr( buf, G_ASCII_DTOSTR_BUF_SIZE, pt[x] ); \ +- vips_target_writes( csv->target, buf ); \ +- } \ +-} ++#define PRINT_FLOAT(TYPE) \ ++ { \ ++ TYPE *pt = (TYPE *) p; \ ++ char buf[G_ASCII_DTOSTR_BUF_SIZE]; \ ++\ ++ for (x = 0; x < image->Xsize; x++) { \ ++ if (x > 0) \ ++ vips_target_writes(csv->target, csv->separator); \ ++ g_ascii_dtostr(buf, G_ASCII_DTOSTR_BUF_SIZE, pt[x]); \ ++ vips_target_writes(csv->target, buf); \ ++ } \ ++ } + +-#define PRINT_COMPLEX( TYPE ) { \ +- TYPE *pt = (TYPE *) p; \ +- char buf[G_ASCII_DTOSTR_BUF_SIZE]; \ +- \ +- for( x = 0; x < image->Xsize; x++ ) { \ +- if( x > 0 ) \ +- vips_target_writes( csv->target, csv->separator ); \ +- VIPS_TARGET_PUTC( csv->target, '(' ); \ +- g_ascii_dtostr( buf, G_ASCII_DTOSTR_BUF_SIZE, pt[0] ); \ +- vips_target_writes( csv->target, buf ); \ +- VIPS_TARGET_PUTC( csv->target, ',' ); \ +- g_ascii_dtostr( buf, G_ASCII_DTOSTR_BUF_SIZE, pt[1] ); \ +- vips_target_writes( csv->target, buf ); \ +- VIPS_TARGET_PUTC( csv->target, ')' ); \ +- pt += 2; \ +- } \ +-} ++#define PRINT_COMPLEX(TYPE) \ ++ { \ ++ TYPE *pt = (TYPE *) p; \ ++ char buf[G_ASCII_DTOSTR_BUF_SIZE]; \ ++\ ++ for (x = 0; x < image->Xsize; x++) { \ ++ if (x > 0) \ ++ vips_target_writes(csv->target, csv->separator); \ ++ VIPS_TARGET_PUTC(csv->target, '('); \ ++ g_ascii_dtostr(buf, G_ASCII_DTOSTR_BUF_SIZE, pt[0]); \ ++ vips_target_writes(csv->target, buf); \ ++ VIPS_TARGET_PUTC(csv->target, ','); \ ++ g_ascii_dtostr(buf, G_ASCII_DTOSTR_BUF_SIZE, pt[1]); \ ++ vips_target_writes(csv->target, buf); \ ++ VIPS_TARGET_PUTC(csv->target, ')'); \ ++ pt += 2; \ ++ } \ ++ } + + static int +-vips_foreign_save_csv_block( VipsRegion *region, VipsRect *area, void *a ) ++vips_foreign_save_csv_block(VipsRegion *region, VipsRect *area, void *a) + { + VipsForeignSaveCsv *csv = (VipsForeignSaveCsv *) a; + VipsImage *image = region->im; + + int x, y; + +- for( y = 0; y < area->height; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( region, 0, area->top + y ); +- +- switch( image->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- PRINT_INT( unsigned char ); break; +- case VIPS_FORMAT_CHAR: +- PRINT_INT( char ); break; +- case VIPS_FORMAT_USHORT: +- PRINT_INT( unsigned short ); break; +- case VIPS_FORMAT_SHORT: +- PRINT_INT( short ); break; +- case VIPS_FORMAT_UINT: +- PRINT_INT( unsigned int ); break; +- case VIPS_FORMAT_INT: +- PRINT_INT( int ); break; +- case VIPS_FORMAT_FLOAT: +- PRINT_FLOAT( float ); break; +- case VIPS_FORMAT_DOUBLE: +- PRINT_FLOAT( double ); break; +- case VIPS_FORMAT_COMPLEX: +- PRINT_COMPLEX( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: +- PRINT_COMPLEX( double ); break; +- +- default: ++ for (y = 0; y < area->height; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(region, 0, area->top + y); ++ ++ switch (image->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ PRINT_INT(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ PRINT_INT(char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ PRINT_INT(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ PRINT_INT(short); ++ break; ++ case VIPS_FORMAT_UINT: ++ PRINT_INT(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ PRINT_INT(int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ PRINT_FLOAT(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ PRINT_FLOAT(double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ PRINT_COMPLEX(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ PRINT_COMPLEX(double); ++ break; ++ ++ default: + g_assert_not_reached(); + } + +- if( vips_target_writes( csv->target, "\n" ) ) +- return( -1 ); ++ if (vips_target_writes(csv->target, "\n")) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_csv_build( VipsObject *object ) ++vips_foreign_save_csv_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveCsv *csv = (VipsForeignSaveCsv *) object; +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_csv_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_csv_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_mono( class->nickname, save->ready ) || +- vips_check_uncoded( class->nickname, save->ready ) ) +- return( -1 ); ++ if (vips_check_mono(class->nickname, save->ready) || ++ vips_check_uncoded(class->nickname, save->ready)) ++ return (-1); + +- if( vips_sink_disc( save->ready, vips_foreign_save_csv_block, csv ) ) +- return( -1 ); ++ if (vips_sink_disc(save->ready, vips_foreign_save_csv_block, csv)) ++ return (-1); + +- if( vips_target_end( csv->target ) ) +- return( -1 ); ++ if (vips_target_end(csv->target)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static const char *vips_foreign_save_csv_suffs[] = { +@@ -189,9 +200,9 @@ static const char *vips_foreign_save_csv_suffs[] = { + }; + + static void +-vips_foreign_save_csv_class_init( VipsForeignSaveCsvClass *class ) ++vips_foreign_save_csv_class_init(VipsForeignSaveCsvClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; +@@ -201,56 +212,55 @@ vips_foreign_save_csv_class_init( VipsForeignSaveCsvClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "csvsave_base"; +- object_class->description = _( "save image to csv" ); ++ object_class->description = _("save image to csv"); + object_class->build = vips_foreign_save_csv_build; + + foreign_class->suffs = vips_foreign_save_csv_suffs; + + save_class->saveable = VIPS_SAVEABLE_MONO; + +- VIPS_ARG_STRING( class, "separator", 13, +- _( "Separator" ), +- _( "Separator characters" ), ++ VIPS_ARG_STRING(class, "separator", 13, ++ _("Separator"), ++ _("Separator characters"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveCsv, separator ), +- "\t" ); ++ G_STRUCT_OFFSET(VipsForeignSaveCsv, separator), ++ "\t"); + } + + static void +-vips_foreign_save_csv_init( VipsForeignSaveCsv *csv ) ++vips_foreign_save_csv_init(VipsForeignSaveCsv *csv) + { +- csv->separator = g_strdup( "\t" ); ++ csv->separator = g_strdup("\t"); + } + + typedef struct _VipsForeignSaveCsvFile { + VipsForeignSaveCsv parent_object; + +- char *filename; ++ char *filename; + } VipsForeignSaveCsvFile; + + typedef VipsForeignSaveCsvClass VipsForeignSaveCsvFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveCsvFile, vips_foreign_save_csv_file, +- vips_foreign_save_csv_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveCsvFile, vips_foreign_save_csv_file, ++ vips_foreign_save_csv_get_type()); + + static int +-vips_foreign_save_csv_file_build( VipsObject *object ) ++vips_foreign_save_csv_file_build(VipsObject *object) + { + VipsForeignSaveCsv *csv = (VipsForeignSaveCsv *) object; + VipsForeignSaveCsvFile *file = (VipsForeignSaveCsvFile *) object; + +- if( file->filename && +- !(csv->target = vips_target_new_to_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(csv->target = vips_target_new_to_file(file->filename))) ++ return (-1); + +- return( VIPS_OBJECT_CLASS( vips_foreign_save_csv_file_parent_class )-> +- build( object ) ); ++ return (VIPS_OBJECT_CLASS(vips_foreign_save_csv_file_parent_class)->build(object)); + } + + static void +-vips_foreign_save_csv_file_class_init( VipsForeignSaveCsvFileClass *class ) ++vips_foreign_save_csv_file_class_init(VipsForeignSaveCsvFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -259,17 +269,16 @@ vips_foreign_save_csv_file_class_init( VipsForeignSaveCsvFileClass *class ) + object_class->nickname = "csvsave"; + object_class->build = vips_foreign_save_csv_file_build; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveCsvFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveCsvFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_csv_file_init( VipsForeignSaveCsvFile *file ) ++vips_foreign_save_csv_file_init(VipsForeignSaveCsvFile *file) + { + } + +@@ -281,28 +290,27 @@ typedef struct _VipsForeignSaveCsvTarget { + + typedef VipsForeignSaveCsvClass VipsForeignSaveCsvTargetClass; + +-G_DEFINE_TYPE( VipsForeignSaveCsvTarget, vips_foreign_save_csv_target, +- vips_foreign_save_csv_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveCsvTarget, vips_foreign_save_csv_target, ++ vips_foreign_save_csv_get_type()); + + static int +-vips_foreign_save_csv_target_build( VipsObject *object ) ++vips_foreign_save_csv_target_build(VipsObject *object) + { + VipsForeignSaveCsv *csv = (VipsForeignSaveCsv *) object; + VipsForeignSaveCsvTarget *target = (VipsForeignSaveCsvTarget *) object; + +- if( target->target ) { +- csv->target = target->target; +- g_object_ref( csv->target ); ++ if (target->target) { ++ csv->target = target->target; ++ g_object_ref(csv->target); + } + +- return( VIPS_OBJECT_CLASS( vips_foreign_save_csv_target_parent_class )-> +- build( object ) ); ++ return (VIPS_OBJECT_CLASS(vips_foreign_save_csv_target_parent_class)->build(object)); + } + + static void +-vips_foreign_save_csv_target_class_init( VipsForeignSaveCsvTargetClass *class ) ++vips_foreign_save_csv_target_class_init(VipsForeignSaveCsvTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -311,23 +319,22 @@ vips_foreign_save_csv_target_class_init( VipsForeignSaveCsvTargetClass *class ) + object_class->nickname = "csvsave_target"; + object_class->build = vips_foreign_save_csv_target_build; + +- VIPS_ARG_OBJECT( class, "target", 1, +- _( "Target" ), +- _( "Target to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveCsvTarget, target ), +- VIPS_TYPE_TARGET ); +- ++ VIPS_ARG_OBJECT(class, "target", 1, ++ _("Target"), ++ _("Target to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveCsvTarget, target), ++ VIPS_TYPE_TARGET); + } + + static void +-vips_foreign_save_csv_target_init( VipsForeignSaveCsvTarget *target ) ++vips_foreign_save_csv_target_init(VipsForeignSaveCsvTarget *target) + { + } + + /** + * vips_csvsave: (method) +- * @in: image to save ++ * @in: image to save + * @filename: file to write to + * @...: %NULL-terminated list of optional named arguments + * +@@ -337,11 +344,11 @@ vips_foreign_save_csv_target_init( VipsForeignSaveCsvTarget *target ) + * + * Writes the pixels in @in to the @filename as CSV (comma-separated values). + * The image is written +- * one line of text per scanline. Complex numbers are written as ++ * one line of text per scanline. Complex numbers are written as + * "(real,imaginary)" and will need extra parsing I guess. Only the first band +- * is written. ++ * is written. + * +- * @separator gives the string to use to separate numbers in the output. ++ * @separator gives the string to use to separate numbers in the output. + * The default is "\\t" (tab). + * + * See also: vips_image_write_to_file(). +@@ -349,21 +356,21 @@ vips_foreign_save_csv_target_init( VipsForeignSaveCsvTarget *target ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_csvsave( VipsImage *in, const char *filename, ... ) ++vips_csvsave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "csvsave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("csvsave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_csvsave_target: (method) +- * @in: image to save ++ * @in: image to save + * @target: save image to this target + * @...: %NULL-terminated list of optional named arguments + * +@@ -378,14 +385,14 @@ vips_csvsave( VipsImage *in, const char *filename, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_csvsave_target( VipsImage *in, VipsTarget *target, ... ) ++vips_csvsave_target(VipsImage *in, VipsTarget *target, ...) + { + va_list ap; + int result; + +- va_start( ap, target ); +- result = vips_call_split( "csvsave_target", ap, in, target ); +- va_end( ap ); ++ va_start(ap, target); ++ result = vips_call_split("csvsave_target", ap, in, target); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/dbh.h b/libvips/foreign/dbh.h +index f3f567919a..d016acdaff 100644 +--- a/libvips/foreign/dbh.h ++++ b/libvips/foreign/dbh.h +@@ -1,5 +1,5 @@ + /* +- * ++ * + * (c) Copyright, 1986-1991 + * Biodynamics Research Unit + * Mayo Foundation +@@ -20,71 +20,71 @@ + * + */ + +-struct header_key /* header_key */ +- { /* off + size*/ +- int sizeof_hdr; /* 0 + 4 */ +- char data_type[10]; /* 4 + 10 */ +- char db_name[18]; /* 14 + 18 */ +- int extents; /* 32 + 4 */ +- short int session_error; /* 36 + 2 */ +- char regular; /* 38 + 1 */ +- char hkey_un0; /* 39 + 1 */ +- }; /* total=40 */ ++struct header_key /* header_key */ ++{ /* off + size*/ ++ int sizeof_hdr; /* 0 + 4 */ ++ char data_type[10]; /* 4 + 10 */ ++ char db_name[18]; /* 14 + 18 */ ++ int extents; /* 32 + 4 */ ++ short int session_error; /* 36 + 2 */ ++ char regular; /* 38 + 1 */ ++ char hkey_un0; /* 39 + 1 */ ++}; /* total=40 */ ++ ++struct image_dimension /* image_dimension */ ++{ /* off + size*/ ++ short int dim[8]; /* 0 + 16 */ ++ char vox_units[4]; /* 16 + 4 */ ++ char cal_units[8]; /* 20 + 4 */ ++ short int unused1; /* 24 + 2 */ ++ short int datatype; /* 30 + 2 */ ++ short int bitpix; /* 32 + 2 */ ++ short int dim_un0; /* 34 + 2 */ ++ float pixdim[8]; /* 36 + 32 */ + +-struct image_dimension /* image_dimension */ +- { /* off + size*/ +- short int dim[8]; /* 0 + 16 */ +- char vox_units[4]; /* 16 + 4 */ +- char cal_units[8]; /* 20 + 4 */ +- short int unused1; /* 24 + 2 */ +- short int datatype; /* 30 + 2 */ +- short int bitpix; /* 32 + 2 */ +- short int dim_un0; /* 34 + 2 */ +- float pixdim[8]; /* 36 + 32 */ +- +- /* pixdim[] specifies the voxel dimensions: +- pixdim[1] - voxel width +- pixdim[2] - voxel height +- pixdim[3] - interslice distance +- ..etc +- */ +- float vox_offset; /* 68 + 4 */ +- float funused1; /* 72 + 4 */ +- float funused2; /* 76 + 4 */ +- float funused3; /* 80 + 4 */ +- float cal_max; /* 84 + 4 */ +- float cal_min; /* 88 + 4 */ +- int compressed; /* 92 + 4 */ +- int verified; /* 96 + 4 */ +- int glmax, glmin; /* 100 + 8 */ +- }; ++ /* pixdim[] specifies the voxel dimensions: ++ pixdim[1] - voxel width ++ pixdim[2] - voxel height ++ pixdim[3] - interslice distance ++ ..etc ++ */ ++ float vox_offset; /* 68 + 4 */ ++ float funused1; /* 72 + 4 */ ++ float funused2; /* 76 + 4 */ ++ float funused3; /* 80 + 4 */ ++ float cal_max; /* 84 + 4 */ ++ float cal_min; /* 88 + 4 */ ++ int compressed; /* 92 + 4 */ ++ int verified; /* 96 + 4 */ ++ int glmax, glmin; /* 100 + 8 */ ++}; + +-struct data_history /* data_history */ +- { /* off + size*/ +- char descrip[80]; /* 0 + 80 */ +- char aux_file[24]; /* 80 + 24 */ +- char orient; /* 104 + 1 */ +- char originator[10]; /* 105 + 10 */ +- char generated[10]; /* 115 + 10 */ +- char scannum[10]; /* 125 + 10 */ +- char patient_id[10]; /* 135 + 10 */ +- char exp_date[10]; /* 145 + 10 */ +- char exp_time[10]; /* 155 + 10 */ +- char hist_un0[3]; /* 165 + 3 */ +- int views; /* 168 + 4 */ +- int vols_added; /* 172 + 4 */ +- int start_field; /* 176 + 4 */ +- int field_skip; /* 180 + 4 */ +- int omax,omin; /* 184 + 8 */ +- int smax,smin; /* 192 + 8 */ +- }; /* total=200 */ ++struct data_history /* data_history */ ++{ /* off + size*/ ++ char descrip[80]; /* 0 + 80 */ ++ char aux_file[24]; /* 80 + 24 */ ++ char orient; /* 104 + 1 */ ++ char originator[10]; /* 105 + 10 */ ++ char generated[10]; /* 115 + 10 */ ++ char scannum[10]; /* 125 + 10 */ ++ char patient_id[10]; /* 135 + 10 */ ++ char exp_date[10]; /* 145 + 10 */ ++ char exp_time[10]; /* 155 + 10 */ ++ char hist_un0[3]; /* 165 + 3 */ ++ int views; /* 168 + 4 */ ++ int vols_added; /* 172 + 4 */ ++ int start_field; /* 176 + 4 */ ++ int field_skip; /* 180 + 4 */ ++ int omax, omin; /* 184 + 8 */ ++ int smax, smin; /* 192 + 8 */ ++}; /* total=200 */ + +-struct dsr /* dsr */ +- { /* off + size*/ +- struct header_key hk; /* 0 + 40 */ +- struct image_dimension dime; /* 40 + 108 */ +- struct data_history hist; /* 148 + 200 */ +- }; /* total=348 */ ++struct dsr /* dsr */ ++{ /* off + size*/ ++ struct header_key hk; /* 0 + 40 */ ++ struct image_dimension dime; /* 40 + 108 */ ++ struct data_history hist; /* 148 + 200 */ ++}; /* total=348 */ + + /* Acceptable values for hdr.dime.datatype */ + +@@ -95,11 +95,11 @@ struct dsr /* dsr */ + #define DT_UNKNOWN 0 + */ + +-#define DT_BINARY 1 +-#define DT_UNSIGNED_CHAR 2 +-#define DT_SIGNED_SHORT 4 +-#define DT_SIGNED_INT 8 +-#define DT_FLOAT 16 +-#define DT_COMPLEX 32 +-#define DT_DOUBLE 64 +-#define DT_RGB 128 ++#define DT_BINARY 1 ++#define DT_UNSIGNED_CHAR 2 ++#define DT_SIGNED_SHORT 4 ++#define DT_SIGNED_INT 8 ++#define DT_FLOAT 16 ++#define DT_COMPLEX 32 ++#define DT_DOUBLE 64 ++#define DT_RGB 128 +diff --git a/libvips/foreign/dzsave.c b/libvips/foreign/dzsave.c +index d95d69cfef..778c3bc8f2 100644 +--- a/libvips/foreign/dzsave.c ++++ b/libvips/foreign/dzsave.c +@@ -3,9 +3,9 @@ + * 21/3/12 + * - from the tiff pyramid writer + * 5/7/12 (thanks Alexander Koshman) +- * - make tiles down to 1x1 pixels +- * - oop make right-hand edge tiles +- * - improve overlap handling ++ * - make tiles down to 1x1 pixels ++ * - oop make right-hand edge tiles ++ * - improve overlap handling + * 7/7/12 + * - threaded write + * 6/8/12 (thanks to Benjamin Gilbert for pointing out the errors) +@@ -16,7 +16,7 @@ + * 7/8/12 (thanks to Benjamin Gilbert again for more testing) + * - reorganise the directory structure + * - rename to basename and tile_size +- * - deprecate tile_width/_height and dirname ++ * - deprecate tile_width/_height and dirname + * 1/10/12 + * - did not write low pyramid layers for images with an odd number of + * scan lines (thanks Martin) +@@ -54,11 +54,11 @@ + * 8/8/15 + * - allow zip > 4gb if we have a recent libgsf + * 9/9/15 +- * - better overlap handling, thanks robclouth ++ * - better overlap handling, thanks robclouth + * 24/11/15 + * - don't write almost blank tiles in google mode + * 25/11/15 +- * - always strip tile metadata ++ * - always strip tile metadata + * 16/12/15 + * - fix overlap handling again, thanks erdmann + * 8/6/16 Felix Bünemann +@@ -100,28 +100,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -129,9 +129,9 @@ + + This is difficult to test, there are so many options. + +- It's failed in the past in these cases. These have layers with strips which +- exactly align with image edges, or which have orphan scanlines which need +- adding for the shrink. ++ It's failed in the past in these cases. These have layers with strips which ++ exactly align with image edges, or which have orphan scanlines which need ++ adding for the shrink. + + 1. $ header test.v + test.v: 14016x16448 uchar, 3 bands, srgb, openin VipsImage (0x11e7060) +@@ -139,26 +139,26 @@ + + Not all layers written. + +- 2. $ header ~/Desktop/leicaimage.scn ++ 2. $ header ~/Desktop/leicaimage.scn + /home/john/Desktop/leicaimage.scn: 4225x7905 uchar, 4 bands, rgb + +- Not all layers written. ++ Not all layers written. + +- 3. $ header ~/leicatest1.scn ++ 3. $ header ~/leicatest1.scn + /home/john/leicatest1.scn: 11585x8449 uchar, 4 bands, rgb + +- Not all layers written. ++ Not all layers written. + + various combinations of odd and even tile-size and overlap need testing too. + + Overlap handling + +- For deepzoom, tile-size == 254 and overlap == 1 means that edge tiles are +- 255 x 255 (though less at the bottom right) and non-edge tiles are 256 x +- 256. Tiles are positioned across the image in tile-size steps. This means ++ For deepzoom, tile-size == 254 and overlap == 1 means that edge tiles are ++ 255 x 255 (though less at the bottom right) and non-edge tiles are 256 x ++ 256. Tiles are positioned across the image in tile-size steps. This means + (confusingly) that two adjoining tiles will have two pixels in common. + +- This has caused bugs in the past. ++ This has caused bugs in the past. + + */ + +@@ -195,114 +195,120 @@ + */ + + typedef struct _GsfOutputTarget { +- GsfOutput output; ++ GsfOutput output; + +- VipsTarget *target; ++ VipsTarget *target; + + } GsfOutputTarget; + + typedef struct { +- GsfOutputClass output_class; ++ GsfOutputClass output_class; + } GsfOutputTargetClass; + +-G_DEFINE_TYPE( GsfOutputTarget, gsf_output_target, GSF_OUTPUT_TYPE ); ++G_DEFINE_TYPE(GsfOutputTarget, gsf_output_target, GSF_OUTPUT_TYPE); + + static gboolean +-gsf_output_target_close( GsfOutput *output ) ++gsf_output_target_close(GsfOutput *output) + { +- GsfOutputTarget *output_target = (GsfOutputTarget *) output; ++ GsfOutputTarget *output_target = (GsfOutputTarget *) output; + +- if( output_target->target ) { ++ if (output_target->target) { + /* No easy way to report errors here, sadly. + */ +- (void) vips_target_end( output_target->target ); +- VIPS_UNREF( output_target->target ); ++ (void) vips_target_end(output_target->target); ++ VIPS_UNREF(output_target->target); + +- return( TRUE ); +- } ++ return (TRUE); ++ } + +- return( FALSE ); ++ return (FALSE); + } + + static void +-gsf_output_target_finalize( GObject *obj ) ++gsf_output_target_finalize(GObject *obj) + { +- GsfOutputTarget *output_target = (GsfOutputTarget *) obj; ++ GsfOutputTarget *output_target = (GsfOutputTarget *) obj; + +- (void) gsf_output_target_close( GSF_OUTPUT( output_target ) ); ++ (void) gsf_output_target_close(GSF_OUTPUT(output_target)); + +- G_OBJECT_CLASS( gsf_output_target_parent_class )->finalize( obj ); ++ G_OBJECT_CLASS(gsf_output_target_parent_class)->finalize(obj); + } + + static gboolean +-gsf_output_target_write( GsfOutput *output, +- size_t num_bytes, guint8 const *buffer ) ++gsf_output_target_write(GsfOutput *output, ++ size_t num_bytes, guint8 const *buffer) + { +- GsfOutputTarget *output_target = (GsfOutputTarget *) output; ++ GsfOutputTarget *output_target = (GsfOutputTarget *) output; + +- if( vips_target_write( output_target->target, buffer, num_bytes ) ) +- return( FALSE ); ++ if (vips_target_write(output_target->target, buffer, num_bytes)) ++ return (FALSE); + +- return( TRUE ); ++ return (TRUE); + } + + static gboolean +-gsf_output_target_seek( GsfOutput *output, gsf_off_t offset, GSeekType whence ) ++gsf_output_target_seek(GsfOutput *output, gsf_off_t offset, GSeekType whence) + { + #ifdef HAVE_GSF_ZIP64 + /* No seek needed. + */ +- return( FALSE ); ++ return (FALSE); + #else + GsfOutputTarget *output_target = (GsfOutputTarget *) output; + int stdio_whence; + +- switch( whence ) { +- case G_SEEK_CUR: stdio_whence = SEEK_CUR; break; +- case G_SEEK_END: stdio_whence = SEEK_END; break; +- case G_SEEK_SET: stdio_whence = SEEK_SET; break; ++ switch (whence) { ++ case G_SEEK_CUR: ++ stdio_whence = SEEK_CUR; ++ break; ++ case G_SEEK_END: ++ stdio_whence = SEEK_END; ++ break; ++ case G_SEEK_SET: ++ stdio_whence = SEEK_SET; ++ break; + default: + g_assert_not_reached(); + } + +- if( vips_target_seek( output_target->target, +- offset, stdio_whence ) == -1 ) +- return( FALSE ); ++ if (vips_target_seek(output_target->target, ++ offset, stdio_whence) == -1) ++ return (FALSE); + + /* This will make our parent class handle the seek. + */ +- return( TRUE ); ++ return (TRUE); + #endif + } + + static void +-gsf_output_target_init( GsfOutputTarget *output ) ++gsf_output_target_init(GsfOutputTarget *output) + { + } + + static void +-gsf_output_target_class_init( GsfOutputTargetClass *class ) ++gsf_output_target_class_init(GsfOutputTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- GsfOutputClass *output_class = GSF_OUTPUT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ GsfOutputClass *output_class = GSF_OUTPUT_CLASS(class); + +- gobject_class->finalize = gsf_output_target_finalize; ++ gobject_class->finalize = gsf_output_target_finalize; + +- output_class->Close = gsf_output_target_close; +- output_class->Write = gsf_output_target_write; +- output_class->Seek = gsf_output_target_seek; ++ output_class->Close = gsf_output_target_close; ++ output_class->Write = gsf_output_target_write; ++ output_class->Seek = gsf_output_target_seek; + } + + static GsfOutput * +-gsf_output_target_new( VipsTarget *target ) ++gsf_output_target_new(VipsTarget *target) + { + GsfOutputTarget *output; + +- output = g_object_new( gsf_output_target_get_type(), NULL ); ++ output = g_object_new(gsf_output_target_get_type(), NULL); + output->target = target; +- g_object_ref( target ); ++ g_object_ref(target); + +- return( GSF_OUTPUT( output ) ); ++ return (GSF_OUTPUT(output)); + } + + /* A GSF output object that can write to a directory. +@@ -319,81 +325,81 @@ typedef struct { + GsfOutfileClass output_class; + } GsfOutputDirClass; + +-G_DEFINE_TYPE( GsfOutputDir, gsf_output_dir, GSF_OUTFILE_TYPE ); ++G_DEFINE_TYPE(GsfOutputDir, gsf_output_dir, GSF_OUTFILE_TYPE); + + static gboolean +-gsf_output_dir_close( GsfOutput *output ) ++gsf_output_dir_close(GsfOutput *output) + { +- return( TRUE ); ++ return (TRUE); + } + + static void +-gsf_output_dir_finalize( GObject *obj ) ++gsf_output_dir_finalize(GObject *obj) + { + GsfOutputDir *output_dir = (GsfOutputDir *) obj; + +- g_free( output_dir->root ); ++ g_free(output_dir->root); + +- G_OBJECT_CLASS( gsf_output_dir_parent_class )->finalize( obj ); ++ G_OBJECT_CLASS(gsf_output_dir_parent_class)->finalize(obj); + } + + static GsfOutfile * +-gsf_output_dir_new_valist( char const *root, +- char const *first_property_name, va_list var_args ) ++gsf_output_dir_new_valist(char const *root, ++ char const *first_property_name, va_list var_args) + { + GsfOutputDir *output_dir; + +- if( g_mkdir( root, 0777 ) != 0 && errno != EEXIST ) { ++ if (g_mkdir(root, 0777) != 0 && errno != EEXIST) { + int save_errno = errno; +- char *utf8name = g_filename_display_name( root ); +- vips_error( "dzsave", +- _( "unable to create directory \"%s\", %s" ), +- utf8name, g_strerror( save_errno ) ); +- g_free( utf8name ); +- return( NULL ); ++ char *utf8name = g_filename_display_name(root); ++ vips_error("dzsave", ++ _("unable to create directory \"%s\", %s"), ++ utf8name, g_strerror(save_errno)); ++ g_free(utf8name); ++ return (NULL); + } + +- output_dir = (GsfOutputDir *) g_object_new_valist( GSF_OUTFILE_STDIO_TYPE, +- first_property_name, var_args ); +- output_dir->root = g_strdup( root ); +- gsf_output_set_name_from_filename( GSF_OUTPUT( output_dir ), root ); ++ output_dir = (GsfOutputDir *) g_object_new_valist(GSF_OUTFILE_STDIO_TYPE, ++ first_property_name, var_args); ++ output_dir->root = g_strdup(root); ++ gsf_output_set_name_from_filename(GSF_OUTPUT(output_dir), root); + +- return( GSF_OUTFILE( output_dir ) ); ++ return (GSF_OUTFILE(output_dir)); + } + + static GsfOutput * +-gsf_output_dir_new_child( GsfOutfile *parent, ++gsf_output_dir_new_child(GsfOutfile *parent, + char const *name, gboolean is_dir, + char const *first_property_name, +- va_list args ) ++ va_list args) + { + GsfOutputDir *output_dir = (GsfOutputDir *) parent; + GsfOutput *child; +- char *path = g_build_filename( output_dir->root, name, NULL ); ++ char *path = g_build_filename(output_dir->root, name, NULL); + +- if( is_dir ) +- child = (GsfOutput *) gsf_output_dir_new_valist( path, +- first_property_name, args ); ++ if (is_dir) ++ child = (GsfOutput *) gsf_output_dir_new_valist(path, ++ first_property_name, args); + else +- child = gsf_output_stdio_new_valist( path, NULL, +- first_property_name, args ); +- g_free( path ); ++ child = gsf_output_stdio_new_valist(path, NULL, ++ first_property_name, args); ++ g_free(path); + +- return( child ); ++ return (child); + } + + static void +-gsf_output_dir_init( GsfOutputDir *output ) ++gsf_output_dir_init(GsfOutputDir *output) + { + output->root = NULL; + } + + static void +-gsf_output_dir_class_init( GsfOutputDirClass *class ) ++gsf_output_dir_class_init(GsfOutputDirClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- GsfOutputClass *output_class = GSF_OUTPUT_CLASS( class ); +- GsfOutfileClass *outfile_class = GSF_OUTFILE_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ GsfOutputClass *output_class = GSF_OUTPUT_CLASS(class); ++ GsfOutfileClass *outfile_class = GSF_OUTFILE_CLASS(class); + + gobject_class->finalize = gsf_output_dir_finalize; + +@@ -406,16 +412,16 @@ gsf_output_dir_class_init( GsfOutputDirClass *class ) + } + + static GsfOutput * +-gsf_output_dir_new( char const *root, ... ) ++gsf_output_dir_new(char const *root, ...) + { + GsfOutfile *output; + va_list var_args; + +- va_start( var_args, root ); +- output = gsf_output_dir_new_valist( root, NULL, var_args ); +- va_end( var_args ); ++ va_start(var_args, root); ++ output = gsf_output_dir_new_valist(root, NULL, var_args); ++ va_end(var_args); + +- return( GSF_OUTPUT( output ) ); ++ return (GSF_OUTPUT(output)); + } + + /* Simple wrapper around libgsf. +@@ -432,7 +438,7 @@ gsf_output_dir_new( char const *root, ... ) + /* Need to track the directory tree we are writing, with a ref for each + * GsfOutput. + */ +-typedef struct _VipsGsfDirectory { ++typedef struct _VipsGsfDirectory { + struct _VipsGsfDirectory *parent; + char *name; + +@@ -447,7 +453,7 @@ typedef struct _VipsGsfDirectory { + /* The root node holds the enclosing zip file or FS root ... finish + * this on cleanup. + */ +- GsfOutput *container; ++ GsfOutput *container; + + /* Track number of files in tree and total length of filenames. We use + * this to estimate zip size to spot a >4gb write. +@@ -459,60 +465,60 @@ typedef struct _VipsGsfDirectory { + */ + gint deflate_level; + +-} VipsGsfDirectory; ++} VipsGsfDirectory; + +-static void *vips_gsf_tree_close( VipsGsfDirectory *tree ); ++static void *vips_gsf_tree_close(VipsGsfDirectory *tree); + + static void * +-vips_gsf_tree_close_cb( void *item, void *a, void *b ) ++vips_gsf_tree_close_cb(void *item, void *a, void *b) + { + VipsGsfDirectory *tree = (VipsGsfDirectory *) item; + +- return( vips_gsf_tree_close( tree ) ); ++ return (vips_gsf_tree_close(tree)); + } + + /* Close all dirs, non-NULL on error. + */ + static void * +-vips_gsf_tree_close( VipsGsfDirectory *tree ) ++vips_gsf_tree_close(VipsGsfDirectory *tree) + { +- vips_slist_map2( tree->children, vips_gsf_tree_close_cb, NULL, NULL ); ++ vips_slist_map2(tree->children, vips_gsf_tree_close_cb, NULL, NULL); + +- if( tree->out ) { +- if( !gsf_output_is_closed( tree->out ) && +- !gsf_output_close( tree->out ) ) { +- vips_error( "vips_gsf", +- "%s", _( "unable to close stream" ) ); +- return( tree ); ++ if (tree->out) { ++ if (!gsf_output_is_closed(tree->out) && ++ !gsf_output_close(tree->out)) { ++ vips_error("vips_gsf", ++ "%s", _("unable to close stream")); ++ return (tree); + } + +- VIPS_UNREF( tree->out ); ++ VIPS_UNREF(tree->out); + } + +- if( tree->container ) { +- if( !gsf_output_is_closed( tree->container ) && +- !gsf_output_close( tree->container ) ) { +- vips_error( "vips_gsf", +- "%s", _( "unable to close stream" ) ); +- return( tree ); ++ if (tree->container) { ++ if (!gsf_output_is_closed(tree->container) && ++ !gsf_output_close(tree->container)) { ++ vips_error("vips_gsf", ++ "%s", _("unable to close stream")); ++ return (tree); + } + +- VIPS_UNREF( tree->container ); ++ VIPS_UNREF(tree->container); + } + +- VIPS_FREEF( g_slist_free, tree->children ); +- VIPS_FREE( tree->name ); +- VIPS_FREE( tree ); ++ VIPS_FREEF(g_slist_free, tree->children); ++ VIPS_FREE(tree->name); ++ VIPS_FREE(tree); + +- return( NULL ); ++ return (NULL); + } + + /* Make a new tree root. + */ + static VipsGsfDirectory * +-vips_gsf_tree_new( GsfOutput *out, gint deflate_level ) ++vips_gsf_tree_new(GsfOutput *out, gint deflate_level) + { +- VipsGsfDirectory *tree = g_new( VipsGsfDirectory, 1 ); ++ VipsGsfDirectory *tree = g_new(VipsGsfDirectory, 1); + + tree->parent = NULL; + tree->name = NULL; +@@ -523,61 +529,61 @@ vips_gsf_tree_new( GsfOutput *out, gint deflate_level ) + tree->filename_lengths = 0; + tree->deflate_level = deflate_level; + +- return( tree ); ++ return (tree); + } + + static void * +-vips_gsf_child_by_name_sub( VipsGsfDirectory *dir, const char *name, void *b ) ++vips_gsf_child_by_name_sub(VipsGsfDirectory *dir, const char *name, void *b) + { +- if( strcmp( dir->name, name ) == 0 ) +- return( dir ); ++ if (strcmp(dir->name, name) == 0) ++ return (dir); + +- return( NULL ); ++ return (NULL); + } + + /* Look up a child by name. + */ + static VipsGsfDirectory * +-vips_gsf_child_by_name( VipsGsfDirectory *dir, const char *name ) ++vips_gsf_child_by_name(VipsGsfDirectory *dir, const char *name) + { +- return( vips_slist_map2( dir->children, +- (VipsSListMap2Fn) vips_gsf_child_by_name_sub, +- (char *) name, NULL ) ); ++ return (vips_slist_map2(dir->children, ++ (VipsSListMap2Fn) vips_gsf_child_by_name_sub, ++ (char *) name, NULL)); + } + + /* Make a new directory. + */ + static VipsGsfDirectory * +-vips_gsf_dir_new( VipsGsfDirectory *parent, const char *name ) ++vips_gsf_dir_new(VipsGsfDirectory *parent, const char *name) + { +- VipsGsfDirectory *dir = g_new( VipsGsfDirectory, 1 ); ++ VipsGsfDirectory *dir = g_new(VipsGsfDirectory, 1); + +- g_assert( !vips_gsf_child_by_name( parent, name ) ); ++ g_assert(!vips_gsf_child_by_name(parent, name)); + + dir->parent = parent; +- dir->name = g_strdup( name ); ++ dir->name = g_strdup(name); + dir->children = NULL; + dir->container = NULL; + dir->file_count = 0; + dir->filename_lengths = 0; + dir->deflate_level = parent->deflate_level; + +- if( GSF_IS_OUTFILE_ZIP( parent->out ) ) +- dir->out = gsf_outfile_new_child_full( +- (GsfOutfile *) parent->out, ++ if (GSF_IS_OUTFILE_ZIP(parent->out)) ++ dir->out = gsf_outfile_new_child_full( ++ (GsfOutfile *) parent->out, + name, TRUE, + "compression-level", GSF_ZIP_STORED, +- NULL ); ++ NULL); + else +- dir->out = gsf_outfile_new_child( +- (GsfOutfile *) parent->out, +- name, TRUE ); ++ dir->out = gsf_outfile_new_child( ++ (GsfOutfile *) parent->out, ++ name, TRUE); + +- g_assert( dir->out ); ++ g_assert(dir->out); + +- parent->children = g_slist_prepend( parent->children, dir ); ++ parent->children = g_slist_prepend(parent->children, dir); + +- return( dir ); ++ return (dir); + } + + /* Return a GsfOutput for writing to a path. Paths are object name first, then +@@ -585,12 +591,12 @@ vips_gsf_dir_new( VipsGsfDirectory *parent, const char *name ) + * + * GsfOutput *obj = vips_gsf_path( tree, "fred.jpg", "a", "b", NULL ); + * +- * Returns an obj you can use to write to a/b/fred.jpg. ++ * Returns an obj you can use to write to a/b/fred.jpg. + * + * You must write, close and unref obj. + */ + static GsfOutput * +-vips_gsf_path( VipsGsfDirectory *tree, const char *name, ... ) ++vips_gsf_path(VipsGsfDirectory *tree, const char *name, ...) + { + va_list ap; + VipsGsfDirectory *dir; +@@ -603,51 +609,51 @@ vips_gsf_path( VipsGsfDirectory *tree, const char *name, ... ) + * path we are creating. + */ + tree->file_count += 1; +- tree->filename_lengths += +- strlen( tree->out->name ) + strlen( name ) + 1; ++ tree->filename_lengths += ++ strlen(tree->out->name) + strlen(name) + 1; + +- dir = tree; +- va_start( ap, name ); +- while( (dir_name = va_arg( ap, char * )) ) { +- if( (child = vips_gsf_child_by_name( dir, dir_name )) ) ++ dir = tree; ++ va_start(ap, name); ++ while ((dir_name = va_arg(ap, char *))) { ++ if ((child = vips_gsf_child_by_name(dir, dir_name))) + dir = child; +- else +- dir = vips_gsf_dir_new( dir, dir_name ); ++ else ++ dir = vips_gsf_dir_new(dir, dir_name); + +- tree->filename_lengths += strlen( dir_name ) + 1; ++ tree->filename_lengths += strlen(dir_name) + 1; + } +- va_end( ap ); ++ va_end(ap); + +- if( GSF_IS_OUTFILE_ZIP( dir->out ) ) { ++ if (GSF_IS_OUTFILE_ZIP(dir->out)) { + /* Confusingly, libgsf compression-level really means +- * compression-method. They have a separate deflate-level ++ * compression-method. They have a separate deflate-level + * property for the deflate compression level. + */ +- if( dir->deflate_level == 0 ) ++ if (dir->deflate_level == 0) + obj = gsf_outfile_new_child_full( + (GsfOutfile *) dir->out, + name, FALSE, + "compression-level", GSF_ZIP_STORED, +- NULL ); +- else if( dir->deflate_level == -1 ) ++ NULL); ++ else if (dir->deflate_level == -1) + obj = gsf_outfile_new_child_full( + (GsfOutfile *) dir->out, + name, FALSE, + "compression-level", GSF_ZIP_DEFLATED, +- NULL ); ++ NULL); + else + obj = gsf_outfile_new_child_full( + (GsfOutfile *) dir->out, + name, FALSE, + "compression-level", GSF_ZIP_DEFLATED, + "deflate-level", dir->deflate_level, +- NULL ); ++ NULL); + } + else +- obj = gsf_outfile_new_child( (GsfOutfile *) dir->out, +- name, FALSE ); ++ obj = gsf_outfile_new_child((GsfOutfile *) dir->out, ++ name, FALSE); + +- return( obj ); ++ return (obj); + } + + typedef struct _VipsForeignSaveDz VipsForeignSaveDz; +@@ -659,8 +665,8 @@ struct _Layer { + VipsForeignSaveDz *dz; + + /* The real size of the image. image->Xsize and image->Ysize are +- * always even to make x2 shrink easy. The real image may be a +- * smaller, odd size, ++ * always even to make x2 shrink easy. The real image may be a ++ * smaller, odd size, + */ + int width; + int height; +@@ -674,7 +680,7 @@ struct _Layer { + /* The rect within width/height that contains real image, as opposed + * to background. In centre mode we can have large image borders. + */ +- VipsRect real_pixels; ++ VipsRect real_pixels; + + /* The image we build. + */ +@@ -684,18 +690,18 @@ struct _Layer { + */ + int y; + +- /* The next line we write to in this strip. ++ /* The next line we write to in this strip. + */ + int write_y; + +- VipsRegion *strip; /* The current strip of pixels */ +- VipsRegion *copy; /* Pixels we copy to the next strip */ ++ VipsRegion *strip; /* The current strip of pixels */ ++ VipsRegion *copy; /* Pixels we copy to the next strip */ + +- int sub; /* Subsample factor for this layer */ +- int n; /* Layer number ... 0 for smallest */ ++ int sub; /* Subsample factor for this layer */ ++ int n; /* Layer number ... 0 for smallest */ + +- Layer *below; /* Tiles go to here */ +- Layer *above; /* Tiles come from here */ ++ Layer *below; /* Tiles go to here */ ++ Layer *above; /* Tiles come from here */ + }; + + struct _VipsForeignSaveDz { +@@ -717,7 +723,7 @@ struct _VipsForeignSaveDz { + gboolean centre; + gboolean properties; + VipsAngle angle; +- VipsForeignDzContainer container; ++ VipsForeignDzContainer container; + int compression; + VipsRegionShrink region_shrink; + int skip_blanks; +@@ -725,18 +731,18 @@ struct _VipsForeignSaveDz { + char *id; + + /* Tile and overlap geometry. The members above are the parameters we +- * accept, this next set are the derived values which are actually ++ * accept, this next set are the derived values which are actually + * used in pyramid generation. + * + * Tiles have a base tile_size. Imagine a square placed at the top left. + * This is the size of that square. + * +- * Tiles have a margin. The square from tile_size is expanded outward +- * up/down/left/right by this amount. Parts going off the image are +- * clipped. ++ * Tiles have a margin. The square from tile_size is expanded outward ++ * up/down/left/right by this amount. Parts going off the image are ++ * clipped. + * + * Each time we write a new tile, we step the position by tile_step +- * pixels. ++ * pixels. + * + * We need all three of tile_size, tile_margin and tile_step since + * deepzoom and google maps have different meanings for overlap and we +@@ -755,14 +761,14 @@ struct _VipsForeignSaveDz { + int tile_margin; + int tile_step; + +- Layer *layer; /* x2 shrink pyr layer */ ++ Layer *layer; /* x2 shrink pyr layer */ + + /* Count zoomify tiles we write. + */ + int tile_count; + + /* The tree structure we are writing tiles to. Can be filesystem, a +- * zipfile, etc. ++ * zipfile, etc. + */ + VipsGsfDirectory *tree; + +@@ -771,25 +777,25 @@ struct _VipsForeignSaveDz { + GsfOutput *out; + + /* The name to save as, eg. deepzoom tiles go into ${basename}_files. +- * No suffix, no path at the start. ++ * No suffix, no path at the start. + */ +- char *basename; ++ char *basename; + +- /* The directory we write the output to, or NULL for memory output. ++ /* The directory we write the output to, or NULL for memory output. + */ +- char *dirname; ++ char *dirname; + + /* The root directory name ... $basename with perhaps some extra + * stuff, eg. $(basename)_files, etc. + */ +- char *root_name; ++ char *root_name; + + /* @suffix, but without any options. So @suffix == ".jpg[Q=90]" + * becomes ".jpg". + */ + char *file_suffix; + +- /* libgsf before 1.14.31 can't write zip files larger than 4gb. ++ /* libgsf before 1.14.31 can't write zip files larger than 4gb. + * Track bytes written here and try to guess when we'll go over. + */ + size_t bytes_written; +@@ -798,13 +804,12 @@ struct _VipsForeignSaveDz { + * saving .. used to test for blank tiles. + */ + VipsPel *ink; +- + }; + + typedef VipsForeignSaveClass VipsForeignSaveDzClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveDz, vips_foreign_save_dz, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSaveDz, vips_foreign_save_dz, ++ VIPS_TYPE_FOREIGN_SAVE); + + #define VIPS_ZIP_FIXED_LH_SIZE (30 + 29) + #define VIPS_ZIP_FIXED_CD_SIZE (46 + 9) +@@ -814,20 +819,20 @@ G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveDz, vips_foreign_save_dz, + /* ZIP and SZI are both written as zip files. + */ + static gboolean +-iszip( VipsForeignDzContainer container ) ++iszip(VipsForeignDzContainer container) + { +- switch( container ) { ++ switch (container) { + case VIPS_FOREIGN_DZ_CONTAINER_ZIP: + case VIPS_FOREIGN_DZ_CONTAINER_SZI: +- return( TRUE ); ++ return (TRUE); + + default: +- return( FALSE ); ++ return (FALSE); + } + } + + static size_t +-estimate_zip_size( VipsForeignSaveDz *dz ) ++estimate_zip_size(VipsForeignSaveDz *dz) + { + size_t estimated_zip_size = dz->bytes_written + + dz->tree->file_count * VIPS_ZIP_FIXED_LH_SIZE + +@@ -837,18 +842,18 @@ estimate_zip_size( VipsForeignSaveDz *dz ) + VIPS_ZIP_EOCD_SIZE; + + #ifdef DEBUG_VERBOSE +- printf( "estimate_zip_size: %zd\n", estimated_zip_size ); ++ printf("estimate_zip_size: %zd\n", estimated_zip_size); + #endif /*DEBUG_VERBOSE*/ + +- return( estimated_zip_size ); ++ return (estimated_zip_size); + } + #endif /*HAVE_GSF_ZIP64*/ + + static int +-write_image( VipsForeignSaveDz *dz, +- GsfOutput *out, VipsImage *image, const char *format ) ++write_image(VipsForeignSaveDz *dz, ++ GsfOutput *out, VipsImage *image, const char *format) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( dz ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(dz); + + VipsImage *t; + void *buf; +@@ -858,116 +863,115 @@ write_image( VipsForeignSaveDz *dz, + * we need a copy of the tile in case it's shared (eg. associated + * images). + */ +- if( vips_copy( image, &t, NULL ) ) +- return( -1 ); ++ if (vips_copy(image, &t, NULL)) ++ return (-1); + + /* We default to stripping all metadata. "no_strip" turns this + * off. Most people don't want metadata on every tile. + */ +- vips_image_set_int( t, "hide-progress", 1 ); +- if( vips_image_write_to_buffer( t, format, &buf, &len, +- "strip", !dz->no_strip, +- NULL ) ) { +- VIPS_UNREF( t ); +- return( -1 ); ++ vips_image_set_int(t, "hide-progress", 1); ++ if (vips_image_write_to_buffer(t, format, &buf, &len, ++ "strip", !dz->no_strip, ++ NULL)) { ++ VIPS_UNREF(t); ++ return (-1); + } +- VIPS_UNREF( t ); ++ VIPS_UNREF(t); + + /* gsf doesn't like more than one write active at once. + */ +- g_mutex_lock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); + +- if( !gsf_output_write( out, len, buf ) ) { +- gsf_output_close( out ); +- g_mutex_unlock( vips__global_lock ); +- g_free( buf ); +- vips_error( class->nickname, +- "%s", gsf_output_error( out )->message ); ++ if (!gsf_output_write(out, len, buf)) { ++ gsf_output_close(out); ++ g_mutex_unlock(vips__global_lock); ++ g_free(buf); ++ vips_error(class->nickname, ++ "%s", gsf_output_error(out)->message); + +- return( -1 ); ++ return (-1); + } + + dz->bytes_written += len; + +- gsf_output_close( out ); ++ gsf_output_close(out); + + #ifndef HAVE_GSF_ZIP64 +- if( iszip( dz->container ) ) { ++ if (iszip(dz->container)) { + /* Leave 3 entry headroom for blank.png and metadata files. + */ +- if( dz->tree->file_count + 3 >= (unsigned int) USHRT_MAX ) { +- g_mutex_unlock( vips__global_lock ); ++ if (dz->tree->file_count + 3 >= (unsigned int) USHRT_MAX) { ++ g_mutex_unlock(vips__global_lock); + +- vips_error( class->nickname, +- "%s", _( "too many files in zip" ) ); +- return( -1 ); ++ vips_error(class->nickname, ++ "%s", _("too many files in zip")); ++ return (-1); + } + +- /* Leave 16k headroom for blank.png and metadata files. ++ /* Leave 16k headroom for blank.png and metadata files. + */ +- if( estimate_zip_size( dz ) > (size_t) UINT_MAX - 16384) { +- g_mutex_unlock( vips__global_lock ); ++ if (estimate_zip_size(dz) > (size_t) UINT_MAX - 16384) { ++ g_mutex_unlock(vips__global_lock); + +- vips_error( class->nickname, +- "%s", _( "output file too large" ) ); +- return( -1 ); ++ vips_error(class->nickname, ++ "%s", _("output file too large")); ++ return (-1); + } + } + #endif /*HAVE_GSF_ZIP64*/ + +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_unlock(vips__global_lock); + +- g_free( buf ); ++ g_free(buf); + +- return( 0 ); ++ return (0); + } + + /* Free a pyramid. + */ + static void +-layer_free( Layer *layer ) ++layer_free(Layer *layer) + { +- VIPS_FREEF( g_object_unref, layer->strip ); +- VIPS_FREEF( g_object_unref, layer->copy ); +- VIPS_FREEF( g_object_unref, layer->image ); ++ VIPS_FREEF(g_object_unref, layer->strip); ++ VIPS_FREEF(g_object_unref, layer->copy); ++ VIPS_FREEF(g_object_unref, layer->image); + +- VIPS_FREEF( layer_free, layer->below ); ++ VIPS_FREEF(layer_free, layer->below); + } + + static void +-vips_foreign_save_dz_dispose( GObject *gobject ) ++vips_foreign_save_dz_dispose(GObject *gobject) + { + VipsForeignSaveDz *dz = (VipsForeignSaveDz *) gobject; + +- VIPS_UNREF( dz->target ); ++ VIPS_UNREF(dz->target); + +- VIPS_FREEF( layer_free, dz->layer ); +- VIPS_FREEF( vips_gsf_tree_close, dz->tree ); +- VIPS_FREEF( g_object_unref, dz->out ); ++ VIPS_FREEF(layer_free, dz->layer); ++ VIPS_FREEF(vips_gsf_tree_close, dz->tree); ++ VIPS_FREEF(g_object_unref, dz->out); + +- VIPS_FREE( dz->basename ); +- VIPS_FREE( dz->dirname ); +- VIPS_FREE( dz->root_name ); +- VIPS_FREE( dz->file_suffix ); ++ VIPS_FREE(dz->basename); ++ VIPS_FREE(dz->dirname); ++ VIPS_FREE(dz->root_name); ++ VIPS_FREE(dz->file_suffix); + +- G_OBJECT_CLASS( vips_foreign_save_dz_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_dz_parent_class)->dispose(gobject); + } + +-/* Build a pyramid. ++/* Build a pyramid. + * + * width/height is the size of this layer, real_* the subsection of the layer +- * which is real pixels (as opposed to background). ++ * which is real pixels (as opposed to background). + */ + static Layer * +-pyramid_build( VipsForeignSaveDz *dz, Layer *above, +- int width, int height, VipsRect *real_pixels ) ++pyramid_build(VipsForeignSaveDz *dz, Layer *above, ++ int width, int height, VipsRect *real_pixels) + { +- VipsForeignSave *save = VIPS_FOREIGN_SAVE( dz ); +- Layer *layer = VIPS_NEW( dz, Layer ); ++ VipsForeignSave *save = VIPS_FOREIGN_SAVE(dz); ++ Layer *layer = VIPS_NEW(dz, Layer); + + VipsRect strip; +- int limit; ++ int limit; + + layer->dz = dz; + layer->width = width; +@@ -975,21 +979,21 @@ pyramid_build( VipsForeignSaveDz *dz, Layer *above, + + /* We need to output all possible tiles, even if they give no new pixels. + */ +- layer->tiles_across = VIPS_ROUND_UP( width, dz->tile_step ) / ++ layer->tiles_across = VIPS_ROUND_UP(width, dz->tile_step) / + dz->tile_step; +- layer->tiles_down = VIPS_ROUND_UP( height, dz->tile_step ) / ++ layer->tiles_down = VIPS_ROUND_UP(height, dz->tile_step) / + dz->tile_step; + +- layer->real_pixels = *real_pixels; ++ layer->real_pixels = *real_pixels; + + layer->image = NULL; + layer->strip = NULL; + layer->copy = NULL; + +- if( !above ) ++ if (!above) + /* Top of pyramid. + */ +- layer->sub = 1; ++ layer->sub = 1; + else + layer->sub = above->sub * 2; + +@@ -1000,27 +1004,27 @@ pyramid_build( VipsForeignSaveDz *dz, Layer *above, + * easy. + */ + layer->image = vips_image_new(); +- if( vips_image_pipelinev( layer->image, +- VIPS_DEMAND_STYLE_ANY, save->ready, NULL ) ) { +- layer_free( layer ); +- return( NULL ); ++ if (vips_image_pipelinev(layer->image, ++ VIPS_DEMAND_STYLE_ANY, save->ready, NULL)) { ++ layer_free(layer); ++ return (NULL); + } + layer->image->Xsize = width + (width & 1); + layer->image->Ysize = height + (height & 1); + +- layer->strip = vips_region_new( layer->image ); +- layer->copy = vips_region_new( layer->image ); ++ layer->strip = vips_region_new(layer->image); ++ layer->copy = vips_region_new(layer->image); + + /* The regions will get used in the bg thread callback, so make sure + * we don't own them. + */ +- vips__region_no_ownership( layer->strip ); +- vips__region_no_ownership( layer->copy ); ++ vips__region_no_ownership(layer->strip); ++ vips__region_no_ownership(layer->copy); + +- /* Build a line of tiles here. ++ /* Build a line of tiles here. + * +- * Expand the strip if necessary to make sure we have an even +- * number of lines. ++ * Expand the strip if necessary to make sure we have an even ++ * number of lines. + * + * This is just the height of the first row of tiles, so only add 1* + * tile_margin. +@@ -1031,14 +1035,14 @@ pyramid_build( VipsForeignSaveDz *dz, Layer *above, + strip.top = 0; + strip.width = layer->image->Xsize; + strip.height = dz->tile_size + dz->tile_margin; +- if( (strip.height & 1) == 1 ) ++ if ((strip.height & 1) == 1) + strip.height += 1; +- if( vips_region_buffer( layer->strip, &strip ) ) { +- layer_free( layer ); +- return( NULL ); ++ if (vips_region_buffer(layer->strip, &strip)) { ++ layer_free(layer); ++ return (NULL); + } + +- switch( dz->depth ) { ++ switch (dz->depth) { + case VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL: + limit = 1; + break; +@@ -1048,7 +1052,7 @@ pyramid_build( VipsForeignSaveDz *dz, Layer *above, + break; + + case VIPS_FOREIGN_DZ_DEPTH_ONE: +- limit = VIPS_MAX( width, height ); ++ limit = VIPS_MAX(width, height); + break; + + default: +@@ -1059,28 +1063,28 @@ pyramid_build( VipsForeignSaveDz *dz, Layer *above, + limit = 1; + } + +- if( width > limit || +- height > limit ) { ++ if (width > limit || ++ height > limit) { + /* Round up, so eg. a 5 pixel wide image becomes 3 a layer + * down. + * + * For the rect, round left/top down, round bottom/right up, +- * so we get all possible pixels. ++ * so we get all possible pixels. + */ + VipsRect halfrect; + + halfrect.left = real_pixels->left / 2; + halfrect.top = real_pixels->top / 2; +- halfrect.width = (VIPS_RECT_RIGHT( real_pixels ) + 1) / 2 - ++ halfrect.width = (VIPS_RECT_RIGHT(real_pixels) + 1) / 2 - + halfrect.left; +- halfrect.height = (VIPS_RECT_BOTTOM( real_pixels ) + 1) / 2 - ++ halfrect.height = (VIPS_RECT_BOTTOM(real_pixels) + 1) / 2 - + halfrect.top; + +- if( !(layer->below = pyramid_build( dz, layer, +- (width + 1) / 2, (height + 1) / 2, +- &halfrect )) ) { +- layer_free( layer ); +- return( NULL ); ++ if (!(layer->below = pyramid_build(dz, layer, ++ (width + 1) / 2, (height + 1) / 2, ++ &halfrect))) { ++ layer_free(layer); ++ return (NULL); + } + layer->n = layer->below->n + 1; + } +@@ -1088,79 +1092,79 @@ pyramid_build( VipsForeignSaveDz *dz, Layer *above, + layer->n = 0; + + #ifdef DEBUG +- printf( "pyramid_build:\n" ); +- printf( "\tn = %d\n", layer->n ); +- printf( "\twidth = %d, height = %d\n", width, height ); +- printf( "\tXsize = %d, Ysize = %d\n", +- layer->image->Xsize, layer->image->Ysize ); +- printf( "\ttiles_across = %d, tiles_down = %d\n", +- layer->tiles_across, layer->tiles_down ); +- printf( "\treal_pixels.left = %d, real_pixels.top = %d\n", +- real_pixels->left, real_pixels->top ); +- printf( "\treal_pixels.width = %d, real_pixels.height = %d\n", +- real_pixels->width, real_pixels->height ); ++ printf("pyramid_build:\n"); ++ printf("\tn = %d\n", layer->n); ++ printf("\twidth = %d, height = %d\n", width, height); ++ printf("\tXsize = %d, Ysize = %d\n", ++ layer->image->Xsize, layer->image->Ysize); ++ printf("\ttiles_across = %d, tiles_down = %d\n", ++ layer->tiles_across, layer->tiles_down); ++ printf("\treal_pixels.left = %d, real_pixels.top = %d\n", ++ real_pixels->left, real_pixels->top); ++ printf("\treal_pixels.width = %d, real_pixels.height = %d\n", ++ real_pixels->width, real_pixels->height); + #endif /*DEBUG*/ + +- return( layer ); ++ return (layer); + } + + static int +-write_dzi( VipsForeignSaveDz *dz ) ++write_dzi(VipsForeignSaveDz *dz) + { + GsfOutput *out; + char buf[VIPS_PATH_MAX]; + char *p; + +- vips_snprintf( buf, VIPS_PATH_MAX, "%s.dzi", dz->basename ); +- out = vips_gsf_path( dz->tree, buf, NULL ); ++ vips_snprintf(buf, VIPS_PATH_MAX, "%s.dzi", dz->basename); ++ out = vips_gsf_path(dz->tree, buf, NULL); + +- vips_snprintf( buf, VIPS_PATH_MAX, "%s", dz->suffix + 1 ); +- if( (p = (char *) vips__find_rightmost_brackets( buf )) ) ++ vips_snprintf(buf, VIPS_PATH_MAX, "%s", dz->suffix + 1); ++ if ((p = (char *) vips__find_rightmost_brackets(buf))) + *p = '\0'; + +- gsf_output_printf( out, "\n" ); +- gsf_output_printf( out, "overlap ); +- gsf_output_printf( out, " TileSize=\"%d\"\n", dz->tile_size ); +- gsf_output_printf( out, " >\n" ); +- gsf_output_printf( out, " layer->height ); +- gsf_output_printf( out, " Width=\"%d\"\n", dz->layer->width ); +- gsf_output_printf( out, " />\n" ); +- gsf_output_printf( out, "\n" ); ++ gsf_output_printf(out, "\n"); ++ gsf_output_printf(out, "overlap); ++ gsf_output_printf(out, " TileSize=\"%d\"\n", dz->tile_size); ++ gsf_output_printf(out, " >\n"); ++ gsf_output_printf(out, " layer->height); ++ gsf_output_printf(out, " Width=\"%d\"\n", dz->layer->width); ++ gsf_output_printf(out, " />\n"); ++ gsf_output_printf(out, "\n"); + +- (void) gsf_output_close( out ); +- g_object_unref( out ); ++ (void) gsf_output_close(out); ++ g_object_unref(out); + +- return( 0 ); ++ return (0); + } + + static int +-write_properties( VipsForeignSaveDz *dz ) ++write_properties(VipsForeignSaveDz *dz) + { + GsfOutput *out; + +- out = vips_gsf_path( dz->tree, "ImageProperties.xml", NULL ); ++ out = vips_gsf_path(dz->tree, "ImageProperties.xml", NULL); + +- gsf_output_printf( out, "\n", ++ gsf_output_printf(out, "\n", + dz->layer->width, + dz->layer->height, + dz->tile_count, +- dz->tile_size ); ++ dz->tile_size); + +- (void) gsf_output_close( out ); +- g_object_unref( out ); ++ (void) gsf_output_close(out); ++ g_object_unref(out); + +- return( 0 ); ++ return (0); + } + + static int +-write_blank( VipsForeignSaveDz *dz ) ++write_blank(VipsForeignSaveDz *dz) + { + VipsForeignSave *save = (VipsForeignSave *) dz; + +@@ -1170,52 +1174,52 @@ write_blank( VipsForeignSaveDz *dz ) + double *d; + double *bg; + int i; +- GsfOutput *out; ++ GsfOutput *out; + + /* Number of bands we will end up making. We need to set this in + * vips_black() to make sure we set Type correctly, otherwise we can + * try saving a B_W image as PNG, with disasterous results. + */ +- bg = (double *) vips_area_get_data( VIPS_AREA( save->background ), +- NULL, &n, NULL, NULL ); ++ bg = (double *) vips_area_get_data(VIPS_AREA(save->background), ++ NULL, &n, NULL, NULL); + +- if( vips_black( &x, dz->tile_size, dz->tile_size, "bands", n, NULL ) ) +- return( -1 ); ++ if (vips_black(&x, dz->tile_size, dz->tile_size, "bands", n, NULL)) ++ return (-1); + +- ones = vips_area_new_array( G_TYPE_DOUBLE, sizeof( double ), n ); +- d = (double *) vips_area_get_data( ones, NULL, NULL, NULL, NULL ); +- for( i = 0; i < n; i++ ) +- d[i] = 1.0; ++ ones = vips_area_new_array(G_TYPE_DOUBLE, sizeof(double), n); ++ d = (double *) vips_area_get_data(ones, NULL, NULL, NULL, NULL); ++ for (i = 0; i < n; i++) ++ d[i] = 1.0; + +- if( vips_linear( x, &t, d, bg, n, NULL ) ) { +- vips_area_unref( ones ); +- g_object_unref( x ); +- return( -1 ); ++ if (vips_linear(x, &t, d, bg, n, NULL)) { ++ vips_area_unref(ones); ++ g_object_unref(x); ++ return (-1); + } +- vips_area_unref( ones ); +- g_object_unref( x ); ++ vips_area_unref(ones); ++ g_object_unref(x); + x = t; + +- out = vips_gsf_path( dz->tree, "blank.png", NULL ); ++ out = vips_gsf_path(dz->tree, "blank.png", NULL); + +- if( write_image( dz, out, x, ".png" ) ) { +- g_object_unref( out ); +- g_object_unref( x ); ++ if (write_image(dz, out, x, ".png")) { ++ g_object_unref(out); ++ g_object_unref(x); + +- return( -1 ); ++ return (-1); + } + +- g_object_unref( out ); ++ g_object_unref(out); + +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + /* Write IIIF/IIF3 JSON metadata. + */ + static int +-write_json( VipsForeignSaveDz *dz ) ++write_json(VipsForeignSaveDz *dz) + { + /* Can be NULL for memory output. + */ +@@ -1223,34 +1227,33 @@ write_json( VipsForeignSaveDz *dz ) + + /* dz->file_suffix has a leading "." character. + */ +- const char *suffix = dz->file_suffix[0] == '.' ? +- dz->file_suffix + 1 : dz->file_suffix; ++ const char *suffix = dz->file_suffix[0] == '.' ? dz->file_suffix + 1 : dz->file_suffix; + + GsfOutput *out; + int i; + +- out = vips_gsf_path( dz->tree, "info.json", NULL ); ++ out = vips_gsf_path(dz->tree, "info.json", NULL); + +- if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_IIIF3 ) +- gsf_output_printf( out, ++ if (dz->layout == VIPS_FOREIGN_DZ_LAYOUT_IIIF3) ++ gsf_output_printf(out, + "{\n" +- " \"@context\": " +- "\"http://iiif.io/api/image/3/context.json\",\n" +- " \"id\": \"%s/%s\",\n" +- " \"type\": \"ImageService3\",\n" ++ " \"@context\": " ++ "\"http://iiif.io/api/image/3/context.json\",\n" ++ " \"id\": \"%s/%s\",\n" ++ " \"type\": \"ImageService3\",\n" + " \"profile\": \"level0\",\n" +- " \"protocol\": \"http://iiif.io/api/image\",\n", ++ " \"protocol\": \"http://iiif.io/api/image\",\n", + dz->id ? dz->id : "https://example.com/iiif", +- name ); ++ name); + else +- gsf_output_printf( out, ++ gsf_output_printf(out, + "{\n" + " \"@context\": " +- "\"http://iiif.io/api/image/2/context.json\",\n" +- " \"@id\": \"%s/%s\",\n" ++ "\"http://iiif.io/api/image/2/context.json\",\n" ++ " \"@id\": \"%s/%s\",\n" + " \"profile\": [\n" + " \"http://iiif.io/api/image/2/level0.json\",\n" +- " {\n" ++ " {\n" + " \"formats\": [\n" + " \"%s\"\n" + " ],\n" +@@ -1259,149 +1262,150 @@ write_json( VipsForeignSaveDz *dz ) + " ]\n" + " }\n" + " ],\n" +- " \"protocol\": \"http://iiif.io/api/image\",\n", ++ " \"protocol\": \"http://iiif.io/api/image\",\n", + dz->id ? dz->id : "https://example.com/iiif", +- name, +- suffix ); ++ name, ++ suffix); + +- /* "sizes" is needed for the full/ set of untiled images, which we ++ /* "sizes" is needed for the full/ set of untiled images, which we + * don't yet support. Leave this commented out for now. + +- gsf_output_printf( out, ++ gsf_output_printf( out, + " \"sizes\": [\n" ); + + for( i = 0; i < dz->layer->n + 5; i++ ) { +- gsf_output_printf( out, ++ gsf_output_printf( out, + " {\n" + " \"width\": %d,\n" + " \"height\": \"full\"\n" +- " }", ++ " }", + 1 << (i + 4) ); + if( i != dz->layer->n - 4 ) + gsf_output_printf( out, "," ); + gsf_output_printf( out, "\n" ); + } + +- gsf_output_printf( out, ++ gsf_output_printf( out, + " ],\n" ); + + */ + + /* The set of pyramid layers we have written. + */ +- gsf_output_printf( out, ++ gsf_output_printf(out, + " \"tiles\": [\n" + " {\n" +- " \"scaleFactors\": [\n" ); ++ " \"scaleFactors\": [\n"); + +- for( i = 0; i < dz->layer->n; i++ ) { +- gsf_output_printf( out, ++ for (i = 0; i < dz->layer->n; i++) { ++ gsf_output_printf(out, + " %d", +- 1 << i ); +- if( i != dz->layer->n - 1 ) +- gsf_output_printf( out, "," ); +- gsf_output_printf( out, "\n" ); ++ 1 << i); ++ if (i != dz->layer->n - 1) ++ gsf_output_printf(out, ","); ++ gsf_output_printf(out, "\n"); + } + +- gsf_output_printf( out, ++ gsf_output_printf(out, + " ],\n" + " \"width\": %d\n" + " }\n" +- " ],\n", dz->tile_size ); ++ " ],\n", ++ dz->tile_size); + +- gsf_output_printf( out, ++ gsf_output_printf(out, + " \"width\": %d,\n" +- " \"height\": %d\n", +- dz->layer->width, +- dz->layer->height ); ++ " \"height\": %d\n", ++ dz->layer->width, ++ dz->layer->height); + +- gsf_output_printf( out, +- "}\n" ); ++ gsf_output_printf(out, ++ "}\n"); + +- (void) gsf_output_close( out ); +- g_object_unref( out ); ++ (void) gsf_output_close(out); ++ g_object_unref(out); + +- return( 0 ); ++ return (0); + } + + static int +-write_vips_meta( VipsForeignSaveDz *dz ) ++write_vips_meta(VipsForeignSaveDz *dz) + { + VipsForeignSave *save = (VipsForeignSave *) dz; + + char *dump; + GsfOutput *out; + +- if( !(dump = vips__xml_properties( save->ready )) ) +- return( -1 ); ++ if (!(dump = vips__xml_properties(save->ready))) ++ return (-1); + + /* For deepzom the props must go inside the ${name}_files subdir, for + * gm and zoomify it can sit in the main folder. + */ +- if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_DZ ) +- out = vips_gsf_path( dz->tree, +- "vips-properties.xml", dz->root_name, NULL ); ++ if (dz->layout == VIPS_FOREIGN_DZ_LAYOUT_DZ) ++ out = vips_gsf_path(dz->tree, ++ "vips-properties.xml", dz->root_name, NULL); + else +- out = vips_gsf_path( dz->tree, "vips-properties.xml", NULL ); ++ out = vips_gsf_path(dz->tree, "vips-properties.xml", NULL); + +- gsf_output_write( out, strlen( dump ), (guchar *) dump ); +- (void) gsf_output_close( out ); +- g_object_unref( out ); ++ gsf_output_write(out, strlen(dump), (guchar *) dump); ++ (void) gsf_output_close(out); ++ g_object_unref(out); + +- g_free( dump ); ++ g_free(dump); + +- return( 0 ); ++ return (0); + } + + static void +-build_scan_property( VipsDbuf *dbuf, VipsImage *image, +- const char *vips_name, const char *szi_name ) ++build_scan_property(VipsDbuf *dbuf, VipsImage *image, ++ const char *vips_name, const char *szi_name) + { + const char *str; + GValue value = { 0 }; + GValue save_value = { 0 }; + GType type; + +- if( !vips_image_get_typeof( image, vips_name ) ) ++ if (!vips_image_get_typeof(image, vips_name)) + return; + +- if( vips_image_get( image, vips_name, &value ) ) ++ if (vips_image_get(image, vips_name, &value)) + return; +- type = G_VALUE_TYPE( &value ); ++ type = G_VALUE_TYPE(&value); + +- if( !g_value_type_transformable( type, VIPS_TYPE_SAVE_STRING ) ) { +- g_value_unset( &value ); ++ if (!g_value_type_transformable(type, VIPS_TYPE_SAVE_STRING)) { ++ g_value_unset(&value); + return; + } + +- g_value_init( &save_value, VIPS_TYPE_SAVE_STRING ); +- if( !g_value_transform( &value, &save_value ) ) { +- g_value_unset( &value ); ++ g_value_init(&save_value, VIPS_TYPE_SAVE_STRING); ++ if (!g_value_transform(&value, &save_value)) { ++ g_value_unset(&value); + return; + } +- g_value_unset( &value ); ++ g_value_unset(&value); + +- if( !(str = vips_value_get_save_string( &save_value )) ) { +- g_value_unset( &save_value ); ++ if (!(str = vips_value_get_save_string(&save_value))) { ++ g_value_unset(&save_value); + return; + } + +- if( !g_utf8_validate( str, -1, NULL ) ) { +- g_value_unset( &save_value ); ++ if (!g_utf8_validate(str, -1, NULL)) { ++ g_value_unset(&save_value); + return; + } + +- vips_dbuf_writef( dbuf, " \n" ); +- vips_dbuf_writef( dbuf, " " ); +- vips_dbuf_write_amp( dbuf, szi_name ); +- vips_dbuf_writef( dbuf, "\n" ); +- vips_dbuf_writef( dbuf, " ", +- g_type_name( type ) ); +- vips_dbuf_write_amp( dbuf, str ); +- vips_dbuf_writef( dbuf, "\n" ); +- vips_dbuf_writef( dbuf, " \n" ); ++ vips_dbuf_writef(dbuf, " \n"); ++ vips_dbuf_writef(dbuf, " "); ++ vips_dbuf_write_amp(dbuf, szi_name); ++ vips_dbuf_writef(dbuf, "\n"); ++ vips_dbuf_writef(dbuf, " ", ++ g_type_name(type)); ++ vips_dbuf_write_amp(dbuf, str); ++ vips_dbuf_writef(dbuf, "\n"); ++ vips_dbuf_writef(dbuf, " \n"); + +- g_value_unset( &save_value ); ++ g_value_unset(&save_value); + } + + static char *scan_property_names[][2] = { +@@ -1417,7 +1421,7 @@ static char *scan_property_names[][2] = { + * Free with g_free(). + */ + static char * +-build_scan_properties( VipsImage *image ) ++build_scan_properties(VipsImage *image) + { + VipsDbuf dbuf; + char *date; +@@ -1425,118 +1429,119 @@ build_scan_properties( VipsImage *image ) + + date = vips__get_iso8601(); + +- vips_dbuf_init( &dbuf ); +- vips_dbuf_writef( &dbuf, "\n" ); +- vips_dbuf_writef( &dbuf, "\n", date ); +- vips_dbuf_writef( &dbuf, " \n" ); ++ vips_dbuf_init(&dbuf); ++ vips_dbuf_writef(&dbuf, "\n"); ++ vips_dbuf_writef(&dbuf, "\n", ++ date); ++ vips_dbuf_writef(&dbuf, " \n"); + +- g_free( date ); ++ g_free(date); + +- for( i = 0; i < VIPS_NUMBER( scan_property_names ); i++ ) +- build_scan_property( &dbuf, image, ++ for (i = 0; i < VIPS_NUMBER(scan_property_names); i++) ++ build_scan_property(&dbuf, image, + scan_property_names[i][0], +- scan_property_names[i][1] ); ++ scan_property_names[i][1]); + +- vips_dbuf_writef( &dbuf, " \n" ); +- vips_dbuf_writef( &dbuf, "\n" ); ++ vips_dbuf_writef(&dbuf, " \n"); ++ vips_dbuf_writef(&dbuf, "\n"); + +- return( (char *) vips_dbuf_steal( &dbuf, NULL ) ); ++ return ((char *) vips_dbuf_steal(&dbuf, NULL)); + } + + static int +-write_scan_properties( VipsForeignSaveDz *dz ) ++write_scan_properties(VipsForeignSaveDz *dz) + { + VipsForeignSave *save = (VipsForeignSave *) dz; + + char *dump; + GsfOutput *out; + +- if( !(dump = build_scan_properties( save->ready )) ) +- return( -1 ); ++ if (!(dump = build_scan_properties(save->ready))) ++ return (-1); + +- out = vips_gsf_path( dz->tree, "scan-properties.xml", NULL ); +- gsf_output_write( out, strlen( dump ), (guchar *) dump ); +- (void) gsf_output_close( out ); +- g_object_unref( out ); ++ out = vips_gsf_path(dz->tree, "scan-properties.xml", NULL); ++ gsf_output_write(out, strlen(dump), (guchar *) dump); ++ (void) gsf_output_close(out); ++ g_object_unref(out); + +- g_free( dump ); ++ g_free(dump); + +- return( 0 ); ++ return (0); + } + + static void * +-write_associated_images( VipsImage *image, +- const char *field, GValue *value, void *a ) ++write_associated_images(VipsImage *image, ++ const char *field, GValue *value, void *a) + { + VipsForeignSaveDz *dz = (VipsForeignSaveDz *) a; + +- if( vips_isprefix( "openslide.associated.", field ) ) { ++ if (vips_isprefix("openslide.associated.", field)) { + VipsImage *associated; + const char *p; + const char *q; + GsfOutput *out; + char buf[VIPS_PATH_MAX]; + +- p = field + strlen( "openslide.associated." ); ++ p = field + strlen("openslide.associated."); + + /* Make sure there are no '/' in the filename. + */ +- if( (q = strrchr( p, '/' )) ) ++ if ((q = strrchr(p, '/'))) + p = q + 1; + +- if( vips_image_get_image( image, field, &associated ) ) +- return( image ); ++ if (vips_image_get_image(image, field, &associated)) ++ return (image); + +- vips_snprintf( buf, VIPS_PATH_MAX, "%s.jpg", p ); +- out = vips_gsf_path( dz->tree, buf, "associated_images", NULL ); ++ vips_snprintf(buf, VIPS_PATH_MAX, "%s.jpg", p); ++ out = vips_gsf_path(dz->tree, buf, "associated_images", NULL); + +- if( write_image( dz, out, associated, ".jpg" ) ) { +- g_object_unref( out ); +- g_object_unref( associated ); ++ if (write_image(dz, out, associated, ".jpg")) { ++ g_object_unref(out); ++ g_object_unref(associated); + +- return( image ); ++ return (image); + } + +- g_object_unref( out ); ++ g_object_unref(out); + +- g_object_unref( associated ); ++ g_object_unref(associated); + } + +- return( NULL ); ++ return (NULL); + } + + static int +-write_associated( VipsForeignSaveDz *dz ) ++write_associated(VipsForeignSaveDz *dz) + { + VipsForeignSave *save = (VipsForeignSave *) dz; + +- if( vips_image_map( save->ready, write_associated_images, dz ) ) +- return( -1 ); ++ if (vips_image_map(save->ready, write_associated_images, dz)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Our state during a threaded write of a strip. + */ + typedef struct _Strip { +- Layer *layer; ++ Layer *layer; + + VipsImage *image; + +- /* Allocate the next tile on this boundary. ++ /* Allocate the next tile on this boundary. + */ + int x; + } Strip; + + static void +-strip_free( Strip *strip ) ++strip_free(Strip *strip) + { +- g_object_unref( strip->image ); ++ g_object_unref(strip->image); + } + + static void +-strip_init( Strip *strip, Layer *layer ) ++strip_init(Strip *strip, Layer *layer) + { + VipsForeignSaveDz *dz = layer->dz; + +@@ -1562,23 +1567,23 @@ strip_init( Strip *strip, Layer *layer ) + line.top = layer->y; + line.width = image.width; + line.height = dz->tile_size; +- vips_rect_marginadjust( &line, dz->tile_margin ); ++ vips_rect_marginadjust(&line, dz->tile_margin); + +- vips_rect_intersectrect( &image, &line, &line ); ++ vips_rect_intersectrect(&image, &line, &line); + +- if( !(strip->image = vips_image_new_from_memory( +- VIPS_REGION_ADDR( layer->strip, 0, line.top ), +- VIPS_IMAGE_SIZEOF_LINE( layer->image ) * line.height, +- line.width, line.height, +- layer->image->Bands, layer->image->BandFmt )) ) { +- strip_free( strip ); ++ if (!(strip->image = vips_image_new_from_memory( ++ VIPS_REGION_ADDR(layer->strip, 0, line.top), ++ VIPS_IMAGE_SIZEOF_LINE(layer->image) * line.height, ++ line.width, line.height, ++ layer->image->Bands, layer->image->BandFmt))) { ++ strip_free(strip); + return; + } + + /* The strip needs to inherit the layer's metadata. + */ +- if( vips__image_meta_copy( strip->image, layer->image ) ) { +- strip_free( strip ); ++ if (vips__image_meta_copy(strip->image, layer->image)) { ++ strip_free(strip); + return; + } + +@@ -1588,7 +1593,7 @@ strip_init( Strip *strip, Layer *layer ) + } + + static int +-strip_allocate( VipsThreadState *state, void *a, gboolean *stop ) ++strip_allocate(VipsThreadState *state, void *a, gboolean *stop) + { + Strip *strip = (Strip *) a; + Layer *layer = strip->layer; +@@ -1597,20 +1602,20 @@ strip_allocate( VipsThreadState *state, void *a, gboolean *stop ) + VipsRect image; + + #ifdef DEBUG_VERBOSE +- printf( "strip_allocate\n" ); ++ printf("strip_allocate\n"); + #endif /*DEBUG_VERBOSE*/ + + /* We can't test for allocated area empty, since it might just have + * bits of the left-hand overlap in and no new pixels. Safest to count + * tiles across. + */ +- if( strip->x / dz->tile_step >= layer->tiles_across ) { ++ if (strip->x / dz->tile_step >= layer->tiles_across) { + *stop = TRUE; + #ifdef DEBUG_VERBOSE +- printf( "strip_allocate: done\n" ); ++ printf("strip_allocate: done\n"); + #endif /*DEBUG_VERBOSE*/ + +- return( 0 ); ++ return (0); + } + + image.left = 0; +@@ -1624,40 +1629,40 @@ strip_allocate( VipsThreadState *state, void *a, gboolean *stop ) + state->pos.top = layer->y; + state->pos.width = dz->tile_size; + state->pos.height = dz->tile_size; +- vips_rect_marginadjust( &state->pos, dz->tile_margin ); ++ vips_rect_marginadjust(&state->pos, dz->tile_margin); + +- vips_rect_intersectrect( &image, &state->pos, &state->pos ); ++ vips_rect_intersectrect(&image, &state->pos, &state->pos); + state->x = strip->x; + state->y = layer->y; + + strip->x += dz->tile_step; + +- return( 0 ); ++ return (0); + } + + /* Make an output object for a tile in the current layout. + */ + static GsfOutput * +-tile_name( Layer *layer, int x, int y ) ++tile_name(Layer *layer, int x, int y) + { + VipsForeignSaveDz *dz = layer->dz; + VipsForeignSave *save = (VipsForeignSave *) dz; + +- GsfOutput *out; ++ GsfOutput *out; + char name[VIPS_PATH_MAX]; + char dirname[VIPS_PATH_MAX]; + char dirname2[VIPS_PATH_MAX]; + Layer *p; + int n; + +- switch( dz->layout ) { ++ switch (dz->layout) { + case VIPS_FOREIGN_DZ_LAYOUT_DZ: +- vips_snprintf( dirname, VIPS_PATH_MAX, "%d", layer->n ); +- vips_snprintf( name, VIPS_PATH_MAX, +- "%d_%d%s", x, y, dz->file_suffix ); ++ vips_snprintf(dirname, VIPS_PATH_MAX, "%d", layer->n); ++ vips_snprintf(name, VIPS_PATH_MAX, ++ "%d_%d%s", x, y, dz->file_suffix); + +- out = vips_gsf_path( dz->tree, name, +- dz->root_name, dirname, NULL ); ++ out = vips_gsf_path(dz->tree, name, ++ dz->root_name, dirname, NULL); + + break; + +@@ -1665,44 +1670,43 @@ tile_name( Layer *layer, int x, int y ) + /* We need to work out the tile number so we can calculate the + * directory to put this tile in. + * +- * Tiles are numbered from 0 for the most-zoomed-out tile. ++ * Tiles are numbered from 0 for the most-zoomed-out tile. + */ + n = 0; + +- /* Count all tiles in layers below this one. ++ /* Count all tiles in layers below this one. + */ +- for( p = layer->below; p; p = p->below ) ++ for (p = layer->below; p; p = p->below) + n += p->tiles_across * p->tiles_down; + + /* And count tiles so far in this layer. + */ + n += y * layer->tiles_across + x; + +- vips_snprintf( dirname, VIPS_PATH_MAX, "TileGroup%d", n / 256 ); +- vips_snprintf( name, VIPS_PATH_MAX, +- "%d-%d-%d%s", layer->n, x, y, dz->file_suffix ); ++ vips_snprintf(dirname, VIPS_PATH_MAX, "TileGroup%d", n / 256); ++ vips_snprintf(name, VIPS_PATH_MAX, ++ "%d-%d-%d%s", layer->n, x, y, dz->file_suffix); + + /* Used at the end in ImageProperties.xml + */ + dz->tile_count += 1; + +- out = vips_gsf_path( dz->tree, name, dirname, NULL ); ++ out = vips_gsf_path(dz->tree, name, dirname, NULL); + + break; + + case VIPS_FOREIGN_DZ_LAYOUT_GOOGLE: +- vips_snprintf( dirname, VIPS_PATH_MAX, "%d", layer->n ); +- vips_snprintf( dirname2, VIPS_PATH_MAX, "%d", y ); +- vips_snprintf( name, VIPS_PATH_MAX, +- "%d%s", x, dz->file_suffix ); ++ vips_snprintf(dirname, VIPS_PATH_MAX, "%d", layer->n); ++ vips_snprintf(dirname2, VIPS_PATH_MAX, "%d", y); ++ vips_snprintf(name, VIPS_PATH_MAX, ++ "%d%s", x, dz->file_suffix); + +- out = vips_gsf_path( dz->tree, name, dirname, dirname2, NULL ); ++ out = vips_gsf_path(dz->tree, name, dirname, dirname2, NULL); + + break; + + case VIPS_FOREIGN_DZ_LAYOUT_IIIF: +- case VIPS_FOREIGN_DZ_LAYOUT_IIIF3: +-{ ++ case VIPS_FOREIGN_DZ_LAYOUT_IIIF3: { + /* Tiles are addressed in full resolution coordinates, so + * scale up by layer->sub and dz->tile_size + * +@@ -1714,41 +1718,41 @@ tile_name( Layer *layer, int x, int y ) + */ + int left = x * dz->tile_size * layer->sub; + int top = y * dz->tile_size * layer->sub; +- int width = VIPS_MIN( dz->tile_size * layer->sub, +- save->ready->Xsize - left ); +- int height = VIPS_MIN( dz->tile_size * layer->sub, +- save->ready->Ysize - top ); +- vips_snprintf( dirname, VIPS_PATH_MAX, "%d,%d,%d,%d", +- left, top, width, height ); +- +- if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_IIIF3 ) { +- int xsize = VIPS_MIN( dz->tile_size, +- layer->width - x * dz->tile_size ); +- int ysize = VIPS_MIN( dz->tile_size, +- layer->height - y * dz->tile_size ); +- +- vips_snprintf( dirname2, VIPS_PATH_MAX, "%d,%d", +- xsize, ysize ); ++ int width = VIPS_MIN(dz->tile_size * layer->sub, ++ save->ready->Xsize - left); ++ int height = VIPS_MIN(dz->tile_size * layer->sub, ++ save->ready->Ysize - top); ++ vips_snprintf(dirname, VIPS_PATH_MAX, "%d,%d,%d,%d", ++ left, top, width, height); ++ ++ if (dz->layout == VIPS_FOREIGN_DZ_LAYOUT_IIIF3) { ++ int xsize = VIPS_MIN(dz->tile_size, ++ layer->width - x * dz->tile_size); ++ int ysize = VIPS_MIN(dz->tile_size, ++ layer->height - y * dz->tile_size); ++ ++ vips_snprintf(dirname2, VIPS_PATH_MAX, "%d,%d", ++ xsize, ysize); + } + else { + /* IIIF2 "size" is just real tile width, I think. + */ +- int size = VIPS_MIN( dz->tile_size, +- layer->width - x * dz->tile_size ); ++ int size = VIPS_MIN(dz->tile_size, ++ layer->width - x * dz->tile_size); + +- vips_snprintf( dirname2, VIPS_PATH_MAX, "%d,", size ); ++ vips_snprintf(dirname2, VIPS_PATH_MAX, "%d,", size); + } + +- vips_snprintf( name, VIPS_PATH_MAX, "default%s", +- dz->file_suffix ); ++ vips_snprintf(name, VIPS_PATH_MAX, "default%s", ++ dz->file_suffix); + + /* "0" is rotation and is always 0. + */ +- out = vips_gsf_path( dz->tree, +- name, dirname, dirname2, "0", NULL ); +-} ++ out = vips_gsf_path(dz->tree, ++ name, dirname, dirname2, "0", NULL); ++ } + +- break; ++ break; + + default: + g_assert_not_reached(); +@@ -1759,28 +1763,28 @@ tile_name( Layer *layer, int x, int y ) + } + + #ifdef DEBUG_VERBOSE +- printf( "tile_name: writing to %s\n", name ); ++ printf("tile_name: writing to %s\n", name); + #endif /*DEBUG_VERBOSE*/ + +- return( out ); ++ return (out); + } + +-/* Test for tile nearly equal to background colour. In google maps mode, we +- * skip blank background tiles. ++/* Test for tile nearly equal to background colour. In google maps mode, we ++ * skip blank background tiles. + * + * Don't use exactly equality since compression artefacts or noise can upset + * this. + */ + static gboolean +-tile_equal( VipsImage *image, int threshold, VipsPel * restrict ink ) ++tile_equal(VipsImage *image, int threshold, VipsPel *restrict ink) + { +- const int bytes = VIPS_IMAGE_SIZEOF_PEL( image ); ++ const int bytes = VIPS_IMAGE_SIZEOF_PEL(image); + + VipsRect rect; + VipsRegion *region; + int x, y, b; + +- region = vips_region_new( image ); ++ region = vips_region_new(image); + + /* We know @image is part of a memory buffer, so this will be quick. + */ +@@ -1788,32 +1792,32 @@ tile_equal( VipsImage *image, int threshold, VipsPel * restrict ink ) + rect.top = 0; + rect.width = image->Xsize; + rect.height = image->Ysize; +- if( vips_region_prepare( region, &rect ) ) { +- g_object_unref( region ); +- return( FALSE ); ++ if (vips_region_prepare(region, &rect)) { ++ g_object_unref(region); ++ return (FALSE); + } + +- for( y = 0; y < image->Ysize; y++ ) { +- VipsPel * restrict p = VIPS_REGION_ADDR( region, 0, y ); ++ for (y = 0; y < image->Ysize; y++) { ++ VipsPel *restrict p = VIPS_REGION_ADDR(region, 0, y); + +- for( x = 0; x < image->Xsize; x++ ) { +- for( b = 0; b < bytes; b++ ) +- if( VIPS_ABS( p[b] - ink[b] ) > threshold ) { +- g_object_unref( region ); +- return( FALSE ); ++ for (x = 0; x < image->Xsize; x++) { ++ for (b = 0; b < bytes; b++) ++ if (VIPS_ABS(p[b] - ink[b]) > threshold) { ++ g_object_unref(region); ++ return (FALSE); + } + + p += bytes; + } + } + +- g_object_unref( region ); ++ g_object_unref(region); + +- return( TRUE ); ++ return (TRUE); + } + + static int +-strip_work( VipsThreadState *state, void *a ) ++strip_work(VipsThreadState *state, void *a) + { + Strip *strip = (Strip *) a; + Layer *layer = strip->layer; +@@ -1822,128 +1826,128 @@ strip_work( VipsThreadState *state, void *a ) + + VipsImage *x; + VipsImage *t; +- GsfOutput *out; ++ GsfOutput *out; + + #ifdef DEBUG_VERBOSE +- printf( "strip_work\n" ); ++ printf("strip_work\n"); + #endif /*DEBUG_VERBOSE*/ + +- /* killed is checked by sink_disc, but that's only once per strip, and +- * they can be huge. Check per output tile as well. +- */ +- if( vips_image_iskilled( save->in ) ) +- return( -1 ); ++ /* killed is checked by sink_disc, but that's only once per strip, and ++ * they can be huge. Check per output tile as well. ++ */ ++ if (vips_image_iskilled(save->in)) ++ return (-1); + +- /* If we are centering we may be outside the real pixels. Skip in +- * this case, and the viewer will display blank.png for us. ++ /* If we are centering we may be outside the real pixels. Skip in ++ * this case, and the viewer will display blank.png for us. + */ +- if( dz->centre ) { +- VipsRect tile; ++ if (dz->centre) { ++ VipsRect tile; + + tile.left = state->x; + tile.top = state->y; + tile.width = dz->tile_size; + tile.height = dz->tile_size; +- if( !vips_rect_overlapsrect( &tile, &layer->real_pixels ) ) { ++ if (!vips_rect_overlapsrect(&tile, &layer->real_pixels)) { + #ifdef DEBUG_VERBOSE +- printf( "strip_work: skipping tile %d x %d\n", +- state->x / dz->tile_size, +- state->y / dz->tile_size ); ++ printf("strip_work: skipping tile %d x %d\n", ++ state->x / dz->tile_size, ++ state->y / dz->tile_size); + #endif /*DEBUG_VERBOSE*/ + +- return( 0 ); ++ return (0); + } + } + +- g_assert( vips_object_sanity( VIPS_OBJECT( strip->image ) ) ); ++ g_assert(vips_object_sanity(VIPS_OBJECT(strip->image))); + + /* Extract relative to the strip top-left corner. + */ +- if( vips_extract_area( strip->image, &x, +- state->pos.left, 0, +- state->pos.width, state->pos.height, NULL ) ) +- return( -1 ); ++ if (vips_extract_area(strip->image, &x, ++ state->pos.left, 0, ++ state->pos.width, state->pos.height, NULL)) ++ return (-1); + +- if( dz->skip_blanks >= 0 && +- tile_equal( x, dz->skip_blanks, dz->ink ) ) { +- g_object_unref( x ); ++ if (dz->skip_blanks >= 0 && ++ tile_equal(x, dz->skip_blanks, dz->ink)) { ++ g_object_unref(x); + + #ifdef DEBUG_VERBOSE +- printf( "strip_work: skipping blank tile %d x %d\n", +- state->x / dz->tile_size, +- state->y / dz->tile_size ); ++ printf("strip_work: skipping blank tile %d x %d\n", ++ state->x / dz->tile_size, ++ state->y / dz->tile_size); + #endif /*DEBUG_VERBOSE*/ + +- return( 0 ); ++ return (0); + } + + /* Google tiles need to be padded up to tilesize. + */ +- if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_GOOGLE ) { +- if( vips_embed( x, &t, 0, 0, dz->tile_size, dz->tile_size, +- "background", save->background, +- NULL ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (dz->layout == VIPS_FOREIGN_DZ_LAYOUT_GOOGLE) { ++ if (vips_embed(x, &t, 0, 0, dz->tile_size, dz->tile_size, ++ "background", save->background, ++ NULL)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + + x = t; + } + + /* we need to single-thread around calls to gsf. + */ +- g_mutex_lock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); + +- out = tile_name( layer, +- state->x / dz->tile_step, state->y / dz->tile_step ); ++ out = tile_name(layer, ++ state->x / dz->tile_step, state->y / dz->tile_step); + +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_unlock(vips__global_lock); + +- vips_image_set_int( x, VIPS_META_CONCURRENCY, 1 ); ++ vips_image_set_int(x, VIPS_META_CONCURRENCY, 1); + +- if( write_image( dz, out, x, dz->suffix ) ) { +- g_object_unref( out ); +- g_object_unref( x ); ++ if (write_image(dz, out, x, dz->suffix)) { ++ g_object_unref(out); ++ g_object_unref(x); + +- return( -1 ); ++ return (-1); + } + +- g_object_unref( out ); +- g_object_unref( x ); ++ g_object_unref(out); ++ g_object_unref(x); + + #ifdef DEBUG_VERBOSE +- printf( "strip_work: success\n" ); ++ printf("strip_work: success\n"); + #endif /*DEBUG_VERBOSE*/ + +- return( 0 ); ++ return (0); + } + +-/* Write a line of tiles with a threadpool. ++/* Write a line of tiles with a threadpool. + */ + static int +-strip_save( Layer *layer ) ++strip_save(Layer *layer) + { + Strip strip; + + #ifdef DEBUG +- printf( "strip_save: n = %d, y = %d\n", layer->n, layer->y ); ++ printf("strip_save: n = %d, y = %d\n", layer->n, layer->y); + #endif /*DEBUG*/ + +- strip_init( &strip, layer ); +- if( vips_threadpool_run( strip.image, +- vips_thread_state_new, strip_allocate, strip_work, NULL, +- &strip ) ) { +- strip_free( &strip ); +- return( -1 ); ++ strip_init(&strip, layer); ++ if (vips_threadpool_run(strip.image, ++ vips_thread_state_new, strip_allocate, strip_work, NULL, ++ &strip)) { ++ strip_free(&strip); ++ return (-1); + } +- strip_free( &strip ); ++ strip_free(&strip); + + #ifdef DEBUG +- printf( "strip_save: success\n" ); ++ printf("strip_save: success\n"); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + /* A strip has filled, but the rightmost column and the bottom-most row may +@@ -1952,32 +1956,32 @@ strip_save( Layer *layer ) + * Fill them, if necessary, by copying the previous row/column. + */ + static void +-layer_generate_extras( Layer *layer ) ++layer_generate_extras(Layer *layer) + { + VipsRegion *strip = layer->strip; + + /* We only work for full-width strips. + */ +- g_assert( strip->valid.width == layer->image->Xsize ); ++ g_assert(strip->valid.width == layer->image->Xsize); + +- if( layer->width < layer->image->Xsize ) { +- int ps = VIPS_IMAGE_SIZEOF_PEL( strip->im ); ++ if (layer->width < layer->image->Xsize) { ++ int ps = VIPS_IMAGE_SIZEOF_PEL(strip->im); + + int b, y; + + /* Need to add a right-most column. + */ +- for( y = 0; y < strip->valid.height; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( strip, +- layer->width - 1, strip->valid.top + y ); ++ for (y = 0; y < strip->valid.height; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(strip, ++ layer->width - 1, strip->valid.top + y); + VipsPel *q = p + ps; + +- for( b = 0; b < ps; b++ ) ++ for (b = 0; b < ps; b++) + q[b] = p[b]; + } + } + +- if( layer->height < layer->image->Ysize ) { ++ if (layer->height < layer->image->Ysize) { + VipsRect last; + + /* The last two lines of the image. +@@ -1986,26 +1990,26 @@ layer_generate_extras( Layer *layer ) + last.top = layer->image->Ysize - 2; + last.width = layer->image->Xsize; + last.height = 2; +- ++ + /* Do we have them both? Fill the last with the next-to-last. + */ +- vips_rect_intersectrect( &last, &strip->valid, &last ); +- if( last.height == 2 ) { ++ vips_rect_intersectrect(&last, &strip->valid, &last); ++ if (last.height == 2) { + last.height = 1; + +- vips_region_copy( strip, strip, &last, +- 0, last.top + 1 ); ++ vips_region_copy(strip, strip, &last, ++ 0, last.top + 1); + } + } + } + +-static int strip_arrived( Layer *layer ); ++static int strip_arrived(Layer *layer); + + /* Shrink what pixels we can from this strip into the layer below. If the + * strip below fills, recurse. + */ + static int +-strip_shrink( Layer *layer ) ++strip_shrink(Layer *layer) + { + Layer *below = layer->below; + VipsRegion *from = layer->strip; +@@ -2017,28 +2021,28 @@ strip_shrink( Layer *layer ) + VipsRect source; + + #ifdef DEBUG +- printf( "strip_shrink: %d lines in layer %d to layer %d\n", +- from->valid.height, layer->n, below->n ); ++ printf("strip_shrink: %d lines in layer %d to layer %d\n", ++ from->valid.height, layer->n, below->n); + #endif /*DEBUG*/ + + /* We may have an extra column of pixels on the right or + * bottom that need filling: generate them. + */ +- layer_generate_extras( layer ); ++ layer_generate_extras(layer); + + /* Our pixels might cross a strip boundary in the layer below, so we + * have to write repeatedly until we run out of pixels. + */ +- for(;;) { ++ for (;;) { + /* The pixels the layer below needs. + */ + target.left = 0; + target.top = below->write_y; + target.width = below->image->Xsize; + target.height = to->valid.height; +- vips_rect_intersectrect( &target, &to->valid, &target ); ++ vips_rect_intersectrect(&target, &to->valid, &target); + +- /* Those pixels need this area of this layer. ++ /* Those pixels need this area of this layer. + */ + source.left = target.left * 2; + source.top = target.top * 2; +@@ -2047,7 +2051,7 @@ strip_shrink( Layer *layer ) + + /* Of which we have these available. + */ +- vips_rect_intersectrect( &source, &from->valid, &source ); ++ vips_rect_intersectrect(&source, &from->valid, &source); + + /* So these are the pixels in the layer below we can provide. + */ +@@ -2058,11 +2062,11 @@ strip_shrink( Layer *layer ) + + /* None? All done. + */ +- if( vips_rect_isempty( &target ) ) ++ if (vips_rect_isempty(&target)) + break; + +- (void) vips_region_shrink_method( from, to, +- &target, region_shrink ); ++ (void) vips_region_shrink_method(from, to, ++ &target, region_shrink); + + below->write_y += target.height; + +@@ -2071,18 +2075,18 @@ strip_shrink( Layer *layer ) + * down the image, or, if it's at the bottom, get to the last + * real line of pixels. + */ +- if( below->write_y == VIPS_RECT_BOTTOM( &to->valid ) || +- below->write_y == below->height ) { +- if( strip_arrived( below ) ) +- return( -1 ); ++ if (below->write_y == VIPS_RECT_BOTTOM(&to->valid) || ++ below->write_y == below->height) { ++ if (strip_arrived(below)) ++ return (-1); + } + } + +- return( 0 ); ++ return (0); + } + +-/* A new strip has arrived! The strip has enough pixels in to write a line of +- * tiles. ++/* A new strip has arrived! The strip has enough pixels in to write a line of ++ * tiles. + * + * - write a line of tiles + * - shrink what we can to the layer below +@@ -2090,7 +2094,7 @@ strip_shrink( Layer *layer ) + * - copy the overlap with the previous strip + */ + static int +-strip_arrived( Layer *layer ) ++strip_arrived(Layer *layer) + { + VipsForeignSaveDz *dz = layer->dz; + +@@ -2099,21 +2103,21 @@ strip_arrived( Layer *layer ) + VipsRect image_area; + + #ifdef DEBUG +- printf( "strip_arrived: layer %d, strip at %d, height %d\n", +- layer->n, layer->y, layer->strip->valid.height ); ++ printf("strip_arrived: layer %d, strip at %d, height %d\n", ++ layer->n, layer->y, layer->strip->valid.height); + #endif /*DEBUG*/ + +- if( strip_save( layer ) ) +- return( -1 ); ++ if (strip_save(layer)) ++ return (-1); + +- if( layer->below && +- strip_shrink( layer ) ) +- return( -1 ); ++ if (layer->below && ++ strip_shrink(layer)) ++ return (-1); + +- /* Position our strip down the image. ++ /* Position our strip down the image. + * +- * Expand the strip if necessary to make sure we have an even +- * number of lines. ++ * Expand the strip if necessary to make sure we have an even ++ * number of lines. + */ + layer->y += dz->tile_step; + new_strip.left = 0; +@@ -2125,79 +2129,79 @@ strip_arrived( Layer *layer ) + image_area.top = 0; + image_area.width = layer->image->Xsize; + image_area.height = layer->image->Ysize; +- vips_rect_intersectrect( &new_strip, &image_area, &new_strip ); ++ vips_rect_intersectrect(&new_strip, &image_area, &new_strip); + +- if( (new_strip.height & 1) == 1 ) ++ if ((new_strip.height & 1) == 1) + new_strip.height += 1; + + /* We may exactly hit the bottom of the real image (ie. before borders +- * have been possibly expanded by 1 pixel). In this case, we'll not +- * be able to do the expansion in layer_generate_extras(), since the +- * region won't be large enough, and we'll not get another chance +- * since this is the bottom. ++ * have been possibly expanded by 1 pixel). In this case, we'll not ++ * be able to do the expansion in layer_generate_extras(), since the ++ * region won't be large enough, and we'll not get another chance ++ * since this is the bottom. + * + * Add another scanline if this has happened. + */ +- if( VIPS_RECT_BOTTOM( &new_strip ) == layer->height ) ++ if (VIPS_RECT_BOTTOM(&new_strip) == layer->height) + new_strip.height = layer->image->Ysize - new_strip.top; + +- /* What pixels that we will need do we already have? Save them in ++ /* What pixels that we will need do we already have? Save them in + * overlap. + */ +- vips_rect_intersectrect( &new_strip, &layer->strip->valid, &overlap ); +- if( !vips_rect_isempty( &overlap ) ) { +- if( vips_region_buffer( layer->copy, &overlap ) ) +- return( -1 ); +- vips_region_copy( layer->strip, layer->copy, +- &overlap, overlap.left, overlap.top ); ++ vips_rect_intersectrect(&new_strip, &layer->strip->valid, &overlap); ++ if (!vips_rect_isempty(&overlap)) { ++ if (vips_region_buffer(layer->copy, &overlap)) ++ return (-1); ++ vips_region_copy(layer->strip, layer->copy, ++ &overlap, overlap.left, overlap.top); + } + +- if( !vips_rect_isempty( &new_strip ) ) { +- if( vips_region_buffer( layer->strip, &new_strip ) ) +- return( -1 ); ++ if (!vips_rect_isempty(&new_strip)) { ++ if (vips_region_buffer(layer->strip, &new_strip)) ++ return (-1); + + /* And copy back again. + */ +- if( !vips_rect_isempty( &overlap ) ) +- vips_region_copy( layer->copy, layer->strip, +- &overlap, overlap.left, overlap.top ); ++ if (!vips_rect_isempty(&overlap)) ++ vips_region_copy(layer->copy, layer->strip, ++ &overlap, overlap.left, overlap.top); + } + +- return( 0 ); ++ return (0); + } + + /* The image has been completely written. Flush any strips which might have + * overlaps in. + */ + static int +-strip_flush( Layer *layer ) ++strip_flush(Layer *layer) + { +- if( layer->y < layer->height ) +- if( strip_save( layer ) ) +- return( -1 ); ++ if (layer->y < layer->height) ++ if (strip_save(layer)) ++ return (-1); + +- if( layer->below ) +- if( strip_flush( layer->below ) ) +- return( -1 ); ++ if (layer->below) ++ if (strip_flush(layer->below)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Another strip of image pixels from vips_sink_disc(). Write into the top +- * pyramid layer. ++ * pyramid layer. + */ + static int +-pyramid_strip( VipsRegion *region, VipsRect *area, void *a ) ++pyramid_strip(VipsRegion *region, VipsRect *area, void *a) + { + VipsForeignSaveDz *dz = (VipsForeignSaveDz *) a; + Layer *layer = dz->layer; + + #ifdef DEBUG +- printf( "pyramid_strip: strip at %d, height %d\n", +- area->top, area->height ); ++ printf("pyramid_strip: strip at %d, height %d\n", ++ area->top, area->height); + #endif /*DEBUG*/ + +- for(;;) { ++ for (;;) { + VipsRect *to = &layer->strip->valid; + VipsRect target; + +@@ -2207,25 +2211,25 @@ pyramid_strip( VipsRegion *region, VipsRect *area, void *a ) + target.top = layer->write_y; + target.width = layer->image->Xsize; + target.height = to->height; +- vips_rect_intersectrect( &target, to, &target ); ++ vips_rect_intersectrect(&target, to, &target); + + /* Clip against what we have available. + */ +- vips_rect_intersectrect( &target, area, &target ); ++ vips_rect_intersectrect(&target, area, &target); + +- /* Have we written all the pixels we were given? We are done. ++ /* Have we written all the pixels we were given? We are done. + */ +- if( vips_rect_isempty( &target ) ) ++ if (vips_rect_isempty(&target)) + break; + + /* And copy those pixels in. + * +- * FIXME: If the strip fits inside the region we've just ++ * FIXME: If the strip fits inside the region we've just + * received, we could skip the copy. Will this happen very + * often? Unclear. + */ +- vips_region_copy( region, layer->strip, +- &target, target.left, target.top ); ++ vips_region_copy(region, layer->strip, ++ &target, target.left, target.top); + + layer->write_y += target.height; + +@@ -2233,10 +2237,10 @@ pyramid_strip( VipsRegion *region, VipsRect *area, void *a ) + * down the image, or, if it's at the bottom, get to the last + * real line of pixels. + */ +- if( layer->write_y == VIPS_RECT_BOTTOM( to ) || +- layer->write_y == layer->height ) { +- if( strip_arrived( layer ) ) +- return( -1 ); ++ if (layer->write_y == VIPS_RECT_BOTTOM(to) || ++ layer->write_y == layer->height) { ++ if (strip_arrived(layer)) ++ return (-1); + } + } + +@@ -2248,132 +2252,130 @@ pyramid_strip( VipsRegion *region, VipsRect *area, void *a ) + * lines of overlap over into the top of the next row. Deepzoom says we + * must flush these half-written strips to the output. + */ +- if( layer->write_y == layer->height ) { ++ if (layer->write_y == layer->height) { + #ifdef DEBUG +- printf( "pyramid_strip: flushing ..\n" ); ++ printf("pyramid_strip: flushing ..\n"); + #endif /*DEBUG*/ + +- if( strip_flush( layer ) ) +- return( -1 ); ++ if (strip_flush(layer)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_dz_build( VipsObject *object ) ++vips_foreign_save_dz_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveDz *dz = (VipsForeignSaveDz *) object; +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( dz ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(dz); + +- VipsRect real_pixels; ++ VipsRect real_pixels; + char *p; + + /* Google, zoomify and iiif default to zero overlap, ".jpg". + */ +- if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_ZOOMIFY || ++ if (dz->layout == VIPS_FOREIGN_DZ_LAYOUT_ZOOMIFY || + dz->layout == VIPS_FOREIGN_DZ_LAYOUT_GOOGLE || + dz->layout == VIPS_FOREIGN_DZ_LAYOUT_IIIF || +- dz->layout == VIPS_FOREIGN_DZ_LAYOUT_IIIF3 ) { +- if( !vips_object_argument_isset( object, "overlap" ) ) ++ dz->layout == VIPS_FOREIGN_DZ_LAYOUT_IIIF3) { ++ if (!vips_object_argument_isset(object, "overlap")) + dz->overlap = 0; +- if( !vips_object_argument_isset( object, "suffix" ) ) +- VIPS_SETSTR( dz->suffix, ".jpg" ); ++ if (!vips_object_argument_isset(object, "suffix")) ++ VIPS_SETSTR(dz->suffix, ".jpg"); + } + + /* Google and zoomify default to 256 pixel tiles. + */ +- if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_ZOOMIFY || +- dz->layout == VIPS_FOREIGN_DZ_LAYOUT_GOOGLE ) { +- if( !vips_object_argument_isset( object, "tile_size" ) ) ++ if (dz->layout == VIPS_FOREIGN_DZ_LAYOUT_ZOOMIFY || ++ dz->layout == VIPS_FOREIGN_DZ_LAYOUT_GOOGLE) { ++ if (!vips_object_argument_isset(object, "tile_size")) + dz->tile_size = 256; + } + + /* Some iiif writers default to 256, some to 512. We pick 512. + */ +- if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_IIIF || +- dz->layout == VIPS_FOREIGN_DZ_LAYOUT_IIIF3 ) { +- if( !vips_object_argument_isset( object, "tile_size" ) ) ++ if (dz->layout == VIPS_FOREIGN_DZ_LAYOUT_IIIF || ++ dz->layout == VIPS_FOREIGN_DZ_LAYOUT_IIIF3) { ++ if (!vips_object_argument_isset(object, "tile_size")) + dz->tile_size = 512; + } + + /* skip_blanks defaults to 5 in google mode. + */ +- if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_GOOGLE && +- !vips_object_argument_isset( object, "skip_blanks" ) ) ++ if (dz->layout == VIPS_FOREIGN_DZ_LAYOUT_GOOGLE && ++ !vips_object_argument_isset(object, "skip_blanks")) + dz->skip_blanks = 5; + + /* Our tile layout. + */ +- if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_DZ ) { ++ if (dz->layout == VIPS_FOREIGN_DZ_LAYOUT_DZ) { + dz->tile_margin = dz->overlap; +- dz->tile_step = dz->tile_size; ++ dz->tile_step = dz->tile_size; + } + else { + dz->tile_margin = 0; + dz->tile_step = dz->tile_size - dz->overlap; + } + +- if( dz->tile_step <= 0 ) { +- vips_error( "dzsave", "%s", _( "overlap too large" ) ); +- return( -1 ); ++ if (dz->tile_step <= 0) { ++ vips_error("dzsave", "%s", _("overlap too large")); ++ return (-1); + } + + /* Default to white background. vips_foreign_save_init() defaults to +- * black. ++ * black. + */ +- if( !vips_object_argument_isset( object, "background" ) ) { +- VipsArrayDouble *background; ++ if (!vips_object_argument_isset(object, "background")) { ++ VipsArrayDouble *background; + + /* Using g_object_set() to set an input param in build will + * change the hash and confuse caching, but we don't cache + * savers, so it's fine. + */ +- background = vips_array_double_newv( 1, 255.0 ); +- g_object_set( object, "background", background, NULL ); +- vips_area_unref( VIPS_AREA( background ) ); ++ background = vips_array_double_newv(1, 255.0); ++ g_object_set(object, "background", background, NULL); ++ vips_area_unref(VIPS_AREA(background)); + } + + /* DeepZoom stops at 1x1 pixels, others when the image fits within a + * tile. + */ +- if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_DZ ) { +- if( !vips_object_argument_isset( object, "depth" ) ) ++ if (dz->layout == VIPS_FOREIGN_DZ_LAYOUT_DZ) { ++ if (!vips_object_argument_isset(object, "depth")) + dz->depth = VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL; + } +- else +- if( !vips_object_argument_isset( object, "depth" ) ) +- dz->depth = VIPS_FOREIGN_DZ_DEPTH_ONETILE; ++ else if (!vips_object_argument_isset(object, "depth")) ++ dz->depth = VIPS_FOREIGN_DZ_DEPTH_ONETILE; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_dz_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_dz_parent_class)->build(object)) ++ return (-1); + + /* Optional rotate. + */ +-{ +- VipsImage *z; ++ { ++ VipsImage *z; + +- if( vips_rot( save->ready, &z, dz->angle, NULL ) ) +- return( -1 ); ++ if (vips_rot(save->ready, &z, dz->angle, NULL)) ++ return (-1); + +- VIPS_UNREF( save->ready ); +- save->ready = z; +-} ++ VIPS_UNREF(save->ready); ++ save->ready = z; ++ } + + /* We use ink to check for blank tiles. + */ +- if( dz->skip_blanks >= 0 ) { +- if( !(dz->ink = vips__vector_to_ink( +- class->nickname, save->ready, +- VIPS_AREA( save->background )->data, NULL, +- VIPS_AREA( save->background )->n )) ) +- return( -1 ); ++ if (dz->skip_blanks >= 0) { ++ if (!(dz->ink = vips__vector_to_ink( ++ class->nickname, save->ready, ++ VIPS_AREA(save->background)->data, NULL, ++ VIPS_AREA(save->background)->n))) ++ return (-1); + } + + /* The real pixels we have from our input. This is about to get +- * expanded with background. ++ * expanded with background. + */ + real_pixels.left = 0; + real_pixels.top = 0; +@@ -2383,149 +2385,143 @@ vips_foreign_save_dz_build( VipsObject *object ) + /* For centred images, imagine shrinking so that the image fits in a + * single tile, centering in that tile, then expanding back again. + */ +- if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_GOOGLE && +- dz->centre ) { ++ if (dz->layout == VIPS_FOREIGN_DZ_LAYOUT_GOOGLE && ++ dz->centre) { + VipsImage *z; + Layer *layer; + int n_layers; + int size; + +- if( !(layer = pyramid_build( dz, NULL, +- save->ready->Xsize, save->ready->Ysize, +- &real_pixels )) ) +- return( -1 ); ++ if (!(layer = pyramid_build(dz, NULL, ++ save->ready->Xsize, save->ready->Ysize, ++ &real_pixels))) ++ return (-1); + n_layers = layer->n; + /* This would cause interesting problems. + */ +- g_assert( n_layers < 30 ); +- layer_free( layer ); ++ g_assert(n_layers < 30); ++ layer_free(layer); + size = dz->tile_size * (1 << n_layers); + + real_pixels.left = (size - save->ready->Xsize) / 2; + real_pixels.top = (size - save->ready->Ysize) / 2; + +- if( vips_embed( save->ready, &z, +- real_pixels.left, real_pixels.top, +- size, size, +- "background", save->background, +- NULL ) ) +- return( -1 ); ++ if (vips_embed(save->ready, &z, ++ real_pixels.left, real_pixels.top, ++ size, size, ++ "background", save->background, ++ NULL)) ++ return (-1); + +- VIPS_UNREF( save->ready ); ++ VIPS_UNREF(save->ready); + save->ready = z; + + #ifdef DEBUG +- printf( "centre: centring within a %d x %d image\n", +- size, size ); ++ printf("centre: centring within a %d x %d image\n", ++ size, size); + #endif /*DEBUG*/ +- + } + + #ifdef DEBUG +- printf( "vips_foreign_save_dz_build: tile_size == %d\n", +- dz->tile_size ); +- printf( "vips_foreign_save_dz_build: overlap == %d\n", +- dz->overlap ); +- printf( "vips_foreign_save_dz_build: tile_margin == %d\n", +- dz->tile_margin ); +- printf( "vips_foreign_save_dz_build: tile_step == %d\n", +- dz->tile_step ); ++ printf("vips_foreign_save_dz_build: tile_size == %d\n", ++ dz->tile_size); ++ printf("vips_foreign_save_dz_build: overlap == %d\n", ++ dz->overlap); ++ printf("vips_foreign_save_dz_build: tile_margin == %d\n", ++ dz->tile_margin); ++ printf("vips_foreign_save_dz_build: tile_step == %d\n", ++ dz->tile_step); + #endif /*DEBUG*/ + + /* Init basename and dirname from the associated filesystem names, if + * we can. + */ +-{ +- const char *filename = dz->filename ? +- dz->filename : +- vips_connection_filename( VIPS_CONNECTION( dz->target ) ); ++ { ++ const char *filename = dz->filename ? dz->filename : vips_connection_filename(VIPS_CONNECTION(dz->target)); + +- if( !vips_object_argument_isset( object, "basename" ) ) { +- if( filename ) +- dz->basename = g_path_get_basename( filename ); +- else +- dz->basename = g_strdup( "untitled" ); +- } ++ if (!vips_object_argument_isset(object, "basename")) { ++ if (filename) ++ dz->basename = g_path_get_basename(filename); ++ else ++ dz->basename = g_strdup("untitled"); ++ } + +- if( !vips_object_argument_isset( object, "dirname" ) ) { +- if( filename ) +- dz->dirname = g_path_get_dirname( filename ); ++ if (!vips_object_argument_isset(object, "dirname")) { ++ if (filename) ++ dz->dirname = g_path_get_dirname(filename); ++ } + } +-} + + /* Remove any [options] from basename. + */ +- if( (p = (char *) vips__find_rightmost_brackets( dz->basename )) ) ++ if ((p = (char *) vips__find_rightmost_brackets(dz->basename))) + *p = '\0'; + +- /* If we're writing thing.zip or thing.szi, default to zip ++ /* If we're writing thing.zip or thing.szi, default to zip + * container. + */ +- if( (p = strrchr( dz->basename, '.' )) ) { +- if( !vips_object_argument_isset( object, "container" ) ) { +- if( g_ascii_strcasecmp( p + 1, "zip" ) == 0 ) ++ if ((p = strrchr(dz->basename, '.'))) { ++ if (!vips_object_argument_isset(object, "container")) { ++ if (g_ascii_strcasecmp(p + 1, "zip") == 0) + dz->container = VIPS_FOREIGN_DZ_CONTAINER_ZIP; +- if( g_ascii_strcasecmp( p + 1, "szi" ) == 0 ) ++ if (g_ascii_strcasecmp(p + 1, "szi") == 0) + dz->container = VIPS_FOREIGN_DZ_CONTAINER_SZI; + } + + /* Remove any legal suffix. We don't remove all suffixes + * since we might be writing to a dirname with a dot in. + */ +- if( g_ascii_strcasecmp( p + 1, "zip" ) == 0 || +- g_ascii_strcasecmp( p + 1, "szi" ) == 0 || +- g_ascii_strcasecmp( p + 1, "dz" ) == 0 ) ++ if (g_ascii_strcasecmp(p + 1, "zip") == 0 || ++ g_ascii_strcasecmp(p + 1, "szi") == 0 || ++ g_ascii_strcasecmp(p + 1, "dz") == 0) + *p = '\0'; + } + + /* Build the skeleton of the image pyramid. + */ +- if( !(dz->layer = pyramid_build( dz, NULL, +- save->ready->Xsize, save->ready->Ysize, &real_pixels )) ) +- return( -1 ); ++ if (!(dz->layer = pyramid_build(dz, NULL, ++ save->ready->Xsize, save->ready->Ysize, &real_pixels))) ++ return (-1); + +- if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_DZ ) +- dz->root_name = g_strdup_printf( "%s_files", dz->basename ); ++ if (dz->layout == VIPS_FOREIGN_DZ_LAYOUT_DZ) ++ dz->root_name = g_strdup_printf("%s_files", dz->basename); + else +- dz->root_name = g_strdup( dz->basename ); ++ dz->root_name = g_strdup(dz->basename); + + /* Drop any [options] from @suffix. + */ +- dz->file_suffix = g_strdup( dz->suffix ); +- if( (p = (char *) vips__find_rightmost_brackets( dz->file_suffix )) ) ++ dz->file_suffix = g_strdup(dz->suffix); ++ if ((p = (char *) vips__find_rightmost_brackets(dz->file_suffix))) + *p = '\0'; + + /* Make the thing we write the tiles into. + */ +- switch( dz->container ) { +- case VIPS_FOREIGN_DZ_CONTAINER_FS: +-{ ++ switch (dz->container) { ++ case VIPS_FOREIGN_DZ_CONTAINER_FS: { + GsfOutput *out; + char name[VIPS_PATH_MAX]; + +- /* For filesystem output of deepzoom, we write +- * dirname/basename_files/ and dirname/basename.dzi, ie. the ++ /* For filesystem output of deepzoom, we write ++ * dirname/basename_files/ and dirname/basename.dzi, ie. the + * output does not go into a subdirectory. + */ +- if( dz->layout == VIPS_FOREIGN_DZ_LAYOUT_DZ ) +- vips_snprintf( name, VIPS_PATH_MAX, +- "%s", dz->dirname ); ++ if (dz->layout == VIPS_FOREIGN_DZ_LAYOUT_DZ) ++ vips_snprintf(name, VIPS_PATH_MAX, ++ "%s", dz->dirname); + else +- vips_snprintf( name, VIPS_PATH_MAX, +- "%s/%s", dz->dirname, dz->basename ); ++ vips_snprintf(name, VIPS_PATH_MAX, ++ "%s/%s", dz->dirname, dz->basename); + +- if( !(out = (GsfOutput *) +- gsf_output_dir_new( name, NULL )) ) { +- return( -1 ); ++ if (!(out = (GsfOutput *) ++ gsf_output_dir_new(name, NULL))) { ++ return (-1); + } +- +- dz->tree = vips_gsf_tree_new( out, 0 ); +-} +- break; ++ ++ dz->tree = vips_gsf_tree_new(out, 0); ++ } break; + + case VIPS_FOREIGN_DZ_CONTAINER_ZIP: +- case VIPS_FOREIGN_DZ_CONTAINER_SZI: +-{ ++ case VIPS_FOREIGN_DZ_CONTAINER_SZI: { + GsfOutput *zip; + GsfOutput *out2; + GError *error = NULL; +@@ -2533,102 +2529,101 @@ vips_foreign_save_dz_build( VipsObject *object ) + /* We can have dzsave("x.zip", container="fs"), ie. zip output + * from write to file. Make a target if we need one. + */ +- if( !dz->target ) { +- if( !(dz->target = +- vips_target_new_to_file( dz->filename )) ) +- return( -1 ); ++ if (!dz->target) { ++ if (!(dz->target = ++ vips_target_new_to_file(dz->filename))) ++ return (-1); + } + + /* Can be memory, a file (not a directory tree), pipe, etc. + */ +- dz->out = gsf_output_target_new( dz->target ); ++ dz->out = gsf_output_target_new(dz->target); + +- if( !(zip = (GsfOutput *) +- gsf_outfile_zip_new( dz->out, &error )) ) { +- vips_g_error( &error ); +- return( -1 ); ++ if (!(zip = (GsfOutput *) ++ gsf_outfile_zip_new(dz->out, &error))) { ++ vips_g_error(&error); ++ return (-1); + } + + /* Make the base directory inside the zip. All stuff goes into +- * this. ++ * this. + */ +- out2 = gsf_outfile_new_child_full( (GsfOutfile *) zip, ++ out2 = gsf_outfile_new_child_full((GsfOutfile *) zip, + dz->basename, TRUE, +- "compression-level", GSF_ZIP_STORED, +- NULL ); ++ "compression-level", GSF_ZIP_STORED, ++ NULL); + + #ifndef HAVE_GSF_DEFLATE_LEVEL +- if( dz->compression > 0 ) { +- g_warning( "%s", +- _( "deflate-level not supported by libgsf, " +- "using default compression" ) ); ++ if (dz->compression > 0) { ++ g_warning("%s", ++ _("deflate-level not supported by libgsf, " ++ "using default compression")); + dz->compression = -1; + } + #endif /*HAVE_GSF_DEFLATE_LEVEL*/ + +- dz->tree = vips_gsf_tree_new( out2, dz->compression ); ++ dz->tree = vips_gsf_tree_new(out2, dz->compression); + + /* Note the thing that will need closing up on exit. + */ +- dz->tree->container = zip; +-} +- break; ++ dz->tree->container = zip; ++ } break; + + default: + g_assert_not_reached(); + } + +- if( vips_sink_disc( save->ready, pyramid_strip, dz ) ) +- return( -1 ); ++ if (vips_sink_disc(save->ready, pyramid_strip, dz)) ++ return (-1); + +- switch( dz->layout ) { ++ switch (dz->layout) { + case VIPS_FOREIGN_DZ_LAYOUT_DZ: +- if( write_dzi( dz ) ) +- return( -1 ); ++ if (write_dzi(dz)) ++ return (-1); + break; + + case VIPS_FOREIGN_DZ_LAYOUT_ZOOMIFY: +- if( write_properties( dz ) ) +- return( -1 ); ++ if (write_properties(dz)) ++ return (-1); + break; + + case VIPS_FOREIGN_DZ_LAYOUT_GOOGLE: +- if( write_blank( dz ) ) +- return( -1 ); ++ if (write_blank(dz)) ++ return (-1); + break; + + case VIPS_FOREIGN_DZ_LAYOUT_IIIF: + case VIPS_FOREIGN_DZ_LAYOUT_IIIF3: +- if( write_json( dz ) ) +- return( -1 ); ++ if (write_json(dz)) ++ return (-1); + break; + + default: + g_assert_not_reached(); + } + +- if( write_vips_meta( dz ) ) +- return( -1 ); ++ if (write_vips_meta(dz)) ++ return (-1); + +- if( dz->container == VIPS_FOREIGN_DZ_CONTAINER_SZI && +- write_scan_properties( dz ) ) +- return( -1 ); ++ if (dz->container == VIPS_FOREIGN_DZ_CONTAINER_SZI && ++ write_scan_properties(dz)) ++ return (-1); + +- if( dz->container == VIPS_FOREIGN_DZ_CONTAINER_SZI && +- write_associated( dz ) ) +- return( -1 ); ++ if (dz->container == VIPS_FOREIGN_DZ_CONTAINER_SZI && ++ write_associated(dz)) ++ return (-1); + + /* Shut down the output to flush everything. + */ +- if( vips_gsf_tree_close( dz->tree ) ) +- return( -1 ); +- dz->tree = NULL; ++ if (vips_gsf_tree_close(dz->tree)) ++ return (-1); ++ dz->tree = NULL; + + /* unref out to force flush in gsf_output_target_close(). + */ +- VIPS_UNREF( dz->out ); ++ VIPS_UNREF(dz->out); + +- return( 0 ); ++ return (0); + } + + /* Save a bit of typing. +@@ -2652,9 +2647,9 @@ static VipsBandFormat bandfmt_dz[10] = { + static const char *dz_suffs[] = { ".dz", ".szi", NULL }; + + static void +-vips_foreign_save_dz_class_init( VipsForeignSaveDzClass *class ) ++vips_foreign_save_dz_class_init(VipsForeignSaveDzClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; +@@ -2664,7 +2659,7 @@ vips_foreign_save_dz_class_init( VipsForeignSaveDzClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "dzsave_base"; +- object_class->description = _( "save image to deep zoom format" ); ++ object_class->description = _("save image to deep zoom format"); + object_class->build = vips_foreign_save_dz_build; + + foreign_class->suffs = dz_suffs; +@@ -2673,148 +2668,147 @@ vips_foreign_save_dz_class_init( VipsForeignSaveDzClass *class ) + save_class->format_table = bandfmt_dz; + save_class->coding[VIPS_CODING_LABQ] = TRUE; + +- VIPS_ARG_STRING( class, "basename", 2, +- _( "Base name" ), +- _( "Base name to save to" ), ++ VIPS_ARG_STRING(class, "basename", 2, ++ _("Base name"), ++ _("Base name to save to"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDz, basename ), +- NULL ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, basename), ++ NULL); + +- VIPS_ARG_ENUM( class, "layout", 8, +- _( "Layout" ), +- _( "Directory layout" ), ++ VIPS_ARG_ENUM(class, "layout", 8, ++ _("Layout"), ++ _("Directory layout"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDz, layout ), +- VIPS_TYPE_FOREIGN_DZ_LAYOUT, VIPS_FOREIGN_DZ_LAYOUT_DZ ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, layout), ++ VIPS_TYPE_FOREIGN_DZ_LAYOUT, VIPS_FOREIGN_DZ_LAYOUT_DZ); + +- VIPS_ARG_STRING( class, "suffix", 9, +- _( "Suffix" ), +- _( "Filename suffix for tiles" ), ++ VIPS_ARG_STRING(class, "suffix", 9, ++ _("Suffix"), ++ _("Filename suffix for tiles"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDz, suffix ), +- ".jpeg" ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, suffix), ++ ".jpeg"); + +- VIPS_ARG_INT( class, "overlap", 10, +- _( "Overlap" ), +- _( "Tile overlap in pixels" ), ++ VIPS_ARG_INT(class, "overlap", 10, ++ _("Overlap"), ++ _("Tile overlap in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDz, overlap ), +- 0, 8192, 1 ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, overlap), ++ 0, 8192, 1); + +- VIPS_ARG_INT( class, "tile_size", 11, +- _( "Tile size" ), +- _( "Tile size in pixels" ), ++ VIPS_ARG_INT(class, "tile_size", 11, ++ _("Tile size"), ++ _("Tile size in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDz, tile_size ), +- 1, 8192, 254 ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, tile_size), ++ 1, 8192, 254); + +- VIPS_ARG_ENUM( class, "depth", 13, +- _( "Depth" ), +- _( "Pyramid depth" ), ++ VIPS_ARG_ENUM(class, "depth", 13, ++ _("Depth"), ++ _("Pyramid depth"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDz, depth ), +- VIPS_TYPE_FOREIGN_DZ_DEPTH, VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, depth), ++ VIPS_TYPE_FOREIGN_DZ_DEPTH, VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL); + +- VIPS_ARG_BOOL( class, "centre", 13, +- _( "Center" ), +- _( "Center image in tile" ), ++ VIPS_ARG_BOOL(class, "centre", 13, ++ _("Center"), ++ _("Center image in tile"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDz, centre ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, centre), ++ FALSE); + +- VIPS_ARG_ENUM( class, "angle", 14, +- _( "Angle" ), +- _( "Rotate image during save" ), ++ VIPS_ARG_ENUM(class, "angle", 14, ++ _("Angle"), ++ _("Rotate image during save"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDz, angle ), +- VIPS_TYPE_ANGLE, VIPS_ANGLE_D0 ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, angle), ++ VIPS_TYPE_ANGLE, VIPS_ANGLE_D0); + +- VIPS_ARG_ENUM( class, "container", 15, +- _( "Container" ), +- _( "Pyramid container type" ), ++ VIPS_ARG_ENUM(class, "container", 15, ++ _("Container"), ++ _("Pyramid container type"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDz, container ), +- VIPS_TYPE_FOREIGN_DZ_CONTAINER, VIPS_FOREIGN_DZ_CONTAINER_FS ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, container), ++ VIPS_TYPE_FOREIGN_DZ_CONTAINER, VIPS_FOREIGN_DZ_CONTAINER_FS); + +- VIPS_ARG_INT( class, "compression", 17, +- _( "Compression" ), +- _( "ZIP deflate compression level" ), ++ VIPS_ARG_INT(class, "compression", 17, ++ _("Compression"), ++ _("ZIP deflate compression level"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDz, compression ), +- -1, 9, 0 ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, compression), ++ -1, 9, 0); + +- VIPS_ARG_ENUM( class, "region_shrink", 18, +- _( "Region shrink" ), +- _( "Method to shrink regions" ), ++ VIPS_ARG_ENUM(class, "region_shrink", 18, ++ _("Region shrink"), ++ _("Method to shrink regions"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDz, region_shrink ), +- VIPS_TYPE_REGION_SHRINK, VIPS_REGION_SHRINK_MEAN ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, region_shrink), ++ VIPS_TYPE_REGION_SHRINK, VIPS_REGION_SHRINK_MEAN); + +- VIPS_ARG_INT( class, "skip_blanks", 19, +- _( "Skip blanks" ), +- _( "Skip tiles which are nearly equal to the background" ), ++ VIPS_ARG_INT(class, "skip_blanks", 19, ++ _("Skip blanks"), ++ _("Skip tiles which are nearly equal to the background"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDz, skip_blanks ), +- -1, 65535, -1 ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, skip_blanks), ++ -1, 65535, -1); + +- VIPS_ARG_BOOL( class, "no_strip", 20, +- _( "No strip" ), +- _( "Don't strip tile metadata" ), ++ VIPS_ARG_BOOL(class, "no_strip", 20, ++ _("No strip"), ++ _("Don't strip tile metadata"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDz, no_strip ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, no_strip), ++ FALSE); + +- VIPS_ARG_STRING( class, "id", 21, +- _( "id" ), +- _( "Resource ID" ), ++ VIPS_ARG_STRING(class, "id", 21, ++ _("id"), ++ _("Resource ID"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDz, id ), +- "https://example.com/iiif" ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, id), ++ "https://example.com/iiif"); + + /* How annoying. We stupidly had these in earlier versions. + */ + +- VIPS_ARG_STRING( class, "dirname", 1, +- _( "Directory name" ), +- _( "Directory name to save to" ), ++ VIPS_ARG_STRING(class, "dirname", 1, ++ _("Directory name"), ++ _("Directory name to save to"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignSaveDz, dirname ), +- NULL ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, dirname), ++ NULL); + +- VIPS_ARG_INT( class, "tile_width", 12, +- _( "Tile width" ), +- _( "Tile width in pixels" ), ++ VIPS_ARG_INT(class, "tile_width", 12, ++ _("Tile width"), ++ _("Tile width in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignSaveDz, tile_size ), +- 1, 8192, 254 ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, tile_size), ++ 1, 8192, 254); + +- VIPS_ARG_INT( class, "tile_height", 12, +- _( "Tile height" ), +- _( "Tile height in pixels" ), ++ VIPS_ARG_INT(class, "tile_height", 12, ++ _("Tile height"), ++ _("Tile height in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignSaveDz, tile_size ), +- 1, 8192, 254 ); ++ G_STRUCT_OFFSET(VipsForeignSaveDz, tile_size), ++ 1, 8192, 254); + +- VIPS_ARG_BOOL( class, "properties", 16, +- _( "Properties" ), +- _( "Write a properties file to the output directory" ), ++ VIPS_ARG_BOOL(class, "properties", 16, ++ _("Properties"), ++ _("Write a properties file to the output directory"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignSaveDz, properties ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsForeignSaveDz, properties), ++ FALSE); + } + + static void +-vips_foreign_save_dz_init( VipsForeignSaveDz *dz ) ++vips_foreign_save_dz_init(VipsForeignSaveDz *dz) + { +- VIPS_SETSTR( dz->suffix, ".jpeg" ); +- dz->layout = VIPS_FOREIGN_DZ_LAYOUT_DZ; ++ VIPS_SETSTR(dz->suffix, ".jpeg"); ++ dz->layout = VIPS_FOREIGN_DZ_LAYOUT_DZ; + dz->overlap = 1; + dz->tile_size = 254; + dz->tile_count = 0; +- dz->depth = VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL; +- dz->angle = VIPS_ANGLE_D0; +- dz->container = VIPS_FOREIGN_DZ_CONTAINER_FS; ++ dz->depth = VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL; ++ dz->angle = VIPS_ANGLE_D0; ++ dz->container = VIPS_FOREIGN_DZ_CONTAINER_FS; + dz->compression = 0; + dz->region_shrink = VIPS_REGION_SHRINK_MEAN; + dz->skip_blanks = -1; +@@ -2823,54 +2817,53 @@ vips_foreign_save_dz_init( VipsForeignSaveDz *dz ) + typedef struct _VipsForeignSaveDzTarget { + VipsForeignSaveDz parent_object; + +- VipsTarget *target; ++ VipsTarget *target; + + } VipsForeignSaveDzTarget; + + typedef VipsForeignSaveDzClass VipsForeignSaveDzTargetClass; + +-G_DEFINE_TYPE( VipsForeignSaveDzTarget, vips_foreign_save_dz_target, +- vips_foreign_save_dz_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveDzTarget, vips_foreign_save_dz_target, ++ vips_foreign_save_dz_get_type()); + + static int +-vips_foreign_save_dz_target_build( VipsObject *object ) ++vips_foreign_save_dz_target_build(VipsObject *object) + { + VipsForeignSaveDz *dz = (VipsForeignSaveDz *) object; + VipsForeignSaveDzTarget *target = (VipsForeignSaveDzTarget *) object; + + dz->target = target->target; +- g_object_ref( dz->target ); ++ g_object_ref(dz->target); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_dz_target_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_dz_target_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_dz_target_class_init( VipsForeignSaveDzTargetClass *class ) ++vips_foreign_save_dz_target_class_init(VipsForeignSaveDzTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "dzsave_target"; +- object_class->description = _( "save image to deepzoom target" ); ++ object_class->description = _("save image to deepzoom target"); + object_class->build = vips_foreign_save_dz_target_build; + +- VIPS_ARG_OBJECT( class, "target", 1, +- _( "Target" ), +- _( "Target to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDzTarget, target ), +- VIPS_TYPE_TARGET ); ++ VIPS_ARG_OBJECT(class, "target", 1, ++ _("Target"), ++ _("Target to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveDzTarget, target), ++ VIPS_TYPE_TARGET); + } + + static void +-vips_foreign_save_dz_target_init( VipsForeignSaveDzTarget *target ) ++vips_foreign_save_dz_target_init(VipsForeignSaveDzTarget *target) + { + VipsForeignSaveDz *dz = (VipsForeignSaveDz *) target; + +@@ -2884,53 +2877,52 @@ typedef struct _VipsForeignSaveDzFile { + + /* Filename for save. + */ +- char *filename; ++ char *filename; + + } VipsForeignSaveDzFile; + + typedef VipsForeignSaveDzClass VipsForeignSaveDzFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveDzFile, vips_foreign_save_dz_file, +- vips_foreign_save_dz_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveDzFile, vips_foreign_save_dz_file, ++ vips_foreign_save_dz_get_type()); + + static int +-vips_foreign_save_dz_file_build( VipsObject *object ) ++vips_foreign_save_dz_file_build(VipsObject *object) + { + VipsForeignSaveDz *dz = (VipsForeignSaveDz *) object; + VipsForeignSaveDzFile *file = (VipsForeignSaveDzFile *) object; + + dz->filename = file->filename; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_dz_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_dz_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_dz_file_class_init( VipsForeignSaveDzFileClass *class ) ++vips_foreign_save_dz_file_class_init(VipsForeignSaveDzFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "dzsave"; +- object_class->description = _( "save image to deepzoom file" ); ++ object_class->description = _("save image to deepzoom file"); + object_class->build = vips_foreign_save_dz_file_build; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDzFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveDzFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_dz_file_init( VipsForeignSaveDzFile *file ) ++vips_foreign_save_dz_file_init(VipsForeignSaveDzFile *file) + { + } + +@@ -2942,54 +2934,53 @@ typedef struct _VipsForeignSaveDzBuffer { + + typedef VipsForeignSaveDzClass VipsForeignSaveDzBufferClass; + +-G_DEFINE_TYPE( VipsForeignSaveDzBuffer, vips_foreign_save_dz_buffer, +- vips_foreign_save_dz_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveDzBuffer, vips_foreign_save_dz_buffer, ++ vips_foreign_save_dz_get_type()); + + static int +-vips_foreign_save_dz_buffer_build( VipsObject *object ) ++vips_foreign_save_dz_buffer_build(VipsObject *object) + { + VipsForeignSaveDz *dz = (VipsForeignSaveDz *) object; + VipsForeignSaveDzBuffer *buffer = (VipsForeignSaveDzBuffer *) object; + + VipsBlob *blob; + +- if( !(dz->target = vips_target_new_to_memory()) ) +- return( -1 ); ++ if (!(dz->target = vips_target_new_to_memory())) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_dz_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_dz_buffer_parent_class)->build(object)) ++ return (-1); + +- g_object_get( dz->target, "blob", &blob, NULL ); +- g_object_set( buffer, "buffer", blob, NULL ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ g_object_get(dz->target, "blob", &blob, NULL); ++ g_object_set(buffer, "buffer", blob, NULL); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_dz_buffer_class_init( VipsForeignSaveDzBufferClass *class ) ++vips_foreign_save_dz_buffer_class_init(VipsForeignSaveDzBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "dzsave_buffer"; +- object_class->description = _( "save image to dz buffer" ); ++ object_class->description = _("save image to dz buffer"); + object_class->build = vips_foreign_save_dz_buffer_build; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to save to" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsForeignSaveDzBuffer, buf ), +- VIPS_TYPE_BLOB ); ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to save to"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveDzBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_save_dz_buffer_init( VipsForeignSaveDzBuffer *buffer ) ++vips_foreign_save_dz_buffer_init(VipsForeignSaveDzBuffer *buffer) + { + VipsForeignSaveDz *dz = (VipsForeignSaveDz *) buffer; + +@@ -3002,20 +2993,20 @@ vips_foreign_save_dz_buffer_init( VipsForeignSaveDzBuffer *buffer ) + + /** + * vips_dzsave: (method) +- * @in: image to save +- * @name: name to save to ++ * @in: image to save ++ * @name: name to save to + * @...: %NULL-terminated list of optional named arguments + * + * Optional arguments: + * + * * @basename: %gchar base part of name + * * @layout: #VipsForeignDzLayout directory layout convention +- * * @suffix: %gchar suffix for tiles +- * * @overlap: %gint set tile overlap +- * * @tile_size: %gint set tile size ++ * * @suffix: %gchar suffix for tiles ++ * * @overlap: %gint set tile overlap ++ * * @tile_size: %gint set tile size + * * @background: #VipsArrayDouble background colour + * * @depth: #VipsForeignDzDepth how deep to make the pyramid +- * * @centre: %gboolean centre the tiles ++ * * @centre: %gboolean centre the tiles + * * @angle: #VipsAngle rotate the image by this much + * * @container: #VipsForeignDzContainer set container type + * * @compression: %gint zip deflate compression level +@@ -3029,18 +3020,18 @@ vips_foreign_save_dz_buffer_init( VipsForeignSaveDzBuffer *buffer ) + * + * vips_dzsave() creates a directory called @name to hold the tiles. If @name + * ends `.zip`, vips_dzsave() will create a zip file called @name to hold the +- * tiles. You can use @container to force zip file output. ++ * tiles. You can use @container to force zip file output. + * + * Use @basename to set the name of the directory tree we are creating. The +- * default value is set from @name. ++ * default value is set from @name. ++ * ++ * You can set @suffix to something like `".jpg[Q=85]"` to control the tile ++ * write options. + * +- * You can set @suffix to something like `".jpg[Q=85]"` to control the tile +- * write options. +- * +- * In Google layout mode, edge tiles are expanded to @tile_size by @tile_size ++ * In Google layout mode, edge tiles are expanded to @tile_size by @tile_size + * pixels. Normally they are filled with white, but you can set another colour + * with @background. Images are usually placed at the top-left of the tile, +- * but you can have them centred by turning on @centre. ++ * but you can have them centred by turning on @centre. + * + * You can set the size and overlap of tiles with @tile_size and @overlap. + * They default to the correct settings for the selected @layout. The deepzoom +@@ -3053,7 +3044,7 @@ vips_foreign_save_dz_buffer_init( VipsForeignSaveDzBuffer *buffer ) + * You can rotate the image during write with the @angle argument. However, + * this will only work for images which support random access, like openslide, + * and not for things like JPEG. You'll need to rotate those images +- * yourself with vips_rot(). Note that the `autorotate` option to the loader ++ * yourself with vips_rot(). Note that the `autorotate` option to the loader + * may do what you need. + * + * By default, all tiles are stripped since usually you do not want a copy of +@@ -3067,36 +3058,36 @@ vips_foreign_save_dz_buffer_init( VipsForeignSaveDzBuffer *buffer ) + * region. This defaults to using the average of the 4 input pixels but you can + * also use the median in cases where you want to preserve the range of values. + * +- * If you set @skip_blanks to a value greater than or equal to zero, tiles +- * which are all within that many pixel values to the background are skipped. +- * This can save a lot of space for some image types. This option defaults to ++ * If you set @skip_blanks to a value greater than or equal to zero, tiles ++ * which are all within that many pixel values to the background are skipped. ++ * This can save a lot of space for some image types. This option defaults to + * 5 in Google layout mode, -1 otherwise. + * +- * In IIIF layout, you can set the base of the `id` property in `info.json` ++ * In IIIF layout, you can set the base of the `id` property in `info.json` + * with @id. The default is `https://example.com/iiif`. + * +- * Use @layout #VIPS_FOREIGN_DZ_LAYOUT_IIIF3 for IIIF v3 layout. +- * ++ * Use @layout #VIPS_FOREIGN_DZ_LAYOUT_IIIF3 for IIIF v3 layout. ++ * + * See also: vips_tiffsave(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_dzsave( VipsImage *in, const char *name, ... ) ++vips_dzsave(VipsImage *in, const char *name, ...) + { + va_list ap; + int result; + +- va_start( ap, name ); +- result = vips_call_split( "dzsave", ap, in, name ); +- va_end( ap ); ++ va_start(ap, name); ++ result = vips_call_split("dzsave", ap, in, name); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_dzsave_buffer: (method) +- * @in: image to save ++ * @in: image to save + * @buf: (array length=len) (element-type guint8): return output buffer here + * @len: (type gsize): return output length here + * @...: %NULL-terminated list of optional named arguments +@@ -3105,12 +3096,12 @@ vips_dzsave( VipsImage *in, const char *name, ... ) + * + * * @basename: %gchar base part of name + * * @layout: #VipsForeignDzLayout directory layout convention +- * * @suffix: %gchar suffix for tiles +- * * @overlap: %gint set tile overlap +- * * @tile_size: %gint set tile size ++ * * @suffix: %gchar suffix for tiles ++ * * @overlap: %gint set tile overlap ++ * * @tile_size: %gint set tile size + * * @background: #VipsArrayDouble background colour + * * @depth: #VipsForeignDzDepth how deep to make the pyramid +- * * @centre: %gboolean centre the tiles ++ * * @centre: %gboolean centre the tiles + * * @angle: #VipsAngle rotate the image by this much + * * @container: #VipsForeignDzContainer set container type + * * @compression: %gint zip deflate compression level +@@ -3119,10 +3110,10 @@ vips_dzsave( VipsImage *in, const char *name, ... ) + * * @no_strip: %gboolean don't strip tiles + * * @id: %gchar id for IIIF properties + * +- * As vips_dzsave(), but save to a memory buffer. ++ * As vips_dzsave(), but save to a memory buffer. + * + * Output is always in a zip container. Use @basename to set the name of the +- * directory that the zip will create when unzipped. ++ * directory that the zip will create when unzipped. + * + * The address of the buffer is returned in @buf, the length of the buffer in + * @len. You are responsible for freeing the buffer with g_free() when you +@@ -3133,36 +3124,36 @@ vips_dzsave( VipsImage *in, const char *name, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_dzsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++vips_dzsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + { + va_list ap; + VipsArea *area; + int result; + +- area = NULL; ++ area = NULL; + +- va_start( ap, len ); +- result = vips_call_split( "dzsave_buffer", ap, in, &area ); +- va_end( ap ); ++ va_start(ap, len); ++ result = vips_call_split("dzsave_buffer", ap, in, &area); ++ va_end(ap); + +- if( !result && +- area ) { +- if( buf ) { ++ if (!result && ++ area) { ++ if (buf) { + *buf = area->data; + area->free_fn = NULL; + } +- if( len ) ++ if (len) + *len = area->length; + +- vips_area_unref( area ); ++ vips_area_unref(area); + } + +- return( result ); ++ return (result); + } + + /** + * vips_dzsave_target: (method) +- * @in: image to save ++ * @in: image to save + * @target: save image to this target + * @...: %NULL-terminated list of optional named arguments + * +@@ -3170,12 +3161,12 @@ vips_dzsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) + * + * * @basename: %gchar base part of name + * * @layout: #VipsForeignDzLayout directory layout convention +- * * @suffix: %gchar suffix for tiles +- * * @overlap: %gint set tile overlap +- * * @tile_size: %gint set tile size ++ * * @suffix: %gchar suffix for tiles ++ * * @overlap: %gint set tile overlap ++ * * @tile_size: %gint set tile size + * * @background: #VipsArrayDouble background colour + * * @depth: #VipsForeignDzDepth how deep to make the pyramid +- * * @centre: %gboolean centre the tiles ++ * * @centre: %gboolean centre the tiles + * * @angle: #VipsAngle rotate the image by this much + * * @container: #VipsForeignDzContainer set container type + * * @compression: %gint zip deflate compression level +@@ -3191,14 +3182,14 @@ vips_dzsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_dzsave_target( VipsImage *in, VipsTarget *target, ... ) ++vips_dzsave_target(VipsImage *in, VipsTarget *target, ...) + { + va_list ap; + int result; + +- va_start( ap, target ); +- result = vips_call_split( "dzsave_target", ap, in, target ); +- va_end( ap ); ++ va_start(ap, target); ++ result = vips_call_split("dzsave_target", ap, in, target); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/exif.c b/libvips/foreign/exif.c +index a22526dac2..bfdd7241a8 100644 +--- a/libvips/foreign/exif.c ++++ b/libvips/foreign/exif.c +@@ -10,35 +10,35 @@ + * 3/7/18 + * - add support for writing string-valued fields + * 9/7/18 [@Nan619] +- * - get tag name from tag plus ifd ++ * - get tag name from tag plus ifd + * 13/11/21 + * - better handling of strings with embedded metacharacters + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -82,205 +82,206 @@ + /* Print exif for debugging ... hacked from exif-0.6.9/actions.c + */ + static void +-show_tags( ExifData *data ) ++show_tags(ExifData *data) + { + int i; + unsigned int tag; + const char *name; + +- printf( "show EXIF tags:\n" ); +- +- for( i = 0; i < EXIF_IFD_COUNT; i++ ) +- printf( "%-7.7s", exif_ifd_get_name( i ) ); +- printf( "\n" ); +- +- for( tag = 0; tag < 0xffff; tag++ ) { +- name = exif_tag_get_title( tag ); +- if( !name ) +- continue; +- printf( " 0x%04x %-29.29s", tag, name ); +- for( i = 0; i < EXIF_IFD_COUNT; i++ ) +- if( exif_content_get_entry( data->ifd[i], tag ) ) +- printf( " * " ); +- else +- printf( " - " ); +- printf( "\n" ); +- } ++ printf("show EXIF tags:\n"); ++ ++ for (i = 0; i < EXIF_IFD_COUNT; i++) ++ printf("%-7.7s", exif_ifd_get_name(i)); ++ printf("\n"); ++ ++ for (tag = 0; tag < 0xffff; tag++) { ++ name = exif_tag_get_title(tag); ++ if (!name) ++ continue; ++ printf(" 0x%04x %-29.29s", tag, name); ++ for (i = 0; i < EXIF_IFD_COUNT; i++) ++ if (exif_content_get_entry(data->ifd[i], tag)) ++ printf(" * "); ++ else ++ printf(" - "); ++ printf("\n"); ++ } + } + + static void +-show_entry( ExifEntry *entry, void *client ) ++show_entry(ExifEntry *entry, void *client) + { + char exif_text[256]; + +- printf( "%s", exif_tag_get_title( entry->tag ) ); +- printf( "|" ); +- printf( "%s", exif_entry_get_value( entry, exif_text, 256 ) ); +- printf( "|" ); +- printf( "%s", exif_format_get_name( entry->format ) ); +- printf( "|" ); +- printf( "%d bytes", entry->size ); +- printf( "\n" ); ++ printf("%s", exif_tag_get_title(entry->tag)); ++ printf("|"); ++ printf("%s", exif_entry_get_value(entry, exif_text, 256)); ++ printf("|"); ++ printf("%s", exif_format_get_name(entry->format)); ++ printf("|"); ++ printf("%d bytes", entry->size); ++ printf("\n"); + } + + static void +-show_ifd( ExifContent *content, void *client ) ++show_ifd(ExifContent *content, void *client) + { + int *ifd = (int *) client; + +- printf( "- ifd %d\n", *ifd ); +- exif_content_foreach_entry( content, show_entry, client ); ++ printf("- ifd %d\n", *ifd); ++ exif_content_foreach_entry(content, show_entry, client); + + *ifd += 1; + } + + static void +-show_values( ExifData *data ) ++show_values(ExifData *data) + { +- ExifByteOrder order; ++ ExifByteOrder order; + int ifd; + +- order = exif_data_get_byte_order( data ); +- printf( "EXIF tags in '%s' byte order\n", +- exif_byte_order_get_name( order ) ); ++ order = exif_data_get_byte_order(data); ++ printf("EXIF tags in '%s' byte order\n", ++ exif_byte_order_get_name(order)); + +- printf( "Title|Value|Format|Size\n" ); ++ printf("Title|Value|Format|Size\n"); + + ifd = 0; +- exif_data_foreach_content( data, show_ifd, &ifd ); ++ exif_data_foreach_content(data, show_ifd, &ifd); + +- if( data->size ) +- printf( "contains thumbnail of %d bytes\n", data->size ); ++ if (data->size) ++ printf("contains thumbnail of %d bytes\n", data->size); + } + #endif /*DEBUG_VERBOSE*/ + +-/* Like exif_data_new_from_data(), but don't default missing fields. +- * +- * If we do exif_data_new_from_data(), then missing fields are set to +- * their default value and we won't know about it. ++/* Like exif_data_new_from_data(), but don't default missing fields. ++ * ++ * If we do exif_data_new_from_data(), then missing fields are set to ++ * their default value and we won't know about it. + */ + static ExifData * +-vips_exif_load_data_without_fix( const void *data, size_t length ) ++vips_exif_load_data_without_fix(const void *data, size_t length) + { + ExifData *ed; + + /* exif_data_load_data() only allows uint for length. Limit it to less + * than that: 2**20 should be enough for anyone. + */ +- if( length < 4 ) { +- vips_error( "exif", "%s", _( "exif too small" ) ); +- return( NULL ); ++ if (length < 4) { ++ vips_error("exif", "%s", _("exif too small")); ++ return (NULL); + } +- if( length > 1 << 20 ) { +- vips_error( "exif", "%s", _( "exif too large" ) ); +- return( NULL ); ++ if (length > 1 << 20) { ++ vips_error("exif", "%s", _("exif too large")); ++ return (NULL); + } + +- if( !(ed = exif_data_new()) ) { +- vips_error( "exif", "%s", _( "unable to init exif" ) ); +- return( NULL ); ++ if (!(ed = exif_data_new())) { ++ vips_error("exif", "%s", _("unable to init exif")); ++ return (NULL); + } + +- exif_data_unset_option( ed, EXIF_DATA_OPTION_FOLLOW_SPECIFICATION ); +- if( !vips_isprefix( "Exif", (char *) data ) ) { ++ exif_data_unset_option(ed, EXIF_DATA_OPTION_FOLLOW_SPECIFICATION); ++ if (!vips_isprefix("Exif", (char *) data)) { + /* Ensure "Exif" prefix as loaders may not provide it. + */ +- void* data_with_prefix; +- data_with_prefix = g_malloc0( length + 6 ); +- memcpy( data_with_prefix, "Exif\0\0", 6 ); +- memcpy( data_with_prefix + 6, data, length ); +- exif_data_load_data( ed, data_with_prefix, length + 6 ); +- g_free( data_with_prefix ); +- } else +- exif_data_load_data( ed, data, length ); +- +- return( ed ); ++ void *data_with_prefix; ++ data_with_prefix = g_malloc0(length + 6); ++ memcpy(data_with_prefix, "Exif\0\0", 6); ++ memcpy(data_with_prefix + 6, data, length); ++ exif_data_load_data(ed, data_with_prefix, length + 6); ++ g_free(data_with_prefix); ++ } ++ else ++ exif_data_load_data(ed, data, length); ++ ++ return (ed); + } + + static int +-vips_exif_get_int( ExifData *ed, +- ExifEntry *entry, unsigned long component, int *out ) ++vips_exif_get_int(ExifData *ed, ++ ExifEntry *entry, unsigned long component, int *out) + { +- ExifByteOrder bo = exif_data_get_byte_order( ed ); ++ ExifByteOrder bo = exif_data_get_byte_order(ed); + size_t sizeof_component = entry->size / entry->components; + size_t offset = component * sizeof_component; + +- if( entry->format == EXIF_FORMAT_SHORT ) +- *out = exif_get_short( entry->data + offset, bo ); +- else if( entry->format == EXIF_FORMAT_SSHORT ) +- *out = exif_get_sshort( entry->data + offset, bo ); +- else if( entry->format == EXIF_FORMAT_LONG ) ++ if (entry->format == EXIF_FORMAT_SHORT) ++ *out = exif_get_short(entry->data + offset, bo); ++ else if (entry->format == EXIF_FORMAT_SSHORT) ++ *out = exif_get_sshort(entry->data + offset, bo); ++ else if (entry->format == EXIF_FORMAT_LONG) + /* This won't work for huge values, but who cares. + */ +- *out = (int) exif_get_long( entry->data + offset, bo ); +- else if( entry->format == EXIF_FORMAT_SLONG ) +- *out = exif_get_slong( entry->data + offset, bo ); ++ *out = (int) exif_get_long(entry->data + offset, bo); ++ else if (entry->format == EXIF_FORMAT_SLONG) ++ *out = exif_get_slong(entry->data + offset, bo); + else +- return( -1 ); ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_exif_get_rational( ExifData *ed, +- ExifEntry *entry, unsigned long component, ExifRational *out ) ++vips_exif_get_rational(ExifData *ed, ++ ExifEntry *entry, unsigned long component, ExifRational *out) + { +- if( entry->format == EXIF_FORMAT_RATIONAL ) { +- ExifByteOrder bo = exif_data_get_byte_order( ed ); ++ if (entry->format == EXIF_FORMAT_RATIONAL) { ++ ExifByteOrder bo = exif_data_get_byte_order(ed); + size_t sizeof_component = entry->size / entry->components; + size_t offset = component * sizeof_component; + +- *out = exif_get_rational( entry->data + offset, bo ); ++ *out = exif_get_rational(entry->data + offset, bo); + } + else +- return( -1 ); ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_exif_get_srational( ExifData *ed, +- ExifEntry *entry, unsigned long component, ExifSRational *out ) ++vips_exif_get_srational(ExifData *ed, ++ ExifEntry *entry, unsigned long component, ExifSRational *out) + { +- if( entry->format == EXIF_FORMAT_SRATIONAL ) { +- ExifByteOrder bo = exif_data_get_byte_order( ed ); ++ if (entry->format == EXIF_FORMAT_SRATIONAL) { ++ ExifByteOrder bo = exif_data_get_byte_order(ed); + size_t sizeof_component = entry->size / entry->components; + size_t offset = component * sizeof_component; + +- *out = exif_get_srational( entry->data + offset, bo ); ++ *out = exif_get_srational(entry->data + offset, bo); + } + else +- return( -1 ); ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_exif_get_double( ExifData *ed, +- ExifEntry *entry, unsigned long component, double *out ) ++vips_exif_get_double(ExifData *ed, ++ ExifEntry *entry, unsigned long component, double *out) + { + ExifRational rv; + ExifSRational srv; + double value; + +- if( !vips_exif_get_rational( ed, entry, component, &rv ) ) { +- if( rv.denominator == 0 ) ++ if (!vips_exif_get_rational(ed, entry, component, &rv)) { ++ if (rv.denominator == 0) + value = 0; + else + value = (double) rv.numerator / rv.denominator; + } +- else if( !vips_exif_get_srational( ed, entry, component, &srv ) ) { +- if( srv.denominator == 0 ) ++ else if (!vips_exif_get_srational(ed, entry, component, &srv)) { ++ if (srv.denominator == 0) + value = 0; + else + value = (double) srv.numerator / srv.denominator; + } + else +- return( -1 ); ++ return (-1); + + *out = value; + +- return( 0 ); ++ return (0); + } + + /* Save an exif value to a string in a way that we can restore. We only bother +@@ -289,7 +290,7 @@ vips_exif_get_double( ExifData *ed, + * Keep in sync with vips_exif_from_s() below. + */ + static void +-vips_exif_to_s( ExifData *ed, ExifEntry *entry, VipsBuf *buf ) ++vips_exif_to_s(ExifData *ed, ExifEntry *entry, VipsBuf *buf) + { + unsigned long i; + int iv; +@@ -297,48 +298,48 @@ vips_exif_to_s( ExifData *ed, ExifEntry *entry, VipsBuf *buf ) + ExifSRational srv; + char txt[256]; + +- if( entry->format == EXIF_FORMAT_ASCII ) { ++ if (entry->format == EXIF_FORMAT_ASCII) { + /* libexif does not null-terminate strings. Copy out and add + * the \0 ourselves. + */ +- int len = VIPS_MIN( 254, entry->size ); ++ int len = VIPS_MIN(254, entry->size); + +- memcpy( txt, entry->data, len ); ++ memcpy(txt, entry->data, len); + txt[len] = '\0'; +- vips_buf_appendf( buf, "%s ", txt ); ++ vips_buf_appendf(buf, "%s ", txt); + } +- else if( entry->components < 10 && +- !vips_exif_get_int( ed, entry, 0, &iv ) ) { +- for( i = 0; i < entry->components; i++ ) { +- vips_exif_get_int( ed, entry, i, &iv ); +- vips_buf_appendf( buf, "%d ", iv ); ++ else if (entry->components < 10 && ++ !vips_exif_get_int(ed, entry, 0, &iv)) { ++ for (i = 0; i < entry->components; i++) { ++ vips_exif_get_int(ed, entry, i, &iv); ++ vips_buf_appendf(buf, "%d ", iv); + } + } +- else if( entry->components < 10 && +- !vips_exif_get_rational( ed, entry, 0, &rv ) ) { +- for( i = 0; i < entry->components; i++ ) { +- vips_exif_get_rational( ed, entry, i, &rv ); +- vips_buf_appendf( buf, "%u/%u ", +- rv.numerator, rv.denominator ); ++ else if (entry->components < 10 && ++ !vips_exif_get_rational(ed, entry, 0, &rv)) { ++ for (i = 0; i < entry->components; i++) { ++ vips_exif_get_rational(ed, entry, i, &rv); ++ vips_buf_appendf(buf, "%u/%u ", ++ rv.numerator, rv.denominator); + } + } +- else if( entry->components < 10 && +- !vips_exif_get_srational( ed, entry, 0, &srv ) ) { +- for( i = 0; i < entry->components; i++ ) { +- vips_exif_get_srational( ed, entry, i, &srv ); +- vips_buf_appendf( buf, "%d/%d ", +- srv.numerator, srv.denominator ); ++ else if (entry->components < 10 && ++ !vips_exif_get_srational(ed, entry, 0, &srv)) { ++ for (i = 0; i < entry->components; i++) { ++ vips_exif_get_srational(ed, entry, i, &srv); ++ vips_buf_appendf(buf, "%d/%d ", ++ srv.numerator, srv.denominator); + } + } +- else +- vips_buf_appendf( buf, "%s ", +- exif_entry_get_value( entry, txt, 256 ) ); ++ else ++ vips_buf_appendf(buf, "%s ", ++ exif_entry_get_value(entry, txt, 256)); + +- vips_buf_appendf( buf, "(%s, %s, %lu components, %d bytes)", +- exif_entry_get_value( entry, txt, 256 ), +- exif_format_get_name( entry->format ), ++ vips_buf_appendf(buf, "(%s, %s, %lu components, %d bytes)", ++ exif_entry_get_value(entry, txt, 256), ++ exif_format_get_name(entry->format), + entry->components, +- entry->size ); ++ entry->size); + } + + typedef struct _VipsExifParams { +@@ -352,72 +353,72 @@ typedef struct _VipsExifParams { + * As long as this entry has been linked to an ifd, get the tag name. + */ + static const char * +-vips_exif_entry_get_name( ExifEntry *entry ) ++vips_exif_entry_get_name(ExifEntry *entry) + { +- if( !entry->parent ) +- return( NULL ); ++ if (!entry->parent) ++ return (NULL); + +- return( exif_tag_get_name_in_ifd( entry->tag, +- exif_entry_get_ifd( entry ) ) ); ++ return (exif_tag_get_name_in_ifd(entry->tag, ++ exif_entry_get_ifd(entry))); + } + + static void +-vips_exif_attach_entry( ExifEntry *entry, VipsExifParams *params ) ++vips_exif_attach_entry(ExifEntry *entry, VipsExifParams *params) + { + const char *tag_name; + char vips_name_txt[256]; +- VipsBuf vips_name = VIPS_BUF_STATIC( vips_name_txt ); ++ VipsBuf vips_name = VIPS_BUF_STATIC(vips_name_txt); + char value_txt[256]; +- VipsBuf value = VIPS_BUF_STATIC( value_txt ); ++ VipsBuf value = VIPS_BUF_STATIC(value_txt); + +- if( !(tag_name = vips_exif_entry_get_name( entry )) ) ++ if (!(tag_name = vips_exif_entry_get_name(entry))) + return; + +- vips_buf_appendf( &vips_name, "exif-ifd%d-%s", +- exif_entry_get_ifd( entry ), tag_name ); +- vips_exif_to_s( params->ed, entry, &value ); ++ vips_buf_appendf(&vips_name, "exif-ifd%d-%s", ++ exif_entry_get_ifd(entry), tag_name); ++ vips_exif_to_s(params->ed, entry, &value); + + /* Can't do anything sensible with the error return. + */ +- (void) vips_image_set_string( params->image, +- vips_buf_all( &vips_name ), vips_buf_all( &value ) ); ++ (void) vips_image_set_string(params->image, ++ vips_buf_all(&vips_name), vips_buf_all(&value)); + } + + static void +-vips_exif_get_content( ExifContent *content, VipsExifParams *params ) ++vips_exif_get_content(ExifContent *content, VipsExifParams *params) + { +- exif_content_foreach_entry( content, +- (ExifContentForeachEntryFunc) vips_exif_attach_entry, params ); ++ exif_content_foreach_entry(content, ++ (ExifContentForeachEntryFunc) vips_exif_attach_entry, params); + } + + static int +-vips_exif_entry_get_double( ExifData *ed, int ifd, ExifTag tag, double *out ) ++vips_exif_entry_get_double(ExifData *ed, int ifd, ExifTag tag, double *out) + { + ExifEntry *entry; + +- if( !(entry = exif_content_get_entry( ed->ifd[ifd], tag )) || +- entry->components != 1 ) +- return( -1 ); ++ if (!(entry = exif_content_get_entry(ed->ifd[ifd], tag)) || ++ entry->components != 1) ++ return (-1); + +- return( vips_exif_get_double( ed, entry, 0, out ) ); ++ return (vips_exif_get_double(ed, entry, 0, out)); + } + + static int +-vips_exif_entry_get_int( ExifData *ed, int ifd, ExifTag tag, int *out ) ++vips_exif_entry_get_int(ExifData *ed, int ifd, ExifTag tag, int *out) + { + ExifEntry *entry; + +- if( !(entry = exif_content_get_entry( ed->ifd[ifd], tag )) || +- entry->components != 1 ) +- return( -1 ); ++ if (!(entry = exif_content_get_entry(ed->ifd[ifd], tag)) || ++ entry->components != 1) ++ return (-1); + +- return( vips_exif_get_int( ed, entry, 0, out ) ); ++ return (vips_exif_get_int(ed, entry, 0, out)); + } + + /* Set the image resolution from the EXIF tags. + */ + static int +-vips_image_resolution_from_exif( VipsImage *image, ExifData *ed ) ++vips_image_resolution_from_exif(VipsImage *image, ExifData *ed) + { + double xres, yres; + int unit; +@@ -428,23 +429,24 @@ vips_image_resolution_from_exif( VipsImage *image, ExifData *ed ) + * Don't warn about missing res fields, it's very common, especially for + * things like webp. + */ +- if( vips_exif_entry_get_double( ed, 0, EXIF_TAG_X_RESOLUTION, &xres ) || +- vips_exif_entry_get_double( ed, +- 0, EXIF_TAG_Y_RESOLUTION, &yres ) ) +- return( -1 ); ++ if (vips_exif_entry_get_double(ed, 0, EXIF_TAG_X_RESOLUTION, &xres) || ++ vips_exif_entry_get_double(ed, ++ 0, EXIF_TAG_Y_RESOLUTION, &yres)) ++ return (-1); + + /* resuint is optional and defaults to inch. + */ + unit = 2; +- (void) vips_exif_entry_get_int( ed, +- 0, EXIF_TAG_RESOLUTION_UNIT, &unit ); ++ (void) vips_exif_entry_get_int(ed, ++ 0, EXIF_TAG_RESOLUTION_UNIT, &unit); + + #ifdef DEBUG +- printf( "vips_image_resolution_from_exif: seen exif tags " +- "xres = %g, yres = %g, unit = %d\n", xres, yres, unit ); ++ printf("vips_image_resolution_from_exif: seen exif tags " ++ "xres = %g, yres = %g, unit = %d\n", ++ xres, yres, unit); + #endif /*DEBUG*/ + +- switch( unit ) { ++ switch (unit) { + case 1: + /* No units, instead xres / yres gives the pixel aspect ratio. + */ +@@ -455,8 +457,8 @@ vips_image_resolution_from_exif( VipsImage *image, ExifData *ed ) + */ + xres /= 25.4; + yres /= 25.4; +- vips_image_set_string( image, +- VIPS_META_RESOLUTION_UNIT, "in" ); ++ vips_image_set_string(image, ++ VIPS_META_RESOLUTION_UNIT, "in"); + break; + + case 3: +@@ -464,38 +466,39 @@ vips_image_resolution_from_exif( VipsImage *image, ExifData *ed ) + */ + xres /= 10.0; + yres /= 10.0; +- vips_image_set_string( image, +- VIPS_META_RESOLUTION_UNIT, "cm" ); ++ vips_image_set_string(image, ++ VIPS_META_RESOLUTION_UNIT, "cm"); + break; + + default: +- g_warning( "%s", _( "unknown EXIF resolution unit" ) ); +- return( -1 ); ++ g_warning("%s", _("unknown EXIF resolution unit")); ++ return (-1); + } + + #ifdef DEBUG +- printf( "vips_image_resolution_from_exif: " +- "seen exif resolution %g, %g p/mm\n", xres, yres ); ++ printf("vips_image_resolution_from_exif: " ++ "seen exif resolution %g, %g p/mm\n", ++ xres, yres); + #endif /*DEBUG*/ + + /* Don't allow negative resolution. + */ +- image->Xres = VIPS_MAX( 0, xres ); +- image->Yres = VIPS_MAX( 0, yres ); ++ image->Xres = VIPS_MAX(0, xres); ++ image->Yres = VIPS_MAX(0, yres); + +- return( 0 ); ++ return (0); + } + + /* Need to fwd ref this. + */ + static int +-vips_exif_resolution_from_image( ExifData *ed, VipsImage *image ); ++vips_exif_resolution_from_image(ExifData *ed, VipsImage *image); + +-/* Scan the exif block on the image, if any, and make a set of vips metadata ++/* Scan the exif block on the image, if any, and make a set of vips metadata + * tags for what we find. + */ + int +-vips__exif_parse( VipsImage *image ) ++vips__exif_parse(VipsImage *image) + { + const void *data; + size_t size; +@@ -503,68 +506,68 @@ vips__exif_parse( VipsImage *image ) + VipsExifParams params; + const char *str; + +- if( !vips_image_get_typeof( image, VIPS_META_EXIF_NAME ) ) +- return( 0 ); +- if( vips_image_get_blob( image, VIPS_META_EXIF_NAME, &data, &size ) ) +- return( -1 ); +- if( !(ed = vips_exif_load_data_without_fix( data, size )) ) +- return( -1 ); ++ if (!vips_image_get_typeof(image, VIPS_META_EXIF_NAME)) ++ return (0); ++ if (vips_image_get_blob(image, VIPS_META_EXIF_NAME, &data, &size)) ++ return (-1); ++ if (!(ed = vips_exif_load_data_without_fix(data, size))) ++ return (-1); + + #ifdef DEBUG_VERBOSE +- show_tags( ed ); +- show_values( ed ); ++ show_tags(ed); ++ show_values(ed); + #endif /*DEBUG_VERBOSE*/ + +- /* Look for resolution fields and use them to set the VIPS xres/yres ++ /* Look for resolution fields and use them to set the VIPS xres/yres + * fields. + * + * If the fields are missing, set them from the image, which will have +- * previously had them set from something like JFIF. ++ * previously had them set from something like JFIF. + */ +- if( vips_image_resolution_from_exif( image, ed ) && +- vips_exif_resolution_from_image( ed, image ) ) { +- exif_data_free( ed ); +- return( -1 ); ++ if (vips_image_resolution_from_exif(image, ed) && ++ vips_exif_resolution_from_image(ed, image)) { ++ exif_data_free(ed); ++ return (-1); + } + + /* Make sure all required fields are there before we attach the vips + * metadata. + */ +- exif_data_fix( ed ); ++ exif_data_fix(ed); + + /* Attach informational fields for what we find. + */ + params.image = image; + params.ed = ed; +- exif_data_foreach_content( ed, +- (ExifDataForeachContentFunc) vips_exif_get_content, ¶ms ); ++ exif_data_foreach_content(ed, ++ (ExifDataForeachContentFunc) vips_exif_get_content, ¶ms); + +- vips_image_set_blob_copy( image, +- "jpeg-thumbnail-data", ed->data, ed->size ); ++ vips_image_set_blob_copy(image, ++ "jpeg-thumbnail-data", ed->data, ed->size); + +- exif_data_free( ed ); ++ exif_data_free(ed); + + /* Orientation handling. ifd0 has the Orientation tag for the main +- * image. ++ * image. + */ +- if( vips_image_get_typeof( image, "exif-ifd0-Orientation" ) != 0 && +- !vips_image_get_string( image, +- "exif-ifd0-Orientation", &str ) ) { ++ if (vips_image_get_typeof(image, "exif-ifd0-Orientation") != 0 && ++ !vips_image_get_string(image, ++ "exif-ifd0-Orientation", &str)) { + int orientation; + +- orientation = atoi( str ); +- if( orientation < 1 || +- orientation > 8 ) ++ orientation = atoi(str); ++ if (orientation < 1 || ++ orientation > 8) + orientation = 1; +- vips_image_set_int( image, VIPS_META_ORIENTATION, orientation ); ++ vips_image_set_int(image, VIPS_META_ORIENTATION, orientation); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_exif_set_int( ExifData *ed, +- ExifEntry *entry, unsigned long component, void *data ) ++vips_exif_set_int(ExifData *ed, ++ ExifEntry *entry, unsigned long component, void *data) + { + int value = *((int *) data); + +@@ -572,32 +575,32 @@ vips_exif_set_int( ExifData *ed, + size_t sizeof_component; + size_t offset = component; + +- if( entry->components <= component ) { +- VIPS_DEBUG_MSG( "vips_exif_set_int: too few components\n" ); ++ if (entry->components <= component) { ++ VIPS_DEBUG_MSG("vips_exif_set_int: too few components\n"); + return; + } + + /* Wait until after the component check to make sure we cant get /0. + */ +- bo = exif_data_get_byte_order( ed ); ++ bo = exif_data_get_byte_order(ed); + sizeof_component = entry->size / entry->components; + offset = component * sizeof_component; + +- VIPS_DEBUG_MSG( "vips_exif_set_int: %s = %d\n", +- vips_exif_entry_get_name( entry ), value ); +- +- if( entry->format == EXIF_FORMAT_SHORT ) +- exif_set_short( entry->data + offset, bo, value ); +- else if( entry->format == EXIF_FORMAT_SSHORT ) +- exif_set_sshort( entry->data + offset, bo, value ); +- else if( entry->format == EXIF_FORMAT_LONG ) +- exif_set_long( entry->data + offset, bo, value ); +- else if( entry->format == EXIF_FORMAT_SLONG ) +- exif_set_slong( entry->data + offset, bo, value ); ++ VIPS_DEBUG_MSG("vips_exif_set_int: %s = %d\n", ++ vips_exif_entry_get_name(entry), value); ++ ++ if (entry->format == EXIF_FORMAT_SHORT) ++ exif_set_short(entry->data + offset, bo, value); ++ else if (entry->format == EXIF_FORMAT_SSHORT) ++ exif_set_sshort(entry->data + offset, bo, value); ++ else if (entry->format == EXIF_FORMAT_LONG) ++ exif_set_long(entry->data + offset, bo, value); ++ else if (entry->format == EXIF_FORMAT_SLONG) ++ exif_set_slong(entry->data + offset, bo, value); + } + + static void +-vips_exif_double_to_rational( double value, ExifRational *rv ) ++vips_exif_double_to_rational(double value, ExifRational *rv) + { + /* We will usually set factors of 10, so use 1000 as the denominator + * and it'll probably be OK. +@@ -607,7 +610,7 @@ vips_exif_double_to_rational( double value, ExifRational *rv ) + } + + static void +-vips_exif_double_to_srational( double value, ExifSRational *srv ) ++vips_exif_double_to_srational(double value, ExifSRational *srv) + { + /* We will usually set factors of 10, so use 1000 as the denominator + * and it'll probably be OK. +@@ -619,29 +622,29 @@ vips_exif_double_to_srational( double value, ExifSRational *srv ) + /* Parse a char * into an ExifRational. We allow floats as well. + */ + static void +-vips_exif_parse_rational( const char *str, ExifRational *rv ) ++vips_exif_parse_rational(const char *str, ExifRational *rv) + { +- if( sscanf( str, " %u / %u ", &rv->numerator, &rv->denominator ) == 2 ) ++ if (sscanf(str, " %u / %u ", &rv->numerator, &rv->denominator) == 2) + return; +- vips_exif_double_to_rational( g_ascii_strtod( str, NULL ), rv ); ++ vips_exif_double_to_rational(g_ascii_strtod(str, NULL), rv); + } + + /* Parse a char * into an ExifSRational. We allow floats as well. + */ + static void +-vips_exif_parse_srational( const char *str, ExifSRational *srv ) ++vips_exif_parse_srational(const char *str, ExifSRational *srv) + { +- if( sscanf( str, " %d / %d ", +- &srv->numerator, &srv->denominator ) == 2 ) ++ if (sscanf(str, " %d / %d ", ++ &srv->numerator, &srv->denominator) == 2) + return; +- vips_exif_double_to_srational( g_ascii_strtod( str, NULL ), srv ); ++ vips_exif_double_to_srational(g_ascii_strtod(str, NULL), srv); + } + + /* Does both signed and unsigned rationals from a char *. + */ + static void +-vips_exif_set_rational( ExifData *ed, +- ExifEntry *entry, unsigned long component, void *data ) ++vips_exif_set_rational(ExifData *ed, ++ ExifEntry *entry, unsigned long component, void *data) + { + char *value = (char *) data; + +@@ -649,41 +652,41 @@ vips_exif_set_rational( ExifData *ed, + size_t sizeof_component; + size_t offset; + +- if( entry->components <= component ) { +- VIPS_DEBUG_MSG( "vips_exif_set_rational: " +- "too few components\n" ); ++ if (entry->components <= component) { ++ VIPS_DEBUG_MSG("vips_exif_set_rational: " ++ "too few components\n"); + return; + } + + /* Wait until after the component check to make sure we cant get /0. + */ +- bo = exif_data_get_byte_order( ed ); ++ bo = exif_data_get_byte_order(ed); + sizeof_component = entry->size / entry->components; + offset = component * sizeof_component; + +- VIPS_DEBUG_MSG( "vips_exif_set_rational: %s = \"%s\"\n", +- vips_exif_entry_get_name( entry ), value ); ++ VIPS_DEBUG_MSG("vips_exif_set_rational: %s = \"%s\"\n", ++ vips_exif_entry_get_name(entry), value); + +- if( entry->format == EXIF_FORMAT_RATIONAL ) { ++ if (entry->format == EXIF_FORMAT_RATIONAL) { + ExifRational rv; + +- vips_exif_parse_rational( value, &rv ); ++ vips_exif_parse_rational(value, &rv); + +- VIPS_DEBUG_MSG( "vips_exif_set_rational: %u / %u\n", +- rv.numerator, +- rv.denominator ); ++ VIPS_DEBUG_MSG("vips_exif_set_rational: %u / %u\n", ++ rv.numerator, ++ rv.denominator); + +- exif_set_rational( entry->data + offset, bo, rv ); ++ exif_set_rational(entry->data + offset, bo, rv); + } +- else if( entry->format == EXIF_FORMAT_SRATIONAL ) { ++ else if (entry->format == EXIF_FORMAT_SRATIONAL) { + ExifSRational srv; + +- vips_exif_parse_srational( value, &srv ); ++ vips_exif_parse_srational(value, &srv); + +- VIPS_DEBUG_MSG( "vips_exif_set_rational: %d / %d\n", +- srv.numerator, srv.denominator ); ++ VIPS_DEBUG_MSG("vips_exif_set_rational: %d / %d\n", ++ srv.numerator, srv.denominator); + +- exif_set_srational( entry->data + offset, bo, srv ); ++ exif_set_srational(entry->data + offset, bo, srv); + } + } + +@@ -693,8 +696,8 @@ vips_exif_set_rational( ExifData *ed, + * approximation of the double we are trying to set. + */ + static void +-vips_exif_set_double( ExifData *ed, +- ExifEntry *entry, unsigned long component, void *data ) ++vips_exif_set_double(ExifData *ed, ++ ExifEntry *entry, unsigned long component, void *data) + { + double value = *((double *) data); + +@@ -703,66 +706,66 @@ vips_exif_set_double( ExifData *ed, + size_t offset; + double old_value; + +- if( entry->components <= component ) { +- VIPS_DEBUG_MSG( "vips_exif_set_double: " +- "too few components\n" ); ++ if (entry->components <= component) { ++ VIPS_DEBUG_MSG("vips_exif_set_double: " ++ "too few components\n"); + return; + } + + /* Wait until after the component check to make sure we cant get /0. + */ +- bo = exif_data_get_byte_order( ed ); ++ bo = exif_data_get_byte_order(ed); + sizeof_component = entry->size / entry->components; + offset = component * sizeof_component; + +- VIPS_DEBUG_MSG( "vips_exif_set_double: %s = %g\n", +- vips_exif_entry_get_name( entry ), value ); ++ VIPS_DEBUG_MSG("vips_exif_set_double: %s = %g\n", ++ vips_exif_entry_get_name(entry), value); + +- if( entry->format == EXIF_FORMAT_RATIONAL ) { ++ if (entry->format == EXIF_FORMAT_RATIONAL) { + ExifRational rv; + +- rv = exif_get_rational( entry->data + offset, bo ); +- if( rv.denominator == 0 ) ++ rv = exif_get_rational(entry->data + offset, bo); ++ if (rv.denominator == 0) + old_value = 0; + else + old_value = (double) rv.numerator / rv.denominator; + +- if( VIPS_FABS( old_value - value ) > 0.0001 ) { +- vips_exif_double_to_rational( value, &rv ); ++ if (VIPS_FABS(old_value - value) > 0.0001) { ++ vips_exif_double_to_rational(value, &rv); + +- VIPS_DEBUG_MSG( "vips_exif_set_double: %u / %u\n", +- rv.numerator, +- rv.denominator ); ++ VIPS_DEBUG_MSG("vips_exif_set_double: %u / %u\n", ++ rv.numerator, ++ rv.denominator); + +- exif_set_rational( entry->data + offset, bo, rv ); ++ exif_set_rational(entry->data + offset, bo, rv); + } + } +- else if( entry->format == EXIF_FORMAT_SRATIONAL ) { ++ else if (entry->format == EXIF_FORMAT_SRATIONAL) { + ExifSRational srv; + +- srv = exif_get_srational( entry->data + offset, bo ); +- if( srv.denominator == 0 ) ++ srv = exif_get_srational(entry->data + offset, bo); ++ if (srv.denominator == 0) + old_value = 0; + else + old_value = (double) srv.numerator / srv.denominator; + +- if( VIPS_FABS( old_value - value ) > 0.0001 ) { +- vips_exif_double_to_srational( value, &srv ); ++ if (VIPS_FABS(old_value - value) > 0.0001) { ++ vips_exif_double_to_srational(value, &srv); + +- VIPS_DEBUG_MSG( "vips_exif_set_double: %d / %d\n", +- srv.numerator, srv.denominator ); ++ VIPS_DEBUG_MSG("vips_exif_set_double: %d / %d\n", ++ srv.numerator, srv.denominator); + +- exif_set_srational( entry->data + offset, bo, srv ); ++ exif_set_srational(entry->data + offset, bo, srv); + } + } + } + +-typedef void (*write_fn)( ExifData *ed, +- ExifEntry *entry, unsigned long component, void *data ); ++typedef void (*write_fn)(ExifData *ed, ++ ExifEntry *entry, unsigned long component, void *data); + + /* String-valued tags need special treatment, sadly. + * +- * Strings are written in three ways: ++ * Strings are written in three ways: + * + * 1. As ASCII, but with an 8-byte preamble giving the encoding (it's always + * ASCII though) and the format undefined. +@@ -771,15 +774,15 @@ typedef void (*write_fn)( ExifData *ed, + */ + + static gboolean +-tag_is_encoding( ExifTag tag ) ++tag_is_encoding(ExifTag tag) + { +- return( tag == EXIF_TAG_USER_COMMENT ); ++ return (tag == EXIF_TAG_USER_COMMENT); + } + + static gboolean +-tag_is_ascii( ExifTag tag ) ++tag_is_ascii(ExifTag tag) + { +- return( tag == EXIF_TAG_MAKE || ++ return (tag == EXIF_TAG_MAKE || + tag == EXIF_TAG_MODEL || + tag == EXIF_TAG_IMAGE_DESCRIPTION || + tag == EXIF_TAG_ARTIST || +@@ -792,52 +795,32 @@ tag_is_ascii( ExifTag tag ) + tag == EXIF_TAG_SUB_SEC_TIME_ORIGINAL || + tag == EXIF_TAG_SUB_SEC_TIME_DIGITIZED + #ifdef HAVE_EXIF_0_6_22 +- || tag == EXIF_TAG_CAMERA_OWNER_NAME +- || tag == EXIF_TAG_BODY_SERIAL_NUMBER +- || tag == EXIF_TAG_LENS_MAKE +- || tag == EXIF_TAG_LENS_MODEL +- || tag == EXIF_TAG_LENS_SERIAL_NUMBER ++ || tag == EXIF_TAG_CAMERA_OWNER_NAME || tag == EXIF_TAG_BODY_SERIAL_NUMBER || tag == EXIF_TAG_LENS_MAKE || tag == EXIF_TAG_LENS_MODEL || tag == EXIF_TAG_LENS_SERIAL_NUMBER + #endif + #ifdef HAVE_EXIF_0_6_23 +- || tag == EXIF_TAG_OFFSET_TIME +- || tag == EXIF_TAG_OFFSET_TIME_ORIGINAL +- || tag == EXIF_TAG_OFFSET_TIME_DIGITIZED +- || tag == EXIF_TAG_GPS_LATITUDE_REF +- || tag == EXIF_TAG_GPS_LONGITUDE_REF +- || tag == EXIF_TAG_GPS_SATELLITES +- || tag == EXIF_TAG_GPS_STATUS +- || tag == EXIF_TAG_GPS_MEASURE_MODE +- || tag == EXIF_TAG_GPS_SPEED_REF +- || tag == EXIF_TAG_GPS_TRACK_REF +- || tag == EXIF_TAG_GPS_IMG_DIRECTION_REF +- || tag == EXIF_TAG_GPS_MAP_DATUM +- || tag == EXIF_TAG_GPS_DEST_LATITUDE_REF +- || tag == EXIF_TAG_GPS_DEST_LONGITUDE_REF +- || tag == EXIF_TAG_GPS_DEST_BEARING_REF +- || tag == EXIF_TAG_GPS_DEST_DISTANCE_REF +- || tag == EXIF_TAG_GPS_DATE_STAMP ++ || tag == EXIF_TAG_OFFSET_TIME || tag == EXIF_TAG_OFFSET_TIME_ORIGINAL || tag == EXIF_TAG_OFFSET_TIME_DIGITIZED || tag == EXIF_TAG_GPS_LATITUDE_REF || tag == EXIF_TAG_GPS_LONGITUDE_REF || tag == EXIF_TAG_GPS_SATELLITES || tag == EXIF_TAG_GPS_STATUS || tag == EXIF_TAG_GPS_MEASURE_MODE || tag == EXIF_TAG_GPS_SPEED_REF || tag == EXIF_TAG_GPS_TRACK_REF || tag == EXIF_TAG_GPS_IMG_DIRECTION_REF || tag == EXIF_TAG_GPS_MAP_DATUM || tag == EXIF_TAG_GPS_DEST_LATITUDE_REF || tag == EXIF_TAG_GPS_DEST_LONGITUDE_REF || tag == EXIF_TAG_GPS_DEST_BEARING_REF || tag == EXIF_TAG_GPS_DEST_DISTANCE_REF || tag == EXIF_TAG_GPS_DATE_STAMP + #endif +- ); ++ ); + } + + static gboolean +-tag_is_utf16( ExifTag tag ) ++tag_is_utf16(ExifTag tag) + { +- return( tag == EXIF_TAG_XP_TITLE || +- tag == EXIF_TAG_XP_COMMENT || +- tag == EXIF_TAG_XP_AUTHOR || ++ return (tag == EXIF_TAG_XP_TITLE || ++ tag == EXIF_TAG_XP_COMMENT || ++ tag == EXIF_TAG_XP_AUTHOR || + tag == EXIF_TAG_XP_KEYWORDS || +- tag == EXIF_TAG_XP_SUBJECT ); ++ tag == EXIF_TAG_XP_SUBJECT); + } + +-/* Set a libexif-formatted string entry. ++/* Set a libexif-formatted string entry. + */ + static void +-vips_exif_alloc_string( ExifEntry *entry, unsigned long components ) ++vips_exif_alloc_string(ExifEntry *entry, unsigned long components) + { + ExifMem *mem; + +- g_assert( !entry->data ); ++ g_assert(!entry->data); + + /* The string in the entry must be allocated with the same allocator + * that was used to allocate the entry itself. We can't do this +@@ -846,40 +829,40 @@ vips_exif_alloc_string( ExifEntry *entry, unsigned long components ) + */ + mem = exif_mem_new_default(); + +- /* EXIF_FORMAT_UNDEFINED is correct for EXIF_TAG_USER_COMMENT, our ++ /* EXIF_FORMAT_UNDEFINED is correct for EXIF_TAG_USER_COMMENT, our + * caller should change this if it wishes. + */ +- entry->data = exif_mem_alloc( mem, components ); +- entry->size = components; +- entry->components = components; +- entry->format = EXIF_FORMAT_UNDEFINED; ++ entry->data = exif_mem_alloc(mem, components); ++ entry->size = components; ++ entry->components = components; ++ entry->format = EXIF_FORMAT_UNDEFINED; + +- VIPS_FREEF( exif_mem_unref, mem ); ++ VIPS_FREEF(exif_mem_unref, mem); + } + + /* The final " (xx, yy, zz, kk)" part of the string (if present) was +- * added by us in _to_s(), we must remove it before setting the string ++ * added by us in _to_s(), we must remove it before setting the string + * back again. + * + * It may not be there if the user has changed the string. + */ + static char * +-drop_tail( const char *data ) ++drop_tail(const char *data) + { + char *str; + char *p; + +- str = g_strdup( data ); ++ str = g_strdup(data); + +- p = str + strlen( str ); +- if( p > str && +- *g_utf8_prev_char( p ) == ')' && +- (p = g_utf8_strrchr( str, -1, (gunichar) '(')) && ++ p = str + strlen(str); ++ if (p > str && ++ *g_utf8_prev_char(p) == ')' && ++ (p = g_utf8_strrchr(str, -1, (gunichar) '(')) && + p > str && +- *(p = g_utf8_prev_char( p )) == ' ' ) ++ *(p = g_utf8_prev_char(p)) == ' ') + *p = '\0'; + +- return( str ); ++ return (str); + } + + /* special header required for EXIF_TAG_USER_COMMENT. +@@ -890,116 +873,116 @@ drop_tail( const char *data ) + * encoding. UserComment is like this, for example. + */ + static void +-vips_exif_set_string_encoding( ExifData *ed, +- ExifEntry *entry, unsigned long component, const char *data ) ++vips_exif_set_string_encoding(ExifData *ed, ++ ExifEntry *entry, unsigned long component, const char *data) + { + char *str; + char *ascii; + int len; + +- str = drop_tail( data ); ++ str = drop_tail(data); + + /* libexif can only really save ASCII to things like UserComment. + */ +- ascii = g_str_to_ascii( str, NULL ); +- g_free( str ); ++ ascii = g_str_to_ascii(str, NULL); ++ g_free(str); + str = ascii; + +- /* libexif comment strings are not NULL-terminated, and have an ++ /* libexif comment strings are not NULL-terminated, and have an + * encoding tag (always ASCII) in the first 8 bytes. + */ +- len = strlen( str ); +- vips_exif_alloc_string( entry, sizeof( ASCII_COMMENT ) - 1 + len ); +- memcpy( entry->data, ASCII_COMMENT, sizeof( ASCII_COMMENT ) - 1 ); +- memcpy( entry->data + sizeof( ASCII_COMMENT ) - 1, str, len ); ++ len = strlen(str); ++ vips_exif_alloc_string(entry, sizeof(ASCII_COMMENT) - 1 + len); ++ memcpy(entry->data, ASCII_COMMENT, sizeof(ASCII_COMMENT) - 1); ++ memcpy(entry->data + sizeof(ASCII_COMMENT) - 1, str, len); + +- g_free( str ); ++ g_free(str); + } + + /* Write a libvips NULL-terminated utf-8 string into an ASCII entry. Tags like + * ImageDescription work like this. + */ + static void +-vips_exif_set_string_ascii( ExifData *ed, +- ExifEntry *entry, unsigned long component, const char *data ) ++vips_exif_set_string_ascii(ExifData *ed, ++ ExifEntry *entry, unsigned long component, const char *data) + { + char *str; + char *ascii; + int len; + +- str = drop_tail( data ); ++ str = drop_tail(data); + + /* libexif can only really save ASCII to things like UserComment. + */ +- ascii = g_str_to_ascii( str, NULL ); +- g_free( str ); ++ ascii = g_str_to_ascii(str, NULL); ++ g_free(str); + str = ascii; + + /* ASCII strings are NULL-terminated. + */ +- len = strlen( str ); +- vips_exif_alloc_string( entry, len + 1 ); +- memcpy( entry->data, str, len + 1 ); +- entry->format = EXIF_FORMAT_ASCII; ++ len = strlen(str); ++ vips_exif_alloc_string(entry, len + 1); ++ memcpy(entry->data, str, len + 1); ++ entry->format = EXIF_FORMAT_ASCII; + +- g_free( str ); ++ g_free(str); + } + + /* Write a libvips NULL-terminated utf-8 string into a utf16 entry. + */ + static void +-vips_exif_set_string_utf16( ExifData *ed, +- ExifEntry *entry, unsigned long component, const char *data ) ++vips_exif_set_string_utf16(ExifData *ed, ++ ExifEntry *entry, unsigned long component, const char *data) + { + char *str; + gunichar2 *utf16; + glong len; + +- str = drop_tail( data ); ++ str = drop_tail(data); + +- utf16 = g_utf8_to_utf16( str, -1, NULL, &len, NULL ); ++ utf16 = g_utf8_to_utf16(str, -1, NULL, &len, NULL); + + /* libexif utf16 strings are NULL-terminated. + */ +- vips_exif_alloc_string( entry, (len + 1) * 2 ); +- memcpy( entry->data, utf16, (len + 1) * 2 ); +- entry->format = EXIF_FORMAT_BYTE; ++ vips_exif_alloc_string(entry, (len + 1) * 2); ++ memcpy(entry->data, utf16, (len + 1) * 2); ++ entry->format = EXIF_FORMAT_BYTE; + +- g_free( utf16 ); +- g_free( str ); ++ g_free(utf16); ++ g_free(str); + } + + /* Write a tag. Update what's there, or make a new one. + */ + static void +-vips_exif_set_tag( ExifData *ed, int ifd, ExifTag tag, write_fn fn, void *data ) ++vips_exif_set_tag(ExifData *ed, int ifd, ExifTag tag, write_fn fn, void *data) + { + ExifEntry *entry; + +- if( (entry = exif_content_get_entry( ed->ifd[ifd], tag )) ) { +- fn( ed, entry, 0, data ); ++ if ((entry = exif_content_get_entry(ed->ifd[ifd], tag))) { ++ fn(ed, entry, 0, data); + } + else { + entry = exif_entry_new(); + + /* tag must be set before calling exif_content_add_entry. + */ +- entry->tag = tag; +- exif_content_add_entry( ed->ifd[ifd], entry ); +- exif_entry_unref( entry ); ++ entry->tag = tag; ++ exif_content_add_entry(ed->ifd[ifd], entry); ++ exif_entry_unref(entry); + + /* libexif makes us have a special path for string-valued + * fields :( + */ +- if( tag_is_encoding( tag ) ) +- vips_exif_set_string_encoding( ed, entry, 0, data ); +- else if( tag_is_ascii( tag ) ) +- vips_exif_set_string_ascii( ed, entry, 0, data ); +- else if( tag_is_utf16( tag ) ) +- vips_exif_set_string_utf16( ed, entry, 0, data ); ++ if (tag_is_encoding(tag)) ++ vips_exif_set_string_encoding(ed, entry, 0, data); ++ else if (tag_is_ascii(tag)) ++ vips_exif_set_string_ascii(ed, entry, 0, data); ++ else if (tag_is_utf16(tag)) ++ vips_exif_set_string_utf16(ed, entry, 0, data); + else { +- exif_entry_initialize( entry, tag ); +- fn( ed, entry, 0, data ); ++ exif_entry_initialize(entry, tag); ++ fn(ed, entry, 0, data); + } + } + } +@@ -1007,28 +990,28 @@ vips_exif_set_tag( ExifData *ed, int ifd, ExifTag tag, write_fn fn, void *data ) + /* Set the EXIF resolution from the vips xres/yres tags. + */ + static int +-vips_exif_resolution_from_image( ExifData *ed, VipsImage *image ) ++vips_exif_resolution_from_image(ExifData *ed, VipsImage *image) + { + double xres, yres; + const char *p; + int unit; + +- VIPS_DEBUG_MSG( "vips_exif_resolution_from_image: vips res of %g, %g\n", +- image->Xres, image->Yres ); ++ VIPS_DEBUG_MSG("vips_exif_resolution_from_image: vips res of %g, %g\n", ++ image->Xres, image->Yres); + + /* Default to inches, more progs support it. + */ + unit = 2; +- if( vips_image_get_typeof( image, VIPS_META_RESOLUTION_UNIT ) && +- !vips_image_get_string( image, +- VIPS_META_RESOLUTION_UNIT, &p ) ) { +- if( vips_isprefix( "cm", p ) ) ++ if (vips_image_get_typeof(image, VIPS_META_RESOLUTION_UNIT) && ++ !vips_image_get_string(image, ++ VIPS_META_RESOLUTION_UNIT, &p)) { ++ if (vips_isprefix("cm", p)) + unit = 3; +- else if( vips_isprefix( "none", p ) ) ++ else if (vips_isprefix("none", p)) + unit = 1; + } + +- switch( unit ) { ++ switch (unit) { + case 1: + xres = image->Xres; + yres = image->Yres; +@@ -1045,184 +1028,183 @@ vips_exif_resolution_from_image( ExifData *ed, VipsImage *image ) + break; + + default: +- g_warning( "%s", _( "unknown EXIF resolution unit" ) ); +- return( 0 ); ++ g_warning("%s", _("unknown EXIF resolution unit")); ++ return (0); + } + + /* Main image xres/yres/unit are in ifd0. ifd1 has the thumbnail + * xres/yres/unit. + */ +- vips_exif_set_tag( ed, 0, EXIF_TAG_X_RESOLUTION, +- vips_exif_set_double, (void *) &xres ); +- vips_exif_set_tag( ed, 0, EXIF_TAG_Y_RESOLUTION, +- vips_exif_set_double, (void *) &yres ); +- vips_exif_set_tag( ed, 0, EXIF_TAG_RESOLUTION_UNIT, +- vips_exif_set_int, (void *) &unit ); +- +- return( 0 ); ++ vips_exif_set_tag(ed, 0, EXIF_TAG_X_RESOLUTION, ++ vips_exif_set_double, (void *) &xres); ++ vips_exif_set_tag(ed, 0, EXIF_TAG_Y_RESOLUTION, ++ vips_exif_set_double, (void *) &yres); ++ vips_exif_set_tag(ed, 0, EXIF_TAG_RESOLUTION_UNIT, ++ vips_exif_set_int, (void *) &unit); ++ ++ return (0); + } + +-/* Exif also tracks image dimensions. ++/* Exif also tracks image dimensions. + */ + static int +-vips_exif_set_dimensions( ExifData *ed, VipsImage *im ) ++vips_exif_set_dimensions(ExifData *ed, VipsImage *im) + { +- VIPS_DEBUG_MSG( "vips_exif_set_dimensions: vips size of %d, %d\n", +- im->Xsize, im->Ysize ); ++ VIPS_DEBUG_MSG("vips_exif_set_dimensions: vips size of %d, %d\n", ++ im->Xsize, im->Ysize); + +- vips_exif_set_tag( ed, 2, EXIF_TAG_PIXEL_X_DIMENSION, +- vips_exif_set_int, (void *) &im->Xsize ); +- vips_exif_set_tag( ed, 2, EXIF_TAG_PIXEL_Y_DIMENSION, +- vips_exif_set_int, (void *) &im->Ysize ); ++ vips_exif_set_tag(ed, 2, EXIF_TAG_PIXEL_X_DIMENSION, ++ vips_exif_set_int, (void *) &im->Xsize); ++ vips_exif_set_tag(ed, 2, EXIF_TAG_PIXEL_Y_DIMENSION, ++ vips_exif_set_int, (void *) &im->Ysize); + +- return( 0 ); ++ return (0); + } + +-/* And orientation. ++/* And orientation. + */ + static int +-vips_exif_set_orientation( ExifData *ed, VipsImage *im ) ++vips_exif_set_orientation(ExifData *ed, VipsImage *im) + { + int orientation; + + /* We set the tag, even if it's been deleted, since it's a required + * field. + */ +- if( !vips_image_get_typeof( im, VIPS_META_ORIENTATION ) || +- vips_image_get_int( im, VIPS_META_ORIENTATION, &orientation ) ) ++ if (!vips_image_get_typeof(im, VIPS_META_ORIENTATION) || ++ vips_image_get_int(im, VIPS_META_ORIENTATION, &orientation)) + orientation = 1; + +- VIPS_DEBUG_MSG( "set_exif_orientation: %d\n", orientation ); ++ VIPS_DEBUG_MSG("set_exif_orientation: %d\n", orientation); + +- vips_exif_set_tag( ed, 0, EXIF_TAG_ORIENTATION, +- vips_exif_set_int, (void *) &orientation ); ++ vips_exif_set_tag(ed, 0, EXIF_TAG_ORIENTATION, ++ vips_exif_set_int, (void *) &orientation); + +- return( 0 ); ++ return (0); + } + +-/* And thumbnail. ++/* And thumbnail. + */ + static int +-vips_exif_set_thumbnail( ExifData *ed, VipsImage *im ) ++vips_exif_set_thumbnail(ExifData *ed, VipsImage *im) + { + /* Delete any old thumbnail data. We should use the exif free func, + * but the memory allocator is not exposed by libexif! Hopefully they + * are just using free(). + * + * exif.c makes this assumption too when it tries to update a +- * thumbnail. ++ * thumbnail. + */ +- if( ed->data ) { +- free( ed->data ); ++ if (ed->data) { ++ free(ed->data); + ed->data = NULL; + } + ed->size = 0; + +- /* Update EXIF thumbnail from metadata, if any. ++ /* Update EXIF thumbnail from metadata, if any. + */ +- if( vips_image_get_typeof( im, "jpeg-thumbnail-data" ) ) { ++ if (vips_image_get_typeof(im, "jpeg-thumbnail-data")) { + const void *data; + size_t size; + +- if( vips_image_get_blob( im, "jpeg-thumbnail-data", +- &data, &size ) ) +- return( -1 ); ++ if (vips_image_get_blob(im, "jpeg-thumbnail-data", ++ &data, &size)) ++ return (-1); + + /* Again, we should use the exif allocator attached to this + * entry, but it is not exposed! + */ +- if( size > 0 && +- data ) { +- ed->data = malloc( size ); +- memcpy( ed->data, data, size ); ++ if (size > 0 && ++ data) { ++ ed->data = malloc(size); ++ memcpy(ed->data, data, size); + ed->size = size; + } + } + +- return( 0 ); ++ return (0); + } + + /* Skip any spaces. + */ + static const char * +-skip_space( const char *p ) ++skip_space(const char *p) + { +- while( p && *p == ' ' ) ++ while (p && *p == ' ') + p += 1; + +- return( p ); ++ return (p); + } + + /* Skip to the end of this non-space sequence. + */ + static const char * +-skip_nonspace( const char *p ) ++skip_nonspace(const char *p) + { +- while( p && *p && *p != ' ' ) ++ while (p && *p && *p != ' ') + p += 1; + +- return( p ); ++ return (p); + } + + /* See also vips_exif_to_s() ... keep in sync. Only the numeric types are + * handled here, since they can be updated. For string types, we have to +- * destroy and recreate, see above. ++ * destroy and recreate, see above. + */ + static void +-vips_exif_from_s( ExifData *ed, ExifEntry *entry, const char *value ) ++vips_exif_from_s(ExifData *ed, ExifEntry *entry, const char *value) + { + unsigned long i; + const char *p; + int v; + +- if( entry->format == EXIF_FORMAT_SHORT || ++ if (entry->format == EXIF_FORMAT_SHORT || + entry->format == EXIF_FORMAT_SSHORT || + entry->format == EXIF_FORMAT_LONG || +- entry->format == EXIF_FORMAT_SLONG ) { +- if( entry->components >= 10 ) ++ entry->format == EXIF_FORMAT_SLONG) { ++ if (entry->components >= 10) + return; + + p = value; +- for( i = 0; i < entry->components; i++ ) { +- if( !(p = skip_space( p )) ) +- break; ++ for (i = 0; i < entry->components; i++) { ++ if (!(p = skip_space(p))) ++ break; + +- v = atof( p ); +- vips_exif_set_int( ed, entry, i, &v ); ++ v = atof(p); ++ vips_exif_set_int(ed, entry, i, &v); + +- p = skip_nonspace( p ); ++ p = skip_nonspace(p); + } + } +- else if( entry->format == EXIF_FORMAT_RATIONAL || +- entry->format == EXIF_FORMAT_SRATIONAL ) { +- if( entry->components >= 10 ) ++ else if (entry->format == EXIF_FORMAT_RATIONAL || ++ entry->format == EXIF_FORMAT_SRATIONAL) { ++ if (entry->components >= 10) + return; + + p = value; +- for( i = 0; i < entry->components; i++ ) { +- if( !(p = skip_space( p )) ) +- break; ++ for (i = 0; i < entry->components; i++) { ++ if (!(p = skip_space(p))) ++ break; + +- vips_exif_set_rational( ed, entry, i, (void *) p ); ++ vips_exif_set_rational(ed, entry, i, (void *) p); + +- p = skip_nonspace( p ); ++ p = skip_nonspace(p); + } + } +- + } + +-static void +-vips_exif_set_entry( ExifData *ed, ExifEntry *entry, +- unsigned long component, void *data ) ++static void ++vips_exif_set_entry(ExifData *ed, ExifEntry *entry, ++ unsigned long component, void *data) + { +- const char *string = (const char *) data; ++ const char *string = (const char *) data; + +- vips_exif_from_s( ed, entry, string ); ++ vips_exif_from_s(ed, entry, string); + } + + static void * +-vips_exif_image_field( VipsImage *image, +- const char *field, GValue *value, void *data ) ++vips_exif_image_field(VipsImage *image, ++ const char *field, GValue *value, void *data) + { + ExifData *ed = (ExifData *) data; + +@@ -1231,38 +1213,38 @@ vips_exif_image_field( VipsImage *image, + const char *p; + ExifTag tag; + +- if( !vips_isprefix( "exif-ifd", field ) ) +- return( NULL ); ++ if (!vips_isprefix("exif-ifd", field)) ++ return (NULL); + + /* value must be a string. + */ +- if( vips_image_get_string( image, field, &string ) ) { +- g_warning( _( "bad exif meta \"%s\"" ), field ); +- return( NULL ); ++ if (vips_image_get_string(image, field, &string)) { ++ g_warning(_("bad exif meta \"%s\""), field); ++ return (NULL); + } + +- p = field + strlen( "exif-ifd" ); +- ifd = atoi( p ); ++ p = field + strlen("exif-ifd"); ++ ifd = atoi(p); + +- for( ; isdigit( *p ); p++ ) ++ for (; isdigit(*p); p++) + ; +- if( *p != '-' ) { +- g_warning( _( "bad exif meta \"%s\"" ), field ); +- return( NULL ); ++ if (*p != '-') { ++ g_warning(_("bad exif meta \"%s\""), field); ++ return (NULL); + } + + /* GPSVersionID is tag 0 (the error return) so we have to + * test the name too. + */ +- if( !(tag = exif_tag_from_name( p + 1 )) && +- strcmp( p + 1, "GPSVersionID" ) != 0 ) { +- g_warning( _( "bad exif meta \"%s\"" ), field ); +- return( NULL ); ++ if (!(tag = exif_tag_from_name(p + 1)) && ++ strcmp(p + 1, "GPSVersionID") != 0) { ++ g_warning(_("bad exif meta \"%s\""), field); ++ return (NULL); + } + +- vips_exif_set_tag( ed, ifd, tag, vips_exif_set_entry, (void *) string ); ++ vips_exif_set_tag(ed, ifd, tag, vips_exif_set_entry, (void *) string); + +- return( NULL ); ++ return (NULL); + } + + typedef struct _VipsExifRemove { +@@ -1273,55 +1255,55 @@ typedef struct _VipsExifRemove { + } VipsExifRemove; + + static void +-vips_exif_exif_entry( ExifEntry *entry, VipsExifRemove *ve ) ++vips_exif_exif_entry(ExifEntry *entry, VipsExifRemove *ve) + { + const char *tag_name; + char vips_name_txt[256]; +- VipsBuf vips_name_buf = VIPS_BUF_STATIC( vips_name_txt ); ++ VipsBuf vips_name_buf = VIPS_BUF_STATIC(vips_name_txt); + + const char *vips_name; + const char *vips_value; + +- if( !(tag_name = vips_exif_entry_get_name( entry )) ) ++ if (!(tag_name = vips_exif_entry_get_name(entry))) + return; + +- vips_buf_appendf( &vips_name_buf, "exif-ifd%d-%s", +- exif_entry_get_ifd( entry ), tag_name ); +- vips_name = vips_buf_all( &vips_name_buf ); ++ vips_buf_appendf(&vips_name_buf, "exif-ifd%d-%s", ++ exif_entry_get_ifd(entry), tag_name); ++ vips_name = vips_buf_all(&vips_name_buf); + + /* Is there a image metadata item for this tag? + */ + vips_value = NULL; +- if( vips_image_get_typeof( ve->image, vips_name ) ) { ++ if (vips_image_get_typeof(ve->image, vips_name)) { + /* No easy way to return an error code from here, sadly. + */ +- if( vips_image_get_string( ve->image, vips_name, &vips_value ) ) +- g_warning( _( "bad exif meta \"%s\"" ), vips_name ); ++ if (vips_image_get_string(ve->image, vips_name, &vips_value)) ++ g_warning(_("bad exif meta \"%s\""), vips_name); + } + + /* Does this field exist on the image? If not, schedule it for + * removal. + */ +- if( !vips_value ) +- ve->to_remove = g_slist_prepend( ve->to_remove, entry ); ++ if (!vips_value) ++ ve->to_remove = g_slist_prepend(ve->to_remove, entry); + + /* Orientation is really set from the vips + * VIPS_META_ORIENTATION tag. If that's been deleted, we must delete + * any matching EXIF tags too. + */ +- if( strcmp( tag_name, "Orientation" ) == 0 && +- vips_value ) +- ve->to_remove = g_slist_prepend( ve->to_remove, entry ); ++ if (strcmp(tag_name, "Orientation") == 0 && ++ vips_value) ++ ve->to_remove = g_slist_prepend(ve->to_remove, entry); + +- /* If this is a string tag with a new value, we must also remove it ++ /* If this is a string tag with a new value, we must also remove it + * ready for recreation, see the comment below. + */ +- if( vips_value && +- (tag_is_encoding( entry->tag ) || +- tag_is_ascii( entry->tag ) || +- tag_is_utf16( entry->tag )) ) { ++ if (vips_value && ++ (tag_is_encoding(entry->tag) || ++ tag_is_ascii(entry->tag) || ++ tag_is_utf16(entry->tag))) { + char value_txt[256]; +- VipsBuf value = VIPS_BUF_STATIC( value_txt ); ++ VipsBuf value = VIPS_BUF_STATIC(value_txt); + + /* Render the original exif-data value to a string and see + * if the user has changed it. If they have, remove it ready +@@ -1329,82 +1311,82 @@ vips_exif_exif_entry( ExifEntry *entry, VipsExifRemove *ve ) + * + * Leaving it there prevents it being recreated. + */ +- vips_exif_to_s( ve->ed, entry, &value ); +- if( strcmp( vips_buf_all( &value ), vips_value ) != 0 ) +- ve->to_remove = g_slist_prepend( ve->to_remove, entry ); ++ vips_exif_to_s(ve->ed, entry, &value); ++ if (strcmp(vips_buf_all(&value), vips_value) != 0) ++ ve->to_remove = g_slist_prepend(ve->to_remove, entry); + } + } + + static void * +-vips_exif_exif_remove( ExifEntry *entry, VipsExifRemove *ve, void *b ) ++vips_exif_exif_remove(ExifEntry *entry, VipsExifRemove *ve, void *b) + { + #ifdef DEBUG +-{ +- const char *tag_name; +- char vips_name_txt[256]; +- VipsBuf vips_name = VIPS_BUF_STATIC( vips_name_txt ); ++ { ++ const char *tag_name; ++ char vips_name_txt[256]; ++ VipsBuf vips_name = VIPS_BUF_STATIC(vips_name_txt); + +- tag_name = vips_exif_entry_get_name( entry ); +- vips_buf_appendf( &vips_name, "exif-ifd%d-%s", +- exif_entry_get_ifd( entry ), tag_name ); ++ tag_name = vips_exif_entry_get_name(entry); ++ vips_buf_appendf(&vips_name, "exif-ifd%d-%s", ++ exif_entry_get_ifd(entry), tag_name); + +- printf( "vips_exif_exif_remove: %s\n", vips_buf_all( &vips_name ) ); +-} ++ printf("vips_exif_exif_remove: %s\n", vips_buf_all(&vips_name)); ++ } + #endif /*DEBUG*/ + +- exif_content_remove_entry( ve->content, entry ); ++ exif_content_remove_entry(ve->content, entry); + +- return( NULL ); ++ return (NULL); + } + + static void +-vips_exif_exif_content( ExifContent *content, VipsExifRemove *ve ) ++vips_exif_exif_content(ExifContent *content, VipsExifRemove *ve) + { + ve->content = content; + ve->to_remove = NULL; +- exif_content_foreach_entry( content, +- (ExifContentForeachEntryFunc) vips_exif_exif_entry, ve ); +- vips_slist_map2( ve->to_remove, +- (VipsSListMap2Fn) vips_exif_exif_remove, ve, NULL ); +- VIPS_FREEF( g_slist_free, ve->to_remove ); ++ exif_content_foreach_entry(content, ++ (ExifContentForeachEntryFunc) vips_exif_exif_entry, ve); ++ vips_slist_map2(ve->to_remove, ++ (VipsSListMap2Fn) vips_exif_exif_remove, ve, NULL); ++ VIPS_FREEF(g_slist_free, ve->to_remove); + } + + static void +-vips_exif_update( ExifData *ed, VipsImage *image ) ++vips_exif_update(ExifData *ed, VipsImage *image) + { + VipsExifRemove ve; + +- VIPS_DEBUG_MSG( "vips_exif_update: \n" ); ++ VIPS_DEBUG_MSG("vips_exif_update: \n"); + + /* If this exif came from the image (rather than being an exif block we + * have made afresh), then any fields which are in the block but not on + * the image must have been deliberately removed. Remove them from the + * block as well. + * +- * Any string-valued fields (eg. comment etc.) which exist as libvips +- * metadata tags with changed whose values have changed must also be ++ * Any string-valued fields (eg. comment etc.) which exist as libvips ++ * metadata tags with changed whose values have changed must also be + * removed. + * + * libexif does not allow you to change string lengths (you must make + * new tags) so we have to remove ready to re-add. + */ +- if( vips_image_get_typeof( image, VIPS_META_EXIF_NAME ) ) { ++ if (vips_image_get_typeof(image, VIPS_META_EXIF_NAME)) { + ve.image = image; + ve.ed = ed; +- exif_data_foreach_content( ed, +- (ExifDataForeachContentFunc) vips_exif_exif_content, +- &ve ); ++ exif_data_foreach_content(ed, ++ (ExifDataForeachContentFunc) vips_exif_exif_content, ++ &ve); + } + + /* Walk the image and add any exif- that's set in image metadata. + */ +- vips_image_map( image, vips_exif_image_field, ed ); ++ vips_image_map(image, vips_exif_image_field, ed); + } + + /* Examine the metadata tags on the image and update the EXIF block. + */ + int +-vips__exif_update( VipsImage *image ) ++vips__exif_update(VipsImage *image) + { + unsigned char *data; + size_t length; +@@ -1414,95 +1396,95 @@ vips__exif_update( VipsImage *image ) + /* Either parse from the embedded EXIF, or if there's none, make + * some fresh EXIF we can write the resolution to. + */ +- if( vips_image_get_typeof( image, VIPS_META_EXIF_NAME ) ) { +- if( vips_image_get_blob( image, VIPS_META_EXIF_NAME, +- (void *) &data, &length ) ) +- return( -1 ); ++ if (vips_image_get_typeof(image, VIPS_META_EXIF_NAME)) { ++ if (vips_image_get_blob(image, VIPS_META_EXIF_NAME, ++ (void *) &data, &length)) ++ return (-1); + +- if( !(ed = vips_exif_load_data_without_fix( data, length )) ) +- return( -1 ); ++ if (!(ed = vips_exif_load_data_without_fix(data, length))) ++ return (-1); + } +- else { ++ else { + ed = exif_data_new(); + +- exif_data_set_option( ed, +- EXIF_DATA_OPTION_FOLLOW_SPECIFICATION ); +- exif_data_set_data_type( ed, EXIF_DATA_TYPE_COMPRESSED ); +- exif_data_set_byte_order( ed, EXIF_BYTE_ORDER_INTEL ); ++ exif_data_set_option(ed, ++ EXIF_DATA_OPTION_FOLLOW_SPECIFICATION); ++ exif_data_set_data_type(ed, EXIF_DATA_TYPE_COMPRESSED); ++ exif_data_set_byte_order(ed, EXIF_BYTE_ORDER_INTEL); + } + + /* Make sure all required fields are there before we attach the vips + * metadata. + */ +- exif_data_fix( ed ); ++ exif_data_fix(ed); + + /* Update EXIF tags from the image metadata. + */ +- vips_exif_update( ed, image ); ++ vips_exif_update(ed, image); + + /* Update EXIF resolution from the vips image header. + */ +- if( vips_exif_resolution_from_image( ed, image ) ) { +- exif_data_free( ed ); +- return( -1 ); ++ if (vips_exif_resolution_from_image(ed, image)) { ++ exif_data_free(ed); ++ return (-1); + } + + /* Update EXIF image dimensions from the vips image header. + */ +- if( vips_exif_set_dimensions( ed, image ) ) { +- exif_data_free( ed ); +- return( -1 ); ++ if (vips_exif_set_dimensions(ed, image)) { ++ exif_data_free(ed); ++ return (-1); + } + + /* Update EXIF orientation from the vips image header. + */ +- if( vips_exif_set_orientation( ed, image ) ) { +- exif_data_free( ed ); +- return( -1 ); ++ if (vips_exif_set_orientation(ed, image)) { ++ exif_data_free(ed); ++ return (-1); + } + + /* Update the thumbnail. + */ +- if( vips_exif_set_thumbnail( ed, image ) ) { +- exif_data_free( ed ); +- return( -1 ); ++ if (vips_exif_set_thumbnail(ed, image)) { ++ exif_data_free(ed); ++ return (-1); + } + + /* Reserialise and write. exif_data_save_data() returns an int for some + * reason. + */ +- exif_data_save_data( ed, &data, &idl ); +- if( !idl ) { +- vips_error( "exif", "%s", _( "error saving EXIF" ) ); +- exif_data_free( ed ); +- return( -1 ); ++ exif_data_save_data(ed, &data, &idl); ++ if (!idl) { ++ vips_error("exif", "%s", _("error saving EXIF")); ++ exif_data_free(ed); ++ return (-1); + } + length = idl; + + #ifdef DEBUG +- printf( "vips__exif_update: generated %zd bytes of EXIF\n", length ); ++ printf("vips__exif_update: generated %zd bytes of EXIF\n", length); + #endif /*DEBUG*/ + +- vips_image_set_blob( image, VIPS_META_EXIF_NAME, +- (VipsCallbackFn) vips_area_free_cb, data, length ); ++ vips_image_set_blob(image, VIPS_META_EXIF_NAME, ++ (VipsCallbackFn) vips_area_free_cb, data, length); + +- exif_data_free( ed ); ++ exif_data_free(ed); + +- return( 0 ); ++ return (0); + } + + #else /*!HAVE_EXIF*/ + + int +-vips__exif_parse( VipsImage *image ) ++vips__exif_parse(VipsImage *image) + { +- return( 0 ); ++ return (0); + } + + int +-vips__exif_update( VipsImage *image ) ++vips__exif_update(VipsImage *image) + { +- return( 0 ); ++ return (0); + } + + #endif /*!HAVE_EXIF*/ +diff --git a/libvips/foreign/fits.c b/libvips/foreign/fits.c +index 4bce24fb72..05fbf25197 100644 +--- a/libvips/foreign/fits.c ++++ b/libvips/foreign/fits.c +@@ -18,7 +18,7 @@ + * 21/3/11 + * - read/write metadata as whole records to avoid changing things + * - cast input to a supported format +- * - bandsplit for write ++ * - bandsplit for write + * 13/12/11 + * - redo as a set of fns ready for wrapping in a new-style class + * 23/6/13 +@@ -28,9 +28,9 @@ + * support for BSCALE / BZERO settings + * 17/1/17 + * - invalidate operation on read error +- * 26/1/17 aferrero2707 ++ * 26/1/17 aferrero2707 + * - use fits_open_diskfile(), not fits_open_file() ... we don't want the +- * extended filename syntax ++ * extended filename syntax + * 15/4/17 + * - skip HDUs with zero dimensions, thanks benepo + * 27/10/22 +@@ -40,28 +40,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -90,11 +90,11 @@ + + /* + +- TODO ++ TODO + + - ask Doug for a test colour image + +- found WFPC2u5780205r_c0fx.fits on the fits samples page, ++ found WFPC2u5780205r_c0fx.fits on the fits samples page, + but it's tiny + + - test performance +@@ -120,7 +120,7 @@ typedef struct { + int naxis; + long long int naxes[MAX_DIMENSIONS]; + +- GMutex *lock; /* Lock fits_*() calls with this */ ++ GMutex *lock; /* Lock fits_*() calls with this */ + + /* One line of pels ready for scatter/gather. + */ +@@ -130,69 +130,69 @@ typedef struct { + const char *vips__fits_suffs[] = { ".fits", ".fit", ".fts", NULL }; + + static void +-vips_fits_error( int status ) ++vips_fits_error(int status) + { + char buf[80]; + +- fits_get_errstatus( status, buf ); +- vips_error( "fits", "%s", buf ); ++ fits_get_errstatus(status, buf); ++ vips_error("fits", "%s", buf); + } + + /* Shut down. Can be called many times. + */ + static void +-vips_fits_close( VipsFits *fits ) ++vips_fits_close(VipsFits *fits) + { +- VIPS_FREE( fits->filename ); +- VIPS_FREEF( vips_g_mutex_free, fits->lock ); ++ VIPS_FREE(fits->filename); ++ VIPS_FREEF(vips_g_mutex_free, fits->lock); + +- if( fits->fptr ) { ++ if (fits->fptr) { + int status; + + status = 0; + +- if( fits_close_file( fits->fptr, &status ) ) +- vips_fits_error( status ); ++ if (fits_close_file(fits->fptr, &status)) ++ vips_fits_error(status); + + fits->fptr = NULL; + } + +- VIPS_FREE( fits->line ); ++ VIPS_FREE(fits->line); + } + + static void +-vips_fits_close_cb( VipsImage *image, VipsFits *fits ) ++vips_fits_close_cb(VipsImage *image, VipsFits *fits) + { +- vips_fits_close( fits ); ++ vips_fits_close(fits); + } + + static VipsFits * +-vips_fits_new_read( const char *filename, VipsImage *out ) ++vips_fits_new_read(const char *filename, VipsImage *out) + { + VipsFits *fits; + int status; + +- if( !(fits = VIPS_NEW( out, VipsFits )) ) +- return( NULL ); ++ if (!(fits = VIPS_NEW(out, VipsFits))) ++ return (NULL); + +- fits->filename = vips_strdup( NULL, filename ); ++ fits->filename = vips_strdup(NULL, filename); + fits->image = out; + fits->fptr = NULL; + fits->lock = NULL; + fits->line = NULL; +- g_signal_connect( out, "close", +- G_CALLBACK( vips_fits_close_cb ), fits ); ++ g_signal_connect(out, "close", ++ G_CALLBACK(vips_fits_close_cb), fits); + + status = 0; +- if( fits_open_diskfile( &fits->fptr, filename, READONLY, &status ) ) { +- vips_error( "fits", _( "unable to open \"%s\"" ), filename ); +- vips_fits_error( status ); +- return( NULL ); ++ if (fits_open_diskfile(&fits->fptr, filename, READONLY, &status)) { ++ vips_error("fits", _("unable to open \"%s\""), filename); ++ vips_fits_error(status); ++ return (NULL); + } + + fits->lock = vips_g_mutex_new(); + +- return( fits ); ++ return (fits); + } + + /* fits image types -> VIPS band formats. VIPS doesn't have 64-bit int, so no +@@ -200,16 +200,16 @@ vips_fits_new_read( const char *filename, VipsImage *out ) + */ + static int fits2vips_formats[][3] = { + { BYTE_IMG, VIPS_FORMAT_UCHAR, TBYTE }, +- { SHORT_IMG, VIPS_FORMAT_SHORT, TSHORT }, +- { USHORT_IMG, VIPS_FORMAT_USHORT, TUSHORT }, +- { LONG_IMG, VIPS_FORMAT_INT, TINT }, +- { ULONG_IMG, VIPS_FORMAT_UINT, TUINT }, +- { FLOAT_IMG, VIPS_FORMAT_FLOAT, TFLOAT }, ++ { SHORT_IMG, VIPS_FORMAT_SHORT, TSHORT }, ++ { USHORT_IMG, VIPS_FORMAT_USHORT, TUSHORT }, ++ { LONG_IMG, VIPS_FORMAT_INT, TINT }, ++ { ULONG_IMG, VIPS_FORMAT_UINT, TUINT }, ++ { FLOAT_IMG, VIPS_FORMAT_FLOAT, TFLOAT }, + { DOUBLE_IMG, VIPS_FORMAT_DOUBLE, TDOUBLE } + }; + + static int +-vips_fits_get_header( VipsFits *fits, VipsImage *out ) ++vips_fits_get_header(VipsFits *fits, VipsImage *out) + { + int status; + int bitpix; +@@ -225,44 +225,44 @@ vips_fits_get_header( VipsFits *fits, VipsImage *out ) + /* Some FITS images have the first HDU for extra metadata ... skip + * forward until we find a header unit we can load as an image. + */ +- for(;;) { +- if( fits_get_img_paramll( fits->fptr, +- 10, &bitpix, &fits->naxis, fits->naxes, &status ) ) { +- vips_fits_error( status ); +- return( -1 ); ++ for (;;) { ++ if (fits_get_img_paramll(fits->fptr, ++ 10, &bitpix, &fits->naxis, fits->naxes, &status)) { ++ vips_fits_error(status); ++ return (-1); + } + +- if( fits->naxis > 0 ) ++ if (fits->naxis > 0) + break; + +- if( fits_movrel_hdu( fits->fptr, 1, NULL, &status ) ) { +- vips_fits_error( status ); +- vips_error( "fits", +- "%s", _( "no HDU found with naxes > 0" ) ); +- return( -1 ); ++ if (fits_movrel_hdu(fits->fptr, 1, NULL, &status)) { ++ vips_fits_error(status); ++ vips_error("fits", ++ "%s", _("no HDU found with naxes > 0")); ++ return (-1); + } + } + + /* cfitsio does automatic conversion from the format stored in +- * the file to the equivalent type after scale/offset. We need ++ * the file to the equivalent type after scale/offset. We need + * to allocate a vips image of the equivalent type, not the original + * type. + */ +- if( fits_get_img_equivtype( fits->fptr, &bitpix, &status ) ) { +- vips_fits_error( status ); +- return( -1 ); ++ if (fits_get_img_equivtype(fits->fptr, &bitpix, &status)) { ++ vips_fits_error(status); ++ return (-1); + } + + #ifdef VIPS_DEBUG +- VIPS_DEBUG_MSG( "naxis = %d\n", fits->naxis ); +- for( i = 0; i < fits->naxis; i++ ) +- VIPS_DEBUG_MSG( "%d) %lld\n", i, fits->naxes[i] ); +- VIPS_DEBUG_MSG( "fits2vips: bitpix = %d\n", bitpix ); ++ VIPS_DEBUG_MSG("naxis = %d\n", fits->naxis); ++ for (i = 0; i < fits->naxis; i++) ++ VIPS_DEBUG_MSG("%d) %lld\n", i, fits->naxes[i]); ++ VIPS_DEBUG_MSG("fits2vips: bitpix = %d\n", bitpix); + #endif /*VIPS_DEBUG*/ + + height = 1; + bands = 1; +- switch( fits->naxis ) { ++ switch (fits->naxis) { + /* If you add more dimensions here, adjust data read below. See also + * the definition of MAX_DIMENSIONS above. + */ +@@ -273,12 +273,12 @@ vips_fits_get_header( VipsFits *fits, VipsImage *out ) + case 6: + case 5: + case 4: +- for( i = fits->naxis; i > 3; i-- ) +- if( fits->naxes[i - 1] != 1 ) { +- vips_error( "fits", +- "%s", _( "dimensions above 3 " +- "must be size 1" ) ); +- return( -1 ); ++ for (i = fits->naxis; i > 3; i--) ++ if (fits->naxes[i - 1] != 1) { ++ vips_error("fits", ++ "%s", _("dimensions above 3 " ++ "must be size 1")); ++ return (-1); + } + + case 3: +@@ -292,32 +292,32 @@ vips_fits_get_header( VipsFits *fits, VipsImage *out ) + break; + + default: +- vips_error( "fits", _( "bad number of axis %d" ), fits->naxis ); +- return( -1 ); ++ vips_error("fits", _("bad number of axis %d"), fits->naxis); ++ return (-1); + } + + /* Get image format. This is the equivalent format, or the format + * stored in the file. + */ +- for( i = 0; i < VIPS_NUMBER( fits2vips_formats ); i++ ) +- if( fits2vips_formats[i][0] == bitpix ) ++ for (i = 0; i < VIPS_NUMBER(fits2vips_formats); i++) ++ if (fits2vips_formats[i][0] == bitpix) + break; +- if( i == VIPS_NUMBER( fits2vips_formats ) ) { +- vips_error( "fits", _( "unsupported bitpix %d\n" ), +- bitpix ); +- return( -1 ); ++ if (i == VIPS_NUMBER(fits2vips_formats)) { ++ vips_error("fits", _("unsupported bitpix %d\n"), ++ bitpix); ++ return (-1); + } + format = fits2vips_formats[i][1]; + fits->datatype = fits2vips_formats[i][2]; + +- if( bands == 1 ) { +- if( format == VIPS_FORMAT_USHORT ) ++ if (bands == 1) { ++ if (format == VIPS_FORMAT_USHORT) + interpretation = VIPS_INTERPRETATION_GREY16; + else + interpretation = VIPS_INTERPRETATION_B_W; + } +- else if( bands == 3 ) { +- if( format == VIPS_FORMAT_USHORT ) ++ else if (bands == 3) { ++ if (format == VIPS_FORMAT_USHORT) + interpretation = VIPS_INTERPRETATION_RGB16; + else + interpretation = VIPS_INTERPRETATION_sRGB; +@@ -325,77 +325,77 @@ vips_fits_get_header( VipsFits *fits, VipsImage *out ) + else + interpretation = VIPS_INTERPRETATION_MULTIBAND; + +- vips_image_init_fields( out, +- width, height, bands, +- format, +- VIPS_CODING_NONE, interpretation, 1.0, 1.0 ); ++ vips_image_init_fields(out, ++ width, height, bands, ++ format, ++ VIPS_CODING_NONE, interpretation, 1.0, 1.0); + +- /* We read in lines, so SMALLTILE ends up being too small. +- */ +- if( vips_image_pipelinev( out, VIPS_DEMAND_STYLE_FATSTRIP, NULL ) ) +- return( -1 ); ++ /* We read in lines, so SMALLTILE ends up being too small. ++ */ ++ if (vips_image_pipelinev(out, VIPS_DEMAND_STYLE_FATSTRIP, NULL)) ++ return (-1); + + /* We need to be able to hold one scanline of one band for + * scatter/gather. + */ +- if( !(fits->line = VIPS_ARRAY( NULL, +- VIPS_IMAGE_SIZEOF_ELEMENT( out ) * out->Xsize, VipsPel )) ) +- return( -1 ); ++ if (!(fits->line = VIPS_ARRAY(NULL, ++ VIPS_IMAGE_SIZEOF_ELEMENT(out) * out->Xsize, VipsPel))) ++ return (-1); + + /* Read all keys into meta. + */ +- if( fits_get_hdrspace( fits->fptr, &keysexist, NULL, &status ) ) { +- vips_fits_error( status ); +- return( -1 ); ++ if (fits_get_hdrspace(fits->fptr, &keysexist, NULL, &status)) { ++ vips_fits_error(status); ++ return (-1); + } + +- for( i = 0; i < keysexist; i++ ) { ++ for (i = 0; i < keysexist; i++) { + char record[81]; + char vipsname[100]; + +- if( fits_read_record( fits->fptr, i + 1, record, &status ) ) { +- vips_fits_error( status ); +- return( -1 ); ++ if (fits_read_record(fits->fptr, i + 1, record, &status)) { ++ vips_fits_error(status); ++ return (-1); + } + +- VIPS_DEBUG_MSG( "fits2vips: setting meta on vips image:\n" ); +- VIPS_DEBUG_MSG( " record == \"%s\"\n", record ); ++ VIPS_DEBUG_MSG("fits2vips: setting meta on vips image:\n"); ++ VIPS_DEBUG_MSG(" record == \"%s\"\n", record); + + /* FITS lets keys repeat. For example, HISTORY appears many + * times, each time with a fresh line of history attached. We + * have to include the key index in the vips name we assign. + */ + +- vips_snprintf( vipsname, 100, "fits-%d", i ); +- vips_image_set_string( out, vipsname, record ); ++ vips_snprintf(vipsname, 100, "fits-%d", i); ++ vips_image_set_string(out, vipsname, record); + } + +- return( 0 ); ++ return (0); + } + + int +-vips__fits_read_header( const char *filename, VipsImage *out ) ++vips__fits_read_header(const char *filename, VipsImage *out) + { + VipsFits *fits; + +- VIPS_DEBUG_MSG( "fits2vips_header: reading \"%s\"\n", filename ); ++ VIPS_DEBUG_MSG("fits2vips_header: reading \"%s\"\n", filename); + +- if( !(fits = vips_fits_new_read( filename, out )) ) +- return( -1 ); ++ if (!(fits = vips_fits_new_read(filename, out))) ++ return (-1); + +- if( vips_fits_get_header( fits, out ) ) { +- vips_fits_close( fits ); +- return( -1 ); ++ if (vips_fits_get_header(fits, out)) { ++ vips_fits_close(fits); ++ return (-1); + } + +- vips_fits_close( fits ); ++ vips_fits_close(fits); + +- return( 0 ); ++ return (0); + } + + static int +-vips_fits_read_subset( VipsFits *fits, +- long *fpixel, long *lpixel, long *inc, VipsPel *q ) ++vips_fits_read_subset(VipsFits *fits, ++ long *fpixel, long *lpixel, long *inc, VipsPel *q) + { + int status; + +@@ -405,52 +405,53 @@ vips_fits_read_subset( VipsFits *fits, + + /* Break on ffgsv() for this call. + */ +- if( fits_read_subset( fits->fptr, fits->datatype, +- fpixel, lpixel, inc, +- NULL, q, NULL, &status ) ) { +- vips_fits_error( status ); +- vips_foreign_load_invalidate( fits->image ); ++ if (fits_read_subset(fits->fptr, fits->datatype, ++ fpixel, lpixel, inc, ++ NULL, q, NULL, &status)) { ++ vips_fits_error(status); ++ vips_foreign_load_invalidate(fits->image); + +- return( -1 ); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + +-#define SCATTER( TYPE ) { \ +- TYPE *tp = (TYPE *) p; \ +- TYPE *tq = ((TYPE *) q) + band; \ +- \ +- for( int x = 0; x < width; x++ ) { \ +- *tq = tp[x]; \ +- tq += bands; \ +- } \ +-} ++#define SCATTER(TYPE) \ ++ { \ ++ TYPE *tp = (TYPE *) p; \ ++ TYPE *tq = ((TYPE *) q) + band; \ ++\ ++ for (int x = 0; x < width; x++) { \ ++ *tq = tp[x]; \ ++ tq += bands; \ ++ } \ ++ } + + static void +-vips_fits_scatter( VipsFits *fits, VipsPel *q, VipsPel *p, int width, int band ) ++vips_fits_scatter(VipsFits *fits, VipsPel *q, VipsPel *p, int width, int band) + { +- int bands = fits->image->Bands; ++ int bands = fits->image->Bands; + +- switch( fits->image->BandFmt ) { ++ switch (fits->image->BandFmt) { + case VIPS_FORMAT_UCHAR: + case VIPS_FORMAT_CHAR: +- SCATTER( guchar ); ++ SCATTER(guchar); + break; + + case VIPS_FORMAT_SHORT: + case VIPS_FORMAT_USHORT: +- SCATTER( gushort ); ++ SCATTER(gushort); + break; + + case VIPS_FORMAT_INT: + case VIPS_FORMAT_UINT: + case VIPS_FORMAT_FLOAT: +- SCATTER( guint ); ++ SCATTER(guint); + break; + + case VIPS_FORMAT_DOUBLE: +- SCATTER( double ); ++ SCATTER(double); + break; + + default: +@@ -459,142 +460,142 @@ vips_fits_scatter( VipsFits *fits, VipsPel *q, VipsPel *p, int width, int band ) + } + + static int +-vips_fits_generate( VipsRegion *out, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_fits_generate(VipsRegion *out, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsFits *fits = (VipsFits *) a; + VipsRect *r = &out->valid; + +- VIPS_DEBUG_MSG( "fits2vips_generate: " +- "generating left = %d, top = %d, width = %d, height = %d\n", +- r->left, r->top, r->width, r->height ); ++ VIPS_DEBUG_MSG("fits2vips_generate: " ++ "generating left = %d, top = %d, width = %d, height = %d\n", ++ r->left, r->top, r->width, r->height); + +- vips__worker_lock( fits->lock ); ++ vips__worker_lock(fits->lock); + +- for( int w = 0; w < out->im->Bands; w++ ) { +- for( int y = r->top; y < VIPS_RECT_BOTTOM( r ); y++ ) { ++ for (int w = 0; w < out->im->Bands; w++) { ++ for (int y = r->top; y < VIPS_RECT_BOTTOM(r); y++) { + long fpixel[MAX_DIMENSIONS]; + long lpixel[MAX_DIMENSIONS]; + long inc[MAX_DIMENSIONS]; + +- for( int z = 0; z < MAX_DIMENSIONS; z++ ) ++ for (int z = 0; z < MAX_DIMENSIONS; z++) + fpixel[z] = 1; + fpixel[0] = r->left + 1; + fpixel[1] = y + 1; + fpixel[2] = w + 1; + +- for( int z = 0; z < MAX_DIMENSIONS; z++ ) ++ for (int z = 0; z < MAX_DIMENSIONS; z++) + lpixel[z] = 1; +- lpixel[0] = VIPS_RECT_RIGHT( r ); ++ lpixel[0] = VIPS_RECT_RIGHT(r); + lpixel[1] = y + 1; + lpixel[2] = w + 1; + +- for( int z = 0; z < MAX_DIMENSIONS; z++ ) ++ for (int z = 0; z < MAX_DIMENSIONS; z++) + inc[z] = 1; + + /* We're inside a lock, so it's OK to write to ->line. + */ +- if( vips_fits_read_subset( fits, +- fpixel, lpixel, inc, fits->line ) ) { +- g_mutex_unlock( fits->lock ); +- return( -1 ); ++ if (vips_fits_read_subset(fits, ++ fpixel, lpixel, inc, fits->line)) { ++ g_mutex_unlock(fits->lock); ++ return (-1); + } + +- vips_fits_scatter( fits, +- VIPS_REGION_ADDR( out, r->left, y ), fits->line, +- r->width, w ); ++ vips_fits_scatter(fits, ++ VIPS_REGION_ADDR(out, r->left, y), fits->line, ++ r->width, w); + } + } + +- g_mutex_unlock( fits->lock ); ++ g_mutex_unlock(fits->lock); + +- return( 0 ); ++ return (0); + } + + int +-vips__fits_read( const char *filename, VipsImage *out ) ++vips__fits_read(const char *filename, VipsImage *out) + { + VipsFits *fits; + +- if( !(fits = vips_fits_new_read( filename, out )) ) +- return( -1 ); +- if( vips_fits_get_header( fits, out ) || +- vips_image_generate( out, +- NULL, vips_fits_generate, NULL, fits, NULL ) ) { +- vips_fits_close( fits ); +- return( -1 ); ++ if (!(fits = vips_fits_new_read(filename, out))) ++ return (-1); ++ if (vips_fits_get_header(fits, out) || ++ vips_image_generate(out, ++ NULL, vips_fits_generate, NULL, fits, NULL)) { ++ vips_fits_close(fits); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + int +-vips__fits_isfits( const char *filename ) ++vips__fits_isfits(const char *filename) + { + fitsfile *fptr; + int status; + +- VIPS_DEBUG_MSG( "isfits: testing \"%s\"\n", filename ); ++ VIPS_DEBUG_MSG("isfits: testing \"%s\"\n", filename); + + status = 0; + +- if( fits_open_diskfile( &fptr, filename, READONLY, &status ) ) { +- VIPS_DEBUG_MSG( "isfits: error reading \"%s\"\n", filename ); ++ if (fits_open_diskfile(&fptr, filename, READONLY, &status)) { ++ VIPS_DEBUG_MSG("isfits: error reading \"%s\"\n", filename); + #ifdef VIPS_DEBUG +- vips_fits_error( status ); +- VIPS_DEBUG_MSG( "isfits: %s\n", vips_error_buffer() ); ++ vips_fits_error(status); ++ VIPS_DEBUG_MSG("isfits: %s\n", vips_error_buffer()); + #endif /*VIPS_DEBUG*/ + +- return( 0 ); ++ return (0); + } +- fits_close_file( fptr, &status ); ++ fits_close_file(fptr, &status); + +- return( 1 ); ++ return (1); + } + + static VipsFits * +-vips_fits_new_write( VipsImage *in, const char *filename ) ++vips_fits_new_write(VipsImage *in, const char *filename) + { + VipsFits *fits; + int status; + + status = 0; + +- if( !(fits = VIPS_NEW( in, VipsFits )) ) +- return( NULL ); +- fits->filename = vips_strdup( VIPS_OBJECT( in ), filename ); ++ if (!(fits = VIPS_NEW(in, VipsFits))) ++ return (NULL); ++ fits->filename = vips_strdup(VIPS_OBJECT(in), filename); + fits->image = in; + fits->fptr = NULL; + fits->lock = NULL; + fits->line = NULL; +- g_signal_connect( in, "close", +- G_CALLBACK( vips_fits_close_cb ), fits ); ++ g_signal_connect(in, "close", ++ G_CALLBACK(vips_fits_close_cb), fits); + +- if( !(fits->filename = vips_strdup( NULL, filename )) ) +- return( NULL ); ++ if (!(fits->filename = vips_strdup(NULL, filename))) ++ return (NULL); + + /* We need to be able to hold one scanline of one band. + */ +- if( !(fits->line = VIPS_ARRAY( NULL, +- VIPS_IMAGE_SIZEOF_ELEMENT( in ) * in->Xsize, VipsPel )) ) +- return( NULL ); ++ if (!(fits->line = VIPS_ARRAY(NULL, ++ VIPS_IMAGE_SIZEOF_ELEMENT(in) * in->Xsize, VipsPel))) ++ return (NULL); + + /* fits_create_file() will fail if there's a file of thet name, unless + * we put a "!" in front ofthe filename. This breaks conventions with + * the rest of vips, so just unlink explicitly. + */ +- g_unlink( filename ); ++ g_unlink(filename); + +- if( fits_create_file( &fits->fptr, filename, &status ) ) { +- vips_error( "fits", +- _( "unable to write to \"%s\"" ), filename ); +- vips_fits_error( status ); +- return( NULL ); ++ if (fits_create_file(&fits->fptr, filename, &status)) { ++ vips_error("fits", ++ _("unable to write to \"%s\""), filename); ++ vips_fits_error(status); ++ return (NULL); + } + + fits->lock = vips_g_mutex_new(); + +- return( fits ); ++ return (fits); + } + + /* Header fields which cfitsio 4.1 writes for us start like this. +@@ -612,8 +613,8 @@ const char *vips_fits_basic[] = { + }; + + static void * +-vips_fits_write_meta( VipsImage *image, +- const char *field, GValue *value, void *a ) ++vips_fits_write_meta(VipsImage *image, ++ const char *field, GValue *value, void *a) + { + VipsFits *fits = (VipsFits *) a; + +@@ -624,33 +625,33 @@ vips_fits_write_meta( VipsImage *image, + + /* We want fields which start "fits-". + */ +- if( !vips_isprefix( "fits-", field ) ) +- return( NULL ); ++ if (!vips_isprefix("fits-", field)) ++ return (NULL); + +- /* The value should be a refstring, since we wrote it in fits2vips ++ /* The value should be a refstring, since we wrote it in fits2vips + * above ^^. + */ +- value_str = vips_value_get_ref_string( value, NULL ); ++ value_str = vips_value_get_ref_string(value, NULL); + + /* We don't want fields which cfitsio will have already written for us. + */ +- for( int i = 0; i < VIPS_NUMBER( vips_fits_basic ); i++ ) +- if( vips_isprefix( vips_fits_basic[i], value_str ) ) +- return( NULL ); ++ for (int i = 0; i < VIPS_NUMBER(vips_fits_basic); i++) ++ if (vips_isprefix(vips_fits_basic[i], value_str)) ++ return (NULL); + +- VIPS_DEBUG_MSG( "vips_fits_write_meta: setting meta on fits image:\n" ); +- VIPS_DEBUG_MSG( " value == \"%s\"\n", value_str ); ++ VIPS_DEBUG_MSG("vips_fits_write_meta: setting meta on fits image:\n"); ++ VIPS_DEBUG_MSG(" value == \"%s\"\n", value_str); + +- if( fits_write_record( fits->fptr, value_str, &status ) ) { +- vips_fits_error( status ); +- return( a ); ++ if (fits_write_record(fits->fptr, value_str, &status)) { ++ vips_fits_error(status); ++ return (a); + } + +- return( NULL ); ++ return (NULL); + } + + static int +-vips_fits_set_header( VipsFits *fits, VipsImage *in ) ++vips_fits_set_header(VipsFits *fits, VipsImage *in) + { + int status; + int bitpix; +@@ -663,73 +664,73 @@ vips_fits_set_header( VipsFits *fits, VipsImage *in ) + fits->naxes[1] = in->Ysize; + fits->naxes[2] = in->Bands; + +- for( i = 0; i < VIPS_NUMBER( fits2vips_formats ); i++ ) +- if( fits2vips_formats[i][1] == in->BandFmt ) ++ for (i = 0; i < VIPS_NUMBER(fits2vips_formats); i++) ++ if (fits2vips_formats[i][1] == in->BandFmt) + break; +- if( i == VIPS_NUMBER( fits2vips_formats ) ) { +- vips_error( "fits", +- _( "unsupported BandFmt %d\n" ), in->BandFmt ); +- return( -1 ); ++ if (i == VIPS_NUMBER(fits2vips_formats)) { ++ vips_error("fits", ++ _("unsupported BandFmt %d\n"), in->BandFmt); ++ return (-1); + } + bitpix = fits2vips_formats[i][0]; + fits->datatype = fits2vips_formats[i][2]; + + #ifdef VIPS_DEBUG +- VIPS_DEBUG_MSG( "naxis = %d\n", fits->naxis ); +- for( i = 0; i < fits->naxis; i++ ) +- VIPS_DEBUG_MSG( "%d) %lld\n", i, fits->naxes[i] ); +- VIPS_DEBUG_MSG( "bitpix = %d\n", bitpix ); ++ VIPS_DEBUG_MSG("naxis = %d\n", fits->naxis); ++ for (i = 0; i < fits->naxis; i++) ++ VIPS_DEBUG_MSG("%d) %lld\n", i, fits->naxes[i]); ++ VIPS_DEBUG_MSG("bitpix = %d\n", bitpix); + #endif /*VIPS_DEBUG*/ + +- if( fits_create_imgll( fits->fptr, bitpix, fits->naxis, +- fits->naxes, &status ) ) { +- vips_fits_error( status ); +- return( -1 ); ++ if (fits_create_imgll(fits->fptr, bitpix, fits->naxis, ++ fits->naxes, &status)) { ++ vips_fits_error(status); ++ return (-1); + } + +- if( vips_image_map( in, +- (VipsImageMapFn) vips_fits_write_meta, fits ) ) +- return( -1 ); ++ if (vips_image_map(in, ++ (VipsImageMapFn) vips_fits_write_meta, fits)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_fits_write( VipsRegion *region, VipsRect *area, void *a ) ++vips_fits_write(VipsRegion *region, VipsRect *area, void *a) + { + VipsFits *fits = (VipsFits *) a; + VipsImage *image = fits->image; +- int es = VIPS_IMAGE_SIZEOF_ELEMENT( image ); +- int ps = VIPS_IMAGE_SIZEOF_PEL( image ); ++ int es = VIPS_IMAGE_SIZEOF_ELEMENT(image); ++ int ps = VIPS_IMAGE_SIZEOF_PEL(image); + + int status; + int y, b, x, k; + + status = 0; + +- VIPS_DEBUG_MSG( "vips_fits_write: " +- "writing left = %d, top = %d, width = %d, height = %d\n", +- area->left, area->top, area->width, area->height ); ++ VIPS_DEBUG_MSG("vips_fits_write: " ++ "writing left = %d, top = %d, width = %d, height = %d\n", ++ area->left, area->top, area->width, area->height); + + /* We need to write a band at a time. We can't bandsplit in vips, + * since vips_sink_disc() can't loop over many images at once, sadly. + */ + +- for( y = 0; y < area->height; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( region, +- area->left, area->top + y ); ++ for (y = 0; y < area->height; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(region, ++ area->left, area->top + y); + +- for( b = 0; b < image->Bands; b++ ) { ++ for (b = 0; b < image->Bands; b++) { + VipsPel *p1, *q; + long fpixel[3]; + + p1 = p + b * es; + q = fits->line; + +- for( x = 0; x < area->width; x++ ) { +- for( k = 0; k < es; k++ ) ++ for (x = 0; x < area->width; x++) { ++ for (k = 0; k < es; k++) + q[k] = p1[k]; +- ++ + q += es; + p1 += ps; + } +@@ -741,36 +742,36 @@ vips_fits_write( VipsRegion *region, VipsRect *area, void *a ) + /* No need to lock, write functions are single-threaded. + */ + +- if( fits_write_pix( fits->fptr, fits->datatype, +- fpixel, area->width, fits->line, +- &status ) ) { +- vips_fits_error( status ); +- return( -1 ); ++ if (fits_write_pix(fits->fptr, fits->datatype, ++ fpixel, area->width, fits->line, ++ &status)) { ++ vips_fits_error(status); ++ return (-1); + } + } + } + +- return( 0 ); ++ return (0); + } + + int +-vips__fits_write( VipsImage *in, const char *filename ) ++vips__fits_write(VipsImage *in, const char *filename) + { + VipsFits *fits; + +- VIPS_DEBUG_MSG( "vips2fits: writing \"%s\"\n", filename ); ++ VIPS_DEBUG_MSG("vips2fits: writing \"%s\"\n", filename); + +- if( !(fits = vips_fits_new_write( in, filename )) ) +- return( -1 ); ++ if (!(fits = vips_fits_new_write(in, filename))) ++ return (-1); + +- if( vips_fits_set_header( fits, fits->image ) || +- vips_sink_disc( fits->image, vips_fits_write, fits ) ) { +- vips_fits_close( fits ); +- return( -1 ); ++ if (vips_fits_set_header(fits, fits->image) || ++ vips_sink_disc(fits->image, vips_fits_write, fits)) { ++ vips_fits_close(fits); ++ return (-1); + } +- vips_fits_close( fits ); ++ vips_fits_close(fits); + +- return( 0 ); ++ return (0); + } + + #endif /*HAVE_CFITSIO*/ +diff --git a/libvips/foreign/fitsload.c b/libvips/foreign/fitsload.c +index d067ab3a01..a3808345c9 100644 +--- a/libvips/foreign/fitsload.c ++++ b/libvips/foreign/fitsload.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -67,113 +67,111 @@ typedef struct _VipsForeignLoadFits { + + typedef VipsForeignLoadClass VipsForeignLoadFitsClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadFits, vips_foreign_load_fits, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadFits, vips_foreign_load_fits, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_fits_dispose( GObject *gobject ) ++vips_foreign_load_fits_dispose(GObject *gobject) + { + VipsForeignLoadFits *fits = (VipsForeignLoadFits *) gobject; + +- VIPS_UNREF( fits->source ); ++ VIPS_UNREF(fits->source); + +- G_OBJECT_CLASS( vips_foreign_load_fits_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_fits_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_load_fits_build( VipsObject *object ) ++vips_foreign_load_fits_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsForeignLoadFits *fits = ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsForeignLoadFits *fits = + (VipsForeignLoadFits *) object; + + /* We can only open sources which have an associated filename, since + * the fits library works in terms of filenames. + */ +- if( fits->source ) { +- VipsConnection *connection = VIPS_CONNECTION( fits->source ); ++ if (fits->source) { ++ VipsConnection *connection = VIPS_CONNECTION(fits->source); + + const char *filename; + +- if( !vips_source_is_file( fits->source ) || +- !(filename = vips_connection_filename( connection )) ) { +- vips_error( class->nickname, "%s", +- _( "no filename available" ) ); +- return( -1 ); ++ if (!vips_source_is_file(fits->source) || ++ !(filename = vips_connection_filename(connection))) { ++ vips_error(class->nickname, "%s", ++ _("no filename available")); ++ return (-1); + } + + fits->filename = filename; + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_fits_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_fits_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static VipsForeignFlags +-vips_foreign_load_fits_get_flags_source( VipsSource *source ) ++vips_foreign_load_fits_get_flags_source(VipsSource *source) + { +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static VipsForeignFlags +-vips_foreign_load_fits_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_fits_get_flags(VipsForeignLoad *load) + { +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static VipsForeignFlags +-vips_foreign_load_fits_get_flags_filename( const char *filename ) ++vips_foreign_load_fits_get_flags_filename(const char *filename) + { + VipsSource *source; + VipsForeignFlags flags; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( 0 ); +- flags = vips_foreign_load_fits_get_flags_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (0); ++ flags = vips_foreign_load_fits_get_flags_source(source); ++ VIPS_UNREF(source); + +- return( flags ); ++ return (flags); + } + + static int +-vips_foreign_load_fits_header( VipsForeignLoad *load ) ++vips_foreign_load_fits_header(VipsForeignLoad *load) + { + VipsForeignLoadFits *fits = (VipsForeignLoadFits *) load; + +- if( vips__fits_read_header( fits->filename, load->out ) ) +- return( -1 ); ++ if (vips__fits_read_header(fits->filename, load->out)) ++ return (-1); + +- VIPS_SETSTR( load->out->filename, fits->filename ); ++ VIPS_SETSTR(load->out->filename, fits->filename); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_fits_load( VipsForeignLoad *load ) ++vips_foreign_load_fits_load(VipsForeignLoad *load) + { + VipsForeignLoadFits *fits = (VipsForeignLoadFits *) load; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( fits ), 2 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(fits), 2); + + t[0] = vips_image_new(); +- if( vips__fits_read( fits->filename, t[0] ) || +- vips_flip( t[0], &t[1], VIPS_DIRECTION_VERTICAL, NULL ) || +- vips_image_write( t[1], load->real ) ) +- return( -1 ); ++ if (vips__fits_read(fits->filename, t[0]) || ++ vips_flip(t[0], &t[1], VIPS_DIRECTION_VERTICAL, NULL) || ++ vips_image_write(t[1], load->real)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_fits_class_init( VipsForeignLoadFitsClass *class ) ++vips_foreign_load_fits_class_init(VipsForeignLoadFitsClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -182,7 +180,7 @@ vips_foreign_load_fits_class_init( VipsForeignLoadFitsClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "fitsload_base"; +- object_class->description = _( "FITS loader base class" ); ++ object_class->description = _("FITS loader base class"); + object_class->build = vips_foreign_load_fits_build; + + /* cfitsio has not been fuzzed, so should not be used with +@@ -194,17 +192,16 @@ vips_foreign_load_fits_class_init( VipsForeignLoadFitsClass *class ) + */ + foreign_class->priority = -50; + +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_fits_get_flags_filename; + load_class->get_flags = vips_foreign_load_fits_get_flags; + load_class->is_a = vips__fits_isfits; + load_class->header = vips_foreign_load_fits_header; + load_class->load = vips_foreign_load_fits_load; +- + } + + static void +-vips_foreign_load_fits_init( VipsForeignLoadFits *fits ) ++vips_foreign_load_fits_init(VipsForeignLoadFits *fits) + { + } + +@@ -213,36 +210,35 @@ typedef struct _VipsForeignLoadFitsFile { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadFitsFile; + + typedef VipsForeignLoadFitsClass VipsForeignLoadFitsFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadFitsFile, vips_foreign_load_fits_file, +- vips_foreign_load_fits_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadFitsFile, vips_foreign_load_fits_file, ++ vips_foreign_load_fits_get_type()); + + static int +-vips_foreign_load_fits_file_build( VipsObject *object ) ++vips_foreign_load_fits_file_build(VipsObject *object) + { + VipsForeignLoadFits *fits = (VipsForeignLoadFits *) object; + VipsForeignLoadFitsFile *file = (VipsForeignLoadFitsFile *) object; + +- if( file->filename && +- !(fits->source = vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(fits->source = vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_fits_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_fits_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_fits_file_class_init( VipsForeignLoadFitsFileClass *class ) ++vips_foreign_load_fits_file_class_init(VipsForeignLoadFitsFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -251,23 +247,23 @@ vips_foreign_load_fits_file_class_init( VipsForeignLoadFitsFileClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "fitsload"; +- object_class->description = _( "load a FITS image" ); ++ object_class->description = _("load a FITS image"); + object_class->build = vips_foreign_load_fits_file_build; + + foreign_class->suffs = vips__fits_suffs; + + load_class->is_a = vips__fits_isfits; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadFitsFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadFitsFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_fits_file_init( VipsForeignLoadFitsFile *file ) ++vips_foreign_load_fits_file_init(VipsForeignLoadFitsFile *file) + { + } + +@@ -282,72 +278,70 @@ typedef struct _VipsForeignLoadFitsSource { + + typedef VipsForeignLoadFitsClass VipsForeignLoadFitsSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadFitsSource, vips_foreign_load_fits_source, +- vips_foreign_load_fits_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadFitsSource, vips_foreign_load_fits_source, ++ vips_foreign_load_fits_get_type()); + + static int +-vips_foreign_load_fits_source_build( VipsObject *object ) ++vips_foreign_load_fits_source_build(VipsObject *object) + { + VipsForeignLoadFits *fits = (VipsForeignLoadFits *) object; +- VipsForeignLoadFitsSource *source = ++ VipsForeignLoadFitsSource *source = + (VipsForeignLoadFitsSource *) object; + +- if( source->source ) { ++ if (source->source) { + fits->source = source->source; +- g_object_ref( fits->source ); ++ g_object_ref(fits->source); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_fits_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_fits_source_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_fits_source_is_a_source( VipsSource *source ) ++vips_foreign_load_fits_source_is_a_source(VipsSource *source) + { +- VipsConnection *connection = VIPS_CONNECTION( source ); ++ VipsConnection *connection = VIPS_CONNECTION(source); + + const char *filename; + +- return( vips_source_is_file( source ) && +- (filename = vips_connection_filename( connection )) && +- vips__fits_isfits( filename ) ); ++ return (vips_source_is_file(source) && ++ (filename = vips_connection_filename(connection)) && ++ vips__fits_isfits(filename)); + } + + static void +-vips_foreign_load_fits_source_class_init( +- VipsForeignLoadFitsSourceClass *class ) ++vips_foreign_load_fits_source_class_init( ++ VipsForeignLoadFitsSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "fitsload_source"; +- object_class->description = _( "load FITS from a source" ); ++ object_class->description = _("load FITS from a source"); + object_class->build = vips_foreign_load_fits_source_build; + + operation_class->flags |= VIPS_OPERATION_NOCACHE; + +- load_class->is_a_source = ++ load_class->is_a_source = + vips_foreign_load_fits_source_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadFitsSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadFitsSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_fits_source_init( VipsForeignLoadFitsSource *fits ) ++vips_foreign_load_fits_source_init(VipsForeignLoadFitsSource *fits) + { + } + +@@ -359,13 +353,13 @@ vips_foreign_load_fits_source_init( VipsForeignLoadFitsSource *fits ) + * @out: (out): decompressed image + * @...: %NULL-terminated list of optional named arguments + * +- * Read a FITS image file into a VIPS image. ++ * Read a FITS image file into a VIPS image. + * + * This operation can read images with up to three dimensions. Any higher +- * dimensions must be empty. ++ * dimensions must be empty. + * +- * It can read 8, 16 and 32-bit integer images, signed and unsigned, float and +- * double. ++ * It can read 8, 16 and 32-bit integer images, signed and unsigned, float and ++ * double. + * + * FITS metadata is attached with the "fits-" prefix. + * +@@ -374,16 +368,16 @@ vips_foreign_load_fits_source_init( VipsForeignLoadFitsSource *fits ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_fitsload( const char *filename, VipsImage **out, ... ) ++vips_fitsload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "fitsload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("fitsload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -392,19 +386,19 @@ vips_fitsload( const char *filename, VipsImage **out, ... ) + * @out: (out): decompressed image + * @...: %NULL-terminated list of optional named arguments + * +- * Exactly as vips_fitsload(), but read from a source. ++ * Exactly as vips_fitsload(), but read from a source. + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_fitsload_source( VipsSource *source, VipsImage **out, ... ) ++vips_fitsload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "fitsload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("fitsload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/fitssave.c b/libvips/foreign/fitssave.c +index ea83f16783..46d7cbef2d 100644 +--- a/libvips/foreign/fitssave.c ++++ b/libvips/foreign/fitssave.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -58,42 +58,41 @@ typedef struct _VipsForeignSaveFits { + + /* Filename for save. + */ +- char *filename; ++ char *filename; + + } VipsForeignSaveFits; + + typedef VipsForeignSaveClass VipsForeignSaveFitsClass; + +-G_DEFINE_TYPE( VipsForeignSaveFits, vips_foreign_save_fits, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_TYPE(VipsForeignSaveFits, vips_foreign_save_fits, ++ VIPS_TYPE_FOREIGN_SAVE); + + static int +-vips_foreign_save_fits_build( VipsObject *object ) ++vips_foreign_save_fits_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveFits *fits = (VipsForeignSaveFits *) object; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( fits ), 2 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(fits), 2); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_fits_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_fits_parent_class)->build(object)) ++ return (-1); + + /* FITS is written bottom-to-top, so we must flip. + * +- * But all vips readers must work top-to-bottom (or vips_copy()'s seq +- * hint won't work) so we must cache the input image. ++ * But all vips readers must work top-to-bottom (or vips_copy()'s seq ++ * hint won't work) so we must cache the input image. + * + * We cache to RAM, but perhaps we should use something like + * vips_get_disc_threshold() and copy to a tempfile. + */ + t[0] = vips_image_new_memory(); +- if( vips_image_write( save->ready, t[0] ) || +- vips_flip( t[0], &t[1], VIPS_DIRECTION_VERTICAL, NULL ) || +- vips__fits_write( t[1], fits->filename ) ) +- return( -1 ); ++ if (vips_image_write(save->ready, t[0]) || ++ vips_flip(t[0], &t[1], VIPS_DIRECTION_VERTICAL, NULL) || ++ vips__fits_write(t[1], fits->filename)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Save a bit of typing. +@@ -115,11 +114,11 @@ static VipsBandFormat bandfmt_fits[10] = { + }; + + static void +-vips_foreign_save_fits_class_init( VipsForeignSaveFitsClass *class ) ++vips_foreign_save_fits_class_init(VipsForeignSaveFitsClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; + +@@ -127,7 +126,7 @@ vips_foreign_save_fits_class_init( VipsForeignSaveFitsClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "fitssave"; +- object_class->description = _( "save image to fits file" ); ++ object_class->description = _("save image to fits file"); + object_class->build = vips_foreign_save_fits_build; + + /* cfitsio has not been fuzzed, so should not be used with +@@ -140,16 +139,16 @@ vips_foreign_save_fits_class_init( VipsForeignSaveFitsClass *class ) + save_class->saveable = VIPS_SAVEABLE_ANY; + save_class->format_table = bandfmt_fits; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveFits, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveFits, filename), ++ NULL); + } + + static void +-vips_foreign_save_fits_init( VipsForeignSaveFits *fits ) ++vips_foreign_save_fits_init(VipsForeignSaveFits *fits) + { + } + +@@ -157,8 +156,8 @@ vips_foreign_save_fits_init( VipsForeignSaveFits *fits ) + + /** + * vips_fitssave: (method) +- * @in: image to save +- * @filename: file to write to ++ * @in: image to save ++ * @filename: file to write to + * @...: %NULL-terminated list of optional named arguments + * + * Write a VIPS image to a file in FITS format. +@@ -168,14 +167,14 @@ vips_foreign_save_fits_init( VipsForeignSaveFits *fits ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_fitssave( VipsImage *in, const char *filename, ... ) ++vips_fitssave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "fitssave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("fitssave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/foreign.c b/libvips/foreign/foreign.c +index 5fe674411f..f3941c5119 100644 +--- a/libvips/foreign/foreign.c ++++ b/libvips/foreign/foreign.c +@@ -30,28 +30,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -81,41 +81,41 @@ + * @include: vips/vips.h + * @title: VipsForeign + * +- * This set of operations load and save images in a variety of formats. ++ * This set of operations load and save images in a variety of formats. + * + * The operations share a base class that offers a simple way to search for a + * subclass of #VipsForeign which can load a certain file (see +- * vips_foreign_find_load()) or buffer (see vips_foreign_find_load_buffer()), ++ * vips_foreign_find_load()) or buffer (see vips_foreign_find_load_buffer()), + * or which could be used to save an image to a + * certain file type (see vips_foreign_find_save() and + * vips_foreign_find_save_buffer()). You can then run these + * operations using vips_call() and friends to perform the load or save. + * + * vips_image_write_to_file() and vips_image_new_from_file() and friends use +- * these functions to automate file load and save. ++ * these functions to automate file load and save. + * + * You can also invoke the operations directly, for example: + * + * |[ +- * vips_tiffsave (my_image, "frank.anything", ++ * vips_tiffsave (my_image, "frank.anything", + * "compression", VIPS_FOREIGN_TIFF_COMPRESSION_JPEG, + * NULL); + * ]| + * + * To add support for a new file format to vips, simply define a new subclass +- * of #VipsForeignLoad or #VipsForeignSave. ++ * of #VipsForeignLoad or #VipsForeignSave. + * +- * If you define a new operation which is a subclass of #VipsForeign, support ++ * If you define a new operation which is a subclass of #VipsForeign, support + * for it automatically appears in all VIPS user-interfaces. It will also be + * transparently supported by vips_image_new_from_file() and friends. + * + * VIPS comes with VipsForeign for TIFF, JPEG, PNG, Analyze, PPM, OpenEXR, CSV, +- * Matlab, Radiance, RAW, FITS, WebP, SVG, PDF, GIF and VIPS. It also includes +- * import filters which can load with libMagick and with OpenSlide. ++ * Matlab, Radiance, RAW, FITS, WebP, SVG, PDF, GIF and VIPS. It also includes ++ * import filters which can load with libMagick and with OpenSlide. + * + * ## Writing a new loader + * +- * Add a new loader to VIPS by subclassing #VipsForeignLoad. Subclasses need to ++ * Add a new loader to VIPS by subclassing #VipsForeignLoad. Subclasses need to + * implement at least @header(). + * + * @header() must set at least the header fields of @out. @load(), if defined, +@@ -124,7 +124,7 @@ + * The suffix list is used to select a format to save a file in, and to pick a + * loader if you don't define is_a(). + * +- * You should also define @nickname and @description in #VipsObject. ++ * You should also define @nickname and @description in #VipsObject. + * + * As a complete example, here's code for a PNG loader, minus the actual + * calls to libpng. +@@ -132,59 +132,59 @@ + * |[ + * typedef struct _VipsForeignLoadPng { + * VipsForeignLoad parent_object; +- * +- * char *filename; ++ * ++ * char *filename; + * } VipsForeignLoadPng; +- * ++ * + * typedef VipsForeignLoadClass VipsForeignLoadPngClass; +- * +- * G_DEFINE_TYPE( VipsForeignLoadPng, vips_foreign_load_png, ++ * ++ * G_DEFINE_TYPE( VipsForeignLoadPng, vips_foreign_load_png, + * VIPS_TYPE_FOREIGN_LOAD ); +- * ++ * + * static VipsForeignFlags + * vips_foreign_load_png_get_flags_filename( const char *filename ) + * { + * VipsForeignFlags flags; +- * ++ * + * flags = 0; + * if( vips__png_isinterlaced( filename ) ) + * flags = VIPS_FOREIGN_PARTIAL; + * else + * flags = VIPS_FOREIGN_SEQUENTIAL; +- * ++ * + * return( flags ); + * } +- * ++ * + * static VipsForeignFlags + * vips_foreign_load_png_get_flags( VipsForeignLoad *load ) + * { + * VipsForeignLoadPng *png = (VipsForeignLoadPng *) load; +- * ++ * + * return( vips_foreign_load_png_get_flags_filename( png->filename ) ); + * } +- * ++ * + * static int + * vips_foreign_load_png_header( VipsForeignLoad *load ) + * { + * VipsForeignLoadPng *png = (VipsForeignLoadPng *) load; +- * ++ * + * if( vips__png_header( png->filename, load->out ) ) + * return( -1 ); +- * ++ * + * return( 0 ); + * } +- * ++ * + * static int + * vips_foreign_load_png_load( VipsForeignLoad *load ) + * { + * VipsForeignLoadPng *png = (VipsForeignLoadPng *) load; +- * ++ * + * if( vips__png_read( png->filename, load->real ) ) + * return( -1 ); +- * ++ * + * return( 0 ); + * } +- * ++ * + * static void + * vips_foreign_load_png_class_init( VipsForeignLoadPngClass *class ) + * { +@@ -192,40 +192,40 @@ + * VipsObjectClass *object_class = (VipsObjectClass *) class; + * VipsForeignClass *foreign_class = (VipsForeignClass *) class; + * VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +- * ++ * + * gobject_class->set_property = vips_object_set_property; + * gobject_class->get_property = vips_object_get_property; +- * ++ * + * object_class->nickname = "pngload"; + * object_class->description = _( "load png from file" ); +- * ++ * + * foreign_class->suffs = vips__png_suffs; +- * ++ * + * load_class->is_a = vips__png_ispng; +- * load_class->get_flags_filename = ++ * load_class->get_flags_filename = + * vips_foreign_load_png_get_flags_filename; + * load_class->get_flags = vips_foreign_load_png_get_flags; + * load_class->header = vips_foreign_load_png_header; + * load_class->load = vips_foreign_load_png_load; +- * +- * VIPS_ARG_STRING( class, "filename", 1, ++ * ++ * VIPS_ARG_STRING( class, "filename", 1, + * _( "Filename" ), + * _( "Filename to load from" ), +- * VIPS_ARGUMENT_REQUIRED_INPUT, ++ * VIPS_ARGUMENT_REQUIRED_INPUT, + * G_STRUCT_OFFSET( VipsForeignLoadPng, filename ), + * NULL ); + * } +- * ++ * + * static void + * vips_foreign_load_png_init( VipsForeignLoadPng *png ) + * { + * } + * ]| +- * ++ * + * ## Writing a new saver + * + * Call your saver in the class' @build() method after chaining up. The +- * prepared image should be ready for you to save in @ready. ++ * prepared image should be ready for you to save in @ready. + * + * As a complete example, here's the code for the CSV saver, minus the calls + * to the actual save routines. +@@ -233,32 +233,32 @@ + * |[ + * typedef struct _VipsForeignSaveCsv { + * VipsForeignSave parent_object; +- * +- * char *filename; ++ * ++ * char *filename; + * const char *separator; + * } VipsForeignSaveCsv; +- * ++ * + * typedef VipsForeignSaveClass VipsForeignSaveCsvClass; +- * +- * G_DEFINE_TYPE( VipsForeignSaveCsv, vips_foreign_save_csv, ++ * ++ * G_DEFINE_TYPE( VipsForeignSaveCsv, vips_foreign_save_csv, + * VIPS_TYPE_FOREIGN_SAVE ); +- * ++ * + * static int + * vips_foreign_save_csv_build( VipsObject *object ) + * { + * VipsForeignSave *save = (VipsForeignSave *) object; + * VipsForeignSaveCsv *csv = (VipsForeignSaveCsv *) object; +- * ++ * + * if( VIPS_OBJECT_CLASS( vips_foreign_save_csv_parent_class )-> + * build( object ) ) + * return( -1 ); +- * ++ * + * if( vips__csv_write( save->ready, csv->filename, csv->separator ) ) + * return( -1 ); +- * ++ * + * return( 0 ); + * } +- * ++ * + * static void + * vips_foreign_save_csv_class_init( VipsForeignSaveCsvClass *class ) + * { +@@ -266,35 +266,35 @@ + * VipsObjectClass *object_class = (VipsObjectClass *) class; + * VipsForeignClass *foreign_class = (VipsForeignClass *) class; + * VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; +- * ++ * + * gobject_class->set_property = vips_object_set_property; + * gobject_class->get_property = vips_object_get_property; +- * ++ * + * object_class->nickname = "csvsave"; + * object_class->description = _( "save image to csv file" ); + * object_class->build = vips_foreign_save_csv_build; +- * ++ * + * foreign_class->suffs = vips__foreign_csv_suffs; +- * ++ * + * save_class->saveable = VIPS_SAVEABLE_MONO; +- * // no need to define ->format_table, we don't want the input ++ * // no need to define ->format_table, we don't want the input + * // cast for us +- * +- * VIPS_ARG_STRING( class, "filename", 1, ++ * ++ * VIPS_ARG_STRING( class, "filename", 1, + * _( "Filename" ), + * _( "Filename to save to" ), +- * VIPS_ARGUMENT_REQUIRED_INPUT, ++ * VIPS_ARGUMENT_REQUIRED_INPUT, + * G_STRUCT_OFFSET( VipsForeignSaveCsv, filename ), + * NULL ); +- * +- * VIPS_ARG_STRING( class, "separator", 13, +- * _( "Separator" ), ++ * ++ * VIPS_ARG_STRING( class, "separator", 13, ++ * _( "Separator" ), + * _( "Separator characters" ), + * VIPS_ARGUMENT_OPTIONAL_INPUT, + * G_STRUCT_OFFSET( VipsForeignSaveCsv, separator ), +- * "\t" ); ++ * "\t" ); + * } +- * ++ * + * static void + * vips_foreign_save_csv_init( VipsForeignSaveCsv *csv ) + * { +@@ -303,12 +303,12 @@ + * ]| + */ + +-/* Use this to link images to the load operation that made them. ++/* Use this to link images to the load operation that made them. + */ +-static GQuark vips__foreign_load_operation = 0; ++static GQuark vips__foreign_load_operation = 0; + + /** +- * VipsForeignFlags: ++ * VipsForeignFlags: + * @VIPS_FOREIGN_NONE: no flags set + * @VIPS_FOREIGN_PARTIAL: the image may be read lazilly + * @VIPS_FOREIGN_BIGENDIAN: image pixels are most-significant byte first +@@ -317,11 +317,11 @@ static GQuark vips__foreign_load_operation = 0; + * Some hints about the image loader. + * + * #VIPS_FOREIGN_PARTIAL means that the image can be read directly from the +- * file without needing to be unpacked to a temporary image first. ++ * file without needing to be unpacked to a temporary image first. + * + * #VIPS_FOREIGN_SEQUENTIAL means that the loader supports lazy reading, but + * only top-to-bottom (sequential) access. Formats like PNG can read sets of +- * scanlines, for example, but only in order. ++ * scanlines, for example, but only in order. + * + * If neither PARTIAL or SEQUENTIAL is set, the loader only supports whole + * image read. Setting both PARTIAL and SEQUENTIAL is an error. +@@ -331,79 +331,78 @@ static GQuark vips__foreign_load_operation = 0; + * need to swap bytes. See vips_copy(). + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsForeign, vips_foreign, VIPS_TYPE_OPERATION ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeign, vips_foreign, VIPS_TYPE_OPERATION); + + static void +-vips_foreign_summary_class( VipsObjectClass *object_class, VipsBuf *buf ) ++vips_foreign_summary_class(VipsObjectClass *object_class, VipsBuf *buf) + { +- VipsForeignClass *class = VIPS_FOREIGN_CLASS( object_class ); +- VipsOperationClass *operation_class = +- VIPS_OPERATION_CLASS( object_class ); ++ VipsForeignClass *class = VIPS_FOREIGN_CLASS(object_class); ++ VipsOperationClass *operation_class = ++ VIPS_OPERATION_CLASS(object_class); + +- VIPS_OBJECT_CLASS( vips_foreign_parent_class )-> +- summary_class( object_class, buf ); ++ VIPS_OBJECT_CLASS(vips_foreign_parent_class)->summary_class(object_class, buf); + +- if( class->suffs ) { ++ if (class->suffs) { + const char **p; + +- vips_buf_appends( buf, " (" ); +- for( p = class->suffs; *p; p++ ) { +- vips_buf_appendf( buf, "%s", *p ); +- if( p[1] ) +- vips_buf_appends( buf, ", " ); ++ vips_buf_appends(buf, " ("); ++ for (p = class->suffs; *p; p++) { ++ vips_buf_appendf(buf, "%s", *p); ++ if (p[1]) ++ vips_buf_appends(buf, ", "); + } +- vips_buf_appends( buf, ")" ); ++ vips_buf_appends(buf, ")"); + } + +- vips_buf_appendf( buf, ", priority=%d", class->priority ); ++ vips_buf_appendf(buf, ", priority=%d", class->priority); + +- if( operation_class->flags & VIPS_OPERATION_UNTRUSTED ) +- vips_buf_appendf( buf, ", untrusted" ); +- if( operation_class->flags & VIPS_OPERATION_BLOCKED ) +- vips_buf_appendf( buf, ", blocked" ); ++ if (operation_class->flags & VIPS_OPERATION_UNTRUSTED) ++ vips_buf_appendf(buf, ", untrusted"); ++ if (operation_class->flags & VIPS_OPERATION_BLOCKED) ++ vips_buf_appendf(buf, ", blocked"); + } + + static void +-vips_foreign_class_init( VipsForeignClass *class ) ++vips_foreign_class_init(VipsForeignClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "foreign"; +- object_class->description = _( "load and save image files" ); ++ object_class->description = _("load and save image files"); + object_class->summary_class = vips_foreign_summary_class; + } + + static void +-vips_foreign_init( VipsForeign *object ) ++vips_foreign_init(VipsForeign *object) + { + } + +-/* To iterate over supported files we build a temp list of subclasses of ++/* To iterate over supported files we build a temp list of subclasses of + * VipsForeign, sort by priority, iterate, and free. + */ + + static void * +-file_add_class( VipsForeignClass *class, GSList **files ) ++file_add_class(VipsForeignClass *class, GSList **files) + { + /* We exclude "rawload" as it has a different API. + */ +- if( !vips_isprefix( "rawload", VIPS_OBJECT_CLASS( class )->nickname ) ) +- /* Append so we don't reverse the list of files. Sort will +- * not reorder items of equal priority. ++ if (!vips_isprefix("rawload", VIPS_OBJECT_CLASS(class)->nickname)) ++ /* Append so we don't reverse the list of files. Sort will ++ * not reorder items of equal priority. + */ +- *files = g_slist_append( *files, class ); ++ *files = g_slist_append(*files, class); + +- return( NULL ); ++ return (NULL); + } + + static gint +-file_compare( VipsForeignClass *a, VipsForeignClass *b, void *user_data ) ++file_compare(VipsForeignClass *a, VipsForeignClass *b, void *user_data) + { +- return( b->priority - a->priority ); ++ return (b->priority - a->priority); + } + + /** +@@ -414,7 +413,7 @@ file_compare( VipsForeignClass *a, VipsForeignClass *b, void *user_data ) + * @b: user data + * + * Apply a function to every #VipsForeignClass that VIPS knows about. Foreigns +- * are presented to the function in priority order. ++ * are presented to the function in priority order. + * + * Like all VIPS map functions, if @fn returns %NULL, iteration continues. If + * it returns non-%NULL, iteration terminates and that value is returned. The +@@ -425,120 +424,119 @@ file_compare( VipsForeignClass *a, VipsForeignClass *b, void *user_data ) + * Returns: (transfer none): the result of iteration + */ + void * +-vips_foreign_map( const char *base, VipsSListMap2Fn fn, void *a, void *b ) ++vips_foreign_map(const char *base, VipsSListMap2Fn fn, void *a, void *b) + { + GSList *files; + void *result; + + files = NULL; +- (void) vips_class_map_all( g_type_from_name( base ), +- (VipsClassMapFn) file_add_class, (void *) &files ); ++ (void) vips_class_map_all(g_type_from_name(base), ++ (VipsClassMapFn) file_add_class, (void *) &files); + +- files = g_slist_sort( files, (GCompareFunc) file_compare ); ++ files = g_slist_sort(files, (GCompareFunc) file_compare); + #ifdef DEBUG +-{ +- GSList *p; ++ { ++ GSList *p; + +- printf( "vips_foreign_map: search order\n" ); +- for( p = files; p; p = p->next ) { +- VipsForeignClass *class = (VipsForeignClass *) p->data; ++ printf("vips_foreign_map: search order\n"); ++ for (p = files; p; p = p->next) { ++ VipsForeignClass *class = (VipsForeignClass *) p->data; + +- printf( "\t%s\n", VIPS_OBJECT_CLASS( class )->nickname ); ++ printf("\t%s\n", VIPS_OBJECT_CLASS(class)->nickname); ++ } + } +-} + #endif /*DEBUG*/ +- result = vips_slist_map2( files, fn, a, b ); ++ result = vips_slist_map2(files, fn, a, b); + +- g_slist_free( files ); ++ g_slist_free(files); + +- return( result ); ++ return (result); + } + + /* Abstract base class for image load. + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoad, vips_foreign_load, VIPS_TYPE_FOREIGN ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoad, vips_foreign_load, VIPS_TYPE_FOREIGN); + + static void +-vips_foreign_load_dispose( GObject *gobject ) ++vips_foreign_load_dispose(GObject *gobject) + { +- VipsForeignLoad *load = VIPS_FOREIGN_LOAD( gobject ); ++ VipsForeignLoad *load = VIPS_FOREIGN_LOAD(gobject); + +- VIPS_UNREF( load->real ); ++ VIPS_UNREF(load->real); + +- G_OBJECT_CLASS( vips_foreign_load_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_parent_class)->dispose(gobject); + } + + static void +-vips_foreign_load_summary_class( VipsObjectClass *object_class, VipsBuf *buf ) +-{ +- VipsForeignLoadClass *class = VIPS_FOREIGN_LOAD_CLASS( object_class ); +- +- VIPS_OBJECT_CLASS( vips_foreign_load_parent_class )-> +- summary_class( object_class, buf ); +- +- if( !G_TYPE_IS_ABSTRACT( G_TYPE_FROM_CLASS( class ) ) ) { +- if( class->is_a ) +- vips_buf_appends( buf, ", is_a" ); +- if( class->is_a_buffer ) +- vips_buf_appends( buf, ", is_a_buffer" ); +- if( class->is_a_source ) +- vips_buf_appends( buf, ", is_a_source" ); +- if( class->get_flags ) +- vips_buf_appends( buf, ", get_flags" ); +- if( class->get_flags_filename ) +- vips_buf_appends( buf, ", get_flags_filename" ); +- if( class->header ) +- vips_buf_appends( buf, ", header" ); +- if( class->load ) +- vips_buf_appends( buf, ", load" ); ++vips_foreign_load_summary_class(VipsObjectClass *object_class, VipsBuf *buf) ++{ ++ VipsForeignLoadClass *class = VIPS_FOREIGN_LOAD_CLASS(object_class); ++ ++ VIPS_OBJECT_CLASS(vips_foreign_load_parent_class)->summary_class(object_class, buf); ++ ++ if (!G_TYPE_IS_ABSTRACT(G_TYPE_FROM_CLASS(class))) { ++ if (class->is_a) ++ vips_buf_appends(buf, ", is_a"); ++ if (class->is_a_buffer) ++ vips_buf_appends(buf, ", is_a_buffer"); ++ if (class->is_a_source) ++ vips_buf_appends(buf, ", is_a_source"); ++ if (class->get_flags) ++ vips_buf_appends(buf, ", get_flags"); ++ if (class->get_flags_filename) ++ vips_buf_appends(buf, ", get_flags_filename"); ++ if (class->header) ++ vips_buf_appends(buf, ", header"); ++ if (class->load) ++ vips_buf_appends(buf, ", load"); + + /* You can omit ->load(), you must not omit ->header(). + */ +- g_assert( class->header ); ++ g_assert(class->header); + } + } + + /* Can this VipsForeign open this file? + */ + static void * +-vips_foreign_find_load_sub( VipsForeignLoadClass *load_class, +- const char *filename, void *b ) ++vips_foreign_find_load_sub(VipsForeignLoadClass *load_class, ++ const char *filename, void *b) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( load_class ); +- VipsForeignClass *class = VIPS_FOREIGN_CLASS( load_class ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(load_class); ++ VipsForeignClass *class = VIPS_FOREIGN_CLASS(load_class); + + /* Ignore the buffer and source loaders. + */ +- if( vips_ispostfix( object_class->nickname, "_buffer" ) || +- vips_ispostfix( object_class->nickname, "_source" ) ) +- return( NULL ); ++ if (vips_ispostfix(object_class->nickname, "_buffer") || ++ vips_ispostfix(object_class->nickname, "_source")) ++ return (NULL); + + #ifdef DEBUG +- printf( "vips_foreign_find_load_sub: %s\n", +- VIPS_OBJECT_CLASS( class )->nickname ); ++ printf("vips_foreign_find_load_sub: %s\n", ++ VIPS_OBJECT_CLASS(class)->nickname); + #endif /*DEBUG*/ + + /* Try to sniff the filetype from the first few bytes, if we can, + * otherwise fall back to checking the filename suffix. + */ +- if( load_class->is_a ) { +- if( load_class->is_a( filename ) ) +- return( load_class ); ++ if (load_class->is_a) { ++ if (load_class->is_a(filename)) ++ return (load_class); + + #ifdef DEBUG +- printf( "vips_foreign_find_load_sub: is_a failed\n" ); ++ printf("vips_foreign_find_load_sub: is_a failed\n"); + #endif /*DEBUG*/ + } +- else if( class->suffs ) { +- if( vips_filename_suffix_match( filename, class->suffs ) ) +- return( load_class ); ++ else if (class->suffs) { ++ if (vips_filename_suffix_match(filename, class->suffs)) ++ return (load_class); + } +- else +- g_warning( "loader %s has no is_a method and no suffix list", +- object_class->nickname ); ++ else ++ g_warning("loader %s has no is_a method and no suffix list", ++ object_class->nickname); + +- return( NULL ); ++ return (NULL); + } + + /** +@@ -546,57 +544,57 @@ vips_foreign_find_load_sub( VipsForeignLoadClass *load_class, + * @filename: file to find a loader for + * + * Searches for an operation you could use to load @filename. Any trailing +- * options on @filename are stripped and ignored. ++ * options on @filename are stripped and ignored. + * + * See also: vips_foreign_find_load_buffer(), vips_image_new_from_file(). + * + * Returns: the name of an operation on success, %NULL on error + */ + const char * +-vips_foreign_find_load( const char *name ) ++vips_foreign_find_load(const char *name) + { + char filename[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; + VipsForeignLoadClass *load_class; + +- vips__filename_split8( name, filename, option_string ); ++ vips__filename_split8(name, filename, option_string); + + /* Very common, so make a better error message for this case. + */ +- if( !vips_existsf( "%s", filename ) ) { +- vips_error( "VipsForeignLoad", +- _( "file \"%s\" does not exist" ), name ); +- return( NULL ); ++ if (!vips_existsf("%s", filename)) { ++ vips_error("VipsForeignLoad", ++ _("file \"%s\" does not exist"), name); ++ return (NULL); + } +- if( vips_isdirf( "%s", filename ) ) { +- vips_error( "VipsForeignLoad", +- _( "\"%s\" is a directory" ), name ); +- return( NULL ); ++ if (vips_isdirf("%s", filename)) { ++ vips_error("VipsForeignLoad", ++ _("\"%s\" is a directory"), name); ++ return (NULL); + } + +- if( !(load_class = (VipsForeignLoadClass *) vips_foreign_map( +- "VipsForeignLoad", +- (VipsSListMap2Fn) vips_foreign_find_load_sub, +- (void *) filename, NULL )) ) { +- vips_error( "VipsForeignLoad", +- _( "\"%s\" is not a known file format" ), name ); +- return( NULL ); ++ if (!(load_class = (VipsForeignLoadClass *) vips_foreign_map( ++ "VipsForeignLoad", ++ (VipsSListMap2Fn) vips_foreign_find_load_sub, ++ (void *) filename, NULL))) { ++ vips_error("VipsForeignLoad", ++ _("\"%s\" is not a known file format"), name); ++ return (NULL); + } + + #ifdef DEBUG +- printf( "vips_foreign_find_load: selected %s\n", +- VIPS_OBJECT_CLASS( load_class )->nickname ); ++ printf("vips_foreign_find_load: selected %s\n", ++ VIPS_OBJECT_CLASS(load_class)->nickname); + #endif /*DEBUG*/ + +- return( G_OBJECT_CLASS_NAME( load_class ) ); ++ return (G_OBJECT_CLASS_NAME(load_class)); + } + + /* Kept for compat with earlier version of the vip8 API. Use +- * vips_image_new_from_file() now. ++ * vips_image_new_from_file() now. + */ + + int +-vips_foreign_load( const char *name, VipsImage **out, ... ) ++vips_foreign_load(const char *name, VipsImage **out, ...) + { + char filename[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; +@@ -604,103 +602,103 @@ vips_foreign_load( const char *name, VipsImage **out, ... ) + va_list ap; + int result; + +- vips__filename_split8( name, filename, option_string ); +- if( !(operation_name = vips_foreign_find_load( filename )) ) +- return( -1 ); ++ vips__filename_split8(name, filename, option_string); ++ if (!(operation_name = vips_foreign_find_load(filename))) ++ return (-1); + +- va_start( ap, out ); +- result = vips_call_split_option_string( operation_name, option_string, +- ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split_option_string(operation_name, option_string, ++ ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /* Can this VipsForeign open this buffer? + */ + static void * +-vips_foreign_find_load_buffer_sub( VipsForeignLoadClass *load_class, +- const void **buf, size_t *len ) ++vips_foreign_find_load_buffer_sub(VipsForeignLoadClass *load_class, ++ const void **buf, size_t *len) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( load_class ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(load_class); + + /* Skip non-buffer loaders. + */ +- if( !vips_ispostfix( object_class->nickname, "_buffer" ) ) +- return( NULL ); ++ if (!vips_ispostfix(object_class->nickname, "_buffer")) ++ return (NULL); + +- if( load_class->is_a_buffer ) { +- if( load_class->is_a_buffer( *buf, *len ) ) +- return( load_class ); ++ if (load_class->is_a_buffer) { ++ if (load_class->is_a_buffer(*buf, *len)) ++ return (load_class); + } + else +- g_warning( "loader %s has no is_a_buffer method", +- object_class->nickname ); ++ g_warning("loader %s has no is_a_buffer method", ++ object_class->nickname); + +- return( NULL ); ++ return (NULL); + } + + /** + * vips_foreign_find_load_buffer: +- * @data: (array length=size) (element-type guint8) (transfer none): start of ++ * @data: (array length=size) (element-type guint8) (transfer none): start of + * memory buffer + * @size: (type gsize): number of bytes in @data + * + * Searches for an operation you could use to load a memory buffer. To see the + * range of buffer loaders supported by your vips, try something like: +- * ++ * + * vips -l | grep load_buffer + * + * See also: vips_image_new_from_buffer(). + * +- * Returns: (transfer none): the name of an operation on success, %NULL on ++ * Returns: (transfer none): the name of an operation on success, %NULL on + * error. + */ + const char * +-vips_foreign_find_load_buffer( const void *data, size_t size ) ++vips_foreign_find_load_buffer(const void *data, size_t size) + { + VipsForeignLoadClass *load_class; + +- if( !(load_class = (VipsForeignLoadClass *) vips_foreign_map( +- "VipsForeignLoad", +- (VipsSListMap2Fn) vips_foreign_find_load_buffer_sub, +- &data, &size )) ) { +- vips_error( "VipsForeignLoad", +- "%s", _( "buffer is not in a known format" ) ); +- return( NULL ); ++ if (!(load_class = (VipsForeignLoadClass *) vips_foreign_map( ++ "VipsForeignLoad", ++ (VipsSListMap2Fn) vips_foreign_find_load_buffer_sub, ++ &data, &size))) { ++ vips_error("VipsForeignLoad", ++ "%s", _("buffer is not in a known format")); ++ return (NULL); + } + +- return( G_OBJECT_CLASS_NAME( load_class ) ); ++ return (G_OBJECT_CLASS_NAME(load_class)); + } + + /* Can this VipsForeign open this source? + */ + static void * +-vips_foreign_find_load_source_sub( void *item, void *a, void *b ) ++vips_foreign_find_load_source_sub(void *item, void *a, void *b) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( item ); +- VipsForeignLoadClass *load_class = VIPS_FOREIGN_LOAD_CLASS( item ); +- VipsSource *source = VIPS_SOURCE( a ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(item); ++ VipsForeignLoadClass *load_class = VIPS_FOREIGN_LOAD_CLASS(item); ++ VipsSource *source = VIPS_SOURCE(a); + + /* Skip non-source loaders. + */ +- if( !vips_ispostfix( object_class->nickname, "_source" ) ) +- return( NULL ); ++ if (!vips_ispostfix(object_class->nickname, "_source")) ++ return (NULL); + +- if( load_class->is_a_source ) { ++ if (load_class->is_a_source) { + /* We may have done a _read() rather than a _sniff() in one of + * the is_a testers. Always rewind. + */ +- (void) vips_source_rewind( source ); ++ (void) vips_source_rewind(source); + +- if( load_class->is_a_source( source ) ) +- return( load_class ); ++ if (load_class->is_a_source(source)) ++ return (load_class); + } +- else +- g_warning( "loader %s has no is_a_source method", +- object_class->nickname ); ++ else ++ g_warning("loader %s has no is_a_source method", ++ object_class->nickname); + +- return( NULL ); ++ return (NULL); + } + + /** +@@ -709,34 +707,34 @@ vips_foreign_find_load_source_sub( void *item, void *a, void *b ) + * + * Searches for an operation you could use to load a source. To see the + * range of source loaders supported by your vips, try something like: +- * ++ * + * vips -l | grep load_source + * + * See also: vips_image_new_from_source(). + * +- * Returns: (transfer none): the name of an operation on success, %NULL on ++ * Returns: (transfer none): the name of an operation on success, %NULL on + * error. + */ + const char * +-vips_foreign_find_load_source( VipsSource *source ) ++vips_foreign_find_load_source(VipsSource *source) + { + VipsForeignLoadClass *load_class; + +- if( !(load_class = (VipsForeignLoadClass *) vips_foreign_map( +- "VipsForeignLoad", +- vips_foreign_find_load_source_sub, +- source, NULL )) ) { +- vips_error( "VipsForeignLoad", +- "%s", _( "source is not in a known format" ) ); +- return( NULL ); ++ if (!(load_class = (VipsForeignLoadClass *) vips_foreign_map( ++ "VipsForeignLoad", ++ vips_foreign_find_load_source_sub, ++ source, NULL))) { ++ vips_error("VipsForeignLoad", ++ "%s", _("source is not in a known format")); ++ return (NULL); + } + + /* All source loaders should be NOCACHE. + */ +- g_assert( VIPS_OPERATION_CLASS( load_class )->flags & +- VIPS_OPERATION_NOCACHE ); ++ g_assert(VIPS_OPERATION_CLASS(load_class)->flags & ++ VIPS_OPERATION_NOCACHE); + +- return( G_OBJECT_CLASS_NAME( load_class ) ); ++ return (G_OBJECT_CLASS_NAME(load_class)); + } + + /** +@@ -749,20 +747,20 @@ vips_foreign_find_load_source( VipsSource *source ) + * + * Returns: %TRUE if @filename can be loaded by @loader. + */ +-gboolean +-vips_foreign_is_a( const char *loader, const char *filename ) ++gboolean ++vips_foreign_is_a(const char *loader, const char *filename) + { + const VipsObjectClass *class; + VipsForeignLoadClass *load_class; + +- if( !(class = vips_class_find( "VipsForeignLoad", loader )) ) +- return( FALSE ); +- load_class = VIPS_FOREIGN_LOAD_CLASS( class ); +- if( load_class->is_a && +- load_class->is_a( filename ) ) +- return( TRUE ); ++ if (!(class = vips_class_find("VipsForeignLoad", loader))) ++ return (FALSE); ++ load_class = VIPS_FOREIGN_LOAD_CLASS(class); ++ if (load_class->is_a && ++ load_class->is_a(filename)) ++ return (TRUE); + +- return( FALSE ); ++ return (FALSE); + } + + /** +@@ -777,19 +775,19 @@ vips_foreign_is_a( const char *loader, const char *filename ) + * Returns: %TRUE if @data can be loaded by @loader. + */ + gboolean +-vips_foreign_is_a_buffer( const char *loader, const void *data, size_t size ) ++vips_foreign_is_a_buffer(const char *loader, const void *data, size_t size) + { + const VipsObjectClass *class; + VipsForeignLoadClass *load_class; + +- if( !(class = vips_class_find( "VipsForeignLoad", loader )) ) +- return( FALSE ); +- load_class = VIPS_FOREIGN_LOAD_CLASS( class ); +- if( load_class->is_a_buffer && +- load_class->is_a_buffer( data, size ) ) +- return( TRUE ); ++ if (!(class = vips_class_find("VipsForeignLoad", loader))) ++ return (FALSE); ++ load_class = VIPS_FOREIGN_LOAD_CLASS(class); ++ if (load_class->is_a_buffer && ++ load_class->is_a_buffer(data, size)) ++ return (TRUE); + +- return( FALSE ); ++ return (FALSE); + } + + /** +@@ -803,19 +801,19 @@ vips_foreign_is_a_buffer( const char *loader, const void *data, size_t size ) + * Returns: %TRUE if @data can be loaded by @source. + */ + gboolean +-vips_foreign_is_a_source( const char *loader, VipsSource *source ) ++vips_foreign_is_a_source(const char *loader, VipsSource *source) + { + const VipsObjectClass *class; + VipsForeignLoadClass *load_class; + +- if( !(class = vips_class_find( "VipsForeignLoad", loader )) ) +- return( FALSE ); +- load_class = VIPS_FOREIGN_LOAD_CLASS( class ); +- if( load_class->is_a_source && +- load_class->is_a_source( source ) ) +- return( TRUE ); ++ if (!(class = vips_class_find("VipsForeignLoad", loader))) ++ return (FALSE); ++ load_class = VIPS_FOREIGN_LOAD_CLASS(class); ++ if (load_class->is_a_source && ++ load_class->is_a_source(source)) ++ return (TRUE); + +- return( FALSE ); ++ return (FALSE); + } + + /** +@@ -823,284 +821,281 @@ vips_foreign_is_a_source( const char *loader, VipsSource *source ) + * @loader: name of loader to use for test + * @filename: file to test + * +- * Return the flags for @filename using @loader. ++ * Return the flags for @filename using @loader. + * @loader is something like "tiffload" or "VipsForeignLoadTiff". + * + * Returns: the flags for @filename. + */ +-VipsForeignFlags +-vips_foreign_flags( const char *loader, const char *filename ) ++VipsForeignFlags ++vips_foreign_flags(const char *loader, const char *filename) + { + const VipsObjectClass *class; + +- if( (class = vips_class_find( "VipsForeignLoad", loader )) ) { +- VipsForeignLoadClass *load_class = +- VIPS_FOREIGN_LOAD_CLASS( class ); ++ if ((class = vips_class_find("VipsForeignLoad", loader))) { ++ VipsForeignLoadClass *load_class = ++ VIPS_FOREIGN_LOAD_CLASS(class); + +- if( load_class->get_flags_filename ) +- return( load_class->get_flags_filename( filename ) ); ++ if (load_class->get_flags_filename) ++ return (load_class->get_flags_filename(filename)); + } + +- return( 0 ); ++ return (0); + } + + static VipsObject * +-vips_foreign_load_new_from_string( const char *string ) ++vips_foreign_load_new_from_string(const char *string) + { + const char *file_op; + GType type; + VipsForeignLoad *load; + +- if( !(file_op = vips_foreign_find_load( string )) ) +- return( NULL ); +- type = g_type_from_name( file_op ); +- g_assert( type ); ++ if (!(file_op = vips_foreign_find_load(string))) ++ return (NULL); ++ type = g_type_from_name(file_op); ++ g_assert(type); + +- load = VIPS_FOREIGN_LOAD( g_object_new( type, NULL ) ); +- g_object_set( load, ++ load = VIPS_FOREIGN_LOAD(g_object_new(type, NULL)); ++ g_object_set(load, + "filename", string, +- NULL ); ++ NULL); + +- return( VIPS_OBJECT( load ) ); ++ return (VIPS_OBJECT(load)); + } + + static VipsImage * +-vips_foreign_load_temp( VipsForeignLoad *load ) ++vips_foreign_load_temp(VipsForeignLoad *load) + { + const guint64 disc_threshold = vips_get_disc_threshold(); +- const guint64 image_size = VIPS_IMAGE_SIZEOF_IMAGE( load->out ); ++ const guint64 image_size = VIPS_IMAGE_SIZEOF_IMAGE(load->out); + + /* ->memory used to be called ->disc and default TRUE. If it's been + * forced FALSE, set memory TRUE. + */ +- if( !load->disc ) ++ if (!load->disc) + load->memory = TRUE; + +- if( load->memory ) { ++ if (load->memory) { + #ifdef DEBUG +- printf( "vips_foreign_load_temp: forced memory temp\n" ); ++ printf("vips_foreign_load_temp: forced memory temp\n"); + #endif /*DEBUG*/ + +- return( vips_image_new_memory() ); ++ return (vips_image_new_memory()); + } + + /* If this is a partial operation, we can open directly. + */ +- if( load->flags & VIPS_FOREIGN_PARTIAL ) { ++ if (load->flags & VIPS_FOREIGN_PARTIAL) { + #ifdef DEBUG +- printf( "vips_foreign_load_temp: partial temp\n" ); ++ printf("vips_foreign_load_temp: partial temp\n"); + #endif /*DEBUG*/ + +- return( vips_image_new() ); ++ return (vips_image_new()); + } + + /* If it can do sequential access and it's been requested, we can open + * directly. + */ +- if( (load->flags & VIPS_FOREIGN_SEQUENTIAL) && +- load->access != VIPS_ACCESS_RANDOM ) { ++ if ((load->flags & VIPS_FOREIGN_SEQUENTIAL) && ++ load->access != VIPS_ACCESS_RANDOM) { + #ifdef DEBUG +- printf( "vips_foreign_load_temp: partial sequential temp\n" ); ++ printf("vips_foreign_load_temp: partial sequential temp\n"); + #endif /*DEBUG*/ + +- return( vips_image_new() ); ++ return (vips_image_new()); + } + +- /* We open via disc if the uncompressed image will be larger than ++ /* We open via disc if the uncompressed image will be larger than + * vips_get_disc_threshold() + */ +- if( image_size > disc_threshold ) { ++ if (image_size > disc_threshold) { + #ifdef DEBUG +- printf( "vips_foreign_load_temp: disc temp\n" ); ++ printf("vips_foreign_load_temp: disc temp\n"); + #endif /*DEBUG*/ + +- return( vips_image_new_temp_file( "%s.v" ) ); ++ return (vips_image_new_temp_file("%s.v")); + } + + #ifdef DEBUG +- printf( "vips_foreign_load_temp: fallback memory temp\n" ); ++ printf("vips_foreign_load_temp: fallback memory temp\n"); + #endif /*DEBUG*/ + + /* Otherwise, fall back to a memory buffer. + */ +- return( vips_image_new_memory() ); +- ++ return (vips_image_new_memory()); + } + + /* Check two images for compatibility: their geometries need to match. + */ + static gboolean +-vips_foreign_load_iscompat( VipsImage *a, VipsImage *b ) ++vips_foreign_load_iscompat(VipsImage *a, VipsImage *b) + { +- if( a->Xsize != b->Xsize || ++ if (a->Xsize != b->Xsize || + a->Ysize != b->Ysize || + a->Bands != b->Bands || + a->Coding != b->Coding || +- a->BandFmt != b->BandFmt ) { +- vips_error( "VipsForeignLoad", "%s", +- _( "images do not match between header and load" ) ); +- return( FALSE ); ++ a->BandFmt != b->BandFmt) { ++ vips_error("VipsForeignLoad", "%s", ++ _("images do not match between header and load")); ++ return (FALSE); + } + +- return( TRUE ); ++ return (TRUE); + } + + /* Our start function ... do the lazy open, if necessary, and return a region + * on the new image. + */ + static void * +-vips_foreign_load_start( VipsImage *out, void *a, void *b ) ++vips_foreign_load_start(VipsImage *out, void *a, void *b) + { +- VipsForeignLoad *load = VIPS_FOREIGN_LOAD( b ); +- VipsForeignLoadClass *class = VIPS_FOREIGN_LOAD_GET_CLASS( load ); ++ VipsForeignLoad *load = VIPS_FOREIGN_LOAD(b); ++ VipsForeignLoadClass *class = VIPS_FOREIGN_LOAD_GET_CLASS(load); + + /* If this start has failed before in another thread, we can fail now. + */ +- if( load->error ) +- return( NULL ); ++ if (load->error) ++ return (NULL); + +- if( !load->real ) { +- if( !(load->real = vips_foreign_load_temp( load )) ) +- return( NULL ); ++ if (!load->real) { ++ if (!(load->real = vips_foreign_load_temp(load))) ++ return (NULL); + + #ifdef DEBUG +- printf( "vips_foreign_load_start: triggering ->load()\n" ); ++ printf("vips_foreign_load_start: triggering ->load()\n"); + #endif /*DEBUG*/ + + /* Read the image in. This may involve a long computation and +- * will finish with load->real holding the decompressed image. ++ * will finish with load->real holding the decompressed image. + * + * We want our caller to be able to see this computation on + * @out, so eval signals on ->real need to appear on ->out. + */ + load->real->progress_signal = load->out; + +- /* Note the load object on the image. Loaders can use ++ /* Note the load object on the image. Loaders can use + * this to signal invalidate if they hit a load error. See + * vips_foreign_load_invalidate() below. + */ +- g_object_set_qdata( G_OBJECT( load->real ), +- vips__foreign_load_operation, load ); ++ g_object_set_qdata(G_OBJECT(load->real), ++ vips__foreign_load_operation, load); + + /* Load the image and check the result. + * + * ->header() read the header into @out, load will read the + * image into @real. They must match exactly in size, bands, +- * format and coding for the copy to work. ++ * format and coding for the copy to work. + * + * Some versions of ImageMagick give different results between + * Ping and Load for some formats, for example. + * + * If the load fails, we need to stop + */ +- if( class->load( load ) || +- vips_image_pio_input( load->real ) || +- !vips_foreign_load_iscompat( load->real, out ) ) { +- vips_operation_invalidate( VIPS_OPERATION( load ) ); ++ if (class->load(load) || ++ vips_image_pio_input(load->real) || ++ !vips_foreign_load_iscompat(load->real, out)) { ++ vips_operation_invalidate(VIPS_OPERATION(load)); + load->error = TRUE; + +- return( NULL ); ++ return (NULL); + } + + /* We have to tell vips that out depends on real. We've set + * the demand hint below, but not given an input there. + */ +- if( vips_image_pipelinev( load->out, load->out->dhint, +- load->real, NULL ) ) +- return( NULL ); ++ if (vips_image_pipelinev(load->out, load->out->dhint, ++ load->real, NULL)) ++ return (NULL); + } + +- return( vips_region_new( load->real ) ); ++ return (vips_region_new(load->real)); + } + + /* Just pointer-copy. + */ + static int +-vips_foreign_load_generate( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_foreign_load_generate(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + +- /* Ask for input we need. +- */ +- if( vips_region_prepare( ir, r ) ) +- return( -1 ); ++ /* Ask for input we need. ++ */ ++ if (vips_region_prepare(ir, r)) ++ return (-1); + +- /* Attach output region to that. +- */ +- if( vips_region_region( or, ir, r, r->left, r->top ) ) +- return( -1 ); ++ /* Attach output region to that. ++ */ ++ if (vips_region_region(or, ir, r, r->left, r->top)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_build( VipsObject *object ) ++vips_foreign_load_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsForeignLoad *load = VIPS_FOREIGN_LOAD( object ); +- VipsForeignLoadClass *fclass = VIPS_FOREIGN_LOAD_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsForeignLoad *load = VIPS_FOREIGN_LOAD(object); ++ VipsForeignLoadClass *fclass = VIPS_FOREIGN_LOAD_GET_CLASS(object); + + VipsForeignFlags flags; + + #ifdef DEBUG +- printf( "vips_foreign_load_build:\n" ); ++ printf("vips_foreign_load_build:\n"); + #endif /*DEBUG*/ + + flags = 0; +- if( fclass->get_flags ) +- flags |= fclass->get_flags( load ); +- +- if( (flags & VIPS_FOREIGN_PARTIAL) && +- (flags & VIPS_FOREIGN_SEQUENTIAL) ) { +- g_warning( "%s", +- _( "VIPS_FOREIGN_PARTIAL and VIPS_FOREIGN_SEQUENTIAL " +- "both set -- using SEQUENTIAL" ) ); ++ if (fclass->get_flags) ++ flags |= fclass->get_flags(load); ++ ++ if ((flags & VIPS_FOREIGN_PARTIAL) && ++ (flags & VIPS_FOREIGN_SEQUENTIAL)) { ++ g_warning("%s", ++ _("VIPS_FOREIGN_PARTIAL and VIPS_FOREIGN_SEQUENTIAL " ++ "both set -- using SEQUENTIAL")); + flags ^= VIPS_FOREIGN_PARTIAL; + } + +- g_object_set( load, "flags", flags, NULL ); ++ g_object_set(load, "flags", flags, NULL); + + /* We must block caching of seq loaders running in seq mode. A seq + * loader in random mode is fine, since we'll read to ram or a temp + * file. + */ +- if( (load->flags & VIPS_FOREIGN_SEQUENTIAL) && +- load->access != VIPS_ACCESS_RANDOM ) ++ if ((load->flags & VIPS_FOREIGN_SEQUENTIAL) && ++ load->access != VIPS_ACCESS_RANDOM) + load->nocache = TRUE; + + /* The deprecated "fail" field sets fail_on warning. + */ +- if( vips_object_argument_isset( object, "fail" ) && +- !vips_object_argument_isset( object, "fail_on" ) ) +- load->fail_on = load->fail ? +- VIPS_FAIL_ON_WARNING : VIPS_FAIL_ON_NONE; ++ if (vips_object_argument_isset(object, "fail") && ++ !vips_object_argument_isset(object, "fail_on")) ++ load->fail_on = load->fail ? VIPS_FAIL_ON_WARNING : VIPS_FAIL_ON_NONE; + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_parent_class)->build(object)) ++ return (-1); + +- if( load->sequential ) +- g_warning( "%s", +- _( "ignoring deprecated \"sequential\" mode -- " +- "please use \"access\" instead" ) ); ++ if (load->sequential) ++ g_warning("%s", ++ _("ignoring deprecated \"sequential\" mode -- " ++ "please use \"access\" instead")); + +- g_object_set( object, "out", vips_image_new(), NULL ); ++ g_object_set(object, "out", vips_image_new(), NULL); + +- vips_image_set_string( load->out, +- VIPS_META_LOADER, class->nickname ); ++ vips_image_set_string(load->out, ++ VIPS_META_LOADER, class->nickname); + + #ifdef DEBUG +- printf( "vips_foreign_load_build: triggering ->header()\n" ); ++ printf("vips_foreign_load_build: triggering ->header()\n"); + #endif /*DEBUG*/ + + /* Read the header into @out. + */ +- if( fclass->header && +- fclass->header( load ) ) +- return( -1 ); ++ if (fclass->header && ++ fclass->header(load)) ++ return (-1); + + /* If there's no ->load() method then the header read has done + * everything. Otherwise, it's just set fields and we must also +@@ -1109,55 +1104,54 @@ vips_foreign_load_build( VipsObject *object ) + * Delay the load until the first pixel is requested by doing the work + * in the start function of the copy. + */ +- if( fclass->load ) { ++ if (fclass->load) { + #ifdef DEBUG +- printf( "vips_foreign_load_build: delaying read ...\n" ); ++ printf("vips_foreign_load_build: delaying read ...\n"); + #endif /*DEBUG*/ + + /* ->header() should set the dhint. It'll default to the safe + * SMALLTILE if header() did not set it. + */ +- if( vips_image_pipelinev( load->out, load->out->dhint, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(load->out, load->out->dhint, NULL)) ++ return (-1); + +- /* Then 'start' creates the real image and 'gen' fetches ++ /* Then 'start' creates the real image and 'gen' fetches + * pixels for @out from @real on demand. + */ +- if( vips_image_generate( load->out, +- vips_foreign_load_start, +- vips_foreign_load_generate, +- vips_stop_one, +- NULL, load ) ) +- return( -1 ); ++ if (vips_image_generate(load->out, ++ vips_foreign_load_start, ++ vips_foreign_load_generate, ++ vips_stop_one, ++ NULL, load)) ++ return (-1); + } + + /* Tell downstream if seq mode was requested. + */ +- if( load->access != VIPS_ACCESS_RANDOM ) +- vips_image_set_int( load->out, VIPS_META_SEQUENTIAL, 1 ); ++ if (load->access != VIPS_ACCESS_RANDOM) ++ vips_image_set_int(load->out, VIPS_META_SEQUENTIAL, 1); + +- return( 0 ); ++ return (0); + } + +-static VipsOperationFlags +-vips_foreign_load_operation_get_flags( VipsOperation *operation ) ++static VipsOperationFlags ++vips_foreign_load_operation_get_flags(VipsOperation *operation) + { +- VipsForeignLoad *load = VIPS_FOREIGN_LOAD( operation ); ++ VipsForeignLoad *load = VIPS_FOREIGN_LOAD(operation); + + VipsOperationFlags flags; + +- flags = VIPS_OPERATION_CLASS( vips_foreign_load_parent_class )-> +- get_flags( operation ); +- if( load->nocache ) ++ flags = VIPS_OPERATION_CLASS(vips_foreign_load_parent_class)->get_flags(operation); ++ if (load->nocache) + flags |= VIPS_OPERATION_NOCACHE; + +- return( flags ); ++ return (flags); + } + + static void +-vips_foreign_load_class_init( VipsForeignLoadClass *class ) ++vips_foreign_load_class_init(VipsForeignLoadClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsOperationClass *operation_class = (VipsOperationClass *) class; + +@@ -1169,69 +1163,68 @@ vips_foreign_load_class_init( VipsForeignLoadClass *class ) + object_class->summary_class = vips_foreign_load_summary_class; + object_class->new_from_string = vips_foreign_load_new_from_string; + object_class->nickname = "load"; +- object_class->description = _( "loaders" ); ++ object_class->description = _("loaders"); + + operation_class->get_flags = vips_foreign_load_operation_get_flags; + +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsForeignLoad, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsForeignLoad, out)); + +- VIPS_ARG_FLAGS( class, "flags", 106, +- _( "Flags" ), +- _( "Flags for this file" ), ++ VIPS_ARG_FLAGS(class, "flags", 106, ++ _("Flags"), ++ _("Flags for this file"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsForeignLoad, flags ), +- VIPS_TYPE_FOREIGN_FLAGS, VIPS_FOREIGN_NONE ); ++ G_STRUCT_OFFSET(VipsForeignLoad, flags), ++ VIPS_TYPE_FOREIGN_FLAGS, VIPS_FOREIGN_NONE); + +- VIPS_ARG_BOOL( class, "memory", 107, +- _( "Memory" ), +- _( "Force open via memory" ), ++ VIPS_ARG_BOOL(class, "memory", 107, ++ _("Memory"), ++ _("Force open via memory"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoad, memory ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignLoad, memory), ++ FALSE); + +- VIPS_ARG_ENUM( class, "access", 108, +- _( "Access" ), +- _( "Required access pattern for this file" ), ++ VIPS_ARG_ENUM(class, "access", 108, ++ _("Access"), ++ _("Required access pattern for this file"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoad, access ), +- VIPS_TYPE_ACCESS, VIPS_ACCESS_RANDOM ); ++ G_STRUCT_OFFSET(VipsForeignLoad, access), ++ VIPS_TYPE_ACCESS, VIPS_ACCESS_RANDOM); + +- VIPS_ARG_ENUM( class, "fail_on", 109, +- _( "Fail on" ), +- _( "Error level to fail on" ), ++ VIPS_ARG_ENUM(class, "fail_on", 109, ++ _("Fail on"), ++ _("Error level to fail on"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoad, fail_on ), +- VIPS_TYPE_FAIL_ON, VIPS_FAIL_ON_NONE ); ++ G_STRUCT_OFFSET(VipsForeignLoad, fail_on), ++ VIPS_TYPE_FAIL_ON, VIPS_FAIL_ON_NONE); + +- VIPS_ARG_BOOL( class, "sequential", 110, +- _( "Sequential" ), +- _( "Sequential read only" ), ++ VIPS_ARG_BOOL(class, "sequential", 110, ++ _("Sequential"), ++ _("Sequential read only"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignLoad, sequential ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignLoad, sequential), ++ FALSE); + +- VIPS_ARG_BOOL( class, "fail", 111, +- _( "Fail" ), +- _( "Fail on first warning" ), ++ VIPS_ARG_BOOL(class, "fail", 111, ++ _("Fail"), ++ _("Fail on first warning"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignLoad, fail ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignLoad, fail), ++ FALSE); + +- VIPS_ARG_BOOL( class, "disc", 112, +- _( "Disc" ), +- _( "Open to disc" ), ++ VIPS_ARG_BOOL(class, "disc", 112, ++ _("Disc"), ++ _("Open to disc"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignLoad, disc ), +- TRUE ); +- ++ G_STRUCT_OFFSET(VipsForeignLoad, disc), ++ TRUE); + } + + static void +-vips_foreign_load_init( VipsForeignLoad *load ) ++vips_foreign_load_init(VipsForeignLoad *load) + { + load->disc = TRUE; + load->access = VIPS_ACCESS_RANDOM; +@@ -1248,103 +1241,102 @@ vips_foreign_load_init( VipsForeignLoad *load ) + * + * Loaders can call this on the image they are making if they see a read error + * from the load library. It signals "invalidate" on the load operation and +- * will cause it to be dropped from cache. ++ * will cause it to be dropped from cache. + * + * If we know a file will cause a read error, we don't want to cache the +- * failing operation, we want to make sure the image will really be opened +- * again if our caller tries again. For example, a broken file might be +- * replaced by a working one. ++ * failing operation, we want to make sure the image will really be opened ++ * again if our caller tries again. For example, a broken file might be ++ * replaced by a working one. + */ + void +-vips_foreign_load_invalidate( VipsImage *image ) ++vips_foreign_load_invalidate(VipsImage *image) + { +- VipsOperation *operation; ++ VipsOperation *operation; + + #ifdef DEBUG +- printf( "vips_foreign_load_invalidate: %p\n", image ); ++ printf("vips_foreign_load_invalidate: %p\n", image); + #endif /*DEBUG*/ + +- if( (operation = g_object_get_qdata( G_OBJECT( image ), +- vips__foreign_load_operation )) ) { +- vips_operation_invalidate( operation ); ++ if ((operation = g_object_get_qdata(G_OBJECT(image), ++ vips__foreign_load_operation))) { ++ vips_operation_invalidate(operation); + } + } + + /* Abstract base class for image savers. + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSave, vips_foreign_save, VIPS_TYPE_FOREIGN ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSave, vips_foreign_save, VIPS_TYPE_FOREIGN); + + static void +-vips_foreign_save_dispose( GObject *gobject ) ++vips_foreign_save_dispose(GObject *gobject) + { +- VipsForeignSave *save = VIPS_FOREIGN_SAVE( gobject ); ++ VipsForeignSave *save = VIPS_FOREIGN_SAVE(gobject); + +- VIPS_UNREF( save->ready ); ++ VIPS_UNREF(save->ready); + +- G_OBJECT_CLASS( vips_foreign_save_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_parent_class)->dispose(gobject); + } + + static void +-vips_foreign_save_summary_class( VipsObjectClass *object_class, VipsBuf *buf ) ++vips_foreign_save_summary_class(VipsObjectClass *object_class, VipsBuf *buf) + { +- VipsForeignSaveClass *class = VIPS_FOREIGN_SAVE_CLASS( object_class ); ++ VipsForeignSaveClass *class = VIPS_FOREIGN_SAVE_CLASS(object_class); + +- VIPS_OBJECT_CLASS( vips_foreign_save_parent_class )-> +- summary_class( object_class, buf ); ++ VIPS_OBJECT_CLASS(vips_foreign_save_parent_class)->summary_class(object_class, buf); + +- vips_buf_appendf( buf, ", %s", +- vips_enum_nick( VIPS_TYPE_SAVEABLE, class->saveable ) ); ++ vips_buf_appendf(buf, ", %s", ++ vips_enum_nick(VIPS_TYPE_SAVEABLE, class->saveable)); + } + + static VipsObject * +-vips_foreign_save_new_from_string( const char *string ) ++vips_foreign_save_new_from_string(const char *string) + { + const char *file_op; + GType type; + VipsForeignSave *save; + +- if( !(file_op = vips_foreign_find_save( string )) ) +- return( NULL ); +- type = g_type_from_name( file_op ); +- g_assert( type ); ++ if (!(file_op = vips_foreign_find_save(string))) ++ return (NULL); ++ type = g_type_from_name(file_op); ++ g_assert(type); + +- save = VIPS_FOREIGN_SAVE( g_object_new( type, NULL ) ); +- g_object_set( save, ++ save = VIPS_FOREIGN_SAVE(g_object_new(type, NULL)); ++ g_object_set(save, + "filename", string, +- NULL ); ++ NULL); + +- return( VIPS_OBJECT( save ) ); ++ return (VIPS_OBJECT(save)); + } + +-/* Convert an image for saving. ++/* Convert an image for saving. + */ + int +-vips__foreign_convert_saveable( VipsImage *in, VipsImage **ready, ++vips__foreign_convert_saveable(VipsImage *in, VipsImage **ready, + VipsSaveable saveable, VipsBandFormat *format, VipsCoding *coding, +- VipsArrayDouble *background ) ++ VipsArrayDouble *background) + { + /* in holds a reference to the output of our chain as we build it. + */ +- g_object_ref( in ); ++ g_object_ref(in); + +- /* For coded images, can this class save the coding we are in now? ++ /* For coded images, can this class save the coding we are in now? + * Nothing to do. + */ +- if( in->Coding != VIPS_CODING_NONE && +- coding[in->Coding] ) { ++ if (in->Coding != VIPS_CODING_NONE && ++ coding[in->Coding]) { + *ready = in; +- return( 0 ); ++ return (0); + } + +- /* For uncoded images, if this saver supports ANY bands and this ++ /* For uncoded images, if this saver supports ANY bands and this + * format we have nothing to do. + */ +- if( in->Coding == VIPS_CODING_NONE && +- saveable == VIPS_SAVEABLE_ANY && +- format[in->BandFmt] == in->BandFmt ) { ++ if (in->Coding == VIPS_CODING_NONE && ++ saveable == VIPS_SAVEABLE_ANY && ++ format[in->BandFmt] == in->BandFmt) { + *ready = in; +- return( 0 ); ++ return (0); + } + + /* Otherwise ... we need to decode and then (possibly) recode at the +@@ -1353,158 +1345,158 @@ vips__foreign_convert_saveable( VipsImage *in, VipsImage **ready, + + /* If this is an VIPS_CODING_LABQ, we can go straight to RGB. + */ +- if( in->Coding == VIPS_CODING_LABQ ) { ++ if (in->Coding == VIPS_CODING_LABQ) { + VipsImage *out; + +- if( vips_LabQ2sRGB( in, &out, NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_LabQ2sRGB(in, &out, NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + } + + /* If this is an VIPS_CODING_RAD, we unpack to float. This could be +- * scRGB or XYZ. ++ * scRGB or XYZ. + */ +- if( in->Coding == VIPS_CODING_RAD ) { ++ if (in->Coding == VIPS_CODING_RAD) { + VipsImage *out; + +- if( vips_rad2float( in, &out, NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_rad2float(in, &out, NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + } + +- /* If the saver supports RAD, we need to go to scRGB or XYZ. ++ /* If the saver supports RAD, we need to go to scRGB or XYZ. + */ +- if( coding[VIPS_CODING_RAD] ) { +- if( in->Type != VIPS_INTERPRETATION_scRGB && +- in->Type != VIPS_INTERPRETATION_XYZ ) { ++ if (coding[VIPS_CODING_RAD]) { ++ if (in->Type != VIPS_INTERPRETATION_scRGB && ++ in->Type != VIPS_INTERPRETATION_XYZ) { + VipsImage *out; + +- if( vips_colourspace( in, &out, +- VIPS_INTERPRETATION_scRGB, NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_colourspace(in, &out, ++ VIPS_INTERPRETATION_scRGB, NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + } + } + + /* If this image is CMYK and the saver is RGB-only, use lcms to try to +- * import to XYZ. ++ * import to XYZ. + */ +- if( in->Type == VIPS_INTERPRETATION_CMYK && ++ if (in->Type == VIPS_INTERPRETATION_CMYK && + in->Bands >= 4 && + (saveable == VIPS_SAVEABLE_RGB || +- saveable == VIPS_SAVEABLE_RGBA || +- saveable == VIPS_SAVEABLE_RGBA_ONLY) ) { ++ saveable == VIPS_SAVEABLE_RGBA || ++ saveable == VIPS_SAVEABLE_RGBA_ONLY)) { + VipsImage *out; + +- if( vips_icc_import( in, &out, +- "pcs", VIPS_PCS_XYZ, +- "embedded", TRUE, +- "input_profile", "cmyk", +- NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_icc_import(in, &out, ++ "pcs", VIPS_PCS_XYZ, ++ "embedded", TRUE, ++ "input_profile", "cmyk", ++ NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + } + + /* If this is something other than CMYK or RAD, and it's not already +- * an RGB image, eg. maybe a LAB image, we need to transform ++ * an RGB image, eg. maybe a LAB image, we need to transform + * to RGB. + */ +- if( !coding[VIPS_CODING_RAD] && ++ if (!coding[VIPS_CODING_RAD] && + in->Bands >= 3 && + in->Type != VIPS_INTERPRETATION_CMYK && + in->Type != VIPS_INTERPRETATION_sRGB && + in->Type != VIPS_INTERPRETATION_RGB16 && + in->Type != VIPS_INTERPRETATION_scRGB && +- vips_colourspace_issupported( in ) && ++ vips_colourspace_issupported(in) && + (saveable == VIPS_SAVEABLE_RGB || +- saveable == VIPS_SAVEABLE_RGBA || +- saveable == VIPS_SAVEABLE_RGBA_ONLY || +- saveable == VIPS_SAVEABLE_RGB_CMYK) ) { ++ saveable == VIPS_SAVEABLE_RGBA || ++ saveable == VIPS_SAVEABLE_RGBA_ONLY || ++ saveable == VIPS_SAVEABLE_RGB_CMYK)) { + VipsImage *out; + VipsInterpretation interpretation; + + /* Do we make RGB or RGB16? We don't want to squash a 16-bit +- * RGB down to 8 bits if the saver supports 16. ++ * RGB down to 8 bits if the saver supports 16. + */ +- if( vips_band_format_is8bit( format[in->BandFmt] ) ) ++ if (vips_band_format_is8bit(format[in->BandFmt])) + interpretation = VIPS_INTERPRETATION_sRGB; + else + interpretation = VIPS_INTERPRETATION_RGB16; + +- if( vips_colourspace( in, &out, interpretation, NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_colourspace(in, &out, interpretation, NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + } + +- /* VIPS_SAVEABLE_RGBA_ONLY does not support mono types ... convert +- * to sRGB. ++ /* VIPS_SAVEABLE_RGBA_ONLY does not support mono types ... convert ++ * to sRGB. + */ +- if( !coding[VIPS_CODING_RAD] && ++ if (!coding[VIPS_CODING_RAD] && + in->Bands < 3 && +- saveable == VIPS_SAVEABLE_RGBA_ONLY ) { ++ saveable == VIPS_SAVEABLE_RGBA_ONLY) { + VipsImage *out; + VipsInterpretation interpretation; + + /* Do we make RGB or RGB16? We don't want to squash a 16-bit +- * RGB down to 8 bits if the saver supports 16. ++ * RGB down to 8 bits if the saver supports 16. + */ +- if( vips_band_format_is8bit( format[in->BandFmt] ) ) ++ if (vips_band_format_is8bit(format[in->BandFmt])) + interpretation = VIPS_INTERPRETATION_sRGB; + else + interpretation = VIPS_INTERPRETATION_RGB16; + +- if( vips_colourspace( in, &out, interpretation, NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_colourspace(in, &out, interpretation, NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + } + + /* Get the bands right. We must do this after all colourspace +- * transforms, since they can change the number of bands. ++ * transforms, since they can change the number of bands. + */ +- if( in->Coding == VIPS_CODING_NONE ) { ++ if (in->Coding == VIPS_CODING_NONE) { + /* Do we need to flatten out an alpha channel? There needs to + * be an alpha there now, and this writer needs to not support + * alpha. + */ +- if( (in->Bands == 2 || +- (in->Bands == 4 && +- in->Type != VIPS_INTERPRETATION_CMYK)) && ++ if ((in->Bands == 2 || ++ (in->Bands == 4 && ++ in->Type != VIPS_INTERPRETATION_CMYK)) && + (saveable == VIPS_SAVEABLE_MONO || +- saveable == VIPS_SAVEABLE_RGB || +- saveable == VIPS_SAVEABLE_RGB_CMYK) ) { ++ saveable == VIPS_SAVEABLE_RGB || ++ saveable == VIPS_SAVEABLE_RGB_CMYK)) { + VipsImage *out; + +- if( vips_flatten( in, &out, +- "background", background, +- NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_flatten(in, &out, ++ "background", background, ++ NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + } +@@ -1513,10 +1505,10 @@ vips__foreign_convert_saveable( VipsImage *in, VipsImage **ready, + * bands. + */ + +- else if( in->Bands > 3 && ++ else if (in->Bands > 3 && + (saveable == VIPS_SAVEABLE_RGB || +- (saveable == VIPS_SAVEABLE_RGB_CMYK && +- in->Type != VIPS_INTERPRETATION_CMYK)) ) { ++ (saveable == VIPS_SAVEABLE_RGB_CMYK && ++ in->Type != VIPS_INTERPRETATION_CMYK))) { + VipsImage *out; + + /* Don't let 4 bands though unless the image really is +@@ -1526,42 +1518,42 @@ vips__foreign_convert_saveable( VipsImage *in, VipsImage **ready, + * write CMYK jpg, but we mustn't do that for RGBA + * images. + */ +- if( vips_extract_band( in, &out, 0, +- "n", 3, +- NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_extract_band(in, &out, 0, ++ "n", 3, ++ NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + } +- else if( in->Bands > 4 && ++ else if (in->Bands > 4 && + ((saveable == VIPS_SAVEABLE_RGB_CMYK && +- in->Type == VIPS_INTERPRETATION_CMYK) || +- saveable == VIPS_SAVEABLE_RGBA || +- saveable == VIPS_SAVEABLE_RGBA_ONLY) ) { ++ in->Type == VIPS_INTERPRETATION_CMYK) || ++ saveable == VIPS_SAVEABLE_RGBA || ++ saveable == VIPS_SAVEABLE_RGBA_ONLY)) { + VipsImage *out; + +- if( vips_extract_band( in, &out, 0, +- "n", 4, +- NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_extract_band(in, &out, 0, ++ "n", 4, ++ NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + } +- else if( in->Bands > 1 && +- saveable == VIPS_SAVEABLE_MONO ) { ++ else if (in->Bands > 1 && ++ saveable == VIPS_SAVEABLE_MONO) { + VipsImage *out; + +- if( vips_extract_band( in, &out, 0, NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_extract_band(in, &out, 0, NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + } +@@ -1577,9 +1569,9 @@ vips__foreign_convert_saveable( VipsImage *in, VipsImage **ready, + * images tagged as RGB16 alone), we'll need to get it ready for the + * saver. + */ +- if( (in->Type == VIPS_INTERPRETATION_RGB16 || +- in->Type == VIPS_INTERPRETATION_GREY16) && +- !vips_band_format_is8bit( in->BandFmt ) ) { ++ if ((in->Type == VIPS_INTERPRETATION_RGB16 || ++ in->Type == VIPS_INTERPRETATION_GREY16) && ++ !vips_band_format_is8bit(in->BandFmt)) { + /* If the saver supports ushort, cast to ushort. It may be + * float at the moment, for example. + * +@@ -1587,36 +1579,36 @@ vips__foreign_convert_saveable( VipsImage *in, VipsImage **ready, + * it down. This is the behaviour we want for saving an RGB16 + * image as JPG, for example. + */ +- if( format[VIPS_FORMAT_USHORT] == VIPS_FORMAT_USHORT ) { ++ if (format[VIPS_FORMAT_USHORT] == VIPS_FORMAT_USHORT) { + VipsImage *out; + +- if( vips_cast( in, &out, VIPS_FORMAT_USHORT, NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_cast(in, &out, VIPS_FORMAT_USHORT, NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + } + else { + VipsImage *out; + +- if( vips_rshift_const1( in, &out, 8, NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_rshift_const1(in, &out, 8, NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + +- /* That could have produced an int image ... make sure ++ /* That could have produced an int image ... make sure + * we are now uchar. + */ +- if( vips_cast( in, &out, VIPS_FORMAT_UCHAR, NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_cast(in, &out, VIPS_FORMAT_UCHAR, NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + } +@@ -1627,11 +1619,11 @@ vips__foreign_convert_saveable( VipsImage *in, VipsImage **ready, + { + VipsImage *out; + +- if( vips_cast( in, &out, format[in->BandFmt], NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_cast(in, &out, format[in->BandFmt], NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + } +@@ -1639,102 +1631,101 @@ vips__foreign_convert_saveable( VipsImage *in, VipsImage **ready, + /* Does this class want a coded image? Search the coding table for the + * first one. + */ +- if( coding[VIPS_CODING_NONE] ) { ++ if (coding[VIPS_CODING_NONE]) { + /* Already NONE, nothing to do. + */ + } +- else if( coding[VIPS_CODING_LABQ] ) { ++ else if (coding[VIPS_CODING_LABQ]) { + VipsImage *out; + +- if( vips_Lab2LabQ( in, &out, NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_Lab2LabQ(in, &out, NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + } +- else if( coding[VIPS_CODING_RAD] ) { ++ else if (coding[VIPS_CODING_RAD]) { + VipsImage *out; + +- if( vips_float2rad( in, &out, NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_float2rad(in, &out, NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + } + +- /* Some format libraries, like libpng, will throw a hard error if the ++ /* Some format libraries, like libpng, will throw a hard error if the + * profile is inappropriate for this image type. With profiles inherited +- * from a source image, this can happen all the time, so we ++ * from a source image, this can happen all the time, so we + * want to silently drop the profile in this case. + */ +- if( vips_image_get_typeof( in, VIPS_META_ICC_NAME ) ) { ++ if (vips_image_get_typeof(in, VIPS_META_ICC_NAME)) { + const void *data; + size_t length; + +- if( !vips_image_get_blob( in, VIPS_META_ICC_NAME, +- &data, &length ) && +- !vips_icc_is_compatible_profile( in, data, length ) ) { ++ if (!vips_image_get_blob(in, VIPS_META_ICC_NAME, ++ &data, &length) && ++ !vips_icc_is_compatible_profile(in, data, length)) { + VipsImage *out; + +- if( vips_copy( in, &out, NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_copy(in, &out, NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + + in = out; + +- vips_image_remove( in, VIPS_META_ICC_NAME ); ++ vips_image_remove(in, VIPS_META_ICC_NAME); + } + } + + *ready = in; + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_build( VipsObject *object ) ++vips_foreign_save_build(VipsObject *object) + { +- VipsForeignSave *save = VIPS_FOREIGN_SAVE( object ); ++ VipsForeignSave *save = VIPS_FOREIGN_SAVE(object); + +- if( save->in ) { +- VipsForeignSaveClass *class = +- VIPS_FOREIGN_SAVE_GET_CLASS( save ); ++ if (save->in) { ++ VipsForeignSaveClass *class = ++ VIPS_FOREIGN_SAVE_GET_CLASS(save); + VipsImage *ready; + +- if( vips__foreign_convert_saveable( save->in, &ready, +- class->saveable, class->format_table, class->coding, +- save->background ) ) +- return( -1 ); ++ if (vips__foreign_convert_saveable(save->in, &ready, ++ class->saveable, class->format_table, class->coding, ++ save->background)) ++ return (-1); + +- if( save->page_height ) { ++ if (save->page_height) { + VipsImage *x; + +- if( vips_copy( ready, &x, NULL ) ) { +- VIPS_UNREF( ready ); +- return( -1 ); ++ if (vips_copy(ready, &x, NULL)) { ++ VIPS_UNREF(ready); ++ return (-1); + } +- VIPS_UNREF( ready ); ++ VIPS_UNREF(ready); + ready = x; + +- vips_image_set_int( ready, +- VIPS_META_PAGE_HEIGHT, save->page_height ); ++ vips_image_set_int(ready, ++ VIPS_META_PAGE_HEIGHT, save->page_height); + } + +- VIPS_UNREF( save->ready ); ++ VIPS_UNREF(save->ready); + save->ready = ready; + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + #define UC VIPS_FORMAT_UCHAR +@@ -1754,9 +1745,9 @@ static VipsBandFormat vips_foreign_save_format_table[10] = { + }; + + static void +-vips_foreign_save_class_init( VipsForeignSaveClass *class ) ++vips_foreign_save_class_init(VipsForeignSaveClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsOperationClass *operation_class = (VipsOperationClass *) class; + +@@ -1770,11 +1761,11 @@ vips_foreign_save_class_init( VipsForeignSaveClass *class ) + object_class->summary_class = vips_foreign_save_summary_class; + object_class->new_from_string = vips_foreign_save_new_from_string; + object_class->nickname = "save"; +- object_class->description = _( "savers" ); ++ object_class->description = _("savers"); + +- /* All savers are sequential by definition. Things like tiled tiff +- * write and interlaced png write, which are not, add extra caches +- * on their input. ++ /* All savers are sequential by definition. Things like tiled tiff ++ * write and interlaced png write, which are not, add extra caches ++ * on their input. + */ + operation_class->flags |= VIPS_OPERATION_SEQUENTIAL; + +@@ -1784,80 +1775,79 @@ vips_foreign_save_class_init( VipsForeignSaveClass *class ) + + /* Default to no coding allowed. + */ +- for( i = 0; i < VIPS_CODING_LAST; i++ ) ++ for (i = 0; i < VIPS_CODING_LAST; i++) + class->coding[i] = FALSE; + class->coding[VIPS_CODING_NONE] = TRUE; + + /* Default to no cast on save. + */ +- class->format_table = vips_foreign_save_format_table; ++ class->format_table = vips_foreign_save_format_table; + +- VIPS_ARG_IMAGE( class, "in", 0, +- _( "Input" ), +- _( "Image to save" ), ++ VIPS_ARG_IMAGE(class, "in", 0, ++ _("Input"), ++ _("Image to save"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSave, in ) ); ++ G_STRUCT_OFFSET(VipsForeignSave, in)); + +- VIPS_ARG_BOOL( class, "strip", 100, +- _( "Strip" ), +- _( "Strip all metadata from image" ), ++ VIPS_ARG_BOOL(class, "strip", 100, ++ _("Strip"), ++ _("Strip all metadata from image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSave, strip ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSave, strip), ++ FALSE); + +- VIPS_ARG_BOXED( class, "background", 101, +- _( "Background" ), +- _( "Background value" ), ++ VIPS_ARG_BOXED(class, "background", 101, ++ _("Background"), ++ _("Background value"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSave, background ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsForeignSave, background), ++ VIPS_TYPE_ARRAY_DOUBLE); + +- VIPS_ARG_INT( class, "page_height", 102, +- _( "Page height" ), +- _( "Set page height for multipage save" ), ++ VIPS_ARG_INT(class, "page_height", 102, ++ _("Page height"), ++ _("Set page height for multipage save"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSave, page_height ), +- 0, VIPS_MAX_COORD, 0 ); +- ++ G_STRUCT_OFFSET(VipsForeignSave, page_height), ++ 0, VIPS_MAX_COORD, 0); + } + + static void +-vips_foreign_save_init( VipsForeignSave *save ) ++vips_foreign_save_init(VipsForeignSave *save) + { +- save->background = vips_array_double_newv( 1, 0.0 ); ++ save->background = vips_array_double_newv(1, 0.0); + } + +-/* Can we write this filename with this class? ++/* Can we write this filename with this class? + */ + static void * +-vips_foreign_find_save_sub( VipsForeignSaveClass *save_class, +- const char *filename, void *b ) ++vips_foreign_find_save_sub(VipsForeignSaveClass *save_class, ++ const char *filename, void *b) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( save_class ); +- VipsForeignClass *class = VIPS_FOREIGN_CLASS( save_class ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(save_class); ++ VipsForeignClass *class = VIPS_FOREIGN_CLASS(save_class); + + const char **p; + +- /* All savers needs suffs defined since we use the suff to pick the ++ /* All savers needs suffs defined since we use the suff to pick the + * saver. + */ +- if( !class->suffs ) +- g_warning( "no suffix defined for %s", object_class->nickname ); ++ if (!class->suffs) ++ g_warning("no suffix defined for %s", object_class->nickname); + + /* Skip non-file savers. + */ +- if( vips_ispostfix( object_class->nickname, "_buffer" ) || +- vips_ispostfix( object_class->nickname, "_target" ) ) +- return( NULL ); ++ if (vips_ispostfix(object_class->nickname, "_buffer") || ++ vips_ispostfix(object_class->nickname, "_target")) ++ return (NULL); + + /* vips_foreign_find_save() has already removed any options from the + * end of the filename, so we can test directly against the suffix. + */ +- for( p = class->suffs; *p; p++ ) +- if( vips_iscasepostfix( filename, *p ) ) +- return( save_class ); ++ for (p = class->suffs; *p; p++) ++ if (vips_iscasepostfix(filename, *p)) ++ return (save_class); + +- return( NULL ); ++ return (NULL); + } + + /** +@@ -1865,111 +1855,111 @@ vips_foreign_find_save_sub( VipsForeignSaveClass *save_class, + * @filename: name to find a saver for + * + * Searches for an operation you could use to write to @filename. +- * Any trailing options on @filename are stripped and ignored. ++ * Any trailing options on @filename are stripped and ignored. + * + * See also: vips_foreign_find_save_buffer(), vips_image_write_to_file(). + * + * Returns: (nullable): the name of an operation on success, %NULL on error + */ + const char * +-vips_foreign_find_save( const char *name ) ++vips_foreign_find_save(const char *name) + { + char filename[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; + VipsForeignSaveClass *save_class; + +- vips__filename_split8( name, filename, option_string ); ++ vips__filename_split8(name, filename, option_string); + +- if( !(save_class = (VipsForeignSaveClass *) vips_foreign_map( +- "VipsForeignSave", +- (VipsSListMap2Fn) vips_foreign_find_save_sub, +- (void *) filename, NULL )) ) { +- vips_error( "VipsForeignSave", +- _( "\"%s\" is not a known file format" ), name ); ++ if (!(save_class = (VipsForeignSaveClass *) vips_foreign_map( ++ "VipsForeignSave", ++ (VipsSListMap2Fn) vips_foreign_find_save_sub, ++ (void *) filename, NULL))) { ++ vips_error("VipsForeignSave", ++ _("\"%s\" is not a known file format"), name); + +- return( NULL ); ++ return (NULL); + } + +- return( G_OBJECT_CLASS_NAME( save_class ) ); ++ return (G_OBJECT_CLASS_NAME(save_class)); + } + + static void * +-vips_foreign_get_suffixes_count_cb( VipsForeignSaveClass *save_class, +- void *a, void *b ) ++vips_foreign_get_suffixes_count_cb(VipsForeignSaveClass *save_class, ++ void *a, void *b) + { +- VipsForeignClass *foreign_class = VIPS_FOREIGN_CLASS( save_class ); ++ VipsForeignClass *foreign_class = VIPS_FOREIGN_CLASS(save_class); + int *n_fields = (int *) a; + + int i; + +- if( foreign_class->suffs ) +- for( i = 0; foreign_class->suffs[i]; i++ ) ++ if (foreign_class->suffs) ++ for (i = 0; foreign_class->suffs[i]; i++) + *n_fields += 1; + +- return( NULL ); ++ return (NULL); + } + + static void * +-vips_foreign_get_suffixes_add_cb( VipsForeignSaveClass *save_class, +- void *a, void *b ) ++vips_foreign_get_suffixes_add_cb(VipsForeignSaveClass *save_class, ++ void *a, void *b) + { +- VipsForeignClass *foreign_class = VIPS_FOREIGN_CLASS( save_class ); ++ VipsForeignClass *foreign_class = VIPS_FOREIGN_CLASS(save_class); + gchar ***p = (gchar ***) a; + + int i; + +- if( foreign_class->suffs ) +- for( i = 0; foreign_class->suffs[i]; i++ ) { +- **p = g_strdup( foreign_class->suffs[i] ); ++ if (foreign_class->suffs) ++ for (i = 0; foreign_class->suffs[i]; i++) { ++ **p = g_strdup(foreign_class->suffs[i]); + *p += 1; + } + +- return( NULL ); ++ return (NULL); + } + + /** + * vips_foreign_get_suffixes: + * +- * Get a %NULL-terminated array listing all the supported suffixes. ++ * Get a %NULL-terminated array listing all the supported suffixes. + * +- * This is not the same as all the supported file types, since libvips +- * detects image format for load by testing the first few bytes. ++ * This is not the same as all the supported file types, since libvips ++ * detects image format for load by testing the first few bytes. + * + * Use vips_foreign_find_load() to detect type for a specific file. + * + * Free the return result with g_strfreev(). + * +- * Returns: (transfer full) (array): all supported file extensions, as a +- * %NULL-terminated array. ++ * Returns: (transfer full) (array): all supported file extensions, as a ++ * %NULL-terminated array. + */ +-gchar ** +-vips_foreign_get_suffixes( void ) ++gchar ** ++vips_foreign_get_suffixes(void) + { + int n_suffs; + gchar **suffs; + gchar **p; + + n_suffs = 0; +- (void) vips_foreign_map( ++ (void) vips_foreign_map( + "VipsForeignSave", +- (VipsSListMap2Fn) vips_foreign_get_suffixes_count_cb, +- &n_suffs, NULL ); ++ (VipsSListMap2Fn) vips_foreign_get_suffixes_count_cb, ++ &n_suffs, NULL); + +- suffs = g_new0( gchar *, n_suffs + 1 ); ++ suffs = g_new0(gchar *, n_suffs + 1); + p = suffs; +- (void) vips_foreign_map( ++ (void) vips_foreign_map( + "VipsForeignSave", +- (VipsSListMap2Fn) vips_foreign_get_suffixes_add_cb, +- &p, NULL ); ++ (VipsSListMap2Fn) vips_foreign_get_suffixes_add_cb, ++ &p, NULL); + +- return( suffs ); ++ return (suffs); + } + + /* Kept for early vips8 API compat. + */ + + int +-vips_foreign_save( VipsImage *in, const char *name, ... ) ++vips_foreign_save(VipsImage *in, const char *name, ...) + { + char filename[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; +@@ -1977,42 +1967,42 @@ vips_foreign_save( VipsImage *in, const char *name, ... ) + va_list ap; + int result; + +- vips__filename_split8( name, filename, option_string ); ++ vips__filename_split8(name, filename, option_string); + +- if( !(operation_name = vips_foreign_find_save( filename )) ) +- return( -1 ); ++ if (!(operation_name = vips_foreign_find_save(filename))) ++ return (-1); + +- va_start( ap, name ); +- result = vips_call_split_option_string( operation_name, option_string, +- ap, in, filename ); +- va_end( ap ); ++ va_start(ap, name); ++ result = vips_call_split_option_string(operation_name, option_string, ++ ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /* Can this class write this filetype to a target? + */ + static void * +-vips_foreign_find_save_target_sub( VipsForeignSaveClass *save_class, +- const char *suffix, void *b ) ++vips_foreign_find_save_target_sub(VipsForeignSaveClass *save_class, ++ const char *suffix, void *b) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( save_class ); +- VipsForeignClass *class = VIPS_FOREIGN_CLASS( save_class ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(save_class); ++ VipsForeignClass *class = VIPS_FOREIGN_CLASS(save_class); + +- /* All concrete savers needs suffs, since we use the suff to pick the ++ /* All concrete savers needs suffs, since we use the suff to pick the + * saver. + */ +- if( !G_TYPE_IS_ABSTRACT( G_TYPE_FROM_CLASS( class ) ) && +- !class->suffs ) +- g_warning( "no suffix defined for %s", object_class->nickname ); ++ if (!G_TYPE_IS_ABSTRACT(G_TYPE_FROM_CLASS(class)) && ++ !class->suffs) ++ g_warning("no suffix defined for %s", object_class->nickname); + +- if( !G_TYPE_IS_ABSTRACT( G_TYPE_FROM_CLASS( class ) ) && ++ if (!G_TYPE_IS_ABSTRACT(G_TYPE_FROM_CLASS(class)) && + class->suffs && +- vips_ispostfix( object_class->nickname, "_target" ) && +- vips_filename_suffix_match( suffix, class->suffs ) ) +- return( save_class ); ++ vips_ispostfix(object_class->nickname, "_target") && ++ vips_filename_suffix_match(suffix, class->suffs)) ++ return (save_class); + +- return( NULL ); ++ return (NULL); + } + + /** +@@ -2020,57 +2010,57 @@ vips_foreign_find_save_target_sub( VipsForeignSaveClass *save_class, + * @suffix: format to find a saver for + * + * Searches for an operation you could use to write to a target in @suffix +- * format. ++ * format. + * + * See also: vips_image_write_to_buffer(). + * + * Returns: (nullable): the name of an operation on success, %NULL on error + */ + const char * +-vips_foreign_find_save_target( const char *name ) ++vips_foreign_find_save_target(const char *name) + { + char suffix[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; + VipsForeignSaveClass *save_class; + +- vips__filename_split8( name, suffix, option_string ); ++ vips__filename_split8(name, suffix, option_string); + +- if( !(save_class = (VipsForeignSaveClass *) vips_foreign_map( +- "VipsForeignSave", +- (VipsSListMap2Fn) vips_foreign_find_save_target_sub, +- (void *) suffix, NULL )) ) { +- vips_error( "VipsForeignSave", +- _( "\"%s\" is not a known target format" ), name ); ++ if (!(save_class = (VipsForeignSaveClass *) vips_foreign_map( ++ "VipsForeignSave", ++ (VipsSListMap2Fn) vips_foreign_find_save_target_sub, ++ (void *) suffix, NULL))) { ++ vips_error("VipsForeignSave", ++ _("\"%s\" is not a known target format"), name); + +- return( NULL ); ++ return (NULL); + } + +- return( G_OBJECT_CLASS_NAME( save_class ) ); ++ return (G_OBJECT_CLASS_NAME(save_class)); + } + + /* Can we write this buffer with this file type? + */ + static void * +-vips_foreign_find_save_buffer_sub( VipsForeignSaveClass *save_class, +- const char *suffix, void *b ) ++vips_foreign_find_save_buffer_sub(VipsForeignSaveClass *save_class, ++ const char *suffix, void *b) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( save_class ); +- VipsForeignClass *class = VIPS_FOREIGN_CLASS( save_class ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(save_class); ++ VipsForeignClass *class = VIPS_FOREIGN_CLASS(save_class); + +- /* All concrete savers needs suffs, since we use the suff to pick the ++ /* All concrete savers needs suffs, since we use the suff to pick the + * saver. + */ +- if( !G_TYPE_IS_ABSTRACT( G_TYPE_FROM_CLASS( class ) ) && +- !class->suffs ) +- g_warning( "no suffix defined for %s", object_class->nickname ); ++ if (!G_TYPE_IS_ABSTRACT(G_TYPE_FROM_CLASS(class)) && ++ !class->suffs) ++ g_warning("no suffix defined for %s", object_class->nickname); + +- if( !G_TYPE_IS_ABSTRACT( G_TYPE_FROM_CLASS( class ) ) && ++ if (!G_TYPE_IS_ABSTRACT(G_TYPE_FROM_CLASS(class)) && + class->suffs && +- vips_ispostfix( object_class->nickname, "_buffer" ) && +- vips_filename_suffix_match( suffix, class->suffs ) ) +- return( save_class ); ++ vips_ispostfix(object_class->nickname, "_buffer") && ++ vips_filename_suffix_match(suffix, class->suffs)) ++ return (save_class); + +- return( NULL ); ++ return (NULL); + } + + /** +@@ -2078,32 +2068,32 @@ vips_foreign_find_save_buffer_sub( VipsForeignSaveClass *save_class, + * @suffix: name to find a saver for + * + * Searches for an operation you could use to write to a buffer in @suffix +- * format. ++ * format. + * + * See also: vips_image_write_to_buffer(). + * + * Returns: (nullable): the name of an operation on success, %NULL on error + */ + const char * +-vips_foreign_find_save_buffer( const char *name ) ++vips_foreign_find_save_buffer(const char *name) + { + char suffix[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; + VipsForeignSaveClass *save_class; + +- vips__filename_split8( name, suffix, option_string ); ++ vips__filename_split8(name, suffix, option_string); + +- if( !(save_class = (VipsForeignSaveClass *) vips_foreign_map( +- "VipsForeignSave", +- (VipsSListMap2Fn) vips_foreign_find_save_buffer_sub, +- (void *) suffix, NULL )) ) { +- vips_error( "VipsForeignSave", +- _( "\"%s\" is not a known buffer format" ), name ); ++ if (!(save_class = (VipsForeignSaveClass *) vips_foreign_map( ++ "VipsForeignSave", ++ (VipsSListMap2Fn) vips_foreign_find_save_buffer_sub, ++ (void *) suffix, NULL))) { ++ vips_error("VipsForeignSave", ++ _("\"%s\" is not a known buffer format"), name); + +- return( NULL ); ++ return (NULL); + } + +- return( G_OBJECT_CLASS_NAME( save_class ) ); ++ return (G_OBJECT_CLASS_NAME(save_class)); + } + + /* C API wrappers for loadable modules go here. +@@ -2122,16 +2112,16 @@ vips_foreign_find_save_buffer( const char *name ) + * * @thumbnail: %gboolean, fetch thumbnail instead of image + * * @unlimited: %gboolean, remove all denial of service limits + * +- * Read a HEIF image file into a VIPS image. ++ * Read a HEIF image file into a VIPS image. + * + * Use @page to select a page to render, numbering from zero. If neither @n + * nor @page are set, @page defaults to the primary page, otherwise to 0. + * + * Use @n to select the number of pages to render. The default is 1. Pages are +- * rendered in a vertical column. Set to -1 to mean "until the end of the ++ * rendered in a vertical column. Set to -1 to mean "until the end of the + * document". Use vips_grid() to reorganise pages. + * +- * HEIF images have a primary image. The metadata item `heif-primary` gives ++ * HEIF images have a primary image. The metadata item `heif-primary` gives + * the page number of the primary. + * + * If @thumbnail is %TRUE, then fetch a stored thumbnail rather than the +@@ -2148,16 +2138,16 @@ vips_foreign_find_save_buffer( const char *name ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_heifload( const char *filename, VipsImage **out, ... ) ++vips_heifload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "heifload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("heifload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -2174,18 +2164,18 @@ vips_heifload( const char *filename, VipsImage **out, ... ) + * * @thumbnail: %gboolean, fetch thumbnail instead of image + * * @unlimited: %gboolean, remove all denial of service limits + * +- * Read a HEIF image file into a VIPS image. +- * Exactly as vips_heifload(), but read from a memory buffer. ++ * Read a HEIF image file into a VIPS image. ++ * Exactly as vips_heifload(), but read from a memory buffer. + * +- * You must not free the buffer while @out is active. The +- * #VipsObject::postclose signal on @out is a good place to free. ++ * You must not free the buffer while @out is active. The ++ * #VipsObject::postclose signal on @out is a good place to free. + * + * See also: vips_heifload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_heifload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++vips_heifload_buffer(void *buf, size_t len, VipsImage **out, ...) + { + va_list ap; + VipsBlob *blob; +@@ -2193,15 +2183,15 @@ vips_heifload_buffer( void *buf, size_t len, VipsImage **out, ... ) + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, buf, len ); ++ blob = vips_blob_new(NULL, buf, len); + +- va_start( ap, out ); +- result = vips_call_split( "heifload_buffer", ap, blob, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("heifload_buffer", ap, blob, out); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( result ); ++ return (result); + } + + /** +@@ -2217,29 +2207,29 @@ vips_heifload_buffer( void *buf, size_t len, VipsImage **out, ... ) + * * @thumbnail: %gboolean, fetch thumbnail instead of image + * * @unlimited: %gboolean, remove all denial of service limits + * +- * Exactly as vips_heifload(), but read from a source. ++ * Exactly as vips_heifload(), but read from a source. + * + * See also: vips_heifload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_heifload_source( VipsSource *source, VipsImage **out, ... ) ++vips_heifload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "heifload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("heifload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_heifsave: (method) +- * @in: image to save +- * @filename: file to write to ++ * @in: image to save ++ * @filename: file to write to + * @...: %NULL-terminated list of optional named arguments + * + * Optional arguments: +@@ -2251,7 +2241,7 @@ vips_heifload_source( VipsSource *source, VipsImage **out, ... ) + * * @effort: %gint, encoding effort + * * @subsample_mode: #VipsForeignSubsample, chroma subsampling mode + * +- * Write a VIPS image to a file in HEIF format. ++ * Write a VIPS image to a file in HEIF format. + * + * Use @Q to set the compression factor. Default 50, which seems to be roughly + * what the iphone uses. Q 30 gives about the same quality as JPEG Q 75. +@@ -2276,21 +2266,21 @@ vips_heifload_source( VipsSource *source, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_heifsave( VipsImage *in, const char *filename, ... ) ++vips_heifsave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "heifsave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("heifsave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_heifsave_buffer: (method) +- * @in: image to save ++ * @in: image to save + * @buf: (array length=len) (element-type guint8): return output buffer here + * @len: (type gsize): return output length here + * @...: %NULL-terminated list of optional named arguments +@@ -2304,7 +2294,7 @@ vips_heifsave( VipsImage *in, const char *filename, ... ) + * * @effort: %gint, encoding effort + * * @subsample_mode: #VipsForeignSubsample, chroma subsampling mode + * +- * As vips_heifsave(), but save to a memory buffer. ++ * As vips_heifsave(), but save to a memory buffer. + * + * The address of the buffer is returned in @obuf, the length of the buffer in + * @olen. You are responsible for freeing the buffer with g_free() when you +@@ -2315,36 +2305,36 @@ vips_heifsave( VipsImage *in, const char *filename, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_heifsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++vips_heifsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + { + va_list ap; + VipsArea *area; + int result; + +- area = NULL; ++ area = NULL; + +- va_start( ap, len ); +- result = vips_call_split( "heifsave_buffer", ap, in, &area ); +- va_end( ap ); ++ va_start(ap, len); ++ result = vips_call_split("heifsave_buffer", ap, in, &area); ++ va_end(ap); + +- if( !result && +- area ) { +- if( buf ) { ++ if (!result && ++ area) { ++ if (buf) { + *buf = area->data; + area->free_fn = NULL; + } +- if( len ) ++ if (len) + *len = area->length; + +- vips_area_unref( area ); ++ vips_area_unref(area); + } + +- return( result ); ++ return (result); + } + + /** + * vips_heifsave_target: (method) +- * @in: image to save ++ * @in: image to save + * @target: save image to this target + * @...: %NULL-terminated list of optional named arguments + * +@@ -2364,16 +2354,16 @@ vips_heifsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_heifsave_target( VipsImage *in, VipsTarget *target, ... ) ++vips_heifsave_target(VipsImage *in, VipsTarget *target, ...) + { + va_list ap; + int result; + +- va_start( ap, target ); +- result = vips_call_split( "heifsave_target", ap, in, target ); +- va_end( ap ); ++ va_start(ap, target); ++ result = vips_call_split("heifsave_target", ap, in, target); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -2382,7 +2372,7 @@ vips_heifsave_target( VipsImage *in, VipsTarget *target, ... ) + * @out: (out): decompressed image + * @...: %NULL-terminated list of optional named arguments + * +- * Read a JPEG-XL image. ++ * Read a JPEG-XL image. + * + * The JPEG-XL loader and saver are experimental features and may change + * in future libvips versions. +@@ -2392,16 +2382,16 @@ vips_heifsave_target( VipsImage *in, VipsTarget *target, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_jxlload( const char *filename, VipsImage **out, ... ) ++vips_jxlload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "jxlload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("jxlload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -2411,12 +2401,12 @@ vips_jxlload( const char *filename, VipsImage **out, ... ) + * @out: (out): image to write + * @...: %NULL-terminated list of optional named arguments + * +- * Exactly as vips_jxlload(), but read from a buffer. ++ * Exactly as vips_jxlload(), but read from a buffer. + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_jxlload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++vips_jxlload_buffer(void *buf, size_t len, VipsImage **out, ...) + { + va_list ap; + VipsBlob *blob; +@@ -2424,15 +2414,15 @@ vips_jxlload_buffer( void *buf, size_t len, VipsImage **out, ... ) + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, buf, len ); ++ blob = vips_blob_new(NULL, buf, len); + +- va_start( ap, out ); +- result = vips_call_split( "jxlload_buffer", ap, blob, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("jxlload_buffer", ap, blob, out); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( result ); ++ return (result); + } + + /** +@@ -2441,27 +2431,27 @@ vips_jxlload_buffer( void *buf, size_t len, VipsImage **out, ... ) + * @out: (out): decompressed image + * @...: %NULL-terminated list of optional named arguments + * +- * Exactly as vips_jxlload(), but read from a source. ++ * Exactly as vips_jxlload(), but read from a source. + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_jxlload_source( VipsSource *source, VipsImage **out, ... ) ++vips_jxlload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "jxlload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("jxlload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_jxlsave: (method) +- * @in: image to save +- * @filename: file to write to ++ * @in: image to save ++ * @filename: file to write to + * @...: %NULL-terminated list of optional named arguments + * + * Optional arguments: +@@ -2472,17 +2462,17 @@ vips_jxlload_source( VipsSource *source, VipsImage **out, ... ) + * * @lossless: %gboolean, enables lossless compression + * * @Q: %gint, quality setting + * +- * Write a VIPS image to a file in JPEG-XL format. ++ * Write a VIPS image to a file in JPEG-XL format. + * + * The JPEG-XL loader and saver are experimental features and may change + * in future libvips versions. + * +- * @tier sets the overall decode speed the encoder will target. Minimum is 0 ++ * @tier sets the overall decode speed the encoder will target. Minimum is 0 + * (highest quality), and maximum is 4 (lowest quality). Default is 0. + * +- * @distance sets the target maximum encoding error. Minimum is 0 ++ * @distance sets the target maximum encoding error. Minimum is 0 + * (highest quality), and maximum is 15 (lowest quality). Default is 1.0 +- * (visually lossless). ++ * (visually lossless). + * + * As a convenience, you can also use @Q to set @distance. @Q uses + * approximately the same scale as regular JPEG. +@@ -2492,21 +2482,21 @@ vips_jxlload_source( VipsSource *source, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_jxlsave( VipsImage *in, const char *filename, ... ) ++vips_jxlsave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "jxlsave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("jxlsave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_jxlsave_buffer: (method) +- * @in: image to save ++ * @in: image to save + * @buf: (array length=len) (element-type guint8): return output buffer here + * @len: (type gsize): return output length here + * @...: %NULL-terminated list of optional named arguments +@@ -2526,36 +2516,36 @@ vips_jxlsave( VipsImage *in, const char *filename, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_jxlsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++vips_jxlsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + { + va_list ap; + VipsArea *area; + int result; + +- area = NULL; ++ area = NULL; + +- va_start( ap, len ); +- result = vips_call_split( "jxlsave_buffer", ap, in, &area ); +- va_end( ap ); ++ va_start(ap, len); ++ result = vips_call_split("jxlsave_buffer", ap, in, &area); ++ va_end(ap); + +- if( !result && +- area ) { +- if( buf ) { ++ if (!result && ++ area) { ++ if (buf) { + *buf = area->data; + area->free_fn = NULL; + } +- if( len ) ++ if (len) + *len = area->length; + +- vips_area_unref( area ); ++ vips_area_unref(area); + } + +- return( result ); ++ return (result); + } + + /** + * vips_jxlsave_target: (method) +- * @in: image to save ++ * @in: image to save + * @target: save image to this target + * @...: %NULL-terminated list of optional named arguments + * +@@ -2574,16 +2564,16 @@ vips_jxlsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_jxlsave_target( VipsImage *in, VipsTarget *target, ... ) ++vips_jxlsave_target(VipsImage *in, VipsTarget *target, ...) + { + va_list ap; + int result; + +- va_start( ap, target ); +- result = vips_call_split( "jxlsave_target", ap, in, target ); +- va_end( ap ); ++ va_start(ap, target); ++ result = vips_call_split("jxlsave_target", ap, in, target); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -2601,7 +2591,7 @@ vips_jxlsave_target( VipsImage *in, VipsTarget *target, ... ) + * * @background: #VipsArrayDouble background colour + * * @password: %gchararray background colour + * +- * Render a PDF file into a VIPS image. ++ * Render a PDF file into a VIPS image. + * + * The output image is always RGBA --- CMYK PDFs will be + * converted. If you need CMYK bitmaps, you should use vips_magickload() +@@ -2611,19 +2601,19 @@ vips_jxlsave_target( VipsImage *in, VipsTarget *target, ... ) + * + * Use @n to select the number of pages to render. The default is 1. Pages are + * rendered in a vertical column, with each individual page aligned to the +- * left. Set to -1 to mean "until the end of the document". Use vips_grid() ++ * left. Set to -1 to mean "until the end of the document". Use vips_grid() + * to change page layout. + * + * Use @dpi to set the rendering resolution. The default is 72. Additionally, + * you can scale by setting @scale. If you set both, they combine. + * +- * Use @background to set the background RGBA colour. The default is 255 ++ * Use @background to set the background RGBA colour. The default is 255 + * (solid white), use eg. 0 for a transparent background. + * + * Use @password to supply a decryption password. + * + * The operation fills a number of header fields with metadata, for example +- * "pdf-author". They may be useful. ++ * "pdf-author". They may be useful. + * + * This function only reads the image header and does not render any pixel + * data. Rendering occurs when pixels are accessed. +@@ -2633,16 +2623,16 @@ vips_jxlsave_target( VipsImage *in, VipsTarget *target, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_pdfload( const char *filename, VipsImage **out, ... ) ++vips_pdfload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "pdfload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("pdfload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -2661,17 +2651,17 @@ vips_pdfload( const char *filename, VipsImage **out, ... ) + * * @background: #VipsArrayDouble background colour + * + * Read a PDF-formatted memory buffer into a VIPS image. Exactly as +- * vips_pdfload(), but read from memory. ++ * vips_pdfload(), but read from memory. + * +- * You must not free the buffer while @out is active. The +- * #VipsObject::postclose signal on @out is a good place to free. ++ * You must not free the buffer while @out is active. The ++ * #VipsObject::postclose signal on @out is a good place to free. + * + * See also: vips_pdfload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_pdfload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++vips_pdfload_buffer(void *buf, size_t len, VipsImage **out, ...) + { + va_list ap; + VipsBlob *blob; +@@ -2679,15 +2669,15 @@ vips_pdfload_buffer( void *buf, size_t len, VipsImage **out, ... ) + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, buf, len ); ++ blob = vips_blob_new(NULL, buf, len); + +- va_start( ap, out ); +- result = vips_call_split( "pdfload_buffer", ap, blob, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("pdfload_buffer", ap, blob, out); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( result ); ++ return (result); + } + + /** +@@ -2704,23 +2694,23 @@ vips_pdfload_buffer( void *buf, size_t len, VipsImage **out, ... ) + * * @scale: %gdouble, scale render by this factor + * * @background: #VipsArrayDouble background colour + * +- * Exactly as vips_pdfload(), but read from a source. ++ * Exactly as vips_pdfload(), but read from a source. + * + * See also: vips_pdfload() + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_pdfload_source( VipsSource *source, VipsImage **out, ... ) ++vips_pdfload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "pdfload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("pdfload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -2764,16 +2754,16 @@ vips_pdfload_source( VipsSource *source, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_openslideload( const char *filename, VipsImage **out, ... ) ++vips_openslideload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "openslideload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("openslideload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -2789,252 +2779,252 @@ vips_openslideload( const char *filename, VipsImage **out, ... ) + * * @attach_associated: %gboolean, attach all associated images as metadata + * * @autocrop: %gboolean, crop to image bounds + * +- * Exactly as vips_openslideload(), but read from a source. ++ * Exactly as vips_openslideload(), but read from a source. + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_openslideload_source( VipsSource *source, VipsImage **out, ... ) ++vips_openslideload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "openslideload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("openslideload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /* Called from iofuncs to init all operations in this dir. Use a plugin system + * instead? + */ + void +-vips_foreign_operation_init( void ) +-{ +- extern GType vips_foreign_load_rad_file_get_type( void ); +- extern GType vips_foreign_load_rad_buffer_get_type( void ); +- extern GType vips_foreign_load_rad_source_get_type( void ); +- extern GType vips_foreign_save_rad_file_get_type( void ); +- extern GType vips_foreign_save_rad_buffer_get_type( void ); +- extern GType vips_foreign_save_rad_target_get_type( void ); +- +- extern GType vips_foreign_load_mat_get_type( void ); +- +- extern GType vips_foreign_load_ppm_file_get_type( void ); +- extern GType vips_foreign_load_ppm_source_get_type( void ); +- extern GType vips_foreign_save_ppm_file_get_type( void ); +- extern GType vips_foreign_save_pbm_target_get_type( void ); +- extern GType vips_foreign_save_pgm_target_get_type( void ); +- extern GType vips_foreign_save_ppm_target_get_type( void ); +- extern GType vips_foreign_save_pfm_target_get_type( void ); +- +- extern GType vips_foreign_load_png_file_get_type( void ); +- extern GType vips_foreign_load_png_buffer_get_type( void ); +- extern GType vips_foreign_load_png_source_get_type( void ); +- extern GType vips_foreign_save_png_file_get_type( void ); +- extern GType vips_foreign_save_png_buffer_get_type( void ); +- extern GType vips_foreign_save_png_target_get_type( void ); +- +- extern GType vips_foreign_save_spng_file_get_type( void ); +- extern GType vips_foreign_save_spng_buffer_get_type( void ); +- extern GType vips_foreign_save_spng_target_get_type( void ); +- +- extern GType vips_foreign_load_csv_file_get_type( void ); +- extern GType vips_foreign_load_csv_source_get_type( void ); +- extern GType vips_foreign_save_csv_file_get_type( void ); +- extern GType vips_foreign_save_csv_target_get_type( void ); +- +- extern GType vips_foreign_load_matrix_file_get_type( void ); +- extern GType vips_foreign_load_matrix_source_get_type( void ); +- extern GType vips_foreign_save_matrix_file_get_type( void ); +- extern GType vips_foreign_save_matrix_target_get_type( void ); +- extern GType vips_foreign_print_matrix_get_type( void ); +- +- extern GType vips_foreign_load_fits_file_get_type( void ); +- extern GType vips_foreign_load_fits_source_get_type( void ); +- extern GType vips_foreign_save_fits_get_type( void ); +- +- extern GType vips_foreign_load_analyze_get_type( void ); +- +- extern GType vips_foreign_load_openexr_get_type( void ); +- +- extern GType vips_foreign_load_openslide_file_get_type( void ); +- extern GType vips_foreign_load_openslide_source_get_type( void ); +- +- extern GType vips_foreign_load_vips_file_get_type( void ); +- extern GType vips_foreign_load_vips_source_get_type( void ); +- extern GType vips_foreign_save_vips_file_get_type( void ); +- extern GType vips_foreign_save_vips_target_get_type( void ); +- +- extern GType vips_foreign_load_jpeg_file_get_type( void ); +- extern GType vips_foreign_load_jpeg_buffer_get_type( void ); +- extern GType vips_foreign_load_jpeg_source_get_type( void ); +- extern GType vips_foreign_save_jpeg_file_get_type( void ); +- extern GType vips_foreign_save_jpeg_buffer_get_type( void ); +- extern GType vips_foreign_save_jpeg_target_get_type( void ); +- extern GType vips_foreign_save_jpeg_mime_get_type( void ); +- +- extern GType vips_foreign_load_tiff_file_get_type( void ); +- extern GType vips_foreign_load_tiff_buffer_get_type( void ); +- extern GType vips_foreign_load_tiff_source_get_type( void ); +- extern GType vips_foreign_save_tiff_file_get_type( void ); +- extern GType vips_foreign_save_tiff_buffer_get_type( void ); +- extern GType vips_foreign_save_tiff_target_get_type( void ); +- +- extern GType vips_foreign_load_raw_get_type( void ); +- extern GType vips_foreign_save_raw_get_type( void ); +- extern GType vips_foreign_save_raw_fd_get_type( void ); +- +- extern GType vips_foreign_load_magick_file_get_type( void ); +- extern GType vips_foreign_load_magick_buffer_get_type( void ); +- extern GType vips_foreign_load_magick7_file_get_type( void ); +- extern GType vips_foreign_load_magick7_buffer_get_type( void ); +- +- extern GType vips_foreign_save_magick_file_get_type( void ); +- extern GType vips_foreign_save_magick_buffer_get_type( void ); +- extern GType vips_foreign_save_magick_bmp_file_get_type( void ); +- extern GType vips_foreign_save_magick_bmp_buffer_get_type( void ); +- extern GType vips_foreign_save_magick_gif_file_get_type( void ); +- extern GType vips_foreign_save_magick_gif_buffer_get_type( void ); +- +- extern GType vips_foreign_save_dz_file_get_type( void ); +- extern GType vips_foreign_save_dz_buffer_get_type( void ); +- extern GType vips_foreign_save_dz_target_get_type( void ); +- +- extern GType vips_foreign_load_webp_file_get_type( void ); +- extern GType vips_foreign_load_webp_buffer_get_type( void ); +- extern GType vips_foreign_load_webp_source_get_type( void ); +- extern GType vips_foreign_save_webp_file_get_type( void ); +- extern GType vips_foreign_save_webp_buffer_get_type( void ); +- extern GType vips_foreign_save_webp_target_get_type( void ); +- extern GType vips_foreign_save_webp_mime_get_type( void ); +- +- extern GType vips_foreign_load_pdf_file_get_type( void ); +- extern GType vips_foreign_load_pdf_buffer_get_type( void ); +- extern GType vips_foreign_load_pdf_source_get_type( void ); +- +- extern GType vips_foreign_load_svg_file_get_type( void ); +- extern GType vips_foreign_load_svg_buffer_get_type( void ); +- extern GType vips_foreign_load_svg_source_get_type( void ); +- +- extern GType vips_foreign_load_jp2k_file_get_type( void ); +- extern GType vips_foreign_load_jp2k_buffer_get_type( void ); +- extern GType vips_foreign_load_jp2k_source_get_type( void ); +- extern GType vips_foreign_save_jp2k_file_get_type( void ); +- extern GType vips_foreign_save_jp2k_buffer_get_type( void ); +- extern GType vips_foreign_save_jp2k_target_get_type( void ); +- +- extern GType vips_foreign_load_jxl_file_get_type( void ); +- extern GType vips_foreign_load_jxl_buffer_get_type( void ); +- extern GType vips_foreign_load_jxl_source_get_type( void ); +- extern GType vips_foreign_save_jxl_file_get_type( void ); +- extern GType vips_foreign_save_jxl_buffer_get_type( void ); +- extern GType vips_foreign_save_jxl_target_get_type( void ); +- +- extern GType vips_foreign_load_heif_file_get_type( void ); +- extern GType vips_foreign_load_heif_buffer_get_type( void ); +- extern GType vips_foreign_load_heif_source_get_type( void ); +- extern GType vips_foreign_save_heif_file_get_type( void ); +- extern GType vips_foreign_save_heif_buffer_get_type( void ); +- extern GType vips_foreign_save_heif_target_get_type( void ); +- extern GType vips_foreign_save_avif_target_get_type( void ); +- +- extern GType vips_foreign_load_nifti_file_get_type( void ); +- extern GType vips_foreign_load_nifti_source_get_type( void ); +- extern GType vips_foreign_save_nifti_get_type( void ); +- +- extern GType vips_foreign_load_nsgif_file_get_type( void ); +- extern GType vips_foreign_load_nsgif_buffer_get_type( void ); +- extern GType vips_foreign_load_nsgif_source_get_type( void ); +- +- extern GType vips_foreign_save_cgif_file_get_type( void ); +- extern GType vips_foreign_save_cgif_buffer_get_type( void ); +- extern GType vips_foreign_save_cgif_target_get_type( void ); +- +- vips_foreign_load_csv_file_get_type(); +- vips_foreign_load_csv_source_get_type(); +- vips_foreign_save_csv_file_get_type(); +- vips_foreign_save_csv_target_get_type(); +- +- vips_foreign_load_matrix_file_get_type(); +- vips_foreign_load_matrix_source_get_type(); +- vips_foreign_save_matrix_file_get_type(); +- vips_foreign_save_matrix_target_get_type(); +- vips_foreign_print_matrix_get_type(); +- +- vips_foreign_load_raw_get_type(); +- vips_foreign_save_raw_get_type(); +- vips_foreign_save_raw_fd_get_type(); +- +- vips_foreign_load_vips_file_get_type(); +- vips_foreign_load_vips_source_get_type(); +- vips_foreign_save_vips_file_get_type(); +- vips_foreign_save_vips_target_get_type(); ++vips_foreign_operation_init(void) ++{ ++ extern GType vips_foreign_load_rad_file_get_type(void); ++ extern GType vips_foreign_load_rad_buffer_get_type(void); ++ extern GType vips_foreign_load_rad_source_get_type(void); ++ extern GType vips_foreign_save_rad_file_get_type(void); ++ extern GType vips_foreign_save_rad_buffer_get_type(void); ++ extern GType vips_foreign_save_rad_target_get_type(void); ++ ++ extern GType vips_foreign_load_mat_get_type(void); ++ ++ extern GType vips_foreign_load_ppm_file_get_type(void); ++ extern GType vips_foreign_load_ppm_source_get_type(void); ++ extern GType vips_foreign_save_ppm_file_get_type(void); ++ extern GType vips_foreign_save_pbm_target_get_type(void); ++ extern GType vips_foreign_save_pgm_target_get_type(void); ++ extern GType vips_foreign_save_ppm_target_get_type(void); ++ extern GType vips_foreign_save_pfm_target_get_type(void); ++ ++ extern GType vips_foreign_load_png_file_get_type(void); ++ extern GType vips_foreign_load_png_buffer_get_type(void); ++ extern GType vips_foreign_load_png_source_get_type(void); ++ extern GType vips_foreign_save_png_file_get_type(void); ++ extern GType vips_foreign_save_png_buffer_get_type(void); ++ extern GType vips_foreign_save_png_target_get_type(void); ++ ++ extern GType vips_foreign_save_spng_file_get_type(void); ++ extern GType vips_foreign_save_spng_buffer_get_type(void); ++ extern GType vips_foreign_save_spng_target_get_type(void); ++ ++ extern GType vips_foreign_load_csv_file_get_type(void); ++ extern GType vips_foreign_load_csv_source_get_type(void); ++ extern GType vips_foreign_save_csv_file_get_type(void); ++ extern GType vips_foreign_save_csv_target_get_type(void); ++ ++ extern GType vips_foreign_load_matrix_file_get_type(void); ++ extern GType vips_foreign_load_matrix_source_get_type(void); ++ extern GType vips_foreign_save_matrix_file_get_type(void); ++ extern GType vips_foreign_save_matrix_target_get_type(void); ++ extern GType vips_foreign_print_matrix_get_type(void); ++ ++ extern GType vips_foreign_load_fits_file_get_type(void); ++ extern GType vips_foreign_load_fits_source_get_type(void); ++ extern GType vips_foreign_save_fits_get_type(void); ++ ++ extern GType vips_foreign_load_analyze_get_type(void); ++ ++ extern GType vips_foreign_load_openexr_get_type(void); ++ ++ extern GType vips_foreign_load_openslide_file_get_type(void); ++ extern GType vips_foreign_load_openslide_source_get_type(void); ++ ++ extern GType vips_foreign_load_vips_file_get_type(void); ++ extern GType vips_foreign_load_vips_source_get_type(void); ++ extern GType vips_foreign_save_vips_file_get_type(void); ++ extern GType vips_foreign_save_vips_target_get_type(void); ++ ++ extern GType vips_foreign_load_jpeg_file_get_type(void); ++ extern GType vips_foreign_load_jpeg_buffer_get_type(void); ++ extern GType vips_foreign_load_jpeg_source_get_type(void); ++ extern GType vips_foreign_save_jpeg_file_get_type(void); ++ extern GType vips_foreign_save_jpeg_buffer_get_type(void); ++ extern GType vips_foreign_save_jpeg_target_get_type(void); ++ extern GType vips_foreign_save_jpeg_mime_get_type(void); ++ ++ extern GType vips_foreign_load_tiff_file_get_type(void); ++ extern GType vips_foreign_load_tiff_buffer_get_type(void); ++ extern GType vips_foreign_load_tiff_source_get_type(void); ++ extern GType vips_foreign_save_tiff_file_get_type(void); ++ extern GType vips_foreign_save_tiff_buffer_get_type(void); ++ extern GType vips_foreign_save_tiff_target_get_type(void); ++ ++ extern GType vips_foreign_load_raw_get_type(void); ++ extern GType vips_foreign_save_raw_get_type(void); ++ extern GType vips_foreign_save_raw_fd_get_type(void); ++ ++ extern GType vips_foreign_load_magick_file_get_type(void); ++ extern GType vips_foreign_load_magick_buffer_get_type(void); ++ extern GType vips_foreign_load_magick7_file_get_type(void); ++ extern GType vips_foreign_load_magick7_buffer_get_type(void); ++ ++ extern GType vips_foreign_save_magick_file_get_type(void); ++ extern GType vips_foreign_save_magick_buffer_get_type(void); ++ extern GType vips_foreign_save_magick_bmp_file_get_type(void); ++ extern GType vips_foreign_save_magick_bmp_buffer_get_type(void); ++ extern GType vips_foreign_save_magick_gif_file_get_type(void); ++ extern GType vips_foreign_save_magick_gif_buffer_get_type(void); ++ ++ extern GType vips_foreign_save_dz_file_get_type(void); ++ extern GType vips_foreign_save_dz_buffer_get_type(void); ++ extern GType vips_foreign_save_dz_target_get_type(void); ++ ++ extern GType vips_foreign_load_webp_file_get_type(void); ++ extern GType vips_foreign_load_webp_buffer_get_type(void); ++ extern GType vips_foreign_load_webp_source_get_type(void); ++ extern GType vips_foreign_save_webp_file_get_type(void); ++ extern GType vips_foreign_save_webp_buffer_get_type(void); ++ extern GType vips_foreign_save_webp_target_get_type(void); ++ extern GType vips_foreign_save_webp_mime_get_type(void); ++ ++ extern GType vips_foreign_load_pdf_file_get_type(void); ++ extern GType vips_foreign_load_pdf_buffer_get_type(void); ++ extern GType vips_foreign_load_pdf_source_get_type(void); ++ ++ extern GType vips_foreign_load_svg_file_get_type(void); ++ extern GType vips_foreign_load_svg_buffer_get_type(void); ++ extern GType vips_foreign_load_svg_source_get_type(void); ++ ++ extern GType vips_foreign_load_jp2k_file_get_type(void); ++ extern GType vips_foreign_load_jp2k_buffer_get_type(void); ++ extern GType vips_foreign_load_jp2k_source_get_type(void); ++ extern GType vips_foreign_save_jp2k_file_get_type(void); ++ extern GType vips_foreign_save_jp2k_buffer_get_type(void); ++ extern GType vips_foreign_save_jp2k_target_get_type(void); ++ ++ extern GType vips_foreign_load_jxl_file_get_type(void); ++ extern GType vips_foreign_load_jxl_buffer_get_type(void); ++ extern GType vips_foreign_load_jxl_source_get_type(void); ++ extern GType vips_foreign_save_jxl_file_get_type(void); ++ extern GType vips_foreign_save_jxl_buffer_get_type(void); ++ extern GType vips_foreign_save_jxl_target_get_type(void); ++ ++ extern GType vips_foreign_load_heif_file_get_type(void); ++ extern GType vips_foreign_load_heif_buffer_get_type(void); ++ extern GType vips_foreign_load_heif_source_get_type(void); ++ extern GType vips_foreign_save_heif_file_get_type(void); ++ extern GType vips_foreign_save_heif_buffer_get_type(void); ++ extern GType vips_foreign_save_heif_target_get_type(void); ++ extern GType vips_foreign_save_avif_target_get_type(void); ++ ++ extern GType vips_foreign_load_nifti_file_get_type(void); ++ extern GType vips_foreign_load_nifti_source_get_type(void); ++ extern GType vips_foreign_save_nifti_get_type(void); ++ ++ extern GType vips_foreign_load_nsgif_file_get_type(void); ++ extern GType vips_foreign_load_nsgif_buffer_get_type(void); ++ extern GType vips_foreign_load_nsgif_source_get_type(void); ++ ++ extern GType vips_foreign_save_cgif_file_get_type(void); ++ extern GType vips_foreign_save_cgif_buffer_get_type(void); ++ extern GType vips_foreign_save_cgif_target_get_type(void); ++ ++ vips_foreign_load_csv_file_get_type(); ++ vips_foreign_load_csv_source_get_type(); ++ vips_foreign_save_csv_file_get_type(); ++ vips_foreign_save_csv_target_get_type(); ++ ++ vips_foreign_load_matrix_file_get_type(); ++ vips_foreign_load_matrix_source_get_type(); ++ vips_foreign_save_matrix_file_get_type(); ++ vips_foreign_save_matrix_target_get_type(); ++ vips_foreign_print_matrix_get_type(); ++ ++ vips_foreign_load_raw_get_type(); ++ vips_foreign_save_raw_get_type(); ++ vips_foreign_save_raw_fd_get_type(); ++ ++ vips_foreign_load_vips_file_get_type(); ++ vips_foreign_load_vips_source_get_type(); ++ vips_foreign_save_vips_file_get_type(); ++ vips_foreign_save_vips_target_get_type(); + + #ifdef HAVE_ANALYZE +- vips_foreign_load_analyze_get_type(); ++ vips_foreign_load_analyze_get_type(); + #endif /*HAVE_ANALYZE*/ + + #ifdef HAVE_PPM +- vips_foreign_load_ppm_file_get_type(); +- vips_foreign_load_ppm_source_get_type(); +- vips_foreign_save_ppm_file_get_type(); +- vips_foreign_save_pbm_target_get_type(); +- vips_foreign_save_pgm_target_get_type(); +- vips_foreign_save_ppm_target_get_type(); +- vips_foreign_save_pfm_target_get_type(); ++ vips_foreign_load_ppm_file_get_type(); ++ vips_foreign_load_ppm_source_get_type(); ++ vips_foreign_save_ppm_file_get_type(); ++ vips_foreign_save_pbm_target_get_type(); ++ vips_foreign_save_pgm_target_get_type(); ++ vips_foreign_save_ppm_target_get_type(); ++ vips_foreign_save_pfm_target_get_type(); + #endif /*HAVE_PPM*/ + + #ifdef HAVE_RADIANCE +- vips_foreign_load_rad_file_get_type(); +- vips_foreign_load_rad_buffer_get_type(); +- vips_foreign_load_rad_source_get_type(); +- vips_foreign_save_rad_file_get_type(); +- vips_foreign_save_rad_buffer_get_type(); +- vips_foreign_save_rad_target_get_type(); ++ vips_foreign_load_rad_file_get_type(); ++ vips_foreign_load_rad_buffer_get_type(); ++ vips_foreign_load_rad_source_get_type(); ++ vips_foreign_save_rad_file_get_type(); ++ vips_foreign_save_rad_buffer_get_type(); ++ vips_foreign_save_rad_target_get_type(); + #endif /*HAVE_RADIANCE*/ + + #if defined(HAVE_POPPLER) && !defined(POPPLER_MODULE) +- vips_foreign_load_pdf_file_get_type(); +- vips_foreign_load_pdf_buffer_get_type(); +- vips_foreign_load_pdf_source_get_type(); ++ vips_foreign_load_pdf_file_get_type(); ++ vips_foreign_load_pdf_buffer_get_type(); ++ vips_foreign_load_pdf_source_get_type(); + #endif /*defined(HAVE_POPPLER) && !defined(POPPLER_MODULE)*/ + + #ifdef HAVE_PDFIUM +- vips_foreign_load_pdf_file_get_type(); +- vips_foreign_load_pdf_buffer_get_type(); +- vips_foreign_load_pdf_source_get_type(); ++ vips_foreign_load_pdf_file_get_type(); ++ vips_foreign_load_pdf_buffer_get_type(); ++ vips_foreign_load_pdf_source_get_type(); + #endif /*HAVE_PDFIUM*/ + + #ifdef HAVE_RSVG +- vips_foreign_load_svg_file_get_type(); +- vips_foreign_load_svg_buffer_get_type(); +- vips_foreign_load_svg_source_get_type(); ++ vips_foreign_load_svg_file_get_type(); ++ vips_foreign_load_svg_buffer_get_type(); ++ vips_foreign_load_svg_source_get_type(); + #endif /*HAVE_RSVG*/ + + #if defined(HAVE_LIBJXL) && !defined(LIBJXL_MODULE) +- vips_foreign_load_jxl_file_get_type(); +- vips_foreign_load_jxl_buffer_get_type(); +- vips_foreign_load_jxl_source_get_type(); +- vips_foreign_save_jxl_file_get_type(); +- vips_foreign_save_jxl_buffer_get_type(); +- vips_foreign_save_jxl_target_get_type(); ++ vips_foreign_load_jxl_file_get_type(); ++ vips_foreign_load_jxl_buffer_get_type(); ++ vips_foreign_load_jxl_source_get_type(); ++ vips_foreign_save_jxl_file_get_type(); ++ vips_foreign_save_jxl_buffer_get_type(); ++ vips_foreign_save_jxl_target_get_type(); + #endif /*defined(HAVE_LIBJXL) && !defined(LIBJXL_MODULE)*/ + + #ifdef HAVE_LIBOPENJP2 +- vips_foreign_load_jp2k_file_get_type(); +- vips_foreign_load_jp2k_buffer_get_type(); +- vips_foreign_load_jp2k_source_get_type(); +- vips_foreign_save_jp2k_file_get_type(); +- vips_foreign_save_jp2k_buffer_get_type(); +- vips_foreign_save_jp2k_target_get_type(); ++ vips_foreign_load_jp2k_file_get_type(); ++ vips_foreign_load_jp2k_buffer_get_type(); ++ vips_foreign_load_jp2k_source_get_type(); ++ vips_foreign_save_jp2k_file_get_type(); ++ vips_foreign_save_jp2k_buffer_get_type(); ++ vips_foreign_save_jp2k_target_get_type(); + #endif /*HAVE_LIBOPENJP2*/ + + #ifdef HAVE_NSGIF + vips_foreign_load_nsgif_file_get_type(); +- vips_foreign_load_nsgif_buffer_get_type(); +- vips_foreign_load_nsgif_source_get_type(); ++ vips_foreign_load_nsgif_buffer_get_type(); ++ vips_foreign_load_nsgif_source_get_type(); + #endif /*HAVE_NSGIF*/ + + #ifdef HAVE_CGIF +@@ -3044,65 +3034,65 @@ vips_foreign_operation_init( void ) + #endif /*HAVE_CGIF*/ + + #ifdef HAVE_GSF +- vips_foreign_save_dz_file_get_type(); +- vips_foreign_save_dz_buffer_get_type(); +- vips_foreign_save_dz_target_get_type(); ++ vips_foreign_save_dz_file_get_type(); ++ vips_foreign_save_dz_buffer_get_type(); ++ vips_foreign_save_dz_target_get_type(); + #endif /*HAVE_GSF*/ + + #ifdef HAVE_PNG +- vips_foreign_load_png_file_get_type(); +- vips_foreign_load_png_buffer_get_type(); +- vips_foreign_load_png_source_get_type(); +- vips_foreign_save_png_file_get_type(); +- vips_foreign_save_png_buffer_get_type(); +- vips_foreign_save_png_target_get_type(); ++ vips_foreign_load_png_file_get_type(); ++ vips_foreign_load_png_buffer_get_type(); ++ vips_foreign_load_png_source_get_type(); ++ vips_foreign_save_png_file_get_type(); ++ vips_foreign_save_png_buffer_get_type(); ++ vips_foreign_save_png_target_get_type(); + #endif /*HAVE_PNG*/ + + #ifdef HAVE_SPNG +- vips_foreign_load_png_file_get_type(); +- vips_foreign_load_png_buffer_get_type(); +- vips_foreign_load_png_source_get_type(); +- vips_foreign_save_spng_file_get_type(); +- vips_foreign_save_spng_buffer_get_type(); +- vips_foreign_save_spng_target_get_type(); ++ vips_foreign_load_png_file_get_type(); ++ vips_foreign_load_png_buffer_get_type(); ++ vips_foreign_load_png_source_get_type(); ++ vips_foreign_save_spng_file_get_type(); ++ vips_foreign_save_spng_buffer_get_type(); ++ vips_foreign_save_spng_target_get_type(); + #endif /*HAVE_SPNG*/ + + #ifdef HAVE_MATIO +- vips_foreign_load_mat_get_type(); ++ vips_foreign_load_mat_get_type(); + #endif /*HAVE_MATIO*/ + + #ifdef HAVE_JPEG +- vips_foreign_load_jpeg_file_get_type(); +- vips_foreign_load_jpeg_buffer_get_type(); +- vips_foreign_load_jpeg_source_get_type(); +- vips_foreign_save_jpeg_file_get_type(); +- vips_foreign_save_jpeg_buffer_get_type(); +- vips_foreign_save_jpeg_target_get_type(); +- vips_foreign_save_jpeg_mime_get_type(); ++ vips_foreign_load_jpeg_file_get_type(); ++ vips_foreign_load_jpeg_buffer_get_type(); ++ vips_foreign_load_jpeg_source_get_type(); ++ vips_foreign_save_jpeg_file_get_type(); ++ vips_foreign_save_jpeg_buffer_get_type(); ++ vips_foreign_save_jpeg_target_get_type(); ++ vips_foreign_save_jpeg_mime_get_type(); + #endif /*HAVE_JPEG*/ + + #ifdef HAVE_LIBWEBP +- vips_foreign_load_webp_file_get_type(); +- vips_foreign_load_webp_buffer_get_type(); +- vips_foreign_load_webp_source_get_type(); +- vips_foreign_save_webp_file_get_type(); +- vips_foreign_save_webp_buffer_get_type(); +- vips_foreign_save_webp_target_get_type(); ++ vips_foreign_load_webp_file_get_type(); ++ vips_foreign_load_webp_buffer_get_type(); ++ vips_foreign_load_webp_source_get_type(); ++ vips_foreign_save_webp_file_get_type(); ++ vips_foreign_save_webp_buffer_get_type(); ++ vips_foreign_save_webp_target_get_type(); + vips_foreign_save_webp_mime_get_type(); + #endif /*HAVE_LIBWEBP*/ + + #ifdef HAVE_TIFF +- vips_foreign_load_tiff_file_get_type(); +- vips_foreign_load_tiff_buffer_get_type(); +- vips_foreign_load_tiff_source_get_type(); +- vips_foreign_save_tiff_file_get_type(); +- vips_foreign_save_tiff_buffer_get_type(); +- vips_foreign_save_tiff_target_get_type(); ++ vips_foreign_load_tiff_file_get_type(); ++ vips_foreign_load_tiff_buffer_get_type(); ++ vips_foreign_load_tiff_source_get_type(); ++ vips_foreign_save_tiff_file_get_type(); ++ vips_foreign_save_tiff_buffer_get_type(); ++ vips_foreign_save_tiff_target_get_type(); + #endif /*HAVE_TIFF*/ + + #if defined(HAVE_OPENSLIDE) && !defined(OPENSLIDE_MODULE) +- vips_foreign_load_openslide_file_get_type(); +- vips_foreign_load_openslide_source_get_type(); ++ vips_foreign_load_openslide_file_get_type(); ++ vips_foreign_load_openslide_source_get_type(); + #endif /*defined(HAVE_OPENSLIDE) && !defined(OPENSLIDE_MODULE)*/ + + #if defined(ENABLE_MAGICKLOAD) && !defined(MAGICK_MODULE) +@@ -3127,34 +3117,34 @@ vips_foreign_operation_init( void ) + #endif /*defined(ENABLE_MAGICKSAVE) && !defined(MAGICK_MODULE)*/ + + #ifdef HAVE_CFITSIO +- vips_foreign_load_fits_file_get_type(); +- vips_foreign_load_fits_source_get_type(); +- vips_foreign_save_fits_get_type(); ++ vips_foreign_load_fits_file_get_type(); ++ vips_foreign_load_fits_source_get_type(); ++ vips_foreign_save_fits_get_type(); + #endif /*HAVE_CFITSIO*/ + + #ifdef HAVE_OPENEXR +- vips_foreign_load_openexr_get_type(); ++ vips_foreign_load_openexr_get_type(); + #endif /*HAVE_OPENEXR*/ + + #ifdef HAVE_NIFTI +- vips_foreign_load_nifti_file_get_type(); +- vips_foreign_load_nifti_source_get_type(); +- vips_foreign_save_nifti_get_type(); ++ vips_foreign_load_nifti_file_get_type(); ++ vips_foreign_load_nifti_source_get_type(); ++ vips_foreign_save_nifti_get_type(); + #endif /*HAVE_NIFTI*/ + + #if defined(HAVE_HEIF_DECODER) && !defined(HEIF_MODULE) +- vips_foreign_load_heif_file_get_type(); +- vips_foreign_load_heif_buffer_get_type(); +- vips_foreign_load_heif_source_get_type(); ++ vips_foreign_load_heif_file_get_type(); ++ vips_foreign_load_heif_buffer_get_type(); ++ vips_foreign_load_heif_source_get_type(); + #endif /*defined(HAVE_HEIF_DECODER) && !defined(HEIF_MODULE)*/ + + #if defined(HAVE_HEIF_ENCODER) && !defined(HEIF_MODULE) +- vips_foreign_save_heif_file_get_type(); +- vips_foreign_save_heif_buffer_get_type(); +- vips_foreign_save_heif_target_get_type(); ++ vips_foreign_save_heif_file_get_type(); ++ vips_foreign_save_heif_buffer_get_type(); ++ vips_foreign_save_heif_target_get_type(); + vips_foreign_save_avif_target_get_type(); + #endif /*defined(HAVE_HEIF_ENCODER) && !defined(HEIF_MODULE)*/ + +- vips__foreign_load_operation = +- g_quark_from_static_string( "vips-foreign-load-operation" ); ++ vips__foreign_load_operation = ++ g_quark_from_static_string("vips-foreign-load-operation"); + } +diff --git a/libvips/foreign/heifload.c b/libvips/foreign/heifload.c +index 83aed76d68..f467190216 100644 +--- a/libvips/foreign/heifload.c ++++ b/libvips/foreign/heifload.c +@@ -5,7 +5,7 @@ + * 24/7/19 [zhoux2016] + * - always fetch metadata from the main image (thumbs don't have it) + * 24/7/19 +- * - close early on minimise ++ * - close early on minimise + * - close early on error + * 1/9/19 [meyermarcel] + * - handle alpha +@@ -30,28 +30,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -91,11 +91,11 @@ const char *vips__avif_suffs[] = { + NULL + }; + +-const char *vips__heif_suffs[] = { ++const char *vips__heif_suffs[] = { + ".heic", + ".heif", + ".avif", +- NULL ++ NULL + }; + + #endif /*defined(HAVE_HEIF_DECODER) || defined(HAVE_HEIF_ENCODER)*/ +@@ -105,19 +105,19 @@ const char *vips__heif_suffs[] = { + #include + + #define VIPS_TYPE_FOREIGN_LOAD_HEIF (vips_foreign_load_heif_get_type()) +-#define VIPS_FOREIGN_LOAD_HEIF( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_FOREIGN_LOAD_HEIF, VipsForeignLoadHeif )) +-#define VIPS_FOREIGN_LOAD_HEIF_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_FOREIGN_LOAD_HEIF, VipsForeignLoadHeifClass)) +-#define VIPS_IS_FOREIGN_LOAD_HEIF( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_FOREIGN_LOAD_HEIF )) +-#define VIPS_IS_FOREIGN_LOAD_HEIF_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_FOREIGN_LOAD_HEIF )) +-#define VIPS_FOREIGN_LOAD_HEIF_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_FOREIGN_LOAD_HEIF, VipsForeignLoadHeifClass )) ++#define VIPS_FOREIGN_LOAD_HEIF(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_FOREIGN_LOAD_HEIF, VipsForeignLoadHeif)) ++#define VIPS_FOREIGN_LOAD_HEIF_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_FOREIGN_LOAD_HEIF, VipsForeignLoadHeifClass)) ++#define VIPS_IS_FOREIGN_LOAD_HEIF(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_FOREIGN_LOAD_HEIF)) ++#define VIPS_IS_FOREIGN_LOAD_HEIF_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_FOREIGN_LOAD_HEIF)) ++#define VIPS_FOREIGN_LOAD_HEIF_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_FOREIGN_LOAD_HEIF, VipsForeignLoadHeifClass)) + + typedef struct _VipsForeignLoadHeif { + VipsForeignLoad parent_object; +@@ -157,7 +157,7 @@ typedef struct _VipsForeignLoadHeif { + */ + gboolean has_alpha; + +- /* Size of final output image. ++ /* Size of final output image. + */ + int width; + int height; +@@ -171,11 +171,11 @@ typedef struct _VipsForeignLoadHeif { + */ + int bits_per_pixel; + +- /* The page number currently in @handle. ++ /* The page number currently in @handle. + */ + int page_no; + +- /* TRUE if @handle has selected the thumbnail rather than the main ++ /* TRUE if @handle has selected the thumbnail rather than the main + * image. + */ + gboolean thumbnail_set; +@@ -214,11 +214,11 @@ typedef struct _VipsForeignLoadHeif { + } VipsForeignLoadHeif; + + void +-vips__heif_error( struct heif_error *error ) ++vips__heif_error(struct heif_error *error) + { +- if( error->code ) +- vips_error( "heif", "%s (%d.%d)", error->message, error->code, +- error->subcode ); ++ if (error->code) ++ vips_error("heif", "%s (%d.%d)", error->message, error->code, ++ error->subcode); + } + + typedef struct _VipsForeignLoadHeifClass { +@@ -226,72 +226,70 @@ typedef struct _VipsForeignLoadHeifClass { + + } VipsForeignLoadHeifClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadHeif, vips_foreign_load_heif, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadHeif, vips_foreign_load_heif, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_heif_dispose( GObject *gobject ) ++vips_foreign_load_heif_dispose(GObject *gobject) + { + VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) gobject; + + heif->data = NULL; +- VIPS_FREEF( heif_image_release, heif->img ); +- VIPS_FREEF( heif_image_handle_release, heif->handle ); +- VIPS_FREEF( heif_context_free, heif->ctx ); +- VIPS_FREE( heif->id ); +- VIPS_FREE( heif->reader ); +- VIPS_UNREF( heif->source ); +- +- G_OBJECT_CLASS( vips_foreign_load_heif_parent_class )-> +- dispose( gobject ); ++ VIPS_FREEF(heif_image_release, heif->img); ++ VIPS_FREEF(heif_image_handle_release, heif->handle); ++ VIPS_FREEF(heif_context_free, heif->ctx); ++ VIPS_FREE(heif->id); ++ VIPS_FREE(heif->reader); ++ VIPS_UNREF(heif->source); ++ ++ G_OBJECT_CLASS(vips_foreign_load_heif_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_load_heif_build( VipsObject *object ) ++vips_foreign_load_heif_build(VipsObject *object) + { + VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) object; + + #ifdef DEBUG +- printf( "vips_foreign_load_heif_build:\n" ); ++ printf("vips_foreign_load_heif_build:\n"); + #endif /*DEBUG*/ + +- if( heif->source && +- vips_source_rewind( heif->source ) ) +- return( -1 ); ++ if (heif->source && ++ vips_source_rewind(heif->source)) ++ return (-1); + +- if( !heif->ctx ) { ++ if (!heif->ctx) { + struct heif_error error; + + heif->ctx = heif_context_alloc(); + #ifdef HAVE_HEIF_SET_MAX_IMAGE_SIZE_LIMIT +- heif_context_set_maximum_image_size_limit( heif->ctx, +- heif->unlimited ? USHRT_MAX : 0x4000 ); ++ heif_context_set_maximum_image_size_limit(heif->ctx, ++ heif->unlimited ? USHRT_MAX : 0x4000); + #endif /* HAVE_HEIF_SET_MAX_IMAGE_SIZE_LIMIT */ +- error = heif_context_read_from_reader( heif->ctx, +- heif->reader, heif, NULL ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ error = heif_context_read_from_reader(heif->ctx, ++ heif->reader, heif, NULL); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_heif_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_heif_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static const char *heif_magic[] = { +- "ftypheic", /* A regular heif image */ +- "ftypheix", /* Extended range (>8 bit) image */ +- "ftyphevc", /* Image sequence */ +- "ftypheim", /* Image sequence */ +- "ftypheis", /* Scaleable image */ +- "ftyphevm", /* Multiview sequence */ +- "ftyphevs", /* Scaleable sequence */ +- "ftypmif1", /* Nokia alpha_ image */ +- "ftypmsf1", /* Nokia animation image */ ++ "ftypheic", /* A regular heif image */ ++ "ftypheix", /* Extended range (>8 bit) image */ ++ "ftyphevc", /* Image sequence */ ++ "ftypheim", /* Image sequence */ ++ "ftypheis", /* Scaleable image */ ++ "ftyphevm", /* Multiview sequence */ ++ "ftyphevs", /* Scaleable sequence */ ++ "ftypmif1", /* Nokia alpha_ image */ ++ "ftypmsf1", /* Nokia animation image */ + "ftypavif" /* AV1 image format */ + }; + +@@ -303,45 +301,45 @@ static const char *heif_magic[] = { + * types. + */ + static int +-vips_foreign_load_heif_is_a( const char *buf, int len ) ++vips_foreign_load_heif_is_a(const char *buf, int len) + { +- if( len >= 12 ) { +- unsigned char *p = (unsigned char *) buf; +- guint32 chunk_len = +- VIPS_LSHIFT_INT( p[0], 24 ) | +- VIPS_LSHIFT_INT( p[1], 16 ) | +- VIPS_LSHIFT_INT( p[2], 8 ) | +- VIPS_LSHIFT_INT( p[3], 0 ); ++ if (len >= 12) { ++ unsigned char *p = (unsigned char *) buf; ++ guint32 chunk_len = ++ VIPS_LSHIFT_INT(p[0], 24) | ++ VIPS_LSHIFT_INT(p[1], 16) | ++ VIPS_LSHIFT_INT(p[2], 8) | ++ VIPS_LSHIFT_INT(p[3], 0); + + int i; + +- /* chunk_len can be pretty big for eg. animated AVIF. +- */ +- if( chunk_len > 2048 || +- chunk_len % 4 != 0 ) +- return( 0 ); ++ /* chunk_len can be pretty big for eg. animated AVIF. ++ */ ++ if (chunk_len > 2048 || ++ chunk_len % 4 != 0) ++ return (0); + +- for( i = 0; i < VIPS_NUMBER( heif_magic ); i++ ) +- if( strncmp( buf + 4, heif_magic[i], 8 ) == 0 ) +- return( 1 ); ++ for (i = 0; i < VIPS_NUMBER(heif_magic); i++) ++ if (strncmp(buf + 4, heif_magic[i], 8) == 0) ++ return (1); + } + +- return( 0 ); ++ return (0); + } + + static VipsForeignFlags +-vips_foreign_load_heif_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_heif_get_flags(VipsForeignLoad *load) + { + /* FIXME .. could support random access for grid images. + */ +- return( VIPS_FOREIGN_SEQUENTIAL ); ++ return (VIPS_FOREIGN_SEQUENTIAL); + } + +-/* We've selected the page. Try to select the associated thumbnail instead, ++/* We've selected the page. Try to select the associated thumbnail instead, + * if we can. + */ + static int +-vips_foreign_load_heif_set_thumbnail( VipsForeignLoadHeif *heif ) ++vips_foreign_load_heif_set_thumbnail(VipsForeignLoadHeif *heif) + { + heif_item_id thumb_ids[1]; + int n_thumbs; +@@ -352,96 +350,96 @@ vips_foreign_load_heif_set_thumbnail( VipsForeignLoadHeif *heif ) + double thumb_aspect; + + #ifdef DEBUG +- printf( "vips_foreign_load_heif_set_thumbnail:\n" ); ++ printf("vips_foreign_load_heif_set_thumbnail:\n"); + #endif /*DEBUG*/ + +- n_thumbs = heif_image_handle_get_list_of_thumbnail_IDs( +- heif->handle, thumb_ids, 1 ); +- if( n_thumbs == 0 ) +- return( 0 ); ++ n_thumbs = heif_image_handle_get_list_of_thumbnail_IDs( ++ heif->handle, thumb_ids, 1); ++ if (n_thumbs == 0) ++ return (0); + +- error = heif_image_handle_get_thumbnail( heif->handle, +- thumb_ids[0], &thumb_handle ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ error = heif_image_handle_get_thumbnail(heif->handle, ++ thumb_ids[0], &thumb_handle); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + + /* Just checking the width and height of the handle isn't +- * enough -- we have to experimentally decode it and test the +- * decoded dimensions. ++ * enough -- we have to experimentally decode it and test the ++ * decoded dimensions. + */ +- error = heif_decode_image( thumb_handle, &thumb_img, +- heif_colorspace_RGB, ++ error = heif_decode_image(thumb_handle, &thumb_img, ++ heif_colorspace_RGB, + heif_chroma_interleaved_RGB, +- NULL ); +- if( error.code ) { +- VIPS_FREEF( heif_image_handle_release, thumb_handle ); +- vips__heif_error( &error ); +- return( -1 ); ++ NULL); ++ if (error.code) { ++ VIPS_FREEF(heif_image_handle_release, thumb_handle); ++ vips__heif_error(&error); ++ return (-1); + } + +- thumb_aspect = (double) +- heif_image_get_width( thumb_img, heif_channel_interleaved ) / +- heif_image_get_height( thumb_img, heif_channel_interleaved ); ++ thumb_aspect = (double) ++ heif_image_get_width(thumb_img, heif_channel_interleaved) / ++ heif_image_get_height(thumb_img, heif_channel_interleaved); + +- VIPS_FREEF( heif_image_release, thumb_img ); ++ VIPS_FREEF(heif_image_release, thumb_img); + +- main_aspect = (double) +- heif_image_handle_get_width( heif->handle ) / +- heif_image_handle_get_height( heif->handle ); ++ main_aspect = (double) ++ heif_image_handle_get_width(heif->handle) / ++ heif_image_handle_get_height(heif->handle); + +- /* The bug we are working around has decoded thumbs as 512x512 +- * with the main image as 6kx4k, so a 0.1 threshold is more ++ /* The bug we are working around has decoded thumbs as 512x512 ++ * with the main image as 6kx4k, so a 0.1 threshold is more + * than tight enough to spot the error. + */ +- if( fabs( main_aspect - thumb_aspect ) > 0.1 ) { +- VIPS_FREEF( heif_image_handle_release, thumb_handle ); +- return( 0 ); ++ if (fabs(main_aspect - thumb_aspect) > 0.1) { ++ VIPS_FREEF(heif_image_handle_release, thumb_handle); ++ return (0); + } + +- VIPS_FREEF( heif_image_handle_release, heif->handle ); ++ VIPS_FREEF(heif_image_handle_release, heif->handle); + heif->handle = thumb_handle; + +- return( 0 ); ++ return (0); + } + + /* Select a page. If thumbnail is set, select the thumbnail for that page, if + * there is one. + */ + static int +-vips_foreign_load_heif_set_page( VipsForeignLoadHeif *heif, +- int page_no, gboolean thumbnail ) ++vips_foreign_load_heif_set_page(VipsForeignLoadHeif *heif, ++ int page_no, gboolean thumbnail) + { +- if( !heif->handle || ++ if (!heif->handle || + page_no != heif->page_no || +- thumbnail != heif->thumbnail_set ) { ++ thumbnail != heif->thumbnail_set) { + struct heif_error error; + + #ifdef DEBUG +- printf( "vips_foreign_load_heif_set_page: %d, thumbnail = %d\n", +- page_no, thumbnail ); ++ printf("vips_foreign_load_heif_set_page: %d, thumbnail = %d\n", ++ page_no, thumbnail); + #endif /*DEBUG*/ + +- VIPS_FREEF( heif_image_handle_release, heif->handle ); +- VIPS_FREEF( heif_image_release, heif->img ); ++ VIPS_FREEF(heif_image_handle_release, heif->handle); ++ VIPS_FREEF(heif_image_release, heif->img); + heif->data = NULL; + heif->thumbnail_set = FALSE; + +- error = heif_context_get_image_handle( heif->ctx, +- heif->id[page_no], &heif->handle ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ error = heif_context_get_image_handle(heif->ctx, ++ heif->id[page_no], &heif->handle); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + +- if( thumbnail ) { +- if( vips_foreign_load_heif_set_thumbnail( heif ) ) +- return( -1 ); ++ if (thumbnail) { ++ if (vips_foreign_load_heif_set_thumbnail(heif)) ++ return (-1); + + /* If we were asked to select the thumbnail, say we + * did, even if there are no thumbnails and we just +- * selected the main image. ++ * selected the main image. + * + * If we don't do this, next time around in _generate + * we'll try to select the thumbnail again, which will +@@ -453,11 +451,11 @@ vips_foreign_load_heif_set_page( VipsForeignLoadHeif *heif, + heif->page_no = page_no; + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_heif_set_header( VipsForeignLoadHeif *heif, VipsImage *out ) ++vips_foreign_load_heif_set_header(VipsForeignLoadHeif *heif, VipsImage *out) + { + VipsForeignLoad *load = (VipsForeignLoad *) heif; + +@@ -472,65 +470,65 @@ vips_foreign_load_heif_set_header( VipsForeignLoadHeif *heif, VipsImage *out ) + VipsInterpretation interpretation; + VipsBandFormat format; + +- /* We take the metadata from the non-thumbnail first page. HEIC ++ /* We take the metadata from the non-thumbnail first page. HEIC + * thumbnails don't have metadata. + */ +- if( vips_foreign_load_heif_set_page( heif, heif->page, FALSE ) ) +- return( -1 ); ++ if (vips_foreign_load_heif_set_page(heif, heif->page, FALSE)) ++ return (-1); + + /* Verify dimensions + */ +- if( heif->page_width < 1 || +- heif->page_height < 1 ) { +- vips_error( "heifload", "%s", _( "bad dimensions" ) ); +- return( -1 ); ++ if (heif->page_width < 1 || ++ heif->page_height < 1) { ++ vips_error("heifload", "%s", _("bad dimensions")); ++ return (-1); + } + +- heif->has_alpha = heif_image_handle_has_alpha_channel( heif->handle ); ++ heif->has_alpha = heif_image_handle_has_alpha_channel(heif->handle); + #ifdef DEBUG +- printf( "heif_image_handle_has_alpha_channel() = %d\n", +- heif->has_alpha ); ++ printf("heif_image_handle_has_alpha_channel() = %d\n", ++ heif->has_alpha); + #endif /*DEBUG*/ + bands = heif->has_alpha ? 4 : 3; + + #ifdef DEBUG +- printf( "heif_image_handle_get_luma_bits_per_pixel() = %d\n", +- heif_image_handle_get_luma_bits_per_pixel( heif->handle ) ); ++ printf("heif_image_handle_get_luma_bits_per_pixel() = %d\n", ++ heif_image_handle_get_luma_bits_per_pixel(heif->handle)); + #endif /*DEBUG*/ + + /* FIXME .. IPTC as well? + */ +- n_metadata = heif_image_handle_get_list_of_metadata_block_IDs( +- heif->handle, NULL, id, VIPS_NUMBER( id ) ); +- for( i = 0; i < n_metadata; i++ ) { +- size_t length = heif_image_handle_get_metadata_size( +- heif->handle, id[i] ); +- const char *type = heif_image_handle_get_metadata_type( +- heif->handle, id[i] ); ++ n_metadata = heif_image_handle_get_list_of_metadata_block_IDs( ++ heif->handle, NULL, id, VIPS_NUMBER(id)); ++ for (i = 0; i < n_metadata; i++) { ++ size_t length = heif_image_handle_get_metadata_size( ++ heif->handle, id[i]); ++ const char *type = heif_image_handle_get_metadata_type( ++ heif->handle, id[i]); + + unsigned char *data; + char name[256]; + + #ifdef DEBUG +- printf( "metadata type = %s, length = %zu\n", type, length ); ++ printf("metadata type = %s, length = %zu\n", type, length); + #endif /*DEBUG*/ + +- if( !length ) ++ if (!length) + continue; +- if( !(data = VIPS_ARRAY( out, length, unsigned char )) ) +- return( -1 ); +- error = heif_image_handle_get_metadata( +- heif->handle, id[i], data ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ if (!(data = VIPS_ARRAY(out, length, unsigned char))) ++ return (-1); ++ error = heif_image_handle_get_metadata( ++ heif->handle, id[i], data); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + + /* We need to skip the first four bytes of EXIF, they just + * contain the offset. + */ +- if( length > 4 && +- g_ascii_strcasecmp( type, "exif" ) == 0 ) { ++ if (length > 4 && ++ g_ascii_strcasecmp(type, "exif") == 0) { + data += 4; + length -= 4; + } +@@ -540,17 +538,17 @@ vips_foreign_load_heif_set_header( VipsForeignLoadHeif *heif, VipsImage *out ) + * XMP metadata is just attached with the "mime" type, and + * usually start with " 10 && +- vips_isprefix( "handle ); ++ enum heif_color_profile_type profile_type = ++ heif_image_handle_get_color_profile_type(heif->handle); + + #ifdef DEBUG +-{ +- printf( "profile type = " ); +- switch( profile_type ) { +- case heif_color_profile_type_not_present: +- printf( "none" ); +- break; +- +- case heif_color_profile_type_nclx: +- printf( "nclx" ); +- break; +- +- case heif_color_profile_type_rICC: +- printf( "rICC" ); +- break; +- +- case heif_color_profile_type_prof: +- printf( "prof" ); +- break; +- +- default: +- printf( "unknown" ); +- break; ++ { ++ printf("profile type = "); ++ switch (profile_type) { ++ case heif_color_profile_type_not_present: ++ printf("none"); ++ break; ++ ++ case heif_color_profile_type_nclx: ++ printf("nclx"); ++ break; ++ ++ case heif_color_profile_type_rICC: ++ printf("rICC"); ++ break; ++ ++ case heif_color_profile_type_prof: ++ printf("prof"); ++ break; ++ ++ default: ++ printf("unknown"); ++ break; ++ } ++ printf("\n"); + } +- printf( "\n" ); +-} + #endif /*DEBUG*/ + + /* lcms can load standard (prof) and reduced (rICC) profiles + */ +- if( profile_type == heif_color_profile_type_prof || +- profile_type == heif_color_profile_type_rICC ) { +- size_t length = heif_image_handle_get_raw_color_profile_size( +- heif->handle ); ++ if (profile_type == heif_color_profile_type_prof || ++ profile_type == heif_color_profile_type_rICC) { ++ size_t length = heif_image_handle_get_raw_color_profile_size( ++ heif->handle); + + unsigned char *data; + +- if( !(data = VIPS_ARRAY( out, length, unsigned char )) ) +- return( -1 ); +- error = heif_image_handle_get_raw_color_profile( +- heif->handle, data ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ if (!(data = VIPS_ARRAY(out, length, unsigned char))) ++ return (-1); ++ error = heif_image_handle_get_raw_color_profile( ++ heif->handle, data); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + + #ifdef DEBUG +- printf( "profile data, length = %zd\n", length ); ++ printf("profile data, length = %zd\n", length); + #endif /*DEBUG*/ + +- vips_image_set_blob( out, VIPS_META_ICC_NAME, +- (VipsCallbackFn) NULL, data, length ); ++ vips_image_set_blob(out, VIPS_META_ICC_NAME, ++ (VipsCallbackFn) NULL, data, length); + } +- else if( profile_type == heif_color_profile_type_nclx ) { +- g_warning( "heifload: ignoring nclx profile" ); ++ else if (profile_type == heif_color_profile_type_nclx) { ++ g_warning("heifload: ignoring nclx profile"); + } + #endif /*HAVE_HEIF_COLOR_PROFILE*/ + +- vips_image_set_int( out, "heif-primary", heif->primary_page ); +- vips_image_set_int( out, VIPS_META_N_PAGES, heif->n_top ); ++ vips_image_set_int(out, "heif-primary", heif->primary_page); ++ vips_image_set_int(out, VIPS_META_N_PAGES, heif->n_top); + + /* Only set page-height if we have more than one page, or this could + * accidentally turn into an animated image later. + */ +- if( heif->n > 1 ) +- vips_image_set_int( out, +- VIPS_META_PAGE_HEIGHT, heif->page_height ); ++ if (heif->n > 1) ++ vips_image_set_int(out, ++ VIPS_META_PAGE_HEIGHT, heif->page_height); + + /* Determine compression from HEIF "brand". heif_avif and heif_avis + * were added in v1.7. +@@ -644,26 +642,26 @@ vips_foreign_load_heif_set_header( VipsForeignLoadHeif *heif, VipsImage *out ) + compression = VIPS_FOREIGN_HEIF_COMPRESSION_HEVC; + + #ifdef HAVE_HEIF_AVIF +-{ +- const unsigned char *brand_data; +- +- if( (brand_data = vips_source_sniff( heif->source, 12 )) ) { +- enum heif_brand brand; +- brand = heif_main_brand( brand_data, 12 ); +- if( brand == heif_avif || +- brand == heif_avis ) +- compression = VIPS_FOREIGN_HEIF_COMPRESSION_AV1; ++ { ++ const unsigned char *brand_data; ++ ++ if ((brand_data = vips_source_sniff(heif->source, 12))) { ++ enum heif_brand brand; ++ brand = heif_main_brand(brand_data, 12); ++ if (brand == heif_avif || ++ brand == heif_avis) ++ compression = VIPS_FOREIGN_HEIF_COMPRESSION_AV1; ++ } + } +-} + #endif /*HAVE_HEIF_AVIF*/ + +- vips_image_set_string( out, "heif-compression", +- vips_enum_nick( VIPS_TYPE_FOREIGN_HEIF_COMPRESSION, +- compression ) ); ++ vips_image_set_string(out, "heif-compression", ++ vips_enum_nick(VIPS_TYPE_FOREIGN_HEIF_COMPRESSION, ++ compression)); + +- vips_image_set_int( out, "heif-bitdepth", heif->bits_per_pixel ); ++ vips_image_set_int(out, "heif-bitdepth", heif->bits_per_pixel); + +- if( heif->bits_per_pixel > 8 ) { ++ if (heif->bits_per_pixel > 8) { + interpretation = VIPS_INTERPRETATION_RGB16; + format = VIPS_FORMAT_USHORT; + } +@@ -673,25 +671,25 @@ vips_foreign_load_heif_set_header( VipsForeignLoadHeif *heif, VipsImage *out ) + } + + /* FIXME .. we always decode to RGB in generate. We should check for +- * all grey images, perhaps. ++ * all grey images, perhaps. + */ +- if( vips_image_pipelinev( out, VIPS_DEMAND_STYLE_THINSTRIP, NULL ) ) +- return( -1 ); +- vips_image_init_fields( out, +- heif->page_width, heif->page_height * heif->n, bands, +- format, VIPS_CODING_NONE, interpretation, +- 1.0, 1.0 ); ++ if (vips_image_pipelinev(out, VIPS_DEMAND_STYLE_THINSTRIP, NULL)) ++ return (-1); ++ vips_image_init_fields(out, ++ heif->page_width, heif->page_height * heif->n, bands, ++ format, VIPS_CODING_NONE, interpretation, ++ 1.0, 1.0); + +- VIPS_SETSTR( load->out->filename, +- vips_connection_filename( VIPS_CONNECTION( heif->source ) ) ); ++ VIPS_SETSTR(load->out->filename, ++ vips_connection_filename(VIPS_CONNECTION(heif->source))); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_heif_header( VipsForeignLoad *load ) ++vips_foreign_load_heif_header(VipsForeignLoad *load) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( load ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(load); + VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) load; + + struct heif_error error; +@@ -699,157 +697,153 @@ vips_foreign_load_heif_header( VipsForeignLoad *load ) + int i; + + #ifdef DEBUG +- printf( "vips_foreign_load_heif_header:\n" ); ++ printf("vips_foreign_load_heif_header:\n"); + #endif /*DEBUG*/ + +- heif->n_top = heif_context_get_number_of_top_level_images( heif->ctx ); +- heif->id = VIPS_ARRAY( NULL, heif->n_top, heif_item_id ); +- heif_context_get_list_of_top_level_image_IDs( heif->ctx, +- heif->id, heif->n_top ); ++ heif->n_top = heif_context_get_number_of_top_level_images(heif->ctx); ++ heif->id = VIPS_ARRAY(NULL, heif->n_top, heif_item_id); ++ heif_context_get_list_of_top_level_image_IDs(heif->ctx, ++ heif->id, heif->n_top); + + /* Note page number of primary image. + */ +- error = heif_context_get_primary_image_ID( heif->ctx, &primary_id ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ error = heif_context_get_primary_image_ID(heif->ctx, &primary_id); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } +- for( i = 0; i < heif->n_top; i++ ) +- if( heif->id[i] == primary_id ) ++ for (i = 0; i < heif->n_top; i++) ++ if (heif->id[i] == primary_id) + heif->primary_page = i; + + /* If @n and @page have not been set, @page defaults to the primary + * page. + */ +- if( !vips_object_argument_isset( VIPS_OBJECT( load ), "page" ) && +- !vips_object_argument_isset( VIPS_OBJECT( load ), "n" ) ) ++ if (!vips_object_argument_isset(VIPS_OBJECT(load), "page") && ++ !vips_object_argument_isset(VIPS_OBJECT(load), "n")) + heif->page = heif->primary_page; + +- if( heif->n == -1 ) ++ if (heif->n == -1) + heif->n = heif->n_top - heif->page; +- if( heif->page < 0 || ++ if (heif->page < 0 || + heif->n <= 0 || +- heif->page + heif->n > heif->n_top ) { +- vips_error( class->nickname, "%s", _( "bad page number" ) ); +- return( -1 ); ++ heif->page + heif->n > heif->n_top) { ++ vips_error(class->nickname, "%s", _("bad page number")); ++ return (-1); + } + + #ifdef DEBUG +- for( i = heif->page; i < heif->page + heif->n; i++ ) { ++ for (i = heif->page; i < heif->page + heif->n; i++) { + heif_item_id thumb_ids[1]; + int n_items; + int n_thumbs; + int j; + +- if( vips_foreign_load_heif_set_page( heif, i, FALSE ) ) +- return( -1 ); ++ if (vips_foreign_load_heif_set_page(heif, i, FALSE)) ++ return (-1); + +- n_thumbs = heif_image_handle_get_number_of_thumbnails( +- heif->handle ); +- n_items = heif_image_handle_get_list_of_thumbnail_IDs( +- heif->handle, thumb_ids, 1 ); ++ n_thumbs = heif_image_handle_get_number_of_thumbnails( ++ heif->handle); ++ n_items = heif_image_handle_get_list_of_thumbnail_IDs( ++ heif->handle, thumb_ids, 1); + +- printf( "page = %d\n", i ); +- printf( "n_thumbs = %d\n", n_thumbs ); +- printf( "n_items = %d\n", n_items ); ++ printf("page = %d\n", i); ++ printf("n_thumbs = %d\n", n_thumbs); ++ printf("n_items = %d\n", n_items); + +- for( j = 0; j < n_items; j++ ) { ++ for (j = 0; j < n_items; j++) { + struct heif_image_handle *thumb_handle; + +- error = heif_image_handle_get_thumbnail( heif->handle, +- thumb_ids[j], &thumb_handle ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ error = heif_image_handle_get_thumbnail(heif->handle, ++ thumb_ids[j], &thumb_handle); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + +- printf( " thumb %d\n", j ); +- printf( " width = %d\n", +- heif_image_handle_get_width( thumb_handle ) ); +- printf( " height = %d\n", +- heif_image_handle_get_height( thumb_handle ) ); +- printf( " bits_per_pixel = %d\n", +- heif_image_handle_get_luma_bits_per_pixel( +- thumb_handle ) ); +- ++ printf(" thumb %d\n", j); ++ printf(" width = %d\n", ++ heif_image_handle_get_width(thumb_handle)); ++ printf(" height = %d\n", ++ heif_image_handle_get_height(thumb_handle)); ++ printf(" bits_per_pixel = %d\n", ++ heif_image_handle_get_luma_bits_per_pixel( ++ thumb_handle)); + } + } + #endif /*DEBUG*/ + + /* All pages must be the same size for libvips toilet roll images. + */ +- if( vips_foreign_load_heif_set_page( heif, +- heif->page, heif->thumbnail ) ) +- return( -1 ); +- heif->page_width = heif_image_handle_get_width( heif->handle ); +- heif->page_height = heif_image_handle_get_height( heif->handle ); +- heif->bits_per_pixel = +- heif_image_handle_get_luma_bits_per_pixel( heif->handle ); +- if( heif->bits_per_pixel < 0 ) { +- vips_error( class->nickname, +- "%s", _( "undefined bits per pixel" ) ); +- return( -1 ); ++ if (vips_foreign_load_heif_set_page(heif, ++ heif->page, heif->thumbnail)) ++ return (-1); ++ heif->page_width = heif_image_handle_get_width(heif->handle); ++ heif->page_height = heif_image_handle_get_height(heif->handle); ++ heif->bits_per_pixel = ++ heif_image_handle_get_luma_bits_per_pixel(heif->handle); ++ if (heif->bits_per_pixel < 0) { ++ vips_error(class->nickname, ++ "%s", _("undefined bits per pixel")); ++ return (-1); + } + +- for( i = heif->page + 1; i < heif->page + heif->n; i++ ) { +- if( vips_foreign_load_heif_set_page( heif, +- i, heif->thumbnail ) ) +- return( -1 ); +- if( heif_image_handle_get_width( heif->handle ) +- != heif->page_width || +- heif_image_handle_get_height( heif->handle ) +- != heif->page_height || +- heif_image_handle_get_luma_bits_per_pixel( +- heif->handle ) +- != heif->bits_per_pixel ) { +- vips_error( class->nickname, "%s", +- _( "not all pages are the same size" ) ); +- return( -1 ); ++ for (i = heif->page + 1; i < heif->page + heif->n; i++) { ++ if (vips_foreign_load_heif_set_page(heif, ++ i, heif->thumbnail)) ++ return (-1); ++ if (heif_image_handle_get_width(heif->handle) != heif->page_width || ++ heif_image_handle_get_height(heif->handle) != heif->page_height || ++ heif_image_handle_get_luma_bits_per_pixel( ++ heif->handle) != heif->bits_per_pixel) { ++ vips_error(class->nickname, "%s", ++ _("not all pages are the same size")); ++ return (-1); + } + } + + #ifdef DEBUG +- printf( "page_width = %d\n", heif->page_width ); +- printf( "page_height = %d\n", heif->page_height ); +- printf( "bits_per_pixel = %d\n", heif->bits_per_pixel ); +- +- printf( "n_top = %d\n", heif->n_top ); +- for( i = 0; i < heif->n_top; i++ ) { +- printf( " id[%d] = %d\n", i, heif->id[i] ); +- if( vips_foreign_load_heif_set_page( heif, i, FALSE ) ) +- return( -1 ); +- printf( " width = %d\n", +- heif_image_handle_get_width( heif->handle ) ); +- printf( " height = %d\n", +- heif_image_handle_get_height( heif->handle ) ); +- printf( " bits_per_pixel = %d\n", +- heif_image_handle_get_luma_bits_per_pixel( heif->handle ) ); +- printf( " has_depth = %d\n", +- heif_image_handle_has_depth_image( heif->handle ) ); +- printf( " has_alpha = %d\n", +- heif_image_handle_has_alpha_channel( heif->handle ) ); +- printf( " n_metadata = %d\n", +- heif_image_handle_get_number_of_metadata_blocks( +- heif->handle, NULL ) ); ++ printf("page_width = %d\n", heif->page_width); ++ printf("page_height = %d\n", heif->page_height); ++ printf("bits_per_pixel = %d\n", heif->bits_per_pixel); ++ ++ printf("n_top = %d\n", heif->n_top); ++ for (i = 0; i < heif->n_top; i++) { ++ printf(" id[%d] = %d\n", i, heif->id[i]); ++ if (vips_foreign_load_heif_set_page(heif, i, FALSE)) ++ return (-1); ++ printf(" width = %d\n", ++ heif_image_handle_get_width(heif->handle)); ++ printf(" height = %d\n", ++ heif_image_handle_get_height(heif->handle)); ++ printf(" bits_per_pixel = %d\n", ++ heif_image_handle_get_luma_bits_per_pixel(heif->handle)); ++ printf(" has_depth = %d\n", ++ heif_image_handle_has_depth_image(heif->handle)); ++ printf(" has_alpha = %d\n", ++ heif_image_handle_has_alpha_channel(heif->handle)); ++ printf(" n_metadata = %d\n", ++ heif_image_handle_get_number_of_metadata_blocks( ++ heif->handle, NULL)); + #ifdef HAVE_HEIF_COLOR_PROFILE +- printf( " colour profile type = 0x%xd\n", +- heif_image_handle_get_color_profile_type( +- heif->handle ) ); ++ printf(" colour profile type = 0x%xd\n", ++ heif_image_handle_get_color_profile_type( ++ heif->handle)); + #endif /*HAVE_HEIF_COLOR_PROFILE*/ + } + #endif /*DEBUG*/ + +- if( vips_foreign_load_heif_set_header( heif, load->out ) ) +- return( -1 ); ++ if (vips_foreign_load_heif_set_header(heif, load->out)) ++ return (-1); + +- vips_source_minimise( heif->source ); ++ vips_source_minimise(heif->source); + +- return( 0 ); ++ return (0); + } + + #ifdef DEBUG + void +-vips__heif_image_print( struct heif_image *img ) ++vips__heif_image_print(struct heif_image *img) + { + const static enum heif_channel channel[] = { + heif_channel_Y, +@@ -875,18 +869,18 @@ vips__heif_image_print( struct heif_image *img ) + + int i; + +- printf( "vips__heif_image_print:\n" ); +- for( i = 0; i < VIPS_NUMBER( channel ); i++ ) { +- if( !heif_image_has_channel( img, channel[i] ) ) ++ printf("vips__heif_image_print:\n"); ++ for (i = 0; i < VIPS_NUMBER(channel); i++) { ++ if (!heif_image_has_channel(img, channel[i])) + continue; + +- printf( "\t%s:\n", channel_name[i] ); +- printf( "\t\twidth = %d\n", +- heif_image_get_width( img, channel[i] ) ); +- printf( "\t\theight = %d\n", +- heif_image_get_height( img, channel[i] ) ); +- printf( "\t\tbits = %d\n", +- heif_image_get_bits_per_pixel( img, channel[i] ) ); ++ printf("\t%s:\n", channel_name[i]); ++ printf("\t\twidth = %d\n", ++ heif_image_get_width(img, channel[i])); ++ printf("\t\theight = %d\n", ++ heif_image_get_height(img, channel[i])); ++ printf("\t\tbits = %d\n", ++ heif_image_get_bits_per_pixel(img, channel[i])); + } + } + #endif /*DEBUG*/ +@@ -894,105 +888,105 @@ vips__heif_image_print( struct heif_image *img ) + /* Pick a chroma format. Shared with heifsave. + */ + int +-vips__heif_chroma( int bits_per_pixel, gboolean has_alpha ) ++vips__heif_chroma(int bits_per_pixel, gboolean has_alpha) + { +- if( bits_per_pixel == 8 ) { +- if( has_alpha ) +- return( heif_chroma_interleaved_RGBA ); ++ if (bits_per_pixel == 8) { ++ if (has_alpha) ++ return (heif_chroma_interleaved_RGBA); + else +- return( heif_chroma_interleaved_RGB ); ++ return (heif_chroma_interleaved_RGB); + } + else { +- if( has_alpha ) +- return( heif_chroma_interleaved_RRGGBBAA_BE ); ++ if (has_alpha) ++ return (heif_chroma_interleaved_RRGGBBAA_BE); + else +- return( heif_chroma_interleaved_RRGGBB_BE ); ++ return (heif_chroma_interleaved_RRGGBB_BE); + } + } + + static int +-vips_foreign_load_heif_generate( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_foreign_load_heif_generate(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) a; +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( heif ); +- VipsRect *r = &or->valid; ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(heif); ++ VipsRect *r = & or->valid; + + int page = r->top / heif->page_height + heif->page; + int line = r->top % heif->page_height; + + #ifdef DEBUG_VERBOSE +- printf( "vips_foreign_load_heif_generate: line %d\n", r->top ); ++ printf("vips_foreign_load_heif_generate: line %d\n", r->top); + #endif /*DEBUG_VERBOSE*/ + +- g_assert( r->height == 1 ); ++ g_assert(r->height == 1); + +- if( vips_foreign_load_heif_set_page( heif, page, heif->thumbnail ) ) +- return( -1 ); ++ if (vips_foreign_load_heif_set_page(heif, page, heif->thumbnail)) ++ return (-1); + +- if( !heif->img ) { ++ if (!heif->img) { + struct heif_error error; + struct heif_decoding_options *options; +- enum heif_chroma chroma = +- vips__heif_chroma( heif->bits_per_pixel, +- heif->has_alpha ); ++ enum heif_chroma chroma = ++ vips__heif_chroma(heif->bits_per_pixel, ++ heif->has_alpha); + + options = heif_decoding_options_alloc(); +- error = heif_decode_image( heif->handle, &heif->img, +- heif_colorspace_RGB, +- chroma, +- options ); +- heif_decoding_options_free( options ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ error = heif_decode_image(heif->handle, &heif->img, ++ heif_colorspace_RGB, ++ chroma, ++ options); ++ heif_decoding_options_free(options); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + + #ifdef DEBUG +- vips__heif_image_print( heif->img ); ++ vips__heif_image_print(heif->img); + #endif /*DEBUG*/ + } + +- if( !heif->data ) { +- int image_width = heif_image_get_width( heif->img, +- heif_channel_interleaved ); +- int image_height = heif_image_get_height( heif->img, +- heif_channel_interleaved ); ++ if (!heif->data) { ++ int image_width = heif_image_get_width(heif->img, ++ heif_channel_interleaved); ++ int image_height = heif_image_get_height(heif->img, ++ heif_channel_interleaved); + + /* We can sometimes get inconsistency between the dimensions + * reported on the handle, and the final image we fetch. Error + * out to prevent a segv. + */ +- if( image_width != heif->page_width || +- image_height != heif->page_height ) { +- vips_error( class->nickname, +- "%s", _( "bad image dimensions on decode" ) ); +- return( -1 ); ++ if (image_width != heif->page_width || ++ image_height != heif->page_height) { ++ vips_error(class->nickname, ++ "%s", _("bad image dimensions on decode")); ++ return (-1); + } + +- if( !(heif->data = heif_image_get_plane_readonly( heif->img, +- heif_channel_interleaved, &heif->stride )) ) { +- vips_error( class->nickname, +- "%s", _( "unable to get image data" ) ); +- return( -1 ); ++ if (!(heif->data = heif_image_get_plane_readonly(heif->img, ++ heif_channel_interleaved, &heif->stride))) { ++ vips_error(class->nickname, ++ "%s", _("unable to get image data")); ++ return (-1); + } + } + +- memcpy( VIPS_REGION_ADDR( or, 0, r->top ), +- heif->data + heif->stride * line, +- VIPS_IMAGE_SIZEOF_LINE( or->im ) ); ++ memcpy(VIPS_REGION_ADDR(or, 0, r->top), ++ heif->data + heif->stride * line, ++ VIPS_IMAGE_SIZEOF_LINE(or->im)); + + /* We may need to swap bytes and shift to fill 16 bits. + */ +- if( heif->bits_per_pixel > 8 ) { ++ if (heif->bits_per_pixel > 8) { + int shift = 16 - heif->bits_per_pixel; +- int ne = VIPS_REGION_N_ELEMENTS( or ); ++ int ne = VIPS_REGION_N_ELEMENTS(or); + + int i; + VipsPel *p; + +- p = VIPS_REGION_ADDR( or, 0, r->top ); +- for( i = 0; i < ne; i++ ) { ++ p = VIPS_REGION_ADDR(or, 0, r->top); ++ for (i = 0; i < ne; i++) { + /* We've asked for big endian, we must write native. + */ + guint16 v = ((p[0] << 8) | p[1]) << shift; +@@ -1002,52 +996,52 @@ vips_foreign_load_heif_generate( VipsRegion *or, + } + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_heif_minimise( VipsObject *object, VipsForeignLoadHeif *heif ) ++vips_foreign_load_heif_minimise(VipsObject *object, VipsForeignLoadHeif *heif) + { +- vips_source_minimise( heif->source ); ++ vips_source_minimise(heif->source); + } + + static int +-vips_foreign_load_heif_load( VipsForeignLoad *load ) ++vips_foreign_load_heif_load(VipsForeignLoad *load) + { + VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) load; + +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( load ), 3 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(load), 3); + + #ifdef DEBUG +- printf( "vips_foreign_load_heif_load: loading image\n" ); ++ printf("vips_foreign_load_heif_load: loading image\n"); + #endif /*DEBUG*/ + + t[0] = vips_image_new(); +- if( vips_foreign_load_heif_set_header( heif, t[0] ) ) +- return( -1 ); ++ if (vips_foreign_load_heif_set_header(heif, t[0])) ++ return (-1); + + /* CLose input immediately at end of read. + */ +- g_signal_connect( t[0], "minimise", +- G_CALLBACK( vips_foreign_load_heif_minimise ), heif ); ++ g_signal_connect(t[0], "minimise", ++ G_CALLBACK(vips_foreign_load_heif_minimise), heif); + +- if( vips_image_generate( t[0], +- NULL, vips_foreign_load_heif_generate, NULL, heif, NULL ) || +- vips_sequential( t[0], &t[1], NULL ) || +- vips_image_write( t[1], load->real ) ) +- return( -1 ); ++ if (vips_image_generate(t[0], ++ NULL, vips_foreign_load_heif_generate, NULL, heif, NULL) || ++ vips_sequential(t[0], &t[1], NULL) || ++ vips_image_write(t[1], load->real)) ++ return (-1); + +- if( vips_source_decode( heif->source ) ) +- return( -1 ); ++ if (vips_source_decode(heif->source)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_heif_class_init( VipsForeignLoadHeifClass *class ) ++vips_foreign_load_heif_class_init(VipsForeignLoadHeifClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -1056,96 +1050,96 @@ vips_foreign_load_heif_class_init( VipsForeignLoadHeifClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "heifload_base"; +- object_class->description = _( "load a HEIF image" ); ++ object_class->description = _("load a HEIF image"); + object_class->build = vips_foreign_load_heif_build; + + load_class->get_flags = vips_foreign_load_heif_get_flags; + load_class->header = vips_foreign_load_heif_header; + load_class->load = vips_foreign_load_heif_load; + +- VIPS_ARG_INT( class, "page", 2, +- _( "Page" ), +- _( "First page to load" ), ++ VIPS_ARG_INT(class, "page", 2, ++ _("Page"), ++ _("First page to load"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadHeif, page ), +- 0, 100000, 0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadHeif, page), ++ 0, 100000, 0); + +- VIPS_ARG_INT( class, "n", 3, +- _( "n" ), +- _( "Number of pages to load, -1 for all" ), ++ VIPS_ARG_INT(class, "n", 3, ++ _("n"), ++ _("Number of pages to load, -1 for all"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadHeif, n ), +- -1, 100000, 1 ); ++ G_STRUCT_OFFSET(VipsForeignLoadHeif, n), ++ -1, 100000, 1); + +- VIPS_ARG_BOOL( class, "thumbnail", 4, +- _( "Thumbnail" ), +- _( "Fetch thumbnail image" ), ++ VIPS_ARG_BOOL(class, "thumbnail", 4, ++ _("Thumbnail"), ++ _("Fetch thumbnail image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadHeif, thumbnail ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignLoadHeif, thumbnail), ++ FALSE); + +- VIPS_ARG_BOOL( class, "autorotate", 21, +- _( "Autorotate" ), +- _( "Rotate image using exif orientation" ), ++ VIPS_ARG_BOOL(class, "autorotate", 21, ++ _("Autorotate"), ++ _("Rotate image using exif orientation"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignLoadHeif, autorotate ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignLoadHeif, autorotate), ++ FALSE); + +- VIPS_ARG_BOOL( class, "unlimited", 22, +- _( "Unlimited" ), +- _( "Remove all denial of service limits" ), ++ VIPS_ARG_BOOL(class, "unlimited", 22, ++ _("Unlimited"), ++ _("Remove all denial of service limits"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadHeif, unlimited ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignLoadHeif, unlimited), ++ FALSE); + } + + static gint64 +-vips_foreign_load_heif_get_position( void *userdata ) ++vips_foreign_load_heif_get_position(void *userdata) + { + VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) userdata; + +- return( vips_source_seek( heif->source, 0L, SEEK_CUR ) ); ++ return (vips_source_seek(heif->source, 0L, SEEK_CUR)); + } + +-/* libheif read() does not work like unix read(). ++/* libheif read() does not work like unix read(). + * +- * This method is cannot return EOF. Instead, the separate wait_for_file_size() ++ * This method is cannot return EOF. Instead, the separate wait_for_file_size() + * is called beforehand to make sure that there's enough data there. + */ + static int +-vips_foreign_load_heif_read( void *data, size_t size, void *userdata ) ++vips_foreign_load_heif_read(void *data, size_t size, void *userdata) + { + VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) userdata; + +- while( size > 0 ) { ++ while (size > 0) { + gint64 bytes_read; + +- bytes_read = vips_source_read( heif->source, data, size ); +- if( bytes_read <= 0 ) +- return( -1 ); ++ bytes_read = vips_source_read(heif->source, data, size); ++ if (bytes_read <= 0) ++ return (-1); + + size -= bytes_read; + data += bytes_read; + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_heif_seek( gint64 position, void *userdata ) ++vips_foreign_load_heif_seek(gint64 position, void *userdata) + { + VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) userdata; + + /* Return 0 on success. + */ +- return( vips_source_seek( heif->source, position, SEEK_SET ) == -1 ); ++ return (vips_source_seek(heif->source, position, SEEK_SET) == -1); + } + + /* libheif calls this to mean "I intend to read() to this position, please + * check it is OK". + */ +-static enum heif_reader_grow_status +-vips_foreign_load_heif_wait_for_file_size( gint64 target_size, void *userdata ) ++static enum heif_reader_grow_status ++vips_foreign_load_heif_wait_for_file_size(gint64 target_size, void *userdata) + { + VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) userdata; + +@@ -1153,13 +1147,13 @@ vips_foreign_load_heif_wait_for_file_size( gint64 target_size, void *userdata ) + gint64 result; + enum heif_reader_grow_status status; + +- /* We seek the VipsSource to the position and check for errors. ++ /* We seek the VipsSource to the position and check for errors. + */ +- old_position = vips_source_seek( heif->source, 0L, SEEK_CUR ); +- result = vips_source_seek( heif->source, target_size, SEEK_SET ); +- vips_source_seek( heif->source, old_position, SEEK_SET ); ++ old_position = vips_source_seek(heif->source, 0L, SEEK_CUR); ++ result = vips_source_seek(heif->source, target_size, SEEK_SET); ++ vips_source_seek(heif->source, old_position, SEEK_SET); + +- if( result < 0 ) ++ if (result < 0) + /* Unable to seek to this point, so it's beyond EOF. + */ + status = heif_reader_grow_status_size_beyond_eof; +@@ -1169,15 +1163,15 @@ vips_foreign_load_heif_wait_for_file_size( gint64 target_size, void *userdata ) + */ + status = heif_reader_grow_status_size_reached; + +- return( status ); ++ return (status); + } + + static void +-vips_foreign_load_heif_init( VipsForeignLoadHeif *heif ) ++vips_foreign_load_heif_init(VipsForeignLoadHeif *heif) + { + heif->n = 1; + +- heif->reader = VIPS_ARRAY( NULL, 1, struct heif_reader ); ++ heif->reader = VIPS_ARRAY(NULL, 1, struct heif_reader); + + /* The first version to support heif_reader. + */ +@@ -1185,7 +1179,7 @@ vips_foreign_load_heif_init( VipsForeignLoadHeif *heif ) + heif->reader->get_position = vips_foreign_load_heif_get_position; + heif->reader->read = vips_foreign_load_heif_read; + heif->reader->seek = vips_foreign_load_heif_seek; +- heif->reader->wait_for_file_size = ++ heif->reader->wait_for_file_size = + vips_foreign_load_heif_wait_for_file_size; + } + +@@ -1194,48 +1188,47 @@ typedef struct _VipsForeignLoadHeifFile { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadHeifFile; + + typedef VipsForeignLoadHeifClass VipsForeignLoadHeifFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadHeifFile, vips_foreign_load_heif_file, +- vips_foreign_load_heif_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadHeifFile, vips_foreign_load_heif_file, ++ vips_foreign_load_heif_get_type()); + + static int +-vips_foreign_load_heif_file_build( VipsObject *object ) ++vips_foreign_load_heif_file_build(VipsObject *object) + { + VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) object; + VipsForeignLoadHeifFile *file = (VipsForeignLoadHeifFile *) object; + +- if( file->filename ) +- if( !(heif->source = +- vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename) ++ if (!(heif->source = ++ vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_heif_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_heif_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_heif_file_is_a( const char *filename ) ++vips_foreign_load_heif_file_is_a(const char *filename) + { + char buf[12]; + +- if( vips__get_bytes( filename, (unsigned char *) buf, 12 ) != 12 ) +- return( 0 ); ++ if (vips__get_bytes(filename, (unsigned char *) buf, 12) != 12) ++ return (0); + +- return( vips_foreign_load_heif_is_a( buf, 12 ) ); ++ return (vips_foreign_load_heif_is_a(buf, 12)); + } + + static void +-vips_foreign_load_heif_file_class_init( VipsForeignLoadHeifFileClass *class ) ++vips_foreign_load_heif_file_class_init(VipsForeignLoadHeifFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -1250,17 +1243,16 @@ vips_foreign_load_heif_file_class_init( VipsForeignLoadHeifFileClass *class ) + + load_class->is_a = vips_foreign_load_heif_file_is_a; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadHeifFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadHeifFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_heif_file_init( VipsForeignLoadHeifFile *file ) ++vips_foreign_load_heif_file_init(VipsForeignLoadHeifFile *file) + { + } + +@@ -1275,40 +1267,39 @@ typedef struct _VipsForeignLoadHeifBuffer { + + typedef VipsForeignLoadHeifClass VipsForeignLoadHeifBufferClass; + +-G_DEFINE_TYPE( VipsForeignLoadHeifBuffer, vips_foreign_load_heif_buffer, +- vips_foreign_load_heif_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadHeifBuffer, vips_foreign_load_heif_buffer, ++ vips_foreign_load_heif_get_type()); + + static int +-vips_foreign_load_heif_buffer_build( VipsObject *object ) ++vips_foreign_load_heif_buffer_build(VipsObject *object) + { + VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) object; +- VipsForeignLoadHeifBuffer *buffer = ++ VipsForeignLoadHeifBuffer *buffer = + (VipsForeignLoadHeifBuffer *) object; + +- if( buffer->buf ) +- if( !(heif->source = vips_source_new_from_memory( +- VIPS_AREA( buffer->buf )->data, +- VIPS_AREA( buffer->buf )->length )) ) +- return( -1 ); ++ if (buffer->buf) ++ if (!(heif->source = vips_source_new_from_memory( ++ VIPS_AREA(buffer->buf)->data, ++ VIPS_AREA(buffer->buf)->length))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_heif_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_heif_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_heif_buffer_is_a( const void *buf, size_t len ) ++vips_foreign_load_heif_buffer_is_a(const void *buf, size_t len) + { +- return( vips_foreign_load_heif_is_a( buf, len ) ); ++ return (vips_foreign_load_heif_is_a(buf, len)); + } + + static void +-vips_foreign_load_heif_buffer_class_init( +- VipsForeignLoadHeifBufferClass *class ) ++vips_foreign_load_heif_buffer_class_init( ++ VipsForeignLoadHeifBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -1320,17 +1311,16 @@ vips_foreign_load_heif_buffer_class_init( + + load_class->is_a_buffer = vips_foreign_load_heif_buffer_is_a; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadHeifBuffer, buf ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadHeifBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_load_heif_buffer_init( VipsForeignLoadHeifBuffer *buffer ) ++vips_foreign_load_heif_buffer_init(VipsForeignLoadHeifBuffer *buffer) + { + } + +@@ -1345,44 +1335,43 @@ typedef struct _VipsForeignLoadHeifSource { + + typedef VipsForeignLoadHeifClass VipsForeignLoadHeifSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadHeifSource, vips_foreign_load_heif_source, +- vips_foreign_load_heif_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadHeifSource, vips_foreign_load_heif_source, ++ vips_foreign_load_heif_get_type()); + + static int +-vips_foreign_load_heif_source_build( VipsObject *object ) ++vips_foreign_load_heif_source_build(VipsObject *object) + { + VipsForeignLoadHeif *heif = (VipsForeignLoadHeif *) object; +- VipsForeignLoadHeifSource *source = ++ VipsForeignLoadHeifSource *source = + (VipsForeignLoadHeifSource *) object; + +- if( source->source ) { ++ if (source->source) { + heif->source = source->source; +- g_object_ref( heif->source ); ++ g_object_ref(heif->source); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_heif_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_heif_source_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_heif_source_is_a_source( VipsSource *source ) ++vips_foreign_load_heif_source_is_a_source(VipsSource *source) + { + const char *p; + +- return( (p = (const char *) vips_source_sniff( source, 12 )) && +- vips_foreign_load_heif_is_a( p, 12 ) ); ++ return ((p = (const char *) vips_source_sniff(source, 12)) && ++ vips_foreign_load_heif_is_a(p, 12)); + } + + static void +-vips_foreign_load_heif_source_class_init( +- VipsForeignLoadHeifSourceClass *class ) ++vips_foreign_load_heif_source_class_init( ++ VipsForeignLoadHeifSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -1395,17 +1384,16 @@ vips_foreign_load_heif_source_class_init( + + load_class->is_a_source = vips_foreign_load_heif_source_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadHeifSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadHeifSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_heif_source_init( VipsForeignLoadHeifSource *source ) ++vips_foreign_load_heif_source_init(VipsForeignLoadHeifSource *source) + { + } + +diff --git a/libvips/foreign/heifsave.c b/libvips/foreign/heifsave.c +index 304c137a6a..43bad251dd 100644 +--- a/libvips/foreign/heifsave.c ++++ b/libvips/foreign/heifsave.c +@@ -20,28 +20,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -79,7 +79,7 @@ typedef struct _VipsForeignSaveHeif { + */ + int Q; + +- /* bitdepth to save at for >8 bit images. ++ /* bitdepth to save at for >8 bit images. + */ + int bitdepth; + +@@ -120,7 +120,7 @@ typedef struct _VipsForeignSaveHeif { + */ + struct heif_image *img; + +- /* The libheif memory area we fill with pixels from the libvips ++ /* The libheif memory area we fill with pixels from the libvips + * pipe. + */ + uint8_t *data; +@@ -137,37 +137,36 @@ typedef VipsForeignSaveClass VipsForeignSaveHeifClass; + + /* Defined in heifload.c + */ +-void vips__heif_image_print( struct heif_image *img ); +-void vips__heif_error( struct heif_error *error ); ++void vips__heif_image_print(struct heif_image *img); ++void vips__heif_error(struct heif_error *error); + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveHeif, vips_foreign_save_heif, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSaveHeif, vips_foreign_save_heif, ++ VIPS_TYPE_FOREIGN_SAVE); + + static void +-vips_foreign_save_heif_dispose( GObject *gobject ) ++vips_foreign_save_heif_dispose(GObject *gobject) + { + VipsForeignSaveHeif *heif = (VipsForeignSaveHeif *) gobject; + +- VIPS_UNREF( heif->target ); +- VIPS_UNREF( heif->image ); +- VIPS_FREEF( heif_image_release, heif->img ); +- VIPS_FREEF( heif_image_handle_release, heif->handle ); +- VIPS_FREEF( heif_encoder_release, heif->encoder ); +- VIPS_FREEF( heif_context_free, heif->ctx ); ++ VIPS_UNREF(heif->target); ++ VIPS_UNREF(heif->image); ++ VIPS_FREEF(heif_image_release, heif->img); ++ VIPS_FREEF(heif_image_handle_release, heif->handle); ++ VIPS_FREEF(heif_encoder_release, heif->encoder); ++ VIPS_FREEF(heif_context_free, heif->ctx); + +- G_OBJECT_CLASS( vips_foreign_save_heif_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_heif_parent_class)->dispose(gobject); + } + +-typedef struct heif_error (*libheif_metadata_fn)( struct heif_context *, +- const struct heif_image_handle *, +- const void *, int ); ++typedef struct heif_error (*libheif_metadata_fn)(struct heif_context *, ++ const struct heif_image_handle *, ++ const void *, int); + + /* String-based metadata fields we add. + */ + typedef struct _VipsForeignSaveHeifMetadata { +- const char *name; /* as understood by libvips */ +- libheif_metadata_fn saver; /* as understood by libheif */ ++ const char *name; /* as understood by libvips */ ++ libheif_metadata_fn saver; /* as understood by libheif */ + } VipsForeignSaveHeifMetadata; + + static VipsForeignSaveHeifMetadata libheif_metadata[] = { +@@ -176,44 +175,44 @@ static VipsForeignSaveHeifMetadata libheif_metadata[] = { + }; + + static int +-vips_foreign_save_heif_write_metadata( VipsForeignSaveHeif *heif ) ++vips_foreign_save_heif_write_metadata(VipsForeignSaveHeif *heif) + { + int i; + struct heif_error error; + + /* Rebuild exif from tags, if we'll be saving it. + */ +- if( vips__exif_update( heif->image ) ) +- return( -1 ); ++ if (vips__exif_update(heif->image)) ++ return (-1); + +- for( i = 0; i < VIPS_NUMBER( libheif_metadata ); i++ ) +- if( vips_image_get_typeof( heif->image, +- libheif_metadata[i].name ) ) { ++ for (i = 0; i < VIPS_NUMBER(libheif_metadata); i++) ++ if (vips_image_get_typeof(heif->image, ++ libheif_metadata[i].name)) { + const void *data; + size_t length; + + #ifdef DEBUG +- printf( "attaching %s ..\n", +- libheif_metadata[i].name ); ++ printf("attaching %s ..\n", ++ libheif_metadata[i].name); + #endif /*DEBUG*/ + +- if( vips_image_get_blob( heif->image, +- libheif_metadata[i].name, &data, &length ) ) +- return( -1 ); ++ if (vips_image_get_blob(heif->image, ++ libheif_metadata[i].name, &data, &length)) ++ return (-1); + +- error = libheif_metadata[i].saver( heif->ctx, +- heif->handle, data, length ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ error = libheif_metadata[i].saver(heif->ctx, ++ heif->handle, data, length); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_heif_write_page( VipsForeignSaveHeif *heif, int page ) ++vips_foreign_save_heif_write_page(VipsForeignSaveHeif *heif, int page) + { + VipsForeignSave *save = (VipsForeignSave *) heif; + +@@ -221,102 +220,102 @@ vips_foreign_save_heif_write_page( VipsForeignSaveHeif *heif, int page ) + struct heif_encoding_options *options; + + #ifdef HAVE_HEIF_COLOR_PROFILE +- if( !save->strip && +- vips_image_get_typeof( heif->image, VIPS_META_ICC_NAME ) ) { ++ if (!save->strip && ++ vips_image_get_typeof(heif->image, VIPS_META_ICC_NAME)) { + const void *data; + size_t length; + + #ifdef DEBUG +- printf( "attaching profile ..\n" ); ++ printf("attaching profile ..\n"); + #endif /*DEBUG*/ + +- if( vips_image_get_blob( heif->image, +- VIPS_META_ICC_NAME, &data, &length ) ) +- return( -1 ); ++ if (vips_image_get_blob(heif->image, ++ VIPS_META_ICC_NAME, &data, &length)) ++ return (-1); + + /* FIXME .. also see heif_image_set_nclx_color_profile() + */ +- error = heif_image_set_raw_color_profile( heif->img, +- "rICC", data, length ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ error = heif_image_set_raw_color_profile(heif->img, ++ "rICC", data, length); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + } + #endif /*HAVE_HEIF_COLOR_PROFILE*/ + + options = heif_encoding_options_alloc(); +- if( vips_image_hasalpha( heif->image ) ) ++ if (vips_image_hasalpha(heif->image)) + options->save_alpha_channel = 1; + + #ifdef DEBUG +-{ +- GTimer *timer = g_timer_new(); ++ { ++ GTimer *timer = g_timer_new(); + +- printf( "calling heif_context_encode_image() ...\n" ); ++ printf("calling heif_context_encode_image() ...\n"); + #endif /*DEBUG*/ + +- error = heif_context_encode_image( heif->ctx, +- heif->img, heif->encoder, options, &heif->handle ); ++ error = heif_context_encode_image(heif->ctx, ++ heif->img, heif->encoder, options, &heif->handle); + + #ifdef DEBUG +- printf( "... libheif took %.2g seconds\n", +- g_timer_elapsed( timer, NULL ) ); +- g_timer_destroy( timer ); +-} ++ printf("... libheif took %.2g seconds\n", ++ g_timer_elapsed(timer, NULL)); ++ g_timer_destroy(timer); ++ } + #endif /*DEBUG*/ + +- heif_encoding_options_free( options ); ++ heif_encoding_options_free(options); + +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + +- if( vips_image_get_typeof( heif->image, "heif-primary" ) ) { ++ if (vips_image_get_typeof(heif->image, "heif-primary")) { + int primary; + +- if( vips_image_get_int( heif->image, +- "heif-primary", &primary ) ) +- return( -1 ); ++ if (vips_image_get_int(heif->image, ++ "heif-primary", &primary)) ++ return (-1); + +- if( page == primary ) { +- error = heif_context_set_primary_image( heif->ctx, +- heif->handle ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ if (page == primary) { ++ error = heif_context_set_primary_image(heif->ctx, ++ heif->handle); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + } + } + +- if( !save->strip && +- vips_foreign_save_heif_write_metadata( heif ) ) +- return( -1 ); ++ if (!save->strip && ++ vips_foreign_save_heif_write_metadata(heif)) ++ return (-1); + +- VIPS_FREEF( heif_image_handle_release, heif->handle ); ++ VIPS_FREEF(heif_image_handle_release, heif->handle); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_heif_pack( VipsForeignSaveHeif *heif, +- VipsPel *q, VipsPel *p, int ne ) ++vips_foreign_save_heif_pack(VipsForeignSaveHeif *heif, ++ VipsPel *q, VipsPel *p, int ne) + { + int i; + +- if( heif->image->BandFmt == VIPS_FORMAT_UCHAR && +- heif->bitdepth == 8 ) ++ if (heif->image->BandFmt == VIPS_FORMAT_UCHAR && ++ heif->bitdepth == 8) + /* Most common case -- 8 bit to 8 bit. + */ +- memcpy( q, p, ne ); +- else if( heif->image->BandFmt == VIPS_FORMAT_UCHAR && +- heif->bitdepth > 8 ) { ++ memcpy(q, p, ne); ++ else if (heif->image->BandFmt == VIPS_FORMAT_UCHAR && ++ heif->bitdepth > 8) { + /* 8-bit source, write a bigendian short, shifted up. + */ + int shift = heif->bitdepth - 8; + +- for( i = 0; i < ne; i++ ) { ++ for (i = 0; i < ne; i++) { + guint16 v = p[i] << shift; + + q[0] = v >> 8; +@@ -325,19 +324,20 @@ vips_foreign_save_heif_pack( VipsForeignSaveHeif *heif, + q += 2; + } + } +- else if( heif->image->BandFmt == VIPS_FORMAT_USHORT && +- heif->bitdepth <= 8 ) { ++ else if (heif->image->BandFmt == VIPS_FORMAT_USHORT && ++ heif->bitdepth <= 8) { + /* 16-bit native byte order source, 8 bit write. +- * +- * Pick the high or low bits of the source. +- */ +- int vips_bitdepth = +- heif->image->Type == VIPS_INTERPRETATION_RGB16 || +- heif->image->Type == VIPS_INTERPRETATION_GREY16 ? +- 16 : 8; ++ * ++ * Pick the high or low bits of the source. ++ */ ++ int vips_bitdepth = ++ heif->image->Type == VIPS_INTERPRETATION_RGB16 || ++ heif->image->Type == VIPS_INTERPRETATION_GREY16 ++ ? 16 ++ : 8; + int shift = vips_bitdepth - heif->bitdepth; + +- for( i = 0; i < ne; i++ ) { ++ for (i = 0; i < ne; i++) { + guint16 v = *((gushort *) p) >> shift; + + q[i] = v; +@@ -345,17 +345,18 @@ vips_foreign_save_heif_pack( VipsForeignSaveHeif *heif, + p += 2; + } + } +- else if( heif->image->BandFmt == VIPS_FORMAT_USHORT && +- heif->bitdepth > 8 ) { ++ else if (heif->image->BandFmt == VIPS_FORMAT_USHORT && ++ heif->bitdepth > 8) { + /* 16-bit native byte order source, 16 bit bigendian write. + */ +- int vips_bitdepth = +- heif->image->Type == VIPS_INTERPRETATION_RGB16 || +- heif->image->Type == VIPS_INTERPRETATION_GREY16 ? +- 16 : 8; ++ int vips_bitdepth = ++ heif->image->Type == VIPS_INTERPRETATION_RGB16 || ++ heif->image->Type == VIPS_INTERPRETATION_GREY16 ++ ? 16 ++ : 8; + int shift = vips_bitdepth - heif->bitdepth; + +- for( i = 0; i < ne; i++ ) { ++ for (i = 0; i < ne; i++) { + guint16 v = *((gushort *) p) >> shift; + + q[0] = v >> 8; +@@ -366,71 +367,71 @@ vips_foreign_save_heif_pack( VipsForeignSaveHeif *heif, + } + } + else { +- VipsObjectClass *class = VIPS_OBJECT_CLASS( heif ); ++ VipsObjectClass *class = VIPS_OBJECT_CLASS(heif); + +- vips_error( class->nickname, +- "%s", _( "unimplemeted format conversion" ) ); +- return( -1 ); ++ vips_error(class->nickname, ++ "%s", _("unimplemeted format conversion")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_heif_write_block( VipsRegion *region, VipsRect *area, +- void *a ) ++vips_foreign_save_heif_write_block(VipsRegion *region, VipsRect *area, ++ void *a) + { + VipsForeignSaveHeif *heif = (VipsForeignSaveHeif *) a; + + int y; + + #ifdef DEBUG +- printf( "vips_foreign_save_heif_write_block: y = %d\n", area->top ); ++ printf("vips_foreign_save_heif_write_block: y = %d\n", area->top); + #endif /*DEBUG*/ + +- /* Copy a line at a time into our output image, write each time the ++ /* Copy a line at a time into our output image, write each time the + * image fills. + */ +- for( y = 0; y < area->height; y++ ) { ++ for (y = 0; y < area->height; y++) { + /* Y in page. + */ + int page = (area->top + y) / heif->page_height; + int line = (area->top + y) % heif->page_height; +- VipsPel *p = VIPS_REGION_ADDR( region, 0, area->top + y ); ++ VipsPel *p = VIPS_REGION_ADDR(region, 0, area->top + y); + VipsPel *q = heif->data + line * heif->stride; + +- if( vips_foreign_save_heif_pack( heif, +- q, p, VIPS_REGION_N_ELEMENTS( region ) ) ) +- return( -1 ); ++ if (vips_foreign_save_heif_pack(heif, ++ q, p, VIPS_REGION_N_ELEMENTS(region))) ++ return (-1); + +- /* Did we just write the final line? Write as a new page ++ /* Did we just write the final line? Write as a new page + * into the output. + */ +- if( line == heif->page_height - 1 ) +- if( vips_foreign_save_heif_write_page( heif, page ) ) +- return( -1 ); ++ if (line == heif->page_height - 1) ++ if (vips_foreign_save_heif_write_page(heif, page)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + +-struct heif_error +-vips_foreign_save_heif_write( struct heif_context *ctx, +- const void *data, size_t length, void *userdata ) ++struct heif_error ++vips_foreign_save_heif_write(struct heif_context *ctx, ++ const void *data, size_t length, void *userdata) + { + VipsForeignSaveHeif *heif = (VipsForeignSaveHeif *) userdata; + + struct heif_error error; + + error.code = 0; +- if( vips_target_write( heif->target, data, length ) ) ++ if (vips_target_write(heif->target, data, length)) + error.code = -1; + +- return( error ); ++ return (error); + } + + static int +-vips_foreign_save_heif_build( VipsObject *object ) ++vips_foreign_save_heif_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveHeif *heif = (VipsForeignSaveHeif *) object; +@@ -439,139 +440,141 @@ vips_foreign_save_heif_build( VipsObject *object ) + struct heif_writer writer; + char *chroma; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_heif_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_heif_parent_class)->build(object)) ++ return (-1); + + /* Make a copy of the image in case we modify the metadata eg. for + * exif_update. + */ +- if( vips_copy( save->ready, &heif->image, NULL ) ) +- return( -1 ); ++ if (vips_copy(save->ready, &heif->image, NULL)) ++ return (-1); + + /* If the old, deprecated "speed" param is being used and the new + * "effort" param is not, use speed to init effort. + */ +- if( vips_object_argument_isset( object, "speed" ) && +- !vips_object_argument_isset( object, "effort" ) ) ++ if (vips_object_argument_isset(object, "speed") && ++ !vips_object_argument_isset(object, "effort")) + heif->effort = 9 - heif->speed; + +- /* Default 12 bit save for 16-bit images. HEIC (for example) implements ++ /* Default 12 bit save for 16-bit images. HEIC (for example) implements + * 8 / 10 / 12. + */ +- if( !vips_object_argument_isset( object, "bitdepth" ) ) +- heif->bitdepth = +- heif->image->Type == VIPS_INTERPRETATION_RGB16 || +- heif->image->Type == VIPS_INTERPRETATION_GREY16 ? +- 12 : 8; +- +- error = heif_context_get_encoder_for_format( heif->ctx, +- (enum heif_compression_format) heif->compression, +- &heif->encoder ); +- if( error.code ) { +- if( error.code == heif_error_Unsupported_filetype ) +- vips_error( "heifsave", +- "%s", _( "Unsupported compression" ) ); +- else +- vips__heif_error( &error ); +- +- return( -1 ); ++ if (!vips_object_argument_isset(object, "bitdepth")) ++ heif->bitdepth = ++ heif->image->Type == VIPS_INTERPRETATION_RGB16 || ++ heif->image->Type == VIPS_INTERPRETATION_GREY16 ++ ? 12 ++ : 8; ++ ++ error = heif_context_get_encoder_for_format(heif->ctx, ++ (enum heif_compression_format) heif->compression, ++ &heif->encoder); ++ if (error.code) { ++ if (error.code == heif_error_Unsupported_filetype) ++ vips_error("heifsave", ++ "%s", _("Unsupported compression")); ++ else ++ vips__heif_error(&error); ++ ++ return (-1); + } + +- error = heif_encoder_set_lossy_quality( heif->encoder, heif->Q ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ error = heif_encoder_set_lossy_quality(heif->encoder, heif->Q); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + +- error = heif_encoder_set_lossless( heif->encoder, heif->lossless ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ error = heif_encoder_set_lossless(heif->encoder, heif->lossless); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + +- error = heif_encoder_set_parameter_integer( heif->encoder, +- "speed", 9 - heif->effort ); +- if( error.code && +- error.subcode != heif_suberror_Unsupported_parameter ) { +- vips__heif_error( &error ); +- return( -1 ); ++ error = heif_encoder_set_parameter_integer(heif->encoder, ++ "speed", 9 - heif->effort); ++ if (error.code && ++ error.subcode != heif_suberror_Unsupported_parameter) { ++ vips__heif_error(&error); ++ return (-1); + } + + chroma = heif->subsample_mode == VIPS_FOREIGN_SUBSAMPLE_OFF || +- (heif->subsample_mode == VIPS_FOREIGN_SUBSAMPLE_AUTO && +- heif->Q >= 90) ? "444" : "420"; +- error = heif_encoder_set_parameter_string( heif->encoder, +- "chroma", chroma ); +- if( error.code && +- error.subcode != heif_suberror_Unsupported_parameter ) { +- vips__heif_error( &error ); +- return( -1 ); ++ (heif->subsample_mode == VIPS_FOREIGN_SUBSAMPLE_AUTO && ++ heif->Q >= 90) ++ ? "444" ++ : "420"; ++ error = heif_encoder_set_parameter_string(heif->encoder, ++ "chroma", chroma); ++ if (error.code && ++ error.subcode != heif_suberror_Unsupported_parameter) { ++ vips__heif_error(&error); ++ return (-1); + } + +- /* TODO .. support extra per-encoder params with ++ /* TODO .. support extra per-encoder params with + * heif_encoder_list_parameters(). + */ + + heif->page_width = heif->image->Xsize; +- heif->page_height = vips_image_get_page_height( heif->image ); ++ heif->page_height = vips_image_get_page_height(heif->image); + heif->n_pages = heif->image->Ysize / heif->page_height; + +- /* Make a heif image the size of a page. We send sink_disc() output ++ /* Make a heif image the size of a page. We send sink_disc() output + * here and write a frame each time it fills. + */ + #ifdef DEBUG +- printf( "vips_foreign_save_heif_build:\n" ); +- printf( "\twidth = %d\n", heif->page_width ); +- printf( "\theight = %d\n", heif->page_height ); +- printf( "\talpha = %d\n", vips_image_hasalpha( heif->image ) ); ++ printf("vips_foreign_save_heif_build:\n"); ++ printf("\twidth = %d\n", heif->page_width); ++ printf("\theight = %d\n", heif->page_height); ++ printf("\talpha = %d\n", vips_image_hasalpha(heif->image)); + #endif /*DEBUG*/ +- error = heif_image_create( heif->page_width, heif->page_height, +- heif_colorspace_RGB, +- vips__heif_chroma( heif->bitdepth, +- vips_image_hasalpha( heif->image ) ), +- &heif->img ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ error = heif_image_create(heif->page_width, heif->page_height, ++ heif_colorspace_RGB, ++ vips__heif_chroma(heif->bitdepth, ++ vips_image_hasalpha(heif->image)), ++ &heif->img); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + +- error = heif_image_add_plane( heif->img, heif_channel_interleaved, +- heif->page_width, heif->page_height, +- heif->bitdepth ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ error = heif_image_add_plane(heif->img, heif_channel_interleaved, ++ heif->page_width, heif->page_height, ++ heif->bitdepth); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + + #ifdef DEBUG +- vips__heif_image_print( heif->img ); ++ vips__heif_image_print(heif->img); + #endif /*DEBUG*/ + +- heif->data = heif_image_get_plane( heif->img, +- heif_channel_interleaved, &heif->stride ); ++ heif->data = heif_image_get_plane(heif->img, ++ heif_channel_interleaved, &heif->stride); + +- /* Write data. ++ /* Write data. + */ +- if( vips_sink_disc( heif->image, +- vips_foreign_save_heif_write_block, heif ) ) +- return( -1 ); ++ if (vips_sink_disc(heif->image, ++ vips_foreign_save_heif_write_block, heif)) ++ return (-1); + + /* This has to come right at the end :-( so there's no support for + * incremental writes. + */ + writer.writer_api_version = 1; + writer.write = vips_foreign_save_heif_write; +- error = heif_context_write( heif->ctx, &writer, heif ); +- if( error.code ) { +- vips__heif_error( &error ); +- return( -1 ); ++ error = heif_context_write(heif->ctx, &writer, heif); ++ if (error.code) { ++ vips__heif_error(&error); ++ return (-1); + } + +- if( vips_target_end( heif->target ) ) +- return( -1 ); ++ if (vips_target_end(heif->target)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + #define UC VIPS_FORMAT_UCHAR +@@ -586,9 +589,9 @@ static VipsBandFormat vips_heif_bandfmt[10] = { + }; + + static void +-vips_foreign_save_heif_class_init( VipsForeignSaveHeifClass *class ) ++vips_foreign_save_heif_class_init(VipsForeignSaveHeifClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; + +@@ -597,67 +600,66 @@ vips_foreign_save_heif_class_init( VipsForeignSaveHeifClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "heifsave_base"; +- object_class->description = _( "save image in HEIF format" ); ++ object_class->description = _("save image in HEIF format"); + object_class->build = vips_foreign_save_heif_build; + + save_class->saveable = VIPS_SAVEABLE_RGBA_ONLY; + save_class->format_table = vips_heif_bandfmt; + +- VIPS_ARG_INT( class, "Q", 10, +- _( "Q" ), +- _( "Q factor" ), ++ VIPS_ARG_INT(class, "Q", 10, ++ _("Q"), ++ _("Q factor"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveHeif, Q ), +- 1, 100, 50 ); ++ G_STRUCT_OFFSET(VipsForeignSaveHeif, Q), ++ 1, 100, 50); + +- VIPS_ARG_INT( class, "bitdepth", 11, +- _( "Bit depth" ), +- _( "Number of bits per pixel" ), ++ VIPS_ARG_INT(class, "bitdepth", 11, ++ _("Bit depth"), ++ _("Number of bits per pixel"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveHeif, bitdepth ), +- 1, 16, 12 ); ++ G_STRUCT_OFFSET(VipsForeignSaveHeif, bitdepth), ++ 1, 16, 12); + +- VIPS_ARG_BOOL( class, "lossless", 13, +- _( "Lossless" ), +- _( "Enable lossless compression" ), ++ VIPS_ARG_BOOL(class, "lossless", 13, ++ _("Lossless"), ++ _("Enable lossless compression"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveHeif, lossless ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveHeif, lossless), ++ FALSE); + +- VIPS_ARG_ENUM( class, "compression", 14, +- _( "Compression" ), +- _( "Compression format" ), ++ VIPS_ARG_ENUM(class, "compression", 14, ++ _("Compression"), ++ _("Compression format"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveHeif, compression ), ++ G_STRUCT_OFFSET(VipsForeignSaveHeif, compression), + VIPS_TYPE_FOREIGN_HEIF_COMPRESSION, +- VIPS_FOREIGN_HEIF_COMPRESSION_HEVC ); ++ VIPS_FOREIGN_HEIF_COMPRESSION_HEVC); + +- VIPS_ARG_INT( class, "effort", 15, +- _( "Effort" ), +- _( "CPU effort" ), ++ VIPS_ARG_INT(class, "effort", 15, ++ _("Effort"), ++ _("CPU effort"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveHeif, effort ), +- 0, 9, 4 ); ++ G_STRUCT_OFFSET(VipsForeignSaveHeif, effort), ++ 0, 9, 4); + +- VIPS_ARG_ENUM( class, "subsample_mode", 16, +- _( "Subsample mode" ), +- _( "Select chroma subsample operation mode" ), ++ VIPS_ARG_ENUM(class, "subsample_mode", 16, ++ _("Subsample mode"), ++ _("Select chroma subsample operation mode"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveHeif, subsample_mode ), ++ G_STRUCT_OFFSET(VipsForeignSaveHeif, subsample_mode), + VIPS_TYPE_FOREIGN_SUBSAMPLE, +- VIPS_FOREIGN_SUBSAMPLE_AUTO ); ++ VIPS_FOREIGN_SUBSAMPLE_AUTO); + +- VIPS_ARG_INT( class, "speed", 17, +- _( "Speed" ), +- _( "CPU effort" ), ++ VIPS_ARG_INT(class, "speed", 17, ++ _("Speed"), ++ _("CPU effort"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignSaveHeif, speed ), +- 0, 9, 5 ); +- ++ G_STRUCT_OFFSET(VipsForeignSaveHeif, speed), ++ 0, 9, 5); + } + + static void +-vips_foreign_save_heif_init( VipsForeignSaveHeif *heif ) ++vips_foreign_save_heif_init(VipsForeignSaveHeif *heif) + { + heif->ctx = heif_context_alloc(); + heif->Q = 50; +@@ -676,38 +678,37 @@ typedef struct _VipsForeignSaveHeifFile { + + /* Filename for save. + */ +- char *filename; ++ char *filename; + + } VipsForeignSaveHeifFile; + + typedef VipsForeignSaveHeifClass VipsForeignSaveHeifFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveHeifFile, vips_foreign_save_heif_file, +- vips_foreign_save_heif_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveHeifFile, vips_foreign_save_heif_file, ++ vips_foreign_save_heif_get_type()); + + static int +-vips_foreign_save_heif_file_build( VipsObject *object ) ++vips_foreign_save_heif_file_build(VipsObject *object) + { + VipsForeignSaveHeif *heif = (VipsForeignSaveHeif *) object; + VipsForeignSaveHeifFile *file = (VipsForeignSaveHeifFile *) object; + +- if( !(heif->target = vips_target_new_to_file( file->filename )) ) +- return( -1 ); ++ if (!(heif->target = vips_target_new_to_file(file->filename))) ++ return (-1); + +- if( vips_iscasepostfix( file->filename, ".avif" ) ) ++ if (vips_iscasepostfix(file->filename, ".avif")) + heif->compression = VIPS_FOREIGN_HEIF_COMPRESSION_AV1; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_heif_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_heif_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_heif_file_class_init( VipsForeignSaveHeifFileClass *class ) ++vips_foreign_save_heif_file_class_init(VipsForeignSaveHeifFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + +@@ -719,17 +720,16 @@ vips_foreign_save_heif_file_class_init( VipsForeignSaveHeifFileClass *class ) + + foreign_class->suffs = vips__heif_suffs; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveHeifFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveHeifFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_heif_file_init( VipsForeignSaveHeifFile *file ) ++vips_foreign_save_heif_file_init(VipsForeignSaveHeifFile *file) + { + } + +@@ -744,37 +744,36 @@ typedef struct _VipsForeignSaveHeifBuffer { + + typedef VipsForeignSaveHeifClass VipsForeignSaveHeifBufferClass; + +-G_DEFINE_TYPE( VipsForeignSaveHeifBuffer, vips_foreign_save_heif_buffer, +- vips_foreign_save_heif_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveHeifBuffer, vips_foreign_save_heif_buffer, ++ vips_foreign_save_heif_get_type()); + + static int +-vips_foreign_save_heif_buffer_build( VipsObject *object ) ++vips_foreign_save_heif_buffer_build(VipsObject *object) + { + VipsForeignSaveHeif *heif = (VipsForeignSaveHeif *) object; +- VipsForeignSaveHeifBuffer *buffer = ++ VipsForeignSaveHeifBuffer *buffer = + (VipsForeignSaveHeifBuffer *) object; + + VipsBlob *blob; + +- if( !(heif->target = vips_target_new_to_memory()) ) +- return( -1 ); ++ if (!(heif->target = vips_target_new_to_memory())) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_heif_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_heif_buffer_parent_class)->build(object)) ++ return (-1); + +- g_object_get( heif->target, "blob", &blob, NULL ); +- g_object_set( buffer, "buffer", blob, NULL ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ g_object_get(heif->target, "blob", &blob, NULL); ++ g_object_set(buffer, "buffer", blob, NULL); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_heif_buffer_class_init( +- VipsForeignSaveHeifBufferClass *class ) ++vips_foreign_save_heif_buffer_class_init( ++ VipsForeignSaveHeifBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + +@@ -786,17 +785,16 @@ vips_foreign_save_heif_buffer_class_init( + + foreign_class->suffs = vips__heic_suffs; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to save to" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsForeignSaveHeifBuffer, buf ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to save to"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveHeifBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_save_heif_buffer_init( VipsForeignSaveHeifBuffer *buffer ) ++vips_foreign_save_heif_buffer_init(VipsForeignSaveHeifBuffer *buffer) + { + } + +@@ -808,33 +806,32 @@ typedef struct _VipsForeignSaveHeifTarget { + + typedef VipsForeignSaveHeifClass VipsForeignSaveHeifTargetClass; + +-G_DEFINE_TYPE( VipsForeignSaveHeifTarget, vips_foreign_save_heif_target, +- vips_foreign_save_heif_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveHeifTarget, vips_foreign_save_heif_target, ++ vips_foreign_save_heif_get_type()); + + static int +-vips_foreign_save_heif_target_build( VipsObject *object ) ++vips_foreign_save_heif_target_build(VipsObject *object) + { + VipsForeignSaveHeif *heif = (VipsForeignSaveHeif *) object; +- VipsForeignSaveHeifTarget *target = ++ VipsForeignSaveHeifTarget *target = + (VipsForeignSaveHeifTarget *) object; + +- if( target->target ) { ++ if (target->target) { + heif->target = target->target; +- g_object_ref( heif->target ); ++ g_object_ref(heif->target); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_heif_target_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_heif_target_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_heif_target_class_init( +- VipsForeignSaveHeifTargetClass *class ) ++vips_foreign_save_heif_target_class_init( ++ VipsForeignSaveHeifTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + +@@ -846,36 +843,35 @@ vips_foreign_save_heif_target_class_init( + + foreign_class->suffs = vips__heic_suffs; + +- VIPS_ARG_OBJECT( class, "target", 1, +- _( "Target" ), +- _( "Target to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveHeifTarget, target ), +- VIPS_TYPE_TARGET ); +- ++ VIPS_ARG_OBJECT(class, "target", 1, ++ _("Target"), ++ _("Target to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveHeifTarget, target), ++ VIPS_TYPE_TARGET); + } + + static void +-vips_foreign_save_heif_target_init( VipsForeignSaveHeifTarget *target ) ++vips_foreign_save_heif_target_init(VipsForeignSaveHeifTarget *target) + { + } + + typedef VipsForeignSaveHeifTarget VipsForeignSaveAvifTarget; + typedef VipsForeignSaveHeifTargetClass VipsForeignSaveAvifTargetClass; + +-G_DEFINE_TYPE( VipsForeignSaveAvifTarget, vips_foreign_save_avif_target, +- vips_foreign_save_heif_target_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveAvifTarget, vips_foreign_save_avif_target, ++ vips_foreign_save_heif_target_get_type()); + + static void +-vips_foreign_save_avif_target_class_init( +- VipsForeignSaveAvifTargetClass *class ) ++vips_foreign_save_avif_target_class_init( ++ VipsForeignSaveAvifTargetClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsOperationClass *operation_class = (VipsOperationClass *) class; + + object_class->nickname = "avifsave_target"; +- object_class->description = _( "save image in AVIF format" ); ++ object_class->description = _("save image in AVIF format"); + + foreign_class->suffs = vips__avif_suffs; + +@@ -885,7 +881,7 @@ vips_foreign_save_avif_target_class_init( + } + + static void +-vips_foreign_save_avif_target_init( VipsForeignSaveAvifTarget *target ) ++vips_foreign_save_avif_target_init(VipsForeignSaveAvifTarget *target) + { + VipsForeignSaveHeif *heif = (VipsForeignSaveHeif *) target; + +diff --git a/libvips/foreign/jp2kload.c b/libvips/foreign/jp2kload.c +index 223ffa642b..caa81ee26e 100644 +--- a/libvips/foreign/jp2kload.c ++++ b/libvips/foreign/jp2kload.c +@@ -10,28 +10,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -77,12 +77,12 @@ typedef struct _VipsForeignLoadJp2k { + + /* Decompress state. + */ +- opj_stream_t *stream; /* Source as an opj stream */ +- OPJ_CODEC_FORMAT format; /* libopenjp2 format */ +- opj_codec_t *codec; /* Decompress codec */ ++ opj_stream_t *stream; /* Source as an opj stream */ ++ OPJ_CODEC_FORMAT format; /* libopenjp2 format */ ++ opj_codec_t *codec; /* Decompress codec */ + opj_dparameters_t parameters; /* Core decompress params */ +- opj_image_t *image; /* Read image to here */ +- opj_codestream_info_v2_t *info; /* Tile geometry */ ++ opj_image_t *image; /* Read image to here */ ++ opj_codestream_info_v2_t *info; /* Tile geometry */ + + /* Number of errors reported during load -- use this to block load of + * corrupted images. +@@ -100,135 +100,133 @@ typedef struct _VipsForeignLoadJp2k { + + typedef VipsForeignLoadClass VipsForeignLoadJp2kClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadJp2k, vips_foreign_load_jp2k, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadJp2k, vips_foreign_load_jp2k, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_jp2k_dispose( GObject *gobject ) ++vips_foreign_load_jp2k_dispose(GObject *gobject) + { + VipsForeignLoadJp2k *jp2k = (VipsForeignLoadJp2k *) gobject; + + #ifdef DEBUG +- printf( "vips_foreign_load_jp2k_dispose:\n" ); ++ printf("vips_foreign_load_jp2k_dispose:\n"); + #endif /*DEBUG*/ + + /* + * FIXME ... do we need this? seems to just cause warnings + * + if( jp2k->codec && +- jp2k->stream ) ++ jp2k->stream ) + opj_end_decompress( jp2k->codec, jp2k->stream ); + * + */ + +- if( jp2k->info ) +- opj_destroy_cstr_info( &jp2k->info ); +- VIPS_FREEF( opj_destroy_codec, jp2k->codec ); +- VIPS_FREEF( opj_stream_destroy, jp2k->stream ); +- VIPS_FREEF( opj_image_destroy, jp2k->image ); +- VIPS_UNREF( jp2k->source ); ++ if (jp2k->info) ++ opj_destroy_cstr_info(&jp2k->info); ++ VIPS_FREEF(opj_destroy_codec, jp2k->codec); ++ VIPS_FREEF(opj_stream_destroy, jp2k->stream); ++ VIPS_FREEF(opj_image_destroy, jp2k->image); ++ VIPS_UNREF(jp2k->source); + +- G_OBJECT_CLASS( vips_foreign_load_jp2k_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_jp2k_parent_class)->dispose(gobject); + } + + static OPJ_SIZE_T +-vips_foreign_load_jp2k_read_source( void *buffer, size_t length, void *client ) ++vips_foreign_load_jp2k_read_source(void *buffer, size_t length, void *client) + { +- VipsSource *source = VIPS_SOURCE( client ); +- gint64 bytes_read = vips_source_read( source, buffer, length ); ++ VipsSource *source = VIPS_SOURCE(client); ++ gint64 bytes_read = vips_source_read(source, buffer, length); + + /* openjpeg read uses -1 for both EOF and error return. + */ +- return( bytes_read == 0 ? -1 : bytes_read ); ++ return (bytes_read == 0 ? -1 : bytes_read); + } + + static OPJ_OFF_T +-vips_foreign_load_jp2k_skip_source( OPJ_OFF_T n_bytes, void *client ) ++vips_foreign_load_jp2k_skip_source(OPJ_OFF_T n_bytes, void *client) + { +- VipsSource *source = VIPS_SOURCE( client ); ++ VipsSource *source = VIPS_SOURCE(client); + +- if( vips_source_seek( source, n_bytes, SEEK_CUR ) == -1 ) ++ if (vips_source_seek(source, n_bytes, SEEK_CUR) == -1) + /* openjpeg skip uses -1 for both end of stream and error. + */ +- return( -1 ); ++ return (-1); + +- return( n_bytes ); ++ return (n_bytes); + } + + static OPJ_BOOL +-vips_foreign_load_jp2k_seek_source( OPJ_OFF_T position, void *client ) ++vips_foreign_load_jp2k_seek_source(OPJ_OFF_T position, void *client) + { +- VipsSource *source = VIPS_SOURCE( client ); ++ VipsSource *source = VIPS_SOURCE(client); + +- if( vips_source_seek( source, position, SEEK_SET ) == -1 ) ++ if (vips_source_seek(source, position, SEEK_SET) == -1) + /* openjpeg seek uses FALSE for both end of stream and error. + */ +- return( OPJ_FALSE ); ++ return (OPJ_FALSE); + +- return( OPJ_TRUE ); ++ return (OPJ_TRUE); + } + + /* Make a libopenjp2 stream that wraps a VipsSource. + */ + static opj_stream_t * +-vips_foreign_load_jp2k_stream( VipsSource *source ) ++vips_foreign_load_jp2k_stream(VipsSource *source) + { + opj_stream_t *stream; + + /* TRUE means a read stream. + */ +- if( !(stream = opj_stream_create( OPJ_J2K_STREAM_CHUNK_SIZE, TRUE )) ) +- return( NULL ); ++ if (!(stream = opj_stream_create(OPJ_J2K_STREAM_CHUNK_SIZE, TRUE))) ++ return (NULL); + +- opj_stream_set_user_data( stream, source, NULL ); ++ opj_stream_set_user_data(stream, source, NULL); + /* Unfortunately, jp2k requires the length, so pipe sources will have + * to buffer in memory. + */ +- opj_stream_set_user_data_length( stream, +- vips_source_length( source ) ); +- opj_stream_set_read_function( stream, +- vips_foreign_load_jp2k_read_source ); +- opj_stream_set_skip_function( stream, +- vips_foreign_load_jp2k_skip_source ); +- opj_stream_set_seek_function( stream, +- vips_foreign_load_jp2k_seek_source ); +- +- return( stream ); ++ opj_stream_set_user_data_length(stream, ++ vips_source_length(source)); ++ opj_stream_set_read_function(stream, ++ vips_foreign_load_jp2k_read_source); ++ opj_stream_set_skip_function(stream, ++ vips_foreign_load_jp2k_skip_source); ++ opj_stream_set_seek_function(stream, ++ vips_foreign_load_jp2k_seek_source); ++ ++ return (stream); + } + + static int +-vips_foreign_load_jp2k_build( VipsObject *object ) ++vips_foreign_load_jp2k_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsForeignLoadJp2k *jp2k = (VipsForeignLoadJp2k *) object; + + #ifdef DEBUG +- printf( "vips_foreign_load_jp2k_build:\n" ); ++ printf("vips_foreign_load_jp2k_build:\n"); + #endif /*DEBUG*/ + + /* Default parameters. + */ +- jp2k->parameters.decod_format = -1; +- jp2k->parameters.cod_format = -1; +- opj_set_default_decoder_parameters( &jp2k->parameters ); ++ jp2k->parameters.decod_format = -1; ++ jp2k->parameters.cod_format = -1; ++ opj_set_default_decoder_parameters(&jp2k->parameters); + + /* Link the openjpeg stream to our VipsSource. + */ +- if( jp2k->source ) { +- jp2k->stream = vips_foreign_load_jp2k_stream( jp2k->source ); +- if( !jp2k->stream ) { +- vips_error( class->nickname, +- "%s", _( "unable to create jp2k stream" ) ); +- return( -1 ); ++ if (jp2k->source) { ++ jp2k->stream = vips_foreign_load_jp2k_stream(jp2k->source); ++ if (!jp2k->stream) { ++ vips_error(class->nickname, ++ "%s", _("unable to create jp2k stream")); ++ return (-1); + } + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_jp2k_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_jp2k_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + #define JP2_RFC3745_MAGIC "\x00\x00\x00\x0c\x6a\x50\x20\x20\x0d\x0a\x87\x0a" +@@ -239,140 +237,140 @@ vips_foreign_load_jp2k_build( VipsObject *object ) + /* Return the image format. OpenJPEG supports several different image types. + */ + static OPJ_CODEC_FORMAT +-vips_foreign_load_jp2k_get_format( VipsSource *source ) ++vips_foreign_load_jp2k_get_format(VipsSource *source) + { + unsigned char *data; + +- if( vips_source_sniff_at_most( source, &data, 12 ) < 12 ) +- return( -1 ); ++ if (vips_source_sniff_at_most(source, &data, 12) < 12) ++ return (-1); + + /* There's also OPJ_CODEC_JPT for xxx.jpt files, but we don't support + * that. + */ +- if( memcmp( data, JP2_RFC3745_MAGIC, 12) == 0 || +- memcmp( data, JP2_MAGIC, 4 ) == 0 ) +- return( OPJ_CODEC_JP2 ); +- else if( memcmp( data, J2K_CODESTREAM_MAGIC, 4 ) == 0 ) +- return( OPJ_CODEC_J2K ); ++ if (memcmp(data, JP2_RFC3745_MAGIC, 12) == 0 || ++ memcmp(data, JP2_MAGIC, 4) == 0) ++ return (OPJ_CODEC_JP2); ++ else if (memcmp(data, J2K_CODESTREAM_MAGIC, 4) == 0) ++ return (OPJ_CODEC_J2K); + else +- return( -1 ); ++ return (-1); + } + + static gboolean +-vips_foreign_load_jp2k_is_a_source( VipsSource *source ) ++vips_foreign_load_jp2k_is_a_source(VipsSource *source) + { +- return( vips_foreign_load_jp2k_get_format( source ) != -1 ); ++ return (vips_foreign_load_jp2k_get_format(source) != -1); + } + + static VipsForeignFlags +-vips_foreign_load_jp2k_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_jp2k_get_flags(VipsForeignLoad *load) + { +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + /* The openjpeg info and warning callbacks are incredibly chatty. + */ +-static void +-vips_foreign_load_jp2k_info_callback( const char *msg, void *client ) ++static void ++vips_foreign_load_jp2k_info_callback(const char *msg, void *client) + { + #ifdef DEBUG +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( client ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(client); + +- g_info( "%s: %s", class->nickname, msg ); ++ g_info("%s: %s", class->nickname, msg); + #endif /*DEBUG*/ + } + + /* The openjpeg info and warning callbacks are incredibly chatty. + */ +-static void +-vips_foreign_load_jp2k_warning_callback( const char *msg, void *client ) ++static void ++vips_foreign_load_jp2k_warning_callback(const char *msg, void *client) + { + #ifdef DEBUG +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( client ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(client); + +- g_warning( "%s: %s", class->nickname, msg ); ++ g_warning("%s: %s", class->nickname, msg); + #endif /*DEBUG*/ + } + +-static void +-vips_foreign_load_jp2k_error_callback( const char *msg, void *client ) ++static void ++vips_foreign_load_jp2k_error_callback(const char *msg, void *client) + { + VipsForeignLoadJp2k *jp2k = (VipsForeignLoadJp2k *) client; +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( jp2k ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(jp2k); + + #ifdef DEBUG +- printf( "%s: %s", class->nickname, msg ); ++ printf("%s: %s", class->nickname, msg); + #endif /*DEBUG*/ + +- vips_error( class->nickname, "%s", msg ); ++ vips_error(class->nickname, "%s", msg); + jp2k->n_errors += 1; + } + + static void +-vips_foreign_load_jp2k_attach_handlers( VipsForeignLoadJp2k *jp2k, +- opj_codec_t *codec ) ++vips_foreign_load_jp2k_attach_handlers(VipsForeignLoadJp2k *jp2k, ++ opj_codec_t *codec) + { +- opj_set_info_handler( codec, +- vips_foreign_load_jp2k_info_callback, jp2k ); +- opj_set_warning_handler( codec, +- vips_foreign_load_jp2k_warning_callback, jp2k ); +- opj_set_error_handler( codec, +- vips_foreign_load_jp2k_error_callback, jp2k ); ++ opj_set_info_handler(codec, ++ vips_foreign_load_jp2k_info_callback, jp2k); ++ opj_set_warning_handler(codec, ++ vips_foreign_load_jp2k_warning_callback, jp2k); ++ opj_set_error_handler(codec, ++ vips_foreign_load_jp2k_error_callback, jp2k); + } + + #ifdef DEBUG + static void +-vips_foreign_load_jp2k_print_image( opj_image_t *image ) ++vips_foreign_load_jp2k_print_image(opj_image_t *image) + { +- printf( "image:\n" ); +- printf( "x0 = %u, y0 = %u, x1 = %u, y1 = %u, numcomps = %u, " +- "color_space = %u\n", +- image->x0, image->y0, image->x1, image->y1, +- image->numcomps, image->color_space ); +- printf( "icc_profile_buf = %p, icc_profile_len = %x\n", +- image->icc_profile_buf, image->icc_profile_len ); ++ printf("image:\n"); ++ printf("x0 = %u, y0 = %u, x1 = %u, y1 = %u, numcomps = %u, " ++ "color_space = %u\n", ++ image->x0, image->y0, image->x1, image->y1, ++ image->numcomps, image->color_space); ++ printf("icc_profile_buf = %p, icc_profile_len = %x\n", ++ image->icc_profile_buf, image->icc_profile_len); + } + + static void +-vips_foreign_load_jp2k_print( VipsForeignLoadJp2k *jp2k ) ++vips_foreign_load_jp2k_print(VipsForeignLoadJp2k *jp2k) + { + int i; + +- vips_foreign_load_jp2k_print_image( jp2k->image ); ++ vips_foreign_load_jp2k_print_image(jp2k->image); + +- printf( "components:\n" ); +- for( i = 0; i < jp2k->image->numcomps; i++ ) { ++ printf("components:\n"); ++ for (i = 0; i < jp2k->image->numcomps; i++) { + opj_image_comp_t *this = &jp2k->image->comps[i]; + +- printf( "%i) dx = %u, dy = %u, w = %u, h = %u, " +- "x0 = %u, y0 = %u\n", +- i, this->dx, this->dy, this->w, this->h, +- this->x0, this->y0 ); +- printf( " prec = %d, sgnd = %x, " +- "resno_decoded = %u, factor = %u\n", +- this->prec, this->sgnd, +- this->resno_decoded, this->factor ); +- printf( " data = %p, alpha = %u\n", +- this->data, this->alpha ); ++ printf("%i) dx = %u, dy = %u, w = %u, h = %u, " ++ "x0 = %u, y0 = %u\n", ++ i, this->dx, this->dy, this->w, this->h, ++ this->x0, this->y0); ++ printf(" prec = %d, sgnd = %x, " ++ "resno_decoded = %u, factor = %u\n", ++ this->prec, this->sgnd, ++ this->resno_decoded, this->factor); ++ printf(" data = %p, alpha = %u\n", ++ this->data, this->alpha); + } + +- printf( "info:\n" ); +- printf( "tx0 = %u, ty0 = %d, tdx = %u, tdy = %u, tw = %u, th = %u\n", +- jp2k->info->tx0, jp2k->info->ty0, +- jp2k->info->tdx, jp2k->info->tdy, +- jp2k->info->tw, jp2k->info->th ); +- printf( "nbcomps = %u, tile_info = %p\n", +- jp2k->info->nbcomps, jp2k->info->tile_info ); +- if( jp2k->info->tw == 1 && +- jp2k->info->th == 1 ) +- printf( "untiled\n" ); ++ printf("info:\n"); ++ printf("tx0 = %u, ty0 = %d, tdx = %u, tdy = %u, tw = %u, th = %u\n", ++ jp2k->info->tx0, jp2k->info->ty0, ++ jp2k->info->tdx, jp2k->info->tdy, ++ jp2k->info->tw, jp2k->info->th); ++ printf("nbcomps = %u, tile_info = %p\n", ++ jp2k->info->nbcomps, jp2k->info->tile_info); ++ if (jp2k->info->tw == 1 && ++ jp2k->info->th == 1) ++ printf("untiled\n"); + } + #endif /*DEBUG*/ + + static int +-vips_foreign_load_jp2k_set_header( VipsForeignLoadJp2k *jp2k, VipsImage *out ) ++vips_foreign_load_jp2k_set_header(VipsForeignLoadJp2k *jp2k, VipsImage *out) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( jp2k ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(jp2k); + opj_image_comp_t *first = &jp2k->image->comps[0]; + + VipsBandFormat format; +@@ -380,34 +378,28 @@ vips_foreign_load_jp2k_set_header( VipsForeignLoadJp2k *jp2k, VipsImage *out ) + + /* OpenJPEG only supports up to 31 bits per pixel. Treat it as 32. + */ +- if( first->prec <= 8 ) ++ if (first->prec <= 8) + format = first->sgnd ? VIPS_FORMAT_CHAR : VIPS_FORMAT_UCHAR; +- else if( first->prec <= 16 ) ++ else if (first->prec <= 16) + format = first->sgnd ? VIPS_FORMAT_SHORT : VIPS_FORMAT_USHORT; + else + format = first->sgnd ? VIPS_FORMAT_INT : VIPS_FORMAT_UINT; + +- switch( jp2k->image->color_space ) { ++ switch (jp2k->image->color_space) { + case OPJ_CLRSPC_SYCC: + case OPJ_CLRSPC_EYCC: + /* Map these to RGB. + */ +- interpretation = vips_format_sizeof( format ) == 1 ? +- VIPS_INTERPRETATION_sRGB : +- VIPS_INTERPRETATION_RGB16; ++ interpretation = vips_format_sizeof(format) == 1 ? VIPS_INTERPRETATION_sRGB : VIPS_INTERPRETATION_RGB16; + jp2k->ycc_to_rgb = TRUE; + break; + + case OPJ_CLRSPC_GRAY: +- interpretation = vips_format_sizeof( format ) == 1 ? +- VIPS_INTERPRETATION_B_W : +- VIPS_INTERPRETATION_GREY16; ++ interpretation = vips_format_sizeof(format) == 1 ? VIPS_INTERPRETATION_B_W : VIPS_INTERPRETATION_GREY16; + break; + + case OPJ_CLRSPC_SRGB: +- interpretation = vips_format_sizeof( format ) == 1 ? +- VIPS_INTERPRETATION_sRGB : +- VIPS_INTERPRETATION_RGB16; ++ interpretation = vips_format_sizeof(format) == 1 ? VIPS_INTERPRETATION_sRGB : VIPS_INTERPRETATION_RGB16; + break; + + case OPJ_CLRSPC_CMYK: +@@ -417,19 +409,15 @@ vips_foreign_load_jp2k_set_header( VipsForeignLoadJp2k *jp2k, VipsImage *out ) + case OPJ_CLRSPC_UNSPECIFIED: + /* Try to guess something sensible. + */ +- if( jp2k->image->numcomps < 3 ) +- interpretation = vips_format_sizeof( format ) == 1 ? +- VIPS_INTERPRETATION_B_W : +- VIPS_INTERPRETATION_GREY16; ++ if (jp2k->image->numcomps < 3) ++ interpretation = vips_format_sizeof(format) == 1 ? VIPS_INTERPRETATION_B_W : VIPS_INTERPRETATION_GREY16; + else +- interpretation = vips_format_sizeof( format ) == 1 ? +- VIPS_INTERPRETATION_sRGB : +- VIPS_INTERPRETATION_RGB16; ++ interpretation = vips_format_sizeof(format) == 1 ? VIPS_INTERPRETATION_sRGB : VIPS_INTERPRETATION_RGB16; + + /* Unspecified with three bands and subsampling on bands 2 and +- * 3 is usually YCC. ++ * 3 is usually YCC. + */ +- if( jp2k->image->numcomps == 3 && ++ if (jp2k->image->numcomps == 3 && + jp2k->image->comps[0].dx == 1 && + jp2k->image->comps[0].dy == 1 && + jp2k->image->comps[1].dx > 1 && +@@ -441,171 +429,172 @@ vips_foreign_load_jp2k_set_header( VipsForeignLoadJp2k *jp2k, VipsImage *out ) + break; + + default: +- vips_error( class->nickname, +- _( "unsupported colourspace %d" ), +- jp2k->image->color_space ); +- return( -1 ); ++ vips_error(class->nickname, ++ _("unsupported colourspace %d"), ++ jp2k->image->color_space); ++ return (-1); + } + + /* We use a tilecache on our output. + */ +- if( vips_image_pipelinev( out, VIPS_DEMAND_STYLE_SMALLTILE, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(out, VIPS_DEMAND_STYLE_SMALLTILE, NULL)) ++ return (-1); + +- vips_image_init_fields( out, +- first->w, first->h, jp2k->image->numcomps, format, +- VIPS_CODING_NONE, interpretation, 1.0, 1.0 ); ++ vips_image_init_fields(out, ++ first->w, first->h, jp2k->image->numcomps, format, ++ VIPS_CODING_NONE, interpretation, 1.0, 1.0); + + /* openjpeg allows left and top of the coordinate grid to be + * non-zero. These are always in unshrunk coordinates. + */ +- out->Xoffset = +- -VIPS_ROUND_INT( (double) jp2k->image->x0 / jp2k->shrink ); +- out->Yoffset = +- -VIPS_ROUND_INT( (double) jp2k->image->y0 / jp2k->shrink ); +- +- if( jp2k->image->icc_profile_buf && +- jp2k->image->icc_profile_len > 0 ) +- vips_image_set_blob_copy( out, VIPS_META_ICC_NAME, ++ out->Xoffset = ++ -VIPS_ROUND_INT((double) jp2k->image->x0 / jp2k->shrink); ++ out->Yoffset = ++ -VIPS_ROUND_INT((double) jp2k->image->y0 / jp2k->shrink); ++ ++ if (jp2k->image->icc_profile_buf && ++ jp2k->image->icc_profile_len > 0) ++ vips_image_set_blob_copy(out, VIPS_META_ICC_NAME, + jp2k->image->icc_profile_buf, +- jp2k->image->icc_profile_len ); ++ jp2k->image->icc_profile_len); + +- /* Map number of layers in image to pages. ++ /* Map number of layers in image to pages. + */ +- if( jp2k->info && +- jp2k->info->m_default_tile_info.tccp_info ) +- vips_image_set_int( out, VIPS_META_N_PAGES, +- jp2k->info->m_default_tile_info.tccp_info-> +- numresolutions ); ++ if (jp2k->info && ++ jp2k->info->m_default_tile_info.tccp_info) ++ vips_image_set_int(out, VIPS_META_N_PAGES, ++ jp2k->info->m_default_tile_info.tccp_info->numresolutions); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_jp2k_header( VipsForeignLoad *load ) ++vips_foreign_load_jp2k_header(VipsForeignLoad *load) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( load ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(load); + VipsForeignLoadJp2k *jp2k = (VipsForeignLoadJp2k *) load; + + opj_image_comp_t *first; + int i; + + #ifdef DEBUG +- printf( "vips_foreign_load_jp2k_header:\n" ); ++ printf("vips_foreign_load_jp2k_header:\n"); + #endif /*DEBUG*/ + +- jp2k->format = vips_foreign_load_jp2k_get_format( jp2k->source ); +- vips_source_rewind( jp2k->source ); +- if( !(jp2k->codec = opj_create_decompress( jp2k->format )) ) +- return( -1 ); ++ jp2k->format = vips_foreign_load_jp2k_get_format(jp2k->source); ++ vips_source_rewind(jp2k->source); ++ if (!(jp2k->codec = opj_create_decompress(jp2k->format))) ++ return (-1); + +- vips_foreign_load_jp2k_attach_handlers( jp2k, jp2k->codec ); ++ vips_foreign_load_jp2k_attach_handlers(jp2k, jp2k->codec); + + jp2k->shrink = 1 << jp2k->page; + jp2k->parameters.cp_reduce = jp2k->page; +- if( !opj_setup_decoder( jp2k->codec, &jp2k->parameters ) ) +- return( -1 ); ++ if (!opj_setup_decoder(jp2k->codec, &jp2k->parameters)) ++ return (-1); + +- opj_codec_set_threads( jp2k->codec, vips_concurrency_get() ); ++ opj_codec_set_threads(jp2k->codec, vips_concurrency_get()); + +- if( !opj_read_header( jp2k->stream, jp2k->codec, &jp2k->image ) ) +- return( -1 ); +- if( !(jp2k->info = opj_get_cstr_info( jp2k->codec )) ) +- return( -1 ); ++ if (!opj_read_header(jp2k->stream, jp2k->codec, &jp2k->image)) ++ return (-1); ++ if (!(jp2k->info = opj_get_cstr_info(jp2k->codec))) ++ return (-1); + + #ifdef DEBUG +- vips_foreign_load_jp2k_print( jp2k ); ++ vips_foreign_load_jp2k_print(jp2k); + #endif /*DEBUG*/ + + /* We only allow images where all components have the same format. + */ +- if( jp2k->image->numcomps > MAX_BANDS ) { +- vips_error( class->nickname, +- "%s", _( "too many image bands" ) ); +- return( -1 ); ++ if (jp2k->image->numcomps > MAX_BANDS) { ++ vips_error(class->nickname, ++ "%s", _("too many image bands")); ++ return (-1); + } +- if( jp2k->image->numcomps == 0 ) { +- vips_error( class->nickname, +- "%s", _( "no image components" ) ); +- return( -1 ); ++ if (jp2k->image->numcomps == 0) { ++ vips_error(class->nickname, ++ "%s", _("no image components")); ++ return (-1); + } + first = &jp2k->image->comps[0]; +- for( i = 1; i < jp2k->image->numcomps; i++ ) { ++ for (i = 1; i < jp2k->image->numcomps; i++) { + opj_image_comp_t *this = &jp2k->image->comps[i]; + +- if( this->x0 != first->x0 || ++ if (this->x0 != first->x0 || + this->y0 != first->y0 || + this->w * this->dx != first->w * first->dx || + this->h * this->dy != first->h * first->dy || + this->resno_decoded != first->resno_decoded || +- this->factor != first->factor ) { +- vips_error( class->nickname, +- "%s", _( "components differ in geometry" ) ); +- return( -1 ); ++ this->factor != first->factor) { ++ vips_error(class->nickname, ++ "%s", _("components differ in geometry")); ++ return (-1); + } + +- if( this->prec != first->prec || +- this->sgnd != first->sgnd ) { +- vips_error( class->nickname, +- "%s", _( "components differ in precision" ) ); +- return( -1 ); ++ if (this->prec != first->prec || ++ this->sgnd != first->sgnd) { ++ vips_error(class->nickname, ++ "%s", _("components differ in precision")); ++ return (-1); + } + + /* If dx/dy are not 1, we'll need to upsample components during + * tile packing. + */ +- if( this->dx != first->dx || ++ if (this->dx != first->dx || + this->dy != first->dy || + first->dx != 1 || +- first->dy != 1 ) ++ first->dy != 1) + jp2k->upsample = TRUE; + } + +- if( vips_foreign_load_jp2k_set_header( jp2k, load->out ) ) +- return( -1 ); ++ if (vips_foreign_load_jp2k_set_header(jp2k, load->out)) ++ return (-1); + +- VIPS_SETSTR( load->out->filename, +- vips_connection_filename( VIPS_CONNECTION( jp2k->source ) ) ); ++ VIPS_SETSTR(load->out->filename, ++ vips_connection_filename(VIPS_CONNECTION(jp2k->source))); + +- return( 0 ); ++ return (0); + } + +-#define PACK( TYPE ) { \ +- TYPE *tq = (TYPE *) q; \ +- \ +- for( x = 0; x < length; x++ ) { \ +- for( i = 0; i < b; i++ ) \ +- tq[i] = planes[i][x]; \ +- \ +- tq += b; \ +- } \ +-} ++#define PACK(TYPE) \ ++ { \ ++ TYPE *tq = (TYPE *) q; \ ++\ ++ for (x = 0; x < length; x++) { \ ++ for (i = 0; i < b; i++) \ ++ tq[i] = planes[i][x]; \ ++\ ++ tq += b; \ ++ } \ ++ } + +-#define PACK_UPSAMPLE( TYPE ) { \ +- TYPE *tq = (TYPE *) q; \ +- \ +- for( x = 0; x < length; x++ ) { \ +- for( i = 0; i < b; i++ ) { \ +- int dx = image->comps[i].dx; \ +- int pixel = planes[i][x / dx]; \ +- \ +- tq[i] = pixel; \ ++#define PACK_UPSAMPLE(TYPE) \ ++ { \ ++ TYPE *tq = (TYPE *) q; \ ++\ ++ for (x = 0; x < length; x++) { \ ++ for (i = 0; i < b; i++) { \ ++ int dx = image->comps[i].dx; \ ++ int pixel = planes[i][x / dx]; \ ++\ ++ tq[i] = pixel; \ ++ } \ ++\ ++ tq += b; \ + } \ +- \ +- tq += b; \ +- } \ +-} ++ } + + /* Pack a line of openjpeg pixels into libvips format. left/top are the +- * offsets into the opj image in pixel coordinates where we should start ++ * offsets into the opj image in pixel coordinates where we should start + * reading. + * + * Set upsample if any opj component is subsampled. + */ + static void +-vips_foreign_load_jp2k_pack( gboolean upsample, +- opj_image_t *image, VipsImage *im, +- VipsPel *q, int left, int top, int length ) ++vips_foreign_load_jp2k_pack(gboolean upsample, ++ opj_image_t *image, VipsImage *im, ++ VipsPel *q, int left, int top, int length) + { + int *planes[MAX_BANDS]; + int b = image->numcomps; +@@ -613,56 +602,56 @@ vips_foreign_load_jp2k_pack( gboolean upsample, + int x, i; + + #ifdef DEBUG_VERBOSE +- printf( "vips_foreign_load_jp2k_pack: " +- "upsample = %d, left = %d, top = %d, length = %d\n", +- upsample, left, top, length ); ++ printf("vips_foreign_load_jp2k_pack: " ++ "upsample = %d, left = %d, top = %d, length = %d\n", ++ upsample, left, top, length); + #endif /*DEBUG_VERBOSE*/ + +- for( i = 0; i < b; i++ ) { ++ for (i = 0; i < b; i++) { + opj_image_comp_t *comp = &image->comps[i]; + +- planes[i] = comp->data + (top / comp->dy) * comp->w + ++ planes[i] = comp->data + (top / comp->dy) * comp->w + + (left / comp->dx); + } + +- if( upsample ) +- switch( im->BandFmt ) { ++ if (upsample) ++ switch (im->BandFmt) { + case VIPS_FORMAT_CHAR: + case VIPS_FORMAT_UCHAR: +- PACK_UPSAMPLE( unsigned char ); ++ PACK_UPSAMPLE(unsigned char); + break; + + case VIPS_FORMAT_SHORT: + case VIPS_FORMAT_USHORT: +- PACK_UPSAMPLE( unsigned short ); ++ PACK_UPSAMPLE(unsigned short); + break; + + case VIPS_FORMAT_INT: + case VIPS_FORMAT_UINT: +- PACK_UPSAMPLE( unsigned int ); ++ PACK_UPSAMPLE(unsigned int); + break; + + default: + g_assert_not_reached(); + break; + } +- else ++ else + /* Fast no-upsample path. + */ +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_CHAR: + case VIPS_FORMAT_UCHAR: +- PACK( unsigned char ); ++ PACK(unsigned char); + break; + + case VIPS_FORMAT_SHORT: + case VIPS_FORMAT_USHORT: +- PACK( unsigned short ); ++ PACK(unsigned short); + break; + + case VIPS_FORMAT_INT: + case VIPS_FORMAT_UINT: +- PACK( unsigned int ); ++ PACK(unsigned int); + break; + + default: +@@ -675,34 +664,35 @@ vips_foreign_load_jp2k_pack( gboolean upsample, + * + * See also https://en.wikipedia.org/wiki/YCbCr#JPEG_conversion + */ +-#define YCC_TO_RGB( TYPE ) { \ +- TYPE *tq = (TYPE *) q; \ +- \ +- for( x = 0; x < length; x++ ) { \ +- int y = tq[0]; \ +- int cb = tq[1] - offset; \ +- int cr = tq[2] - offset; \ +- \ +- int r, g, b; \ +- \ +- r = y + (int)(1.402 * (float)cr); \ +- tq[0] = VIPS_CLIP( 0, r, upb ); \ +- \ +- g = y - (int)(0.344 * (float)cb + 0.714 * (float)cr); \ +- tq[1] = VIPS_CLIP( 0, g, upb ); \ +- \ +- b = y + (int)(1.772 * (float)cb); \ +- tq[2] = VIPS_CLIP( 0, b, upb ); \ +- \ +- tq += 3; \ +- } \ +-} ++#define YCC_TO_RGB(TYPE) \ ++ { \ ++ TYPE *tq = (TYPE *) q; \ ++\ ++ for (x = 0; x < length; x++) { \ ++ int y = tq[0]; \ ++ int cb = tq[1] - offset; \ ++ int cr = tq[2] - offset; \ ++\ ++ int r, g, b; \ ++\ ++ r = y + (int) (1.402 * (float) cr); \ ++ tq[0] = VIPS_CLIP(0, r, upb); \ ++\ ++ g = y - (int) (0.344 * (float) cb + 0.714 * (float) cr); \ ++ tq[1] = VIPS_CLIP(0, g, upb); \ ++\ ++ b = y + (int) (1.772 * (float) cb); \ ++ tq[2] = VIPS_CLIP(0, b, upb); \ ++\ ++ tq += 3; \ ++ } \ ++ } + + /* YCC->RGB for a line of pels. + */ + static void +-vips_foreign_load_jp2k_ycc_to_rgb( opj_image_t *image, VipsImage *im, +- VipsPel *q, int length ) ++vips_foreign_load_jp2k_ycc_to_rgb(opj_image_t *image, VipsImage *im, ++ VipsPel *q, int length) + { + int prec = image->comps[0].prec; + int offset = 1 << (prec - 1); +@@ -710,20 +700,20 @@ vips_foreign_load_jp2k_ycc_to_rgb( opj_image_t *image, VipsImage *im, + + int x; + +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_CHAR: + case VIPS_FORMAT_UCHAR: +- YCC_TO_RGB( unsigned char ); ++ YCC_TO_RGB(unsigned char); + break; + + case VIPS_FORMAT_SHORT: + case VIPS_FORMAT_USHORT: +- YCC_TO_RGB( unsigned short ); ++ YCC_TO_RGB(unsigned short); + break; + + case VIPS_FORMAT_INT: + case VIPS_FORMAT_UINT: +- YCC_TO_RGB( unsigned int ); ++ YCC_TO_RGB(unsigned int); + break; + + default: +@@ -732,42 +722,43 @@ vips_foreign_load_jp2k_ycc_to_rgb( opj_image_t *image, VipsImage *im, + } + } + +-#define LSHIFT( TYPE ) { \ +- TYPE *tq = (TYPE *) q; \ +- \ +- for( x = 0; x < n_elements; x++ ) \ +- tq[x] = VIPS_LSHIFT_INT( tq[x], shift ); \ +-} ++#define LSHIFT(TYPE) \ ++ { \ ++ TYPE *tq = (TYPE *) q; \ ++\ ++ for (x = 0; x < n_elements; x++) \ ++ tq[x] = VIPS_LSHIFT_INT(tq[x], shift); \ ++ } + + /* Left-justify to the libvips pixel bits. We need 12 bit precision images + * (for example) to fill 0-65535. + */ + static void +-vips_foreign_load_jp2k_ljust( opj_image_t *image, VipsImage *im, +- VipsPel *q, int length ) ++vips_foreign_load_jp2k_ljust(opj_image_t *image, VipsImage *im, ++ VipsPel *q, int length) + { + int prec = image->comps[0].prec; +- int shift = VIPS_IMAGE_SIZEOF_ELEMENT( im ) * 8 - prec; ++ int shift = VIPS_IMAGE_SIZEOF_ELEMENT(im) * 8 - prec; + +- if( shift != 0 ) { ++ if (shift != 0) { + int n_elements = length * im->Bands; + + int x; + +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_CHAR: + case VIPS_FORMAT_UCHAR: +- LSHIFT( unsigned char ); ++ LSHIFT(unsigned char); + break; + + case VIPS_FORMAT_SHORT: + case VIPS_FORMAT_USHORT: +- LSHIFT( unsigned short ); ++ LSHIFT(unsigned short); + break; + + case VIPS_FORMAT_INT: + case VIPS_FORMAT_UINT: +- LSHIFT( unsigned int ); ++ LSHIFT(unsigned int); + break; + + default: +@@ -777,11 +768,11 @@ vips_foreign_load_jp2k_ljust( opj_image_t *image, VipsImage *im, + } + } + +-/* Read a tile from an untiled jp2k file. ++/* Read a tile from an untiled jp2k file. + */ + static int +-vips_foreign_load_jp2k_generate_untiled( VipsRegion *out, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_foreign_load_jp2k_generate_untiled(VipsRegion *out, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsForeignLoad *load = (VipsForeignLoad *) a; + VipsForeignLoadJp2k *jp2k = (VipsForeignLoadJp2k *) load; +@@ -792,16 +783,16 @@ vips_foreign_load_jp2k_generate_untiled( VipsRegion *out, + int y; + + #ifdef DEBUG_VERBOSE +- printf( "vips_foreign_load_jp2k_generate_untiled: " +- "left = %d, top = %d, width = %d, height = %d\n", +- r->left, r->top, r->width, r->height ); ++ printf("vips_foreign_load_jp2k_generate_untiled: " ++ "left = %d, top = %d, width = %d, height = %d\n", ++ r->left, r->top, r->width, r->height); + #endif /*DEBUG_VERBOSE*/ + + /* If openjpeg has flagged an error, the library is not in a known + * state and it's not safe to call again. + */ +- if( jp2k->n_errors ) +- return( 0 ); ++ if (jp2k->n_errors) ++ return (0); + + /* Coordinates are always in the highest res level. + */ +@@ -816,49 +807,49 @@ vips_foreign_load_jp2k_generate_untiled( VipsRegion *out, + image.top = 0; + image.width = jp2k->info->tdx; + image.height = jp2k->info->tdy; +- vips_rect_intersectrect( &opj, &image, &opj ); ++ vips_rect_intersectrect(&opj, &image, &opj); + +- if( !opj_set_decode_area( jp2k->codec, jp2k->image, +- opj.left, opj.top, +- VIPS_RECT_RIGHT( &opj ), VIPS_RECT_BOTTOM( &opj ) ) ) +- return( -1 ); ++ if (!opj_set_decode_area(jp2k->codec, jp2k->image, ++ opj.left, opj.top, ++ VIPS_RECT_RIGHT(&opj), VIPS_RECT_BOTTOM(&opj))) ++ return (-1); + +- if( !opj_decode( jp2k->codec, jp2k->stream, jp2k->image ) ) +- return( -1 ); ++ if (!opj_decode(jp2k->codec, jp2k->stream, jp2k->image)) ++ return (-1); + +- /* Unpack decoded pixels to buffer in vips layout. ++ /* Unpack decoded pixels to buffer in vips layout. + */ +- for( y = 0; y < r->height; y++ ) { +- VipsPel *q = VIPS_REGION_ADDR( out, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *q = VIPS_REGION_ADDR(out, r->left, r->top + y); + +- vips_foreign_load_jp2k_pack( jp2k->upsample, +- jp2k->image, out->im, q, 0, y, r->width ); ++ vips_foreign_load_jp2k_pack(jp2k->upsample, ++ jp2k->image, out->im, q, 0, y, r->width); + +- if( jp2k->ycc_to_rgb ) +- vips_foreign_load_jp2k_ycc_to_rgb( jp2k->image, +- out->im, q, r->width ); ++ if (jp2k->ycc_to_rgb) ++ vips_foreign_load_jp2k_ycc_to_rgb(jp2k->image, ++ out->im, q, r->width); + +- vips_foreign_load_jp2k_ljust( jp2k->image, +- out->im, q, r->width ); ++ vips_foreign_load_jp2k_ljust(jp2k->image, ++ out->im, q, r->width); + } + + /* jp2k files can't be truncated (they fail to open), so all we can + * spot is errors. + */ +- if( load->fail_on >= VIPS_FAIL_ON_ERROR && +- jp2k->n_errors > 0 ) +- return( -1 ); ++ if (load->fail_on >= VIPS_FAIL_ON_ERROR && ++ jp2k->n_errors > 0) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Read a tile from the file. libvips tiles can be much larger or smaller than +- * openjpeg tiles, so we must loop over the output region, painting in ++ * openjpeg tiles, so we must loop over the output region, painting in + * tiles from the file. + */ + static int +-vips_foreign_load_jp2k_generate_tiled( VipsRegion *out, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_foreign_load_jp2k_generate_tiled(VipsRegion *out, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsForeignLoad *load = (VipsForeignLoad *) a; + VipsForeignLoadJp2k *jp2k = (VipsForeignLoadJp2k *) load; +@@ -866,10 +857,10 @@ vips_foreign_load_jp2k_generate_tiled( VipsRegion *out, + + /* jp2k get smaller with the layer size. + */ +- int tile_width = VIPS_ROUND_UINT( +- (double) jp2k->info->tdx / jp2k->shrink ); +- int tile_height = VIPS_ROUND_UINT( +- (double) jp2k->info->tdy / jp2k->shrink ); ++ int tile_width = VIPS_ROUND_UINT( ++ (double) jp2k->info->tdx / jp2k->shrink); ++ int tile_height = VIPS_ROUND_UINT( ++ (double) jp2k->info->tdy / jp2k->shrink); + + /* ... so tiles_across is always the same. + */ +@@ -878,19 +869,19 @@ vips_foreign_load_jp2k_generate_tiled( VipsRegion *out, + int x, y, z; + + #ifdef DEBUG_VERBOSE +- printf( "vips_foreign_load_jp2k_generate: " +- "left = %d, top = %d, width = %d, height = %d\n", +- r->left, r->top, r->width, r->height ); ++ printf("vips_foreign_load_jp2k_generate: " ++ "left = %d, top = %d, width = %d, height = %d\n", ++ r->left, r->top, r->width, r->height); + #endif /*DEBUG_VERBOSE*/ + + /* If openjpeg has flagged an error, the library is not in a known + * state and it's not safe to call again. + */ +- if( jp2k->n_errors ) +- return( 0 ); ++ if (jp2k->n_errors) ++ return (0); + + y = 0; +- while( y < r->height ) { ++ while (y < r->height) { + VipsRect tile, hit; + + /* Not necessary, but it stops static analyzers complaining +@@ -899,7 +890,7 @@ vips_foreign_load_jp2k_generate_tiled( VipsRegion *out, + hit.height = 0; + + x = 0; +- while( x < r->width ) { ++ while (x < r->width) { + /* Tile the xy falls in, in tile numbers. + */ + int tx = (r->left + x) / tile_width; +@@ -915,11 +906,11 @@ vips_foreign_load_jp2k_generate_tiled( VipsRegion *out, + /* Fetch the tile. + */ + #ifdef DEBUG_VERBOSE +- printf( " fetch tile %d\n", tile_index ); ++ printf(" fetch tile %d\n", tile_index); + #endif /*DEBUG_VERBOSE*/ +- if( !opj_get_decoded_tile( jp2k->codec, +- jp2k->stream, jp2k->image, tile_index ) ) +- return( -1 ); ++ if (!opj_get_decoded_tile(jp2k->codec, ++ jp2k->stream, jp2k->image, tile_index)) ++ return (-1); + + /* Intersect tile with request to get pixels we need + * to copy out. +@@ -928,27 +919,27 @@ vips_foreign_load_jp2k_generate_tiled( VipsRegion *out, + tile.top = ys; + tile.width = tile_width; + tile.height = tile_height; +- vips_rect_intersectrect( &tile, r, &hit ); ++ vips_rect_intersectrect(&tile, r, &hit); + +- /* Unpack hit pixels to buffer in vips layout. ++ /* Unpack hit pixels to buffer in vips layout. + */ +- for( z = 0; z < hit.height; z++ ) { +- VipsPel *q = VIPS_REGION_ADDR( out, +- hit.left, hit.top + z ); ++ for (z = 0; z < hit.height; z++) { ++ VipsPel *q = VIPS_REGION_ADDR(out, ++ hit.left, hit.top + z); + +- vips_foreign_load_jp2k_pack( jp2k->upsample, ++ vips_foreign_load_jp2k_pack(jp2k->upsample, + jp2k->image, out->im, q, + hit.left - tile.left, + hit.top - tile.top + z, +- hit.width ); ++ hit.width); + +- if( jp2k->ycc_to_rgb ) +- vips_foreign_load_jp2k_ycc_to_rgb( +- jp2k->image, out->im, q, +- hit.width ); ++ if (jp2k->ycc_to_rgb) ++ vips_foreign_load_jp2k_ycc_to_rgb( ++ jp2k->image, out->im, q, ++ hit.width); + +- vips_foreign_load_jp2k_ljust( jp2k->image, +- out->im, q, hit.width ); ++ vips_foreign_load_jp2k_ljust(jp2k->image, ++ out->im, q, hit.width); + } + + x += hit.width; +@@ -963,80 +954,80 @@ vips_foreign_load_jp2k_generate_tiled( VipsRegion *out, + /* jp2k files can't be truncated (they fail to open), so all we can + * spot is errors. + */ +- if( load->fail_on >= VIPS_FAIL_ON_ERROR && +- jp2k->n_errors > 0 ) +- return( -1 ); ++ if (load->fail_on >= VIPS_FAIL_ON_ERROR && ++ jp2k->n_errors > 0) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_jp2k_load( VipsForeignLoad *load ) ++vips_foreign_load_jp2k_load(VipsForeignLoad *load) + { + VipsForeignLoadJp2k *jp2k = (VipsForeignLoadJp2k *) load; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( load ), 3 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(load), 3); + + int vips_tile_width; + int vips_tile_height; + int vips_tiles_across; + + #ifdef DEBUG +- printf( "vips_foreign_load_jp2k_load:\n" ); ++ printf("vips_foreign_load_jp2k_load:\n"); + #endif /*DEBUG*/ + + t[0] = vips_image_new(); +- if( vips_foreign_load_jp2k_set_header( jp2k, t[0] ) ) +- return( -1 ); ++ if (vips_foreign_load_jp2k_set_header(jp2k, t[0])) ++ return (-1); + + /* Untiled jp2k images need a different read API. + */ +- if( jp2k->info->tw == 1 && +- jp2k->info->th == 1 ) { ++ if (jp2k->info->tw == 1 && ++ jp2k->info->th == 1) { + vips_tile_width = 512; + vips_tile_height = 512; +- vips_tiles_across = +- VIPS_ROUND_UP( t[0]->Xsize, vips_tile_width ) / ++ vips_tiles_across = ++ VIPS_ROUND_UP(t[0]->Xsize, vips_tile_width) / + vips_tile_width; + +- if( vips_image_generate( t[0], +- NULL, vips_foreign_load_jp2k_generate_untiled, NULL, +- jp2k, NULL ) ) +- return( -1 ); ++ if (vips_image_generate(t[0], ++ NULL, vips_foreign_load_jp2k_generate_untiled, NULL, ++ jp2k, NULL)) ++ return (-1); + } + else { + vips_tile_width = jp2k->info->tdx; + vips_tile_height = jp2k->info->tdy; +- vips_tiles_across = jp2k->info->tw; ++ vips_tiles_across = jp2k->info->tw; + +- if( vips_image_generate( t[0], +- NULL, vips_foreign_load_jp2k_generate_tiled, NULL, +- jp2k, NULL ) ) +- return( -1 ); ++ if (vips_image_generate(t[0], ++ NULL, vips_foreign_load_jp2k_generate_tiled, NULL, ++ jp2k, NULL)) ++ return (-1); + } + +- /* Copy to out, adding a cache. Enough tiles for two complete ++ /* Copy to out, adding a cache. Enough tiles for two complete + * rows, plus 50%. + */ +- if( vips_tilecache( t[0], &t[1], +- "tile_width", vips_tile_width, +- "tile_height", vips_tile_height, +- "max_tiles", 3 * vips_tiles_across, +- NULL ) ) +- return( -1 ); ++ if (vips_tilecache(t[0], &t[1], ++ "tile_width", vips_tile_width, ++ "tile_height", vips_tile_height, ++ "max_tiles", 3 * vips_tiles_across, ++ NULL)) ++ return (-1); + +- if( vips_image_write( t[1], load->real ) ) +- return( -1 ); ++ if (vips_image_write(t[1], load->real)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_jp2k_class_init( VipsForeignLoadJp2kClass *class ) ++vips_foreign_load_jp2k_class_init(VipsForeignLoadJp2kClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->dispose = vips_foreign_load_jp2k_dispose; +@@ -1044,7 +1035,7 @@ vips_foreign_load_jp2k_class_init( VipsForeignLoadJp2kClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "jp2kload_base"; +- object_class->description = _( "load JPEG2000 image" ); ++ object_class->description = _("load JPEG2000 image"); + object_class->build = vips_foreign_load_jp2k_build; + + /* OpenJPEG is fuzzed, but not by us. +@@ -1055,17 +1046,16 @@ vips_foreign_load_jp2k_class_init( VipsForeignLoadJp2kClass *class ) + load_class->header = vips_foreign_load_jp2k_header; + load_class->load = vips_foreign_load_jp2k_load; + +- VIPS_ARG_INT( class, "page", 20, +- _( "Page" ), +- _( "Load this page from the image" ), ++ VIPS_ARG_INT(class, "page", 20, ++ _("Page"), ++ _("Load this page from the image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadJp2k, page ), +- 0, 100000, 0 ); +- ++ G_STRUCT_OFFSET(VipsForeignLoadJp2k, page), ++ 0, 100000, 0); + } + + static void +-vips_foreign_load_jp2k_init( VipsForeignLoadJp2k *jp2k ) ++vips_foreign_load_jp2k_init(VipsForeignLoadJp2k *jp2k) + { + } + +@@ -1074,54 +1064,52 @@ typedef struct _VipsForeignLoadJp2kFile { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadJp2kFile; + + typedef VipsForeignLoadJp2kClass VipsForeignLoadJp2kFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadJp2kFile, vips_foreign_load_jp2k_file, +- vips_foreign_load_jp2k_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadJp2kFile, vips_foreign_load_jp2k_file, ++ vips_foreign_load_jp2k_get_type()); + + static int +-vips_foreign_load_jp2k_file_build( VipsObject *object ) ++vips_foreign_load_jp2k_file_build(VipsObject *object) + { + VipsForeignLoadJp2k *jp2k = (VipsForeignLoadJp2k *) object; + VipsForeignLoadJp2kFile *file = (VipsForeignLoadJp2kFile *) object; + +- if( file->filename && +- !(jp2k->source = vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(jp2k->source = vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_jp2k_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_jp2k_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-const char *vips__jp2k_suffs[] = +- { ".j2k", ".jp2", ".jpt", ".j2c", ".jpc", NULL }; ++const char *vips__jp2k_suffs[] = { ".j2k", ".jp2", ".jpt", ".j2c", ".jpc", NULL }; + + static int +-vips_foreign_load_jp2k_is_a( const char *filename ) ++vips_foreign_load_jp2k_is_a(const char *filename) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( FALSE ); +- result = vips_foreign_load_jp2k_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (FALSE); ++ result = vips_foreign_load_jp2k_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static void +-vips_foreign_load_jp2k_file_class_init( +- VipsForeignLoadJp2kFileClass *class ) ++vips_foreign_load_jp2k_file_class_init( ++ VipsForeignLoadJp2kFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -1136,17 +1124,16 @@ vips_foreign_load_jp2k_file_class_init( + + load_class->is_a = vips_foreign_load_jp2k_is_a; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadJp2kFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadJp2kFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_jp2k_file_init( VipsForeignLoadJp2kFile *jp2k ) ++vips_foreign_load_jp2k_file_init(VipsForeignLoadJp2kFile *jp2k) + { + } + +@@ -1161,48 +1148,47 @@ typedef struct _VipsForeignLoadJp2kBuffer { + + typedef VipsForeignLoadJp2kClass VipsForeignLoadJp2kBufferClass; + +-G_DEFINE_TYPE( VipsForeignLoadJp2kBuffer, vips_foreign_load_jp2k_buffer, +- vips_foreign_load_jp2k_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadJp2kBuffer, vips_foreign_load_jp2k_buffer, ++ vips_foreign_load_jp2k_get_type()); + + static int +-vips_foreign_load_jp2k_buffer_build( VipsObject *object ) ++vips_foreign_load_jp2k_buffer_build(VipsObject *object) + { + VipsForeignLoadJp2k *jp2k = (VipsForeignLoadJp2k *) object; +- VipsForeignLoadJp2kBuffer *buffer = ++ VipsForeignLoadJp2kBuffer *buffer = + (VipsForeignLoadJp2kBuffer *) object; + +- if( buffer->buf ) +- if( !(jp2k->source = vips_source_new_from_memory( +- VIPS_AREA( buffer->buf )->data, +- VIPS_AREA( buffer->buf )->length )) ) +- return( -1 ); ++ if (buffer->buf) ++ if (!(jp2k->source = vips_source_new_from_memory( ++ VIPS_AREA(buffer->buf)->data, ++ VIPS_AREA(buffer->buf)->length))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_jp2k_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_jp2k_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_jp2k_buffer_is_a( const void *buf, size_t len ) ++vips_foreign_load_jp2k_buffer_is_a(const void *buf, size_t len) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_memory( buf, len )) ) +- return( FALSE ); +- result = vips_foreign_load_jp2k_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_memory(buf, len))) ++ return (FALSE); ++ result = vips_foreign_load_jp2k_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static void +-vips_foreign_load_jp2k_buffer_class_init( +- VipsForeignLoadJp2kBufferClass *class ) ++vips_foreign_load_jp2k_buffer_class_init( ++ VipsForeignLoadJp2kBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -1214,17 +1200,16 @@ vips_foreign_load_jp2k_buffer_class_init( + + load_class->is_a_buffer = vips_foreign_load_jp2k_buffer_is_a; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadJp2kBuffer, buf ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadJp2kBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_load_jp2k_buffer_init( VipsForeignLoadJp2kBuffer *buffer ) ++vips_foreign_load_jp2k_buffer_init(VipsForeignLoadJp2kBuffer *buffer) + { + } + +@@ -1239,36 +1224,36 @@ typedef struct _VipsForeignLoadJp2kSource { + + typedef VipsForeignLoadJp2kClass VipsForeignLoadJp2kSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadJp2kSource, vips_foreign_load_jp2k_source, +- vips_foreign_load_jp2k_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadJp2kSource, vips_foreign_load_jp2k_source, ++ vips_foreign_load_jp2k_get_type()); + + static int +-vips_foreign_load_jp2k_source_build( VipsObject *object ) ++vips_foreign_load_jp2k_source_build(VipsObject *object) + { + VipsForeignLoadJp2k *jp2k = (VipsForeignLoadJp2k *) object; +- VipsForeignLoadJp2kSource *source = ++ VipsForeignLoadJp2kSource *source = + (VipsForeignLoadJp2kSource *) object; + +- if( source->source ) { ++ if (source->source) { + jp2k->source = source->source; +- g_object_ref( jp2k->source ); ++ g_object_ref(jp2k->source); + } + +- if( VIPS_OBJECT_CLASS( +- vips_foreign_load_jp2k_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS( ++ vips_foreign_load_jp2k_source_parent_class) ++ ->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_jp2k_source_class_init( +- VipsForeignLoadJp2kSourceClass *class ) ++vips_foreign_load_jp2k_source_class_init( ++ VipsForeignLoadJp2kSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -1281,79 +1266,78 @@ vips_foreign_load_jp2k_source_class_init( + + load_class->is_a_source = vips_foreign_load_jp2k_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadJp2kSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadJp2kSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_jp2k_source_init( +- VipsForeignLoadJp2kSource *jp2k ) ++vips_foreign_load_jp2k_source_init( ++ VipsForeignLoadJp2kSource *jp2k) + { + } + +-static void +-info_callback( const char *msg G_GNUC_UNUSED, void *data G_GNUC_UNUSED ) ++static void ++info_callback(const char *msg G_GNUC_UNUSED, void *data G_GNUC_UNUSED) + { + /* There's a lot of info as well ... + */ + #ifdef DEBUG +- printf( "info_callback: %s\n", msg ); ++ printf("info_callback: %s\n", msg); + #endif /*DEBUG*/ + } + +-static void +-warning_callback( const char *msg G_GNUC_UNUSED, void *data G_GNUC_UNUSED ) ++static void ++warning_callback(const char *msg G_GNUC_UNUSED, void *data G_GNUC_UNUSED) + { + /* There are a lot of warnings ... + */ + #ifdef DEBUG +- printf( "warning_callback: %s\n", msg ); ++ printf("warning_callback: %s\n", msg); + #endif /*DEBUG*/ + } + +-static void +-error_callback( const char *msg, void *data ) ++static void ++error_callback(const char *msg, void *data) + { + #ifdef DEBUG +- printf( "error_callback: %s\n", msg ); ++ printf("error_callback: %s\n", msg); + #endif /*DEBUG*/ + +- vips_error( "OpenJPEG", "%s", msg ); ++ vips_error("OpenJPEG", "%s", msg); + } + + typedef struct _TileDecompress { + VipsSource *source; +- opj_stream_t *stream; +- opj_codec_t *codec; ++ opj_stream_t *stream; ++ opj_codec_t *codec; + opj_image_t *image; + } TileDecompress; + + static void +-vips__foreign_load_jp2k_decompress_free( TileDecompress *decompress ) ++vips__foreign_load_jp2k_decompress_free(TileDecompress *decompress) + { +- VIPS_FREEF( opj_destroy_codec, decompress->codec ); +- VIPS_FREEF( opj_image_destroy, decompress->image ); +- VIPS_FREEF( opj_stream_destroy, decompress->stream ); +- VIPS_UNREF( decompress->source ); ++ VIPS_FREEF(opj_destroy_codec, decompress->codec); ++ VIPS_FREEF(opj_image_destroy, decompress->image); ++ VIPS_FREEF(opj_stream_destroy, decompress->stream); ++ VIPS_UNREF(decompress->source); + } + +-/* Called from tiff2vips to decode a jp2k-compressed tile. ++/* Called from tiff2vips to decode a jp2k-compressed tile. + * +- * width/height is the tile size. If this is an edge tile, and smaller than ++ * width/height is the tile size. If this is an edge tile, and smaller than + * this, we still write a full-size tile and our caller will clip. + */ + int +-vips__foreign_load_jp2k_decompress( VipsImage *out, +- int width, int height, gboolean ycc_to_rgb, +- void *from, size_t from_length, +- void *to, size_t to_length ) ++vips__foreign_load_jp2k_decompress(VipsImage *out, ++ int width, int height, gboolean ycc_to_rgb, ++ void *from, size_t from_length, ++ void *to, size_t to_length) + { +- size_t pel_size = VIPS_IMAGE_SIZEOF_PEL( out ); ++ size_t pel_size = VIPS_IMAGE_SIZEOF_PEL(out); + size_t line_size = pel_size * width; + + TileDecompress decompress = { 0 }; +@@ -1364,93 +1348,93 @@ vips__foreign_load_jp2k_decompress( VipsImage *out, + int y; + + #ifdef DEBUG +- printf( "vips__foreign_load_jp2k_decompress: width = %d, height = %d, " +- "ycc_to_rgb = %d, from_length = %zd, to_length = %zd\n", +- width, height, ycc_to_rgb, from_length, to_length ); ++ printf("vips__foreign_load_jp2k_decompress: width = %d, height = %d, " ++ "ycc_to_rgb = %d, from_length = %zd, to_length = %zd\n", ++ width, height, ycc_to_rgb, from_length, to_length); + #endif /*DEBUG*/ + + /* Our ycc->rgb only works for exactly 3 bands. + */ + ycc_to_rgb = ycc_to_rgb && out->Bands == 3; + +- opj_set_default_decoder_parameters( ¶meters ); +- decompress.codec = opj_create_decompress( OPJ_CODEC_J2K ); +- opj_set_info_handler( decompress.codec, info_callback, NULL ); +- opj_set_warning_handler( decompress.codec, warning_callback, NULL ); +- opj_set_error_handler( decompress.codec, error_callback, NULL ); +- opj_setup_decoder( decompress.codec, ¶meters ); +- +- decompress.source = vips_source_new_from_memory( from, from_length ); +- decompress.stream = vips_foreign_load_jp2k_stream( decompress.source ); +- +- if( !opj_read_header( decompress.stream, +- decompress.codec, &decompress.image ) ) { +- vips_error( "jp2kload", "%s", ( "header error" ) ); +- vips__foreign_load_jp2k_decompress_free( &decompress ); +- return( -1 ); ++ opj_set_default_decoder_parameters(¶meters); ++ decompress.codec = opj_create_decompress(OPJ_CODEC_J2K); ++ opj_set_info_handler(decompress.codec, info_callback, NULL); ++ opj_set_warning_handler(decompress.codec, warning_callback, NULL); ++ opj_set_error_handler(decompress.codec, error_callback, NULL); ++ opj_setup_decoder(decompress.codec, ¶meters); ++ ++ decompress.source = vips_source_new_from_memory(from, from_length); ++ decompress.stream = vips_foreign_load_jp2k_stream(decompress.source); ++ ++ if (!opj_read_header(decompress.stream, ++ decompress.codec, &decompress.image)) { ++ vips_error("jp2kload", "%s", ("header error")); ++ vips__foreign_load_jp2k_decompress_free(&decompress); ++ return (-1); + } + +- if( decompress.image->x1 > width || ++ if (decompress.image->x1 > width || + decompress.image->y1 > height || +- line_size * height > to_length ) { +- vips_error( "jp2kload", "%s", ( "bad dimensions" ) ); +- vips__foreign_load_jp2k_decompress_free( &decompress ); +- return( -1 ); ++ line_size * height > to_length) { ++ vips_error("jp2kload", "%s", ("bad dimensions")); ++ vips__foreign_load_jp2k_decompress_free(&decompress); ++ return (-1); + } + +- if( !opj_decode( decompress.codec, +- decompress.stream, decompress.image ) ) { +- vips_error( "jp2kload", "%s", ( "decode error" ) ); +- vips__foreign_load_jp2k_decompress_free( &decompress ); +- return( -1 ); ++ if (!opj_decode(decompress.codec, ++ decompress.stream, decompress.image)) { ++ vips_error("jp2kload", "%s", ("decode error")); ++ vips__foreign_load_jp2k_decompress_free(&decompress); ++ return (-1); + } + + /* Do any components need upsampling? + */ + upsample = FALSE; +- for( i = 0; i < decompress.image->numcomps; i++ ) { ++ for (i = 0; i < decompress.image->numcomps; i++) { + opj_image_comp_t *this = &decompress.image->comps[i]; + +- if( this->dx > 1 || +- this->dy > 1 ) ++ if (this->dx > 1 || ++ this->dy > 1) + upsample = TRUE; + } + +- /* Unpack hit pixels to buffer in vips layout. ++ /* Unpack hit pixels to buffer in vips layout. + */ + q = to; +- for( y = 0; y < height; y++ ) { +- vips_foreign_load_jp2k_pack( upsample, ++ for (y = 0; y < height; y++) { ++ vips_foreign_load_jp2k_pack(upsample, + decompress.image, out, q, +- 0, y, width ); ++ 0, y, width); + +- if( ycc_to_rgb ) +- vips_foreign_load_jp2k_ycc_to_rgb( +- decompress.image, out, q, +- width ); ++ if (ycc_to_rgb) ++ vips_foreign_load_jp2k_ycc_to_rgb( ++ decompress.image, out, q, ++ width); + +- vips_foreign_load_jp2k_ljust( decompress.image, +- out, q, width ); ++ vips_foreign_load_jp2k_ljust(decompress.image, ++ out, q, width); + + q += line_size; + } + +- vips__foreign_load_jp2k_decompress_free( &decompress ); ++ vips__foreign_load_jp2k_decompress_free(&decompress); + +- return( 0 ); ++ return (0); + } + + #else /*!HAVE_LIBOPENJP2*/ + + int +-vips__foreign_load_jp2k_decompress( VipsImage *out, +- int width, int height, gboolean ycc_to_rgb, +- void *from, size_t from_length, +- void *to, size_t to_length ) ++vips__foreign_load_jp2k_decompress(VipsImage *out, ++ int width, int height, gboolean ycc_to_rgb, ++ void *from, size_t from_length, ++ void *to, size_t to_length) + { +- vips_error( "jp2k", +- "%s", _( "libvips built without JPEG2000 support" ) ); +- return( -1 ); ++ vips_error("jp2k", ++ "%s", _("libvips built without JPEG2000 support")); ++ return (-1); + } + + #endif /*HAVE_LIBOPENJP2*/ +@@ -1468,7 +1452,7 @@ vips__foreign_load_jp2k_decompress( VipsImage *out, + * + * Read a JPEG2000 image. The loader supports 8, 16 and 32-bit int pixel + * values, signed and unsigned. It supports greyscale, RGB, YCC, CMYK and +- * multispectral colour spaces. It will read any ICC profile on the image. ++ * multispectral colour spaces. It will read any ICC profile on the image. + * + * It will only load images where all channels have the same format. + * +@@ -1484,16 +1468,16 @@ vips__foreign_load_jp2k_decompress( VipsImage *out, + * Returns: 0 on success, -1 on error. + */ + int +-vips_jp2kload( const char *filename, VipsImage **out, ... ) ++vips_jp2kload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "jp2kload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("jp2kload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -1508,7 +1492,7 @@ vips_jp2kload( const char *filename, VipsImage **out, ... ) + * * @page: %gint, load this page + * * @fail_on: #VipsFailOn, types of read error to fail on + * +- * Exactly as vips_jp2kload(), but read from a buffer. ++ * Exactly as vips_jp2kload(), but read from a buffer. + * + * You must not free the buffer while @out is active. The + * #VipsObject::postclose signal on @out is a good place to free. +@@ -1516,7 +1500,7 @@ vips_jp2kload( const char *filename, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_jp2kload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++vips_jp2kload_buffer(void *buf, size_t len, VipsImage **out, ...) + { + va_list ap; + VipsBlob *blob; +@@ -1524,15 +1508,15 @@ vips_jp2kload_buffer( void *buf, size_t len, VipsImage **out, ... ) + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, buf, len ); ++ blob = vips_blob_new(NULL, buf, len); + +- va_start( ap, out ); +- result = vips_call_split( "jp2kload_buffer", ap, blob, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("jp2kload_buffer", ap, blob, out); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( result ); ++ return (result); + } + + /** +@@ -1546,19 +1530,19 @@ vips_jp2kload_buffer( void *buf, size_t len, VipsImage **out, ... ) + * * @page: %gint, load this page + * * @fail_on: #VipsFailOn, types of read error to fail on + * +- * Exactly as vips_jp2kload(), but read from a source. ++ * Exactly as vips_jp2kload(), but read from a source. + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_jp2kload_source( VipsSource *source, VipsImage **out, ... ) ++vips_jp2kload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "jp2kload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("jp2kload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/jp2ksave.c b/libvips/foreign/jp2ksave.c +index 4ed398c333..54a2835b60 100644 +--- a/libvips/foreign/jp2ksave.c ++++ b/libvips/foreign/jp2ksave.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -118,149 +118,149 @@ typedef struct _VipsForeignSaveJp2k { + + typedef VipsForeignSaveClass VipsForeignSaveJp2kClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveJp2k, vips_foreign_save_jp2k, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSaveJp2k, vips_foreign_save_jp2k, ++ VIPS_TYPE_FOREIGN_SAVE); + + static void +-vips_foreign_save_jp2k_dispose( GObject *gobject ) ++vips_foreign_save_jp2k_dispose(GObject *gobject) + { + VipsForeignSaveJp2k *jp2k = (VipsForeignSaveJp2k *) gobject; + +- VIPS_FREEF( opj_destroy_codec, jp2k->codec ); +- VIPS_FREEF( opj_stream_destroy, jp2k->stream ); +- VIPS_FREEF( opj_image_destroy, jp2k->image ); ++ VIPS_FREEF(opj_destroy_codec, jp2k->codec); ++ VIPS_FREEF(opj_stream_destroy, jp2k->stream); ++ VIPS_FREEF(opj_image_destroy, jp2k->image); + +- VIPS_UNREF( jp2k->target ); +- VIPS_UNREF( jp2k->strip ); ++ VIPS_UNREF(jp2k->target); ++ VIPS_UNREF(jp2k->strip); + +- VIPS_FREE( jp2k->tile_buffer ); +- VIPS_FREE( jp2k->accumulate ); ++ VIPS_FREE(jp2k->tile_buffer); ++ VIPS_FREE(jp2k->accumulate); + +- G_OBJECT_CLASS( vips_foreign_save_jp2k_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_jp2k_parent_class)->dispose(gobject); + } + + static OPJ_SIZE_T +-vips_foreign_save_jp2k_target_write( void *buffer, size_t length, void *client ) ++vips_foreign_save_jp2k_target_write(void *buffer, size_t length, void *client) + { +- VipsTarget *target = VIPS_TARGET( client ); ++ VipsTarget *target = VIPS_TARGET(client); + +- if( vips_target_write( target, buffer, length ) ) +- return( 0 ); ++ if (vips_target_write(target, buffer, length)) ++ return (0); + +- return( length ); ++ return (length); + } + + static OPJ_BOOL +-vips_foreign_save_jp2k_target_seek( off_t position, void *client ) ++vips_foreign_save_jp2k_target_seek(off_t position, void *client) + { +- VipsTarget *target = VIPS_TARGET( client ); ++ VipsTarget *target = VIPS_TARGET(client); + +- if( vips_target_seek( target, position, SEEK_SET ) < 0 ) +- return( FALSE ); ++ if (vips_target_seek(target, position, SEEK_SET) < 0) ++ return (FALSE); + +- return( TRUE ); ++ return (TRUE); + } + +-static OPJ_OFF_T +-vips_foreign_save_jp2k_target_skip( off_t offset, void *client) ++static OPJ_OFF_T ++vips_foreign_save_jp2k_target_skip(off_t offset, void *client) + { +- VipsTarget *target = VIPS_TARGET( client ); ++ VipsTarget *target = VIPS_TARGET(client); + +- if( vips_target_seek( target, offset, SEEK_CUR ) < 0 ) +- return( -1 ); ++ if (vips_target_seek(target, offset, SEEK_CUR) < 0) ++ return (-1); + +- return( offset ); ++ return (offset); + } + + /* Make a libopenjp2 output stream that wraps a VipsTarget. + */ + static opj_stream_t * +-vips_foreign_save_jp2k_target( VipsTarget *target ) ++vips_foreign_save_jp2k_target(VipsTarget *target) + { + opj_stream_t *stream; + + /* FALSE means a write stream. + */ +- if( !(stream = opj_stream_create( OPJ_J2K_STREAM_CHUNK_SIZE, FALSE )) ) +- return( NULL ); +- +- opj_stream_set_user_data( stream, target, NULL ); +- opj_stream_set_write_function( stream, +- vips_foreign_save_jp2k_target_write ); +- opj_stream_set_seek_function( stream, +- vips_foreign_save_jp2k_target_seek ); +- opj_stream_set_skip_function( stream, +- vips_foreign_save_jp2k_target_skip ); +- +- return( stream ); ++ if (!(stream = opj_stream_create(OPJ_J2K_STREAM_CHUNK_SIZE, FALSE))) ++ return (NULL); ++ ++ opj_stream_set_user_data(stream, target, NULL); ++ opj_stream_set_write_function(stream, ++ vips_foreign_save_jp2k_target_write); ++ opj_stream_set_seek_function(stream, ++ vips_foreign_save_jp2k_target_seek); ++ opj_stream_set_skip_function(stream, ++ vips_foreign_save_jp2k_target_skip); ++ ++ return (stream); + } + + static void +-vips_foreign_save_jp2k_error_callback( const char *msg, void *client ) ++vips_foreign_save_jp2k_error_callback(const char *msg, void *client) + { +- vips_error( "jp2ksave", "%s", msg ); ++ vips_error("jp2ksave", "%s", msg); + } + + /* The openjpeg info and warning callbacks are incredibly chatty. + */ + static void +-vips_foreign_save_jp2k_warning_callback( const char *msg, void *client ) ++vips_foreign_save_jp2k_warning_callback(const char *msg, void *client) + { + #ifdef DEBUG + #endif /*DEBUG*/ +- g_warning( "jp2ksave: %s", msg ); ++ g_warning("jp2ksave: %s", msg); + } + + static void +-vips_foreign_save_jp2k_info_callback( const char *msg, void *client ) ++vips_foreign_save_jp2k_info_callback(const char *msg, void *client) + { + #ifdef DEBUG + #endif /*DEBUG*/ +- g_info( "jp2ksave: %s", msg ); ++ g_info("jp2ksave: %s", msg); + } + + static void +-vips_foreign_save_jp2k_attach_handlers( opj_codec_t *codec ) ++vips_foreign_save_jp2k_attach_handlers(opj_codec_t *codec) + { +- opj_set_info_handler( codec, +- vips_foreign_save_jp2k_info_callback, NULL ); +- opj_set_warning_handler( codec, +- vips_foreign_save_jp2k_warning_callback, NULL ); +- opj_set_error_handler( codec, +- vips_foreign_save_jp2k_error_callback, NULL ); ++ opj_set_info_handler(codec, ++ vips_foreign_save_jp2k_info_callback, NULL); ++ opj_set_warning_handler(codec, ++ vips_foreign_save_jp2k_warning_callback, NULL); ++ opj_set_error_handler(codec, ++ vips_foreign_save_jp2k_error_callback, NULL); + } + + /* See also https://en.wikipedia.org/wiki/YCbCr#JPEG_conversion + */ +-#define RGB_TO_YCC( TYPE ) { \ +- TYPE *tq = (TYPE *) q; \ +- \ +- for( x = 0; x < tile->width; x++ ) { \ +- int r = tq[0]; \ +- int g = tq[1]; \ +- int b = tq[2]; \ +- \ +- int y, cb, cr; \ +- \ +- y = 0.299 * r + 0.587 * g + 0.114 * b; \ +- tq[0] = VIPS_CLIP( 0, y, upb ); \ +- \ +- cb = offset - (int)(0.168736 * r + 0.331264 * g - 0.5 * b); \ +- tq[1] = VIPS_CLIP( 0, cb, upb ); \ +- \ +- cr = offset - (int)(-0.5 * r + 0.418688 * g + 0.081312 * b); \ +- tq[2] = VIPS_CLIP( 0, cr, upb ); \ +- \ +- tq += 3; \ +- } \ +-} ++#define RGB_TO_YCC(TYPE) \ ++ { \ ++ TYPE *tq = (TYPE *) q; \ ++\ ++ for (x = 0; x < tile->width; x++) { \ ++ int r = tq[0]; \ ++ int g = tq[1]; \ ++ int b = tq[2]; \ ++\ ++ int y, cb, cr; \ ++\ ++ y = 0.299 * r + 0.587 * g + 0.114 * b; \ ++ tq[0] = VIPS_CLIP(0, y, upb); \ ++\ ++ cb = offset - (int) (0.168736 * r + 0.331264 * g - 0.5 * b); \ ++ tq[1] = VIPS_CLIP(0, cb, upb); \ ++\ ++ cr = offset - (int) (-0.5 * r + 0.418688 * g + 0.081312 * b); \ ++ tq[2] = VIPS_CLIP(0, cr, upb); \ ++\ ++ tq += 3; \ ++ } \ ++ } + + /* In-place RGB->YCC for a line of pels. + */ + static void +-vips_foreign_save_jp2k_rgb_to_ycc( VipsRegion *region, +- VipsRect *tile, int prec ) ++vips_foreign_save_jp2k_rgb_to_ycc(VipsRegion *region, ++ VipsRect *tile, int prec) + { + VipsImage *im = region->im; + int offset = 1 << (prec - 1); +@@ -268,26 +268,26 @@ vips_foreign_save_jp2k_rgb_to_ycc( VipsRegion *region, + + int x, y; + +- g_assert( im->Bands == 3 ); ++ g_assert(im->Bands == 3); + +- for( y = 0; y < tile->height; y++ ) { +- VipsPel *q = VIPS_REGION_ADDR( region, +- tile->left, tile->top + y ); ++ for (y = 0; y < tile->height; y++) { ++ VipsPel *q = VIPS_REGION_ADDR(region, ++ tile->left, tile->top + y); + +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_CHAR: + case VIPS_FORMAT_UCHAR: +- RGB_TO_YCC( unsigned char ); ++ RGB_TO_YCC(unsigned char); + break; + + case VIPS_FORMAT_SHORT: + case VIPS_FORMAT_USHORT: +- RGB_TO_YCC( unsigned short ); ++ RGB_TO_YCC(unsigned short); + break; + + case VIPS_FORMAT_INT: + case VIPS_FORMAT_UINT: +- RGB_TO_YCC( unsigned int ); ++ RGB_TO_YCC(unsigned int); + break; + + default: +@@ -302,95 +302,97 @@ vips_foreign_save_jp2k_rgb_to_ycc( VipsRegion *region, + * 2. add subsequent lines in comp.dy. + * 3. horizontal average to output line + */ +-#define SHRINK( OUTPUT_TYPE, ACC_TYPE, PIXEL_TYPE ) { \ +- ACC_TYPE *acc = (ACC_TYPE *) accumulate; \ +- OUTPUT_TYPE *tq = (OUTPUT_TYPE *) q; \ +- const int n_pels = comp->dx * comp->dy; \ +- \ +- PIXEL_TYPE *tp; \ +- ACC_TYPE *ap; \ +- \ +- tp = (PIXEL_TYPE *) p; \ +- for( x = 0; x < tile->width; x++ ) { \ +- acc[x] = *tp; \ +- tp += n_bands; \ +- } \ +- \ +- for( z = 1; z < comp->dy; z++ ) { \ +- tp = (PIXEL_TYPE *) (p + z * lskip); \ +- for( x = 0; x < tile->width; x++ ) { \ +- acc[x] += *tp; \ ++#define SHRINK(OUTPUT_TYPE, ACC_TYPE, PIXEL_TYPE) \ ++ { \ ++ ACC_TYPE *acc = (ACC_TYPE *) accumulate; \ ++ OUTPUT_TYPE *tq = (OUTPUT_TYPE *) q; \ ++ const int n_pels = comp->dx * comp->dy; \ ++\ ++ PIXEL_TYPE *tp; \ ++ ACC_TYPE *ap; \ ++\ ++ tp = (PIXEL_TYPE *) p; \ ++ for (x = 0; x < tile->width; x++) { \ ++ acc[x] = *tp; \ + tp += n_bands; \ + } \ +- } \ +- \ +- ap = acc; \ +- for( x = 0; x < output_width; x++ ) { \ +- ACC_TYPE sum; \ +- \ +- sum = 0; \ +- for( z = 0; z < comp->dx; z++ ) \ +- sum += ap[z]; \ +- \ +- tq[x] = (sum + n_pels / 2) / n_pels; \ +- ap += comp->dx; \ +- } \ +-} ++\ ++ for (z = 1; z < comp->dy; z++) { \ ++ tp = (PIXEL_TYPE *) (p + z * lskip); \ ++ for (x = 0; x < tile->width; x++) { \ ++ acc[x] += *tp; \ ++ tp += n_bands; \ ++ } \ ++ } \ ++\ ++ ap = acc; \ ++ for (x = 0; x < output_width; x++) { \ ++ ACC_TYPE sum; \ ++\ ++ sum = 0; \ ++ for (z = 0; z < comp->dx; z++) \ ++ sum += ap[z]; \ ++\ ++ tq[x] = (sum + n_pels / 2) / n_pels; \ ++ ap += comp->dx; \ ++ } \ ++ } + + static void +-vips_foreign_save_jp2k_unpack_subsample( VipsRegion *region, VipsRect *tile, +- opj_image_t *image, VipsPel *tile_buffer, VipsPel *accumulate ) ++vips_foreign_save_jp2k_unpack_subsample(VipsRegion *region, VipsRect *tile, ++ opj_image_t *image, VipsPel *tile_buffer, VipsPel *accumulate) + { + VipsImage *im = region->im; +- size_t sizeof_element = VIPS_REGION_SIZEOF_ELEMENT( region ); +- size_t lskip = VIPS_REGION_LSKIP( region ); ++ size_t sizeof_element = VIPS_REGION_SIZEOF_ELEMENT(region); ++ size_t lskip = VIPS_REGION_LSKIP(region); + int n_bands = im->Bands; + + VipsPel *q; + int x, y, z, i; + + q = tile_buffer; +- for( i = 0; i < n_bands; i++ ) { ++ for (i = 0; i < n_bands; i++) { + opj_image_comp_t *comp = &image->comps[i]; + + /* The number of pixels we write for this component. No + * padding. + */ + int output_width = VIPS_ROUND_UINT( +- (double) tile->width / comp->dx ); ++ (double) tile->width / comp->dx); + int output_height = VIPS_ROUND_UINT( +- (double) tile->height / comp->dy );; ++ (double) tile->height / comp->dy); ++ ; + +- for( y = 0; y < output_height; y++ ) { ++ for (y = 0; y < output_height; y++) { + VipsPel *p = i * sizeof_element + +- VIPS_REGION_ADDR( region, +- tile->left, tile->top + y * comp->dy ); ++ VIPS_REGION_ADDR(region, ++ tile->left, tile->top + y * comp->dy); + + /* Shrink a line of pels to q. + */ +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_CHAR: +- SHRINK( signed char, int, signed char ); ++ SHRINK(signed char, int, signed char); + break; + + case VIPS_FORMAT_UCHAR: +- SHRINK( unsigned char, int, unsigned char ); ++ SHRINK(unsigned char, int, unsigned char); + break; + + case VIPS_FORMAT_SHORT: +- SHRINK( signed short, int, signed short ); ++ SHRINK(signed short, int, signed short); + break; + + case VIPS_FORMAT_USHORT: +- SHRINK( unsigned short, int, unsigned short ); ++ SHRINK(unsigned short, int, unsigned short); + break; + + case VIPS_FORMAT_INT: +- SHRINK( signed int, gint64, signed int ); ++ SHRINK(signed int, gint64, signed int); + break; + + case VIPS_FORMAT_UINT: +- SHRINK( unsigned int, gint64, unsigned int ); ++ SHRINK(unsigned int, gint64, unsigned int); + break; + + default: +@@ -403,50 +405,51 @@ vips_foreign_save_jp2k_unpack_subsample( VipsRegion *region, VipsRect *tile, + } + } + +-#define UNPACK( OUT, IN ) { \ +- OUT *tq = (OUT *) q; \ +- IN *tp = (IN *) p + i; \ +- \ +- for( x = 0; x < tile->width; x++ ) { \ +- tq[x] = *tp; \ +- tp += b; \ +- } \ +-} ++#define UNPACK(OUT, IN) \ ++ { \ ++ OUT *tq = (OUT *) q; \ ++ IN *tp = (IN *) p + i; \ ++\ ++ for (x = 0; x < tile->width; x++) { \ ++ tq[x] = *tp; \ ++ tp += b; \ ++ } \ ++ } + + static void +-vips_foreign_save_jp2k_unpack( VipsRegion *region, VipsRect *tile, +- opj_image_t *image, VipsPel *tile_buffer ) ++vips_foreign_save_jp2k_unpack(VipsRegion *region, VipsRect *tile, ++ opj_image_t *image, VipsPel *tile_buffer) + { + VipsImage *im = region->im; +- size_t sizeof_element = VIPS_REGION_SIZEOF_ELEMENT( region ); ++ size_t sizeof_element = VIPS_REGION_SIZEOF_ELEMENT(region); + size_t sizeof_line = sizeof_element * tile->width; + size_t sizeof_tile = sizeof_line * tile->height; + int b = im->Bands; + + int x, y, i; + +- for( y = 0; y < tile->height; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( region, +- tile->left, tile->top + y ); ++ for (y = 0; y < tile->height; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(region, ++ tile->left, tile->top + y); + +- for( i = 0; i < b; i++ ) { ++ for (i = 0; i < b; i++) { + VipsPel *q = tile_buffer + + i * sizeof_tile + y * sizeof_line; + +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_CHAR: + case VIPS_FORMAT_UCHAR: +- UNPACK( unsigned char, unsigned char ); ++ UNPACK(unsigned char, unsigned char); + break; + + case VIPS_FORMAT_SHORT: + case VIPS_FORMAT_USHORT: +- UNPACK( unsigned short, unsigned short ); ++ UNPACK(unsigned short, unsigned short); + break; + + case VIPS_FORMAT_INT: + case VIPS_FORMAT_UINT: +- UNPACK( unsigned int, unsigned int ); ++ UNPACK(unsigned int, unsigned int); + break; + + default: +@@ -458,43 +461,44 @@ vips_foreign_save_jp2k_unpack( VipsRegion *region, VipsRect *tile, + } + + static size_t +-vips_foreign_save_jp2k_sizeof_tile( VipsForeignSaveJp2k *jp2k, VipsRect *tile ) ++vips_foreign_save_jp2k_sizeof_tile(VipsForeignSaveJp2k *jp2k, VipsRect *tile) + { + VipsForeignSave *save = (VipsForeignSave *) jp2k; +- size_t sizeof_element = VIPS_IMAGE_SIZEOF_ELEMENT( save->ready ); ++ size_t sizeof_element = VIPS_IMAGE_SIZEOF_ELEMENT(save->ready); + + size_t size; + int i; + + size = 0; +- for( i = 0; i < jp2k->image->numcomps; i++ ) { ++ for (i = 0; i < jp2k->image->numcomps; i++) { + opj_image_comp_t *comp = &jp2k->image->comps[i]; + + /* The number of pixels we write for this component. Round to + * nearest, and we may have to write half-pixels at the edges. + */ + int output_width = VIPS_ROUND_UINT( +- (double) tile->width / comp->dx ); ++ (double) tile->width / comp->dx); + int output_height = VIPS_ROUND_UINT( +- (double) tile->height / comp->dy );; ++ (double) tile->height / comp->dy); ++ ; + + size += output_width * output_height * sizeof_element; + } + +- return( size ); ++ return (size); + } + + static int +-vips_foreign_save_jp2k_write_tiles( VipsForeignSaveJp2k *jp2k ) ++vips_foreign_save_jp2k_write_tiles(VipsForeignSaveJp2k *jp2k) + { + VipsForeignSave *save = (VipsForeignSave *) jp2k; + VipsImage *im = save->ready; +- int tiles_across = VIPS_ROUND_UP( im->Xsize, jp2k->tile_width ) / ++ int tiles_across = VIPS_ROUND_UP(im->Xsize, jp2k->tile_width) / + jp2k->tile_width; + + int x; + +- for( x = 0; x < im->Xsize; x += jp2k->tile_width ) { ++ for (x = 0; x < im->Xsize; x += jp2k->tile_width) { + VipsRect tile; + size_t sizeof_tile; + int tile_index; +@@ -503,47 +507,47 @@ vips_foreign_save_jp2k_write_tiles( VipsForeignSaveJp2k *jp2k ) + tile.top = jp2k->strip->valid.top; + tile.width = jp2k->tile_width; + tile.height = jp2k->tile_height; +- vips_rect_intersectrect( &tile, &jp2k->strip->valid, &tile ); ++ vips_rect_intersectrect(&tile, &jp2k->strip->valid, &tile); + +- if( jp2k->save_as_ycc ) +- vips_foreign_save_jp2k_rgb_to_ycc( jp2k->strip, +- &tile, jp2k->image->comps[0].prec ); ++ if (jp2k->save_as_ycc) ++ vips_foreign_save_jp2k_rgb_to_ycc(jp2k->strip, ++ &tile, jp2k->image->comps[0].prec); + +- if( jp2k->subsample ) +- vips_foreign_save_jp2k_unpack_subsample( jp2k->strip, ++ if (jp2k->subsample) ++ vips_foreign_save_jp2k_unpack_subsample(jp2k->strip, + &tile, jp2k->image, +- jp2k->tile_buffer, jp2k->accumulate ); ++ jp2k->tile_buffer, jp2k->accumulate); + else +- vips_foreign_save_jp2k_unpack( jp2k->strip, ++ vips_foreign_save_jp2k_unpack(jp2k->strip, + &tile, jp2k->image, +- jp2k->tile_buffer ); ++ jp2k->tile_buffer); + + sizeof_tile = +- vips_foreign_save_jp2k_sizeof_tile( jp2k, &tile ); ++ vips_foreign_save_jp2k_sizeof_tile(jp2k, &tile); + tile_index = tiles_across * tile.top / jp2k->tile_height + + x / jp2k->tile_width; +- if( !opj_write_tile( jp2k->codec, tile_index, +- (VipsPel *) jp2k->tile_buffer, sizeof_tile, +- jp2k->stream ) ) +- return( -1 ); ++ if (!opj_write_tile(jp2k->codec, tile_index, ++ (VipsPel *) jp2k->tile_buffer, sizeof_tile, ++ jp2k->stream)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_jp2k_write_block( VipsRegion *region, VipsRect *area, +- void *a ) ++vips_foreign_save_jp2k_write_block(VipsRegion *region, VipsRect *area, ++ void *a) + { + VipsForeignSaveJp2k *jp2k = (VipsForeignSaveJp2k *) a; + VipsForeignSave *save = (VipsForeignSave *) jp2k; + + #ifdef DEBUG_VERBOSE +- printf( "vips_foreign_save_jp2k_write_block: y = %d, nlines = %d\n", +- area->top, area->height ); ++ printf("vips_foreign_save_jp2k_write_block: y = %d, nlines = %d\n", ++ area->top, area->height); + #endif /*DEBUG_VERBOSE*/ + +- for(;;) { ++ for (;;) { + VipsRect *to = &jp2k->strip->valid; + + VipsRect hit; +@@ -553,25 +557,25 @@ vips_foreign_save_jp2k_write_block( VipsRegion *region, VipsRect *area, + /* The intersection with the strip is the fresh pixels we + * have. + */ +- vips_rect_intersectrect( area, to, &hit ); ++ vips_rect_intersectrect(area, to, &hit); + + /* Write the new pixels into the strip. + */ +- vips_region_copy( region, jp2k->strip, +- &hit, hit.left, hit.top ); ++ vips_region_copy(region, jp2k->strip, ++ &hit, hit.left, hit.top); + + /* Have we failed to reach the bottom of the strip? We must + * have run out of fresh pixels, so we are done. + */ +- if( VIPS_RECT_BOTTOM( &hit ) != +- VIPS_RECT_BOTTOM( &jp2k->strip->valid ) ) ++ if (VIPS_RECT_BOTTOM(&hit) != ++ VIPS_RECT_BOTTOM(&jp2k->strip->valid)) + break; + + /* We have reached the bottom of the strip. Write this line of + * pixels and move the strip down. + */ +- if( vips_foreign_save_jp2k_write_tiles( jp2k ) ) +- return( -1 ); ++ if (vips_foreign_save_jp2k_write_tiles(jp2k)) ++ return (-1); + + new.left = 0; + new.top = jp2k->strip->valid.top + jp2k->tile_height; +@@ -581,49 +585,49 @@ vips_foreign_save_jp2k_write_block( VipsRegion *region, VipsRect *area, + image.top = 0; + image.width = save->ready->Xsize; + image.height = save->ready->Ysize; +- vips_rect_intersectrect( &new, &image, &new); ++ vips_rect_intersectrect(&new, &image, &new); + + /* End of image? + */ +- if( vips_rect_isempty( &new ) ) ++ if (vips_rect_isempty(&new)) + break; + +- if( vips_region_buffer( jp2k->strip, &new ) ) +- return( -1 ); ++ if (vips_region_buffer(jp2k->strip, &new)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* We can't call opj_calloc on win, sadly. + */ +-#define VIPS_OPJ_CALLOC( N, TYPE ) \ +- ((TYPE *) calloc( (N), sizeof( TYPE ) )) ++#define VIPS_OPJ_CALLOC(N, TYPE) \ ++ ((TYPE *) calloc((N), sizeof(TYPE))) + + /* Allocate an openjpeg image structure. Openjpeg has opj_image_create(), but + * that always allocates memory for each channel, and we don't want that when + * we are doing tiled write. + */ + static opj_image_t * +-vips_opj_image_create( OPJ_UINT32 numcmpts, ++vips_opj_image_create(OPJ_UINT32 numcmpts, + opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc, +- gboolean allocate ) ++ gboolean allocate) + { + OPJ_UINT32 compno; + opj_image_t *image = NULL; + +- if( !(image = VIPS_OPJ_CALLOC( 1, opj_image_t )) ) +- return( NULL ); ++ if (!(image = VIPS_OPJ_CALLOC(1, opj_image_t))) ++ return (NULL); + +- image->color_space = clrspc; +- image->numcomps = numcmpts; +- image->comps = VIPS_OPJ_CALLOC( image->numcomps, opj_image_comp_t ); +- if( !image->comps ) { +- opj_image_destroy( image ); +- return( NULL ); +- } ++ image->color_space = clrspc; ++ image->numcomps = numcmpts; ++ image->comps = VIPS_OPJ_CALLOC(image->numcomps, opj_image_comp_t); ++ if (!image->comps) { ++ opj_image_destroy(image); ++ return (NULL); ++ } + +- for( compno = 0; compno < numcmpts; compno++ ) { ++ for (compno = 0; compno < numcmpts; compno++) { + opj_image_comp_t *comp = &image->comps[compno]; + + comp->dx = cmptparms[compno].dx; +@@ -635,35 +639,35 @@ vips_opj_image_create( OPJ_UINT32 numcmpts, + comp->prec = cmptparms[compno].prec; + comp->sgnd = cmptparms[compno].sgnd; + +- if( comp->h != 0 && ++ if (comp->h != 0 && + (OPJ_SIZE_T) comp->w > SIZE_MAX / comp->h / +- sizeof( OPJ_INT32 ) ) { +- opj_image_destroy( image ); +- return( NULL ); ++ sizeof(OPJ_INT32)) { ++ opj_image_destroy(image); ++ return (NULL); + } + + /* Allocation is optional. + */ +- if( allocate ) { ++ if (allocate) { + size_t bytes = (size_t) comp->w * comp->h * +- sizeof( OPJ_INT32 ); ++ sizeof(OPJ_INT32); + +- comp->data = (OPJ_INT32*) opj_image_data_alloc( bytes ); +- if( !comp->data ) { +- opj_image_destroy( image ); ++ comp->data = (OPJ_INT32 *) opj_image_data_alloc(bytes); ++ if (!comp->data) { ++ opj_image_destroy(image); + return NULL; + } +- memset( comp->data, 0, bytes ); ++ memset(comp->data, 0, bytes); + } + } + +- return( image ); ++ return (image); + } + + static opj_image_t * +-vips_foreign_save_jp2k_new_image( VipsImage *im, ++vips_foreign_save_jp2k_new_image(VipsImage *im, + int width, int height, +- gboolean subsample, gboolean save_as_ycc, gboolean allocate ) ++ gboolean subsample, gboolean save_as_ycc, gboolean allocate) + { + OPJ_COLOR_SPACE color_space; + int expected_bands; +@@ -672,12 +676,12 @@ vips_foreign_save_jp2k_new_image( VipsImage *im, + opj_image_t *image; + int i; + +- if( im->Bands > MAX_BANDS ) +- return( NULL ); ++ if (im->Bands > MAX_BANDS) ++ return (NULL); + + /* CIELAB etc. do not seem to be well documented. + */ +- switch( im->Type ) { ++ switch (im->Type) { + case VIPS_INTERPRETATION_B_W: + case VIPS_INTERPRETATION_GREY16: + color_space = OPJ_CLRSPC_GRAY; +@@ -701,7 +705,7 @@ vips_foreign_save_jp2k_new_image( VipsImage *im, + break; + } + +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_CHAR: + case VIPS_FORMAT_UCHAR: + bits_per_pixel = 8; +@@ -724,7 +728,7 @@ vips_foreign_save_jp2k_new_image( VipsImage *im, + break; + } + +- for( i = 0; i < im->Bands; i++ ) { ++ for (i = 0; i < im->Bands; i++) { + comps[i].dx = (subsample && i > 0) ? 2 : 1; + comps[i].dy = (subsample && i > 0) ? 2 : 1; + comps[i].w = width; +@@ -732,20 +736,20 @@ vips_foreign_save_jp2k_new_image( VipsImage *im, + comps[i].x0 = 0; + comps[i].y0 = 0; + comps[i].prec = bits_per_pixel; +- comps[i].sgnd = !vips_band_format_isuint( im->BandFmt ); ++ comps[i].sgnd = !vips_band_format_isuint(im->BandFmt); + } + +- image = vips_opj_image_create( im->Bands, comps, color_space, +- allocate ); ++ image = vips_opj_image_create(im->Bands, comps, color_space, ++ allocate); + image->x1 = width; + image->y1 = height; + + /* Tag alpha channels. + */ +- for( i = 0; i < im->Bands; i++ ) ++ for (i = 0; i < im->Bands; i++) + image->comps[i].alpha = i >= expected_bands; + +- return( image ); ++ return (image); + } + + /* Compression profile derived from the BM's recommendations, see: +@@ -755,10 +759,10 @@ vips_foreign_save_jp2k_new_image( VipsImage *im, + * Some of these settings (eg. numresolution) are overridden later. + */ + static void +-vips_foreign_save_jp2k_set_profile( opj_cparameters_t *parameters, +- gboolean lossless, int Q ) ++vips_foreign_save_jp2k_set_profile(opj_cparameters_t *parameters, ++ gboolean lossless, int Q) + { +- if( lossless ) ++ if (lossless) + parameters->irreversible = FALSE; + else { + int i; +@@ -784,7 +788,7 @@ vips_foreign_save_jp2k_set_profile( opj_cparameters_t *parameters, + parameters->csty = 1; + + parameters->res_spec = 7; +- for( i = 0; i < parameters->res_spec; i++ ) { ++ for (i = 0; i < parameters->res_spec; i++) { + parameters->prch_init[i] = 256; + parameters->prcw_init[i] = 256; + parameters->tcp_distoratio[i] = Q + 10 * i; +@@ -793,9 +797,9 @@ vips_foreign_save_jp2k_set_profile( opj_cparameters_t *parameters, + } + + static int +-vips_foreign_save_jp2k_build( VipsObject *object ) ++vips_foreign_save_jp2k_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveJp2k *jp2k = (VipsForeignSaveJp2k *) object; + +@@ -803,26 +807,25 @@ vips_foreign_save_jp2k_build( VipsObject *object ) + size_t sizeof_line; + VipsRect strip_position; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_jp2k_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_jp2k_parent_class)->build(object)) ++ return (-1); + + /* Analyze our arguments. + */ + +- if( !vips_band_format_isint( save->ready->BandFmt ) ) { +- vips_error( class->nickname, +- "%s", _( "not an integer format" ) ); +- return( -1 ); ++ if (!vips_band_format_isint(save->ready->BandFmt)) { ++ vips_error(class->nickname, ++ "%s", _("not an integer format")); ++ return (-1); + } + +- switch( jp2k->subsample_mode ) { ++ switch (jp2k->subsample_mode) { + case VIPS_FOREIGN_SUBSAMPLE_AUTO: + jp2k->subsample = + !jp2k->lossless && + jp2k->Q < 90 && + (save->ready->Type == VIPS_INTERPRETATION_sRGB || +- save->ready->Type == VIPS_INTERPRETATION_RGB16) && ++ save->ready->Type == VIPS_INTERPRETATION_RGB16) && + save->ready->Bands == 3; + break; + +@@ -839,17 +842,17 @@ vips_foreign_save_jp2k_build( VipsObject *object ) + break; + } + +- if( jp2k->subsample ) ++ if (jp2k->subsample) + jp2k->save_as_ycc = TRUE; + + /* Set parameters for compressor. + */ +- opj_set_default_encoder_parameters( &jp2k->parameters ); ++ opj_set_default_encoder_parameters(&jp2k->parameters); + + /* Set compression profile. + */ +- vips_foreign_save_jp2k_set_profile( &jp2k->parameters, +- jp2k->lossless, jp2k->Q ); ++ vips_foreign_save_jp2k_set_profile(&jp2k->parameters, ++ jp2k->lossless, jp2k->Q); + + /* Always tile. + */ +@@ -864,59 +867,60 @@ vips_foreign_save_jp2k_build( VipsObject *object ) + /* Number of layers to write. Smallest layer is c. 2^5 on the smallest + * axis. + */ +- jp2k->parameters.numresolution = VIPS_MAX( 1, +- log( VIPS_MIN( save->ready->Xsize, save->ready->Ysize ) ) / +- log( 2 ) - 5 ); ++ jp2k->parameters.numresolution = VIPS_MAX(1, ++ log(VIPS_MIN(save->ready->Xsize, save->ready->Ysize)) / ++ log(2) - ++ 5); + #ifdef DEBUG +- printf( "vips_foreign_save_jp2k_build: numresolutions = %d\n", +- jp2k->parameters.numresolution ); ++ printf("vips_foreign_save_jp2k_build: numresolutions = %d\n", ++ jp2k->parameters.numresolution); + #endif /*DEBUG*/ + + /* Set up compressor. + */ + +- /* Save as a jp2 file. +- */ +- jp2k->codec = opj_create_compress( OPJ_CODEC_JP2 ); +- vips_foreign_save_jp2k_attach_handlers( jp2k->codec ); ++ /* Save as a jp2 file. ++ */ ++ jp2k->codec = opj_create_compress(OPJ_CODEC_JP2); ++ vips_foreign_save_jp2k_attach_handlers(jp2k->codec); + + /* FALSE means don't alloc memory for image planes (we write in + * tiles, not whole images). + */ +- if( !(jp2k->image = vips_foreign_save_jp2k_new_image( save->ready, +- save->ready->Xsize, save->ready->Ysize, +- jp2k->subsample, jp2k->save_as_ycc, FALSE )) ) +- return( -1 ); +- if( !opj_setup_encoder( jp2k->codec, &jp2k->parameters, jp2k->image ) ) +- return( -1 ); ++ if (!(jp2k->image = vips_foreign_save_jp2k_new_image(save->ready, ++ save->ready->Xsize, save->ready->Ysize, ++ jp2k->subsample, jp2k->save_as_ycc, FALSE))) ++ return (-1); ++ if (!opj_setup_encoder(jp2k->codec, &jp2k->parameters, jp2k->image)) ++ return (-1); + +- opj_codec_set_threads( jp2k->codec, vips_concurrency_get() ); ++ opj_codec_set_threads(jp2k->codec, vips_concurrency_get()); + +- if( !(jp2k->stream = vips_foreign_save_jp2k_target( jp2k->target )) ) +- return( -1 ); ++ if (!(jp2k->stream = vips_foreign_save_jp2k_target(jp2k->target))) ++ return (-1); + +- if( !opj_start_compress( jp2k->codec, jp2k->image, jp2k->stream ) ) +- return( -1 ); ++ if (!opj_start_compress(jp2k->codec, jp2k->image, jp2k->stream)) ++ return (-1); + + /* The buffer we repack tiles to for write. Large enough for one + * complete tile. + */ +- sizeof_tile = VIPS_IMAGE_SIZEOF_PEL( save->ready ) * ++ sizeof_tile = VIPS_IMAGE_SIZEOF_PEL(save->ready) * + jp2k->tile_width * jp2k->tile_height; +- if( !(jp2k->tile_buffer = VIPS_ARRAY( NULL, sizeof_tile, VipsPel )) ) +- return( -1 ); ++ if (!(jp2k->tile_buffer = VIPS_ARRAY(NULL, sizeof_tile, VipsPel))) ++ return (-1); + + /* We need a line of sums for chroma subsample. At worst, gint64. + */ +- sizeof_line = sizeof( gint64 ) * jp2k->tile_width; +- if( !(jp2k->accumulate = VIPS_ARRAY( NULL, sizeof_line, VipsPel )) ) +- return( -1 ); ++ sizeof_line = sizeof(gint64) * jp2k->tile_width; ++ if (!(jp2k->accumulate = VIPS_ARRAY(NULL, sizeof_line, VipsPel))) ++ return (-1); + + /* The line of tiles we are building. It's used by the bg thread, so + * no ownership. + */ +- jp2k->strip = vips_region_new( save->ready ); +- vips__region_no_ownership( jp2k->strip ); ++ jp2k->strip = vips_region_new(save->ready); ++ vips__region_no_ownership(jp2k->strip); + + /* Position strip at the top of the image, the height of a row of + * tiles. +@@ -925,27 +929,27 @@ vips_foreign_save_jp2k_build( VipsObject *object ) + strip_position.top = 0; + strip_position.width = save->ready->Xsize; + strip_position.height = jp2k->tile_height; +- if( vips_region_buffer( jp2k->strip, &strip_position ) ) +- return( -1 ); ++ if (vips_region_buffer(jp2k->strip, &strip_position)) ++ return (-1); + + /* Write data. + */ +- if( vips_sink_disc( save->ready, +- vips_foreign_save_jp2k_write_block, jp2k ) ) +- return( -1 ); ++ if (vips_sink_disc(save->ready, ++ vips_foreign_save_jp2k_write_block, jp2k)) ++ return (-1); + +- opj_end_compress( jp2k->codec, jp2k->stream ); ++ opj_end_compress(jp2k->codec, jp2k->stream); + +- if( vips_target_end( jp2k->target ) ) +- return( -1 ); ++ if (vips_target_end(jp2k->target)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_jp2k_class_init( VipsForeignSaveJp2kClass *class ) ++vips_foreign_save_jp2k_class_init(VipsForeignSaveJp2kClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; +@@ -955,53 +959,52 @@ vips_foreign_save_jp2k_class_init( VipsForeignSaveJp2kClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "jp2ksave_base"; +- object_class->description = _( "save image in JPEG2000 format" ); ++ object_class->description = _("save image in JPEG2000 format"); + object_class->build = vips_foreign_save_jp2k_build; + + foreign_class->suffs = vips__jp2k_suffs; + + save_class->saveable = VIPS_SAVEABLE_ANY; + +- VIPS_ARG_INT( class, "tile_width", 11, +- _( "Tile width" ), +- _( "Tile width in pixels" ), ++ VIPS_ARG_INT(class, "tile_width", 11, ++ _("Tile width"), ++ _("Tile width in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJp2k, tile_width ), +- 1, 32768, 512 ); ++ G_STRUCT_OFFSET(VipsForeignSaveJp2k, tile_width), ++ 1, 32768, 512); + +- VIPS_ARG_INT( class, "tile_height", 12, +- _( "Tile height" ), +- _( "Tile height in pixels" ), ++ VIPS_ARG_INT(class, "tile_height", 12, ++ _("Tile height"), ++ _("Tile height in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJp2k, tile_height ), +- 1, 32768, 512 ); ++ G_STRUCT_OFFSET(VipsForeignSaveJp2k, tile_height), ++ 1, 32768, 512); + +- VIPS_ARG_BOOL( class, "lossless", 13, +- _( "Lossless" ), +- _( "Enable lossless compression" ), ++ VIPS_ARG_BOOL(class, "lossless", 13, ++ _("Lossless"), ++ _("Enable lossless compression"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJp2k, lossless ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveJp2k, lossless), ++ FALSE); + +- VIPS_ARG_ENUM( class, "subsample_mode", 19, +- _( "Subsample mode" ), +- _( "Select chroma subsample operation mode" ), ++ VIPS_ARG_ENUM(class, "subsample_mode", 19, ++ _("Subsample mode"), ++ _("Select chroma subsample operation mode"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJp2k, subsample_mode ), ++ G_STRUCT_OFFSET(VipsForeignSaveJp2k, subsample_mode), + VIPS_TYPE_FOREIGN_SUBSAMPLE, +- VIPS_FOREIGN_SUBSAMPLE_OFF ); ++ VIPS_FOREIGN_SUBSAMPLE_OFF); + +- VIPS_ARG_INT( class, "Q", 14, +- _( "Q" ), +- _( "Q factor" ), ++ VIPS_ARG_INT(class, "Q", 14, ++ _("Q"), ++ _("Q factor"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJp2k, Q ), +- 1, 100, 48 ); +- ++ G_STRUCT_OFFSET(VipsForeignSaveJp2k, Q), ++ 1, 100, 48); + } + + static void +-vips_foreign_save_jp2k_init( VipsForeignSaveJp2k *jp2k ) ++vips_foreign_save_jp2k_init(VipsForeignSaveJp2k *jp2k) + { + jp2k->tile_width = 512; + jp2k->tile_height = 512; +@@ -1024,29 +1027,28 @@ typedef struct _VipsForeignSaveJp2kFile { + + typedef VipsForeignSaveJp2kClass VipsForeignSaveJp2kFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveJp2kFile, vips_foreign_save_jp2k_file, +- vips_foreign_save_jp2k_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveJp2kFile, vips_foreign_save_jp2k_file, ++ vips_foreign_save_jp2k_get_type()); + + static int +-vips_foreign_save_jp2k_file_build( VipsObject *object ) ++vips_foreign_save_jp2k_file_build(VipsObject *object) + { + VipsForeignSaveJp2k *jp2k = (VipsForeignSaveJp2k *) object; + VipsForeignSaveJp2kFile *file = (VipsForeignSaveJp2kFile *) object; + +- if( !(jp2k->target = vips_target_new_to_file( file->filename )) ) +- return( -1 ); ++ if (!(jp2k->target = vips_target_new_to_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_jp2k_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_jp2k_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_jp2k_file_class_init( VipsForeignSaveJp2kFileClass *class ) ++vips_foreign_save_jp2k_file_class_init(VipsForeignSaveJp2kFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -1055,17 +1057,16 @@ vips_foreign_save_jp2k_file_class_init( VipsForeignSaveJp2kFileClass *class ) + object_class->nickname = "jp2ksave"; + object_class->build = vips_foreign_save_jp2k_file_build; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJp2kFile, filename ), +- NULL ); +- ++ G_STRUCT_OFFSET(VipsForeignSaveJp2kFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_jp2k_file_init( VipsForeignSaveJp2kFile *file ) ++vips_foreign_save_jp2k_file_init(VipsForeignSaveJp2kFile *file) + { + } + +@@ -1080,11 +1081,11 @@ typedef struct _VipsForeignSaveJp2kBuffer { + + typedef VipsForeignSaveJp2kClass VipsForeignSaveJp2kBufferClass; + +-G_DEFINE_TYPE( VipsForeignSaveJp2kBuffer, vips_foreign_save_jp2k_buffer, +- vips_foreign_save_jp2k_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveJp2kBuffer, vips_foreign_save_jp2k_buffer, ++ vips_foreign_save_jp2k_get_type()); + + static int +-vips_foreign_save_jp2k_buffer_build( VipsObject *object ) ++vips_foreign_save_jp2k_buffer_build(VipsObject *object) + { + VipsForeignSaveJp2k *jp2k = (VipsForeignSaveJp2k *) object; + VipsForeignSaveJp2kBuffer *buffer = +@@ -1092,25 +1093,24 @@ vips_foreign_save_jp2k_buffer_build( VipsObject *object ) + + VipsBlob *blob; + +- if( !(jp2k->target = vips_target_new_to_memory()) ) +- return( -1 ); ++ if (!(jp2k->target = vips_target_new_to_memory())) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_jp2k_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_jp2k_buffer_parent_class)->build(object)) ++ return (-1); + +- g_object_get( jp2k->target, "blob", &blob, NULL ); +- g_object_set( buffer, "buffer", blob, NULL ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ g_object_get(jp2k->target, "blob", &blob, NULL); ++ g_object_set(buffer, "buffer", blob, NULL); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( 0 ); ++ return (0); + } + + static void + vips_foreign_save_jp2k_buffer_class_init( +- VipsForeignSaveJp2kBufferClass *class ) ++ VipsForeignSaveJp2kBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -1119,17 +1119,16 @@ vips_foreign_save_jp2k_buffer_class_init( + object_class->nickname = "jp2ksave_buffer"; + object_class->build = vips_foreign_save_jp2k_buffer_build; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to save to" ), ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to save to"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJp2kBuffer, buf ), +- VIPS_TYPE_BLOB ); +- ++ G_STRUCT_OFFSET(VipsForeignSaveJp2kBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_save_jp2k_buffer_init( VipsForeignSaveJp2kBuffer *buffer ) ++vips_foreign_save_jp2k_buffer_init(VipsForeignSaveJp2kBuffer *buffer) + { + } + +@@ -1141,33 +1140,32 @@ typedef struct _VipsForeignSaveJp2kTarget { + + typedef VipsForeignSaveJp2kClass VipsForeignSaveJp2kTargetClass; + +-G_DEFINE_TYPE( VipsForeignSaveJp2kTarget, vips_foreign_save_jp2k_target, +- vips_foreign_save_jp2k_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveJp2kTarget, vips_foreign_save_jp2k_target, ++ vips_foreign_save_jp2k_get_type()); + + static int +-vips_foreign_save_jp2k_target_build( VipsObject *object ) ++vips_foreign_save_jp2k_target_build(VipsObject *object) + { + VipsForeignSaveJp2k *jp2k = (VipsForeignSaveJp2k *) object; + VipsForeignSaveJp2kTarget *target = + (VipsForeignSaveJp2kTarget *) object; + +- if( target->target ) { ++ if (target->target) { + jp2k->target = target->target; +- g_object_ref( jp2k->target ); ++ g_object_ref(jp2k->target); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_jp2k_target_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_jp2k_target_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void + vips_foreign_save_jp2k_target_class_init( +- VipsForeignSaveJp2kTargetClass *class ) ++ VipsForeignSaveJp2kTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -1176,24 +1174,23 @@ vips_foreign_save_jp2k_target_class_init( + object_class->nickname = "jp2ksave_target"; + object_class->build = vips_foreign_save_jp2k_target_build; + +- VIPS_ARG_OBJECT( class, "target", 1, +- _( "Target" ), +- _( "Target to save to" ), ++ VIPS_ARG_OBJECT(class, "target", 1, ++ _("Target"), ++ _("Target to save to"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJp2kTarget, target ), +- VIPS_TYPE_TARGET ); +- ++ G_STRUCT_OFFSET(VipsForeignSaveJp2kTarget, target), ++ VIPS_TYPE_TARGET); + } + + static void +-vips_foreign_save_jp2k_target_init( VipsForeignSaveJp2kTarget *target ) ++vips_foreign_save_jp2k_target_init(VipsForeignSaveJp2kTarget *target) + { + } + + /* Stuff we track during tile compress. + */ + typedef struct _TileCompress { +- opj_codec_t *codec; ++ opj_codec_t *codec; + opj_image_t *image; + opj_stream_t *stream; + VipsPel *accumulate; +@@ -1203,17 +1200,17 @@ typedef struct _TileCompress { + * subsampling. + */ + static void +-vips_foreign_save_jp2k_unpack_subsample_image( VipsRegion *region, +- VipsRect *tile, opj_image_t *image, VipsPel *accumulate ) ++vips_foreign_save_jp2k_unpack_subsample_image(VipsRegion *region, ++ VipsRect *tile, opj_image_t *image, VipsPel *accumulate) + { + VipsImage *im = region->im; +- size_t sizeof_element = VIPS_REGION_SIZEOF_ELEMENT( region ); +- size_t lskip = VIPS_REGION_LSKIP( region ); ++ size_t sizeof_element = VIPS_REGION_SIZEOF_ELEMENT(region); ++ size_t lskip = VIPS_REGION_LSKIP(region); + int n_bands = im->Bands; + + int x, y, z, i; + +- for( i = 0; i < n_bands; i++ ) { ++ for (i = 0; i < n_bands; i++) { + opj_image_comp_t *comp = &image->comps[i]; + int *q = comp->data; + +@@ -1221,40 +1218,40 @@ vips_foreign_save_jp2k_unpack_subsample_image( VipsRegion *region, + * align to scanlines on comp. + */ + int output_width = VIPS_ROUND_UINT( +- (double) comp->w / comp->dx ); ++ (double) comp->w / comp->dx); + int output_height = VIPS_ROUND_UINT( +- (double) comp->h / comp->dy ); ++ (double) comp->h / comp->dy); + +- for( y = 0; y < output_height; y++ ) { ++ for (y = 0; y < output_height; y++) { + VipsPel *p = i * sizeof_element + +- VIPS_REGION_ADDR( region, +- tile->left, tile->top + y * comp->dy ); ++ VIPS_REGION_ADDR(region, ++ tile->left, tile->top + y * comp->dy); + + /* Shrink a line of pels to q. + */ +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_CHAR: +- SHRINK( int, int, signed char ); ++ SHRINK(int, int, signed char); + break; + + case VIPS_FORMAT_UCHAR: +- SHRINK( int, int, unsigned char ); ++ SHRINK(int, int, unsigned char); + break; + + case VIPS_FORMAT_SHORT: +- SHRINK( int, int, signed short ); ++ SHRINK(int, int, signed short); + break; + + case VIPS_FORMAT_USHORT: +- SHRINK( int, int, unsigned short ); ++ SHRINK(int, int, unsigned short); + break; + + case VIPS_FORMAT_INT: +- SHRINK( int, gint64, signed int ); ++ SHRINK(int, gint64, signed int); + break; + + case VIPS_FORMAT_UINT: +- SHRINK( int, gint64, unsigned int ); ++ SHRINK(int, gint64, unsigned int); + break; + + default: +@@ -1271,36 +1268,36 @@ vips_foreign_save_jp2k_unpack_subsample_image( VipsRegion *region, + * subsampling. + */ + static void +-vips_foreign_save_jp2k_unpack_image( VipsRegion *region, VipsRect *tile, +- opj_image_t *image ) ++vips_foreign_save_jp2k_unpack_image(VipsRegion *region, VipsRect *tile, ++ opj_image_t *image) + { + VipsImage *im = region->im; + int b = im->Bands; + + int x, y, i; + +- for( y = 0; y < tile->height; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( region, +- tile->left, tile->top + y ); ++ for (y = 0; y < tile->height; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(region, ++ tile->left, tile->top + y); + +- for( i = 0; i < b; i++ ) { ++ for (i = 0; i < b; i++) { + opj_image_comp_t *comp = &image->comps[i]; +- int *q = comp->data + y * comp->w; ++ int *q = comp->data + y * comp->w; + +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_CHAR: + case VIPS_FORMAT_UCHAR: +- UNPACK( int, unsigned char ); ++ UNPACK(int, unsigned char); + break; + + case VIPS_FORMAT_SHORT: + case VIPS_FORMAT_USHORT: +- UNPACK( int, unsigned short ); ++ UNPACK(int, unsigned short); + break; + + case VIPS_FORMAT_INT: + case VIPS_FORMAT_UINT: +- UNPACK( int, unsigned int ); ++ UNPACK(int, unsigned int); + break; + + default: +@@ -1312,12 +1309,12 @@ vips_foreign_save_jp2k_unpack_image( VipsRegion *region, VipsRect *tile, + } + + void +-vips__foreign_load_jp2k_compress_free( TileCompress *compress ) ++vips__foreign_load_jp2k_compress_free(TileCompress *compress) + { +- VIPS_FREEF( opj_destroy_codec, compress->codec ); +- VIPS_FREEF( opj_image_destroy, compress->image ); +- VIPS_FREEF( opj_stream_destroy, compress->stream ); +- VIPS_FREE( compress->accumulate ); ++ VIPS_FREEF(opj_destroy_codec, compress->codec); ++ VIPS_FREEF(opj_image_destroy, compress->image); ++ VIPS_FREEF(opj_stream_destroy, compress->stream); ++ VIPS_FREE(compress->accumulate); + } + + /* Compress area @tile within @region and write to @target as a @tile_width by +@@ -1328,10 +1325,10 @@ vips__foreign_load_jp2k_compress_free( TileCompress *compress ) + * nope, openjpeg does not allow that. + */ + int +-vips__foreign_load_jp2k_compress( VipsRegion *region, ++vips__foreign_load_jp2k_compress(VipsRegion *region, + VipsRect *tile, VipsTarget *target, + int tile_width, int tile_height, +- gboolean save_as_ycc, gboolean subsample, gboolean lossless, int Q ) ++ gboolean save_as_ycc, gboolean subsample, gboolean lossless, int Q) + { + TileCompress compress = { 0 }; + opj_cparameters_t parameters; +@@ -1344,11 +1341,11 @@ vips__foreign_load_jp2k_compress( VipsRegion *region, + + /* Set compression params. + */ +- opj_set_default_encoder_parameters( ¶meters ); ++ opj_set_default_encoder_parameters(¶meters); + + /* Set compression profile. + */ +- vips_foreign_save_jp2k_set_profile( ¶meters, lossless, Q ); ++ vips_foreign_save_jp2k_set_profile(¶meters, lossless, Q); + + /* Makes three band images smaller, somehow. + */ +@@ -1357,81 +1354,81 @@ vips__foreign_load_jp2k_compress( VipsRegion *region, + /* Create output image. TRUE means we alloc memory for the image + * planes. + */ +- if( !(compress.image = vips_foreign_save_jp2k_new_image( region->im, +- tile_width, tile_height, subsample, save_as_ycc, TRUE )) ) { +- vips__foreign_load_jp2k_compress_free( &compress ); +- return( -1 ); ++ if (!(compress.image = vips_foreign_save_jp2k_new_image(region->im, ++ tile_width, tile_height, subsample, save_as_ycc, TRUE))) { ++ vips__foreign_load_jp2k_compress_free(&compress); ++ return (-1); + } + + /* We need a line of sums for chroma subsample. At worst, gint64. + */ +- sizeof_line = sizeof( gint64 ) * tile->width; +- if( !(compress.accumulate = +- VIPS_ARRAY( NULL, sizeof_line, VipsPel )) ) { +- vips__foreign_load_jp2k_compress_free( &compress ); +- return( -1 ); ++ sizeof_line = sizeof(gint64) * tile->width; ++ if (!(compress.accumulate = ++ VIPS_ARRAY(NULL, sizeof_line, VipsPel))) { ++ vips__foreign_load_jp2k_compress_free(&compress); ++ return (-1); + } + +- /* tiff needs a jpeg2000 codestream, not a jp2 file. +- */ +- compress.codec = opj_create_compress( OPJ_CODEC_J2K ); +- vips_foreign_save_jp2k_attach_handlers( compress.codec ); +- if( !opj_setup_encoder( compress.codec, +- ¶meters, compress.image ) ) { +- vips__foreign_load_jp2k_compress_free( &compress ); +- return( -1 ); ++ /* tiff needs a jpeg2000 codestream, not a jp2 file. ++ */ ++ compress.codec = opj_create_compress(OPJ_CODEC_J2K); ++ vips_foreign_save_jp2k_attach_handlers(compress.codec); ++ if (!opj_setup_encoder(compress.codec, ++ ¶meters, compress.image)) { ++ vips__foreign_load_jp2k_compress_free(&compress); ++ return (-1); + } + +- opj_codec_set_threads( compress.codec, vips_concurrency_get() ); ++ opj_codec_set_threads(compress.codec, vips_concurrency_get()); + +- if( save_as_ycc ) +- vips_foreign_save_jp2k_rgb_to_ycc( region, +- tile, compress.image->comps[0].prec ); ++ if (save_as_ycc) ++ vips_foreign_save_jp2k_rgb_to_ycc(region, ++ tile, compress.image->comps[0].prec); + + /* we need to unpack to the int arrays on comps[i].data + */ +- if( subsample ) +- vips_foreign_save_jp2k_unpack_subsample_image( region, ++ if (subsample) ++ vips_foreign_save_jp2k_unpack_subsample_image(region, + tile, compress.image, +- compress.accumulate ); ++ compress.accumulate); + else +- vips_foreign_save_jp2k_unpack_image( region, +- tile, compress.image ); ++ vips_foreign_save_jp2k_unpack_image(region, ++ tile, compress.image); + +- if( !(compress.stream = vips_foreign_save_jp2k_target( target )) ) { +- vips__foreign_load_jp2k_compress_free( &compress ); +- return( -1 ); ++ if (!(compress.stream = vips_foreign_save_jp2k_target(target))) { ++ vips__foreign_load_jp2k_compress_free(&compress); ++ return (-1); + } + +- if( !opj_start_compress( compress.codec, +- compress.image, compress.stream ) ) { +- vips__foreign_load_jp2k_compress_free( &compress ); +- return( -1 ); ++ if (!opj_start_compress(compress.codec, ++ compress.image, compress.stream)) { ++ vips__foreign_load_jp2k_compress_free(&compress); ++ return (-1); + } + +- if( !opj_encode( compress.codec, compress.stream ) ) { +- vips__foreign_load_jp2k_compress_free( &compress ); +- return( -1 ); ++ if (!opj_encode(compress.codec, compress.stream)) { ++ vips__foreign_load_jp2k_compress_free(&compress); ++ return (-1); + } + +- opj_end_compress( compress.codec, compress.stream ); ++ opj_end_compress(compress.codec, compress.stream); + +- vips__foreign_load_jp2k_compress_free( &compress ); ++ vips__foreign_load_jp2k_compress_free(&compress); + +- return( 0 ); ++ return (0); + } + + #else /*!HAVE_LIBOPENJP2*/ + + int +-vips__foreign_load_jp2k_compress( VipsRegion *region, ++vips__foreign_load_jp2k_compress(VipsRegion *region, + VipsRect *tile, VipsTarget *target, + int tile_width, int tile_height, +- gboolean save_as_ycc, gboolean subsample, gboolean lossless, int Q ) ++ gboolean save_as_ycc, gboolean subsample, gboolean lossless, int Q) + { +- vips_error( "jp2k", +- "%s", _( "libvips built without JPEG2000 support" ) ); +- return( -1 ); ++ vips_error("jp2k", ++ "%s", _("libvips built without JPEG2000 support")); ++ return (-1); + } + + #endif /*HAVE_LIBOPENJP2*/ +@@ -1474,16 +1471,16 @@ vips__foreign_load_jp2k_compress( VipsRegion *region, + * Returns: 0 on success, -1 on error. + */ + int +-vips_jp2ksave( VipsImage *in, const char *filename, ... ) ++vips_jp2ksave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "jp2ksave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("jp2ksave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -1508,7 +1505,7 @@ vips_jp2ksave( VipsImage *in, const char *filename, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_jp2ksave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++vips_jp2ksave_buffer(VipsImage *in, void **buf, size_t *len, ...) + { + va_list ap; + VipsArea *area; +@@ -1516,23 +1513,23 @@ vips_jp2ksave_buffer( VipsImage *in, void **buf, size_t *len, ... ) + + area = NULL; + +- va_start( ap, len ); +- result = vips_call_split( "jp2ksave_buffer", ap, in, &area ); +- va_end( ap ); ++ va_start(ap, len); ++ result = vips_call_split("jp2ksave_buffer", ap, in, &area); ++ va_end(ap); + +- if( !result && +- area ) { +- if( buf ) { ++ if (!result && ++ area) { ++ if (buf) { + *buf = area->data; + area->free_fn = NULL; + } +- if( len ) ++ if (len) + *len = area->length; + +- vips_area_unref( area ); ++ vips_area_unref(area); + } + +- return( result ); ++ return (result); + } + + /** +@@ -1556,14 +1553,14 @@ vips_jp2ksave_buffer( VipsImage *in, void **buf, size_t *len, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_jp2ksave_target( VipsImage *in, VipsTarget *target, ... ) ++vips_jp2ksave_target(VipsImage *in, VipsTarget *target, ...) + { + va_list ap; + int result; + +- va_start( ap, target ); +- result = vips_call_split( "jp2ksave_target", ap, in, target ); +- va_end( ap ); ++ va_start(ap, target); ++ result = vips_call_split("jp2ksave_target", ap, in, target); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/jpeg.h b/libvips/foreign/jpeg.h +index 1068df63a4..a36725bad3 100644 +--- a/libvips/foreign/jpeg.h ++++ b/libvips/foreign/jpeg.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -42,8 +42,8 @@ extern "C" { + #undef HAVE_STDLIB_H + #endif /*HAVE_STDLIB_H*/ + +-/* jpeglib defines its own boolean type as an enum which then clashes with +- * everyone elses. Rename it as jboolean. ++/* jpeglib defines its own boolean type as an enum which then clashes with ++ * everyone elses. Rename it as jboolean. + */ + #define boolean jboolean + +@@ -71,12 +71,12 @@ typedef struct { + + /* Private stuff for us. + */ +- jmp_buf jmp; /* longjmp() here to get back to VIPS */ +- FILE *fp; /* fclose() if non-NULL */ ++ jmp_buf jmp; /* longjmp() here to get back to VIPS */ ++ FILE *fp; /* fclose() if non-NULL */ + } ErrorManager; + +-void vips__new_output_message( j_common_ptr cinfo ); +-void vips__new_error_exit( j_common_ptr cinfo ); ++void vips__new_output_message(j_common_ptr cinfo); ++void vips__new_error_exit(j_common_ptr cinfo); + + #ifdef __cplusplus + } +diff --git a/libvips/foreign/jpeg2vips.c b/libvips/foreign/jpeg2vips.c +index d494dfb30f..df520ce271 100644 +--- a/libvips/foreign/jpeg2vips.c ++++ b/libvips/foreign/jpeg2vips.c +@@ -38,7 +38,7 @@ + * 12/10/2011 + * - read XMP data + * 3/11/11 +- * - attach exif tags as coded values ++ * - attach exif tags as coded values + * 24/11/11 + * - turn into a set of read fns ready to be called from a class + * 9/1/12 +@@ -62,11 +62,11 @@ + * 16/10/14 + * - add "autorotate" option + * 20/1/15 +- * - don't call jpeg_finish_decompress(), all it does is read and check ++ * - don't call jpeg_finish_decompress(), all it does is read and check + * the tail of the file + * 26/2/15 + * - close the jpeg read down early for a header read ... this saves an +- * fd during jpg read, handy for large numbers of input images ++ * fd during jpg read, handy for large numbers of input images + * 15/7/15 + * - save exif tags using @name, not @title ... @title is subject to i18n + * 21/2/16 +@@ -91,7 +91,7 @@ + * - revise read from buffer functions in line with latest libjpeg + * recommendations -- fixes a segv with crafted jpeg images + * 29/8/17 +- * - revert previous warning change: libvips reports serious corruption, ++ * - revert previous warning change: libvips reports serious corruption, + * like a truncated file, as a warning and we need to be able to catch + * that + * 9/4/18 +@@ -109,37 +109,37 @@ + * 5/5/20 angelmixu + * - better handling of JFIF res unit 0 + * 13/9/20 +- * - set resolution unit from JFIF ++ * - set resolution unit from JFIF + * 24/7/21 + * - add fail_on support +- * 2/8/22 ++ * 2/8/22 + * - add "unlimited" + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -170,7 +170,7 @@ + /* Stuff we track during a read. + */ + typedef struct _ReadJpeg { +- VipsImage *out; ++ VipsImage *out; + + /* Shrink by this much during load. 1, 2, 4, 8. + */ +@@ -181,7 +181,7 @@ typedef struct _ReadJpeg { + VipsFailOn fail_on; + + struct jpeg_decompress_struct cinfo; +- ErrorManager eman; ++ ErrorManager eman; + gboolean invert_pels; + + /* Track the y pos during a read with this. +@@ -228,7 +228,7 @@ typedef struct { + } Source; + + static void +-source_init_source( j_decompress_ptr cinfo ) ++source_init_source(j_decompress_ptr cinfo) + { + Source *src = (Source *) cinfo->src; + +@@ -242,7 +242,7 @@ source_init_source( j_decompress_ptr cinfo ) + /* Fill the input buffer --- called whenever buffer is emptied. + */ + static boolean +-source_fill_input_buffer( j_decompress_ptr cinfo ) ++source_fill_input_buffer(j_decompress_ptr cinfo) + { + static const JOCTET eoi_buffer[4] = { + (JOCTET) 0xFF, (JOCTET) JPEG_EOI, 0, 0 +@@ -252,39 +252,39 @@ source_fill_input_buffer( j_decompress_ptr cinfo ) + + gint64 bytes_read; + +- if( (bytes_read = vips_source_read( src->source, +- src->buf, SOURCE_BUFFER_SIZE )) > 0 ) { ++ if ((bytes_read = vips_source_read(src->source, ++ src->buf, SOURCE_BUFFER_SIZE)) > 0) { + src->pub.next_input_byte = src->buf; + src->pub.bytes_in_buffer = bytes_read; + } + else { +- if( src->jpeg->fail_on >= VIPS_FAIL_ON_TRUNCATED ) { +- /* Knock the output out of cache. +- */ +- vips_foreign_load_invalidate( src->jpeg->out ); +- ERREXIT( cinfo, JERR_INPUT_EOF ); +- } ++ if (src->jpeg->fail_on >= VIPS_FAIL_ON_TRUNCATED) { ++ /* Knock the output out of cache. ++ */ ++ vips_foreign_load_invalidate(src->jpeg->out); ++ ERREXIT(cinfo, JERR_INPUT_EOF); ++ } + else +- WARNMS( cinfo, JWRN_JPEG_EOF ); ++ WARNMS(cinfo, JWRN_JPEG_EOF); + + src->pub.next_input_byte = eoi_buffer; + src->pub.bytes_in_buffer = 2; + } + +- return( TRUE ); ++ return (TRUE); + } + + static void +-skip_input_data( j_decompress_ptr cinfo, long num_bytes ) ++skip_input_data(j_decompress_ptr cinfo, long num_bytes) + { + Source *src = (Source *) cinfo->src; + +- if( num_bytes > 0 ) { ++ if (num_bytes > 0) { + while (num_bytes > (long) src->pub.bytes_in_buffer) { + num_bytes -= (long) src->pub.bytes_in_buffer; +- (void) (*src->pub.fill_input_buffer) (cinfo); ++ (void) (*src->pub.fill_input_buffer)(cinfo); + +- /* note we assume that fill_input_buffer will never ++ /* note we assume that fill_input_buffer will never + * return FALSE, so suspension need not be handled. + */ + } +@@ -295,73 +295,72 @@ skip_input_data( j_decompress_ptr cinfo, long num_bytes ) + } + + static int +-readjpeg_open_input( ReadJpeg *jpeg ) ++readjpeg_open_input(ReadJpeg *jpeg) + { + j_decompress_ptr cinfo = &jpeg->cinfo; + +- if( jpeg->source && +- !cinfo->src ) { ++ if (jpeg->source && ++ !cinfo->src) { + Source *src; + +- if( vips_source_rewind( jpeg->source ) ) +- return( -1 ); ++ if (vips_source_rewind(jpeg->source)) ++ return (-1); + +- cinfo->src = (struct jpeg_source_mgr *) +- (*cinfo->mem->alloc_small)( +- (j_common_ptr) cinfo, JPOOL_PERMANENT, +- sizeof( Source ) ); ++ cinfo->src = (struct jpeg_source_mgr *) (*cinfo->mem->alloc_small)( ++ (j_common_ptr) cinfo, JPOOL_PERMANENT, ++ sizeof(Source)); + + src = (Source *) cinfo->src; + src->jpeg = jpeg; + src->source = jpeg->source; + src->pub.init_source = source_init_source; + src->pub.fill_input_buffer = source_fill_input_buffer; +- src->pub.resync_to_restart = jpeg_resync_to_restart; +- src->pub.skip_input_data = skip_input_data; ++ src->pub.resync_to_restart = jpeg_resync_to_restart; ++ src->pub.skip_input_data = skip_input_data; + src->pub.bytes_in_buffer = 0; + src->pub.next_input_byte = src->buf; + } + +- return( 0 ); ++ return (0); + } + + static void +-readjpeg_emit_message( j_common_ptr cinfo, int msg_level ) ++readjpeg_emit_message(j_common_ptr cinfo, int msg_level) + { +- ReadJpeg *jpeg = (ReadJpeg *) cinfo->client_data; ++ ReadJpeg *jpeg = (ReadJpeg *) cinfo->client_data; + + long num_warnings; + +- if( msg_level < 0 ) { ++ if (msg_level < 0) { + /* Always count warnings in num_warnings. + */ + num_warnings = ++cinfo->err->num_warnings; + + /* Corrupt files may give many warnings, the policy here is to + * show only the first warning and treat many warnings as fatal, +- * unless unlimited is set. ++ * unless unlimited is set. + */ +- if( num_warnings == 1 ) +- (*cinfo->err->output_message)( cinfo ); +- else if( !jpeg || +- (!jpeg->unlimited && num_warnings >= 100) ) +- cinfo->err->error_exit( cinfo ); ++ if (num_warnings == 1) ++ (*cinfo->err->output_message)(cinfo); ++ else if (!jpeg || ++ (!jpeg->unlimited && num_warnings >= 100)) ++ cinfo->err->error_exit(cinfo); + } +- else if( cinfo->err->trace_level >= msg_level ) ++ else if (cinfo->err->trace_level >= msg_level) + /* It's a trace message. Show it if trace_level >= msg_level. + */ +- (*cinfo->err->output_message)( cinfo ); ++ (*cinfo->err->output_message)(cinfo); + } + + /* This can be called many times. + */ + static int +-readjpeg_free( ReadJpeg *jpeg ) ++readjpeg_free(ReadJpeg *jpeg) + { +- if( jpeg->eman.pub.num_warnings != 0 ) { +- g_warning( _( "read gave %ld warnings" ), +- jpeg->eman.pub.num_warnings ); +- g_warning( "%s", vips_error_buffer() ); ++ if (jpeg->eman.pub.num_warnings != 0) { ++ g_warning(_("read gave %ld warnings"), ++ jpeg->eman.pub.num_warnings); ++ g_warning("%s", vips_error_buffer()); + + /* Make the message only appear once. + */ +@@ -373,43 +372,43 @@ readjpeg_free( ReadJpeg *jpeg ) + * jpeg_destroy_decompress(). + */ + +- /* I don't think this can fail. It's harmless to call many times. ++ /* I don't think this can fail. It's harmless to call many times. + */ +- jpeg_destroy_decompress( &jpeg->cinfo ); ++ jpeg_destroy_decompress(&jpeg->cinfo); + +- VIPS_UNREF( jpeg->source ); ++ VIPS_UNREF(jpeg->source); + +- return( 0 ); ++ return (0); + } + + static void +-readjpeg_close_cb( VipsImage *image, ReadJpeg *jpeg ) ++readjpeg_close_cb(VipsImage *image, ReadJpeg *jpeg) + { +- (void) readjpeg_free( jpeg ); ++ (void) readjpeg_free(jpeg); + } + + static void +-readjpeg_minimise_cb( VipsImage *image, ReadJpeg *jpeg ) ++readjpeg_minimise_cb(VipsImage *image, ReadJpeg *jpeg) + { +- vips_source_minimise( jpeg->source ); ++ vips_source_minimise(jpeg->source); + } + + static ReadJpeg * +-readjpeg_new( VipsSource *source, VipsImage *out, +- int shrink, VipsFailOn fail_on, gboolean autorotate, +- gboolean unlimited ) ++readjpeg_new(VipsSource *source, VipsImage *out, ++ int shrink, VipsFailOn fail_on, gboolean autorotate, ++ gboolean unlimited) + { + ReadJpeg *jpeg; + +- if( !(jpeg = VIPS_NEW( out, ReadJpeg )) ) +- return( NULL ); ++ if (!(jpeg = VIPS_NEW(out, ReadJpeg))) ++ return (NULL); + + jpeg->out = out; + jpeg->source = source; +- g_object_ref( source ); ++ g_object_ref(source); + jpeg->shrink = shrink; + jpeg->fail_on = fail_on; +- jpeg->cinfo.err = jpeg_std_error( &jpeg->eman.pub ); ++ jpeg->cinfo.err = jpeg_std_error(&jpeg->eman.pub); + jpeg->eman.pub.error_exit = vips__new_error_exit; + jpeg->eman.pub.emit_message = readjpeg_emit_message; + jpeg->eman.pub.output_message = vips__new_output_message; +@@ -417,28 +416,28 @@ readjpeg_new( VipsSource *source, VipsImage *out, + jpeg->y_pos = 0; + jpeg->autorotate = autorotate; + jpeg->unlimited = unlimited; +- jpeg->cinfo.client_data = jpeg; ++ jpeg->cinfo.client_data = jpeg; + + /* jpeg_create_decompress() can fail on some sanity checks. Don't + * readjpeg_free() since we don't want to jpeg_destroy_decompress(). + */ +- if( setjmp( jpeg->eman.jmp ) ) +- return( NULL ); ++ if (setjmp(jpeg->eman.jmp)) ++ return (NULL); + +- jpeg_create_decompress( &jpeg->cinfo ); ++ jpeg_create_decompress(&jpeg->cinfo); + +- g_signal_connect( out, "close", +- G_CALLBACK( readjpeg_close_cb ), jpeg ); +- g_signal_connect( out, "minimise", +- G_CALLBACK( readjpeg_minimise_cb ), jpeg ); ++ g_signal_connect(out, "close", ++ G_CALLBACK(readjpeg_close_cb), jpeg); ++ g_signal_connect(out, "minimise", ++ G_CALLBACK(readjpeg_minimise_cb), jpeg); + +- return( jpeg ); ++ return (jpeg); + } + + static const char * +-find_chroma_subsample( struct jpeg_decompress_struct *cinfo ) ++find_chroma_subsample(struct jpeg_decompress_struct *cinfo) + { +- /* libjpeg only uses 4:4:4 and 4:2:0, confusingly. ++ /* libjpeg only uses 4:4:4 and 4:2:0, confusingly. + * + * http://poynton.ca/PDFs/Chroma_subsampling_notation.pdf + */ +@@ -446,61 +445,59 @@ find_chroma_subsample( struct jpeg_decompress_struct *cinfo ) + cinfo->max_v_samp_factor > 1; + gboolean is_cmyk = cinfo->num_components > 3; + +- return( is_cmyk ? +- (has_subsample ? "4:2:0:4" : "4:4:4:4" ) : +- (has_subsample ? "4:2:0" : "4:4:4") ); ++ return (is_cmyk ? (has_subsample ? "4:2:0:4" : "4:4:4:4") : (has_subsample ? "4:2:0" : "4:4:4")); + } + + static int +-attach_blob( VipsImage *im, const char *field, void *data, size_t data_length ) ++attach_blob(VipsImage *im, const char *field, void *data, size_t data_length) + { + /* Only use the first one. + */ +- if( vips_image_get_typeof( im, field ) ) { ++ if (vips_image_get_typeof(im, field)) { + #ifdef DEBUG +- printf( "attach_blob: second %s block, ignoring\n", field ); ++ printf("attach_blob: second %s block, ignoring\n", field); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + #ifdef DEBUG +- printf( "attach_blob: attaching %zd bytes of %s\n", +- data_length, field ); ++ printf("attach_blob: attaching %zd bytes of %s\n", ++ data_length, field); + #endif /*DEBUG*/ + +- vips_image_set_blob_copy( im, field, data, data_length ); ++ vips_image_set_blob_copy(im, field, data, data_length); + +- return( 0 ); ++ return (0); + } + +-/* data is the XMP string ... it'll have something like ++/* data is the XMP string ... it'll have something like + * "http://ns.adobe.com/xap/1.0/" at the front, then a null character, then + * the real XMP. + */ + static int +-attach_xmp_blob( VipsImage *im, void *data, size_t data_length ) ++attach_xmp_blob(VipsImage *im, void *data, size_t data_length) + { + char *p = (char *) data; + int i; + +- if( data_length < 4 || +- !vips_isprefix( "http", p ) ) +- return( 0 ); ++ if (data_length < 4 || ++ !vips_isprefix("http", p)) ++ return (0); + + /* Search for a null char within the first few characters. 80 + * should be plenty for a basic URL. + * + * -2 for the extra null. + */ +- for( i = 0; i < VIPS_MIN( 80, data_length - 2 ); i++ ) +- if( !p[i] ) ++ for (i = 0; i < VIPS_MIN(80, data_length - 2); i++) ++ if (!p[i]) + break; +- if( p[i] ) +- return( 0 ); ++ if (p[i]) ++ return (0); + +- return( attach_blob( im, VIPS_META_XMP_NAME, +- p + i + 1, data_length - i - 1 ) ); ++ return (attach_blob(im, VIPS_META_XMP_NAME, ++ p + i + 1, data_length - i - 1)); + } + + /* Number of app2 sections we can capture. Each one can be 64k, so 6400k should +@@ -512,7 +509,7 @@ attach_xmp_blob( VipsImage *im, void *data, size_t data_length ) + * do 255-pel. + */ + static int +-read_jpeg_header( ReadJpeg *jpeg, VipsImage *out ) ++read_jpeg_header(ReadJpeg *jpeg, VipsImage *out) + { + struct jpeg_decompress_struct *cinfo = &jpeg->cinfo; + +@@ -527,16 +524,16 @@ read_jpeg_header( ReadJpeg *jpeg, VipsImage *out ) + size_t data_length; + int i; + +- /* Read JPEG header. libjpeg will set out_color_space sanely for us ++ /* Read JPEG header. libjpeg will set out_color_space sanely for us + * for YUV YCCK etc. + */ +- jpeg_read_header( cinfo, TRUE ); ++ jpeg_read_header(cinfo, TRUE); + cinfo->scale_denom = jpeg->shrink; + cinfo->scale_num = 1; +- jpeg_calc_output_dimensions( cinfo ); ++ jpeg_calc_output_dimensions(cinfo); + + jpeg->invert_pels = FALSE; +- switch( cinfo->out_color_space ) { ++ switch (cinfo->out_color_space) { + case JCS_GRAYSCALE: + interpretation = VIPS_INTERPRETATION_B_W; + break; +@@ -556,10 +553,10 @@ read_jpeg_header( ReadJpeg *jpeg, VipsImage *out ) + } + + #ifdef DEBUG +- if( cinfo->saw_JFIF_marker ) +- printf( "read_jpeg_header: jfif _density %d, %d, unit %d\n", ++ if (cinfo->saw_JFIF_marker) ++ printf("read_jpeg_header: jfif _density %d, %d, unit %d\n", + cinfo->X_density, cinfo->Y_density, +- cinfo->density_unit ); ++ cinfo->density_unit); + #endif /*DEBUG*/ + + /* Get the jfif resolution. exif may overwrite this later. Default to +@@ -567,16 +564,16 @@ read_jpeg_header( ReadJpeg *jpeg, VipsImage *out ) + */ + xres = 72.0 / 25.4; + yres = 72.0 / 25.4; +- if( cinfo->saw_JFIF_marker && +- cinfo->X_density != 1U && +- cinfo->Y_density != 1U ) { +- switch( cinfo->density_unit ) { ++ if (cinfo->saw_JFIF_marker && ++ cinfo->X_density != 1U && ++ cinfo->Y_density != 1U) { ++ switch (cinfo->density_unit) { + case 0: + /* X_density / Y_density gives the pixel aspect ratio. + * Leave xres, but adjust yres. + */ +- if( cinfo->Y_density > 0 ) +- yres = xres * cinfo->X_density / ++ if (cinfo->Y_density > 0) ++ yres = xres * cinfo->X_density / + cinfo->Y_density; + break; + +@@ -585,8 +582,8 @@ read_jpeg_header( ReadJpeg *jpeg, VipsImage *out ) + */ + xres = cinfo->X_density / 25.4; + yres = cinfo->Y_density / 25.4; +- vips_image_set_string( out, +- VIPS_META_RESOLUTION_UNIT, "in" ); ++ vips_image_set_string(out, ++ VIPS_META_RESOLUTION_UNIT, "in"); + break; + + case 2: +@@ -594,39 +591,39 @@ read_jpeg_header( ReadJpeg *jpeg, VipsImage *out ) + */ + xres = cinfo->X_density / 10.0; + yres = cinfo->Y_density / 10.0; +- vips_image_set_string( out, +- VIPS_META_RESOLUTION_UNIT, "cm" ); ++ vips_image_set_string(out, ++ VIPS_META_RESOLUTION_UNIT, "cm"); + break; + + default: +- g_warning( "%s", _( "unknown JFIF resolution unit" ) ); ++ g_warning("%s", _("unknown JFIF resolution unit")); + break; + } + + #ifdef DEBUG +- printf( "read_jpeg_header: seen jfif resolution %g, %g p/mm\n", +- xres, yres ); ++ printf("read_jpeg_header: seen jfif resolution %g, %g p/mm\n", ++ xres, yres); + #endif /*DEBUG*/ + } + + /* Set VIPS header. + */ +- vips_image_init_fields( out, ++ vips_image_init_fields(out, + cinfo->output_width, cinfo->output_height, + cinfo->output_components, + VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, + interpretation, +- xres, yres ); ++ xres, yres); + +- VIPS_SETSTR( out->filename, +- vips_connection_filename( VIPS_CONNECTION( jpeg->source ) ) ); ++ VIPS_SETSTR(out->filename, ++ vips_connection_filename(VIPS_CONNECTION(jpeg->source))); + +- if( vips_image_pipelinev( out, VIPS_DEMAND_STYLE_FATSTRIP, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(out, VIPS_DEMAND_STYLE_FATSTRIP, NULL)) ++ return (-1); + + /* cinfo->output_width and cinfo->output_height round up with + * shrink-on-load. For example, if the image is 1801 pixels across and +- * we shrink by 4, the output will be 450.25 pixels across, ++ * we shrink by 4, the output will be 450.25 pixels across, + * cinfo->output_width with be 451, and libjpeg will write a black + * column of pixels down the right. + * +@@ -639,65 +636,65 @@ read_jpeg_header( ReadJpeg *jpeg, VipsImage *out ) + /* Interlaced jpegs need lots of memory to read, so our caller needs + * to know. + */ +- (void) vips_image_set_int( out, "jpeg-multiscan", +- jpeg_has_multiple_scans( cinfo ) ); ++ (void) vips_image_set_int(out, "jpeg-multiscan", ++ jpeg_has_multiple_scans(cinfo)); + + /* 8.7 adds this for PNG as well, so we have a new format-neutral name. + */ +- if( jpeg_has_multiple_scans( cinfo ) ) +- vips_image_set_int( out, "interlaced", 1 ); ++ if (jpeg_has_multiple_scans(cinfo)) ++ vips_image_set_int(out, "interlaced", 1); + +- (void) vips_image_set_string( out, "jpeg-chroma-subsample", +- find_chroma_subsample( cinfo ) ); ++ (void) vips_image_set_string(out, "jpeg-chroma-subsample", ++ find_chroma_subsample(cinfo)); + + /* Look for EXIF and ICC profile. + */ +- for( p = cinfo->marker_list; p; p = p->next ) { ++ for (p = cinfo->marker_list; p; p = p->next) { + #ifdef DEBUG +-{ +- printf( "read_jpeg_header: seen %u bytes of APP%d\n", +- p->data_length, +- p->marker - JPEG_APP0 ); +- +- for( i = 0; i < 10; i++ ) +- printf( "\t%d) '%c' (%d)\n", +- i, p->data[i], p->data[i] ); +-} ++ { ++ printf("read_jpeg_header: seen %u bytes of APP%d\n", ++ p->data_length, ++ p->marker - JPEG_APP0); ++ ++ for (i = 0; i < 10; i++) ++ printf("\t%d) '%c' (%d)\n", ++ i, p->data[i], p->data[i]); ++ } + #endif /*DEBUG*/ + +- switch( p->marker ) { ++ switch (p->marker) { + case JPEG_APP0 + 1: + /* Possible EXIF or XMP data. + */ +- if( p->data_length > 4 && +- vips_isprefix( "Exif", (char *) p->data ) && +- attach_blob( out, VIPS_META_EXIF_NAME, +- p->data, p->data_length ) ) +- return( -1 ); +- +- if( p->data_length > 4 && +- vips_isprefix( "http", (char *) p->data ) && +- attach_xmp_blob( out, +- p->data, p->data_length ) ) +- return( -1 ); ++ if (p->data_length > 4 && ++ vips_isprefix("Exif", (char *) p->data) && ++ attach_blob(out, VIPS_META_EXIF_NAME, ++ p->data, p->data_length)) ++ return (-1); ++ ++ if (p->data_length > 4 && ++ vips_isprefix("http", (char *) p->data) && ++ attach_xmp_blob(out, ++ p->data, p->data_length)) ++ return (-1); + + break; + + case JPEG_APP0 + 2: + /* Possible ICC profile. + */ +- if( p->data_length > 14 && +- vips_isprefix( "ICC_PROFILE", +- (char *) p->data ) ) { ++ if (p->data_length > 14 && ++ vips_isprefix("ICC_PROFILE", ++ (char *) p->data)) { + /* cur_marker numbers from 1, according to + * spec. + */ + int cur_marker = p->data[12] - 1; + +- if( cur_marker >= 0 && +- cur_marker < MAX_APP2_SECTIONS ) { ++ if (cur_marker >= 0 && ++ cur_marker < MAX_APP2_SECTIONS) { + app2_data[cur_marker] = p->data + 14; +- app2_data_length[cur_marker] = ++ app2_data_length[cur_marker] = + p->data_length - 14; + } + } +@@ -706,19 +703,19 @@ read_jpeg_header( ReadJpeg *jpeg, VipsImage *out ) + case JPEG_APP0 + 13: + /* Possible IPTC data block. + */ +- if( p->data_length > 5 && +- vips_isprefix( "Photo", (char *) p->data ) ) { +- if( attach_blob( out, VIPS_META_IPTC_NAME, +- p->data, p->data_length ) ) +- return( -1 ); ++ if (p->data_length > 5 && ++ vips_isprefix("Photo", (char *) p->data)) { ++ if (attach_blob(out, VIPS_META_IPTC_NAME, ++ p->data, p->data_length)) ++ return (-1); + + /* Older versions of libvips used this misspelt + * name :-( attach under this name too for + * compatibility. + */ +- if( attach_blob( out, "ipct-data", +- p->data, p->data_length ) ) +- return( -1 ); ++ if (attach_blob(out, "ipct-data", ++ p->data, p->data_length)) ++ return (-1); + } + break; + +@@ -738,22 +735,22 @@ read_jpeg_header( ReadJpeg *jpeg, VipsImage *out ) + * Leave this code here in case we come up with a + * better rule. + */ +- if( p->data_length >= 12 && +- vips_isprefix( "Adobe", (char *) p->data ) ) { +- if( p->data[11] == 0 ) { ++ if (p->data_length >= 12 && ++ vips_isprefix("Adobe", (char *) p->data)) { ++ if (p->data[11] == 0) { + #ifdef DEBUG +- printf( "complete Adobe block, not YCCK image\n" ); +-#endif /*DEBUG*/ +- //jpeg->invert_pels = FALSE; ++ printf("complete Adobe block, not YCCK image\n"); ++#endif /*DEBUG*/ ++ // jpeg->invert_pels = FALSE; + } + } + break; + + default: + #ifdef DEBUG +- printf( "read_jpeg_header: " +- "ignoring %u byte APP%d block\n", +- p->data_length, p->marker - JPEG_APP0 ); ++ printf("read_jpeg_header: " ++ "ignoring %u byte APP%d block\n", ++ p->data_length, p->marker - JPEG_APP0); + #endif /*DEBUG*/ + break; + } +@@ -762,38 +759,38 @@ read_jpeg_header( ReadJpeg *jpeg, VipsImage *out ) + /* Assemble ICC sections. + */ + data_length = 0; +- for( i = 0; i < MAX_APP2_SECTIONS && app2_data[i]; i++ ) ++ for (i = 0; i < MAX_APP2_SECTIONS && app2_data[i]; i++) + data_length += app2_data_length[i]; +- if( data_length ) { ++ if (data_length) { + unsigned char *data; + int p; + + #ifdef DEBUG +- printf( "read_jpeg_header: assembled %zd byte ICC profile\n", +- data_length ); ++ printf("read_jpeg_header: assembled %zd byte ICC profile\n", ++ data_length); + #endif /*DEBUG*/ + +- if( !(data = vips_malloc( NULL, data_length )) ) +- return( -1 ); ++ if (!(data = vips_malloc(NULL, data_length))) ++ return (-1); + + p = 0; +- for( i = 0; i < MAX_APP2_SECTIONS && app2_data[i]; i++ ) { +- memcpy( data + p, app2_data[i], app2_data_length[i] ); ++ for (i = 0; i < MAX_APP2_SECTIONS && app2_data[i]; i++) { ++ memcpy(data + p, app2_data[i], app2_data_length[i]); + p += app2_data_length[i]; + } + +- vips_image_set_blob( out, VIPS_META_ICC_NAME, +- (VipsCallbackFn) vips_area_free_cb, data, data_length ); ++ vips_image_set_blob(out, VIPS_META_ICC_NAME, ++ (VipsCallbackFn) vips_area_free_cb, data, data_length); + } + +- return( 0 ); ++ return (0); + } + + static int +-read_jpeg_generate( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++read_jpeg_generate(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + ReadJpeg *jpeg = (ReadJpeg *) a; + struct jpeg_decompress_struct *cinfo = &jpeg->cinfo; + int sz = cinfo->output_width * cinfo->output_components; +@@ -801,176 +798,176 @@ read_jpeg_generate( VipsRegion *or, + int y; + + #ifdef DEBUG_VERBOSE +- printf( "read_jpeg_generate: %p line %d, %d rows\n", +- g_thread_self(), r->top, r->height ); ++ printf("read_jpeg_generate: %p line %d, %d rows\n", ++ g_thread_self(), r->top, r->height); + #endif /*DEBUG_VERBOSE*/ + +- VIPS_GATE_START( "read_jpeg_generate: work" ); ++ VIPS_GATE_START("read_jpeg_generate: work"); + + /* We're inside a tilecache where tiles are the full image width, so + * this should always be true. + */ +- g_assert( r->left == 0 ); +- g_assert( r->width == or->im->Xsize ); +- g_assert( VIPS_RECT_BOTTOM( r ) <= or->im->Ysize ); ++ g_assert(r->left == 0); ++ g_assert(r->width == or->im->Xsize); ++ g_assert(VIPS_RECT_BOTTOM(r) <= or->im->Ysize); + + /* Tiles should always be on a 8-pixel boundary. + */ +- g_assert( r->top % 8 == 0 ); ++ g_assert(r->top % 8 == 0); + + /* Tiles should always be a strip in height, unless it's the final + * strip. + */ +- g_assert( r->height == VIPS_MIN( 8, or->im->Ysize - r->top ) ); ++ g_assert(r->height == VIPS_MIN(8, or->im->Ysize - r->top)); + + /* And check that y_pos is correct. It should be, since we are inside + * a vips_sequential(). + */ +- if( r->top != jpeg->y_pos ) { +- VIPS_GATE_STOP( "read_jpeg_generate: work" ); +- vips_error( "VipsJpeg", +- _( "out of order read at line %d" ), jpeg->y_pos ); ++ if (r->top != jpeg->y_pos) { ++ VIPS_GATE_STOP("read_jpeg_generate: work"); ++ vips_error("VipsJpeg", ++ _("out of order read at line %d"), jpeg->y_pos); + +- return( -1 ); ++ return (-1); + } + + /* Here for longjmp() from vips__new_error_exit() during + * jpeg_read_scanlines(). + */ +- if( setjmp( jpeg->eman.jmp ) ) { +- VIPS_GATE_STOP( "read_jpeg_generate: work" ); ++ if (setjmp(jpeg->eman.jmp)) { ++ VIPS_GATE_STOP("read_jpeg_generate: work"); + + #ifdef DEBUG +- printf( "read_jpeg_generate: longjmp() exit\n" ); ++ printf("read_jpeg_generate: longjmp() exit\n"); + #endif /*DEBUG*/ + +- return( -1 ); ++ return (-1); + } + +- if( jpeg->eman.pub.num_warnings > 0 && +- jpeg->fail_on >= VIPS_FAIL_ON_WARNING ) { +- VIPS_GATE_STOP( "read_jpeg_generate: work" ); ++ if (jpeg->eman.pub.num_warnings > 0 && ++ jpeg->fail_on >= VIPS_FAIL_ON_WARNING) { ++ VIPS_GATE_STOP("read_jpeg_generate: work"); + + /* Only fail once. + */ + jpeg->eman.pub.num_warnings = 0; + +- return( -1 ); ++ return (-1); + } + +- for( y = 0; y < r->height; y++ ) { ++ for (y = 0; y < r->height; y++) { + JSAMPROW row_pointer[1]; + +- row_pointer[0] = (JSAMPLE *) +- VIPS_REGION_ADDR( or, 0, r->top + y ); ++ row_pointer[0] = (JSAMPLE *) ++ VIPS_REGION_ADDR(or, 0, r->top + y); + +- jpeg_read_scanlines( cinfo, &row_pointer[0], 1 ); ++ jpeg_read_scanlines(cinfo, &row_pointer[0], 1); + +- if( jpeg->invert_pels ) { ++ if (jpeg->invert_pels) { + int x; + +- for( x = 0; x < sz; x++ ) ++ for (x = 0; x < sz; x++) + row_pointer[0][x] = 255 - row_pointer[0][x]; + } + +- jpeg->y_pos += 1; ++ jpeg->y_pos += 1; + } + +- VIPS_GATE_STOP( "read_jpeg_generate: work" ); ++ VIPS_GATE_STOP("read_jpeg_generate: work"); + +- return( 0 ); ++ return (0); + } + + /* Read a cinfo to a VIPS image. + */ + static int +-read_jpeg_image( ReadJpeg *jpeg, VipsImage *out ) ++read_jpeg_image(ReadJpeg *jpeg, VipsImage *out) + { + struct jpeg_decompress_struct *cinfo = &jpeg->cinfo; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 5 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(out), 5); + + VipsImage *im; + + /* Here for longjmp() from vips__new_error_exit() during + * jpeg_read_header() or jpeg_start_decompress(). + */ +- if( setjmp( jpeg->eman.jmp ) ) +- return( -1 ); ++ if (setjmp(jpeg->eman.jmp)) ++ return (-1); + + t[0] = vips_image_new(); +- if( read_jpeg_header( jpeg, t[0] ) ) +- return( -1 ); ++ if (read_jpeg_header(jpeg, t[0])) ++ return (-1); + + /* Switch to pixel decode. + */ +- if( vips_source_decode( jpeg->source ) ) +- return( -1 ); ++ if (vips_source_decode(jpeg->source)) ++ return (-1); + +- jpeg_start_decompress( cinfo ); ++ jpeg_start_decompress(cinfo); + + #ifdef DEBUG +- printf( "read_jpeg_image: starting decompress\n" ); ++ printf("read_jpeg_image: starting decompress\n"); + #endif /*DEBUG*/ + + /* We must crop after the seq, or our generate may not be asked for + * full lines of pixels and will attempt to write beyond the buffer. + */ +- if( vips_image_generate( t[0], +- NULL, read_jpeg_generate, NULL, +- jpeg, NULL ) || +- vips_sequential( t[0], &t[1], ++ if (vips_image_generate(t[0], ++ NULL, read_jpeg_generate, NULL, ++ jpeg, NULL) || ++ vips_sequential(t[0], &t[1], + "tile_height", 8, +- NULL ) || +- vips_extract_area( t[1], &t[2], +- 0, 0, jpeg->output_width, jpeg->output_height, NULL ) ) +- return( -1 ); ++ NULL) || ++ vips_extract_area(t[1], &t[2], ++ 0, 0, jpeg->output_width, jpeg->output_height, NULL)) ++ return (-1); + im = t[2]; + +- if( jpeg->autorotate && +- vips_image_get_orientation( im ) != 1 ) { ++ if (jpeg->autorotate && ++ vips_image_get_orientation(im) != 1) { + /* We have to copy to memory before calling autorot, since it + * needs random access. + */ +- if( !(t[3] = vips_image_copy_memory( im )) || +- vips_autorot( t[3], &t[4], NULL ) ) +- return( -1 ); ++ if (!(t[3] = vips_image_copy_memory(im)) || ++ vips_autorot(t[3], &t[4], NULL)) ++ return (-1); + im = t[4]; + } + +- if( vips_image_write( im, out ) ) +- return( -1 ); ++ if (vips_image_write(im, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips__jpeg_read( ReadJpeg *jpeg, VipsImage *out, gboolean header_only ) ++vips__jpeg_read(ReadJpeg *jpeg, VipsImage *out, gboolean header_only) + { + /* Need to read in APP1 (EXIF metadata), APP2 (ICC profile), APP13 + * (photoshop IPTC) and APP14 (Adobe flags). + */ +- jpeg_save_markers( &jpeg->cinfo, JPEG_APP0 + 1, 0xffff ); +- jpeg_save_markers( &jpeg->cinfo, JPEG_APP0 + 2, 0xffff ); +- jpeg_save_markers( &jpeg->cinfo, JPEG_APP0 + 13, 0xffff ); +- jpeg_save_markers( &jpeg->cinfo, JPEG_APP0 + 14, 0xffff ); ++ jpeg_save_markers(&jpeg->cinfo, JPEG_APP0 + 1, 0xffff); ++ jpeg_save_markers(&jpeg->cinfo, JPEG_APP0 + 2, 0xffff); ++ jpeg_save_markers(&jpeg->cinfo, JPEG_APP0 + 13, 0xffff); ++ jpeg_save_markers(&jpeg->cinfo, JPEG_APP0 + 14, 0xffff); + + #ifdef DEBUG +-{ +- int i; ++ { ++ int i; + +- /* Handy for debugging ... spot any extra markers. +- */ +- for( i = 0; i < 16; i++ ) +- jpeg_save_markers( &jpeg->cinfo, JPEG_APP0 + i, 0xffff ); +-} ++ /* Handy for debugging ... spot any extra markers. ++ */ ++ for (i = 0; i < 16; i++) ++ jpeg_save_markers(&jpeg->cinfo, JPEG_APP0 + i, 0xffff); ++ } + #endif /*DEBUG*/ + + /* Convert! + */ +- if( header_only ) { +- if( read_jpeg_header( jpeg, out ) ) +- return( -1 ); ++ if (header_only) { ++ if (read_jpeg_header(jpeg, out)) ++ return (-1); + + /* Patch in the correct size. + */ +@@ -979,58 +976,58 @@ vips__jpeg_read( ReadJpeg *jpeg, VipsImage *out, gboolean header_only ) + + /* Swap width and height if we're going to rotate this image. + */ +- if( jpeg->autorotate && +- vips_image_get_orientation_swap( out ) ) { +- VIPS_SWAP( int, out->Xsize, out->Ysize ); +- vips_autorot_remove_angle( out ); ++ if (jpeg->autorotate && ++ vips_image_get_orientation_swap(out)) { ++ VIPS_SWAP(int, out->Xsize, out->Ysize); ++ vips_autorot_remove_angle(out); + } + } + else { +- if( read_jpeg_image( jpeg, out ) ) +- return( -1 ); ++ if (read_jpeg_image(jpeg, out)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + int +-vips__jpeg_read_source( VipsSource *source, VipsImage *out, +- gboolean header_only, int shrink, VipsFailOn fail_on, +- gboolean autorotate, gboolean unlimited ) ++vips__jpeg_read_source(VipsSource *source, VipsImage *out, ++ gboolean header_only, int shrink, VipsFailOn fail_on, ++ gboolean autorotate, gboolean unlimited) + { + ReadJpeg *jpeg; + +- if( !(jpeg = readjpeg_new( source, out, shrink, fail_on, +- autorotate, unlimited )) ) +- return( -1 ); ++ if (!(jpeg = readjpeg_new(source, out, shrink, fail_on, ++ autorotate, unlimited))) ++ return (-1); + + /* Here for longjmp() from vips__new_error_exit() during + * cinfo->mem->alloc_small() or jpeg_read_header(). + */ +- if( setjmp( jpeg->eman.jmp ) ) +- return( -1 ); ++ if (setjmp(jpeg->eman.jmp)) ++ return (-1); + +- if( readjpeg_open_input( jpeg ) || +- vips__jpeg_read( jpeg, out, header_only ) ) +- return( -1 ); ++ if (readjpeg_open_input(jpeg) || ++ vips__jpeg_read(jpeg, out, header_only)) ++ return (-1); + +- if( header_only ) +- vips_source_minimise( source ); ++ if (header_only) ++ vips_source_minimise(source); + +- return( 0 ); ++ return (0); + } + + int +-vips__isjpeg_source( VipsSource *source ) ++vips__isjpeg_source(VipsSource *source) + { + const unsigned char *p; + +- if( (p = vips_source_sniff( source, 2 )) && +- p[0] == 0xff && +- p[1] == 0xd8 ) +- return( 1 ); ++ if ((p = vips_source_sniff(source, 2)) && ++ p[0] == 0xff && ++ p[1] == 0xd8) ++ return (1); + +- return( 0 ); ++ return (0); + } + + #endif /*HAVE_JPEG*/ +diff --git a/libvips/foreign/jpegload.c b/libvips/foreign/jpegload.c +index 04190587ee..d17018def5 100644 +--- a/libvips/foreign/jpegload.c ++++ b/libvips/foreign/jpegload.c +@@ -10,28 +10,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -90,83 +90,81 @@ typedef struct _VipsForeignLoadJpeg { + + typedef VipsForeignLoadClass VipsForeignLoadJpegClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadJpeg, vips_foreign_load_jpeg, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadJpeg, vips_foreign_load_jpeg, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_jpeg_dispose( GObject *gobject ) ++vips_foreign_load_jpeg_dispose(GObject *gobject) + { + VipsForeignLoadJpeg *jpeg = (VipsForeignLoadJpeg *) gobject; + +- VIPS_UNREF( jpeg->source ); ++ VIPS_UNREF(jpeg->source); + +- G_OBJECT_CLASS( vips_foreign_load_jpeg_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_jpeg_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_load_jpeg_build( VipsObject *object ) ++vips_foreign_load_jpeg_build(VipsObject *object) + { + VipsForeignLoadJpeg *jpeg = (VipsForeignLoadJpeg *) object; + +- if( jpeg->shrink != 1 && +- jpeg->shrink != 2 && +- jpeg->shrink != 4 && +- jpeg->shrink != 8 ) { +- vips_error( "VipsFormatLoadJpeg", +- _( "bad shrink factor %d" ), jpeg->shrink ); +- return( -1 ); ++ if (jpeg->shrink != 1 && ++ jpeg->shrink != 2 && ++ jpeg->shrink != 4 && ++ jpeg->shrink != 8) { ++ vips_error("VipsFormatLoadJpeg", ++ _("bad shrink factor %d"), jpeg->shrink); ++ return (-1); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_jpeg_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_jpeg_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static VipsForeignFlags +-vips_foreign_load_jpeg_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_jpeg_get_flags(VipsForeignLoad *load) + { +- return( VIPS_FOREIGN_SEQUENTIAL ); ++ return (VIPS_FOREIGN_SEQUENTIAL); + } + + static VipsForeignFlags +-vips_foreign_load_jpeg_get_flags_filename( const char *filename ) ++vips_foreign_load_jpeg_get_flags_filename(const char *filename) + { +- return( VIPS_FOREIGN_SEQUENTIAL ); ++ return (VIPS_FOREIGN_SEQUENTIAL); + } + + static int +-vips_foreign_load_jpeg_header( VipsForeignLoad *load ) ++vips_foreign_load_jpeg_header(VipsForeignLoad *load) + { + VipsForeignLoadJpeg *jpeg = (VipsForeignLoadJpeg *) load; + +- if( vips__jpeg_read_source( jpeg->source, +- load->out, TRUE, jpeg->shrink, load->fail_on, +- jpeg->autorotate, jpeg->unlimited ) ) +- return( -1 ); ++ if (vips__jpeg_read_source(jpeg->source, ++ load->out, TRUE, jpeg->shrink, load->fail_on, ++ jpeg->autorotate, jpeg->unlimited)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_jpeg_load( VipsForeignLoad *load ) ++vips_foreign_load_jpeg_load(VipsForeignLoad *load) + { + VipsForeignLoadJpeg *jpeg = (VipsForeignLoadJpeg *) load; + +- if( vips__jpeg_read_source( jpeg->source, +- load->real, FALSE, jpeg->shrink, load->fail_on, +- jpeg->autorotate, jpeg->unlimited ) ) +- return( -1 ); ++ if (vips__jpeg_read_source(jpeg->source, ++ load->real, FALSE, jpeg->shrink, load->fail_on, ++ jpeg->autorotate, jpeg->unlimited)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_jpeg_class_init( VipsForeignLoadJpegClass *class ) ++vips_foreign_load_jpeg_class_init(VipsForeignLoadJpegClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -176,44 +174,43 @@ vips_foreign_load_jpeg_class_init( VipsForeignLoadJpegClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "jpegload_base"; +- object_class->description = _( "load jpeg" ); ++ object_class->description = _("load jpeg"); + object_class->build = vips_foreign_load_jpeg_build; + + /* We are fast at is_a(), so high priority. + */ + foreign_class->priority = 50; + +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_jpeg_get_flags_filename; + load_class->get_flags = vips_foreign_load_jpeg_get_flags; + load_class->header = vips_foreign_load_jpeg_header; + load_class->load = vips_foreign_load_jpeg_load; + +- VIPS_ARG_INT( class, "shrink", 20, +- _( "Shrink" ), +- _( "Shrink factor on load" ), ++ VIPS_ARG_INT(class, "shrink", 20, ++ _("Shrink"), ++ _("Shrink factor on load"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadJpeg, shrink ), +- 1, 16, 1 ); ++ G_STRUCT_OFFSET(VipsForeignLoadJpeg, shrink), ++ 1, 16, 1); + +- VIPS_ARG_BOOL( class, "autorotate", 21, +- _( "Autorotate" ), +- _( "Rotate image using exif orientation" ), ++ VIPS_ARG_BOOL(class, "autorotate", 21, ++ _("Autorotate"), ++ _("Rotate image using exif orientation"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadJpeg, autorotate ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignLoadJpeg, autorotate), ++ FALSE); + +- VIPS_ARG_BOOL( class, "unlimited", 22, +- _( "Unlimited" ), +- _( "Remove all denial of service limits" ), ++ VIPS_ARG_BOOL(class, "unlimited", 22, ++ _("Unlimited"), ++ _("Remove all denial of service limits"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadJpeg, unlimited ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsForeignLoadJpeg, unlimited), ++ FALSE); + } + + static void +-vips_foreign_load_jpeg_init( VipsForeignLoadJpeg *jpeg ) ++vips_foreign_load_jpeg_init(VipsForeignLoadJpeg *jpeg) + { + jpeg->shrink = 1; + } +@@ -227,116 +224,113 @@ typedef struct _VipsForeignLoadJpegSource { + + typedef VipsForeignLoadJpegClass VipsForeignLoadJpegSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadJpegSource, vips_foreign_load_jpeg_source, +- vips_foreign_load_jpeg_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadJpegSource, vips_foreign_load_jpeg_source, ++ vips_foreign_load_jpeg_get_type()); + + static int +-vips_foreign_load_jpeg_source_build( VipsObject *object ) ++vips_foreign_load_jpeg_source_build(VipsObject *object) + { + VipsForeignLoadJpeg *jpeg = (VipsForeignLoadJpeg *) object; +- VipsForeignLoadJpegSource *source = ++ VipsForeignLoadJpegSource *source = + (VipsForeignLoadJpegSource *) object; + +- if( source->source ) { ++ if (source->source) { + jpeg->source = source->source; +- g_object_ref( jpeg->source ); ++ g_object_ref(jpeg->source); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_jpeg_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_jpeg_source_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_jpeg_source_is_a_source( VipsSource *source ) ++vips_foreign_load_jpeg_source_is_a_source(VipsSource *source) + { +- return( vips__isjpeg_source( source ) ); ++ return (vips__isjpeg_source(source)); + } + + static void +-vips_foreign_load_jpeg_source_class_init( +- VipsForeignLoadJpegSourceClass *class ) ++vips_foreign_load_jpeg_source_class_init( ++ VipsForeignLoadJpegSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "jpegload_source"; +- object_class->description = _( "load image from jpeg source" ); ++ object_class->description = _("load image from jpeg source"); + object_class->build = vips_foreign_load_jpeg_source_build; + + operation_class->flags |= VIPS_OPERATION_NOCACHE; + + load_class->is_a_source = vips_foreign_load_jpeg_source_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadJpegSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadJpegSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_jpeg_source_init( VipsForeignLoadJpegSource *source ) ++vips_foreign_load_jpeg_source_init(VipsForeignLoadJpegSource *source) + { + } + + typedef struct _VipsForeignLoadJpegFile { + VipsForeignLoadJpeg parent_object; + +- char *filename; ++ char *filename; + + } VipsForeignLoadJpegFile; + + typedef VipsForeignLoadJpegClass VipsForeignLoadJpegFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadJpegFile, vips_foreign_load_jpeg_file, +- vips_foreign_load_jpeg_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadJpegFile, vips_foreign_load_jpeg_file, ++ vips_foreign_load_jpeg_get_type()); + + static int +-vips_foreign_load_jpeg_file_build( VipsObject *object ) ++vips_foreign_load_jpeg_file_build(VipsObject *object) + { + VipsForeignLoadJpeg *jpeg = (VipsForeignLoadJpeg *) object; + VipsForeignLoadJpegFile *file = (VipsForeignLoadJpegFile *) object; + +- if( file->filename && +- !(jpeg->source = +- vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(jpeg->source = ++ vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_jpeg_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_jpeg_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_jpeg_file_is_a( const char *filename ) ++vips_foreign_load_jpeg_file_is_a(const char *filename) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( FALSE ); +- result = vips_foreign_load_jpeg_source_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (FALSE); ++ result = vips_foreign_load_jpeg_source_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static void +-vips_foreign_load_jpeg_file_class_init( VipsForeignLoadJpegFileClass *class ) ++vips_foreign_load_jpeg_file_class_init(VipsForeignLoadJpegFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -345,23 +339,23 @@ vips_foreign_load_jpeg_file_class_init( VipsForeignLoadJpegFileClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "jpegload"; +- object_class->description = _( "load jpeg from file" ); ++ object_class->description = _("load jpeg from file"); + object_class->build = vips_foreign_load_jpeg_file_build; + + foreign_class->suffs = vips__jpeg_suffs; + + load_class->is_a = vips_foreign_load_jpeg_file_is_a; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadJpegFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadJpegFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_jpeg_file_init( VipsForeignLoadJpegFile *file ) ++vips_foreign_load_jpeg_file_init(VipsForeignLoadJpegFile *file) + { + } + +@@ -374,48 +368,47 @@ typedef struct _VipsForeignLoadJpegBuffer { + + typedef VipsForeignLoadJpegClass VipsForeignLoadJpegBufferClass; + +-G_DEFINE_TYPE( VipsForeignLoadJpegBuffer, vips_foreign_load_jpeg_buffer, +- vips_foreign_load_jpeg_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadJpegBuffer, vips_foreign_load_jpeg_buffer, ++ vips_foreign_load_jpeg_get_type()); + + static int +-vips_foreign_load_jpeg_buffer_build( VipsObject *object ) ++vips_foreign_load_jpeg_buffer_build(VipsObject *object) + { + VipsForeignLoadJpeg *jpeg = (VipsForeignLoadJpeg *) object; +- VipsForeignLoadJpegBuffer *buffer = ++ VipsForeignLoadJpegBuffer *buffer = + (VipsForeignLoadJpegBuffer *) object; + +- if( buffer->blob && +- !(jpeg->source = vips_source_new_from_memory( +- VIPS_AREA( buffer->blob )->data, +- VIPS_AREA( buffer->blob )->length )) ) +- return( -1 ); ++ if (buffer->blob && ++ !(jpeg->source = vips_source_new_from_memory( ++ VIPS_AREA(buffer->blob)->data, ++ VIPS_AREA(buffer->blob)->length))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_jpeg_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_jpeg_buffer_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_jpeg_buffer_is_a_buffer( const void *buf, size_t len ) ++vips_foreign_load_jpeg_buffer_is_a_buffer(const void *buf, size_t len) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_memory( buf, len )) ) +- return( FALSE ); +- result = vips_foreign_load_jpeg_source_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_memory(buf, len))) ++ return (FALSE); ++ result = vips_foreign_load_jpeg_source_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static void +-vips_foreign_load_jpeg_buffer_class_init( +- VipsForeignLoadJpegBufferClass *class ) ++vips_foreign_load_jpeg_buffer_class_init( ++ VipsForeignLoadJpegBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -423,21 +416,21 @@ vips_foreign_load_jpeg_buffer_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "jpegload_buffer"; +- object_class->description = _( "load jpeg from buffer" ); ++ object_class->description = _("load jpeg from buffer"); + object_class->build = vips_foreign_load_jpeg_buffer_build; + + load_class->is_a_buffer = vips_foreign_load_jpeg_buffer_is_a_buffer; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadJpegBuffer, blob ), +- VIPS_TYPE_BLOB ); ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadJpegBuffer, blob), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_load_jpeg_buffer_init( VipsForeignLoadJpegBuffer *buffer ) ++vips_foreign_load_jpeg_buffer_init(VipsForeignLoadJpegBuffer *buffer) + { + } + +@@ -453,28 +446,28 @@ vips_foreign_load_jpeg_buffer_init( VipsForeignLoadJpegBuffer *buffer ) + * + * * @shrink: %gint, shrink by this much on load + * * @fail_on: #VipsFailOn, types of read error to fail on +- * * @autorotate: %gboolean, rotate image upright during load ++ * * @autorotate: %gboolean, rotate image upright during load + * +- * Read a JPEG file into a VIPS image. It can read most 8-bit JPEG images, ++ * Read a JPEG file into a VIPS image. It can read most 8-bit JPEG images, + * including CMYK and YCbCr. + * +- * @shrink means shrink by this integer factor during load. Possible values +- * are 1, 2, 4 and 8. Shrinking during read is very much faster than ++ * @shrink means shrink by this integer factor during load. Possible values ++ * are 1, 2, 4 and 8. Shrinking during read is very much faster than + * decompressing the whole image and then shrinking later. + * + * Use @fail_on to set the type of error that will cause load to fail. By + * default, loaders are permissive, that is, #VIPS_FAIL_ON_NONE. + * +- * Setting @autorotate to %TRUE will make the loader interpret the ++ * Setting @autorotate to %TRUE will make the loader interpret the + * orientation tag and automatically rotate the image appropriately during +- * load. ++ * load. + * +- * If @autorotate is %FALSE, the metadata field #VIPS_META_ORIENTATION is set +- * to the value of the orientation tag. Applications may read and interpret ++ * If @autorotate is %FALSE, the metadata field #VIPS_META_ORIENTATION is set ++ * to the value of the orientation tag. Applications may read and interpret + * this field + * as they wish later in processing. See vips_autorot(). Save + * operations will use #VIPS_META_ORIENTATION, if present, to set the +- * orientation of output images. ++ * orientation of output images. + * + * Example: + * +@@ -485,15 +478,15 @@ vips_foreign_load_jpeg_buffer_init( VipsForeignLoadJpegBuffer *buffer ) + * NULL ); + * ]| + * +- * Any embedded ICC profiles are ignored: you always just get the RGB from +- * the file. Instead, the embedded profile will be attached to the image as +- * #VIPS_META_ICC_NAME. You need to use something like +- * vips_icc_import() to get CIE values from the file. ++ * Any embedded ICC profiles are ignored: you always just get the RGB from ++ * the file. Instead, the embedded profile will be attached to the image as ++ * #VIPS_META_ICC_NAME. You need to use something like ++ * vips_icc_import() to get CIE values from the file. + * + * EXIF metadata is attached as #VIPS_META_EXIF_NAME, IPTC as + * #VIPS_META_IPTC_NAME, and XMP as #VIPS_META_XMP_NAME. + * +- * The int metadata item "jpeg-multiscan" is set to the result of ++ * The int metadata item "jpeg-multiscan" is set to the result of + * jpeg_has_multiple_scans(). Interlaced jpeg images need a large amount of + * memory to load, so this field gives callers a chance to handle these + * images differently. +@@ -501,9 +494,9 @@ vips_foreign_load_jpeg_buffer_init( VipsForeignLoadJpegBuffer *buffer ) + * The string-valued field "jpeg-chroma-subsample" gives the chroma subsample + * in standard notation. 4:4:4 means no subsample, 4:2:0 means YCbCr with + * Cb and Cr subsampled horizontally and vertically, 4:4:4:4 means a CMYK +- * image with no subsampling. ++ * image with no subsampling. + * +- * The EXIF thumbnail, if present, is attached to the image as ++ * The EXIF thumbnail, if present, is attached to the image as + * "jpeg-thumbnail-data". See vips_image_get_blob(). + * + * See also: vips_jpegload_buffer(), vips_image_new_from_file(), vips_autorot(). +@@ -511,16 +504,16 @@ vips_foreign_load_jpeg_buffer_init( VipsForeignLoadJpegBuffer *buffer ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_jpegload( const char *filename, VipsImage **out, ... ) ++vips_jpegload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "jpegload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("jpegload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -534,21 +527,21 @@ vips_jpegload( const char *filename, VipsImage **out, ... ) + * + * * @shrink: %gint, shrink by this much on load + * * @fail_on: #VipsFailOn, types of read error to fail on +- * * @autorotate: %gboolean, use exif Orientation tag to rotate the image ++ * * @autorotate: %gboolean, use exif Orientation tag to rotate the image + * during load + * + * Read a JPEG-formatted memory block into a VIPS image. Exactly as +- * vips_jpegload(), but read from a memory buffer. ++ * vips_jpegload(), but read from a memory buffer. + * +- * You must not free the buffer while @out is active. The +- * #VipsObject::postclose signal on @out is a good place to free. ++ * You must not free the buffer while @out is active. The ++ * #VipsObject::postclose signal on @out is a good place to free. + * + * See also: vips_jpegload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_jpegload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++vips_jpegload_buffer(void *buf, size_t len, VipsImage **out, ...) + { + va_list ap; + VipsBlob *blob; +@@ -556,15 +549,15 @@ vips_jpegload_buffer( void *buf, size_t len, VipsImage **out, ... ) + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, buf, len ); ++ blob = vips_blob_new(NULL, buf, len); + +- va_start( ap, out ); +- result = vips_call_split( "jpegload_buffer", ap, blob, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("jpegload_buffer", ap, blob, out); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( result ); ++ return (result); + } + + /** +@@ -577,25 +570,25 @@ vips_jpegload_buffer( void *buf, size_t len, VipsImage **out, ... ) + * + * * @shrink: %gint, shrink by this much on load + * * @fail_on: #VipsFailOn, types of read error to fail on +- * * @autorotate: %gboolean, use exif Orientation tag to rotate the image ++ * * @autorotate: %gboolean, use exif Orientation tag to rotate the image + * during load + * + * Read a JPEG-formatted memory block into a VIPS image. Exactly as +- * vips_jpegload(), but read from a source. ++ * vips_jpegload(), but read from a source. + * + * See also: vips_jpegload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_jpegload_source( VipsSource *source, VipsImage **out, ... ) ++vips_jpegload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "jpegload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("jpegload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/jpegsave.c b/libvips/foreign/jpegsave.c +index df0d7b36f2..6e726e7387 100644 +--- a/libvips/foreign/jpegsave.c ++++ b/libvips/foreign/jpegsave.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -90,7 +90,7 @@ typedef struct _VipsForeignSaveJpeg { + */ + gboolean trellis_quant; + +- /* Apply overshooting to samples with extreme values e.g. 0 & 255 ++ /* Apply overshooting to samples with extreme values e.g. 0 & 255 + * for 8-bit. + */ + gboolean overshoot_deringing; +@@ -111,8 +111,8 @@ typedef struct _VipsForeignSaveJpeg { + + typedef VipsForeignSaveClass VipsForeignSaveJpegClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveJpeg, vips_foreign_save_jpeg, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSaveJpeg, vips_foreign_save_jpeg, ++ VIPS_TYPE_FOREIGN_SAVE); + + #define UC VIPS_FORMAT_UCHAR + +@@ -124,29 +124,26 @@ static VipsBandFormat bandfmt_jpeg[10] = { + }; + + static int +-vips_foreign_save_jpeg_build( VipsObject *object ) ++vips_foreign_save_jpeg_build(VipsObject *object) + { + VipsForeignSaveJpeg *jpeg = (VipsForeignSaveJpeg *) object; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_jpeg_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_jpeg_parent_class)->build(object)) ++ return (-1); + + /* no_subsample is deprecated, but we retain backwards compatibility + * new code should use subsample_mode + */ +- if( vips_object_argument_isset( object, "no_subsample" ) ) +- jpeg->subsample_mode = jpeg->no_subsample ? +- VIPS_FOREIGN_SUBSAMPLE_OFF : +- VIPS_FOREIGN_SUBSAMPLE_AUTO; ++ if (vips_object_argument_isset(object, "no_subsample")) ++ jpeg->subsample_mode = jpeg->no_subsample ? VIPS_FOREIGN_SUBSAMPLE_OFF : VIPS_FOREIGN_SUBSAMPLE_AUTO; + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_jpeg_class_init( VipsForeignSaveJpegClass *class ) ++vips_foreign_save_jpeg_class_init(VipsForeignSaveJpegClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; +@@ -155,7 +152,7 @@ vips_foreign_save_jpeg_class_init( VipsForeignSaveJpegClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "jpegsave_base"; +- object_class->description = _( "save jpeg" ); ++ object_class->description = _("save jpeg"); + object_class->build = vips_foreign_save_jpeg_build; + + foreign_class->suffs = vips__jpeg_suffs; +@@ -165,88 +162,87 @@ vips_foreign_save_jpeg_class_init( VipsForeignSaveJpegClass *class ) + save_class->saveable = VIPS_SAVEABLE_RGB_CMYK; + save_class->format_table = bandfmt_jpeg; + +- VIPS_ARG_INT( class, "Q", 10, +- _( "Q" ), +- _( "Q factor" ), ++ VIPS_ARG_INT(class, "Q", 10, ++ _("Q"), ++ _("Q factor"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJpeg, Q ), +- 1, 100, 75 ); ++ G_STRUCT_OFFSET(VipsForeignSaveJpeg, Q), ++ 1, 100, 75); + +- VIPS_ARG_STRING( class, "profile", 11, +- _( "Profile" ), +- _( "ICC profile to embed" ), ++ VIPS_ARG_STRING(class, "profile", 11, ++ _("Profile"), ++ _("ICC profile to embed"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJpeg, profile ), +- NULL ); ++ G_STRUCT_OFFSET(VipsForeignSaveJpeg, profile), ++ NULL); + +- VIPS_ARG_BOOL( class, "optimize_coding", 12, +- _( "Optimize_coding" ), +- _( "Compute optimal Huffman coding tables" ), ++ VIPS_ARG_BOOL(class, "optimize_coding", 12, ++ _("Optimize_coding"), ++ _("Compute optimal Huffman coding tables"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJpeg, optimize_coding ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveJpeg, optimize_coding), ++ FALSE); + +- VIPS_ARG_BOOL( class, "interlace", 13, +- _( "Interlace" ), +- _( "Generate an interlaced (progressive) jpeg" ), ++ VIPS_ARG_BOOL(class, "interlace", 13, ++ _("Interlace"), ++ _("Generate an interlaced (progressive) jpeg"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJpeg, interlace ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveJpeg, interlace), ++ FALSE); + +- VIPS_ARG_BOOL( class, "no_subsample", 14, +- _( "No subsample" ), +- _( "Disable chroma subsample" ), ++ VIPS_ARG_BOOL(class, "no_subsample", 14, ++ _("No subsample"), ++ _("Disable chroma subsample"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignSaveJpeg, no_subsample ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveJpeg, no_subsample), ++ FALSE); + +- VIPS_ARG_BOOL( class, "trellis_quant", 15, +- _( "Trellis quantisation" ), +- _( "Apply trellis quantisation to each 8x8 block" ), ++ VIPS_ARG_BOOL(class, "trellis_quant", 15, ++ _("Trellis quantisation"), ++ _("Apply trellis quantisation to each 8x8 block"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJpeg, trellis_quant ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveJpeg, trellis_quant), ++ FALSE); + +- VIPS_ARG_BOOL( class, "overshoot_deringing", 16, +- _( "Overshoot de-ringing" ), +- _( "Apply overshooting to samples with extreme values" ), ++ VIPS_ARG_BOOL(class, "overshoot_deringing", 16, ++ _("Overshoot de-ringing"), ++ _("Apply overshooting to samples with extreme values"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJpeg, overshoot_deringing ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveJpeg, overshoot_deringing), ++ FALSE); + +- VIPS_ARG_BOOL( class, "optimize_scans", 17, +- _( "Optimize scans" ), +- _( "Split spectrum of DCT coefficients into separate scans" ), ++ VIPS_ARG_BOOL(class, "optimize_scans", 17, ++ _("Optimize scans"), ++ _("Split spectrum of DCT coefficients into separate scans"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJpeg, optimize_scans ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveJpeg, optimize_scans), ++ FALSE); + +- VIPS_ARG_INT( class, "quant_table", 18, +- _( "Quantization table" ), +- _( "Use predefined quantization table with given index" ), ++ VIPS_ARG_INT(class, "quant_table", 18, ++ _("Quantization table"), ++ _("Use predefined quantization table with given index"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJpeg, quant_table ), +- 0, 8, 0 ); ++ G_STRUCT_OFFSET(VipsForeignSaveJpeg, quant_table), ++ 0, 8, 0); + +- VIPS_ARG_ENUM( class, "subsample_mode", 19, +- _( "Subsample mode" ), +- _( "Select chroma subsample operation mode" ), ++ VIPS_ARG_ENUM(class, "subsample_mode", 19, ++ _("Subsample mode"), ++ _("Select chroma subsample operation mode"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJpeg, subsample_mode ), ++ G_STRUCT_OFFSET(VipsForeignSaveJpeg, subsample_mode), + VIPS_TYPE_FOREIGN_SUBSAMPLE, +- VIPS_FOREIGN_SUBSAMPLE_AUTO ); ++ VIPS_FOREIGN_SUBSAMPLE_AUTO); + +- VIPS_ARG_INT( class, "restart_interval", 20, +- _( "Restart interval" ), +- _( "Add restart markers every specified number of mcu" ), ++ VIPS_ARG_INT(class, "restart_interval", 20, ++ _("Restart interval"), ++ _("Add restart markers every specified number of mcu"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJpeg, restart_interval ), +- 0, INT_MAX, 0 ); +- ++ G_STRUCT_OFFSET(VipsForeignSaveJpeg, restart_interval), ++ 0, INT_MAX, 0); + } + + static void +-vips_foreign_save_jpeg_init( VipsForeignSaveJpeg *jpeg ) ++vips_foreign_save_jpeg_init(VipsForeignSaveJpeg *jpeg) + { + jpeg->Q = 75; + jpeg->subsample_mode = VIPS_FOREIGN_SUBSAMPLE_AUTO; +@@ -261,56 +257,55 @@ typedef struct _VipsForeignSaveJpegTarget { + + typedef VipsForeignSaveJpegClass VipsForeignSaveJpegTargetClass; + +-G_DEFINE_TYPE( VipsForeignSaveJpegTarget, vips_foreign_save_jpeg_target, +- vips_foreign_save_jpeg_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveJpegTarget, vips_foreign_save_jpeg_target, ++ vips_foreign_save_jpeg_get_type()); + + static int +-vips_foreign_save_jpeg_target_build( VipsObject *object ) ++vips_foreign_save_jpeg_target_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveJpeg *jpeg = (VipsForeignSaveJpeg *) object; +- VipsForeignSaveJpegTarget *target = ++ VipsForeignSaveJpegTarget *target = + (VipsForeignSaveJpegTarget *) object; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_jpeg_target_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_jpeg_target_parent_class)->build(object)) ++ return (-1); + +- if( vips__jpeg_write_target( save->ready, target->target, +- jpeg->Q, jpeg->profile, jpeg->optimize_coding, +- jpeg->interlace, save->strip, jpeg->trellis_quant, +- jpeg->overshoot_deringing, jpeg->optimize_scans, +- jpeg->quant_table, jpeg->subsample_mode, +- jpeg->restart_interval ) ) +- return( -1 ); ++ if (vips__jpeg_write_target(save->ready, target->target, ++ jpeg->Q, jpeg->profile, jpeg->optimize_coding, ++ jpeg->interlace, save->strip, jpeg->trellis_quant, ++ jpeg->overshoot_deringing, jpeg->optimize_scans, ++ jpeg->quant_table, jpeg->subsample_mode, ++ jpeg->restart_interval)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_jpeg_target_class_init( +- VipsForeignSaveJpegTargetClass *class ) ++vips_foreign_save_jpeg_target_class_init( ++ VipsForeignSaveJpegTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "jpegsave_target"; +- object_class->description = _( "save image to jpeg target" ); ++ object_class->description = _("save image to jpeg target"); + object_class->build = vips_foreign_save_jpeg_target_build; + +- VIPS_ARG_OBJECT( class, "target", 1, +- _( "Target" ), +- _( "Target to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJpegTarget, target ), +- VIPS_TYPE_TARGET ); ++ VIPS_ARG_OBJECT(class, "target", 1, ++ _("Target"), ++ _("Target to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveJpegTarget, target), ++ VIPS_TYPE_TARGET); + } + + static void +-vips_foreign_save_jpeg_target_init( VipsForeignSaveJpegTarget *target ) ++vips_foreign_save_jpeg_target_init(VipsForeignSaveJpegTarget *target) + { + } + +@@ -319,17 +314,17 @@ typedef struct _VipsForeignSaveJpegFile { + + /* Filename for save. + */ +- char *filename; ++ char *filename; + + } VipsForeignSaveJpegFile; + + typedef VipsForeignSaveJpegClass VipsForeignSaveJpegFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveJpegFile, vips_foreign_save_jpeg_file, +- vips_foreign_save_jpeg_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveJpegFile, vips_foreign_save_jpeg_file, ++ vips_foreign_save_jpeg_get_type()); + + static int +-vips_foreign_save_jpeg_file_build( VipsObject *object ) ++vips_foreign_save_jpeg_file_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveJpeg *jpeg = (VipsForeignSaveJpeg *) object; +@@ -337,49 +332,48 @@ vips_foreign_save_jpeg_file_build( VipsObject *object ) + + VipsTarget *target; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_jpeg_file_parent_class )-> +- build( object ) ) +- return( -1 ); +- +- if( !(target = vips_target_new_to_file( file->filename )) ) +- return( -1 ); +- if( vips__jpeg_write_target( save->ready, target, +- jpeg->Q, jpeg->profile, jpeg->optimize_coding, +- jpeg->interlace, save->strip, jpeg->trellis_quant, +- jpeg->overshoot_deringing, jpeg->optimize_scans, +- jpeg->quant_table, jpeg->subsample_mode, +- jpeg->restart_interval ) ) { +- VIPS_UNREF( target ); +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_jpeg_file_parent_class)->build(object)) ++ return (-1); ++ ++ if (!(target = vips_target_new_to_file(file->filename))) ++ return (-1); ++ if (vips__jpeg_write_target(save->ready, target, ++ jpeg->Q, jpeg->profile, jpeg->optimize_coding, ++ jpeg->interlace, save->strip, jpeg->trellis_quant, ++ jpeg->overshoot_deringing, jpeg->optimize_scans, ++ jpeg->quant_table, jpeg->subsample_mode, ++ jpeg->restart_interval)) { ++ VIPS_UNREF(target); ++ return (-1); + } +- VIPS_UNREF( target ); ++ VIPS_UNREF(target); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_jpeg_file_class_init( VipsForeignSaveJpegFileClass *class ) ++vips_foreign_save_jpeg_file_class_init(VipsForeignSaveJpegFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "jpegsave"; +- object_class->description = _( "save image to jpeg file" ); ++ object_class->description = _("save image to jpeg file"); + object_class->build = vips_foreign_save_jpeg_file_build; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJpegFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveJpegFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_jpeg_file_init( VipsForeignSaveJpegFile *file ) ++vips_foreign_save_jpeg_file_init(VipsForeignSaveJpegFile *file) + { + } + +@@ -394,70 +388,69 @@ typedef struct _VipsForeignSaveJpegBuffer { + + typedef VipsForeignSaveJpegClass VipsForeignSaveJpegBufferClass; + +-G_DEFINE_TYPE( VipsForeignSaveJpegBuffer, vips_foreign_save_jpeg_buffer, +- vips_foreign_save_jpeg_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveJpegBuffer, vips_foreign_save_jpeg_buffer, ++ vips_foreign_save_jpeg_get_type()); + + static int +-vips_foreign_save_jpeg_buffer_build( VipsObject *object ) ++vips_foreign_save_jpeg_buffer_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveJpeg *jpeg = (VipsForeignSaveJpeg *) object; +- VipsForeignSaveJpegBuffer *buffer = ++ VipsForeignSaveJpegBuffer *buffer = + (VipsForeignSaveJpegBuffer *) object; + + VipsTarget *target; + VipsBlob *blob; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_jpeg_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); +- +- if( !(target = vips_target_new_to_memory()) ) +- return( -1 ); +- +- if( vips__jpeg_write_target( save->ready, target, +- jpeg->Q, jpeg->profile, jpeg->optimize_coding, +- jpeg->interlace, save->strip, jpeg->trellis_quant, +- jpeg->overshoot_deringing, jpeg->optimize_scans, +- jpeg->quant_table, jpeg->subsample_mode, +- jpeg->restart_interval ) ) { +- VIPS_UNREF( target ); +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_jpeg_buffer_parent_class)->build(object)) ++ return (-1); ++ ++ if (!(target = vips_target_new_to_memory())) ++ return (-1); ++ ++ if (vips__jpeg_write_target(save->ready, target, ++ jpeg->Q, jpeg->profile, jpeg->optimize_coding, ++ jpeg->interlace, save->strip, jpeg->trellis_quant, ++ jpeg->overshoot_deringing, jpeg->optimize_scans, ++ jpeg->quant_table, jpeg->subsample_mode, ++ jpeg->restart_interval)) { ++ VIPS_UNREF(target); ++ return (-1); + } + +- g_object_get( target, "blob", &blob, NULL ); +- g_object_set( buffer, "buffer", blob, NULL ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ g_object_get(target, "blob", &blob, NULL); ++ g_object_set(buffer, "buffer", blob, NULL); ++ vips_area_unref(VIPS_AREA(blob)); + +- VIPS_UNREF( target ); ++ VIPS_UNREF(target); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_jpeg_buffer_class_init( +- VipsForeignSaveJpegBufferClass *class ) ++vips_foreign_save_jpeg_buffer_class_init( ++ VipsForeignSaveJpegBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "jpegsave_buffer"; +- object_class->description = _( "save image to jpeg buffer" ); ++ object_class->description = _("save image to jpeg buffer"); + object_class->build = vips_foreign_save_jpeg_buffer_build; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to save to" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJpegBuffer, buf ), +- VIPS_TYPE_BLOB ); ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to save to"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveJpegBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_save_jpeg_buffer_init( VipsForeignSaveJpegBuffer *file ) ++vips_foreign_save_jpeg_buffer_init(VipsForeignSaveJpegBuffer *file) + { + } + +@@ -468,11 +461,11 @@ typedef struct _VipsForeignSaveJpegMime { + + typedef VipsForeignSaveJpegClass VipsForeignSaveJpegMimeClass; + +-G_DEFINE_TYPE( VipsForeignSaveJpegMime, vips_foreign_save_jpeg_mime, +- vips_foreign_save_jpeg_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveJpegMime, vips_foreign_save_jpeg_mime, ++ vips_foreign_save_jpeg_get_type()); + + static int +-vips_foreign_save_jpeg_mime_build( VipsObject *object ) ++vips_foreign_save_jpeg_mime_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveJpeg *jpeg = (VipsForeignSaveJpeg *) object; +@@ -482,52 +475,50 @@ vips_foreign_save_jpeg_mime_build( VipsObject *object ) + const unsigned char *obuf; + size_t olen; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_jpeg_mime_parent_class )-> +- build( object ) ) +- return( -1 ); +- +- if( !(target = vips_target_new_to_memory()) ) +- return( -1 ); +- +- if( vips__jpeg_write_target( save->ready, target, +- jpeg->Q, jpeg->profile, jpeg->optimize_coding, +- jpeg->interlace, save->strip, jpeg->trellis_quant, +- jpeg->overshoot_deringing, jpeg->optimize_scans, +- jpeg->quant_table, jpeg->subsample_mode, +- jpeg->restart_interval ) ) { +- VIPS_UNREF( target ); +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_jpeg_mime_parent_class)->build(object)) ++ return (-1); ++ ++ if (!(target = vips_target_new_to_memory())) ++ return (-1); ++ ++ if (vips__jpeg_write_target(save->ready, target, ++ jpeg->Q, jpeg->profile, jpeg->optimize_coding, ++ jpeg->interlace, save->strip, jpeg->trellis_quant, ++ jpeg->overshoot_deringing, jpeg->optimize_scans, ++ jpeg->quant_table, jpeg->subsample_mode, ++ jpeg->restart_interval)) { ++ VIPS_UNREF(target); ++ return (-1); + } + +- g_object_get( target, "blob", &blob, NULL ); ++ g_object_get(target, "blob", &blob, NULL); + +- obuf = vips_blob_get( blob, &olen ); +- printf( "Content-length: %zu\r\n", olen ); +- printf( "Content-type: image/jpeg\r\n" ); +- printf( "\r\n" ); +- (void) fwrite( obuf, sizeof( char ), olen, stdout ); +- fflush( stdout ); ++ obuf = vips_blob_get(blob, &olen); ++ printf("Content-length: %zu\r\n", olen); ++ printf("Content-type: image/jpeg\r\n"); ++ printf("\r\n"); ++ (void) fwrite(obuf, sizeof(char), olen, stdout); ++ fflush(stdout); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- VIPS_UNREF( target ); ++ VIPS_UNREF(target); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_jpeg_mime_class_init( VipsForeignSaveJpegMimeClass *class ) ++vips_foreign_save_jpeg_mime_class_init(VipsForeignSaveJpegMimeClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + + object_class->nickname = "jpegsave_mime"; +- object_class->description = _( "save image to jpeg mime" ); ++ object_class->description = _("save image to jpeg mime"); + object_class->build = vips_foreign_save_jpeg_mime_build; +- + } + + static void +-vips_foreign_save_jpeg_mime_init( VipsForeignSaveJpegMime *mime ) ++vips_foreign_save_jpeg_mime_init(VipsForeignSaveJpegMime *mime) + { + } + +@@ -535,8 +526,8 @@ vips_foreign_save_jpeg_mime_init( VipsForeignSaveJpegMime *mime ) + + /** + * vips_jpegsave: (method) +- * @in: image to save +- * @filename: file to write to ++ * @in: image to save ++ * @filename: file to write to + * @...: %NULL-terminated list of optional named arguments + * + * Optional arguments: +@@ -558,21 +549,21 @@ vips_foreign_save_jpeg_mime_init( VipsForeignSaveJpegMime *mime ) + * Use @Q to set the JPEG compression factor. Default 75. + * + * Use @profile to give the name of a profile to be embedded in the JPEG. +- * This does not affect the pixels which are written, just the way +- * they are tagged. See vips_profile_load() for details on profile naming. ++ * This does not affect the pixels which are written, just the way ++ * they are tagged. See vips_profile_load() for details on profile naming. + * +- * If no profile is specified and the VIPS header ++ * If no profile is specified and the VIPS header + * contains an ICC profile named #VIPS_META_ICC_NAME, the + * profile from the VIPS header will be attached. + * + * If @optimize_coding is set, the Huffman tables are optimized. This is +- * sllightly slower and produces slightly smaller files. ++ * sllightly slower and produces slightly smaller files. + * + * If @interlace is set, the jpeg files will be interlaced (progressive jpeg, + * in jpg parlance). These files may be better for display over a slow network +- * conection, but need much more memory to encode and decode. ++ * conection, but need much more memory to encode and decode. + * +- * If @strip is set, no EXIF data, IPTC data, ICC profile or XMP metadata is ++ * If @strip is set, no EXIF data, IPTC data, ICC profile or XMP metadata is + * written into the output file. + * + * Chroma subsampling is normally automatically disabled for Q >= 90. You can +@@ -601,11 +592,11 @@ vips_foreign_save_jpeg_mime_init( VipsForeignSaveJpegMime *mime ) + * * 3 — Table from ImageMagick by N. Robidoux (current mozjpeg default) + * * 4 — Table tuned for PSNR-HVS-M on Kodak image set + * * 5 — Table from Relevance of Human Vision to JPEG-DCT Compression (1992) +- * * 6 — Table from DCTune Perceptual Optimization of Compressed Dental ++ * * 6 — Table from DCTune Perceptual Optimization of Compressed Dental + * X-Rays (1997) +- * * 7 — Table from A Visual Detection Model for DCT Coefficient ++ * * 7 — Table from A Visual Detection Model for DCT Coefficient + * Quantization (1993) +- * * 8 — Table from An Improved Detection Model for DCT Coefficient ++ * * 8 — Table from An Improved Detection Model for DCT Coefficient + * Quantization (1993) + * + * Quantization table 0 is the default in vips and libjpeg(-turbo), but it +@@ -619,7 +610,7 @@ vips_foreign_save_jpeg_mime_init( VipsForeignSaveJpegMime *mime ) + * Tables 5-7 are based on older research papers, but generally achieve worse + * compression ratios and/or quality than 2 or 4. + * +- * For maximum compression with mozjpeg, a useful set of options is `strip, ++ * For maximum compression with mozjpeg, a useful set of options is `strip, + * optimize-coding, interlace, optimize-scans, trellis-quant, quant_table=3`. + * + * By default, the output stream won't have restart markers. If a non-zero +@@ -628,37 +619,37 @@ vips_foreign_save_jpeg_mime_init( VipsForeignSaveJpegMime *mime ) + * if there are transmission errors, but also allows for some decoders to read + * part of the JPEG without decoding the whole stream. + * +- * The image is automatically converted to RGB, Monochrome or CMYK before +- * saving. ++ * The image is automatically converted to RGB, Monochrome or CMYK before ++ * saving. + * + * EXIF data is constructed from #VIPS_META_EXIF_NAME, then + * modified with any other related tags on the image before being written to + * the file. #VIPS_META_RESOLUTION_UNIT is used to set the EXIF resolution +- * unit. #VIPS_META_ORIENTATION is used to set the EXIF orientation tag. ++ * unit. #VIPS_META_ORIENTATION is used to set the EXIF orientation tag. + * + * IPTC as #VIPS_META_IPTC_NAME and XMP as #VIPS_META_XMP_NAME +- * are coded and attached. ++ * are coded and attached. + * + * See also: vips_jpegsave_buffer(), vips_image_write_to_file(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_jpegsave( VipsImage *in, const char *filename, ... ) ++vips_jpegsave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "jpegsave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("jpegsave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_jpegsave_target: (method) +- * @in: image to save ++ * @in: image to save + * @target: save image to this target + * @...: %NULL-terminated list of optional named arguments + * +@@ -683,21 +674,21 @@ vips_jpegsave( VipsImage *in, const char *filename, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_jpegsave_target( VipsImage *in, VipsTarget *target, ... ) ++vips_jpegsave_target(VipsImage *in, VipsTarget *target, ...) + { + va_list ap; + int result; + +- va_start( ap, target ); +- result = vips_call_split( "jpegsave_target", ap, in, target ); +- va_end( ap ); ++ va_start(ap, target); ++ result = vips_call_split("jpegsave_target", ap, in, target); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_jpegsave_buffer: (method) +- * @in: image to save ++ * @in: image to save + * @buf: (array length=len) (element-type guint8): return output buffer here + * @len: (type gsize): return output length here + * @...: %NULL-terminated list of optional named arguments +@@ -716,7 +707,7 @@ vips_jpegsave_target( VipsImage *in, VipsTarget *target, ... ) + * * @quant_table: %gint, quantization table index + * * @restart_interval: %gint, restart interval in mcu + * +- * As vips_jpegsave(), but save to a memory buffer. ++ * As vips_jpegsave(), but save to a memory buffer. + * + * The address of the buffer is returned in @obuf, the length of the buffer in + * @olen. You are responsible for freeing the buffer with g_free() when you +@@ -727,36 +718,36 @@ vips_jpegsave_target( VipsImage *in, VipsTarget *target, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_jpegsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++vips_jpegsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + { + va_list ap; + VipsArea *area; + int result; + +- area = NULL; ++ area = NULL; + +- va_start( ap, len ); +- result = vips_call_split( "jpegsave_buffer", ap, in, &area ); +- va_end( ap ); ++ va_start(ap, len); ++ result = vips_call_split("jpegsave_buffer", ap, in, &area); ++ va_end(ap); + +- if( !result && +- area ) { +- if( buf ) { ++ if (!result && ++ area) { ++ if (buf) { + *buf = area->data; + area->free_fn = NULL; + } +- if( len ) ++ if (len) + *len = area->length; + +- vips_area_unref( area ); ++ vips_area_unref(area); + } + +- return( result ); ++ return (result); + } + + /** + * vips_jpegsave_mime: (method) +- * @in: image to save ++ * @in: image to save + * @...: %NULL-terminated list of optional named arguments + * + * Optional arguments: +@@ -780,14 +771,14 @@ vips_jpegsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_jpegsave_mime( VipsImage *in, ... ) ++vips_jpegsave_mime(VipsImage *in, ...) + { + va_list ap; + int result; + +- va_start( ap, in ); +- result = vips_call_split( "jpegsave_mime", ap, in ); +- va_end( ap ); ++ va_start(ap, in); ++ result = vips_call_split("jpegsave_mime", ap, in); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/jxlload.c b/libvips/foreign/jxlload.c +index 72b0653734..fd9b2280f4 100644 +--- a/libvips/foreign/jxlload.c ++++ b/libvips/foreign/jxlload.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -66,7 +66,7 @@ + * + * - add "shrink" option to read out 8x shrunk image? + * +- * - fix scRGB gamma ++ * - fix scRGB gamma + */ + + #define INPUT_BUFFER_SIZE (4096) +@@ -116,296 +116,294 @@ typedef struct _VipsForeignLoadJxl { + + typedef VipsForeignLoadClass VipsForeignLoadJxlClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadJxl, vips_foreign_load_jxl, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadJxl, vips_foreign_load_jxl, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_jxl_dispose( GObject *gobject ) ++vips_foreign_load_jxl_dispose(GObject *gobject) + { + VipsForeignLoadJxl *jxl = (VipsForeignLoadJxl *) gobject; + + #ifdef DEBUG +- printf( "vips_foreign_load_jxl_dispose:\n" ); ++ printf("vips_foreign_load_jxl_dispose:\n"); + #endif /*DEBUG*/ + +- VIPS_FREEF( JxlThreadParallelRunnerDestroy, jxl->runner ); +- VIPS_FREEF( JxlDecoderDestroy, jxl->decoder ); +- VIPS_FREE( jxl->icc_data ); +- VIPS_UNREF( jxl->source ); ++ VIPS_FREEF(JxlThreadParallelRunnerDestroy, jxl->runner); ++ VIPS_FREEF(JxlDecoderDestroy, jxl->decoder); ++ VIPS_FREE(jxl->icc_data); ++ VIPS_UNREF(jxl->source); + +- G_OBJECT_CLASS( vips_foreign_load_jxl_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_jxl_parent_class)->dispose(gobject); + } + + static void +-vips_foreign_load_jxl_error( VipsForeignLoadJxl *jxl, const char *details ) ++vips_foreign_load_jxl_error(VipsForeignLoadJxl *jxl, const char *details) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( jxl ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(jxl); + + /* TODO ... jxl has no way to get error messages at the moment. + */ +- vips_error( class->nickname, "error %s", details ); ++ vips_error(class->nickname, "error %s", details); + } + + static int +-vips_foreign_load_jxl_build( VipsObject *object ) ++vips_foreign_load_jxl_build(VipsObject *object) + { + VipsForeignLoadJxl *jxl = (VipsForeignLoadJxl *) object; + + #ifdef DEBUG +- printf( "vips_foreign_load_jxl_build:\n" ); ++ printf("vips_foreign_load_jxl_build:\n"); + #endif /*DEBUG*/ + +- jxl->runner = JxlThreadParallelRunnerCreate( NULL, +- vips_concurrency_get() ); +- jxl->decoder = JxlDecoderCreate( NULL ); ++ jxl->runner = JxlThreadParallelRunnerCreate(NULL, ++ vips_concurrency_get()); ++ jxl->decoder = JxlDecoderCreate(NULL); + +- if( JxlDecoderSetParallelRunner( jxl->decoder, +- JxlThreadParallelRunner, jxl->runner ) ) { +- vips_foreign_load_jxl_error( jxl, +- "JxlDecoderSetParallelRunner" ); +- return( -1 ); ++ if (JxlDecoderSetParallelRunner(jxl->decoder, ++ JxlThreadParallelRunner, jxl->runner)) { ++ vips_foreign_load_jxl_error(jxl, ++ "JxlDecoderSetParallelRunner"); ++ return (-1); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_jxl_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_jxl_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_jxl_is_a_source( VipsSource *source ) ++vips_foreign_load_jxl_is_a_source(VipsSource *source) + { + const unsigned char *p; + JxlSignature sig; + +- return( (p = vips_source_sniff( source, 12 )) && +- (sig = JxlSignatureCheck( p, 12 )) != JXL_SIG_INVALID && +- sig != JXL_SIG_NOT_ENOUGH_BYTES ); ++ return ((p = vips_source_sniff(source, 12)) && ++ (sig = JxlSignatureCheck(p, 12)) != JXL_SIG_INVALID && ++ sig != JXL_SIG_NOT_ENOUGH_BYTES); + } + + static VipsForeignFlags +-vips_foreign_load_jxl_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_jxl_get_flags(VipsForeignLoad *load) + { +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static int +-vips_foreign_load_jxl_fill_input( VipsForeignLoadJxl *jxl, +- size_t bytes_remaining ) ++vips_foreign_load_jxl_fill_input(VipsForeignLoadJxl *jxl, ++ size_t bytes_remaining) + { + gint64 bytes_read; + + #ifdef DEBUG_VERBOSE +- printf( "vips_foreign_load_jxl_fill_input: %zd bytes requested\n", +- INPUT_BUFFER_SIZE - bytes_remaining ); ++ printf("vips_foreign_load_jxl_fill_input: %zd bytes requested\n", ++ INPUT_BUFFER_SIZE - bytes_remaining); + #endif /*DEBUG_VERBOSE*/ + +- memmove( jxl->input_buffer, ++ memmove(jxl->input_buffer, + jxl->input_buffer + jxl->bytes_in_buffer - bytes_remaining, +- bytes_remaining ); +- bytes_read = vips_source_read( jxl->source, ++ bytes_remaining); ++ bytes_read = vips_source_read(jxl->source, + jxl->input_buffer + bytes_remaining, +- INPUT_BUFFER_SIZE - bytes_remaining ); ++ INPUT_BUFFER_SIZE - bytes_remaining); + /* Read error, or unexpected end of input. + */ +- if( bytes_read <= 0 ) +- return( -1 ); ++ if (bytes_read <= 0) ++ return (-1); + jxl->bytes_in_buffer = bytes_read + bytes_remaining; + + #ifdef DEBUG_VERBOSE +- printf( "vips_foreign_load_jxl_fill_input: %zd bytes read\n", +- bytes_read ); ++ printf("vips_foreign_load_jxl_fill_input: %zd bytes read\n", ++ bytes_read); + #endif /*DEBUG_VERBOSE*/ + +- return( 0 ); ++ return (0); + } + + #ifdef DEBUG + static void +-vips_foreign_load_jxl_print_status( JxlDecoderStatus status ) ++vips_foreign_load_jxl_print_status(JxlDecoderStatus status) + { +- switch( status ) { ++ switch (status) { + case JXL_DEC_SUCCESS: +- printf( "JXL_DEC_SUCCESS\n" ); ++ printf("JXL_DEC_SUCCESS\n"); + break; + + case JXL_DEC_ERROR: +- printf( "JXL_DEC_ERROR\n" ); ++ printf("JXL_DEC_ERROR\n"); + break; + + case JXL_DEC_NEED_MORE_INPUT: +- printf( "JXL_DEC_NEED_MORE_INPUT\n" ); ++ printf("JXL_DEC_NEED_MORE_INPUT\n"); + break; + + case JXL_DEC_NEED_PREVIEW_OUT_BUFFER: +- printf( "JXL_DEC_NEED_PREVIEW_OUT_BUFFER\n" ); ++ printf("JXL_DEC_NEED_PREVIEW_OUT_BUFFER\n"); + break; + + case JXL_DEC_NEED_DC_OUT_BUFFER: +- printf( "JXL_DEC_NEED_DC_OUT_BUFFER\n" ); ++ printf("JXL_DEC_NEED_DC_OUT_BUFFER\n"); + break; + + case JXL_DEC_NEED_IMAGE_OUT_BUFFER: +- printf( "JXL_DEC_NEED_IMAGE_OUT_BUFFER\n" ); ++ printf("JXL_DEC_NEED_IMAGE_OUT_BUFFER\n"); + break; + + case JXL_DEC_JPEG_NEED_MORE_OUTPUT: +- printf( "JXL_DEC_JPEG_NEED_MORE_OUTPUT\n" ); ++ printf("JXL_DEC_JPEG_NEED_MORE_OUTPUT\n"); + break; + + case JXL_DEC_BASIC_INFO: +- printf( "JXL_DEC_BASIC_INFO\n" ); ++ printf("JXL_DEC_BASIC_INFO\n"); + break; + + case JXL_DEC_EXTENSIONS: +- printf( "JXL_DEC_EXTENSIONS\n" ); ++ printf("JXL_DEC_EXTENSIONS\n"); + break; + + case JXL_DEC_COLOR_ENCODING: +- printf( "JXL_DEC_COLOR_ENCODING\n" ); ++ printf("JXL_DEC_COLOR_ENCODING\n"); + break; + + case JXL_DEC_PREVIEW_IMAGE: +- printf( "JXL_DEC_PREVIEW_IMAGE\n" ); ++ printf("JXL_DEC_PREVIEW_IMAGE\n"); + break; + + case JXL_DEC_FRAME: +- printf( "JXL_DEC_FRAME\n" ); ++ printf("JXL_DEC_FRAME\n"); + break; + + case JXL_DEC_DC_IMAGE: +- printf( "JXL_DEC_DC_IMAGE\n" ); ++ printf("JXL_DEC_DC_IMAGE\n"); + break; + + case JXL_DEC_FULL_IMAGE: +- printf( "JXL_DEC_FULL_IMAGE\n" ); ++ printf("JXL_DEC_FULL_IMAGE\n"); + break; + + case JXL_DEC_JPEG_RECONSTRUCTION: +- printf( "JXL_DEC_JPEG_RECONSTRUCTION\n" ); ++ printf("JXL_DEC_JPEG_RECONSTRUCTION\n"); + break; + + default: +- printf( "JXL_DEC_\n" ); ++ printf("JXL_DEC_\n"); + break; + } + } + + static void +-vips_foreign_load_jxl_print_info( JxlBasicInfo *info ) ++vips_foreign_load_jxl_print_info(JxlBasicInfo *info) + { +- printf( "JxlBasicInfo:\n" ); +- printf( " have_container = %d\n", info->have_container ); +- printf( " xsize = %d\n", info->xsize ); +- printf( " ysize = %d\n", info->ysize ); +- printf( " bits_per_sample = %d\n", info->bits_per_sample ); +- printf( " exponent_bits_per_sample = %d\n", +- info->exponent_bits_per_sample ); +- printf( " intensity_target = %g\n", info->intensity_target ); +- printf( " min_nits = %g\n", info->min_nits ); +- printf( " relative_to_max_display = %d\n", +- info->relative_to_max_display ); +- printf( " linear_below = %g\n", info->linear_below ); +- printf( " uses_original_profile = %d\n", +- info->uses_original_profile ); +- printf( " have_preview = %d\n", info->have_preview ); +- printf( " have_animation = %d\n", info->have_animation ); +- printf( " orientation = %d\n", info->orientation ); +- printf( " num_color_channels = %d\n", info->num_color_channels ); +- printf( " num_extra_channels = %d\n", info->num_extra_channels ); +- printf( " alpha_bits = %d\n", info->alpha_bits ); +- printf( " alpha_exponent_bits = %d\n", info->alpha_exponent_bits ); +- printf( " alpha_premultiplied = %d\n", info->alpha_premultiplied ); +- printf( " preview.xsize = %d\n", info->preview.xsize ); +- printf( " preview.ysize = %d\n", info->preview.ysize ); +- printf( " animation.tps_numerator = %d\n", +- info->animation.tps_numerator ); +- printf( " animation.tps_denominator = %d\n", +- info->animation.tps_denominator ); +- printf( " animation.num_loops = %d\n", info->animation.num_loops ); +- printf( " animation.have_timecodes = %d\n", +- info->animation.have_timecodes ); ++ printf("JxlBasicInfo:\n"); ++ printf(" have_container = %d\n", info->have_container); ++ printf(" xsize = %d\n", info->xsize); ++ printf(" ysize = %d\n", info->ysize); ++ printf(" bits_per_sample = %d\n", info->bits_per_sample); ++ printf(" exponent_bits_per_sample = %d\n", ++ info->exponent_bits_per_sample); ++ printf(" intensity_target = %g\n", info->intensity_target); ++ printf(" min_nits = %g\n", info->min_nits); ++ printf(" relative_to_max_display = %d\n", ++ info->relative_to_max_display); ++ printf(" linear_below = %g\n", info->linear_below); ++ printf(" uses_original_profile = %d\n", ++ info->uses_original_profile); ++ printf(" have_preview = %d\n", info->have_preview); ++ printf(" have_animation = %d\n", info->have_animation); ++ printf(" orientation = %d\n", info->orientation); ++ printf(" num_color_channels = %d\n", info->num_color_channels); ++ printf(" num_extra_channels = %d\n", info->num_extra_channels); ++ printf(" alpha_bits = %d\n", info->alpha_bits); ++ printf(" alpha_exponent_bits = %d\n", info->alpha_exponent_bits); ++ printf(" alpha_premultiplied = %d\n", info->alpha_premultiplied); ++ printf(" preview.xsize = %d\n", info->preview.xsize); ++ printf(" preview.ysize = %d\n", info->preview.ysize); ++ printf(" animation.tps_numerator = %d\n", ++ info->animation.tps_numerator); ++ printf(" animation.tps_denominator = %d\n", ++ info->animation.tps_denominator); ++ printf(" animation.num_loops = %d\n", info->animation.num_loops); ++ printf(" animation.have_timecodes = %d\n", ++ info->animation.have_timecodes); + } + + static void +-vips_foreign_load_jxl_print_format( JxlPixelFormat *format ) ++vips_foreign_load_jxl_print_format(JxlPixelFormat *format) + { +- printf( "JxlPixelFormat:\n" ); +- printf( " data_type = " ); +- switch( format->data_type ) { +- case JXL_TYPE_UINT8: +- printf( "JXL_TYPE_UINT8" ); ++ printf("JxlPixelFormat:\n"); ++ printf(" data_type = "); ++ switch (format->data_type) { ++ case JXL_TYPE_UINT8: ++ printf("JXL_TYPE_UINT8"); + break; + +- case JXL_TYPE_UINT16: +- printf( "JXL_TYPE_UINT16" ); ++ case JXL_TYPE_UINT16: ++ printf("JXL_TYPE_UINT16"); + break; + +- case JXL_TYPE_FLOAT: +- printf( "JXL_TYPE_FLOAT" ); ++ case JXL_TYPE_FLOAT: ++ printf("JXL_TYPE_FLOAT"); + break; + + default: +- printf( "(unknown)" ); ++ printf("(unknown)"); + break; + } +- printf( "\n" ); +- printf( " num_channels = %d\n", format->num_channels ); +- printf( " endianness = %d\n", format->endianness ); +- printf( " align = %zd\n", format->align ); ++ printf("\n"); ++ printf(" num_channels = %d\n", format->num_channels); ++ printf(" endianness = %d\n", format->endianness); ++ printf(" align = %zd\n", format->align); + } + #endif /*DEBUG*/ + +-static JxlDecoderStatus +-vips_foreign_load_jxl_process( VipsForeignLoadJxl *jxl ) ++static JxlDecoderStatus ++vips_foreign_load_jxl_process(VipsForeignLoadJxl *jxl) + { + JxlDecoderStatus status; + + #ifdef DEBUG +- printf( "vips_foreign_load_jxl_process: starting ...\n" ); ++ printf("vips_foreign_load_jxl_process: starting ...\n"); + #endif /*DEBUG*/ + +- while( (status = JxlDecoderProcessInput( jxl->decoder )) == +- JXL_DEC_NEED_MORE_INPUT ) { ++ while ((status = JxlDecoderProcessInput(jxl->decoder)) == ++ JXL_DEC_NEED_MORE_INPUT) { + size_t bytes_remaining; + + #ifdef DEBUG +- printf( "vips_foreign_load_jxl_process: reading ...\n" ); ++ printf("vips_foreign_load_jxl_process: reading ...\n"); + #endif /*DEBUG*/ + +- bytes_remaining = JxlDecoderReleaseInput( jxl->decoder ); +- if( vips_foreign_load_jxl_fill_input( jxl, bytes_remaining ) ) +- return( JXL_DEC_ERROR ); +- JxlDecoderSetInput( jxl->decoder, +- jxl->input_buffer, jxl->bytes_in_buffer ); ++ bytes_remaining = JxlDecoderReleaseInput(jxl->decoder); ++ if (vips_foreign_load_jxl_fill_input(jxl, bytes_remaining)) ++ return (JXL_DEC_ERROR); ++ JxlDecoderSetInput(jxl->decoder, ++ jxl->input_buffer, jxl->bytes_in_buffer); + } + + #ifdef DEBUG +- printf( "vips_foreign_load_jxl_process: seen " ); +- vips_foreign_load_jxl_print_status( status ); ++ printf("vips_foreign_load_jxl_process: seen "); ++ vips_foreign_load_jxl_print_status(status); + #endif /*DEBUG*/ + +- return( status ); ++ return (status); + } + + static int +-vips_foreign_load_jxl_set_header( VipsForeignLoadJxl *jxl, VipsImage *out ) ++vips_foreign_load_jxl_set_header(VipsForeignLoadJxl *jxl, VipsImage *out) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( jxl ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(jxl); + + VipsBandFormat format; + VipsInterpretation interpretation; + +- if( jxl->info.xsize >= VIPS_MAX_COORD || +- jxl->info.ysize >= VIPS_MAX_COORD ) { +- vips_error( class->nickname, +- "%s", _( "image size out of bounds" ) ); +- return( -1 ); ++ if (jxl->info.xsize >= VIPS_MAX_COORD || ++ jxl->info.ysize >= VIPS_MAX_COORD) { ++ vips_error(class->nickname, ++ "%s", _("image size out of bounds")); ++ return (-1); + } + +- switch( jxl->format.data_type ) { ++ switch (jxl->format.data_type) { + case JXL_TYPE_UINT8: + format = VIPS_FORMAT_UCHAR; + break; +@@ -422,9 +420,9 @@ vips_foreign_load_jxl_set_header( VipsForeignLoadJxl *jxl, VipsImage *out ) + g_assert_not_reached(); + } + +- switch( jxl->info.num_color_channels ) { ++ switch (jxl->info.num_color_channels) { + case 1: +- switch( format ) { ++ switch (format) { + case VIPS_FORMAT_UCHAR: + interpretation = VIPS_INTERPRETATION_B_W; + break; +@@ -440,7 +438,7 @@ vips_foreign_load_jxl_set_header( VipsForeignLoadJxl *jxl, VipsImage *out ) + break; + + case 3: +- switch( format ) { ++ switch (format) { + case VIPS_FORMAT_UCHAR: + interpretation = VIPS_INTERPRETATION_sRGB; + break; +@@ -464,89 +462,89 @@ vips_foreign_load_jxl_set_header( VipsForeignLoadJxl *jxl, VipsImage *out ) + break; + } + +- vips_image_init_fields( out, +- jxl->info.xsize, jxl->info.ysize, jxl->format.num_channels, +- format, VIPS_CODING_NONE, interpretation, 1.0, 1.0 ); ++ vips_image_init_fields(out, ++ jxl->info.xsize, jxl->info.ysize, jxl->format.num_channels, ++ format, VIPS_CODING_NONE, interpretation, 1.0, 1.0); + +- /* Even though this is a full image reader, we hint thinstrip since +- * we are quite happy serving that if anything downstream ++ /* Even though this is a full image reader, we hint thinstrip since ++ * we are quite happy serving that if anything downstream + * would like it. + */ +- if( vips_image_pipelinev( out, VIPS_DEMAND_STYLE_THINSTRIP, NULL ) ) +- return( -1 ); +- +- if( jxl->icc_data && +- jxl->icc_size > 0 ) { +- vips_image_set_blob( out, VIPS_META_ICC_NAME, +- (VipsCallbackFn) vips_area_free_cb, +- jxl->icc_data, jxl->icc_size ); ++ if (vips_image_pipelinev(out, VIPS_DEMAND_STYLE_THINSTRIP, NULL)) ++ return (-1); ++ ++ if (jxl->icc_data && ++ jxl->icc_size > 0) { ++ vips_image_set_blob(out, VIPS_META_ICC_NAME, ++ (VipsCallbackFn) vips_area_free_cb, ++ jxl->icc_data, jxl->icc_size); + jxl->icc_data = NULL; + jxl->icc_size = 0; + } + +- vips_image_set_int( out, +- VIPS_META_ORIENTATION, jxl->info.orientation ); ++ vips_image_set_int(out, ++ VIPS_META_ORIENTATION, jxl->info.orientation); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_jxl_header( VipsForeignLoad *load ) ++vips_foreign_load_jxl_header(VipsForeignLoad *load) + { + VipsForeignLoadJxl *jxl = (VipsForeignLoadJxl *) load; + + JxlDecoderStatus status; + + #ifdef DEBUG +- printf( "vips_foreign_load_jxl_header:\n" ); ++ printf("vips_foreign_load_jxl_header:\n"); + #endif /*DEBUG*/ + +- if( vips_source_rewind( jxl->source ) ) +- return( -1 ); ++ if (vips_source_rewind(jxl->source)) ++ return (-1); + +- JxlDecoderRewind( jxl->decoder ); +- if( JxlDecoderSubscribeEvents( jxl->decoder, +- JXL_DEC_COLOR_ENCODING | +- JXL_DEC_BASIC_INFO ) ) { +- vips_foreign_load_jxl_error( jxl, +- "JxlDecoderSubscribeEvents" ); +- return( -1 ); ++ JxlDecoderRewind(jxl->decoder); ++ if (JxlDecoderSubscribeEvents(jxl->decoder, ++ JXL_DEC_COLOR_ENCODING | ++ JXL_DEC_BASIC_INFO)) { ++ vips_foreign_load_jxl_error(jxl, ++ "JxlDecoderSubscribeEvents"); ++ return (-1); + } + +- if( vips_foreign_load_jxl_fill_input( jxl, 0 ) ) +- return( -1 ); +- JxlDecoderSetInput( jxl->decoder, +- jxl->input_buffer, jxl->bytes_in_buffer ); ++ if (vips_foreign_load_jxl_fill_input(jxl, 0)) ++ return (-1); ++ JxlDecoderSetInput(jxl->decoder, ++ jxl->input_buffer, jxl->bytes_in_buffer); + + /* Read to the end of the header. + */ + do { +- switch( (status = vips_foreign_load_jxl_process( jxl )) ) { +- case JXL_DEC_ERROR: +- vips_foreign_load_jxl_error( jxl, +- "JxlDecoderProcessInput" ); +- return( -1 ); +- +- case JXL_DEC_BASIC_INFO: +- if( JxlDecoderGetBasicInfo( jxl->decoder, +- &jxl->info ) ) { +- vips_foreign_load_jxl_error( jxl, +- "JxlDecoderGetBasicInfo" ); +- return( -1 ); ++ switch ((status = vips_foreign_load_jxl_process(jxl))) { ++ case JXL_DEC_ERROR: ++ vips_foreign_load_jxl_error(jxl, ++ "JxlDecoderProcessInput"); ++ return (-1); ++ ++ case JXL_DEC_BASIC_INFO: ++ if (JxlDecoderGetBasicInfo(jxl->decoder, ++ &jxl->info)) { ++ vips_foreign_load_jxl_error(jxl, ++ "JxlDecoderGetBasicInfo"); ++ return (-1); + } + #ifdef DEBUG +- vips_foreign_load_jxl_print_info( &jxl->info ); ++ vips_foreign_load_jxl_print_info(&jxl->info); + #endif /*DEBUG*/ + + /* Pick a pixel format to decode to. + */ +- jxl->format.num_channels = +- jxl->info.num_color_channels + ++ jxl->format.num_channels = ++ jxl->info.num_color_channels + + jxl->info.num_extra_channels; +- if( jxl->info.exponent_bits_per_sample > 0 || +- jxl->info.alpha_exponent_bits > 0 ) ++ if (jxl->info.exponent_bits_per_sample > 0 || ++ jxl->info.alpha_exponent_bits > 0) + jxl->format.data_type = JXL_TYPE_FLOAT; +- else if( jxl->info.bits_per_sample > 8 ) ++ else if (jxl->info.bits_per_sample > 8) + jxl->format.data_type = JXL_TYPE_UINT16; + else + jxl->format.data_type = JXL_TYPE_UINT8; +@@ -554,127 +552,128 @@ vips_foreign_load_jxl_header( VipsForeignLoad *load ) + jxl->format.align = 0; + + #ifdef DEBUG +- vips_foreign_load_jxl_print_format( &jxl->format ); ++ vips_foreign_load_jxl_print_format(&jxl->format); + #endif /*DEBUG*/ + + break; + + case JXL_DEC_COLOR_ENCODING: +- if( JxlDecoderGetICCProfileSize( jxl->decoder, +- &jxl->format, +- JXL_COLOR_PROFILE_TARGET_DATA, +- &jxl->icc_size ) ) { +- vips_foreign_load_jxl_error( jxl, +- "JxlDecoderGetICCProfileSize" ); +- return( -1 ); ++ if (JxlDecoderGetICCProfileSize(jxl->decoder, ++ &jxl->format, ++ JXL_COLOR_PROFILE_TARGET_DATA, ++ &jxl->icc_size)) { ++ vips_foreign_load_jxl_error(jxl, ++ "JxlDecoderGetICCProfileSize"); ++ return (-1); + } + + #ifdef DEBUG +- printf( "vips_foreign_load_jxl_header: " +- "%zd byte profile\n", jxl->icc_size ); ++ printf("vips_foreign_load_jxl_header: " ++ "%zd byte profile\n", ++ jxl->icc_size); + #endif /*DEBUG*/ +- if( !(jxl->icc_data = vips_malloc( NULL, +- jxl->icc_size )) ) +- return( -1 ); +- +- if( JxlDecoderGetColorAsICCProfile( jxl->decoder, +- &jxl->format, +- JXL_COLOR_PROFILE_TARGET_DATA, +- jxl->icc_data, jxl->icc_size ) ) { +- vips_foreign_load_jxl_error( jxl, +- "JxlDecoderGetColorAsICCProfile" ); +- return( -1 ); ++ if (!(jxl->icc_data = vips_malloc(NULL, ++ jxl->icc_size))) ++ return (-1); ++ ++ if (JxlDecoderGetColorAsICCProfile(jxl->decoder, ++ &jxl->format, ++ JXL_COLOR_PROFILE_TARGET_DATA, ++ jxl->icc_data, jxl->icc_size)) { ++ vips_foreign_load_jxl_error(jxl, ++ "JxlDecoderGetColorAsICCProfile"); ++ return (-1); + } + break; + + default: + break; + } +- /* JXL_DEC_COLOR_ENCODING is always the last status signal before +- * pixel decoding starts. +- */ +- } while( status != JXL_DEC_COLOR_ENCODING ); ++ /* JXL_DEC_COLOR_ENCODING is always the last status signal before ++ * pixel decoding starts. ++ */ ++ } while (status != JXL_DEC_COLOR_ENCODING); + +- if( vips_foreign_load_jxl_set_header( jxl, load->out ) ) +- return( -1 ); ++ if (vips_foreign_load_jxl_set_header(jxl, load->out)) ++ return (-1); + +- VIPS_SETSTR( load->out->filename, +- vips_connection_filename( VIPS_CONNECTION( jxl->source ) ) ); ++ VIPS_SETSTR(load->out->filename, ++ vips_connection_filename(VIPS_CONNECTION(jxl->source))); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_jxl_load( VipsForeignLoad *load ) ++vips_foreign_load_jxl_load(VipsForeignLoad *load) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( load ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(load); + VipsForeignLoadJxl *jxl = (VipsForeignLoadJxl *) load; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( load ), 3 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(load), 3); + + size_t buffer_size; + JxlDecoderStatus status; + + #ifdef DEBUG +- printf( "vips_foreign_load_jxl_load:\n" ); ++ printf("vips_foreign_load_jxl_load:\n"); + #endif /*DEBUG*/ + + t[0] = vips_image_new(); +- if( vips_foreign_load_jxl_set_header( jxl, t[0] ) ) +- return( -1 ); ++ if (vips_foreign_load_jxl_set_header(jxl, t[0])) ++ return (-1); + + /* We have to rewind ... we can't be certain the header + * decoder left the input in the correct place. + */ +- if( vips_source_rewind( jxl->source ) ) +- return( -1 ); +- +- JxlDecoderRewind( jxl->decoder ); +- if( JxlDecoderSubscribeEvents( jxl->decoder, +- JXL_DEC_FULL_IMAGE ) ) { +- vips_foreign_load_jxl_error( jxl, +- "JxlDecoderSubscribeEvents" ); +- return( -1 ); ++ if (vips_source_rewind(jxl->source)) ++ return (-1); ++ ++ JxlDecoderRewind(jxl->decoder); ++ if (JxlDecoderSubscribeEvents(jxl->decoder, ++ JXL_DEC_FULL_IMAGE)) { ++ vips_foreign_load_jxl_error(jxl, ++ "JxlDecoderSubscribeEvents"); ++ return (-1); + } + +- if( vips_foreign_load_jxl_fill_input( jxl, 0 ) ) +- return( -1 ); +- JxlDecoderSetInput( jxl->decoder, +- jxl->input_buffer, jxl->bytes_in_buffer ); ++ if (vips_foreign_load_jxl_fill_input(jxl, 0)) ++ return (-1); ++ JxlDecoderSetInput(jxl->decoder, ++ jxl->input_buffer, jxl->bytes_in_buffer); + + /* Read to the end of the image. + */ + do { +- switch( (status = vips_foreign_load_jxl_process( jxl )) ) { +- case JXL_DEC_ERROR: +- vips_foreign_load_jxl_error( jxl, +- "JxlDecoderProcessInput" ); +- return( -1 ); +- +- case JXL_DEC_NEED_IMAGE_OUT_BUFFER: +- if( vips_image_write_prepare( t[0] ) ) +- return( -1 ); +- +- if( JxlDecoderImageOutBufferSize( jxl->decoder, +- &jxl->format, +- &buffer_size ) ) { +- vips_foreign_load_jxl_error( jxl, +- "JxlDecoderImageOutBufferSize" ); +- return( -1 ); ++ switch ((status = vips_foreign_load_jxl_process(jxl))) { ++ case JXL_DEC_ERROR: ++ vips_foreign_load_jxl_error(jxl, ++ "JxlDecoderProcessInput"); ++ return (-1); ++ ++ case JXL_DEC_NEED_IMAGE_OUT_BUFFER: ++ if (vips_image_write_prepare(t[0])) ++ return (-1); ++ ++ if (JxlDecoderImageOutBufferSize(jxl->decoder, ++ &jxl->format, ++ &buffer_size)) { ++ vips_foreign_load_jxl_error(jxl, ++ "JxlDecoderImageOutBufferSize"); ++ return (-1); + } +- if( buffer_size != +- VIPS_IMAGE_SIZEOF_IMAGE( t[0] ) ) { +- vips_error( class->nickname, +- "%s", _( "bad buffer size" ) ); +- return( -1 ); ++ if (buffer_size != ++ VIPS_IMAGE_SIZEOF_IMAGE(t[0])) { ++ vips_error(class->nickname, ++ "%s", _("bad buffer size")); ++ return (-1); + } +- if( JxlDecoderSetImageOutBuffer( jxl->decoder, +- &jxl->format, +- VIPS_IMAGE_ADDR( t[0], 0, 0 ), +- VIPS_IMAGE_SIZEOF_IMAGE( t[0] ) ) ) { +- vips_foreign_load_jxl_error( jxl, +- "JxlDecoderSetImageOutBuffer" ); +- return( -1 ); ++ if (JxlDecoderSetImageOutBuffer(jxl->decoder, ++ &jxl->format, ++ VIPS_IMAGE_ADDR(t[0], 0, 0), ++ VIPS_IMAGE_SIZEOF_IMAGE(t[0]))) { ++ vips_foreign_load_jxl_error(jxl, ++ "JxlDecoderSetImageOutBuffer"); ++ return (-1); + } + break; + +@@ -686,20 +685,20 @@ vips_foreign_load_jxl_load( VipsForeignLoad *load ) + default: + break; + } +- } while( status != JXL_DEC_SUCCESS ); ++ } while (status != JXL_DEC_SUCCESS); + +- if( vips_image_write( t[0], load->real ) ) +- return( -1 ); ++ if (vips_image_write(t[0], load->real)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_jxl_class_init( VipsForeignLoadJxlClass *class ) ++vips_foreign_load_jxl_class_init(VipsForeignLoadJxlClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->dispose = vips_foreign_load_jxl_dispose; +@@ -707,7 +706,7 @@ vips_foreign_load_jxl_class_init( VipsForeignLoadJxlClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "jxlload_base"; +- object_class->description = _( "load JPEG-XL image" ); ++ object_class->description = _("load JPEG-XL image"); + object_class->build = vips_foreign_load_jxl_build; + + /* libjxl is fuzzed, but it's relatively young and bugs are +@@ -718,11 +717,10 @@ vips_foreign_load_jxl_class_init( VipsForeignLoadJxlClass *class ) + load_class->get_flags = vips_foreign_load_jxl_get_flags; + load_class->header = vips_foreign_load_jxl_header; + load_class->load = vips_foreign_load_jxl_load; +- + } + + static void +-vips_foreign_load_jxl_init( VipsForeignLoadJxl *jxl ) ++vips_foreign_load_jxl_init(VipsForeignLoadJxl *jxl) + { + } + +@@ -731,53 +729,51 @@ typedef struct _VipsForeignLoadJxlFile { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadJxlFile; + + typedef VipsForeignLoadJxlClass VipsForeignLoadJxlFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadJxlFile, vips_foreign_load_jxl_file, +- vips_foreign_load_jxl_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadJxlFile, vips_foreign_load_jxl_file, ++ vips_foreign_load_jxl_get_type()); + + static int +-vips_foreign_load_jxl_file_build( VipsObject *object ) ++vips_foreign_load_jxl_file_build(VipsObject *object) + { + VipsForeignLoadJxl *jxl = (VipsForeignLoadJxl *) object; + VipsForeignLoadJxlFile *file = (VipsForeignLoadJxlFile *) object; + +- if( file->filename && +- !(jxl->source = vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(jxl->source = vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_jxl_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_jxl_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-const char *vips__jxl_suffs[] = +- { ".jxl", NULL }; ++const char *vips__jxl_suffs[] = { ".jxl", NULL }; + + static int +-vips_foreign_load_jxl_is_a( const char *filename ) ++vips_foreign_load_jxl_is_a(const char *filename) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( FALSE ); +- result = vips_foreign_load_jxl_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (FALSE); ++ result = vips_foreign_load_jxl_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static void +-vips_foreign_load_jxl_file_class_init( VipsForeignLoadJxlFileClass *class ) ++vips_foreign_load_jxl_file_class_init(VipsForeignLoadJxlFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -792,17 +788,16 @@ vips_foreign_load_jxl_file_class_init( VipsForeignLoadJxlFileClass *class ) + + load_class->is_a = vips_foreign_load_jxl_is_a; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadJxlFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadJxlFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_jxl_file_init( VipsForeignLoadJxlFile *jxl ) ++vips_foreign_load_jxl_file_init(VipsForeignLoadJxlFile *jxl) + { + } + +@@ -817,47 +812,46 @@ typedef struct _VipsForeignLoadJxlBuffer { + + typedef VipsForeignLoadJxlClass VipsForeignLoadJxlBufferClass; + +-G_DEFINE_TYPE( VipsForeignLoadJxlBuffer, vips_foreign_load_jxl_buffer, +- vips_foreign_load_jxl_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadJxlBuffer, vips_foreign_load_jxl_buffer, ++ vips_foreign_load_jxl_get_type()); + + static int +-vips_foreign_load_jxl_buffer_build( VipsObject *object ) ++vips_foreign_load_jxl_buffer_build(VipsObject *object) + { + VipsForeignLoadJxl *jxl = (VipsForeignLoadJxl *) object; +- VipsForeignLoadJxlBuffer *buffer = ++ VipsForeignLoadJxlBuffer *buffer = + (VipsForeignLoadJxlBuffer *) object; + +- if( buffer->buf ) +- if( !(jxl->source = vips_source_new_from_memory( +- VIPS_AREA( buffer->buf )->data, +- VIPS_AREA( buffer->buf )->length )) ) +- return( -1 ); ++ if (buffer->buf) ++ if (!(jxl->source = vips_source_new_from_memory( ++ VIPS_AREA(buffer->buf)->data, ++ VIPS_AREA(buffer->buf)->length))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_jxl_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_jxl_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_jxl_buffer_is_a( const void *buf, size_t len ) ++vips_foreign_load_jxl_buffer_is_a(const void *buf, size_t len) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_memory( buf, len )) ) +- return( FALSE ); +- result = vips_foreign_load_jxl_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_memory(buf, len))) ++ return (FALSE); ++ result = vips_foreign_load_jxl_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static void +-vips_foreign_load_jxl_buffer_class_init( VipsForeignLoadJxlBufferClass *class ) ++vips_foreign_load_jxl_buffer_class_init(VipsForeignLoadJxlBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -869,17 +863,16 @@ vips_foreign_load_jxl_buffer_class_init( VipsForeignLoadJxlBufferClass *class ) + + load_class->is_a_buffer = vips_foreign_load_jxl_buffer_is_a; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadJxlBuffer, buf ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadJxlBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_load_jxl_buffer_init( VipsForeignLoadJxlBuffer *buffer ) ++vips_foreign_load_jxl_buffer_init(VipsForeignLoadJxlBuffer *buffer) + { + } + +@@ -894,35 +887,35 @@ typedef struct _VipsForeignLoadJxlSource { + + typedef VipsForeignLoadJxlClass VipsForeignLoadJxlSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadJxlSource, vips_foreign_load_jxl_source, +- vips_foreign_load_jxl_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadJxlSource, vips_foreign_load_jxl_source, ++ vips_foreign_load_jxl_get_type()); + + static int +-vips_foreign_load_jxl_source_build( VipsObject *object ) ++vips_foreign_load_jxl_source_build(VipsObject *object) + { + VipsForeignLoadJxl *jxl = (VipsForeignLoadJxl *) object; +- VipsForeignLoadJxlSource *source = ++ VipsForeignLoadJxlSource *source = + (VipsForeignLoadJxlSource *) object; + +- if( source->source ) { ++ if (source->source) { + jxl->source = source->source; +- g_object_ref( jxl->source ); ++ g_object_ref(jxl->source); + } + +- if( VIPS_OBJECT_CLASS( +- vips_foreign_load_jxl_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS( ++ vips_foreign_load_jxl_source_parent_class) ++ ->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_jxl_source_class_init( VipsForeignLoadJxlSourceClass *class ) ++vips_foreign_load_jxl_source_class_init(VipsForeignLoadJxlSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -935,17 +928,16 @@ vips_foreign_load_jxl_source_class_init( VipsForeignLoadJxlSourceClass *class ) + + load_class->is_a_source = vips_foreign_load_jxl_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadJxlSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadJxlSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_jxl_source_init( VipsForeignLoadJxlSource *jxl ) ++vips_foreign_load_jxl_source_init(VipsForeignLoadJxlSource *jxl) + { + } + +diff --git a/libvips/foreign/jxlsave.c b/libvips/foreign/jxlsave.c +index 3139c15498..8160bc50f1 100644 +--- a/libvips/foreign/jxlsave.c ++++ b/libvips/foreign/jxlsave.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -104,163 +104,159 @@ typedef struct _VipsForeignSaveJxl { + + typedef VipsForeignSaveClass VipsForeignSaveJxlClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveJxl, vips_foreign_save_jxl, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSaveJxl, vips_foreign_save_jxl, ++ VIPS_TYPE_FOREIGN_SAVE); + + static void +-vips_foreign_save_jxl_dispose( GObject *gobject ) ++vips_foreign_save_jxl_dispose(GObject *gobject) + { + VipsForeignSaveJxl *jxl = (VipsForeignSaveJxl *) gobject; + +- VIPS_FREEF( JxlThreadParallelRunnerDestroy, jxl->runner ); +- VIPS_FREEF( JxlEncoderDestroy, jxl->encoder ); +- VIPS_UNREF( jxl->target ); ++ VIPS_FREEF(JxlThreadParallelRunnerDestroy, jxl->runner); ++ VIPS_FREEF(JxlEncoderDestroy, jxl->encoder); ++ VIPS_UNREF(jxl->target); + +- G_OBJECT_CLASS( vips_foreign_save_jxl_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_jxl_parent_class)->dispose(gobject); + } + + static void +-vips_foreign_save_jxl_error( VipsForeignSaveJxl *jxl, const char *details ) ++vips_foreign_save_jxl_error(VipsForeignSaveJxl *jxl, const char *details) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( jxl ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(jxl); + + /* TODO ... jxl has no way to get error messages at the moment. + */ +- vips_error( class->nickname, "error %s", details ); ++ vips_error(class->nickname, "error %s", details); + } + + #ifdef DEBUG + static void +-vips_foreign_save_jxl_print_info( JxlBasicInfo *info ) ++vips_foreign_save_jxl_print_info(JxlBasicInfo *info) + { +- printf( "JxlBasicInfo:\n" ); +- printf( " have_container = %d\n", info->have_container ); +- printf( " xsize = %d\n", info->xsize ); +- printf( " ysize = %d\n", info->ysize ); +- printf( " bits_per_sample = %d\n", info->bits_per_sample ); +- printf( " exponent_bits_per_sample = %d\n", +- info->exponent_bits_per_sample ); +- printf( " intensity_target = %g\n", info->intensity_target ); +- printf( " min_nits = %g\n", info->min_nits ); +- printf( " relative_to_max_display = %d\n", +- info->relative_to_max_display ); +- printf( " linear_below = %g\n", info->linear_below ); +- printf( " uses_original_profile = %d\n", +- info->uses_original_profile ); +- printf( " have_preview = %d\n", info->have_preview ); +- printf( " have_animation = %d\n", info->have_animation ); +- printf( " orientation = %d\n", info->orientation ); +- printf( " num_color_channels = %d\n", info->num_color_channels ); +- printf( " num_extra_channels = %d\n", info->num_extra_channels ); +- printf( " alpha_bits = %d\n", info->alpha_bits ); +- printf( " alpha_exponent_bits = %d\n", info->alpha_exponent_bits ); +- printf( " alpha_premultiplied = %d\n", info->alpha_premultiplied ); +- printf( " preview.xsize = %d\n", info->preview.xsize ); +- printf( " preview.ysize = %d\n", info->preview.ysize ); +- printf( " animation.tps_numerator = %d\n", +- info->animation.tps_numerator ); +- printf( " animation.tps_denominator = %d\n", +- info->animation.tps_denominator ); +- printf( " animation.num_loops = %d\n", info->animation.num_loops ); +- printf( " animation.have_timecodes = %d\n", +- info->animation.have_timecodes ); ++ printf("JxlBasicInfo:\n"); ++ printf(" have_container = %d\n", info->have_container); ++ printf(" xsize = %d\n", info->xsize); ++ printf(" ysize = %d\n", info->ysize); ++ printf(" bits_per_sample = %d\n", info->bits_per_sample); ++ printf(" exponent_bits_per_sample = %d\n", ++ info->exponent_bits_per_sample); ++ printf(" intensity_target = %g\n", info->intensity_target); ++ printf(" min_nits = %g\n", info->min_nits); ++ printf(" relative_to_max_display = %d\n", ++ info->relative_to_max_display); ++ printf(" linear_below = %g\n", info->linear_below); ++ printf(" uses_original_profile = %d\n", ++ info->uses_original_profile); ++ printf(" have_preview = %d\n", info->have_preview); ++ printf(" have_animation = %d\n", info->have_animation); ++ printf(" orientation = %d\n", info->orientation); ++ printf(" num_color_channels = %d\n", info->num_color_channels); ++ printf(" num_extra_channels = %d\n", info->num_extra_channels); ++ printf(" alpha_bits = %d\n", info->alpha_bits); ++ printf(" alpha_exponent_bits = %d\n", info->alpha_exponent_bits); ++ printf(" alpha_premultiplied = %d\n", info->alpha_premultiplied); ++ printf(" preview.xsize = %d\n", info->preview.xsize); ++ printf(" preview.ysize = %d\n", info->preview.ysize); ++ printf(" animation.tps_numerator = %d\n", ++ info->animation.tps_numerator); ++ printf(" animation.tps_denominator = %d\n", ++ info->animation.tps_denominator); ++ printf(" animation.num_loops = %d\n", info->animation.num_loops); ++ printf(" animation.have_timecodes = %d\n", ++ info->animation.have_timecodes); + } + + static void +-vips_foreign_save_jxl_print_format( JxlPixelFormat *format ) ++vips_foreign_save_jxl_print_format(JxlPixelFormat *format) + { +- printf( "JxlPixelFormat:\n" ); +- printf( " num_channels = %d\n", format->num_channels ); +- printf( " data_type = " ); +- switch( format->data_type ) { +- case JXL_TYPE_UINT8: +- printf( "JXL_TYPE_UINT8" ); ++ printf("JxlPixelFormat:\n"); ++ printf(" num_channels = %d\n", format->num_channels); ++ printf(" data_type = "); ++ switch (format->data_type) { ++ case JXL_TYPE_UINT8: ++ printf("JXL_TYPE_UINT8"); + break; + +- case JXL_TYPE_UINT16: +- printf( "JXL_TYPE_UINT16" ); ++ case JXL_TYPE_UINT16: ++ printf("JXL_TYPE_UINT16"); + break; + +- case JXL_TYPE_FLOAT: +- printf( "JXL_TYPE_FLOAT" ); ++ case JXL_TYPE_FLOAT: ++ printf("JXL_TYPE_FLOAT"); + break; + + default: +- printf( "(unknown)" ); ++ printf("(unknown)"); + break; + } +- printf( "\n" ); +- printf( " endianness = %d\n", format->endianness ); +- printf( " align = %zd\n", format->align ); ++ printf("\n"); ++ printf(" endianness = %d\n", format->endianness); ++ printf(" align = %zd\n", format->align); + } + + static void +-vips_foreign_save_jxl_print_status( JxlEncoderStatus status ) ++vips_foreign_save_jxl_print_status(JxlEncoderStatus status) + { +- switch( status ) { ++ switch (status) { + case JXL_ENC_SUCCESS: +- printf( "JXL_ENC_SUCCESS\n" ); ++ printf("JXL_ENC_SUCCESS\n"); + break; + + case JXL_ENC_ERROR: +- printf( "JXL_ENC_ERROR\n" ); ++ printf("JXL_ENC_ERROR\n"); + break; + + case JXL_ENC_NEED_MORE_OUTPUT: +- printf( "JXL_ENC_NEED_MORE_OUTPUT\n" ); ++ printf("JXL_ENC_NEED_MORE_OUTPUT\n"); + break; + + case JXL_ENC_NOT_SUPPORTED: +- printf( "JXL_ENC_NOT_SUPPORTED\n" ); ++ printf("JXL_ENC_NOT_SUPPORTED\n"); + break; + + default: +- printf( "JXL_ENC_\n" ); ++ printf("JXL_ENC_\n"); + break; + } + } + #endif /*DEBUG*/ + + static int +-vips_foreign_save_jxl_build( VipsObject *object ) ++vips_foreign_save_jxl_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveJxl *jxl = (VipsForeignSaveJxl *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 5 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 5); + + JxlEncoderFrameSettings *frame_settings; + JxlEncoderStatus status; + VipsImage *in; + VipsBandFormat format; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_jxl_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_jxl_parent_class)->build(object)) ++ return (-1); + + /* If Q is set and distance is not, use Q to set a rough distance + * value. Formula stolen from cjxl.c and very roughly approximates + * libjpeg values. + */ +- if( !vips_object_argument_isset( object, "distance" ) ) +- jxl->distance = jxl->Q >= 30 ? +- 0.1 + (100 - jxl->Q) * 0.09 : +- 6.24 + pow(2.5, (30 - jxl->Q) / 5.0f) / 6.25f; ++ if (!vips_object_argument_isset(object, "distance")) ++ jxl->distance = jxl->Q >= 30 ? 0.1 + (100 - jxl->Q) * 0.09 : 6.24 + pow(2.5, (30 - jxl->Q) / 5.0f) / 6.25f; + + /* Distance 0 is lossless. libjxl will fail for lossy distance 0. + */ +- if( jxl->distance == 0 ) ++ if (jxl->distance == 0) + jxl->lossless = TRUE; + +- jxl->runner = JxlThreadParallelRunnerCreate( NULL, +- vips_concurrency_get() ); +- jxl->encoder = JxlEncoderCreate( NULL ); ++ jxl->runner = JxlThreadParallelRunnerCreate(NULL, ++ vips_concurrency_get()); ++ jxl->encoder = JxlEncoderCreate(NULL); + +- if( JxlEncoderSetParallelRunner( jxl->encoder, +- JxlThreadParallelRunner, jxl->runner ) ) { +- vips_foreign_save_jxl_error( jxl, +- "JxlDecoderSetParallelRunner" ); +- return( -1 ); ++ if (JxlEncoderSetParallelRunner(jxl->encoder, ++ JxlThreadParallelRunner, jxl->runner)) { ++ vips_foreign_save_jxl_error(jxl, ++ "JxlDecoderSetParallelRunner"); ++ return (-1); + } + + in = save->ready; +@@ -268,21 +264,21 @@ vips_foreign_save_jxl_build( VipsObject *object ) + /* Fix the input image format. JXL uses float for 0-1 linear (ie. + * scRGB) only. We must convert eg. sRGB float to 8-bit for save. + */ +- if( in->Type == VIPS_INTERPRETATION_scRGB ) ++ if (in->Type == VIPS_INTERPRETATION_scRGB) + format = VIPS_FORMAT_FLOAT; +- else if( in->Type == VIPS_INTERPRETATION_RGB16 || +- in->Type == VIPS_INTERPRETATION_GREY16 ) ++ else if (in->Type == VIPS_INTERPRETATION_RGB16 || ++ in->Type == VIPS_INTERPRETATION_GREY16) + format = VIPS_FORMAT_USHORT; + else + format = VIPS_FORMAT_UCHAR; + +- if( vips_cast( in, &t[0], format, NULL ) ) +- return( -1 ); ++ if (vips_cast(in, &t[0], format, NULL)) ++ return (-1); + in = t[0]; + +- JxlEncoderInitBasicInfo( &jxl->info ); ++ JxlEncoderInitBasicInfo(&jxl->info); + +- switch( in->BandFmt ) { ++ switch (in->BandFmt) { + case VIPS_FORMAT_UCHAR: + jxl->info.bits_per_sample = 8; + jxl->info.exponent_bits_per_sample = 0; +@@ -306,7 +302,7 @@ vips_foreign_save_jxl_build( VipsObject *object ) + break; + } + +- switch( in->Type ) { ++ switch (in->Type) { + case VIPS_INTERPRETATION_B_W: + case VIPS_INTERPRETATION_GREY16: + jxl->info.num_color_channels = 1; +@@ -321,8 +317,8 @@ vips_foreign_save_jxl_build( VipsObject *object ) + default: + jxl->info.num_color_channels = in->Bands; + } +- jxl->info.num_extra_channels = VIPS_MAX( 0, +- in->Bands - jxl->info.num_color_channels ); ++ jxl->info.num_extra_channels = VIPS_MAX(0, ++ in->Bands - jxl->info.num_color_channels); + + jxl->info.xsize = in->Xsize; + jxl->info.ysize = in->Ysize; +@@ -330,9 +326,9 @@ vips_foreign_save_jxl_build( VipsObject *object ) + jxl->format.endianness = JXL_NATIVE_ENDIAN; + jxl->format.align = 0; + +- if( vips_image_hasalpha( in ) ) { ++ if (vips_image_hasalpha(in)) { + jxl->info.alpha_bits = jxl->info.bits_per_sample; +- jxl->info.alpha_exponent_bits = ++ jxl->info.alpha_exponent_bits = + jxl->info.exponent_bits_per_sample; + } + else { +@@ -340,11 +336,11 @@ vips_foreign_save_jxl_build( VipsObject *object ) + jxl->info.alpha_bits = 0; + } + +- if( vips_image_get_typeof( in, "stonits" ) ) { ++ if (vips_image_get_typeof(in, "stonits")) { + double stonits; + +- if( vips_image_get_double( in, "stonits", &stonits ) ) +- return( -1 ); ++ if (vips_image_get_double(in, "stonits", &stonits)) ++ return (-1); + jxl->info.intensity_target = stonits; + } + +@@ -353,95 +349,95 @@ vips_foreign_save_jxl_build( VipsObject *object ) + */ + jxl->info.uses_original_profile = jxl->lossless; + +- if( JxlEncoderSetBasicInfo( jxl->encoder, &jxl->info ) ) { +- vips_foreign_save_jxl_error( jxl, "JxlEncoderSetBasicInfo" ); +- return( -1 ); ++ if (JxlEncoderSetBasicInfo(jxl->encoder, &jxl->info)) { ++ vips_foreign_save_jxl_error(jxl, "JxlEncoderSetBasicInfo"); ++ return (-1); + } + + /* Set any ICC profile. + */ +- if( vips_image_get_typeof( in, VIPS_META_ICC_NAME ) ) { ++ if (vips_image_get_typeof(in, VIPS_META_ICC_NAME)) { + const void *data; + size_t length; + +- if( vips_image_get_blob( in, +- VIPS_META_ICC_NAME, &data, &length ) ) +- return( -1 ); ++ if (vips_image_get_blob(in, ++ VIPS_META_ICC_NAME, &data, &length)) ++ return (-1); + + #ifdef DEBUG +- printf( "attaching %zd bytes of ICC\n", length ); ++ printf("attaching %zd bytes of ICC\n", length); + #endif /*DEBUG*/ +- if( JxlEncoderSetICCProfile( jxl->encoder, +- (guint8 *) data, length ) ) { +- vips_foreign_save_jxl_error( jxl, +- "JxlEncoderSetColorEncoding" ); +- return( -1 ); ++ if (JxlEncoderSetICCProfile(jxl->encoder, ++ (guint8 *) data, length)) { ++ vips_foreign_save_jxl_error(jxl, ++ "JxlEncoderSetColorEncoding"); ++ return (-1); + } + } + else { + /* If there's no ICC profile, we must set the colour encoding + * ourselves. + */ +- if( in->Type == VIPS_INTERPRETATION_scRGB ) { ++ if (in->Type == VIPS_INTERPRETATION_scRGB) { + #ifdef DEBUG +- printf( "setting scRGB colourspace\n" ); ++ printf("setting scRGB colourspace\n"); + #endif /*DEBUG*/ + +- JxlColorEncodingSetToLinearSRGB( &jxl->color_encoding, +- jxl->format.num_channels < 3 ); ++ JxlColorEncodingSetToLinearSRGB(&jxl->color_encoding, ++ jxl->format.num_channels < 3); + } + else { + #ifdef DEBUG +- printf( "setting sRGB colourspace\n" ); ++ printf("setting sRGB colourspace\n"); + #endif /*DEBUG*/ + +- JxlColorEncodingSetToSRGB( &jxl->color_encoding, +- jxl->format.num_channels < 3 ); ++ JxlColorEncodingSetToSRGB(&jxl->color_encoding, ++ jxl->format.num_channels < 3); + } + +- if( JxlEncoderSetColorEncoding( jxl->encoder, +- &jxl->color_encoding ) ) { +- vips_foreign_save_jxl_error( jxl, +- "JxlEncoderSetColorEncoding" ); +- return( -1 ); ++ if (JxlEncoderSetColorEncoding(jxl->encoder, ++ &jxl->color_encoding)) { ++ vips_foreign_save_jxl_error(jxl, ++ "JxlEncoderSetColorEncoding"); ++ return (-1); + } + } + + /* Render the entire image in memory. libjxl seems to be missing + * tile-based write at the moment. + */ +- if( vips_image_wio_input( in ) ) +- return( -1 ); ++ if (vips_image_wio_input(in)) ++ return (-1); + +- frame_settings = JxlEncoderFrameSettingsCreate( jxl->encoder, NULL ); +- JxlEncoderFrameSettingsSetOption( frame_settings, +- JXL_ENC_FRAME_SETTING_DECODING_SPEED, jxl->tier ); +- JxlEncoderSetFrameDistance( frame_settings, jxl->distance ); +- JxlEncoderFrameSettingsSetOption( frame_settings, +- JXL_ENC_FRAME_SETTING_EFFORT, jxl->effort ); +- JxlEncoderSetFrameLossless( frame_settings, jxl->lossless ); ++ frame_settings = JxlEncoderFrameSettingsCreate(jxl->encoder, NULL); ++ JxlEncoderFrameSettingsSetOption(frame_settings, ++ JXL_ENC_FRAME_SETTING_DECODING_SPEED, jxl->tier); ++ JxlEncoderSetFrameDistance(frame_settings, jxl->distance); ++ JxlEncoderFrameSettingsSetOption(frame_settings, ++ JXL_ENC_FRAME_SETTING_EFFORT, jxl->effort); ++ JxlEncoderSetFrameLossless(frame_settings, jxl->lossless); + + #ifdef DEBUG +- vips_foreign_save_jxl_print_info( &jxl->info ); +- vips_foreign_save_jxl_print_format( &jxl->format ); +- printf( "JxlEncoderFrameSettings:\n" ); +- printf( " tier = %d\n", jxl->tier ); +- printf( " distance = %g\n", jxl->distance ); +- printf( " effort = %d\n", jxl->effort ); +- printf( " lossless = %d\n", jxl->lossless ); ++ vips_foreign_save_jxl_print_info(&jxl->info); ++ vips_foreign_save_jxl_print_format(&jxl->format); ++ printf("JxlEncoderFrameSettings:\n"); ++ printf(" tier = %d\n", jxl->tier); ++ printf(" distance = %g\n", jxl->distance); ++ printf(" effort = %d\n", jxl->effort); ++ printf(" lossless = %d\n", jxl->lossless); + #endif /*DEBUG*/ + +- if( JxlEncoderAddImageFrame( frame_settings, &jxl->format, +- VIPS_IMAGE_ADDR( in, 0, 0 ), +- VIPS_IMAGE_SIZEOF_IMAGE( in ) ) ) { +- vips_foreign_save_jxl_error( jxl, "JxlEncoderAddImageFrame" ); +- return( -1 ); ++ if (JxlEncoderAddImageFrame(frame_settings, &jxl->format, ++ VIPS_IMAGE_ADDR(in, 0, 0), ++ VIPS_IMAGE_SIZEOF_IMAGE(in))) { ++ vips_foreign_save_jxl_error(jxl, "JxlEncoderAddImageFrame"); ++ return (-1); + } + + /* This function must be called after the final frame and/or box, + * otherwise the codestream will not be encoded correctly. + */ +- JxlEncoderCloseInput( jxl->encoder ); ++ JxlEncoderCloseInput(jxl->encoder); + + do { + uint8_t *out; +@@ -449,31 +445,31 @@ vips_foreign_save_jxl_build( VipsObject *object ) + + out = jxl->output_buffer; + avail_out = OUTPUT_BUFFER_SIZE; +- status = JxlEncoderProcessOutput( jxl->encoder, +- &out, &avail_out ); +- switch( status ) { ++ status = JxlEncoderProcessOutput(jxl->encoder, ++ &out, &avail_out); ++ switch (status) { + case JXL_ENC_SUCCESS: + case JXL_ENC_NEED_MORE_OUTPUT: +- if( vips_target_write( jxl->target, +- jxl->output_buffer, +- OUTPUT_BUFFER_SIZE - avail_out ) ) +- return( -1 ); ++ if (vips_target_write(jxl->target, ++ jxl->output_buffer, ++ OUTPUT_BUFFER_SIZE - avail_out)) ++ return (-1); + break; + + default: +- vips_foreign_save_jxl_error( jxl, +- "JxlEncoderProcessOutput" ); ++ vips_foreign_save_jxl_error(jxl, ++ "JxlEncoderProcessOutput"); + #ifdef DEBUG +- vips_foreign_save_jxl_print_status( status ); ++ vips_foreign_save_jxl_print_status(status); + #endif /*DEBUG*/ +- return( -1 ); ++ return (-1); + } +- } while( status != JXL_ENC_SUCCESS ); ++ } while (status != JXL_ENC_SUCCESS); + +- if( vips_target_end( jxl->target ) ) +- return( -1 ); ++ if (vips_target_end(jxl->target)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Save a bit of typing. +@@ -490,11 +486,11 @@ static VipsBandFormat bandfmt_jxl[10] = { + }; + + static void +-vips_foreign_save_jxl_class_init( VipsForeignSaveJxlClass *class ) ++vips_foreign_save_jxl_class_init(VipsForeignSaveJxlClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; + +@@ -503,7 +499,7 @@ vips_foreign_save_jxl_class_init( VipsForeignSaveJxlClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "jxlsave_base"; +- object_class->description = _( "save image in JPEG-XL format" ); ++ object_class->description = _("save image in JPEG-XL format"); + object_class->build = vips_foreign_save_jxl_build; + + /* libjxl is fuzzed, but it's still relatively young and bugs are +@@ -518,45 +514,44 @@ vips_foreign_save_jxl_class_init( VipsForeignSaveJxlClass *class ) + save_class->saveable = VIPS_SAVEABLE_RGBA; + save_class->format_table = bandfmt_jxl; + +- VIPS_ARG_INT( class, "tier", 10, +- _( "Tier" ), +- _( "Decode speed tier" ), ++ VIPS_ARG_INT(class, "tier", 10, ++ _("Tier"), ++ _("Decode speed tier"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJxl, tier ), +- 0, 4, 0 ); ++ G_STRUCT_OFFSET(VipsForeignSaveJxl, tier), ++ 0, 4, 0); + +- VIPS_ARG_DOUBLE( class, "distance", 11, +- _( "Distance" ), +- _( "Target butteraugli distance" ), ++ VIPS_ARG_DOUBLE(class, "distance", 11, ++ _("Distance"), ++ _("Target butteraugli distance"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJxl, distance ), +- 0, 15, 1.0 ); ++ G_STRUCT_OFFSET(VipsForeignSaveJxl, distance), ++ 0, 15, 1.0); + +- VIPS_ARG_INT( class, "effort", 12, +- _( "Effort" ), +- _( "Encoding effort" ), ++ VIPS_ARG_INT(class, "effort", 12, ++ _("Effort"), ++ _("Encoding effort"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJxl, effort ), +- 3, 9, 7 ); ++ G_STRUCT_OFFSET(VipsForeignSaveJxl, effort), ++ 3, 9, 7); + +- VIPS_ARG_BOOL( class, "lossless", 13, +- _( "Lossless" ), +- _( "Enable lossless compression" ), ++ VIPS_ARG_BOOL(class, "lossless", 13, ++ _("Lossless"), ++ _("Enable lossless compression"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJxl, lossless ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveJxl, lossless), ++ FALSE); + +- VIPS_ARG_INT( class, "Q", 14, +- _( "Q" ), +- _( "Quality factor" ), ++ VIPS_ARG_INT(class, "Q", 14, ++ _("Q"), ++ _("Quality factor"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJxl, Q ), +- 0, 100, 75 ); +- ++ G_STRUCT_OFFSET(VipsForeignSaveJxl, Q), ++ 0, 100, 75); + } + + static void +-vips_foreign_save_jxl_init( VipsForeignSaveJxl *jxl ) ++vips_foreign_save_jxl_init(VipsForeignSaveJxl *jxl) + { + jxl->tier = 0; + jxl->distance = 1.0; +@@ -570,35 +565,34 @@ typedef struct _VipsForeignSaveJxlFile { + + /* Filename for save. + */ +- char *filename; ++ char *filename; + + } VipsForeignSaveJxlFile; + + typedef VipsForeignSaveJxlClass VipsForeignSaveJxlFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveJxlFile, vips_foreign_save_jxl_file, +- vips_foreign_save_jxl_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveJxlFile, vips_foreign_save_jxl_file, ++ vips_foreign_save_jxl_get_type()); + + static int +-vips_foreign_save_jxl_file_build( VipsObject *object ) ++vips_foreign_save_jxl_file_build(VipsObject *object) + { + VipsForeignSaveJxl *jxl = (VipsForeignSaveJxl *) object; + VipsForeignSaveJxlFile *file = (VipsForeignSaveJxlFile *) object; + +- if( !(jxl->target = vips_target_new_to_file( file->filename )) ) +- return( -1 ); ++ if (!(jxl->target = vips_target_new_to_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_jxl_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_jxl_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_jxl_file_class_init( VipsForeignSaveJxlFileClass *class ) ++vips_foreign_save_jxl_file_class_init(VipsForeignSaveJxlFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -607,17 +601,16 @@ vips_foreign_save_jxl_file_class_init( VipsForeignSaveJxlFileClass *class ) + object_class->nickname = "jxlsave"; + object_class->build = vips_foreign_save_jxl_file_build; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJxlFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveJxlFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_jxl_file_init( VipsForeignSaveJxlFile *file ) ++vips_foreign_save_jxl_file_init(VipsForeignSaveJxlFile *file) + { + } + +@@ -632,37 +625,36 @@ typedef struct _VipsForeignSaveJxlBuffer { + + typedef VipsForeignSaveJxlClass VipsForeignSaveJxlBufferClass; + +-G_DEFINE_TYPE( VipsForeignSaveJxlBuffer, vips_foreign_save_jxl_buffer, +- vips_foreign_save_jxl_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveJxlBuffer, vips_foreign_save_jxl_buffer, ++ vips_foreign_save_jxl_get_type()); + + static int +-vips_foreign_save_jxl_buffer_build( VipsObject *object ) ++vips_foreign_save_jxl_buffer_build(VipsObject *object) + { + VipsForeignSaveJxl *jxl = (VipsForeignSaveJxl *) object; +- VipsForeignSaveJxlBuffer *buffer = ++ VipsForeignSaveJxlBuffer *buffer = + (VipsForeignSaveJxlBuffer *) object; + + VipsBlob *blob; + +- if( !(jxl->target = vips_target_new_to_memory()) ) +- return( -1 ); ++ if (!(jxl->target = vips_target_new_to_memory())) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_jxl_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_jxl_buffer_parent_class)->build(object)) ++ return (-1); + +- g_object_get( jxl->target, "blob", &blob, NULL ); +- g_object_set( buffer, "buffer", blob, NULL ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ g_object_get(jxl->target, "blob", &blob, NULL); ++ g_object_set(buffer, "buffer", blob, NULL); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_jxl_buffer_class_init( +- VipsForeignSaveJxlBufferClass *class ) ++vips_foreign_save_jxl_buffer_class_init( ++ VipsForeignSaveJxlBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -671,17 +663,16 @@ vips_foreign_save_jxl_buffer_class_init( + object_class->nickname = "jxlsave_buffer"; + object_class->build = vips_foreign_save_jxl_buffer_build; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to save to" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJxlBuffer, buf ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to save to"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveJxlBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_save_jxl_buffer_init( VipsForeignSaveJxlBuffer *buffer ) ++vips_foreign_save_jxl_buffer_init(VipsForeignSaveJxlBuffer *buffer) + { + } + +@@ -693,33 +684,32 @@ typedef struct _VipsForeignSaveJxlTarget { + + typedef VipsForeignSaveJxlClass VipsForeignSaveJxlTargetClass; + +-G_DEFINE_TYPE( VipsForeignSaveJxlTarget, vips_foreign_save_jxl_target, +- vips_foreign_save_jxl_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveJxlTarget, vips_foreign_save_jxl_target, ++ vips_foreign_save_jxl_get_type()); + + static int +-vips_foreign_save_jxl_target_build( VipsObject *object ) ++vips_foreign_save_jxl_target_build(VipsObject *object) + { + VipsForeignSaveJxl *jxl = (VipsForeignSaveJxl *) object; +- VipsForeignSaveJxlTarget *target = ++ VipsForeignSaveJxlTarget *target = + (VipsForeignSaveJxlTarget *) object; + +- if( target->target ) { ++ if (target->target) { + jxl->target = target->target; +- g_object_ref( jxl->target ); ++ g_object_ref(jxl->target); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_jxl_target_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_jxl_target_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_jxl_target_class_init( +- VipsForeignSaveJxlTargetClass *class ) ++vips_foreign_save_jxl_target_class_init( ++ VipsForeignSaveJxlTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -728,17 +718,16 @@ vips_foreign_save_jxl_target_class_init( + object_class->nickname = "jxlsave_target"; + object_class->build = vips_foreign_save_jxl_target_build; + +- VIPS_ARG_OBJECT( class, "target", 1, +- _( "Target" ), +- _( "Target to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveJxlTarget, target ), +- VIPS_TYPE_TARGET ); +- ++ VIPS_ARG_OBJECT(class, "target", 1, ++ _("Target"), ++ _("Target to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveJxlTarget, target), ++ VIPS_TYPE_TARGET); + } + + static void +-vips_foreign_save_jxl_target_init( VipsForeignSaveJxlTarget *target ) ++vips_foreign_save_jxl_target_init(VipsForeignSaveJxlTarget *target) + { + } + +diff --git a/libvips/foreign/magick.c b/libvips/foreign/magick.c +index 5d1d856f62..8a1e4ed2e0 100644 +--- a/libvips/foreign/magick.c ++++ b/libvips/foreign/magick.c +@@ -1,6 +1,6 @@ + /* Common functions for interfacing with ImageMagick. + * +- * 22/12/17 dlemstra ++ * 22/12/17 dlemstra + * + * 24/7/18 + * - add the sniffer +@@ -10,28 +10,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -52,13 +52,13 @@ + + #if defined(HAVE_MAGICK6) || defined(HAVE_MAGICK7) + +-/* ImageMagick can't detect some formats, like ICO and TGA, by examining the ++/* ImageMagick can't detect some formats, like ICO and TGA, by examining the + * contents -- ico.c and tga.c simply do not have recognisers. + * + * For these formats, do the detection ourselves. + * Return an IM format specifier, or NULL to let IM do the detection. + * +- * For sniffing TGAs, we check that there is at least enough room for the ++ * For sniffing TGAs, we check that there is at least enough room for the + * header and that the preamble contains valid values: + * + * ----------------------------------------------------------- +@@ -73,56 +73,56 @@ + * * https://en.wikipedia.org/wiki/Truevision_TGA#Technical_details + */ + static const char * +-magick_sniff( const unsigned char *bytes, size_t length ) ++magick_sniff(const unsigned char *bytes, size_t length) + { +- if( length >= 4 && ++ if (length >= 4 && + bytes[0] == 0 && + bytes[1] == 0 && + bytes[2] == 1 && +- bytes[3] == 0 ) +- return( "ICO" ); ++ bytes[3] == 0) ++ return ("ICO"); + +- if( length >= 5 && +- bytes[0] == 0 && ++ if (length >= 5 && ++ bytes[0] == 0 && + bytes[1] == 1 && + bytes[2] == 0 && + bytes[3] == 0 && +- bytes[4] == 0 ) +- return( "TTF" ); ++ bytes[4] == 0) ++ return ("TTF"); + +- if( length >= 18 && +- (bytes[1] == 0 || +- bytes[1] == 1) && ++ if (length >= 18 && ++ (bytes[1] == 0 || ++ bytes[1] == 1) && + (bytes[2] == 0 || +- bytes[2] == 1 || +- bytes[2] == 2 || +- bytes[2] == 3 || +- bytes[2] == 9 || +- bytes[2] == 10 || +- bytes[2] == 11) ) +- return( "TGA" ); ++ bytes[2] == 1 || ++ bytes[2] == 2 || ++ bytes[2] == 3 || ++ bytes[2] == 9 || ++ bytes[2] == 10 || ++ bytes[2] == 11)) ++ return ("TGA"); + +- return( NULL ); ++ return (NULL); + } + + void +-magick_sniff_bytes( ImageInfo *image_info, +- const unsigned char *bytes, size_t length ) ++magick_sniff_bytes(ImageInfo *image_info, ++ const unsigned char *bytes, size_t length) + { + const char *format; + +- if( (format = magick_sniff( bytes, length )) ) +- vips_strncpy( image_info->magick, format, MaxTextExtent ); ++ if ((format = magick_sniff(bytes, length))) ++ vips_strncpy(image_info->magick, format, MaxTextExtent); + } + + void +-magick_sniff_file( ImageInfo *image_info, const char *filename ) ++magick_sniff_file(ImageInfo *image_info, const char *filename) + { + unsigned char bytes[256]; + size_t length; + +- if( (length = vips__get_bytes( filename, bytes, 256 )) >= 4 ) +- magick_sniff_bytes( image_info, bytes, 256 ); ++ if ((length = vips__get_bytes(filename, bytes, 256)) >= 4) ++ magick_sniff_bytes(image_info, bytes, 256); + } + + #endif /*defined(HAVE_MAGICK6) || defined(HAVE_MAGICK7)*/ +@@ -130,106 +130,106 @@ magick_sniff_file( ImageInfo *image_info, const char *filename ) + #ifdef HAVE_MAGICK7 + + Image * +-magick_acquire_image( const ImageInfo *image_info, ExceptionInfo *exception ) ++magick_acquire_image(const ImageInfo *image_info, ExceptionInfo *exception) + { +- return( AcquireImage( image_info, exception ) ); ++ return (AcquireImage(image_info, exception)); + } + + void +-magick_acquire_next_image( const ImageInfo *image_info, Image *image, +- ExceptionInfo *exception ) ++magick_acquire_next_image(const ImageInfo *image_info, Image *image, ++ ExceptionInfo *exception) + { +- AcquireNextImage( image_info, image, exception ); ++ AcquireNextImage(image_info, image, exception); + } + + int +-magick_set_image_size( Image *image, const size_t width, const size_t height, +- ExceptionInfo *exception ) ++magick_set_image_size(Image *image, const size_t width, const size_t height, ++ ExceptionInfo *exception) + { +- return( SetImageExtent( image, width, height, exception ) ); ++ return (SetImageExtent(image, width, height, exception)); + } + + int +-magick_import_pixels( Image *image, const ssize_t x, const ssize_t y, ++magick_import_pixels(Image *image, const ssize_t x, const ssize_t y, + const size_t width, const size_t height, const char *map, +- const StorageType type,const void *pixels, ExceptionInfo *exception ) ++ const StorageType type, const void *pixels, ExceptionInfo *exception) + { +- return( ImportImagePixels( image, x, y, width, height, map, +- type, pixels, exception ) ); ++ return (ImportImagePixels(image, x, y, width, height, map, ++ type, pixels, exception)); + } + + void * +-magick_images_to_blob( const ImageInfo *image_info, Image *images, +- size_t *length, ExceptionInfo *exception ) ++magick_images_to_blob(const ImageInfo *image_info, Image *images, ++ size_t *length, ExceptionInfo *exception) + { +- return( ImagesToBlob( image_info, images, length, exception ) ); ++ return (ImagesToBlob(image_info, images, length, exception)); + } + + void +-magick_set_property( Image *image, const char *property, const char *value, +- ExceptionInfo *exception ) ++magick_set_property(Image *image, const char *property, const char *value, ++ ExceptionInfo *exception) + { +- (void) SetImageProperty( image, property, value, exception ); ++ (void) SetImageProperty(image, property, value, exception); + } + + int +-magick_set_profile( Image *image, +- const char *name, const void *data, size_t length, +- ExceptionInfo *exception ) ++magick_set_profile(Image *image, ++ const char *name, const void *data, size_t length, ++ ExceptionInfo *exception) + { + StringInfo *string; + MagickBooleanType result; + +- string = BlobToStringInfo( data, length ); +- result = SetImageProfile( image, name, string, exception ); +- DestroyStringInfo( string ); ++ string = BlobToStringInfo(data, length); ++ result = SetImageProfile(image, name, string, exception); ++ DestroyStringInfo(string); + +- return( result ); ++ return (result); + } + + void * +-magick_profile_map( Image *image, MagickMapProfileFn fn, void *a ) ++magick_profile_map(Image *image, MagickMapProfileFn fn, void *a) + { + char *name; + +- ResetImageProfileIterator( image ); +- while( (name = GetNextImageProfile( image )) ) { ++ ResetImageProfileIterator(image); ++ while ((name = GetNextImageProfile(image))) { + const StringInfo *profile; + void *data; + size_t length; + void *result; + +- profile = GetImageProfile( image, name ); +- data = GetStringInfoDatum( profile ); +- length = GetStringInfoLength( profile ); +- if( (result = fn( image, name, data, length, a )) ) +- return( result ); ++ profile = GetImageProfile(image, name); ++ data = GetStringInfoDatum(profile); ++ length = GetStringInfoLength(profile); ++ if ((result = fn(image, name, data, length, a))) ++ return (result); + } + +- return( NULL ); ++ return (NULL); + } + + ExceptionInfo * +-magick_acquire_exception( void ) ++magick_acquire_exception(void) + { +- return( AcquireExceptionInfo() ); ++ return (AcquireExceptionInfo()); + } + + void +-magick_destroy_exception( ExceptionInfo *exception ) ++magick_destroy_exception(ExceptionInfo *exception) + { +- VIPS_FREEF( DestroyExceptionInfo, exception ); ++ VIPS_FREEF(DestroyExceptionInfo, exception); + } + + void +-magick_inherit_exception( ExceptionInfo *exception, Image *image ) ++magick_inherit_exception(ExceptionInfo *exception, Image *image) + { + (void) exception; + (void) image; + } + + void +-magick_set_number_scenes( ImageInfo *image_info, int scene, int number_scenes ) ++magick_set_number_scenes(ImageInfo *image_info, int scene, int number_scenes) + { + /* I can't find docs for these fields, but this seems to work. + */ +@@ -240,41 +240,41 @@ magick_set_number_scenes( ImageInfo *image_info, int scene, int number_scenes ) + + /* Some IMs must have the string version set as well. + */ +- vips_snprintf( page, 256, "%d-%d", scene, scene + number_scenes ); +- image_info->scenes = g_strdup( page ); ++ vips_snprintf(page, 256, "%d-%d", scene, scene + number_scenes); ++ image_info->scenes = g_strdup(page); + } + + int +-magick_optimize_image_layers( Image **images, ExceptionInfo *exception ) ++magick_optimize_image_layers(Image **images, ExceptionInfo *exception) + { + Image *tmp; + +- tmp = OptimizePlusImageLayers( *images, exception ); ++ tmp = OptimizePlusImageLayers(*images, exception); + +- if( exception->severity != UndefinedException ) { +- VIPS_FREEF( DestroyImageList, tmp ); ++ if (exception->severity != UndefinedException) { ++ VIPS_FREEF(DestroyImageList, tmp); + return MagickFalse; + } + +- VIPS_FREEF( DestroyImageList, *images ); ++ VIPS_FREEF(DestroyImageList, *images); + *images = tmp; + + return MagickTrue; + } + + int +-magick_optimize_image_transparency( const Image *images, +- ExceptionInfo *exception ) ++magick_optimize_image_transparency(const Image *images, ++ ExceptionInfo *exception) + { +- OptimizeImageTransparency( images, exception ); ++ OptimizeImageTransparency(images, exception); + +- return( exception->severity == UndefinedException ); ++ return (exception->severity == UndefinedException); + } + + /* Does a few bytes look like a file IM can handle? + */ + gboolean +-magick_ismagick( const unsigned char *bytes, size_t length ) ++magick_ismagick(const unsigned char *bytes, size_t length) + { + char format[MagickPathExtent]; + +@@ -282,21 +282,21 @@ magick_ismagick( const unsigned char *bytes, size_t length ) + + /* Try with our custom sniffers first. + */ +- return( magick_sniff( bytes, length ) || +- GetImageMagick( bytes, length, format ) ); ++ return (magick_sniff(bytes, length) || ++ GetImageMagick(bytes, length, format)); + } + + int +-magick_quantize_images( Image *images, +- const size_t depth, ExceptionInfo *exception ) ++magick_quantize_images(Image *images, ++ const size_t depth, ExceptionInfo *exception) + { + QuantizeInfo info; + +- GetQuantizeInfo( &info ); ++ GetQuantizeInfo(&info); + info.number_colors = 1 << depth; +- QuantizeImages( &info, images, exception ); ++ QuantizeImages(&info, images, exception); + +- return( exception->severity == UndefinedException ); ++ return (exception->severity == UndefinedException); + } + + #endif /*HAVE_MAGICK7*/ +@@ -304,47 +304,47 @@ magick_quantize_images( Image *images, + #ifdef HAVE_MAGICK6 + + Image * +-magick_acquire_image( const ImageInfo *image_info, ExceptionInfo *exception ) ++magick_acquire_image(const ImageInfo *image_info, ExceptionInfo *exception) + { + (void) exception; + + #ifdef HAVE_ACQUIREIMAGE +- return( AcquireImage( image_info ) ); ++ return (AcquireImage(image_info)); + #else /*!HAVE_ACQUIREIMAGE*/ + /* IM5-ish and GraphicsMagick use AllocateImage(). + */ +- return( AllocateImage( image_info ) ); ++ return (AllocateImage(image_info)); + #endif + } + + void +-magick_acquire_next_image( const ImageInfo *image_info, Image *image, +- ExceptionInfo *exception ) ++magick_acquire_next_image(const ImageInfo *image_info, Image *image, ++ ExceptionInfo *exception) + { + (void) exception; + #ifdef HAVE_ACQUIREIMAGE +- AcquireNextImage( image_info, image ); ++ AcquireNextImage(image_info, image); + #else /*!HAVE_ACQUIREIMAGE*/ + /* IM5-ish and GraphicsMagick use AllocateNextImage(). + */ +- AllocateNextImage( image_info, image ); ++ AllocateNextImage(image_info, image); + #endif + } + + int +-magick_set_image_size( Image *image, const size_t width, const size_t height, +- ExceptionInfo *exception ) ++magick_set_image_size(Image *image, const size_t width, const size_t height, ++ ExceptionInfo *exception) + { + #ifdef HAVE_SETIMAGEEXTENT +- int result = SetImageExtent( image, width, height ); ++ int result = SetImageExtent(image, width, height); + + /* IM6 sets the exception on the image. + */ +- if( !result ) +- magick_inherit_exception( exception, image ); ++ if (!result) ++ magick_inherit_exception(exception, image); + +- return( result ); +-#else /*!HAVE_SETIMAGEEXTENT*/ ++ return (result); ++#else /*!HAVE_SETIMAGEEXTENT*/ + (void) exception; + image->columns = width; + image->rows = height; +@@ -353,118 +353,117 @@ magick_set_image_size( Image *image, const size_t width, const size_t height, + * SetImageExtent(), but GM does not really have an equivalent. Just + * always return True. + */ +- return( MagickTrue ); ++ return (MagickTrue); + #endif /*HAVE_SETIMAGEEXTENT*/ + } + + int +-magick_import_pixels( Image *image, const ssize_t x, const ssize_t y, ++magick_import_pixels(Image *image, const ssize_t x, const ssize_t y, + const size_t width, const size_t height, const char *map, +- const StorageType type, const void *pixels, ExceptionInfo *exception ) ++ const StorageType type, const void *pixels, ExceptionInfo *exception) + { + #ifdef HAVE_IMPORTIMAGEPIXELS +- return( ImportImagePixels( image, x, y, width, height, map, +- type, pixels ) ); +-#else /*!HAVE_IMPORTIMAGEPIXELS*/ ++ return (ImportImagePixels(image, x, y, width, height, map, ++ type, pixels)); ++#else /*!HAVE_IMPORTIMAGEPIXELS*/ + Image *constitute_image; + unsigned int storage_type_depth; + +- g_assert( image ); +- g_assert( image->signature == MagickSignature ); ++ g_assert(image); ++ g_assert(image->signature == MagickSignature); + +- constitute_image = ConstituteImage( width, height, map, type, +- pixels, &image->exception ); +- if( !constitute_image ) +- return( MagickFalse ); ++ constitute_image = ConstituteImage(width, height, map, type, ++ pixels, &image->exception); ++ if (!constitute_image) ++ return (MagickFalse); + + /* image needs to inherit these fields from constitute_image. + */ +- switch( type ) { +- case CharPixel: +- storage_type_depth = sizeof( unsigned char ) * 8; ++ switch (type) { ++ case CharPixel: ++ storage_type_depth = sizeof(unsigned char) * 8; + break; + +- case ShortPixel: +- storage_type_depth = sizeof( unsigned short ) * 8; ++ case ShortPixel: ++ storage_type_depth = sizeof(unsigned short) * 8; + break; + +- case IntegerPixel: +- storage_type_depth = sizeof( unsigned short ) * 8; ++ case IntegerPixel: ++ storage_type_depth = sizeof(unsigned short) * 8; + break; + +- case LongPixel: +- storage_type_depth = sizeof( unsigned long ) * 8; ++ case LongPixel: ++ storage_type_depth = sizeof(unsigned long) * 8; + break; + +- case FloatPixel: +- storage_type_depth = sizeof( float ) * 8; ++ case FloatPixel: ++ storage_type_depth = sizeof(float) * 8; + break; + +- case DoublePixel: +- storage_type_depth = sizeof( double ) * 8; ++ case DoublePixel: ++ storage_type_depth = sizeof(double) * 8; + break; + + default: + storage_type_depth = QuantumDepth; + break; +- + } +- image->depth = VIPS_MIN( storage_type_depth, QuantumDepth ); ++ image->depth = VIPS_MIN(storage_type_depth, QuantumDepth); + image->matte = constitute_image->matte; + +- (void) CompositeImage( image, CopyCompositeOp, constitute_image, x, y ); ++ (void) CompositeImage(image, CopyCompositeOp, constitute_image, x, y); + +- DestroyImage( constitute_image ); ++ DestroyImage(constitute_image); + +- return( image->exception.severity == UndefinedException ); ++ return (image->exception.severity == UndefinedException); + #endif /*HAVE_IMPORTIMAGEPIXELS*/ + } + + void * +-magick_images_to_blob( const ImageInfo *image_info, Image *images, +- size_t *length, ExceptionInfo *exception ) ++magick_images_to_blob(const ImageInfo *image_info, Image *images, ++ size_t *length, ExceptionInfo *exception) + { + #ifdef HAVE_IMAGESTOBLOB +- return( ImagesToBlob( image_info, images, length, exception ) ); ++ return (ImagesToBlob(image_info, images, length, exception)); + #else +- return( ImageToBlob( image_info, images, length, exception ) ); ++ return (ImageToBlob(image_info, images, length, exception)); + #endif /*HAVE_IMAGESTOBLOB*/ + } + + void +-magick_set_property( Image *image, const char *property, const char *value, +- ExceptionInfo *exception ) ++magick_set_property(Image *image, const char *property, const char *value, ++ ExceptionInfo *exception) + { + (void) exception; + #ifdef HAVE_SETIMAGEPROPERTY +- (void) SetImageProperty( image, property, value ); +-#else /*!HAVE_SETIMAGEPROPERTY*/ +- (void) SetImageAttribute( image, property, value ); ++ (void) SetImageProperty(image, property, value); ++#else /*!HAVE_SETIMAGEPROPERTY*/ ++ (void) SetImageAttribute(image, property, value); + #endif /*HAVE_SETIMAGEPROPERTY*/ + } + + int +-magick_set_profile( Image *image, ++magick_set_profile(Image *image, + const char *name, const void *data, size_t length, +- ExceptionInfo *exception ) ++ ExceptionInfo *exception) + { + int result; + + #ifdef HAVE_BLOBTOSTRINGINFO + StringInfo *string; + +- string = BlobToStringInfo( data, length ); +- result = SetImageProfile( image, name, string ); +- DestroyStringInfo( string ); +-#else /*!HAVE_BLOBTOSTRINGINFO*/ +- result = SetImageProfile( image, name, data, length ); ++ string = BlobToStringInfo(data, length); ++ result = SetImageProfile(image, name, string); ++ DestroyStringInfo(string); ++#else /*!HAVE_BLOBTOSTRINGINFO*/ ++ result = SetImageProfile(image, name, data, length); + #endif /*HAVE_BLOBTOSTRINGINFO*/ + +- return( result ); ++ return (result); + } + + void * +-magick_profile_map( Image *image, MagickMapProfileFn fn, void *a ) ++magick_profile_map(Image *image, MagickMapProfileFn fn, void *a) + { + const char *name; + const void *data; +@@ -472,37 +471,37 @@ magick_profile_map( Image *image, MagickMapProfileFn fn, void *a ) + void *result; + + #ifdef HAVE_RESETIMAGEPROFILEITERATOR +- ResetImageProfileIterator( image ); +- while( (name = GetNextImageProfile( image )) ) { ++ ResetImageProfileIterator(image); ++ while ((name = GetNextImageProfile(image))) { + const StringInfo *profile; + +- profile = GetImageProfile( image, name ); +- data = GetStringInfoDatum( profile ); +- length = GetStringInfoLength( profile ); +- if( (result = fn( image, name, data, length, a )) ) +- return( result ); ++ profile = GetImageProfile(image, name); ++ data = GetStringInfoDatum(profile); ++ length = GetStringInfoLength(profile); ++ if ((result = fn(image, name, data, length, a))) ++ return (result); + } +-#else /*!HAVE_RESETIMAGEPROFILEITERATOR*/ +-{ +- ImageProfileIterator *iter; +- +- iter = AllocateImageProfileIterator( image ); +- while( NextImageProfile( iter, +- &name, (const unsigned char **) &data, &length ) ) { +- if( (result = fn( image, name, data, length, a )) ) { +- DeallocateImageProfileIterator( iter ); +- return( result ); ++#else /*!HAVE_RESETIMAGEPROFILEITERATOR*/ ++ { ++ ImageProfileIterator *iter; ++ ++ iter = AllocateImageProfileIterator(image); ++ while (NextImageProfile(iter, ++ &name, (const unsigned char **) &data, &length)) { ++ if ((result = fn(image, name, data, length, a))) { ++ DeallocateImageProfileIterator(iter); ++ return (result); ++ } + } ++ DeallocateImageProfileIterator(iter); + } +- DeallocateImageProfileIterator( iter ); +-} + #endif /*HAVE_RESETIMAGEPROFILEITERATOR*/ + +- return( NULL ); ++ return (NULL); + } + + ExceptionInfo * +-magick_acquire_exception( void ) ++magick_acquire_exception(void) + { + ExceptionInfo *exception; + +@@ -510,45 +509,45 @@ magick_acquire_exception( void ) + /* IM6+ + */ + exception = AcquireExceptionInfo(); +-#else /*!HAVE_ACQUIREEXCEPTIONINFO*/ ++#else /*!HAVE_ACQUIREEXCEPTIONINFO*/ + /* gm + */ +- exception = g_new( ExceptionInfo, 1 ); +- GetExceptionInfo( exception ); ++ exception = g_new(ExceptionInfo, 1); ++ GetExceptionInfo(exception); + #endif /*HAVE_ACQUIREEXCEPTIONINFO*/ + +- return( exception ); ++ return (exception); + } + + void +-magick_destroy_exception( ExceptionInfo *exception ) ++magick_destroy_exception(ExceptionInfo *exception) + { + #ifdef HAVE_ACQUIREEXCEPTIONINFO + /* IM6+ will free the exception in destroy. + */ +- VIPS_FREEF( DestroyExceptionInfo, exception ); +-#else /*!HAVE_ACQUIREEXCEPTIONINFO*/ ++ VIPS_FREEF(DestroyExceptionInfo, exception); ++#else /*!HAVE_ACQUIREEXCEPTIONINFO*/ + /* gm and very old IM need to free the memory too. + */ +- if( exception ) { +- DestroyExceptionInfo( exception ); +- g_free( exception ); ++ if (exception) { ++ DestroyExceptionInfo(exception); ++ g_free(exception); + } + #endif /*HAVE_ACQUIREEXCEPTIONINFO*/ + } + + void +-magick_inherit_exception( ExceptionInfo *exception, Image *image ) ++magick_inherit_exception(ExceptionInfo *exception, Image *image) + { + #ifdef HAVE_INHERITEXCEPTION +- InheritException( exception, &image->exception ); ++ InheritException(exception, &image->exception); + #endif /*HAVE_INHERITEXCEPTION*/ + } + + void +-magick_set_number_scenes( ImageInfo *image_info, int scene, int number_scenes ) ++magick_set_number_scenes(ImageInfo *image_info, int scene, int number_scenes) + { +-#ifdef HAVE_NUMBER_SCENES ++#ifdef HAVE_NUMBER_SCENES + /* I can't find docs for these fields, but this seems to work. + */ + char page[256]; +@@ -558,8 +557,8 @@ magick_set_number_scenes( ImageInfo *image_info, int scene, int number_scenes ) + + /* Some IMs must have the string version set as well. + */ +- vips_snprintf( page, 256, "%d-%d", scene, scene + number_scenes ); +- image_info->scenes = g_strdup( page ); ++ vips_snprintf(page, 256, "%d-%d", scene, scene + number_scenes); ++ image_info->scenes = g_strdup(page); + #else /*!HAVE_NUMBER_SCENES*/ + /* This works with GM 1.2.31 and probably others. + */ +@@ -569,38 +568,38 @@ magick_set_number_scenes( ImageInfo *image_info, int scene, int number_scenes ) + } + + int +-magick_optimize_image_layers( Image **images, ExceptionInfo *exception ) ++magick_optimize_image_layers(Image **images, ExceptionInfo *exception) + { + #ifdef HAVE_OPTIMIZEPLUSIMAGELAYERS + Image *tmp; + +- tmp = OptimizePlusImageLayers(*images, exception ); ++ tmp = OptimizePlusImageLayers(*images, exception); + +- if ( exception->severity != UndefinedException ) ++ if (exception->severity != UndefinedException) + return MagickFalse; + +- VIPS_FREEF( DestroyImageList, *images ); ++ VIPS_FREEF(DestroyImageList, *images); + + *images = tmp; + + return MagickTrue; +-#else /*!HAVE_OPTIMIZEPLUSIMAGELAYERS*/ +- g_warning( "%s", _( "layer optimization is not supported by " +- "your version of libMagick" ) ); ++#else /*!HAVE_OPTIMIZEPLUSIMAGELAYERS*/ ++ g_warning("%s", _("layer optimization is not supported by " ++ "your version of libMagick")); + return MagickTrue; + #endif /*HAVE_OPTIMIZEPLUSIMAGELAYERS*/ + } + + int +-magick_optimize_image_transparency( const Image *images, +- ExceptionInfo *exception ) ++magick_optimize_image_transparency(const Image *images, ++ ExceptionInfo *exception) + { + #ifdef HAVE_OPTIMIZEIMAGETRANSPARENCY + OptimizeImageTransparency(images, exception); +- return ( exception->severity == UndefinedException ); +-#else /*!HAVE_OPTIMIZEIMAGETRANSPARENCY*/ +- g_warning( "%s", _( "transparency optimization is not supported by " +- "your version of libMagick" ) ); ++ return (exception->severity == UndefinedException); ++#else /*!HAVE_OPTIMIZEIMAGETRANSPARENCY*/ ++ g_warning("%s", _("transparency optimization is not supported by " ++ "your version of libMagick")); + return MagickTrue; + #endif /*HAVE_OPTIMIZEIMAGETRANSPARENCY*/ + } +@@ -608,36 +607,36 @@ magick_optimize_image_transparency( const Image *images, + /* Does a few bytes look like a file IM can handle? + */ + gboolean +-magick_ismagick( const unsigned char *bytes, size_t length ) ++magick_ismagick(const unsigned char *bytes, size_t length) + { + magick_genesis(); + + /* Try with our custom sniffers first. + */ + #ifdef HAVE_GETIMAGEMAGICK3 +-{ +- char format[MaxTextExtent]; ++ { ++ char format[MaxTextExtent]; + +- return( magick_sniff( bytes, length ) || +- GetImageMagick( bytes, length, format ) ); +-} ++ return (magick_sniff(bytes, length) || ++ GetImageMagick(bytes, length, format)); ++ } + #else /*!HAVE_GETIMAGEMAGICK3*/ + /* The GM one returns a static string. + */ +- return( magick_sniff( bytes, length ) || +- GetImageMagick( bytes, length ) ); ++ return (magick_sniff(bytes, length) || ++ GetImageMagick(bytes, length)); + #endif + } + + int +-magick_quantize_images( Image *images, +- const size_t depth, ExceptionInfo *exception ) ++magick_quantize_images(Image *images, ++ const size_t depth, ExceptionInfo *exception) + { + QuantizeInfo info; + +- GetQuantizeInfo( &info ); ++ GetQuantizeInfo(&info); + info.number_colors = (1 << depth); +- return QuantizeImages( &info, images ); ++ return QuantizeImages(&info, images); + } + + #endif /*HAVE_MAGICK6*/ +@@ -645,17 +644,17 @@ magick_quantize_images( Image *images, + #if defined(HAVE_MAGICK6) || defined(HAVE_MAGICK7) + + void +-magick_set_image_option( ImageInfo *image_info, +- const char *name, const char *value ) ++magick_set_image_option(ImageInfo *image_info, ++ const char *name, const char *value) + { + #ifdef HAVE_SETIMAGEOPTION +- SetImageOption( image_info, name, value ); ++ SetImageOption(image_info, name, value); + #endif /*HAVE_SETIMAGEOPTION*/ + } + + typedef struct _MagickColorspaceTypeNames { + ColorspaceType colorspace; +- const char *name; ++ const char *name; + } MagickColorspaceTypeNames; + + static MagickColorspaceTypeNames magick_colorspace_names[] = { +@@ -677,8 +676,8 @@ static MagickColorspaceTypeNames magick_colorspace_names[] = { + { YPbPrColorspace, "YPbPrColorspace" }, + { YUVColorspace, "YUVColorspace" }, + +- /* More recent imagemagicks add these. +- */ ++/* More recent imagemagicks add these. ++ */ + #ifdef HAVE_CMYCOLORSPACE + { CMYColorspace, "CMYColorspace" }, + { HCLColorspace, "HCLColorspace" }, +@@ -709,108 +708,108 @@ static MagickColorspaceTypeNames magick_colorspace_names[] = { + }; + + const char * +-magick_ColorspaceType2str( ColorspaceType colorspace ) ++magick_ColorspaceType2str(ColorspaceType colorspace) + { + int i; + +- for( i = 0; i < VIPS_NUMBER( magick_colorspace_names ); i++ ) +- if( magick_colorspace_names[i].colorspace == colorspace ) +- return( magick_colorspace_names[i].name ); ++ for (i = 0; i < VIPS_NUMBER(magick_colorspace_names); i++) ++ if (magick_colorspace_names[i].colorspace == colorspace) ++ return (magick_colorspace_names[i].name); + +- return( "" ); ++ return (""); + } + + void +-magick_vips_error( const char *domain, ExceptionInfo *exception ) +-{ +- if( exception ) { +- if( exception->reason && +- exception->description ) +- vips_error( domain, _( "libMagick error: %s %s" ), +- exception->reason, exception->description ); +- else if( exception->reason ) +- vips_error( domain, _( "libMagick error: %s" ), +- exception->reason ); +- else +- vips_error( domain, "%s", _( "libMagick error:" ) ); ++magick_vips_error(const char *domain, ExceptionInfo *exception) ++{ ++ if (exception) { ++ if (exception->reason && ++ exception->description) ++ vips_error(domain, _("libMagick error: %s %s"), ++ exception->reason, exception->description); ++ else if (exception->reason) ++ vips_error(domain, _("libMagick error: %s"), ++ exception->reason); ++ else ++ vips_error(domain, "%s", _("libMagick error:")); + } + } + + static void * +-magick_genesis_cb( void *client ) ++magick_genesis_cb(void *client) + { + ExceptionInfo *exception; + + #ifdef DEBUG +- printf( "magick_genesis_cb:\n" ); ++ printf("magick_genesis_cb:\n"); + #endif /*DEBUG*/ + +-#if defined(HAVE_MAGICKCOREGENESIS) || defined(HAVE_MAGICK7) +- MagickCoreGenesis( vips_get_argv0(), MagickFalse ); +-#else /*!HAVE_MAGICKCOREGENESIS*/ +- InitializeMagick( vips_get_argv0() ); ++#if defined(HAVE_MAGICKCOREGENESIS) || defined(HAVE_MAGICK7) ++ MagickCoreGenesis(vips_get_argv0(), MagickFalse); ++#else /*!HAVE_MAGICKCOREGENESIS*/ ++ InitializeMagick(vips_get_argv0()); + #endif /*HAVE_MAGICKCOREGENESIS*/ + + /* This forces *magick to init all loaders. We have to do this so we +- * can sniff files with GetImageMagick(). ++ * can sniff files with GetImageMagick(). + * + * We don't care about errors from magickinit. + */ + exception = magick_acquire_exception(); +- (void) GetMagickInfo( "*", exception ); ++ (void) GetMagickInfo("*", exception); + magick_destroy_exception(exception); + +- return( NULL ); ++ return (NULL); + } + + void +-magick_genesis( void ) ++magick_genesis(void) + { + static GOnce once = G_ONCE_INIT; + +- VIPS_ONCE( &once, magick_genesis_cb, NULL ); ++ VIPS_ONCE(&once, magick_genesis_cb, NULL); + } + + /* Set vips metadata from a magick profile. + */ + static void * +-magick_set_vips_profile_cb( Image *image, +- const char *name, const void *data, size_t length, void *a ) ++magick_set_vips_profile_cb(Image *image, ++ const char *name, const void *data, size_t length, void *a) + { + VipsImage *im = (VipsImage *) a; + + char name_text[256]; +- VipsBuf vips_name = VIPS_BUF_STATIC( name_text ); +- +- if( g_ascii_strcasecmp( name, "XMP" ) == 0 ) +- vips_buf_appendf( &vips_name, VIPS_META_XMP_NAME ); +- else if( g_ascii_strcasecmp( name, "IPTC" ) == 0 ) +- vips_buf_appendf( &vips_name, VIPS_META_IPTC_NAME ); +- else if( g_ascii_strcasecmp( name, "ICC" ) == 0 ) +- vips_buf_appendf( &vips_name, VIPS_META_ICC_NAME ); +- else if( g_ascii_strcasecmp( name, "EXIF" ) == 0 ) +- vips_buf_appendf( &vips_name, VIPS_META_EXIF_NAME ); ++ VipsBuf vips_name = VIPS_BUF_STATIC(name_text); ++ ++ if (g_ascii_strcasecmp(name, "XMP") == 0) ++ vips_buf_appendf(&vips_name, VIPS_META_XMP_NAME); ++ else if (g_ascii_strcasecmp(name, "IPTC") == 0) ++ vips_buf_appendf(&vips_name, VIPS_META_IPTC_NAME); ++ else if (g_ascii_strcasecmp(name, "ICC") == 0) ++ vips_buf_appendf(&vips_name, VIPS_META_ICC_NAME); ++ else if (g_ascii_strcasecmp(name, "EXIF") == 0) ++ vips_buf_appendf(&vips_name, VIPS_META_EXIF_NAME); + else +- vips_buf_appendf( &vips_name, "magickprofile-%s", name ); ++ vips_buf_appendf(&vips_name, "magickprofile-%s", name); + +- vips_image_set_blob_copy( im, +- vips_buf_all( &vips_name ), data, length ); ++ vips_image_set_blob_copy(im, ++ vips_buf_all(&vips_name), data, length); + +- if( strcmp( name, "exif" ) == 0 ) +- (void) vips__exif_parse( im ); ++ if (strcmp(name, "exif") == 0) ++ (void) vips__exif_parse(im); + +- return( NULL ); ++ return (NULL); + } + + /* Set vips metadata from ImageMagick profiles. + */ + int +-magick_set_vips_profile( VipsImage *im, Image *image ) ++magick_set_vips_profile(VipsImage *im, Image *image) + { +- if( magick_profile_map( image, magick_set_vips_profile_cb, im ) ) +- return( -1 ); ++ if (magick_profile_map(image, magick_set_vips_profile_cb, im)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + typedef struct { +@@ -819,55 +818,55 @@ typedef struct { + } CopyProfileInfo; + + static void * +-magick_set_magick_profile_cb( VipsImage *im, +- const char *name, GValue *value, CopyProfileInfo *info ) ++magick_set_magick_profile_cb(VipsImage *im, ++ const char *name, GValue *value, CopyProfileInfo *info) + { + char txt[256]; +- VipsBuf buf = VIPS_BUF_STATIC( txt ); ++ VipsBuf buf = VIPS_BUF_STATIC(txt); + const void *data; + size_t length; + +- if( strcmp( name, VIPS_META_XMP_NAME ) == 0 ) +- vips_buf_appendf( &buf, "XMP" ); +- else if( strcmp( name, VIPS_META_IPTC_NAME ) == 0 ) +- vips_buf_appendf( &buf, "IPTC" ); +- else if( strcmp( name, VIPS_META_ICC_NAME ) == 0 ) +- vips_buf_appendf( &buf, "ICC" ); +- else if( strcmp( name, VIPS_META_EXIF_NAME ) == 0 ) +- vips_buf_appendf( &buf, "EXIF" ); +- else if( vips_isprefix( "magickprofile-", name ) ) +- vips_buf_appendf( &buf, +- "%s", name + strlen( "magickprofile-" ) ); ++ if (strcmp(name, VIPS_META_XMP_NAME) == 0) ++ vips_buf_appendf(&buf, "XMP"); ++ else if (strcmp(name, VIPS_META_IPTC_NAME) == 0) ++ vips_buf_appendf(&buf, "IPTC"); ++ else if (strcmp(name, VIPS_META_ICC_NAME) == 0) ++ vips_buf_appendf(&buf, "ICC"); ++ else if (strcmp(name, VIPS_META_EXIF_NAME) == 0) ++ vips_buf_appendf(&buf, "EXIF"); ++ else if (vips_isprefix("magickprofile-", name)) ++ vips_buf_appendf(&buf, ++ "%s", name + strlen("magickprofile-")); + +- if( vips_buf_is_empty( &buf ) ) +- return( NULL ); +- if( !vips_image_get_typeof( im, name ) ) +- return( NULL ); +- if( vips_image_get_blob( im, name, &data, &length ) ) +- return( im ); ++ if (vips_buf_is_empty(&buf)) ++ return (NULL); ++ if (!vips_image_get_typeof(im, name)) ++ return (NULL); ++ if (vips_image_get_blob(im, name, &data, &length)) ++ return (im); + +- if( !magick_set_profile( info->image, +- vips_buf_all( &buf ), data, length, info->exception ) ) +- return( im ); ++ if (!magick_set_profile(info->image, ++ vips_buf_all(&buf), data, length, info->exception)) ++ return (im); + +- return( NULL ); ++ return (NULL); + } + + /* Set magick metadata from a VipsImage. + */ + int +-magick_set_magick_profile( Image *image, +- VipsImage *im, ExceptionInfo *exception ) ++magick_set_magick_profile(Image *image, ++ VipsImage *im, ExceptionInfo *exception) + { + CopyProfileInfo info; + + info.image = image; + info.exception = exception; +- if( vips_image_map( im, +- (VipsImageMapFn) magick_set_magick_profile_cb, &info ) ) +- return( -1 ); ++ if (vips_image_map(im, ++ (VipsImageMapFn) magick_set_magick_profile_cb, &info)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + #endif /*defined(HAVE_MAGICK6) || defined(HAVE_MAGICK7)*/ +diff --git a/libvips/foreign/magick.h b/libvips/foreign/magick.h +index f4aecb4c7d..8a289521a0 100644 +--- a/libvips/foreign/magick.h ++++ b/libvips/foreign/magick.h +@@ -1,36 +1,36 @@ + /* Common functions for interfacing with ImageMagick. + * +- * 22/12/17 dlemstra ++ * 22/12/17 dlemstra + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +-#if defined(HAVE_MAGICK6) || defined (HAVE_MAGICK7) ++#if defined(HAVE_MAGICK6) || defined(HAVE_MAGICK7) + + #ifdef HAVE_MAGICK6 + #include +@@ -42,54 +42,54 @@ + #define MaxPathExtent MagickPathExtent + #endif /*HAVE_MAGICK7*/ + +-Image *magick_acquire_image( const ImageInfo *image_info, +- ExceptionInfo *exception ); +-void magick_acquire_next_image( const ImageInfo *image_info, +- Image *image, ExceptionInfo *exception ); +-int magick_set_image_size( Image *image, +- const size_t width, const size_t height, ExceptionInfo *exception ); +-int magick_import_pixels( Image *image, const ssize_t x, const ssize_t y, ++Image *magick_acquire_image(const ImageInfo *image_info, ++ ExceptionInfo *exception); ++void magick_acquire_next_image(const ImageInfo *image_info, ++ Image *image, ExceptionInfo *exception); ++int magick_set_image_size(Image *image, ++ const size_t width, const size_t height, ExceptionInfo *exception); ++int magick_import_pixels(Image *image, const ssize_t x, const ssize_t y, + const size_t width, const size_t height, const char *map, +- const StorageType type,const void *pixels, ExceptionInfo *exception ); +-void *magick_images_to_blob( const ImageInfo *image_info, Image *images, +- size_t *length, ExceptionInfo *exception ); +-void magick_set_property( Image *image, +- const char *property, const char *value, ExceptionInfo *exception ); +-typedef void *(*MagickMapProfileFn)( Image *image, +- const char *name, const void *data, size_t length, void *a ); +-void *magick_profile_map( Image *image, MagickMapProfileFn fn, void *a ); +-int magick_set_profile( Image *image, +- const char *name, const void *data, size_t length, +- ExceptionInfo *exception ); +- +-void magick_set_image_option( ImageInfo *image_info, +- const char *name, const char *value ); +-void magick_set_number_scenes( ImageInfo *image_info, +- int scene, int number_scenes ); +- +-const char *magick_ColorspaceType2str( ColorspaceType colorspace ); +- +-ExceptionInfo *magick_acquire_exception( void ); +-void magick_destroy_exception( ExceptionInfo *exception ); +-void magick_inherit_exception( ExceptionInfo *exception, Image *image ); +- +-void magick_sniff_bytes( ImageInfo *image_info, +- const unsigned char *bytes, size_t length ); +-void magick_sniff_file( ImageInfo *image_info, const char *filename ); +-void magick_vips_error( const char *domain, ExceptionInfo *exception ); +- +-void magick_genesis( void ); +- +-int magick_set_vips_profile( VipsImage *im, Image *image ); +-int magick_set_magick_profile( Image *image, +- VipsImage *im, ExceptionInfo *exception ); +- +-int magick_optimize_image_layers( Image **images, ExceptionInfo *exception ); +-int magick_optimize_image_transparency( const Image *images, +- ExceptionInfo *exception ); +- +-int magick_quantize_images( Image *images, const size_t depth, ExceptionInfo *exception ); +- +-gboolean magick_ismagick( const unsigned char *bytes, size_t length ); ++ const StorageType type, const void *pixels, ExceptionInfo *exception); ++void *magick_images_to_blob(const ImageInfo *image_info, Image *images, ++ size_t *length, ExceptionInfo *exception); ++void magick_set_property(Image *image, ++ const char *property, const char *value, ExceptionInfo *exception); ++typedef void *(*MagickMapProfileFn)(Image *image, ++ const char *name, const void *data, size_t length, void *a); ++void *magick_profile_map(Image *image, MagickMapProfileFn fn, void *a); ++int magick_set_profile(Image *image, ++ const char *name, const void *data, size_t length, ++ ExceptionInfo *exception); ++ ++void magick_set_image_option(ImageInfo *image_info, ++ const char *name, const char *value); ++void magick_set_number_scenes(ImageInfo *image_info, ++ int scene, int number_scenes); ++ ++const char *magick_ColorspaceType2str(ColorspaceType colorspace); ++ ++ExceptionInfo *magick_acquire_exception(void); ++void magick_destroy_exception(ExceptionInfo *exception); ++void magick_inherit_exception(ExceptionInfo *exception, Image *image); ++ ++void magick_sniff_bytes(ImageInfo *image_info, ++ const unsigned char *bytes, size_t length); ++void magick_sniff_file(ImageInfo *image_info, const char *filename); ++void magick_vips_error(const char *domain, ExceptionInfo *exception); ++ ++void magick_genesis(void); ++ ++int magick_set_vips_profile(VipsImage *im, Image *image); ++int magick_set_magick_profile(Image *image, ++ VipsImage *im, ExceptionInfo *exception); ++ ++int magick_optimize_image_layers(Image **images, ExceptionInfo *exception); ++int magick_optimize_image_transparency(const Image *images, ++ ExceptionInfo *exception); ++ ++int magick_quantize_images(Image *images, const size_t depth, ExceptionInfo *exception); ++ ++gboolean magick_ismagick(const unsigned char *bytes, size_t length); + + #endif /*HAVE_MAGICK6*/ +diff --git a/libvips/foreign/magick2vips.c b/libvips/foreign/magick2vips.c +index d39657541a..3145231aef 100644 +--- a/libvips/foreign/magick2vips.c ++++ b/libvips/foreign/magick2vips.c +@@ -1,5 +1,5 @@ + /* Read a file using libMagick +- * ++ * + * 7/1/03 JC + * - from im_tiff2vips + * 3/2/03 JC +@@ -16,7 +16,7 @@ + * - set RGB16/GREY16 if appropriate + * 10/8/07 + * - support 32/64 bit imagemagick too +- * 21/2/08 ++ * 21/2/08 + * - use MaxRGB if QuantumRange is missing (thanks Bob) + * - look for MAGICKCORE_HDRI_SUPPORT (thanks Marcel) + * - use image->attributes if GetNextImageAttribute() is missing +@@ -25,7 +25,7 @@ + * 17/3/09 + * - reset dcm:display-range to help DICOM read + * 20/4/09 +- * - argh libMagick uses 255 == transparent ... we must invert all ++ * - argh libMagick uses 255 == transparent ... we must invert all + * alpha channels + * 12/5/09 + * - fix signed/unsigned warnings +@@ -41,12 +41,12 @@ + * 11/6/13 + * - add @all_frames option, off by default + * 4/12/14 Lovell +- * - add @density option ++ * - add @density option + * 16/2/15 mcuelenaere + * - add blob read + * 26/2/15 + * - close the read down early for a header read ... this saves an +- * fd during file read, handy for large numbers of input images ++ * fd during file read, handy for large numbers of input images + * 14/2/16 + * - add @page option, 0 by default + * 18/4/16 +@@ -72,28 +72,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -126,13 +126,13 @@ + /* pre-float Magick used to call this MaxRGB. + */ + #if !defined(QuantumRange) +-# define QuantumRange MaxRGB ++#define QuantumRange MaxRGB + #endif + + /* And this used to be UseHDRI. + */ + #if MAGICKCORE_HDRI_SUPPORT +-# define UseHDRI 1 ++#define UseHDRI 1 + #endif + + /* What we track during a read call. +@@ -141,7 +141,7 @@ typedef struct _Read { + char *filename; + VipsImage *im; + const void *buf; +- size_t len; ++ size_t len; + int page; + int n; + +@@ -168,34 +168,34 @@ typedef struct _Read { + /* Can be called many times. + */ + static void +-read_free( Read *read ) ++read_free(Read *read) + { + #ifdef DEBUG +- printf( "magick2vips: read_free: %s\n", read->filename ); ++ printf("magick2vips: read_free: %s\n", read->filename); + #endif /*DEBUG*/ + +- VIPS_FREE( read->filename ); +- VIPS_FREEF( DestroyImageList, read->image ); +- VIPS_FREEF( DestroyImageInfo, read->image_info ); +- VIPS_FREE( read->frames ); +- VIPS_FREEF( magick_destroy_exception, read->exception ); +- VIPS_FREEF( vips_g_mutex_free, read->lock ); ++ VIPS_FREE(read->filename); ++ VIPS_FREEF(DestroyImageList, read->image); ++ VIPS_FREEF(DestroyImageInfo, read->image_info); ++ VIPS_FREE(read->frames); ++ VIPS_FREEF(magick_destroy_exception, read->exception); ++ VIPS_FREEF(vips_g_mutex_free, read->lock); + } + + /* Can be called many times. + */ + static int +-read_close( VipsImage *im, Read *read ) ++read_close(VipsImage *im, Read *read) + { +- read_free( read ); ++ read_free(read); + +- return( 0 ); ++ return (0); + } + + static Read * +-read_new( const char *filename, VipsImage *im, +- const void *buf, const size_t len, +- const char *density, int page, int n ) ++read_new(const char *filename, VipsImage *im, ++ const void *buf, const size_t len, ++ const char *density, int page, int n) + { + Read *read; + +@@ -204,83 +204,83 @@ read_new( const char *filename, VipsImage *im, + /* IM doesn't use the -1 means end-of-file convention, change it to a + * very large number. + */ +- if( n == -1 ) ++ if (n == -1) + n = 10000000; + +- if( !(read = VIPS_NEW( im, Read )) ) +- return( NULL ); +- read->filename = filename ? g_strdup( filename ) : NULL; ++ if (!(read = VIPS_NEW(im, Read))) ++ return (NULL); ++ read->filename = filename ? g_strdup(filename) : NULL; + read->buf = buf; + read->len = len; + read->page = page; + read->n = n; + read->im = im; + read->image = NULL; +- read->image_info = CloneImageInfo( NULL ); +- read->exception = magick_acquire_exception(); ++ read->image_info = CloneImageInfo(NULL); ++ read->exception = magick_acquire_exception(); + read->n_pages = 0; + read->n_frames = 0; + read->frames = NULL; + read->frame_height = 0; + read->lock = vips_g_mutex_new(); + +- g_signal_connect( im, "close", G_CALLBACK( read_close ), read ); ++ g_signal_connect(im, "close", G_CALLBACK(read_close), read); + +- if( !read->image_info ) +- return( NULL ); ++ if (!read->image_info) ++ return (NULL); + +- if( filename ) +- vips_strncpy( read->image_info->filename, +- filename, MaxTextExtent ); ++ if (filename) ++ vips_strncpy(read->image_info->filename, ++ filename, MaxTextExtent); + + /* Any extra file format detection. + */ +- if( filename ) +- magick_sniff_file( read->image_info, filename ); +- if( buf ) +- magick_sniff_bytes( read->image_info, buf, len ); ++ if (filename) ++ magick_sniff_file(read->image_info, filename); ++ if (buf) ++ magick_sniff_bytes(read->image_info, buf, len); + + /* Canvas resolution for rendering vector formats like SVG. + */ +- VIPS_SETSTR( read->image_info->density, density ); ++ VIPS_SETSTR(read->image_info->density, density); + + /* When reading DICOM images, we want to ignore any + * window_center/_width setting, since it may put pixels outside the +- * 0-65535 range and lose data. ++ * 0-65535 range and lose data. + * + * These window settings are attached as vips metadata, so our caller + * can interpret them if it wants. + */ +- magick_set_image_option( read->image_info, +- "dcm:display-range", "reset" ); ++ magick_set_image_option(read->image_info, ++ "dcm:display-range", "reset"); + +- if( read->page > 0 ) +- magick_set_number_scenes( read->image_info, +- read->page, read->n ); ++ if (read->page > 0) ++ magick_set_number_scenes(read->image_info, ++ read->page, read->n); + + #ifdef DEBUG +- printf( "magick2vips: read_new: %s\n", read->filename ); ++ printf("magick2vips: read_new: %s\n", read->filename); + #endif /*DEBUG*/ + +- return( read ); ++ return (read); + } + + static int +-get_bands( Image *image ) ++get_bands(Image *image) + { + int bands; +- ImageType type = GetImageType( image, &image->exception ); ++ ImageType type = GetImageType(image, &image->exception); + +- switch( type ) { ++ switch (type) { + case BilevelType: + case GrayscaleType: + bands = 1; + break; + + case GrayscaleMatteType: +- /* ImageMagick also has PaletteBilevelMatteType, but GraphicsMagick +- * does not. Skip for portability. +- */ ++ /* ImageMagick also has PaletteBilevelMatteType, but GraphicsMagick ++ * does not. Skip for portability. ++ */ + bands = 2; + break; + +@@ -300,16 +300,16 @@ get_bands( Image *image ) + break; + + default: +- vips_error( "magick2vips", _( "unsupported image type %d" ), +- (int) type ); +- return( -1 ); ++ vips_error("magick2vips", _("unsupported image type %d"), ++ (int) type); ++ return (-1); + } + +- return( bands ); ++ return (bands); + } + + static int +-parse_header( Read *read ) ++parse_header(Read *read) + { + VipsImage *im = read->im; + Image *image = read->image; +@@ -319,73 +319,73 @@ parse_header( Read *read ) + int i; + + #ifdef DEBUG +- printf( "parse_header: filename = %s\n", read->filename ); +- printf( "GetImageChannelDepth(AllChannels) = %zd\n", +- GetImageChannelDepth( image, AllChannels, &image->exception ) ); +- printf( "GetImageDepth() = %zd\n", +- GetImageDepth( image, &image->exception ) ); +- printf( "image->depth = %zd\n", image->depth ); +- printf( "GetImageType() = %d\n", +- GetImageType( image, &image->exception ) ); +- printf( "IsGrayImage() = %d\n", +- IsGrayImage( image, &image->exception ) ); +- printf( "IsMonochromeImage() = %d\n", +- IsMonochromeImage( image, &image->exception ) ); +- printf( "IsOpaqueImage() = %d\n", +- IsOpaqueImage( image, &image->exception ) ); +- printf( "image->columns = %zd\n", image->columns ); +- printf( "image->rows = %zd\n", image->rows ); ++ printf("parse_header: filename = %s\n", read->filename); ++ printf("GetImageChannelDepth(AllChannels) = %zd\n", ++ GetImageChannelDepth(image, AllChannels, &image->exception)); ++ printf("GetImageDepth() = %zd\n", ++ GetImageDepth(image, &image->exception)); ++ printf("image->depth = %zd\n", image->depth); ++ printf("GetImageType() = %d\n", ++ GetImageType(image, &image->exception)); ++ printf("IsGrayImage() = %d\n", ++ IsGrayImage(image, &image->exception)); ++ printf("IsMonochromeImage() = %d\n", ++ IsMonochromeImage(image, &image->exception)); ++ printf("IsOpaqueImage() = %d\n", ++ IsOpaqueImage(image, &image->exception)); ++ printf("image->columns = %zd\n", image->columns); ++ printf("image->rows = %zd\n", image->rows); + #endif /*DEBUG*/ + + im->Xsize = image->columns; + im->Ysize = image->rows; + read->frame_height = image->rows; +- im->Bands = get_bands( image ); +- if( im->Xsize <= 0 || ++ im->Bands = get_bands(image); ++ if (im->Xsize <= 0 || + im->Ysize <= 0 || + im->Bands <= 0 || + im->Xsize >= VIPS_MAX_COORD || + im->Ysize >= VIPS_MAX_COORD || +- im->Bands >= VIPS_MAX_COORD ) { +- vips_error( "magick2vips", +- _( "bad image dimensions %d x %d pixels, %d bands" ), +- im->Xsize, im->Ysize, im->Bands ); +- return( -1 ); ++ im->Bands >= VIPS_MAX_COORD) { ++ vips_error("magick2vips", ++ _("bad image dimensions %d x %d pixels, %d bands"), ++ im->Xsize, im->Ysize, im->Bands); ++ return (-1); + } + +- /* Depth can be 'fractional'. ++ /* Depth can be 'fractional'. + * + * You'd think we should use +- * GetImageDepth() but that seems unreliable. 16-bit mono DICOM images ++ * GetImageDepth() but that seems unreliable. 16-bit mono DICOM images + * are reported as depth 1, for example. + * + * Try GetImageChannelDepth(), maybe that works. + */ +- depth = GetImageChannelDepth( image, AllChannels, &image->exception ); ++ depth = GetImageChannelDepth(image, AllChannels, &image->exception); + im->BandFmt = -1; +- if( depth >= 1 && depth <= 8 ) ++ if (depth >= 1 && depth <= 8) + im->BandFmt = VIPS_FORMAT_UCHAR; +- if( depth >= 9 && depth <= 16 ) ++ if (depth >= 9 && depth <= 16) + im->BandFmt = VIPS_FORMAT_USHORT; + #ifdef UseHDRI +- if( depth == 32 ) ++ if (depth == 32) + im->BandFmt = VIPS_FORMAT_FLOAT; +- if( depth == 64 ) ++ if (depth == 64) + im->BandFmt = VIPS_FORMAT_DOUBLE; +-#else /*!UseHDRI*/ +- if( depth == 32 ) ++#else /*!UseHDRI*/ ++ if (depth == 32) + im->BandFmt = VIPS_FORMAT_UINT; + #endif /*UseHDRI*/ + +- if( im->BandFmt == -1 ) { +- vips_error( "magick2vips", _( "unsupported bit depth %d" ), +- (int) depth ); +- return( -1 ); ++ if (im->BandFmt == -1) { ++ vips_error("magick2vips", _("unsupported bit depth %d"), ++ (int) depth); ++ return (-1); + } + +- switch( image->colorspace ) { ++ switch (image->colorspace) { + case GRAYColorspace: +- if( im->BandFmt == VIPS_FORMAT_USHORT ) ++ if (im->BandFmt == VIPS_FORMAT_USHORT) + im->Type = VIPS_INTERPRETATION_GREY16; + else + im->Type = VIPS_INTERPRETATION_B_W; +@@ -393,7 +393,7 @@ parse_header( Read *read ) + + case sRGBColorspace: + case RGBColorspace: +- if( im->BandFmt == VIPS_FORMAT_USHORT ) ++ if (im->BandFmt == VIPS_FORMAT_USHORT) + im->Type = VIPS_INTERPRETATION_RGB16; + else + im->Type = VIPS_INTERPRETATION_sRGB; +@@ -404,12 +404,12 @@ parse_header( Read *read ) + break; + + default: +- vips_error( "magick2vips", _( "unsupported colorspace %d" ), +- (int) image->colorspace ); +- return( -1 ); ++ vips_error("magick2vips", _("unsupported colorspace %d"), ++ (int) image->colorspace); ++ return (-1); + } + +- switch( image->units ) { ++ switch (image->units) { + case PixelsPerInchResolution: + im->Xres = image->x_resolution / 25.4; + im->Yres = image->y_resolution / 25.4; +@@ -430,91 +430,91 @@ parse_header( Read *read ) + */ + im->Coding = VIPS_CODING_NONE; + +- if( vips_image_pipelinev( im, VIPS_DEMAND_STYLE_SMALLTILE, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(im, VIPS_DEMAND_STYLE_SMALLTILE, NULL)) ++ return (-1); + + /* Set vips metadata from ImageMagick profiles. + */ +- if( magick_set_vips_profile( im, image ) ) +- return( -1 ); ++ if (magick_set_vips_profile(im, image)) ++ return (-1); + + #ifdef HAVE_RESETIMAGEPROPERTYITERATOR +-{ +- char *key; ++ { ++ char *key; + +- /* This is the most recent imagemagick API, test for this first. +- */ +- ResetImagePropertyIterator( image ); +- while( (key = GetNextImageProperty( image )) ) { +- char name_text[256]; +- VipsBuf name = VIPS_BUF_STATIC( name_text ); +- +- vips_buf_appendf( &name, "magick-%s", key ); +- vips_image_set_string( im, +- vips_buf_all( &name ), GetImageProperty( image, key ) ); ++ /* This is the most recent imagemagick API, test for this first. ++ */ ++ ResetImagePropertyIterator(image); ++ while ((key = GetNextImageProperty(image))) { ++ char name_text[256]; ++ VipsBuf name = VIPS_BUF_STATIC(name_text); ++ ++ vips_buf_appendf(&name, "magick-%s", key); ++ vips_image_set_string(im, ++ vips_buf_all(&name), GetImageProperty(image, key)); ++ } + } +-} + #elif defined(HAVE_RESETIMAGEATTRIBUTEITERATOR) +-{ +- const ImageAttribute *attr; ++ { ++ const ImageAttribute *attr; + +- /* magick6.1-ish and later, deprecated in 6.5ish. +- */ +- ResetImageAttributeIterator( image ); +- while( (attr = GetNextImageAttribute( image )) ) { +- char name_text[256]; +- VipsBuf name = VIPS_BUF_STATIC( name_text ); ++ /* magick6.1-ish and later, deprecated in 6.5ish. ++ */ ++ ResetImageAttributeIterator(image); ++ while ((attr = GetNextImageAttribute(image))) { ++ char name_text[256]; ++ VipsBuf name = VIPS_BUF_STATIC(name_text); + +- vips_buf_appendf( &name, "magick-%s", attr->key ); +- vips_image_set_string( im, vips_buf_all( &name ), attr->value ); ++ vips_buf_appendf(&name, "magick-%s", attr->key); ++ vips_image_set_string(im, vips_buf_all(&name), attr->value); ++ } + } +-} + #else +-{ +- const ImageAttribute *attr; ++ { ++ const ImageAttribute *attr; + +- /* GraphicsMagick is missing the iterator: we have to loop ourselves. +- * ->attributes is marked as private in the header, but there's no +- * getter so we have to access it directly. +- */ +- for( attr = image->attributes; attr; attr = attr->next ) { +- char name_text[256]; +- VipsBuf name = VIPS_BUF_STATIC( name_text ); ++ /* GraphicsMagick is missing the iterator: we have to loop ourselves. ++ * ->attributes is marked as private in the header, but there's no ++ * getter so we have to access it directly. ++ */ ++ for (attr = image->attributes; attr; attr = attr->next) { ++ char name_text[256]; ++ VipsBuf name = VIPS_BUF_STATIC(name_text); + +- vips_buf_appendf( &name, "magick-%s", attr->key ); +- vips_image_set_string( im, vips_buf_all( &name ), attr->value ); ++ vips_buf_appendf(&name, "magick-%s", attr->key); ++ vips_image_set_string(im, vips_buf_all(&name), attr->value); ++ } + } +-} +-#endif ++#endif + +- /* Something like "BMP". +- */ +- if( strlen( read->image->magick ) > 0 ) +- vips_image_set_string( im, "magick-format", +- read->image->magick ); ++ /* Something like "BMP". ++ */ ++ if (strlen(read->image->magick) > 0) ++ vips_image_set_string(im, "magick-format", ++ read->image->magick); + + /* Do we have a set of equal-sized frames? Append them. + +- FIXME ... there must be an attribute somewhere from dicom read ++ FIXME ... there must be an attribute somewhere from dicom read + which says this is a volumetric image + + */ +- read->n_pages = GetImageListLength( image ); ++ read->n_pages = GetImageListLength(image); + read->n_frames = 0; +- for( p = image; p; (p = GetNextImageInList( p )) ) { +- int p_depth = +- GetImageChannelDepth( p, AllChannels, &p->exception ); ++ for (p = image; p; (p = GetNextImageInList(p))) { ++ int p_depth = ++ GetImageChannelDepth(p, AllChannels, &p->exception); + +- if( p->columns != (unsigned int) im->Xsize || ++ if (p->columns != (unsigned int) im->Xsize || + p->rows != (unsigned int) im->Ysize || +- get_bands( p ) != im->Bands || +- p_depth != depth ) { ++ get_bands(p) != im->Bands || ++ p_depth != depth) { + #ifdef DEBUG +- printf( "frame %d differs\n", read->n_frames ); +- printf( "%zdx%zd, %d bands\n", +- p->columns, p->rows, get_bands( p ) ); +- printf( "first frame is %dx%d, %d bands\n", +- im->Xsize, im->Ysize, im->Bands ); ++ printf("frame %d differs\n", read->n_frames); ++ printf("%zdx%zd, %d bands\n", ++ p->columns, p->rows, get_bands(p)); ++ printf("first frame is %dx%d, %d bands\n", ++ im->Xsize, im->Ysize, im->Bands); + #endif /*DEBUG*/ + + break; +@@ -522,39 +522,39 @@ parse_header( Read *read ) + + read->n_frames += 1; + } +- if( p ) ++ if (p) + /* Nope ... just do the first image in the list. + */ + read->n_frames = 1; + + #ifdef DEBUG +- printf( "will read %d frames\n", read->n_frames ); ++ printf("will read %d frames\n", read->n_frames); + #endif /*DEBUG*/ + +- if( read->n != -1 ) +- read->n_frames = VIPS_MIN( read->n_frames, read->n ); ++ if (read->n != -1) ++ read->n_frames = VIPS_MIN(read->n_frames, read->n); + + /* Record frame pointers. + */ +- if( !(read->frames = VIPS_ARRAY( NULL, read->n_frames, Image * )) ) +- return( -1 ); ++ if (!(read->frames = VIPS_ARRAY(NULL, read->n_frames, Image *))) ++ return (-1); + p = image; +- for( i = 0; i < read->n_frames; i++ ) { ++ for (i = 0; i < read->n_frames; i++) { + read->frames[i] = p; +- p = GetNextImageInList( p ); ++ p = GetNextImageInList(p); + } + +- if( read->n_frames > 1 ) { +- vips_image_set_int( im, VIPS_META_PAGE_HEIGHT, im->Ysize ); ++ if (read->n_frames > 1) { ++ vips_image_set_int(im, VIPS_META_PAGE_HEIGHT, im->Ysize); + im->Ysize *= read->n_frames; + } + +- vips_image_set_int( im, VIPS_META_N_PAGES, read->n_pages ); ++ vips_image_set_int(im, VIPS_META_N_PAGES, read->n_pages); + +- vips_image_set_int( im, VIPS_META_ORIENTATION, +- VIPS_CLIP( 1, image->orientation, 8 ) ); ++ vips_image_set_int(im, VIPS_META_ORIENTATION, ++ VIPS_CLIP(1, image->orientation, 8)); + +- return( 0 ); ++ return (0); + } + + /* Divide by this to get 0 - MAX from a Quantum. Eg. consider QuantumRange == +@@ -562,72 +562,78 @@ parse_header( Read *read ) + * this can't be zero (if QuantumRange < MAX) .. can happen if we have a Q8 + * ImageMagick trying to represent a 16-bit image. + */ +-#define SCALE( MAX ) \ +- (QuantumRange < (MAX) ? \ +- 1 : \ +- ((QuantumRange + 1) / ((MAX) + 1))) +- +-#define GRAY_LOOP( TYPE, MAX ) { \ +- TYPE *q = (TYPE *) q8; \ +- \ +- for( x = 0; x < n; x++ ) \ +- q[x] = pixels[x].green / SCALE( MAX ); \ +-} ++#define SCALE(MAX) \ ++ (QuantumRange < (MAX) ? 1 : ((QuantumRange + 1) / ((MAX) + 1))) ++ ++#define GRAY_LOOP(TYPE, MAX) \ ++ { \ ++ TYPE *q = (TYPE *) q8; \ ++\ ++ for (x = 0; x < n; x++) \ ++ q[x] = pixels[x].green / SCALE(MAX); \ ++ } + +-#define GRAYA_LOOP( TYPE, MAX ) { \ +- TYPE *q = (TYPE *) q8; \ +- \ +- for( x = 0; x < n; x++ ) { \ +- q[0] = pixels[x].green / SCALE( MAX ); \ +- q[1] = MAX - pixels[x].opacity / SCALE( MAX ); \ +- \ +- q += 2; \ +- } \ +-} ++#define GRAYA_LOOP(TYPE, MAX) \ ++ { \ ++ TYPE *q = (TYPE *) q8; \ ++\ ++ for (x = 0; x < n; x++) { \ ++ q[0] = pixels[x].green / SCALE(MAX); \ ++ q[1] = MAX - pixels[x].opacity / SCALE(MAX); \ ++\ ++ q += 2; \ ++ } \ ++ } + +-#define RGB_LOOP( TYPE, MAX ) { \ +- TYPE *q = (TYPE *) q8; \ +- \ +- for( x = 0; x < n; x++ ) { \ +- q[0] = pixels[x].red / SCALE( MAX ); \ +- q[1] = pixels[x].green / SCALE( MAX ); \ +- q[2] = pixels[x].blue / SCALE( MAX ); \ +- \ +- q += 3; \ +- } \ +-} ++#define RGB_LOOP(TYPE, MAX) \ ++ { \ ++ TYPE *q = (TYPE *) q8; \ ++\ ++ for (x = 0; x < n; x++) { \ ++ q[0] = pixels[x].red / SCALE(MAX); \ ++ q[1] = pixels[x].green / SCALE(MAX); \ ++ q[2] = pixels[x].blue / SCALE(MAX); \ ++\ ++ q += 3; \ ++ } \ ++ } + +-#define RGBA_LOOP( TYPE, MAX ) { \ +- TYPE *q = (TYPE *) q8; \ +- \ +- for( x = 0; x < n; x++ ) { \ +- q[0] = pixels[x].red / SCALE( MAX ); \ +- q[1] = pixels[x].green / SCALE( MAX ); \ +- q[2] = pixels[x].blue / SCALE( MAX ); \ +- q[3] = MAX - pixels[x].opacity / SCALE( MAX ); \ +- \ +- q += 4; \ +- } \ +-} ++#define RGBA_LOOP(TYPE, MAX) \ ++ { \ ++ TYPE *q = (TYPE *) q8; \ ++\ ++ for (x = 0; x < n; x++) { \ ++ q[0] = pixels[x].red / SCALE(MAX); \ ++ q[1] = pixels[x].green / SCALE(MAX); \ ++ q[2] = pixels[x].blue / SCALE(MAX); \ ++ q[3] = MAX - pixels[x].opacity / SCALE(MAX); \ ++\ ++ q += 4; \ ++ } \ ++ } + + static void +-unpack_pixels( VipsImage *im, VipsPel *q8, PixelPacket *pixels, int n ) ++unpack_pixels(VipsImage *im, VipsPel *q8, PixelPacket *pixels, int n) + { + int x; + +- switch( im->Bands ) { ++ switch (im->Bands) { + case 1: + /* Gray. + */ +- switch( im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- GRAY_LOOP( unsigned char, 255 ); break; +- case VIPS_FORMAT_USHORT: +- GRAY_LOOP( unsigned short, 65535 ); break; +- case VIPS_FORMAT_UINT: +- GRAY_LOOP( unsigned int, 4294967295UL ); break; +- case VIPS_FORMAT_DOUBLE: +- GRAY_LOOP( double, QuantumRange ); break; ++ switch (im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ GRAY_LOOP(unsigned char, 255); ++ break; ++ case VIPS_FORMAT_USHORT: ++ GRAY_LOOP(unsigned short, 65535); ++ break; ++ case VIPS_FORMAT_UINT: ++ GRAY_LOOP(unsigned int, 4294967295UL); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ GRAY_LOOP(double, QuantumRange); ++ break; + + default: + g_assert_not_reached(); +@@ -637,15 +643,19 @@ unpack_pixels( VipsImage *im, VipsPel *q8, PixelPacket *pixels, int n ) + case 2: + /* Gray plus alpha. + */ +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_UCHAR: +- GRAYA_LOOP( unsigned char, 255 ); break; +- case VIPS_FORMAT_USHORT: +- GRAYA_LOOP( unsigned short, 65535 ); break; +- case VIPS_FORMAT_UINT: +- GRAYA_LOOP( unsigned int, 4294967295UL ); break; +- case VIPS_FORMAT_DOUBLE: +- GRAYA_LOOP( double, QuantumRange ); break; ++ GRAYA_LOOP(unsigned char, 255); ++ break; ++ case VIPS_FORMAT_USHORT: ++ GRAYA_LOOP(unsigned short, 65535); ++ break; ++ case VIPS_FORMAT_UINT: ++ GRAYA_LOOP(unsigned int, 4294967295UL); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ GRAYA_LOOP(double, QuantumRange); ++ break; + + default: + g_assert_not_reached(); +@@ -655,15 +665,19 @@ unpack_pixels( VipsImage *im, VipsPel *q8, PixelPacket *pixels, int n ) + case 3: + /* RGB. + */ +- switch( im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- RGB_LOOP( unsigned char, 255 ); break; +- case VIPS_FORMAT_USHORT: +- RGB_LOOP( unsigned short, 65535 ); break; +- case VIPS_FORMAT_UINT: +- RGB_LOOP( unsigned int, 4294967295UL ); break; +- case VIPS_FORMAT_DOUBLE: +- RGB_LOOP( double, QuantumRange ); break; ++ switch (im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ RGB_LOOP(unsigned char, 255); ++ break; ++ case VIPS_FORMAT_USHORT: ++ RGB_LOOP(unsigned short, 65535); ++ break; ++ case VIPS_FORMAT_UINT: ++ RGB_LOOP(unsigned int, 4294967295UL); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ RGB_LOOP(double, QuantumRange); ++ break; + + default: + g_assert_not_reached(); +@@ -673,15 +687,19 @@ unpack_pixels( VipsImage *im, VipsPel *q8, PixelPacket *pixels, int n ) + case 4: + /* RGBA or CMYK. + */ +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_UCHAR: +- RGBA_LOOP( unsigned char, 255 ); break; +- case VIPS_FORMAT_USHORT: +- RGBA_LOOP( unsigned short, 65535 ); break; +- case VIPS_FORMAT_UINT: +- RGBA_LOOP( unsigned int, 4294967295UL ); break; +- case VIPS_FORMAT_DOUBLE: +- RGBA_LOOP( double, QuantumRange ); break; ++ RGBA_LOOP(unsigned char, 255); ++ break; ++ case VIPS_FORMAT_USHORT: ++ RGBA_LOOP(unsigned short, 65535); ++ break; ++ case VIPS_FORMAT_UINT: ++ RGBA_LOOP(unsigned int, 4294967295UL); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ RGBA_LOOP(double, QuantumRange); ++ break; + + default: + g_assert_not_reached(); +@@ -694,39 +712,39 @@ unpack_pixels( VipsImage *im, VipsPel *q8, PixelPacket *pixels, int n ) + } + + static PixelPacket * +-get_pixels( Image *image, int left, int top, int width, int height ) ++get_pixels(Image *image, int left, int top, int width, int height) + { + PixelPacket *pixels; + + #ifdef HAVE_GETVIRTUALPIXELS +- if( !(pixels = (PixelPacket *) GetVirtualPixels( image, +- left, top, width, height, &image->exception )) ) ++ if (!(pixels = (PixelPacket *) GetVirtualPixels(image, ++ left, top, width, height, &image->exception))) + #else +- if( !(pixels = GetImagePixels( image, left, top, width, height )) ) ++ if (!(pixels = GetImagePixels(image, left, top, width, height))) + #endif +- return( NULL ); ++ return (NULL); + + /* Can't happen if red/green/blue are doubles. + */ + #ifndef UseHDRI + /* Unpack palette. + */ +- if( image->storage_class == PseudoClass ) { ++ if (image->storage_class == PseudoClass) { + #ifdef HAVE_GETVIRTUALPIXELS +- IndexPacket *indexes = (IndexPacket *) +- GetVirtualIndexQueue( image ); ++ IndexPacket *indexes = (IndexPacket *) ++ GetVirtualIndexQueue(image); + #else + /* Was GetIndexes(), but that's now deprecated. + */ +- IndexPacket *indexes = AccessMutableIndexes( image ); ++ IndexPacket *indexes = AccessMutableIndexes(image); + #endif + + int i; + +- for( i = 0; i < width * height; i++ ) { ++ for (i = 0; i < width * height; i++) { + IndexPacket x = indexes[i]; + +- if( x < image->colors ) { ++ if (x < image->colors) { + pixels[i].red = image->colormap[x].red; + pixels[i].green = image->colormap[x].green; + pixels[i].blue = image->colormap[x].blue; +@@ -735,197 +753,197 @@ get_pixels( Image *image, int left, int top, int width, int height ) + } + #endif /*UseHDRI*/ + +- return( pixels ); ++ return (pixels); + } + + static int +-magick_fill_region( VipsRegion *out, +- void *seq, void *a, void *b, gboolean *stop ) ++magick_fill_region(VipsRegion *out, ++ void *seq, void *a, void *b, gboolean *stop) + { + Read *read = (Read *) a; + VipsRect *r = &out->valid; + int y; + +- for( y = 0; y < r->height; y++ ) { ++ for (y = 0; y < r->height; y++) { + int top = r->top + y; + int frame = top / read->frame_height; + int line = top % read->frame_height; + + PixelPacket *pixels; + +- vips__worker_lock( read->lock ); ++ vips__worker_lock(read->lock); + +- pixels = get_pixels( read->frames[frame], +- r->left, line, r->width, 1 ); ++ pixels = get_pixels(read->frames[frame], ++ r->left, line, r->width, 1); + +- g_mutex_unlock( read->lock ); ++ g_mutex_unlock(read->lock); + +- if( !pixels ) { +- vips_foreign_load_invalidate( read->im ); +- vips_error( "magick2vips", +- "%s", _( "unable to read pixels" ) ); +- return( -1 ); ++ if (!pixels) { ++ vips_foreign_load_invalidate(read->im); ++ vips_error("magick2vips", ++ "%s", _("unable to read pixels")); ++ return (-1); + } + +- unpack_pixels( read->im, VIPS_REGION_ADDR( out, r->left, top ), +- pixels, r->width ); ++ unpack_pixels(read->im, VIPS_REGION_ADDR(out, r->left, top), ++ pixels, r->width); + } + +- return( 0 ); ++ return (0); + } + + int +-vips__magick_read( const char *filename, +- VipsImage *out, const char *density, int page, int n ) ++vips__magick_read(const char *filename, ++ VipsImage *out, const char *density, int page, int n) + { + Read *read; + + #ifdef DEBUG +- printf( "magick2vips: vips__magick_read: %s\n", filename ); ++ printf("magick2vips: vips__magick_read: %s\n", filename); + #endif /*DEBUG*/ + +- if( !(read = read_new( filename, out, NULL, n, density, page, n )) ) +- return( -1 ); ++ if (!(read = read_new(filename, out, NULL, n, density, page, n))) ++ return (-1); + + #ifdef DEBUG +- printf( "magick2vips: calling ReadImage() ...\n" ); ++ printf("magick2vips: calling ReadImage() ...\n"); + #endif /*DEBUG*/ + +- read->image = ReadImage( read->image_info, read->exception ); +- if( !read->image ) { +- magick_vips_error( "magick2vips", read->exception ); +- vips_error( "magick2vips", +- _( "unable to read file \"%s\"" ), filename ); +- return( -1 ); ++ read->image = ReadImage(read->image_info, read->exception); ++ if (!read->image) { ++ magick_vips_error("magick2vips", read->exception); ++ vips_error("magick2vips", ++ _("unable to read file \"%s\""), filename); ++ return (-1); + } + +- if( parse_header( read ) ) +- return( -1 ); +- if( vips_image_generate( out, +- NULL, magick_fill_region, NULL, read, NULL ) ) +- return( -1 ); ++ if (parse_header(read)) ++ return (-1); ++ if (vips_image_generate(out, ++ NULL, magick_fill_region, NULL, read, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-vips__magick_read_header( const char *filename, +- VipsImage *out, const char *density, int page, int n ) ++vips__magick_read_header(const char *filename, ++ VipsImage *out, const char *density, int page, int n) + { + Read *read; + + #ifdef DEBUG +- printf( "vips__magick_read_header: %s\n", filename ); ++ printf("vips__magick_read_header: %s\n", filename); + #endif /*DEBUG*/ + +- if( !(read = read_new( filename, out, NULL, 0, density, page, n )) ) +- return( -1 ); ++ if (!(read = read_new(filename, out, NULL, 0, density, page, n))) ++ return (-1); + + #ifdef DEBUG +- printf( "vips__magick_read_header: reading image ...\n" ); ++ printf("vips__magick_read_header: reading image ...\n"); + #endif /*DEBUG*/ + + /* It would be great if we could PingImage and just read the header, + * but sadly many IM coders do not support ping. The critical one for +- * us is DICOM. TGA also has issues. ++ * us is DICOM. TGA also has issues. + */ +- read->image = ReadImage( read->image_info, read->exception ); +- if( !read->image ) { +- magick_vips_error( "magick2vips", read->exception ); +- vips_error( "magick2vips", +- _( "unable to read file \"%s\"" ), filename ); +- return( -1 ); ++ read->image = ReadImage(read->image_info, read->exception); ++ if (!read->image) { ++ magick_vips_error("magick2vips", read->exception); ++ vips_error("magick2vips", ++ _("unable to read file \"%s\""), filename); ++ return (-1); + } + +- if( parse_header( read ) ) +- return( -1 ); ++ if (parse_header(read)) ++ return (-1); + +- if( out->Xsize <= 0 || +- out->Ysize <= 0 ) { +- vips_error( "magick2vips", "%s", _( "bad image size" ) ); +- return( -1 ); ++ if (out->Xsize <= 0 || ++ out->Ysize <= 0) { ++ vips_error("magick2vips", "%s", _("bad image size")); ++ return (-1); + } + + /* Just a header read: we can free the read early and save an fd. + */ +- read_free( read ); ++ read_free(read); + +- return( 0 ); ++ return (0); + } + + int +-vips__magick_read_buffer( const void *buf, const size_t len, +- VipsImage *out, const char *density, int page, int n ) ++vips__magick_read_buffer(const void *buf, const size_t len, ++ VipsImage *out, const char *density, int page, int n) + { + Read *read; + + #ifdef DEBUG +- printf( "magick2vips: vips__magick_read_buffer: %p %zu\n", buf, len ); ++ printf("magick2vips: vips__magick_read_buffer: %p %zu\n", buf, len); + #endif /*DEBUG*/ + +- if( !(read = read_new( NULL, out, buf, len, density, page, n )) ) +- return( -1 ); ++ if (!(read = read_new(NULL, out, buf, len, density, page, n))) ++ return (-1); + + #ifdef DEBUG +- printf( "magick2vips: calling BlobToImage() ...\n" ); ++ printf("magick2vips: calling BlobToImage() ...\n"); + #endif /*DEBUG*/ + +- read->image = BlobToImage( read->image_info, +- buf, len, read->exception ); +- if( !read->image ) { +- magick_vips_error( "magick2vips", read->exception ); +- vips_error( "magick2vips", "%s", _( "unable to read buffer" ) ); +- return( -1 ); ++ read->image = BlobToImage(read->image_info, ++ buf, len, read->exception); ++ if (!read->image) { ++ magick_vips_error("magick2vips", read->exception); ++ vips_error("magick2vips", "%s", _("unable to read buffer")); ++ return (-1); + } + +- if( parse_header( read ) ) +- return( -1 ); +- if( vips_image_generate( out, +- NULL, magick_fill_region, NULL, read, NULL ) ) +- return( -1 ); ++ if (parse_header(read)) ++ return (-1); ++ if (vips_image_generate(out, ++ NULL, magick_fill_region, NULL, read, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-vips__magick_read_buffer_header( const void *buf, const size_t len, +- VipsImage *out, const char *density, int page, int n ) ++vips__magick_read_buffer_header(const void *buf, const size_t len, ++ VipsImage *out, const char *density, int page, int n) + { + Read *read; + + #ifdef DEBUG +- printf( "vips__magick_read_buffer_header: %p %zu\n", buf, len ); ++ printf("vips__magick_read_buffer_header: %p %zu\n", buf, len); + #endif /*DEBUG*/ + +- if( !(read = read_new( NULL, out, buf, len, density, page, n )) ) +- return( -1 ); ++ if (!(read = read_new(NULL, out, buf, len, density, page, n))) ++ return (-1); + + #ifdef DEBUG +- printf( "vips__magick_read_buffer_header: pinging blob ...\n" ); ++ printf("vips__magick_read_buffer_header: pinging blob ...\n"); + #endif /*DEBUG*/ + + /* It would be great if we could PingBlob and just read the header, +- * but sadly many IM coders do not support ping well. The critical one +- * for us is DICOM. TGA also has issues. ++ * but sadly many IM coders do not support ping well. The critical one ++ * for us is DICOM. TGA also has issues. + */ +- read->image = BlobToImage( read->image_info, +- buf, len, read->exception ); +- if( !read->image ) { +- magick_vips_error( "magick2vips", read->exception ); +- vips_error( "magick2vips", "%s", _( "unable to ping blob" ) ); +- return( -1 ); ++ read->image = BlobToImage(read->image_info, ++ buf, len, read->exception); ++ if (!read->image) { ++ magick_vips_error("magick2vips", read->exception); ++ vips_error("magick2vips", "%s", _("unable to ping blob")); ++ return (-1); + } + +- if( parse_header( read ) ) +- return( -1 ); ++ if (parse_header(read)) ++ return (-1); + +- if( out->Xsize <= 0 || +- out->Ysize <= 0 ) { +- vips_error( "magick2vips", "%s", _( "bad image size" ) ); +- return( -1 ); ++ if (out->Xsize <= 0 || ++ out->Ysize <= 0) { ++ vips_error("magick2vips", "%s", _("bad image size")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + #endif /*HAVE_MAGICK6*/ +diff --git a/libvips/foreign/magick6load.c b/libvips/foreign/magick6load.c +index d8552ec814..bcdf973e5c 100644 +--- a/libvips/foreign/magick6load.c ++++ b/libvips/foreign/magick6load.c +@@ -18,28 +18,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -74,35 +74,35 @@ typedef struct _VipsForeignLoadMagick { + */ + gboolean all_frames; + +- char *density; /* Load at this resolution */ +- int page; /* Load this page (frame) */ +- int n; /* Load this many pages */ ++ char *density; /* Load at this resolution */ ++ int page; /* Load this page (frame) */ ++ int n; /* Load this many pages */ + + } VipsForeignLoadMagick; + + typedef VipsForeignLoadClass VipsForeignLoadMagickClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadMagick, vips_foreign_load_magick, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadMagick, vips_foreign_load_magick, ++ VIPS_TYPE_FOREIGN_LOAD); + + static VipsForeignFlags +-vips_foreign_load_magick_get_flags_filename( const char *filename ) ++vips_foreign_load_magick_get_flags_filename(const char *filename) + { +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static VipsForeignFlags +-vips_foreign_load_magick_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_magick_get_flags(VipsForeignLoad *load) + { +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static void +-vips_foreign_load_magick_class_init( VipsForeignLoadMagickClass *class ) ++vips_foreign_load_magick_class_init(VipsForeignLoadMagickClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -110,9 +110,9 @@ vips_foreign_load_magick_class_init( VipsForeignLoadMagickClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "magickload_base"; +- object_class->description = _( "load with ImageMagick" ); ++ object_class->description = _("load with ImageMagick"); + +- /* Don't cache magickload: it can gobble up memory and disc. ++ /* Don't cache magickload: it can gobble up memory and disc. + */ + operation_class->flags |= VIPS_OPERATION_NOCACHE; + +@@ -126,42 +126,41 @@ vips_foreign_load_magick_class_init( VipsForeignLoadMagickClass *class ) + */ + foreign_class->priority = -100; + +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_magick_get_flags_filename; + load_class->get_flags = vips_foreign_load_magick_get_flags; + +- VIPS_ARG_STRING( class, "density", 21, +- _( "Density" ), +- _( "Canvas resolution for rendering vector formats like SVG" ), ++ VIPS_ARG_STRING(class, "density", 21, ++ _("Density"), ++ _("Canvas resolution for rendering vector formats like SVG"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadMagick, density ), +- NULL ); ++ G_STRUCT_OFFSET(VipsForeignLoadMagick, density), ++ NULL); + +- VIPS_ARG_INT( class, "page", 22, +- _( "Page" ), +- _( "First page to load" ), ++ VIPS_ARG_INT(class, "page", 22, ++ _("Page"), ++ _("First page to load"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadMagick, page ), +- 0, 100000, 0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadMagick, page), ++ 0, 100000, 0); + +- VIPS_ARG_INT( class, "n", 23, +- _( "n" ), +- _( "Number of pages to load, -1 for all" ), ++ VIPS_ARG_INT(class, "n", 23, ++ _("n"), ++ _("Number of pages to load, -1 for all"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadMagick, n ), +- -1, 100000, 1 ); ++ G_STRUCT_OFFSET(VipsForeignLoadMagick, n), ++ -1, 100000, 1); + +- VIPS_ARG_BOOL( class, "all_frames", 20, +- _( "All frames" ), +- _( "Read all frames from an image" ), ++ VIPS_ARG_BOOL(class, "all_frames", 20, ++ _("All frames"), ++ _("Read all frames from an image"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignLoadMagick, all_frames ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsForeignLoadMagick, all_frames), ++ FALSE); + } + + static void +-vips_foreign_load_magick_init( VipsForeignLoadMagick *magick ) ++vips_foreign_load_magick_init(VipsForeignLoadMagick *magick) + { + magick->n = 1; + } +@@ -169,59 +168,59 @@ vips_foreign_load_magick_init( VipsForeignLoadMagick *magick ) + typedef struct _VipsForeignLoadMagickFile { + VipsForeignLoadMagick parent_object; + +- char *filename; ++ char *filename; + + } VipsForeignLoadMagickFile; + + typedef VipsForeignLoadMagickClass VipsForeignLoadMagickFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadMagickFile, vips_foreign_load_magick_file, +- vips_foreign_load_magick_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadMagickFile, vips_foreign_load_magick_file, ++ vips_foreign_load_magick_get_type()); + + static gboolean +-ismagick( const char *filename ) ++ismagick(const char *filename) + { + /* Fetch up to the first 100 bytes. Hopefully that'll be enough. + */ + unsigned char buf[100]; + int len; + +- return( (len = vips__get_bytes( filename, buf, 100 )) > 10 && +- magick_ismagick( buf, len ) ); ++ return ((len = vips__get_bytes(filename, buf, 100)) > 10 && ++ magick_ismagick(buf, len)); + } + + /* Unfortunately, libMagick does not support header-only reads very well. See + * + * http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=20017 + * +- * Test especially with BMP, GIF, TGA. So we are forced to read the entire ++ * Test especially with BMP, GIF, TGA. So we are forced to read the entire + * image in the @header() method. + */ + static int +-vips_foreign_load_magick_file_header( VipsForeignLoad *load ) ++vips_foreign_load_magick_file_header(VipsForeignLoad *load) + { + VipsForeignLoadMagick *magick = (VipsForeignLoadMagick *) load; +- VipsForeignLoadMagickFile *magick_file = ++ VipsForeignLoadMagickFile *magick_file = + (VipsForeignLoadMagickFile *) load; + +- if( magick->all_frames ) ++ if (magick->all_frames) + magick->n = -1; + +- if( vips__magick_read( magick_file->filename, +- load->out, magick->density, +- magick->page, magick->n ) ) +- return( -1 ); ++ if (vips__magick_read(magick_file->filename, ++ load->out, magick->density, ++ magick->page, magick->n)) ++ return (-1); + +- VIPS_SETSTR( load->out->filename, magick_file->filename ); ++ VIPS_SETSTR(load->out->filename, magick_file->filename); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_magick_file_class_init( +- VipsForeignLoadMagickFileClass *class ) ++vips_foreign_load_magick_file_class_init( ++ VipsForeignLoadMagickFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -229,23 +228,22 @@ vips_foreign_load_magick_file_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "magickload"; +- object_class->description = _( "load file with ImageMagick" ); ++ object_class->description = _("load file with ImageMagick"); + + load_class->is_a = ismagick; + load_class->header = vips_foreign_load_magick_file_header; + load_class->load = NULL; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadMagickFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadMagickFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_magick_file_init( VipsForeignLoadMagickFile *magick_file ) ++vips_foreign_load_magick_file_init(VipsForeignLoadMagickFile *magick_file) + { + } + +@@ -258,46 +256,46 @@ typedef struct _VipsForeignLoadMagickBuffer { + + typedef VipsForeignLoadMagickClass VipsForeignLoadMagickBufferClass; + +-G_DEFINE_TYPE( VipsForeignLoadMagickBuffer, vips_foreign_load_magick_buffer, +- vips_foreign_load_magick_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadMagickBuffer, vips_foreign_load_magick_buffer, ++ vips_foreign_load_magick_get_type()); + + static gboolean +-vips_foreign_load_magick_buffer_is_a_buffer( const void *buf, size_t len ) ++vips_foreign_load_magick_buffer_is_a_buffer(const void *buf, size_t len) + { +- return( len > 10 && magick_ismagick( (const unsigned char *) buf, len ) ); ++ return (len > 10 && magick_ismagick((const unsigned char *) buf, len)); + } + + /* Unfortunately, libMagick does not support header-only reads very well. See + * + * http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=20017 + * +- * Test especially with BMP, GIF, TGA. So we are forced to read the entire ++ * Test especially with BMP, GIF, TGA. So we are forced to read the entire + * image in the @header() method. + */ + static int +-vips_foreign_load_magick_buffer_header( VipsForeignLoad *load ) ++vips_foreign_load_magick_buffer_header(VipsForeignLoad *load) + { + VipsForeignLoadMagick *magick = (VipsForeignLoadMagick *) load; +- VipsForeignLoadMagickBuffer *magick_buffer = ++ VipsForeignLoadMagickBuffer *magick_buffer = + (VipsForeignLoadMagickBuffer *) load; + +- if( magick->all_frames ) ++ if (magick->all_frames) + magick->n = -1; + +- if( vips__magick_read_buffer( +- magick_buffer->buf->data, magick_buffer->buf->length, +- load->out, magick->density, magick->page, +- magick->n ) ) +- return( -1 ); ++ if (vips__magick_read_buffer( ++ magick_buffer->buf->data, magick_buffer->buf->length, ++ load->out, magick->density, magick->page, ++ magick->n)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_magick_buffer_class_init( +- VipsForeignLoadMagickBufferClass *class ) ++vips_foreign_load_magick_buffer_class_init( ++ VipsForeignLoadMagickBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -305,23 +303,22 @@ vips_foreign_load_magick_buffer_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "magickload_buffer"; +- object_class->description = _( "load buffer with ImageMagick" ); ++ object_class->description = _("load buffer with ImageMagick"); + + load_class->is_a_buffer = vips_foreign_load_magick_buffer_is_a_buffer; + load_class->header = vips_foreign_load_magick_buffer_header; + load_class->load = NULL; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadMagickBuffer, buf ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadMagickBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_load_magick_buffer_init( VipsForeignLoadMagickBuffer *buffer ) ++vips_foreign_load_magick_buffer_init(VipsForeignLoadMagickBuffer *buffer) + { + } + +diff --git a/libvips/foreign/magick7load.c b/libvips/foreign/magick7load.c +index 5a2e330d5e..572813b14e 100644 +--- a/libvips/foreign/magick7load.c ++++ b/libvips/foreign/magick7load.c +@@ -14,28 +14,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -71,9 +71,9 @@ typedef struct _VipsForeignLoadMagick7 { + */ + gboolean all_frames; + +- char *density; /* Load at this resolution */ +- int page; /* Load this page (frame) */ +- int n; /* Load this many pages */ ++ char *density; /* Load at this resolution */ ++ int page; /* Load this page (frame) */ ++ int n; /* Load this many pages */ + + Image *image; + ImageInfo *image_info; +@@ -85,8 +85,8 @@ typedef struct _VipsForeignLoadMagick7 { + + int n_frames; /* Number of frames we will read */ + Image **frames; /* An Image* for each frame */ +- CacheView **cache_view; /* A CacheView for each frame */ +- int frame_height; ++ CacheView **cache_view; /* A CacheView for each frame */ ++ int frame_height; + + /* Mutex to serialise calls to libMagick during threaded read. + */ +@@ -96,12 +96,12 @@ typedef struct _VipsForeignLoadMagick7 { + + typedef VipsForeignLoadClass VipsForeignLoadMagick7Class; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadMagick7, vips_foreign_load_magick7, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadMagick7, vips_foreign_load_magick7, ++ VIPS_TYPE_FOREIGN_LOAD); + + #ifdef DEBUG + static void +-vips_magick7_print_traits( Image *image ) ++vips_magick7_print_traits(Image *image) + { + static const int trait_bits[] = { + CopyPixelTrait, +@@ -114,108 +114,108 @@ vips_magick7_print_traits( Image *image ) + "BlendPixelTrait" + }; + +- int b; +- int i; +- +- printf( "vips_magick7_print_traits: channel traits:\n" ); +- for( b = 0; b < GetPixelChannels( image ); b++ ) { +- PixelChannel channel = +- GetPixelChannelChannel( image, b ); +- PixelTrait traits = +- GetPixelChannelTraits( image, channel ); +- +- printf( "\t%d) ", b ); +- for( i = 0; i < VIPS_NUMBER( trait_bits ); i++ ) +- if( traits & trait_bits[i] ) +- printf( "%s ", trait_names[i] ); +- if( traits == 0 ) +- printf( "undefined" ); +- printf( "\n" ); +- } ++ int b; ++ int i; ++ ++ printf("vips_magick7_print_traits: channel traits:\n"); ++ for (b = 0; b < GetPixelChannels(image); b++) { ++ PixelChannel channel = ++ GetPixelChannelChannel(image, b); ++ PixelTrait traits = ++ GetPixelChannelTraits(image, channel); ++ ++ printf("\t%d) ", b); ++ for (i = 0; i < VIPS_NUMBER(trait_bits); i++) ++ if (traits & trait_bits[i]) ++ printf("%s ", trait_names[i]); ++ if (traits == 0) ++ printf("undefined"); ++ printf("\n"); ++ } + } + + static void +-vips_magick7_print_channel_names( Image *image ) ++vips_magick7_print_channel_names(Image *image) + { + static const int pixel_channels[] = { +- UndefinedPixelChannel, +- RedPixelChannel, +- CyanPixelChannel, +- GrayPixelChannel, +- LPixelChannel, +- LabelPixelChannel, +- YPixelChannel, +- aPixelChannel, +- GreenPixelChannel, +- MagentaPixelChannel, +- CbPixelChannel, +- bPixelChannel, +- BluePixelChannel, +- YellowPixelChannel, +- CrPixelChannel, +- BlackPixelChannel, +- AlphaPixelChannel, +- IndexPixelChannel, +- ReadMaskPixelChannel, +- WriteMaskPixelChannel, +- MetaPixelChannel, +- IntensityPixelChannel, +- CompositePixelChannel, ++ UndefinedPixelChannel, ++ RedPixelChannel, ++ CyanPixelChannel, ++ GrayPixelChannel, ++ LPixelChannel, ++ LabelPixelChannel, ++ YPixelChannel, ++ aPixelChannel, ++ GreenPixelChannel, ++ MagentaPixelChannel, ++ CbPixelChannel, ++ bPixelChannel, ++ BluePixelChannel, ++ YellowPixelChannel, ++ CrPixelChannel, ++ BlackPixelChannel, ++ AlphaPixelChannel, ++ IndexPixelChannel, ++ ReadMaskPixelChannel, ++ WriteMaskPixelChannel, ++ MetaPixelChannel, ++ IntensityPixelChannel, ++ CompositePixelChannel, + SyncPixelChannel + }; + static const char *pixel_channel_names[] = { +- "UndefinedPixelChannel", +- "RedPixelChannel", +- "CyanPixelChannel", +- "GrayPixelChannel", +- "LPixelChannel", +- "LabelPixelChannel", +- "YPixelChannel", +- "aPixelChannel", +- "GreenPixelChannel", +- "MagentaPixelChannel", +- "CbPixelChannel", +- "bPixelChannel", +- "BluePixelChannel", +- "YellowPixelChannel", +- "CrPixelChannel", +- "BlackPixelChannel", +- "AlphaPixelChannel", +- "IndexPixelChannel", +- "ReadMaskPixelChannel", +- "WriteMaskPixelChannel", +- "MetaPixelChannel", +- "IntensityPixelChannel", +- "CompositePixelChannel", +- "SyncPixelChannel", ++ "UndefinedPixelChannel", ++ "RedPixelChannel", ++ "CyanPixelChannel", ++ "GrayPixelChannel", ++ "LPixelChannel", ++ "LabelPixelChannel", ++ "YPixelChannel", ++ "aPixelChannel", ++ "GreenPixelChannel", ++ "MagentaPixelChannel", ++ "CbPixelChannel", ++ "bPixelChannel", ++ "BluePixelChannel", ++ "YellowPixelChannel", ++ "CrPixelChannel", ++ "BlackPixelChannel", ++ "AlphaPixelChannel", ++ "IndexPixelChannel", ++ "ReadMaskPixelChannel", ++ "WriteMaskPixelChannel", ++ "MetaPixelChannel", ++ "IntensityPixelChannel", ++ "CompositePixelChannel", ++ "SyncPixelChannel", + }; + +- int b; +- int i; ++ int b; ++ int i; ++ ++ printf("vips_magick7_print_channel_names: channel names:\n"); ++ for (b = 0; b < GetPixelChannels(image); b++) { ++ PixelChannel channel = ++ GetPixelChannelChannel(image, b); + +- printf( "vips_magick7_print_channel_names: channel names:\n" ); +- for( b = 0; b < GetPixelChannels( image ); b++ ) { +- PixelChannel channel = +- GetPixelChannelChannel( image, b ); +- +- printf( "\t%d) ", b ); +- for( i = 0; i < VIPS_NUMBER( pixel_channels ); i++ ) ++ printf("\t%d) ", b); ++ for (i = 0; i < VIPS_NUMBER(pixel_channels); i++) + /* Don't break on found, many channel names repeat. + */ +- if( channel == pixel_channels[i] ) +- printf( "%s ", pixel_channel_names[i] ); +- printf( "\n" ); +- } ++ if (channel == pixel_channels[i]) ++ printf("%s ", pixel_channel_names[i]); ++ printf("\n"); ++ } + } + + static void +-vips_magick7_print_image_type( Image *image ) ++vips_magick7_print_image_type(Image *image) + { + static const int image_types[] = { + UndefinedType, + BilevelType, + GrayscaleType, +- GrayscaleAlphaType, ++ GrayscaleAlphaType, + PaletteType, + PaletteAlphaType, + TrueColorType, +@@ -230,7 +230,7 @@ vips_magick7_print_image_type( Image *image ) + "UndefinedType", + "BilevelType", + "GrayscaleType", +- "GrayscaleAlphaType", ++ "GrayscaleAlphaType", + "PaletteType", + "PaletteAlphaType", + "TrueColorType", +@@ -243,105 +243,103 @@ vips_magick7_print_image_type( Image *image ) + + int i; + +- for( i = 0; i < VIPS_NUMBER( image_types ); i++ ) +- if( GetImageType( image ) == image_types[i] ) { +- printf( "\t%s\n", image_type_names[i] ); ++ for (i = 0; i < VIPS_NUMBER(image_types); i++) ++ if (GetImageType(image) == image_types[i]) { ++ printf("\t%s\n", image_type_names[i]); + break; + } +- if( i == VIPS_NUMBER( image_types ) ) +- printf( "\tunknown GetImageType()\n" ); ++ if (i == VIPS_NUMBER(image_types)) ++ printf("\tunknown GetImageType()\n"); + } + #endif /*DEBUG*/ + + static VipsForeignFlags +-vips_foreign_load_magick7_get_flags_filename( const char *filename ) ++vips_foreign_load_magick7_get_flags_filename(const char *filename) + { +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static VipsForeignFlags +-vips_foreign_load_magick7_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_magick7_get_flags(VipsForeignLoad *load) + { +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static void +-vips_foreign_load_magick7_dispose( GObject *gobject ) ++vips_foreign_load_magick7_dispose(GObject *gobject) + { + VipsForeignLoadMagick7 *magick7 = (VipsForeignLoadMagick7 *) gobject; + + int i; + + #ifdef DEBUG +- printf( "vips_foreign_load_magick7_dispose: %p\n", gobject ); ++ printf("vips_foreign_load_magick7_dispose: %p\n", gobject); + #endif /*DEBUG*/ + +- for( i = 0; i < magick7->n_frames; i++ ) { +- VIPS_FREEF( DestroyCacheView, magick7->cache_view[i] ); ++ for (i = 0; i < magick7->n_frames; i++) { ++ VIPS_FREEF(DestroyCacheView, magick7->cache_view[i]); + } +- VIPS_FREEF( DestroyImageList, magick7->image ); +- VIPS_FREEF( DestroyImageInfo, magick7->image_info ); +- VIPS_FREE( magick7->frames ); +- VIPS_FREE( magick7->cache_view ); +- VIPS_FREEF( magick_destroy_exception, magick7->exception ); +- VIPS_FREEF( vips_g_mutex_free, magick7->lock ); +- +- G_OBJECT_CLASS( vips_foreign_load_magick7_parent_class )-> +- dispose( gobject ); ++ VIPS_FREEF(DestroyImageList, magick7->image); ++ VIPS_FREEF(DestroyImageInfo, magick7->image_info); ++ VIPS_FREE(magick7->frames); ++ VIPS_FREE(magick7->cache_view); ++ VIPS_FREEF(magick_destroy_exception, magick7->exception); ++ VIPS_FREEF(vips_g_mutex_free, magick7->lock); ++ ++ G_OBJECT_CLASS(vips_foreign_load_magick7_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_load_magick7_build( VipsObject *object ) ++vips_foreign_load_magick7_build(VipsObject *object) + { + VipsForeignLoadMagick7 *magick7 = (VipsForeignLoadMagick7 *) object; + + #ifdef DEBUG +- printf( "vips_foreign_load_magick7_build: %p\n", object ); ++ printf("vips_foreign_load_magick7_build: %p\n", object); + #endif /*DEBUG*/ + + magick_genesis(); + +- magick7->image_info = CloneImageInfo( NULL ); ++ magick7->image_info = CloneImageInfo(NULL); + magick7->exception = magick_acquire_exception(); + magick7->lock = vips_g_mutex_new(); + +- if( !magick7->image_info ) +- return( -1 ); ++ if (!magick7->image_info) ++ return (-1); + +- if( magick7->all_frames ) ++ if (magick7->all_frames) + magick7->n = -1; + + /* Canvas resolution for rendering vector formats like SVG. + */ +- VIPS_SETSTR( magick7->image_info->density, magick7->density ); ++ VIPS_SETSTR(magick7->image_info->density, magick7->density); + + /* When reading DICOM images, we want to ignore any + * window_center/_width setting, since it may put pixels outside the +- * 0-65535 range and lose data. ++ * 0-65535 range and lose data. + * + * These window settings are attached as vips metadata, so our caller + * can interpret them if it wants. + */ +- magick_set_image_option( magick7->image_info, +- "dcm:display-range", "reset" ); ++ magick_set_image_option(magick7->image_info, ++ "dcm:display-range", "reset"); + +- if( magick7->page > 0 ) +- magick_set_number_scenes( magick7->image_info, +- magick7->page, magick7->n ); ++ if (magick7->page > 0) ++ magick_set_number_scenes(magick7->image_info, ++ magick7->page, magick7->n); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_magick7_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_magick7_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_magick7_class_init( VipsForeignLoadMagick7Class *class ) ++vips_foreign_load_magick7_class_init(VipsForeignLoadMagick7Class *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -350,10 +348,10 @@ vips_foreign_load_magick7_class_init( VipsForeignLoadMagick7Class *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "magickload_base"; +- object_class->description = _( "load with ImageMagick7" ); ++ object_class->description = _("load with ImageMagick7"); + object_class->build = vips_foreign_load_magick7_build; + +- /* Don't cache magickload: it can gobble up memory and disc. ++ /* Don't cache magickload: it can gobble up memory and disc. + */ + operation_class->flags |= VIPS_OPERATION_NOCACHE; + +@@ -367,58 +365,57 @@ vips_foreign_load_magick7_class_init( VipsForeignLoadMagick7Class *class ) + */ + foreign_class->priority = -100; + +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_magick7_get_flags_filename; + load_class->get_flags = vips_foreign_load_magick7_get_flags; + +- VIPS_ARG_STRING( class, "density", 20, +- _( "Density" ), +- _( "Canvas resolution for rendering vector formats like SVG" ), ++ VIPS_ARG_STRING(class, "density", 20, ++ _("Density"), ++ _("Canvas resolution for rendering vector formats like SVG"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadMagick7, density ), +- NULL ); ++ G_STRUCT_OFFSET(VipsForeignLoadMagick7, density), ++ NULL); + +- VIPS_ARG_INT( class, "page", 21, +- _( "Page" ), +- _( "First page to load" ), ++ VIPS_ARG_INT(class, "page", 21, ++ _("Page"), ++ _("First page to load"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadMagick7, page ), +- 0, 100000, 0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadMagick7, page), ++ 0, 100000, 0); + +- VIPS_ARG_INT( class, "n", 22, +- _( "n" ), +- _( "Number of pages to load, -1 for all" ), ++ VIPS_ARG_INT(class, "n", 22, ++ _("n"), ++ _("Number of pages to load, -1 for all"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadMagick7, n ), +- -1, 100000, 1 ); ++ G_STRUCT_OFFSET(VipsForeignLoadMagick7, n), ++ -1, 100000, 1); + +- VIPS_ARG_BOOL( class, "all_frames", 23, +- _( "All frames" ), +- _( "Read all frames from an image" ), ++ VIPS_ARG_BOOL(class, "all_frames", 23, ++ _("All frames"), ++ _("Read all frames from an image"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignLoadMagick7, all_frames ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsForeignLoadMagick7, all_frames), ++ FALSE); + } + + static void +-vips_foreign_load_magick7_init( VipsForeignLoadMagick7 *magick7 ) ++vips_foreign_load_magick7_init(VipsForeignLoadMagick7 *magick7) + { + magick7->n = 1; + } + + static void +-vips_foreign_load_magick7_error( VipsForeignLoadMagick7 *magick7 ) ++vips_foreign_load_magick7_error(VipsForeignLoadMagick7 *magick7) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( magick7 ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(magick7); + +- vips_error( class->nickname, _( "Magick: %s %s" ), +- magick7->exception->reason, +- magick7->exception->description ); ++ vips_error(class->nickname, _("Magick: %s %s"), ++ magick7->exception->reason, ++ magick7->exception->description); + } + + static int +-magick7_get_bands( Image *image ) ++magick7_get_bands(Image *image) + { + int bands; + int i; +@@ -427,32 +424,32 @@ magick7_get_bands( Image *image ) + * just the palette ones. + */ + bands = 0; +- for( i = 0; i < GetPixelChannels( image ); i++ ) { +- PixelChannel channel = GetPixelChannelChannel( image, i ); ++ for (i = 0; i < GetPixelChannels(image); i++) { ++ PixelChannel channel = GetPixelChannelChannel(image, i); + +- if( channel != IndexPixelChannel ) ++ if (channel != IndexPixelChannel) + bands += 1; +- } ++ } + +- return( bands ); ++ return (bands); + } + + static int +-vips_foreign_load_magick7_parse( VipsForeignLoadMagick7 *magick7, +- Image *image, VipsImage *out ) ++vips_foreign_load_magick7_parse(VipsForeignLoadMagick7 *magick7, ++ Image *image, VipsImage *out) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( magick7 ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(magick7); + + const char *key; + Image *p; + + #ifdef DEBUG +- printf( "image->depth = %zd\n", image->depth ); +- printf( "GetImageType() = %d\n", GetImageType( image ) ); +- vips_magick7_print_image_type( image ); +- printf( "GetPixelChannels() = %zd\n", GetPixelChannels( image ) ); +- printf( "image->columns = %zd\n", image->columns ); +- printf( "image->rows = %zd\n", image->rows ); ++ printf("image->depth = %zd\n", image->depth); ++ printf("GetImageType() = %d\n", GetImageType(image)); ++ vips_magick7_print_image_type(image); ++ printf("GetPixelChannels() = %zd\n", GetPixelChannels(image)); ++ printf("image->columns = %zd\n", image->columns); ++ printf("image->rows = %zd\n", image->rows); + #endif /*DEBUG*/ + + /* Ysize updated below once we have worked out how many frames to load. +@@ -460,41 +457,41 @@ vips_foreign_load_magick7_parse( VipsForeignLoadMagick7 *magick7, + out->Xsize = image->columns; + out->Ysize = image->rows; + magick7->frame_height = image->rows; +- out->Bands = magick7_get_bands( image ); +- if( out->Xsize <= 0 || ++ out->Bands = magick7_get_bands(image); ++ if (out->Xsize <= 0 || + out->Ysize <= 0 || + out->Bands <= 0 || + out->Xsize >= VIPS_MAX_COORD || + out->Ysize >= VIPS_MAX_COORD || +- out->Bands >= VIPS_MAX_COORD ) { +- vips_error( class->nickname, +- _( "bad image dimensions %d x %d pixels, %d bands" ), +- out->Xsize, out->Ysize, out->Bands ); +- return( -1 ); ++ out->Bands >= VIPS_MAX_COORD) { ++ vips_error(class->nickname, ++ _("bad image dimensions %d x %d pixels, %d bands"), ++ out->Xsize, out->Ysize, out->Bands); ++ return (-1); + } + + /* Depth can be 'fractional'. You'd think we should use +- * GetImageDepth() but that seems to compute something very complex. ++ * GetImageDepth() but that seems to compute something very complex. + */ + out->BandFmt = -1; +- if( image->depth >= 1 && image->depth <= 8 ) ++ if (image->depth >= 1 && image->depth <= 8) + out->BandFmt = VIPS_FORMAT_UCHAR; +- if( image->depth >= 9 && image->depth <= 16 ) ++ if (image->depth >= 9 && image->depth <= 16) + out->BandFmt = VIPS_FORMAT_USHORT; +- if( image->depth == 32 ) ++ if (image->depth == 32) + out->BandFmt = VIPS_FORMAT_FLOAT; +- if( image->depth == 64 ) ++ if (image->depth == 64) + out->BandFmt = VIPS_FORMAT_DOUBLE; + +- if( out->BandFmt == -1 ) { +- vips_error( class->nickname, +- _( "unsupported bit depth %zd" ), image->depth ); +- return( -1 ); ++ if (out->BandFmt == -1) { ++ vips_error(class->nickname, ++ _("unsupported bit depth %zd"), image->depth); ++ return (-1); + } + +- switch( image->colorspace ) { ++ switch (image->colorspace) { + case GRAYColorspace: +- if( out->BandFmt == VIPS_FORMAT_USHORT ) ++ if (out->BandFmt == VIPS_FORMAT_USHORT) + out->Type = VIPS_INTERPRETATION_GREY16; + else + out->Type = VIPS_INTERPRETATION_B_W; +@@ -502,7 +499,7 @@ vips_foreign_load_magick7_parse( VipsForeignLoadMagick7 *magick7, + + case sRGBColorspace: + case RGBColorspace: +- if( out->BandFmt == VIPS_FORMAT_USHORT ) ++ if (out->BandFmt == VIPS_FORMAT_USHORT) + out->Type = VIPS_INTERPRETATION_RGB16; + else + out->Type = VIPS_INTERPRETATION_sRGB; +@@ -513,23 +510,23 @@ vips_foreign_load_magick7_parse( VipsForeignLoadMagick7 *magick7, + break; + + default: +- vips_error( class->nickname, +- _( "unsupported colorspace %s" ), +- magick_ColorspaceType2str( image->colorspace ) ); +- return( -1 ); ++ vips_error(class->nickname, ++ _("unsupported colorspace %s"), ++ magick_ColorspaceType2str(image->colorspace)); ++ return (-1); + } + +- switch( image->units ) { ++ switch (image->units) { + case PixelsPerInchResolution: + out->Xres = image->resolution.x / 25.4; + out->Yres = image->resolution.y / 25.4; +- vips_image_set_string( out, VIPS_META_RESOLUTION_UNIT, "in" ); ++ vips_image_set_string(out, VIPS_META_RESOLUTION_UNIT, "in"); + break; + + case PixelsPerCentimeterResolution: + out->Xres = image->resolution.x / 10.0; + out->Yres = image->resolution.y / 10.0; +- vips_image_set_string( out, VIPS_META_RESOLUTION_UNIT, "cm" ); ++ vips_image_set_string(out, VIPS_META_RESOLUTION_UNIT, "cm"); + break; + + default: +@@ -544,61 +541,61 @@ vips_foreign_load_magick7_parse( VipsForeignLoadMagick7 *magick7, + */ + out->Coding = VIPS_CODING_NONE; + +- if( vips_image_pipelinev( out, VIPS_DEMAND_STYLE_SMALLTILE, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(out, VIPS_DEMAND_STYLE_SMALLTILE, NULL)) ++ return (-1); + + /* Get all the string metadata. + */ +- ResetImagePropertyIterator( image ); +- while( (key = GetNextImageProperty( image )) ) { ++ ResetImagePropertyIterator(image); ++ while ((key = GetNextImageProperty(image))) { + char name_text[256]; +- VipsBuf name = VIPS_BUF_STATIC( name_text ); ++ VipsBuf name = VIPS_BUF_STATIC(name_text); + const char *value; + +- value = GetImageProperty( image, key, magick7->exception ); +- if( !value ) { +- vips_foreign_load_magick7_error( magick7 ); +- return( -1 ); ++ value = GetImageProperty(image, key, magick7->exception); ++ if (!value) { ++ vips_foreign_load_magick7_error(magick7); ++ return (-1); + } +- vips_buf_appendf( &name, "magick-%s", key ); +- vips_image_set_string( out, vips_buf_all( &name ), value ); ++ vips_buf_appendf(&name, "magick-%s", key); ++ vips_image_set_string(out, vips_buf_all(&name), value); + } + + /* Set vips metadata from ImageMagick profiles. + */ +- if( magick_set_vips_profile( out, image ) ) +- return( -1 ); ++ if (magick_set_vips_profile(out, image)) ++ return (-1); + +- /* Something like "BMP". +- */ +- if( magick7->image->magick && +- strlen( magick7->image->magick ) > 0 ) +- vips_image_set_string( out, "magick-format", +- magick7->image->magick ); ++ /* Something like "BMP". ++ */ ++ if (magick7->image->magick && ++ strlen(magick7->image->magick) > 0) ++ vips_image_set_string(out, "magick-format", ++ magick7->image->magick); + +- magick7->n_pages = GetImageListLength( GetFirstImageInList( image ) ); ++ magick7->n_pages = GetImageListLength(GetFirstImageInList(image)); + #ifdef DEBUG +- printf( "image has %d pages\n", magick7->n_pages ); ++ printf("image has %d pages\n", magick7->n_pages); + #endif /*DEBUG*/ + + /* Do we have a set of equal-sized frames? Append them. + +- FIXME ... there must be an attribute somewhere from dicom read ++ FIXME ... there must be an attribute somewhere from dicom read + which says this is a volumetric image + + */ + magick7->n_frames = 0; +- for( p = image; p; (p = GetNextImageInList( p )) ) { +- if( p->columns != (unsigned int) out->Xsize || ++ for (p = image; p; (p = GetNextImageInList(p))) { ++ if (p->columns != (unsigned int) out->Xsize || + p->rows != (unsigned int) out->Ysize || +- magick7_get_bands( p ) != out->Bands || +- p->depth != image->depth ) { ++ magick7_get_bands(p) != out->Bands || ++ p->depth != image->depth) { + #ifdef DEBUG +- printf( "frame %d differs\n", magick7->n_frames ); +- printf( "%zdx%zd, %d bands\n", +- p->columns, p->rows, magick7_get_bands( p ) ); +- printf( "first frame is %dx%d, %d bands\n", +- out->Xsize, out->Ysize, out->Bands ); ++ printf("frame %d differs\n", magick7->n_frames); ++ printf("%zdx%zd, %d bands\n", ++ p->columns, p->rows, magick7_get_bands(p)); ++ printf("first frame is %dx%d, %d bands\n", ++ out->Xsize, out->Ysize, out->Bands); + #endif /*DEBUG*/ + + break; +@@ -606,31 +603,31 @@ vips_foreign_load_magick7_parse( VipsForeignLoadMagick7 *magick7, + + magick7->n_frames += 1; + } +- if( p ) ++ if (p) + /* Nope ... just do the first image in the list. + */ + magick7->n_frames = 1; + + #ifdef DEBUG +- printf( "will read %d frames\n", magick7->n_frames ); ++ printf("will read %d frames\n", magick7->n_frames); + #endif /*DEBUG*/ + +- if( magick7->n != -1 ) +- magick7->n_frames = VIPS_MIN( magick7->n_frames, magick7->n ); ++ if (magick7->n != -1) ++ magick7->n_frames = VIPS_MIN(magick7->n_frames, magick7->n); + + /* So we can finally set the height. + */ +- if( magick7->n_frames > 1 ) { +- vips_image_set_int( out, VIPS_META_PAGE_HEIGHT, out->Ysize ); ++ if (magick7->n_frames > 1) { ++ vips_image_set_int(out, VIPS_META_PAGE_HEIGHT, out->Ysize); + out->Ysize *= magick7->n_frames; + } + +- vips_image_set_int( out, VIPS_META_N_PAGES, magick7->n_pages ); ++ vips_image_set_int(out, VIPS_META_N_PAGES, magick7->n_pages); + +- vips_image_set_int( out, VIPS_META_ORIENTATION, +- VIPS_CLIP( 1, image->orientation, 8 ) ); ++ vips_image_set_int(out, VIPS_META_ORIENTATION, ++ VIPS_CLIP(1, image->orientation, 8)); + +- return( 0 ); ++ return (0); + } + + /* We don't bother with GetPixelReadMask(), assume it's everywhere. Don't +@@ -639,75 +636,76 @@ vips_foreign_load_magick7_parse( VipsForeignLoadMagick7 *magick7, + * We do skip index channels. Palette images add extra index channels + * containing the index value from the file before colourmap lookup. + */ +-#define UNPACK( TYPE ) { \ +- TYPE * restrict tq = (TYPE *) q; \ +- int x; \ +- int b; \ +- \ +- for( x = 0; x < r->width; x++ ) { \ +- for( b = 0; b < GetPixelChannels( image ); b++ ) { \ +- PixelChannel channel = \ +- GetPixelChannelChannel( image, b ); \ +- \ +- if( channel != IndexPixelChannel ) \ +- *tq++ = p[b]; \ ++#define UNPACK(TYPE) \ ++ { \ ++ TYPE *restrict tq = (TYPE *) q; \ ++ int x; \ ++ int b; \ ++\ ++ for (x = 0; x < r->width; x++) { \ ++ for (b = 0; b < GetPixelChannels(image); b++) { \ ++ PixelChannel channel = \ ++ GetPixelChannelChannel(image, b); \ ++\ ++ if (channel != IndexPixelChannel) \ ++ *tq++ = p[b]; \ ++ } \ ++\ ++ p += GetPixelChannels(image); \ + } \ +- \ +- p += GetPixelChannels( image ); \ +- } \ +-} ++ } + + static int +-vips_foreign_load_magick7_fill_region( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_foreign_load_magick7_fill_region(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsForeignLoadMagick7 *magick7 = (VipsForeignLoadMagick7 *) a; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsImage *im = or->im; + + int y; + +- for( y = 0; y < r->height; y++ ) { ++ for (y = 0; y < r->height; y++) { + int top = r->top + y; + int frame = top / magick7->frame_height; + int line = top % magick7->frame_height; + Image *image = magick7->frames[frame]; + +- Quantum * restrict p; +- VipsPel * restrict q; ++ Quantum *restrict p; ++ VipsPel *restrict q; + +- vips__worker_lock( magick7->lock ); ++ vips__worker_lock(magick7->lock); + +- p = GetCacheViewAuthenticPixels( magick7->cache_view[frame], +- r->left, line, r->width, 1, +- magick7->exception ); ++ p = GetCacheViewAuthenticPixels(magick7->cache_view[frame], ++ r->left, line, r->width, 1, ++ magick7->exception); + +- g_mutex_unlock( magick7->lock ); ++ g_mutex_unlock(magick7->lock); + +- if( !p ) ++ if (!p) + /* This can happen if, for example, some frames of a + * gif are shorter than others. It's not always + * an error. + */ + continue; + +- q = VIPS_REGION_ADDR( or, r->left, top ); ++ q = VIPS_REGION_ADDR(or, r->left, top); + +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_UCHAR: +- UNPACK( unsigned char ); ++ UNPACK(unsigned char); + break; + + case VIPS_FORMAT_USHORT: +- UNPACK( unsigned short ); ++ UNPACK(unsigned short); + break; + + case VIPS_FORMAT_FLOAT: +- UNPACK( float ); ++ UNPACK(float); + break; + + case VIPS_FORMAT_DOUBLE: +- UNPACK( double ); ++ UNPACK(double); + break; + + default: +@@ -715,11 +713,11 @@ vips_foreign_load_magick7_fill_region( VipsRegion *or, + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_magick7_load( VipsForeignLoadMagick7 *magick7 ) ++vips_foreign_load_magick7_load(VipsForeignLoadMagick7 *magick7) + { + VipsForeignLoad *load = (VipsForeignLoad *) magick7; + +@@ -727,115 +725,115 @@ vips_foreign_load_magick7_load( VipsForeignLoadMagick7 *magick7 ) + int i; + + #ifdef DEBUG +- printf( "vips_foreign_load_magick7_load: %p\n", magick7 ); ++ printf("vips_foreign_load_magick7_load: %p\n", magick7); + #endif /*DEBUG*/ + +- if( vips_foreign_load_magick7_parse( magick7, +- magick7->image, load->out ) ) +- return( -1 ); ++ if (vips_foreign_load_magick7_parse(magick7, ++ magick7->image, load->out)) ++ return (-1); + + /* Record frame pointers. + */ +- g_assert( !magick7->frames ); +- if( !(magick7->frames = +- VIPS_ARRAY( NULL, magick7->n_frames, Image * )) ) +- return( -1 ); ++ g_assert(!magick7->frames); ++ if (!(magick7->frames = ++ VIPS_ARRAY(NULL, magick7->n_frames, Image *))) ++ return (-1); + p = magick7->image; +- for( i = 0; i < magick7->n_frames; i++ ) { ++ for (i = 0; i < magick7->n_frames; i++) { + magick7->frames[i] = p; +- p = GetNextImageInList( p ); ++ p = GetNextImageInList(p); + } + + /* And a cache_view for each frame. + */ +- g_assert( !magick7->cache_view ); +- if( !(magick7->cache_view = VIPS_ARRAY( NULL, +- magick7->n_frames, CacheView * )) ) +- return( -1 ); +- for( i = 0; i < magick7->n_frames; i++ ) { +- magick7->cache_view[i] = AcquireAuthenticCacheView( +- magick7->frames[i], magick7->exception ); ++ g_assert(!magick7->cache_view); ++ if (!(magick7->cache_view = VIPS_ARRAY(NULL, ++ magick7->n_frames, CacheView *))) ++ return (-1); ++ for (i = 0; i < magick7->n_frames; i++) { ++ magick7->cache_view[i] = AcquireAuthenticCacheView( ++ magick7->frames[i], magick7->exception); + } + + #ifdef DEBUG + /* Only display the traits from frame0, they should all be the same. + */ +- vips_magick7_print_traits( magick7->frames[0] ); +- vips_magick7_print_channel_names( magick7->frames[0] ); ++ vips_magick7_print_traits(magick7->frames[0]); ++ vips_magick7_print_channel_names(magick7->frames[0]); + #endif /*DEBUG*/ + +- if( vips_image_generate( load->out, +- NULL, vips_foreign_load_magick7_fill_region, NULL, +- magick7, NULL ) ) +- return( -1 ); ++ if (vips_image_generate(load->out, ++ NULL, vips_foreign_load_magick7_fill_region, NULL, ++ magick7, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + typedef struct _VipsForeignLoadMagick7File { + VipsForeignLoadMagick7 parent_object; + +- char *filename; ++ char *filename; + + } VipsForeignLoadMagick7File; + + typedef VipsForeignLoadMagick7Class VipsForeignLoadMagick7FileClass; + +-G_DEFINE_TYPE( VipsForeignLoadMagick7File, vips_foreign_load_magick7_file, +- vips_foreign_load_magick7_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadMagick7File, vips_foreign_load_magick7_file, ++ vips_foreign_load_magick7_get_type()); + + static gboolean +-ismagick7( const char *filename ) ++ismagick7(const char *filename) + { + /* Fetch up to the first 100 bytes. Hopefully that'll be enough. + */ + unsigned char buf[100]; + int len; + +- return( (len = vips__get_bytes( filename, buf, 100 )) > 10 && +- magick_ismagick( buf, len ) ); ++ return ((len = vips__get_bytes(filename, buf, 100)) > 10 && ++ magick_ismagick(buf, len)); + } + + static int +-vips_foreign_load_magick7_file_header( VipsForeignLoad *load ) ++vips_foreign_load_magick7_file_header(VipsForeignLoad *load) + { + VipsForeignLoadMagick7 *magick7 = (VipsForeignLoadMagick7 *) load; + VipsForeignLoadMagick7File *file = (VipsForeignLoadMagick7File *) load; + + #ifdef DEBUG +- printf( "vips_foreign_load_magick7_file_header: %p\n", load ); ++ printf("vips_foreign_load_magick7_file_header: %p\n", load); + #endif /*DEBUG*/ + +- vips_strncpy( magick7->image_info->filename, file->filename, +- MagickPathExtent ); ++ vips_strncpy(magick7->image_info->filename, file->filename, ++ MagickPathExtent); + +- magick_sniff_file( magick7->image_info, file->filename ); ++ magick_sniff_file(magick7->image_info, file->filename); + + /* It would be great if we could PingImage and just read the header, + * but sadly many IM coders do not support ping. The critical one for + * us is DICOM. +- * ++ * + * We have to read the whole image in _header. + */ +- magick7->image = ReadImage( magick7->image_info, magick7->exception ); +- if( !magick7->image ) { +- vips_foreign_load_magick7_error( magick7 ); +- return( -1 ); ++ magick7->image = ReadImage(magick7->image_info, magick7->exception); ++ if (!magick7->image) { ++ vips_foreign_load_magick7_error(magick7); ++ return (-1); + } + +- if( vips_foreign_load_magick7_load( magick7 ) ) +- return( -1 ); ++ if (vips_foreign_load_magick7_load(magick7)) ++ return (-1); + +- VIPS_SETSTR( load->out->filename, file->filename ); ++ VIPS_SETSTR(load->out->filename, file->filename); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_magick7_file_class_init( +- VipsForeignLoadMagick7FileClass *class ) ++vips_foreign_load_magick7_file_class_init( ++ VipsForeignLoadMagick7FileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -843,22 +841,21 @@ vips_foreign_load_magick7_file_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "magickload"; +- object_class->description = _( "load file with ImageMagick7" ); ++ object_class->description = _("load file with ImageMagick7"); + + load_class->is_a = ismagick7; + load_class->header = vips_foreign_load_magick7_file_header; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadMagick7File, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadMagick7File, filename), ++ NULL); + } + + static void +-vips_foreign_load_magick7_file_init( VipsForeignLoadMagick7File *magick7_file ) ++vips_foreign_load_magick7_file_init(VipsForeignLoadMagick7File *magick7_file) + { + } + +@@ -871,54 +868,54 @@ typedef struct _VipsForeignLoadMagick7Buffer { + + typedef VipsForeignLoadMagick7Class VipsForeignLoadMagick7BufferClass; + +-G_DEFINE_TYPE( VipsForeignLoadMagick7Buffer, vips_foreign_load_magick7_buffer, +- vips_foreign_load_magick7_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadMagick7Buffer, vips_foreign_load_magick7_buffer, ++ vips_foreign_load_magick7_get_type()); + + static gboolean +-vips_foreign_load_magick7_buffer_is_a_buffer( const void *buf, size_t len ) ++vips_foreign_load_magick7_buffer_is_a_buffer(const void *buf, size_t len) + { +- return( len > 10 && +- magick_ismagick( (const unsigned char *) buf, len ) ); ++ return (len > 10 && ++ magick_ismagick((const unsigned char *) buf, len)); + } + + static int +-vips_foreign_load_magick7_buffer_header( VipsForeignLoad *load ) ++vips_foreign_load_magick7_buffer_header(VipsForeignLoad *load) + { + VipsForeignLoadMagick7 *magick7 = (VipsForeignLoadMagick7 *) load; +- VipsForeignLoadMagick7Buffer *magick7_buffer = ++ VipsForeignLoadMagick7Buffer *magick7_buffer = + (VipsForeignLoadMagick7Buffer *) load; + + #ifdef DEBUG +- printf( "vips_foreign_load_magick7_buffer_header: %p\n", load ); ++ printf("vips_foreign_load_magick7_buffer_header: %p\n", load); + #endif /*DEBUG*/ + + /* It would be great if we could PingBlob and just read the header, + * but sadly many IM coders do not support ping. The critical one for + * us is DICOM. +- * ++ * + * We have to read the whole image in _header. + */ +- magick_sniff_bytes( magick7->image_info, +- magick7_buffer->buf->data, magick7_buffer->buf->length ); +- magick7->image = BlobToImage( magick7->image_info, ++ magick_sniff_bytes(magick7->image_info, ++ magick7_buffer->buf->data, magick7_buffer->buf->length); ++ magick7->image = BlobToImage(magick7->image_info, + magick7_buffer->buf->data, magick7_buffer->buf->length, +- magick7->exception ); +- if( !magick7->image ) { +- vips_foreign_load_magick7_error( magick7 ); +- return( -1 ); ++ magick7->exception); ++ if (!magick7->image) { ++ vips_foreign_load_magick7_error(magick7); ++ return (-1); + } + +- if( vips_foreign_load_magick7_load( magick7 ) ) +- return( -1 ); ++ if (vips_foreign_load_magick7_load(magick7)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_magick7_buffer_class_init( +- VipsForeignLoadMagick7BufferClass *class ) ++vips_foreign_load_magick7_buffer_class_init( ++ VipsForeignLoadMagick7BufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -926,22 +923,21 @@ vips_foreign_load_magick7_buffer_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "magickload_buffer"; +- object_class->description = _( "load buffer with ImageMagick7" ); ++ object_class->description = _("load buffer with ImageMagick7"); + + load_class->is_a_buffer = vips_foreign_load_magick7_buffer_is_a_buffer; + load_class->header = vips_foreign_load_magick7_buffer_header; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadMagick7Buffer, buf ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadMagick7Buffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_load_magick7_buffer_init( VipsForeignLoadMagick7Buffer *buffer ) ++vips_foreign_load_magick7_buffer_init(VipsForeignLoadMagick7Buffer *buffer) + { + } + +diff --git a/libvips/foreign/magickload.c b/libvips/foreign/magickload.c +index ad9978bf3d..fe01278340 100644 +--- a/libvips/foreign/magickload.c ++++ b/libvips/foreign/magickload.c +@@ -18,28 +18,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -73,7 +73,7 @@ + * * @density: string, canvas resolution for rendering vector formats like SVG + * + * Read in an image using libMagick, the ImageMagick library. This library can +- * read more than 80 file formats, including SVG, BMP, EPS, DICOM and many ++ * read more than 80 file formats, including SVG, BMP, EPS, DICOM and many + * others. + * The reader can handle any ImageMagick image, including the float and double + * formats. It will work with any quantum size, including HDR. Any metadata +@@ -90,8 +90,8 @@ + * pages to load. Set @n to -1 to load all pages from @page onwards. + * + * @density is "WxH" in DPI, e.g. "600x300" or "600" (default is "72x72"). See +- * the [density +- * docs](http://www.imagemagick.org/script/command-line-options.php#density) ++ * the [density ++ * docs](http://www.imagemagick.org/script/command-line-options.php#density) + * on the imagemagick website. + * + * See also: vips_image_new_from_file(). +@@ -99,16 +99,16 @@ + * Returns: 0 on success, -1 on error. + */ + int +-vips_magickload( const char *filename, VipsImage **out, ... ) ++vips_magickload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "magickload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("magickload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -125,17 +125,17 @@ vips_magickload( const char *filename, VipsImage **out, ... ) + * * @density: string, canvas resolution for rendering vector formats like SVG + * + * Read an image memory block using libMagick into a VIPS image. Exactly as +- * vips_magickload(), but read from a memory source. ++ * vips_magickload(), but read from a memory source. + * +- * You must not free the buffer while @out is active. The +- * #VipsObject::postclose signal on @out is a good place to free. ++ * You must not free the buffer while @out is active. The ++ * #VipsObject::postclose signal on @out is a good place to free. + * + * See also: vips_magickload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_magickload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++vips_magickload_buffer(void *buf, size_t len, VipsImage **out, ...) + { + va_list ap; + VipsBlob *blob; +@@ -143,13 +143,13 @@ vips_magickload_buffer( void *buf, size_t len, VipsImage **out, ... ) + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, buf, len ); ++ blob = vips_blob_new(NULL, buf, len); + +- va_start( ap, out ); +- result = vips_call_split( "magickload_buffer", ap, blob, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("magickload_buffer", ap, blob, out); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/magicksave.c b/libvips/foreign/magicksave.c +index f55bafaee2..09014d954a 100644 +--- a/libvips/foreign/magicksave.c ++++ b/libvips/foreign/magicksave.c +@@ -1,6 +1,6 @@ + /* save with libMagick + * +- * 22/12/17 dlemstra ++ * 22/12/17 dlemstra + * 6/2/19 DarthSim + * - fix GraphicsMagick support + * 17/2/19 +@@ -9,7 +9,7 @@ + * 29/6/19 + * - support "strip" option + * 6/7/19 [deftomat] +- * - support array of delays ++ * - support array of delays + * 5/8/19 DarthSim + * - support GIF optimization + * 21/4/21 kleisauke +@@ -18,28 +18,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -56,8 +56,8 @@ + + /** + * vips_magicksave: (method) +- * @in: image to save +- * @filename: file to write to ++ * @in: image to save ++ * @filename: file to write to + * @...: %NULL-terminated list of optional named arguments + * + * Optional arguments: +@@ -92,21 +92,21 @@ + * Returns: 0 on success, -1 on error. + */ + int +-vips_magicksave( VipsImage *in, const char *filename, ... ) ++vips_magicksave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "magicksave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("magicksave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_magicksave_buffer: (method) +- * @in: image to save ++ * @in: image to save + * @buf: (array length=len) (element-type guint8): return output buffer here + * @len: (type gsize): return output length here + * @...: %NULL-terminated list of optional named arguments +@@ -119,7 +119,7 @@ vips_magicksave( VipsImage *in, const char *filename, ... ) + * * @optimize_gif_transparency: %gboolean, apply GIF transparency optimization + * * @bitdepth: %gint, number of bits per pixel + * +- * As vips_magicksave(), but save to a memory buffer. ++ * As vips_magicksave(), but save to a memory buffer. + * + * The address of the buffer is returned in @obuf, the length of the buffer in + * @olen. You are responsible for freeing the buffer with g_free() when you +@@ -130,29 +130,29 @@ vips_magicksave( VipsImage *in, const char *filename, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_magicksave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++vips_magicksave_buffer(VipsImage *in, void **buf, size_t *len, ...) + { + va_list ap; + VipsArea *area; + int result; + +- area = NULL; ++ area = NULL; + +- va_start( ap, len ); +- result = vips_call_split( "magicksave_buffer", ap, in, &area ); +- va_end( ap ); ++ va_start(ap, len); ++ result = vips_call_split("magicksave_buffer", ap, in, &area); ++ va_end(ap); + +- if( !result && +- area ) { +- if( buf ) { ++ if (!result && ++ area) { ++ if (buf) { + *buf = area->data; + area->free_fn = NULL; + } +- if( len ) ++ if (len) + *len = area->length; + +- vips_area_unref( area ); ++ vips_area_unref(area); + } + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/matlab.c b/libvips/foreign/matlab.c +index 8da55e781b..ded71302e1 100644 +--- a/libvips/foreign/matlab.c ++++ b/libvips/foreign/matlab.c +@@ -6,35 +6,35 @@ + * - reworked as some fns ready for new-style classes + * 21/8/14 + * - swap width/height +- * - set interpretation to rgb16 etc. ++ * - set interpretation to rgb16 etc. + * 16/2/16 +- * - more specific is_a test ++ * - more specific is_a test + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -46,7 +46,7 @@ + + + it will not handle sparse matricies + +-+ it loads the first variable in the file with between 1 and 3 dimensions, +++ it loads the first variable in the file with between 1 and 3 dimensions, + is this sensible behaviour? + + + load only, no save +@@ -86,60 +86,60 @@ typedef struct { + } Read; + + static void +-read_destroy( Read *read ) ++read_destroy(Read *read) + { +- VIPS_FREE( read->filename ); +- VIPS_FREEF( Mat_VarFree, read->var ); +- VIPS_FREEF( Mat_Close, read->mat ); ++ VIPS_FREE(read->filename); ++ VIPS_FREEF(Mat_VarFree, read->var); ++ VIPS_FREEF(Mat_Close, read->mat); + +- g_free( read ); ++ g_free(read); + } + + static Read * +-read_new( const char *filename, VipsImage *out ) ++read_new(const char *filename, VipsImage *out) + { + Read *read; + +- if( !(read = VIPS_NEW( NULL, Read )) ) +- return( NULL ); ++ if (!(read = VIPS_NEW(NULL, Read))) ++ return (NULL); + +- read->filename = vips_strdup( NULL, filename ); ++ read->filename = vips_strdup(NULL, filename); + read->out = out; + read->mat = NULL; + read->var = NULL; + +- if( !(read->mat = Mat_Open( filename, MAT_ACC_RDONLY )) ) { +- vips_error( "mat2vips", +- _( "unable to open \"%s\"" ), filename ); +- read_destroy( read ); +- return( NULL ); ++ if (!(read->mat = Mat_Open(filename, MAT_ACC_RDONLY))) { ++ vips_error("mat2vips", ++ _("unable to open \"%s\""), filename); ++ read_destroy(read); ++ return (NULL); + } + +- for(;;) { +- if( !(read->var = Mat_VarReadNextInfo( read->mat )) ) { +- vips_error( "mat2vips", +- _( "no matrix variables in \"%s\"" ), +- filename ); +- read_destroy( read ); +- return( NULL ); ++ for (;;) { ++ if (!(read->var = Mat_VarReadNextInfo(read->mat))) { ++ vips_error("mat2vips", ++ _("no matrix variables in \"%s\""), ++ filename); ++ read_destroy(read); ++ return (NULL); + } + + #ifdef DEBUG +- printf( "mat2vips: seen:\n" ); +- printf( "var->name == %s\n", read->var->name ); +- printf( "var->class_type == %d\n", read->var->class_type ); +- printf( "var->rank == %d\n", read->var->rank ); ++ printf("mat2vips: seen:\n"); ++ printf("var->name == %s\n", read->var->name); ++ printf("var->class_type == %d\n", read->var->class_type); ++ printf("var->rank == %d\n", read->var->rank); + #endif /*DEBUG*/ + + /* Vector to colour image is OK for us. + */ +- if( read->var->rank >= 1 && read->var->rank <= 3 ) ++ if (read->var->rank >= 1 && read->var->rank <= 3) + break; + +- VIPS_FREEF( Mat_VarFree, read->var ); ++ VIPS_FREEF(Mat_VarFree, read->var); + } + +- return( read ); ++ return (read); + } + + /* Matlab classes -> VIPS band formats. +@@ -157,37 +157,37 @@ static int mat2vips_formats[][2] = { + + /* Pick an interpretation. + */ +-static VipsInterpretation +-mat2vips_pick_interpretation( int bands, VipsBandFormat format ) ++static VipsInterpretation ++mat2vips_pick_interpretation(int bands, VipsBandFormat format) + { +- if( bands == 3 && +- vips_band_format_is8bit( format ) ) +- return( VIPS_INTERPRETATION_sRGB ); +- if( bands == 3 && +- (format == VIPS_FORMAT_USHORT || +- format == VIPS_FORMAT_SHORT) ) +- return( VIPS_INTERPRETATION_RGB16 ); +- if( bands == 1 && +- (format == VIPS_FORMAT_USHORT || +- format == VIPS_FORMAT_SHORT) ) +- return( VIPS_INTERPRETATION_GREY16 ); +- if( bands > 1 ) +- return( VIPS_INTERPRETATION_MULTIBAND ); +- +- return( VIPS_INTERPRETATION_MULTIBAND ); ++ if (bands == 3 && ++ vips_band_format_is8bit(format)) ++ return (VIPS_INTERPRETATION_sRGB); ++ if (bands == 3 && ++ (format == VIPS_FORMAT_USHORT || ++ format == VIPS_FORMAT_SHORT)) ++ return (VIPS_INTERPRETATION_RGB16); ++ if (bands == 1 && ++ (format == VIPS_FORMAT_USHORT || ++ format == VIPS_FORMAT_SHORT)) ++ return (VIPS_INTERPRETATION_GREY16); ++ if (bands > 1) ++ return (VIPS_INTERPRETATION_MULTIBAND); ++ ++ return (VIPS_INTERPRETATION_MULTIBAND); + } + + static int +-mat2vips_get_header( matvar_t *var, VipsImage *im ) ++mat2vips_get_header(matvar_t *var, VipsImage *im) + { + int width, height, bands; + VipsBandFormat format; +- VipsInterpretation interpretation; ++ VipsInterpretation interpretation; + int i; + + width = 1; + bands = 1; +- switch( var->rank ) { ++ switch (var->rank) { + case 3: + bands = var->dims[2]; + +@@ -199,94 +199,94 @@ mat2vips_get_header( matvar_t *var, VipsImage *im ) + break; + + default: +- vips_error( "mat2vips", +- _( "unsupported rank %d\n" ), var->rank ); +- return( -1 ); ++ vips_error("mat2vips", ++ _("unsupported rank %d\n"), var->rank); ++ return (-1); + } + +- for( i = 0; i < VIPS_NUMBER( mat2vips_formats ); i++ ) +- if( mat2vips_formats[i][0] == var->class_type ) ++ for (i = 0; i < VIPS_NUMBER(mat2vips_formats); i++) ++ if (mat2vips_formats[i][0] == var->class_type) + break; +- if( i == VIPS_NUMBER( mat2vips_formats ) ) { +- vips_error( "mat2vips", _( "unsupported class type %d\n" ), +- var->class_type ); +- return( -1 ); ++ if (i == VIPS_NUMBER(mat2vips_formats)) { ++ vips_error("mat2vips", _("unsupported class type %d\n"), ++ var->class_type); ++ return (-1); + } + format = mat2vips_formats[i][1]; +- interpretation = mat2vips_pick_interpretation( bands, format ); ++ interpretation = mat2vips_pick_interpretation(bands, format); + +- vips_image_init_fields( im, +- width, height, bands, +- format, +- VIPS_CODING_NONE, interpretation, 1.0, 1.0 ); ++ vips_image_init_fields(im, ++ width, height, bands, ++ format, ++ VIPS_CODING_NONE, interpretation, 1.0, 1.0); + +- /* We read to a huge memory area. +- */ +- if( vips_image_pipelinev( im, VIPS_DEMAND_STYLE_ANY, NULL ) ) +- return( -1 ); ++ /* We read to a huge memory area. ++ */ ++ if (vips_image_pipelinev(im, VIPS_DEMAND_STYLE_ANY, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-vips__mat_header( const char *filename, VipsImage *out ) ++vips__mat_header(const char *filename, VipsImage *out) + { + Read *read; + + #ifdef DEBUG +- printf( "mat2vips_header: reading \"%s\"\n", filename ); ++ printf("mat2vips_header: reading \"%s\"\n", filename); + #endif /*DEBUG*/ + +- if( !(read = read_new( filename, out )) ) +- return( -1 ); +- if( mat2vips_get_header( read->var, read->out ) ) { +- read_destroy( read ); +- return( -1 ); ++ if (!(read = read_new(filename, out))) ++ return (-1); ++ if (mat2vips_get_header(read->var, read->out)) { ++ read_destroy(read); ++ return (-1); + } +- read_destroy( read ); ++ read_destroy(read); + +- return( 0 ); ++ return (0); + } + + static int +-mat2vips_get_data( mat_t *mat, matvar_t *var, VipsImage *im ) ++mat2vips_get_data(mat_t *mat, matvar_t *var, VipsImage *im) + { + int y; + VipsPel *buffer; +- const int es = VIPS_IMAGE_SIZEOF_ELEMENT( im ); ++ const int es = VIPS_IMAGE_SIZEOF_ELEMENT(im); + + /* Matlab images are plane-separate, so we have to assemble bands in + * image-size chunks. + */ +- const guint64 is = es * VIPS_IMAGE_N_PELS( im ); ++ const guint64 is = es * VIPS_IMAGE_N_PELS(im); + +- if( Mat_VarReadDataAll( mat, var ) ) { +- vips_error( "mat2vips", "%s", +- _( "Mat_VarReadDataAll failed" ) ); +- return( -1 ); ++ if (Mat_VarReadDataAll(mat, var)) { ++ vips_error("mat2vips", "%s", ++ _("Mat_VarReadDataAll failed")); ++ return (-1); + } + + /* Matlab images are in columns, so we have to transpose into + * scanlines with this buffer. + */ +- if( !(buffer = VIPS_ARRAY( im, +- VIPS_IMAGE_SIZEOF_LINE( im ), VipsPel )) ) +- return( -1 ); ++ if (!(buffer = VIPS_ARRAY(im, ++ VIPS_IMAGE_SIZEOF_LINE(im), VipsPel))) ++ return (-1); + +- for( y = 0; y < im->Ysize; y++ ) { ++ for (y = 0; y < im->Ysize; y++) { + const VipsPel *p = var->data + y * es; + int x; + VipsPel *q; + + q = buffer; +- for( x = 0; x < im->Xsize; x++ ) { ++ for (x = 0; x < im->Xsize; x++) { + int b; + +- for( b = 0; b < im->Bands; b++ ) { ++ for (b = 0; b < im->Bands; b++) { + const VipsPel *p2 = p + b * is; + int z; + +- for( z = 0; z < es; z++ ) ++ for (z = 0; z < es; z++) + q[z] = p2[z]; + + q += es; +@@ -295,44 +295,44 @@ mat2vips_get_data( mat_t *mat, matvar_t *var, VipsImage *im ) + p += es * im->Ysize; + } + +- if( vips_image_write_line( im, y, buffer ) ) +- return( -1 ); ++ if (vips_image_write_line(im, y, buffer)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + int +-vips__mat_load( const char *filename, VipsImage *out ) ++vips__mat_load(const char *filename, VipsImage *out) + { + Read *read; + + #ifdef DEBUG +- printf( "mat2vips: reading \"%s\"\n", filename ); ++ printf("mat2vips: reading \"%s\"\n", filename); + #endif /*DEBUG*/ + +- if( !(read = read_new( filename, out )) ) +- return( -1 ); +- if( mat2vips_get_header( read->var, read->out ) || +- mat2vips_get_data( read->mat, read->var, read->out ) ) { +- read_destroy( read ); +- return( -1 ); ++ if (!(read = read_new(filename, out))) ++ return (-1); ++ if (mat2vips_get_header(read->var, read->out) || ++ mat2vips_get_data(read->mat, read->var, read->out)) { ++ read_destroy(read); ++ return (-1); + } +- read_destroy( read ); ++ read_destroy(read); + +- return( 0 ); ++ return (0); + } + + int +-vips__mat_ismat( const char *filename ) ++vips__mat_ismat(const char *filename) + { + unsigned char buf[15]; + +- if( vips__get_bytes( filename, buf, 10 ) == 10 && +- vips_isprefix( "MATLAB 5.0", (char *) buf ) ) +- return( 1 ); ++ if (vips__get_bytes(filename, buf, 10) == 10 && ++ vips_isprefix("MATLAB 5.0", (char *) buf)) ++ return (1); + +- return( 0 ); ++ return (0); + } + + const char *vips__mat_suffs[] = { ".mat", NULL }; +diff --git a/libvips/foreign/matload.c b/libvips/foreign/matload.c +index e6fc7e0fbb..766dacb348 100644 +--- a/libvips/foreign/matload.c ++++ b/libvips/foreign/matload.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -59,59 +59,59 @@ typedef struct _VipsForeignLoadMat { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadMat; + + typedef VipsForeignLoadClass VipsForeignLoadMatClass; + +-G_DEFINE_TYPE( VipsForeignLoadMat, vips_foreign_load_mat, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_TYPE(VipsForeignLoadMat, vips_foreign_load_mat, ++ VIPS_TYPE_FOREIGN_LOAD); + + static VipsForeignFlags +-vips_foreign_load_mat_get_flags_filename( const char *filename ) ++vips_foreign_load_mat_get_flags_filename(const char *filename) + { +- return( 0 ); ++ return (0); + } + + static VipsForeignFlags +-vips_foreign_load_mat_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_mat_get_flags(VipsForeignLoad *load) + { + VipsForeignLoadMat *mat = (VipsForeignLoadMat *) load; + +- return( vips_foreign_load_mat_get_flags_filename( mat->filename ) ); ++ return (vips_foreign_load_mat_get_flags_filename(mat->filename)); + } + + static int +-vips_foreign_load_mat_header( VipsForeignLoad *load ) ++vips_foreign_load_mat_header(VipsForeignLoad *load) + { + VipsForeignLoadMat *mat = (VipsForeignLoadMat *) load; + +- if( vips__mat_header( mat->filename, load->out ) ) +- return( -1 ); ++ if (vips__mat_header(mat->filename, load->out)) ++ return (-1); + +- VIPS_SETSTR( load->out->filename, mat->filename ); ++ VIPS_SETSTR(load->out->filename, mat->filename); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_mat_load( VipsForeignLoad *load ) ++vips_foreign_load_mat_load(VipsForeignLoad *load) + { + VipsForeignLoadMat *mat = (VipsForeignLoadMat *) load; + +- if( vips__mat_load( mat->filename, load->real ) ) +- return( -1 ); ++ if (vips__mat_load(mat->filename, load->real)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_mat_class_init( VipsForeignLoadMatClass *class ) ++vips_foreign_load_mat_class_init(VipsForeignLoadMatClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -119,7 +119,7 @@ vips_foreign_load_mat_class_init( VipsForeignLoadMatClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "matload"; +- object_class->description = _( "load mat from file" ); ++ object_class->description = _("load mat from file"); + + /* libmatio is fuzzed, but not by us. + */ +@@ -128,22 +128,22 @@ vips_foreign_load_mat_class_init( VipsForeignLoadMatClass *class ) + foreign_class->suffs = vips__mat_suffs; + + load_class->is_a = vips__mat_ismat; +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_mat_get_flags_filename; + load_class->get_flags = vips_foreign_load_mat_get_flags; + load_class->header = vips_foreign_load_mat_header; + load_class->load = vips_foreign_load_mat_load; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadMat, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadMat, filename), ++ NULL); + } + + static void +-vips_foreign_load_mat_init( VipsForeignLoadMat *mat ) ++vips_foreign_load_mat_init(VipsForeignLoadMat *mat) + { + } + +@@ -155,26 +155,26 @@ vips_foreign_load_mat_init( VipsForeignLoadMat *mat ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Read a Matlab save file into a VIPS image. ++ * Read a Matlab save file into a VIPS image. + * + * This operation searches the save + * file for the first array variable with between 1 and 3 dimensions and loads + * it as an image. It will not handle complex images. It does not handle +- * sparse matrices. ++ * sparse matrices. + * + * See also: vips_image_new_from_file(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_matload( const char *filename, VipsImage **out, ... ) ++vips_matload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "matload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("matload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/matrixload.c b/libvips/foreign/matrixload.c +index 6903d0cb13..400552d2cc 100644 +--- a/libvips/foreign/matrixload.c ++++ b/libvips/foreign/matrixload.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -71,106 +71,104 @@ typedef struct _VipsForeignLoadMatrix { + + typedef VipsForeignLoadClass VipsForeignLoadMatrixClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadMatrix, vips_foreign_load_matrix, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadMatrix, vips_foreign_load_matrix, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_matrix_dispose( GObject *gobject ) ++vips_foreign_load_matrix_dispose(GObject *gobject) + { + VipsForeignLoadMatrix *matrix = (VipsForeignLoadMatrix *) gobject; + +- VIPS_UNREF( matrix->source ); +- VIPS_UNREF( matrix->sbuf ); +- VIPS_FREE( matrix->linebuf ); ++ VIPS_UNREF(matrix->source); ++ VIPS_UNREF(matrix->sbuf); ++ VIPS_FREE(matrix->linebuf); + +- G_OBJECT_CLASS( vips_foreign_load_matrix_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_matrix_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_load_matrix_build( VipsObject *object ) ++vips_foreign_load_matrix_build(VipsObject *object) + { + VipsForeignLoadMatrix *matrix = (VipsForeignLoadMatrix *) object; + +- if( !(matrix->sbuf = vips_sbuf_new_from_source( matrix->source )) ) +- return( -1 ); ++ if (!(matrix->sbuf = vips_sbuf_new_from_source(matrix->source))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_matrix_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_matrix_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static VipsForeignFlags +-vips_foreign_load_matrix_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_matrix_get_flags(VipsForeignLoad *load) + { +- return( 0 ); ++ return (0); + } + + /* Parse a header line. Two numbers for width and height, and two optional +- * numbers for scale and offset. ++ * numbers for scale and offset. + * + * We can have scale and no offset, in which case we assume offset = 0. + */ + static int +-parse_matrix_header( char *line, +- int *width, int *height, double *scale, double *offset ) ++parse_matrix_header(char *line, ++ int *width, int *height, double *scale, double *offset) + { + double header[4]; + char *p, *q; + int i; + +- for( i = 0, p = line; +- (q = vips_break_token( p, " \t" )) && +- i < 4; +- i++, p = q ) +- if( vips_strtod( p, &header[i] ) ) { +- vips_error( "matload", +- _( "bad number \"%s\"" ), p ); +- return( -1 ); ++ for (i = 0, p = line; ++ (q = vips_break_token(p, " \t")) && ++ i < 4; ++ i++, p = q) ++ if (vips_strtod(p, &header[i])) { ++ vips_error("matload", ++ _("bad number \"%s\""), p); ++ return (-1); + } + +- if( i < 4 ) ++ if (i < 4) + header[3] = 0.0; +- if( i < 3 ) ++ if (i < 3) + header[2] = 1.0; +- if( i < 2 ) { +- vips_error( "matload", "%s", _( "no width / height" ) ); +- return( -1 ); ++ if (i < 2) { ++ vips_error("matload", "%s", _("no width / height")); ++ return (-1); + } + +- if( VIPS_FLOOR( header[0] ) != header[0] || +- VIPS_FLOOR( header[1] ) != header[1] ) { +- vips_error( "mask2vips", "%s", _( "width / height not int" ) ); +- return( -1 ); ++ if (VIPS_FLOOR(header[0]) != header[0] || ++ VIPS_FLOOR(header[1]) != header[1]) { ++ vips_error("mask2vips", "%s", _("width / height not int")); ++ return (-1); + } + + /* Width / height can be 65536 for a 16-bit LUT, for example. + */ + *width = header[0]; + *height = header[1]; +- if( *width <= 0 || ++ if (*width <= 0 || + *width > 100000 || +- *height <= 0 || +- *height > 100000 ) { +- vips_error( "mask2vips", +- "%s", _( "width / height out of range" ) ); +- return( -1 ); ++ *height <= 0 || ++ *height > 100000) { ++ vips_error("mask2vips", ++ "%s", _("width / height out of range")); ++ return (-1); + } +- if( header[2] == 0.0 ) { +- vips_error( "mask2vips", "%s", _( "zero scale" ) ); +- return( -1 ); ++ if (header[2] == 0.0) { ++ vips_error("mask2vips", "%s", _("zero scale")); ++ return (-1); + } + + *scale = header[2]; + *offset = header[3]; + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_matrix_header( VipsForeignLoad *load ) ++vips_foreign_load_matrix_header(VipsForeignLoad *load) + { + VipsForeignLoadMatrix *matrix = (VipsForeignLoadMatrix *) load; + +@@ -183,106 +181,105 @@ vips_foreign_load_matrix_header( VipsForeignLoad *load ) + + /* Rewind. + */ +- vips_sbuf_unbuffer( matrix->sbuf ); +- if( vips_source_rewind( matrix->source ) ) +- return( -1 ); +- +- line = vips_sbuf_get_line_copy( matrix->sbuf ); +- result = parse_matrix_header( line, &width, &height, &scale, &offset ); +- g_free( line ); +- if( result ) +- return( -1 ); +- +- if( vips_image_pipelinev( load->out, +- VIPS_DEMAND_STYLE_THINSTRIP, NULL ) ) +- return( -1 ); +- vips_image_init_fields( load->out, +- width, height, 1, +- VIPS_FORMAT_DOUBLE, +- VIPS_CODING_NONE, VIPS_INTERPRETATION_B_W, 1.0, 1.0 ); +- +- vips_image_set_double( load->out, "scale", scale ); +- vips_image_set_double( load->out, "offset", offset ); +- +- VIPS_SETSTR( load->out->filename, +- vips_connection_filename( VIPS_CONNECTION( matrix->source ) ) ); +- +- if( !(matrix->linebuf = VIPS_ARRAY( NULL, width, double )) ) +- return( -1 ); +- +- return( 0 ); ++ vips_sbuf_unbuffer(matrix->sbuf); ++ if (vips_source_rewind(matrix->source)) ++ return (-1); ++ ++ line = vips_sbuf_get_line_copy(matrix->sbuf); ++ result = parse_matrix_header(line, &width, &height, &scale, &offset); ++ g_free(line); ++ if (result) ++ return (-1); ++ ++ if (vips_image_pipelinev(load->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, NULL)) ++ return (-1); ++ vips_image_init_fields(load->out, ++ width, height, 1, ++ VIPS_FORMAT_DOUBLE, ++ VIPS_CODING_NONE, VIPS_INTERPRETATION_B_W, 1.0, 1.0); ++ ++ vips_image_set_double(load->out, "scale", scale); ++ vips_image_set_double(load->out, "offset", offset); ++ ++ VIPS_SETSTR(load->out->filename, ++ vips_connection_filename(VIPS_CONNECTION(matrix->source))); ++ ++ if (!(matrix->linebuf = VIPS_ARRAY(NULL, width, double))) ++ return (-1); ++ ++ return (0); + } + + static int +-vips_foreign_load_matrix_load( VipsForeignLoad *load ) ++vips_foreign_load_matrix_load(VipsForeignLoad *load) + { + VipsForeignLoadMatrix *matrix = (VipsForeignLoadMatrix *) load; +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( load ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(load); + + int x, y; + +- if( vips_image_pipelinev( load->real, +- VIPS_DEMAND_STYLE_THINSTRIP, NULL ) ) +- return( -1 ); +- vips_image_init_fields( load->real, +- load->out->Xsize, load->out->Ysize, 1, +- VIPS_FORMAT_DOUBLE, +- VIPS_CODING_NONE, VIPS_INTERPRETATION_B_W, 1.0, 1.0 ); ++ if (vips_image_pipelinev(load->real, ++ VIPS_DEMAND_STYLE_THINSTRIP, NULL)) ++ return (-1); ++ vips_image_init_fields(load->real, ++ load->out->Xsize, load->out->Ysize, 1, ++ VIPS_FORMAT_DOUBLE, ++ VIPS_CODING_NONE, VIPS_INTERPRETATION_B_W, 1.0, 1.0); + +- for( y = 0; y < load->real->Ysize; y++ ) { ++ for (y = 0; y < load->real->Ysize; y++) { + char *line; + char *p, *q; + +- line = vips_sbuf_get_line_copy( matrix->sbuf ); +- +- for( x = 0, p = line; +- (q = vips_break_token( p, " \t" )) && +- x < load->out->Xsize; +- x++, p = q ) +- if( vips_strtod( p, &matrix->linebuf[x] ) ) { +- vips_error( class->nickname, +- _( "bad number \"%s\"" ), p ); +- g_free( line ); +- return( -1 ); ++ line = vips_sbuf_get_line_copy(matrix->sbuf); ++ ++ for (x = 0, p = line; ++ (q = vips_break_token(p, " \t")) && ++ x < load->out->Xsize; ++ x++, p = q) ++ if (vips_strtod(p, &matrix->linebuf[x])) { ++ vips_error(class->nickname, ++ _("bad number \"%s\""), p); ++ g_free(line); ++ return (-1); + } + +- g_free( line ); ++ g_free(line); + +- if( x != load->out->Xsize ) { +- vips_error( class->nickname, +- _( "line %d too short" ), y ); +- return( -1 ); ++ if (x != load->out->Xsize) { ++ vips_error(class->nickname, ++ _("line %d too short"), y); ++ return (-1); + } + +- if( vips_image_write_line( load->real, y, +- (VipsPel *) matrix->linebuf ) ) +- return( -1 ); ++ if (vips_image_write_line(load->real, y, ++ (VipsPel *) matrix->linebuf)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_matrix_class_init( VipsForeignLoadMatrixClass *class ) ++vips_foreign_load_matrix_class_init(VipsForeignLoadMatrixClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->dispose = vips_foreign_load_matrix_dispose; + + object_class->nickname = "matrixload_base"; +- object_class->description = _( "load matrix" ); ++ object_class->description = _("load matrix"); + object_class->build = vips_foreign_load_matrix_build; + + load_class->get_flags = vips_foreign_load_matrix_get_flags; + load_class->header = vips_foreign_load_matrix_header; + load_class->load = vips_foreign_load_matrix_load; +- + } + + static void +-vips_foreign_load_matrix_init( VipsForeignLoadMatrix *matrix ) ++vips_foreign_load_matrix_init(VipsForeignLoadMatrix *matrix) + { + } + +@@ -297,31 +294,30 @@ typedef struct _VipsForeignLoadMatrixFile { + + typedef VipsForeignLoadMatrixClass VipsForeignLoadMatrixFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadMatrixFile, vips_foreign_load_matrix_file, +- vips_foreign_load_matrix_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadMatrixFile, vips_foreign_load_matrix_file, ++ vips_foreign_load_matrix_get_type()); + + static VipsForeignFlags +-vips_foreign_load_matrix_file_get_flags_filename( const char *filename ) ++vips_foreign_load_matrix_file_get_flags_filename(const char *filename) + { +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_matrix_file_build( VipsObject *object ) ++vips_foreign_load_matrix_file_build(VipsObject *object) + { + VipsForeignLoadMatrix *matrix = (VipsForeignLoadMatrix *) object; + VipsForeignLoadMatrixFile *file = (VipsForeignLoadMatrixFile *) object; + +- if( file->filename ) +- if( !(matrix->source = +- vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename) ++ if (!(matrix->source = ++ vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_matrix_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_matrix_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static const char *vips_foreign_load_matrix_suffs[] = { +@@ -330,7 +326,7 @@ static const char *vips_foreign_load_matrix_suffs[] = { + }; + + static gboolean +-vips_foreign_load_matrix_file_is_a( const char *filename ) ++vips_foreign_load_matrix_file_is_a(const char *filename) + { + unsigned char line[80]; + guint64 bytes; +@@ -340,23 +336,23 @@ vips_foreign_load_matrix_file_is_a( const char *filename ) + double offset; + int result; + +- if( (bytes = vips__get_bytes( filename, line, 79 )) <= 0 ) +- return( FALSE ); ++ if ((bytes = vips__get_bytes(filename, line, 79)) <= 0) ++ return (FALSE); + line[bytes] = '\0'; + + vips_error_freeze(); +- result = parse_matrix_header( (char *) line, +- &width, &height, &scale, &offset ); ++ result = parse_matrix_header((char *) line, ++ &width, &height, &scale, &offset); + vips_error_thaw(); + +- return( result == 0 ); ++ return (result == 0); + } + + static void +-vips_foreign_load_matrix_file_class_init( +- VipsForeignLoadMatrixFileClass *class ) ++vips_foreign_load_matrix_file_class_init( ++ VipsForeignLoadMatrixFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -370,20 +366,19 @@ vips_foreign_load_matrix_file_class_init( + foreign_class->suffs = vips_foreign_load_matrix_suffs; + + load_class->is_a = vips_foreign_load_matrix_file_is_a; +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_matrix_file_get_flags_filename; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadMatrixFile, filename ), +- NULL ); +- ++ G_STRUCT_OFFSET(VipsForeignLoadMatrixFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_matrix_file_init( VipsForeignLoadMatrixFile *file ) ++vips_foreign_load_matrix_file_init(VipsForeignLoadMatrixFile *file) + { + } + +@@ -396,30 +391,29 @@ typedef struct _VipsForeignLoadMatrixSource { + + typedef VipsForeignLoadMatrixClass VipsForeignLoadMatrixSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadMatrixSource, vips_foreign_load_matrix_source, +- vips_foreign_load_matrix_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadMatrixSource, vips_foreign_load_matrix_source, ++ vips_foreign_load_matrix_get_type()); + + static int +-vips_foreign_load_matrix_source_build( VipsObject *object ) ++vips_foreign_load_matrix_source_build(VipsObject *object) + { + VipsForeignLoadMatrix *matrix = (VipsForeignLoadMatrix *) object; +- VipsForeignLoadMatrixSource *source = ++ VipsForeignLoadMatrixSource *source = + (VipsForeignLoadMatrixSource *) object; + +- if( source->source ) { ++ if (source->source) { + matrix->source = source->source; +- g_object_ref( matrix->source ); ++ g_object_ref(matrix->source); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_matrix_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_matrix_source_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_matrix_source_is_a_source( VipsSource *source ) ++vips_foreign_load_matrix_source_is_a_source(VipsSource *source) + { + unsigned char *data; + gint64 bytes_read; +@@ -430,26 +424,26 @@ vips_foreign_load_matrix_source_is_a_source( VipsSource *source ) + double offset; + int result; + +- if( (bytes_read = vips_source_sniff_at_most( source, +- &data, 79 )) <= 0 ) +- return( FALSE ); +- vips_strncpy( line, (const char *) data, 80 ); ++ if ((bytes_read = vips_source_sniff_at_most(source, ++ &data, 79)) <= 0) ++ return (FALSE); ++ vips_strncpy(line, (const char *) data, 80); + + vips_error_freeze(); +- result = parse_matrix_header( line, +- &width, &height, &scale, &offset ); ++ result = parse_matrix_header(line, ++ &width, &height, &scale, &offset); + vips_error_thaw(); + +- return( result == 0 ); ++ return (result == 0); + } + + static void +-vips_foreign_load_matrix_source_class_init( +- VipsForeignLoadMatrixFileClass *class ) ++vips_foreign_load_matrix_source_class_init( ++ VipsForeignLoadMatrixFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -462,17 +456,16 @@ vips_foreign_load_matrix_source_class_init( + + load_class->is_a_source = vips_foreign_load_matrix_source_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadMatrixSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadMatrixSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_matrix_source_init( VipsForeignLoadMatrixSource *source ) ++vips_foreign_load_matrix_source_init(VipsForeignLoadMatrixSource *source) + { + } + +@@ -485,18 +478,18 @@ vips_foreign_load_matrix_source_init( VipsForeignLoadMatrixSource *source ) + * Reads a matrix from a file. + * + * Matrix files have a simple format that's supposed to be easy to create with +- * a text editor or a spreadsheet. ++ * a text editor or a spreadsheet. + * + * The first line has four numbers for width, height, scale and + * offset (scale and offset may be omitted, in which case they default to 1.0 + * and 0.0). Scale must be non-zero. Width and height must be positive +- * integers. The numbers are separated by any mixture of spaces, commas, +- * tabs and quotation marks ("). The scale and offset fields may be ++ * integers. The numbers are separated by any mixture of spaces, commas, ++ * tabs and quotation marks ("). The scale and offset fields may be + * floating-point, and must use '.' + * as a decimal separator. + * + * Subsequent lines each hold one row of matrix data, with numbers again +- * separated by any mixture of spaces, commas, ++ * separated by any mixture of spaces, commas, + * tabs and quotation marks ("). The numbers may be floating-point, and must + * use '.' + * as a decimal separator. +@@ -509,16 +502,16 @@ vips_foreign_load_matrix_source_init( VipsForeignLoadMatrixSource *source ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_matrixload( const char *filename, VipsImage **out, ... ) ++vips_matrixload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "matrixload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("matrixload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -527,22 +520,21 @@ vips_matrixload( const char *filename, VipsImage **out, ... ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Exactly as vips_matrixload(), but read from a source. ++ * Exactly as vips_matrixload(), but read from a source. + * + * See also: vips_matrixload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_matrixload_source( VipsSource *source, VipsImage **out, ... ) ++vips_matrixload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "matrixload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("matrixload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/foreign/matrixsave.c b/libvips/foreign/matrixsave.c +index 3740730462..fb93d495bc 100644 +--- a/libvips/foreign/matrixsave.c ++++ b/libvips/foreign/matrixsave.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -61,83 +61,81 @@ typedef struct _VipsForeignSaveMatrix { + + typedef VipsForeignSaveClass VipsForeignSaveMatrixClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveMatrix, vips_foreign_save_matrix, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSaveMatrix, vips_foreign_save_matrix, ++ VIPS_TYPE_FOREIGN_SAVE); + + static void +-vips_foreign_save_matrix_dispose( GObject *gobject ) ++vips_foreign_save_matrix_dispose(GObject *gobject) + { + VipsForeignSaveMatrix *matrix = (VipsForeignSaveMatrix *) gobject; + +- VIPS_UNREF( matrix->target ); ++ VIPS_UNREF(matrix->target); + +- G_OBJECT_CLASS( vips_foreign_save_matrix_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_matrix_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_save_matrix_block( VipsRegion *region, VipsRect *area, void *a ) ++vips_foreign_save_matrix_block(VipsRegion *region, VipsRect *area, void *a) + { + VipsForeignSaveMatrix *matrix = (VipsForeignSaveMatrix *) a; + + int x, y; + +- for( y = 0; y < area->height; y++ ) { +- double *p = (double *) +- VIPS_REGION_ADDR( region, 0, area->top + y ); ++ for (y = 0; y < area->height; y++) { ++ double *p = (double *) ++ VIPS_REGION_ADDR(region, 0, area->top + y); + +- char buf[G_ASCII_DTOSTR_BUF_SIZE]; ++ char buf[G_ASCII_DTOSTR_BUF_SIZE]; + +- for( x = 0; x < area->width; x++ ) { +- if( x > 0 ) +- vips_target_writes( matrix->target, " " ); ++ for (x = 0; x < area->width; x++) { ++ if (x > 0) ++ vips_target_writes(matrix->target, " "); + +- g_ascii_dtostr( buf, G_ASCII_DTOSTR_BUF_SIZE, p[x] ); +- vips_target_writes( matrix->target, buf ); +- } ++ g_ascii_dtostr(buf, G_ASCII_DTOSTR_BUF_SIZE, p[x]); ++ vips_target_writes(matrix->target, buf); ++ } + +- if( vips_target_writes( matrix->target, "\n" ) ) +- return( -1 ); ++ if (vips_target_writes(matrix->target, "\n")) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_matrix_build( VipsObject *object ) ++vips_foreign_save_matrix_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveMatrix *matrix = (VipsForeignSaveMatrix *) object; +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + + double scale; + double offset; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_matrix_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_matrix_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_mono( class->nickname, save->ready ) || +- vips_check_uncoded( class->nickname, save->ready ) ) +- return( -1 ); ++ if (vips_check_mono(class->nickname, save->ready) || ++ vips_check_uncoded(class->nickname, save->ready)) ++ return (-1); + +- vips_target_writef( matrix->target, "%d %d", +- save->ready->Xsize, save->ready->Ysize ); +- scale = vips_image_get_scale( save->ready ); +- offset = vips_image_get_offset( save->ready ); +- if( scale != 1.0 || offset != 0.0 ) +- vips_target_writef( matrix->target, " %g %g", scale, offset ); +- if( vips_target_writes( matrix->target, "\n" ) ) +- return( -1 ); ++ vips_target_writef(matrix->target, "%d %d", ++ save->ready->Xsize, save->ready->Ysize); ++ scale = vips_image_get_scale(save->ready); ++ offset = vips_image_get_offset(save->ready); ++ if (scale != 1.0 || offset != 0.0) ++ vips_target_writef(matrix->target, " %g %g", scale, offset); ++ if (vips_target_writes(matrix->target, "\n")) ++ return (-1); + +- if( vips_sink_disc( save->ready, +- vips_foreign_save_matrix_block, matrix ) ) +- return( -1 ); ++ if (vips_sink_disc(save->ready, ++ vips_foreign_save_matrix_block, matrix)) ++ return (-1); + +- if( vips_target_end( matrix->target ) ) +- return( -1 ); ++ if (vips_target_end(matrix->target)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Save a bit of typing. +@@ -155,7 +153,7 @@ vips_foreign_save_matrix_build( VipsObject *object ) + + static VipsBandFormat bandfmt_matrix[10] = { + /* Band format: UC C US S UI I F X D DX */ +- /* Promotion: */ D, D, D, D, D, D, D, D, D, D ++ /* Promotion: */ D, D, D, D, D, D, D, D, D, D + }; + + static const char *vips_foreign_save_matrix_suffs[] = { +@@ -164,9 +162,9 @@ static const char *vips_foreign_save_matrix_suffs[] = { + }; + + static void +-vips_foreign_save_matrix_class_init( VipsForeignSaveMatrixClass *class ) ++vips_foreign_save_matrix_class_init(VipsForeignSaveMatrixClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; +@@ -174,51 +172,51 @@ vips_foreign_save_matrix_class_init( VipsForeignSaveMatrixClass *class ) + gobject_class->dispose = vips_foreign_save_matrix_dispose; + + object_class->nickname = "matrixsave_base"; +- object_class->description = _( "save image to matrix" ); ++ object_class->description = _("save image to matrix"); + object_class->build = vips_foreign_save_matrix_build; + + foreign_class->suffs = vips_foreign_save_matrix_suffs; + + save_class->saveable = VIPS_SAVEABLE_MONO; + save_class->format_table = bandfmt_matrix; +- + } + + static void +-vips_foreign_save_matrix_init( VipsForeignSaveMatrix *matrix ) ++vips_foreign_save_matrix_init(VipsForeignSaveMatrix *matrix) + { + } + + typedef struct _VipsForeignSaveMatrixFile { + VipsForeignSaveMatrix parent_object; + +- char *filename; ++ char *filename; + } VipsForeignSaveMatrixFile; + + typedef VipsForeignSaveMatrixClass VipsForeignSaveMatrixFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveMatrixFile, vips_foreign_save_matrix_file, +- vips_foreign_save_matrix_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveMatrixFile, vips_foreign_save_matrix_file, ++ vips_foreign_save_matrix_get_type()); + + static int +-vips_foreign_save_matrix_file_build( VipsObject *object ) ++vips_foreign_save_matrix_file_build(VipsObject *object) + { + VipsForeignSaveMatrix *matrix = (VipsForeignSaveMatrix *) object; + VipsForeignSaveMatrixFile *file = (VipsForeignSaveMatrixFile *) object; + +- if( file->filename && +- !(matrix->target = vips_target_new_to_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(matrix->target = vips_target_new_to_file(file->filename))) ++ return (-1); + +- return( VIPS_OBJECT_CLASS( +- vips_foreign_save_matrix_file_parent_class )->build( object ) ); ++ return (VIPS_OBJECT_CLASS( ++ vips_foreign_save_matrix_file_parent_class) ++ ->build(object)); + } + + static void +-vips_foreign_save_matrix_file_class_init( +- VipsForeignSaveMatrixFileClass *class ) ++vips_foreign_save_matrix_file_class_init( ++ VipsForeignSaveMatrixFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -227,17 +225,16 @@ vips_foreign_save_matrix_file_class_init( + object_class->nickname = "matrixsave"; + object_class->build = vips_foreign_save_matrix_file_build; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveMatrixFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveMatrixFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_matrix_file_init( VipsForeignSaveMatrixFile *file ) ++vips_foreign_save_matrix_file_init(VipsForeignSaveMatrixFile *file) + { + } + +@@ -249,31 +246,31 @@ typedef struct _VipsForeignSaveMatrixTarget { + + typedef VipsForeignSaveMatrixClass VipsForeignSaveMatrixTargetClass; + +-G_DEFINE_TYPE( VipsForeignSaveMatrixTarget, vips_foreign_save_matrix_target, +- vips_foreign_save_matrix_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveMatrixTarget, vips_foreign_save_matrix_target, ++ vips_foreign_save_matrix_get_type()); + + static int +-vips_foreign_save_matrix_target_build( VipsObject *object ) ++vips_foreign_save_matrix_target_build(VipsObject *object) + { + VipsForeignSaveMatrix *matrix = (VipsForeignSaveMatrix *) object; +- VipsForeignSaveMatrixTarget *target = ++ VipsForeignSaveMatrixTarget *target = + (VipsForeignSaveMatrixTarget *) object; + +- if( target->target ) { +- matrix->target = target->target; +- g_object_ref( matrix->target ); ++ if (target->target) { ++ matrix->target = target->target; ++ g_object_ref(matrix->target); + } + +- return( VIPS_OBJECT_CLASS( +- vips_foreign_save_matrix_target_parent_class )-> +- build( object ) ); ++ return (VIPS_OBJECT_CLASS( ++ vips_foreign_save_matrix_target_parent_class) ++ ->build(object)); + } + + static void +-vips_foreign_save_matrix_target_class_init( +- VipsForeignSaveMatrixTargetClass *class ) ++vips_foreign_save_matrix_target_class_init( ++ VipsForeignSaveMatrixTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -282,17 +279,16 @@ vips_foreign_save_matrix_target_class_init( + object_class->nickname = "matrixsave_target"; + object_class->build = vips_foreign_save_matrix_target_build; + +- VIPS_ARG_OBJECT( class, "target", 1, +- _( "Target" ), +- _( "Target to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveMatrixTarget, target ), +- VIPS_TYPE_TARGET ); +- ++ VIPS_ARG_OBJECT(class, "target", 1, ++ _("Target"), ++ _("Target to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveMatrixTarget, target), ++ VIPS_TYPE_TARGET); + } + + static void +-vips_foreign_save_matrix_target_init( VipsForeignSaveMatrixTarget *target ) ++vips_foreign_save_matrix_target_init(VipsForeignSaveMatrixTarget *target) + { + } + +@@ -303,42 +299,41 @@ typedef struct _VipsForeignPrintMatrix { + + typedef VipsForeignSaveClass VipsForeignPrintMatrixClass; + +-G_DEFINE_TYPE( VipsForeignPrintMatrix, vips_foreign_print_matrix, +- vips_foreign_save_matrix_get_type() ); ++G_DEFINE_TYPE(VipsForeignPrintMatrix, vips_foreign_print_matrix, ++ vips_foreign_save_matrix_get_type()); + + static int +-vips_foreign_print_matrix_build( VipsObject *object ) ++vips_foreign_print_matrix_build(VipsObject *object) + { + VipsForeignSaveMatrix *matrix = (VipsForeignSaveMatrix *) object; + +- if( !(matrix->target = vips_target_new_to_descriptor( 0 )) ) +- return( -1 ); ++ if (!(matrix->target = vips_target_new_to_descriptor(0))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_print_matrix_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_print_matrix_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_print_matrix_class_init( VipsForeignPrintMatrixClass *class ) ++vips_foreign_print_matrix_class_init(VipsForeignPrintMatrixClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + + object_class->nickname = "matrixprint"; +- object_class->description = _( "print matrix" ); ++ object_class->description = _("print matrix"); + object_class->build = vips_foreign_print_matrix_build; + } + + static void +-vips_foreign_print_matrix_init( VipsForeignPrintMatrix *matrix ) ++vips_foreign_print_matrix_init(VipsForeignPrintMatrix *matrix) + { + } + + /** + * vips_matrixsave: (method) +- * @in: image to save ++ * @in: image to save + * @filename: file to write to + * @...: %NULL-terminated list of optional named arguments + * +@@ -350,21 +345,21 @@ vips_foreign_print_matrix_init( VipsForeignPrintMatrix *matrix ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_matrixsave( VipsImage *in, const char *filename, ... ) ++vips_matrixsave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "matrixsave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("matrixsave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_matrixsave_target: (method) +- * @in: image to save ++ * @in: image to save + * @target: save image to this target + * @...: %NULL-terminated list of optional named arguments + * +@@ -375,21 +370,21 @@ vips_matrixsave( VipsImage *in, const char *filename, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_matrixsave_target( VipsImage *in, VipsTarget *target, ... ) ++vips_matrixsave_target(VipsImage *in, VipsTarget *target, ...) + { + va_list ap; + int result; + +- va_start( ap, target ); +- result = vips_call_split( "matrixsave_target", ap, in, target ); +- va_end( ap ); ++ va_start(ap, target); ++ result = vips_call_split("matrixsave_target", ap, in, target); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_matrixprint: (method) +- * @in: image to print ++ * @in: image to print + * @...: %NULL-terminated list of optional named arguments + * + * Print @in to %stdout in matrix format. See vips_matrixload() for a +@@ -400,14 +395,14 @@ vips_matrixsave_target( VipsImage *in, VipsTarget *target, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_matrixprint( VipsImage *in, ... ) ++vips_matrixprint(VipsImage *in, ...) + { + va_list ap; + int result; + +- va_start( ap, in ); +- result = vips_call_split( "matrixprint", ap, in ); +- va_end( ap ); ++ va_start(ap, in); ++ result = vips_call_split("matrixprint", ap, in); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/niftiload.c b/libvips/foreign/niftiload.c +index ded3163c46..474790efa0 100644 +--- a/libvips/foreign/niftiload.c ++++ b/libvips/foreign/niftiload.c +@@ -9,28 +9,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -42,12 +42,12 @@ + /* TODO + * + * - for uncompressed images, we could do direct mapping of the input +- * - perhaps we could stream compressed images? but only if ext is defined at ++ * - perhaps we could stream compressed images? but only if ext is defined at + * the start of the file + * (yes, file format is magic number, 348-byte header, extension data, + * pixel data, then all gz'd) + * - we could use the much faster byteswap in glib? +- * - I have not been able to test the ext stuff :( ++ * - I have not been able to test the ext stuff :( + * + * There should be at least a x2 speedup possible. + */ +@@ -87,7 +87,7 @@ typedef struct _VipsForeignLoadNifti { + nifti_image *nim; + + /* Wrap this VipsImage around the NIFTI pointer, then redirect read +- * requests to that. Saves a copy. ++ * requests to that. Saves a copy. + */ + VipsImage *memory; + +@@ -95,51 +95,49 @@ typedef struct _VipsForeignLoadNifti { + + typedef VipsForeignLoadClass VipsForeignLoadNiftiClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadNifti, vips_foreign_load_nifti, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadNifti, vips_foreign_load_nifti, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_nifti_dispose( GObject *gobject ) ++vips_foreign_load_nifti_dispose(GObject *gobject) + { + VipsForeignLoadNifti *nifti = (VipsForeignLoadNifti *) gobject; + +- VIPS_UNREF( nifti->source ); +- VIPS_UNREF( nifti->memory ); +- VIPS_FREEF( nifti_image_free, nifti->nim ); ++ VIPS_UNREF(nifti->source); ++ VIPS_UNREF(nifti->memory); ++ VIPS_FREEF(nifti_image_free, nifti->nim); + +- G_OBJECT_CLASS( vips_foreign_load_nifti_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_nifti_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_load_nifti_build( VipsObject *object ) ++vips_foreign_load_nifti_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsForeignLoadNifti *nifti = (VipsForeignLoadNifti *) object; + + /* We can only open source which have an associated filename, since + * the nifti library works in terms of filenames. + */ +- if( nifti->source ) { +- VipsConnection *connection = VIPS_CONNECTION( nifti->source ); ++ if (nifti->source) { ++ VipsConnection *connection = VIPS_CONNECTION(nifti->source); + + const char *filename; + +- if( !vips_source_is_file( nifti->source ) || +- !(filename = vips_connection_filename( connection )) ) { +- vips_error( class->nickname, +- "%s", _( "no filename available" ) ); +- return( -1 ); ++ if (!vips_source_is_file(nifti->source) || ++ !(filename = vips_connection_filename(connection))) { ++ vips_error(class->nickname, ++ "%s", _("no filename available")); ++ return (-1); + } + +- nifti->filename = filename; ++ nifti->filename = filename; + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_nifti_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_nifti_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Map DT_* datatype values to VipsBandFormat. +@@ -147,7 +145,7 @@ vips_foreign_load_nifti_build( VipsObject *object ) + typedef struct _VipsForeignDT2Vips { + int datatype; + VipsBandFormat fmt; +-} VipsForeignDT2Vips ; ++} VipsForeignDT2Vips; + + static VipsForeignDT2Vips vips_foreign_nifti_DT2Vips[] = { + { DT_UINT8, VIPS_FORMAT_UCHAR }, +@@ -165,27 +163,27 @@ static VipsForeignDT2Vips vips_foreign_nifti_DT2Vips[] = { + }; + + VipsBandFormat +-vips__foreign_nifti_datatype2BandFmt( int datatype ) ++vips__foreign_nifti_datatype2BandFmt(int datatype) + { + int i; + +- for( i = 0; i < VIPS_NUMBER( vips_foreign_nifti_DT2Vips ); i++ ) +- if( vips_foreign_nifti_DT2Vips[i].datatype == datatype ) +- return( vips_foreign_nifti_DT2Vips[i].fmt ); ++ for (i = 0; i < VIPS_NUMBER(vips_foreign_nifti_DT2Vips); i++) ++ if (vips_foreign_nifti_DT2Vips[i].datatype == datatype) ++ return (vips_foreign_nifti_DT2Vips[i].fmt); + +- return( VIPS_FORMAT_NOTSET ); ++ return (VIPS_FORMAT_NOTSET); + } + + int +-vips__foreign_nifti_BandFmt2datatype( VipsBandFormat fmt ) ++vips__foreign_nifti_BandFmt2datatype(VipsBandFormat fmt) + { + int i; + +- for( i = 0; i < VIPS_NUMBER( vips_foreign_nifti_DT2Vips ); i++ ) +- if( vips_foreign_nifti_DT2Vips[i].fmt == fmt ) +- return( vips_foreign_nifti_DT2Vips[i].datatype ); ++ for (i = 0; i < VIPS_NUMBER(vips_foreign_nifti_DT2Vips); i++) ++ if (vips_foreign_nifti_DT2Vips[i].fmt == fmt) ++ return (vips_foreign_nifti_DT2Vips[i].datatype); + +- return( -1 ); ++ return (-1); + } + + /* All the header fields we attach as metadata. +@@ -200,191 +198,191 @@ static VipsForeignNiftiFields vips_foreign_nifti_fields[] = { + /* The first 8 must be the dims[] fields, see + * vips_foreign_save_nifti_make_nim(). + */ +- { "ndim", G_TYPE_INT, G_STRUCT_OFFSET( nifti_image, ndim ) }, +- { "nx", G_TYPE_INT, G_STRUCT_OFFSET( nifti_image, nx ) }, +- { "ny", G_TYPE_INT, G_STRUCT_OFFSET( nifti_image, ny ) }, +- { "nz", G_TYPE_INT, G_STRUCT_OFFSET( nifti_image, nz ) }, +- { "nt", G_TYPE_INT, G_STRUCT_OFFSET( nifti_image, nt ) }, +- { "nu", G_TYPE_INT, G_STRUCT_OFFSET( nifti_image, nu ) }, +- { "nv", G_TYPE_INT, G_STRUCT_OFFSET( nifti_image, nv ) }, +- { "nw", G_TYPE_INT, G_STRUCT_OFFSET( nifti_image, nw ) }, +- +- { "dx", G_TYPE_DOUBLE, G_STRUCT_OFFSET( nifti_image, dx ) }, +- { "dy", G_TYPE_DOUBLE, G_STRUCT_OFFSET( nifti_image, dy ) }, +- { "dz", G_TYPE_DOUBLE, G_STRUCT_OFFSET( nifti_image, dz ) }, +- { "dt", G_TYPE_DOUBLE, G_STRUCT_OFFSET( nifti_image, dt ) }, +- { "du", G_TYPE_DOUBLE, G_STRUCT_OFFSET( nifti_image, du ) }, +- { "dv", G_TYPE_DOUBLE, G_STRUCT_OFFSET( nifti_image, dv ) }, +- { "dw", G_TYPE_DOUBLE, G_STRUCT_OFFSET( nifti_image, dw ) }, +- +- { "scl_slope", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, scl_slope ) }, +- { "scl_inter", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, scl_inter ) }, +- +- { "cal_min", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, cal_min ) }, +- { "cal_max", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, cal_max ) }, +- +- { "qform_code", G_TYPE_INT, +- G_STRUCT_OFFSET( nifti_image, qform_code ) }, +- { "sform_code", G_TYPE_INT, +- G_STRUCT_OFFSET( nifti_image, sform_code ) }, +- +- { "freq_dim", G_TYPE_INT, +- G_STRUCT_OFFSET( nifti_image, freq_dim ) }, +- { "phase_dim", G_TYPE_INT, +- G_STRUCT_OFFSET( nifti_image, phase_dim ) }, +- { "slice_dim", G_TYPE_INT, +- G_STRUCT_OFFSET( nifti_image, slice_dim ) }, +- +- { "slice_code", G_TYPE_INT, +- G_STRUCT_OFFSET( nifti_image, slice_code ) }, +- { "slice_start", G_TYPE_INT, +- G_STRUCT_OFFSET( nifti_image, slice_start ) }, +- { "slice_end", G_TYPE_INT, +- G_STRUCT_OFFSET( nifti_image, slice_end ) }, +- { "slice_duration", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, slice_duration ) }, +- +- { "quatern_b", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, quatern_b ) }, +- { "quatern_c", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, quatern_c ) }, +- { "quatern_d", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, quatern_d ) }, +- { "qoffset_x", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, qoffset_x ) }, +- { "qoffset_y", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, qoffset_y ) }, +- { "qoffset_z", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, qoffset_z ) }, +- { "qfac", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, qfac ) }, +- +- { "sto_xyz00", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[0][0] ) }, +- { "sto_xyz01", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[0][1] ) }, +- { "sto_xyz02", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[0][2] ) }, +- { "sto_xyz03", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[0][3] ) }, +- +- { "sto_xyz10", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[1][0] ) }, +- { "sto_xyz11", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[1][1] ) }, +- { "sto_xyz12", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[1][2] ) }, +- { "sto_xyz13", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[1][3] ) }, +- +- { "sto_xyz20", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[2][0] ) }, +- { "sto_xyz21", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[2][1] ) }, +- { "sto_xyz22", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[2][2] ) }, +- { "sto_xyz23", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[2][3] ) }, +- +- { "sto_xyz30", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[3][0] ) }, +- { "sto_xyz31", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[3][1] ) }, +- { "sto_xyz32", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[3][2] ) }, +- { "sto_xyz33", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, sto_xyz.m[3][3] ) }, +- +- { "toffset", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, toffset ) }, +- +- { "xyz_units", G_TYPE_INT, +- G_STRUCT_OFFSET( nifti_image, xyz_units ) }, +- { "time_units", G_TYPE_INT, +- G_STRUCT_OFFSET( nifti_image, time_units ) }, +- +- { "nifti_type", G_TYPE_INT, +- G_STRUCT_OFFSET( nifti_image, nifti_type ) }, +- { "intent_code", G_TYPE_INT, +- G_STRUCT_OFFSET( nifti_image, intent_code ) }, +- { "intent_p1", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, intent_p1 ) }, +- { "intent_p2", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, intent_p2 ) }, +- { "intent_p3", G_TYPE_DOUBLE, +- G_STRUCT_OFFSET( nifti_image, intent_p3 ) }, ++ { "ndim", G_TYPE_INT, G_STRUCT_OFFSET(nifti_image, ndim) }, ++ { "nx", G_TYPE_INT, G_STRUCT_OFFSET(nifti_image, nx) }, ++ { "ny", G_TYPE_INT, G_STRUCT_OFFSET(nifti_image, ny) }, ++ { "nz", G_TYPE_INT, G_STRUCT_OFFSET(nifti_image, nz) }, ++ { "nt", G_TYPE_INT, G_STRUCT_OFFSET(nifti_image, nt) }, ++ { "nu", G_TYPE_INT, G_STRUCT_OFFSET(nifti_image, nu) }, ++ { "nv", G_TYPE_INT, G_STRUCT_OFFSET(nifti_image, nv) }, ++ { "nw", G_TYPE_INT, G_STRUCT_OFFSET(nifti_image, nw) }, ++ ++ { "dx", G_TYPE_DOUBLE, G_STRUCT_OFFSET(nifti_image, dx) }, ++ { "dy", G_TYPE_DOUBLE, G_STRUCT_OFFSET(nifti_image, dy) }, ++ { "dz", G_TYPE_DOUBLE, G_STRUCT_OFFSET(nifti_image, dz) }, ++ { "dt", G_TYPE_DOUBLE, G_STRUCT_OFFSET(nifti_image, dt) }, ++ { "du", G_TYPE_DOUBLE, G_STRUCT_OFFSET(nifti_image, du) }, ++ { "dv", G_TYPE_DOUBLE, G_STRUCT_OFFSET(nifti_image, dv) }, ++ { "dw", G_TYPE_DOUBLE, G_STRUCT_OFFSET(nifti_image, dw) }, ++ ++ { "scl_slope", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, scl_slope) }, ++ { "scl_inter", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, scl_inter) }, ++ ++ { "cal_min", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, cal_min) }, ++ { "cal_max", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, cal_max) }, ++ ++ { "qform_code", G_TYPE_INT, ++ G_STRUCT_OFFSET(nifti_image, qform_code) }, ++ { "sform_code", G_TYPE_INT, ++ G_STRUCT_OFFSET(nifti_image, sform_code) }, ++ ++ { "freq_dim", G_TYPE_INT, ++ G_STRUCT_OFFSET(nifti_image, freq_dim) }, ++ { "phase_dim", G_TYPE_INT, ++ G_STRUCT_OFFSET(nifti_image, phase_dim) }, ++ { "slice_dim", G_TYPE_INT, ++ G_STRUCT_OFFSET(nifti_image, slice_dim) }, ++ ++ { "slice_code", G_TYPE_INT, ++ G_STRUCT_OFFSET(nifti_image, slice_code) }, ++ { "slice_start", G_TYPE_INT, ++ G_STRUCT_OFFSET(nifti_image, slice_start) }, ++ { "slice_end", G_TYPE_INT, ++ G_STRUCT_OFFSET(nifti_image, slice_end) }, ++ { "slice_duration", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, slice_duration) }, ++ ++ { "quatern_b", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, quatern_b) }, ++ { "quatern_c", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, quatern_c) }, ++ { "quatern_d", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, quatern_d) }, ++ { "qoffset_x", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, qoffset_x) }, ++ { "qoffset_y", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, qoffset_y) }, ++ { "qoffset_z", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, qoffset_z) }, ++ { "qfac", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, qfac) }, ++ ++ { "sto_xyz00", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[0][0]) }, ++ { "sto_xyz01", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[0][1]) }, ++ { "sto_xyz02", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[0][2]) }, ++ { "sto_xyz03", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[0][3]) }, ++ ++ { "sto_xyz10", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[1][0]) }, ++ { "sto_xyz11", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[1][1]) }, ++ { "sto_xyz12", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[1][2]) }, ++ { "sto_xyz13", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[1][3]) }, ++ ++ { "sto_xyz20", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[2][0]) }, ++ { "sto_xyz21", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[2][1]) }, ++ { "sto_xyz22", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[2][2]) }, ++ { "sto_xyz23", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[2][3]) }, ++ ++ { "sto_xyz30", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[3][0]) }, ++ { "sto_xyz31", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[3][1]) }, ++ { "sto_xyz32", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[3][2]) }, ++ { "sto_xyz33", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, sto_xyz.m[3][3]) }, ++ ++ { "toffset", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, toffset) }, ++ ++ { "xyz_units", G_TYPE_INT, ++ G_STRUCT_OFFSET(nifti_image, xyz_units) }, ++ { "time_units", G_TYPE_INT, ++ G_STRUCT_OFFSET(nifti_image, time_units) }, ++ ++ { "nifti_type", G_TYPE_INT, ++ G_STRUCT_OFFSET(nifti_image, nifti_type) }, ++ { "intent_code", G_TYPE_INT, ++ G_STRUCT_OFFSET(nifti_image, intent_code) }, ++ { "intent_p1", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, intent_p1) }, ++ { "intent_p2", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, intent_p2) }, ++ { "intent_p3", G_TYPE_DOUBLE, ++ G_STRUCT_OFFSET(nifti_image, intent_p3) }, + }; + + void * +-vips__foreign_nifti_map( VipsNiftiMapFn fn, void *a, void *b ) ++vips__foreign_nifti_map(VipsNiftiMapFn fn, void *a, void *b) + { + int i; + void *result; + +- for( i = 0; i < VIPS_NUMBER( vips_foreign_nifti_fields ); i++ ) { ++ for (i = 0; i < VIPS_NUMBER(vips_foreign_nifti_fields); i++) { + GValue value = { 0 }; + +- g_value_init( &value, vips_foreign_nifti_fields[i].type ); +- result = fn( vips_foreign_nifti_fields[i].name, &value, +- vips_foreign_nifti_fields[i].offset, a, b ); +- g_value_unset( &value ); ++ g_value_init(&value, vips_foreign_nifti_fields[i].type); ++ result = fn(vips_foreign_nifti_fields[i].name, &value, ++ vips_foreign_nifti_fields[i].offset, a, b); ++ g_value_unset(&value); + +- if( result ) +- return( result ); ++ if (result) ++ return (result); + } + +- return( NULL ); ++ return (NULL); + } + + /* How I wish glib had something like this :( Just implement the ones we need + * for vips_foreign_nifti_fields above. + */ + static void +-vips_gvalue_read( GValue *value, void *p ) ++vips_gvalue_read(GValue *value, void *p) + { +- switch( G_VALUE_TYPE( value ) ) { ++ switch (G_VALUE_TYPE(value)) { + case G_TYPE_INT: +- g_value_set_int( value, *((int *) p) ); ++ g_value_set_int(value, *((int *) p)); + break; + + case G_TYPE_DOUBLE: + /* We set as double rather than float, as things like pyvips + * expect double for metadata items. + */ +- g_value_set_double( value, *((float *) p) ); ++ g_value_set_double(value, *((float *) p)); + break; + + default: +- g_warning( "vips_gvalue_read: unsupported GType %s", +- g_type_name( G_VALUE_TYPE( value ) ) ); ++ g_warning("vips_gvalue_read: unsupported GType %s", ++ g_type_name(G_VALUE_TYPE(value))); + } + } + + static void * +-vips_foreign_load_nifti_set( const char *name, GValue *value, glong offset, +- void *a, void *b ) ++vips_foreign_load_nifti_set(const char *name, GValue *value, glong offset, ++ void *a, void *b) + { + nifti_image *nim = (nifti_image *) a; +- VipsImage *out = VIPS_IMAGE( b ); ++ VipsImage *out = VIPS_IMAGE(b); + + char vips_name[256]; + +- vips_gvalue_read( value, (gpointer) nim + offset ); +- vips_snprintf( vips_name, 256, "nifti-%s", name ); +- vips_image_set( out, vips_name, value ); ++ vips_gvalue_read(value, (gpointer) nim + offset); ++ vips_snprintf(vips_name, 256, "nifti-%s", name); ++ vips_image_set(out, vips_name, value); + +- return( NULL ); ++ return (NULL); + } + + static int +-vips_foreign_load_nifti_set_header( VipsForeignLoadNifti *nifti, +- nifti_image *nim, VipsImage *out ) ++vips_foreign_load_nifti_set_header(VipsForeignLoadNifti *nifti, ++ nifti_image *nim, VipsImage *out) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( nifti ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(nifti); + + guint width; + guint height; +@@ -395,29 +393,29 @@ vips_foreign_load_nifti_set_header( VipsForeignLoadNifti *nifti, + int i; + char txt[256]; + +- if( nim->ndim < 1 || +- nim->ndim > 7 ) { +- vips_error( class->nickname, +- _( "%d-dimensional images not supported" ), +- nim->ndim ); +- return( 0 ); ++ if (nim->ndim < 1 || ++ nim->ndim > 7) { ++ vips_error(class->nickname, ++ _("%d-dimensional images not supported"), ++ nim->ndim); ++ return (0); + } +- for( i = 1; i < 8 && i < nim->ndim + 1; i++ ) { +- if( nim->dim[i] <= 0 ) { +- vips_error( class->nickname, +- "%s", _( "invalid dimension" ) ); +- return( 0 ); ++ for (i = 1; i < 8 && i < nim->ndim + 1; i++) { ++ if (nim->dim[i] <= 0) { ++ vips_error(class->nickname, ++ "%s", _("invalid dimension")); ++ return (0); + } + + /* If we have several images in a dimension, the spacing must + * be non-zero or we'll get a /0 error in resolution + * calculation. + */ +- if( nim->dim[i] > 1 && +- nim->pixdim[i] == 0 ) { +- vips_error( class->nickname, +- "%s", _( "invalid resolution" ) ); +- return( 0 ); ++ if (nim->dim[i] > 1 && ++ nim->pixdim[i] == 0) { ++ vips_error(class->nickname, ++ "%s", _("invalid resolution")); ++ return (0); + } + } + +@@ -427,48 +425,48 @@ vips_foreign_load_nifti_set_header( VipsForeignLoadNifti *nifti, + bands = 1; + width = (guint) nim->nx; + height = (guint) nim->ny; +- for( i = 3; i < 8 && i < nim->ndim + 1; i++ ) +- if( !g_uint_checked_mul( &height, height, nim->dim[i] ) ) { +- vips_error( class->nickname, +- "%s", _( "dimension overflow" ) ); +- return( 0 ); ++ for (i = 3; i < 8 && i < nim->ndim + 1; i++) ++ if (!g_uint_checked_mul(&height, height, nim->dim[i])) { ++ vips_error(class->nickname, ++ "%s", _("dimension overflow")); ++ return (0); + } +- if( height > INT_MAX ) { +- vips_error( class->nickname, "%s", _( "dimension overflow" ) ); +- return( 0 ); ++ if (height > INT_MAX) { ++ vips_error(class->nickname, "%s", _("dimension overflow")); ++ return (0); + } + +- fmt = vips__foreign_nifti_datatype2BandFmt( nim->datatype ); +- if( fmt == VIPS_FORMAT_NOTSET ) { +- vips_error( class->nickname, +- _( "datatype %d not supported" ), nim->datatype ); +- return( -1 ); ++ fmt = vips__foreign_nifti_datatype2BandFmt(nim->datatype); ++ if (fmt == VIPS_FORMAT_NOTSET) { ++ vips_error(class->nickname, ++ _("datatype %d not supported"), nim->datatype); ++ return (-1); + } + +- if( nim->datatype == DT_RGB ) ++ if (nim->datatype == DT_RGB) + bands = 3; +- if( nim->datatype == DT_RGBA32 ) ++ if (nim->datatype == DT_RGBA32) + bands = 4; + + /* We fold y and z together, so they must have the same resolution.. + */ + xres = 1.0; + yres = 1.0; +- if( nim->nz == 1 || +- nim->dz == nim->dy ) +- switch( nim->xyz_units ) { ++ if (nim->nz == 1 || ++ nim->dz == nim->dy) ++ switch (nim->xyz_units) { + case NIFTI_UNITS_METER: +- xres = 1000.0 / nim->dx; +- yres = 1000.0 / nim->dy; +- break; ++ xres = 1000.0 / nim->dx; ++ yres = 1000.0 / nim->dy; ++ break; + case NIFTI_UNITS_MM: +- xres = 1.0 / nim->dx; +- yres = 1.0 / nim->dy; ++ xres = 1.0 / nim->dx; ++ yres = 1.0 / nim->dy; + break; + + case NIFTI_UNITS_MICRON: +- xres = 1.0 / (1000.0 * nim->dx); +- yres = 1.0 / (1000.0 * nim->dy); ++ xres = 1.0 / (1000.0 * nim->dx); ++ yres = 1.0 / (1000.0 * nim->dy); + break; + + default: +@@ -476,52 +474,51 @@ vips_foreign_load_nifti_set_header( VipsForeignLoadNifti *nifti, + } + + #ifdef DEBUG +- printf( "get_vips_properties: width = %d\n", width ); +- printf( "get_vips_properties: height = %d\n", height ); +- printf( "get_vips_properties: bands = %d\n", bands ); +- printf( "get_vips_properties: fmt = %d\n", fmt ); ++ printf("get_vips_properties: width = %d\n", width); ++ printf("get_vips_properties: height = %d\n", height); ++ printf("get_vips_properties: bands = %d\n", bands); ++ printf("get_vips_properties: fmt = %d\n", fmt); + #endif /*DEBUG*/ + +- /* We load to memory then write to out, so we'll hint THINSTRIP. +- */ +- vips_image_pipelinev( out, VIPS_DEMAND_STYLE_THINSTRIP, NULL ); ++ /* We load to memory then write to out, so we'll hint THINSTRIP. ++ */ ++ vips_image_pipelinev(out, VIPS_DEMAND_STYLE_THINSTRIP, NULL); + +- vips_image_init_fields( out, +- width, height, bands, fmt, +- VIPS_CODING_NONE, +- bands == 1 ? +- VIPS_INTERPRETATION_B_W : VIPS_INTERPRETATION_sRGB, +- xres, yres ); ++ vips_image_init_fields(out, ++ width, height, bands, fmt, ++ VIPS_CODING_NONE, ++ bands == 1 ? VIPS_INTERPRETATION_B_W : VIPS_INTERPRETATION_sRGB, ++ xres, yres); + + /* Set some vips metadata for every nifti header field. + */ +- if( vips__foreign_nifti_map( vips_foreign_load_nifti_set, nim, out ) ) +- return( -1 ); ++ if (vips__foreign_nifti_map(vips_foreign_load_nifti_set, nim, out)) ++ return (-1); + + /* One byte longer than the spec to leave space for any extra + * '\0' termination. + */ +- vips_strncpy( txt, nim->intent_name, 17 ); +- vips_image_set_string( out, "nifti-intent_name", txt ); +- vips_strncpy( txt, nim->descrip, 81 ); +- vips_image_set_string( out, "nifti-descrip", txt ); ++ vips_strncpy(txt, nim->intent_name, 17); ++ vips_image_set_string(out, "nifti-intent_name", txt); ++ vips_strncpy(txt, nim->descrip, 81); ++ vips_image_set_string(out, "nifti-descrip", txt); + +- for( i = 0; i < nim->num_ext; i++ ) { ++ for (i = 0; i < nim->num_ext; i++) { + nifti1_extension *ext = &nim->ext_list[i]; + +- vips_snprintf( txt, 256, "nifti-ext-%d-%d", i, ext->ecode ); +- vips_image_set_blob_copy( out, txt, ext->edata, ext->esize ); ++ vips_snprintf(txt, 256, "nifti-ext-%d-%d", i, ext->ecode); ++ vips_image_set_blob_copy(out, txt, ext->edata, ext->esize); + } + +- vips_image_set_int( out, VIPS_META_PAGE_HEIGHT, nim->ny ); ++ vips_image_set_int(out, VIPS_META_PAGE_HEIGHT, nim->ny); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_nifti_header( VipsForeignLoad *load ) ++vips_foreign_load_nifti_header(VipsForeignLoad *load) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( load ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(load); + VipsForeignLoadNifti *nifti = (VipsForeignLoadNifti *) load; + + /* We can't use the (much faster) nifti_read_header() since it just +@@ -532,58 +529,58 @@ vips_foreign_load_nifti_header( VipsForeignLoad *load ) + /* FALSE means don't read data, just the header. Use + * nifti_image_load() later to pull the data in. + */ +- if( !(nifti->nim = nifti_image_read( nifti->filename, FALSE )) ) { +- vips_error( class->nickname, +- "%s", _( "unable to read NIFTI header" ) ); +- return( 0 ); ++ if (!(nifti->nim = nifti_image_read(nifti->filename, FALSE))) { ++ vips_error(class->nickname, ++ "%s", _("unable to read NIFTI header")); ++ return (0); + } + +- if( vips_foreign_load_nifti_set_header( nifti, +- nifti->nim, load->out ) ) { +- return( -1 ); ++ if (vips_foreign_load_nifti_set_header(nifti, ++ nifti->nim, load->out)) { ++ return (-1); + } + +- VIPS_SETSTR( load->out->filename, nifti->filename ); ++ VIPS_SETSTR(load->out->filename, nifti->filename); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_nifti_load( VipsForeignLoad *load ) ++vips_foreign_load_nifti_load(VipsForeignLoad *load) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( load ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(load); + VipsForeignLoadNifti *nifti = (VipsForeignLoadNifti *) load; + + #ifdef DEBUG +- printf( "vips_foreign_load_nifti_load: loading image\n" ); ++ printf("vips_foreign_load_nifti_load: loading image\n"); + #endif /*DEBUG*/ + +- /* We just read the entire image to memory. ++ /* We just read the entire image to memory. + */ +- if( nifti_image_load( nifti->nim ) ) { +- vips_error( class->nickname, +- "%s", _( "unable to load NIFTI file" ) ); +- return( -1 ); ++ if (nifti_image_load(nifti->nim)) { ++ vips_error(class->nickname, ++ "%s", _("unable to load NIFTI file")); ++ return (-1); + } + +- if( !(nifti->memory = vips_image_new_from_memory( +- nifti->nim->data, VIPS_IMAGE_SIZEOF_IMAGE( load->out ), +- load->out->Xsize, load->out->Ysize, +- load->out->Bands, load->out->BandFmt )) ) +- return( -1 ); ++ if (!(nifti->memory = vips_image_new_from_memory( ++ nifti->nim->data, VIPS_IMAGE_SIZEOF_IMAGE(load->out), ++ load->out->Xsize, load->out->Ysize, ++ load->out->Bands, load->out->BandFmt))) ++ return (-1); + +- if( vips_image_write( nifti->memory, load->real ) ) +- return( -1 ); ++ if (vips_image_write(nifti->memory, load->real)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_nifti_class_init( VipsForeignLoadNiftiClass *class ) ++vips_foreign_load_nifti_class_init(VipsForeignLoadNiftiClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -592,7 +589,7 @@ vips_foreign_load_nifti_class_init( VipsForeignLoadNiftiClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "niftiload_base"; +- object_class->description = _( "load a NIFTI image" ); ++ object_class->description = _("load a NIFTI image"); + object_class->build = vips_foreign_load_nifti_build; + + /* nificlib has not been fuzzed, so should not be used with +@@ -609,7 +606,7 @@ vips_foreign_load_nifti_class_init( VipsForeignLoadNiftiClass *class ) + } + + static void +-vips_foreign_load_nifti_init( VipsForeignLoadNifti *nifti ) ++vips_foreign_load_nifti_init(VipsForeignLoadNifti *nifti) + { + } + +@@ -618,43 +615,42 @@ typedef struct _VipsForeignLoadNiftiFile { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadNiftiFile; + + typedef VipsForeignLoadNiftiClass VipsForeignLoadNiftiFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadNiftiFile, vips_foreign_load_nifti_file, +- vips_foreign_load_nifti_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadNiftiFile, vips_foreign_load_nifti_file, ++ vips_foreign_load_nifti_get_type()); + + static int +-vips_foreign_load_nifti_file_build( VipsObject *object ) ++vips_foreign_load_nifti_file_build(VipsObject *object) + { + VipsForeignLoadNifti *nifti = (VipsForeignLoadNifti *) object; + VipsForeignLoadNiftiFile *file = (VipsForeignLoadNiftiFile *) object; + +- if( file->filename && +- !(nifti->source = +- vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(nifti->source = ++ vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_nifti_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_nifti_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-const char *vips_foreign_nifti_suffs[] = { +- ".nii", ".nii.gz", +- ".hdr", ".hdr.gz", +- ".img", ".img.gz", +- ".nia", ".nia.gz", +- NULL ++const char *vips_foreign_nifti_suffs[] = { ++ ".nii", ".nii.gz", ++ ".hdr", ".hdr.gz", ++ ".img", ".img.gz", ++ ".nia", ".nia.gz", ++ NULL + }; + + static int +-vips_foreign_load_nifti_is_a( const char *filename ) ++vips_foreign_load_nifti_is_a(const char *filename) + { + char *hfile; + znzFile fp; +@@ -664,37 +660,37 @@ vips_foreign_load_nifti_is_a( const char *filename ) + * output. We have to make our own. + */ + +- if( !(hfile = nifti_findhdrname( filename )) ) +- return( 0 ); ++ if (!(hfile = nifti_findhdrname(filename))) ++ return (0); + +- fp = znzopen( hfile, "rb", nifti_is_gzfile( hfile )); +- if( znz_isnull( fp ) ) { +- free( hfile ); +- return( 0 ); ++ fp = znzopen(hfile, "rb", nifti_is_gzfile(hfile)); ++ if (znz_isnull(fp)) { ++ free(hfile); ++ return (0); + } +- free( hfile ); ++ free(hfile); + +- (void) znzread( &nhdr, 1, sizeof( nhdr ), fp ); ++ (void) znzread(&nhdr, 1, sizeof(nhdr), fp); + +- znzclose( fp ); ++ znzclose(fp); + + /* Test for sanity both ways around. There's a thing to test for byte + * order in niftilib, but it's static :( + */ +- if( nifti_hdr_looks_good( &nhdr ) ) +- return( 1 ); +- swap_nifti_header( &nhdr, FALSE ); +- if( nifti_hdr_looks_good( &nhdr ) ) +- return( 1 ); ++ if (nifti_hdr_looks_good(&nhdr)) ++ return (1); ++ swap_nifti_header(&nhdr, FALSE); ++ if (nifti_hdr_looks_good(&nhdr)) ++ return (1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_nifti_file_class_init( +- VipsForeignLoadNiftiFileClass *class ) ++vips_foreign_load_nifti_file_class_init( ++ VipsForeignLoadNiftiFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -703,24 +699,23 @@ vips_foreign_load_nifti_file_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "niftiload"; +- object_class->description = _( "load NIfTI volume" ); ++ object_class->description = _("load NIfTI volume"); + object_class->build = vips_foreign_load_nifti_file_build; + + foreign_class->suffs = vips_foreign_nifti_suffs; + + load_class->is_a = vips_foreign_load_nifti_is_a; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadNiftiFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadNiftiFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_nifti_file_init( VipsForeignLoadNiftiFile *nifti ) ++vips_foreign_load_nifti_file_init(VipsForeignLoadNiftiFile *nifti) + { + } + +@@ -735,74 +730,73 @@ typedef struct _VipsForeignLoadNiftiSource { + + typedef VipsForeignLoadNiftiClass VipsForeignLoadNiftiSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadNiftiSource, vips_foreign_load_nifti_source, +- vips_foreign_load_nifti_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadNiftiSource, vips_foreign_load_nifti_source, ++ vips_foreign_load_nifti_get_type()); + + static int +-vips_foreign_load_nifti_source_build( VipsObject *object ) ++vips_foreign_load_nifti_source_build(VipsObject *object) + { + VipsForeignLoadNifti *nifti = (VipsForeignLoadNifti *) object; +- VipsForeignLoadNiftiSource *source = ++ VipsForeignLoadNiftiSource *source = + (VipsForeignLoadNiftiSource *) object; + +- if( source->source ) { ++ if (source->source) { + nifti->source = source->source; +- g_object_ref( nifti->source ); ++ g_object_ref(nifti->source); + } + +- if( VIPS_OBJECT_CLASS( +- vips_foreign_load_nifti_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS( ++ vips_foreign_load_nifti_source_parent_class) ++ ->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_nifti_source_is_a_source( VipsSource *source ) ++vips_foreign_load_nifti_source_is_a_source(VipsSource *source) + { +- VipsConnection *connection = VIPS_CONNECTION( source ); ++ VipsConnection *connection = VIPS_CONNECTION(source); + + const char *filename; + +- return( vips_source_is_file( source ) && +- (filename = vips_connection_filename( connection )) && +- vips_foreign_load_nifti_is_a( filename ) ); ++ return (vips_source_is_file(source) && ++ (filename = vips_connection_filename(connection)) && ++ vips_foreign_load_nifti_is_a(filename)); + } + + static void +-vips_foreign_load_nifti_source_class_init( +- VipsForeignLoadNiftiSourceClass *class ) ++vips_foreign_load_nifti_source_class_init( ++ VipsForeignLoadNiftiSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "niftiload_source"; +- object_class->description = _( "load NIfTI volumes" ); ++ object_class->description = _("load NIfTI volumes"); + object_class->build = vips_foreign_load_nifti_source_build; + + operation_class->flags |= VIPS_OPERATION_NOCACHE; + +- load_class->is_a_source = ++ load_class->is_a_source = + vips_foreign_load_nifti_source_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadNiftiSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadNiftiSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_nifti_source_init( +- VipsForeignLoadNiftiSource *nifti ) ++vips_foreign_load_nifti_source_init( ++ VipsForeignLoadNiftiSource *nifti) + { + } + +@@ -814,7 +808,7 @@ vips_foreign_load_nifti_source_init( + * @out: (out): decompressed image + * @...: %NULL-terminated list of optional named arguments + * +- * Read a NIFTI image file into a VIPS image. ++ * Read a NIFTI image file into a VIPS image. + * + * NIFTI metadata is attached with the "nifti-" prefix. + * +@@ -823,16 +817,16 @@ vips_foreign_load_nifti_source_init( + * Returns: 0 on success, -1 on error. + */ + int +-vips_niftiload( const char *filename, VipsImage **out, ... ) ++vips_niftiload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "niftiload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("niftiload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -841,19 +835,19 @@ vips_niftiload( const char *filename, VipsImage **out, ... ) + * @out: (out): decompressed image + * @...: %NULL-terminated list of optional named arguments + * +- * Exactly as vips_niftiload(), but read from a source. ++ * Exactly as vips_niftiload(), but read from a source. + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_niftiload_source( VipsSource *source, VipsImage **out, ... ) ++vips_niftiload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "niftiload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("niftiload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/niftisave.c b/libvips/foreign/niftisave.c +index 47845feb7e..a790520416 100644 +--- a/libvips/foreign/niftisave.c ++++ b/libvips/foreign/niftisave.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -60,7 +60,7 @@ typedef struct _VipsForeignSaveNifti { + + /* Filename for save. + */ +- char *filename; ++ char *filename; + + nifti_image *nim; + +@@ -68,27 +68,26 @@ typedef struct _VipsForeignSaveNifti { + + typedef VipsForeignSaveClass VipsForeignSaveNiftiClass; + +-G_DEFINE_TYPE( VipsForeignSaveNifti, vips_foreign_save_nifti, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_TYPE(VipsForeignSaveNifti, vips_foreign_save_nifti, ++ VIPS_TYPE_FOREIGN_SAVE); + + static void +-vips_foreign_save_nifti_dispose( GObject *gobject ) ++vips_foreign_save_nifti_dispose(GObject *gobject) + { + VipsForeignSaveNifti *nifti = (VipsForeignSaveNifti *) gobject; + +- VIPS_FREEF( nifti_image_free, nifti->nim ); ++ VIPS_FREEF(nifti_image_free, nifti->nim); + +- G_OBJECT_CLASS( vips_foreign_save_nifti_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_nifti_parent_class)->dispose(gobject); + } + + /* Make ->nim from the vips header fields. + */ + static int +-vips_foreign_save_nifti_header_vips( VipsForeignSaveNifti *nifti, +- VipsImage *image ) ++vips_foreign_save_nifti_header_vips(VipsForeignSaveNifti *nifti, ++ VipsImage *image) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( nifti ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(nifti); + + int dims[8]; + int datatype; +@@ -96,60 +95,60 @@ vips_foreign_save_nifti_header_vips( VipsForeignSaveNifti *nifti, + + /* Most nifti images have this defaulted as 1. + */ +- for( i = 0; i < VIPS_NUMBER( dims ); i++ ) ++ for (i = 0; i < VIPS_NUMBER(dims); i++) + dims[i] = 1; + + dims[0] = 2; + dims[1] = image->Xsize; +- dims[2] = vips_image_get_page_height( image ); ++ dims[2] = vips_image_get_page_height(image); + + /* Multipage image? + */ +- if( dims[2] < image->Ysize ) { ++ if (dims[2] < image->Ysize) { + dims[0] = 3; + dims[3] = image->Ysize / dims[2]; + } + +- datatype = vips__foreign_nifti_BandFmt2datatype( image->BandFmt ); +- if( datatype == -1 ) { +- vips_error( class->nickname, +- "%s", _( "unsupported libvips image type" ) ); +- return( -1 ); ++ datatype = vips__foreign_nifti_BandFmt2datatype(image->BandFmt); ++ if (datatype == -1) { ++ vips_error(class->nickname, ++ "%s", _("unsupported libvips image type")); ++ return (-1); + } + +- if( image->Bands > 1 ) { +- if( image->BandFmt != VIPS_FORMAT_UCHAR ) { +- vips_error( class->nickname, +- "%s", _( "8-bit colour images only" ) ); +- return( -1 ); ++ if (image->Bands > 1) { ++ if (image->BandFmt != VIPS_FORMAT_UCHAR) { ++ vips_error(class->nickname, ++ "%s", _("8-bit colour images only")); ++ return (-1); + } + +- if( image->Bands == 3 ) ++ if (image->Bands == 3) + datatype = DT_RGB; +- else if( image->Bands == 4 ) ++ else if (image->Bands == 4) + datatype = DT_RGBA32; + else { +- vips_error( class->nickname, +- "%s", _( "3 or 4 band colour images only" ) ); +- return( -1 ); ++ vips_error(class->nickname, ++ "%s", _("3 or 4 band colour images only")); ++ return (-1); + } + } + +- if( !(nifti->nim = nifti_make_new_nim( dims, datatype, FALSE )) ) +- return( -1 ); ++ if (!(nifti->nim = nifti_make_new_nim(dims, datatype, FALSE))) ++ return (-1); + + nifti->nim->dx = 1.0 / image->Xres; + nifti->nim->dy = 1.0 / image->Yres; + nifti->nim->dz = 1.0 / image->Yres; + nifti->nim->xyz_units = NIFTI_UNITS_MM; + +- vips_snprintf( nifti->nim->descrip, sizeof( nifti->nim->descrip ), +- "libvips-%s", VIPS_VERSION ); ++ vips_snprintf(nifti->nim->descrip, sizeof(nifti->nim->descrip), ++ "libvips-%s", VIPS_VERSION); + + /* All other fields can stay at their default value. + */ + +- return( 0 ); ++ return (0); + } + + typedef struct _VipsNdimInfo { +@@ -160,79 +159,79 @@ typedef struct _VipsNdimInfo { + } VipsNdimInfo; + + static void * +-vips_foreign_save_nifti_set_dims( const char *name, +- GValue *value, glong offset, void *a, void *b ) ++vips_foreign_save_nifti_set_dims(const char *name, ++ GValue *value, glong offset, void *a, void *b) + { + VipsNdimInfo *info = (VipsNdimInfo *) a; + +- /* The first 8 members are the dims fields. ++ /* The first 8 members are the dims fields. + */ +- if( info->n < 8 ) { ++ if (info->n < 8) { + char vips_name[256]; + int i; + +- vips_snprintf( vips_name, 256, "nifti-%s", name ); +- if( vips_image_get_int( info->image, vips_name, &i ) || ++ vips_snprintf(vips_name, 256, "nifti-%s", name); ++ if (vips_image_get_int(info->image, vips_name, &i) || + i <= 0 || +- i >= VIPS_MAX_COORD ) +- return( info ); ++ i >= VIPS_MAX_COORD) ++ return (info); + info->dims[info->n] = i; + } + + info->n += 1; + +- return( NULL ); ++ return (NULL); + } + + /* How I wish glib had something like this :( Just implement the ones we need + * for vips_foreign_nifti_fields above. + */ + static void +-vips_gvalue_write( GValue *value, void *p ) ++vips_gvalue_write(GValue *value, void *p) + { +- switch( G_VALUE_TYPE( value ) ) { ++ switch (G_VALUE_TYPE(value)) { + case G_TYPE_INT: +- *((int *) p) = g_value_get_int( value ); ++ *((int *) p) = g_value_get_int(value); + break; + + case G_TYPE_DOUBLE: +- *((float *) p) = g_value_get_double( value ); ++ *((float *) p) = g_value_get_double(value); + break; + + default: +- g_warning( "vips_gvalue_write: unsupported GType %s", +- g_type_name( G_VALUE_TYPE( value ) ) ); ++ g_warning("vips_gvalue_write: unsupported GType %s", ++ g_type_name(G_VALUE_TYPE(value))); + } + } + + static void * +-vips_foreign_save_nifti_set_fields( const char *name, +- GValue *value, glong offset, void *a, void *b ) ++vips_foreign_save_nifti_set_fields(const char *name, ++ GValue *value, glong offset, void *a, void *b) + { + VipsNdimInfo *info = (VipsNdimInfo *) a; + + /* The first 8 members are the dims fields. We set them above ^^^ -- + * do the others in this pass. + */ +- if( info->n >= 8 ) { ++ if (info->n >= 8) { + char vips_name[256]; + GValue value_copy = { 0 }; + +- vips_snprintf( vips_name, 256, "nifti-%s", name ); +- if( vips_image_get( info->image, vips_name, &value_copy ) ) +- return( info ); +- vips_gvalue_write( &value_copy, (gpointer) info->nim + offset ); +- g_value_unset( &value_copy ); ++ vips_snprintf(vips_name, 256, "nifti-%s", name); ++ if (vips_image_get(info->image, vips_name, &value_copy)) ++ return (info); ++ vips_gvalue_write(&value_copy, (gpointer) info->nim + offset); ++ g_value_unset(&value_copy); + } + + info->n += 1; + +- return( NULL ); ++ return (NULL); + } + + static void * +-vips_foreign_save_nifti_ext( VipsImage *image, +- const char *field, GValue *value, void *a ) ++vips_foreign_save_nifti_ext(VipsImage *image, ++ const char *field, GValue *value, void *a) + { + nifti_image *nim = (nifti_image *) a; + +@@ -241,37 +240,37 @@ vips_foreign_save_nifti_ext( VipsImage *image, + char *data; + size_t length; + +- if( !vips_isprefix( "nifti-ext-", field ) ) +- return( NULL ); ++ if (!vips_isprefix("nifti-ext-", field)) ++ return (NULL); + + /* The name is "nifti-ext-N-XX" where N is the index (discard this) + * and XX is the nifti ext ecode. + */ +- if( sscanf( field, "nifti-ext-%d-%d", &i, &ecode ) != 2 ) { +- vips_error( "niftisave", +- "%s", _( "bad nifti-ext- field name" ) ); +- return( image ); ++ if (sscanf(field, "nifti-ext-%d-%d", &i, &ecode) != 2) { ++ vips_error("niftisave", ++ "%s", _("bad nifti-ext- field name")); ++ return (image); + } + +- if( vips_image_get_blob( image, field, (void *) &data, &length ) ) +- return( image ); ++ if (vips_image_get_blob(image, field, (void *) &data, &length)) ++ return (image); + +- if( nifti_add_extension( nim, data, length, ecode ) ) { +- vips_error( "niftisave", +- "%s", _( "unable to attach nifti ext" ) ); +- return( image ); ++ if (nifti_add_extension(nim, data, length, ecode)) { ++ vips_error("niftisave", ++ "%s", _("unable to attach nifti ext")); ++ return (image); + } + +- return( NULL ); ++ return (NULL); + } + + /* Make ->nim from the nifti- fields. + */ + static int +-vips_foreign_save_nifti_header_nifti( VipsForeignSaveNifti *nifti, +- VipsImage *image ) ++vips_foreign_save_nifti_header_nifti(VipsForeignSaveNifti *nifti, ++ VipsImage *image) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( nifti ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(nifti); + + VipsNdimInfo info; + int dims[8]; +@@ -281,117 +280,116 @@ vips_foreign_save_nifti_header_nifti( VipsForeignSaveNifti *nifti, + + /* Most nifti images have this defaulted as 1. + */ +- for( i = 0; i < VIPS_NUMBER( dims ); i++ ) ++ for (i = 0; i < VIPS_NUMBER(dims); i++) + dims[i] = 1; + + info.image = image; + info.dims = dims; + info.n = 0; +- if( vips__foreign_nifti_map( +- vips_foreign_save_nifti_set_dims, &info, NULL ) ) +- return( -1 ); ++ if (vips__foreign_nifti_map( ++ vips_foreign_save_nifti_set_dims, &info, NULL)) ++ return (-1); + + /* page-height overrides ny if it makes sense. This might not be +- * correct :( ++ * correct :( + */ +- dims[2] = vips_image_get_page_height( image ); ++ dims[2] = vips_image_get_page_height(image); + + /* Multipage image? + */ +- if( dims[2] < image->Ysize ) { ++ if (dims[2] < image->Ysize) { + dims[0] = 3; + dims[3] = image->Ysize / dims[2]; + } + + height = 1; +- for( i = 2; i < VIPS_NUMBER( dims ) && i < dims[0] + 1; i++ ) +- if( !g_uint_checked_mul( &height, height, dims[i] ) ) { +- vips_error( class->nickname, +- "%s", _( "dimension overflow" ) ); +- return( 0 ); ++ for (i = 2; i < VIPS_NUMBER(dims) && i < dims[0] + 1; i++) ++ if (!g_uint_checked_mul(&height, height, dims[i])) { ++ vips_error(class->nickname, ++ "%s", _("dimension overflow")); ++ return (0); + } +- if( image->Xsize != dims[1] || +- image->Ysize != height ) { +- vips_error( class->nickname, +- "%s", _( "bad image dimensions" ) ); +- return( -1 ); ++ if (image->Xsize != dims[1] || ++ image->Ysize != height) { ++ vips_error(class->nickname, ++ "%s", _("bad image dimensions")); ++ return (-1); + } + +- datatype = vips__foreign_nifti_BandFmt2datatype( image->BandFmt ); +- if( datatype == -1 ) { +- vips_error( class->nickname, +- "%s", _( "unsupported libvips image type" ) ); +- return( -1 ); ++ datatype = vips__foreign_nifti_BandFmt2datatype(image->BandFmt); ++ if (datatype == -1) { ++ vips_error(class->nickname, ++ "%s", _("unsupported libvips image type")); ++ return (-1); + } + +- if( !(nifti->nim = nifti_make_new_nim( dims, datatype, FALSE )) ) +- return( -1 ); ++ if (!(nifti->nim = nifti_make_new_nim(dims, datatype, FALSE))) ++ return (-1); + + info.image = image; + info.nim = nifti->nim; + info.n = 0; +- if( vips__foreign_nifti_map( +- vips_foreign_save_nifti_set_fields, &info, NULL ) ) +- return( -1 ); ++ if (vips__foreign_nifti_map( ++ vips_foreign_save_nifti_set_fields, &info, NULL)) ++ return (-1); + + /* Attach any ext blocks. + */ +- if( vips_image_map( image, +- (VipsImageMapFn) vips_foreign_save_nifti_ext, nifti->nim ) ) +- return( -1 ); ++ if (vips_image_map(image, ++ (VipsImageMapFn) vips_foreign_save_nifti_ext, nifti->nim)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_nifti_build( VipsObject *object ) ++vips_foreign_save_nifti_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveNifti *nifti = (VipsForeignSaveNifti *) object; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_nifti_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_nifti_parent_class)->build(object)) ++ return (-1); + +- /* This could be an image (indirectly) from niftiload, or something ++ /* This could be an image (indirectly) from niftiload, or something + * like OME_TIFF, which does not have all the "nifti-ndim" fields. + * + * If it doesn't look like a nifti, try to make a nifti header from + * what we have. + */ +- if( vips_image_get_typeof( save->ready, "nifti-ndim" ) ) { +- if( vips_foreign_save_nifti_header_nifti( nifti, save->ready ) ) +- return( -1 ); ++ if (vips_image_get_typeof(save->ready, "nifti-ndim")) { ++ if (vips_foreign_save_nifti_header_nifti(nifti, save->ready)) ++ return (-1); + } + else { +- if( vips_foreign_save_nifti_header_vips( nifti, save->ready ) ) +- return( -1 ); ++ if (vips_foreign_save_nifti_header_vips(nifti, save->ready)) ++ return (-1); + } + + /* set ext, plus other stuff + */ + +- if( nifti_set_filenames( nifti->nim, nifti->filename, FALSE, TRUE ) ) { +- vips_error( class->nickname, +- "%s", _( "unable to set nifti filename" ) ); +- return( -1 ); ++ if (nifti_set_filenames(nifti->nim, nifti->filename, FALSE, TRUE)) { ++ vips_error(class->nickname, ++ "%s", _("unable to set nifti filename")); ++ return (-1); + } + +- if( !(nifti->nim->data = +- vips_image_write_to_memory( save->ready, NULL )) ) +- return( -1 ); ++ if (!(nifti->nim->data = ++ vips_image_write_to_memory(save->ready, NULL))) ++ return (-1); + + /* No return code!??!?!! + */ +- nifti_image_write( nifti->nim ); ++ nifti_image_write(nifti->nim); + + /* We must free and NULL the pointer or nifti will try to free it for + * us. + */ +- VIPS_FREE( nifti->nim->data ); ++ VIPS_FREE(nifti->nim->data); + +- return( 0 ); ++ return (0); + } + + /* Save a bit of typing. +@@ -413,11 +411,11 @@ static VipsBandFormat vips_nifti_bandfmt[10] = { + }; + + static void +-vips_foreign_save_nifti_class_init( VipsForeignSaveNiftiClass *class ) ++vips_foreign_save_nifti_class_init(VipsForeignSaveNiftiClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; + +@@ -426,7 +424,7 @@ vips_foreign_save_nifti_class_init( VipsForeignSaveNiftiClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "niftisave"; +- object_class->description = _( "save image to nifti file" ); ++ object_class->description = _("save image to nifti file"); + object_class->build = vips_foreign_save_nifti_build; + + /* nificlib has not been fuzzed, so should not be used with +@@ -439,16 +437,16 @@ vips_foreign_save_nifti_class_init( VipsForeignSaveNiftiClass *class ) + save_class->saveable = VIPS_SAVEABLE_ANY; + save_class->format_table = vips_nifti_bandfmt; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveNifti, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveNifti, filename), ++ NULL); + } + + static void +-vips_foreign_save_nifti_init( VipsForeignSaveNifti *nifti ) ++vips_foreign_save_nifti_init(VipsForeignSaveNifti *nifti) + { + } + +@@ -456,11 +454,11 @@ vips_foreign_save_nifti_init( VipsForeignSaveNifti *nifti ) + + /** + * vips_niftisave: (method) +- * @in: image to save +- * @filename: file to write to ++ * @in: image to save ++ * @filename: file to write to + * @...: %NULL-terminated list of optional named arguments + * +- * Write a VIPS image to a file in NIFTI format. ++ * Write a VIPS image to a file in NIFTI format. + * + * Use the various NIFTI suffixes to pick the nifti save format. + * +@@ -469,14 +467,14 @@ vips_foreign_save_nifti_init( VipsForeignSaveNifti *nifti ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_niftisave( VipsImage *in, const char *filename, ... ) ++vips_niftisave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "niftisave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("niftisave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/nsgifload.c b/libvips/foreign/nsgifload.c +index d5d9075b28..9fc5fb6b0a 100644 +--- a/libvips/foreign/nsgifload.c ++++ b/libvips/foreign/nsgifload.c +@@ -5,33 +5,33 @@ + * 3/3/22 tlsa + * - update libnsgif API + *9/5/22 +- - attach GIF palette as metadata ++ - attach GIF palette as metadata + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -74,19 +74,19 @@ + #include + + #define VIPS_TYPE_FOREIGN_LOAD_GIF (vips_foreign_load_nsgif_get_type()) +-#define VIPS_FOREIGN_LOAD_GIF( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_FOREIGN_LOAD_GIF, VipsForeignLoadNsgif )) +-#define VIPS_FOREIGN_LOAD_GIF_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_FOREIGN_LOAD_GIF, VipsForeignLoadNsgifClass)) +-#define VIPS_IS_FOREIGN_LOAD_GIF( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_FOREIGN_LOAD_GIF )) +-#define VIPS_IS_FOREIGN_LOAD_GIF_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_FOREIGN_LOAD_GIF )) +-#define VIPS_FOREIGN_LOAD_GIF_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_FOREIGN_LOAD_GIF, VipsForeignLoadNsgifClass )) ++#define VIPS_FOREIGN_LOAD_GIF(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_FOREIGN_LOAD_GIF, VipsForeignLoadNsgif)) ++#define VIPS_FOREIGN_LOAD_GIF_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_FOREIGN_LOAD_GIF, VipsForeignLoadNsgifClass)) ++#define VIPS_IS_FOREIGN_LOAD_GIF(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_FOREIGN_LOAD_GIF)) ++#define VIPS_IS_FOREIGN_LOAD_GIF_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_FOREIGN_LOAD_GIF)) ++#define VIPS_FOREIGN_LOAD_GIF_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_FOREIGN_LOAD_GIF, VipsForeignLoadNsgifClass)) + + typedef struct _VipsForeignLoadNsgif { + VipsForeignLoad parent_object; +@@ -116,7 +116,7 @@ typedef struct _VipsForeignLoadNsgif { + */ + const nsgif_info_t *info; + +- /* Delays between frames (in milliseconds). Array of length ++ /* Delays between frames (in milliseconds). Array of length + * @info->frame_count. + */ + int *delay; +@@ -142,109 +142,108 @@ typedef struct _VipsForeignLoadNsgif { + + typedef VipsForeignLoadClass VipsForeignLoadNsgifClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadNsgif, vips_foreign_load_nsgif, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadNsgif, vips_foreign_load_nsgif, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_nsgif_error( VipsForeignLoadNsgif *gif, nsgif_error result ) ++vips_foreign_load_nsgif_error(VipsForeignLoadNsgif *gif, nsgif_error result) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( gif ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(gif); + +- vips_error( class->nickname, "%s", nsgif_strerror( result ) ); ++ vips_error(class->nickname, "%s", nsgif_strerror(result)); + } + + static void +-vips_foreign_load_nsgif_dispose( GObject *gobject ) ++vips_foreign_load_nsgif_dispose(GObject *gobject) + { + VipsForeignLoadNsgif *gif = (VipsForeignLoadNsgif *) gobject; + +- VIPS_DEBUG_MSG( "vips_foreign_load_nsgif_dispose:\n" ); ++ VIPS_DEBUG_MSG("vips_foreign_load_nsgif_dispose:\n"); + +- if( gif->anim ) { +- nsgif_destroy( gif->anim ); ++ if (gif->anim) { ++ nsgif_destroy(gif->anim); + } +- VIPS_UNREF( gif->source ); +- VIPS_FREE( gif->delay ); ++ VIPS_UNREF(gif->source); ++ VIPS_FREE(gif->delay); + +- G_OBJECT_CLASS( vips_foreign_load_nsgif_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_nsgif_parent_class)->dispose(gobject); + } + + static VipsForeignFlags +-vips_foreign_load_nsgif_get_flags_filename( const char *filename ) ++vips_foreign_load_nsgif_get_flags_filename(const char *filename) + { +- return( VIPS_FOREIGN_SEQUENTIAL ); ++ return (VIPS_FOREIGN_SEQUENTIAL); + } + + static VipsForeignFlags +-vips_foreign_load_nsgif_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_nsgif_get_flags(VipsForeignLoad *load) + { +- return( VIPS_FOREIGN_SEQUENTIAL ); ++ return (VIPS_FOREIGN_SEQUENTIAL); + } + + static gboolean +-vips_foreign_load_nsgif_is_a_source( VipsSource *source ) ++vips_foreign_load_nsgif_is_a_source(VipsSource *source) + { + const unsigned char *data; + +- if( (data = vips_source_sniff( source, 4 )) && ++ if ((data = vips_source_sniff(source, 4)) && + data[0] == 'G' && + data[1] == 'I' && + data[2] == 'F' && +- data[3] == '8' ) +- return( TRUE ); ++ data[3] == '8') ++ return (TRUE); + +- return( FALSE ); ++ return (FALSE); + } + + #ifdef VERBOSE + + static void +-print_frame( const nsgif_frame_info_t *frame_info ) ++print_frame(const nsgif_frame_info_t *frame_info) + { +- if ( frame_info == NULL ) ++ if (frame_info == NULL) + return; + +- printf( "frame_info:\n" ); +- printf( " display = %d\n", frame_info->display ); +- printf( " local_palette = %d\n", frame_info->local_palette ); +- printf( " transparency = %d\n", frame_info->transparency ); +- printf( " disposal = %d (%s)\n", +- frame_info->disposal, +- nsgif_str_disposal( frame_info->disposal ) ); +- printf( " delay = %d\n", frame_info->delay ); +- printf( " rect.x0 = %u\n", frame_info->rect.x0 ); +- printf( " rect.y0 = %u\n", frame_info->rect.y0 ); +- printf( " rect.x1 = %u\n", frame_info->rect.x1 ); +- printf( " rect.y1 = %u\n", frame_info->rect.y1 ); ++ printf("frame_info:\n"); ++ printf(" display = %d\n", frame_info->display); ++ printf(" local_palette = %d\n", frame_info->local_palette); ++ printf(" transparency = %d\n", frame_info->transparency); ++ printf(" disposal = %d (%s)\n", ++ frame_info->disposal, ++ nsgif_str_disposal(frame_info->disposal)); ++ printf(" delay = %d\n", frame_info->delay); ++ printf(" rect.x0 = %u\n", frame_info->rect.x0); ++ printf(" rect.y0 = %u\n", frame_info->rect.y0); ++ printf(" rect.x1 = %u\n", frame_info->rect.x1); ++ printf(" rect.y1 = %u\n", frame_info->rect.y1); + } + + static void +-print_animation( nsgif_t *anim, const nsgif_info_t *info ) ++print_animation(nsgif_t *anim, const nsgif_info_t *info) + { + int i; + const uint8_t *bg = (uint8_t *) &info->background; + +- printf( "animation:\n" ); +- printf( " width = %d\n", info->width ); +- printf( " height = %d\n", info->height ); +- printf( " frame_count = %d\n", info->frame_count ); +- printf( " global_palette = %d\n", info->global_palette ); +- printf( " loop_max = %d\n", info->loop_max ); +- printf( " background = %d %d %d %d\n", +- bg[0], bg[1], bg[2], bg[3] ); +- +- for( i = 0; i < info->frame_count; i++ ) { +- printf( "%d ", i ); +- print_frame( nsgif_get_frame_info( anim, i ) ); ++ printf("animation:\n"); ++ printf(" width = %d\n", info->width); ++ printf(" height = %d\n", info->height); ++ printf(" frame_count = %d\n", info->frame_count); ++ printf(" global_palette = %d\n", info->global_palette); ++ printf(" loop_max = %d\n", info->loop_max); ++ printf(" background = %d %d %d %d\n", ++ bg[0], bg[1], bg[2], bg[3]); ++ ++ for (i = 0; i < info->frame_count; i++) { ++ printf("%d ", i); ++ print_frame(nsgif_get_frame_info(anim, i)); + } + } + + #endif /*VERBOSE*/ + + static int +-vips_foreign_load_nsgif_set_header( VipsForeignLoadNsgif *gif, +- VipsImage *image ) ++vips_foreign_load_nsgif_set_header(VipsForeignLoadNsgif *gif, ++ VipsImage *image) + { + double array[3]; + const uint8_t *bg; +@@ -252,83 +251,81 @@ vips_foreign_load_nsgif_set_header( VipsForeignLoadNsgif *gif, + uint32_t table[NSGIF_MAX_COLOURS]; + int colours; + +- VIPS_DEBUG_MSG( "vips_foreign_load_nsgif_set_header:\n" ); ++ VIPS_DEBUG_MSG("vips_foreign_load_nsgif_set_header:\n"); + +- vips_image_init_fields( image, ++ vips_image_init_fields(image, + gif->info->width, gif->info->height * gif->n, + gif->has_transparency ? 4 : 3, + VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, +- VIPS_INTERPRETATION_sRGB, 1.0, 1.0 ); +- vips_image_pipelinev( image, VIPS_DEMAND_STYLE_FATSTRIP, NULL ); ++ VIPS_INTERPRETATION_sRGB, 1.0, 1.0); ++ vips_image_pipelinev(image, VIPS_DEMAND_STYLE_FATSTRIP, NULL); + + /* Only set page-height if we have more than one page, or this could + * accidentally turn into an animated image later. + */ +- if( gif->n > 1 ) +- vips_image_set_int( image, +- VIPS_META_PAGE_HEIGHT, gif->info->height ); +- vips_image_set_int( image, VIPS_META_N_PAGES, +- gif->info->frame_count ); +- vips_image_set_int( image, "loop", gif->info->loop_max ); +- +- vips_image_set_array_int( image, "delay", +- gif->delay, gif->info->frame_count ); ++ if (gif->n > 1) ++ vips_image_set_int(image, ++ VIPS_META_PAGE_HEIGHT, gif->info->height); ++ vips_image_set_int(image, VIPS_META_N_PAGES, ++ gif->info->frame_count); ++ vips_image_set_int(image, "loop", gif->info->loop_max); + ++ vips_image_set_array_int(image, "delay", ++ gif->delay, gif->info->frame_count); + + bg = (uint8_t *) &gif->info->background; + array[0] = bg[0]; + array[1] = bg[1]; + array[2] = bg[2]; + +- vips_image_set_array_double( image, "background", array, 3 ); ++ vips_image_set_array_double(image, "background", array, 3); + +- VIPS_SETSTR( image->filename, +- vips_connection_filename( VIPS_CONNECTION( gif->source ) ) ); ++ VIPS_SETSTR(image->filename, ++ vips_connection_filename(VIPS_CONNECTION(gif->source))); + + /* DEPRECATED "gif-loop" + * + * Not the correct behavior as loop=1 became gif-loop=0 + * but we want to keep the old behavior untouched! + */ +- vips_image_set_int( image, +- "gif-loop", gif->info->loop_max == 0 ? +- 0 : gif->info->loop_max - 1 ); ++ vips_image_set_int(image, ++ "gif-loop", gif->info->loop_max == 0 ? 0 : gif->info->loop_max - 1); + + /* The deprecated gif-delay field is in centiseconds. + */ +- vips_image_set_int( image, "gif-delay", gif->gif_delay ); ++ vips_image_set_int(image, "gif-delay", gif->gif_delay); + + /* If there are no local palettes, we can attach the global palette as + * metadata. + */ +- if( !gif->local_palette ) { +- nsgif_global_palette( gif->anim, table, &entries ); +- vips_image_set_array_int( image, "gif-palette", +- (const int *) table, entries ); ++ if (!gif->local_palette) { ++ nsgif_global_palette(gif->anim, table, &entries); ++ vips_image_set_array_int(image, "gif-palette", ++ (const int *) table, entries); + + colours = entries; +- } ++ } + else { + int i; + + colours = 0; + +- if( gif->info->global_palette ) { +- nsgif_global_palette( gif->anim, table, &entries ); ++ if (gif->info->global_palette) { ++ nsgif_global_palette(gif->anim, table, &entries); + colours = entries; + } + +- for( i = 0; i < gif->info->frame_count; i++ ) { +- if( nsgif_local_palette( gif->anim, i, table, +- &entries ) ) +- colours = VIPS_MAX( colours, entries ); ++ for (i = 0; i < gif->info->frame_count; i++) { ++ if (nsgif_local_palette(gif->anim, i, table, ++ &entries)) ++ colours = VIPS_MAX(colours, entries); + } + } + +- vips_image_set_int( image, "palette-bit-depth", +- ceil( log2( colours ) ) ); ++ vips_image_set_int(image, "palette-bit-depth", ++ ceil(log2(colours))); + +- return( 0 ); ++ return (0); + } + + /* Scan the GIF as quickly as we can and extract transparency, bands, pages, +@@ -340,9 +337,9 @@ vips_foreign_load_nsgif_set_header( VipsForeignLoadNsgif *gif, + * Close as soon as we can to free up the fd. + */ + static int +-vips_foreign_load_nsgif_header( VipsForeignLoad *load ) ++vips_foreign_load_nsgif_header(VipsForeignLoad *load) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( load ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(load); + VipsForeignLoadNsgif *gif = (VipsForeignLoadNsgif *) load; + + const void *data; +@@ -350,120 +347,121 @@ vips_foreign_load_nsgif_header( VipsForeignLoad *load ) + nsgif_error result; + int i; + +- VIPS_DEBUG_MSG( "vips_foreign_load_nsgif_header:\n" ); ++ VIPS_DEBUG_MSG("vips_foreign_load_nsgif_header:\n"); + + /* We map in the image, then minimise to close any underlying file + * object. This won't unmap. + */ +- if( !(data = vips_source_map( gif->source, &size )) ) +- return( -1 ); +- vips_source_minimise( gif->source ); ++ if (!(data = vips_source_map(gif->source, &size))) ++ return (-1); ++ vips_source_minimise(gif->source); + + /* Treat errors from _scan() as warnings. If libnsgif really can't do +- * something it'll fail gracefully later when we try to read out ++ * something it'll fail gracefully later when we try to read out + * frame data. + */ +- result = nsgif_data_scan( gif->anim, size, (void *) data ); +- VIPS_DEBUG_MSG( "nsgif_data_scan() = %s\n", nsgif_strerror( result ) ); +- switch( result ) { ++ result = nsgif_data_scan(gif->anim, size, (void *) data); ++ VIPS_DEBUG_MSG("nsgif_data_scan() = %s\n", nsgif_strerror(result)); ++ switch (result) { + case NSGIF_ERR_END_OF_DATA: +- if( load->fail_on >= VIPS_FAIL_ON_TRUNCATED ) { +- vips_foreign_load_nsgif_error( gif, result ); +- return( -1 ); ++ if (load->fail_on >= VIPS_FAIL_ON_TRUNCATED) { ++ vips_foreign_load_nsgif_error(gif, result); ++ return (-1); + } + else +- g_warning( "%s", nsgif_strerror( result ) ); ++ g_warning("%s", nsgif_strerror(result)); + break; + + case NSGIF_OK: + break; + + default: +- if( load->fail_on >= VIPS_FAIL_ON_WARNING ) { +- vips_foreign_load_nsgif_error( gif, result ); +- return( -1 ); ++ if (load->fail_on >= VIPS_FAIL_ON_WARNING) { ++ vips_foreign_load_nsgif_error(gif, result); ++ return (-1); + } + else +- g_warning( "%s", nsgif_strerror( result ) ); ++ g_warning("%s", nsgif_strerror(result)); + break; + } + + /* Tell libnsgif that that's all the data we have. This will let us + * read out any truncated final frames. + */ +- nsgif_data_complete( gif->anim ); ++ nsgif_data_complete(gif->anim); + +- gif->info = nsgif_get_info( gif->anim ); ++ gif->info = nsgif_get_info(gif->anim); + #ifdef VERBOSE +- print_animation( gif->anim, gif->info ); ++ print_animation(gif->anim, gif->info); + #endif /*VERBOSE*/ +- if( !gif->info->frame_count ) { +- vips_error( class->nickname, "%s", _( "no frames in GIF" ) ); +- return( -1 ); ++ if (!gif->info->frame_count) { ++ vips_error(class->nickname, "%s", _("no frames in GIF")); ++ return (-1); + } + + /* Check for any transparency. + */ +- for( i = 0; i < gif->info->frame_count; i++ ) { ++ for (i = 0; i < gif->info->frame_count; i++) { + const nsgif_frame_info_t *frame_info; + +- if( (frame_info = nsgif_get_frame_info( gif->anim, i )) ) { +- if( frame_info->transparency ) ++ if ((frame_info = nsgif_get_frame_info(gif->anim, i))) { ++ if (frame_info->transparency) + gif->has_transparency = TRUE; +- if( frame_info->local_palette ) ++ if (frame_info->local_palette) + gif->local_palette = TRUE; + } + } + +- if( gif->n == -1 ) ++ if (gif->n == -1) + gif->n = gif->info->frame_count - gif->page; + +- if( gif->page < 0 || ++ if (gif->page < 0 || + gif->n <= 0 || +- gif->page + gif->n > gif->info->frame_count ) { +- vips_error( class->nickname, "%s", _( "bad page number" ) ); +- return( -1 ); ++ gif->page + gif->n > gif->info->frame_count) { ++ vips_error(class->nickname, "%s", _("bad page number")); ++ return (-1); + } + + /* In ms, frame_delay in cs. + */ +- VIPS_FREE( gif->delay ); +- if( !(gif->delay = VIPS_ARRAY( NULL, +- gif->info->frame_count, int )) ) +- return( -1 ); +- for( i = 0; i < gif->info->frame_count; i++ ) { ++ VIPS_FREE(gif->delay); ++ if (!(gif->delay = VIPS_ARRAY(NULL, ++ gif->info->frame_count, int))) ++ return (-1); ++ for (i = 0; i < gif->info->frame_count; i++) { + const nsgif_frame_info_t *frame_info; + +- frame_info = nsgif_get_frame_info( gif->anim, i ); +- if ( frame_info == NULL ) { +- vips_error( class->nickname, "%s", _( "bad frame" ) ); +- return( -1 ); ++ frame_info = nsgif_get_frame_info(gif->anim, i); ++ if (frame_info == NULL) { ++ vips_error(class->nickname, "%s", _("bad frame")); ++ return (-1); + } + gif->delay[i] = 10 * frame_info->delay; + } + + gif->gif_delay = gif->delay[0] / 10; + +- vips_foreign_load_nsgif_set_header( gif, load->out ); ++ vips_foreign_load_nsgif_set_header(gif, load->out); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_nsgif_generate( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_foreign_load_nsgif_generate(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsForeignLoadNsgif *gif = (VipsForeignLoadNsgif *) a; + + int y; + + #ifdef VERBOSE +- VIPS_DEBUG_MSG( "vips_foreign_load_nsgif_generate: " +- "top = %d, height = %d\n", r->top, r->height ); ++ VIPS_DEBUG_MSG("vips_foreign_load_nsgif_generate: " ++ "top = %d, height = %d\n", ++ r->top, r->height); + #endif /*VERBOSE*/ + +- for( y = 0; y < r->height; y++ ) { ++ for (y = 0; y < r->height; y++) { + /* The page for this output line, and the line number in page. + */ + int page = (r->top + y) / gif->info->height + gif->page; +@@ -472,34 +470,34 @@ vips_foreign_load_nsgif_generate( VipsRegion *or, + nsgif_error result; + VipsPel *p, *q; + +- g_assert( line >= 0 && line < gif->info->height ); +- g_assert( page >= 0 && page < gif->info->frame_count ); +- +- if( gif->frame_number != page ) { +- result = nsgif_frame_decode( gif->anim, +- page, &gif->bitmap ); +- VIPS_DEBUG_MSG( " nsgif_frame_decode(%d) = %d\n", +- page, result ); +- if( result != NSGIF_OK ) { +- vips_foreign_load_nsgif_error( gif, result ); +- return( -1 ); ++ g_assert(line >= 0 && line < gif->info->height); ++ g_assert(page >= 0 && page < gif->info->frame_count); ++ ++ if (gif->frame_number != page) { ++ result = nsgif_frame_decode(gif->anim, ++ page, &gif->bitmap); ++ VIPS_DEBUG_MSG(" nsgif_frame_decode(%d) = %d\n", ++ page, result); ++ if (result != NSGIF_OK) { ++ vips_foreign_load_nsgif_error(gif, result); ++ return (-1); + } + + #ifdef VERBOSE +- print_frame( nsgif_get_frame_info( gif->anim, page ) ); ++ print_frame(nsgif_get_frame_info(gif->anim, page)); + #endif /*VERBOSE*/ + + gif->frame_number = page; + } + +- p = gif->bitmap + line * gif->info->width * sizeof( int ); +- q = VIPS_REGION_ADDR( or, 0, r->top + y ); +- if( gif->has_transparency ) +- memcpy( q, p, VIPS_REGION_SIZEOF_LINE( or ) ); ++ p = gif->bitmap + line * gif->info->width * sizeof(int); ++ q = VIPS_REGION_ADDR(or, 0, r->top + y); ++ if (gif->has_transparency) ++ memcpy(q, p, VIPS_REGION_SIZEOF_LINE(or)); + else { + int i; + +- for( i = 0; i < r->width; i++ ) { ++ for (i = 0; i < r->width; i++) { + q[0] = p[0]; + q[1] = p[1]; + q[2] = p[2]; +@@ -510,66 +508,66 @@ vips_foreign_load_nsgif_generate( VipsRegion *or, + } + } + +- return( 0 ); ++ return (0); + } + + int +-vips_foreign_load_nsgif_tile_height( VipsForeignLoadNsgif *gif ) ++vips_foreign_load_nsgif_tile_height(VipsForeignLoadNsgif *gif) + { + int height = gif->info->height; + + int i; + + /* First, check the perfect size. +- */ +- if( height % 16 == 0 ) +- return( 16 ); ++ */ ++ if (height % 16 == 0) ++ return (16); + + /* Next, check larger and smaller sizes. +- */ +- for( i = 1; i < 16; i++ ) { +- if( height % (16 + i) == 0 ) +- return( 16 + i ); +- if( height % (16 - i) == 0 ) +- return( 16 - i ); ++ */ ++ for (i = 1; i < 16; i++) { ++ if (height % (16 + i) == 0) ++ return (16 + i); ++ if (height % (16 - i) == 0) ++ return (16 - i); + } + +- return( 1 ); ++ return (1); + } + + static int +-vips_foreign_load_nsgif_load( VipsForeignLoad *load ) ++vips_foreign_load_nsgif_load(VipsForeignLoad *load) + { + VipsForeignLoadNsgif *gif = (VipsForeignLoadNsgif *) load; + VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( load ), 4 ); ++ vips_object_local_array(VIPS_OBJECT(load), 4); + +- VIPS_DEBUG_MSG( "vips_foreign_load_nsgif_load:\n" ); ++ VIPS_DEBUG_MSG("vips_foreign_load_nsgif_load:\n"); + + /* Make the output pipeline. + */ + t[0] = vips_image_new(); +- if( vips_foreign_load_nsgif_set_header( gif, t[0] ) ) +- return( -1 ); ++ if (vips_foreign_load_nsgif_set_header(gif, t[0])) ++ return (-1); + + /* Strips 8 pixels high to avoid too many tiny regions. + */ +- if( vips_image_generate( t[0], +- NULL, vips_foreign_load_nsgif_generate, NULL, gif, NULL ) || +- vips_sequential( t[0], &t[1], +- "tile_height", +- vips_foreign_load_nsgif_tile_height( gif ), +- NULL ) || +- vips_image_write( t[1], load->real ) ) +- return( -1 ); +- +- return( 0 ); ++ if (vips_image_generate(t[0], ++ NULL, vips_foreign_load_nsgif_generate, NULL, gif, NULL) || ++ vips_sequential(t[0], &t[1], ++ "tile_height", ++ vips_foreign_load_nsgif_tile_height(gif), ++ NULL) || ++ vips_image_write(t[1], load->real)) ++ return (-1); ++ ++ return (0); + } + + static void +-vips_foreign_load_nsgif_class_init( VipsForeignLoadNsgifClass *class ) ++vips_foreign_load_nsgif_class_init(VipsForeignLoadNsgifClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -579,64 +577,63 @@ vips_foreign_load_nsgif_class_init( VipsForeignLoadNsgifClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "gifload_base"; +- object_class->description = _( "load GIF with libnsgif" ); ++ object_class->description = _("load GIF with libnsgif"); + + /* High priority, so that we handle vipsheader etc. + */ + foreign_class->priority = 50; + +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_nsgif_get_flags_filename; + load_class->get_flags = vips_foreign_load_nsgif_get_flags; + load_class->header = vips_foreign_load_nsgif_header; + load_class->load = vips_foreign_load_nsgif_load; + +- VIPS_ARG_INT( class, "page", 10, +- _( "Page" ), +- _( "First page to load" ), ++ VIPS_ARG_INT(class, "page", 10, ++ _("Page"), ++ _("First page to load"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadNsgif, page ), +- 0, 100000, 0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadNsgif, page), ++ 0, 100000, 0); + +- VIPS_ARG_INT( class, "n", 6, +- _( "n" ), +- _( "Number of pages to load, -1 for all" ), ++ VIPS_ARG_INT(class, "n", 6, ++ _("n"), ++ _("Number of pages to load, -1 for all"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadNsgif, n ), +- -1, 100000, 1 ); +- ++ G_STRUCT_OFFSET(VipsForeignLoadNsgif, n), ++ -1, 100000, 1); + } + + static void * +-vips_foreign_load_nsgif_bitmap_create( int width, int height ) ++vips_foreign_load_nsgif_bitmap_create(int width, int height) + { + /* GIF has a limit of 64k per axis -- double-check this. + */ +- if( width <= 0 || ++ if (width <= 0 || + width > 65536 || + height <= 0 || +- height > 65536 ) { +- vips_error( "gifload", +- "%s", _( "bad image dimensions") ); +- return( NULL ); ++ height > 65536) { ++ vips_error("gifload", ++ "%s", _("bad image dimensions")); ++ return (NULL); + } + +- return g_malloc0( (gsize) width * height * 4 ); ++ return g_malloc0((gsize) width * height * 4); + } + + static unsigned char * +-vips_foreign_load_nsgif_bitmap_get_buffer( void *bitmap ) ++vips_foreign_load_nsgif_bitmap_get_buffer(void *bitmap) + { +- g_assert( bitmap ); ++ g_assert(bitmap); + +- return( bitmap ); ++ return (bitmap); + } + +-static void +-vips_foreign_load_nsgif_bitmap_destroy( void *bitmap ) ++static void ++vips_foreign_load_nsgif_bitmap_destroy(void *bitmap) + { +- g_assert( bitmap ); +- g_free( bitmap ); ++ g_assert(bitmap); ++ g_free(bitmap); + } + + static nsgif_bitmap_cb_vt vips_foreign_load_nsgif_bitmap_callbacks = { +@@ -646,17 +643,17 @@ static nsgif_bitmap_cb_vt vips_foreign_load_nsgif_bitmap_callbacks = { + }; + + static void +-vips_foreign_load_nsgif_init( VipsForeignLoadNsgif *gif ) ++vips_foreign_load_nsgif_init(VipsForeignLoadNsgif *gif) + { + nsgif_error result = nsgif_create( + &vips_foreign_load_nsgif_bitmap_callbacks, + NSGIF_BITMAP_FMT_R8G8B8A8, +- &gif->anim ); ++ &gif->anim); + if (result != NSGIF_OK) { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( gif ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(gif); + +- vips_error( class->nickname, "%s", +- nsgif_strerror( result ) ); ++ vips_error(class->nickname, "%s", ++ nsgif_strerror(result)); + return; + } + +@@ -670,31 +667,30 @@ typedef struct _VipsForeignLoadNsgifFile { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadNsgifFile; + + typedef VipsForeignLoadNsgifClass VipsForeignLoadNsgifFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadNsgifFile, vips_foreign_load_nsgif_file, +- vips_foreign_load_nsgif_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadNsgifFile, vips_foreign_load_nsgif_file, ++ vips_foreign_load_nsgif_get_type()); + + static int +-vips_foreign_load_gif_file_build( VipsObject *object ) ++vips_foreign_load_gif_file_build(VipsObject *object) + { + VipsForeignLoadNsgif *gif = (VipsForeignLoadNsgif *) object; + VipsForeignLoadNsgifFile *file = (VipsForeignLoadNsgifFile *) object; + +- if( file->filename ) +- if( !(gif->source = +- vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename) ++ if (!(gif->source = ++ vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_nsgif_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_nsgif_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static const char *vips_foreign_nsgif_suffs[] = { +@@ -703,24 +699,24 @@ static const char *vips_foreign_nsgif_suffs[] = { + }; + + static gboolean +-vips_foreign_load_nsgif_file_is_a( const char *filename ) ++vips_foreign_load_nsgif_file_is_a(const char *filename) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( FALSE ); +- result = vips_foreign_load_nsgif_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (FALSE); ++ result = vips_foreign_load_nsgif_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static void +-vips_foreign_load_nsgif_file_class_init( +- VipsForeignLoadNsgifFileClass *class ) ++vips_foreign_load_nsgif_file_class_init( ++ VipsForeignLoadNsgifFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -729,24 +725,23 @@ vips_foreign_load_nsgif_file_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "gifload"; +- object_class->description = _( "load GIF with libnsgif" ); ++ object_class->description = _("load GIF with libnsgif"); + object_class->build = vips_foreign_load_gif_file_build; + + foreign_class->suffs = vips_foreign_nsgif_suffs; + + load_class->is_a = vips_foreign_load_nsgif_file_is_a; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadNsgifFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadNsgifFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_nsgif_file_init( VipsForeignLoadNsgifFile *file ) ++vips_foreign_load_nsgif_file_init(VipsForeignLoadNsgifFile *file) + { + } + +@@ -761,48 +756,47 @@ typedef struct _VipsForeignLoadNsgifBuffer { + + typedef VipsForeignLoadNsgifClass VipsForeignLoadNsgifBufferClass; + +-G_DEFINE_TYPE( VipsForeignLoadNsgifBuffer, vips_foreign_load_nsgif_buffer, +- vips_foreign_load_nsgif_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadNsgifBuffer, vips_foreign_load_nsgif_buffer, ++ vips_foreign_load_nsgif_get_type()); + + static int +-vips_foreign_load_nsgif_buffer_build( VipsObject *object ) ++vips_foreign_load_nsgif_buffer_build(VipsObject *object) + { + VipsForeignLoadNsgif *gif = (VipsForeignLoadNsgif *) object; +- VipsForeignLoadNsgifBuffer *buffer = ++ VipsForeignLoadNsgifBuffer *buffer = + (VipsForeignLoadNsgifBuffer *) object; + +- if( buffer->blob && +- !(gif->source = vips_source_new_from_memory( +- buffer->blob->data, +- buffer->blob->length )) ) +- return( -1 ); ++ if (buffer->blob && ++ !(gif->source = vips_source_new_from_memory( ++ buffer->blob->data, ++ buffer->blob->length))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_nsgif_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_nsgif_buffer_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_nsgif_buffer_is_a_buffer( const void *buf, size_t len ) ++vips_foreign_load_nsgif_buffer_is_a_buffer(const void *buf, size_t len) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_memory( buf, len )) ) +- return( FALSE ); +- result = vips_foreign_load_nsgif_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_memory(buf, len))) ++ return (FALSE); ++ result = vips_foreign_load_nsgif_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static void +-vips_foreign_load_nsgif_buffer_class_init( +- VipsForeignLoadNsgifBufferClass *class ) ++vips_foreign_load_nsgif_buffer_class_init( ++ VipsForeignLoadNsgifBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -810,22 +804,21 @@ vips_foreign_load_nsgif_buffer_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "gifload_buffer"; +- object_class->description = _( "load GIF with libnsgif" ); ++ object_class->description = _("load GIF with libnsgif"); + object_class->build = vips_foreign_load_nsgif_buffer_build; + + load_class->is_a_buffer = vips_foreign_load_nsgif_buffer_is_a_buffer; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadNsgifBuffer, blob ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadNsgifBuffer, blob), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_load_nsgif_buffer_init( VipsForeignLoadNsgifBuffer *buffer ) ++vips_foreign_load_nsgif_buffer_init(VipsForeignLoadNsgifBuffer *buffer) + { + } + +@@ -840,59 +833,57 @@ typedef struct _VipsForeignLoadNsgifSource { + + typedef VipsForeignLoadClass VipsForeignLoadNsgifSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadNsgifSource, vips_foreign_load_nsgif_source, +- vips_foreign_load_nsgif_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadNsgifSource, vips_foreign_load_nsgif_source, ++ vips_foreign_load_nsgif_get_type()); + + static int +-vips_foreign_load_nsgif_source_build( VipsObject *object ) ++vips_foreign_load_nsgif_source_build(VipsObject *object) + { + VipsForeignLoadNsgif *gif = (VipsForeignLoadNsgif *) object; +- VipsForeignLoadNsgifSource *source = ++ VipsForeignLoadNsgifSource *source = + (VipsForeignLoadNsgifSource *) object; + +- if( source->source ) { ++ if (source->source) { + gif->source = source->source; +- g_object_ref( gif->source ); ++ g_object_ref(gif->source); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_nsgif_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_nsgif_source_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_nsgif_source_class_init( +- VipsForeignLoadNsgifSourceClass *class ) ++vips_foreign_load_nsgif_source_class_init( ++ VipsForeignLoadNsgifSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "gifload_source"; +- object_class->description = _( "load gif from source" ); ++ object_class->description = _("load gif from source"); + object_class->build = vips_foreign_load_nsgif_source_build; + + operation_class->flags |= VIPS_OPERATION_NOCACHE; + + load_class->is_a_source = vips_foreign_load_nsgif_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadNsgifSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadNsgifSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_nsgif_source_init( VipsForeignLoadNsgifSource *source ) ++vips_foreign_load_nsgif_source_init(VipsForeignLoadNsgifSource *source) + { + } + +@@ -929,16 +920,16 @@ vips_foreign_load_nsgif_source_init( VipsForeignLoadNsgifSource *source ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_gifload( const char *filename, VipsImage **out, ... ) ++vips_gifload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "gifload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("gifload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -964,7 +955,7 @@ vips_gifload( const char *filename, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_gifload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++vips_gifload_buffer(void *buf, size_t len, VipsImage **out, ...) + { + va_list ap; + VipsBlob *blob; +@@ -972,15 +963,15 @@ vips_gifload_buffer( void *buf, size_t len, VipsImage **out, ... ) + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, buf, len ); ++ blob = vips_blob_new(NULL, buf, len); + +- va_start( ap, out ); +- result = vips_call_split( "gifload_buffer", ap, blob, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("gifload_buffer", ap, blob, out); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( result ); ++ return (result); + } + + /** +@@ -1002,14 +993,14 @@ vips_gifload_buffer( void *buf, size_t len, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_gifload_source( VipsSource *source, VipsImage **out, ... ) ++vips_gifload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "gifload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("gifload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/openexr2vips.c b/libvips/foreign/openexr2vips.c +index ba4f0d673a..40517551b6 100644 +--- a/libvips/foreign/openexr2vips.c ++++ b/libvips/foreign/openexr2vips.c +@@ -25,12 +25,12 @@ + TODO + + - colour management +- - attributes +- - more of OpenEXR's pixel formats ++ - attributes ++ - more of OpenEXR's pixel formats + - more than just RGBA channels + - turn alpha to vips 0 - 255 from exr 0 - 1 + +- the openexr C API is very limited ... it seems RGBA half pixels is ++ the openexr C API is very limited ... it seems RGBA half pixels is + all you can do + + openexr lets you have different formats in different channels :-( +@@ -43,28 +43,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -107,169 +107,169 @@ typedef struct { + } Read; + + gboolean +-vips__openexr_isexr( const char *filename ) ++vips__openexr_isexr(const char *filename) + { + unsigned char buf[4]; + +- if( vips__get_bytes( filename, buf, 4 ) == 4 ) +- if( buf[0] == 0x76 && buf[1] == 0x2f && +- buf[2] == 0x31 && buf[3] == 0x01 ) +- return( TRUE ); ++ if (vips__get_bytes(filename, buf, 4) == 4) ++ if (buf[0] == 0x76 && buf[1] == 0x2f && ++ buf[2] == 0x31 && buf[3] == 0x01) ++ return (TRUE); + +- return( FALSE ); ++ return (FALSE); + } + + static void +-get_imf_error( void ) ++get_imf_error(void) + { +- vips_error( "exr2vips", _( "EXR error: %s" ), ImfErrorMessage() ); ++ vips_error("exr2vips", _("EXR error: %s"), ImfErrorMessage()); + } + + static void +-read_close( Read *read ) ++read_close(Read *read) + { +- VIPS_FREEF( ImfCloseTiledInputFile, read->tiles ); +- VIPS_FREEF( ImfCloseInputFile, read->lines ); ++ VIPS_FREEF(ImfCloseTiledInputFile, read->tiles); ++ VIPS_FREEF(ImfCloseInputFile, read->lines); + } + + static void +-read_destroy( VipsImage *out, Read *read ) ++read_destroy(VipsImage *out, Read *read) + { +- VIPS_FREE( read->filename ); ++ VIPS_FREE(read->filename); + +- read_close( read ); ++ read_close(read); + +- g_free( read ); ++ g_free(read); + } + + static Read * +-read_new( const char *filename, VipsImage *out ) ++read_new(const char *filename, VipsImage *out) + { + Read *read; + int xmin, ymin; + int xmax, ymax; + +- if( !(read = VIPS_NEW( NULL, Read )) ) +- return( NULL ); +- read->filename = vips_strdup( NULL, filename ); ++ if (!(read = VIPS_NEW(NULL, Read))) ++ return (NULL); ++ read->filename = vips_strdup(NULL, filename); + read->out = out; + read->tiles = NULL; + read->lines = NULL; +- if( out ) +- g_signal_connect( out, "close", +- G_CALLBACK( read_destroy ), read ); ++ if (out) ++ g_signal_connect(out, "close", ++ G_CALLBACK(read_destroy), read); + + /* Try to open tiled first ... if that fails, fall back to scanlines. + +- FIXME ... seems a bit ugly, but how else can you spot a tiled ++ FIXME ... seems a bit ugly, but how else can you spot a tiled + EXR image? + + */ +- if( !(read->tiles = ImfOpenTiledInputFile( read->filename )) ) { +- if( !(read->lines = ImfOpenInputFile( read->filename )) ) { ++ if (!(read->tiles = ImfOpenTiledInputFile(read->filename))) { ++ if (!(read->lines = ImfOpenInputFile(read->filename))) { + get_imf_error(); +- return( NULL ); ++ return (NULL); + } + } + + #ifdef DEBUG +- if( read->tiles ) +- printf( "exr2vips: opening in tiled mode\n" ); ++ if (read->tiles) ++ printf("exr2vips: opening in tiled mode\n"); + else +- printf( "exr2vips: opening in scanline mode\n" ); ++ printf("exr2vips: opening in scanline mode\n"); + #endif /*DEBUG*/ + +- if( read->tiles ) { +- read->header = ImfTiledInputHeader( read->tiles ); +- read->tile_width = ImfTiledInputTileXSize( read->tiles ); +- read->tile_height = ImfTiledInputTileYSize( read->tiles ); ++ if (read->tiles) { ++ read->header = ImfTiledInputHeader(read->tiles); ++ read->tile_width = ImfTiledInputTileXSize(read->tiles); ++ read->tile_height = ImfTiledInputTileYSize(read->tiles); + } + else +- read->header = ImfInputHeader( read->lines ); ++ read->header = ImfInputHeader(read->lines); + +- ImfHeaderDataWindow( read->header, &xmin, &ymin, &xmax, &ymax ); ++ ImfHeaderDataWindow(read->header, &xmin, &ymin, &xmax, &ymax); + read->window.left = xmin; + read->window.top = ymin; + read->window.width = xmax - xmin + 1; + read->window.height = ymax - ymin + 1; + +- return( read ); ++ return (read); + } + + gboolean +-vips__openexr_istiled( const char *filename ) ++vips__openexr_istiled(const char *filename) + { + Read *read; + gboolean tiled; + +- if( !(read = read_new( filename, NULL )) ) +- return( FALSE ); ++ if (!(read = read_new(filename, NULL))) ++ return (FALSE); + tiled = read->tiles != NULL; +- read_destroy( NULL, read ); ++ read_destroy(NULL, read); + +- return( tiled ); ++ return (tiled); + } + + /* Read a OpenEXR file (header) into a VIPS (header). + */ + static void +-read_header( Read *read, VipsImage *out ) ++read_header(Read *read, VipsImage *out) + { + VipsDemandStyle hint; + +- /* ++ /* + +- FIXME ... not really scRGB, you should get the chromaticities +- from the header and transform ++ FIXME ... not really scRGB, you should get the chromaticities ++ from the header and transform + + */ +- vips_image_init_fields( out, +- read->window.width, read->window.height, 4, +- VIPS_FORMAT_FLOAT, +- VIPS_CODING_NONE, VIPS_INTERPRETATION_scRGB, 1.0, 1.0 ); +- +- if( read->tiles ) +- /* Even though this is a tiled reader, we hint thinstrip +- * since with the cache we are quite happy serving that if ++ vips_image_init_fields(out, ++ read->window.width, read->window.height, 4, ++ VIPS_FORMAT_FLOAT, ++ VIPS_CODING_NONE, VIPS_INTERPRETATION_scRGB, 1.0, 1.0); ++ ++ if (read->tiles) ++ /* Even though this is a tiled reader, we hint thinstrip ++ * since with the cache we are quite happy serving that if + * anything downstream would like it. + */ + hint = VIPS_DEMAND_STYLE_THINSTRIP; + else + hint = VIPS_DEMAND_STYLE_FATSTRIP; +- (void) vips_image_pipelinev( out, hint, NULL ); ++ (void) vips_image_pipelinev(out, hint, NULL); + } + + int +-vips__openexr_read_header( const char *filename, VipsImage *out ) ++vips__openexr_read_header(const char *filename, VipsImage *out) + { + Read *read; + +- if( !(read = read_new( filename, out )) ) +- return( -1 ); +- read_header( read, out ); +- read_close( read ); ++ if (!(read = read_new(filename, out))) ++ return (-1); ++ read_header(read, out); ++ read_close(read); + +- return( 0 ); ++ return (0); + } + + /* Allocate a tile buffer. + */ + static void * +-vips__openexr_start( VipsImage *out, void *a, void *b ) ++vips__openexr_start(VipsImage *out, void *a, void *b) + { + Read *read = (Read *) a; + ImfRgba *imf_buffer; + +- if( !(imf_buffer = VIPS_ARRAY( out, +- read->tile_width * read->tile_height, ImfRgba )) ) +- return( NULL ); ++ if (!(imf_buffer = VIPS_ARRAY(out, ++ read->tile_width * read->tile_height, ImfRgba))) ++ return (NULL); + +- return( imf_buffer ); ++ return (imf_buffer); + } + + static int +-vips__openexr_generate( VipsRegion *out, +- void *seq, void *a, void *b, gboolean *top ) ++vips__openexr_generate(VipsRegion *out, ++ void *seq, void *a, void *b, gboolean *top) + { + ImfRgba *imf_buffer = (ImfRgba *) seq; + Read *read = (Read *) a; +@@ -293,33 +293,33 @@ vips__openexr_generate( VipsRegion *out, + image.width = read->out->Xsize; + image.height = read->out->Ysize; + +- for( y = ys; y < VIPS_RECT_BOTTOM( r ); y += th ) +- for( x = xs; x < VIPS_RECT_RIGHT( r ); x += tw ) { ++ for (y = ys; y < VIPS_RECT_BOTTOM(r); y += th) ++ for (x = xs; x < VIPS_RECT_RIGHT(r); x += tw) { + VipsRect tile; + VipsRect hit; + int result; + +- if( !ImfTiledInputSetFrameBuffer( read->tiles, +- imf_buffer - +- (read->window.left + x) - +- (read->window.top + y) * tw, +- 1, tw ) ) { +- vips_foreign_load_invalidate( read->out ); ++ if (!ImfTiledInputSetFrameBuffer(read->tiles, ++ imf_buffer - ++ (read->window.left + x) - ++ (read->window.top + y) * tw, ++ 1, tw)) { ++ vips_foreign_load_invalidate(read->out); + get_imf_error(); +- return( -1 ); ++ return (-1); + } + + #ifdef DEBUG +- printf( "exr2vips: requesting tile %d x %d\n", +- x / tw, y / th ); ++ printf("exr2vips: requesting tile %d x %d\n", ++ x / tw, y / th); + #endif /*DEBUG*/ + +- result = ImfTiledInputReadTile( read->tiles, +- x / tw, y / th, 0, 0 ); ++ result = ImfTiledInputReadTile(read->tiles, ++ x / tw, y / th, 0, 0); + +- if( !result ) { ++ if (!result) { + get_imf_error(); +- return( -1 ); ++ return (-1); + } + + /* The tile in the file, in VIPS coordinates. +@@ -328,46 +328,46 @@ vips__openexr_generate( VipsRegion *out, + tile.top = y; + tile.width = tw; + tile.height = th; +- vips_rect_intersectrect( &tile, &image, &tile ); ++ vips_rect_intersectrect(&tile, &image, &tile); + + /* The part of this tile that hits the region. + */ +- vips_rect_intersectrect( &tile, r, &hit ); ++ vips_rect_intersectrect(&tile, r, &hit); + + /* Convert to float and write to the region. + */ +- for( z = 0; z < hit.height; z++ ) { +- ImfRgba *p = imf_buffer + ++ for (z = 0; z < hit.height; z++) { ++ ImfRgba *p = imf_buffer + + (hit.left - tile.left) + + (hit.top - tile.top + z) * tw; +- float *q = (float *) VIPS_REGION_ADDR( out, +- hit.left, hit.top + z ); ++ float *q = (float *) VIPS_REGION_ADDR(out, ++ hit.left, hit.top + z); + + int i; + +- ImfHalfToFloatArray( 4 * hit.width, +- (ImfHalf *) p, q ); ++ ImfHalfToFloatArray(4 * hit.width, ++ (ImfHalf *) p, q); + +- /* oexr uses 0 - 1 for alpha, but vips is ++ /* oexr uses 0 - 1 for alpha, but vips is + * always 0 - 255, even for scrgb images. + */ +- for( i = 0; i < hit.width; i++ ) ++ for (i = 0; i < hit.width; i++) + q[4 * i + 3] *= 255; + } + } + +- return( 0 ); ++ return (0); + } + + int +-vips__openexr_read( const char *filename, VipsImage *out ) ++vips__openexr_read(const char *filename, VipsImage *out) + { + Read *read; + +- if( !(read = read_new( filename, out )) ) +- return( -1 ); ++ if (!(read = read_new(filename, out))) ++ return (-1); + +- if( read->tiles ) { ++ if (read->tiles) { + VipsImage *raw; + VipsImage *t; + +@@ -375,27 +375,26 @@ vips__openexr_read( const char *filename, VipsImage *out ) + * plus 50%. + */ + raw = vips_image_new(); +- vips_object_local( out, raw ); +- +- read_header( read, raw ); +- +- if( vips_image_generate( raw, +- vips__openexr_start, vips__openexr_generate, NULL, +- read, NULL ) ) +- return( -1 ); +- +- if( vips_tilecache( raw, &t, +- "tile_width", read->tile_width, +- "tile_height", read->tile_height, +- "max_tiles", (int) +- (2.5 * (1 + raw->Xsize / read->tile_width)), +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ vips_object_local(out, raw); ++ ++ read_header(read, raw); ++ ++ if (vips_image_generate(raw, ++ vips__openexr_start, vips__openexr_generate, NULL, ++ read, NULL)) ++ return (-1); ++ ++ if (vips_tilecache(raw, &t, ++ "tile_width", read->tile_width, ++ "tile_height", read->tile_height, ++ "max_tiles", (int) (2.5 * (1 + raw->Xsize / read->tile_width)), ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + } + else { + const int left = read->window.left; +@@ -407,45 +406,45 @@ vips__openexr_read( const char *filename, VipsImage *out ) + float *vips_buffer; + int y; + +- if( !(imf_buffer = VIPS_ARRAY( out, width, ImfRgba )) || +- !(vips_buffer = VIPS_ARRAY( out, 4 * width, float )) ) +- return( -1 ); ++ if (!(imf_buffer = VIPS_ARRAY(out, width, ImfRgba)) || ++ !(vips_buffer = VIPS_ARRAY(out, 4 * width, float))) ++ return (-1); + +- read_header( read, out ); ++ read_header(read, out); + +- for( y = 0; y < height; y++ ) { ++ for (y = 0; y < height; y++) { + int i; + +- if( !ImfInputSetFrameBuffer( read->lines, +- imf_buffer - left - (top + y) * width, +- 1, width ) ) { ++ if (!ImfInputSetFrameBuffer(read->lines, ++ imf_buffer - left - (top + y) * width, ++ 1, width)) { + get_imf_error(); +- return( -1 ); ++ return (-1); + } +- if( !ImfInputReadPixels( read->lines, +- top + y, top + y ) ) { ++ if (!ImfInputReadPixels(read->lines, ++ top + y, top + y)) { + get_imf_error(); +- return( -1 ); ++ return (-1); + } + +- ImfHalfToFloatArray( 4 * width, +- (ImfHalf *) imf_buffer, vips_buffer ); ++ ImfHalfToFloatArray(4 * width, ++ (ImfHalf *) imf_buffer, vips_buffer); + + /* oexr uses 0 - 1 for alpha, but vips is always 0 - + * 255, even for scrgb images. + */ +- for( i = 0; i < width; i++ ) ++ for (i = 0; i < width; i++) + vips_buffer[4 * i + 3] *= 255; + +- if( vips_image_write_line( out, y, +- (VipsPel *) vips_buffer ) ) +- return( -1 ); ++ if (vips_image_write_line(out, y, ++ (VipsPel *) vips_buffer)) ++ return (-1); + } + +- read_close( read ); ++ read_close(read); + } + +- return( 0 ); ++ return (0); + } + + #endif /*HAVE_OPENEXR*/ +diff --git a/libvips/foreign/openexrload.c b/libvips/foreign/openexrload.c +index e830ac1d9c..6057f7b594 100644 +--- a/libvips/foreign/openexrload.c ++++ b/libvips/foreign/openexrload.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -57,68 +57,68 @@ typedef struct _VipsForeignLoadOpenexr { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadOpenexr; + + typedef VipsForeignLoadClass VipsForeignLoadOpenexrClass; + +-G_DEFINE_TYPE( VipsForeignLoadOpenexr, vips_foreign_load_openexr, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_TYPE(VipsForeignLoadOpenexr, vips_foreign_load_openexr, ++ VIPS_TYPE_FOREIGN_LOAD); + + static VipsForeignFlags +-vips_foreign_load_openexr_get_flags_filename( const char *filename ) ++vips_foreign_load_openexr_get_flags_filename(const char *filename) + { + VipsForeignFlags flags; + + flags = 0; +- if( vips__openexr_istiled( filename ) ) ++ if (vips__openexr_istiled(filename)) + flags |= VIPS_FOREIGN_PARTIAL; + +- return( flags ); ++ return (flags); + } + + static VipsForeignFlags +-vips_foreign_load_openexr_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_openexr_get_flags(VipsForeignLoad *load) + { + VipsForeignLoadOpenexr *openexr = (VipsForeignLoadOpenexr *) load; + +- return( vips_foreign_load_openexr_get_flags_filename( +- openexr->filename ) ); ++ return (vips_foreign_load_openexr_get_flags_filename( ++ openexr->filename)); + } + + static int +-vips_foreign_load_openexr_header( VipsForeignLoad *load ) ++vips_foreign_load_openexr_header(VipsForeignLoad *load) + { + VipsForeignLoadOpenexr *openexr = (VipsForeignLoadOpenexr *) load; + +- if( vips__openexr_read_header( openexr->filename, load->out ) ) +- return( -1 ); ++ if (vips__openexr_read_header(openexr->filename, load->out)) ++ return (-1); + +- VIPS_SETSTR( load->out->filename, openexr->filename ); ++ VIPS_SETSTR(load->out->filename, openexr->filename); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_openexr_load( VipsForeignLoad *load ) ++vips_foreign_load_openexr_load(VipsForeignLoad *load) + { + VipsForeignLoadOpenexr *openexr = (VipsForeignLoadOpenexr *) load; + +- if( vips__openexr_read( openexr->filename, load->real ) ) +- return( -1 ); ++ if (vips__openexr_read(openexr->filename, load->real)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static const char *vips_foreign_openexr_suffs[] = { ".exr", NULL }; + + static void +-vips_foreign_load_openexr_class_init( VipsForeignLoadOpenexrClass *class ) ++vips_foreign_load_openexr_class_init(VipsForeignLoadOpenexrClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -126,7 +126,7 @@ vips_foreign_load_openexr_class_init( VipsForeignLoadOpenexrClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "openexrload"; +- object_class->description = _( "load an OpenEXR image" ); ++ object_class->description = _("load an OpenEXR image"); + + /* OpenEXR is fuzzed, but not by us. + */ +@@ -139,22 +139,22 @@ vips_foreign_load_openexr_class_init( VipsForeignLoadOpenexrClass *class ) + foreign_class->priority = 200; + + load_class->is_a = vips__openexr_isexr; +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_openexr_get_flags_filename; + load_class->get_flags = vips_foreign_load_openexr_get_flags; + load_class->header = vips_foreign_load_openexr_header; + load_class->load = vips_foreign_load_openexr_load; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadOpenexr, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadOpenexr, filename), ++ NULL); + } + + static void +-vips_foreign_load_openexr_init( VipsForeignLoadOpenexr *openexr ) ++vips_foreign_load_openexr_init(VipsForeignLoadOpenexr *openexr) + { + } + +@@ -166,7 +166,7 @@ vips_foreign_load_openexr_init( VipsForeignLoadOpenexr *openexr ) + * @out: (out): decompressed image + * @...: %NULL-terminated list of optional named arguments + * +- * Read a OpenEXR file into a VIPS image. ++ * Read a OpenEXR file into a VIPS image. + * + * The reader can handle scanline and tiled OpenEXR images. It can't handle + * OpenEXR colour management, image attributes, many pixel formats, anything +@@ -180,14 +180,14 @@ vips_foreign_load_openexr_init( VipsForeignLoadOpenexr *openexr ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_openexrload( const char *filename, VipsImage **out, ... ) ++vips_openexrload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "openexrload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("openexrload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/openslideload.c b/libvips/foreign/openslideload.c +index 32e50c9da5..7c70a95ddf 100644 +--- a/libvips/foreign/openslideload.c ++++ b/libvips/foreign/openslideload.c +@@ -44,7 +44,7 @@ + * 30/7/14 + * - add autocrop toggle + * 9/8/14 +- * - do argb -> rgba for associated as well ++ * - do argb -> rgba for associated as well + * 27/1/15 + * - unpremultiplication speedups for fully opaque/transparent pixels + * 18/1/17 +@@ -59,22 +59,22 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + +@@ -114,7 +114,7 @@ typedef struct { + + openslide_t *osr; + +- /* Crop to image bounds if @autocrop is set. ++ /* Crop to image bounds if @autocrop is set. + */ + VipsRect bounds; + +@@ -130,144 +130,144 @@ typedef struct { + } ReadSlide; + + static int +-vips__openslide_isslide( const char *filename ) ++vips__openslide_isslide(const char *filename) + { + #ifdef HAVE_OPENSLIDE_3_4 + const char *vendor; + int ok; + +- vendor = openslide_detect_vendor( filename ); ++ vendor = openslide_detect_vendor(filename); + + /* Generic tiled tiff images can be opened by openslide as well. + * Only offer to load this file if it's not a generic tiff since + * we want vips_tiffload() to handle these. + */ +- ok = ( vendor && +- strcmp( vendor, "generic-tiff" ) != 0 ); ++ ok = (vendor && ++ strcmp(vendor, "generic-tiff") != 0); + +- VIPS_DEBUG_MSG( "vips__openslide_isslide: %s - %d\n", filename, ok ); ++ VIPS_DEBUG_MSG("vips__openslide_isslide: %s - %d\n", filename, ok); + +- return( ok ); ++ return (ok); + #else + openslide_t *osr; + int ok; + + ok = 0; +- osr = openslide_open( filename ); ++ osr = openslide_open(filename); + +- if( osr ) { ++ if (osr) { + const char *vendor; + + /* Generic tiled tiff images can be opened by openslide as + * well. Only offer to load this file if it's not a generic + * tiff since we want vips_tiffload() to handle these. + */ +- vendor = openslide_get_property_value( osr, +- OPENSLIDE_PROPERTY_NAME_VENDOR ); ++ vendor = openslide_get_property_value(osr, ++ OPENSLIDE_PROPERTY_NAME_VENDOR); + + /* vendor will be NULL if osr is in error state. + */ +- if( vendor && +- strcmp( vendor, "generic-tiff" ) != 0 ) ++ if (vendor && ++ strcmp(vendor, "generic-tiff") != 0) + ok = 1; + +- openslide_close( osr ); +- } ++ openslide_close(osr); ++ } + +- VIPS_DEBUG_MSG( "vips__openslide_isslide: %s - %d\n", filename, ok ); ++ VIPS_DEBUG_MSG("vips__openslide_isslide: %s - %d\n", filename, ok); + +- return( ok ); ++ return (ok); + #endif + } + + static void +-readslide_destroy_cb( VipsImage *image, ReadSlide *rslide ) ++readslide_destroy_cb(VipsImage *image, ReadSlide *rslide) + { +- VIPS_FREEF( openslide_close, rslide->osr ); +- VIPS_FREE( rslide->associated ); +- VIPS_FREE( rslide->filename ); +- VIPS_FREE( rslide ); ++ VIPS_FREEF(openslide_close, rslide->osr); ++ VIPS_FREE(rslide->associated); ++ VIPS_FREE(rslide->filename); ++ VIPS_FREE(rslide); + } + + static int +-check_associated_image( openslide_t *osr, const char *name ) ++check_associated_image(openslide_t *osr, const char *name) + { +- const char * const *associated; ++ const char *const *associated; + +- for( associated = openslide_get_associated_image_names( osr ); +- *associated != NULL; associated++ ) +- if( strcmp( *associated, name ) == 0 ) +- return( 0 ); ++ for (associated = openslide_get_associated_image_names(osr); ++ *associated != NULL; associated++) ++ if (strcmp(*associated, name) == 0) ++ return (0); + +- vips_error( "openslide2vips", +- "%s", _( "invalid associated image name" ) ); ++ vips_error("openslide2vips", ++ "%s", _("invalid associated image name")); + +- return( -1 ); ++ return (-1); + } + + static gboolean +-get_bounds( openslide_t *osr, VipsRect *rect ) ++get_bounds(openslide_t *osr, VipsRect *rect) + { + static const char *openslide_names[] = { +- "openslide.bounds-x", +- "openslide.bounds-y", +- "openslide.bounds-width", ++ "openslide.bounds-x", ++ "openslide.bounds-y", ++ "openslide.bounds-width", + "openslide.bounds-height" + }; + static int vips_offsets[] = { +- G_STRUCT_OFFSET( VipsRect, left ), +- G_STRUCT_OFFSET( VipsRect, top ), +- G_STRUCT_OFFSET( VipsRect, width ), +- G_STRUCT_OFFSET( VipsRect, height ) ++ G_STRUCT_OFFSET(VipsRect, left), ++ G_STRUCT_OFFSET(VipsRect, top), ++ G_STRUCT_OFFSET(VipsRect, width), ++ G_STRUCT_OFFSET(VipsRect, height) + }; + + const char *value; + int i; + +- for( i = 0; i < 4; i++ ) { +- if( !(value = openslide_get_property_value( osr, +- openslide_names[i] )) ) +- return( FALSE ); +- G_STRUCT_MEMBER( int, rect, vips_offsets[i] ) = +- atoi( value ); ++ for (i = 0; i < 4; i++) { ++ if (!(value = openslide_get_property_value(osr, ++ openslide_names[i]))) ++ return (FALSE); ++ G_STRUCT_MEMBER(int, rect, vips_offsets[i]) = ++ atoi(value); + } + +- return( TRUE ); ++ return (TRUE); + } + + static ReadSlide * +-readslide_new( const char *filename, VipsImage *out, +- int level, gboolean autocrop, +- const char *associated, gboolean attach_associated, gboolean rgb ) ++readslide_new(const char *filename, VipsImage *out, ++ int level, gboolean autocrop, ++ const char *associated, gboolean attach_associated, gboolean rgb) + { + ReadSlide *rslide; + +- if( level && +- associated ) { +- vips_error( "openslide2vips", +- "%s", _( "specify only one of level and " +- "associated image" ) ); +- return( NULL ); ++ if (level && ++ associated) { ++ vips_error("openslide2vips", ++ "%s", _("specify only one of level and " ++ "associated image")); ++ return (NULL); + } + +- if( attach_associated && +- associated ) { +- vips_error( "openslide2vips", +- "%s", _( "specify only one of attach_assicated and " +- "associated image" ) ); +- return( NULL ); ++ if (attach_associated && ++ associated) { ++ vips_error("openslide2vips", ++ "%s", _("specify only one of attach_assicated and " ++ "associated image")); ++ return (NULL); + } + +- rslide = VIPS_NEW( NULL, ReadSlide ); +- memset( rslide, 0, sizeof( *rslide ) ); +- g_signal_connect( out, "close", G_CALLBACK( readslide_destroy_cb ), +- rslide ); ++ rslide = VIPS_NEW(NULL, ReadSlide); ++ memset(rslide, 0, sizeof(*rslide)); ++ g_signal_connect(out, "close", G_CALLBACK(readslide_destroy_cb), ++ rslide); + +- rslide->filename = g_strdup( filename ); ++ rslide->filename = g_strdup(filename); + rslide->out = out; + rslide->level = level; + rslide->autocrop = autocrop; +- rslide->associated = g_strdup( associated ); ++ rslide->associated = g_strdup(associated); + rslide->attach_associated = attach_associated; + rslide->rgb = rgb; + +@@ -276,10 +276,10 @@ readslide_new( const char *filename, VipsImage *out, + rslide->tile_width = 256; + rslide->tile_height = 256; + +- return( rslide ); ++ return (rslide); + } + +-/* Convert from ARGB to RGBA and undo premultiplication. ++/* Convert from ARGB to RGBA and undo premultiplication. + * + * We throw away transparency. Formats like Mirax use transparent + bg + * colour for areas with no useful pixels. But if we output +@@ -291,21 +291,21 @@ readslide_new( const char *filename, VipsImage *out, + * compatibility with older vipses. + */ + static void +-argb2rgba( uint32_t * restrict buf, int64_t n, uint32_t bg ) ++argb2rgba(uint32_t *restrict buf, int64_t n, uint32_t bg) + { +- const uint32_t pbg = GUINT32_TO_BE( (bg << 8) | 255 ); ++ const uint32_t pbg = GUINT32_TO_BE((bg << 8) | 255); + + int64_t i; + +- for( i = 0; i < n; i++ ) { +- uint32_t * restrict p = buf + i; ++ for (i = 0; i < n; i++) { ++ uint32_t *restrict p = buf + i; + uint32_t x = *p; + uint8_t a = x >> 24; +- VipsPel * restrict out = (VipsPel *) p; ++ VipsPel *restrict out = (VipsPel *) p; + +- if( a == 255 ) +- *p = GUINT32_TO_BE( (x << 8) | 255 ); +- else if( a == 0 ) ++ if (a == 255) ++ *p = GUINT32_TO_BE((x << 8) | 255); ++ else if (a == 0) + /* Use background color. + */ + *p = pbg; +@@ -323,202 +323,202 @@ argb2rgba( uint32_t * restrict buf, int64_t n, uint32_t bg ) + /* Convert from ARGB to RGB. In RGB mode, assume a is always 255. + */ + static void +-argb2rgb( uint32_t * restrict buf, VipsPel *restrict q, int64_t n ) ++argb2rgb(uint32_t *restrict buf, VipsPel *restrict q, int64_t n) + { + int64_t i; + +- for( i = 0; i < n; i++ ) { ++ for (i = 0; i < n; i++) { + uint32_t x = buf[i]; + +- q[0] = ((x >> 16) & 0xff); +- q[1] = ((x >> 8) & 0xff); +- q[2] = (x & 0xff); +- q += 3; ++ q[0] = ((x >> 16) & 0xff); ++ q[1] = ((x >> 8) & 0xff); ++ q[2] = (x & 0xff); ++ q += 3; + } + } + + static VipsImage * +-vips__openslide_get_associated( ReadSlide *rslide, const char *associated_name ) ++vips__openslide_get_associated(ReadSlide *rslide, const char *associated_name) + { +- VipsImage *associated; +- int64_t w, h; +- const char *error; +- +- associated = vips_image_new_memory(); +- openslide_get_associated_image_dimensions( rslide->osr, +- associated_name, &w, &h ); +- +- /* Always 4 bands, since this is the image that gets the ARGB from +- * cairo. +- */ +- vips_image_init_fields( associated, w, h, 4, +- VIPS_FORMAT_UCHAR, +- VIPS_CODING_NONE, VIPS_INTERPRETATION_sRGB, 1.0, 1.0 ); +- if( vips_image_pipelinev( associated, +- VIPS_DEMAND_STYLE_THINSTRIP, NULL ) || +- vips_image_write_prepare( associated ) ) { +- g_object_unref( associated ); +- return( NULL ); +- } +- +- openslide_read_associated_image( rslide->osr, +- associated_name, +- (uint32_t *) VIPS_IMAGE_ADDR( associated, 0, 0 ) ); +- error = openslide_get_error( rslide->osr ); +- if( error ) { +- vips_error( "openslide2vips", +- _( "reading associated image: %s" ), error ); +- g_object_unref( associated ); +- return( NULL ); +- } +- +- /* In RGB mode we make a second RGB image and repack to that. +- */ +- if( rslide->rgb ) { +- VipsImage *rgb; +- +- rgb = vips_image_new_memory(); +- vips_object_local( rgb, associated ); +- +- vips_image_init_fields( rgb, w, h, 3, +- VIPS_FORMAT_UCHAR, +- VIPS_CODING_NONE, VIPS_INTERPRETATION_sRGB, 1.0, 1.0 ); +- if( vips_image_pipelinev( rgb, +- VIPS_DEMAND_STYLE_THINSTRIP, NULL ) || +- vips_image_write_prepare( rgb ) ) { +- g_object_unref( rgb ); +- return( NULL ); +- } +- +- argb2rgb( (uint32_t *) VIPS_IMAGE_ADDR( associated, 0, 0 ), +- VIPS_IMAGE_ADDR( rgb, 0, 0 ), w * h ); +- +- associated = rgb; +- } +- else +- /* We can do this in place. +- */ +- argb2rgba( (uint32_t *) VIPS_IMAGE_ADDR( associated, 0, 0 ), +- w * h, rslide->bg ); +- +- return( associated ); ++ VipsImage *associated; ++ int64_t w, h; ++ const char *error; ++ ++ associated = vips_image_new_memory(); ++ openslide_get_associated_image_dimensions(rslide->osr, ++ associated_name, &w, &h); ++ ++ /* Always 4 bands, since this is the image that gets the ARGB from ++ * cairo. ++ */ ++ vips_image_init_fields(associated, w, h, 4, ++ VIPS_FORMAT_UCHAR, ++ VIPS_CODING_NONE, VIPS_INTERPRETATION_sRGB, 1.0, 1.0); ++ if (vips_image_pipelinev(associated, ++ VIPS_DEMAND_STYLE_THINSTRIP, NULL) || ++ vips_image_write_prepare(associated)) { ++ g_object_unref(associated); ++ return (NULL); ++ } ++ ++ openslide_read_associated_image(rslide->osr, ++ associated_name, ++ (uint32_t *) VIPS_IMAGE_ADDR(associated, 0, 0)); ++ error = openslide_get_error(rslide->osr); ++ if (error) { ++ vips_error("openslide2vips", ++ _("reading associated image: %s"), error); ++ g_object_unref(associated); ++ return (NULL); ++ } ++ ++ /* In RGB mode we make a second RGB image and repack to that. ++ */ ++ if (rslide->rgb) { ++ VipsImage *rgb; ++ ++ rgb = vips_image_new_memory(); ++ vips_object_local(rgb, associated); ++ ++ vips_image_init_fields(rgb, w, h, 3, ++ VIPS_FORMAT_UCHAR, ++ VIPS_CODING_NONE, VIPS_INTERPRETATION_sRGB, 1.0, 1.0); ++ if (vips_image_pipelinev(rgb, ++ VIPS_DEMAND_STYLE_THINSTRIP, NULL) || ++ vips_image_write_prepare(rgb)) { ++ g_object_unref(rgb); ++ return (NULL); ++ } ++ ++ argb2rgb((uint32_t *) VIPS_IMAGE_ADDR(associated, 0, 0), ++ VIPS_IMAGE_ADDR(rgb, 0, 0), w * h); ++ ++ associated = rgb; ++ } ++ else ++ /* We can do this in place. ++ */ ++ argb2rgba((uint32_t *) VIPS_IMAGE_ADDR(associated, 0, 0), ++ w * h, rslide->bg); ++ ++ return (associated); + } + + static int +-readslide_attach_associated( ReadSlide *rslide, VipsImage *image ) ++readslide_attach_associated(ReadSlide *rslide, VipsImage *image) + { +- const char * const *associated_name; ++ const char *const *associated_name; + +- for( associated_name = +- openslide_get_associated_image_names( rslide->osr ); +- *associated_name != NULL; associated_name++ ) { ++ for (associated_name = ++ openslide_get_associated_image_names(rslide->osr); ++ *associated_name != NULL; associated_name++) { + VipsImage *associated; +- char buf[256]; ++ char buf[256]; + +- if( !(associated = vips__openslide_get_associated( rslide, +- *associated_name )) ) +- return( -1 ); ++ if (!(associated = vips__openslide_get_associated(rslide, ++ *associated_name))) ++ return (-1); + +- vips_snprintf( buf, 256, +- "openslide.associated.%s", *associated_name ); +- vips_image_set_image( image, buf, associated ); ++ vips_snprintf(buf, 256, ++ "openslide.associated.%s", *associated_name); ++ vips_image_set_image(image, buf, associated); + +- g_object_unref( associated ); ++ g_object_unref(associated); + } + +- return( 0 ); ++ return (0); + } + + /* Read out a resolution field, converting to pixels per mm. + */ + static double +-readslice_parse_res( ReadSlide *rslide, const char *name ) ++readslice_parse_res(ReadSlide *rslide, const char *name) + { +- const char *value = openslide_get_property_value( rslide->osr, name ); +- double mpp = g_ascii_strtod( value, NULL ); ++ const char *value = openslide_get_property_value(rslide->osr, name); ++ double mpp = g_ascii_strtod(value, NULL); + +- return( mpp == 0 ? 1.0 : 1000.0 / mpp ); ++ return (mpp == 0 ? 1.0 : 1000.0 / mpp); + } + + static int +-readslide_parse( ReadSlide *rslide, VipsImage *image ) ++readslide_parse(ReadSlide *rslide, VipsImage *image) + { + int64_t w, h; + const char *error; + const char *background; +- const char * const *properties; ++ const char *const *properties; + char *associated_names; + double xres; + double yres; + +- rslide->osr = openslide_open( rslide->filename ); +- if( rslide->osr == NULL ) { +- vips_error( "openslide2vips", +- "%s", _( "unsupported slide format" ) ); +- return( -1 ); ++ rslide->osr = openslide_open(rslide->filename); ++ if (rslide->osr == NULL) { ++ vips_error("openslide2vips", ++ "%s", _("unsupported slide format")); ++ return (-1); + } + +- error = openslide_get_error( rslide->osr ); +- if( error ) { +- vips_error( "openslide2vips", +- _( "opening slide: %s" ), error ); +- return( -1 ); ++ error = openslide_get_error(rslide->osr); ++ if (error) { ++ vips_error("openslide2vips", ++ _("opening slide: %s"), error); ++ return (-1); + } + +- if( rslide->level < 0 || +- rslide->level >= openslide_get_level_count( rslide->osr ) ) { +- vips_error( "openslide2vips", +- "%s", _( "invalid slide level" ) ); +- return( -1 ); ++ if (rslide->level < 0 || ++ rslide->level >= openslide_get_level_count(rslide->osr)) { ++ vips_error("openslide2vips", ++ "%s", _("invalid slide level")); ++ return (-1); + } + +- if( rslide->associated && +- check_associated_image( rslide->osr, rslide->associated ) ) +- return( -1 ); +- +- if( rslide->associated ) { +- openslide_get_associated_image_dimensions( rslide->osr, +- rslide->associated, &w, &h ); +- vips_image_set_string( image, "slide-associated-image", +- rslide->associated ); +- if( vips_image_pipelinev( image, +- VIPS_DEMAND_STYLE_THINSTRIP, NULL ) ) +- return( -1 ); +- } ++ if (rslide->associated && ++ check_associated_image(rslide->osr, rslide->associated)) ++ return (-1); ++ ++ if (rslide->associated) { ++ openslide_get_associated_image_dimensions(rslide->osr, ++ rslide->associated, &w, &h); ++ vips_image_set_string(image, "slide-associated-image", ++ rslide->associated); ++ if (vips_image_pipelinev(image, ++ VIPS_DEMAND_STYLE_THINSTRIP, NULL)) ++ return (-1); ++ } + else { + char buf[256]; + const char *value; + +- openslide_get_level_dimensions( rslide->osr, +- rslide->level, &w, &h ); ++ openslide_get_level_dimensions(rslide->osr, ++ rslide->level, &w, &h); + rslide->downsample = openslide_get_level_downsample( +- rslide->osr, rslide->level ); +- vips_image_set_int( image, "slide-level", rslide->level ); +- if( vips_image_pipelinev( image, +- VIPS_DEMAND_STYLE_SMALLTILE, NULL ) ) +- return( -1 ); ++ rslide->osr, rslide->level); ++ vips_image_set_int(image, "slide-level", rslide->level); ++ if (vips_image_pipelinev(image, ++ VIPS_DEMAND_STYLE_SMALLTILE, NULL)) ++ return (-1); + + /* Try to get tile width/height. An undocumented, experimental + * feature. + */ +- vips_snprintf( buf, 256, +- "openslide.level[%d].tile-width", rslide->level ); +- if( (value = openslide_get_property_value( rslide->osr, buf )) ) +- rslide->tile_width = atoi( value ); +- vips_snprintf( buf, 256, +- "openslide.level[%d].tile-height", rslide->level ); +- if( (value = openslide_get_property_value( rslide->osr, buf )) ) +- rslide->tile_height = atoi( value ); +- if( value ) +- VIPS_DEBUG_MSG( "readslide_new: found tile-size\n" ); +- +- /* Some images have a bounds in the header. Crop to +- * that if autocrop is set. ++ vips_snprintf(buf, 256, ++ "openslide.level[%d].tile-width", rslide->level); ++ if ((value = openslide_get_property_value(rslide->osr, buf))) ++ rslide->tile_width = atoi(value); ++ vips_snprintf(buf, 256, ++ "openslide.level[%d].tile-height", rslide->level); ++ if ((value = openslide_get_property_value(rslide->osr, buf))) ++ rslide->tile_height = atoi(value); ++ if (value) ++ VIPS_DEBUG_MSG("readslide_new: found tile-size\n"); ++ ++ /* Some images have a bounds in the header. Crop to ++ * that if autocrop is set. + */ +- if( rslide->autocrop ) +- if( !get_bounds( rslide->osr, &rslide->bounds ) ) +- rslide->autocrop = FALSE; +- if( rslide->autocrop ) { ++ if (rslide->autocrop) ++ if (!get_bounds(rslide->osr, &rslide->bounds)) ++ rslide->autocrop = FALSE; ++ if (rslide->autocrop) { + VipsRect whole; + + rslide->bounds.left /= rslide->downsample; +@@ -532,46 +532,46 @@ readslide_parse( ReadSlide *rslide, VipsImage *image ) + whole.top = 0; + whole.width = w; + whole.height = h; +- vips_rect_intersectrect( &rslide->bounds, &whole, +- &rslide->bounds ); ++ vips_rect_intersectrect(&rslide->bounds, &whole, ++ &rslide->bounds); + + /* If we've clipped to nothing, ignore bounds. + */ +- if( vips_rect_isempty( &rslide->bounds ) ) ++ if (vips_rect_isempty(&rslide->bounds)) + rslide->autocrop = FALSE; + } +- if( rslide->autocrop ) { ++ if (rslide->autocrop) { + w = rslide->bounds.width; + h = rslide->bounds.height; + } + + /* Attach all associated images. + */ +- if( rslide->attach_associated && +- readslide_attach_associated( rslide, image ) ) +- return( -1 ); ++ if (rslide->attach_associated && ++ readslide_attach_associated(rslide, image)) ++ return (-1); + } + + rslide->bg = 0xffffff; +- if( (background = openslide_get_property_value( rslide->osr, +- OPENSLIDE_PROPERTY_NAME_BACKGROUND_COLOR )) ) +- rslide->bg = strtoul( background, NULL, 16 ); +- +- if( w <= 0 || +- h <= 0 || +- rslide->downsample < 0 ) { +- vips_error( "openslide2vips", _( "getting dimensions: %s" ), +- openslide_get_error( rslide->osr ) ); +- return( -1 ); ++ if ((background = openslide_get_property_value(rslide->osr, ++ OPENSLIDE_PROPERTY_NAME_BACKGROUND_COLOR))) ++ rslide->bg = strtoul(background, NULL, 16); ++ ++ if (w <= 0 || ++ h <= 0 || ++ rslide->downsample < 0) { ++ vips_error("openslide2vips", _("getting dimensions: %s"), ++ openslide_get_error(rslide->osr)); ++ return (-1); + } +- if( w > INT_MAX || +- h > INT_MAX ) { +- vips_error( "openslide2vips", +- "%s", _( "image dimensions overflow int" ) ); +- return( -1 ); ++ if (w > INT_MAX || ++ h > INT_MAX) { ++ vips_error("openslide2vips", ++ "%s", _("image dimensions overflow int")); ++ return (-1); + } + +- if( !rslide->autocrop ) { ++ if (!rslide->autocrop) { + rslide->bounds.left = 0; + rslide->bounds.top = 0; + rslide->bounds.width = w; +@@ -583,74 +583,73 @@ readslide_parse( ReadSlide *rslide, VipsImage *image ) + xres = 1.0; + yres = 1.0; + +- for( properties = openslide_get_property_names( rslide->osr ); +- *properties != NULL; properties++ ) { ++ for (properties = openslide_get_property_names(rslide->osr); ++ *properties != NULL; properties++) { + const char *name = *properties; +- const char *value = +- openslide_get_property_value( rslide->osr, name ); ++ const char *value = ++ openslide_get_property_value(rslide->osr, name); + + /* Can be NULL for some openslides with some images. + */ +- if( value ) { +- vips_image_set_string( image, name, value ); ++ if (value) { ++ vips_image_set_string(image, name, value); + +- if( strcmp( *properties, "openslide.mpp-x" ) == 0 ) +- xres = readslice_parse_res( rslide, name ); +- if( strcmp( *properties, "openslide.mpp-y" ) == 0 ) +- yres = readslice_parse_res( rslide, name ); ++ if (strcmp(*properties, "openslide.mpp-x") == 0) ++ xres = readslice_parse_res(rslide, name); ++ if (strcmp(*properties, "openslide.mpp-y") == 0) ++ yres = readslice_parse_res(rslide, name); + } + } + +- associated_names = g_strjoinv( ", ", (char **) +- openslide_get_associated_image_names( rslide->osr ) ); +- vips_image_set_string( image, +- "slide-associated-images", associated_names ); +- VIPS_FREE( associated_names ); ++ associated_names = g_strjoinv(", ", (char **) openslide_get_associated_image_names(rslide->osr)); ++ vips_image_set_string(image, ++ "slide-associated-images", associated_names); ++ VIPS_FREE(associated_names); + +- vips_image_init_fields( image, w, h, rslide->rgb ? 3 : 4, +- VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, +- VIPS_INTERPRETATION_sRGB, xres, yres ); ++ vips_image_init_fields(image, w, h, rslide->rgb ? 3 : 4, ++ VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, ++ VIPS_INTERPRETATION_sRGB, xres, yres); + +- return( 0 ); ++ return (0); + } + + static int +-vips__openslide_read_header( const char *filename, VipsImage *out, +- int level, gboolean autocrop, +- char *associated, gboolean attach_associated, gboolean rgb ) ++vips__openslide_read_header(const char *filename, VipsImage *out, ++ int level, gboolean autocrop, ++ char *associated, gboolean attach_associated, gboolean rgb) + { + ReadSlide *rslide; + +- if( !(rslide = readslide_new( filename, +- out, level, autocrop, associated, attach_associated, rgb )) || +- readslide_parse( rslide, out ) ) +- return( -1 ); ++ if (!(rslide = readslide_new(filename, ++ out, level, autocrop, associated, attach_associated, rgb)) || ++ readslide_parse(rslide, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Allocate a tile buffer. Have one of these for each thread so we can unpack + * to vips in parallel. + */ + static void * +-vips__openslide_start( VipsImage *out, void *a, void *b ) ++vips__openslide_start(VipsImage *out, void *a, void *b) + { + ReadSlide *rslide = (ReadSlide *) a; + +- uint32_t *tile_buffer; ++ uint32_t *tile_buffer; + +- if( !(tile_buffer = VIPS_MALLOC( NULL, +- (size_t) rslide->tile_width * rslide->tile_height * 4 )) ) +- return( NULL ); ++ if (!(tile_buffer = VIPS_MALLOC(NULL, ++ (size_t) rslide->tile_width * rslide->tile_height * 4))) ++ return (NULL); + +- return( (void *) tile_buffer ); ++ return ((void *) tile_buffer); + } + + static int +-vips__openslide_generate( VipsRegion *out, +- void *_seq, void *_rslide, void *unused, gboolean *stop ) ++vips__openslide_generate(VipsRegion *out, ++ void *_seq, void *_rslide, void *unused, gboolean *stop) + { +- uint32_t *tile_buffer = (uint32_t *) _seq; ++ uint32_t *tile_buffer = (uint32_t *) _seq; + ReadSlide *rslide = _rslide; + uint32_t bg = rslide->bg; + VipsRect *r = &out->valid; +@@ -659,145 +658,145 @@ vips__openslide_generate( VipsRegion *out, + uint32_t *buf; + const char *error; + +- VIPS_DEBUG_MSG( "vips__openslide_generate: %dx%d @ %dx%d\n", +- r->width, r->height, r->left, r->top ); ++ VIPS_DEBUG_MSG("vips__openslide_generate: %dx%d @ %dx%d\n", ++ r->width, r->height, r->left, r->top); + + /* We're inside a cache, so requests should always be + * tile_width by tile_height pixels and on a tile boundary. + */ +- g_assert( (r->left % rslide->tile_width) == 0 ); +- g_assert( (r->top % rslide->tile_height) == 0 ); +- g_assert( r->width <= rslide->tile_width ); +- g_assert( r->height <= rslide->tile_height ); +- +- /* The memory on the region should be contiguous. +- */ +- g_assert( VIPS_REGION_LSKIP( out ) == r->width * out->im->Bands ); +- +- /* In RGB mode we need to read to the tile buffer. +- */ +- if( rslide->rgb ) { +- g_assert( tile_buffer ); +- g_assert( rslide->tile_width >= r->width ); +- g_assert( rslide->tile_height >= r->height ); +- +- buf = tile_buffer; +- } +- else +- buf = (uint32_t *) VIPS_REGION_ADDR( out, r->left, r->top ); +- +- openslide_read_region( rslide->osr, ++ g_assert((r->left % rslide->tile_width) == 0); ++ g_assert((r->top % rslide->tile_height) == 0); ++ g_assert(r->width <= rslide->tile_width); ++ g_assert(r->height <= rslide->tile_height); ++ ++ /* The memory on the region should be contiguous. ++ */ ++ g_assert(VIPS_REGION_LSKIP(out) == r->width * out->im->Bands); ++ ++ /* In RGB mode we need to read to the tile buffer. ++ */ ++ if (rslide->rgb) { ++ g_assert(tile_buffer); ++ g_assert(rslide->tile_width >= r->width); ++ g_assert(rslide->tile_height >= r->height); ++ ++ buf = tile_buffer; ++ } ++ else ++ buf = (uint32_t *) VIPS_REGION_ADDR(out, r->left, r->top); ++ ++ openslide_read_region(rslide->osr, + buf, +- (r->left + rslide->bounds.left) * rslide->downsample, +- (r->top + rslide->bounds.top) * rslide->downsample, ++ (r->left + rslide->bounds.left) * rslide->downsample, ++ (r->top + rslide->bounds.top) * rslide->downsample, + rslide->level, +- r->width, r->height ); ++ r->width, r->height); + + /* openslide errors are terminal. To support +- * @fail we'd have to close the openslide_t and reopen, perhaps ++ * @fail we'd have to close the openslide_t and reopen, perhaps + * somehow marking this tile as unreadable. + * + * See + * https://github.com/libvips/libvips/commit/bb0a6643f94e69294e36d2b253f9bdd60c8c40ed#commitcomment-19838911 + */ +- error = openslide_get_error( rslide->osr ); +- if( error ) { +- vips_error( "openslide2vips", +- _( "reading region: %s" ), error ); +- return( -1 ); ++ error = openslide_get_error(rslide->osr); ++ if (error) { ++ vips_error("openslide2vips", ++ _("reading region: %s"), error); ++ return (-1); + } + +- if( rslide->rgb ) +- argb2rgb( tile_buffer, +- VIPS_REGION_ADDR( out, r->left, r->top ), n ); +- else +- argb2rgba( buf, n, bg ); ++ if (rslide->rgb) ++ argb2rgb(tile_buffer, ++ VIPS_REGION_ADDR(out, r->left, r->top), n); ++ else ++ argb2rgba(buf, n, bg); + +- return( 0 ); ++ return (0); + } + + static int +-vips__openslide_stop( void *_seq, void *a, void *b ) ++vips__openslide_stop(void *_seq, void *a, void *b) + { +- uint32_t *tile_buffer = (uint32_t *) _seq; ++ uint32_t *tile_buffer = (uint32_t *) _seq; + +- VIPS_FREE( tile_buffer ); ++ VIPS_FREE(tile_buffer); + +- return( 0 ); ++ return (0); + } + + static int +-vips__openslide_read( const char *filename, VipsImage *out, ++vips__openslide_read(const char *filename, VipsImage *out, + int level, gboolean autocrop, gboolean attach_associated, +- gboolean rgb ) ++ gboolean rgb) + { + ReadSlide *rslide; + VipsImage *raw; + VipsImage *t; + +- VIPS_DEBUG_MSG( "vips__openslide_read: %s %d\n", +- filename, level ); ++ VIPS_DEBUG_MSG("vips__openslide_read: %s %d\n", ++ filename, level); + +- if( !(rslide = readslide_new( filename, out, level, autocrop, +- NULL, attach_associated, rgb )) ) +- return( -1 ); ++ if (!(rslide = readslide_new(filename, out, level, autocrop, ++ NULL, attach_associated, rgb))) ++ return (-1); + + raw = vips_image_new(); +- vips_object_local( out, raw ); ++ vips_object_local(out, raw); + +- if( readslide_parse( rslide, raw ) || +- vips_image_generate( raw, +- vips__openslide_start, +- vips__openslide_generate, +- vips__openslide_stop, rslide, NULL ) ) +- return( -1 ); ++ if (readslide_parse(rslide, raw) || ++ vips_image_generate(raw, ++ vips__openslide_start, ++ vips__openslide_generate, ++ vips__openslide_stop, rslide, NULL)) ++ return (-1); + +- /* Copy to out, adding a cache. Enough tiles for two complete rows, ++ /* Copy to out, adding a cache. Enough tiles for two complete rows, + * plus 50%. We need at least two rows, or we'll constantly reload + * tiles if they cross a tile boundary. + */ +- if( vips_tilecache( raw, &t, +- "tile_width", rslide->tile_width, +- "tile_height", rslide->tile_height, +- "max_tiles", ++ if (vips_tilecache(raw, &t, ++ "tile_width", rslide->tile_width, ++ "tile_height", rslide->tile_height, ++ "max_tiles", + (int) (2.5 * (1 + raw->Xsize / rslide->tile_width)), +- "threaded", TRUE, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t, out ) ) { +- g_object_unref( t ); +- return( -1 ); ++ "threaded", TRUE, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t, out)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + +- return( 0 ); ++ return (0); + } + + static int +-vips__openslide_read_associated( const char *filename, VipsImage *out, +- const char *associated_name, gboolean rgb ) ++vips__openslide_read_associated(const char *filename, VipsImage *out, ++ const char *associated_name, gboolean rgb) + { + ReadSlide *rslide; + VipsImage *associated; + +- VIPS_DEBUG_MSG( "vips__openslide_read_associated: %s %s\n", +- filename, associated_name ); ++ VIPS_DEBUG_MSG("vips__openslide_read_associated: %s %s\n", ++ filename, associated_name); + +- if( !(rslide = readslide_new( filename, +- out, 0, FALSE, associated_name, FALSE, rgb )) ) +- return( -1 ); ++ if (!(rslide = readslide_new(filename, ++ out, 0, FALSE, associated_name, FALSE, rgb))) ++ return (-1); + +- if( !(associated = vips__openslide_get_associated( rslide, +- associated_name )) ) +- return( -1 ); ++ if (!(associated = vips__openslide_get_associated(rslide, ++ associated_name))) ++ return (-1); + +- if( vips_image_write( associated, out ) ) { +- VIPS_UNREF( associated ); +- return( -1 ); +- } +- VIPS_UNREF( associated ); ++ if (vips_image_write(associated, out)) { ++ VIPS_UNREF(associated); ++ return (-1); ++ } ++ VIPS_UNREF(associated); + +- return( 0 ); ++ return (0); + } + + typedef struct _VipsForeignLoadOpenslide { +@@ -819,7 +818,7 @@ typedef struct _VipsForeignLoadOpenslide { + */ + gboolean autocrop; + +- /* Load just this associated image. ++ /* Load just this associated image. + */ + char *associated; + +@@ -827,141 +826,139 @@ typedef struct _VipsForeignLoadOpenslide { + */ + gboolean attach_associated; + +- /* Read as RGB, not RGBA. +- */ ++ /* Read as RGB, not RGBA. ++ */ + gboolean rgb; + + } VipsForeignLoadOpenslide; + + typedef VipsForeignLoadClass VipsForeignLoadOpenslideClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadOpenslide, vips_foreign_load_openslide, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadOpenslide, vips_foreign_load_openslide, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_openslide_dispose( GObject *gobject ) ++vips_foreign_load_openslide_dispose(GObject *gobject) + { +- VipsForeignLoadOpenslide *openslide = ++ VipsForeignLoadOpenslide *openslide = + (VipsForeignLoadOpenslide *) gobject; + +- VIPS_UNREF( openslide->source ); ++ VIPS_UNREF(openslide->source); + +- G_OBJECT_CLASS( vips_foreign_load_openslide_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_openslide_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_load_openslide_build( VipsObject *object ) ++vips_foreign_load_openslide_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsForeignLoadOpenslide *openslide = ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsForeignLoadOpenslide *openslide = + (VipsForeignLoadOpenslide *) object; + + /* We can only open source which have an associated filename, since + * the openslide library works in terms of filenames. + */ +- if( openslide->source ) { +- VipsConnection *connection = +- VIPS_CONNECTION( openslide->source ); ++ if (openslide->source) { ++ VipsConnection *connection = ++ VIPS_CONNECTION(openslide->source); + + const char *filename; + +- if( !vips_source_is_file( openslide->source ) || +- !(filename = vips_connection_filename( connection )) ) { +- vips_error( class->nickname, "%s", +- _( "no filename available" ) ); +- return( -1 ); ++ if (!vips_source_is_file(openslide->source) || ++ !(filename = vips_connection_filename(connection))) { ++ vips_error(class->nickname, "%s", ++ _("no filename available")); ++ return (-1); + } + + openslide->filename = filename; + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_openslide_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_openslide_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static VipsForeignFlags +-vips_foreign_load_openslide_get_flags_source( VipsSource *source ) ++vips_foreign_load_openslide_get_flags_source(VipsSource *source) + { + /* We can't tell from just the source, we need to know what part of + * the file the user wants. But it'll usually be partial. + */ +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static VipsForeignFlags +-vips_foreign_load_openslide_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_openslide_get_flags(VipsForeignLoad *load) + { + VipsForeignLoadOpenslide *openslide = (VipsForeignLoadOpenslide *) load; + VipsForeignFlags flags; + + flags = 0; +- if( !openslide->associated ) ++ if (!openslide->associated) + flags |= VIPS_FOREIGN_PARTIAL; + +- return( flags ); ++ return (flags); + } + + static VipsForeignFlags +-vips_foreign_load_openslide_get_flags_filename( const char *filename ) ++vips_foreign_load_openslide_get_flags_filename(const char *filename) + { + VipsSource *source; + VipsForeignFlags flags; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( 0 ); +- flags = vips_foreign_load_openslide_get_flags_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (0); ++ flags = vips_foreign_load_openslide_get_flags_source(source); ++ VIPS_UNREF(source); + +- return( flags ); ++ return (flags); + } + + static int +-vips_foreign_load_openslide_header( VipsForeignLoad *load ) ++vips_foreign_load_openslide_header(VipsForeignLoad *load) + { + VipsForeignLoadOpenslide *openslide = (VipsForeignLoadOpenslide *) load; + +- if( vips__openslide_read_header( openslide->filename, load->out, +- openslide->level, openslide->autocrop, +- openslide->associated, openslide->attach_associated, +- openslide->rgb ) ) +- return( -1 ); ++ if (vips__openslide_read_header(openslide->filename, load->out, ++ openslide->level, openslide->autocrop, ++ openslide->associated, openslide->attach_associated, ++ openslide->rgb)) ++ return (-1); + +- VIPS_SETSTR( load->out->filename, openslide->filename ); ++ VIPS_SETSTR(load->out->filename, openslide->filename); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_openslide_load( VipsForeignLoad *load ) ++vips_foreign_load_openslide_load(VipsForeignLoad *load) + { + VipsForeignLoadOpenslide *openslide = (VipsForeignLoadOpenslide *) load; + +- if( !openslide->associated ) { +- if( vips__openslide_read( openslide->filename, load->real, +- openslide->level, openslide->autocrop, +- openslide->attach_associated, +- openslide->rgb ) ) +- return( -1 ); ++ if (!openslide->associated) { ++ if (vips__openslide_read(openslide->filename, load->real, ++ openslide->level, openslide->autocrop, ++ openslide->attach_associated, ++ openslide->rgb)) ++ return (-1); + } + else { +- if( vips__openslide_read_associated( openslide->filename, +- load->real, openslide->associated, openslide->rgb ) ) +- return( -1 ); ++ if (vips__openslide_read_associated(openslide->filename, ++ load->real, openslide->associated, openslide->rgb)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_openslide_class_init( VipsForeignLoadOpenslideClass *class ) ++vips_foreign_load_openslide_class_init(VipsForeignLoadOpenslideClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -970,7 +967,7 @@ vips_foreign_load_openslide_class_init( VipsForeignLoadOpenslideClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "openslideload_base"; +- object_class->description = _( "load OpenSlide base class" ); ++ object_class->description = _("load OpenSlide base class"); + object_class->build = vips_foreign_load_openslide_build; + + /* We need to be ahead of the tiff sniffer since many OpenSlide +@@ -982,61 +979,60 @@ vips_foreign_load_openslide_class_init( VipsForeignLoadOpenslideClass *class ) + */ + foreign_class->priority = 100; + +- /* libopenslide does not try to recover from errors, so it's not safe ++ /* libopenslide does not try to recover from errors, so it's not safe + * to cache. + */ + operation_class->flags |= VIPS_OPERATION_NOCACHE; + +- /* openslide has not been fuzzed and is largly unmaintained, so should ++ /* openslide has not been fuzzed and is largly unmaintained, so should + * not be used with untrusted input unless you are very careful. + */ + operation_class->flags |= VIPS_OPERATION_UNTRUSTED; + +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_openslide_get_flags_filename; + load_class->get_flags = vips_foreign_load_openslide_get_flags; + load_class->header = vips_foreign_load_openslide_header; + load_class->load = vips_foreign_load_openslide_load; + +- VIPS_ARG_INT( class, "level", 20, +- _( "Level" ), +- _( "Load this level from the file" ), ++ VIPS_ARG_INT(class, "level", 20, ++ _("Level"), ++ _("Load this level from the file"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadOpenslide, level ), +- 0, 100000, 0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadOpenslide, level), ++ 0, 100000, 0); + +- VIPS_ARG_BOOL( class, "autocrop", 21, +- _( "Autocrop" ), +- _( "Crop to image bounds" ), ++ VIPS_ARG_BOOL(class, "autocrop", 21, ++ _("Autocrop"), ++ _("Crop to image bounds"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadOpenslide, autocrop ), +- FALSE ); +- +- VIPS_ARG_STRING( class, "associated", 22, +- _( "Associated" ), +- _( "Load this associated image" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadOpenslide, associated ), +- NULL ); +- +- VIPS_ARG_BOOL( class, "attach_associated", 23, +- _( "Attach associated" ), +- _( "Attach all associated images" ), ++ G_STRUCT_OFFSET(VipsForeignLoadOpenslide, autocrop), ++ FALSE); ++ ++ VIPS_ARG_STRING(class, "associated", 22, ++ _("Associated"), ++ _("Load this associated image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadOpenslide, attach_associated ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignLoadOpenslide, associated), ++ NULL); + +- VIPS_ARG_BOOL( class, "rgb", 24, +- _( "RGB" ), +- _( "Output RGB (not RGBA)" ), ++ VIPS_ARG_BOOL(class, "attach_associated", 23, ++ _("Attach associated"), ++ _("Attach all associated images"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadOpenslide, rgb ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignLoadOpenslide, attach_associated), ++ FALSE); + ++ VIPS_ARG_BOOL(class, "rgb", 24, ++ _("RGB"), ++ _("Output RGB (not RGBA)"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadOpenslide, rgb), ++ FALSE); + } + + static void +-vips_foreign_load_openslide_init( VipsForeignLoadOpenslide *openslide ) ++vips_foreign_load_openslide_init(VipsForeignLoadOpenslide *openslide) + { + } + +@@ -1045,51 +1041,50 @@ typedef struct _VipsForeignLoadOpenslideFile { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadOpenslideFile; + + typedef VipsForeignLoadOpenslideClass VipsForeignLoadOpenslideFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadOpenslideFile, vips_foreign_load_openslide_file, +- vips_foreign_load_openslide_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadOpenslideFile, vips_foreign_load_openslide_file, ++ vips_foreign_load_openslide_get_type()); + + static int +-vips_foreign_load_openslide_file_build( VipsObject *object ) ++vips_foreign_load_openslide_file_build(VipsObject *object) + { +- VipsForeignLoadOpenslide *openslide = ++ VipsForeignLoadOpenslide *openslide = + (VipsForeignLoadOpenslide *) object; +- VipsForeignLoadOpenslideFile *file = ++ VipsForeignLoadOpenslideFile *file = + (VipsForeignLoadOpenslideFile *) object; + +- if( file->filename && +- !(openslide->source = +- vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(openslide->source = ++ vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_openslide_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_openslide_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static const char *vips_foreign_openslide_suffs[] = { +- ".svs", /* Aperio */ +- ".vms", ".vmu", ".ndpi", /* Hamamatsu */ +- ".scn", /* Leica */ +- ".mrxs", /* MIRAX */ +- ".svslide", /* Sakura */ +- ".tif", /* Trestle */ +- ".bif", /* Ventana */ ++ ".svs", /* Aperio */ ++ ".vms", ".vmu", ".ndpi", /* Hamamatsu */ ++ ".scn", /* Leica */ ++ ".mrxs", /* MIRAX */ ++ ".svslide", /* Sakura */ ++ ".tif", /* Trestle */ ++ ".bif", /* Ventana */ + NULL + }; + + static void +-vips_foreign_load_openslide_file_class_init( +- VipsForeignLoadOpenslideFileClass *class ) ++vips_foreign_load_openslide_file_class_init( ++ VipsForeignLoadOpenslideFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -1098,24 +1093,23 @@ vips_foreign_load_openslide_file_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "openslideload"; +- object_class->description = _( "load file with OpenSlide" ); ++ object_class->description = _("load file with OpenSlide"); + object_class->build = vips_foreign_load_openslide_file_build; + + foreign_class->suffs = vips_foreign_openslide_suffs; + + load_class->is_a = vips__openslide_isslide; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadOpenslideFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadOpenslideFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_openslide_file_init( VipsForeignLoadOpenslideFile *openslide ) ++vips_foreign_load_openslide_file_init(VipsForeignLoadOpenslideFile *openslide) + { + } + +@@ -1130,48 +1124,48 @@ typedef struct _VipsForeignLoadOpenslideSource { + + typedef VipsForeignLoadOpenslideClass VipsForeignLoadOpenslideSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadOpenslideSource, +- vips_foreign_load_openslide_source, +- vips_foreign_load_openslide_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadOpenslideSource, ++ vips_foreign_load_openslide_source, ++ vips_foreign_load_openslide_get_type()); + + static int +-vips_foreign_load_openslide_source_build( VipsObject *object ) ++vips_foreign_load_openslide_source_build(VipsObject *object) + { +- VipsForeignLoadOpenslide *openslide = ++ VipsForeignLoadOpenslide *openslide = + (VipsForeignLoadOpenslide *) object; +- VipsForeignLoadOpenslideSource *source = ++ VipsForeignLoadOpenslideSource *source = + (VipsForeignLoadOpenslideSource *) object; + +- if( source->source ) { ++ if (source->source) { + openslide->source = source->source; +- g_object_ref( openslide->source ); ++ g_object_ref(openslide->source); + } + +- if( VIPS_OBJECT_CLASS( +- vips_foreign_load_openslide_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS( ++ vips_foreign_load_openslide_source_parent_class) ++ ->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_openslide_source_is_a_source( VipsSource *source ) ++vips_foreign_load_openslide_source_is_a_source(VipsSource *source) + { +- VipsConnection *connection = VIPS_CONNECTION( source ); ++ VipsConnection *connection = VIPS_CONNECTION(source); + + const char *filename; + +- return( vips_source_is_file( source ) && +- (filename = vips_connection_filename( connection )) && +- vips__openslide_isslide( filename ) ); ++ return (vips_source_is_file(source) && ++ (filename = vips_connection_filename(connection)) && ++ vips__openslide_isslide(filename)); + } + + static void +-vips_foreign_load_openslide_source_class_init( +- VipsForeignLoadOpenslideSourceClass *class ) ++vips_foreign_load_openslide_source_class_init( ++ VipsForeignLoadOpenslideSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -1179,24 +1173,23 @@ vips_foreign_load_openslide_source_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "openslideload_source"; +- object_class->description = _( "load source with OpenSlide" ); ++ object_class->description = _("load source with OpenSlide"); + object_class->build = vips_foreign_load_openslide_source_build; + +- load_class->is_a_source = ++ load_class->is_a_source = + vips_foreign_load_openslide_source_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadOpenslideSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadOpenslideSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_openslide_source_init( +- VipsForeignLoadOpenslideSource *openslide ) ++vips_foreign_load_openslide_source_init( ++ VipsForeignLoadOpenslideSource *openslide) + { + } + +diff --git a/libvips/foreign/pdfiumload.c b/libvips/foreign/pdfiumload.c +index 7f62246941..376ca569b9 100644 +--- a/libvips/foreign/pdfiumload.c ++++ b/libvips/foreign/pdfiumload.c +@@ -20,32 +20,32 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +-/* TODO ++/* TODO + * + * - what about filename encodings? + * - need to test on Windows +@@ -53,7 +53,7 @@ + + /* How to build against PDFium: + * +- * Download the prebuilt binary from: ++ * Download the prebuilt binary from: + * + * https://github.com/bblanchon/pdfium-binaries + * +@@ -67,19 +67,19 @@ + + VIPSHOME=/home/john/vips + cat > $VIPSHOME/lib/pkgconfig/pdfium.pc << EOF +- prefix=$VIPSHOME +- exec_prefix=\${prefix} +- libdir=\${exec_prefix}/lib +- includedir=\${prefix}/include +- Name: pdfium +- Description: pdfium +- Version: 4290 +- Requires: +- Libs: -L\${libdir} -lpdfium +- Cflags: -I\${includedir} ++ prefix=$VIPSHOME ++ exec_prefix=\${prefix} ++ libdir=\${exec_prefix}/lib ++ includedir=\${prefix}/include ++ Name: pdfium ++ Description: pdfium ++ Version: 4290 ++ Requires: ++ Libs: -L\${libdir} -lpdfium ++ Cflags: -I\${includedir} + EOF + +- * ++ * + */ + + /* +@@ -121,7 +121,7 @@ typedef struct _VipsForeignLoadPdf { + + /* Load this many pages. + */ +- int n; ++ int n; + + /* Render at this DPI. + */ +@@ -144,7 +144,7 @@ typedef struct _VipsForeignLoadPdf { + FPDF_PAGE page; + int current_page; + +- /* Doc has this many pages. ++ /* Doc has this many pages. + */ + int n_pages; + +@@ -162,8 +162,8 @@ typedef struct _VipsForeignLoadPdf { + + typedef VipsForeignLoadClass VipsForeignLoadPdfClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadPdf, vips_foreign_load_pdf, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadPdf, vips_foreign_load_pdf, ++ VIPS_TYPE_FOREIGN_LOAD); + + static char *vips_pdfium_errors[] = { + "no error", +@@ -178,42 +178,41 @@ static char *vips_pdfium_errors[] = { + static GMutex *vips_pdfium_mutex = NULL; + + static void +-vips_pdfium_error( void ) ++vips_pdfium_error(void) + { + int err = FPDF_GetLastError(); + +- if( err >= 0 && +- err < VIPS_NUMBER( vips_pdfium_errors ) ) +- vips_error( "pdfload", "%s", _( vips_pdfium_errors[err] ) ); ++ if (err >= 0 && ++ err < VIPS_NUMBER(vips_pdfium_errors)) ++ vips_error("pdfload", "%s", _(vips_pdfium_errors[err])); + else +- vips_error( "pdfload", "%s", _( "unknown error" ) ); ++ vips_error("pdfload", "%s", _("unknown error")); + } + + static void +-vips_foreign_load_pdf_close( VipsForeignLoadPdf *pdf ) ++vips_foreign_load_pdf_close(VipsForeignLoadPdf *pdf) + { +- g_mutex_lock( vips_pdfium_mutex ); ++ g_mutex_lock(vips_pdfium_mutex); + +- VIPS_FREEF( FPDF_ClosePage, pdf->page ); +- VIPS_FREEF( FPDF_CloseDocument, pdf->doc ); +- VIPS_UNREF( pdf->source ); ++ VIPS_FREEF(FPDF_ClosePage, pdf->page); ++ VIPS_FREEF(FPDF_CloseDocument, pdf->doc); ++ VIPS_UNREF(pdf->source); + +- g_mutex_unlock( vips_pdfium_mutex ); ++ g_mutex_unlock(vips_pdfium_mutex); + } + + static void +-vips_foreign_load_pdf_dispose( GObject *gobject ) ++vips_foreign_load_pdf_dispose(GObject *gobject) + { + VipsForeignLoadPdf *pdf = (VipsForeignLoadPdf *) gobject; + +- vips_foreign_load_pdf_close( pdf ); ++ vips_foreign_load_pdf_close(pdf); + +- G_OBJECT_CLASS( vips_foreign_load_pdf_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_pdf_parent_class)->dispose(gobject); + } + + static void * +-vips_pdfium_init_cb( void *dummy ) ++vips_pdfium_init_cb(void *dummy) + { + FPDF_LIBRARY_CONFIG config; + +@@ -222,145 +221,144 @@ vips_pdfium_init_cb( void *dummy ) + config.m_pIsolate = NULL; + config.m_v8EmbedderSlot = 0; + +- FPDF_InitLibraryWithConfig( &config ); ++ FPDF_InitLibraryWithConfig(&config); + +- return( NULL ); ++ return (NULL); + } + + /* This is the m_GetBlock function for FPDF_FILEACCESS. + */ + static gboolean +-vips_pdfium_GetBlock( void *param, +- unsigned long position, unsigned char *pBuf, unsigned long size ) ++vips_pdfium_GetBlock(void *param, ++ unsigned long position, unsigned char *pBuf, unsigned long size) + { + VipsForeignLoadPdf *pdf = (VipsForeignLoadPdf *) param; + + /* PDFium guarantees these. + */ +- g_assert( size > 0 ); +- g_assert( position >= 0 ); +- g_assert( position + size <= pdf->file_access.m_FileLen ); ++ g_assert(size > 0); ++ g_assert(position >= 0); ++ g_assert(position + size <= pdf->file_access.m_FileLen); + +- if( vips_source_seek( pdf->source, position, SEEK_SET ) < 0 ) +- return( FALSE ); ++ if (vips_source_seek(pdf->source, position, SEEK_SET) < 0) ++ return (FALSE); + +- while( size > 0 ) { ++ while (size > 0) { + gint64 bytes_read; + +- if( (bytes_read = +- vips_source_read( pdf->source, pBuf, size )) < 0 ) +- return( FALSE ); ++ if ((bytes_read = ++ vips_source_read(pdf->source, pBuf, size)) < 0) ++ return (FALSE); + pBuf += bytes_read; + size -= bytes_read; + } + +- return( TRUE ); ++ return (TRUE); + } + + static int +-vips_foreign_load_pdf_build( VipsObject *object ) ++vips_foreign_load_pdf_build(VipsObject *object) + { + static GOnce once = G_ONCE_INIT; + + VipsForeignLoadPdf *pdf = (VipsForeignLoadPdf *) object; +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( pdf ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(pdf); + + gint64 length; + +- VIPS_ONCE( &once, vips_pdfium_init_cb, NULL ); ++ VIPS_ONCE(&once, vips_pdfium_init_cb, NULL); + +- if( !vips_object_argument_isset( object, "scale" ) ) ++ if (!vips_object_argument_isset(object, "scale")) + pdf->scale = pdf->dpi / 72.0; + + /* pdfium must know the file length, unfortunately. + */ +- if( pdf->source ) { +- if( (length = vips_source_length( pdf->source )) <= 0 ) +- return( -1 ); +- if( length > 1 << 30 ) { +- vips_error( class->nickname, +- _( "%s: too large for pdfium" ), +- vips_connection_nick( +- VIPS_CONNECTION( pdf->source ) ) ); +- return( -1 ); ++ if (pdf->source) { ++ if ((length = vips_source_length(pdf->source)) <= 0) ++ return (-1); ++ if (length > 1 << 30) { ++ vips_error(class->nickname, ++ _("%s: too large for pdfium"), ++ vips_connection_nick( ++ VIPS_CONNECTION(pdf->source))); ++ return (-1); + } + pdf->file_access.m_FileLen = length; + pdf->file_access.m_GetBlock = vips_pdfium_GetBlock; + pdf->file_access.m_Param = pdf; + +- g_mutex_lock( vips_pdfium_mutex ); ++ g_mutex_lock(vips_pdfium_mutex); + +- if( !(pdf->doc = FPDF_LoadCustomDocument( &pdf->file_access, +- pdf->password )) ) { +- g_mutex_unlock( vips_pdfium_mutex ); ++ if (!(pdf->doc = FPDF_LoadCustomDocument(&pdf->file_access, ++ pdf->password))) { ++ g_mutex_unlock(vips_pdfium_mutex); + vips_pdfium_error(); +- vips_error( "pdfload", +- _( "%s: unable to load" ), +- vips_connection_nick( +- VIPS_CONNECTION( pdf->source ) ) ); +- return( -1 ); ++ vips_error("pdfload", ++ _("%s: unable to load"), ++ vips_connection_nick( ++ VIPS_CONNECTION(pdf->source))); ++ return (-1); + } + +- g_mutex_unlock( vips_pdfium_mutex ); ++ g_mutex_unlock(vips_pdfium_mutex); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_pdf_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_pdf_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static VipsForeignFlags +-vips_foreign_load_pdf_get_flags_filename( const char *filename ) ++vips_foreign_load_pdf_get_flags_filename(const char *filename) + { + /* We can't render any part of the page on demand, but we can render + * separate pages. Might as well call ourselves partial. + */ +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static VipsForeignFlags +-vips_foreign_load_pdf_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_pdf_get_flags(VipsForeignLoad *load) + { +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static int +-vips_foreign_load_pdf_get_page( VipsForeignLoadPdf *pdf, int page_no ) ++vips_foreign_load_pdf_get_page(VipsForeignLoadPdf *pdf, int page_no) + { +- if( pdf->current_page != page_no ) { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( pdf ); ++ if (pdf->current_page != page_no) { ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(pdf); + +- g_mutex_lock( vips_pdfium_mutex ); ++ g_mutex_lock(vips_pdfium_mutex); + +- VIPS_FREEF( FPDF_ClosePage, pdf->page ); ++ VIPS_FREEF(FPDF_ClosePage, pdf->page); + pdf->current_page = -1; + + #ifdef DEBUG +- printf( "vips_foreign_load_pdf_get_page: %d\n", page_no ); ++ printf("vips_foreign_load_pdf_get_page: %d\n", page_no); + #endif /*DEBUG*/ + +- if( !(pdf->page = FPDF_LoadPage( pdf->doc, page_no )) ) { +- g_mutex_unlock( vips_pdfium_mutex ); ++ if (!(pdf->page = FPDF_LoadPage(pdf->doc, page_no))) { ++ g_mutex_unlock(vips_pdfium_mutex); + vips_pdfium_error(); +- vips_error( class->nickname, +- _( "unable to load page %d" ), page_no ); +- return( -1 ); ++ vips_error(class->nickname, ++ _("unable to load page %d"), page_no); ++ return (-1); + } + pdf->current_page = page_no; + +- g_mutex_unlock( vips_pdfium_mutex ); ++ g_mutex_unlock(vips_pdfium_mutex); + } + +- return( 0 ); ++ return (0); + } + + /* String-based metadata fields we extract. + */ + typedef struct _VipsForeignLoadPdfMetadata { +- char *tag; /* as understood by PDFium */ +- char *field; /* as understood by libvips */ ++ char *tag; /* as understood by PDFium */ ++ char *field; /* as understood by libvips */ + } VipsForeignLoadPdfMetadata; + + static VipsForeignLoadPdfMetadata vips_foreign_load_pdf_metadata[] = { +@@ -372,131 +370,131 @@ static VipsForeignLoadPdfMetadata vips_foreign_load_pdf_metadata[] = { + { "Producer", "pdf-producer" }, + /* poppler has "metadata" as well, but pdfium does not support this */ + }; +-static int n_metadata = VIPS_NUMBER( vips_foreign_load_pdf_metadata ); ++static int n_metadata = VIPS_NUMBER(vips_foreign_load_pdf_metadata); + + static int +-vips_foreign_load_pdf_set_image( VipsForeignLoadPdf *pdf, VipsImage *out ) ++vips_foreign_load_pdf_set_image(VipsForeignLoadPdf *pdf, VipsImage *out) + { + int i; + double res; + + #ifdef DEBUG +- printf( "vips_foreign_load_pdf_set_image: %p\n", pdf ); ++ printf("vips_foreign_load_pdf_set_image: %p\n", pdf); + #endif /*DEBUG*/ + + /* We render to a linecache, so fat strips work well. + */ +- if( vips_image_pipelinev( out, VIPS_DEMAND_STYLE_FATSTRIP, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(out, VIPS_DEMAND_STYLE_FATSTRIP, NULL)) ++ return (-1); + + /* Extract and attach metadata. Set the old name too for compat. + */ +- vips_image_set_int( out, "pdf-n_pages", pdf->n_pages ); +- vips_image_set_int( out, VIPS_META_N_PAGES, pdf->n_pages ); ++ vips_image_set_int(out, "pdf-n_pages", pdf->n_pages); ++ vips_image_set_int(out, VIPS_META_N_PAGES, pdf->n_pages); + +- g_mutex_lock( vips_pdfium_mutex ); ++ g_mutex_lock(vips_pdfium_mutex); + +- for( i = 0; i < n_metadata; i++ ) { +- VipsForeignLoadPdfMetadata *metadata = ++ for (i = 0; i < n_metadata; i++) { ++ VipsForeignLoadPdfMetadata *metadata = + &vips_foreign_load_pdf_metadata[i]; + + char text[1024]; + int len; + +- len = FPDF_GetMetaText( pdf->doc, metadata->tag, text, 1024 ); +- if( len > 0 ) { ++ len = FPDF_GetMetaText(pdf->doc, metadata->tag, text, 1024); ++ if (len > 0) { + char *str; + + /* Silently ignore coding errors. + */ +- if( (str = g_utf16_to_utf8( (gunichar2 *) text, len, +- NULL, NULL, NULL )) ) { +- vips_image_set_string( out, +- metadata->field, str ); +- g_free( str ); ++ if ((str = g_utf16_to_utf8((gunichar2 *) text, len, ++ NULL, NULL, NULL))) { ++ vips_image_set_string(out, ++ metadata->field, str); ++ g_free(str); + } + } + } + +- g_mutex_unlock( vips_pdfium_mutex ); ++ g_mutex_unlock(vips_pdfium_mutex); + + /* We need pixels/mm for vips. + */ + res = pdf->dpi / 25.4; + +- vips_image_init_fields( out, +- pdf->image.width, pdf->image.height, ++ vips_image_init_fields(out, ++ pdf->image.width, pdf->image.height, + 4, VIPS_FORMAT_UCHAR, +- VIPS_CODING_NONE, VIPS_INTERPRETATION_sRGB, res, res ); ++ VIPS_CODING_NONE, VIPS_INTERPRETATION_sRGB, res, res); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_pdf_header( VipsForeignLoad *load ) ++vips_foreign_load_pdf_header(VipsForeignLoad *load) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( load ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(load); + VipsForeignLoadPdf *pdf = (VipsForeignLoadPdf *) load; + + int top; + int i; + + #ifdef DEBUG +- printf( "vips_foreign_load_pdf_header: %p\n", pdf ); ++ printf("vips_foreign_load_pdf_header: %p\n", pdf); + #endif /*DEBUG*/ + +- g_mutex_lock( vips_pdfium_mutex ); +- pdf->n_pages = FPDF_GetPageCount( pdf->doc ); +- g_mutex_unlock( vips_pdfium_mutex ); ++ g_mutex_lock(vips_pdfium_mutex); ++ pdf->n_pages = FPDF_GetPageCount(pdf->doc); ++ g_mutex_unlock(vips_pdfium_mutex); + + /* @n == -1 means until the end of the doc. + */ +- if( pdf->n == -1 ) ++ if (pdf->n == -1) + pdf->n = pdf->n_pages - pdf->page_no; + +- if( pdf->page_no + pdf->n > pdf->n_pages || ++ if (pdf->page_no + pdf->n > pdf->n_pages || + pdf->page_no < 0 || +- pdf->n <= 0 ) { +- vips_error( class->nickname, "%s", _( "pages out of range" ) ); +- return( -1 ); ++ pdf->n <= 0) { ++ vips_error(class->nickname, "%s", _("pages out of range")); ++ return (-1); + } + + /* Lay out the pages in our output image. + */ +- if( !(pdf->pages = VIPS_ARRAY( pdf, pdf->n, VipsRect )) ) +- return( -1 ); ++ if (!(pdf->pages = VIPS_ARRAY(pdf, pdf->n, VipsRect))) ++ return (-1); + + top = 0; + pdf->image.left = 0; + pdf->image.top = 0; + pdf->image.width = 0; + pdf->image.height = 0; +- for( i = 0; i < pdf->n; i++ ) { +- if( vips_foreign_load_pdf_get_page( pdf, pdf->page_no + i ) ) +- return( -1 ); ++ for (i = 0; i < pdf->n; i++) { ++ if (vips_foreign_load_pdf_get_page(pdf, pdf->page_no + i)) ++ return (-1); + pdf->pages[i].left = 0; + pdf->pages[i].top = top; + /* We do round to nearest, in the same way that vips_resize() + * does round to nearest. Without this, things like + * shrink-on-load will break. + */ +- pdf->pages[i].width = VIPS_RINT( +- FPDF_GetPageWidth( pdf->page ) * pdf->scale ); +- pdf->pages[i].height = VIPS_RINT( +- FPDF_GetPageHeight( pdf->page ) * pdf->scale ); ++ pdf->pages[i].width = VIPS_RINT( ++ FPDF_GetPageWidth(pdf->page) * pdf->scale); ++ pdf->pages[i].height = VIPS_RINT( ++ FPDF_GetPageHeight(pdf->page) * pdf->scale); + + /* PDFium allows page width or height to be less than 1 (!!). + */ +- if( pdf->pages[i].width < 1 || ++ if (pdf->pages[i].width < 1 || + pdf->pages[i].height < 1 || + pdf->pages[i].width > VIPS_MAX_COORD || +- pdf->pages[i].height > VIPS_MAX_COORD ) { +- vips_error( class->nickname, +- "%s", _( "page size out of range" ) ); +- return( -1 ); ++ pdf->pages[i].height > VIPS_MAX_COORD) { ++ vips_error(class->nickname, ++ "%s", _("page size out of range")); ++ return (-1); + } + +- if( pdf->pages[i].width > pdf->image.width ) ++ if (pdf->pages[i].width > pdf->image.width) + pdf->image.width = pdf->pages[i].width; + pdf->image.height += pdf->pages[i].height; + +@@ -506,43 +504,43 @@ vips_foreign_load_pdf_header( VipsForeignLoad *load ) + /* If all pages are the same height, we can tag this as a toilet roll + * image. + */ +- for( i = 1; i < pdf->n; i++ ) +- if( pdf->pages[i].height != pdf->pages[0].height ) ++ for (i = 1; i < pdf->n; i++) ++ if (pdf->pages[i].height != pdf->pages[0].height) + break; + + /* Only set page-height if we have more than one page, or this could + * accidentally turn into an animated image later. + */ +- if( pdf->n > 1 ) +- vips_image_set_int( load->out, +- VIPS_META_PAGE_HEIGHT, pdf->pages[0].height ); ++ if (pdf->n > 1) ++ vips_image_set_int(load->out, ++ VIPS_META_PAGE_HEIGHT, pdf->pages[0].height); + +- vips_foreign_load_pdf_set_image( pdf, load->out ); ++ vips_foreign_load_pdf_set_image(pdf, load->out); + + /* Convert the background to the image format. + */ +- if( !(pdf->ink = vips__vector_to_ink( class->nickname, +- load->out, +- VIPS_AREA( pdf->background )->data, NULL, +- VIPS_AREA( pdf->background )->n )) ) +- return( -1 ); +- vips__bgra2rgba( (guint32 *) pdf->ink, 1 ); +- +- return( 0 ); ++ if (!(pdf->ink = vips__vector_to_ink(class->nickname, ++ load->out, ++ VIPS_AREA(pdf->background)->data, NULL, ++ VIPS_AREA(pdf->background)->n))) ++ return (-1); ++ vips__bgra2rgba((guint32 *) pdf->ink, 1); ++ ++ return (0); + } + + static void +-vips_foreign_load_pdf_minimise( VipsObject *object, VipsForeignLoadPdf *pdf ) ++vips_foreign_load_pdf_minimise(VipsObject *object, VipsForeignLoadPdf *pdf) + { +- vips_source_minimise( pdf->source ); ++ vips_source_minimise(pdf->source); + } + + static int +-vips_foreign_load_pdf_generate( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_foreign_load_pdf_generate(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsForeignLoadPdf *pdf = (VipsForeignLoadPdf *) a; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + + int top; + int i; +@@ -550,52 +548,52 @@ vips_foreign_load_pdf_generate( VipsRegion *or, + + /* + printf( "vips_foreign_load_pdf_generate: " +- "left = %d, top = %d, width = %d, height = %d\n", +- r->left, r->top, r->width, r->height ); ++ "left = %d, top = %d, width = %d, height = %d\n", ++ r->left, r->top, r->width, r->height ); + */ + + /* Search through the pages we are drawing for the first containing +- * this rect. This could be quicker, perhaps a binary search, but who ++ * this rect. This could be quicker, perhaps a binary search, but who + * cares. + */ +- for( i = 0; i < pdf->n; i++ ) +- if( VIPS_RECT_BOTTOM( &pdf->pages[i] ) > r->top ) ++ for (i = 0; i < pdf->n; i++) ++ if (VIPS_RECT_BOTTOM(&pdf->pages[i]) > r->top) + break; + +- top = r->top; +- while( top < VIPS_RECT_BOTTOM( r ) ) { ++ top = r->top; ++ while (top < VIPS_RECT_BOTTOM(r)) { + VipsRect rect; + FPDF_BITMAP bitmap; + +- vips_rect_intersectrect( r, &pdf->pages[i], &rect ); ++ vips_rect_intersectrect(r, &pdf->pages[i], &rect); + +- if( vips_foreign_load_pdf_get_page( pdf, pdf->page_no + i ) ) +- return( -1 ); ++ if (vips_foreign_load_pdf_get_page(pdf, pdf->page_no + i)) ++ return (-1); + +- vips__worker_lock( vips_pdfium_mutex ); ++ vips__worker_lock(vips_pdfium_mutex); + + /* 4 means RGBA. + */ +- bitmap = FPDFBitmap_CreateEx( rect.width, rect.height, 4, +- VIPS_REGION_ADDR( or, rect.left, rect.top ), +- VIPS_REGION_LSKIP( or ) ); ++ bitmap = FPDFBitmap_CreateEx(rect.width, rect.height, 4, ++ VIPS_REGION_ADDR(or, rect.left, rect.top), ++ VIPS_REGION_LSKIP(or)); + + /* Only paint the background if there's no transparency. + */ +- if ( !FPDFPage_HasTransparency( pdf->page ) ) { ++ if (!FPDFPage_HasTransparency(pdf->page)) { + FPDF_DWORD ink = *((guint32 *) pdf->ink); + +- FPDFBitmap_FillRect( bitmap, +- 0, 0, rect.width, rect.height, ink ); ++ FPDFBitmap_FillRect(bitmap, ++ 0, 0, rect.width, rect.height, ink); + } + +- FPDF_RenderPageBitmap( bitmap, pdf->page, ++ FPDF_RenderPageBitmap(bitmap, pdf->page, + 0, 0, rect.width, rect.height, +- 0, 0 ); ++ 0, 0); + +- FPDFBitmap_Destroy( bitmap ); ++ FPDFBitmap_Destroy(bitmap); + +- g_mutex_unlock( vips_pdfium_mutex ); ++ g_mutex_unlock(vips_pdfium_mutex); + + top += rect.height; + i += 1; +@@ -603,142 +601,141 @@ vips_foreign_load_pdf_generate( VipsRegion *or, + + /* PDFium writes BGRA, we must swap. + */ +- for( y = 0; y < r->height; y++ ) +- vips__bgra2rgba( +- (guint32 *) VIPS_REGION_ADDR( or, r->left, r->top + y ), +- r->width ); ++ for (y = 0; y < r->height; y++) ++ vips__bgra2rgba( ++ (guint32 *) VIPS_REGION_ADDR(or, r->left, r->top + y), ++ r->width); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_pdf_load( VipsForeignLoad *load ) ++vips_foreign_load_pdf_load(VipsForeignLoad *load) + { + VipsForeignLoadPdf *pdf = (VipsForeignLoadPdf *) load; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( (VipsObject *) load, 2 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array((VipsObject *) load, 2); + + #ifdef DEBUG +- printf( "vips_foreign_load_pdf_load: %p\n", pdf ); ++ printf("vips_foreign_load_pdf_load: %p\n", pdf); + #endif /*DEBUG*/ + + /* Read to this image, then cache to out, see below. + */ +- t[0] = vips_image_new(); ++ t[0] = vips_image_new(); + + /* Close input immediately at end of read. + */ +- g_signal_connect( t[0], "minimise", +- G_CALLBACK( vips_foreign_load_pdf_minimise ), pdf ); ++ g_signal_connect(t[0], "minimise", ++ G_CALLBACK(vips_foreign_load_pdf_minimise), pdf); + +- vips_foreign_load_pdf_set_image( pdf, t[0] ); +- if( vips_image_generate( t[0], +- NULL, vips_foreign_load_pdf_generate, NULL, pdf, NULL ) ) +- return( -1 ); ++ vips_foreign_load_pdf_set_image(pdf, t[0]); ++ if (vips_image_generate(t[0], ++ NULL, vips_foreign_load_pdf_generate, NULL, pdf, NULL)) ++ return (-1); + + /* PDFium does not like rendering parts of pages :-( always render +- * complete pages. ++ * complete pages. + */ +- if( vips_tilecache( t[0], &t[1], +- "tile_width", pdf->pages[0].width, +- "tile_height", pdf->pages[0].height, +- "max_tiles", 1, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( t[1], load->real ) ) +- return( -1 ); +- +- return( 0 ); ++ if (vips_tilecache(t[0], &t[1], ++ "tile_width", pdf->pages[0].width, ++ "tile_height", pdf->pages[0].height, ++ "max_tiles", 1, ++ NULL)) ++ return (-1); ++ if (vips_image_write(t[1], load->real)) ++ return (-1); ++ ++ return (0); + } + + static void * +-vips_foreign_load_pdf_once_init( void *client ) ++vips_foreign_load_pdf_once_init(void *client) + { + /* We must make the mutex on class init (not _build) since we + * can lock ebven if build is not called. + */ + vips_pdfium_mutex = vips_g_mutex_new(); + +- return( NULL ); ++ return (NULL); + } + + static void +-vips_foreign_load_pdf_class_init( VipsForeignLoadPdfClass *class ) ++vips_foreign_load_pdf_class_init(VipsForeignLoadPdfClass *class) + { + static GOnce once = G_ONCE_INIT; + +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +- VIPS_ONCE( &once, vips_foreign_load_pdf_once_init, NULL ); ++ VIPS_ONCE(&once, vips_foreign_load_pdf_once_init, NULL); + + gobject_class->dispose = vips_foreign_load_pdf_dispose; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pdfload_base"; +- object_class->description = _( "load PDF with PDFium" ); ++ object_class->description = _("load PDF with PDFium"); + object_class->build = vips_foreign_load_pdf_build; + +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_pdf_get_flags_filename; + load_class->get_flags = vips_foreign_load_pdf_get_flags; + load_class->header = vips_foreign_load_pdf_header; + load_class->load = vips_foreign_load_pdf_load; + +- VIPS_ARG_INT( class, "page", 10, +- _( "Page" ), +- _( "First page to load" ), ++ VIPS_ARG_INT(class, "page", 10, ++ _("Page"), ++ _("First page to load"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdf, page_no ), +- 0, 100000, 0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadPdf, page_no), ++ 0, 100000, 0); + +- VIPS_ARG_INT( class, "n", 11, +- _( "n" ), +- _( "Number of pages to load, -1 for all" ), ++ VIPS_ARG_INT(class, "n", 11, ++ _("n"), ++ _("Number of pages to load, -1 for all"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdf, n ), +- -1, 100000, 1 ); ++ G_STRUCT_OFFSET(VipsForeignLoadPdf, n), ++ -1, 100000, 1); + +- VIPS_ARG_DOUBLE( class, "dpi", 12, +- _( "DPI" ), +- _( "DPI to render at" ), ++ VIPS_ARG_DOUBLE(class, "dpi", 12, ++ _("DPI"), ++ _("DPI to render at"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdf, dpi ), +- 0.001, 100000.0, 72.0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadPdf, dpi), ++ 0.001, 100000.0, 72.0); + +- VIPS_ARG_DOUBLE( class, "scale", 13, +- _( "Scale" ), +- _( "Factor to scale by" ), ++ VIPS_ARG_DOUBLE(class, "scale", 13, ++ _("Scale"), ++ _("Factor to scale by"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdf, scale ), +- 0.001, 100000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadPdf, scale), ++ 0.001, 100000.0, 1.0); + +- VIPS_ARG_BOXED( class, "background", 14, +- _( "Background" ), +- _( "Background colour" ), ++ VIPS_ARG_BOXED(class, "background", 14, ++ _("Background"), ++ _("Background colour"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdf, background ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsForeignLoadPdf, background), ++ VIPS_TYPE_ARRAY_DOUBLE); + +- VIPS_ARG_STRING( class, "password", 25, +- _( "Password" ), +- _( "Password to decrypt with" ), ++ VIPS_ARG_STRING(class, "password", 25, ++ _("Password"), ++ _("Password to decrypt with"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdf, password ), +- NULL ); +- ++ G_STRUCT_OFFSET(VipsForeignLoadPdf, password), ++ NULL); + } + + static void +-vips_foreign_load_pdf_init( VipsForeignLoadPdf *pdf ) ++vips_foreign_load_pdf_init(VipsForeignLoadPdf *pdf) + { + pdf->dpi = 72.0; + pdf->scale = 1.0; + pdf->n = 1; + pdf->current_page = -1; +- pdf->background = vips_array_double_newv( 1, 255.0 ); ++ pdf->background = vips_array_double_newv(1, 255.0); + } + + typedef struct _VipsForeignLoadPdfFile { +@@ -746,24 +743,25 @@ typedef struct _VipsForeignLoadPdfFile { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadPdfFile; + + typedef VipsForeignLoadPdfClass VipsForeignLoadPdfFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadPdfFile, vips_foreign_load_pdf_file, +- vips_foreign_load_pdf_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadPdfFile, vips_foreign_load_pdf_file, ++ vips_foreign_load_pdf_get_type()); + + static int +-vips_foreign_load_pdf_file_header( VipsForeignLoad *load ) ++vips_foreign_load_pdf_file_header(VipsForeignLoad *load) + { + VipsForeignLoadPdfFile *file = (VipsForeignLoadPdfFile *) load; + +- VIPS_SETSTR( load->out->filename, file->filename ); ++ VIPS_SETSTR(load->out->filename, file->filename); + +- return( VIPS_FOREIGN_LOAD_CLASS( +- vips_foreign_load_pdf_file_parent_class )->header( load ) ); ++ return (VIPS_FOREIGN_LOAD_CLASS( ++ vips_foreign_load_pdf_file_parent_class) ++ ->header(load)); + } + + static const char *vips_foreign_pdf_suffs[] = { +@@ -772,55 +770,54 @@ static const char *vips_foreign_pdf_suffs[] = { + }; + + static int +-vips_foreign_load_pdf_file_build( VipsObject *object ) ++vips_foreign_load_pdf_file_build(VipsObject *object) + { + VipsForeignLoadPdf *pdf = (VipsForeignLoadPdf *) object; + VipsForeignLoadPdfFile *file = (VipsForeignLoadPdfFile *) pdf; + + #ifdef DEBUG +- printf( "vips_foreign_load_pdf_file_build: %s\n", file->filename ); ++ printf("vips_foreign_load_pdf_file_build: %s\n", file->filename); + #endif /*DEBUG*/ + +- if( file->filename && +- !(pdf->source = vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(pdf->source = vips_source_new_from_file(file->filename))) ++ return (-1); + +- return( VIPS_OBJECT_CLASS( vips_foreign_load_pdf_file_parent_class )-> +- build( object ) ); ++ return (VIPS_OBJECT_CLASS(vips_foreign_load_pdf_file_parent_class)->build(object)); + } + + static gboolean +-vips_foreign_load_pdf_is_a_buffer( const void *buf, size_t len ) ++vips_foreign_load_pdf_is_a_buffer(const void *buf, size_t len) + { + const guchar *str = (const guchar *) buf; + +- if( len >= 4 && +- str[0] == '%' && ++ if (len >= 4 && ++ str[0] == '%' && + str[1] == 'P' && + str[2] == 'D' && +- str[3] == 'F' ) +- return( 1 ); ++ str[3] == 'F') ++ return (1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_pdf_is_a( const char *filename ) ++vips_foreign_load_pdf_is_a(const char *filename) + { + unsigned char buf[4]; + +- if( vips__get_bytes( filename, buf, 4 ) == 4 && +- vips_foreign_load_pdf_is_a_buffer( buf, 4 ) ) +- return( 1 ); ++ if (vips__get_bytes(filename, buf, 4) == 4 && ++ vips_foreign_load_pdf_is_a_buffer(buf, 4)) ++ return (1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_pdf_file_class_init( +- VipsForeignLoadPdfFileClass *class ) ++vips_foreign_load_pdf_file_class_init( ++ VipsForeignLoadPdfFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -829,7 +826,7 @@ vips_foreign_load_pdf_file_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pdfload"; +- object_class->description = _( "load PDF from file" ); ++ object_class->description = _("load PDF from file"); + object_class->build = vips_foreign_load_pdf_file_build; + + foreign_class->suffs = vips_foreign_pdf_suffs; +@@ -837,17 +834,16 @@ vips_foreign_load_pdf_file_class_init( + load_class->is_a = vips_foreign_load_pdf_is_a; + load_class->header = vips_foreign_load_pdf_file_header; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdfFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadPdfFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_pdf_file_init( VipsForeignLoadPdfFile *file ) ++vips_foreign_load_pdf_file_init(VipsForeignLoadPdfFile *file) + { + } + +@@ -862,30 +858,29 @@ typedef struct _VipsForeignLoadPdfBuffer { + + typedef VipsForeignLoadPdfClass VipsForeignLoadPdfBufferClass; + +-G_DEFINE_TYPE( VipsForeignLoadPdfBuffer, vips_foreign_load_pdf_buffer, +- vips_foreign_load_pdf_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadPdfBuffer, vips_foreign_load_pdf_buffer, ++ vips_foreign_load_pdf_get_type()); + + static int +-vips_foreign_load_pdf_buffer_build( VipsObject *object ) ++vips_foreign_load_pdf_buffer_build(VipsObject *object) + { + VipsForeignLoadPdf *pdf = (VipsForeignLoadPdf *) object; + VipsForeignLoadPdfBuffer *buffer = (VipsForeignLoadPdfBuffer *) pdf; + +- if( buffer->buf && +- !(pdf->source = vips_source_new_from_memory( +- VIPS_AREA( buffer->buf )->data, +- VIPS_AREA( buffer->buf )->length )) ) +- return( -1 ); ++ if (buffer->buf && ++ !(pdf->source = vips_source_new_from_memory( ++ VIPS_AREA(buffer->buf)->data, ++ VIPS_AREA(buffer->buf)->length))) ++ return (-1); + +- return( VIPS_OBJECT_CLASS( vips_foreign_load_pdf_buffer_parent_class )-> +- build( object ) ); ++ return (VIPS_OBJECT_CLASS(vips_foreign_load_pdf_buffer_parent_class)->build(object)); + } + + static void +-vips_foreign_load_pdf_buffer_class_init( +- VipsForeignLoadPdfBufferClass *class ) ++vips_foreign_load_pdf_buffer_class_init( ++ VipsForeignLoadPdfBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -893,22 +888,21 @@ vips_foreign_load_pdf_buffer_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pdfload_buffer"; +- object_class->description = _( "load PDF from buffer" ); ++ object_class->description = _("load PDF from buffer"); + object_class->build = vips_foreign_load_pdf_buffer_build; + + load_class->is_a_buffer = vips_foreign_load_pdf_is_a_buffer; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdfBuffer, buf ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadPdfBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_load_pdf_buffer_init( VipsForeignLoadPdfBuffer *buffer ) ++vips_foreign_load_pdf_buffer_init(VipsForeignLoadPdfBuffer *buffer) + { + } + +@@ -921,67 +915,65 @@ typedef struct _VipsForeignLoadPdfSource { + + typedef VipsForeignLoadPdfClass VipsForeignLoadPdfSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadPdfSource, vips_foreign_load_pdf_source, +- vips_foreign_load_pdf_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadPdfSource, vips_foreign_load_pdf_source, ++ vips_foreign_load_pdf_get_type()); + + static int +-vips_foreign_load_pdf_source_build( VipsObject *object ) ++vips_foreign_load_pdf_source_build(VipsObject *object) + { + VipsForeignLoadPdf *pdf = (VipsForeignLoadPdf *) object; + VipsForeignLoadPdfSource *source = (VipsForeignLoadPdfSource *) pdf; + +- if( source->source ) { ++ if (source->source) { + pdf->source = source->source; +- g_object_ref( pdf->source ); ++ g_object_ref(pdf->source); + } + +- return( VIPS_OBJECT_CLASS( vips_foreign_load_pdf_source_parent_class )-> +- build( object ) ); ++ return (VIPS_OBJECT_CLASS(vips_foreign_load_pdf_source_parent_class)->build(object)); + } + + static gboolean +-vips_foreign_load_pdf_source_is_a_source( VipsSource *source ) ++vips_foreign_load_pdf_source_is_a_source(VipsSource *source) + { + const unsigned char *p; + +- return( (p = vips_source_sniff( source, 4 )) && +- p[0] == '%' && ++ return ((p = vips_source_sniff(source, 4)) && ++ p[0] == '%' && + p[1] == 'P' && + p[2] == 'D' && +- p[3] == 'F' ); ++ p[3] == 'F'); + } + + static void +-vips_foreign_load_pdf_source_class_init( +- VipsForeignLoadPdfSourceClass *class ) ++vips_foreign_load_pdf_source_class_init( ++ VipsForeignLoadPdfSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pdfload_source"; +- object_class->description = _( "load PDF from source" ); ++ object_class->description = _("load PDF from source"); + object_class->build = vips_foreign_load_pdf_source_build; + + operation_class->flags |= VIPS_OPERATION_NOCACHE; + + load_class->is_a_source = vips_foreign_load_pdf_source_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdfSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadPdfSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_pdf_source_init( VipsForeignLoadPdfSource *source ) ++vips_foreign_load_pdf_source_init(VipsForeignLoadPdfSource *source) + { + } + +diff --git a/libvips/foreign/pforeign.h b/libvips/foreign/pforeign.h +index 3182b35ba4..0cb63a02ea 100644 +--- a/libvips/foreign/pforeign.h ++++ b/libvips/foreign/pforeign.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -37,22 +37,19 @@ extern "C" { + + /* Slow and horrid version if there's no recent glib. + */ +-#if !GLIB_CHECK_VERSION( 2, 48, 0 ) +-#define g_uint_checked_mul( dest, a, b ) ( \ +- ((guint64) a * b) > UINT_MAX ? \ +- (*dest = UINT_MAX, FALSE) : \ +- (*dest = a * b, TRUE) \ +-) ++#if !GLIB_CHECK_VERSION(2, 48, 0) ++#define g_uint_checked_mul(dest, a, b) ( \ ++ ((guint64) a * b) > UINT_MAX ? (*dest = UINT_MAX, FALSE) : (*dest = a * b, TRUE)) + #endif /*!GLIB_CHECK_VERSION( 2, 48, 0 )*/ + + /* We've seen real images with 28 chunks, so set 50. + */ + #define MAX_PNG_TEXT_CHUNKS 50 + +-void vips__tiff_init( void ); ++void vips__tiff_init(void); + +-int vips__tiff_write_target( VipsImage *in, VipsTarget *target, +- VipsForeignTiffCompression compression, int Q, ++int vips__tiff_write_target(VipsImage *in, VipsTarget *target, ++ VipsForeignTiffCompression compression, int Q, + VipsForeignTiffPredictor predictor, + const char *profile, + gboolean tile, int tile_width, int tile_height, +@@ -65,66 +62,66 @@ int vips__tiff_write_target( VipsImage *in, VipsTarget *target, + gboolean properties, + gboolean strip, + VipsRegionShrink region_shrink, +- int level, ++ int level, + gboolean lossless, + VipsForeignDzDepth depth, +- gboolean subifd, ++ gboolean subifd, + gboolean premultiply, +- int page_height ); ++ int page_height); + +-gboolean vips__istiff_source( VipsSource *source ); +-gboolean vips__istifftiled_source( VipsSource *source ); +-int vips__tiff_read_header_source( VipsSource *source, VipsImage *out, +- int page, int n, gboolean autorotate, int subifd, VipsFailOn fail_on ); +-int vips__tiff_read_source( VipsSource *source, VipsImage *out, +- int page, int n, gboolean autorotate, int subifd, VipsFailOn fail_on ); ++gboolean vips__istiff_source(VipsSource *source); ++gboolean vips__istifftiled_source(VipsSource *source); ++int vips__tiff_read_header_source(VipsSource *source, VipsImage *out, ++ int page, int n, gboolean autorotate, int subifd, VipsFailOn fail_on); ++int vips__tiff_read_source(VipsSource *source, VipsImage *out, ++ int page, int n, gboolean autorotate, int subifd, VipsFailOn fail_on); + + extern const char *vips__foreign_tiff_suffs[]; + +-int vips__isanalyze( const char *filename ); +-int vips__analyze_read_header( const char *filename, VipsImage *out ); +-int vips__analyze_read( const char *filename, VipsImage *out ); ++int vips__isanalyze(const char *filename); ++int vips__analyze_read_header(const char *filename, VipsImage *out); ++int vips__analyze_read(const char *filename, VipsImage *out); + + extern const char *vips__foreign_csv_suffs[]; + +-int vips__matrix_read_header( const char *filename, +- int *width, int *height, double *scale, double *offset ); +-int vips__matrix_ismatrix( const char *filename ); +-VipsImage *vips__matrix_read_file( FILE *fp ); +-VipsImage *vips__matrix_read( const char *filename ); +-int vips__matrix_write( VipsImage *in, const char *filename ); +-int vips__matrix_write_file( VipsImage *in, FILE *fp ); ++int vips__matrix_read_header(const char *filename, ++ int *width, int *height, double *scale, double *offset); ++int vips__matrix_ismatrix(const char *filename); ++VipsImage *vips__matrix_read_file(FILE *fp); ++VipsImage *vips__matrix_read(const char *filename); ++int vips__matrix_write(VipsImage *in, const char *filename); ++int vips__matrix_write_file(VipsImage *in, FILE *fp); + + extern const char *vips__foreign_matrix_suffs[]; + +-int vips__openexr_isexr( const char *filename ); +-gboolean vips__openexr_istiled( const char *filename ); +-int vips__openexr_read_header( const char *filename, VipsImage *out ); +-int vips__openexr_read( const char *filename, VipsImage *out ); ++int vips__openexr_isexr(const char *filename); ++gboolean vips__openexr_istiled(const char *filename); ++int vips__openexr_read_header(const char *filename, VipsImage *out); ++int vips__openexr_read(const char *filename, VipsImage *out); + + extern const char *vips__fits_suffs[]; + +-int vips__fits_isfits( const char *filename ); +-int vips__fits_read_header( const char *filename, VipsImage *out ); +-int vips__fits_read( const char *filename, VipsImage *out ); ++int vips__fits_isfits(const char *filename); ++int vips__fits_read_header(const char *filename, VipsImage *out); ++int vips__fits_read(const char *filename, VipsImage *out); + +-int vips__fits_write( VipsImage *in, const char *filename ); ++int vips__fits_write(VipsImage *in, const char *filename); + +-int vips__magick_read( const char *filename, +- VipsImage *out, const char *density, int page, int n ); +-int vips__magick_read_header( const char *filename, +- VipsImage *out, const char *density, int page, int n ); ++int vips__magick_read(const char *filename, ++ VipsImage *out, const char *density, int page, int n); ++int vips__magick_read_header(const char *filename, ++ VipsImage *out, const char *density, int page, int n); + +-int vips__magick_read_buffer( const void *buf, const size_t len, +- VipsImage *out, const char *density, int page, int n ); +-int vips__magick_read_buffer_header( const void *buf, const size_t len, +- VipsImage *out, const char *density, int page, int n ); ++int vips__magick_read_buffer(const void *buf, const size_t len, ++ VipsImage *out, const char *density, int page, int n); ++int vips__magick_read_buffer_header(const void *buf, const size_t len, ++ VipsImage *out, const char *density, int page, int n); + + extern const char *vips__mat_suffs[]; + +-int vips__mat_load( const char *filename, VipsImage *out ); +-int vips__mat_header( const char *filename, VipsImage *out ); +-int vips__mat_ismat( const char *filename ); ++int vips__mat_load(const char *filename, VipsImage *out); ++int vips__mat_header(const char *filename, VipsImage *out); ++int vips__mat_ismat(const char *filename); + + extern const char *vips__ppm_suffs[]; + extern const char *vips__save_pbm_suffs[]; +@@ -133,43 +130,43 @@ extern const char *vips__save_ppm_suffs[]; + extern const char *vips__save_pfm_suffs[]; + extern const char *vips__save_pnm_suffs[]; + +-int vips__ppm_save_target( VipsImage *in, VipsTarget *target, +- gboolean ascii, gboolean squash ); +-int vips__rad_israd( VipsSource *source ); +-int vips__rad_header( VipsSource *source, VipsImage *out ); +-int vips__rad_load( VipsSource *source, VipsImage *out ); ++int vips__ppm_save_target(VipsImage *in, VipsTarget *target, ++ gboolean ascii, gboolean squash); ++int vips__rad_israd(VipsSource *source); ++int vips__rad_header(VipsSource *source, VipsImage *out); ++int vips__rad_load(VipsSource *source, VipsImage *out); + +-int vips__rad_save( VipsImage *in, VipsTarget *target ); ++int vips__rad_save(VipsImage *in, VipsTarget *target); + + extern const char *vips__rad_suffs[]; + + extern const char *vips__jpeg_suffs[]; + +-int vips__jpeg_write_target( VipsImage *in, VipsTarget *target, +- int Q, const char *profile, ++int vips__jpeg_write_target(VipsImage *in, VipsTarget *target, ++ int Q, const char *profile, + gboolean optimize_coding, gboolean progressive, gboolean strip, + gboolean trellis_quant, gboolean overshoot_deringing, + gboolean optimize_scans, int quant_table, +- VipsForeignSubsample subsample_mode, int restart_interval ); +- +-int vips__jpeg_read_source( VipsSource *source, VipsImage *out, +- gboolean header_only, int shrink, VipsFailOn fail_on, +- gboolean autorotate, gboolean unlimited ); +-int vips__isjpeg_source( VipsSource *source ); +- +-int vips__png_ispng_source( VipsSource *source ); +-int vips__png_header_source( VipsSource *source, VipsImage *out, +- gboolean unlimited ); +-int vips__png_read_source( VipsSource *source, VipsImage *out, +- VipsFailOn fail_on, gboolean unlimited ); +-gboolean vips__png_isinterlaced_source( VipsSource *source ); ++ VipsForeignSubsample subsample_mode, int restart_interval); ++ ++int vips__jpeg_read_source(VipsSource *source, VipsImage *out, ++ gboolean header_only, int shrink, VipsFailOn fail_on, ++ gboolean autorotate, gboolean unlimited); ++int vips__isjpeg_source(VipsSource *source); ++ ++int vips__png_ispng_source(VipsSource *source); ++int vips__png_header_source(VipsSource *source, VipsImage *out, ++ gboolean unlimited); ++int vips__png_read_source(VipsSource *source, VipsImage *out, ++ VipsFailOn fail_on, gboolean unlimited); ++gboolean vips__png_isinterlaced_source(VipsSource *source); + extern const char *vips__png_suffs[]; + +-int vips__png_write_target( VipsImage *in, VipsTarget *target, ++int vips__png_write_target(VipsImage *in, VipsTarget *target, + int compress, int interlace, const char *profile, + VipsForeignPngFilter filter, gboolean strip, + gboolean palette, int Q, double dither, +- int bitdepth, int effort ); ++ int bitdepth, int effort); + + /* Map WEBP metadata names to vips names. + */ +@@ -183,36 +180,36 @@ extern const VipsWebPNames vips__webp_names[]; + extern const int vips__n_webp_names; + extern const char *vips__webp_suffs[]; + +-int vips__iswebp_source( VipsSource *source ); ++int vips__iswebp_source(VipsSource *source); + +-int vips__webp_read_header_source( VipsSource *source, VipsImage *out, +- int page, int n, double scale ); +-int vips__webp_read_source( VipsSource *source, VipsImage *out, +- int page, int n, double scale ); ++int vips__webp_read_header_source(VipsSource *source, VipsImage *out, ++ int page, int n, double scale); ++int vips__webp_read_source(VipsSource *source, VipsImage *out, ++ int page, int n, double scale); + + extern const char *vips_foreign_nifti_suffs[]; + +-VipsBandFormat vips__foreign_nifti_datatype2BandFmt( int datatype ); +-int vips__foreign_nifti_BandFmt2datatype( VipsBandFormat fmt ); ++VipsBandFormat vips__foreign_nifti_datatype2BandFmt(int datatype); ++int vips__foreign_nifti_BandFmt2datatype(VipsBandFormat fmt); + +-typedef void *(*VipsNiftiMapFn)( const char *name, GValue *value, glong offset, +- void *a, void *b ); +-void *vips__foreign_nifti_map( VipsNiftiMapFn fn, void *a, void *b ); ++typedef void *(*VipsNiftiMapFn)(const char *name, GValue *value, glong offset, ++ void *a, void *b); ++void *vips__foreign_nifti_map(VipsNiftiMapFn fn, void *a, void *b); + + extern const char *vips__heic_suffs[]; + extern const char *vips__avif_suffs[]; + extern const char *vips__heif_suffs[]; +-int vips__heif_chroma( int bits_per_pixel, gboolean has_alpha ); ++int vips__heif_chroma(int bits_per_pixel, gboolean has_alpha); + + extern const char *vips__jp2k_suffs[]; +-int vips__foreign_load_jp2k_decompress( VipsImage *out, ++int vips__foreign_load_jp2k_decompress(VipsImage *out, + int width, int height, gboolean ycc_to_rgb, + void *from, size_t from_length, +- void *to, size_t to_length ); +-int vips__foreign_load_jp2k_compress( VipsRegion *region, ++ void *to, size_t to_length); ++int vips__foreign_load_jp2k_compress(VipsRegion *region, + VipsRect *tile, VipsTarget *target, + int tile_width, int tile_height, +- gboolean save_as_ycc, gboolean subsample, gboolean lossless, int Q ); ++ gboolean save_as_ycc, gboolean subsample, gboolean lossless, int Q); + + extern const char *vips__jxl_suffs[]; + +diff --git a/libvips/foreign/pngload.c b/libvips/foreign/pngload.c +index af000f839e..3b3904c0f9 100644 +--- a/libvips/foreign/pngload.c ++++ b/libvips/foreign/pngload.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -69,83 +69,82 @@ typedef struct _VipsForeignLoadPng { + + typedef VipsForeignLoadClass VipsForeignLoadPngClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadPng, vips_foreign_load_png, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadPng, vips_foreign_load_png, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_png_dispose( GObject *gobject ) ++vips_foreign_load_png_dispose(GObject *gobject) + { + VipsForeignLoadPng *png = (VipsForeignLoadPng *) gobject; + +- VIPS_UNREF( png->source ); ++ VIPS_UNREF(png->source); + +- G_OBJECT_CLASS( vips_foreign_load_png_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_png_parent_class)->dispose(gobject); + } + + static VipsForeignFlags +-vips_foreign_load_png_get_flags_source( VipsSource *source ) ++vips_foreign_load_png_get_flags_source(VipsSource *source) + { + VipsForeignFlags flags; + + flags = 0; +- if( vips__png_isinterlaced_source( source ) ) ++ if (vips__png_isinterlaced_source(source)) + flags |= VIPS_FOREIGN_PARTIAL; + else + flags |= VIPS_FOREIGN_SEQUENTIAL; + +- return( flags ); ++ return (flags); + } + + static VipsForeignFlags +-vips_foreign_load_png_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_png_get_flags(VipsForeignLoad *load) + { + VipsForeignLoadPng *png = (VipsForeignLoadPng *) load; + +- return( vips_foreign_load_png_get_flags_source( png->source ) ); ++ return (vips_foreign_load_png_get_flags_source(png->source)); + } + + static VipsForeignFlags +-vips_foreign_load_png_get_flags_filename( const char *filename ) ++vips_foreign_load_png_get_flags_filename(const char *filename) + { + VipsSource *source; + VipsForeignFlags flags; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( 0 ); +- flags = vips_foreign_load_png_get_flags_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (0); ++ flags = vips_foreign_load_png_get_flags_source(source); ++ VIPS_UNREF(source); + +- return( flags ); ++ return (flags); + } + + static int +-vips_foreign_load_png_header( VipsForeignLoad *load ) ++vips_foreign_load_png_header(VipsForeignLoad *load) + { + VipsForeignLoadPng *png = (VipsForeignLoadPng *) load; + +- if( vips__png_header_source( png->source, load->out, png->unlimited ) ) +- return( -1 ); ++ if (vips__png_header_source(png->source, load->out, png->unlimited)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_png_load( VipsForeignLoad *load ) ++vips_foreign_load_png_load(VipsForeignLoad *load) + { + VipsForeignLoadPng *png = (VipsForeignLoadPng *) load; + +- if( vips__png_read_source( png->source, load->real, +- load->fail_on, png->unlimited ) ) +- return( -1 ); ++ if (vips__png_read_source(png->source, load->real, ++ load->fail_on, png->unlimited)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_png_class_init( VipsForeignLoadPngClass *class ) ++vips_foreign_load_png_class_init(VipsForeignLoadPngClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -155,28 +154,28 @@ vips_foreign_load_png_class_init( VipsForeignLoadPngClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pngload_base"; +- object_class->description = _( "load png base class" ); ++ object_class->description = _("load png base class"); + + /* We are fast at is_a(), so high priority. + */ + foreign_class->priority = 200; + +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_png_get_flags_filename; + load_class->get_flags = vips_foreign_load_png_get_flags; + load_class->header = vips_foreign_load_png_header; + load_class->load = vips_foreign_load_png_load; + +- VIPS_ARG_BOOL( class, "unlimited", 23, +- _( "Unlimited" ), +- _( "Remove all denial of service limits" ), ++ VIPS_ARG_BOOL(class, "unlimited", 23, ++ _("Unlimited"), ++ _("Remove all denial of service limits"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPng, unlimited ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignLoadPng, unlimited), ++ FALSE); + } + + static void +-vips_foreign_load_png_init( VipsForeignLoadPng *png ) ++vips_foreign_load_png_init(VipsForeignLoadPng *png) + { + } + +@@ -191,63 +190,61 @@ typedef struct _VipsForeignLoadPngSource { + + typedef VipsForeignLoadPngClass VipsForeignLoadPngSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadPngSource, vips_foreign_load_png_source, +- vips_foreign_load_png_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadPngSource, vips_foreign_load_png_source, ++ vips_foreign_load_png_get_type()); + + static int +-vips_foreign_load_png_source_build( VipsObject *object ) ++vips_foreign_load_png_source_build(VipsObject *object) + { + VipsForeignLoadPng *png = (VipsForeignLoadPng *) object; + VipsForeignLoadPngSource *source = (VipsForeignLoadPngSource *) object; + +- if( source->source ) { ++ if (source->source) { + png->source = source->source; +- g_object_ref( png->source ); ++ g_object_ref(png->source); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_png_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_png_source_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_png_source_is_a_source( VipsSource *source ) ++vips_foreign_load_png_source_is_a_source(VipsSource *source) + { +- return( vips__png_ispng_source( source ) ); ++ return (vips__png_ispng_source(source)); + } + + static void +-vips_foreign_load_png_source_class_init( VipsForeignLoadPngSourceClass *class ) ++vips_foreign_load_png_source_class_init(VipsForeignLoadPngSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pngload_source"; +- object_class->description = _( "load png from source" ); ++ object_class->description = _("load png from source"); + object_class->build = vips_foreign_load_png_source_build; + + operation_class->flags |= VIPS_OPERATION_NOCACHE; + + load_class->is_a_source = vips_foreign_load_png_source_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPngSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadPngSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_png_source_init( VipsForeignLoadPngSource *source ) ++vips_foreign_load_png_source_init(VipsForeignLoadPngSource *source) + { + } + +@@ -256,50 +253,49 @@ typedef struct _VipsForeignLoadPngFile { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadPngFile; + + typedef VipsForeignLoadPngClass VipsForeignLoadPngFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadPngFile, vips_foreign_load_png_file, +- vips_foreign_load_png_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadPngFile, vips_foreign_load_png_file, ++ vips_foreign_load_png_get_type()); + + static int +-vips_foreign_load_png_file_build( VipsObject *object ) ++vips_foreign_load_png_file_build(VipsObject *object) + { + VipsForeignLoadPng *png = (VipsForeignLoadPng *) object; + VipsForeignLoadPngFile *file = (VipsForeignLoadPngFile *) object; + +- if( file->filename && +- !(png->source = vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(png->source = vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_png_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_png_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_png_file_is_a( const char *filename ) ++vips_foreign_load_png_file_is_a(const char *filename) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( FALSE ); +- result = vips_foreign_load_png_source_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (FALSE); ++ result = vips_foreign_load_png_source_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static void +-vips_foreign_load_png_file_class_init( VipsForeignLoadPngFileClass *class ) ++vips_foreign_load_png_file_class_init(VipsForeignLoadPngFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -308,23 +304,23 @@ vips_foreign_load_png_file_class_init( VipsForeignLoadPngFileClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pngload"; +- object_class->description = _( "load png from file" ); ++ object_class->description = _("load png from file"); + object_class->build = vips_foreign_load_png_file_build; + + foreign_class->suffs = vips__png_suffs; + + load_class->is_a = vips_foreign_load_png_file_is_a; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPngFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadPngFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_png_file_init( VipsForeignLoadPngFile *file ) ++vips_foreign_load_png_file_init(VipsForeignLoadPngFile *file) + { + } + +@@ -339,46 +335,45 @@ typedef struct _VipsForeignLoadPngBuffer { + + typedef VipsForeignLoadPngClass VipsForeignLoadPngBufferClass; + +-G_DEFINE_TYPE( VipsForeignLoadPngBuffer, vips_foreign_load_png_buffer, +- vips_foreign_load_png_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadPngBuffer, vips_foreign_load_png_buffer, ++ vips_foreign_load_png_get_type()); + + static int +-vips_foreign_load_png_buffer_build( VipsObject *object ) ++vips_foreign_load_png_buffer_build(VipsObject *object) + { + VipsForeignLoadPng *png = (VipsForeignLoadPng *) object; + VipsForeignLoadPngBuffer *buffer = (VipsForeignLoadPngBuffer *) object; + +- if( buffer->blob && +- !(png->source = vips_source_new_from_memory( +- VIPS_AREA( buffer->blob )->data, +- VIPS_AREA( buffer->blob )->length )) ) +- return( -1 ); ++ if (buffer->blob && ++ !(png->source = vips_source_new_from_memory( ++ VIPS_AREA(buffer->blob)->data, ++ VIPS_AREA(buffer->blob)->length))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_png_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_png_buffer_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_png_buffer_is_a_buffer( const void *buf, size_t len ) ++vips_foreign_load_png_buffer_is_a_buffer(const void *buf, size_t len) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_memory( buf, len )) ) +- return( FALSE ); +- result = vips_foreign_load_png_source_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_memory(buf, len))) ++ return (FALSE); ++ result = vips_foreign_load_png_source_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static void +-vips_foreign_load_png_buffer_class_init( VipsForeignLoadPngBufferClass *class ) ++vips_foreign_load_png_buffer_class_init(VipsForeignLoadPngBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -386,22 +381,21 @@ vips_foreign_load_png_buffer_class_init( VipsForeignLoadPngBufferClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pngload_buffer"; +- object_class->description = _( "load png from buffer" ); ++ object_class->description = _("load png from buffer"); + object_class->build = vips_foreign_load_png_buffer_build; + + load_class->is_a_buffer = vips_foreign_load_png_buffer_is_a_buffer; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPngBuffer, blob ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadPngBuffer, blob), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_load_png_buffer_init( VipsForeignLoadPngBuffer *buffer ) ++vips_foreign_load_png_buffer_init(VipsForeignLoadPngBuffer *buffer) + { + } + +@@ -427,8 +421,8 @@ vips_foreign_load_png_buffer_init( VipsForeignLoadPngBuffer *buffer ) + * Use @fail_on to set the type of error that will cause load to fail. By + * default, loaders are permissive, that is, #VIPS_FAIL_ON_NONE. + * +- * By default, the PNG loader limits the number of text and data chunks to +- * block some denial of service attacks. Set @unlimited to disable these ++ * By default, the PNG loader limits the number of text and data chunks to ++ * block some denial of service attacks. Set @unlimited to disable these + * limits. + * + * See also: vips_image_new_from_file(). +@@ -436,16 +430,16 @@ vips_foreign_load_png_buffer_init( VipsForeignLoadPngBuffer *buffer ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_pngload( const char *filename, VipsImage **out, ... ) ++vips_pngload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "pngload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("pngload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -462,15 +456,15 @@ vips_pngload( const char *filename, VipsImage **out, ... ) + * + * Exactly as vips_pngload(), but read from a PNG-formatted memory block. + * +- * You must not free the buffer while @out is active. The +- * #VipsObject::postclose signal on @out is a good place to free. ++ * You must not free the buffer while @out is active. The ++ * #VipsObject::postclose signal on @out is a good place to free. + * + * See also: vips_pngload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_pngload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++vips_pngload_buffer(void *buf, size_t len, VipsImage **out, ...) + { + va_list ap; + VipsBlob *blob; +@@ -478,15 +472,15 @@ vips_pngload_buffer( void *buf, size_t len, VipsImage **out, ... ) + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, buf, len ); ++ blob = vips_blob_new(NULL, buf, len); + +- va_start( ap, out ); +- result = vips_call_split( "pngload_buffer", ap, blob, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("pngload_buffer", ap, blob, out); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( result ); ++ return (result); + } + + /** +@@ -500,21 +494,21 @@ vips_pngload_buffer( void *buf, size_t len, VipsImage **out, ... ) + * * @fail_on: #VipsFailOn, types of read error to fail on + * * @unlimited: %gboolean, Remove all denial of service limits + * +- * Exactly as vips_pngload(), but read from a source. ++ * Exactly as vips_pngload(), but read from a source. + * + * See also: vips_pngload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_pngload_source( VipsSource *source, VipsImage **out, ... ) ++vips_pngload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "pngload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("pngload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/pngsave.c b/libvips/foreign/pngsave.c +index 250b7213ef..785d50f6a3 100644 +--- a/libvips/foreign/pngsave.c ++++ b/libvips/foreign/pngsave.c +@@ -14,28 +14,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -83,87 +83,87 @@ typedef struct _VipsForeignSavePng { + + typedef VipsForeignSaveClass VipsForeignSavePngClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSavePng, vips_foreign_save_png, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSavePng, vips_foreign_save_png, ++ VIPS_TYPE_FOREIGN_SAVE); + + static void +-vips_foreign_save_png_dispose( GObject *gobject ) ++vips_foreign_save_png_dispose(GObject *gobject) + { + VipsForeignSavePng *png = (VipsForeignSavePng *) gobject; + +- VIPS_UNREF( png->target ); ++ VIPS_UNREF(png->target); + +- G_OBJECT_CLASS( vips_foreign_save_png_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_png_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_save_png_build( VipsObject *object ) ++vips_foreign_save_png_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSavePng *png = (VipsForeignSavePng *) object; + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_png_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_png_parent_class)->build(object)) ++ return (-1); + + in = save->ready; +- g_object_ref( in ); ++ g_object_ref(in); + + /* If no output bitdepth has been specified, use input Type to pick. + */ +- if( !vips_object_argument_isset( object, "bitdepth" ) ) +- png->bitdepth = +- in->Type == VIPS_INTERPRETATION_RGB16 || +- in->Type == VIPS_INTERPRETATION_GREY16 ? 16 : 8; ++ if (!vips_object_argument_isset(object, "bitdepth")) ++ png->bitdepth = ++ in->Type == VIPS_INTERPRETATION_RGB16 || ++ in->Type == VIPS_INTERPRETATION_GREY16 ++ ? 16 ++ : 8; + + /* Deprecated "colours" arg just sets bitdepth large enough to hold + * that many colours. + */ +- if( vips_object_argument_isset( object, "colours" ) ) +- png->bitdepth = ceil( log2( png->colours ) ); ++ if (vips_object_argument_isset(object, "colours")) ++ png->bitdepth = ceil(log2(png->colours)); + + /* Cast in down to 8 bit if we can. + */ +- if( png->bitdepth <= 8 ) { ++ if (png->bitdepth <= 8) { + VipsImage *x; + +- if( vips_cast( in, &x, VIPS_FORMAT_UCHAR, NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_cast(in, &x, VIPS_FORMAT_UCHAR, NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + in = x; + } + + /* If this is a RGB or RGBA image and a low bit depth has been + * requested, enable palettization. + */ +- if( in->Bands > 2 && +- png->bitdepth < 8 ) ++ if (in->Bands > 2 && ++ png->bitdepth < 8) + png->palette = TRUE; + + /* Disable palettization for >8 bit save. + */ +- if( png->bitdepth > 8 ) ++ if (png->bitdepth > 8) + png->palette = FALSE; + +- if( vips__png_write_target( in, png->target, +- png->compression, png->interlace, png->profile, png->filter, +- save->strip, png->palette, png->Q, png->dither, +- png->bitdepth, png->effort ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips__png_write_target(in, png->target, ++ png->compression, png->interlace, png->profile, png->filter, ++ save->strip, png->palette, png->Q, png->dither, ++ png->bitdepth, png->effort)) { ++ g_object_unref(in); ++ return (-1); + } + +- if( vips_target_end( png->target ) ) +- return( -1 ); ++ if (vips_target_end(png->target)) ++ return (-1); + +- g_object_unref( in ); ++ g_object_unref(in); + +- return( 0 ); ++ return (0); + } + + /* Save a bit of typing. +@@ -188,9 +188,9 @@ static VipsBandFormat bandfmt_png[10] = { + }; + + static void +-vips_foreign_save_png_class_init( VipsForeignSavePngClass *class ) ++vips_foreign_save_png_class_init(VipsForeignSavePngClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; +@@ -200,7 +200,7 @@ vips_foreign_save_png_class_init( VipsForeignSavePngClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pngsave_base"; +- object_class->description = _( "save png" ); ++ object_class->description = _("save png"); + object_class->build = vips_foreign_save_png_build; + + foreign_class->suffs = vips__png_suffs; +@@ -208,81 +208,80 @@ vips_foreign_save_png_class_init( VipsForeignSavePngClass *class ) + save_class->saveable = VIPS_SAVEABLE_RGBA; + save_class->format_table = bandfmt_png; + +- VIPS_ARG_INT( class, "compression", 6, +- _( "Compression" ), +- _( "Compression factor" ), ++ VIPS_ARG_INT(class, "compression", 6, ++ _("Compression"), ++ _("Compression factor"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePng, compression ), +- 0, 9, 6 ); ++ G_STRUCT_OFFSET(VipsForeignSavePng, compression), ++ 0, 9, 6); + +- VIPS_ARG_BOOL( class, "interlace", 7, +- _( "Interlace" ), +- _( "Interlace image" ), ++ VIPS_ARG_BOOL(class, "interlace", 7, ++ _("Interlace"), ++ _("Interlace image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePng, interlace ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSavePng, interlace), ++ FALSE); + +- VIPS_ARG_STRING( class, "profile", 11, +- _( "Profile" ), +- _( "ICC profile to embed" ), ++ VIPS_ARG_STRING(class, "profile", 11, ++ _("Profile"), ++ _("ICC profile to embed"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePng, profile ), +- NULL ); ++ G_STRUCT_OFFSET(VipsForeignSavePng, profile), ++ NULL); + +- VIPS_ARG_FLAGS( class, "filter", 12, +- _( "Filter" ), +- _( "libpng row filter flag(s)" ), ++ VIPS_ARG_FLAGS(class, "filter", 12, ++ _("Filter"), ++ _("libpng row filter flag(s)"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePng, filter ), ++ G_STRUCT_OFFSET(VipsForeignSavePng, filter), + VIPS_TYPE_FOREIGN_PNG_FILTER, +- VIPS_FOREIGN_PNG_FILTER_NONE ); ++ VIPS_FOREIGN_PNG_FILTER_NONE); + +- VIPS_ARG_BOOL( class, "palette", 13, +- _( "Palette" ), +- _( "Quantise to 8bpp palette" ), ++ VIPS_ARG_BOOL(class, "palette", 13, ++ _("Palette"), ++ _("Quantise to 8bpp palette"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePng, palette ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSavePng, palette), ++ FALSE); + +- VIPS_ARG_INT( class, "Q", 15, +- _( "Quality" ), +- _( "Quantisation quality" ), ++ VIPS_ARG_INT(class, "Q", 15, ++ _("Quality"), ++ _("Quantisation quality"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePng, Q ), +- 0, 100, 100 ); ++ G_STRUCT_OFFSET(VipsForeignSavePng, Q), ++ 0, 100, 100); + +- VIPS_ARG_DOUBLE( class, "dither", 16, +- _( "Dithering" ), +- _( "Amount of dithering" ), ++ VIPS_ARG_DOUBLE(class, "dither", 16, ++ _("Dithering"), ++ _("Amount of dithering"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePng, dither ), +- 0.0, 1.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsForeignSavePng, dither), ++ 0.0, 1.0, 1.0); + +- VIPS_ARG_INT( class, "bitdepth", 17, +- _( "Bit depth" ), +- _( "Write as a 1, 2, 4, 8 or 16 bit image" ), ++ VIPS_ARG_INT(class, "bitdepth", 17, ++ _("Bit depth"), ++ _("Write as a 1, 2, 4, 8 or 16 bit image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePng, bitdepth ), +- 0, 16, 0 ); ++ G_STRUCT_OFFSET(VipsForeignSavePng, bitdepth), ++ 0, 16, 0); + +- VIPS_ARG_INT( class, "effort", 18, +- _( "Effort" ), +- _( "Quantisation CPU effort" ), ++ VIPS_ARG_INT(class, "effort", 18, ++ _("Effort"), ++ _("Quantisation CPU effort"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePng, effort ), +- 1, 10, 7 ); ++ G_STRUCT_OFFSET(VipsForeignSavePng, effort), ++ 1, 10, 7); + +- VIPS_ARG_INT( class, "colours", 14, +- _( "Colours" ), +- _( "Max number of palette colours" ), ++ VIPS_ARG_INT(class, "colours", 14, ++ _("Colours"), ++ _("Max number of palette colours"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignSavePng, colours ), +- 2, 256, 256 ); +- ++ G_STRUCT_OFFSET(VipsForeignSavePng, colours), ++ 2, 256, 256); + } + + static void +-vips_foreign_save_png_init( VipsForeignSavePng *png ) ++vips_foreign_save_png_init(VipsForeignSavePng *png) + { + png->compression = 6; + png->filter = VIPS_FOREIGN_PNG_FILTER_NONE; +@@ -299,102 +298,99 @@ typedef struct _VipsForeignSavePngTarget { + + typedef VipsForeignSavePngClass VipsForeignSavePngTargetClass; + +-G_DEFINE_TYPE( VipsForeignSavePngTarget, vips_foreign_save_png_target, +- vips_foreign_save_png_get_type() ); ++G_DEFINE_TYPE(VipsForeignSavePngTarget, vips_foreign_save_png_target, ++ vips_foreign_save_png_get_type()); + + static int +-vips_foreign_save_png_target_build( VipsObject *object ) ++vips_foreign_save_png_target_build(VipsObject *object) + { + VipsForeignSavePng *png = (VipsForeignSavePng *) object; + VipsForeignSavePngTarget *target = (VipsForeignSavePngTarget *) object; + + png->target = target->target; +- g_object_ref( png->target ); ++ g_object_ref(png->target); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_png_target_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_png_target_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_png_target_class_init( VipsForeignSavePngTargetClass *class ) ++vips_foreign_save_png_target_class_init(VipsForeignSavePngTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pngsave_target"; +- object_class->description = _( "save image to target as PNG" ); ++ object_class->description = _("save image to target as PNG"); + object_class->build = vips_foreign_save_png_target_build; + +- VIPS_ARG_OBJECT( class, "target", 1, +- _( "Target" ), +- _( "Target to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePngTarget, target ), +- VIPS_TYPE_TARGET ); +- ++ VIPS_ARG_OBJECT(class, "target", 1, ++ _("Target"), ++ _("Target to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSavePngTarget, target), ++ VIPS_TYPE_TARGET); + } + + static void +-vips_foreign_save_png_target_init( VipsForeignSavePngTarget *target ) ++vips_foreign_save_png_target_init(VipsForeignSavePngTarget *target) + { + } + + typedef struct _VipsForeignSavePngFile { + VipsForeignSavePng parent_object; + +- char *filename; ++ char *filename; + } VipsForeignSavePngFile; + + typedef VipsForeignSavePngClass VipsForeignSavePngFileClass; + +-G_DEFINE_TYPE( VipsForeignSavePngFile, vips_foreign_save_png_file, +- vips_foreign_save_png_get_type() ); ++G_DEFINE_TYPE(VipsForeignSavePngFile, vips_foreign_save_png_file, ++ vips_foreign_save_png_get_type()); + + static int +-vips_foreign_save_png_file_build( VipsObject *object ) ++vips_foreign_save_png_file_build(VipsObject *object) + { + VipsForeignSavePng *png = (VipsForeignSavePng *) object; + VipsForeignSavePngFile *file = (VipsForeignSavePngFile *) object; + +- if( !(png->target = vips_target_new_to_file( file->filename )) ) +- return( -1 ); ++ if (!(png->target = vips_target_new_to_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_png_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_png_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_png_file_class_init( VipsForeignSavePngFileClass *class ) ++vips_foreign_save_png_file_class_init(VipsForeignSavePngFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pngsave"; +- object_class->description = _( "save image to png file" ); ++ object_class->description = _("save image to png file"); + object_class->build = vips_foreign_save_png_file_build; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePngFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSavePngFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_png_file_init( VipsForeignSavePngFile *file ) ++vips_foreign_save_png_file_init(VipsForeignSavePngFile *file) + { + } + +@@ -406,54 +402,53 @@ typedef struct _VipsForeignSavePngBuffer { + + typedef VipsForeignSavePngClass VipsForeignSavePngBufferClass; + +-G_DEFINE_TYPE( VipsForeignSavePngBuffer, vips_foreign_save_png_buffer, +- vips_foreign_save_png_get_type() ); ++G_DEFINE_TYPE(VipsForeignSavePngBuffer, vips_foreign_save_png_buffer, ++ vips_foreign_save_png_get_type()); + + static int +-vips_foreign_save_png_buffer_build( VipsObject *object ) ++vips_foreign_save_png_buffer_build(VipsObject *object) + { + VipsForeignSavePng *png = (VipsForeignSavePng *) object; + VipsForeignSavePngBuffer *buffer = (VipsForeignSavePngBuffer *) object; + + VipsBlob *blob; + +- if( !(png->target = vips_target_new_to_memory()) ) +- return( -1 ); ++ if (!(png->target = vips_target_new_to_memory())) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_png_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_png_buffer_parent_class)->build(object)) ++ return (-1); + +- g_object_get( png->target, "blob", &blob, NULL ); +- g_object_set( buffer, "buffer", blob, NULL ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ g_object_get(png->target, "blob", &blob, NULL); ++ g_object_set(buffer, "buffer", blob, NULL); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_png_buffer_class_init( VipsForeignSavePngBufferClass *class ) ++vips_foreign_save_png_buffer_class_init(VipsForeignSavePngBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pngsave_buffer"; +- object_class->description = _( "save image to png buffer" ); ++ object_class->description = _("save image to png buffer"); + object_class->build = vips_foreign_save_png_buffer_build; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to save to" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsForeignSavePngBuffer, buf ), +- VIPS_TYPE_BLOB ); ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to save to"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsForeignSavePngBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_save_png_buffer_init( VipsForeignSavePngBuffer *buffer ) ++vips_foreign_save_png_buffer_init(VipsForeignSavePngBuffer *buffer) + { + } + +@@ -461,8 +456,8 @@ vips_foreign_save_png_buffer_init( VipsForeignSavePngBuffer *buffer ) + + /** + * vips_pngsave: (method) +- * @in: image to save +- * @filename: file to write to ++ * @in: image to save ++ * @filename: file to write to + * @...: %NULL-terminated list of optional named arguments + * + * Optional arguments: +@@ -472,7 +467,7 @@ vips_foreign_save_png_buffer_init( VipsForeignSavePngBuffer *buffer ) + * * @profile: %gchararray, ICC profile to embed + * * @filter: #VipsForeignPngFilter row filter flag(s) + * * @palette: %gboolean, enable quantisation to 8bpp palette +- * * @Q: %gint, quality for 8bpp quantisation ++ * * @Q: %gint, quality for 8bpp quantisation + * * @dither: %gdouble, amount of dithering for 8bpp quantization + * * @bitdepth: %gint, set write bit depth to 1, 2, 4, 8 or 16 + * * @effort: %gint, quantisation CPU effort +@@ -481,16 +476,16 @@ vips_foreign_save_png_buffer_init( VipsForeignSavePngBuffer *buffer ) + * + * @compression means compress with this much effort (0 - 9). Default 6. + * +- * Set @interlace to %TRUE to interlace the image with ADAM7 ++ * Set @interlace to %TRUE to interlace the image with ADAM7 + * interlacing. Beware + * than an interlaced PNG can be up to 7 times slower to write than a + * non-interlaced image. + * + * Use @profile to give the filename of a profile to be embedded in the PNG. +- * This does not affect the pixels which are written, just the way +- * they are tagged. See vips_profile_load() for details on profile naming. ++ * This does not affect the pixels which are written, just the way ++ * they are tagged. See vips_profile_load() for details on profile naming. + * +- * If @profile is specified and the VIPS header ++ * If @profile is specified and the VIPS header + * contains an ICC profile named VIPS_META_ICC_NAME ("icc-profile-data"), the + * profile from the VIPS header will be attached. + * +@@ -502,7 +497,7 @@ vips_foreign_save_png_buffer_init( VipsForeignSavePngBuffer *buffer ) + * saved as 16-bit PNG, others are saved as 8-bit PNG. + * + * Set @palette to %TRUE to enable palette mode for RGB or RGBA images. A +- * palette will be computed with enough space for @bitdepth (1, 2, 4 or 8) ++ * palette will be computed with enough space for @bitdepth (1, 2, 4 or 8) + * bits. Use @Q to set the optimisation effort, @dither to set the degree of + * Floyd-Steinberg dithering and @effort to control the CPU effort + * (1 is the fastest, 10 is the slowest, 7 is the default). +@@ -520,21 +515,21 @@ vips_foreign_save_png_buffer_init( VipsForeignSavePngBuffer *buffer ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_pngsave( VipsImage *in, const char *filename, ... ) ++vips_pngsave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "pngsave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("pngsave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_pngsave_buffer: (method) +- * @in: image to save ++ * @in: image to save + * @buf: (array length=len) (element-type guint8): return output buffer here + * @len: (type gsize): return output length here + * @...: %NULL-terminated list of optional named arguments +@@ -546,12 +541,12 @@ vips_pngsave( VipsImage *in, const char *filename, ... ) + * * @profile: %gchararray, ICC profile to embed + * * @filter: #VipsForeignPngFilter row filter flag(s) + * * @palette: %gboolean, enable quantisation to 8bpp palette +- * * @Q: %gint, quality for 8bpp quantisation ++ * * @Q: %gint, quality for 8bpp quantisation + * * @dither: %gdouble, amount of dithering for 8bpp quantization + * * @bitdepth: %gint, set write bit depth to 1, 2, 4, 8 or 16 + * * @effort: %gint, quantisation CPU effort + * +- * As vips_pngsave(), but save to a memory buffer. ++ * As vips_pngsave(), but save to a memory buffer. + * + * The address of the buffer is returned in @buf, the length of the buffer in + * @len. You are responsible for freeing the buffer with g_free() when you +@@ -562,36 +557,36 @@ vips_pngsave( VipsImage *in, const char *filename, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_pngsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++vips_pngsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + { + va_list ap; + VipsArea *area; + int result; + +- area = NULL; ++ area = NULL; + +- va_start( ap, len ); +- result = vips_call_split( "pngsave_buffer", ap, in, &area ); +- va_end( ap ); ++ va_start(ap, len); ++ result = vips_call_split("pngsave_buffer", ap, in, &area); ++ va_end(ap); + +- if( !result && +- area ) { +- if( buf ) { ++ if (!result && ++ area) { ++ if (buf) { + *buf = area->data; + area->free_fn = NULL; + } +- if( len ) ++ if (len) + *len = area->length; + +- vips_area_unref( area ); ++ vips_area_unref(area); + } + +- return( result ); ++ return (result); + } + + /** + * vips_pngsave_target: (method) +- * @in: image to save ++ * @in: image to save + * @target: save image to this target + * @...: %NULL-terminated list of optional named arguments + * +@@ -602,7 +597,7 @@ vips_pngsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) + * * @profile: ICC profile to embed + * * @filter: libpng row filter flag(s) + * * @palette: enable quantisation to 8bpp palette +- * * @Q: quality for 8bpp quantisation ++ * * @Q: quality for 8bpp quantisation + * * @dither: amount of dithering for 8bpp quantization + * * @bitdepth: %gint, set write bit depth to 1, 2, 4, 8 or 16 + * * @effort: %gint, quantisation CPU effort +@@ -614,14 +609,14 @@ vips_pngsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_pngsave_target( VipsImage *in, VipsTarget *target, ... ) ++vips_pngsave_target(VipsImage *in, VipsTarget *target, ...) + { + va_list ap; + int result; + +- va_start( ap, target ); +- result = vips_call_split( "pngsave_target", ap, in, target ); +- va_end( ap ); ++ va_start(ap, target); ++ result = vips_call_split("pngsave_target", ap, in, target); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/popplerload.c b/libvips/foreign/popplerload.c +index 1e450048b1..ca25b77781 100644 +--- a/libvips/foreign/popplerload.c ++++ b/libvips/foreign/popplerload.c +@@ -11,7 +11,7 @@ + * 8/6/18 + * - add background param + * 16/8/18 [kleisauke] +- * - shut down the input file as soon as we can ++ * - shut down the input file as soon as we can + * 19/9/19 + * - reopen the input if we minimised too early + * 11/3/20 +@@ -26,28 +26,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -76,7 +76,7 @@ + #include + #include + +-/* Render PDFs with tiles this size. They need to be pretty big to limit ++/* Render PDFs with tiles this size. They need to be pretty big to limit + * overcomputation. + * + * An A4 page at 300dpi is 3508 pixels, so this should be enough to prevent +@@ -85,19 +85,19 @@ + #define TILE_SIZE (4000) + + #define VIPS_TYPE_FOREIGN_LOAD_PDF (vips_foreign_load_pdf_get_type()) +-#define VIPS_FOREIGN_LOAD_PDF( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_FOREIGN_LOAD_PDF, VipsForeignLoadPdf )) +-#define VIPS_FOREIGN_LOAD_PDF_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_FOREIGN_LOAD_PDF, VipsForeignLoadPdfClass)) +-#define VIPS_IS_FOREIGN_LOAD_PDF( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_FOREIGN_LOAD_PDF )) +-#define VIPS_IS_FOREIGN_LOAD_PDF_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_FOREIGN_LOAD_PDF )) +-#define VIPS_FOREIGN_LOAD_PDF_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_FOREIGN_LOAD_PDF, VipsForeignLoadPdfClass )) ++#define VIPS_FOREIGN_LOAD_PDF(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_FOREIGN_LOAD_PDF, VipsForeignLoadPdf)) ++#define VIPS_FOREIGN_LOAD_PDF_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_FOREIGN_LOAD_PDF, VipsForeignLoadPdfClass)) ++#define VIPS_IS_FOREIGN_LOAD_PDF(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_FOREIGN_LOAD_PDF)) ++#define VIPS_IS_FOREIGN_LOAD_PDF_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_FOREIGN_LOAD_PDF)) ++#define VIPS_FOREIGN_LOAD_PDF_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_FOREIGN_LOAD_PDF, VipsForeignLoadPdfClass)) + + typedef struct _VipsForeignLoadPdf { + VipsForeignLoad parent_object; +@@ -114,7 +114,7 @@ typedef struct _VipsForeignLoadPdf { + + /* Load this many pages. + */ +- int n; ++ int n; + + /* Render at this DPI. + */ +@@ -144,7 +144,7 @@ typedef struct _VipsForeignLoadPdf { + PopplerPage *page; + int current_page; + +- /* Doc has this many pages. ++ /* Doc has this many pages. + */ + int n_pages; + +@@ -165,94 +165,92 @@ typedef struct _VipsForeignLoadPdfClass { + + } VipsForeignLoadPdfClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadPdf, vips_foreign_load_pdf, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadPdf, vips_foreign_load_pdf, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_pdf_dispose( GObject *gobject ) ++vips_foreign_load_pdf_dispose(GObject *gobject) + { +- VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF( gobject ); ++ VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF(gobject); + +- VIPS_UNREF( pdf->page ); +- VIPS_UNREF( pdf->doc ); +- VIPS_UNREF( pdf->source ); +- VIPS_UNREF( pdf->stream ); ++ VIPS_UNREF(pdf->page); ++ VIPS_UNREF(pdf->doc); ++ VIPS_UNREF(pdf->source); ++ VIPS_UNREF(pdf->stream); + +- G_OBJECT_CLASS( vips_foreign_load_pdf_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_pdf_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_load_pdf_build( VipsObject *object ) ++vips_foreign_load_pdf_build(VipsObject *object) + { +- VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF( object ); ++ VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF(object); + + GError *error = NULL; + +- if( vips_source_rewind( pdf->source ) ) +- return( -1 ); ++ if (vips_source_rewind(pdf->source)) ++ return (-1); + + pdf->total_scale = pdf->scale * pdf->dpi / 72.0; + +- pdf->stream = vips_g_input_stream_new_from_source( pdf->source ); +- if( !(pdf->doc = poppler_document_new_from_stream( pdf->stream, +- vips_source_length( pdf->source ), pdf->password, +- NULL, &error )) ) { +- vips_g_error( &error ); +- return( -1 ); ++ pdf->stream = vips_g_input_stream_new_from_source(pdf->source); ++ if (!(pdf->doc = poppler_document_new_from_stream(pdf->stream, ++ vips_source_length(pdf->source), pdf->password, ++ NULL, &error))) { ++ vips_g_error(&error); ++ return (-1); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_pdf_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_pdf_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static VipsForeignFlags +-vips_foreign_load_pdf_get_flags_filename( const char *filename ) ++vips_foreign_load_pdf_get_flags_filename(const char *filename) + { + /* We can render any part of the page on demand. + */ +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static VipsForeignFlags +-vips_foreign_load_pdf_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_pdf_get_flags(VipsForeignLoad *load) + { +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static int +-vips_foreign_load_pdf_get_page( VipsForeignLoadPdf *pdf, int page_no ) ++vips_foreign_load_pdf_get_page(VipsForeignLoadPdf *pdf, int page_no) + { +- if( pdf->current_page != page_no || +- !pdf->page ) { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( pdf ); ++ if (pdf->current_page != page_no || ++ !pdf->page) { ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(pdf); + +- VIPS_UNREF( pdf->page ); ++ VIPS_UNREF(pdf->page); + pdf->current_page = -1; + + #ifdef DEBUG +- printf( "vips_foreign_load_pdf_get_page: %d\n", page_no ); ++ printf("vips_foreign_load_pdf_get_page: %d\n", page_no); + #endif /*DEBUG*/ + +- if( !(pdf->page = +- poppler_document_get_page( pdf->doc, page_no )) ) { +- vips_error( class->nickname, +- _( "unable to load page %d" ), page_no ); +- return( -1 ); ++ if (!(pdf->page = ++ poppler_document_get_page(pdf->doc, page_no))) { ++ vips_error(class->nickname, ++ _("unable to load page %d"), page_no); ++ return (-1); + } + pdf->current_page = page_no; + } + +- return( 0 ); ++ return (0); + } + + /* String-based metadata fields we extract. + */ + typedef struct _VipsForeignLoadPdfMetadata { +- char *(*pdf_fetch)( PopplerDocument *doc ); ++ char *(*pdf_fetch)(PopplerDocument *doc); + char *field; + } VipsForeignLoadPdfMetadata; + +@@ -265,32 +263,32 @@ static VipsForeignLoadPdfMetadata vips_foreign_load_pdf_metadata[] = { + { poppler_document_get_producer, "pdf-producer" }, + { poppler_document_get_metadata, "pdf-metadata" }, + }; +-static int n_metadata = VIPS_NUMBER( vips_foreign_load_pdf_metadata ); ++static int n_metadata = VIPS_NUMBER(vips_foreign_load_pdf_metadata); + + static int +-vips_foreign_load_pdf_set_image( VipsForeignLoadPdf *pdf, VipsImage *out ) ++vips_foreign_load_pdf_set_image(VipsForeignLoadPdf *pdf, VipsImage *out) + { + int i; + double res; + + #ifdef DEBUG +- printf( "vips_foreign_load_pdf_set_image: %p\n", pdf ); ++ printf("vips_foreign_load_pdf_set_image: %p\n", pdf); + #endif /*DEBUG*/ + + /* Extract and attach metadata. Set the old name too for compat. + */ +- vips_image_set_int( out, "pdf-n_pages", pdf->n_pages ); +- vips_image_set_int( out, VIPS_META_N_PAGES, pdf->n_pages ); ++ vips_image_set_int(out, "pdf-n_pages", pdf->n_pages); ++ vips_image_set_int(out, VIPS_META_N_PAGES, pdf->n_pages); + +- for( i = 0; i < n_metadata; i++ ) { +- VipsForeignLoadPdfMetadata *metadata = ++ for (i = 0; i < n_metadata; i++) { ++ VipsForeignLoadPdfMetadata *metadata = + &vips_foreign_load_pdf_metadata[i]; + + char *str; + +- if( (str = metadata->pdf_fetch( pdf->doc )) ) { +- vips_image_set_string( out, metadata->field, str ); +- g_free( str ); ++ if ((str = metadata->pdf_fetch(pdf->doc))) { ++ vips_image_set_string(out, metadata->field, str); ++ g_free(str); + } + } + +@@ -298,73 +296,73 @@ vips_foreign_load_pdf_set_image( VipsForeignLoadPdf *pdf, VipsImage *out ) + */ + res = pdf->dpi / 25.4; + +- vips_image_init_fields( out, +- pdf->image.width, pdf->image.height, ++ vips_image_init_fields(out, ++ pdf->image.width, pdf->image.height, + 4, VIPS_FORMAT_UCHAR, +- VIPS_CODING_NONE, VIPS_INTERPRETATION_sRGB, res, res ); ++ VIPS_CODING_NONE, VIPS_INTERPRETATION_sRGB, res, res); + +- /* We render to a tilecache, so it has to be SMALLTILE. +- */ +- if( vips_image_pipelinev( out, VIPS_DEMAND_STYLE_SMALLTILE, NULL ) ) +- return( -1 ); ++ /* We render to a tilecache, so it has to be SMALLTILE. ++ */ ++ if (vips_image_pipelinev(out, VIPS_DEMAND_STYLE_SMALLTILE, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_pdf_header( VipsForeignLoad *load ) ++vips_foreign_load_pdf_header(VipsForeignLoad *load) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( load ); +- VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF( load ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(load); ++ VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF(load); + + int top; + int i; + + #ifdef DEBUG +- printf( "vips_foreign_load_pdf_header: %p\n", pdf ); ++ printf("vips_foreign_load_pdf_header: %p\n", pdf); + #endif /*DEBUG*/ + +- pdf->n_pages = poppler_document_get_n_pages( pdf->doc ); ++ pdf->n_pages = poppler_document_get_n_pages(pdf->doc); + + /* @n == -1 means until the end of the doc. + */ +- if( pdf->n == -1 ) ++ if (pdf->n == -1) + pdf->n = pdf->n_pages - pdf->page_no; + +- if( pdf->page_no + pdf->n > pdf->n_pages || ++ if (pdf->page_no + pdf->n > pdf->n_pages || + pdf->page_no < 0 || +- pdf->n <= 0 ) { +- vips_error( class->nickname, "%s", _( "pages out of range" ) ); +- return( -1 ); ++ pdf->n <= 0) { ++ vips_error(class->nickname, "%s", _("pages out of range")); ++ return (-1); + } + + /* Lay out the pages in our output image. + */ +- if( !(pdf->pages = VIPS_ARRAY( pdf, pdf->n, VipsRect )) ) +- return( -1 ); ++ if (!(pdf->pages = VIPS_ARRAY(pdf, pdf->n, VipsRect))) ++ return (-1); + + top = 0; + pdf->image.left = 0; + pdf->image.top = 0; + pdf->image.width = 0; + pdf->image.height = 0; +- for( i = 0; i < pdf->n; i++ ) { ++ for (i = 0; i < pdf->n; i++) { + double width; + double height; + +- if( vips_foreign_load_pdf_get_page( pdf, pdf->page_no + i ) ) +- return( -1 ); +- poppler_page_get_size( pdf->page, &width, &height ); ++ if (vips_foreign_load_pdf_get_page(pdf, pdf->page_no + i)) ++ return (-1); ++ poppler_page_get_size(pdf->page, &width, &height); + pdf->pages[i].left = 0; + pdf->pages[i].top = top; + /* We do round to nearest, in the same way that vips_resize() + * does round to nearest. Without this, things like + * shrink-on-load will break. + */ +- pdf->pages[i].width = VIPS_RINT( width * pdf->total_scale ); +- pdf->pages[i].height = VIPS_RINT( height * pdf->total_scale ); ++ pdf->pages[i].width = VIPS_RINT(width * pdf->total_scale); ++ pdf->pages[i].height = VIPS_RINT(height * pdf->total_scale); + +- if( pdf->pages[i].width > pdf->image.width ) ++ if (pdf->pages[i].width > pdf->image.width) + pdf->image.width = pdf->pages[i].width; + pdf->image.height += pdf->pages[i].height; + +@@ -374,48 +372,48 @@ vips_foreign_load_pdf_header( VipsForeignLoad *load ) + /* If all pages are the same height, we can tag this as a toilet roll + * image. + */ +- for( i = 1; i < pdf->n; i++ ) +- if( pdf->pages[i].height != pdf->pages[0].height ) ++ for (i = 1; i < pdf->n; i++) ++ if (pdf->pages[i].height != pdf->pages[0].height) + break; + + /* Only set page-height if we have more than one page, or this could + * accidentally turn into an animated image later. + */ +- if( pdf->n > 1 ) +- vips_image_set_int( load->out, +- VIPS_META_PAGE_HEIGHT, pdf->pages[0].height ); ++ if (pdf->n > 1) ++ vips_image_set_int(load->out, ++ VIPS_META_PAGE_HEIGHT, pdf->pages[0].height); + +- vips_foreign_load_pdf_set_image( pdf, load->out ); ++ vips_foreign_load_pdf_set_image(pdf, load->out); + +- /* Convert the background to the image format. ++ /* Convert the background to the image format. + */ +- if( !(pdf->ink = vips__vector_to_ink( class->nickname, +- load->out, +- VIPS_AREA( pdf->background )->data, NULL, +- VIPS_AREA( pdf->background )->n )) ) +- return( -1 ); ++ if (!(pdf->ink = vips__vector_to_ink(class->nickname, ++ load->out, ++ VIPS_AREA(pdf->background)->data, NULL, ++ VIPS_AREA(pdf->background)->n))) ++ return (-1); + + /* Swap to cairo-style premultiplied bgra. + */ +- vips__rgba2bgra_premultiplied( (guint32 *) pdf->ink, 1 ); ++ vips__rgba2bgra_premultiplied((guint32 *) pdf->ink, 1); + +- vips_source_minimise( pdf->source ); ++ vips_source_minimise(pdf->source); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_pdf_minimise( VipsImage *image, VipsForeignLoadPdf *pdf ) ++vips_foreign_load_pdf_minimise(VipsImage *image, VipsForeignLoadPdf *pdf) + { +- vips_source_minimise( pdf->source ); ++ vips_source_minimise(pdf->source); + } + + static int +-vips_foreign_load_pdf_generate( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_foreign_load_pdf_generate(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { +- VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF( a ); +- VipsRect *r = &or->valid; ++ VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF(a); ++ VipsRect *r = & or->valid; + + int top; + int i; +@@ -423,51 +421,51 @@ vips_foreign_load_pdf_generate( VipsRegion *or, + + /* + printf( "vips_foreign_load_pdf_generate: " +- "left = %d, top = %d, width = %d, height = %d\n", +- r->left, r->top, r->width, r->height ); ++ "left = %d, top = %d, width = %d, height = %d\n", ++ r->left, r->top, r->width, r->height ); + */ + +- /* Poppler won't always paint the background. ++ /* Poppler won't always paint the background. + */ +- vips_region_paint_pel( or, r, pdf->ink ); ++ vips_region_paint_pel(or, r, pdf->ink); + + /* Search through the pages we are drawing for the first containing +- * this rect. This could be quicker, perhaps a binary search, but who ++ * this rect. This could be quicker, perhaps a binary search, but who + * cares. + */ +- for( i = 0; i < pdf->n; i++ ) +- if( VIPS_RECT_BOTTOM( &pdf->pages[i] ) > r->top ) ++ for (i = 0; i < pdf->n; i++) ++ if (VIPS_RECT_BOTTOM(&pdf->pages[i]) > r->top) + break; + +- top = r->top; +- while( top < VIPS_RECT_BOTTOM( r ) ) { ++ top = r->top; ++ while (top < VIPS_RECT_BOTTOM(r)) { + VipsRect rect; + cairo_surface_t *surface; + cairo_t *cr; + +- vips_rect_intersectrect( r, &pdf->pages[i], &rect ); ++ vips_rect_intersectrect(r, &pdf->pages[i], &rect); + +- surface = cairo_image_surface_create_for_data( +- VIPS_REGION_ADDR( or, rect.left, rect.top ), +- CAIRO_FORMAT_ARGB32, +- rect.width, rect.height, +- VIPS_REGION_LSKIP( or ) ); +- cr = cairo_create( surface ); +- cairo_surface_destroy( surface ); ++ surface = cairo_image_surface_create_for_data( ++ VIPS_REGION_ADDR(or, rect.left, rect.top), ++ CAIRO_FORMAT_ARGB32, ++ rect.width, rect.height, ++ VIPS_REGION_LSKIP(or)); ++ cr = cairo_create(surface); ++ cairo_surface_destroy(surface); + +- cairo_scale( cr, pdf->total_scale, pdf->total_scale ); +- cairo_translate( cr, +- (pdf->pages[i].left - rect.left) / pdf->total_scale, +- (pdf->pages[i].top - rect.top) / pdf->total_scale ); ++ cairo_scale(cr, pdf->total_scale, pdf->total_scale); ++ cairo_translate(cr, ++ (pdf->pages[i].left - rect.left) / pdf->total_scale, ++ (pdf->pages[i].top - rect.top) / pdf->total_scale); + +- /* poppler is single-threaded, but we don't need to lock since ++ /* poppler is single-threaded, but we don't need to lock since + * we're running inside a non-threaded tilecache. + */ +- if( vips_foreign_load_pdf_get_page( pdf, pdf->page_no + i ) ) +- return( -1 ); +- poppler_page_render( pdf->page, cr ); ++ if (vips_foreign_load_pdf_get_page(pdf, pdf->page_no + i)) ++ return (-1); ++ poppler_page_render(pdf->page, cr); + +- cairo_destroy( cr ); ++ cairo_destroy(cr); + + top += rect.height; + i += 1; +@@ -475,54 +473,54 @@ vips_foreign_load_pdf_generate( VipsRegion *or, + + /* Cairo makes pre-multipled BRGA, we must byteswap and unpremultiply. + */ +- for( y = 0; y < r->height; y++ ) +- vips__premultiplied_bgra2rgba( +- (guint32 *) VIPS_REGION_ADDR( or, r->left, r->top + y ), +- r->width ); ++ for (y = 0; y < r->height; y++) ++ vips__premultiplied_bgra2rgba( ++ (guint32 *) VIPS_REGION_ADDR(or, r->left, r->top + y), ++ r->width); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_pdf_load( VipsForeignLoad *load ) ++vips_foreign_load_pdf_load(VipsForeignLoad *load) + { +- VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF( load ); +- VipsImage **t = (VipsImage **) +- vips_object_local_array( (VipsObject *) load, 2 ); ++ VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF(load); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array((VipsObject *) load, 2); + + #ifdef DEBUG +- printf( "vips_foreign_load_pdf_load: %p\n", pdf ); ++ printf("vips_foreign_load_pdf_load: %p\n", pdf); + #endif /*DEBUG*/ + + /* Read to this image, then cache to out, see below. + */ +- t[0] = vips_image_new(); ++ t[0] = vips_image_new(); + + /* Close input immediately at end of read. + */ +- g_signal_connect( t[0], "minimise", +- G_CALLBACK( vips_foreign_load_pdf_minimise ), pdf ); ++ g_signal_connect(t[0], "minimise", ++ G_CALLBACK(vips_foreign_load_pdf_minimise), pdf); + +- vips_foreign_load_pdf_set_image( pdf, t[0] ); +- if( vips_image_generate( t[0], +- NULL, vips_foreign_load_pdf_generate, NULL, pdf, NULL ) || +- vips_tilecache( t[0], &t[1], ++ vips_foreign_load_pdf_set_image(pdf, t[0]); ++ if (vips_image_generate(t[0], ++ NULL, vips_foreign_load_pdf_generate, NULL, pdf, NULL) || ++ vips_tilecache(t[0], &t[1], + "tile_width", TILE_SIZE, + "tile_height", TILE_SIZE, + "max_tiles", 2 * (1 + t[0]->Xsize / TILE_SIZE), +- NULL ) || +- vips_image_write( t[1], load->real ) ) +- return( -1 ); ++ NULL) || ++ vips_image_write(t[1], load->real)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_pdf_class_init( VipsForeignLoadPdfClass *class ) ++vips_foreign_load_pdf_class_init(VipsForeignLoadPdfClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->dispose = vips_foreign_load_pdf_dispose; +@@ -530,71 +528,70 @@ vips_foreign_load_pdf_class_init( VipsForeignLoadPdfClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pdfload_base"; +- object_class->description = _( "load PDF with libpoppler" ); ++ object_class->description = _("load PDF with libpoppler"); + object_class->build = vips_foreign_load_pdf_build; + + /* libpoppler is fuzzed, but not by us. + */ + operation_class->flags |= VIPS_OPERATION_UNTRUSTED; + +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_pdf_get_flags_filename; + load_class->get_flags = vips_foreign_load_pdf_get_flags; + load_class->header = vips_foreign_load_pdf_header; + load_class->load = vips_foreign_load_pdf_load; + +- VIPS_ARG_INT( class, "page", 20, +- _( "Page" ), +- _( "First page to load" ), ++ VIPS_ARG_INT(class, "page", 20, ++ _("Page"), ++ _("First page to load"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdf, page_no ), +- 0, 100000, 0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadPdf, page_no), ++ 0, 100000, 0); + +- VIPS_ARG_INT( class, "n", 21, +- _( "n" ), +- _( "Number of pages to load, -1 for all" ), ++ VIPS_ARG_INT(class, "n", 21, ++ _("n"), ++ _("Number of pages to load, -1 for all"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdf, n ), +- -1, 100000, 1 ); ++ G_STRUCT_OFFSET(VipsForeignLoadPdf, n), ++ -1, 100000, 1); + +- VIPS_ARG_DOUBLE( class, "dpi", 22, +- _( "DPI" ), +- _( "DPI to render at" ), ++ VIPS_ARG_DOUBLE(class, "dpi", 22, ++ _("DPI"), ++ _("DPI to render at"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdf, dpi ), +- 0.001, 100000.0, 72.0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadPdf, dpi), ++ 0.001, 100000.0, 72.0); + +- VIPS_ARG_DOUBLE( class, "scale", 23, +- _( "Scale" ), +- _( "Factor to scale by" ), ++ VIPS_ARG_DOUBLE(class, "scale", 23, ++ _("Scale"), ++ _("Factor to scale by"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdf, scale ), +- 0.001, 100000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadPdf, scale), ++ 0.001, 100000.0, 1.0); + +- VIPS_ARG_BOXED( class, "background", 24, +- _( "Background" ), +- _( "Background colour" ), ++ VIPS_ARG_BOXED(class, "background", 24, ++ _("Background"), ++ _("Background colour"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdf, background ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsForeignLoadPdf, background), ++ VIPS_TYPE_ARRAY_DOUBLE); + +- VIPS_ARG_STRING( class, "password", 25, +- _( "Password" ), +- _( "Password to decrypt with" ), ++ VIPS_ARG_STRING(class, "password", 25, ++ _("Password"), ++ _("Password to decrypt with"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdf, password ), +- NULL ); +- ++ G_STRUCT_OFFSET(VipsForeignLoadPdf, password), ++ NULL); + } + + static void +-vips_foreign_load_pdf_init( VipsForeignLoadPdf *pdf ) ++vips_foreign_load_pdf_init(VipsForeignLoadPdf *pdf) + { + pdf->dpi = 72.0; + pdf->scale = 1.0; + pdf->n = 1; + pdf->current_page = -1; +- pdf->background = vips_array_double_newv( 1, 255.0 ); ++ pdf->background = vips_array_double_newv(1, 255.0); + } + + typedef struct _VipsForeignLoadPdfFile { +@@ -602,7 +599,7 @@ typedef struct _VipsForeignLoadPdfFile { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + char *uri; + +@@ -610,30 +607,30 @@ typedef struct _VipsForeignLoadPdfFile { + + typedef VipsForeignLoadPdfClass VipsForeignLoadPdfFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadPdfFile, vips_foreign_load_pdf_file, +- vips_foreign_load_pdf_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadPdfFile, vips_foreign_load_pdf_file, ++ vips_foreign_load_pdf_get_type()); + + static void +-vips_foreign_load_pdf_file_dispose( GObject *gobject ) ++vips_foreign_load_pdf_file_dispose(GObject *gobject) + { +- VipsForeignLoadPdfFile *file = ++ VipsForeignLoadPdfFile *file = + (VipsForeignLoadPdfFile *) gobject; + +- VIPS_FREE( file->uri ); ++ VIPS_FREE(file->uri); + +- G_OBJECT_CLASS( vips_foreign_load_pdf_file_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_pdf_file_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_load_pdf_file_header( VipsForeignLoad *load ) ++vips_foreign_load_pdf_file_header(VipsForeignLoad *load) + { + VipsForeignLoadPdfFile *file = (VipsForeignLoadPdfFile *) load; + +- VIPS_SETSTR( load->out->filename, file->filename ); ++ VIPS_SETSTR(load->out->filename, file->filename); + +- return( VIPS_FOREIGN_LOAD_CLASS( +- vips_foreign_load_pdf_file_parent_class )->header( load ) ); ++ return (VIPS_FOREIGN_LOAD_CLASS( ++ vips_foreign_load_pdf_file_parent_class) ++ ->header(load)); + } + + static const char *vips_foreign_pdf_suffs[] = { +@@ -642,71 +639,69 @@ static const char *vips_foreign_pdf_suffs[] = { + }; + + static int +-vips_foreign_load_pdf_file_build( VipsObject *object ) ++vips_foreign_load_pdf_file_build(VipsObject *object) + { +- VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF( object ); ++ VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF(object); + VipsForeignLoadPdfFile *file = (VipsForeignLoadPdfFile *) pdf; + + #ifdef DEBUG +- printf( "vips_foreign_load_pdf_file_build: %s\n", file->filename ); ++ printf("vips_foreign_load_pdf_file_build: %s\n", file->filename); + #endif /*DEBUG*/ + +- if( file->filename ) { ++ if (file->filename) { + char *path; + GError *error = NULL; + + /* We need an absolute path for a URI. + */ +- path = vips_realpath( file->filename ); +- if( !(file->uri = g_filename_to_uri( path, NULL, &error )) ) { +- g_free( path ); +- vips_g_error( &error ); +- return( -1 ); ++ path = vips_realpath(file->filename); ++ if (!(file->uri = g_filename_to_uri(path, NULL, &error))) { ++ g_free(path); ++ vips_g_error(&error); ++ return (-1); + } +- g_free( path ); +- +- if( !(pdf->source = +- vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ g_free(path); + ++ if (!(pdf->source = ++ vips_source_new_from_file(file->filename))) ++ return (-1); + } + +- return( VIPS_OBJECT_CLASS( vips_foreign_load_pdf_file_parent_class )-> +- build( object ) ); ++ return (VIPS_OBJECT_CLASS(vips_foreign_load_pdf_file_parent_class)->build(object)); + } + + static gboolean +-vips_foreign_load_pdf_is_a_buffer( const void *buf, size_t len ) ++vips_foreign_load_pdf_is_a_buffer(const void *buf, size_t len) + { + const guchar *str = (const guchar *) buf; + +- if( len >= 4 && +- str[0] == '%' && ++ if (len >= 4 && ++ str[0] == '%' && + str[1] == 'P' && + str[2] == 'D' && +- str[3] == 'F' ) +- return( 1 ); ++ str[3] == 'F') ++ return (1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_pdf_is_a( const char *filename ) ++vips_foreign_load_pdf_is_a(const char *filename) + { + unsigned char buf[4]; + +- if( vips__get_bytes( filename, buf, 4 ) == 4 && +- vips_foreign_load_pdf_is_a_buffer( buf, 4 ) ) +- return( 1 ); ++ if (vips__get_bytes(filename, buf, 4) == 4 && ++ vips_foreign_load_pdf_is_a_buffer(buf, 4)) ++ return (1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_pdf_file_class_init( +- VipsForeignLoadPdfFileClass *class ) ++vips_foreign_load_pdf_file_class_init( ++ VipsForeignLoadPdfFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -716,7 +711,7 @@ vips_foreign_load_pdf_file_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pdfload"; +- object_class->description = _( "load PDF from file" ); ++ object_class->description = _("load PDF from file"); + object_class->build = vips_foreign_load_pdf_file_build; + + foreign_class->suffs = vips_foreign_pdf_suffs; +@@ -724,17 +719,16 @@ vips_foreign_load_pdf_file_class_init( + load_class->is_a = vips_foreign_load_pdf_is_a; + load_class->header = vips_foreign_load_pdf_file_header; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdfFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadPdfFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_pdf_file_init( VipsForeignLoadPdfFile *file ) ++vips_foreign_load_pdf_file_init(VipsForeignLoadPdfFile *file) + { + } + +@@ -749,30 +743,29 @@ typedef struct _VipsForeignLoadPdfBuffer { + + typedef VipsForeignLoadPdfClass VipsForeignLoadPdfBufferClass; + +-G_DEFINE_TYPE( VipsForeignLoadPdfBuffer, vips_foreign_load_pdf_buffer, +- vips_foreign_load_pdf_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadPdfBuffer, vips_foreign_load_pdf_buffer, ++ vips_foreign_load_pdf_get_type()); + + static int +-vips_foreign_load_pdf_buffer_build( VipsObject *object ) ++vips_foreign_load_pdf_buffer_build(VipsObject *object) + { +- VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF( object ); ++ VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF(object); + VipsForeignLoadPdfBuffer *buffer = (VipsForeignLoadPdfBuffer *) pdf; + +- if( buffer->buf && +- !(pdf->source = vips_source_new_from_memory( +- VIPS_AREA( buffer->buf )->data, +- VIPS_AREA( buffer->buf )->length )) ) +- return( -1 ); ++ if (buffer->buf && ++ !(pdf->source = vips_source_new_from_memory( ++ VIPS_AREA(buffer->buf)->data, ++ VIPS_AREA(buffer->buf)->length))) ++ return (-1); + +- return( VIPS_OBJECT_CLASS( vips_foreign_load_pdf_buffer_parent_class )-> +- build( object ) ); ++ return (VIPS_OBJECT_CLASS(vips_foreign_load_pdf_buffer_parent_class)->build(object)); + } + + static void +-vips_foreign_load_pdf_buffer_class_init( +- VipsForeignLoadPdfBufferClass *class ) ++vips_foreign_load_pdf_buffer_class_init( ++ VipsForeignLoadPdfBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -780,22 +773,21 @@ vips_foreign_load_pdf_buffer_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pdfload_buffer"; +- object_class->description = _( "load PDF from buffer" ); ++ object_class->description = _("load PDF from buffer"); + object_class->build = vips_foreign_load_pdf_buffer_build; + + load_class->is_a_buffer = vips_foreign_load_pdf_is_a_buffer; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdfBuffer, buf ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadPdfBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_load_pdf_buffer_init( VipsForeignLoadPdfBuffer *buffer ) ++vips_foreign_load_pdf_buffer_init(VipsForeignLoadPdfBuffer *buffer) + { + } + +@@ -808,67 +800,65 @@ typedef struct _VipsForeignLoadPdfSource { + + typedef VipsForeignLoadPdfClass VipsForeignLoadPdfSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadPdfSource, vips_foreign_load_pdf_source, +- vips_foreign_load_pdf_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadPdfSource, vips_foreign_load_pdf_source, ++ vips_foreign_load_pdf_get_type()); + + static int +-vips_foreign_load_pdf_source_build( VipsObject *object ) ++vips_foreign_load_pdf_source_build(VipsObject *object) + { +- VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF( object ); ++ VipsForeignLoadPdf *pdf = VIPS_FOREIGN_LOAD_PDF(object); + VipsForeignLoadPdfSource *source = (VipsForeignLoadPdfSource *) pdf; + +- if( source->source ) { ++ if (source->source) { + pdf->source = source->source; +- g_object_ref( pdf->source ); ++ g_object_ref(pdf->source); + } + +- return( VIPS_OBJECT_CLASS( vips_foreign_load_pdf_source_parent_class )-> +- build( object ) ); ++ return (VIPS_OBJECT_CLASS(vips_foreign_load_pdf_source_parent_class)->build(object)); + } + + static gboolean +-vips_foreign_load_pdf_source_is_a_source( VipsSource *source ) ++vips_foreign_load_pdf_source_is_a_source(VipsSource *source) + { + const unsigned char *p; + +- return( (p = vips_source_sniff( source, 4 )) && +- p[0] == '%' && ++ return ((p = vips_source_sniff(source, 4)) && ++ p[0] == '%' && + p[1] == 'P' && + p[2] == 'D' && +- p[3] == 'F' ); ++ p[3] == 'F'); + } + + static void +-vips_foreign_load_pdf_source_class_init( +- VipsForeignLoadPdfSourceClass *class ) ++vips_foreign_load_pdf_source_class_init( ++ VipsForeignLoadPdfSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pdfload_source"; +- object_class->description = _( "load PDF from source" ); ++ object_class->description = _("load PDF from source"); + object_class->build = vips_foreign_load_pdf_source_build; + + operation_class->flags |= VIPS_OPERATION_NOCACHE; + + load_class->is_a_source = vips_foreign_load_pdf_source_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPdfSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadPdfSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_pdf_source_init( VipsForeignLoadPdfSource *source ) ++vips_foreign_load_pdf_source_init(VipsForeignLoadPdfSource *source) + { + } + +diff --git a/libvips/foreign/ppmload.c b/libvips/foreign/ppmload.c +index 5907cd1d68..b92cb1827d 100644 +--- a/libvips/foreign/ppmload.c ++++ b/libvips/foreign/ppmload.c +@@ -36,7 +36,7 @@ + * - sequential load, plus mmap for filename sources + * - faster plus lower memory use + * 02/02/20 +- * - ban max_vaue < 0 ++ * - ban max_vaue < 0 + * 27/6/20 + * - add ppmload_source + * 22/11/20 +@@ -49,28 +49,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -112,10 +112,10 @@ typedef struct _VipsForeignLoadPpm { + VipsInterpretation interpretation; + float scale; + int max_value; +- int index; /* ppm type .. index in magic_names[] */ +- int bits; /* 1, 8, 16 or 32 */ ++ int index; /* ppm type .. index in magic_names[] */ ++ int bits; /* 1, 8, 16 or 32 */ + gboolean ascii; /* TRUE for ascii encoding */ +- gboolean msb_first; /* TRUE if most sig byte is first */ ++ gboolean msb_first; /* TRUE if most sig byte is first */ + + gboolean have_read_header; + +@@ -123,26 +123,26 @@ typedef struct _VipsForeignLoadPpm { + + typedef VipsForeignLoadClass VipsForeignLoadPpmClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadPpm, vips_foreign_load_ppm, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadPpm, vips_foreign_load_ppm, ++ VIPS_TYPE_FOREIGN_LOAD); + + /* ppm types. + */ + static char *magic_names[] = { +- "P1", /* pbm ... 1 band 1 bit, ascii */ +- "P2", /* pgm ... 1 band many bit, ascii */ +- "P3", /* ppm ... 3 band many bit, ascii */ +- "P4", /* pbm ... 1 band 1 bit, binary */ +- "P5", /* pgm ... 1 band 8 bit, binary */ +- "P6", /* ppm ... 3 band 8 bit, binary */ +- "PF", /* pfm ... 3 band 32 bit, binary */ +- "Pf" /* pfm ... 1 band 32 bit, binary */ ++ "P1", /* pbm ... 1 band 1 bit, ascii */ ++ "P2", /* pgm ... 1 band many bit, ascii */ ++ "P3", /* ppm ... 3 band many bit, ascii */ ++ "P4", /* pbm ... 1 band 1 bit, binary */ ++ "P5", /* pgm ... 1 band 8 bit, binary */ ++ "P6", /* ppm ... 3 band 8 bit, binary */ ++ "PF", /* pfm ... 3 band 32 bit, binary */ ++ "Pf" /* pfm ... 1 band 32 bit, binary */ + }; + + /* Shared with ppmsave. + */ +-const char *vips__ppm_suffs[] = { +- ".pbm", ".pgm", ".ppm", ".pfm", ".pnm", NULL ++const char *vips__ppm_suffs[] = { ++ ".pbm", ".pgm", ".ppm", ".pfm", ".pnm", NULL + }; + const char *vips__save_pbm_suffs[] = { ".pbm", NULL }; + const char *vips__save_pgm_suffs[] = { ".pgm", NULL }; +@@ -151,88 +151,86 @@ const char *vips__save_pfm_suffs[] = { ".pfm", NULL }; + const char *vips__save_pnm_suffs[] = { ".pnm", NULL }; + + static gboolean +-vips_foreign_load_ppm_is_a_source( VipsSource *source ) ++vips_foreign_load_ppm_is_a_source(VipsSource *source) + { + const unsigned char *data; + +- if( (data = vips_source_sniff( source, 2 )) ) { ++ if ((data = vips_source_sniff(source, 2))) { + int i; + +- for( i = 0; i < VIPS_NUMBER( magic_names ); i++ ) +- if( vips_isprefix( magic_names[i], (char *) data ) ) +- return( TRUE ); ++ for (i = 0; i < VIPS_NUMBER(magic_names); i++) ++ if (vips_isprefix(magic_names[i], (char *) data)) ++ return (TRUE); + } + +- return( FALSE ); ++ return (FALSE); + } + + static int +-get_int( VipsSbuf *sbuf, int *i ) ++get_int(VipsSbuf *sbuf, int *i) + { + const char *txt; + +- if( vips_sbuf_skip_whitespace( sbuf ) || +- !(txt = vips_sbuf_get_non_whitespace( sbuf )) ) +- return( -1 ); ++ if (vips_sbuf_skip_whitespace(sbuf) || ++ !(txt = vips_sbuf_get_non_whitespace(sbuf))) ++ return (-1); + +- *i = atoi( txt ); ++ *i = atoi(txt); + +- return( 0 ); ++ return (0); + } + + static int +-get_float( VipsSbuf *sbuf, float *f ) ++get_float(VipsSbuf *sbuf, float *f) + { + const char *txt; + +- if( vips_sbuf_skip_whitespace( sbuf ) || +- !(txt = vips_sbuf_get_non_whitespace( sbuf )) ) +- return( -1 ); ++ if (vips_sbuf_skip_whitespace(sbuf) || ++ !(txt = vips_sbuf_get_non_whitespace(sbuf))) ++ return (-1); + + /* We don't want the locale str -> float conversion. + */ +- *f = g_ascii_strtod( txt, NULL ); ++ *f = g_ascii_strtod(txt, NULL); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_ppm_dispose( GObject *gobject ) ++vips_foreign_load_ppm_dispose(GObject *gobject) + { + VipsForeignLoadPpm *ppm = (VipsForeignLoadPpm *) gobject; + + #ifdef DEBUG +- printf( "vips_foreign_load_ppm_dispose: %p\n", ppm ); ++ printf("vips_foreign_load_ppm_dispose: %p\n", ppm); + #endif /*DEBUG*/ + +- VIPS_UNREF( ppm->sbuf ); +- VIPS_UNREF( ppm->source ); ++ VIPS_UNREF(ppm->sbuf); ++ VIPS_UNREF(ppm->source); + +- G_OBJECT_CLASS( vips_foreign_load_ppm_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_ppm_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_load_ppm_build( VipsObject *object ) ++vips_foreign_load_ppm_build(VipsObject *object) + { + VipsForeignLoadPpm *ppm = (VipsForeignLoadPpm *) object; + +- if( ppm->source ) +- ppm->sbuf = vips_sbuf_new_from_source( ppm->source ); ++ if (ppm->source) ++ ppm->sbuf = vips_sbuf_new_from_source(ppm->source); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_ppm_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_ppm_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Scan the header into our class. + */ + static int +-vips_foreign_load_ppm_parse_header( VipsForeignLoadPpm *ppm ) ++vips_foreign_load_ppm_parse_header(VipsForeignLoadPpm *ppm) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( ppm ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(ppm); + + int i; + char buf[2]; +@@ -249,20 +247,20 @@ vips_foreign_load_ppm_parse_header( VipsForeignLoadPpm *ppm ) + 1, 1, 1, 0, 0, 0, 0, 0 + }; + +- if( vips_source_rewind( ppm->source ) ) +- return( -1 ); ++ if (vips_source_rewind(ppm->source)) ++ return (-1); + + /* Read in the magic number. + */ +- buf[0] = VIPS_SBUF_GETC( ppm->sbuf ); +- buf[1] = VIPS_SBUF_GETC( ppm->sbuf ); ++ buf[0] = VIPS_SBUF_GETC(ppm->sbuf); ++ buf[1] = VIPS_SBUF_GETC(ppm->sbuf); + +- for( i = 0; i < VIPS_NUMBER( magic_names ); i++ ) +- if( vips_isprefix( magic_names[i], buf ) ) ++ for (i = 0; i < VIPS_NUMBER(magic_names); i++) ++ if (vips_isprefix(magic_names[i], buf)) + break; +- if( i == VIPS_NUMBER( magic_names ) ) { +- vips_error( class->nickname, "%s", _( "bad magic number" ) ); +- return( -1 ); ++ if (i == VIPS_NUMBER(magic_names)) { ++ vips_error(class->nickname, "%s", _("bad magic number")); ++ return (-1); + } + ppm->index = i; + ppm->bits = lookup_bits[i]; +@@ -275,35 +273,35 @@ vips_foreign_load_ppm_parse_header( VipsForeignLoadPpm *ppm ) + + /* Read in size. + */ +- if( get_int( ppm->sbuf, &ppm->width ) || +- get_int( ppm->sbuf, &ppm->height ) ) +- return( -1 ); ++ if (get_int(ppm->sbuf, &ppm->width) || ++ get_int(ppm->sbuf, &ppm->height)) ++ return (-1); + + /* Read in max value / scale for >1 bit images. + */ +- if( ppm->bits > 1 ) { +- if( ppm->index == 6 || +- ppm->index == 7 ) { +- if( get_float( ppm->sbuf, &ppm->scale ) ) +- return( -1 ); ++ if (ppm->bits > 1) { ++ if (ppm->index == 6 || ++ ppm->index == 7) { ++ if (get_float(ppm->sbuf, &ppm->scale)) ++ return (-1); + + /* Scale > 0 means big-endian. + */ + ppm->msb_first = ppm->scale > 0; + } + else { +- if( get_int( ppm->sbuf, &ppm->max_value ) ) +- return( -1 ); ++ if (get_int(ppm->sbuf, &ppm->max_value)) ++ return (-1); + + /* max_value must be > 0 and <= 65535, according to + * the spec, but we allow up to 32 bits per pixel. + */ +- if( ppm->max_value < 0 ) ++ if (ppm->max_value < 0) + ppm->max_value = 0; + +- if( ppm->max_value > 255 ) ++ if (ppm->max_value > 255) + ppm->bits = 16; +- if( ppm->max_value > 65535 ) ++ if (ppm->max_value > 65535) + ppm->bits = 32; + } + } +@@ -311,16 +309,16 @@ vips_foreign_load_ppm_parse_header( VipsForeignLoadPpm *ppm ) + /* For binary images, there is always exactly 1 more whitespace + * character before the data starts. + */ +- if( !ppm->ascii && +- !isspace( VIPS_SBUF_GETC( ppm->sbuf ) ) ) { +- vips_error( class->nickname, "%s", +- _( "no whitespace before start of binary data" ) ); +- return( -1 ); ++ if (!ppm->ascii && ++ !isspace(VIPS_SBUF_GETC(ppm->sbuf))) { ++ vips_error(class->nickname, "%s", ++ _("no whitespace before start of binary data")); ++ return (-1); + } + + /* Choose a VIPS bandfmt. + */ +- switch( ppm->bits ) { ++ switch (ppm->bits) { + case 1: + case 8: + ppm->format = VIPS_FORMAT_UCHAR; +@@ -331,8 +329,8 @@ vips_foreign_load_ppm_parse_header( VipsForeignLoadPpm *ppm ) + break; + + case 32: +- if( ppm->index == 6 || +- ppm->index == 7 ) ++ if (ppm->index == 6 || ++ ppm->index == 7) + ppm->format = VIPS_FORMAT_FLOAT; + else + ppm->format = VIPS_FORMAT_UINT; +@@ -346,44 +344,44 @@ vips_foreign_load_ppm_parse_header( VipsForeignLoadPpm *ppm ) + ppm->format = VIPS_FORMAT_UCHAR; + } + +- if( ppm->bands == 1 ) { +- if( ppm->format == VIPS_FORMAT_USHORT ) ++ if (ppm->bands == 1) { ++ if (ppm->format == VIPS_FORMAT_USHORT) + ppm->interpretation = VIPS_INTERPRETATION_GREY16; + else + ppm->interpretation = VIPS_INTERPRETATION_B_W; + } + else { +- if( ppm->format == VIPS_FORMAT_USHORT ) ++ if (ppm->format == VIPS_FORMAT_USHORT) + ppm->interpretation = VIPS_INTERPRETATION_RGB16; +- else ++ else + ppm->interpretation = VIPS_INTERPRETATION_sRGB; + } + + ppm->have_read_header = TRUE; + + #ifdef DEBUG +- printf( "vips_foreign_load_ppm_parse_header:\n" ); +- printf( "\twidth = %d\n", ppm->width ); +- printf( "\theight = %d\n", ppm->height ); +- printf( "\tbands = %d\n", ppm->bands ); +- printf( "\tformat = %s\n", +- vips_enum_nick( VIPS_TYPE_BAND_FORMAT, +- ppm->format ) ); +- printf( "\tinterpretation = %s\n", +- vips_enum_nick( VIPS_TYPE_INTERPRETATION, +- ppm->interpretation ) ); +- printf( "\tscale = %g\n", ppm->scale ); +- printf( "\tmax_value = %d\n", ppm->max_value ); +- printf( "\tbits = %d\n", ppm->bits ); +- printf( "\tacsii = %d\n", ppm->ascii ); +- printf( "\tmsb_first = %d\n", ppm->msb_first ); ++ printf("vips_foreign_load_ppm_parse_header:\n"); ++ printf("\twidth = %d\n", ppm->width); ++ printf("\theight = %d\n", ppm->height); ++ printf("\tbands = %d\n", ppm->bands); ++ printf("\tformat = %s\n", ++ vips_enum_nick(VIPS_TYPE_BAND_FORMAT, ++ ppm->format)); ++ printf("\tinterpretation = %s\n", ++ vips_enum_nick(VIPS_TYPE_INTERPRETATION, ++ ppm->interpretation)); ++ printf("\tscale = %g\n", ppm->scale); ++ printf("\tmax_value = %d\n", ppm->max_value); ++ printf("\tbits = %d\n", ppm->bits); ++ printf("\tacsii = %d\n", ppm->ascii); ++ printf("\tmsb_first = %d\n", ppm->msb_first); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + static VipsForeignFlags +-vips_foreign_load_ppm_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_ppm_get_flags(VipsForeignLoad *load) + { + VipsForeignLoadPpm *ppm = (VipsForeignLoadPpm *) load; + +@@ -395,79 +393,78 @@ vips_foreign_load_ppm_get_flags( VipsForeignLoad *load ) + * then we can mmap the file and support partial load. Otherwise, + * it's sequential. + */ +- if( !ppm->have_read_header && +- vips_foreign_load_ppm_parse_header( ppm ) ) +- return( 0 ); +- if( vips_source_is_mappable( ppm->source ) && +- !ppm->ascii && +- ppm->bits >= 8 ) ++ if (!ppm->have_read_header && ++ vips_foreign_load_ppm_parse_header(ppm)) ++ return (0); ++ if (vips_source_is_mappable(ppm->source) && ++ !ppm->ascii && ++ ppm->bits >= 8) + flags |= VIPS_FOREIGN_PARTIAL; + else + flags |= VIPS_FOREIGN_SEQUENTIAL; + +- return( flags ); ++ return (flags); + } + + static void +-vips_foreign_load_ppm_set_image_metadata( VipsForeignLoadPpm *ppm, +- VipsImage *image ) ++vips_foreign_load_ppm_set_image_metadata(VipsForeignLoadPpm *ppm, ++ VipsImage *image) + { + image->Type = ppm->interpretation; + +- if( ppm->index == 6 || +- ppm->index == 7 ) +- vips_image_set_double( image, +- "pfm-scale", VIPS_FABS( ppm->scale ) ); ++ if (ppm->index == 6 || ++ ppm->index == 7) ++ vips_image_set_double(image, ++ "pfm-scale", VIPS_FABS(ppm->scale)); + else +- vips_image_set_double( image, +- "ppm-max-value", VIPS_ABS( ppm->max_value ) ); ++ vips_image_set_double(image, ++ "ppm-max-value", VIPS_ABS(ppm->max_value)); + +- VIPS_SETSTR( image->filename, vips_connection_filename( +- VIPS_CONNECTION( ppm->sbuf->source ) ) ); ++ VIPS_SETSTR(image->filename, vips_connection_filename(VIPS_CONNECTION(ppm->sbuf->source))); + + #ifdef DEBUG +- printf( "vips_foreign_load_ppm_set_image: " ); +- vips_object_print_summary( VIPS_OBJECT( image ) ); ++ printf("vips_foreign_load_ppm_set_image: "); ++ vips_object_print_summary(VIPS_OBJECT(image)); + #endif /*DEBUG*/ + } + + static void +-vips_foreign_load_ppm_set_image( VipsForeignLoadPpm *ppm, VipsImage *image ) ++vips_foreign_load_ppm_set_image(VipsForeignLoadPpm *ppm, VipsImage *image) + { +- vips_image_init_fields( image, +- ppm->width, ppm->height, ppm->bands, ppm->format, +- VIPS_CODING_NONE, ppm->interpretation, 1.0, 1.0 ); ++ vips_image_init_fields(image, ++ ppm->width, ppm->height, ppm->bands, ppm->format, ++ VIPS_CODING_NONE, ppm->interpretation, 1.0, 1.0); + +- (void) vips_image_pipelinev( image, VIPS_DEMAND_STYLE_THINSTRIP, NULL ); ++ (void) vips_image_pipelinev(image, VIPS_DEMAND_STYLE_THINSTRIP, NULL); + +- vips_foreign_load_ppm_set_image_metadata( ppm, image ); ++ vips_foreign_load_ppm_set_image_metadata(ppm, image); + + #ifdef DEBUG +- printf( "vips_foreign_load_ppm_set_image: " ); +- vips_object_print_summary( VIPS_OBJECT( image ) ); ++ printf("vips_foreign_load_ppm_set_image: "); ++ vips_object_print_summary(VIPS_OBJECT(image)); + #endif /*DEBUG*/ + } + + static int +-vips_foreign_load_ppm_header( VipsForeignLoad *load ) ++vips_foreign_load_ppm_header(VipsForeignLoad *load) + { + VipsForeignLoadPpm *ppm = (VipsForeignLoadPpm *) load; + +- if( !ppm->have_read_header && +- vips_foreign_load_ppm_parse_header( ppm ) ) +- return( 0 ); ++ if (!ppm->have_read_header && ++ vips_foreign_load_ppm_parse_header(ppm)) ++ return (0); + +- vips_foreign_load_ppm_set_image( ppm, load->out ); ++ vips_foreign_load_ppm_set_image(ppm, load->out); + +- vips_source_minimise( ppm->source ); ++ vips_source_minimise(ppm->source); + +- return( 0 ); ++ return (0); + } + + /* Read a ppm/pgm file using mmap(). + */ + static VipsImage * +-vips_foreign_load_ppm_map( VipsForeignLoadPpm *ppm ) ++vips_foreign_load_ppm_map(VipsForeignLoadPpm *ppm) + { + gint64 header_offset; + size_t length; +@@ -475,56 +472,56 @@ vips_foreign_load_ppm_map( VipsForeignLoadPpm *ppm ) + VipsImage *out; + + #ifdef DEBUG +- printf( "vips_foreign_load_ppm_map:\n" ); ++ printf("vips_foreign_load_ppm_map:\n"); + #endif /*DEBUG*/ + +- vips_sbuf_unbuffer( ppm->sbuf ); +- header_offset = vips_source_seek( ppm->source, 0, SEEK_CUR ); +- data = vips_source_map( ppm->source, &length ); +- if( header_offset < 0 || +- !data ) +- return( NULL ); ++ vips_sbuf_unbuffer(ppm->sbuf); ++ header_offset = vips_source_seek(ppm->source, 0, SEEK_CUR); ++ data = vips_source_map(ppm->source, &length); ++ if (header_offset < 0 || ++ !data) ++ return (NULL); + data += header_offset; +- length -= header_offset; ++ length -= header_offset; + +- if( !(out = vips_image_new_from_memory( data, length, +- ppm->width, ppm->height, ppm->bands, ppm->format )) ) +- return( NULL ); ++ if (!(out = vips_image_new_from_memory(data, length, ++ ppm->width, ppm->height, ppm->bands, ppm->format))) ++ return (NULL); + +- vips_foreign_load_ppm_set_image_metadata( ppm, out ); ++ vips_foreign_load_ppm_set_image_metadata(ppm, out); + +- return( out ); ++ return (out); + } + + static int +-vips_foreign_load_ppm_generate_binary( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_foreign_load_ppm_generate_binary(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsForeignLoadPpm *ppm = (VipsForeignLoadPpm *) a; +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( ppm ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(ppm); + VipsImage *image = or->im; +- size_t sizeof_line = VIPS_IMAGE_SIZEOF_LINE( image ); ++ size_t sizeof_line = VIPS_IMAGE_SIZEOF_LINE(image); + + int y; + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *q = VIPS_REGION_ADDR( or, 0, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *q = VIPS_REGION_ADDR(or, 0, r->top + y); + + size_t n_bytes; + + n_bytes = sizeof_line; +- while( n_bytes > 0 ) { ++ while (n_bytes > 0) { + gint64 bytes_read; + +- bytes_read = +- vips_source_read( ppm->source, q, n_bytes ); +- if( bytes_read < 0 ) +- return( -1 ); +- if( bytes_read == 0 ) { +- vips_error( class->nickname, +- "%s", _( "file truncated" ) ); +- return( -1 ); ++ bytes_read = ++ vips_source_read(ppm->source, q, n_bytes); ++ if (bytes_read < 0) ++ return (-1); ++ if (bytes_read == 0) { ++ vips_error(class->nickname, ++ "%s", _("file truncated")); ++ return (-1); + } + + q += bytes_read; +@@ -532,50 +529,50 @@ vips_foreign_load_ppm_generate_binary( VipsRegion *or, + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_ppm_generate_1bit_ascii( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_foreign_load_ppm_generate_1bit_ascii(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsForeignLoadPpm *ppm = (VipsForeignLoadPpm *) a; + VipsImage *image = or->im; + + int x, y; + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *q = VIPS_REGION_ADDR( or, 0, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *q = VIPS_REGION_ADDR(or, 0, r->top + y); + +- for( x = 0; x < image->Xsize; x++ ) { ++ for (x = 0; x < image->Xsize; x++) { + int val; + +- if( get_int( ppm->sbuf, &val ) ) +- return( -1 ); ++ if (get_int(ppm->sbuf, &val)) ++ return (-1); + +- if( val ) ++ if (val) + q[x] = 0; + else + q[x] = 255; + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_ppm_generate_1bit_binary( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_foreign_load_ppm_generate_1bit_binary(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsForeignLoadPpm *ppm = (VipsForeignLoadPpm *) a; + VipsImage *image = or->im; + + int x, y; + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *q = VIPS_REGION_ADDR( or, 0, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *q = VIPS_REGION_ADDR(or, 0, r->top + y); + + int bits; + +@@ -583,45 +580,45 @@ vips_foreign_load_ppm_generate_1bit_binary( VipsRegion *or, + */ + bits = 0; + +- for( x = 0; x < image->Xsize; x++ ) { +- if( (x & 7) == 0 ) +- bits = VIPS_SBUF_GETC( ppm->sbuf ); ++ for (x = 0; x < image->Xsize; x++) { ++ if ((x & 7) == 0) ++ bits = VIPS_SBUF_GETC(ppm->sbuf); + q[x] = (bits & 128) ? 0 : 255; +- bits = VIPS_LSHIFT_INT( bits, 1 ); ++ bits = VIPS_LSHIFT_INT(bits, 1); + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_ppm_generate_ascii_int( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_foreign_load_ppm_generate_ascii_int(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsForeignLoadPpm *ppm = (VipsForeignLoadPpm *) a; + VipsImage *image = or->im; + int n_elements = image->Xsize * image->Bands; + + int i, y; + +- for( y = 0; y < r->height; y++ ) { +- VipsPel *q = VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *q = VIPS_REGION_ADDR(or, r->left, r->top + y); + +- for( i = 0; i < n_elements; i++ ) { ++ for (i = 0; i < n_elements; i++) { + int val; + +- if( get_int( ppm->sbuf, &val ) ) +- return( -1 ); +- +- switch( image->BandFmt ) { ++ if (get_int(ppm->sbuf, &val)) ++ return (-1); ++ ++ switch (image->BandFmt) { + case VIPS_FORMAT_UCHAR: +- q[i] = VIPS_CLIP( 0, val, 255 ); ++ q[i] = VIPS_CLIP(0, val, 255); + break; + + case VIPS_FORMAT_USHORT: +- ((unsigned short *) q)[i] = +- VIPS_CLIP( 0, val, 65535 ); ++ ((unsigned short *) q)[i] = ++ VIPS_CLIP(0, val, 65535); + break; + + case VIPS_FORMAT_UINT: +@@ -634,112 +631,112 @@ vips_foreign_load_ppm_generate_ascii_int( VipsRegion *or, + } + } + +- return( 0 ); ++ return (0); + } + + static VipsImage * +-vips_foreign_load_ppm_scan( VipsForeignLoadPpm *ppm ) ++vips_foreign_load_ppm_scan(VipsForeignLoadPpm *ppm) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( ppm ), 2 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(ppm), 2); + + VipsImage *out; + VipsGenerateFn generate; + + /* What sort of read are we doing? + */ +- if( !ppm->ascii && ppm->bits >= 8 ) { ++ if (!ppm->ascii && ppm->bits >= 8) { + #ifdef DEBUG +- printf( "vips_foreign_load_ppm_source: >1 bit binary load\n" ); ++ printf("vips_foreign_load_ppm_source: >1 bit binary load\n"); + #endif /*DEBUG*/ + + generate = vips_foreign_load_ppm_generate_binary; + +- /* The binary loader does not use the buffered IO ++ /* The binary loader does not use the buffered IO + * object. + */ +- vips_sbuf_unbuffer( ppm->sbuf ); ++ vips_sbuf_unbuffer(ppm->sbuf); + } +- else if( !ppm->ascii && ppm->bits == 1 ) { ++ else if (!ppm->ascii && ppm->bits == 1) { + #ifdef DEBUG +- printf( "vips_foreign_load_ppm_source: 1-bit binary load\n" ); ++ printf("vips_foreign_load_ppm_source: 1-bit binary load\n"); + #endif /*DEBUG*/ + + generate = vips_foreign_load_ppm_generate_1bit_binary; + } +- else if( ppm->ascii && ppm->bits == 1 ) { ++ else if (ppm->ascii && ppm->bits == 1) { + #ifdef DEBUG +- printf( "vips_foreign_load_ppm_source: 1-bit ascii load\n" ); ++ printf("vips_foreign_load_ppm_source: 1-bit ascii load\n"); + #endif /*DEBUG*/ + + generate = vips_foreign_load_ppm_generate_1bit_ascii; + } + else { + #ifdef DEBUG +- printf( "vips_foreign_load_ppm_source: >1-bit ascii load\n" ); ++ printf("vips_foreign_load_ppm_source: >1-bit ascii load\n"); + #endif /*DEBUG*/ + + generate = vips_foreign_load_ppm_generate_ascii_int; + } + +- t[0] = vips_image_new(); +- vips_foreign_load_ppm_set_image( ppm, t[0] ); +- if( vips_image_generate( t[0], NULL, generate, NULL, ppm, NULL ) || +- vips_sequential( t[0], &out, NULL ) ) +- return( NULL ); ++ t[0] = vips_image_new(); ++ vips_foreign_load_ppm_set_image(ppm, t[0]); ++ if (vips_image_generate(t[0], NULL, generate, NULL, ppm, NULL) || ++ vips_sequential(t[0], &out, NULL)) ++ return (NULL); + +- return( out ); ++ return (out); + } + + static int +-vips_foreign_load_ppm_load( VipsForeignLoad *load ) ++vips_foreign_load_ppm_load(VipsForeignLoad *load) + { + VipsForeignLoadPpm *ppm = (VipsForeignLoadPpm *) load; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( (VipsObject *) load, 2 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array((VipsObject *) load, 2); + +- if( !ppm->have_read_header && +- vips_foreign_load_ppm_parse_header( ppm ) ) +- return( 0 ); ++ if (!ppm->have_read_header && ++ vips_foreign_load_ppm_parse_header(ppm)) ++ return (0); + + /* If the source is mappable and this is a binary file, we can map it. + */ +- if( vips_source_is_mappable( ppm->source ) && +- !ppm->ascii && +- ppm->bits >= 8 ) { +- if( !(t[0] = vips_foreign_load_ppm_map( ppm )) ) +- return( -1 ); ++ if (vips_source_is_mappable(ppm->source) && ++ !ppm->ascii && ++ ppm->bits >= 8) { ++ if (!(t[0] = vips_foreign_load_ppm_map(ppm))) ++ return (-1); + } + else { +- if( !(t[0] = vips_foreign_load_ppm_scan( ppm )) ) +- return( -1 ); ++ if (!(t[0] = vips_foreign_load_ppm_scan(ppm))) ++ return (-1); + } + + #ifdef DEBUG +- printf( "vips_foreign_load_ppm: byteswap = %d\n", +- vips_amiMSBfirst() != ppm->msb_first ); ++ printf("vips_foreign_load_ppm: byteswap = %d\n", ++ vips_amiMSBfirst() != ppm->msb_first); + #endif /*DEBUG*/ + + /* Don't byteswap the ascii formats. + */ +- if( vips__byteswap_bool( t[0], &t[1], ++ if (vips__byteswap_bool(t[0], &t[1], + !ppm->ascii && +- vips_amiMSBfirst() != ppm->msb_first ) || +- vips_image_write( t[1], load->real ) ) +- return( -1 ); ++ vips_amiMSBfirst() != ppm->msb_first) || ++ vips_image_write(t[1], load->real)) ++ return (-1); + +- if( vips_source_decode( ppm->source ) ) +- return( -1 ); ++ if (vips_source_decode(ppm->source)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_ppm_class_init( VipsForeignLoadPpmClass *class ) ++vips_foreign_load_ppm_class_init(VipsForeignLoadPpmClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -748,7 +745,7 @@ vips_foreign_load_ppm_class_init( VipsForeignLoadPpmClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "ppmload_base"; +- object_class->description = _( "load ppm base class" ); ++ object_class->description = _("load ppm base class"); + object_class->build = vips_foreign_load_ppm_build; + + /* You're unlikely to want to use this on untrusted files. +@@ -764,11 +761,10 @@ vips_foreign_load_ppm_class_init( VipsForeignLoadPpmClass *class ) + load_class->get_flags = vips_foreign_load_ppm_get_flags; + load_class->header = vips_foreign_load_ppm_header; + load_class->load = vips_foreign_load_ppm_load; +- + } + + static void +-vips_foreign_load_ppm_init( VipsForeignLoadPpm *ppm ) ++vips_foreign_load_ppm_init(VipsForeignLoadPpm *ppm) + { + ppm->scale = 1.0; + } +@@ -782,44 +778,43 @@ typedef struct _VipsForeignLoadPpmFile { + + typedef VipsForeignLoadPpmClass VipsForeignLoadPpmFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadPpmFile, vips_foreign_load_ppm_file, +- vips_foreign_load_ppm_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadPpmFile, vips_foreign_load_ppm_file, ++ vips_foreign_load_ppm_get_type()); + + static gboolean +-vips_foreign_load_ppm_file_is_a( const char *filename ) ++vips_foreign_load_ppm_file_is_a(const char *filename) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( FALSE ); +- result = vips_foreign_load_ppm_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (FALSE); ++ result = vips_foreign_load_ppm_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static int +-vips_foreign_load_ppm_file_build( VipsObject *object ) ++vips_foreign_load_ppm_file_build(VipsObject *object) + { + VipsForeignLoadPpmFile *file = (VipsForeignLoadPpmFile *) object; + VipsForeignLoadPpm *ppm = (VipsForeignLoadPpm *) object; + +- if( file->filename && +- !(ppm->source = vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(ppm->source = vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_ppm_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_ppm_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_ppm_file_class_init( VipsForeignLoadPpmClass *class ) ++vips_foreign_load_ppm_file_class_init(VipsForeignLoadPpmClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -827,21 +822,21 @@ vips_foreign_load_ppm_file_class_init( VipsForeignLoadPpmClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "ppmload"; +- object_class->description = _( "load ppm from file" ); ++ object_class->description = _("load ppm from file"); + object_class->build = vips_foreign_load_ppm_file_build; + + load_class->is_a = vips_foreign_load_ppm_file_is_a; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPpmFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadPpmFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_ppm_file_init( VipsForeignLoadPpmFile *file ) ++vips_foreign_load_ppm_file_init(VipsForeignLoadPpmFile *file) + { + } + +@@ -854,33 +849,32 @@ typedef struct _VipsForeignLoadPpmSource { + + typedef VipsForeignLoadPpmClass VipsForeignLoadPpmSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadPpmSource, vips_foreign_load_ppm_source, +- vips_foreign_load_ppm_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadPpmSource, vips_foreign_load_ppm_source, ++ vips_foreign_load_ppm_get_type()); + + static int +-vips_foreign_load_ppm_source_build( VipsObject *object ) ++vips_foreign_load_ppm_source_build(VipsObject *object) + { + VipsForeignLoadPpm *ppm = (VipsForeignLoadPpm *) object; + VipsForeignLoadPpmSource *source = (VipsForeignLoadPpmSource *) object; + +- if( source->source ) { ++ if (source->source) { + ppm->source = source->source; +- g_object_ref( ppm->source ); ++ g_object_ref(ppm->source); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_ppm_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_ppm_source_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_ppm_source_class_init( VipsForeignLoadPpmFileClass *class ) ++vips_foreign_load_ppm_source_class_init(VipsForeignLoadPpmFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -893,17 +887,16 @@ vips_foreign_load_ppm_source_class_init( VipsForeignLoadPpmFileClass *class ) + + load_class->is_a_source = vips_foreign_load_ppm_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPpmSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadPpmSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_ppm_source_init( VipsForeignLoadPpmSource *source ) ++vips_foreign_load_ppm_source_init(VipsForeignLoadPpmSource *source) + { + } + +@@ -915,10 +908,10 @@ vips_foreign_load_ppm_source_init( VipsForeignLoadPpmSource *source ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Read a PPM/PBM/PGM/PFM file into a VIPS image. ++ * Read a PPM/PBM/PGM/PFM file into a VIPS image. + * + * It can read 1, 8, 16 and 32 bit images, colour or monochrome, +- * stored in binary or in ASCII. One bit images become 8 bit VIPS images, ++ * stored in binary or in ASCII. One bit images become 8 bit VIPS images, + * with 0 and 255 for 0 and 1. + * + * See also: vips_image_new_from_file(). +@@ -926,16 +919,16 @@ vips_foreign_load_ppm_source_init( VipsForeignLoadPpmSource *source ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_ppmload( const char *filename, VipsImage **out, ... ) ++vips_ppmload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "ppmload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("ppmload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -952,21 +945,21 @@ vips_ppmload( const char *filename, VipsImage **out, ... ) + * * @separator: set of separator characters + * * @fail: %gboolean, fail on errors + * +- * Exactly as vips_ppmload(), but read from a source. ++ * Exactly as vips_ppmload(), but read from a source. + * + * See also: vips_ppmload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_ppmload_source( VipsSource *source, VipsImage **out, ... ) ++vips_ppmload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "ppmload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("ppmload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/ppmsave.c b/libvips/foreign/ppmsave.c +index 2f66956fbc..173adfb2ae 100644 +--- a/libvips/foreign/ppmsave.c ++++ b/libvips/foreign/ppmsave.c +@@ -20,28 +20,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -68,7 +68,7 @@ + + typedef struct _VipsForeignSavePpm VipsForeignSavePpm; + +-typedef int (*VipsSavePpmFn)( VipsForeignSavePpm *, VipsImage *, VipsPel * ); ++typedef int (*VipsSavePpmFn)(VipsForeignSavePpm *, VipsImage *, VipsPel *); + + struct _VipsForeignSavePpm { + VipsForeignSave parent_object; +@@ -87,43 +87,42 @@ struct _VipsForeignSavePpm { + + typedef VipsForeignSaveClass VipsForeignSavePpmClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSavePpm, vips_foreign_save_ppm, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSavePpm, vips_foreign_save_ppm, ++ VIPS_TYPE_FOREIGN_SAVE); + + static void +-vips_foreign_save_ppm_dispose( GObject *gobject ) ++vips_foreign_save_ppm_dispose(GObject *gobject) + { + VipsForeignSavePpm *ppm = (VipsForeignSavePpm *) gobject; + +- VIPS_UNREF( ppm->target ); ++ VIPS_UNREF(ppm->target); + +- G_OBJECT_CLASS( vips_foreign_save_ppm_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_ppm_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_save_ppm_line_ascii( VipsForeignSavePpm *ppm, +- VipsImage *image, VipsPel *p ) ++vips_foreign_save_ppm_line_ascii(VipsForeignSavePpm *ppm, ++ VipsImage *image, VipsPel *p) + { + const int n_elements = image->Xsize * image->Bands; + + int i; + +- for( i = 0; i < n_elements; i++ ) { +- switch( image->BandFmt ) { ++ for (i = 0; i < n_elements; i++) { ++ switch (image->BandFmt) { + case VIPS_FORMAT_UCHAR: +- vips_target_writef( ppm->target, +- "%d ", p[i] ); ++ vips_target_writef(ppm->target, ++ "%d ", p[i]); + break; + + case VIPS_FORMAT_USHORT: +- vips_target_writef( ppm->target, +- "%d ", ((unsigned short *) p)[i] ); ++ vips_target_writef(ppm->target, ++ "%d ", ((unsigned short *) p)[i]); + break; + + case VIPS_FORMAT_UINT: +- vips_target_writef( ppm->target, +- "%d ", ((unsigned int *) p)[i] ); ++ vips_target_writef(ppm->target, ++ "%d ", ((unsigned int *) p)[i]); + break; + + default: +@@ -131,41 +130,41 @@ vips_foreign_save_ppm_line_ascii( VipsForeignSavePpm *ppm, + } + } + +- if( vips_target_writes( ppm->target, "\n" ) ) +- return( -1 ); ++ if (vips_target_writes(ppm->target, "\n")) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_ppm_line_ascii_1bit( VipsForeignSavePpm *ppm, +- VipsImage *image, VipsPel *p ) ++vips_foreign_save_ppm_line_ascii_1bit(VipsForeignSavePpm *ppm, ++ VipsImage *image, VipsPel *p) + { + int x; + +- for( x = 0; x < image->Xsize; x++ ) +- vips_target_writef( ppm->target, "%d ", p[x] ? 0 : 1 ); ++ for (x = 0; x < image->Xsize; x++) ++ vips_target_writef(ppm->target, "%d ", p[x] ? 0 : 1); + +- if( vips_target_writes( ppm->target, "\n" ) ) +- return( -1 ); ++ if (vips_target_writes(ppm->target, "\n")) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_ppm_line_binary( VipsForeignSavePpm *ppm, +- VipsImage *image, VipsPel *p ) ++vips_foreign_save_ppm_line_binary(VipsForeignSavePpm *ppm, ++ VipsImage *image, VipsPel *p) + { +- if( vips_target_write( ppm->target, +- p, VIPS_IMAGE_SIZEOF_LINE( image ) ) ) +- return( -1 ); ++ if (vips_target_write(ppm->target, ++ p, VIPS_IMAGE_SIZEOF_LINE(image))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_ppm_line_binary_1bit( VipsForeignSavePpm *ppm, +- VipsImage *image, VipsPel *p ) ++vips_foreign_save_ppm_line_binary_1bit(VipsForeignSavePpm *ppm, ++ VipsImage *image, VipsPel *p) + { + int x; + int bits; +@@ -173,14 +172,14 @@ vips_foreign_save_ppm_line_binary_1bit( VipsForeignSavePpm *ppm, + + bits = 0; + n_bits = 0; +- for( x = 0; x < image->Xsize; x++ ) { +- bits = VIPS_LSHIFT_INT( bits, 1 ); ++ for (x = 0; x < image->Xsize; x++) { ++ bits = VIPS_LSHIFT_INT(bits, 1); + n_bits += 1; + bits |= p[x] > 128 ? 0 : 1; + +- if( n_bits == 8 ) { +- if( VIPS_TARGET_PUTC( ppm->target, bits ) ) +- return( -1 ); ++ if (n_bits == 8) { ++ if (VIPS_TARGET_PUTC(ppm->target, bits)) ++ return (-1); + + bits = 0; + n_bits = 0; +@@ -189,37 +188,37 @@ vips_foreign_save_ppm_line_binary_1bit( VipsForeignSavePpm *ppm, + + /* Flush any remaining bits in this line. + */ +- if( n_bits && +- VIPS_TARGET_PUTC( ppm->target, bits ) ) +- return( -1 ); ++ if (n_bits && ++ VIPS_TARGET_PUTC(ppm->target, bits)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_ppm_block( VipsRegion *region, VipsRect *area, void *a ) ++vips_foreign_save_ppm_block(VipsRegion *region, VipsRect *area, void *a) + { + VipsForeignSavePpm *ppm = (VipsForeignSavePpm *) a; + VipsImage *image = region->im; + + int y; + +- for( y = 0; y < area->height; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( region, 0, area->top + y ); ++ for (y = 0; y < area->height; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(region, 0, area->top + y); + +- if( ppm->fn( ppm, image, p ) ) +- return( -1 ); ++ if (ppm->fn(ppm, image, p)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_ppm_build( VipsObject *object ) ++vips_foreign_save_ppm_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSavePpm *ppm = (VipsForeignSavePpm *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + + VipsImage *image; + char *magic; +@@ -227,9 +226,8 @@ vips_foreign_save_ppm_build( VipsObject *object ) + VipsBandFormat target_format; + VipsInterpretation target_interpretation; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_ppm_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_ppm_parent_class)->build(object)) ++ return (-1); + + image = save->ready; + target_format = image->BandFmt; +@@ -243,22 +241,22 @@ vips_foreign_save_ppm_build( VipsObject *object ) + * pfm ... 1 or 3 bands, 32 bit + * pnm ... pick from input + */ +- switch( ppm->format ) { ++ switch (ppm->format) { + case VIPS_FOREIGN_PPM_FORMAT_PBM: +- if( !vips_object_argument_isset( object, "bitdepth" ) ) ++ if (!vips_object_argument_isset(object, "bitdepth")) + ppm->bitdepth = 1; + target_interpretation = VIPS_INTERPRETATION_B_W; + break; + + case VIPS_FOREIGN_PPM_FORMAT_PGM: +- if( target_format == VIPS_FORMAT_USHORT ) ++ if (target_format == VIPS_FORMAT_USHORT) + target_interpretation = VIPS_INTERPRETATION_GREY16; + else + target_interpretation = VIPS_INTERPRETATION_B_W; + break; + + case VIPS_FOREIGN_PPM_FORMAT_PPM: +- if( target_format == VIPS_FORMAT_USHORT ) ++ if (target_format == VIPS_FORMAT_USHORT) + target_interpretation = VIPS_INTERPRETATION_RGB16; + else + target_interpretation = VIPS_INTERPRETATION_sRGB; +@@ -275,160 +273,154 @@ vips_foreign_save_ppm_build( VipsObject *object ) + break; + } + +- if( vips_cast( image, &t[0], target_format, NULL ) ) +- return( -1 ); ++ if (vips_cast(image, &t[0], target_format, NULL)) ++ return (-1); + image = t[0]; + +- if( image->Type != target_interpretation ) { +- if( vips_colourspace( image, &t[1], +- target_interpretation, NULL ) ) +- return( -1 ); ++ if (image->Type != target_interpretation) { ++ if (vips_colourspace(image, &t[1], ++ target_interpretation, NULL)) ++ return (-1); + image = t[1]; + } + +- /* Handle the deprecated squash parameter. ++ /* Handle the deprecated squash parameter. + */ +- if( vips_object_argument_isset( object, "squash" ) ) ++ if (vips_object_argument_isset(object, "squash")) + ppm->bitdepth = 1; + +- if( vips_check_uintorf( "vips2ppm", image ) || +- vips_check_bands_1or3( "vips2ppm", image ) || +- vips_check_uncoded( "vips2ppm", image ) || +- vips_image_pio_input( image ) ) +- return( -1 ); ++ if (vips_check_uintorf("vips2ppm", image) || ++ vips_check_bands_1or3("vips2ppm", image) || ++ vips_check_uncoded("vips2ppm", image) || ++ vips_image_pio_input(image)) ++ return (-1); + +- if( ppm->ascii && +- image->BandFmt == VIPS_FORMAT_FLOAT ) { +- g_warning( "%s", +- _( "float images must be binary -- disabling ascii" ) ); ++ if (ppm->ascii && ++ image->BandFmt == VIPS_FORMAT_FLOAT) { ++ g_warning("%s", ++ _("float images must be binary -- disabling ascii")); + ppm->ascii = FALSE; + } + +- /* One bit images must come from a 8 bit, one band source. ++ /* One bit images must come from a 8 bit, one band source. + */ +- if( ppm->bitdepth && +- (image->Bands != 1 || +- image->BandFmt != VIPS_FORMAT_UCHAR) ) { +- g_warning( "%s", +- _( "can only save 1 band uchar images as 1 bit -- " +- "disabling 1 bit save" ) ); +- ppm->bitdepth = 0; ++ if (ppm->bitdepth && ++ (image->Bands != 1 || ++ image->BandFmt != VIPS_FORMAT_UCHAR)) { ++ g_warning("%s", ++ _("can only save 1 band uchar images as 1 bit -- " ++ "disabling 1 bit save")); ++ ppm->bitdepth = 0; + } + + magic = "unset"; +- if( image->BandFmt == VIPS_FORMAT_FLOAT && +- image->Bands == 3 ) ++ if (image->BandFmt == VIPS_FORMAT_FLOAT && ++ image->Bands == 3) + magic = "PF"; +- else if( image->BandFmt == VIPS_FORMAT_FLOAT && +- image->Bands == 1 ) ++ else if (image->BandFmt == VIPS_FORMAT_FLOAT && ++ image->Bands == 1) + magic = "Pf"; +- else if( image->Bands == 1 && +- ppm->ascii && +- ppm->bitdepth ) ++ else if (image->Bands == 1 && ++ ppm->ascii && ++ ppm->bitdepth) + magic = "P1"; +- else if( image->Bands == 1 && +- ppm->ascii ) ++ else if (image->Bands == 1 && ++ ppm->ascii) + magic = "P2"; +- else if( image->Bands == 1 && +- !ppm->ascii && +- ppm->bitdepth ) ++ else if (image->Bands == 1 && ++ !ppm->ascii && ++ ppm->bitdepth) + magic = "P4"; +- else if( image->Bands == 1 && +- !ppm->ascii ) ++ else if (image->Bands == 1 && ++ !ppm->ascii) + magic = "P5"; +- else if( image->Bands == 3 && +- ppm->ascii ) ++ else if (image->Bands == 3 && ++ ppm->ascii) + magic = "P3"; +- else if( image->Bands == 3 && +- !ppm->ascii ) ++ else if (image->Bands == 3 && ++ !ppm->ascii) + magic = "P6"; + else + g_assert_not_reached(); + +- vips_target_writef( ppm->target, "%s\n", magic ); +- if( !save->strip ) { ++ vips_target_writef(ppm->target, "%s\n", magic); ++ if (!save->strip) { + date = vips__get_iso8601(); +- vips_target_writef( ppm->target, +- "#vips2ppm - %s\n", date ); +- g_free( date ); ++ vips_target_writef(ppm->target, ++ "#vips2ppm - %s\n", date); ++ g_free(date); + } +- vips_target_writef( ppm->target, +- "%d %d\n", image->Xsize, image->Ysize ); ++ vips_target_writef(ppm->target, ++ "%d %d\n", image->Xsize, image->Ysize); + +- if( !ppm->bitdepth ) +- switch( image->BandFmt ) { ++ if (!ppm->bitdepth) ++ switch (image->BandFmt) { + case VIPS_FORMAT_UCHAR: +- vips_target_writef( ppm->target, +- "%d\n", UCHAR_MAX ); ++ vips_target_writef(ppm->target, ++ "%d\n", UCHAR_MAX); + break; + + case VIPS_FORMAT_USHORT: +- vips_target_writef( ppm->target, +- "%d\n", USHRT_MAX ); ++ vips_target_writef(ppm->target, ++ "%d\n", USHRT_MAX); + break; + + case VIPS_FORMAT_UINT: +- vips_target_writef( ppm->target, +- "%d\n", UINT_MAX ); ++ vips_target_writef(ppm->target, ++ "%d\n", UINT_MAX); + break; + +- case VIPS_FORMAT_FLOAT: +-{ ++ case VIPS_FORMAT_FLOAT: { + double scale; + char buf[G_ASCII_DTOSTR_BUF_SIZE]; + + scale = 1; +- if( vips_image_get_typeof( image, "pfm-scale" ) && +- !vips_image_get_double( image, +- "pfm-scale", &scale ) ) ++ if (vips_image_get_typeof(image, "pfm-scale") && ++ !vips_image_get_double(image, ++ "pfm-scale", &scale)) + ; + +- if( !vips_amiMSBfirst() ) ++ if (!vips_amiMSBfirst()) + scale *= -1; + /* Need to be locale independent. + */ +- g_ascii_dtostr( buf, G_ASCII_DTOSTR_BUF_SIZE, scale ); +- vips_target_writes( ppm->target, buf ); +- vips_target_writes( ppm->target, "\n" ); +-} +- break; ++ g_ascii_dtostr(buf, G_ASCII_DTOSTR_BUF_SIZE, scale); ++ vips_target_writes(ppm->target, buf); ++ vips_target_writes(ppm->target, "\n"); ++ } break; + + default: + g_assert_not_reached(); + } + +- if( ppm->bitdepth ) +- ppm->fn = ppm->ascii ? +- vips_foreign_save_ppm_line_ascii_1bit : +- vips_foreign_save_ppm_line_binary_1bit; ++ if (ppm->bitdepth) ++ ppm->fn = ppm->ascii ? vips_foreign_save_ppm_line_ascii_1bit : vips_foreign_save_ppm_line_binary_1bit; + else +- ppm->fn = ppm->ascii ? +- vips_foreign_save_ppm_line_ascii : +- vips_foreign_save_ppm_line_binary; ++ ppm->fn = ppm->ascii ? vips_foreign_save_ppm_line_ascii : vips_foreign_save_ppm_line_binary; + + /* 16 and 32-bit binary write might need byteswapping. + */ +- if( !ppm->ascii && ++ if (!ppm->ascii && + (image->BandFmt == VIPS_FORMAT_USHORT || +- image->BandFmt == VIPS_FORMAT_UINT) ) { ++ image->BandFmt == VIPS_FORMAT_UINT)) { + VipsImage *x; + +- if( vips__byteswap_bool( image, &x, !vips_amiMSBfirst() ) ) +- return( -1 ); ++ if (vips__byteswap_bool(image, &x, !vips_amiMSBfirst())) ++ return (-1); + image = x; + + /* image must now be unreffed on exit. + */ +- vips_object_local( VIPS_OBJECT( ppm->target ), image ); ++ vips_object_local(VIPS_OBJECT(ppm->target), image); + } + +- if( vips_sink_disc( image, vips_foreign_save_ppm_block, ppm ) ) +- return( -1 ); ++ if (vips_sink_disc(image, vips_foreign_save_ppm_block, ppm)) ++ return (-1); + +- if( vips_target_end( ppm->target ) ) +- return( -1 ); ++ if (vips_target_end(ppm->target)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Save a bit of typing. +@@ -450,9 +442,9 @@ static VipsBandFormat bandfmt_ppm[10] = { + }; + + static void +-vips_foreign_save_ppm_class_init( VipsForeignSavePpmClass *class ) ++vips_foreign_save_ppm_class_init(VipsForeignSavePpmClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; + +@@ -461,45 +453,44 @@ vips_foreign_save_ppm_class_init( VipsForeignSavePpmClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "ppmsave_base"; +- object_class->description = _( "save to ppm" ); ++ object_class->description = _("save to ppm"); + object_class->build = vips_foreign_save_ppm_build; + + save_class->saveable = VIPS_SAVEABLE_RGB; + save_class->format_table = bandfmt_ppm; + +- VIPS_ARG_ENUM( class, "format", 2, +- _( "Format" ), +- _( "Format to save in" ), ++ VIPS_ARG_ENUM(class, "format", 2, ++ _("Format"), ++ _("Format to save in"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePpm, format ), +- VIPS_TYPE_FOREIGN_PPM_FORMAT, +- VIPS_FOREIGN_PPM_FORMAT_PPM ); ++ G_STRUCT_OFFSET(VipsForeignSavePpm, format), ++ VIPS_TYPE_FOREIGN_PPM_FORMAT, ++ VIPS_FOREIGN_PPM_FORMAT_PPM); + +- VIPS_ARG_BOOL( class, "ascii", 10, +- _( "ASCII" ), +- _( "Save as ascii" ), ++ VIPS_ARG_BOOL(class, "ascii", 10, ++ _("ASCII"), ++ _("Save as ascii"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePpm, ascii ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSavePpm, ascii), ++ FALSE); + +- VIPS_ARG_INT( class, "bitdepth", 15, +- _( "Bit depth" ), +- _( "Set to 1 to write as a 1 bit image" ), ++ VIPS_ARG_INT(class, "bitdepth", 15, ++ _("Bit depth"), ++ _("Set to 1 to write as a 1 bit image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePpm, bitdepth ), +- 0, 1, 0 ); ++ G_STRUCT_OFFSET(VipsForeignSavePpm, bitdepth), ++ 0, 1, 0); + +- VIPS_ARG_BOOL( class, "squash", 11, +- _( "Squash" ), +- _( "Save as one bit" ), ++ VIPS_ARG_BOOL(class, "squash", 11, ++ _("Squash"), ++ _("Save as one bit"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignSavePpm, squash ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsForeignSavePpm, squash), ++ FALSE); + } + + static void +-vips_foreign_save_ppm_init( VipsForeignSavePpm *ppm ) ++vips_foreign_save_ppm_init(VipsForeignSavePpm *ppm) + { + ppm->format = VIPS_FOREIGN_PPM_FORMAT_PPM; + } +@@ -507,41 +498,40 @@ vips_foreign_save_ppm_init( VipsForeignSavePpm *ppm ) + typedef struct _VipsForeignSavePpmFile { + VipsForeignSavePpm parent_object; + +- char *filename; ++ char *filename; + } VipsForeignSavePpmFile; + + typedef VipsForeignSavePpmClass VipsForeignSavePpmFileClass; + +-G_DEFINE_TYPE( VipsForeignSavePpmFile, vips_foreign_save_ppm_file, +- vips_foreign_save_ppm_get_type() ); ++G_DEFINE_TYPE(VipsForeignSavePpmFile, vips_foreign_save_ppm_file, ++ vips_foreign_save_ppm_get_type()); + + static int +-vips_foreign_save_ppm_file_build( VipsObject *object ) ++vips_foreign_save_ppm_file_build(VipsObject *object) + { + VipsForeignSavePpm *ppm = (VipsForeignSavePpm *) object; + VipsForeignSavePpmFile *file = (VipsForeignSavePpmFile *) object; + +- if( file->filename && +- !(ppm->target = vips_target_new_to_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(ppm->target = vips_target_new_to_file(file->filename))) ++ return (-1); + +- if( vips_iscasepostfix( file->filename, ".pbm" ) ) ++ if (vips_iscasepostfix(file->filename, ".pbm")) + ppm->format = VIPS_FOREIGN_PPM_FORMAT_PBM; +- else if( vips_iscasepostfix( file->filename, ".pgm" ) ) ++ else if (vips_iscasepostfix(file->filename, ".pgm")) + ppm->format = VIPS_FOREIGN_PPM_FORMAT_PGM; +- else if( vips_iscasepostfix( file->filename, ".pfm" ) ) ++ else if (vips_iscasepostfix(file->filename, ".pfm")) + ppm->format = VIPS_FOREIGN_PPM_FORMAT_PFM; +- else if( vips_iscasepostfix( file->filename, ".pnm" ) ) ++ else if (vips_iscasepostfix(file->filename, ".pnm")) + ppm->format = VIPS_FOREIGN_PPM_FORMAT_PNM; + +- return( VIPS_OBJECT_CLASS( vips_foreign_save_ppm_file_parent_class )-> +- build( object ) ); ++ return (VIPS_OBJECT_CLASS(vips_foreign_save_ppm_file_parent_class)->build(object)); + } + + static void +-vips_foreign_save_ppm_file_class_init( VipsForeignSavePpmFileClass *class ) ++vips_foreign_save_ppm_file_class_init(VipsForeignSavePpmFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + +@@ -549,22 +539,21 @@ vips_foreign_save_ppm_file_class_init( VipsForeignSavePpmFileClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "ppmsave"; +- object_class->description = _( "save image to ppm file" ); ++ object_class->description = _("save image to ppm file"); + object_class->build = vips_foreign_save_ppm_file_build; + + foreign_class->suffs = vips__ppm_suffs; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePpmFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSavePpmFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_ppm_file_init( VipsForeignSavePpmFile *file ) ++vips_foreign_save_ppm_file_init(VipsForeignSavePpmFile *file) + { + } + +@@ -576,31 +565,31 @@ typedef struct _VipsForeignSavePpmTarget { + + typedef VipsForeignSavePpmClass VipsForeignSavePpmTargetClass; + +-G_DEFINE_TYPE( VipsForeignSavePpmTarget, vips_foreign_save_ppm_target, +- vips_foreign_save_ppm_get_type() ); ++G_DEFINE_TYPE(VipsForeignSavePpmTarget, vips_foreign_save_ppm_target, ++ vips_foreign_save_ppm_get_type()); + + static int +-vips_foreign_save_ppm_target_build( VipsObject *object ) ++vips_foreign_save_ppm_target_build(VipsObject *object) + { + VipsForeignSavePpm *ppm = (VipsForeignSavePpm *) object; +- VipsForeignSavePpmTarget *target = ++ VipsForeignSavePpmTarget *target = + (VipsForeignSavePpmTarget *) object; + +- if( target->target ) { +- ppm->target = target->target; +- g_object_ref( ppm->target ); ++ if (target->target) { ++ ppm->target = target->target; ++ g_object_ref(ppm->target); + } + +- return( VIPS_OBJECT_CLASS( +- vips_foreign_save_ppm_target_parent_class )-> +- build( object ) ); ++ return (VIPS_OBJECT_CLASS( ++ vips_foreign_save_ppm_target_parent_class) ++ ->build(object)); + } + + static void +-vips_foreign_save_ppm_target_class_init( +- VipsForeignSavePpmTargetClass *class ) ++vips_foreign_save_ppm_target_class_init( ++ VipsForeignSavePpmTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + +@@ -612,36 +601,35 @@ vips_foreign_save_ppm_target_class_init( + + foreign_class->suffs = vips__save_ppm_suffs; + +- VIPS_ARG_OBJECT( class, "target", 1, +- _( "Target" ), +- _( "Target to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSavePpmTarget, target ), +- VIPS_TYPE_TARGET ); +- ++ VIPS_ARG_OBJECT(class, "target", 1, ++ _("Target"), ++ _("Target to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSavePpmTarget, target), ++ VIPS_TYPE_TARGET); + } + + static void +-vips_foreign_save_ppm_target_init( VipsForeignSavePpmTarget *target ) ++vips_foreign_save_ppm_target_init(VipsForeignSavePpmTarget *target) + { + } + + typedef VipsForeignSavePpmTarget VipsForeignSavePbmTarget; + typedef VipsForeignSavePpmTargetClass VipsForeignSavePbmTargetClass; + +-G_DEFINE_TYPE( VipsForeignSavePbmTarget, vips_foreign_save_pbm_target, +- vips_foreign_save_ppm_target_get_type() ); ++G_DEFINE_TYPE(VipsForeignSavePbmTarget, vips_foreign_save_pbm_target, ++ vips_foreign_save_ppm_target_get_type()); + + static void +-vips_foreign_save_pbm_target_class_init( +- VipsForeignSavePbmTargetClass *class ) ++vips_foreign_save_pbm_target_class_init( ++ VipsForeignSavePbmTargetClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsOperationClass *operation_class = (VipsOperationClass *) class; + + object_class->nickname = "pbmsave_target"; +- object_class->description = _( "save image in pbm format" ); ++ object_class->description = _("save image in pbm format"); + + foreign_class->suffs = vips__save_pbm_suffs; + +@@ -651,7 +639,7 @@ vips_foreign_save_pbm_target_class_init( + } + + static void +-vips_foreign_save_pbm_target_init( VipsForeignSavePbmTarget *target ) ++vips_foreign_save_pbm_target_init(VipsForeignSavePbmTarget *target) + { + VipsForeignSavePpm *ppm = (VipsForeignSavePpm *) target; + +@@ -661,19 +649,19 @@ vips_foreign_save_pbm_target_init( VipsForeignSavePbmTarget *target ) + typedef VipsForeignSavePpmTarget VipsForeignSavePgmTarget; + typedef VipsForeignSavePpmTargetClass VipsForeignSavePgmTargetClass; + +-G_DEFINE_TYPE( VipsForeignSavePgmTarget, vips_foreign_save_pgm_target, +- vips_foreign_save_ppm_target_get_type() ); ++G_DEFINE_TYPE(VipsForeignSavePgmTarget, vips_foreign_save_pgm_target, ++ vips_foreign_save_ppm_target_get_type()); + + static void +-vips_foreign_save_pgm_target_class_init( +- VipsForeignSavePgmTargetClass *class ) ++vips_foreign_save_pgm_target_class_init( ++ VipsForeignSavePgmTargetClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsOperationClass *operation_class = (VipsOperationClass *) class; + + object_class->nickname = "pgmsave_target"; +- object_class->description = _( "save image in pgm format" ); ++ object_class->description = _("save image in pgm format"); + + foreign_class->suffs = vips__save_pgm_suffs; + +@@ -683,7 +671,7 @@ vips_foreign_save_pgm_target_class_init( + } + + static void +-vips_foreign_save_pgm_target_init( VipsForeignSavePgmTarget *target ) ++vips_foreign_save_pgm_target_init(VipsForeignSavePgmTarget *target) + { + VipsForeignSavePpm *ppm = (VipsForeignSavePpm *) target; + +@@ -693,19 +681,19 @@ vips_foreign_save_pgm_target_init( VipsForeignSavePgmTarget *target ) + typedef VipsForeignSavePpmTarget VipsForeignSavePfmTarget; + typedef VipsForeignSavePpmTargetClass VipsForeignSavePfmTargetClass; + +-G_DEFINE_TYPE( VipsForeignSavePfmTarget, vips_foreign_save_pfm_target, +- vips_foreign_save_ppm_target_get_type() ); ++G_DEFINE_TYPE(VipsForeignSavePfmTarget, vips_foreign_save_pfm_target, ++ vips_foreign_save_ppm_target_get_type()); + + static void +-vips_foreign_save_pfm_target_class_init( +- VipsForeignSavePfmTargetClass *class ) ++vips_foreign_save_pfm_target_class_init( ++ VipsForeignSavePfmTargetClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsOperationClass *operation_class = (VipsOperationClass *) class; + + object_class->nickname = "pfmsave_target"; +- object_class->description = _( "save image in pfm format" ); ++ object_class->description = _("save image in pfm format"); + + foreign_class->suffs = vips__save_pfm_suffs; + +@@ -715,7 +703,7 @@ vips_foreign_save_pfm_target_class_init( + } + + static void +-vips_foreign_save_pfm_target_init( VipsForeignSavePfmTarget *target ) ++vips_foreign_save_pfm_target_init(VipsForeignSavePfmTarget *target) + { + VipsForeignSavePpm *ppm = (VipsForeignSavePpm *) target; + +@@ -725,19 +713,19 @@ vips_foreign_save_pfm_target_init( VipsForeignSavePfmTarget *target ) + typedef VipsForeignSavePpmTarget VipsForeignSavePnmTarget; + typedef VipsForeignSavePpmTargetClass VipsForeignSavePnmTargetClass; + +-G_DEFINE_TYPE( VipsForeignSavePnmTarget, vips_foreign_save_pnm_target, +- vips_foreign_save_ppm_target_get_type() ); ++G_DEFINE_TYPE(VipsForeignSavePnmTarget, vips_foreign_save_pnm_target, ++ vips_foreign_save_ppm_target_get_type()); + + static void +-vips_foreign_save_pnm_target_class_init( +- VipsForeignSavePfmTargetClass *class ) ++vips_foreign_save_pnm_target_class_init( ++ VipsForeignSavePfmTargetClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsOperationClass *operation_class = (VipsOperationClass *) class; + + object_class->nickname = "pnmsave_target"; +- object_class->description = _( "save image in pnm format" ); ++ object_class->description = _("save image in pnm format"); + + foreign_class->suffs = vips__save_pnm_suffs; + +@@ -747,7 +735,7 @@ vips_foreign_save_pnm_target_class_init( + } + + static void +-vips_foreign_save_pnm_target_init( VipsForeignSavePfmTarget *target ) ++vips_foreign_save_pnm_target_init(VipsForeignSavePfmTarget *target) + { + VipsForeignSavePpm *ppm = (VipsForeignSavePpm *) target; + +@@ -758,7 +746,7 @@ vips_foreign_save_pnm_target_init( VipsForeignSavePfmTarget *target ) + + /** + * vips_ppmsave: (method) +- * @in: image to save ++ * @in: image to save + * @filename: file to write to + * @...: %NULL-terminated list of optional named arguments + * +@@ -769,15 +757,15 @@ vips_foreign_save_pnm_target_init( VipsForeignSavePfmTarget *target ) + * * @bitdepth: %gint, bitdepth to save at + * + * Write a VIPS image to a file as PPM. It can write 1, 8, 16 or +- * 32 bit unsigned integer images, float images, colour or monochrome, +- * stored as binary or ASCII. ++ * 32 bit unsigned integer images, float images, colour or monochrome, ++ * stored as binary or ASCII. + * Integer images of more than 8 bits can only be stored in ASCII. + * +- * When writing float (PFM) images the scale factor is set from the ++ * When writing float (PFM) images the scale factor is set from the + * "pfm-scale" metadata. + * + * Set @ascii to %TRUE to write as human-readable ASCII. Normally data is +- * written in binary. ++ * written in binary. + * + * Set @bitdepth to 1 to write a one-bit image. + * +@@ -788,21 +776,21 @@ vips_foreign_save_pnm_target_init( VipsForeignSavePfmTarget *target ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_ppmsave( VipsImage *in, const char *filename, ... ) ++vips_ppmsave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "ppmsave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("ppmsave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_ppmsave_target: (method) +- * @in: image to save ++ * @in: image to save + * @target: save image to this target + * @...: %NULL-terminated list of optional named arguments + * +@@ -819,14 +807,14 @@ vips_ppmsave( VipsImage *in, const char *filename, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_ppmsave_target( VipsImage *in, VipsTarget *target, ... ) ++vips_ppmsave_target(VipsImage *in, VipsTarget *target, ...) + { + va_list ap; + int result; + +- va_start( ap, target ); +- result = vips_call_split( "ppmsave_target", ap, in, target ); +- va_end( ap ); ++ va_start(ap, target); ++ result = vips_call_split("ppmsave_target", ap, in, target); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/quantise.c b/libvips/foreign/quantise.c +index 490f5b4d22..70aa484741 100644 +--- a/libvips/foreign/quantise.c ++++ b/libvips/foreign/quantise.c +@@ -1,33 +1,33 @@ + /* quantise an image + * +- * 20/6/18 ++ * 20/6/18 + * - from vipspng.c + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -56,43 +56,43 @@ vips__quantise_attr_create() + } + + VipsQuantiseError +-vips__quantise_set_max_colors( VipsQuantiseAttr *attr, int colors ) ++vips__quantise_set_max_colors(VipsQuantiseAttr *attr, int colors) + { +- return liq_set_max_colors( attr, colors ); ++ return liq_set_max_colors(attr, colors); + } + + VipsQuantiseError +-vips__quantise_set_quality( VipsQuantiseAttr *attr, int minimum, int maximum ) ++vips__quantise_set_quality(VipsQuantiseAttr *attr, int minimum, int maximum) + { +- return liq_set_quality( attr, minimum, maximum ); ++ return liq_set_quality(attr, minimum, maximum); + } + + VipsQuantiseError +-vips__quantise_set_speed( VipsQuantiseAttr *attr, int speed ) ++vips__quantise_set_speed(VipsQuantiseAttr *attr, int speed) + { +- return liq_set_speed( attr, speed ); ++ return liq_set_speed(attr, speed); + } + + VipsQuantiseImage * +-vips__quantise_image_create_rgba( const VipsQuantiseAttr *attr, +- const void *bitmap, int width, int height, double gamma ) ++vips__quantise_image_create_rgba(const VipsQuantiseAttr *attr, ++ const void *bitmap, int width, int height, double gamma) + { +- return liq_image_create_rgba( attr, bitmap, width, height, gamma ); ++ return liq_image_create_rgba(attr, bitmap, width, height, gamma); + } + + VipsQuantiseError +-vips__quantise_image_quantize( VipsQuantiseImage *const input_image, +- VipsQuantiseAttr *const options, VipsQuantiseResult **result_output ) ++vips__quantise_image_quantize(VipsQuantiseImage *const input_image, ++ VipsQuantiseAttr *const options, VipsQuantiseResult **result_output) + { +- return liq_image_quantize( input_image, options, result_output ); ++ return liq_image_quantize(input_image, options, result_output); + } + + /* Like vips__quantise_image_quantize(), but make a fixed palette that won't + * get remapped during dithering. + */ + VipsQuantiseError +-vips__quantise_image_quantize_fixed( VipsQuantiseImage *const input_image, +- VipsQuantiseAttr *const options, VipsQuantiseResult **result_output ) ++vips__quantise_image_quantize_fixed(VipsQuantiseImage *const input_image, ++ VipsQuantiseAttr *const options, VipsQuantiseResult **result_output) + { + int i; + liq_result *result; +@@ -103,20 +103,20 @@ vips__quantise_image_quantize_fixed( VipsQuantiseImage *const input_image, + + /* First, quantize the image and get its palette. + */ +- err = liq_image_quantize( input_image, options, &result ); +- if( err != LIQ_OK ) ++ err = liq_image_quantize(input_image, options, &result); ++ if (err != LIQ_OK) + return err; + +- palette = liq_get_palette( result ); ++ palette = liq_get_palette(result); + + /* Now, we need a fake 1 pixel image that will be quantized on the + * next step. Its pixel color doesn't matter since we'll add all the + * colors from the palette further. + */ +- fake_image = +- liq_image_create_rgba( options, fake_image_pixels, 1, 1, 0 ); +- if( !fake_image ) { +- liq_result_destroy( result ); ++ fake_image = ++ liq_image_create_rgba(options, fake_image_pixels, 1, 1, 0); ++ if (!fake_image) { ++ liq_result_destroy(result); + return LIQ_OUT_OF_MEMORY; + } + +@@ -124,58 +124,58 @@ vips__quantise_image_quantize_fixed( VipsQuantiseImage *const input_image, + * image. Since the fixed colors number is the same as required colors + * number, no new colors will be added. + */ +- for( i = 0; i < palette->count; i++ ) +- liq_image_add_fixed_color( fake_image, palette->entries[i] ); ++ for (i = 0; i < palette->count; i++) ++ liq_image_add_fixed_color(fake_image, palette->entries[i]); + +- liq_result_destroy( result ); ++ liq_result_destroy(result); + +- /* Finally, quantize the fake image with fixed colors to make a ++ /* Finally, quantize the fake image with fixed colors to make a + * VipsQuantiseResult with a fixed palette. + */ +- err = liq_image_quantize( fake_image, options, result_output ); ++ err = liq_image_quantize(fake_image, options, result_output); + +- liq_image_destroy( fake_image ); ++ liq_image_destroy(fake_image); + + return err; + } + + VipsQuantiseError +-vips__quantise_set_dithering_level( VipsQuantiseResult *res, +- float dither_level ) ++vips__quantise_set_dithering_level(VipsQuantiseResult *res, ++ float dither_level) + { +- return liq_set_dithering_level( res, dither_level ); ++ return liq_set_dithering_level(res, dither_level); + } + + const VipsQuantisePalette * +-vips__quantise_get_palette( VipsQuantiseResult *result ) ++vips__quantise_get_palette(VipsQuantiseResult *result) + { +- return liq_get_palette( result ); ++ return liq_get_palette(result); + } + + VipsQuantiseError +-vips__quantise_write_remapped_image( VipsQuantiseResult *result, +- VipsQuantiseImage *input_image, void *buffer, size_t buffer_size ) ++vips__quantise_write_remapped_image(VipsQuantiseResult *result, ++ VipsQuantiseImage *input_image, void *buffer, size_t buffer_size) + { + return liq_write_remapped_image( +- result, input_image, buffer, buffer_size ); ++ result, input_image, buffer, buffer_size); + } + + void +-vips__quantise_result_destroy( VipsQuantiseResult *result ) ++vips__quantise_result_destroy(VipsQuantiseResult *result) + { +- liq_result_destroy( result ); ++ liq_result_destroy(result); + } + + void +-vips__quantise_image_destroy( VipsQuantiseImage *img ) ++vips__quantise_image_destroy(VipsQuantiseImage *img) + { +- liq_image_destroy( img ); ++ liq_image_destroy(img); + } + + void +-vips__quantise_attr_destroy( VipsQuantiseAttr *attr ) ++vips__quantise_attr_destroy(VipsQuantiseAttr *attr) + { +- liq_attr_destroy( attr ); ++ liq_attr_destroy(attr); + } + + #elif defined(HAVE_QUANTIZR) /*!HAVE_IMAGEQUANT*/ +@@ -187,13 +187,13 @@ vips__quantise_attr_create() + } + + VipsQuantiseError +-vips__quantise_set_max_colors( VipsQuantiseAttr *attr, int colors ) ++vips__quantise_set_max_colors(VipsQuantiseAttr *attr, int colors) + { +- return quantizr_set_max_colors( attr, colors ); ++ return quantizr_set_max_colors(attr, colors); + } + + VipsQuantiseError +-vips__quantise_set_quality( VipsQuantiseAttr *attr, int minimum, int maximum ) ++vips__quantise_set_quality(VipsQuantiseAttr *attr, int minimum, int maximum) + { + /* Not supported by quantizr + */ +@@ -201,7 +201,7 @@ vips__quantise_set_quality( VipsQuantiseAttr *attr, int minimum, int maximum ) + } + + VipsQuantiseError +-vips__quantise_set_speed( VipsQuantiseAttr *attr, int speed ) ++vips__quantise_set_speed(VipsQuantiseAttr *attr, int speed) + { + /* Not supported by quantizr + */ +@@ -209,70 +209,70 @@ vips__quantise_set_speed( VipsQuantiseAttr *attr, int speed ) + } + + VipsQuantiseImage * +-vips__quantise_image_create_rgba( const VipsQuantiseAttr *attr, +- const void *bitmap, int width, int height, double gamma ) ++vips__quantise_image_create_rgba(const VipsQuantiseAttr *attr, ++ const void *bitmap, int width, int height, double gamma) + { + /* attr and gamma ununused by quantizr + */ + return quantizr_create_image_rgba( +- (unsigned char *) bitmap, width, height ); ++ (unsigned char *) bitmap, width, height); + } + + VipsQuantiseError +-vips__quantise_image_quantize( VipsQuantiseImage *const input_image, +- VipsQuantiseAttr *const options, VipsQuantiseResult **result_output ) ++vips__quantise_image_quantize(VipsQuantiseImage *const input_image, ++ VipsQuantiseAttr *const options, VipsQuantiseResult **result_output) + { +- *result_output = quantizr_quantize( input_image, options ); ++ *result_output = quantizr_quantize(input_image, options); + return 0; + } + + VipsQuantiseError +-vips__quantise_image_quantize_fixed( VipsQuantiseImage *const input_image, +- VipsQuantiseAttr *const options, VipsQuantiseResult **result_output ) ++vips__quantise_image_quantize_fixed(VipsQuantiseImage *const input_image, ++ VipsQuantiseAttr *const options, VipsQuantiseResult **result_output) + { + /* Quantizr doesn't change the palette during remapping, so we don't + * need a special implementation for this + */ +- return vips__quantise_image_quantize( input_image, options, +- result_output ); ++ return vips__quantise_image_quantize(input_image, options, ++ result_output); + } + + VipsQuantiseError +-vips__quantise_set_dithering_level( VipsQuantiseResult *res, +- float dither_level ) ++vips__quantise_set_dithering_level(VipsQuantiseResult *res, ++ float dither_level) + { +- return quantizr_set_dithering_level( res, dither_level ); ++ return quantizr_set_dithering_level(res, dither_level); + } + + const VipsQuantisePalette * +-vips__quantise_get_palette( VipsQuantiseResult *result ) ++vips__quantise_get_palette(VipsQuantiseResult *result) + { +- return quantizr_get_palette( result ); ++ return quantizr_get_palette(result); + } + + VipsQuantiseError +-vips__quantise_write_remapped_image( VipsQuantiseResult *result, +- VipsQuantiseImage *input_image, void *buffer, size_t buffer_size ) ++vips__quantise_write_remapped_image(VipsQuantiseResult *result, ++ VipsQuantiseImage *input_image, void *buffer, size_t buffer_size) + { +- return quantizr_remap( result, input_image, buffer, buffer_size ); ++ return quantizr_remap(result, input_image, buffer, buffer_size); + } + + void +-vips__quantise_result_destroy( VipsQuantiseResult *result ) ++vips__quantise_result_destroy(VipsQuantiseResult *result) + { +- quantizr_free_result( result ); ++ quantizr_free_result(result); + } + + void +-vips__quantise_image_destroy( VipsQuantiseImage *img ) ++vips__quantise_image_destroy(VipsQuantiseImage *img) + { +- quantizr_free_image( img ); ++ quantizr_free_image(img); + } + + void +-vips__quantise_attr_destroy( VipsQuantiseAttr *attr ) ++vips__quantise_attr_destroy(VipsQuantiseAttr *attr) + { +- quantizr_free_options( attr ); ++ quantizr_free_options(attr); + } + + #endif /*HAVE_IMAGEQUANT*/ +@@ -295,29 +295,29 @@ typedef struct _Quantise { + } Quantise; + + static void +-vips__quantise_free( Quantise *quantise ) ++vips__quantise_free(Quantise *quantise) + { + int i; + +- VIPS_FREEF( vips__quantise_result_destroy, quantise->quantisation_result ); +- VIPS_FREEF( vips__quantise_image_destroy, quantise->input_image ); +- VIPS_FREEF( vips__quantise_attr_destroy, quantise->attr ); ++ VIPS_FREEF(vips__quantise_result_destroy, quantise->quantisation_result); ++ VIPS_FREEF(vips__quantise_image_destroy, quantise->input_image); ++ VIPS_FREEF(vips__quantise_attr_destroy, quantise->attr); + +- for( i = 0; i < VIPS_NUMBER( quantise->t ); i++ ) +- VIPS_UNREF( quantise->t[i] ); ++ for (i = 0; i < VIPS_NUMBER(quantise->t); i++) ++ VIPS_UNREF(quantise->t[i]); + +- VIPS_FREE( quantise ); ++ VIPS_FREE(quantise); + } + + static Quantise * +-vips__quantise_new( VipsImage *in, ++vips__quantise_new(VipsImage *in, + VipsImage **index_out, VipsImage **palette_out, +- int colours, int Q, double dither, int effort ) ++ int colours, int Q, double dither, int effort) + { + Quantise *quantise; + int i; + +- quantise = VIPS_NEW( NULL, Quantise ); ++ quantise = VIPS_NEW(NULL, Quantise); + quantise->in = in; + quantise->index_out = index_out; + quantise->palette_out = palette_out; +@@ -325,120 +325,120 @@ vips__quantise_new( VipsImage *in, + quantise->Q = Q; + quantise->dither = dither; + quantise->effort = effort; +- for( i = 0; i < VIPS_NUMBER( quantise->t ); i++ ) +- quantise->t[i] = NULL; ++ for (i = 0; i < VIPS_NUMBER(quantise->t); i++) ++ quantise->t[i] = NULL; + +- return( quantise ); ++ return (quantise); + } + + int +-vips__quantise_image( VipsImage *in, ++vips__quantise_image(VipsImage *in, + VipsImage **index_out, VipsImage **palette_out, + int colours, int Q, double dither, int effort, +- gboolean threshold_alpha ) ++ gboolean threshold_alpha) + { + Quantise *quantise; + VipsImage *index; + VipsImage *palette; + const VipsQuantisePalette *lp; + gint64 i; +- VipsPel * restrict p; ++ VipsPel *restrict p; + gboolean added_alpha; + +- quantise = vips__quantise_new( in, index_out, palette_out, +- colours, Q, dither, effort ); ++ quantise = vips__quantise_new(in, index_out, palette_out, ++ colours, Q, dither, effort); + +- /* Ensure input is sRGB. ++ /* Ensure input is sRGB. + */ +- if( in->Type != VIPS_INTERPRETATION_sRGB ) { +- if( vips_colourspace( in, &quantise->t[0], +- VIPS_INTERPRETATION_sRGB, NULL ) ) { +- vips__quantise_free( quantise ); +- return( -1 ); ++ if (in->Type != VIPS_INTERPRETATION_sRGB) { ++ if (vips_colourspace(in, &quantise->t[0], ++ VIPS_INTERPRETATION_sRGB, NULL)) { ++ vips__quantise_free(quantise); ++ return (-1); + } + in = quantise->t[0]; + } + +- /* Add alpha channel if missing. ++ /* Add alpha channel if missing. + */ + added_alpha = FALSE; +- if( !vips_image_hasalpha( in ) ) { +- if( vips_bandjoin_const1( in, &quantise->t[1], 255, NULL ) ) { +- vips__quantise_free( quantise ); +- return( -1 ); ++ if (!vips_image_hasalpha(in)) { ++ if (vips_bandjoin_const1(in, &quantise->t[1], 255, NULL)) { ++ vips__quantise_free(quantise); ++ return (-1); + } + added_alpha = TRUE; + in = quantise->t[1]; + } + +- if( !(quantise->t[2] = vips_image_copy_memory( in )) ) { +- vips__quantise_free( quantise ); +- return( -1 ); ++ if (!(quantise->t[2] = vips_image_copy_memory(in))) { ++ vips__quantise_free(quantise); ++ return (-1); + } + in = quantise->t[2]; + + /* Threshold alpha channel. + */ +- if( threshold_alpha && +- !added_alpha ) { +- const guint64 n_pels = VIPS_IMAGE_N_PELS( in ); ++ if (threshold_alpha && ++ !added_alpha) { ++ const guint64 n_pels = VIPS_IMAGE_N_PELS(in); + +- p = VIPS_IMAGE_ADDR( in, 0, 0 ); +- for( i = 0; i < n_pels; i++ ) { ++ p = VIPS_IMAGE_ADDR(in, 0, 0); ++ for (i = 0; i < n_pels; i++) { + p[3] = p[3] > 128 ? 255 : 0; + p += 4; + } + } + + quantise->attr = vips__quantise_attr_create(); +- vips__quantise_set_max_colors( quantise->attr, colours ); +- vips__quantise_set_quality( quantise->attr, 0, Q ); +- vips__quantise_set_speed( quantise->attr, 11 - effort ); +- +- quantise->input_image = vips__quantise_image_create_rgba( quantise->attr, +- VIPS_IMAGE_ADDR( in, 0, 0 ), in->Xsize, in->Ysize, 0 ); +- +- if( vips__quantise_image_quantize( quantise->input_image, quantise->attr, +- &quantise->quantisation_result ) ) { +- vips_error( "quantise", "%s", _( "quantisation failed" ) ); +- vips__quantise_free( quantise ); +- return( -1 ); ++ vips__quantise_set_max_colors(quantise->attr, colours); ++ vips__quantise_set_quality(quantise->attr, 0, Q); ++ vips__quantise_set_speed(quantise->attr, 11 - effort); ++ ++ quantise->input_image = vips__quantise_image_create_rgba(quantise->attr, ++ VIPS_IMAGE_ADDR(in, 0, 0), in->Xsize, in->Ysize, 0); ++ ++ if (vips__quantise_image_quantize(quantise->input_image, quantise->attr, ++ &quantise->quantisation_result)) { ++ vips_error("quantise", "%s", _("quantisation failed")); ++ vips__quantise_free(quantise); ++ return (-1); + } + +- vips__quantise_set_dithering_level( quantise->quantisation_result, dither ); ++ vips__quantise_set_dithering_level(quantise->quantisation_result, dither); + + index = quantise->t[3] = vips_image_new_memory(); +- vips_image_init_fields( index, ++ vips_image_init_fields(index, + in->Xsize, in->Ysize, 1, VIPS_FORMAT_UCHAR, +- VIPS_CODING_NONE, VIPS_INTERPRETATION_B_W, 1.0, 1.0 ); ++ VIPS_CODING_NONE, VIPS_INTERPRETATION_B_W, 1.0, 1.0); + +- if( vips_image_write_prepare( index ) ) { +- vips__quantise_free( quantise ); +- return( -1 ); ++ if (vips_image_write_prepare(index)) { ++ vips__quantise_free(quantise); ++ return (-1); + } + +- if( vips__quantise_write_remapped_image( quantise->quantisation_result, +- quantise->input_image, +- VIPS_IMAGE_ADDR( index, 0, 0 ), VIPS_IMAGE_N_PELS( index ) ) ) { +- vips_error( "quantise", "%s", _( "quantisation failed" ) ); +- vips__quantise_free( quantise ); +- return( -1 ); ++ if (vips__quantise_write_remapped_image(quantise->quantisation_result, ++ quantise->input_image, ++ VIPS_IMAGE_ADDR(index, 0, 0), VIPS_IMAGE_N_PELS(index))) { ++ vips_error("quantise", "%s", _("quantisation failed")); ++ vips__quantise_free(quantise); ++ return (-1); + } + +- lp = vips__quantise_get_palette( quantise->quantisation_result ); ++ lp = vips__quantise_get_palette(quantise->quantisation_result); + + palette = quantise->t[4] = vips_image_new_memory(); +- vips_image_init_fields( palette, lp->count, 1, 4, ++ vips_image_init_fields(palette, lp->count, 1, 4, + VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, VIPS_INTERPRETATION_sRGB, +- 1.0, 1.0 ); ++ 1.0, 1.0); + +- if( vips_image_write_prepare( palette ) ) { +- vips__quantise_free( quantise ); +- return( -1 ); ++ if (vips_image_write_prepare(palette)) { ++ vips__quantise_free(quantise); ++ return (-1); + } + +- p = VIPS_IMAGE_ADDR( palette, 0, 0 ); +- for( i = 0; i < lp->count; i++ ) { ++ p = VIPS_IMAGE_ADDR(palette, 0, 0); ++ for (i = 0; i < lp->count; i++) { + p[0] = lp->entries[i].r; + p[1] = lp->entries[i].g; + p[2] = lp->entries[i].b; +@@ -448,28 +448,27 @@ vips__quantise_image( VipsImage *in, + } + + *index_out = index; +- g_object_ref( index ); ++ g_object_ref(index); + *palette_out = palette; +- g_object_ref( palette ); ++ g_object_ref(palette); + +- vips__quantise_free( quantise ); ++ vips__quantise_free(quantise); + +- return( 0 ); ++ return (0); + } + + #else /*!HAVE_QUANTIZATION*/ + + int +-vips__quantise_image( VipsImage *in, ++vips__quantise_image(VipsImage *in, + VipsImage **index_out, VipsImage **palette_out, + int colours, int Q, double dither, int effort, +- gboolean threshold_alpha ) ++ gboolean threshold_alpha) + { +- vips_error( "vips__quantise_image", +- "%s", _( "libvips not built with quantisation support" ) ); ++ vips_error("vips__quantise_image", ++ "%s", _("libvips not built with quantisation support")); + +- return( -1 ); ++ return (-1); + } + + #endif /*HAVE_QUANTIZATION*/ +- +diff --git a/libvips/foreign/quantise.h b/libvips/foreign/quantise.h +index 4a93c92f18..4b2b033c20 100644 +--- a/libvips/foreign/quantise.h ++++ b/libvips/foreign/quantise.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -60,31 +60,31 @@ extern "C" { + + #ifdef HAVE_QUANTIZATION + VipsQuantiseAttr *vips__quantise_attr_create(); +-VipsQuantiseError vips__quantise_set_max_colors( VipsQuantiseAttr *attr, +- int colors ); +-VipsQuantiseError vips__quantise_set_quality( VipsQuantiseAttr *attr, +- int minimum, int maximum ); +-VipsQuantiseError vips__quantise_set_speed( VipsQuantiseAttr *attr, int speed ); +-VipsQuantiseImage *vips__quantise_image_create_rgba( const VipsQuantiseAttr *attr, +- const void *bitmap, int width, int height, double gamma ); +-VipsQuantiseError vips__quantise_image_quantize( VipsQuantiseImage *input_image, +- VipsQuantiseAttr *options, VipsQuantiseResult **result_output ); +-VipsQuantiseError vips__quantise_image_quantize_fixed( VipsQuantiseImage *input_image, +- VipsQuantiseAttr *options, VipsQuantiseResult **result_output ); +-VipsQuantiseError vips__quantise_set_dithering_level( VipsQuantiseResult *res, +- float dither_level ); +-const VipsQuantisePalette *vips__quantise_get_palette( VipsQuantiseResult *result ); +-VipsQuantiseError vips__quantise_write_remapped_image( VipsQuantiseResult *result, +- VipsQuantiseImage *input_image, void *buffer, size_t buffer_size ); +-void vips__quantise_result_destroy( VipsQuantiseResult *result ); +-void vips__quantise_image_destroy( VipsQuantiseImage *img ); +-void vips__quantise_attr_destroy( VipsQuantiseAttr *attr ); ++VipsQuantiseError vips__quantise_set_max_colors(VipsQuantiseAttr *attr, ++ int colors); ++VipsQuantiseError vips__quantise_set_quality(VipsQuantiseAttr *attr, ++ int minimum, int maximum); ++VipsQuantiseError vips__quantise_set_speed(VipsQuantiseAttr *attr, int speed); ++VipsQuantiseImage *vips__quantise_image_create_rgba(const VipsQuantiseAttr *attr, ++ const void *bitmap, int width, int height, double gamma); ++VipsQuantiseError vips__quantise_image_quantize(VipsQuantiseImage *input_image, ++ VipsQuantiseAttr *options, VipsQuantiseResult **result_output); ++VipsQuantiseError vips__quantise_image_quantize_fixed(VipsQuantiseImage *input_image, ++ VipsQuantiseAttr *options, VipsQuantiseResult **result_output); ++VipsQuantiseError vips__quantise_set_dithering_level(VipsQuantiseResult *res, ++ float dither_level); ++const VipsQuantisePalette *vips__quantise_get_palette(VipsQuantiseResult *result); ++VipsQuantiseError vips__quantise_write_remapped_image(VipsQuantiseResult *result, ++ VipsQuantiseImage *input_image, void *buffer, size_t buffer_size); ++void vips__quantise_result_destroy(VipsQuantiseResult *result); ++void vips__quantise_image_destroy(VipsQuantiseImage *img); ++void vips__quantise_attr_destroy(VipsQuantiseAttr *attr); + #endif /*HAVE_QUANTIZATION*/ + +-int vips__quantise_image( VipsImage *in, ++int vips__quantise_image(VipsImage *in, + VipsImage **index_out, VipsImage **palette_out, + int colours, int Q, double dither, int effort, +- gboolean threshold_alpha ); ++ gboolean threshold_alpha); + + #ifdef __cplusplus + } +diff --git a/libvips/foreign/radiance.c b/libvips/foreign/radiance.c +index 8cdcee690d..31667edd96 100644 +--- a/libvips/foreign/radiance.c ++++ b/libvips/foreign/radiance.c +@@ -1,4 +1,4 @@ +-/* Read Radiance (.hdr) files ++/* Read Radiance (.hdr) files + * + * 3/3/09 + * - write packed data, a separate im_rad2float() operation can unpack +@@ -16,7 +16,7 @@ + * - put the reader globals into a struct so we can have many active + * readers + * 23/5/16 +- * - add buffer save functions ++ * - add buffer save functions + * 28/2/17 + * - use dbuf for buffer output + * 4/4/17 +@@ -33,28 +33,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -70,8 +70,8 @@ + + /* + +- Sections of this reader from Greg Ward and Radiance with kind +- permission. The Radience copyright notice appears below. ++ Sections of this reader from Greg Ward and Radiance with kind ++ permission. The Radience copyright notice appears below. + + */ + +@@ -176,168 +176,186 @@ + * 6. remove unused funcs, mostly related to HDR write + */ + +-#define RED 0 +-#define GRN 1 +-#define BLU 2 +-#define CIEX 0 /* or, if input is XYZ... */ +-#define CIEY 1 +-#define CIEZ 2 +-#define EXP 3 /* exponent same for either format */ +-#define COLXS 128 /* excess used for exponent */ +-#define WHT 3 /* used for RGBPRIMS type */ ++#define RED 0 ++#define GRN 1 ++#define BLU 2 ++#define CIEX 0 /* or, if input is XYZ... */ ++#define CIEY 1 ++#define CIEZ 2 ++#define EXP 3 /* exponent same for either format */ ++#define COLXS 128 /* excess used for exponent */ ++#define WHT 3 /* used for RGBPRIMS type */ + + #undef uby8 +-#define uby8 unsigned char /* 8-bit unsigned integer */ ++#define uby8 unsigned char /* 8-bit unsigned integer */ + +-typedef uby8 COLR[4]; /* red, green, blue (or X,Y,Z), exponent */ ++typedef uby8 COLR[4]; /* red, green, blue (or X,Y,Z), exponent */ + + typedef float COLORV; +-typedef COLORV COLOR[3]; /* red, green, blue (or X,Y,Z) */ ++typedef COLORV COLOR[3]; /* red, green, blue (or X,Y,Z) */ + +-typedef float RGBPRIMS[4][2]; /* (x,y) chromaticities for RGBW */ +-typedef float (*RGBPRIMP)[2]; /* pointer to RGBPRIMS array */ ++typedef float RGBPRIMS[4][2]; /* (x,y) chromaticities for RGBW */ ++typedef float (*RGBPRIMP)[2]; /* pointer to RGBPRIMS array */ + +-typedef float COLORMAT[3][3]; /* color coordinate conversion matrix */ ++typedef float COLORMAT[3][3]; /* color coordinate conversion matrix */ + +-#define copycolr(c1,c2) (c1[0]=c2[0],c1[1]=c2[1], \ +- c1[2]=c2[2],c1[3]=c2[3]) ++#define copycolr(c1, c2) (c1[0] = c2[0], c1[1] = c2[1], \ ++ c1[2] = c2[2], c1[3] = c2[3]) + +-#define colval(col,pri) ((col)[pri]) ++#define colval(col, pri) ((col)[pri]) + +-#define setcolor(col,r,g,b) ((col)[RED]=(r),(col)[GRN]=(g),(col)[BLU]=(b)) ++#define setcolor(col, r, g, b) ((col)[RED] = (r), (col)[GRN] = (g), (col)[BLU] = (b)) + +-#define copycolor(c1,c2) ((c1)[0]=(c2)[0],(c1)[1]=(c2)[1],(c1)[2]=(c2)[2]) ++#define copycolor(c1, c2) ((c1)[0] = (c2)[0], (c1)[1] = (c2)[1], (c1)[2] = (c2)[2]) + +-#define scalecolor(col,sf) ((col)[0]*=(sf),(col)[1]*=(sf),(col)[2]*=(sf)) ++#define scalecolor(col, sf) ((col)[0] *= (sf), (col)[1] *= (sf), (col)[2] *= (sf)) + +-#define addcolor(c1,c2) ((c1)[0]+=(c2)[0],(c1)[1]+=(c2)[1],(c1)[2]+=(c2)[2]) ++#define addcolor(c1, c2) ((c1)[0] += (c2)[0], (c1)[1] += (c2)[1], (c1)[2] += (c2)[2]) + +-#define multcolor(c1,c2) ((c1)[0]*=(c2)[0],(c1)[1]*=(c2)[1],(c1)[2]*=(c2)[2]) ++#define multcolor(c1, c2) ((c1)[0] *= (c2)[0], (c1)[1] *= (c2)[1], (c1)[2] *= (c2)[2]) + +-#ifdef NTSC +-#define CIE_x_r 0.670 /* standard NTSC primaries */ +-#define CIE_y_r 0.330 +-#define CIE_x_g 0.210 +-#define CIE_y_g 0.710 +-#define CIE_x_b 0.140 +-#define CIE_y_b 0.080 +-#define CIE_x_w (1./3.) /* use true white */ +-#define CIE_y_w (1./3.) ++#ifdef NTSC ++#define CIE_x_r 0.670 /* standard NTSC primaries */ ++#define CIE_y_r 0.330 ++#define CIE_x_g 0.210 ++#define CIE_y_g 0.710 ++#define CIE_x_b 0.140 ++#define CIE_y_b 0.080 ++#define CIE_x_w (1. / 3.) /* use true white */ ++#define CIE_y_w (1. / 3.) + #else +-#define CIE_x_r 0.640 /* nominal CRT primaries */ +-#define CIE_y_r 0.330 +-#define CIE_x_g 0.290 +-#define CIE_y_g 0.600 +-#define CIE_x_b 0.150 +-#define CIE_y_b 0.060 +-#define CIE_x_w (1./3.) /* use true white */ +-#define CIE_y_w (1./3.) ++#define CIE_x_r 0.640 /* nominal CRT primaries */ ++#define CIE_y_r 0.330 ++#define CIE_x_g 0.290 ++#define CIE_y_g 0.600 ++#define CIE_x_b 0.150 ++#define CIE_y_b 0.060 ++#define CIE_x_w (1. / 3.) /* use true white */ ++#define CIE_y_w (1. / 3.) + #endif + +-#define STDPRIMS {{CIE_x_r,CIE_y_r},{CIE_x_g,CIE_y_g}, \ +- {CIE_x_b,CIE_y_b},{CIE_x_w,CIE_y_w}} +- +-#define CIE_D ( CIE_x_r*(CIE_y_g - CIE_y_b) + \ +- CIE_x_g*(CIE_y_b - CIE_y_r) + \ +- CIE_x_b*(CIE_y_r - CIE_y_g) ) +-#define CIE_C_rD ( (1./CIE_y_w) * \ +- ( CIE_x_w*(CIE_y_g - CIE_y_b) - \ +- CIE_y_w*(CIE_x_g - CIE_x_b) + \ +- CIE_x_g*CIE_y_b - CIE_x_b*CIE_y_g ) ) +-#define CIE_C_gD ( (1./CIE_y_w) * \ +- ( CIE_x_w*(CIE_y_b - CIE_y_r) - \ +- CIE_y_w*(CIE_x_b - CIE_x_r) - \ +- CIE_x_r*CIE_y_b + CIE_x_b*CIE_y_r ) ) +-#define CIE_C_bD ( (1./CIE_y_w) * \ +- ( CIE_x_w*(CIE_y_r - CIE_y_g) - \ +- CIE_y_w*(CIE_x_r - CIE_x_g) + \ +- CIE_x_r*CIE_y_g - CIE_x_g*CIE_y_r ) ) +- +-#define CIE_rf (CIE_y_r*CIE_C_rD/CIE_D) +-#define CIE_gf (CIE_y_g*CIE_C_gD/CIE_D) +-#define CIE_bf (CIE_y_b*CIE_C_bD/CIE_D) ++#define STDPRIMS \ ++ { \ ++ { CIE_x_r, CIE_y_r }, { CIE_x_g, CIE_y_g }, \ ++ { CIE_x_b, CIE_y_b }, \ ++ { \ ++ CIE_x_w, CIE_y_w \ ++ } \ ++ } ++ ++#define CIE_D (CIE_x_r * (CIE_y_g - CIE_y_b) + \ ++ CIE_x_g * (CIE_y_b - CIE_y_r) + \ ++ CIE_x_b * (CIE_y_r - CIE_y_g)) ++#define CIE_C_rD ((1. / CIE_y_w) * \ ++ (CIE_x_w * (CIE_y_g - CIE_y_b) - \ ++ CIE_y_w * (CIE_x_g - CIE_x_b) + \ ++ CIE_x_g * CIE_y_b - CIE_x_b * CIE_y_g)) ++#define CIE_C_gD ((1. / CIE_y_w) * \ ++ (CIE_x_w * (CIE_y_b - CIE_y_r) - \ ++ CIE_y_w * (CIE_x_b - CIE_x_r) - \ ++ CIE_x_r * CIE_y_b + CIE_x_b * CIE_y_r)) ++#define CIE_C_bD ((1. / CIE_y_w) * \ ++ (CIE_x_w * (CIE_y_r - CIE_y_g) - \ ++ CIE_y_w * (CIE_x_r - CIE_x_g) + \ ++ CIE_x_r * CIE_y_g - CIE_x_g * CIE_y_r)) ++ ++#define CIE_rf (CIE_y_r * CIE_C_rD / CIE_D) ++#define CIE_gf (CIE_y_g * CIE_C_gD / CIE_D) ++#define CIE_bf (CIE_y_b * CIE_C_bD / CIE_D) + + /* As of 9-94, CIE_rf=.265074126, CIE_gf=.670114631 and CIE_bf=.064811243 */ + + /***** The following definitions are valid for RGB colors only... *****/ + +-#define bright(col) (CIE_rf*(col)[RED]+CIE_gf*(col)[GRN]+CIE_bf*(col)[BLU]) +-#define normbright(c) ( ( (long)(CIE_rf*256.+.5)*(c)[RED] + \ +- (long)(CIE_gf*256.+.5)*(c)[GRN] + \ +- (long)(CIE_bf*256.+.5)*(c)[BLU] ) >> 8 ) ++#define bright(col) (CIE_rf * (col)[RED] + CIE_gf * (col)[GRN] + CIE_bf * (col)[BLU]) ++#define normbright(c) (((long) (CIE_rf * 256. + .5) * (c)[RED] + \ ++ (long) (CIE_gf * 256. + .5) * (c)[GRN] + \ ++ (long) (CIE_bf * 256. + .5) * (c)[BLU]) >> \ ++ 8) + +- /* luminous efficacies over visible spectrum */ +-#define MAXEFFICACY 683. /* defined maximum at 550 nm */ +-#define WHTEFFICACY 179. /* uniform white light */ +-#define D65EFFICACY 203. /* standard illuminant D65 */ +-#define INCEFFICACY 160. /* illuminant A (incand.) */ +-#define SUNEFFICACY 208. /* illuminant B (solar dir.) */ +-#define SKYEFFICACY D65EFFICACY /* skylight (should be 110) */ +-#define DAYEFFICACY D65EFFICACY /* combined sky and solar */ ++/* luminous efficacies over visible spectrum */ ++#define MAXEFFICACY 683. /* defined maximum at 550 nm */ ++#define WHTEFFICACY 179. /* uniform white light */ ++#define D65EFFICACY 203. /* standard illuminant D65 */ ++#define INCEFFICACY 160. /* illuminant A (incand.) */ ++#define SUNEFFICACY 208. /* illuminant B (solar dir.) */ ++#define SKYEFFICACY D65EFFICACY /* skylight (should be 110) */ ++#define DAYEFFICACY D65EFFICACY /* combined sky and solar */ + +-#define luminance(col) (WHTEFFICACY * bright(col)) ++#define luminance(col) (WHTEFFICACY * bright(col)) + + /***** ...end of stuff specific to RGB colors *****/ + +-#define intens(col) ( (col)[0] > (col)[1] \ +- ? (col)[0] > (col)[2] ? (col)[0] : (col)[2] \ +- : (col)[1] > (col)[2] ? (col)[1] : (col)[2] ) +- +-#define colrval(c,p) ( (c)[EXP] ? \ +- ldexp((c)[p]+.5,(int)(c)[EXP]-(COLXS+8)) : \ +- 0. ) +- +-#define WHTCOLOR {1.0,1.0,1.0} +-#define BLKCOLOR {0.0,0.0,0.0} +-#define WHTCOLR {128,128,128,COLXS+1} +-#define BLKCOLR {0,0,0,0} +- +- /* picture format identifier */ +-#define COLRFMT "32-bit_rle_rgbe" +-#define CIEFMT "32-bit_rle_xyze" +-#define PICFMT "32-bit_rle_???e" /* matches either */ +-#define LPICFMT 15 /* max format id len */ +- +- /* macros for exposures */ +-#define EXPOSSTR "EXPOSURE=" +-#define LEXPOSSTR 9 +-#define isexpos(hl) (!strncmp(hl,EXPOSSTR,LEXPOSSTR)) +-#define exposval(hl) atof((hl)+LEXPOSSTR) +-#define fputexpos(ex,fp) fprintf(fp,"%s%e\n",EXPOSSTR,ex) +- +- /* macros for pixel aspect ratios */ +-#define ASPECTSTR "PIXASPECT=" +-#define LASPECTSTR 10 +-#define isaspect(hl) (!strncmp(hl,ASPECTSTR,LASPECTSTR)) +-#define aspectval(hl) atof((hl)+LASPECTSTR) +-#define fputaspect(pa,fp) fprintf(fp,"%s%f\n",ASPECTSTR,pa) +- +- /* macros for primary specifications */ +-#define PRIMARYSTR "PRIMARIES=" +-#define LPRIMARYSTR 10 +-#define isprims(hl) (!strncmp(hl,PRIMARYSTR,LPRIMARYSTR)) +-#define primsval(p,hl) (sscanf((hl)+LPRIMARYSTR, \ +- "%f %f %f %f %f %f %f %f", \ +- &(p)[RED][CIEX],&(p)[RED][CIEY], \ +- &(p)[GRN][CIEX],&(p)[GRN][CIEY], \ +- &(p)[BLU][CIEX],&(p)[BLU][CIEY], \ +- &(p)[WHT][CIEX],&(p)[WHT][CIEY]) == 8) +-#define fputprims(p,fp) fprintf(fp, \ +- "%s %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f\n",\ +- PRIMARYSTR, \ +- (p)[RED][CIEX],(p)[RED][CIEY], \ +- (p)[GRN][CIEX],(p)[GRN][CIEY], \ +- (p)[BLU][CIEX],(p)[BLU][CIEY], \ +- (p)[WHT][CIEX],(p)[WHT][CIEY]) +- +- /* macros for color correction */ +-#define COLCORSTR "COLORCORR=" +-#define LCOLCORSTR 10 +-#define iscolcor(hl) (!strncmp(hl,COLCORSTR,LCOLCORSTR)) +-#define colcorval(cc,hl) sscanf((hl)+LCOLCORSTR,"%f %f %f", \ +- &(cc)[RED],&(cc)[GRN],&(cc)[BLU]) +-#define fputcolcor(cc,fp) fprintf(fp,"%s %f %f %f\n",COLCORSTR, \ +- (cc)[RED],(cc)[GRN],(cc)[BLU]) ++#define intens(col) ((col)[0] > (col)[1] \ ++ ? (col)[0] > (col)[2] ? (col)[0] : (col)[2] \ ++ : (col)[1] > (col)[2] ? (col)[1] \ ++ : (col)[2]) ++ ++#define colrval(c, p) ((c)[EXP] ? ldexp((c)[p] + .5, (int) (c)[EXP] - (COLXS + 8)) : 0.) ++ ++#define WHTCOLOR \ ++ { \ ++ 1.0, 1.0, 1.0 \ ++ } ++#define BLKCOLOR \ ++ { \ ++ 0.0, 0.0, 0.0 \ ++ } ++#define WHTCOLR \ ++ { \ ++ 128, 128, 128, COLXS + 1 \ ++ } ++#define BLKCOLR \ ++ { \ ++ 0, 0, 0, 0 \ ++ } ++ ++/* picture format identifier */ ++#define COLRFMT "32-bit_rle_rgbe" ++#define CIEFMT "32-bit_rle_xyze" ++#define PICFMT "32-bit_rle_???e" /* matches either */ ++#define LPICFMT 15 /* max format id len */ ++ ++/* macros for exposures */ ++#define EXPOSSTR "EXPOSURE=" ++#define LEXPOSSTR 9 ++#define isexpos(hl) (!strncmp(hl, EXPOSSTR, LEXPOSSTR)) ++#define exposval(hl) atof((hl) + LEXPOSSTR) ++#define fputexpos(ex, fp) fprintf(fp, "%s%e\n", EXPOSSTR, ex) ++ ++/* macros for pixel aspect ratios */ ++#define ASPECTSTR "PIXASPECT=" ++#define LASPECTSTR 10 ++#define isaspect(hl) (!strncmp(hl, ASPECTSTR, LASPECTSTR)) ++#define aspectval(hl) atof((hl) + LASPECTSTR) ++#define fputaspect(pa, fp) fprintf(fp, "%s%f\n", ASPECTSTR, pa) ++ ++/* macros for primary specifications */ ++#define PRIMARYSTR "PRIMARIES=" ++#define LPRIMARYSTR 10 ++#define isprims(hl) (!strncmp(hl, PRIMARYSTR, LPRIMARYSTR)) ++#define primsval(p, hl) (sscanf((hl) + LPRIMARYSTR, \ ++ "%f %f %f %f %f %f %f %f", \ ++ &(p)[RED][CIEX], &(p)[RED][CIEY], \ ++ &(p)[GRN][CIEX], &(p)[GRN][CIEY], \ ++ &(p)[BLU][CIEX], &(p)[BLU][CIEY], \ ++ &(p)[WHT][CIEX], &(p)[WHT][CIEY]) == 8) ++#define fputprims(p, fp) fprintf(fp, \ ++ "%s %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f\n", \ ++ PRIMARYSTR, \ ++ (p)[RED][CIEX], (p)[RED][CIEY], \ ++ (p)[GRN][CIEX], (p)[GRN][CIEY], \ ++ (p)[BLU][CIEX], (p)[BLU][CIEY], \ ++ (p)[WHT][CIEX], (p)[WHT][CIEY]) ++ ++/* macros for color correction */ ++#define COLCORSTR "COLORCORR=" ++#define LCOLCORSTR 10 ++#define iscolcor(hl) (!strncmp(hl, COLCORSTR, LCOLCORSTR)) ++#define colcorval(cc, hl) sscanf((hl) + LCOLCORSTR, "%f %f %f", \ ++ &(cc)[RED], &(cc)[GRN], &(cc)[BLU]) ++#define fputcolcor(cc, fp) fprintf(fp, "%s %f %f %f\n", COLCORSTR, \ ++ (cc)[RED], (cc)[GRN], (cc)[BLU]) + + /* + * Conversions to and from XYZ space generally don't apply WHTEFFICACY. +@@ -345,113 +363,111 @@ typedef float COLORMAT[3][3]; /* color coordinate conversion matrix */ + * converting from radiance (watts/sr/m^2). + */ + +-extern RGBPRIMS stdprims; /* standard primary chromaticities */ +-extern COLORMAT rgb2xyzmat; /* RGB to XYZ conversion matrix */ +-extern COLORMAT xyz2rgbmat; /* XYZ to RGB conversion matrix */ +-extern COLOR cblack, cwhite; /* black (0,0,0) and white (1,1,1) */ ++extern RGBPRIMS stdprims; /* standard primary chromaticities */ ++extern COLORMAT rgb2xyzmat; /* RGB to XYZ conversion matrix */ ++extern COLORMAT xyz2rgbmat; /* XYZ to RGB conversion matrix */ ++extern COLOR cblack, cwhite; /* black (0,0,0) and white (1,1,1) */ + +-#define CGAMUT_LOWER 01 +-#define CGAMUT_UPPER 02 +-#define CGAMUT (CGAMUT_LOWER|CGAMUT_UPPER) ++#define CGAMUT_LOWER 01 ++#define CGAMUT_UPPER 02 ++#define CGAMUT (CGAMUT_LOWER | CGAMUT_UPPER) + +-#define rgb_cie(xyz,rgb) colortrans(xyz,rgb2xyzmat,rgb) ++#define rgb_cie(xyz, rgb) colortrans(xyz, rgb2xyzmat, rgb) + +-#define cpcolormat(md,ms) memcpy((void *)md,(void *)ms,sizeof(COLORMAT)) ++#define cpcolormat(md, ms) memcpy((void *) md, (void *) ms, sizeof(COLORMAT)) + +-#ifdef getc_unlocked /* avoid horrendous overhead of flockfile */ ++#ifdef getc_unlocked /* avoid horrendous overhead of flockfile */ + #undef getc + #undef putc +-#define getc getc_unlocked +-#define putc putc_unlocked ++#define getc getc_unlocked ++#define putc putc_unlocked + #endif + +-#define MINELEN 8 /* minimum scanline length for encoding */ +-#define MAXELEN 0x7fff /* maximum scanline length for encoding */ +-#define MINRUN 4 /* minimum run length */ ++#define MINELEN 8 /* minimum scanline length for encoding */ ++#define MAXELEN 0x7fff /* maximum scanline length for encoding */ ++#define MINRUN 4 /* minimum run length */ + +- /* flags for scanline ordering */ +-#define XDECR 1 +-#define YDECR 2 +-#define YMAJOR 4 ++/* flags for scanline ordering */ ++#define XDECR 1 ++#define YDECR 2 ++#define YMAJOR 4 + +- /* standard scanline ordering */ +-#define PIXSTANDARD (YMAJOR|YDECR) +-#define PIXSTDFMT "-Y %d +X %d\n" ++/* standard scanline ordering */ ++#define PIXSTANDARD (YMAJOR | YDECR) ++#define PIXSTDFMT "-Y %d +X %d\n" + +- /* structure for image dimensions */ ++/* structure for image dimensions */ + typedef struct { +- int rt; /* orientation (from flags above) */ +- int xr, yr; /* x and y resolution */ ++ int rt; /* orientation (from flags above) */ ++ int xr, yr; /* x and y resolution */ + } RESOLU; + +- /* macros to get scanline length and number */ +-#define scanlen(rs) ((rs)->rt & YMAJOR ? (rs)->xr : (rs)->yr) +-#define numscans(rs) ((rs)->rt & YMAJOR ? (rs)->yr : (rs)->xr) ++/* macros to get scanline length and number */ ++#define scanlen(rs) ((rs)->rt & YMAJOR ? (rs)->xr : (rs)->yr) ++#define numscans(rs) ((rs)->rt & YMAJOR ? (rs)->yr : (rs)->xr) + +- /* resolution string buffer and its size */ +-#define RESOLU_BUFLEN 32 ++/* resolution string buffer and its size */ ++#define RESOLU_BUFLEN 32 + +- /* macros for reading/writing resolution struct */ +-#define fputsresolu(rs,fp) fputs(resolu2str(resolu_buf,rs),fp) +-#define fgetsresolu(rs,fp) str2resolu(rs, \ +- fgets(resolu_buf,RESOLU_BUFLEN,fp)) ++/* macros for reading/writing resolution struct */ ++#define fputsresolu(rs, fp) fputs(resolu2str(resolu_buf, rs), fp) ++#define fgetsresolu(rs, fp) str2resolu(rs, \ ++ fgets(resolu_buf, RESOLU_BUFLEN, fp)) + +- /* reading/writing of standard ordering */ +-#define fprtresolu(sl,ns,fp) fprintf(fp,PIXSTDFMT,ns,sl) +-#define fscnresolu(sl,ns,fp) (fscanf(fp,PIXSTDFMT,ns,sl)==2) ++/* reading/writing of standard ordering */ ++#define fprtresolu(sl, ns, fp) fprintf(fp, PIXSTDFMT, ns, sl) ++#define fscnresolu(sl, ns, fp) (fscanf(fp, PIXSTDFMT, ns, sl) == 2) + +- /* identify header lines */ +-#define isheadid(s) headidval(NULL,s) +-#define isformat(s) formatval(NULL,s) +-#define isdate(s) dateval(NULL,s) +-#define isgmt(s) gmtval(NULL,s) ++/* identify header lines */ ++#define isheadid(s) headidval(NULL, s) ++#define isformat(s) formatval(NULL, s) ++#define isdate(s) dateval(NULL, s) ++#define isgmt(s) gmtval(NULL, s) + +-#define LATLONSTR "LATLONG=" +-#define LLATLONSTR 8 +-#define islatlon(hl) (!strncmp(hl,LATLONSTR,LLATLONSTR)) +-#define latlonval(ll,hl) sscanf((hl)+LLATLONSTR, "%f %f", \ +- &(ll)[0],&(ll)[1]) +-#define fputlatlon(lat,lon,fp) fprintf(fp,"%s %.6f %.6f\n",LATLONSTR,lat,lon) ++#define LATLONSTR "LATLONG=" ++#define LLATLONSTR 8 ++#define islatlon(hl) (!strncmp(hl, LATLONSTR, LLATLONSTR)) ++#define latlonval(ll, hl) sscanf((hl) + LLATLONSTR, "%f %f", \ ++ &(ll)[0], &(ll)[1]) ++#define fputlatlon(lat, lon, fp) fprintf(fp, "%s %.6f %.6f\n", LATLONSTR, lat, lon) + + typedef int gethfunc(char *s, void *p); /* callback to process header lines */ + +-#ifdef getc_unlocked /* avoid horrendous overhead of flockfile */ ++#ifdef getc_unlocked /* avoid horrendous overhead of flockfile */ + #undef getc + #undef putc +-#define getc getc_unlocked +-#define putc putc_unlocked ++#define getc getc_unlocked ++#define putc putc_unlocked + #endif + +- +-static char resolu_buf[RESOLU_BUFLEN]; /* resolution line buffer */ ++static char resolu_buf[RESOLU_BUFLEN]; /* resolution line buffer */ + + static char * +-resolu2str(buf, rp) /* convert resolution struct to line */ +-char *buf; +-register RESOLU *rp; ++resolu2str(buf, rp) /* convert resolution struct to line */ ++char *buf; ++register RESOLU *rp; + { +- if (rp->rt&YMAJOR) ++ if (rp->rt & YMAJOR) + sprintf(buf, "%cY %d %cX %d\n", +- rp->rt&YDECR ? '-' : '+', rp->yr, +- rp->rt&XDECR ? '-' : '+', rp->xr); ++ rp->rt & YDECR ? '-' : '+', rp->yr, ++ rp->rt & XDECR ? '-' : '+', rp->xr); + else + sprintf(buf, "%cX %d %cY %d\n", +- rp->rt&XDECR ? '-' : '+', rp->xr, +- rp->rt&YDECR ? '-' : '+', rp->yr); +- return(buf); ++ rp->rt & XDECR ? '-' : '+', rp->xr, ++ rp->rt & YDECR ? '-' : '+', rp->yr); ++ return (buf); + } + +- + static int +-str2resolu(rp, buf) /* convert resolution line to struct */ +-register RESOLU *rp; +-char *buf; ++str2resolu(rp, buf) /* convert resolution line to struct */ ++register RESOLU *rp; ++char *buf; + { +- register char *xndx, *yndx; +- register char *cp; ++ register char *xndx, *yndx; ++ register char *cp; + + if (buf == NULL) +- return(0); ++ return (0); + xndx = yndx = NULL; + for (cp = buf; *cp; cp++) + if (*cp == 'X') +@@ -459,96 +475,100 @@ char *buf; + else if (*cp == 'Y') + yndx = cp; + if (xndx == NULL || yndx == NULL) +- return(0); ++ return (0); + rp->rt = 0; +- if (xndx > yndx) rp->rt |= YMAJOR; +- if (xndx[-1] == '-') rp->rt |= XDECR; +- if (yndx[-1] == '-') rp->rt |= YDECR; +- if ((rp->xr = atoi(xndx+1)) <= 0) +- return(0); +- if ((rp->yr = atoi(yndx+1)) <= 0) +- return(0); +- return(1); ++ if (xndx > yndx) ++ rp->rt |= YMAJOR; ++ if (xndx[-1] == '-') ++ rp->rt |= XDECR; ++ if (yndx[-1] == '-') ++ rp->rt |= YDECR; ++ if ((rp->xr = atoi(xndx + 1)) <= 0) ++ return (0); ++ if ((rp->yr = atoi(yndx + 1)) <= 0) ++ return (0); ++ return (1); + } + +-#define MAXLINE 2048 +-#define MAXFMTLEN 2048 +- +-static const char FMTSTR[] = "FORMAT="; /* format identifier */ ++#define MAXLINE 2048 ++#define MAXFMTLEN 2048 + ++static const char FMTSTR[] = "FORMAT="; /* format identifier */ + + static int +-formatval( /* get format value (return true if format) */ ++formatval(/* get format value (return true if format) */ + char fmt[MAXFMTLEN], +- const char *s +-) ++ const char *s) + { +- const char *cp = FMTSTR; +- char *r = fmt; +- +- while (*cp) if (*cp++ != *s++) return(0); +- while (isspace(*s)) s++; +- if (!*s) return(0); +- if (r == NULL) return(1); ++ const char *cp = FMTSTR; ++ char *r = fmt; ++ ++ while (*cp) ++ if (*cp++ != *s++) ++ return (0); ++ while (isspace(*s)) ++ s++; ++ if (!*s) ++ return (0); ++ if (r == NULL) ++ return (1); + do + *r++ = *s++; +- while (*s && !isspace(*s) && r-fmt < MAXFMTLEN-1); ++ while (*s && !isspace(*s) && r - fmt < MAXFMTLEN - 1); + *r = '\0'; +- return(1); ++ return (1); + } + +- + static int +-getheader( /* get header from file */ ++getheader(/* get header from file */ + VipsSbuf *sbuf, + gethfunc *f, +- void *p +-) ++ void *p) + { +- for(;;) { ++ for (;;) { + const char *line; + +- if( !(line = vips_sbuf_get_line( sbuf )) ) +- return( -1 ); +- if( strcmp( line, "" ) == 0 ) ++ if (!(line = vips_sbuf_get_line(sbuf))) ++ return (-1); ++ if (strcmp(line, "") == 0) + /* Blank line. We've parsed the header successfully. + */ + break; + +- if( f != NULL && +- (*f)( (char *) line, p ) < 0 ) +- return( -1 ); ++ if (f != NULL && ++ (*f)((char *) line, p) < 0) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Read a single scanline, encoded in the old style. + */ + static int +-scanline_read_old( VipsSbuf *sbuf, COLR *scanline, int width ) ++scanline_read_old(VipsSbuf *sbuf, COLR *scanline, int width) + { + int rshift; + + rshift = 0; +- +- while( width > 0 ) { +- if( VIPS_SBUF_REQUIRE( sbuf, 4 ) ) +- return( -1 ); + +- scanline[0][RED] = VIPS_SBUF_FETCH( sbuf ); +- scanline[0][GRN] = VIPS_SBUF_FETCH( sbuf ); +- scanline[0][BLU] = VIPS_SBUF_FETCH( sbuf ); +- scanline[0][EXP] = VIPS_SBUF_FETCH( sbuf ); ++ while (width > 0) { ++ if (VIPS_SBUF_REQUIRE(sbuf, 4)) ++ return (-1); ++ ++ scanline[0][RED] = VIPS_SBUF_FETCH(sbuf); ++ scanline[0][GRN] = VIPS_SBUF_FETCH(sbuf); ++ scanline[0][BLU] = VIPS_SBUF_FETCH(sbuf); ++ scanline[0][EXP] = VIPS_SBUF_FETCH(sbuf); + +- if( scanline[0][RED] == 1 && ++ if (scanline[0][RED] == 1 && + scanline[0][GRN] == 1 && +- scanline[0][BLU] == 1 ) { ++ scanline[0][BLU] == 1) { + guint i; + +- for( i = ((guint32) scanline[0][EXP] << rshift); +- i > 0 && width > 0; i-- ) { +- copycolr( scanline[0], scanline[-1] ); ++ for (i = ((guint32) scanline[0][EXP] << rshift); ++ i > 0 && width > 0; i--) { ++ copycolr(scanline[0], scanline[-1]); + scanline += 1; + width -= 1; + } +@@ -557,9 +577,9 @@ scanline_read_old( VipsSbuf *sbuf, COLR *scanline, int width ) + + /* This can happen with badly-formed input files. + */ +- if( rshift > 24 ) +- return( -1 ); +- } ++ if (rshift > 24) ++ return (-1); ++ } + else { + scanline += 1; + width -= 1; +@@ -567,147 +587,148 @@ scanline_read_old( VipsSbuf *sbuf, COLR *scanline, int width ) + } + } + +- return( 0 ); ++ return (0); + } + + /* Read a single encoded scanline. + */ + static int +-scanline_read( VipsSbuf *sbuf, COLR *scanline, int width ) ++scanline_read(VipsSbuf *sbuf, COLR *scanline, int width) + { + int i, j; + + /* Detect old-style scanlines. + */ +- if( width < MINELEN || +- width > MAXELEN ) +- return( scanline_read_old( sbuf, scanline, width ) ); +- +- if( VIPS_SBUF_REQUIRE( sbuf, 4 ) ) +- return( -1 ); +- +- if( VIPS_SBUF_PEEK( sbuf )[0] != 2 ) +- return( scanline_read_old( sbuf, scanline, width ) ); +- +- scanline[0][RED] = VIPS_SBUF_FETCH( sbuf ); +- scanline[0][GRN] = VIPS_SBUF_FETCH( sbuf ); +- scanline[0][BLU] = VIPS_SBUF_FETCH( sbuf ); +- scanline[0][EXP] = VIPS_SBUF_FETCH( sbuf ); +- if( scanline[0][GRN] != 2 || +- scanline[0][BLU] & 128 ) +- return( scanline_read_old( sbuf, +- scanline + 1, width - 1 ) ); +- +- if( ((scanline[0][BLU] << 8) | scanline[0][EXP]) != width ) { +- vips_error( "rad2vips", "%s", _( "scanline length mismatch" ) ); +- return( -1 ); ++ if (width < MINELEN || ++ width > MAXELEN) ++ return (scanline_read_old(sbuf, scanline, width)); ++ ++ if (VIPS_SBUF_REQUIRE(sbuf, 4)) ++ return (-1); ++ ++ if (VIPS_SBUF_PEEK(sbuf)[0] != 2) ++ return (scanline_read_old(sbuf, scanline, width)); ++ ++ scanline[0][RED] = VIPS_SBUF_FETCH(sbuf); ++ scanline[0][GRN] = VIPS_SBUF_FETCH(sbuf); ++ scanline[0][BLU] = VIPS_SBUF_FETCH(sbuf); ++ scanline[0][EXP] = VIPS_SBUF_FETCH(sbuf); ++ if (scanline[0][GRN] != 2 || ++ scanline[0][BLU] & 128) ++ return (scanline_read_old(sbuf, ++ scanline + 1, width - 1)); ++ ++ if (((scanline[0][BLU] << 8) | scanline[0][EXP]) != width) { ++ vips_error("rad2vips", "%s", _("scanline length mismatch")); ++ return (-1); + } + +- for( i = 0; i < 4; i++ ) +- for( j = 0; j < width; ) { ++ for (i = 0; i < 4; i++) ++ for (j = 0; j < width;) { + int code, len; + gboolean run; + +- if( VIPS_SBUF_REQUIRE( sbuf, 2 ) ) +- return( -1 ); ++ if (VIPS_SBUF_REQUIRE(sbuf, 2)) ++ return (-1); + +- code = VIPS_SBUF_FETCH( sbuf ); ++ code = VIPS_SBUF_FETCH(sbuf); + run = code > 128; +- len = run ? code & 127 : code; ++ len = run ? code & 127 : code; + +- if( j + len > width ) { +- vips_error( "rad2vips", "%s", _( "overrun" ) ); +- return( -1 ); ++ if (j + len > width) { ++ vips_error("rad2vips", "%s", _("overrun")); ++ return (-1); + } + +- if( run ) { ++ if (run) { + int val; + +- val = VIPS_SBUF_FETCH( sbuf ); +- while( len-- ) ++ val = VIPS_SBUF_FETCH(sbuf); ++ while (len--) + scanline[j++][i] = val; +- } ++ } + else { +- if( VIPS_SBUF_REQUIRE( sbuf, len ) ) +- return( -1 ); +- while( len-- ) +- scanline[j++][i] = +- VIPS_SBUF_FETCH( sbuf ); ++ if (VIPS_SBUF_REQUIRE(sbuf, len)) ++ return (-1); ++ while (len--) ++ scanline[j++][i] = ++ VIPS_SBUF_FETCH(sbuf); + } + } + +- return( 0 ); ++ return (0); + } + + /* An encoded scanline can't be larger than this. + */ +-#define MAX_LINE (2 * MAXELEN * sizeof( COLR )) ++#define MAX_LINE (2 * MAXELEN * sizeof(COLR)) + + /* write an RLE scanline. Write magic header. + */ + static void +-rle_scanline_write( COLR *scanline, int width, +- unsigned char *buffer, int *length ) ++rle_scanline_write(COLR *scanline, int width, ++ unsigned char *buffer, int *length) + { + int i, j, beg, cnt; + +-#define PUTC( CH ) { \ +- buffer[(*length)++] = (CH); \ +- g_assert( *length <= MAX_LINE ); \ +-} ++#define PUTC(CH) \ ++ { \ ++ buffer[(*length)++] = (CH); \ ++ g_assert(*length <= MAX_LINE); \ ++ } + + *length = 0; + +- PUTC( 2 ); +- PUTC( 2 ); +- PUTC( width >> 8 ); +- PUTC( width & 255 ); ++ PUTC(2); ++ PUTC(2); ++ PUTC(width >> 8); ++ PUTC(width & 255); + +- for( i = 0; i < 4; i++ ) { +- for( j = 0; j < width; ) { ++ for (i = 0; i < 4; i++) { ++ for (j = 0; j < width;) { + /* Not needed, but keeps gcc used-before-set warning + * quiet. + */ + cnt = 1; + +- /* Set beg / cnt to the start and length of the next ++ /* Set beg / cnt to the start and length of the next + * run longer than MINRUN. + */ +- for( beg = j; beg < width; beg += cnt ) { +- for( cnt = 1; +- cnt < 127 && +- beg + cnt < width && +- scanline[beg + cnt][i] == +- scanline[beg][i]; +- cnt++ ) ++ for (beg = j; beg < width; beg += cnt) { ++ for (cnt = 1; ++ cnt < 127 && ++ beg + cnt < width && ++ scanline[beg + cnt][i] == ++ scanline[beg][i]; ++ cnt++) + ; + +- if( cnt >= MINRUN ) ++ if (cnt >= MINRUN) + break; + } + + /* Code pixels leading up to the run as a set of +- * non-runs. ++ * non-runs. + */ +- while( j < beg ) { +- int len = VIPS_MIN( 128, beg - j ); +- COLR *p = scanline + j; ++ while (j < beg) { ++ int len = VIPS_MIN(128, beg - j); ++ COLR *p = scanline + j; + + int k; + +- PUTC( len ); +- for( k = 0; k < len; k++ ) +- PUTC( p[k][i] ); ++ PUTC(len); ++ for (k = 0; k < len; k++) ++ PUTC(p[k][i]); + j += len; + } + + /* Code the run we found, if any + */ +- if( cnt >= MINRUN ) { +- PUTC( 128 + cnt ); +- PUTC( scanline[j][i] ); +- j += cnt; +- } ++ if (cnt >= MINRUN) { ++ PUTC(128 + cnt); ++ PUTC(scanline[j][i]); ++ j += cnt; ++ } + } + } + } +@@ -727,7 +748,7 @@ typedef struct { + } Read; + + int +-vips__rad_israd( VipsSource *source ) ++vips__rad_israd(VipsSource *source) + { + VipsSbuf *sbuf; + const char *line; +@@ -735,44 +756,44 @@ vips__rad_israd( VipsSource *source ) + + /* Just test that the first line is the magic string. + */ +- sbuf = vips_sbuf_new_from_source( source ); +- result = (line = vips_sbuf_get_line( sbuf )) && +- strcmp( line, "#?RADIANCE" ) == 0; +- VIPS_UNREF( sbuf ); ++ sbuf = vips_sbuf_new_from_source(source); ++ result = (line = vips_sbuf_get_line(sbuf)) && ++ strcmp(line, "#?RADIANCE") == 0; ++ VIPS_UNREF(sbuf); + +- return( result ); ++ return (result); + } + + static void +-read_destroy( VipsImage *image, Read *read ) ++read_destroy(VipsImage *image, Read *read) + { +- VIPS_UNREF( read->sbuf ); ++ VIPS_UNREF(read->sbuf); + } + + static void +-read_minimise_cb( VipsImage *image, Read *read ) ++read_minimise_cb(VipsImage *image, Read *read) + { +- if( read->sbuf ) +- vips_source_minimise( read->sbuf->source ); ++ if (read->sbuf) ++ vips_source_minimise(read->sbuf->source); + } + + static Read * +-read_new( VipsSource *source, VipsImage *out ) ++read_new(VipsSource *source, VipsImage *out) + { + Read *read; + int i; + +- if( vips_source_rewind( source ) ) +- return( NULL ); ++ if (vips_source_rewind(source)) ++ return (NULL); + +- if( !(read = VIPS_NEW( out, Read )) ) +- return( NULL ); ++ if (!(read = VIPS_NEW(out, Read))) ++ return (NULL); + +- read->sbuf = vips_sbuf_new_from_source( source ); ++ read->sbuf = vips_sbuf_new_from_source(source); + read->out = out; +- strcpy( read->format, COLRFMT ); ++ strcpy(read->format, COLRFMT); + read->expos = 1.0; +- for( i = 0; i < 3; i++ ) ++ for (i = 0; i < 3; i++) + read->colcor[i] = 1.0; + read->aspect = 1.0; + read->prims[0][0] = CIE_x_r; +@@ -784,44 +805,44 @@ read_new( VipsSource *source, VipsImage *out ) + read->prims[3][0] = CIE_x_w; + read->prims[3][1] = CIE_y_w; + +- g_signal_connect( out, "close", +- G_CALLBACK( read_destroy ), read ); +- g_signal_connect( out, "minimise", +- G_CALLBACK( read_minimise_cb ), read ); ++ g_signal_connect(out, "close", ++ G_CALLBACK(read_destroy), read); ++ g_signal_connect(out, "minimise", ++ G_CALLBACK(read_minimise_cb), read); + +- return( read ); ++ return (read); + } + + static int +-rad2vips_process_line( char *line, Read *read ) ++rad2vips_process_line(char *line, Read *read) + { +- if( isformat( line ) ) { +- if( formatval( line, read->format ) ) +- return( -1 ); ++ if (isformat(line)) { ++ if (formatval(line, read->format)) ++ return (-1); + } +- else if( isexpos( line ) ) { +- read->expos *= exposval( line ); ++ else if (isexpos(line)) { ++ read->expos *= exposval(line); + } +- else if( iscolcor( line ) ) { ++ else if (iscolcor(line)) { + COLOR cc; + int i; + +- (void) colcorval( cc, line ); +- for( i = 0; i < 3; i++ ) ++ (void) colcorval(cc, line); ++ for (i = 0; i < 3; i++) + read->colcor[i] *= cc[i]; + } +- else if( isaspect( line ) ) { +- read->aspect *= aspectval( line ); ++ else if (isaspect(line)) { ++ read->aspect *= aspectval(line); + } +- else if( isprims( line ) ) { +- (void) primsval( read->prims, line ); ++ else if (isprims(line)) { ++ (void) primsval(read->prims, line); + } + +- return( 0 ); ++ return (0); + } + + static const char *prims_name[4][2] = { +- { "rad-prims-rx", "rad-prims-ry" }, ++ { "rad-prims-rx", "rad-prims-ry" }, + { "rad-prims-gx", "rad-prims-gy" }, + { "rad-prims-bx", "rad-prims-by" }, + { "rad-prims-wx", "rad-prims-wy" } +@@ -834,7 +855,7 @@ static const char *colcor_name[3] = { + }; + + static int +-rad2vips_get_header( Read *read, VipsImage *out ) ++rad2vips_get_header(Read *read, VipsImage *out) + { + VipsInterpretation interpretation; + const char *line; +@@ -842,141 +863,141 @@ rad2vips_get_header( Read *read, VipsImage *out ) + int height; + int i, j; + +- if( getheader( read->sbuf, +- (gethfunc *) rad2vips_process_line, read ) || +- !(line = vips_sbuf_get_line( read->sbuf )) || +- !str2resolu( &read->rs, (char *) line ) ) { +- vips_error( "rad2vips", "%s", +- _( "error reading radiance header" ) ); +- return( -1 ); ++ if (getheader(read->sbuf, ++ (gethfunc *) rad2vips_process_line, read) || ++ !(line = vips_sbuf_get_line(read->sbuf)) || ++ !str2resolu(&read->rs, (char *) line)) { ++ vips_error("rad2vips", "%s", ++ _("error reading radiance header")); ++ return (-1); + } + +- if( strcmp( read->format, COLRFMT ) == 0 ) ++ if (strcmp(read->format, COLRFMT) == 0) + interpretation = VIPS_INTERPRETATION_scRGB; +- else if( strcmp( read->format, CIEFMT ) == 0 ) ++ else if (strcmp(read->format, CIEFMT) == 0) + interpretation = VIPS_INTERPRETATION_XYZ; + else + interpretation = VIPS_INTERPRETATION_MULTIBAND; + +- width = scanlen( &read->rs ); +- height = numscans( &read->rs ); +- if( width <= 0 || ++ width = scanlen(&read->rs); ++ height = numscans(&read->rs); ++ if (width <= 0 || + width >= VIPS_MAX_COORD || +- height <= 0 || +- height >= VIPS_MAX_COORD ) { +- vips_error( "rad2vips", "%s", _( "image size out of bounds" ) ); +- return( -1 ); ++ height <= 0 || ++ height >= VIPS_MAX_COORD) { ++ vips_error("rad2vips", "%s", _("image size out of bounds")); ++ return (-1); + } + +- vips_image_init_fields( out, width, height, 4, ++ vips_image_init_fields(out, width, height, 4, + VIPS_FORMAT_UCHAR, VIPS_CODING_RAD, + interpretation, +- 1, read->aspect ); ++ 1, read->aspect); + +- VIPS_SETSTR( out->filename, +- vips_connection_filename( +- VIPS_CONNECTION( read->sbuf->source ) ) ); ++ VIPS_SETSTR(out->filename, ++ vips_connection_filename( ++ VIPS_CONNECTION(read->sbuf->source))); + +- if( vips_image_pipelinev( out, VIPS_DEMAND_STYLE_THINSTRIP, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(out, VIPS_DEMAND_STYLE_THINSTRIP, NULL)) ++ return (-1); + +- vips_image_set_string( out, "rad-format", read->format ); ++ vips_image_set_string(out, "rad-format", read->format); + +- vips_image_set_double( out, "rad-expos", read->expos ); ++ vips_image_set_double(out, "rad-expos", read->expos); + +- for( i = 0; i < 3; i++ ) +- vips_image_set_double( out, +- colcor_name[i], read->colcor[i] ); ++ for (i = 0; i < 3; i++) ++ vips_image_set_double(out, ++ colcor_name[i], read->colcor[i]); + +- vips_image_set_double( out, "rad-aspect", read->aspect ); ++ vips_image_set_double(out, "rad-aspect", read->aspect); + +- for( i = 0; i < 4; i++ ) +- for( j = 0; j < 2; j++ ) +- vips_image_set_double( out, +- prims_name[i][j], read->prims[i][j] ); ++ for (i = 0; i < 4; i++) ++ for (j = 0; j < 2; j++) ++ vips_image_set_double(out, ++ prims_name[i][j], read->prims[i][j]); + +- return( 0 ); ++ return (0); + } + + int +-vips__rad_header( VipsSource *source, VipsImage *out ) ++vips__rad_header(VipsSource *source, VipsImage *out) + { + Read *read; + +- if( !(read = read_new( source, out )) ) +- return( -1 ); +- if( rad2vips_get_header( read, read->out ) ) +- return( -1 ); +- vips_source_minimise( source ); ++ if (!(read = read_new(source, out))) ++ return (-1); ++ if (rad2vips_get_header(read, read->out)) ++ return (-1); ++ vips_source_minimise(source); + +- return( 0 ); ++ return (0); + } + + static int +-rad2vips_generate( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++rad2vips_generate(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { +- VipsRect *r = &or->valid; +- Read *read = (Read *) a; ++ VipsRect *r = & or->valid; ++ Read *read = (Read *) a; + + int y; + + #ifdef DEBUG +- printf( "rad2vips_generate: line %d, %d rows\n", +- r->top, r->height ); ++ printf("rad2vips_generate: line %d, %d rows\n", ++ r->top, r->height); + #endif /*DEBUG*/ + +- VIPS_GATE_START( "rad2vips_generate: work" ); ++ VIPS_GATE_START("rad2vips_generate: work"); + +- for( y = 0; y < r->height; y++ ) { +- COLR *buf = (COLR *) +- VIPS_REGION_ADDR( or, 0, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ COLR *buf = (COLR *) ++ VIPS_REGION_ADDR(or, 0, r->top + y); + +- if( scanline_read( read->sbuf, buf, or->im->Xsize ) ) { +- vips_error( "rad2vips", +- _( "read error line %d" ), r->top + y ); +- VIPS_GATE_STOP( "rad2vips_generate: work" ); +- return( -1 ); ++ if (scanline_read(read->sbuf, buf, or->im->Xsize)) { ++ vips_error("rad2vips", ++ _("read error line %d"), r->top + y); ++ VIPS_GATE_STOP("rad2vips_generate: work"); ++ return (-1); + } + } + +- VIPS_GATE_STOP( "rad2vips_generate: work" ); ++ VIPS_GATE_STOP("rad2vips_generate: work"); + +- return( 0 ); ++ return (0); + } + + int +-vips__rad_load( VipsSource *source, VipsImage *out ) ++vips__rad_load(VipsSource *source, VipsImage *out) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 3 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(out), 3); + + Read *read; + + #ifdef DEBUG +- printf( "rad2vips: reading \"%s\"\n", +- vips_connection_nick( VIPS_CONNECTION( source ) ) ); ++ printf("rad2vips: reading \"%s\"\n", ++ vips_connection_nick(VIPS_CONNECTION(source))); + #endif /*DEBUG*/ + +- if( !(read = read_new( source, out )) ) +- return( -1 ); ++ if (!(read = read_new(source, out))) ++ return (-1); + + t[0] = vips_image_new(); +- if( rad2vips_get_header( read, t[0] ) ) +- return( -1 ); ++ if (rad2vips_get_header(read, t[0])) ++ return (-1); + +- if( vips_image_generate( t[0], +- NULL, rad2vips_generate, NULL, read, NULL ) || +- vips_sequential( t[0], &t[1], +- "tile_height", VIPS__FATSTRIP_HEIGHT, +- NULL ) || +- vips_image_write( t[1], out ) ) +- return( -1 ); ++ if (vips_image_generate(t[0], ++ NULL, rad2vips_generate, NULL, read, NULL) || ++ vips_sequential(t[0], &t[1], ++ "tile_height", VIPS__FATSTRIP_HEIGHT, ++ NULL) || ++ vips_image_write(t[1], out)) ++ return (-1); + +- if( vips_source_decode( source ) ) +- return( -1 ); ++ if (vips_source_decode(source)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* What we track during a radiance write. +@@ -995,30 +1016,30 @@ typedef struct { + } Write; + + static void +-write_destroy( Write *write ) ++write_destroy(Write *write) + { +- VIPS_FREE( write->line ); +- VIPS_UNREF( write->target ); ++ VIPS_FREE(write->line); ++ VIPS_UNREF(write->target); + +- g_free( write ); ++ g_free(write); + } + + static Write * +-write_new( VipsImage *in, VipsTarget *target ) ++write_new(VipsImage *in, VipsTarget *target) + { + Write *write; + int i; + +- if( !(write = VIPS_NEW( NULL, Write )) ) +- return( NULL ); ++ if (!(write = VIPS_NEW(NULL, Write))) ++ return (NULL); + + write->in = in; + write->target = target; +- g_object_ref( target ); ++ g_object_ref(target); + +- strcpy( write->format, COLRFMT ); ++ strcpy(write->format, COLRFMT); + write->expos = 1.0; +- for( i = 0; i < 3; i++ ) ++ for (i = 0; i < 3; i++) + write->colcor[i] = 1.0; + write->aspect = 1.0; + write->prims[0][0] = CIE_x_r; +@@ -1030,49 +1051,49 @@ write_new( VipsImage *in, VipsTarget *target ) + write->prims[3][0] = CIE_x_w; + write->prims[3][1] = CIE_y_w; + +- if( !(write->line = VIPS_ARRAY( NULL, MAX_LINE, unsigned char )) ) { +- write_destroy( write ); +- return( NULL ); ++ if (!(write->line = VIPS_ARRAY(NULL, MAX_LINE, unsigned char))) { ++ write_destroy(write); ++ return (NULL); + } + +- return( write ); ++ return (write); + } + + static void +-vips2rad_make_header( Write *write ) ++vips2rad_make_header(Write *write) + { + const char *str; + int i, j; + double d; + +- if( vips_image_get_typeof( write->in, "rad-expos" ) ) +- vips_image_get_double( write->in, "rad-expos", &write->expos ); ++ if (vips_image_get_typeof(write->in, "rad-expos")) ++ vips_image_get_double(write->in, "rad-expos", &write->expos); + +- if( vips_image_get_typeof( write->in, "rad-aspect" ) ) +- vips_image_get_double( write->in, +- "rad-aspect", &write->aspect ); ++ if (vips_image_get_typeof(write->in, "rad-aspect")) ++ vips_image_get_double(write->in, ++ "rad-aspect", &write->aspect); + +- if( vips_image_get_typeof( write->in, "rad-format" ) && +- !vips_image_get_string( write->in, "rad-format", &str ) ) +- vips_strncpy( write->format, str, 256 ); ++ if (vips_image_get_typeof(write->in, "rad-format") && ++ !vips_image_get_string(write->in, "rad-format", &str)) ++ vips_strncpy(write->format, str, 256); + +- if( write->in->Type == VIPS_INTERPRETATION_scRGB ) +- strcpy( write->format, COLRFMT ); +- if( write->in->Type == VIPS_INTERPRETATION_XYZ ) +- strcpy( write->format, CIEFMT ); ++ if (write->in->Type == VIPS_INTERPRETATION_scRGB) ++ strcpy(write->format, COLRFMT); ++ if (write->in->Type == VIPS_INTERPRETATION_XYZ) ++ strcpy(write->format, CIEFMT); + +- for( i = 0; i < 3; i++ ) +- if( vips_image_get_typeof( write->in, colcor_name[i] ) && +- !vips_image_get_double( write->in, +- colcor_name[i], &d ) ) ++ for (i = 0; i < 3; i++) ++ if (vips_image_get_typeof(write->in, colcor_name[i]) && ++ !vips_image_get_double(write->in, ++ colcor_name[i], &d)) + write->colcor[i] = d; + +- for( i = 0; i < 4; i++ ) +- for( j = 0; j < 2; j++ ) { +- const char *name = prims_name[i][j]; ++ for (i = 0; i < 4; i++) ++ for (j = 0; j < 2; j++) { ++ const char *name = prims_name[i][j]; + +- if( vips_image_get_typeof( write->in, name ) && +- !vips_image_get_double( write->in, name, &d ) ) ++ if (vips_image_get_typeof(write->in, name) && ++ !vips_image_get_double(write->in, name, &d)) + write->prims[i][j] = d; + } + +@@ -1084,113 +1105,113 @@ vips2rad_make_header( Write *write ) + } + + static int +-vips2rad_put_header( Write *write ) ++vips2rad_put_header(Write *write) + { +- vips2rad_make_header( write ); +- +- vips_target_writes( write->target, "#?RADIANCE\n" ); +- vips_target_writef( write->target, "%s%s\n", FMTSTR, write->format ); +- vips_target_writef( write->target, "%s%e\n", EXPOSSTR, write->expos ); +- vips_target_writef( write->target, +- "%s %f %f %f\n", COLCORSTR, +- write->colcor[RED], write->colcor[GRN], write->colcor[BLU] ); +- vips_target_writef( write->target, +- "SOFTWARE=vips %s\n", vips_version_string() ); +- vips_target_writef( write->target, +- "%s%f\n", ASPECTSTR, write->aspect ); +- vips_target_writef( write->target, +- "%s %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f\n", +- PRIMARYSTR, +- write->prims[RED][CIEX], write->prims[RED][CIEY], +- write->prims[GRN][CIEX], write->prims[GRN][CIEY], +- write->prims[BLU][CIEX], write->prims[BLU][CIEY], +- write->prims[WHT][CIEX], write->prims[WHT][CIEY] ); +- vips_target_writes( write->target, "\n" ); +- vips_target_writes( write->target, +- resolu2str( resolu_buf, &write->rs ) ); +- +- return( 0 ); ++ vips2rad_make_header(write); ++ ++ vips_target_writes(write->target, "#?RADIANCE\n"); ++ vips_target_writef(write->target, "%s%s\n", FMTSTR, write->format); ++ vips_target_writef(write->target, "%s%e\n", EXPOSSTR, write->expos); ++ vips_target_writef(write->target, ++ "%s %f %f %f\n", COLCORSTR, ++ write->colcor[RED], write->colcor[GRN], write->colcor[BLU]); ++ vips_target_writef(write->target, ++ "SOFTWARE=vips %s\n", vips_version_string()); ++ vips_target_writef(write->target, ++ "%s%f\n", ASPECTSTR, write->aspect); ++ vips_target_writef(write->target, ++ "%s %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f\n", ++ PRIMARYSTR, ++ write->prims[RED][CIEX], write->prims[RED][CIEY], ++ write->prims[GRN][CIEX], write->prims[GRN][CIEY], ++ write->prims[BLU][CIEX], write->prims[BLU][CIEY], ++ write->prims[WHT][CIEX], write->prims[WHT][CIEY]); ++ vips_target_writes(write->target, "\n"); ++ vips_target_writes(write->target, ++ resolu2str(resolu_buf, &write->rs)); ++ ++ return (0); + } + + /* Write a single scanline to buffer. + */ + static int +-scanline_write( Write *write, COLR *scanline, int width ) ++scanline_write(Write *write, COLR *scanline, int width) + { +- if( width < MINELEN || +- width > MAXELEN ) { ++ if (width < MINELEN || ++ width > MAXELEN) { + /* Too large or small for RLE ... do a simple write. + */ +- if( vips_target_write( write->target, +- scanline, sizeof( COLR ) * width ) ) +- return( -1 ); ++ if (vips_target_write(write->target, ++ scanline, sizeof(COLR) * width)) ++ return (-1); + } + else { + int length; + + /* An RLE scanline. + */ +- rle_scanline_write( scanline, width, write->line, &length ); ++ rle_scanline_write(scanline, width, write->line, &length); + +- if( vips_target_write( write->target, write->line, length ) ) +- return( -1 ); ++ if (vips_target_write(write->target, write->line, length)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips2rad_put_data_block( VipsRegion *region, VipsRect *area, void *a ) ++vips2rad_put_data_block(VipsRegion *region, VipsRect *area, void *a) + { + Write *write = (Write *) a; + int i; + +- for( i = 0; i < area->height; i++ ) { +- VipsPel *p = VIPS_REGION_ADDR( region, 0, area->top + i ); ++ for (i = 0; i < area->height; i++) { ++ VipsPel *p = VIPS_REGION_ADDR(region, 0, area->top + i); + +- if( scanline_write( write, (COLR *) p, area->width ) ) +- return( -1 ); ++ if (scanline_write(write, (COLR *) p, area->width)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips2rad_put_data( Write *write ) ++vips2rad_put_data(Write *write) + { +- if( vips_sink_disc( write->in, vips2rad_put_data_block, write ) ) +- return( -1 ); ++ if (vips_sink_disc(write->in, vips2rad_put_data_block, write)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-vips__rad_save( VipsImage *in, VipsTarget *target ) ++vips__rad_save(VipsImage *in, VipsTarget *target) + { + Write *write; + + #ifdef DEBUG +- printf( "vips2rad: writing to buffer\n" ); ++ printf("vips2rad: writing to buffer\n"); + #endif /*DEBUG*/ + +- if( vips_image_pio_input( in ) || +- vips_check_coding( "vips2rad", in, VIPS_CODING_RAD ) ) +- return( -1 ); +- if( !(write = write_new( in, target )) ) +- return( -1 ); ++ if (vips_image_pio_input(in) || ++ vips_check_coding("vips2rad", in, VIPS_CODING_RAD)) ++ return (-1); ++ if (!(write = write_new(in, target))) ++ return (-1); + +- if( vips2rad_put_header( write ) || +- vips2rad_put_data( write ) ) { +- write_destroy( write ); +- return( -1 ); ++ if (vips2rad_put_header(write) || ++ vips2rad_put_data(write)) { ++ write_destroy(write); ++ return (-1); + } + +- if( vips_target_end( target ) ) +- return( -1 ); ++ if (vips_target_end(target)) ++ return (-1); + +- write_destroy( write ); ++ write_destroy(write); + +- return( 0 ); ++ return (0); + } + + const char *vips__rad_suffs[] = { ".hdr", NULL }; +diff --git a/libvips/foreign/radload.c b/libvips/foreign/radload.c +index 932252f102..0665a9f7e0 100644 +--- a/libvips/foreign/radload.c ++++ b/libvips/foreign/radload.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -63,67 +63,66 @@ typedef struct _VipsForeignLoadRad { + + typedef VipsForeignLoadClass VipsForeignLoadRadClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadRad, vips_foreign_load_rad, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadRad, vips_foreign_load_rad, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_rad_dispose( GObject *gobject ) ++vips_foreign_load_rad_dispose(GObject *gobject) + { + VipsForeignLoadRad *rad = (VipsForeignLoadRad *) gobject; + +- VIPS_UNREF( rad->source ); ++ VIPS_UNREF(rad->source); + +- G_OBJECT_CLASS( vips_foreign_load_rad_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_rad_parent_class)->dispose(gobject); + } + + static VipsForeignFlags +-vips_foreign_load_rad_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_rad_get_flags(VipsForeignLoad *load) + { +- return( VIPS_FOREIGN_SEQUENTIAL ); ++ return (VIPS_FOREIGN_SEQUENTIAL); + } + + static VipsForeignFlags +-vips_foreign_load_rad_get_flags_filename( const char *filename ) ++vips_foreign_load_rad_get_flags_filename(const char *filename) + { +- return( VIPS_FOREIGN_SEQUENTIAL ); ++ return (VIPS_FOREIGN_SEQUENTIAL); + } + + static int +-vips_foreign_load_rad_header( VipsForeignLoad *load ) ++vips_foreign_load_rad_header(VipsForeignLoad *load) + { + VipsForeignLoadRad *rad = (VipsForeignLoadRad *) load; + +- if( vips__rad_header( rad->source, load->out ) ) +- return( -1 ); ++ if (vips__rad_header(rad->source, load->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_rad_load( VipsForeignLoad *load ) ++vips_foreign_load_rad_load(VipsForeignLoad *load) + { + VipsForeignLoadRad *rad = (VipsForeignLoadRad *) load; + +- if( vips__rad_load( rad->source, load->real ) ) +- return( -1 ); ++ if (vips__rad_load(rad->source, load->real)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_rad_class_init( VipsForeignLoadRadClass *class ) ++vips_foreign_load_rad_class_init(VipsForeignLoadRadClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->dispose = vips_foreign_load_rad_dispose; + + object_class->nickname = "radload_base"; +- object_class->description = _( "load rad base class" ); ++ object_class->description = _("load rad base class"); + + /* You're unlikely to want to use this on untrusted files. + */ +@@ -133,16 +132,15 @@ vips_foreign_load_rad_class_init( VipsForeignLoadRadClass *class ) + */ + foreign_class->priority = -50; + +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_rad_get_flags_filename; + load_class->get_flags = vips_foreign_load_rad_get_flags; + load_class->header = vips_foreign_load_rad_header; + load_class->load = vips_foreign_load_rad_load; +- + } + + static void +-vips_foreign_load_rad_init( VipsForeignLoadRad *rad ) ++vips_foreign_load_rad_init(VipsForeignLoadRad *rad) + { + } + +@@ -157,63 +155,61 @@ typedef struct _VipsForeignLoadRadSource { + + typedef VipsForeignLoadRadClass VipsForeignLoadRadSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadRadSource, vips_foreign_load_rad_source, +- vips_foreign_load_rad_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadRadSource, vips_foreign_load_rad_source, ++ vips_foreign_load_rad_get_type()); + + static int +-vips_foreign_load_rad_source_build( VipsObject *object ) ++vips_foreign_load_rad_source_build(VipsObject *object) + { + VipsForeignLoadRad *rad = (VipsForeignLoadRad *) object; + VipsForeignLoadRadSource *source = (VipsForeignLoadRadSource *) object; + +- if( source->source ) { ++ if (source->source) { + rad->source = source->source; +- g_object_ref( rad->source ); ++ g_object_ref(rad->source); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_rad_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_rad_source_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_rad_source_is_a_source( VipsSource *source ) ++vips_foreign_load_rad_source_is_a_source(VipsSource *source) + { +- return( vips__rad_israd( source ) ); ++ return (vips__rad_israd(source)); + } + + static void +-vips_foreign_load_rad_source_class_init( VipsForeignLoadRadSourceClass *class ) ++vips_foreign_load_rad_source_class_init(VipsForeignLoadRadSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "radload_source"; +- object_class->description = _( "load rad from source" ); ++ object_class->description = _("load rad from source"); + object_class->build = vips_foreign_load_rad_source_build; + + operation_class->flags |= VIPS_OPERATION_NOCACHE; + + load_class->is_a_source = vips_foreign_load_rad_source_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadRadSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadRadSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_rad_source_init( VipsForeignLoadRadSource *source ) ++vips_foreign_load_rad_source_init(VipsForeignLoadRadSource *source) + { + } + +@@ -222,50 +218,49 @@ typedef struct _VipsForeignLoadRadFile { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadRadFile; + + typedef VipsForeignLoadRadClass VipsForeignLoadRadFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadRadFile, vips_foreign_load_rad_file, +- vips_foreign_load_rad_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadRadFile, vips_foreign_load_rad_file, ++ vips_foreign_load_rad_get_type()); + + static int +-vips_foreign_load_rad_file_build( VipsObject *object ) ++vips_foreign_load_rad_file_build(VipsObject *object) + { + VipsForeignLoadRad *rad = (VipsForeignLoadRad *) object; + VipsForeignLoadRadFile *file = (VipsForeignLoadRadFile *) object; + +- if( file->filename && +- !(rad->source = vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(rad->source = vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_rad_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_rad_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_rad_file_is_a( const char *filename ) ++vips_foreign_load_rad_file_is_a(const char *filename) + { + VipsSource *source; + int result; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( -1 ); +- result = vips_foreign_load_rad_source_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (-1); ++ result = vips_foreign_load_rad_source_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static void +-vips_foreign_load_rad_file_class_init( VipsForeignLoadRadFileClass *class ) ++vips_foreign_load_rad_file_class_init(VipsForeignLoadRadFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -274,23 +269,23 @@ vips_foreign_load_rad_file_class_init( VipsForeignLoadRadFileClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "radload"; +- object_class->description = _( "load a Radiance image from a file" ); ++ object_class->description = _("load a Radiance image from a file"); + object_class->build = vips_foreign_load_rad_file_build; + + foreign_class->suffs = vips__rad_suffs; + + load_class->is_a = vips_foreign_load_rad_file_is_a; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadRadFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadRadFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_rad_file_init( VipsForeignLoadRadFile *file ) ++vips_foreign_load_rad_file_init(VipsForeignLoadRadFile *file) + { + } + +@@ -305,46 +300,45 @@ typedef struct _VipsForeignLoadRadBuffer { + + typedef VipsForeignLoadRadClass VipsForeignLoadRadBufferClass; + +-G_DEFINE_TYPE( VipsForeignLoadRadBuffer, vips_foreign_load_rad_buffer, +- vips_foreign_load_rad_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadRadBuffer, vips_foreign_load_rad_buffer, ++ vips_foreign_load_rad_get_type()); + + static int +-vips_foreign_load_rad_buffer_build( VipsObject *object ) ++vips_foreign_load_rad_buffer_build(VipsObject *object) + { + VipsForeignLoadRad *rad = (VipsForeignLoadRad *) object; + VipsForeignLoadRadBuffer *buffer = (VipsForeignLoadRadBuffer *) object; + +- if( buffer->blob && +- !(rad->source = vips_source_new_from_memory( +- VIPS_AREA( buffer->blob )->data, +- VIPS_AREA( buffer->blob )->length )) ) +- return( -1 ); ++ if (buffer->blob && ++ !(rad->source = vips_source_new_from_memory( ++ VIPS_AREA(buffer->blob)->data, ++ VIPS_AREA(buffer->blob)->length))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_rad_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_rad_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_rad_buffer_is_a_buffer( const void *buf, size_t len ) ++vips_foreign_load_rad_buffer_is_a_buffer(const void *buf, size_t len) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_memory( buf, len )) ) +- return( FALSE ); +- result = vips_foreign_load_rad_source_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_memory(buf, len))) ++ return (FALSE); ++ result = vips_foreign_load_rad_source_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static void +-vips_foreign_load_rad_buffer_class_init( VipsForeignLoadRadBufferClass *class ) ++vips_foreign_load_rad_buffer_class_init(VipsForeignLoadRadBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -352,22 +346,21 @@ vips_foreign_load_rad_buffer_class_init( VipsForeignLoadRadBufferClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "radload_buffer"; +- object_class->description = _( "load rad from buffer" ); ++ object_class->description = _("load rad from buffer"); + object_class->build = vips_foreign_load_rad_buffer_build; + + load_class->is_a_buffer = vips_foreign_load_rad_buffer_is_a_buffer; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadRadBuffer, blob ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadRadBuffer, blob), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_load_rad_buffer_init( VipsForeignLoadRadBuffer *buffer ) ++vips_foreign_load_rad_buffer_init(VipsForeignLoadRadBuffer *buffer) + { + } + +@@ -379,35 +372,35 @@ vips_foreign_load_rad_buffer_init( VipsForeignLoadRadBuffer *buffer ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Read a Radiance (HDR) file into a VIPS image. ++ * Read a Radiance (HDR) file into a VIPS image. + * + * Radiance files are read as #VIPS_CODING_RAD. They have one byte for each of + * red, green and blue, and one byte of shared exponent. Some operations (like +- * vips_extract_area()) can work directly with images in this format, but +- * mmany (all the arithmetic operations, for example) will not. Unpack +- * #VIPS_CODING_RAD images to 3 band float with vips_rad2float() if ++ * vips_extract_area()) can work directly with images in this format, but ++ * mmany (all the arithmetic operations, for example) will not. Unpack ++ * #VIPS_CODING_RAD images to 3 band float with vips_rad2float() if + * you want to do arithmetic on them. + * +- * This operation ignores some header fields, like VIEW and DATE. It will not ++ * This operation ignores some header fields, like VIEW and DATE. It will not + * rotate/flip as the FORMAT string asks. + * +- * Sections of this reader from Greg Ward and Radiance with kind permission. ++ * Sections of this reader from Greg Ward and Radiance with kind permission. + * + * See also: vips_image_new_from_file(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_radload( const char *filename, VipsImage **out, ... ) ++vips_radload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "radload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("radload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -419,15 +412,15 @@ vips_radload( const char *filename, VipsImage **out, ... ) + * + * Exactly as vips_radload(), but read from a HDR-formatted memory block. + * +- * You must not free the buffer while @out is active. The +- * #VipsObject::postclose signal on @out is a good place to free. ++ * You must not free the buffer while @out is active. The ++ * #VipsObject::postclose signal on @out is a good place to free. + * + * See also: vips_radload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_radload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++vips_radload_buffer(void *buf, size_t len, VipsImage **out, ...) + { + va_list ap; + VipsBlob *blob; +@@ -435,15 +428,15 @@ vips_radload_buffer( void *buf, size_t len, VipsImage **out, ... ) + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, buf, len ); ++ blob = vips_blob_new(NULL, buf, len); + +- va_start( ap, out ); +- result = vips_call_split( "radload_buffer", ap, blob, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("radload_buffer", ap, blob, out); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( result ); ++ return (result); + } + + /** +@@ -452,22 +445,21 @@ vips_radload_buffer( void *buf, size_t len, VipsImage **out, ... ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Exactly as vips_radload(), but read from a source. ++ * Exactly as vips_radload(), but read from a source. + * + * See also: vips_radload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_radload_source( VipsSource *source, VipsImage **out, ... ) ++vips_radload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "radload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("radload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/foreign/radsave.c b/libvips/foreign/radsave.c +index 3d169b8db2..8a2dad3c87 100644 +--- a/libvips/foreign/radsave.c ++++ b/libvips/foreign/radsave.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -60,8 +60,8 @@ typedef struct _VipsForeignSaveRad { + + typedef VipsForeignSaveClass VipsForeignSaveRadClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveRad, vips_foreign_save_rad, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSaveRad, vips_foreign_save_rad, ++ VIPS_TYPE_FOREIGN_SAVE); + + /* Save a bit of typing. + */ +@@ -82,14 +82,14 @@ static VipsBandFormat vips_foreign_save_rad_format_table[10] = { + }; + + static void +-vips_foreign_save_rad_class_init( VipsForeignSaveRadClass *class ) ++vips_foreign_save_rad_class_init(VipsForeignSaveRadClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; + + object_class->nickname = "radsave_base"; +- object_class->description = _( "save Radiance" ); ++ object_class->description = _("save Radiance"); + + foreign_class->suffs = vips__rad_suffs; + +@@ -97,71 +97,69 @@ vips_foreign_save_rad_class_init( VipsForeignSaveRadClass *class ) + save_class->format_table = vips_foreign_save_rad_format_table; + save_class->coding[VIPS_CODING_NONE] = FALSE; + save_class->coding[VIPS_CODING_RAD] = TRUE; +- + } + + static void +-vips_foreign_save_rad_init( VipsForeignSaveRad *rad ) ++vips_foreign_save_rad_init(VipsForeignSaveRad *rad) + { + } + + typedef struct _VipsForeignSaveRadFile { + VipsForeignSaveRad parent_object; + +- char *filename; ++ char *filename; + } VipsForeignSaveRadFile; + + typedef VipsForeignSaveRadClass VipsForeignSaveRadFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveRadFile, vips_foreign_save_rad_file, +- vips_foreign_save_rad_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveRadFile, vips_foreign_save_rad_file, ++ vips_foreign_save_rad_get_type()); + + static int +-vips_foreign_save_rad_file_build( VipsObject *object ) ++vips_foreign_save_rad_file_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveRadFile *file = (VipsForeignSaveRadFile *) object; + + VipsTarget *target; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_rad_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_rad_file_parent_class)->build(object)) ++ return (-1); + +- if( !(target = vips_target_new_to_file( file->filename )) ) +- return( -1 ); +- if( vips__rad_save( save->ready, target ) ) { +- VIPS_UNREF( target ); +- return( -1 ); ++ if (!(target = vips_target_new_to_file(file->filename))) ++ return (-1); ++ if (vips__rad_save(save->ready, target)) { ++ VIPS_UNREF(target); ++ return (-1); + } +- VIPS_UNREF( target ); ++ VIPS_UNREF(target); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_rad_file_class_init( VipsForeignSaveRadFileClass *class ) ++vips_foreign_save_rad_file_class_init(VipsForeignSaveRadFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "radsave"; +- object_class->description = _( "save image to Radiance file" ); ++ object_class->description = _("save image to Radiance file"); + object_class->build = vips_foreign_save_rad_file_build; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveRadFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveRadFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_rad_file_init( VipsForeignSaveRadFile *file ) ++vips_foreign_save_rad_file_init(VipsForeignSaveRadFile *file) + { + } + +@@ -173,49 +171,47 @@ typedef struct _VipsForeignSaveRadTarget { + + typedef VipsForeignSaveRadClass VipsForeignSaveRadTargetClass; + +-G_DEFINE_TYPE( VipsForeignSaveRadTarget, vips_foreign_save_rad_target, +- vips_foreign_save_rad_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveRadTarget, vips_foreign_save_rad_target, ++ vips_foreign_save_rad_get_type()); + + static int +-vips_foreign_save_rad_target_build( VipsObject *object ) ++vips_foreign_save_rad_target_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveRadTarget *target = (VipsForeignSaveRadTarget *) object; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_rad_target_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_rad_target_parent_class)->build(object)) ++ return (-1); + +- if( vips__rad_save( save->ready, target->target ) ) +- return( -1 ); ++ if (vips__rad_save(save->ready, target->target)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_rad_target_class_init( VipsForeignSaveRadTargetClass *class ) ++vips_foreign_save_rad_target_class_init(VipsForeignSaveRadTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "radsave_target"; +- object_class->description = _( "save image to Radiance target" ); ++ object_class->description = _("save image to Radiance target"); + object_class->build = vips_foreign_save_rad_target_build; + +- VIPS_ARG_OBJECT( class, "target", 1, +- _( "Target" ), +- _( "Target to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveRadTarget, target ), +- VIPS_TYPE_TARGET ); +- ++ VIPS_ARG_OBJECT(class, "target", 1, ++ _("Target"), ++ _("Target to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveRadTarget, target), ++ VIPS_TYPE_TARGET); + } + + static void +-vips_foreign_save_rad_target_init( VipsForeignSaveRadTarget *target ) ++vips_foreign_save_rad_target_init(VipsForeignSaveRadTarget *target) + { + } + +@@ -227,61 +223,60 @@ typedef struct _VipsForeignSaveRadBuffer { + + typedef VipsForeignSaveRadClass VipsForeignSaveRadBufferClass; + +-G_DEFINE_TYPE( VipsForeignSaveRadBuffer, vips_foreign_save_rad_buffer, +- vips_foreign_save_rad_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveRadBuffer, vips_foreign_save_rad_buffer, ++ vips_foreign_save_rad_get_type()); + + static int +-vips_foreign_save_rad_buffer_build( VipsObject *object ) ++vips_foreign_save_rad_buffer_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + + VipsTarget *target; + VipsBlob *blob; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_rad_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_rad_buffer_parent_class)->build(object)) ++ return (-1); + +- if( !(target = vips_target_new_to_memory()) ) +- return( -1 ); ++ if (!(target = vips_target_new_to_memory())) ++ return (-1); + +- if( vips__rad_save( save->ready, target ) ) { +- VIPS_UNREF( target ); +- return( -1 ); ++ if (vips__rad_save(save->ready, target)) { ++ VIPS_UNREF(target); ++ return (-1); + } + +- g_object_get( target, "blob", &blob, NULL ); +- g_object_set( save, "buffer", blob, NULL ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ g_object_get(target, "blob", &blob, NULL); ++ g_object_set(save, "buffer", blob, NULL); ++ vips_area_unref(VIPS_AREA(blob)); + +- VIPS_UNREF( target ); ++ VIPS_UNREF(target); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_rad_buffer_class_init( VipsForeignSaveRadBufferClass *class ) ++vips_foreign_save_rad_buffer_class_init(VipsForeignSaveRadBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "radsave_buffer"; +- object_class->description = _( "save image to Radiance buffer" ); ++ object_class->description = _("save image to Radiance buffer"); + object_class->build = vips_foreign_save_rad_buffer_build; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to save to" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsForeignSaveRadBuffer, buf ), +- VIPS_TYPE_BLOB ); ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to save to"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveRadBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_save_rad_buffer_init( VipsForeignSaveRadBuffer *buffer ) ++vips_foreign_save_rad_buffer_init(VipsForeignSaveRadBuffer *buffer) + { + } + +@@ -289,39 +284,39 @@ vips_foreign_save_rad_buffer_init( VipsForeignSaveRadBuffer *buffer ) + + /** + * vips_radsave: (method) +- * @in: image to save ++ * @in: image to save + * @filename: file to write to + * @...: %NULL-terminated list of optional named arguments + * + * Write a VIPS image in Radiance (HDR) format. + * +- * Sections of this reader from Greg Ward and Radiance with kind permission. ++ * Sections of this reader from Greg Ward and Radiance with kind permission. + * + * See also: vips_image_write_to_file(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_radsave( VipsImage *in, const char *filename, ... ) ++vips_radsave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "radsave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("radsave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_radsave_buffer: (method) +- * @in: image to save ++ * @in: image to save + * @buf: (array length=len) (element-type guint8): return output buffer here + * @len: (type gsize): return output length here + * @...: %NULL-terminated list of optional named arguments + * +- * As vips_radsave(), but save to a memory buffer. ++ * As vips_radsave(), but save to a memory buffer. + * + * The address of the buffer is returned in @buf, the length of the buffer in + * @len. You are responsible for freeing the buffer with g_free() when you +@@ -332,36 +327,36 @@ vips_radsave( VipsImage *in, const char *filename, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_radsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++vips_radsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + { + va_list ap; + VipsArea *area; + int result; + +- area = NULL; ++ area = NULL; + +- va_start( ap, len ); +- result = vips_call_split( "radsave_buffer", ap, in, &area ); +- va_end( ap ); ++ va_start(ap, len); ++ result = vips_call_split("radsave_buffer", ap, in, &area); ++ va_end(ap); + +- if( !result && +- area ) { +- if( buf ) { ++ if (!result && ++ area) { ++ if (buf) { + *buf = area->data; + area->free_fn = NULL; + } +- if( len ) ++ if (len) + *len = area->length; + +- vips_area_unref( area ); ++ vips_area_unref(area); + } + +- return( result ); ++ return (result); + } + + /** + * vips_radsave_target: (method) +- * @in: image to save ++ * @in: image to save + * @target: save image to this target + * @...: %NULL-terminated list of optional named arguments + * +@@ -372,14 +367,14 @@ vips_radsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_radsave_target( VipsImage *in, VipsTarget *target, ... ) ++vips_radsave_target(VipsImage *in, VipsTarget *target, ...) + { + va_list ap; + int result; + +- va_start( ap, target ); +- result = vips_call_split( "radsave_target", ap, in, target ); +- va_end( ap ); ++ va_start(ap, target); ++ result = vips_call_split("radsave_target", ap, in, target); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/rawload.c b/libvips/foreign/rawload.c +index 682d45c970..97972a04ec 100644 +--- a/libvips/foreign/rawload.c ++++ b/libvips/foreign/rawload.c +@@ -7,28 +7,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -61,63 +61,63 @@ typedef struct _VipsForeignLoadRaw { + + typedef VipsForeignLoadClass VipsForeignLoadRawClass; + +-G_DEFINE_TYPE( VipsForeignLoadRaw, vips_foreign_load_raw, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_TYPE(VipsForeignLoadRaw, vips_foreign_load_raw, ++ VIPS_TYPE_FOREIGN_LOAD); + + static VipsForeignFlags +-vips_foreign_load_raw_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_raw_get_flags(VipsForeignLoad *load) + { +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static VipsForeignFlags +-vips_foreign_load_raw_get_flags_filename( const char *filename ) ++vips_foreign_load_raw_get_flags_filename(const char *filename) + { +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static int +-vips_foreign_load_raw_header( VipsForeignLoad *load ) ++vips_foreign_load_raw_header(VipsForeignLoad *load) + { + VipsForeignLoadRaw *raw = (VipsForeignLoadRaw *) load; + + VipsImage *out; + VipsImage *x; + +- if( !(out = vips_image_new_from_file_raw( raw->filename, +- raw->width, raw->height, +- vips_format_sizeof_unsafe( raw->format ) * raw->bands, +- raw->offset )) ) +- return( -1 ); +- +- if( vips_copy( out, &x, +- "interpretation", raw->interpretation, +- "format", raw->format, +- "bands", raw->bands, +- NULL ) ) { +- g_object_unref( out ); +- return( -1 ); ++ if (!(out = vips_image_new_from_file_raw(raw->filename, ++ raw->width, raw->height, ++ vips_format_sizeof_unsafe(raw->format) * raw->bands, ++ raw->offset))) ++ return (-1); ++ ++ if (vips_copy(out, &x, ++ "interpretation", raw->interpretation, ++ "format", raw->format, ++ "bands", raw->bands, ++ NULL)) { ++ g_object_unref(out); ++ return (-1); + } +- g_object_unref( out ); ++ g_object_unref(out); + out = x; + +- /* Remove the @out that's there now. ++ /* Remove the @out that's there now. + */ +- g_object_get( load, "out", &x, NULL ); +- g_object_unref( x ); +- g_object_unref( x ); ++ g_object_get(load, "out", &x, NULL); ++ g_object_unref(x); ++ g_object_unref(x); + +- g_object_set( load, "out", out, NULL ); ++ g_object_set(load, "out", out, NULL); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_raw_class_init( VipsForeignLoadRawClass *class ) ++vips_foreign_load_raw_class_init(VipsForeignLoadRawClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -128,66 +128,65 @@ vips_foreign_load_raw_class_init( VipsForeignLoadRawClass *class ) + operation_class->flags |= VIPS_OPERATION_UNTRUSTED; + + object_class->nickname = "rawload"; +- object_class->description = _( "load raw data from a file" ); ++ object_class->description = _("load raw data from a file"); + + load_class->get_flags = vips_foreign_load_raw_get_flags; +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_raw_get_flags_filename; + load_class->header = vips_foreign_load_raw_header; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadRaw, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadRaw, filename), ++ NULL); + +- VIPS_ARG_INT( class, "width", 20, +- _( "Width" ), +- _( "Image width in pixels" ), ++ VIPS_ARG_INT(class, "width", 20, ++ _("Width"), ++ _("Image width in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadRaw, width ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadRaw, width), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "height", 21, +- _( "Height" ), +- _( "Image height in pixels" ), ++ VIPS_ARG_INT(class, "height", 21, ++ _("Height"), ++ _("Image height in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadRaw, height ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadRaw, height), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "bands", 22, +- _( "Bands" ), +- _( "Number of bands in image" ), ++ VIPS_ARG_INT(class, "bands", 22, ++ _("Bands"), ++ _("Number of bands in image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadRaw, bands ), +- 0, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadRaw, bands), ++ 0, VIPS_MAX_COORD, 0); + +- VIPS_ARG_UINT64( class, "offset", 23, +- _( "Size of header" ), +- _( "Offset in bytes from start of file" ), ++ VIPS_ARG_UINT64(class, "offset", 23, ++ _("Size of header"), ++ _("Offset in bytes from start of file"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadRaw, offset ), +- 0, 100000000000, 0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadRaw, offset), ++ 0, 100000000000, 0); + +- VIPS_ARG_ENUM( class, "format", 24, +- _( "Format" ), +- _( "Pixel format in image" ), ++ VIPS_ARG_ENUM(class, "format", 24, ++ _("Format"), ++ _("Pixel format in image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadRaw, format ), +- VIPS_TYPE_BAND_FORMAT, VIPS_FORMAT_UCHAR ); ++ G_STRUCT_OFFSET(VipsForeignLoadRaw, format), ++ VIPS_TYPE_BAND_FORMAT, VIPS_FORMAT_UCHAR); + +- VIPS_ARG_ENUM( class, "interpretation", 25, +- _( "Interpretation" ), +- _( "Pixel interpretation" ), ++ VIPS_ARG_ENUM(class, "interpretation", 25, ++ _("Interpretation"), ++ _("Pixel interpretation"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadRaw, interpretation ), +- VIPS_TYPE_INTERPRETATION, VIPS_INTERPRETATION_MULTIBAND ); +- ++ G_STRUCT_OFFSET(VipsForeignLoadRaw, interpretation), ++ VIPS_TYPE_INTERPRETATION, VIPS_INTERPRETATION_MULTIBAND); + } + + static void +-vips_foreign_load_raw_init( VipsForeignLoadRaw *raw ) ++vips_foreign_load_raw_init(VipsForeignLoadRaw *raw) + { + raw->format = VIPS_FORMAT_UCHAR; + raw->interpretation = VIPS_INTERPRETATION_MULTIBAND; +@@ -208,33 +207,31 @@ vips_foreign_load_raw_init( VipsForeignLoadRaw *raw ) + * * @format: #VipsBandFormat, set image format + * * @interpretation: #VipsInterpretation, set image interpretation + * +- * This operation mmaps the file, setting up @out so that access to that +- * image will read from the file. ++ * This operation mmaps the file, setting up @out so that access to that ++ * image will read from the file. + * + * By default, it assumes uchar pixels. Use @format to select something else. + * + * The image will be tagged as #VIPS_INTERPRETATION_MULTIBAND. Use + * @interpretation to select something else. + * +- * Use vips_byteswap() to reverse the byte ordering if necessary. ++ * Use vips_byteswap() to reverse the byte ordering if necessary. + * + * See also: vips_image_new_from_file(), vips_copy(), vips_byteswap(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_rawload( const char *filename, VipsImage **out, +- int width, int height, int bands, ... ) ++vips_rawload(const char *filename, VipsImage **out, ++ int width, int height, int bands, ...) + { + va_list ap; + int result; + +- va_start( ap, bands ); +- result = vips_call_split( "rawload", ap, +- filename, out, width, height, bands ); +- va_end( ap ); ++ va_start(ap, bands); ++ result = vips_call_split("rawload", ap, ++ filename, out, width, height, bands); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +- +diff --git a/libvips/foreign/rawsave.c b/libvips/foreign/rawsave.c +index 6a20516a3c..b5fee709c4 100644 +--- a/libvips/foreign/rawsave.c ++++ b/libvips/foreign/rawsave.c +@@ -19,28 +19,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -75,55 +75,53 @@ typedef struct _VipsForeignSaveRaw { + + typedef VipsForeignSaveClass VipsForeignSaveRawClass; + +-G_DEFINE_TYPE( VipsForeignSaveRaw, vips_foreign_save_raw, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_TYPE(VipsForeignSaveRaw, vips_foreign_save_raw, ++ VIPS_TYPE_FOREIGN_SAVE); + + static void +-vips_foreign_save_raw_dispose( GObject *gobject ) ++vips_foreign_save_raw_dispose(GObject *gobject) + { + VipsForeignSaveRaw *raw = (VipsForeignSaveRaw *) gobject; + +- VIPS_FREEF( vips_tracked_close, raw->fd ); ++ VIPS_FREEF(vips_tracked_close, raw->fd); + +- G_OBJECT_CLASS( vips_foreign_save_raw_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_raw_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_save_raw_write( VipsRegion *region, VipsRect *area, void *a ) ++vips_foreign_save_raw_write(VipsRegion *region, VipsRect *area, void *a) + { + VipsForeignSave *save = (VipsForeignSave *) a; + VipsForeignSaveRaw *raw = (VipsForeignSaveRaw *) a; + int i; +- +- for( i = 0; i < area->height; i++ ) { +- VipsPel *p = +- VIPS_REGION_ADDR( region, area->left, area->top + i ); +- +- if( vips__write( raw->fd, p, +- VIPS_IMAGE_SIZEOF_PEL( save->in ) * area->width ) ) +- return( -1 ); ++ ++ for (i = 0; i < area->height; i++) { ++ VipsPel *p = ++ VIPS_REGION_ADDR(region, area->left, area->top + i); ++ ++ if (vips__write(raw->fd, p, ++ VIPS_IMAGE_SIZEOF_PEL(save->in) * area->width)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_raw_build( VipsObject *object ) ++vips_foreign_save_raw_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveRaw *raw = (VipsForeignSaveRaw *) object; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_raw_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_raw_parent_class)->build(object)) ++ return (-1); + +- if( (raw->fd = vips__open_image_write( raw->filename, FALSE )) < 0 || +- vips_image_pio_input( save->in ) || +- vips_sink_disc( save->in, vips_foreign_save_raw_write, raw ) ) +- return( -1 ); ++ if ((raw->fd = vips__open_image_write(raw->filename, FALSE)) < 0 || ++ vips_image_pio_input(save->in) || ++ vips_sink_disc(save->in, vips_foreign_save_raw_write, raw)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static const char *vips_foreign_save_raw_suffs[] = { +@@ -132,9 +130,9 @@ static const char *vips_foreign_save_raw_suffs[] = { + }; + + static void +-vips_foreign_save_raw_class_init( VipsForeignSaveRawClass *class ) ++vips_foreign_save_raw_class_init(VipsForeignSaveRawClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; +@@ -144,50 +142,50 @@ vips_foreign_save_raw_class_init( VipsForeignSaveRawClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "rawsave"; +- object_class->description = _( "save image to raw file" ); ++ object_class->description = _("save image to raw file"); + object_class->build = vips_foreign_save_raw_build; + + foreign_class->suffs = vips_foreign_save_raw_suffs; + + save_class->saveable = VIPS_SAVEABLE_ANY; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveRaw, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveRaw, filename), ++ NULL); + } + + static void +-vips_foreign_save_raw_init( VipsForeignSaveRaw *raw ) ++vips_foreign_save_raw_init(VipsForeignSaveRaw *raw) + { + } + + /** + * vips_rawsave: (method) +- * @in: image to save ++ * @in: image to save + * @filename: file to write to + * @...: %NULL-terminated list of optional named arguments + * + * Writes the pixels in @in to the file @filename with no header or other +- * metadata. ++ * metadata. + * + * See also: vips_image_write_to_file(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_rawsave( VipsImage *in, const char *filename, ... ) ++vips_rawsave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "rawsave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("rawsave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /* And with an fd rather than a filename. +@@ -201,50 +199,49 @@ typedef struct _VipsForeignSaveRawFd { + + typedef VipsForeignSaveClass VipsForeignSaveRawFdClass; + +-G_DEFINE_TYPE( VipsForeignSaveRawFd, vips_foreign_save_raw_fd, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_TYPE(VipsForeignSaveRawFd, vips_foreign_save_raw_fd, ++ VIPS_TYPE_FOREIGN_SAVE); + + static int +-vips_foreign_save_raw_fd_write( VipsRegion *region, VipsRect *area, void *a ) ++vips_foreign_save_raw_fd_write(VipsRegion *region, VipsRect *area, void *a) + { + VipsForeignSave *save = (VipsForeignSave *) a; + VipsForeignSaveRawFd *fd = (VipsForeignSaveRawFd *) a; + int i; +- +- for( i = 0; i < area->height; i++ ) { +- VipsPel *p = +- VIPS_REGION_ADDR( region, area->left, area->top + i ); +- +- if( vips__write( fd->fd, p, +- VIPS_IMAGE_SIZEOF_PEL( save->in ) * area->width ) ) +- return( -1 ); ++ ++ for (i = 0; i < area->height; i++) { ++ VipsPel *p = ++ VIPS_REGION_ADDR(region, area->left, area->top + i); ++ ++ if (vips__write(fd->fd, p, ++ VIPS_IMAGE_SIZEOF_PEL(save->in) * area->width)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_raw_fd_build( VipsObject *object ) ++vips_foreign_save_raw_fd_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveRawFd *fd = (VipsForeignSaveRawFd *) object; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_raw_fd_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_raw_fd_parent_class)->build(object)) ++ return (-1); + +- if( vips_image_pio_input( save->in ) || +- vips_sink_disc( save->in, +- vips_foreign_save_raw_fd_write, fd ) ) +- return( -1 ); ++ if (vips_image_pio_input(save->in) || ++ vips_sink_disc(save->in, ++ vips_foreign_save_raw_fd_write, fd)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_raw_fd_class_init( VipsForeignSaveRawFdClass *class ) ++vips_foreign_save_raw_fd_class_init(VipsForeignSaveRawFdClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; +@@ -253,29 +250,29 @@ vips_foreign_save_raw_fd_class_init( VipsForeignSaveRawFdClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "rawsave_fd"; +- object_class->description = _( "write raw image to file descriptor" ); ++ object_class->description = _("write raw image to file descriptor"); + object_class->build = vips_foreign_save_raw_fd_build; + + foreign_class->suffs = vips_foreign_save_raw_suffs; + + save_class->saveable = VIPS_SAVEABLE_ANY; + +- VIPS_ARG_INT( class, "fd", 1, +- _( "File descriptor" ), +- _( "File descriptor to write to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveRawFd, fd ), +- 0, 10000, 0 ); ++ VIPS_ARG_INT(class, "fd", 1, ++ _("File descriptor"), ++ _("File descriptor to write to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveRawFd, fd), ++ 0, 10000, 0); + } + + static void +-vips_foreign_save_raw_fd_init( VipsForeignSaveRawFd *fd ) ++vips_foreign_save_raw_fd_init(VipsForeignSaveRawFd *fd) + { + } + + /** + * vips_rawsave_fd: (method) +- * @in: image to save ++ * @in: image to save + * @fd: file to write to + * @...: %NULL-terminated list of optional named arguments + * +@@ -287,14 +284,14 @@ vips_foreign_save_raw_fd_init( VipsForeignSaveRawFd *fd ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_rawsave_fd( VipsImage *in, int fd, ... ) ++vips_rawsave_fd(VipsImage *in, int fd, ...) + { + va_list ap; + int result; + +- va_start( ap, fd ); +- result = vips_call_split( "rawsave_fd", ap, in, fd ); +- va_end( ap ); ++ va_start(ap, fd); ++ result = vips_call_split("rawsave_fd", ap, in, fd); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/spngload.c b/libvips/foreign/spngload.c +index e235904bb6..c8fc71bf20 100644 +--- a/libvips/foreign/spngload.c ++++ b/libvips/foreign/spngload.c +@@ -10,28 +10,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -80,129 +80,128 @@ typedef struct _VipsForeignLoadPng { + + typedef VipsForeignLoadClass VipsForeignLoadPngClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadPng, vips_foreign_load_png, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadPng, vips_foreign_load_png, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_png_dispose( GObject *gobject ) ++vips_foreign_load_png_dispose(GObject *gobject) + { + VipsForeignLoadPng *png = (VipsForeignLoadPng *) gobject; + +- VIPS_FREEF( spng_ctx_free, png->ctx ); +- VIPS_UNREF( png->source ); ++ VIPS_FREEF(spng_ctx_free, png->ctx); ++ VIPS_UNREF(png->source); + +- G_OBJECT_CLASS( vips_foreign_load_png_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_png_parent_class)->dispose(gobject); + } + +-static int +-vips_foreign_load_png_stream( spng_ctx *ctx, void *user, +- void *dest, size_t length ) ++static int ++vips_foreign_load_png_stream(spng_ctx *ctx, void *user, ++ void *dest, size_t length) + { +- VipsSource *source = VIPS_SOURCE( user ); ++ VipsSource *source = VIPS_SOURCE(user); + +- while( length > 0 ) { ++ while (length > 0) { + gint64 bytes_read; + +- bytes_read = vips_source_read( source, dest, length ); +- if( bytes_read < 0 ) +- return( SPNG_IO_ERROR ); +- if( bytes_read == 0 ) +- return( SPNG_IO_EOF ); ++ bytes_read = vips_source_read(source, dest, length); ++ if (bytes_read < 0) ++ return (SPNG_IO_ERROR); ++ if (bytes_read == 0) ++ return (SPNG_IO_EOF); + + dest += bytes_read; + length -= bytes_read; + } + +- return( 0 ); ++ return (0); + } + + static VipsForeignFlags +-vips_foreign_load_png_get_flags_source( VipsSource *source ) ++vips_foreign_load_png_get_flags_source(VipsSource *source) + { + spng_ctx *ctx; + struct spng_ihdr ihdr; + VipsForeignFlags flags; + +- ctx = spng_ctx_new( SPNG_CTX_IGNORE_ADLER32 ); +- spng_set_crc_action( ctx, SPNG_CRC_USE, SPNG_CRC_USE ); +- if( vips_source_rewind( source ) ) +- return( 0 ); +- spng_set_png_stream( ctx, +- vips_foreign_load_png_stream, source ); +- if( spng_get_ihdr( ctx, &ihdr ) ) { +- spng_ctx_free( ctx ); +- return( 0 ); ++ ctx = spng_ctx_new(SPNG_CTX_IGNORE_ADLER32); ++ spng_set_crc_action(ctx, SPNG_CRC_USE, SPNG_CRC_USE); ++ if (vips_source_rewind(source)) ++ return (0); ++ spng_set_png_stream(ctx, ++ vips_foreign_load_png_stream, source); ++ if (spng_get_ihdr(ctx, &ihdr)) { ++ spng_ctx_free(ctx); ++ return (0); + } +- spng_ctx_free( ctx ); ++ spng_ctx_free(ctx); + + flags = 0; +- if( ihdr.interlace_method != SPNG_INTERLACE_NONE ) ++ if (ihdr.interlace_method != SPNG_INTERLACE_NONE) + flags |= VIPS_FOREIGN_PARTIAL; + else + flags |= VIPS_FOREIGN_SEQUENTIAL; + +- return( flags ); ++ return (flags); + } + + static VipsForeignFlags +-vips_foreign_load_png_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_png_get_flags(VipsForeignLoad *load) + { + VipsForeignLoadPng *png = (VipsForeignLoadPng *) load; + +- return( vips_foreign_load_png_get_flags_source( png->source ) ); ++ return (vips_foreign_load_png_get_flags_source(png->source)); + } + + static VipsForeignFlags +-vips_foreign_load_png_get_flags_filename( const char *filename ) ++vips_foreign_load_png_get_flags_filename(const char *filename) + { + VipsSource *source; + VipsForeignFlags flags; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( 0 ); +- flags = vips_foreign_load_png_get_flags_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (0); ++ flags = vips_foreign_load_png_get_flags_source(source); ++ VIPS_UNREF(source); + +- return( flags ); ++ return (flags); + } + + /* Set the png text data as metadata on the vips image. These are always + * null-terminated strings. + */ + static void +-vips_foreign_load_png_set_text( VipsImage *out, +- int i, const char *key, const char *value ) ++vips_foreign_load_png_set_text(VipsImage *out, ++ int i, const char *key, const char *value) + { + #ifdef DEBUG +- printf( "vips_foreign_load_png_set_text: key %s, value %s\n", +- key, value ); ++ printf("vips_foreign_load_png_set_text: key %s, value %s\n", ++ key, value); + #endif /*DEBUG*/ + +- if( strcmp( key, "XML:com.adobe.xmp" ) == 0 ) { ++ if (strcmp(key, "XML:com.adobe.xmp") == 0) { + /* Save as an XMP tag. This must be a BLOB, for compatibility + * for things like the XMP blob that the tiff loader adds. + * + * Note that this will remove the null-termination from the + * string. We must carefully reattach this. + */ +- vips_image_set_blob_copy( out, +- VIPS_META_XMP_NAME, value, strlen( value ) ); ++ vips_image_set_blob_copy(out, ++ VIPS_META_XMP_NAME, value, strlen(value)); + } +- else { ++ else { + char name[256]; + + /* Save as a string comment. Some PNGs have EXIF data as + * text segments, unfortunately. + */ +- vips_snprintf( name, 256, "png-comment-%d-%s", i, key ); ++ vips_snprintf(name, 256, "png-comment-%d-%s", i, key); + +- vips_image_set_string( out, name, value ); ++ vips_image_set_string(out, name, value); + } + } + + static int +-vips_foreign_load_png_set_header( VipsForeignLoadPng *png, VipsImage *image ) ++vips_foreign_load_png_set_header(VipsForeignLoadPng *png, VipsImage *image) + { + double xres, yres; + struct spng_iccp iccp; +@@ -215,79 +214,79 @@ vips_foreign_load_png_set_header( VipsForeignLoadPng *png, VipsImage *image ) + */ + xres = 72.0 / 25.4; + yres = 72.0 / 25.4; +- if( !spng_get_phys( png->ctx, &phys ) ) { ++ if (!spng_get_phys(png->ctx, &phys)) { + /* unit 1 means pixels per metre, otherwise unspecified. + */ +- xres = phys.unit_specifier == 1 ? +- phys.ppu_x / 1000.0 : phys.ppu_x; +- yres = phys.unit_specifier == 1 ? +- phys.ppu_y / 1000.0 : phys.ppu_y; ++ xres = phys.unit_specifier == 1 ? phys.ppu_x / 1000.0 : phys.ppu_x; ++ yres = phys.unit_specifier == 1 ? phys.ppu_y / 1000.0 : phys.ppu_y; + } + +- vips_image_init_fields( image, ++ vips_image_init_fields(image, + png->ihdr.width, png->ihdr.height, png->bands, +- png->format, VIPS_CODING_NONE, png->interpretation, +- xres, yres ); ++ png->format, VIPS_CODING_NONE, png->interpretation, ++ xres, yres); + +- VIPS_SETSTR( image->filename, +- vips_connection_filename( VIPS_CONNECTION( png->source ) ) ); ++ VIPS_SETSTR(image->filename, ++ vips_connection_filename(VIPS_CONNECTION(png->source))); + +- if( vips_image_pipelinev( image, VIPS_DEMAND_STYLE_THINSTRIP, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(image, VIPS_DEMAND_STYLE_THINSTRIP, NULL)) ++ return (-1); + +- if( !spng_get_iccp( png->ctx, &iccp ) ) +- vips_image_set_blob_copy( image, +- VIPS_META_ICC_NAME, iccp.profile, iccp.profile_len ); ++ if (!spng_get_iccp(png->ctx, &iccp)) ++ vips_image_set_blob_copy(image, ++ VIPS_META_ICC_NAME, iccp.profile, iccp.profile_len); + +- if( !spng_get_text( png->ctx, NULL, &n_text ) ) { ++ if (!spng_get_text(png->ctx, NULL, &n_text)) { + struct spng_text *text; + + /* Very large numbers of text chunks are used in DoS + * attacks. + */ +- if( !png->unlimited && n_text > MAX_PNG_TEXT_CHUNKS ) { +- g_warning( _( "%d text chunks, " +- "only %d text chunks will be loaded" ), +- n_text, MAX_PNG_TEXT_CHUNKS ); ++ if (!png->unlimited && n_text > MAX_PNG_TEXT_CHUNKS) { ++ g_warning(_("%d text chunks, " ++ "only %d text chunks will be loaded"), ++ n_text, MAX_PNG_TEXT_CHUNKS); + n_text = MAX_PNG_TEXT_CHUNKS; + } + +- text = VIPS_ARRAY( VIPS_OBJECT( png ), +- n_text, struct spng_text ); +- if( !spng_get_text( png->ctx, text, &n_text ) ) { ++ text = VIPS_ARRAY(VIPS_OBJECT(png), ++ n_text, struct spng_text); ++ if (!spng_get_text(png->ctx, text, &n_text)) { + guint32 i; + +- for( i = 0; i < n_text; i++ ) ++ for (i = 0; i < n_text; i++) + /* .text is always a null-terminated C string. + */ +- vips_foreign_load_png_set_text( image, +- i, text[i].keyword, text[i].text ); ++ vips_foreign_load_png_set_text(image, ++ i, text[i].keyword, text[i].text); + } + } + +- if( !spng_get_exif( png->ctx, &exif ) ) +- vips_image_set_blob_copy( image, VIPS_META_EXIF_NAME, +- exif.data, exif.length ); ++ if (!spng_get_exif(png->ctx, &exif)) ++ vips_image_set_blob_copy(image, VIPS_META_EXIF_NAME, ++ exif.data, exif.length); + + /* Attach original palette bit depth, if any, as metadata. + */ +- if( png->ihdr.color_type == SPNG_COLOR_TYPE_INDEXED ) +- vips_image_set_int( image, +- "palette-bit-depth", png->ihdr.bit_depth ); ++ if (png->ihdr.color_type == SPNG_COLOR_TYPE_INDEXED) ++ vips_image_set_int(image, ++ "palette-bit-depth", png->ihdr.bit_depth); + + /* Let our caller know. These are very expensive to decode. + */ +- if( png->ihdr.interlace_method != SPNG_INTERLACE_NONE ) +- vips_image_set_int( image, "interlaced", 1 ); ++ if (png->ihdr.interlace_method != SPNG_INTERLACE_NONE) ++ vips_image_set_int(image, "interlaced", 1); + +- if( !spng_get_bkgd( png->ctx, &bkgd ) ) { +- const int scale = image->BandFmt == +- VIPS_FORMAT_UCHAR ? 1 : 256; ++ if (!spng_get_bkgd(png->ctx, &bkgd)) { ++ const int scale = image->BandFmt == ++ VIPS_FORMAT_UCHAR ++ ? 1 ++ : 256; + + double array[3]; + int n; + +- switch( png->ihdr.color_type ) { ++ switch (png->ihdr.color_type) { + case SPNG_COLOR_TYPE_GRAYSCALE: + case SPNG_COLOR_TYPE_GRAYSCALE_ALPHA: + array[0] = bkgd.gray / scale; +@@ -311,18 +310,18 @@ vips_foreign_load_png_set_header( VipsForeignLoadPng *png, VipsImage *image ) + break; + } + +- if( n > 0 ) +- vips_image_set_array_double( image, "background", +- array, n ); ++ if (n > 0) ++ vips_image_set_array_double(image, "background", ++ array, n); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_png_header( VipsForeignLoad *load ) ++vips_foreign_load_png_header(VipsForeignLoad *load) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( load ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(load); + VipsForeignLoadPng *png = (VipsForeignLoadPng *) load; + + int flags; +@@ -332,13 +331,13 @@ vips_foreign_load_png_header( VipsForeignLoad *load ) + /* In non-fail mode, ignore CRC errors. + */ + flags = 0; +- if( load->fail_on >= VIPS_FAIL_ON_ERROR ) ++ if (load->fail_on >= VIPS_FAIL_ON_ERROR) + flags |= SPNG_CTX_IGNORE_ADLER32; +- png->ctx = spng_ctx_new( flags ); +- if( load->fail_on >= VIPS_FAIL_ON_ERROR ) ++ png->ctx = spng_ctx_new(flags); ++ if (load->fail_on >= VIPS_FAIL_ON_ERROR) + /* Ignore and don't calculate checksums. + */ +- spng_set_crc_action( png->ctx, SPNG_CRC_USE, SPNG_CRC_USE ); ++ spng_set_crc_action(png->ctx, SPNG_CRC_USE, SPNG_CRC_USE); + + /* Set limits to avoid decompression bombs. Set chunk limits to 60mb + * -- we've seen 50mb XMP blocks in the wild. +@@ -346,60 +345,60 @@ vips_foreign_load_png_header( VipsForeignLoad *load ) + * No need to test the decoded image size -- the user can do that if + * they wish. + */ +- if ( !png->unlimited ) { +- spng_set_image_limits( png->ctx, +- VIPS_MAX_COORD, VIPS_MAX_COORD ); +- spng_set_chunk_limits( png->ctx, +- 60 * 1024 * 1024, 60 * 1024 * 1024 ); ++ if (!png->unlimited) { ++ spng_set_image_limits(png->ctx, ++ VIPS_MAX_COORD, VIPS_MAX_COORD); ++ spng_set_chunk_limits(png->ctx, ++ 60 * 1024 * 1024, 60 * 1024 * 1024); + } + +- if( vips_source_rewind( png->source ) ) +- return( -1 ); +- spng_set_png_stream( png->ctx, +- vips_foreign_load_png_stream, png->source ); +- if( (error = spng_get_ihdr( png->ctx, &png->ihdr )) ) { +- vips_error( class->nickname, "%s", spng_strerror( error ) ); +- return( -1 ); ++ if (vips_source_rewind(png->source)) ++ return (-1); ++ spng_set_png_stream(png->ctx, ++ vips_foreign_load_png_stream, png->source); ++ if ((error = spng_get_ihdr(png->ctx, &png->ihdr))) { ++ vips_error(class->nickname, "%s", spng_strerror(error)); ++ return (-1); + } + + #ifdef DEBUG +- printf( "width: %d\nheight: %d\nbit depth: %d\ncolor type: %d\n", ++ printf("width: %d\nheight: %d\nbit depth: %d\ncolor type: %d\n", + png->ihdr.width, png->ihdr.height, +- png->ihdr.bit_depth, png->ihdr.color_type ); +- printf( "compression method: %d\nfilter method: %d\n" +- "interlace method: %d\n", ++ png->ihdr.bit_depth, png->ihdr.color_type); ++ printf("compression method: %d\nfilter method: %d\n" ++ "interlace method: %d\n", + png->ihdr.compression_method, png->ihdr.filter_method, +- png->ihdr.interlace_method ); ++ png->ihdr.interlace_method); + #endif /*DEBUG*/ + + /* Just convert to host-endian if nothing else applies. +- */ ++ */ + png->fmt = SPNG_FMT_PNG; + +- switch( png->ihdr.color_type ) { +- case SPNG_COLOR_TYPE_INDEXED: +- png->bands = 3; ++ switch (png->ihdr.color_type) { ++ case SPNG_COLOR_TYPE_INDEXED: ++ png->bands = 3; + break; + +- case SPNG_COLOR_TYPE_GRAYSCALE_ALPHA: +- case SPNG_COLOR_TYPE_GRAYSCALE: +- png->bands = 1; ++ case SPNG_COLOR_TYPE_GRAYSCALE_ALPHA: ++ case SPNG_COLOR_TYPE_GRAYSCALE: ++ png->bands = 1; + break; + +- case SPNG_COLOR_TYPE_TRUECOLOR: +- case SPNG_COLOR_TYPE_TRUECOLOR_ALPHA: +- png->bands = 3; ++ case SPNG_COLOR_TYPE_TRUECOLOR: ++ case SPNG_COLOR_TYPE_TRUECOLOR_ALPHA: ++ png->bands = 3; + break; + + default: +- vips_error( class->nickname, "%s", _( "unknown color type" ) ); +- return( -1 ); ++ vips_error(class->nickname, "%s", _("unknown color type")); ++ return (-1); + } + + /* Set libvips format and interpretation. + */ +- if( png->ihdr.bit_depth > 8 ) { +- if( png->bands < 3 ) ++ if (png->ihdr.bit_depth > 8) { ++ if (png->bands < 3) + png->interpretation = VIPS_INTERPRETATION_GREY16; + else + png->interpretation = VIPS_INTERPRETATION_RGB16; +@@ -407,7 +406,7 @@ vips_foreign_load_png_header( VipsForeignLoad *load ) + png->format = VIPS_FORMAT_USHORT; + } + else { +- if( png->bands < 3 ) ++ if (png->bands < 3) + png->interpretation = VIPS_INTERPRETATION_B_W; + else + png->interpretation = VIPS_INTERPRETATION_sRGB; +@@ -417,233 +416,232 @@ vips_foreign_load_png_header( VipsForeignLoad *load ) + + /* Expand palette images. + */ +- if( png->ihdr.color_type == SPNG_COLOR_TYPE_INDEXED ) ++ if (png->ihdr.color_type == SPNG_COLOR_TYPE_INDEXED) + png->fmt = SPNG_FMT_RGB8; + + /* Expand <8 bit images to full bytes. + */ +- if( png->ihdr.color_type == SPNG_COLOR_TYPE_GRAYSCALE && +- png->ihdr.bit_depth < 8 ) ++ if (png->ihdr.color_type == SPNG_COLOR_TYPE_GRAYSCALE && ++ png->ihdr.bit_depth < 8) + png->fmt = SPNG_FMT_G8; + + /* Try reading the optional transparency chunk. This will cause all + * chunks up to the first IDAT to be read in, so it can fail if any + * chunk has an error. + */ +- error = spng_get_trns( png->ctx, &trns ); +- if( error && +- error != SPNG_ECHUNKAVAIL ) { +- vips_error( class->nickname, "%s", spng_strerror( error ) ); +- return( -1 ); ++ error = spng_get_trns(png->ctx, &trns); ++ if (error && ++ error != SPNG_ECHUNKAVAIL) { ++ vips_error(class->nickname, "%s", spng_strerror(error)); ++ return (-1); + } + + /* Expand transparency. + * +- * The _ALPHA types should not have the optional trns chunk (they +- * always have a transparent band), see ++ * The _ALPHA types should not have the optional trns chunk (they ++ * always have a transparent band), see + * https://www.w3.org/TR/2003/REC-PNG-20031110/#11tRNS + * +- * It's quick and safe to call spng_get_trns() again, and we now know ++ * It's quick and safe to call spng_get_trns() again, and we now know + * it will only fail for no transparency chunk. + */ +- if( png->ihdr.color_type == SPNG_COLOR_TYPE_GRAYSCALE_ALPHA || +- png->ihdr.color_type == SPNG_COLOR_TYPE_TRUECOLOR_ALPHA ) ++ if (png->ihdr.color_type == SPNG_COLOR_TYPE_GRAYSCALE_ALPHA || ++ png->ihdr.color_type == SPNG_COLOR_TYPE_TRUECOLOR_ALPHA) + png->bands += 1; +- else if( !spng_get_trns( png->ctx, &trns ) ) { ++ else if (!spng_get_trns(png->ctx, &trns)) { + png->bands += 1; + +- if( png->ihdr.color_type == SPNG_COLOR_TYPE_TRUECOLOR ) { +- if( png->ihdr.bit_depth == 16 ) ++ if (png->ihdr.color_type == SPNG_COLOR_TYPE_TRUECOLOR) { ++ if (png->ihdr.bit_depth == 16) + png->fmt = SPNG_FMT_RGBA16; +- else ++ else + png->fmt = SPNG_FMT_RGBA8; + } +- else if( png->ihdr.color_type == SPNG_COLOR_TYPE_INDEXED ) ++ else if (png->ihdr.color_type == SPNG_COLOR_TYPE_INDEXED) + png->fmt = SPNG_FMT_RGBA8; +- else if( png->ihdr.color_type == SPNG_COLOR_TYPE_GRAYSCALE ) { +- if( png->ihdr.bit_depth == 16 ) ++ else if (png->ihdr.color_type == SPNG_COLOR_TYPE_GRAYSCALE) { ++ if (png->ihdr.bit_depth == 16) + png->fmt = SPNG_FMT_GA16; +- else ++ else + png->fmt = SPNG_FMT_GA8; + } + } + +- vips_source_minimise( png->source ); ++ vips_source_minimise(png->source); + +- if( vips_foreign_load_png_set_header( png, load->out ) ) +- return( -1 ); ++ if (vips_foreign_load_png_set_header(png, load->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_png_minimise( VipsObject *object, VipsForeignLoadPng *png ) ++vips_foreign_load_png_minimise(VipsObject *object, VipsForeignLoadPng *png) + { +- vips_source_minimise( png->source ); ++ vips_source_minimise(png->source); + } + + static int +-vips_foreign_load_png_generate( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_foreign_load_png_generate(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { +- VipsRect *r = &or->valid; +- VipsForeignLoad *load = VIPS_FOREIGN_LOAD( a ); ++ VipsRect *r = & or->valid; ++ VipsForeignLoad *load = VIPS_FOREIGN_LOAD(a); + VipsForeignLoadPng *png = (VipsForeignLoadPng *) load; +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( png ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(png); + + int y; + int error; + + #ifdef DEBUG +- printf( "vips_foreign_load_png_generate: line %d, %d rows\n", +- r->top, r->height ); +- printf( "vips_foreign_load_png_generate: y_top = %d\n", png->y_pos ); ++ printf("vips_foreign_load_png_generate: line %d, %d rows\n", ++ r->top, r->height); ++ printf("vips_foreign_load_png_generate: y_top = %d\n", png->y_pos); + #endif /*DEBUG*/ + + /* We're inside a tilecache where tiles are the full image width, so + * this should always be true. + */ +- g_assert( r->left == 0 ); +- g_assert( r->width == or->im->Xsize ); +- g_assert( VIPS_RECT_BOTTOM( r ) <= or->im->Ysize ); ++ g_assert(r->left == 0); ++ g_assert(r->width == or->im->Xsize); ++ g_assert(VIPS_RECT_BOTTOM(r) <= or->im->Ysize); + + /* Tiles should always be a strip in height, unless it's the final + * strip. + */ +- g_assert( r->height == VIPS_MIN( VIPS__FATSTRIP_HEIGHT, +- or->im->Ysize - r->top ) ); ++ g_assert(r->height == VIPS_MIN(VIPS__FATSTRIP_HEIGHT, or->im->Ysize - r->top)); + + /* And check that y_pos is correct. It should be, since we are inside + * a vips_sequential(). + */ +- if( r->top != png->y_pos ) { +- vips_error( class->nickname, +- _( "out of order read at line %d" ), png->y_pos ); +- return( -1 ); ++ if (r->top != png->y_pos) { ++ vips_error(class->nickname, ++ _("out of order read at line %d"), png->y_pos); ++ return (-1); + } + +- for( y = 0; y < r->height; y++ ) { +- /* libspng returns EOI when successfully reading the ++ for (y = 0; y < r->height; y++) { ++ /* libspng returns EOI when successfully reading the + * final line of input. + */ +- error = spng_decode_row( png->ctx, +- VIPS_REGION_ADDR( or, 0, r->top + y ), +- VIPS_REGION_SIZEOF_LINE( or ) ); +- if( error != 0 && +- error != SPNG_EOI ) { +- /* We've failed to read some pixels. Knock this +- * operation out of cache. ++ error = spng_decode_row(png->ctx, ++ VIPS_REGION_ADDR(or, 0, r->top + y), ++ VIPS_REGION_SIZEOF_LINE(or)); ++ if (error != 0 && ++ error != SPNG_EOI) { ++ /* We've failed to read some pixels. Knock this ++ * operation out of cache. + */ +- vips_operation_invalidate( VIPS_OPERATION( png ) ); ++ vips_operation_invalidate(VIPS_OPERATION(png)); + + #ifdef DEBUG +- printf( "vips_foreign_load_png_generate:\n" ); +- printf( " spng_decode_row() failed, line %d\n", +- r->top + y ); +- printf( " thread %p\n", g_thread_self() ); +- printf( " error %s\n", spng_strerror( error ) ); ++ printf("vips_foreign_load_png_generate:\n"); ++ printf(" spng_decode_row() failed, line %d\n", ++ r->top + y); ++ printf(" thread %p\n", g_thread_self()); ++ printf(" error %s\n", spng_strerror(error)); + #endif /*DEBUG*/ + +- g_warning( "%s: %s", +- class->nickname, spng_strerror( error ) ); ++ g_warning("%s: %s", ++ class->nickname, spng_strerror(error)); + +- /* And bail if trunc is on. ++ /* And bail if trunc is on. + */ +- if( load->fail_on >= VIPS_FAIL_ON_TRUNCATED ) { +- vips_error( class->nickname, +- "%s", _( "libspng read error" ) ); +- return( -1 ); ++ if (load->fail_on >= VIPS_FAIL_ON_TRUNCATED) { ++ vips_error(class->nickname, ++ "%s", _("libspng read error")); ++ return (-1); + } + } + + png->y_pos += 1; + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_png_load( VipsForeignLoad *load ) ++vips_foreign_load_png_load(VipsForeignLoad *load) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( load ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(load); + VipsForeignLoadPng *png = (VipsForeignLoadPng *) load; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( load ), 3 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(load), 3); + + enum spng_decode_flags flags; + int error; + +- if( vips_source_decode( png->source ) ) +- return( -1 ); ++ if (vips_source_decode(png->source)) ++ return (-1); + + /* Decode transparency, if available. + */ + flags = SPNG_DECODE_TRNS; + +- if( png->ihdr.interlace_method != SPNG_INTERLACE_NONE ) { +- /* Arg awful interlaced image. We have to load to a huge mem ++ if (png->ihdr.interlace_method != SPNG_INTERLACE_NONE) { ++ /* Arg awful interlaced image. We have to load to a huge mem + * buffer, then copy to out. + */ + t[0] = vips_image_new_memory(); +- if( vips_foreign_load_png_set_header( png, t[0] ) || +- vips_image_write_prepare( t[0] ) ) +- return( -1 ); +- +- if( (error = spng_decode_image( png->ctx, +- VIPS_IMAGE_ADDR( t[0], 0, 0 ), +- VIPS_IMAGE_SIZEOF_IMAGE( t[0] ), +- png->fmt, flags )) ) { +- vips_error( class->nickname, +- "%s", spng_strerror( error ) ); +- return( -1 ); ++ if (vips_foreign_load_png_set_header(png, t[0]) || ++ vips_image_write_prepare(t[0])) ++ return (-1); ++ ++ if ((error = spng_decode_image(png->ctx, ++ VIPS_IMAGE_ADDR(t[0], 0, 0), ++ VIPS_IMAGE_SIZEOF_IMAGE(t[0]), ++ png->fmt, flags))) { ++ vips_error(class->nickname, ++ "%s", spng_strerror(error)); ++ return (-1); + } + + /* We've now finished reading the file. + */ +- vips_source_minimise( png->source ); ++ vips_source_minimise(png->source); + +- if( vips_image_write( t[0], load->real ) ) +- return( -1 ); ++ if (vips_image_write(t[0], load->real)) ++ return (-1); + } + else { + t[0] = vips_image_new(); + +- if( vips_foreign_load_png_set_header( png, t[0] ) ) +- return( -1 ); ++ if (vips_foreign_load_png_set_header(png, t[0])) ++ return (-1); + + /* We can decode these progressively. + */ + flags |= SPNG_DECODE_PROGRESSIVE; + +- if( (error = spng_decode_image( png->ctx, NULL, 0, +- png->fmt, flags )) ) { +- vips_error( class->nickname, +- "%s", spng_strerror( error ) ); +- return( -1 ); ++ if ((error = spng_decode_image(png->ctx, NULL, 0, ++ png->fmt, flags))) { ++ vips_error(class->nickname, ++ "%s", spng_strerror(error)); ++ return (-1); + } + + /* Close input immediately at end of read. + */ +- g_signal_connect( t[0], "minimise", +- G_CALLBACK( vips_foreign_load_png_minimise ), png ); +- +- if( vips_image_generate( t[0], +- NULL, vips_foreign_load_png_generate, NULL, +- png, NULL ) || +- vips_sequential( t[0], &t[1], +- "tile_height", VIPS__FATSTRIP_HEIGHT, +- NULL ) || +- vips_image_write( t[1], load->real ) ) +- return( -1 ); ++ g_signal_connect(t[0], "minimise", ++ G_CALLBACK(vips_foreign_load_png_minimise), png); ++ ++ if (vips_image_generate(t[0], ++ NULL, vips_foreign_load_png_generate, NULL, ++ png, NULL) || ++ vips_sequential(t[0], &t[1], ++ "tile_height", VIPS__FATSTRIP_HEIGHT, ++ NULL) || ++ vips_image_write(t[1], load->real)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_png_class_init( VipsForeignLoadPngClass *class ) ++vips_foreign_load_png_class_init(VipsForeignLoadPngClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -653,28 +651,28 @@ vips_foreign_load_png_class_init( VipsForeignLoadPngClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pngload_base"; +- object_class->description = _( "load png base class" ); ++ object_class->description = _("load png base class"); + + /* We are fast at is_a(), so high priority. + */ + foreign_class->priority = 200; + +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_png_get_flags_filename; + load_class->get_flags = vips_foreign_load_png_get_flags; + load_class->header = vips_foreign_load_png_header; + load_class->load = vips_foreign_load_png_load; + +- VIPS_ARG_BOOL( class, "unlimited", 23, +- _( "Unlimited" ), +- _( "Remove all denial of service limits" ), ++ VIPS_ARG_BOOL(class, "unlimited", 23, ++ _("Unlimited"), ++ _("Remove all denial of service limits"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPng, unlimited ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignLoadPng, unlimited), ++ FALSE); + } + + static void +-vips_foreign_load_png_init( VipsForeignLoadPng *png ) ++vips_foreign_load_png_init(VipsForeignLoadPng *png) + { + } + +@@ -689,71 +687,69 @@ typedef struct _VipsForeignLoadPngSource { + + typedef VipsForeignLoadPngClass VipsForeignLoadPngSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadPngSource, vips_foreign_load_png_source, +- vips_foreign_load_png_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadPngSource, vips_foreign_load_png_source, ++ vips_foreign_load_png_get_type()); + + static int +-vips_foreign_load_png_source_build( VipsObject *object ) ++vips_foreign_load_png_source_build(VipsObject *object) + { + VipsForeignLoadPng *png = (VipsForeignLoadPng *) object; + VipsForeignLoadPngSource *source = (VipsForeignLoadPngSource *) object; + +- if( source->source ) { ++ if (source->source) { + png->source = source->source; +- g_object_ref( png->source ); ++ g_object_ref(png->source); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_png_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_png_source_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_png_source_is_a_source( VipsSource *source ) ++vips_foreign_load_png_source_is_a_source(VipsSource *source) + { + static unsigned char signature[8] = { 137, 80, 78, 71, 13, 10, 26, 10 }; + + const unsigned char *p; + +- if( (p = vips_source_sniff( source, 8 )) && +- memcmp( p, signature, 8 ) == 0 ) +- return( TRUE ); ++ if ((p = vips_source_sniff(source, 8)) && ++ memcmp(p, signature, 8) == 0) ++ return (TRUE); + +- return( FALSE ); ++ return (FALSE); + } + + static void +-vips_foreign_load_png_source_class_init( VipsForeignLoadPngSourceClass *class ) ++vips_foreign_load_png_source_class_init(VipsForeignLoadPngSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pngload_source"; +- object_class->description = _( "load png from source" ); ++ object_class->description = _("load png from source"); + object_class->build = vips_foreign_load_png_source_build; + + operation_class->flags |= VIPS_OPERATION_NOCACHE; + + load_class->is_a_source = vips_foreign_load_png_source_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPngSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadPngSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_png_source_init( VipsForeignLoadPngSource *source ) ++vips_foreign_load_png_source_init(VipsForeignLoadPngSource *source) + { + } + +@@ -762,52 +758,51 @@ typedef struct _VipsForeignLoadPngFile { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadPngFile; + + typedef VipsForeignLoadPngClass VipsForeignLoadPngFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadPngFile, vips_foreign_load_png_file, +- vips_foreign_load_png_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadPngFile, vips_foreign_load_png_file, ++ vips_foreign_load_png_get_type()); + + static int +-vips_foreign_load_png_file_build( VipsObject *object ) ++vips_foreign_load_png_file_build(VipsObject *object) + { + VipsForeignLoadPng *png = (VipsForeignLoadPng *) object; + VipsForeignLoadPngFile *file = (VipsForeignLoadPngFile *) object; + +- if( file->filename && +- !(png->source = vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(png->source = vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_png_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_png_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_png_file_is_a( const char *filename ) ++vips_foreign_load_png_file_is_a(const char *filename) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( FALSE ); +- result = vips_foreign_load_png_source_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (FALSE); ++ result = vips_foreign_load_png_source_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + const char *vips_foreign_load_png_file_suffs[] = { ".png", NULL }; + + static void +-vips_foreign_load_png_file_class_init( VipsForeignLoadPngFileClass *class ) ++vips_foreign_load_png_file_class_init(VipsForeignLoadPngFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -816,23 +811,23 @@ vips_foreign_load_png_file_class_init( VipsForeignLoadPngFileClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pngload"; +- object_class->description = _( "load png from file" ); ++ object_class->description = _("load png from file"); + object_class->build = vips_foreign_load_png_file_build; + + foreign_class->suffs = vips_foreign_load_png_file_suffs; + + load_class->is_a = vips_foreign_load_png_file_is_a; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPngFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadPngFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_png_file_init( VipsForeignLoadPngFile *file ) ++vips_foreign_load_png_file_init(VipsForeignLoadPngFile *file) + { + } + +@@ -847,46 +842,45 @@ typedef struct _VipsForeignLoadPngBuffer { + + typedef VipsForeignLoadPngClass VipsForeignLoadPngBufferClass; + +-G_DEFINE_TYPE( VipsForeignLoadPngBuffer, vips_foreign_load_png_buffer, +- vips_foreign_load_png_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadPngBuffer, vips_foreign_load_png_buffer, ++ vips_foreign_load_png_get_type()); + + static int +-vips_foreign_load_png_buffer_build( VipsObject *object ) ++vips_foreign_load_png_buffer_build(VipsObject *object) + { + VipsForeignLoadPng *png = (VipsForeignLoadPng *) object; + VipsForeignLoadPngBuffer *buffer = (VipsForeignLoadPngBuffer *) object; + +- if( buffer->blob && +- !(png->source = vips_source_new_from_memory( +- VIPS_AREA( buffer->blob )->data, +- VIPS_AREA( buffer->blob )->length )) ) +- return( -1 ); ++ if (buffer->blob && ++ !(png->source = vips_source_new_from_memory( ++ VIPS_AREA(buffer->blob)->data, ++ VIPS_AREA(buffer->blob)->length))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_png_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_png_buffer_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_png_buffer_is_a_buffer( const void *buf, size_t len ) ++vips_foreign_load_png_buffer_is_a_buffer(const void *buf, size_t len) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_memory( buf, len )) ) +- return( FALSE ); +- result = vips_foreign_load_png_source_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_memory(buf, len))) ++ return (FALSE); ++ result = vips_foreign_load_png_source_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static void +-vips_foreign_load_png_buffer_class_init( VipsForeignLoadPngBufferClass *class ) ++vips_foreign_load_png_buffer_class_init(VipsForeignLoadPngBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -894,22 +888,21 @@ vips_foreign_load_png_buffer_class_init( VipsForeignLoadPngBufferClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pngload_buffer"; +- object_class->description = _( "load png from buffer" ); ++ object_class->description = _("load png from buffer"); + object_class->build = vips_foreign_load_png_buffer_build; + + load_class->is_a_buffer = vips_foreign_load_png_buffer_is_a_buffer; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadPngBuffer, blob ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadPngBuffer, blob), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_load_png_buffer_init( VipsForeignLoadPngBuffer *buffer ) ++vips_foreign_load_png_buffer_init(VipsForeignLoadPngBuffer *buffer) + { + } + +diff --git a/libvips/foreign/spngsave.c b/libvips/foreign/spngsave.c +index dfa661594d..919b2cdd70 100644 +--- a/libvips/foreign/spngsave.c ++++ b/libvips/foreign/spngsave.c +@@ -18,28 +18,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -100,81 +100,80 @@ typedef struct _VipsForeignSaveSpng { + + typedef VipsForeignSaveClass VipsForeignSaveSpngClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveSpng, vips_foreign_save_spng, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSaveSpng, vips_foreign_save_spng, ++ VIPS_TYPE_FOREIGN_SAVE); + + static void +-vips_foreign_save_spng_dispose( GObject *gobject ) ++vips_foreign_save_spng_dispose(GObject *gobject) + { + VipsForeignSaveSpng *spng = (VipsForeignSaveSpng *) gobject; + + GSList *p; + +- VIPS_UNREF( spng->target ); +- VIPS_UNREF( spng->memory ); +- VIPS_FREEF( spng_ctx_free, spng->ctx ); ++ VIPS_UNREF(spng->target); ++ VIPS_UNREF(spng->memory); ++ VIPS_FREEF(spng_ctx_free, spng->ctx); + +- for( p = spng->text_chunks; p; p = p->next ) { ++ for (p = spng->text_chunks; p; p = p->next) { + struct spng_text *text = (struct spng_text *) p->data; + +- VIPS_FREE( text->text ); +- VIPS_FREE( text ); ++ VIPS_FREE(text->text); ++ VIPS_FREE(text); + } +- VIPS_FREEF( g_slist_free, spng->text_chunks ); ++ VIPS_FREEF(g_slist_free, spng->text_chunks); + +- VIPS_FREE( spng->line ); ++ VIPS_FREE(spng->line); + +- G_OBJECT_CLASS( vips_foreign_save_spng_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_spng_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_save_spng_text( VipsForeignSaveSpng *spng, +- const char *keyword, const char *value ) ++vips_foreign_save_spng_text(VipsForeignSaveSpng *spng, ++ const char *keyword, const char *value) + { +- struct spng_text *text = VIPS_NEW( NULL, struct spng_text ); ++ struct spng_text *text = VIPS_NEW(NULL, struct spng_text); + +- vips_strncpy( text->keyword, keyword, sizeof( text->keyword ) ); ++ vips_strncpy(text->keyword, keyword, sizeof(text->keyword)); + /* FIXME ... is this right? + */ + text->type = SPNG_TEXT; +- text->length = strlen( value ); +- text->text = g_strdup( value ); ++ text->length = strlen(value); ++ text->text = g_strdup(value); + +- spng->text_chunks = g_slist_prepend( spng->text_chunks, text ); +- +- return( 0 ); ++ spng->text_chunks = g_slist_prepend(spng->text_chunks, text); ++ ++ return (0); + } + + static void * +-vips_foreign_save_spng_comment( VipsImage *image, +- const char *field, GValue *value, void *user_data ) ++vips_foreign_save_spng_comment(VipsImage *image, ++ const char *field, GValue *value, void *user_data) + { + VipsForeignSaveSpng *spng = (VipsForeignSaveSpng *) user_data; + +- if( vips_isprefix( "png-comment-", field ) ) { ++ if (vips_isprefix("png-comment-", field)) { + const char *value; + int i; + char key[256]; + +- if( vips_image_get_string( image, field, &value ) ) +- return( image ); ++ if (vips_image_get_string(image, field, &value)) ++ return (image); + +- if( strlen( field ) > 256 || +- sscanf( field, "png-comment-%d-%80s", &i, key ) != 2 ) { +- vips_error( "vips2png", +- "%s", _( "bad png comment key" ) ); +- return( image ); ++ if (strlen(field) > 256 || ++ sscanf(field, "png-comment-%d-%80s", &i, key) != 2) { ++ vips_error("vips2png", ++ "%s", _("bad png comment key")); ++ return (image); + } + +- vips_foreign_save_spng_text( spng, key, value ); ++ vips_foreign_save_spng_text(spng, key, value); + } + +- return( NULL ); ++ return (NULL); + } + + static int +-vips_foreign_save_spng_metadata( VipsForeignSaveSpng *spng, VipsImage *in ) ++vips_foreign_save_spng_metadata(VipsForeignSaveSpng *spng, VipsImage *in) + { + struct spng_iccp iccp; + uint32_t n_text; +@@ -182,203 +181,205 @@ vips_foreign_save_spng_metadata( VipsForeignSaveSpng *spng, VipsImage *in ) + int i; + GSList *p; + +- if( spng->profile ) { ++ if (spng->profile) { + VipsBlob *blob; + +- if( vips_profile_load( spng->profile, &blob, NULL ) ) +- return( -1 ); +- if( blob ) { ++ if (vips_profile_load(spng->profile, &blob, NULL)) ++ return (-1); ++ if (blob) { + size_t length; +- const void *data = vips_blob_get( blob, &length ); +- char *basename = g_path_get_basename( spng->profile ); ++ const void *data = vips_blob_get(blob, &length); ++ char *basename = g_path_get_basename(spng->profile); + + #ifdef DEBUG +- printf( "write_vips: attaching %zd bytes " +- "of ICC profile\n", length ); ++ printf("write_vips: attaching %zd bytes " ++ "of ICC profile\n", ++ length); + #endif /*DEBUG*/ + +- vips_strncpy( iccp.profile_name, basename, +- sizeof( iccp.profile_name ) ); ++ vips_strncpy(iccp.profile_name, basename, ++ sizeof(iccp.profile_name)); + iccp.profile_len = length; + iccp.profile = (void *) data; +- spng_set_iccp( spng->ctx, &iccp ); ++ spng_set_iccp(spng->ctx, &iccp); + +- vips_area_unref( (VipsArea *) blob ); +- g_free( basename ); ++ vips_area_unref((VipsArea *) blob); ++ g_free(basename); + } + } +- else if( vips_image_get_typeof( in, VIPS_META_ICC_NAME ) ) { ++ else if (vips_image_get_typeof(in, VIPS_META_ICC_NAME)) { + const void *data; + size_t length; + +- if( vips_image_get_blob( in, VIPS_META_ICC_NAME, +- &data, &length ) ) +- return( -1 ); ++ if (vips_image_get_blob(in, VIPS_META_ICC_NAME, ++ &data, &length)) ++ return (-1); + + #ifdef DEBUG +- printf( "write_vips: attaching %zd bytes " +- "of ICC profile\n", length ); ++ printf("write_vips: attaching %zd bytes " ++ "of ICC profile\n", ++ length); + #endif /*DEBUG*/ + +- vips_strncpy( iccp.profile_name, "icc", +- sizeof( iccp.profile_name ) ); ++ vips_strncpy(iccp.profile_name, "icc", ++ sizeof(iccp.profile_name)); + iccp.profile_len = length; + iccp.profile = (void *) data; + +- spng_set_iccp( spng->ctx, &iccp ); ++ spng_set_iccp(spng->ctx, &iccp); + } + +- if( vips_image_get_typeof( in, VIPS_META_XMP_NAME ) ) { ++ if (vips_image_get_typeof(in, VIPS_META_XMP_NAME)) { + const void *data; + size_t length; + char *str; + +- if( vips_image_get_blob( in, +- VIPS_META_XMP_NAME, &data, &length ) ) +- return( -1 ); ++ if (vips_image_get_blob(in, ++ VIPS_META_XMP_NAME, &data, &length)) ++ return (-1); + + /* The blob form of the XMP metadata is missing the + * terminating \0 bytes, we have to paste it back, + * unfortunately. See pngload. + */ +- str = g_malloc( length + 1 ); +- vips_strncpy( str, data, length + 1 ); +- vips_foreign_save_spng_text( spng, "XML:com.adobe.xmp", str ); +- g_free( str ); ++ str = g_malloc(length + 1); ++ vips_strncpy(str, data, length + 1); ++ vips_foreign_save_spng_text(spng, "XML:com.adobe.xmp", str); ++ g_free(str); + } + +- if( vips_image_get_typeof( in, VIPS_META_EXIF_NAME ) ) { ++ if (vips_image_get_typeof(in, VIPS_META_EXIF_NAME)) { + struct spng_exif exif; + +- if( vips__exif_update( in ) || +- vips_image_get_blob( in, VIPS_META_EXIF_NAME, +- (const void **) &exif.data, &exif.length ) ) +- return( -1 ); ++ if (vips__exif_update(in) || ++ vips_image_get_blob(in, VIPS_META_EXIF_NAME, ++ (const void **) &exif.data, &exif.length)) ++ return (-1); + + /* libspng does not want the JFIF "Exif\0\0" prefix. + */ +- if( exif.length >= 6 && +- vips_isprefix( "Exif", exif.data ) ) { ++ if (exif.length >= 6 && ++ vips_isprefix("Exif", exif.data)) { + exif.data += 6; + exif.length -= 6; + } + +- spng_set_exif( spng->ctx, &exif ); ++ spng_set_exif(spng->ctx, &exif); + } + +- if( vips_image_map( in, vips_foreign_save_spng_comment, spng ) ) +- return( -1 ); ++ if (vips_image_map(in, vips_foreign_save_spng_comment, spng)) ++ return (-1); + +- n_text = g_slist_length( spng->text_chunks ); +- text_chunk_array = VIPS_ARRAY( NULL, n_text, struct spng_text ); +- for( i = 0, p = spng->text_chunks; p; p = p->next, i++ ) { ++ n_text = g_slist_length(spng->text_chunks); ++ text_chunk_array = VIPS_ARRAY(NULL, n_text, struct spng_text); ++ for (i = 0, p = spng->text_chunks; p; p = p->next, i++) { + struct spng_text *text = (struct spng_text *) p->data; + + text_chunk_array[i] = *text; + } + #ifdef DEBUG +- printf( "attaching %u text items\n", n_text ); ++ printf("attaching %u text items\n", n_text); + #endif /*DEBUG*/ +- spng_set_text( spng->ctx, text_chunk_array, n_text ); +- VIPS_FREE( text_chunk_array ); ++ spng_set_text(spng->ctx, text_chunk_array, n_text); ++ VIPS_FREE(text_chunk_array); + +- return( 0 ); ++ return (0); + } + + /* Pack a line of 1/2/4 bit index values. + */ + static void +-vips_foreign_save_spng_pack( VipsForeignSaveSpng *spng, +- VipsPel *q, VipsPel *p, size_t n ) ++vips_foreign_save_spng_pack(VipsForeignSaveSpng *spng, ++ VipsPel *q, VipsPel *p, size_t n) + { +- int pixel_mask = 8 / spng->bitdepth - 1; ++ int pixel_mask = 8 / spng->bitdepth - 1; + int shift = spng->palette ? 0 : 8 - spng->bitdepth; + +- VipsPel bits; +- size_t x; ++ VipsPel bits; ++ size_t x; + +- bits = 0; +- for( x = 0; x < n; x++ ) { +- bits <<= spng->bitdepth; ++ bits = 0; ++ for (x = 0; x < n; x++) { ++ bits <<= spng->bitdepth; + bits |= p[x] >> shift; + +- if( (x & pixel_mask) == pixel_mask ) +- *q++ = bits; +- } ++ if ((x & pixel_mask) == pixel_mask) ++ *q++ = bits; ++ } + +- /* Any left-over bits? Need to be left-aligned. +- */ +- if( (x & pixel_mask) != 0 ) { +- /* The number of bits we've collected and must +- * left-align and flush. +- */ +- int collected_bits = (x & pixel_mask) << (spng->bitdepth - 1); ++ /* Any left-over bits? Need to be left-aligned. ++ */ ++ if ((x & pixel_mask) != 0) { ++ /* The number of bits we've collected and must ++ * left-align and flush. ++ */ ++ int collected_bits = (x & pixel_mask) << (spng->bitdepth - 1); + +- *q++ = bits << (8 - collected_bits); +- } ++ *q++ = bits << (8 - collected_bits); ++ } + } + +-static int +-vips_foreign_save_spng_write_fn( spng_ctx *ctx, void *user, +- void *data, size_t n ) ++static int ++vips_foreign_save_spng_write_fn(spng_ctx *ctx, void *user, ++ void *data, size_t n) + { + VipsForeignSaveSpng *spng = (VipsForeignSaveSpng *) user; + +- if( vips_target_write( spng->target, data, n ) ) +- return( SPNG_IO_ERROR ); ++ if (vips_target_write(spng->target, data, n)) ++ return (SPNG_IO_ERROR); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_spng_write_block( VipsRegion *region, VipsRect *area, +- void *user ) ++vips_foreign_save_spng_write_block(VipsRegion *region, VipsRect *area, ++ void *user) + { + VipsForeignSaveSpng *spng = (VipsForeignSaveSpng *) user; +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( spng ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(spng); + + int y; + int error; + + /* The area to write is always a set of complete scanlines. + */ +- g_assert( area->left == 0 ); +- g_assert( area->width == region->im->Xsize ); +- g_assert( area->top + area->height <= region->im->Ysize ); ++ g_assert(area->left == 0); ++ g_assert(area->width == region->im->Xsize); ++ g_assert(area->top + area->height <= region->im->Ysize); + +- for( y = 0; y < area->height; y++ ) { ++ for (y = 0; y < area->height; y++) { + VipsPel *line; + size_t sizeof_line; + +- line = VIPS_REGION_ADDR( region, 0, area->top + y ); +- sizeof_line = VIPS_REGION_SIZEOF_LINE( region ); ++ line = VIPS_REGION_ADDR(region, 0, area->top + y); ++ sizeof_line = VIPS_REGION_SIZEOF_LINE(region); + +- if( spng->bitdepth < 8 ) { +- vips_foreign_save_spng_pack( spng, +- spng->line, line, sizeof_line ); ++ if (spng->bitdepth < 8) { ++ vips_foreign_save_spng_pack(spng, ++ spng->line, line, sizeof_line); + line = spng->line; + sizeof_line = spng->sizeof_line; + } + +- if( (error = spng_encode_row( spng->ctx, line, sizeof_line )) ) ++ if ((error = spng_encode_row(spng->ctx, line, sizeof_line))) + break; + } + + /* You can get SPNG_EOI for the final scanline. + */ +- if( error && +- error != SPNG_EOI ) { +- vips_error( class->nickname, "%s", spng_strerror( error ) ); +- return( -1 ); ++ if (error && ++ error != SPNG_EOI) { ++ vips_error(class->nickname, "%s", spng_strerror(error)); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_spng_write( VipsForeignSaveSpng *spng, VipsImage *in ) ++vips_foreign_save_spng_write(VipsForeignSaveSpng *spng, VipsImage *in) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( spng ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(spng); + VipsForeignSave *save = (VipsForeignSave *) spng; + + int error; +@@ -387,81 +388,81 @@ vips_foreign_save_spng_write( VipsForeignSaveSpng *spng, VipsImage *in ) + int fmt; + enum spng_encode_flags encode_flags; + +- spng->ctx = spng_ctx_new( SPNG_CTX_ENCODER ); ++ spng->ctx = spng_ctx_new(SPNG_CTX_ENCODER); + +- if( (error = spng_set_png_stream( spng->ctx, +- vips_foreign_save_spng_write_fn, spng )) ) { +- vips_error( class->nickname, "%s", spng_strerror( error ) ); +- return( -1 ); ++ if ((error = spng_set_png_stream(spng->ctx, ++ vips_foreign_save_spng_write_fn, spng))) { ++ vips_error(class->nickname, "%s", spng_strerror(error)); ++ return (-1); + } + + ihdr.width = in->Xsize; + ihdr.height = in->Ysize; + ihdr.bit_depth = spng->bitdepth; + +- switch( in->Bands ) { ++ switch (in->Bands) { + case 1: + ihdr.color_type = SPNG_COLOR_TYPE_GRAYSCALE; + break; + + case 2: +- ihdr.color_type = SPNG_COLOR_TYPE_GRAYSCALE_ALPHA; ++ ihdr.color_type = SPNG_COLOR_TYPE_GRAYSCALE_ALPHA; + break; + + case 3: + ihdr.color_type = SPNG_COLOR_TYPE_TRUECOLOR; + break; + +- case 4: +- ihdr.color_type = SPNG_COLOR_TYPE_TRUECOLOR_ALPHA; ++ case 4: ++ ihdr.color_type = SPNG_COLOR_TYPE_TRUECOLOR_ALPHA; + break; + + default: +- vips_error( class->nickname, "%s", _( "bad bands" ) ); +- return( -1 ); ++ vips_error(class->nickname, "%s", _("bad bands")); ++ return (-1); + } + + #ifdef HAVE_QUANTIZATION + /* Enable image quantisation to paletted 8bpp PNG if palette is set. + */ +- if( spng->palette ) ++ if (spng->palette) + ihdr.color_type = SPNG_COLOR_TYPE_INDEXED; + #else +- if( spng->palette ) +- g_warning( "%s", +- _( "ignoring palette (no quantisation support)" ) ); ++ if (spng->palette) ++ g_warning("%s", ++ _("ignoring palette (no quantisation support)")); + #endif /*HAVE_QUANTIZATION*/ + + ihdr.compression_method = 0; + ihdr.filter_method = 0; + ihdr.interlace_method = spng->interlace ? 1 : 0; +- if( (error = spng_set_ihdr( spng->ctx, &ihdr )) ) { +- vips_error( class->nickname, "%s", spng_strerror( error ) ); +- return( -1 ); ++ if ((error = spng_set_ihdr(spng->ctx, &ihdr))) { ++ vips_error(class->nickname, "%s", spng_strerror(error)); ++ return (-1); + } + +- spng_set_option( spng->ctx, +- SPNG_IMG_COMPRESSION_LEVEL, spng->compression ); +- spng_set_option( spng->ctx, +- SPNG_TEXT_COMPRESSION_LEVEL, spng->compression ); +- spng_set_option( spng->ctx, +- SPNG_FILTER_CHOICE, spng->filter ); ++ spng_set_option(spng->ctx, ++ SPNG_IMG_COMPRESSION_LEVEL, spng->compression); ++ spng_set_option(spng->ctx, ++ SPNG_TEXT_COMPRESSION_LEVEL, spng->compression); ++ spng_set_option(spng->ctx, ++ SPNG_FILTER_CHOICE, spng->filter); + + /* Set resolution. spng uses pixels per meter. + */ + phys.unit_specifier = 1; +- phys.ppu_x = VIPS_RINT( in->Xres * 1000.0 ); +- phys.ppu_y = VIPS_RINT( in->Xres * 1000.0 ); +- spng_set_phys( spng->ctx, &phys ); ++ phys.ppu_x = VIPS_RINT(in->Xres * 1000.0); ++ phys.ppu_y = VIPS_RINT(in->Xres * 1000.0); ++ spng_set_phys(spng->ctx, &phys); + + /* Metadata. + */ +- if( !save->strip && +- vips_foreign_save_spng_metadata( spng, in ) ) +- return( -1 ); ++ if (!save->strip && ++ vips_foreign_save_spng_metadata(spng, in)) ++ return (-1); + + #ifdef HAVE_QUANTIZATION +- if( spng->palette ) { ++ if (spng->palette) { + struct spng_plte plte = { 0 }; + struct spng_trns trns = { 0 }; + +@@ -470,22 +471,22 @@ vips_foreign_save_spng_write( VipsForeignSaveSpng *spng, VipsImage *in ) + int palette_count; + int i; + +- if( vips__quantise_image( in, &im_index, &im_palette, +- 1 << spng->bitdepth, +- spng->Q, +- spng->dither, +- spng->effort, +- FALSE ) ) +- return( -1 ); ++ if (vips__quantise_image(in, &im_index, &im_palette, ++ 1 << spng->bitdepth, ++ spng->Q, ++ spng->dither, ++ spng->effort, ++ FALSE)) ++ return (-1); + + /* PNG is 8-bit index only. + */ + palette_count = im_palette->Xsize; +- g_assert( palette_count <= 256 ); ++ g_assert(palette_count <= 256); + +- for( i = 0; i < palette_count; i++ ) { +- VipsPel *p = (VipsPel *) +- VIPS_IMAGE_ADDR( im_palette, i, 0 ); ++ for (i = 0; i < palette_count; i++) { ++ VipsPel *p = (VipsPel *) ++ VIPS_IMAGE_ADDR(im_palette, i, 0); + struct spng_plte_entry *entry = + &plte.entries[plte.n_entries]; + +@@ -495,23 +496,23 @@ vips_foreign_save_spng_write( VipsForeignSaveSpng *spng, VipsImage *in ) + plte.n_entries += 1; + + trns.type3_alpha[i] = p[3]; +- if( p[3] != 255 ) { +- trns.n_type3_entries = i+1; ++ if (p[3] != 255) { ++ trns.n_type3_entries = i + 1; + } + } + + #ifdef DEBUG +- printf( "attaching %d entry palette\n", plte.n_entries ); +- if( trns.n_type3_entries ) +- printf( "attaching %d transparency values\n", +- trns.n_type3_entries ); ++ printf("attaching %d entry palette\n", plte.n_entries); ++ if (trns.n_type3_entries) ++ printf("attaching %d transparency values\n", ++ trns.n_type3_entries); + #endif /*DEBUG*/ + +- VIPS_UNREF( im_palette ); ++ VIPS_UNREF(im_palette); + +- spng_set_plte( spng->ctx, &plte ); +- if( trns.n_type3_entries ) +- spng_set_trns( spng->ctx, &trns ); ++ spng_set_plte(spng->ctx, &plte); ++ if (trns.n_type3_entries) ++ spng_set_trns(spng->ctx, &trns); + + in = spng->memory = im_index; + } +@@ -519,31 +520,30 @@ vips_foreign_save_spng_write( VipsForeignSaveSpng *spng, VipsImage *in ) + + /* Low-bitdepth write needs an extra buffer for packing pixels. + */ +- if( spng->bitdepth < 8 ) { +- spng->sizeof_line = 1 + VIPS_IMAGE_SIZEOF_LINE( in ) / +- (8 / spng->bitdepth); ++ if (spng->bitdepth < 8) { ++ spng->sizeof_line = 1 + VIPS_IMAGE_SIZEOF_LINE(in) / (8 / spng->bitdepth); + +- if( !(spng->line = +- vips_malloc( NULL, VIPS_IMAGE_SIZEOF_LINE( in ) )) ) +- return( -1 ); ++ if (!(spng->line = ++ vips_malloc(NULL, VIPS_IMAGE_SIZEOF_LINE(in)))) ++ return (-1); + } + +- /* SPNG_FMT_PNG is a special value that matches the format in ihdr ++ /* SPNG_FMT_PNG is a special value that matches the format in ihdr + */ + fmt = SPNG_FMT_PNG; + encode_flags = SPNG_ENCODE_PROGRESSIVE | SPNG_ENCODE_FINALIZE; +- if( (error = spng_encode_image( spng->ctx, +- NULL, -1, fmt, encode_flags )) ) { +- vips_error( class->nickname, "%s", spng_strerror( error ) ); +- return( -1 ); ++ if ((error = spng_encode_image(spng->ctx, ++ NULL, -1, fmt, encode_flags))) { ++ vips_error(class->nickname, "%s", spng_strerror(error)); ++ return (-1); + } + +- if( spng->interlace ) { ++ if (spng->interlace) { + /* Force the input into memory, if it's not there already. + */ +- if( !spng->memory ) { +- if( !(spng->memory = vips_image_copy_memory( in )) ) +- return( -1 ); ++ if (!spng->memory) { ++ if (!(spng->memory = vips_image_copy_memory(in))) ++ return (-1); + in = spng->memory; + } + +@@ -552,102 +552,103 @@ vips_foreign_save_spng_write( VipsForeignSaveSpng *spng, VipsImage *in ) + VipsPel *line; + size_t sizeof_line; + +- if( (error = +- spng_get_row_info( spng->ctx, &row_info )) ) ++ if ((error = ++ spng_get_row_info(spng->ctx, &row_info))) + break; + +- line = VIPS_IMAGE_ADDR( in, 0, row_info.row_num ); +- sizeof_line = VIPS_IMAGE_SIZEOF_LINE( in ); ++ line = VIPS_IMAGE_ADDR(in, 0, row_info.row_num); ++ sizeof_line = VIPS_IMAGE_SIZEOF_LINE(in); + +- if( spng->bitdepth < 8 ) { +- vips_foreign_save_spng_pack( spng, +- spng->line, line, sizeof_line ); ++ if (spng->bitdepth < 8) { ++ vips_foreign_save_spng_pack(spng, ++ spng->line, line, sizeof_line); + line = spng->line; + sizeof_line = spng->sizeof_line; + } + +- error = spng_encode_row( spng->ctx, line, sizeof_line ); +- } while( !error ); ++ error = spng_encode_row(spng->ctx, line, sizeof_line); ++ } while (!error); + +- if( error != SPNG_EOI ) { +- vips_error( class->nickname, +- "%s", spng_strerror( error ) ); +- return( -1 ); ++ if (error != SPNG_EOI) { ++ vips_error(class->nickname, ++ "%s", spng_strerror(error)); ++ return (-1); + } + } + else { +- if( vips_sink_disc( in, +- vips_foreign_save_spng_write_block, spng ) ) +- return( -1 ); ++ if (vips_sink_disc(in, ++ vips_foreign_save_spng_write_block, spng)) ++ return (-1); + } + +- if( vips_target_end( spng->target ) ) +- return( -1 ); ++ if (vips_target_end(spng->target)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_spng_build( VipsObject *object ) ++vips_foreign_save_spng_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveSpng *spng = (VipsForeignSaveSpng *) object; + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_spng_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_spng_parent_class)->build(object)) ++ return (-1); + + in = save->ready; +- g_object_ref( in ); ++ g_object_ref(in); + + /* If no output bitdepth has been specified, use input Type to pick. + */ +- if( !vips_object_argument_isset( object, "bitdepth" ) ) +- spng->bitdepth = +- in->Type == VIPS_INTERPRETATION_RGB16 || +- in->Type == VIPS_INTERPRETATION_GREY16 ? 16 : 8; ++ if (!vips_object_argument_isset(object, "bitdepth")) ++ spng->bitdepth = ++ in->Type == VIPS_INTERPRETATION_RGB16 || ++ in->Type == VIPS_INTERPRETATION_GREY16 ++ ? 16 ++ : 8; + + /* Deprecated "colours" arg just sets bitdepth large enough to hold + * that many colours. + */ +- if( vips_object_argument_isset( object, "colours" ) ) +- spng->bitdepth = ceil( log2( spng->colours ) ); ++ if (vips_object_argument_isset(object, "colours")) ++ spng->bitdepth = ceil(log2(spng->colours)); + + /* Cast in down to 8 bit if we can. + */ +- if( spng->bitdepth <= 8 ) { ++ if (spng->bitdepth <= 8) { + VipsImage *x; + +- if( vips_cast( in, &x, VIPS_FORMAT_UCHAR, NULL ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_cast(in, &x, VIPS_FORMAT_UCHAR, NULL)) { ++ g_object_unref(in); ++ return (-1); + } +- g_object_unref( in ); ++ g_object_unref(in); + in = x; + } + + /* If this is a RGB or RGBA image and a low bit depth has been + * requested, enable palettisation. + */ +- if( in->Bands > 2 && +- spng->bitdepth < 8 ) ++ if (in->Bands > 2 && ++ spng->bitdepth < 8) + spng->palette = TRUE; + + /* Disable palettization for >8 bit save. + */ +- if( spng->bitdepth > 8 ) ++ if (spng->bitdepth > 8) + spng->palette = FALSE; + +- if( vips_foreign_save_spng_write( spng, in ) ) { +- g_object_unref( in ); +- return( -1 ); ++ if (vips_foreign_save_spng_write(spng, in)) { ++ g_object_unref(in); ++ return (-1); + } + +- g_object_unref( in ); ++ g_object_unref(in); + +- return( 0 ); ++ return (0); + } + + #define UC VIPS_FORMAT_UCHAR +@@ -662,9 +663,9 @@ static VipsBandFormat bandfmt_spng[10] = { + }; + + static void +-vips_foreign_save_spng_class_init( VipsForeignSaveSpngClass *class ) ++vips_foreign_save_spng_class_init(VipsForeignSaveSpngClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; +@@ -674,7 +675,7 @@ vips_foreign_save_spng_class_init( VipsForeignSaveSpngClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "spngsave_base"; +- object_class->description = _( "save spng" ); ++ object_class->description = _("save spng"); + object_class->build = vips_foreign_save_spng_build; + + foreign_class->suffs = vips__png_suffs; +@@ -682,81 +683,80 @@ vips_foreign_save_spng_class_init( VipsForeignSaveSpngClass *class ) + save_class->saveable = VIPS_SAVEABLE_RGBA; + save_class->format_table = bandfmt_spng; + +- VIPS_ARG_INT( class, "compression", 6, +- _( "Compression" ), +- _( "Compression factor" ), ++ VIPS_ARG_INT(class, "compression", 6, ++ _("Compression"), ++ _("Compression factor"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveSpng, compression ), +- 0, 9, 6 ); ++ G_STRUCT_OFFSET(VipsForeignSaveSpng, compression), ++ 0, 9, 6); + +- VIPS_ARG_BOOL( class, "interlace", 7, +- _( "Interlace" ), +- _( "Interlace image" ), ++ VIPS_ARG_BOOL(class, "interlace", 7, ++ _("Interlace"), ++ _("Interlace image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveSpng, interlace ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveSpng, interlace), ++ FALSE); + +- VIPS_ARG_STRING( class, "profile", 11, +- _( "Profile" ), +- _( "ICC profile to embed" ), ++ VIPS_ARG_STRING(class, "profile", 11, ++ _("Profile"), ++ _("ICC profile to embed"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveSpng, profile ), +- NULL ); ++ G_STRUCT_OFFSET(VipsForeignSaveSpng, profile), ++ NULL); + +- VIPS_ARG_FLAGS( class, "filter", 12, +- _( "Filter" ), +- _( "libspng row filter flag(s)" ), ++ VIPS_ARG_FLAGS(class, "filter", 12, ++ _("Filter"), ++ _("libspng row filter flag(s)"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveSpng, filter ), ++ G_STRUCT_OFFSET(VipsForeignSaveSpng, filter), + VIPS_TYPE_FOREIGN_PNG_FILTER, +- VIPS_FOREIGN_PNG_FILTER_NONE ); ++ VIPS_FOREIGN_PNG_FILTER_NONE); + +- VIPS_ARG_BOOL( class, "palette", 13, +- _( "Palette" ), +- _( "Quantise to 8bpp palette" ), ++ VIPS_ARG_BOOL(class, "palette", 13, ++ _("Palette"), ++ _("Quantise to 8bpp palette"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveSpng, palette ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveSpng, palette), ++ FALSE); + +- VIPS_ARG_INT( class, "Q", 15, +- _( "Quality" ), +- _( "Quantisation quality" ), ++ VIPS_ARG_INT(class, "Q", 15, ++ _("Quality"), ++ _("Quantisation quality"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveSpng, Q ), +- 0, 100, 100 ); ++ G_STRUCT_OFFSET(VipsForeignSaveSpng, Q), ++ 0, 100, 100); + +- VIPS_ARG_DOUBLE( class, "dither", 16, +- _( "Dithering" ), +- _( "Amount of dithering" ), ++ VIPS_ARG_DOUBLE(class, "dither", 16, ++ _("Dithering"), ++ _("Amount of dithering"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveSpng, dither ), +- 0.0, 1.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsForeignSaveSpng, dither), ++ 0.0, 1.0, 1.0); + +- VIPS_ARG_INT( class, "bitdepth", 17, +- _( "Bit depth" ), +- _( "Write as a 1, 2, 4, 8 or 16 bit image" ), ++ VIPS_ARG_INT(class, "bitdepth", 17, ++ _("Bit depth"), ++ _("Write as a 1, 2, 4, 8 or 16 bit image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveSpng, bitdepth ), +- 0, 16, 0 ); ++ G_STRUCT_OFFSET(VipsForeignSaveSpng, bitdepth), ++ 0, 16, 0); + +- VIPS_ARG_INT( class, "effort", 18, +- _( "Effort" ), +- _( "Quantisation CPU effort" ), ++ VIPS_ARG_INT(class, "effort", 18, ++ _("Effort"), ++ _("Quantisation CPU effort"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveSpng, effort ), +- 1, 10, 7 ); ++ G_STRUCT_OFFSET(VipsForeignSaveSpng, effort), ++ 1, 10, 7); + +- VIPS_ARG_INT( class, "colours", 14, +- _( "Colours" ), +- _( "Max number of palette colours" ), ++ VIPS_ARG_INT(class, "colours", 14, ++ _("Colours"), ++ _("Max number of palette colours"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignSaveSpng, colours ), +- 2, 256, 256 ); +- ++ G_STRUCT_OFFSET(VipsForeignSaveSpng, colours), ++ 2, 256, 256); + } + + static void +-vips_foreign_save_spng_init( VipsForeignSaveSpng *spng ) ++vips_foreign_save_spng_init(VipsForeignSaveSpng *spng) + { + spng->compression = 6; + spng->filter = VIPS_FOREIGN_PNG_FILTER_NONE; +@@ -773,103 +773,100 @@ typedef struct _VipsForeignSaveSpngTarget { + + typedef VipsForeignSaveSpngClass VipsForeignSaveSpngTargetClass; + +-G_DEFINE_TYPE( VipsForeignSaveSpngTarget, vips_foreign_save_spng_target, +- vips_foreign_save_spng_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveSpngTarget, vips_foreign_save_spng_target, ++ vips_foreign_save_spng_get_type()); + + static int +-vips_foreign_save_spng_target_build( VipsObject *object ) ++vips_foreign_save_spng_target_build(VipsObject *object) + { + VipsForeignSaveSpng *spng = (VipsForeignSaveSpng *) object; +- VipsForeignSaveSpngTarget *target = ++ VipsForeignSaveSpngTarget *target = + (VipsForeignSaveSpngTarget *) object; + + spng->target = target->target; +- g_object_ref( spng->target ); ++ g_object_ref(spng->target); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_spng_target_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_spng_target_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_spng_target_class_init( VipsForeignSaveSpngTargetClass *class ) ++vips_foreign_save_spng_target_class_init(VipsForeignSaveSpngTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pngsave_target"; +- object_class->description = _( "save image to target as PNG" ); ++ object_class->description = _("save image to target as PNG"); + object_class->build = vips_foreign_save_spng_target_build; + +- VIPS_ARG_OBJECT( class, "target", 1, +- _( "Target" ), +- _( "Target to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveSpngTarget, target ), +- VIPS_TYPE_TARGET ); +- ++ VIPS_ARG_OBJECT(class, "target", 1, ++ _("Target"), ++ _("Target to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveSpngTarget, target), ++ VIPS_TYPE_TARGET); + } + + static void +-vips_foreign_save_spng_target_init( VipsForeignSaveSpngTarget *target ) ++vips_foreign_save_spng_target_init(VipsForeignSaveSpngTarget *target) + { + } + + typedef struct _VipsForeignSaveSpngFile { + VipsForeignSaveSpng parent_object; + +- char *filename; ++ char *filename; + } VipsForeignSaveSpngFile; + + typedef VipsForeignSaveSpngClass VipsForeignSaveSpngFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveSpngFile, vips_foreign_save_spng_file, +- vips_foreign_save_spng_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveSpngFile, vips_foreign_save_spng_file, ++ vips_foreign_save_spng_get_type()); + + static int +-vips_foreign_save_spng_file_build( VipsObject *object ) ++vips_foreign_save_spng_file_build(VipsObject *object) + { + VipsForeignSaveSpng *spng = (VipsForeignSaveSpng *) object; + VipsForeignSaveSpngFile *file = (VipsForeignSaveSpngFile *) object; + +- if( !(spng->target = vips_target_new_to_file( file->filename )) ) +- return( -1 ); ++ if (!(spng->target = vips_target_new_to_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_spng_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_spng_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_spng_file_class_init( VipsForeignSaveSpngFileClass *class ) ++vips_foreign_save_spng_file_class_init(VipsForeignSaveSpngFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pngsave"; +- object_class->description = _( "save image to file as PNG" ); ++ object_class->description = _("save image to file as PNG"); + object_class->build = vips_foreign_save_spng_file_build; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveSpngFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveSpngFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_spng_file_init( VipsForeignSaveSpngFile *file ) ++vips_foreign_save_spng_file_init(VipsForeignSaveSpngFile *file) + { + } + +@@ -881,55 +878,54 @@ typedef struct _VipsForeignSaveSpngBuffer { + + typedef VipsForeignSaveSpngClass VipsForeignSaveSpngBufferClass; + +-G_DEFINE_TYPE( VipsForeignSaveSpngBuffer, vips_foreign_save_spng_buffer, +- vips_foreign_save_spng_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveSpngBuffer, vips_foreign_save_spng_buffer, ++ vips_foreign_save_spng_get_type()); + + static int +-vips_foreign_save_spng_buffer_build( VipsObject *object ) ++vips_foreign_save_spng_buffer_build(VipsObject *object) + { + VipsForeignSaveSpng *spng = (VipsForeignSaveSpng *) object; +- VipsForeignSaveSpngBuffer *buffer = ++ VipsForeignSaveSpngBuffer *buffer = + (VipsForeignSaveSpngBuffer *) object; + + VipsBlob *blob; + +- if( !(spng->target = vips_target_new_to_memory()) ) +- return( -1 ); ++ if (!(spng->target = vips_target_new_to_memory())) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_spng_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_spng_buffer_parent_class)->build(object)) ++ return (-1); + +- g_object_get( spng->target, "blob", &blob, NULL ); +- g_object_set( buffer, "buffer", blob, NULL ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ g_object_get(spng->target, "blob", &blob, NULL); ++ g_object_set(buffer, "buffer", blob, NULL); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_spng_buffer_class_init( VipsForeignSaveSpngBufferClass *class ) ++vips_foreign_save_spng_buffer_class_init(VipsForeignSaveSpngBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "pngsave_buffer"; +- object_class->description = _( "save image to buffer as PNG" ); ++ object_class->description = _("save image to buffer as PNG"); + object_class->build = vips_foreign_save_spng_buffer_build; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to save to" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsForeignSaveSpngBuffer, buf ), +- VIPS_TYPE_BLOB ); ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to save to"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveSpngBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_save_spng_buffer_init( VipsForeignSaveSpngBuffer *buffer ) ++vips_foreign_save_spng_buffer_init(VipsForeignSaveSpngBuffer *buffer) + { + } + +diff --git a/libvips/foreign/svgload.c b/libvips/foreign/svgload.c +index 94072581d4..6dcf965d60 100644 +--- a/libvips/foreign/svgload.c ++++ b/libvips/foreign/svgload.c +@@ -21,7 +21,7 @@ + * - rework as a sequential loader to reduce overcomputation + * 11/6/21 + * - switch to rsvg_handle_render_document() +- * - librsvg can no longer render very large images :( ++ * - librsvg can no longer render very large images :( + * 14/10/21 + * - allow utf-8 headers for svg detection + * 28/4/22 +@@ -32,28 +32,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -81,7 +81,7 @@ + #include + #include + +-/* Render SVGs with tiles this size. They need to be pretty big to limit ++/* Render SVGs with tiles this size. They need to be pretty big to limit + * overcomputation. + */ + #define TILE_SIZE (2000) +@@ -125,106 +125,106 @@ typedef struct _VipsForeignLoadSvg { + + typedef VipsForeignLoadClass VipsForeignLoadSvgClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadSvg, vips_foreign_load_svg, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadSvg, vips_foreign_load_svg, ++ VIPS_TYPE_FOREIGN_LOAD); + + #ifdef HANDLE_SVGZ + static void * +-vips_foreign_load_svg_zalloc( void *opaque, unsigned items, unsigned size ) ++vips_foreign_load_svg_zalloc(void *opaque, unsigned items, unsigned size) + { +- return( g_malloc0_n( items, size ) ); ++ return (g_malloc0_n(items, size)); + } + + static void +-vips_foreign_load_svg_zfree( void *opaque, void *ptr ) ++vips_foreign_load_svg_zfree(void *opaque, void *ptr) + { +- return( g_free( ptr ) ); ++ return (g_free(ptr)); + } + #endif /*HANDLE_SVGZ*/ + +-/* Find a utf-8 substring within the first len_bytes (not characters). ++/* Find a utf-8 substring within the first len_bytes (not characters). + * + * - case-insensitive + * - needle must be zero-terminated, but hackstack need not be + * - haystack can be null-terminated +- * - if haystack is shorter than len bytes, that'll end the search ++ * - if haystack is shorter than len bytes, that'll end the search + * - if we hit invalid utf-8, we return NULL + */ + static const char * +-vips_utf8_strcasestr( const char *haystack_start, const char *needle_start, +- int len_bytes ) ++vips_utf8_strcasestr(const char *haystack_start, const char *needle_start, ++ int len_bytes) + { +- int needle_len = g_utf8_strlen( needle_start, -1 ); +- int needle_len_bytes = strlen( needle_start ); ++ int needle_len = g_utf8_strlen(needle_start, -1); ++ int needle_len_bytes = strlen(needle_start); + + const char *haystack; + +- for( haystack = haystack_start; +- haystack - haystack_start <= len_bytes - needle_len_bytes; +- haystack = g_utf8_find_next_char( haystack, NULL ) ) { +- const char *needle_char; +- const char *haystack_char; ++ for (haystack = haystack_start; ++ haystack - haystack_start <= len_bytes - needle_len_bytes; ++ haystack = g_utf8_find_next_char(haystack, NULL)) { ++ const char *needle_char; ++ const char *haystack_char; + int i; + +- haystack_char = haystack; +- needle_char = needle_start; +- for( i = 0; i < needle_len; i++ ) { ++ haystack_char = haystack; ++ needle_char = needle_start; ++ for (i = 0; i < needle_len; i++) { + /* Haystack isn't necessarily null-terminated and + * might end half-way through a utf-8 character, so we + * need to be careful not to run off the end. + */ +- gunichar a = +- g_utf8_get_char_validated( haystack_char, +- haystack_start + len_bytes - haystack ); +- gunichar b = +- g_utf8_get_char_validated( needle_char, -1 ); ++ gunichar a = ++ g_utf8_get_char_validated(haystack_char, ++ haystack_start + len_bytes - haystack); ++ gunichar b = ++ g_utf8_get_char_validated(needle_char, -1); + +- /* Invalid utf8? ++ /* Invalid utf8? + * +- * gunichar is a uint32, so we can't compare < 0, we +- * have to look for -1 and -2 (the two possible error ++ * gunichar is a uint32, so we can't compare < 0, we ++ * have to look for -1 and -2 (the two possible error + * values). +- */ +- if( a == (gunichar) -1 || ++ */ ++ if (a == (gunichar) -1 || + a == (gunichar) -2 || + b == (gunichar) -1 || +- b == (gunichar) -2 ) +- return( NULL ); +- +- /* End of haystack. There can't be a complete needle +- * anywhere. +- */ +- if( a == (gunichar) 0 ) +- return( NULL ); +- +- /* Mismatch. +- */ +- if( g_unichar_tolower( a ) != g_unichar_tolower( b ) ) +- break; +- +- haystack_char = +- g_utf8_find_next_char( haystack_char, +- haystack_start + len_bytes ); +- needle_char = +- g_utf8_find_next_char( needle_char, NULL ); +- } +- +- if( i == needle_len ) +- /* Walked the whole of needle, so we must have found a ++ b == (gunichar) -2) ++ return (NULL); ++ ++ /* End of haystack. There can't be a complete needle ++ * anywhere. ++ */ ++ if (a == (gunichar) 0) ++ return (NULL); ++ ++ /* Mismatch. ++ */ ++ if (g_unichar_tolower(a) != g_unichar_tolower(b)) ++ break; ++ ++ haystack_char = ++ g_utf8_find_next_char(haystack_char, ++ haystack_start + len_bytes); ++ needle_char = ++ g_utf8_find_next_char(needle_char, NULL); ++ } ++ ++ if (i == needle_len) ++ /* Walked the whole of needle, so we must have found a + * complete match. + */ +- return( haystack ); +- } ++ return (haystack); ++ } + +- /* Walked the whole of haystack without finding a match. +- */ +- return( NULL ); ++ /* Walked the whole of haystack without finding a match. ++ */ ++ return (NULL); + } + + /* This is used by both the file and buffer subclasses. + */ + static gboolean +-vips_foreign_load_svg_is_a( const void *buf, size_t len ) ++vips_foreign_load_svg_is_a(const void *buf, size_t len) + { + char *str; + +@@ -245,9 +245,9 @@ vips_foreign_load_svg_is_a( const void *buf, size_t len ) + * + * Minimum gzip size is 18 bytes, starting with 1F 8B. + */ +- if( len >= 18 && +- str[0] == '\037' && +- str[1] == '\213' ) { ++ if (len >= 18 && ++ str[0] == '\037' && ++ str[1] == '\213') { + z_stream zs; + size_t opos; + +@@ -259,22 +259,22 @@ vips_foreign_load_svg_is_a( const void *buf, size_t len ) + + /* There isn't really an error return from is_a_buffer() + */ +- if( inflateInit2( &zs, 15 | 32 ) != Z_OK ) +- return( FALSE ); ++ if (inflateInit2(&zs, 15 | 32) != Z_OK) ++ return (FALSE); + + opos = 0; + do { +- zs.avail_out = sizeof( obuf ) - opos; ++ zs.avail_out = sizeof(obuf) - opos; + zs.next_out = (unsigned char *) obuf + opos; +- if( inflate( &zs, Z_NO_FLUSH ) < Z_OK ) { +- inflateEnd( &zs ); +- return( FALSE ); ++ if (inflate(&zs, Z_NO_FLUSH) < Z_OK) { ++ inflateEnd(&zs); ++ return (FALSE); + } +- opos = sizeof( obuf ) - zs.avail_out; +- } while( opos < sizeof( obuf ) && +- zs.avail_in > 0 ); ++ opos = sizeof(obuf) - zs.avail_out; ++ } while (opos < sizeof(obuf) && ++ zs.avail_in > 0); + +- inflateEnd( &zs ); ++ inflateEnd(&zs); + + str = obuf; + len = opos; +@@ -295,45 +295,44 @@ vips_foreign_load_svg_is_a( const void *buf, size_t len ) + * valid utf-8. + * + * We could rsvg_handle_new_from_data() on the buffer, but that can be +- * horribly slow for large documents. ++ * horribly slow for large documents. + */ +- if( vips_utf8_strcasestr( str, "page ); ++ VIPS_UNREF(svg->page); + +- G_OBJECT_CLASS( vips_foreign_load_svg_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_svg_parent_class)->dispose(gobject); + } + + static VipsForeignFlags +-vips_foreign_load_svg_get_flags_filename( const char *filename ) ++vips_foreign_load_svg_get_flags_filename(const char *filename) + { + /* We can render any part of the page on demand. + */ +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + + static VipsForeignFlags +-vips_foreign_load_svg_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_svg_get_flags(VipsForeignLoad *load) + { +- return( VIPS_FOREIGN_PARTIAL ); ++ return (VIPS_FOREIGN_PARTIAL); + } + +-#if LIBRSVG_CHECK_VERSION( 2, 52, 0 ) ++#if LIBRSVG_CHECK_VERSION(2, 52, 0) + /* Derived from `CssLength::to_user` in librsvg. + * https://gitlab.gnome.org/GNOME/librsvg/-/blob/e6607c9ae8d8409d4efff6b12993717400b3356e/src/length.rs#L368 + */ + static double +-svg_css_length_to_pixels( RsvgLength length, double dpi ) ++svg_css_length_to_pixels(RsvgLength length, double dpi) + { + double value = length.length; + +@@ -342,45 +341,45 @@ svg_css_length_to_pixels( RsvgLength length, double dpi ) + */ + double font_size = 12.0; + +- switch( length.unit ) { +- case RSVG_UNIT_PX: +- /* Already a pixel value. +- */ +- break; +- case RSVG_UNIT_EM: +- value *= font_size; +- break; +- case RSVG_UNIT_EX: +- value *= font_size / 2.0; +- break; +- case RSVG_UNIT_IN: +- value *= dpi; +- break; +- case RSVG_UNIT_CM: +- /* 2.54 cm in an inch. +- */ +- value = dpi * value / 2.54; +- break; +- case RSVG_UNIT_MM: +- /* 25.4 mm in an inch. +- */ +- value = dpi * value / 25.4; +- break; +- case RSVG_UNIT_PT: +- /* 72 points in an inch. +- */ +- value = dpi * value / 72; +- break; +- case RSVG_UNIT_PC: +- /* 6 picas in an inch. +- */ +- value = dpi * value / 6; +- break; +- default: +- /* Probably RSVG_UNIT_PERCENT. We can't know what the +- * pixel value is without more information. +- */ +- value = 0; ++ switch (length.unit) { ++ case RSVG_UNIT_PX: ++ /* Already a pixel value. ++ */ ++ break; ++ case RSVG_UNIT_EM: ++ value *= font_size; ++ break; ++ case RSVG_UNIT_EX: ++ value *= font_size / 2.0; ++ break; ++ case RSVG_UNIT_IN: ++ value *= dpi; ++ break; ++ case RSVG_UNIT_CM: ++ /* 2.54 cm in an inch. ++ */ ++ value = dpi * value / 2.54; ++ break; ++ case RSVG_UNIT_MM: ++ /* 25.4 mm in an inch. ++ */ ++ value = dpi * value / 25.4; ++ break; ++ case RSVG_UNIT_PT: ++ /* 72 points in an inch. ++ */ ++ value = dpi * value / 72; ++ break; ++ case RSVG_UNIT_PC: ++ /* 6 picas in an inch. ++ */ ++ value = dpi * value / 6; ++ break; ++ default: ++ /* Probably RSVG_UNIT_PERCENT. We can't know what the ++ * pixel value is without more information. ++ */ ++ value = 0; + } + + return value; +@@ -388,18 +387,18 @@ svg_css_length_to_pixels( RsvgLength length, double dpi ) + #endif + + static int +-vips_foreign_load_svg_get_natural_size( VipsForeignLoadSvg *svg, +- double *out_width, double *out_height ) ++vips_foreign_load_svg_get_natural_size(VipsForeignLoadSvg *svg, ++ double *out_width, double *out_height) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( svg ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(svg); + + double width; + double height; + +-#if LIBRSVG_CHECK_VERSION( 2, 52, 0 ) ++#if LIBRSVG_CHECK_VERSION(2, 52, 0) + +- if( !rsvg_handle_get_intrinsic_size_in_pixels( svg->page, +- &width, &height ) ) { ++ if (!rsvg_handle_get_intrinsic_size_in_pixels(svg->page, ++ &width, &height)) { + RsvgRectangle viewbox; + + /* Try the intrinsic dimensions first. +@@ -408,65 +407,65 @@ vips_foreign_load_svg_get_natural_size( VipsForeignLoadSvg *svg, + RsvgLength iwidth, iheight; + gboolean has_viewbox; + +- rsvg_handle_get_intrinsic_dimensions( svg->page, ++ rsvg_handle_get_intrinsic_dimensions(svg->page, + &has_width, &iwidth, + &has_height, &iheight, +- &has_viewbox, &viewbox ); ++ &has_viewbox, &viewbox); + +-#if LIBRSVG_CHECK_VERSION( 2, 54, 0 ) +- /* After librsvg 2.54.0, the `has_width` and `has_height` +- * arguments always returns `TRUE`, since with SVG2 all ++#if LIBRSVG_CHECK_VERSION(2, 54, 0) ++ /* After librsvg 2.54.0, the `has_width` and `has_height` ++ * arguments always returns `TRUE`, since with SVG2 all + * documents *have* a default width and height of `100%`. + */ +- width = svg_css_length_to_pixels( iwidth, svg->dpi ); +- height = svg_css_length_to_pixels( iheight, svg->dpi ); ++ width = svg_css_length_to_pixels(iwidth, svg->dpi); ++ height = svg_css_length_to_pixels(iheight, svg->dpi); + + has_width = width > 0.0; + has_height = height > 0.0; + +- if( has_width && has_height ) { +- /* Success! Taking the viewbox into account is not ++ if (has_width && has_height) { ++ /* Success! Taking the viewbox into account is not + * needed. + */ + } +- else if( has_width && has_viewbox ) { ++ else if (has_width && has_viewbox) { + height = width * viewbox.height / viewbox.width; + } +- else if( has_height && has_viewbox ) { ++ else if (has_height && has_viewbox) { + width = height * viewbox.width / viewbox.height; + } +- else if( has_viewbox ) { ++ else if (has_viewbox) { + width = viewbox.width; + height = viewbox.height; + } +-#else /*!LIBRSVG_CHECK_VERSION( 2, 54, 0 )*/ +- if( has_width && has_height ) { ++#else /*!LIBRSVG_CHECK_VERSION( 2, 54, 0 )*/ ++ if (has_width && has_height) { + /* We can use these values directly. + */ +- width = svg_css_length_to_pixels( iwidth, svg->dpi ); +- height = svg_css_length_to_pixels( iheight, svg->dpi ); ++ width = svg_css_length_to_pixels(iwidth, svg->dpi); ++ height = svg_css_length_to_pixels(iheight, svg->dpi); + } +- else if( has_width && has_viewbox ) { +- width = svg_css_length_to_pixels( iwidth, svg->dpi ); ++ else if (has_width && has_viewbox) { ++ width = svg_css_length_to_pixels(iwidth, svg->dpi); + height = width * viewbox.height / viewbox.width; + } +- else if( has_height && has_viewbox ) { +- height = svg_css_length_to_pixels( iheight, svg->dpi ); ++ else if (has_height && has_viewbox) { ++ height = svg_css_length_to_pixels(iheight, svg->dpi); + width = height * viewbox.width / viewbox.height; + } +- else if( has_viewbox ) { ++ else if (has_viewbox) { + width = viewbox.width; + height = viewbox.height; + } + #endif /*!LIBRSVG_CHECK_VERSION( 2, 54, 0 )*/ + +- if( width <= 0.0 || +- height <= 0.0 ) { +- /* We haven't found a usable set of sizes, so try ++ if (width <= 0.0 || ++ height <= 0.0) { ++ /* We haven't found a usable set of sizes, so try + * working out the visible area. + */ +- rsvg_handle_get_geometry_for_element( svg->page, NULL, +- &viewbox, NULL, NULL ); ++ rsvg_handle_get_geometry_for_element(svg->page, NULL, ++ &viewbox, NULL, NULL); + width = viewbox.x + viewbox.width; + height = viewbox.y + viewbox.height; + } +@@ -474,42 +473,42 @@ vips_foreign_load_svg_get_natural_size( VipsForeignLoadSvg *svg, + + #else /*!LIBRSVG_CHECK_VERSION( 2, 52, 0 )*/ + +-{ +- RsvgDimensionData dimensions; ++ { ++ RsvgDimensionData dimensions; + +- rsvg_handle_get_dimensions( svg->page, &dimensions ); +- width = dimensions.width; +- height = dimensions.height; +-} ++ rsvg_handle_get_dimensions(svg->page, &dimensions); ++ width = dimensions.width; ++ height = dimensions.height; ++ } + + #endif /*LIBRSVG_CHECK_VERSION( 2, 52, 0 )*/ + + /* width or height below 0.5 can't be rounded to 1. + */ +- if( width < 0.5 || +- height < 0.5 ) { +- vips_error( class->nickname, "%s", _( "bad dimensions" ) ); +- return( -1 ); ++ if (width < 0.5 || ++ height < 0.5) { ++ vips_error(class->nickname, "%s", _("bad dimensions")); ++ return (-1); + } + + *out_width = width; + *out_height = height; + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_svg_get_scaled_size( VipsForeignLoadSvg *svg, +- int *out_width, int *out_height ) ++vips_foreign_load_svg_get_scaled_size(VipsForeignLoadSvg *svg, ++ int *out_width, int *out_height) + { + double width; + double height; + + /* Get dimensions with the default dpi. + */ +- rsvg_handle_set_dpi( svg->page, 72.0 ); +- if( vips_foreign_load_svg_get_natural_size( svg, &width, &height ) ) +- return( -1 ); ++ rsvg_handle_set_dpi(svg->page, 72.0); ++ if (vips_foreign_load_svg_get_natural_size(svg, &width, &height)) ++ return (-1); + + /* We scale up with cairo --- scaling with rsvg_handle_set_dpi() will + * fail for SVGs with absolute sizes. +@@ -518,166 +517,166 @@ vips_foreign_load_svg_get_scaled_size( VipsForeignLoadSvg *svg, + width *= svg->cairo_scale; + height *= svg->cairo_scale; + +- *out_width = VIPS_ROUND_UINT( width ); +- *out_height = VIPS_ROUND_UINT( height ); ++ *out_width = VIPS_ROUND_UINT(width); ++ *out_height = VIPS_ROUND_UINT(height); + +- return ( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_svg_parse( VipsForeignLoadSvg *svg, VipsImage *out ) ++vips_foreign_load_svg_parse(VipsForeignLoadSvg *svg, VipsImage *out) + { + int width; + int height; + double res; + +- if( vips_foreign_load_svg_get_scaled_size( svg, &width, &height ) ) +- return( -1 ); ++ if (vips_foreign_load_svg_get_scaled_size(svg, &width, &height)) ++ return (-1); + + /* We need pixels/mm for vips. + */ + res = svg->dpi / 25.4; + +- vips_image_init_fields( out, ++ vips_image_init_fields(out, + width, height, + 4, VIPS_FORMAT_UCHAR, +- VIPS_CODING_NONE, VIPS_INTERPRETATION_sRGB, res, res ); ++ VIPS_CODING_NONE, VIPS_INTERPRETATION_sRGB, res, res); + + /* We use a tilecache, so it's smalltile. + */ +- if( vips_image_pipelinev( out, VIPS_DEMAND_STYLE_SMALLTILE, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(out, VIPS_DEMAND_STYLE_SMALLTILE, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_svg_header( VipsForeignLoad *load ) ++vips_foreign_load_svg_header(VipsForeignLoad *load) + { + VipsForeignLoadSvg *svg = (VipsForeignLoadSvg *) load; + +- return vips_foreign_load_svg_parse( svg, load->out ); ++ return vips_foreign_load_svg_parse(svg, load->out); + } + + static int +-vips_foreign_load_svg_generate( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_foreign_load_svg_generate(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + const VipsForeignLoadSvg *svg = (VipsForeignLoadSvg *) a; +- const VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( svg ); +- const VipsRect *r = &or->valid; ++ const VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(svg); ++ const VipsRect *r = & or->valid; + + cairo_surface_t *surface; + cairo_t *cr; + int y; + + #ifdef DEBUG +- printf( "vips_foreign_load_svg_generate: %p \n " +- "left = %d, top = %d, width = %d, height = %d\n", ++ printf("vips_foreign_load_svg_generate: %p \n " ++ "left = %d, top = %d, width = %d, height = %d\n", + svg, +- r->left, r->top, r->width, r->height ); ++ r->left, r->top, r->width, r->height); + #endif /*DEBUG*/ + + /* rsvg won't always paint the background. + */ +- vips_region_black( or ); ++ vips_region_black(or); + +- surface = cairo_image_surface_create_for_data( +- VIPS_REGION_ADDR( or, r->left, r->top ), +- CAIRO_FORMAT_ARGB32, +- r->width, r->height, +- VIPS_REGION_LSKIP( or ) ); +- cr = cairo_create( surface ); +- cairo_surface_destroy( surface ); ++ surface = cairo_image_surface_create_for_data( ++ VIPS_REGION_ADDR(or, r->left, r->top), ++ CAIRO_FORMAT_ARGB32, ++ r->width, r->height, ++ VIPS_REGION_LSKIP(or)); ++ cr = cairo_create(surface); ++ cairo_surface_destroy(surface); + + /* rsvg is single-threaded, but we don't need to lock since we're + * running inside a non-threaded tilecache. + */ +-#if LIBRSVG_CHECK_VERSION( 2, 46, 0 ) ++#if LIBRSVG_CHECK_VERSION(2, 46, 0) + +-{ +- RsvgRectangle viewport; +- GError *error = NULL; ++ { ++ RsvgRectangle viewport; ++ GError *error = NULL; + +- /* No need to scale -- we always set the viewport to the +- * whole image, and set the region to draw on the surface. +- */ +- cairo_translate( cr, -r->left, -r->top ); +- viewport.x = 0; +- viewport.y = 0; +- viewport.width = or->im->Xsize; +- viewport.height = or->im->Ysize; +- +- if( !rsvg_handle_render_document( svg->page, cr, &viewport, &error ) ) { +- cairo_destroy( cr ); +- vips_operation_invalidate( VIPS_OPERATION( svg ) ); +- vips_error( class->nickname, +- "%s", _( "SVG rendering failed" ) ); +- vips_g_error( &error ); +- return( -1 ); +- } ++ /* No need to scale -- we always set the viewport to the ++ * whole image, and set the region to draw on the surface. ++ */ ++ cairo_translate(cr, -r->left, -r->top); ++ viewport.x = 0; ++ viewport.y = 0; ++ viewport.width = or->im->Xsize; ++ viewport.height = or->im->Ysize; ++ ++ if (!rsvg_handle_render_document(svg->page, cr, &viewport, &error)) { ++ cairo_destroy(cr); ++ vips_operation_invalidate(VIPS_OPERATION(svg)); ++ vips_error(class->nickname, ++ "%s", _("SVG rendering failed")); ++ vips_g_error(&error); ++ return (-1); ++ } + +- cairo_destroy( cr ); +-} ++ cairo_destroy(cr); ++ } + + #else /*!LIBRSVG_CHECK_VERSION( 2, 46, 0 )*/ + +- cairo_scale( cr, svg->cairo_scale, svg->cairo_scale ); +- cairo_translate( cr, -r->left / svg->cairo_scale, +- -r->top / svg->cairo_scale ); ++ cairo_scale(cr, svg->cairo_scale, svg->cairo_scale); ++ cairo_translate(cr, -r->left / svg->cairo_scale, ++ -r->top / svg->cairo_scale); + +- if( !rsvg_handle_render_cairo( svg->page, cr ) ) { +- cairo_destroy( cr ); +- vips_operation_invalidate( VIPS_OPERATION( svg ) ); +- vips_error( class->nickname, +- "%s", _( "SVG rendering failed" ) ); +- return( -1 ); ++ if (!rsvg_handle_render_cairo(svg->page, cr)) { ++ cairo_destroy(cr); ++ vips_operation_invalidate(VIPS_OPERATION(svg)); ++ vips_error(class->nickname, ++ "%s", _("SVG rendering failed")); ++ return (-1); + } + +- cairo_destroy( cr ); ++ cairo_destroy(cr); + + #endif /*LIBRSVG_CHECK_VERSION( 2, 46, 0 )*/ + + /* Cairo makes pre-multipled BRGA -- we must byteswap and unpremultiply. + */ +- for( y = 0; y < r->height; y++ ) +- vips__premultiplied_bgra2rgba( +- (guint32 *) VIPS_REGION_ADDR( or, r->left, r->top + y ), +- r->width ); ++ for (y = 0; y < r->height; y++) ++ vips__premultiplied_bgra2rgba( ++ (guint32 *) VIPS_REGION_ADDR(or, r->left, r->top + y), ++ r->width); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_svg_load( VipsForeignLoad *load ) ++vips_foreign_load_svg_load(VipsForeignLoad *load) + { + VipsForeignLoadSvg *svg = (VipsForeignLoadSvg *) load; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( (VipsObject *) load, 3 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array((VipsObject *) load, 3); + + /* Enough tiles for two complete rows. + */ +- t[0] = vips_image_new(); +- if( vips_foreign_load_svg_parse( svg, t[0] ) || +- vips_image_generate( t[0], NULL, +- vips_foreign_load_svg_generate, NULL, svg, NULL ) || +- vips_tilecache( t[0], &t[1], ++ t[0] = vips_image_new(); ++ if (vips_foreign_load_svg_parse(svg, t[0]) || ++ vips_image_generate(t[0], NULL, ++ vips_foreign_load_svg_generate, NULL, svg, NULL) || ++ vips_tilecache(t[0], &t[1], + "tile_width", TILE_SIZE, + "tile_height", TILE_SIZE, + "max_tiles", 2 * (1 + t[0]->Xsize / TILE_SIZE), +- NULL ) || +- vips_image_write( t[1], load->real ) ) +- return( -1 ); ++ NULL) || ++ vips_image_write(t[1], load->real)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_svg_class_init( VipsForeignLoadSvgClass *class ) ++vips_foreign_load_svg_class_init(VipsForeignLoadSvgClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -686,7 +685,7 @@ vips_foreign_load_svg_class_init( VipsForeignLoadSvgClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "svgload_base"; +- object_class->description = _( "load SVG with rsvg" ); ++ object_class->description = _("load SVG with rsvg"); + + /* librsvg has not been fuzzed, so should not be used with + * untrusted input unless you are very careful. +@@ -697,36 +696,35 @@ vips_foreign_load_svg_class_init( VipsForeignLoadSvgClass *class ) + */ + foreign_class->priority = -5; + +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_svg_get_flags_filename; + load_class->get_flags = vips_foreign_load_svg_get_flags; + load_class->load = vips_foreign_load_svg_load; + +- VIPS_ARG_DOUBLE( class, "dpi", 21, +- _( "DPI" ), +- _( "Render at this DPI" ), ++ VIPS_ARG_DOUBLE(class, "dpi", 21, ++ _("DPI"), ++ _("Render at this DPI"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadSvg, dpi ), +- 0.001, 100000.0, 72.0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadSvg, dpi), ++ 0.001, 100000.0, 72.0); + +- VIPS_ARG_DOUBLE( class, "scale", 22, +- _( "Scale" ), +- _( "Scale output by this factor" ), ++ VIPS_ARG_DOUBLE(class, "scale", 22, ++ _("Scale"), ++ _("Scale output by this factor"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadSvg, scale ), +- 0.001, 100000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadSvg, scale), ++ 0.001, 100000.0, 1.0); + +- VIPS_ARG_BOOL( class, "unlimited", 23, +- _( "Unlimited" ), +- _( "Allow SVG of any size" ), ++ VIPS_ARG_BOOL(class, "unlimited", 23, ++ _("Unlimited"), ++ _("Allow SVG of any size"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadSvg, unlimited ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsForeignLoadSvg, unlimited), ++ FALSE); + } + + static void +-vips_foreign_load_svg_init( VipsForeignLoadSvg *svg ) ++vips_foreign_load_svg_init(VipsForeignLoadSvg *svg) + { + svg->dpi = 72.0; + svg->scale = 1.0; +@@ -744,27 +742,27 @@ typedef struct _VipsForeignLoadSvgSource { + + typedef VipsForeignLoadClass VipsForeignLoadSvgSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadSvgSource, vips_foreign_load_svg_source, +- vips_foreign_load_svg_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadSvgSource, vips_foreign_load_svg_source, ++ vips_foreign_load_svg_get_type()); + + gboolean +-vips_foreign_load_svg_source_is_a_source( VipsSource *source ) ++vips_foreign_load_svg_source_is_a_source(VipsSource *source) + { + unsigned char *data; + gint64 bytes_read; + +- if( (bytes_read = vips_source_sniff_at_most( source, +- &data, SVG_HEADER_SIZE )) <= 0 ) +- return( FALSE ); ++ if ((bytes_read = vips_source_sniff_at_most(source, ++ &data, SVG_HEADER_SIZE)) <= 0) ++ return (FALSE); + +- return( vips_foreign_load_svg_is_a( data, bytes_read ) ); ++ return (vips_foreign_load_svg_is_a(data, bytes_read)); + } + + static int +-vips_foreign_load_svg_source_header( VipsForeignLoad *load ) ++vips_foreign_load_svg_source_header(VipsForeignLoad *load) + { + VipsForeignLoadSvg *svg = (VipsForeignLoadSvg *) load; +- VipsForeignLoadSvgSource *source = ++ VipsForeignLoadSvgSource *source = + (VipsForeignLoadSvgSource *) load; + RsvgHandleFlags flags = svg->unlimited ? RSVG_HANDLE_FLAG_UNLIMITED : 0; + +@@ -772,47 +770,47 @@ vips_foreign_load_svg_source_header( VipsForeignLoad *load ) + + GInputStream *gstream; + +- if( vips_source_rewind( source->source ) ) +- return( -1 ); ++ if (vips_source_rewind(source->source)) ++ return (-1); + +- gstream = vips_g_input_stream_new_from_source( source->source ); +- if( !(svg->page = rsvg_handle_new_from_stream_sync( +- gstream, NULL, flags, NULL, &error )) ) { +- g_object_unref( gstream ); +- vips_g_error( &error ); +- return( -1 ); ++ gstream = vips_g_input_stream_new_from_source(source->source); ++ if (!(svg->page = rsvg_handle_new_from_stream_sync( ++ gstream, NULL, flags, NULL, &error))) { ++ g_object_unref(gstream); ++ vips_g_error(&error); ++ return (-1); + } +- g_object_unref( gstream ); ++ g_object_unref(gstream); + +- return( vips_foreign_load_svg_header( load ) ); ++ return (vips_foreign_load_svg_header(load)); + } + + static int +-vips_foreign_load_svg_source_load( VipsForeignLoad *load ) ++vips_foreign_load_svg_source_load(VipsForeignLoad *load) + { + VipsForeignLoadSvgSource *source = (VipsForeignLoadSvgSource *) load; + +- if( vips_source_rewind( source->source ) || +- vips_foreign_load_svg_load( load ) || +- vips_source_decode( source->source ) ) +- return( -1 ); ++ if (vips_source_rewind(source->source) || ++ vips_foreign_load_svg_load(load) || ++ vips_source_decode(source->source)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_svg_source_class_init( VipsForeignLoadSvgSourceClass *class ) ++vips_foreign_load_svg_source_class_init(VipsForeignLoadSvgSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "svgload_source"; +- object_class->description = _( "load svg from source" ); ++ object_class->description = _("load svg from source"); + + operation_class->flags |= VIPS_OPERATION_NOCACHE; + +@@ -820,17 +818,16 @@ vips_foreign_load_svg_source_class_init( VipsForeignLoadSvgSourceClass *class ) + load_class->header = vips_foreign_load_svg_source_header; + load_class->load = vips_foreign_load_svg_source_load; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadSvgSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadSvgSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_svg_source_init( VipsForeignLoadSvgSource *source ) ++vips_foreign_load_svg_source_init(VipsForeignLoadSvgSource *source) + { + } + +@@ -839,28 +836,28 @@ typedef struct _VipsForeignLoadSvgFile { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadSvgFile; + + typedef VipsForeignLoadSvgClass VipsForeignLoadSvgFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadSvgFile, vips_foreign_load_svg_file, +- vips_foreign_load_svg_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadSvgFile, vips_foreign_load_svg_file, ++ vips_foreign_load_svg_get_type()); + + static gboolean +-vips_foreign_load_svg_file_is_a( const char *filename ) ++vips_foreign_load_svg_file_is_a(const char *filename) + { + unsigned char buf[SVG_HEADER_SIZE]; + guint64 bytes; + +- return( (bytes = vips__get_bytes( filename, +- buf, SVG_HEADER_SIZE )) > 0 && +- vips_foreign_load_svg_is_a( buf, bytes ) ); ++ return ((bytes = vips__get_bytes(filename, ++ buf, SVG_HEADER_SIZE)) > 0 && ++ vips_foreign_load_svg_is_a(buf, bytes)); + } + + static int +-vips_foreign_load_svg_file_header( VipsForeignLoad *load ) ++vips_foreign_load_svg_file_header(VipsForeignLoad *load) + { + VipsForeignLoadSvg *svg = (VipsForeignLoadSvg *) load; + VipsForeignLoadSvgFile *file = (VipsForeignLoadSvgFile *) load; +@@ -870,24 +867,24 @@ vips_foreign_load_svg_file_header( VipsForeignLoad *load ) + + GFile *gfile; + +- gfile = g_file_new_for_path( file->filename ); +- if( !(svg->page = rsvg_handle_new_from_gfile_sync( +- gfile, flags, NULL, &error )) ) { +- g_object_unref( gfile ); +- vips_g_error( &error ); +- return( -1 ); ++ gfile = g_file_new_for_path(file->filename); ++ if (!(svg->page = rsvg_handle_new_from_gfile_sync( ++ gfile, flags, NULL, &error))) { ++ g_object_unref(gfile); ++ vips_g_error(&error); ++ return (-1); + } +- g_object_unref( gfile ); ++ g_object_unref(gfile); + +- VIPS_SETSTR( load->out->filename, file->filename ); ++ VIPS_SETSTR(load->out->filename, file->filename); + +- return( vips_foreign_load_svg_header( load ) ); ++ return (vips_foreign_load_svg_header(load)); + } + + static const char *vips_foreign_svg_suffs[] = { + ".svg", +- /* librsvg supports svgz directly, no need to check for zlib here. +- */ ++/* librsvg supports svgz directly, no need to check for zlib here. ++ */ + #if LIBRSVG_CHECK_FEATURE(SVGZ) + ".svgz", + ".svg.gz", +@@ -896,10 +893,10 @@ static const char *vips_foreign_svg_suffs[] = { + }; + + static void +-vips_foreign_load_svg_file_class_init( +- VipsForeignLoadSvgFileClass *class ) ++vips_foreign_load_svg_file_class_init( ++ VipsForeignLoadSvgFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -914,17 +911,16 @@ vips_foreign_load_svg_file_class_init( + load_class->is_a = vips_foreign_load_svg_file_is_a; + load_class->header = vips_foreign_load_svg_file_header; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadSvgFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadSvgFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_svg_file_init( VipsForeignLoadSvgFile *file ) ++vips_foreign_load_svg_file_init(VipsForeignLoadSvgFile *file) + { + } + +@@ -939,14 +935,14 @@ typedef struct _VipsForeignLoadSvgBuffer { + + typedef VipsForeignLoadSvgClass VipsForeignLoadSvgBufferClass; + +-G_DEFINE_TYPE( VipsForeignLoadSvgBuffer, vips_foreign_load_svg_buffer, +- vips_foreign_load_svg_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadSvgBuffer, vips_foreign_load_svg_buffer, ++ vips_foreign_load_svg_get_type()); + + static int +-vips_foreign_load_svg_buffer_header( VipsForeignLoad *load ) ++vips_foreign_load_svg_buffer_header(VipsForeignLoad *load) + { + VipsForeignLoadSvg *svg = (VipsForeignLoadSvg *) load; +- VipsForeignLoadSvgBuffer *buffer = ++ VipsForeignLoadSvgBuffer *buffer = + (VipsForeignLoadSvgBuffer *) load; + RsvgHandleFlags flags = svg->unlimited ? RSVG_HANDLE_FLAG_UNLIMITED : 0; + +@@ -954,24 +950,24 @@ vips_foreign_load_svg_buffer_header( VipsForeignLoad *load ) + + GInputStream *gstream; + +- gstream = g_memory_input_stream_new_from_data( +- buffer->buf->data, buffer->buf->length, NULL ); +- if( !(svg->page = rsvg_handle_new_from_stream_sync( +- gstream, NULL, flags, NULL, &error )) ) { +- g_object_unref( gstream ); +- vips_g_error( &error ); +- return( -1 ); ++ gstream = g_memory_input_stream_new_from_data( ++ buffer->buf->data, buffer->buf->length, NULL); ++ if (!(svg->page = rsvg_handle_new_from_stream_sync( ++ gstream, NULL, flags, NULL, &error))) { ++ g_object_unref(gstream); ++ vips_g_error(&error); ++ return (-1); + } +- g_object_unref( gstream ); ++ g_object_unref(gstream); + +- return( vips_foreign_load_svg_header( load ) ); ++ return (vips_foreign_load_svg_header(load)); + } + + static void +-vips_foreign_load_svg_buffer_class_init( +- VipsForeignLoadSvgBufferClass *class ) ++vips_foreign_load_svg_buffer_class_init( ++ VipsForeignLoadSvgBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -983,17 +979,16 @@ vips_foreign_load_svg_buffer_class_init( + load_class->is_a_buffer = vips_foreign_load_svg_is_a; + load_class->header = vips_foreign_load_svg_buffer_header; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadSvgBuffer, buf ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadSvgBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_load_svg_buffer_init( VipsForeignLoadSvgBuffer *buffer ) ++vips_foreign_load_svg_buffer_init(VipsForeignLoadSvgBuffer *buffer) + { + } + +@@ -1015,7 +1010,7 @@ vips_foreign_load_svg_buffer_init( VipsForeignLoadSvgBuffer *buffer ) + * and should be fast. + * + * Use @dpi to set the rendering resolution. The default is 72. You can also +- * scale the rendering by @scale. ++ * scale the rendering by @scale. + * + * This function only reads the image header and does not render any pixel + * data. Rendering occurs when pixels are accessed. +@@ -1028,16 +1023,16 @@ vips_foreign_load_svg_buffer_init( VipsForeignLoadSvgBuffer *buffer ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_svgload( const char *filename, VipsImage **out, ... ) ++vips_svgload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "svgload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("svgload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -1054,17 +1049,17 @@ vips_svgload( const char *filename, VipsImage **out, ... ) + * * @unlimited: %gboolean, allow SVGs of any size + * + * Read a SVG-formatted memory block into a VIPS image. Exactly as +- * vips_svgload(), but read from a memory buffer. ++ * vips_svgload(), but read from a memory buffer. + * +- * You must not free the buffer while @out is active. The +- * #VipsObject::postclose signal on @out is a good place to free. ++ * You must not free the buffer while @out is active. The ++ * #VipsObject::postclose signal on @out is a good place to free. + * + * See also: vips_svgload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_svgload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++vips_svgload_buffer(void *buf, size_t len, VipsImage **out, ...) + { + va_list ap; + VipsBlob *blob; +@@ -1072,15 +1067,15 @@ vips_svgload_buffer( void *buf, size_t len, VipsImage **out, ... ) + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, buf, len ); ++ blob = vips_blob_new(NULL, buf, len); + +- va_start( ap, out ); +- result = vips_call_split( "svgload_buffer", ap, blob, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("svgload_buffer", ap, blob, out); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( result ); ++ return (result); + } + + /** +@@ -1103,7 +1098,7 @@ vips_svgload_buffer( void *buf, size_t len, VipsImage **out, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_svgload_string( const char *str, VipsImage **out, ... ) ++vips_svgload_string(const char *str, VipsImage **out, ...) + { + va_list ap; + VipsBlob *blob; +@@ -1111,15 +1106,15 @@ vips_svgload_string( const char *str, VipsImage **out, ... ) + + /* Copy the string. + */ +- blob = vips_blob_copy( (const void *) str, strlen( str ) ); ++ blob = vips_blob_copy((const void *) str, strlen(str)); + +- va_start( ap, out ); +- result = vips_call_split( "svgload_buffer", ap, blob, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("svgload_buffer", ap, blob, out); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( result ); ++ return (result); + } + + /** +@@ -1128,22 +1123,21 @@ vips_svgload_string( const char *str, VipsImage **out, ... ) + * @out: (out): image to write + * @...: %NULL-terminated list of optional named arguments + * +- * Exactly as vips_svgload(), but read from a source. ++ * Exactly as vips_svgload(), but read from a source. + * + * See also: vips_svgload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_svgload_source( VipsSource *source, VipsImage **out, ... ) ++vips_svgload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "svgload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("svgload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/foreign/tiff.c b/libvips/foreign/tiff.c +index 734ed2b8cb..e21eb99117 100644 +--- a/libvips/foreign/tiff.c ++++ b/libvips/foreign/tiff.c +@@ -9,28 +9,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -63,93 +63,93 @@ + * more than one thread. + */ + static void +-vips__thandler_error( const char *module, const char *fmt, va_list ap ) ++vips__thandler_error(const char *module, const char *fmt, va_list ap) + { +- vips_verror( module, fmt, ap ); ++ vips_verror(module, fmt, ap); + } + + /* It'd be nice to be able to support the @fail option for the tiff loader, but + * there's no easy way to do this, since libtiff has a global warning handler. + */ + static void +-vips__thandler_warning( const char *module, const char *fmt, va_list ap ) ++vips__thandler_warning(const char *module, const char *fmt, va_list ap) + { +- g_logv( G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, fmt, ap ); ++ g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, fmt, ap); + } + + /* Called during library init. + * +- * libtiff error and warning handlers may be called from other threads +- * running in other libs. Other libs may install error handlers and capture ++ * libtiff error and warning handlers may be called from other threads ++ * running in other libs. Other libs may install error handlers and capture + * messages caused by us. + */ + void +-vips__tiff_init( void ) ++vips__tiff_init(void) + { +- TIFFSetErrorHandler( vips__thandler_error ); +- TIFFSetWarningHandler( vips__thandler_warning ); ++ TIFFSetErrorHandler(vips__thandler_error); ++ TIFFSetWarningHandler(vips__thandler_warning); + } + + /* TIFF input from a vips source. + */ + + static tsize_t +-openin_source_read( thandle_t st, tdata_t data, tsize_t size ) ++openin_source_read(thandle_t st, tdata_t data, tsize_t size) + { +- VipsSource *source = VIPS_SOURCE( st ); ++ VipsSource *source = VIPS_SOURCE(st); + +- return( vips_source_read( source, data, size ) ); ++ return (vips_source_read(source, data, size)); + } + + static tsize_t +-openin_source_write( thandle_t st, tdata_t buffer, tsize_t size ) ++openin_source_write(thandle_t st, tdata_t buffer, tsize_t size) + { + g_assert_not_reached(); + +- return( 0 ); ++ return (0); + } + + static toff_t +-openin_source_seek( thandle_t st, toff_t offset, int whence ) ++openin_source_seek(thandle_t st, toff_t offset, int whence) + { +- VipsSource *source = VIPS_SOURCE( st ); ++ VipsSource *source = VIPS_SOURCE(st); + +- return( (toff_t) vips_source_seek( source, offset, whence ) ); ++ return ((toff_t) vips_source_seek(source, offset, whence)); + } + + static int +-openin_source_close( thandle_t st ) ++openin_source_close(thandle_t st) + { +- VipsSource *source = VIPS_SOURCE( st ); ++ VipsSource *source = VIPS_SOURCE(st); + +- VIPS_UNREF( source ); ++ VIPS_UNREF(source); + +- return( 0 ); ++ return (0); + } + + static toff_t +-openin_source_length( thandle_t st ) ++openin_source_length(thandle_t st) + { +- VipsSource *source = VIPS_SOURCE( st ); ++ VipsSource *source = VIPS_SOURCE(st); + + /* libtiff will use this to get file size if tags like StripByteCounts + * are missing. + * + * toff_t is usually uint64, with -1 cast to uint64 to indicate error. + */ +- return( (toff_t) vips_source_length( source ) ); ++ return ((toff_t) vips_source_length(source)); + } + + static int +-openin_source_map( thandle_t st, tdata_t *start, toff_t *len ) ++openin_source_map(thandle_t st, tdata_t *start, toff_t *len) + { + g_assert_not_reached(); + +- return( 0 ); ++ return (0); + } + + static void +-openin_source_unmap( thandle_t st, tdata_t start, toff_t len ) ++openin_source_unmap(thandle_t st, tdata_t start, toff_t len) + { + g_assert_not_reached(); + +@@ -157,43 +157,43 @@ openin_source_unmap( thandle_t st, tdata_t start, toff_t len ) + } + + TIFF * +-vips__tiff_openin_source( VipsSource *source ) ++vips__tiff_openin_source(VipsSource *source) + { + TIFF *tiff; + + #ifdef DEBUG +- printf( "vips__tiff_openin_source:\n" ); ++ printf("vips__tiff_openin_source:\n"); + #endif /*DEBUG*/ + +- if( vips_source_rewind( source ) ) +- return( NULL ); ++ if (vips_source_rewind(source)) ++ return (NULL); + + /* Disable memory mapped input -- it chews up VM and the performance +- * gain is very small. ++ * gain is very small. + * +- * C enables strip chopping: very large uncompressed strips are +- * chopped into c. 8kb chunks. This can reduce peak memory use for ++ * C enables strip chopping: very large uncompressed strips are ++ * chopped into c. 8kb chunks. This can reduce peak memory use for + * this type of file. + */ +- if( !(tiff = TIFFClientOpen( "source input", "rmC", +- (thandle_t) source, +- openin_source_read, +- openin_source_write, +- openin_source_seek, +- openin_source_close, +- openin_source_length, +- openin_source_map, +- openin_source_unmap )) ) { +- vips_error( "vips__tiff_openin_source", "%s", +- _( "unable to open source for input" ) ); +- return( NULL ); ++ if (!(tiff = TIFFClientOpen("source input", "rmC", ++ (thandle_t) source, ++ openin_source_read, ++ openin_source_write, ++ openin_source_seek, ++ openin_source_close, ++ openin_source_length, ++ openin_source_map, ++ openin_source_unmap))) { ++ vips_error("vips__tiff_openin_source", "%s", ++ _("unable to open source for input")); ++ return (NULL); + } + + /* Unreffed on close(), see above. + */ +- g_object_ref( source ); ++ g_object_ref(source); + +- return( tiff ); ++ return (tiff); + } + + /* TIFF output to a target. +@@ -202,61 +202,61 @@ vips__tiff_openin_source( VipsSource *source ) + /* libtiff needs this (!!?!?!) for writing multipage images. + */ + static tsize_t +-openout_target_read( thandle_t st, tdata_t data, tsize_t size ) ++openout_target_read(thandle_t st, tdata_t data, tsize_t size) + { + VipsTarget *target = (VipsTarget *) st; + +- return( vips_target_read( target, data, size ) ); ++ return (vips_target_read(target, data, size)); + } + + static tsize_t +-openout_target_write( thandle_t st, tdata_t data, tsize_t size ) ++openout_target_write(thandle_t st, tdata_t data, tsize_t size) + { + VipsTarget *target = (VipsTarget *) st; + +- if( vips_target_write( target, data, size ) ) +- return( (tsize_t) -1 ); ++ if (vips_target_write(target, data, size)) ++ return ((tsize_t) -1); + +- return( size ); ++ return (size); + } + + static toff_t +-openout_target_seek( thandle_t st, toff_t offset, int whence ) ++openout_target_seek(thandle_t st, toff_t offset, int whence) + { + VipsTarget *target = (VipsTarget *) st; + +- return( vips_target_seek( target, offset, whence ) ); ++ return (vips_target_seek(target, offset, whence)); + } + + static int +-openout_target_close( thandle_t st ) ++openout_target_close(thandle_t st) + { + VipsTarget *target = (VipsTarget *) st; + +- if( vips_target_end( target ) ) +- return( -1 ); ++ if (vips_target_end(target)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static toff_t +-openout_target_length( thandle_t st ) ++openout_target_length(thandle_t st) + { + g_assert_not_reached(); + +- return( (toff_t) -1 ); ++ return ((toff_t) -1); + } + + static int +-openout_target_map( thandle_t st, tdata_t *start, toff_t *len ) ++openout_target_map(thandle_t st, tdata_t *start, toff_t *len) + { + g_assert_not_reached(); + +- return( -1 ); ++ return (-1); + } + + static void +-openout_target_unmap( thandle_t st, tdata_t start, toff_t len ) ++openout_target_unmap(thandle_t st, tdata_t start, toff_t len) + { + g_assert_not_reached(); + +@@ -264,31 +264,31 @@ openout_target_unmap( thandle_t st, tdata_t start, toff_t len ) + } + + TIFF * +-vips__tiff_openout_target( VipsTarget *target, gboolean bigtiff ) ++vips__tiff_openout_target(VipsTarget *target, gboolean bigtiff) + { + const char *mode = bigtiff ? "w8" : "w"; + + TIFF *tiff; + + #ifdef DEBUG +- printf( "vips__tiff_openout_buffer:\n" ); ++ printf("vips__tiff_openout_buffer:\n"); + #endif /*DEBUG*/ + +- if( !(tiff = TIFFClientOpen( "target output", mode, +- (thandle_t) target, +- openout_target_read, +- openout_target_write, +- openout_target_seek, +- openout_target_close, +- openout_target_length, +- openout_target_map, +- openout_target_unmap )) ) { +- vips_error( "vips__tiff_openout_target", "%s", +- _( "unable to open target for output" ) ); +- return( NULL ); ++ if (!(tiff = TIFFClientOpen("target output", mode, ++ (thandle_t) target, ++ openout_target_read, ++ openout_target_write, ++ openout_target_seek, ++ openout_target_close, ++ openout_target_length, ++ openout_target_map, ++ openout_target_unmap))) { ++ vips_error("vips__tiff_openout_target", "%s", ++ _("unable to open target for output")); ++ return (NULL); + } + +- return( tiff ); ++ return (tiff); + } + + #endif /*HAVE_TIFF*/ +diff --git a/libvips/foreign/tiff.h b/libvips/foreign/tiff.h +index 45a125c837..f67167e4a0 100644 +--- a/libvips/foreign/tiff.h ++++ b/libvips/foreign/tiff.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -37,10 +37,10 @@ + extern "C" { + #endif /*__cplusplus*/ + +-TIFF *vips__tiff_openin_source( VipsSource *source ); ++TIFF *vips__tiff_openin_source(VipsSource *source); + +-TIFF *vips__tiff_openout( const char *path, gboolean bigtiff ); +-TIFF *vips__tiff_openout_target( VipsTarget *target, gboolean bigtiff ); ++TIFF *vips__tiff_openout(const char *path, gboolean bigtiff); ++TIFF *vips__tiff_openout_target(VipsTarget *target, gboolean bigtiff); + + #ifdef __cplusplus + } +diff --git a/libvips/foreign/tiff2vips.c b/libvips/foreign/tiff2vips.c +index 0f0d6b58e7..4c78baa3ce 100644 +--- a/libvips/foreign/tiff2vips.c ++++ b/libvips/foreign/tiff2vips.c +@@ -106,7 +106,7 @@ + * 15/8/08 + * - reorganise for image format system + * 20/12/08 +- * - dont read with mmap: no performance advantage with libtiff, chews up ++ * - dont read with mmap: no performance advantage with libtiff, chews up + * VM wastefully + * 13/1/09 + * - read strip-wise, not scanline-wise ... works with more compression / +@@ -140,7 +140,7 @@ + * 17/9/13 + * - support separate planes for strip read + * - big cleanup +- * - support for many more formats, eg. 32-bit int etc. ++ * - support for many more formats, eg. 32-bit int etc. + * 11/4/14 + * - support 16 bits per sample palette images + * - palette images can have an alpha +@@ -156,7 +156,7 @@ + * - try to handle 8-bit colormaps + * 26/2/15 + * - close the read down early for a header read ... this saves an +- * fd during file read, handy for large numbers of input images ++ * fd during file read, handy for large numbers of input images + * 29/9/15 + * - load IPTC metadata + * - load photoshop metadata +@@ -168,7 +168,7 @@ + * 26/5/16 + * - add autorotate support + * 17/11/16 +- * - add multi-page read ++ * - add multi-page read + * 17/1/17 + * - invalidate operation on read error + * 27/1/17 +@@ -184,7 +184,7 @@ + * 16/8/18 + * - shut down the input file as soon as we can [kleisauke] + * 28/3/19 omira-sch +- * - better buffer sizing ++ * - better buffer sizing + * - ban chroma-subsampled, non-jpg compressed images + * 7/6/19 + * - istiff reads the first directory rather than just testing the magic +@@ -195,7 +195,7 @@ + * - support ASSOCALPHA in any alpha band + * 27/1/20 + * - read logluv images as XYZ +- * 11/4/20 petoor ++ * 11/4/20 petoor + * - better handling of aligned reads in multipage tiffs + * 28/5/20 + * - add subifd +@@ -215,32 +215,32 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +-/* ++/* + #define DEBUG_VERBOSE + #define DEBUG + */ +@@ -283,7 +283,7 @@ + */ + static int rtiff_we_decompress[] = { + #ifdef HAVE_JPEG +- COMPRESSION_JPEG, ++ COMPRESSION_JPEG, + #endif /*HAVE_JPEG*/ + JP2K_YCC, + JP2K_RGB, +@@ -302,10 +302,10 @@ typedef struct _RtiffHeader { + int photometric_interpretation; + int inkset; + int sample_format; +- gboolean separate; +- int orientation; ++ gboolean separate; ++ int orientation; + +- /* If there's a premultiplied alpha, the band we need to ++ /* If there's a premultiplied alpha, the band we need to + * unpremultiply with. -1 for no unpremultiplication. + */ + int alpha_band; +@@ -318,7 +318,7 @@ typedef struct _RtiffHeader { + /* Fields for tiled images, as returned by libtiff. + */ + guint32 tile_width; +- guint32 tile_height; ++ guint32 tile_height; + tsize_t tile_size; + tsize_t tile_row_size; + +@@ -362,8 +362,8 @@ typedef struct _RtiffHeader { + /* Scanline-type process function. + */ + struct _Rtiff; +-typedef void (*scanline_process_fn)( struct _Rtiff *, +- VipsPel *q, VipsPel *p, int n, void *client ); ++typedef void (*scanline_process_fn)(struct _Rtiff *, ++ VipsPel *q, VipsPel *p, int n, void *client); + + /* Stuff we track during a read. + */ +@@ -377,10 +377,10 @@ typedef struct _Rtiff { + gboolean autorotate; + int subifd; + VipsFailOn fail_on; +- +- /* We decompress some compression types in parallel, so we need to +- * lock tile get. +- */ ++ ++ /* We decompress some compression types in parallel, so we need to ++ * lock tile get. ++ */ + GRecMutex lock; + + /* The TIFF we read. +@@ -405,16 +405,16 @@ typedef struct _Rtiff { + gboolean memcpy; + + /* Geometry as read from the TIFF header. This is read for the first +- * page, and equal for all other pages. ++ * page, and equal for all other pages. + */ +- RtiffHeader header; ++ RtiffHeader header; + + /* Hold a single strip or tile, possibly just an image plane. + */ + tdata_t plane_buf; + +- /* Hold a plane-assembled strip or tile ... a set of samples_per_pixel +- * strips or tiles interleaved. ++ /* Hold a plane-assembled strip or tile ... a set of samples_per_pixel ++ * strips or tiles interleaved. + */ + tdata_t contig_buf; + +@@ -426,62 +426,62 @@ typedef struct _Rtiff { + /* Test for field exists. + */ + static int +-tfexists( TIFF *tif, ttag_t tag ) ++tfexists(TIFF *tif, ttag_t tag) + { + guint32 a, b; + +- if( TIFFGetField( tif, tag, &a, &b ) ) +- return( 1 ); +- else +- return( 0 ); ++ if (TIFFGetField(tif, tag, &a, &b)) ++ return (1); ++ else ++ return (0); + } + +-/* Get a guint32 field. ++/* Get a guint32 field. + */ + static int +-tfget32( TIFF *tif, ttag_t tag, guint32 *out ) ++tfget32(TIFF *tif, ttag_t tag, guint32 *out) + { + guint32 fld; + +- if( !TIFFGetFieldDefaulted( tif, tag, &fld ) ) { +- vips_error( "tiff2vips", +- _( "required field %d missing" ), tag ); +- return( 0 ); ++ if (!TIFFGetFieldDefaulted(tif, tag, &fld)) { ++ vips_error("tiff2vips", ++ _("required field %d missing"), tag); ++ return (0); + } + + *out = fld; + +- return( 1 ); ++ return (1); + } + + /* Get a guint16 field. + */ + static int +-tfget16( TIFF *tif, ttag_t tag, int *out ) ++tfget16(TIFF *tif, ttag_t tag, int *out) + { + guint16 fld; + +- if( !TIFFGetFieldDefaulted( tif, tag, &fld ) ) { +- vips_error( "tiff2vips", +- _( "required field %d missing" ), tag ); +- return( 0 ); ++ if (!TIFFGetFieldDefaulted(tif, tag, &fld)) { ++ vips_error("tiff2vips", ++ _("required field %d missing"), tag); ++ return (0); + } + + *out = fld; + +- return( 1 ); ++ return (1); + } + + static int +-get_resolution( TIFF *tiff, VipsImage *out ) ++get_resolution(TIFF *tiff, VipsImage *out) + { + float x, y; + int ru; + +- if( TIFFGetFieldDefaulted( tiff, TIFFTAG_XRESOLUTION, &x ) && +- TIFFGetFieldDefaulted( tiff, TIFFTAG_YRESOLUTION, &y ) && +- tfget16( tiff, TIFFTAG_RESOLUTIONUNIT, &ru ) ) { +- switch( ru ) { ++ if (TIFFGetFieldDefaulted(tiff, TIFFTAG_XRESOLUTION, &x) && ++ TIFFGetFieldDefaulted(tiff, TIFFTAG_YRESOLUTION, &y) && ++ tfget16(tiff, TIFFTAG_RESOLUTIONUNIT, &ru)) { ++ switch (ru) { + case RESUNIT_NONE: + break; + +@@ -490,8 +490,8 @@ get_resolution( TIFF *tiff, VipsImage *out ) + */ + x /= 10.0 * 2.54; + y /= 10.0 * 2.54; +- vips_image_set_string( out, +- VIPS_META_RESOLUTION_UNIT, "in" ); ++ vips_image_set_string(out, ++ VIPS_META_RESOLUTION_UNIT, "in"); + break; + + case RESUNIT_CENTIMETER: +@@ -499,14 +499,14 @@ get_resolution( TIFF *tiff, VipsImage *out ) + */ + x /= 10.0; + y /= 10.0; +- vips_image_set_string( out, +- VIPS_META_RESOLUTION_UNIT, "cm" ); ++ vips_image_set_string(out, ++ VIPS_META_RESOLUTION_UNIT, "cm"); + break; + + default: +- vips_error( "tiff2vips", +- "%s", _( "unknown resolution unit" ) ); +- return( -1 ); ++ vips_error("tiff2vips", ++ "%s", _("unknown resolution unit")); ++ return (-1); + } + } + else { +@@ -520,82 +520,82 @@ get_resolution( TIFF *tiff, VipsImage *out ) + out->Xres = x; + out->Yres = y; + +- return( 0 ); ++ return (0); + } + + static int +-get_sample_format( TIFF *tiff ) ++get_sample_format(TIFF *tiff) + { + int sample_format; + guint16 v; + + sample_format = SAMPLEFORMAT_INT; + +- if( TIFFGetFieldDefaulted( tiff, TIFFTAG_SAMPLEFORMAT, &v ) ) { ++ if (TIFFGetFieldDefaulted(tiff, TIFFTAG_SAMPLEFORMAT, &v)) { + /* Some images have this set to void, bizarre. + */ +- if( v == SAMPLEFORMAT_VOID ) ++ if (v == SAMPLEFORMAT_VOID) + v = SAMPLEFORMAT_UINT; + + sample_format = v; + } + +- return( sample_format ); ++ return (sample_format); + } + + static int +-get_orientation( TIFF *tiff ) ++get_orientation(TIFF *tiff) + { + int orientation; + guint16 v; + + orientation = ORIENTATION_TOPLEFT; + +- if( TIFFGetFieldDefaulted( tiff, TIFFTAG_ORIENTATION, &v ) ) +- /* Can have mad values. ++ if (TIFFGetFieldDefaulted(tiff, TIFFTAG_ORIENTATION, &v)) ++ /* Can have mad values. + */ +- orientation = VIPS_CLIP( 1, v, 8 ); ++ orientation = VIPS_CLIP(1, v, 8); + +- return( orientation ); ++ return (orientation); + } + + /* Can be called many times. + */ + static void +-rtiff_free( Rtiff *rtiff ) ++rtiff_free(Rtiff *rtiff) + { +- VIPS_FREEF( TIFFClose, rtiff->tiff ); +- g_rec_mutex_clear( &rtiff->lock ); +- VIPS_UNREF( rtiff->source ); ++ VIPS_FREEF(TIFFClose, rtiff->tiff); ++ g_rec_mutex_clear(&rtiff->lock); ++ VIPS_UNREF(rtiff->source); + } + + static void +-rtiff_close_cb( VipsImage *image, Rtiff *rtiff ) ++rtiff_close_cb(VipsImage *image, Rtiff *rtiff) + { +- rtiff_free( rtiff ); ++ rtiff_free(rtiff); + } + + static void +-rtiff_minimise_cb( VipsImage *image, Rtiff *rtiff ) ++rtiff_minimise_cb(VipsImage *image, Rtiff *rtiff) + { + /* We must not minimised tiled images. These can be read from many + * threads, and this minimise handler is not inside the lock. + */ +- if( !rtiff->header.tiled && +- rtiff->source ) +- vips_source_minimise( rtiff->source ); ++ if (!rtiff->header.tiled && ++ rtiff->source) ++ vips_source_minimise(rtiff->source); + } + + static Rtiff * +-rtiff_new( VipsSource *source, VipsImage *out, +- int page, int n, gboolean autorotate, int subifd, VipsFailOn fail_on ) ++rtiff_new(VipsSource *source, VipsImage *out, ++ int page, int n, gboolean autorotate, int subifd, VipsFailOn fail_on) + { + Rtiff *rtiff; + +- if( !(rtiff = VIPS_NEW( out, Rtiff )) ) +- return( NULL ); ++ if (!(rtiff = VIPS_NEW(out, Rtiff))) ++ return (NULL); + +- g_object_ref( source ); ++ g_object_ref(source); + rtiff->source = source; + rtiff->out = out; + rtiff->page = page; +@@ -603,7 +603,7 @@ rtiff_new( VipsSource *source, VipsImage *out, + rtiff->autorotate = autorotate; + rtiff->subifd = subifd; + rtiff->fail_on = fail_on; +- g_rec_mutex_init( &rtiff->lock ); ++ g_rec_mutex_init(&rtiff->lock); + rtiff->tiff = NULL; + rtiff->n_pages = 0; + rtiff->current_page = -1; +@@ -614,118 +614,118 @@ rtiff_new( VipsSource *source, VipsImage *out, + rtiff->contig_buf = NULL; + rtiff->y_pos = 0; + +- g_signal_connect( out, "close", +- G_CALLBACK( rtiff_close_cb ), rtiff ); +- g_signal_connect( out, "minimise", +- G_CALLBACK( rtiff_minimise_cb ), rtiff ); ++ g_signal_connect(out, "close", ++ G_CALLBACK(rtiff_close_cb), rtiff); ++ g_signal_connect(out, "minimise", ++ G_CALLBACK(rtiff_minimise_cb), rtiff); + +- if( rtiff->page < 0 || +- rtiff->page > 1000000 ) { +- vips_error( "tiff2vips", _( "bad page number %d" ), +- rtiff->page ); +- return( NULL ); ++ if (rtiff->page < 0 || ++ rtiff->page > 1000000) { ++ vips_error("tiff2vips", _("bad page number %d"), ++ rtiff->page); ++ return (NULL); + } + + /* We allow n == -1, meaning all pages. It gets swapped for a real n + * value when we open the TIFF. + */ +- if( rtiff->n != -1 && +- (rtiff->n < 1 || rtiff->n > 1000000) ) { +- vips_error( "tiff2vips", _( "bad number of pages %d" ), +- rtiff->n ); +- return( NULL ); ++ if (rtiff->n != -1 && ++ (rtiff->n < 1 || rtiff->n > 1000000)) { ++ vips_error("tiff2vips", _("bad number of pages %d"), ++ rtiff->n); ++ return (NULL); + } + +- if( !(rtiff->tiff = vips__tiff_openin_source( source )) ) +- return( NULL ); ++ if (!(rtiff->tiff = vips__tiff_openin_source(source))) ++ return (NULL); + +- return( rtiff ); ++ return (rtiff); + } + + static int +-rtiff_strip_read( Rtiff *rtiff, int strip, tdata_t buf ) ++rtiff_strip_read(Rtiff *rtiff, int strip, tdata_t buf) + { + tsize_t length; + + #ifdef DEBUG_VERBOSE +- printf( "rtiff_strip_read: reading strip %d\n", strip ); ++ printf("rtiff_strip_read: reading strip %d\n", strip); + #endif /*DEBUG_VERBOSE*/ + +- if( rtiff->header.read_scanlinewise ) +- length = TIFFReadScanline( rtiff->tiff, +- buf, strip, (tsample_t) 0 ); +- else +- length = TIFFReadEncodedStrip( rtiff->tiff, +- strip, buf, (tsize_t) -1 ); ++ if (rtiff->header.read_scanlinewise) ++ length = TIFFReadScanline(rtiff->tiff, ++ buf, strip, (tsample_t) 0); ++ else ++ length = TIFFReadEncodedStrip(rtiff->tiff, ++ strip, buf, (tsize_t) -1); + +- if( length == -1 ) { +- vips_foreign_load_invalidate( rtiff->out ); +- vips_error( "tiff2vips", "%s", _( "read error" ) ); +- return( -1 ); ++ if (length == -1) { ++ vips_foreign_load_invalidate(rtiff->out); ++ vips_error("tiff2vips", "%s", _("read error")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* We need to hint to libtiff what format we'd like pixels in. + */ + static void +-rtiff_set_decode_format( Rtiff *rtiff ) ++rtiff_set_decode_format(Rtiff *rtiff) + { + /* Ask for YCbCr->RGB for jpg data. + */ +- if( rtiff->header.compression == COMPRESSION_JPEG ) +- TIFFSetField( rtiff->tiff, +- TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB ); ++ if (rtiff->header.compression == COMPRESSION_JPEG) ++ TIFFSetField(rtiff->tiff, ++ TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB); + + /* Ask for SGI LOGLUV as 3xfloat. + */ +- if( rtiff->header.photometric_interpretation == +- PHOTOMETRIC_LOGLUV ) +- TIFFSetField( rtiff->tiff, +- TIFFTAG_SGILOGDATAFMT, SGILOGDATAFMT_FLOAT ); ++ if (rtiff->header.photometric_interpretation == ++ PHOTOMETRIC_LOGLUV) ++ TIFFSetField(rtiff->tiff, ++ TIFFTAG_SGILOGDATAFMT, SGILOGDATAFMT_FLOAT); + } + + static int +-rtiff_set_page( Rtiff *rtiff, int page ) ++rtiff_set_page(Rtiff *rtiff, int page) + { +- if( rtiff->current_page != page ) { ++ if (rtiff->current_page != page) { + #ifdef DEBUG +- printf( "rtiff_set_page: selecting page %d, subifd %d\n", +- page, rtiff->subifd ); ++ printf("rtiff_set_page: selecting page %d, subifd %d\n", ++ page, rtiff->subifd); + #endif /*DEBUG*/ + +- if( !TIFFSetDirectory( rtiff->tiff, page ) ) { +- vips_error( "tiff2vips", +- _( "TIFF does not contain page %d" ), page ); +- return( -1 ); ++ if (!TIFFSetDirectory(rtiff->tiff, page)) { ++ vips_error("tiff2vips", ++ _("TIFF does not contain page %d"), page); ++ return (-1); + } + +- if( rtiff->subifd >= 0 ) { ++ if (rtiff->subifd >= 0) { + guint16 subifd_count; + toff_t *subifd_offsets; + +- if( !TIFFGetField( rtiff->tiff, TIFFTAG_SUBIFD, +- &subifd_count, &subifd_offsets ) ) { +- vips_error( "tiff2vips", +- "%s", _( "no SUBIFD tag" ) ); +- return( -1 ); ++ if (!TIFFGetField(rtiff->tiff, TIFFTAG_SUBIFD, ++ &subifd_count, &subifd_offsets)) { ++ vips_error("tiff2vips", ++ "%s", _("no SUBIFD tag")); ++ return (-1); + } + +- if( rtiff->subifd >= subifd_count ) { +- vips_error( "tiff2vips", +- _( "subifd %d out of range, " +- "only 0-%d available" ), ++ if (rtiff->subifd >= subifd_count) { ++ vips_error("tiff2vips", ++ _("subifd %d out of range, " ++ "only 0-%d available"), + rtiff->subifd, +- subifd_count - 1 ); +- return( -1 ); ++ subifd_count - 1); ++ return (-1); + } + +- if( !TIFFSetSubDirectory( rtiff->tiff, +- subifd_offsets[rtiff->subifd] ) ) { +- vips_error( "tiff2vips", +- "%s", _( "subdirectory unreadable" ) ); +- return( -1 ); ++ if (!TIFFSetSubDirectory(rtiff->tiff, ++ subifd_offsets[rtiff->subifd])) { ++ vips_error("tiff2vips", ++ "%s", _("subdirectory unreadable")); ++ return (-1); + } + } + +@@ -734,20 +734,20 @@ rtiff_set_page( Rtiff *rtiff, int page ) + /* These can get unset when we change directories. Make sure + * they are set again. + */ +- rtiff_set_decode_format( rtiff ); ++ rtiff_set_decode_format(rtiff); + } + +- return( 0 ); ++ return (0); + } + + static int +-rtiff_n_pages( Rtiff *rtiff ) ++rtiff_n_pages(Rtiff *rtiff) + { + int n; + +- (void) TIFFSetDirectory( rtiff->tiff, 0 ); ++ (void) TIFFSetDirectory(rtiff->tiff, 0); + +- for( n = 1; TIFFReadDirectory( rtiff->tiff ); n++ ) ++ for (n = 1; TIFFReadDirectory(rtiff->tiff); n++) + ; + + /* Make sure the nest set_page() will set the directory. +@@ -755,161 +755,161 @@ rtiff_n_pages( Rtiff *rtiff ) + rtiff->current_page = -1; + + #ifdef DEBUG +- printf( "rtiff_n_pages: found %d pages\n", n ); ++ printf("rtiff_n_pages: found %d pages\n", n); + #endif /*DEBUG*/ + +- return( n ); ++ return (n); + } + + static int +-rtiff_check_samples( Rtiff *rtiff, int samples_per_pixel ) ++rtiff_check_samples(Rtiff *rtiff, int samples_per_pixel) + { +- if( rtiff->header.samples_per_pixel != samples_per_pixel ) { +- vips_error( "tiff2vips", +- _( "not %d bands" ), samples_per_pixel ); +- return( -1 ); ++ if (rtiff->header.samples_per_pixel != samples_per_pixel) { ++ vips_error("tiff2vips", ++ _("not %d bands"), samples_per_pixel); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Check n and n+1 so we can have an alpha. + */ + static int +-rtiff_check_min_samples( Rtiff *rtiff, int samples_per_pixel ) ++rtiff_check_min_samples(Rtiff *rtiff, int samples_per_pixel) + { +- if( rtiff->header.samples_per_pixel < samples_per_pixel ) { +- vips_error( "tiff2vips", +- _( "not at least %d samples per pixel" ), +- samples_per_pixel ); +- return( -1 ); ++ if (rtiff->header.samples_per_pixel < samples_per_pixel) { ++ vips_error("tiff2vips", ++ _("not at least %d samples per pixel"), ++ samples_per_pixel); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + +-/* Only allow samples which are whole bytes in size. ++/* Only allow samples which are whole bytes in size. + */ + static int +-rtiff_non_fractional( Rtiff *rtiff ) ++rtiff_non_fractional(Rtiff *rtiff) + { +- if( rtiff->header.bits_per_sample % 8 != 0 || +- rtiff->header.bits_per_sample == 0 ) { +- vips_error( "tiff2vips", "%s", _( "samples_per_pixel " +- "not a whole number of bytes" ) ); +- return( -1 ); ++ if (rtiff->header.bits_per_sample % 8 != 0 || ++ rtiff->header.bits_per_sample == 0) { ++ vips_error("tiff2vips", "%s", _("samples_per_pixel " ++ "not a whole number of bytes")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-rtiff_check_interpretation( Rtiff *rtiff, int photometric_interpretation ) +-{ +- if( rtiff->header.photometric_interpretation != +- photometric_interpretation ) { +- vips_error( "tiff2vips", +- _( "not photometric interpretation %d" ), +- photometric_interpretation ); +- return( -1 ); ++rtiff_check_interpretation(Rtiff *rtiff, int photometric_interpretation) ++{ ++ if (rtiff->header.photometric_interpretation != ++ photometric_interpretation) { ++ vips_error("tiff2vips", ++ _("not photometric interpretation %d"), ++ photometric_interpretation); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-rtiff_check_bits( Rtiff *rtiff, int bits_per_sample ) ++rtiff_check_bits(Rtiff *rtiff, int bits_per_sample) + { +- if( rtiff->header.bits_per_sample != bits_per_sample ) { +- vips_error( "tiff2vips", +- _( "not %d bits per sample" ), bits_per_sample ); +- return( -1 ); ++ if (rtiff->header.bits_per_sample != bits_per_sample) { ++ vips_error("tiff2vips", ++ _("not %d bits per sample"), bits_per_sample); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-rtiff_check_bits_palette( Rtiff *rtiff ) +-{ +- if( rtiff->header.bits_per_sample != 16 && +- rtiff->header.bits_per_sample != 8 && +- rtiff->header.bits_per_sample != 4 && +- rtiff->header.bits_per_sample != 2 && +- rtiff->header.bits_per_sample != 1 ) { +- vips_error( "tiff2vips", +- _( "%d bits per sample palette image not supported" ), +- rtiff->header.bits_per_sample ); +- return( -1 ); ++rtiff_check_bits_palette(Rtiff *rtiff) ++{ ++ if (rtiff->header.bits_per_sample != 16 && ++ rtiff->header.bits_per_sample != 8 && ++ rtiff->header.bits_per_sample != 4 && ++ rtiff->header.bits_per_sample != 2 && ++ rtiff->header.bits_per_sample != 1) { ++ vips_error("tiff2vips", ++ _("%d bits per sample palette image not supported"), ++ rtiff->header.bits_per_sample); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static VipsBandFormat +-rtiff_guess_format( Rtiff *rtiff ) ++rtiff_guess_format(Rtiff *rtiff) + { + int bits_per_sample = rtiff->header.bits_per_sample; + int sample_format = rtiff->header.sample_format; + +- switch( bits_per_sample ) { ++ switch (bits_per_sample) { + case 1: + case 2: + case 4: + case 8: +- if( sample_format == SAMPLEFORMAT_INT ) +- return( VIPS_FORMAT_CHAR ); +- if( sample_format == SAMPLEFORMAT_UINT ) +- return( VIPS_FORMAT_UCHAR ); ++ if (sample_format == SAMPLEFORMAT_INT) ++ return (VIPS_FORMAT_CHAR); ++ if (sample_format == SAMPLEFORMAT_UINT) ++ return (VIPS_FORMAT_UCHAR); + break; + + case 16: +- if( sample_format == SAMPLEFORMAT_INT ) +- return( VIPS_FORMAT_SHORT ); +- if( sample_format == SAMPLEFORMAT_UINT ) +- return( VIPS_FORMAT_USHORT ); ++ if (sample_format == SAMPLEFORMAT_INT) ++ return (VIPS_FORMAT_SHORT); ++ if (sample_format == SAMPLEFORMAT_UINT) ++ return (VIPS_FORMAT_USHORT); + break; + + case 32: +- if( sample_format == SAMPLEFORMAT_INT ) +- return( VIPS_FORMAT_INT ); +- if( sample_format == SAMPLEFORMAT_UINT ) +- return( VIPS_FORMAT_UINT ); +- if( sample_format == SAMPLEFORMAT_IEEEFP ) +- return( VIPS_FORMAT_FLOAT ); ++ if (sample_format == SAMPLEFORMAT_INT) ++ return (VIPS_FORMAT_INT); ++ if (sample_format == SAMPLEFORMAT_UINT) ++ return (VIPS_FORMAT_UINT); ++ if (sample_format == SAMPLEFORMAT_IEEEFP) ++ return (VIPS_FORMAT_FLOAT); + break; + + case 64: +- if( sample_format == SAMPLEFORMAT_IEEEFP ) +- return( VIPS_FORMAT_DOUBLE ); +- if( sample_format == SAMPLEFORMAT_COMPLEXIEEEFP ) +- return( VIPS_FORMAT_COMPLEX ); ++ if (sample_format == SAMPLEFORMAT_IEEEFP) ++ return (VIPS_FORMAT_DOUBLE); ++ if (sample_format == SAMPLEFORMAT_COMPLEXIEEEFP) ++ return (VIPS_FORMAT_COMPLEX); + break; + + case 128: +- if( sample_format == SAMPLEFORMAT_COMPLEXIEEEFP ) +- return( VIPS_FORMAT_DPCOMPLEX ); ++ if (sample_format == SAMPLEFORMAT_COMPLEXIEEEFP) ++ return (VIPS_FORMAT_DPCOMPLEX); + break; + + default: + break; + } + +- vips_error( "tiff2vips", "%s", _( "unsupported tiff image type\n" ) ); ++ vips_error("tiff2vips", "%s", _("unsupported tiff image type\n")); + +- return( VIPS_FORMAT_NOTSET ); ++ return (VIPS_FORMAT_NOTSET); + } + + /* Per-scanline process function for VIPS_CODING_LABQ. + */ + static void +-rtiff_labpack_line( Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, void *dummy ) ++rtiff_labpack_line(Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, void *dummy) + { + int samples_per_pixel = rtiff->header.samples_per_pixel; + + int x; + +- for( x = 0; x < n; x++ ) { ++ for (x = 0; x < n; x++) { + q[0] = p[0]; + q[1] = p[1]; + q[2] = p[2]; +@@ -923,30 +923,29 @@ rtiff_labpack_line( Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, void *dummy ) + /* Read an 8-bit LAB image. + */ + static int +-rtiff_parse_labpack( Rtiff *rtiff, VipsImage *out ) ++rtiff_parse_labpack(Rtiff *rtiff, VipsImage *out) + { +- if( rtiff_check_min_samples( rtiff, 3 ) || +- rtiff_check_bits( rtiff, 8 ) || +- rtiff_check_interpretation( rtiff, PHOTOMETRIC_CIELAB ) ) +- return( -1 ); ++ if (rtiff_check_min_samples(rtiff, 3) || ++ rtiff_check_bits(rtiff, 8) || ++ rtiff_check_interpretation(rtiff, PHOTOMETRIC_CIELAB)) ++ return (-1); + +- out->Bands = 4; +- out->BandFmt = VIPS_FORMAT_UCHAR; +- out->Coding = VIPS_CODING_LABQ; +- out->Type = VIPS_INTERPRETATION_LAB; ++ out->Bands = 4; ++ out->BandFmt = VIPS_FORMAT_UCHAR; ++ out->Coding = VIPS_CODING_LABQ; ++ out->Type = VIPS_INTERPRETATION_LAB; + + rtiff->sfn = rtiff_labpack_line; + +- return( 0 ); ++ return (0); + } + +- + /* Per-scanline process function for 8-bit VIPS_CODING_LAB to 16-bit LabS with + * alpha. + */ + static void +-rtiff_lab_with_alpha_line( Rtiff *rtiff, +- VipsPel *q, VipsPel *p, int n, void *dummy ) ++rtiff_lab_with_alpha_line(Rtiff *rtiff, ++ VipsPel *q, VipsPel *p, int n, void *dummy) + { + int samples_per_pixel = rtiff->header.samples_per_pixel; + +@@ -956,14 +955,14 @@ rtiff_lab_with_alpha_line( Rtiff *rtiff, + + p1 = (unsigned char *) p; + q1 = (short *) q; +- for( x = 0; x < n; x++ ) { ++ for (x = 0; x < n; x++) { + int i; + + q1[0] = ((unsigned int) p1[0]) * 32767 / 255; + q1[1] = ((short) p1[1]) << 8; + q1[2] = ((short) p1[2]) << 8; + +- for( i = 3; i < samples_per_pixel; i++ ) ++ for (i = 3; i < samples_per_pixel; i++) + q1[i] = (p1[i] << 8) + p1[i]; + + q1 += samples_per_pixel; +@@ -974,12 +973,12 @@ rtiff_lab_with_alpha_line( Rtiff *rtiff, + /* Read an 8-bit LAB image with alpha bands into 16-bit LabS. + */ + static int +-rtiff_parse_lab_with_alpha( Rtiff *rtiff, VipsImage *out ) ++rtiff_parse_lab_with_alpha(Rtiff *rtiff, VipsImage *out) + { +- if( rtiff_check_min_samples( rtiff, 4 ) || +- rtiff_check_bits( rtiff, 8 ) || +- rtiff_check_interpretation( rtiff, PHOTOMETRIC_CIELAB ) ) +- return( -1 ); ++ if (rtiff_check_min_samples(rtiff, 4) || ++ rtiff_check_bits(rtiff, 8) || ++ rtiff_check_interpretation(rtiff, PHOTOMETRIC_CIELAB)) ++ return (-1); + + out->Bands = rtiff->header.samples_per_pixel; + out->BandFmt = VIPS_FORMAT_SHORT; +@@ -988,29 +987,29 @@ rtiff_parse_lab_with_alpha( Rtiff *rtiff, VipsImage *out ) + + rtiff->sfn = rtiff_lab_with_alpha_line; + +- return( 0 ); ++ return (0); + } + + /* Per-scanline process function for LABS. + */ + static void +-rtiff_labs_line( Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, void *dummy ) ++rtiff_labs_line(Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, void *dummy) + { + int samples_per_pixel = rtiff->header.samples_per_pixel; + + unsigned short *p1; + short *q1; + int x; +- int i; ++ int i; + + p1 = (unsigned short *) p; + q1 = (short *) q; +- for( x = 0; x < n; x++ ) { ++ for (x = 0; x < n; x++) { + /* We use signed int16 for L. + */ + q1[0] = p1[0] >> 1; + +- for( i = 1; i < samples_per_pixel; i++ ) ++ for (i = 1; i < samples_per_pixel; i++) + q1[i] = p1[i]; + + q1 += samples_per_pixel; +@@ -1021,43 +1020,43 @@ rtiff_labs_line( Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, void *dummy ) + /* Read a 16-bit LAB image. + */ + static int +-rtiff_parse_labs( Rtiff *rtiff, VipsImage *out ) ++rtiff_parse_labs(Rtiff *rtiff, VipsImage *out) + { +- if( rtiff_check_min_samples( rtiff, 3 ) || +- rtiff_check_bits( rtiff, 16 ) || +- rtiff_check_interpretation( rtiff, PHOTOMETRIC_CIELAB ) ) +- return( -1 ); ++ if (rtiff_check_min_samples(rtiff, 3) || ++ rtiff_check_bits(rtiff, 16) || ++ rtiff_check_interpretation(rtiff, PHOTOMETRIC_CIELAB)) ++ return (-1); + +- out->Bands = rtiff->header.samples_per_pixel; +- out->BandFmt = VIPS_FORMAT_SHORT; +- out->Coding = VIPS_CODING_NONE; +- out->Type = VIPS_INTERPRETATION_LABS; ++ out->Bands = rtiff->header.samples_per_pixel; ++ out->BandFmt = VIPS_FORMAT_SHORT; ++ out->Coding = VIPS_CODING_NONE; ++ out->Type = VIPS_INTERPRETATION_LABS; + + rtiff->sfn = rtiff_labs_line; + +- return( 0 ); ++ return (0); + } + + /* libtiff delivers logluv as illuminant-free 0-1 XYZ in 3 x float. + */ + static void +-rtiff_logluv_line( Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, void *dummy ) ++rtiff_logluv_line(Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, void *dummy) + { + int samples_per_pixel = rtiff->header.samples_per_pixel; + + float *p1; + float *q1; + int x; +- int i; ++ int i; + + p1 = (float *) p; + q1 = (float *) q; +- for( x = 0; x < n; x++ ) { ++ for (x = 0; x < n; x++) { + q1[0] = VIPS_D65_X0 * p1[0]; + q1[1] = VIPS_D65_Y0 * p1[1]; + q1[2] = VIPS_D65_Z0 * p1[2]; + +- for( i = 3; i < samples_per_pixel; i++ ) ++ for (i = 3; i < samples_per_pixel; i++) + q1[i] = p1[i]; + + q1 += samples_per_pixel; +@@ -1068,207 +1067,217 @@ rtiff_logluv_line( Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, void *dummy ) + /* LOGLUV images arrive from libtiff as float xyz. + */ + static int +-rtiff_parse_logluv( Rtiff *rtiff, VipsImage *out ) ++rtiff_parse_logluv(Rtiff *rtiff, VipsImage *out) + { +- if( rtiff_check_min_samples( rtiff, 3 ) || +- rtiff_check_interpretation( rtiff, PHOTOMETRIC_LOGLUV ) ) +- return( -1 ); ++ if (rtiff_check_min_samples(rtiff, 3) || ++ rtiff_check_interpretation(rtiff, PHOTOMETRIC_LOGLUV)) ++ return (-1); + +- out->Bands = rtiff->header.samples_per_pixel; +- out->BandFmt = VIPS_FORMAT_FLOAT; +- out->Coding = VIPS_CODING_NONE; +- out->Type = VIPS_INTERPRETATION_XYZ; ++ out->Bands = rtiff->header.samples_per_pixel; ++ out->BandFmt = VIPS_FORMAT_FLOAT; ++ out->Coding = VIPS_CODING_NONE; ++ out->Type = VIPS_INTERPRETATION_XYZ; + + rtiff->sfn = rtiff_logluv_line; + +- return( 0 ); ++ return (0); + } + + /* Make a N-bit scanline process function. We pass in the code to expand the + * bits down the byte since this does not generalize well. + */ +-#define NBIT_LINE( N, EXPAND ) \ +-static void \ +-rtiff_ ## N ## bit_line( Rtiff *rtiff, \ +- VipsPel *q, VipsPel *p, int n, void *flg ) \ +-{ \ +- int photometric = rtiff->header.photometric_interpretation; \ +- int mask = photometric == PHOTOMETRIC_MINISBLACK ? 0 : 0xff; \ +- int bps = rtiff->header.bits_per_sample; \ +- int load = 8 / bps - 1; \ +- \ +- int x; \ +- VipsPel bits; \ +- \ +- /* Stop a compiler warning. \ +- */ \ +- bits = 0; \ +- \ +- for( x = 0; x < n; x++ ) { \ +- if( (x & load) == 0 ) \ +- /* Flip the bits for miniswhite. \ +- */ \ +- bits = *p++ ^ mask; \ +- \ +- EXPAND( q[x], bits ); \ +- \ +- bits <<= bps; \ +- } \ +-} ++#define NBIT_LINE(N, EXPAND) \ ++ static void \ ++ rtiff_##N##bit_line(Rtiff *rtiff, \ ++ VipsPel *q, VipsPel *p, int n, void *flg) \ ++ { \ ++ int photometric = rtiff->header.photometric_interpretation; \ ++ int mask = photometric == PHOTOMETRIC_MINISBLACK ? 0 : 0xff; \ ++ int bps = rtiff->header.bits_per_sample; \ ++ int load = 8 / bps - 1; \ ++\ ++ int x; \ ++ VipsPel bits; \ ++\ ++ /* Stop a compiler warning. \ ++ */ \ ++ bits = 0; \ ++\ ++ for (x = 0; x < n; x++) { \ ++ if ((x & load) == 0) \ ++ /* Flip the bits for miniswhite. \ ++ */ \ ++ bits = *p++ ^ mask; \ ++\ ++ EXPAND(q[x], bits); \ ++\ ++ bits <<= bps; \ ++ } \ ++ } + + /* Expand the top bit down a byte. Use a sign-extending shift. + */ +-#define EXPAND1( Q, BITS ) G_STMT_START { \ +- (Q) = (((signed char) (BITS & 128)) >> 7); \ +-} G_STMT_END ++#define EXPAND1(Q, BITS) \ ++ G_STMT_START \ ++ { \ ++ (Q) = (((signed char) (BITS & 128)) >> 7); \ ++ } \ ++ G_STMT_END + + /* Expand the top two bits down a byte. Shift down, then expand up. + */ +-#define EXPAND2( Q, BITS ) G_STMT_START { \ +- VipsPel twobits = BITS >> 6; \ +- VipsPel fourbits = twobits | (twobits << 2); \ +- Q = fourbits | (fourbits << 4); \ +-} G_STMT_END ++#define EXPAND2(Q, BITS) \ ++ G_STMT_START \ ++ { \ ++ VipsPel twobits = BITS >> 6; \ ++ VipsPel fourbits = twobits | (twobits << 2); \ ++ Q = fourbits | (fourbits << 4); \ ++ } \ ++ G_STMT_END + +-/* Expand the top four bits down a byte. ++/* Expand the top four bits down a byte. + */ +-#define EXPAND4( Q, BITS ) G_STMT_START { \ +- Q = (BITS & 0xf0) | (BITS >> 4); \ +-} G_STMT_END ++#define EXPAND4(Q, BITS) \ ++ G_STMT_START \ ++ { \ ++ Q = (BITS & 0xf0) | (BITS >> 4); \ ++ } \ ++ G_STMT_END + +-NBIT_LINE( 1, EXPAND1 ) +-NBIT_LINE( 2, EXPAND2 ) +-NBIT_LINE( 4, EXPAND4 ) ++NBIT_LINE(1, EXPAND1) ++NBIT_LINE(2, EXPAND2) ++NBIT_LINE(4, EXPAND4) + +-/* Read a 1-bit TIFF image. ++/* Read a 1-bit TIFF image. + */ + static int +-rtiff_parse_onebit( Rtiff *rtiff, VipsImage *out ) ++rtiff_parse_onebit(Rtiff *rtiff, VipsImage *out) + { +- if( rtiff_check_samples( rtiff, 1 ) || +- rtiff_check_bits( rtiff, 1 ) ) +- return( -1 ); ++ if (rtiff_check_samples(rtiff, 1) || ++ rtiff_check_bits(rtiff, 1)) ++ return (-1); + +- out->Bands = 1; +- out->BandFmt = VIPS_FORMAT_UCHAR; +- out->Coding = VIPS_CODING_NONE; +- out->Type = VIPS_INTERPRETATION_B_W; ++ out->Bands = 1; ++ out->BandFmt = VIPS_FORMAT_UCHAR; ++ out->Coding = VIPS_CODING_NONE; ++ out->Type = VIPS_INTERPRETATION_B_W; + + rtiff->sfn = rtiff_1bit_line; + +- return( 0 ); ++ return (0); + } + +-/* Read a 2-bit TIFF image. ++/* Read a 2-bit TIFF image. + */ + static int +-rtiff_parse_twobit( Rtiff *rtiff, VipsImage *out ) ++rtiff_parse_twobit(Rtiff *rtiff, VipsImage *out) + { +- if( rtiff_check_samples( rtiff, 1 ) || +- rtiff_check_bits( rtiff, 2 ) ) +- return( -1 ); ++ if (rtiff_check_samples(rtiff, 1) || ++ rtiff_check_bits(rtiff, 2)) ++ return (-1); + +- out->Bands = 1; +- out->BandFmt = VIPS_FORMAT_UCHAR; +- out->Coding = VIPS_CODING_NONE; +- out->Type = VIPS_INTERPRETATION_B_W; ++ out->Bands = 1; ++ out->BandFmt = VIPS_FORMAT_UCHAR; ++ out->Coding = VIPS_CODING_NONE; ++ out->Type = VIPS_INTERPRETATION_B_W; + + rtiff->sfn = rtiff_2bit_line; + +- return( 0 ); ++ return (0); + } + +-/* Read a 4-bit TIFF image. ++/* Read a 4-bit TIFF image. + */ + static int +-rtiff_parse_fourbit( Rtiff *rtiff, VipsImage *out ) ++rtiff_parse_fourbit(Rtiff *rtiff, VipsImage *out) + { +- if( rtiff_check_samples( rtiff, 1 ) || +- rtiff_check_bits( rtiff, 4 ) ) +- return( -1 ); ++ if (rtiff_check_samples(rtiff, 1) || ++ rtiff_check_bits(rtiff, 4)) ++ return (-1); + +- out->Bands = 1; +- out->BandFmt = VIPS_FORMAT_UCHAR; +- out->Coding = VIPS_CODING_NONE; +- out->Type = VIPS_INTERPRETATION_B_W; ++ out->Bands = 1; ++ out->BandFmt = VIPS_FORMAT_UCHAR; ++ out->Coding = VIPS_CODING_NONE; ++ out->Type = VIPS_INTERPRETATION_B_W; + + rtiff->sfn = rtiff_4bit_line; + +- return( 0 ); ++ return (0); + } + +-/* Swap the sense of the first channel, if necessary. ++/* Swap the sense of the first channel, if necessary. + */ +-#define GREY_LOOP( TYPE, MAX ) { \ +- TYPE *p1; \ +- TYPE *q1; \ +- \ +- p1 = (TYPE *) p; \ +- q1 = (TYPE *) q; \ +- for( x = 0; x < n; x++ ) { \ +- if( invert ) \ +- q1[0] = MAX - p1[0]; \ +- else \ +- q1[0] = p1[0]; \ +- \ +- for( i = 1; i < samples_per_pixel; i++ ) \ +- q1[i] = p1[i]; \ +- \ +- q1 += samples_per_pixel; \ +- p1 += samples_per_pixel; \ +- } \ +-} ++#define GREY_LOOP(TYPE, MAX) \ ++ { \ ++ TYPE *p1; \ ++ TYPE *q1; \ ++\ ++ p1 = (TYPE *) p; \ ++ q1 = (TYPE *) q; \ ++ for (x = 0; x < n; x++) { \ ++ if (invert) \ ++ q1[0] = MAX - p1[0]; \ ++ else \ ++ q1[0] = p1[0]; \ ++\ ++ for (i = 1; i < samples_per_pixel; i++) \ ++ q1[i] = p1[i]; \ ++\ ++ q1 += samples_per_pixel; \ ++ p1 += samples_per_pixel; \ ++ } \ ++ } + + /* Per-scanline process function for greyscale images. + */ + static void +-rtiff_greyscale_line( Rtiff *rtiff, +- VipsPel *q, VipsPel *p, int n, void *client ) ++rtiff_greyscale_line(Rtiff *rtiff, ++ VipsPel *q, VipsPel *p, int n, void *client) + { + int samples_per_pixel = rtiff->header.samples_per_pixel; +- int photometric_interpretation = ++ int photometric_interpretation = + rtiff->header.photometric_interpretation; +- VipsBandFormat format = rtiff_guess_format( rtiff ); ++ VipsBandFormat format = rtiff_guess_format(rtiff); + + /* Swapping black and white doesn't make sense for the signed formats. + */ +- gboolean invert = ++ gboolean invert = + photometric_interpretation == PHOTOMETRIC_MINISWHITE && +- vips_band_format_isuint( format ); ++ vips_band_format_isuint(format); + + int x, i; + +- switch( format ) { ++ switch (format) { + case VIPS_FORMAT_CHAR: +- GREY_LOOP( gchar, 0 ); ++ GREY_LOOP(gchar, 0); + break; + + case VIPS_FORMAT_UCHAR: +- GREY_LOOP( guchar, UCHAR_MAX ); ++ GREY_LOOP(guchar, UCHAR_MAX); + break; + + case VIPS_FORMAT_SHORT: +- GREY_LOOP( gshort, 0 ); ++ GREY_LOOP(gshort, 0); + break; + + case VIPS_FORMAT_USHORT: +- GREY_LOOP( gushort, USHRT_MAX ); ++ GREY_LOOP(gushort, USHRT_MAX); + break; + + case VIPS_FORMAT_INT: +- GREY_LOOP( gint, 0 ); ++ GREY_LOOP(gint, 0); + break; + + case VIPS_FORMAT_UINT: +- GREY_LOOP( guint, UINT_MAX ); ++ GREY_LOOP(guint, UINT_MAX); + break; + + case VIPS_FORMAT_FLOAT: +- GREY_LOOP( float, 1.0 ); ++ GREY_LOOP(float, 1.0); + break; + + case VIPS_FORMAT_DOUBLE: +- GREY_LOOP( double, 1.0 ); ++ GREY_LOOP(double, 1.0); + break; + + default: +@@ -1277,34 +1286,34 @@ rtiff_greyscale_line( Rtiff *rtiff, + } + + /* Read a grey-scale TIFF image. We have to invert the first band if +- * PHOTOMETRIC_MINISBLACK is set. ++ * PHOTOMETRIC_MINISBLACK is set. + */ + static int +-rtiff_parse_greyscale( Rtiff *rtiff, VipsImage *out ) ++rtiff_parse_greyscale(Rtiff *rtiff, VipsImage *out) + { +- if( rtiff_check_min_samples( rtiff, 1 ) || +- rtiff_non_fractional( rtiff ) ) +- return( -1 ); ++ if (rtiff_check_min_samples(rtiff, 1) || ++ rtiff_non_fractional(rtiff)) ++ return (-1); + +- out->Bands = rtiff->header.samples_per_pixel; +- out->BandFmt = rtiff_guess_format( rtiff ); +- if( out->BandFmt == VIPS_FORMAT_NOTSET ) +- return( -1 ); +- out->Coding = VIPS_CODING_NONE; ++ out->Bands = rtiff->header.samples_per_pixel; ++ out->BandFmt = rtiff_guess_format(rtiff); ++ if (out->BandFmt == VIPS_FORMAT_NOTSET) ++ return (-1); ++ out->Coding = VIPS_CODING_NONE; + +- if( rtiff->header.bits_per_sample == 16 ) +- out->Type = VIPS_INTERPRETATION_GREY16; ++ if (rtiff->header.bits_per_sample == 16) ++ out->Type = VIPS_INTERPRETATION_GREY16; + else +- out->Type = VIPS_INTERPRETATION_B_W; ++ out->Type = VIPS_INTERPRETATION_B_W; + + /* rtiff_greyscale_line() doesn't do complex. + */ +- if( vips_check_noncomplex( "tiff2vips", out ) ) +- return( -1 ); ++ if (vips_check_noncomplex("tiff2vips", out)) ++ return (-1); + + rtiff->sfn = rtiff_greyscale_line; + +- return( 0 ); ++ return (0); + } + + typedef struct { +@@ -1326,8 +1335,8 @@ typedef struct { + /* 1/2/4 bit samples with an 8-bit palette. + */ + static void +-rtiff_palette_line_bit( Rtiff *rtiff, +- VipsPel *q, VipsPel *p, int n, void *client ) ++rtiff_palette_line_bit(Rtiff *rtiff, ++ VipsPel *q, VipsPel *p, int n, void *client) + { + PaletteRead *read = (PaletteRead *) client; + int samples_per_pixel = rtiff->header.samples_per_pixel; +@@ -1339,10 +1348,10 @@ rtiff_palette_line_bit( Rtiff *rtiff, + + bit = 0; + data = 0; +- for( x = 0; x < n * samples_per_pixel; x++ ) { ++ for (x = 0; x < n * samples_per_pixel; x++) { + int i; + +- if( bit <= 0 ) { ++ if (bit <= 0) { + data = *p++; + bit = 8; + } +@@ -1354,8 +1363,8 @@ rtiff_palette_line_bit( Rtiff *rtiff, + /* The first band goes through the LUT, subsequent bands are + * left-justified and copied. + */ +- if( x % samples_per_pixel == 0 ) { +- if( read->mono ) ++ if (x % samples_per_pixel == 0) { ++ if (read->mono) + *q++ = read->red8[i]; + else { + q[0] = read->red8[i]; +@@ -1364,16 +1373,16 @@ rtiff_palette_line_bit( Rtiff *rtiff, + q += 3; + } + } +- else +- *q++ = VIPS_LSHIFT_INT( i, 8 - bits_per_sample ); ++ else ++ *q++ = VIPS_LSHIFT_INT(i, 8 - bits_per_sample); + } + } + + /* 8-bit samples with an 8-bit palette. + */ + static void +-rtiff_palette_line8( Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, +- void *client ) ++rtiff_palette_line8(Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, ++ void *client) + { + PaletteRead *read = (PaletteRead *) client; + int samples_per_pixel = rtiff->header.samples_per_pixel; +@@ -1381,10 +1390,10 @@ rtiff_palette_line8( Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, + int x; + int s; + +- for( x = 0; x < n; x++ ) { ++ for (x = 0; x < n; x++) { + int i = p[0]; + +- if( read->mono ) ++ if (read->mono) + q[0] = read->red8[i]; + else { + q[0] = read->red8[i]; +@@ -1393,19 +1402,19 @@ rtiff_palette_line8( Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, + q += 2; + } + +- for( s = 1; s < samples_per_pixel; s++ ) +- q[s] = p[s]; ++ for (s = 1; s < samples_per_pixel; s++) ++ q[s] = p[s]; + +- q += samples_per_pixel; +- p += samples_per_pixel; ++ q += samples_per_pixel; ++ p += samples_per_pixel; + } + } + +-/* 16-bit samples with 16-bit data in the palette. ++/* 16-bit samples with 16-bit data in the palette. + */ + static void +-rtiff_palette_line16( Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, +- void *client ) ++rtiff_palette_line16(Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, ++ void *client) + { + PaletteRead *read = (PaletteRead *) client; + int samples_per_pixel = rtiff->header.samples_per_pixel; +@@ -1417,10 +1426,10 @@ rtiff_palette_line16( Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, + q16 = (guint16 *) q; + p16 = (guint16 *) p; + +- for( x = 0; x < n; x++ ) { ++ for (x = 0; x < n; x++) { + int i = p16[0]; + +- if( read->mono ) ++ if (read->mono) + q16[0] = read->red16[i]; + else { + q16[0] = read->red16[i]; +@@ -1429,18 +1438,18 @@ rtiff_palette_line16( Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, + q16 += 2; + } + +- for( s = 1; s < samples_per_pixel; s++ ) +- q16[s] = p16[s]; ++ for (s = 1; s < samples_per_pixel; s++) ++ q16[s] = p16[s]; + +- q16 += samples_per_pixel; +- p16 += samples_per_pixel; ++ q16 += samples_per_pixel; ++ p16 += samples_per_pixel; + } + } + +-/* Read a palette-ised TIFF image. ++/* Read a palette-ised TIFF image. + */ + static int +-rtiff_parse_palette( Rtiff *rtiff, VipsImage *out ) ++rtiff_parse_palette(Rtiff *rtiff, VipsImage *out) + { + int samples_per_pixel = rtiff->header.samples_per_pixel; + int bits_per_sample = rtiff->header.bits_per_sample; +@@ -1449,24 +1458,24 @@ rtiff_parse_palette( Rtiff *rtiff, VipsImage *out ) + PaletteRead *read; + int i; + +- if( rtiff_check_bits_palette( rtiff ) || +- rtiff_check_min_samples( rtiff, 1 ) ) +- return( -1 ); ++ if (rtiff_check_bits_palette(rtiff) || ++ rtiff_check_min_samples(rtiff, 1)) ++ return (-1); + len = 1 << bits_per_sample; + +- if( !(read = VIPS_NEW( out, PaletteRead )) || +- !(read->red8 = VIPS_ARRAY( out, len, VipsPel )) || +- !(read->green8 = VIPS_ARRAY( out, len, VipsPel )) || +- !(read->blue8 = VIPS_ARRAY( out, len, VipsPel )) ) +- return( -1 ); ++ if (!(read = VIPS_NEW(out, PaletteRead)) || ++ !(read->red8 = VIPS_ARRAY(out, len, VipsPel)) || ++ !(read->green8 = VIPS_ARRAY(out, len, VipsPel)) || ++ !(read->blue8 = VIPS_ARRAY(out, len, VipsPel))) ++ return (-1); + + /* Get maps, convert to 8-bit data. + */ +- if( !TIFFGetField( rtiff->tiff, +- TIFFTAG_COLORMAP, +- &read->red16, &read->green16, &read->blue16 ) ) { +- vips_error( "tiff2vips", "%s", _( "bad colormap" ) ); +- return( -1 ); ++ if (!TIFFGetField(rtiff->tiff, ++ TIFFTAG_COLORMAP, ++ &read->red16, &read->green16, &read->blue16)) { ++ vips_error("tiff2vips", "%s", _("bad colormap")); ++ return (-1); + } + + /* Old-style colourmaps were 8-bit. If all the top bytes are zero, +@@ -1474,21 +1483,21 @@ rtiff_parse_palette( Rtiff *rtiff, VipsImage *out ) + * + * See: https://github.com/libvips/libvips/issues/220 + */ +- for( i = 0; i < len; i++ ) +- if( (read->red16[i] >> 8) | +- (read->green16[i] >> 8) | +- (read->blue16[i] >> 8) ) ++ for (i = 0; i < len; i++) ++ if ((read->red16[i] >> 8) | ++ (read->green16[i] >> 8) | ++ (read->blue16[i] >> 8)) + break; +- if( i < len ) +- for( i = 0; i < len; i++ ) { ++ if (i < len) ++ for (i = 0; i < len; i++) { + read->red8[i] = read->red16[i] >> 8; + read->green8[i] = read->green16[i] >> 8; + read->blue8[i] = read->blue16[i] >> 8; + } + else { +- g_warning( "%s", _( "assuming 8-bit palette" ) ); ++ g_warning("%s", _("assuming 8-bit palette")); + +- for( i = 0; i < len; i++ ) { ++ for (i = 0; i < len; i++) { + read->red8[i] = read->red16[i] & 0xff; + read->green8[i] = read->green16[i] & 0xff; + read->blue8[i] = read->blue16[i] & 0xff; +@@ -1498,9 +1507,9 @@ rtiff_parse_palette( Rtiff *rtiff, VipsImage *out ) + /* Are all the maps equal? We have a mono image. + */ + read->mono = TRUE; +- for( i = 0; i < len; i++ ) +- if( read->red16[i] != read->green16[i] || +- read->green16[i] != read->blue16[i] ) { ++ for (i = 0; i < len; i++) ++ if (read->red16[i] != read->green16[i] || ++ read->green16[i] != read->blue16[i]) { + read->mono = FALSE; + break; + } +@@ -1510,91 +1519,91 @@ rtiff_parse_palette( Rtiff *rtiff, VipsImage *out ) + * just search the colormap. + */ + +- if( bits_per_sample <= 8 ) +- out->BandFmt = VIPS_FORMAT_UCHAR; ++ if (bits_per_sample <= 8) ++ out->BandFmt = VIPS_FORMAT_UCHAR; + else +- out->BandFmt = VIPS_FORMAT_USHORT; +- out->Coding = VIPS_CODING_NONE; ++ out->BandFmt = VIPS_FORMAT_USHORT; ++ out->Coding = VIPS_CODING_NONE; + +- if( read->mono ) { +- out->Bands = samples_per_pixel; +- if( bits_per_sample <= 8 ) +- out->Type = VIPS_INTERPRETATION_B_W; ++ if (read->mono) { ++ out->Bands = samples_per_pixel; ++ if (bits_per_sample <= 8) ++ out->Type = VIPS_INTERPRETATION_B_W; + else +- out->Type = VIPS_INTERPRETATION_GREY16; ++ out->Type = VIPS_INTERPRETATION_GREY16; + } + else { +- out->Bands = samples_per_pixel + 2; +- if( bits_per_sample <= 8 ) +- out->Type = VIPS_INTERPRETATION_sRGB; ++ out->Bands = samples_per_pixel + 2; ++ if (bits_per_sample <= 8) ++ out->Type = VIPS_INTERPRETATION_sRGB; + else +- out->Type = VIPS_INTERPRETATION_RGB16; ++ out->Type = VIPS_INTERPRETATION_RGB16; + } + + rtiff->client = read; +- if( bits_per_sample < 8 ) ++ if (bits_per_sample < 8) + rtiff->sfn = rtiff_palette_line_bit; +- else if( bits_per_sample == 8 ) ++ else if (bits_per_sample == 8) + rtiff->sfn = rtiff_palette_line8; +- else if( bits_per_sample == 16 ) ++ else if (bits_per_sample == 16) + rtiff->sfn = rtiff_palette_line16; + else +- g_assert_not_reached(); ++ g_assert_not_reached(); + +- return( 0 ); ++ return (0); + } + + /* Per-scanline process function when we just need to copy. + */ + static void +-rtiff_memcpy_line( Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, void *client ) ++rtiff_memcpy_line(Rtiff *rtiff, VipsPel *q, VipsPel *p, int n, void *client) + { + VipsImage *im = (VipsImage *) client; +- size_t len = n * VIPS_IMAGE_SIZEOF_PEL( im ); ++ size_t len = n * VIPS_IMAGE_SIZEOF_PEL(im); + +- memcpy( q, p, len ); ++ memcpy(q, p, len); + } + + /* Read a regular multiband image where we can just copy pixels from the tiff + * buffer. + */ + static int +-rtiff_parse_copy( Rtiff *rtiff, VipsImage *out ) ++rtiff_parse_copy(Rtiff *rtiff, VipsImage *out) + { + int samples_per_pixel = rtiff->header.samples_per_pixel; +- int photometric_interpretation = ++ int photometric_interpretation = + rtiff->header.photometric_interpretation; + int inkset = rtiff->header.inkset; + +- if( rtiff_non_fractional( rtiff ) ) +- return( -1 ); ++ if (rtiff_non_fractional(rtiff)) ++ return (-1); + +- out->Bands = samples_per_pixel; +- out->BandFmt = rtiff_guess_format( rtiff ); +- if( out->BandFmt == VIPS_FORMAT_NOTSET ) +- return( -1 ); +- out->Coding = VIPS_CODING_NONE; ++ out->Bands = samples_per_pixel; ++ out->BandFmt = rtiff_guess_format(rtiff); ++ if (out->BandFmt == VIPS_FORMAT_NOTSET) ++ return (-1); ++ out->Coding = VIPS_CODING_NONE; + +- if( samples_per_pixel >= 3 && ++ if (samples_per_pixel >= 3 && + (photometric_interpretation == PHOTOMETRIC_RGB || +- photometric_interpretation == PHOTOMETRIC_YCBCR) ) { +- if( out->BandFmt == VIPS_FORMAT_USHORT ) +- out->Type = VIPS_INTERPRETATION_RGB16; +- else if( !vips_band_format_isint( out->BandFmt ) ) ++ photometric_interpretation == PHOTOMETRIC_YCBCR)) { ++ if (out->BandFmt == VIPS_FORMAT_USHORT) ++ out->Type = VIPS_INTERPRETATION_RGB16; ++ else if (!vips_band_format_isint(out->BandFmt)) + /* Most float images use 0 - 1 for black - white. +- * Photoshop uses 0 - 1 and no gamma. ++ * Photoshop uses 0 - 1 and no gamma. + */ +- out->Type = VIPS_INTERPRETATION_scRGB; ++ out->Type = VIPS_INTERPRETATION_scRGB; + else +- out->Type = VIPS_INTERPRETATION_sRGB; ++ out->Type = VIPS_INTERPRETATION_sRGB; + } +- else if( samples_per_pixel >= 3 && +- photometric_interpretation == PHOTOMETRIC_CIELAB ) +- out->Type = VIPS_INTERPRETATION_LAB; +- else if( photometric_interpretation == PHOTOMETRIC_SEPARATED && ++ else if (samples_per_pixel >= 3 && ++ photometric_interpretation == PHOTOMETRIC_CIELAB) ++ out->Type = VIPS_INTERPRETATION_LAB; ++ else if (photometric_interpretation == PHOTOMETRIC_SEPARATED && + samples_per_pixel >= 4 && +- inkset == INKSET_CMYK ) +- out->Type = VIPS_INTERPRETATION_CMYK; ++ inkset == INKSET_CMYK) ++ out->Type = VIPS_INTERPRETATION_CMYK; + else + out->Type = VIPS_INTERPRETATION_MULTIBAND; + +@@ -1607,162 +1616,160 @@ rtiff_parse_copy( Rtiff *rtiff, VipsImage *out ) + */ + rtiff->memcpy = photometric_interpretation != PHOTOMETRIC_YCBCR; + +- return( 0 ); ++ return (0); + } + +-typedef int (*reader_fn)( Rtiff *rtiff, VipsImage *out ); ++typedef int (*reader_fn)(Rtiff *rtiff, VipsImage *out); + + /* We have a range of output paths. Look at the tiff header and try to + * route the input image to the best output path. + */ + static reader_fn +-rtiff_pick_reader( Rtiff *rtiff ) ++rtiff_pick_reader(Rtiff *rtiff) + { + int bits_per_sample = rtiff->header.bits_per_sample; +- int photometric_interpretation = ++ int photometric_interpretation = + rtiff->header.photometric_interpretation; + int samples_per_pixel = rtiff->header.samples_per_pixel; + +- if( photometric_interpretation == PHOTOMETRIC_CIELAB ) { +- if( bits_per_sample == 8 ) { +- if( samples_per_pixel > 3 ) +- return( rtiff_parse_lab_with_alpha ); ++ if (photometric_interpretation == PHOTOMETRIC_CIELAB) { ++ if (bits_per_sample == 8) { ++ if (samples_per_pixel > 3) ++ return (rtiff_parse_lab_with_alpha); + else +- return( rtiff_parse_labpack ); ++ return (rtiff_parse_labpack); + } +- if( bits_per_sample == 16 ) +- return( rtiff_parse_labs ); ++ if (bits_per_sample == 16) ++ return (rtiff_parse_labs); + } + +- if( photometric_interpretation == PHOTOMETRIC_LOGLUV ) +- return( rtiff_parse_logluv ); ++ if (photometric_interpretation == PHOTOMETRIC_LOGLUV) ++ return (rtiff_parse_logluv); + +- if( photometric_interpretation == PHOTOMETRIC_MINISWHITE || +- photometric_interpretation == PHOTOMETRIC_MINISBLACK ) { ++ if (photometric_interpretation == PHOTOMETRIC_MINISWHITE || ++ photometric_interpretation == PHOTOMETRIC_MINISBLACK) { + +- if( bits_per_sample == 1) +- return ( rtiff_parse_onebit ); +- else if ( bits_per_sample == 2 ) +- return ( rtiff_parse_twobit); +- else if ( bits_per_sample == 4 ) +- return ( rtiff_parse_fourbit); ++ if (bits_per_sample == 1) ++ return (rtiff_parse_onebit); ++ else if (bits_per_sample == 2) ++ return (rtiff_parse_twobit); ++ else if (bits_per_sample == 4) ++ return (rtiff_parse_fourbit); + else +- return( rtiff_parse_greyscale ); ++ return (rtiff_parse_greyscale); + } + +- if( photometric_interpretation == PHOTOMETRIC_PALETTE ) +- return( rtiff_parse_palette ); ++ if (photometric_interpretation == PHOTOMETRIC_PALETTE) ++ return (rtiff_parse_palette); + +- return( rtiff_parse_copy ); ++ return (rtiff_parse_copy); + } + + /* Set the header on @out from our rtiff. rtiff_header_read() has already been +- * called. ++ * called. + */ + static int +-rtiff_set_header( Rtiff *rtiff, VipsImage *out ) ++rtiff_set_header(Rtiff *rtiff, VipsImage *out) + { + guint32 data_len; + void *data; + +- rtiff_set_decode_format( rtiff ); ++ rtiff_set_decode_format(rtiff); + +- if( rtiff->header.photometric_interpretation == PHOTOMETRIC_LOGLUV ) +- vips_image_set_double( out, "stonits", rtiff->header.stonits ); ++ if (rtiff->header.photometric_interpretation == PHOTOMETRIC_LOGLUV) ++ vips_image_set_double(out, "stonits", rtiff->header.stonits); + + out->Xsize = rtiff->header.width; + out->Ysize = rtiff->header.height * rtiff->n; + +- VIPS_SETSTR( out->filename, +- vips_connection_filename( VIPS_CONNECTION( rtiff->source ) ) ); ++ VIPS_SETSTR(out->filename, ++ vips_connection_filename(VIPS_CONNECTION(rtiff->source))); + +- if( rtiff->n > 1 ) +- vips_image_set_int( out, +- VIPS_META_PAGE_HEIGHT, rtiff->header.height ); ++ if (rtiff->n > 1) ++ vips_image_set_int(out, ++ VIPS_META_PAGE_HEIGHT, rtiff->header.height); + +- if( rtiff->header.subifd_count > 0 ) +- vips_image_set_int( out, +- VIPS_META_N_SUBIFDS, rtiff->header.subifd_count ); ++ if (rtiff->header.subifd_count > 0) ++ vips_image_set_int(out, ++ VIPS_META_N_SUBIFDS, rtiff->header.subifd_count); + +- vips_image_set_int( out, VIPS_META_N_PAGES, rtiff->n_pages ); ++ vips_image_set_int(out, VIPS_META_N_PAGES, rtiff->n_pages); + + /* We have a range of output paths. Look at the tiff header and try to + * route the input image to the best output path. + */ +- if( rtiff_pick_reader( rtiff )( rtiff, out ) ) +- return( -1 ); ++ if (rtiff_pick_reader(rtiff)(rtiff, out)) ++ return (-1); + + /* Read any ICC profile. + */ +- if( TIFFGetField( rtiff->tiff, +- TIFFTAG_ICCPROFILE, &data_len, &data ) ) +- vips_image_set_blob_copy( out, +- VIPS_META_ICC_NAME, data, data_len ); ++ if (TIFFGetField(rtiff->tiff, ++ TIFFTAG_ICCPROFILE, &data_len, &data)) ++ vips_image_set_blob_copy(out, ++ VIPS_META_ICC_NAME, data, data_len); + + /* Read any XMP metadata. + */ +- if( TIFFGetField( rtiff->tiff, +- TIFFTAG_XMLPACKET, &data_len, &data ) ) +- vips_image_set_blob_copy( out, +- VIPS_META_XMP_NAME, data, data_len ); ++ if (TIFFGetField(rtiff->tiff, ++ TIFFTAG_XMLPACKET, &data_len, &data)) ++ vips_image_set_blob_copy(out, ++ VIPS_META_XMP_NAME, data, data_len); + + /* Read any IPTC metadata. + */ +- if( TIFFGetField( rtiff->tiff, +- TIFFTAG_RICHTIFFIPTC, &data_len, &data ) ) { +- vips_image_set_blob_copy( out, +- VIPS_META_IPTC_NAME, data, data_len ); ++ if (TIFFGetField(rtiff->tiff, ++ TIFFTAG_RICHTIFFIPTC, &data_len, &data)) { ++ vips_image_set_blob_copy(out, ++ VIPS_META_IPTC_NAME, data, data_len); + +- /* Older versions of libvips used this misspelt name :-( attach ++ /* Older versions of libvips used this misspelt name :-( attach + * under this name too for compatibility. + */ +- vips_image_set_blob_copy( out, "ipct-data", data, data_len ); ++ vips_image_set_blob_copy(out, "ipct-data", data, data_len); + } + + /* Read any photoshop metadata. + */ +- if( TIFFGetField( rtiff->tiff, +- TIFFTAG_PHOTOSHOP, &data_len, &data ) ) +- vips_image_set_blob_copy( out, +- VIPS_META_PHOTOSHOP_NAME, data, data_len ); ++ if (TIFFGetField(rtiff->tiff, ++ TIFFTAG_PHOTOSHOP, &data_len, &data)) ++ vips_image_set_blob_copy(out, ++ VIPS_META_PHOTOSHOP_NAME, data, data_len); + +- if( rtiff->header.image_description ) +- vips_image_set_string( out, VIPS_META_IMAGEDESCRIPTION, +- rtiff->header.image_description ); ++ if (rtiff->header.image_description) ++ vips_image_set_string(out, VIPS_META_IMAGEDESCRIPTION, ++ rtiff->header.image_description); + +- if( get_resolution( rtiff->tiff, out ) ) +- return( -1 ); ++ if (get_resolution(rtiff->tiff, out)) ++ return (-1); + + /* Set the "orientation" tag. This is picked up later by autorot, if + * requested. + */ +- vips_image_set_int( out, +- VIPS_META_ORIENTATION, rtiff->header.orientation ); ++ vips_image_set_int(out, ++ VIPS_META_ORIENTATION, rtiff->header.orientation); + +- /* Hint smalltile for tiled images, since we may be decompressing +- * outside the lock and THINSTRIP would prevent parallel tile decode. +- */ +- vips_image_pipelinev( out, +- rtiff->header.tiled ? +- VIPS_DEMAND_STYLE_SMALLTILE : +- VIPS_DEMAND_STYLE_THINSTRIP, +- NULL ); ++ /* Hint smalltile for tiled images, since we may be decompressing ++ * outside the lock and THINSTRIP would prevent parallel tile decode. ++ */ ++ vips_image_pipelinev(out, ++ rtiff->header.tiled ? VIPS_DEMAND_STYLE_SMALLTILE : VIPS_DEMAND_STYLE_THINSTRIP, ++ NULL); + +- return( 0 ); ++ return (0); + } + + /* Tilewise read sequence value. + */ + typedef struct _RtiffSeq { +- Rtiff *rtiff; ++ Rtiff *rtiff; + +- /* Decompressed tile here. +- */ ++ /* Decompressed tile here. ++ */ + tdata_t *buf; + + /* If we are decompressing, we need a buffer to read the raw tile to + * before running the decompressor. This needs to be per-thread, since +- * we decompress in parallel. ++ * we decompress in parallel. + */ + tdata_t compressed_buf; + tsize_t compressed_buf_length; +@@ -1772,16 +1779,16 @@ typedef struct _RtiffSeq { + * to vips in parallel. + */ + static void * +-rtiff_seq_start( VipsImage *out, void *a, void *b ) ++rtiff_seq_start(VipsImage *out, void *a, void *b) + { + Rtiff *rtiff = (Rtiff *) a; +- RtiffSeq *seq; ++ RtiffSeq *seq; + +- if( !(seq = VIPS_NEW( out, RtiffSeq )) ) +- return( NULL ); ++ if (!(seq = VIPS_NEW(out, RtiffSeq))) ++ return (NULL); + seq->rtiff = rtiff; +- if( !(seq->buf = vips_malloc( NULL, rtiff->header.tile_size )) ) +- return( NULL ); ++ if (!(seq->buf = vips_malloc(NULL, rtiff->header.tile_size))) ++ return (NULL); + + /* If we will be decompressing, we need a buffer large enough to hold + * the largest compressed tile in any page. +@@ -1790,43 +1797,43 @@ rtiff_seq_start( VipsImage *out, void *a, void *b ) + * than searching every page for the largest tile with + * TIFFTAG_TILEBYTECOUNTS. + */ +- if( rtiff->header.we_decompress ) { ++ if (rtiff->header.we_decompress) { + seq->compressed_buf_length = 2 * rtiff->header.tile_size; +- if( !(seq->compressed_buf = VIPS_MALLOC( NULL, +- seq->compressed_buf_length )) ) +- return( NULL ); ++ if (!(seq->compressed_buf = VIPS_MALLOC(NULL, ++ seq->compressed_buf_length))) ++ return (NULL); + } + +- return( (void *) seq ); ++ return ((void *) seq); + } + + #ifdef HAVE_JPEG +-static void +-rtiff_decompress_jpeg_init_source( j_decompress_ptr cinfo ) ++static void ++rtiff_decompress_jpeg_init_source(j_decompress_ptr cinfo) + { +- /* Nothing. +- */ ++ /* Nothing. ++ */ + } + +-static boolean +-rtiff_decompress_jpeg_fill_input_buffer( j_decompress_ptr cinfo ) ++static boolean ++rtiff_decompress_jpeg_fill_input_buffer(j_decompress_ptr cinfo) + { +- static const JOCTET mybuffer[4] = { +- (JOCTET) 0xFF, (JOCTET) JPEG_EOI, 0, 0 +- }; ++ static const JOCTET mybuffer[4] = { ++ (JOCTET) 0xFF, (JOCTET) JPEG_EOI, 0, 0 ++ }; + +- /* The whole JPEG data is expected to reside in the supplied memory +- * buffer, so any request for more data beyond the given buffer size +- * is treated as an error. +- */ +- WARNMS( cinfo, JWRN_JPEG_EOF ); ++ /* The whole JPEG data is expected to reside in the supplied memory ++ * buffer, so any request for more data beyond the given buffer size ++ * is treated as an error. ++ */ ++ WARNMS(cinfo, JWRN_JPEG_EOF); + +- /* Insert a fake EOI marker +- */ +- cinfo->src->next_input_byte = mybuffer; +- cinfo->src->bytes_in_buffer = 2; ++ /* Insert a fake EOI marker ++ */ ++ cinfo->src->next_input_byte = mybuffer; ++ cinfo->src->bytes_in_buffer = 2; + +- return( TRUE ); ++ return (TRUE); + } + + /* Skip data --- used to skip over a potentially large amount of +@@ -1840,142 +1847,141 @@ rtiff_decompress_jpeg_fill_input_buffer( j_decompress_ptr cinfo ) + * buffer is the application writer's problem. + */ + +-static void +-rtiff_decompress_jpeg_skip_input_data( j_decompress_ptr cinfo, long num_bytes ) ++static void ++rtiff_decompress_jpeg_skip_input_data(j_decompress_ptr cinfo, long num_bytes) + { +- struct jpeg_source_mgr * src = cinfo->src; ++ struct jpeg_source_mgr *src = cinfo->src; + +- /* Just a dumb implementation for now. Could use fseek() except +- * it doesn't work on pipes. Not clear that being smart is worth +- * any trouble anyway --- large skips are infrequent. +- */ +- if( num_bytes > 0 ) { +- while( num_bytes > (long) src->bytes_in_buffer ) { +- num_bytes -= (long) src->bytes_in_buffer; +- (void) (*src->fill_input_buffer)( cinfo ); +- /* note we assume that fill_input_buffer will never +- * return FALSE, so suspension need not be handled. +- */ +- } ++ /* Just a dumb implementation for now. Could use fseek() except ++ * it doesn't work on pipes. Not clear that being smart is worth ++ * any trouble anyway --- large skips are infrequent. ++ */ ++ if (num_bytes > 0) { ++ while (num_bytes > (long) src->bytes_in_buffer) { ++ num_bytes -= (long) src->bytes_in_buffer; ++ (void) (*src->fill_input_buffer)(cinfo); ++ /* note we assume that fill_input_buffer will never ++ * return FALSE, so suspension need not be handled. ++ */ ++ } + +- src->next_input_byte += (size_t) num_bytes; +- src->bytes_in_buffer -= (size_t) num_bytes; +- } ++ src->next_input_byte += (size_t) num_bytes; ++ src->bytes_in_buffer -= (size_t) num_bytes; ++ } + } + + static void +-rtiff_decompress_jpeg_set_memory( j_decompress_ptr cinfo, +- void *data, size_t data_len ) ++rtiff_decompress_jpeg_set_memory(j_decompress_ptr cinfo, ++ void *data, size_t data_len) + { +- if( !cinfo->src ) +- cinfo->src = (struct jpeg_source_mgr *) +- (*cinfo->mem->alloc_small)( +- (j_common_ptr) cinfo, JPOOL_PERMANENT, +- sizeof( struct jpeg_source_mgr ) ); ++ if (!cinfo->src) ++ cinfo->src = (struct jpeg_source_mgr *) (*cinfo->mem->alloc_small)( ++ (j_common_ptr) cinfo, JPOOL_PERMANENT, ++ sizeof(struct jpeg_source_mgr)); + +- /* Present the whole of data as one chunk. +- */ +- cinfo->src->bytes_in_buffer = data_len; +- cinfo->src->next_input_byte = (JOCTET *) data; +- cinfo->src->init_source = rtiff_decompress_jpeg_init_source; +- cinfo->src->fill_input_buffer = rtiff_decompress_jpeg_fill_input_buffer; +- cinfo->src->skip_input_data = rtiff_decompress_jpeg_skip_input_data; +- cinfo->src->resync_to_restart = jpeg_resync_to_restart; ++ /* Present the whole of data as one chunk. ++ */ ++ cinfo->src->bytes_in_buffer = data_len; ++ cinfo->src->next_input_byte = (JOCTET *) data; ++ cinfo->src->init_source = rtiff_decompress_jpeg_init_source; ++ cinfo->src->fill_input_buffer = rtiff_decompress_jpeg_fill_input_buffer; ++ cinfo->src->skip_input_data = rtiff_decompress_jpeg_skip_input_data; ++ cinfo->src->resync_to_restart = jpeg_resync_to_restart; + } + + static int +-rtiff_decompress_jpeg_run( Rtiff *rtiff, j_decompress_ptr cinfo, +- void *data, size_t data_len, void *out ) +-{ +- void *tables; +- uint32_t tables_len; +- int bytes_per_pixel; +- size_t bytes_per_scanline; +- VipsPel *q; +- int y; ++rtiff_decompress_jpeg_run(Rtiff *rtiff, j_decompress_ptr cinfo, ++ void *data, size_t data_len, void *out) ++{ ++ void *tables; ++ uint32_t tables_len; ++ int bytes_per_pixel; ++ size_t bytes_per_scanline; ++ VipsPel *q; ++ int y; + + #ifdef DEBUG_VERBOSE +- printf( "rtiff_decompress_jpeg_run: decompressing %zd bytes of jpg\n", +- data_len ); ++ printf("rtiff_decompress_jpeg_run: decompressing %zd bytes of jpg\n", ++ data_len); + #endif /*DEBUG_VERBOSE*/ + +- /* Tables are optional. +- */ +- tables = NULL; +- tables_len = 0; +- (void) TIFFGetField( rtiff->tiff, +- TIFFTAG_JPEGTABLES, &tables_len, &tables ); +- +- if( tables ) { +- rtiff_decompress_jpeg_set_memory( cinfo, tables, tables_len ); +- if( jpeg_read_header( cinfo, FALSE ) != +- JPEG_HEADER_TABLES_ONLY ) +- return( -1 ); +- } +- +- rtiff_decompress_jpeg_set_memory( cinfo, data, data_len ); +- +- if( jpeg_read_header( cinfo, TRUE ) != JPEG_HEADER_OK ) +- return( -1 ); +- +- /* This isn't stored in the tile -- we have to set it from the +- * enclosing TIFF. +- */ +- switch( rtiff->header.photometric_interpretation ) { +- case PHOTOMETRIC_SEPARATED: +- cinfo->jpeg_color_space = JCS_CMYK; +- bytes_per_pixel = 4; +- break; +- +- case PHOTOMETRIC_YCBCR: +- cinfo->jpeg_color_space = JCS_YCbCr; +- bytes_per_pixel = 3; +- break; +- +- case PHOTOMETRIC_RGB: +- cinfo->jpeg_color_space = JCS_RGB; +- bytes_per_pixel = 3; +- break; +- +- case PHOTOMETRIC_MINISWHITE: +- case PHOTOMETRIC_MINISBLACK: +- cinfo->jpeg_color_space = JCS_GRAYSCALE; +- bytes_per_pixel = 1; +- break; +- +- default: +- cinfo->jpeg_color_space = JCS_UNKNOWN; +- bytes_per_pixel = 1; +- break; +- } +- +- jpeg_start_decompress( cinfo ); +- bytes_per_scanline = cinfo->output_width * bytes_per_pixel; +- +- /* Double-check tile dimensions. +- */ +- if( cinfo->output_width > rtiff->header.tile_width || +- cinfo->output_height > rtiff->header.tile_height || +- bytes_per_scanline > rtiff->header.tile_row_size ) +- return( -1 ); +- +- q = (VipsPel *) out; +- for( y = 0; y < cinfo->output_height; y++ ) { +- JSAMPROW row_pointer[1]; +- +- row_pointer[0] = (JSAMPLE *) q; +- jpeg_read_scanlines( cinfo, &row_pointer[0], 1 ); +- q += bytes_per_scanline; +- } +- +- return( 0 ); ++ /* Tables are optional. ++ */ ++ tables = NULL; ++ tables_len = 0; ++ (void) TIFFGetField(rtiff->tiff, ++ TIFFTAG_JPEGTABLES, &tables_len, &tables); ++ ++ if (tables) { ++ rtiff_decompress_jpeg_set_memory(cinfo, tables, tables_len); ++ if (jpeg_read_header(cinfo, FALSE) != ++ JPEG_HEADER_TABLES_ONLY) ++ return (-1); ++ } ++ ++ rtiff_decompress_jpeg_set_memory(cinfo, data, data_len); ++ ++ if (jpeg_read_header(cinfo, TRUE) != JPEG_HEADER_OK) ++ return (-1); ++ ++ /* This isn't stored in the tile -- we have to set it from the ++ * enclosing TIFF. ++ */ ++ switch (rtiff->header.photometric_interpretation) { ++ case PHOTOMETRIC_SEPARATED: ++ cinfo->jpeg_color_space = JCS_CMYK; ++ bytes_per_pixel = 4; ++ break; ++ ++ case PHOTOMETRIC_YCBCR: ++ cinfo->jpeg_color_space = JCS_YCbCr; ++ bytes_per_pixel = 3; ++ break; ++ ++ case PHOTOMETRIC_RGB: ++ cinfo->jpeg_color_space = JCS_RGB; ++ bytes_per_pixel = 3; ++ break; ++ ++ case PHOTOMETRIC_MINISWHITE: ++ case PHOTOMETRIC_MINISBLACK: ++ cinfo->jpeg_color_space = JCS_GRAYSCALE; ++ bytes_per_pixel = 1; ++ break; ++ ++ default: ++ cinfo->jpeg_color_space = JCS_UNKNOWN; ++ bytes_per_pixel = 1; ++ break; ++ } ++ ++ jpeg_start_decompress(cinfo); ++ bytes_per_scanline = cinfo->output_width * bytes_per_pixel; ++ ++ /* Double-check tile dimensions. ++ */ ++ if (cinfo->output_width > rtiff->header.tile_width || ++ cinfo->output_height > rtiff->header.tile_height || ++ bytes_per_scanline > rtiff->header.tile_row_size) ++ return (-1); ++ ++ q = (VipsPel *) out; ++ for (y = 0; y < cinfo->output_height; y++) { ++ JSAMPROW row_pointer[1]; ++ ++ row_pointer[0] = (JSAMPLE *) q; ++ jpeg_read_scanlines(cinfo, &row_pointer[0], 1); ++ q += bytes_per_scanline; ++ } ++ ++ return (0); + } + + static void +-rtiff_decompress_jpeg_emit_message( j_common_ptr cinfo, int msg_level ) ++rtiff_decompress_jpeg_emit_message(j_common_ptr cinfo, int msg_level) + { +- if( msg_level < 0 ) { +- long num_warnings; ++ if (msg_level < 0) { ++ long num_warnings; + + /* Always count warnings in num_warnings. + */ +@@ -1983,156 +1989,156 @@ rtiff_decompress_jpeg_emit_message( j_common_ptr cinfo, int msg_level ) + + /* Corrupt files may give many warnings, the policy here is to + * show only the first warning and treat many warnings as fatal, +- * unless unlimited is set. ++ * unless unlimited is set. + */ +- if( num_warnings == 1 ) +- (*cinfo->err->output_message)( cinfo ); ++ if (num_warnings == 1) ++ (*cinfo->err->output_message)(cinfo); + } +- else if( cinfo->err->trace_level >= msg_level ) ++ else if (cinfo->err->trace_level >= msg_level) + /* It's a trace message. Show it if trace_level >= msg_level. + */ +- (*cinfo->err->output_message)( cinfo ); ++ (*cinfo->err->output_message)(cinfo); + } + + /* Decompress a tile of size coefficients into out. + */ + static int +-rtiff_decompress_jpeg( Rtiff *rtiff, void *data, size_t data_len, void *out ) +-{ +- struct jpeg_decompress_struct cinfo = { 0 }; +- ErrorManager eman; +- +- if( setjmp( eman.jmp ) == 0 ) { +- cinfo.err = jpeg_std_error( &eman.pub ); +- eman.pub.error_exit = vips__new_error_exit; +- eman.pub.emit_message = rtiff_decompress_jpeg_emit_message; +- eman.pub.output_message = vips__new_output_message; +- eman.fp = NULL; +- +- jpeg_create_decompress( &cinfo ); +- +- if( rtiff_decompress_jpeg_run( rtiff, &cinfo, +- data, data_len, out ) ) { +- jpeg_destroy_decompress( &cinfo ); +- return( -1 ); +- } +- } +- else { ++rtiff_decompress_jpeg(Rtiff *rtiff, void *data, size_t data_len, void *out) ++{ ++ struct jpeg_decompress_struct cinfo = { 0 }; ++ ErrorManager eman; ++ ++ if (setjmp(eman.jmp) == 0) { ++ cinfo.err = jpeg_std_error(&eman.pub); ++ eman.pub.error_exit = vips__new_error_exit; ++ eman.pub.emit_message = rtiff_decompress_jpeg_emit_message; ++ eman.pub.output_message = vips__new_output_message; ++ eman.fp = NULL; ++ ++ jpeg_create_decompress(&cinfo); ++ ++ if (rtiff_decompress_jpeg_run(rtiff, &cinfo, ++ data, data_len, out)) { ++ jpeg_destroy_decompress(&cinfo); ++ return (-1); ++ } ++ } ++ else { + #ifdef DEBUG_VERBOSE +- printf( "rtiff_decompress_jpeg: error return\n" ); ++ printf("rtiff_decompress_jpeg: error return\n"); + #endif /*DEBUG_VERBOSE*/ + +- jpeg_destroy_decompress( &cinfo ); +- return( -1 ); +- } ++ jpeg_destroy_decompress(&cinfo); ++ return (-1); ++ } + +- jpeg_destroy_decompress( &cinfo ); ++ jpeg_destroy_decompress(&cinfo); + +- return( 0 ); ++ return (0); + } + #endif /*HAVE_JPEG*/ + + static int +-rtiff_decompress_tile( Rtiff *rtiff, tdata_t *in, tsize_t size, tdata_t *out ) +-{ +- g_assert( rtiff->header.we_decompress ); +- +- switch( rtiff->header.compression ) { +- case JP2K_YCC: +- case JP2K_RGB: +- case JP2K_LOSSY: +- if( vips__foreign_load_jp2k_decompress( +- rtiff->out, +- rtiff->header.tile_width, +- rtiff->header.tile_height, +- TRUE, +- in, size, +- out, rtiff->header.tile_size ) ) +- return( -1 ); +- break; ++rtiff_decompress_tile(Rtiff *rtiff, tdata_t *in, tsize_t size, tdata_t *out) ++{ ++ g_assert(rtiff->header.we_decompress); ++ ++ switch (rtiff->header.compression) { ++ case JP2K_YCC: ++ case JP2K_RGB: ++ case JP2K_LOSSY: ++ if (vips__foreign_load_jp2k_decompress( ++ rtiff->out, ++ rtiff->header.tile_width, ++ rtiff->header.tile_height, ++ TRUE, ++ in, size, ++ out, rtiff->header.tile_size)) ++ return (-1); ++ break; + + #ifdef HAVE_JPEG +- case COMPRESSION_JPEG: +- if( rtiff_decompress_jpeg( rtiff, in, size, out ) ) +- return( -1 ); +- break; ++ case COMPRESSION_JPEG: ++ if (rtiff_decompress_jpeg(rtiff, in, size, out)) ++ return (-1); ++ break; + #endif /*HAVE_JPEG*/ + +- default: +- g_assert_not_reached(); +- break; +- } ++ default: ++ g_assert_not_reached(); ++ break; ++ } + +- return( 0 ); ++ return (0); + } + + /* Select a page and decompress a tile. This has to be a single operation, + * since it changes the current page number in TIFF. + */ + static int +-rtiff_read_tile( RtiffSeq *seq, tdata_t *buf, int page, int x, int y ) ++rtiff_read_tile(RtiffSeq *seq, tdata_t *buf, int page, int x, int y) + { +- Rtiff *rtiff = seq->rtiff; ++ Rtiff *rtiff = seq->rtiff; + +- tsize_t size; ++ tsize_t size; + + #ifdef DEBUG_VERBOSE +- printf( "rtiff_read_tile: page = %d, x = %d, y = %d, " +- "we_decompress = %d\n", +- page, x, y, rtiff->header.we_decompress ); ++ printf("rtiff_read_tile: page = %d, x = %d, y = %d, " ++ "we_decompress = %d\n", ++ page, x, y, rtiff->header.we_decompress); + #endif /*DEBUG_VERBOSE*/ + +- /* Compressed tiles load to compressed_buf. +- */ +- if( rtiff->header.we_decompress ) { ++ /* Compressed tiles load to compressed_buf. ++ */ ++ if (rtiff->header.we_decompress) { + ttile_t tile_no; + +- g_rec_mutex_lock( &rtiff->lock ); ++ g_rec_mutex_lock(&rtiff->lock); ++ ++ if (rtiff_set_page(rtiff, page)) { ++ g_rec_mutex_unlock(&rtiff->lock); ++ return (-1); ++ } ++ ++ tile_no = TIFFComputeTile(rtiff->tiff, x, y, 0, 0); + +- if( rtiff_set_page( rtiff, page ) ) { +- g_rec_mutex_unlock( &rtiff->lock ); +- return( -1 ); +- } ++ size = TIFFReadRawTile(rtiff->tiff, tile_no, ++ seq->compressed_buf, seq->compressed_buf_length); ++ if (size <= 0) { ++ vips_foreign_load_invalidate(rtiff->out); ++ g_rec_mutex_unlock(&rtiff->lock); ++ return (-1); ++ } + +- tile_no = TIFFComputeTile( rtiff->tiff, x, y, 0, 0 ); ++ g_rec_mutex_unlock(&rtiff->lock); + +- size = TIFFReadRawTile( rtiff->tiff, tile_no, +- seq->compressed_buf, seq->compressed_buf_length ); +- if( size <= 0 ) { +- vips_foreign_load_invalidate( rtiff->out ); +- g_rec_mutex_unlock( &rtiff->lock ); +- return( -1 ); ++ /* Decompress outside the lock, so we get parallelism. ++ */ ++ if (rtiff_decompress_tile(rtiff, ++ seq->compressed_buf, size, buf)) { ++ vips_error("tiff2vips", ++ _("decompress error tile %d x %d"), x, y); ++ return (-1); + } ++ } ++ else { ++ g_rec_mutex_lock(&rtiff->lock); + +- g_rec_mutex_unlock( &rtiff->lock ); +- +- /* Decompress outside the lock, so we get parallelism. +- */ +- if( rtiff_decompress_tile( rtiff, +- seq->compressed_buf, size, buf ) ) { +- vips_error( "tiff2vips", +- _( "decompress error tile %d x %d" ), x, y ); +- return( -1 ); +- } +- } +- else { +- g_rec_mutex_lock( &rtiff->lock ); +- +- if( rtiff_set_page( rtiff, page ) ) { +- g_rec_mutex_unlock( &rtiff->lock ); +- return( -1 ); +- } +- +- if( TIFFReadTile( rtiff->tiff, buf, x, y, 0, 0 ) < 0 ) { +- vips_foreign_load_invalidate( rtiff->out ); +- g_rec_mutex_unlock( &rtiff->lock ); +- return( -1 ); ++ if (rtiff_set_page(rtiff, page)) { ++ g_rec_mutex_unlock(&rtiff->lock); ++ return (-1); + } + +- g_rec_mutex_unlock( &rtiff->lock ); +- } ++ if (TIFFReadTile(rtiff->tiff, buf, x, y, 0, 0) < 0) { ++ vips_foreign_load_invalidate(rtiff->out); ++ g_rec_mutex_unlock(&rtiff->lock); ++ return (-1); ++ } + +- return( 0 ); ++ g_rec_mutex_unlock(&rtiff->lock); ++ } ++ ++ return (0); + } + + /* Paint a tile from the file. This is a +@@ -2141,43 +2147,43 @@ rtiff_read_tile( RtiffSeq *seq, tdata_t *buf, int page, int x, int y ) + * region. + */ + static int +-rtiff_fill_region_aligned( VipsRegion *out, +- void *vseq, void *a, void *b, gboolean *stop ) ++rtiff_fill_region_aligned(VipsRegion *out, ++ void *vseq, void *a, void *b, gboolean *stop) + { +- RtiffSeq *seq = (RtiffSeq *) vseq; ++ RtiffSeq *seq = (RtiffSeq *) vseq; + Rtiff *rtiff = (Rtiff *) a; + VipsRect *r = &out->valid; + int page_height = rtiff->header.height; + int page_no = r->top / page_height; + int page_y = r->top % page_height; + +- g_assert( (r->left % rtiff->header.tile_width) == 0 ); +- g_assert( (r->top % rtiff->header.tile_height) == 0 ); +- g_assert( r->width == rtiff->header.tile_width ); +- g_assert( r->height == rtiff->header.tile_height ); +- g_assert( VIPS_REGION_LSKIP( out ) == VIPS_REGION_SIZEOF_LINE( out ) ); ++ g_assert((r->left % rtiff->header.tile_width) == 0); ++ g_assert((r->top % rtiff->header.tile_height) == 0); ++ g_assert(r->width == rtiff->header.tile_width); ++ g_assert(r->height == rtiff->header.tile_height); ++ g_assert(VIPS_REGION_LSKIP(out) == VIPS_REGION_SIZEOF_LINE(out)); + + #ifdef DEBUG_VERBOSE +- printf( "rtiff_fill_region_aligned:\n" ); ++ printf("rtiff_fill_region_aligned:\n"); + #endif /*DEBUG_VERBOSE*/ + + /* Read that tile directly into the vips tile. + */ +- if( rtiff_read_tile( seq, +- (tdata_t *) VIPS_REGION_ADDR( out, r->left, r->top ), +- rtiff->page + page_no, r->left, page_y ) ) +- return( -1 ); ++ if (rtiff_read_tile(seq, ++ (tdata_t *) VIPS_REGION_ADDR(out, r->left, r->top), ++ rtiff->page + page_no, r->left, page_y)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Loop over the output region, painting in tiles from the file. + */ + static int +-rtiff_fill_region_unaligned( VipsRegion *out, +- void *vseq, void *a, void *b, gboolean *stop ) ++rtiff_fill_region_unaligned(VipsRegion *out, ++ void *vseq, void *a, void *b, gboolean *stop) + { +- RtiffSeq *seq = (RtiffSeq *) vseq; ++ RtiffSeq *seq = (RtiffSeq *) vseq; + Rtiff *rtiff = (Rtiff *) a; + int tile_width = rtiff->header.tile_width; + int tile_height = rtiff->header.tile_height; +@@ -2188,11 +2194,11 @@ rtiff_fill_region_unaligned( VipsRegion *out, + int x, y, z; + + #ifdef DEBUG_VERBOSE +- printf( "rtiff_fill_region_unaligned:\n" ); ++ printf("rtiff_fill_region_unaligned:\n"); + #endif /*DEBUG_VERBOSE*/ + + y = 0; +- while( y < r->height ) { ++ while (y < r->height) { + VipsRect tile, page, hit; + + /* Not necessary, but it stops static analyzers complaining +@@ -2201,7 +2207,7 @@ rtiff_fill_region_unaligned( VipsRegion *out, + hit.height = 0; + + x = 0; +- while( x < r->width ) { ++ while (x < r->width) { + /* page_no is within this toilet roll image, not tiff + * file page number ... add the number of the start + * page to get that. +@@ -2214,11 +2220,11 @@ rtiff_fill_region_unaligned( VipsRegion *out, + int xs = ((r->left + x) / tile_width) * tile_width; + int ys = (page_y / tile_height) * tile_height; + +- if( rtiff_read_tile( seq, +- seq->buf, rtiff->page + page_no, xs, ys ) ) +- return( -1 ); ++ if (rtiff_read_tile(seq, ++ seq->buf, rtiff->page + page_no, xs, ys)) ++ return (-1); + +- /* Position of tile on the page. ++ /* Position of tile on the page. + */ + tile.left = xs; + tile.top = ys; +@@ -2231,7 +2237,7 @@ rtiff_fill_region_unaligned( VipsRegion *out, + page.top = 0; + page.width = rtiff->header.width; + page.height = rtiff->header.height; +- vips_rect_intersectrect( &tile, &page, &tile ); ++ vips_rect_intersectrect(&tile, &page, &tile); + + /* To image coordinates. + */ +@@ -2239,27 +2245,27 @@ rtiff_fill_region_unaligned( VipsRegion *out, + + /* And clip again by this region. + */ +- vips_rect_intersectrect( &tile, r, &hit ); ++ vips_rect_intersectrect(&tile, r, &hit); + + /* We are inside a tilecache, so requests will always + * be aligned left-right to tile boundaries. + * + * this is not true vertically for toilet-roll images. + */ +- g_assert( hit.left == tile.left ); ++ g_assert(hit.left == tile.left); + +- /* Unpack to VIPS format. ++ /* Unpack to VIPS format. + * Just unpack the section of the tile we need. + */ +- for( z = 0; z < hit.height; z++ ) { ++ for (z = 0; z < hit.height; z++) { + VipsPel *p = (VipsPel *) seq->buf + +- (hit.top - tile.top + z) * +- tile_row_size; +- VipsPel *q = VIPS_REGION_ADDR( out, +- hit.left, hit.top + z ); ++ (hit.top - tile.top + z) * ++ tile_row_size; ++ VipsPel *q = VIPS_REGION_ADDR(out, ++ hit.left, hit.top + z); + +- rtiff->sfn( rtiff, +- q, p, hit.width, rtiff->client ); ++ rtiff->sfn(rtiff, ++ q, p, hit.width, rtiff->client); + } + + x += hit.width; +@@ -2271,14 +2277,14 @@ rtiff_fill_region_unaligned( VipsRegion *out, + y += hit.height; + } + +- return( 0 ); ++ return (0); + } + + /* Loop over the output region, painting in tiles from the file. + */ + static int +-rtiff_fill_region( VipsRegion *out, +- void *vseq, void *a, void *b, gboolean *stop ) ++rtiff_fill_region(VipsRegion *out, ++ void *vseq, void *a, void *b, gboolean *stop) + { + Rtiff *rtiff = (Rtiff *) a; + int tile_width = rtiff->header.tile_width; +@@ -2292,199 +2298,199 @@ rtiff_fill_region( VipsRegion *out, + VipsGenerateFn generate; + + #ifdef DEBUG_VERBOSE +- printf( "rtiff_fill_region: left = %d, top = %d, " +- "width = %d, height = %d\n", +- r->left, r->top, r->width, r->height ); ++ printf("rtiff_fill_region: left = %d, top = %d, " ++ "width = %d, height = %d\n", ++ r->left, r->top, r->width, r->height); + #endif /*DEBUG_VERBOSE*/ + +- /* Special case: we are filling a single cache tile exactly sized to ++ /* Special case: we are filling a single cache tile exactly sized to + * match the tiff tile, and we have no repacking to do for this format. + * +- * If we are not on the first page, pages must be a multiple of the ++ * If we are not on the first page, pages must be a multiple of the + * tile size of we'll miss alignment. + */ +- if( (page_no == 0 || page_height % tile_height == 0) && ++ if ((page_no == 0 || page_height % tile_height == 0) && + r->left % tile_width == 0 && + r->top % tile_height == 0 && + r->width == tile_width && + r->height == tile_height && + r->left + tile_width <= page_width && + page_y + tile_height <= page_height && +- VIPS_REGION_LSKIP( out ) == VIPS_REGION_SIZEOF_LINE( out ) && +- rtiff->memcpy ) ++ VIPS_REGION_LSKIP(out) == VIPS_REGION_SIZEOF_LINE(out) && ++ rtiff->memcpy) + generate = rtiff_fill_region_aligned; + else + generate = rtiff_fill_region_unaligned; + +- VIPS_GATE_START( "rtiff_fill_region: work" ); ++ VIPS_GATE_START("rtiff_fill_region: work"); + +- if( generate( out, vseq, a, b, stop ) ) { +- VIPS_GATE_STOP( "rtiff_fill_region: work" ); +- return( -1 ); ++ if (generate(out, vseq, a, b, stop)) { ++ VIPS_GATE_STOP("rtiff_fill_region: work"); ++ return (-1); + } + +- VIPS_GATE_STOP( "rtiff_fill_region: work" ); ++ VIPS_GATE_STOP("rtiff_fill_region: work"); + +- return( 0 ); ++ return (0); + } + + static int +-rtiff_seq_stop( void *vseq, void *a, void *b ) ++rtiff_seq_stop(void *vseq, void *a, void *b) + { +- RtiffSeq *seq = (RtiffSeq *) vseq; ++ RtiffSeq *seq = (RtiffSeq *) vseq; + +- VIPS_FREE( seq->buf ); +- VIPS_FREE( seq->compressed_buf ); ++ VIPS_FREE(seq->buf); ++ VIPS_FREE(seq->compressed_buf); + +- return( 0 ); ++ return (0); + } + + /* Unpremultiply associative alpha, if any. + */ + static int +-rtiff_unpremultiply( Rtiff *rtiff, VipsImage *in, VipsImage **out ) ++rtiff_unpremultiply(Rtiff *rtiff, VipsImage *in, VipsImage **out) + { +- if( rtiff->header.alpha_band != -1 ) { ++ if (rtiff->header.alpha_band != -1) { + VipsImage *x; + +- if( +- vips_unpremultiply( in, &x, ++ if ( ++ vips_unpremultiply(in, &x, + "alpha_band", rtiff->header.alpha_band, +- NULL ) || +- vips_cast( x, out, in->BandFmt, NULL ) ) { +- g_object_unref( x ); +- return( -1 ); ++ NULL) || ++ vips_cast(x, out, in->BandFmt, NULL)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + } + else { + *out = in; +- g_object_ref( in ); ++ g_object_ref(in); + } + +- return( 0 ); ++ return (0); + } + + /* Tile-type TIFF reader core - pass in a per-tile transform. Generate into + * the im and do it all partially. + */ + static int +-rtiff_read_tilewise( Rtiff *rtiff, VipsImage *out ) ++rtiff_read_tilewise(Rtiff *rtiff, VipsImage *out) + { + int tile_width = rtiff->header.tile_width; + int tile_height = rtiff->header.tile_height; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 4 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(out), 4); + + VipsImage *in; + + #ifdef DEBUG +- printf( "tiff2vips: rtiff_read_tilewise\n" ); ++ printf("tiff2vips: rtiff_read_tilewise\n"); + #endif /*DEBUG*/ + + /* I don't have a sample images for tiled + separate, ban it for now. + */ +- if( rtiff->header.separate ) { +- vips_error( "tiff2vips", +- "%s", _( "tiled separate planes not supported" ) ); +- return( -1 ); ++ if (rtiff->header.separate) { ++ vips_error("tiff2vips", ++ "%s", _("tiled separate planes not supported")); ++ return (-1); + } + + /* Read to this image, then cache to out, see below. + */ +- t[0] = vips_image_new(); ++ t[0] = vips_image_new(); + +- if( rtiff_set_header( rtiff, t[0] ) ) +- return( -1 ); ++ if (rtiff_set_header(rtiff, t[0])) ++ return (-1); + + /* Double check: in memcpy mode, the vips tilesize should exactly + * match the tifftile size. + */ +- if( rtiff->memcpy ) { +- size_t vips_tile_size = VIPS_IMAGE_SIZEOF_PEL( t[0] ) * +- tile_width * tile_height; ++ if (rtiff->memcpy) { ++ size_t vips_tile_size = VIPS_IMAGE_SIZEOF_PEL(t[0]) * ++ tile_width * tile_height; + +- if( rtiff->header.tile_size != vips_tile_size ) { +- vips_error( "tiff2vips", +- "%s", _( "unsupported tiff image type" ) ); +- return( -1 ); ++ if (rtiff->header.tile_size != vips_tile_size) { ++ vips_error("tiff2vips", ++ "%s", _("unsupported tiff image type")); ++ return (-1); + } + } + + /* Generate to out, adding a cache. Enough tiles for two complete rows. +- * Set "threaded", so we allow many tiles to be read at once. We lock +- * around each tile read. +- */ +- if( +- vips_image_generate( t[0], +- rtiff_seq_start, rtiff_fill_region, rtiff_seq_stop, +- rtiff, NULL ) || +- vips_tilecache( t[0], &t[1], ++ * Set "threaded", so we allow many tiles to be read at once. We lock ++ * around each tile read. ++ */ ++ if ( ++ vips_image_generate(t[0], ++ rtiff_seq_start, rtiff_fill_region, rtiff_seq_stop, ++ rtiff, NULL) || ++ vips_tilecache(t[0], &t[1], + "tile_width", tile_width, + "tile_height", tile_height, + "max_tiles", 2 * (1 + t[0]->Xsize / tile_width), + "threaded", TRUE, +- NULL ) || +- rtiff_unpremultiply( rtiff, t[1], &t[2] ) ) +- return( -1 ); ++ NULL) || ++ rtiff_unpremultiply(rtiff, t[1], &t[2])) ++ return (-1); + in = t[2]; + + /* Only do this if we have to. + */ +- if( rtiff->autorotate && +- vips_image_get_orientation( in ) != 1 ) { +- if( vips_autorot( in, &t[3], NULL ) ) +- return( -1 ); ++ if (rtiff->autorotate && ++ vips_image_get_orientation(in) != 1) { ++ if (vips_autorot(in, &t[3], NULL)) ++ return (-1); + in = t[3]; + } + +- if( vips_image_write( in, out ) ) +- return( -1 ); ++ if (vips_image_write(in, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-/* Read a strip from a page. If the image is in separate planes, read each ++/* Read a strip from a page. If the image is in separate planes, read each + * plane and interleave to the output. + * + * No need to lock -- this is inside a sequential. + */ + static int +-rtiff_strip_read_interleaved( Rtiff *rtiff, +- int page, tstrip_t strip, tdata_t buf ) ++rtiff_strip_read_interleaved(Rtiff *rtiff, ++ int page, tstrip_t strip, tdata_t buf) + { + int samples_per_pixel = rtiff->header.samples_per_pixel; + int read_height = rtiff->header.read_height; + int bits_per_sample = rtiff->header.bits_per_sample; + int strip_y = strip * read_height; + +- if( rtiff_set_page( rtiff, page ) ) +- return( -1 ); ++ if (rtiff_set_page(rtiff, page)) ++ return (-1); + +- if( rtiff->header.separate ) { ++ if (rtiff->header.separate) { + int page_width = rtiff->header.width; + int page_height = rtiff->header.height; + int strips_per_plane = 1 + (page_height - 1) / read_height; +- int strip_height = VIPS_MIN( read_height, +- page_height - strip_y ); ++ int strip_height = VIPS_MIN(read_height, ++ page_height - strip_y); + int pels_per_strip = page_width * strip_height; +- int bytes_per_sample = bits_per_sample >> 3; ++ int bytes_per_sample = bits_per_sample >> 3; + + int i, j, k; + +- for( i = 0; i < samples_per_pixel; i++ ) { ++ for (i = 0; i < samples_per_pixel; i++) { + VipsPel *p; + VipsPel *q; + +- if( rtiff_strip_read( rtiff, +- strips_per_plane * i + strip, +- rtiff->plane_buf ) ) +- return( -1 ); ++ if (rtiff_strip_read(rtiff, ++ strips_per_plane * i + strip, ++ rtiff->plane_buf)) ++ return (-1); + + p = (VipsPel *) rtiff->plane_buf; + q = i * bytes_per_sample + (VipsPel *) buf; +- for( j = 0; j < pels_per_strip; j++ ) { +- for( k = 0; k < bytes_per_sample; k++ ) ++ for (j = 0; j < pels_per_strip; j++) { ++ for (k = 0; k < bytes_per_sample; k++) + q[k] = p[k]; + + p += bytes_per_sample; +@@ -2492,39 +2498,39 @@ rtiff_strip_read_interleaved( Rtiff *rtiff, + } + } + } +- else { +- if( rtiff_strip_read( rtiff, strip, buf ) ) +- return( -1 ); ++ else { ++ if (rtiff_strip_read(rtiff, strip, buf)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-rtiff_stripwise_generate( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++rtiff_stripwise_generate(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsImage *out = or->im; + Rtiff *rtiff = (Rtiff *) a; + int read_height = rtiff->header.read_height; + int page_height = rtiff->header.height; + tsize_t scanline_size = rtiff->header.scanline_size; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + + int y; + + #ifdef DEBUG_VERBOSE +- printf( "rtiff_stripwise_generate: top = %d, height = %d\n", +- r->top, r->height ); +- printf( "rtiff_stripwise_generate: y_top = %d\n", rtiff->y_pos ); ++ printf("rtiff_stripwise_generate: top = %d, height = %d\n", ++ r->top, r->height); ++ printf("rtiff_stripwise_generate: y_top = %d\n", rtiff->y_pos); + #endif /*DEBUG_VERBOSE*/ + + /* We're inside a tilecache where tiles are the full image width, so + * this should always be true. + */ +- g_assert( r->left == 0 ); +- g_assert( r->width == or->im->Xsize ); +- g_assert( VIPS_RECT_BOTTOM( r ) <= or->im->Ysize ); ++ g_assert(r->left == 0); ++ g_assert(r->width == or->im->Xsize); ++ g_assert(VIPS_RECT_BOTTOM(r) <= or->im->Ysize); + + /* If we're reading more than one page, tiles won't fall on strip + * boundaries. Tiles may be contain several strips. +@@ -2533,17 +2539,18 @@ rtiff_stripwise_generate( VipsRegion *or, + /* Check that y_pos is correct. It should be, since we are inside + * a vips_sequential(). + */ +- if( r->top != rtiff->y_pos ) { +- vips_error( "tiff2vips", +- _( "out of order read -- at line %d, " +- "but line %d requested" ), rtiff->y_pos, r->top ); +- return( -1 ); ++ if (r->top != rtiff->y_pos) { ++ vips_error("tiff2vips", ++ _("out of order read -- at line %d, " ++ "but line %d requested"), ++ rtiff->y_pos, r->top); ++ return (-1); + } + +- VIPS_GATE_START( "rtiff_stripwise_generate: work" ); ++ VIPS_GATE_START("rtiff_stripwise_generate: work"); + + y = 0; +- while( y < r->height ) { ++ while (y < r->height) { + /* page_no is within this toilet roll image, not tiff + * file page number ... add the number of the start + * page to get that. +@@ -2557,7 +2564,7 @@ rtiff_stripwise_generate( VipsRegion *or, + + VipsRect image, page, strip, hit; + +- /* Our four (including the output region) rects, all in ++ /* Our four (including the output region) rects, all in + * output image coordinates. + */ + image.left = 0; +@@ -2575,33 +2582,33 @@ rtiff_stripwise_generate( VipsRegion *or, + strip.width = out->Xsize; + strip.height = read_height; + +- /* Clip strip against page and image ... the final strip will ++ /* Clip strip against page and image ... the final strip will + * be smaller. + */ +- vips_rect_intersectrect( &strip, &image, &strip ); +- vips_rect_intersectrect( &strip, &page, &strip ); ++ vips_rect_intersectrect(&strip, &image, &strip); ++ vips_rect_intersectrect(&strip, &page, &strip); + + /* Now the bit that overlaps with the region we are filling. + */ +- vips_rect_intersectrect( &strip, r, &hit ); ++ vips_rect_intersectrect(&strip, r, &hit); + +- g_assert( hit.height > 0 ); ++ g_assert(hit.height > 0); + +- /* Read directly into the image if we can. Otherwise, we must ++ /* Read directly into the image if we can. Otherwise, we must + * read to a temp buffer then unpack into the image. + * + * We need to read via a buffer if we need to reformat pixels, + * or if this strip is not aligned on a tile boundary. + */ +- if( rtiff->memcpy && ++ if (rtiff->memcpy && + hit.top == strip.top && +- hit.height == strip.height ) { +- if( rtiff_strip_read_interleaved( rtiff, +- rtiff->page + page_no, strip_no, +- VIPS_REGION_ADDR( or, 0, r->top + y ) ) ) { +- VIPS_GATE_STOP( +- "rtiff_stripwise_generate: work" ); +- return( -1 ); ++ hit.height == strip.height) { ++ if (rtiff_strip_read_interleaved(rtiff, ++ rtiff->page + page_no, strip_no, ++ VIPS_REGION_ADDR(or, 0, r->top + y))) { ++ VIPS_GATE_STOP( ++ "rtiff_stripwise_generate: work"); ++ return (-1); + } + } + else { +@@ -2611,25 +2618,25 @@ rtiff_stripwise_generate( VipsRegion *or, + + /* Read and interleave the entire strip. + */ +- if( rtiff_strip_read_interleaved( rtiff, +- rtiff->page + page_no, strip_no, +- rtiff->contig_buf ) ) { +- VIPS_GATE_STOP( +- "rtiff_stripwise_generate: work" ); +- return( -1 ); ++ if (rtiff_strip_read_interleaved(rtiff, ++ rtiff->page + page_no, strip_no, ++ rtiff->contig_buf)) { ++ VIPS_GATE_STOP( ++ "rtiff_stripwise_generate: work"); ++ return (-1); + } + + /* Do any repacking to generate pixels in vips layout. + */ +- p = (VipsPel *) rtiff->contig_buf + ++ p = (VipsPel *) rtiff->contig_buf + + (hit.top - strip.top) * scanline_size; +- q = VIPS_REGION_ADDR( or, 0, r->top + y ); +- for( z = 0; z < hit.height; z++ ) { +- rtiff->sfn( rtiff, +- q, p, or->im->Xsize, rtiff->client ); ++ q = VIPS_REGION_ADDR(or, 0, r->top + y); ++ for (z = 0; z < hit.height; z++) { ++ rtiff->sfn(rtiff, ++ q, p, or->im->Xsize, rtiff->client); + + p += scanline_size; +- q += VIPS_REGION_LSKIP( or ); ++ q += VIPS_REGION_LSKIP(or); + } + } + +@@ -2637,52 +2644,52 @@ rtiff_stripwise_generate( VipsRegion *or, + rtiff->y_pos += hit.height; + } + +- VIPS_GATE_STOP( "rtiff_stripwise_generate: work" ); ++ VIPS_GATE_STOP("rtiff_stripwise_generate: work"); + +- return( 0 ); ++ return (0); + } + + /* Stripwise reading. + * + * We could potentially read strips in any order, but this would give +- * catastrophic performance for operations like 90 degress rotate on a ++ * catastrophic performance for operations like 90 degress rotate on a + * large image. Only offer sequential read. + */ + static int +-rtiff_read_stripwise( Rtiff *rtiff, VipsImage *out ) ++rtiff_read_stripwise(Rtiff *rtiff, VipsImage *out) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 4 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(out), 4); + + VipsImage *in; + int tile_height; + + #ifdef DEBUG +- printf( "tiff2vips: rtiff_read_stripwise\n" ); ++ printf("tiff2vips: rtiff_read_stripwise\n"); + #endif /*DEBUG*/ + + t[0] = vips_image_new(); +- if( rtiff_set_header( rtiff, t[0] ) ) +- return( -1 ); ++ if (rtiff_set_header(rtiff, t[0])) ++ return (-1); + + /* Double check: in memcpy mode, the vips linesize should exactly + * match the tiff line size. + */ +- if( rtiff->memcpy ) { ++ if (rtiff->memcpy) { + size_t vips_line_size; + + /* Lines are smaller in plane-separated mode. + */ +- if( rtiff->header.separate ) +- vips_line_size = VIPS_IMAGE_SIZEOF_ELEMENT( t[0] ) * +- t[0]->Xsize; ++ if (rtiff->header.separate) ++ vips_line_size = VIPS_IMAGE_SIZEOF_ELEMENT(t[0]) * ++ t[0]->Xsize; + else +- vips_line_size = VIPS_IMAGE_SIZEOF_LINE( t[0] ); ++ vips_line_size = VIPS_IMAGE_SIZEOF_LINE(t[0]); + +- if( vips_line_size != rtiff->header.scanline_size ) { +- vips_error( "tiff2vips", +- "%s", _( "unsupported tiff image type" ) ); +- return( -1 ); ++ if (vips_line_size != rtiff->header.scanline_size) { ++ vips_error("tiff2vips", ++ "%s", _("unsupported tiff image type")); ++ return (-1); + } + } + +@@ -2690,12 +2697,12 @@ rtiff_read_stripwise( Rtiff *rtiff, VipsImage *out ) + * then interleave to the output. + * + * We don't need a separate buffer per thread since the _generate() +- * function runs inside the cache lock. ++ * function runs inside the cache lock. + */ +- if( rtiff->header.separate ) { +- if( !(rtiff->plane_buf = VIPS_MALLOC( out, +- rtiff->header.read_size )) ) +- return( -1 ); ++ if (rtiff->header.separate) { ++ if (!(rtiff->plane_buf = VIPS_MALLOC(out, ++ rtiff->header.read_size))) ++ return (-1); + } + + /* If we need to manipulate pixels, we must read to an interleaved +@@ -2705,18 +2712,18 @@ rtiff_read_stripwise( Rtiff *rtiff, VipsImage *out ) + * strips may not be aligned on tile boundaries. + * + * We don't need a separate buffer per thread since the _generate() +- * function runs inside the cache lock. ++ * function runs inside the cache lock. + */ +- if( !rtiff->memcpy || +- rtiff->n > 1 ) { ++ if (!rtiff->memcpy || ++ rtiff->n > 1) { + tsize_t size; + + size = rtiff->header.read_size; +- if( rtiff->header.separate ) ++ if (rtiff->header.separate) + size *= rtiff->header.samples_per_pixel; + +- if( !(rtiff->contig_buf = VIPS_MALLOC( out, size )) ) +- return( -1 ); ++ if (!(rtiff->contig_buf = VIPS_MALLOC(out, size))) ++ return (-1); + } + + /* rows_per_strip can be very large if this is a separate plane image, +@@ -2726,40 +2733,40 @@ rtiff_read_stripwise( Rtiff *rtiff, VipsImage *out ) + * work for the tilecache -- set a min size for tiles which is a + * multiple of rowsperstrip. + */ +- tile_height = VIPS_MAX( +- VIPS_ROUND_DOWN( 16, rtiff->header.read_height ), +- rtiff->header.read_height ); ++ tile_height = VIPS_MAX( ++ VIPS_ROUND_DOWN(16, rtiff->header.read_height), ++ rtiff->header.read_height); + +- if( +- vips_image_generate( t[0], +- NULL, rtiff_stripwise_generate, NULL, +- rtiff, NULL ) || +- vips_sequential( t[0], &t[1], ++ if ( ++ vips_image_generate(t[0], ++ NULL, rtiff_stripwise_generate, NULL, ++ rtiff, NULL) || ++ vips_sequential(t[0], &t[1], + "tile_height", tile_height, +- NULL ) || +- rtiff_unpremultiply( rtiff, t[1], &t[2] ) ) +- return( -1 ); ++ NULL) || ++ rtiff_unpremultiply(rtiff, t[1], &t[2])) ++ return (-1); + in = t[2]; + + /* Only do this if we have to. + */ +- if( rtiff->autorotate && +- vips_image_get_orientation( in ) != 1 ) { +- if( vips_autorot( in, &t[3], NULL ) ) +- return( -1 ); ++ if (rtiff->autorotate && ++ vips_image_get_orientation(in) != 1) { ++ if (vips_autorot(in, &t[3], NULL)) ++ return (-1); + in = t[3]; + } + +- if( vips_image_write( in, out ) ) +- return( -1 ); ++ if (vips_image_write(in, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Load from a tiff dir into one of our tiff header structs. + */ + static int +-rtiff_header_read( Rtiff *rtiff, RtiffHeader *header ) ++rtiff_header_read(Rtiff *rtiff, RtiffHeader *header) + { + int i; + guint16 extra_samples_count; +@@ -2768,31 +2775,31 @@ rtiff_header_read( Rtiff *rtiff, RtiffHeader *header ) + toff_t *subifd_offsets; + char *image_description; + +- if( !tfget32( rtiff->tiff, TIFFTAG_IMAGEWIDTH, +- &header->width ) || +- !tfget32( rtiff->tiff, TIFFTAG_IMAGELENGTH, +- &header->height ) || +- !tfget16( rtiff->tiff, TIFFTAG_SAMPLESPERPIXEL, +- &header->samples_per_pixel ) || +- !tfget16( rtiff->tiff, TIFFTAG_BITSPERSAMPLE, +- &header->bits_per_sample ) || +- !tfget16( rtiff->tiff, TIFFTAG_PHOTOMETRIC, +- &header->photometric_interpretation ) || +- !tfget16( rtiff->tiff, TIFFTAG_INKSET, +- &header->inkset ) ) +- return( -1 ); +- +- TIFFGetFieldDefaulted( rtiff->tiff, +- TIFFTAG_COMPRESSION, &header->compression ); ++ if (!tfget32(rtiff->tiff, TIFFTAG_IMAGEWIDTH, ++ &header->width) || ++ !tfget32(rtiff->tiff, TIFFTAG_IMAGELENGTH, ++ &header->height) || ++ !tfget16(rtiff->tiff, TIFFTAG_SAMPLESPERPIXEL, ++ &header->samples_per_pixel) || ++ !tfget16(rtiff->tiff, TIFFTAG_BITSPERSAMPLE, ++ &header->bits_per_sample) || ++ !tfget16(rtiff->tiff, TIFFTAG_PHOTOMETRIC, ++ &header->photometric_interpretation) || ++ !tfget16(rtiff->tiff, TIFFTAG_INKSET, ++ &header->inkset)) ++ return (-1); ++ ++ TIFFGetFieldDefaulted(rtiff->tiff, ++ TIFFTAG_COMPRESSION, &header->compression); + + /* One of the types we decompress? + */ +- for( i = 0; i < VIPS_NUMBER( rtiff_we_decompress ); i++ ) +- if( header->compression == rtiff_we_decompress[i] ) { ++ for (i = 0; i < VIPS_NUMBER(rtiff_we_decompress); i++) ++ if (header->compression == rtiff_we_decompress[i]) { + #ifdef DEBUG +- printf( "rtiff_header_read: " +- "compression %d handled by us\n", +- header->compression ); ++ printf("rtiff_header_read: " ++ "compression %d handled by us\n", ++ header->compression); + #endif /*DEBUG*/ + header->we_decompress = TRUE; + break; +@@ -2800,188 +2807,188 @@ rtiff_header_read( Rtiff *rtiff, RtiffHeader *header ) + + /* We must set this here since it'll change the value of scanline_size. + */ +- rtiff_set_decode_format( rtiff ); ++ rtiff_set_decode_format(rtiff); + + /* Request YCbCr expansion. libtiff complains if you do this for + * non-jpg images. We must set this here since it changes the result + * of scanline_size. + */ +- if( header->compression != COMPRESSION_JPEG && +- header->photometric_interpretation == PHOTOMETRIC_YCBCR ) { ++ if (header->compression != COMPRESSION_JPEG && ++ header->photometric_interpretation == PHOTOMETRIC_YCBCR) { + /* We rely on the jpg decompressor to upsample chroma + * subsampled images. If there is chroma subsampling but + * no jpg compression, we have to give up. + * + * tiffcp fails for images like this too. + */ +- guint16 hsub, vsub; +- +- TIFFGetFieldDefaulted( rtiff->tiff, +- TIFFTAG_YCBCRSUBSAMPLING, &hsub, &vsub ); +- if( hsub != 1 || +- vsub != 1 ) { +- vips_error( "tiff2vips", +- "%s", _( "subsampled images not supported" ) ); +- return( -1 ); +- } +- } +- +- if( header->photometric_interpretation == PHOTOMETRIC_LOGLUV ) { +- if( header->compression != COMPRESSION_SGILOG && +- header->compression != COMPRESSION_SGILOG24 ) { +- vips_error( "tiff2vips", +- "%s", _( "not SGI-compressed LOGLUV" ) ); +- return( -1 ); ++ guint16 hsub, vsub; ++ ++ TIFFGetFieldDefaulted(rtiff->tiff, ++ TIFFTAG_YCBCRSUBSAMPLING, &hsub, &vsub); ++ if (hsub != 1 || ++ vsub != 1) { ++ vips_error("tiff2vips", ++ "%s", _("subsampled images not supported")); ++ return (-1); ++ } ++ } ++ ++ if (header->photometric_interpretation == PHOTOMETRIC_LOGLUV) { ++ if (header->compression != COMPRESSION_SGILOG && ++ header->compression != COMPRESSION_SGILOG24) { ++ vips_error("tiff2vips", ++ "%s", _("not SGI-compressed LOGLUV")); ++ return (-1); + } + } + + /* For logluv, the calibration factor to get to absolute luminance. + */ +- if( !TIFFGetField( rtiff->tiff, TIFFTAG_STONITS, &header->stonits ) ) ++ if (!TIFFGetField(rtiff->tiff, TIFFTAG_STONITS, &header->stonits)) + header->stonits = 1.0; + + /* Arbitrary sanity-checking limits. + */ +- if( header->width <= 0 || ++ if (header->width <= 0 || + header->width >= VIPS_MAX_COORD || + header->height <= 0 || +- header->height >= VIPS_MAX_COORD ) { +- vips_error( "tiff2vips", +- "%s", _( "width/height out of range" ) ); +- return( -1 ); ++ header->height >= VIPS_MAX_COORD) { ++ vips_error("tiff2vips", ++ "%s", _("width/height out of range")); ++ return (-1); + } + +- if( header->samples_per_pixel <= 0 || +- header->samples_per_pixel > 10000 || +- header->bits_per_sample <= 0 || +- header->bits_per_sample > 32 ) { +- vips_error( "tiff2vips", +- "%s", _( "samples out of range" ) ); +- return( -1 ); ++ if (header->samples_per_pixel <= 0 || ++ header->samples_per_pixel > 10000 || ++ header->bits_per_sample <= 0 || ++ header->bits_per_sample > 32) { ++ vips_error("tiff2vips", ++ "%s", _("samples out of range")); ++ return (-1); + } + +- header->sample_format = get_sample_format( rtiff->tiff ); +- header->orientation = get_orientation( rtiff->tiff ); ++ header->sample_format = get_sample_format(rtiff->tiff); ++ header->orientation = get_orientation(rtiff->tiff); + +- header->separate = FALSE; +- if( tfexists( rtiff->tiff, TIFFTAG_PLANARCONFIG ) ) { +- int v; ++ header->separate = FALSE; ++ if (tfexists(rtiff->tiff, TIFFTAG_PLANARCONFIG)) { ++ int v; + +- if( !tfget16( rtiff->tiff, TIFFTAG_PLANARCONFIG, &v ) ) +- return( -1 ); +- if( v == PLANARCONFIG_SEPARATE ) +- header->separate = TRUE; ++ if (!tfget16(rtiff->tiff, TIFFTAG_PLANARCONFIG, &v)) ++ return (-1); ++ if (v == PLANARCONFIG_SEPARATE) ++ header->separate = TRUE; + } + + /* TIFFGetField needs a guint16 to write count to. + */ +- if( TIFFGetField( rtiff->tiff, TIFFTAG_SUBIFD, +- &subifd_count, &subifd_offsets ) ) ++ if (TIFFGetField(rtiff->tiff, TIFFTAG_SUBIFD, ++ &subifd_count, &subifd_offsets)) + header->subifd_count = subifd_count; + +- /* IMAGEDESCRIPTION often has useful metadata. libtiff makes sure +- * that data is null-terminated and contains no embedded null ++ /* IMAGEDESCRIPTION often has useful metadata. libtiff makes sure ++ * that data is null-terminated and contains no embedded null + * characters. + */ +- if( TIFFGetField( rtiff->tiff, +- TIFFTAG_IMAGEDESCRIPTION, &image_description ) ) +- header->image_description = +- vips_strdup( VIPS_OBJECT( rtiff->out ), +- image_description ); ++ if (TIFFGetField(rtiff->tiff, ++ TIFFTAG_IMAGEDESCRIPTION, &image_description)) ++ header->image_description = ++ vips_strdup(VIPS_OBJECT(rtiff->out), ++ image_description); + + /* Tiles and strip images have slightly different fields. + */ +- header->tiled = TIFFIsTiled( rtiff->tiff ); ++ header->tiled = TIFFIsTiled(rtiff->tiff); + + #ifdef DEBUG +- printf( "rtiff_header_read: header.width = %d\n", +- header->width ); +- printf( "rtiff_header_read: header.height = %d\n", +- header->height ); +- printf( "rtiff_header_read: header.samples_per_pixel = %d\n", +- header->samples_per_pixel ); +- printf( "rtiff_header_read: header.bits_per_sample = %d\n", +- header->bits_per_sample ); +- printf( "rtiff_header_read: header.sample_format = %d\n", +- header->sample_format ); +- printf( "rtiff_header_read: header.orientation = %d\n", +- header->orientation ); +- printf( "rtiff_header_read: header.tiled = %d\n", +- header->tiled ); ++ printf("rtiff_header_read: header.width = %d\n", ++ header->width); ++ printf("rtiff_header_read: header.height = %d\n", ++ header->height); ++ printf("rtiff_header_read: header.samples_per_pixel = %d\n", ++ header->samples_per_pixel); ++ printf("rtiff_header_read: header.bits_per_sample = %d\n", ++ header->bits_per_sample); ++ printf("rtiff_header_read: header.sample_format = %d\n", ++ header->sample_format); ++ printf("rtiff_header_read: header.orientation = %d\n", ++ header->orientation); ++ printf("rtiff_header_read: header.tiled = %d\n", ++ header->tiled); + #endif /*DEBUG*/ + +- if( header->tiled ) { +- if( !tfget32( rtiff->tiff, +- TIFFTAG_TILEWIDTH, &header->tile_width ) || +- !tfget32( rtiff->tiff, +- TIFFTAG_TILELENGTH, &header->tile_height ) ) +- return( -1 ); ++ if (header->tiled) { ++ if (!tfget32(rtiff->tiff, ++ TIFFTAG_TILEWIDTH, &header->tile_width) || ++ !tfget32(rtiff->tiff, ++ TIFFTAG_TILELENGTH, &header->tile_height)) ++ return (-1); + + #ifdef DEBUG +- printf( "rtiff_header_read: header.tile_width = %d\n", +- header->tile_width ); +- printf( "rtiff_header_read: header.tile_height = %d\n", +- header->tile_height ); ++ printf("rtiff_header_read: header.tile_width = %d\n", ++ header->tile_width); ++ printf("rtiff_header_read: header.tile_height = %d\n", ++ header->tile_height); + #endif /*DEBUG*/ + + /* Arbitrary sanity-checking limits. + */ +- if( header->tile_width <= 0 || ++ if (header->tile_width <= 0 || + header->tile_width > 10000 || + header->tile_height <= 0 || +- header->tile_height > 10000 ) { +- vips_error( "tiff2vips", +- "%s", _( "tile size out of range" ) ); +- return( -1 ); ++ header->tile_height > 10000) { ++ vips_error("tiff2vips", ++ "%s", _("tile size out of range")); ++ return (-1); + } + +- header->tile_size = TIFFTileSize( rtiff->tiff ); +- header->tile_row_size = TIFFTileRowSize( rtiff->tiff ); ++ header->tile_size = TIFFTileSize(rtiff->tiff); ++ header->tile_row_size = TIFFTileRowSize(rtiff->tiff); + + #ifdef DEBUG +- printf( "rtiff_header_read: header.tile_size = %zd\n", +- header->tile_size ); +- printf( "rtiff_header_read: header.tile_row_size = %zd\n", +- header->tile_row_size ); ++ printf("rtiff_header_read: header.tile_size = %zd\n", ++ header->tile_size); ++ printf("rtiff_header_read: header.tile_row_size = %zd\n", ++ header->tile_row_size); + #endif /*DEBUG*/ + + /* Fuzzed TIFFs can give crazy values for tile_size. Sanity + * check at 100mb per tile. + */ +- if( header->tile_size <= 0 || ++ if (header->tile_size <= 0 || + header->tile_size > 100 * 1000 * 1000 || + header->tile_row_size <= 0 || +- header->tile_row_size > 100 * 1000 * 1000 ) { +- vips_error( "tiff2vips", +- "%s", _( "tile size out of range" ) ); +- return( -1 ); ++ header->tile_row_size > 100 * 1000 * 1000) { ++ vips_error("tiff2vips", ++ "%s", _("tile size out of range")); ++ return (-1); + } + + /* Stop some compiler warnings. + */ +- header->rows_per_strip = 0; +- header->strip_size = 0; +- header->number_of_strips = 0; ++ header->rows_per_strip = 0; ++ header->strip_size = 0; ++ header->number_of_strips = 0; + header->read_height = 0; + header->read_size = 0; + } + else { +- if( !tfget32( rtiff->tiff, +- TIFFTAG_ROWSPERSTRIP, &header->rows_per_strip ) ) +- return( -1 ); +- header->strip_size = TIFFStripSize( rtiff->tiff ); +- header->scanline_size = TIFFScanlineSize( rtiff->tiff ); +- header->number_of_strips = TIFFNumberOfStrips( rtiff->tiff ); ++ if (!tfget32(rtiff->tiff, ++ TIFFTAG_ROWSPERSTRIP, &header->rows_per_strip)) ++ return (-1); ++ header->strip_size = TIFFStripSize(rtiff->tiff); ++ header->scanline_size = TIFFScanlineSize(rtiff->tiff); ++ header->number_of_strips = TIFFNumberOfStrips(rtiff->tiff); + + #ifdef DEBUG +- printf( "rtiff_header_read: header.rows_per_strip = %d\n", +- header->rows_per_strip ); +- printf( "rtiff_header_read: header.strip_size = %zd\n", +- header->strip_size ); +- printf( "rtiff_header_read: header.scanline_size = %zd\n", +- header->scanline_size ); +- printf( "rtiff_header_read: header.number_of_strips = %d\n", +- header->number_of_strips ); ++ printf("rtiff_header_read: header.rows_per_strip = %d\n", ++ header->rows_per_strip); ++ printf("rtiff_header_read: header.strip_size = %zd\n", ++ header->strip_size); ++ printf("rtiff_header_read: header.scanline_size = %zd\n", ++ header->scanline_size); ++ printf("rtiff_header_read: header.number_of_strips = %d\n", ++ header->number_of_strips); + #endif /*DEBUG*/ + + /* libtiff has two strip-wise readers. TIFFReadEncodedStrip() +@@ -3000,10 +3007,10 @@ rtiff_header_read( Rtiff *rtiff, RtiffHeader *header ) + * TIFFScanlineSize() will not work in this case due to + * chroma subsampling. + */ +- if( header->rows_per_strip > 128 && ++ if (header->rows_per_strip > 128 && + !header->separate && +- header->photometric_interpretation != +- PHOTOMETRIC_YCBCR ) { ++ header->photometric_interpretation != ++ PHOTOMETRIC_YCBCR) { + header->read_scanlinewise = TRUE; + header->read_height = 1; + header->read_size = rtiff->header.scanline_size; +@@ -3011,24 +3018,24 @@ rtiff_header_read( Rtiff *rtiff, RtiffHeader *header ) + else { + header->read_scanlinewise = FALSE; + +- /* rows_per_strip can be 2 ** 32 - 1, meaning the +- * whole image. Clip this down to height to avoid +- * confusing vips. ++ /* rows_per_strip can be 2 ** 32 - 1, meaning the ++ * whole image. Clip this down to height to avoid ++ * confusing vips. + * + * And it musn't be zero. + */ +- header->read_height = VIPS_CLIP( 1, +- header->rows_per_strip, header->height ); ++ header->read_height = VIPS_CLIP(1, ++ header->rows_per_strip, header->height); + header->read_size = header->strip_size; + } + + #ifdef DEBUG +- printf( "rtiff_header_read: header.read_scanlinewise = %d\n", +- header->read_scanlinewise ); +- printf( "rtiff_header_read: header.read_height = %d\n", +- header->read_height ); +- printf( "rtiff_header_read: header.read_size = %zd\n", +- header->read_size ); ++ printf("rtiff_header_read: header.read_scanlinewise = %d\n", ++ header->read_scanlinewise); ++ printf("rtiff_header_read: header.read_height = %d\n", ++ header->read_height); ++ printf("rtiff_header_read: header.read_size = %zd\n", ++ header->read_size); + #endif /*DEBUG*/ + + /* Stop some compiler warnings. +@@ -3039,108 +3046,109 @@ rtiff_header_read( Rtiff *rtiff, RtiffHeader *header ) + header->tile_row_size = 0; + } + +- TIFFGetFieldDefaulted( rtiff->tiff, TIFFTAG_EXTRASAMPLES, +- &extra_samples_count, &extra_samples_types ); ++ TIFFGetFieldDefaulted(rtiff->tiff, TIFFTAG_EXTRASAMPLES, ++ &extra_samples_count, &extra_samples_types); + + header->alpha_band = -1; +- if( extra_samples_count > 0 ) { +- /* There must be exactly one band which is +- * EXTRASAMPLE_ASSOCALPHA. Note which one it is so we can ++ if (extra_samples_count > 0) { ++ /* There must be exactly one band which is ++ * EXTRASAMPLE_ASSOCALPHA. Note which one it is so we can + * unpremultiply with the right channel. + */ + int i; + +- for( i = 0; i < extra_samples_count; i++ ) +- if( extra_samples_types[i] == EXTRASAMPLE_ASSOCALPHA ) { +- if( header->alpha_band != -1 ) +- g_warning( "%s", _( "more than one " +- "alpha -- ignoring" ) ); ++ for (i = 0; i < extra_samples_count; i++) ++ if (extra_samples_types[i] == EXTRASAMPLE_ASSOCALPHA) { ++ if (header->alpha_band != -1) ++ g_warning("%s", _("more than one " ++ "alpha -- ignoring")); + + header->alpha_band = header->samples_per_pixel - + extra_samples_count + i; + } + } + +- return( 0 ); ++ return (0); + } + + static int +-rtiff_header_equal( RtiffHeader *h1, RtiffHeader *h2 ) ++rtiff_header_equal(RtiffHeader *h1, RtiffHeader *h2) + { +- if( h1->width != h2->width || ++ if (h1->width != h2->width || + h1->height != h2->height || + h1->samples_per_pixel != h2->samples_per_pixel || + h1->bits_per_sample != h2->bits_per_sample || +- h1->photometric_interpretation != ++ h1->photometric_interpretation != + h2->photometric_interpretation || + h1->sample_format != h2->sample_format || + h1->compression != h2->compression || + h1->separate != h2->separate || + h1->tiled != h2->tiled || +- h1->orientation != h2->orientation ) +- return( 0 ); ++ h1->orientation != h2->orientation) ++ return (0); + +- if( h1->tiled ) { +- if( h1->tile_width != h2->tile_width || +- h1->tile_height != h2->tile_height ) +- return( 0 ); ++ if (h1->tiled) { ++ if (h1->tile_width != h2->tile_width || ++ h1->tile_height != h2->tile_height) ++ return (0); + } + else { +- if( h1->read_height != h2->read_height || ++ if (h1->read_height != h2->read_height || + h1->read_size != h2->read_size || +- h1->number_of_strips != h2->number_of_strips ) +- return( 0 ); ++ h1->number_of_strips != h2->number_of_strips) ++ return (0); + } + +- return( 1 ); ++ return (1); + } + + static int +-rtiff_header_read_all( Rtiff *rtiff ) ++rtiff_header_read_all(Rtiff *rtiff) + { + #ifdef DEBUG +- printf( "rtiff_header_read_all: " +- "reading header for page %d ...\n", rtiff->page ); ++ printf("rtiff_header_read_all: " ++ "reading header for page %d ...\n", ++ rtiff->page); + #endif /*DEBUG*/ + +- /* -1 means "to the end". ++ /* -1 means "to the end". + * +- * We must count pages before selecting and reading the header of the +- * first page, since scanning a TIFF can change the value of libtiff's +- * internal header fields in strange ways, especially if the TIFF is +- * corrupt. ++ * We must count pages before selecting and reading the header of the ++ * first page, since scanning a TIFF can change the value of libtiff's ++ * internal header fields in strange ways, especially if the TIFF is ++ * corrupt. + */ +- rtiff->n_pages = rtiff_n_pages( rtiff ); ++ rtiff->n_pages = rtiff_n_pages(rtiff); + +- if( rtiff_set_page( rtiff, rtiff->page ) || +- rtiff_header_read( rtiff, &rtiff->header ) ) +- return( -1 ); ++ if (rtiff_set_page(rtiff, rtiff->page) || ++ rtiff_header_read(rtiff, &rtiff->header)) ++ return (-1); + +- /* If we're to read many pages, verify that they are all identical. ++ /* If we're to read many pages, verify that they are all identical. + */ +- if( rtiff->n == -1 ) ++ if (rtiff->n == -1) + rtiff->n = rtiff->n_pages - rtiff->page; +- if( rtiff->n > 1 ) { ++ if (rtiff->n > 1) { + int i; + +- for( i = 1; i < rtiff->n; i++ ) { ++ for (i = 1; i < rtiff->n; i++) { + RtiffHeader header; + + #ifdef DEBUG +- printf( "rtiff_header_read_all: " +- "verifying header for page %d ...\n", +- rtiff->page + i ); ++ printf("rtiff_header_read_all: " ++ "verifying header for page %d ...\n", ++ rtiff->page + i); + #endif /*DEBUG*/ + +- if( rtiff_set_page( rtiff, rtiff->page + i ) || +- rtiff_header_read( rtiff, &header ) ) +- return( -1 ); ++ if (rtiff_set_page(rtiff, rtiff->page + i) || ++ rtiff_header_read(rtiff, &header)) ++ return (-1); + +- if( !rtiff_header_equal( &rtiff->header, &header ) ) { +- vips_error( "tiff2vips", +- _( "page %d differs from page %d" ), +- rtiff->page + i, rtiff->page ); +- return( -1 ); ++ if (!rtiff_header_equal(&rtiff->header, &header)) { ++ vips_error("tiff2vips", ++ _("page %d differs from page %d"), ++ rtiff->page + i, rtiff->page); ++ return (-1); + } + } + +@@ -3149,105 +3157,105 @@ rtiff_header_read_all( Rtiff *rtiff ) + rtiff->current_page = -1; + } + +- return( 0 ); ++ return (0); + } + +-typedef gboolean (*TiffPropertyFn)( TIFF *tif ); ++typedef gboolean (*TiffPropertyFn)(TIFF *tif); + + static gboolean +-vips__testtiff_source( VipsSource *source, TiffPropertyFn fn ) ++vips__testtiff_source(VipsSource *source, TiffPropertyFn fn) + { + TIFF *tif; + gboolean property; + + vips__tiff_init(); + +- if( !(tif = vips__tiff_openin_source( source )) ) { ++ if (!(tif = vips__tiff_openin_source(source))) { + vips_error_clear(); +- return( FALSE ); ++ return (FALSE); + } + +- property = fn ? fn( tif ) : TRUE; ++ property = fn ? fn(tif) : TRUE; + +- TIFFClose( tif ); ++ TIFFClose(tif); + +- return( property ); ++ return (property); + } + + gboolean +-vips__istiff_source( VipsSource *source ) ++vips__istiff_source(VipsSource *source) + { +- return( vips__testtiff_source( source, NULL ) ); ++ return (vips__testtiff_source(source, NULL)); + } + + gboolean +-vips__istifftiled_source( VipsSource *source ) ++vips__istifftiled_source(VipsSource *source) + { +- return( vips__testtiff_source( source, TIFFIsTiled ) ); ++ return (vips__testtiff_source(source, TIFFIsTiled)); + } + + int +-vips__tiff_read_header_source( VipsSource *source, VipsImage *out, +- int page, int n, gboolean autorotate, int subifd, VipsFailOn fail_on ) ++vips__tiff_read_header_source(VipsSource *source, VipsImage *out, ++ int page, int n, gboolean autorotate, int subifd, VipsFailOn fail_on) + { + Rtiff *rtiff; + + vips__tiff_init(); + +- if( !(rtiff = rtiff_new( source, out, +- page, n, autorotate, subifd, fail_on )) || +- rtiff_header_read_all( rtiff ) ) +- return( -1 ); ++ if (!(rtiff = rtiff_new(source, out, ++ page, n, autorotate, subifd, fail_on)) || ++ rtiff_header_read_all(rtiff)) ++ return (-1); + +- if( rtiff_set_header( rtiff, out ) ) +- return( -1 ); ++ if (rtiff_set_header(rtiff, out)) ++ return (-1); + +- if( rtiff->autorotate && +- vips_image_get_orientation_swap( out ) ) { +- VIPS_SWAP( int, out->Xsize, out->Ysize ); +- vips_autorot_remove_angle( out ); ++ if (rtiff->autorotate && ++ vips_image_get_orientation_swap(out)) { ++ VIPS_SWAP(int, out->Xsize, out->Ysize); ++ vips_autorot_remove_angle(out); + } + + /* We never call vips_source_decode() since we need to be able to + * seek() the whole way through the file. Just minimise instead, + */ +- vips_source_minimise( source ); ++ vips_source_minimise(source); + +- return( 0 ); ++ return (0); + } + + int +-vips__tiff_read_source( VipsSource *source, VipsImage *out, +- int page, int n, gboolean autorotate, int subifd, VipsFailOn fail_on ) ++vips__tiff_read_source(VipsSource *source, VipsImage *out, ++ int page, int n, gboolean autorotate, int subifd, VipsFailOn fail_on) + { + Rtiff *rtiff; + + #ifdef DEBUG +- printf( "tiff2vips: libtiff version is \"%s\"\n", TIFFGetVersion() ); ++ printf("tiff2vips: libtiff version is \"%s\"\n", TIFFGetVersion()); + #endif /*DEBUG*/ + + vips__tiff_init(); + +- if( !(rtiff = rtiff_new( source, out, +- page, n, autorotate, subifd, fail_on )) || +- rtiff_header_read_all( rtiff ) ) +- return( -1 ); ++ if (!(rtiff = rtiff_new(source, out, ++ page, n, autorotate, subifd, fail_on)) || ++ rtiff_header_read_all(rtiff)) ++ return (-1); + +- if( rtiff->header.tiled ) { +- if( rtiff_read_tilewise( rtiff, out ) ) +- return( -1 ); ++ if (rtiff->header.tiled) { ++ if (rtiff_read_tilewise(rtiff, out)) ++ return (-1); + } + else { +- if( rtiff_read_stripwise( rtiff, out ) ) +- return( -1 ); ++ if (rtiff_read_stripwise(rtiff, out)) ++ return (-1); + } + + /* We never call vips_source_decode() since we need to be able to + * seek() the whole way through the file. Just minimise instead, + */ +- vips_source_minimise( source ); ++ vips_source_minimise(source); + +- return( 0 ); ++ return (0); + } + + #endif /*HAVE_TIFF*/ +diff --git a/libvips/foreign/tiffload.c b/libvips/foreign/tiffload.c +index 33f0e2c351..e6e916fa17 100644 +--- a/libvips/foreign/tiffload.c ++++ b/libvips/foreign/tiffload.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -61,11 +61,11 @@ typedef struct _VipsForeignLoadTiff { + */ + VipsSource *source; + +- /* Load this page. ++ /* Load this page. + */ + int page; + +- /* Load this many pages. ++ /* Load this many pages. + */ + int n; + +@@ -81,86 +81,85 @@ typedef struct _VipsForeignLoadTiff { + + typedef VipsForeignLoadClass VipsForeignLoadTiffClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadTiff, vips_foreign_load_tiff, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadTiff, vips_foreign_load_tiff, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_tiff_dispose( GObject *gobject ) ++vips_foreign_load_tiff_dispose(GObject *gobject) + { + VipsForeignLoadTiff *tiff = (VipsForeignLoadTiff *) gobject; + +- VIPS_UNREF( tiff->source ); ++ VIPS_UNREF(tiff->source); + +- G_OBJECT_CLASS( vips_foreign_load_tiff_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_tiff_parent_class)->dispose(gobject); + } + + static VipsForeignFlags +-vips_foreign_load_tiff_get_flags_source( VipsSource *source ) ++vips_foreign_load_tiff_get_flags_source(VipsSource *source) + { + VipsForeignFlags flags; + + flags = 0; +- if( vips__istifftiled_source( source ) ) ++ if (vips__istifftiled_source(source)) + flags |= VIPS_FOREIGN_PARTIAL; + else + flags |= VIPS_FOREIGN_SEQUENTIAL; + +- return( flags ); ++ return (flags); + } + + static VipsForeignFlags +-vips_foreign_load_tiff_get_flags_filename( const char *filename ) ++vips_foreign_load_tiff_get_flags_filename(const char *filename) + { + VipsSource *source; + VipsForeignFlags flags; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( 0 ); +- flags = vips_foreign_load_tiff_get_flags_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (0); ++ flags = vips_foreign_load_tiff_get_flags_source(source); ++ VIPS_UNREF(source); + +- return( flags ); ++ return (flags); + } + + static VipsForeignFlags +-vips_foreign_load_tiff_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_tiff_get_flags(VipsForeignLoad *load) + { + VipsForeignLoadTiff *tiff = (VipsForeignLoadTiff *) load; + +- return( vips_foreign_load_tiff_get_flags_source( tiff->source ) ); ++ return (vips_foreign_load_tiff_get_flags_source(tiff->source)); + } + + static int +-vips_foreign_load_tiff_header( VipsForeignLoad *load ) ++vips_foreign_load_tiff_header(VipsForeignLoad *load) + { + VipsForeignLoadTiff *tiff = (VipsForeignLoadTiff *) load; + +- if( vips__tiff_read_header_source( tiff->source, load->out, +- tiff->page, tiff->n, tiff->autorotate, tiff->subifd, +- load->fail_on ) ) +- return( -1 ); ++ if (vips__tiff_read_header_source(tiff->source, load->out, ++ tiff->page, tiff->n, tiff->autorotate, tiff->subifd, ++ load->fail_on)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_tiff_load( VipsForeignLoad *load ) ++vips_foreign_load_tiff_load(VipsForeignLoad *load) + { + VipsForeignLoadTiff *tiff = (VipsForeignLoadTiff *) load; + +- if( vips__tiff_read_source( tiff->source, load->real, +- tiff->page, tiff->n, tiff->autorotate, tiff->subifd, +- load->fail_on ) ) +- return( -1 ); ++ if (vips__tiff_read_source(tiff->source, load->real, ++ tiff->page, tiff->n, tiff->autorotate, tiff->subifd, ++ load->fail_on)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_tiff_class_init( VipsForeignLoadTiffClass *class ) ++vips_foreign_load_tiff_class_init(VipsForeignLoadTiffClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -177,54 +176,53 @@ vips_foreign_load_tiff_class_init( VipsForeignLoadTiffClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "tiffload_base"; +- object_class->description = _( "load tiff" ); ++ object_class->description = _("load tiff"); + + /* We are fast, but must test after openslideload. + */ + foreign_class->priority = 50; + +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_tiff_get_flags_filename; + load_class->get_flags = vips_foreign_load_tiff_get_flags; + load_class->header = vips_foreign_load_tiff_header; + load_class->load = vips_foreign_load_tiff_load; + +- VIPS_ARG_INT( class, "page", 20, +- _( "Page" ), +- _( "First page to load" ), ++ VIPS_ARG_INT(class, "page", 20, ++ _("Page"), ++ _("First page to load"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadTiff, page ), +- 0, 100000, 0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadTiff, page), ++ 0, 100000, 0); + +- VIPS_ARG_INT( class, "n", 21, +- _( "n" ), +- _( "Number of pages to load, -1 for all" ), ++ VIPS_ARG_INT(class, "n", 21, ++ _("n"), ++ _("Number of pages to load, -1 for all"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadTiff, n ), +- -1, 100000, 1 ); ++ G_STRUCT_OFFSET(VipsForeignLoadTiff, n), ++ -1, 100000, 1); + +- VIPS_ARG_BOOL( class, "autorotate", 22, +- _( "Autorotate" ), +- _( "Rotate image using orientation tag" ), ++ VIPS_ARG_BOOL(class, "autorotate", 22, ++ _("Autorotate"), ++ _("Rotate image using orientation tag"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadTiff, autorotate ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignLoadTiff, autorotate), ++ FALSE); + +- VIPS_ARG_INT( class, "subifd", 21, +- _( "subifd" ), +- _( "Subifd index" ), ++ VIPS_ARG_INT(class, "subifd", 21, ++ _("subifd"), ++ _("Subifd index"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadTiff, subifd ), +- -1, 100000, -1 ); +- ++ G_STRUCT_OFFSET(VipsForeignLoadTiff, subifd), ++ -1, 100000, -1); + } + + static void +-vips_foreign_load_tiff_init( VipsForeignLoadTiff *tiff ) ++vips_foreign_load_tiff_init(VipsForeignLoadTiff *tiff) + { +- tiff->page = 0; +- tiff->n = 1; +- tiff->subifd = -1; ++ tiff->page = 0; ++ tiff->n = 1; ++ tiff->subifd = -1; + } + + typedef struct _VipsForeignLoadTiffSource { +@@ -238,65 +236,63 @@ typedef struct _VipsForeignLoadTiffSource { + + typedef VipsForeignLoadTiffClass VipsForeignLoadTiffSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadTiffSource, vips_foreign_load_tiff_source, +- vips_foreign_load_tiff_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadTiffSource, vips_foreign_load_tiff_source, ++ vips_foreign_load_tiff_get_type()); + + static int +-vips_foreign_load_tiff_source_build( VipsObject *object ) ++vips_foreign_load_tiff_source_build(VipsObject *object) + { + VipsForeignLoadTiff *tiff = (VipsForeignLoadTiff *) object; +- VipsForeignLoadTiffSource *source = ++ VipsForeignLoadTiffSource *source = + (VipsForeignLoadTiffSource *) object; + +- if( source->source ) { ++ if (source->source) { + tiff->source = source->source; +- g_object_ref( tiff->source ); ++ g_object_ref(tiff->source); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_tiff_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_tiff_source_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_tiff_source_is_a_source( VipsSource *source ) ++vips_foreign_load_tiff_source_is_a_source(VipsSource *source) + { +- return( vips__istiff_source( source ) ); ++ return (vips__istiff_source(source)); + } + + static void +-vips_foreign_load_tiff_source_class_init( +- VipsForeignLoadTiffSourceClass *class ) ++vips_foreign_load_tiff_source_class_init( ++ VipsForeignLoadTiffSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "tiffload_source"; +- object_class->description = _( "load tiff from source" ); ++ object_class->description = _("load tiff from source"); + object_class->build = vips_foreign_load_tiff_source_build; + + operation_class->flags |= VIPS_OPERATION_NOCACHE; + + load_class->is_a_source = vips_foreign_load_tiff_source_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadTiffSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadTiffSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_tiff_source_init( VipsForeignLoadTiffSource *source ) ++vips_foreign_load_tiff_source_init(VipsForeignLoadTiffSource *source) + { + } + +@@ -305,53 +301,52 @@ typedef struct _VipsForeignLoadTiffFile { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadTiffFile; + + typedef VipsForeignLoadTiffClass VipsForeignLoadTiffFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadTiffFile, vips_foreign_load_tiff_file, +- vips_foreign_load_tiff_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadTiffFile, vips_foreign_load_tiff_file, ++ vips_foreign_load_tiff_get_type()); + + static int +-vips_foreign_load_tiff_file_build( VipsObject *object ) ++vips_foreign_load_tiff_file_build(VipsObject *object) + { + VipsForeignLoadTiff *tiff = (VipsForeignLoadTiff *) object; + VipsForeignLoadTiffFile *file = (VipsForeignLoadTiffFile *) object; + +- if( file->filename && +- !(tiff->source = +- vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(tiff->source = ++ vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_tiff_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_tiff_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_tiff_file_is_a( const char *filename ) ++vips_foreign_load_tiff_file_is_a(const char *filename) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( FALSE ); +- result = vips_foreign_load_tiff_source_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (FALSE); ++ result = vips_foreign_load_tiff_source_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + const char *vips__foreign_tiff_suffs[] = { ".tif", ".tiff", NULL }; + + static void +-vips_foreign_load_tiff_file_class_init( VipsForeignLoadTiffFileClass *class ) ++vips_foreign_load_tiff_file_class_init(VipsForeignLoadTiffFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -360,23 +355,23 @@ vips_foreign_load_tiff_file_class_init( VipsForeignLoadTiffFileClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "tiffload"; +- object_class->description = _( "load tiff from file" ); ++ object_class->description = _("load tiff from file"); + object_class->build = vips_foreign_load_tiff_file_build; + + foreign_class->suffs = vips__foreign_tiff_suffs; + + load_class->is_a = vips_foreign_load_tiff_file_is_a; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadTiffFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadTiffFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_tiff_file_init( VipsForeignLoadTiffFile *file ) ++vips_foreign_load_tiff_file_init(VipsForeignLoadTiffFile *file) + { + } + +@@ -391,48 +386,47 @@ typedef struct _VipsForeignLoadTiffBuffer { + + typedef VipsForeignLoadTiffClass VipsForeignLoadTiffBufferClass; + +-G_DEFINE_TYPE( VipsForeignLoadTiffBuffer, vips_foreign_load_tiff_buffer, +- vips_foreign_load_tiff_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadTiffBuffer, vips_foreign_load_tiff_buffer, ++ vips_foreign_load_tiff_get_type()); + + static int +-vips_foreign_load_tiff_buffer_build( VipsObject *object ) ++vips_foreign_load_tiff_buffer_build(VipsObject *object) + { + VipsForeignLoadTiff *tiff = (VipsForeignLoadTiff *) object; +- VipsForeignLoadTiffBuffer *buffer = ++ VipsForeignLoadTiffBuffer *buffer = + (VipsForeignLoadTiffBuffer *) object; + +- if( buffer->blob && +- !(tiff->source = vips_source_new_from_memory( +- VIPS_AREA( buffer->blob )->data, +- VIPS_AREA( buffer->blob )->length )) ) +- return( -1 ); ++ if (buffer->blob && ++ !(tiff->source = vips_source_new_from_memory( ++ VIPS_AREA(buffer->blob)->data, ++ VIPS_AREA(buffer->blob)->length))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_tiff_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_tiff_buffer_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_tiff_buffer_is_a_buffer( const void *buf, size_t len ) ++vips_foreign_load_tiff_buffer_is_a_buffer(const void *buf, size_t len) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_memory( buf, len )) ) +- return( FALSE ); +- result = vips_foreign_load_tiff_source_is_a_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_memory(buf, len))) ++ return (FALSE); ++ result = vips_foreign_load_tiff_source_is_a_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static void +-vips_foreign_load_tiff_buffer_class_init( +- VipsForeignLoadTiffBufferClass *class ) ++vips_foreign_load_tiff_buffer_class_init( ++ VipsForeignLoadTiffBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -440,21 +434,21 @@ vips_foreign_load_tiff_buffer_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "tiffload_buffer"; +- object_class->description = _( "load tiff from buffer" ); ++ object_class->description = _("load tiff from buffer"); + object_class->build = vips_foreign_load_tiff_buffer_build; + + load_class->is_a_buffer = vips_foreign_load_tiff_buffer_is_a_buffer; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadTiffBuffer, blob ), +- VIPS_TYPE_BLOB ); ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadTiffBuffer, blob), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_load_tiff_buffer_init( VipsForeignLoadTiffBuffer *buffer ) ++vips_foreign_load_tiff_buffer_init(VipsForeignLoadTiffBuffer *buffer) + { + } + +@@ -470,32 +464,32 @@ vips_foreign_load_tiff_buffer_init( VipsForeignLoadTiffBuffer *buffer ) + * + * * @page: %gint, load this page + * * @n: %gint, load this many pages +- * * @autorotate: %gboolean, use orientation tag to rotate the image ++ * * @autorotate: %gboolean, use orientation tag to rotate the image + * during load + * * @subifd: %gint, select this subifd index + * +- * Read a TIFF file into a VIPS image. It is a full baseline TIFF 6 reader, +- * with extensions for tiled images, multipage images, XYZ and LAB colour ++ * Read a TIFF file into a VIPS image. It is a full baseline TIFF 6 reader, ++ * with extensions for tiled images, multipage images, XYZ and LAB colour + * space, pyramidal images and JPEG compression, including CMYK and YCbCr. + * + * @page means load this page from the file. By default the first page (page +- * 0) is read. ++ * 0) is read. + * + * @n means load this many pages. By default a single page is read. All the + * pages must have the same dimensions, and they are loaded as a tall, thin +- * "toilet roll" image. The #VIPS_META_PAGE_HEIGHT metadata +- * tag gives the height in pixels of each page. Use -1 to load all pages. ++ * "toilet roll" image. The #VIPS_META_PAGE_HEIGHT metadata ++ * tag gives the height in pixels of each page. Use -1 to load all pages. + * +- * Setting @autorotate to %TRUE will make the loader interpret the ++ * Setting @autorotate to %TRUE will make the loader interpret the + * orientation tag and automatically rotate the image appropriately during +- * load. ++ * load. + * +- * If @autorotate is %FALSE, the metadata field #VIPS_META_ORIENTATION is set +- * to the value of the orientation tag. Applications may read and interpret ++ * If @autorotate is %FALSE, the metadata field #VIPS_META_ORIENTATION is set ++ * to the value of the orientation tag. Applications may read and interpret + * this field + * as they wish later in processing. See vips_autorot(). Save + * operations will use #VIPS_META_ORIENTATION, if present, to set the +- * orientation of output images. ++ * orientation of output images. + * + * If @autorotate is TRUE, the image will be rotated upright during load and + * no metadata attached. This can be very slow. +@@ -509,7 +503,7 @@ vips_foreign_load_tiff_buffer_init( VipsForeignLoadTiffBuffer *buffer ) + * #VIPS_META_ICC_NAME. Any XMP metadata is read and attached to the image + * as #VIPS_META_XMP_NAME. Any IPTC is attached as #VIPS_META_IPTC_NAME. The + * image description is +- * attached as #VIPS_META_IMAGEDESCRIPTION. Data in the photoshop tag is ++ * attached as #VIPS_META_IMAGEDESCRIPTION. Data in the photoshop tag is + * attached as #VIPS_META_PHOTOSHOP_NAME. + * + * See also: vips_image_new_from_file(), vips_autorot(). +@@ -517,16 +511,16 @@ vips_foreign_load_tiff_buffer_init( VipsForeignLoadTiffBuffer *buffer ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_tiffload( const char *filename, VipsImage **out, ... ) ++vips_tiffload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "tiffload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("tiffload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -540,22 +534,22 @@ vips_tiffload( const char *filename, VipsImage **out, ... ) + * + * * @page: %gint, load this page + * * @n: %gint, load this many pages +- * * @autorotate: %gboolean, use orientation tag to rotate the image ++ * * @autorotate: %gboolean, use orientation tag to rotate the image + * during load + * * @subifd: %gint, select this subifd index + * + * Read a TIFF-formatted memory block into a VIPS image. Exactly as +- * vips_tiffload(), but read from a memory source. ++ * vips_tiffload(), but read from a memory source. + * +- * You must not free the buffer while @out is active. The +- * #VipsObject::postclose signal on @out is a good place to free. ++ * You must not free the buffer while @out is active. The ++ * #VipsObject::postclose signal on @out is a good place to free. + * + * See also: vips_tiffload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_tiffload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++vips_tiffload_buffer(void *buf, size_t len, VipsImage **out, ...) + { + va_list ap; + VipsBlob *blob; +@@ -563,15 +557,15 @@ vips_tiffload_buffer( void *buf, size_t len, VipsImage **out, ... ) + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, buf, len ); ++ blob = vips_blob_new(NULL, buf, len); + +- va_start( ap, out ); +- result = vips_call_split( "tiffload_buffer", ap, blob, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("tiffload_buffer", ap, blob, out); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( result ); ++ return (result); + } + + /** +@@ -584,25 +578,25 @@ vips_tiffload_buffer( void *buf, size_t len, VipsImage **out, ... ) + * + * * @page: %gint, load this page + * * @n: %gint, load this many pages +- * * @autorotate: %gboolean, use orientation tag to rotate the image ++ * * @autorotate: %gboolean, use orientation tag to rotate the image + * during load + * * @subifd: %gint, select this subifd index + * +- * Exactly as vips_tiffload(), but read from a source. ++ * Exactly as vips_tiffload(), but read from a source. + * + * See also: vips_tiffload(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_tiffload_source( VipsSource *source, VipsImage **out, ... ) ++vips_tiffload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "tiffload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("tiffload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/tiffsave.c b/libvips/foreign/tiffsave.c +index caa38f4dd3..efb4334894 100644 +--- a/libvips/foreign/tiffsave.c ++++ b/libvips/foreign/tiffsave.c +@@ -34,28 +34,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -94,7 +94,7 @@ typedef struct _VipsForeignSaveTiff { + VipsForeignTiffCompression compression; + int Q; + VipsForeignTiffPredictor predictor; +- char *profile; ++ char *profile; + gboolean tile; + int tile_width; + int tile_height; +@@ -119,18 +119,17 @@ typedef struct _VipsForeignSaveTiff { + + typedef VipsForeignSaveClass VipsForeignSaveTiffClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveTiff, vips_foreign_save_tiff, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSaveTiff, vips_foreign_save_tiff, ++ VIPS_TYPE_FOREIGN_SAVE); + + static void +-vips_foreign_save_tiff_dispose( GObject *gobject ) ++vips_foreign_save_tiff_dispose(GObject *gobject) + { + VipsForeignSaveTiff *tiff = (VipsForeignSaveTiff *) gobject; + +- VIPS_UNREF( tiff->target ); ++ VIPS_UNREF(tiff->target); + +- G_OBJECT_CLASS( vips_foreign_save_tiff_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_tiff_parent_class)->dispose(gobject); + } + + #define UC VIPS_FORMAT_UCHAR +@@ -143,9 +142,9 @@ static VipsBandFormat bandfmt_jpeg[10] = { + }; + + static int +-vips_foreign_save_tiff_build( VipsObject *object ) ++vips_foreign_save_tiff_build(VipsObject *object) + { +- VipsForeignSaveClass *class = VIPS_FOREIGN_SAVE_GET_CLASS( object ); ++ VipsForeignSaveClass *class = VIPS_FOREIGN_SAVE_GET_CLASS(object); + + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveTiff *tiff = (VipsForeignSaveTiff *) object; +@@ -156,31 +155,30 @@ vips_foreign_save_tiff_build( VipsObject *object ) + * path. The regular tiff one will let through things like float and + * 16-bit and alpha for example, which will make the jpeg saver choke. + */ +- if( save->in && +- tiff->compression == VIPS_FOREIGN_TIFF_COMPRESSION_JPEG ) { ++ if (save->in && ++ tiff->compression == VIPS_FOREIGN_TIFF_COMPRESSION_JPEG) { + VipsImage *x; + + /* See also vips_foreign_save_jpeg_class_init(). + */ +- if( vips__foreign_convert_saveable( save->in, &x, +- VIPS_SAVEABLE_RGB_CMYK, bandfmt_jpeg, class->coding, +- save->background ) ) +- return( -1 ); ++ if (vips__foreign_convert_saveable(save->in, &x, ++ VIPS_SAVEABLE_RGB_CMYK, bandfmt_jpeg, class->coding, ++ save->background)) ++ return (-1); + +- g_object_set( object, "in", x, NULL ); +- g_object_unref( x ); ++ g_object_set(object, "in", x, NULL); ++ g_object_unref(x); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_tiff_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_tiff_parent_class)->build(object)) ++ return (-1); + + /* Default xres/yres to the values from the image. This is always + * pixels/mm. + */ +- if( !vips_object_argument_isset( object, "xres" ) ) ++ if (!vips_object_argument_isset(object, "xres")) + tiff->xres = save->ready->Xres; +- if( !vips_object_argument_isset( object, "yres" ) ) ++ if (!vips_object_argument_isset(object, "yres")) + tiff->yres = save->ready->Yres; + + /* We default to pixels/cm. +@@ -190,57 +188,57 @@ vips_foreign_save_tiff_build( VipsObject *object ) + + /* resunit param overrides resunit metadata. + */ +- if( !vips_object_argument_isset( object, "resunit" ) && +- vips_image_get_typeof( save->ready, +- VIPS_META_RESOLUTION_UNIT ) && +- !vips_image_get_string( save->ready, +- VIPS_META_RESOLUTION_UNIT, &p ) && +- vips_isprefix( "in", p ) ) ++ if (!vips_object_argument_isset(object, "resunit") && ++ vips_image_get_typeof(save->ready, ++ VIPS_META_RESOLUTION_UNIT) && ++ !vips_image_get_string(save->ready, ++ VIPS_META_RESOLUTION_UNIT, &p) && ++ vips_isprefix("in", p)) + tiff->resunit = VIPS_FOREIGN_TIFF_RESUNIT_INCH; + +- if( tiff->resunit == VIPS_FOREIGN_TIFF_RESUNIT_INCH ) { ++ if (tiff->resunit == VIPS_FOREIGN_TIFF_RESUNIT_INCH) { + tiff->xres *= 2.54; + tiff->yres *= 2.54; + } + +- /* Handle the deprecated squash parameter. ++ /* Handle the deprecated squash parameter. + */ +- if( tiff->squash ) ++ if (tiff->squash) + /* We set that even in the case of LAB to LABQ. + */ + tiff->bitdepth = 1; + +- if( vips__tiff_write_target( save->ready, tiff->target, +- tiff->compression, tiff->Q, tiff->predictor, +- tiff->profile, +- tiff->tile, tiff->tile_width, tiff->tile_height, +- tiff->pyramid, +- tiff->bitdepth, +- tiff->miniswhite, +- tiff->resunit, tiff->xres, tiff->yres, +- tiff->bigtiff, +- tiff->rgbjpeg, +- tiff->properties, +- save->strip, +- tiff->region_shrink, +- tiff->level, +- tiff->lossless, +- tiff->depth, +- tiff->subifd, +- tiff->premultiply, +- save->page_height ) ) +- return( -1 ); +- +- if( vips_target_end( tiff->target ) ) +- return( -1 ); +- +- return( 0 ); ++ if (vips__tiff_write_target(save->ready, tiff->target, ++ tiff->compression, tiff->Q, tiff->predictor, ++ tiff->profile, ++ tiff->tile, tiff->tile_width, tiff->tile_height, ++ tiff->pyramid, ++ tiff->bitdepth, ++ tiff->miniswhite, ++ tiff->resunit, tiff->xres, tiff->yres, ++ tiff->bigtiff, ++ tiff->rgbjpeg, ++ tiff->properties, ++ save->strip, ++ tiff->region_shrink, ++ tiff->level, ++ tiff->lossless, ++ tiff->depth, ++ tiff->subifd, ++ tiff->premultiply, ++ save->page_height)) ++ return (-1); ++ ++ if (vips_target_end(tiff->target)) ++ return (-1); ++ ++ return (0); + } + + static void +-vips_foreign_save_tiff_class_init( VipsForeignSaveTiffClass *class ) ++vips_foreign_save_tiff_class_init(VipsForeignSaveTiffClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; +@@ -250,7 +248,7 @@ vips_foreign_save_tiff_class_init( VipsForeignSaveTiffClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "tiffsave_base"; +- object_class->description = _( "save image as tiff" ); ++ object_class->description = _("save image as tiff"); + object_class->build = vips_foreign_save_tiff_build; + + foreign_class->suffs = vips__foreign_tiff_suffs; +@@ -258,173 +256,172 @@ vips_foreign_save_tiff_class_init( VipsForeignSaveTiffClass *class ) + save_class->saveable = VIPS_SAVEABLE_ANY; + save_class->coding[VIPS_CODING_LABQ] = TRUE; + +- VIPS_ARG_ENUM( class, "compression", 6, +- _( "Compression" ), +- _( "Compression for this file" ), ++ VIPS_ARG_ENUM(class, "compression", 6, ++ _("Compression"), ++ _("Compression for this file"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, compression ), +- VIPS_TYPE_FOREIGN_TIFF_COMPRESSION, +- VIPS_FOREIGN_TIFF_COMPRESSION_NONE ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, compression), ++ VIPS_TYPE_FOREIGN_TIFF_COMPRESSION, ++ VIPS_FOREIGN_TIFF_COMPRESSION_NONE); + +- VIPS_ARG_INT( class, "Q", 7, +- _( "Q" ), +- _( "Q factor" ), ++ VIPS_ARG_INT(class, "Q", 7, ++ _("Q"), ++ _("Q factor"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, Q ), +- 1, 100, 75 ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, Q), ++ 1, 100, 75); + +- VIPS_ARG_ENUM( class, "predictor", 8, +- _( "Predictor" ), +- _( "Compression prediction" ), ++ VIPS_ARG_ENUM(class, "predictor", 8, ++ _("Predictor"), ++ _("Compression prediction"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, predictor ), +- VIPS_TYPE_FOREIGN_TIFF_PREDICTOR, +- VIPS_FOREIGN_TIFF_PREDICTOR_HORIZONTAL ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, predictor), ++ VIPS_TYPE_FOREIGN_TIFF_PREDICTOR, ++ VIPS_FOREIGN_TIFF_PREDICTOR_HORIZONTAL); + +- VIPS_ARG_STRING( class, "profile", 9, +- _( "Profile" ), +- _( "ICC profile to embed" ), ++ VIPS_ARG_STRING(class, "profile", 9, ++ _("Profile"), ++ _("ICC profile to embed"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, profile ), +- NULL ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, profile), ++ NULL); + +- VIPS_ARG_BOOL( class, "tile", 10, +- _( "Tile" ), +- _( "Write a tiled tiff" ), ++ VIPS_ARG_BOOL(class, "tile", 10, ++ _("Tile"), ++ _("Write a tiled tiff"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, tile ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, tile), ++ FALSE); + +- VIPS_ARG_INT( class, "tile_width", 11, +- _( "Tile width" ), +- _( "Tile width in pixels" ), ++ VIPS_ARG_INT(class, "tile_width", 11, ++ _("Tile width"), ++ _("Tile width in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, tile_width ), +- 1, 32768, 128 ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, tile_width), ++ 1, 32768, 128); + +- VIPS_ARG_INT( class, "tile_height", 12, +- _( "Tile height" ), +- _( "Tile height in pixels" ), ++ VIPS_ARG_INT(class, "tile_height", 12, ++ _("Tile height"), ++ _("Tile height in pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, tile_height ), +- 1, 32768, 128 ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, tile_height), ++ 1, 32768, 128); + +- VIPS_ARG_BOOL( class, "pyramid", 13, +- _( "Pyramid" ), +- _( "Write a pyramidal tiff" ), ++ VIPS_ARG_BOOL(class, "pyramid", 13, ++ _("Pyramid"), ++ _("Write a pyramidal tiff"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, pyramid ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, pyramid), ++ FALSE); + +- VIPS_ARG_BOOL( class, "miniswhite", 14, +- _( "Miniswhite" ), +- _( "Use 0 for white in 1-bit images" ), ++ VIPS_ARG_BOOL(class, "miniswhite", 14, ++ _("Miniswhite"), ++ _("Use 0 for white in 1-bit images"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, miniswhite ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, miniswhite), ++ FALSE); + +- VIPS_ARG_INT( class, "bitdepth", 15, +- _( "Bit depth" ), +- _( "Write as a 1, 2, 4 or 8 bit image" ), ++ VIPS_ARG_INT(class, "bitdepth", 15, ++ _("Bit depth"), ++ _("Write as a 1, 2, 4 or 8 bit image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, bitdepth ), +- 0, 8, 0 ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, bitdepth), ++ 0, 8, 0); + +- VIPS_ARG_ENUM( class, "resunit", 16, +- _( "Resolution unit" ), +- _( "Resolution unit" ), ++ VIPS_ARG_ENUM(class, "resunit", 16, ++ _("Resolution unit"), ++ _("Resolution unit"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, resunit ), +- VIPS_TYPE_FOREIGN_TIFF_RESUNIT, VIPS_FOREIGN_TIFF_RESUNIT_CM ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, resunit), ++ VIPS_TYPE_FOREIGN_TIFF_RESUNIT, VIPS_FOREIGN_TIFF_RESUNIT_CM); + +- VIPS_ARG_DOUBLE( class, "xres", 17, +- _( "Xres" ), +- _( "Horizontal resolution in pixels/mm" ), ++ VIPS_ARG_DOUBLE(class, "xres", 17, ++ _("Xres"), ++ _("Horizontal resolution in pixels/mm"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, xres ), +- 0.001, 1000000, 1 ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, xres), ++ 0.001, 1000000, 1); + +- VIPS_ARG_DOUBLE( class, "yres", 18, +- _( "Yres" ), +- _( "Vertical resolution in pixels/mm" ), ++ VIPS_ARG_DOUBLE(class, "yres", 18, ++ _("Yres"), ++ _("Vertical resolution in pixels/mm"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, yres ), +- 0.001, 1000000, 1 ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, yres), ++ 0.001, 1000000, 1); + +- VIPS_ARG_BOOL( class, "bigtiff", 19, +- _( "Bigtiff" ), +- _( "Write a bigtiff image" ), ++ VIPS_ARG_BOOL(class, "bigtiff", 19, ++ _("Bigtiff"), ++ _("Write a bigtiff image"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, bigtiff ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, bigtiff), ++ FALSE); + +- VIPS_ARG_BOOL( class, "properties", 21, +- _( "Properties" ), +- _( "Write a properties document to IMAGEDESCRIPTION" ), ++ VIPS_ARG_BOOL(class, "properties", 21, ++ _("Properties"), ++ _("Write a properties document to IMAGEDESCRIPTION"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, properties ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, properties), ++ FALSE); + +- VIPS_ARG_ENUM( class, "region_shrink", 22, +- _( "Region shrink" ), +- _( "Method to shrink regions" ), ++ VIPS_ARG_ENUM(class, "region_shrink", 22, ++ _("Region shrink"), ++ _("Method to shrink regions"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, region_shrink ), +- VIPS_TYPE_REGION_SHRINK, VIPS_REGION_SHRINK_MEAN ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, region_shrink), ++ VIPS_TYPE_REGION_SHRINK, VIPS_REGION_SHRINK_MEAN); + +- VIPS_ARG_INT( class, "level", 23, +- _( "Level" ), +- _( "ZSTD compression level" ), ++ VIPS_ARG_INT(class, "level", 23, ++ _("Level"), ++ _("ZSTD compression level"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, level ), +- 1, 22, 10 ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, level), ++ 1, 22, 10); + +- VIPS_ARG_BOOL( class, "lossless", 24, +- _( "Lossless" ), +- _( "Enable WEBP lossless mode" ), ++ VIPS_ARG_BOOL(class, "lossless", 24, ++ _("Lossless"), ++ _("Enable WEBP lossless mode"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, lossless ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, lossless), ++ FALSE); + +- VIPS_ARG_ENUM( class, "depth", 25, +- _( "Depth" ), +- _( "Pyramid depth" ), ++ VIPS_ARG_ENUM(class, "depth", 25, ++ _("Depth"), ++ _("Pyramid depth"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, depth ), +- VIPS_TYPE_FOREIGN_DZ_DEPTH, VIPS_FOREIGN_DZ_DEPTH_ONETILE ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, depth), ++ VIPS_TYPE_FOREIGN_DZ_DEPTH, VIPS_FOREIGN_DZ_DEPTH_ONETILE); + +- VIPS_ARG_BOOL( class, "subifd", 26, +- _( "Sub-IFD" ), +- _( "Save pyr layers as sub-IFDs" ), ++ VIPS_ARG_BOOL(class, "subifd", 26, ++ _("Sub-IFD"), ++ _("Save pyr layers as sub-IFDs"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, subifd ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, subifd), ++ FALSE); + +- VIPS_ARG_BOOL( class, "premultiply", 27, +- _( "Premultiply" ), +- _( "Save with premultiplied alpha" ), ++ VIPS_ARG_BOOL(class, "premultiply", 27, ++ _("Premultiply"), ++ _("Save with premultiplied alpha"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, premultiply ), +- FALSE ); +- +- VIPS_ARG_BOOL( class, "rgbjpeg", 20, +- _( "RGB JPEG" ), +- _( "Output RGB JPEG rather than YCbCr" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, rgbjpeg ), +- FALSE ); +- +- VIPS_ARG_BOOL( class, "squash", 14, +- _( "Squash" ), +- _( "Squash images down to 1 bit" ), ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, premultiply), ++ FALSE); ++ ++ VIPS_ARG_BOOL(class, "rgbjpeg", 20, ++ _("RGB JPEG"), ++ _("Output RGB JPEG rather than YCbCr"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignSaveTiff, squash ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, rgbjpeg), ++ FALSE); + ++ VIPS_ARG_BOOL(class, "squash", 14, ++ _("Squash"), ++ _("Squash images down to 1 bit"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, ++ G_STRUCT_OFFSET(VipsForeignSaveTiff, squash), ++ FALSE); + } + + static void +-vips_foreign_save_tiff_init( VipsForeignSaveTiff *tiff ) ++vips_foreign_save_tiff_init(VipsForeignSaveTiff *tiff) + { + tiff->compression = VIPS_FOREIGN_TIFF_COMPRESSION_NONE; + tiff->Q = 75; +@@ -437,7 +434,7 @@ vips_foreign_save_tiff_init( VipsForeignSaveTiff *tiff ) + tiff->region_shrink = VIPS_REGION_SHRINK_MEAN; + tiff->level = 10; + tiff->lossless = FALSE; +- tiff->depth = VIPS_FOREIGN_DZ_DEPTH_ONETILE; ++ tiff->depth = VIPS_FOREIGN_DZ_DEPTH_ONETILE; + tiff->bitdepth = 0; + } + +@@ -449,103 +446,101 @@ typedef struct _VipsForeignSaveTiffTarget { + + typedef VipsForeignSaveTiffClass VipsForeignSaveTiffTargetClass; + +-G_DEFINE_TYPE( VipsForeignSaveTiffTarget, vips_foreign_save_tiff_target, +- vips_foreign_save_tiff_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveTiffTarget, vips_foreign_save_tiff_target, ++ vips_foreign_save_tiff_get_type()); + + static int +-vips_foreign_save_tiff_target_build( VipsObject *object ) ++vips_foreign_save_tiff_target_build(VipsObject *object) + { + VipsForeignSaveTiff *tiff = (VipsForeignSaveTiff *) object; +- VipsForeignSaveTiffTarget *target = ++ VipsForeignSaveTiffTarget *target = + (VipsForeignSaveTiffTarget *) object; + + tiff->target = target->target; +- g_object_ref( tiff->target ); ++ g_object_ref(tiff->target); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_tiff_target_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_tiff_target_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_tiff_target_class_init( +- VipsForeignSaveTiffTargetClass *class ) ++vips_foreign_save_tiff_target_class_init( ++ VipsForeignSaveTiffTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "tiffsave_target"; +- object_class->description = _( "save image to tiff target" ); ++ object_class->description = _("save image to tiff target"); + object_class->build = vips_foreign_save_tiff_target_build; + +- VIPS_ARG_OBJECT( class, "target", 1, +- _( "Target" ), +- _( "Target to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiffTarget, target ), +- VIPS_TYPE_TARGET ); ++ VIPS_ARG_OBJECT(class, "target", 1, ++ _("Target"), ++ _("Target to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveTiffTarget, target), ++ VIPS_TYPE_TARGET); + } + + static void +-vips_foreign_save_tiff_target_init( VipsForeignSaveTiffTarget *target ) ++vips_foreign_save_tiff_target_init(VipsForeignSaveTiffTarget *target) + { + } + + typedef struct _VipsForeignSaveTiffFile { + VipsForeignSaveTiff parent_object; + +- char *filename; ++ char *filename; + } VipsForeignSaveTiffFile; + + typedef VipsForeignSaveTiffClass VipsForeignSaveTiffFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveTiffFile, vips_foreign_save_tiff_file, +- vips_foreign_save_tiff_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveTiffFile, vips_foreign_save_tiff_file, ++ vips_foreign_save_tiff_get_type()); + + static int +-vips_foreign_save_tiff_file_build( VipsObject *object ) ++vips_foreign_save_tiff_file_build(VipsObject *object) + { + VipsForeignSaveTiff *tiff = (VipsForeignSaveTiff *) object; + VipsForeignSaveTiffFile *file = (VipsForeignSaveTiffFile *) object; + +- if( !(tiff->target = vips_target_new_to_file( file->filename )) ) +- return( -1 ); ++ if (!(tiff->target = vips_target_new_to_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_tiff_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_tiff_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_tiff_file_class_init( VipsForeignSaveTiffFileClass *class ) ++vips_foreign_save_tiff_file_class_init(VipsForeignSaveTiffFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "tiffsave"; +- object_class->description = _( "save image to tiff file" ); ++ object_class->description = _("save image to tiff file"); + object_class->build = vips_foreign_save_tiff_file_build; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiffFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveTiffFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_tiff_file_init( VipsForeignSaveTiffFile *file ) ++vips_foreign_save_tiff_file_init(VipsForeignSaveTiffFile *file) + { + } + +@@ -557,56 +552,55 @@ typedef struct _VipsForeignSaveTiffBuffer { + + typedef VipsForeignSaveTiffClass VipsForeignSaveTiffBufferClass; + +-G_DEFINE_TYPE( VipsForeignSaveTiffBuffer, vips_foreign_save_tiff_buffer, +- vips_foreign_save_tiff_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveTiffBuffer, vips_foreign_save_tiff_buffer, ++ vips_foreign_save_tiff_get_type()); + + static int +-vips_foreign_save_tiff_buffer_build( VipsObject *object ) ++vips_foreign_save_tiff_buffer_build(VipsObject *object) + { + VipsForeignSaveTiff *tiff = (VipsForeignSaveTiff *) object; +- VipsForeignSaveTiffBuffer *buffer = ++ VipsForeignSaveTiffBuffer *buffer = + (VipsForeignSaveTiffBuffer *) object; + + VipsBlob *blob; + +- if( !(tiff->target = vips_target_new_to_memory()) ) +- return( -1 ); ++ if (!(tiff->target = vips_target_new_to_memory())) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_tiff_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_tiff_buffer_parent_class)->build(object)) ++ return (-1); + +- g_object_get( tiff->target, "blob", &blob, NULL ); +- g_object_set( buffer, "buffer", blob, NULL ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ g_object_get(tiff->target, "blob", &blob, NULL); ++ g_object_set(buffer, "buffer", blob, NULL); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_tiff_buffer_class_init( +- VipsForeignSaveTiffBufferClass *class ) ++vips_foreign_save_tiff_buffer_class_init( ++ VipsForeignSaveTiffBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "tiffsave_buffer"; +- object_class->description = _( "save image to tiff buffer" ); ++ object_class->description = _("save image to tiff buffer"); + object_class->build = vips_foreign_save_tiff_buffer_build; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to save to" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsForeignSaveTiffBuffer, buf ), +- VIPS_TYPE_BLOB ); ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to save to"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveTiffBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_save_tiff_buffer_init( VipsForeignSaveTiffBuffer *buffer ) ++vips_foreign_save_tiff_buffer_init(VipsForeignSaveTiffBuffer *buffer) + { + } + +@@ -614,8 +608,8 @@ vips_foreign_save_tiff_buffer_init( VipsForeignSaveTiffBuffer *buffer ) + + /** + * vips_tiffsave: (method) +- * @in: image to save +- * @filename: file to write to ++ * @in: image to save ++ * @filename: file to write to + * @...: %NULL-terminated list of optional named arguments + * + * Optional arguments: +@@ -646,17 +640,17 @@ vips_foreign_save_tiff_buffer_init( VipsForeignSaveTiffBuffer *buffer ) + * + * If @in has the #VIPS_META_PAGE_HEIGHT metadata item, this is assumed to be a + * "toilet roll" image. It will be +- * written as series of pages, each #VIPS_META_PAGE_HEIGHT pixels high. ++ * written as series of pages, each #VIPS_META_PAGE_HEIGHT pixels high. + * + * Use @compression to set the tiff compression. Currently jpeg, packbits, +- * fax4, lzw, none, deflate, webp and zstd are supported. The default is no ++ * fax4, lzw, none, deflate, webp and zstd are supported. The default is no + * compression. +- * JPEG compression is a good lossy compressor for photographs, packbits is +- * good for 1-bit images, and deflate is the best lossless compression TIFF +- * can do. ++ * JPEG compression is a good lossy compressor for photographs, packbits is ++ * good for 1-bit images, and deflate is the best lossless compression TIFF ++ * can do. + * + * XYZ images are automatically saved as libtiff LOGLUV with SGILOG compression. +- * Float LAB images are saved as float CIELAB. Set @bitdepth to save as 8-bit ++ * Float LAB images are saved as float CIELAB. Set @bitdepth to save as 8-bit + * CIELAB. + * + * Use @Q to set the JPEG compression factor. Default 75. +@@ -666,14 +660,14 @@ vips_foreign_save_tiff_buffer_init( VipsForeignSaveTiffBuffer *buffer ) + * + * Use @predictor to set the predictor for lzw, deflate and zstd compression. + * It defaults to #VIPS_FOREIGN_TIFF_PREDICTOR_HORIZONTAL, meaning horizontal +- * differencing. Please refer to the libtiff +- * specifications for further discussion of various predictors. ++ * differencing. Please refer to the libtiff ++ * specifications for further discussion of various predictors. + * + * Use @profile to give the filename of a profile to be embedded in the TIFF. +- * This does not affect the pixels which are written, just the way +- * they are tagged. See vips_profile_load() for details on profile naming. ++ * This does not affect the pixels which are written, just the way ++ * they are tagged. See vips_profile_load() for details on profile naming. + * +- * If no profile is specified and the VIPS header ++ * If no profile is specified and the VIPS header + * contains an ICC profile named #VIPS_META_ICC_NAME, the + * profile from the VIPS header will be attached. + * +@@ -702,15 +696,15 @@ vips_foreign_save_tiff_buffer_init( VipsForeignSaveTiffBuffer *buffer ) + * In case @miniswhite is set to true this behavior is inverted. + * In case of depth 4: values < 16 are written as black, and so on for the + * lighter shades. In case @miniswhite is set to true this behavior is inverted. +- * +- * Use @resunit to override the default resolution unit. +- * The default +- * resolution unit is taken from the header field +- * #VIPS_META_RESOLUTION_UNIT. If this field is not set, then ++ * ++ * Use @resunit to override the default resolution unit. ++ * The default ++ * resolution unit is taken from the header field ++ * #VIPS_META_RESOLUTION_UNIT. If this field is not set, then + * VIPS defaults to cm. + * + * Use @xres and @yres to override the default horizontal and vertical +- * resolutions. By default these values are taken from the VIPS image header. ++ * resolutions. By default these values are taken from the VIPS image header. + * libvips resolution is always in pixels per millimetre. + * + * Set @bigtiff to attempt to write a bigtiff. Bigtiff is a variant of the TIFF +@@ -721,13 +715,13 @@ vips_foreign_save_tiff_buffer_init( VipsForeignSaveTiffBuffer *buffer ) + * used instead. + * + * The value of #VIPS_META_XMP_NAME is written to +- * the XMP tag. #VIPS_META_ORIENTATION (if set) is used to set the value of ++ * the XMP tag. #VIPS_META_ORIENTATION (if set) is used to set the value of + * the orientation +- * tag. #VIPS_META_IPTC (if set) is used to set the value of the IPTC tag. ++ * tag. #VIPS_META_IPTC (if set) is used to set the value of the IPTC tag. + * #VIPS_META_PHOTOSHOP_NAME (if set) is used to set the value of the PHOTOSHOP + * tag. + * +- * By default, pyramid layers are saved as consecutive pages. ++ * By default, pyramid layers are saved as consecutive pages. + * Set @subifd to save pyramid layers as sub-directories of the main image. + * Setting this option can improve compatibility with formats like OME. + * +@@ -739,21 +733,21 @@ vips_foreign_save_tiff_buffer_init( VipsForeignSaveTiffBuffer *buffer ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_tiffsave( VipsImage *in, const char *filename, ... ) ++vips_tiffsave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "tiffsave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("tiffsave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_tiffsave_buffer: (method) +- * @in: image to save ++ * @in: image to save + * @buf: (array length=len) (element-type guint8): return output buffer here + * @len: (type gsize): return output length here + * @...: %NULL-terminated list of optional named arguments +@@ -782,7 +776,7 @@ vips_tiffsave( VipsImage *in, const char *filename, ... ) + * * @subifd: %gboolean write pyr layers as sub-ifds + * * @premultiply: %gboolean write premultiplied alpha + * +- * As vips_tiffsave(), but save to a memory buffer. ++ * As vips_tiffsave(), but save to a memory buffer. + * + * The address of the buffer is returned in @buf, the length of the buffer in + * @len. You are responsible for freeing the buffer with g_free() when you +@@ -793,31 +787,31 @@ vips_tiffsave( VipsImage *in, const char *filename, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_tiffsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++vips_tiffsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + { + va_list ap; + VipsArea *area; + int result; + +- area = NULL; ++ area = NULL; + +- va_start( ap, len ); +- result = vips_call_split( "tiffsave_buffer", ap, in, &area ); +- va_end( ap ); ++ va_start(ap, len); ++ result = vips_call_split("tiffsave_buffer", ap, in, &area); ++ va_end(ap); + +- if( !result && +- area ) { +- if( buf ) { ++ if (!result && ++ area) { ++ if (buf) { + *buf = area->data; + area->free_fn = NULL; + } +- if( len ) ++ if (len) + *len = area->length; + +- vips_area_unref( area ); ++ vips_area_unref(area); + } + +- return( result ); ++ return (result); + } + + /** +@@ -857,14 +851,14 @@ vips_tiffsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_tiffsave_target( VipsImage *in, VipsTarget *target, ... ) ++vips_tiffsave_target(VipsImage *in, VipsTarget *target, ...) + { + va_list ap; + int result; + +- va_start( ap, target ); +- result = vips_call_split( "tiffsave_target", ap, in, target ); +- va_end( ap ); ++ va_start(ap, target); ++ result = vips_call_split("tiffsave_target", ap, in, target); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/vips2jpeg.c b/libvips/foreign/vips2jpeg.c +index 337e7468c9..fc577c4e3b 100644 +--- a/libvips/foreign/vips2jpeg.c ++++ b/libvips/foreign/vips2jpeg.c +@@ -45,13 +45,13 @@ + * 18/10/2011 + * - update Orientation as well + * 3/11/11 +- * - rebuild exif tags from coded metadata values ++ * - rebuild exif tags from coded metadata values + * 24/11/11 + * - turn into a set of write fns ready to be called from a class + * 7/8/12 + * - use VIPS_META_RESOLUTION_UNIT to select resolution unit + * 16/11/12 +- * - read ifds from exif fields ++ * - read ifds from exif fields + * - optionally parse rationals as a/b + * - update exif image dimensions + * 21/11/12 +@@ -70,7 +70,7 @@ + * 15/7/15 + * - exif tags use @name, not @title + * - set arbitrary exif tags from metadata +- * 25/11/15 ++ * 25/11/15 + * - don't write JFIF headers if we are stripping, thanks Benjamin + * 13/4/16 + * - remove deleted exif fields more carefully +@@ -98,34 +98,34 @@ + * - only write JFIF resolution if we don't have EXIF + * 7/10/21 Manthey + * - add restart_interval +- * 21/10/21 usualuse ++ * 21/10/21 usualuse + * - raise single-chunk limit on APP to 65533 + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -154,51 +154,51 @@ + + #include "jpeg.h" + +-#define ICC_MARKER (JPEG_APP0 + 2) /* JPEG marker code for ICC */ +-#define ICC_OVERHEAD_LEN 14 /* size of non-profile data in APP2 */ +-#define MAX_BYTES_IN_MARKER 65533 /* maximum data len of a JPEG marker */ +-#define MAX_DATA_BYTES_IN_MARKER (MAX_BYTES_IN_MARKER - ICC_OVERHEAD_LEN) ++#define ICC_MARKER (JPEG_APP0 + 2) /* JPEG marker code for ICC */ ++#define ICC_OVERHEAD_LEN 14 /* size of non-profile data in APP2 */ ++#define MAX_BYTES_IN_MARKER 65533 /* maximum data len of a JPEG marker */ ++#define MAX_DATA_BYTES_IN_MARKER (MAX_BYTES_IN_MARKER - ICC_OVERHEAD_LEN) + + /* New output message method - send to VIPS. + */ + void +-vips__new_output_message( j_common_ptr cinfo ) ++vips__new_output_message(j_common_ptr cinfo) + { + char buffer[JMSG_LENGTH_MAX]; + +- (*cinfo->err->format_message)( cinfo, buffer ); +- vips_error( "VipsJpeg", _( "%s" ), buffer ); ++ (*cinfo->err->format_message)(cinfo, buffer); ++ vips_error("VipsJpeg", _("%s"), buffer); + + #ifdef DEBUG +- printf( "vips__new_output_message: \"%s\"\n", buffer ); ++ printf("vips__new_output_message: \"%s\"\n", buffer); + #endif /*DEBUG*/ + } + + /* New error_exit handler. + */ + void +-vips__new_error_exit( j_common_ptr cinfo ) ++vips__new_error_exit(j_common_ptr cinfo) + { + ErrorManager *eman = (ErrorManager *) cinfo->err; + + #ifdef DEBUG +- printf( "vips__new_error_exit:\n" ); ++ printf("vips__new_error_exit:\n"); + #endif /*DEBUG*/ + + /* Close the fp if necessary. + */ +- if( eman->fp ) { +- (void) fclose( eman->fp ); ++ if (eman->fp) { ++ (void) fclose(eman->fp); + eman->fp = NULL; + } + + /* Send the error message to VIPS. This method is overridden above. + */ +- (*cinfo->err->output_message)( cinfo ); ++ (*cinfo->err->output_message)(cinfo); + + /* Jump back. + */ +- longjmp( eman->jmp, 1 ); ++ longjmp(eman->jmp, 1); + } + + /* What we track during a JPEG write. +@@ -206,33 +206,33 @@ vips__new_error_exit( j_common_ptr cinfo ) + typedef struct { + VipsImage *in; + struct jpeg_compress_struct cinfo; +- ErrorManager eman; ++ ErrorManager eman; + JSAMPROW *row_pointer; + VipsImage *inverted; + } Write; + + static void +-write_destroy( Write *write ) ++write_destroy(Write *write) + { +- jpeg_destroy_compress( &write->cinfo ); +- VIPS_FREE( write->row_pointer ); +- VIPS_UNREF( write->inverted ); +- VIPS_UNREF( write->in ); ++ jpeg_destroy_compress(&write->cinfo); ++ VIPS_FREE(write->row_pointer); ++ VIPS_UNREF(write->inverted); ++ VIPS_UNREF(write->in); + +- g_free( write ); ++ g_free(write); + } + + static Write * +-write_new( VipsImage *in ) ++write_new(VipsImage *in) + { + Write *write; + +- if( !(write = g_new0( Write, 1 )) ) +- return( NULL ); ++ if (!(write = g_new0(Write, 1))) ++ return (NULL); + + write->in = NULL; + write->row_pointer = NULL; +- write->cinfo.err = jpeg_std_error( &write->eman.pub ); ++ write->cinfo.err = jpeg_std_error(&write->eman.pub); + write->cinfo.dest = NULL; + write->eman.pub.error_exit = vips__new_error_exit; + write->eman.pub.output_message = vips__new_output_message; +@@ -242,105 +242,105 @@ write_new( VipsImage *in ) + /* Make a copy of the input image since we may modify it with + * vips__exif_update() etc. + */ +- if( vips_copy( in, &write->in, NULL ) ) { +- write_destroy( write ); +- return( NULL ); ++ if (vips_copy(in, &write->in, NULL)) { ++ write_destroy(write); ++ return (NULL); + } + +- return( write ); ++ return (write); + } + + static int +-write_blob( Write *write, const char *field, int app ) ++write_blob(Write *write, const char *field, int app) + { + unsigned char *data; + size_t data_length; + +- if( vips_image_get_typeof( write->in, field ) ) { +- if( vips_image_get_blob( write->in, field, +- (void *) &data, &data_length ) ) +- return( -1 ); ++ if (vips_image_get_typeof(write->in, field)) { ++ if (vips_image_get_blob(write->in, field, ++ (void *) &data, &data_length)) ++ return (-1); + + /* Single jpeg markers can only hold 64kb, large objects must + * be split into multiple markers. + * + * Unfortunately, how this splitting is done depends on the +- * data type. For example, ICC and XMP have completely ++ * data type. For example, ICC and XMP have completely + * different ways of doing this. + * + * For now, just ignore oversize objects and warn. + */ +- if( data_length > MAX_BYTES_IN_MARKER ) +- g_warning( _( "field \"%s\" is too large " +- "for a single JPEG marker, ignoring" ), +- field ); ++ if (data_length > MAX_BYTES_IN_MARKER) ++ g_warning(_("field \"%s\" is too large " ++ "for a single JPEG marker, ignoring"), ++ field); + else { + #ifdef DEBUG +- printf( "write_blob: attaching %zd bytes of %s\n", +- data_length, field ); ++ printf("write_blob: attaching %zd bytes of %s\n", ++ data_length, field); + #endif /*DEBUG*/ + +- jpeg_write_marker( &write->cinfo, app, +- data, data_length ); +- } ++ jpeg_write_marker(&write->cinfo, app, ++ data, data_length); ++ } + } + +- return( 0 ); ++ return (0); + } + + #define XML_URL "http://ns.adobe.com/xap/1.0/" + + static int +-write_xmp( Write *write ) ++write_xmp(Write *write) + { + unsigned char *data; + size_t data_length; + char *p; + +- if( !vips_image_get_typeof( write->in, VIPS_META_XMP_NAME ) ) +- return( 0 ); +- if( vips_image_get_blob( write->in, VIPS_META_XMP_NAME, +- (void *) &data, &data_length ) ) +- return( -1 ); ++ if (!vips_image_get_typeof(write->in, VIPS_META_XMP_NAME)) ++ return (0); ++ if (vips_image_get_blob(write->in, VIPS_META_XMP_NAME, ++ (void *) &data, &data_length)) ++ return (-1); + +- /* To write >64kb XMP it you need to parse the whole XMP object, +- * pull out the most important fields, code just them into the main +- * XMP block, then write any remaining XMP objects into a set of +- * extended XMP markers. ++ /* To write >64kb XMP it you need to parse the whole XMP object, ++ * pull out the most important fields, code just them into the main ++ * XMP block, then write any remaining XMP objects into a set of ++ * extended XMP markers. + * + * http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/ \ + * XMPSpecificationPart3.pdf + * +- * jpeg_write_marker() with some libjpeg versions will throw a fatal ++ * jpeg_write_marker() with some libjpeg versions will throw a fatal + * error with large chunks. + */ +- if( data_length > 60000 ) { +- g_warning( "%s", _( "VipsJpeg: large XMP not saved" ) ); +- return( 0 ); ++ if (data_length > 60000) { ++ g_warning("%s", _("VipsJpeg: large XMP not saved")); ++ return (0); + } + + /* We need to add the magic XML URL to the start, then a null + * character, then the data. + */ +- p = g_malloc( data_length + strlen( XML_URL ) + 1 ); +- strcpy( p, XML_URL ); +- memcpy( p + strlen( XML_URL ) + 1, data, data_length ); +- +- jpeg_write_marker( &write->cinfo, JPEG_APP0 + 1, +- (unsigned char *) p, data_length + strlen( XML_URL ) + 1 ); ++ p = g_malloc(data_length + strlen(XML_URL) + 1); ++ strcpy(p, XML_URL); ++ memcpy(p + strlen(XML_URL) + 1, data, data_length); ++ ++ jpeg_write_marker(&write->cinfo, JPEG_APP0 + 1, ++ (unsigned char *) p, data_length + strlen(XML_URL) + 1); + +- g_free( p ); ++ g_free(p); + +- return( 0 ); ++ return (0); + } + + static int +-write_exif( Write *write ) ++write_exif(Write *write) + { +- if( write_blob( write, VIPS_META_EXIF_NAME, JPEG_APP0 + 1 ) ) +- return( -1 ); ++ if (write_blob(write, VIPS_META_EXIF_NAME, JPEG_APP0 + 1)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* ICC writer from lcms, slight tweaks. +@@ -355,68 +355,68 @@ write_exif( Write *write ) + */ + + static void +-write_profile_data (j_compress_ptr cinfo, +- const JOCTET *icc_data_ptr, +- unsigned int icc_data_len) ++write_profile_data(j_compress_ptr cinfo, ++ const JOCTET *icc_data_ptr, ++ unsigned int icc_data_len) + { +- unsigned int num_markers; /* total number of markers we'll write */ +- int cur_marker = 1; /* per spec, counting starts at 1 */ +- unsigned int length; /* number of bytes to write in this marker */ +- +- /* rounding up will fail for length == 0 */ +- g_assert( icc_data_len > 0 ); +- +- /* Calculate the number of markers we'll need, rounding up of course */ +- num_markers = (icc_data_len + MAX_DATA_BYTES_IN_MARKER - 1) / +- MAX_DATA_BYTES_IN_MARKER; +- +- while (icc_data_len > 0) { +- /* length of profile to put in this marker */ +- length = icc_data_len; +- if (length > MAX_DATA_BYTES_IN_MARKER) +- length = MAX_DATA_BYTES_IN_MARKER; +- icc_data_len -= length; +- +- /* Write the JPEG marker header (APP2 code and marker length) */ +- jpeg_write_m_header(cinfo, ICC_MARKER, +- (unsigned int) (length + ICC_OVERHEAD_LEN)); +- +- /* Write the marker identifying string "ICC_PROFILE" (null-terminated). +- * We code it in this less-than-transparent way so that the code works +- * even if the local character set is not ASCII. +- */ +- jpeg_write_m_byte(cinfo, 0x49); +- jpeg_write_m_byte(cinfo, 0x43); +- jpeg_write_m_byte(cinfo, 0x43); +- jpeg_write_m_byte(cinfo, 0x5F); +- jpeg_write_m_byte(cinfo, 0x50); +- jpeg_write_m_byte(cinfo, 0x52); +- jpeg_write_m_byte(cinfo, 0x4F); +- jpeg_write_m_byte(cinfo, 0x46); +- jpeg_write_m_byte(cinfo, 0x49); +- jpeg_write_m_byte(cinfo, 0x4C); +- jpeg_write_m_byte(cinfo, 0x45); +- jpeg_write_m_byte(cinfo, 0x0); +- +- /* Add the sequencing info */ +- jpeg_write_m_byte(cinfo, cur_marker); +- jpeg_write_m_byte(cinfo, (int) num_markers); +- +- /* Add the profile data */ +- while (length--) { +- jpeg_write_m_byte(cinfo, *icc_data_ptr); +- icc_data_ptr++; +- } +- cur_marker++; +- } ++ unsigned int num_markers; /* total number of markers we'll write */ ++ int cur_marker = 1; /* per spec, counting starts at 1 */ ++ unsigned int length; /* number of bytes to write in this marker */ ++ ++ /* rounding up will fail for length == 0 */ ++ g_assert(icc_data_len > 0); ++ ++ /* Calculate the number of markers we'll need, rounding up of course */ ++ num_markers = (icc_data_len + MAX_DATA_BYTES_IN_MARKER - 1) / ++ MAX_DATA_BYTES_IN_MARKER; ++ ++ while (icc_data_len > 0) { ++ /* length of profile to put in this marker */ ++ length = icc_data_len; ++ if (length > MAX_DATA_BYTES_IN_MARKER) ++ length = MAX_DATA_BYTES_IN_MARKER; ++ icc_data_len -= length; ++ ++ /* Write the JPEG marker header (APP2 code and marker length) */ ++ jpeg_write_m_header(cinfo, ICC_MARKER, ++ (unsigned int) (length + ICC_OVERHEAD_LEN)); ++ ++ /* Write the marker identifying string "ICC_PROFILE" (null-terminated). ++ * We code it in this less-than-transparent way so that the code works ++ * even if the local character set is not ASCII. ++ */ ++ jpeg_write_m_byte(cinfo, 0x49); ++ jpeg_write_m_byte(cinfo, 0x43); ++ jpeg_write_m_byte(cinfo, 0x43); ++ jpeg_write_m_byte(cinfo, 0x5F); ++ jpeg_write_m_byte(cinfo, 0x50); ++ jpeg_write_m_byte(cinfo, 0x52); ++ jpeg_write_m_byte(cinfo, 0x4F); ++ jpeg_write_m_byte(cinfo, 0x46); ++ jpeg_write_m_byte(cinfo, 0x49); ++ jpeg_write_m_byte(cinfo, 0x4C); ++ jpeg_write_m_byte(cinfo, 0x45); ++ jpeg_write_m_byte(cinfo, 0x0); ++ ++ /* Add the sequencing info */ ++ jpeg_write_m_byte(cinfo, cur_marker); ++ jpeg_write_m_byte(cinfo, (int) num_markers); ++ ++ /* Add the profile data */ ++ while (length--) { ++ jpeg_write_m_byte(cinfo, *icc_data_ptr); ++ icc_data_ptr++; ++ } ++ cur_marker++; ++ } + } + + #ifndef HAVE_EXIF + /* Set the JFIF resolution from the vips xres/yres tags. + */ + static void +-vips_jfif_resolution_from_image( struct jpeg_compress_struct *cinfo, +- VipsImage *image ) ++vips_jfif_resolution_from_image(struct jpeg_compress_struct *cinfo, ++ VipsImage *image) + { + int xres, yres; + const char *p; +@@ -425,29 +425,29 @@ vips_jfif_resolution_from_image( struct jpeg_compress_struct *cinfo, + /* Default to inches, more progs support it. + */ + unit = 1; +- if( vips_image_get_typeof( image, VIPS_META_RESOLUTION_UNIT ) && +- !vips_image_get_string( image, +- VIPS_META_RESOLUTION_UNIT, &p ) ) { +- if( vips_isprefix( "cm", p ) ) ++ if (vips_image_get_typeof(image, VIPS_META_RESOLUTION_UNIT) && ++ !vips_image_get_string(image, ++ VIPS_META_RESOLUTION_UNIT, &p)) { ++ if (vips_isprefix("cm", p)) + unit = 2; +- else if( vips_isprefix( "none", p ) ) ++ else if (vips_isprefix("none", p)) + unit = 0; + } + +- switch( unit ) { ++ switch (unit) { + case 0: +- xres = VIPS_RINT( image->Xres ); +- yres = VIPS_RINT( image->Yres ); ++ xres = VIPS_RINT(image->Xres); ++ yres = VIPS_RINT(image->Yres); + break; + + case 1: +- xres = VIPS_RINT( image->Xres * 25.4 ); +- yres = VIPS_RINT( image->Yres * 25.4 ); ++ xres = VIPS_RINT(image->Xres * 25.4); ++ yres = VIPS_RINT(image->Yres * 25.4); + break; + + case 2: +- xres = VIPS_RINT( image->Xres * 10.0 ); +- yres = VIPS_RINT( image->Yres * 10.0 ); ++ xres = VIPS_RINT(image->Xres * 10.0); ++ yres = VIPS_RINT(image->Yres * 10.0); + break; + + default: +@@ -455,8 +455,9 @@ vips_jfif_resolution_from_image( struct jpeg_compress_struct *cinfo, + break; + } + +- VIPS_DEBUG_MSG( "vips_jfif_resolution_from_image: " +- "setting xres = %d, yres = %d, unit = %d\n", xres, yres, unit ); ++ VIPS_DEBUG_MSG("vips_jfif_resolution_from_image: " ++ "setting xres = %d, yres = %d, unit = %d\n", ++ xres, yres, unit); + + cinfo->density_unit = unit; + cinfo->X_density = xres; +@@ -467,77 +468,78 @@ vips_jfif_resolution_from_image( struct jpeg_compress_struct *cinfo, + /* Write an ICC Profile from a file into the JPEG stream. + */ + static int +-write_profile_file( Write *write, const char *profile ) ++write_profile_file(Write *write, const char *profile) + { + VipsBlob *blob; + +- if( vips_profile_load( profile, &blob, NULL ) ) +- return( -1 ); ++ if (vips_profile_load(profile, &blob, NULL)) ++ return (-1); + +- if( blob ) { ++ if (blob) { + size_t length; +- const void *data = vips_blob_get( blob, &length ); ++ const void *data = vips_blob_get(blob, &length); + +- write_profile_data( &write->cinfo, (JOCTET *) data, length ); ++ write_profile_data(&write->cinfo, (JOCTET *) data, length); + + #ifdef DEBUG +- printf( "write_profile_file: " +- "attached profile \"%s\"\n", profile ); ++ printf("write_profile_file: " ++ "attached profile \"%s\"\n", ++ profile); + #endif /*DEBUG*/ + +- vips_area_unref( (VipsArea *) blob ); ++ vips_area_unref((VipsArea *) blob); + } + +- return( 0 ); ++ return (0); + } + + static int +-write_profile_meta( Write *write ) ++write_profile_meta(Write *write) + { + const void *data; + size_t length; + +- if( vips_image_get_blob( write->in, +- VIPS_META_ICC_NAME, &data, &length ) ) +- return( -1 ); +- write_profile_data( &write->cinfo, data, length ); ++ if (vips_image_get_blob(write->in, ++ VIPS_META_ICC_NAME, &data, &length)) ++ return (-1); ++ write_profile_data(&write->cinfo, data, length); + + #ifdef DEBUG +- printf( "write_profile_meta: attached %zd byte profile from header\n", +- length ); ++ printf("write_profile_meta: attached %zd byte profile from header\n", ++ length); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + static int +-write_jpeg_block( VipsRegion *region, VipsRect *area, void *a ) ++write_jpeg_block(VipsRegion *region, VipsRect *area, void *a) + { + Write *write = (Write *) a; + int i; + +- for( i = 0; i < area->height; i++ ) +- write->row_pointer[i] = (JSAMPROW) +- VIPS_REGION_ADDR( region, 0, area->top + i ); ++ for (i = 0; i < area->height; i++) ++ write->row_pointer[i] = (JSAMPROW) ++ VIPS_REGION_ADDR(region, 0, area->top + i); + + /* Catch any longjmp()s from jpeg_write_scanlines() here. + */ +- if( setjmp( write->eman.jmp ) ) +- return( -1 ); ++ if (setjmp(write->eman.jmp)) ++ return (-1); + +- jpeg_write_scanlines( &write->cinfo, write->row_pointer, area->height ); ++ jpeg_write_scanlines(&write->cinfo, write->row_pointer, area->height); + +- return( 0 ); ++ return (0); + } + + /* Write a VIPS image to a JPEG compress struct. + */ + static int +-write_vips( Write *write, int qfac, const char *profile, +- gboolean optimize_coding, gboolean progressive, gboolean strip, ++write_vips(Write *write, int qfac, const char *profile, ++ gboolean optimize_coding, gboolean progressive, gboolean strip, + gboolean trellis_quant, gboolean overshoot_deringing, + gboolean optimize_scans, int quant_table, +- VipsForeignSubsample subsample_mode, int restart_interval ) ++ VipsForeignSubsample subsample_mode, int restart_interval) + { + VipsImage *in; + J_COLOR_SPACE space; +@@ -548,153 +550,153 @@ write_vips( Write *write, int qfac, const char *profile, + + /* Should have been converted for save. + */ +- g_assert( in->BandFmt == VIPS_FORMAT_UCHAR ); +- g_assert( in->Coding == VIPS_CODING_NONE ); +- g_assert( in->Bands == 1 || +- in->Bands == 3 || +- in->Bands == 4 ); ++ g_assert(in->BandFmt == VIPS_FORMAT_UCHAR); ++ g_assert(in->Coding == VIPS_CODING_NONE); ++ g_assert(in->Bands == 1 || ++ in->Bands == 3 || ++ in->Bands == 4); + +- /* Check input image. +- */ +- if( vips_image_pio_input( in ) ) +- return( -1 ); ++ /* Check input image. ++ */ ++ if (vips_image_pio_input(in)) ++ return (-1); + + /* Set compression parameters. + */ +- write->cinfo.image_width = in->Xsize; +- write->cinfo.image_height = in->Ysize; ++ write->cinfo.image_width = in->Xsize; ++ write->cinfo.image_height = in->Ysize; + write->cinfo.input_components = in->Bands; +- if( in->Bands == 4 && +- in->Type == VIPS_INTERPRETATION_CMYK ) { ++ if (in->Bands == 4 && ++ in->Type == VIPS_INTERPRETATION_CMYK) { + space = JCS_CMYK; + /* IJG always sets an Adobe marker, so we should invert CMYK. + */ +- if( vips_invert( in, &write->inverted, NULL ) ) +- return( -1 ); ++ if (vips_invert(in, &write->inverted, NULL)) ++ return (-1); + in = write->inverted; + } +- else if( in->Bands == 3 ) ++ else if (in->Bands == 3) + space = JCS_RGB; +- else if( in->Bands == 1 ) ++ else if (in->Bands == 1) + space = JCS_GRAYSCALE; +- else ++ else + /* Use luminance compression for all channels. + */ + space = JCS_UNKNOWN; +- write->cinfo.in_color_space = space; ++ write->cinfo.in_color_space = space; + + /* Build VIPS output stuff now we know the image we'll be writing. + */ +- if( !(write->row_pointer = VIPS_ARRAY( NULL, in->Ysize, JSAMPROW )) ) +- return( -1 ); ++ if (!(write->row_pointer = VIPS_ARRAY(NULL, in->Ysize, JSAMPROW))) ++ return (-1); + + #ifdef HAVE_JPEG_EXT_PARAMS + /* Reset compression profile to libjpeg defaults + */ +- if( jpeg_c_int_param_supported( &write->cinfo, JINT_COMPRESS_PROFILE ) ) +- jpeg_c_set_int_param( &write->cinfo, +- JINT_COMPRESS_PROFILE, JCP_FASTEST ); ++ if (jpeg_c_int_param_supported(&write->cinfo, JINT_COMPRESS_PROFILE)) ++ jpeg_c_set_int_param(&write->cinfo, ++ JINT_COMPRESS_PROFILE, JCP_FASTEST); + #endif + + /* Reset to default. + */ +- jpeg_set_defaults( &write->cinfo ); ++ jpeg_set_defaults(&write->cinfo); + +- /* Compute optimal Huffman coding tables. ++ /* Compute optimal Huffman coding tables. + */ + write->cinfo.optimize_coding = optimize_coding; + + /* Use a restart interval. + */ +- if( restart_interval > 0 ) ++ if (restart_interval > 0) + write->cinfo.restart_interval = restart_interval; + + #ifdef HAVE_JPEG_EXT_PARAMS +- /* Apply trellis quantisation to each 8x8 block. Implies ++ /* Apply trellis quantisation to each 8x8 block. Implies + * "optimize_coding". + */ +- if( trellis_quant ) { +- if( jpeg_c_bool_param_supported( &write->cinfo, +- JBOOLEAN_TRELLIS_QUANT ) ) { +- jpeg_c_set_bool_param( &write->cinfo, +- JBOOLEAN_TRELLIS_QUANT, TRUE ); ++ if (trellis_quant) { ++ if (jpeg_c_bool_param_supported(&write->cinfo, ++ JBOOLEAN_TRELLIS_QUANT)) { ++ jpeg_c_set_bool_param(&write->cinfo, ++ JBOOLEAN_TRELLIS_QUANT, TRUE); + write->cinfo.optimize_coding = TRUE; + } +- else +- g_warning( "%s", _( "trellis_quant unsupported" ) ); ++ else ++ g_warning("%s", _("trellis_quant unsupported")); + } + +- /* Apply overshooting to samples with extreme values e.g. 0 & 255 ++ /* Apply overshooting to samples with extreme values e.g. 0 & 255 + * for 8-bit. + */ +- if( overshoot_deringing ) { +- if( jpeg_c_bool_param_supported( &write->cinfo, +- JBOOLEAN_OVERSHOOT_DERINGING ) ) +- jpeg_c_set_bool_param( &write->cinfo, +- JBOOLEAN_OVERSHOOT_DERINGING, TRUE ); +- else +- g_warning( "%s", +- _( "overshoot_deringing unsupported" ) ); ++ if (overshoot_deringing) { ++ if (jpeg_c_bool_param_supported(&write->cinfo, ++ JBOOLEAN_OVERSHOOT_DERINGING)) ++ jpeg_c_set_bool_param(&write->cinfo, ++ JBOOLEAN_OVERSHOOT_DERINGING, TRUE); ++ else ++ g_warning("%s", ++ _("overshoot_deringing unsupported")); + } + /* Split the spectrum of DCT coefficients into separate scans. +- * Requires progressive output. Must be set before ++ * Requires progressive output. Must be set before + * jpeg_simple_progression. + */ +- if( optimize_scans ) { +- if( progressive ) { +- if( jpeg_c_bool_param_supported( &write->cinfo, +- JBOOLEAN_OPTIMIZE_SCANS ) ) +- jpeg_c_set_bool_param( &write->cinfo, +- JBOOLEAN_OPTIMIZE_SCANS, TRUE ); +- else +- g_warning( "%s", +- _( "ignoring optimize_scans" ) ); ++ if (optimize_scans) { ++ if (progressive) { ++ if (jpeg_c_bool_param_supported(&write->cinfo, ++ JBOOLEAN_OPTIMIZE_SCANS)) ++ jpeg_c_set_bool_param(&write->cinfo, ++ JBOOLEAN_OPTIMIZE_SCANS, TRUE); ++ else ++ g_warning("%s", ++ _("ignoring optimize_scans")); + } +- else +- g_warning( "%s", +- _( "ignoring optimize_scans for baseline" ) ); ++ else ++ g_warning("%s", ++ _("ignoring optimize_scans for baseline")); + } + + /* Use predefined quantization table. + */ +- if( quant_table > 0 ) { +- if( jpeg_c_int_param_supported( &write->cinfo, +- JINT_BASE_QUANT_TBL_IDX ) ) +- jpeg_c_set_int_param( &write->cinfo, +- JINT_BASE_QUANT_TBL_IDX, quant_table ); ++ if (quant_table > 0) { ++ if (jpeg_c_int_param_supported(&write->cinfo, ++ JINT_BASE_QUANT_TBL_IDX)) ++ jpeg_c_set_int_param(&write->cinfo, ++ JINT_BASE_QUANT_TBL_IDX, quant_table); + else +- g_warning( "%s", +- _( "setting quant_table unsupported" ) ); ++ g_warning("%s", ++ _("setting quant_table unsupported")); + } + #else +- /* Using jpeglib.h without extension parameters, warn of ignored ++ /* Using jpeglib.h without extension parameters, warn of ignored + * options. + */ +- if( trellis_quant ) +- g_warning( "%s", _( "ignoring trellis_quant" ) ); +- if( overshoot_deringing ) +- g_warning( "%s", _( "ignoring overshoot_deringing" ) ); +- if( optimize_scans ) +- g_warning( "%s", _( "ignoring optimize_scans" ) ); +- if( quant_table > 0 ) +- g_warning( "%s", _( "ignoring quant_table" ) ); ++ if (trellis_quant) ++ g_warning("%s", _("ignoring trellis_quant")); ++ if (overshoot_deringing) ++ g_warning("%s", _("ignoring overshoot_deringing")); ++ if (optimize_scans) ++ g_warning("%s", _("ignoring optimize_scans")); ++ if (quant_table > 0) ++ g_warning("%s", _("ignoring quant_table")); + #endif + + /* Set compression quality. Must be called after setting params above. + */ +- jpeg_set_quality( &write->cinfo, qfac, TRUE ); ++ jpeg_set_quality(&write->cinfo, qfac, TRUE); + + /* Enable progressive write. + */ +- if( progressive ) +- jpeg_simple_progression( &write->cinfo ); ++ if (progressive) ++ jpeg_simple_progression(&write->cinfo); + +- if( subsample_mode == VIPS_FOREIGN_SUBSAMPLE_OFF || ++ if (subsample_mode == VIPS_FOREIGN_SUBSAMPLE_OFF || + (subsample_mode == VIPS_FOREIGN_SUBSAMPLE_AUTO && +- qfac >= 90) ) { ++ qfac >= 90)) { + int i; + +- for( i = 0; i < in->Bands; i++ ) { ++ for (i = 0; i < in->Bands; i++) { + write->cinfo.comp_info[i].h_samp_factor = 1; + write->cinfo.comp_info[i].v_samp_factor = 1; + } +@@ -705,58 +707,58 @@ write_vips( Write *write, int qfac, const char *profile, + */ + write->cinfo.write_JFIF_header = FALSE; + #ifndef HAVE_EXIF +- if( !strip ) { +- vips_jfif_resolution_from_image( &write->cinfo, write->in ); ++ if (!strip) { ++ vips_jfif_resolution_from_image(&write->cinfo, write->in); + write->cinfo.write_JFIF_header = TRUE; + } + #endif /*HAVE_EXIF*/ + + /* Write app0 and build compress tables. + */ +- jpeg_start_compress( &write->cinfo, TRUE ); ++ jpeg_start_compress(&write->cinfo, TRUE); + + /* All the other APP chunks come next. + */ +- if( !strip ) { ++ if (!strip) { + /* We need to rebuild the exif data block from any exif tags + * on the image. + */ +- if( vips__exif_update( write->in ) || +- write_exif( write ) || +- write_xmp( write ) || +- write_blob( write, +- VIPS_META_IPTC_NAME, JPEG_APP0 + 13 ) ) +- return( -1 ); +- +- /* A profile supplied as an argument overrides an embedded +- * profile. ++ if (vips__exif_update(write->in) || ++ write_exif(write) || ++ write_xmp(write) || ++ write_blob(write, ++ VIPS_META_IPTC_NAME, JPEG_APP0 + 13)) ++ return (-1); ++ ++ /* A profile supplied as an argument overrides an embedded ++ * profile. + */ +- if( profile ) { +- if( write_profile_file( write, profile ) ) +- return( -1 ); ++ if (profile) { ++ if (write_profile_file(write, profile)) ++ return (-1); + } + else { +- if( vips_image_get_typeof( in, VIPS_META_ICC_NAME ) && +- write_profile_meta( write ) ) +- return( -1 ); ++ if (vips_image_get_typeof(in, VIPS_META_ICC_NAME) && ++ write_profile_meta(write)) ++ return (-1); + } + } + + /* Write data. Note that the write function grabs the longjmp()! + */ +- if( vips_sink_disc( in, write_jpeg_block, write ) ) +- return( -1 ); ++ if (vips_sink_disc(in, write_jpeg_block, write)) ++ return (-1); + + /* We have to reinstate the setjmp() before we jpeg_finish_compress(). + */ +- if( setjmp( write->eman.jmp ) ) +- return( -1 ); ++ if (setjmp(write->eman.jmp)) ++ return (-1); + + /* This should only be called on a successful write. + */ +- jpeg_finish_compress( &write->cinfo ); ++ jpeg_finish_compress(&write->cinfo); + +- return( 0 ); ++ return (0); + } + + #define TARGET_BUFFER_SIZE (4096) +@@ -778,28 +780,28 @@ typedef struct { + unsigned char buf[TARGET_BUFFER_SIZE]; + } Dest; + +-/* Buffer full method. This is only called when the output area is exactly ++/* Buffer full method. This is only called when the output area is exactly + * full. + */ + static jboolean +-empty_output_buffer( j_compress_ptr cinfo ) ++empty_output_buffer(j_compress_ptr cinfo) + { + Dest *dest = (Dest *) cinfo->dest; + +- if( vips_target_write( dest->target, +- dest->buf, TARGET_BUFFER_SIZE ) ) +- ERREXIT( cinfo, JERR_FILE_WRITE ); ++ if (vips_target_write(dest->target, ++ dest->buf, TARGET_BUFFER_SIZE)) ++ ERREXIT(cinfo, JERR_FILE_WRITE); + + dest->pub.next_output_byte = dest->buf; + dest->pub.free_in_buffer = TARGET_BUFFER_SIZE; + +- return( TRUE ); ++ return (TRUE); + } + + /* Init dest method. + */ + static void +-init_destination( j_compress_ptr cinfo ) ++init_destination(j_compress_ptr cinfo) + { + Dest *dest = (Dest *) cinfo->dest; + +@@ -810,30 +812,28 @@ init_destination( j_compress_ptr cinfo ) + /* Flush any remaining bytes to the output. + */ + static void +-term_destination( j_compress_ptr cinfo ) ++term_destination(j_compress_ptr cinfo) + { +- Dest *dest = (Dest *) cinfo->dest; ++ Dest *dest = (Dest *) cinfo->dest; + +- if( vips_target_write( dest->target, +- dest->buf, TARGET_BUFFER_SIZE - dest->pub.free_in_buffer ) ) +- ERREXIT( cinfo, JERR_FILE_WRITE ); ++ if (vips_target_write(dest->target, ++ dest->buf, TARGET_BUFFER_SIZE - dest->pub.free_in_buffer)) ++ ERREXIT(cinfo, JERR_FILE_WRITE); + +- if( vips_target_end( dest->target ) ) +- ERREXIT( cinfo, JERR_FILE_WRITE ); ++ if (vips_target_end(dest->target)) ++ ERREXIT(cinfo, JERR_FILE_WRITE); + } + + /* Set dest to one of our objects. + */ + static void +-target_dest( j_compress_ptr cinfo, VipsTarget *target ) ++target_dest(j_compress_ptr cinfo, VipsTarget *target) + { + Dest *dest; + +- if( !cinfo->dest ) { /* first time for this JPEG object? */ +- cinfo->dest = (struct jpeg_destination_mgr *) +- (*cinfo->mem->alloc_small) +- ( (j_common_ptr) cinfo, JPOOL_PERMANENT, +- sizeof( Dest ) ); ++ if (!cinfo->dest) { /* first time for this JPEG object? */ ++ cinfo->dest = (struct jpeg_destination_mgr *) (*cinfo->mem->alloc_small)((j_common_ptr) cinfo, JPOOL_PERMANENT, ++ sizeof(Dest)); + } + + dest = (Dest *) cinfo->dest; +@@ -844,46 +844,46 @@ target_dest( j_compress_ptr cinfo, VipsTarget *target ) + } + + int +-vips__jpeg_write_target( VipsImage *in, VipsTarget *target, +- int Q, const char *profile, ++vips__jpeg_write_target(VipsImage *in, VipsTarget *target, ++ int Q, const char *profile, + gboolean optimize_coding, gboolean progressive, + gboolean strip, gboolean trellis_quant, + gboolean overshoot_deringing, gboolean optimize_scans, + int quant_table, VipsForeignSubsample subsample_mode, +- int restart_interval ) ++ int restart_interval) + { + Write *write; + +- if( !(write = write_new( in )) ) +- return( -1 ); ++ if (!(write = write_new(in))) ++ return (-1); + + /* Make jpeg compression object. +- */ +- if( setjmp( write->eman.jmp ) ) { ++ */ ++ if (setjmp(write->eman.jmp)) { + /* Here for longjmp() during write_vips(). + */ +- write_destroy( write ); ++ write_destroy(write); + +- return( -1 ); ++ return (-1); + } +- jpeg_create_compress( &write->cinfo ); ++ jpeg_create_compress(&write->cinfo); + + /* Attach output. + */ +- target_dest( &write->cinfo, target ); ++ target_dest(&write->cinfo, target); + + /* Convert! Write errors come back here as an error return. + */ +- if( write_vips( write, +- Q, profile, optimize_coding, progressive, strip, +- trellis_quant, overshoot_deringing, optimize_scans, +- quant_table, subsample_mode, restart_interval ) ) { +- write_destroy( write ); +- return( -1 ); ++ if (write_vips(write, ++ Q, profile, optimize_coding, progressive, strip, ++ trellis_quant, overshoot_deringing, optimize_scans, ++ quant_table, subsample_mode, restart_interval)) { ++ write_destroy(write); ++ return (-1); + } +- write_destroy( write ); ++ write_destroy(write); + +- return( 0 ); ++ return (0); + } + + const char *vips__jpeg_suffs[] = { ".jpg", ".jpeg", ".jpe", NULL }; +diff --git a/libvips/foreign/vips2magick.c b/libvips/foreign/vips2magick.c +index ef9812764e..bd6bf2bc1f 100644 +--- a/libvips/foreign/vips2magick.c ++++ b/libvips/foreign/vips2magick.c +@@ -1,6 +1,6 @@ + /* save with libMagick + * +- * 22/12/17 dlemstra ++ * 22/12/17 dlemstra + * 6/2/19 DarthSim + * - fix GraphicsMagick support + * 17/2/19 +@@ -9,7 +9,7 @@ + * 29/6/19 + * - support "strip" option + * 6/7/19 [deftomat] +- * - support array of delays ++ * - support array of delays + * 5/8/19 DarthSim + * - support GIF optimization + * 21/4/21 kleisauke +@@ -20,28 +20,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -66,7 +66,7 @@ typedef struct _VipsForeignSaveMagick { + + /* Parameters. + */ +- char *filename; /* NULL during buffer output */ ++ char *filename; /* NULL during buffer output */ + char *format; + int quality; + int bitdepth; +@@ -93,35 +93,34 @@ typedef struct _VipsForeignSaveMagick { + + typedef VipsForeignSaveClass VipsForeignSaveMagickClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveMagick, vips_foreign_save_magick, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSaveMagick, vips_foreign_save_magick, ++ VIPS_TYPE_FOREIGN_SAVE); + + static void +-vips_foreign_save_magick_dispose( GObject *gobject ) ++vips_foreign_save_magick_dispose(GObject *gobject) + { + VipsForeignSaveMagick *magick = (VipsForeignSaveMagick *) gobject; + + #ifdef DEBUG +- printf( "vips_foreign_save_magick_dispose: %p\n", gobject ); ++ printf("vips_foreign_save_magick_dispose: %p\n", gobject); + #endif /*DEBUG*/ + +- VIPS_FREE( magick->filename ); +- VIPS_FREE( magick->map ); +- VIPS_FREEF( DestroyImageList, magick->images ); +- VIPS_FREEF( DestroyImageInfo, magick->image_info ); +- VIPS_FREEF( magick_destroy_exception, magick->exception ); +- g_value_unset( &magick->delay_gvalue ); ++ VIPS_FREE(magick->filename); ++ VIPS_FREE(magick->map); ++ VIPS_FREEF(DestroyImageList, magick->images); ++ VIPS_FREEF(DestroyImageInfo, magick->image_info); ++ VIPS_FREEF(magick_destroy_exception, magick->exception); ++ g_value_unset(&magick->delay_gvalue); + +- G_OBJECT_CLASS( vips_foreign_save_magick_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_magick_parent_class)->dispose(gobject); + } + + /* Move current_image on to the next image we will write. + */ + static int +-vips_foreign_save_magick_next_image( VipsForeignSaveMagick *magick ) ++vips_foreign_save_magick_next_image(VipsForeignSaveMagick *magick) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( magick ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(magick); + VipsForeignSave *save = (VipsForeignSave *) magick; + VipsImage *im = save->ready; + +@@ -130,12 +129,12 @@ vips_foreign_save_magick_next_image( VipsForeignSaveMagick *magick ) + const char *str; + int page_index; + +- g_assert( !magick->current_image ); ++ g_assert(!magick->current_image); + +- if( magick->images == NULL ) { +- if( !(image = magick_acquire_image( magick->image_info, +- magick->exception )) ) +- return( -1 ); ++ if (magick->images == NULL) { ++ if (!(image = magick_acquire_image(magick->image_info, ++ magick->exception))) ++ return (-1); + + magick->images = image; + magick->position.top = 0; +@@ -144,30 +143,30 @@ vips_foreign_save_magick_next_image( VipsForeignSaveMagick *magick ) + magick->position.height = magick->page_height; + } + else { +- image = GetLastImageInList( magick->images ); +- magick_acquire_next_image( magick->image_info, image, +- magick->exception ); +- if( GetNextImageInList( image ) == NULL ) +- return( -1 ); ++ image = GetLastImageInList(magick->images); ++ magick_acquire_next_image(magick->image_info, image, ++ magick->exception); ++ if (GetNextImageInList(image) == NULL) ++ return (-1); + +- image = SyncNextImageInList( image ); ++ image = SyncNextImageInList(image); + magick->position.top += magick->page_height; + } + +- if( !magick_set_image_size( image, +- im->Xsize, magick->page_height, magick->exception ) ) { +- magick_vips_error( class->nickname, magick->exception ); +- return( -1 ); ++ if (!magick_set_image_size(image, ++ im->Xsize, magick->page_height, magick->exception)) { ++ magick_vips_error(class->nickname, magick->exception); ++ return (-1); + } + + /* Delay must be converted from milliseconds into centiseconds + * as GIF image requires centiseconds. + */ +- if( magick->delays ) { ++ if (magick->delays) { + page_index = magick->position.top / magick->page_height; +- if( page_index < magick->delays_length ) +- image->delay = +- VIPS_RINT( magick->delays[page_index] / 10.0 ); ++ if (page_index < magick->delays_length) ++ image->delay = ++ VIPS_RINT(magick->delays[page_index] / 10.0); + } + + /* ImageMagick uses iterations like this (at least in gif save): +@@ -176,62 +175,62 @@ vips_foreign_save_magick_next_image( VipsForeignSaveMagick *magick ) + * 2 - loop once + * 3 - loop twice etc. + */ +- if( vips_image_get_typeof( im, "loop" ) && +- !vips_image_get_int( im, "loop", &number ) ) { ++ if (vips_image_get_typeof(im, "loop") && ++ !vips_image_get_int(im, "loop", &number)) { + image->iterations = (size_t) number; + } + else { + /* DEPRECATED "gif-loop" + * +- * We have the simple gif meaning, so we must add one unless ++ * We have the simple gif meaning, so we must add one unless + * it's zero. + */ +- if( vips_image_get_typeof( im, "gif-loop" ) && +- !vips_image_get_int( im, "gif-loop", &number ) ) ++ if (vips_image_get_typeof(im, "gif-loop") && ++ !vips_image_get_int(im, "gif-loop", &number)) + image->iterations = (size_t) (number ? number + 1 : 0); + } + +- if( vips_image_get_typeof( im, "gif-comment" ) && +- !vips_image_get_string( im, "gif-comment", &str ) ) +- magick_set_property( image, "comment", str, magick->exception ); ++ if (vips_image_get_typeof(im, "gif-comment") && ++ !vips_image_get_string(im, "gif-comment", &str)) ++ magick_set_property(image, "comment", str, magick->exception); + + /* libvips keeps animations as a set of independent frames, so we want + * to clear to the background between each one. + */ + image->dispose = BackgroundDispose; + +- if( !save->strip && +- magick_set_magick_profile( image, im, magick->exception ) ) { +- magick_vips_error( class->nickname, magick->exception ); +- return( -1 ); ++ if (!save->strip && ++ magick_set_magick_profile(image, im, magick->exception)) { ++ magick_vips_error(class->nickname, magick->exception); ++ return (-1); + } + + magick->current_image = image; +- +- return( 0 ); ++ ++ return (0); + } + + /* We've written all the pixels to current_image ... finish it off ready to + * move on. + */ + static void +-vips_foreign_save_magick_end_image( VipsForeignSaveMagick *magick ) ++vips_foreign_save_magick_end_image(VipsForeignSaveMagick *magick) + { +- if( magick->current_image ) { +- magick_inherit_exception( magick->exception, +- magick->current_image ); ++ if (magick->current_image) { ++ magick_inherit_exception(magick->exception, ++ magick->current_image); + magick->current_image = NULL; + } + } + +-/* Another block of pixels have arrived from libvips. ++/* Another block of pixels have arrived from libvips. + */ + static int +-vips_foreign_save_magick_write_block( VipsRegion *region, VipsRect *area, +- void *a ) ++vips_foreign_save_magick_write_block(VipsRegion *region, VipsRect *area, ++ void *a) + { + VipsForeignSaveMagick *magick = (VipsForeignSaveMagick *) a; +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( magick ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(magick); + + VipsRect pixels; + +@@ -240,52 +239,51 @@ vips_foreign_save_magick_write_block( VipsRegion *region, VipsRect *area, + VipsRect hit; + void *p; + +- if( !magick->current_image && +- vips_foreign_save_magick_next_image( magick ) ) +- return( -1 ); +- +- vips_rect_intersectrect( &pixels, &magick->position, &hit ); +- p = VIPS_REGION_ADDR( region, hit.left, hit.top ); +- if( !magick_import_pixels( magick->current_image, +- hit.left, hit.top - magick->position.top, +- hit.width, hit.height, +- magick->map, magick->storage_type, +- p, +- magick->exception ) ) { +- magick_vips_error( class->nickname, +- magick->exception ); +- return( -1 ); ++ if (!magick->current_image && ++ vips_foreign_save_magick_next_image(magick)) ++ return (-1); ++ ++ vips_rect_intersectrect(&pixels, &magick->position, &hit); ++ p = VIPS_REGION_ADDR(region, hit.left, hit.top); ++ if (!magick_import_pixels(magick->current_image, ++ hit.left, hit.top - magick->position.top, ++ hit.width, hit.height, ++ magick->map, magick->storage_type, ++ p, ++ magick->exception)) { ++ magick_vips_error(class->nickname, ++ magick->exception); ++ return (-1); + } + + /* Have we filled the page. + */ +- if( VIPS_RECT_BOTTOM( &hit ) == +- VIPS_RECT_BOTTOM( &magick->position ) ) +- vips_foreign_save_magick_end_image( magick ); ++ if (VIPS_RECT_BOTTOM(&hit) == ++ VIPS_RECT_BOTTOM(&magick->position)) ++ vips_foreign_save_magick_end_image(magick); + + pixels.top += hit.height; + pixels.height -= hit.height; +- } while( pixels.height > 0 ); ++ } while (pixels.height > 0); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_magick_build( VipsObject *object ) ++vips_foreign_save_magick_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveMagick *magick = (VipsForeignSaveMagick *) object; + + VipsImage *im; + + #ifdef DEBUG +- printf( "vips_foreign_save_magick_build: %p\n", object ); ++ printf("vips_foreign_save_magick_build: %p\n", object); + #endif /*DEBUG*/ + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_magick_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_magick_parent_class)->build(object)) ++ return (-1); + + magick_genesis(); + +@@ -294,9 +292,9 @@ vips_foreign_save_magick_build( VipsObject *object ) + im = save->ready; + + magick->exception = magick_acquire_exception(); +- magick->image_info = CloneImageInfo( NULL ); ++ magick->image_info = CloneImageInfo(NULL); + +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_UCHAR: + magick->storage_type = CharPixel; + break; +@@ -318,119 +316,119 @@ vips_foreign_save_magick_build( VipsObject *object ) + break; + + default: +- vips_error( class->nickname, +- "%s", _( "unsupported image format" ) ); +- return( -1 ); ++ vips_error(class->nickname, ++ "%s", _("unsupported image format")); ++ return (-1); + } + +- switch( im->Bands ) { ++ switch (im->Bands) { + case 1: +- magick->map = g_strdup( "I" ); ++ magick->map = g_strdup("I"); + break; + + case 2: +- magick->map = g_strdup( "IA" ); ++ magick->map = g_strdup("IA"); + break; + + case 3: +- magick->map = g_strdup( "RGB" ); ++ magick->map = g_strdup("RGB"); + break; + + case 4: +- if( im->Type == VIPS_INTERPRETATION_CMYK ) +- magick->map = g_strdup( "CMYK" ); ++ if (im->Type == VIPS_INTERPRETATION_CMYK) ++ magick->map = g_strdup("CMYK"); + else +- magick->map = g_strdup( "RGBA" ); ++ magick->map = g_strdup("RGBA"); + break; + + case 5: +- magick->map = g_strdup( "CMYKA" ); ++ magick->map = g_strdup("CMYKA"); + break; + + default: +- vips_error( class->nickname, +- "%s", _( "unsupported number of image bands" ) ); +- return( -1 ); ++ vips_error(class->nickname, ++ "%s", _("unsupported number of image bands")); ++ return (-1); + } + +- if( magick->format ) { +- vips_strncpy( magick->image_info->magick, +- magick->format, MaxPathExtent ); +- if( magick->filename ) +- (void) vips_snprintf( magick->image_info->filename, +- MaxPathExtent, "%s:%s", +- magick->format, magick->filename ); ++ if (magick->format) { ++ vips_strncpy(magick->image_info->magick, ++ magick->format, MaxPathExtent); ++ if (magick->filename) ++ (void) vips_snprintf(magick->image_info->filename, ++ MaxPathExtent, "%s:%s", ++ magick->format, magick->filename); + } +- else if( magick->filename ) { +- vips_strncpy( magick->image_info->filename, +- magick->filename, MaxPathExtent ); ++ else if (magick->filename) { ++ vips_strncpy(magick->image_info->filename, ++ magick->filename, MaxPathExtent); + } + +- if( magick->quality > 0 ) ++ if (magick->quality > 0) + magick->image_info->quality = magick->quality; + +- magick->page_height = vips_image_get_page_height( im ); ++ magick->page_height = vips_image_get_page_height(im); + + /* Get as a gvalue so we can keep a ref to the delay array while we + * need it. + */ +- if( vips_image_get_typeof( im, "delay" ) ) { +- g_value_unset( &magick->delay_gvalue ); +- if( vips_image_get( im, "delay", &magick->delay_gvalue ) ) +- return( -1 ); +- magick->delays = vips_value_get_array_int( +- &magick->delay_gvalue, &magick->delays_length ); ++ if (vips_image_get_typeof(im, "delay")) { ++ g_value_unset(&magick->delay_gvalue); ++ if (vips_image_get(im, "delay", &magick->delay_gvalue)) ++ return (-1); ++ magick->delays = vips_value_get_array_int( ++ &magick->delay_gvalue, &magick->delays_length); + } + +- if( vips_sink_disc( im, +- vips_foreign_save_magick_write_block, magick ) ) +- return( -1 ); ++ if (vips_sink_disc(im, ++ vips_foreign_save_magick_write_block, magick)) ++ return (-1); + +- if( magick->optimize_gif_frames ) { +- if( !magick_optimize_image_layers( &magick->images, +- magick->exception ) ) { +- magick_inherit_exception( magick->exception, +- magick->images ); +- magick_vips_error( class->nickname, magick->exception ); ++ if (magick->optimize_gif_frames) { ++ if (!magick_optimize_image_layers(&magick->images, ++ magick->exception)) { ++ magick_inherit_exception(magick->exception, ++ magick->images); ++ magick_vips_error(class->nickname, magick->exception); + +- return( -1 ); ++ return (-1); + } + } + +- if( magick->optimize_gif_transparency ) { +- if( !magick_optimize_image_transparency( magick->images, +- magick->exception ) ) { +- magick_inherit_exception( magick->exception, +- magick->images ); +- magick_vips_error( class->nickname, magick->exception ); ++ if (magick->optimize_gif_transparency) { ++ if (!magick_optimize_image_transparency(magick->images, ++ magick->exception)) { ++ magick_inherit_exception(magick->exception, ++ magick->images); ++ magick_vips_error(class->nickname, magick->exception); + +- return( -1 ); ++ return (-1); + } + } +- ++ + /* Bitdepth <= 8 requested? Quantize/Dither images. + * ImageMagick then selects the appropriate bit depth when writing + * the actual image (e.g. BMP or GIF). + */ +- if( magick->bitdepth ) { +- if ( !magick_quantize_images( magick->images, +- magick->bitdepth, magick->exception ) ) { +- magick_inherit_exception( magick->exception, +- magick->images ); +- magick_vips_error( class->nickname, magick->exception ); +- +- return( -1 ); ++ if (magick->bitdepth) { ++ if (!magick_quantize_images(magick->images, ++ magick->bitdepth, magick->exception)) { ++ magick_inherit_exception(magick->exception, ++ magick->images); ++ magick_vips_error(class->nickname, magick->exception); ++ ++ return (-1); + } + } + +- return( 0 ); ++ return (0); + } + + /* We could call into libMagick and discover what save formats it supports, but + * that would mean starting up libMagick on libvips init, and that would add a + * lot of time. + * +- * Instead, just list the commonly-used formats that all libMagicks support and ++ * Instead, just list the commonly-used formats that all libMagicks support and + * that libvips does not. + */ + static const char *vips__save_magick_suffs[] = { NULL }; +@@ -451,9 +449,9 @@ static VipsBandFormat bandfmt_magick[10] = { + }; + + static void +-vips_foreign_save_magick_class_init( VipsForeignSaveMagickClass *class ) ++vips_foreign_save_magick_class_init(VipsForeignSaveMagickClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsOperationClass *operation_class = (VipsOperationClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; +@@ -464,7 +462,7 @@ vips_foreign_save_magick_class_init( VipsForeignSaveMagickClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "magicksave_base"; +- object_class->description = _( "save with ImageMagick" ); ++ object_class->description = _("save with ImageMagick"); + object_class->build = vips_foreign_save_magick_build; + + /* *magick is fuzzed, but it's such a huge thing it's safer to +@@ -481,50 +479,50 @@ vips_foreign_save_magick_class_init( VipsForeignSaveMagickClass *class ) + save_class->saveable = VIPS_SAVEABLE_ANY; + save_class->format_table = bandfmt_magick; + +- VIPS_ARG_STRING( class, "format", 2, +- _( "Format" ), +- _( "Format to save in" ), ++ VIPS_ARG_STRING(class, "format", 2, ++ _("Format"), ++ _("Format to save in"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveMagick, format ), +- NULL ); ++ G_STRUCT_OFFSET(VipsForeignSaveMagick, format), ++ NULL); + +- VIPS_ARG_INT( class, "quality", 3, +- _( "Quality" ), +- _( "Quality to use" ), ++ VIPS_ARG_INT(class, "quality", 3, ++ _("Quality"), ++ _("Quality to use"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveMagick, quality ), +- 0, 100, 0 ); ++ G_STRUCT_OFFSET(VipsForeignSaveMagick, quality), ++ 0, 100, 0); + +- VIPS_ARG_BOOL( class, "optimize_gif_frames", 4, +- _( "Optimize_gif_frames" ), +- _( "Apply GIF frames optimization" ), ++ VIPS_ARG_BOOL(class, "optimize_gif_frames", 4, ++ _("Optimize_gif_frames"), ++ _("Apply GIF frames optimization"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveMagick, optimize_gif_frames ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveMagick, optimize_gif_frames), ++ FALSE); + +- VIPS_ARG_BOOL( class, "optimize_gif_transparency", 5, +- _( "Optimize_gif_transparency" ), +- _( "Apply GIF transparency optimization" ), ++ VIPS_ARG_BOOL(class, "optimize_gif_transparency", 5, ++ _("Optimize_gif_transparency"), ++ _("Apply GIF transparency optimization"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveMagick, +- optimize_gif_transparency ), +- FALSE ); +- +- VIPS_ARG_INT( class, "bitdepth", 6, +- _( "Bit depth" ), +- _( "Number of bits per pixel" ), ++ G_STRUCT_OFFSET(VipsForeignSaveMagick, ++ optimize_gif_transparency), ++ FALSE); ++ ++ VIPS_ARG_INT(class, "bitdepth", 6, ++ _("Bit depth"), ++ _("Number of bits per pixel"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveMagick, bitdepth ), ++ G_STRUCT_OFFSET(VipsForeignSaveMagick, bitdepth), + 0, 8, 0); + } + + static void +-vips_foreign_save_magick_init( VipsForeignSaveMagick *magick ) ++vips_foreign_save_magick_init(VipsForeignSaveMagick *magick) + { + /* Init to an int just to have something there. It is swapped for an + * int array later. + */ +- g_value_init( &magick->delay_gvalue, G_TYPE_INT ); ++ g_value_init(&magick->delay_gvalue, G_TYPE_INT); + magick->bitdepth = 0; + } + +@@ -537,58 +535,56 @@ typedef struct _VipsForeignSaveMagickFile { + + typedef VipsForeignSaveMagickClass VipsForeignSaveMagickFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveMagickFile, vips_foreign_save_magick_file, +- vips_foreign_save_magick_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveMagickFile, vips_foreign_save_magick_file, ++ vips_foreign_save_magick_get_type()); + + static int +-vips_foreign_save_magick_file_build( VipsObject *object ) ++vips_foreign_save_magick_file_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsForeignSaveMagick *magick = (VipsForeignSaveMagick *) object; + VipsForeignSaveMagickFile *file = (VipsForeignSaveMagickFile *) object; + +- magick->filename = g_strdup( file->filename ); ++ magick->filename = g_strdup(file->filename); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_magick_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_magick_file_parent_class)->build(object)) ++ return (-1); + +- if( !WriteImages( magick->image_info, magick->images, +- magick->image_info->filename, magick->exception ) ) { +- magick_inherit_exception( magick->exception, magick->images ); +- magick_vips_error( class->nickname, magick->exception ); ++ if (!WriteImages(magick->image_info, magick->images, ++ magick->image_info->filename, magick->exception)) { ++ magick_inherit_exception(magick->exception, magick->images); ++ magick_vips_error(class->nickname, magick->exception); + +- return( -1 ); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static void + vips_foreign_save_magick_file_class_init( +- VipsForeignSaveMagickFileClass *class ) ++ VipsForeignSaveMagickFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "magicksave"; +- object_class->description = _( "save file with ImageMagick" ); ++ object_class->description = _("save file with ImageMagick"); + object_class->build = vips_foreign_save_magick_file_build; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveMagickFile, filename ), +- NULL ); +- ++ G_STRUCT_OFFSET(VipsForeignSaveMagickFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_magick_file_init( VipsForeignSaveMagickFile *file ) ++vips_foreign_save_magick_file_init(VipsForeignSaveMagickFile *file) + { + } + +@@ -603,84 +599,82 @@ typedef struct _VipsForeignSaveMagickBuffer { + + typedef VipsForeignSaveMagickClass VipsForeignSaveMagickBufferClass; + +-G_DEFINE_TYPE( VipsForeignSaveMagickBuffer, vips_foreign_save_magick_buffer, +- vips_foreign_save_magick_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveMagickBuffer, vips_foreign_save_magick_buffer, ++ vips_foreign_save_magick_get_type()); + + static int +-vips_foreign_save_magick_buffer_build( VipsObject *object ) ++vips_foreign_save_magick_buffer_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsForeignSaveMagick *magick = (VipsForeignSaveMagick *) object; +- VipsForeignSaveMagickBuffer *buffer = ++ VipsForeignSaveMagickBuffer *buffer = + (VipsForeignSaveMagickBuffer *) object; + + void *obuf; + size_t olen; + VipsBlob *blob; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_magick_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_magick_buffer_parent_class)->build(object)) ++ return (-1); + +- if( !(obuf = magick_images_to_blob( magick->image_info, magick->images, +- &olen, magick->exception )) ) { +- magick_inherit_exception( magick->exception, magick->images ); +- magick_vips_error( class->nickname, magick->exception ); ++ if (!(obuf = magick_images_to_blob(magick->image_info, magick->images, ++ &olen, magick->exception))) { ++ magick_inherit_exception(magick->exception, magick->images); ++ magick_vips_error(class->nickname, magick->exception); + +- return( -1 ); ++ return (-1); + } + +- blob = vips_blob_new( (VipsCallbackFn) vips_area_free_cb, obuf, olen ); +- g_object_set( buffer, "buffer", blob, NULL ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ blob = vips_blob_new((VipsCallbackFn) vips_area_free_cb, obuf, olen); ++ g_object_set(buffer, "buffer", blob, NULL); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_magick_buffer_class_init( +- VipsForeignSaveMagickBufferClass *class ) ++vips_foreign_save_magick_buffer_class_init( ++ VipsForeignSaveMagickBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "magicksave_buffer"; +- object_class->description = _( "save image to magick buffer" ); ++ object_class->description = _("save image to magick buffer"); + object_class->build = vips_foreign_save_magick_buffer_build; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to save to" ), ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to save to"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsForeignSaveMagickBuffer, buf ), +- VIPS_TYPE_BLOB ); +- ++ G_STRUCT_OFFSET(VipsForeignSaveMagickBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_save_magick_buffer_init( VipsForeignSaveMagickBuffer *buffer ) ++vips_foreign_save_magick_buffer_init(VipsForeignSaveMagickBuffer *buffer) + { + } + + typedef VipsForeignSaveMagickFile VipsForeignSaveMagickBmpFile; + typedef VipsForeignSaveMagickFileClass VipsForeignSaveMagickBmpFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveMagickBmpFile, vips_foreign_save_magick_bmp_file, +- vips_foreign_save_magick_file_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveMagickBmpFile, vips_foreign_save_magick_bmp_file, ++ vips_foreign_save_magick_file_get_type()); + + static void +-vips_foreign_save_magick_bmp_file_class_init( +- VipsForeignSaveMagickBmpFileClass *class ) ++vips_foreign_save_magick_bmp_file_class_init( ++ VipsForeignSaveMagickBmpFileClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsOperationClass *operation_class = (VipsOperationClass *) class; + + object_class->nickname = "magicksave_bmp"; +- object_class->description = _( "save bmp image with ImageMagick" ); ++ object_class->description = _("save bmp image with ImageMagick"); + + foreign_class->suffs = vips__save_magick_bmp_suffs; + +@@ -690,30 +684,30 @@ vips_foreign_save_magick_bmp_file_class_init( + } + + static void +-vips_foreign_save_magick_bmp_file_init( VipsForeignSaveMagickBmpFile *file ) ++vips_foreign_save_magick_bmp_file_init(VipsForeignSaveMagickBmpFile *file) + { + VipsForeignSaveMagick *magick = (VipsForeignSaveMagick *) file; + +- VIPS_SETSTR( magick->format, "bmp" ); ++ VIPS_SETSTR(magick->format, "bmp"); + } + + typedef VipsForeignSaveMagickBuffer VipsForeignSaveMagickBmpBuffer; + typedef VipsForeignSaveMagickBufferClass VipsForeignSaveMagickBmpBufferClass; + +-G_DEFINE_TYPE( VipsForeignSaveMagickBmpBuffer, +- vips_foreign_save_magick_bmp_buffer, +- vips_foreign_save_magick_buffer_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveMagickBmpBuffer, ++ vips_foreign_save_magick_bmp_buffer, ++ vips_foreign_save_magick_buffer_get_type()); + + static void + vips_foreign_save_magick_bmp_buffer_class_init( +- VipsForeignSaveMagickBmpBufferClass *class ) ++ VipsForeignSaveMagickBmpBufferClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsOperationClass *operation_class = (VipsOperationClass *) class; + + object_class->nickname = "magicksave_bmp_buffer"; +- object_class->description = _( "save bmp image to magick buffer" ); ++ object_class->description = _("save bmp image to magick buffer"); + + foreign_class->suffs = vips__save_magick_bmp_suffs; + +@@ -723,30 +717,30 @@ vips_foreign_save_magick_bmp_buffer_class_init( + } + + static void +-vips_foreign_save_magick_bmp_buffer_init( +- VipsForeignSaveMagickBmpBuffer *buffer ) ++vips_foreign_save_magick_bmp_buffer_init( ++ VipsForeignSaveMagickBmpBuffer *buffer) + { + VipsForeignSaveMagick *magick = (VipsForeignSaveMagick *) buffer; + +- VIPS_SETSTR( magick->format, "bmp" ); ++ VIPS_SETSTR(magick->format, "bmp"); + } + + typedef VipsForeignSaveMagickFile VipsForeignSaveMagickGifFile; + typedef VipsForeignSaveMagickFileClass VipsForeignSaveMagickGifFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveMagickGifFile, vips_foreign_save_magick_gif_file, +- vips_foreign_save_magick_file_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveMagickGifFile, vips_foreign_save_magick_gif_file, ++ vips_foreign_save_magick_file_get_type()); + + static void +-vips_foreign_save_magick_gif_file_class_init( +- VipsForeignSaveMagickGifFileClass *class ) ++vips_foreign_save_magick_gif_file_class_init( ++ VipsForeignSaveMagickGifFileClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsOperationClass *operation_class = (VipsOperationClass *) class; + + object_class->nickname = "magicksave_gif"; +- object_class->description = _( "save gif image with ImageMagick" ); ++ object_class->description = _("save gif image with ImageMagick"); + + foreign_class->suffs = vips__save_magick_gif_suffs; + +@@ -756,30 +750,30 @@ vips_foreign_save_magick_gif_file_class_init( + } + + static void +-vips_foreign_save_magick_gif_file_init( VipsForeignSaveMagickGifFile *file ) ++vips_foreign_save_magick_gif_file_init(VipsForeignSaveMagickGifFile *file) + { + VipsForeignSaveMagick *magick = (VipsForeignSaveMagick *) file; + +- VIPS_SETSTR( magick->format, "gif" ); ++ VIPS_SETSTR(magick->format, "gif"); + } + + typedef VipsForeignSaveMagickBuffer VipsForeignSaveMagickGifBuffer; + typedef VipsForeignSaveMagickBufferClass VipsForeignSaveMagickGifBufferClass; + +-G_DEFINE_TYPE( VipsForeignSaveMagickGifBuffer, +- vips_foreign_save_magick_gif_buffer, +- vips_foreign_save_magick_buffer_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveMagickGifBuffer, ++ vips_foreign_save_magick_gif_buffer, ++ vips_foreign_save_magick_buffer_get_type()); + + static void + vips_foreign_save_magick_gif_buffer_class_init( +- VipsForeignSaveMagickGifBufferClass *class ) ++ VipsForeignSaveMagickGifBufferClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsOperationClass *operation_class = (VipsOperationClass *) class; + + object_class->nickname = "magicksave_gif_buffer"; +- object_class->description = _( "save gif image to magick buffer" ); ++ object_class->description = _("save gif image to magick buffer"); + + foreign_class->suffs = vips__save_magick_gif_suffs; + +@@ -789,12 +783,12 @@ vips_foreign_save_magick_gif_buffer_class_init( + } + + static void +-vips_foreign_save_magick_gif_buffer_init( +- VipsForeignSaveMagickGifBuffer *buffer ) ++vips_foreign_save_magick_gif_buffer_init( ++ VipsForeignSaveMagickGifBuffer *buffer) + { + VipsForeignSaveMagick *magick = (VipsForeignSaveMagick *) buffer; + +- VIPS_SETSTR( magick->format, "gif" ); ++ VIPS_SETSTR(magick->format, "gif"); + } + + #endif /*ENABLE_MAGICKSAVE*/ +diff --git a/libvips/foreign/vips2tiff.c b/libvips/foreign/vips2tiff.c +index 058cece76b..6cb9741458 100644 +--- a/libvips/foreign/vips2tiff.c ++++ b/libvips/foreign/vips2tiff.c +@@ -7,7 +7,7 @@ + * software program in whole or part. Users may copy, modify or + * distribute this file at will. + * +- * MODIFICATION FOR VIPS Copyright 1991, K.Martinez ++ * MODIFICATION FOR VIPS Copyright 1991, K.Martinez + * + * software may be distributed FREE, with these copyright notices + * no responsibility/warantee is implied or given +@@ -69,7 +69,7 @@ + * 19/7/04 + * - write several scanlines at once, good speed up for some cases + * 22/9/04 +- * - got rid of wrapper image so nip gets progress feedback ++ * - got rid of wrapper image so nip gets progress feedback + * - fixed tiny read-beyond-buffer issue for edge tiles + * 7/10/04 + * - added ICC profile embedding +@@ -80,11 +80,11 @@ + * 9/3/05 + * - set PHOTOMETRIC_CIELAB for vips TYPE_LAB images ... so we can write + * float LAB as well as float RGB +- * - also LABS images ++ * - also LABS images + * 22/6/05 + * - 16 bit LAB write was broken + * 9/9/05 +- * - write any icc profile from meta ++ * - write any icc profile from meta + * 3/3/06 + * - raise tile buffer limit (thanks Ruven) + * 11/11/06 +@@ -95,7 +95,7 @@ + * 3/11/07 + * - use im_wbuffer() for background writes + * 15/2/08 +- * - set TIFFTAG_JPEGQUALITY explicitly when we copy TIFF files, since ++ * - set TIFFTAG_JPEGQUALITY explicitly when we copy TIFF files, since + * libtiff doesn't keep this in the header (thanks Joe) + * 20/2/08 + * - use tiff error handler from im_tiff2vips.c +@@ -169,8 +169,8 @@ + * 14/10/16 + * - add buffer output + * 29/1/17 +- * - enable bigtiff automatically for large, uncompressed writes, thanks +- * AndreasSchmid1 ++ * - enable bigtiff automatically for large, uncompressed writes, thanks ++ * AndreasSchmid1 + * 26/8/17 + * - support pyramid creation to buffer, thanks bubba + * 24/10/17 +@@ -208,32 +208,32 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +-/* ++/* + #define DEBUG_VERBOSE + #define DEBUG + */ +@@ -293,18 +293,18 @@ typedef struct _Wtiff Wtiff; + /* A layer in the pyramid. + */ + struct _Layer { +- Wtiff *wtiff; /* Main wtiff struct */ ++ Wtiff *wtiff; /* Main wtiff struct */ + + /* The temp target for this layer. + */ + VipsTarget *target; + +- int width, height; /* Layer size */ +- int sub; /* Subsample factor for this layer */ +- TIFF *tif; /* TIFF file we write this layer to */ ++ int width, height; /* Layer size */ ++ int sub; /* Subsample factor for this layer */ ++ TIFF *tif; /* TIFF file we write this layer to */ + + /* The image we build. We only keep a few scanlines of this around in +- * @strip. ++ * @strip. + */ + VipsImage *image; + +@@ -312,21 +312,21 @@ struct _Layer { + */ + int y; + +- /* The next line we write to in strip. ++ /* The next line we write to in strip. + */ + int write_y; + +- VipsRegion *strip; /* The current strip of pixels */ +- VipsRegion *copy; /* Pixels we copy to the next strip */ ++ VipsRegion *strip; /* The current strip of pixels */ ++ VipsRegion *copy; /* Pixels we copy to the next strip */ + +- Layer *below; /* The smaller layer below us */ +- Layer *above; /* The larger layer above */ ++ Layer *below; /* The smaller layer below us */ ++ Layer *above; /* The larger layer above */ + }; + + /* A TIFF image in the process of being written. + */ + struct _Wtiff { +- VipsImage *input; /* Original input image */ ++ VipsImage *input; /* Original input image */ + + /* Image transformed ready for write. + */ +@@ -336,32 +336,32 @@ struct _Wtiff { + */ + VipsTarget *target; + +- Layer *layer; /* Top of pyramid */ +- VipsPel *tbuf; /* TIFF output buffer */ +- int tls; /* Tile line size */ +- +- int compression; /* libtiff compression type */ +- int Q; /* JPEG q-factor, webp level */ +- int predictor; /* libtiff predictor type */ +- int tile; /* Tile or not */ +- int tilew, tileh; /* Tile size */ +- int pyramid; /* Wtiff pyramid */ +- int bitdepth; /* Write as 1, 2 or 4 bit */ +- int miniswhite; /* Wtiff as 0 == white */ +- int resunit; /* Resolution unit (inches or cm) */ +- double xres; /* Resolution in X */ +- double yres; /* Resolution in Y */ +- const char *profile; /* Profile to embed */ +- int bigtiff; /* True for bigtiff write */ +- int rgbjpeg; /* True for RGB not YCbCr */ +- int properties; /* Set to save XML props */ +- int strip; /* Don't write metadata */ ++ Layer *layer; /* Top of pyramid */ ++ VipsPel *tbuf; /* TIFF output buffer */ ++ int tls; /* Tile line size */ ++ ++ int compression; /* libtiff compression type */ ++ int Q; /* JPEG q-factor, webp level */ ++ int predictor; /* libtiff predictor type */ ++ int tile; /* Tile or not */ ++ int tilew, tileh; /* Tile size */ ++ int pyramid; /* Wtiff pyramid */ ++ int bitdepth; /* Write as 1, 2 or 4 bit */ ++ int miniswhite; /* Wtiff as 0 == white */ ++ int resunit; /* Resolution unit (inches or cm) */ ++ double xres; /* Resolution in X */ ++ double yres; /* Resolution in Y */ ++ const char *profile; /* Profile to embed */ ++ int bigtiff; /* True for bigtiff write */ ++ int rgbjpeg; /* True for RGB not YCbCr */ ++ int properties; /* Set to save XML props */ ++ int strip; /* Don't write metadata */ + VipsRegionShrink region_shrink; /* How to shrink regions */ +- int level; /* zstd compression level */ +- gboolean lossless; /* lossless mode */ +- VipsForeignDzDepth depth; /* Pyr depth */ +- gboolean subifd; /* Write pyr layers into subifds */ +- gboolean premultiply; /* Premultiply alpha */ ++ int level; /* zstd compression level */ ++ gboolean lossless; /* lossless mode */ ++ VipsForeignDzDepth depth; /* Pyr depth */ ++ gboolean subifd; /* Write pyr layers into subifds */ ++ gboolean premultiply; /* Premultiply alpha */ + + /* True if we've detected a toilet-roll image, plus the page height, + * which has been checked to be a factor of im->Ysize. page_number +@@ -378,7 +378,7 @@ struct _Wtiff { + int image_height; + + /* TRUE if the compression type is not supported by libtiff directly +- * and we must compress ourselves. ++ * and we must compress ourselves. + */ + gboolean we_compress; + }; +@@ -386,62 +386,62 @@ struct _Wtiff { + /* Write an ICC Profile from a file into the JPEG stream. + */ + static int +-embed_profile_file( TIFF *tif, const char *profile ) ++embed_profile_file(TIFF *tif, const char *profile) + { + VipsBlob *blob; + +- if( vips_profile_load( profile, &blob, NULL ) ) +- return( -1 ); ++ if (vips_profile_load(profile, &blob, NULL)) ++ return (-1); + +- if( blob ) { ++ if (blob) { + size_t length; +- const void *data = vips_blob_get( blob, &length ); ++ const void *data = vips_blob_get(blob, &length); + +- TIFFSetField( tif, TIFFTAG_ICCPROFILE, length, data ); ++ TIFFSetField(tif, TIFFTAG_ICCPROFILE, length, data); + + #ifdef DEBUG +- printf( "vips2tiff: attached profile \"%s\"\n", profile ); ++ printf("vips2tiff: attached profile \"%s\"\n", profile); + #endif /*DEBUG*/ + +- vips_area_unref( (VipsArea *) blob ); ++ vips_area_unref((VipsArea *) blob); + } + +- return( 0 ); ++ return (0); + } + + /* Embed an ICC profile from VipsImage metadata. + */ + static int +-embed_profile_meta( TIFF *tif, VipsImage *im ) ++embed_profile_meta(TIFF *tif, VipsImage *im) + { + const void *data; + size_t length; + +- if( vips_image_get_blob( im, VIPS_META_ICC_NAME, &data, &length ) ) +- return( -1 ); +- TIFFSetField( tif, TIFFTAG_ICCPROFILE, length, data ); ++ if (vips_image_get_blob(im, VIPS_META_ICC_NAME, &data, &length)) ++ return (-1); ++ TIFFSetField(tif, TIFFTAG_ICCPROFILE, length, data); + + #ifdef DEBUG +- printf( "vips2tiff: attached profile from meta\n" ); ++ printf("vips2tiff: attached profile from meta\n"); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + static void +-wtiff_layer_init( Wtiff *wtiff, Layer **layer, Layer *above, +- int width, int height ) ++wtiff_layer_init(Wtiff *wtiff, Layer **layer, Layer *above, ++ int width, int height) + { +- if( !*layer ) { +- *layer = VIPS_NEW( wtiff->ready, Layer ); ++ if (!*layer) { ++ *layer = VIPS_NEW(wtiff->ready, Layer); + (*layer)->wtiff = wtiff; + (*layer)->width = width; +- (*layer)->height = height; ++ (*layer)->height = height; + +- if( !above ) ++ if (!above) + /* Top of pyramid. + */ +- (*layer)->sub = 1; ++ (*layer)->sub = 1; + else + (*layer)->sub = above->sub * 2; + +@@ -458,13 +458,13 @@ wtiff_layer_init( Wtiff *wtiff, Layer **layer, Layer *above, + /* The target we write to. The base layer writes to the main + * output, each layer smaller writes to a memory temp. + */ +- if( !above ) { ++ if (!above) { + (*layer)->target = wtiff->target; +- g_object_ref( (*layer)->target ); ++ g_object_ref((*layer)->target); + } +- else +- (*layer)->target = +- vips_target_new_temp( wtiff->target ); ++ else ++ (*layer)->target = ++ vips_target_new_temp(wtiff->target); + + /* + printf( "wtiff_layer_init: sub = %d, width = %d, height = %d\n", +@@ -472,10 +472,10 @@ wtiff_layer_init( Wtiff *wtiff, Layer **layer, Layer *above, + */ + } + +- if( wtiff->pyramid ) { ++ if (wtiff->pyramid) { + int limitw, limith; + +- switch( wtiff->depth ) { ++ switch (wtiff->depth) { + case VIPS_FOREIGN_DZ_DEPTH_ONEPIXEL: + limitw = limith = 1; + break; +@@ -500,221 +500,219 @@ wtiff_layer_init( Wtiff *wtiff, Layer **layer, Layer *above, + * Very tall or wide images might end up with a smallest layer + * larger than one tile. + */ +- if( ((*layer)->width > limitw || +- (*layer)->height > limith) && +- (*layer)->width > 1 && +- (*layer)->height > 1 ) +- wtiff_layer_init( wtiff, &(*layer)->below, *layer, +- width / 2, height / 2 ); ++ if (((*layer)->width > limitw || ++ (*layer)->height > limith) && ++ (*layer)->width > 1 && ++ (*layer)->height > 1) ++ wtiff_layer_init(wtiff, &(*layer)->below, *layer, ++ width / 2, height / 2); + } + } + + static int +-wtiff_embed_profile( Wtiff *wtiff, TIFF *tif ) ++wtiff_embed_profile(Wtiff *wtiff, TIFF *tif) + { +- if( wtiff->profile && +- embed_profile_file( tif, wtiff->profile ) ) +- return( -1 ); ++ if (wtiff->profile && ++ embed_profile_file(tif, wtiff->profile)) ++ return (-1); + +- if( !wtiff->profile && +- vips_image_get_typeof( wtiff->ready, VIPS_META_ICC_NAME ) && +- embed_profile_meta( tif, wtiff->ready ) ) +- return( -1 ); ++ if (!wtiff->profile && ++ vips_image_get_typeof(wtiff->ready, VIPS_META_ICC_NAME) && ++ embed_profile_meta(tif, wtiff->ready)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-wtiff_embed_xmp( Wtiff *wtiff, TIFF *tif ) ++wtiff_embed_xmp(Wtiff *wtiff, TIFF *tif) + { + const void *data; + size_t size; + +- if( !vips_image_get_typeof( wtiff->ready, VIPS_META_XMP_NAME ) ) +- return( 0 ); +- if( vips_image_get_blob( wtiff->ready, VIPS_META_XMP_NAME, +- &data, &size ) ) +- return( -1 ); +- TIFFSetField( tif, TIFFTAG_XMLPACKET, size, data ); ++ if (!vips_image_get_typeof(wtiff->ready, VIPS_META_XMP_NAME)) ++ return (0); ++ if (vips_image_get_blob(wtiff->ready, VIPS_META_XMP_NAME, ++ &data, &size)) ++ return (-1); ++ TIFFSetField(tif, TIFFTAG_XMLPACKET, size, data); + + #ifdef DEBUG +- printf( "vips2tiff: attached XMP from meta\n" ); ++ printf("vips2tiff: attached XMP from meta\n"); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + static int +-wtiff_embed_iptc( Wtiff *wtiff, TIFF *tif ) ++wtiff_embed_iptc(Wtiff *wtiff, TIFF *tif) + { + const void *data; + size_t size; + +- if( !vips_image_get_typeof( wtiff->ready, VIPS_META_IPTC_NAME ) ) +- return( 0 ); +- if( vips_image_get_blob( wtiff->ready, VIPS_META_IPTC_NAME, +- &data, &size ) ) +- return( -1 ); ++ if (!vips_image_get_typeof(wtiff->ready, VIPS_META_IPTC_NAME)) ++ return (0); ++ if (vips_image_get_blob(wtiff->ready, VIPS_META_IPTC_NAME, ++ &data, &size)) ++ return (-1); + + /* For no very good reason, libtiff stores IPTC as an array of + * long, not byte. + */ +- if( size & 3 ) { +- g_warning( "%s", _( "rounding up IPTC data length" ) ); ++ if (size & 3) { ++ g_warning("%s", _("rounding up IPTC data length")); + size /= 4; + size += 1; + } + else + size /= 4; + +- TIFFSetField( tif, TIFFTAG_RICHTIFFIPTC, size, data ); ++ TIFFSetField(tif, TIFFTAG_RICHTIFFIPTC, size, data); + + #ifdef DEBUG +- printf( "vips2tiff: attached IPTC from meta\n" ); ++ printf("vips2tiff: attached IPTC from meta\n"); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + static int +-wtiff_embed_photoshop( Wtiff *wtiff, TIFF *tif ) ++wtiff_embed_photoshop(Wtiff *wtiff, TIFF *tif) + { + const void *data; + size_t size; + +- if( !vips_image_get_typeof( wtiff->ready, VIPS_META_PHOTOSHOP_NAME ) ) +- return( 0 ); +- if( vips_image_get_blob( wtiff->ready, VIPS_META_PHOTOSHOP_NAME, +- &data, &size ) ) +- return( -1 ); +- TIFFSetField( tif, TIFFTAG_PHOTOSHOP, size, data ); ++ if (!vips_image_get_typeof(wtiff->ready, VIPS_META_PHOTOSHOP_NAME)) ++ return (0); ++ if (vips_image_get_blob(wtiff->ready, VIPS_META_PHOTOSHOP_NAME, ++ &data, &size)) ++ return (-1); ++ TIFFSetField(tif, TIFFTAG_PHOTOSHOP, size, data); + + #ifdef DEBUG +- printf( "vips2tiff: attached photoshop data from meta\n" ); ++ printf("vips2tiff: attached photoshop data from meta\n"); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + /* Set IMAGEDESCRIPTION, if it's there. If @properties is TRUE, set from + * vips' metadata. + */ + static int +-wtiff_embed_imagedescription( Wtiff *wtiff, TIFF *tif ) ++wtiff_embed_imagedescription(Wtiff *wtiff, TIFF *tif) + { +- if( wtiff->properties ) { ++ if (wtiff->properties) { + char *doc; + +- if( !(doc = vips__xml_properties( wtiff->ready )) ) +- return( -1 ); +- TIFFSetField( tif, TIFFTAG_IMAGEDESCRIPTION, doc ); +- g_free( doc ); ++ if (!(doc = vips__xml_properties(wtiff->ready))) ++ return (-1); ++ TIFFSetField(tif, TIFFTAG_IMAGEDESCRIPTION, doc); ++ g_free(doc); + } + else { + const char *imagedescription; + +- if( !vips_image_get_typeof( wtiff->ready, +- VIPS_META_IMAGEDESCRIPTION ) ) +- return( 0 ); +- if( vips_image_get_string( wtiff->ready, +- VIPS_META_IMAGEDESCRIPTION, &imagedescription ) ) +- return( -1 ); +- TIFFSetField( tif, TIFFTAG_IMAGEDESCRIPTION, imagedescription ); ++ if (!vips_image_get_typeof(wtiff->ready, ++ VIPS_META_IMAGEDESCRIPTION)) ++ return (0); ++ if (vips_image_get_string(wtiff->ready, ++ VIPS_META_IMAGEDESCRIPTION, &imagedescription)) ++ return (-1); ++ TIFFSetField(tif, TIFFTAG_IMAGEDESCRIPTION, imagedescription); + } + + #ifdef DEBUG +- printf( "vips2tiff: attached imagedescription from meta\n" ); ++ printf("vips2tiff: attached imagedescription from meta\n"); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + +-/* Write a TIFF header for this layer. ++/* Write a TIFF header for this layer. + */ + static int +-wtiff_write_header( Wtiff *wtiff, Layer *layer ) ++wtiff_write_header(Wtiff *wtiff, Layer *layer) + { + TIFF *tif = layer->tif; + + int i; +- int orientation; ++ int orientation; + + #ifdef DEBUG +- printf( "wtiff_write_header: sub %d, width %d, height %d\n", +- layer->sub, layer->width, layer->height ); ++ printf("wtiff_write_header: sub %d, width %d, height %d\n", ++ layer->sub, layer->width, layer->height); + #endif /*DEBUG*/ + + /* Output base header fields. + */ +- TIFFSetField( tif, TIFFTAG_IMAGEWIDTH, layer->width ); +- TIFFSetField( tif, TIFFTAG_IMAGELENGTH, layer->height ); +- TIFFSetField( tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG ); +- TIFFSetField( tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT ); +- TIFFSetField( tif, TIFFTAG_COMPRESSION, wtiff->compression ); ++ TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, layer->width); ++ TIFFSetField(tif, TIFFTAG_IMAGELENGTH, layer->height); ++ TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); ++ TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); ++ TIFFSetField(tif, TIFFTAG_COMPRESSION, wtiff->compression); + +- if( wtiff->compression == COMPRESSION_JPEG ) +- TIFFSetField( tif, TIFFTAG_JPEGQUALITY, wtiff->Q ); ++ if (wtiff->compression == COMPRESSION_JPEG) ++ TIFFSetField(tif, TIFFTAG_JPEGQUALITY, wtiff->Q); + + #ifdef HAVE_TIFF_COMPRESSION_WEBP +- if( wtiff->compression == COMPRESSION_WEBP ) { +- TIFFSetField( tif, TIFFTAG_WEBP_LEVEL, wtiff->Q ); +- TIFFSetField( tif, TIFFTAG_WEBP_LOSSLESS, wtiff->lossless ); ++ if (wtiff->compression == COMPRESSION_WEBP) { ++ TIFFSetField(tif, TIFFTAG_WEBP_LEVEL, wtiff->Q); ++ TIFFSetField(tif, TIFFTAG_WEBP_LOSSLESS, wtiff->lossless); + } +- if( wtiff->compression == COMPRESSION_ZSTD ) { +- TIFFSetField( tif, TIFFTAG_ZSTD_LEVEL, wtiff->level ); +- if( wtiff->predictor != VIPS_FOREIGN_TIFF_PREDICTOR_NONE ) +- TIFFSetField( tif, +- TIFFTAG_PREDICTOR, wtiff->predictor ); ++ if (wtiff->compression == COMPRESSION_ZSTD) { ++ TIFFSetField(tif, TIFFTAG_ZSTD_LEVEL, wtiff->level); ++ if (wtiff->predictor != VIPS_FOREIGN_TIFF_PREDICTOR_NONE) ++ TIFFSetField(tif, ++ TIFFTAG_PREDICTOR, wtiff->predictor); + } + #endif /*HAVE_TIFF_COMPRESSION_WEBP*/ + +- if( (wtiff->compression == COMPRESSION_ADOBE_DEFLATE || +- wtiff->compression == COMPRESSION_LZW) && +- wtiff->predictor != VIPS_FOREIGN_TIFF_PREDICTOR_NONE ) +- TIFFSetField( tif, TIFFTAG_PREDICTOR, wtiff->predictor ); ++ if ((wtiff->compression == COMPRESSION_ADOBE_DEFLATE || ++ wtiff->compression == COMPRESSION_LZW) && ++ wtiff->predictor != VIPS_FOREIGN_TIFF_PREDICTOR_NONE) ++ TIFFSetField(tif, TIFFTAG_PREDICTOR, wtiff->predictor); + +- for( i = 0; i < VIPS_NUMBER( wtiff_we_compress ); i++ ) +- if( wtiff->compression == wtiff_we_compress[i] ) { ++ for (i = 0; i < VIPS_NUMBER(wtiff_we_compress); i++) ++ if (wtiff->compression == wtiff_we_compress[i]) { + wtiff->we_compress = TRUE; + break; + } + + /* Don't write mad resolutions (eg. zero), it confuses some programs. + */ +- TIFFSetField( tif, TIFFTAG_RESOLUTIONUNIT, wtiff->resunit ); +- TIFFSetField( tif, TIFFTAG_XRESOLUTION, +- VIPS_FCLIP( 0.01, wtiff->xres, 1000000 ) ); +- TIFFSetField( tif, TIFFTAG_YRESOLUTION, +- VIPS_FCLIP( 0.01, wtiff->yres, 1000000 ) ); +- +- if( !wtiff->strip ) +- if( wtiff_embed_profile( wtiff, tif ) || +- wtiff_embed_xmp( wtiff, tif ) || +- wtiff_embed_iptc( wtiff, tif ) || +- wtiff_embed_photoshop( wtiff, tif ) || +- wtiff_embed_imagedescription( wtiff, tif ) ) +- return( -1 ); +- +- if( vips_image_get_typeof( wtiff->ready, VIPS_META_ORIENTATION ) && +- !vips_image_get_int( wtiff->ready, +- VIPS_META_ORIENTATION, &orientation ) ) +- TIFFSetField( tif, TIFFTAG_ORIENTATION, orientation ); ++ TIFFSetField(tif, TIFFTAG_RESOLUTIONUNIT, wtiff->resunit); ++ TIFFSetField(tif, TIFFTAG_XRESOLUTION, ++ VIPS_FCLIP(0.01, wtiff->xres, 1000000)); ++ TIFFSetField(tif, TIFFTAG_YRESOLUTION, ++ VIPS_FCLIP(0.01, wtiff->yres, 1000000)); ++ ++ if (!wtiff->strip) ++ if (wtiff_embed_profile(wtiff, tif) || ++ wtiff_embed_xmp(wtiff, tif) || ++ wtiff_embed_iptc(wtiff, tif) || ++ wtiff_embed_photoshop(wtiff, tif) || ++ wtiff_embed_imagedescription(wtiff, tif)) ++ return (-1); ++ ++ if (vips_image_get_typeof(wtiff->ready, VIPS_META_ORIENTATION) && ++ !vips_image_get_int(wtiff->ready, ++ VIPS_META_ORIENTATION, &orientation)) ++ TIFFSetField(tif, TIFFTAG_ORIENTATION, orientation); + + /* And colour fields. + */ +- if( wtiff->ready->Coding == VIPS_CODING_LABQ ) { +- TIFFSetField( tif, TIFFTAG_SAMPLESPERPIXEL, 3 ); +- TIFFSetField( tif, TIFFTAG_BITSPERSAMPLE, 8 ); +- TIFFSetField( tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_CIELAB ); ++ if (wtiff->ready->Coding == VIPS_CODING_LABQ) { ++ TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 3); ++ TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, 8); ++ TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_CIELAB); + } +- else if( wtiff->bitdepth == 1 || wtiff->bitdepth == 2 || +- wtiff->bitdepth == 4 ) { +- TIFFSetField( tif, TIFFTAG_SAMPLESPERPIXEL, 1 ); +- TIFFSetField( tif, TIFFTAG_BITSPERSAMPLE, wtiff->bitdepth ); +- TIFFSetField( tif, TIFFTAG_PHOTOMETRIC, +- wtiff->miniswhite ? +- PHOTOMETRIC_MINISWHITE : +- PHOTOMETRIC_MINISBLACK ); ++ else if (wtiff->bitdepth == 1 || wtiff->bitdepth == 2 || ++ wtiff->bitdepth == 4) { ++ TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1); ++ TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, wtiff->bitdepth); ++ TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, ++ wtiff->miniswhite ? PHOTOMETRIC_MINISWHITE : PHOTOMETRIC_MINISBLACK); + } + else { + int photometric; +@@ -726,294 +724,288 @@ wtiff_write_header( Wtiff *wtiff, Layer *layer ) + + int alpha_bands; + +- TIFFSetField( tif, TIFFTAG_SAMPLESPERPIXEL, +- wtiff->ready->Bands ); +- TIFFSetField( tif, TIFFTAG_BITSPERSAMPLE, +- vips_format_sizeof( wtiff->ready->BandFmt ) << 3 ); ++ TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, ++ wtiff->ready->Bands); ++ TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, ++ vips_format_sizeof(wtiff->ready->BandFmt) << 3); + +- if( wtiff->ready->Type == VIPS_INTERPRETATION_B_W || ++ if (wtiff->ready->Type == VIPS_INTERPRETATION_B_W || + wtiff->ready->Type == VIPS_INTERPRETATION_GREY16 || +- wtiff->ready->Bands < 3 ) { ++ wtiff->ready->Bands < 3) { + /* Mono or mono + alpha. + */ +- photometric = wtiff->miniswhite ? +- PHOTOMETRIC_MINISWHITE : +- PHOTOMETRIC_MINISBLACK; ++ photometric = wtiff->miniswhite ? PHOTOMETRIC_MINISWHITE : PHOTOMETRIC_MINISBLACK; + colour_bands = 1; + } +- else if( wtiff->ready->Type == VIPS_INTERPRETATION_LAB || +- wtiff->ready->Type == VIPS_INTERPRETATION_LABS ) { ++ else if (wtiff->ready->Type == VIPS_INTERPRETATION_LAB || ++ wtiff->ready->Type == VIPS_INTERPRETATION_LABS) { + photometric = PHOTOMETRIC_CIELAB; + colour_bands = 3; + } +- else if( wtiff->input->Type == VIPS_INTERPRETATION_XYZ ) { ++ else if (wtiff->input->Type == VIPS_INTERPRETATION_XYZ) { + double stonits; + + photometric = PHOTOMETRIC_LOGLUV; + /* Tell libtiff we will write as float XYZ. + */ +- TIFFSetField( tif, +- TIFFTAG_SGILOGDATAFMT, SGILOGDATAFMT_FLOAT ); ++ TIFFSetField(tif, ++ TIFFTAG_SGILOGDATAFMT, SGILOGDATAFMT_FLOAT); + stonits = 1.0; +- if( vips_image_get_typeof( wtiff->ready, "stonits" ) ) +- vips_image_get_double( wtiff->ready, +- "stonits", &stonits ); +- TIFFSetField( tif, TIFFTAG_STONITS, stonits ); ++ if (vips_image_get_typeof(wtiff->ready, "stonits")) ++ vips_image_get_double(wtiff->ready, ++ "stonits", &stonits); ++ TIFFSetField(tif, TIFFTAG_STONITS, stonits); + colour_bands = 3; + } +- else if( wtiff->ready->Type == VIPS_INTERPRETATION_CMYK && +- wtiff->ready->Bands >= 4 ) { ++ else if (wtiff->ready->Type == VIPS_INTERPRETATION_CMYK && ++ wtiff->ready->Bands >= 4) { + photometric = PHOTOMETRIC_SEPARATED; +- TIFFSetField( tif, TIFFTAG_INKSET, INKSET_CMYK ); ++ TIFFSetField(tif, TIFFTAG_INKSET, INKSET_CMYK); + colour_bands = 4; + } +- else if( wtiff->compression == COMPRESSION_JPEG && ++ else if (wtiff->compression == COMPRESSION_JPEG && + wtiff->ready->Bands == 3 && + wtiff->ready->BandFmt == VIPS_FORMAT_UCHAR && +- (!wtiff->rgbjpeg && wtiff->Q < 90) ) { ++ (!wtiff->rgbjpeg && wtiff->Q < 90)) { + /* This signals to libjpeg that it can do + * YCbCr chrominance subsampling from RGB, not + * that we will supply the image as YCbCr. + */ + photometric = PHOTOMETRIC_YCBCR; +- TIFFSetField( tif, TIFFTAG_JPEGCOLORMODE, +- JPEGCOLORMODE_RGB ); ++ TIFFSetField(tif, TIFFTAG_JPEGCOLORMODE, ++ JPEGCOLORMODE_RGB); + colour_bands = 3; + } + else { + /* Some kind of generic multi-band image with three or +- * more bands ... save the first three bands as RGB, ++ * more bands ... save the first three bands as RGB, + * the rest as alpha. + */ + photometric = PHOTOMETRIC_RGB; + colour_bands = 3; + } + +- alpha_bands = VIPS_CLIP( 0, +- wtiff->ready->Bands - colour_bands, MAX_ALPHA ); +- if( alpha_bands > 0 ) { ++ alpha_bands = VIPS_CLIP(0, ++ wtiff->ready->Bands - colour_bands, MAX_ALPHA); ++ if (alpha_bands > 0) { + guint16 v[MAX_ALPHA]; + int i; + + /* EXTRASAMPLE_UNASSALPHA means generic extra + * alpha-like channels. ASSOCALPHA means pre-multipled +- * alpha only. ++ * alpha only. + * + * Make the first channel the premultiplied alpha, if + * we are premultiplying. + */ +- for( i = 0; i < alpha_bands; i++ ) +- v[i] = i == 0 && wtiff->premultiply ? +- EXTRASAMPLE_ASSOCALPHA : +- EXTRASAMPLE_UNASSALPHA; +- TIFFSetField( tif, +- TIFFTAG_EXTRASAMPLES, alpha_bands, v ); ++ for (i = 0; i < alpha_bands; i++) ++ v[i] = i == 0 && wtiff->premultiply ? EXTRASAMPLE_ASSOCALPHA : EXTRASAMPLE_UNASSALPHA; ++ TIFFSetField(tif, ++ TIFFTAG_EXTRASAMPLES, alpha_bands, v); + } + +- TIFFSetField( tif, TIFFTAG_PHOTOMETRIC, photometric ); ++ TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photometric); + } + + /* Layout. + */ +- if( wtiff->tile ) { +- TIFFSetField( tif, TIFFTAG_TILEWIDTH, wtiff->tilew ); +- TIFFSetField( tif, TIFFTAG_TILELENGTH, wtiff->tileh ); ++ if (wtiff->tile) { ++ TIFFSetField(tif, TIFFTAG_TILEWIDTH, wtiff->tilew); ++ TIFFSetField(tif, TIFFTAG_TILELENGTH, wtiff->tileh); + } + else +- TIFFSetField( tif, TIFFTAG_ROWSPERSTRIP, wtiff->tileh ); ++ TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, wtiff->tileh); + +- +- if( layer->above ) ++ if (layer->above) + /* Pyramid layer. + */ +- TIFFSetField( tif, TIFFTAG_SUBFILETYPE, FILETYPE_REDUCEDIMAGE ); +- else if( wtiff->toilet_roll ) { ++ TIFFSetField(tif, TIFFTAG_SUBFILETYPE, FILETYPE_REDUCEDIMAGE); ++ else if (wtiff->toilet_roll) { + /* One page of many. + */ +- TIFFSetField( tif, TIFFTAG_SUBFILETYPE, FILETYPE_PAGE ); ++ TIFFSetField(tif, TIFFTAG_SUBFILETYPE, FILETYPE_PAGE); + +- TIFFSetField( tif, TIFFTAG_PAGENUMBER, +- wtiff->page_number, wtiff->n_pages ); ++ TIFFSetField(tif, TIFFTAG_PAGENUMBER, ++ wtiff->page_number, wtiff->n_pages); + } + +- + /* Sample format. + * + * Don't set for logluv: libtiff does this for us. + */ +- if( wtiff->input->Type != VIPS_INTERPRETATION_XYZ ) { +- int format; ++ if (wtiff->input->Type != VIPS_INTERPRETATION_XYZ) { ++ int format; + + format = SAMPLEFORMAT_UINT; +- if( vips_band_format_isuint( wtiff->ready->BandFmt ) ) ++ if (vips_band_format_isuint(wtiff->ready->BandFmt)) + format = SAMPLEFORMAT_UINT; +- else if( vips_band_format_isint( wtiff->ready->BandFmt ) ) ++ else if (vips_band_format_isint(wtiff->ready->BandFmt)) + format = SAMPLEFORMAT_INT; +- else if( vips_band_format_isfloat( wtiff->ready->BandFmt ) ) ++ else if (vips_band_format_isfloat(wtiff->ready->BandFmt)) + format = SAMPLEFORMAT_IEEEFP; +- else if( vips_band_format_iscomplex( wtiff->ready->BandFmt ) ) ++ else if (vips_band_format_iscomplex(wtiff->ready->BandFmt)) + format = SAMPLEFORMAT_COMPLEXIEEEFP; +- TIFFSetField( tif, TIFFTAG_SAMPLEFORMAT, format ); ++ TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, format); + } + +- return( 0 ); ++ return (0); + } + + static int +-wtiff_layer_rewind( Wtiff *wtiff, Layer *layer ) ++wtiff_layer_rewind(Wtiff *wtiff, Layer *layer) + { + VipsRect strip_size; + +- /* Build a line of tiles here. ++ /* Build a line of tiles here. + * +- * Expand the strip if necessary to make sure we have an even +- * number of lines. ++ * Expand the strip if necessary to make sure we have an even ++ * number of lines. + */ + strip_size.left = 0; + strip_size.top = 0; + strip_size.width = layer->image->Xsize; + strip_size.height = wtiff->tileh; +- if( (strip_size.height & 1) == 1 ) ++ if ((strip_size.height & 1) == 1) + strip_size.height += 1; +- if( vips_region_buffer( layer->strip, &strip_size ) ) +- return( -1 ); ++ if (vips_region_buffer(layer->strip, &strip_size)) ++ return (-1); + + layer->y = 0; + layer->write_y = 0; + +- return( 0 ); ++ return (0); + } + + static int +-wtiff_allocate_layers( Wtiff *wtiff ) ++wtiff_allocate_layers(Wtiff *wtiff) + { + Layer *layer; + +- g_assert( wtiff->layer ); ++ g_assert(wtiff->layer); + +- for( layer = wtiff->layer; layer; layer = layer->below ) { +- if( !layer->image ) { ++ for (layer = wtiff->layer; layer; layer = layer->below) { ++ if (!layer->image) { + layer->image = vips_image_new(); +- if( vips_image_pipelinev( layer->image, +- VIPS_DEMAND_STYLE_ANY, wtiff->ready, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(layer->image, ++ VIPS_DEMAND_STYLE_ANY, wtiff->ready, NULL)) ++ return (-1); + layer->image->Xsize = layer->width; + layer->image->Ysize = layer->height; + +- layer->strip = vips_region_new( layer->image ); +- layer->copy = vips_region_new( layer->image ); ++ layer->strip = vips_region_new(layer->image); ++ layer->copy = vips_region_new(layer->image); + + /* The regions will get used in the bg thread callback, + * so make sure we don't own them. + */ +- vips__region_no_ownership( layer->strip ); +- vips__region_no_ownership( layer->copy ); ++ vips__region_no_ownership(layer->strip); ++ vips__region_no_ownership(layer->copy); + +- layer->tif = vips__tiff_openout_target( layer->target, +- wtiff->bigtiff ); +- if( !layer->tif ) +- return( -1 ); ++ layer->tif = vips__tiff_openout_target(layer->target, ++ wtiff->bigtiff); ++ if (!layer->tif) ++ return (-1); + } + +- if( wtiff_layer_rewind( wtiff, layer ) ) +- return( -1 ); ++ if (wtiff_layer_rewind(wtiff, layer)) ++ return (-1); + +- if( wtiff_write_header( wtiff, layer ) ) +- return( -1 ); ++ if (wtiff_write_header(wtiff, layer)) ++ return (-1); + } + +- if( !wtiff->tbuf ) { +- if( wtiff->tile ) +- wtiff->tbuf = vips_malloc( NULL, +- TIFFTileSize( wtiff->layer->tif ) ); ++ if (!wtiff->tbuf) { ++ if (wtiff->tile) ++ wtiff->tbuf = vips_malloc(NULL, ++ TIFFTileSize(wtiff->layer->tif)); + else +- wtiff->tbuf = vips_malloc( NULL, +- TIFFScanlineSize( wtiff->layer->tif ) ); +- if( !wtiff->tbuf ) +- return( -1 ); ++ wtiff->tbuf = vips_malloc(NULL, ++ TIFFScanlineSize(wtiff->layer->tif)); ++ if (!wtiff->tbuf) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Free a single pyramid layer. + */ + static void +-layer_free( Layer *layer ) ++layer_free(Layer *layer) + { + /* Don't unref the target for this layer -- we'll need it for gather. + */ +- VIPS_FREEF( TIFFClose, layer->tif ); +- VIPS_UNREF( layer->strip ); +- VIPS_UNREF( layer->copy ); +- VIPS_UNREF( layer->image ); ++ VIPS_FREEF(TIFFClose, layer->tif); ++ VIPS_UNREF(layer->strip); ++ VIPS_UNREF(layer->copy); ++ VIPS_UNREF(layer->image); + } + + /* Free an entire pyramid. + */ + static void +-layer_free_all( Layer *layer ) ++layer_free_all(Layer *layer) + { +- if( layer->below ) +- layer_free_all( layer->below ); ++ if (layer->below) ++ layer_free_all(layer->below); + +- layer_free( layer ); ++ layer_free(layer); + } + + static void +-wtiff_free( Wtiff *wtiff ) ++wtiff_free(Wtiff *wtiff) + { + Layer *layer; + + /* unref all the targets, including the base layer. + */ +- for( layer = wtiff->layer; layer; layer = layer->below ) +- VIPS_UNREF( layer->target ); ++ for (layer = wtiff->layer; layer; layer = layer->below) ++ VIPS_UNREF(layer->target); + +- VIPS_UNREF( wtiff->ready ); +- VIPS_FREE( wtiff->tbuf ); +- VIPS_FREEF( layer_free_all, wtiff->layer ); +- VIPS_FREE( wtiff ); ++ VIPS_UNREF(wtiff->ready); ++ VIPS_FREE(wtiff->tbuf); ++ VIPS_FREEF(layer_free_all, wtiff->layer); ++ VIPS_FREE(wtiff); + } + + static int +-get_compression( VipsForeignTiffCompression compression ) ++get_compression(VipsForeignTiffCompression compression) + { +- switch( compression ) { ++ switch (compression) { + case VIPS_FOREIGN_TIFF_COMPRESSION_NONE: +- return( COMPRESSION_NONE ); ++ return (COMPRESSION_NONE); + case VIPS_FOREIGN_TIFF_COMPRESSION_JPEG: +- return( COMPRESSION_JPEG ); ++ return (COMPRESSION_JPEG); + case VIPS_FOREIGN_TIFF_COMPRESSION_DEFLATE: +- return( COMPRESSION_ADOBE_DEFLATE ); ++ return (COMPRESSION_ADOBE_DEFLATE); + case VIPS_FOREIGN_TIFF_COMPRESSION_PACKBITS: +- return( COMPRESSION_PACKBITS ); ++ return (COMPRESSION_PACKBITS); + case VIPS_FOREIGN_TIFF_COMPRESSION_CCITTFAX4: +- return( COMPRESSION_CCITTFAX4 ); ++ return (COMPRESSION_CCITTFAX4); + case VIPS_FOREIGN_TIFF_COMPRESSION_LZW: +- return( COMPRESSION_LZW ); ++ return (COMPRESSION_LZW); + #ifdef HAVE_TIFF_COMPRESSION_WEBP + case VIPS_FOREIGN_TIFF_COMPRESSION_WEBP: +- return( COMPRESSION_WEBP ); ++ return (COMPRESSION_WEBP); + case VIPS_FOREIGN_TIFF_COMPRESSION_ZSTD: +- return( COMPRESSION_ZSTD ); ++ return (COMPRESSION_ZSTD); + #endif /*HAVE_TIFF_COMPRESSION_WEBP*/ + case VIPS_FOREIGN_TIFF_COMPRESSION_JP2K: +- return( JP2K_LOSSY ); +- ++ return (JP2K_LOSSY); ++ + default: +- return( COMPRESSION_NONE ); ++ return (COMPRESSION_NONE); + } + } + + static int +-get_resunit( VipsForeignTiffResunit resunit ) ++get_resunit(VipsForeignTiffResunit resunit) + { +- switch( resunit ) { ++ switch (resunit) { + case VIPS_FOREIGN_TIFF_RESUNIT_CM: +- return( RESUNIT_CENTIMETER ); ++ return (RESUNIT_CENTIMETER); + case VIPS_FOREIGN_TIFF_RESUNIT_INCH: +- return( RESUNIT_INCH ); ++ return (RESUNIT_INCH); + + default: + g_assert_not_reached(); +@@ -1021,70 +1013,70 @@ get_resunit( VipsForeignTiffResunit resunit ) + + /* Keep -Wall happy. + */ +- return( -1 ); ++ return (-1); + } + + /* Get the image ready to be written. + */ + static int +-ready_to_write( Wtiff *wtiff ) ++ready_to_write(Wtiff *wtiff) + { + VipsImage *input; + VipsImage *x; + + input = wtiff->input; +- g_object_ref( input ); ++ g_object_ref(input); + +- if( vips_check_coding_known( "vips2tiff", input ) ) { +- VIPS_UNREF( input ); +- return( -1 ); ++ if (vips_check_coding_known("vips2tiff", input)) { ++ VIPS_UNREF(input); ++ return (-1); + } + + /* Premultiply any alpha, if necessary. + */ +- if( wtiff->premultiply && +- vips_image_hasalpha( input ) ) { ++ if (wtiff->premultiply && ++ vips_image_hasalpha(input)) { + VipsBandFormat start_format = input->BandFmt; + +- if( vips_premultiply( input, &x, NULL ) ) { +- VIPS_UNREF( input ); +- return( -1 ); ++ if (vips_premultiply(input, &x, NULL)) { ++ VIPS_UNREF(input); ++ return (-1); + } +- VIPS_UNREF( input ); ++ VIPS_UNREF(input); + input = x; + + /* Premultiply always makes a float -- cast back again. + */ +- if( vips_cast( input, &x, start_format, NULL ) ) { +- VIPS_UNREF( input ); +- return( -1 ); ++ if (vips_cast(input, &x, start_format, NULL)) { ++ VIPS_UNREF(input); ++ return (-1); + } +- VIPS_UNREF( input ); ++ VIPS_UNREF(input); + input = x; + } + + /* "squash" float LAB down to LABQ. + */ +- if( wtiff->bitdepth && ++ if (wtiff->bitdepth && + input->Bands == 3 && + input->BandFmt == VIPS_FORMAT_FLOAT && +- input->Type == VIPS_INTERPRETATION_LAB ) { +- if( vips_Lab2LabQ( input, &x, NULL ) ) { +- VIPS_UNREF( input ); +- return( -1 ); ++ input->Type == VIPS_INTERPRETATION_LAB) { ++ if (vips_Lab2LabQ(input, &x, NULL)) { ++ VIPS_UNREF(input); ++ return (-1); + } +- VIPS_UNREF( input ); ++ VIPS_UNREF(input); + input = x; + } + + wtiff->ready = input; + +- return( 0 ); ++ return (0); + } + + static Wtiff * +-wtiff_new( VipsImage *input, VipsTarget *target, +- VipsForeignTiffCompression compression, int Q, ++wtiff_new(VipsImage *input, VipsTarget *target, ++ VipsForeignTiffCompression compression, int Q, + VipsForeignTiffPredictor predictor, + const char *profile, + gboolean tile, int tile_width, int tile_height, +@@ -1097,23 +1089,23 @@ wtiff_new( VipsImage *input, VipsTarget *target, + gboolean properties, + gboolean strip, + VipsRegionShrink region_shrink, +- int level, ++ int level, + gboolean lossless, +- VipsForeignDzDepth depth, ++ VipsForeignDzDepth depth, + gboolean subifd, + gboolean premultiply, +- int page_height ) ++ int page_height) + { + Wtiff *wtiff; + +- if( !(wtiff = VIPS_NEW( NULL, Wtiff )) ) +- return( NULL ); ++ if (!(wtiff = VIPS_NEW(NULL, Wtiff))) ++ return (NULL); + wtiff->input = input; + wtiff->ready = NULL; + wtiff->target = target; + wtiff->layer = NULL; + wtiff->tbuf = NULL; +- wtiff->compression = get_compression( compression ); ++ wtiff->compression = get_compression(compression); + wtiff->Q = Q; + wtiff->predictor = predictor; + wtiff->tile = tile; +@@ -1122,7 +1114,7 @@ wtiff_new( VipsImage *input, VipsTarget *target, + wtiff->pyramid = pyramid; + wtiff->bitdepth = bitdepth; + wtiff->miniswhite = miniswhite; +- wtiff->resunit = get_resunit( resunit ); ++ wtiff->resunit = get_resunit(resunit); + wtiff->xres = xres; + wtiff->yres = yres; + wtiff->profile = profile; +@@ -1144,30 +1136,30 @@ wtiff_new( VipsImage *input, VipsTarget *target, + + /* Any pre-processing on the image. + */ +- if( ready_to_write( wtiff ) ) { +- wtiff_free( wtiff ); +- return( NULL ); ++ if (ready_to_write(wtiff)) { ++ wtiff_free(wtiff); ++ return (NULL); + } + + /* XYZ images are written as libtiff LOGLUV. + */ +- if( wtiff->ready->Type == VIPS_INTERPRETATION_XYZ ) ++ if (wtiff->ready->Type == VIPS_INTERPRETATION_XYZ) + wtiff->compression = COMPRESSION_SGILOG; + + /* Multipage image? 0 is the default for this argument. + */ +- if( wtiff->page_height == 0 ) +- wtiff->page_height = vips_image_get_page_height( input ); +- if( wtiff->page_height > 0 && ++ if (wtiff->page_height == 0) ++ wtiff->page_height = vips_image_get_page_height(input); ++ if (wtiff->page_height > 0 && + wtiff->page_height < wtiff->ready->Ysize && +- wtiff->ready->Ysize % wtiff->page_height == 0 ) { ++ wtiff->ready->Ysize % wtiff->page_height == 0) { + #ifdef DEBUG +- printf( "wtiff_new: detected toilet roll image, " +- "page-height=%d\n", +- wtiff->page_height ); +- printf( "wtiff_new: pages=%d\n", +- wtiff->ready->Ysize / wtiff->page_height ); +-#endif/*DEBUG*/ ++ printf("wtiff_new: detected toilet roll image, " ++ "page-height=%d\n", ++ wtiff->page_height); ++ printf("wtiff_new: pages=%d\n", ++ wtiff->ready->Ysize / wtiff->page_height); ++#endif /*DEBUG*/ + + wtiff->toilet_roll = TRUE; + wtiff->image_height = wtiff->page_height; +@@ -1176,30 +1168,30 @@ wtiff_new( VipsImage *input, VipsTarget *target, + + /* subifd turns on pyramid mode. + */ +- if( wtiff->subifd ) ++ if (wtiff->subifd) + wtiff->pyramid = TRUE; + + /* Pyramid images must be tiled. + */ +- if( wtiff->pyramid ) ++ if (wtiff->pyramid) + wtiff->tile = TRUE; + + /* Multi-page pyramids must be in subifd mode. + */ +- if( wtiff->pyramid && +- wtiff->toilet_roll ) ++ if (wtiff->pyramid && ++ wtiff->toilet_roll) + wtiff->subifd = TRUE; + +- /* We can only pyramid LABQ and non-complex images. ++ /* We can only pyramid LABQ and non-complex images. + */ +- if( wtiff->pyramid ) { +- if( wtiff->ready->Coding == VIPS_CODING_NONE && +- vips_band_format_iscomplex( wtiff->ready->BandFmt ) ) { +- wtiff_free( wtiff ); +- vips_error( "vips2tiff", +- "%s", _( "can only pyramid LABQ and " +- "non-complex images" ) ); +- return( NULL ); ++ if (wtiff->pyramid) { ++ if (wtiff->ready->Coding == VIPS_CODING_NONE && ++ vips_band_format_iscomplex(wtiff->ready->BandFmt)) { ++ wtiff_free(wtiff); ++ vips_error("vips2tiff", ++ "%s", _("can only pyramid LABQ and " ++ "non-complex images")); ++ return (NULL); + } + } + +@@ -1209,91 +1201,91 @@ wtiff_new( VipsImage *input, VipsTarget *target, + * This won't always work. If the image data is just under 4gb but + * there's a lot of metadata, we could be pushed over the 4gb limit. + */ +- if( wtiff->compression == COMPRESSION_NONE && +- VIPS_IMAGE_SIZEOF_IMAGE( wtiff->ready ) > UINT_MAX ) ++ if (wtiff->compression == COMPRESSION_NONE && ++ VIPS_IMAGE_SIZEOF_IMAGE(wtiff->ready) > UINT_MAX) + wtiff->bigtiff = TRUE; + + /* In strip mode we use tileh to set rowsperstrip, and that does not + * have the multiple-of-16 restriction. + */ +- if( wtiff->tile ) { +- if( (wtiff->tilew & 0xf) != 0 || +- (wtiff->tileh & 0xf) != 0 ) { +- wtiff_free( wtiff ); +- vips_error( "vips2tiff", +- "%s", _( "tile size not a multiple of 16" ) ); +- return( NULL ); ++ if (wtiff->tile) { ++ if ((wtiff->tilew & 0xf) != 0 || ++ (wtiff->tileh & 0xf) != 0) { ++ wtiff_free(wtiff); ++ vips_error("vips2tiff", ++ "%s", _("tile size not a multiple of 16")); ++ return (NULL); + } + } + + /* Depth 8 is handled above. + */ +- if( wtiff->bitdepth && +- !(wtiff->bitdepth == 1 || +- wtiff->bitdepth == 2 || +- wtiff->bitdepth == 4) ) { +- g_warning( "%s", +- _( "bitdepth 1, 2 or 4 only -- disabling bitdepth") ); ++ if (wtiff->bitdepth && ++ !(wtiff->bitdepth == 1 || ++ wtiff->bitdepth == 2 || ++ wtiff->bitdepth == 4)) { ++ g_warning("%s", ++ _("bitdepth 1, 2 or 4 only -- disabling bitdepth")); + wtiff->bitdepth = 0; + } + + /* Can only have byte fractional bit depths for 8 bit mono. + * 3-band float should have been packed above. + */ +- if( wtiff->bitdepth && ++ if (wtiff->bitdepth && + !(wtiff->ready->Coding == VIPS_CODING_NONE && +- wtiff->ready->BandFmt == VIPS_FORMAT_UCHAR && +- wtiff->ready->Bands == 1) ) { +- g_warning( "%s", +- ( "can only set bitdepth for 1-band uchar and " +- "3-band float lab -- disabling bitdepth" ) ); ++ wtiff->ready->BandFmt == VIPS_FORMAT_UCHAR && ++ wtiff->ready->Bands == 1)) { ++ g_warning("%s", ++ ("can only set bitdepth for 1-band uchar and " ++ "3-band float lab -- disabling bitdepth")); + wtiff->bitdepth = 0; + } + +- if( wtiff->bitdepth && +- wtiff->compression == COMPRESSION_JPEG ) { +- g_warning( "%s", +- _( "can't have <8 bit JPEG -- disabling JPEG" ) ); ++ if (wtiff->bitdepth && ++ wtiff->compression == COMPRESSION_JPEG) { ++ g_warning("%s", ++ _("can't have <8 bit JPEG -- disabling JPEG")); + wtiff->compression = COMPRESSION_NONE; + } +- ++ + /* We can only MINISWHITE non-complex images of 1 or 2 bands. + */ +- if( wtiff->miniswhite && +- (wtiff->ready->Coding != VIPS_CODING_NONE || +- vips_band_format_iscomplex( wtiff->ready->BandFmt ) || +- wtiff->ready->Bands > 2) ) { +- g_warning( "%s", +- _( "can only save non-complex greyscale images " +- "as miniswhite -- disabling miniswhite" ) ); ++ if (wtiff->miniswhite && ++ (wtiff->ready->Coding != VIPS_CODING_NONE || ++ vips_band_format_iscomplex(wtiff->ready->BandFmt) || ++ wtiff->ready->Bands > 2)) { ++ g_warning("%s", ++ _("can only save non-complex greyscale images " ++ "as miniswhite -- disabling miniswhite")); + wtiff->miniswhite = FALSE; + } + + /* Sizeof a line of bytes in the TIFF tile. + */ +- if( wtiff->ready->Coding == VIPS_CODING_LABQ ) ++ if (wtiff->ready->Coding == VIPS_CODING_LABQ) + wtiff->tls = wtiff->tilew * 3; +- else if( wtiff->bitdepth == 1 ) +- wtiff->tls = VIPS_ROUND_UP( wtiff->tilew, 8 ) / 8; +- else if( wtiff->bitdepth == 2 ) +- wtiff->tls = VIPS_ROUND_UP( wtiff->tilew, 4 ) / 4; +- else if( wtiff->bitdepth == 4 ) +- wtiff->tls = VIPS_ROUND_UP( wtiff->tilew, 2 ) / 2; ++ else if (wtiff->bitdepth == 1) ++ wtiff->tls = VIPS_ROUND_UP(wtiff->tilew, 8) / 8; ++ else if (wtiff->bitdepth == 2) ++ wtiff->tls = VIPS_ROUND_UP(wtiff->tilew, 4) / 4; ++ else if (wtiff->bitdepth == 4) ++ wtiff->tls = VIPS_ROUND_UP(wtiff->tilew, 2) / 2; + else +- wtiff->tls = VIPS_IMAGE_SIZEOF_PEL( wtiff->ready ) * ++ wtiff->tls = VIPS_IMAGE_SIZEOF_PEL(wtiff->ready) * + wtiff->tilew; + +- return( wtiff ); ++ return (wtiff); + } + + /* Convert VIPS LabQ to TIFF LAB. Just take the first three bands. + */ + static void +-LabQ2LabC( VipsPel *q, VipsPel *p, int n ) ++LabQ2LabC(VipsPel *q, VipsPel *p, int n) + { + int x; + +- for( x = 0; x < n; x++ ) { ++ for (x = 0; x < n; x++) { + /* Get most significant 8 bits of lab. + */ + q[0] = p[0]; +@@ -1308,7 +1300,7 @@ LabQ2LabC( VipsPel *q, VipsPel *p, int n ) + /* Pack 8 bit VIPS to N bit TIFF. + */ + static void +-eightbit2nbit( Wtiff *wtiff, VipsPel *q, VipsPel *p, int n ) ++eightbit2nbit(Wtiff *wtiff, VipsPel *q, VipsPel *p, int n) + { + /* Invert in miniswhite mode. + */ +@@ -1317,20 +1309,20 @@ eightbit2nbit( Wtiff *wtiff, VipsPel *q, VipsPel *p, int n ) + int shift = 8 - wtiff->bitdepth; + + VipsPel bits; +- int x; ++ int x; + + bits = 0; +- for( x = 0; x < n; x++ ) { ++ for (x = 0; x < n; x++) { + bits <<= wtiff->bitdepth; + bits |= p[x] >> shift; + +- if( (x & pixel_mask) == pixel_mask ) ++ if ((x & pixel_mask) == pixel_mask) + *q++ = bits ^ mask; +- } ++ } + + /* Any left-over bits? Need to be left-aligned. + */ +- if( (x & pixel_mask) != 0 ) { ++ if ((x & pixel_mask) != 0) { + /* The number of bits we've collected in bits and must + * left-align and flush. + */ +@@ -1340,68 +1332,69 @@ eightbit2nbit( Wtiff *wtiff, VipsPel *q, VipsPel *p, int n ) + } + } + +-/* Swap the sense of the first channel, if necessary. ++/* Swap the sense of the first channel, if necessary. + */ +-#define GREY_LOOP( TYPE, MAX ) { \ +- TYPE *p1; \ +- TYPE *q1; \ +- \ +- p1 = (TYPE *) p; \ +- q1 = (TYPE *) q; \ +- for( x = 0; x < n; x++ ) { \ +- if( invert ) \ +- q1[0] = MAX - p1[0]; \ +- else \ +- q1[0] = p1[0]; \ +- \ +- for( i = 1; i < im->Bands; i++ ) \ +- q1[i] = p1[i]; \ +- \ +- q1 += im->Bands; \ +- p1 += im->Bands; \ +- } \ +-} ++#define GREY_LOOP(TYPE, MAX) \ ++ { \ ++ TYPE *p1; \ ++ TYPE *q1; \ ++\ ++ p1 = (TYPE *) p; \ ++ q1 = (TYPE *) q; \ ++ for (x = 0; x < n; x++) { \ ++ if (invert) \ ++ q1[0] = MAX - p1[0]; \ ++ else \ ++ q1[0] = p1[0]; \ ++\ ++ for (i = 1; i < im->Bands; i++) \ ++ q1[i] = p1[i]; \ ++\ ++ q1 += im->Bands; \ ++ p1 += im->Bands; \ ++ } \ ++ } + + /* If we're writing a 1 or 2 band image as a greyscale and MINISWHITE, we need + * to swap the sense of the first band. See tiff2vips.c, greyscale_line() for + * the opposite conversion. + */ + static void +-invert_band0( Wtiff *wtiff, VipsPel *q, VipsPel *p, int n ) ++invert_band0(Wtiff *wtiff, VipsPel *q, VipsPel *p, int n) + { + VipsImage *im = wtiff->ready; + gboolean invert = wtiff->miniswhite; + +- int x, i; ++ int x, i; + +- switch( im->BandFmt ) { ++ switch (im->BandFmt) { + case VIPS_FORMAT_UCHAR: + case VIPS_FORMAT_CHAR: +- GREY_LOOP( guchar, UCHAR_MAX ); ++ GREY_LOOP(guchar, UCHAR_MAX); + break; + + case VIPS_FORMAT_SHORT: +- GREY_LOOP( gshort, SHRT_MAX ); ++ GREY_LOOP(gshort, SHRT_MAX); + break; + + case VIPS_FORMAT_USHORT: +- GREY_LOOP( gushort, USHRT_MAX ); ++ GREY_LOOP(gushort, USHRT_MAX); + break; + + case VIPS_FORMAT_INT: +- GREY_LOOP( gint, INT_MAX ); ++ GREY_LOOP(gint, INT_MAX); + break; + + case VIPS_FORMAT_UINT: +- GREY_LOOP( guint, UINT_MAX ); ++ GREY_LOOP(guint, UINT_MAX); + break; + + case VIPS_FORMAT_FLOAT: +- GREY_LOOP( float, 1.0 ); ++ GREY_LOOP(float, 1.0); + break; + + case VIPS_FORMAT_DOUBLE: +- GREY_LOOP( double, 1.0 ); ++ GREY_LOOP(double, 1.0); + break; + + default: +@@ -1412,21 +1405,21 @@ invert_band0( Wtiff *wtiff, VipsPel *q, VipsPel *p, int n ) + /* Convert VIPS LABS to TIFF 16 bit LAB. + */ + static void +-LabS2Lab16( VipsPel *q, VipsPel *p, int n, int samples_per_pixel ) ++LabS2Lab16(VipsPel *q, VipsPel *p, int n, int samples_per_pixel) + { + short *p1 = (short *) p; + unsigned short *q1 = (unsigned short *) q; + + int x; + +- for( x = 0; x < n; x++ ) { ++ for (x = 0; x < n; x++) { + int i; + +- /* LABS L can be negative. +- */ +- q1[0] = VIPS_LSHIFT_INT( VIPS_MAX( 0, p1[0] ), 1 ); ++ /* LABS L can be negative. ++ */ ++ q1[0] = VIPS_LSHIFT_INT(VIPS_MAX(0, p1[0]), 1); + +- for( i = 1; i < samples_per_pixel; i++ ) ++ for (i = 1; i < samples_per_pixel; i++) + q1[i] = p1[i]; + + q1 += samples_per_pixel; +@@ -1437,21 +1430,21 @@ LabS2Lab16( VipsPel *q, VipsPel *p, int n, int samples_per_pixel ) + /* Convert VIPS D65 XYZ to TIFF scaled float illuminant-free xyz. + */ + static void +-XYZ2tiffxyz( VipsPel *q, VipsPel *p, int n, int samples_per_pixel ) ++XYZ2tiffxyz(VipsPel *q, VipsPel *p, int n, int samples_per_pixel) + { + float *p1 = (float *) p; + float *q1 = (float *) q; + + int x; + +- for( x = 0; x < n; x++ ) { ++ for (x = 0; x < n; x++) { + int i; + +- q1[0] = p1[0] / VIPS_D65_X0; +- q1[1] = p1[1] / VIPS_D65_Y0; +- q1[2] = p1[2] / VIPS_D65_Z0; ++ q1[0] = p1[0] / VIPS_D65_X0; ++ q1[1] = p1[1] / VIPS_D65_Y0; ++ q1[2] = p1[2] / VIPS_D65_Z0; + +- for( i = 3; i < samples_per_pixel; i++ ) ++ for (i = 3; i < samples_per_pixel; i++) + q1[i] = p1[i]; + + q1 += samples_per_pixel; +@@ -1462,8 +1455,8 @@ XYZ2tiffxyz( VipsPel *q, VipsPel *p, int n, int samples_per_pixel ) + /* Pack the pixels in @area from @in into a TIFF tile buffer. + */ + static void +-wtiff_pack2tiff( Wtiff *wtiff, Layer *layer, +- VipsRegion *in, VipsRect *area, VipsPel *q ) ++wtiff_pack2tiff(Wtiff *wtiff, Layer *layer, ++ VipsRegion *in, VipsRect *area, VipsPel *q) + { + int y; + +@@ -1474,30 +1467,30 @@ wtiff_pack2tiff( Wtiff *wtiff, Layer *layer, + * Black out the tile first to make sure these edge pixels are always + * zero. + */ +- if( wtiff->compression == COMPRESSION_JPEG && +- (area->width < wtiff->tilew || +- area->height < wtiff->tileh) ) +- memset( q, 0, TIFFTileSize( layer->tif ) ); +- +- for( y = area->top; y < VIPS_RECT_BOTTOM( area ); y++ ) { +- VipsPel *p = (VipsPel *) VIPS_REGION_ADDR( in, area->left, y ); +- +- if( wtiff->ready->Coding == VIPS_CODING_LABQ ) +- LabQ2LabC( q, p, area->width ); +- else if( wtiff->bitdepth > 0 ) +- eightbit2nbit( wtiff, q, p, area->width ); +- else if( wtiff->input->Type == VIPS_INTERPRETATION_XYZ ) +- XYZ2tiffxyz( q, p, area->width, in->im->Bands ); +- else if( (in->im->Bands == 1 || in->im->Bands == 2) && +- wtiff->miniswhite ) +- invert_band0( wtiff, q, p, area->width ); +- else if( wtiff->ready->BandFmt == VIPS_FORMAT_SHORT && +- wtiff->ready->Type == VIPS_INTERPRETATION_LABS ) +- LabS2Lab16( q, p, area->width, in->im->Bands ); ++ if (wtiff->compression == COMPRESSION_JPEG && ++ (area->width < wtiff->tilew || ++ area->height < wtiff->tileh)) ++ memset(q, 0, TIFFTileSize(layer->tif)); ++ ++ for (y = area->top; y < VIPS_RECT_BOTTOM(area); y++) { ++ VipsPel *p = (VipsPel *) VIPS_REGION_ADDR(in, area->left, y); ++ ++ if (wtiff->ready->Coding == VIPS_CODING_LABQ) ++ LabQ2LabC(q, p, area->width); ++ else if (wtiff->bitdepth > 0) ++ eightbit2nbit(wtiff, q, p, area->width); ++ else if (wtiff->input->Type == VIPS_INTERPRETATION_XYZ) ++ XYZ2tiffxyz(q, p, area->width, in->im->Bands); ++ else if ((in->im->Bands == 1 || in->im->Bands == 2) && ++ wtiff->miniswhite) ++ invert_band0(wtiff, q, p, area->width); ++ else if (wtiff->ready->BandFmt == VIPS_FORMAT_SHORT && ++ wtiff->ready->Type == VIPS_INTERPRETATION_LABS) ++ LabS2Lab16(q, p, area->width, in->im->Bands); + else +- memcpy( q, p, +- area->width * +- VIPS_IMAGE_SIZEOF_PEL( wtiff->ready ) ); ++ memcpy(q, p, ++ area->width * ++ VIPS_IMAGE_SIZEOF_PEL(wtiff->ready)); + + q += wtiff->tls; + } +@@ -1506,7 +1499,7 @@ wtiff_pack2tiff( Wtiff *wtiff, Layer *layer, + /* Write a set of tiles across the strip. + */ + static int +-wtiff_layer_write_tiles( Wtiff *wtiff, Layer *layer, VipsRegion *strip ) ++wtiff_layer_write_tiles(Wtiff *wtiff, Layer *layer, VipsRegion *strip) + { + VipsImage *im = layer->image; + VipsRect *area = &strip->valid; +@@ -1519,24 +1512,24 @@ wtiff_layer_write_tiles( Wtiff *wtiff, Layer *layer, VipsRegion *strip ) + image.width = im->Xsize; + image.height = im->Ysize; + +- for( x = 0; x < im->Xsize; x += wtiff->tilew ) { ++ for (x = 0; x < im->Xsize; x += wtiff->tilew) { + VipsRect tile; + + tile.left = x; + tile.top = area->top; + tile.width = wtiff->tilew; + tile.height = wtiff->tileh; +- vips_rect_intersectrect( &tile, &image, &tile ); ++ vips_rect_intersectrect(&tile, &image, &tile); + + #ifdef DEBUG_VERBOSE +- printf( "Writing %dx%d tile at position %dx%d to image %s\n", ++ printf("Writing %dx%d tile at position %dx%d to image %s\n", + tile.width, tile.height, tile.left, tile.top, +- TIFFFileName( layer->tif ) ); ++ TIFFFileName(layer->tif)); + #endif /*DEBUG_VERBOSE*/ + +- if( wtiff->we_compress ) { +- ttile_t tile_no = TIFFComputeTile( layer->tif, +- tile.left, tile.top, 0, 0 ); ++ if (wtiff->we_compress) { ++ ttile_t tile_no = TIFFComputeTile(layer->tif, ++ tile.left, tile.top, 0, 0); + + VipsTarget *target; + int result; +@@ -1545,7 +1538,7 @@ wtiff_layer_write_tiles( Wtiff *wtiff, Layer *layer, VipsRegion *strip ) + + target = vips_target_new_to_memory(); + +- switch( wtiff->compression ) { ++ switch (wtiff->compression) { + case JP2K_LOSSY: + /* Sadly chroma subsample seems not to work + * for edge tiles in tiff with jp2k +@@ -1562,14 +1555,14 @@ wtiff_layer_write_tiles( Wtiff *wtiff, Layer *layer, VipsRegion *strip ) + * FIXME ... try again with openjpeg 2.5, + * when that comes. + */ +- result = vips__foreign_load_jp2k_compress( ++ result = vips__foreign_load_jp2k_compress( + strip, &tile, target, + wtiff->tilew, wtiff->tileh, + !wtiff->rgbjpeg, +- // !wtiff->rgbjpeg && wtiff->Q < 90, ++ // !wtiff->rgbjpeg && wtiff->Q < 90, + FALSE, +- wtiff->lossless, +- wtiff->Q ); ++ wtiff->lossless, ++ wtiff->Q); + break; + + default: +@@ -1578,102 +1571,102 @@ wtiff_layer_write_tiles( Wtiff *wtiff, Layer *layer, VipsRegion *strip ) + break; + } + +- if( result ) { +- g_object_unref( target ); +- return( -1 ); ++ if (result) { ++ g_object_unref(target); ++ return (-1); + } + +- buffer = vips_target_steal( target, &length ); ++ buffer = vips_target_steal(target, &length); + +- g_object_unref( target ); ++ g_object_unref(target); + +- result = TIFFWriteRawTile( layer->tif, tile_no, +- buffer, length ); ++ result = TIFFWriteRawTile(layer->tif, tile_no, ++ buffer, length); + +- g_free( buffer ); +- +- if( result < 0 ) { +- vips_error( "vips2tiff", +- "%s", _( "TIFF write tile failed" ) ); +- return( -1 ); ++ g_free(buffer); ++ ++ if (result < 0) { ++ vips_error("vips2tiff", ++ "%s", _("TIFF write tile failed")); ++ return (-1); + } + } + else { + /* Have to repack pixels for libtiff. + */ +- wtiff_pack2tiff( wtiff, +- layer, strip, &tile, wtiff->tbuf ); +- +- if( TIFFWriteTile( layer->tif, wtiff->tbuf, +- tile.left, tile.top, 0, 0 ) < 0 ) { +- vips_error( "vips2tiff", +- "%s", _( "TIFF write tile failed" ) ); +- return( -1 ); ++ wtiff_pack2tiff(wtiff, ++ layer, strip, &tile, wtiff->tbuf); ++ ++ if (TIFFWriteTile(layer->tif, wtiff->tbuf, ++ tile.left, tile.top, 0, 0) < 0) { ++ vips_error("vips2tiff", ++ "%s", _("TIFF write tile failed")); ++ return (-1); + } + } + } + +- return( 0 ); ++ return (0); + } + + /* Write tileh scanlines, less for the last strip. + */ + static int +-wtiff_layer_write_strip( Wtiff *wtiff, Layer *layer, VipsRegion *strip ) ++wtiff_layer_write_strip(Wtiff *wtiff, Layer *layer, VipsRegion *strip) + { + VipsImage *im = layer->image; + VipsRect *area = &strip->valid; +- int height = VIPS_MIN( wtiff->tileh, area->height ); ++ int height = VIPS_MIN(wtiff->tileh, area->height); + + int y; + + #ifdef DEBUG_VERBOSE +- printf( "wtiff_layer_write_strip: top %d, height %d, file %s\n", +- area->top, height, TIFFFileName( layer->tif ) ); ++ printf("wtiff_layer_write_strip: top %d, height %d, file %s\n", ++ area->top, height, TIFFFileName(layer->tif)); + #endif /*DEBUG_VERBOSE*/ + +- for( y = 0; y < height; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( strip, 0, area->top + y ); ++ for (y = 0; y < height; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(strip, 0, area->top + y); + + /* Any repacking necessary. + */ +- if( im->Coding == VIPS_CODING_LABQ ) { +- LabQ2LabC( wtiff->tbuf, p, im->Xsize ); ++ if (im->Coding == VIPS_CODING_LABQ) { ++ LabQ2LabC(wtiff->tbuf, p, im->Xsize); + p = wtiff->tbuf; + } +- else if( im->BandFmt == VIPS_FORMAT_SHORT && +- im->Type == VIPS_INTERPRETATION_LABS ) { +- LabS2Lab16( wtiff->tbuf, p, im->Xsize, im->Bands ); ++ else if (im->BandFmt == VIPS_FORMAT_SHORT && ++ im->Type == VIPS_INTERPRETATION_LABS) { ++ LabS2Lab16(wtiff->tbuf, p, im->Xsize, im->Bands); + p = wtiff->tbuf; + } +- else if( wtiff->input->Type == VIPS_INTERPRETATION_XYZ ) { +- XYZ2tiffxyz( wtiff->tbuf, p, im->Xsize, im->Bands ); ++ else if (wtiff->input->Type == VIPS_INTERPRETATION_XYZ) { ++ XYZ2tiffxyz(wtiff->tbuf, p, im->Xsize, im->Bands); + p = wtiff->tbuf; + } +- else if( wtiff->bitdepth > 0 ) { +- eightbit2nbit( wtiff, wtiff->tbuf, p, im->Xsize ); ++ else if (wtiff->bitdepth > 0) { ++ eightbit2nbit(wtiff, wtiff->tbuf, p, im->Xsize); + p = wtiff->tbuf; + } +- else if( (im->Bands == 1 || im->Bands == 2) && +- wtiff->miniswhite ) { +- invert_band0( wtiff, wtiff->tbuf, p, im->Xsize ); ++ else if ((im->Bands == 1 || im->Bands == 2) && ++ wtiff->miniswhite) { ++ invert_band0(wtiff, wtiff->tbuf, p, im->Xsize); + p = wtiff->tbuf; + } + +- if( TIFFWriteScanline( layer->tif, p, area->top + y, 0 ) < 0 ) +- return( -1 ); ++ if (TIFFWriteScanline(layer->tif, p, area->top + y, 0) < 0) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + +-static int layer_strip_arrived( Layer *layer ); ++static int layer_strip_arrived(Layer *layer); + + /* Shrink what pixels we can from this strip into the layer below. If the + * strip below fills, recurse. + */ + static int +-layer_strip_shrink( Layer *layer ) ++layer_strip_shrink(Layer *layer) + { + Layer *below = layer->below; + VipsRegion *from = layer->strip; +@@ -1685,16 +1678,16 @@ layer_strip_shrink( Layer *layer ) + /* Our pixels might cross a strip boundary in the layer below, so we + * have to write repeatedly until we run out of pixels. + */ +- for(;;) { ++ for (;;) { + /* The pixels the layer below needs. + */ + target.left = 0; + target.top = below->write_y; + target.width = below->image->Xsize; + target.height = to->valid.height; +- vips_rect_intersectrect( &target, &to->valid, &target ); ++ vips_rect_intersectrect(&target, &to->valid, &target); + +- /* Those pixels need this area of this layer. ++ /* Those pixels need this area of this layer. + */ + source.left = target.left * 2; + source.top = target.top * 2; +@@ -1703,7 +1696,7 @@ layer_strip_shrink( Layer *layer ) + + /* Of which we have these available. + */ +- vips_rect_intersectrect( &source, &from->valid, &source ); ++ vips_rect_intersectrect(&source, &from->valid, &source); + + /* So these are the pixels in the layer below we can provide. + */ +@@ -1714,11 +1707,11 @@ layer_strip_shrink( Layer *layer ) + + /* None? All done. + */ +- if( vips_rect_isempty( &target ) ) ++ if (vips_rect_isempty(&target)) + break; + +- (void) vips_region_shrink_method( from, to, &target, +- layer->wtiff->region_shrink ); ++ (void) vips_region_shrink_method(from, to, &target, ++ layer->wtiff->region_shrink); + + below->write_y += target.height; + +@@ -1727,18 +1720,18 @@ layer_strip_shrink( Layer *layer ) + * down the image, or, if it's at the bottom, get to the last + * real line of pixels. + */ +- if( below->write_y == VIPS_RECT_BOTTOM( &to->valid ) || +- below->write_y == below->height ) { +- if( layer_strip_arrived( below ) ) +- return( -1 ); ++ if (below->write_y == VIPS_RECT_BOTTOM(&to->valid) || ++ below->write_y == below->height) { ++ if (layer_strip_arrived(below)) ++ return (-1); + } + } + +- return( 0 ); ++ return (0); + } + +-/* A new strip has arrived! The strip has at least enough pixels in to +- * write a line of tiles or a set of scanlines. ++/* A new strip has arrived! The strip has at least enough pixels in to ++ * write a line of tiles or a set of scanlines. + * + * - write a line of tiles / set of scanlines + * - shrink what we can to the layer below +@@ -1746,7 +1739,7 @@ layer_strip_shrink( Layer *layer ) + * - copy the overlap with the previous strip + */ + static int +-layer_strip_arrived( Layer *layer ) ++layer_strip_arrived(Layer *layer) + { + Wtiff *wtiff = layer->wtiff; + +@@ -1755,21 +1748,21 @@ layer_strip_arrived( Layer *layer ) + VipsRect overlap; + VipsRect image_area; + +- if( wtiff->tile ) +- result = wtiff_layer_write_tiles( wtiff, layer, layer->strip ); ++ if (wtiff->tile) ++ result = wtiff_layer_write_tiles(wtiff, layer, layer->strip); + else +- result = wtiff_layer_write_strip( wtiff, layer, layer->strip ); +- if( result ) +- return( -1 ); ++ result = wtiff_layer_write_strip(wtiff, layer, layer->strip); ++ if (result) ++ return (-1); + +- if( layer->below && +- layer_strip_shrink( layer ) ) +- return( -1 ); ++ if (layer->below && ++ layer_strip_shrink(layer)) ++ return (-1); + +- /* Position our strip down the image. ++ /* Position our strip down the image. + * +- * Expand the strip if necessary to make sure we have an even +- * number of lines. ++ * Expand the strip if necessary to make sure we have an even ++ * number of lines. + */ + layer->y += wtiff->tileh; + new_strip.left = 0; +@@ -1781,56 +1774,56 @@ layer_strip_arrived( Layer *layer ) + image_area.top = 0; + image_area.width = layer->image->Xsize; + image_area.height = layer->image->Ysize; +- vips_rect_intersectrect( &new_strip, &image_area, &new_strip ); ++ vips_rect_intersectrect(&new_strip, &image_area, &new_strip); + +- if( (new_strip.height & 1) == 1 ) ++ if ((new_strip.height & 1) == 1) + new_strip.height += 1; + +- /* What pixels that we will need do we already have? Save them in ++ /* What pixels that we will need do we already have? Save them in + * overlap. + */ +- vips_rect_intersectrect( &new_strip, &layer->strip->valid, &overlap ); +- if( !vips_rect_isempty( &overlap ) ) { +- if( vips_region_buffer( layer->copy, &overlap ) ) +- return( -1 ); +- vips_region_copy( layer->strip, layer->copy, +- &overlap, overlap.left, overlap.top ); ++ vips_rect_intersectrect(&new_strip, &layer->strip->valid, &overlap); ++ if (!vips_rect_isempty(&overlap)) { ++ if (vips_region_buffer(layer->copy, &overlap)) ++ return (-1); ++ vips_region_copy(layer->strip, layer->copy, ++ &overlap, overlap.left, overlap.top); + } + +- if( !vips_rect_isempty( &new_strip ) ) { +- if( vips_region_buffer( layer->strip, &new_strip ) ) +- return( -1 ); ++ if (!vips_rect_isempty(&new_strip)) { ++ if (vips_region_buffer(layer->strip, &new_strip)) ++ return (-1); + + /* And copy back again. + */ +- if( !vips_rect_isempty( &overlap ) ) +- vips_region_copy( layer->copy, layer->strip, +- &overlap, overlap.left, overlap.top ); ++ if (!vips_rect_isempty(&overlap)) ++ vips_region_copy(layer->copy, layer->strip, ++ &overlap, overlap.left, overlap.top); + } + +- return( 0 ); ++ return (0); + } + +-/* Another few scanlines of pixels. We know the scanlines are all within the ++/* Another few scanlines of pixels. We know the scanlines are all within the + * current page. + */ + static int +-wtiff_write_lines( Wtiff *wtiff, VipsRegion *region, VipsRect *lines ) ++wtiff_write_lines(Wtiff *wtiff, VipsRegion *region, VipsRect *lines) + { +- Layer *layer = wtiff->layer; ++ Layer *layer = wtiff->layer; + int page_top = wtiff->page_number * wtiff->page_height; + + #ifdef DEBUG_VERBOSE +- printf( "wtiff_write_lines: top %d, height %d\n", +- lines->top, lines->height ); +-#endif/*DEBUG_VERBOSE*/ ++ printf("wtiff_write_lines: top %d, height %d\n", ++ lines->top, lines->height); ++#endif /*DEBUG_VERBOSE*/ + + /* Keep filling the current strip of the top layer. Each time it + * fills, write a chunk of pyramid. + * +- * lines is in ++ * lines is in + */ +- for(;;) { ++ for (;;) { + VipsRect *to = &layer->strip->valid; + VipsRect target; + VipsRect page_lines; +@@ -1841,7 +1834,7 @@ wtiff_write_lines( Wtiff *wtiff, VipsRegion *region, VipsRect *lines ) + target.top = layer->write_y; + target.width = layer->image->Xsize; + target.height = to->height; +- vips_rect_intersectrect( &target, to, &target ); ++ vips_rect_intersectrect(&target, to, &target); + + /* region and lines are in world coordinates, we must subtract + * the top of the current page to get layer coordinates. +@@ -1851,22 +1844,22 @@ wtiff_write_lines( Wtiff *wtiff, VipsRegion *region, VipsRect *lines ) + + /* Clip against the lines we've been given. + */ +- vips_rect_intersectrect( &target, &page_lines, &target ); ++ vips_rect_intersectrect(&target, &page_lines, &target); + + /* Are we empty? All done. + */ +- if( vips_rect_isempty( &target ) ) ++ if (vips_rect_isempty(&target)) + break; + + /* And copy those pixels in. + * +- * FIXME: If the strip fits inside the region we've just ++ * FIXME: If the strip fits inside the region we've just + * received, we could skip the copy. Will this happen very + * often? Unclear. + */ + target.top += page_top; +- vips_region_copy( region, layer->strip, +- &target, target.left, target.top - page_top ); ++ vips_region_copy(region, layer->strip, ++ &target, target.left, target.top - page_top); + + layer->write_y += target.height; + +@@ -1874,82 +1867,83 @@ wtiff_write_lines( Wtiff *wtiff, VipsRegion *region, VipsRect *lines ) + * down the image, or, if it's at the bottom, get to the last + * real line of pixels. + */ +- if( layer->write_y == VIPS_RECT_BOTTOM( to ) || +- layer->write_y == layer->height ) { +- if( layer_strip_arrived( layer ) ) +- return( -1 ); ++ if (layer->write_y == VIPS_RECT_BOTTOM(to) || ++ layer->write_y == layer->height) { ++ if (layer_strip_arrived(layer)) ++ return (-1); + } + } + +- return( 0 ); ++ return (0); + } + + /* Copy fields. + */ +-#define CopyField( tag, v ) \ +- if( TIFFGetField( in, tag, &v ) ) TIFFSetField( out, tag, v ) ++#define CopyField(tag, v) \ ++ if (TIFFGetField(in, tag, &v)) \ ++ TIFFSetField(out, tag, v) + + static int +-wtiff_copy_tiles( Wtiff *wtiff, TIFF *out, TIFF *in ) ++wtiff_copy_tiles(Wtiff *wtiff, TIFF *out, TIFF *in) + { +- const ttile_t n_tiles = TIFFNumberOfTiles( in ); ++ const ttile_t n_tiles = TIFFNumberOfTiles(in); + + tsize_t tile_size; + tdata_t buf; + ttile_t i; + +- if( wtiff->compression == COMPRESSION_JPEG ) +- tile_size = TIFFTileSize( in ); +- else +- /* If we will be copying raw tiles we need a buffer large ++ if (wtiff->compression == COMPRESSION_JPEG) ++ tile_size = TIFFTileSize(in); ++ else ++ /* If we will be copying raw tiles we need a buffer large + * enough to hold the largest compressed tile in any page. + * +- * Allocate a buffer 2x the uncompressed tile size ... much ++ * Allocate a buffer 2x the uncompressed tile size ... much + * simpler than searching every page for the largest tile with + * TIFFTAG_TILEBYTECOUNTS. + */ + tile_size = 2 * wtiff->tls * wtiff->tileh; +- buf = vips_malloc( NULL, tile_size ); ++ buf = vips_malloc(NULL, tile_size); + +- for( i = 0; i < n_tiles; i++ ) { ++ for (i = 0; i < n_tiles; i++) { + tsize_t len; + +- /* If this is a JPEG-compressed TIFF, we need to decompress +- * and recompress, since tiles are actually written in several +- * places (coefficients go in the tile, huffman tables go ++ /* If this is a JPEG-compressed TIFF, we need to decompress ++ * and recompress, since tiles are actually written in several ++ * places (coefficients go in the tile, huffman tables go + * elsewhere). + * +- * For all other compression types, we can just use ++ * For all other compression types, we can just use + * TIFFReadRawTile()/TIFFWriteRawTile(). + */ +- if( wtiff->compression == COMPRESSION_JPEG ) { +- len = TIFFReadEncodedTile( in, i, buf, tile_size ); +- if( len <= 0 || +- TIFFWriteEncodedTile( out, i, buf, len ) < 0 ) { +- g_free( buf ); +- return( -1 ); ++ if (wtiff->compression == COMPRESSION_JPEG) { ++ len = TIFFReadEncodedTile(in, i, buf, tile_size); ++ if (len <= 0 || ++ TIFFWriteEncodedTile(out, i, buf, len) < 0) { ++ g_free(buf); ++ return (-1); + } + } + else { +- len = TIFFReadRawTile( in, i, buf, tile_size ); +- if( len <= 0 || +- TIFFWriteRawTile( out, i, buf, len ) < 0 ) { +- g_free( buf ); +- return( -1 ); ++ len = TIFFReadRawTile(in, i, buf, tile_size); ++ if (len <= 0 || ++ TIFFWriteRawTile(out, i, buf, len) < 0) { ++ g_free(buf); ++ return (-1); + } + } + } + +- g_free( buf ); ++ g_free(buf); + +- return( 0 ); ++ return (0); + } + +-/* Copy a TIFF file ... we know we wrote it, so just copy the tags we know ++/* Copy a TIFF file ... we know we wrote it, so just copy the tags we know + * we might have set. + */ + static int +-wtiff_copy_tiff( Wtiff *wtiff, TIFF *out, TIFF *in ) ++wtiff_copy_tiff(Wtiff *wtiff, TIFF *out, TIFF *in) + { + guint32 ui32; + guint16 ui16; +@@ -1959,248 +1953,248 @@ wtiff_copy_tiff( Wtiff *wtiff, TIFF *out, TIFF *in ) + + /* All the fields we might have set. + */ +- CopyField( TIFFTAG_IMAGEWIDTH, ui32 ); +- CopyField( TIFFTAG_IMAGELENGTH, ui32 ); +- CopyField( TIFFTAG_PLANARCONFIG, ui16 ); +- CopyField( TIFFTAG_ORIENTATION, ui16 ); +- CopyField( TIFFTAG_XRESOLUTION, f ); +- CopyField( TIFFTAG_YRESOLUTION, f ); +- CopyField( TIFFTAG_RESOLUTIONUNIT, ui16 ); +- CopyField( TIFFTAG_COMPRESSION, ui16 ); +- CopyField( TIFFTAG_SAMPLESPERPIXEL, ui16 ); +- CopyField( TIFFTAG_BITSPERSAMPLE, ui16 ); +- CopyField( TIFFTAG_PHOTOMETRIC, ui16 ); +- CopyField( TIFFTAG_ORIENTATION, ui16 ); +- CopyField( TIFFTAG_TILEWIDTH, ui32 ); +- CopyField( TIFFTAG_TILELENGTH, ui32 ); +- CopyField( TIFFTAG_ROWSPERSTRIP, ui32 ); +- CopyField( TIFFTAG_SUBFILETYPE, ui32 ); +- +- if( TIFFGetField( in, TIFFTAG_EXTRASAMPLES, &ui16, &a ) ) +- TIFFSetField( out, TIFFTAG_EXTRASAMPLES, ui16, a ); +- +- if( TIFFGetField( in, TIFFTAG_PAGENUMBER, &ui16, &ui16_2 ) ) +- TIFFSetField( out, TIFFTAG_PAGENUMBER, ui16, ui16_2 ); ++ CopyField(TIFFTAG_IMAGEWIDTH, ui32); ++ CopyField(TIFFTAG_IMAGELENGTH, ui32); ++ CopyField(TIFFTAG_PLANARCONFIG, ui16); ++ CopyField(TIFFTAG_ORIENTATION, ui16); ++ CopyField(TIFFTAG_XRESOLUTION, f); ++ CopyField(TIFFTAG_YRESOLUTION, f); ++ CopyField(TIFFTAG_RESOLUTIONUNIT, ui16); ++ CopyField(TIFFTAG_COMPRESSION, ui16); ++ CopyField(TIFFTAG_SAMPLESPERPIXEL, ui16); ++ CopyField(TIFFTAG_BITSPERSAMPLE, ui16); ++ CopyField(TIFFTAG_PHOTOMETRIC, ui16); ++ CopyField(TIFFTAG_ORIENTATION, ui16); ++ CopyField(TIFFTAG_TILEWIDTH, ui32); ++ CopyField(TIFFTAG_TILELENGTH, ui32); ++ CopyField(TIFFTAG_ROWSPERSTRIP, ui32); ++ CopyField(TIFFTAG_SUBFILETYPE, ui32); ++ ++ if (TIFFGetField(in, TIFFTAG_EXTRASAMPLES, &ui16, &a)) ++ TIFFSetField(out, TIFFTAG_EXTRASAMPLES, ui16, a); ++ ++ if (TIFFGetField(in, TIFFTAG_PAGENUMBER, &ui16, &ui16_2)) ++ TIFFSetField(out, TIFFTAG_PAGENUMBER, ui16, ui16_2); + + /* TIFFTAG_JPEGQUALITY is a pesudo-tag, so we can't copy it. + * Set explicitly from Wtiff. + */ +- if( wtiff->compression == COMPRESSION_JPEG ) { +- TIFFSetField( out, TIFFTAG_JPEGQUALITY, wtiff->Q ); ++ if (wtiff->compression == COMPRESSION_JPEG) { ++ TIFFSetField(out, TIFFTAG_JPEGQUALITY, wtiff->Q); + + /* Only for three-band, 8-bit images. + */ +- if( wtiff->ready->Bands == 3 && +- wtiff->ready->BandFmt == VIPS_FORMAT_UCHAR ) { +- /* Enable rgb->ycbcr conversion in the jpeg write. ++ if (wtiff->ready->Bands == 3 && ++ wtiff->ready->BandFmt == VIPS_FORMAT_UCHAR) { ++ /* Enable rgb->ycbcr conversion in the jpeg write. + */ +- if( !wtiff->rgbjpeg && +- wtiff->Q < 90 ) +- TIFFSetField( out, +- TIFFTAG_JPEGCOLORMODE, +- JPEGCOLORMODE_RGB ); ++ if (!wtiff->rgbjpeg && ++ wtiff->Q < 90) ++ TIFFSetField(out, ++ TIFFTAG_JPEGCOLORMODE, ++ JPEGCOLORMODE_RGB); + + /* And we want ycbcr expanded to rgb on read. Otherwise + * TIFFTileSize() will give us the size of a chrominance + * subsampled tile. + */ +- TIFFSetField( in, +- TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB ); ++ TIFFSetField(in, ++ TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB); + } + } + + #ifdef HAVE_TIFF_COMPRESSION_WEBP + /* More pseudotags we can't copy. + */ +- if( wtiff->compression == COMPRESSION_WEBP ) { +- TIFFSetField( out, TIFFTAG_WEBP_LEVEL, wtiff->Q ); +- TIFFSetField( out, TIFFTAG_WEBP_LOSSLESS, wtiff->lossless ); ++ if (wtiff->compression == COMPRESSION_WEBP) { ++ TIFFSetField(out, TIFFTAG_WEBP_LEVEL, wtiff->Q); ++ TIFFSetField(out, TIFFTAG_WEBP_LOSSLESS, wtiff->lossless); + } +- if( wtiff->compression == COMPRESSION_ZSTD ) { +- TIFFSetField( out, TIFFTAG_ZSTD_LEVEL, wtiff->level ); +- if( wtiff->predictor != VIPS_FOREIGN_TIFF_PREDICTOR_NONE ) +- TIFFSetField( out, +- TIFFTAG_PREDICTOR, wtiff->predictor ); ++ if (wtiff->compression == COMPRESSION_ZSTD) { ++ TIFFSetField(out, TIFFTAG_ZSTD_LEVEL, wtiff->level); ++ if (wtiff->predictor != VIPS_FOREIGN_TIFF_PREDICTOR_NONE) ++ TIFFSetField(out, ++ TIFFTAG_PREDICTOR, wtiff->predictor); + } + #endif /*HAVE_TIFF_COMPRESSION_WEBP*/ + +- if( (wtiff->compression == COMPRESSION_ADOBE_DEFLATE || +- wtiff->compression == COMPRESSION_LZW) && +- wtiff->predictor != VIPS_FOREIGN_TIFF_PREDICTOR_NONE ) +- TIFFSetField( out, TIFFTAG_PREDICTOR, wtiff->predictor ); ++ if ((wtiff->compression == COMPRESSION_ADOBE_DEFLATE || ++ wtiff->compression == COMPRESSION_LZW) && ++ wtiff->predictor != VIPS_FOREIGN_TIFF_PREDICTOR_NONE) ++ TIFFSetField(out, TIFFTAG_PREDICTOR, wtiff->predictor); + + /* We can't copy profiles or xmp :( Set again from wtiff. + */ +- if( !wtiff->strip ) +- if( wtiff_embed_profile( wtiff, out ) || +- wtiff_embed_xmp( wtiff, out ) || +- wtiff_embed_iptc( wtiff, out ) || +- wtiff_embed_photoshop( wtiff, out ) || +- wtiff_embed_imagedescription( wtiff, out ) ) +- return( -1 ); +- +- if( wtiff_copy_tiles( wtiff, out, in ) ) +- return( -1 ); +- +- return( 0 ); ++ if (!wtiff->strip) ++ if (wtiff_embed_profile(wtiff, out) || ++ wtiff_embed_xmp(wtiff, out) || ++ wtiff_embed_iptc(wtiff, out) || ++ wtiff_embed_photoshop(wtiff, out) || ++ wtiff_embed_imagedescription(wtiff, out)) ++ return (-1); ++ ++ if (wtiff_copy_tiles(wtiff, out, in)) ++ return (-1); ++ ++ return (0); + } + + /* Append all of the layers we wrote to the output. + */ + static int +-wtiff_gather( Wtiff *wtiff ) ++wtiff_gather(Wtiff *wtiff) + { + Layer *layer; + + #ifdef DEBUG +- printf( "wtiff_gather:\n" ); ++ printf("wtiff_gather:\n"); + #endif /*DEBUG*/ + +- if( wtiff->layer && +- wtiff->layer->below ) +- for( layer = wtiff->layer->below; layer; +- layer = layer->below ) { ++ if (wtiff->layer && ++ wtiff->layer->below) ++ for (layer = wtiff->layer->below; layer; ++ layer = layer->below) { + VipsSource *source; + TIFF *in; + + #ifdef DEBUG +- printf( "appending layer sub = %d ...\n", layer->sub ); ++ printf("appending layer sub = %d ...\n", layer->sub); + #endif /*DEBUG*/ + +- if( !(source = +- vips_source_new_from_target( layer->target )) ) +- return( -1 ); ++ if (!(source = ++ vips_source_new_from_target(layer->target))) ++ return (-1); + +- if( !(in = vips__tiff_openin_source( source )) ) { +- VIPS_UNREF( source ); +- return( -1 ); ++ if (!(in = vips__tiff_openin_source(source))) { ++ VIPS_UNREF(source); ++ return (-1); + } + +- VIPS_UNREF( source ); ++ VIPS_UNREF(source); + +- if( wtiff_copy_tiff( wtiff, wtiff->layer->tif, in ) ) { +- TIFFClose( in ); +- return( -1 ); ++ if (wtiff_copy_tiff(wtiff, wtiff->layer->tif, in)) { ++ TIFFClose(in); ++ return (-1); + } + +- TIFFClose( in ); ++ TIFFClose(in); + +- if( !TIFFWriteDirectory( wtiff->layer->tif ) ) +- return( -1 ); ++ if (!TIFFWriteDirectory(wtiff->layer->tif)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-wtiff_page_start( Wtiff *wtiff ) ++wtiff_page_start(Wtiff *wtiff) + { + #ifdef DEBUG +- printf( "wtiff_page_start: page %d\n", wtiff->page_number ); ++ printf("wtiff_page_start: page %d\n", wtiff->page_number); + #endif /*DEBUG*/ + +- /* Init the pyramid framework for this page. This will just make a ++ /* Init the pyramid framework for this page. This will just make a + * single layer if we're not pyramiding. + */ +- wtiff_layer_init( wtiff, &wtiff->layer, NULL, +- wtiff->ready->Xsize, wtiff->page_height ); ++ wtiff_layer_init(wtiff, &wtiff->layer, NULL, ++ wtiff->ready->Xsize, wtiff->page_height); + + /* Fill all the layers and write the TIFF headers. + */ +- if( wtiff_allocate_layers( wtiff ) ) +- return( -1 ); ++ if (wtiff_allocate_layers(wtiff)) ++ return (-1); + + /* In ifd mode, we write the pyramid layers as subdirectories of this + * page. + */ +- if( wtiff->subifd ) { ++ if (wtiff->subifd) { + int n_layers; + Layer *p; + + #ifdef DEBUG +- printf( "wtiff_write_page: OME pyr mode\n" ); ++ printf("wtiff_write_page: OME pyr mode\n"); + #endif /*DEBUG*/ + +- for( n_layers = 0, p = wtiff->layer->below; p; p = p->below ) ++ for (n_layers = 0, p = wtiff->layer->below; p; p = p->below) + n_layers += 1; + +- if( n_layers > 0 ) { +- toff_t *subifd_offsets; +- +- /* This magic tag makes the n_layers directories we +- * write after this one into subdirectories. We set +- * the offsets to 0 and libtiff will fill them in +- * automatically. +- */ +- subifd_offsets = VIPS_ARRAY( NULL, n_layers, toff_t ); +- memset( subifd_offsets, +- 0, n_layers * sizeof( toff_t ) ); +- TIFFSetField( wtiff->layer->tif, TIFFTAG_SUBIFD, +- n_layers, subifd_offsets ); +- g_free( subifd_offsets ); ++ if (n_layers > 0) { ++ toff_t *subifd_offsets; ++ ++ /* This magic tag makes the n_layers directories we ++ * write after this one into subdirectories. We set ++ * the offsets to 0 and libtiff will fill them in ++ * automatically. ++ */ ++ subifd_offsets = VIPS_ARRAY(NULL, n_layers, toff_t); ++ memset(subifd_offsets, ++ 0, n_layers * sizeof(toff_t)); ++ TIFFSetField(wtiff->layer->tif, TIFFTAG_SUBIFD, ++ n_layers, subifd_offsets); ++ g_free(subifd_offsets); + } + } + +- return( 0 ); ++ return (0); + } + + static int +-wtiff_page_end( Wtiff *wtiff ) ++wtiff_page_end(Wtiff *wtiff) + { + #ifdef DEBUG +- printf( "wtiff_page_end: page %d\n", wtiff->page_number ); ++ printf("wtiff_page_end: page %d\n", wtiff->page_number); + #endif /*DEBUG*/ + +- if( !TIFFWriteDirectory( wtiff->layer->tif ) ) +- return( -1 ); ++ if (!TIFFWriteDirectory(wtiff->layer->tif)) ++ return (-1); + + /* Append any pyr layers, if necessary. + */ +- if( wtiff->layer->below ) { ++ if (wtiff->layer->below) { + Layer *layer; + +- /* Free any lower pyramid resources ... this will +- * TIFFClose() (but not delete) the smaller layers ++ /* Free any lower pyramid resources ... this will ++ * TIFFClose() (but not delete) the smaller layers + * ready for us to read from them again. + */ +- layer_free_all( wtiff->layer->below ); ++ layer_free_all(wtiff->layer->below); + + /* Append smaller layers to the main file. + */ +- if( wtiff_gather( wtiff ) ) +- return( -1 ); ++ if (wtiff_gather(wtiff)) ++ return (-1); + + /* unref all the lower targets. + */ +- for( layer = wtiff->layer->below; layer; layer = layer->below ) +- VIPS_UNREF( layer->target ); ++ for (layer = wtiff->layer->below; layer; layer = layer->below) ++ VIPS_UNREF(layer->target); + +- /* ... ready for the next page. ++ /* ... ready for the next page. + */ + wtiff->layer->below = NULL; + } + + wtiff->page_number += 1; + +- return( 0 ); ++ return (0); + } + + /* A strip of pixels has come in from libvips. Split these strips into pages, + * and run the page start / end code. + */ + static int +-wtiff_sink_disc_strip( VipsRegion *region, VipsRect *area, void *a ) ++wtiff_sink_disc_strip(VipsRegion *region, VipsRect *area, void *a) + { +- Wtiff *wtiff = ( Wtiff *) a; ++ Wtiff *wtiff = (Wtiff *) a; + + VipsRect pixels; + + #ifdef DEBUG_VERBOSE +- printf( "wtiff_sink_disc_strip: top %d, height %d\n", +- area->top, area->height ); ++ printf("wtiff_sink_disc_strip: top %d, height %d\n", ++ area->top, area->height); + #endif /*DEBUG_VERBOSE*/ + +- g_assert( area->width == wtiff->ready->Xsize ); ++ g_assert(area->width == wtiff->ready->Xsize); + + /* Loop down this as we write scanlines into pages. + */ +@@ -2219,38 +2213,38 @@ wtiff_sink_disc_strip( VipsRegion *region, VipsRect *area, void *a ) + + /* The scanlines we have for this page. + */ +- vips_rect_intersectrect( &page, &pixels, &lines ); ++ vips_rect_intersectrect(&page, &pixels, &lines); + + /* At the top of the page? Run the page start code. + */ +- if( lines.top == page.top && +- wtiff_page_start( wtiff ) ) +- return( -1 ); ++ if (lines.top == page.top && ++ wtiff_page_start(wtiff)) ++ return (-1); + + /* Write the scanlines into the page. + */ +- if( wtiff_write_lines( wtiff, region, &lines ) ) +- return( -1 ); ++ if (wtiff_write_lines(wtiff, region, &lines)) ++ return (-1); + + /* Hit the end of the page? Run the page end code. + */ +- if( VIPS_RECT_BOTTOM( &page ) == VIPS_RECT_BOTTOM( &lines ) && +- wtiff_page_end( wtiff ) ) +- return( -1 ); ++ if (VIPS_RECT_BOTTOM(&page) == VIPS_RECT_BOTTOM(&lines) && ++ wtiff_page_end(wtiff)) ++ return (-1); + + /* Remove the pixels we've written and loop if we have some + * still to write. + */ + pixels.top += lines.height; + pixels.height -= lines.height; +- } while( !vips_rect_isempty( &pixels ) ); ++ } while (!vips_rect_isempty(&pixels)); + +- return( 0 ); ++ return (0); + } + +-int +-vips__tiff_write_target( VipsImage *input, VipsTarget *target, +- VipsForeignTiffCompression compression, int Q, ++int ++vips__tiff_write_target(VipsImage *input, VipsTarget *target, ++ VipsForeignTiffCompression compression, int Q, + VipsForeignTiffPredictor predictor, + const char *profile, + gboolean tile, int tile_width, int tile_height, +@@ -2260,35 +2254,35 @@ vips__tiff_write_target( VipsImage *input, VipsTarget *target, + VipsForeignTiffResunit resunit, double xres, double yres, + gboolean bigtiff, + gboolean rgbjpeg, +- gboolean properties, gboolean strip, ++ gboolean properties, gboolean strip, + VipsRegionShrink region_shrink, +- int level, ++ int level, + gboolean lossless, + VipsForeignDzDepth depth, + gboolean subifd, + gboolean premultiply, +- int page_height ) ++ int page_height) + { + Wtiff *wtiff; + + vips__tiff_init(); + +- if( !(wtiff = wtiff_new( input, target, +- compression, Q, predictor, profile, +- tile, tile_width, tile_height, pyramid, bitdepth, +- miniswhite, resunit, xres, yres, bigtiff, rgbjpeg, +- properties, strip, region_shrink, level, lossless, depth, +- subifd, premultiply, page_height )) ) +- return( -1 ); +- +- if( vips_sink_disc( wtiff->ready, wtiff_sink_disc_strip, wtiff ) ) { +- wtiff_free( wtiff ); +- return( -1 ); ++ if (!(wtiff = wtiff_new(input, target, ++ compression, Q, predictor, profile, ++ tile, tile_width, tile_height, pyramid, bitdepth, ++ miniswhite, resunit, xres, yres, bigtiff, rgbjpeg, ++ properties, strip, region_shrink, level, lossless, depth, ++ subifd, premultiply, page_height))) ++ return (-1); ++ ++ if (vips_sink_disc(wtiff->ready, wtiff_sink_disc_strip, wtiff)) { ++ wtiff_free(wtiff); ++ return (-1); + } + +- wtiff_free( wtiff ); ++ wtiff_free(wtiff); + +- return( 0 ); ++ return (0); + } + + #endif /*HAVE_TIFF*/ +diff --git a/libvips/foreign/vipsload.c b/libvips/foreign/vipsload.c +index 63483427ce..20ed8464ce 100644 +--- a/libvips/foreign/vipsload.c ++++ b/libvips/foreign/vipsload.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -56,103 +56,102 @@ typedef struct _VipsForeignLoadVips { + + typedef VipsForeignLoadClass VipsForeignLoadVipsClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadVips, vips_foreign_load_vips, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadVips, vips_foreign_load_vips, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_vips_dispose( GObject *gobject ) ++vips_foreign_load_vips_dispose(GObject *gobject) + { + VipsForeignLoadVips *vips = (VipsForeignLoadVips *) gobject; + +- VIPS_UNREF( vips->source ); ++ VIPS_UNREF(vips->source); + +- G_OBJECT_CLASS( vips_foreign_load_vips_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_vips_parent_class)->dispose(gobject); + } + + static VipsForeignFlags +-vips_foreign_load_vips_get_flags_source( VipsSource *source ) ++vips_foreign_load_vips_get_flags_source(VipsSource *source) + { + unsigned char *data; + VipsForeignFlags flags; + + flags = VIPS_FOREIGN_PARTIAL; + +- if( vips_source_sniff_at_most( source, &data, 4 ) == 4 && +- *((guint32 *) data) == VIPS_MAGIC_SPARC ) ++ if (vips_source_sniff_at_most(source, &data, 4) == 4 && ++ *((guint32 *) data) == VIPS_MAGIC_SPARC) + flags |= VIPS_FOREIGN_BIGENDIAN; + +- return( flags ); ++ return (flags); + } + + static VipsForeignFlags +-vips_foreign_load_vips_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_vips_get_flags(VipsForeignLoad *load) + { + VipsForeignLoadVips *vips = (VipsForeignLoadVips *) load; + +- return( vips_foreign_load_vips_get_flags_source( vips->source ) ); ++ return (vips_foreign_load_vips_get_flags_source(vips->source)); + } + + static VipsForeignFlags +-vips_foreign_load_vips_get_flags_filename( const char *filename ) ++vips_foreign_load_vips_get_flags_filename(const char *filename) + { + VipsSource *source; + VipsForeignFlags flags; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( 0 ); +- flags = vips_foreign_load_vips_get_flags_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (0); ++ flags = vips_foreign_load_vips_get_flags_source(source); ++ VIPS_UNREF(source); + +- return( flags ); ++ return (flags); + } + + static int +-vips_foreign_load_vips_header( VipsForeignLoad *load ) ++vips_foreign_load_vips_header(VipsForeignLoad *load) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( load ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(load); + VipsForeignLoadVips *vips = (VipsForeignLoadVips *) load; +- VipsConnection *connection = VIPS_CONNECTION( vips->source ); ++ VipsConnection *connection = VIPS_CONNECTION(vips->source); + + const char *filename; + VipsImage *image; + VipsImage *x; + +- if( !vips_source_is_file( vips->source ) || +- !(filename = vips_connection_filename( connection )) ) { +- vips_error( class->nickname, +- "%s", _( "no filename associated with source" ) ); +- return( -1 ); ++ if (!vips_source_is_file(vips->source) || ++ !(filename = vips_connection_filename(connection))) { ++ vips_error(class->nickname, ++ "%s", _("no filename associated with source")); ++ return (-1); + } + +- if( !(image = vips_image_new_mode( filename, "r" )) ) +- return( -1 ); ++ if (!(image = vips_image_new_mode(filename, "r"))) ++ return (-1); + + /* What a hack. Remove the @out that's there now and replace it with +- * our image. ++ * our image. + */ +- g_object_get( load, "out", &x, NULL ); +- g_object_unref( x ); +- g_object_unref( x ); ++ g_object_get(load, "out", &x, NULL); ++ g_object_unref(x); ++ g_object_unref(x); + +- g_object_set( load, "out", image, NULL ); ++ g_object_set(load, "out", image, NULL); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_vips_class_init( VipsForeignLoadVipsClass *class ) ++vips_foreign_load_vips_class_init(VipsForeignLoadVipsClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->dispose = vips_foreign_load_vips_dispose; + + object_class->nickname = "vipsload_base"; +- object_class->description = _( "load vips base class" ); ++ object_class->description = _("load vips base class"); + + /* You're unlikely to want to use this on untrusted files. + */ +@@ -163,15 +162,14 @@ vips_foreign_load_vips_class_init( VipsForeignLoadVipsClass *class ) + foreign_class->priority = 200; + + load_class->get_flags = vips_foreign_load_vips_get_flags; +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_vips_get_flags_filename; + load_class->header = vips_foreign_load_vips_header; + load_class->load = NULL; +- + } + + static void +-vips_foreign_load_vips_init( VipsForeignLoadVips *vips ) ++vips_foreign_load_vips_init(VipsForeignLoadVips *vips) + { + } + +@@ -184,38 +182,37 @@ typedef struct _VipsForeignLoadVipsFile { + + typedef VipsForeignLoadVipsClass VipsForeignLoadVipsFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadVipsFile, vips_foreign_load_vips_file, +- vips_foreign_load_vips_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadVipsFile, vips_foreign_load_vips_file, ++ vips_foreign_load_vips_get_type()); + + static int +-vips_foreign_load_vips_file_build( VipsObject *object ) ++vips_foreign_load_vips_file_build(VipsObject *object) + { + VipsForeignLoadVips *vips = (VipsForeignLoadVips *) object; + VipsForeignLoadVipsFile *file = (VipsForeignLoadVipsFile *) object; + +- if( file->filename && +- !(vips->source = vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(vips->source = vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_vips_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_vips_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + const char *vips__suffs[] = { ".v", ".vips", NULL }; + + static gboolean +-vips_foreign_load_vips_file_is_a( const char *filename ) ++vips_foreign_load_vips_file_is_a(const char *filename) + { +- return( vips__file_magic( filename ) ); ++ return (vips__file_magic(filename)); + } + + static void +-vips_foreign_load_vips_file_class_init( VipsForeignLoadVipsClass *class ) ++vips_foreign_load_vips_file_class_init(VipsForeignLoadVipsClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -224,23 +221,23 @@ vips_foreign_load_vips_file_class_init( VipsForeignLoadVipsClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "vipsload"; +- object_class->description = _( "load vips from file" ); ++ object_class->description = _("load vips from file"); + object_class->build = vips_foreign_load_vips_file_build; + + foreign_class->suffs = vips__suffs; + + load_class->is_a = vips_foreign_load_vips_file_is_a; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadVipsFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadVipsFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_vips_file_init( VipsForeignLoadVipsFile *file ) ++vips_foreign_load_vips_file_init(VipsForeignLoadVipsFile *file) + { + } + +@@ -253,71 +250,69 @@ typedef struct _VipsForeignLoadVipsSource { + + typedef VipsForeignLoadVipsClass VipsForeignLoadVipsSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadVipsSource, vips_foreign_load_vips_source, +- vips_foreign_load_vips_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadVipsSource, vips_foreign_load_vips_source, ++ vips_foreign_load_vips_get_type()); + + static int +-vips_foreign_load_vips_source_build( VipsObject *object ) ++vips_foreign_load_vips_source_build(VipsObject *object) + { + VipsForeignLoadVips *vips = (VipsForeignLoadVips *) object; +- VipsForeignLoadVipsSource *source = ++ VipsForeignLoadVipsSource *source = + (VipsForeignLoadVipsSource *) object; + +- if( source->source ) { ++ if (source->source) { + vips->source = source->source; +- g_object_ref( vips->source ); ++ g_object_ref(vips->source); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_vips_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_vips_source_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_vips_source_is_a_source( VipsSource *source ) ++vips_foreign_load_vips_source_is_a_source(VipsSource *source) + { +- VipsConnection *connection = VIPS_CONNECTION( source ); ++ VipsConnection *connection = VIPS_CONNECTION(source); + + const char *filename; + +- return( vips_source_is_file( source ) && +- (filename = vips_connection_filename( connection )) && +- vips__file_magic( filename ) ); ++ return (vips_source_is_file(source) && ++ (filename = vips_connection_filename(connection)) && ++ vips__file_magic(filename)); + } + + static void +-vips_foreign_load_vips_source_class_init( VipsForeignLoadVipsClass *class ) ++vips_foreign_load_vips_source_class_init(VipsForeignLoadVipsClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "vipsload_source"; +- object_class->description = _( "load vips from source" ); ++ object_class->description = _("load vips from source"); + object_class->build = vips_foreign_load_vips_source_build; + + operation_class->flags |= VIPS_OPERATION_NOCACHE; + +- load_class->is_a_source = ++ load_class->is_a_source = + vips_foreign_load_vips_source_is_a_source; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadVipsSource, source ), +- VIPS_TYPE_SOURCE ); +- ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadVipsSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_vips_source_init( VipsForeignLoadVipsSource *source ) ++vips_foreign_load_vips_source_init(VipsForeignLoadVipsSource *source) + { + } + +@@ -327,23 +322,23 @@ vips_foreign_load_vips_source_init( VipsForeignLoadVipsSource *source ) + * @out: (out): decompressed image + * @...: %NULL-terminated list of optional named arguments + * +- * Read in a vips image. ++ * Read in a vips image. + * + * See also: vips_vipssave(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_vipsload( const char *filename, VipsImage **out, ... ) ++vips_vipsload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "vipsload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("vipsload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -352,19 +347,19 @@ vips_vipsload( const char *filename, VipsImage **out, ... ) + * @out: (out): decompressed image + * @...: %NULL-terminated list of optional named arguments + * +- * Exactly as vips_vipsload(), but read from a source. ++ * Exactly as vips_vipsload(), but read from a source. + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_vipsload_source( VipsSource *source, VipsImage **out, ... ) ++vips_vipsload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "vipsload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("vipsload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/vipspng.c b/libvips/foreign/vipspng.c +index afef240c04..5d341b2d38 100644 +--- a/libvips/foreign/vipspng.c ++++ b/libvips/foreign/vipspng.c +@@ -51,10 +51,10 @@ + * 9/8/14 + * - don't check profiles, helps with libpng >=1.6.11 + * 27/10/14 Lovell +- * - add @filter option ++ * - add @filter option + * 26/2/15 + * - close the read down early for a header read ... this saves an +- * fd during file read, handy for large numbers of input images ++ * fd during file read, handy for large numbers of input images + * 31/7/16 + * - support --strip option + * 17/1/17 +@@ -84,35 +84,35 @@ + * 29/8/21 joshuamsager + * - add "unlimited" flag to png load + * 13/1/22 +- * - raise libpng pixel size limit to VIPS_MAX_COORD ++ * - raise libpng pixel size limit to VIPS_MAX_COORD + * 17/11/22 + * - add exif read/write + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -150,28 +150,28 @@ const char *vips__png_suffs[] = { ".png", NULL }; + #endif + + static void +-user_error_function( png_structp png_ptr, png_const_charp error_msg ) ++user_error_function(png_structp png_ptr, png_const_charp error_msg) + { + #ifdef DEBUG +- printf( "user_error_function: %s\n", error_msg ); ++ printf("user_error_function: %s\n", error_msg); + #endif /*DEBUG*/ + +- g_warning( "%s", error_msg ); ++ g_warning("%s", error_msg); + + /* This function must not return or the default error handler will be + * invoked. + */ +- longjmp( png_jmpbuf( png_ptr ), -1 ); ++ longjmp(png_jmpbuf(png_ptr), -1); + } + + static void +-user_warning_function( png_structp png_ptr, png_const_charp warning_msg ) ++user_warning_function(png_structp png_ptr, png_const_charp warning_msg) + { + #ifdef DEBUG +- printf( "user_warning_function: %s\n", warning_msg ); ++ printf("user_warning_function: %s\n", warning_msg); + #endif /*DEBUG*/ + +- g_warning( "%s", warning_msg ); ++ g_warning("%s", warning_msg); + } + + #define INPUT_BUFFER_SIZE (4096) +@@ -203,60 +203,60 @@ typedef struct { + /* Can be called many times. + */ + static void +-read_destroy( Read *read ) ++read_destroy(Read *read) + { + /* We never call png_read_end(), perhaps we should. It can fail on + * truncated files, so we'd need a setjmp(). + */ + +- if( read->pPng ) +- png_destroy_read_struct( &read->pPng, &read->pInfo, NULL ); +- VIPS_UNREF( read->source ); +- VIPS_FREE( read->row_pointer ); ++ if (read->pPng) ++ png_destroy_read_struct(&read->pPng, &read->pInfo, NULL); ++ VIPS_UNREF(read->source); ++ VIPS_FREE(read->row_pointer); + } + + static void +-read_close_cb( VipsImage *out, Read *read ) ++read_close_cb(VipsImage *out, Read *read) + { +- read_destroy( read ); ++ read_destroy(read); + } + + static void +-read_minimise_cb( VipsImage *image, Read *read ) ++read_minimise_cb(VipsImage *image, Read *read) + { +- if( read->source ) +- vips_source_minimise( read->source ); ++ if (read->source) ++ vips_source_minimise(read->source); + } + + static void +-vips_png_read_source( png_structp pPng, png_bytep data, png_size_t length ) ++vips_png_read_source(png_structp pPng, png_bytep data, png_size_t length) + { +- Read *read = png_get_io_ptr( pPng ); ++ Read *read = png_get_io_ptr(pPng); + + #ifdef DEBUG +- printf( "vips_png_read_source: read %zd bytes\n", length ); ++ printf("vips_png_read_source: read %zd bytes\n", length); + #endif /*DEBUG*/ + + /* libpng makes many small reads, which hurts performance if you do a + * syscall for each one. Read via our own buffer. + */ +- while( length > 0 ) { ++ while (length > 0) { + gint64 bytes_available; + +- if( read->bytes_in_buffer <= 0 ) { ++ if (read->bytes_in_buffer <= 0) { + gint64 bytes_read; + +- bytes_read = vips_source_read( read->source, +- read->input_buffer, INPUT_BUFFER_SIZE ); +- if( bytes_read <= 0 ) +- png_error( pPng, "not enough data" ); ++ bytes_read = vips_source_read(read->source, ++ read->input_buffer, INPUT_BUFFER_SIZE); ++ if (bytes_read <= 0) ++ png_error(pPng, "not enough data"); + + read->next_byte = read->input_buffer; + read->bytes_in_buffer = bytes_read; + } + +- bytes_available = VIPS_MIN( read->bytes_in_buffer, length ); +- memcpy( data, read->next_byte, bytes_available ); ++ bytes_available = VIPS_MIN(read->bytes_in_buffer, length); ++ memcpy(data, read->next_byte, bytes_available); + data += bytes_available; + length -= bytes_available; + read->next_byte += bytes_available; +@@ -265,13 +265,13 @@ vips_png_read_source( png_structp pPng, png_bytep data, png_size_t length ) + } + + static Read * +-read_new( VipsSource *source, VipsImage *out, +- VipsFailOn fail_on, gboolean unlimited ) ++read_new(VipsSource *source, VipsImage *out, ++ VipsFailOn fail_on, gboolean unlimited) + { + Read *read; + +- if( !(read = VIPS_NEW( out, Read )) ) +- return( NULL ); ++ if (!(read = VIPS_NEW(out, Read))) ++ return (NULL); + + read->name = NULL; + read->fail_on = fail_on; +@@ -283,114 +283,114 @@ read_new( VipsSource *source, VipsImage *out, + read->source = source; + read->unlimited = unlimited; + +- g_object_ref( source ); ++ g_object_ref(source); + +- g_signal_connect( out, "close", +- G_CALLBACK( read_close_cb ), read ); +- g_signal_connect( out, "minimise", +- G_CALLBACK( read_minimise_cb ), read ); ++ g_signal_connect(out, "close", ++ G_CALLBACK(read_close_cb), read); ++ g_signal_connect(out, "minimise", ++ G_CALLBACK(read_minimise_cb), read); + +- if( !(read->pPng = png_create_read_struct( +- PNG_LIBPNG_VER_STRING, NULL, +- user_error_function, user_warning_function )) ) +- return( NULL ); ++ if (!(read->pPng = png_create_read_struct( ++ PNG_LIBPNG_VER_STRING, NULL, ++ user_error_function, user_warning_function))) ++ return (NULL); + +- /* Prevent libpng (>=1.6.11) verifying sRGB profiles. Many PNGs have +- * broken profiles, but we still want to be able to open them. +- */ ++ /* Prevent libpng (>=1.6.11) verifying sRGB profiles. Many PNGs have ++ * broken profiles, but we still want to be able to open them. ++ */ + #ifdef PNG_SKIP_sRGB_CHECK_PROFILE +- png_set_option( read->pPng, +- PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON ); ++ png_set_option(read->pPng, ++ PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON); + #endif /*PNG_SKIP_sRGB_CHECK_PROFILE*/ + + /* Don't verify ADLER32 checksums (this can produce a lot of + * warnings). + */ + #ifdef PNG_IGNORE_ADLER32 +- png_set_option( read->pPng, PNG_IGNORE_ADLER32, PNG_OPTION_ON ); ++ png_set_option(read->pPng, PNG_IGNORE_ADLER32, PNG_OPTION_ON); + #endif /*PNG_IGNORE_ADLER32*/ + + /* Disable CRC checking in fuzzing mode. Most fuzzed images will have + * bad CRCs so this check would break fuzzing. + */ + #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION +- png_set_crc_action( read->pPng, +- PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE ); ++ png_set_crc_action(read->pPng, ++ PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE); + #endif /*FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION*/ + + /* libpng has a default soft limit of 1m pixels per axis. + */ +- png_set_user_limits( read->pPng, VIPS_MAX_COORD, VIPS_MAX_COORD ); ++ png_set_user_limits(read->pPng, VIPS_MAX_COORD, VIPS_MAX_COORD); + +- if( vips_source_rewind( source ) ) +- return( NULL ); +- png_set_read_fn( read->pPng, read, vips_png_read_source ); ++ if (vips_source_rewind(source)) ++ return (NULL); ++ png_set_read_fn(read->pPng, read, vips_png_read_source); + + /* Catch PNG errors from png_read_info() etc. + */ +- if( setjmp( png_jmpbuf( read->pPng ) ) ) +- return( NULL ); ++ if (setjmp(png_jmpbuf(read->pPng))) ++ return (NULL); + +- if( !(read->pInfo = png_create_info_struct( read->pPng )) ) +- return( NULL ); ++ if (!(read->pInfo = png_create_info_struct(read->pPng))) ++ return (NULL); + + #ifdef HAVE_PNG_SET_CHUNK_MALLOC_MAX + +- /* By default, libpng refuses to open files with a metadata chunk ++ /* By default, libpng refuses to open files with a metadata chunk + * larger than 8mb. We've seen real files with 20mb, so set 50mb. + */ +- png_set_chunk_malloc_max( read->pPng, 50 * 1024 * 1024 ); ++ png_set_chunk_malloc_max(read->pPng, 50 * 1024 * 1024); + + /* This limits the number of chunks. The limit from +- * png_set_chunk_malloc_max() times this value is the maximum ++ * png_set_chunk_malloc_max() times this value is the maximum + * memory use. + * + * libnpng defaults to 1000, which is rather high. + */ +- png_set_chunk_cache_max( read->pPng, 100 ); ++ png_set_chunk_cache_max(read->pPng, 100); + + #endif /*HAVE_PNG_SET_CHUNK_MALLOC_MAX*/ + +- png_read_info( read->pPng, read->pInfo ); ++ png_read_info(read->pPng, read->pInfo); + +- return( read ); ++ return (read); + } + + /* Set the png text data as metadata on the vips image. These are always + * null-terminated strings. + */ + static int +-vips__set_text( VipsImage *out, int i, const char *key, const char *text ) ++vips__set_text(VipsImage *out, int i, const char *key, const char *text) + { + char name[256]; + +- if( strcmp( key, "XML:com.adobe.xmp" ) == 0 ) { ++ if (strcmp(key, "XML:com.adobe.xmp") == 0) { + /* Save as an XMP tag. This must be a BLOB, for compatibility + * for things like the XMP blob that the tiff loader adds. + * + * Note that this will remove the null-termination from the + * string. We must carefully reattach this. + */ +- vips_image_set_blob_copy( out, +- VIPS_META_XMP_NAME, text, strlen( text ) ); ++ vips_image_set_blob_copy(out, ++ VIPS_META_XMP_NAME, text, strlen(text)); + } +- else { ++ else { + /* Save as a string comment. Some PNGs have EXIF data as + * text segments, but the correct way to support this is with + * png_get_eXIf_1(). + */ +- vips_snprintf( name, 256, "png-comment-%d-%s", i, key ); ++ vips_snprintf(name, 256, "png-comment-%d-%s", i, key); + +- vips_image_set_string( out, name, text ); ++ vips_image_set_string(out, name, text); + } + +- return( 0 ); ++ return (0); + } + + /* Read a png header. + */ + static int +-png2vips_header( Read *read, VipsImage *out ) ++png2vips_header(Read *read, VipsImage *out) + { + png_uint_32 width, height; + int bitdepth, color_type; +@@ -403,7 +403,7 @@ png2vips_header( Read *read, VipsImage *out ) + int compression_type; + + png_textp text_ptr; +- int num_text; ++ int num_text; + + /* Well thank you, libpng. + */ +@@ -415,50 +415,50 @@ png2vips_header( Read *read, VipsImage *out ) + + png_uint_32 proflen; + +- int bands; ++ int bands; + VipsInterpretation interpretation; + double Xres, Yres; + +- if( setjmp( png_jmpbuf( read->pPng ) ) ) +- return( -1 ); ++ if (setjmp(png_jmpbuf(read->pPng))) ++ return (-1); + +- png_get_IHDR( read->pPng, read->pInfo, ++ png_get_IHDR(read->pPng, read->pInfo, + &width, &height, &bitdepth, &color_type, +- &interlace_type, NULL, NULL ); ++ &interlace_type, NULL, NULL); + + /* png_get_channels() gives us 1 band for palette images ... so look + * at colour_type for output bands. + * + * Ignore alpha, we detect that separately below. + */ +- switch( color_type ) { +- case PNG_COLOR_TYPE_PALETTE: +- bands = 3; ++ switch (color_type) { ++ case PNG_COLOR_TYPE_PALETTE: ++ bands = 3; + break; + +- case PNG_COLOR_TYPE_GRAY_ALPHA: +- case PNG_COLOR_TYPE_GRAY: +- bands = 1; ++ case PNG_COLOR_TYPE_GRAY_ALPHA: ++ case PNG_COLOR_TYPE_GRAY: ++ bands = 1; + break; + +- case PNG_COLOR_TYPE_RGB: +- case PNG_COLOR_TYPE_RGB_ALPHA: +- bands = 3; ++ case PNG_COLOR_TYPE_RGB: ++ case PNG_COLOR_TYPE_RGB_ALPHA: ++ bands = 3; + break; + + default: +- vips_error( "png2vips", "%s", _( "unsupported color type" ) ); +- return( -1 ); ++ vips_error("png2vips", "%s", _("unsupported color type")); ++ return (-1); + } + +- if( bitdepth > 8 ) { +- if( bands < 3 ) ++ if (bitdepth > 8) { ++ if (bands < 3) + interpretation = VIPS_INTERPRETATION_GREY16; + else + interpretation = VIPS_INTERPRETATION_RGB16; + } + else { +- if( bands < 3 ) ++ if (bands < 3) + interpretation = VIPS_INTERPRETATION_B_W; + else + interpretation = VIPS_INTERPRETATION_sRGB; +@@ -466,17 +466,17 @@ png2vips_header( Read *read, VipsImage *out ) + + /* Expand palette images. + */ +- if( color_type == PNG_COLOR_TYPE_PALETTE ) +- png_set_palette_to_rgb( read->pPng ); ++ if (color_type == PNG_COLOR_TYPE_PALETTE) ++ png_set_palette_to_rgb(read->pPng); + + /* Expand transparency. + */ +- if( png_get_valid( read->pPng, read->pInfo, PNG_INFO_tRNS ) ) { +- png_set_tRNS_to_alpha( read->pPng ); ++ if (png_get_valid(read->pPng, read->pInfo, PNG_INFO_tRNS)) { ++ png_set_tRNS_to_alpha(read->pPng); + bands += 1; + } +- else if( color_type == PNG_COLOR_TYPE_GRAY_ALPHA || +- color_type == PNG_COLOR_TYPE_RGB_ALPHA ) { ++ else if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA || ++ color_type == PNG_COLOR_TYPE_RGB_ALPHA) { + /* Some images have no transparency chunk, but still set + * color_type to alpha. + */ +@@ -485,29 +485,29 @@ png2vips_header( Read *read, VipsImage *out ) + + /* Expand <8 bit images to full bytes. + */ +- if( color_type == PNG_COLOR_TYPE_GRAY && +- bitdepth < 8 ) +- png_set_expand_gray_1_2_4_to_8( read->pPng ); ++ if (color_type == PNG_COLOR_TYPE_GRAY && ++ bitdepth < 8) ++ png_set_expand_gray_1_2_4_to_8(read->pPng); + + /* If we're an INTEL byte order machine and this is 16bits, we need + * to swap bytes. + */ +- if( bitdepth > 8 && +- !vips_amiMSBfirst() ) +- png_set_swap( read->pPng ); ++ if (bitdepth > 8 && ++ !vips_amiMSBfirst()) ++ png_set_swap(read->pPng); + +- /* Get resolution. Default to 72 pixels per inch, the usual png value. ++ /* Get resolution. Default to 72 pixels per inch, the usual png value. + */ + unit_type = PNG_RESOLUTION_METER; + res_x = 72.0 / 2.54 * 100.0; + res_y = 72.0 / 2.54 * 100.0; +- png_get_pHYs( read->pPng, read->pInfo, &res_x, &res_y, &unit_type ); +- switch( unit_type ) { ++ png_get_pHYs(read->pPng, read->pInfo, &res_x, &res_y, &unit_type); ++ switch (unit_type) { + case PNG_RESOLUTION_METER: + Xres = res_x / 1000.0; + Yres = res_y / 1000.0; + break; +- ++ + default: + Xres = res_x; + Yres = res_y; +@@ -516,17 +516,17 @@ png2vips_header( Read *read, VipsImage *out ) + + /* Set VIPS header. + */ +- vips_image_init_fields( out, ++ vips_image_init_fields(out, + width, height, bands, + bitdepth > 8 ? VIPS_FORMAT_USHORT : VIPS_FORMAT_UCHAR, +- VIPS_CODING_NONE, interpretation, +- Xres, Yres ); ++ VIPS_CODING_NONE, interpretation, ++ Xres, Yres); + +- VIPS_SETSTR( out->filename, +- vips_connection_filename( VIPS_CONNECTION( read->source ) ) ); ++ VIPS_SETSTR(out->filename, ++ vips_connection_filename(VIPS_CONNECTION(read->source))); + +- if( vips_image_pipelinev( out, VIPS_DEMAND_STYLE_THINSTRIP, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(out, VIPS_DEMAND_STYLE_THINSTRIP, NULL)) ++ return (-1); + + /* Fetch the ICC profile. @name is useless, something like "icc" or + * "ICC Profile" etc. Ignore it. +@@ -534,16 +534,16 @@ png2vips_header( Read *read, VipsImage *out ) + * @profile was png_charpp in libpngs < 1.5, png_bytepp is the + * modern one. Ignore the warning, if any. + */ +- if( png_get_iCCP( read->pPng, read->pInfo, +- &name, &compression_type, &profile, &proflen ) ) { ++ if (png_get_iCCP(read->pPng, read->pInfo, ++ &name, &compression_type, &profile, &proflen)) { + #ifdef DEBUG +- printf( "png2vips_header: attaching %d bytes of ICC profile\n", +- proflen ); +- printf( "png2vips_header: name = \"%s\"\n", name ); ++ printf("png2vips_header: attaching %d bytes of ICC profile\n", ++ proflen); ++ printf("png2vips_header: name = \"%s\"\n", name); + #endif /*DEBUG*/ + +- vips_image_set_blob_copy( out, +- VIPS_META_ICC_NAME, profile, proflen ); ++ vips_image_set_blob_copy(out, ++ VIPS_META_ICC_NAME, profile, proflen); + } + + /* Some libpng warn you to call png_set_interlace_handling(); here, but +@@ -552,290 +552,290 @@ png2vips_header( Read *read, VipsImage *out ) + * Only set this for libpng 1.6+. + */ + #if PNG_LIBPNG_VER > 10600 +- (void) png_set_interlace_handling( read->pPng ); ++ (void) png_set_interlace_handling(read->pPng); + #endif + + /* Sanity-check line size. + */ +- png_read_update_info( read->pPng, read->pInfo ); +- if( png_get_rowbytes( read->pPng, read->pInfo ) != +- VIPS_IMAGE_SIZEOF_LINE( out ) ) { +- vips_error( "vipspng", +- "%s", _( "unable to read PNG header" ) ); +- return( -1 ); ++ png_read_update_info(read->pPng, read->pInfo); ++ if (png_get_rowbytes(read->pPng, read->pInfo) != ++ VIPS_IMAGE_SIZEOF_LINE(out)) { ++ vips_error("vipspng", ++ "%s", _("unable to read PNG header")); ++ return (-1); + } + + /* Let our caller know. These are very expensive to decode. + */ +- if( interlace_type != PNG_INTERLACE_NONE ) +- vips_image_set_int( out, "interlaced", 1 ); ++ if (interlace_type != PNG_INTERLACE_NONE) ++ vips_image_set_int(out, "interlaced", 1); + +- if( png_get_text( read->pPng, read->pInfo, +- &text_ptr, &num_text ) > 0 ) { ++ if (png_get_text(read->pPng, read->pInfo, ++ &text_ptr, &num_text) > 0) { + int i; + + /* Very large numbers of text chunks are used in DoS + * attacks. + */ +- if( !read->unlimited && +- num_text > MAX_PNG_TEXT_CHUNKS ) { +- g_warning(_( "%d text chunks, only %d text chunks will be loaded" ), +- num_text, MAX_PNG_TEXT_CHUNKS ); ++ if (!read->unlimited && ++ num_text > MAX_PNG_TEXT_CHUNKS) { ++ g_warning(_("%d text chunks, only %d text chunks will be loaded"), ++ num_text, MAX_PNG_TEXT_CHUNKS); + num_text = MAX_PNG_TEXT_CHUNKS; + } + +- for( i = 0; i < num_text; i++ ) ++ for (i = 0; i < num_text; i++) + /* .text is always a null-terminated C string. + */ +- if( vips__set_text( out, i, +- text_ptr[i].key, text_ptr[i].text ) ) +- return( -1 ); ++ if (vips__set_text(out, i, ++ text_ptr[i].key, text_ptr[i].text)) ++ return (-1); + } + + /* Attach original palette bit depth, if any, as metadata. + */ +- if( color_type == PNG_COLOR_TYPE_PALETTE ) +- vips_image_set_int( out, "palette-bit-depth", bitdepth ); ++ if (color_type == PNG_COLOR_TYPE_PALETTE) ++ vips_image_set_int(out, "palette-bit-depth", bitdepth); + +- /* Note the PNG background colour, if any. +- */ ++ /* Note the PNG background colour, if any. ++ */ + #ifdef PNG_bKGD_SUPPORTED +-{ +- png_color_16 *background; +- +- if( png_get_bKGD( read->pPng, read->pInfo, &background ) ) { +- const int scale = out->BandFmt == VIPS_FORMAT_UCHAR ? 1 : 256; +- +- double array[3]; +- int n; +- +- switch( color_type ) { +- case PNG_COLOR_TYPE_GRAY: +- case PNG_COLOR_TYPE_GRAY_ALPHA: +- array[0] = background->gray / scale; +- n = 1; +- break; +- +- case PNG_COLOR_TYPE_RGB: +- case PNG_COLOR_TYPE_RGB_ALPHA: +- array[0] = background->red / scale; +- array[1] = background->green / scale; +- array[2] = background->blue / scale; +- n = 3; +- break; +- +- case PNG_COLOR_TYPE_PALETTE: +- default: +- /* Not sure what to do here. I suppose we should read +- * the palette. +- */ +- n = 0; +- break; +- } ++ { ++ png_color_16 *background; ++ ++ if (png_get_bKGD(read->pPng, read->pInfo, &background)) { ++ const int scale = out->BandFmt == VIPS_FORMAT_UCHAR ? 1 : 256; ++ ++ double array[3]; ++ int n; ++ ++ switch (color_type) { ++ case PNG_COLOR_TYPE_GRAY: ++ case PNG_COLOR_TYPE_GRAY_ALPHA: ++ array[0] = background->gray / scale; ++ n = 1; ++ break; ++ ++ case PNG_COLOR_TYPE_RGB: ++ case PNG_COLOR_TYPE_RGB_ALPHA: ++ array[0] = background->red / scale; ++ array[1] = background->green / scale; ++ array[2] = background->blue / scale; ++ n = 3; ++ break; ++ ++ case PNG_COLOR_TYPE_PALETTE: ++ default: ++ /* Not sure what to do here. I suppose we should read ++ * the palette. ++ */ ++ n = 0; ++ break; ++ } + +- if( n > 0 ) +- vips_image_set_array_double( out, "background", +- array, n ); ++ if (n > 0) ++ vips_image_set_array_double(out, "background", ++ array, n); ++ } + } +-} + #endif /*PNG_bKGD_SUPPORTED*/ + + #ifdef PNG_eXIf_SUPPORTED +-{ +- png_uint_32 num_exif; +- png_bytep exif; ++ { ++ png_uint_32 num_exif; ++ png_bytep exif; + +- if( png_get_eXIf_1( read->pPng, read->pInfo, &num_exif, &exif ) ) +- vips_image_set_blob_copy( out, VIPS_META_EXIF_NAME, +- exif, num_exif ); +-} ++ if (png_get_eXIf_1(read->pPng, read->pInfo, &num_exif, &exif)) ++ vips_image_set_blob_copy(out, VIPS_META_EXIF_NAME, ++ exif, num_exif); ++ } + #endif /*PNG_eXIf_SUPPORTED*/ + +- return( 0 ); ++ return (0); + } + + /* Out is a huge "t" buffer we decompress to. + */ + static int +-png2vips_interlace( Read *read, VipsImage *out ) ++png2vips_interlace(Read *read, VipsImage *out) + { + int y; + + #ifdef DEBUG +- printf( "png2vips_interlace: reading whole image\n" ); ++ printf("png2vips_interlace: reading whole image\n"); + #endif /*DEBUG*/ + +- if( vips_image_write_prepare( out ) ) +- return( -1 ); ++ if (vips_image_write_prepare(out)) ++ return (-1); + +- if( setjmp( png_jmpbuf( read->pPng ) ) ) +- return( -1 ); ++ if (setjmp(png_jmpbuf(read->pPng))) ++ return (-1); + +- if( !(read->row_pointer = VIPS_ARRAY( NULL, out->Ysize, png_bytep )) ) +- return( -1 ); +- for( y = 0; y < out->Ysize; y++ ) +- read->row_pointer[y] = VIPS_IMAGE_ADDR( out, 0, y ); ++ if (!(read->row_pointer = VIPS_ARRAY(NULL, out->Ysize, png_bytep))) ++ return (-1); ++ for (y = 0; y < out->Ysize; y++) ++ read->row_pointer[y] = VIPS_IMAGE_ADDR(out, 0, y); + +- png_read_image( read->pPng, read->row_pointer ); ++ png_read_image(read->pPng, read->row_pointer); + +- read_destroy( read ); ++ read_destroy(read); + +- return( 0 ); ++ return (0); + } + + static int +-png2vips_generate( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++png2vips_generate(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + Read *read = (Read *) a; + + int y; + + #ifdef DEBUG +- printf( "png2vips_generate: line %d, %d rows\n", r->top, r->height ); +- printf( "png2vips_generate: y_top = %d\n", read->y_pos ); ++ printf("png2vips_generate: line %d, %d rows\n", r->top, r->height); ++ printf("png2vips_generate: y_top = %d\n", read->y_pos); + #endif /*DEBUG*/ + + /* We're inside a tilecache where tiles are the full image width, so + * this should always be true. + */ +- g_assert( r->left == 0 ); +- g_assert( r->width == or->im->Xsize ); +- g_assert( VIPS_RECT_BOTTOM( r ) <= or->im->Ysize ); ++ g_assert(r->left == 0); ++ g_assert(r->width == or->im->Xsize); ++ g_assert(VIPS_RECT_BOTTOM(r) <= or->im->Ysize); + + /* Tiles should always be a strip in height, unless it's the final + * strip. + */ +- g_assert( r->height == VIPS_MIN( VIPS__FATSTRIP_HEIGHT, +- or->im->Ysize - r->top ) ); ++ g_assert(r->height == VIPS_MIN(VIPS__FATSTRIP_HEIGHT, or->im->Ysize - r->top)); + + /* And check that y_pos is correct. It should be, since we are inside + * a vips_sequential(). + */ +- if( r->top != read->y_pos ) { +- vips_error( "vipspng", +- _( "out of order read at line %d" ), read->y_pos ); +- return( -1 ); ++ if (r->top != read->y_pos) { ++ vips_error("vipspng", ++ _("out of order read at line %d"), read->y_pos); ++ return (-1); + } + +- for( y = 0; y < r->height; y++ ) { +- png_bytep q = (png_bytep) VIPS_REGION_ADDR( or, 0, r->top + y ); ++ for (y = 0; y < r->height; y++) { ++ png_bytep q = (png_bytep) VIPS_REGION_ADDR(or, 0, r->top + y); + + /* We need to catch errors from read_row(). + */ +- if( !setjmp( png_jmpbuf( read->pPng ) ) ) +- png_read_row( read->pPng, q, NULL ); +- else { +- /* We've failed to read some pixels. Knock this +- * operation out of cache. ++ if (!setjmp(png_jmpbuf(read->pPng))) ++ png_read_row(read->pPng, q, NULL); ++ else { ++ /* We've failed to read some pixels. Knock this ++ * operation out of cache. + */ +- vips_foreign_load_invalidate( read->out ); ++ vips_foreign_load_invalidate(read->out); + + #ifdef DEBUG +- printf( "png2vips_generate: png_read_row() failed, " +- "line %d\n", r->top + y ); +- printf( "png2vips_generate: file %s\n", read->name ); +- printf( "png2vips_generate: thread %p\n", +- g_thread_self() ); ++ printf("png2vips_generate: png_read_row() failed, " ++ "line %d\n", ++ r->top + y); ++ printf("png2vips_generate: file %s\n", read->name); ++ printf("png2vips_generate: thread %p\n", ++ g_thread_self()); + #endif /*DEBUG*/ + + /* And bail if fail is on. We have to add an error + * message, since the handler we install just does + * g_warning(). + */ +- if( read->fail_on >= VIPS_FAIL_ON_TRUNCATED ) { +- vips_error( "vipspng", +- "%s", _( "libpng read error" ) ); +- return( -1 ); ++ if (read->fail_on >= VIPS_FAIL_ON_TRUNCATED) { ++ vips_error("vipspng", ++ "%s", _("libpng read error")); ++ return (-1); + } + } + + read->y_pos += 1; + } + +- return( 0 ); ++ return (0); + } + + static int +-png2vips_image( Read *read, VipsImage *out ) ++png2vips_image(Read *read, VipsImage *out) + { +- int interlace_type = png_get_interlace_type( read->pPng, read->pInfo ); +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 3 ); ++ int interlace_type = png_get_interlace_type(read->pPng, read->pInfo); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(out), 3); + +- if( interlace_type != PNG_INTERLACE_NONE ) { +- /* Arg awful interlaced image. We have to load to a huge mem ++ if (interlace_type != PNG_INTERLACE_NONE) { ++ /* Arg awful interlaced image. We have to load to a huge mem + * buffer, then copy to out. + */ + t[0] = vips_image_new_memory(); +- if( png2vips_header( read, t[0] ) || +- png2vips_interlace( read, t[0] ) || +- vips_image_write( t[0], out ) ) +- return( -1 ); ++ if (png2vips_header(read, t[0]) || ++ png2vips_interlace(read, t[0]) || ++ vips_image_write(t[0], out)) ++ return (-1); + } + else { + t[0] = vips_image_new(); +- if( png2vips_header( read, t[0] ) || +- vips_image_generate( t[0], +- NULL, png2vips_generate, NULL, +- read, NULL ) || +- vips_sequential( t[0], &t[1], +- "tile_height", VIPS__FATSTRIP_HEIGHT, +- NULL ) || +- vips_image_write( t[1], out ) ) +- return( -1 ); ++ if (png2vips_header(read, t[0]) || ++ vips_image_generate(t[0], ++ NULL, png2vips_generate, NULL, ++ read, NULL) || ++ vips_sequential(t[0], &t[1], ++ "tile_height", VIPS__FATSTRIP_HEIGHT, ++ NULL) || ++ vips_image_write(t[1], out)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + gboolean +-vips__png_ispng_source( VipsSource *source ) ++vips__png_ispng_source(VipsSource *source) + { + const unsigned char *p; + +- if( (p = vips_source_sniff( source, 8 )) && +- !png_sig_cmp( (png_bytep) p, 0, 8 ) ) +- return( TRUE ); ++ if ((p = vips_source_sniff(source, 8)) && ++ !png_sig_cmp((png_bytep) p, 0, 8)) ++ return (TRUE); + +- return( FALSE ); ++ return (FALSE); + } + + int +-vips__png_header_source( VipsSource *source, VipsImage *out, +- gboolean unlimited ) ++vips__png_header_source(VipsSource *source, VipsImage *out, ++ gboolean unlimited) + { + Read *read; + +- if( !(read = read_new( source, out, TRUE, unlimited )) || +- png2vips_header( read, out ) ) +- return( -1 ); ++ if (!(read = read_new(source, out, TRUE, unlimited)) || ++ png2vips_header(read, out)) ++ return (-1); + +- vips_source_minimise( source ); ++ vips_source_minimise(source); + +- return( 0 ); ++ return (0); + } + + int +-vips__png_read_source( VipsSource *source, VipsImage *out, +- VipsFailOn fail_on, gboolean unlimited ) ++vips__png_read_source(VipsSource *source, VipsImage *out, ++ VipsFailOn fail_on, gboolean unlimited) + { + Read *read; + +- if( !(read = read_new( source, out, fail_on, unlimited )) || +- png2vips_image( read, out ) || +- vips_source_decode( source ) ) +- return( -1 ); ++ if (!(read = read_new(source, out, fail_on, unlimited)) || ++ png2vips_image(read, out) || ++ vips_source_decode(source)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Interlaced PNGs need to be entirely decompressed into memory then can be + * served partially from there. Non-interlaced PNGs may be read sequentially. + */ + gboolean +-vips__png_isinterlaced_source( VipsSource *source ) ++vips__png_isinterlaced_source(VipsSource *source) + { + VipsImage *image; + Read *read; +@@ -843,14 +843,14 @@ vips__png_isinterlaced_source( VipsSource *source ) + + image = vips_image_new(); + +- if( !(read = read_new( source, image, TRUE, FALSE )) ) { +- g_object_unref( image ); +- return( -1 ); ++ if (!(read = read_new(source, image, TRUE, FALSE))) { ++ g_object_unref(image); ++ return (-1); + } +- interlace_type = png_get_interlace_type( read->pPng, read->pInfo ); +- g_object_unref( image ); ++ interlace_type = png_get_interlace_type(read->pPng, read->pInfo); ++ g_object_unref(image); + +- return( interlace_type != PNG_INTERLACE_NONE ); ++ return (interlace_type != PNG_INTERLACE_NONE); + } + + /* What we track during a PNG write. +@@ -867,49 +867,49 @@ typedef struct { + } Write; + + static void +-write_destroy( Write *write ) ++write_destroy(Write *write) + { + #ifdef DEBUG +- printf( "write_destroy: %p\n", write ); ++ printf("write_destroy: %p\n", write); + #endif /*DEBUG*/ + +- VIPS_UNREF( write->memory ); +- if( write->pPng ) +- png_destroy_write_struct( &write->pPng, &write->pInfo ); +- VIPS_FREE( write->row_pointer ); +- VIPS_FREE( write ); ++ VIPS_UNREF(write->memory); ++ if (write->pPng) ++ png_destroy_write_struct(&write->pPng, &write->pInfo); ++ VIPS_FREE(write->row_pointer); ++ VIPS_FREE(write); + } + + static void +-user_write_data( png_structp pPng, png_bytep data, png_size_t length ) ++user_write_data(png_structp pPng, png_bytep data, png_size_t length) + { +- Write *write = (Write *) png_get_io_ptr( pPng ); ++ Write *write = (Write *) png_get_io_ptr(pPng); + +- if( vips_target_write( write->target, data, length ) ) +- png_error( pPng, "not enough data" ); ++ if (vips_target_write(write->target, data, length)) ++ png_error(pPng, "not enough data"); + } + + static Write * +-write_new( VipsImage *in, VipsTarget *target ) ++write_new(VipsImage *in, VipsTarget *target) + { + Write *write; + +- if( !(write = VIPS_NEW( NULL, Write )) ) +- return( NULL ); ++ if (!(write = VIPS_NEW(NULL, Write))) ++ return (NULL); + write->in = in; + write->target = target; + + #ifdef DEBUG +- printf( "write_new: %p\n", write ); ++ printf("write_new: %p\n", write); + #endif /*DEBUG*/ + +- if( !(write->row_pointer = VIPS_ARRAY( NULL, in->Ysize, png_bytep )) ) +- return( NULL ); +- if( !(write->pPng = png_create_write_struct( +- PNG_LIBPNG_VER_STRING, NULL, +- user_error_function, user_warning_function )) ) { +- write_destroy( write ); +- return( NULL ); ++ if (!(write->row_pointer = VIPS_ARRAY(NULL, in->Ysize, png_bytep))) ++ return (NULL); ++ if (!(write->pPng = png_create_write_struct( ++ PNG_LIBPNG_VER_STRING, NULL, ++ user_error_function, user_warning_function))) { ++ write_destroy(write); ++ return (NULL); + } + + /* Prevent libpng (>=1.6.11) verifying sRGB profiles. We are often +@@ -917,29 +917,29 @@ write_new( VipsImage *in, VipsTarget *target ) + * prevent that. + */ + #ifdef PNG_SKIP_sRGB_CHECK_PROFILE +- png_set_option( write->pPng, +- PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON ); ++ png_set_option(write->pPng, ++ PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON); + #endif /*PNG_SKIP_sRGB_CHECK_PROFILE*/ + +- png_set_write_fn( write->pPng, write, user_write_data, NULL ); ++ png_set_write_fn(write->pPng, write, user_write_data, NULL); + + /* Catch PNG errors from png_create_info_struct(). + */ +- if( setjmp( png_jmpbuf( write->pPng ) ) ) { +- write_destroy( write ); +- return( NULL ); ++ if (setjmp(png_jmpbuf(write->pPng))) { ++ write_destroy(write); ++ return (NULL); + } + +- if( !(write->pInfo = png_create_info_struct( write->pPng )) ) { +- write_destroy( write ); +- return( NULL ); ++ if (!(write->pInfo = png_create_info_struct(write->pPng))) { ++ write_destroy(write); ++ return (NULL); + } + +- return( write ); ++ return (write); + } + + static int +-write_png_block( VipsRegion *region, VipsRect *area, void *a ) ++write_png_block(VipsRegion *region, VipsRect *area, void *a) + { + Write *write = (Write *) a; + +@@ -947,34 +947,34 @@ write_png_block( VipsRegion *region, VipsRect *area, void *a ) + + /* The area to write is always a set of complete scanlines. + */ +- g_assert( area->left == 0 ); +- g_assert( area->width == region->im->Xsize ); +- g_assert( area->top + area->height <= region->im->Ysize ); ++ g_assert(area->left == 0); ++ g_assert(area->width == region->im->Xsize); ++ g_assert(area->top + area->height <= region->im->Ysize); + +- /* Catch PNG errors. ++ /* Catch PNG errors. + */ +- if( setjmp( png_jmpbuf( write->pPng ) ) ) +- return( -1 ); ++ if (setjmp(png_jmpbuf(write->pPng))) ++ return (-1); + +- for( i = 0; i < area->height; i++ ) ++ for (i = 0; i < area->height; i++) + write->row_pointer[i] = (png_bytep) +- VIPS_REGION_ADDR( region, 0, area->top + i ); ++ VIPS_REGION_ADDR(region, 0, area->top + i); + +- png_write_rows( write->pPng, write->row_pointer, area->height ); ++ png_write_rows(write->pPng, write->row_pointer, area->height); + +- return( 0 ); ++ return (0); + } + + static void +-vips__png_set_text( png_structp pPng, png_infop pInfo, +- const char *key, const char *value ) ++vips__png_set_text(png_structp pPng, png_infop pInfo, ++ const char *key, const char *value) + { + png_text text; + + text.compression = 0; + text.key = (char *) key; + text.text = (char *) value; +- text.text_length = strlen( value ); ++ text.text_length = strlen(value); + + /* Before 1.4, these fields were only there if explicitly enabled. + */ +@@ -983,44 +983,44 @@ vips__png_set_text( png_structp pPng, png_infop pInfo, + text.lang = NULL; + #endif + +- png_set_text( pPng, pInfo, &text, 1 ); ++ png_set_text(pPng, pInfo, &text, 1); + } + + static void * +-write_png_comment( VipsImage *image, +- const char *field, GValue *value, void *data ) ++write_png_comment(VipsImage *image, ++ const char *field, GValue *value, void *data) + { + Write *write = (Write *) data; + +- if( vips_isprefix( "png-comment-", field ) ) { ++ if (vips_isprefix("png-comment-", field)) { + const char *str; + int i; + char key[256]; + +- if( vips_image_get_string( write->in, field, &str ) ) +- return( image ); ++ if (vips_image_get_string(write->in, field, &str)) ++ return (image); + +- if( strlen( field ) > 256 || +- sscanf( field, "png-comment-%d-%80s", &i, key ) != 2 ) { +- vips_error( "vips2png", +- "%s", _( "bad png comment key" ) ); +- return( image ); ++ if (strlen(field) > 256 || ++ sscanf(field, "png-comment-%d-%80s", &i, key) != 2) { ++ vips_error("vips2png", ++ "%s", _("bad png comment key")); ++ return (image); + } + +- vips__png_set_text( write->pPng, write->pInfo, key, str ); ++ vips__png_set_text(write->pPng, write->pInfo, key, str); + } + +- return( NULL ); ++ return (NULL); + } + + /* Write a VIPS image to PNG. + */ + static int +-write_vips( Write *write, ++write_vips(Write *write, + int compress, int interlace, const char *profile, + VipsForeignPngFilter filter, gboolean strip, + gboolean palette, int Q, double dither, +- int bitdepth, int effort ) ++ int bitdepth, int effort) + { + VipsImage *in = write->in; + +@@ -1028,193 +1028,202 @@ write_vips( Write *write, + int interlace_type; + int i, nb_passes; + +- g_assert( in->BandFmt == VIPS_FORMAT_UCHAR || +- in->BandFmt == VIPS_FORMAT_USHORT ); +- g_assert( in->Coding == VIPS_CODING_NONE ); +- g_assert( in->Bands > 0 && in->Bands < 5 ); ++ g_assert(in->BandFmt == VIPS_FORMAT_UCHAR || ++ in->BandFmt == VIPS_FORMAT_USHORT); ++ g_assert(in->Coding == VIPS_CODING_NONE); ++ g_assert(in->Bands > 0 && in->Bands < 5); + + /* Catch PNG errors. + */ +- if( setjmp( png_jmpbuf( write->pPng ) ) ) +- return( -1 ); ++ if (setjmp(png_jmpbuf(write->pPng))) ++ return (-1); + + /* Check input image. If we are writing interlaced, we need to make 7 + * passes over the image. We advertise ourselves as seq, so to ensure +- * we only suck once from upstream, switch to WIO. ++ * we only suck once from upstream, switch to WIO. + */ +- if( interlace ) { +- if( !(write->memory = vips_image_copy_memory( in )) ) +- return( -1 ); ++ if (interlace) { ++ if (!(write->memory = vips_image_copy_memory(in))) ++ return (-1); + in = write->memory; + } + else { +- if( vips_image_pio_input( in ) ) +- return( -1 ); ++ if (vips_image_pio_input(in)) ++ return (-1); + } +- if( compress < 0 || +- compress > 9 ) { +- vips_error( "vips2png", +- "%s", _( "compress should be in [0,9]" ) ); +- return( -1 ); ++ if (compress < 0 || ++ compress > 9) { ++ vips_error("vips2png", ++ "%s", _("compress should be in [0,9]")); ++ return (-1); + } + + /* Set compression parameters. + */ +- png_set_compression_level( write->pPng, compress ); ++ png_set_compression_level(write->pPng, compress); + + /* Set row filter. + */ +- png_set_filter( write->pPng, 0, filter ); ++ png_set_filter(write->pPng, 0, filter); + +- switch( in->Bands ) { +- case 1: color_type = PNG_COLOR_TYPE_GRAY; break; +- case 2: color_type = PNG_COLOR_TYPE_GRAY_ALPHA; break; +- case 3: color_type = PNG_COLOR_TYPE_RGB; break; +- case 4: color_type = PNG_COLOR_TYPE_RGB_ALPHA; break; ++ switch (in->Bands) { ++ case 1: ++ color_type = PNG_COLOR_TYPE_GRAY; ++ break; ++ case 2: ++ color_type = PNG_COLOR_TYPE_GRAY_ALPHA; ++ break; ++ case 3: ++ color_type = PNG_COLOR_TYPE_RGB; ++ break; ++ case 4: ++ color_type = PNG_COLOR_TYPE_RGB_ALPHA; ++ break; + + default: +- vips_error( "vips2png", +- _( "can't save %d band image as png" ), in->Bands ); +- return( -1 ); ++ vips_error("vips2png", ++ _("can't save %d band image as png"), in->Bands); ++ return (-1); + } + + #ifdef HAVE_QUANTIZATION + /* Enable image quantisation to paletted 8bpp PNG if palette is set. + */ +- if( palette ) ++ if (palette) + color_type = PNG_COLOR_TYPE_PALETTE; + #else +- if( palette ) +- g_warning( "%s", +- _( "ignoring palette (no quantisation support)" ) ); ++ if (palette) ++ g_warning("%s", ++ _("ignoring palette (no quantisation support)")); + #endif /*HAVE_QUANTIZATION*/ + + interlace_type = interlace ? PNG_INTERLACE_ADAM7 : PNG_INTERLACE_NONE; + + /* libpng has a default soft limit of 1m pixels per axis. + */ +- png_set_user_limits( write->pPng, VIPS_MAX_COORD, VIPS_MAX_COORD ); ++ png_set_user_limits(write->pPng, VIPS_MAX_COORD, VIPS_MAX_COORD); + +- png_set_IHDR( write->pPng, write->pInfo, +- in->Xsize, in->Ysize, bitdepth, color_type, interlace_type, +- PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT ); ++ png_set_IHDR(write->pPng, write->pInfo, ++ in->Xsize, in->Ysize, bitdepth, color_type, interlace_type, ++ PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); + + /* Set resolution. libpng uses pixels per meter. + */ +- png_set_pHYs( write->pPng, write->pInfo, +- VIPS_RINT( in->Xres * 1000 ), VIPS_RINT( in->Yres * 1000 ), +- PNG_RESOLUTION_METER ); ++ png_set_pHYs(write->pPng, write->pInfo, ++ VIPS_RINT(in->Xres * 1000), VIPS_RINT(in->Yres * 1000), ++ PNG_RESOLUTION_METER); + + /* Metadata + */ +- if( !strip ) { +- if( profile ) { ++ if (!strip) { ++ if (profile) { + VipsBlob *blob; + +- if( vips_profile_load( profile, &blob, NULL ) ) +- return( -1 ); +- if( blob ) { ++ if (vips_profile_load(profile, &blob, NULL)) ++ return (-1); ++ if (blob) { + size_t length; +- const void *data +- = vips_blob_get( blob, &length ); ++ const void *data = vips_blob_get(blob, &length); + + #ifdef DEBUG +- printf( "write_vips: attaching %zd bytes " +- "of ICC profile\n", length ); ++ printf("write_vips: attaching %zd bytes " ++ "of ICC profile\n", ++ length); + #endif /*DEBUG*/ + +- png_set_iCCP( write->pPng, write->pInfo, +- "icc", PNG_COMPRESSION_TYPE_BASE, +- (void *) data, length ); ++ png_set_iCCP(write->pPng, write->pInfo, ++ "icc", PNG_COMPRESSION_TYPE_BASE, ++ (void *) data, length); + +- vips_area_unref( (VipsArea *) blob ); ++ vips_area_unref((VipsArea *) blob); + } + } +- else if( vips_image_get_typeof( in, VIPS_META_ICC_NAME ) ) { ++ else if (vips_image_get_typeof(in, VIPS_META_ICC_NAME)) { + const void *data; + size_t length; + +- if( vips_image_get_blob( in, VIPS_META_ICC_NAME, +- &data, &length ) ) +- return( -1 ); ++ if (vips_image_get_blob(in, VIPS_META_ICC_NAME, ++ &data, &length)) ++ return (-1); + + #ifdef DEBUG +- printf( "write_vips: attaching %zd bytes " +- "of ICC profile\n", length ); ++ printf("write_vips: attaching %zd bytes " ++ "of ICC profile\n", ++ length); + #endif /*DEBUG*/ + + /* We need to ignore any errors from png_set_iCCP() + * since we want to drop incompatible profiles rather + * than simply failing. + */ +- if( setjmp( png_jmpbuf( write->pPng ) ) ) { ++ if (setjmp(png_jmpbuf(write->pPng))) { + /* Silent ignore of error. + */ +- g_warning( "bad ICC profile not saved" ); ++ g_warning("bad ICC profile not saved"); + } + else { + /* This will jump back to the line above on + * error. + */ +- png_set_iCCP( write->pPng, write->pInfo, "icc", +- PNG_COMPRESSION_TYPE_BASE, +- (void *) data, length ); ++ png_set_iCCP(write->pPng, write->pInfo, "icc", ++ PNG_COMPRESSION_TYPE_BASE, ++ (void *) data, length); + } + + /* And restore the setjmp. + */ +- if( setjmp( png_jmpbuf( write->pPng ) ) ) +- return( -1 ); ++ if (setjmp(png_jmpbuf(write->pPng))) ++ return (-1); + } + +- if( vips_image_get_typeof( in, VIPS_META_XMP_NAME ) ) { ++ if (vips_image_get_typeof(in, VIPS_META_XMP_NAME)) { + const void *data; + size_t length; + char *str; + +- /* XMP is attached as a BLOB with no null-termination. ++ /* XMP is attached as a BLOB with no null-termination. + * We must re-add this. + */ +- if( vips_image_get_blob( in, +- VIPS_META_XMP_NAME, &data, &length ) ) +- return( -1 ); +- +- str = g_malloc( length + 1 ); +- vips_strncpy( str, data, length + 1 ); +- vips__png_set_text( write->pPng, write->pInfo, +- "XML:com.adobe.xmp", str ); +- g_free( str ); ++ if (vips_image_get_blob(in, ++ VIPS_META_XMP_NAME, &data, &length)) ++ return (-1); ++ ++ str = g_malloc(length + 1); ++ vips_strncpy(str, data, length + 1); ++ vips__png_set_text(write->pPng, write->pInfo, ++ "XML:com.adobe.xmp", str); ++ g_free(str); + } + + #ifdef PNG_eXIf_SUPPORTED +- if( vips_image_get_typeof( in, VIPS_META_EXIF_NAME ) ) { ++ if (vips_image_get_typeof(in, VIPS_META_EXIF_NAME)) { + const void *data; + size_t length; + +- if( vips__exif_update( in ) || +- vips_image_get_blob( in, VIPS_META_EXIF_NAME, +- &data, &length ) ) +- return( -1 ); ++ if (vips__exif_update(in) || ++ vips_image_get_blob(in, VIPS_META_EXIF_NAME, ++ &data, &length)) ++ return (-1); + + /* libpng does not want the JFIF "Exif\0\0" prefix. + */ +- if( length >= 6 && +- vips_isprefix( "Exif", (char *) data ) ) { ++ if (length >= 6 && ++ vips_isprefix("Exif", (char *) data)) { + data += 6; + length -= 6; + } + +- png_set_eXIf_1( write->pPng, write->pInfo, +- length, (png_bytep) data ); ++ png_set_eXIf_1(write->pPng, write->pInfo, ++ length, (png_bytep) data); + } + #endif /*PNG_eXIf_SUPPORTED*/ + +- if( vips_image_map( in, write_png_comment, write ) ) +- return( -1 ); ++ if (vips_image_map(in, write_png_comment, write)) ++ return (-1); + } + + #ifdef HAVE_QUANTIZATION +- if( palette ) { ++ if (palette) { + VipsImage *im_index; + VipsImage *im_palette; + int palette_count; +@@ -1222,123 +1231,123 @@ write_vips( Write *write, + png_byte *png_trans; + int trans_count; + +- if( vips__quantise_image( in, &im_index, &im_palette, +- 1 << bitdepth, Q, dither, effort, FALSE ) ) +- return( -1 ); ++ if (vips__quantise_image(in, &im_index, &im_palette, ++ 1 << bitdepth, Q, dither, effort, FALSE)) ++ return (-1); + + palette_count = im_palette->Xsize; + +- g_assert( palette_count <= PNG_MAX_PALETTE_LENGTH ); ++ g_assert(palette_count <= PNG_MAX_PALETTE_LENGTH); + +- png_palette = (png_color *) png_malloc( write->pPng, +- palette_count * sizeof( png_color ) ); +- png_trans = (png_byte *) png_malloc( write->pPng, +- palette_count * sizeof( png_byte ) ); ++ png_palette = (png_color *) png_malloc(write->pPng, ++ palette_count * sizeof(png_color)); ++ png_trans = (png_byte *) png_malloc(write->pPng, ++ palette_count * sizeof(png_byte)); + trans_count = 0; +- for( i = 0; i < palette_count; i++ ) { +- VipsPel *p = (VipsPel *) +- VIPS_IMAGE_ADDR( im_palette, i, 0 ); ++ for (i = 0; i < palette_count; i++) { ++ VipsPel *p = (VipsPel *) ++ VIPS_IMAGE_ADDR(im_palette, i, 0); + png_color *col = &png_palette[i]; + + col->red = p[0]; + col->green = p[1]; + col->blue = p[2]; + png_trans[i] = p[3]; +- if( p[3] != 255 ) ++ if (p[3] != 255) + trans_count = i + 1; + #ifdef DEBUG +- printf( "write_vips: palette[%d] %d %d %d %d\n", +- i + 1, p[0], p[1], p[2], p[3] ); ++ printf("write_vips: palette[%d] %d %d %d %d\n", ++ i + 1, p[0], p[1], p[2], p[3]); + #endif /*DEBUG*/ + } + + #ifdef DEBUG +- printf( "write_vips: attaching %d color palette\n", +- palette_count ); ++ printf("write_vips: attaching %d color palette\n", ++ palette_count); + #endif /*DEBUG*/ +- png_set_PLTE( write->pPng, write->pInfo, png_palette, +- palette_count ); +- if( trans_count ) { ++ png_set_PLTE(write->pPng, write->pInfo, png_palette, ++ palette_count); ++ if (trans_count) { + #ifdef DEBUG +- printf( "write_vips: attaching %d alpha values\n", +- trans_count ); ++ printf("write_vips: attaching %d alpha values\n", ++ trans_count); + #endif /*DEBUG*/ +- png_set_tRNS( write->pPng, write->pInfo, png_trans, +- trans_count, NULL ); ++ png_set_tRNS(write->pPng, write->pInfo, png_trans, ++ trans_count, NULL); + } + +- png_free( write->pPng, (void *) png_palette ); +- png_free( write->pPng, (void *) png_trans ); ++ png_free(write->pPng, (void *) png_palette); ++ png_free(write->pPng, (void *) png_trans); + +- VIPS_UNREF( im_palette ); ++ VIPS_UNREF(im_palette); + +- VIPS_UNREF( write->memory ); ++ VIPS_UNREF(write->memory); + write->memory = im_index; + in = write->memory; + } + #endif /*HAVE_QUANTIZATION*/ + +- png_write_info( write->pPng, write->pInfo ); ++ png_write_info(write->pPng, write->pInfo); + + /* If we're an intel byte order CPU and this is a 16bit image, we need + * to swap bytes. + */ +- if( bitdepth > 8 && +- !vips_amiMSBfirst() ) +- png_set_swap( write->pPng ); ++ if (bitdepth > 8 && ++ !vips_amiMSBfirst()) ++ png_set_swap(write->pPng); + + /* If bitdepth is 1/2/4, pack pixels into bytes. + */ +- png_set_packing( write->pPng ); ++ png_set_packing(write->pPng); + +- if( interlace ) +- nb_passes = png_set_interlace_handling( write->pPng ); ++ if (interlace) ++ nb_passes = png_set_interlace_handling(write->pPng); + else + nb_passes = 1; + + /* Write data. + */ +- for( i = 0; i < nb_passes; i++ ) +- if( vips_sink_disc( in, write_png_block, write ) ) +- return( -1 ); ++ for (i = 0; i < nb_passes; i++) ++ if (vips_sink_disc(in, write_png_block, write)) ++ return (-1); + + /* The setjmp() was held by our background writer: reset it. + */ +- if( setjmp( png_jmpbuf( write->pPng ) ) ) +- return( -1 ); ++ if (setjmp(png_jmpbuf(write->pPng))) ++ return (-1); + +- png_write_end( write->pPng, write->pInfo ); ++ png_write_end(write->pPng, write->pInfo); + +- return( 0 ); ++ return (0); + } + + int +-vips__png_write_target( VipsImage *in, VipsTarget *target, ++vips__png_write_target(VipsImage *in, VipsTarget *target, + int compression, int interlace, + const char *profile, VipsForeignPngFilter filter, gboolean strip, + gboolean palette, int Q, double dither, +- int bitdepth, int effort ) ++ int bitdepth, int effort) + { + Write *write; + +- if( !(write = write_new( in, target )) ) +- return( -1 ); ++ if (!(write = write_new(in, target))) ++ return (-1); + +- if( write_vips( write, +- compression, interlace, profile, filter, strip, palette, +- Q, dither, bitdepth, effort ) ) { +- write_destroy( write ); +- vips_error( "vips2png", _( "unable to write to target %s" ), +- vips_connection_nick( VIPS_CONNECTION( target ) ) ); +- return( -1 ); ++ if (write_vips(write, ++ compression, interlace, profile, filter, strip, palette, ++ Q, dither, bitdepth, effort)) { ++ write_destroy(write); ++ vips_error("vips2png", _("unable to write to target %s"), ++ vips_connection_nick(VIPS_CONNECTION(target))); ++ return (-1); + } + +- write_destroy( write ); ++ write_destroy(write); + +- if( vips_target_end( target ) ) +- return( -1 ); ++ if (vips_target_end(target)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + #endif /*HAVE_PNG*/ +diff --git a/libvips/foreign/vipssave.c b/libvips/foreign/vipssave.c +index ac3b8bed1d..5e6b0d589a 100644 +--- a/libvips/foreign/vipssave.c ++++ b/libvips/foreign/vipssave.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -57,33 +57,31 @@ typedef struct _VipsForeignSaveVips { + + typedef VipsForeignSaveClass VipsForeignSaveVipsClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveVips, vips_foreign_save_vips, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSaveVips, vips_foreign_save_vips, ++ VIPS_TYPE_FOREIGN_SAVE); + + static void +-vips_foreign_save_vips_dispose( GObject *gobject ) ++vips_foreign_save_vips_dispose(GObject *gobject) + { + VipsForeignSaveVips *vips = (VipsForeignSaveVips *) gobject; + +- VIPS_UNREF( vips->target ); ++ VIPS_UNREF(vips->target); + +- G_OBJECT_CLASS( vips_foreign_save_vips_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_vips_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_save_vips_build( VipsObject *object ) ++vips_foreign_save_vips_build(VipsObject *object) + { + VipsForeignSaveVips *vips = (VipsForeignSaveVips *) object; + + const char *filename; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_vips_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_vips_parent_class)->build(object)) ++ return (-1); + +- if( (filename = +- vips_connection_filename( VIPS_CONNECTION( vips->target ) )) ) { ++ if ((filename = ++ vips_connection_filename(VIPS_CONNECTION(vips->target)))) { + VipsForeignSave *save = (VipsForeignSave *) object; + + VipsImage *x; +@@ -92,16 +90,16 @@ vips_foreign_save_vips_build( VipsObject *object ) + * preventing recursion and sending this directly to the + * saver built into iofuncs. + */ +- if( !(x = vips_image_new_mode( filename, "w" )) ) +- return( -1 ); +- if( vips_image_write( save->ready, x ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (!(x = vips_image_new_mode(filename, "w"))) ++ return (-1); ++ if (vips_image_write(save->ready, x)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + } + else { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + + /* We could add load vips from memory, fd, via mmap etc. here. + * We should perhaps move iofuncs/vips.c into this file. +@@ -109,15 +107,15 @@ vips_foreign_save_vips_build( VipsObject *object ) + * For now, just fail unless there's a filename associated + * with this source. + */ +- vips_error( class->nickname, +- "%s", _( "no filename associated with target" ) ); +- return( -1 ); ++ vips_error(class->nickname, ++ "%s", _("no filename associated with target")); ++ return (-1); + } + +- if( vips_target_end( vips->target ) ) +- return( -1 ); ++ if (vips_target_end(vips->target)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* From vipsload.c. +@@ -125,11 +123,11 @@ vips_foreign_save_vips_build( VipsObject *object ) + extern const char *vips__suffs[]; + + static void +-vips_foreign_save_vips_class_init( VipsForeignSaveVipsClass *class ) ++vips_foreign_save_vips_class_init(VipsForeignSaveVipsClass *class) + { + int i; + +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; +@@ -137,18 +135,18 @@ vips_foreign_save_vips_class_init( VipsForeignSaveVipsClass *class ) + gobject_class->dispose = vips_foreign_save_vips_dispose; + + object_class->nickname = "vipssave_base"; +- object_class->description = _( "save vips base class" ); ++ object_class->description = _("save vips base class"); + object_class->build = vips_foreign_save_vips_build; + + foreign_class->suffs = vips__suffs; + + save_class->saveable = VIPS_SAVEABLE_ANY; +- for( i = 0; i < VIPS_CODING_LAST; i++ ) ++ for (i = 0; i < VIPS_CODING_LAST; i++) + save_class->coding[i] = TRUE; + } + + static void +-vips_foreign_save_vips_init( VipsForeignSaveVips *vips ) ++vips_foreign_save_vips_init(VipsForeignSaveVips *vips) + { + } + +@@ -160,48 +158,47 @@ typedef struct _VipsForeignSaveVipsFile { + + typedef VipsForeignSaveVipsClass VipsForeignSaveVipsFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveVipsFile, vips_foreign_save_vips_file, +- vips_foreign_save_vips_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveVipsFile, vips_foreign_save_vips_file, ++ vips_foreign_save_vips_get_type()); + + static int +-vips_foreign_save_vips_file_build( VipsObject *object ) ++vips_foreign_save_vips_file_build(VipsObject *object) + { + VipsForeignSaveVips *vips = (VipsForeignSaveVips *) object; + VipsForeignSaveVipsFile *file = (VipsForeignSaveVipsFile *) object; + +- if( !(vips->target = vips_target_new_to_file( file->filename )) ) +- return( -1 ); ++ if (!(vips->target = vips_target_new_to_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_vips_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_vips_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_vips_file_class_init( VipsForeignSaveVipsFileClass *class ) ++vips_foreign_save_vips_file_class_init(VipsForeignSaveVipsFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "vipssave"; +- object_class->description = _( "save image to file in vips format" ); ++ object_class->description = _("save image to file in vips format"); + object_class->build = vips_foreign_save_vips_file_build; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveVipsFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveVipsFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_vips_file_init( VipsForeignSaveVipsFile *file ) ++vips_foreign_save_vips_file_init(VipsForeignSaveVipsFile *file) + { + } + +@@ -214,58 +211,56 @@ typedef struct _VipsForeignSaveVipsTarget { + + typedef VipsForeignSaveVipsClass VipsForeignSaveVipsTargetClass; + +-G_DEFINE_TYPE( VipsForeignSaveVipsTarget, vips_foreign_save_vips_target, +- vips_foreign_save_vips_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveVipsTarget, vips_foreign_save_vips_target, ++ vips_foreign_save_vips_get_type()); + + static int +-vips_foreign_save_vips_target_build( VipsObject *object ) ++vips_foreign_save_vips_target_build(VipsObject *object) + { + VipsForeignSaveVips *vips = (VipsForeignSaveVips *) object; +- VipsForeignSaveVipsTarget *target = ++ VipsForeignSaveVipsTarget *target = + (VipsForeignSaveVipsTarget *) object; + + vips->target = target->target; +- g_object_ref( vips->target ); ++ g_object_ref(vips->target); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_vips_target_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_vips_target_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_vips_target_class_init( +- VipsForeignSaveVipsTargetClass *class ) ++vips_foreign_save_vips_target_class_init( ++ VipsForeignSaveVipsTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "vipssave_target"; +- object_class->description = _( "save image to target in vips format" ); ++ object_class->description = _("save image to target in vips format"); + object_class->build = vips_foreign_save_vips_target_build; + +- VIPS_ARG_OBJECT( class, "target", 1, +- _( "Target" ), +- _( "Target to save to" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveVipsTarget, target ), +- VIPS_TYPE_TARGET ); +- ++ VIPS_ARG_OBJECT(class, "target", 1, ++ _("Target"), ++ _("Target to save to"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignSaveVipsTarget, target), ++ VIPS_TYPE_TARGET); + } + + static void +-vips_foreign_save_vips_target_init( VipsForeignSaveVipsTarget *target ) ++vips_foreign_save_vips_target_init(VipsForeignSaveVipsTarget *target) + { + } + + /** + * vips_vipssave: (method) +- * @in: image to save +- * @filename: file to write to ++ * @in: image to save ++ * @filename: file to write to + * @...: %NULL-terminated list of optional named arguments + * + * Write @in to @filename in VIPS format. +@@ -275,21 +270,21 @@ vips_foreign_save_vips_target_init( VipsForeignSaveVipsTarget *target ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_vipssave( VipsImage *in, const char *filename, ... ) ++vips_vipssave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "vipssave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("vipssave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_vipssave_target: (method) +- * @in: image to save ++ * @in: image to save + * @target: save image to this target + * @...: %NULL-terminated list of optional named arguments + * +@@ -298,14 +293,14 @@ vips_vipssave( VipsImage *in, const char *filename, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_vipssave_target( VipsImage *in, VipsTarget *target, ... ) ++vips_vipssave_target(VipsImage *in, VipsTarget *target, ...) + { + va_list ap; + int result; + +- va_start( ap, target ); +- result = vips_call_split( "vipssave_target", ap, in, target ); +- va_end( ap ); ++ va_start(ap, target); ++ result = vips_call_split("vipssave_target", ap, in, target); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/webp2vips.c b/libvips/foreign/webp2vips.c +index c4ab160189..1b82dfaf4d 100644 +--- a/libvips/foreign/webp2vips.c ++++ b/libvips/foreign/webp2vips.c +@@ -23,7 +23,7 @@ + * 27/6/19 + * - disable alpha output if all frame fill the canvas and are solid + * 6/7/19 [deftomat] +- * - support array of delays ++ * - support array of delays + * 14/10/19 + * - revise for source IO + * 27/10/21 +@@ -32,28 +32,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -112,7 +112,7 @@ typedef struct { + int frame_width; + int frame_height; + +- /* Size of final output image. ++ /* Size of final output image. + */ + int width; + int height; +@@ -160,48 +160,48 @@ typedef struct { + } Read; + + const char * +-vips__error_webp( VP8StatusCode code ) ++vips__error_webp(VP8StatusCode code) + { +- switch( code ) { +- case VP8_STATUS_OK: +- return( "VP8_STATUS_OK" ); ++ switch (code) { ++ case VP8_STATUS_OK: ++ return ("VP8_STATUS_OK"); + + case VP8_STATUS_OUT_OF_MEMORY: +- return( "VP8_STATUS_OUT_OF_MEMORY" ); ++ return ("VP8_STATUS_OUT_OF_MEMORY"); + + case VP8_STATUS_INVALID_PARAM: +- return( "VP8_STATUS_INVALID_PARAM" ); ++ return ("VP8_STATUS_INVALID_PARAM"); + + case VP8_STATUS_BITSTREAM_ERROR: +- return( "VP8_STATUS_BITSTREAM_ERROR" ); ++ return ("VP8_STATUS_BITSTREAM_ERROR"); + + case VP8_STATUS_UNSUPPORTED_FEATURE: +- return( "VP8_STATUS_UNSUPPORTED_FEATURE" ); ++ return ("VP8_STATUS_UNSUPPORTED_FEATURE"); + + case VP8_STATUS_SUSPENDED: +- return( "VP8_STATUS_SUSPENDED" ); ++ return ("VP8_STATUS_SUSPENDED"); + + case VP8_STATUS_USER_ABORT: +- return( "VP8_STATUS_USER_ABORT" ); ++ return ("VP8_STATUS_USER_ABORT"); + + case VP8_STATUS_NOT_ENOUGH_DATA: +- return( "VP8_STATUS_NOT_ENOUGH_DATA" ); ++ return ("VP8_STATUS_NOT_ENOUGH_DATA"); + + default: +- return( "" ); ++ return (""); + } + } + + static void +-vips_image_paint_area( VipsImage *image, const VipsRect *r, const VipsPel *ink ) ++vips_image_paint_area(VipsImage *image, const VipsRect *r, const VipsPel *ink) + { + VipsRect valid = { 0, 0, image->Xsize, image->Ysize }; + VipsRect ovl; + +- vips_rect_intersectrect( r, &valid, &ovl ); +- if( !vips_rect_isempty( &ovl ) ) { +- int ps = VIPS_IMAGE_SIZEOF_PEL( image ); +- int ls = VIPS_IMAGE_SIZEOF_LINE( image ); ++ vips_rect_intersectrect(r, &valid, &ovl); ++ if (!vips_rect_isempty(&ovl)) { ++ int ps = VIPS_IMAGE_SIZEOF_PEL(image); ++ int ls = VIPS_IMAGE_SIZEOF_LINE(image); + int ws = ovl.width * ps; + + VipsPel *to, *q; +@@ -211,21 +211,21 @@ vips_image_paint_area( VipsImage *image, const VipsRect *r, const VipsPel *ink ) + * subsequent lines. We need to work for RGB and RGBA, so we + * can't just write uint32s. + */ +- to = VIPS_IMAGE_ADDR( image, ovl.left, ovl.top ); ++ to = VIPS_IMAGE_ADDR(image, ovl.left, ovl.top); + + q = to; +- for( x = 0; x < ovl.width; x++ ) { ++ for (x = 0; x < ovl.width; x++) { + /* Faster than memcpy() for about ps < 20. + */ +- for( z = 0; z < ps; z++ ) ++ for (z = 0; z < ps; z++) + q[z] = ink[z]; + + q += ps; + } + + q = to + ls; +- for( y = 1; y < ovl.height; y++ ) { +- memcpy( q, to, ws ); ++ for (y = 1; y < ovl.height; y++) { ++ memcpy(q, to, ws); + q += ls; + } + } +@@ -233,19 +233,19 @@ vips_image_paint_area( VipsImage *image, const VipsRect *r, const VipsPel *ink ) + + /* Blend two guint8. + */ +-#define BLEND( X, aX, Y, aY, scale ) \ ++#define BLEND(X, aX, Y, aY, scale) \ + (((X * aX + Y * aY) * scale + (1 << 12)) >> 24) + + /* Extract R, G, B, A, assuming little-endian. + */ +-#define getR( V ) (V & 0xff) +-#define getG( V ) ((V >> 8) & 0xff) +-#define getB( V ) ((V >> 16) & 0xff) +-#define getA( V ) ((V >> 24) & 0xff) ++#define getR(V) (V & 0xff) ++#define getG(V) ((V >> 8) & 0xff) ++#define getB(V) ((V >> 16) & 0xff) ++#define getA(V) ((V >> 24) & 0xff) + + /* Rebuild RGBA, assuming little-endian. + */ +-#define setRGBA( R, G, B, A ) \ ++#define setRGBA(R, G, B, A) \ + (R | (G << 8) | (B << 16) | ((guint32) A << 24)) + + /* OVER blend of two unpremultiplied RGBA guint32 +@@ -253,113 +253,113 @@ vips_image_paint_area( VipsImage *image, const VipsRect *r, const VipsPel *ink ) + * We assume little-endian (x86), add a byteswap before this if necessary. + */ + static guint32 +-blend_pixel( guint32 A, guint32 B ) ++blend_pixel(guint32 A, guint32 B) + { +- guint8 aA = getA( A ); ++ guint8 aA = getA(A); + +- if( aA == 0 ) +- return( B ); ++ if (aA == 0) ++ return (B); + +- guint8 aB = getA( B ); ++ guint8 aB = getA(B); + + guint8 fac = (aB * (255 - aA) + 127) >> 8; +- guint8 aR = aA + fac; ++ guint8 aR = aA + fac; + int scale = aR == 0 ? 0 : (1 << 24) / aR; + +- guint8 rR = BLEND( getR( A ), aA, getR( B ), fac, scale ); +- guint8 gR = BLEND( getG( A ), aA, getG( B ), fac, scale ); +- guint8 bR = BLEND( getB( A ), aA, getB( B ), fac, scale ); ++ guint8 rR = BLEND(getR(A), aA, getR(B), fac, scale); ++ guint8 gR = BLEND(getG(A), aA, getG(B), fac, scale); ++ guint8 bR = BLEND(getB(A), aA, getB(B), fac, scale); + +- return( setRGBA( rR, gR, bR, aR ) ); ++ return (setRGBA(rR, gR, bR, aR)); + } + + /* Blend sub into frame at left, top. + */ + static void +-vips_image_paint_image( VipsImage *frame, +- VipsImage *sub, int left, int top, gboolean blend ) ++vips_image_paint_image(VipsImage *frame, ++ VipsImage *sub, int left, int top, gboolean blend) + { + VipsRect frame_rect = { 0, 0, frame->Xsize, frame->Ysize }; + VipsRect sub_rect = { left, top, sub->Xsize, sub->Ysize }; +- int ps = VIPS_IMAGE_SIZEOF_PEL( frame ); ++ int ps = VIPS_IMAGE_SIZEOF_PEL(frame); + + VipsRect ovl; + +- g_assert( VIPS_IMAGE_SIZEOF_PEL( sub ) == ps ); ++ g_assert(VIPS_IMAGE_SIZEOF_PEL(sub) == ps); + +- vips_rect_intersectrect( &frame_rect, &sub_rect, &ovl ); +- if( !vips_rect_isempty( &ovl ) ) { ++ vips_rect_intersectrect(&frame_rect, &sub_rect, &ovl); ++ if (!vips_rect_isempty(&ovl)) { + VipsPel *p, *q; + int x, y; + +- p = VIPS_IMAGE_ADDR( sub, ovl.left - left, ovl.top - top ); +- q = VIPS_IMAGE_ADDR( frame, ovl.left, ovl.top ); ++ p = VIPS_IMAGE_ADDR(sub, ovl.left - left, ovl.top - top); ++ q = VIPS_IMAGE_ADDR(frame, ovl.left, ovl.top); + +- for( y = 0; y < ovl.height; y++ ) { +- if( blend ) { ++ for (y = 0; y < ovl.height; y++) { ++ if (blend) { + guint32 *A = (guint32 *) p; + guint32 *B = (guint32 *) q; + +- for( x = 0; x < ovl.width; x++ ) +- B[x] = blend_pixel( A[x], B[x] ); ++ for (x = 0; x < ovl.width; x++) ++ B[x] = blend_pixel(A[x], B[x]); + } + else +- memcpy( (char *) q, (char *) p, +- ovl.width * ps ); ++ memcpy((char *) q, (char *) p, ++ ovl.width * ps); + +- p += VIPS_IMAGE_SIZEOF_LINE( sub ); +- q += VIPS_IMAGE_SIZEOF_LINE( frame ); ++ p += VIPS_IMAGE_SIZEOF_LINE(sub); ++ q += VIPS_IMAGE_SIZEOF_LINE(frame); + } + } + } + + int +-vips__iswebp_source( VipsSource *source ) ++vips__iswebp_source(VipsSource *source) + { + const unsigned char *p; + + /* WebP is "RIFF xxxx WEBP" at the start, so we need 12 bytes. + */ +- if( (p = vips_source_sniff( source, 12 )) && +- vips_isprefix( "RIFF", (char *) p ) && +- vips_isprefix( "WEBP", (char *) p + 8 ) ) +- return( 1 ); ++ if ((p = vips_source_sniff(source, 12)) && ++ vips_isprefix("RIFF", (char *) p) && ++ vips_isprefix("WEBP", (char *) p + 8)) ++ return (1); + +- return( 0 ); ++ return (0); + } + + static int +-read_free( Read *read ) ++read_free(Read *read) + { +- WebPDemuxReleaseIterator( &read->iter ); +- VIPS_UNREF( read->frame ); +- VIPS_FREEF( WebPDemuxDelete, read->demux ); +- WebPFreeDecBuffer( &read->config.output ); ++ WebPDemuxReleaseIterator(&read->iter); ++ VIPS_UNREF(read->frame); ++ VIPS_FREEF(WebPDemuxDelete, read->demux); ++ WebPFreeDecBuffer(&read->config.output); + +- VIPS_UNREF( read->source ); +- VIPS_FREE( read->delays ); +- VIPS_FREE( read ); ++ VIPS_UNREF(read->source); ++ VIPS_FREE(read->delays); ++ VIPS_FREE(read); + +- return( 0 ); ++ return (0); + } + + static void +-read_close_cb( VipsImage *image, Read *read ) ++read_close_cb(VipsImage *image, Read *read) + { +- read_free( read ); ++ read_free(read); + } + + static Read * +-read_new( VipsImage *out, VipsSource *source, int page, int n, double scale ) ++read_new(VipsImage *out, VipsSource *source, int page, int n, double scale) + { + Read *read; + +- if( !(read = VIPS_NEW( NULL, Read )) ) +- return( NULL ); ++ if (!(read = VIPS_NEW(NULL, Read))) ++ return (NULL); + + read->out = out; + read->source = source; +- g_object_ref( source ); ++ g_object_ref(source); + read->page = page; + read->n = n; + read->scale = scale; +@@ -372,18 +372,18 @@ read_new( VipsImage *out, VipsSource *source, int page, int n, double scale ) + /* Everything has to stay open until read has finished, unfortunately, + * since webp relies on us mapping the whole file. + */ +- g_signal_connect( out, "close", +- G_CALLBACK( read_close_cb ), read ); ++ g_signal_connect(out, "close", ++ G_CALLBACK(read_close_cb), read); + +- WebPInitDecoderConfig( &read->config ); ++ WebPInitDecoderConfig(&read->config); + read->config.options.use_threads = 1; + read->config.output.is_external_memory = 1; + +- if( !(read->data.bytes = +- vips_source_map( source, &read->data.size )) ) +- return( NULL ); ++ if (!(read->data.bytes = ++ vips_source_map(source, &read->data.size))) ++ return (NULL); + +- return( read ); ++ return (read); + } + + /* Map vips metadata names to webp names. +@@ -393,20 +393,20 @@ const VipsWebPNames vips__webp_names[] = { + { VIPS_META_EXIF_NAME, "EXIF", EXIF_FLAG }, + { VIPS_META_XMP_NAME, "XMP ", XMP_FLAG } + }; +-const int vips__n_webp_names = VIPS_NUMBER( vips__webp_names ); ++const int vips__n_webp_names = VIPS_NUMBER(vips__webp_names); + + static int +-read_header( Read *read, VipsImage *out ) ++read_header(Read *read, VipsImage *out) + { + int flags; + int i; + +- if( !(read->demux = WebPDemux( &read->data )) ) { +- vips_error( "webp", "%s", _( "unable to parse image" ) ); +- return( -1 ); ++ if (!(read->demux = WebPDemux(&read->data))) { ++ vips_error("webp", "%s", _("unable to parse image")); ++ return (-1); + } + +- flags = WebPDemuxGetI( read->demux, WEBP_FF_FORMAT_FLAGS ); ++ flags = WebPDemuxGetI(read->demux, WEBP_FF_FORMAT_FLAGS); + + read->alpha = flags & ALPHA_FLAG; + +@@ -415,57 +415,57 @@ read_header( Read *read, VipsImage *out ) + */ + read->config.output.colorspace = MODE_RGBA; + +- read->canvas_width = +- WebPDemuxGetI( read->demux, WEBP_FF_CANVAS_WIDTH ); +- read->canvas_height = +- WebPDemuxGetI( read->demux, WEBP_FF_CANVAS_HEIGHT ); ++ read->canvas_width = ++ WebPDemuxGetI(read->demux, WEBP_FF_CANVAS_WIDTH); ++ read->canvas_height = ++ WebPDemuxGetI(read->demux, WEBP_FF_CANVAS_HEIGHT); + +- if( flags & ANIMATION_FLAG ) { ++ if (flags & ANIMATION_FLAG) { + int loop_count; + WebPIterator iter; + +- loop_count = WebPDemuxGetI( read->demux, WEBP_FF_LOOP_COUNT ); +- read->frame_count = WebPDemuxGetI( read->demux, +- WEBP_FF_FRAME_COUNT ); ++ loop_count = WebPDemuxGetI(read->demux, WEBP_FF_LOOP_COUNT); ++ read->frame_count = WebPDemuxGetI(read->demux, ++ WEBP_FF_FRAME_COUNT); + + #ifdef DEBUG +- printf( "webp2vips: animation\n" ); +- printf( "webp2vips: loop_count = %d\n", loop_count ); +- printf( "webp2vips: frame_count = %d\n", read->frame_count ); ++ printf("webp2vips: animation\n"); ++ printf("webp2vips: loop_count = %d\n", loop_count); ++ printf("webp2vips: frame_count = %d\n", read->frame_count); + #endif /*DEBUG*/ + +- vips_image_set_int( out, "loop", loop_count ); ++ vips_image_set_int(out, "loop", loop_count); + + /* DEPRECATED "gif-loop" + * + * Not the correct behavior as loop=1 became gif-loop=0 + * but we want to keep the old behavior untouched! + */ +- vips_image_set_int( out, "gif-loop", +- loop_count == 0 ? 0 : loop_count - 1 ); ++ vips_image_set_int(out, "gif-loop", ++ loop_count == 0 ? 0 : loop_count - 1); + +- if( WebPDemuxGetFrame( read->demux, 1, &iter ) ) { ++ if (WebPDemuxGetFrame(read->demux, 1, &iter)) { + int i; + +- read->delays = (int *) +- g_malloc0( read->frame_count * sizeof( int ) ); +- for( i = 0; i < read->frame_count; i++ ) ++ read->delays = (int *) ++ g_malloc0(read->frame_count * sizeof(int)); ++ for (i = 0; i < read->frame_count; i++) + read->delays[i] = 40; + + do { +- g_assert( iter.frame_num >= 1 && +- iter.frame_num <= read->frame_count ); ++ g_assert(iter.frame_num >= 1 && ++ iter.frame_num <= read->frame_count); + +- read->delays[iter.frame_num - 1] = ++ read->delays[iter.frame_num - 1] = + iter.duration; + + /* We need the alpha in an animation if: +- * - any frame has transparent pixels ++ * - any frame has transparent pixels + * - any frame doesn't fill the whole canvas. + */ +- if( iter.has_alpha || ++ if (iter.has_alpha || + iter.width != read->canvas_width || +- iter.height != read->canvas_height ) ++ iter.height != read->canvas_height) + read->alpha = TRUE; + + /* We must disable shrink-on-load if any frame +@@ -473,58 +473,58 @@ read_header( Read *read, VipsImage *out ) + * able to shrink-on-load it to the exact + * position in a downsized canvas. + */ +- if( iter.width != read->canvas_width || +- iter.height != read->canvas_height ) ++ if (iter.width != read->canvas_width || ++ iter.height != read->canvas_height) + read->scale = 1.0; +- } while( WebPDemuxNextFrame( &iter ) ); ++ } while (WebPDemuxNextFrame(&iter)); + +- vips_image_set_array_int( out, +- "delay", read->delays, read->frame_count ); ++ vips_image_set_array_int(out, ++ "delay", read->delays, read->frame_count); + + /* webp uses ms for delays, gif uses centiseconds. + */ +- vips_image_set_int( out, "gif-delay", +- VIPS_RINT( read->delays[0] / 10.0 ) ); ++ vips_image_set_int(out, "gif-delay", ++ VIPS_RINT(read->delays[0] / 10.0)); + } + +- WebPDemuxReleaseIterator( &iter ); ++ WebPDemuxReleaseIterator(&iter); + +- if( read->n == -1 ) ++ if (read->n == -1) + read->n = read->frame_count - read->page; + +- if( read->page < 0 || ++ if (read->page < 0 || + read->n <= 0 || +- read->page + read->n > read->frame_count ) { +- vips_error( "webp", +- "%s", _( "bad page number" ) ); +- return( -1 ); ++ read->page + read->n > read->frame_count) { ++ vips_error("webp", ++ "%s", _("bad page number")); ++ return (-1); + } + + /* Note that n-pages is the number of pages in the original, + * not the number of pages in the image we are writing. + */ +- vips_image_set_int( out, VIPS_META_N_PAGES, read->frame_count ); ++ vips_image_set_int(out, VIPS_META_N_PAGES, read->frame_count); + } + + /* We round-to-nearest cf. pdfload etc. + */ +- read->frame_width = VIPS_RINT( read->canvas_width * read->scale ); +- read->frame_height = VIPS_RINT( read->canvas_height * read->scale ); ++ read->frame_width = VIPS_RINT(read->canvas_width * read->scale); ++ read->frame_height = VIPS_RINT(read->canvas_height * read->scale); + + #ifdef DEBUG +- printf( "webp2vips: canvas_width = %d\n", read->canvas_width ); +- printf( "webp2vips: canvas_height = %d\n", read->canvas_height ); +- printf( "webp2vips: frame_width = %d\n", read->frame_width ); +- printf( "webp2vips: frame_height = %d\n", read->frame_height ); ++ printf("webp2vips: canvas_width = %d\n", read->canvas_width); ++ printf("webp2vips: canvas_height = %d\n", read->canvas_height); ++ printf("webp2vips: frame_width = %d\n", read->frame_width); ++ printf("webp2vips: frame_height = %d\n", read->frame_height); + #endif /*DEBUG*/ + +- if( flags & ANIMATION_FLAG ) { ++ if (flags & ANIMATION_FLAG) { + /* Only set page-height if we have more than one page, or + * this could accidentally turn into an animated image later. + */ +- if( read->n > 1 ) +- vips_image_set_int( out, +- VIPS_META_PAGE_HEIGHT, read->frame_height ); ++ if (read->n > 1) ++ vips_image_set_int(out, ++ VIPS_META_PAGE_HEIGHT, read->frame_height); + + read->width = read->frame_width; + read->height = read->n * read->frame_height; +@@ -537,29 +537,29 @@ read_header( Read *read, VipsImage *out ) + + /* height can be huge if this is an animated webp image. + */ +- if( read->width <= 0 || ++ if (read->width <= 0 || + read->height <= 0 || + read->width > 0x3FFF || + read->height >= VIPS_MAX_COORD || + read->frame_width <= 0 || + read->frame_height <= 0 || + read->frame_width > 0x3FFF || +- read->frame_height > 0x3FFF ) { +- vips_error( "webp", "%s", _( "bad image dimensions" ) ); +- return( -1 ); ++ read->frame_height > 0x3FFF) { ++ vips_error("webp", "%s", _("bad image dimensions")); ++ return (-1); + } + +- for( i = 0; i < vips__n_webp_names; i++ ) { ++ for (i = 0; i < vips__n_webp_names; i++) { + const char *vips = vips__webp_names[i].vips; + const char *webp = vips__webp_names[i].webp; + +- if( flags & vips__webp_names[i].flags ) { ++ if (flags & vips__webp_names[i].flags) { + WebPChunkIterator iter; + +- WebPDemuxGetChunk( read->demux, webp, 1, &iter ); +- vips_image_set_blob_copy( out, +- vips, iter.chunk.bytes, iter.chunk.size ); +- WebPDemuxReleaseChunkIterator( &iter ); ++ WebPDemuxGetChunk(read->demux, webp, 1, &iter); ++ vips_image_set_blob_copy(out, ++ vips, iter.chunk.bytes, iter.chunk.size); ++ WebPDemuxReleaseChunkIterator(&iter); + } + } + +@@ -567,112 +567,112 @@ read_header( Read *read, VipsImage *out ) + * can. + */ + read->frame = vips_image_new_memory(); +- vips_image_init_fields( read->frame, +- read->frame_width, read->frame_height, 4, ++ vips_image_init_fields(read->frame, ++ read->frame_width, read->frame_height, 4, + VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, + VIPS_INTERPRETATION_sRGB, +- 1.0, 1.0 ); +- if( vips_image_pipelinev( read->frame, +- VIPS_DEMAND_STYLE_THINSTRIP, NULL ) || +- vips_image_write_prepare( read->frame ) ) +- return( -1 ); ++ 1.0, 1.0); ++ if (vips_image_pipelinev(read->frame, ++ VIPS_DEMAND_STYLE_THINSTRIP, NULL) || ++ vips_image_write_prepare(read->frame)) ++ return (-1); + +- vips_image_init_fields( out, ++ vips_image_init_fields(out, + read->width, read->height, + read->alpha ? 4 : 3, + VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, + VIPS_INTERPRETATION_sRGB, +- 1.0, 1.0 ); +- if( vips_image_pipelinev( out, VIPS_DEMAND_STYLE_THINSTRIP, NULL ) ) +- return( -1 ); +- VIPS_SETSTR( out->filename, +- vips_connection_filename( VIPS_CONNECTION( read->source ) ) ); +- +- if( !WebPDemuxGetFrame( read->demux, 1, &read->iter ) ) { +- vips_error( "webp", +- "%s", _( "unable to loop through frames" ) ); +- return( -1 ); ++ 1.0, 1.0); ++ if (vips_image_pipelinev(out, VIPS_DEMAND_STYLE_THINSTRIP, NULL)) ++ return (-1); ++ VIPS_SETSTR(out->filename, ++ vips_connection_filename(VIPS_CONNECTION(read->source))); ++ ++ if (!WebPDemuxGetFrame(read->demux, 1, &read->iter)) { ++ vips_error("webp", ++ "%s", _("unable to loop through frames")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Read a single frame -- a width * height block of pixels. This will get + * blended into the accumulator at some offset. + */ + static VipsImage * +-read_frame( Read *read, +- int width, int height, const guint8 *data, size_t length ) ++read_frame(Read *read, ++ int width, int height, const guint8 *data, size_t length) + { + VipsImage *frame; + + #ifdef DEBUG +- printf( "read_frame:\n" ); ++ printf("read_frame:\n"); + #endif /*DEBUG*/ + + frame = vips_image_new_memory(); +- vips_image_init_fields( frame, ++ vips_image_init_fields(frame, + width, height, 4, + VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, + VIPS_INTERPRETATION_sRGB, +- 1.0, 1.0 ); +- if( vips_image_pipelinev( frame, VIPS_DEMAND_STYLE_THINSTRIP, NULL ) || +- vips_image_write_prepare( frame ) ) { +- g_object_unref( frame ); +- return( NULL ); ++ 1.0, 1.0); ++ if (vips_image_pipelinev(frame, VIPS_DEMAND_STYLE_THINSTRIP, NULL) || ++ vips_image_write_prepare(frame)) { ++ g_object_unref(frame); ++ return (NULL); + } + +- read->config.output.u.RGBA.rgba = VIPS_IMAGE_ADDR( frame, 0, 0 ); +- read->config.output.u.RGBA.stride = VIPS_IMAGE_SIZEOF_LINE( frame ); +- read->config.output.u.RGBA.size = VIPS_IMAGE_SIZEOF_IMAGE( frame ); +- if( read->scale != 1.0 ) { ++ read->config.output.u.RGBA.rgba = VIPS_IMAGE_ADDR(frame, 0, 0); ++ read->config.output.u.RGBA.stride = VIPS_IMAGE_SIZEOF_LINE(frame); ++ read->config.output.u.RGBA.size = VIPS_IMAGE_SIZEOF_IMAGE(frame); ++ if (read->scale != 1.0) { + read->config.options.use_scaling = 1; + read->config.options.scaled_width = width; +- read->config.options.scaled_height = height; ++ read->config.options.scaled_height = height; + } + +- if( WebPDecode( data, length, &read->config ) != VP8_STATUS_OK ) { +- g_object_unref( frame ); +- vips_error( "webp2vips", "%s", _( "unable to read pixels" ) ); +- return( NULL ); ++ if (WebPDecode(data, length, &read->config) != VP8_STATUS_OK) { ++ g_object_unref(frame); ++ vips_error("webp2vips", "%s", _("unable to read pixels")); ++ return (NULL); + } + +- return( frame ); ++ return (frame); + } + + static int +-read_next_frame( Read *read ) ++read_next_frame(Read *read) + { + VipsImage *frame; + VipsRect area; + + #ifdef DEBUG +- printf( "read_next_frame:\n" ); ++ printf("read_next_frame:\n"); + #endif /*DEBUG*/ + + /* Area of this frame, in output image coordinates. We must rint(), + * since we need the same rules as the overall image scale, or we'll + * sometimes have missing pixels on edges. + */ +- area.left = VIPS_RINT( read->iter.x_offset * read->scale ); +- area.top = VIPS_RINT( read->iter.y_offset * read->scale ); +- area.width = VIPS_RINT( read->iter.width * read->scale ); +- area.height = VIPS_RINT( read->iter.height * read->scale ); ++ area.left = VIPS_RINT(read->iter.x_offset * read->scale); ++ area.top = VIPS_RINT(read->iter.y_offset * read->scale); ++ area.width = VIPS_RINT(read->iter.width * read->scale); ++ area.height = VIPS_RINT(read->iter.height * read->scale); + + /* Dispose from the previous frame. + */ +- if( read->dispose_method == WEBP_MUX_DISPOSE_BACKGROUND ) { +- /* We must clear the pixels occupied by the previous webp +- * frame (not the whole of the read frame) to 0 (transparent). ++ if (read->dispose_method == WEBP_MUX_DISPOSE_BACKGROUND) { ++ /* We must clear the pixels occupied by the previous webp ++ * frame (not the whole of the read frame) to 0 (transparent). + * +- * We do not clear to WEBP_FF_BACKGROUND_COLOR. That's only ++ * We do not clear to WEBP_FF_BACKGROUND_COLOR. That's only + * used to composite down to RGB. Perhaps we + * should attach background as metadata. + */ + guint32 zero = 0; + +- vips_image_paint_area( read->frame, +- &read->dispose_rect, (VipsPel *) &zero ); ++ vips_image_paint_area(read->frame, ++ &read->dispose_rect, (VipsPel *) &zero); + } + + /* Note this frame's dispose for next time. +@@ -681,57 +681,57 @@ read_next_frame( Read *read ) + read->dispose_rect = area; + + #ifdef DEBUG +- printf( "webp2vips: frame_num = %d\n", read->iter.frame_num ); +- printf( " left = %d\n", area.left ); +- printf( " top = %d\n", area.top ); +- printf( " width = %d\n", area.width ); +- printf( " height = %d\n", area.height ); +- printf( " duration = %d\n", read->iter.duration ); +- printf( " dispose = " ); +- if( read->iter.dispose_method == WEBP_MUX_DISPOSE_BACKGROUND ) +- printf( "clear to background\n" ); ++ printf("webp2vips: frame_num = %d\n", read->iter.frame_num); ++ printf(" left = %d\n", area.left); ++ printf(" top = %d\n", area.top); ++ printf(" width = %d\n", area.width); ++ printf(" height = %d\n", area.height); ++ printf(" duration = %d\n", read->iter.duration); ++ printf(" dispose = "); ++ if (read->iter.dispose_method == WEBP_MUX_DISPOSE_BACKGROUND) ++ printf("clear to background\n"); + else +- printf( "none\n" ); +- printf( " has_alpha = %d\n", read->iter.has_alpha ); +- printf( " blend_method = " ); +- if( read->iter.blend_method == WEBP_MUX_BLEND ) +- printf( "blend with previous\n" ); ++ printf("none\n"); ++ printf(" has_alpha = %d\n", read->iter.has_alpha); ++ printf(" blend_method = "); ++ if (read->iter.blend_method == WEBP_MUX_BLEND) ++ printf("blend with previous\n"); + else +- printf( "don't blend\n" ); ++ printf("don't blend\n"); + #endif /*DEBUG*/ + +- if( !(frame = read_frame( read, +- area.width, area.height, +- read->iter.fragment.bytes, read->iter.fragment.size )) ) +- return( -1 ); ++ if (!(frame = read_frame(read, ++ area.width, area.height, ++ read->iter.fragment.bytes, read->iter.fragment.size))) ++ return (-1); + + /* Now blend or copy the new pixels into our accumulator. + */ +- vips_image_paint_image( read->frame, frame, +- area.left, area.top, ++ vips_image_paint_image(read->frame, frame, ++ area.left, area.top, + read->iter.frame_num > 1 && +- read->iter.blend_method == WEBP_MUX_BLEND ); ++ read->iter.blend_method == WEBP_MUX_BLEND); + +- g_object_unref( frame ); ++ g_object_unref(frame); + +- /* If there's another frame, move on. ++ /* If there's another frame, move on. + */ +- if( read->iter.frame_num < read->frame_count ) { +- if( !WebPDemuxNextFrame( &read->iter ) ) { +- vips_error( "webp2vips", +- "%s", _( "not enough frames" ) ); +- return( -1 ); ++ if (read->iter.frame_num < read->frame_count) { ++ if (!WebPDemuxNextFrame(&read->iter)) { ++ vips_error("webp2vips", ++ "%s", _("not enough frames")); ++ return (-1); + } + } + +- return( 0 ); ++ return (0); + } + + static int +-read_webp_generate( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++read_webp_generate(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + Read *read = (Read *) a; + + /* iter.frame_num numbers from 1. +@@ -740,22 +740,22 @@ read_webp_generate( VipsRegion *or, + int line = r->top % read->frame_height; + + #ifdef DEBUG_VERBOSE +- printf( "read_webp_generate: line %d\n", r->top ); ++ printf("read_webp_generate: line %d\n", r->top); + #endif /*DEBUG_VERBOSE*/ + +- g_assert( r->height == 1 ); ++ g_assert(r->height == 1); + +- while( read->frame_no < frame ) { +- if( read_next_frame( read ) ) +- return( -1 ); ++ while (read->frame_no < frame) { ++ if (read_next_frame(read)) ++ return (-1); + + read->frame_no += 1; + } + +- if( or->im->Bands == 4 ) +- memcpy( VIPS_REGION_ADDR( or, 0, r->top ), +- VIPS_IMAGE_ADDR( read->frame, 0, line ), +- VIPS_IMAGE_SIZEOF_LINE( read->frame ) ); ++ if (or->im->Bands == 4) ++ memcpy(VIPS_REGION_ADDR(or, 0, r->top), ++ VIPS_IMAGE_ADDR(read->frame, 0, line), ++ VIPS_IMAGE_SIZEOF_LINE(read->frame)); + else { + int x; + VipsPel *p; +@@ -764,9 +764,9 @@ read_webp_generate( VipsRegion *or, + /* We know that alpha is solid, so we can just drop the 4th + * band. + */ +- p = VIPS_IMAGE_ADDR( read->frame, 0, line ); +- q = VIPS_REGION_ADDR( or, 0, r->top ); +- for( x = 0; x < r->width; x++ ) { ++ p = VIPS_IMAGE_ADDR(read->frame, 0, line); ++ q = VIPS_REGION_ADDR(or, 0, r->top); ++ for (x = 0; x < r->width; x++) { + q[0] = p[0]; + q[1] = p[1]; + q[2] = p[2]; +@@ -776,52 +776,52 @@ read_webp_generate( VipsRegion *or, + } + } + +- return( 0 ); ++ return (0); + } + + static int +-read_image( Read *read, VipsImage *out ) ++read_image(Read *read, VipsImage *out) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 3 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(out), 3); + + t[0] = vips_image_new(); +- if( read_header( read, t[0] ) ) +- return( -1 ); ++ if (read_header(read, t[0])) ++ return (-1); + +- if( vips_image_generate( t[0], +- NULL, read_webp_generate, NULL, read, NULL ) || +- vips_sequential( t[0], &t[1], NULL ) || +- vips_image_write( t[1], out ) ) +- return( -1 ); ++ if (vips_image_generate(t[0], ++ NULL, read_webp_generate, NULL, read, NULL) || ++ vips_sequential(t[0], &t[1], NULL) || ++ vips_image_write(t[1], out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-vips__webp_read_header_source( VipsSource *source, VipsImage *out, +- int page, int n, double scale ) ++vips__webp_read_header_source(VipsSource *source, VipsImage *out, ++ int page, int n, double scale) + { + Read *read; + +- if( !(read = read_new( out, source, page, n, scale )) || +- read_header( read, out ) ) +- return( -1 ); ++ if (!(read = read_new(out, source, page, n, scale)) || ++ read_header(read, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-vips__webp_read_source( VipsSource *source, VipsImage *out, +- int page, int n, double scale ) ++vips__webp_read_source(VipsSource *source, VipsImage *out, ++ int page, int n, double scale) + { + Read *read; + +- if( !(read = read_new( out, source, page, n, scale )) || +- read_image( read, out ) ) +- return( -1 ); ++ if (!(read = read_new(out, source, page, n, scale)) || ++ read_image(read, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + #endif /*HAVE_LIBWEBP*/ +diff --git a/libvips/foreign/webpload.c b/libvips/foreign/webpload.c +index 5b8cb74b65..38e6a9078e 100644 +--- a/libvips/foreign/webpload.c ++++ b/libvips/foreign/webpload.c +@@ -12,28 +12,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -72,7 +72,7 @@ typedef struct _VipsForeignLoadWebp { + + /* Scale by this much during load. + */ +- double scale; ++ double scale; + + /* Old and deprecated scaling path. + */ +@@ -81,79 +81,77 @@ typedef struct _VipsForeignLoadWebp { + + typedef VipsForeignLoadClass VipsForeignLoadWebpClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignLoadWebp, vips_foreign_load_webp, +- VIPS_TYPE_FOREIGN_LOAD ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignLoadWebp, vips_foreign_load_webp, ++ VIPS_TYPE_FOREIGN_LOAD); + + static void +-vips_foreign_load_webp_dispose( GObject *gobject ) ++vips_foreign_load_webp_dispose(GObject *gobject) + { + VipsForeignLoadWebp *webp = (VipsForeignLoadWebp *) gobject; + +- VIPS_UNREF( webp->source ); ++ VIPS_UNREF(webp->source); + +- G_OBJECT_CLASS( vips_foreign_load_webp_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_load_webp_parent_class)->dispose(gobject); + } + + static int +-vips_foreign_load_webp_build( VipsObject *object ) ++vips_foreign_load_webp_build(VipsObject *object) + { + VipsForeignLoadWebp *webp = (VipsForeignLoadWebp *) object; + + /* BC for the old API. + */ +- if( !vips_object_argument_isset( VIPS_OBJECT( webp ), "scale" ) && +- vips_object_argument_isset( VIPS_OBJECT( webp ), "shrink" ) && +- webp->shrink != 0 ) ++ if (!vips_object_argument_isset(VIPS_OBJECT(webp), "scale") && ++ vips_object_argument_isset(VIPS_OBJECT(webp), "shrink") && ++ webp->shrink != 0) + webp->scale = 1.0 / webp->shrink; + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_webp_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_webp_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static VipsForeignFlags +-vips_foreign_load_webp_get_flags( VipsForeignLoad *load ) ++vips_foreign_load_webp_get_flags(VipsForeignLoad *load) + { +- return( 0 ); ++ return (0); + } + + static VipsForeignFlags +-vips_foreign_load_webp_get_flags_filename( const char *filename ) ++vips_foreign_load_webp_get_flags_filename(const char *filename) + { +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_webp_header( VipsForeignLoad *load ) ++vips_foreign_load_webp_header(VipsForeignLoad *load) + { + VipsForeignLoadWebp *webp = (VipsForeignLoadWebp *) load; + +- if( vips__webp_read_header_source( webp->source, load->out, +- webp->page, webp->n, webp->scale ) ) +- return( -1 ); ++ if (vips__webp_read_header_source(webp->source, load->out, ++ webp->page, webp->n, webp->scale)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_load_webp_load( VipsForeignLoad *load ) ++vips_foreign_load_webp_load(VipsForeignLoad *load) + { + VipsForeignLoadWebp *webp = (VipsForeignLoadWebp *) load; + +- if( vips__webp_read_source( webp->source, load->real, +- webp->page, webp->n, webp->scale ) ) +- return( -1 ); ++ if (vips__webp_read_source(webp->source, load->real, ++ webp->page, webp->n, webp->scale)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_webp_class_init( VipsForeignLoadWebpClass *class ) ++vips_foreign_load_webp_class_init(VipsForeignLoadWebpClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -163,51 +161,50 @@ vips_foreign_load_webp_class_init( VipsForeignLoadWebpClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "webpload_base"; +- object_class->description = _( "load webp" ); ++ object_class->description = _("load webp"); + object_class->build = vips_foreign_load_webp_build; + + /* We are fast at is_a(), so high priority. + */ + foreign_class->priority = 200; + +- load_class->get_flags_filename = ++ load_class->get_flags_filename = + vips_foreign_load_webp_get_flags_filename; + load_class->get_flags = vips_foreign_load_webp_get_flags; + load_class->header = vips_foreign_load_webp_header; + load_class->load = vips_foreign_load_webp_load; + +- VIPS_ARG_INT( class, "page", 20, +- _( "Page" ), +- _( "First page to load" ), ++ VIPS_ARG_INT(class, "page", 20, ++ _("Page"), ++ _("First page to load"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadWebp, page ), +- 0, 100000, 0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadWebp, page), ++ 0, 100000, 0); + +- VIPS_ARG_INT( class, "n", 21, +- _( "n" ), +- _( "Number of pages to load, -1 for all" ), ++ VIPS_ARG_INT(class, "n", 21, ++ _("n"), ++ _("Number of pages to load, -1 for all"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadWebp, n ), +- -1, 100000, 1 ); ++ G_STRUCT_OFFSET(VipsForeignLoadWebp, n), ++ -1, 100000, 1); + +- VIPS_ARG_DOUBLE( class, "scale", 22, +- _( "Scale" ), +- _( "Factor to scale by" ), ++ VIPS_ARG_DOUBLE(class, "scale", 22, ++ _("Scale"), ++ _("Factor to scale by"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadWebp, scale ), +- 0.0, 1024.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsForeignLoadWebp, scale), ++ 0.0, 1024.0, 1.0); + +- VIPS_ARG_INT( class, "shrink", 23, +- _( "Shrink" ), +- _( "Shrink factor on load" ), ++ VIPS_ARG_INT(class, "shrink", 23, ++ _("Shrink"), ++ _("Shrink factor on load"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignLoadWebp, shrink ), +- 1, 1024, 1 ); +- ++ G_STRUCT_OFFSET(VipsForeignLoadWebp, shrink), ++ 1, 1024, 1); + } + + static void +-vips_foreign_load_webp_init( VipsForeignLoadWebp *webp ) ++vips_foreign_load_webp_init(VipsForeignLoadWebp *webp) + { + webp->n = 1; + webp->shrink = 1; +@@ -223,59 +220,57 @@ typedef struct _VipsForeignLoadWebpSource { + + typedef VipsForeignLoadWebpClass VipsForeignLoadWebpSourceClass; + +-G_DEFINE_TYPE( VipsForeignLoadWebpSource, vips_foreign_load_webp_source, +- vips_foreign_load_webp_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadWebpSource, vips_foreign_load_webp_source, ++ vips_foreign_load_webp_get_type()); + + static int +-vips_foreign_load_webp_source_build( VipsObject *object ) ++vips_foreign_load_webp_source_build(VipsObject *object) + { + VipsForeignLoadWebp *webp = (VipsForeignLoadWebp *) object; +- VipsForeignLoadWebpSource *source = ++ VipsForeignLoadWebpSource *source = + (VipsForeignLoadWebpSource *) object; + +- if( source->source ) { ++ if (source->source) { + webp->source = source->source; +- g_object_ref( webp->source ); ++ g_object_ref(webp->source); + } + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_webp_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_webp_source_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_load_webp_source_class_init( +- VipsForeignLoadWebpSourceClass *class ) ++vips_foreign_load_webp_source_class_init( ++ VipsForeignLoadWebpSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "webpload_source"; +- object_class->description = _( "load webp from source" ); ++ object_class->description = _("load webp from source"); + object_class->build = vips_foreign_load_webp_source_build; + + operation_class->flags |= VIPS_OPERATION_NOCACHE; + +- load_class->is_a_source = vips__iswebp_source; +- +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadWebpSource, source ), +- VIPS_TYPE_SOURCE ); ++ load_class->is_a_source = vips__iswebp_source; + ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadWebpSource, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_foreign_load_webp_source_init( VipsForeignLoadWebpSource *buffer ) ++vips_foreign_load_webp_source_init(VipsForeignLoadWebpSource *buffer) + { + } + +@@ -284,53 +279,52 @@ typedef struct _VipsForeignLoadWebpFile { + + /* Filename for load. + */ +- char *filename; ++ char *filename; + + } VipsForeignLoadWebpFile; + + typedef VipsForeignLoadWebpClass VipsForeignLoadWebpFileClass; + +-G_DEFINE_TYPE( VipsForeignLoadWebpFile, vips_foreign_load_webp_file, +- vips_foreign_load_webp_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadWebpFile, vips_foreign_load_webp_file, ++ vips_foreign_load_webp_get_type()); + + static int +-vips_foreign_load_webp_file_build( VipsObject *object ) ++vips_foreign_load_webp_file_build(VipsObject *object) + { + VipsForeignLoadWebp *webp = (VipsForeignLoadWebp *) object; + VipsForeignLoadWebpFile *file = (VipsForeignLoadWebpFile *) object; + +- if( file->filename && +- !(webp->source = +- vips_source_new_from_file( file->filename )) ) +- return( -1 ); ++ if (file->filename && ++ !(webp->source = ++ vips_source_new_from_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_webp_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_webp_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_webp_file_is_a( const char *filename ) ++vips_foreign_load_webp_file_is_a(const char *filename) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_file( filename )) ) +- return( FALSE ); +- result = vips__iswebp_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_file(filename))) ++ return (FALSE); ++ result = vips__iswebp_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + const char *vips__webp_suffs[] = { ".webp", NULL }; + + static void +-vips_foreign_load_webp_file_class_init( VipsForeignLoadWebpFileClass *class ) ++vips_foreign_load_webp_file_class_init(VipsForeignLoadWebpFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; +@@ -339,23 +333,23 @@ vips_foreign_load_webp_file_class_init( VipsForeignLoadWebpFileClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "webpload"; +- object_class->description = _( "load webp from file" ); ++ object_class->description = _("load webp from file"); + object_class->build = vips_foreign_load_webp_file_build; + + foreign_class->suffs = vips__webp_suffs; + + load_class->is_a = vips_foreign_load_webp_file_is_a; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadWebpFile, filename ), +- NULL ); ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadWebpFile, filename), ++ NULL); + } + + static void +-vips_foreign_load_webp_file_init( VipsForeignLoadWebpFile *file ) ++vips_foreign_load_webp_file_init(VipsForeignLoadWebpFile *file) + { + } + +@@ -370,48 +364,47 @@ typedef struct _VipsForeignLoadWebpBuffer { + + typedef VipsForeignLoadWebpClass VipsForeignLoadWebpBufferClass; + +-G_DEFINE_TYPE( VipsForeignLoadWebpBuffer, vips_foreign_load_webp_buffer, +- vips_foreign_load_webp_get_type() ); ++G_DEFINE_TYPE(VipsForeignLoadWebpBuffer, vips_foreign_load_webp_buffer, ++ vips_foreign_load_webp_get_type()); + + static int +-vips_foreign_load_webp_buffer_build( VipsObject *object ) ++vips_foreign_load_webp_buffer_build(VipsObject *object) + { + VipsForeignLoadWebp *webp = (VipsForeignLoadWebp *) object; +- VipsForeignLoadWebpBuffer *buffer = ++ VipsForeignLoadWebpBuffer *buffer = + (VipsForeignLoadWebpBuffer *) object; + +- if( buffer->blob && +- !(webp->source = vips_source_new_from_memory( +- VIPS_AREA( buffer->blob )->data, +- VIPS_AREA( buffer->blob )->length )) ) +- return( -1 ); ++ if (buffer->blob && ++ !(webp->source = vips_source_new_from_memory( ++ VIPS_AREA(buffer->blob)->data, ++ VIPS_AREA(buffer->blob)->length))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_load_webp_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_load_webp_buffer_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static gboolean +-vips_foreign_load_webp_buffer_is_a_buffer( const void *buf, size_t len ) ++vips_foreign_load_webp_buffer_is_a_buffer(const void *buf, size_t len) + { + VipsSource *source; + gboolean result; + +- if( !(source = vips_source_new_from_memory( buf, len )) ) +- return( FALSE ); +- result = vips__iswebp_source( source ); +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_memory(buf, len))) ++ return (FALSE); ++ result = vips__iswebp_source(source); ++ VIPS_UNREF(source); + +- return( result ); ++ return (result); + } + + static void +-vips_foreign_load_webp_buffer_class_init( +- VipsForeignLoadWebpBufferClass *class ) ++vips_foreign_load_webp_buffer_class_init( ++ VipsForeignLoadWebpBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + +@@ -419,21 +412,21 @@ vips_foreign_load_webp_buffer_class_init( + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "webpload_buffer"; +- object_class->description = _( "load webp from buffer" ); ++ object_class->description = _("load webp from buffer"); + object_class->build = vips_foreign_load_webp_buffer_build; + +- load_class->is_a_buffer = vips_foreign_load_webp_buffer_is_a_buffer; ++ load_class->is_a_buffer = vips_foreign_load_webp_buffer_is_a_buffer; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignLoadWebpBuffer, blob ), +- VIPS_TYPE_BLOB ); ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsForeignLoadWebpBuffer, blob), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_load_webp_buffer_init( VipsForeignLoadWebpBuffer *buffer ) ++vips_foreign_load_webp_buffer_init(VipsForeignLoadWebpBuffer *buffer) + { + } + +@@ -451,36 +444,36 @@ vips_foreign_load_webp_buffer_init( VipsForeignLoadWebpBuffer *buffer ) + * * @n: %gint, load this many pages + * * @scale: %gdouble, scale by this much on load + * +- * Read a WebP file into a VIPS image. ++ * Read a WebP file into a VIPS image. + * + * Use @page to select a page to render, numbering from zero. + * + * Use @n to select the number of pages to render. The default is 1. Pages are + * rendered in a vertical column, with each individual page aligned to the +- * left. Set to -1 to mean "until the end of the document". Use vips_grid() ++ * left. Set to -1 to mean "until the end of the document". Use vips_grid() + * to change page layout. + * + * Use @scale to specify a scale-on-load factor. For example, 2.0 to double + * the size on load. Animated webp images don't support shrink-on-load, so a + * further resize may be necessary. + * +- * The loader supports ICC, EXIF and XMP metadata. ++ * The loader supports ICC, EXIF and XMP metadata. + * + * See also: vips_image_new_from_file(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_webpload( const char *filename, VipsImage **out, ... ) ++vips_webpload(const char *filename, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "webpload", ap, filename, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("webpload", ap, filename, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -497,17 +490,17 @@ vips_webpload( const char *filename, VipsImage **out, ... ) + * * @scale: %gdouble, scale by this much on load + * + * Read a WebP-formatted memory block into a VIPS image. Exactly as +- * vips_webpload(), but read from a memory buffer. ++ * vips_webpload(), but read from a memory buffer. + * +- * You must not free the buffer while @out is active. The +- * #VipsObject::postclose signal on @out is a good place to free. ++ * You must not free the buffer while @out is active. The ++ * #VipsObject::postclose signal on @out is a good place to free. + * + * See also: vips_webpload() + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_webpload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++vips_webpload_buffer(void *buf, size_t len, VipsImage **out, ...) + { + va_list ap; + VipsBlob *blob; +@@ -515,15 +508,15 @@ vips_webpload_buffer( void *buf, size_t len, VipsImage **out, ... ) + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, buf, len ); ++ blob = vips_blob_new(NULL, buf, len); + +- va_start( ap, out ); +- result = vips_call_split( "webpload_buffer", ap, blob, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("webpload_buffer", ap, blob, out); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( result ); ++ return (result); + } + + /** +@@ -538,21 +531,21 @@ vips_webpload_buffer( void *buf, size_t len, VipsImage **out, ... ) + * * @n: %gint, load this many pages + * * @scale: %gdouble, scale by this much on load + * +- * Exactly as vips_webpload(), but read from a source. ++ * Exactly as vips_webpload(), but read from a source. + * + * See also: vips_webpload() + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_webpload_source( VipsSource *source, VipsImage **out, ... ) ++vips_webpload_source(VipsSource *source, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "webpload_source", ap, source, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("webpload_source", ap, source, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/foreign/webpsave.c b/libvips/foreign/webpsave.c +index 1b388f8b75..ff9ec3676a 100644 +--- a/libvips/foreign/webpsave.c ++++ b/libvips/foreign/webpsave.c +@@ -36,28 +36,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -86,8 +86,8 @@ + #include + #include + +-typedef int (*webp_import)( WebPPicture *picture, +- const uint8_t *rgb, int stride ); ++typedef int (*webp_import)(WebPPicture *picture, ++ const uint8_t *rgb, int stride); + + typedef enum _VipsForeignSaveWebpMode { + VIPS_FOREIGN_SAVE_WEBP_MODE_SINGLE, +@@ -191,37 +191,36 @@ typedef struct _VipsForeignSaveWebp { + + typedef VipsForeignSaveClass VipsForeignSaveWebpClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsForeignSaveWebp, vips_foreign_save_webp, +- VIPS_TYPE_FOREIGN_SAVE ); ++G_DEFINE_ABSTRACT_TYPE(VipsForeignSaveWebp, vips_foreign_save_webp, ++ VIPS_TYPE_FOREIGN_SAVE); + + static void +-vips_foreign_save_webp_unset( VipsForeignSaveWebp *write ) ++vips_foreign_save_webp_unset(VipsForeignSaveWebp *write) + { +- WebPMemoryWriterClear( &write->memory_writer ); +- VIPS_FREEF( WebPAnimEncoderDelete, write->enc ); +- VIPS_FREEF( WebPMuxDelete, write->mux ); +- VIPS_UNREF( write->image ); ++ WebPMemoryWriterClear(&write->memory_writer); ++ VIPS_FREEF(WebPAnimEncoderDelete, write->enc); ++ VIPS_FREEF(WebPMuxDelete, write->mux); ++ VIPS_UNREF(write->image); + } + + static void +-vips_foreign_save_webp_dispose( GObject *gobject ) ++vips_foreign_save_webp_dispose(GObject *gobject) + { + VipsForeignSaveWebp *webp = (VipsForeignSaveWebp *) gobject; + +- VIPS_UNREF( webp->target ); ++ VIPS_UNREF(webp->target); + +- VIPS_FREE( webp->frame_bytes ); ++ VIPS_FREE(webp->frame_bytes); + +- G_OBJECT_CLASS( vips_foreign_save_webp_parent_class )-> +- dispose( gobject ); ++ G_OBJECT_CLASS(vips_foreign_save_webp_parent_class)->dispose(gobject); + } + + static gboolean +-vips_foreign_save_webp_pic_init( VipsForeignSaveWebp *write, WebPPicture *pic ) ++vips_foreign_save_webp_pic_init(VipsForeignSaveWebp *write, WebPPicture *pic) + { +- if( !WebPPictureInit( pic ) ) { +- vips_error( "webpsave", "%s", _( "picture version error" ) ); +- return( FALSE ); ++ if (!WebPPictureInit(pic)) { ++ vips_error("webpsave", "%s", _("picture version error")); ++ return (FALSE); + } + pic->writer = WebPMemoryWrite; + pic->custom_ptr = (void *) &write->memory_writer; +@@ -233,208 +232,206 @@ vips_foreign_save_webp_pic_init( VipsForeignSaveWebp *write, WebPPicture *pic ) + write->near_lossless || + write->smart_subsample; + +- return( TRUE ); ++ return (TRUE); + } + + /* Write a VipsImage into an unintialised pic. + */ + static int +-vips_foreign_save_webp_write_webp_image( VipsForeignSaveWebp *write, +- const VipsPel *imagedata, WebPPicture *pic ) ++vips_foreign_save_webp_write_webp_image(VipsForeignSaveWebp *write, ++ const VipsPel *imagedata, WebPPicture *pic) + { + webp_import import; +- int page_height = vips_image_get_page_height( write->image ); ++ int page_height = vips_image_get_page_height(write->image); + +- if( !vips_foreign_save_webp_pic_init( write, pic ) ) +- return( -1 ); ++ if (!vips_foreign_save_webp_pic_init(write, pic)) ++ return (-1); + + pic->width = write->image->Xsize; + pic->height = page_height; + +- if( write->image->Bands == 4 ) ++ if (write->image->Bands == 4) + import = WebPPictureImportRGBA; + else + import = WebPPictureImportRGB; + +- if( !import( pic, imagedata, +- write->image->Xsize * write->image->Bands ) ) { +- WebPPictureFree( pic ); +- vips_error( "webpsave", "%s", _( "picture memory error" ) ); +- return( -1 ); ++ if (!import(pic, imagedata, ++ write->image->Xsize * write->image->Bands)) { ++ WebPPictureFree(pic); ++ vips_error("webpsave", "%s", _("picture memory error")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* We have a complete frame --- write! + */ + static int +-vips_foreign_save_webp_write_frame( VipsForeignSaveWebp *webp) ++vips_foreign_save_webp_write_frame(VipsForeignSaveWebp *webp) + { + WebPPicture pic; +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( webp ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(webp); + +- if( vips_foreign_save_webp_write_webp_image( webp, webp->frame_bytes, +- &pic ) ) +- return( -1 ); ++ if (vips_foreign_save_webp_write_webp_image(webp, webp->frame_bytes, ++ &pic)) ++ return (-1); + + /* Animated write + */ +- if( webp->mode == VIPS_FOREIGN_SAVE_WEBP_MODE_ANIM ) { +- if( !WebPAnimEncoderAdd( webp->enc, +- &pic, webp->timestamp_ms, &webp->config ) ) { +- WebPPictureFree( &pic ); +- vips_error( class->nickname, +- "%s", _( "anim add error" ) ); +- return( -1 ); ++ if (webp->mode == VIPS_FOREIGN_SAVE_WEBP_MODE_ANIM) { ++ if (!WebPAnimEncoderAdd(webp->enc, ++ &pic, webp->timestamp_ms, &webp->config)) { ++ WebPPictureFree(&pic); ++ vips_error(class->nickname, ++ "%s", _("anim add error")); ++ return (-1); + } + /* Adjust current timestamp + */ +- if( webp->delay && +- webp->page_number < webp->delay_length ) ++ if (webp->delay && ++ webp->page_number < webp->delay_length) + webp->timestamp_ms += webp->delay[webp->page_number]; + else + webp->timestamp_ms += webp->gif_delay * 10; +- + } + else { + /* Single image write + */ +- if( !WebPEncode( &webp->config, &pic ) ) { +- WebPPictureFree( &pic ); +- vips_error( "webpsave", "%s", +- _( "unable to encode" ) ); +- return( -1 ); ++ if (!WebPEncode(&webp->config, &pic)) { ++ WebPPictureFree(&pic); ++ vips_error("webpsave", "%s", ++ _("unable to encode")); ++ return (-1); + } + } + +- WebPPictureFree( &pic ); ++ WebPPictureFree(&pic); + +- return( 0 ); ++ return (0); + } + + /* Another chunk of pixels have arrived from the pipeline. Add to frame, and + * if the frame completes, compress and write to the target. + */ + static int +-vips_foreign_save_webp_sink_disc( VipsRegion *region, VipsRect *area, void *a ) ++vips_foreign_save_webp_sink_disc(VipsRegion *region, VipsRect *area, void *a) + { +- VipsForeignSaveWebp *webp = (VipsForeignSaveWebp*) a; ++ VipsForeignSaveWebp *webp = (VipsForeignSaveWebp *) a; + int i; +- int page_height = vips_image_get_page_height( webp->image ); ++ int page_height = vips_image_get_page_height(webp->image); + + /* Write the new pixels into the frame. + */ +- for( i = 0; i < area->height; i++ ) { +- memcpy( webp->frame_bytes + area->width * +- webp->write_y * webp->image->Bands, +- VIPS_REGION_ADDR( region, 0, area->top + i ), +- area->width * webp->image->Bands ); ++ for (i = 0; i < area->height; i++) { ++ memcpy(webp->frame_bytes + area->width * webp->write_y * webp->image->Bands, ++ VIPS_REGION_ADDR(region, 0, area->top + i), ++ area->width * webp->image->Bands); + + webp->write_y += 1; + + /* If we've filled the frame, write and move it down. + */ +- if( webp->write_y == page_height ) { +- if( vips_foreign_save_webp_write_frame( webp ) ) +- return( -1 ); ++ if (webp->write_y == page_height) { ++ if (vips_foreign_save_webp_write_frame(webp)) ++ return (-1); + + webp->write_y = 0; + webp->page_number += 1; + } + } + +- return( 0 ); ++ return (0); + } + + static WebPPreset +-get_preset( VipsForeignWebpPreset preset ) ++get_preset(VipsForeignWebpPreset preset) + { +- switch( preset ) { ++ switch (preset) { + case VIPS_FOREIGN_WEBP_PRESET_DEFAULT: +- return( WEBP_PRESET_DEFAULT ); ++ return (WEBP_PRESET_DEFAULT); + case VIPS_FOREIGN_WEBP_PRESET_PICTURE: +- return( WEBP_PRESET_PICTURE ); ++ return (WEBP_PRESET_PICTURE); + case VIPS_FOREIGN_WEBP_PRESET_PHOTO: +- return( WEBP_PRESET_PHOTO ); ++ return (WEBP_PRESET_PHOTO); + case VIPS_FOREIGN_WEBP_PRESET_DRAWING: +- return( WEBP_PRESET_DRAWING ); ++ return (WEBP_PRESET_DRAWING); + case VIPS_FOREIGN_WEBP_PRESET_ICON: +- return( WEBP_PRESET_ICON ); ++ return (WEBP_PRESET_ICON); + case VIPS_FOREIGN_WEBP_PRESET_TEXT: +- return( WEBP_PRESET_TEXT ); ++ return (WEBP_PRESET_TEXT); + + default: + g_assert_not_reached(); + } + + /* Keep -Wall happy. +- */ +- return( -1 ); ++ */ ++ return (-1); + } + + static void +-vips_webp_set_count( VipsForeignSaveWebp *write, int loop_count ) ++vips_webp_set_count(VipsForeignSaveWebp *write, int loop_count) + { + uint32_t features; + +- if( WebPMuxGetFeatures( write->mux, &features ) == WEBP_MUX_OK && +- (features & ANIMATION_FLAG) ) { ++ if (WebPMuxGetFeatures(write->mux, &features) == WEBP_MUX_OK && ++ (features & ANIMATION_FLAG)) { + WebPMuxAnimParams params; + +- if( WebPMuxGetAnimationParams( write->mux, ¶ms ) == +- WEBP_MUX_OK ) { ++ if (WebPMuxGetAnimationParams(write->mux, ¶ms) == ++ WEBP_MUX_OK) { + params.loop_count = loop_count; +- WebPMuxSetAnimationParams( write->mux, ¶ms ); ++ WebPMuxSetAnimationParams(write->mux, ¶ms); + } + } + } + + static int +-vips_webp_set_chunk( VipsForeignSaveWebp *write, +- const char *webp_name, const void *data, size_t length ) ++vips_webp_set_chunk(VipsForeignSaveWebp *write, ++ const char *webp_name, const void *data, size_t length) + { + WebPData chunk; + + chunk.bytes = data; + chunk.size = length; + +- if( WebPMuxSetChunk( write->mux, webp_name, &chunk, 1 ) != +- WEBP_MUX_OK ) { +- vips_error( "webpsave", +- "%s", _( "chunk add error" ) ); +- return( -1 ); ++ if (WebPMuxSetChunk(write->mux, webp_name, &chunk, 1) != ++ WEBP_MUX_OK) { ++ vips_error("webpsave", ++ "%s", _("chunk add error")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_webp_add_chunks( VipsForeignSaveWebp *write ) ++vips_webp_add_chunks(VipsForeignSaveWebp *write) + { + int i; + +- for( i = 0; i < vips__n_webp_names; i++ ) { ++ for (i = 0; i < vips__n_webp_names; i++) { + const char *vips_name = vips__webp_names[i].vips; + const char *webp_name = vips__webp_names[i].webp; + +- if( vips_image_get_typeof( write->image, vips_name ) ) { ++ if (vips_image_get_typeof(write->image, vips_name)) { + const void *data; + size_t length; + +- if( vips_image_get_blob( write->image, +- vips_name, &data, &length ) || +- vips_webp_set_chunk( write, +- webp_name, data, length ) ) +- return( -1 ); ++ if (vips_image_get_blob(write->image, ++ vips_name, &data, &length) || ++ vips_webp_set_chunk(write, ++ webp_name, data, length)) ++ return (-1); + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_webp_add_metadata( VipsForeignSaveWebp *write ) ++vips_webp_add_metadata(VipsForeignSaveWebp *write) + { + WebPData data; + +@@ -443,131 +440,133 @@ vips_webp_add_metadata( VipsForeignSaveWebp *write ) + + /* Parse what we have. + */ +- if( !(write->mux = WebPMuxCreate( &data, 1 )) ) { +- vips_error( "webpsave", "%s", _( "mux error" ) ); +- return( -1 ); ++ if (!(write->mux = WebPMuxCreate(&data, 1))) { ++ vips_error("webpsave", "%s", _("mux error")); ++ return (-1); + } + +- if( vips_image_get_typeof( write->image, "loop" ) ) { ++ if (vips_image_get_typeof(write->image, "loop")) { + int loop; + +- if( vips_image_get_int( write->image, "loop", &loop ) ) +- return( -1 ); ++ if (vips_image_get_int(write->image, "loop", &loop)) ++ return (-1); + +- vips_webp_set_count( write, loop ); ++ vips_webp_set_count(write, loop); + } + /* DEPRECATED "gif-loop" + */ +- else if ( vips_image_get_typeof( write->image, "gif-loop" ) ) { ++ else if (vips_image_get_typeof(write->image, "gif-loop")) { + int gif_loop; + +- if( vips_image_get_int( write->image, "gif-loop", &gif_loop ) ) +- return( -1 ); ++ if (vips_image_get_int(write->image, "gif-loop", &gif_loop)) ++ return (-1); + +- vips_webp_set_count( write, gif_loop == 0 ? 0 : gif_loop + 1 ); ++ vips_webp_set_count(write, gif_loop == 0 ? 0 : gif_loop + 1); + } + + /* Add extra metadata. + */ +- if( !write->strip ) { ++ if (!write->strip) { + /* We need to rebuild exif from the other image tags before + * writing the metadata. + */ +- if( vips__exif_update( write->image ) ) +- return( -1 ); ++ if (vips__exif_update(write->image)) ++ return (-1); + + /* Override profile. + */ +- if( write->profile && +- vips__profile_set( write->image, write->profile ) ) +- return( -1 ); ++ if (write->profile && ++ vips__profile_set(write->image, write->profile)) ++ return (-1); + +- if( vips_webp_add_chunks( write ) ) +- return( -1 ); ++ if (vips_webp_add_chunks(write)) ++ return (-1); + } + +- if( WebPMuxAssemble( write->mux, &data ) != WEBP_MUX_OK ) { +- vips_error( "webpsave", "%s", _( "mux error" ) ); +- return( -1 ); ++ if (WebPMuxAssemble(write->mux, &data) != WEBP_MUX_OK) { ++ vips_error("webpsave", "%s", _("mux error")); ++ return (-1); + } + + /* Free old stuff, reinit with new stuff. + */ +- WebPMemoryWriterClear( &write->memory_writer ); ++ WebPMemoryWriterClear(&write->memory_writer); + write->memory_writer.mem = (uint8_t *) data.bytes; + write->memory_writer.size = data.size; + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_webp_init_config( VipsForeignSaveWebp *webp ) { ++vips_foreign_save_webp_init_config(VipsForeignSaveWebp *webp) ++{ + /* Init WebP config. + */ +- WebPMemoryWriterInit( &webp->memory_writer ); +- if( !WebPConfigInit( &webp->config ) ) { +- vips_foreign_save_webp_unset( webp ); +- vips_error( "webpsave", +- "%s", _( "config version error" ) ); +- return( -1 ); ++ WebPMemoryWriterInit(&webp->memory_writer); ++ if (!WebPConfigInit(&webp->config)) { ++ vips_foreign_save_webp_unset(webp); ++ vips_error("webpsave", ++ "%s", _("config version error")); ++ return (-1); + } + + /* These presets are only for lossy compression. There seems to be + * separate API for lossless or near-lossless, see + * WebPConfigLosslessPreset(). + */ +- if( !(webp->lossless || webp->near_lossless) && +- !WebPConfigPreset( &webp->config, get_preset( webp->preset ), +- webp->Q ) ) { +- vips_foreign_save_webp_unset( webp ); +- vips_error( "webpsave", "%s", _( "config version error" ) ); +- return( -1 ); ++ if (!(webp->lossless || webp->near_lossless) && ++ !WebPConfigPreset(&webp->config, get_preset(webp->preset), ++ webp->Q)) { ++ vips_foreign_save_webp_unset(webp); ++ vips_error("webpsave", "%s", _("config version error")); ++ return (-1); + } + + webp->config.lossless = webp->lossless || webp->near_lossless; + webp->config.alpha_quality = webp->alpha_q; + webp->config.method = webp->effort; + +- if( webp->lossless ) ++ if (webp->lossless) + webp->config.quality = webp->Q; +- if( webp->near_lossless ) ++ if (webp->near_lossless) + webp->config.near_lossless = webp->Q; +- if( webp->smart_subsample ) ++ if (webp->smart_subsample) + webp->config.use_sharp_yuv = 1; + +- if( !WebPValidateConfig( &webp->config ) ) { +- vips_foreign_save_webp_unset( webp ); +- vips_error( "webpsave", "%s", _( "invalid configuration" ) ); +- return( -1 ); ++ if (!WebPValidateConfig(&webp->config)) { ++ vips_foreign_save_webp_unset(webp); ++ vips_error("webpsave", "%s", _("invalid configuration")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_webp_init_anim_enc( VipsForeignSaveWebp *webp ) { ++vips_foreign_save_webp_init_anim_enc(VipsForeignSaveWebp *webp) ++{ + WebPAnimEncoderOptions anim_config; + int i; +- int page_height = vips_image_get_page_height( webp->image ); ++ int page_height = vips_image_get_page_height(webp->image); + + /* Init config for animated write + */ +- if( !WebPAnimEncoderOptionsInit( &anim_config ) ) { +- vips_error( "webpsave", +- "%s", _( "config version error" ) ); +- return( -1 ); ++ if (!WebPAnimEncoderOptionsInit(&anim_config)) { ++ vips_error("webpsave", ++ "%s", _("config version error")); ++ return (-1); + } + + anim_config.minimize_size = webp->min_size; + anim_config.allow_mixed = webp->mixed; + anim_config.kmin = webp->kmin; + anim_config.kmax = webp->kmax; +- webp->enc = WebPAnimEncoderNew( webp->image->Xsize, page_height, +- &anim_config ); +- if( !webp->enc ) { +- vips_error( "webpsave", +- "%s", _( "unable to init animation" ) ); +- return( -1 ); ++ webp->enc = WebPAnimEncoderNew(webp->image->Xsize, page_height, ++ &anim_config); ++ if (!webp->enc) { ++ vips_error("webpsave", ++ "%s", _("unable to init animation")); ++ return (-1); + } + + /* Get delay array +@@ -575,147 +574,147 @@ vips_foreign_save_webp_init_anim_enc( VipsForeignSaveWebp *webp ) { + * There might just be the old gif-delay field. This is centiseconds. + */ + webp->gif_delay = 10; +- if( vips_image_get_typeof( webp->image, "gif-delay" ) && +- vips_image_get_int( webp->image, "gif-delay", +- &webp->gif_delay ) ) +- return( -1 ); ++ if (vips_image_get_typeof(webp->image, "gif-delay") && ++ vips_image_get_int(webp->image, "gif-delay", ++ &webp->gif_delay)) ++ return (-1); + + /* New images have an array of ints instead. +- */ ++ */ + webp->delay = NULL; +- if( vips_image_get_typeof( webp->image, "delay" ) && +- vips_image_get_array_int( webp->image, "delay", +- &webp->delay, &webp->delay_length ) ) +- return( -1 ); ++ if (vips_image_get_typeof(webp->image, "delay") && ++ vips_image_get_array_int(webp->image, "delay", ++ &webp->delay, &webp->delay_length)) ++ return (-1); + + /* Force frames with a small or no duration to 100ms + * to be consistent with web browsers and other + * transcoding tools. + */ +- if( webp->gif_delay <= 1 ) ++ if (webp->gif_delay <= 1) + webp->gif_delay = 10; + +- for( i = 0; i < webp->delay_length; i++ ) +- if( webp->delay[i] <= 10 ) ++ for (i = 0; i < webp->delay_length; i++) ++ if (webp->delay[i] <= 10) + webp->delay[i] = 100; + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_webp_finish_anim( VipsForeignSaveWebp *webp ) { ++vips_foreign_save_webp_finish_anim(VipsForeignSaveWebp *webp) ++{ + WebPData webp_data; + + /* Closes animated encoder and adds last frame delay. + */ +- if( !WebPAnimEncoderAdd( webp->enc, +- NULL, webp->timestamp_ms, NULL ) ) { +- vips_error( "webpsave", +- "%s", _( "anim close error" ) ); +- return( -1 ); ++ if (!WebPAnimEncoderAdd(webp->enc, ++ NULL, webp->timestamp_ms, NULL)) { ++ vips_error("webpsave", ++ "%s", _("anim close error")); ++ return (-1); + } + +- if( !WebPAnimEncoderAssemble( webp->enc, &webp_data ) ) { +- vips_error( "webpsave", +- "%s", _( "anim build error" ) ); +- return( -1 ); ++ if (!WebPAnimEncoderAssemble(webp->enc, &webp_data)) { ++ vips_error("webpsave", ++ "%s", _("anim build error")); ++ return (-1); + } + + /* Terrible. This will only work if the output buffer is currently + * empty. + */ +- if( webp->memory_writer.mem != NULL ) { +- vips_error( "webpsave", "%s", _( "internal error" ) ); +- return( -1 ); ++ if (webp->memory_writer.mem != NULL) { ++ vips_error("webpsave", "%s", _("internal error")); ++ return (-1); + } + + webp->memory_writer.mem = (uint8_t *) webp_data.bytes; + webp->memory_writer.size = webp_data.size; + +- return( 0 ); ++ return (0); + } + + static int +-vips_foreign_save_webp_build( VipsObject *object ) ++vips_foreign_save_webp_build(VipsObject *object) + { + VipsForeignSave *save = (VipsForeignSave *) object; + VipsForeignSaveWebp *webp = (VipsForeignSaveWebp *) object; + + int page_height; + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_webp_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_webp_parent_class)->build(object)) ++ return (-1); + +- page_height = vips_image_get_page_height( save->ready ); +- if( save->ready->Xsize > 16383 || page_height > 16383 ) { +- vips_error( "webpsave", _( "image too large" ) ); +- vips_foreign_save_webp_unset( webp ); +- return( -1 ); ++ page_height = vips_image_get_page_height(save->ready); ++ if (save->ready->Xsize > 16383 || page_height > 16383) { ++ vips_error("webpsave", _("image too large")); ++ vips_foreign_save_webp_unset(webp); ++ return (-1); + } + + /* We need a copy of the input image in case we change the metadata + * eg. in vips__exif_update(). + */ +- if( vips_copy( save->ready, &webp->image, NULL ) ) { +- vips_foreign_save_webp_unset( webp ); +- return( -1 ); ++ if (vips_copy(save->ready, &webp->image, NULL)) { ++ vips_foreign_save_webp_unset(webp); ++ return (-1); + } + + /* RGB(A) frame as a contiguous buffer. + */ + size_t frame_size = (size_t) webp->image->Bands * webp->image->Xsize * page_height; +- webp->frame_bytes = g_try_malloc( frame_size ); +- if( webp->frame_bytes == NULL ) { +- vips_error( "webpsave", _( "failed to allocate %zu bytes" ), frame_size ); +- vips_foreign_save_webp_unset( webp ); +- return( -1 ); ++ webp->frame_bytes = g_try_malloc(frame_size); ++ if (webp->frame_bytes == NULL) { ++ vips_error("webpsave", _("failed to allocate %zu bytes"), frame_size); ++ vips_foreign_save_webp_unset(webp); ++ return (-1); + } + + /* Init generic WebP config + */ +- if( vips_foreign_save_webp_init_config( webp ) ) +- return( -1 ); ++ if (vips_foreign_save_webp_init_config(webp)) ++ return (-1); + + /* Determine the write mode (single image or animated write) + */ + webp->mode = VIPS_FOREIGN_SAVE_WEBP_MODE_SINGLE; +- if( page_height != webp->image->Ysize ) ++ if (page_height != webp->image->Ysize) + webp->mode = VIPS_FOREIGN_SAVE_WEBP_MODE_ANIM; + + /* Init config for animated write (if necessary) + */ +- if( webp->mode == VIPS_FOREIGN_SAVE_WEBP_MODE_ANIM ) +- if( vips_foreign_save_webp_init_anim_enc( webp ) ) +- return( -1 ); ++ if (webp->mode == VIPS_FOREIGN_SAVE_WEBP_MODE_ANIM) ++ if (vips_foreign_save_webp_init_anim_enc(webp)) ++ return (-1); + +- if( vips_sink_disc( webp->image, +- vips_foreign_save_webp_sink_disc, webp ) ) +- return( -1 ); ++ if (vips_sink_disc(webp->image, ++ vips_foreign_save_webp_sink_disc, webp)) ++ return (-1); + + /* Finish animated write + */ +- if( webp->mode == VIPS_FOREIGN_SAVE_WEBP_MODE_ANIM ) +- if( vips_foreign_save_webp_finish_anim( webp ) ) +- return( -1 ); ++ if (webp->mode == VIPS_FOREIGN_SAVE_WEBP_MODE_ANIM) ++ if (vips_foreign_save_webp_finish_anim(webp)) ++ return (-1); + +- if( vips_webp_add_metadata( webp ) ) { +- vips_foreign_save_webp_unset( webp ); +- return( -1 ); ++ if (vips_webp_add_metadata(webp)) { ++ vips_foreign_save_webp_unset(webp); ++ return (-1); + } + +- if( vips_target_write( webp->target, +- webp->memory_writer.mem, webp->memory_writer.size ) ) { +- vips_foreign_save_webp_unset( webp ); +- return( -1 ); ++ if (vips_target_write(webp->target, ++ webp->memory_writer.mem, webp->memory_writer.size)) { ++ vips_foreign_save_webp_unset(webp); ++ return (-1); + } + +- if( vips_target_end( webp->target ) ) +- return( -1 ); ++ if (vips_target_end(webp->target)) ++ return (-1); + +- vips_foreign_save_webp_unset( webp ); ++ vips_foreign_save_webp_unset(webp); + +- return( 0 ); ++ return (0); + } + + static const char *vips__save_webp_suffs[] = { ".webp", NULL }; +@@ -730,9 +729,9 @@ static VipsBandFormat bandfmt_webp[10] = { + }; + + static void +-vips_foreign_save_webp_class_init( VipsForeignSaveWebpClass *class ) ++vips_foreign_save_webp_class_init(VipsForeignSaveWebpClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsForeignClass *foreign_class = (VipsForeignClass *) class; + VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class; +@@ -742,7 +741,7 @@ vips_foreign_save_webp_class_init( VipsForeignSaveWebpClass *class ) + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "webpsave_base"; +- object_class->description = _( "save as WebP" ); ++ object_class->description = _("save as WebP"); + object_class->build = vips_foreign_save_webp_build; + + foreign_class->suffs = vips__save_webp_suffs; +@@ -750,101 +749,101 @@ vips_foreign_save_webp_class_init( VipsForeignSaveWebpClass *class ) + save_class->saveable = VIPS_SAVEABLE_RGBA_ONLY; + save_class->format_table = bandfmt_webp; + +- VIPS_ARG_INT( class, "Q", 10, +- _( "Q" ), +- _( "Q factor" ), ++ VIPS_ARG_INT(class, "Q", 10, ++ _("Q"), ++ _("Q factor"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveWebp, Q ), +- 0, 100, 75 ); ++ G_STRUCT_OFFSET(VipsForeignSaveWebp, Q), ++ 0, 100, 75); + +- VIPS_ARG_BOOL( class, "lossless", 11, +- _( "Lossless" ), +- _( "Enable lossless compression" ), ++ VIPS_ARG_BOOL(class, "lossless", 11, ++ _("Lossless"), ++ _("Enable lossless compression"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveWebp, lossless ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveWebp, lossless), ++ FALSE); + +- VIPS_ARG_ENUM( class, "preset", 12, +- _( "Preset" ), +- _( "Preset for lossy compression" ), ++ VIPS_ARG_ENUM(class, "preset", 12, ++ _("Preset"), ++ _("Preset for lossy compression"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveWebp, preset ), ++ G_STRUCT_OFFSET(VipsForeignSaveWebp, preset), + VIPS_TYPE_FOREIGN_WEBP_PRESET, +- VIPS_FOREIGN_WEBP_PRESET_DEFAULT ); ++ VIPS_FOREIGN_WEBP_PRESET_DEFAULT); + +- VIPS_ARG_BOOL( class, "smart_subsample", 13, +- _( "Smart subsampling" ), +- _( "Enable high quality chroma subsampling" ), ++ VIPS_ARG_BOOL(class, "smart_subsample", 13, ++ _("Smart subsampling"), ++ _("Enable high quality chroma subsampling"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveWebp, smart_subsample ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveWebp, smart_subsample), ++ FALSE); + +- VIPS_ARG_BOOL( class, "near_lossless", 14, +- _( "Near lossless" ), +- _( "Enable preprocessing in lossless mode (uses Q)" ), ++ VIPS_ARG_BOOL(class, "near_lossless", 14, ++ _("Near lossless"), ++ _("Enable preprocessing in lossless mode (uses Q)"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveWebp, near_lossless ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveWebp, near_lossless), ++ FALSE); + +- VIPS_ARG_INT( class, "alpha_q", 15, +- _( "Alpha quality" ), +- _( "Change alpha plane fidelity for lossy compression" ), ++ VIPS_ARG_INT(class, "alpha_q", 15, ++ _("Alpha quality"), ++ _("Change alpha plane fidelity for lossy compression"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveWebp, alpha_q ), +- 0, 100, 100 ); ++ G_STRUCT_OFFSET(VipsForeignSaveWebp, alpha_q), ++ 0, 100, 100); + +- VIPS_ARG_BOOL( class, "min_size", 16, +- _( "Minimise size" ), +- _( "Optimise for minimum size" ), ++ VIPS_ARG_BOOL(class, "min_size", 16, ++ _("Minimise size"), ++ _("Optimise for minimum size"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveWebp, min_size ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveWebp, min_size), ++ FALSE); + +- VIPS_ARG_INT( class, "kmin", 17, +- _( "Minimum keyframe spacing" ), +- _( "Minimum number of frames between key frames" ), ++ VIPS_ARG_INT(class, "kmin", 17, ++ _("Minimum keyframe spacing"), ++ _("Minimum number of frames between key frames"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveWebp, kmin ), +- 0, INT_MAX, INT_MAX - 1 ); ++ G_STRUCT_OFFSET(VipsForeignSaveWebp, kmin), ++ 0, INT_MAX, INT_MAX - 1); + +- VIPS_ARG_INT( class, "kmax", 18, +- _( "Maximum keyframe spacing" ), +- _( "Maximum number of frames between key frames" ), ++ VIPS_ARG_INT(class, "kmax", 18, ++ _("Maximum keyframe spacing"), ++ _("Maximum number of frames between key frames"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveWebp, kmax ), +- 0, INT_MAX, INT_MAX ); ++ G_STRUCT_OFFSET(VipsForeignSaveWebp, kmax), ++ 0, INT_MAX, INT_MAX); + +- VIPS_ARG_INT( class, "effort", 19, +- _( "Effort" ), +- _( "Level of CPU effort to reduce file size" ), ++ VIPS_ARG_INT(class, "effort", 19, ++ _("Effort"), ++ _("Level of CPU effort to reduce file size"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveWebp, effort ), +- 0, 6, 4 ); ++ G_STRUCT_OFFSET(VipsForeignSaveWebp, effort), ++ 0, 6, 4); + +- VIPS_ARG_STRING( class, "profile", 20, +- _( "Profile" ), +- _( "ICC profile to embed" ), ++ VIPS_ARG_STRING(class, "profile", 20, ++ _("Profile"), ++ _("ICC profile to embed"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveWebp, profile ), +- NULL ); ++ G_STRUCT_OFFSET(VipsForeignSaveWebp, profile), ++ NULL); + +- VIPS_ARG_INT( class, "reduction_effort", 21, +- _( "Reduction effort" ), +- _( "Level of CPU effort to reduce file size" ), ++ VIPS_ARG_INT(class, "reduction_effort", 21, ++ _("Reduction effort"), ++ _("Level of CPU effort to reduce file size"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsForeignSaveWebp, effort ), +- 0, 6, 4 ); ++ G_STRUCT_OFFSET(VipsForeignSaveWebp, effort), ++ 0, 6, 4); + +- VIPS_ARG_BOOL( class, "mixed", 22, +- _( "Mixed encoding" ), +- _( "Allow mixed encoding (might reduce file size)" ), ++ VIPS_ARG_BOOL(class, "mixed", 22, ++ _("Mixed encoding"), ++ _("Allow mixed encoding (might reduce file size)"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveWebp, mixed ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsForeignSaveWebp, mixed), ++ FALSE); + } + + static void +-vips_foreign_save_webp_init( VipsForeignSaveWebp *webp ) ++vips_foreign_save_webp_init(VipsForeignSaveWebp *webp) + { + webp->Q = 75; + webp->alpha_q = 100; +@@ -864,31 +863,30 @@ typedef struct _VipsForeignSaveWebpTarget { + + typedef VipsForeignSaveWebpClass VipsForeignSaveWebpTargetClass; + +-G_DEFINE_TYPE( VipsForeignSaveWebpTarget, vips_foreign_save_webp_target, +- vips_foreign_save_webp_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveWebpTarget, vips_foreign_save_webp_target, ++ vips_foreign_save_webp_get_type()); + + static int +-vips_foreign_save_webp_target_build( VipsObject *object ) ++vips_foreign_save_webp_target_build(VipsObject *object) + { + VipsForeignSaveWebp *webp = (VipsForeignSaveWebp *) object; + VipsForeignSaveWebpTarget *target = + (VipsForeignSaveWebpTarget *) object; + + webp->target = target->target; +- g_object_ref( webp->target ); ++ g_object_ref(webp->target); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_webp_target_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_webp_target_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void + vips_foreign_save_webp_target_class_init( +- VipsForeignSaveWebpTargetClass *class ) ++ VipsForeignSaveWebpTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -897,17 +895,16 @@ vips_foreign_save_webp_target_class_init( + object_class->nickname = "webpsave_target"; + object_class->build = vips_foreign_save_webp_target_build; + +- VIPS_ARG_OBJECT( class, "target", 1, +- _( "Target" ), +- _( "Target to save to" ), ++ VIPS_ARG_OBJECT(class, "target", 1, ++ _("Target"), ++ _("Target to save to"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveWebpTarget, target ), +- VIPS_TYPE_TARGET ); +- ++ G_STRUCT_OFFSET(VipsForeignSaveWebpTarget, target), ++ VIPS_TYPE_TARGET); + } + + static void +-vips_foreign_save_webp_target_init( VipsForeignSaveWebpTarget *target ) ++vips_foreign_save_webp_target_init(VipsForeignSaveWebpTarget *target) + { + } + +@@ -918,29 +915,28 @@ typedef struct _VipsForeignSaveWebpFile { + + typedef VipsForeignSaveWebpClass VipsForeignSaveWebpFileClass; + +-G_DEFINE_TYPE( VipsForeignSaveWebpFile, vips_foreign_save_webp_file, +- vips_foreign_save_webp_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveWebpFile, vips_foreign_save_webp_file, ++ vips_foreign_save_webp_get_type()); + + static int +-vips_foreign_save_webp_file_build( VipsObject *object ) ++vips_foreign_save_webp_file_build(VipsObject *object) + { + VipsForeignSaveWebp *webp = (VipsForeignSaveWebp *) object; + VipsForeignSaveWebpFile *file = (VipsForeignSaveWebpFile *) object; + +- if( !(webp->target = vips_target_new_to_file( file->filename )) ) +- return( -1 ); ++ if (!(webp->target = vips_target_new_to_file(file->filename))) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_webp_file_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_webp_file_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_webp_file_class_init( VipsForeignSaveWebpFileClass *class ) ++vips_foreign_save_webp_file_class_init(VipsForeignSaveWebpFileClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -949,16 +945,16 @@ vips_foreign_save_webp_file_class_init( VipsForeignSaveWebpFileClass *class ) + object_class->nickname = "webpsave"; + object_class->build = vips_foreign_save_webp_file_build; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to save to" ), ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to save to"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsForeignSaveWebpFile, filename ), +- NULL ); ++ G_STRUCT_OFFSET(VipsForeignSaveWebpFile, filename), ++ NULL); + } + + static void +-vips_foreign_save_webp_file_init( VipsForeignSaveWebpFile *file ) ++vips_foreign_save_webp_file_init(VipsForeignSaveWebpFile *file) + { + } + +@@ -969,11 +965,11 @@ typedef struct _VipsForeignSaveWebpBuffer { + + typedef VipsForeignSaveWebpClass VipsForeignSaveWebpBufferClass; + +-G_DEFINE_TYPE( VipsForeignSaveWebpBuffer, vips_foreign_save_webp_buffer, +- vips_foreign_save_webp_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveWebpBuffer, vips_foreign_save_webp_buffer, ++ vips_foreign_save_webp_get_type()); + + static int +-vips_foreign_save_webp_buffer_build( VipsObject *object ) ++vips_foreign_save_webp_buffer_build(VipsObject *object) + { + VipsForeignSaveWebp *webp = (VipsForeignSaveWebp *) object; + VipsForeignSaveWebpBuffer *buffer = +@@ -981,25 +977,24 @@ vips_foreign_save_webp_buffer_build( VipsObject *object ) + + VipsBlob *blob; + +- if( !(webp->target = vips_target_new_to_memory()) ) +- return( -1 ); ++ if (!(webp->target = vips_target_new_to_memory())) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_webp_buffer_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_webp_buffer_parent_class)->build(object)) ++ return (-1); + +- g_object_get( webp->target, "blob", &blob, NULL ); +- g_object_set( buffer, "buffer", blob, NULL ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ g_object_get(webp->target, "blob", &blob, NULL); ++ g_object_set(buffer, "buffer", blob, NULL); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( 0 ); ++ return (0); + } + + static void + vips_foreign_save_webp_buffer_class_init( +- VipsForeignSaveWebpBufferClass *class ) ++ VipsForeignSaveWebpBufferClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -1008,16 +1003,16 @@ vips_foreign_save_webp_buffer_class_init( + object_class->nickname = "webpsave_buffer"; + object_class->build = vips_foreign_save_webp_buffer_build; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to save to" ), ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to save to"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsForeignSaveWebpBuffer, buf ), +- VIPS_TYPE_BLOB ); ++ G_STRUCT_OFFSET(VipsForeignSaveWebpBuffer, buf), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_foreign_save_webp_buffer_init( VipsForeignSaveWebpBuffer *buffer ) ++vips_foreign_save_webp_buffer_init(VipsForeignSaveWebpBuffer *buffer) + { + } + +@@ -1028,11 +1023,11 @@ typedef struct _VipsForeignSaveWebpMime { + + typedef VipsForeignSaveWebpClass VipsForeignSaveWebpMimeClass; + +-G_DEFINE_TYPE( VipsForeignSaveWebpMime, vips_foreign_save_webp_mime, +- vips_foreign_save_webp_get_type() ); ++G_DEFINE_TYPE(VipsForeignSaveWebpMime, vips_foreign_save_webp_mime, ++ vips_foreign_save_webp_get_type()); + + static int +-vips_foreign_save_webp_mime_build( VipsObject *object ) ++vips_foreign_save_webp_mime_build(VipsObject *object) + { + VipsForeignSaveWebp *webp = (VipsForeignSaveWebp *) object; + +@@ -1040,42 +1035,40 @@ vips_foreign_save_webp_mime_build( VipsObject *object ) + void *data; + size_t len; + +- if( !(webp->target = vips_target_new_to_memory()) ) +- return( -1 ); ++ if (!(webp->target = vips_target_new_to_memory())) ++ return (-1); + +- if( VIPS_OBJECT_CLASS( vips_foreign_save_webp_mime_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_foreign_save_webp_mime_parent_class)->build(object)) ++ return (-1); + +- g_object_get( webp->target, "blob", &blob, NULL ); +- data = VIPS_AREA( blob )->data; +- len = VIPS_AREA( blob )->length; +- vips_area_unref( VIPS_AREA( blob ) ); ++ g_object_get(webp->target, "blob", &blob, NULL); ++ data = VIPS_AREA(blob)->data; ++ len = VIPS_AREA(blob)->length; ++ vips_area_unref(VIPS_AREA(blob)); + +- printf( "Content-length: %zu\r\n", len ); +- printf( "Content-type: image/webp\r\n" ); +- printf( "\r\n" ); +- (void) fwrite( data, sizeof( char ), len, stdout ); +- fflush( stdout ); ++ printf("Content-length: %zu\r\n", len); ++ printf("Content-type: image/webp\r\n"); ++ printf("\r\n"); ++ (void) fwrite(data, sizeof(char), len, stdout); ++ fflush(stdout); + +- VIPS_UNREF( webp->target ); ++ VIPS_UNREF(webp->target); + +- return( 0 ); ++ return (0); + } + + static void +-vips_foreign_save_webp_mime_class_init( VipsForeignSaveWebpMimeClass *class ) ++vips_foreign_save_webp_mime_class_init(VipsForeignSaveWebpMimeClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; + + object_class->nickname = "webpsave_mime"; +- object_class->description = _( "save image to webp mime" ); ++ object_class->description = _("save image to webp mime"); + object_class->build = vips_foreign_save_webp_mime_build; +- + } + + static void +-vips_foreign_save_webp_mime_init( VipsForeignSaveWebpMime *mime ) ++vips_foreign_save_webp_mime_init(VipsForeignSaveWebpMime *mime) + { + } + +@@ -1150,16 +1143,16 @@ vips_foreign_save_webp_mime_init( VipsForeignSaveWebpMime *mime ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_webpsave( VipsImage *in, const char *filename, ... ) ++vips_webpsave(VipsImage *in, const char *filename, ...) + { + va_list ap; + int result; + +- va_start( ap, filename ); +- result = vips_call_split( "webpsave", ap, in, filename ); +- va_end( ap ); ++ va_start(ap, filename); ++ result = vips_call_split("webpsave", ap, in, filename); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -1196,7 +1189,7 @@ vips_webpsave( VipsImage *in, const char *filename, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_webpsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++vips_webpsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + { + va_list ap; + VipsArea *area; +@@ -1204,23 +1197,23 @@ vips_webpsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) + + area = NULL; + +- va_start( ap, len ); +- result = vips_call_split( "webpsave_buffer", ap, in, &area ); +- va_end( ap ); ++ va_start(ap, len); ++ result = vips_call_split("webpsave_buffer", ap, in, &area); ++ va_end(ap); + +- if( !result && +- area ) { +- if( buf ) { ++ if (!result && ++ area) { ++ if (buf) { + *buf = area->data; + area->free_fn = NULL; + } +- if( len ) ++ if (len) + *len = area->length; + +- vips_area_unref( area ); ++ vips_area_unref(area); + } + +- return( result ); ++ return (result); + } + + /** +@@ -1251,16 +1244,16 @@ vips_webpsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_webpsave_mime( VipsImage *in, ... ) ++vips_webpsave_mime(VipsImage *in, ...) + { + va_list ap; + int result; + +- va_start( ap, in ); +- result = vips_call_split( "webpsave_mime", ap, in ); +- va_end( ap ); ++ va_start(ap, in); ++ result = vips_call_split("webpsave_mime", ap, in); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -1292,14 +1285,14 @@ vips_webpsave_mime( VipsImage *in, ... ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_webpsave_target( VipsImage *in, VipsTarget *target, ... ) ++vips_webpsave_target(VipsImage *in, VipsTarget *target, ...) + { + va_list ap; + int result; + +- va_start( ap, target ); +- result = vips_call_split( "webpsave_target", ap, in, target ); +- va_end( ap ); ++ va_start(ap, target); ++ result = vips_call_split("webpsave_target", ap, in, target); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/freqfilt/freqfilt.c b/libvips/freqfilt/freqfilt.c +index fa6d801e5d..96ff82b622 100644 +--- a/libvips/freqfilt/freqfilt.c ++++ b/libvips/freqfilt/freqfilt.c +@@ -1,4 +1,4 @@ +-/* base class for all Fourier stuff ++/* base class for all Fourier stuff + * + * properties: + * - single output image +@@ -6,28 +6,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -60,55 +60,55 @@ + * images to a displayable form. + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsFreqfilt, vips_freqfilt, VIPS_TYPE_OPERATION ); ++G_DEFINE_ABSTRACT_TYPE(VipsFreqfilt, vips_freqfilt, VIPS_TYPE_OPERATION); + + static int +-vips_freqfilt_build( VipsObject *object ) ++vips_freqfilt_build(VipsObject *object) + { +- VipsFreqfilt *freqfilt = VIPS_FREQFILT( object ); ++ VipsFreqfilt *freqfilt = VIPS_FREQFILT(object); + + #ifdef DEBUG +- printf( "vips_freqfilt_build: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_freqfilt_build: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- g_object_set( freqfilt, "out", vips_image_new(), NULL ); ++ g_object_set(freqfilt, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_freqfilt_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_freqfilt_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_freqfilt_class_init( VipsFreqfiltClass *class ) ++vips_freqfilt_class_init(VipsFreqfiltClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "freqfilt"; +- vobject_class->description = _( "frequency-domain filter operations" ); ++ vobject_class->description = _("frequency-domain filter operations"); + vobject_class->build = vips_freqfilt_build; + +- VIPS_ARG_IMAGE( class, "in", -1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", -1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsFreqfilt, in ) ); ++ G_STRUCT_OFFSET(VipsFreqfilt, in)); + +- VIPS_ARG_IMAGE( class, "out", 1, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsFreqfilt, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 1, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsFreqfilt, out)); + } + + static void +-vips_freqfilt_init( VipsFreqfilt *freqfilt ) ++vips_freqfilt_init(VipsFreqfilt *freqfilt) + { + } + +@@ -118,9 +118,9 @@ vips_freqfilt_init( VipsFreqfilt *freqfilt ) + * fftw. In some modes fftw generates only half the output and we construct + * the rest. + * +- * input pipeline -> +- * bandsplit -> +- * full memory image, freed when im_*fft*() exits -> ++ * input pipeline -> ++ * bandsplit -> ++ * full memory image, freed when im_*fft*() exits -> + * fftw -> + * half memory image, freed when im_*fft*() exits -> + * full memory image, freed when @out is freed -> +@@ -130,51 +130,50 @@ vips_freqfilt_init( VipsFreqfilt *freqfilt ) + * vips__fftproc() needs to just call VipsFftProcessFn directly for 1 band images, + * so we can't cache the output in this fn. + */ +-int +-vips__fftproc( VipsObject *context, +- VipsImage *in, VipsImage **out, VipsFftProcessFn fn ) ++int ++vips__fftproc(VipsObject *context, ++ VipsImage *in, VipsImage **out, VipsFftProcessFn fn) + { +- VipsImage **bands = (VipsImage **) +- vips_object_local_array( context, in->Bands ); +- VipsImage **fft = (VipsImage **) +- vips_object_local_array( context, in->Bands ); ++ VipsImage **bands = (VipsImage **) ++ vips_object_local_array(context, in->Bands); ++ VipsImage **fft = (VipsImage **) ++ vips_object_local_array(context, in->Bands); + + int b; + +- if( in->Bands == 1 ) +- return( fn( context, in, out ) ); ++ if (in->Bands == 1) ++ return (fn(context, in, out)); + +- for( b = 0; b < in->Bands; b++ ) +- if( vips_extract_band( in, &bands[b], b, NULL ) || +- fn( context, bands[b], &fft[b] ) ) +- return( -1 ); ++ for (b = 0; b < in->Bands; b++) ++ if (vips_extract_band(in, &bands[b], b, NULL) || ++ fn(context, bands[b], &fft[b])) ++ return (-1); + +- if( vips_bandjoin( fft, out, in->Bands, NULL ) ) +- return( -1 ); ++ if (vips_bandjoin(fft, out, in->Bands, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Called from iofuncs to init all operations in this dir. Use a plugin system + * instead? + */ + void +-vips_freqfilt_operation_init( void ) ++vips_freqfilt_operation_init(void) + { + #ifdef HAVE_FFTW +- extern GType vips_fwfft_get_type( void ); +- extern GType vips_invfft_get_type( void ); ++ extern GType vips_fwfft_get_type(void); ++ extern GType vips_invfft_get_type(void); + #endif /*HAVE_FFTW*/ +- extern GType vips_freqmult_get_type( void ); +- extern GType vips_spectrum_get_type( void ); +- extern GType vips_phasecor_get_type( void ); ++ extern GType vips_freqmult_get_type(void); ++ extern GType vips_spectrum_get_type(void); ++ extern GType vips_phasecor_get_type(void); + + #ifdef HAVE_FFTW +- vips_fwfft_get_type(); +- vips_invfft_get_type(); ++ vips_fwfft_get_type(); ++ vips_invfft_get_type(); + #endif /*HAVE_FFTW*/ +- vips_freqmult_get_type(); +- vips_spectrum_get_type(); +- vips_phasecor_get_type(); ++ vips_freqmult_get_type(); ++ vips_spectrum_get_type(); ++ vips_phasecor_get_type(); + } +- +diff --git a/libvips/freqfilt/freqmult.c b/libvips/freqfilt/freqmult.c +index 2556a37f8c..2a9b840409 100644 +--- a/libvips/freqfilt/freqmult.c ++++ b/libvips/freqfilt/freqmult.c +@@ -19,28 +19,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -63,34 +63,33 @@ typedef struct _VipsFreqmult { + + typedef VipsFreqfiltClass VipsFreqmultClass; + +-G_DEFINE_TYPE( VipsFreqmult, vips_freqmult, VIPS_TYPE_FREQFILT ); ++G_DEFINE_TYPE(VipsFreqmult, vips_freqmult, VIPS_TYPE_FREQFILT); + + static int +-vips_freqmult_build( VipsObject *object ) ++vips_freqmult_build(VipsObject *object) + { +- VipsFreqfilt *freqfilt = VIPS_FREQFILT( object ); ++ VipsFreqfilt *freqfilt = VIPS_FREQFILT(object); + VipsFreqmult *freqmult = (VipsFreqmult *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 5 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 5); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_freqmult_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_freqmult_parent_class)->build(object)) ++ return (-1); + + in = freqfilt->in; + +- if( vips_band_format_iscomplex( in->BandFmt ) ) { +- if( vips_multiply( in, freqmult->mask, &t[0], NULL ) || +- vips_invfft( t[0], &t[1], "real", TRUE, NULL ) ) +- return( -1 ); ++ if (vips_band_format_iscomplex(in->BandFmt)) { ++ if (vips_multiply(in, freqmult->mask, &t[0], NULL) || ++ vips_invfft(t[0], &t[1], "real", TRUE, NULL)) ++ return (-1); + + in = t[1]; + } + else { +- /* Optimisation: output of vips_invfft() is double, we ++ /* Optimisation: output of vips_invfft() is double, we + * will usually cast to char, so rather than keeping a +- * large double buffer and partial to char from that, ++ * large double buffer and partial to char from that, + * cast to a memory buffer and copy to out from that. + * + * FIXME does this actually work now we're a class? test +@@ -98,51 +97,50 @@ vips_freqmult_build( VipsObject *object ) + */ + t[4] = vips_image_new_memory(); + +- if( vips_fwfft( in, &t[0], NULL ) || +- vips_multiply( t[0], freqmult->mask, &t[1], NULL ) || +- vips_invfft( t[1], &t[2], "real", TRUE, NULL ) || +- vips_cast( t[2], &t[3], in->BandFmt, NULL ) || +- vips_image_write( t[3], t[4] ) ) +- return( -1 ); ++ if (vips_fwfft(in, &t[0], NULL) || ++ vips_multiply(t[0], freqmult->mask, &t[1], NULL) || ++ vips_invfft(t[1], &t[2], "real", TRUE, NULL) || ++ vips_cast(t[2], &t[3], in->BandFmt, NULL) || ++ vips_image_write(t[3], t[4])) ++ return (-1); + +- in = t[4]; ++ in = t[4]; + } + +- if( vips_image_write( in, freqfilt->out ) ) +- return( -1 ); ++ if (vips_image_write(in, freqfilt->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_freqmult_class_init( VipsFreqmultClass *class ) ++vips_freqmult_class_init(VipsFreqmultClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "freqmult"; +- vobject_class->description = _( "frequency-domain filtering" ); ++ vobject_class->description = _("frequency-domain filtering"); + vobject_class->build = vips_freqmult_build; + +- VIPS_ARG_IMAGE( class, "mask", 0, +- _( "Mask" ), +- _( "Input mask image" ), ++ VIPS_ARG_IMAGE(class, "mask", 0, ++ _("Mask"), ++ _("Input mask image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsFreqmult, mask ) ); +- ++ G_STRUCT_OFFSET(VipsFreqmult, mask)); + } + + static void +-vips_freqmult_init( VipsFreqmult *freqmult ) ++vips_freqmult_init(VipsFreqmult *freqmult) + { + } + + /** + * vips_freqmult: (method) +- * @in: input image ++ * @in: input image + * @mask: mask image + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments +@@ -158,15 +156,14 @@ vips_freqmult_init( VipsFreqmult *freqmult ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_freqmult( VipsImage *in, VipsImage *mask, VipsImage **out, ... ) ++vips_freqmult(VipsImage *in, VipsImage *mask, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "freqmult", ap, in, mask, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("freqmult", ap, in, mask, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/freqfilt/fwfft.c b/libvips/freqfilt/fwfft.c +index d27b07b271..e6aeb6c2e5 100644 +--- a/libvips/freqfilt/fwfft.c ++++ b/libvips/freqfilt/fwfft.c +@@ -1,6 +1,6 @@ + /* forward FFT + * +- * Author: Nicos Dessipris ++ * Author: Nicos Dessipris + * Written on: 12/04/1990 + * Modified on : 09/05/1990 to cope with float input + * Modified on : 08/03/1991 history removed +@@ -41,28 +41,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -89,17 +89,17 @@ typedef struct _VipsFwfft { + + typedef VipsFreqfiltClass VipsFwfftClass; + +-G_DEFINE_TYPE( VipsFwfft, vips_fwfft, VIPS_TYPE_FREQFILT ); ++G_DEFINE_TYPE(VipsFwfft, vips_fwfft, VIPS_TYPE_FREQFILT); + + /* Real to complex forward transform. + */ +-static int +-rfwfft1( VipsObject *object, VipsImage *in, VipsImage **out ) ++static int ++rfwfft1(VipsObject *object, VipsImage *in, VipsImage **out) + { + VipsFwfft *fwfft = (VipsFwfft *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( fwfft ); +- const guint64 size = VIPS_IMAGE_N_PELS( in ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(fwfft); ++ const guint64 size = VIPS_IMAGE_N_PELS(in); + const int half_width = in->Xsize / 2 + 1; + + double *half_complex; +@@ -109,236 +109,232 @@ rfwfft1( VipsObject *object, VipsImage *in, VipsImage **out ) + double *buf, *q, *p; + int x, y; + +- if( vips_check_mono( class->nickname, in ) || +- vips_check_uncoded( class->nickname, in ) ) +- return( -1 ); ++ if (vips_check_mono(class->nickname, in) || ++ vips_check_uncoded(class->nickname, in)) ++ return (-1); + + /* Convert input to a real double membuffer. + */ + t[1] = vips_image_new_memory(); +- if( vips_cast_double( in, &t[0], NULL ) || +- vips_image_write( t[0], t[1] ) ) +- return( -1 ); ++ if (vips_cast_double(in, &t[0], NULL) || ++ vips_image_write(t[0], t[1])) ++ return (-1); + + /* Make the plan for the transform. Yes, they really do use nx for + * height and ny for width. Use a separate scratch buffer for the + * planner, we can't overwrite real->data + */ +- if( !(planner_scratch = VIPS_ARRAY( fwfft, +- VIPS_IMAGE_N_PELS( in ), double )) ) +- return( -1 ); +- if( !(half_complex = VIPS_ARRAY( fwfft, +- in->Ysize * half_width * 2, double )) ) +- return( -1 ); +- if( !(plan = fftw_plan_dft_r2c_2d( in->Ysize, in->Xsize, +- planner_scratch, (fftw_complex *) half_complex, +- 0 )) ) { +- vips_error( class->nickname, +- "%s", _( "unable to create transform plan" ) ); +- return( -1 ); ++ if (!(planner_scratch = VIPS_ARRAY(fwfft, ++ VIPS_IMAGE_N_PELS(in), double))) ++ return (-1); ++ if (!(half_complex = VIPS_ARRAY(fwfft, ++ in->Ysize * half_width * 2, double))) ++ return (-1); ++ if (!(plan = fftw_plan_dft_r2c_2d(in->Ysize, in->Xsize, ++ planner_scratch, (fftw_complex *) half_complex, ++ 0))) { ++ vips_error(class->nickname, ++ "%s", _("unable to create transform plan")); ++ return (-1); + } + +- fftw_execute_dft_r2c( plan, +- (double *) t[1]->data, (fftw_complex *) half_complex ); ++ fftw_execute_dft_r2c(plan, ++ (double *) t[1]->data, (fftw_complex *) half_complex); + +- fftw_destroy_plan( plan ); ++ fftw_destroy_plan(plan); + +- /* Write to out as another memory buffer. ++ /* Write to out as another memory buffer. + */ + *out = vips_image_new_memory(); +- if( vips_image_pipelinev( *out, VIPS_DEMAND_STYLE_ANY, in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(*out, VIPS_DEMAND_STYLE_ANY, in, NULL)) ++ return (-1); + (*out)->BandFmt = VIPS_FORMAT_DPCOMPLEX; + (*out)->Type = VIPS_INTERPRETATION_FOURIER; +- if( !(buf = VIPS_ARRAY( fwfft, VIPS_IMAGE_N_PELS( *out ), double )) ) +- return( -1 ); ++ if (!(buf = VIPS_ARRAY(fwfft, VIPS_IMAGE_N_PELS(*out), double))) ++ return (-1); + +- /* Copy and normalise. The right half is the up/down and +- * left/right flip of the left, but conjugated. Do the first ++ /* Copy and normalise. The right half is the up/down and ++ * left/right flip of the left, but conjugated. Do the first + * row separately, then mirror around the centre row. + */ + p = half_complex; + q = buf; + +- for( x = 0; x < half_width; x++ ) { ++ for (x = 0; x < half_width; x++) { + q[0] = p[0] / size; + q[1] = p[1] / size; + p += 2; + q += 2; + } + +- p = half_complex + ((in->Xsize + 1) / 2 - 1) * 2; ++ p = half_complex + ((in->Xsize + 1) / 2 - 1) * 2; + +- for( x = half_width; x < (*out)->Xsize; x++ ) { ++ for (x = half_width; x < (*out)->Xsize; x++) { + q[0] = p[0] / size; + q[1] = -1.0 * p[1] / size; + p -= 2; + q += 2; + } + +- if( vips_image_write_line( *out, 0, (VipsPel *) buf ) ) +- return( -1 ); ++ if (vips_image_write_line(*out, 0, (VipsPel *) buf)) ++ return (-1); + +- for( y = 1; y < (*out)->Ysize; y++ ) { +- p = half_complex + y * half_width * 2; ++ for (y = 1; y < (*out)->Ysize; y++) { ++ p = half_complex + y * half_width * 2; + q = buf; + +- for( x = 0; x < half_width; x++ ) { ++ for (x = 0; x < half_width; x++) { + q[0] = p[0] / size; + q[1] = p[1] / size; + p += 2; + q += 2; + } + +- /* Good grief. ++ /* Good grief. + */ +- p = half_complex + 2 * +- (((*out)->Ysize - y + 1) * half_width - 2 + +- (in->Xsize & 1)); ++ p = half_complex + 2 * (((*out)->Ysize - y + 1) * half_width - 2 + (in->Xsize & 1)); + +- for( x = half_width; x < (*out)->Xsize; x++ ) { ++ for (x = half_width; x < (*out)->Xsize; x++) { + q[0] = p[0] / size; + q[1] = -1.0 * p[1] / size; + p -= 2; + q += 2; + } + +- if( vips_image_write_line( *out, y, (VipsPel *) buf ) ) +- return( -1 ); ++ if (vips_image_write_line(*out, y, (VipsPel *) buf)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Complex to complex forward transform. + */ +-static int +-cfwfft1( VipsObject *object, VipsImage *in, VipsImage **out ) ++static int ++cfwfft1(VipsObject *object, VipsImage *in, VipsImage **out) + { + VipsFwfft *fwfft = (VipsFwfft *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( fwfft ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(fwfft); + + fftw_plan plan; + double *planner_scratch; + double *buf, *q, *p; + int x, y; + +- if( vips_check_mono( class->nickname, in ) || +- vips_check_uncoded( class->nickname, in ) ) +- return( -1 ); ++ if (vips_check_mono(class->nickname, in) || ++ vips_check_uncoded(class->nickname, in)) ++ return (-1); + + /* Convert input to a complex double membuffer. + */ + t[1] = vips_image_new_memory(); +- if( vips_cast_dpcomplex( in, &t[0], NULL ) || +- vips_image_write( t[0], t[1] ) ) +- return( -1 ); ++ if (vips_cast_dpcomplex(in, &t[0], NULL) || ++ vips_image_write(t[0], t[1])) ++ return (-1); + + /* We have to have a separate buffer for the planner to work on. + */ +- if( !(planner_scratch = VIPS_ARRAY( fwfft, +- VIPS_IMAGE_N_PELS( in ) * 2, double )) ) +- return( -1 ); ++ if (!(planner_scratch = VIPS_ARRAY(fwfft, ++ VIPS_IMAGE_N_PELS(in) * 2, double))) ++ return (-1); + + /* Make the plan for the transform. + */ +- if( !(plan = fftw_plan_dft_2d( in->Ysize, in->Xsize, +- (fftw_complex *) planner_scratch, +- (fftw_complex *) planner_scratch, +- FFTW_FORWARD, +- 0 )) ) { +- vips_error( class->nickname, +- "%s", _( "unable to create transform plan" ) ); +- return( -1 ); ++ if (!(plan = fftw_plan_dft_2d(in->Ysize, in->Xsize, ++ (fftw_complex *) planner_scratch, ++ (fftw_complex *) planner_scratch, ++ FFTW_FORWARD, ++ 0))) { ++ vips_error(class->nickname, ++ "%s", _("unable to create transform plan")); ++ return (-1); + } + +- fftw_execute_dft( plan, +- (fftw_complex *) t[1]->data, (fftw_complex *) t[1]->data ); ++ fftw_execute_dft(plan, ++ (fftw_complex *) t[1]->data, (fftw_complex *) t[1]->data); + +- fftw_destroy_plan( plan ); ++ fftw_destroy_plan(plan); + +- /* Write to out as another memory buffer. ++ /* Write to out as another memory buffer. + */ + *out = vips_image_new_memory(); +- if( vips_image_pipelinev( *out, VIPS_DEMAND_STYLE_ANY, in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(*out, VIPS_DEMAND_STYLE_ANY, in, NULL)) ++ return (-1); + (*out)->BandFmt = VIPS_FORMAT_DPCOMPLEX; + (*out)->Type = VIPS_INTERPRETATION_FOURIER; +- if( !(buf = VIPS_ARRAY( fwfft, VIPS_IMAGE_N_PELS( *out ), double )) ) +- return( -1 ); ++ if (!(buf = VIPS_ARRAY(fwfft, VIPS_IMAGE_N_PELS(*out), double))) ++ return (-1); + + /* Copy to out, normalise. + */ + p = (double *) t[1]->data; +- for( y = 0; y < (*out)->Ysize; y++ ) { +- guint64 size = VIPS_IMAGE_N_PELS( *out ); ++ for (y = 0; y < (*out)->Ysize; y++) { ++ guint64 size = VIPS_IMAGE_N_PELS(*out); + + q = buf; + +- for( x = 0; x < (*out)->Xsize; x++ ) { ++ for (x = 0; x < (*out)->Xsize; x++) { + q[0] = p[0] / size; + q[1] = p[1] / size; + p += 2; + q += 2; + } + +- if( vips_image_write_line( *out, y, (VipsPel *) buf ) ) +- return( -1 ); ++ if (vips_image_write_line(*out, y, (VipsPel *) buf)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_fwfft_build( VipsObject *object ) ++vips_fwfft_build(VipsObject *object) + { +- VipsFreqfilt *freqfilt = VIPS_FREQFILT( object ); ++ VipsFreqfilt *freqfilt = VIPS_FREQFILT(object); + VipsFwfft *fwfft = (VipsFwfft *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_fwfft_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_fwfft_parent_class)->build(object)) ++ return (-1); + +- in = freqfilt->in; ++ in = freqfilt->in; + +- if( vips_image_decode( in, &t[0] ) ) +- return( -1 ); +- in = t[0]; ++ if (vips_image_decode(in, &t[0])) ++ return (-1); ++ in = t[0]; + +- if( vips_band_format_iscomplex( in->BandFmt ) ) { +- if( vips__fftproc( VIPS_OBJECT( fwfft ), in, &t[1], +- cfwfft1 ) ) +- return( -1 ); ++ if (vips_band_format_iscomplex(in->BandFmt)) { ++ if (vips__fftproc(VIPS_OBJECT(fwfft), in, &t[1], ++ cfwfft1)) ++ return (-1); + } + else { +- if( vips__fftproc( VIPS_OBJECT( fwfft ), in, &t[1], +- rfwfft1 ) ) +- return( -1 ); ++ if (vips__fftproc(VIPS_OBJECT(fwfft), in, &t[1], ++ rfwfft1)) ++ return (-1); + } + +- if( vips_image_write( t[1], freqfilt->out ) ) +- return( -1 ); ++ if (vips_image_write(t[1], freqfilt->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_fwfft_class_init( VipsFwfftClass *class ) ++vips_fwfft_class_init(VipsFwfftClass *class) + { +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + vobject_class->nickname = "fwfft"; +- vobject_class->description = _( "forward FFT" ); ++ vobject_class->description = _("forward FFT"); + vobject_class->build = vips_fwfft_build; +- + } + + static void +-vips_fwfft_init( VipsFwfft *fwfft ) ++vips_fwfft_init(VipsFwfft *fwfft) + { + } + +@@ -346,7 +342,7 @@ vips_fwfft_init( VipsFwfft *fwfft ) + + /** + * vips_fwfft: (method) +- * @in: input image ++ * @in: input image + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +@@ -360,15 +356,14 @@ vips_fwfft_init( VipsFwfft *fwfft ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_fwfft( VipsImage *in, VipsImage **out, ... ) ++vips_fwfft(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "fwfft", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("fwfft", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/freqfilt/invfft.c b/libvips/freqfilt/invfft.c +index 82e7c5b880..acb7611ac0 100644 +--- a/libvips/freqfilt/invfft.c ++++ b/libvips/freqfilt/invfft.c +@@ -1,6 +1,6 @@ + /* Inverse FFT + * +- * Author: Nicos Dessipris ++ * Author: Nicos Dessipris + * Written on: 12/04/1990 + * Modified on : + * 28/6/95 JC +@@ -30,28 +30,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -80,65 +80,65 @@ typedef struct _VipsInvfft { + + typedef VipsFreqfiltClass VipsInvfftClass; + +-G_DEFINE_TYPE( VipsInvfft, vips_invfft, VIPS_TYPE_FREQFILT ); ++G_DEFINE_TYPE(VipsInvfft, vips_invfft, VIPS_TYPE_FREQFILT); + + /* Complex to complex inverse transform. + */ +-static int +-cinvfft1( VipsObject *object, VipsImage *in, VipsImage **out ) ++static int ++cinvfft1(VipsObject *object, VipsImage *in, VipsImage **out) + { +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); + VipsInvfft *invfft = (VipsInvfft *) object; +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( invfft ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(invfft); + + fftw_plan plan; + double *planner_scratch; + +- if( vips_check_mono( class->nickname, in ) || +- vips_check_uncoded( class->nickname, in ) ) +- return( -1 ); ++ if (vips_check_mono(class->nickname, in) || ++ vips_check_uncoded(class->nickname, in)) ++ return (-1); + + /* Convert input to a complex double membuffer. + */ + *out = vips_image_new_memory(); +- if( vips_cast_dpcomplex( in, &t[0], NULL ) || +- vips_image_write( t[0], *out ) ) +- return( -1 ); ++ if (vips_cast_dpcomplex(in, &t[0], NULL) || ++ vips_image_write(t[0], *out)) ++ return (-1); + + /* Make the plan for the transform. Yes, they really do use nx for + * height and ny for width. + */ +- if( !(planner_scratch = VIPS_ARRAY( invfft, +- VIPS_IMAGE_N_PELS( in ) * 2, double )) ) +- return( -1 ); +- if( !(plan = fftw_plan_dft_2d( in->Ysize, in->Xsize, +- (fftw_complex *) planner_scratch, +- (fftw_complex *) planner_scratch, +- FFTW_BACKWARD, +- 0 )) ) { +- vips_error( class->nickname, +- "%s", _( "unable to create transform plan" ) ); +- return( -1 ); ++ if (!(planner_scratch = VIPS_ARRAY(invfft, ++ VIPS_IMAGE_N_PELS(in) * 2, double))) ++ return (-1); ++ if (!(plan = fftw_plan_dft_2d(in->Ysize, in->Xsize, ++ (fftw_complex *) planner_scratch, ++ (fftw_complex *) planner_scratch, ++ FFTW_BACKWARD, ++ 0))) { ++ vips_error(class->nickname, ++ "%s", _("unable to create transform plan")); ++ return (-1); + } + +- fftw_execute_dft( plan, +- (fftw_complex *) (*out)->data, (fftw_complex *) (*out)->data ); ++ fftw_execute_dft(plan, ++ (fftw_complex *) (*out)->data, (fftw_complex *) (*out)->data); + +- fftw_destroy_plan( plan ); ++ fftw_destroy_plan(plan); + + (*out)->Type = VIPS_INTERPRETATION_B_W; + +- return( 0 ); ++ return (0); + } + + /* Complex to real inverse transform. + */ +-static int +-rinvfft1( VipsObject *object, VipsImage *in, VipsImage **out ) ++static int ++rinvfft1(VipsObject *object, VipsImage *in, VipsImage **out) + { +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); + VipsInvfft *invfft = (VipsInvfft *) object; +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( invfft ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(invfft); + const int half_width = in->Xsize / 2 + 1; + + double *half_complex; +@@ -150,20 +150,20 @@ rinvfft1( VipsObject *object, VipsImage *in, VipsImage **out ) + /* Convert input to a complex double membuffer. + */ + t[1] = vips_image_new_memory(); +- if( vips_cast_dpcomplex( in, &t[0], NULL ) || +- vips_image_write( t[0], t[1] ) ) +- return( -1 ); ++ if (vips_cast_dpcomplex(in, &t[0], NULL) || ++ vips_image_write(t[0], t[1])) ++ return (-1); + + /* Build half-complex image. + */ +- if( !(half_complex = VIPS_ARRAY( invfft, +- t[1]->Ysize * half_width * 2, double )) ) +- return( -1 ); ++ if (!(half_complex = VIPS_ARRAY(invfft, ++ t[1]->Ysize * half_width * 2, double))) ++ return (-1); + q = half_complex; +- for( y = 0; y < t[1]->Ysize; y++ ) { +- p = ((double *) t[1]->data) + (guint64) y * t[1]->Xsize * 2; ++ for (y = 0; y < t[1]->Ysize; y++) { ++ p = ((double *) t[1]->data) + (guint64) y * t[1]->Xsize * 2; + +- for( x = 0; x < half_width; x++ ) { ++ for (x = 0; x < half_width; x++) { + q[0] = p[0]; + q[1] = p[1]; + p += 2; +@@ -174,95 +174,93 @@ rinvfft1( VipsObject *object, VipsImage *in, VipsImage **out ) + /* Make mem buffer real image for output. + */ + *out = vips_image_new_memory(); +- if( vips_image_pipelinev( *out, VIPS_DEMAND_STYLE_ANY, t[1], NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(*out, VIPS_DEMAND_STYLE_ANY, t[1], NULL)) ++ return (-1); + (*out)->BandFmt = VIPS_FORMAT_DOUBLE; + (*out)->Type = VIPS_INTERPRETATION_B_W; +- if( vips_image_write_prepare( *out ) ) +- return( -1 ); ++ if (vips_image_write_prepare(*out)) ++ return (-1); + + /* Make the plan for the transform. Yes, they really do use nx for + * height and ny for width. + */ +- if( !(planner_scratch = VIPS_ARRAY( invfft, +- t[1]->Ysize * half_width * 2, double )) ) +- return( -1 ); +- if( !(plan = fftw_plan_dft_c2r_2d( t[1]->Ysize, t[1]->Xsize, +- (fftw_complex *) planner_scratch, (double *) (*out)->data, +- 0 )) ) { +- vips_error( class->nickname, +- "%s", _( "unable to create transform plan" ) ); +- return( -1 ); ++ if (!(planner_scratch = VIPS_ARRAY(invfft, ++ t[1]->Ysize * half_width * 2, double))) ++ return (-1); ++ if (!(plan = fftw_plan_dft_c2r_2d(t[1]->Ysize, t[1]->Xsize, ++ (fftw_complex *) planner_scratch, (double *) (*out)->data, ++ 0))) { ++ vips_error(class->nickname, ++ "%s", _("unable to create transform plan")); ++ return (-1); + } + +- fftw_execute_dft_c2r( plan, +- (fftw_complex *) half_complex, (double *) (*out)->data ); ++ fftw_execute_dft_c2r(plan, ++ (fftw_complex *) half_complex, (double *) (*out)->data); + +- fftw_destroy_plan( plan ); ++ fftw_destroy_plan(plan); + +- return( 0 ); ++ return (0); + } + + static int +-vips_invfft_build( VipsObject *object ) ++vips_invfft_build(VipsObject *object) + { +- VipsFreqfilt *freqfilt = VIPS_FREQFILT( object ); ++ VipsFreqfilt *freqfilt = VIPS_FREQFILT(object); + VipsInvfft *invfft = (VipsInvfft *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_invfft_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_invfft_parent_class)->build(object)) ++ return (-1); + +- in = freqfilt->in; ++ in = freqfilt->in; + +- if( vips_image_decode( in, &t[0] ) ) +- return( -1 ); +- in = t[0]; ++ if (vips_image_decode(in, &t[0])) ++ return (-1); ++ in = t[0]; + +- if( invfft->real ) { +- if( vips__fftproc( VIPS_OBJECT( invfft ), +- in, &t[1], rinvfft1 ) ) +- return( -1 ); ++ if (invfft->real) { ++ if (vips__fftproc(VIPS_OBJECT(invfft), ++ in, &t[1], rinvfft1)) ++ return (-1); + } + else { +- if( vips__fftproc( VIPS_OBJECT( invfft ), +- in, &t[1], cinvfft1 ) ) +- return( -1 ); ++ if (vips__fftproc(VIPS_OBJECT(invfft), ++ in, &t[1], cinvfft1)) ++ return (-1); + } +- +- if( vips_image_write( t[1], freqfilt->out ) ) +- return( -1 ); + +- return( 0 ); ++ if (vips_image_write(t[1], freqfilt->out)) ++ return (-1); ++ ++ return (0); + } + + static void +-vips_invfft_class_init( VipsInvfftClass *class ) ++vips_invfft_class_init(VipsInvfftClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "invfft"; +- vobject_class->description = _( "inverse FFT" ); ++ vobject_class->description = _("inverse FFT"); + vobject_class->build = vips_invfft_build; + +- VIPS_ARG_BOOL( class, "real", 4, +- _( "Real" ), +- _( "Output only the real part of the transform" ), ++ VIPS_ARG_BOOL(class, "real", 4, ++ _("Real"), ++ _("Output only the real part of the transform"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsInvfft, real ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsInvfft, real), ++ FALSE); + } + + static void +-vips_invfft_init( VipsInvfft *invfft ) ++vips_invfft_init(VipsInvfft *invfft) + { + } + +@@ -270,7 +268,7 @@ vips_invfft_init( VipsInvfft *invfft ) + + /** + * vips_invfft: (method) +- * @in: input image ++ * @in: input image + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +@@ -289,15 +287,14 @@ vips_invfft_init( VipsInvfft *invfft ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_invfft( VipsImage *in, VipsImage **out, ... ) ++vips_invfft(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "invfft", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("invfft", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/freqfilt/pfreqfilt.h b/libvips/freqfilt/pfreqfilt.h +index d1e6069436..a42c509ed8 100644 +--- a/libvips/freqfilt/pfreqfilt.h ++++ b/libvips/freqfilt/pfreqfilt.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -38,19 +38,19 @@ extern "C" { + #include + + #define VIPS_TYPE_FREQFILT (vips_freqfilt_get_type()) +-#define VIPS_FREQFILT( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_FREQFILT, VipsFreqfilt )) +-#define VIPS_FREQFILT_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_FREQFILT(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_FREQFILT, VipsFreqfilt)) ++#define VIPS_FREQFILT_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_FREQFILT, VipsFreqfiltClass)) ++#define VIPS_IS_FREQFILT(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_FREQFILT)) ++#define VIPS_IS_FREQFILT_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_FREQFILT)) ++#define VIPS_FREQFILT_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_FREQFILT, VipsFreqfiltClass)) +-#define VIPS_IS_FREQFILT( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_FREQFILT )) +-#define VIPS_IS_FREQFILT_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_FREQFILT )) +-#define VIPS_FREQFILT_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_FREQFILT, VipsFreqfiltClass )) + + typedef struct _VipsFreqfilt { + VipsOperation parent_instance; +@@ -65,17 +65,15 @@ typedef struct _VipsFreqfiltClass { + + } VipsFreqfiltClass; + +-GType vips_freqfilt_get_type( void ); ++GType vips_freqfilt_get_type(void); + +-typedef int (*VipsFftProcessFn)( VipsObject *, VipsImage *, VipsImage ** ); ++typedef int (*VipsFftProcessFn)(VipsObject *, VipsImage *, VipsImage **); + +-int vips__fftproc( VipsObject *context, +- VipsImage *in, VipsImage **out, VipsFftProcessFn fn ); ++int vips__fftproc(VipsObject *context, ++ VipsImage *in, VipsImage **out, VipsFftProcessFn fn); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_PFREQFILT_H*/ +- +- +diff --git a/libvips/freqfilt/phasecor.c b/libvips/freqfilt/phasecor.c +index 4201a21013..7e294c786e 100644 +--- a/libvips/freqfilt/phasecor.c ++++ b/libvips/freqfilt/phasecor.c +@@ -13,28 +13,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -57,67 +57,65 @@ typedef struct _VipsPhasecor { + + typedef VipsFreqfiltClass VipsPhasecorClass; + +-G_DEFINE_TYPE( VipsPhasecor, vips_phasecor, VIPS_TYPE_FREQFILT ); ++G_DEFINE_TYPE(VipsPhasecor, vips_phasecor, VIPS_TYPE_FREQFILT); + + static int +-vips_phasecor_build( VipsObject *object ) ++vips_phasecor_build(VipsObject *object) + { +- VipsFreqfilt *freqfilt = VIPS_FREQFILT( object ); ++ VipsFreqfilt *freqfilt = VIPS_FREQFILT(object); + VipsPhasecor *phasecor = (VipsPhasecor *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 5 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 5); + + VipsImage *in1, *in2; + +- if( VIPS_OBJECT_CLASS( vips_phasecor_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_phasecor_parent_class)->build(object)) ++ return (-1); + + in1 = freqfilt->in; + in2 = phasecor->in2; + +- if( in1->BandFmt != VIPS_FORMAT_COMPLEX ) { +- if( vips_fwfft( in1, &t[0], NULL ) ) +- return( -1 ); ++ if (in1->BandFmt != VIPS_FORMAT_COMPLEX) { ++ if (vips_fwfft(in1, &t[0], NULL)) ++ return (-1); + in1 = t[0]; + } + +- if( in2->BandFmt != VIPS_FORMAT_COMPLEX ) { +- if( vips_fwfft( in2, &t[1], NULL ) ) +- return( -1 ); ++ if (in2->BandFmt != VIPS_FORMAT_COMPLEX) { ++ if (vips_fwfft(in2, &t[1], NULL)) ++ return (-1); + in2 = t[1]; + } + +- if( vips_cross_phase( in1, in2, &t[2], NULL ) || +- vips_invfft( t[2], &t[3], "real", TRUE, NULL ) || +- vips_image_write( t[3], freqfilt->out ) ) +- return( -1 ); ++ if (vips_cross_phase(in1, in2, &t[2], NULL) || ++ vips_invfft(t[2], &t[3], "real", TRUE, NULL) || ++ vips_image_write(t[3], freqfilt->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_phasecor_class_init( VipsPhasecorClass *class ) ++vips_phasecor_class_init(VipsPhasecorClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "phasecor"; +- vobject_class->description = _( "calculate phase correlation" ); ++ vobject_class->description = _("calculate phase correlation"); + vobject_class->build = vips_phasecor_build; + +- VIPS_ARG_IMAGE( class, "in2", 0, +- _( "in2" ), +- _( "Second input image" ), ++ VIPS_ARG_IMAGE(class, "in2", 0, ++ _("in2"), ++ _("Second input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsPhasecor, in2 ) ); +- ++ G_STRUCT_OFFSET(VipsPhasecor, in2)); + } + + static void +-vips_phasecor_init( VipsPhasecor *phasecor ) ++vips_phasecor_init(VipsPhasecor *phasecor) + { + } + +@@ -131,20 +129,19 @@ vips_phasecor_init( VipsPhasecor *phasecor ) + * Convert the two input images to Fourier space, calculate phase-correlation, + * back to real space. + * +- * See also: vips_fwfft(), vips_cross_phase(), ++ * See also: vips_fwfft(), vips_cross_phase(), + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_phasecor( VipsImage *in1, VipsImage *in2, VipsImage **out, ... ) ++vips_phasecor(VipsImage *in1, VipsImage *in2, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "phasecor", ap, in1, in2, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("phasecor", ap, in1, in2, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/freqfilt/spectrum.c b/libvips/freqfilt/spectrum.c +index 36fe47cf4d..698a69a464 100644 +--- a/libvips/freqfilt/spectrum.c ++++ b/libvips/freqfilt/spectrum.c +@@ -2,7 +2,7 @@ + * + * Author: Nicos Dessipris + * Written on: 27/03/1991 +- * Modified on : ++ * Modified on : + * 16/6/93 J.Cupitt + * - im_ioflag() changed to im_iocheck() + * 23/2/95 JC +@@ -20,28 +20,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -59,58 +59,56 @@ + typedef VipsFreqfilt VipsSpectrum; + typedef VipsFreqfiltClass VipsSpectrumClass; + +-G_DEFINE_TYPE( VipsSpectrum, vips_spectrum, VIPS_TYPE_FREQFILT ); ++G_DEFINE_TYPE(VipsSpectrum, vips_spectrum, VIPS_TYPE_FREQFILT); + + static int +-vips_spectrum_build( VipsObject *object ) ++vips_spectrum_build(VipsObject *object) + { +- VipsFreqfilt *freqfilt = VIPS_FREQFILT( object ); +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 5 ); ++ VipsFreqfilt *freqfilt = VIPS_FREQFILT(object); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 5); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_spectrum_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_spectrum_parent_class)->build(object)) ++ return (-1); + + in = freqfilt->in; + +- if( in->BandFmt != VIPS_FORMAT_COMPLEX ) { +- if( vips_fwfft( in, &t[0], NULL ) ) +- return( -1 ); ++ if (in->BandFmt != VIPS_FORMAT_COMPLEX) { ++ if (vips_fwfft(in, &t[0], NULL)) ++ return (-1); + in = t[0]; + } + +- if( vips_abs( in, &t[1], NULL ) || +- vips_scale( t[1], &t[2], "log", TRUE, NULL ) || +- vips_wrap( t[2], &t[3], NULL ) ) +- return( -1 ); ++ if (vips_abs(in, &t[1], NULL) || ++ vips_scale(t[1], &t[2], "log", TRUE, NULL) || ++ vips_wrap(t[2], &t[3], NULL)) ++ return (-1); + +- if( vips_image_write( t[3], freqfilt->out ) ) +- return( -1 ); ++ if (vips_image_write(t[3], freqfilt->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_spectrum_class_init( VipsSpectrumClass *class ) ++vips_spectrum_class_init(VipsSpectrumClass *class) + { +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + vobject_class->nickname = "spectrum"; +- vobject_class->description = _( "make displayable power spectrum" ); ++ vobject_class->description = _("make displayable power spectrum"); + vobject_class->build = vips_spectrum_build; +- + } + + static void +-vips_spectrum_init( VipsSpectrum *spectrum ) ++vips_spectrum_init(VipsSpectrum *spectrum) + { + } + + /** + * vips_spectrum: (method) +- * @in: input image ++ * @in: input image + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +@@ -124,15 +122,14 @@ vips_spectrum_init( VipsSpectrum *spectrum ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_spectrum( VipsImage *in, VipsImage **out, ... ) ++vips_spectrum(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "spectrum", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("spectrum", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/histogram/case.c b/libvips/histogram/case.c +index 46f91546b9..ca4f3b0de4 100644 +--- a/libvips/histogram/case.c ++++ b/libvips/histogram/case.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -55,42 +55,42 @@ typedef struct _VipsCase { + + typedef VipsOperationClass VipsCaseClass; + +-G_DEFINE_TYPE( VipsCase, vips_case, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsCase, vips_case, VIPS_TYPE_OPERATION); + +-static int +-vips_case_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++static int ++vips_case_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + VipsRegion **ar = (VipsRegion **) seq; + VipsCase *cas = (VipsCase *) b; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsRegion *index = ar[cas->n]; + + int x, y, i; +- VipsPel * restrict ip; +- VipsPel * restrict q; ++ VipsPel *restrict ip; ++ VipsPel *restrict q; + size_t ils; + size_t qls; + int hist[256]; +- VipsPel * restrict p[256]; ++ VipsPel *restrict p[256]; + size_t ls[256]; + size_t ps; + +- if( vips_region_prepare( index, r ) ) +- return( -1 ); ++ if (vips_region_prepare(index, r)) ++ return (-1); + +- g_assert( index->im->BandFmt == VIPS_FORMAT_UCHAR ); +- g_assert( index->im->Bands == 1 ); ++ g_assert(index->im->BandFmt == VIPS_FORMAT_UCHAR); ++ g_assert(index->im->Bands == 1); + + /* Histogram of index region, so we know which of our inputs we will + * need to prepare. + */ +- memset( hist, 0, cas->n * sizeof( int ) ); +- ip = VIPS_REGION_ADDR( index, r->left, r->top ); +- ils = VIPS_REGION_LSKIP( index ); +- for( y = 0; y < r->height; y++ ) { +- for( x = 0; x < r->width; x++ ) { +- int v = VIPS_MIN( ip[x], cas->n - 1 ); ++ memset(hist, 0, cas->n * sizeof(int)); ++ ip = VIPS_REGION_ADDR(index, r->left, r->top); ++ ils = VIPS_REGION_LSKIP(index); ++ for (y = 0; y < r->height; y++) { ++ for (x = 0; x < r->width; x++) { ++ int v = VIPS_MIN(ip[x], cas->n - 1); + + hist[v] += 1; + } +@@ -98,29 +98,29 @@ vips_case_gen( VipsRegion *or, void *seq, void *a, void *b, + ip += ils; + } + +- for( i = 0; i < cas->n; i++ ) +- if( hist[i] ) { +- if( vips_region_prepare( ar[i], r ) ) +- return( -1 ); +- p[i] = VIPS_REGION_ADDR( ar[i], r->left, r->top ); +- ls[i] = VIPS_REGION_LSKIP( ar[i] ); ++ for (i = 0; i < cas->n; i++) ++ if (hist[i]) { ++ if (vips_region_prepare(ar[i], r)) ++ return (-1); ++ p[i] = VIPS_REGION_ADDR(ar[i], r->left, r->top); ++ ls[i] = VIPS_REGION_LSKIP(ar[i]); + } + +- ip = VIPS_REGION_ADDR( index, r->left, r->top ); +- q = VIPS_REGION_ADDR( or, r->left, r->top ); +- qls = VIPS_REGION_LSKIP( or ); +- ps = VIPS_IMAGE_SIZEOF_PEL( or->im ); +- for( y = 0; y < r->height; y++ ) { ++ ip = VIPS_REGION_ADDR(index, r->left, r->top); ++ q = VIPS_REGION_ADDR(or, r->left, r->top); ++ qls = VIPS_REGION_LSKIP(or); ++ ps = VIPS_IMAGE_SIZEOF_PEL(or->im); ++ for (y = 0; y < r->height; y++) { + int k; + + k = 0; +- for( x = 0; x < r->width; x++ ) { +- int v = VIPS_MIN( ip[x], cas->n - 1 ); +- VipsPel * restrict pv = p[v]; ++ for (x = 0; x < r->width; x++) { ++ int v = VIPS_MIN(ip[x], cas->n - 1); ++ VipsPel *restrict pv = p[v]; + + int j; + +- for( j = 0; j < ps; j++ ) { ++ for (j = 0; j < ps; j++) { + q[k] = pv[k]; + k += 1; + } +@@ -128,20 +128,20 @@ vips_case_gen( VipsRegion *or, void *seq, void *a, void *b, + + ip += ils; + q += qls; +- for( i = 0; i < cas->n; i++ ) +- if( hist[i] ) ++ for (i = 0; i < cas->n; i++) ++ if (hist[i]) + p[i] += ls[i]; + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_case_build( VipsObject *object ) ++vips_case_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsCase *cas = (VipsCase *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + + VipsImage *index; + VipsImage **cases; +@@ -151,41 +151,41 @@ vips_case_build( VipsObject *object ) + VipsImage **size; + int i; + +- g_object_set( object, "out", vips_image_new(), NULL ); ++ g_object_set(object, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_case_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_case_parent_class)->build(object)) ++ return (-1); + + index = cas->index; +- cases = vips_area_get_data( &cas->cases->area, +- NULL, &cas->n, NULL, NULL ); +- if( cas->n > 256 || +- cas->n < 1 ) { +- vips_error( class->nickname, "%s", _( "bad number of cases" ) ); +- return( -1 ); ++ cases = vips_area_get_data(&cas->cases->area, ++ NULL, &cas->n, NULL, NULL); ++ if (cas->n > 256 || ++ cas->n < 1) { ++ vips_error(class->nickname, "%s", _("bad number of cases")); ++ return (-1); + } +- if( index->Bands > 1 ) { +- vips_error( class->nickname, +- "%s", _( "index image not 1-band" ) ); +- return( -1 ); ++ if (index->Bands > 1) { ++ vips_error(class->nickname, ++ "%s", _("index image not 1-band")); ++ return (-1); + } + + /* Cast @index to u8 to make the index image. + */ +- if( vips_cast( index, &t[0], VIPS_FORMAT_UCHAR, NULL ) ) +- return( -1 ); ++ if (vips_cast(index, &t[0], VIPS_FORMAT_UCHAR, NULL)) ++ return (-1); + index = t[0]; + +- decode = (VipsImage **) vips_object_local_array( object, cas->n ); +- format = (VipsImage **) vips_object_local_array( object, cas->n ); +- band = (VipsImage **) vips_object_local_array( object, cas->n + 1 ); +- size = (VipsImage **) vips_object_local_array( object, cas->n + 1 ); ++ decode = (VipsImage **) vips_object_local_array(object, cas->n); ++ format = (VipsImage **) vips_object_local_array(object, cas->n); ++ band = (VipsImage **) vips_object_local_array(object, cas->n + 1); ++ size = (VipsImage **) vips_object_local_array(object, cas->n + 1); + + /* Decode RAD/LABQ etc. + */ +- for( i = 0; i < cas->n; i++ ) +- if( vips_image_decode( cases[i], &decode[i] ) ) +- return( -1 ); ++ for (i = 0; i < cas->n; i++) ++ if (vips_image_decode(cases[i], &decode[i])) ++ return (-1); + cases = decode; + + /* case images must match in format, size and bands. +@@ -194,85 +194,84 @@ vips_case_build( VipsObject *object ) + * that to the end of the set of images for sizealike. + */ + band[cas->n] = index; +- g_object_ref( index ); +- if( vips__formatalike_vec( cases, format, cas->n ) || +- vips__bandalike_vec( class->nickname, +- format, band, cas->n, 1 ) || +- vips__sizealike_vec( band, size, cas->n + 1 ) ) +- return( -1 ); ++ g_object_ref(index); ++ if (vips__formatalike_vec(cases, format, cas->n) || ++ vips__bandalike_vec(class->nickname, ++ format, band, cas->n, 1) || ++ vips__sizealike_vec(band, size, cas->n + 1)) ++ return (-1); + cases = size; + +- if( vips_image_pipeline_array( cas->out, +- VIPS_DEMAND_STYLE_THINSTRIP, cases ) ) +- return( -1 ); ++ if (vips_image_pipeline_array(cas->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, cases)) ++ return (-1); + + cas->out->BandFmt = cases[0]->BandFmt; + cas->out->Bands = cases[0]->Bands; + cas->out->Type = cases[0]->Type; + +- if( vips_image_generate( cas->out, +- vips_start_many, vips_case_gen, vips_stop_many, +- cases, cas ) ) +- return( -1 ); ++ if (vips_image_generate(cas->out, ++ vips_start_many, vips_case_gen, vips_stop_many, ++ cases, cas)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_case_class_init( VipsCaseClass *class ) ++vips_case_class_init(VipsCaseClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "case"; +- object_class->description = +- _( "use pixel values to pick cases from an array of images" ); ++ object_class->description = ++ _("use pixel values to pick cases from an array of images"); + object_class->build = vips_case_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "index", 1, +- _( "Index" ), +- _( "Index image" ), ++ VIPS_ARG_IMAGE(class, "index", 1, ++ _("Index"), ++ _("Index image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsCase, index ) ); ++ G_STRUCT_OFFSET(VipsCase, index)); + +- VIPS_ARG_BOXED( class, "cases", 2, +- _( "Cases" ), +- _( "Array of case images" ), ++ VIPS_ARG_BOXED(class, "cases", 2, ++ _("Cases"), ++ _("Array of case images"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsCase, cases ), +- VIPS_TYPE_ARRAY_IMAGE ); +- +- VIPS_ARG_IMAGE( class, "out", 3, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsCase, out ) ); +- ++ G_STRUCT_OFFSET(VipsCase, cases), ++ VIPS_TYPE_ARRAY_IMAGE); ++ ++ VIPS_ARG_IMAGE(class, "out", 3, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsCase, out)); + } + + static void +-vips_case_init( VipsCase *cas ) ++vips_case_init(VipsCase *cas) + { + } + + static int +-vips_casev( VipsImage *index, VipsImage **cases, VipsImage **out, int n, +- va_list ap ) ++vips_casev(VipsImage *index, VipsImage **cases, VipsImage **out, int n, ++ va_list ap) + { +- VipsArrayImage *array; ++ VipsArrayImage *array; + int result; + +- array = vips_array_image_new( cases, n ); +- result = vips_call_split( "case", ap, index, array, out ); +- vips_area_unref( VIPS_AREA( array ) ); ++ array = vips_array_image_new(cases, n); ++ result = vips_call_split("case", ap, index, array, out); ++ vips_area_unref(VIPS_AREA(array)); + +- return( result ); ++ return (result); + } + + /** +@@ -286,9 +285,9 @@ vips_casev( VipsImage *index, VipsImage **cases, VipsImage **out, int n, + * Use values in @index to select pixels from @cases. + * + * @index must have one band. @cases can have up to 256 elements. Values in +- * @index greater than or equal to @n use the final image in @cases. The +- * images in @cases must have either one band or the same number of bands. +- * The output image is the same size as @index. Images in @cases are ++ * @index greater than or equal to @n use the final image in @cases. The ++ * images in @cases must have either one band or the same number of bands. ++ * The output image is the same size as @index. Images in @cases are + * expanded to the smallest common format and number of bands. + * + * Combine this with vips_switch() to make something like a case statement or +@@ -299,15 +298,14 @@ vips_casev( VipsImage *index, VipsImage **cases, VipsImage **out, int n, + * Returns: 0 on success, -1 on error + */ + int +-vips_case( VipsImage *index, VipsImage **cases, VipsImage **out, int n, ... ) ++vips_case(VipsImage *index, VipsImage **cases, VipsImage **out, int n, ...) + { + va_list ap; + int result; + +- va_start( ap, n ); +- result = vips_casev( index, cases, out, n, ap ); +- va_end( ap ); ++ va_start(ap, n); ++ result = vips_casev(index, cases, out, n, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/histogram/hist_cum.c b/libvips/histogram/hist_cum.c +index bb2c783d13..1895c391b3 100644 +--- a/libvips/histogram/hist_cum.c ++++ b/libvips/histogram/hist_cum.c +@@ -20,34 +20,34 @@ + * 24/3/10 + * - gtkdoc + * - small cleanups +- * 12/8/13 ++ * 12/8/13 + * - redone im_histcum() as a class, vips_hist_cum() + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -66,58 +66,66 @@ + typedef VipsHistUnary VipsHistCum; + typedef VipsHistUnaryClass VipsHistCumClass; + +-G_DEFINE_TYPE( VipsHistCum, vips_hist_cum, VIPS_TYPE_HIST_UNARY ); +- +-#define ACCUMULATE( ITYPE, OTYPE ) { \ +- for( b = 0; b < nb; b++ ) { \ +- ITYPE *p = (ITYPE *) in[0]; \ +- OTYPE *q = (OTYPE *) out; \ +- OTYPE total; \ +- \ +- total = 0; \ +- for( x = b; x < mx; x += nb ) { \ +- total += p[x]; \ +- q[x] = total; \ ++G_DEFINE_TYPE(VipsHistCum, vips_hist_cum, VIPS_TYPE_HIST_UNARY); ++ ++#define ACCUMULATE(ITYPE, OTYPE) \ ++ { \ ++ for (b = 0; b < nb; b++) { \ ++ ITYPE *p = (ITYPE *) in[0]; \ ++ OTYPE *q = (OTYPE *) out; \ ++ OTYPE total; \ ++\ ++ total = 0; \ ++ for (x = b; x < mx; x += nb) { \ ++ total += p[x]; \ ++ q[x] = total; \ ++ } \ + } \ +- } \ +-} ++ } + + static void +-vips_hist_cum_process( VipsHistogram *histogram, +- VipsPel *out, VipsPel **in, int width ) ++vips_hist_cum_process(VipsHistogram *histogram, ++ VipsPel *out, VipsPel **in, int width) + { +- const int bands = vips_image_get_bands( histogram->ready[0] ); +- const int nb = +- vips_band_format_iscomplex( histogram->ready[0]->BandFmt ) ? +- bands * 2 : bands; ++ const int bands = vips_image_get_bands(histogram->ready[0]); ++ const int nb = ++ vips_band_format_iscomplex(histogram->ready[0]->BandFmt) ? bands * 2 : bands; + int mx = width * nb; + +- int x, b; +- +- switch( vips_image_get_format( histogram->ready[0] ) ) { +- case VIPS_FORMAT_CHAR: +- ACCUMULATE( signed char, signed int ); break; +- case VIPS_FORMAT_UCHAR: +- ACCUMULATE( unsigned char, unsigned int ); break; +- case VIPS_FORMAT_SHORT: +- ACCUMULATE( signed short, signed int ); break; +- case VIPS_FORMAT_USHORT: +- ACCUMULATE( unsigned short, unsigned int ); break; +- case VIPS_FORMAT_INT: +- ACCUMULATE( signed int, signed int ); break; +- case VIPS_FORMAT_UINT: +- ACCUMULATE( unsigned int, unsigned int ); break; +- +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- ACCUMULATE( float, float ); break; +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- ACCUMULATE( double, double ); break; +- +- default: ++ int x, b; ++ ++ switch (vips_image_get_format(histogram->ready[0])) { ++ case VIPS_FORMAT_CHAR: ++ ACCUMULATE(signed char, signed int); ++ break; ++ case VIPS_FORMAT_UCHAR: ++ ACCUMULATE(unsigned char, unsigned int); ++ break; ++ case VIPS_FORMAT_SHORT: ++ ACCUMULATE(signed short, signed int); ++ break; ++ case VIPS_FORMAT_USHORT: ++ ACCUMULATE(unsigned short, unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ ACCUMULATE(signed int, signed int); ++ break; ++ case VIPS_FORMAT_UINT: ++ ACCUMULATE(unsigned int, unsigned int); ++ break; ++ ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ ACCUMULATE(float, float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ ACCUMULATE(double, double); ++ break; ++ ++ default: + g_assert_not_reached(); +- } ++ } + } + + /* Save a bit of typing. +@@ -139,20 +147,20 @@ static const VipsBandFormat vips_hist_cum_format_table[10] = { + }; + + static void +-vips_hist_cum_class_init( VipsHistCumClass *class ) ++vips_hist_cum_class_init(VipsHistCumClass *class) + { + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsHistogramClass *hclass = VIPS_HISTOGRAM_CLASS( class ); ++ VipsHistogramClass *hclass = VIPS_HISTOGRAM_CLASS(class); + + object_class->nickname = "hist_cum"; +- object_class->description = _( "form cumulative histogram" ); ++ object_class->description = _("form cumulative histogram"); + + hclass->format_table = vips_hist_cum_format_table; + hclass->process = vips_hist_cum_process; + } + + static void +-vips_hist_cum_init( VipsHistCum *hist_cum ) ++vips_hist_cum_init(VipsHistCum *hist_cum) + { + } + +@@ -162,21 +170,21 @@ vips_hist_cum_init( VipsHistCum *hist_cum ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Form cumulative histogram. ++ * Form cumulative histogram. + * + * See also: vips_hist_norm(). + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_hist_cum( VipsImage *in, VipsImage **out, ... ) ++int ++vips_hist_cum(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "hist_cum", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("hist_cum", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/histogram/hist_entropy.c b/libvips/histogram/hist_entropy.c +index 28cd1a54bf..e2ffb81a29 100644 +--- a/libvips/histogram/hist_entropy.c ++++ b/libvips/histogram/hist_entropy.c +@@ -1,7 +1,7 @@ + /* estimate entropy + * + * Author: John Cupitt +- * 11/8/15 ++ * 11/8/15 + * - from hist_ismonotonic.c + * 6/3/16 + * - vips_log() call was mangled, thanks Lovell +@@ -9,28 +9,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -44,7 +44,7 @@ + + #include + +-typedef struct _VipsHistEntropy { ++typedef struct _VipsHistEntropy { + VipsOperation parent_instance; + + VipsImage *in; +@@ -54,84 +54,81 @@ typedef struct _VipsHistEntropy { + + typedef VipsOperationClass VipsHistEntropyClass; + +-G_DEFINE_TYPE( VipsHistEntropy, vips_hist_entropy, +- VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsHistEntropy, vips_hist_entropy, ++ VIPS_TYPE_OPERATION); + + static int +-vips_hist_entropy_build( VipsObject *object ) ++vips_hist_entropy_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsHistEntropy *entropy = (VipsHistEntropy *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsHistEntropy *entropy = (VipsHistEntropy *) object; ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); + +- double avg; +- double sum; ++ double avg; ++ double sum; + +- if( VIPS_OBJECT_CLASS( vips_hist_entropy_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_hist_entropy_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_hist( class->nickname, entropy->in ) ) +- return( -1 ); ++ if (vips_check_hist(class->nickname, entropy->in)) ++ return (-1); + + /* Compute: + * norm_hist = hist / sum( hist ) + * entropy = -sum( norm_hist * log2( norm_hist ) ) + */ +- if( vips_avg( entropy->in, &avg, NULL ) ) +- return( -1 ); +- sum = avg * VIPS_IMAGE_N_PELS( entropy->in ) * entropy->in->Bands; +- if( vips_linear1( entropy->in, &t[0], 1.0 / sum, 0, NULL ) || +- vips_log( t[0], &t[1], NULL ) || +- vips_linear1( t[1], &t[2], 1.0 / log( 2.0 ), 0, NULL ) || +- vips_multiply( t[0], t[2], &t[3], NULL ) || +- vips_avg( t[3], &avg, NULL ) ) +- return( -1 ); +- +- g_object_set( entropy, +- "out", -avg * +- VIPS_IMAGE_N_PELS( entropy->in ) * entropy->in->Bands, +- NULL ); +- +- return( 0 ); ++ if (vips_avg(entropy->in, &avg, NULL)) ++ return (-1); ++ sum = avg * VIPS_IMAGE_N_PELS(entropy->in) * entropy->in->Bands; ++ if (vips_linear1(entropy->in, &t[0], 1.0 / sum, 0, NULL) || ++ vips_log(t[0], &t[1], NULL) || ++ vips_linear1(t[1], &t[2], 1.0 / log(2.0), 0, NULL) || ++ vips_multiply(t[0], t[2], &t[3], NULL) || ++ vips_avg(t[3], &avg, NULL)) ++ return (-1); ++ ++ g_object_set(entropy, ++ "out", -avg * VIPS_IMAGE_N_PELS(entropy->in) * entropy->in->Bands, ++ NULL); ++ ++ return (0); + } + + static void +-vips_hist_entropy_class_init( VipsHistEntropyClass *class ) ++vips_hist_entropy_class_init(VipsHistEntropyClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "hist_entropy"; +- object_class->description = _( "estimate image entropy" ); ++ object_class->description = _("estimate image entropy"); + object_class->build = vips_hist_entropy_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input histogram image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input histogram image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsHistEntropy, in ) ); ++ G_STRUCT_OFFSET(VipsHistEntropy, in)); + +- VIPS_ARG_DOUBLE( class, "out", 2, +- _( "Output" ), +- _( "Output value" ), ++ VIPS_ARG_DOUBLE(class, "out", 2, ++ _("Output"), ++ _("Output value"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsHistEntropy, out ), +- -INFINITY, INFINITY, 0.0 ); +- ++ G_STRUCT_OFFSET(VipsHistEntropy, out), ++ -INFINITY, INFINITY, 0.0); + } + + static void +-vips_hist_entropy_init( VipsHistEntropy *entropy ) ++vips_hist_entropy_init(VipsHistEntropy *entropy) + { + } + + /** + * vips_hist_entropy: (method) +- * @in: input histogram ++ * @in: input histogram + * @out: (out): image entropy + * @...: %NULL-terminated list of optional named arguments + * +@@ -145,15 +142,15 @@ vips_hist_entropy_init( VipsHistEntropy *entropy ) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_hist_entropy( VipsImage *in, double *out, ... ) ++int ++vips_hist_entropy(VipsImage *in, double *out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "hist_entropy", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("hist_entropy", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/histogram/hist_equal.c b/libvips/histogram/hist_equal.c +index 198bcd2ae4..c567bb7b35 100644 +--- a/libvips/histogram/hist_equal.c ++++ b/libvips/histogram/hist_equal.c +@@ -4,7 +4,7 @@ + * + * Author: Nicos Dessipris + * Written on: 27/03/1991 +- * Modified on : ++ * Modified on : + * 16/6/93 J.Cupitt + * - im_ioflag() changed to im_iocheck() + * 24/5/95 JC +@@ -13,7 +13,7 @@ + * - more cleanup + * 23/3/10 + * - gtkdoc +- * 12/8/13 ++ * 12/8/13 + * - redone as a class + * 19/6/17 + * - make output format always == input format, thanks Simon +@@ -21,28 +21,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -55,7 +55,7 @@ + + #include + +-typedef struct _VipsHistEqual { ++typedef struct _VipsHistEqual { + VipsOperation parent_instance; + + VipsImage *in; +@@ -68,70 +68,70 @@ typedef struct _VipsHistEqual { + + typedef VipsOperationClass VipsHistEqualClass; + +-G_DEFINE_TYPE( VipsHistEqual, vips_hist_equal, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsHistEqual, vips_hist_equal, VIPS_TYPE_OPERATION); + + static int +-vips_hist_equal_build( VipsObject *object ) ++vips_hist_equal_build(VipsObject *object) + { +- VipsHistEqual *equal = (VipsHistEqual *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 5 ); ++ VipsHistEqual *equal = (VipsHistEqual *) object; ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 5); + +- g_object_set( equal, "out", vips_image_new(), NULL ); ++ g_object_set(equal, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_hist_equal_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_hist_equal_parent_class)->build(object)) ++ return (-1); + + /* norm can return a uchar output for a ushort input if the range is + * small, so make sure we cast back to the input type again. + */ +- if( vips_hist_find( equal->in, &t[0], ++ if (vips_hist_find(equal->in, &t[0], + "band", equal->which, +- NULL ) || +- vips_hist_cum( t[0], &t[1], NULL ) || +- vips_hist_norm( t[1], &t[2], NULL ) || +- vips_cast( t[2], &t[3], equal->in->BandFmt, NULL ) || +- vips_maplut( equal->in, &t[4], t[3], NULL ) || +- vips_image_write( t[4], equal->out ) ) +- return( -1 ); +- +- return( 0 ); ++ NULL) || ++ vips_hist_cum(t[0], &t[1], NULL) || ++ vips_hist_norm(t[1], &t[2], NULL) || ++ vips_cast(t[2], &t[3], equal->in->BandFmt, NULL) || ++ vips_maplut(equal->in, &t[4], t[3], NULL) || ++ vips_image_write(t[4], equal->out)) ++ return (-1); ++ ++ return (0); + } + + static void +-vips_hist_equal_class_init( VipsHistEqualClass *class ) ++vips_hist_equal_class_init(VipsHistEqualClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "hist_equal"; +- object_class->description = _( "histogram equalisation" ); ++ object_class->description = _("histogram equalisation"); + object_class->build = vips_hist_equal_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsHistEqual, in ) ); +- +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsHistEqual, out ) ); +- +- VIPS_ARG_INT( class, "band", 110, +- _( "Band" ), +- _( "Equalise with this band" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsHistEqual, which ), +- -1, 100000, -1 ); ++ G_STRUCT_OFFSET(VipsHistEqual, in)); ++ ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsHistEqual, out)); ++ ++ VIPS_ARG_INT(class, "band", 110, ++ _("Band"), ++ _("Equalise with this band"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsHistEqual, which), ++ -1, 100000, -1); + } + + static void +-vips_hist_equal_init( VipsHistEqual *equal ) ++vips_hist_equal_init(VipsHistEqual *equal) + { + equal->which = -1; + } +@@ -148,21 +148,21 @@ vips_hist_equal_init( VipsHistEqual *equal ) + * + * Histogram-equalise @in. Equalise using band @bandno, or if @bandno is -1, + * equalise bands independently. The output format is always the same as the +- * input format. ++ * input format. + * +- * See also: ++ * See also: + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_hist_equal( VipsImage *in, VipsImage **out, ... ) ++int ++vips_hist_equal(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "hist_equal", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("hist_equal", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/histogram/hist_ismonotonic.c b/libvips/histogram/hist_ismonotonic.c +index 3c6a6cfec8..ec2c7db9a3 100644 +--- a/libvips/histogram/hist_ismonotonic.c ++++ b/libvips/histogram/hist_ismonotonic.c +@@ -19,28 +19,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -53,7 +53,7 @@ + + #include + +-typedef struct _VipsHistIsmonotonic { ++typedef struct _VipsHistIsmonotonic { + VipsOperation parent_instance; + + VipsImage *in; +@@ -63,75 +63,73 @@ typedef struct _VipsHistIsmonotonic { + + typedef VipsOperationClass VipsHistIsmonotonicClass; + +-G_DEFINE_TYPE( VipsHistIsmonotonic, vips_hist_ismonotonic, +- VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsHistIsmonotonic, vips_hist_ismonotonic, ++ VIPS_TYPE_OPERATION); + + static int +-vips_hist_ismonotonic_build( VipsObject *object ) ++vips_hist_ismonotonic_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsHistIsmonotonic *ismonotonic = (VipsHistIsmonotonic *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 4 ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsHistIsmonotonic *ismonotonic = (VipsHistIsmonotonic *) object; ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 4); + +- double m; ++ double m; + +- if( VIPS_OBJECT_CLASS( vips_hist_ismonotonic_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_hist_ismonotonic_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_hist( class->nickname, ismonotonic->in ) ) +- return( -1 ); ++ if (vips_check_hist(class->nickname, ismonotonic->in)) ++ return (-1); + +- if( ismonotonic->in->Xsize == 1 ) +- t[0] = vips_image_new_matrixv( 1, 2, -1.0, 1.0 ); +- else +- t[0] = vips_image_new_matrixv( 2, 1, -1.0, 1.0 ); +- vips_image_set_double( t[0], "offset", 128 ); ++ if (ismonotonic->in->Xsize == 1) ++ t[0] = vips_image_new_matrixv(1, 2, -1.0, 1.0); ++ else ++ t[0] = vips_image_new_matrixv(2, 1, -1.0, 1.0); ++ vips_image_set_double(t[0], "offset", 128); + + /* We want >=128 everywhere, ie. no -ve transitions. + */ +- if( vips_conv( ismonotonic->in, &t[1], t[0], ++ if (vips_conv(ismonotonic->in, &t[1], t[0], + "precision", VIPS_PRECISION_INTEGER, +- NULL ) || +- vips_moreeq_const1( t[1], &t[2], 128, NULL ) || +- vips_min( t[2], &m, NULL ) ) +- return( -1 ); ++ NULL) || ++ vips_moreeq_const1(t[1], &t[2], 128, NULL) || ++ vips_min(t[2], &m, NULL)) ++ return (-1); + +- g_object_set( ismonotonic, "monotonic", (int) m == 255, NULL ); ++ g_object_set(ismonotonic, "monotonic", (int) m == 255, NULL); + +- return( 0 ); ++ return (0); + } + + static void +-vips_hist_ismonotonic_class_init( VipsHistIsmonotonicClass *class ) ++vips_hist_ismonotonic_class_init(VipsHistIsmonotonicClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "hist_ismonotonic"; +- object_class->description = _( "test for monotonicity" ); ++ object_class->description = _("test for monotonicity"); + object_class->build = vips_hist_ismonotonic_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input histogram image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input histogram image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsHistIsmonotonic, in ) ); +- +- VIPS_ARG_BOOL( class, "monotonic", 2, +- _( "Monotonic" ), +- _( "true if in is monotonic" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsHistIsmonotonic, monotonic ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsHistIsmonotonic, in)); ++ ++ VIPS_ARG_BOOL(class, "monotonic", 2, ++ _("Monotonic"), ++ _("true if in is monotonic"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsHistIsmonotonic, monotonic), ++ FALSE); + } + + static void +-vips_hist_ismonotonic_init( VipsHistIsmonotonic *ismonotonic ) ++vips_hist_ismonotonic_init(VipsHistIsmonotonic *ismonotonic) + { + } + +@@ -145,15 +143,15 @@ vips_hist_ismonotonic_init( VipsHistIsmonotonic *ismonotonic ) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_hist_ismonotonic( VipsImage *in, gboolean *out, ... ) ++int ++vips_hist_ismonotonic(VipsImage *in, gboolean *out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "hist_ismonotonic", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("hist_ismonotonic", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/histogram/hist_local.c b/libvips/histogram/hist_local.c +index 00552abf17..8adf4ff346 100644 +--- a/libvips/histogram/hist_local.c ++++ b/libvips/histogram/hist_local.c +@@ -1,10 +1,10 @@ + /* local histogram equalisation + * +- * Copyright: 1991, N. Dessipris ++ * Copyright: 1991, N. Dessipris + * + * Author: N. Dessipris + * Written on: 24/10/1991 +- * Modified on : ++ * Modified on : + * 25/1/96 JC + * - rewritten, adapting im_spcor() + * - correct result, 2x faster, partial, simpler, better arg checking +@@ -31,28 +31,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -83,12 +83,12 @@ typedef struct _VipsHistLocal { + + typedef VipsOperationClass VipsHistLocalClass; + +-G_DEFINE_TYPE( VipsHistLocal, vips_hist_local, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsHistLocal, vips_hist_local, VIPS_TYPE_OPERATION); + + /* Our sequence value: the region this sequence is using, and local stats. + */ + typedef struct { +- VipsRegion *ir; /* Input region */ ++ VipsRegion *ir; /* Input region */ + + /* A 256-element hist for every band. + */ +@@ -96,100 +96,100 @@ typedef struct { + } VipsHistLocalSequence; + + static int +-vips_hist_local_stop( void *vseq, void *a, void *b ) ++vips_hist_local_stop(void *vseq, void *a, void *b) + { + VipsHistLocalSequence *seq = (VipsHistLocalSequence *) vseq; + VipsImage *in = (VipsImage *) a; + +- VIPS_UNREF( seq->ir ); +- if( seq->hist && +- in ) { +- int i; ++ VIPS_UNREF(seq->ir); ++ if (seq->hist && ++ in) { ++ int i; + +- for( i = 0; i < in->Bands; i++ ) +- VIPS_FREE( seq->hist[i] ); ++ for (i = 0; i < in->Bands; i++) ++ VIPS_FREE(seq->hist[i]); + } +- VIPS_FREE( seq->hist ); +- VIPS_FREE( seq ); ++ VIPS_FREE(seq->hist); ++ VIPS_FREE(seq); + +- return( 0 ); ++ return (0); + } + + static void * +-vips_hist_local_start( VipsImage *out, void *a, void *b ) ++vips_hist_local_start(VipsImage *out, void *a, void *b) + { + VipsImage *in = (VipsImage *) a; + VipsHistLocalSequence *seq; + + int i; + +- if( !(seq = VIPS_NEW( NULL, VipsHistLocalSequence )) ) +- return( NULL ); ++ if (!(seq = VIPS_NEW(NULL, VipsHistLocalSequence))) ++ return (NULL); + seq->ir = NULL; + seq->hist = NULL; + +- if( !(seq->ir = vips_region_new( in )) || +- !(seq->hist = VIPS_ARRAY( NULL, in->Bands, unsigned int * )) ) { +- vips_hist_local_stop( seq, NULL, NULL ); +- return( NULL ); ++ if (!(seq->ir = vips_region_new(in)) || ++ !(seq->hist = VIPS_ARRAY(NULL, in->Bands, unsigned int *))) { ++ vips_hist_local_stop(seq, NULL, NULL); ++ return (NULL); + } + +- for( i = 0; i < in->Bands; i++ ) +- if( !(seq->hist[i] = VIPS_ARRAY( NULL, 256, unsigned int )) ) { +- vips_hist_local_stop( seq, NULL, NULL ); +- return( NULL ); +- } ++ for (i = 0; i < in->Bands; i++) ++ if (!(seq->hist[i] = VIPS_ARRAY(NULL, 256, unsigned int))) { ++ vips_hist_local_stop(seq, NULL, NULL); ++ return (NULL); ++ } + +- return( seq ); ++ return (seq); + } + + static int +-vips_hist_local_generate( VipsRegion *or, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_hist_local_generate(VipsRegion * or, ++ void *vseq, void *a, void *b, gboolean *stop) + { + VipsHistLocalSequence *seq = (VipsHistLocalSequence *) vseq; + VipsImage *in = (VipsImage *) a; + const VipsHistLocal *local = (VipsHistLocal *) b; +- VipsRect *r = &or->valid; +- const int bands = in->Bands; ++ VipsRect *r = & or->valid; ++ const int bands = in->Bands; + const int max_slope = local->max_slope; + + VipsRect irect; + int y; + int lsk; +- int centre; /* Offset to move to centre of window */ ++ int centre; /* Offset to move to centre of window */ + + /* What part of ir do we need? + */ + irect.left = r->left; + irect.top = r->top; +- irect.width = r->width + local->width; +- irect.height = r->height + local->height; +- if( vips_region_prepare( seq->ir, &irect ) ) +- return( -1 ); ++ irect.width = r->width + local->width; ++ irect.height = r->height + local->height; ++ if (vips_region_prepare(seq->ir, &irect)) ++ return (-1); + +- lsk = VIPS_REGION_LSKIP( seq->ir ); ++ lsk = VIPS_REGION_LSKIP(seq->ir); + centre = lsk * (local->height / 2) + bands * (local->width / 2); + +- for( y = 0; y < r->height; y++ ) { ++ for (y = 0; y < r->height; y++) { + /* Get input and output pointers for this line. + */ +- VipsPel * restrict p = +- VIPS_REGION_ADDR( seq->ir, r->left, r->top + y ); +- VipsPel * restrict q = +- VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ VipsPel *restrict p = ++ VIPS_REGION_ADDR(seq->ir, r->left, r->top + y); ++ VipsPel *restrict q = ++ VIPS_REGION_ADDR(or, r->left, r->top + y); + +- VipsPel * restrict p1; ++ VipsPel *restrict p1; + int x, i, j, b; + +- /* Find histogram for the start of this line. ++ /* Find histogram for the start of this line. + */ +- for( b = 0; b < bands; b++ ) +- memset( seq->hist[b], 0, 256 * sizeof( unsigned int ) ); ++ for (b = 0; b < bands; b++) ++ memset(seq->hist[b], 0, 256 * sizeof(unsigned int)); + p1 = p; +- for( j = 0; j < local->height; j++ ) { +- for( i = 0, x = 0; x < local->width; x++ ) +- for( b = 0; b < bands; b++, i++ ) ++ for (j = 0; j < local->height; j++) { ++ for (i = 0, x = 0; x < local->width; x++) ++ for (b = 0; b < bands; b++, i++) + seq->hist[b][p1[i]] += 1; + + p1 += lsk; +@@ -197,11 +197,11 @@ vips_hist_local_generate( VipsRegion *or, + + /* Loop for output pels. + */ +- for( x = 0; x < r->width; x++ ) { +- for( b = 0; b < bands; b++ ) { ++ for (x = 0; x < r->width; x++) { ++ for (b = 0; b < bands; b++) { + /* Sum histogram up to current pel. + */ +- unsigned int * restrict hist = seq->hist[b]; ++ unsigned int *restrict hist = seq->hist[b]; + const int target = p[centre + b]; + + int sum; +@@ -210,9 +210,9 @@ vips_hist_local_generate( VipsRegion *or, + + /* For CLAHE we need to limit the height of the + * hist to limit the amount we boost the +- * contrast by. ++ * contrast by. + */ +- if( max_slope > 0 ) { ++ if (max_slope > 0) { + int sum_over; + + sum_over = 0; +@@ -220,19 +220,19 @@ vips_hist_local_generate( VipsRegion *or, + /* Must be <= target, since a cum hist + * always includes the current element. + */ +- for( i = 0; i <= target; i++ ) { +- if( hist[i] > max_slope ) { +- sum_over += hist[i] - ++ for (i = 0; i <= target; i++) { ++ if (hist[i] > max_slope) { ++ sum_over += hist[i] - + max_slope; + sum += max_slope; + } +- else ++ else + sum += hist[i]; + } + +- for( ; i < 256; i++ ) { +- if( hist[i] > max_slope ) +- sum_over += hist[i] - ++ for (; i < 256; i++) { ++ if (hist[i] > max_slope) ++ sum_over += hist[i] - + max_slope; + } + +@@ -244,7 +244,7 @@ vips_hist_local_generate( VipsRegion *or, + } + else { + sum = 0; +- for( i = 0; i <= target; i++ ) ++ for (i = 0; i <= target; i++) + sum += hist[i]; + } + +@@ -254,15 +254,15 @@ vips_hist_local_generate( VipsRegion *or, + * Scale by 255, not 256, or we'll get + * overflow. + */ +- q[b] = 255 * sum / ++ q[b] = 255 * sum / + (local->width * local->height); + +- /* Adapt histogram --- remove the pels from +- * the left hand column, add in pels for a ++ /* Adapt histogram --- remove the pels from ++ * the left hand column, add in pels for a + * new right-hand column. + */ + p1 = p + b; +- for( j = 0; j < local->height; j++ ) { ++ for (j = 0; j < local->height; j++) { + hist[p1[0]] -= 1; + hist[p1[bands * local->width]] += 1; + +@@ -275,125 +275,124 @@ vips_hist_local_generate( VipsRegion *or, + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_hist_local_build( VipsObject *object ) ++vips_hist_local_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsHistLocal *local = (VipsHistLocal *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 3 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 3); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_hist_local_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_hist_local_parent_class)->build(object)) ++ return (-1); + +- in = local->in; ++ in = local->in; + +- if( vips_image_decode( in, &t[0] ) ) +- return( -1 ); +- in = t[0]; ++ if (vips_image_decode(in, &t[0])) ++ return (-1); ++ in = t[0]; + +- if( vips_check_format( class->nickname, in, VIPS_FORMAT_UCHAR ) ) +- return( -1 ); ++ if (vips_check_format(class->nickname, in, VIPS_FORMAT_UCHAR)) ++ return (-1); + +- if( local->width > in->Xsize || +- local->height > in->Ysize ) { +- vips_error( class->nickname, "%s", _( "window too large" ) ); +- return( -1 ); ++ if (local->width > in->Xsize || ++ local->height > in->Ysize) { ++ vips_error(class->nickname, "%s", _("window too large")); ++ return (-1); + } + +- /* Expand the input. ++ /* Expand the input. + */ +- if( vips_embed( in, &t[1], +- local->width / 2, local->height / 2, +- in->Xsize + local->width - 1, in->Ysize + local->height - 1, +- "extend", VIPS_EXTEND_MIRROR, +- NULL ) ) +- return( -1 ); ++ if (vips_embed(in, &t[1], ++ local->width / 2, local->height / 2, ++ in->Xsize + local->width - 1, in->Ysize + local->height - 1, ++ "extend", VIPS_EXTEND_MIRROR, ++ NULL)) ++ return (-1); + in = t[1]; + +- g_object_set( object, "out", vips_image_new(), NULL ); ++ g_object_set(object, "out", vips_image_new(), NULL); + + /* Set demand hints. FATSTRIP is good for us, as THINSTRIP will cause + * too many recalculations on overlaps. + */ +- if( vips_image_pipelinev( local->out, +- VIPS_DEMAND_STYLE_FATSTRIP, in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(local->out, ++ VIPS_DEMAND_STYLE_FATSTRIP, in, NULL)) ++ return (-1); + local->out->Xsize -= local->width - 1; + local->out->Ysize -= local->height - 1; + +- if( vips_image_generate( local->out, +- vips_hist_local_start, +- vips_hist_local_generate, +- vips_hist_local_stop, +- in, local ) ) +- return( -1 ); ++ if (vips_image_generate(local->out, ++ vips_hist_local_start, ++ vips_hist_local_generate, ++ vips_hist_local_stop, ++ in, local)) ++ return (-1); + + local->out->Xoffset = 0; + local->out->Yoffset = 0; + +- vips_reorder_margin_hint( local->out, local->width * local->height ); ++ vips_reorder_margin_hint(local->out, local->width * local->height); + +- return( 0 ); ++ return (0); + } + + static void +-vips_hist_local_class_init( VipsHistLocalClass *class ) ++vips_hist_local_class_init(VipsHistLocalClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "hist_local"; +- object_class->description = _( "local histogram equalisation" ); ++ object_class->description = _("local histogram equalisation"); + object_class->build = vips_hist_local_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsHistLocal, in ) ); ++ G_STRUCT_OFFSET(VipsHistLocal, in)); + +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsHistLocal, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsHistLocal, out)); + +- VIPS_ARG_INT( class, "width", 4, +- _( "Width" ), +- _( "Window width in pixels" ), ++ VIPS_ARG_INT(class, "width", 4, ++ _("Width"), ++ _("Window width in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsHistLocal, width ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsHistLocal, width), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "height", 5, +- _( "Height" ), +- _( "Window height in pixels" ), ++ VIPS_ARG_INT(class, "height", 5, ++ _("Height"), ++ _("Window height in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsHistLocal, height ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsHistLocal, height), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "max_slope", 6, +- _( "Max slope" ), +- _( "Maximum slope (CLAHE)" ), ++ VIPS_ARG_INT(class, "max_slope", 6, ++ _("Max slope"), ++ _("Maximum slope (CLAHE)"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsHistLocal, max_slope ), +- 0, 100, 0 ); +- ++ G_STRUCT_OFFSET(VipsHistLocal, max_slope), ++ 0, 100, 0); + } + + static void +-vips_hist_local_init( VipsHistLocal *local ) ++vips_hist_local_init(VipsHistLocal *local) + { + } + +@@ -410,7 +409,7 @@ vips_hist_local_init( VipsHistLocal *local ) + * * @max_slope: maximum brightening + * + * Performs local histogram equalisation on @in using a +- * window of size @width by @height centered on the input pixel. ++ * window of size @width by @height centered on the input pixel. + * + * The output image is the same size as the input image. The edge pixels are + * created by mirroring the input image outwards. +@@ -424,15 +423,15 @@ vips_hist_local_init( VipsHistLocal *local ) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_hist_local( VipsImage *in, VipsImage **out, int width, int height, ... ) ++int ++vips_hist_local(VipsImage *in, VipsImage **out, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "hist_local", ap, in, out, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("hist_local", ap, in, out, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/histogram/hist_match.c b/libvips/histogram/hist_match.c +index 0c3ac30f40..2501b3a4d1 100644 +--- a/libvips/histogram/hist_match.c ++++ b/libvips/histogram/hist_match.c +@@ -12,7 +12,7 @@ + * 24/3/10 + * - gtkdoc + * - small cleanups +- * 12/8/13 ++ * 12/8/13 + * - redone im_histspec() as a class, vips_hist_match() + * 19/12/13 + * - oop, upcast input +@@ -20,28 +20,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -72,14 +72,14 @@ typedef struct _VipsHistMatch { + + typedef VipsHistogramClass VipsHistMatchClass; + +-G_DEFINE_TYPE( VipsHistMatch, vips_hist_match, VIPS_TYPE_HISTOGRAM ); ++G_DEFINE_TYPE(VipsHistMatch, vips_hist_match, VIPS_TYPE_HISTOGRAM); + + static void +-vips_hist_match_process( VipsHistogram *histogram, +- VipsPel *out, VipsPel **in, int width ) ++vips_hist_match_process(VipsHistogram *histogram, ++ VipsPel *out, VipsPel **in, int width) + { +- VipsHistMatch *match = (VipsHistMatch *) histogram; +- const int bands = match->in->Bands; ++ VipsHistMatch *match = (VipsHistMatch *) histogram; ++ const int bands = match->in->Bands; + const int max = width * bands; + + unsigned int *inbuf = (unsigned int *) in[0]; +@@ -88,119 +88,118 @@ vips_hist_match_process( VipsHistogram *histogram, + + int i, j; + +- for( j = 0; j < bands; j++ ) { ++ for (j = 0; j < bands; j++) { + /* Track up refbuf[] with this. + */ + int ri = j; + int limit = max - bands; + +- for( i = j; i < max; i += bands ) { ++ for (i = j; i < max; i += bands) { + unsigned int inv = inbuf[i]; + +- for( ; ri < limit; ri += bands ) +- if( inv <= refbuf[ri] ) ++ for (; ri < limit; ri += bands) ++ if (inv <= refbuf[ri]) + break; + +- if( ri < limit ) { ++ if (ri < limit) { + /* Simple rounding. + */ +- double mid = refbuf[ri] + ++ double mid = refbuf[ri] + + refbuf[ri + bands] / 2.0; + +- if( inv < mid ) ++ if (inv < mid) + outbuf[i] = ri / bands; + else + outbuf[i] = ri / bands + 1; + } +- else ++ else + outbuf[i] = refbuf[ri]; + } + } + } + + static int +-vips_hist_match_build( VipsObject *object ) ++vips_hist_match_build(VipsObject *object) + { +- VipsHistogram *histogram = VIPS_HISTOGRAM( object ); ++ VipsHistogram *histogram = VIPS_HISTOGRAM(object); + VipsHistMatch *match = (VipsHistMatch *) object; + + histogram->n = 2; +- histogram->in = (VipsImage **) vips_object_local_array( object, 2 ); ++ histogram->in = (VipsImage **) vips_object_local_array(object, 2); + histogram->in[0] = match->in; + histogram->in[1] = match->ref; + +- if( histogram->in[0] ) +- g_object_ref( histogram->in[0] ); +- if( histogram->in[1] ) +- g_object_ref( histogram->in[1] ); ++ if (histogram->in[0]) ++ g_object_ref(histogram->in[0]); ++ if (histogram->in[1]) ++ g_object_ref(histogram->in[1]); + +- if( VIPS_OBJECT_CLASS( vips_hist_match_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_hist_match_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_hist_match_class_init( VipsHistMatchClass *class ) ++vips_hist_match_class_init(VipsHistMatchClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsHistogramClass *hclass = VIPS_HISTOGRAM_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsHistogramClass *hclass = VIPS_HISTOGRAM_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "hist_match"; +- vobject_class->description = _( "match two histograms" ); ++ vobject_class->description = _("match two histograms"); + vobject_class->build = vips_hist_match_build; + +- hclass->input_format = VIPS_FORMAT_UINT; ++ hclass->input_format = VIPS_FORMAT_UINT; + hclass->process = vips_hist_match_process; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input histogram" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input histogram"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsHistMatch, in ) ); ++ G_STRUCT_OFFSET(VipsHistMatch, in)); + +- VIPS_ARG_IMAGE( class, "ref", 2, +- _( "Reference" ), +- _( "Reference histogram" ), ++ VIPS_ARG_IMAGE(class, "ref", 2, ++ _("Reference"), ++ _("Reference histogram"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsHistMatch, ref ) ); +- ++ G_STRUCT_OFFSET(VipsHistMatch, ref)); + } + + static void +-vips_hist_match_init( VipsHistMatch *match ) ++vips_hist_match_init(VipsHistMatch *match) + { + } + + /** + * vips_hist_match: (method) + * @in: input histogram +- * @ref: reference histogram ++ * @ref: reference histogram + * @out: (out): output histogram + * @...: %NULL-terminated list of optional named arguments + * + * Adjust @in to match @ref. If @in and @ref are normalised + * cumulative histograms, @out will be a LUT that adjusts the PDF of the image +- * from which @in was made to match the PDF of @ref's image. ++ * from which @in was made to match the PDF of @ref's image. + * + * See also: vips_maplut(), vips_hist_find(), vips_hist_norm(), +- * vips_hist_cum(). ++ * vips_hist_cum(). + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_hist_match( VipsImage *in, VipsImage *ref, VipsImage **out, ... ) ++int ++vips_hist_match(VipsImage *in, VipsImage *ref, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "hist_match", ap, in, ref, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("hist_match", ap, in, ref, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/histogram/hist_norm.c b/libvips/histogram/hist_norm.c +index e755bfcdcd..29c43b7467 100644 +--- a/libvips/histogram/hist_norm.c ++++ b/libvips/histogram/hist_norm.c +@@ -20,34 +20,34 @@ + * 24/3/10 + * - gtkdoc + * - small cleanups +- * 12/8/13 ++ * 12/8/13 + * - redone im_histnorm() as a class, vips_hist_norm() + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -69,89 +69,89 @@ typedef struct _VipsHistNorm { + + typedef VipsOperationClass VipsHistNormClass; + +-G_DEFINE_TYPE( VipsHistNorm, vips_hist_norm, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsHistNorm, vips_hist_norm, VIPS_TYPE_OPERATION); + + static int +-vips_hist_norm_build( VipsObject *object ) ++vips_hist_norm_build(VipsObject *object) + { + VipsHistNorm *norm = (VipsHistNorm *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 3 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 3); + + guint64 new_max; +- int bands; ++ int bands; + double *a, *b; + int y; + VipsBandFormat fmt; + +- g_object_set( object, "out", vips_image_new(), NULL ); ++ g_object_set(object, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_hist_norm_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_hist_norm_parent_class)->build(object)) ++ return (-1); + + /* Need max for each channel. + */ +- if( vips_stats( norm->in, &t[0], NULL ) ) +- return( -1 ); ++ if (vips_stats(norm->in, &t[0], NULL)) ++ return (-1); + + /* Scale each channel by px / channel max + */ +- new_max = VIPS_IMAGE_N_PELS( norm->in ) - 1; ++ new_max = VIPS_IMAGE_N_PELS(norm->in) - 1; + bands = norm->in->Bands; +- if( !(a = VIPS_ARRAY( object, bands, double )) || +- !(b = VIPS_ARRAY( object, bands, double )) ) +- return( -1 ); +- for( y = 0; y < bands; y++ ) { +- a[y] = new_max / *VIPS_MATRIX( t[0], 1, y + 1 ); ++ if (!(a = VIPS_ARRAY(object, bands, double)) || ++ !(b = VIPS_ARRAY(object, bands, double))) ++ return (-1); ++ for (y = 0; y < bands; y++) { ++ a[y] = new_max / *VIPS_MATRIX(t[0], 1, y + 1); + b[y] = 0; + } + +- if( vips_linear( norm->in, &t[1], a, b, bands, NULL ) ) +- return( -1 ); ++ if (vips_linear(norm->in, &t[1], a, b, bands, NULL)) ++ return (-1); + + /* Make output format as small as we can. + */ +- if( new_max <= 255 ) ++ if (new_max <= 255) + fmt = VIPS_FORMAT_UCHAR; +- else if( new_max <= 65535 ) ++ else if (new_max <= 65535) + fmt = VIPS_FORMAT_USHORT; +- else ++ else + fmt = VIPS_FORMAT_UINT; + +- if( vips_cast( t[1], &t[2], fmt, NULL ) || +- vips_image_write( t[2], norm->out ) ) +- return( -1 ); ++ if (vips_cast(t[1], &t[2], fmt, NULL) || ++ vips_image_write(t[2], norm->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_hist_norm_class_init( VipsHistNormClass *class ) ++vips_hist_norm_class_init(VipsHistNormClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "hist_norm"; +- object_class->description = _( "normalise histogram" ); ++ object_class->description = _("normalise histogram"); + object_class->build = vips_hist_norm_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsHistNorm, in ) ); ++ G_STRUCT_OFFSET(VipsHistNorm, in)); + +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsHistNorm, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsHistNorm, out)); + } + + static void +-vips_hist_norm_init( VipsHistNorm *hist_norm ) ++vips_hist_norm_init(VipsHistNorm *hist_norm) + { + } + +@@ -160,8 +160,8 @@ vips_hist_norm_init( VipsHistNorm *hist_norm ) + * @in: input image + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments +- * +- * Normalise histogram. The maximum of each band becomes equal to the maximum ++ * ++ * Normalise histogram. The maximum of each band becomes equal to the maximum + * index, so for example the max for a uchar image becomes 255. + * Normalise each band separately. + * +@@ -169,15 +169,15 @@ vips_hist_norm_init( VipsHistNorm *hist_norm ) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_hist_norm( VipsImage *in, VipsImage **out, ... ) ++int ++vips_hist_norm(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "hist_norm", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("hist_norm", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/histogram/hist_plot.c b/libvips/histogram/hist_plot.c +index 1999013ae6..8481f5f17d 100644 +--- a/libvips/histogram/hist_plot.c ++++ b/libvips/histogram/hist_plot.c +@@ -16,7 +16,7 @@ + * 26/9/99 JC + * - oooops, graph float was wrong + * 17/11/99 JC +- * - oops, failed for all 0's histogram ++ * - oops, failed for all 0's histogram + * 14/12/05 + * - redone plot function in C, also use incheck() to cache calcs + * - much, much faster! +@@ -32,28 +32,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -79,181 +79,215 @@ typedef struct _VipsHistPlot { + + typedef VipsOperationClass VipsHistPlotClass; + +-G_DEFINE_TYPE( VipsHistPlot, vips_hist_plot, VIPS_TYPE_OPERATION ); +- +-#define VERT( TYPE ) { \ +- TYPE *p1 = (TYPE *) p; \ +- \ +- for( x = le; x < ri; x++ ) { \ +- for( z = 0; z < nb; z++ ) \ +- q[z] = p1[z] < ((TYPE) x) ? 0 : 255; \ +- \ +- q += nb; \ +- } \ +-} ++G_DEFINE_TYPE(VipsHistPlot, vips_hist_plot, VIPS_TYPE_OPERATION); ++ ++#define VERT(TYPE) \ ++ { \ ++ TYPE *p1 = (TYPE *) p; \ ++\ ++ for (x = le; x < ri; x++) { \ ++ for (z = 0; z < nb; z++) \ ++ q[z] = p1[z] < ((TYPE) x) ? 0 : 255; \ ++\ ++ q += nb; \ ++ } \ ++ } + + /* Generate function. + */ + static int +-vips_hist_plot_vert_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++vips_hist_plot_vert_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + VipsImage *in = (VipsImage *) a; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; + int to = r->top; +- int ri = VIPS_RECT_RIGHT( r ); +- int bo = VIPS_RECT_BOTTOM( r ); ++ int ri = VIPS_RECT_RIGHT(r); ++ int bo = VIPS_RECT_BOTTOM(r); + int nb = in->Bands; + + int x, y, z; + +- for( y = to; y < bo; y++ ) { +- VipsPel *q = VIPS_REGION_ADDR( or, le, y ); +- VipsPel *p = VIPS_IMAGE_ADDR( in, 0, y ); +- +- switch( in->BandFmt ) { +- case VIPS_FORMAT_UCHAR: VERT( unsigned char ); break; +- case VIPS_FORMAT_CHAR: VERT( signed char ); break; +- case VIPS_FORMAT_USHORT: VERT( unsigned short ); break; +- case VIPS_FORMAT_SHORT: VERT( signed short ); break; +- case VIPS_FORMAT_UINT: VERT( unsigned int ); break; +- case VIPS_FORMAT_INT: VERT( signed int ); break; +- case VIPS_FORMAT_FLOAT: VERT( float ); break; +- case VIPS_FORMAT_DOUBLE: VERT( double ); break; ++ for (y = to; y < bo; y++) { ++ VipsPel *q = VIPS_REGION_ADDR(or, le, y); ++ VipsPel *p = VIPS_IMAGE_ADDR(in, 0, y); ++ ++ switch (in->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ VERT(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ VERT(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ VERT(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ VERT(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ VERT(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ VERT(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ VERT(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ VERT(double); ++ break; + + default: +- g_assert_not_reached(); ++ g_assert_not_reached(); + } + } + +- return( 0 ); ++ return (0); + } + +-#define HORZ( TYPE ) { \ +- TYPE *p1 = (TYPE *) p; \ +- \ +- for( y = to; y < bo; y++ ) { \ +- for( z = 0; z < nb; z++ ) \ +- q[z] = p1[z] < ((TYPE) (ht - y)) ? 0 : 255; \ +- \ +- q += lsk; \ +- } \ +-} ++#define HORZ(TYPE) \ ++ { \ ++ TYPE *p1 = (TYPE *) p; \ ++\ ++ for (y = to; y < bo; y++) { \ ++ for (z = 0; z < nb; z++) \ ++ q[z] = p1[z] < ((TYPE) (ht - y)) ? 0 : 255; \ ++\ ++ q += lsk; \ ++ } \ ++ } + + /* Generate function. + */ + static int +-vips_hist_plot_horz_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++vips_hist_plot_horz_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + VipsImage *in = (VipsImage *) a; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; + int to = r->top; +- int ri = VIPS_RECT_RIGHT( r ); +- int bo = VIPS_RECT_BOTTOM( r ); ++ int ri = VIPS_RECT_RIGHT(r); ++ int bo = VIPS_RECT_BOTTOM(r); + int nb = in->Bands; +- int lsk = VIPS_REGION_LSKIP( or ); ++ int lsk = VIPS_REGION_LSKIP(or); + int ht = or->im->Ysize; + + int x, y, z; + +- for( x = le; x < ri; x++ ) { +- VipsPel *q = VIPS_REGION_ADDR( or, x, to ); +- VipsPel *p = VIPS_IMAGE_ADDR( in, x, 0 ); +- +- switch( in->BandFmt ) { +- case VIPS_FORMAT_UCHAR: HORZ( unsigned char ); break; +- case VIPS_FORMAT_CHAR: HORZ( signed char ); break; +- case VIPS_FORMAT_USHORT: HORZ( unsigned short ); break; +- case VIPS_FORMAT_SHORT: HORZ( signed short ); break; +- case VIPS_FORMAT_UINT: HORZ( unsigned int ); break; +- case VIPS_FORMAT_INT: HORZ( signed int ); break; +- case VIPS_FORMAT_FLOAT: HORZ( float ); break; +- case VIPS_FORMAT_DOUBLE: HORZ( double ); break; ++ for (x = le; x < ri; x++) { ++ VipsPel *q = VIPS_REGION_ADDR(or, x, to); ++ VipsPel *p = VIPS_IMAGE_ADDR(in, x, 0); ++ ++ switch (in->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ HORZ(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ HORZ(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ HORZ(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ HORZ(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ HORZ(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ HORZ(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ HORZ(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ HORZ(double); ++ break; + + default: + g_assert_not_reached(); + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_hist_plot_build( VipsObject *object ) ++vips_hist_plot_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsHistPlot *plot = (VipsHistPlot *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + + VipsImage *in; + double min, max; + int width, height, tsize; + VipsGenerateFn generate_fn; + +- g_object_set( plot, "out", vips_image_new(), NULL ); ++ g_object_set(plot, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_hist_plot_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_hist_plot_parent_class)->build(object)) ++ return (-1); + + in = plot->in; + +- if( vips_check_uncoded( class->nickname, in ) || +- vips_check_noncomplex( class->nickname, in ) || +- vips_check_hist( class->nickname, in ) ) +- return( -1 ); ++ if (vips_check_uncoded(class->nickname, in) || ++ vips_check_noncomplex(class->nickname, in) || ++ vips_check_hist(class->nickname, in)) ++ return (-1); + +- if( !vips_band_format_isuint( in->BandFmt ) && +- vips_band_format_isint( in->BandFmt ) ) { +- /* A signed int type. Move min up to 0. ++ if (!vips_band_format_isuint(in->BandFmt) && ++ vips_band_format_isint(in->BandFmt)) { ++ /* A signed int type. Move min up to 0. + */ + double min; + +- if( vips_min( in, &min, NULL ) || +- vips_linear1( in, &t[0], 1.0, -min, NULL ) ) +- return( -1 ); ++ if (vips_min(in, &min, NULL) || ++ vips_linear1(in, &t[0], 1.0, -min, NULL)) ++ return (-1); + + in = t[0]; + } +- else if( vips_band_format_isfloat( in->BandFmt ) ) { ++ else if (vips_band_format_isfloat(in->BandFmt)) { + /* Float image: scale min--max to 0--any. Output square + * graph. + */ + int any = in->Xsize * in->Ysize; + +- if( vips_stats( in, &t[0], NULL ) ) +- return( -1 ); +- min = *VIPS_MATRIX( t[0], 0, 0 ); +- max = *VIPS_MATRIX( t[0], 1, 0 ); ++ if (vips_stats(in, &t[0], NULL)) ++ return (-1); ++ min = *VIPS_MATRIX(t[0], 0, 0); ++ max = *VIPS_MATRIX(t[0], 1, 0); + +- if( vips_linear1( in, &t[1], +- any / (max - min), -min * any / (max - min), NULL ) ) +- return( -1 ); ++ if (vips_linear1(in, &t[1], ++ any / (max - min), -min * any / (max - min), NULL)) ++ return (-1); + + in = t[1]; + } + +- if( vips_image_wio_input( in ) ) +- return( -1 ); ++ if (vips_image_wio_input(in)) ++ return (-1); + + /* Find range we will plot. + */ +- if( vips_max( in, &max, NULL ) ) +- return( -1 ); +- g_assert( max >= 0 ); +- if( in->BandFmt == VIPS_FORMAT_UCHAR ) ++ if (vips_max(in, &max, NULL)) ++ return (-1); ++ g_assert(max >= 0); ++ if (in->BandFmt == VIPS_FORMAT_UCHAR) + tsize = 256; + else +- tsize = VIPS_CEIL( max ); ++ tsize = VIPS_CEIL(max); + + /* Make sure we don't make a zero height image. + */ +- if( tsize == 0 ) ++ if (tsize == 0) + tsize = 1; + +- if( in->Xsize == 1 ) { ++ if (in->Xsize == 1) { + /* Vertical graph. + */ + width = tsize; +@@ -270,46 +304,46 @@ vips_hist_plot_build( VipsObject *object ) + + /* Set image. + */ +- vips_image_init_fields( plot->out, width, height, in->Bands, +- VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, +- VIPS_INTERPRETATION_HISTOGRAM, +- 1.0, 1.0 ); +- if( vips_image_pipelinev( plot->out, VIPS_DEMAND_STYLE_ANY, NULL ) || +- vips_image_generate( plot->out, +- NULL, generate_fn, NULL, in, NULL ) ) +- return( -1 ); +- +- return( 0 ); ++ vips_image_init_fields(plot->out, width, height, in->Bands, ++ VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, ++ VIPS_INTERPRETATION_HISTOGRAM, ++ 1.0, 1.0); ++ if (vips_image_pipelinev(plot->out, VIPS_DEMAND_STYLE_ANY, NULL) || ++ vips_image_generate(plot->out, ++ NULL, generate_fn, NULL, in, NULL)) ++ return (-1); ++ ++ return (0); + } + + static void +-vips_hist_plot_class_init( VipsHistPlotClass *class ) ++vips_hist_plot_class_init(VipsHistPlotClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "hist_plot"; +- object_class->description = _( "plot histogram" ); ++ object_class->description = _("plot histogram"); + object_class->build = vips_hist_plot_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsHistPlot, in ) ); ++ G_STRUCT_OFFSET(VipsHistPlot, in)); + +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsHistPlot, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsHistPlot, out)); + } + + static void +-vips_hist_plot_init( VipsHistPlot *hist_plot ) ++vips_hist_plot_init(VipsHistPlot *hist_plot) + { + } + +@@ -319,32 +353,30 @@ vips_hist_plot_init( VipsHistPlot *hist_plot ) + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments + * +- * Plot a 1 by any or any by 1 image file as a max by any or ++ * Plot a 1 by any or any by 1 image file as a max by any or + * any by max image using these rules: +- * +- * unsigned char max is always 256 + * +- * other unsigned integer types output 0 - maxium ++ * unsigned char max is always 256 ++ * ++ * other unsigned integer types output 0 - maxium + * value of @in. + * + * signed int types min moved to 0, max moved to max + min. + * +- * float types min moved to 0, max moved to any ++ * float types min moved to 0, max moved to any + * (square output) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_hist_plot( VipsImage *in, VipsImage **out, ... ) ++int ++vips_hist_plot(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "hist_plot", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("hist_plot", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +- +diff --git a/libvips/histogram/hist_unary.c b/libvips/histogram/hist_unary.c +index 4e8219fef4..2b1ae3f68c 100644 +--- a/libvips/histogram/hist_unary.c ++++ b/libvips/histogram/hist_unary.c +@@ -6,28 +6,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -50,50 +50,48 @@ + #include "phistogram.h" + #include "hist_unary.h" + +-G_DEFINE_ABSTRACT_TYPE( VipsHistUnary, vips_hist_unary, VIPS_TYPE_HISTOGRAM ); ++G_DEFINE_ABSTRACT_TYPE(VipsHistUnary, vips_hist_unary, VIPS_TYPE_HISTOGRAM); + + static int +-vips_hist_unary_build( VipsObject *object ) ++vips_hist_unary_build(VipsObject *object) + { +- VipsHistogram *histogram = VIPS_HISTOGRAM( object ); +- VipsHistUnary *unary = VIPS_HIST_UNARY( object ); ++ VipsHistogram *histogram = VIPS_HISTOGRAM(object); ++ VipsHistUnary *unary = VIPS_HIST_UNARY(object); + + histogram->n = 1; +- histogram->in = (VipsImage **) vips_object_local_array( object, 1 ); ++ histogram->in = (VipsImage **) vips_object_local_array(object, 1); + histogram->in[0] = unary->in; + +- if( histogram->in[0] ) +- g_object_ref( histogram->in[0] ); ++ if (histogram->in[0]) ++ g_object_ref(histogram->in[0]); + +- if( VIPS_OBJECT_CLASS( vips_hist_unary_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_hist_unary_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_hist_unary_class_init( VipsHistUnaryClass *class ) ++vips_hist_unary_class_init(VipsHistUnaryClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "hist_unary"; +- vobject_class->description = _( "hist_unary operations" ); ++ vobject_class->description = _("hist_unary operations"); + vobject_class->build = vips_hist_unary_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsHistUnary, in ) ); +- ++ G_STRUCT_OFFSET(VipsHistUnary, in)); + } + + static void +-vips_hist_unary_init( VipsHistUnary *hist_unary ) ++vips_hist_unary_init(VipsHistUnary *hist_unary) + { + } +diff --git a/libvips/histogram/hist_unary.h b/libvips/histogram/hist_unary.h +index aaf416aa6e..3279788389 100644 +--- a/libvips/histogram/hist_unary.h ++++ b/libvips/histogram/hist_unary.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -38,19 +38,19 @@ extern "C" { + #include + + #define VIPS_TYPE_HIST_UNARY (vips_hist_unary_get_type()) +-#define VIPS_HIST_UNARY( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_HIST_UNARY, VipsHistUnary )) +-#define VIPS_HIST_UNARY_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_HIST_UNARY(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_HIST_UNARY, VipsHistUnary)) ++#define VIPS_HIST_UNARY_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_HIST_UNARY, VipsHistUnaryClass)) ++#define VIPS_IS_HIST_UNARY(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_HIST_UNARY)) ++#define VIPS_IS_HIST_UNARY_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_HIST_UNARY)) ++#define VIPS_HIST_UNARY_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_HIST_UNARY, VipsHistUnaryClass)) +-#define VIPS_IS_HIST_UNARY( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_HIST_UNARY )) +-#define VIPS_IS_HIST_UNARY_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_HIST_UNARY )) +-#define VIPS_HIST_UNARY_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_HIST_UNARY, VipsHistUnaryClass )) + + typedef struct _VipsHistUnary { + VipsHistogram parent_instance; +@@ -64,12 +64,10 @@ typedef struct _VipsHistUnaryClass { + + } VipsHistUnaryClass; + +-GType vips_hist_unary_get_type( void ); ++GType vips_hist_unary_get_type(void); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_PHIST_UNARY_H*/ +- +- +diff --git a/libvips/histogram/histogram.c b/libvips/histogram/histogram.c +index a4185f0d72..51a9c5cf9c 100644 +--- a/libvips/histogram/histogram.c ++++ b/libvips/histogram/histogram.c +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -56,17 +56,17 @@ + * @include: vips/vips.h + * + * Histograms and look-up tables are 1xn or nx1 images, where n is less than +- * 256 or less than 65536, corresponding to 8- and 16-bit unsigned int images. +- * They are tagged with a #VipsInterpretation of +- * #VIPS_INTERPRETATION_HISTOGRAM and usually displayed by user-interfaces ++ * 256 or less than 65536, corresponding to 8- and 16-bit unsigned int images. ++ * They are tagged with a #VipsInterpretation of ++ * #VIPS_INTERPRETATION_HISTOGRAM and usually displayed by user-interfaces + * such as nip2 as plots rather than images. + * +- * These functions can be broadly grouped as things to find or build ++ * These functions can be broadly grouped as things to find or build + * histograms (vips_hist_find(), vips_hist_find_indexed(), +- * vips_hist_find_ndim(), vips_buildlut(), vips_identity()), +- * operations that +- * manipulate histograms in some way (vips_hist_cum(), vips_hist_norm()), +- * operations to apply histograms (vips_maplut()), and a variety of utility ++ * vips_hist_find_ndim(), vips_buildlut(), vips_identity()), ++ * operations that ++ * manipulate histograms in some way (vips_hist_cum(), vips_hist_norm()), ++ * operations to apply histograms (vips_maplut()), and a variety of utility + * operations. + * + * A final group of operations build tone curves. These are useful in +@@ -74,46 +74,46 @@ + * for CIELAB images, but might be useful elsewhere. + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsHistogram, vips_histogram, VIPS_TYPE_OPERATION ); ++G_DEFINE_ABSTRACT_TYPE(VipsHistogram, vips_histogram, VIPS_TYPE_OPERATION); + +-/* sizealike by expanding in just one dimension and copying the final element. ++/* sizealike by expanding in just one dimension and copying the final element. + */ + static int +-vips__hist_sizealike_vec( VipsImage **in, VipsImage **out, int n ) ++vips__hist_sizealike_vec(VipsImage **in, VipsImage **out, int n) + { + int i; + int max_size; + +- g_assert( n >= 1 ); ++ g_assert(n >= 1); + +- max_size = VIPS_MAX( in[0]->Xsize, in[0]->Ysize ); +- for( i = 1; i < n; i++ ) +- max_size = VIPS_MAX( max_size, +- VIPS_MAX( in[0]->Xsize, in[0]->Ysize ) ); ++ max_size = VIPS_MAX(in[0]->Xsize, in[0]->Ysize); ++ for (i = 1; i < n; i++) ++ max_size = VIPS_MAX(max_size, ++ VIPS_MAX(in[0]->Xsize, in[0]->Ysize)); + +- for( i = 0; i < n; i++ ) +- if( in[i]->Ysize == 1 ) { +- if( vips_embed( in[i], &out[i], 0, 0, max_size, 1, +- "extend", VIPS_EXTEND_COPY, +- NULL ) ) +- return( -1 ); ++ for (i = 0; i < n; i++) ++ if (in[i]->Ysize == 1) { ++ if (vips_embed(in[i], &out[i], 0, 0, max_size, 1, ++ "extend", VIPS_EXTEND_COPY, ++ NULL)) ++ return (-1); + } + else { +- if( vips_embed( in[i], &out[i], 0, 0, 1, max_size, +- "extend", VIPS_EXTEND_COPY, +- NULL ) ) +- return( -1 ); ++ if (vips_embed(in[i], &out[i], 0, 0, 1, max_size, ++ "extend", VIPS_EXTEND_COPY, ++ NULL)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_histogram_build( VipsObject *object ) ++vips_histogram_build(VipsObject *object) + { +- VipsHistogram *histogram = VIPS_HISTOGRAM( object ); +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsHistogramClass *hclass = VIPS_HISTOGRAM_GET_CLASS( histogram ); ++ VipsHistogram *histogram = VIPS_HISTOGRAM(object); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsHistogramClass *hclass = VIPS_HISTOGRAM_GET_CLASS(histogram); + + VipsImage **decode; + VipsImage **format; +@@ -121,106 +121,106 @@ vips_histogram_build( VipsObject *object ) + VipsImage **size; + VipsImage **memory; + +- VipsPel *outbuf; +- VipsPel **inbuf; ++ VipsPel *outbuf; ++ VipsPel **inbuf; + int i; + + #ifdef DEBUG +- printf( "vips_histogram_build: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_histogram_build: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- if( VIPS_OBJECT_CLASS( vips_histogram_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_histogram_parent_class)->build(object)) ++ return (-1); + +- g_assert( histogram->n > 0 ); ++ g_assert(histogram->n > 0); + + /* Must be NULL-terminated. + */ +- g_assert( !histogram->in[histogram->n] ); ++ g_assert(!histogram->in[histogram->n]); + +- decode = (VipsImage **) vips_object_local_array( object, histogram->n ); +- format = (VipsImage **) vips_object_local_array( object, histogram->n ); +- band = (VipsImage **) vips_object_local_array( object, histogram->n ); +- size = (VipsImage **) vips_object_local_array( object, histogram->n ); +- memory = (VipsImage **) vips_object_local_array( object, histogram->n ); ++ decode = (VipsImage **) vips_object_local_array(object, histogram->n); ++ format = (VipsImage **) vips_object_local_array(object, histogram->n); ++ band = (VipsImage **) vips_object_local_array(object, histogram->n); ++ size = (VipsImage **) vips_object_local_array(object, histogram->n); ++ memory = (VipsImage **) vips_object_local_array(object, histogram->n); + +- g_object_set( histogram, "out", vips_image_new(), NULL ); ++ g_object_set(histogram, "out", vips_image_new(), NULL); + +- for( i = 0; i < histogram->n; i++ ) +- if( vips_image_decode( histogram->in[i], &decode[i] ) || +- vips_check_hist( class->nickname, decode[i] ) ) +- return( -1 ); ++ for (i = 0; i < histogram->n; i++) ++ if (vips_image_decode(histogram->in[i], &decode[i]) || ++ vips_check_hist(class->nickname, decode[i])) ++ return (-1); + + /* Cast our input images up to a common format, bands and size. If + * input_format is set, cast to a fixed input type. + */ +- if( hclass->input_format != VIPS_FORMAT_NOTSET ) { +- for( i = 0; i < histogram->n; i++ ) +- if( vips_cast( decode[i], &format[i], +- hclass->input_format, NULL ) ) +- return( -1 ); ++ if (hclass->input_format != VIPS_FORMAT_NOTSET) { ++ for (i = 0; i < histogram->n; i++) ++ if (vips_cast(decode[i], &format[i], ++ hclass->input_format, NULL)) ++ return (-1); + } + else { +- if( vips__formatalike_vec( decode, format, histogram->n ) ) +- return( -1 ); ++ if (vips__formatalike_vec(decode, format, histogram->n)) ++ return (-1); + } +- +- if( vips__bandalike_vec( class->nickname, +- format, band, histogram->n, 1 ) || +- vips__hist_sizealike_vec( band, size, histogram->n ) ) +- return( -1 ); + +- if( vips_image_pipeline_array( histogram->out, +- VIPS_DEMAND_STYLE_THINSTRIP, size ) ) +- return( -1 ); ++ if (vips__bandalike_vec(class->nickname, ++ format, band, histogram->n, 1) || ++ vips__hist_sizealike_vec(band, size, histogram->n)) ++ return (-1); ++ ++ if (vips_image_pipeline_array(histogram->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, size)) ++ return (-1); + + /* Need a copy of the inputs in memory. + */ +- if( !(inbuf = VIPS_ARRAY( object, histogram->n + 1, VipsPel * )) ) +- return( -1 ); +- for( i = 0; i < histogram->n; i++ ) { +- if( !(memory[i] = vips_image_copy_memory( size[i] )) ) +- return( -1 ); +- inbuf[i] = VIPS_IMAGE_ADDR( memory[i], 0, 0 ); ++ if (!(inbuf = VIPS_ARRAY(object, histogram->n + 1, VipsPel *))) ++ return (-1); ++ for (i = 0; i < histogram->n; i++) { ++ if (!(memory[i] = vips_image_copy_memory(size[i]))) ++ return (-1); ++ inbuf[i] = VIPS_IMAGE_ADDR(memory[i], 0, 0); + } +- inbuf[i] = NULL; ++ inbuf[i] = NULL; + + /* Keep a copy of the memory images here for subclasses. + */ + histogram->ready = memory; + +- histogram->out->Xsize = VIPS_IMAGE_N_PELS( histogram->ready[0] ); ++ histogram->out->Xsize = VIPS_IMAGE_N_PELS(histogram->ready[0]); + histogram->out->Ysize = 1; +- if( hclass->format_table ) +- histogram->out->BandFmt = ++ if (hclass->format_table) ++ histogram->out->BandFmt = + hclass->format_table[histogram->ready[0]->BandFmt]; + histogram->out->Type = VIPS_INTERPRETATION_HISTOGRAM; + +- if( !(outbuf = vips_malloc( object, +- VIPS_IMAGE_SIZEOF_LINE( histogram->out ))) ) +- return( -1 ); ++ if (!(outbuf = vips_malloc(object, ++ VIPS_IMAGE_SIZEOF_LINE(histogram->out)))) ++ return (-1); + +- hclass->process( histogram, outbuf, inbuf, histogram->ready[0]->Xsize ); ++ hclass->process(histogram, outbuf, inbuf, histogram->ready[0]->Xsize); + +- if( vips_image_write_line( histogram->out, 0, outbuf ) ) +- return( -1 ); ++ if (vips_image_write_line(histogram->out, 0, outbuf)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_histogram_class_init( VipsHistogramClass *class ) ++vips_histogram_class_init(VipsHistogramClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "histogram"; +- vobject_class->description = _( "histogram operations" ); ++ vobject_class->description = _("histogram operations"); + vobject_class->build = vips_histogram_build; + + class->input_format = VIPS_FORMAT_NOTSET; +@@ -228,16 +228,15 @@ vips_histogram_class_init( VipsHistogramClass *class ) + /* Inputs set by subclassess. + */ + +- VIPS_ARG_IMAGE( class, "out", 10, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsHistogram, out ) ); +- ++ VIPS_ARG_IMAGE(class, "out", 10, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsHistogram, out)); + } + + static void +-vips_histogram_init( VipsHistogram *histogram ) ++vips_histogram_init(VipsHistogram *histogram) + { + /* Sanity check this above. + */ +@@ -248,20 +247,20 @@ vips_histogram_init( VipsHistogram *histogram ) + * instead? + */ + void +-vips_histogram_operation_init( void ) ++vips_histogram_operation_init(void) + { +- extern GType vips_maplut_get_type( void ); +- extern GType vips_case_get_type( void ); +- extern GType vips_percent_get_type( void ); +- extern GType vips_hist_cum_get_type( void ); +- extern GType vips_hist_norm_get_type( void ); +- extern GType vips_hist_equal_get_type( void ); +- extern GType vips_hist_plot_get_type( void ); +- extern GType vips_hist_match_get_type( void ); +- extern GType vips_hist_local_get_type( void ); +- extern GType vips_hist_ismonotonic_get_type( void ); +- extern GType vips_hist_entropy_get_type( void ); +- extern GType vips_stdif_get_type( void ); ++ extern GType vips_maplut_get_type(void); ++ extern GType vips_case_get_type(void); ++ extern GType vips_percent_get_type(void); ++ extern GType vips_hist_cum_get_type(void); ++ extern GType vips_hist_norm_get_type(void); ++ extern GType vips_hist_equal_get_type(void); ++ extern GType vips_hist_plot_get_type(void); ++ extern GType vips_hist_match_get_type(void); ++ extern GType vips_hist_local_get_type(void); ++ extern GType vips_hist_ismonotonic_get_type(void); ++ extern GType vips_hist_entropy_get_type(void); ++ extern GType vips_stdif_get_type(void); + + vips_maplut_get_type(); + vips_case_get_type(); +@@ -274,5 +273,5 @@ vips_histogram_operation_init( void ) + vips_hist_match_get_type(); + vips_hist_local_get_type(); + vips_hist_ismonotonic_get_type(); +- vips_hist_entropy_get_type(); ++ vips_hist_entropy_get_type(); + } +diff --git a/libvips/histogram/maplut.c b/libvips/histogram/maplut.c +index 2598b3b0f3..f7f0f374ad 100644 +--- a/libvips/histogram/maplut.c ++++ b/libvips/histogram/maplut.c +@@ -37,28 +37,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -79,327 +79,345 @@ typedef struct _VipsMaplut { + VipsImage *in; + VipsImage *out; + VipsImage *lut; +- int band; ++ int band; + +- int fmt; /* LUT image BandFmt */ +- int nb; /* Number of bands in lut */ +- int es; /* VIPS_IMAGE_SIZEOF_ELEMENT() for lut image */ +- int sz; /* Number of elements in minor dimension */ +- int clp; /* Value we clip against */ +- VipsPel **table; /* Lut converted to 2d array */ +- int overflow; /* Number of overflows for non-uchar lut */ ++ int fmt; /* LUT image BandFmt */ ++ int nb; /* Number of bands in lut */ ++ int es; /* VIPS_IMAGE_SIZEOF_ELEMENT() for lut image */ ++ int sz; /* Number of elements in minor dimension */ ++ int clp; /* Value we clip against */ ++ VipsPel **table; /* Lut converted to 2d array */ ++ int overflow; /* Number of overflows for non-uchar lut */ + + } VipsMaplut; + + typedef VipsOperationClass VipsMaplutClass; + +-G_DEFINE_TYPE( VipsMaplut, vips_maplut, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsMaplut, vips_maplut, VIPS_TYPE_OPERATION); + + static void +-vips_maplut_preeval( VipsImage *image, VipsProgress *progress, +- VipsMaplut *maplut ) ++vips_maplut_preeval(VipsImage *image, VipsProgress *progress, ++ VipsMaplut *maplut) + { + maplut->overflow = 0; + } + + static void +-vips_maplut_posteval( VipsImage *image, VipsProgress *progress, +- VipsMaplut *maplut ) ++vips_maplut_posteval(VipsImage *image, VipsProgress *progress, ++ VipsMaplut *maplut) + { +- if( maplut->overflow ) +- g_warning( _( "%d overflows detected" ), maplut->overflow ); ++ if (maplut->overflow) ++ g_warning(_("%d overflows detected"), maplut->overflow); + } + + /* Our sequence value: the region this sequence is using, and local stats. + */ + typedef struct { +- VipsRegion *ir; /* Input region */ +- int overflow; /* Number of overflows */ ++ VipsRegion *ir; /* Input region */ ++ int overflow; /* Number of overflows */ + } VipsMaplutSequence; + + /* Our start function. + */ + static void * +-vips_maplut_start( VipsImage *out, void *a, void *b ) ++vips_maplut_start(VipsImage *out, void *a, void *b) + { + VipsImage *in = (VipsImage *) a; + VipsMaplutSequence *seq; + +- if( !(seq = VIPS_NEW( out, VipsMaplutSequence )) ) +- return( NULL ); ++ if (!(seq = VIPS_NEW(out, VipsMaplutSequence))) ++ return (NULL); + + /* Init! + */ + seq->ir = NULL; + seq->overflow = 0; + +- if( !(seq->ir = vips_region_new( in )) ) +- return( NULL ); ++ if (!(seq->ir = vips_region_new(in))) ++ return (NULL); + +- return( seq ); ++ return (seq); + } + + /* Map through n non-complex luts. + */ +-#define loop( OUT ) { \ +- int b = maplut->nb; \ +- \ +- for( y = to; y < bo; y++ ) { \ +- for( z = 0; z < b; z++ ) { \ +- VipsPel *p = VIPS_REGION_ADDR( ir, le, y ); \ +- OUT *q = (OUT *) VIPS_REGION_ADDR( or, le, y ); \ +- OUT *tlut = (OUT *) maplut->table[z]; \ +- \ +- for( x = z; x < ne; x += b ) \ +- q[x] = tlut[p[x]]; \ ++#define loop(OUT) \ ++ { \ ++ int b = maplut->nb; \ ++\ ++ for (y = to; y < bo; y++) { \ ++ for (z = 0; z < b; z++) { \ ++ VipsPel *p = VIPS_REGION_ADDR(ir, le, y); \ ++ OUT *q = (OUT *) VIPS_REGION_ADDR(or, le, y); \ ++ OUT *tlut = (OUT *) maplut->table[z]; \ ++\ ++ for (x = z; x < ne; x += b) \ ++ q[x] = tlut[p[x]]; \ ++ } \ + } \ +- } \ +-} ++ } + + /* Map through n complex luts. + */ +-#define loopc( OUT ) { \ +- int b = in->Bands; \ +- \ +- for( y = to; y < bo; y++ ) { \ +- for( z = 0; z < b; z++ ) { \ +- VipsPel *p = VIPS_REGION_ADDR( ir, le, y ) + z; \ +- OUT *q = (OUT *) VIPS_REGION_ADDR( or, le, y ) + z * 2; \ +- OUT *tlut = (OUT *) maplut->table[z]; \ +- \ +- for( x = 0; x < ne; x += b ) { \ +- int n = p[x] * 2; \ +- \ +- q[0] = tlut[n]; \ +- q[1] = tlut[n + 1]; \ +- q += b * 2; \ ++#define loopc(OUT) \ ++ { \ ++ int b = in->Bands; \ ++\ ++ for (y = to; y < bo; y++) { \ ++ for (z = 0; z < b; z++) { \ ++ VipsPel *p = VIPS_REGION_ADDR(ir, le, y) + z; \ ++ OUT *q = (OUT *) VIPS_REGION_ADDR(or, le, y) + z * 2; \ ++ OUT *tlut = (OUT *) maplut->table[z]; \ ++\ ++ for (x = 0; x < ne; x += b) { \ ++ int n = p[x] * 2; \ ++\ ++ q[0] = tlut[n]; \ ++ q[1] = tlut[n + 1]; \ ++ q += b * 2; \ ++ } \ + } \ + } \ +- } \ +-} ++ } + +-#define loopg( IN, OUT ) { \ +- int b = maplut->nb; \ +- \ +- for( y = to; y < bo; y++ ) { \ +- for( z = 0; z < b; z++ ) { \ +- IN *p = (IN *) VIPS_REGION_ADDR( ir, le, y ); \ +- OUT *q = (OUT *) VIPS_REGION_ADDR( or, le, y ); \ +- OUT *tlut = (OUT *) maplut->table[z]; \ +- \ +- for( x = z; x < ne; x += b ) { \ +- int index = p[x]; \ +- \ +- if( index > maplut->clp ) { \ +- index = maplut->clp; \ +- seq->overflow++; \ ++#define loopg(IN, OUT) \ ++ { \ ++ int b = maplut->nb; \ ++\ ++ for (y = to; y < bo; y++) { \ ++ for (z = 0; z < b; z++) { \ ++ IN *p = (IN *) VIPS_REGION_ADDR(ir, le, y); \ ++ OUT *q = (OUT *) VIPS_REGION_ADDR(or, le, y); \ ++ OUT *tlut = (OUT *) maplut->table[z]; \ ++\ ++ for (x = z; x < ne; x += b) { \ ++ int index = p[x]; \ ++\ ++ if (index > maplut->clp) { \ ++ index = maplut->clp; \ ++ seq->overflow++; \ ++ } \ ++\ ++ q[x] = tlut[index]; \ + } \ +- \ +- q[x] = tlut[index]; \ + } \ + } \ +- } \ +-} ++ } + +-#define loopcg( IN, OUT ) { \ +- int b = in->Bands; \ +- \ +- for( y = to; y < bo; y++ ) { \ +- for( z = 0; z < b; z++ ) { \ +- IN *p = (IN *) VIPS_REGION_ADDR( ir, le, y ) + z; \ +- OUT *q = (OUT *) VIPS_REGION_ADDR( or, le, y ) + z * 2; \ +- OUT *tlut = (OUT *) maplut->table[z]; \ +- \ +- for( x = 0; x < ne; x += b ) { \ +- int index = p[x]; \ +- \ +- if( index > maplut->clp ) { \ +- index = maplut->clp; \ +- seq->overflow++; \ ++#define loopcg(IN, OUT) \ ++ { \ ++ int b = in->Bands; \ ++\ ++ for (y = to; y < bo; y++) { \ ++ for (z = 0; z < b; z++) { \ ++ IN *p = (IN *) VIPS_REGION_ADDR(ir, le, y) + z; \ ++ OUT *q = (OUT *) VIPS_REGION_ADDR(or, le, y) + z * 2; \ ++ OUT *tlut = (OUT *) maplut->table[z]; \ ++\ ++ for (x = 0; x < ne; x += b) { \ ++ int index = p[x]; \ ++\ ++ if (index > maplut->clp) { \ ++ index = maplut->clp; \ ++ seq->overflow++; \ ++ } \ ++\ ++ q[0] = tlut[index * 2]; \ ++ q[1] = tlut[index * 2 + 1]; \ ++\ ++ q += b * 2; \ + } \ +- \ +- q[0] = tlut[index * 2]; \ +- q[1] = tlut[index * 2 + 1]; \ +- \ +- q += b * 2; \ + } \ + } \ +- } \ +-} ++ } + + /* Map image through one non-complex lut. + */ +-#define loop1( OUT ) { \ +- OUT *tlut = (OUT *) maplut->table[0]; \ +- \ +- for( y = to; y < bo; y++ ) { \ +- OUT *q = (OUT *) VIPS_REGION_ADDR( or, le, y ); \ +- VipsPel *p = VIPS_REGION_ADDR( ir, le, y ); \ +- \ +- for( x = 0; x < ne; x++ ) \ +- q[x] = tlut[p[x]]; \ +- } \ +-} ++#define loop1(OUT) \ ++ { \ ++ OUT *tlut = (OUT *) maplut->table[0]; \ ++\ ++ for (y = to; y < bo; y++) { \ ++ OUT *q = (OUT *) VIPS_REGION_ADDR(or, le, y); \ ++ VipsPel *p = VIPS_REGION_ADDR(ir, le, y); \ ++\ ++ for (x = 0; x < ne; x++) \ ++ q[x] = tlut[p[x]]; \ ++ } \ ++ } + + /* Map image through one complex lut. + */ +-#define loop1c( OUT ) { \ +- OUT *tlut = (OUT *) maplut->table[0]; \ +- \ +- for( y = to; y < bo; y++ ) { \ +- OUT *q = (OUT *) VIPS_REGION_ADDR( or, le, y ); \ +- VipsPel *p = VIPS_REGION_ADDR( ir, le, y ); \ +- \ +- for( x = 0; x < ne; x++ ) { \ +- int n = p[x] * 2; \ +- \ +- q[0] = tlut[n]; \ +- q[1] = tlut[n + 1]; \ +- q += 2; \ ++#define loop1c(OUT) \ ++ { \ ++ OUT *tlut = (OUT *) maplut->table[0]; \ ++\ ++ for (y = to; y < bo; y++) { \ ++ OUT *q = (OUT *) VIPS_REGION_ADDR(or, le, y); \ ++ VipsPel *p = VIPS_REGION_ADDR(ir, le, y); \ ++\ ++ for (x = 0; x < ne; x++) { \ ++ int n = p[x] * 2; \ ++\ ++ q[0] = tlut[n]; \ ++ q[1] = tlut[n + 1]; \ ++ q += 2; \ ++ } \ + } \ +- } \ +-} ++ } + + /* As above, but the input image may be any unsigned integer type. We have to + * index the lut carefully, and record the number of overflows we detect. + */ +-#define loop1g( IN, OUT ) { \ +- OUT *tlut = (OUT *) maplut->table[0]; \ +- \ +- for( y = to; y < bo; y++ ) { \ +- OUT *q = (OUT *) VIPS_REGION_ADDR( or, le, y ); \ +- IN *p = (IN *) VIPS_REGION_ADDR( ir, le, y ); \ +- \ +- for( x = 0; x < ne; x++ ) { \ +- int index = p[x]; \ +- \ +- if( index > maplut->clp ) { \ +- index = maplut->clp; \ +- seq->overflow++; \ ++#define loop1g(IN, OUT) \ ++ { \ ++ OUT *tlut = (OUT *) maplut->table[0]; \ ++\ ++ for (y = to; y < bo; y++) { \ ++ OUT *q = (OUT *) VIPS_REGION_ADDR(or, le, y); \ ++ IN *p = (IN *) VIPS_REGION_ADDR(ir, le, y); \ ++\ ++ for (x = 0; x < ne; x++) { \ ++ int index = p[x]; \ ++\ ++ if (index > maplut->clp) { \ ++ index = maplut->clp; \ ++ seq->overflow++; \ ++ } \ ++\ ++ q[x] = tlut[index]; \ + } \ +- \ +- q[x] = tlut[index]; \ + } \ +- } \ +-} ++ } + +-#define loop1cg( IN, OUT ) { \ +- OUT *tlut = (OUT *) maplut->table[0]; \ +- \ +- for( y = to; y < bo; y++ ) { \ +- OUT *q = (OUT *) VIPS_REGION_ADDR( or, le, y ); \ +- IN *p = (IN *) VIPS_REGION_ADDR( ir, le, y ); \ +- \ +- for( x = 0; x < ne; x++ ) { \ +- int index = p[x]; \ +- \ +- if( index > maplut->clp ) { \ +- index = maplut->clp; \ +- seq->overflow++; \ ++#define loop1cg(IN, OUT) \ ++ { \ ++ OUT *tlut = (OUT *) maplut->table[0]; \ ++\ ++ for (y = to; y < bo; y++) { \ ++ OUT *q = (OUT *) VIPS_REGION_ADDR(or, le, y); \ ++ IN *p = (IN *) VIPS_REGION_ADDR(ir, le, y); \ ++\ ++ for (x = 0; x < ne; x++) { \ ++ int index = p[x]; \ ++\ ++ if (index > maplut->clp) { \ ++ index = maplut->clp; \ ++ seq->overflow++; \ ++ } \ ++\ ++ q[0] = tlut[index * 2]; \ ++ q[1] = tlut[index * 2 + 1]; \ ++ q += 2; \ + } \ +- \ +- q[0] = tlut[index * 2]; \ +- q[1] = tlut[index * 2 + 1]; \ +- q += 2; \ + } \ +- } \ +-} ++ } + + /* Map 1-band image through a many-band non-complex lut. + */ +-#define loop1m( OUT ) { \ +- OUT **tlut = (OUT **) maplut->table; \ +- \ +- for( y = to; y < bo; y++ ) { \ +- OUT *q = (OUT *) VIPS_REGION_ADDR( or, le, y ); \ +- VipsPel *p = VIPS_REGION_ADDR( ir, le, y ); \ +- \ +- for( i = 0, x = 0; x < np; x++ ) { \ +- int n = p[x]; \ +- \ +- for( z = 0; z < maplut->nb; z++, i++ ) \ +- q[i] = tlut[z][n]; \ ++#define loop1m(OUT) \ ++ { \ ++ OUT **tlut = (OUT **) maplut->table; \ ++\ ++ for (y = to; y < bo; y++) { \ ++ OUT *q = (OUT *) VIPS_REGION_ADDR(or, le, y); \ ++ VipsPel *p = VIPS_REGION_ADDR(ir, le, y); \ ++\ ++ for (i = 0, x = 0; x < np; x++) { \ ++ int n = p[x]; \ ++\ ++ for (z = 0; z < maplut->nb; z++, i++) \ ++ q[i] = tlut[z][n]; \ ++ } \ + } \ +- } \ +-} ++ } + + /* Map 1-band image through many-band complex lut. + */ +-#define loop1cm( OUT ) { \ +- OUT **tlut = (OUT **) maplut->table; \ +- \ +- for( y = to; y < bo; y++ ) { \ +- OUT *q = (OUT *) VIPS_REGION_ADDR( or, le, y ); \ +- VipsPel *p = VIPS_REGION_ADDR( ir, le, y ); \ +- \ +- for( x = 0; x < np; x++ ) { \ +- int n = p[x] * 2; \ +- \ +- for( z = 0; z < maplut->nb; z++ ) { \ +- q[0] = tlut[z][n]; \ +- q[1] = tlut[z][n+1]; \ +- q += 2; \ ++#define loop1cm(OUT) \ ++ { \ ++ OUT **tlut = (OUT **) maplut->table; \ ++\ ++ for (y = to; y < bo; y++) { \ ++ OUT *q = (OUT *) VIPS_REGION_ADDR(or, le, y); \ ++ VipsPel *p = VIPS_REGION_ADDR(ir, le, y); \ ++\ ++ for (x = 0; x < np; x++) { \ ++ int n = p[x] * 2; \ ++\ ++ for (z = 0; z < maplut->nb; z++) { \ ++ q[0] = tlut[z][n]; \ ++ q[1] = tlut[z][n + 1]; \ ++ q += 2; \ ++ } \ + } \ + } \ +- } \ +-} ++ } + + /* Map 1-band uint or ushort image through a many-band non-complex LUT. + */ +-#define loop1gm( IN, OUT ) { \ +- OUT **tlut = (OUT **) maplut->table; \ +- \ +- for( y = to; y < bo; y++ ) { \ +- IN *p = (IN *) VIPS_REGION_ADDR( ir, le, y ); \ +- OUT *q = (OUT *) VIPS_REGION_ADDR( or, le, y ); \ +- \ +- for( i = 0, x = 0; x < np; x++ ) { \ +- int n = p[x]; \ +- \ +- if( n > maplut->clp ) { \ +- n = maplut->clp; \ +- seq->overflow++; \ ++#define loop1gm(IN, OUT) \ ++ { \ ++ OUT **tlut = (OUT **) maplut->table; \ ++\ ++ for (y = to; y < bo; y++) { \ ++ IN *p = (IN *) VIPS_REGION_ADDR(ir, le, y); \ ++ OUT *q = (OUT *) VIPS_REGION_ADDR(or, le, y); \ ++\ ++ for (i = 0, x = 0; x < np; x++) { \ ++ int n = p[x]; \ ++\ ++ if (n > maplut->clp) { \ ++ n = maplut->clp; \ ++ seq->overflow++; \ ++ } \ ++\ ++ for (z = 0; z < maplut->nb; z++, i++) \ ++ q[i] = tlut[z][n]; \ + } \ +- \ +- for( z = 0; z < maplut->nb; z++, i++ ) \ +- q[i] = tlut[z][n]; \ + } \ +- } \ +-} ++ } + + /* Map 1-band uint or ushort image through a many-band complex LUT. + */ +-#define loop1cgm( IN, OUT ) { \ +- OUT **tlut = (OUT **) maplut->table; \ +- \ +- for( y = to; y < bo; y++ ) { \ +- IN *p = (IN *) VIPS_REGION_ADDR( ir, le, y ); \ +- OUT *q = (OUT *) VIPS_REGION_ADDR( or, le, y ); \ +- \ +- for( x = 0; x < np; x++ ) { \ +- int n = p[x]; \ +- \ +- if( n > maplut->clp ) { \ +- n = maplut->clp; \ +- seq->overflow++; \ +- } \ +- \ +- for( z = 0; z < maplut->nb; z++ ) { \ +- q[0] = tlut[z][n * 2]; \ +- q[1] = tlut[z][n * 2 + 1]; \ +- q += 2; \ ++#define loop1cgm(IN, OUT) \ ++ { \ ++ OUT **tlut = (OUT **) maplut->table; \ ++\ ++ for (y = to; y < bo; y++) { \ ++ IN *p = (IN *) VIPS_REGION_ADDR(ir, le, y); \ ++ OUT *q = (OUT *) VIPS_REGION_ADDR(or, le, y); \ ++\ ++ for (x = 0; x < np; x++) { \ ++ int n = p[x]; \ ++\ ++ if (n > maplut->clp) { \ ++ n = maplut->clp; \ ++ seq->overflow++; \ ++ } \ ++\ ++ for (z = 0; z < maplut->nb; z++) { \ ++ q[0] = tlut[z][n * 2]; \ ++ q[1] = tlut[z][n * 2 + 1]; \ ++ q += 2; \ ++ } \ + } \ + } \ +- } \ +-} ++ } + + /* Switch for input types. Has to be uint type! + */ +-#define inner_switch( UCHAR, GEN, OUT ) \ +- switch( ir->im->BandFmt ) { \ +- case VIPS_FORMAT_UCHAR: UCHAR( OUT ); break; \ +- case VIPS_FORMAT_USHORT: GEN( unsigned short, OUT ); break; \ +- case VIPS_FORMAT_UINT: GEN( unsigned int, OUT ); break; \ ++#define inner_switch(UCHAR, GEN, OUT) \ ++ switch (ir->im->BandFmt) { \ ++ case VIPS_FORMAT_UCHAR: \ ++ UCHAR(OUT); \ ++ break; \ ++ case VIPS_FORMAT_USHORT: \ ++ GEN(unsigned short, OUT); \ ++ break; \ ++ case VIPS_FORMAT_UINT: \ ++ GEN(unsigned int, OUT); \ ++ break; \ + default: \ + g_assert_not_reached(); \ + } +@@ -408,75 +426,82 @@ vips_maplut_start( VipsImage *out, void *a, void *b ) + * variant for complex ones. Another pair as well, in case the input is not + * uchar. + */ +-#define outer_switch( UCHAR_F, UCHAR_FC, GEN_F, GEN_FC ) \ +- switch( maplut->fmt ) { \ ++#define outer_switch(UCHAR_F, UCHAR_FC, GEN_F, GEN_FC) \ ++ switch (maplut->fmt) { \ + case VIPS_FORMAT_UCHAR: \ +- inner_switch( UCHAR_F, GEN_F, unsigned char ); break; \ +- case VIPS_FORMAT_CHAR:\ +- inner_switch( UCHAR_F, GEN_F, char ); break; \ ++ inner_switch(UCHAR_F, GEN_F, unsigned char); \ ++ break; \ ++ case VIPS_FORMAT_CHAR: \ ++ inner_switch(UCHAR_F, GEN_F, char); \ ++ break; \ + case VIPS_FORMAT_USHORT: \ +- inner_switch( UCHAR_F, GEN_F, unsigned short ); break; \ ++ inner_switch(UCHAR_F, GEN_F, unsigned short); \ ++ break; \ + case VIPS_FORMAT_SHORT: \ +- inner_switch( UCHAR_F, GEN_F, short ); break; \ ++ inner_switch(UCHAR_F, GEN_F, short); \ ++ break; \ + case VIPS_FORMAT_UINT: \ +- inner_switch( UCHAR_F, GEN_F, unsigned int ); break; \ ++ inner_switch(UCHAR_F, GEN_F, unsigned int); \ ++ break; \ + case VIPS_FORMAT_INT: \ +- inner_switch( UCHAR_F, GEN_F, int ); break; \ ++ inner_switch(UCHAR_F, GEN_F, int); \ ++ break; \ + case VIPS_FORMAT_FLOAT: \ +- inner_switch( UCHAR_F, GEN_F, float ); break; \ ++ inner_switch(UCHAR_F, GEN_F, float); \ ++ break; \ + case VIPS_FORMAT_DOUBLE: \ +- inner_switch( UCHAR_F, GEN_F, double ); break; \ ++ inner_switch(UCHAR_F, GEN_F, double); \ ++ break; \ + case VIPS_FORMAT_COMPLEX: \ +- inner_switch( UCHAR_FC, GEN_FC, float ); break; \ ++ inner_switch(UCHAR_FC, GEN_FC, float); \ ++ break; \ + case VIPS_FORMAT_DPCOMPLEX: \ +- inner_switch( UCHAR_FC, GEN_FC, double ); break; \ ++ inner_switch(UCHAR_FC, GEN_FC, double); \ ++ break; \ + default: \ + g_assert_not_reached(); \ + } + + /* Do a map. + */ +-static int +-vips_maplut_gen( VipsRegion *or, void *vseq, void *a, void *b, +- gboolean *stop ) ++static int ++vips_maplut_gen(VipsRegion * or, void *vseq, void *a, void *b, ++ gboolean *stop) + { + VipsMaplutSequence *seq = (VipsMaplutSequence *) vseq; + VipsImage *in = (VipsImage *) a; + VipsMaplut *maplut = (VipsMaplut *) b; + VipsRegion *ir = seq->ir; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; + int to = r->top; +- int bo = VIPS_RECT_BOTTOM( r ); +- int np = r->width; /* Pels across region */ +- int ne = VIPS_REGION_N_ELEMENTS( or ); /* Number of elements */ ++ int bo = VIPS_RECT_BOTTOM(r); ++ int np = r->width; /* Pels across region */ ++ int ne = VIPS_REGION_N_ELEMENTS(or); /* Number of elements */ + + int x, y, z, i; + +- if( vips_region_prepare( ir, r ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, r)) ++ return (-1); + +- if( maplut->nb == 1 ) ++ if (maplut->nb == 1) + /* One band lut. + */ +- outer_switch( loop1, loop1c, loop1g, loop1cg ) +- else +- /* Many band lut. +- */ +- if( in->Bands == 1 ) ++ outer_switch(loop1, loop1c, loop1g, loop1cg) else ++ /* Many band lut. ++ */ ++ if (in->Bands == 1) + /* ... but 1 band input. + */ +- outer_switch( loop1m, loop1cm, loop1gm, loop1cgm ) +- else +- outer_switch( loop, loopc, loopg, loopcg ) ++ outer_switch(loop1m, loop1cm, loop1gm, loop1cgm) else outer_switch(loop, loopc, loopg, loopcg) + +- return( 0 ); ++ return (0); + } + + /* Destroy a sequence value. + */ + static int +-vips_maplut_stop( void *vseq, void *a, void *b ) ++vips_maplut_stop(void *vseq, void *a, void *b) + { + VipsMaplutSequence *seq = (VipsMaplutSequence *) vseq; + VipsMaplut *maplut = (VipsMaplut *) b; +@@ -485,9 +510,9 @@ vips_maplut_stop( void *vseq, void *a, void *b ) + */ + maplut->overflow += seq->overflow; + +- VIPS_UNREF( seq->ir ); ++ VIPS_UNREF(seq->ir); + +- return( 0 ); ++ return (0); + } + + /* Save a bit of typing. +@@ -496,7 +521,7 @@ vips_maplut_stop( void *vseq, void *a, void *b ) + #define US VIPS_FORMAT_USHORT + #define UI VIPS_FORMAT_UINT + +-/* Type mapping: go to uchar / ushort / uint to make an index. ++/* Type mapping: go to uchar / ushort / uint to make an index. + */ + static const VipsBandFormat bandfmt_maplut[10] = { + /* Band format: UC C US S UI I F X D DX */ +@@ -504,221 +529,232 @@ static const VipsBandFormat bandfmt_maplut[10] = { + }; + + /* Repack lut into a set of band arrays. If we're just passing one band of the +- * image through the lut, put the identity function in the other bands. +- */ +-#define PACK_TABLE( TYPE ) { \ +- TYPE *data = (TYPE *) lut->data; \ +- int x, b; \ +- \ +- for( x = 0; x < maplut->sz; x++ ) \ +- for( b = 0; b < maplut->nb; b++ ) { \ +- TYPE *q = (TYPE *) maplut->table[b]; \ +- \ +- if( maplut->band >= 0 && \ +- lut->Bands == 1 ) { \ +- if( b == maplut->band ) \ +- q[x] = data[x]; \ ++ * image through the lut, put the identity function in the other bands. ++ */ ++#define PACK_TABLE(TYPE) \ ++ { \ ++ TYPE *data = (TYPE *) lut->data; \ ++ int x, b; \ ++\ ++ for (x = 0; x < maplut->sz; x++) \ ++ for (b = 0; b < maplut->nb; b++) { \ ++ TYPE *q = (TYPE *) maplut->table[b]; \ ++\ ++ if (maplut->band >= 0 && \ ++ lut->Bands == 1) { \ ++ if (b == maplut->band) \ ++ q[x] = data[x]; \ ++ else \ ++ q[x] = x; \ ++ } \ + else \ +- q[x] = x; \ ++ q[x] = data[x * lut->Bands + b]; \ + } \ +- else \ +- q[x] = data[x * lut->Bands + b]; \ +- } \ +-} ++ } + +-#define PACK_TABLEC( TYPE ) { \ +- TYPE *data = (TYPE *) lut->data; \ +- int x, b; \ +- \ +- for( x = 0; x < maplut->sz; x++ ) \ +- for( b = 0; b < maplut->nb; b++ ) { \ +- TYPE *q = (TYPE *) maplut->table[b]; \ +- \ +- if( maplut->band >= 0 && \ +- lut->Bands == 1 ) { \ +- if( b == maplut->band ) { \ +- q[2 * x] = data[2 * x]; \ +- q[2 * x + 1] = data[2 * x + 1]; \ ++#define PACK_TABLEC(TYPE) \ ++ { \ ++ TYPE *data = (TYPE *) lut->data; \ ++ int x, b; \ ++\ ++ for (x = 0; x < maplut->sz; x++) \ ++ for (b = 0; b < maplut->nb; b++) { \ ++ TYPE *q = (TYPE *) maplut->table[b]; \ ++\ ++ if (maplut->band >= 0 && \ ++ lut->Bands == 1) { \ ++ if (b == maplut->band) { \ ++ q[2 * x] = data[2 * x]; \ ++ q[2 * x + 1] = data[2 * x + 1]; \ ++ } \ ++ else { \ ++ q[2 * x] = x; \ ++ q[2 * x + 1] = 0; \ ++ } \ + } \ + else { \ +- q[2 * x] = x; \ +- q[2 * x + 1] = 0; \ ++ q[2 * x] = data[2 * (x * lut->Bands + b)]; \ ++ q[2 * x + 1] = \ ++ data[2 * (x * lut->Bands + b) + 1]; \ + } \ + } \ +- else { \ +- q[2 * x] = data[2 * (x * lut->Bands + b)]; \ +- q[2 * x + 1] = \ +- data[2 * (x * lut->Bands + b) + 1]; \ +- } \ +- } \ +-} ++ } + + static int +-vips_maplut_build( VipsObject *object ) ++vips_maplut_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsMaplut *maplut = (VipsMaplut *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + + VipsImage *in; + VipsImage *lut; + int i; + +- g_object_set( object, "out", vips_image_new(), NULL ); ++ g_object_set(object, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_maplut_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_maplut_parent_class)->build(object)) ++ return (-1); + + in = maplut->in; + lut = maplut->lut; + +- if( vips_check_hist( class->nickname, lut ) || +- vips_check_uncoded( class->nickname, lut ) ) +- return( -1 ); ++ if (vips_check_hist(class->nickname, lut) || ++ vips_check_uncoded(class->nickname, lut)) ++ return (-1); + + /* Cast @in to u8/u16/u32 to make the index image. + */ +- if( vips_cast( in, &t[0], bandfmt_maplut[in->BandFmt], NULL ) ) +- return( -1 ); ++ if (vips_cast(in, &t[0], bandfmt_maplut[in->BandFmt], NULL)) ++ return (-1); + in = t[0]; + +- if( vips_check_uncoded( class->nickname, in ) || +- vips_check_bands_1orn( class->nickname, in, lut ) || +- vips_image_pio_input( in ) ) +- return( -1 ); ++ if (vips_check_uncoded(class->nickname, in) || ++ vips_check_bands_1orn(class->nickname, in, lut) || ++ vips_image_pio_input(in)) ++ return (-1); + +- if( vips_image_pipelinev( maplut->out, +- VIPS_DEMAND_STYLE_THINSTRIP, in, lut, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(maplut->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, in, lut, NULL)) ++ return (-1); + maplut->out->BandFmt = lut->BandFmt; + + /* Output has same number of bands as LUT, unless LUT has 1 band, in + * which case output has same number of bands as input. + */ +- if( lut->Bands != 1 ) ++ if (lut->Bands != 1) + maplut->out->Bands = lut->Bands; + + /* The Type comes from the image with many bands. A B_W index image, + * for example, needs to become an RGB image when it goes through a + * three-band LUT. + */ +- if( lut->Bands != 1 ) ++ if (lut->Bands != 1) + maplut->out->Type = lut->Type; + +- g_signal_connect( in, "preeval", +- G_CALLBACK( vips_maplut_preeval ), maplut ); +- g_signal_connect( in, "posteval", +- G_CALLBACK( vips_maplut_posteval ), maplut ); ++ g_signal_connect(in, "preeval", ++ G_CALLBACK(vips_maplut_preeval), maplut); ++ g_signal_connect(in, "posteval", ++ G_CALLBACK(vips_maplut_posteval), maplut); + + /* Make luts. We unpack the LUT image into a 2D C array to speed + * processing. + */ +- if( !(t[1] = vips_image_copy_memory( lut )) ) +- return( -1 ); ++ if (!(t[1] = vips_image_copy_memory(lut))) ++ return (-1); + lut = t[1]; + maplut->fmt = lut->BandFmt; +- maplut->es = VIPS_IMAGE_SIZEOF_ELEMENT( lut ); ++ maplut->es = VIPS_IMAGE_SIZEOF_ELEMENT(lut); + maplut->sz = lut->Xsize * lut->Ysize; + maplut->clp = maplut->sz - 1; + + /* If @bands is >= 0, we need to expand the lut to the number of bands +- * in the input image. ++ * in the input image. + */ +- if( maplut->band >= 0 && +- lut->Bands == 1 ) ++ if (maplut->band >= 0 && ++ lut->Bands == 1) + maplut->nb = in->Bands; + else + maplut->nb = lut->Bands; + + /* Attach tables. + */ +- if( !(maplut->table = VIPS_ARRAY( maplut, maplut->nb, VipsPel * )) ) +- return( -1 ); +- for( i = 0; i < maplut->nb; i++ ) +- if( !(maplut->table[i] = VIPS_ARRAY( maplut, +- maplut->sz * maplut->es, VipsPel )) ) +- return( -1 ); ++ if (!(maplut->table = VIPS_ARRAY(maplut, maplut->nb, VipsPel *))) ++ return (-1); ++ for (i = 0; i < maplut->nb; i++) ++ if (!(maplut->table[i] = VIPS_ARRAY(maplut, ++ maplut->sz * maplut->es, VipsPel))) ++ return (-1); + + /* Scan LUT and fill table. + */ +- switch( lut->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- PACK_TABLE( unsigned char ); break; ++ switch (lut->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ PACK_TABLE(unsigned char); ++ break; + case VIPS_FORMAT_CHAR: +- PACK_TABLE( char ); break; +- case VIPS_FORMAT_USHORT: +- PACK_TABLE( unsigned short ); break; +- case VIPS_FORMAT_SHORT: +- PACK_TABLE( short ); break; +- case VIPS_FORMAT_UINT: +- PACK_TABLE( unsigned int ); break; +- case VIPS_FORMAT_INT: +- PACK_TABLE( int ); break; +- case VIPS_FORMAT_FLOAT: +- PACK_TABLE( float ); break; +- case VIPS_FORMAT_DOUBLE: +- PACK_TABLE( double ); break; +- case VIPS_FORMAT_COMPLEX: +- PACK_TABLEC( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: +- PACK_TABLEC( double ); break; +- default: +- g_assert_not_reached(); ++ PACK_TABLE(char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ PACK_TABLE(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ PACK_TABLE(short); ++ break; ++ case VIPS_FORMAT_UINT: ++ PACK_TABLE(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ PACK_TABLE(int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ PACK_TABLE(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ PACK_TABLE(double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ PACK_TABLEC(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ PACK_TABLEC(double); ++ break; ++ default: ++ g_assert_not_reached(); + } + +- if( vips_image_generate( maplut->out, +- vips_maplut_start, vips_maplut_gen, vips_maplut_stop, +- in, maplut ) ) +- return( -1 ); ++ if (vips_image_generate(maplut->out, ++ vips_maplut_start, vips_maplut_gen, vips_maplut_stop, ++ in, maplut)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_maplut_class_init( VipsMaplutClass *class ) ++vips_maplut_class_init(VipsMaplutClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "maplut"; +- object_class->description = _( "map an image though a lut" ); ++ object_class->description = _("map an image though a lut"); + object_class->build = vips_maplut_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaplut, in ) ); ++ G_STRUCT_OFFSET(VipsMaplut, in)); + +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsMaplut, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsMaplut, out)); + +- VIPS_ARG_IMAGE( class, "lut", 3, +- _( "LUT" ), +- _( "Look-up table image" ), ++ VIPS_ARG_IMAGE(class, "lut", 3, ++ _("LUT"), ++ _("Look-up table image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMaplut, lut ) ); ++ G_STRUCT_OFFSET(VipsMaplut, lut)); + +- VIPS_ARG_INT( class, "band", 4, +- _( "Band" ), +- _( "Apply one-band lut to this band of in" ), ++ VIPS_ARG_INT(class, "band", 4, ++ _("Band"), ++ _("Apply one-band lut to this band of in"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMaplut, band ), +- -1, 10000, -1 ); +- ++ G_STRUCT_OFFSET(VipsMaplut, band), ++ -1, 10000, -1); + } + + static void +-vips_maplut_init( VipsMaplut *maplut ) ++vips_maplut_init(VipsMaplut *maplut) + { + maplut->band = -1; + } +@@ -734,21 +770,21 @@ vips_maplut_init( VipsMaplut *maplut ) + * + * * @band: apply one-band @lut to this band of @in + * +- * Map an image through another image acting as a LUT (Look Up Table). ++ * Map an image through another image acting as a LUT (Look Up Table). + * The lut may have any type and the output image will be that type. +- * ++ * + * The input image will be cast to one of the unsigned integer types, that is, + * VIPS_FORMAT_UCHAR, VIPS_FORMAT_USHORT or VIPS_FORMAT_UINT. +- * ++ * + * If @lut is too small for the input type (for example, if @in is + * VIPS_FORMAT_UCHAR but @lut only has 100 elements), the lut is padded out +- * by copying the last element. Overflows are reported at the end of ++ * by copying the last element. Overflows are reported at the end of + * computation. +- * If @lut is too large, extra values are ignored. +- * +- * If @lut has one band and @band is -1 (the default), then all bands of @in +- * pass through @lut. If @band is >= 0, then just that band of @in passes +- * through @lut and other bands are just copied. ++ * If @lut is too large, extra values are ignored. ++ * ++ * If @lut has one band and @band is -1 (the default), then all bands of @in ++ * pass through @lut. If @band is >= 0, then just that band of @in passes ++ * through @lut and other bands are just copied. + * + * If @lut + * has same number of bands as @in, then each band is mapped +@@ -760,15 +796,14 @@ vips_maplut_init( VipsMaplut *maplut ) + * Returns: 0 on success, -1 on error + */ + int +-vips_maplut( VipsImage *in, VipsImage **out, VipsImage *lut, ... ) ++vips_maplut(VipsImage *in, VipsImage **out, VipsImage *lut, ...) + { + va_list ap; + int result; + +- va_start( ap, lut ); +- result = vips_call_split( "maplut", ap, in, out, lut ); +- va_end( ap ); ++ va_start(ap, lut); ++ result = vips_call_split("maplut", ap, in, out, lut); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/histogram/percent.c b/libvips/histogram/percent.c +index 9769d39f1e..d7f7a126d1 100644 +--- a/libvips/histogram/percent.c ++++ b/libvips/histogram/percent.c +@@ -19,28 +19,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -54,7 +54,7 @@ + + #include + +-typedef struct _VipsPercent { ++typedef struct _VipsPercent { + VipsOperation parent_instance; + + VipsImage *in; +@@ -65,71 +65,69 @@ typedef struct _VipsPercent { + + typedef VipsOperationClass VipsPercentClass; + +-G_DEFINE_TYPE( VipsPercent, vips_percent, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsPercent, vips_percent, VIPS_TYPE_OPERATION); + + static int +-vips_percent_build( VipsObject *object ) ++vips_percent_build(VipsObject *object) + { +- VipsPercent *percent = (VipsPercent *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 7 ); ++ VipsPercent *percent = (VipsPercent *) object; ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 7); + + double threshold; + +- if( VIPS_OBJECT_CLASS( vips_percent_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_percent_parent_class)->build(object)) ++ return (-1); + +- if( vips_hist_find( percent->in, &t[0], NULL ) || +- vips_hist_cum( t[0], &t[1], NULL ) || +- vips_hist_norm( t[1], &t[2], NULL ) || +- vips_more_const1( t[2], &t[3], +- (percent->percent / 100.0) * t[2]->Xsize, NULL ) || +- vips_profile( t[3], &t[5], &t[6], NULL ) || +- vips_avg( t[6], &threshold, NULL ) ) +- return( -1 ); ++ if (vips_hist_find(percent->in, &t[0], NULL) || ++ vips_hist_cum(t[0], &t[1], NULL) || ++ vips_hist_norm(t[1], &t[2], NULL) || ++ vips_more_const1(t[2], &t[3], ++ (percent->percent / 100.0) * t[2]->Xsize, NULL) || ++ vips_profile(t[3], &t[5], &t[6], NULL) || ++ vips_avg(t[6], &threshold, NULL)) ++ return (-1); + +- g_object_set( object, "threshold", (int) threshold, NULL ); ++ g_object_set(object, "threshold", (int) threshold, NULL); + +- return( 0 ); ++ return (0); + } + + static void +-vips_percent_class_init( VipsPercentClass *class ) ++vips_percent_class_init(VipsPercentClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "percent"; +- object_class->description = _( "find threshold for percent of pixels" ); ++ object_class->description = _("find threshold for percent of pixels"); + object_class->build = vips_percent_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsPercent, in ) ); +- +- VIPS_ARG_DOUBLE( class, "percent", 2, +- _( "Percent" ), +- _( "Percent of pixels" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsPercent, percent ), +- 0, 100, 50 ); +- +- VIPS_ARG_INT( class, "threshold", 3, +- _( "Threshold" ), +- _( "Threshold above which lie percent of pixels" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsPercent, threshold ), +- 0, 65535, 0 ); ++ G_STRUCT_OFFSET(VipsPercent, in)); + ++ VIPS_ARG_DOUBLE(class, "percent", 2, ++ _("Percent"), ++ _("Percent of pixels"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsPercent, percent), ++ 0, 100, 50); ++ ++ VIPS_ARG_INT(class, "threshold", 3, ++ _("Threshold"), ++ _("Threshold above which lie percent of pixels"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsPercent, threshold), ++ 0, 65535, 0); + } + + static void +-vips_percent_init( VipsPercent *percent ) ++vips_percent_init(VipsPercent *percent) + { + } + +@@ -140,7 +138,7 @@ vips_percent_init( VipsPercent *percent ) + * @threshold: (out): output threshold value + * @...: %NULL-terminated list of optional named arguments + * +- * vips_percent() returns (through the @threshold parameter) the threshold ++ * vips_percent() returns (through the @threshold parameter) the threshold + * below which there are @percent values of @in. For example: + * + * |[ +@@ -150,22 +148,22 @@ vips_percent_init( VipsPercent *percent ) + * + * Means that 90% of pixels in `k2.jpg` have a value less than 214. + * +- * The function works for uchar and ushort images only. It can be used ++ * The function works for uchar and ushort images only. It can be used + * to threshold the scaled result of a filtering operation. + * + * See also: vips_hist_find(), vips_profile(). + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_percent( VipsImage *in, double percent, int *threshold, ... ) ++int ++vips_percent(VipsImage *in, double percent, int *threshold, ...) + { + va_list ap; + int result; + +- va_start( ap, threshold ); +- result = vips_call_split( "percent", ap, in, percent, threshold ); +- va_end( ap ); ++ va_start(ap, threshold); ++ result = vips_call_split("percent", ap, in, percent, threshold); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/histogram/phistogram.h b/libvips/histogram/phistogram.h +index 45ff77a89b..7964b232ca 100644 +--- a/libvips/histogram/phistogram.h ++++ b/libvips/histogram/phistogram.h +@@ -5,28 +5,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -40,44 +40,44 @@ extern "C" { + #include + + #define VIPS_TYPE_HISTOGRAM (vips_histogram_get_type()) +-#define VIPS_HISTOGRAM( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_HISTOGRAM, VipsHistogram )) +-#define VIPS_HISTOGRAM_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_HISTOGRAM(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_HISTOGRAM, VipsHistogram)) ++#define VIPS_HISTOGRAM_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_HISTOGRAM, VipsHistogramClass)) ++#define VIPS_IS_HISTOGRAM(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_HISTOGRAM)) ++#define VIPS_IS_HISTOGRAM_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_HISTOGRAM)) ++#define VIPS_HISTOGRAM_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_HISTOGRAM, VipsHistogramClass)) +-#define VIPS_IS_HISTOGRAM( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_HISTOGRAM )) +-#define VIPS_IS_HISTOGRAM_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_HISTOGRAM )) +-#define VIPS_HISTOGRAM_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_HISTOGRAM, VipsHistogramClass )) + + typedef struct _VipsHistogram VipsHistogram; + +-typedef void (*VipsHistogramProcessFn)( VipsHistogram *histogram, +- VipsPel *out, VipsPel **in, int width ); ++typedef void (*VipsHistogramProcessFn)(VipsHistogram *histogram, ++ VipsPel *out, VipsPel **in, int width); + + struct _VipsHistogram { + VipsOperation parent_instance; + + VipsImage *out; + +- /* NULL-terminated array of input images. ++ /* NULL-terminated array of input images. + */ + VipsImage **in; + int n; + + /* ... and transformed ready for processing. + */ +- VipsImage **ready; ++ VipsImage **ready; + }; + + typedef struct _VipsHistogramClass { + VipsOperationClass parent_class; + +- /* For each input format, what output format. ++ /* For each input format, what output format. + */ + const VipsBandFormat *format_table; + +@@ -89,12 +89,10 @@ typedef struct _VipsHistogramClass { + + } VipsHistogramClass; + +-GType vips_histogram_get_type( void ); ++GType vips_histogram_get_type(void); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_PHISTOGRAM_H*/ +- +- +diff --git a/libvips/histogram/stdif.c b/libvips/histogram/stdif.c +index f8f6ebe4a9..34787fcd92 100644 +--- a/libvips/histogram/stdif.c ++++ b/libvips/histogram/stdif.c +@@ -1,10 +1,10 @@ +-/* statistical difference ++/* statistical difference + * + * Copyright: 1990, N. Dessipris. + * + * Author: Nicos Dessipris + * Written on: 02/05/1990 +- * Modified on : ++ * Modified on : + * 6/8/93 JC + * - now works for odd window sizes + * - ANSIfication +@@ -15,41 +15,41 @@ + * - now partial, plus rolling window + * - 5x faster, amazingly + * - works +- * 7/4/04 ++ * 7/4/04 + * - now uses im_embed() with edge stretching on the input, not + * the output + * 25/3/10 + * - gtkdoc + * - small cleanups +- * 10/8/13 ++ * 10/8/13 + * - wrapped as a class using hist_local.c + * - many bands + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -84,27 +84,27 @@ typedef struct _VipsStdif { + + typedef VipsOperationClass VipsStdifClass; + +-G_DEFINE_TYPE( VipsStdif, vips_stdif, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsStdif, vips_stdif, VIPS_TYPE_OPERATION); + + /* How ugly and stupid. + */ + #define MAX_BANDS (100) + + static int +-vips_stdif_generate( VipsRegion *or, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_stdif_generate(VipsRegion * or, ++ void *vseq, void *a, void *b, gboolean *stop) + { +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsRegion *ir = (VipsRegion *) vseq; + VipsImage *in = (VipsImage *) a; + VipsStdif *stdif = (VipsStdif *) b; +- int bands = in->Bands; ++ int bands = in->Bands; + int npel = stdif->width * stdif->width; + + VipsRect irect; + int y; + int lsk; +- int centre; /* Offset to move to centre of window */ ++ int centre; /* Offset to move to centre of window */ + + /* What part of ir do we need? + */ +@@ -112,17 +112,17 @@ vips_stdif_generate( VipsRegion *or, + irect.top = or->valid.top; + irect.width = or->valid.width + stdif->width; + irect.height = or->valid.height + stdif->height; +- if( vips_region_prepare( ir, &irect ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &irect)) ++ return (-1); + +- lsk = VIPS_REGION_LSKIP( ir ); ++ lsk = VIPS_REGION_LSKIP(ir); + centre = lsk * (stdif->height / 2) + stdif->width / 2; + +- for( y = 0; y < r->height; y++ ) { ++ for (y = 0; y < r->height; y++) { + /* Get input and output pointers for this line. + */ +- VipsPel *p = VIPS_REGION_ADDR( ir, r->left, r->top + y ); +- VipsPel *q = VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ VipsPel *p = VIPS_REGION_ADDR(ir, r->left, r->top + y); ++ VipsPel *q = VIPS_REGION_ADDR(or, r->left, r->top + y); + + double f1 = stdif->a * stdif->m0; + double f2 = 1.0 - stdif->a; +@@ -139,15 +139,15 @@ vips_stdif_generate( VipsRegion *or, + + /* Find sum, sum of squares for the start of this line. + */ +- for( b = 0; b < bands; b++ ) { +- memset( sum, 0, bands * sizeof( unsigned int ) ); +- memset( sum2, 0, bands * sizeof( unsigned int ) ); ++ for (b = 0; b < bands; b++) { ++ memset(sum, 0, bands * sizeof(unsigned int)); ++ memset(sum2, 0, bands * sizeof(unsigned int)); + } + p1 = p; +- for( j = 0; j < stdif->height; j++ ) { ++ for (j = 0; j < stdif->height; j++) { + i = 0; +- for( x = 0; x < stdif->width; x++ ) { +- for( b = 0; b < bands; b++ ) { ++ for (x = 0; x < stdif->width; x++) { ++ for (b = 0; b < bands; b++) { + int t = p1[i++]; + + sum[b] += t; +@@ -160,36 +160,36 @@ vips_stdif_generate( VipsRegion *or, + + /* Loop for output pels. + */ +- for( x = 0; x < r->width; x++ ) { +- for( b = 0; b < bands; b++ ) { ++ for (x = 0; x < r->width; x++) { ++ for (b = 0; b < bands; b++) { + /* Find stats. + */ + double mean = (double) sum[b] / npel; +- double var = (double) sum2[b] / npel - ++ double var = (double) sum2[b] / npel - + (mean * mean); +- double sig = sqrt( var ); ++ double sig = sqrt(var); + + /* Transform. + */ +- double res = f1 + f2 * mean + +- ((double) p[centre] - mean) * +- (f3 / (stdif->s0 + stdif->b * sig)); ++ double res = f1 + f2 * mean + ++ ((double) p[centre] - mean) * ++ (f3 / (stdif->s0 + stdif->b * sig)); + + /* And write. + */ +- if( res < 0.0 ) ++ if (res < 0.0) + *q++ = 0; +- else if( res >= 256.0 ) ++ else if (res >= 256.0) + *q++ = 255; + else + *q++ = res + 0.5; + +- /* Adapt sums - remove the pels from the left +- * hand column, add in pels for a new ++ /* Adapt sums - remove the pels from the left ++ * hand column, add in pels for a new + * right-hand column. + */ + p1 = p; +- for( j = 0; j < stdif->height; j++ ) { ++ for (j = 0; j < stdif->height; j++) { + int t1 = p1[0]; + int t2 = p1[bands * stdif->width]; + +@@ -207,149 +207,148 @@ vips_stdif_generate( VipsRegion *or, + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_stdif_build( VipsObject *object ) ++vips_stdif_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsStdif *stdif = (VipsStdif *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 3 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 3); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_stdif_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_stdif_parent_class)->build(object)) ++ return (-1); + +- in = stdif->in; ++ in = stdif->in; + +- if( vips_image_decode( in, &t[0] ) ) +- return( -1 ); +- in = t[0]; ++ if (vips_image_decode(in, &t[0])) ++ return (-1); ++ in = t[0]; + +- if( vips_check_format( class->nickname, in, VIPS_FORMAT_UCHAR ) ) +- return( -1 ); ++ if (vips_check_format(class->nickname, in, VIPS_FORMAT_UCHAR)) ++ return (-1); + +- if( stdif->width > in->Xsize || +- stdif->height > in->Ysize ) { +- vips_error( class->nickname, "%s", _( "window too large" ) ); +- return( -1 ); ++ if (stdif->width > in->Xsize || ++ stdif->height > in->Ysize) { ++ vips_error(class->nickname, "%s", _("window too large")); ++ return (-1); + } +- if( in->Bands > MAX_BANDS ) { +- vips_error( class->nickname, "%s", _( "too many bands" ) ); +- return( -1 ); ++ if (in->Bands > MAX_BANDS) { ++ vips_error(class->nickname, "%s", _("too many bands")); ++ return (-1); + } + +- /* Expand the input. ++ /* Expand the input. + */ +- if( vips_embed( in, &t[1], +- stdif->width / 2, stdif->height / 2, +- in->Xsize + stdif->width - 1, in->Ysize + stdif->height - 1, +- "extend", VIPS_EXTEND_COPY, +- NULL ) ) +- return( -1 ); ++ if (vips_embed(in, &t[1], ++ stdif->width / 2, stdif->height / 2, ++ in->Xsize + stdif->width - 1, in->Ysize + stdif->height - 1, ++ "extend", VIPS_EXTEND_COPY, ++ NULL)) ++ return (-1); + in = t[1]; + +- g_object_set( object, "out", vips_image_new(), NULL ); ++ g_object_set(object, "out", vips_image_new(), NULL); + + /* Set demand hints. FATSTRIP is good for us, as THINSTRIP will cause + * too many recalculations on overlaps. + */ +- if( vips_image_pipelinev( stdif->out, +- VIPS_DEMAND_STYLE_FATSTRIP, in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(stdif->out, ++ VIPS_DEMAND_STYLE_FATSTRIP, in, NULL)) ++ return (-1); + stdif->out->Xsize -= stdif->width - 1; + stdif->out->Ysize -= stdif->height - 1; + +- if( vips_image_generate( stdif->out, +- vips_start_one, +- vips_stdif_generate, +- vips_stop_one, +- in, stdif ) ) +- return( -1 ); ++ if (vips_image_generate(stdif->out, ++ vips_start_one, ++ vips_stdif_generate, ++ vips_stop_one, ++ in, stdif)) ++ return (-1); + + stdif->out->Xoffset = 0; + stdif->out->Yoffset = 0; + +- vips_reorder_margin_hint( stdif->out, stdif->width * stdif->height ); ++ vips_reorder_margin_hint(stdif->out, stdif->width * stdif->height); + +- return( 0 ); ++ return (0); + } + + static void +-vips_stdif_class_init( VipsStdifClass *class ) ++vips_stdif_class_init(VipsStdifClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "stdif"; +- object_class->description = _( "statistical difference" ); ++ object_class->description = _("statistical difference"); + object_class->build = vips_stdif_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsStdif, in ) ); ++ G_STRUCT_OFFSET(VipsStdif, in)); + +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsStdif, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsStdif, out)); + + /* Windows larger than 256x256 will overflow sum2, see above. + */ +- VIPS_ARG_INT( class, "width", 4, +- _( "Width" ), +- _( "Window width in pixels" ), ++ VIPS_ARG_INT(class, "width", 4, ++ _("Width"), ++ _("Window width in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsStdif, width ), +- 1, 256, 11 ); ++ G_STRUCT_OFFSET(VipsStdif, width), ++ 1, 256, 11); + +- VIPS_ARG_INT( class, "height", 5, +- _( "Height" ), +- _( "Window height in pixels" ), ++ VIPS_ARG_INT(class, "height", 5, ++ _("Height"), ++ _("Window height in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsStdif, height ), +- 1, 256, 11 ); ++ G_STRUCT_OFFSET(VipsStdif, height), ++ 1, 256, 11); + +- VIPS_ARG_DOUBLE( class, "a", 2, +- _( "Mean weight" ), +- _( "Weight of new mean" ), ++ VIPS_ARG_DOUBLE(class, "a", 2, ++ _("Mean weight"), ++ _("Weight of new mean"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsStdif, a ), +- 0.0, 1.0, 0.5 ); ++ G_STRUCT_OFFSET(VipsStdif, a), ++ 0.0, 1.0, 0.5); + +- VIPS_ARG_DOUBLE( class, "m0", 2, +- _( "Mean" ), +- _( "New mean" ), ++ VIPS_ARG_DOUBLE(class, "m0", 2, ++ _("Mean"), ++ _("New mean"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsStdif, m0 ), +- -INFINITY, INFINITY, 128 ); ++ G_STRUCT_OFFSET(VipsStdif, m0), ++ -INFINITY, INFINITY, 128); + +- VIPS_ARG_DOUBLE( class, "b", 2, +- _( "Deviation weight" ), +- _( "Weight of new deviation" ), ++ VIPS_ARG_DOUBLE(class, "b", 2, ++ _("Deviation weight"), ++ _("Weight of new deviation"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsStdif, b ), +- 0.0, 2.0, 0.5 ); ++ G_STRUCT_OFFSET(VipsStdif, b), ++ 0.0, 2.0, 0.5); + +- VIPS_ARG_DOUBLE( class, "s0", 2, +- _( "Deviation" ), +- _( "New deviation" ), ++ VIPS_ARG_DOUBLE(class, "s0", 2, ++ _("Deviation"), ++ _("New deviation"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsStdif, s0 ), +- -INFINITY, INFINITY, 50 ); +- ++ G_STRUCT_OFFSET(VipsStdif, s0), ++ -INFINITY, INFINITY, 50); + } + + static void +-vips_stdif_init( VipsStdif *stdif ) ++vips_stdif_init(VipsStdif *stdif) + { + stdif->width = 11; + stdif->height = 11; +@@ -375,22 +374,22 @@ vips_stdif_init( VipsStdif *stdif ) + * * @s0: target deviation + * + * vips_stdif() preforms statistical differencing according to the formula +- * given in page 45 of the book "An Introduction to Digital Image +- * Processing" by Wayne Niblack. This transformation emphasises the way in +- * which a pel differs statistically from its neighbours. It is useful for ++ * given in page 45 of the book "An Introduction to Digital Image ++ * Processing" by Wayne Niblack. This transformation emphasises the way in ++ * which a pel differs statistically from its neighbours. It is useful for + * enhancing low-contrast images with lots of detail, such as X-ray plates. + * + * At point (i,j) the output is given by the equation: + * + * |[ +- * vout(i,j) = @a * @m0 + (1 - @a) * meanv + ++ * vout(i,j) = @a * @m0 + (1 - @a) * meanv + + * (vin(i,j) - meanv) * (@b * @s0) / (@s0 + @b * stdv) + * ]| + * + * Values @a, @m0, @b and @s0 are entered, while meanv and stdv are the values +- * calculated over a moving window of size @width, @height centred on pixel +- * (i,j). @m0 is the new mean, @a is the weight given to it. @s0 is the new +- * standard deviation, @b is the weight given to it. ++ * calculated over a moving window of size @width, @height centred on pixel ++ * (i,j). @m0 is the new mean, @a is the weight given to it. @s0 is the new ++ * standard deviation, @b is the weight given to it. + * + * Try: + * +@@ -398,24 +397,23 @@ vips_stdif_init( VipsStdif *stdif ) + * vips stdif $VIPSHOME/pics/huysum.v fred.v 0.5 128 0.5 50 11 11 + * ]| + * +- * The operation works on one-band uchar images only, and writes a one-band +- * uchar image as its result. The output image has the same size as the ++ * The operation works on one-band uchar images only, and writes a one-band ++ * uchar image as its result. The output image has the same size as the + * input. + * + * See also: vips_hist_local(). + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_stdif( VipsImage *in, VipsImage **out, int width, int height, ... ) ++int ++vips_stdif(VipsImage *in, VipsImage **out, int width, int height, ...) + { + va_list ap; + int result; + +- va_start( ap, height ); +- result = vips_call_split( "stdif", ap, in, out, width, height ); +- va_end( ap ); ++ va_start(ap, height); ++ result = vips_call_split("stdif", ap, in, out, width, height); ++ va_end(ap); + +- return( result ); ++ return (result); + } +- +diff --git a/libvips/include/vips/almostdeprecated.h b/libvips/include/vips/almostdeprecated.h +index 1f3df78b10..8bc64d1b07 100644 +--- a/libvips/include/vips/almostdeprecated.h ++++ b/libvips/include/vips/almostdeprecated.h +@@ -1,5 +1,5 @@ + /* Old and broken stuff that we still enable by default, but don't document +- * and certainly don't recommend. ++ * and certainly don't recommend. + * + * 30/6/09 + * - from vips.h +@@ -7,28 +7,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -54,58 +54,58 @@ typedef enum { + /* Used to define a region of interest for im_extract() etc. Too boring to be + * public API, see im_extract_area() etc. + */ +-typedef struct { ++typedef struct { + int xstart; + int ystart; + int xsize; + int ysize; +- int chsel; /* 1 2 3 or 0, for r g b or all respectively +- *(channel select) */ ++ int chsel; /* 1 2 3 or 0, for r g b or all respectively ++ *(channel select) */ + } IMAGE_BOX; + + VIPS_DEPRECATED +-int im_extract( IMAGE *, IMAGE *, IMAGE_BOX * ); ++int im_extract(IMAGE *, IMAGE *, IMAGE_BOX *); + VIPS_DEPRECATED +-DOUBLEMASK *im_measure( IMAGE *im, IMAGE_BOX *box, int h, int v, +- int *sel, int nsel, const char *name ); ++DOUBLEMASK *im_measure(IMAGE *im, IMAGE_BOX *box, int h, int v, ++ int *sel, int nsel, const char *name); + + VIPS_DEPRECATED +-gboolean im_isuint( IMAGE *im ); ++gboolean im_isuint(IMAGE *im); + VIPS_DEPRECATED +-gboolean im_isint( IMAGE *im ); ++gboolean im_isint(IMAGE *im); + VIPS_DEPRECATED +-gboolean im_isfloat( IMAGE *im ); ++gboolean im_isfloat(IMAGE *im); + VIPS_DEPRECATED +-gboolean im_isscalar( IMAGE *im ); ++gboolean im_isscalar(IMAGE *im); + VIPS_DEPRECATED +-gboolean im_iscomplex( IMAGE *im ); ++gboolean im_iscomplex(IMAGE *im); + + VIPS_DEPRECATED +-int im_c2ps( IMAGE *in, IMAGE *out ); ++int im_c2ps(IMAGE *in, IMAGE *out); + + VIPS_DEPRECATED +-int im_clip( IMAGE *in, IMAGE *out ); ++int im_clip(IMAGE *in, IMAGE *out); + + #define MASK_IDEAL_HIGHPASS IM_MASK_IDEAL_HIGHPASS +-#define MASK_IDEAL_LOWPASS IM_MASK_IDEAL_LOWPASS +-#define MASK_BUTTERWORTH_HIGHPASS IM_MASK_BUTTERWORTH_HIGHPASS +-#define MASK_BUTTERWORTH_LOWPASS IM_MASK_BUTTERWORTH_LOWPASS +-#define MASK_GAUSS_HIGHPASS IM_MASK_GAUSS_HIGHPASS +-#define MASK_GAUSS_LOWPASS IM_MASK_GAUSS_LOWPASS ++#define MASK_IDEAL_LOWPASS IM_MASK_IDEAL_LOWPASS ++#define MASK_BUTTERWORTH_HIGHPASS IM_MASK_BUTTERWORTH_HIGHPASS ++#define MASK_BUTTERWORTH_LOWPASS IM_MASK_BUTTERWORTH_LOWPASS ++#define MASK_GAUSS_HIGHPASS IM_MASK_GAUSS_HIGHPASS ++#define MASK_GAUSS_LOWPASS IM_MASK_GAUSS_LOWPASS + + #define MASK_IDEAL_RINGPASS IM_MASK_IDEAL_RINGPASS +-#define MASK_IDEAL_RINGREJECT IM_MASK_IDEAL_RINGREJECT +-#define MASK_BUTTERWORTH_RINGPASS IM_MASK_BUTTERWORTH_RINGPASS +-#define MASK_BUTTERWORTH_RINGREJECT IM_MASK_BUTTERWORTH_RINGREJECT +-#define MASK_GAUSS_RINGPASS IM_MASK_GAUSS_RINGPASS +-#define MASK_GAUSS_RINGREJECT IM_MASK_GAUSS_RINGREJECT ++#define MASK_IDEAL_RINGREJECT IM_MASK_IDEAL_RINGREJECT ++#define MASK_BUTTERWORTH_RINGPASS IM_MASK_BUTTERWORTH_RINGPASS ++#define MASK_BUTTERWORTH_RINGREJECT IM_MASK_BUTTERWORTH_RINGREJECT ++#define MASK_GAUSS_RINGPASS IM_MASK_GAUSS_RINGPASS ++#define MASK_GAUSS_RINGREJECT IM_MASK_GAUSS_RINGREJECT + + #define MASK_IDEAL_BANDPASS IM_MASK_IDEAL_BANDPASS +-#define MASK_IDEAL_BANDREJECT IM_MASK_IDEAL_BANDREJECT +-#define MASK_BUTTERWORTH_BANDPASS IM_MASK_BUTTERWORTH_BANDPASS +-#define MASK_BUTTERWORTH_BANDREJECT IM_MASK_BUTTERWORTH_BANDREJECT +-#define MASK_GAUSS_BANDPASS IM_MASK_GAUSS_BANDPASS +-#define MASK_GAUSS_BANDREJECT IM_MASK_GAUSS_BANDREJECT ++#define MASK_IDEAL_BANDREJECT IM_MASK_IDEAL_BANDREJECT ++#define MASK_BUTTERWORTH_BANDPASS IM_MASK_BUTTERWORTH_BANDPASS ++#define MASK_BUTTERWORTH_BANDREJECT IM_MASK_BUTTERWORTH_BANDREJECT ++#define MASK_GAUSS_BANDPASS IM_MASK_GAUSS_BANDPASS ++#define MASK_GAUSS_BANDREJECT IM_MASK_GAUSS_BANDREJECT + + #define MASK_FRACTAL_FLT IM_MASK_FRACTAL_FLT + +@@ -121,9 +121,9 @@ typedef enum { + } im_arch_type; + + VIPS_DEPRECATED +-gboolean im_isnative( im_arch_type arch ); ++gboolean im_isnative(im_arch_type arch); + VIPS_DEPRECATED +-int im_copy_from( IMAGE *in, IMAGE *out, im_arch_type architecture ); ++int im_copy_from(IMAGE *in, IMAGE *out, im_arch_type architecture); + + /* Backwards compatibility macros. + */ +@@ -133,90 +133,89 @@ int im_copy_from( IMAGE *in, IMAGE *out, im_arch_type architecture ); + /* Deprecated API. + */ + VIPS_DEPRECATED_FOR(vips_error) +-void im_errormsg( const char *fmt, ... ) +- G_GNUC_PRINTF( 1, 2 ); ++void im_errormsg(const char *fmt, ...) ++ G_GNUC_PRINTF(1, 2); + VIPS_DEPRECATED_FOR(vips_verror) +-void im_verrormsg( const char *fmt, va_list ap ); ++void im_verrormsg(const char *fmt, va_list ap); + VIPS_DEPRECATED_FOR(vips_error_system) +-void im_errormsg_system( int err, const char *fmt, ... ) +- G_GNUC_PRINTF( 2, 3 ); ++void im_errormsg_system(int err, const char *fmt, ...) ++ G_GNUC_PRINTF(2, 3); + VIPS_DEPRECATED_FOR(g_info) +-void im_diagnostics( const char *fmt, ... ) +- G_GNUC_PRINTF( 1, 2 ); ++void im_diagnostics(const char *fmt, ...) ++ G_GNUC_PRINTF(1, 2); + VIPS_DEPRECATED_FOR(g_warning) +-void im_warning( const char *fmt, ... ) +- G_GNUC_PRINTF( 1, 2 ); ++void im_warning(const char *fmt, ...) ++ G_GNUC_PRINTF(1, 2); + + VIPS_DEPRECATED +-int im_iterate( VipsImage *im, ++int im_iterate(VipsImage *im, + VipsStartFn start, im_generate_fn generate, VipsStopFn stop, +- void *a, void *b +-); ++ void *a, void *b); + + /* Async rendering. + */ + VIPS_DEPRECATED_FOR(vips_sink_screen) +-int im_render_priority( VipsImage *in, VipsImage *out, VipsImage *mask, ++int im_render_priority(VipsImage *in, VipsImage *out, VipsImage *mask, + int width, int height, int max, + int priority, +- void (*notify)( VipsImage *, VipsRect *, void * ), void *client ); ++ void (*notify)(VipsImage *, VipsRect *, void *), void *client); + VIPS_DEPRECATED_FOR(vips_sink_screen) +-int im_cache( VipsImage *in, VipsImage *out, int width, int height, int max ); ++int im_cache(VipsImage *in, VipsImage *out, int width, int height, int max); + + /* Deprecated operations. + */ + VIPS_DEPRECATED +-int im_cmulnorm( IMAGE *in1, IMAGE *in2, IMAGE *out ); ++int im_cmulnorm(IMAGE *in1, IMAGE *in2, IMAGE *out); + VIPS_DEPRECATED +-int im_fav4( IMAGE **, IMAGE * ); ++int im_fav4(IMAGE **, IMAGE *); + VIPS_DEPRECATED +-int im_gadd( double, IMAGE *, double, IMAGE *, double, IMAGE *); ++int im_gadd(double, IMAGE *, double, IMAGE *, double, IMAGE *); + VIPS_DEPRECATED +-int im_litecor( IMAGE *, IMAGE *, IMAGE *, int, double ); ++int im_litecor(IMAGE *, IMAGE *, IMAGE *, int, double); + VIPS_DEPRECATED_FOR(vips_sink_screen) +-int im_render_fade( IMAGE *in, IMAGE *out, IMAGE *mask, ++int im_render_fade(IMAGE *in, IMAGE *out, IMAGE *mask, + int width, int height, int max, + int fps, int steps, + int priority, +- void (*notify)( IMAGE *, VipsRect *, void * ), void *client ); ++ void (*notify)(IMAGE *, VipsRect *, void *), void *client); + VIPS_DEPRECATED_FOR(vips_sink_screen) +-int im_render( IMAGE *in, IMAGE *out, IMAGE *mask, ++int im_render(IMAGE *in, IMAGE *out, IMAGE *mask, + int width, int height, int max, +- void (*notify)( IMAGE *, VipsRect *, void * ), void *client ); ++ void (*notify)(IMAGE *, VipsRect *, void *), void *client); + + VIPS_DEPRECATED +-int im_cooc_matrix( IMAGE *im, IMAGE *m, +- int xp, int yp, int xs, int ys, int dx, int dy, int flag ); ++int im_cooc_matrix(IMAGE *im, IMAGE *m, ++ int xp, int yp, int xs, int ys, int dx, int dy, int flag); + VIPS_DEPRECATED +-int im_cooc_asm( IMAGE *m, double *asmoment ); ++int im_cooc_asm(IMAGE *m, double *asmoment); + VIPS_DEPRECATED +-int im_cooc_contrast( IMAGE *m, double *contrast ); ++int im_cooc_contrast(IMAGE *m, double *contrast); + VIPS_DEPRECATED +-int im_cooc_correlation( IMAGE *m, double *correlation ); ++int im_cooc_correlation(IMAGE *m, double *correlation); + VIPS_DEPRECATED +-int im_cooc_entropy( IMAGE *m, double *entropy ); ++int im_cooc_entropy(IMAGE *m, double *entropy); + + VIPS_DEPRECATED +-int im_glds_matrix( IMAGE *im, IMAGE *m, +- int xpos, int ypos, int xsize, int ysize, int dx, int dy ); ++int im_glds_matrix(IMAGE *im, IMAGE *m, ++ int xpos, int ypos, int xsize, int ysize, int dx, int dy); + VIPS_DEPRECATED +-int im_glds_asm( IMAGE *m, double *asmoment ); ++int im_glds_asm(IMAGE *m, double *asmoment); + VIPS_DEPRECATED +-int im_glds_contrast( IMAGE *m, double *contrast ); ++int im_glds_contrast(IMAGE *m, double *contrast); + VIPS_DEPRECATED +-int im_glds_entropy( IMAGE *m, double *entropy ); ++int im_glds_entropy(IMAGE *m, double *entropy); + VIPS_DEPRECATED +-int im_glds_mean( IMAGE *m, double *mean ); ++int im_glds_mean(IMAGE *m, double *mean); + + VIPS_DEPRECATED + int im_dif_std(IMAGE *im, int xpos, int ypos, int xsize, int ysize, int dx, int dy, double *pmean, double *pstd); + VIPS_DEPRECATED +-int im_simcontr( IMAGE *out, int xsize, int ysize ); ++int im_simcontr(IMAGE *out, int xsize, int ysize); + VIPS_DEPRECATED +-int im_spatres( IMAGE *in, IMAGE *out, int step ); ++int im_spatres(IMAGE *in, IMAGE *out, int step); + + VIPS_DEPRECATED +-int im_stretch3( IMAGE *in, IMAGE *out, double dx, double dy ); ++int im_stretch3(IMAGE *in, IMAGE *out, double dx, double dy); + + /* Renamed operations. + */ +@@ -224,184 +223,184 @@ int im_stretch3( IMAGE *in, IMAGE *out, double dx, double dy ); + /* arithmetic + */ + VIPS_DEPRECATED_FOR(vips_remainder_const) +-int im_remainderconst_vec( IMAGE *in, IMAGE *out, int n, double *c ); ++int im_remainderconst_vec(IMAGE *in, IMAGE *out, int n, double *c); + + /* boolean + */ + VIPS_DEPRECATED_FOR(vips_andimage_const1) +-int im_andconst( IMAGE *, IMAGE *, double ); ++int im_andconst(IMAGE *, IMAGE *, double); + VIPS_DEPRECATED_FOR(vips_andimage_const) +-int im_and_vec( IMAGE *, IMAGE *, int, double * ); ++int im_and_vec(IMAGE *, IMAGE *, int, double *); + VIPS_DEPRECATED_FOR(vips_orimage_const1) +-int im_orconst( IMAGE *, IMAGE *, double ); ++int im_orconst(IMAGE *, IMAGE *, double); + VIPS_DEPRECATED_FOR(vips_orimage_const) +-int im_or_vec( IMAGE *, IMAGE *, int, double * ); ++int im_or_vec(IMAGE *, IMAGE *, int, double *); + VIPS_DEPRECATED_FOR(vips_eorimage_const1) +-int im_eorconst( IMAGE *, IMAGE *, double ); ++int im_eorconst(IMAGE *, IMAGE *, double); + VIPS_DEPRECATED_FOR(vips_eorimage_const) +-int im_eor_vec( IMAGE *, IMAGE *, int, double * ); ++int im_eor_vec(IMAGE *, IMAGE *, int, double *); + + /* mosaicing + */ + VIPS_DEPRECATED_FOR(vips_affine) +-int im_affine( IMAGE *in, IMAGE *out, ++int im_affine(IMAGE *in, IMAGE *out, + double a, double b, double c, double d, double dx, double dy, +- int ox, int oy, int ow, int oh ); ++ int ox, int oy, int ow, int oh); + VIPS_DEPRECATED_FOR(vips_similarity) +-int im_similarity( IMAGE *in, IMAGE *out, +- double a, double b, double dx, double dy ); ++int im_similarity(IMAGE *in, IMAGE *out, ++ double a, double b, double dx, double dy); + VIPS_DEPRECATED_FOR(vips_similarity) +-int im_similarity_area( IMAGE *in, IMAGE *out, ++int im_similarity_area(IMAGE *in, IMAGE *out, + double a, double b, double dx, double dy, +- int ox, int oy, int ow, int oh ); ++ int ox, int oy, int ow, int oh); + + /* colour + */ + VIPS_DEPRECATED_FOR(vips_icc_export) +-int im_icc_export( IMAGE *in, IMAGE *out, +- const char *output_profile_filename, int intent ); ++int im_icc_export(IMAGE *in, IMAGE *out, ++ const char *output_profile_filename, int intent); + + /* conversion + */ + VIPS_DEPRECATED_FOR(vips_cast) +-int im_clip2dcm( IMAGE *in, IMAGE *out ); ++int im_clip2dcm(IMAGE *in, IMAGE *out); + VIPS_DEPRECATED_FOR(vips_cast) +-int im_clip2cm( IMAGE *in, IMAGE *out ); ++int im_clip2cm(IMAGE *in, IMAGE *out); + VIPS_DEPRECATED_FOR(vips_cast) +-int im_clip2us( IMAGE *in, IMAGE *out ); ++int im_clip2us(IMAGE *in, IMAGE *out); + VIPS_DEPRECATED_FOR(vips_cast) +-int im_clip2ui( IMAGE *in, IMAGE *out ); ++int im_clip2ui(IMAGE *in, IMAGE *out); + VIPS_DEPRECATED_FOR(vips_cast) +-int im_clip2s( IMAGE *in, IMAGE *out ); ++int im_clip2s(IMAGE *in, IMAGE *out); + VIPS_DEPRECATED_FOR(vips_cast) +-int im_clip2i( IMAGE *in, IMAGE *out ); ++int im_clip2i(IMAGE *in, IMAGE *out); + VIPS_DEPRECATED_FOR(vips_cast) +-int im_clip2d( IMAGE *in, IMAGE *out ); ++int im_clip2d(IMAGE *in, IMAGE *out); + VIPS_DEPRECATED_FOR(vips_cast) +-int im_clip2f( IMAGE *in, IMAGE *out ); ++int im_clip2f(IMAGE *in, IMAGE *out); + VIPS_DEPRECATED_FOR(vips_cast) +-int im_clip2c( IMAGE *in, IMAGE *out ); ++int im_clip2c(IMAGE *in, IMAGE *out); + + VIPS_DEPRECATED +-int im_slice( IMAGE *in, IMAGE *out, double, double ); ++int im_slice(IMAGE *in, IMAGE *out, double, double); + VIPS_DEPRECATED +-int im_thresh( IMAGE *in, IMAGE *out, double ); ++int im_thresh(IMAGE *in, IMAGE *out, double); + + VIPS_DEPRECATED_FOR(printf) +-int im_print( const char *message ); ++int im_print(const char *message); + + VIPS_DEPRECATED +-int im_convsub( IMAGE *in, IMAGE *out, INTMASK *mask, int xskip, int yskip ); ++int im_convsub(IMAGE *in, IMAGE *out, INTMASK *mask, int xskip, int yskip); + + VIPS_DEPRECATED +-int im_bernd( const char *tiffname, int x, int y, int w, int h ); ++int im_bernd(const char *tiffname, int x, int y, int w, int h); + + VIPS_DEPRECATED +-int im_resize_linear( IMAGE *, IMAGE *, int, int ); ++int im_resize_linear(IMAGE *, IMAGE *, int, int); + + VIPS_DEPRECATED_FOR(vips_convf) +-int im_convf( IMAGE *in, IMAGE *out, DOUBLEMASK *mask ); ++int im_convf(IMAGE *in, IMAGE *out, DOUBLEMASK *mask); + VIPS_DEPRECATED_FOR(vips_convsep) +-int im_convsepf( IMAGE *in, IMAGE *out, DOUBLEMASK *mask ); ++int im_convsepf(IMAGE *in, IMAGE *out, DOUBLEMASK *mask); + VIPS_DEPRECATED +-int im_conv_raw( IMAGE *in, IMAGE *out, INTMASK *mask ); ++int im_conv_raw(IMAGE *in, IMAGE *out, INTMASK *mask); + VIPS_DEPRECATED +-int im_convf_raw( IMAGE *in, IMAGE *out, DOUBLEMASK *mask ); ++int im_convf_raw(IMAGE *in, IMAGE *out, DOUBLEMASK *mask); + VIPS_DEPRECATED +-int im_convsep_raw( IMAGE *in, IMAGE *out, INTMASK *mask ); ++int im_convsep_raw(IMAGE *in, IMAGE *out, INTMASK *mask); + VIPS_DEPRECATED +-int im_convsepf_raw( IMAGE *in, IMAGE *out, DOUBLEMASK *mask ); ++int im_convsepf_raw(IMAGE *in, IMAGE *out, DOUBLEMASK *mask); + VIPS_DEPRECATED +-int im_fastcor_raw( IMAGE *in, IMAGE *ref, IMAGE *out ); ++int im_fastcor_raw(IMAGE *in, IMAGE *ref, IMAGE *out); + VIPS_DEPRECATED +-int im_spcor_raw( IMAGE *in, IMAGE *ref, IMAGE *out ); ++int im_spcor_raw(IMAGE *in, IMAGE *ref, IMAGE *out); + VIPS_DEPRECATED +-int im_gradcor_raw( IMAGE *in, IMAGE *ref, IMAGE *out ); ++int im_gradcor_raw(IMAGE *in, IMAGE *ref, IMAGE *out); + VIPS_DEPRECATED +-int im_contrast_surface_raw( IMAGE *in, IMAGE *out, +- int half_win_size, int spacing ); ++int im_contrast_surface_raw(IMAGE *in, IMAGE *out, ++ int half_win_size, int spacing); + + VIPS_DEPRECATED_FOR(vips_stdif) +-int im_stdif_raw( IMAGE *in, IMAGE *out, +- double a, double m0, double b, double s0, int xwin, int ywin ); ++int im_stdif_raw(IMAGE *in, IMAGE *out, ++ double a, double m0, double b, double s0, int xwin, int ywin); + VIPS_DEPRECATED_FOR(vips_hist_local) +-int im_lhisteq_raw( IMAGE *in, IMAGE *out, int xwin, int ywin ); ++int im_lhisteq_raw(IMAGE *in, IMAGE *out, int xwin, int ywin); + + VIPS_DEPRECATED_FOR(vips_morph) +-int im_erode_raw( IMAGE *in, IMAGE *out, INTMASK *m ); ++int im_erode_raw(IMAGE *in, IMAGE *out, INTMASK *m); + VIPS_DEPRECATED_FOR(vips_morph) +-int im_dilate_raw( IMAGE *in, IMAGE *out, INTMASK *m ); ++int im_dilate_raw(IMAGE *in, IMAGE *out, INTMASK *m); + VIPS_DEPRECATED +-int im_rank_raw( IMAGE *in, IMAGE *out, int xsize, int ysize, int order ); ++int im_rank_raw(IMAGE *in, IMAGE *out, int xsize, int ysize, int order); + + /* inplace + */ + VIPS_DEPRECATED_FOR(vips_draw_circle) +-int im_circle( IMAGE *im, int cx, int cy, int radius, int intensity ); ++int im_circle(IMAGE *im, int cx, int cy, int radius, int intensity); + VIPS_DEPRECATED_FOR(vips_draw_line1) +-int im_line( IMAGE *, int, int, int, int, int ); ++int im_line(IMAGE *, int, int, int, int, int); + VIPS_DEPRECATED_FOR(vips_labelregions) +-int im_segment( IMAGE *test, IMAGE *mask, int *segments ); ++int im_segment(IMAGE *test, IMAGE *mask, int *segments); + VIPS_DEPRECATED_FOR(vips_draw_rect) +-int im_paintrect( IMAGE *im, VipsRect *r, PEL *ink ); ++int im_paintrect(IMAGE *im, VipsRect *r, PEL *ink); + VIPS_DEPRECATED_FOR(vips_draw_image) +-int im_insertplace( IMAGE *main, IMAGE *sub, int x, int y ); ++int im_insertplace(IMAGE *main, IMAGE *sub, int x, int y); + + VIPS_DEPRECATED_FOR(vips_draw_flood) +-int im_flood_copy( IMAGE *in, IMAGE *out, int x, int y, PEL *ink ); ++int im_flood_copy(IMAGE *in, IMAGE *out, int x, int y, PEL *ink); + VIPS_DEPRECATED_FOR(vips_draw_flood) +-int im_flood_blob_copy( IMAGE *in, IMAGE *out, int x, int y, PEL *ink ); ++int im_flood_blob_copy(IMAGE *in, IMAGE *out, int x, int y, PEL *ink); + VIPS_DEPRECATED_FOR(vips_draw_flood) +-int im_flood_other_copy( IMAGE *test, IMAGE *mark, IMAGE *out, +- int x, int y, int serial ); ++int im_flood_other_copy(IMAGE *test, IMAGE *mark, IMAGE *out, ++ int x, int y, int serial); + + VIPS_DEPRECATED_FOR(vips_draw_flood) +-int im_flood( IMAGE *im, int x, int y, PEL *ink, VipsRect *dout ); ++int im_flood(IMAGE *im, int x, int y, PEL *ink, VipsRect *dout); + VIPS_DEPRECATED_FOR(vips_draw_flood) +-int im_flood_blob( IMAGE *im, int x, int y, PEL *ink, VipsRect *dout ); ++int im_flood_blob(IMAGE *im, int x, int y, PEL *ink, VipsRect *dout); + VIPS_DEPRECATED_FOR(vips_draw_flood) +-int im_flood_other( IMAGE *test, IMAGE *mark, +- int x, int y, int serial, VipsRect *dout ); ++int im_flood_other(IMAGE *test, IMAGE *mark, ++ int x, int y, int serial, VipsRect *dout); + + VIPS_DEPRECATED_FOR(vips_draw_line) +-int im_fastline( IMAGE *im, int x1, int y1, int x2, int y2, PEL *pel ); ++int im_fastline(IMAGE *im, int x1, int y1, int x2, int y2, PEL *pel); + VIPS_DEPRECATED_FOR(vips_draw_line) +-int im_fastlineuser( IMAGE *im, +- int x1, int y1, int x2, int y2, +- VipsPlotFn fn, void *client1, void *client2, void *client3 ); ++int im_fastlineuser(IMAGE *im, ++ int x1, int y1, int x2, int y2, ++ VipsPlotFn fn, void *client1, void *client2, void *client3); + + VIPS_DEPRECATED_FOR(vips_draw_mask) +-int im_plotmask( IMAGE *im, int ix, int iy, PEL *ink, PEL *mask, VipsRect *r ); ++int im_plotmask(IMAGE *im, int ix, int iy, PEL *ink, PEL *mask, VipsRect *r); + VIPS_DEPRECATED_FOR(vips_getpoint) +-int im_readpoint( IMAGE *im, int x, int y, PEL *pel ); ++int im_readpoint(IMAGE *im, int x, int y, PEL *pel); + VIPS_DEPRECATED_FOR(vips_draw_point) +-int im_plotpoint( IMAGE *im, int x, int y, PEL *pel ); ++int im_plotpoint(IMAGE *im, int x, int y, PEL *pel); + + VIPS_DEPRECATED_FOR(vips_draw_smudge) +-int im_smudge( IMAGE *image, int ix, int iy, VipsRect *r ); ++int im_smudge(IMAGE *image, int ix, int iy, VipsRect *r); + VIPS_DEPRECATED +-int im_smear( IMAGE *im, int ix, int iy, VipsRect *r ); ++int im_smear(IMAGE *im, int ix, int iy, VipsRect *r); + + VIPS_DEPRECATED_FOR(g_warning) +-void vips_warn( const char *domain, const char *fmt, ... ) +- G_GNUC_PRINTF( 2, 3 ); ++void vips_warn(const char *domain, const char *fmt, ...) ++ G_GNUC_PRINTF(2, 3); + VIPS_DEPRECATED_FOR(g_warning) +-void vips_vwarn( const char *domain, const char *fmt, va_list ap ); ++void vips_vwarn(const char *domain, const char *fmt, va_list ap); + VIPS_DEPRECATED +-void vips_info_set( gboolean info ); ++void vips_info_set(gboolean info); + VIPS_DEPRECATED_FOR(g_info) +-void vips_info( const char *domain, const char *fmt, ... ) +- G_GNUC_PRINTF( 2, 3 ); ++void vips_info(const char *domain, const char *fmt, ...) ++ G_GNUC_PRINTF(2, 3); + VIPS_DEPRECATED_FOR(g_info) +-void vips_vinfo( const char *domain, const char *fmt, va_list ap ); ++void vips_vinfo(const char *domain, const char *fmt, va_list ap); + + VIPS_DEPRECATED_FOR(vips_autorot) +-VipsAngle vips_autorot_get_angle( VipsImage *image ); ++VipsAngle vips_autorot_get_angle(VipsImage *image); + + /* iofuncs + */ + VIPS_DEPRECATED_FOR(g_free) +-int vips_free( void *buf ); ++int vips_free(void *buf); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/arithmetic.h b/libvips/include/vips/arithmetic.h +index 8fc520e906..cb9d32d0c9 100644 +--- a/libvips/include/vips/arithmetic.h ++++ b/libvips/include/vips/arithmetic.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -41,7 +41,7 @@ + extern "C" { + #endif /*__cplusplus*/ + +-/** ++/** + * VipsOperationMath: + * @VIPS_OPERATION_MATH_SIN: sin(), angles in degrees + * @VIPS_OPERATION_MATH_COS: cos(), angles in degrees +@@ -49,8 +49,8 @@ extern "C" { + * @VIPS_OPERATION_MATH_ASIN: asin(), angles in degrees + * @VIPS_OPERATION_MATH_ACOS: acos(), angles in degrees + * @VIPS_OPERATION_MATH_ATAN: atan(), angles in degrees +- * @VIPS_OPERATION_MATH_LOG: log base e +- * @VIPS_OPERATION_MATH_LOG10: log base 10 ++ * @VIPS_OPERATION_MATH_LOG: log base e ++ * @VIPS_OPERATION_MATH_LOG10: log base 10 + * @VIPS_OPERATION_MATH_EXP: e to the something + * @VIPS_OPERATION_MATH_EXP10: 10 to the something + * @VIPS_OPERATION_MATH_SINH: sinh(), angles in radians +@@ -82,11 +82,11 @@ typedef enum { + VIPS_OPERATION_MATH_LAST + } VipsOperationMath; + +-/** ++/** + * VipsOperationMath2: + * @VIPS_OPERATION_MATH2_POW: pow( left, right ) +- * @VIPS_OPERATION_MATH2_WOP: pow( right, left ) +- * @VIPS_OPERATION_MATH2_ATAN2: atan2( left, right ) ++ * @VIPS_OPERATION_MATH2_WOP: pow( right, left ) ++ * @VIPS_OPERATION_MATH2_ATAN2: atan2( left, right ) + * + * See also: vips_math(). + */ +@@ -97,7 +97,7 @@ typedef enum { + VIPS_OPERATION_MATH2_LAST + } VipsOperationMath2; + +-/** ++/** + * VipsOperationRound: + * @VIPS_OPERATION_ROUND_RINT: round to nearest + * @VIPS_OPERATION_ROUND_FLOOR: largest integral value not greater than +@@ -112,7 +112,7 @@ typedef enum { + VIPS_OPERATION_ROUND_LAST + } VipsOperationRound; + +-/** ++/** + * VipsOperationRelational: + * @VIPS_OPERATION_RELATIONAL_EQUAL: == + * @VIPS_OPERATION_RELATIONAL_NOTEQ: != +@@ -133,7 +133,7 @@ typedef enum { + VIPS_OPERATION_RELATIONAL_LAST + } VipsOperationRelational; + +-/** ++/** + * VipsOperationBoolean: + * @VIPS_OPERATION_BOOLEAN_AND: & + * @VIPS_OPERATION_BOOLEAN_OR: | +@@ -152,7 +152,7 @@ typedef enum { + VIPS_OPERATION_BOOLEAN_LAST + } VipsOperationBoolean; + +-/** ++/** + * VipsOperationComplex: + * @VIPS_OPERATION_COMPLEX_POLAR: convert to polar coordinates + * @VIPS_OPERATION_COMPLEX_RECT: convert to rectangular coordinates +@@ -167,7 +167,7 @@ typedef enum { + VIPS_OPERATION_COMPLEX_LAST + } VipsOperationComplex; + +-/** ++/** + * VipsOperationComplex2: + * @VIPS_OPERATION_COMPLEX2_CROSS_PHASE: convert to polar coordinates + * +@@ -178,7 +178,7 @@ typedef enum { + VIPS_OPERATION_COMPLEX2_LAST + } VipsOperationComplex2; + +-/** ++/** + * VipsOperationComplexget: + * @VIPS_OPERATION_COMPLEXGET_REAL: get real component + * @VIPS_OPERATION_COMPLEXGET_IMAG: get imaginary component +@@ -192,376 +192,376 @@ typedef enum { + } VipsOperationComplexget; + + VIPS_API +-int vips_add( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_add(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_sum( VipsImage **in, VipsImage **out, int n, ... ) ++int vips_sum(VipsImage **in, VipsImage **out, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_subtract( VipsImage *in1, VipsImage *in2, VipsImage **out, ... ) ++int vips_subtract(VipsImage *in1, VipsImage *in2, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_multiply( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_multiply(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_divide( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_divide(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_linear( VipsImage *in, VipsImage **out, +- const double *a, const double *b, int n, ... ) ++int vips_linear(VipsImage *in, VipsImage **out, ++ const double *a, const double *b, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_linear1( VipsImage *in, VipsImage **out, double a, double b, ... ) ++int vips_linear1(VipsImage *in, VipsImage **out, double a, double b, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_remainder( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_remainder(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_remainder_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++int vips_remainder_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_remainder_const1( VipsImage *in, VipsImage **out, +- double c, ... ) ++int vips_remainder_const1(VipsImage *in, VipsImage **out, ++ double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_invert( VipsImage *in, VipsImage **out, ... ) ++int vips_invert(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_abs( VipsImage *in, VipsImage **out, ... ) ++int vips_abs(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_sign( VipsImage *in, VipsImage **out, ... ) ++int vips_sign(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_round( VipsImage *in, VipsImage **out, VipsOperationRound round, ... ) ++int vips_round(VipsImage *in, VipsImage **out, VipsOperationRound round, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_floor( VipsImage *in, VipsImage **out, ... ) ++int vips_floor(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_ceil( VipsImage *in, VipsImage **out, ... ) ++int vips_ceil(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_rint( VipsImage *in, VipsImage **out, ... ) ++int vips_rint(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_math( VipsImage *in, VipsImage **out, +- VipsOperationMath math, ... ) ++int vips_math(VipsImage *in, VipsImage **out, ++ VipsOperationMath math, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_sin( VipsImage *in, VipsImage **out, ... ) ++int vips_sin(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_cos( VipsImage *in, VipsImage **out, ... ) ++int vips_cos(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_tan( VipsImage *in, VipsImage **out, ... ) ++int vips_tan(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_asin( VipsImage *in, VipsImage **out, ... ) ++int vips_asin(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_acos( VipsImage *in, VipsImage **out, ... ) ++int vips_acos(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_atan( VipsImage *in, VipsImage **out, ... ) ++int vips_atan(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_exp( VipsImage *in, VipsImage **out, ... ) ++int vips_exp(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_exp10( VipsImage *in, VipsImage **out, ... ) ++int vips_exp10(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_log( VipsImage *in, VipsImage **out, ... ) ++int vips_log(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_log10( VipsImage *in, VipsImage **out, ... ) ++int vips_log10(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_sinh( VipsImage *in, VipsImage **out, ... ) ++int vips_sinh(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_cosh( VipsImage *in, VipsImage **out, ... ) ++int vips_cosh(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_tanh( VipsImage *in, VipsImage **out, ... ) ++int vips_tanh(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_asinh( VipsImage *in, VipsImage **out, ... ) ++int vips_asinh(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_acosh( VipsImage *in, VipsImage **out, ... ) ++int vips_acosh(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_atanh( VipsImage *in, VipsImage **out, ... ) ++int vips_atanh(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_complex( VipsImage *in, VipsImage **out, +- VipsOperationComplex cmplx, ... ) ++int vips_complex(VipsImage *in, VipsImage **out, ++ VipsOperationComplex cmplx, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_polar( VipsImage *in, VipsImage **out, ... ) ++int vips_polar(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_rect( VipsImage *in, VipsImage **out, ... ) ++int vips_rect(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_conj( VipsImage *in, VipsImage **out, ... ) ++int vips_conj(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_complex2( VipsImage *left, VipsImage *right, VipsImage **out, +- VipsOperationComplex2 cmplx, ... ) ++int vips_complex2(VipsImage *left, VipsImage *right, VipsImage **out, ++ VipsOperationComplex2 cmplx, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_cross_phase( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_cross_phase(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_complexget( VipsImage *in, VipsImage **out, +- VipsOperationComplexget get, ... ) ++int vips_complexget(VipsImage *in, VipsImage **out, ++ VipsOperationComplexget get, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_real( VipsImage *in, VipsImage **out, ... ) ++int vips_real(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_imag( VipsImage *in, VipsImage **out, ... ) ++int vips_imag(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_complexform( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_complexform(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_relational( VipsImage *left, VipsImage *right, VipsImage **out, +- VipsOperationRelational relational, ... ) ++int vips_relational(VipsImage *left, VipsImage *right, VipsImage **out, ++ VipsOperationRelational relational, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_equal( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_equal(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_notequal( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_notequal(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_less( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_less(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_lesseq( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_lesseq(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_more( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_more(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_moreeq( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_moreeq(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_relational_const( VipsImage *in, VipsImage **out, +- VipsOperationRelational relational, const double *c, int n, ... ) ++int vips_relational_const(VipsImage *in, VipsImage **out, ++ VipsOperationRelational relational, const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_equal_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++int vips_equal_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_notequal_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++int vips_notequal_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_less_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++int vips_less_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_lesseq_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++int vips_lesseq_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_more_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++int vips_more_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_moreeq_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++int vips_moreeq_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_relational_const1( VipsImage *in, VipsImage **out, +- VipsOperationRelational relational, double c, ... ) ++int vips_relational_const1(VipsImage *in, VipsImage **out, ++ VipsOperationRelational relational, double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_equal_const1( VipsImage *in, VipsImage **out, double c, ... ) ++int vips_equal_const1(VipsImage *in, VipsImage **out, double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_notequal_const1( VipsImage *in, VipsImage **out, double c, ... ) ++int vips_notequal_const1(VipsImage *in, VipsImage **out, double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_less_const1( VipsImage *in, VipsImage **out, double c, ... ) ++int vips_less_const1(VipsImage *in, VipsImage **out, double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_lesseq_const1( VipsImage *in, VipsImage **out, double c, ... ) ++int vips_lesseq_const1(VipsImage *in, VipsImage **out, double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_more_const1( VipsImage *in, VipsImage **out, double c, ... ) ++int vips_more_const1(VipsImage *in, VipsImage **out, double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_moreeq_const1( VipsImage *in, VipsImage **out, double c, ... ) ++int vips_moreeq_const1(VipsImage *in, VipsImage **out, double c, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_boolean( VipsImage *left, VipsImage *right, VipsImage **out, +- VipsOperationBoolean boolean, ... ) ++int vips_boolean(VipsImage *left, VipsImage *right, VipsImage **out, ++ VipsOperationBoolean boolean, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_andimage( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_andimage(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_orimage( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_orimage(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_eorimage( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_eorimage(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_lshift( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_lshift(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_rshift( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_rshift(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_boolean_const( VipsImage *in, VipsImage **out, +- VipsOperationBoolean boolean, const double *c, int n, ... ) ++int vips_boolean_const(VipsImage *in, VipsImage **out, ++ VipsOperationBoolean boolean, const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_andimage_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++int vips_andimage_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_orimage_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++int vips_orimage_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_eorimage_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++int vips_eorimage_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_lshift_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++int vips_lshift_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_rshift_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++int vips_rshift_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_boolean_const1( VipsImage *in, VipsImage **out, +- VipsOperationBoolean boolean, double c, ... ) ++int vips_boolean_const1(VipsImage *in, VipsImage **out, ++ VipsOperationBoolean boolean, double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_andimage_const1( VipsImage *in, VipsImage **out, double c, ... ) ++int vips_andimage_const1(VipsImage *in, VipsImage **out, double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_orimage_const1( VipsImage *in, VipsImage **out, double c, ... ) ++int vips_orimage_const1(VipsImage *in, VipsImage **out, double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_eorimage_const1( VipsImage *in, VipsImage **out, double c, ... ) ++int vips_eorimage_const1(VipsImage *in, VipsImage **out, double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_lshift_const1( VipsImage *in, VipsImage **out, double c, ... ) ++int vips_lshift_const1(VipsImage *in, VipsImage **out, double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_rshift_const1( VipsImage *in, VipsImage **out, double c, ... ) ++int vips_rshift_const1(VipsImage *in, VipsImage **out, double c, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_math2( VipsImage *left, VipsImage *right, VipsImage **out, +- VipsOperationMath2 math2, ... ) ++int vips_math2(VipsImage *left, VipsImage *right, VipsImage **out, ++ VipsOperationMath2 math2, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_pow( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_pow(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_wop( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_wop(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_atan2( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_atan2(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_math2_const( VipsImage *in, VipsImage **out, +- VipsOperationMath2 math2, const double *c, int n, ... ) ++int vips_math2_const(VipsImage *in, VipsImage **out, ++ VipsOperationMath2 math2, const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_pow_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++int vips_pow_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_wop_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++int vips_wop_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_atan2_const( VipsImage *in, VipsImage **out, +- const double *c, int n, ... ) ++int vips_atan2_const(VipsImage *in, VipsImage **out, ++ const double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_math2_const1( VipsImage *in, VipsImage **out, +- VipsOperationMath2 math2, double c, ... ) ++int vips_math2_const1(VipsImage *in, VipsImage **out, ++ VipsOperationMath2 math2, double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_pow_const1( VipsImage *in, VipsImage **out, double c, ... ) ++int vips_pow_const1(VipsImage *in, VipsImage **out, double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_wop_const1( VipsImage *in, VipsImage **out, double c, ... ) ++int vips_wop_const1(VipsImage *in, VipsImage **out, double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_atan2_const1( VipsImage *in, VipsImage **out, double c, ... ) ++int vips_atan2_const1(VipsImage *in, VipsImage **out, double c, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_avg( VipsImage *in, double *out, ... ) ++int vips_avg(VipsImage *in, double *out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_deviate( VipsImage *in, double *out, ... ) ++int vips_deviate(VipsImage *in, double *out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_min( VipsImage *in, double *out, ... ) ++int vips_min(VipsImage *in, double *out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_max( VipsImage *in, double *out, ... ) ++int vips_max(VipsImage *in, double *out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_stats( VipsImage *in, VipsImage **out, ... ) ++int vips_stats(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_measure( VipsImage *in, VipsImage **out, int h, int v, ... ) ++int vips_measure(VipsImage *in, VipsImage **out, int h, int v, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_find_trim( VipsImage *in, +- int *left, int *top, int *width, int *height, ... ) ++int vips_find_trim(VipsImage *in, ++ int *left, int *top, int *width, int *height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_getpoint( VipsImage *in, double **vector, int *n, int x, int y, ... ) ++int vips_getpoint(VipsImage *in, double **vector, int *n, int x, int y, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_hist_find( VipsImage *in, VipsImage **out, ... ) ++int vips_hist_find(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_hist_find_ndim( VipsImage *in, VipsImage **out, ... ) ++int vips_hist_find_ndim(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_hist_find_indexed( VipsImage *in, VipsImage *index, +- VipsImage **out, ... ) ++int vips_hist_find_indexed(VipsImage *in, VipsImage *index, ++ VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_hough_line( VipsImage *in, VipsImage **out, ... ) ++int vips_hough_line(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_hough_circle( VipsImage *in, VipsImage **out, ... ) ++int vips_hough_circle(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_project( VipsImage *in, VipsImage **columns, VipsImage **rows, ... ) ++int vips_project(VipsImage *in, VipsImage **columns, VipsImage **rows, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_profile( VipsImage *in, VipsImage **columns, VipsImage **rows, ... ) ++int vips_profile(VipsImage *in, VipsImage **columns, VipsImage **rows, ...) + G_GNUC_NULL_TERMINATED; + + #ifdef __cplusplus +diff --git a/libvips/include/vips/basic.h b/libvips/include/vips/basic.h +index 4db1384c90..b6ec3a27f0 100644 +--- a/libvips/include/vips/basic.h ++++ b/libvips/include/vips/basic.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -37,9 +37,9 @@ + /* Defined in config.h + */ + #ifdef _VIPS_PUBLIC +-# define VIPS_API _VIPS_PUBLIC extern ++#define VIPS_API _VIPS_PUBLIC extern + #else +-# define VIPS_API extern ++#define VIPS_API extern + #endif + + /* VIPS_DISABLE_DEPRECATION_WARNINGS: +@@ -49,11 +49,11 @@ + * Must be defined before including `vips/vips.h`. + */ + #ifdef VIPS_DISABLE_DEPRECATION_WARNINGS +-# define VIPS_DEPRECATED VIPS_API +-# define VIPS_DEPRECATED_FOR(f) VIPS_API ++#define VIPS_DEPRECATED VIPS_API ++#define VIPS_DEPRECATED_FOR(f) VIPS_API + #else +-# define VIPS_DEPRECATED G_DEPRECATED VIPS_API +-# define VIPS_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) VIPS_API ++#define VIPS_DEPRECATED G_DEPRECATED VIPS_API ++#define VIPS_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) VIPS_API + #endif + + #ifdef __cplusplus +@@ -70,16 +70,16 @@ typedef unsigned char VipsPel; + + /* Also used for eg. vips_local() and friends. + */ +-typedef int (*VipsCallbackFn)( void *a, void *b ); ++typedef int (*VipsCallbackFn)(void *a, void *b); + + /* Like GFunc, but return a value. + */ +-typedef void *(*VipsSListMap2Fn)( void *item, +- void *a, void *b ); +-typedef void *(*VipsSListMap4Fn)( void *item, +- void *a, void *b, void *c, void *d ); +-typedef void *(*VipsSListFold2Fn)( void *item, +- void *a, void *b, void *c ); ++typedef void *(*VipsSListMap2Fn)(void *item, ++ void *a, void *b); ++typedef void *(*VipsSListMap4Fn)(void *item, ++ void *a, void *b, void *c, void *d); ++typedef void *(*VipsSListFold2Fn)(void *item, ++ void *a, void *b, void *c); + + typedef enum { + VIPS_PRECISION_INTEGER, +@@ -91,19 +91,19 @@ typedef enum { + /* Just for testing. + */ + VIPS_API +-char *vips_path_filename7( const char *path ); ++char *vips_path_filename7(const char *path); + VIPS_API +-char *vips_path_mode7( const char *path ); ++char *vips_path_mode7(const char *path); + +-struct _VipsImage; ++struct _VipsImage; + typedef struct _VipsImage VipsImage; +-struct _VipsRegion; ++struct _VipsRegion; + typedef struct _VipsRegion VipsRegion; + struct _VipsBuf; + typedef struct _VipsBuf VipsBuf; +-struct _VipsSource; ++struct _VipsSource; + typedef struct _VipsSource VipsSource; +-struct _VipsTarget; ++struct _VipsTarget; + typedef struct _VipsTarget VipsTarget; + + #ifdef __cplusplus +diff --git a/libvips/include/vips/buf.h b/libvips/include/vips/buf.h +index acc0bb90cb..a71cd07753 100644 +--- a/libvips/include/vips/buf.h ++++ b/libvips/include/vips/buf.h +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -39,8 +39,8 @@ + extern "C" { + #endif /*__cplusplus*/ + +-/* A string in the process of being written to ... multiple calls to +- * vips_buf_append add to it. On overflow append "..." and block further ++/* A string in the process of being written to ... multiple calls to ++ * vips_buf_append add to it. On overflow append "..." and block further + * writes. + */ + +@@ -48,68 +48,70 @@ struct _VipsBuf { + /* All fields are private. + */ + /*< private >*/ +- char *base; /* String base */ +- int mx; /* Maximum length */ +- int i; /* Current write point */ +- gboolean full; /* String has filled, block writes */ +- int lasti; /* For read-recent */ +- gboolean dynamic; /* We own the string with malloc() */ +-}; +- +-#define VIPS_BUF_STATIC( TEXT ) \ +- { &TEXT[0], sizeof( TEXT ), 0, FALSE, 0, FALSE } ++ char *base; /* String base */ ++ int mx; /* Maximum length */ ++ int i; /* Current write point */ ++ gboolean full; /* String has filled, block writes */ ++ int lasti; /* For read-recent */ ++ gboolean dynamic; /* We own the string with malloc() */ ++}; ++ ++#define VIPS_BUF_STATIC(TEXT) \ ++ { \ ++ &TEXT[0], sizeof(TEXT), 0, FALSE, 0, FALSE \ ++ } + + /* Init and append to one of the above. + */ + VIPS_API +-void vips_buf_rewind( VipsBuf *buf ); ++void vips_buf_rewind(VipsBuf *buf); + VIPS_API +-void vips_buf_destroy( VipsBuf *buf ); ++void vips_buf_destroy(VipsBuf *buf); + VIPS_API +-void vips_buf_init( VipsBuf *buf ); ++void vips_buf_init(VipsBuf *buf); + VIPS_API +-void vips_buf_set_static( VipsBuf *buf, char *base, int mx ); ++void vips_buf_set_static(VipsBuf *buf, char *base, int mx); + VIPS_API +-void vips_buf_set_dynamic( VipsBuf *buf, int mx ); ++void vips_buf_set_dynamic(VipsBuf *buf, int mx); + VIPS_API +-void vips_buf_init_static( VipsBuf *buf, char *base, int mx ); ++void vips_buf_init_static(VipsBuf *buf, char *base, int mx); + VIPS_API +-void vips_buf_init_dynamic( VipsBuf *buf, int mx ); ++void vips_buf_init_dynamic(VipsBuf *buf, int mx); + VIPS_API +-gboolean vips_buf_appendns( VipsBuf *buf, const char *str, int sz ); ++gboolean vips_buf_appendns(VipsBuf *buf, const char *str, int sz); + VIPS_API +-gboolean vips_buf_appends( VipsBuf *buf, const char *str ); ++gboolean vips_buf_appends(VipsBuf *buf, const char *str); + VIPS_API +-gboolean vips_buf_appendf( VipsBuf *buf, const char *fmt, ... ) +- G_GNUC_PRINTF( 2, 3 ); ++gboolean vips_buf_appendf(VipsBuf *buf, const char *fmt, ...) ++ G_GNUC_PRINTF(2, 3); + VIPS_API +-gboolean vips_buf_vappendf( VipsBuf *buf, const char *fmt, va_list ap ); ++gboolean vips_buf_vappendf(VipsBuf *buf, const char *fmt, va_list ap); + VIPS_API +-gboolean vips_buf_appendc( VipsBuf *buf, char ch ); ++gboolean vips_buf_appendc(VipsBuf *buf, char ch); + VIPS_API +-gboolean vips_buf_appendsc( VipsBuf *buf, gboolean quote, const char *str ); ++gboolean vips_buf_appendsc(VipsBuf *buf, gboolean quote, const char *str); + VIPS_API +-gboolean vips_buf_appendgv( VipsBuf *buf, GValue *value ); ++gboolean vips_buf_appendgv(VipsBuf *buf, GValue *value); + VIPS_API +-gboolean vips_buf_append_size( VipsBuf *buf, size_t n ); ++gboolean vips_buf_append_size(VipsBuf *buf, size_t n); + VIPS_API +-gboolean vips_buf_removec( VipsBuf *buf, char ch ); ++gboolean vips_buf_removec(VipsBuf *buf, char ch); + VIPS_API +-gboolean vips_buf_change( VipsBuf *buf, const char *o, const char *n ); ++gboolean vips_buf_change(VipsBuf *buf, const char *o, const char *n); + VIPS_API +-gboolean vips_buf_is_empty( VipsBuf *buf ); ++gboolean vips_buf_is_empty(VipsBuf *buf); + VIPS_API +-gboolean vips_buf_is_full( VipsBuf *buf ); ++gboolean vips_buf_is_full(VipsBuf *buf); + VIPS_API +-const char *vips_buf_all( VipsBuf *buf ); ++const char *vips_buf_all(VipsBuf *buf); + VIPS_API +-const char *vips_buf_firstline( VipsBuf *buf ); ++const char *vips_buf_firstline(VipsBuf *buf); + VIPS_API +-gboolean vips_buf_appendg( VipsBuf *buf, double g ); ++gboolean vips_buf_appendg(VipsBuf *buf, double g); + VIPS_API +-gboolean vips_buf_appendd( VipsBuf *buf, int d ); ++gboolean vips_buf_appendd(VipsBuf *buf, int d); + VIPS_API +-int vips_buf_len( VipsBuf *buf ); ++int vips_buf_len(VipsBuf *buf); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/colour.h b/libvips/include/vips/colour.h +index cf73dac192..895f25e1dd 100644 +--- a/libvips/include/vips/colour.h ++++ b/libvips/include/vips/colour.h +@@ -11,28 +11,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -108,196 +108,196 @@ typedef enum { + } VipsPCS; + + VIPS_API +-gboolean vips_colourspace_issupported( const VipsImage *image ); ++gboolean vips_colourspace_issupported(const VipsImage *image); + VIPS_API +-int vips_colourspace( VipsImage *in, VipsImage **out, +- VipsInterpretation space, ... ) ++int vips_colourspace(VipsImage *in, VipsImage **out, ++ VipsInterpretation space, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_LabQ2sRGB( VipsImage *in, VipsImage **out, ... ) ++int vips_LabQ2sRGB(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_rad2float( VipsImage *in, VipsImage **out, ... ) ++int vips_rad2float(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_float2rad( VipsImage *in, VipsImage **out, ... ) ++int vips_float2rad(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_LabS2LabQ( VipsImage *in, VipsImage **out, ... ) ++int vips_LabS2LabQ(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_LabQ2LabS( VipsImage *in, VipsImage **out, ... ) ++int vips_LabQ2LabS(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_LabQ2Lab( VipsImage *in, VipsImage **out, ... ) ++int vips_LabQ2Lab(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_Lab2LabQ( VipsImage *in, VipsImage **out, ... ) ++int vips_Lab2LabQ(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_LCh2Lab( VipsImage *in, VipsImage **out, ... ) ++int vips_LCh2Lab(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_Lab2LCh( VipsImage *in, VipsImage **out, ... ) ++int vips_Lab2LCh(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_Yxy2Lab( VipsImage *in, VipsImage **out, ... ) ++int vips_Yxy2Lab(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_CMC2XYZ( VipsImage *in, VipsImage **out, ... ) ++int vips_CMC2XYZ(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_Lab2XYZ( VipsImage *in, VipsImage **out, ... ) ++int vips_Lab2XYZ(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_XYZ2Lab( VipsImage *in, VipsImage **out, ... ) ++int vips_XYZ2Lab(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_XYZ2scRGB( VipsImage *in, VipsImage **out, ... ) ++int vips_XYZ2scRGB(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_scRGB2sRGB( VipsImage *in, VipsImage **out, ... ) ++int vips_scRGB2sRGB(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_scRGB2BW( VipsImage *in, VipsImage **out, ... ) ++int vips_scRGB2BW(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_sRGB2scRGB( VipsImage *in, VipsImage **out, ... ) ++int vips_sRGB2scRGB(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_scRGB2XYZ( VipsImage *in, VipsImage **out, ... ) ++int vips_scRGB2XYZ(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_HSV2sRGB( VipsImage *in, VipsImage **out, ... ) ++int vips_HSV2sRGB(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_sRGB2HSV( VipsImage *in, VipsImage **out, ... ) ++int vips_sRGB2HSV(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_LCh2CMC( VipsImage *in, VipsImage **out, ... ) ++int vips_LCh2CMC(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_CMC2LCh( VipsImage *in, VipsImage **out, ... ) ++int vips_CMC2LCh(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_XYZ2Yxy( VipsImage *in, VipsImage **out, ... ) ++int vips_XYZ2Yxy(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_Yxy2XYZ( VipsImage *in, VipsImage **out, ... ) ++int vips_Yxy2XYZ(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_LabS2Lab( VipsImage *in, VipsImage **out, ... ) ++int vips_LabS2Lab(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_Lab2LabS( VipsImage *in, VipsImage **out, ... ) ++int vips_Lab2LabS(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_CMYK2XYZ( VipsImage *in, VipsImage **out, ... ) ++int vips_CMYK2XYZ(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_XYZ2CMYK( VipsImage *in, VipsImage **out, ... ) ++int vips_XYZ2CMYK(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_profile_load( const char *name, VipsBlob **profile, ... ) ++int vips_profile_load(const char *name, VipsBlob **profile, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_icc_present( void ); ++int vips_icc_present(void); + VIPS_API +-int vips_icc_transform( VipsImage *in, VipsImage **out, +- const char *output_profile, ... ) ++int vips_icc_transform(VipsImage *in, VipsImage **out, ++ const char *output_profile, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_icc_import( VipsImage *in, VipsImage **out, ... ) ++int vips_icc_import(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_icc_export( VipsImage *in, VipsImage **out, ... ) ++int vips_icc_export(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_icc_ac2rc( VipsImage *in, VipsImage **out, +- const char *profile_filename ); ++int vips_icc_ac2rc(VipsImage *in, VipsImage **out, ++ const char *profile_filename); + VIPS_API +-gboolean vips_icc_is_compatible_profile( VipsImage *image, +- const void *data, size_t data_length ); ++gboolean vips_icc_is_compatible_profile(VipsImage *image, ++ const void *data, size_t data_length); + + VIPS_API +-int vips_dE76( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_dE76(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_dE00( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_dE00(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_dECMC( VipsImage *left, VipsImage *right, VipsImage **out, ... ) ++int vips_dECMC(VipsImage *left, VipsImage *right, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-void vips_col_Lab2XYZ( float L, float a, float b, +- float *X, float *Y, float *Z ); ++void vips_col_Lab2XYZ(float L, float a, float b, ++ float *X, float *Y, float *Z); + VIPS_API +-void vips_col_XYZ2Lab( float X, float Y, float Z, +- float *L, float *a, float *b ); ++void vips_col_XYZ2Lab(float X, float Y, float Z, ++ float *L, float *a, float *b); + VIPS_API +-double vips_col_ab2h( double a, double b ); ++double vips_col_ab2h(double a, double b); + VIPS_API +-void vips_col_ab2Ch( float a, float b, float *C, float *h ); ++void vips_col_ab2Ch(float a, float b, float *C, float *h); + VIPS_API +-void vips_col_Ch2ab( float C, float h, float *a, float *b ); ++void vips_col_Ch2ab(float C, float h, float *a, float *b); + + VIPS_API +-float vips_col_L2Lcmc( float L ); ++float vips_col_L2Lcmc(float L); + VIPS_API +-float vips_col_C2Ccmc( float C ); ++float vips_col_C2Ccmc(float C); + VIPS_API +-float vips_col_Ch2hcmc( float C, float h ); ++float vips_col_Ch2hcmc(float C, float h); + + VIPS_API +-void vips_col_make_tables_CMC( void ); ++void vips_col_make_tables_CMC(void); + VIPS_API +-float vips_col_Lcmc2L( float Lcmc ); ++float vips_col_Lcmc2L(float Lcmc); + VIPS_API +-float vips_col_Ccmc2C( float Ccmc ); ++float vips_col_Ccmc2C(float Ccmc); + VIPS_API +-float vips_col_Chcmc2h( float C, float hcmc ); ++float vips_col_Chcmc2h(float C, float hcmc); + + VIPS_API +-int vips_col_sRGB2scRGB_8( int r, int g, int b, float *R, float *G, float *B ); ++int vips_col_sRGB2scRGB_8(int r, int g, int b, float *R, float *G, float *B); + VIPS_API +-int vips_col_sRGB2scRGB_16( int r, int g, int b, float *R, float *G, float *B ); ++int vips_col_sRGB2scRGB_16(int r, int g, int b, float *R, float *G, float *B); + VIPS_API +-int vips_col_sRGB2scRGB_8_noclip( int r, int g, int b, +- float *R, float *G, float *B ); ++int vips_col_sRGB2scRGB_8_noclip(int r, int g, int b, ++ float *R, float *G, float *B); + VIPS_API +-int vips_col_sRGB2scRGB_16_noclip( int r, int g, int b, +- float *R, float *G, float *B ); ++int vips_col_sRGB2scRGB_16_noclip(int r, int g, int b, ++ float *R, float *G, float *B); + + VIPS_API +-int vips_col_scRGB2XYZ( float R, float G, float B, +- float *X, float *Y, float *Z ); ++int vips_col_scRGB2XYZ(float R, float G, float B, ++ float *X, float *Y, float *Z); + VIPS_API +-int vips_col_XYZ2scRGB( float X, float Y, float Z, +- float *R, float *G, float *B ); ++int vips_col_XYZ2scRGB(float X, float Y, float Z, ++ float *R, float *G, float *B); + + VIPS_API +-int vips_col_scRGB2sRGB_8( float R, float G, float B, +- int *r, int *g, int *b, int *og ); ++int vips_col_scRGB2sRGB_8(float R, float G, float B, ++ int *r, int *g, int *b, int *og); + VIPS_API +-int vips_col_scRGB2sRGB_16( float R, float G, float B, +- int *r, int *g, int *b, int *og ); ++int vips_col_scRGB2sRGB_16(float R, float G, float B, ++ int *r, int *g, int *b, int *og); + VIPS_API +-int vips_col_scRGB2BW_16( float R, float G, float B, int *g, int *og ); ++int vips_col_scRGB2BW_16(float R, float G, float B, int *g, int *og); + VIPS_API +-int vips_col_scRGB2BW_8( float R, float G, float B, int *g, int *og ); ++int vips_col_scRGB2BW_8(float R, float G, float B, int *g, int *og); + + VIPS_API +-float vips_pythagoras( float L1, float a1, float b1, +- float L2, float a2, float b2 ); ++float vips_pythagoras(float L1, float a1, float b1, ++ float L2, float a2, float b2); + VIPS_API +-float vips_col_dE00( +- float L1, float a1, float b1, float L2, float a2, float b2 ); ++float vips_col_dE00( ++ float L1, float a1, float b1, float L2, float a2, float b2); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/connection.h b/libvips/include/vips/connection.h +index 0fed4f12eb..fbce951417 100644 +--- a/libvips/include/vips/connection.h ++++ b/libvips/include/vips/connection.h +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -44,21 +44,21 @@ extern "C" { + #endif /*__cplusplus*/ + + #define VIPS_TYPE_CONNECTION (vips_connection_get_type()) +-#define VIPS_CONNECTION( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_CONNECTION, VipsConnection )) +-#define VIPS_CONNECTION_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_CONNECTION, VipsConnectionClass)) +-#define VIPS_IS_CONNECTION( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_CONNECTION )) +-#define VIPS_IS_CONNECTION_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_CONNECTION )) +-#define VIPS_CONNECTION_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_CONNECTION, VipsConnectionClass )) +- +-/* Communicate with something like a socket or pipe. ++#define VIPS_CONNECTION(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_CONNECTION, VipsConnection)) ++#define VIPS_CONNECTION_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_CONNECTION, VipsConnectionClass)) ++#define VIPS_IS_CONNECTION(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_CONNECTION)) ++#define VIPS_IS_CONNECTION_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_CONNECTION)) ++#define VIPS_CONNECTION_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_CONNECTION, VipsConnectionClass)) ++ ++/* Communicate with something like a socket or pipe. + */ + typedef struct _VipsConnection { + VipsObject parent_object; +@@ -68,20 +68,20 @@ typedef struct _VipsConnection { + /* Read/write this fd if connected to a system pipe/socket. Override + * ::read() and ::write() to do something else. + */ +- int descriptor; ++ int descriptor; + + /* A descriptor we close with vips_tracked_close(). + */ +- int tracked_descriptor; ++ int tracked_descriptor; + + /* A descriptor we close with close(). + */ +- int close_descriptor; ++ int close_descriptor; + + /* If descriptor is a file, the filename we opened. Handy for error +- * messages. ++ * messages. + */ +- char *filename; ++ char *filename; + + } VipsConnection; + +@@ -91,30 +91,30 @@ typedef struct _VipsConnectionClass { + } VipsConnectionClass; + + VIPS_API +-GType vips_connection_get_type( void ); ++GType vips_connection_get_type(void); + + VIPS_API +-const char *vips_connection_filename( VipsConnection *connection ); ++const char *vips_connection_filename(VipsConnection *connection); + VIPS_API +-const char *vips_connection_nick( VipsConnection *connection ); ++const char *vips_connection_nick(VipsConnection *connection); + + VIPS_API +-void vips_pipe_read_limit_set( gint64 limit ); ++void vips_pipe_read_limit_set(gint64 limit); + + #define VIPS_TYPE_SOURCE (vips_source_get_type()) +-#define VIPS_SOURCE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_SOURCE, VipsSource )) +-#define VIPS_SOURCE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_SOURCE, VipsSourceClass)) +-#define VIPS_IS_SOURCE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_SOURCE )) +-#define VIPS_IS_SOURCE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_SOURCE )) +-#define VIPS_SOURCE_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_SOURCE, VipsSourceClass )) ++#define VIPS_SOURCE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_SOURCE, VipsSource)) ++#define VIPS_SOURCE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_SOURCE, VipsSourceClass)) ++#define VIPS_IS_SOURCE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_SOURCE)) ++#define VIPS_IS_SOURCE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_SOURCE)) ++#define VIPS_SOURCE_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_SOURCE, VipsSourceClass)) + + /* Read from something like a socket, file or memory area and present the data + * with a unified seek / read / map interface. +@@ -126,7 +126,7 @@ void vips_pipe_read_limit_set( gint64 limit ); + struct _VipsSource { + VipsConnection parent_object; + +- /* We have two phases: ++ /* We have two phases: + * + * During the header phase, we save bytes read from the input (if this + * is an unseekable source) so that we can rewind and try again, if +@@ -140,7 +140,7 @@ struct _VipsSource { + /* TRUE if this input is something like a pipe. These don't support + * seek or map -- all you can do is read() bytes sequentially. + * +- * If you attempt to map or get the size of a pipe-style input, it'll ++ * If you attempt to map or get the size of a pipe-style input, it'll + * get read entirely into memory. Seeks will cause read up to the seek + * point. + */ +@@ -151,7 +151,7 @@ struct _VipsSource { + * + * length is -1 for is_pipe sources. + * +- * off_t can be 32 bits on some platforms, so make sure we have a ++ * off_t can be 32 bits on some platforms, so make sure we have a + * full 64. + */ + gint64 read_position; +@@ -160,12 +160,12 @@ struct _VipsSource { + /*< private >*/ + + /* For sources where we have the whole image in memory (from a memory +- * buffer, from mmaping the file, from reading the pipe into memory), ++ * buffer, from mmaping the file, from reading the pipe into memory), + * a pointer to the start. + */ + const void *data; + +- /* For is_pipe sources, save data read during header phase here. If ++ /* For is_pipe sources, save data read during header phase here. If + * we rewind and try again, serve data from this until it runs out. + * + * If we need to force the whole pipe into memory, read everything to +@@ -177,7 +177,7 @@ struct _VipsSource { + */ + GByteArray *sniff; + +- /* For a memory source, the blob we read from. ++ /* For a memory source, the blob we read from. + */ + VipsBlob *blob; + +@@ -185,7 +185,6 @@ struct _VipsSource { + */ + void *mmap_baseaddr; + size_t mmap_length; +- + }; + + typedef struct _VipsSourceClass { +@@ -200,7 +199,7 @@ typedef struct _VipsSourceClass { + * We must return gint64, since ssize_t is often defined as unsigned + * on Windows. + */ +- gint64 (*read)( VipsSource *, void *, size_t ); ++ gint64 (*read)(VipsSource *, void *, size_t); + + /* Seek to a certain position, args exactly as lseek(2). Set errno on + * error. +@@ -211,68 +210,68 @@ typedef struct _VipsSourceClass { + * We have to use int64 rather than off_t, since we must work on + * Windows, where off_t can be 32-bits. + */ +- gint64 (*seek)( VipsSource *, gint64, int ); ++ gint64 (*seek)(VipsSource *, gint64, int); + + } VipsSourceClass; + + VIPS_API +-GType vips_source_get_type( void ); ++GType vips_source_get_type(void); + + VIPS_API +-VipsSource *vips_source_new_from_descriptor( int descriptor ); ++VipsSource *vips_source_new_from_descriptor(int descriptor); + VIPS_API +-VipsSource *vips_source_new_from_file( const char *filename ); ++VipsSource *vips_source_new_from_file(const char *filename); + VIPS_API +-VipsSource *vips_source_new_from_blob( VipsBlob *blob ); ++VipsSource *vips_source_new_from_blob(VipsBlob *blob); + VIPS_API +-VipsSource *vips_source_new_from_target( VipsTarget *target ); ++VipsSource *vips_source_new_from_target(VipsTarget *target); + VIPS_API +-VipsSource *vips_source_new_from_memory( const void *data, size_t size ); ++VipsSource *vips_source_new_from_memory(const void *data, size_t size); + VIPS_API +-VipsSource *vips_source_new_from_options( const char *options ); ++VipsSource *vips_source_new_from_options(const char *options); + + VIPS_API +-void vips_source_minimise( VipsSource *source ); ++void vips_source_minimise(VipsSource *source); + VIPS_API +-int vips_source_unminimise( VipsSource *source ); ++int vips_source_unminimise(VipsSource *source); + VIPS_API +-int vips_source_decode( VipsSource *source ); ++int vips_source_decode(VipsSource *source); + VIPS_API +-gint64 vips_source_read( VipsSource *source, void *data, size_t length ); ++gint64 vips_source_read(VipsSource *source, void *data, size_t length); + VIPS_API +-gboolean vips_source_is_mappable( VipsSource *source ); ++gboolean vips_source_is_mappable(VipsSource *source); + VIPS_API +-gboolean vips_source_is_file( VipsSource *source ); ++gboolean vips_source_is_file(VipsSource *source); + VIPS_API +-const void *vips_source_map( VipsSource *source, size_t *length ); ++const void *vips_source_map(VipsSource *source, size_t *length); + VIPS_API +-VipsBlob *vips_source_map_blob( VipsSource *source ); ++VipsBlob *vips_source_map_blob(VipsSource *source); + VIPS_API +-gint64 vips_source_seek( VipsSource *source, gint64 offset, int whence ); ++gint64 vips_source_seek(VipsSource *source, gint64 offset, int whence); + VIPS_API +-int vips_source_rewind( VipsSource *source ); ++int vips_source_rewind(VipsSource *source); + VIPS_API +-gint64 vips_source_sniff_at_most( VipsSource *source, +- unsigned char **data, size_t length ); ++gint64 vips_source_sniff_at_most(VipsSource *source, ++ unsigned char **data, size_t length); + VIPS_API +-unsigned char *vips_source_sniff( VipsSource *source, size_t length ); ++unsigned char *vips_source_sniff(VipsSource *source, size_t length); + VIPS_API +-gint64 vips_source_length( VipsSource *source ); ++gint64 vips_source_length(VipsSource *source); + + #define VIPS_TYPE_SOURCE_CUSTOM (vips_source_custom_get_type()) +-#define VIPS_SOURCE_CUSTOM( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_SOURCE_CUSTOM, VipsSourceCustom )) +-#define VIPS_SOURCE_CUSTOM_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_SOURCE_CUSTOM, VipsSourceCustomClass)) +-#define VIPS_IS_SOURCE_CUSTOM( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_SOURCE_CUSTOM )) +-#define VIPS_IS_SOURCE_CUSTOM_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_SOURCE_CUSTOM )) +-#define VIPS_SOURCE_CUSTOM_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_SOURCE_CUSTOM, VipsSourceCustomClass )) ++#define VIPS_SOURCE_CUSTOM(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_SOURCE_CUSTOM, VipsSourceCustom)) ++#define VIPS_SOURCE_CUSTOM_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_SOURCE_CUSTOM, VipsSourceCustomClass)) ++#define VIPS_IS_SOURCE_CUSTOM(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_SOURCE_CUSTOM)) ++#define VIPS_IS_SOURCE_CUSTOM_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_SOURCE_CUSTOM)) ++#define VIPS_SOURCE_CUSTOM_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_SOURCE_CUSTOM, VipsSourceCustomClass)) + + /* Subclass of source_custom with signals for handlers. This is supposed to be + * useful for language bindings. +@@ -289,34 +288,34 @@ typedef struct _VipsSourceCustomClass { + * We must use gint64 everywhere since there's no G_TYPE_SIZE. + */ + +- gint64 (*read)( VipsSourceCustom *, void *, gint64 ); +- gint64 (*seek)( VipsSourceCustom *, gint64, int ); ++ gint64 (*read)(VipsSourceCustom *, void *, gint64); ++ gint64 (*seek)(VipsSourceCustom *, gint64, int); + + } VipsSourceCustomClass; + + VIPS_API +-GType vips_source_custom_get_type( void ); ++GType vips_source_custom_get_type(void); + VIPS_API +-VipsSourceCustom *vips_source_custom_new( void ); ++VipsSourceCustom *vips_source_custom_new(void); + +-/* A GInputStream that wraps a VipsSource. This lets us eg. ++/* A GInputStream that wraps a VipsSource. This lets us eg. + * hook librsvg up to libvips using their GInputStream interface. + */ + + #define VIPS_TYPE_G_INPUT_STREAM (vips_g_input_stream_get_type()) +-#define VIPS_G_INPUT_STREAM( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_G_INPUT_STREAM, VipsGInputStream )) +-#define VIPS_G_INPUT_STREAM_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_G_INPUT_STREAM, VipsGInputStreamClass)) +-#define VIPS_IS_G_INPUT_STREAM( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_G_INPUT_STREAM )) +-#define VIPS_IS_G_INPUT_STREAM_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_G_INPUT_STREAM )) +-#define VIPS_G_INPUT_STREAM_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_G_INPUT_STREAM, VipsGInputStreamClass )) ++#define VIPS_G_INPUT_STREAM(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_G_INPUT_STREAM, VipsGInputStream)) ++#define VIPS_G_INPUT_STREAM_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_G_INPUT_STREAM, VipsGInputStreamClass)) ++#define VIPS_IS_G_INPUT_STREAM(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_G_INPUT_STREAM)) ++#define VIPS_IS_G_INPUT_STREAM_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_G_INPUT_STREAM)) ++#define VIPS_G_INPUT_STREAM_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_G_INPUT_STREAM, VipsGInputStreamClass)) + + typedef struct _VipsGInputStream { + GInputStream parent_instance; +@@ -335,26 +334,26 @@ typedef struct _VipsGInputStreamClass { + } VipsGInputStreamClass; + + VIPS_API +-GInputStream *vips_g_input_stream_new_from_source( VipsSource *source ); ++GInputStream *vips_g_input_stream_new_from_source(VipsSource *source); + +-/* A VipsSource that wraps a GInputStream. This lets us eg. load PNGs from ++/* A VipsSource that wraps a GInputStream. This lets us eg. load PNGs from + * GFile objects. + */ + + #define VIPS_TYPE_SOURCE_G_INPUT_STREAM (vips_source_g_input_stream_get_type()) +-#define VIPS_SOURCE_G_INPUT_STREAM( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_SOURCE_G_INPUT_STREAM, VipsSourceGInputStream )) +-#define VIPS_SOURCE_G_INPUT_STREAM_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_SOURCE_G_INPUT_STREAM, VipsSourceGInputStreamClass)) +-#define VIPS_IS_SOURCE_G_INPUT_STREAM( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_SOURCE_G_INPUT_STREAM )) +-#define VIPS_IS_SOURCE_G_INPUT_STREAM_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_SOURCE_G_INPUT_STREAM )) +-#define VIPS_SOURCE_G_INPUT_STREAM_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_SOURCE_G_INPUT_STREAM, VipsSourceGInputStreamClass )) ++#define VIPS_SOURCE_G_INPUT_STREAM(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_SOURCE_G_INPUT_STREAM, VipsSourceGInputStream)) ++#define VIPS_SOURCE_G_INPUT_STREAM_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_SOURCE_G_INPUT_STREAM, VipsSourceGInputStreamClass)) ++#define VIPS_IS_SOURCE_G_INPUT_STREAM(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_SOURCE_G_INPUT_STREAM)) ++#define VIPS_IS_SOURCE_G_INPUT_STREAM_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_SOURCE_G_INPUT_STREAM)) ++#define VIPS_SOURCE_G_INPUT_STREAM_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_SOURCE_G_INPUT_STREAM, VipsSourceGInputStreamClass)) + + typedef struct _VipsSourceGInputStream { + VipsSource parent_instance; +@@ -376,28 +375,28 @@ typedef struct _VipsSourceGInputStreamClass { + } VipsSourceGInputStreamClass; + + VIPS_API +-VipsSourceGInputStream *vips_source_g_input_stream_new( GInputStream *stream ); ++VipsSourceGInputStream *vips_source_g_input_stream_new(GInputStream *stream); + + #define VIPS_TYPE_TARGET (vips_target_get_type()) +-#define VIPS_TARGET( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_TARGET, VipsTarget )) +-#define VIPS_TARGET_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_TARGET, VipsTargetClass)) +-#define VIPS_IS_TARGET( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_TARGET )) +-#define VIPS_IS_TARGET_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_TARGET )) +-#define VIPS_TARGET_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_TARGET, VipsTargetClass )) ++#define VIPS_TARGET(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_TARGET, VipsTarget)) ++#define VIPS_TARGET_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_TARGET, VipsTargetClass)) ++#define VIPS_IS_TARGET(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_TARGET)) ++#define VIPS_IS_TARGET_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_TARGET)) ++#define VIPS_TARGET_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_TARGET, VipsTargetClass)) + + /* PNG writes in 8kb chunks, so we need to be a little larger than that. + */ + #define VIPS_TARGET_BUFFER_SIZE (8500) + +-/* Output to something like a socket, pipe or memory area. ++/* Output to something like a socket, pipe or memory area. + */ + struct _VipsTarget { + VipsConnection parent_object; +@@ -412,7 +411,7 @@ struct _VipsTarget { + */ + gboolean ended; + +- /* Write memory output here. We use a GString rather than a ++ /* Write memory output here. We use a GString rather than a + * GByteArray since we need eg. g_string_overwrite_len(). + * @position tracks the current write position in this. + */ +@@ -436,7 +435,6 @@ struct _VipsTarget { + */ + gboolean delete_on_close; + char *delete_on_close_filename; +- + }; + + typedef struct _VipsTargetClass { +@@ -447,14 +445,14 @@ typedef struct _VipsTargetClass { + * We must return gint64, since ssize_t is often defined as unsigned + * on Windows. + */ +- gint64 (*write)( VipsTarget *, const void *, size_t ); ++ gint64 (*write)(VipsTarget *, const void *, size_t); + + /* Deprecated in favour of ::end. + */ +- void (*finish)( VipsTarget * ); ++ void (*finish)(VipsTarget *); + + /* libtiff needs to be able to seek and read on targets, +- * unfortunately. ++ * unfortunately. + * + * This will not work for eg. pipes, of course. + */ +@@ -465,78 +463,75 @@ typedef struct _VipsTargetClass { + * We must return gint64, since ssize_t is often defined as unsigned + * on Windows. + */ +- gint64 (*read)( VipsTarget *, void *, size_t ); ++ gint64 (*read)(VipsTarget *, void *, size_t); + + /* Seek output. Args exactly as lseek(2). + */ +- off_t (*seek)( VipsTarget *, off_t offset, int whence); ++ off_t (*seek)(VipsTarget *, off_t offset, int whence); + + /* Output has been generated, so do any clearing up, + * eg. copy the bytes we saved in memory to the target blob. + */ +- int (*end)( VipsTarget * ); ++ int (*end)(VipsTarget *); + + } VipsTargetClass; + + VIPS_API +-GType vips_target_get_type( void ); ++GType vips_target_get_type(void); + + VIPS_API +-VipsTarget *vips_target_new_to_descriptor( int descriptor ); ++VipsTarget *vips_target_new_to_descriptor(int descriptor); + VIPS_API +-VipsTarget *vips_target_new_to_file( const char *filename ); ++VipsTarget *vips_target_new_to_file(const char *filename); + VIPS_API +-VipsTarget *vips_target_new_to_memory( void ); ++VipsTarget *vips_target_new_to_memory(void); + VIPS_API +-VipsTarget *vips_target_new_temp( VipsTarget *target ); ++VipsTarget *vips_target_new_temp(VipsTarget *target); + VIPS_API +-int vips_target_write( VipsTarget *target, const void *data, size_t length ); ++int vips_target_write(VipsTarget *target, const void *data, size_t length); + VIPS_API +-gint64 vips_target_read( VipsTarget *target, void *buffer, size_t length ); ++gint64 vips_target_read(VipsTarget *target, void *buffer, size_t length); + VIPS_API +-off_t vips_target_seek( VipsTarget *target, off_t offset, int whence ); ++off_t vips_target_seek(VipsTarget *target, off_t offset, int whence); + VIPS_API +-int vips_target_end( VipsTarget *target ); ++int vips_target_end(VipsTarget *target); + VIPS_DEPRECATED_FOR(vips_target_end) +-void vips_target_finish( VipsTarget *target ); ++void vips_target_finish(VipsTarget *target); + VIPS_API +-unsigned char *vips_target_steal( VipsTarget *target, size_t *length ); ++unsigned char *vips_target_steal(VipsTarget *target, size_t *length); + VIPS_API +-char *vips_target_steal_text( VipsTarget *target ); ++char *vips_target_steal_text(VipsTarget *target); + + VIPS_API +-int vips_target_putc( VipsTarget *target, int ch ); +-#define VIPS_TARGET_PUTC( S, C ) ( \ +- (S)->write_point < VIPS_TARGET_BUFFER_SIZE ? \ +- ((S)->output_buffer[(S)->write_point++] = (C), 0) : \ +- vips_target_putc( (S), (C) ) \ +-) ++int vips_target_putc(VipsTarget *target, int ch); ++#define VIPS_TARGET_PUTC(S, C) ( \ ++ (S)->write_point < VIPS_TARGET_BUFFER_SIZE ? ((S)->output_buffer[(S)->write_point++] = (C), 0) : vips_target_putc((S), (C))) + VIPS_API +-int vips_target_writes( VipsTarget *target, const char *str ); ++int vips_target_writes(VipsTarget *target, const char *str); + VIPS_API +-int vips_target_writef( VipsTarget *target, const char *fmt, ... ) +- G_GNUC_PRINTF( 2, 3 ); ++int vips_target_writef(VipsTarget *target, const char *fmt, ...) ++ G_GNUC_PRINTF(2, 3); + VIPS_API +-int vips_target_write_amp( VipsTarget *target, const char *str ); ++int vips_target_write_amp(VipsTarget *target, const char *str); + + #define VIPS_TYPE_TARGET_CUSTOM (vips_target_custom_get_type()) +-#define VIPS_TARGET_CUSTOM( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_TARGET_CUSTOM, VipsTargetCustom )) +-#define VIPS_TARGET_CUSTOM_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_TARGET_CUSTOM, VipsTargetCustomClass)) +-#define VIPS_IS_TARGET_CUSTOM( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_TARGET_CUSTOM )) +-#define VIPS_IS_TARGET_CUSTOM_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_TARGET_CUSTOM )) +-#define VIPS_TARGET_CUSTOM_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_TARGET_CUSTOM, VipsTargetCustomClass )) ++#define VIPS_TARGET_CUSTOM(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_TARGET_CUSTOM, VipsTargetCustom)) ++#define VIPS_TARGET_CUSTOM_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_TARGET_CUSTOM, VipsTargetCustomClass)) ++#define VIPS_IS_TARGET_CUSTOM(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_TARGET_CUSTOM)) ++#define VIPS_IS_TARGET_CUSTOM_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_TARGET_CUSTOM)) ++#define VIPS_TARGET_CUSTOM_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_TARGET_CUSTOM, VipsTargetCustomClass)) + + #define VIPS_TARGET_CUSTOM_BUFFER_SIZE (4096) + +-/* Output to something like a socket, pipe or memory area. ++/* Output to something like a socket, pipe or memory area. + */ + typedef struct _VipsTargetCustom { + VipsTarget parent_object; +@@ -550,18 +545,18 @@ typedef struct _VipsTargetCustomClass { + * We must use gint64 everywhere since there's no G_TYPE_SIZE. + */ + +- gint64 (*write)( VipsTargetCustom *, const void *, gint64 ); +- void (*finish)( VipsTargetCustom * ); +- gint64 (*read)( VipsTargetCustom *, void *, gint64 ); +- gint64 (*seek)( VipsTargetCustom *, gint64, int ); +- int (*end)( VipsTargetCustom * ); ++ gint64 (*write)(VipsTargetCustom *, const void *, gint64); ++ void (*finish)(VipsTargetCustom *); ++ gint64 (*read)(VipsTargetCustom *, void *, gint64); ++ gint64 (*seek)(VipsTargetCustom *, gint64, int); ++ int (*end)(VipsTargetCustom *); + + } VipsTargetCustomClass; + + VIPS_API +-GType vips_target_custom_get_type( void ); ++GType vips_target_custom_get_type(void); + VIPS_API +-VipsTargetCustom *vips_target_custom_new( void ); ++VipsTargetCustom *vips_target_custom_new(void); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/conversion.h b/libvips/include/vips/conversion.h +index b3dd66aae6..0e164bcf37 100644 +--- a/libvips/include/vips/conversion.h ++++ b/libvips/include/vips/conversion.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -135,219 +135,219 @@ typedef enum { + } VipsBlendMode; + + VIPS_API +-int vips_copy( VipsImage *in, VipsImage **out, ... ) ++int vips_copy(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_tilecache( VipsImage *in, VipsImage **out, ... ) ++int vips_tilecache(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_linecache( VipsImage *in, VipsImage **out, ... ) ++int vips_linecache(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_sequential( VipsImage *in, VipsImage **out, ... ) ++int vips_sequential(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_cache( VipsImage *in, VipsImage **out, ... ) ++int vips_cache(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_copy_file( VipsImage *in, VipsImage **out, ... ) ++int vips_copy_file(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_embed( VipsImage *in, VipsImage **out, +- int x, int y, int width, int height, ... ) ++int vips_embed(VipsImage *in, VipsImage **out, ++ int x, int y, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_gravity( VipsImage *in, VipsImage **out, +- VipsCompassDirection direction, int width, int height, ... ) ++int vips_gravity(VipsImage *in, VipsImage **out, ++ VipsCompassDirection direction, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_flip( VipsImage *in, VipsImage **out, VipsDirection direction, ... ) ++int vips_flip(VipsImage *in, VipsImage **out, VipsDirection direction, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_insert( VipsImage *main, VipsImage *sub, VipsImage **out, +- int x, int y, ... ) ++int vips_insert(VipsImage *main, VipsImage *sub, VipsImage **out, ++ int x, int y, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_join( VipsImage *in1, VipsImage *in2, VipsImage **out, +- VipsDirection direction, ... ) ++int vips_join(VipsImage *in1, VipsImage *in2, VipsImage **out, ++ VipsDirection direction, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_arrayjoin( VipsImage **in, VipsImage **out, int n, ... ) ++int vips_arrayjoin(VipsImage **in, VipsImage **out, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_extract_area( VipsImage *in, VipsImage **out, +- int left, int top, int width, int height, ... ) ++int vips_extract_area(VipsImage *in, VipsImage **out, ++ int left, int top, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_crop( VipsImage *in, VipsImage **out, +- int left, int top, int width, int height, ... ) ++int vips_crop(VipsImage *in, VipsImage **out, ++ int left, int top, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_smartcrop( VipsImage *in, VipsImage **out, int width, int height, ... ) ++int vips_smartcrop(VipsImage *in, VipsImage **out, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_extract_band( VipsImage *in, VipsImage **out, int band, ... ) ++int vips_extract_band(VipsImage *in, VipsImage **out, int band, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_replicate( VipsImage *in, VipsImage **out, int across, int down, ... ) ++int vips_replicate(VipsImage *in, VipsImage **out, int across, int down, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_grid( VipsImage *in, VipsImage **out, +- int tile_height, int across, int down, ... ) ++int vips_grid(VipsImage *in, VipsImage **out, ++ int tile_height, int across, int down, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_transpose3d( VipsImage *in, VipsImage **out, ... ) ++int vips_transpose3d(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_wrap( VipsImage *in, VipsImage **out, ... ) ++int vips_wrap(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_rot( VipsImage *in, VipsImage **out, VipsAngle angle, ... ) ++int vips_rot(VipsImage *in, VipsImage **out, VipsAngle angle, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_rot90( VipsImage *in, VipsImage **out, ... ) ++int vips_rot90(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_rot180( VipsImage *in, VipsImage **out, ... ) ++int vips_rot180(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_rot270( VipsImage *in, VipsImage **out, ... ) ++int vips_rot270(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_rot45( VipsImage *in, VipsImage **out, ... ) ++int vips_rot45(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-void vips_autorot_remove_angle( VipsImage *image ); ++void vips_autorot_remove_angle(VipsImage *image); + VIPS_API +-int vips_autorot( VipsImage *in, VipsImage **out, ... ) ++int vips_autorot(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_zoom( VipsImage *in, VipsImage **out, int xfac, int yfac, ... ) ++int vips_zoom(VipsImage *in, VipsImage **out, int xfac, int yfac, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_subsample( VipsImage *in, VipsImage **out, int xfac, int yfac, ... ) ++int vips_subsample(VipsImage *in, VipsImage **out, int xfac, int yfac, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_cast( VipsImage *in, VipsImage **out, VipsBandFormat format, ... ) ++int vips_cast(VipsImage *in, VipsImage **out, VipsBandFormat format, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_cast_uchar( VipsImage *in, VipsImage **out, ... ) ++int vips_cast_uchar(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_cast_char( VipsImage *in, VipsImage **out, ... ) ++int vips_cast_char(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_cast_ushort( VipsImage *in, VipsImage **out, ... ) ++int vips_cast_ushort(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_cast_short( VipsImage *in, VipsImage **out, ... ) ++int vips_cast_short(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_cast_uint( VipsImage *in, VipsImage **out, ... ) ++int vips_cast_uint(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_cast_int( VipsImage *in, VipsImage **out, ... ) ++int vips_cast_int(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_cast_float( VipsImage *in, VipsImage **out, ... ) ++int vips_cast_float(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_cast_double( VipsImage *in, VipsImage **out, ... ) ++int vips_cast_double(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_cast_complex( VipsImage *in, VipsImage **out, ... ) ++int vips_cast_complex(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_cast_dpcomplex( VipsImage *in, VipsImage **out, ... ) ++int vips_cast_dpcomplex(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_scale( VipsImage *in, VipsImage **out, ... ) ++int vips_scale(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_msb( VipsImage *in, VipsImage **out, ... ) ++int vips_msb(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_byteswap( VipsImage *in, VipsImage **out, ... ) ++int vips_byteswap(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_bandjoin( VipsImage **in, VipsImage **out, int n, ... ) ++int vips_bandjoin(VipsImage **in, VipsImage **out, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_bandjoin2( VipsImage *in1, VipsImage *in2, VipsImage **out, ... ) ++int vips_bandjoin2(VipsImage *in1, VipsImage *in2, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_bandjoin_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) ++int vips_bandjoin_const(VipsImage *in, VipsImage **out, double *c, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_bandjoin_const1( VipsImage *in, VipsImage **out, double c, ... ) ++int vips_bandjoin_const1(VipsImage *in, VipsImage **out, double c, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_bandrank( VipsImage **in, VipsImage **out, int n, ... ) ++int vips_bandrank(VipsImage **in, VipsImage **out, int n, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_bandfold( VipsImage *in, VipsImage **out, ... ) ++int vips_bandfold(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_bandunfold( VipsImage *in, VipsImage **out, ... ) ++int vips_bandunfold(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_bandbool( VipsImage *in, VipsImage **out, +- VipsOperationBoolean boolean, ... ) ++int vips_bandbool(VipsImage *in, VipsImage **out, ++ VipsOperationBoolean boolean, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_bandand( VipsImage *in, VipsImage **out, ... ) ++int vips_bandand(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_bandor( VipsImage *in, VipsImage **out, ... ) ++int vips_bandor(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_bandeor( VipsImage *in, VipsImage **out, ... ) ++int vips_bandeor(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_bandmean( VipsImage *in, VipsImage **out, ... ) ++int vips_bandmean(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_recomb( VipsImage *in, VipsImage **out, VipsImage *m, ... ) ++int vips_recomb(VipsImage *in, VipsImage **out, VipsImage *m, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_ifthenelse( VipsImage *cond, VipsImage *in1, VipsImage *in2, +- VipsImage **out, ... ) ++int vips_ifthenelse(VipsImage *cond, VipsImage *in1, VipsImage *in2, ++ VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_switch( VipsImage **tests, VipsImage **out, int n, ... ) ++int vips_switch(VipsImage **tests, VipsImage **out, int n, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_flatten( VipsImage *in, VipsImage **out, ... ) ++int vips_flatten(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_addalpha( VipsImage *in, VipsImage **out, ... ) ++int vips_addalpha(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_premultiply( VipsImage *in, VipsImage **out, ... ) ++int vips_premultiply(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_unpremultiply( VipsImage *in, VipsImage **out, ... ) ++int vips_unpremultiply(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_composite( VipsImage **in, VipsImage **out, int n, int *mode, ... ) ++int vips_composite(VipsImage **in, VipsImage **out, int n, int *mode, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_composite2( VipsImage *base, VipsImage *overlay, VipsImage **out, +- VipsBlendMode mode, ... ) ++int vips_composite2(VipsImage *base, VipsImage *overlay, VipsImage **out, ++ VipsBlendMode mode, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_falsecolour( VipsImage *in, VipsImage **out, ... ) ++int vips_falsecolour(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_gamma( VipsImage *in, VipsImage **out, ... ) ++int vips_gamma(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + #ifdef __cplusplus +diff --git a/libvips/include/vips/convolution.h b/libvips/include/vips/convolution.h +index c4fafe04ad..f0fcfa8d45 100644 +--- a/libvips/include/vips/convolution.h ++++ b/libvips/include/vips/convolution.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -46,46 +46,46 @@ typedef enum { + } VipsCombine; + + VIPS_API +-int vips_conv( VipsImage *in, VipsImage **out, VipsImage *mask, ... ) ++int vips_conv(VipsImage *in, VipsImage **out, VipsImage *mask, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_convf( VipsImage *in, VipsImage **out, VipsImage *mask, ... ) ++int vips_convf(VipsImage *in, VipsImage **out, VipsImage *mask, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_convi( VipsImage *in, VipsImage **out, VipsImage *mask, ... ) ++int vips_convi(VipsImage *in, VipsImage **out, VipsImage *mask, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_conva( VipsImage *in, VipsImage **out, VipsImage *mask, ... ) ++int vips_conva(VipsImage *in, VipsImage **out, VipsImage *mask, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_convsep( VipsImage *in, VipsImage **out, VipsImage *mask, ... ) ++int vips_convsep(VipsImage *in, VipsImage **out, VipsImage *mask, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_convasep( VipsImage *in, VipsImage **out, VipsImage *mask, ... ) ++int vips_convasep(VipsImage *in, VipsImage **out, VipsImage *mask, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_compass( VipsImage *in, VipsImage **out, VipsImage *mask, ... ) ++int vips_compass(VipsImage *in, VipsImage **out, VipsImage *mask, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_gaussblur( VipsImage *in, VipsImage **out, double sigma, ... ) ++int vips_gaussblur(VipsImage *in, VipsImage **out, double sigma, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_sharpen( VipsImage *in, VipsImage **out, ... ) ++int vips_sharpen(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_spcor( VipsImage *in, VipsImage *ref, VipsImage **out, ... ) ++int vips_spcor(VipsImage *in, VipsImage *ref, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_fastcor( VipsImage *in, VipsImage *ref, VipsImage **out, ... ) ++int vips_fastcor(VipsImage *in, VipsImage *ref, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_sobel( VipsImage *in, VipsImage **out, ... ) ++int vips_sobel(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_canny( VipsImage *in, VipsImage **out, ... ) ++int vips_canny(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + #ifdef __cplusplus +diff --git a/libvips/include/vips/create.h b/libvips/include/vips/create.h +index 8789d89340..b2b2dd6e8a 100644 +--- a/libvips/include/vips/create.h ++++ b/libvips/include/vips/create.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -47,111 +47,111 @@ typedef enum { + } VipsTextWrap; + + VIPS_API +-int vips_black( VipsImage **out, int width, int height, ... ) ++int vips_black(VipsImage **out, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_xyz( VipsImage **out, int width, int height, ... ) ++int vips_xyz(VipsImage **out, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_grey( VipsImage **out, int width, int height, ... ) ++int vips_grey(VipsImage **out, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_gaussmat( VipsImage **out, double sigma, double min_ampl, ... ) ++int vips_gaussmat(VipsImage **out, double sigma, double min_ampl, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_logmat( VipsImage **out, double sigma, double min_ampl, ... ) ++int vips_logmat(VipsImage **out, double sigma, double min_ampl, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_text( VipsImage **out, const char *text, ... ) ++int vips_text(VipsImage **out, const char *text, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_gaussnoise( VipsImage **out, int width, int height, ... ) ++int vips_gaussnoise(VipsImage **out, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_eye( VipsImage **out, int width, int height, ... ) ++int vips_eye(VipsImage **out, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_sines( VipsImage **out, int width, int height, ... ) ++int vips_sines(VipsImage **out, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_zone( VipsImage **out, int width, int height, ... ) ++int vips_zone(VipsImage **out, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_identity( VipsImage **out, ... ) ++int vips_identity(VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_buildlut( VipsImage *in, VipsImage **out, ... ) ++int vips_buildlut(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_invertlut( VipsImage *in, VipsImage **out, ... ) ++int vips_invertlut(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_tonelut( VipsImage **out, ... ) ++int vips_tonelut(VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_mask_ideal( VipsImage **out, int width, int height, +- double frequency_cutoff, ... ) ++int vips_mask_ideal(VipsImage **out, int width, int height, ++ double frequency_cutoff, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_mask_ideal_ring( VipsImage **out, int width, int height, +- double frequency_cutoff, double ringwidth, ... ) ++int vips_mask_ideal_ring(VipsImage **out, int width, int height, ++ double frequency_cutoff, double ringwidth, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_mask_ideal_band( VipsImage **out, int width, int height, +- double frequency_cutoff_x, double frequency_cutoff_y, +- double radius, ... ) ++int vips_mask_ideal_band(VipsImage **out, int width, int height, ++ double frequency_cutoff_x, double frequency_cutoff_y, ++ double radius, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_mask_butterworth( VipsImage **out, int width, int height, +- double order, +- double frequency_cutoff, double amplitude_cutoff, ... ) ++int vips_mask_butterworth(VipsImage **out, int width, int height, ++ double order, ++ double frequency_cutoff, double amplitude_cutoff, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_mask_butterworth_ring( VipsImage **out, int width, int height, +- double order, +- double frequency_cutoff, double amplitude_cutoff, +- double ringwidth, ... ) ++int vips_mask_butterworth_ring(VipsImage **out, int width, int height, ++ double order, ++ double frequency_cutoff, double amplitude_cutoff, ++ double ringwidth, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_mask_butterworth_band( VipsImage **out, int width, int height, +- double order, +- double frequency_cutoff_x, double frequency_cutoff_y, double radius, +- double amplitude_cutoff, ... ) ++int vips_mask_butterworth_band(VipsImage **out, int width, int height, ++ double order, ++ double frequency_cutoff_x, double frequency_cutoff_y, double radius, ++ double amplitude_cutoff, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_mask_gaussian( VipsImage **out, int width, int height, +- double frequency_cutoff, double amplitude_cutoff, ... ) ++int vips_mask_gaussian(VipsImage **out, int width, int height, ++ double frequency_cutoff, double amplitude_cutoff, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_mask_gaussian_ring( VipsImage **out, int width, int height, +- double frequency_cutoff, double amplitude_cutoff, +- double ringwidth, ... ) ++int vips_mask_gaussian_ring(VipsImage **out, int width, int height, ++ double frequency_cutoff, double amplitude_cutoff, ++ double ringwidth, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_mask_gaussian_band( VipsImage **out, int width, int height, +- double frequency_cutoff_x, double frequency_cutoff_y, double radius, +- double amplitude_cutoff, ... ) ++int vips_mask_gaussian_band(VipsImage **out, int width, int height, ++ double frequency_cutoff_x, double frequency_cutoff_y, double radius, ++ double amplitude_cutoff, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_mask_fractal( VipsImage **out, int width, int height, +- double fractal_dimension, ... ) ++int vips_mask_fractal(VipsImage **out, int width, int height, ++ double fractal_dimension, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_fractsurf( VipsImage **out, +- int width, int height, double fractal_dimension, ... ) ++int vips_fractsurf(VipsImage **out, ++ int width, int height, double fractal_dimension, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_worley( VipsImage **out, int width, int height, ... ) ++int vips_worley(VipsImage **out, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_perlin( VipsImage **out, int width, int height, ... ) ++int vips_perlin(VipsImage **out, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + + #ifdef __cplusplus +diff --git a/libvips/include/vips/dbuf.h b/libvips/include/vips/dbuf.h +index ce0e1c598a..9a53ce8a03 100644 +--- a/libvips/include/vips/dbuf.h ++++ b/libvips/include/vips/dbuf.h +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -59,42 +59,42 @@ typedef struct _VipsDbuf { + */ + size_t write_point; + +-} VipsDbuf; ++} VipsDbuf; + + VIPS_API +-void vips_dbuf_destroy( VipsDbuf *dbuf ); ++void vips_dbuf_destroy(VipsDbuf *dbuf); + VIPS_API +-void vips_dbuf_init( VipsDbuf *dbuf ); ++void vips_dbuf_init(VipsDbuf *dbuf); + VIPS_API +-gboolean vips_dbuf_minimum_size( VipsDbuf *dbuf, size_t size ); ++gboolean vips_dbuf_minimum_size(VipsDbuf *dbuf, size_t size); + VIPS_API +-gboolean vips_dbuf_allocate( VipsDbuf *dbuf, size_t size ); ++gboolean vips_dbuf_allocate(VipsDbuf *dbuf, size_t size); + VIPS_API +-size_t vips_dbuf_read( VipsDbuf *dbuf, unsigned char *data, size_t size ); ++size_t vips_dbuf_read(VipsDbuf *dbuf, unsigned char *data, size_t size); + VIPS_API +-unsigned char *vips_dbuf_get_write( VipsDbuf *dbuf, size_t *size ); ++unsigned char *vips_dbuf_get_write(VipsDbuf *dbuf, size_t *size); + VIPS_API +-gboolean vips_dbuf_write( VipsDbuf *dbuf, +- const unsigned char *data, size_t size ); ++gboolean vips_dbuf_write(VipsDbuf *dbuf, ++ const unsigned char *data, size_t size); + VIPS_API +-gboolean vips_dbuf_writef( VipsDbuf *dbuf, const char *fmt, ... ) +- G_GNUC_PRINTF( 2, 3 ); ++gboolean vips_dbuf_writef(VipsDbuf *dbuf, const char *fmt, ...) ++ G_GNUC_PRINTF(2, 3); + VIPS_API +-gboolean vips_dbuf_write_amp( VipsDbuf *dbuf, const char *str ); ++gboolean vips_dbuf_write_amp(VipsDbuf *dbuf, const char *str); + VIPS_API +-void vips_dbuf_reset( VipsDbuf *dbuf ); ++void vips_dbuf_reset(VipsDbuf *dbuf); + VIPS_API +-void vips_dbuf_destroy( VipsDbuf *dbuf ); ++void vips_dbuf_destroy(VipsDbuf *dbuf); + VIPS_API +-gboolean vips_dbuf_seek( VipsDbuf *dbuf, off_t offset, int whence ); ++gboolean vips_dbuf_seek(VipsDbuf *dbuf, off_t offset, int whence); + VIPS_API +-void vips_dbuf_truncate( VipsDbuf *dbuf ); ++void vips_dbuf_truncate(VipsDbuf *dbuf); + VIPS_API +-off_t vips_dbuf_tell( VipsDbuf *dbuf ); ++off_t vips_dbuf_tell(VipsDbuf *dbuf); + VIPS_API +-unsigned char *vips_dbuf_string( VipsDbuf *dbuf, size_t *size ); ++unsigned char *vips_dbuf_string(VipsDbuf *dbuf, size_t *size); + VIPS_API +-unsigned char *vips_dbuf_steal( VipsDbuf *dbuf, size_t *size ); ++unsigned char *vips_dbuf_steal(VipsDbuf *dbuf, size_t *size); + + #endif /*VIPS_DBUF_H*/ + +diff --git a/libvips/include/vips/debug.h b/libvips/include/vips/debug.h +index de2fa24583..667587d304 100644 +--- a/libvips/include/vips/debug.h ++++ b/libvips/include/vips/debug.h +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -36,35 +36,67 @@ extern "C" { + #endif /*__cplusplus*/ + + #ifdef VIPS_DEBUG +-#define VIPS_DEBUG_MSG( ... ) \ +- G_STMT_START { printf( __VA_ARGS__ ); } G_STMT_END ++#define VIPS_DEBUG_MSG(...) \ ++ G_STMT_START \ ++ { \ ++ printf(__VA_ARGS__); \ ++ } \ ++ G_STMT_END + #else +-#define VIPS_DEBUG_MSG( ... ) \ +- G_STMT_START { ; } G_STMT_END ++#define VIPS_DEBUG_MSG(...) \ ++ G_STMT_START \ ++ { \ ++ ; \ ++ } \ ++ G_STMT_END + #endif /*VIPS_DEBUG*/ + + #ifdef VIPS_DEBUG_RED +-#define VIPS_DEBUG_MSG_RED( ... ) \ +- G_STMT_START { printf( "red: " __VA_ARGS__ ); } G_STMT_END ++#define VIPS_DEBUG_MSG_RED(...) \ ++ G_STMT_START \ ++ { \ ++ printf("red: " __VA_ARGS__); \ ++ } \ ++ G_STMT_END + #else +-#define VIPS_DEBUG_MSG_RED( ... ) \ +- G_STMT_START { ; } G_STMT_END ++#define VIPS_DEBUG_MSG_RED(...) \ ++ G_STMT_START \ ++ { \ ++ ; \ ++ } \ ++ G_STMT_END + #endif /*VIPS_DEBUG_RED*/ + + #ifdef VIPS_DEBUG_AMBER +-#define VIPS_DEBUG_MSG_AMBER( ... ) \ +- G_STMT_START { printf( "amber: " __VA_ARGS__ ); } G_STMT_END ++#define VIPS_DEBUG_MSG_AMBER(...) \ ++ G_STMT_START \ ++ { \ ++ printf("amber: " __VA_ARGS__); \ ++ } \ ++ G_STMT_END + #else +-#define VIPS_DEBUG_MSG_AMBER( ... ) \ +- G_STMT_START { ; } G_STMT_END ++#define VIPS_DEBUG_MSG_AMBER(...) \ ++ G_STMT_START \ ++ { \ ++ ; \ ++ } \ ++ G_STMT_END + #endif /*VIPS_DEBUG_AMBER*/ + + #ifdef VIPS_DEBUG_GREEN +-#define VIPS_DEBUG_MSG_GREEN( ... ) \ +- G_STMT_START { printf( "green: " __VA_ARGS__ ); } G_STMT_END ++#define VIPS_DEBUG_MSG_GREEN(...) \ ++ G_STMT_START \ ++ { \ ++ printf("green: " __VA_ARGS__); \ ++ } \ ++ G_STMT_END + #else +-#define VIPS_DEBUG_MSG_GREEN( ... ) \ +- G_STMT_START { ; } G_STMT_END ++#define VIPS_DEBUG_MSG_GREEN(...) \ ++ G_STMT_START \ ++ { \ ++ ; \ ++ } \ ++ G_STMT_END + #endif /*VIPS_DEBUG_GREEN*/ + + #ifdef __cplusplus +diff --git a/libvips/include/vips/deprecated.h b/libvips/include/vips/deprecated.h +index 5f7a94cf03..e4fb038252 100644 +--- a/libvips/include/vips/deprecated.h ++++ b/libvips/include/vips/deprecated.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -50,71 +50,71 @@ extern "C" { + #endif /*G_OS_WIN32*/ + + /* Bits per Band */ +-#define BBBYTE 8 +-#define BBSHORT 16 +-#define BBINT 32 +-#define BBFLOAT 32 +-#define BBCOMPLEX 64 /* complex consisting of two floats */ +-#define BBDOUBLE 64 +-#define BBDPCOMPLEX 128 /* complex consisting of two doubles */ ++#define BBBYTE 8 ++#define BBSHORT 16 ++#define BBINT 32 ++#define BBFLOAT 32 ++#define BBCOMPLEX 64 /* complex consisting of two floats */ ++#define BBDOUBLE 64 ++#define BBDPCOMPLEX 128 /* complex consisting of two doubles */ + + /* picture Type */ +-#define MULTIBAND 0 +-#define B_W 1 +-#define LUMINACE 2 +-#define XRAY 3 +-#define IR 4 +-#define YUV 5 +-#define RED_ONLY 6 /* red channel only */ +-#define GREEN_ONLY 7 /* green channel only */ +-#define BLUE_ONLY 8 /* blue channel only */ +-#define POWER_SPECTRUM 9 +-#define HISTOGRAM 10 +-#define FOURIER 24 ++#define MULTIBAND 0 ++#define B_W 1 ++#define LUMINACE 2 ++#define XRAY 3 ++#define IR 4 ++#define YUV 5 ++#define RED_ONLY 6 /* red channel only */ ++#define GREEN_ONLY 7 /* green channel only */ ++#define BLUE_ONLY 8 /* blue channel only */ ++#define POWER_SPECTRUM 9 ++#define HISTOGRAM 10 ++#define FOURIER 24 + + /* Colour spaces. + */ +-#define LUT 11 +-#define XYZ 12 +-#define LAB 13 +-#define CMC 14 +-#define CMYK 15 +-#define LABQ 16 +-#define RGB 17 +-#define UCS 18 +-#define LCH 19 +-#define LABS 21 +-#define sRGB 22 +-#define YXY 23 +- +-/* BandFmt ++#define LUT 11 ++#define XYZ 12 ++#define LAB 13 ++#define CMC 14 ++#define CMYK 15 ++#define LABQ 16 ++#define RGB 17 ++#define UCS 18 ++#define LCH 19 ++#define LABS 21 ++#define sRGB 22 ++#define YXY 23 ++ ++/* BandFmt + */ +-#define FMTNOTSET -1 +-#define FMTUCHAR 0 /* pels interpreted as unsigned chars */ +-#define FMTCHAR 1 /* pels interpreted as signed chars */ +-#define FMTUSHORT 2 /* pels interpreted as unsigned shorts */ +-#define FMTSHORT 3 /* pels interpreted as signed shorts */ +-#define FMTUINT 4 /* pels interpreted as unsigned ints */ +-#define FMTINT 5 /* pels interpreted as signed ints */ +-#define FMTFLOAT 6 /* pels interpreted as floats */ +-#define FMTCOMPLEX 7 /* pels interpreted as complex (2 float each) */ +-#define FMTDOUBLE 8 /* pels interpreted as unsigned double */ +-#define FMTDPCOMPLEX 9 /* pels interpreted as complex (2 double each)*/ +- +-/* Coding type ++#define FMTNOTSET -1 ++#define FMTUCHAR 0 /* pels interpreted as unsigned chars */ ++#define FMTCHAR 1 /* pels interpreted as signed chars */ ++#define FMTUSHORT 2 /* pels interpreted as unsigned shorts */ ++#define FMTSHORT 3 /* pels interpreted as signed shorts */ ++#define FMTUINT 4 /* pels interpreted as unsigned ints */ ++#define FMTINT 5 /* pels interpreted as signed ints */ ++#define FMTFLOAT 6 /* pels interpreted as floats */ ++#define FMTCOMPLEX 7 /* pels interpreted as complex (2 float each) */ ++#define FMTDOUBLE 8 /* pels interpreted as unsigned double */ ++#define FMTDPCOMPLEX 9 /* pels interpreted as complex (2 double each)*/ ++ ++/* Coding type + */ +-#define NOCODING 0 +-#define COLQUANT 1 +-#define LABPACK 2 +-#define LABPACK_COMPRESSED 3 +-#define RGB_COMPRESSED 4 +-#define LUM_COMPRESSED 5 +- +-/* Compression type ++#define NOCODING 0 ++#define COLQUANT 1 ++#define LABPACK 2 ++#define LABPACK_COMPRESSED 3 ++#define RGB_COMPRESSED 4 ++#define LUM_COMPRESSED 5 ++ ++/* Compression type + */ +-#define NO_COMPRESSION 0 +-#define TCSF_COMPRESSION 1 +-#define JPEG_COMPRESSION 2 ++#define NO_COMPRESSION 0 ++#define TCSF_COMPRESSION 1 ++#define JPEG_COMPRESSION 2 + + #define esize(I) IM_IMAGE_SIZEOF_ELEMENT(I) + #define psize(I) IM_IMAGE_SIZEOF_PEL(I) +@@ -125,25 +125,25 @@ extern "C" { + #define nele(B) IM_REGION_N_ELEMENTS(B) + #define rsize(B) IM_REGION_SIZEOF_LINE(B) + +-#define addr(B,X,Y) IM_REGION_ADDR(B,X,Y) ++#define addr(B, X, Y) IM_REGION_ADDR(B, X, Y) + + #ifndef MAX +-#define MAX(A,B) IM_MAX(A, B) +-#define MIN(A,B) IM_MIN(A, B) ++#define MAX(A, B) IM_MAX(A, B) ++#define MIN(A, B) IM_MIN(A, B) + #endif /*MAX*/ + +-#define CLIP(A,V,B) IM_CLIP(A, V, B) +-#define NEW(IM,A) IM_NEW(IM,A) ++#define CLIP(A, V, B) IM_CLIP(A, V, B) ++#define NEW(IM, A) IM_NEW(IM, A) + #define NUMBER(R) IM_NUMBER(R) +-#define ARRAY(IM,N,T) IM_ARRAY(IM,N,T) ++#define ARRAY(IM, N, T) IM_ARRAY(IM, N, T) + +-#define RINT( R ) IM_RINT( R ) ++#define RINT(R) IM_RINT(R) + +-#define CLIP_UCHAR( V, SEQ ) IM_CLIP_UCHAR( V, SEQ ) +-#define CLIP_USHORT( V, SEQ ) IM_CLIP_USHORT( V, SEQ ) +-#define CLIP_CHAR( V, SEQ ) IM_CLIP_CHAR( V, SEQ ) +-#define CLIP_SHORT( V, SEQ ) IM_CLIP_SHORT( V, SEQ ) +-#define CLIP_NONE( V, SEQ ) IM_CLIP_NONE( V, SEQ ) ++#define CLIP_UCHAR(V, SEQ) IM_CLIP_UCHAR(V, SEQ) ++#define CLIP_USHORT(V, SEQ) IM_CLIP_USHORT(V, SEQ) ++#define CLIP_CHAR(V, SEQ) IM_CLIP_CHAR(V, SEQ) ++#define CLIP_SHORT(V, SEQ) IM_CLIP_SHORT(V, SEQ) ++#define CLIP_NONE(V, SEQ) IM_CLIP_NONE(V, SEQ) + + #define right(R) IM_RECT_RIGHT(R) + #define bottom(R) IM_RECT_BOTTOM(R) +diff --git a/libvips/include/vips/dispatch.h b/libvips/include/vips/dispatch.h +index ccbe533cef..5bb5393f8c 100644 +--- a/libvips/include/vips/dispatch.h ++++ b/libvips/include/vips/dispatch.h +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -45,77 +45,77 @@ extern "C" { + /* Type names. You may define your own, but if you use one of these, then + * you should use the built-in VIPS type converters. + */ +-#define IM_TYPE_IMAGEVEC "imagevec" /* im_object is ptr to IMAGE[] */ +-#define IM_TYPE_DOUBLEVEC "doublevec" /* im_object is ptr to double[] */ +-#define IM_TYPE_INTVEC "intvec" /* im_object is ptr to int[] */ +-#define IM_TYPE_DOUBLE "double" /* im_object is ptr to double */ +-#define IM_TYPE_INT "integer" /* 32-bit integer */ +-#define IM_TYPE_COMPLEX "complex" /* Pair of doubles */ +-#define IM_TYPE_STRING "string" /* Zero-terminated char array */ +-#define IM_TYPE_IMASK "intmask" /* Integer mask type */ +-#define IM_TYPE_DMASK "doublemask" /* Double mask type */ +-#define IM_TYPE_IMAGE "image" /* IMAGE descriptor */ +-#define IM_TYPE_DISPLAY "display" /* Display descriptor */ +-#define IM_TYPE_GVALUE "gvalue" /* GValue wrapper */ +-#define IM_TYPE_INTERPOLATE "interpolate"/* A subclass of VipsInterpolate */ +-typedef char *im_arg_type; /* Type of argument id */ ++#define IM_TYPE_IMAGEVEC "imagevec" /* im_object is ptr to IMAGE[] */ ++#define IM_TYPE_DOUBLEVEC "doublevec" /* im_object is ptr to double[] */ ++#define IM_TYPE_INTVEC "intvec" /* im_object is ptr to int[] */ ++#define IM_TYPE_DOUBLE "double" /* im_object is ptr to double */ ++#define IM_TYPE_INT "integer" /* 32-bit integer */ ++#define IM_TYPE_COMPLEX "complex" /* Pair of doubles */ ++#define IM_TYPE_STRING "string" /* Zero-terminated char array */ ++#define IM_TYPE_IMASK "intmask" /* Integer mask type */ ++#define IM_TYPE_DMASK "doublemask" /* Double mask type */ ++#define IM_TYPE_IMAGE "image" /* IMAGE descriptor */ ++#define IM_TYPE_DISPLAY "display" /* Display descriptor */ ++#define IM_TYPE_GVALUE "gvalue" /* GValue wrapper */ ++#define IM_TYPE_INTERPOLATE "interpolate" /* A subclass of VipsInterpolate */ ++typedef char *im_arg_type; /* Type of argument id */ + + /* Internal representation of an argument to an image processing function. +- */ ++ */ + typedef void *im_object; + + /* These bits are ored together to make the flags in a type descriptor. + * +- * IM_TYPE_OUTPUT: set to indicate output, otherwise input. If the IM_TYPE_RW +- * bit is set and IM_TYPE_OUTPUT is not set, both input and output (ie. the ++ * IM_TYPE_OUTPUT: set to indicate output, otherwise input. If the IM_TYPE_RW ++ * bit is set and IM_TYPE_OUTPUT is not set, both input and output (ie. the + * operation side-effects this argument). + * +- * IM_TYPE_ARG: Two ways of making an im_object --- with and without a +- * command-line string to help you along. Arguments with a string are thing +- * like IMAGE descriptors, which require a filename to initialise. +- * Arguments without are things like output numbers, where making the object ++ * IM_TYPE_ARG: Two ways of making an im_object --- with and without a ++ * command-line string to help you along. Arguments with a string are thing ++ * like IMAGE descriptors, which require a filename to initialise. ++ * Arguments without are things like output numbers, where making the object + * simply involves allocating storage. + */ + typedef enum { +- IM_TYPE_NONE = 0, /* No flags */ +- IM_TYPE_OUTPUT = 0x1, /* Output/input object */ +- IM_TYPE_ARG = 0x2, /* Uses a str arg in construction */ +- IM_TYPE_RW = 0x4 /* Read-write */ ++ IM_TYPE_NONE = 0, /* No flags */ ++ IM_TYPE_OUTPUT = 0x1, /* Output/input object */ ++ IM_TYPE_ARG = 0x2, /* Uses a str arg in construction */ ++ IM_TYPE_RW = 0x4 /* Read-write */ + } im_type_flags; + + /* Initialise, destroy and write objects. The "str" argument to the + * init function will not be supplied if this is not an ARG type. The + * write function writes to the GString. + */ +-typedef int (*im_init_obj_fn)( im_object *obj, char *str ); +-typedef int (*im_dest_obj_fn)( im_object obj ); ++typedef int (*im_init_obj_fn)(im_object *obj, char *str); ++typedef int (*im_dest_obj_fn)(im_object obj); + + /* Describe a VIPS type. + */ + typedef struct { +- im_arg_type type; /* Type of argument */ +- int size; /* sizeof( im_object repres. ) */ +- im_type_flags flags; /* Flags */ +- im_init_obj_fn init; /* Operation functions */ +- im_dest_obj_fn dest; /* Destroy object */ ++ im_arg_type type; /* Type of argument */ ++ int size; /* sizeof( im_object repres. ) */ ++ im_type_flags flags; /* Flags */ ++ im_init_obj_fn init; /* Operation functions */ ++ im_dest_obj_fn dest; /* Destroy object */ + } im_type_desc; + +-/* Success on an argument. This is called if the image processing function ++/* Success on an argument. This is called if the image processing function + * succeeds and should be used to (for example) print output. + */ +-typedef int (*im_print_obj_fn)( im_object obj ); ++typedef int (*im_print_obj_fn)(im_object obj); + + /* Describe a VIPS command argument. + */ + typedef struct { +- char *name; /* eg. "width" */ +- im_type_desc *desc; /* Type description */ +- im_print_obj_fn print; /* Print some output objects */ ++ char *name; /* eg. "width" */ ++ im_type_desc *desc; /* Type description */ ++ im_print_obj_fn print; /* Print some output objects */ + } im_arg_desc; + + /* Type of VIPS dispatch funtion. + */ +-typedef int (*im_dispatch_fn)( im_object *argv ); ++typedef int (*im_dispatch_fn)(im_object *argv); + + /* Maximum size of arg table. + */ +@@ -125,30 +125,30 @@ typedef int (*im_dispatch_fn)( im_object *argv ); + * added. + */ + typedef enum { +- IM_FN_NONE = 0, /* No flags set */ +- IM_FN_PIO = 0x1, /* Is a partial function */ +- IM_FN_TRANSFORM = 0x2, /* Performs coordinate transformations */ +- IM_FN_PTOP = 0x4, /* Point-to-point ... can be done with a LUT */ +- IM_FN_NOCACHE = 0x8 /* Result should not be cached */ ++ IM_FN_NONE = 0, /* No flags set */ ++ IM_FN_PIO = 0x1, /* Is a partial function */ ++ IM_FN_TRANSFORM = 0x2, /* Performs coordinate transformations */ ++ IM_FN_PTOP = 0x4, /* Point-to-point ... can be done with a LUT */ ++ IM_FN_NOCACHE = 0x8 /* Result should not be cached */ + } im_fn_flags; + + /* Describe a VIPS function. + */ + typedef struct { +- char *name; /* eg "im_invert" */ +- char *desc; /* Description - eg "photographic negative" */ +- im_fn_flags flags; /* Flags for this function */ +- im_dispatch_fn disp; /* Dispatch */ +- int argc; /* Number of args */ +- im_arg_desc *argv; /* Arg table */ ++ char *name; /* eg "im_invert" */ ++ char *desc; /* Description - eg "photographic negative" */ ++ im_fn_flags flags; /* Flags for this function */ ++ im_dispatch_fn disp; /* Dispatch */ ++ int argc; /* Number of args */ ++ im_arg_desc *argv; /* Arg table */ + } im_function; + + /* A set of VIPS functions forming a package. + */ + typedef struct { +- char *name; /* Package name (eg "arithmetic") */ +- int nfuncs; /* Number of functions in package */ +- im_function **table; /* Array of function descriptors */ ++ char *name; /* Package name (eg "arithmetic") */ ++ int nfuncs; /* Number of functions in package */ ++ im_function **table; /* Array of function descriptors */ + } im_package; + + /* Externs for dispatch. +@@ -157,29 +157,29 @@ typedef struct { + /* Struct for mask IO to a file. + */ + typedef struct { +- char *name; /* Command-line name in */ +- void *mask; /* Mask --- DOUBLE or INT */ ++ char *name; /* Command-line name in */ ++ void *mask; /* Mask --- DOUBLE or INT */ + } im_mask_object; + + /* Struct for doublevec IO + */ + typedef struct { +- int n; /* Vector length */ +- double *vec; /* Vector */ ++ int n; /* Vector length */ ++ double *vec; /* Vector */ + } im_doublevec_object; + + /* Struct for intvec IO + */ + typedef struct { +- int n; /* Vector length */ +- int *vec; /* Vector */ ++ int n; /* Vector length */ ++ int *vec; /* Vector */ + } im_intvec_object; + + /* Struct for imagevec IO + */ + typedef struct { +- int n; /* Vector length */ +- IMAGE **vec; /* Vector */ ++ int n; /* Vector length */ ++ IMAGE **vec; /* Vector */ + } im_imagevec_object; + + /* Built-in VIPS types. +@@ -219,92 +219,167 @@ extern im_type_desc im__input_interpolate; + + /* VIPS print functions. + */ +-int im__iprint( im_object obj ); /* int */ +-int im__ivprint( im_object obj ); /* intvec */ +-int im__dprint( im_object obj ); /* double */ +-int im__dvprint( im_object obj ); /* doublevec */ +-int im__dmsprint( im_object obj ); /* DOUBLEMASK as stats */ +-int im__cprint( im_object obj ); /* complex */ +-int im__sprint( im_object obj ); /* string */ +-int im__displayprint( im_object obj ); /* im_col_display */ +-int im__gprint( im_object obj ); /* GValue */ ++int im__iprint(im_object obj); /* int */ ++int im__ivprint(im_object obj); /* intvec */ ++int im__dprint(im_object obj); /* double */ ++int im__dvprint(im_object obj); /* doublevec */ ++int im__dmsprint(im_object obj); /* DOUBLEMASK as stats */ ++int im__cprint(im_object obj); /* complex */ ++int im__sprint(im_object obj); /* string */ ++int im__displayprint(im_object obj); /* im_col_display */ ++int im__gprint(im_object obj); /* GValue */ + + /* Macros for convenient creation. + */ +-#define IM_INPUT_INT( S ) { S, &im__input_int, NULL } +-#define IM_INPUT_INTVEC( S ) { S, &im__input_intvec, NULL } +-#define IM_INPUT_IMASK( S ) { S, &im__input_imask, NULL } +-#define IM_OUTPUT_INT( S ) { S, &im__output_int, im__iprint } +-#define IM_OUTPUT_INTVEC( S ) { S, &im__output_intvec, im__ivprint } +-#define IM_OUTPUT_IMASK( S ) { S, &im__output_imask, NULL } +- +-#define IM_INPUT_DOUBLE( S ) { S, &im__input_double, NULL } +-#define IM_INPUT_DOUBLEVEC( S ) { S, &im__input_doublevec, NULL } +-#define IM_INPUT_DMASK( S ) { S, &im__input_dmask, NULL } +-#define IM_OUTPUT_DOUBLE( S ) { S, &im__output_double, im__dprint } +-#define IM_OUTPUT_DOUBLEVEC( S ) { S, &im__output_doublevec, im__dvprint } +-#define IM_OUTPUT_DMASK( S ) { S, &im__output_dmask, NULL } +-#define IM_OUTPUT_DMASK_STATS( S ) { S, &im__output_dmask_screen, im__dmsprint } +- +-#define IM_OUTPUT_COMPLEX( S ) { S, &im__output_complex, im__cprint } +- +-#define IM_INPUT_STRING( S ) { S, &im__input_string, NULL } +-#define IM_OUTPUT_STRING( S ) { S, &im__output_string, im__sprint } +- +-#define IM_INPUT_IMAGE( S ) { S, &im__input_image, NULL } +-#define IM_INPUT_IMAGEVEC( S ) { S, &im__input_imagevec, NULL } +-#define IM_OUTPUT_IMAGE( S ) { S, &im__output_image, NULL } +-#define IM_RW_IMAGE( S ) { S, &im__rw_image, NULL } +- +-#define IM_INPUT_DISPLAY( S ) { S, &im__input_display, NULL } +-#define IM_OUTPUT_DISPLAY( S ) { S, &im__output_display, im__displayprint } +- +-#define IM_INPUT_GVALUE( S ) { S, &im__input_gvalue, NULL } +-#define IM_OUTPUT_GVALUE( S ) { S, &im__output_gvalue, im__gprint } +- +-#define IM_INPUT_INTERPOLATE( S ) { S, &im__input_interpolate, NULL } ++#define IM_INPUT_INT(S) \ ++ { \ ++ S, &im__input_int, NULL \ ++ } ++#define IM_INPUT_INTVEC(S) \ ++ { \ ++ S, &im__input_intvec, NULL \ ++ } ++#define IM_INPUT_IMASK(S) \ ++ { \ ++ S, &im__input_imask, NULL \ ++ } ++#define IM_OUTPUT_INT(S) \ ++ { \ ++ S, &im__output_int, im__iprint \ ++ } ++#define IM_OUTPUT_INTVEC(S) \ ++ { \ ++ S, &im__output_intvec, im__ivprint \ ++ } ++#define IM_OUTPUT_IMASK(S) \ ++ { \ ++ S, &im__output_imask, NULL \ ++ } ++ ++#define IM_INPUT_DOUBLE(S) \ ++ { \ ++ S, &im__input_double, NULL \ ++ } ++#define IM_INPUT_DOUBLEVEC(S) \ ++ { \ ++ S, &im__input_doublevec, NULL \ ++ } ++#define IM_INPUT_DMASK(S) \ ++ { \ ++ S, &im__input_dmask, NULL \ ++ } ++#define IM_OUTPUT_DOUBLE(S) \ ++ { \ ++ S, &im__output_double, im__dprint \ ++ } ++#define IM_OUTPUT_DOUBLEVEC(S) \ ++ { \ ++ S, &im__output_doublevec, im__dvprint \ ++ } ++#define IM_OUTPUT_DMASK(S) \ ++ { \ ++ S, &im__output_dmask, NULL \ ++ } ++#define IM_OUTPUT_DMASK_STATS(S) \ ++ { \ ++ S, &im__output_dmask_screen, im__dmsprint \ ++ } ++ ++#define IM_OUTPUT_COMPLEX(S) \ ++ { \ ++ S, &im__output_complex, im__cprint \ ++ } ++ ++#define IM_INPUT_STRING(S) \ ++ { \ ++ S, &im__input_string, NULL \ ++ } ++#define IM_OUTPUT_STRING(S) \ ++ { \ ++ S, &im__output_string, im__sprint \ ++ } ++ ++#define IM_INPUT_IMAGE(S) \ ++ { \ ++ S, &im__input_image, NULL \ ++ } ++#define IM_INPUT_IMAGEVEC(S) \ ++ { \ ++ S, &im__input_imagevec, NULL \ ++ } ++#define IM_OUTPUT_IMAGE(S) \ ++ { \ ++ S, &im__output_image, NULL \ ++ } ++#define IM_RW_IMAGE(S) \ ++ { \ ++ S, &im__rw_image, NULL \ ++ } ++ ++#define IM_INPUT_DISPLAY(S) \ ++ { \ ++ S, &im__input_display, NULL \ ++ } ++#define IM_OUTPUT_DISPLAY(S) \ ++ { \ ++ S, &im__output_display, im__displayprint \ ++ } ++ ++#define IM_INPUT_GVALUE(S) \ ++ { \ ++ S, &im__input_gvalue, NULL \ ++ } ++#define IM_OUTPUT_GVALUE(S) \ ++ { \ ++ S, &im__output_gvalue, im__gprint \ ++ } ++ ++#define IM_INPUT_INTERPOLATE(S) \ ++ { \ ++ S, &im__input_interpolate, NULL \ ++ } + + /* Add a plug-in package. + */ + VIPS_DEPRECATED +-im_package *im_load_plugin( const char *name ); ++im_package *im_load_plugin(const char *name); + VIPS_DEPRECATED +-int im_load_plugins( const char *fmt, ... ) +- G_GNUC_PRINTF( 1, 2 ); ++int im_load_plugins(const char *fmt, ...) ++ G_GNUC_PRINTF(1, 2); + + /* Close all plug-ins. + */ + VIPS_DEPRECATED +-int im_close_plugins( void ); ++int im_close_plugins(void); + + /* Loop over all loaded packages. + */ + VIPS_DEPRECATED +-void *im_map_packages( VipsSListMap2Fn fn, void *a ); ++void *im_map_packages(VipsSListMap2Fn fn, void *a); + + /* Convenience functions for finding packages, functions, etc. + */ + VIPS_DEPRECATED +-im_function *im_find_function( const char *name ); ++im_function *im_find_function(const char *name); + VIPS_DEPRECATED +-im_package *im_find_package( const char *name ); ++im_package *im_find_package(const char *name); + VIPS_DEPRECATED +-im_package *im_package_of_function( const char *name ); ++im_package *im_package_of_function(const char *name); + + /* Allocate space for, and free im_object argument lists. + */ + VIPS_DEPRECATED +-int im_free_vargv( im_function *fn, im_object *vargv ); ++int im_free_vargv(im_function *fn, im_object *vargv); + VIPS_DEPRECATED +-int im_allocate_vargv( im_function *fn, im_object *vargv ); ++int im_allocate_vargv(im_function *fn, im_object *vargv); + + /* Run a VIPS command by name. + */ + VIPS_DEPRECATED +-int im_run_command( char *name, int argc, char **argv ); ++int im_run_command(char *name, int argc, char **argv); + + VIPS_DEPRECATED +-int vips__input_interpolate_init( im_object *obj, char *str ); ++int vips__input_interpolate_init(im_object *obj, char *str); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/draw.h b/libvips/include/vips/draw.h +index a9656df305..486c90f282 100644 +--- a/libvips/include/vips/draw.h ++++ b/libvips/include/vips/draw.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -46,64 +46,64 @@ typedef enum { + VIPS_COMBINE_MODE_SET, + VIPS_COMBINE_MODE_ADD, + VIPS_COMBINE_MODE_LAST +-} VipsCombineMode; ++} VipsCombineMode; + + VIPS_API +-int vips_draw_rect( VipsImage *image, +- double *ink, int n, int left, int top, int width, int height, ... ) ++int vips_draw_rect(VipsImage *image, ++ double *ink, int n, int left, int top, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_draw_rect1( VipsImage *image, +- double ink, int left, int top, int width, int height, ... ) ++int vips_draw_rect1(VipsImage *image, ++ double ink, int left, int top, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_draw_point( VipsImage *image, double *ink, int n, int x, int y, ... ) ++int vips_draw_point(VipsImage *image, double *ink, int n, int x, int y, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_draw_point1( VipsImage *image, double ink, int x, int y, ... ) ++int vips_draw_point1(VipsImage *image, double ink, int x, int y, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_draw_image( VipsImage *image, VipsImage *sub, int x, int y, ... ) ++int vips_draw_image(VipsImage *image, VipsImage *sub, int x, int y, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_draw_mask( VipsImage *image, +- double *ink, int n, VipsImage *mask, int x, int y, ... ) ++int vips_draw_mask(VipsImage *image, ++ double *ink, int n, VipsImage *mask, int x, int y, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_draw_mask1( VipsImage *image, +- double ink, VipsImage *mask, int x, int y, ... ) ++int vips_draw_mask1(VipsImage *image, ++ double ink, VipsImage *mask, int x, int y, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_draw_line( VipsImage *image, +- double *ink, int n, int x1, int y1, int x2, int y2, ... ) ++int vips_draw_line(VipsImage *image, ++ double *ink, int n, int x1, int y1, int x2, int y2, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_draw_line1( VipsImage *image, +- double ink, int x1, int y1, int x2, int y2, ... ) ++int vips_draw_line1(VipsImage *image, ++ double ink, int x1, int y1, int x2, int y2, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_draw_circle( VipsImage *image, +- double *ink, int n, int cx, int cy, int radius, ... ) ++int vips_draw_circle(VipsImage *image, ++ double *ink, int n, int cx, int cy, int radius, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_draw_circle1( VipsImage *image, +- double ink, int cx, int cy, int radius, ... ) ++int vips_draw_circle1(VipsImage *image, ++ double ink, int cx, int cy, int radius, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_draw_flood( VipsImage *image, double *ink, int n, int x, int y, ... ) ++int vips_draw_flood(VipsImage *image, double *ink, int n, int x, int y, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_draw_flood1( VipsImage *image, double ink, int x, int y, ... ) ++int vips_draw_flood1(VipsImage *image, double ink, int x, int y, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_draw_smudge( VipsImage *image, +- int left, int top, int width, int height, ... ) ++int vips_draw_smudge(VipsImage *image, ++ int left, int top, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + + #ifdef __cplusplus +diff --git a/libvips/include/vips/error.h b/libvips/include/vips/error.h +index 0262c40912..4da69857d5 100644 +--- a/libvips/include/vips/error.h ++++ b/libvips/include/vips/error.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -36,104 +36,104 @@ extern "C" { + #endif /*__cplusplus*/ + + VIPS_API +-const char *vips_error_buffer( void ); ++const char *vips_error_buffer(void); + VIPS_API +-char *vips_error_buffer_copy( void ); ++char *vips_error_buffer_copy(void); + VIPS_API +-void vips_error_clear( void ); ++void vips_error_clear(void); + + VIPS_API +-void vips_error_freeze( void ); ++void vips_error_freeze(void); + VIPS_API +-void vips_error_thaw( void ); ++void vips_error_thaw(void); + + VIPS_API +-void vips_error( const char *domain, const char *fmt, ... ) +- G_GNUC_PRINTF( 2, 3 ); ++void vips_error(const char *domain, const char *fmt, ...) ++ G_GNUC_PRINTF(2, 3); + VIPS_API +-void vips_verror( const char *domain, const char *fmt, va_list ap ); ++void vips_verror(const char *domain, const char *fmt, va_list ap); + VIPS_API +-void vips_error_system( int err, const char *domain, const char *fmt, ... ) +- G_GNUC_PRINTF( 3, 4 ); ++void vips_error_system(int err, const char *domain, const char *fmt, ...) ++ G_GNUC_PRINTF(3, 4); + VIPS_API +-void vips_verror_system( int err, const char *domain, +- const char *fmt, va_list ap ); ++void vips_verror_system(int err, const char *domain, ++ const char *fmt, va_list ap); + VIPS_API +-void vips_error_g( GError **error ); ++void vips_error_g(GError **error); + VIPS_API +-void vips_g_error( GError **error ); ++void vips_g_error(GError **error); + + VIPS_API +-void vips_error_exit( const char *fmt, ... ) +- G_GNUC_NORETURN G_GNUC_PRINTF( 1, 2 ); ++void vips_error_exit(const char *fmt, ...) ++ G_GNUC_NORETURN G_GNUC_PRINTF(1, 2); + + VIPS_API +-int vips_check_uncoded( const char *domain, VipsImage *im ); ++int vips_check_uncoded(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_coding( const char *domain, VipsImage *im, VipsCoding coding ); ++int vips_check_coding(const char *domain, VipsImage *im, VipsCoding coding); + VIPS_API +-int vips_check_coding_known( const char *domain, VipsImage *im ); ++int vips_check_coding_known(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_coding_noneorlabq( const char *domain, VipsImage *im ); ++int vips_check_coding_noneorlabq(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_coding_same( const char *domain, VipsImage *im1, VipsImage *im2 ); ++int vips_check_coding_same(const char *domain, VipsImage *im1, VipsImage *im2); + VIPS_API +-int vips_check_mono( const char *domain, VipsImage *im ); ++int vips_check_mono(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_bands( const char *domain, VipsImage *im, int bands ); ++int vips_check_bands(const char *domain, VipsImage *im, int bands); + VIPS_API +-int vips_check_bands_1or3( const char *domain, VipsImage *im ); ++int vips_check_bands_1or3(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_bands_atleast( const char *domain, VipsImage *im, int bands ); ++int vips_check_bands_atleast(const char *domain, VipsImage *im, int bands); + VIPS_API +-int vips_check_bands_1orn( const char *domain, VipsImage *im1, VipsImage *im2 ); ++int vips_check_bands_1orn(const char *domain, VipsImage *im1, VipsImage *im2); + VIPS_API +-int vips_check_bands_1orn_unary( const char *domain, VipsImage *im, int n ); ++int vips_check_bands_1orn_unary(const char *domain, VipsImage *im, int n); + VIPS_API +-int vips_check_bands_same( const char *domain, VipsImage *im1, VipsImage *im2 ); ++int vips_check_bands_same(const char *domain, VipsImage *im1, VipsImage *im2); + VIPS_API +-int vips_check_bandno( const char *domain, VipsImage *im, int bandno ); ++int vips_check_bandno(const char *domain, VipsImage *im, int bandno); + + VIPS_API +-int vips_check_int( const char *domain, VipsImage *im ); ++int vips_check_int(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_uint( const char *domain, VipsImage *im ); ++int vips_check_uint(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_uintorf( const char *domain, VipsImage *im ); ++int vips_check_uintorf(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_noncomplex( const char *domain, VipsImage *im ); ++int vips_check_noncomplex(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_complex( const char *domain, VipsImage *im ); ++int vips_check_complex(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_twocomponents( const char *domain, VipsImage *im ); ++int vips_check_twocomponents(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_format( const char *domain, VipsImage *im, VipsBandFormat fmt ); ++int vips_check_format(const char *domain, VipsImage *im, VipsBandFormat fmt); + VIPS_API +-int vips_check_u8or16( const char *domain, VipsImage *im ); ++int vips_check_u8or16(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_8or16( const char *domain, VipsImage *im ); ++int vips_check_8or16(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_u8or16orf( const char *domain, VipsImage *im ); ++int vips_check_u8or16orf(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_format_same( const char *domain, VipsImage *im1, VipsImage *im2 ); ++int vips_check_format_same(const char *domain, VipsImage *im1, VipsImage *im2); + VIPS_API +-int vips_check_size_same( const char *domain, VipsImage *im1, VipsImage *im2 ); ++int vips_check_size_same(const char *domain, VipsImage *im1, VipsImage *im2); + VIPS_API +-int vips_check_oddsquare( const char *domain, VipsImage *im ); ++int vips_check_oddsquare(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_vector_length( const char *domain, int n, int len ); ++int vips_check_vector_length(const char *domain, int n, int len); + VIPS_API +-int vips_check_vector( const char *domain, int n, VipsImage *im ); ++int vips_check_vector(const char *domain, int n, VipsImage *im); + VIPS_API +-int vips_check_hist( const char *domain, VipsImage *im ); ++int vips_check_hist(const char *domain, VipsImage *im); + VIPS_API +-int vips_check_matrix( const char *domain, VipsImage *im, VipsImage **out ); ++int vips_check_matrix(const char *domain, VipsImage *im, VipsImage **out); + VIPS_API +-int vips_check_separable( const char *domain, VipsImage *im ); ++int vips_check_separable(const char *domain, VipsImage *im); + + VIPS_API +-int vips_check_precision_intfloat( const char *domain, +- VipsPrecision precision ); ++int vips_check_precision_intfloat(const char *domain, ++ VipsPrecision precision); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/foreign.h b/libvips/include/vips/foreign.h +index 75dd06aef5..44ebf3c442 100644 +--- a/libvips/include/vips/foreign.h ++++ b/libvips/include/vips/foreign.h +@@ -4,28 +4,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -42,19 +42,19 @@ extern "C" { + #endif /*__cplusplus*/ + + #define VIPS_TYPE_FOREIGN (vips_foreign_get_type()) +-#define VIPS_FOREIGN( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_FOREIGN, VipsForeign )) +-#define VIPS_FOREIGN_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_FOREIGN, VipsForeignClass)) +-#define VIPS_IS_FOREIGN( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_FOREIGN )) +-#define VIPS_IS_FOREIGN_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_FOREIGN )) +-#define VIPS_FOREIGN_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_FOREIGN, VipsForeignClass )) ++#define VIPS_FOREIGN(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_FOREIGN, VipsForeign)) ++#define VIPS_FOREIGN_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_FOREIGN, VipsForeignClass)) ++#define VIPS_IS_FOREIGN(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_FOREIGN)) ++#define VIPS_IS_FOREIGN_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_FOREIGN)) ++#define VIPS_FOREIGN_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_FOREIGN, VipsForeignClass)) + + typedef struct _VipsForeign { + VipsOperation parent_object; +@@ -91,32 +91,32 @@ GType vips_foreign_get_type(void); + * subclasses of VipsForeign. + */ + VIPS_API +-void *vips_foreign_map( const char *base, +- VipsSListMap2Fn fn, void *a, void *b ); ++void *vips_foreign_map(const char *base, ++ VipsSListMap2Fn fn, void *a, void *b); + +-/* Image file load properties. ++/* Image file load properties. + * + * Keep in sync with the deprecated VipsFormatFlags, we need to be able to + * cast between them. + */ + typedef enum /*< flags >*/ { +- VIPS_FOREIGN_NONE = 0, /* No flags set */ +- VIPS_FOREIGN_PARTIAL = 1, /* Lazy read OK (eg. tiled tiff) */ +- VIPS_FOREIGN_BIGENDIAN = 2, /* Most-significant byte first */ +- VIPS_FOREIGN_SEQUENTIAL = 4, /* Top-to-bottom lazy read OK */ +- VIPS_FOREIGN_ALL = 7 /* All flags set */ ++ VIPS_FOREIGN_NONE = 0, /* No flags set */ ++ VIPS_FOREIGN_PARTIAL = 1, /* Lazy read OK (eg. tiled tiff) */ ++ VIPS_FOREIGN_BIGENDIAN = 2, /* Most-significant byte first */ ++ VIPS_FOREIGN_SEQUENTIAL = 4, /* Top-to-bottom lazy read OK */ ++ VIPS_FOREIGN_ALL = 7 /* All flags set */ + } VipsForeignFlags; + +-/** ++/** + * VipsFailOn: +- * @VIPS_FAIL_ON_NONE: never stop ++ * @VIPS_FAIL_ON_NONE: never stop + * @VIPS_FAIL_ON_TRUNCATED: stop on image truncated, nothing else + * @VIPS_FAIL_ON_ERROR: stop on serious error or truncation + * @VIPS_FAIL_ON_WARNING: stop on anything, even warnings + * +- * How sensitive loaders are to errors, from never stop (very insensitive), to +- * stop on the smallest warning (very sensitive). +- * ++ * How sensitive loaders are to errors, from never stop (very insensitive), to ++ * stop on the smallest warning (very sensitive). ++ * + * Each one implies the ones before it, so #VIPS_FAIL_ON_ERROR implies + * #VIPS_FAIL_ON_TRUNCATED. + */ +@@ -129,29 +129,29 @@ typedef enum { + } VipsFailOn; + + #define VIPS_TYPE_FOREIGN_LOAD (vips_foreign_load_get_type()) +-#define VIPS_FOREIGN_LOAD( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_FOREIGN_LOAD, VipsForeignLoad )) +-#define VIPS_FOREIGN_LOAD_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_FOREIGN_LOAD, VipsForeignLoadClass)) +-#define VIPS_IS_FOREIGN_LOAD( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_FOREIGN_LOAD )) +-#define VIPS_IS_FOREIGN_LOAD_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_FOREIGN_LOAD )) +-#define VIPS_FOREIGN_LOAD_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_FOREIGN_LOAD, VipsForeignLoadClass )) ++#define VIPS_FOREIGN_LOAD(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_FOREIGN_LOAD, VipsForeignLoad)) ++#define VIPS_FOREIGN_LOAD_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_FOREIGN_LOAD, VipsForeignLoadClass)) ++#define VIPS_IS_FOREIGN_LOAD(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_FOREIGN_LOAD)) ++#define VIPS_IS_FOREIGN_LOAD_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_FOREIGN_LOAD)) ++#define VIPS_FOREIGN_LOAD_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_FOREIGN_LOAD, VipsForeignLoadClass)) + + typedef struct _VipsForeignLoad { + VipsForeign parent_object; + /*< private >*/ + +- /* Set TRUE to force open via memory. ++ /* Set TRUE to force open via memory. + */ + gboolean memory; + +- /* Type of access upstream wants and the loader must supply. ++ /* Type of access upstream wants and the loader must supply. + */ + VipsAccess access; + +@@ -198,69 +198,69 @@ typedef struct _VipsForeignLoadClass { + VipsForeignClass parent_class; + /*< public >*/ + +- /* Is a file in this format. ++ /* Is a file in this format. + * +- * This function should return %TRUE if the file contains an image of ++ * This function should return %TRUE if the file contains an image of + * this type. If you don't define this function, #VipsForeignLoad + * will use @suffs instead. + */ +- gboolean (*is_a)( const char *filename ); ++ gboolean (*is_a)(const char *filename); + +- /* Is a buffer in this format. ++ /* Is a buffer in this format. + * +- * This function should return %TRUE if the buffer contains an image of +- * this type. ++ * This function should return %TRUE if the buffer contains an image of ++ * this type. + */ +- gboolean (*is_a_buffer)( const void *data, size_t size ); ++ gboolean (*is_a_buffer)(const void *data, size_t size); + +- /* Is a stream in this format. ++ /* Is a stream in this format. + * +- * This function should return %TRUE if the stream contains an image of +- * this type. ++ * This function should return %TRUE if the stream contains an image of ++ * this type. + */ +- gboolean (*is_a_source)( VipsSource *source ); ++ gboolean (*is_a_source)(VipsSource *source); + +- /* Get the flags from a filename. ++ /* Get the flags from a filename. + * + * This function should examine the file and return a set +- * of flags. If you don't define it, vips will default to 0 (no flags +- * set). ++ * of flags. If you don't define it, vips will default to 0 (no flags ++ * set). + * + * This method is necessary for vips7 compatibility. Don't define + * it if you don't need vips7. + */ +- VipsForeignFlags (*get_flags_filename)( const char *filename ); ++ VipsForeignFlags (*get_flags_filename)(const char *filename); + +- /* Get the flags for this load operation. Images can be loaded from ++ /* Get the flags for this load operation. Images can be loaded from + * (for example) memory areas rather than files, so you can't just use + * @get_flags_filename(). + */ +- VipsForeignFlags (*get_flags)( VipsForeignLoad *load ); ++ VipsForeignFlags (*get_flags)(VipsForeignLoad *load); + +- /* Do the minimum read we can. ++ /* Do the minimum read we can. + * +- * Set the header fields in @out from @filename. If you can read the ++ * Set the header fields in @out from @filename. If you can read the + * whole image as well with no performance cost (as with vipsload), + * or if your loader does not support reading only the header, read + * the entire image in this method and leave @load() NULL. + * +- * @header() needs to set the dhint on the image .. otherwise you get ++ * @header() needs to set the dhint on the image .. otherwise you get + * the default SMALLTILE. + * + * Return 0 for success, -1 for error, setting vips_error(). + */ +- int (*header)( VipsForeignLoad *load ); ++ int (*header)(VipsForeignLoad *load); + +- /* Read the whole image into @real. The pixels will get copied to @out ++ /* Read the whole image into @real. The pixels will get copied to @out + * later. + * +- * You can omit this method if you define a @header() method which +- * loads the whole file. ++ * You can omit this method if you define a @header() method which ++ * loads the whole file. + * + * Return 0 for success, -1 for error, setting + * vips_error(). + */ +- int (*load)( VipsForeignLoad *load ); ++ int (*load)(VipsForeignLoad *load); + } VipsForeignLoadClass; + + /* Don't put spaces around void here, it breaks gtk-doc. +@@ -269,45 +269,45 @@ VIPS_API + GType vips_foreign_load_get_type(void); + + VIPS_API +-const char *vips_foreign_find_load( const char *filename ); ++const char *vips_foreign_find_load(const char *filename); + VIPS_API +-const char *vips_foreign_find_load_buffer( const void *data, size_t size ); ++const char *vips_foreign_find_load_buffer(const void *data, size_t size); + VIPS_API +-const char *vips_foreign_find_load_source( VipsSource *source ); ++const char *vips_foreign_find_load_source(VipsSource *source); + + VIPS_API +-VipsForeignFlags vips_foreign_flags( const char *loader, const char *filename ); ++VipsForeignFlags vips_foreign_flags(const char *loader, const char *filename); + VIPS_API +-gboolean vips_foreign_is_a( const char *loader, const char *filename ); ++gboolean vips_foreign_is_a(const char *loader, const char *filename); + VIPS_API +-gboolean vips_foreign_is_a_buffer( const char *loader, +- const void *data, size_t size ); ++gboolean vips_foreign_is_a_buffer(const char *loader, ++ const void *data, size_t size); + VIPS_API +-gboolean vips_foreign_is_a_source( const char *loader, +- VipsSource *source ); ++gboolean vips_foreign_is_a_source(const char *loader, ++ VipsSource *source); + + VIPS_API +-void vips_foreign_load_invalidate( VipsImage *image ); ++void vips_foreign_load_invalidate(VipsImage *image); + + #define VIPS_TYPE_FOREIGN_SAVE (vips_foreign_save_get_type()) +-#define VIPS_FOREIGN_SAVE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_FOREIGN_SAVE, VipsForeignSave )) +-#define VIPS_FOREIGN_SAVE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_FOREIGN_SAVE, VipsForeignSaveClass)) +-#define VIPS_IS_FOREIGN_SAVE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_FOREIGN_SAVE )) +-#define VIPS_IS_FOREIGN_SAVE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_FOREIGN_SAVE )) +-#define VIPS_FOREIGN_SAVE_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_FOREIGN_SAVE, VipsForeignSaveClass )) +- +-/** ++#define VIPS_FOREIGN_SAVE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_FOREIGN_SAVE, VipsForeignSave)) ++#define VIPS_FOREIGN_SAVE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_FOREIGN_SAVE, VipsForeignSaveClass)) ++#define VIPS_IS_FOREIGN_SAVE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_FOREIGN_SAVE)) ++#define VIPS_IS_FOREIGN_SAVE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_FOREIGN_SAVE)) ++#define VIPS_FOREIGN_SAVE_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_FOREIGN_SAVE, VipsForeignSaveClass)) ++ ++/** + * VipsSaveable: + * @VIPS_SAVEABLE_MONO: 1 band (eg. CSV) +- * @VIPS_SAVEABLE_RGB: 1 or 3 bands (eg. PPM) ++ * @VIPS_SAVEABLE_RGB: 1 or 3 bands (eg. PPM) + * @VIPS_SAVEABLE_RGBA: 1, 2, 3 or 4 bands (eg. PNG) + * @VIPS_SAVEABLE_RGBA_ONLY: 3 or 4 bands (eg. WEBP) + * @VIPS_SAVEABLE_RGB_CMYK: 1, 3 or 4 bands (eg. JPEG) +@@ -343,7 +343,7 @@ typedef struct _VipsForeignSave { + + /*< public >*/ + +- /* The image we are to save, as supplied by our caller. ++ /* The image we are to save, as supplied by our caller. + */ + VipsImage *in; + +@@ -363,17 +363,17 @@ typedef struct _VipsForeignSaveClass { + + /* How this format treats bands. + * +- * @saveable describes the bands that your saver can handle. For +- * example, PPM images can have 1 or 3 bands (mono or RGB), so it ++ * @saveable describes the bands that your saver can handle. For ++ * example, PPM images can have 1 or 3 bands (mono or RGB), so it + * uses #VIPS_SAVEABLE_RGB. + */ + VipsSaveable saveable; + + /* How this format treats band formats. + * +- * @format_table describes the band formats that your saver can +- * handle. For each of the 10 #VipsBandFormat values, the array +- * should give the format your saver will accept. ++ * @format_table describes the band formats that your saver can ++ * handle. For each of the 10 #VipsBandFormat values, the array ++ * should give the format your saver will accept. + */ + VipsBandFormat *format_table; + +@@ -391,32 +391,32 @@ VIPS_API + GType vips_foreign_save_get_type(void); + + VIPS_API +-const char *vips_foreign_find_save( const char *filename ); ++const char *vips_foreign_find_save(const char *filename); + VIPS_API +-gchar **vips_foreign_get_suffixes( void ); ++gchar **vips_foreign_get_suffixes(void); + VIPS_API +-const char *vips_foreign_find_save_buffer( const char *suffix ); ++const char *vips_foreign_find_save_buffer(const char *suffix); + VIPS_API +-const char *vips_foreign_find_save_target( const char *suffix ); ++const char *vips_foreign_find_save_target(const char *suffix); + + VIPS_API +-int vips_vipsload( const char *filename, VipsImage **out, ... ) ++int vips_vipsload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_vipsload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_vipsload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_vipssave( VipsImage *in, const char *filename, ... ) ++int vips_vipssave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_vipssave_target( VipsImage *in, VipsTarget *target, ... ) ++int vips_vipssave_target(VipsImage *in, VipsTarget *target, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_openslideload( const char *filename, VipsImage **out, ... ) ++int vips_openslideload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_openslideload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_openslideload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + /** +@@ -452,26 +452,26 @@ typedef enum { + } VipsForeignJpegSubsample; + + VIPS_API +-int vips_jpegload( const char *filename, VipsImage **out, ... ) ++int vips_jpegload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_jpegload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++int vips_jpegload_buffer(void *buf, size_t len, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_jpegload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_jpegload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_jpegsave_target( VipsImage *in, VipsTarget *target, ... ) ++int vips_jpegsave_target(VipsImage *in, VipsTarget *target, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_jpegsave( VipsImage *in, const char *filename, ... ) ++int vips_jpegsave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_jpegsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++int vips_jpegsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_jpegsave_mime( VipsImage *in, ... ) ++int vips_jpegsave_mime(VipsImage *in, ...) + G_GNUC_NULL_TERMINATED; + + /** +@@ -496,26 +496,26 @@ typedef enum { + } VipsForeignWebpPreset; + + VIPS_API +-int vips_webpload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_webpload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_webpload( const char *filename, VipsImage **out, ... ) ++int vips_webpload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_webpload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++int vips_webpload_buffer(void *buf, size_t len, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_webpsave_target( VipsImage *in, VipsTarget *target, ... ) ++int vips_webpsave_target(VipsImage *in, VipsTarget *target, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_webpsave( VipsImage *in, const char *filename, ... ) ++int vips_webpsave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_webpsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++int vips_webpsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_webpsave_mime( VipsImage *in, ... ) ++int vips_webpsave_mime(VipsImage *in, ...) + G_GNUC_NULL_TERMINATED; + + /** +@@ -583,90 +583,90 @@ typedef enum { + } VipsForeignTiffResunit; + + VIPS_API +-int vips_tiffload( const char *filename, VipsImage **out, ... ) ++int vips_tiffload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_tiffload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++int vips_tiffload_buffer(void *buf, size_t len, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_tiffload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_tiffload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_tiffsave( VipsImage *in, const char *filename, ... ) ++int vips_tiffsave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_tiffsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++int vips_tiffsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_tiffsave_target( VipsImage *in, VipsTarget *target, ... ) ++int vips_tiffsave_target(VipsImage *in, VipsTarget *target, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_openexrload( const char *filename, VipsImage **out, ... ) ++int vips_openexrload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_fitsload( const char *filename, VipsImage **out, ... ) ++int vips_fitsload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_fitssave( VipsImage *in, const char *filename, ... ) ++int vips_fitssave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_analyzeload( const char *filename, VipsImage **out, ... ) ++int vips_analyzeload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_rawload( const char *filename, VipsImage **out, +- int width, int height, int bands, ... ) ++int vips_rawload(const char *filename, VipsImage **out, ++ int width, int height, int bands, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_rawsave( VipsImage *in, const char *filename, ... ) ++int vips_rawsave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_rawsave_fd( VipsImage *in, int fd, ... ) ++int vips_rawsave_fd(VipsImage *in, int fd, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_csvload( const char *filename, VipsImage **out, ... ) ++int vips_csvload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_csvload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_csvload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_csvsave( VipsImage *in, const char *filename, ... ) ++int vips_csvsave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_csvsave_target( VipsImage *in, VipsTarget *target, ... ) ++int vips_csvsave_target(VipsImage *in, VipsTarget *target, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_matrixload( const char *filename, VipsImage **out, ... ) ++int vips_matrixload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_matrixload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_matrixload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_matrixsave( VipsImage *in, const char *filename, ... ) ++int vips_matrixsave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_matrixsave_target( VipsImage *in, VipsTarget *target, ... ) ++int vips_matrixsave_target(VipsImage *in, VipsTarget *target, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_matrixprint( VipsImage *in, ... ) ++int vips_matrixprint(VipsImage *in, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_magickload( const char *filename, VipsImage **out, ... ) ++int vips_magickload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_magickload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++int vips_magickload_buffer(void *buf, size_t len, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_magicksave( VipsImage *in, const char *filename, ... ) ++int vips_magicksave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_magicksave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++int vips_magicksave_buffer(VipsImage *in, void **buf, size_t *len, ...) + G_GNUC_NULL_TERMINATED; + + /** +@@ -691,22 +691,22 @@ typedef enum /*< flags >*/ { + } VipsForeignPngFilter; + + VIPS_API +-int vips_pngload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_pngload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_pngload( const char *filename, VipsImage **out, ... ) ++int vips_pngload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_pngload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++int vips_pngload_buffer(void *buf, size_t len, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_pngsave_target( VipsImage *in, VipsTarget *target, ... ) ++int vips_pngsave_target(VipsImage *in, VipsTarget *target, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_pngsave( VipsImage *in, const char *filename, ... ) ++int vips_pngsave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_pngsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++int vips_pngsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + G_GNUC_NULL_TERMINATED; + + /** +@@ -741,149 +741,149 @@ typedef enum { + } VipsForeignPpmFormat; + + VIPS_API +-int vips_ppmload( const char *filename, VipsImage **out, ... ) ++int vips_ppmload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_ppmload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_ppmload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_ppmsave( VipsImage *in, const char *filename, ... ) ++int vips_ppmsave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_ppmsave_target( VipsImage *in, VipsTarget *target, ... ) ++int vips_ppmsave_target(VipsImage *in, VipsTarget *target, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_matload( const char *filename, VipsImage **out, ... ) ++int vips_matload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_radload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_radload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_radload( const char *filename, VipsImage **out, ... ) ++int vips_radload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_radload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++int vips_radload_buffer(void *buf, size_t len, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_radsave( VipsImage *in, const char *filename, ... ) ++int vips_radsave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_radsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++int vips_radsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_radsave_target( VipsImage *in, VipsTarget *target, ... ) ++int vips_radsave_target(VipsImage *in, VipsTarget *target, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_pdfload( const char *filename, VipsImage **out, ... ) ++int vips_pdfload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_pdfload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++int vips_pdfload_buffer(void *buf, size_t len, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_pdfload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_pdfload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_svgload( const char *filename, VipsImage **out, ... ) ++int vips_svgload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_svgload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++int vips_svgload_buffer(void *buf, size_t len, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_svgload_string( const char *str, VipsImage **out, ... ) ++int vips_svgload_string(const char *str, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_svgload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_svgload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_gifload( const char *filename, VipsImage **out, ... ) ++int vips_gifload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_gifload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++int vips_gifload_buffer(void *buf, size_t len, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_gifload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_gifload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_gifsave( VipsImage *in, const char *filename, ... ) ++int vips_gifsave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_gifsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++int vips_gifsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_gifsave_target( VipsImage *in, VipsTarget *target, ... ) ++int vips_gifsave_target(VipsImage *in, VipsTarget *target, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_heifload( const char *filename, VipsImage **out, ... ) ++int vips_heifload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_heifload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++int vips_heifload_buffer(void *buf, size_t len, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_heifload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_heifload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_heifsave( VipsImage *in, const char *filename, ... ) ++int vips_heifsave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_heifsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++int vips_heifsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_heifsave_target( VipsImage *in, VipsTarget *target, ... ) ++int vips_heifsave_target(VipsImage *in, VipsTarget *target, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_niftiload( const char *filename, VipsImage **out, ... ) ++int vips_niftiload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_niftiload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_niftiload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_niftisave( VipsImage *in, const char *filename, ... ) ++int vips_niftisave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_jp2kload( const char *filename, VipsImage **out, ... ) ++int vips_jp2kload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_jp2kload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++int vips_jp2kload_buffer(void *buf, size_t len, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_jp2kload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_jp2kload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_jp2ksave( VipsImage *in, const char *filename, ... ) ++int vips_jp2ksave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_jp2ksave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++int vips_jp2ksave_buffer(VipsImage *in, void **buf, size_t *len, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_jp2ksave_target( VipsImage *in, VipsTarget *target, ... ) ++int vips_jp2ksave_target(VipsImage *in, VipsTarget *target, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_jxlload_source( VipsSource *source, VipsImage **out, ... ) ++int vips_jxlload_source(VipsSource *source, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_jxlload_buffer( void *buf, size_t len, VipsImage **out, ... ) ++int vips_jxlload_buffer(void *buf, size_t len, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_jxlload( const char *filename, VipsImage **out, ... ) ++int vips_jxlload(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_jxlsave( VipsImage *in, const char *filename, ... ) ++int vips_jxlsave(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_jxlsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++int vips_jxlsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_jxlsave_target( VipsImage *in, VipsTarget *target, ... ) ++int vips_jxlsave_target(VipsImage *in, VipsTarget *target, ...) + G_GNUC_NULL_TERMINATED; + + /** +@@ -894,7 +894,7 @@ int vips_jxlsave_target( VipsImage *in, VipsTarget *target, ... ) + * @VIPS_FOREIGN_DZ_LAYOUT_IIIF: use IIIF v2 directory layout + * @VIPS_FOREIGN_DZ_LAYOUT_IIIF3: use IIIF v3 directory layout + * +- * What directory layout and metadata standard to use. ++ * What directory layout and metadata standard to use. + */ + typedef enum { + VIPS_FOREIGN_DZ_LAYOUT_DZ, +@@ -936,13 +936,13 @@ typedef enum { + } VipsForeignDzContainer; + + VIPS_API +-int vips_dzsave( VipsImage *in, const char *name, ... ) ++int vips_dzsave(VipsImage *in, const char *name, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_dzsave_buffer( VipsImage *in, void **buf, size_t *len, ... ) ++int vips_dzsave_buffer(VipsImage *in, void **buf, size_t *len, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_dzsave_target( VipsImage *in, VipsTarget *target, ... ) ++int vips_dzsave_target(VipsImage *in, VipsTarget *target, ...) + G_GNUC_NULL_TERMINATED; + + /** +@@ -952,7 +952,7 @@ int vips_dzsave_target( VipsImage *in, VipsTarget *target, ... ) + * @VIPS_FOREIGN_HEIF_COMPRESSION_JPEG: jpeg + * @VIPS_FOREIGN_HEIF_COMPRESSION_AV1: aom + * +- * The compression format to use inside a HEIF container. ++ * The compression format to use inside a HEIF container. + * + * This is assumed to use the same numbering as %heif_compression_format. + */ +diff --git a/libvips/include/vips/format.h b/libvips/include/vips/format.h +index 5c2d5721b3..b96c4eb9a9 100644 +--- a/libvips/include/vips/format.h ++++ b/libvips/include/vips/format.h +@@ -4,28 +4,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -37,26 +37,26 @@ extern "C" { + #endif /*__cplusplus*/ + + #define VIPS_TYPE_FORMAT (vips_format_get_type()) +-#define VIPS_FORMAT( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_FORMAT, VipsFormat )) +-#define VIPS_FORMAT_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_FORMAT, VipsFormatClass)) +-#define VIPS_IS_FORMAT( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_FORMAT )) +-#define VIPS_IS_FORMAT_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_FORMAT )) +-#define VIPS_FORMAT_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_FORMAT, VipsFormatClass )) +- +-/* Image file properties. ++#define VIPS_FORMAT(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_FORMAT, VipsFormat)) ++#define VIPS_FORMAT_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_FORMAT, VipsFormatClass)) ++#define VIPS_IS_FORMAT(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_FORMAT)) ++#define VIPS_IS_FORMAT_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_FORMAT)) ++#define VIPS_FORMAT_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_FORMAT, VipsFormatClass)) ++ ++/* Image file properties. + */ + typedef enum { +- VIPS_FORMAT_NONE = 0, /* No flags set */ +- VIPS_FORMAT_PARTIAL = 1, /* Lazy read OK (eg. tiled tiff) */ +- VIPS_FORMAT_BIGENDIAN = 2 /* Most-significant byte first */ ++ VIPS_FORMAT_NONE = 0, /* No flags set */ ++ VIPS_FORMAT_PARTIAL = 1, /* Lazy read OK (eg. tiled tiff) */ ++ VIPS_FORMAT_BIGENDIAN = 2 /* Most-significant byte first */ + } VipsFormatFlags; + + /* Don't instantiate these things, just use the class stuff. +@@ -74,23 +74,23 @@ typedef struct _VipsFormatClass { + /*< public >*/ + /* Is a file in this format. + */ +- gboolean (*is_a)( const char * ); ++ gboolean (*is_a)(const char *); + + /* Read just the header into the VipsImage. + */ +- int (*header)( const char *, VipsImage * ); ++ int (*header)(const char *, VipsImage *); + + /* Load the whole image. + */ +- int (*load)( const char *, VipsImage * ); ++ int (*load)(const char *, VipsImage *); + + /* Write the VipsImage to the file in this format. + */ +- int (*save)( VipsImage *, const char * ); ++ int (*save)(VipsImage *, const char *); + + /* Get the flags for this file in this format. + */ +- VipsFormatFlags (*get_flags)( const char * ); ++ VipsFormatFlags (*get_flags)(const char *); + + /* Loop over formats in this order, default 0. We need this because + * some formats can be read by several loaders (eg. tiff can be read +@@ -105,28 +105,28 @@ typedef struct _VipsFormatClass { + } VipsFormatClass; + + VIPS_API +-GType vips_format_get_type( void ); ++GType vips_format_get_type(void); + + /* Map over and find formats. This uses type introspection to loop over + * subclasses of VipsFormat. + */ + VIPS_API +-void *vips_format_map( VipsSListMap2Fn fn, void *a, void *b ); ++void *vips_format_map(VipsSListMap2Fn fn, void *a, void *b); + VIPS_API +-VipsFormatClass *vips_format_for_file( const char *filename ); ++VipsFormatClass *vips_format_for_file(const char *filename); + VIPS_API +-VipsFormatClass *vips_format_for_name( const char *filename ); ++VipsFormatClass *vips_format_for_name(const char *filename); + + VIPS_API +-VipsFormatFlags vips_format_get_flags( VipsFormatClass *format, +- const char *filename ); ++VipsFormatFlags vips_format_get_flags(VipsFormatClass *format, ++ const char *filename); + + /* Read/write an image convenience functions. + */ + VIPS_API +-int vips_format_read( const char *filename, VipsImage *out ); ++int vips_format_read(const char *filename, VipsImage *out); + VIPS_API +-int vips_format_write( VipsImage *in, const char *filename ); ++int vips_format_write(VipsImage *in, const char *filename); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/freqfilt.h b/libvips/include/vips/freqfilt.h +index a4c3049959..85a6d0a0c2 100644 +--- a/libvips/include/vips/freqfilt.h ++++ b/libvips/include/vips/freqfilt.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -39,22 +39,22 @@ extern "C" { + #endif /*__cplusplus*/ + + VIPS_API +-int vips_fwfft( VipsImage *in, VipsImage **out, ... ) ++int vips_fwfft(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_invfft( VipsImage *in, VipsImage **out, ... ) ++int vips_invfft(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_freqmult( VipsImage *in, VipsImage *mask, VipsImage **out, ... ) ++int vips_freqmult(VipsImage *in, VipsImage *mask, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_spectrum( VipsImage *in, VipsImage **out, ... ) ++int vips_spectrum(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_phasecor( VipsImage *in1, VipsImage *in2, VipsImage **out, ... ) ++int vips_phasecor(VipsImage *in1, VipsImage *in2, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + #ifdef __cplusplus +diff --git a/libvips/include/vips/gate.h b/libvips/include/vips/gate.h +index a349bc34b4..2b53e22b07 100644 +--- a/libvips/include/vips/gate.h ++++ b/libvips/include/vips/gate.h +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -37,43 +37,51 @@ extern "C" { + + #include + +-#define VIPS_GATE_START( NAME ) \ +-G_STMT_START { \ +- if( vips__thread_profile ) \ +- vips__thread_gate_start( NAME ); \ +-} G_STMT_END +- +-#define VIPS_GATE_STOP( NAME ) \ +-G_STMT_START { \ +- if( vips__thread_profile ) \ +- vips__thread_gate_stop( NAME ); \ +-} G_STMT_END +- +-#define VIPS_GATE_MALLOC( SIZE ) \ +-G_STMT_START { \ +- if( vips__thread_profile ) \ +- vips__thread_malloc_free( (gint64) (SIZE) ); \ +-} G_STMT_END +- +-#define VIPS_GATE_FREE( SIZE ) \ +-G_STMT_START { \ +- if( vips__thread_profile ) \ +- vips__thread_malloc_free( -((gint64) (SIZE)) ); \ +-} G_STMT_END ++#define VIPS_GATE_START(NAME) \ ++ G_STMT_START \ ++ { \ ++ if (vips__thread_profile) \ ++ vips__thread_gate_start(NAME); \ ++ } \ ++ G_STMT_END ++ ++#define VIPS_GATE_STOP(NAME) \ ++ G_STMT_START \ ++ { \ ++ if (vips__thread_profile) \ ++ vips__thread_gate_stop(NAME); \ ++ } \ ++ G_STMT_END ++ ++#define VIPS_GATE_MALLOC(SIZE) \ ++ G_STMT_START \ ++ { \ ++ if (vips__thread_profile) \ ++ vips__thread_malloc_free((gint64) (SIZE)); \ ++ } \ ++ G_STMT_END ++ ++#define VIPS_GATE_FREE(SIZE) \ ++ G_STMT_START \ ++ { \ ++ if (vips__thread_profile) \ ++ vips__thread_malloc_free(-((gint64) (SIZE))); \ ++ } \ ++ G_STMT_END + + extern gboolean vips__thread_profile; + + VIPS_API +-void vips_profile_set( gboolean profile ); ++void vips_profile_set(gboolean profile); + +-void vips__thread_profile_attach( const char *thread_name ); +-void vips__thread_profile_detach( void ); +-void vips__thread_profile_stop( void ); ++void vips__thread_profile_attach(const char *thread_name); ++void vips__thread_profile_detach(void); ++void vips__thread_profile_stop(void); + +-void vips__thread_gate_start( const char *gate_name ); +-void vips__thread_gate_stop( const char *gate_name ); ++void vips__thread_gate_start(const char *gate_name); ++void vips__thread_gate_stop(const char *gate_name); + +-void vips__thread_malloc_free( gint64 size ); ++void vips__thread_malloc_free(gint64 size); + + #endif /*VIPS_GATE_H*/ + +diff --git a/libvips/include/vips/generate.h b/libvips/include/vips/generate.h +index 8053095395..c39395c171 100644 +--- a/libvips/include/vips/generate.h ++++ b/libvips/include/vips/generate.h +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -37,52 +37,52 @@ + extern "C" { + #endif /*__cplusplus*/ + +-typedef int (*VipsRegionWrite)( VipsRegion *region, VipsRect *area, void *a ); ++typedef int (*VipsRegionWrite)(VipsRegion *region, VipsRect *area, void *a); + VIPS_API +-int vips_sink_disc( VipsImage *im, VipsRegionWrite write_fn, void *a ); ++int vips_sink_disc(VipsImage *im, VipsRegionWrite write_fn, void *a); + + VIPS_API +-int vips_sink( VipsImage *im, ++int vips_sink(VipsImage *im, + VipsStartFn start_fn, VipsGenerateFn generate_fn, VipsStopFn stop_fn, +- void *a, void *b ); ++ void *a, void *b); + VIPS_API +-int vips_sink_tile( VipsImage *im, ++int vips_sink_tile(VipsImage *im, + int tile_width, int tile_height, + VipsStartFn start_fn, VipsGenerateFn generate_fn, VipsStopFn stop_fn, +- void *a, void *b ); ++ void *a, void *b); + +-typedef void (*VipsSinkNotify)( VipsImage *im, VipsRect *rect, void *a ); ++typedef void (*VipsSinkNotify)(VipsImage *im, VipsRect *rect, void *a); + VIPS_API +-int vips_sink_screen( VipsImage *in, VipsImage *out, VipsImage *mask, ++int vips_sink_screen(VipsImage *in, VipsImage *out, VipsImage *mask, + int tile_width, int tile_height, int max_tiles, + int priority, +- VipsSinkNotify notify_fn, void *a ); ++ VipsSinkNotify notify_fn, void *a); + + VIPS_API +-int vips_sink_memory( VipsImage *im ); ++int vips_sink_memory(VipsImage *im); + + VIPS_API +-void *vips_start_one( VipsImage *out, void *a, void *b ); ++void *vips_start_one(VipsImage *out, void *a, void *b); + VIPS_API +-int vips_stop_one( void *seq, void *a, void *b ); ++int vips_stop_one(void *seq, void *a, void *b); + VIPS_API +-void *vips_start_many( VipsImage *out, void *a, void *b ); ++void *vips_start_many(VipsImage *out, void *a, void *b); + VIPS_API +-int vips_stop_many( void *seq, void *a, void *b ); ++int vips_stop_many(void *seq, void *a, void *b); + VIPS_API +-VipsImage **vips_allocate_input_array( VipsImage *out, ... ) ++VipsImage **vips_allocate_input_array(VipsImage *out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_image_generate( VipsImage *image, ++int vips_image_generate(VipsImage *image, + VipsStartFn start_fn, VipsGenerateFn generate_fn, VipsStopFn stop_fn, +- void *a, void *b ); ++ void *a, void *b); + + VIPS_API +-int vips_image_pipeline_array( VipsImage *image, +- VipsDemandStyle hint, VipsImage **in ); ++int vips_image_pipeline_array(VipsImage *image, ++ VipsDemandStyle hint, VipsImage **in); + VIPS_API +-int vips_image_pipelinev( VipsImage *image, VipsDemandStyle hint, ... ) ++int vips_image_pipelinev(VipsImage *image, VipsDemandStyle hint, ...) + G_GNUC_NULL_TERMINATED; + + #ifdef __cplusplus +diff --git a/libvips/include/vips/header.h b/libvips/include/vips/header.h +index 6e4294f286..f9c3c767fc 100644 +--- a/libvips/include/vips/header.h ++++ b/libvips/include/vips/header.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -80,7 +80,7 @@ extern "C" { + /** + * VIPS_META_IMAGEDESCRIPTION: + * +- * The IMAGEDESCRIPTION tag. Often has useful metadata. ++ * The IMAGEDESCRIPTION tag. Often has useful metadata. + */ + #define VIPS_META_IMAGEDESCRIPTION "image-description" + +@@ -105,15 +105,15 @@ extern "C" { + * + * Images loaded via vips_sequential() have this int field defined. Some + * operations (eg. vips_shrinkv()) add extra caches if they see it on their +- * input. ++ * input. + */ + #define VIPS_META_SEQUENTIAL "vips-sequential" + + /** + * VIPS_META_ORIENTATION: + * +- * The orientation tag for this image. An int from 1 - 8 using the standard +- * exif/tiff meanings. ++ * The orientation tag for this image. An int from 1 - 8 using the standard ++ * exif/tiff meanings. + * + * * 1 - The 0th row represents the visual top of the image, and the 0th column + * represents the visual left-hand side. +@@ -130,7 +130,7 @@ extern "C" { + * * 7 - The 0th row represents the visual right-hand side of the image, and the + * 0th column represents the visual bottom. + * * 8 - The 0th row represents the visual left-hand side of the image, and the +- * 0th column represents the visual bottom. ++ * 0th column represents the visual bottom. + */ + #define VIPS_META_ORIENTATION "orientation" + +@@ -139,14 +139,14 @@ extern "C" { + * + * If set, the height of each page when this image was loaded. If you save an + * image with "page-height" set to a format that supports multiple pages, such +- * as tiff, the image will be saved as a series of pages. ++ * as tiff, the image will be saved as a series of pages. + */ + #define VIPS_META_PAGE_HEIGHT "page-height" + + /** + * VIPS_META_N_PAGES: + * +- * If set, the number of pages in the original file. ++ * If set, the number of pages in the original file. + */ + #define VIPS_META_N_PAGES "n-pages" + +@@ -165,145 +165,145 @@ extern "C" { + #define VIPS_META_CONCURRENCY "concurrency" + + VIPS_API +-guint64 vips_format_sizeof( VipsBandFormat format ); ++guint64 vips_format_sizeof(VipsBandFormat format); + VIPS_API +-guint64 vips_format_sizeof_unsafe( VipsBandFormat format ); ++guint64 vips_format_sizeof_unsafe(VipsBandFormat format); + + VIPS_API +-int vips_image_get_width( const VipsImage *image ); ++int vips_image_get_width(const VipsImage *image); + VIPS_API +-int vips_image_get_height( const VipsImage *image ); ++int vips_image_get_height(const VipsImage *image); + VIPS_API +-int vips_image_get_bands( const VipsImage *image ); ++int vips_image_get_bands(const VipsImage *image); + VIPS_API +-VipsBandFormat vips_image_get_format( const VipsImage *image ); ++VipsBandFormat vips_image_get_format(const VipsImage *image); + VIPS_API +-double vips_image_get_format_max( VipsBandFormat format ); ++double vips_image_get_format_max(VipsBandFormat format); + VIPS_API +-VipsBandFormat vips_image_guess_format( const VipsImage *image ); ++VipsBandFormat vips_image_guess_format(const VipsImage *image); + VIPS_API +-VipsCoding vips_image_get_coding( const VipsImage *image ); ++VipsCoding vips_image_get_coding(const VipsImage *image); + VIPS_API +-VipsInterpretation vips_image_get_interpretation( const VipsImage *image ); ++VipsInterpretation vips_image_get_interpretation(const VipsImage *image); + VIPS_API +-VipsInterpretation vips_image_guess_interpretation( const VipsImage *image ); ++VipsInterpretation vips_image_guess_interpretation(const VipsImage *image); + VIPS_API +-double vips_image_get_xres( const VipsImage *image ); ++double vips_image_get_xres(const VipsImage *image); + VIPS_API +-double vips_image_get_yres( const VipsImage *image ); ++double vips_image_get_yres(const VipsImage *image); + VIPS_API +-int vips_image_get_xoffset( const VipsImage *image ); ++int vips_image_get_xoffset(const VipsImage *image); + VIPS_API +-int vips_image_get_yoffset( const VipsImage *image ); ++int vips_image_get_yoffset(const VipsImage *image); + VIPS_API +-const char *vips_image_get_filename( const VipsImage *image ); ++const char *vips_image_get_filename(const VipsImage *image); + VIPS_API +-const char *vips_image_get_mode( const VipsImage *image ); ++const char *vips_image_get_mode(const VipsImage *image); + VIPS_API +-double vips_image_get_scale( const VipsImage *image ); ++double vips_image_get_scale(const VipsImage *image); + VIPS_API +-double vips_image_get_offset( const VipsImage *image ); ++double vips_image_get_offset(const VipsImage *image); + VIPS_API +-int vips_image_get_page_height( VipsImage *image ); ++int vips_image_get_page_height(VipsImage *image); + VIPS_API +-int vips_image_get_n_pages( VipsImage *image ); ++int vips_image_get_n_pages(VipsImage *image); + VIPS_API +-int vips_image_get_n_subifds( VipsImage *image ); ++int vips_image_get_n_subifds(VipsImage *image); + VIPS_API +-int vips_image_get_orientation( VipsImage *image ); ++int vips_image_get_orientation(VipsImage *image); + VIPS_API +-gboolean vips_image_get_orientation_swap( VipsImage *image ); ++gboolean vips_image_get_orientation_swap(VipsImage *image); + VIPS_API +-int vips_image_get_concurrency( VipsImage *image, int default_concurrency ); ++int vips_image_get_concurrency(VipsImage *image, int default_concurrency); + VIPS_API +-const void *vips_image_get_data( VipsImage *image ); ++const void *vips_image_get_data(VipsImage *image); + + VIPS_API +-void vips_image_init_fields( VipsImage *image, +- int xsize, int ysize, int bands, +- VipsBandFormat format, VipsCoding coding, +- VipsInterpretation interpretation, +- double xres, double yres ); ++void vips_image_init_fields(VipsImage *image, ++ int xsize, int ysize, int bands, ++ VipsBandFormat format, VipsCoding coding, ++ VipsInterpretation interpretation, ++ double xres, double yres); + + VIPS_API +-void vips_image_set( VipsImage *image, const char *name, GValue *value ); ++void vips_image_set(VipsImage *image, const char *name, GValue *value); + VIPS_API +-int vips_image_get( const VipsImage *image, +- const char *name, GValue *value_copy ); ++int vips_image_get(const VipsImage *image, ++ const char *name, GValue *value_copy); + VIPS_API +-int vips_image_get_as_string( const VipsImage *image, +- const char *name, char **out ); ++int vips_image_get_as_string(const VipsImage *image, ++ const char *name, char **out); + VIPS_API +-GType vips_image_get_typeof( const VipsImage *image, const char *name ); ++GType vips_image_get_typeof(const VipsImage *image, const char *name); + VIPS_API +-gboolean vips_image_remove( VipsImage *image, const char *name ); +-typedef void *(*VipsImageMapFn)( VipsImage *image, +- const char *name, GValue *value, void *a ); ++gboolean vips_image_remove(VipsImage *image, const char *name); ++typedef void *(*VipsImageMapFn)(VipsImage *image, ++ const char *name, GValue *value, void *a); + VIPS_API +-void *vips_image_map( VipsImage *image, VipsImageMapFn fn, void *a ); ++void *vips_image_map(VipsImage *image, VipsImageMapFn fn, void *a); + VIPS_API +-gchar **vips_image_get_fields( VipsImage *image ); ++gchar **vips_image_get_fields(VipsImage *image); + + VIPS_API +-void vips_image_set_area( VipsImage *image, +- const char *name, VipsCallbackFn free_fn, void *data ); ++void vips_image_set_area(VipsImage *image, ++ const char *name, VipsCallbackFn free_fn, void *data); + VIPS_API +-int vips_image_get_area( const VipsImage *image, +- const char *name, const void **data ); ++int vips_image_get_area(const VipsImage *image, ++ const char *name, const void **data); + VIPS_API +-void vips_image_set_blob( VipsImage *image, +- const char *name, +- VipsCallbackFn free_fn, const void *data, size_t length ); ++void vips_image_set_blob(VipsImage *image, ++ const char *name, ++ VipsCallbackFn free_fn, const void *data, size_t length); + VIPS_API +-void vips_image_set_blob_copy( VipsImage *image, +- const char *name, const void *data, size_t length ); ++void vips_image_set_blob_copy(VipsImage *image, ++ const char *name, const void *data, size_t length); + VIPS_API +-int vips_image_get_blob( const VipsImage *image, +- const char *name, const void **data, size_t *length ); ++int vips_image_get_blob(const VipsImage *image, ++ const char *name, const void **data, size_t *length); + + VIPS_API +-int vips_image_get_int( const VipsImage *image, const char *name, int *out ); ++int vips_image_get_int(const VipsImage *image, const char *name, int *out); + VIPS_API +-void vips_image_set_int( VipsImage *image, const char *name, int i ); ++void vips_image_set_int(VipsImage *image, const char *name, int i); + VIPS_API +-int vips_image_get_double( const VipsImage *image, +- const char *name, double *out ); ++int vips_image_get_double(const VipsImage *image, ++ const char *name, double *out); + VIPS_API +-void vips_image_set_double( VipsImage *image, const char *name, double d ); ++void vips_image_set_double(VipsImage *image, const char *name, double d); + VIPS_API +-int vips_image_get_string( const VipsImage *image, +- const char *name, const char **out ); ++int vips_image_get_string(const VipsImage *image, ++ const char *name, const char **out); + VIPS_API +-void vips_image_set_string( VipsImage *image, +- const char *name, const char *str ); ++void vips_image_set_string(VipsImage *image, ++ const char *name, const char *str); + VIPS_API +-void vips_image_print_field( const VipsImage *image, const char *name ); ++void vips_image_print_field(const VipsImage *image, const char *name); + VIPS_API +-int vips_image_get_image( const VipsImage *image, +- const char *name, VipsImage **out ); ++int vips_image_get_image(const VipsImage *image, ++ const char *name, VipsImage **out); + VIPS_API +-void vips_image_set_image( VipsImage *image, const char *name, VipsImage *im ); ++void vips_image_set_image(VipsImage *image, const char *name, VipsImage *im); + VIPS_API +-void vips_image_set_array_int( VipsImage *image, const char *name, +- const int *array, int n ); ++void vips_image_set_array_int(VipsImage *image, const char *name, ++ const int *array, int n); + VIPS_API +-int vips_image_get_array_int( VipsImage *image, const char *name, +- int **out, int *n ); ++int vips_image_get_array_int(VipsImage *image, const char *name, ++ int **out, int *n); + VIPS_API +-int vips_image_get_array_double( VipsImage *image, const char *name, +- double **out, int *n ); ++int vips_image_get_array_double(VipsImage *image, const char *name, ++ double **out, int *n); + VIPS_API +-void vips_image_set_array_double( VipsImage *image, const char *name, +- const double *array, int n ); ++void vips_image_set_array_double(VipsImage *image, const char *name, ++ const double *array, int n); + + VIPS_API +-int vips_image_history_printf( VipsImage *image, const char *format, ... ) +- G_GNUC_PRINTF( 2, 3 ); ++int vips_image_history_printf(VipsImage *image, const char *format, ...) ++ G_GNUC_PRINTF(2, 3); + VIPS_API +-int vips_image_history_args( VipsImage *image, +- const char *name, int argc, char *argv[] ); ++int vips_image_history_args(VipsImage *image, ++ const char *name, int argc, char *argv[]); + VIPS_API +-const char *vips_image_get_history( VipsImage *image ); ++const char *vips_image_get_history(VipsImage *image); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/histogram.h b/libvips/include/vips/histogram.h +index 324377a803..51122aa4e9 100644 +--- a/libvips/include/vips/histogram.h ++++ b/libvips/include/vips/histogram.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -39,43 +39,43 @@ extern "C" { + #endif /*__cplusplus*/ + + VIPS_API +-int vips_maplut( VipsImage *in, VipsImage **out, VipsImage *lut, ... ) ++int vips_maplut(VipsImage *in, VipsImage **out, VipsImage *lut, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_percent( VipsImage *in, double percent, int *threshold, ... ) ++int vips_percent(VipsImage *in, double percent, int *threshold, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_stdif( VipsImage *in, VipsImage **out, int width, int height, ... ) ++int vips_stdif(VipsImage *in, VipsImage **out, int width, int height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_hist_cum( VipsImage *in, VipsImage **out, ... ) ++int vips_hist_cum(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_hist_norm( VipsImage *in, VipsImage **out, ... ) ++int vips_hist_norm(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_hist_equal( VipsImage *in, VipsImage **out, ... ) ++int vips_hist_equal(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_hist_plot( VipsImage *in, VipsImage **out, ... ) ++int vips_hist_plot(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_hist_match( VipsImage *in, VipsImage *ref, VipsImage **out, ... ) ++int vips_hist_match(VipsImage *in, VipsImage *ref, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_hist_local( VipsImage *in, VipsImage **out, +- int width, int height, ... ) ++int vips_hist_local(VipsImage *in, VipsImage **out, ++ int width, int height, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_hist_ismonotonic( VipsImage *in, gboolean *out, ... ) ++int vips_hist_ismonotonic(VipsImage *in, gboolean *out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_hist_entropy( VipsImage *in, double *out, ... ) ++int vips_hist_entropy(VipsImage *in, double *out, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_case( VipsImage *index, VipsImage **cases, VipsImage **out, int n, +- ... ) ++int vips_case(VipsImage *index, VipsImage **cases, VipsImage **out, int n, ++ ...) + G_GNUC_NULL_TERMINATED; + + #ifdef __cplusplus +diff --git a/libvips/include/vips/image.h b/libvips/include/vips/image.h +index b4d7935335..1a4d8a0f9f 100644 +--- a/libvips/include/vips/image.h ++++ b/libvips/include/vips/image.h +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -47,8 +47,8 @@ + extern "C" { + #endif /*__cplusplus*/ + +-/* If you read MSB first, you get these two values. +- * intel order: byte 0 = b6 ++/* If you read MSB first, you get these two values. ++ * intel order: byte 0 = b6 + * SPARC order: byte 0 = 08 + */ + #define VIPS_MAGIC_INTEL (0xb6a6f208U) +@@ -64,26 +64,26 @@ extern "C" { + #define VIPS_MAX_COORD (10000000) + + typedef enum { +- VIPS_DEMAND_STYLE_ERROR = -1, +- VIPS_DEMAND_STYLE_SMALLTILE, ++ VIPS_DEMAND_STYLE_ERROR = -1, ++ VIPS_DEMAND_STYLE_SMALLTILE, + VIPS_DEMAND_STYLE_FATSTRIP, + VIPS_DEMAND_STYLE_THINSTRIP, +- VIPS_DEMAND_STYLE_ANY ++ VIPS_DEMAND_STYLE_ANY + } VipsDemandStyle; + + /* Types of image descriptor we may have. The type field is advisory only: it + * does not imply that any fields in IMAGE have valid data. + */ + typedef enum { +- VIPS_IMAGE_ERROR = -1, +- VIPS_IMAGE_NONE, /* no type set */ +- VIPS_IMAGE_SETBUF, /* malloced memory array */ +- VIPS_IMAGE_SETBUF_FOREIGN, /* memory array, don't free on close */ +- VIPS_IMAGE_OPENIN, /* input from fd with a window */ +- VIPS_IMAGE_MMAPIN, /* memory mapped input file */ +- VIPS_IMAGE_MMAPINRW, /* memory mapped read/write file */ +- VIPS_IMAGE_OPENOUT, /* output to fd */ +- VIPS_IMAGE_PARTIAL /* partial image */ ++ VIPS_IMAGE_ERROR = -1, ++ VIPS_IMAGE_NONE, /* no type set */ ++ VIPS_IMAGE_SETBUF, /* malloced memory array */ ++ VIPS_IMAGE_SETBUF_FOREIGN, /* memory array, don't free on close */ ++ VIPS_IMAGE_OPENIN, /* input from fd with a window */ ++ VIPS_IMAGE_MMAPIN, /* memory mapped input file */ ++ VIPS_IMAGE_MMAPINRW, /* memory mapped read/write file */ ++ VIPS_IMAGE_OPENOUT, /* output to fd */ ++ VIPS_IMAGE_PARTIAL /* partial image */ + } VipsImageType; + + typedef enum { +@@ -140,41 +140,41 @@ typedef enum { + VIPS_ACCESS_LAST + } VipsAccess; + +-typedef void *(*VipsStartFn)( VipsImage *out, void *a, void *b ); +-typedef int (*VipsGenerateFn)( VipsRegion *out, +- void *seq, void *a, void *b, gboolean *stop ); +-typedef int (*VipsStopFn)( void *seq, void *a, void *b ); ++typedef void *(*VipsStartFn)(VipsImage *out, void *a, void *b); ++typedef int (*VipsGenerateFn)(VipsRegion *out, ++ void *seq, void *a, void *b, gboolean *stop); ++typedef int (*VipsStopFn)(void *seq, void *a, void *b); + + /* Struct we keep a record of execution time in. Passed to eval signal so + * it can assess progress. + */ + typedef struct _VipsProgress { + /*< private >*/ +- VipsImage *im; /* Image we are part of */ ++ VipsImage *im; /* Image we are part of */ + + /*< public >*/ +- int run; /* Time we have been running */ +- int eta; /* Estimated seconds of computation left */ +- gint64 tpels; /* Number of pels we expect to calculate */ +- gint64 npels; /* Number of pels calculated so far */ +- int percent; /* Percent complete */ +- GTimer *start; /* Start time */ ++ int run; /* Time we have been running */ ++ int eta; /* Estimated seconds of computation left */ ++ gint64 tpels; /* Number of pels we expect to calculate */ ++ gint64 npels; /* Number of pels calculated so far */ ++ int percent; /* Percent complete */ ++ GTimer *start; /* Start time */ + } VipsProgress; + + #define VIPS_TYPE_IMAGE (vips_image_get_type()) +-#define VIPS_IMAGE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_IMAGE, VipsImage )) +-#define VIPS_IMAGE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_IMAGE, VipsImageClass)) +-#define VIPS_IS_IMAGE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_IMAGE )) +-#define VIPS_IS_IMAGE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_IMAGE )) +-#define VIPS_IMAGE_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_IMAGE, VipsImageClass )) ++#define VIPS_IMAGE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_IMAGE, VipsImage)) ++#define VIPS_IMAGE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_IMAGE, VipsImageClass)) ++#define VIPS_IS_IMAGE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_IMAGE)) ++#define VIPS_IS_IMAGE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_IMAGE)) ++#define VIPS_IMAGE_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_IMAGE, VipsImageClass)) + + /* Matching typedef in basic.h. + */ +@@ -187,26 +187,26 @@ struct _VipsImage { + * Don't use them though, use vips_image_get_width() and friends. + */ + +- int Xsize; /* image width, in pixels */ +- int Ysize; /* image height, in pixels */ +- int Bands; /* number of image bands */ ++ int Xsize; /* image width, in pixels */ ++ int Ysize; /* image height, in pixels */ ++ int Bands; /* number of image bands */ + +- VipsBandFormat BandFmt; /* pixel format */ +- VipsCoding Coding; /* pixel coding */ +- VipsInterpretation Type;/* pixel interpretation */ +- double Xres; /* horizontal pixels per millimetre */ +- double Yres; /* vertical pixels per millimetre */ ++ VipsBandFormat BandFmt; /* pixel format */ ++ VipsCoding Coding; /* pixel coding */ ++ VipsInterpretation Type; /* pixel interpretation */ ++ double Xres; /* horizontal pixels per millimetre */ ++ double Yres; /* vertical pixels per millimetre */ + +- int Xoffset; /* image origin hint */ +- int Yoffset; /* image origin hint */ ++ int Xoffset; /* image origin hint */ ++ int Yoffset; /* image origin hint */ + +- /* No longer used, the names are here for compat with very, very old ++ /* No longer used, the names are here for compat with very, very old + * code. + */ + int Length; + short Compression; + short Level; +- int Bbits; /* was number of bits in this format */ ++ int Bbits; /* was number of bits in this format */ + + /* Old code expects to see this member, newer code has a param on + * eval(). +@@ -217,8 +217,8 @@ struct _VipsImage { + * vips_image_get_history() and friends. + */ + char *Hist; /* don't use, see vips_image_get_history() */ +- char *filename; /* pointer to copy of filename */ +- VipsPel *data; /* start of image data for WIO */ ++ char *filename; /* pointer to copy of filename */ ++ VipsPel *data; /* start of image data for WIO */ + int kill; /* set to non-zero to block eval */ + + /* Everything below this private and only used internally by +@@ -232,29 +232,29 @@ struct _VipsImage { + float Xres_float; + float Yres_float; + +- char *mode; /* mode string passed to _new() */ +- VipsImageType dtype; /* descriptor type */ +- int fd; /* file descriptor */ +- void *baseaddr; /* pointer to the start of an mmap file */ +- size_t length; /* size of mmap area */ +- guint32 magic; /* magic from header, endian-ness of image */ ++ char *mode; /* mode string passed to _new() */ ++ VipsImageType dtype; /* descriptor type */ ++ int fd; /* file descriptor */ ++ void *baseaddr; /* pointer to the start of an mmap file */ ++ size_t length; /* size of mmap area */ ++ guint32 magic; /* magic from header, endian-ness of image */ + +- /* Partial image stuff. All these fields are initialised ++ /* Partial image stuff. All these fields are initialised + * to NULL and ignored unless set by vips_image_generate() etc. + */ + VipsStartFn start_fn; + VipsGenerateFn generate_fn; + VipsStopFn stop_fn; +- void *client1; /* user arguments */ ++ void *client1; /* user arguments */ + void *client2; +- GMutex *sslock; /* start-stop lock */ +- GSList *regions; /* list of regions current for this image */ +- VipsDemandStyle dhint; /* demand style hint */ ++ GMutex *sslock; /* start-stop lock */ ++ GSList *regions; /* list of regions current for this image */ ++ VipsDemandStyle dhint; /* demand style hint */ + + /* Extra user-defined fields ... see vips_image_get() etc. + */ +- GHashTable *meta; /* GhashTable of GValue */ +- GSList *meta_traverse; /* traverse order for Meta */ ++ GHashTable *meta; /* GhashTable of GValue */ ++ GSList *meta_traverse; /* traverse order for Meta */ + + /* Part of mmap() read ... the sizeof() the header we skip from the + * file start. Usually VIPS_SIZEOF_HEADER, but can be something else +@@ -271,7 +271,7 @@ struct _VipsImage { + */ + GSList *windows; + +- /* Upstream/downstream relationships, built from args to ++ /* Upstream/downstream relationships, built from args to + * vips_demand_hint(). + * + * We use these to invalidate downstream pixel buffers. +@@ -328,37 +328,37 @@ typedef struct _VipsImageClass { + + /* Evaluation is starting. + */ +- void (*preeval)( VipsImage *image, VipsProgress *progress, void *data ); ++ void (*preeval)(VipsImage *image, VipsProgress *progress, void *data); + + /* Evaluation progress. + */ +- void (*eval)( VipsImage *image, VipsProgress *progress, void *data ); ++ void (*eval)(VipsImage *image, VipsProgress *progress, void *data); + + /* Evaluation is ending. + */ +- void (*posteval)( VipsImage *image, VipsProgress *progress, void *data ); ++ void (*posteval)(VipsImage *image, VipsProgress *progress, void *data); + +- /* An image has been written to. +- * Used by eg. vips_image_new_mode("x.jpg", "w") to do the ++ /* An image has been written to. ++ * Used by eg. vips_image_new_mode("x.jpg", "w") to do the + * final write to jpeg. + * Set *result to non-zero to indicate an error on write. + */ +- void (*written)( VipsImage *image, int *result, void *data ); ++ void (*written)(VipsImage *image, int *result, void *data); + +- /* An image has been modified in some way and all caches +- * need dropping. ++ /* An image has been modified in some way and all caches ++ * need dropping. + */ +- void (*invalidate)( VipsImage *image, void *data ); ++ void (*invalidate)(VipsImage *image, void *data); + +- /* Minimise this pipeline. ++ /* Minimise this pipeline. + * + * This is triggered (sometimes) at the end of eval to signal that + * we're probably done and that operations involved should try to +- * minimise memory use by, for example, dropping caches. ++ * minimise memory use by, for example, dropping caches. + * + * See vips_tilecache(). + */ +- void (*minimise)( VipsImage *image, void *data ); ++ void (*minimise)(VipsImage *image, void *data); + + } VipsImageClass; + +@@ -373,230 +373,230 @@ GType vips_image_get_type(void); + + /* Pixel address calculation macros. + */ +-#define VIPS_IMAGE_SIZEOF_ELEMENT( I ) \ ++#define VIPS_IMAGE_SIZEOF_ELEMENT(I) \ + (vips_format_sizeof_unsafe((I)->BandFmt)) +-#define VIPS_IMAGE_SIZEOF_PEL( I ) \ +- (VIPS_IMAGE_SIZEOF_ELEMENT( I ) * (I)->Bands) +-#define VIPS_IMAGE_SIZEOF_LINE( I ) \ +- (VIPS_IMAGE_SIZEOF_PEL( I ) * (I)->Xsize) +-#define VIPS_IMAGE_SIZEOF_IMAGE( I ) \ +- (VIPS_IMAGE_SIZEOF_LINE( I ) * (I)->Ysize) +-#define VIPS_IMAGE_N_ELEMENTS( I ) \ ++#define VIPS_IMAGE_SIZEOF_PEL(I) \ ++ (VIPS_IMAGE_SIZEOF_ELEMENT(I) * (I)->Bands) ++#define VIPS_IMAGE_SIZEOF_LINE(I) \ ++ (VIPS_IMAGE_SIZEOF_PEL(I) * (I)->Xsize) ++#define VIPS_IMAGE_SIZEOF_IMAGE(I) \ ++ (VIPS_IMAGE_SIZEOF_LINE(I) * (I)->Ysize) ++#define VIPS_IMAGE_N_ELEMENTS(I) \ + ((I)->Bands * (I)->Xsize) +-#define VIPS_IMAGE_N_PELS( I ) \ ++#define VIPS_IMAGE_N_PELS(I) \ + ((guint64) (I)->Xsize * (I)->Ysize) + + /* If VIPS_DEBUG is defined, add bounds checking. + */ + #ifdef VIPS_DEBUG +-#define VIPS_IMAGE_ADDR( I, X, Y ) \ +- ( ((X) >= 0 && (X) < VIPS_IMAGE( I )->Xsize && \ +- (Y) >= 0 && (Y) < VIPS_IMAGE( I )->Ysize && \ +- VIPS_IMAGE( I )->data) ? \ +- (VIPS_IMAGE( I )->data + \ +- (Y) * VIPS_IMAGE_SIZEOF_LINE( I ) + \ +- (X) * VIPS_IMAGE_SIZEOF_PEL( I )) : \ +- (fprintf( stderr, \ +- "VIPS_IMAGE_ADDR: point out of bounds, " \ +- "file \"%s\", line %d\n" \ +- "(point x=%d, y=%d\n" \ +- " should have been within VipsRect left=%d, top=%d, " \ +- "width=%d, height=%d)\n", \ +- __FILE__, __LINE__, \ +- (X), (Y), \ +- 0, 0, \ +- VIPS_IMAGE( I )->Xsize, \ +- VIPS_IMAGE( I )->Ysize ), (VipsPel *) NULL) \ +- ) ++#define VIPS_IMAGE_ADDR(I, X, Y) \ ++ (((X) >= 0 && (X) < VIPS_IMAGE(I)->Xsize && \ ++ (Y) >= 0 && (Y) < VIPS_IMAGE(I)->Ysize && \ ++ VIPS_IMAGE(I)->data) \ ++ ? (VIPS_IMAGE(I)->data + \ ++ (Y) *VIPS_IMAGE_SIZEOF_LINE(I) + \ ++ (X) *VIPS_IMAGE_SIZEOF_PEL(I)) \ ++ : (fprintf(stderr, \ ++ "VIPS_IMAGE_ADDR: point out of bounds, " \ ++ "file \"%s\", line %d\n" \ ++ "(point x=%d, y=%d\n" \ ++ " should have been within VipsRect left=%d, top=%d, " \ ++ "width=%d, height=%d)\n", \ ++ __FILE__, __LINE__, \ ++ (X), (Y), \ ++ 0, 0, \ ++ VIPS_IMAGE(I)->Xsize, \ ++ VIPS_IMAGE(I)->Ysize), \ ++ (VipsPel *) NULL)) + #else /*!VIPS_DEBUG*/ +-#define VIPS_IMAGE_ADDR( I, X, Y ) \ ++#define VIPS_IMAGE_ADDR(I, X, Y) \ + ((I)->data + \ +- (Y) * VIPS_IMAGE_SIZEOF_LINE( I ) + \ +- (X) * VIPS_IMAGE_SIZEOF_PEL( I )) ++ (Y) *VIPS_IMAGE_SIZEOF_LINE(I) + \ ++ (X) *VIPS_IMAGE_SIZEOF_PEL(I)) + #endif /*VIPS_DEBUG*/ + + #ifdef VIPS_DEBUG +-#define VIPS_MATRIX( I, X, Y ) \ +- ((VIPS_IMAGE( I )->BandFmt == VIPS_FORMAT_DOUBLE && \ +- VIPS_IMAGE( I )->Bands == 1) ? \ +- ((double *) VIPS_IMAGE_ADDR( I, X, Y )) : \ +- (fprintf( stderr, "VIPS_MATRIX: not a matrix image\n" ), \ +- (double *) NULL)) ++#define VIPS_MATRIX(I, X, Y) \ ++ ((VIPS_IMAGE(I)->BandFmt == VIPS_FORMAT_DOUBLE && \ ++ VIPS_IMAGE(I)->Bands == 1) \ ++ ? ((double *) VIPS_IMAGE_ADDR(I, X, Y)) \ ++ : (fprintf(stderr, "VIPS_MATRIX: not a matrix image\n"), \ ++ (double *) NULL)) + #else /*!VIPS_DEBUG*/ +-#define VIPS_MATRIX( I, X, Y ) \ +- ((double *) VIPS_IMAGE_ADDR( I, X, Y )) ++#define VIPS_MATRIX(I, X, Y) \ ++ ((double *) VIPS_IMAGE_ADDR(I, X, Y)) + #endif /*VIPS_DEBUG*/ + + VIPS_API +-void vips_progress_set( gboolean progress ); ++void vips_progress_set(gboolean progress); + + VIPS_API +-void vips_image_invalidate_all( VipsImage *image ); ++void vips_image_invalidate_all(VipsImage *image); + + VIPS_API +-void vips_image_minimise_all( VipsImage *image ); ++void vips_image_minimise_all(VipsImage *image); + + VIPS_API +-gboolean vips_image_is_sequential( VipsImage *image ); ++gboolean vips_image_is_sequential(VipsImage *image); + + VIPS_API +-void vips_image_set_progress( VipsImage *image, gboolean progress ); ++void vips_image_set_progress(VipsImage *image, gboolean progress); + VIPS_API +-gboolean vips_image_iskilled( VipsImage *image ); ++gboolean vips_image_iskilled(VipsImage *image); + VIPS_API +-void vips_image_set_kill( VipsImage *image, gboolean kill ); ++void vips_image_set_kill(VipsImage *image, gboolean kill); + + VIPS_API +-char *vips_filename_get_filename( const char *vips_filename ); ++char *vips_filename_get_filename(const char *vips_filename); + VIPS_API +-char *vips_filename_get_options( const char *vips_filename ); ++char *vips_filename_get_options(const char *vips_filename); + + VIPS_API +-VipsImage *vips_image_new( void ); ++VipsImage *vips_image_new(void); + VIPS_API +-VipsImage *vips_image_new_memory( void ); ++VipsImage *vips_image_new_memory(void); + VIPS_API +-VipsImage *vips_image_memory( void ); ++VipsImage *vips_image_memory(void); + VIPS_API +-VipsImage *vips_image_new_from_file( const char *name, ... ) ++VipsImage *vips_image_new_from_file(const char *name, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-VipsImage *vips_image_new_from_file_RW( const char *filename ); ++VipsImage *vips_image_new_from_file_RW(const char *filename); + VIPS_API +-VipsImage *vips_image_new_from_file_raw( const char *filename, +- int xsize, int ysize, int bands, guint64 offset ); ++VipsImage *vips_image_new_from_file_raw(const char *filename, ++ int xsize, int ysize, int bands, guint64 offset); + VIPS_API +-VipsImage *vips_image_new_from_memory( const void *data, size_t size, +- int width, int height, int bands, VipsBandFormat format ); ++VipsImage *vips_image_new_from_memory(const void *data, size_t size, ++ int width, int height, int bands, VipsBandFormat format); + VIPS_API +-VipsImage *vips_image_new_from_memory_copy( const void *data, size_t size, +- int width, int height, int bands, VipsBandFormat format ); ++VipsImage *vips_image_new_from_memory_copy(const void *data, size_t size, ++ int width, int height, int bands, VipsBandFormat format); + VIPS_API +-VipsImage *vips_image_new_from_buffer( const void *buf, size_t len, +- const char *option_string, ... ) ++VipsImage *vips_image_new_from_buffer(const void *buf, size_t len, ++ const char *option_string, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-VipsImage *vips_image_new_from_source( VipsSource *source, +- const char *option_string, ... ) G_GNUC_NULL_TERMINATED; ++VipsImage *vips_image_new_from_source(VipsSource *source, ++ const char *option_string, ...) G_GNUC_NULL_TERMINATED; + VIPS_API +-VipsImage *vips_image_new_matrix( int width, int height ); ++VipsImage *vips_image_new_matrix(int width, int height); + VIPS_API +-VipsImage *vips_image_new_matrixv( int width, int height, ... ); ++VipsImage *vips_image_new_matrixv(int width, int height, ...); + VIPS_API +-VipsImage *vips_image_new_matrix_from_array( int width, int height, +- const double *array, int size ); ++VipsImage *vips_image_new_matrix_from_array(int width, int height, ++ const double *array, int size); + VIPS_API +-VipsImage *vips_image_matrix_from_array( int width, int height, +- const double *array, int size ); ++VipsImage *vips_image_matrix_from_array(int width, int height, ++ const double *array, int size); + VIPS_API +-VipsImage *vips_image_new_from_image( VipsImage *image, +- const double *c, int n ); ++VipsImage *vips_image_new_from_image(VipsImage *image, ++ const double *c, int n); + VIPS_API +-VipsImage *vips_image_new_from_image1( VipsImage *image, double c ); ++VipsImage *vips_image_new_from_image1(VipsImage *image, double c); + + VIPS_API +-void vips_image_set_delete_on_close( VipsImage *image, +- gboolean delete_on_close ); ++void vips_image_set_delete_on_close(VipsImage *image, ++ gboolean delete_on_close); + VIPS_API +-guint64 vips_get_disc_threshold( void ); ++guint64 vips_get_disc_threshold(void); + VIPS_API +-VipsImage *vips_image_new_temp_file( const char *format ); ++VipsImage *vips_image_new_temp_file(const char *format); + + VIPS_API +-int vips_image_write( VipsImage *image, VipsImage *out ); ++int vips_image_write(VipsImage *image, VipsImage *out); + VIPS_API +-int vips_image_write_to_file( VipsImage *image, const char *name, ... ) ++int vips_image_write_to_file(VipsImage *image, const char *name, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_image_write_to_buffer( VipsImage *in, +- const char *suffix, void **buf, size_t *size, ... ) ++int vips_image_write_to_buffer(VipsImage *in, ++ const char *suffix, void **buf, size_t *size, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_image_write_to_target( VipsImage *in, +- const char *suffix, VipsTarget *target, ... ) ++int vips_image_write_to_target(VipsImage *in, ++ const char *suffix, VipsTarget *target, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-void *vips_image_write_to_memory( VipsImage *in, size_t *size ); ++void *vips_image_write_to_memory(VipsImage *in, size_t *size); + + VIPS_API +-int vips_image_decode_predict( VipsImage *in, +- int *bands, VipsBandFormat *format ); ++int vips_image_decode_predict(VipsImage *in, ++ int *bands, VipsBandFormat *format); + VIPS_API +-int vips_image_decode( VipsImage *in, VipsImage **out ); ++int vips_image_decode(VipsImage *in, VipsImage **out); + VIPS_API +-int vips_image_encode( VipsImage *in, VipsImage **out, VipsCoding coding ); ++int vips_image_encode(VipsImage *in, VipsImage **out, VipsCoding coding); + + VIPS_API +-gboolean vips_image_isMSBfirst( VipsImage *image ); ++gboolean vips_image_isMSBfirst(VipsImage *image); + VIPS_API +-gboolean vips_image_isfile( VipsImage *image ); ++gboolean vips_image_isfile(VipsImage *image); + VIPS_API +-gboolean vips_image_ispartial( VipsImage *image ); ++gboolean vips_image_ispartial(VipsImage *image); + VIPS_API +-gboolean vips_image_hasalpha( VipsImage *image ); ++gboolean vips_image_hasalpha(VipsImage *image); + + VIPS_API +-VipsImage *vips_image_copy_memory( VipsImage *image ); ++VipsImage *vips_image_copy_memory(VipsImage *image); + VIPS_API +-int vips_image_wio_input( VipsImage *image ); ++int vips_image_wio_input(VipsImage *image); + VIPS_API +-int vips_image_pio_input( VipsImage *image ); ++int vips_image_pio_input(VipsImage *image); + VIPS_API +-int vips_image_pio_output( VipsImage *image ); ++int vips_image_pio_output(VipsImage *image); + VIPS_API +-int vips_image_inplace( VipsImage *image ); ++int vips_image_inplace(VipsImage *image); + VIPS_API +-int vips_image_write_prepare( VipsImage *image ); ++int vips_image_write_prepare(VipsImage *image); + + VIPS_API +-int vips_image_write_line( VipsImage *image, int ypos, VipsPel *linebuffer ); ++int vips_image_write_line(VipsImage *image, int ypos, VipsPel *linebuffer); + + VIPS_API +-gboolean vips_band_format_isint( VipsBandFormat format ); ++gboolean vips_band_format_isint(VipsBandFormat format); + VIPS_API +-gboolean vips_band_format_isuint( VipsBandFormat format ); ++gboolean vips_band_format_isuint(VipsBandFormat format); + VIPS_API +-gboolean vips_band_format_is8bit( VipsBandFormat format ); ++gboolean vips_band_format_is8bit(VipsBandFormat format); + VIPS_API +-gboolean vips_band_format_isfloat( VipsBandFormat format ); ++gboolean vips_band_format_isfloat(VipsBandFormat format); + VIPS_API +-gboolean vips_band_format_iscomplex( VipsBandFormat format ); ++gboolean vips_band_format_iscomplex(VipsBandFormat format); + + VIPS_API +-int vips_system( const char *cmd_format, ... ) ++int vips_system(const char *cmd_format, ...) + G_GNUC_NULL_TERMINATED; + + /* Defined in type.c but declared here, since they use VipsImage. + */ + VIPS_API +-VipsArrayImage *vips_array_image_new( VipsImage **array, int n ); ++VipsArrayImage *vips_array_image_new(VipsImage **array, int n); + VIPS_API +-VipsArrayImage *vips_array_image_newv( int n, ... ); ++VipsArrayImage *vips_array_image_newv(int n, ...); + VIPS_API +-VipsArrayImage *vips_array_image_new_from_string( const char *string, +- VipsAccess flags ); ++VipsArrayImage *vips_array_image_new_from_string(const char *string, ++ VipsAccess flags); + VIPS_API +-VipsArrayImage *vips_array_image_empty( void ); ++VipsArrayImage *vips_array_image_empty(void); + VIPS_API +-VipsArrayImage *vips_array_image_append( VipsArrayImage *array, +- VipsImage *image ); ++VipsArrayImage *vips_array_image_append(VipsArrayImage *array, ++ VipsImage *image); + VIPS_API +-VipsImage **vips_array_image_get( VipsArrayImage *array, int *n ); ++VipsImage **vips_array_image_get(VipsArrayImage *array, int *n); + VIPS_API +-VipsImage **vips_value_get_array_image( const GValue *value, int *n ); ++VipsImage **vips_value_get_array_image(const GValue *value, int *n); + VIPS_API +-void vips_value_set_array_image( GValue *value, int n ); ++void vips_value_set_array_image(GValue *value, int n); + + /* Defined in reorder.c, but really a function on image. + */ + VIPS_API +-int vips_reorder_prepare_many( VipsImage *image, +- VipsRegion **regions, VipsRect *r ); ++int vips_reorder_prepare_many(VipsImage *image, ++ VipsRegion **regions, VipsRect *r); + VIPS_API +-void vips_reorder_margin_hint( VipsImage *image, int margin ); ++void vips_reorder_margin_hint(VipsImage *image, int margin); + + VIPS_API +-void vips_image_free_buffer( VipsImage *image, void *buffer ); ++void vips_image_free_buffer(VipsImage *image, void *buffer); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/inlines.h b/libvips/include/vips/inlines.h +index 883b7afcd7..15a555cde1 100644 +--- a/libvips/include/vips/inlines.h ++++ b/libvips/include/vips/inlines.h +@@ -3,35 +3,35 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + + #ifndef VIPS_INLINE_H + #define VIPS_INLINE_H + +-/* glib promises to define inline in a portable way ++/* glib promises to define inline in a portable way + */ + + #include +@@ -46,21 +46,21 @@ extern "C" { + + #else /* HAVE_HYPOT */ + +-static inline double +-vips__hypot( double a, double b ) ++static inline double ++vips__hypot(double a, double b) + { +- double ta = fabs( a ); +- double tb = fabs( b ); ++ double ta = fabs(a); ++ double tb = fabs(b); + +- if( ta > tb ) { ++ if (ta > tb) { + tb = b / a; + +- return( ta * sqrt( 1.0 + tb * tb ) ); ++ return (ta * sqrt(1.0 + tb * tb)); + } + else { + ta = a / b; + +- return( tb * sqrt( 1.0 + ta * ta ) ); ++ return (tb * sqrt(1.0 + ta * ta)); + } + } + +diff --git a/libvips/include/vips/internal.h b/libvips/include/vips/internal.h +index a9f2802f1f..d501f3bbd2 100644 +--- a/libvips/include/vips/internal.h ++++ b/libvips/include/vips/internal.h +@@ -7,28 +7,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -42,34 +42,34 @@ extern "C" { + /* Try to make an O_BINARY and O_NOINHERIT ... sometimes need the leading '_'. + */ + #if defined(G_PLATFORM_WIN32) || defined(G_WITH_CYGWIN) +-# ifndef O_BINARY +-# ifdef _O_BINARY +-# define O_BINARY _O_BINARY +-# endif /*_O_BINARY*/ +-# endif /*!O_BINARY*/ +-# ifndef O_NOINHERIT +-# ifdef _O_NOINHERIT +-# define O_NOINHERIT _O_NOINHERIT +-# endif /*_O_NOINHERIT*/ +-# endif /*!O_NOINHERIT*/ ++#ifndef O_BINARY ++#ifdef _O_BINARY ++#define O_BINARY _O_BINARY ++#endif /*_O_BINARY*/ ++#endif /*!O_BINARY*/ ++#ifndef O_NOINHERIT ++#ifdef _O_NOINHERIT ++#define O_NOINHERIT _O_NOINHERIT ++#endif /*_O_NOINHERIT*/ ++#endif /*!O_NOINHERIT*/ + #endif /*defined(G_PLATFORM_WIN32) || defined(G_WITH_CYGWIN)*/ + + /* If we have O_BINARY, add it to a mode flags set. + */ + #ifdef O_BINARY +-# define BINARYIZE(M) ((M) | O_BINARY) ++#define BINARYIZE(M) ((M) | O_BINARY) + #else /*!O_BINARY*/ +-# define BINARYIZE(M) (M) ++#define BINARYIZE(M) (M) + #endif /*O_BINARY*/ + + /* If we have O_CLOEXEC or O_NOINHERIT, add it to a mode flags set. + */ + #ifdef O_CLOEXEC +-# define CLOEXEC(M) ((M) | O_CLOEXEC) ++#define CLOEXEC(M) ((M) | O_CLOEXEC) + #elif defined(O_NOINHERIT) +-# define CLOEXEC(M) ((M) | O_NOINHERIT) ++#define CLOEXEC(M) ((M) | O_NOINHERIT) + #else /*!O_CLOEXEC && !O_NOINHERIT*/ +-# define CLOEXEC(M) (M) ++#define CLOEXEC(M) (M) + #endif /*O_CLOEXEC*/ + + /* << on an int is undefined in C if the int is negative. Imagine a machine +@@ -78,9 +78,9 @@ extern "C" { + * Fuzzers find and warn about this, so we must use this macro instead. Cast + * to uint, shift, and cast back. + */ +-#define VIPS_LSHIFT_INT( I, N ) ((int) ((unsigned int) (I) << (N))) ++#define VIPS_LSHIFT_INT(I, N) ((int) ((unsigned int) (I) << (N))) + +-/* What we store in the Meta hash table. We can't just use GHashTable's ++/* What we store in the Meta hash table. We can't just use GHashTable's + * key/value pairs, since we need to iterate over meta in Meta_traverse order. + * + * We don't refcount at this level ... large meta values are refcounted by +@@ -89,24 +89,24 @@ extern "C" { + typedef struct _VipsMeta { + VipsImage *im; + +- char *name; /* strdup() of field name */ +- GValue value; /* copy of value */ ++ char *name; /* strdup() of field name */ ++ GValue value; /* copy of value */ + } VipsMeta; + + /* TODO(kleisauke): VIPS_API is required by the magick module. + */ + VIPS_API +-int vips__exif_parse( VipsImage *image ); ++int vips__exif_parse(VipsImage *image); + /* TODO(kleisauke): VIPS_API is required by the heif module. + */ + VIPS_API +-int vips__exif_update( VipsImage *image ); ++int vips__exif_update(VipsImage *image); + +-void vips_check_init( void ); ++void vips_check_init(void); + +-void vips__meta_init_types( void ); +-void vips__meta_destroy( VipsImage *im ); +-int vips__meta_cp( VipsImage *, const VipsImage * ); ++void vips__meta_init_types(void); ++void vips__meta_destroy(VipsImage *im); ++int vips__meta_cp(VipsImage *, const VipsImage *); + + /* Default tile geometry. + */ +@@ -131,259 +131,259 @@ extern int vips__leak; + */ + extern int vips__progress; + +-/* Show info messages. Handy for debugging. ++/* Show info messages. Handy for debugging. + */ + extern int vips__info; + +-/* A string giving the image size (in bytes of uncompressed image) above which +- * we decompress to disc on open. ++/* A string giving the image size (in bytes of uncompressed image) above which ++ * we decompress to disc on open. + */ + extern char *vips__disc_threshold; + + extern gboolean vips__cache_dump; + extern gboolean vips__cache_trace; + +-void vips__thread_init( void ); +-void vips__threadpool_init( void ); +-void vips__threadpool_shutdown( void ); +-int vips__thread_execute( const char *name, GFunc func, gpointer data ); +-VIPS_API void vips__worker_lock( GMutex *mutex ); ++void vips__thread_init(void); ++void vips__threadpool_init(void); ++void vips__threadpool_shutdown(void); ++int vips__thread_execute(const char *name, GFunc func, gpointer data); ++VIPS_API void vips__worker_lock(GMutex *mutex); + +-void vips__cache_init( void ); ++void vips__cache_init(void); + +-int vips__print_renders( void ); +-int vips__type_leak( void ); +-int vips__object_leak( void ); ++int vips__print_renders(void); ++int vips__type_leak(void); ++int vips__object_leak(void); + + /* iofuncs + */ +-int vips__open_image_read( const char *filename ); +-int vips__open_image_write( const char *filename, gboolean temp ); ++int vips__open_image_read(const char *filename); ++int vips__open_image_write(const char *filename, gboolean temp); + + /* im_image_open_input() needs to have this visible. + */ + #if VIPS_ENABLE_DEPRECATED + VIPS_API + #endif +-int vips_image_open_input( VipsImage *image ); ++int vips_image_open_input(VipsImage *image); + + /* im_image_open_output() needs to have this visible. + */ + #if VIPS_ENABLE_DEPRECATED + VIPS_API + #endif +-int vips_image_open_output( VipsImage *image ); ++int vips_image_open_output(VipsImage *image); + +-void vips__link_break_all( VipsImage *im ); +-void *vips__link_map( VipsImage *image, gboolean upstream, +- VipsSListMap2Fn fn, void *a, void *b ); ++void vips__link_break_all(VipsImage *im); ++void *vips__link_map(VipsImage *image, gboolean upstream, ++ VipsSListMap2Fn fn, void *a, void *b); + +-gboolean vips__mmap_supported( int fd ); +-void *vips__mmap( int fd, int writeable, size_t length, gint64 offset ); +-int vips__munmap( const void *start, size_t length ); ++gboolean vips__mmap_supported(int fd); ++void *vips__mmap(int fd, int writeable, size_t length, gint64 offset); ++int vips__munmap(const void *start, size_t length); + + /* im_mapfile() needs to have this visible. + */ + #if VIPS_ENABLE_DEPRECATED + VIPS_API + #endif +-int vips_mapfile( VipsImage *image ); ++int vips_mapfile(VipsImage *image); + + /* im_mapfilerw() needs to have this visible. + */ + #if VIPS_ENABLE_DEPRECATED + VIPS_API + #endif +-int vips_mapfilerw( VipsImage *image ); ++int vips_mapfilerw(VipsImage *image); + + /* im_remapfilerw() needs to have this visible. + */ + #if VIPS_ENABLE_DEPRECATED + VIPS_API + #endif +-int vips_remapfilerw( VipsImage *image ); ++int vips_remapfilerw(VipsImage *image); + +-void vips__buffer_init( void ); +-void vips__buffer_shutdown( void ); ++void vips__buffer_init(void); ++void vips__buffer_shutdown(void); + +-void vips__copy_4byte( int swap, unsigned char *to, unsigned char *from ); +-void vips__copy_2byte( gboolean swap, unsigned char *to, unsigned char *from ); ++void vips__copy_4byte(int swap, unsigned char *to, unsigned char *from); ++void vips__copy_2byte(gboolean swap, unsigned char *to, unsigned char *from); + +-guint32 vips__file_magic( const char *filename ); ++guint32 vips__file_magic(const char *filename); + /* TODO(kleisauke): VIPS_API is required by vipsheader. + */ + VIPS_API +-int vips__has_extension_block( VipsImage *im ); ++int vips__has_extension_block(VipsImage *im); + /* TODO(kleisauke): VIPS_API is required by vipsheader. + */ + VIPS_API +-void *vips__read_extension_block( VipsImage *im, int *size ); ++void *vips__read_extension_block(VipsImage *im, int *size); + /* TODO(kleisauke): VIPS_API is required by vipsedit. + */ + VIPS_API +-int vips__write_extension_block( VipsImage *im, void *buf, int size ); +-int vips__writehist( VipsImage *image ); ++int vips__write_extension_block(VipsImage *im, void *buf, int size); ++int vips__writehist(VipsImage *image); + /* TODO(kleisauke): VIPS_API is required by vipsedit. + */ + VIPS_API +-int vips__read_header_bytes( VipsImage *im, unsigned char *from ); ++int vips__read_header_bytes(VipsImage *im, unsigned char *from); + /* TODO(kleisauke): VIPS_API is required by vipsedit. + */ + VIPS_API +-int vips__write_header_bytes( VipsImage *im, unsigned char *to ); +-int vips__image_meta_copy( VipsImage *dst, const VipsImage *src ); ++int vips__write_header_bytes(VipsImage *im, unsigned char *to); ++int vips__image_meta_copy(VipsImage *dst, const VipsImage *src); + + extern GMutex *vips__global_lock; + +-int vips_image_written( VipsImage *image ); +-void vips_image_preeval( VipsImage *image ); +-void vips_image_eval( VipsImage *image, guint64 processed ); +-void vips_image_posteval( VipsImage *image ); ++int vips_image_written(VipsImage *image); ++void vips_image_preeval(VipsImage *image); ++void vips_image_eval(VipsImage *image, guint64 processed); ++void vips_image_posteval(VipsImage *image); + + /* im_openout() needs to have this visible. + */ + #if VIPS_ENABLE_DEPRECATED + VIPS_API + #endif +-VipsImage *vips_image_new_mode( const char *filename, const char *mode ); ++VipsImage *vips_image_new_mode(const char *filename, const char *mode); + +-int vips__formatalike_vec( VipsImage **in, VipsImage **out, int n ); +-int vips__sizealike_vec( VipsImage **in, VipsImage **out, int n ); +-int vips__bandup( const char *domain, VipsImage *in, VipsImage **out, int n ); +-int vips__bandalike_vec( const char *domain, +- VipsImage **in, VipsImage **out, int n, int base_bands ); ++int vips__formatalike_vec(VipsImage **in, VipsImage **out, int n); ++int vips__sizealike_vec(VipsImage **in, VipsImage **out, int n); ++int vips__bandup(const char *domain, VipsImage *in, VipsImage **out, int n); ++int vips__bandalike_vec(const char *domain, ++ VipsImage **in, VipsImage **out, int n, int base_bands); + +-int vips__formatalike( VipsImage *in1, VipsImage *in2, +- VipsImage **out1, VipsImage **out2 ); +-int vips__sizealike( VipsImage *in1, VipsImage *in2, +- VipsImage **out1, VipsImage **out2 ); +-int vips__bandalike( const char *domain, +- VipsImage *in1, VipsImage *in2, VipsImage **out1, VipsImage **out2 ); ++int vips__formatalike(VipsImage *in1, VipsImage *in2, ++ VipsImage **out1, VipsImage **out2); ++int vips__sizealike(VipsImage *in1, VipsImage *in2, ++ VipsImage **out1, VipsImage **out2); ++int vips__bandalike(const char *domain, ++ VipsImage *in1, VipsImage *in2, VipsImage **out1, VipsImage **out2); + + /* draw + */ +-VipsPel *vips__vector_to_pels( const char *domain, +- int bands, VipsBandFormat format, VipsCoding coding, +- double *real, double *imag, int n ); ++VipsPel *vips__vector_to_pels(const char *domain, ++ int bands, VipsBandFormat format, VipsCoding coding, ++ double *real, double *imag, int n); + /* TODO(kleisauke): VIPS_API is required by the poppler module. + */ + VIPS_API +-VipsPel *vips__vector_to_ink( const char *domain, +- VipsImage *im, double *real, double *imag, int n ); ++VipsPel *vips__vector_to_ink(const char *domain, ++ VipsImage *im, double *real, double *imag, int n); + +-int vips__draw_flood_direct( VipsImage *image, VipsImage *test, +- int serial, int x, int y ); +-int vips__draw_mask_direct( VipsImage *image, VipsImage *mask, +- VipsPel *ink, int x, int y ); ++int vips__draw_flood_direct(VipsImage *image, VipsImage *test, ++ int serial, int x, int y); ++int vips__draw_mask_direct(VipsImage *image, VipsImage *mask, ++ VipsPel *ink, int x, int y); + +-typedef void (*VipsDrawPoint)( VipsImage *image, +- int x, int y, void *client ); +-typedef void (*VipsDrawScanline)( VipsImage *image, +- int y, int x1, int x2, int quadrant, void *client ); ++typedef void (*VipsDrawPoint)(VipsImage *image, ++ int x, int y, void *client); ++typedef void (*VipsDrawScanline)(VipsImage *image, ++ int y, int x1, int x2, int quadrant, void *client); + +-void vips__draw_line_direct( VipsImage *image, int x1, int y1, int x2, int y2, +- VipsDrawPoint draw_point, void *client ); +-void vips__draw_circle_direct( VipsImage *image, int cx, int cy, int r, +- VipsDrawScanline draw_scanline, void *client ); ++void vips__draw_line_direct(VipsImage *image, int x1, int y1, int x2, int y2, ++ VipsDrawPoint draw_point, void *client); ++void vips__draw_circle_direct(VipsImage *image, int cx, int cy, int r, ++ VipsDrawScanline draw_scanline, void *client); + +-int vips__insert_just_one( VipsRegion *out, VipsRegion *in, int x, int y ); +-int vips__insert_paste_region( VipsRegion *out, VipsRegion *in, VipsRect *pos ); ++int vips__insert_just_one(VipsRegion *out, VipsRegion *in, int x, int y); ++int vips__insert_paste_region(VipsRegion *out, VipsRegion *in, VipsRect *pos); + + /* Register base vips interpolators, called during startup. + */ +-void vips__interpolate_init( void ); ++void vips__interpolate_init(void); + + /* Start up various packages. + */ +-void vips_arithmetic_operation_init( void ); +-void vips_conversion_operation_init( void ); +-void vips_resample_operation_init( void ); +-void vips_foreign_operation_init( void ); +-void vips_colour_operation_init( void ); +-void vips_histogram_operation_init( void ); +-void vips_freqfilt_operation_init( void ); +-void vips_create_operation_init( void ); +-void vips_morphology_operation_init( void ); +-void vips_convolution_operation_init( void ); +-void vips_draw_operation_init( void ); +-void vips_mosaicing_operation_init( void ); +-void vips_cimg_operation_init( void ); +- +-guint64 vips__parse_size( const char *size_string ); ++void vips_arithmetic_operation_init(void); ++void vips_conversion_operation_init(void); ++void vips_resample_operation_init(void); ++void vips_foreign_operation_init(void); ++void vips_colour_operation_init(void); ++void vips_histogram_operation_init(void); ++void vips_freqfilt_operation_init(void); ++void vips_create_operation_init(void); ++void vips_morphology_operation_init(void); ++void vips_convolution_operation_init(void); ++void vips_draw_operation_init(void); ++void vips_mosaicing_operation_init(void); ++void vips_cimg_operation_init(void); ++ ++guint64 vips__parse_size(const char *size_string); + /* TODO(kleisauke): VIPS_API is required by vipsthumbnail. + */ + VIPS_API +-int vips__substitute( char *buf, size_t len, char *sub ); ++int vips__substitute(char *buf, size_t len, char *sub); + +-int vips_check_coding_labq( const char *domain, VipsImage *im ); +-int vips_check_coding_rad( const char *domain, VipsImage *im ); +-int vips_check_bands_3ormore( const char *domain, VipsImage *im ); ++int vips_check_coding_labq(const char *domain, VipsImage *im); ++int vips_check_coding_rad(const char *domain, VipsImage *im); ++int vips_check_bands_3ormore(const char *domain, VipsImage *im); + +-int vips__byteswap_bool( VipsImage *in, VipsImage **out, gboolean swap ); ++int vips__byteswap_bool(VipsImage *in, VipsImage **out, gboolean swap); + +-char *vips__xml_properties( VipsImage *image ); ++char *vips__xml_properties(VipsImage *image); + + /* TODO(kleisauke): VIPS_API is required by the poppler module. + */ + VIPS_API +-void vips__premultiplied_bgra2rgba( guint32 * restrict p, int n ); ++void vips__premultiplied_bgra2rgba(guint32 *restrict p, int n); + VIPS_API +-void vips__rgba2bgra_premultiplied( guint32 * restrict p, int n ); +-void vips__bgra2rgba( guint32 * restrict p, int n ); +-void vips__Lab2LabQ_vec( VipsPel *out, float *in, int width ); +-void vips__LabQ2Lab_vec( float *out, VipsPel *in, int width ); ++void vips__rgba2bgra_premultiplied(guint32 *restrict p, int n); ++void vips__bgra2rgba(guint32 *restrict p, int n); ++void vips__Lab2LabQ_vec(VipsPel *out, float *in, int width); ++void vips__LabQ2Lab_vec(float *out, VipsPel *in, int width); + + #ifdef DEBUG_LEAK + extern GQuark vips__image_pixels_quark; + #endif /*DEBUG_LEAK*/ + +-/* With DEBUG_LEAK, hang one of these off each image and count pixels ++/* With DEBUG_LEAK, hang one of these off each image and count pixels + * calculated. + */ + typedef struct _VipsImagePixels { +- const char *nickname; +- gint64 tpels; /* Number of pels we expect to calculate */ +- gint64 npels; /* Number of pels calculated so far */ ++ const char *nickname; ++ gint64 tpels; /* Number of pels we expect to calculate */ ++ gint64 npels; /* Number of pels calculated so far */ + } VipsImagePixels; + +-int vips__foreign_convert_saveable( VipsImage *in, VipsImage **ready, ++int vips__foreign_convert_saveable(VipsImage *in, VipsImage **ready, + VipsSaveable saveable, VipsBandFormat *format, VipsCoding *coding, +- VipsArrayDouble *background ); ++ VipsArrayDouble *background); + +-int vips_foreign_load( const char *filename, VipsImage **out, ... ) ++int vips_foreign_load(const char *filename, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; +-int vips_foreign_save( VipsImage *in, const char *filename, ... ) ++int vips_foreign_save(VipsImage *in, const char *filename, ...) + G_GNUC_NULL_TERMINATED; + +-int vips__image_intize( VipsImage *in, VipsImage **out ); ++int vips__image_intize(VipsImage *in, VipsImage **out); + +-void vips__reorder_init( void ); +-int vips__reorder_set_input( VipsImage *image, VipsImage **in ); +-void vips__reorder_clear( VipsImage *image ); ++void vips__reorder_init(void); ++int vips__reorder_set_input(VipsImage *image, VipsImage **in); ++void vips__reorder_clear(VipsImage *image); + + /* Window manager API. + */ +-VipsWindow *vips_window_take( VipsWindow *window, +- VipsImage *im, int top, int height ); ++VipsWindow *vips_window_take(VipsWindow *window, ++ VipsImage *im, int top, int height); + +-int vips__profile_set( VipsImage *image, const char *name ); ++int vips__profile_set(VipsImage *image, const char *name); + +-int vips__lrmosaic( VipsImage *ref, VipsImage *sec, VipsImage *out, ++int vips__lrmosaic(VipsImage *ref, VipsImage *sec, VipsImage *out, + int bandno, + int xref, int yref, int xsec, int ysec, + int hwindowsize, int hsearchsize, +- int mwidth ); ++ int mwidth); + +-int vips__tbmosaic( VipsImage *ref, VipsImage *sec, VipsImage *out, ++int vips__tbmosaic(VipsImage *ref, VipsImage *sec, VipsImage *out, + int bandno, + int xref, int yref, int xsec, int ysec, + int hwindowsize, int hsearchsize, +- int mwidth ); ++ int mwidth); + +-int vips__correl( VipsImage *ref, VipsImage *sec, ++int vips__correl(VipsImage *ref, VipsImage *sec, + int xref, int yref, int xsec, int ysec, + int hwindowsize, int hsearchsize, +- double *correlation, int *x, int *y ); ++ double *correlation, int *x, int *y); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/interpolate.h b/libvips/include/vips/interpolate.h +index 2d7b9baad5..fa942ae445 100644 +--- a/libvips/include/vips/interpolate.h ++++ b/libvips/include/vips/interpolate.h +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,19 +43,19 @@ extern "C" { + #endif /*__cplusplus*/ + + #define VIPS_TYPE_INTERPOLATE (vips_interpolate_get_type()) +-#define VIPS_INTERPOLATE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_INTERPOLATE, VipsInterpolate )) +-#define VIPS_INTERPOLATE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_INTERPOLATE, VipsInterpolateClass)) +-#define VIPS_IS_INTERPOLATE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_INTERPOLATE )) +-#define VIPS_IS_INTERPOLATE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_INTERPOLATE )) +-#define VIPS_INTERPOLATE_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_INTERPOLATE, VipsInterpolateClass )) ++#define VIPS_INTERPOLATE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_INTERPOLATE, VipsInterpolate)) ++#define VIPS_INTERPOLATE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_INTERPOLATE, VipsInterpolateClass)) ++#define VIPS_IS_INTERPOLATE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_INTERPOLATE)) ++#define VIPS_IS_INTERPOLATE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_INTERPOLATE)) ++#define VIPS_INTERPOLATE_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_INTERPOLATE, VipsInterpolateClass)) + + typedef struct _VipsInterpolate { + VipsObject parent_object; +@@ -66,8 +66,8 @@ typedef struct _VipsInterpolate { + * function for it to speed up dispatch. Write to the memory at "out", + * interpolate the value at position (x, y) in "in". + */ +-typedef void (*VipsInterpolateMethod)( VipsInterpolate *interpolate, +- void *out, VipsRegion *in, double x, double y ); ++typedef void (*VipsInterpolateMethod)(VipsInterpolate *interpolate, ++ void *out, VipsRegion *in, double x, double y); + + typedef struct _VipsInterpolateClass { + VipsObjectClass parent_class; +@@ -79,7 +79,7 @@ typedef struct _VipsInterpolateClass { + + /* This interpolator needs a window this many pixels across and down. + */ +- int (*get_window_size)( VipsInterpolate *interpolate ); ++ int (*get_window_size)(VipsInterpolate *interpolate); + + /* Or just set this if you want a constant. + */ +@@ -88,7 +88,7 @@ typedef struct _VipsInterpolateClass { + /* Stencils are offset by this much. Default to window_size / 2 - 1 + * (centering) if get_window_offset is NULL and window_offset is -1. + */ +- int (*get_window_offset)( VipsInterpolate *interpolate ); ++ int (*get_window_offset)(VipsInterpolate *interpolate); + int window_offset; + } VipsInterpolateClass; + +@@ -97,14 +97,14 @@ typedef struct _VipsInterpolateClass { + VIPS_API + GType vips_interpolate_get_type(void); + VIPS_API +-void vips_interpolate( VipsInterpolate *interpolate, +- void *out, VipsRegion *in, double x, double y ); ++void vips_interpolate(VipsInterpolate *interpolate, ++ void *out, VipsRegion *in, double x, double y); + VIPS_API +-VipsInterpolateMethod vips_interpolate_get_method( VipsInterpolate *interpolate ); ++VipsInterpolateMethod vips_interpolate_get_method(VipsInterpolate *interpolate); + VIPS_API +-int vips_interpolate_get_window_size( VipsInterpolate *interpolate ); ++int vips_interpolate_get_window_size(VipsInterpolate *interpolate); + VIPS_API +-int vips_interpolate_get_window_offset( VipsInterpolate *interpolate ); ++int vips_interpolate_get_window_offset(VipsInterpolate *interpolate); + + /* How many bits of precision we keep for transformations, ie. how many + * pre-computed matricies we have. +@@ -123,19 +123,18 @@ int vips_interpolate_get_window_offset( VipsInterpolate *interpolate ); + /* Convenience: return static interpolators, no need to unref. + */ + VIPS_API +-VipsInterpolate *vips_interpolate_nearest_static( void ); ++VipsInterpolate *vips_interpolate_nearest_static(void); + VIPS_API +-VipsInterpolate *vips_interpolate_bilinear_static( void ); ++VipsInterpolate *vips_interpolate_bilinear_static(void); + + /* Convenience: make an interpolator from a nickname. g_object_unref() when + * you're done with it. + */ + VIPS_API +-VipsInterpolate *vips_interpolate_new( const char *nickname ); ++VipsInterpolate *vips_interpolate_new(const char *nickname); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_INTERPOLATE_H*/ +- +diff --git a/libvips/include/vips/mask.h b/libvips/include/vips/mask.h +index 6bd2c02ba1..5d2c073d44 100644 +--- a/libvips/include/vips/mask.h ++++ b/libvips/include/vips/mask.h +@@ -9,28 +9,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -59,102 +59,102 @@ typedef struct im__DOUBLEMASK { + char *filename; + } DOUBLEMASK; + +-#define IM_MASK( M, X, Y ) ((M)->coeff[(X) + (Y) * (M)->xsize]) ++#define IM_MASK(M, X, Y) ((M)->coeff[(X) + (Y) * (M)->xsize]) + + VIPS_DEPRECATED +-INTMASK *im_create_imask( const char *filename, int xsize, int ysize ); ++INTMASK *im_create_imask(const char *filename, int xsize, int ysize); + VIPS_DEPRECATED +-INTMASK *im_create_imaskv( const char *filename, int xsize, int ysize, ... ); ++INTMASK *im_create_imaskv(const char *filename, int xsize, int ysize, ...); + VIPS_DEPRECATED +-DOUBLEMASK *im_create_dmask( const char *filename, int xsize, int ysize ); ++DOUBLEMASK *im_create_dmask(const char *filename, int xsize, int ysize); + VIPS_DEPRECATED +-DOUBLEMASK *im_create_dmaskv( const char *filename, int xsize, int ysize, ... ); ++DOUBLEMASK *im_create_dmaskv(const char *filename, int xsize, int ysize, ...); + + VIPS_DEPRECATED +-INTMASK *im_read_imask( const char *filename ); ++INTMASK *im_read_imask(const char *filename); + VIPS_DEPRECATED +-DOUBLEMASK *im_read_dmask( const char *filename ); ++DOUBLEMASK *im_read_dmask(const char *filename); + + VIPS_DEPRECATED +-void im_print_imask( INTMASK *in ); ++void im_print_imask(INTMASK *in); + VIPS_DEPRECATED +-void im_print_dmask( DOUBLEMASK *in ); ++void im_print_dmask(DOUBLEMASK *in); + + VIPS_DEPRECATED +-int im_write_imask( INTMASK *in ); ++int im_write_imask(INTMASK *in); + VIPS_DEPRECATED +-int im_write_dmask( DOUBLEMASK *in ); ++int im_write_dmask(DOUBLEMASK *in); + VIPS_DEPRECATED +-int im_write_imask_name( INTMASK *in, const char *filename ); ++int im_write_imask_name(INTMASK *in, const char *filename); + VIPS_DEPRECATED +-int im_write_dmask_name( DOUBLEMASK *in, const char *filename ); ++int im_write_dmask_name(DOUBLEMASK *in, const char *filename); + + VIPS_DEPRECATED +-int im_free_imask( INTMASK *in ); ++int im_free_imask(INTMASK *in); + VIPS_DEPRECATED +-int im_free_dmask( DOUBLEMASK *in ); ++int im_free_dmask(DOUBLEMASK *in); + + VIPS_DEPRECATED +-INTMASK *im_log_imask( const char *filename, double sigma, double min_ampl ); ++INTMASK *im_log_imask(const char *filename, double sigma, double min_ampl); + VIPS_DEPRECATED +-DOUBLEMASK *im_log_dmask( const char *filename, double sigma, double min_ampl ); ++DOUBLEMASK *im_log_dmask(const char *filename, double sigma, double min_ampl); + + VIPS_DEPRECATED +-INTMASK *im_gauss_imask( const char *filename, double sigma, double min_ampl ); ++INTMASK *im_gauss_imask(const char *filename, double sigma, double min_ampl); + VIPS_DEPRECATED +-INTMASK *im_gauss_imask_sep( const char *filename, +- double sigma, double min_ampl ); ++INTMASK *im_gauss_imask_sep(const char *filename, ++ double sigma, double min_ampl); + VIPS_DEPRECATED +-DOUBLEMASK *im_gauss_dmask( const char *filename, +- double sigma, double min_ampl ); ++DOUBLEMASK *im_gauss_dmask(const char *filename, ++ double sigma, double min_ampl); + VIPS_DEPRECATED +-DOUBLEMASK *im_gauss_dmask_sep( const char *filename, +- double sigma, double min_ampl ); ++DOUBLEMASK *im_gauss_dmask_sep(const char *filename, ++ double sigma, double min_ampl); + + VIPS_DEPRECATED +-INTMASK *im_dup_imask( INTMASK *in, const char *filename ); ++INTMASK *im_dup_imask(INTMASK *in, const char *filename); + VIPS_DEPRECATED +-DOUBLEMASK *im_dup_dmask( DOUBLEMASK *in, const char *filename ); ++DOUBLEMASK *im_dup_dmask(DOUBLEMASK *in, const char *filename); + + VIPS_DEPRECATED +-INTMASK *im_scale_dmask( DOUBLEMASK *in, const char *filename ); ++INTMASK *im_scale_dmask(DOUBLEMASK *in, const char *filename); + VIPS_DEPRECATED +-void im_norm_dmask( DOUBLEMASK *mask ); ++void im_norm_dmask(DOUBLEMASK *mask); + VIPS_DEPRECATED +-DOUBLEMASK *im_imask2dmask( INTMASK *in, const char *filename ); ++DOUBLEMASK *im_imask2dmask(INTMASK *in, const char *filename); + VIPS_DEPRECATED +-INTMASK *im_dmask2imask( DOUBLEMASK *in, const char *filename ); ++INTMASK *im_dmask2imask(DOUBLEMASK *in, const char *filename); + + VIPS_DEPRECATED +-INTMASK *im_rotate_imask90( INTMASK *in, const char *filename ); ++INTMASK *im_rotate_imask90(INTMASK *in, const char *filename); + VIPS_DEPRECATED +-INTMASK *im_rotate_imask45( INTMASK *in, const char *filename ); ++INTMASK *im_rotate_imask45(INTMASK *in, const char *filename); + VIPS_DEPRECATED +-DOUBLEMASK *im_rotate_dmask90( DOUBLEMASK *in, const char *filename ); ++DOUBLEMASK *im_rotate_dmask90(DOUBLEMASK *in, const char *filename); + VIPS_DEPRECATED +-DOUBLEMASK *im_rotate_dmask45( DOUBLEMASK *in, const char *filename ); ++DOUBLEMASK *im_rotate_dmask45(DOUBLEMASK *in, const char *filename); + + VIPS_DEPRECATED +-DOUBLEMASK *im_mattrn( DOUBLEMASK *in, const char *filename ); ++DOUBLEMASK *im_mattrn(DOUBLEMASK *in, const char *filename); + VIPS_DEPRECATED +-DOUBLEMASK *im_matcat( DOUBLEMASK *top, DOUBLEMASK *bottom, +- const char *filename ); ++DOUBLEMASK *im_matcat(DOUBLEMASK *top, DOUBLEMASK *bottom, ++ const char *filename); + VIPS_DEPRECATED +-DOUBLEMASK *im_matmul( DOUBLEMASK *in1, DOUBLEMASK *in2, const char *filename ); ++DOUBLEMASK *im_matmul(DOUBLEMASK *in1, DOUBLEMASK *in2, const char *filename); + + VIPS_DEPRECATED +-DOUBLEMASK *im_lu_decomp( const DOUBLEMASK *mat, const char *filename ); ++DOUBLEMASK *im_lu_decomp(const DOUBLEMASK *mat, const char *filename); + VIPS_DEPRECATED +-int im_lu_solve( const DOUBLEMASK *lu, double *vec ); ++int im_lu_solve(const DOUBLEMASK *lu, double *vec); + VIPS_DEPRECATED +-DOUBLEMASK *im_matinv( const DOUBLEMASK *mat, const char *filename ); ++DOUBLEMASK *im_matinv(const DOUBLEMASK *mat, const char *filename); + VIPS_DEPRECATED +-int im_matinv_inplace( DOUBLEMASK *mat ); ++int im_matinv_inplace(DOUBLEMASK *mat); + + VIPS_DEPRECATED +-DOUBLEMASK *im_local_dmask( struct _VipsImage *out, DOUBLEMASK *mask ); ++DOUBLEMASK *im_local_dmask(struct _VipsImage *out, DOUBLEMASK *mask); + VIPS_DEPRECATED +-INTMASK *im_local_imask( struct _VipsImage *out, INTMASK *mask ); ++INTMASK *im_local_imask(struct _VipsImage *out, INTMASK *mask); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/memory.h b/libvips/include/vips/memory.h +index 4233c8cf3a..92fd167eda 100644 +--- a/libvips/include/vips/memory.h ++++ b/libvips/include/vips/memory.h +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -37,57 +37,62 @@ + extern "C" { + #endif /*__cplusplus*/ + +-#define VIPS_FREEF( F, S ) G_STMT_START { \ +- if( S ) { \ +- (void) F( (S) ); \ +- (S) = 0; \ +- } \ +-} G_STMT_END +- +-#define VIPS_FREE( S ) VIPS_FREEF( g_free, (S) ); +- +-#define VIPS_SETSTR( S, V ) \ +-G_STMT_START { \ +- const char *sst = (V); \ +- \ +- if( (S) != sst ) { \ +- if( !(S) || !sst || strcmp( (S), sst ) != 0 ) { \ +- VIPS_FREE( S ); \ +- if( sst ) \ +- (S) = g_strdup( sst ); \ +- } \ +- } \ +-} G_STMT_END +- +-#define VIPS_MALLOC( OBJ, S ) \ +- (vips_malloc( VIPS_OBJECT( OBJ ), S)) +-#define VIPS_NEW( OBJ, T ) \ +- ((T *) VIPS_MALLOC( OBJ, sizeof( T ))) +-#define VIPS_ARRAY( OBJ, N, T ) \ +- ((T *) VIPS_MALLOC( OBJ, (N) * sizeof( T ))) ++#define VIPS_FREEF(F, S) \ ++ G_STMT_START \ ++ { \ ++ if (S) { \ ++ (void) F((S)); \ ++ (S) = 0; \ ++ } \ ++ } \ ++ G_STMT_END ++ ++#define VIPS_FREE(S) VIPS_FREEF(g_free, (S)); ++ ++#define VIPS_SETSTR(S, V) \ ++ G_STMT_START \ ++ { \ ++ const char *sst = (V); \ ++\ ++ if ((S) != sst) { \ ++ if (!(S) || !sst || strcmp((S), sst) != 0) { \ ++ VIPS_FREE(S); \ ++ if (sst) \ ++ (S) = g_strdup(sst); \ ++ } \ ++ } \ ++ } \ ++ G_STMT_END ++ ++#define VIPS_MALLOC(OBJ, S) \ ++ (vips_malloc(VIPS_OBJECT(OBJ), S)) ++#define VIPS_NEW(OBJ, T) \ ++ ((T *) VIPS_MALLOC(OBJ, sizeof(T))) ++#define VIPS_ARRAY(OBJ, N, T) \ ++ ((T *) VIPS_MALLOC(OBJ, (N) * sizeof(T))) + + VIPS_API +-void *vips_malloc( VipsObject *object, size_t size ); ++void *vips_malloc(VipsObject *object, size_t size); + VIPS_API +-char *vips_strdup( VipsObject *object, const char *str ); ++char *vips_strdup(VipsObject *object, const char *str); + + VIPS_API +-void vips_tracked_free( void *s ); ++void vips_tracked_free(void *s); + VIPS_API +-void *vips_tracked_malloc( size_t size ); ++void *vips_tracked_malloc(size_t size); + VIPS_API +-size_t vips_tracked_get_mem( void ); ++size_t vips_tracked_get_mem(void); + VIPS_API +-size_t vips_tracked_get_mem_highwater( void ); ++size_t vips_tracked_get_mem_highwater(void); + VIPS_API +-int vips_tracked_get_allocs( void ); ++int vips_tracked_get_allocs(void); + + VIPS_API +-int vips_tracked_open( const char *pathname, int flags, int mode ); ++int vips_tracked_open(const char *pathname, int flags, int mode); + VIPS_API +-int vips_tracked_close( int fd ); ++int vips_tracked_close(int fd); + VIPS_API +-int vips_tracked_get_files( void ); ++int vips_tracked_get_files(void); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/morphology.h b/libvips/include/vips/morphology.h +index e14220f05c..918b0ce3d4 100644 +--- a/libvips/include/vips/morphology.h ++++ b/libvips/include/vips/morphology.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -45,25 +45,25 @@ typedef enum { + } VipsOperationMorphology; + + VIPS_API +-int vips_morph( VipsImage *in, VipsImage **out, VipsImage *mask, +- VipsOperationMorphology morph, ... ) ++int vips_morph(VipsImage *in, VipsImage **out, VipsImage *mask, ++ VipsOperationMorphology morph, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_rank( VipsImage *in, VipsImage **out, +- int width, int height, int index, ... ) ++int vips_rank(VipsImage *in, VipsImage **out, ++ int width, int height, int index, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_median( VipsImage *in, VipsImage **out, int size, ... ) ++int vips_median(VipsImage *in, VipsImage **out, int size, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_countlines( VipsImage *in, double *nolines, +- VipsDirection direction, ... ) ++int vips_countlines(VipsImage *in, double *nolines, ++ VipsDirection direction, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_labelregions( VipsImage *in, VipsImage **mask, ... ) ++int vips_labelregions(VipsImage *in, VipsImage **mask, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_fill_nearest( VipsImage *in, VipsImage **out, ... ) ++int vips_fill_nearest(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + + #ifdef __cplusplus +diff --git a/libvips/include/vips/mosaicing.h b/libvips/include/vips/mosaicing.h +index a7cd17188d..28388a55c4 100644 +--- a/libvips/include/vips/mosaicing.h ++++ b/libvips/include/vips/mosaicing.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -39,40 +39,39 @@ extern "C" { + #endif /*__cplusplus*/ + + VIPS_API +-int vips_merge( VipsImage *ref, VipsImage *sec, VipsImage **out, +- VipsDirection direction, int dx, int dy, ... ) ++int vips_merge(VipsImage *ref, VipsImage *sec, VipsImage **out, ++ VipsDirection direction, int dx, int dy, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_mosaic( VipsImage *ref, VipsImage *sec, VipsImage **out, +- VipsDirection direction, int xref, int yref, int xsec, int ysec, ... ) ++int vips_mosaic(VipsImage *ref, VipsImage *sec, VipsImage **out, ++ VipsDirection direction, int xref, int yref, int xsec, int ysec, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_mosaic1( VipsImage *ref, VipsImage *sec, VipsImage **out, +- VipsDirection direction, +- int xr1, int yr1, int xs1, int ys1, +- int xr2, int yr2, int xs2, int ys2, ... ) ++int vips_mosaic1(VipsImage *ref, VipsImage *sec, VipsImage **out, ++ VipsDirection direction, ++ int xr1, int yr1, int xs1, int ys1, ++ int xr2, int yr2, int xs2, int ys2, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_match( VipsImage *ref, VipsImage *sec, VipsImage **out, +- int xr1, int yr1, int xs1, int ys1, +- int xr2, int yr2, int xs2, int ys2, ... ) ++int vips_match(VipsImage *ref, VipsImage *sec, VipsImage **out, ++ int xr1, int yr1, int xs1, int ys1, ++ int xr2, int yr2, int xs2, int ys2, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_globalbalance( VipsImage *in, VipsImage **out, ... ) ++int vips_globalbalance(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_remosaic( VipsImage *in, VipsImage **out, +- const char *old_str, const char *new_str, ... ) ++int vips_remosaic(VipsImage *in, VipsImage **out, ++ const char *old_str, const char *new_str, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_matrixinvert( VipsImage *m, VipsImage **out, ... ) ++int vips_matrixinvert(VipsImage *m, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + +- + #ifdef __cplusplus + } + #endif /*__cplusplus*/ +diff --git a/libvips/include/vips/object.h b/libvips/include/vips/object.h +index 4cb6717e3f..f831fc3c54 100644 +--- a/libvips/include/vips/object.h ++++ b/libvips/include/vips/object.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2003 The National Gallery ++ Copyright (C) 1991-2003 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,15 +43,18 @@ extern "C" { + /* Handy! + */ + #ifdef VIPS_DEBUG +-#define VIPS_UNREF( X ) G_STMT_START { \ +- if( X ) { \ +- g_assert( G_OBJECT( X )->ref_count > 0 ); \ +- g_object_unref( X ); \ +- (X) = 0; \ ++#define VIPS_UNREF(X) \ ++ G_STMT_START \ ++ { \ ++ if (X) { \ ++ g_assert(G_OBJECT(X)->ref_count > 0); \ ++ g_object_unref(X); \ ++ (X) = 0; \ ++ } \ + } \ +-} G_STMT_END ++ G_STMT_END + #else /*!VIPS_DEBUG*/ +-#define VIPS_UNREF( X ) VIPS_FREEF( g_object_unref, (X) ) ++#define VIPS_UNREF(X) VIPS_FREEF(g_object_unref, (X)) + #endif /*VIPS_DEBUG*/ + + typedef struct _VipsObject VipsObject; +@@ -82,175 +85,186 @@ VIPS_ARGUMENT_REQUIRED_OUTPUT Eg. the "result" of an add operation + + VIPS_ARGUMENT_OPTIONAL_OUTPUT Eg. the x pos of the image minimum + +- Other combinations are used internally, eg. supplying the cast-table for an ++ Other combinations are used internally, eg. supplying the cast-table for an + arithmetic operation + + */ + + #define VIPS_ARGUMENT_REQUIRED_INPUT \ + (VIPS_ARGUMENT_INPUT | \ +- VIPS_ARGUMENT_REQUIRED | \ +- VIPS_ARGUMENT_CONSTRUCT) ++ VIPS_ARGUMENT_REQUIRED | \ ++ VIPS_ARGUMENT_CONSTRUCT) + + #define VIPS_ARGUMENT_OPTIONAL_INPUT \ + (VIPS_ARGUMENT_INPUT | \ +- VIPS_ARGUMENT_CONSTRUCT) ++ VIPS_ARGUMENT_CONSTRUCT) + + #define VIPS_ARGUMENT_REQUIRED_OUTPUT \ + (VIPS_ARGUMENT_OUTPUT | \ +- VIPS_ARGUMENT_REQUIRED | \ +- VIPS_ARGUMENT_CONSTRUCT) ++ VIPS_ARGUMENT_REQUIRED | \ ++ VIPS_ARGUMENT_CONSTRUCT) + + #define VIPS_ARGUMENT_OPTIONAL_OUTPUT \ + (VIPS_ARGUMENT_OUTPUT | \ +- VIPS_ARGUMENT_CONSTRUCT) +- +-#define VIPS_ARG_IMAGE( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET ) { \ +- GParamSpec *pspec; \ +- \ +- pspec = g_param_spec_object( (NAME), (LONG), (DESC), \ +- VIPS_TYPE_IMAGE, \ +- (GParamFlags) (G_PARAM_READWRITE) ); \ +- g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \ +- vips_argument_get_id(), pspec ); \ +- vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \ +- pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \ +-} +- +-#define VIPS_ARG_OBJECT( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET, TYPE ) { \ +- GParamSpec *pspec; \ +- \ +- pspec = g_param_spec_object( (NAME), (LONG), (DESC), \ +- TYPE, \ +- (GParamFlags) (G_PARAM_READWRITE) ); \ +- g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \ +- vips_argument_get_id(), pspec ); \ +- vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \ +- pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \ +-} +- +-#define VIPS_ARG_INTERPOLATE( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET ) \ +- VIPS_ARG_OBJECT( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET, VIPS_TYPE_INTERPOLATE ) +- +-#define VIPS_ARG_BOOL( CLASS, NAME, PRIORITY, LONG, DESC, \ +- FLAGS, OFFSET, VALUE ) { \ +- GParamSpec *pspec; \ +- \ +- pspec = g_param_spec_boolean( (NAME), (LONG), (DESC), \ +- (VALUE), \ +- (GParamFlags) (G_PARAM_READWRITE) ); \ +- g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \ +- vips_argument_get_id(), pspec ); \ +- vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \ +- pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \ +-} +- +-#define VIPS_ARG_DOUBLE( CLASS, NAME, PRIORITY, LONG, DESC, \ +- FLAGS, OFFSET, MIN, MAX, VALUE ) { \ +- GParamSpec *pspec; \ +- \ +- pspec = g_param_spec_double( (NAME), (LONG), (DESC), \ +- (MIN), (MAX), (VALUE), \ +- (GParamFlags) (G_PARAM_READWRITE) );\ +- g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \ +- vips_argument_get_id(), pspec ); \ +- vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \ +- pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \ +-} +- +-#define VIPS_ARG_BOXED( CLASS, NAME, PRIORITY, LONG, DESC, \ +- FLAGS, OFFSET, TYPE ) { \ +- GParamSpec *pspec; \ +- \ +- pspec = g_param_spec_boxed( (NAME), (LONG), (DESC), \ +- (TYPE), \ +- (GParamFlags) (G_PARAM_READWRITE) );\ +- g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \ +- vips_argument_get_id(), pspec ); \ +- vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \ +- pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \ +-} +- +-#define VIPS_ARG_INT( CLASS, NAME, PRIORITY, LONG, DESC, \ +- FLAGS, OFFSET, MIN, MAX, VALUE ) { \ +- GParamSpec *pspec; \ +- \ +- pspec = g_param_spec_int( (NAME), (LONG), (DESC), \ +- (MIN), (MAX), (VALUE), \ +- (GParamFlags) (G_PARAM_READWRITE) );\ +- g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \ +- vips_argument_get_id(), pspec ); \ +- vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \ +- pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \ +-} +- +-#define VIPS_ARG_UINT64( CLASS, NAME, PRIORITY, LONG, DESC, \ +- FLAGS, OFFSET, MIN, MAX, VALUE ) { \ +- GParamSpec *pspec; \ +- \ +- pspec = g_param_spec_uint64( (NAME), (LONG), (DESC), \ +- (MIN), (MAX), (VALUE), \ +- (GParamFlags) (G_PARAM_READWRITE) );\ +- g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \ +- vips_argument_get_id(), pspec ); \ +- vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \ +- pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \ +-} +- +-#define VIPS_ARG_ENUM( CLASS, NAME, PRIORITY, LONG, DESC, \ +- FLAGS, OFFSET, TYPE, VALUE ) { \ +- GParamSpec *pspec; \ +- \ +- pspec = g_param_spec_enum( (NAME), (LONG), (DESC), \ +- (TYPE), (VALUE), \ +- (GParamFlags) (G_PARAM_READWRITE) );\ +- g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \ +- vips_argument_get_id(), pspec ); \ +- vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \ +- pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \ +-} +- +-#define VIPS_ARG_FLAGS( CLASS, NAME, PRIORITY, LONG, DESC, \ +- FLAGS, OFFSET, TYPE, VALUE ) { \ +- GParamSpec *pspec; \ +- \ +- pspec = g_param_spec_flags( (NAME), (LONG), (DESC), \ +- (TYPE), (VALUE), \ +- (GParamFlags) (G_PARAM_READWRITE) );\ +- g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \ +- vips_argument_get_id(), pspec ); \ +- vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \ +- pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \ +-} +- +-#define VIPS_ARG_STRING( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET, \ +- VALUE ) { \ +- GParamSpec *pspec; \ +- \ +- pspec = g_param_spec_string( (NAME), (LONG), (DESC), \ +- (VALUE), \ +- (GParamFlags) (G_PARAM_READWRITE) ); \ +- g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \ +- vips_argument_get_id(), pspec ); \ +- vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \ +- pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \ +-} +- +-#define VIPS_ARG_POINTER( CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET ) { \ +- GParamSpec *pspec; \ +- \ +- pspec = g_param_spec_pointer( (NAME), (LONG), (DESC), \ +- (GParamFlags) (G_PARAM_READWRITE) ); \ +- g_object_class_install_property( G_OBJECT_CLASS( CLASS ), \ +- vips_argument_get_id(), pspec ); \ +- vips_object_class_install_argument( VIPS_OBJECT_CLASS( CLASS ), \ +- pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET) ); \ +-} ++ VIPS_ARGUMENT_CONSTRUCT) ++ ++#define VIPS_ARG_IMAGE(CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET) \ ++ { \ ++ GParamSpec *pspec; \ ++\ ++ pspec = g_param_spec_object((NAME), (LONG), (DESC), \ ++ VIPS_TYPE_IMAGE, \ ++ (GParamFlags) (G_PARAM_READWRITE)); \ ++ g_object_class_install_property(G_OBJECT_CLASS(CLASS), \ ++ vips_argument_get_id(), pspec); \ ++ vips_object_class_install_argument(VIPS_OBJECT_CLASS(CLASS), \ ++ pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET)); \ ++ } ++ ++#define VIPS_ARG_OBJECT(CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET, TYPE) \ ++ { \ ++ GParamSpec *pspec; \ ++\ ++ pspec = g_param_spec_object((NAME), (LONG), (DESC), \ ++ TYPE, \ ++ (GParamFlags) (G_PARAM_READWRITE)); \ ++ g_object_class_install_property(G_OBJECT_CLASS(CLASS), \ ++ vips_argument_get_id(), pspec); \ ++ vips_object_class_install_argument(VIPS_OBJECT_CLASS(CLASS), \ ++ pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET)); \ ++ } ++ ++#define VIPS_ARG_INTERPOLATE(CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET) \ ++ VIPS_ARG_OBJECT(CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET, VIPS_TYPE_INTERPOLATE) ++ ++#define VIPS_ARG_BOOL(CLASS, NAME, PRIORITY, LONG, DESC, \ ++ FLAGS, OFFSET, VALUE) \ ++ { \ ++ GParamSpec *pspec; \ ++\ ++ pspec = g_param_spec_boolean((NAME), (LONG), (DESC), \ ++ (VALUE), \ ++ (GParamFlags) (G_PARAM_READWRITE)); \ ++ g_object_class_install_property(G_OBJECT_CLASS(CLASS), \ ++ vips_argument_get_id(), pspec); \ ++ vips_object_class_install_argument(VIPS_OBJECT_CLASS(CLASS), \ ++ pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET)); \ ++ } ++ ++#define VIPS_ARG_DOUBLE(CLASS, NAME, PRIORITY, LONG, DESC, \ ++ FLAGS, OFFSET, MIN, MAX, VALUE) \ ++ { \ ++ GParamSpec *pspec; \ ++\ ++ pspec = g_param_spec_double((NAME), (LONG), (DESC), \ ++ (MIN), (MAX), (VALUE), \ ++ (GParamFlags) (G_PARAM_READWRITE)); \ ++ g_object_class_install_property(G_OBJECT_CLASS(CLASS), \ ++ vips_argument_get_id(), pspec); \ ++ vips_object_class_install_argument(VIPS_OBJECT_CLASS(CLASS), \ ++ pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET)); \ ++ } ++ ++#define VIPS_ARG_BOXED(CLASS, NAME, PRIORITY, LONG, DESC, \ ++ FLAGS, OFFSET, TYPE) \ ++ { \ ++ GParamSpec *pspec; \ ++\ ++ pspec = g_param_spec_boxed((NAME), (LONG), (DESC), \ ++ (TYPE), \ ++ (GParamFlags) (G_PARAM_READWRITE)); \ ++ g_object_class_install_property(G_OBJECT_CLASS(CLASS), \ ++ vips_argument_get_id(), pspec); \ ++ vips_object_class_install_argument(VIPS_OBJECT_CLASS(CLASS), \ ++ pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET)); \ ++ } ++ ++#define VIPS_ARG_INT(CLASS, NAME, PRIORITY, LONG, DESC, \ ++ FLAGS, OFFSET, MIN, MAX, VALUE) \ ++ { \ ++ GParamSpec *pspec; \ ++\ ++ pspec = g_param_spec_int((NAME), (LONG), (DESC), \ ++ (MIN), (MAX), (VALUE), \ ++ (GParamFlags) (G_PARAM_READWRITE)); \ ++ g_object_class_install_property(G_OBJECT_CLASS(CLASS), \ ++ vips_argument_get_id(), pspec); \ ++ vips_object_class_install_argument(VIPS_OBJECT_CLASS(CLASS), \ ++ pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET)); \ ++ } ++ ++#define VIPS_ARG_UINT64(CLASS, NAME, PRIORITY, LONG, DESC, \ ++ FLAGS, OFFSET, MIN, MAX, VALUE) \ ++ { \ ++ GParamSpec *pspec; \ ++\ ++ pspec = g_param_spec_uint64((NAME), (LONG), (DESC), \ ++ (MIN), (MAX), (VALUE), \ ++ (GParamFlags) (G_PARAM_READWRITE)); \ ++ g_object_class_install_property(G_OBJECT_CLASS(CLASS), \ ++ vips_argument_get_id(), pspec); \ ++ vips_object_class_install_argument(VIPS_OBJECT_CLASS(CLASS), \ ++ pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET)); \ ++ } ++ ++#define VIPS_ARG_ENUM(CLASS, NAME, PRIORITY, LONG, DESC, \ ++ FLAGS, OFFSET, TYPE, VALUE) \ ++ { \ ++ GParamSpec *pspec; \ ++\ ++ pspec = g_param_spec_enum((NAME), (LONG), (DESC), \ ++ (TYPE), (VALUE), \ ++ (GParamFlags) (G_PARAM_READWRITE)); \ ++ g_object_class_install_property(G_OBJECT_CLASS(CLASS), \ ++ vips_argument_get_id(), pspec); \ ++ vips_object_class_install_argument(VIPS_OBJECT_CLASS(CLASS), \ ++ pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET)); \ ++ } ++ ++#define VIPS_ARG_FLAGS(CLASS, NAME, PRIORITY, LONG, DESC, \ ++ FLAGS, OFFSET, TYPE, VALUE) \ ++ { \ ++ GParamSpec *pspec; \ ++\ ++ pspec = g_param_spec_flags((NAME), (LONG), (DESC), \ ++ (TYPE), (VALUE), \ ++ (GParamFlags) (G_PARAM_READWRITE)); \ ++ g_object_class_install_property(G_OBJECT_CLASS(CLASS), \ ++ vips_argument_get_id(), pspec); \ ++ vips_object_class_install_argument(VIPS_OBJECT_CLASS(CLASS), \ ++ pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET)); \ ++ } ++ ++#define VIPS_ARG_STRING(CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET, \ ++ VALUE) \ ++ { \ ++ GParamSpec *pspec; \ ++\ ++ pspec = g_param_spec_string((NAME), (LONG), (DESC), \ ++ (VALUE), \ ++ (GParamFlags) (G_PARAM_READWRITE)); \ ++ g_object_class_install_property(G_OBJECT_CLASS(CLASS), \ ++ vips_argument_get_id(), pspec); \ ++ vips_object_class_install_argument(VIPS_OBJECT_CLASS(CLASS), \ ++ pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET)); \ ++ } ++ ++#define VIPS_ARG_POINTER(CLASS, NAME, PRIORITY, LONG, DESC, FLAGS, OFFSET) \ ++ { \ ++ GParamSpec *pspec; \ ++\ ++ pspec = g_param_spec_pointer((NAME), (LONG), (DESC), \ ++ (GParamFlags) (G_PARAM_READWRITE)); \ ++ g_object_class_install_property(G_OBJECT_CLASS(CLASS), \ ++ vips_argument_get_id(), pspec); \ ++ vips_object_class_install_argument(VIPS_OBJECT_CLASS(CLASS), \ ++ pspec, (VipsArgumentFlags) (FLAGS), (PRIORITY), (OFFSET)); \ ++ } + + /* Keep one of these for every argument. + */ + typedef struct _VipsArgument { +- GParamSpec *pspec; /* pspec for this argument */ ++ GParamSpec *pspec; /* pspec for this argument */ + + /* More stuff, see below */ + } VipsArgument; +@@ -265,8 +279,8 @@ typedef struct _VipsArgumentClass { + VipsObjectClass *object_class; + + VipsArgumentFlags flags; +- int priority; /* Order args by this */ +- guint offset; /* G_STRUCT_OFFSET of member in object */ ++ int priority; /* Order args by this */ ++ guint offset; /* G_STRUCT_OFFSET of member in object */ + } VipsArgumentClass; + + /* Keep one of these in the object struct for every argument instance. +@@ -289,7 +303,7 @@ typedef struct _VipsArgumentInstance { + /* If this is an output argument, keep the id of our "close" handler + * here. + */ +- gulong close_id; ++ gulong close_id; + + /* We need to listen for "invalidate" on input images and send our own + * "invalidate" out. If we go, we need to disconnect. +@@ -303,59 +317,62 @@ typedef struct _VipsArgumentInstance { + typedef GHashTable VipsArgumentTable; + + VIPS_API +-int vips_argument_get_id( void ); +-void vips__object_set_member( VipsObject *object, GParamSpec *pspec, +- GObject **member, GObject *argument ); +-typedef void *(*VipsArgumentMapFn)( VipsObject *object, GParamSpec *pspec, +- VipsArgumentClass *argument_class, +- VipsArgumentInstance *argument_instance, void *a, void *b ); ++int vips_argument_get_id(void); ++void vips__object_set_member(VipsObject *object, GParamSpec *pspec, ++ GObject **member, GObject *argument); ++typedef void *(*VipsArgumentMapFn)(VipsObject *object, GParamSpec *pspec, ++ VipsArgumentClass *argument_class, ++ VipsArgumentInstance *argument_instance, void *a, void *b); + VIPS_API +-void *vips_argument_map( VipsObject *object, +- VipsArgumentMapFn fn, void *a, void *b ); ++void *vips_argument_map(VipsObject *object, ++ VipsArgumentMapFn fn, void *a, void *b); + VIPS_API +-int vips_object_get_args( VipsObject *object, +- const char ***names, int **flags, int *n_args ); +-typedef void *(*VipsArgumentClassMapFn)( VipsObjectClass *object_class, ++int vips_object_get_args(VipsObject *object, ++ const char ***names, int **flags, int *n_args); ++typedef void *(*VipsArgumentClassMapFn)(VipsObjectClass *object_class, + GParamSpec *pspec, +- VipsArgumentClass *argument_class, void *a, void *b ); ++ VipsArgumentClass *argument_class, void *a, void *b); + VIPS_API +-void *vips_argument_class_map( VipsObjectClass *object_class, +- VipsArgumentClassMapFn fn, void *a, void *b ); ++void *vips_argument_class_map(VipsObjectClass *object_class, ++ VipsArgumentClassMapFn fn, void *a, void *b); + VIPS_API +-gboolean vips_argument_class_needsstring( VipsArgumentClass *argument_class ); ++gboolean vips_argument_class_needsstring(VipsArgumentClass *argument_class); + VIPS_API +-int vips_object_get_argument( VipsObject *object, const char *name, ++int vips_object_get_argument(VipsObject *object, const char *name, + GParamSpec **pspec, + VipsArgumentClass **argument_class, +- VipsArgumentInstance **argument_instance ); ++ VipsArgumentInstance **argument_instance); + VIPS_API +-gboolean vips_object_argument_isset( VipsObject *object, const char *name ); ++gboolean vips_object_argument_isset(VipsObject *object, const char *name); + VIPS_API +-VipsArgumentFlags vips_object_get_argument_flags( VipsObject *object, +- const char *name ); ++VipsArgumentFlags vips_object_get_argument_flags(VipsObject *object, ++ const char *name); + VIPS_API +-int vips_object_get_argument_priority( VipsObject *object, const char *name ); ++int vips_object_get_argument_priority(VipsObject *object, const char *name); + + /* We have to loop over an objects args in several places, and we can't always + * use vips_argument_map(), the preferred looper. Have the loop code as a + * macro as well for these odd cases. + */ +-#define VIPS_ARGUMENT_FOR_ALL( OBJECT, PSPEC, ARG_CLASS, ARG_INSTANCE ) { \ +- VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( OBJECT ); \ +- GSList *p; \ +- \ +- for( p = object_class->argument_table_traverse; p; p = p->next ) { \ +- VipsArgumentClass *ARG_CLASS = \ +- (VipsArgumentClass *) p->data; \ +- VipsArgument *argument = (VipsArgument *) argument_class; \ +- GParamSpec *PSPEC = argument->pspec; \ +- VipsArgumentInstance *ARG_INSTANCE G_GNUC_UNUSED = \ +- vips__argument_get_instance( argument_class, \ +- VIPS_OBJECT( OBJECT ) ); \ +- +-#define VIPS_ARGUMENT_FOR_ALL_END } } +- +-/* And some macros to collect args from a va list. ++#define VIPS_ARGUMENT_FOR_ALL(OBJECT, PSPEC, ARG_CLASS, ARG_INSTANCE) \ ++ { \ ++ VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS(OBJECT); \ ++ GSList *p; \ ++\ ++ for (p = object_class->argument_table_traverse; p; p = p->next) { \ ++ VipsArgumentClass *ARG_CLASS = \ ++ (VipsArgumentClass *) p->data; \ ++ VipsArgument *argument = (VipsArgument *) argument_class; \ ++ GParamSpec *PSPEC = argument->pspec; \ ++ VipsArgumentInstance *ARG_INSTANCE G_GNUC_UNUSED = \ ++ vips__argument_get_instance(argument_class, \ ++ VIPS_OBJECT(OBJECT)); ++ ++#define VIPS_ARGUMENT_FOR_ALL_END \ ++ } \ ++ } ++ ++/* And some macros to collect args from a va list. + * + * Use something like this: + +@@ -369,7 +386,7 @@ int vips_object_get_argument_priority( VipsObject *object, const char *name ); + + VIPS_ARGUMENT_COLLECT_SET( pspec, argument_class, ap ); + +- GValue value holds the value of an input argument, do ++ GValue value holds the value of an input argument, do + something with it + + VIPS_ARGUMENT_COLLECT_GET( pspec, argument_class, ap ); +@@ -377,51 +394,54 @@ int vips_object_get_argument_priority( VipsObject *object, const char *name ); + void **arg points to where to write an output argument + + VIPS_ARGUMENT_COLLECT_END +- ++ + */ +-#define VIPS_ARGUMENT_COLLECT_SET( PSPEC, ARG_CLASS, AP ) \ +- if( (ARG_CLASS->flags & VIPS_ARGUMENT_INPUT) ) { \ +- GValue value = { 0, }; \ ++#define VIPS_ARGUMENT_COLLECT_SET(PSPEC, ARG_CLASS, AP) \ ++ if ((ARG_CLASS->flags & VIPS_ARGUMENT_INPUT)) { \ ++ GValue value = { \ ++ 0, \ ++ }; \ + gchar *error = NULL; \ +- \ +- /* Input args are given inline, eg. ("factor", 12.0) \ ++\ ++ /* Input args are given inline, eg. ("factor", 12.0) \ + * and must be collected. \ + */ \ +- G_VALUE_COLLECT_INIT( &value, \ +- G_PARAM_SPEC_VALUE_TYPE( PSPEC ), AP, 0, &error ); \ +- \ ++ G_VALUE_COLLECT_INIT(&value, \ ++ G_PARAM_SPEC_VALUE_TYPE(PSPEC), AP, 0, &error); \ ++\ + /* Don't bother with the error message. \ + */ \ +- if( error ) { \ +- VIPS_DEBUG_MSG( "VIPS_OBJECT_COLLECT_SET: err\n" ); \ +- g_free( error ); \ ++ if (error) { \ ++ VIPS_DEBUG_MSG("VIPS_OBJECT_COLLECT_SET: err\n"); \ ++ g_free(error); \ + } + +-#define VIPS_ARGUMENT_COLLECT_GET( PSPEC, ARG_CLASS, AP ) \ +- g_value_unset( &value ); \ ++#define VIPS_ARGUMENT_COLLECT_GET(PSPEC, ARG_CLASS, AP) \ ++ g_value_unset(&value); \ + } \ +- else if( (ARG_CLASS->flags & VIPS_ARGUMENT_OUTPUT) ) { \ ++ else if ((ARG_CLASS->flags & VIPS_ARGUMENT_OUTPUT)) \ ++ { \ + void **arg G_GNUC_UNUSED; \ +- \ ++\ + /* Output args are a pointer to where to send the \ + * result. \ + */ \ +- arg = va_arg( AP, void ** ); ++ arg = va_arg(AP, void **); + + #define VIPS_ARGUMENT_COLLECT_END \ +- } ++ } + + #define VIPS_TYPE_OBJECT (vips_object_get_type()) +-#define VIPS_OBJECT( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), VIPS_TYPE_OBJECT, VipsObject )) +-#define VIPS_OBJECT_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), VIPS_TYPE_OBJECT, VipsObjectClass)) +-#define VIPS_IS_OBJECT( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_OBJECT )) +-#define VIPS_IS_OBJECT_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_OBJECT )) +-#define VIPS_OBJECT_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), VIPS_TYPE_OBJECT, VipsObjectClass )) ++#define VIPS_OBJECT(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), VIPS_TYPE_OBJECT, VipsObject)) ++#define VIPS_OBJECT_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), VIPS_TYPE_OBJECT, VipsObjectClass)) ++#define VIPS_IS_OBJECT(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_OBJECT)) ++#define VIPS_IS_OBJECT_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_OBJECT)) ++#define VIPS_OBJECT_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), VIPS_TYPE_OBJECT, VipsObjectClass)) + + struct _VipsObject { + GObject parent_instance; +@@ -446,7 +466,7 @@ struct _VipsObject { + char *nickname; + char *description; + +- /* The pre/post/close callbacks are all fire-once. ++ /* The pre/post/close callbacks are all fire-once. + */ + gboolean preclose; + gboolean close; +@@ -456,7 +476,6 @@ struct _VipsObject { + * profiling. + */ + size_t local_memory; +- + }; + + struct _VipsObjectClass { +@@ -465,49 +484,49 @@ struct _VipsObjectClass { + /* Build the object ... all argument properties have been set, + * now build the thing. + */ +- int (*build)( VipsObject *object ); ++ int (*build)(VipsObject *object); + +- /* Just after build ... the object is fully ready for work. ++ /* Just after build ... the object is fully ready for work. + */ +- int (*postbuild)( VipsObject *object, void *data ); ++ int (*postbuild)(VipsObject *object, void *data); + + /* Try to print something about the class, handy for help displays. + * Keep to one line. + */ +- void (*summary_class)( struct _VipsObjectClass *cls, VipsBuf *buf ); ++ void (*summary_class)(struct _VipsObjectClass *cls, VipsBuf *buf); + + /* Try to print a one-line summary for the object, the user can see + * this output via things like "header fred.tif", --vips-cache-trace, +- * etc. ++ * etc. + */ +- void (*summary)( VipsObject *object, VipsBuf *buf ); ++ void (*summary)(VipsObject *object, VipsBuf *buf); + + /* Try to print everything about the object, handy for debugging. + */ +- void (*dump)( VipsObject *object, VipsBuf *buf ); ++ void (*dump)(VipsObject *object, VipsBuf *buf); + +- /* Sanity-check the object. Print messages and stuff. ++ /* Sanity-check the object. Print messages and stuff. + * Handy for debugging. + */ +- void (*sanity)( VipsObject *object, VipsBuf *buf ); ++ void (*sanity)(VipsObject *object, VipsBuf *buf); + + /* Rewind. Save and restore any stuff that needs to survive a + * dispose(). + */ +- void (*rewind)( VipsObject *object ); ++ void (*rewind)(VipsObject *object); + + /* Just before close, everything is still alive. + */ +- void (*preclose)( VipsObject *object ); ++ void (*preclose)(VipsObject *object); + + /* Close, time to free stuff. + */ +- void (*close)( VipsObject *object ); ++ void (*close)(VipsObject *object); + + /* Post-close, everything is dead, except the VipsObject pointer. + * Useful for eg. deleting the file associated with a temp image. + */ +- void (*postclose)( VipsObject *object ); ++ void (*postclose)(VipsObject *object); + + /* The CLI interface. Implement these four to get CLI input and output + * for your object. +@@ -518,12 +537,12 @@ struct _VipsObjectClass { + * + * Don't call this directly, see vips_object_new_from_string(). + */ +- VipsObject *(*new_from_string)( const char *string ); ++ VipsObject *(*new_from_string)(const char *string); + + /* The inverse of ^^. Given an object, output what ->new_from_string() +- * would have been given to make that object. ++ * would have been given to make that object. + */ +- void (*to_string)( VipsObject *object, VipsBuf *buf ); ++ void (*to_string)(VipsObject *object, VipsBuf *buf); + + /* Does this output arg need an arg from the command line? Image + * output, for example, needs a filename to write to. +@@ -534,10 +553,10 @@ struct _VipsObjectClass { + * error, setting vips_error(). string is NULL if output_needs_arg() + * was FALSE. + */ +- int (*output_to_arg)( VipsObject *object, const char *string ); ++ int (*output_to_arg)(VipsObject *object, const char *string); + + /* Class nickname, eg. "VipsInterpolateBicubic" has "bicubic" as a +- * nickname. Not internationalised. ++ * nickname. Not internationalised. + */ + const char *nickname; + +@@ -547,13 +566,13 @@ struct _VipsObjectClass { + + /* Hash from pspec to VipsArgumentClass. + * +- * This records the VipsArgumentClass for every pspec used in ++ * This records the VipsArgumentClass for every pspec used in + * VipsObject and any subclass (ie. everywhere), so it's huge. Don't + * loop over this hash! Fine for lookups though. + */ + VipsArgumentTable *argument_table; + +- /* A sorted (by priority) list of the VipsArgumentClass for this class ++ /* A sorted (by priority) list of the VipsArgumentClass for this class + * and any superclasses. This is small and specific to this class. + * + * Use the stored GType to work out when to restart the list for a +@@ -565,50 +584,50 @@ struct _VipsObjectClass { + /* This class is deprecated and therefore hidden from various UI bits. + * + * VipsOperation has a deprecated flag, use that in preference to this +- * if you can. ++ * if you can. + */ + gboolean deprecated; + + /* Reserved for future expansion. + */ +- void (*_vips_reserved1)( void ); +- void (*_vips_reserved2)( void ); +- void (*_vips_reserved3)( void ); +- void (*_vips_reserved4)( void ); ++ void (*_vips_reserved1)(void); ++ void (*_vips_reserved2)(void); ++ void (*_vips_reserved3)(void); ++ void (*_vips_reserved4)(void); + }; + + VIPS_API +-gboolean vips_value_is_null( GParamSpec *psoec, const GValue *value ); ++gboolean vips_value_is_null(GParamSpec *psoec, const GValue *value); + VIPS_API +-void vips_object_set_property( GObject *gobject, +- guint property_id, const GValue *value, GParamSpec *pspec ); ++void vips_object_set_property(GObject *gobject, ++ guint property_id, const GValue *value, GParamSpec *pspec); + VIPS_API +-void vips_object_get_property( GObject *gobject, +- guint property_id, GValue *value, GParamSpec *pspec ); ++void vips_object_get_property(GObject *gobject, ++ guint property_id, GValue *value, GParamSpec *pspec); + + VIPS_API +-void vips_object_preclose( VipsObject *object ); ++void vips_object_preclose(VipsObject *object); + VIPS_API +-int vips_object_build( VipsObject *object ); ++int vips_object_build(VipsObject *object); + + VIPS_API +-void vips_object_summary_class( VipsObjectClass *klass, VipsBuf *buf ); ++void vips_object_summary_class(VipsObjectClass *klass, VipsBuf *buf); + VIPS_API +-void vips_object_summary( VipsObject *object, VipsBuf *buf ); ++void vips_object_summary(VipsObject *object, VipsBuf *buf); + VIPS_API +-void vips_object_dump( VipsObject *object, VipsBuf *buf ); ++void vips_object_dump(VipsObject *object, VipsBuf *buf); + + VIPS_API +-void vips_object_print_summary_class( VipsObjectClass *klass ); ++void vips_object_print_summary_class(VipsObjectClass *klass); + VIPS_API +-void vips_object_print_summary( VipsObject *object ); ++void vips_object_print_summary(VipsObject *object); + VIPS_API +-void vips_object_print_dump( VipsObject *object ); ++void vips_object_print_dump(VipsObject *object); + VIPS_API +-void vips_object_print_name( VipsObject *object ); ++void vips_object_print_name(VipsObject *object); + + VIPS_API +-gboolean vips_object_sanity( VipsObject *object ); ++gboolean vips_object_sanity(VipsObject *object); + + /* Don't put spaces around void here, it breaks gtk-doc. + */ +@@ -616,91 +635,89 @@ VIPS_API + GType vips_object_get_type(void); + + VIPS_API +-void vips_object_class_install_argument( VipsObjectClass *cls, +- GParamSpec *pspec, VipsArgumentFlags flags, +- int priority, guint offset ); ++void vips_object_class_install_argument(VipsObjectClass *cls, ++ GParamSpec *pspec, VipsArgumentFlags flags, ++ int priority, guint offset); + VIPS_API +-int vips_object_set_argument_from_string( VipsObject *object, +- const char *name, const char *value ); ++int vips_object_set_argument_from_string(VipsObject *object, ++ const char *name, const char *value); + VIPS_API +-gboolean vips_object_argument_needsstring( VipsObject *object, +- const char *name ); ++gboolean vips_object_argument_needsstring(VipsObject *object, ++ const char *name); + VIPS_API +-int vips_object_get_argument_to_string( VipsObject *object, +- const char *name, const char *arg ); ++int vips_object_get_argument_to_string(VipsObject *object, ++ const char *name, const char *arg); + VIPS_API +-int vips_object_set_required( VipsObject *object, const char *value ); ++int vips_object_set_required(VipsObject *object, const char *value); + +-typedef void *(*VipsObjectSetArguments)( VipsObject *object, void *a, void *b ); ++typedef void *(*VipsObjectSetArguments)(VipsObject *object, void *a, void *b); + VIPS_API +-VipsObject *vips_object_new( GType type, +- VipsObjectSetArguments set, void *a, void *b ); ++VipsObject *vips_object_new(GType type, ++ VipsObjectSetArguments set, void *a, void *b); + + VIPS_API +-int vips_object_set_valist( VipsObject *object, va_list ap ); ++int vips_object_set_valist(VipsObject *object, va_list ap); + VIPS_API +-int vips_object_set( VipsObject *object, ... ) ++int vips_object_set(VipsObject *object, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_object_set_from_string( VipsObject *object, const char *string ); ++int vips_object_set_from_string(VipsObject *object, const char *string); + + VIPS_API +-VipsObject *vips_object_new_from_string( VipsObjectClass *object_class, +- const char *p ); ++VipsObject *vips_object_new_from_string(VipsObjectClass *object_class, ++ const char *p); + VIPS_API +-void vips_object_to_string( VipsObject *object, VipsBuf *buf ); ++void vips_object_to_string(VipsObject *object, VipsBuf *buf); + + VIPS_API +-void *vips_object_map( VipsSListMap2Fn fn, void *a, void *b ); ++void *vips_object_map(VipsSListMap2Fn fn, void *a, void *b); + +-typedef void *(*VipsTypeMapFn)( GType type, void *a ); +-typedef void *(*VipsTypeMap2Fn)( GType type, void *a, void *b ); +-typedef void *(*VipsClassMapFn)( VipsObjectClass *cls, void *a ); ++typedef void *(*VipsTypeMapFn)(GType type, void *a); ++typedef void *(*VipsTypeMap2Fn)(GType type, void *a, void *b); ++typedef void *(*VipsClassMapFn)(VipsObjectClass *cls, void *a); + VIPS_API +-void *vips_type_map( GType base, VipsTypeMap2Fn fn, void *a, void *b ); ++void *vips_type_map(GType base, VipsTypeMap2Fn fn, void *a, void *b); + VIPS_API +-void *vips_type_map_all( GType base, VipsTypeMapFn fn, void *a ); ++void *vips_type_map_all(GType base, VipsTypeMapFn fn, void *a); + VIPS_API +-int vips_type_depth( GType type ); ++int vips_type_depth(GType type); + VIPS_API +-GType vips_type_find( const char *basename, const char *nickname ); ++GType vips_type_find(const char *basename, const char *nickname); + VIPS_API +-const char *vips_nickname_find( GType type ); ++const char *vips_nickname_find(GType type); + + VIPS_API +-void *vips_class_map_all( GType type, VipsClassMapFn fn, void *a ); ++void *vips_class_map_all(GType type, VipsClassMapFn fn, void *a); + VIPS_API +-const VipsObjectClass *vips_class_find( const char *basename, +- const char *nickname ); ++const VipsObjectClass *vips_class_find(const char *basename, ++ const char *nickname); + + VIPS_API +-VipsObject **vips_object_local_array( VipsObject *parent, int n ); ++VipsObject **vips_object_local_array(VipsObject *parent, int n); + + VIPS_API +-void vips_object_local_cb( VipsObject *vobject, GObject *gobject ); +-#define vips_object_local( V, G ) \ +- (g_signal_connect( V, "close", G_CALLBACK( vips_object_local_cb ), G )) ++void vips_object_local_cb(VipsObject *vobject, GObject *gobject); ++#define vips_object_local(V, G) \ ++ (g_signal_connect(V, "close", G_CALLBACK(vips_object_local_cb), G)) + + VIPS_API +-void vips_object_set_static( VipsObject *object, gboolean static_object ); ++void vips_object_set_static(VipsObject *object, gboolean static_object); + VIPS_API +-void vips_object_print_all( void ); ++void vips_object_print_all(void); + VIPS_API +-void vips_object_sanity_all( void ); ++void vips_object_sanity_all(void); + + VIPS_API +-void vips_object_rewind( VipsObject *object ); ++void vips_object_rewind(VipsObject *object); + + VIPS_API +-void vips_object_unref_outputs( VipsObject *object ); ++void vips_object_unref_outputs(VipsObject *object); + + VIPS_API +-const char *vips_object_get_description( VipsObject *object ); ++const char *vips_object_get_description(VipsObject *object); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_OBJECT_H*/ +- +- +diff --git a/libvips/include/vips/operation.h b/libvips/include/vips/operation.h +index 5f9a09405c..990c7c891e 100644 +--- a/libvips/include/vips/operation.h ++++ b/libvips/include/vips/operation.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -52,21 +52,21 @@ typedef enum /*< flags >*/ { + } VipsOperationFlags; + + #define VIPS_TYPE_OPERATION (vips_operation_get_type()) +-#define VIPS_OPERATION( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_OPERATION, VipsOperation )) +-#define VIPS_OPERATION_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_OPERATION, VipsOperationClass )) +-#define VIPS_IS_OPERATION( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_OPERATION )) +-#define VIPS_IS_OPERATION_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_OPERATION )) +-#define VIPS_OPERATION_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_OPERATION, VipsOperationClass )) +- +-typedef gboolean (*VipsOperationBuildFn)( VipsObject *object ); ++#define VIPS_OPERATION(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_OPERATION, VipsOperation)) ++#define VIPS_OPERATION_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_OPERATION, VipsOperationClass)) ++#define VIPS_IS_OPERATION(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_OPERATION)) ++#define VIPS_IS_OPERATION_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_OPERATION)) ++#define VIPS_OPERATION_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_OPERATION, VipsOperationClass)) ++ ++typedef gboolean (*VipsOperationBuildFn)(VipsObject *object); + + typedef struct _VipsOperation { + VipsObject parent_instance; +@@ -87,17 +87,17 @@ typedef struct _VipsOperationClass { + + /* Print the usage message. + */ +- void (*usage)( struct _VipsOperationClass *cls, VipsBuf *buf ); ++ void (*usage)(struct _VipsOperationClass *cls, VipsBuf *buf); + +- /* Return a set of operation flags. ++ /* Return a set of operation flags. + */ +- VipsOperationFlags (*get_flags)( VipsOperation *operation ); ++ VipsOperationFlags (*get_flags)(VipsOperation *operation); + VipsOperationFlags flags; + + /* One of our input images has signalled "invalidate". The cache uses + * VipsOperation::invalidate to drop dirty ops. + */ +- void (*invalidate)( VipsOperation *operation ); ++ void (*invalidate)(VipsOperation *operation); + } VipsOperationClass; + + /* Don't put spaces around void here, it breaks gtk-doc. +@@ -106,74 +106,74 @@ VIPS_API + GType vips_operation_get_type(void); + + VIPS_API +-VipsOperationFlags vips_operation_get_flags( VipsOperation *operation ); ++VipsOperationFlags vips_operation_get_flags(VipsOperation *operation); + VIPS_API +-void vips_operation_class_print_usage( VipsOperationClass *operation_class ); ++void vips_operation_class_print_usage(VipsOperationClass *operation_class); + VIPS_API +-void vips_operation_invalidate( VipsOperation *operation ); ++void vips_operation_invalidate(VipsOperation *operation); + + VIPS_API +-int vips_operation_call_valist( VipsOperation *operation, va_list ap ); ++int vips_operation_call_valist(VipsOperation *operation, va_list ap); + VIPS_API +-VipsOperation *vips_operation_new( const char *name ); ++VipsOperation *vips_operation_new(const char *name); + VIPS_API +-int vips_call_required_optional( VipsOperation **operation, +- va_list required, va_list optional ); ++int vips_call_required_optional(VipsOperation **operation, ++ va_list required, va_list optional); + VIPS_API +-int vips_call( const char *operation_name, ... ) ++int vips_call(const char *operation_name, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_call_split( const char *operation_name, va_list optional, ... ); ++int vips_call_split(const char *operation_name, va_list optional, ...); + VIPS_API +-int vips_call_split_option_string( const char *operation_name, +- const char *option_string, va_list optional, ... ); ++int vips_call_split_option_string(const char *operation_name, ++ const char *option_string, va_list optional, ...); + + VIPS_API +-void vips_call_options( GOptionGroup *group, VipsOperation *operation ); ++void vips_call_options(GOptionGroup *group, VipsOperation *operation); + VIPS_API +-int vips_call_argv( VipsOperation *operation, int argc, char **argv ); ++int vips_call_argv(VipsOperation *operation, int argc, char **argv); + + VIPS_API +-void vips_cache_drop_all( void ); ++void vips_cache_drop_all(void); + VIPS_API +-VipsOperation *vips_cache_operation_lookup( VipsOperation *operation ); ++VipsOperation *vips_cache_operation_lookup(VipsOperation *operation); + VIPS_API +-void vips_cache_operation_add( VipsOperation *operation ); ++void vips_cache_operation_add(VipsOperation *operation); + VIPS_API +-int vips_cache_operation_buildp( VipsOperation **operation ); ++int vips_cache_operation_buildp(VipsOperation **operation); + VIPS_API +-VipsOperation *vips_cache_operation_build( VipsOperation *operation ); ++VipsOperation *vips_cache_operation_build(VipsOperation *operation); + VIPS_API +-void vips_cache_print( void ); ++void vips_cache_print(void); + VIPS_API +-void vips_cache_set_max( int max ); ++void vips_cache_set_max(int max); + VIPS_API +-void vips_cache_set_max_mem( size_t max_mem ); ++void vips_cache_set_max_mem(size_t max_mem); + VIPS_API +-int vips_cache_get_max( void ); ++int vips_cache_get_max(void); + VIPS_API +-int vips_cache_get_size( void ); ++int vips_cache_get_size(void); + VIPS_API +-size_t vips_cache_get_max_mem( void ); ++size_t vips_cache_get_max_mem(void); + VIPS_API +-int vips_cache_get_max_files( void ); ++int vips_cache_get_max_files(void); + VIPS_API +-void vips_cache_set_max_files( int max_files ); ++void vips_cache_set_max_files(int max_files); + VIPS_API +-void vips_cache_set_dump( gboolean dump ); ++void vips_cache_set_dump(gboolean dump); + VIPS_API +-void vips_cache_set_trace( gboolean trace ); ++void vips_cache_set_trace(gboolean trace); + + /* Part of threadpool, really, but we want these in a header that gets scanned + * for our typelib. + */ + VIPS_API +-void vips_concurrency_set( int concurrency ); ++void vips_concurrency_set(int concurrency); + VIPS_API +-int vips_concurrency_get( void ); ++int vips_concurrency_get(void); + + VIPS_API +-void vips_operation_block_set( const char *name, gboolean state ); ++void vips_operation_block_set(const char *name, gboolean state); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/private.h b/libvips/include/vips/private.h +index d6be94ed8d..747dec620c 100644 +--- a/libvips/include/vips/private.h ++++ b/libvips/include/vips/private.h +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -42,12 +42,12 @@ extern "C" { + + #define VIPS_SPARE (8) + +-/* Private to iofuncs: the minimum number of scanlines we add above and below ++/* Private to iofuncs: the minimum number of scanlines we add above and below + * the window as a margin for slop. + */ + #define VIPS__WINDOW_MARGIN_PIXELS (128) + +-/* Private to iofuncs: add at least this many bytes above and below the window. ++/* Private to iofuncs: add at least this many bytes above and below the window. + * There's no point mapping just a few KB of a small image. + */ + #define VIPS__WINDOW_MARGIN_BYTES (1024 * 1024 * 10) +@@ -60,31 +60,31 @@ extern "C" { + * VipsImage. + */ + typedef struct { +- int ref_count; /* # of regions referencing us */ +- struct _VipsImage *im; /* VipsImage we are attached to */ ++ int ref_count; /* # of regions referencing us */ ++ struct _VipsImage *im; /* VipsImage we are attached to */ + +- int top; /* Area of image we have mapped, in pixels */ ++ int top; /* Area of image we have mapped, in pixels */ + int height; +- VipsPel *data; /* First pixel of line 'top' */ ++ VipsPel *data; /* First pixel of line 'top' */ + +- void *baseaddr; /* Base of window */ +- size_t length; /* Size of window */ ++ void *baseaddr; /* Base of window */ ++ size_t length; /* Size of window */ + } VipsWindow; + + VIPS_API +-int vips_window_unref( VipsWindow *window ); ++int vips_window_unref(VipsWindow *window); + VIPS_API +-void vips_window_print( VipsWindow *window ); ++void vips_window_print(VipsWindow *window); + + /* Per-thread buffer state. Held in a GPrivate. + */ + typedef struct { +- GHashTable *hash; /* VipsImage -> VipsBufferCache* */ +- GThread *thread; /* Just for sanity checking */ ++ GHashTable *hash; /* VipsImage -> VipsBufferCache* */ ++ GThread *thread; /* Just for sanity checking */ + } VipsBufferThread; + + /* Per-image buffer cache. This keeps a list of "done" VipsBuffer that this +- * worker has generated. We use this to reuse results within a thread. ++ * worker has generated. We use this to reuse results within a thread. + * + * Hash to this from VipsBufferThread::hash. + * We can't store the GSList directly in the hash table as GHashTable lacks an +@@ -92,49 +92,49 @@ typedef struct { + * operation. + */ + typedef struct _VipsBufferCache { +- GSList *buffers; /* GSList of "done" VipsBuffer* */ +- GThread *thread; /* Just for sanity checking */ ++ GSList *buffers; /* GSList of "done" VipsBuffer* */ ++ GThread *thread; /* Just for sanity checking */ + struct _VipsImage *im; + VipsBufferThread *buffer_thread; +- GSList *reserve; /* VipsBuffer kept in reserve */ +- int n_reserve; /* Number in reserve */ ++ GSList *reserve; /* VipsBuffer kept in reserve */ ++ int n_reserve; /* Number in reserve */ + } VipsBufferCache; + + /* What we track for each pixel buffer. These can move between caches and +- * between threads, but not between images. ++ * between threads, but not between images. + * +- * Moving between threads is difficult, use region ownership stuff. ++ * Moving between threads is difficult, use region ownership stuff. + */ + typedef struct _VipsBuffer { +- int ref_count; /* # of regions referencing us */ +- struct _VipsImage *im; /* VipsImage we are attached to */ +- +- VipsRect area; /* Area this pixel buffer covers */ +- gboolean done; /* Calculated and in a cache */ +- VipsBufferCache *cache; /* The cache this buffer is published on */ +- VipsPel *buf; /* Private malloc() area */ +- size_t bsize; /* Size of private malloc() */ ++ int ref_count; /* # of regions referencing us */ ++ struct _VipsImage *im; /* VipsImage we are attached to */ ++ ++ VipsRect area; /* Area this pixel buffer covers */ ++ gboolean done; /* Calculated and in a cache */ ++ VipsBufferCache *cache; /* The cache this buffer is published on */ ++ VipsPel *buf; /* Private malloc() area */ ++ size_t bsize; /* Size of private malloc() */ + } VipsBuffer; + + VIPS_API +-void vips_buffer_dump_all( void ); ++void vips_buffer_dump_all(void); + VIPS_API +-void vips_buffer_done( VipsBuffer *buffer ); ++void vips_buffer_done(VipsBuffer *buffer); + VIPS_API +-void vips_buffer_undone( VipsBuffer *buffer ); ++void vips_buffer_undone(VipsBuffer *buffer); + VIPS_API +-void vips_buffer_unref( VipsBuffer *buffer ); ++void vips_buffer_unref(VipsBuffer *buffer); + VIPS_API +-VipsBuffer *vips_buffer_new( struct _VipsImage *im, VipsRect *area ); ++VipsBuffer *vips_buffer_new(struct _VipsImage *im, VipsRect *area); + VIPS_API +-VipsBuffer *vips_buffer_ref( struct _VipsImage *im, VipsRect *area ); ++VipsBuffer *vips_buffer_ref(struct _VipsImage *im, VipsRect *area); + VIPS_API +-VipsBuffer *vips_buffer_unref_ref( VipsBuffer *buffer, +- struct _VipsImage *im, VipsRect *area ); ++VipsBuffer *vips_buffer_unref_ref(VipsBuffer *buffer, ++ struct _VipsImage *im, VipsRect *area); + VIPS_API +-void vips_buffer_print( VipsBuffer *buffer ); ++void vips_buffer_print(VipsBuffer *buffer); + +-void vips__render_shutdown( void ); ++void vips__render_shutdown(void); + + /* Sections of region.h that are private to VIPS. + */ +@@ -143,13 +143,13 @@ void vips__render_shutdown( void ); + */ + typedef enum _RegionType { + VIPS_REGION_NONE, +- VIPS_REGION_BUFFER, /* A VipsBuffer */ +- VIPS_REGION_OTHER_REGION, /* Memory on another region */ +- VIPS_REGION_OTHER_IMAGE, /* Memory on another image */ +- VIPS_REGION_WINDOW /* A VipsWindow on fd */ ++ VIPS_REGION_BUFFER, /* A VipsBuffer */ ++ VIPS_REGION_OTHER_REGION, /* Memory on another region */ ++ VIPS_REGION_OTHER_IMAGE, /* Memory on another image */ ++ VIPS_REGION_WINDOW /* A VipsWindow on fd */ + } RegionType; + +-/* Private to iofuncs: the size of the `tiles' requested by ++/* Private to iofuncs: the size of the `tiles' requested by + * vips_image_generate() when acting as a data sink. + */ + #define VIPS__TILE_WIDTH (128) +@@ -163,28 +163,28 @@ typedef enum _RegionType { + /* Functions on regions. + */ + struct _VipsRegion; +-void vips__region_take_ownership( struct _VipsRegion *reg ); +-void vips__region_check_ownership( struct _VipsRegion *reg ); ++void vips__region_take_ownership(struct _VipsRegion *reg); ++void vips__region_check_ownership(struct _VipsRegion *reg); + /* TODO(kleisauke): VIPS_API is required by vipsdisp. + */ + VIPS_API +-void vips__region_no_ownership( struct _VipsRegion *reg ); ++void vips__region_no_ownership(struct _VipsRegion *reg); + +-typedef int (*VipsRegionFillFn)( struct _VipsRegion *, void * ); ++typedef int (*VipsRegionFillFn)(struct _VipsRegion *, void *); + VIPS_API +-int vips_region_fill( struct _VipsRegion *reg, +- const VipsRect *r, VipsRegionFillFn fn, void *a ); ++int vips_region_fill(struct _VipsRegion *reg, ++ const VipsRect *r, VipsRegionFillFn fn, void *a); + +-int vips__image_wio_output( struct _VipsImage *image ); +-int vips__image_pio_output( struct _VipsImage *image ); ++int vips__image_wio_output(struct _VipsImage *image); ++int vips__image_pio_output(struct _VipsImage *image); + + /* VIPS_ARGUMENT_FOR_ALL() needs to have this visible. + */ + VIPS_API +-VipsArgumentInstance *vips__argument_get_instance( ++VipsArgumentInstance *vips__argument_get_instance( + VipsArgumentClass *argument_class, + VipsObject *object); +-VipsArgument *vips__argument_table_lookup( VipsArgumentTable *table, ++VipsArgument *vips__argument_table_lookup(VipsArgumentTable *table, + GParamSpec *pspec); + + /* im_demand_hint_array() needs to have this visible. +@@ -192,33 +192,33 @@ VipsArgument *vips__argument_table_lookup( VipsArgumentTable *table, + #if VIPS_ENABLE_DEPRECATED + VIPS_API + #endif +-void vips__demand_hint_array( struct _VipsImage *image, +- int hint, struct _VipsImage **in ); ++void vips__demand_hint_array(struct _VipsImage *image, ++ int hint, struct _VipsImage **in); + /* im_cp_desc_array() needs to have this visible. + */ + #if VIPS_ENABLE_DEPRECATED + VIPS_API + #endif +-int vips__image_copy_fields_array( struct _VipsImage *out, +- struct _VipsImage *in[] ); ++int vips__image_copy_fields_array(struct _VipsImage *out, ++ struct _VipsImage *in[]); + +-void vips__region_count_pixels( struct _VipsRegion *region, const char *nickname ); ++void vips__region_count_pixels(struct _VipsRegion *region, const char *nickname); + VIPS_API +-void vips_region_dump_all( void ); ++void vips_region_dump_all(void); + + VIPS_API +-int vips_region_prepare_many( struct _VipsRegion **reg, const VipsRect *r ); ++int vips_region_prepare_many(struct _VipsRegion **reg, const VipsRect *r); + + /* Handy for debugging. + */ +-int vips__view_image( struct _VipsImage *image ); ++int vips__view_image(struct _VipsImage *image); + + /* Pre 8.7 libvipses used this for allocating argument ids. + */ + VIPS_API + int _vips__argument_id; + +-void vips__meta_init( void ); ++void vips__meta_init(void); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/rect.h b/libvips/include/vips/rect.h +index 34498db902..52479e11ee 100644 +--- a/libvips/include/vips/rect.h ++++ b/libvips/include/vips/rect.h +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,27 +51,27 @@ typedef struct _VipsRect { + #define VIPS_RECT_VCENTRE(R) ((R)->top + (R)->height / 2) + + VIPS_API +-gboolean vips_rect_isempty( const VipsRect *r ); ++gboolean vips_rect_isempty(const VipsRect *r); + VIPS_API +-gboolean vips_rect_includespoint( const VipsRect *r, int x, int y ); ++gboolean vips_rect_includespoint(const VipsRect *r, int x, int y); + VIPS_API +-gboolean vips_rect_includesrect( const VipsRect *r1, const VipsRect *r2 ); ++gboolean vips_rect_includesrect(const VipsRect *r1, const VipsRect *r2); + VIPS_API +-gboolean vips_rect_equalsrect( const VipsRect *r1, const VipsRect *r2 ); ++gboolean vips_rect_equalsrect(const VipsRect *r1, const VipsRect *r2); + VIPS_API +-gboolean vips_rect_overlapsrect( const VipsRect *r1, const VipsRect *r2 ); ++gboolean vips_rect_overlapsrect(const VipsRect *r1, const VipsRect *r2); + VIPS_API +-void vips_rect_marginadjust( VipsRect *r, int n ); ++void vips_rect_marginadjust(VipsRect *r, int n); + VIPS_API +-void vips_rect_intersectrect( const VipsRect *r1, const VipsRect *r2, +- VipsRect *out ); ++void vips_rect_intersectrect(const VipsRect *r1, const VipsRect *r2, ++ VipsRect *out); + VIPS_API +-void vips_rect_unionrect( const VipsRect *r1, const VipsRect *r2, +- VipsRect *out ); ++void vips_rect_unionrect(const VipsRect *r1, const VipsRect *r2, ++ VipsRect *out); + VIPS_API +-VipsRect *vips_rect_dup( const VipsRect *r ); ++VipsRect *vips_rect_dup(const VipsRect *r); + VIPS_API +-void vips_rect_normalise( VipsRect *r ); ++void vips_rect_normalise(VipsRect *r); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/region.h b/libvips/include/vips/region.h +index f18035cf60..7d07de63e3 100644 +--- a/libvips/include/vips/region.h ++++ b/libvips/include/vips/region.h +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -48,19 +48,19 @@ extern "C" { + #endif /*__cplusplus*/ + + #define VIPS_TYPE_REGION (vips_region_get_type()) +-#define VIPS_REGION( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_REGION, VipsRegion )) +-#define VIPS_REGION_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_REGION, VipsRegionClass)) +-#define VIPS_IS_REGION( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_REGION )) +-#define VIPS_IS_REGION_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_REGION )) +-#define VIPS_REGION_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_REGION, VipsRegionClass )) ++#define VIPS_REGION(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_REGION, VipsRegion)) ++#define VIPS_REGION_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_REGION, VipsRegionClass)) ++#define VIPS_IS_REGION(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_REGION)) ++#define VIPS_IS_REGION_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_REGION)) ++#define VIPS_REGION_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_REGION, VipsRegionClass)) + + /** + * VipsRegionShrink: +@@ -93,16 +93,16 @@ struct _VipsRegion { + /*< public >*/ + /* Users may read these two fields. + */ +- VipsImage *im; /* Link back to parent image */ +- VipsRect valid; /* Area of parent we can see */ ++ VipsImage *im; /* Link back to parent image */ ++ VipsRect valid; /* Area of parent we can see */ + + /* The rest of VipsRegion is private. + */ + /*< private >*/ +- RegionType type; /* What kind of attachment */ +- VipsPel *data; /* Off here to get data */ +- int bpl; /* Bytes-per-line for data */ +- void *seq; /* Sequence we are using to fill region */ ++ RegionType type; /* What kind of attachment */ ++ VipsPel *data; /* Off here to get data */ ++ int bpl; /* Bytes-per-line for data */ ++ void *seq; /* Sequence we are using to fill region */ + + /* The thread that made this region. Used to assert() test that + * regions are not being shared between threads. +@@ -120,7 +120,7 @@ struct _VipsRegion { + /* The image this region is on has changed and caches need to be + * dropped. + */ +- gboolean invalid; ++ gboolean invalid; + }; + + typedef struct _VipsRegionClass { +@@ -134,102 +134,101 @@ VIPS_API + GType vips_region_get_type(void); + + VIPS_API +-VipsRegion *vips_region_new( VipsImage *image ); ++VipsRegion *vips_region_new(VipsImage *image); + + VIPS_API +-int vips_region_buffer( VipsRegion *reg, const VipsRect *r ); ++int vips_region_buffer(VipsRegion *reg, const VipsRect *r); + VIPS_API +-int vips_region_image( VipsRegion *reg, const VipsRect *r ); ++int vips_region_image(VipsRegion *reg, const VipsRect *r); + VIPS_API +-int vips_region_region( VipsRegion *reg, VipsRegion *dest, +- const VipsRect *r, int x, int y ); ++int vips_region_region(VipsRegion *reg, VipsRegion *dest, ++ const VipsRect *r, int x, int y); + VIPS_API +-int vips_region_equalsregion( VipsRegion *reg1, VipsRegion *reg2 ); ++int vips_region_equalsregion(VipsRegion *reg1, VipsRegion *reg2); + VIPS_API +-int vips_region_position( VipsRegion *reg, int x, int y ); ++int vips_region_position(VipsRegion *reg, int x, int y); + + VIPS_API +-void vips_region_paint( VipsRegion *reg, const VipsRect *r, int value ); ++void vips_region_paint(VipsRegion *reg, const VipsRect *r, int value); + VIPS_API +-void vips_region_paint_pel( VipsRegion *reg, +- const VipsRect *r, const VipsPel *ink ); ++void vips_region_paint_pel(VipsRegion *reg, ++ const VipsRect *r, const VipsPel *ink); + VIPS_API +-void vips_region_black( VipsRegion *reg ); ++void vips_region_black(VipsRegion *reg); + VIPS_API +-void vips_region_copy( VipsRegion *reg, VipsRegion *dest, +- const VipsRect *r, int x, int y ); ++void vips_region_copy(VipsRegion *reg, VipsRegion *dest, ++ const VipsRect *r, int x, int y); + VIPS_API +-int vips_region_shrink_method( VipsRegion *from, VipsRegion *to, +- const VipsRect *target, VipsRegionShrink method ); ++int vips_region_shrink_method(VipsRegion *from, VipsRegion *to, ++ const VipsRect *target, VipsRegionShrink method); + VIPS_API +-int vips_region_shrink( VipsRegion *from, VipsRegion *to, +- const VipsRect *target ); ++int vips_region_shrink(VipsRegion *from, VipsRegion *to, ++ const VipsRect *target); + + VIPS_API +-int vips_region_prepare( VipsRegion *reg, const VipsRect *r ); ++int vips_region_prepare(VipsRegion *reg, const VipsRect *r); + VIPS_API +-int vips_region_prepare_to( VipsRegion *reg, +- VipsRegion *dest, const VipsRect *r, int x, int y ); ++int vips_region_prepare_to(VipsRegion *reg, ++ VipsRegion *dest, const VipsRect *r, int x, int y); + + VIPS_API +-VipsPel *vips_region_fetch( VipsRegion *region, +- int left, int top, int width, int height, size_t *len ); ++VipsPel *vips_region_fetch(VipsRegion *region, ++ int left, int top, int width, int height, size_t *len); + VIPS_API +-int vips_region_width( VipsRegion *region ); ++int vips_region_width(VipsRegion *region); + VIPS_API +-int vips_region_height( VipsRegion *region ); ++int vips_region_height(VipsRegion *region); + + VIPS_API +-void vips_region_invalidate( VipsRegion *reg ); ++void vips_region_invalidate(VipsRegion *reg); + + /* Use this to count pixels passing through key points. Handy for spotting bad + * overcomputation. + */ + #ifdef DEBUG_LEAK +-#define VIPS_COUNT_PIXELS( R, N ) vips__region_count_pixels( R, N ) ++#define VIPS_COUNT_PIXELS(R, N) vips__region_count_pixels(R, N) + #else /*!DEBUG_LEAK*/ +-#define VIPS_COUNT_PIXELS( R, N ) ++#define VIPS_COUNT_PIXELS(R, N) + #endif /*DEBUG_LEAK*/ + +-#define VIPS_REGION_LSKIP( R ) \ +- ((size_t)((R)->bpl)) +-#define VIPS_REGION_N_ELEMENTS( R ) \ +- ((size_t)((R)->valid.width * (R)->im->Bands)) +-#define VIPS_REGION_SIZEOF_ELEMENT( R ) \ +- (VIPS_IMAGE_SIZEOF_ELEMENT( (R)->im )) +-#define VIPS_REGION_SIZEOF_PEL( R ) \ +- (VIPS_IMAGE_SIZEOF_PEL( (R)->im )) +-#define VIPS_REGION_SIZEOF_LINE( R ) \ +- ((size_t)((R)->valid.width * VIPS_REGION_SIZEOF_PEL( R ))) ++#define VIPS_REGION_LSKIP(R) \ ++ ((size_t) ((R)->bpl)) ++#define VIPS_REGION_N_ELEMENTS(R) \ ++ ((size_t) ((R)->valid.width * (R)->im->Bands)) ++#define VIPS_REGION_SIZEOF_ELEMENT(R) \ ++ (VIPS_IMAGE_SIZEOF_ELEMENT((R)->im)) ++#define VIPS_REGION_SIZEOF_PEL(R) \ ++ (VIPS_IMAGE_SIZEOF_PEL((R)->im)) ++#define VIPS_REGION_SIZEOF_LINE(R) \ ++ ((size_t) ((R)->valid.width * VIPS_REGION_SIZEOF_PEL(R))) + + /* If DEBUG is defined, add bounds checking. + */ + #ifdef DEBUG +-#define VIPS_REGION_ADDR( R, X, Y ) \ +- ( (vips_rect_includespoint( &(R)->valid, (X), (Y) ))? \ +- ((R)->data + ((Y) - (R)->valid.top) * VIPS_REGION_LSKIP(R) + \ +- ((X) - (R)->valid.left) * VIPS_REGION_SIZEOF_PEL( R )): \ +- (fprintf( stderr, \ +- "VIPS_REGION_ADDR: point out of bounds, " \ +- "file \"%s\", line %d\n" \ +- "(point x=%d, y=%d\n" \ +- " should have been within VipsRect left=%d, top=%d, " \ +- "width=%d, height=%d)\n", \ +- __FILE__, __LINE__, \ +- (X), (Y), \ +- (R)->valid.left, \ +- (R)->valid.top, \ +- (R)->valid.width, \ +- (R)->valid.height ), abort(), (VipsPel *) NULL) \ +- ) ++#define VIPS_REGION_ADDR(R, X, Y) \ ++ ((vips_rect_includespoint(&(R)->valid, (X), (Y))) ? ((R)->data + ((Y) - (R)->valid.top) * VIPS_REGION_LSKIP(R) + \ ++ ((X) - (R)->valid.left) * VIPS_REGION_SIZEOF_PEL(R)) \ ++ : (fprintf(stderr, \ ++ "VIPS_REGION_ADDR: point out of bounds, " \ ++ "file \"%s\", line %d\n" \ ++ "(point x=%d, y=%d\n" \ ++ " should have been within VipsRect left=%d, top=%d, " \ ++ "width=%d, height=%d)\n", \ ++ __FILE__, __LINE__, \ ++ (X), (Y), \ ++ (R)->valid.left, \ ++ (R)->valid.top, \ ++ (R)->valid.width, \ ++ (R)->valid.height), \ ++ abort(), (VipsPel *) NULL)) + #else /*DEBUG*/ +-#define VIPS_REGION_ADDR( R, X, Y ) \ ++#define VIPS_REGION_ADDR(R, X, Y) \ + ((R)->data + \ +- ((Y)-(R)->valid.top) * VIPS_REGION_LSKIP( R ) + \ +- ((X)-(R)->valid.left) * VIPS_REGION_SIZEOF_PEL( R )) ++ ((Y) - (R)->valid.top) * VIPS_REGION_LSKIP(R) + \ ++ ((X) - (R)->valid.left) * VIPS_REGION_SIZEOF_PEL(R)) + #endif /*DEBUG*/ + +-#define VIPS_REGION_ADDR_TOPLEFT( R ) ((R)->data) ++#define VIPS_REGION_ADDR_TOPLEFT(R) ((R)->data) + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/resample.h b/libvips/include/vips/resample.h +index 43bcab0f33..7a87972f95 100644 +--- a/libvips/include/vips/resample.h ++++ b/libvips/include/vips/resample.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -57,63 +57,63 @@ typedef enum { + } VipsSize; + + VIPS_API +-int vips_shrink( VipsImage *in, VipsImage **out, +- double hshrink, double vshrink, ... ) ++int vips_shrink(VipsImage *in, VipsImage **out, ++ double hshrink, double vshrink, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_shrinkh( VipsImage *in, VipsImage **out, int hshrink, ... ) ++int vips_shrinkh(VipsImage *in, VipsImage **out, int hshrink, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_shrinkv( VipsImage *in, VipsImage **out, int vshrink, ... ) ++int vips_shrinkv(VipsImage *in, VipsImage **out, int vshrink, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_reduce( VipsImage *in, VipsImage **out, +- double hshrink, double vshrink, ... ) ++int vips_reduce(VipsImage *in, VipsImage **out, ++ double hshrink, double vshrink, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_reduceh( VipsImage *in, VipsImage **out, double hshrink, ... ) ++int vips_reduceh(VipsImage *in, VipsImage **out, double hshrink, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_reducev( VipsImage *in, VipsImage **out, double vshrink, ... ) ++int vips_reducev(VipsImage *in, VipsImage **out, double vshrink, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_thumbnail( const char *filename, VipsImage **out, int width, ... ) ++int vips_thumbnail(const char *filename, VipsImage **out, int width, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_thumbnail_buffer( void *buf, size_t len, VipsImage **out, +- int width, ... ) ++int vips_thumbnail_buffer(void *buf, size_t len, VipsImage **out, ++ int width, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_thumbnail_image( VipsImage *in, VipsImage **out, int width, ... ) ++int vips_thumbnail_image(VipsImage *in, VipsImage **out, int width, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_thumbnail_source( VipsSource *source, VipsImage **out, +- int width, ... ) ++int vips_thumbnail_source(VipsSource *source, VipsImage **out, ++ int width, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_similarity( VipsImage *in, VipsImage **out, ... ) ++int vips_similarity(VipsImage *in, VipsImage **out, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_rotate( VipsImage *in, VipsImage **out, double angle, ... ) ++int vips_rotate(VipsImage *in, VipsImage **out, double angle, ...) + G_GNUC_NULL_TERMINATED; + VIPS_API +-int vips_affine( VipsImage *in, VipsImage **out, +- double a, double b, double c, double d, ... ) ++int vips_affine(VipsImage *in, VipsImage **out, ++ double a, double b, double c, double d, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_resize( VipsImage *in, VipsImage **out, double scale, ... ) ++int vips_resize(VipsImage *in, VipsImage **out, double scale, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_mapim( VipsImage *in, VipsImage **out, VipsImage *index, ... ) ++int vips_mapim(VipsImage *in, VipsImage **out, VipsImage *index, ...) + G_GNUC_NULL_TERMINATED; + + VIPS_API +-int vips_quadratic( VipsImage *in, VipsImage **out, VipsImage *coeff, ... ) ++int vips_quadratic(VipsImage *in, VipsImage **out, VipsImage *coeff, ...) + G_GNUC_NULL_TERMINATED; + + #ifdef __cplusplus +diff --git a/libvips/include/vips/sbuf.h b/libvips/include/vips/sbuf.h +index 1fb2895df6..28ba022927 100644 +--- a/libvips/include/vips/sbuf.h ++++ b/libvips/include/vips/sbuf.h +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -42,24 +42,24 @@ extern "C" { + #endif /*__cplusplus*/ + + #define VIPS_TYPE_SBUF (vips_sbuf_get_type()) +-#define VIPS_SBUF( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_SBUF, VipsSbuf )) +-#define VIPS_SBUF_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_SBUF, VipsSbufClass)) +-#define VIPS_IS_SBUF( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_SBUF )) +-#define VIPS_IS_SBUF_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_SBUF )) +-#define VIPS_SBUF_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_SBUF, VipsSbufClass )) ++#define VIPS_SBUF(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_SBUF, VipsSbuf)) ++#define VIPS_SBUF_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_SBUF, VipsSbufClass)) ++#define VIPS_IS_SBUF(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_SBUF)) ++#define VIPS_IS_SBUF_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_SBUF)) ++#define VIPS_SBUF_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_SBUF, VipsSbufClass)) + + #define VIPS_SBUF_BUFFER_SIZE (4096) + + /* Layer over source: read with an input buffer. +- * ++ * + * Libraries like libjpeg do their own input buffering and need raw IO, but + * others, like radiance, need to parse the input into lines. A buffered read + * class is very convenient. +@@ -96,46 +96,41 @@ typedef struct _VipsSbufClass { + } VipsSbufClass; + + VIPS_API +-GType vips_sbuf_get_type( void ); ++GType vips_sbuf_get_type(void); + + VIPS_API +-VipsSbuf *vips_sbuf_new_from_source( VipsSource *source ); ++VipsSbuf *vips_sbuf_new_from_source(VipsSource *source); + + VIPS_API +-void vips_sbuf_unbuffer( VipsSbuf *sbuf ); ++void vips_sbuf_unbuffer(VipsSbuf *sbuf); + + VIPS_API +-int vips_sbuf_getc( VipsSbuf *sbuf ); +-#define VIPS_SBUF_GETC( S ) ( \ +- (S)->read_point < (S)->chars_in_buffer ? \ +- (S)->input_buffer[(S)->read_point++] : \ +- vips_sbuf_getc( S ) \ +-) ++int vips_sbuf_getc(VipsSbuf *sbuf); ++#define VIPS_SBUF_GETC(S) ( \ ++ (S)->read_point < (S)->chars_in_buffer ? (S)->input_buffer[(S)->read_point++] : vips_sbuf_getc(S)) + VIPS_API +-void vips_sbuf_ungetc( VipsSbuf *sbuf ); +-#define VIPS_SBUF_UNGETC( S ) { \ +- if( (S)->read_point > 0 ) \ +- (S)->read_point -= 1; \ +-} ++void vips_sbuf_ungetc(VipsSbuf *sbuf); ++#define VIPS_SBUF_UNGETC(S) \ ++ { \ ++ if ((S)->read_point > 0) \ ++ (S)->read_point -= 1; \ ++ } + + VIPS_API +-int vips_sbuf_require( VipsSbuf *sbuf, int require ); +-#define VIPS_SBUF_REQUIRE( S, R ) ( \ +- (S)->read_point + (R) <= (S)->chars_in_buffer ? \ +- 0 : \ +- vips_sbuf_require( (S), (R) ) \ +-) +-#define VIPS_SBUF_PEEK( S ) ((S)->input_buffer + (S)->read_point) +-#define VIPS_SBUF_FETCH( S ) ((S)->input_buffer[(S)->read_point++]) ++int vips_sbuf_require(VipsSbuf *sbuf, int require); ++#define VIPS_SBUF_REQUIRE(S, R) ( \ ++ (S)->read_point + (R) <= (S)->chars_in_buffer ? 0 : vips_sbuf_require((S), (R))) ++#define VIPS_SBUF_PEEK(S) ((S)->input_buffer + (S)->read_point) ++#define VIPS_SBUF_FETCH(S) ((S)->input_buffer[(S)->read_point++]) + + VIPS_API +-const char *vips_sbuf_get_line( VipsSbuf *sbuf ); ++const char *vips_sbuf_get_line(VipsSbuf *sbuf); + VIPS_API +-char *vips_sbuf_get_line_copy( VipsSbuf *sbuf ); ++char *vips_sbuf_get_line_copy(VipsSbuf *sbuf); + VIPS_API +-const char *vips_sbuf_get_non_whitespace( VipsSbuf *sbuf ); ++const char *vips_sbuf_get_non_whitespace(VipsSbuf *sbuf); + VIPS_API +-int vips_sbuf_skip_whitespace( VipsSbuf *sbuf ); ++int vips_sbuf_skip_whitespace(VipsSbuf *sbuf); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/semaphore.h b/libvips/include/vips/semaphore.h +index 0762aa4404..435044d786 100644 +--- a/libvips/include/vips/semaphore.h ++++ b/libvips/include/vips/semaphore.h +@@ -9,28 +9,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -56,17 +56,17 @@ typedef struct { + } VipsSemaphore; + + VIPS_API +-int vips_semaphore_up( VipsSemaphore *s ); ++int vips_semaphore_up(VipsSemaphore *s); + VIPS_API +-int vips_semaphore_down( VipsSemaphore *s ); ++int vips_semaphore_down(VipsSemaphore *s); + VIPS_API +-int vips_semaphore_upn( VipsSemaphore *s, int n ); ++int vips_semaphore_upn(VipsSemaphore *s, int n); + VIPS_API +-int vips_semaphore_downn( VipsSemaphore *s, int n ); ++int vips_semaphore_downn(VipsSemaphore *s, int n); + VIPS_API +-void vips_semaphore_destroy( VipsSemaphore *s ); ++void vips_semaphore_destroy(VipsSemaphore *s); + VIPS_API +-void vips_semaphore_init( VipsSemaphore *s, int v, char *name ); ++void vips_semaphore_init(VipsSemaphore *s, int v, char *name); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/thread.h b/libvips/include/vips/thread.h +index ac3cd5283b..6c7ba6ada7 100644 +--- a/libvips/include/vips/thread.h ++++ b/libvips/include/vips/thread.h +@@ -4,28 +4,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -40,32 +40,32 @@ extern "C" { + * glib 2.32+ + */ + VIPS_API +-GMutex *vips_g_mutex_new( void ); ++GMutex *vips_g_mutex_new(void); + VIPS_API +-void vips_g_mutex_free( GMutex * ); ++void vips_g_mutex_free(GMutex *); + + /* Same for GCond. + */ + VIPS_API +-GCond *vips_g_cond_new( void ); ++GCond *vips_g_cond_new(void); + VIPS_API +-void vips_g_cond_free( GCond * ); ++void vips_g_cond_free(GCond *); + + /* ... and for GThread. + */ + VIPS_API +-GThread *vips_g_thread_new( const char *, GThreadFunc, gpointer ); ++GThread *vips_g_thread_new(const char *, GThreadFunc, gpointer); + VIPS_API +-void *vips_g_thread_join( GThread *thread ); ++void *vips_g_thread_join(GThread *thread); + + VIPS_API +-gboolean vips_thread_isvips( void ); ++gboolean vips_thread_isvips(void); + + typedef struct _VipsThreadset VipsThreadset; +-VipsThreadset *vips_threadset_new( int max_threads ); +-int vips_threadset_run( VipsThreadset *set, +- const char *domain, GFunc func, gpointer data ); +-void vips_threadset_free( VipsThreadset *set ); ++VipsThreadset *vips_threadset_new(int max_threads); ++int vips_threadset_run(VipsThreadset *set, ++ const char *domain, GFunc func, gpointer data); ++void vips_threadset_free(VipsThreadset *set); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/threadpool.h b/libvips/include/vips/threadpool.h +index 1b50aa8552..77230f3128 100644 +--- a/libvips/include/vips/threadpool.h ++++ b/libvips/include/vips/threadpool.h +@@ -11,28 +11,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,25 +51,24 @@ + extern "C" { + #endif /*__cplusplus*/ + +- + /* Per-thread state. Allocate functions can use these members to + * communicate with work functions. + */ + + #define VIPS_TYPE_THREAD_STATE (vips_thread_state_get_type()) +-#define VIPS_THREAD_STATE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_THREAD_STATE, VipsThreadState )) +-#define VIPS_THREAD_STATE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_THREAD_STATE, VipsThreadStateClass)) +-#define VIPS_IS_THREAD_STATE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_THREAD_STATE )) +-#define VIPS_IS_THREAD_STATE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_THREAD_STATE )) +-#define VIPS_THREAD_STATE_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_THREAD_STATE, VipsThreadStateClass )) ++#define VIPS_THREAD_STATE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_THREAD_STATE, VipsThreadState)) ++#define VIPS_THREAD_STATE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_THREAD_STATE, VipsThreadStateClass)) ++#define VIPS_IS_THREAD_STATE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_THREAD_STATE)) ++#define VIPS_IS_THREAD_STATE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_THREAD_STATE)) ++#define VIPS_THREAD_STATE_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_THREAD_STATE, VipsThreadStateClass)) + + typedef struct _VipsThreadState { + VipsObject parent_object; +@@ -80,9 +79,9 @@ typedef struct _VipsThreadState { + VipsImage *im; + + /* This region is created and destroyed by the threadpool for the +- * use of the worker. ++ * use of the worker. + */ +- VipsRegion *reg; ++ VipsRegion *reg; + + /* Neither used nor set, do what you like with them. + */ +@@ -95,7 +94,7 @@ typedef struct _VipsThreadState { + + /* The client data passed to the enclosing vips_threadpool_run(). + */ +- void *a; ++ void *a; + + /* Set in allocate to stall this thread for a moment. Handy for + * debugging race conditions. +@@ -111,7 +110,7 @@ typedef struct _VipsThreadStateClass { + } VipsThreadStateClass; + + VIPS_API +-void *vips_thread_state_set( VipsObject *object, void *a, void *b ); ++void *vips_thread_state_set(VipsObject *object, void *a, void *b); + + /* Don't put spaces around void here, it breaks gtk-doc. + */ +@@ -119,39 +118,39 @@ VIPS_API + GType vips_thread_state_get_type(void); + + VIPS_API +-VipsThreadState *vips_thread_state_new( VipsImage *im, void *a ); ++VipsThreadState *vips_thread_state_new(VipsImage *im, void *a); + + /* Constructor for per-thread state. + */ +-typedef VipsThreadState *(*VipsThreadStartFn)( VipsImage *im, void *a ); ++typedef VipsThreadState *(*VipsThreadStartFn)(VipsImage *im, void *a); + + /* A work allocate function. This is run single-threaded by a worker to +- * set up a new work unit. ++ * set up a new work unit. + * Return non-zero for errors. Set *stop for "no more work to do" + */ +-typedef int (*VipsThreadpoolAllocateFn)( VipsThreadState *state, +- void *a, gboolean *stop ); ++typedef int (*VipsThreadpoolAllocateFn)(VipsThreadState *state, ++ void *a, gboolean *stop); + + /* A work function. This does a unit of work (eg. processing a tile or +- * whatever). Return non-zero for errors. ++ * whatever). Return non-zero for errors. + */ +-typedef int (*VipsThreadpoolWorkFn)( VipsThreadState *state, void *a ); ++typedef int (*VipsThreadpoolWorkFn)(VipsThreadState *state, void *a); + + /* A progress function. This is run by the main thread once for every + * allocation. Return an error to kill computation early. + */ +-typedef int (*VipsThreadpoolProgressFn)( void *a ); ++typedef int (*VipsThreadpoolProgressFn)(void *a); + + VIPS_API +-int vips_threadpool_run( VipsImage *im, +- VipsThreadStartFn start, +- VipsThreadpoolAllocateFn allocate, ++int vips_threadpool_run(VipsImage *im, ++ VipsThreadStartFn start, ++ VipsThreadpoolAllocateFn allocate, + VipsThreadpoolWorkFn work, + VipsThreadpoolProgressFn progress, +- void *a ); ++ void *a); + VIPS_API +-void vips_get_tile_size( VipsImage *im, +- int *tile_width, int *tile_height, int *n_lines ); ++void vips_get_tile_size(VipsImage *im, ++ int *tile_width, int *tile_height, int *n_lines); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/transform.h b/libvips/include/vips/transform.h +index d1684a0520..148ae74e27 100644 +--- a/libvips/include/vips/transform.h ++++ b/libvips/include/vips/transform.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2003 The National Gallery ++ Copyright (C) 1991-2003 The National Gallery + +- This program is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -42,10 +42,10 @@ extern "C" { + /* Params for an affine transformation. + */ + typedef struct { +- /* Area of input we can use. This can be smaller than the real input +- * image: we expand the input to add extra pixels for interpolation. ++ /* Area of input we can use. This can be smaller than the real input ++ * image: we expand the input to add extra pixels for interpolation. + */ +- VipsRect iarea; ++ VipsRect iarea; + + /* The area of the output we've been asked to generate. left/top can + * be negative. +@@ -54,33 +54,33 @@ typedef struct { + + /* The transform. + */ +- double a, b, c, d; ++ double a, b, c, d; + double idx, idy; + double odx, ody; + +- double ia, ib, ic, id; /* Inverse of matrix abcd */ ++ double ia, ib, ic, id; /* Inverse of matrix abcd */ + } VipsTransformation; + +-void vips__transform_init( VipsTransformation *trn ); +-int vips__transform_calc_inverse( VipsTransformation *trn ); +-int vips__transform_isidentity( const VipsTransformation *trn ); +-int vips__transform_add( const VipsTransformation *in1, +- const VipsTransformation *in2, +- VipsTransformation *out ); +-void vips__transform_print( const VipsTransformation *trn ); +- +-void vips__transform_forward_point( const VipsTransformation *trn, +- const double x, const double y, double *ox, double *oy ); +-void vips__transform_invert_point( const VipsTransformation *trn, +- const double x, const double y, double *ox, double *oy ); +-void vips__transform_forward_rect( const VipsTransformation *trn, +- const VipsRect *in, VipsRect *out ); +-void vips__transform_invert_rect( const VipsTransformation *trn, +- const VipsRect *in, VipsRect *out ); +- +-void vips__transform_set_area( VipsTransformation * ); +- +-int vips__affine( VipsImage *in, VipsImage *out, VipsTransformation *trn ); ++void vips__transform_init(VipsTransformation *trn); ++int vips__transform_calc_inverse(VipsTransformation *trn); ++int vips__transform_isidentity(const VipsTransformation *trn); ++int vips__transform_add(const VipsTransformation *in1, ++ const VipsTransformation *in2, ++ VipsTransformation *out); ++void vips__transform_print(const VipsTransformation *trn); ++ ++void vips__transform_forward_point(const VipsTransformation *trn, ++ const double x, const double y, double *ox, double *oy); ++void vips__transform_invert_point(const VipsTransformation *trn, ++ const double x, const double y, double *ox, double *oy); ++void vips__transform_forward_rect(const VipsTransformation *trn, ++ const VipsRect *in, VipsRect *out); ++void vips__transform_invert_rect(const VipsTransformation *trn, ++ const VipsRect *in, VipsRect *out); ++ ++void vips__transform_set_area(VipsTransformation *); ++ ++int vips__affine(VipsImage *in, VipsImage *out, VipsTransformation *trn); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/type.h b/libvips/include/vips/type.h +index 9437d31bbd..633ffedbd3 100644 +--- a/libvips/include/vips/type.h ++++ b/libvips/include/vips/type.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -53,13 +53,13 @@ typedef struct _VipsThing { + VIPS_API + GType vips_thing_get_type(void); + VIPS_API +-VipsThing *vips_thing_new( int i ); ++VipsThing *vips_thing_new(int i); + + /* A ref-counted area of memory. Can hold arrays of things as well. + */ + typedef struct _VipsArea { + void *data; +- size_t length; /* 0 if not known */ ++ size_t length; /* 0 if not known */ + + /* If this area represents an array, the number of elements in the + * array. Equal to length / sizeof(element). +@@ -68,15 +68,15 @@ typedef struct _VipsArea { + + /*< private >*/ + +- /* Reference count and lock. ++ /* Reference count and lock. + * + * We could use an atomic int, but this is not a high-traffic data + * structure, so a simple GMutex is OK. + */ + int count; +- GMutex *lock; ++ GMutex *lock; + +- /* Things like ICC profiles need their own free functions. ++ /* Things like ICC profiles need their own free functions. + * + * Set client to anything you like -- VipsArea doesn't use this. + */ +@@ -94,37 +94,36 @@ typedef struct _VipsArea { + } VipsArea; + + VIPS_API +-VipsArea *vips_area_copy( VipsArea *area ); ++VipsArea *vips_area_copy(VipsArea *area); + VIPS_API +-int vips_area_free_cb( void *mem, VipsArea *area ); ++int vips_area_free_cb(void *mem, VipsArea *area); + VIPS_API +-void vips_area_unref( VipsArea *area ); ++void vips_area_unref(VipsArea *area); + + VIPS_API +-VipsArea *vips_area_new( VipsCallbackFn free_fn, void *data ); ++VipsArea *vips_area_new(VipsCallbackFn free_fn, void *data); + VIPS_API +-VipsArea *vips_area_new_array( GType type, size_t sizeof_type, int n ); ++VipsArea *vips_area_new_array(GType type, size_t sizeof_type, int n); + VIPS_API +-VipsArea *vips_area_new_array_object( int n ); ++VipsArea *vips_area_new_array_object(int n); + VIPS_API +-void *vips_area_get_data( VipsArea *area, +- size_t *length, int *n, GType *type, size_t *sizeof_type ); ++void *vips_area_get_data(VipsArea *area, ++ size_t *length, int *n, GType *type, size_t *sizeof_type); + + #ifdef VIPS_DEBUG +-#define VIPS_ARRAY_ADDR( X, I ) \ +- (((I) >= 0 && (I) < VIPS_AREA( X )->n) ? \ +- (void *) ((VipsPel *) VIPS_AREA( X )->data + \ +- VIPS_AREA( X )->sizeof_type * (I)) : \ +- (fprintf( stderr, \ +- "VIPS_ARRAY_ADDR: index out of bounds, " \ +- "file \"%s\", line %d\n" \ +- "(index %d should have been within [0,%d])\n", \ +- __FILE__, __LINE__, \ +- (I), VIPS_AREA( X )->n ), NULL )) ++#define VIPS_ARRAY_ADDR(X, I) \ ++ (((I) >= 0 && (I) < VIPS_AREA(X)->n) ? (void *) ((VipsPel *) VIPS_AREA(X)->data + \ ++ VIPS_AREA(X)->sizeof_type * (I)) \ ++ : (fprintf(stderr, \ ++ "VIPS_ARRAY_ADDR: index out of bounds, " \ ++ "file \"%s\", line %d\n" \ ++ "(index %d should have been within [0,%d])\n", \ ++ __FILE__, __LINE__, \ ++ (I), VIPS_AREA(X)->n), \ ++ NULL)) + #else /*!VIPS_DEBUG*/ +-#define VIPS_ARRAY_ADDR( X, I ) \ +- ((void *) \ +- ((VipsPel *) VIPS_AREA( X )->data + VIPS_AREA( X )->sizeof_type * (I))) ++#define VIPS_ARRAY_ADDR(X, I) \ ++ ((void *) ((VipsPel *) VIPS_AREA(X)->data + VIPS_AREA(X)->sizeof_type * (I))) + #endif /*VIPS_DEBUG*/ + + /** +@@ -133,7 +132,7 @@ void *vips_area_get_data( VipsArea *area, + * The #GType for a #VipsArea. + */ + #define VIPS_TYPE_AREA (vips_area_get_type()) +-#define VIPS_AREA( X ) ((VipsArea *) (X)) ++#define VIPS_AREA(X) ((VipsArea *) (X)) + VIPS_API + GType vips_area_get_type(void); + +@@ -153,14 +152,14 @@ GType vips_save_string_get_type(void); + */ + #define VIPS_TYPE_REF_STRING (vips_ref_string_get_type()) + +-typedef struct _VipsRefString { ++typedef struct _VipsRefString { + VipsArea area; + } VipsRefString; + + VIPS_API +-VipsRefString *vips_ref_string_new( const char *str ); ++VipsRefString *vips_ref_string_new(const char *str); + VIPS_API +-const char *vips_ref_string_get( VipsRefString *refstr, size_t *length ); ++const char *vips_ref_string_get(VipsRefString *refstr, size_t *length); + VIPS_API + GType vips_ref_string_get_type(void); + +@@ -171,20 +170,20 @@ GType vips_ref_string_get_type(void); + */ + #define VIPS_TYPE_BLOB (vips_blob_get_type()) + +-typedef struct _VipsBlob { ++typedef struct _VipsBlob { + VipsArea area; + } VipsBlob; + + VIPS_API +-VipsBlob *vips_blob_new( VipsCallbackFn free_fn, +- const void *data, size_t length ); ++VipsBlob *vips_blob_new(VipsCallbackFn free_fn, ++ const void *data, size_t length); + VIPS_API +-VipsBlob *vips_blob_copy( const void *data, size_t length ); ++VipsBlob *vips_blob_copy(const void *data, size_t length); + VIPS_API +-const void *vips_blob_get( VipsBlob *blob, size_t *length ); ++const void *vips_blob_get(VipsBlob *blob, size_t *length); + VIPS_API +-void vips_blob_set( VipsBlob *blob, +- VipsCallbackFn free_fn, const void *data, size_t length ); ++void vips_blob_set(VipsBlob *blob, ++ VipsCallbackFn free_fn, const void *data, size_t length); + VIPS_API + GType vips_blob_get_type(void); + +@@ -195,16 +194,16 @@ GType vips_blob_get_type(void); + */ + #define VIPS_TYPE_ARRAY_DOUBLE (vips_array_double_get_type()) + +-typedef struct _VipsArrayDouble { ++typedef struct _VipsArrayDouble { + VipsArea area; + } VipsArrayDouble; + + VIPS_API +-VipsArrayDouble *vips_array_double_new( const double *array, int n ); ++VipsArrayDouble *vips_array_double_new(const double *array, int n); + VIPS_API +-VipsArrayDouble *vips_array_double_newv( int n, ... ); ++VipsArrayDouble *vips_array_double_newv(int n, ...); + VIPS_API +-double *vips_array_double_get( VipsArrayDouble *array, int *n ); ++double *vips_array_double_get(VipsArrayDouble *array, int *n); + VIPS_API + GType vips_array_double_get_type(void); + +@@ -215,16 +214,16 @@ GType vips_array_double_get_type(void); + */ + #define VIPS_TYPE_ARRAY_INT (vips_array_int_get_type()) + +-typedef struct _VipsArrayInt { ++typedef struct _VipsArrayInt { + VipsArea area; + } VipsArrayInt; + + VIPS_API +-VipsArrayInt *vips_array_int_new( const int *array, int n ); ++VipsArrayInt *vips_array_int_new(const int *array, int n); + VIPS_API +-VipsArrayInt *vips_array_int_newv( int n, ... ); ++VipsArrayInt *vips_array_int_newv(int n, ...); + VIPS_API +-int *vips_array_int_get( VipsArrayInt *array, int *n ); ++int *vips_array_int_get(VipsArrayInt *array, int *n); + VIPS_API + GType vips_array_int_get_type(void); + +@@ -235,7 +234,7 @@ GType vips_array_int_get_type(void); + */ + #define VIPS_TYPE_ARRAY_IMAGE (vips_array_image_get_type()) + +-typedef struct _VipsArrayImage { ++typedef struct _VipsArrayImage { + VipsArea area; + } VipsArrayImage; + +@@ -246,56 +245,56 @@ VIPS_API + GType vips_array_image_get_type(void); + + VIPS_API +-void vips_value_set_area( GValue *value, VipsCallbackFn free_fn, void *data ); ++void vips_value_set_area(GValue *value, VipsCallbackFn free_fn, void *data); + VIPS_API +-void *vips_value_get_area( const GValue *value, size_t *length ); ++void *vips_value_get_area(const GValue *value, size_t *length); + + VIPS_API +-const char *vips_value_get_save_string( const GValue *value ); ++const char *vips_value_get_save_string(const GValue *value); + VIPS_API +-void vips_value_set_save_string( GValue *value, const char *str ); ++void vips_value_set_save_string(GValue *value, const char *str); + VIPS_API +-void vips_value_set_save_stringf( GValue *value, const char *fmt, ... ) +- G_GNUC_PRINTF( 2, 3 ); ++void vips_value_set_save_stringf(GValue *value, const char *fmt, ...) ++ G_GNUC_PRINTF(2, 3); + + VIPS_API +-const char *vips_value_get_ref_string( const GValue *value, size_t *length ); ++const char *vips_value_get_ref_string(const GValue *value, size_t *length); + VIPS_API +-void vips_value_set_ref_string( GValue *value, const char *str ); ++void vips_value_set_ref_string(GValue *value, const char *str); + + VIPS_API +-void *vips_value_get_blob( const GValue *value, size_t *length ); ++void *vips_value_get_blob(const GValue *value, size_t *length); + VIPS_API +-void vips_value_set_blob( GValue *value, +- VipsCallbackFn free_fn, const void *data, size_t length ); ++void vips_value_set_blob(GValue *value, ++ VipsCallbackFn free_fn, const void *data, size_t length); + VIPS_API +-void vips_value_set_blob_free( GValue *value, void *data, size_t length ); ++void vips_value_set_blob_free(GValue *value, void *data, size_t length); + + VIPS_API +-void vips_value_set_array( GValue *value, +- int n, GType type, size_t sizeof_type ); ++void vips_value_set_array(GValue *value, ++ int n, GType type, size_t sizeof_type); + VIPS_API +-void *vips_value_get_array( const GValue *value, +- int *n, GType *type, size_t *sizeof_type ); ++void *vips_value_get_array(const GValue *value, ++ int *n, GType *type, size_t *sizeof_type); + + VIPS_API +-double *vips_value_get_array_double( const GValue *value, int *n ); ++double *vips_value_get_array_double(const GValue *value, int *n); + VIPS_API +-void vips_value_set_array_double( GValue *value, const double *array, int n ); ++void vips_value_set_array_double(GValue *value, const double *array, int n); + + VIPS_API +-int *vips_value_get_array_int( const GValue *value, int *n ); ++int *vips_value_get_array_int(const GValue *value, int *n); + VIPS_API +-void vips_value_set_array_int( GValue *value, const int *array, int n ); ++void vips_value_set_array_int(GValue *value, const int *array, int n); + + VIPS_API +-GObject **vips_value_get_array_object( const GValue *value, int *n ); ++GObject **vips_value_get_array_object(const GValue *value, int *n); + VIPS_API +-void vips_value_set_array_object( GValue *value, int n ); ++void vips_value_set_array_object(GValue *value, int n); + +-/* See also image.h, that has vips_array_image_get(), vips_array_image_new(), +- * vips_value_get_array_image() and vips_value_set_array_image(). They need +- * to be declared after VipsImage. ++/* See also image.h, that has vips_array_image_get(), vips_array_image_new(), ++ * vips_value_get_array_image() and vips_value_set_array_image(). They need ++ * to be declared after VipsImage. + */ + + #ifdef __cplusplus +diff --git a/libvips/include/vips/util.h b/libvips/include/vips/util.h +index 35d9531f62..40ad5ae2db 100644 +--- a/libvips/include/vips/util.h ++++ b/libvips/include/vips/util.h +@@ -1,4 +1,4 @@ +-/* Various useful definitions. ++/* Various useful definitions. + * + * J.Cupitt, 8/4/93 + * 15/7/96 JC +@@ -7,28 +7,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -46,169 +46,204 @@ extern "C" { + */ + #define VIPS_PI (3.14159265358979323846) + +-/* Convert degrees->rads and vice-versa. ++/* Convert degrees->rads and vice-versa. + */ +-#define VIPS_RAD( R ) (((R) / 360.0) * 2.0 * VIPS_PI) +-#define VIPS_DEG( A ) (((A) / (2.0 * VIPS_PI)) * 360.0) ++#define VIPS_RAD(R) (((R) / 360.0) * 2.0 * VIPS_PI) ++#define VIPS_DEG(A) (((A) / (2.0 * VIPS_PI)) * 360.0) + +-#define VIPS_MAX( A, B ) ((A) > (B) ? (A) : (B)) +-#define VIPS_MIN( A, B ) ((A) < (B) ? (A) : (B)) ++#define VIPS_MAX(A, B) ((A) > (B) ? (A) : (B)) ++#define VIPS_MIN(A, B) ((A) < (B) ? (A) : (B)) + +-#define VIPS_CLIP( A, V, B ) VIPS_MAX( (A), VIPS_MIN( (B), (V) ) ) +-#define VIPS_FCLIP( A, V, B ) VIPS_FMAX( (A), VIPS_FMIN( (B), (V) ) ) ++#define VIPS_CLIP(A, V, B) VIPS_MAX((A), VIPS_MIN((B), (V))) ++#define VIPS_FCLIP(A, V, B) VIPS_FMAX((A), VIPS_FMIN((B), (V))) + +-#define VIPS_NUMBER( R ) ((int) (sizeof(R) / sizeof(R[0]))) ++#define VIPS_NUMBER(R) ((int) (sizeof(R) / sizeof(R[0]))) + +-#define VIPS_ABS( X ) (((X) >= 0) ? (X) : -(X)) ++#define VIPS_ABS(X) (((X) >= 0) ? (X) : -(X)) + + /* The built-in isnan and isinf functions provided by gcc 4+ and clang are + * up to 7x faster than their libc equivalent included from . + */ + #if defined(__clang__) || (__GNUC__ >= 4) +-#define VIPS_ISNAN( V ) __builtin_isnan( V ) +-#define VIPS_FLOOR( V ) __builtin_floor( V ) +-#define VIPS_CEIL( V ) __builtin_ceil( V ) +-#define VIPS_RINT( V ) __builtin_rint( V ) +-#define VIPS_ROUND( V ) __builtin_round( V ) +-#define VIPS_FABS( V ) __builtin_fabs( V ) +-#define VIPS_FMAX( A, B ) __builtin_fmax( A, B ) +-#define VIPS_FMIN( A, B ) __builtin_fmin( A, B ) ++#define VIPS_ISNAN(V) __builtin_isnan(V) ++#define VIPS_FLOOR(V) __builtin_floor(V) ++#define VIPS_CEIL(V) __builtin_ceil(V) ++#define VIPS_RINT(V) __builtin_rint(V) ++#define VIPS_ROUND(V) __builtin_round(V) ++#define VIPS_FABS(V) __builtin_fabs(V) ++#define VIPS_FMAX(A, B) __builtin_fmax(A, B) ++#define VIPS_FMIN(A, B) __builtin_fmin(A, B) + #else +-#define VIPS_ISNAN( V ) isnan( V ) +-#define VIPS_FLOOR( V ) floor( V ) +-#define VIPS_CEIL( V ) ceil( V ) +-#define VIPS_RINT( V ) rint( V ) +-#define VIPS_ROUND( V ) round( V ) +-#define VIPS_FABS( V ) VIPS_ABS( V ) +-#define VIPS_FMAX( A, B ) VIPS_MAX( A, B ) +-#define VIPS_FMIN( A, B ) VIPS_MIN( A, B ) ++#define VIPS_ISNAN(V) isnan(V) ++#define VIPS_FLOOR(V) floor(V) ++#define VIPS_CEIL(V) ceil(V) ++#define VIPS_RINT(V) rint(V) ++#define VIPS_ROUND(V) round(V) ++#define VIPS_FABS(V) VIPS_ABS(V) ++#define VIPS_FMAX(A, B) VIPS_MAX(A, B) ++#define VIPS_FMIN(A, B) VIPS_MIN(A, B) + #endif + + /* Testing status before the function call saves a lot of time. + */ +-#define VIPS_ONCE( ONCE, FUNC, CLIENT ) \ +-G_STMT_START { \ +- if( G_UNLIKELY( (ONCE)->status != G_ONCE_STATUS_READY ) ) \ +- (void) g_once( ONCE, FUNC, CLIENT ); \ +-} G_STMT_END ++#define VIPS_ONCE(ONCE, FUNC, CLIENT) \ ++ G_STMT_START \ ++ { \ ++ if (G_UNLIKELY((ONCE)->status != G_ONCE_STATUS_READY)) \ ++ (void) g_once(ONCE, FUNC, CLIENT); \ ++ } \ ++ G_STMT_END + + /* VIPS_RINT() does "bankers rounding", it rounds to the nearest even integer. + * For things like image geometry, we want strict nearest int. + * +- * If you know it's unsigned, _UINT is a little faster. ++ * If you know it's unsigned, _UINT is a little faster. + */ +-#define VIPS_ROUND_INT( R ) ((int) ((R) > 0 ? ((R) + 0.5) : ((R) - 0.5))) +-#define VIPS_ROUND_UINT( R ) ((int) ((R) + 0.5)) ++#define VIPS_ROUND_INT(R) ((int) ((R) > 0 ? ((R) + 0.5) : ((R) -0.5))) ++#define VIPS_ROUND_UINT(R) ((int) ((R) + 0.5)) + + /* Round N down and up to the nearest multiple of P. + */ +-#define VIPS_ROUND_DOWN( N, P ) ((N) - ((N) % (P))) +-#define VIPS_ROUND_UP( N, P ) (VIPS_ROUND_DOWN( (N) + (P) - 1, (P) )) +- +-#define VIPS_SWAP( TYPE, A, B ) \ +-G_STMT_START { \ +- TYPE t = (A); \ +- (A) = (B); \ +- (B) = t; \ +-} G_STMT_END ++#define VIPS_ROUND_DOWN(N, P) ((N) - ((N) % (P))) ++#define VIPS_ROUND_UP(N, P) (VIPS_ROUND_DOWN((N) + (P) -1, (P))) ++ ++#define VIPS_SWAP(TYPE, A, B) \ ++ G_STMT_START \ ++ { \ ++ TYPE t = (A); \ ++ (A) = (B); \ ++ (B) = t; \ ++ } \ ++ G_STMT_END + + /* Duff's device. Do OPERation N times in a 16-way unrolled loop. + */ +-#define VIPS_UNROLL( N, OPER ) \ +-G_STMT_START { \ +- if( (N) ) { \ +- int duff_count = ((N) + 15) / 16; \ +- \ +- switch( (N) % 16 ) { \ +- case 0: do { OPER; \ +- case 15: OPER; \ +- case 14: OPER; \ +- case 13: OPER; \ +- case 12: OPER; \ +- case 11: OPER; \ +- case 10: OPER; \ +- case 9: OPER; \ +- case 8: OPER; \ +- case 7: OPER; \ +- case 6: OPER; \ +- case 5: OPER; \ +- case 4: OPER; \ +- case 3: OPER; \ +- case 2: OPER; \ +- case 1: OPER; \ +- } while( --duff_count > 0 ); \ ++#define VIPS_UNROLL(N, OPER) \ ++ G_STMT_START \ ++ { \ ++ if ((N)) { \ ++ int duff_count = ((N) + 15) / 16; \ ++\ ++ switch ((N) % 16) { \ ++ case 0: \ ++ do { \ ++ OPER; \ ++ case 15: \ ++ OPER; \ ++ case 14: \ ++ OPER; \ ++ case 13: \ ++ OPER; \ ++ case 12: \ ++ OPER; \ ++ case 11: \ ++ OPER; \ ++ case 10: \ ++ OPER; \ ++ case 9: \ ++ OPER; \ ++ case 8: \ ++ OPER; \ ++ case 7: \ ++ OPER; \ ++ case 6: \ ++ OPER; \ ++ case 5: \ ++ OPER; \ ++ case 4: \ ++ OPER; \ ++ case 3: \ ++ OPER; \ ++ case 2: \ ++ OPER; \ ++ case 1: \ ++ OPER; \ ++ } while (--duff_count > 0); \ ++ } \ + } \ + } \ +-} G_STMT_END ++ G_STMT_END + + /* The g_info() macro was added in 2.40. + */ + #ifndef g_info +-/* Hopefully we have varargs macros. Maybe revisit this. ++/* Hopefully we have varargs macros. Maybe revisit this. + */ + #define g_info(...) \ +- g_log( G_LOG_DOMAIN, G_LOG_LEVEL_INFO, __VA_ARGS__ ) ++ g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, __VA_ARGS__) + #endif + + /* Various integer range clips. Record over/under flows. + */ +-#define VIPS_CLIP_UCHAR( V, SEQ ) \ +-G_STMT_START { \ +- if( (V) < 0 ) { \ +- (SEQ)->underflow++; \ +- (V) = 0; \ +- } \ +- else if( (V) > UCHAR_MAX ) { \ +- (SEQ)->overflow++; \ +- (V) = UCHAR_MAX; \ +- } \ +-} G_STMT_END +- +-#define VIPS_CLIP_CHAR( V, SEQ ) \ +-G_STMT_START { \ +- if( (V) < SCHAR_MIN ) { \ +- (SEQ)->underflow++; \ +- (V) = SCHAR_MIN; \ +- } \ +- else if( (V) > SCHAR_MAX ) { \ +- (SEQ)->overflow++; \ +- (V) = SCHAR_MAX; \ +- } \ +-} G_STMT_END +- +-#define VIPS_CLIP_USHORT( V, SEQ ) \ +-G_STMT_START { \ +- if( (V) < 0 ) { \ +- (SEQ)->underflow++; \ +- (V) = 0; \ +- } \ +- else if( (V) > USHRT_MAX ) { \ +- (SEQ)->overflow++; \ +- (V) = USHRT_MAX; \ +- } \ +-} G_STMT_END +- +-#define VIPS_CLIP_SHORT( V, SEQ ) \ +-G_STMT_START { \ +- if( (V) < SHRT_MIN ) { \ +- (SEQ)->underflow++; \ +- (V) = SHRT_MIN; \ +- } \ +- else if( (V) > SHRT_MAX ) { \ +- (SEQ)->overflow++; \ +- (V) = SHRT_MAX; \ +- } \ +-} G_STMT_END +- +-#define VIPS_CLIP_UINT( V, SEQ ) \ +-G_STMT_START { \ +- if( (V) < 0 ) { \ +- (SEQ)->underflow++; \ +- (V) = 0; \ +- } \ +-} G_STMT_END +- +-#define VIPS_CLIP_NONE( V, SEQ ) {} ++#define VIPS_CLIP_UCHAR(V, SEQ) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < 0) { \ ++ (SEQ)->underflow++; \ ++ (V) = 0; \ ++ } \ ++ else if ((V) > UCHAR_MAX) { \ ++ (SEQ)->overflow++; \ ++ (V) = UCHAR_MAX; \ ++ } \ ++ } \ ++ G_STMT_END ++ ++#define VIPS_CLIP_CHAR(V, SEQ) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < SCHAR_MIN) { \ ++ (SEQ)->underflow++; \ ++ (V) = SCHAR_MIN; \ ++ } \ ++ else if ((V) > SCHAR_MAX) { \ ++ (SEQ)->overflow++; \ ++ (V) = SCHAR_MAX; \ ++ } \ ++ } \ ++ G_STMT_END ++ ++#define VIPS_CLIP_USHORT(V, SEQ) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < 0) { \ ++ (SEQ)->underflow++; \ ++ (V) = 0; \ ++ } \ ++ else if ((V) > USHRT_MAX) { \ ++ (SEQ)->overflow++; \ ++ (V) = USHRT_MAX; \ ++ } \ ++ } \ ++ G_STMT_END ++ ++#define VIPS_CLIP_SHORT(V, SEQ) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < SHRT_MIN) { \ ++ (SEQ)->underflow++; \ ++ (V) = SHRT_MIN; \ ++ } \ ++ else if ((V) > SHRT_MAX) { \ ++ (SEQ)->overflow++; \ ++ (V) = SHRT_MAX; \ ++ } \ ++ } \ ++ G_STMT_END ++ ++#define VIPS_CLIP_UINT(V, SEQ) \ ++ G_STMT_START \ ++ { \ ++ if ((V) < 0) { \ ++ (SEQ)->underflow++; \ ++ (V) = 0; \ ++ } \ ++ } \ ++ G_STMT_END ++ ++#define VIPS_CLIP_NONE(V, SEQ) \ ++ { \ ++ } + + /* Not all platforms have PATH_MAX (eg. Hurd) and we don't need a platform one + * anyway, just a static buffer big enough for almost any path. +@@ -216,121 +251,121 @@ G_STMT_START { \ + #define VIPS_PATH_MAX (4096) + + VIPS_API +-const char *vips_enum_string( GType enm, int value ); ++const char *vips_enum_string(GType enm, int value); + VIPS_API +-const char *vips_enum_nick( GType enm, int value ); ++const char *vips_enum_nick(GType enm, int value); + VIPS_API +-int vips_enum_from_nick( const char *domain, GType type, const char *str ); ++int vips_enum_from_nick(const char *domain, GType type, const char *str); + VIPS_API +-int vips_flags_from_nick( const char *domain, GType type, const char *nick ); ++int vips_flags_from_nick(const char *domain, GType type, const char *nick); + + VIPS_API +-gboolean vips_slist_equal( GSList *l1, GSList *l2 ); ++gboolean vips_slist_equal(GSList *l1, GSList *l2); + VIPS_API +-void *vips_slist_map2( GSList *list, VipsSListMap2Fn fn, void *a, void *b ); ++void *vips_slist_map2(GSList *list, VipsSListMap2Fn fn, void *a, void *b); + VIPS_API +-void *vips_slist_map2_rev( GSList *list, VipsSListMap2Fn fn, void *a, void *b ); ++void *vips_slist_map2_rev(GSList *list, VipsSListMap2Fn fn, void *a, void *b); + VIPS_API +-void *vips_slist_map4( GSList *list, +- VipsSListMap4Fn fn, void *a, void *b, void *c, void *d ); ++void *vips_slist_map4(GSList *list, ++ VipsSListMap4Fn fn, void *a, void *b, void *c, void *d); + VIPS_API +-void *vips_slist_fold2( GSList *list, void *start, +- VipsSListFold2Fn fn, void *a, void *b ); ++void *vips_slist_fold2(GSList *list, void *start, ++ VipsSListFold2Fn fn, void *a, void *b); + VIPS_API +-GSList *vips_slist_filter( GSList *list, VipsSListMap2Fn fn, void *a, void *b ); ++GSList *vips_slist_filter(GSList *list, VipsSListMap2Fn fn, void *a, void *b); + VIPS_API +-void vips_slist_free_all( GSList *list ); ++void vips_slist_free_all(GSList *list); + VIPS_API +-void *vips_map_equal( void *a, void *b ); ++void *vips_map_equal(void *a, void *b); + + VIPS_API +-void *vips_hash_table_map( GHashTable *hash, +- VipsSListMap2Fn fn, void *a, void *b ); ++void *vips_hash_table_map(GHashTable *hash, ++ VipsSListMap2Fn fn, void *a, void *b); + + VIPS_API +-char *vips_strncpy( char *dest, const char *src, int n ); ++char *vips_strncpy(char *dest, const char *src, int n); + VIPS_API +-char *vips_strrstr( const char *haystack, const char *needle ); ++char *vips_strrstr(const char *haystack, const char *needle); + VIPS_API +-gboolean vips_ispostfix( const char *a, const char *b ); ++gboolean vips_ispostfix(const char *a, const char *b); + VIPS_API +-gboolean vips_iscasepostfix( const char *a, const char *b ); ++gboolean vips_iscasepostfix(const char *a, const char *b); + VIPS_API +-gboolean vips_isprefix( const char *a, const char *b ); ++gboolean vips_isprefix(const char *a, const char *b); + VIPS_API +-char *vips_break_token( char *str, const char *brk ); ++char *vips_break_token(char *str, const char *brk); + +-void vips__chomp( char *str ); ++void vips__chomp(char *str); + + VIPS_API +-int vips_vsnprintf( char *str, size_t size, const char *format, va_list ap ); ++int vips_vsnprintf(char *str, size_t size, const char *format, va_list ap); + VIPS_API +-int vips_snprintf( char *str, size_t size, const char *format, ... ) +- G_GNUC_PRINTF( 3, 4 ); ++int vips_snprintf(char *str, size_t size, const char *format, ...) ++ G_GNUC_PRINTF(3, 4); + + VIPS_API +-int vips_filename_suffix_match( const char *path, const char *suffixes[] ); ++int vips_filename_suffix_match(const char *path, const char *suffixes[]); + + VIPS_API +-gint64 vips_file_length( int fd ); ++gint64 vips_file_length(int fd); + /* TODO(kleisauke): VIPS_API is required by vipsedit. + */ + VIPS_API +-int vips__write( int fd, const void *buf, size_t count ); ++int vips__write(int fd, const void *buf, size_t count); + + /* TODO(kleisauke): VIPS_API is required by test_connections. + */ + VIPS_API +-int vips__open( const char *filename, int flags, int mode ); +-int vips__open_read( const char *filename ); +-FILE *vips__fopen( const char *filename, const char *mode ); ++int vips__open(const char *filename, int flags, int mode); ++int vips__open_read(const char *filename); ++FILE *vips__fopen(const char *filename, const char *mode); + +-FILE *vips__file_open_read( const char *filename, +- const char *fallback_dir, gboolean text_mode ); +-FILE *vips__file_open_write( const char *filename, +- gboolean text_mode ); ++FILE *vips__file_open_read(const char *filename, ++ const char *fallback_dir, gboolean text_mode); ++FILE *vips__file_open_write(const char *filename, ++ gboolean text_mode); + /* TODO(kleisauke): VIPS_API is required by vipsedit. + */ + VIPS_API +-char *vips__file_read( FILE *fp, const char *name, size_t *length_out ); +-char *vips__file_read_name( const char *name, const char *fallback_dir, +- size_t *length_out ); +-int vips__file_write( void *data, size_t size, size_t nmemb, FILE *stream ); ++char *vips__file_read(FILE *fp, const char *name, size_t *length_out); ++char *vips__file_read_name(const char *name, const char *fallback_dir, ++ size_t *length_out); ++int vips__file_write(void *data, size_t size, size_t nmemb, FILE *stream); + /* TODO(kleisauke): VIPS_API is required by the magick module. + */ + VIPS_API +-gint64 vips__get_bytes( const char *filename, +- unsigned char buf[], gint64 len ); +-int vips__fgetc( FILE *fp ); ++gint64 vips__get_bytes(const char *filename, ++ unsigned char buf[], gint64 len); ++int vips__fgetc(FILE *fp); + +-GValue *vips__gvalue_ref_string_new( const char *text ); +-void vips__gslist_gvalue_free( GSList *list ); +-GSList *vips__gslist_gvalue_copy( const GSList *list ); +-GSList *vips__gslist_gvalue_merge( GSList *a, const GSList *b ); +-char *vips__gslist_gvalue_get( const GSList *list ); ++GValue *vips__gvalue_ref_string_new(const char *text); ++void vips__gslist_gvalue_free(GSList *list); ++GSList *vips__gslist_gvalue_copy(const GSList *list); ++GSList *vips__gslist_gvalue_merge(GSList *a, const GSList *b); ++char *vips__gslist_gvalue_get(const GSList *list); + +-gint64 vips__seek_no_error( int fd, gint64 pos, int whence ); ++gint64 vips__seek_no_error(int fd, gint64 pos, int whence); + /* TODO(kleisauke): VIPS_API is required by vipsedit. + */ + VIPS_API +-gint64 vips__seek( int fd, gint64 pos, int whence ); +-int vips__ftruncate( int fd, gint64 pos ); ++gint64 vips__seek(int fd, gint64 pos, int whence); ++int vips__ftruncate(int fd, gint64 pos); + VIPS_API +-int vips_existsf( const char *name, ... ) +- G_GNUC_PRINTF( 1, 2 ); ++int vips_existsf(const char *name, ...) ++ G_GNUC_PRINTF(1, 2); + VIPS_API +-int vips_isdirf( const char *name, ... ) +- G_GNUC_PRINTF( 1, 2 ); ++int vips_isdirf(const char *name, ...) ++ G_GNUC_PRINTF(1, 2); + VIPS_API +-int vips_mkdirf( const char *name, ... ) +- G_GNUC_PRINTF( 1, 2 ); ++int vips_mkdirf(const char *name, ...) ++ G_GNUC_PRINTF(1, 2); + VIPS_API +-int vips_rmdirf( const char *name, ... ) +- G_GNUC_PRINTF( 1, 2 ); ++int vips_rmdirf(const char *name, ...) ++ G_GNUC_PRINTF(1, 2); + VIPS_API +-int vips_rename( const char *old_name, const char *new_name ); ++int vips_rename(const char *old_name, const char *new_name); + +-/** ++/** + * VipsToken: + * @VIPS_TOKEN_LEFT: left bracket + * @VIPS_TOKEN_RIGHT: right bracket +@@ -339,7 +374,7 @@ int vips_rename( const char *old_name, const char *new_name ); + * @VIPS_TOKEN_COMMA: comma + * + * Tokens returned by the vips lexical analyzer, see vips__token_get(). This +- * is used to parse option strings for arguments. ++ * is used to parse option strings for arguments. + * + * Left and right brackets can be any of (, {, [, <. + * +@@ -348,56 +383,56 @@ int vips_rename( const char *old_name, const char *new_name ); + * + */ + typedef enum { +- VIPS_TOKEN_LEFT = 1, ++ VIPS_TOKEN_LEFT = 1, + VIPS_TOKEN_RIGHT, + VIPS_TOKEN_STRING, + VIPS_TOKEN_EQUALS, + VIPS_TOKEN_COMMA + } VipsToken; + +-const char *vips__token_get( const char *buffer, +- VipsToken *token, char *string, int size ); +-const char *vips__token_must( const char *buffer, VipsToken *token, +- char *string, int size ); +-const char *vips__token_need( const char *buffer, VipsToken need_token, +- char *string, int size ); +-const char *vips__token_segment( const char *p, VipsToken *token, +- char *string, int size ); +-const char *vips__token_segment_need( const char *p, VipsToken need_token, +- char *string, int size ); +-const char *vips__find_rightmost_brackets( const char *p ); ++const char *vips__token_get(const char *buffer, ++ VipsToken *token, char *string, int size); ++const char *vips__token_must(const char *buffer, VipsToken *token, ++ char *string, int size); ++const char *vips__token_need(const char *buffer, VipsToken need_token, ++ char *string, int size); ++const char *vips__token_segment(const char *p, VipsToken *token, ++ char *string, int size); ++const char *vips__token_segment_need(const char *p, VipsToken need_token, ++ char *string, int size); ++const char *vips__find_rightmost_brackets(const char *p); + /* TODO(kleisauke): VIPS_API is required by libvips-cpp and vipsheader. + */ + VIPS_API +-void vips__filename_split8( const char *name, +- char *filename, char *option_string ); ++void vips__filename_split8(const char *name, ++ char *filename, char *option_string); + + VIPS_API +-int vips_ispoweroftwo( int p ); ++int vips_ispoweroftwo(int p); + VIPS_API +-int vips_amiMSBfirst( void ); ++int vips_amiMSBfirst(void); + + /* TODO(kleisauke): VIPS_API is required by jpegsave_file_fuzzer. + */ + VIPS_API +-char *vips__temp_name( const char *format ); ++char *vips__temp_name(const char *format); + +-void vips__change_suffix( const char *name, char *out, int mx, +- const char *new_suff, const char **olds, int nolds ); ++void vips__change_suffix(const char *name, char *out, int mx, ++ const char *new_suff, const char **olds, int nolds); + + VIPS_API +-char *vips_realpath( const char *path ); ++char *vips_realpath(const char *path); + +-guint32 vips__random( guint32 seed ); +-guint32 vips__random_add( guint32 seed, int value ); ++guint32 vips__random(guint32 seed); ++guint32 vips__random_add(guint32 seed, int value); + +-const char *vips__icc_dir( void ); +-const char *vips__windows_prefix( void ); ++const char *vips__icc_dir(void); ++const char *vips__windows_prefix(void); + +-char *vips__get_iso8601( void ); ++char *vips__get_iso8601(void); + + VIPS_API +-int vips_strtod( const char *str, double *out ); ++int vips_strtod(const char *str, double *out); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/vector.h b/libvips/include/vips/vector.h +index 6dc4bc322e..3db1fe506e 100644 +--- a/libvips/include/vips/vector.h ++++ b/libvips/include/vips/vector.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -59,7 +59,7 @@ extern "C" { + + #define VIPS_VECTOR_SOURCE_MAX (10) + +-/* An Orc program. ++/* An Orc program. + */ + typedef struct { + /* Handy for debugging. +@@ -67,7 +67,7 @@ typedef struct { + const char *name; + char *unique_name; + +- /* How many resources we've used so far in this codegen. ++ /* How many resources we've used so far in this codegen. + */ + int n_temp; + int n_scanline; +@@ -81,7 +81,7 @@ typedef struct { + * "sl0" onwards. + */ + int sl[VIPS_VECTOR_SOURCE_MAX]; +- int line[VIPS_VECTOR_SOURCE_MAX]; ++ int line[VIPS_VECTOR_SOURCE_MAX]; + + /* Non-scanline sources, "s1" etc. s[0] is the var for "s1". + */ +@@ -92,9 +92,9 @@ typedef struct { + int d1; + + #ifdef HAVE_ORC +- /* The code we have generated. ++ /* The code we have generated. + */ +- OrcProgram *program; ++ OrcProgram *program; + #endif /*HAVE_ORC*/ + + /* Compiled successfully. +@@ -117,64 +117,64 @@ typedef struct { + extern gboolean vips__vector_enabled; + + VIPS_API +-void vips_vector_init( void ); ++void vips_vector_init(void); + VIPS_API +-gboolean vips_vector_isenabled( void ); ++gboolean vips_vector_isenabled(void); + VIPS_API +-void vips_vector_set_enabled( gboolean enabled ); ++void vips_vector_set_enabled(gboolean enabled); + + VIPS_API +-void vips_vector_free( VipsVector *vector ); ++void vips_vector_free(VipsVector *vector); + VIPS_API +-VipsVector *vips_vector_new( const char *name, int dsize ); ++VipsVector *vips_vector_new(const char *name, int dsize); + + VIPS_API +-void vips_vector_constant( VipsVector *vector, +- char *name, int value, int size ); ++void vips_vector_constant(VipsVector *vector, ++ char *name, int value, int size); + VIPS_API +-void vips_vector_source_scanline( VipsVector *vector, +- char *name, int line, int size ); ++void vips_vector_source_scanline(VipsVector *vector, ++ char *name, int line, int size); + VIPS_API +-int vips_vector_source_name( VipsVector *vector, const char *name, int size ); ++int vips_vector_source_name(VipsVector *vector, const char *name, int size); + VIPS_API +-void vips_vector_temporary( VipsVector *vector, const char *name, int size ); ++void vips_vector_temporary(VipsVector *vector, const char *name, int size); + VIPS_API +-int vips_vector_parameter( VipsVector *vector, const char *name, int size ); ++int vips_vector_parameter(VipsVector *vector, const char *name, int size); + VIPS_API +-int vips_vector_destination( VipsVector *vector, const char *name, int size ); ++int vips_vector_destination(VipsVector *vector, const char *name, int size); + VIPS_API +-void vips_vector_asm2( VipsVector *vector, +- const char *op, const char *a, const char *b ); ++void vips_vector_asm2(VipsVector *vector, ++ const char *op, const char *a, const char *b); + VIPS_API +-void vips_vector_asm3( VipsVector *vector, +- const char *op, const char *a, const char *b, const char *c ); ++void vips_vector_asm3(VipsVector *vector, ++ const char *op, const char *a, const char *b, const char *c); + VIPS_API +-gboolean vips_vector_full( VipsVector *vector ); ++gboolean vips_vector_full(VipsVector *vector); + + VIPS_API +-gboolean vips_vector_compile( VipsVector *vector ); ++gboolean vips_vector_compile(VipsVector *vector); + + VIPS_API +-void vips_vector_print( VipsVector *vector ); ++void vips_vector_print(VipsVector *vector); + + VIPS_API +-void vips_executor_set_program( VipsExecutor *executor, +- VipsVector *vector, int n ); ++void vips_executor_set_program(VipsExecutor *executor, ++ VipsVector *vector, int n); + VIPS_API +-void vips_executor_set_scanline( VipsExecutor *executor, +- VipsRegion *ir, int x, int y ); ++void vips_executor_set_scanline(VipsExecutor *executor, ++ VipsRegion *ir, int x, int y); + VIPS_API +-void vips_executor_set_destination( VipsExecutor *executor, void *value ); ++void vips_executor_set_destination(VipsExecutor *executor, void *value); + VIPS_API +-void vips_executor_set_parameter( VipsExecutor *executor, int var, int value ); ++void vips_executor_set_parameter(VipsExecutor *executor, int var, int value); + VIPS_API +-void vips_executor_set_array( VipsExecutor *executor, int var, void *value ); ++void vips_executor_set_array(VipsExecutor *executor, int var, void *value); + + VIPS_API +-void vips_executor_run( VipsExecutor *executor ); ++void vips_executor_run(VipsExecutor *executor); + + VIPS_API +-void vips_vector_to_fixed_point( double *in, int *out, int n, int scale ); ++void vips_vector_to_fixed_point(double *in, int *out, int n, int scale); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/video.h b/libvips/include/vips/video.h +index 474f2303b4..b5c9b0c390 100644 +--- a/libvips/include/vips/video.h ++++ b/libvips/include/vips/video.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -39,11 +39,11 @@ extern "C" { + #endif /*__cplusplus*/ + + VIPS_DEPRECATED +-int im_video_v4l1( VipsImage *im, const char *device, ++int im_video_v4l1(VipsImage *im, const char *device, + int channel, int brightness, int colour, int contrast, int hue, +- int ngrabs ); ++ int ngrabs); + VIPS_DEPRECATED +-int im_video_test( VipsImage *im, int brightness, int error ); ++int im_video_test(VipsImage *im, int brightness, int error); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/vips.h b/libvips/include/vips/vips.h +index 24b7d391cd..7f93d298b4 100644 +--- a/libvips/include/vips/vips.h ++++ b/libvips/include/vips/vips.h +@@ -52,28 +52,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -145,47 +145,48 @@ extern "C" { + /* We can't use _ here since this will be compiled by our clients and they may + * not have _(). + */ +-#define VIPS_INIT( ARGV0 ) \ +- (vips_version( 3 ) - vips_version( 5 ) != \ +- VIPS_LIBRARY_CURRENT - VIPS_LIBRARY_AGE ? ( \ +- g_warning( "ABI mismatch" ), \ +- g_warning( "library has ABI version %d", \ +- vips_version( 3 ) - vips_version( 5 ) ), \ +- g_warning( "application needs ABI version %d", \ +- VIPS_LIBRARY_CURRENT - VIPS_LIBRARY_AGE ), \ +- vips_error( "vips_init", "ABI mismatch" ), \ +- -1 ) : \ +- vips_init( ARGV0 )) ++#define VIPS_INIT(ARGV0) \ ++ (vips_version(3) - vips_version(5) != \ ++ VIPS_LIBRARY_CURRENT - VIPS_LIBRARY_AGE \ ++ ? ( \ ++ g_warning("ABI mismatch"), \ ++ g_warning("library has ABI version %d", \ ++ vips_version(3) - vips_version(5)), \ ++ g_warning("application needs ABI version %d", \ ++ VIPS_LIBRARY_CURRENT - VIPS_LIBRARY_AGE), \ ++ vips_error("vips_init", "ABI mismatch"), \ ++ -1) \ ++ : vips_init(ARGV0)) + + VIPS_API +-int vips_init( const char *argv0 ); ++int vips_init(const char *argv0); + VIPS_API +-const char *vips_get_argv0( void ); ++const char *vips_get_argv0(void); + VIPS_API +-const char *vips_get_prgname( void ); ++const char *vips_get_prgname(void); + VIPS_API +-void vips_shutdown( void ); ++void vips_shutdown(void); + VIPS_API +-void vips_thread_shutdown( void ); ++void vips_thread_shutdown(void); + + VIPS_API +-void vips_add_option_entries( GOptionGroup *option_group ); ++void vips_add_option_entries(GOptionGroup *option_group); + + VIPS_API +-void vips_leak_set( gboolean leak ); ++void vips_leak_set(gboolean leak); + + VIPS_API +-void vips_block_untrusted_set( gboolean state ); ++void vips_block_untrusted_set(gboolean state); + + VIPS_API +-const char *vips_version_string( void ); ++const char *vips_version_string(void); + VIPS_API +-int vips_version( int flag ); ++int vips_version(int flag); + + VIPS_API +-const char *vips_guess_prefix( const char *argv0, const char *env_name ); ++const char *vips_guess_prefix(const char *argv0, const char *env_name); + VIPS_API +-const char *vips_guess_libdir( const char *argv0, const char *env_name ); ++const char *vips_guess_libdir(const char *argv0, const char *env_name); + + #ifdef __cplusplus + } +diff --git a/libvips/include/vips/vips7compat.h b/libvips/include/vips/vips7compat.h +index 1d4ea2a1dd..631ab398a3 100644 +--- a/libvips/include/vips/vips7compat.h ++++ b/libvips/include/vips/vips7compat.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,47 +43,47 @@ extern "C" { + + /* We have this misspelt in earlier versions :( + */ +-#define VIPS_META_IPCT_NAME VIPS_META_IPTC_NAME ++#define VIPS_META_IPCT_NAME VIPS_META_IPTC_NAME + +-#define IM_D93_X0 VIPS_D93_X0 +-#define IM_D93_Y0 VIPS_D93_Y0 +-#define IM_D93_Z0 VIPS_D93_Z0 ++#define IM_D93_X0 VIPS_D93_X0 ++#define IM_D93_Y0 VIPS_D93_Y0 ++#define IM_D93_Z0 VIPS_D93_Z0 + +-#define IM_D75_X0 VIPS_D75_X0 +-#define IM_D75_Y0 VIPS_D75_Y0 +-#define IM_D75_Z0 VIPS_D75_Z0 ++#define IM_D75_X0 VIPS_D75_X0 ++#define IM_D75_Y0 VIPS_D75_Y0 ++#define IM_D75_Z0 VIPS_D75_Z0 + +-#define IM_D65_X0 VIPS_D65_X0 +-#define IM_D65_Y0 VIPS_D65_Y0 +-#define IM_D65_Z0 VIPS_D65_Z0 ++#define IM_D65_X0 VIPS_D65_X0 ++#define IM_D65_Y0 VIPS_D65_Y0 ++#define IM_D65_Z0 VIPS_D65_Z0 + +-#define IM_D55_X0 VIPS_D55_X0 +-#define IM_D55_Y0 VIPS_D55_Y0 +-#define IM_D55_Z0 VIPS_D55_Z0 ++#define IM_D55_X0 VIPS_D55_X0 ++#define IM_D55_Y0 VIPS_D55_Y0 ++#define IM_D55_Z0 VIPS_D55_Z0 + +-#define IM_D50_X0 VIPS_D50_X0 +-#define IM_D50_Y0 VIPS_D50_Y0 +-#define IM_D50_Z0 VIPS_D50_Z0 ++#define IM_D50_X0 VIPS_D50_X0 ++#define IM_D50_Y0 VIPS_D50_Y0 ++#define IM_D50_Z0 VIPS_D50_Z0 + +-#define IM_A_X0 VIPS_A_X0 +-#define IM_A_Y0 VIPS_A_Y0 +-#define IM_A_Z0 VIPS_A_Z0 ++#define IM_A_X0 VIPS_A_X0 ++#define IM_A_Y0 VIPS_A_Y0 ++#define IM_A_Z0 VIPS_A_Z0 + +-#define IM_B_X0 VIPS_B_X0 +-#define IM_B_Y0 VIPS_B_Y0 +-#define IM_B_Z0 VIPS_B_Z0 ++#define IM_B_X0 VIPS_B_X0 ++#define IM_B_Y0 VIPS_B_Y0 ++#define IM_B_Z0 VIPS_B_Z0 + +-#define IM_C_X0 VIPS_C_X0 +-#define IM_C_Y0 VIPS_C_Y0 +-#define IM_C_Z0 VIPS_C_Z0 ++#define IM_C_X0 VIPS_C_X0 ++#define IM_C_Y0 VIPS_C_Y0 ++#define IM_C_Z0 VIPS_C_Z0 + +-#define IM_E_X0 VIPS_E_X0 +-#define IM_E_Y0 VIPS_E_Y0 +-#define IM_E_Z0 VIPS_E_Z0 ++#define IM_E_X0 VIPS_E_X0 ++#define IM_E_Y0 VIPS_E_Y0 ++#define IM_E_Z0 VIPS_E_Z0 + +-#define IM_D3250_X0 VIPS_D3250_X0 +-#define IM_D3250_Y0 VIPS_D3250_Y0 +-#define IM_D3250_Z0 VIPS_D3250_Z0 ++#define IM_D3250_X0 VIPS_D3250_X0 ++#define IM_D3250_Y0 VIPS_D3250_Y0 ++#define IM_D3250_Z0 VIPS_D3250_Z0 + + #define im_col_Lab2XYZ vips_col_Lab2XYZ + #define im_col_XYZ2Lab vips_col_XYZ2Lab +@@ -213,71 +213,71 @@ const guint64 vips__image_sizeof_bandformat[]; + #define im__global_lock vips__global_lock + + VIPS_DEPRECATED +-int im_cp_desc(IMAGE *out, IMAGE *in ); ++int im_cp_desc(IMAGE *out, IMAGE *in); + VIPS_DEPRECATED +-int im_cp_descv (IMAGE * im, ...); ++int im_cp_descv(IMAGE *im, ...); + #define im_cp_desc_array(I, A) vips__image_copy_fields_array(I, A) + VIPS_DEPRECATED +-int im_demand_hint (IMAGE * im, VipsDemandStyle hint, ...); +-#define im_demand_hint_array( A, B, C ) (vips__demand_hint_array( A, B, C ), 0) ++int im_demand_hint(IMAGE *im, VipsDemandStyle hint, ...); ++#define im_demand_hint_array(A, B, C) (vips__demand_hint_array(A, B, C), 0) + + #define im_image(P, W, H, B, F) \ + vips_image_new_from_memory((P), 0, (W), (H), (B), (F)) + + #define im_binfile vips_image_new_from_file_raw + #define im__open_temp vips_image_new_temp_file +-#define im__test_kill( I ) (vips_image_iskilled( I )) +-#define im__start_eval( I ) (vips_image_preeval( I ), vips_image_iskilled( I )) +-#define im__handle_eval( I, W, H ) \ +- (vips_image_eval( I, W, H ), vips_image_iskilled( I )) ++#define im__test_kill(I) (vips_image_iskilled(I)) ++#define im__start_eval(I) (vips_image_preeval(I), vips_image_iskilled(I)) ++#define im__handle_eval(I, W, H) \ ++ (vips_image_eval(I, W, H), vips_image_iskilled(I)) + #define im__end_eval vips_image_posteval + #define im_invalidate vips_image_invalidate_all + #define im_isfile vips_image_isfile +-#define im_printdesc( I ) vips_object_print_dump( VIPS_OBJECT( I ) ) ++#define im_printdesc(I) vips_object_print_dump(VIPS_OBJECT(I)) + + /* im_openout() needs to have this visible. + */ + VIPS_DEPRECATED +-VipsImage *vips_image_new_mode( const char *filename, const char *mode ); ++VipsImage *vips_image_new_mode(const char *filename, const char *mode); + + /* im_image_open_input() needs to have this visible. + */ + VIPS_DEPRECATED +-int vips_image_open_input( VipsImage *image ); ++int vips_image_open_input(VipsImage *image); + + /* im_image_open_output() needs to have this visible. + */ + VIPS_DEPRECATED +-int vips_image_open_output( VipsImage *image ); ++int vips_image_open_output(VipsImage *image); + + /* im_mapfile() needs to have this visible. + */ + VIPS_DEPRECATED +-int vips_mapfile( VipsImage *image ); ++int vips_mapfile(VipsImage *image); + + /* im_mapfilerw() needs to have this visible. + */ + VIPS_DEPRECATED +-int vips_mapfilerw( VipsImage *image ); ++int vips_mapfilerw(VipsImage *image); + + /* im_remapfilerw() needs to have this visible. + */ + VIPS_DEPRECATED +-int vips_remapfilerw( VipsImage *image ); ++int vips_remapfilerw(VipsImage *image); + +-#define im_openout( F ) vips_image_new_mode( F, "w" ) +-#define im_setbuf( F ) vips_image_new( "t" ) ++#define im_openout(F) vips_image_new_mode(F, "w") ++#define im_setbuf(F) vips_image_new("t") + +-#define im_initdesc( image, \ ++#define im_initdesc(image, \ + xsize, ysize, bands, bandbits, bandfmt, coding, \ +- type, xres, yres, xo, yo ) \ +- vips_image_init_fields( image, \ ++ type, xres, yres, xo, yo) \ ++ vips_image_init_fields(image, \ + xsize, ysize, bands, bandfmt, coding, \ +- type, xres, yres ) ++ type, xres, yres) + + #define im__open_image_file vips__open_image_read + #define im_setupout vips_image_write_prepare +-#define im_writeline( Y, IM, P ) vips_image_write_line( IM, Y, P ) ++#define im_writeline(Y, IM, P) vips_image_write_line(IM, Y, P) + + #define im_prepare vips_region_prepare + #define im_prepare_to vips_region_prepare_to +@@ -291,7 +291,7 @@ int vips_remapfilerw( VipsImage *image ); + + #define im__region_no_ownership vips__region_no_ownership + +-#define im_image_sanity( I ) (!vips_object_sanity( VIPS_OBJECT( I ) )) ++#define im_image_sanity(I) (!vips_object_sanity(VIPS_OBJECT(I))) + #define im_image_sanity_all vips_object_sanity_all + #define im__print_all vips_object_print_all + +@@ -299,80 +299,80 @@ int vips_remapfilerw( VipsImage *image ); + */ + + VIPS_DEPRECATED_FOR(vips_init) +-int im_init_world( const char *argv0 ); ++int im_init_world(const char *argv0); + + VIPS_DEPRECATED_FOR(vips_image_new_mode) +-VipsImage *im_open( const char *filename, const char *mode ); ++VipsImage *im_open(const char *filename, const char *mode); + + VIPS_DEPRECATED +-VipsImage *im_open_local( VipsImage *parent, +- const char *filename, const char *mode ); ++VipsImage *im_open_local(VipsImage *parent, ++ const char *filename, const char *mode); + VIPS_DEPRECATED +-int im_open_local_array( VipsImage *parent, +- VipsImage **images, int n, const char *filename, const char *mode ); ++int im_open_local_array(VipsImage *parent, ++ VipsImage **images, int n, const char *filename, const char *mode); + + #define im_callback_fn VipsCallbackFn + + VIPS_DEPRECATED_FOR(g_signal_connect) +-int im_add_callback( VipsImage *im, +- const char *callback, im_callback_fn fn, void *a, void *b ); ++int im_add_callback(VipsImage *im, ++ const char *callback, im_callback_fn fn, void *a, void *b); + VIPS_DEPRECATED_FOR(g_signal_connect) +-int im_add_callback1( VipsImage *im, +- const char *callback, im_callback_fn fn, void *a, void *b ); +-#define im_add_close_callback( IM, FN, A, B ) \ +- im_add_callback( IM, "close", FN, A, B ) +-#define im_add_postclose_callback( IM, FN, A, B ) \ +- im_add_callback( IM, "postclose", FN, A, B ) +-#define im_add_preclose_callback( IM, FN, A, B ) \ +- im_add_callback( IM, "preclose", FN, A, B ) +-#define im_add_evalstart_callback( IM, FN, A, B ) \ +- im_add_callback1( IM, "preeval", FN, A, B ) +-#define im_add_evalend_callback( IM, FN, A, B ) \ +- im_add_callback1( IM, "posteval", FN, A, B ) +-#define im_add_eval_callback( IM, FN, A, B ) \ +- (vips_image_set_progress( IM, TRUE ), \ +- im_add_callback1( IM, "eval", FN, A, B )) +-#define im_add_invalidate_callback( IM, FN, A, B ) \ +- im_add_callback( IM, "invalidate", FN, A, B ) +- +-#define im_bits_of_fmt( fmt ) (vips_format_sizeof( fmt ) << 3) +- +-typedef void *(*im_construct_fn)( void *, void *, void * ); ++int im_add_callback1(VipsImage *im, ++ const char *callback, im_callback_fn fn, void *a, void *b); ++#define im_add_close_callback(IM, FN, A, B) \ ++ im_add_callback(IM, "close", FN, A, B) ++#define im_add_postclose_callback(IM, FN, A, B) \ ++ im_add_callback(IM, "postclose", FN, A, B) ++#define im_add_preclose_callback(IM, FN, A, B) \ ++ im_add_callback(IM, "preclose", FN, A, B) ++#define im_add_evalstart_callback(IM, FN, A, B) \ ++ im_add_callback1(IM, "preeval", FN, A, B) ++#define im_add_evalend_callback(IM, FN, A, B) \ ++ im_add_callback1(IM, "posteval", FN, A, B) ++#define im_add_eval_callback(IM, FN, A, B) \ ++ (vips_image_set_progress(IM, TRUE), \ ++ im_add_callback1(IM, "eval", FN, A, B)) ++#define im_add_invalidate_callback(IM, FN, A, B) \ ++ im_add_callback(IM, "invalidate", FN, A, B) ++ ++#define im_bits_of_fmt(fmt) (vips_format_sizeof(fmt) << 3) ++ ++typedef void *(*im_construct_fn)(void *, void *, void *); + VIPS_DEPRECATED_FOR(vips_object_local) +-void *im_local( VipsImage *im, +- im_construct_fn cons, im_callback_fn dest, void *a, void *b, void *c ); ++void *im_local(VipsImage *im, ++ im_construct_fn cons, im_callback_fn dest, void *a, void *b, void *c); + VIPS_DEPRECATED_FOR(vips_object_local_array) +-int im_local_array( VipsImage *im, void **out, int n, +- im_construct_fn cons, im_callback_fn dest, void *a, void *b, void *c ); ++int im_local_array(VipsImage *im, void **out, int n, ++ im_construct_fn cons, im_callback_fn dest, void *a, void *b, void *c); + + VIPS_DEPRECATED_FOR(g_object_unref) +-int im_close( VipsImage *im ); ++int im_close(VipsImage *im); + VIPS_DEPRECATED_FOR(vips_image_new_from_file) +-VipsImage *im_init( const char *filename ); ++VipsImage *im_init(const char *filename); + + VIPS_DEPRECATED_FOR(vips_enum_string) +-const char *im_Type2char( VipsInterpretation type ); ++const char *im_Type2char(VipsInterpretation type); + VIPS_DEPRECATED_FOR(vips_enum_string) +-const char *im_BandFmt2char( VipsBandFormat fmt ); ++const char *im_BandFmt2char(VipsBandFormat fmt); + VIPS_DEPRECATED_FOR(vips_enum_string) +-const char *im_Coding2char( VipsCoding coding ); ++const char *im_Coding2char(VipsCoding coding); + VIPS_DEPRECATED_FOR(vips_enum_string) +-const char *im_Compression2char( int n ); ++const char *im_Compression2char(int n); + VIPS_DEPRECATED_FOR(vips_enum_string) +-const char *im_dtype2char( VipsImageType n ); ++const char *im_dtype2char(VipsImageType n); + VIPS_DEPRECATED_FOR(vips_enum_string) +-const char *im_dhint2char( VipsDemandStyle style ); ++const char *im_dhint2char(VipsDemandStyle style); + + VIPS_DEPRECATED_FOR(vips_enum_from_nick) +-VipsInterpretation im_char2Type( const char *str ); ++VipsInterpretation im_char2Type(const char *str); + VIPS_DEPRECATED_FOR(vips_enum_from_nick) +-VipsBandFormat im_char2BandFmt( const char *str ); ++VipsBandFormat im_char2BandFmt(const char *str); + VIPS_DEPRECATED_FOR(vips_enum_from_nick) +-VipsCoding im_char2Coding( const char *str ); ++VipsCoding im_char2Coding(const char *str); + VIPS_DEPRECATED_FOR(vips_enum_from_nick) +-VipsImageType im_char2dtype( const char *str ); ++VipsImageType im_char2dtype(const char *str); + VIPS_DEPRECATED_FOR(vips_enum_from_nick) +-VipsDemandStyle im_char2dhint( const char *str ); ++VipsDemandStyle im_char2dhint(const char *str); + + #define Rect VipsRect + #define IM_RECT_RIGHT VIPS_RECT_RIGHT +@@ -396,12 +396,12 @@ VipsDemandStyle im_char2dhint( const char *str ); + #define im_stop_many vips_stop_many + #define im_allocate_input_array vips_allocate_input_array + #define im_start_fn VipsStartFn +-typedef int (*im_generate_fn)( VipsRegion *out, void *seq, void *a, void *b ); ++typedef int (*im_generate_fn)(VipsRegion *out, void *seq, void *a, void *b); + #define im_stop_fn VipsStopFn + VIPS_DEPRECATED_FOR(vips_image_generate) +-int im_generate( VipsImage *im, ++int im_generate(VipsImage *im, + im_start_fn start, im_generate_fn generate, im_stop_fn stop, +- void *a, void *b ); ++ void *a, void *b); + + #define im__mmap vips__mmap + #define im__munmap vips__munmap +@@ -412,128 +412,134 @@ int im_generate( VipsImage *im, + #define im__print_renders vips__print_renders + + VIPS_DEPRECATED_FOR(vips_sink_screen) +-int im_cache( IMAGE *in, IMAGE *out, int width, int height, int max ); +- +-#define IM_FREEF( F, S ) \ +-G_STMT_START { \ +- if( S ) { \ +- (void) F( (S) ); \ +- (S) = 0; \ +- } \ +-} G_STMT_END ++int im_cache(IMAGE *in, IMAGE *out, int width, int height, int max); ++ ++#define IM_FREEF(F, S) \ ++ G_STMT_START \ ++ { \ ++ if (S) { \ ++ (void) F((S)); \ ++ (S) = 0; \ ++ } \ ++ } \ ++ G_STMT_END + + /* Can't just use VIPS_FREEF(), we want the extra cast to void on the argument + * to vips_free() to make sure we can work for "const char *" variables. + */ +-#define IM_FREE( S ) \ +-G_STMT_START { \ +- if( S ) { \ +- (void) im_free( (void *) (S) ); \ +- (S) = 0; \ +- } \ +-} G_STMT_END +- +-#define IM_SETSTR( S, V ) \ +-G_STMT_START { \ +- const char *sst = (V); \ +- \ +- if( (S) != sst ) { \ +- if( !(S) || !sst || strcmp( (S), sst ) != 0 ) { \ +- IM_FREE( S ); \ +- if( sst ) \ +- (S) = im_strdup( NULL, sst ); \ +- } \ +- } \ +-} G_STMT_END +- +-#define im_malloc( IM, SZ ) \ +- (vips_malloc( VIPS_OBJECT( IM ), (SZ) )) ++#define IM_FREE(S) \ ++ G_STMT_START \ ++ { \ ++ if (S) { \ ++ (void) im_free((void *) (S)); \ ++ (S) = 0; \ ++ } \ ++ } \ ++ G_STMT_END ++ ++#define IM_SETSTR(S, V) \ ++ G_STMT_START \ ++ { \ ++ const char *sst = (V); \ ++\ ++ if ((S) != sst) { \ ++ if (!(S) || !sst || strcmp((S), sst) != 0) { \ ++ IM_FREE(S); \ ++ if (sst) \ ++ (S) = im_strdup(NULL, sst); \ ++ } \ ++ } \ ++ } \ ++ G_STMT_END ++ ++#define im_malloc(IM, SZ) \ ++ (vips_malloc(VIPS_OBJECT(IM), (SZ))) + #define im_free vips_free +-#define im_strdup( IM, STR ) \ +- (vips_strdup( VIPS_OBJECT( IM ), (STR) )) +-#define IM_NEW( IM, T ) ((T *) im_malloc( (IM), sizeof( T ))) +-#define IM_ARRAY( IM, N, T ) ((T *) im_malloc( (IM), (N) * sizeof( T ))) ++#define im_strdup(IM, STR) \ ++ (vips_strdup(VIPS_OBJECT(IM), (STR))) ++#define IM_NEW(IM, T) ((T *) im_malloc((IM), sizeof(T))) ++#define IM_ARRAY(IM, N, T) ((T *) im_malloc((IM), (N) * sizeof(T))) + + #define im_incheck vips_image_wio_input +-#define im_outcheck( I ) (0) ++#define im_outcheck(I) (0) + #define im_rwcheck vips_image_inplace + #define im_pincheck vips_image_pio_input +-#define im_poutcheck( I ) (0) +- +-#define im_iocheck( I, O ) im_incheck( I ) +-#define im_piocheck( I, O ) im_pincheck( I ) +- +-#define im_check_uncoded vips_check_uncoded +-#define im_check_coding_known vips_check_coding_known +-#define im_check_coding_labq vips_check_coding_labq +-#define im_check_coding_rad vips_check_coding_rad +-#define im_check_coding_noneorlabq vips_check_coding_noneorlabq +-#define im_check_coding_same vips_check_coding_same +-#define im_check_mono vips_check_mono +-#define im_check_bands_1or3 vips_check_bands_1or3 +-#define im_check_bands vips_check_bands +-#define im_check_bands_1orn vips_check_bands_1orn +-#define im_check_bands_1orn_unary vips_check_bands_1orn_unary +-#define im_check_bands_same vips_check_bands_same +-#define im_check_bandno vips_check_bandno +-#define im_check_int vips_check_int +-#define im_check_uint vips_check_uint +-#define im_check_uintorf vips_check_uintorf +-#define im_check_noncomplex vips_check_noncomplex +-#define im_check_complex vips_check_complex +-#define im_check_format vips_check_format +-#define im_check_u8or16 vips_check_u8or16 +-#define im_check_8or16 vips_check_8or16 +-#define im_check_u8or16orf vips_check_u8or16orf +-#define im_check_format_same vips_check_format_same +-#define im_check_size_same vips_check_size_same +-#define im_check_vector vips_check_vector +-#define im_check_hist vips_check_hist +-#define im_check_imask vips_check_imask +-#define im_check_dmask vips_check_dmask +- +-#define vips_bandfmt_isint vips_band_format_isint +-#define vips_bandfmt_isuint vips_band_format_isuint +-#define vips_bandfmt_isfloat vips_band_format_isfloat +-#define vips_bandfmt_iscomplex vips_band_format_iscomplex ++#define im_poutcheck(I) (0) ++ ++#define im_iocheck(I, O) im_incheck(I) ++#define im_piocheck(I, O) im_pincheck(I) ++ ++#define im_check_uncoded vips_check_uncoded ++#define im_check_coding_known vips_check_coding_known ++#define im_check_coding_labq vips_check_coding_labq ++#define im_check_coding_rad vips_check_coding_rad ++#define im_check_coding_noneorlabq vips_check_coding_noneorlabq ++#define im_check_coding_same vips_check_coding_same ++#define im_check_mono vips_check_mono ++#define im_check_bands_1or3 vips_check_bands_1or3 ++#define im_check_bands vips_check_bands ++#define im_check_bands_1orn vips_check_bands_1orn ++#define im_check_bands_1orn_unary vips_check_bands_1orn_unary ++#define im_check_bands_same vips_check_bands_same ++#define im_check_bandno vips_check_bandno ++#define im_check_int vips_check_int ++#define im_check_uint vips_check_uint ++#define im_check_uintorf vips_check_uintorf ++#define im_check_noncomplex vips_check_noncomplex ++#define im_check_complex vips_check_complex ++#define im_check_format vips_check_format ++#define im_check_u8or16 vips_check_u8or16 ++#define im_check_8or16 vips_check_8or16 ++#define im_check_u8or16orf vips_check_u8or16orf ++#define im_check_format_same vips_check_format_same ++#define im_check_size_same vips_check_size_same ++#define im_check_vector vips_check_vector ++#define im_check_hist vips_check_hist ++#define im_check_imask vips_check_imask ++#define im_check_dmask vips_check_dmask ++ ++#define vips_bandfmt_isint vips_band_format_isint ++#define vips_bandfmt_isuint vips_band_format_isuint ++#define vips_bandfmt_isfloat vips_band_format_isfloat ++#define vips_bandfmt_iscomplex vips_band_format_iscomplex + + #define im__change_suffix vips__change_suffix + + /* Buffer processing. + */ +-typedef void (*im_wrapone_fn)( void *in, void *out, int width, +- void *a, void *b ); ++typedef void (*im_wrapone_fn)(void *in, void *out, int width, ++ void *a, void *b); + VIPS_DEPRECATED +-int im_wrapone( VipsImage *in, VipsImage *out, +- im_wrapone_fn fn, void *a, void *b ); ++int im_wrapone(VipsImage *in, VipsImage *out, ++ im_wrapone_fn fn, void *a, void *b); + +-typedef void (*im_wraptwo_fn)( void *in1, void *in2, void *out, +- int width, void *a, void *b ); ++typedef void (*im_wraptwo_fn)(void *in1, void *in2, void *out, ++ int width, void *a, void *b); + VIPS_DEPRECATED +-int im_wraptwo( VipsImage *in1, VipsImage *in2, VipsImage *out, +- im_wraptwo_fn fn, void *a, void *b ); ++int im_wraptwo(VipsImage *in1, VipsImage *in2, VipsImage *out, ++ im_wraptwo_fn fn, void *a, void *b); + +-typedef void (*im_wrapmany_fn)( void **in, void *out, int width, +- void *a, void *b ); ++typedef void (*im_wrapmany_fn)(void **in, void *out, int width, ++ void *a, void *b); + VIPS_DEPRECATED +-int im_wrapmany( VipsImage **in, VipsImage *out, +- im_wrapmany_fn fn, void *a, void *b ); ++int im_wrapmany(VipsImage **in, VipsImage *out, ++ im_wrapmany_fn fn, void *a, void *b); + +-#define IM_META_EXIF_NAME VIPS_META_EXIF_NAME +-#define IM_META_ICC_NAME VIPS_META_ICC_NAME +-#define IM_META_RESOLUTION_UNIT VIPS_META_RESOLUTION_UNIT +-#define IM_TYPE_SAVE_STRING VIPS_TYPE_SAVE_STRING +-#define IM_TYPE_BLOB VIPS_TYPE_BLOB +-#define IM_TYPE_AREA VIPS_TYPE_AREA +-#define IM_TYPE_REF_STRING VIPS_TYPE_REF_STRING ++#define IM_META_EXIF_NAME VIPS_META_EXIF_NAME ++#define IM_META_ICC_NAME VIPS_META_ICC_NAME ++#define IM_META_RESOLUTION_UNIT VIPS_META_RESOLUTION_UNIT ++#define IM_TYPE_SAVE_STRING VIPS_TYPE_SAVE_STRING ++#define IM_TYPE_BLOB VIPS_TYPE_BLOB ++#define IM_TYPE_AREA VIPS_TYPE_AREA ++#define IM_TYPE_REF_STRING VIPS_TYPE_REF_STRING + + #define im_header_map_fn VipsImageMapFn + #define im_header_map vips_image_map + + #define im_header_int vips_image_get_int + #define im_header_double vips_image_get_double +-#define im_header_string( IMAGE, FIELD, STRING ) \ +- vips_image_get_string( IMAGE, FIELD, (const char **) STRING ) ++#define im_header_string(IMAGE, FIELD, STRING) \ ++ vips_image_get_string(IMAGE, FIELD, (const char **) STRING) + #define im_header_as_string vips_image_get_as_string + #define im_header_get_typeof vips_image_get_typeof + #define im_header_get vips_image_get +@@ -547,28 +553,28 @@ int im_wrapmany( VipsImage **in, VipsImage *out, + #define im_save_string_setf vips_value_set_save_stringf + + #define im_ref_string_set vips_value_set_ref_string +-#define im_ref_string_get( V ) vips_value_get_ref_string( V, NULL ) ++#define im_ref_string_get(V) vips_value_get_ref_string(V, NULL) + VIPS_DEPRECATED_FOR(vips_value_get_ref_string) +-size_t im_ref_string_get_length( const GValue *value ); ++size_t im_ref_string_get_length(const GValue *value); + + #define im_blob_get vips_value_get_blob + #define im_blob_set vips_value_set_blob + +-#define im_meta_set( A, B, C ) (vips_image_set( A, B, C ), 0) ++#define im_meta_set(A, B, C) (vips_image_set(A, B, C), 0) + #define im_meta_remove vips_image_remove + #define im_meta_get vips_image_get + #define im_meta_get_typeof vips_image_get_typeof + +-#define im_meta_set_int( A, B, C ) (vips_image_set_int( A, B, C ), 0) ++#define im_meta_set_int(A, B, C) (vips_image_set_int(A, B, C), 0) + #define im_meta_get_int vips_image_get_int +-#define im_meta_set_double( A, B, C ) (vips_image_set_double( A, B, C ), 0) ++#define im_meta_set_double(A, B, C) (vips_image_set_double(A, B, C), 0) + #define im_meta_get_double vips_image_get_double +-#define im_meta_set_area( A, B, C, D ) (vips_image_set_area( A, B, C, D ), 0) ++#define im_meta_set_area(A, B, C, D) (vips_image_set_area(A, B, C, D), 0) + #define im_meta_get_area vips_image_get_area +-#define im_meta_set_string( A, B, C ) (vips_image_set_string( A, B, C ), 0) ++#define im_meta_set_string(A, B, C) (vips_image_set_string(A, B, C), 0) + #define im_meta_get_string vips_image_get_string +-#define im_meta_set_blob( A, B, C, D, E ) \ +- (vips_image_set_blob( A, B, C, D, E ), 0) ++#define im_meta_set_blob(A, B, C, D, E) \ ++ (vips_image_set_blob(A, B, C, D, E), 0) + #define im_meta_get_blob vips_image_get_blob + + #define im_semaphore_t VipsSemaphore +@@ -649,407 +655,407 @@ size_t im_ref_string_get_length( const GValue *value ); + #define im_concurrency_get vips_concurrency_get + + VIPS_DEPRECATED_FOR(vips_add) +-int im_add( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_add(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_subtract) +-int im_subtract( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_subtract(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_multiply) +-int im_multiply( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_multiply(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_divide) +-int im_divide( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_divide(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_min) +-int im_min( VipsImage *in, double *out ); ++int im_min(VipsImage *in, double *out); + VIPS_DEPRECATED_FOR(vips_min) +-int im_minpos( VipsImage *in, int *xpos, int *ypos, double *out ); ++int im_minpos(VipsImage *in, int *xpos, int *ypos, double *out); + VIPS_DEPRECATED_FOR(vips_max) +-int im_max( VipsImage *in, double *out ); ++int im_max(VipsImage *in, double *out); + VIPS_DEPRECATED_FOR(vips_max) +-int im_maxpos( VipsImage *in, int *xpos, int *ypos, double *out ); ++int im_maxpos(VipsImage *in, int *xpos, int *ypos, double *out); + VIPS_DEPRECATED_FOR(vips_avg) +-int im_avg( VipsImage *in, double *out ); ++int im_avg(VipsImage *in, double *out); + VIPS_DEPRECATED_FOR(vips_deviate) +-int im_deviate( VipsImage *in, double *out ); ++int im_deviate(VipsImage *in, double *out); + VIPS_DEPRECATED_FOR(vips_invert) +-int im_invert( VipsImage *in, VipsImage *out ); ++int im_invert(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_linear1) +-int im_lintra( double a, VipsImage *in, double b, VipsImage *out ); ++int im_lintra(double a, VipsImage *in, double b, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_linear) +-int im_lintra_vec( int n, double *a, VipsImage *in, double *b, VipsImage *out ); ++int im_lintra_vec(int n, double *a, VipsImage *in, double *b, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_abs) +-int im_abs( VipsImage *in, VipsImage *out ); ++int im_abs(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_sign) +-int im_sign( VipsImage *in, VipsImage *out ); ++int im_sign(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_stats) +-DOUBLEMASK *im_stats( VipsImage *in ); ++DOUBLEMASK *im_stats(VipsImage *in); + VIPS_DEPRECATED_FOR(vips_measure) +-DOUBLEMASK *im_measure_area( VipsImage *im, +- int left, int top, int width, int height, +- int h, int v, +- int *sel, int nsel, const char *name ); ++DOUBLEMASK *im_measure_area(VipsImage *im, ++ int left, int top, int width, int height, ++ int h, int v, ++ int *sel, int nsel, const char *name); + + VIPS_DEPRECATED_FOR(vips_sin) +-int im_sintra( VipsImage *in, VipsImage *out ); ++int im_sintra(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_cos) +-int im_costra( VipsImage *in, VipsImage *out ); ++int im_costra(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_tan) +-int im_tantra( VipsImage *in, VipsImage *out ); ++int im_tantra(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_asin) +-int im_asintra( VipsImage *in, VipsImage *out ); ++int im_asintra(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_acos) +-int im_acostra( VipsImage *in, VipsImage *out ); ++int im_acostra(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_atan) +-int im_atantra( VipsImage *in, VipsImage *out ); ++int im_atantra(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_log) +-int im_logtra( VipsImage *in, VipsImage *out ); ++int im_logtra(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_log10) +-int im_log10tra( VipsImage *in, VipsImage *out ); ++int im_log10tra(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_exp) +-int im_exptra( VipsImage *in, VipsImage *out ); ++int im_exptra(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_exp10) +-int im_exp10tra( VipsImage *in, VipsImage *out ); ++int im_exp10tra(VipsImage *in, VipsImage *out); + + VIPS_DEPRECATED_FOR(vips_floor) +-int im_floor( VipsImage *in, VipsImage *out ); ++int im_floor(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_rint) +-int im_rint( VipsImage *in, VipsImage *out ); ++int im_rint(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_ceil) +-int im_ceil( VipsImage *in, VipsImage *out ); ++int im_ceil(VipsImage *in, VipsImage *out); + + VIPS_DEPRECATED_FOR(vips_equal) +-int im_equal( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_equal(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_notequal) +-int im_notequal( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_notequal(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_less) +-int im_less( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_less(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_lesseq) +-int im_lesseq( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_lesseq(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_more) +-int im_more( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_more(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_moreeq) +-int im_moreeq( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_moreeq(VipsImage *in1, VipsImage *in2, VipsImage *out); + + VIPS_DEPRECATED_FOR(vips_andimage) +-int im_andimage( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_andimage(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_orimage) +-int im_orimage( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_orimage(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_eorimage) +-int im_eorimage( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_eorimage(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_andimage_const) +-int im_andimage_vec( VipsImage *in, VipsImage *out, int n, double *c ); ++int im_andimage_vec(VipsImage *in, VipsImage *out, int n, double *c); + VIPS_DEPRECATED_FOR(vips_orimage_const) +-int im_orimage_vec( VipsImage *in, VipsImage *out, int n, double *c ); ++int im_orimage_vec(VipsImage *in, VipsImage *out, int n, double *c); + VIPS_DEPRECATED_FOR(vips_eorimage_const) +-int im_eorimage_vec( VipsImage *in, VipsImage *out, int n, double *c ); ++int im_eorimage_vec(VipsImage *in, VipsImage *out, int n, double *c); + VIPS_DEPRECATED_FOR(vips_andimage_const1) +-int im_andimageconst( VipsImage *in, VipsImage *out, double c ); ++int im_andimageconst(VipsImage *in, VipsImage *out, double c); + VIPS_DEPRECATED_FOR(vips_orimage_const1) +-int im_orimageconst( VipsImage *in, VipsImage *out, double c ); ++int im_orimageconst(VipsImage *in, VipsImage *out, double c); + VIPS_DEPRECATED_FOR(vips_eorimage_const1) +-int im_eorimageconst( VipsImage *in, VipsImage *out, double c ); ++int im_eorimageconst(VipsImage *in, VipsImage *out, double c); + + VIPS_DEPRECATED_FOR(vips_lshift_const) +-int im_shiftleft_vec( VipsImage *in, VipsImage *out, int n, double *c ); ++int im_shiftleft_vec(VipsImage *in, VipsImage *out, int n, double *c); + VIPS_DEPRECATED_FOR(vips_lshift) +-int im_shiftleft( VipsImage *in, VipsImage *out, int n ); ++int im_shiftleft(VipsImage *in, VipsImage *out, int n); + VIPS_DEPRECATED_FOR(vips_rshift_const) +-int im_shiftright_vec( VipsImage *in, VipsImage *out, int n, double *c ); ++int im_shiftright_vec(VipsImage *in, VipsImage *out, int n, double *c); + VIPS_DEPRECATED_FOR(vips_rshift) +-int im_shiftright( VipsImage *in, VipsImage *out, int n ); ++int im_shiftright(VipsImage *in, VipsImage *out, int n); + + VIPS_DEPRECATED_FOR(vips_remainder) +-int im_remainder( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_remainder(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_remainder_const) +-int im_remainder_vec( VipsImage *in, VipsImage *out, int n, double *c ); ++int im_remainder_vec(VipsImage *in, VipsImage *out, int n, double *c); + VIPS_DEPRECATED_FOR(vips_remainder_const1) +-int im_remainderconst( VipsImage *in, VipsImage *out, double c ); ++int im_remainderconst(VipsImage *in, VipsImage *out, double c); + + VIPS_DEPRECATED_FOR(vips_pow) +-int im_powtra( VipsImage *in, VipsImage *out, double e ); ++int im_powtra(VipsImage *in, VipsImage *out, double e); + VIPS_DEPRECATED_FOR(vips_pow_const) +-int im_powtra_vec( VipsImage *in, VipsImage *out, int n, double *e ); ++int im_powtra_vec(VipsImage *in, VipsImage *out, int n, double *e); + VIPS_DEPRECATED_FOR(vips_exp) +-int im_expntra( VipsImage *in, VipsImage *out, double e ); ++int im_expntra(VipsImage *in, VipsImage *out, double e); + VIPS_DEPRECATED_FOR(vips_exp_const) +-int im_expntra_vec( VipsImage *in, VipsImage *out, int n, double *e ); ++int im_expntra_vec(VipsImage *in, VipsImage *out, int n, double *e); + + VIPS_DEPRECATED_FOR(vips_equal_const) +-int im_equal_vec( VipsImage *in, VipsImage *out, int n, double *c ); ++int im_equal_vec(VipsImage *in, VipsImage *out, int n, double *c); + VIPS_DEPRECATED_FOR(vips_notequal_const) +-int im_notequal_vec( VipsImage *in, VipsImage *out, int n, double *c ); ++int im_notequal_vec(VipsImage *in, VipsImage *out, int n, double *c); + VIPS_DEPRECATED_FOR(vips_less_const) +-int im_less_vec( VipsImage *in, VipsImage *out, int n, double *c ); ++int im_less_vec(VipsImage *in, VipsImage *out, int n, double *c); + VIPS_DEPRECATED_FOR(vips_lesseq_const) +-int im_lesseq_vec( VipsImage *in, VipsImage *out, int n, double *c ); ++int im_lesseq_vec(VipsImage *in, VipsImage *out, int n, double *c); + VIPS_DEPRECATED_FOR(vips_more_const) +-int im_more_vec( VipsImage *in, VipsImage *out, int n, double *c ); ++int im_more_vec(VipsImage *in, VipsImage *out, int n, double *c); + VIPS_DEPRECATED_FOR(vips_moreeq_const) +-int im_moreeq_vec( VipsImage *in, VipsImage *out, int n, double *c ); ++int im_moreeq_vec(VipsImage *in, VipsImage *out, int n, double *c); + VIPS_DEPRECATED_FOR(vips_equal_const1) +-int im_equalconst( VipsImage *in, VipsImage *out, double c ); ++int im_equalconst(VipsImage *in, VipsImage *out, double c); + VIPS_DEPRECATED_FOR(vips_notequal_const1) +-int im_notequalconst( VipsImage *in, VipsImage *out, double c ); ++int im_notequalconst(VipsImage *in, VipsImage *out, double c); + VIPS_DEPRECATED_FOR(vips_less_const1) +-int im_lessconst( VipsImage *in, VipsImage *out, double c ); ++int im_lessconst(VipsImage *in, VipsImage *out, double c); + VIPS_DEPRECATED_FOR(vips_lesseq_const1) +-int im_lesseqconst( VipsImage *in, VipsImage *out, double c ); ++int im_lesseqconst(VipsImage *in, VipsImage *out, double c); + VIPS_DEPRECATED_FOR(vips_more_const1) +-int im_moreconst( VipsImage *in, VipsImage *out, double c ); ++int im_moreconst(VipsImage *in, VipsImage *out, double c); + VIPS_DEPRECATED_FOR(vips_moreeq_const1) +-int im_moreeqconst( VipsImage *in, VipsImage *out, double c ); ++int im_moreeqconst(VipsImage *in, VipsImage *out, double c); + + VIPS_DEPRECATED_FOR(vips_max) +-int im_maxpos_vec( VipsImage *im, int *xpos, int *ypos, double *maxima, int n ); ++int im_maxpos_vec(VipsImage *im, int *xpos, int *ypos, double *maxima, int n); + VIPS_DEPRECATED_FOR(vips_min) +-int im_minpos_vec( VipsImage *im, int *xpos, int *ypos, double *minima, int n ); ++int im_minpos_vec(VipsImage *im, int *xpos, int *ypos, double *minima, int n); + + VIPS_DEPRECATED +-int im_maxpos_avg( VipsImage *im, double *xpos, double *ypos, double *out ); ++int im_maxpos_avg(VipsImage *im, double *xpos, double *ypos, double *out); + + VIPS_DEPRECATED +-int im_linreg( VipsImage **ins, VipsImage *out, double *xs ); ++int im_linreg(VipsImage **ins, VipsImage *out, double *xs); + + VIPS_DEPRECATED_FOR(vips_cross_phase) +-int im_cross_phase( VipsImage *a, VipsImage *b, VipsImage *out ); ++int im_cross_phase(VipsImage *a, VipsImage *b, VipsImage *out); + + VIPS_DEPRECATED +-int im_point( VipsImage *im, VipsInterpolate *interpolate, +- double x, double y, int band, double *out ); ++int im_point(VipsImage *im, VipsInterpolate *interpolate, ++ double x, double y, int band, double *out); + VIPS_DEPRECATED +-int im_point_bilinear( VipsImage *im, +- double x, double y, int band, double *out ); ++int im_point_bilinear(VipsImage *im, ++ double x, double y, int band, double *out); + + VIPS_DEPRECATED_FOR(vips_image_write) +-int im_copy( VipsImage *in, VipsImage *out ); ++int im_copy(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_copy) +-int im_copy_set( VipsImage *in, VipsImage *out, +- VipsInterpretation interpretation, +- float xres, float yres, int xoffset, int yoffset ); ++int im_copy_set(VipsImage *in, VipsImage *out, ++ VipsInterpretation interpretation, ++ float xres, float yres, int xoffset, int yoffset); + VIPS_DEPRECATED +-int im_copy_set_meta( VipsImage *in, VipsImage *out, +- const char *field, GValue *value ); ++int im_copy_set_meta(VipsImage *in, VipsImage *out, ++ const char *field, GValue *value); + VIPS_DEPRECATED_FOR(vips_copy) +-int im_copy_morph( VipsImage *in, VipsImage *out, +- int bands, VipsBandFormat format, VipsCoding coding ); ++int im_copy_morph(VipsImage *in, VipsImage *out, ++ int bands, VipsBandFormat format, VipsCoding coding); + VIPS_DEPRECATED_FOR(vips_byteswap) +-int im_copy_swap( VipsImage *in, VipsImage *out ); ++int im_copy_swap(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_copy_file) +-int im_copy_file( VipsImage *in, VipsImage *out ); ++int im_copy_file(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED +-int im_copy_native( VipsImage *in, VipsImage *out, gboolean is_msb_first ); ++int im_copy_native(VipsImage *in, VipsImage *out, gboolean is_msb_first); + VIPS_DEPRECATED_FOR(vips_embed) +-int im_embed( VipsImage *in, VipsImage *out, +- int type, int x, int y, int width, int height ); ++int im_embed(VipsImage *in, VipsImage *out, ++ int type, int x, int y, int width, int height); + VIPS_DEPRECATED_FOR(vips_flip) +-int im_fliphor( VipsImage *in, VipsImage *out ); ++int im_fliphor(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_flip) +-int im_flipver( VipsImage *in, VipsImage *out ); ++int im_flipver(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_insert) +-int im_insert( VipsImage *main, VipsImage *sub, VipsImage *out, int x, int y ); ++int im_insert(VipsImage *main, VipsImage *sub, VipsImage *out, int x, int y); + VIPS_DEPRECATED_FOR(vips_insert) +-int im_insert_noexpand( VipsImage *main, VipsImage *sub, VipsImage *out, int x, int y ); ++int im_insert_noexpand(VipsImage *main, VipsImage *sub, VipsImage *out, int x, int y); + VIPS_DEPRECATED_FOR(vips_join) +-int im_lrjoin( VipsImage *left, VipsImage *right, VipsImage *out ); ++int im_lrjoin(VipsImage *left, VipsImage *right, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_join) +-int im_tbjoin( VipsImage *top, VipsImage *bottom, VipsImage *out ); ++int im_tbjoin(VipsImage *top, VipsImage *bottom, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_extract_area) +-int im_extract_area( VipsImage *in, VipsImage *out, +- int left, int top, int width, int height ); ++int im_extract_area(VipsImage *in, VipsImage *out, ++ int left, int top, int width, int height); + VIPS_DEPRECATED_FOR(vips_extract_band) +-int im_extract_band( VipsImage *in, VipsImage *out, int band ); ++int im_extract_band(VipsImage *in, VipsImage *out, int band); + VIPS_DEPRECATED_FOR(vips_extract_band) +-int im_extract_bands( VipsImage *in, VipsImage *out, int band, int nbands ); ++int im_extract_bands(VipsImage *in, VipsImage *out, int band, int nbands); + VIPS_DEPRECATED +-int im_extract_areabands( VipsImage *in, VipsImage *out, +- int left, int top, int width, int height, int band, int nbands ); ++int im_extract_areabands(VipsImage *in, VipsImage *out, ++ int left, int top, int width, int height, int band, int nbands); + VIPS_DEPRECATED_FOR(vips_replicate) +-int im_replicate( VipsImage *in, VipsImage *out, int across, int down ); ++int im_replicate(VipsImage *in, VipsImage *out, int across, int down); + VIPS_DEPRECATED_FOR(vips_wrap) +-int im_wrap( VipsImage *in, VipsImage *out, int x, int y ); ++int im_wrap(VipsImage *in, VipsImage *out, int x, int y); + VIPS_DEPRECATED_FOR(vips_wrap) +-int im_rotquad( VipsImage *in, VipsImage *out ); ++int im_rotquad(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_cast) +-int im_clip2fmt( VipsImage *in, VipsImage *out, VipsBandFormat fmt ); ++int im_clip2fmt(VipsImage *in, VipsImage *out, VipsBandFormat fmt); + VIPS_DEPRECATED_FOR(vips_bandjoin2) +-int im_bandjoin( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_bandjoin(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_bandjoin) +-int im_gbandjoin( VipsImage **in, VipsImage *out, int n ); ++int im_gbandjoin(VipsImage **in, VipsImage *out, int n); + VIPS_DEPRECATED_FOR(vips_bandrank) +-int im_rank_image( VipsImage **in, VipsImage *out, int n, int index ); ++int im_rank_image(VipsImage **in, VipsImage *out, int n, int index); + VIPS_DEPRECATED_FOR(vips_bandrank) +-int im_maxvalue( VipsImage **in, VipsImage *out, int n ); ++int im_maxvalue(VipsImage **in, VipsImage *out, int n); + VIPS_DEPRECATED_FOR(vips_grid) +-int im_grid( VipsImage *in, VipsImage *out, int tile_height, int across, int down ); ++int im_grid(VipsImage *in, VipsImage *out, int tile_height, int across, int down); + VIPS_DEPRECATED_FOR(vips_scale) +-int im_scale( VipsImage *in, VipsImage *out ); ++int im_scale(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_scale) +-int im_scaleps( VipsImage *in, VipsImage *out ); ++int im_scaleps(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_msb) +-int im_msb( VipsImage *in, VipsImage *out ); ++int im_msb(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_msb) +-int im_msb_band( VipsImage *in, VipsImage *out, int band ); ++int im_msb_band(VipsImage *in, VipsImage *out, int band); + VIPS_DEPRECATED_FOR(vips_zoom) +-int im_zoom( VipsImage *in, VipsImage *out, int xfac, int yfac ); ++int im_zoom(VipsImage *in, VipsImage *out, int xfac, int yfac); + VIPS_DEPRECATED_FOR(vips_subsample) +-int im_subsample( VipsImage *in, VipsImage *out, int xshrink, int yshrink ); ++int im_subsample(VipsImage *in, VipsImage *out, int xshrink, int yshrink); + + VIPS_DEPRECATED_FOR(vips_gaussnoise) +-int im_gaussnoise( VipsImage *out, int x, int y, double mean, double sigma ); ++int im_gaussnoise(VipsImage *out, int x, int y, double mean, double sigma); + VIPS_DEPRECATED_FOR(vips_text) +-int im_text( VipsImage *out, const char *text, const char *font, +- int width, int alignment, int dpi ); ++int im_text(VipsImage *out, const char *text, const char *font, ++ int width, int alignment, int dpi); + VIPS_DEPRECATED_FOR(vips_black) +-int im_black( VipsImage *out, int x, int y, int bands ); ++int im_black(VipsImage *out, int x, int y, int bands); + VIPS_DEPRECATED_FOR(vips_xyz) +-int im_make_xy( VipsImage *out, const int xsize, const int ysize ); ++int im_make_xy(VipsImage *out, const int xsize, const int ysize); + VIPS_DEPRECATED_FOR(vips_zone) +-int im_zone( VipsImage *out, int size ); ++int im_zone(VipsImage *out, int size); + VIPS_DEPRECATED_FOR(vips_zone) +-int im_fzone( VipsImage *out, int size ); ++int im_fzone(VipsImage *out, int size); + VIPS_DEPRECATED_FOR(vips_eye) +-int im_feye( VipsImage *out, +- const int xsize, const int ysize, const double factor ); ++int im_feye(VipsImage *out, ++ const int xsize, const int ysize, const double factor); + VIPS_DEPRECATED_FOR(vips_eye) +-int im_eye( VipsImage *out, +- const int xsize, const int ysize, const double factor ); ++int im_eye(VipsImage *out, ++ const int xsize, const int ysize, const double factor); + VIPS_DEPRECATED_FOR(vips_grey) +-int im_grey( VipsImage *out, const int xsize, const int ysize ); ++int im_grey(VipsImage *out, const int xsize, const int ysize); + VIPS_DEPRECATED_FOR(vips_grey) +-int im_fgrey( VipsImage *out, const int xsize, const int ysize ); ++int im_fgrey(VipsImage *out, const int xsize, const int ysize); + VIPS_DEPRECATED_FOR(vips_sines) +-int im_sines( VipsImage *out, +- int xsize, int ysize, double horfreq, double verfreq ); ++int im_sines(VipsImage *out, ++ int xsize, int ysize, double horfreq, double verfreq); + VIPS_DEPRECATED_FOR(vips_buildlut) +-int im_buildlut( DOUBLEMASK *input, VipsImage *output ); ++int im_buildlut(DOUBLEMASK *input, VipsImage *output); + VIPS_DEPRECATED_FOR(vips_invertlut) +-int im_invertlut( DOUBLEMASK *input, VipsImage *output, int lut_size ); ++int im_invertlut(DOUBLEMASK *input, VipsImage *output, int lut_size); + VIPS_DEPRECATED_FOR(vips_identity) +-int im_identity( VipsImage *lut, int bands ); ++int im_identity(VipsImage *lut, int bands); + VIPS_DEPRECATED_FOR(vips_identity) +-int im_identity_ushort( VipsImage *lut, int bands, int sz ); ++int im_identity_ushort(VipsImage *lut, int bands, int sz); + + VIPS_DEPRECATED_FOR(vips_tonelut) +-int im_tone_build_range( VipsImage *out, ++int im_tone_build_range(VipsImage *out, + int in_max, int out_max, + double Lb, double Lw, double Ps, double Pm, double Ph, +- double S, double M, double H ); ++ double S, double M, double H); + VIPS_DEPRECATED_FOR(vips_tonelut) +-int im_tone_build( VipsImage *out, ++int im_tone_build(VipsImage *out, + double Lb, double Lw, double Ps, double Pm, double Ph, +- double S, double M, double H ); ++ double S, double M, double H); + + VIPS_DEPRECATED_FOR(vips_system) +-int im_system( VipsImage *im, const char *cmd, char **out ); ++int im_system(VipsImage *im, const char *cmd, char **out); + VIPS_DEPRECATED_FOR(vips_system) +-VipsImage *im_system_image( VipsImage *im, +- const char *in_format, const char *out_format, const char *cmd_format, +- char **log ); ++VipsImage *im_system_image(VipsImage *im, ++ const char *in_format, const char *out_format, const char *cmd_format, ++ char **log); + + VIPS_DEPRECATED_FOR(vips_complex) +-int im_c2amph( VipsImage *in, VipsImage *out ); ++int im_c2amph(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_complex) +-int im_c2rect( VipsImage *in, VipsImage *out ); ++int im_c2rect(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_imag) +-int im_c2imag( VipsImage *in, VipsImage *out ); ++int im_c2imag(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_real) +-int im_c2real( VipsImage *in, VipsImage *out ); ++int im_c2real(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_complexform) +-int im_ri2c( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_ri2c(VipsImage *in1, VipsImage *in2, VipsImage *out); + + VIPS_DEPRECATED_FOR(vips_rot90) +-int im_rot90( VipsImage *in, VipsImage *out ); ++int im_rot90(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_rot180) +-int im_rot180( VipsImage *in, VipsImage *out ); ++int im_rot180(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_rot270) +-int im_rot270( VipsImage *in, VipsImage *out ); ++int im_rot270(VipsImage *in, VipsImage *out); + + VIPS_DEPRECATED_FOR(vips_ifthenelse) +-int im_ifthenelse( VipsImage *c, VipsImage *a, VipsImage *b, VipsImage *out ); ++int im_ifthenelse(VipsImage *c, VipsImage *a, VipsImage *b, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_ifthenelse) +-int im_blend( VipsImage *c, VipsImage *a, VipsImage *b, VipsImage *out ); ++int im_blend(VipsImage *c, VipsImage *a, VipsImage *b, VipsImage *out); + + VIPS_DEPRECATED +-DOUBLEMASK *im_vips2mask( VipsImage *in, const char *filename ); ++DOUBLEMASK *im_vips2mask(VipsImage *in, const char *filename); + VIPS_DEPRECATED +-INTMASK *im_vips2imask( IMAGE *in, const char *filename ); ++INTMASK *im_vips2imask(IMAGE *in, const char *filename); + VIPS_DEPRECATED +-int im_mask2vips( DOUBLEMASK *in, VipsImage *out ); ++int im_mask2vips(DOUBLEMASK *in, VipsImage *out); + VIPS_DEPRECATED +-int im_imask2vips( INTMASK *in, VipsImage *out ); ++int im_imask2vips(INTMASK *in, VipsImage *out); + + VIPS_DEPRECATED_FOR(vips_bandmean) +-int im_bandmean( VipsImage *in, VipsImage *out ); ++int im_bandmean(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_recomb) +-int im_recomb( VipsImage *in, VipsImage *out, DOUBLEMASK *recomb ); ++int im_recomb(VipsImage *in, VipsImage *out, DOUBLEMASK *recomb); + + VIPS_DEPRECATED +-int im_argb2rgba( VipsImage *in, VipsImage *out ); ++int im_argb2rgba(VipsImage *in, VipsImage *out); + + VIPS_DEPRECATED_FOR(vips_falsecolour) +-int im_falsecolour( VipsImage *in, VipsImage *out ); ++int im_falsecolour(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_gamma) +-int im_gammacorrect( VipsImage *in, VipsImage *out, double exponent ); ++int im_gammacorrect(VipsImage *in, VipsImage *out, double exponent); + + VIPS_DEPRECATED_FOR(vips_tilecache) +-int im_tile_cache_random( IMAGE *in, IMAGE *out, +- int tile_width, int tile_height, int max_tiles ); ++int im_tile_cache_random(IMAGE *in, IMAGE *out, ++ int tile_width, int tile_height, int max_tiles); + + VIPS_DEPRECATED_FOR(vips_shrink) +-int im_shrink( VipsImage *in, VipsImage *out, double xshrink, double yshrink ); ++int im_shrink(VipsImage *in, VipsImage *out, double xshrink, double yshrink); + VIPS_DEPRECATED_FOR(vips_affine) +-int im_affinei( VipsImage *in, VipsImage *out, ++int im_affinei(VipsImage *in, VipsImage *out, + VipsInterpolate *interpolate, +- double a, double b, double c, double d, double dx, double dy, +- int ox, int oy, int ow, int oh ); ++ double a, double b, double c, double d, double dx, double dy, ++ int ox, int oy, int ow, int oh); + VIPS_DEPRECATED_FOR(vips_affine) +-int im_affinei_all( VipsImage *in, VipsImage *out, VipsInterpolate *interpolate, +- double a, double b, double c, double d, double dx, double dy ); ++int im_affinei_all(VipsImage *in, VipsImage *out, VipsInterpolate *interpolate, ++ double a, double b, double c, double d, double dx, double dy); + VIPS_DEPRECATED_FOR(vips_shrink) +-int im_rightshift_size( VipsImage *in, VipsImage *out, +- int xshift, int yshift, int band_fmt ); ++int im_rightshift_size(VipsImage *in, VipsImage *out, ++ int xshift, int yshift, int band_fmt); + + VIPS_DEPRECATED_FOR(vips_Lab2XYZ) +-int im_Lab2XYZ_temp( IMAGE *in, IMAGE *out, double X0, double Y0, double Z0 ); ++int im_Lab2XYZ_temp(IMAGE *in, IMAGE *out, double X0, double Y0, double Z0); + VIPS_DEPRECATED_FOR(vips_Lab2XYZ) +-int im_Lab2XYZ( IMAGE *in, IMAGE *out ); ++int im_Lab2XYZ(IMAGE *in, IMAGE *out); + VIPS_DEPRECATED_FOR(vips_XYZ2Lab) +-int im_XYZ2Lab( VipsImage *in, VipsImage *out ); ++int im_XYZ2Lab(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_XYZ2Lab) +-int im_XYZ2Lab_temp( VipsImage *in, VipsImage *out, +- double X0, double Y0, double Z0 ); ++int im_XYZ2Lab_temp(VipsImage *in, VipsImage *out, ++ double X0, double Y0, double Z0); + VIPS_DEPRECATED_FOR(vips_Lab2LCh) +-int im_Lab2LCh( VipsImage *in, VipsImage *out ); ++int im_Lab2LCh(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_LCh2Lab) +-int im_LCh2Lab( VipsImage *in, VipsImage *out ); ++int im_LCh2Lab(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_LCh2CMC) +-int im_LCh2UCS( VipsImage *in, VipsImage *out ); ++int im_LCh2UCS(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_CMC2LCh) +-int im_UCS2LCh( VipsImage *in, VipsImage *out ); ++int im_UCS2LCh(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_XYZ2Yxy) +-int im_XYZ2Yxy( VipsImage *in, VipsImage *out ); ++int im_XYZ2Yxy(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_Yxy2XYZ) +-int im_Yxy2XYZ( VipsImage *in, VipsImage *out ); ++int im_Yxy2XYZ(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_float2rad) +-int im_float2rad( VipsImage *in, VipsImage *out ); ++int im_float2rad(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_rad2float) +-int im_rad2float( VipsImage *in, VipsImage *out ); ++int im_rad2float(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_Lab2LabQ) +-int im_Lab2LabQ( VipsImage *in, VipsImage *out ); ++int im_Lab2LabQ(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_LabQ2Lab) +-int im_LabQ2Lab( VipsImage *in, VipsImage *out ); ++int im_LabQ2Lab(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_Lab2LabS) +-int im_Lab2LabS( VipsImage *in, VipsImage *out ); ++int im_Lab2LabS(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_LabS2Lab) +-int im_LabS2Lab( VipsImage *in, VipsImage *out ); ++int im_LabS2Lab(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_LabQ2LabS) +-int im_LabQ2LabS( VipsImage *in, VipsImage *out ); ++int im_LabQ2LabS(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_LabS2LabQ) +-int im_LabS2LabQ( VipsImage *in, VipsImage *out ); ++int im_LabS2LabQ(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_LabQ2sRGB) +-int im_LabQ2sRGB( VipsImage *in, VipsImage *out ); ++int im_LabQ2sRGB(VipsImage *in, VipsImage *out); + + VIPS_DEPRECATED +-int im_XYZ2sRGB( IMAGE *in, IMAGE *out ); ++int im_XYZ2sRGB(IMAGE *in, IMAGE *out); + VIPS_DEPRECATED +-int im_sRGB2XYZ( IMAGE *in, IMAGE *out ); ++int im_sRGB2XYZ(IMAGE *in, IMAGE *out); + + struct im_col_display; + #define im_col_displays(S) (NULL) +@@ -1057,114 +1063,114 @@ struct im_col_display; + #define im_LabQ2disp_table(A, B, C) (im_LabQ2disp(A, B, C)) + + VIPS_DEPRECATED +-int im_Lab2disp( IMAGE *in, IMAGE *out, struct im_col_display *disp ); ++int im_Lab2disp(IMAGE *in, IMAGE *out, struct im_col_display *disp); + VIPS_DEPRECATED +-int im_disp2Lab( IMAGE *in, IMAGE *out, struct im_col_display *disp ); ++int im_disp2Lab(IMAGE *in, IMAGE *out, struct im_col_display *disp); + + VIPS_DEPRECATED +-int im_dE_fromdisp( IMAGE *, IMAGE *, IMAGE *, struct im_col_display * ); ++int im_dE_fromdisp(IMAGE *, IMAGE *, IMAGE *, struct im_col_display *); + VIPS_DEPRECATED +-int im_dECMC_fromdisp( IMAGE *, IMAGE *, IMAGE *, struct im_col_display * ); ++int im_dECMC_fromdisp(IMAGE *, IMAGE *, IMAGE *, struct im_col_display *); + + #define im_disp2XYZ(A, B, C) (im_sRGB2XYZ(A, B)) + #define im_XYZ2disp(A, B, C) (im_XYZ2sRGB(A, B)) + #define im_LabQ2disp(A, B, C) (im_LabQ2sRGB(A, B)) + + VIPS_DEPRECATED_FOR(vips_icc_transform) +-int im_icc_transform( VipsImage *in, VipsImage *out, ++int im_icc_transform(VipsImage *in, VipsImage *out, + const char *input_profile_filename, + const char *output_profile_filename, +- VipsIntent intent ); ++ VipsIntent intent); + + #define im_icc_present vips_icc_present + + VIPS_DEPRECATED_FOR(vips_icc_import) +-int im_icc_import( VipsImage *in, VipsImage *out, +- const char *input_profile_filename, VipsIntent intent ); ++int im_icc_import(VipsImage *in, VipsImage *out, ++ const char *input_profile_filename, VipsIntent intent); + VIPS_DEPRECATED_FOR(vips_icc_import) +-int im_icc_import_embedded( VipsImage *in, VipsImage *out, VipsIntent intent ); ++int im_icc_import_embedded(VipsImage *in, VipsImage *out, VipsIntent intent); + VIPS_DEPRECATED_FOR(vips_icc_export) +-int im_icc_export_depth( VipsImage *in, VipsImage *out, int depth, +- const char *output_profile_filename, VipsIntent intent ); ++int im_icc_export_depth(VipsImage *in, VipsImage *out, int depth, ++ const char *output_profile_filename, VipsIntent intent); + VIPS_DEPRECATED_FOR(vips_icc_ac2rc) +-int im_icc_ac2rc( VipsImage *in, VipsImage *out, const char *profile_filename ); ++int im_icc_ac2rc(VipsImage *in, VipsImage *out, const char *profile_filename); + + VIPS_DEPRECATED +-int im_LabQ2XYZ( VipsImage *in, VipsImage *out ); ++int im_LabQ2XYZ(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED +-int im_UCS2XYZ( VipsImage *in, VipsImage *out ); ++int im_UCS2XYZ(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED +-int im_UCS2Lab( VipsImage *in, VipsImage *out ); ++int im_UCS2Lab(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED +-int im_Lab2UCS( VipsImage *in, VipsImage *out ); ++int im_Lab2UCS(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED +-int im_XYZ2UCS( VipsImage *in, VipsImage *out ); ++int im_XYZ2UCS(VipsImage *in, VipsImage *out); + + VIPS_DEPRECATED_FOR(vips_dE76) +-int im_dE_fromLab( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_dE_fromLab(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_dECMC) +-int im_dECMC_fromLab( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_dECMC_fromLab(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED +-int im_dE_fromXYZ( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_dE_fromXYZ(VipsImage *in1, VipsImage *in2, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_dE00) +-int im_dE00_fromLab( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_dE00_fromLab(VipsImage *in1, VipsImage *in2, VipsImage *out); + + VIPS_DEPRECATED +-int im_lab_morph( VipsImage *in, VipsImage *out, ++int im_lab_morph(VipsImage *in, VipsImage *out, + DOUBLEMASK *mask, + double L_offset, double L_scale, +- double a_scale, double b_scale ); ++ double a_scale, double b_scale); + + #define im_col_dE00 vips_col_dE00 + + VIPS_DEPRECATED_FOR(vips_quadratic) +-int im_quadratic( IMAGE *in, IMAGE *out, IMAGE *coeff ); ++int im_quadratic(IMAGE *in, IMAGE *out, IMAGE *coeff); + + VIPS_DEPRECATED_FOR(vips_maplut) +-int im_maplut( VipsImage *in, VipsImage *out, VipsImage *lut ); ++int im_maplut(VipsImage *in, VipsImage *out, VipsImage *lut); + VIPS_DEPRECATED +-int im_hist( VipsImage *in, VipsImage *out, int bandno ); ++int im_hist(VipsImage *in, VipsImage *out, int bandno); + VIPS_DEPRECATED_FOR(vips_hist_find) +-int im_histgr( VipsImage *in, VipsImage *out, int bandno ); ++int im_histgr(VipsImage *in, VipsImage *out, int bandno); + VIPS_DEPRECATED_FOR(vips_hist_cum) +-int im_histcum( VipsImage *in, VipsImage *out ); ++int im_histcum(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_hist_norm) +-int im_histnorm( VipsImage *in, VipsImage *out ); ++int im_histnorm(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED +-int im_histeq( VipsImage *in, VipsImage *out ); ++int im_histeq(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_hist_equal) +-int im_heq( VipsImage *in, VipsImage *out, int bandno ); ++int im_heq(VipsImage *in, VipsImage *out, int bandno); + VIPS_DEPRECATED_FOR(vips_hist_find_ndim) +-int im_histnD( VipsImage *in, VipsImage *out, int bins ); ++int im_histnD(VipsImage *in, VipsImage *out, int bins); + VIPS_DEPRECATED_FOR(vips_hist_find_indexed) +-int im_hist_indexed( VipsImage *index, VipsImage *value, VipsImage *out ); ++int im_hist_indexed(VipsImage *index, VipsImage *value, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_hist_plot) +-int im_histplot( VipsImage *in, VipsImage *out ); ++int im_histplot(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_project) +-int im_project( VipsImage *in, VipsImage *hout, VipsImage *vout ); ++int im_project(VipsImage *in, VipsImage *hout, VipsImage *vout); + VIPS_DEPRECATED_FOR(vips_profile) +-int im_profile( IMAGE *in, IMAGE *out, int dir ); ++int im_profile(IMAGE *in, IMAGE *out, int dir); + VIPS_DEPRECATED +-int im_hsp( VipsImage *in, VipsImage *ref, VipsImage *out ); ++int im_hsp(VipsImage *in, VipsImage *ref, VipsImage *out); + VIPS_DEPRECATED +-int im_histspec( VipsImage *in, VipsImage *ref, VipsImage *out ); ++int im_histspec(VipsImage *in, VipsImage *ref, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_hist_local) +-int im_lhisteq( VipsImage *in, VipsImage *out, int xwin, int ywin ); ++int im_lhisteq(VipsImage *in, VipsImage *out, int xwin, int ywin); + VIPS_DEPRECATED_FOR(vips_stdif) +-int im_stdif( VipsImage *in, VipsImage *out, +- double a, double m0, double b, double s0, int xwin, int ywin ); ++int im_stdif(VipsImage *in, VipsImage *out, ++ double a, double m0, double b, double s0, int xwin, int ywin); + VIPS_DEPRECATED_FOR(vips_percent) +-int im_mpercent( VipsImage *in, double percent, int *out ); ++int im_mpercent(VipsImage *in, double percent, int *out); + VIPS_DEPRECATED +-int im_mpercent_hist( VipsImage *hist, double percent, int *out ); ++int im_mpercent_hist(VipsImage *hist, double percent, int *out); + VIPS_DEPRECATED_FOR(vips_hist_ismonotonic) +-int im_ismonotonic( VipsImage *lut, int *out ); ++int im_ismonotonic(VipsImage *lut, int *out); + + VIPS_DEPRECATED +-int im_tone_analyse( VipsImage *in, VipsImage *out, +- double Ps, double Pm, double Ph, double S, double M, double H ); ++int im_tone_analyse(VipsImage *in, VipsImage *out, ++ double Ps, double Pm, double Ph, double S, double M, double H); + VIPS_DEPRECATED +-int im_tone_map( VipsImage *in, VipsImage *out, VipsImage *lut ); ++int im_tone_map(VipsImage *in, VipsImage *out, VipsImage *lut); + + /* Not really correct, but who uses these. + */ +@@ -1176,397 +1182,397 @@ int im_tone_map( VipsImage *in, VipsImage *out, VipsImage *lut ); + #define vips_class_map_concrete_all vips_class_map_all + + VIPS_DEPRECATED_FOR(vips_morph) +-int im_dilate( VipsImage *in, VipsImage *out, INTMASK *mask ); ++int im_dilate(VipsImage *in, VipsImage *out, INTMASK *mask); + VIPS_DEPRECATED_FOR(vips_morph) +-int im_erode( VipsImage *in, VipsImage *out, INTMASK *mask ); ++int im_erode(VipsImage *in, VipsImage *out, INTMASK *mask); + + VIPS_DEPRECATED_FOR(vips_conva) +-int im_aconv( VipsImage *in, VipsImage *out, +- DOUBLEMASK *mask, int n_layers, int cluster ); ++int im_aconv(VipsImage *in, VipsImage *out, ++ DOUBLEMASK *mask, int n_layers, int cluster); + VIPS_DEPRECATED_FOR(vips_convi) +-int im_conv( VipsImage *in, VipsImage *out, INTMASK *mask ); ++int im_conv(VipsImage *in, VipsImage *out, INTMASK *mask); + VIPS_DEPRECATED_FOR(vips_convf) +-int im_conv_f( VipsImage *in, VipsImage *out, DOUBLEMASK *mask ); ++int im_conv_f(VipsImage *in, VipsImage *out, DOUBLEMASK *mask); + + VIPS_DEPRECATED_FOR(vips_convasep) +-int im_aconvsep( VipsImage *in, VipsImage *out, +- DOUBLEMASK *mask, int n_layers ); ++int im_aconvsep(VipsImage *in, VipsImage *out, ++ DOUBLEMASK *mask, int n_layers); + + VIPS_DEPRECATED_FOR(vips_convsep) +-int im_convsep( VipsImage *in, VipsImage *out, INTMASK *mask ); ++int im_convsep(VipsImage *in, VipsImage *out, INTMASK *mask); + VIPS_DEPRECATED_FOR(vips_convsep) +-int im_convsep_f( VipsImage *in, VipsImage *out, DOUBLEMASK *mask ); ++int im_convsep_f(VipsImage *in, VipsImage *out, DOUBLEMASK *mask); + + VIPS_DEPRECATED_FOR(vips_compass) +-int im_compass( VipsImage *in, VipsImage *out, INTMASK *mask ); ++int im_compass(VipsImage *in, VipsImage *out, INTMASK *mask); + VIPS_DEPRECATED_FOR(vips_compass) +-int im_gradient( VipsImage *in, VipsImage *out, INTMASK *mask ); ++int im_gradient(VipsImage *in, VipsImage *out, INTMASK *mask); + VIPS_DEPRECATED_FOR(vips_compass) +-int im_lindetect( VipsImage *in, VipsImage *out, INTMASK *mask ); ++int im_lindetect(VipsImage *in, VipsImage *out, INTMASK *mask); + + VIPS_DEPRECATED +-int im_addgnoise( VipsImage *in, VipsImage *out, double sigma ); ++int im_addgnoise(VipsImage *in, VipsImage *out, double sigma); + + VIPS_DEPRECATED +-int im_contrast_surface_raw( IMAGE *in, IMAGE *out, +- int half_win_size, int spacing ); ++int im_contrast_surface_raw(IMAGE *in, IMAGE *out, ++ int half_win_size, int spacing); + VIPS_DEPRECATED +-int im_contrast_surface( VipsImage *in, VipsImage *out, +- int half_win_size, int spacing ); ++int im_contrast_surface(VipsImage *in, VipsImage *out, ++ int half_win_size, int spacing); + + VIPS_DEPRECATED +-int im_grad_x( VipsImage *in, VipsImage *out ); ++int im_grad_x(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED +-int im_grad_y( VipsImage *in, VipsImage *out ); ++int im_grad_y(VipsImage *in, VipsImage *out); + + VIPS_DEPRECATED_FOR(vips_fastcor) +-int im_fastcor( VipsImage *in, VipsImage *ref, VipsImage *out ); ++int im_fastcor(VipsImage *in, VipsImage *ref, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_spcor) +-int im_spcor( VipsImage *in, VipsImage *ref, VipsImage *out ); ++int im_spcor(VipsImage *in, VipsImage *ref, VipsImage *out); + VIPS_DEPRECATED +-int im_gradcor( VipsImage *in, VipsImage *ref, VipsImage *out ); ++int im_gradcor(VipsImage *in, VipsImage *ref, VipsImage *out); + + VIPS_DEPRECATED_FOR(vips_sharpen) +-int im_sharpen( VipsImage *in, VipsImage *out, +- int mask_size, +- double x1, double y2, double y3, +- double m1, double m2 ); ++int im_sharpen(VipsImage *in, VipsImage *out, ++ int mask_size, ++ double x1, double y2, double y3, ++ double m1, double m2); + + typedef enum { +- IM_MASK_IDEAL_HIGHPASS = 0, +- IM_MASK_IDEAL_LOWPASS = 1, +- IM_MASK_BUTTERWORTH_HIGHPASS = 2, +- IM_MASK_BUTTERWORTH_LOWPASS = 3, +- IM_MASK_GAUSS_HIGHPASS = 4, +- IM_MASK_GAUSS_LOWPASS = 5, +- +- IM_MASK_IDEAL_RINGPASS = 6, +- IM_MASK_IDEAL_RINGREJECT = 7, +- IM_MASK_BUTTERWORTH_RINGPASS = 8, +- IM_MASK_BUTTERWORTH_RINGREJECT = 9, +- IM_MASK_GAUSS_RINGPASS = 10, +- IM_MASK_GAUSS_RINGREJECT = 11, +- +- IM_MASK_IDEAL_BANDPASS = 12, +- IM_MASK_IDEAL_BANDREJECT = 13, +- IM_MASK_BUTTERWORTH_BANDPASS = 14, +- IM_MASK_BUTTERWORTH_BANDREJECT = 15, +- IM_MASK_GAUSS_BANDPASS = 16, +- IM_MASK_GAUSS_BANDREJECT = 17, +- +- IM_MASK_FRACTAL_FLT = 18 ++ IM_MASK_IDEAL_HIGHPASS = 0, ++ IM_MASK_IDEAL_LOWPASS = 1, ++ IM_MASK_BUTTERWORTH_HIGHPASS = 2, ++ IM_MASK_BUTTERWORTH_LOWPASS = 3, ++ IM_MASK_GAUSS_HIGHPASS = 4, ++ IM_MASK_GAUSS_LOWPASS = 5, ++ ++ IM_MASK_IDEAL_RINGPASS = 6, ++ IM_MASK_IDEAL_RINGREJECT = 7, ++ IM_MASK_BUTTERWORTH_RINGPASS = 8, ++ IM_MASK_BUTTERWORTH_RINGREJECT = 9, ++ IM_MASK_GAUSS_RINGPASS = 10, ++ IM_MASK_GAUSS_RINGREJECT = 11, ++ ++ IM_MASK_IDEAL_BANDPASS = 12, ++ IM_MASK_IDEAL_BANDREJECT = 13, ++ IM_MASK_BUTTERWORTH_BANDPASS = 14, ++ IM_MASK_BUTTERWORTH_BANDREJECT = 15, ++ IM_MASK_GAUSS_BANDPASS = 16, ++ IM_MASK_GAUSS_BANDREJECT = 17, ++ ++ IM_MASK_FRACTAL_FLT = 18 + } ImMaskType; + + /* We had them in the VIPS namespace for a while before deprecating them. + */ +-#define VIPS_MASK_IDEAL_HIGHPASS IM_MASK_IDEAL_HIGHPASS +-#define VIPS_MASK_IDEAL_LOWPASS IM_MASK_IDEAL_LOWPASS +-#define VIPS_MASK_BUTTERWORTH_HIGHPASS IM_MASK_BUTTERWORTH_HIGHPASS +-#define VIPS_MASK_BUTTERWORTH_LOWPASS IM_MASK_BUTTERWORTH_LOWPASS +-#define VIPS_MASK_GAUSS_HIGHPASS IM_MASK_GAUSS_HIGHPASS +-#define VIPS_MASK_GAUSS_LOWPASS IM_MASK_GAUSS_LOWPASS +-#define VIPS_MASK_IDEAL_RINGPASS IM_MASK_IDEAL_RINGPASS +-#define VIPS_MASK_IDEAL_RINGREJECT IM_MASK_IDEAL_RINGREJECT +-#define VIPS_MASK_BUTTERWORTH_RINGPASS IM_MASK_BUTTERWORTH_RINGPASS +-#define VIPS_MASK_BUTTERWORTH_RINGREJECT IM_MASK_BUTTERWORTH_RINGREJECT +-#define VIPS_MASK_GAUSS_RINGPASS IM_MASK_GAUSS_RINGPASS +-#define VIPS_MASK_GAUSS_RINGREJECT IM_MASK_GAUSS_RINGREJECT +-#define VIPS_MASK_IDEAL_BANDPASS IM_MASK_IDEAL_BANDPASS +-#define VIPS_MASK_IDEAL_BANDREJECT IM_MASK_IDEAL_BANDREJECT +-#define VIPS_MASK_BUTTERWORTH_BANDPASS IM_MASK_BUTTERWORTH_BANDPASS +-#define VIPS_MASK_BUTTERWORTH_BANDREJECT IM_MASK_BUTTERWORTH_BANDREJECT +-#define VIPS_MASK_GAUSS_BANDPASS IM_MASK_GAUSS_BANDPASS +-#define VIPS_MASK_GAUSS_BANDREJECT IM_MASK_GAUSS_BANDREJECT +-#define VIPS_MASK_FRACTAL_FLT IM_MASK_FRACTAL_FLT ++#define VIPS_MASK_IDEAL_HIGHPASS IM_MASK_IDEAL_HIGHPASS ++#define VIPS_MASK_IDEAL_LOWPASS IM_MASK_IDEAL_LOWPASS ++#define VIPS_MASK_BUTTERWORTH_HIGHPASS IM_MASK_BUTTERWORTH_HIGHPASS ++#define VIPS_MASK_BUTTERWORTH_LOWPASS IM_MASK_BUTTERWORTH_LOWPASS ++#define VIPS_MASK_GAUSS_HIGHPASS IM_MASK_GAUSS_HIGHPASS ++#define VIPS_MASK_GAUSS_LOWPASS IM_MASK_GAUSS_LOWPASS ++#define VIPS_MASK_IDEAL_RINGPASS IM_MASK_IDEAL_RINGPASS ++#define VIPS_MASK_IDEAL_RINGREJECT IM_MASK_IDEAL_RINGREJECT ++#define VIPS_MASK_BUTTERWORTH_RINGPASS IM_MASK_BUTTERWORTH_RINGPASS ++#define VIPS_MASK_BUTTERWORTH_RINGREJECT IM_MASK_BUTTERWORTH_RINGREJECT ++#define VIPS_MASK_GAUSS_RINGPASS IM_MASK_GAUSS_RINGPASS ++#define VIPS_MASK_GAUSS_RINGREJECT IM_MASK_GAUSS_RINGREJECT ++#define VIPS_MASK_IDEAL_BANDPASS IM_MASK_IDEAL_BANDPASS ++#define VIPS_MASK_IDEAL_BANDREJECT IM_MASK_IDEAL_BANDREJECT ++#define VIPS_MASK_BUTTERWORTH_BANDPASS IM_MASK_BUTTERWORTH_BANDPASS ++#define VIPS_MASK_BUTTERWORTH_BANDREJECT IM_MASK_BUTTERWORTH_BANDREJECT ++#define VIPS_MASK_GAUSS_BANDPASS IM_MASK_GAUSS_BANDPASS ++#define VIPS_MASK_GAUSS_BANDREJECT IM_MASK_GAUSS_BANDREJECT ++#define VIPS_MASK_FRACTAL_FLT IM_MASK_FRACTAL_FLT + + #define VIPS_MASK IM_MASK + + VIPS_DEPRECATED +-int im_flt_image_freq( VipsImage *in, VipsImage *out, ImMaskType flag, ... ); ++int im_flt_image_freq(VipsImage *in, VipsImage *out, ImMaskType flag, ...); + VIPS_DEPRECATED +-int im_create_fmask( VipsImage *out, +- int xsize, int ysize, ImMaskType flag, ... ); ++int im_create_fmask(VipsImage *out, ++ int xsize, int ysize, ImMaskType flag, ...); + + VIPS_DEPRECATED_FOR(vips_fwfft) +-int im_fwfft( VipsImage *in, VipsImage *out ); ++int im_fwfft(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_invfft) +-int im_invfft( VipsImage *in, VipsImage *out ); ++int im_invfft(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_invfft) +-int im_invfftr( VipsImage *in, VipsImage *out ); ++int im_invfftr(VipsImage *in, VipsImage *out); + + VIPS_DEPRECATED_FOR(vips_freqmult) +-int im_freqflt( VipsImage *in, VipsImage *mask, VipsImage *out ); ++int im_freqflt(VipsImage *in, VipsImage *mask, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_spectrum) +-int im_disp_ps( VipsImage *in, VipsImage *out ); ++int im_disp_ps(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED_FOR(vips_fractsurf) +-int im_fractsurf( VipsImage *out, int size, double frd ); ++int im_fractsurf(VipsImage *out, int size, double frd); + VIPS_DEPRECATED_FOR(vips_phasecor) +-int im_phasecor_fft( VipsImage *in1, VipsImage *in2, VipsImage *out ); ++int im_phasecor_fft(VipsImage *in1, VipsImage *in2, VipsImage *out); + + VIPS_DEPRECATED_FOR(vips_countlines) +-int im_cntlines( VipsImage *im, double *nolines, int flag ); ++int im_cntlines(VipsImage *im, double *nolines, int flag); + VIPS_DEPRECATED_FOR(vips_labelregions) +-int im_label_regions( VipsImage *test, VipsImage *mask, int *segments ); ++int im_label_regions(VipsImage *test, VipsImage *mask, int *segments); + VIPS_DEPRECATED_FOR(vips_rank) +-int im_rank( VipsImage *in, VipsImage *out, int width, int height, int index ); ++int im_rank(VipsImage *in, VipsImage *out, int width, int height, int index); + VIPS_DEPRECATED +-int im_zerox( VipsImage *in, VipsImage *out, int sign ); ++int im_zerox(VipsImage *in, VipsImage *out, int sign); + + VIPS_DEPRECATED +-int im_benchmarkn( VipsImage *in, VipsImage *out, int n ); ++int im_benchmarkn(VipsImage *in, VipsImage *out, int n); + VIPS_DEPRECATED +-int im_benchmark2( VipsImage *in, double *out ); ++int im_benchmark2(VipsImage *in, double *out); + + VIPS_DEPRECATED_FOR(vips_draw_circle) +-int im_draw_circle( VipsImage *image, +- int x, int y, int radius, gboolean fill, VipsPel *ink ); ++int im_draw_circle(VipsImage *image, ++ int x, int y, int radius, gboolean fill, VipsPel *ink); + + VIPS_DEPRECATED_FOR(vips_draw_mask) +-int im_draw_mask( VipsImage *image, +- VipsImage *mask_im, int x, int y, VipsPel *ink ); ++int im_draw_mask(VipsImage *image, ++ VipsImage *mask_im, int x, int y, VipsPel *ink); + VIPS_DEPRECATED_FOR(vips_draw_image) +-int im_draw_image( VipsImage *image, VipsImage *sub, int x, int y ); ++int im_draw_image(VipsImage *image, VipsImage *sub, int x, int y); + VIPS_DEPRECATED_FOR(vips_draw_rect) +-int im_draw_rect( VipsImage *image, +- int left, int top, int width, int height, int fill, VipsPel *ink ); ++int im_draw_rect(VipsImage *image, ++ int left, int top, int width, int height, int fill, VipsPel *ink); + +-typedef int (*VipsPlotFn)( VipsImage *image, int x, int y, +- void *a, void *b, void *c ); ++typedef int (*VipsPlotFn)(VipsImage *image, int x, int y, ++ void *a, void *b, void *c); + + VIPS_DEPRECATED_FOR(vips_draw_line) +-int im_draw_line_user( VipsImage *image, +- int x1, int y1, int x2, int y2, +- VipsPlotFn plot, void *a, void *b, void *c ); ++int im_draw_line_user(VipsImage *image, ++ int x1, int y1, int x2, int y2, ++ VipsPlotFn plot, void *a, void *b, void *c); + VIPS_DEPRECATED_FOR(vips_draw_line) +-int im_draw_line( VipsImage *image, +- int x1, int y1, int x2, int y2, VipsPel *ink ); ++int im_draw_line(VipsImage *image, ++ int x1, int y1, int x2, int y2, VipsPel *ink); + VIPS_DEPRECATED +-int im_lineset( VipsImage *in, VipsImage *out, VipsImage *mask, VipsImage *ink, +- int n, int *x1v, int *y1v, int *x2v, int *y2v ); ++int im_lineset(VipsImage *in, VipsImage *out, VipsImage *mask, VipsImage *ink, ++ int n, int *x1v, int *y1v, int *x2v, int *y2v); + + VIPS_DEPRECATED +-int im_insertset( VipsImage *main, VipsImage *sub, VipsImage *out, int n, int *x, int *y ); ++int im_insertset(VipsImage *main, VipsImage *sub, VipsImage *out, int n, int *x, int *y); + + VIPS_DEPRECATED_FOR(vips_draw_flood) +-int im_draw_flood( VipsImage *image, int x, int y, VipsPel *ink, VipsRect *dout ); ++int im_draw_flood(VipsImage *image, int x, int y, VipsPel *ink, VipsRect *dout); + VIPS_DEPRECATED_FOR(vips_draw_flood) +-int im_draw_flood_blob( VipsImage *image, +- int x, int y, VipsPel *ink, VipsRect *dout ); ++int im_draw_flood_blob(VipsImage *image, ++ int x, int y, VipsPel *ink, VipsRect *dout); + VIPS_DEPRECATED_FOR(vips_draw_flood1) +-int im_draw_flood_other( VipsImage *image, VipsImage *test, +- int x, int y, int serial, VipsRect *dout ); ++int im_draw_flood_other(VipsImage *image, VipsImage *test, ++ int x, int y, int serial, VipsRect *dout); + + VIPS_DEPRECATED_FOR(vips_draw_point) +-int im_draw_point( VipsImage *image, int x, int y, VipsPel *ink ); ++int im_draw_point(VipsImage *image, int x, int y, VipsPel *ink); + VIPS_DEPRECATED_FOR(vips_getpoint) +-int im_read_point( VipsImage *image, int x, int y, VipsPel *ink ); ++int im_read_point(VipsImage *image, int x, int y, VipsPel *ink); + + VIPS_DEPRECATED_FOR(vips_draw_smudge) +-int im_draw_smudge( VipsImage *image, +- int left, int top, int width, int height ); ++int im_draw_smudge(VipsImage *image, ++ int left, int top, int width, int height); + + VIPS_DEPRECATED +-void im_filename_split( const char *path, char *name, char *mode ); ++void im_filename_split(const char *path, char *name, char *mode); + VIPS_DEPRECATED_FOR(g_path_get_basename) +-const char *im_skip_dir( const char *filename ); ++const char *im_skip_dir(const char *filename); + VIPS_DEPRECATED +-void im_filename_suffix( const char *path, char *suffix ); ++void im_filename_suffix(const char *path, char *suffix); + VIPS_DEPRECATED +-int im_filename_suffix_match( const char *path, const char *suffixes[] ); ++int im_filename_suffix_match(const char *path, const char *suffixes[]); + VIPS_DEPRECATED +-char *im_getnextoption( char **in ); ++char *im_getnextoption(char **in); + VIPS_DEPRECATED +-char *im_getsuboption( const char *buf ); ++char *im_getsuboption(const char *buf); + + VIPS_DEPRECATED_FOR(vips_match) +-int im_match_linear( VipsImage *ref, VipsImage *sec, VipsImage *out, ++int im_match_linear(VipsImage *ref, VipsImage *sec, VipsImage *out, + int xr1, int yr1, int xs1, int ys1, +- int xr2, int yr2, int xs2, int ys2 ); ++ int xr2, int yr2, int xs2, int ys2); + VIPS_DEPRECATED_FOR(vips_match) +-int im_match_linear_search( VipsImage *ref, VipsImage *sec, VipsImage *out, ++int im_match_linear_search(VipsImage *ref, VipsImage *sec, VipsImage *out, + int xr1, int yr1, int xs1, int ys1, + int xr2, int yr2, int xs2, int ys2, +- int hwindowsize, int hsearchsize ); ++ int hwindowsize, int hsearchsize); + + VIPS_DEPRECATED_FOR(vips_globalbalance) +-int im_global_balance( VipsImage *in, VipsImage *out, double gamma ); ++int im_global_balance(VipsImage *in, VipsImage *out, double gamma); + VIPS_DEPRECATED_FOR(vips_globalbalance) +-int im_global_balancef( VipsImage *in, VipsImage *out, double gamma ); ++int im_global_balancef(VipsImage *in, VipsImage *out, double gamma); + + VIPS_DEPRECATED_FOR(vips_remosaic) +-int im_remosaic( VipsImage *in, VipsImage *out, +- const char *old_str, const char *new_str ); ++int im_remosaic(VipsImage *in, VipsImage *out, ++ const char *old_str, const char *new_str); + + VIPS_DEPRECATED_FOR(vips_merge) +-int im_lrmerge( VipsImage *ref, VipsImage *sec, VipsImage *out, +- int dx, int dy, int mwidth ); ++int im_lrmerge(VipsImage *ref, VipsImage *sec, VipsImage *out, ++ int dx, int dy, int mwidth); + VIPS_DEPRECATED_FOR(vips_mosaic1) +-int im_lrmerge1( VipsImage *ref, VipsImage *sec, VipsImage *out, ++int im_lrmerge1(VipsImage *ref, VipsImage *sec, VipsImage *out, + int xr1, int yr1, int xs1, int ys1, + int xr2, int yr2, int xs2, int ys2, +- int mwidth ); ++ int mwidth); + VIPS_DEPRECATED_FOR(vips_merge) +-int im_tbmerge( VipsImage *ref, VipsImage *sec, VipsImage *out, +- int dx, int dy, int mwidth ); ++int im_tbmerge(VipsImage *ref, VipsImage *sec, VipsImage *out, ++ int dx, int dy, int mwidth); + VIPS_DEPRECATED_FOR(vips_mosaic1) +-int im_tbmerge1( VipsImage *ref, VipsImage *sec, VipsImage *out, ++int im_tbmerge1(VipsImage *ref, VipsImage *sec, VipsImage *out, + int xr1, int yr1, int xs1, int ys1, + int xr2, int yr2, int xs2, int ys2, +- int mwidth ); ++ int mwidth); + + VIPS_DEPRECATED_FOR(vips_mosaic) +-int im_lrmosaic( VipsImage *ref, VipsImage *sec, VipsImage *out, ++int im_lrmosaic(VipsImage *ref, VipsImage *sec, VipsImage *out, + int bandno, + int xref, int yref, int xsec, int ysec, + int hwindowsize, int hsearchsize, + int balancetype, +- int mwidth ); ++ int mwidth); + VIPS_DEPRECATED_FOR(vips_mosaic1) +-int im_lrmosaic1( VipsImage *ref, VipsImage *sec, VipsImage *out, ++int im_lrmosaic1(VipsImage *ref, VipsImage *sec, VipsImage *out, + int bandno, +- int xr1, int yr1, int xs1, int ys1, ++ int xr1, int yr1, int xs1, int ys1, + int xr2, int yr2, int xs2, int ys2, + int hwindowsize, int hsearchsize, + int balancetype, +- int mwidth ); ++ int mwidth); + VIPS_DEPRECATED_FOR(vips_mosaic) +-int im_tbmosaic( VipsImage *ref, VipsImage *sec, VipsImage *out, ++int im_tbmosaic(VipsImage *ref, VipsImage *sec, VipsImage *out, + int bandno, +- int xref, int yref, int xsec, int ysec, ++ int xref, int yref, int xsec, int ysec, + int hwindowsize, int hsearchsize, + int balancetype, +- int mwidth ); ++ int mwidth); + VIPS_DEPRECATED_FOR(vips_mosaic1) +-int im_tbmosaic1( VipsImage *ref, VipsImage *sec, VipsImage *out, ++int im_tbmosaic1(VipsImage *ref, VipsImage *sec, VipsImage *out, + int bandno, + int xr1, int yr1, int xs1, int ys1, + int xr2, int yr2, int xs2, int ys2, + int hwindowsize, int hsearchsize, + int balancetype, +- int mwidth ); ++ int mwidth); + + VIPS_DEPRECATED +-int im_correl( VipsImage *ref, VipsImage *sec, ++int im_correl(VipsImage *ref, VipsImage *sec, + int xref, int yref, int xsec, int ysec, + int hwindowsize, int hsearchsize, +- double *correlation, int *x, int *y ); ++ double *correlation, int *x, int *y); + + VIPS_DEPRECATED +-int im_align_bands( VipsImage *in, VipsImage *out ); ++int im_align_bands(VipsImage *in, VipsImage *out); + VIPS_DEPRECATED +-int im_maxpos_subpel( VipsImage *in, double *x, double *y ); ++int im_maxpos_subpel(VipsImage *in, double *x, double *y); + +-VipsImage *vips__deprecated_open_read( const char *filename, gboolean sequential ); +-VipsImage *vips__deprecated_open_write( const char *filename ); ++VipsImage *vips__deprecated_open_read(const char *filename, gboolean sequential); ++VipsImage *vips__deprecated_open_write(const char *filename); + +-void im__format_init( void ); ++void im__format_init(void); + + /* Low-level read/write operations. + */ + VIPS_DEPRECATED +-int im_jpeg2vips( const char *filename, VipsImage *out ); ++int im_jpeg2vips(const char *filename, VipsImage *out); + VIPS_DEPRECATED +-int im_bufjpeg2vips( void *buf, size_t len, +- VipsImage *out, gboolean header_only ); ++int im_bufjpeg2vips(void *buf, size_t len, ++ VipsImage *out, gboolean header_only); + VIPS_DEPRECATED +-int im_vips2jpeg( VipsImage *in, const char *filename ); ++int im_vips2jpeg(VipsImage *in, const char *filename); + VIPS_DEPRECATED +-int im_vips2mimejpeg( VipsImage *in, int qfac ); ++int im_vips2mimejpeg(VipsImage *in, int qfac); + VIPS_DEPRECATED +-int im_vips2bufjpeg( VipsImage *in, VipsImage *out, +- int qfac, char **obuf, int *olen ); ++int im_vips2bufjpeg(VipsImage *in, VipsImage *out, ++ int qfac, char **obuf, int *olen); + + VIPS_DEPRECATED +-int im_tiff2vips( const char *filename, VipsImage *out ); ++int im_tiff2vips(const char *filename, VipsImage *out); + VIPS_DEPRECATED +-int im_vips2tiff( VipsImage *in, const char *filename ); ++int im_vips2tiff(VipsImage *in, const char *filename); + VIPS_DEPRECATED +-int im_tile_cache( VipsImage *in, VipsImage *out, +- int tile_width, int tile_height, int max_tiles ); ++int im_tile_cache(VipsImage *in, VipsImage *out, ++ int tile_width, int tile_height, int max_tiles); + + VIPS_DEPRECATED +-int im_magick2vips( const char *filename, VipsImage *out ); ++int im_magick2vips(const char *filename, VipsImage *out); + VIPS_DEPRECATED +-int im_bufmagick2vips( void *buf, size_t len, +- VipsImage *out, gboolean header_only ); ++int im_bufmagick2vips(void *buf, size_t len, ++ VipsImage *out, gboolean header_only); + + VIPS_DEPRECATED +-int im_exr2vips( const char *filename, VipsImage *out ); ++int im_exr2vips(const char *filename, VipsImage *out); + + VIPS_DEPRECATED +-int im_ppm2vips( const char *filename, VipsImage *out ); ++int im_ppm2vips(const char *filename, VipsImage *out); + VIPS_DEPRECATED +-int im_vips2ppm( VipsImage *in, const char *filename ); ++int im_vips2ppm(VipsImage *in, const char *filename); + + VIPS_DEPRECATED +-int im_analyze2vips( const char *filename, VipsImage *out ); ++int im_analyze2vips(const char *filename, VipsImage *out); + + VIPS_DEPRECATED +-int im_csv2vips( const char *filename, VipsImage *out ); ++int im_csv2vips(const char *filename, VipsImage *out); + VIPS_DEPRECATED +-int im_vips2csv( VipsImage *in, const char *filename ); ++int im_vips2csv(VipsImage *in, const char *filename); + + VIPS_DEPRECATED +-int im_png2vips( const char *filename, VipsImage *out ); ++int im_png2vips(const char *filename, VipsImage *out); + VIPS_DEPRECATED +-int im_vips2png( VipsImage *in, const char *filename ); ++int im_vips2png(VipsImage *in, const char *filename); + VIPS_DEPRECATED +-int im_vips2bufpng( VipsImage *in, VipsImage *out, +- int compression, int interlace, char **obuf, size_t *olen ); ++int im_vips2bufpng(VipsImage *in, VipsImage *out, ++ int compression, int interlace, char **obuf, size_t *olen); + + VIPS_DEPRECATED +-int im_webp2vips( const char *filename, VipsImage *out ); ++int im_webp2vips(const char *filename, VipsImage *out); + VIPS_DEPRECATED +-int im_vips2webp( VipsImage *in, const char *filename ); ++int im_vips2webp(VipsImage *in, const char *filename); + + VIPS_DEPRECATED +-int im_raw2vips( const char *filename, VipsImage *out, +- int width, int height, int bpp, int offset ); ++int im_raw2vips(const char *filename, VipsImage *out, ++ int width, int height, int bpp, int offset); + VIPS_DEPRECATED +-int im_vips2raw( VipsImage *in, int fd ); ++int im_vips2raw(VipsImage *in, int fd); + + VIPS_DEPRECATED +-int im_mat2vips( const char *filename, VipsImage *out ); ++int im_mat2vips(const char *filename, VipsImage *out); + + VIPS_DEPRECATED +-int im_rad2vips( const char *filename, VipsImage *out ); ++int im_rad2vips(const char *filename, VipsImage *out); + VIPS_DEPRECATED +-int im_vips2rad( VipsImage *in, const char *filename ); ++int im_vips2rad(VipsImage *in, const char *filename); + + VIPS_DEPRECATED +-int im_fits2vips( const char *filename, VipsImage *out ); ++int im_fits2vips(const char *filename, VipsImage *out); + VIPS_DEPRECATED +-int im_vips2fits( VipsImage *in, const char *filename ); ++int im_vips2fits(VipsImage *in, const char *filename); + + VIPS_DEPRECATED +-int im_vips2dz( VipsImage *in, const char *filename ); ++int im_vips2dz(VipsImage *in, const char *filename); + +-int im__bandup( const char *domain, VipsImage *in, VipsImage *out, int n ); +-int im__bandalike_vec( const char *domain, VipsImage **in, VipsImage **out, int n ); +-int im__bandalike( const char *domain, +- VipsImage *in1, VipsImage *in2, VipsImage *out1, VipsImage *out2 ); +-int im__formatalike_vec( VipsImage **in, VipsImage **out, int n ); +-int im__formatalike( VipsImage *in1, VipsImage *in2, VipsImage *out1, VipsImage *out2 ); ++int im__bandup(const char *domain, VipsImage *in, VipsImage *out, int n); ++int im__bandalike_vec(const char *domain, VipsImage **in, VipsImage **out, int n); ++int im__bandalike(const char *domain, ++ VipsImage *in1, VipsImage *in2, VipsImage *out1, VipsImage *out2); ++int im__formatalike_vec(VipsImage **in, VipsImage **out, int n); ++int im__formatalike(VipsImage *in1, VipsImage *in2, VipsImage *out1, VipsImage *out2); + +-int im__colour_unary( const char *domain, ++int im__colour_unary(const char *domain, + VipsImage *in, VipsImage *out, VipsInterpretation interpretation, +- im_wrapone_fn buffer_fn, void *a, void *b ); +-VipsImage **im__insert_base( const char *domain, +- VipsImage *in1, VipsImage *in2, VipsImage *out ); ++ im_wrapone_fn buffer_fn, void *a, void *b); ++VipsImage **im__insert_base(const char *domain, ++ VipsImage *in1, VipsImage *in2, VipsImage *out); + + /* TODO(kleisauke): These are also defined in pmosaicing.h */ +-int vips__find_lroverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, +- int bandno_in, +- int xref, int yref, int xsec, int ysec, +- int halfcorrelation, int halfarea, +- int *dx0, int *dy0, +- double *scale1, double *angle1, double *dx1, double *dy1 ); +-int vips__find_tboverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, +- int bandno_in, +- int xref, int yref, int xsec, int ysec, +- int halfcorrelation, int halfarea, +- int *dx0, int *dy0, +- double *scale1, double *angle1, double *dx1, double *dy1 ); ++int vips__find_lroverlap(VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, ++ int bandno_in, ++ int xref, int yref, int xsec, int ysec, ++ int halfcorrelation, int halfarea, ++ int *dx0, int *dy0, ++ double *scale1, double *angle1, double *dx1, double *dy1); ++int vips__find_tboverlap(VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, ++ int bandno_in, ++ int xref, int yref, int xsec, int ysec, ++ int halfcorrelation, int halfarea, ++ int *dx0, int *dy0, ++ double *scale1, double *angle1, double *dx1, double *dy1); + + /* A colour temperature. + */ +@@ -1575,10 +1581,9 @@ typedef struct { + } im_colour_temperature; + + VIPS_DEPRECATED +-void im_copy_dmask_matrix( DOUBLEMASK *mask, double **matrix ); ++void im_copy_dmask_matrix(DOUBLEMASK *mask, double **matrix); + VIPS_DEPRECATED +-void im_copy_matrix_dmask( double **matrix, DOUBLEMASK *mask ); +- ++void im_copy_matrix_dmask(double **matrix, DOUBLEMASK *mask); + + VIPS_DEPRECATED + int *im_ivector(int nl, int nh); +@@ -1607,47 +1612,47 @@ VIPS_DEPRECATED + void im_free_dmat(double **m, int nrl, int nrh, int ncl, int nch); + + VIPS_DEPRECATED +-int im_invmat( double **, int ); ++int im_invmat(double **, int); + + VIPS_DEPRECATED +-int im_conv_f_raw( VipsImage *in, VipsImage *out, DOUBLEMASK *mask ); ++int im_conv_f_raw(VipsImage *in, VipsImage *out, DOUBLEMASK *mask); + VIPS_DEPRECATED +-int im_convsep_f_raw( VipsImage *in, VipsImage *out, DOUBLEMASK *mask ); ++int im_convsep_f_raw(VipsImage *in, VipsImage *out, DOUBLEMASK *mask); + + VIPS_DEPRECATED +-int im_greyc_mask( VipsImage *in, VipsImage *out, VipsImage *mask, +- int iterations, float amplitude, float sharpness, float anisotropy, +- float alpha, float sigma, float dl, float da, float gauss_prec, +- int interpolation, int fast_approx ); ++int im_greyc_mask(VipsImage *in, VipsImage *out, VipsImage *mask, ++ int iterations, float amplitude, float sharpness, float anisotropy, ++ float alpha, float sigma, float dl, float da, float gauss_prec, ++ int interpolation, int fast_approx); + + VIPS_DEPRECATED +-int vips_check_imask( const char *domain, INTMASK *mask ); ++int vips_check_imask(const char *domain, INTMASK *mask); + VIPS_DEPRECATED +-int vips_check_dmask( const char *domain, DOUBLEMASK *mask ); ++int vips_check_dmask(const char *domain, DOUBLEMASK *mask); + VIPS_DEPRECATED +-int vips_check_dmask_1d( const char *domain, DOUBLEMASK *mask ); ++int vips_check_dmask_1d(const char *domain, DOUBLEMASK *mask); + + VIPS_DEPRECATED +-GOptionGroup *vips_get_option_group( void ); ++GOptionGroup *vips_get_option_group(void); + + /* old window manager API + */ + VIPS_DEPRECATED +-VipsWindow *vips_window_ref( VipsImage *im, int top, int height ); ++VipsWindow *vips_window_ref(VipsImage *im, int top, int height); + + VIPS_DEPRECATED +-FILE *vips_popenf( const char *fmt, const char *mode, ... ) +- G_GNUC_PRINTF( 1, 3 ); ++FILE *vips_popenf(const char *fmt, const char *mode, ...) ++ G_GNUC_PRINTF(1, 3); + +-double *vips__ink_to_vector( const char *domain, +- VipsImage *im, VipsPel *ink, int *n ); ++double *vips__ink_to_vector(const char *domain, ++ VipsImage *im, VipsPel *ink, int *n); + +-VipsPel *im__vector_to_ink( const char *domain, +- VipsImage *im, int n, double *vec ); ++VipsPel *im__vector_to_ink(const char *domain, ++ VipsImage *im, int n, double *vec); + +-int vips__init( const char *argv0 ); ++int vips__init(const char *argv0); + +-size_t vips__get_sizeof_vipsobject( void ); ++size_t vips__get_sizeof_vipsobject(void); + + /* This stuff is very, very old and should not be used by anyone now. + */ +@@ -1663,5 +1668,3 @@ size_t vips__get_sizeof_vipsobject( void ); + #endif /*__cplusplus*/ + + #endif /*VIPS_VIPS7COMPAT_H*/ +- +- +diff --git a/libvips/iofuncs/buf.c b/libvips/iofuncs/buf.c +index 19be0a913f..3e186dd52d 100644 +--- a/libvips/iofuncs/buf.c ++++ b/libvips/iofuncs/buf.c +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2003 The National Gallery ++ Copyright (C) 1991-2003 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -52,8 +52,8 @@ + * @see_also: #vips + * @include: vips/vips.h + * +- * A message buffer you can append stuff to safely and quickly. If the message +- * gets too long, you get "..." and truncation. Message buffers can be on the ++ * A message buffer you can append stuff to safely and quickly. If the message ++ * gets too long, you get "..." and truncation. Message buffers can be on the + * stack or heap. + * + * For example: +@@ -73,7 +73,7 @@ + * ]| + */ + +-/** ++/** + * VIPS_BUF_STATIC: + * @TEXT: the storage area to use + * +@@ -92,13 +92,13 @@ + * Reset the buffer to the empty string. + */ + void +-vips_buf_rewind( VipsBuf *buf ) ++vips_buf_rewind(VipsBuf *buf) + { + buf->i = 0; + buf->lasti = 0; + buf->full = FALSE; + +- if( buf->base ) ++ if (buf->base) + buf->base[0] = '\0'; + } + +@@ -109,12 +109,12 @@ vips_buf_rewind( VipsBuf *buf ) + * Initialize a buffer. + */ + void +-vips_buf_init( VipsBuf *buf ) ++vips_buf_init(VipsBuf *buf) + { + buf->base = NULL; + buf->mx = 0; + buf->dynamic = FALSE; +- vips_buf_rewind( buf ); ++ vips_buf_rewind(buf); + } + + /** +@@ -125,16 +125,16 @@ vips_buf_init( VipsBuf *buf ) + * _init state. + */ + void +-vips_buf_destroy( VipsBuf *buf ) ++vips_buf_destroy(VipsBuf *buf) + { +- if( buf->dynamic ) { +- VIPS_FREE( buf->base ); ++ if (buf->dynamic) { ++ VIPS_FREE(buf->base); + } + +- vips_buf_init( buf ); ++ vips_buf_init(buf); + } + +-/** ++/** + * vips_buf_set_static: + * @buf: the buffer + * @base: the start of the memory area to use for storage +@@ -144,16 +144,16 @@ vips_buf_destroy( VipsBuf *buf ) + * initialised. The memory area needs to be at least 4 bytes long. + */ + void +-vips_buf_set_static( VipsBuf *buf, char *base, int mx ) ++vips_buf_set_static(VipsBuf *buf, char *base, int mx) + { +- g_assert( mx >= 4 ); ++ g_assert(mx >= 4); + +- vips_buf_destroy( buf ); ++ vips_buf_destroy(buf); + + buf->base = base; + buf->mx = mx; + buf->dynamic = FALSE; +- vips_buf_rewind( buf ); ++ vips_buf_rewind(buf); + } + + /** +@@ -170,18 +170,18 @@ vips_buf_set_static( VipsBuf *buf, char *base, int mx ) + * |[ + * char txt[256]; + * VipsBuf buf; +- * ++ * + * vips_buf_init_static (&buf, txt, 256); + * ]| +- * ++ * + * Static buffers don't need to be freed when they go out of scope, but their + * size must be set at compile-time. + */ + void +-vips_buf_init_static( VipsBuf *buf, char *base, int mx ) ++vips_buf_init_static(VipsBuf *buf, char *base, int mx) + { +- vips_buf_init( buf ); +- vips_buf_set_static( buf, base, mx ); ++ vips_buf_init(buf); ++ vips_buf_set_static(buf, base, mx); + } + + /** +@@ -193,25 +193,25 @@ vips_buf_init_static( VipsBuf *buf, char *base, int mx ) + * initialised. The memory area needs to be at least 4 bytes long. + */ + void +-vips_buf_set_dynamic( VipsBuf *buf, int mx ) ++vips_buf_set_dynamic(VipsBuf *buf, int mx) + { +- g_assert( mx >= 4 ); ++ g_assert(mx >= 4); + +- if( buf->mx == mx && buf->dynamic ) ++ if (buf->mx == mx && buf->dynamic) + /* No change? + */ +- vips_buf_rewind( buf ); ++ vips_buf_rewind(buf); + else { +- vips_buf_destroy( buf ); ++ vips_buf_destroy(buf); + +- if( !(buf->base = VIPS_ARRAY( NULL, mx, char )) ) ++ if (!(buf->base = VIPS_ARRAY(NULL, mx, char))) + /* No error return, so just block writes. + */ + buf->full = TRUE; + else { + buf->mx = mx; + buf->dynamic = TRUE; +- vips_buf_rewind( buf ); ++ vips_buf_rewind(buf); + } + } + } +@@ -221,12 +221,12 @@ vips_buf_set_dynamic( VipsBuf *buf, int mx ) + * @buf: the buffer + * @mx: the size of the storage area + * +- * Initialise and attach to a heap memory area. ++ * Initialise and attach to a heap memory area. + * The memory area needs to be at least 4 bytes long. +- * ++ * + * |[ + * VipsBuf buf; +- * ++ * + * vips_buf_init_synamic (&buf, 256); + * ]| + * +@@ -234,10 +234,10 @@ vips_buf_set_dynamic( VipsBuf *buf, int mx ) + * be set at runtime. + */ + void +-vips_buf_init_dynamic( VipsBuf *buf, int mx ) ++vips_buf_init_dynamic(VipsBuf *buf, int mx) + { +- vips_buf_init( buf ); +- vips_buf_set_dynamic( buf, mx ); ++ vips_buf_init(buf); ++ vips_buf_set_dynamic(buf, mx); + } + + /** +@@ -249,27 +249,27 @@ vips_buf_init_dynamic( VipsBuf *buf, int mx ) + * Append at most @sz chars from @str to @buf. @sz < 0 means unlimited. This + * is the low-level append operation: functions like vips_buf_appendf() build + * on top of this. +- * ++ * + * Returns: %FALSE on overflow, %TRUE otherwise. + */ + gboolean +-vips_buf_appendns( VipsBuf *buf, const char *str, int sz ) ++vips_buf_appendns(VipsBuf *buf, const char *str, int sz) + { + int len; + int n; + int avail; + int cpy; + +- if( buf->full ) +- return( FALSE ); +- if( !str ) +- return( TRUE ); ++ if (buf->full) ++ return (FALSE); ++ if (!str) ++ return (TRUE); + + /* Amount we want to copy. + */ +- len = strlen( str ); +- if( sz >= 0 ) +- n = VIPS_MIN( sz, len ); ++ len = strlen(str); ++ if (sz >= 0) ++ n = VIPS_MIN(sz, len); + else + n = len; + +@@ -277,7 +277,7 @@ vips_buf_appendns( VipsBuf *buf, const char *str, int sz ) + */ + avail = buf->mx - buf->i - 4; + +- cpy = VIPS_MIN( n, avail ); ++ cpy = VIPS_MIN(n, avail); + + /* Can't use vips_strncpy() here, we don't want to drop the end of the + * string. +@@ -286,18 +286,18 @@ vips_buf_appendns( VipsBuf *buf, const char *str, int sz ) + */ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstringop-overflow" +- strncpy( buf->base + buf->i, str, cpy ); ++ strncpy(buf->base + buf->i, str, cpy); + #pragma GCC diagnostic pop + buf->i += cpy; + +- if( buf->i >= buf->mx - 4 ) { ++ if (buf->i >= buf->mx - 4) { + buf->full = TRUE; +- strcpy( buf->base + buf->mx - 4, "..." ); ++ strcpy(buf->base + buf->mx - 4, "..."); + buf->i = buf->mx - 1; +- return( FALSE ); ++ return (FALSE); + } + +- return( TRUE ); ++ return (TRUE); + } + + /** +@@ -305,14 +305,14 @@ vips_buf_appendns( VipsBuf *buf, const char *str, int sz ) + * @buf: the buffer + * @str: the string to append to the buffer + * +- * Append the whole of @str to @buf. +- * ++ * Append the whole of @str to @buf. ++ * + * Returns: %FALSE on overflow, %TRUE otherwise. + */ + gboolean +-vips_buf_appends( VipsBuf *buf, const char *str ) ++vips_buf_appends(VipsBuf *buf, const char *str) + { +- return( vips_buf_appendns( buf, str, -1 ) ); ++ return (vips_buf_appendns(buf, str, -1)); + } + + /** +@@ -320,19 +320,19 @@ vips_buf_appends( VipsBuf *buf, const char *str ) + * @buf: the buffer + * @ch: the character to append to the buffer + * +- * Append a single character @ch to @buf. +- * ++ * Append a single character @ch to @buf. ++ * + * Returns: %FALSE on overflow, %TRUE otherwise. + */ + gboolean +-vips_buf_appendc( VipsBuf *buf, char ch ) ++vips_buf_appendc(VipsBuf *buf, char ch) + { + char tiny[2]; + + tiny[0] = ch; + tiny[1] = '\0'; + +- return( vips_buf_appendns( buf, tiny, 1 ) ); ++ return (vips_buf_appendns(buf, tiny, 1)); + } + + /** +@@ -342,41 +342,41 @@ vips_buf_appendc( VipsBuf *buf, char ch ) + * @n: the string to substitute + * + * Swap the rightmost occurence of @o for @n. +- * ++ * + * Returns: %FALSE on overflow, %TRUE otherwise. + */ + gboolean +-vips_buf_change( VipsBuf *buf, const char *old, const char *new ) ++vips_buf_change(VipsBuf *buf, const char *old, const char *new) + { +- int olen = strlen( old ); +- int nlen = strlen( new ); ++ int olen = strlen(old); ++ int nlen = strlen(new); + int i; + +- if( buf->full ) +- return( FALSE ); +- if( buf->i - olen + nlen > buf->mx - 4 ) { ++ if (buf->full) ++ return (FALSE); ++ if (buf->i - olen + nlen > buf->mx - 4) { + buf->full = TRUE; +- return( FALSE ); ++ return (FALSE); + } + + /* Find pos of old. + */ +- for( i = buf->i - olen; i > 0; i-- ) +- if( vips_isprefix( old, buf->base + i ) ) ++ for (i = buf->i - olen; i > 0; i--) ++ if (vips_isprefix(old, buf->base + i)) + break; +- g_assert( i >= 0 ); ++ g_assert(i >= 0); + + /* Move tail of buffer to make right-size space for new. + */ +- memmove( buf->base + i + nlen, buf->base + i + olen, +- buf->i - i - olen ); ++ memmove(buf->base + i + nlen, buf->base + i + olen, ++ buf->i - i - olen); + + /* Copy new in. + */ +- memcpy( buf->base + i, new, nlen ); ++ memcpy(buf->base + i, new, nlen); + buf->i = i + nlen + (buf->i - i - olen); + +- return( TRUE ); ++ return (TRUE); + } + + /** +@@ -385,20 +385,20 @@ vips_buf_change( VipsBuf *buf, const char *old, const char *new ) + * @ch: the character to remove + * + * Remove the last character, if it's @ch. +- * ++ * + * Returns: %FALSE on failure, %TRUE otherwise. + */ + gboolean +-vips_buf_removec( VipsBuf *buf, char ch ) ++vips_buf_removec(VipsBuf *buf, char ch) + { +- if( buf->full ) +- return( FALSE ); +- if( buf->i <= 0 ) +- return( FALSE ); +- if( buf->base[buf->i - 1] == ch ) ++ if (buf->full) ++ return (FALSE); ++ if (buf->i <= 0) ++ return (FALSE); ++ if (buf->base[buf->i - 1] == ch) + buf->i -= 1; + +- return( TRUE ); ++ return (TRUE); + } + + /** +@@ -412,27 +412,27 @@ vips_buf_removec( VipsBuf *buf, char ch ) + * Returns: %FALSE on overflow, %TRUE otherwise. + */ + gboolean +-vips_buf_vappendf( VipsBuf *buf, const char *fmt, va_list ap ) ++vips_buf_vappendf(VipsBuf *buf, const char *fmt, va_list ap) + { + int avail; + char *p; + +- if( buf->full ) +- return( FALSE ); ++ if (buf->full) ++ return (FALSE); + + avail = buf->mx - buf->i - 4; + p = buf->base + buf->i; +- (void) vips_vsnprintf( p, avail, fmt, ap ); +- buf->i += strlen( p ); ++ (void) vips_vsnprintf(p, avail, fmt, ap); ++ buf->i += strlen(p); + +- if( buf->i >= buf->mx - 4 ) { ++ if (buf->i >= buf->mx - 4) { + buf->full = TRUE; +- strcpy( buf->base + buf->mx - 4, "..." ); ++ strcpy(buf->base + buf->mx - 4, "..."); + buf->i = buf->mx - 1; +- return( FALSE ); ++ return (FALSE); + } + +- return( TRUE ); ++ return (TRUE); + } + + /** +@@ -442,39 +442,39 @@ vips_buf_vappendf( VipsBuf *buf, const char *fmt, va_list ap ) + * @...: arguments to format string + * + * Format the string and append to @buf. +- * ++ * + * Returns: %FALSE on overflow, %TRUE otherwise. + */ + gboolean +-vips_buf_appendf( VipsBuf *buf, const char *fmt, ... ) ++vips_buf_appendf(VipsBuf *buf, const char *fmt, ...) + { + va_list ap; + gboolean result; + +- va_start( ap, fmt ); +- result = vips_buf_vappendf( buf, fmt, ap ); +- va_end( ap ); ++ va_start(ap, fmt); ++ result = vips_buf_vappendf(buf, fmt, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** + * vips_buf_appendg: + * @buf: the buffer + * @g: value to format and append +- * ++ * + * Append a double, non-localised. Useful for config files etc. +- * ++ * + * Returns: %FALSE on overflow, %TRUE otherwise. + */ + gboolean +-vips_buf_appendg( VipsBuf *buf, double g ) ++vips_buf_appendg(VipsBuf *buf, double g) + { + char text[G_ASCII_DTOSTR_BUF_SIZE]; + +- g_ascii_dtostr( text, sizeof( text ), g ); ++ g_ascii_dtostr(text, sizeof(text), g); + +- return( vips_buf_appends( buf, text ) ); ++ return (vips_buf_appends(buf, text)); + } + + /** +@@ -484,16 +484,16 @@ vips_buf_appendg( VipsBuf *buf, double g ) + * + * Append a number. If the number is -ve, add brackets. Needed for + * building function arguments. +- * ++ * + * Returns: %FALSE on overflow, %TRUE otherwise. + */ + gboolean +-vips_buf_appendd( VipsBuf *buf, int d ) ++vips_buf_appendd(VipsBuf *buf, int d) + { +- if( d < 0 ) +- return( vips_buf_appendf( buf, " (%d)", d ) ); ++ if (d < 0) ++ return (vips_buf_appendf(buf, " (%d)", d)); + else +- return( vips_buf_appendf( buf, " %d", d ) ); ++ return (vips_buf_appendf(buf, " %d", d)); + } + + /** +@@ -505,15 +505,15 @@ vips_buf_appendd( VipsBuf *buf, int d ) + * bytes of binary data" for BLOBs like icc-profile-data. + * + * Use vips_image_get_as_string() to make a text representation of a field. +- * That will base64-encode blobs, for example. ++ * That will base64-encode blobs, for example. + * + * Returns: %FALSE on overflow, %TRUE otherwise. + */ + gboolean +-vips_buf_appendgv( VipsBuf *buf, GValue *value ) ++vips_buf_appendgv(VipsBuf *buf, GValue *value) + { +- GType type = G_VALUE_TYPE( value ); +- GType fundamental = g_type_fundamental( type ); ++ GType type = G_VALUE_TYPE(value); ++ GType fundamental = g_type_fundamental(type); + + gboolean handled; + gboolean result; +@@ -521,133 +521,127 @@ vips_buf_appendgv( VipsBuf *buf, GValue *value ) + result = FALSE; + handled = FALSE; + +- switch( fundamental ) { +- case G_TYPE_STRING: +-{ ++ switch (fundamental) { ++ case G_TYPE_STRING: { + const char *str; + +- /* These are GStrings (gchararray). vips refstrings are ++ /* These are GStrings (gchararray). vips refstrings are + * handled by boxed, see below. + */ +- str = g_value_get_string( value ); +- result = vips_buf_appends( buf, str ); ++ str = g_value_get_string(value); ++ result = vips_buf_appends(buf, str); + handled = TRUE; +-} +- break; ++ } break; + +- case G_TYPE_OBJECT: +-{ ++ case G_TYPE_OBJECT: { + GObject *object; + +- object = g_value_get_object( value ); +- if( VIPS_IS_OBJECT( object ) ) { +- vips_object_summary( VIPS_OBJECT( object ), buf ); ++ object = g_value_get_object(value); ++ if (VIPS_IS_OBJECT(object)) { ++ vips_object_summary(VIPS_OBJECT(object), buf); + result = TRUE; + handled = TRUE; + } +-} +- break; ++ } break; + + case G_TYPE_INT: +- result = vips_buf_appendf( buf, +- "%d", g_value_get_int( value ) ); ++ result = vips_buf_appendf(buf, ++ "%d", g_value_get_int(value)); + handled = TRUE; + break; + + case G_TYPE_UINT64: +- result = vips_buf_appendf( buf, +- "%" G_GINT64_FORMAT, g_value_get_uint64( value ) ); ++ result = vips_buf_appendf(buf, ++ "%" G_GINT64_FORMAT, g_value_get_uint64(value)); + handled = TRUE; + break; + + case G_TYPE_DOUBLE: +- result = vips_buf_appendf( buf, +- "%g", g_value_get_double( value ) ); ++ result = vips_buf_appendf(buf, ++ "%g", g_value_get_double(value)); + handled = TRUE; + break; + + case G_TYPE_BOOLEAN: +- result = vips_buf_appends( buf, +- g_value_get_boolean( value ) ? "true" : "false" ); ++ result = vips_buf_appends(buf, ++ g_value_get_boolean(value) ? "true" : "false"); + handled = TRUE; + break; + + case G_TYPE_ENUM: +- result = vips_buf_appends( buf, +- vips_enum_nick( type, g_value_get_enum( value ) ) ); ++ result = vips_buf_appends(buf, ++ vips_enum_nick(type, g_value_get_enum(value))); + handled = TRUE; + break; + +- case G_TYPE_FLAGS: +-{ +- GFlagsClass *flags_class = g_type_class_ref( type ); ++ case G_TYPE_FLAGS: { ++ GFlagsClass *flags_class = g_type_class_ref(type); + + GFlagsValue *v; + int flags; + +- flags = g_value_get_flags( value ); ++ flags = g_value_get_flags(value); + +- while( flags && +- (v = g_flags_get_first_value( flags_class, flags )) ) { +- result = vips_buf_appendf( buf, "%s ", v->value_nick ); ++ while (flags && ++ (v = g_flags_get_first_value(flags_class, flags))) { ++ result = vips_buf_appendf(buf, "%s ", v->value_nick); + flags &= ~v->value; + } + + handled = TRUE; +-} +- break; ++ } break; + + case G_TYPE_BOXED: +- if( type == VIPS_TYPE_REF_STRING ) { ++ if (type == VIPS_TYPE_REF_STRING) { + const char *str; + size_t str_len; + + /* These should be printable. + */ +- str = vips_value_get_ref_string( value, &str_len ); +- result = vips_buf_appends( buf, str ); ++ str = vips_value_get_ref_string(value, &str_len); ++ result = vips_buf_appends(buf, str); + handled = TRUE; + } +- else if( type == VIPS_TYPE_BLOB ) { ++ else if (type == VIPS_TYPE_BLOB) { + size_t str_len; + + /* Binary data and not printable. + */ +- (void) vips_value_get_ref_string( value, &str_len ); +- result = vips_buf_appendf( buf, +- _( "%zd bytes of binary data" ), str_len ); ++ (void) vips_value_get_ref_string(value, &str_len); ++ result = vips_buf_appendf(buf, ++ _("%zd bytes of binary data"), str_len); + handled = TRUE; + } +- else if( type == VIPS_TYPE_ARRAY_DOUBLE ) { ++ else if (type == VIPS_TYPE_ARRAY_DOUBLE) { + double *arr; + int n; + int i; + +- arr = vips_value_get_array_double( value, &n ); +- for( i = 0; i < n; i++ ) +- result = vips_buf_appendf( buf, "%g ", arr[i] ); ++ arr = vips_value_get_array_double(value, &n); ++ for (i = 0; i < n; i++) ++ result = vips_buf_appendf(buf, "%g ", arr[i]); + handled = TRUE; + } +- else if( type == VIPS_TYPE_ARRAY_INT ) { ++ else if (type == VIPS_TYPE_ARRAY_INT) { + int *arr; + int n; + int i; + +- arr = vips_value_get_array_int( value, &n ); +- for( i = 0; i < n; i++ ) +- result = vips_buf_appendf( buf, "%d ", arr[i] ); ++ arr = vips_value_get_array_int(value, &n); ++ for (i = 0; i < n; i++) ++ result = vips_buf_appendf(buf, "%d ", arr[i]); + handled = TRUE; + } +- else if( type == VIPS_TYPE_ARRAY_IMAGE ) { ++ else if (type == VIPS_TYPE_ARRAY_IMAGE) { + VipsImage **arr; + int n; + int i; + +- arr = vips_value_get_array_image( value, &n ); +- for( i = 0; i < n; i++ ) { +- vips_object_summary( VIPS_OBJECT( arr[i] ), +- buf ); +- result = vips_buf_appends( buf, " " ); ++ arr = vips_value_get_array_image(value, &n); ++ for (i = 0; i < n; i++) { ++ vips_object_summary(VIPS_OBJECT(arr[i]), ++ buf); ++ result = vips_buf_appends(buf, " "); + } + handled = TRUE; + } +@@ -657,15 +651,15 @@ vips_buf_appendgv( VipsBuf *buf, GValue *value ) + break; + } + +- if( !handled ) { ++ if (!handled) { + char *str_value; + +- str_value = g_strdup_value_contents( value ); +- result = vips_buf_appends( buf, str_value ); +- g_free( str_value ); ++ str_value = g_strdup_value_contents(value); ++ result = vips_buf_appends(buf, str_value); ++ g_free(str_value); + } + +- return( result ); ++ return (result); + } + + /** +@@ -675,32 +669,32 @@ vips_buf_appendgv( VipsBuf *buf, GValue *value ) + * + * Turn a number of bytes into a sensible string ... eg "12", "12KB", "12MB", + * "12GB" etc. +- * ++ * + * Returns: %FALSE on overflow, %TRUE otherwise. + */ + gboolean +-vips_buf_append_size( VipsBuf *buf, size_t n ) ++vips_buf_append_size(VipsBuf *buf, size_t n) + { +- const static char *names[] = { ++ const static char *names[] = { + /* File length unit. + */ +- N_( "bytes" ), ++ N_("bytes"), + + /* Kilobyte unit. + */ +- N_( "KB" ), ++ N_("KB"), + + /* Megabyte unit. + */ +- N_( "MB" ), ++ N_("MB"), + + /* Gigabyte unit. + */ +- N_( "GB" ), ++ N_("GB"), + + /* Terabyte unit. + */ +- N_( "TB" ) ++ N_("TB") + }; + + double sz = n; +@@ -708,32 +702,32 @@ vips_buf_append_size( VipsBuf *buf, size_t n ) + + /* -1, since we want to stop at TB, not run off the end. + */ +- for( i = 0; sz > 1024 && i < VIPS_NUMBER( names ) - 1; sz /= 1024, i++ ) ++ for (i = 0; sz > 1024 && i < VIPS_NUMBER(names) - 1; sz /= 1024, i++) + ; + +- if( i == 0 ) ++ if (i == 0) + /* No decimal places for bytes. + */ +- return( vips_buf_appendf( buf, "%g %s", sz, _( names[i] ) ) ); +- else +- return( vips_buf_appendf( buf, "%.2f %s", sz, _( names[i] ) ) ); ++ return (vips_buf_appendf(buf, "%g %s", sz, _(names[i]))); ++ else ++ return (vips_buf_appendf(buf, "%.2f %s", sz, _(names[i]))); + } + + /** + * vips_buf_all: + * @buf: the buffer + * +- * Return the contents of the buffer as a C string. +- * ++ * Return the contents of the buffer as a C string. ++ * + * Returns: the %NULL-terminated contents of the buffer. This is a pointer to +- * the memory managed by the buffer and must not be freed. ++ * the memory managed by the buffer and must not be freed. + */ + const char * +-vips_buf_all( VipsBuf *buf ) ++vips_buf_all(VipsBuf *buf) + { + buf->base[buf->i] = '\0'; + +- return( buf->base ); ++ return (buf->base); + } + + /** +@@ -741,19 +735,19 @@ vips_buf_all( VipsBuf *buf ) + * @buf: the buffer + * + * Trim to just the first line (excluding "\n"). +- * ++ * + * Returns: the %NULL-terminated contents of the buffer. This is a pointer to +- * the memory managed by the buffer and must not be freed. ++ * the memory managed by the buffer and must not be freed. + */ + const char * +-vips_buf_firstline( VipsBuf *buf ) ++vips_buf_firstline(VipsBuf *buf) + { + char *p; + +- if( (p = strchr( vips_buf_all( buf ), '\n' )) ) ++ if ((p = strchr(vips_buf_all(buf), '\n'))) + *p = '\0'; + +- return( vips_buf_all( buf ) ); ++ return (vips_buf_all(buf)); + } + + /** +@@ -763,9 +757,9 @@ vips_buf_firstline( VipsBuf *buf ) + * Returns: %TRUE if the buffer is empty. + */ + gboolean +-vips_buf_is_empty( VipsBuf *buf ) ++vips_buf_is_empty(VipsBuf *buf) + { +- return( buf->i == 0 ); ++ return (buf->i == 0); + } + + /** +@@ -775,9 +769,9 @@ vips_buf_is_empty( VipsBuf *buf ) + * Returns: %TRUE if the buffer is full. + */ + gboolean +-vips_buf_is_full( VipsBuf *buf ) ++vips_buf_is_full(VipsBuf *buf) + { +- return( buf->full ); ++ return (buf->full); + } + + /** +@@ -787,8 +781,7 @@ vips_buf_is_full( VipsBuf *buf ) + * Returns: the number of characters currently in the buffer. + */ + int +-vips_buf_len( VipsBuf *buf ) ++vips_buf_len(VipsBuf *buf) + { +- return( buf->i ); ++ return (buf->i); + } +- +diff --git a/libvips/iofuncs/buffer.c b/libvips/iofuncs/buffer.c +index f7a6f1df75..54f82f80b2 100644 +--- a/libvips/iofuncs/buffer.c ++++ b/libvips/iofuncs/buffer.c +@@ -1,5 +1,5 @@ + /* Manage sets of pixel buffers on an image. +- * ++ * + * 30/10/06 + * - from window.c + * 2/2/07 +@@ -8,7 +8,7 @@ + * - split to many buffer lists per image + * 11/2/07 + * - split to a buffer hash per thread +- * - reuse buffer mallocs when we can ++ * - reuse buffer mallocs when we can + * 20/2/07 + * - add VipsBufferCacheList and we can avoid some hash ops on + * done/undone +@@ -18,7 +18,7 @@ + * 21/9/11 + * - switch to vips_tracked_malloc() + * 18/12/13 +- * - keep a few buffers in reserve per image, stops malloc/free ++ * - keep a few buffers in reserve per image, stops malloc/free + * cycling when sharing is repeatedly discovered + * 6/6/16 + * - free buffers on image close as well as thread exit, so main thread +@@ -29,28 +29,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -79,200 +79,200 @@ static GSList *vips__buffer_all = NULL; + #endif /*DEBUG*/ + + #ifdef DEBUG_CREATE +-static GSList *vips__buffer_cache_all = NULL; ++static GSList *vips__buffer_cache_all = NULL; + #endif /*DEBUG_CREATE*/ + +-/* The maximum numbers of buffers we hold in reserve per image. ++/* The maximum numbers of buffers we hold in reserve per image. + */ +-static const int buffer_cache_max_reserve = 2; ++static const int buffer_cache_max_reserve = 2; + +-/* Workers have a BufferThread (and BufferCache) in a GPrivate they have ++/* Workers have a BufferThread (and BufferCache) in a GPrivate they have + * exclusive access to. + */ + static GPrivate *buffer_thread_key = NULL; + + void +-vips_buffer_print( VipsBuffer *buffer ) ++vips_buffer_print(VipsBuffer *buffer) + { +- printf( "VipsBuffer: %p ref_count = %d, ", buffer, buffer->ref_count ); +- printf( "im = %p, ", buffer->im ); +- printf( "area.left = %d, ", buffer->area.left ); +- printf( "area.top = %d, ", buffer->area.top ); +- printf( "area.width = %d, ", buffer->area.width ); +- printf( "area.height = %d, ", buffer->area.height ); +- printf( "done = %d, ", buffer->done ); +- printf( "cache = %p, ", buffer->cache ); +- printf( "buf = %p, ", buffer->buf ); +- printf( "bsize = %zd\n", buffer->bsize ); ++ printf("VipsBuffer: %p ref_count = %d, ", buffer, buffer->ref_count); ++ printf("im = %p, ", buffer->im); ++ printf("area.left = %d, ", buffer->area.left); ++ printf("area.top = %d, ", buffer->area.top); ++ printf("area.width = %d, ", buffer->area.width); ++ printf("area.height = %d, ", buffer->area.height); ++ printf("done = %d, ", buffer->done); ++ printf("cache = %p, ", buffer->cache); ++ printf("buf = %p, ", buffer->buf); ++ printf("bsize = %zd\n", buffer->bsize); + } + + #ifdef DEBUG + static void * +-vips_buffer_dump( VipsBuffer *buffer, size_t *reserve, size_t *alive ) ++vips_buffer_dump(VipsBuffer *buffer, size_t *reserve, size_t *alive) + { +- vips_buffer_print( buffer ); ++ vips_buffer_print(buffer); + +- g_assert( buffer->im ); +- g_assert( buffer->buf ); ++ g_assert(buffer->im); ++ g_assert(buffer->buf); + +- if( !buffer->cache && +- !buffer->done ) { ++ if (!buffer->cache && ++ !buffer->done) { + /* Global buffer, not linked to any cache. + */ +- printf( "global buffer %p, %.3g MB\n", +- buffer, buffer->bsize / (1024 * 1024.0) ); ++ printf("global buffer %p, %.3g MB\n", ++ buffer, buffer->bsize / (1024 * 1024.0)); + *alive += buffer->bsize; + } + +- else if( buffer->cache && ++ else if (buffer->cache && + buffer->done && +- !vips_rect_isempty( &buffer->area ) && +- g_slist_find( buffer->cache->buffers, buffer ) ) { +- /* Published on a thread. ++ !vips_rect_isempty(&buffer->area) && ++ g_slist_find(buffer->cache->buffers, buffer)) { ++ /* Published on a thread. + */ +- printf( "thread buffer %p, %.3g MB\n", +- buffer, buffer->bsize / (1024 * 1024.0) ); ++ printf("thread buffer %p, %.3g MB\n", ++ buffer, buffer->bsize / (1024 * 1024.0)); + *alive += buffer->bsize; + } + +- else if( buffer->ref_count == 0 && ++ else if (buffer->ref_count == 0 && + buffer->cache && + !buffer->done && +- vips_rect_isempty( &buffer->area ) && +- g_slist_find( buffer->cache->reserve, buffer ) ) ++ vips_rect_isempty(&buffer->area) && ++ g_slist_find(buffer->cache->reserve, buffer)) + /* Held in reserve. + */ + *reserve += buffer->bsize; + + else +- printf( "buffer craziness!\n" ); ++ printf("buffer craziness!\n"); + +- return( NULL ); ++ return (NULL); + } + #endif /*DEBUG*/ + + #ifdef DEBUG_CREATE + static void * +-vips_buffer_cache_dump( VipsBufferCache *cache, void *a, void *b ) ++vips_buffer_cache_dump(VipsBufferCache *cache, void *a, void *b) + { +- printf( "VipsBufferCache: %p\n", cache ); +- printf( "\t%d buffers\n", g_slist_length( cache->buffers ) ); +- printf( "\tthread %p\n", cache->thread ); +- printf( "\timage %p\n", cache->im ); +- printf( "\tbuffer_thread %p\n", cache->buffer_thread ); +- printf( "\t%d in reserve\n", g_slist_length( cache->reserve ) ); +- +- return( NULL ); ++ printf("VipsBufferCache: %p\n", cache); ++ printf("\t%d buffers\n", g_slist_length(cache->buffers)); ++ printf("\tthread %p\n", cache->thread); ++ printf("\timage %p\n", cache->im); ++ printf("\tbuffer_thread %p\n", cache->buffer_thread); ++ printf("\t%d in reserve\n", g_slist_length(cache->reserve)); ++ ++ return (NULL); + } + #endif /*DEBUG_CREATE*/ + + void +-vips_buffer_dump_all( void ) ++vips_buffer_dump_all(void) + { + #ifdef DEBUG +- if( vips__buffer_all ) { ++ if (vips__buffer_all) { + size_t reserve; + size_t alive; + +- printf( "buffers:\n" ); ++ printf("buffers:\n"); + + reserve = 0; + alive = 0; +- vips_slist_map2( vips__buffer_all, +- (VipsSListMap2Fn) vips_buffer_dump, &reserve, &alive ); +- printf( "%.3g MB alive\n", alive / (1024 * 1024.0) ); +- printf( "%.3g MB in reserve\n", reserve / (1024 * 1024.0) ); ++ vips_slist_map2(vips__buffer_all, ++ (VipsSListMap2Fn) vips_buffer_dump, &reserve, &alive); ++ printf("%.3g MB alive\n", alive / (1024 * 1024.0)); ++ printf("%.3g MB in reserve\n", reserve / (1024 * 1024.0)); + } + + #ifdef DEBUG_CREATE +- if( vips__buffer_cache_all ) { +- printf( "buffers: %d buffer cache still alive\n", +- g_slist_length( vips__buffer_cache_all ) ); +- vips_slist_map2( vips__buffer_cache_all, +- (VipsSListMap2Fn) vips_buffer_cache_dump, NULL, NULL ); +- printf( "g_thread_self() == %p\n", g_thread_self() ); ++ if (vips__buffer_cache_all) { ++ printf("buffers: %d buffer cache still alive\n", ++ g_slist_length(vips__buffer_cache_all)); ++ vips_slist_map2(vips__buffer_cache_all, ++ (VipsSListMap2Fn) vips_buffer_cache_dump, NULL, NULL); ++ printf("g_thread_self() == %p\n", g_thread_self()); + } + #endif /*DEBUG_CREATE*/ + #endif /*DEBUG*/ + } + + static void +-vips_buffer_free( VipsBuffer *buffer ) ++vips_buffer_free(VipsBuffer *buffer) + { +- VIPS_FREEF( vips_tracked_free, buffer->buf ); ++ VIPS_FREEF(vips_tracked_free, buffer->buf); + buffer->bsize = 0; +- g_free( buffer ); ++ g_free(buffer); + + #ifdef DEBUG +- g_mutex_lock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); + +- g_assert( g_slist_find( vips__buffer_all, buffer ) ); +- vips__buffer_all = g_slist_remove( vips__buffer_all, buffer ); ++ g_assert(g_slist_find(vips__buffer_all, buffer)); ++ vips__buffer_all = g_slist_remove(vips__buffer_all, buffer); + +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_unlock(vips__global_lock); + #endif /*DEBUG*/ + + #ifdef DEBUG_VERBOSE +- printf( "vips_buffer_free: freeing buffer %p\n", buffer ); ++ printf("vips_buffer_free: freeing buffer %p\n", buffer); + #endif /*DEBUG_VERBOSE*/ + } + + static void +-buffer_thread_free( VipsBufferThread *buffer_thread ) ++buffer_thread_free(VipsBufferThread *buffer_thread) + { +- VIPS_FREEF( g_hash_table_destroy, buffer_thread->hash ); +- VIPS_FREE( buffer_thread ); ++ VIPS_FREEF(g_hash_table_destroy, buffer_thread->hash); ++ VIPS_FREE(buffer_thread); + } + +-/* Run for GDestroyNotify on the VipsBufferThread hash. ++/* Run for GDestroyNotify on the VipsBufferThread hash. + */ + static void +-buffer_cache_free( VipsBufferCache *cache ) ++buffer_cache_free(VipsBufferCache *cache) + { + GSList *p; + + #ifdef DEBUG_CREATE +- g_mutex_lock( vips__global_lock ); +- vips__buffer_cache_all = +- g_slist_remove( vips__buffer_cache_all, cache ); +- g_mutex_unlock( vips__global_lock ); +- +- printf( "buffer_cache_free: freeing cache %p on thread %p\n", +- cache, g_thread_self() ); +- printf( "\t(%d caches left)\n", +- g_slist_length( vips__buffer_cache_all ) ); ++ g_mutex_lock(vips__global_lock); ++ vips__buffer_cache_all = ++ g_slist_remove(vips__buffer_cache_all, cache); ++ g_mutex_unlock(vips__global_lock); ++ ++ printf("buffer_cache_free: freeing cache %p on thread %p\n", ++ cache, g_thread_self()); ++ printf("\t(%d caches left)\n", ++ g_slist_length(vips__buffer_cache_all)); + #endif /*DEBUG_CREATE*/ + + /* Need to mark undone so we don't try and take them off this cache on + * unref. + */ +- for( p = cache->buffers; p; p = p->next ) { ++ for (p = cache->buffers; p; p = p->next) { + VipsBuffer *buffer = (VipsBuffer *) p->data; + +- g_assert( buffer->done ); +- g_assert( buffer->cache == cache ); ++ g_assert(buffer->done); ++ g_assert(buffer->cache == cache); + + buffer->done = FALSE; + buffer->cache = NULL; + } +- VIPS_FREEF( g_slist_free, cache->buffers ); ++ VIPS_FREEF(g_slist_free, cache->buffers); + +- for( p = cache->reserve; p; p = p->next ) { ++ for (p = cache->reserve; p; p = p->next) { + VipsBuffer *buffer = (VipsBuffer *) p->data; + +- vips_buffer_free( buffer ); ++ vips_buffer_free(buffer); + } +- VIPS_FREEF( g_slist_free, cache->reserve ); ++ VIPS_FREEF(g_slist_free, cache->reserve); + +- g_free( cache ); ++ g_free(cache); + } + + static VipsBufferCache * +-buffer_cache_new( VipsBufferThread *buffer_thread, VipsImage *im ) ++buffer_cache_new(VipsBufferThread *buffer_thread, VipsImage *im) + { + VipsBufferCache *cache; + +- cache = g_new( VipsBufferCache, 1 ); ++ cache = g_new(VipsBufferCache, 1); + cache->buffers = NULL; + cache->thread = g_thread_self(); + cache->im = im; +@@ -281,137 +281,137 @@ buffer_cache_new( VipsBufferThread *buffer_thread, VipsImage *im ) + cache->n_reserve = 0; + + #ifdef DEBUG_CREATE +- g_mutex_lock( vips__global_lock ); +- vips__buffer_cache_all = +- g_slist_prepend( vips__buffer_cache_all, cache ); +- g_mutex_unlock( vips__global_lock ); +- +- printf( "buffer_cache_new: new cache %p for thread %p on image %p\n", +- cache, g_thread_self(), im ); +- printf( "\t(%d caches now)\n", +- g_slist_length( vips__buffer_cache_all ) ); ++ g_mutex_lock(vips__global_lock); ++ vips__buffer_cache_all = ++ g_slist_prepend(vips__buffer_cache_all, cache); ++ g_mutex_unlock(vips__global_lock); ++ ++ printf("buffer_cache_new: new cache %p for thread %p on image %p\n", ++ cache, g_thread_self(), im); ++ printf("\t(%d caches now)\n", ++ g_slist_length(vips__buffer_cache_all)); + #endif /*DEBUG_CREATE*/ + +- return( cache ); ++ return (cache); + } + + static VipsBufferThread * +-buffer_thread_new( void ) ++buffer_thread_new(void) + { + VipsBufferThread *buffer_thread; + +- buffer_thread = g_new( VipsBufferThread, 1 ); +- buffer_thread->hash = g_hash_table_new_full( +- g_direct_hash, g_direct_equal, +- NULL, (GDestroyNotify) buffer_cache_free ); ++ buffer_thread = g_new(VipsBufferThread, 1); ++ buffer_thread->hash = g_hash_table_new_full( ++ g_direct_hash, g_direct_equal, ++ NULL, (GDestroyNotify) buffer_cache_free); + buffer_thread->thread = g_thread_self(); + +- return( buffer_thread ); ++ return (buffer_thread); + } + + /* Get our private VipsBufferThread. NULL for non-worker threads. + */ + static VipsBufferThread * +-buffer_thread_get( void ) ++buffer_thread_get(void) + { + VipsBufferThread *buffer_thread; + +- if( vips_thread_isvips() ) { ++ if (vips_thread_isvips()) { + /* Our threads get a set of private buffers, since we know we +- * will be calling vips_thread_shutdown() on thread +- * termination. ++ * will be calling vips_thread_shutdown() on thread ++ * termination. + */ +- if( !(buffer_thread = g_private_get( buffer_thread_key )) ) { ++ if (!(buffer_thread = g_private_get(buffer_thread_key))) { + buffer_thread = buffer_thread_new(); +- g_private_set( buffer_thread_key, buffer_thread ); ++ g_private_set(buffer_thread_key, buffer_thread); + } + +- g_assert( buffer_thread->thread == g_thread_self() ); ++ g_assert(buffer_thread->thread == g_thread_self()); + } +- else +- /* Non-vips threads don't have one. ++ else ++ /* Non-vips threads don't have one. + */ +- buffer_thread = NULL; ++ buffer_thread = NULL; + +- return( buffer_thread ); ++ return (buffer_thread); + } + + /* Get the VipsBufferCache for this image, or NULL for a non-worker. + */ + static VipsBufferCache * +-buffer_cache_get( VipsImage *im ) ++buffer_cache_get(VipsImage *im) + { + VipsBufferThread *buffer_thread; + VipsBufferCache *cache; + +- if( (buffer_thread = buffer_thread_get()) ) { +- if( !(cache = (VipsBufferCache *) +- g_hash_table_lookup( buffer_thread->hash, im )) ) { +- cache = buffer_cache_new( buffer_thread, im ); +- g_hash_table_insert( buffer_thread->hash, im, cache ); ++ if ((buffer_thread = buffer_thread_get())) { ++ if (!(cache = (VipsBufferCache *) ++ g_hash_table_lookup(buffer_thread->hash, im))) { ++ cache = buffer_cache_new(buffer_thread, im); ++ g_hash_table_insert(buffer_thread->hash, im, cache); + } + +- g_assert( cache->thread == g_thread_self() ); ++ g_assert(cache->thread == g_thread_self()); + } + else + cache = NULL; + +- return( cache ); ++ return (cache); + } + + /* Pixels have been calculated: publish for other parts of this thread to see. + */ +-void +-vips_buffer_done( VipsBuffer *buffer ) ++void ++vips_buffer_done(VipsBuffer *buffer) + { + VipsImage *im = buffer->im; + VipsBufferCache *cache; + +- if( !buffer->done && +- (cache = buffer_cache_get( im )) ) { +- g_assert( !g_slist_find( cache->buffers, buffer ) ); +- g_assert( !buffer->cache ); ++ if (!buffer->done && ++ (cache = buffer_cache_get(im))) { ++ g_assert(!g_slist_find(cache->buffers, buffer)); ++ g_assert(!buffer->cache); + + buffer->done = TRUE; + buffer->cache = cache; + +- cache->buffers = g_slist_prepend( cache->buffers, buffer ); ++ cache->buffers = g_slist_prepend(cache->buffers, buffer); + + #ifdef DEBUG_VERBOSE +- printf( "vips_buffer_done: " +- "thread %p adding buffer %p to cache %p\n", +- g_thread_self(), buffer, cache ); +- vips_buffer_print( buffer ); ++ printf("vips_buffer_done: " ++ "thread %p adding buffer %p to cache %p\n", ++ g_thread_self(), buffer, cache); ++ vips_buffer_print(buffer); + #endif /*DEBUG_VERBOSE*/ + } + } + +-/* Take off the public 'done' list. Make sure it has no calculated pixels in. ++/* Take off the public 'done' list. Make sure it has no calculated pixels in. + */ + void +-vips_buffer_undone( VipsBuffer *buffer ) ++vips_buffer_undone(VipsBuffer *buffer) + { +- if( buffer->done ) { ++ if (buffer->done) { + VipsBufferCache *cache = buffer->cache; + + #ifdef DEBUG_VERBOSE +- printf( "vips_buffer_undone: thread %p removing " +- "buffer %p from cache %p\n", +- g_thread_self(), buffer, cache ); ++ printf("vips_buffer_undone: thread %p removing " ++ "buffer %p from cache %p\n", ++ g_thread_self(), buffer, cache); + #endif /*DEBUG_VERBOSE*/ + +- g_assert( cache->thread == g_thread_self() ); +- g_assert( cache->buffer_thread->thread == cache->thread ); +- g_assert( g_slist_find( cache->buffers, buffer ) ); +- g_assert( buffer_thread_get() ); +- g_assert( cache->buffer_thread == buffer_thread_get() ); ++ g_assert(cache->thread == g_thread_self()); ++ g_assert(cache->buffer_thread->thread == cache->thread); ++ g_assert(g_slist_find(cache->buffers, buffer)); ++ g_assert(buffer_thread_get()); ++ g_assert(cache->buffer_thread == buffer_thread_get()); + +- cache->buffers = g_slist_remove( cache->buffers, buffer ); ++ cache->buffers = g_slist_remove(cache->buffers, buffer); + buffer->done = FALSE; + + #ifdef DEBUG_VERBOSE +- printf( "vips_buffer_undone: %d buffers left\n", +- g_slist_length( cache->buffers ) ); ++ printf("vips_buffer_undone: %d buffers left\n", ++ g_slist_length(cache->buffers)); + #endif /*DEBUG_VERBOSE*/ + } + +@@ -421,99 +421,99 @@ vips_buffer_undone( VipsBuffer *buffer ) + } + + void +-vips_buffer_unref( VipsBuffer *buffer ) ++vips_buffer_unref(VipsBuffer *buffer) + { + #ifdef DEBUG_VERBOSE +- printf( "** vips_buffer_unref: left = %d, top = %d, " +- "width = %d, height = %d (%p)\n", +- buffer->area.left, buffer->area.top, +- buffer->area.width, buffer->area.height, +- buffer ); ++ printf("** vips_buffer_unref: left = %d, top = %d, " ++ "width = %d, height = %d (%p)\n", ++ buffer->area.left, buffer->area.top, ++ buffer->area.width, buffer->area.height, ++ buffer); + #endif /*DEBUG_VERBOSE*/ + +- g_assert( buffer->ref_count > 0 ); ++ g_assert(buffer->ref_count > 0); + + buffer->ref_count -= 1; + +- if( buffer->ref_count == 0 ) { ++ if (buffer->ref_count == 0) { + VipsBufferCache *cache; + + #ifdef DEBUG_VERBOSE +- if( !buffer->done ) +- printf( "vips_buffer_unref: buffer was not done\n" ); ++ if (!buffer->done) ++ printf("vips_buffer_unref: buffer was not done\n"); + #endif /*DEBUG_VERBOSE*/ + +- vips_buffer_undone( buffer ); ++ vips_buffer_undone(buffer); + + /* Place on this thread's reserve list for reuse. + */ +- if( (cache = buffer_cache_get( buffer->im )) && +- cache->n_reserve < buffer_cache_max_reserve ) { +- g_assert( !buffer->cache ); ++ if ((cache = buffer_cache_get(buffer->im)) && ++ cache->n_reserve < buffer_cache_max_reserve) { ++ g_assert(!buffer->cache); + +- cache->reserve = +- g_slist_prepend( cache->reserve, buffer ); +- cache->n_reserve += 1; ++ cache->reserve = ++ g_slist_prepend(cache->reserve, buffer); ++ cache->n_reserve += 1; + + buffer->cache = cache; + buffer->area.width = 0; + buffer->area.height = 0; + } +- else +- vips_buffer_free( buffer ); ++ else ++ vips_buffer_free(buffer); + } + } + + static int +-buffer_move( VipsBuffer *buffer, VipsRect *area ) ++buffer_move(VipsBuffer *buffer, VipsRect *area) + { + VipsImage *im = buffer->im; + size_t new_bsize; + +- g_assert( buffer->ref_count == 1 ); ++ g_assert(buffer->ref_count == 1); + +- vips_buffer_undone( buffer ); +- g_assert( !buffer->done ); ++ vips_buffer_undone(buffer); ++ g_assert(!buffer->done); + + buffer->area = *area; + +- new_bsize = (size_t) VIPS_IMAGE_SIZEOF_PEL( im ) * ++ new_bsize = (size_t) VIPS_IMAGE_SIZEOF_PEL(im) * + area->width * area->height; +- if( buffer->bsize < new_bsize || +- !buffer->buf ) { ++ if (buffer->bsize < new_bsize || ++ !buffer->buf) { + buffer->bsize = new_bsize; +- VIPS_FREEF( vips_tracked_free, buffer->buf ); +- if( !(buffer->buf = vips_tracked_malloc( buffer->bsize )) ) +- return( -1 ); ++ VIPS_FREEF(vips_tracked_free, buffer->buf); ++ if (!(buffer->buf = vips_tracked_malloc(buffer->bsize))) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Make a new buffer. + */ + VipsBuffer * +-vips_buffer_new( VipsImage *im, VipsRect *area ) ++vips_buffer_new(VipsImage *im, VipsRect *area) + { + VipsBufferCache *cache; + VipsBuffer *buffer; + +- if( (cache = buffer_cache_get( im )) && +- cache->reserve ) { ++ if ((cache = buffer_cache_get(im)) && ++ cache->reserve) { + buffer = (VipsBuffer *) cache->reserve->data; +- cache->reserve = g_slist_remove( cache->reserve, buffer ); +- cache->n_reserve -= 1; ++ cache->reserve = g_slist_remove(cache->reserve, buffer); ++ cache->n_reserve -= 1; + +- g_assert( buffer->im == im ); +- g_assert( buffer->done == FALSE ); +- g_assert( buffer->cache ); ++ g_assert(buffer->im == im); ++ g_assert(buffer->done == FALSE); ++ g_assert(buffer->cache); + + buffer->ref_count = 1; + buffer->done = FALSE; + buffer->cache = NULL; + } + else { +- buffer = g_new0( VipsBuffer, 1 ); ++ buffer = g_new0(VipsBuffer, 1); + buffer->ref_count = 1; + buffer->im = im; + buffer->done = FALSE; +@@ -522,168 +522,168 @@ vips_buffer_new( VipsImage *im, VipsRect *area ) + buffer->bsize = 0; + + #ifdef DEBUG +- g_mutex_lock( vips__global_lock ); +- vips__buffer_all = +- g_slist_prepend( vips__buffer_all, buffer ); +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); ++ vips__buffer_all = ++ g_slist_prepend(vips__buffer_all, buffer); ++ g_mutex_unlock(vips__global_lock); + #endif /*DEBUG*/ + } + +- if( buffer_move( buffer, area ) ) { +- vips_buffer_free( buffer ); +- return( NULL ); ++ if (buffer_move(buffer, area)) { ++ vips_buffer_free(buffer); ++ return (NULL); + } + +- return( buffer ); ++ return (buffer); + } + + /* Find an existing buffer that encloses area and return a ref. Or NULL for no +- * existing buffer. ++ * existing buffer. + */ + static VipsBuffer * +-buffer_find( VipsImage *im, VipsRect *r ) ++buffer_find(VipsImage *im, VipsRect *r) + { + VipsBufferCache *cache; + VipsBuffer *buffer; + GSList *p; + VipsRect *area; + +- if( !(cache = buffer_cache_get( im )) ) +- return( NULL ); ++ if (!(cache = buffer_cache_get(im))) ++ return (NULL); + + /* This needs to be quick :-( don't use +- * vips_slist_map2()/vips_rect_includesrect(), do the search ++ * vips_slist_map2()/vips_rect_includesrect(), do the search + * inline. + * + * FIXME we return the first enclosing buffer, perhaps we should +- * search for the largest? ++ * search for the largest? + */ +- for( p = cache->buffers; p; p = p->next ) { ++ for (p = cache->buffers; p; p = p->next) { + buffer = (VipsBuffer *) p->data; + area = &buffer->area; + +- if( area->left <= r->left && ++ if (area->left <= r->left && + area->top <= r->top && + area->left + area->width >= r->left + r->width && +- area->top + area->height >= r->top + r->height ) { ++ area->top + area->height >= r->top + r->height) { + buffer->ref_count += 1; + + #ifdef DEBUG_VERBOSE +- printf( "buffer_find: left = %d, top = %d, " +- "width = %d, height = %d, count = %d (%p)\n", +- buffer->area.left, buffer->area.top, +- buffer->area.width, buffer->area.height, ++ printf("buffer_find: left = %d, top = %d, " ++ "width = %d, height = %d, count = %d (%p)\n", ++ buffer->area.left, buffer->area.top, ++ buffer->area.width, buffer->area.height, + buffer->ref_count, +- buffer ); ++ buffer); + #endif /*DEBUG_VERBOSE*/ + +- return( buffer ); ++ return (buffer); + } + } + +- return( NULL ); ++ return (NULL); + } + + /* Return a ref to a buffer that encloses area. The buffer we return might be +- * done. ++ * done. + */ + VipsBuffer * +-vips_buffer_ref( VipsImage *im, VipsRect *area ) ++vips_buffer_ref(VipsImage *im, VipsRect *area) + { + VipsBuffer *buffer; + +- if( (buffer = buffer_find( im, area )) ) +- return( buffer ); ++ if ((buffer = buffer_find(im, area))) ++ return (buffer); + else +- return( vips_buffer_new( im, area ) ); ++ return (vips_buffer_new(im, area)); + } + + /* Unref old, ref new, in a single operation. Reuse stuff if we can. The + * buffer we return might or might not be done. + */ + VipsBuffer * +-vips_buffer_unref_ref( VipsBuffer *old_buffer, VipsImage *im, VipsRect *area ) ++vips_buffer_unref_ref(VipsBuffer *old_buffer, VipsImage *im, VipsRect *area) + { + VipsBuffer *buffer; + +- g_assert( !old_buffer || +- old_buffer->im == im ); ++ g_assert(!old_buffer || ++ old_buffer->im == im); + + /* Is the current buffer OK? + */ +- if( old_buffer && +- vips_rect_includesrect( &old_buffer->area, area ) ) +- return( old_buffer ); ++ if (old_buffer && ++ vips_rect_includesrect(&old_buffer->area, area)) ++ return (old_buffer); + + /* Does the new area already have a buffer? + */ +- if( (buffer = buffer_find( im, area )) ) { +- VIPS_FREEF( vips_buffer_unref, old_buffer ); +- return( buffer ); ++ if ((buffer = buffer_find(im, area))) { ++ VIPS_FREEF(vips_buffer_unref, old_buffer); ++ return (buffer); + } + + /* Is the current buffer unshared? We can just move it. + */ +- if( old_buffer && +- old_buffer->ref_count == 1 ) { +- if( buffer_move( old_buffer, area ) ) { +- vips_buffer_unref( old_buffer ); +- return( NULL ); ++ if (old_buffer && ++ old_buffer->ref_count == 1) { ++ if (buffer_move(old_buffer, area)) { ++ vips_buffer_unref(old_buffer); ++ return (NULL); + } + +- return( old_buffer ); ++ return (old_buffer); + } + + /* Fallback ... unref the old one, make a new one. + */ +- VIPS_FREEF( vips_buffer_unref, old_buffer ); +- if( !(buffer = vips_buffer_new( im, area )) ) +- return( NULL ); ++ VIPS_FREEF(vips_buffer_unref, old_buffer); ++ if (!(buffer = vips_buffer_new(im, area))) ++ return (NULL); + +- return( buffer ); ++ return (buffer); + } + + static void +-buffer_thread_destroy_notify( VipsBufferThread *buffer_thread ) ++buffer_thread_destroy_notify(VipsBufferThread *buffer_thread) + { + /* We only come here if vips_thread_shutdown() was not called for this + * thread. Do our best to clean up. + * +- * GPrivate has stopped working by this point in destruction, be +- * careful not to touch that. ++ * GPrivate has stopped working by this point in destruction, be ++ * careful not to touch that. + */ +- buffer_thread_free( buffer_thread ); ++ buffer_thread_free(buffer_thread); + } + + /* Init the buffer cache system. This is called during vips_init. + */ + void +-vips__buffer_init( void ) ++vips__buffer_init(void) + { +- static GPrivate private = +- G_PRIVATE_INIT( (GDestroyNotify) buffer_thread_destroy_notify ); ++ static GPrivate private = ++ G_PRIVATE_INIT((GDestroyNotify) buffer_thread_destroy_notify); + + buffer_thread_key = &private; + +- if( buffer_cache_max_reserve < 1 ) +- printf( "vips__buffer_init: buffer reserve disabled\n" ); ++ if (buffer_cache_max_reserve < 1) ++ printf("vips__buffer_init: buffer reserve disabled\n"); + + #ifdef DEBUG +- printf( "vips__buffer_init: DEBUG enabled\n" ); ++ printf("vips__buffer_init: DEBUG enabled\n"); + #endif /*DEBUG*/ + + #ifdef DEBUG_CREATE +- printf( "vips__buffer_init: DEBUG_CREATE enabled\n" ); ++ printf("vips__buffer_init: DEBUG_CREATE enabled\n"); + #endif /*DEBUG_CREATE*/ + } + + void +-vips__buffer_shutdown( void ) ++vips__buffer_shutdown(void) + { + VipsBufferThread *buffer_thread; + +- if( (buffer_thread = g_private_get( buffer_thread_key )) ) { +- buffer_thread_free( buffer_thread ); +- g_private_set( buffer_thread_key, NULL ); ++ if ((buffer_thread = g_private_get(buffer_thread_key))) { ++ buffer_thread_free(buffer_thread); ++ g_private_set(buffer_thread_key, NULL); + } + } +diff --git a/libvips/iofuncs/cache.c b/libvips/iofuncs/cache.c +index f9fd79d9d3..a8186cdd83 100644 +--- a/libvips/iofuncs/cache.c ++++ b/libvips/iofuncs/cache.c +@@ -10,28 +10,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -73,10 +73,10 @@ + gboolean vips__cache_dump = FALSE; + gboolean vips__cache_trace = FALSE; + +-/* Max number of cached operations. ++/* Max number of cached operations. + * + * It was 10,000, but this was too high for batch-style applications with +- * little reuse. ++ * little reuse. + */ + static int vips_cache_max = 100; + +@@ -132,243 +132,245 @@ typedef struct _VipsOperationCacheEntry { + + } VipsOperationCacheEntry; + +-/* Pass in the pspec so we can get the generic type. For example, a ++/* Pass in the pspec so we can get the generic type. For example, a + * held in a GParamSpec allowing OBJECT, but the value could be of type + * VipsImage. generics are much faster to compare. + */ + static unsigned int +-vips_value_hash( GParamSpec *pspec, GValue *value ) ++vips_value_hash(GParamSpec *pspec, GValue *value) + { +- GType generic = G_PARAM_SPEC_TYPE( pspec ); ++ GType generic = G_PARAM_SPEC_TYPE(pspec); + + /* Not compile-time constants, so we have to use a set of if()s. Could + * make a table at run time I guess. + */ + +- if( generic == G_TYPE_PARAM_BOOLEAN ) +- return( (unsigned int) g_value_get_boolean( value ) ); +- else if( generic == G_TYPE_PARAM_CHAR ) +- return( (unsigned int) g_value_get_schar( value ) ); +- else if( generic == G_TYPE_PARAM_UCHAR ) +- return( (unsigned int) g_value_get_uchar( value ) ); +- else if( generic == G_TYPE_PARAM_INT ) +- return( (unsigned int) g_value_get_int( value ) ); +- else if( generic == G_TYPE_PARAM_UINT ) +- return( (unsigned int) g_value_get_uint( value ) ); +- else if( generic == G_TYPE_PARAM_LONG ) +- return( (unsigned int) g_value_get_long( value ) ); +- else if( generic == G_TYPE_PARAM_ULONG ) +- return( (unsigned int) g_value_get_ulong( value ) ); +- else if( generic == G_TYPE_PARAM_ENUM ) +- return( (unsigned int) g_value_get_enum( value ) ); +- else if( generic == G_TYPE_PARAM_FLAGS ) +- return( (unsigned int) g_value_get_flags( value ) ); +- else if( generic == G_TYPE_PARAM_UINT64 ) { +- guint64 i = g_value_get_uint64( value ); +- +- return( INT64_HASH( (gint64 *) &i ) ); ++ if (generic == G_TYPE_PARAM_BOOLEAN) ++ return ((unsigned int) g_value_get_boolean(value)); ++ else if (generic == G_TYPE_PARAM_CHAR) ++ return ((unsigned int) g_value_get_schar(value)); ++ else if (generic == G_TYPE_PARAM_UCHAR) ++ return ((unsigned int) g_value_get_uchar(value)); ++ else if (generic == G_TYPE_PARAM_INT) ++ return ((unsigned int) g_value_get_int(value)); ++ else if (generic == G_TYPE_PARAM_UINT) ++ return ((unsigned int) g_value_get_uint(value)); ++ else if (generic == G_TYPE_PARAM_LONG) ++ return ((unsigned int) g_value_get_long(value)); ++ else if (generic == G_TYPE_PARAM_ULONG) ++ return ((unsigned int) g_value_get_ulong(value)); ++ else if (generic == G_TYPE_PARAM_ENUM) ++ return ((unsigned int) g_value_get_enum(value)); ++ else if (generic == G_TYPE_PARAM_FLAGS) ++ return ((unsigned int) g_value_get_flags(value)); ++ else if (generic == G_TYPE_PARAM_UINT64) { ++ guint64 i = g_value_get_uint64(value); ++ ++ return (INT64_HASH((gint64 *) &i)); + } +- else if( generic == G_TYPE_PARAM_INT64 ) { +- gint64 i = g_value_get_int64( value ); ++ else if (generic == G_TYPE_PARAM_INT64) { ++ gint64 i = g_value_get_int64(value); + +- return( INT64_HASH( &i ) ); ++ return (INT64_HASH(&i)); + } +- else if( generic == G_TYPE_PARAM_FLOAT ) { +- float f = g_value_get_float( value ); ++ else if (generic == G_TYPE_PARAM_FLOAT) { ++ float f = g_value_get_float(value); + +- return( g_direct_hash( (void *) &f ) ); ++ return (g_direct_hash((void *) &f)); + } +- else if( generic == G_TYPE_PARAM_DOUBLE ) { +- double d = g_value_get_double( value ); ++ else if (generic == G_TYPE_PARAM_DOUBLE) { ++ double d = g_value_get_double(value); + +- return( DOUBLE_HASH( &d ) ); ++ return (DOUBLE_HASH(&d)); + } +- else if( generic == G_TYPE_PARAM_STRING ) { +- const char *s = g_value_get_string( value ); ++ else if (generic == G_TYPE_PARAM_STRING) { ++ const char *s = g_value_get_string(value); + +- return( s ? g_str_hash( s ) : 0 ); ++ return (s ? g_str_hash(s) : 0); + } +- else if( generic == G_TYPE_PARAM_BOXED ) { +- void *p = g_value_get_boxed( value ); ++ else if (generic == G_TYPE_PARAM_BOXED) { ++ void *p = g_value_get_boxed(value); + +- return( p ? g_direct_hash( p ) : 0 ); ++ return (p ? g_direct_hash(p) : 0); + } +- else if( generic == G_TYPE_PARAM_POINTER ) { +- void *p = g_value_get_pointer( value ); ++ else if (generic == G_TYPE_PARAM_POINTER) { ++ void *p = g_value_get_pointer(value); + +- return( p ? g_direct_hash( p ) : 0 ); ++ return (p ? g_direct_hash(p) : 0); + } +- else if( generic == G_TYPE_PARAM_OBJECT ) { +- void *p = g_value_get_object( value ); ++ else if (generic == G_TYPE_PARAM_OBJECT) { ++ void *p = g_value_get_object(value); + +- return( p ? g_direct_hash( p ) : 0 ); ++ return (p ? g_direct_hash(p) : 0); + } + else { +- /* Fallback: convert to a string and hash that. +- * This is very slow, print a warning if we use it ++ /* Fallback: convert to a string and hash that. ++ * This is very slow, print a warning if we use it + * so we can add another case. + */ + char *s; + unsigned int hash; + +- s = g_strdup_value_contents( value ); +- hash = g_str_hash( s ); ++ s = g_strdup_value_contents(value); ++ hash = g_str_hash(s); + +- printf( "vips_value_hash: no case for %s\n", s ); +- printf( "\ttype %d, %s\n", +- (int) G_VALUE_TYPE( value ), +- g_type_name( G_VALUE_TYPE( value ) ) ); +- printf( "\tgeneric %d, %s\n", +- (int) G_VALUE_TYPE( generic ), +- g_type_name( generic ) ); ++ printf("vips_value_hash: no case for %s\n", s); ++ printf("\ttype %d, %s\n", ++ (int) G_VALUE_TYPE(value), ++ g_type_name(G_VALUE_TYPE(value))); ++ printf("\tgeneric %d, %s\n", ++ (int) G_VALUE_TYPE(generic), ++ g_type_name(generic)); + +- g_free( s ); ++ g_free(s); + +- return( hash ); ++ return (hash); + } + } + +-/* Pass in the pspec so we can get the generic type. For example, a +- * value could be held in a GParamSpec allowing OBJECT, but the value ++/* Pass in the pspec so we can get the generic type. For example, a ++ * value could be held in a GParamSpec allowing OBJECT, but the value + * could be of type VipsImage. generics are much faster to compare. + */ +-static gboolean +-vips_value_equal( GParamSpec *pspec, GValue *v1, GValue *v2 ) ++static gboolean ++vips_value_equal(GParamSpec *pspec, GValue *v1, GValue *v2) + { +- GType generic = G_PARAM_SPEC_TYPE( pspec ); +- GType t1 = G_VALUE_TYPE( v1 ); +- GType t2 = G_VALUE_TYPE( v2 ); ++ GType generic = G_PARAM_SPEC_TYPE(pspec); ++ GType t1 = G_VALUE_TYPE(v1); ++ GType t2 = G_VALUE_TYPE(v2); + +- if( t1 != t2 ) +- return( FALSE ); ++ if (t1 != t2) ++ return (FALSE); + + /* Not compile-time constants, so we have to use a set of if()s. Could + * make a table at run time I guess. + */ + +- if( generic == G_TYPE_PARAM_BOOLEAN ) +- return( g_value_get_boolean( v1 ) == +- g_value_get_boolean( v2 ) ); +- else if( generic == G_TYPE_PARAM_CHAR ) +- return( g_value_get_schar( v1 ) == +- g_value_get_schar( v2 ) ); +- if( generic == G_TYPE_PARAM_UCHAR ) +- return( g_value_get_uchar( v1 ) == +- g_value_get_uchar( v2 ) ); +- if( generic == G_TYPE_PARAM_INT ) +- return( g_value_get_int( v1 ) == +- g_value_get_int( v2 ) ); +- if( generic == G_TYPE_PARAM_UINT ) +- return( g_value_get_uint( v1 ) == +- g_value_get_uint( v2 ) ); +- if( generic == G_TYPE_PARAM_LONG ) +- return( g_value_get_long( v1 ) == +- g_value_get_long( v2 ) ); +- if( generic == G_TYPE_PARAM_ULONG ) +- return( g_value_get_ulong( v1 ) == +- g_value_get_ulong( v2 ) ); +- if( generic == G_TYPE_PARAM_ENUM ) +- return( g_value_get_enum( v1 ) == +- g_value_get_enum( v2 ) ); +- if( generic == G_TYPE_PARAM_FLAGS ) +- return( g_value_get_flags( v1 ) == +- g_value_get_flags( v2 ) ); +- if( generic == G_TYPE_PARAM_UINT64 ) +- return( g_value_get_uint64( v1 ) == +- g_value_get_uint64( v2 ) ); +- if( generic == G_TYPE_PARAM_INT64 ) +- return( g_value_get_int64( v1 ) == +- g_value_get_int64( v2 ) ); +- if( generic == G_TYPE_PARAM_FLOAT ) +- return( g_value_get_float( v1 ) == +- g_value_get_float( v2 ) ); +- if( generic == G_TYPE_PARAM_DOUBLE ) +- return( g_value_get_double( v1 ) == +- g_value_get_double( v2 ) ); +- if( generic == G_TYPE_PARAM_STRING ) { +- const char *s1 = g_value_get_string( v1 ); +- const char *s2 = g_value_get_string( v2 ); +- +- if( s1 == s2 ) +- return( TRUE ); ++ if (generic == G_TYPE_PARAM_BOOLEAN) ++ return (g_value_get_boolean(v1) == ++ g_value_get_boolean(v2)); ++ else if (generic == G_TYPE_PARAM_CHAR) ++ return (g_value_get_schar(v1) == ++ g_value_get_schar(v2)); ++ if (generic == G_TYPE_PARAM_UCHAR) ++ return (g_value_get_uchar(v1) == ++ g_value_get_uchar(v2)); ++ if (generic == G_TYPE_PARAM_INT) ++ return (g_value_get_int(v1) == ++ g_value_get_int(v2)); ++ if (generic == G_TYPE_PARAM_UINT) ++ return (g_value_get_uint(v1) == ++ g_value_get_uint(v2)); ++ if (generic == G_TYPE_PARAM_LONG) ++ return (g_value_get_long(v1) == ++ g_value_get_long(v2)); ++ if (generic == G_TYPE_PARAM_ULONG) ++ return (g_value_get_ulong(v1) == ++ g_value_get_ulong(v2)); ++ if (generic == G_TYPE_PARAM_ENUM) ++ return (g_value_get_enum(v1) == ++ g_value_get_enum(v2)); ++ if (generic == G_TYPE_PARAM_FLAGS) ++ return (g_value_get_flags(v1) == ++ g_value_get_flags(v2)); ++ if (generic == G_TYPE_PARAM_UINT64) ++ return (g_value_get_uint64(v1) == ++ g_value_get_uint64(v2)); ++ if (generic == G_TYPE_PARAM_INT64) ++ return (g_value_get_int64(v1) == ++ g_value_get_int64(v2)); ++ if (generic == G_TYPE_PARAM_FLOAT) ++ return (g_value_get_float(v1) == ++ g_value_get_float(v2)); ++ if (generic == G_TYPE_PARAM_DOUBLE) ++ return (g_value_get_double(v1) == ++ g_value_get_double(v2)); ++ if (generic == G_TYPE_PARAM_STRING) { ++ const char *s1 = g_value_get_string(v1); ++ const char *s2 = g_value_get_string(v2); ++ ++ if (s1 == s2) ++ return (TRUE); + else +- return( s1 && s2 && strcmp( s1, s2 ) == 0 ); ++ return (s1 && s2 && strcmp(s1, s2) == 0); + } +- if( generic == G_TYPE_PARAM_BOXED ) +- return( g_value_get_boxed( v1 ) == +- g_value_get_boxed( v2 ) ); +- if( generic == G_TYPE_PARAM_POINTER ) +- return( g_value_get_pointer( v1 ) == +- g_value_get_pointer( v2 ) ); +- if( generic == G_TYPE_PARAM_OBJECT ) +- return( g_value_get_object( v1 ) == +- g_value_get_object( v2 ) ); ++ if (generic == G_TYPE_PARAM_BOXED) ++ return (g_value_get_boxed(v1) == ++ g_value_get_boxed(v2)); ++ if (generic == G_TYPE_PARAM_POINTER) ++ return (g_value_get_pointer(v1) == ++ g_value_get_pointer(v2)); ++ if (generic == G_TYPE_PARAM_OBJECT) ++ return (g_value_get_object(v1) == ++ g_value_get_object(v2)); + else { +- /* Fallback: convert to a string and compare that. +- * This is very slow, print a warning if we use it ++ /* Fallback: convert to a string and compare that. ++ * This is very slow, print a warning if we use it + * so we can add another case. + */ + char *s1; + char *s2; + gboolean equal; + +- s1 = g_strdup_value_contents( v1 ); +- s2 = g_strdup_value_contents( v2 ); +- equal = strcmp( s1, s2 ) == 0; ++ s1 = g_strdup_value_contents(v1); ++ s2 = g_strdup_value_contents(v2); ++ equal = strcmp(s1, s2) == 0; + +- printf( "vips_value_equal: no case for %s, %s\n", +- s1, s2 ); +- printf( "\tt1 %d, %s\n", (int) t1, g_type_name( t1 ) ); +- printf( "\tt2 %d, %s\n", (int) t2, g_type_name( t2 ) ); +- printf( "\tgeneric %d, %s\n", +- (int) G_VALUE_TYPE( generic ), +- g_type_name( generic ) ); ++ printf("vips_value_equal: no case for %s, %s\n", ++ s1, s2); ++ printf("\tt1 %d, %s\n", (int) t1, g_type_name(t1)); ++ printf("\tt2 %d, %s\n", (int) t2, g_type_name(t2)); ++ printf("\tgeneric %d, %s\n", ++ (int) G_VALUE_TYPE(generic), ++ g_type_name(generic)); + +- g_free( s1 ); +- g_free( s2 ); ++ g_free(s1); ++ g_free(s2); + +- return( equal ); ++ return (equal); + } + } + + static void * +-vips_object_hash_arg( VipsObject *object, ++vips_object_hash_arg(VipsObject *object, + GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { + unsigned int *hash = (unsigned int *) a; + +- if( (argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) && ++ if ((argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) && + (argument_class->flags & VIPS_ARGUMENT_INPUT) && +- argument_instance->assigned ) { +- const char *name = g_param_spec_get_name( pspec ); +- GType type = G_PARAM_SPEC_VALUE_TYPE( pspec ); +- GValue value = { 0, }; +- +- g_value_init( &value, type ); +- g_object_get_property( G_OBJECT( object ), name, &value ); +- *hash = (*hash << 1) ^ vips_value_hash( pspec, &value ); +- g_value_unset( &value ); ++ argument_instance->assigned) { ++ const char *name = g_param_spec_get_name(pspec); ++ GType type = G_PARAM_SPEC_VALUE_TYPE(pspec); ++ GValue value = { ++ 0, ++ }; ++ ++ g_value_init(&value, type); ++ g_object_get_property(G_OBJECT(object), name, &value); ++ *hash = (*hash << 1) ^ vips_value_hash(pspec, &value); ++ g_value_unset(&value); + } + +- return( NULL ); ++ return (NULL); + } + + /* Find a hash from the input arguments to a VipsOperstion. + */ + static unsigned int +-vips_operation_hash( VipsOperation *operation ) ++vips_operation_hash(VipsOperation *operation) + { +- if( !operation->found_hash ) { ++ if (!operation->found_hash) { + guint hash; + + /* Include the operation type in the hash. + */ +- hash = (guint) G_OBJECT_TYPE( operation ); +- (void) vips_argument_map( VIPS_OBJECT( operation ), +- vips_object_hash_arg, &hash, NULL ); ++ hash = (guint) G_OBJECT_TYPE(operation); ++ (void) vips_argument_map(VIPS_OBJECT(operation), ++ vips_object_hash_arg, &hash, NULL); + + /* Make sure we can't have a zero hash value. + */ +@@ -378,114 +380,118 @@ vips_operation_hash( VipsOperation *operation ) + operation->found_hash = TRUE; + } + +- return( operation->hash ); ++ return (operation->hash); + } + + static void * +-vips_object_equal_arg( VipsObject *object, ++vips_object_equal_arg(VipsObject *object, + GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { + VipsObject *other = (VipsObject *) a; + +- const char *name = g_param_spec_get_name( pspec ); +- GType type = G_PARAM_SPEC_VALUE_TYPE( pspec ); +- GValue v1 = { 0, }; +- GValue v2 = { 0, }; ++ const char *name = g_param_spec_get_name(pspec); ++ GType type = G_PARAM_SPEC_VALUE_TYPE(pspec); ++ GValue v1 = { ++ 0, ++ }; ++ GValue v2 = { ++ 0, ++ }; + + gboolean equal; + + /* Only test assigned input constructor args. + */ +- if( !(argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) || ++ if (!(argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) || + !(argument_class->flags & VIPS_ARGUMENT_INPUT) || +- !argument_instance->assigned ) +- return( NULL ); ++ !argument_instance->assigned) ++ return (NULL); + + /* If this is an optional arg, we need to check that this was + * assigned on @other as well. + */ +- if( !(argument_class->flags & VIPS_ARGUMENT_REQUIRED) && +- !vips_object_argument_isset( other, name ) ) ++ if (!(argument_class->flags & VIPS_ARGUMENT_REQUIRED) && ++ !vips_object_argument_isset(other, name)) + /* Optional and was not set on other ... we've found a + * difference! + */ +- return( object ); ++ return (object); + +- g_value_init( &v1, type ); +- g_value_init( &v2, type ); +- g_object_get_property( G_OBJECT( object ), name, &v1 ); +- g_object_get_property( G_OBJECT( other ), name, &v2 ); +- equal = vips_value_equal( pspec, &v1, &v2 ); +- g_value_unset( &v1 ); +- g_value_unset( &v2 ); ++ g_value_init(&v1, type); ++ g_value_init(&v2, type); ++ g_object_get_property(G_OBJECT(object), name, &v1); ++ g_object_get_property(G_OBJECT(other), name, &v2); ++ equal = vips_value_equal(pspec, &v1, &v2); ++ g_value_unset(&v1); ++ g_value_unset(&v2); + + /* Stop (return non-NULL) if we've found a difference. + */ +- return( !equal ? object : NULL ); ++ return (!equal ? object : NULL); + } + + /* Are two objects equal, ie. have the same inputs. + */ +-static gboolean +-vips_operation_equal( VipsOperation *a, VipsOperation *b ) ++static gboolean ++vips_operation_equal(VipsOperation *a, VipsOperation *b) + { +- if( a == b ) +- return( TRUE ); ++ if (a == b) ++ return (TRUE); + +- if( G_OBJECT_TYPE( a ) == G_OBJECT_TYPE( b ) && +- vips_operation_hash( a ) == vips_operation_hash( b ) && +- !vips_argument_map( VIPS_OBJECT( a ), +- vips_object_equal_arg, b, NULL ) ) +- return( TRUE ); ++ if (G_OBJECT_TYPE(a) == G_OBJECT_TYPE(b) && ++ vips_operation_hash(a) == vips_operation_hash(b) && ++ !vips_argument_map(VIPS_OBJECT(a), ++ vips_object_equal_arg, b, NULL)) ++ return (TRUE); + +- return( FALSE ); ++ return (FALSE); + } + + void * +-vips__cache_once_init( void *data ) ++vips__cache_once_init(void *data) + { + vips_cache_lock = vips_g_mutex_new(); + +- vips_cache_table = g_hash_table_new( +- (GHashFunc) vips_operation_hash, +- (GEqualFunc) vips_operation_equal ); ++ vips_cache_table = g_hash_table_new( ++ (GHashFunc) vips_operation_hash, ++ (GEqualFunc) vips_operation_equal); + +- return( NULL ); ++ return (NULL); + } + + void +-vips__cache_init( void ) ++vips__cache_init(void) + { + static GOnce once = G_ONCE_INIT; + +- VIPS_ONCE( &once, vips__cache_once_init, NULL ); ++ VIPS_ONCE(&once, vips__cache_once_init, NULL); + } + + static void * +-vips_cache_print_fn( void *value, void *a, void *b ) ++vips_cache_print_fn(void *value, void *a, void *b) + { + VipsOperationCacheEntry *entry = value; + + char str[32768]; +- VipsBuf buf = VIPS_BUF_STATIC( str ); ++ VipsBuf buf = VIPS_BUF_STATIC(str); + +- vips_object_to_string( VIPS_OBJECT( entry->operation ), &buf ); ++ vips_object_to_string(VIPS_OBJECT(entry->operation), &buf); + +- printf( "%p - %s\n", value, vips_buf_all( &buf ) ); ++ printf("%p - %s\n", value, vips_buf_all(&buf)); + +- return( NULL ); ++ return (NULL); + } + + static void +-vips_cache_print_nolock( void ) ++vips_cache_print_nolock(void) + { +- if( vips_cache_table ) { +- printf( "Operation cache:\n" ); +- vips_hash_table_map( vips_cache_table, +- vips_cache_print_fn, NULL, NULL ); ++ if (vips_cache_table) { ++ printf("Operation cache:\n"); ++ vips_hash_table_map(vips_cache_table, ++ vips_cache_print_fn, NULL, NULL); + } + } + +@@ -495,156 +501,156 @@ vips_cache_print_nolock( void ) + * Print the whole operation cache to stdout. Handy for debugging. + */ + void +-vips_cache_print( void ) ++vips_cache_print(void) + { +- g_mutex_lock( vips_cache_lock ); ++ g_mutex_lock(vips_cache_lock); + + vips_cache_print_nolock(); + +- g_mutex_unlock( vips_cache_lock ); ++ g_mutex_unlock(vips_cache_lock); + } + + static void * +-vips_object_unref_arg( VipsObject *object, ++vips_object_unref_arg(VipsObject *object, + GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { +- if( (argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) && ++ if ((argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) && + (argument_class->flags & VIPS_ARGUMENT_OUTPUT) && + argument_instance->assigned && +- G_IS_PARAM_SPEC_OBJECT( pspec ) ) { ++ G_IS_PARAM_SPEC_OBJECT(pspec)) { + GObject *value; + + /* This will up the ref count for us. + */ +- g_object_get( G_OBJECT( object ), +- g_param_spec_get_name( pspec ), &value, NULL ); ++ g_object_get(G_OBJECT(object), ++ g_param_spec_get_name(pspec), &value, NULL); + + /* Drop the ref we just got, then drop the ref we make when we + * added to the cache. + */ +- g_object_unref( value ); +- g_object_unref( value ); ++ g_object_unref(value); ++ g_object_unref(value); + } + +- return( NULL ); ++ return (NULL); + } + + static void +-vips_cache_unref( VipsOperation *operation ) ++vips_cache_unref(VipsOperation *operation) + { + #ifdef DEBUG +- printf( "vips_cache_unref: " ); +- vips_object_print_summary( VIPS_OBJECT( operation ) ); ++ printf("vips_cache_unref: "); ++ vips_object_print_summary(VIPS_OBJECT(operation)); + #endif /*DEBUG*/ + +- (void) vips_argument_map( VIPS_OBJECT( operation ), +- vips_object_unref_arg, NULL, NULL ); +- g_object_unref( operation ); ++ (void) vips_argument_map(VIPS_OBJECT(operation), ++ vips_object_unref_arg, NULL, NULL); ++ g_object_unref(operation); + } + + /* Remove an operation from the cache. + */ + static void +-vips_cache_remove( VipsOperation *operation ) ++vips_cache_remove(VipsOperation *operation) + { + VipsOperationCacheEntry *entry = (VipsOperationCacheEntry *) +- g_hash_table_lookup( vips_cache_table, operation ); ++ g_hash_table_lookup(vips_cache_table, operation); + + #ifdef DEBUG +- printf( "vips_cache_remove: " ); +- vips_object_print_summary( VIPS_OBJECT( operation ) ); ++ printf("vips_cache_remove: "); ++ vips_object_print_summary(VIPS_OBJECT(operation)); + #endif /*DEBUG*/ + +- g_assert( entry ); ++ g_assert(entry); + +- if( entry->invalidate_id ) { +- g_signal_handler_disconnect( operation, entry->invalidate_id ); ++ if (entry->invalidate_id) { ++ g_signal_handler_disconnect(operation, entry->invalidate_id); + entry->invalidate_id = 0; + } + +- g_hash_table_remove( vips_cache_table, operation ); +- vips_cache_unref( operation ); ++ g_hash_table_remove(vips_cache_table, operation); ++ vips_cache_unref(operation); + +- g_free( entry ); ++ g_free(entry); + } + + static void * +-vips_object_ref_arg( VipsObject *object, ++vips_object_ref_arg(VipsObject *object, + GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { +- if( (argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) && ++ if ((argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) && + (argument_class->flags & VIPS_ARGUMENT_OUTPUT) && + argument_instance->assigned && +- G_IS_PARAM_SPEC_OBJECT( pspec ) ) { ++ G_IS_PARAM_SPEC_OBJECT(pspec)) { + GObject *value; + + /* This will up the ref count for us. + */ +- g_object_get( G_OBJECT( object ), +- g_param_spec_get_name( pspec ), &value, NULL ); ++ g_object_get(G_OBJECT(object), ++ g_param_spec_get_name(pspec), &value, NULL); + } + +- return( NULL ); ++ return (NULL); + } + + static void +-vips_operation_touch( VipsOperation *operation ) ++vips_operation_touch(VipsOperation *operation) + { + VipsOperationCacheEntry *entry = (VipsOperationCacheEntry *) +- g_hash_table_lookup( vips_cache_table, operation ); ++ g_hash_table_lookup(vips_cache_table, operation); + + vips_cache_time += 1; + + /* Don't up the time for invalid items -- we want them to fall out of + * cache. + */ +- if( !entry->invalid ) ++ if (!entry->invalid) + entry->time = vips_cache_time; + } + +-/* Ref an operation for the cache. The operation itself, plus all the output +- * objects it makes. ++/* Ref an operation for the cache. The operation itself, plus all the output ++ * objects it makes. + */ + static void +-vips_cache_ref( VipsOperation *operation ) ++vips_cache_ref(VipsOperation *operation) + { + #ifdef DEBUG +- printf( "vips_cache_ref: " ); +- vips_object_print_summary( VIPS_OBJECT( operation ) ); ++ printf("vips_cache_ref: "); ++ vips_object_print_summary(VIPS_OBJECT(operation)); + #endif /*DEBUG*/ + +- g_object_ref( operation ); +- (void) vips_argument_map( VIPS_OBJECT( operation ), +- vips_object_ref_arg, NULL, NULL ); +- vips_operation_touch( operation ); ++ g_object_ref(operation); ++ (void) vips_argument_map(VIPS_OBJECT(operation), ++ vips_object_ref_arg, NULL, NULL); ++ vips_operation_touch(operation); + } + + static void +-vips_cache_invalidate_cb( VipsOperation *operation, +- VipsOperationCacheEntry *entry ) ++vips_cache_invalidate_cb(VipsOperation *operation, ++ VipsOperationCacheEntry *entry) + { + #ifdef DEBUG +- printf( "vips_cache_invalidate_cb: " ); +- vips_object_print_summary( VIPS_OBJECT( operation ) ); ++ printf("vips_cache_invalidate_cb: "); ++ vips_object_print_summary(VIPS_OBJECT(operation)); + #endif /*DEBUG*/ + + entry->invalid = TRUE; + } + + static void +-vips_cache_insert( VipsOperation *operation ) ++vips_cache_insert(VipsOperation *operation) + { +- VipsOperationCacheEntry *entry = g_new( VipsOperationCacheEntry, 1 ); ++ VipsOperationCacheEntry *entry = g_new(VipsOperationCacheEntry, 1); + + #ifdef VIPS_DEBUG +- printf( "vips_cache_insert: adding to cache" ); +- vips_object_print_dump( VIPS_OBJECT( operation ) ); ++ printf("vips_cache_insert: adding to cache"); ++ vips_object_print_dump(VIPS_OBJECT(operation)); + #endif /*VIPS_DEBUG*/ + + entry->operation = operation; +@@ -652,35 +658,35 @@ vips_cache_insert( VipsOperation *operation ) + entry->invalidate_id = 0; + entry->invalid = FALSE; + +- g_hash_table_insert( vips_cache_table, operation, entry ); +- vips_cache_ref( operation ); ++ g_hash_table_insert(vips_cache_table, operation, entry); ++ vips_cache_ref(operation); + + /* If the operation signals "invalidate", we must tag this cache entry + * for removal. + */ +- entry->invalidate_id = g_signal_connect( operation, "invalidate", +- G_CALLBACK( vips_cache_invalidate_cb ), entry ); ++ entry->invalidate_id = g_signal_connect(operation, "invalidate", ++ G_CALLBACK(vips_cache_invalidate_cb), entry); + } + + static void * +-vips_cache_get_first_fn( void *value, void *a, void *b ) ++vips_cache_get_first_fn(void *value, void *a, void *b) + { +- return( value ); ++ return (value); + } + + /* Return the first item. + */ + static VipsOperation * +-vips_cache_get_first( void ) ++vips_cache_get_first(void) + { + VipsOperationCacheEntry *entry; + +- if( vips_cache_table && +- (entry = vips_hash_table_map( vips_cache_table, +- vips_cache_get_first_fn, NULL, NULL )) ) +- return( VIPS_OPERATION( entry->operation ) ); ++ if (vips_cache_table && ++ (entry = vips_hash_table_map(vips_cache_table, ++ vips_cache_get_first_fn, NULL, NULL))) ++ return (VIPS_OPERATION(entry->operation)); + +- return( NULL ); ++ return (NULL); + } + + /** +@@ -690,185 +696,185 @@ vips_cache_get_first( void ) + * automatically on vips_shutdown(). + */ + void +-vips_cache_drop_all( void ) ++vips_cache_drop_all(void) + { + #ifdef VIPS_DEBUG +- printf( "vips_cache_drop_all:\n" ); ++ printf("vips_cache_drop_all:\n"); + #endif /*VIPS_DEBUG*/ + +- g_mutex_lock( vips_cache_lock ); ++ g_mutex_lock(vips_cache_lock); + +- if( vips_cache_table ) { ++ if (vips_cache_table) { + VipsOperation *operation; + +- if( vips__cache_dump ) ++ if (vips__cache_dump) + vips_cache_print_nolock(); + + /* We can't modify the hash in the callback from + * g_hash_table_foreach() and friends. Repeatedly drop the + * first item instead. + */ +- while( (operation = vips_cache_get_first()) ) +- vips_cache_remove( operation ); ++ while ((operation = vips_cache_get_first())) ++ vips_cache_remove(operation); + +- VIPS_FREEF( g_hash_table_unref, vips_cache_table ); ++ VIPS_FREEF(g_hash_table_unref, vips_cache_table); + } + +- g_mutex_unlock( vips_cache_lock ); ++ g_mutex_unlock(vips_cache_lock); + } + + static void +-vips_cache_get_lru_cb( VipsOperation *key, VipsOperationCacheEntry *value, +- VipsOperationCacheEntry **best ) ++vips_cache_get_lru_cb(VipsOperation *key, VipsOperationCacheEntry *value, ++ VipsOperationCacheEntry **best) + { +- if( !*best || +- (*best)->time > value->time ) ++ if (!*best || ++ (*best)->time > value->time) + *best = value; + } + +-/* Get the least-recently-used cache item. ++/* Get the least-recently-used cache item. + * + * TODO ... will this be too expensive? probably not + */ + static VipsOperation * +-vips_cache_get_lru( void ) ++vips_cache_get_lru(void) + { + VipsOperationCacheEntry *entry; + + entry = NULL; +- g_hash_table_foreach( vips_cache_table, +- (GHFunc) vips_cache_get_lru_cb, &entry ); ++ g_hash_table_foreach(vips_cache_table, ++ (GHFunc) vips_cache_get_lru_cb, &entry); + +- if( entry ) +- return( entry->operation ); ++ if (entry) ++ return (entry->operation); + +- return( NULL ); ++ return (NULL); + } + + /* Is the cache full? Drop until it's not. + */ + static void +-vips_cache_trim( void ) ++vips_cache_trim(void) + { + VipsOperation *operation; + +- g_mutex_lock( vips_cache_lock ); ++ g_mutex_lock(vips_cache_lock); + +- while( vips_cache_table && +- (g_hash_table_size( vips_cache_table ) > vips_cache_max || +- vips_tracked_get_files() > vips_cache_max_files || +- vips_tracked_get_mem() > vips_cache_max_mem) && +- (operation = vips_cache_get_lru()) ) { ++ while (vips_cache_table && ++ (g_hash_table_size(vips_cache_table) > vips_cache_max || ++ vips_tracked_get_files() > vips_cache_max_files || ++ vips_tracked_get_mem() > vips_cache_max_mem) && ++ (operation = vips_cache_get_lru())) { + #ifdef DEBUG +- printf( "vips_cache_trim: trimming " ); +- vips_object_print_summary( VIPS_OBJECT( operation ) ); ++ printf("vips_cache_trim: trimming "); ++ vips_object_print_summary(VIPS_OBJECT(operation)); + #endif /*DEBUG*/ + +- vips_cache_remove( operation ); ++ vips_cache_remove(operation); + } + +- g_mutex_unlock( vips_cache_lock ); ++ g_mutex_unlock(vips_cache_lock); + } + + /** + * vips_cache_operation_lookup: + * @operation: (transfer none): pointer to operation to lookup + * +- * Look up an unbuilt @operation in the cache. If we get a hit, ref and ++ * Look up an unbuilt @operation in the cache. If we get a hit, ref and + * return the old operation. If there's no hit, return NULL. + * + * Returns: (transfer full): the cache hit, if any. + */ + VipsOperation * +-vips_cache_operation_lookup( VipsOperation *operation ) ++vips_cache_operation_lookup(VipsOperation *operation) + { + VipsOperationCacheEntry *hit; + VipsOperation *result; + +- g_assert( VIPS_IS_OPERATION( operation ) ); +- g_assert( !VIPS_OBJECT( operation )->constructed ); ++ g_assert(VIPS_IS_OPERATION(operation)); ++ g_assert(!VIPS_OBJECT(operation)->constructed); + + #ifdef VIPS_DEBUG +- printf( "vips_cache_operation_lookup: " ); +- vips_object_print_dump( VIPS_OBJECT( operation ) ); ++ printf("vips_cache_operation_lookup: "); ++ vips_object_print_dump(VIPS_OBJECT(operation)); + #endif /*VIPS_DEBUG*/ + +- g_mutex_lock( vips_cache_lock ); ++ g_mutex_lock(vips_cache_lock); + + result = NULL; + +- if( (hit = g_hash_table_lookup( vips_cache_table, operation )) ) { +- if( hit->invalid || +- (VIPS_OPERATION_GET_CLASS( hit->operation )->flags & +- VIPS_OPERATION_BLOCKED) ) { ++ if ((hit = g_hash_table_lookup(vips_cache_table, operation))) { ++ if (hit->invalid || ++ (VIPS_OPERATION_GET_CLASS(hit->operation)->flags & ++ VIPS_OPERATION_BLOCKED)) { + /* Has been tagged for removal, or has been blocked. + */ +- vips_cache_remove( hit->operation ); ++ vips_cache_remove(hit->operation); + hit = NULL; + } + else { +- if( vips__cache_trace ) { +- printf( "vips cache*: " ); +- vips_object_print_summary( +- VIPS_OBJECT( operation ) ); ++ if (vips__cache_trace) { ++ printf("vips cache*: "); ++ vips_object_print_summary( ++ VIPS_OBJECT(operation)); + } + + result = hit->operation; +- vips_cache_ref( result ); ++ vips_cache_ref(result); + } + } + +- g_mutex_unlock( vips_cache_lock ); ++ g_mutex_unlock(vips_cache_lock); + + #ifdef VIPS_DEBUG +- printf( "vips_cache_operation_lookup: result = %p\n", result ); ++ printf("vips_cache_operation_lookup: result = %p\n", result); + #endif /*VIPS_DEBUG*/ + +- return( result ); ++ return (result); + } + + /** + * vips_cache_operation_add: + * @operation: (transfer none): pointer to operation to add + * +- * Add a built operation to the cache. The cache will ref the operation. ++ * Add a built operation to the cache. The cache will ref the operation. + */ + void +-vips_cache_operation_add( VipsOperation *operation ) ++vips_cache_operation_add(VipsOperation *operation) + { +- g_assert( VIPS_OBJECT( operation )->constructed ); ++ g_assert(VIPS_OBJECT(operation)->constructed); + +- g_mutex_lock( vips_cache_lock ); ++ g_mutex_lock(vips_cache_lock); + + #ifdef VIPS_DEBUG +- printf( "vips_cache_operation_add: adding " ); +- vips_object_print_dump( VIPS_OBJECT( operation ) ); ++ printf("vips_cache_operation_add: adding "); ++ vips_object_print_dump(VIPS_OBJECT(operation)); + #endif /*VIPS_DEBUG*/ + +- /* If two threads call the same operation at the same time, ++ /* If two threads call the same operation at the same time, + * we can get multiple adds. Let the first one win. See + * https://github.com/libvips/libvips/pull/181 + */ +- if( !g_hash_table_lookup( vips_cache_table, operation ) ) { +- VipsOperationFlags flags = +- vips_operation_get_flags( operation ); ++ if (!g_hash_table_lookup(vips_cache_table, operation)) { ++ VipsOperationFlags flags = ++ vips_operation_get_flags(operation); + gboolean nocache = flags & VIPS_OPERATION_NOCACHE; + + /* Has to be after _build() so we can see output args. + */ +- if( vips__cache_trace ) { +- if( nocache ) +- printf( "vips cache : " ); ++ if (vips__cache_trace) { ++ if (nocache) ++ printf("vips cache : "); + else +- printf( "vips cache+: " ); +- vips_object_print_summary( VIPS_OBJECT( operation ) ); ++ printf("vips cache+: "); ++ vips_object_print_summary(VIPS_OBJECT(operation)); + } + +- if( !nocache ) +- vips_cache_insert( operation ); ++ if (!nocache) ++ vips_cache_insert(operation); + } + +- g_mutex_unlock( vips_cache_lock ); ++ g_mutex_unlock(vips_cache_lock); + + vips_cache_trim(); + } +@@ -878,44 +884,44 @@ vips_cache_operation_add( VipsOperation *operation ) + * @operation: pointer to operation to lookup + * + * Look up @operation in the cache. If we get a hit, unref @operation, ref the +- * old one and return that through the argument pointer. ++ * old one and return that through the argument pointer. + * + * If we miss, build and add @operation. + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_cache_operation_buildp( VipsOperation **operation ) ++vips_cache_operation_buildp(VipsOperation **operation) + { + VipsOperation *hit; + +- g_assert( VIPS_IS_OPERATION( *operation ) ); ++ g_assert(VIPS_IS_OPERATION(*operation)); + + #ifdef VIPS_DEBUG +- printf( "vips_cache_operation_buildp: " ); +- vips_object_print_dump( VIPS_OBJECT( *operation ) ); ++ printf("vips_cache_operation_buildp: "); ++ vips_object_print_dump(VIPS_OBJECT(*operation)); + #endif /*VIPS_DEBUG*/ + +- if( (hit = vips_cache_operation_lookup( *operation )) ) { ++ if ((hit = vips_cache_operation_lookup(*operation))) { + #ifdef VIPS_DEBUG +- printf( "vips_cache_operation_buildp: cache hit %p\n", hit ); ++ printf("vips_cache_operation_buildp: cache hit %p\n", hit); + #endif /*VIPS_DEBUG*/ + +- g_object_unref( *operation ); ++ g_object_unref(*operation); + *operation = hit; + } + else { + #ifdef VIPS_DEBUG +- printf( "vips_cache_operation_buildp: cache miss, building\n" ); ++ printf("vips_cache_operation_buildp: cache miss, building\n"); + #endif /*VIPS_DEBUG*/ + +- if( vips_object_build( VIPS_OBJECT( *operation ) ) ) +- return( -1 ); ++ if (vips_object_build(VIPS_OBJECT(*operation))) ++ return (-1); + +- vips_cache_operation_add( *operation ); ++ vips_cache_operation_add(*operation); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -931,31 +937,31 @@ vips_cache_operation_buildp( VipsOperation **operation ) + * Returns: (transfer full): The built operation. + */ + VipsOperation * +-vips_cache_operation_build( VipsOperation *operation ) ++vips_cache_operation_build(VipsOperation *operation) + { + VipsOperation *orig_operation = operation; + + /* Stop it being unreffed for us on hit. + */ +- g_object_ref( orig_operation ); ++ g_object_ref(orig_operation); + +- if( vips_cache_operation_buildp( &operation ) ) { +- g_object_unref( orig_operation ); ++ if (vips_cache_operation_buildp(&operation)) { ++ g_object_unref(orig_operation); + +- return( NULL ); ++ return (NULL); + } + +- return( operation ); ++ return (operation); + } + + /** + * vips_cache_set_max: + * @max: maximum number of operation to cache + * +- * Set the maximum number of operations we keep in cache. ++ * Set the maximum number of operations we keep in cache. + */ + void +-vips_cache_set_max( int max ) ++vips_cache_set_max(int max) + { + vips_cache_max = max; + vips_cache_trim(); +@@ -963,19 +969,19 @@ vips_cache_set_max( int max ) + + /** + * vips_cache_set_max_mem: +- * @max_mem: maximum amount of tracked memory we use ++ * @max_mem: maximum amount of tracked memory we use + * + * Set the maximum amount of tracked memory we allow before we start dropping + * cached operations. See vips_tracked_get_mem(). + * + * libvips only tracks memory it allocates, it can't track memory allocated by + * external libraries. If you use an operation like vips_magickload(), most of +- * the memory it uses won't be included. ++ * the memory it uses won't be included. + * +- * See also: vips_tracked_get_mem(). ++ * See also: vips_tracked_get_mem(). + */ + void +-vips_cache_set_max_mem( size_t max_mem ) ++vips_cache_set_max_mem(size_t max_mem) + { + vips_cache_max_mem = max_mem; + vips_cache_trim(); +@@ -984,37 +990,37 @@ vips_cache_set_max_mem( size_t max_mem ) + /** + * vips_cache_get_max: + * +- * Get the maximum number of operations we keep in cache. ++ * Get the maximum number of operations we keep in cache. + * + * Returns: the maximum number of operations we keep in cache + */ + int +-vips_cache_get_max( void ) ++vips_cache_get_max(void) + { +- return( vips_cache_max ); ++ return (vips_cache_max); + } + + /** + * vips_cache_get_size: + * +- * Get the current number of operations in cache. ++ * Get the current number of operations in cache. + * + * Returns: get the current number of operations in cache. + */ + int +-vips_cache_get_size( void ) ++vips_cache_get_size(void) + { + guint size; + +- g_mutex_lock( vips_cache_lock ); ++ g_mutex_lock(vips_cache_lock); + + size = 0; +- if( vips_cache_table ) +- size = g_hash_table_size( vips_cache_table ); ++ if (vips_cache_table) ++ size = g_hash_table_size(vips_cache_table); + +- g_mutex_unlock( vips_cache_lock ); ++ g_mutex_unlock(vips_cache_lock); + +- return( size ); ++ return (size); + } + + /** +@@ -1023,14 +1029,14 @@ vips_cache_get_size( void ) + * Get the maximum amount of tracked memory we allow before we start dropping + * cached operations. See vips_tracked_get_mem(). + * +- * See also: vips_tracked_get_mem(). ++ * See also: vips_tracked_get_mem(). + * + * Returns: the maximum amount of tracked memory we allow + */ + size_t +-vips_cache_get_max_mem( void ) ++vips_cache_get_max_mem(void) + { +- return( vips_cache_max_mem ); ++ return (vips_cache_max_mem); + } + + /** +@@ -1039,18 +1045,18 @@ vips_cache_get_max_mem( void ) + * Get the maximum number of tracked files we allow before we start dropping + * cached operations. See vips_tracked_get_files(). + * +- * libvips only tracks file descriptors it allocates, it can't track ones +- * allocated by external libraries. If you use an operation like +- * vips_magickload(), most of the descriptors it uses won't be included. ++ * libvips only tracks file descriptors it allocates, it can't track ones ++ * allocated by external libraries. If you use an operation like ++ * vips_magickload(), most of the descriptors it uses won't be included. + * +- * See also: vips_tracked_get_files(). ++ * See also: vips_tracked_get_files(). + * + * Returns: the maximum number of tracked files we allow + */ + int +-vips_cache_get_max_files( void ) ++vips_cache_get_max_files(void) + { +- return( vips_cache_max_files ); ++ return (vips_cache_max_files); + } + + /** +@@ -1060,10 +1066,10 @@ vips_cache_get_max_files( void ) + * Set the maximum number of tracked files we allow before we start dropping + * cached operations. See vips_tracked_get_files(). + * +- * See also: vips_tracked_get_files(). ++ * See also: vips_tracked_get_files(). + */ + void +-vips_cache_set_max_files( int max_files ) ++vips_cache_set_max_files(int max_files) + { + vips_cache_max_files = max_files; + vips_cache_trim(); +@@ -1075,27 +1081,27 @@ vips_cache_set_max_files( int max_files ) + * + * Handy for debugging. Print the operation cache to stdout just before exit. + * +- * See also: vips_cache_set_trace(). ++ * See also: vips_cache_set_trace(). + */ + void +-vips_cache_set_dump( gboolean dump ) ++vips_cache_set_dump(gboolean dump) + { + vips__cache_dump = dump; + } + + /** + * vips_cache_set_trace: +- * @trace: if %TRUE, trace the operation cache ++ * @trace: if %TRUE, trace the operation cache + * + * Handy for debugging. Print operation cache actions to stdout as we run. + * + * You can set the environment variable `VIPS_TRACE` to turn this option on, or + * use the command-line flag `--vips-cache-trace`. + * +- * See also: vips_cache_set_dump(). ++ * See also: vips_cache_set_dump(). + */ + void +-vips_cache_set_trace( gboolean trace ) ++vips_cache_set_trace(gboolean trace) + { + vips__cache_trace = trace; + } +diff --git a/libvips/iofuncs/connection.c b/libvips/iofuncs/connection.c +index 03bc4e6be3..df1297c2d9 100644 +--- a/libvips/iofuncs/connection.c ++++ b/libvips/iofuncs/connection.c +@@ -1,33 +1,33 @@ +-/* A byte source/sink .. it can be a pipe, file descriptor, memory area, ++/* A byte source/sink .. it can be a pipe, file descriptor, memory area, + * socket, node.js stream, etc. +- * ++ * + * J.Cupitt, 19/6/14 + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -59,116 +59,113 @@ + * SECTION: connection + * @short_description: a source/sink of bytes, perhaps a network socket + * @stability: Stable +- * @see_also: foreign ++ * @see_also: foreign + * @include: vips/vips.h + * @title: VipsConnection + * +- * A #VipsConnection is a source or sink of bytes for something like jpeg +- * loading, see for example vips_jpegload_source(). ++ * A #VipsConnection is a source or sink of bytes for something like jpeg ++ * loading, see for example vips_jpegload_source(). + * +- * It can be connected to a network socket, for example, or perhaps +- * a node.js stream, or to an area of memory. ++ * It can be connected to a network socket, for example, or perhaps ++ * a node.js stream, or to an area of memory. + * + * Subclass to add other input sources. Use #VipsSourceCustom and +- * #VipsTargetCustom to make a source or target with action signals for ++ * #VipsTargetCustom to make a source or target with action signals for + * ::read, ::write and ::seek. + */ + + /** + * VipsConnection: + * +- * A #VipsConnection is a source or sink of bytes for something like jpeg +- * loading. It can be connected to a network socket, for example. ++ * A #VipsConnection is a source or sink of bytes for something like jpeg ++ * loading. It can be connected to a network socket, for example. + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsConnection, vips_connection, VIPS_TYPE_OBJECT ); ++G_DEFINE_ABSTRACT_TYPE(VipsConnection, vips_connection, VIPS_TYPE_OBJECT); + + static void +-vips_connection_finalize( GObject *gobject ) ++vips_connection_finalize(GObject *gobject) + { + VipsConnection *connection = (VipsConnection *) gobject; + + #ifdef VIPS_DEBUG +- VIPS_DEBUG_MSG( "vips_connection_finalize: " ); +- vips_object_print_name( VIPS_OBJECT( gobject ) ); +- VIPS_DEBUG_MSG( "\n" ); ++ VIPS_DEBUG_MSG("vips_connection_finalize: "); ++ vips_object_print_name(VIPS_OBJECT(gobject)); ++ VIPS_DEBUG_MSG("\n"); + #endif /*VIPS_DEBUG*/ + +- if( connection->tracked_descriptor >= 0 ) { +- VIPS_DEBUG_MSG( " tracked_close()\n" ); +- vips_tracked_close( connection->tracked_descriptor ); ++ if (connection->tracked_descriptor >= 0) { ++ VIPS_DEBUG_MSG(" tracked_close()\n"); ++ vips_tracked_close(connection->tracked_descriptor); + connection->tracked_descriptor = -1; + connection->descriptor = -1; + } + +- if( connection->close_descriptor >= 0 ) { +- VIPS_DEBUG_MSG( " close()\n" ); +- close( connection->close_descriptor ); ++ if (connection->close_descriptor >= 0) { ++ VIPS_DEBUG_MSG(" close()\n"); ++ close(connection->close_descriptor); + connection->close_descriptor = -1; + connection->descriptor = -1; + } + +- VIPS_FREE( connection->filename ); ++ VIPS_FREE(connection->filename); + +- G_OBJECT_CLASS( vips_connection_parent_class )->finalize( gobject ); ++ G_OBJECT_CLASS(vips_connection_parent_class)->finalize(gobject); + } + + static void +-vips_connection_class_init( VipsConnectionClass *class ) ++vips_connection_class_init(VipsConnectionClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + + gobject_class->finalize = vips_connection_finalize; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + +- VIPS_ARG_INT( class, "descriptor", 1, +- _( "Descriptor" ), +- _( "File descriptor for read or write" ), ++ VIPS_ARG_INT(class, "descriptor", 1, ++ _("Descriptor"), ++ _("File descriptor for read or write"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsConnection, descriptor ), +- -1, 1000000000, 0 ); ++ G_STRUCT_OFFSET(VipsConnection, descriptor), ++ -1, 1000000000, 0); + +- VIPS_ARG_STRING( class, "filename", 2, +- _( "Filename" ), +- _( "Name of file to open" ), ++ VIPS_ARG_STRING(class, "filename", 2, ++ _("Filename"), ++ _("Name of file to open"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsConnection, filename ), +- NULL ); +- ++ G_STRUCT_OFFSET(VipsConnection, filename), ++ NULL); + } + + static void +-vips_connection_init( VipsConnection *connection ) ++vips_connection_init(VipsConnection *connection) + { + connection->descriptor = -1; + connection->tracked_descriptor = -1; + connection->close_descriptor = -1; + } + +-/** +- * vips_connection_filename: ++/** ++ * vips_connection_filename: + * @connection: connection to operate on + * + * Returns: any filename associated with this connection, or NULL. + */ + const char * +-vips_connection_filename( VipsConnection *connection ) ++vips_connection_filename(VipsConnection *connection) + { +- return( connection->filename ); ++ return (connection->filename); + } + +-/** +- * vips_connection_nick: ++/** ++ * vips_connection_nick: + * @connection: connection to operate on + * + * Returns: a string describing this connection which could be displayed to a + * user. + */ + const char * +-vips_connection_nick( VipsConnection *connection ) ++vips_connection_nick(VipsConnection *connection) + { +- return( connection->filename ? +- connection->filename : +- VIPS_OBJECT( connection )->nickname ); ++ return (connection->filename ? connection->filename : VIPS_OBJECT(connection)->nickname); + } +diff --git a/libvips/iofuncs/dbuf.c b/libvips/iofuncs/dbuf.c +index 0ee0bc6934..b15783ef5d 100644 +--- a/libvips/iofuncs/dbuf.c ++++ b/libvips/iofuncs/dbuf.c +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2003 The National Gallery ++ Copyright (C) 1991-2003 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -48,7 +48,7 @@ + * Initialize @dbuf. + */ + void +-vips_dbuf_init( VipsDbuf *dbuf ) ++vips_dbuf_init(VipsDbuf *dbuf) + { + dbuf->data = NULL; + dbuf->allocated_size = 0; +@@ -59,31 +59,31 @@ vips_dbuf_init( VipsDbuf *dbuf ) + /** + * vips_dbuf_minimum_size: + * @dbuf: the buffer +- * @size: the minimum size ++ * @size: the minimum size + * + * Make sure @dbuf is at least @size bytes. +- * ++ * + * Returns: %FALSE on out of memory, %TRUE otherwise. + */ + gboolean +-vips_dbuf_minimum_size( VipsDbuf *dbuf, size_t size ) ++vips_dbuf_minimum_size(VipsDbuf *dbuf, size_t size) + { +- if( size > dbuf->allocated_size ) { ++ if (size > dbuf->allocated_size) { + const size_t new_allocated_size = 3 * (16 + size) / 2; + + unsigned char *new_data; + +- if( !(new_data = +- g_try_realloc( dbuf->data, new_allocated_size )) ) { +- vips_error( "VipsDbuf", "%s", _( "out of memory" ) ); +- return( FALSE ); ++ if (!(new_data = ++ g_try_realloc(dbuf->data, new_allocated_size))) { ++ vips_error("VipsDbuf", "%s", _("out of memory")); ++ return (FALSE); + } + + dbuf->data = new_data; + dbuf->allocated_size = new_allocated_size; + } + +- return( TRUE ); ++ return (TRUE); + } + + /** +@@ -92,13 +92,13 @@ vips_dbuf_minimum_size( VipsDbuf *dbuf, size_t size ) + * @size: the size to allocate + * + * Make sure @dbuf has at least @size bytes available after the write point. +- * ++ * + * Returns: %FALSE on out of memory, %TRUE otherwise. + */ + gboolean +-vips_dbuf_allocate( VipsDbuf *dbuf, size_t size ) ++vips_dbuf_allocate(VipsDbuf *dbuf, size_t size) + { +- return( vips_dbuf_minimum_size( dbuf, dbuf->write_point + size ) ); ++ return (vips_dbuf_minimum_size(dbuf, dbuf->write_point + size)); + } + + /** +@@ -113,15 +113,15 @@ vips_dbuf_allocate( VipsDbuf *dbuf, size_t size ) + * Returns: the number of bytes transferred. + */ + size_t +-vips_dbuf_read( VipsDbuf *dbuf, unsigned char *data, size_t size ) ++vips_dbuf_read(VipsDbuf *dbuf, unsigned char *data, size_t size) + { + const size_t available = dbuf->data_size - dbuf->write_point; +- const size_t copied = VIPS_MIN( size, available ); ++ const size_t copied = VIPS_MIN(size, available); + +- memcpy( data, dbuf->data + dbuf->write_point, copied ); ++ memcpy(data, dbuf->data + dbuf->write_point, copied); + dbuf->write_point += copied; + +- return( copied ); ++ return (copied); + } + + /** +@@ -131,27 +131,27 @@ vips_dbuf_read( VipsDbuf *dbuf, unsigned char *data, size_t size ) + * + * Return a pointer to an area you can write to, return length of area in + * @size. Use vips_dbuf_allocate() before this call to set a minimum amount of +- * space to have available. ++ * space to have available. + * + * The write point moves to just beyond the returned block. Use + * vips_dbuf_seek() to move it back again. +- * ++ * + * Returns: (transfer none): start of write area. + */ + unsigned char * +-vips_dbuf_get_write( VipsDbuf *dbuf, size_t *size ) ++vips_dbuf_get_write(VipsDbuf *dbuf, size_t *size) + { + unsigned char *write = dbuf->data + dbuf->write_point; + const size_t available = dbuf->allocated_size - dbuf->write_point; + +- memset( write, 0, available ); ++ memset(write, 0, available); + dbuf->write_point = dbuf->allocated_size; + dbuf->data_size = dbuf->allocated_size; + +- if( size ) ++ if (size) + *size = available; + +- return( write ); ++ return (write); + } + + /** +@@ -160,21 +160,21 @@ vips_dbuf_get_write( VipsDbuf *dbuf, size_t *size ) + * @data: the data to write to the buffer + * @size: the size of the len to write + * +- * Append @size bytes from @data. @dbuf expands if necessary. +- * ++ * Append @size bytes from @data. @dbuf expands if necessary. ++ * + * Returns: %FALSE on out of memory, %TRUE otherwise. + */ + gboolean +-vips_dbuf_write( VipsDbuf *dbuf, const unsigned char *data, size_t size ) ++vips_dbuf_write(VipsDbuf *dbuf, const unsigned char *data, size_t size) + { +- if( !vips_dbuf_allocate( dbuf, size ) ) +- return( FALSE ); ++ if (!vips_dbuf_allocate(dbuf, size)) ++ return (FALSE); + +- memcpy( dbuf->data + dbuf->write_point, data, size ); ++ memcpy(dbuf->data + dbuf->write_point, data, size); + dbuf->write_point += size; +- dbuf->data_size = VIPS_MAX( dbuf->data_size, dbuf->write_point ); ++ dbuf->data_size = VIPS_MAX(dbuf->data_size, dbuf->write_point); + +- return( TRUE ); ++ return (TRUE); + } + + /** +@@ -183,31 +183,31 @@ vips_dbuf_write( VipsDbuf *dbuf, const unsigned char *data, size_t size ) + * @fmt: printf()-style format string + * @...: arguments to format string + * +- * Format the string and write to @dbuf. +- * ++ * Format the string and write to @dbuf. ++ * + * Returns: %FALSE on out of memory, %TRUE otherwise. + */ + gboolean +-vips_dbuf_writef( VipsDbuf *dbuf, const char *fmt, ... ) ++vips_dbuf_writef(VipsDbuf *dbuf, const char *fmt, ...) + { + va_list ap; + char *line; + +- va_start( ap, fmt ); +- line = g_strdup_vprintf( fmt, ap ); +- va_end( ap ); ++ va_start(ap, fmt); ++ line = g_strdup_vprintf(fmt, ap); ++ va_end(ap); + +- if( vips_dbuf_write( dbuf, (unsigned char *) line, strlen( line ) ) ) { +- g_free( line ); +- return( FALSE ); ++ if (vips_dbuf_write(dbuf, (unsigned char *) line, strlen(line))) { ++ g_free(line); ++ return (FALSE); + } +- g_free( line ); ++ g_free(line); + +- return( TRUE ); ++ return (TRUE); + } + + /** +- * vips_dbuf_write_amp: ++ * vips_dbuf_write_amp: + * @dbuf: the buffer + * @str: string to write + * +@@ -216,51 +216,51 @@ vips_dbuf_writef( VipsDbuf *dbuf, const char *fmt, ... ) + * + * XML rules: + * +- * - We must escape &<> ++ * - We must escape &<> + * - Don't escape \n, \t, \r +- * - Do escape the other ASCII codes. ++ * - Do escape the other ASCII codes. + * + * Returns: %FALSE on out of memory, %TRUE otherwise. + */ + gboolean +-vips_dbuf_write_amp( VipsDbuf *dbuf, const char *str ) ++vips_dbuf_write_amp(VipsDbuf *dbuf, const char *str) + { + const char *p; + +- for( p = str; *p; p++ ) +- if( *p < 32 && ++ for (p = str; *p; p++) ++ if (*p < 32 && + *p != '\n' && + *p != '\t' && +- *p != '\r' ) { ++ *p != '\r') { + /* You'd think we could output "%x;", but xml + * 1.0 parsers barf on that. xml 1.1 allows this, but +- * there are almost no parsers. ++ * there are almost no parsers. + * +- * U+2400 onwards are unicode glyphs for the ASCII ++ * U+2400 onwards are unicode glyphs for the ASCII + * control characters, so we can use them -- thanks + * electroly. + */ +- if( !vips_dbuf_writef( dbuf, "&#x%04x;", 0x2400 + *p ) ) +- return( FALSE ); ++ if (!vips_dbuf_writef(dbuf, "&#x%04x;", 0x2400 + *p)) ++ return (FALSE); + } +- else if( *p == '<' ) { +- if( !vips_dbuf_write( dbuf, (guchar *) "<", 4 ) ) +- return( FALSE ); ++ else if (*p == '<') { ++ if (!vips_dbuf_write(dbuf, (guchar *) "<", 4)) ++ return (FALSE); + } +- else if( *p == '>' ) { +- if( !vips_dbuf_write( dbuf, (guchar *) ">", 4 ) ) +- return( FALSE ); ++ else if (*p == '>') { ++ if (!vips_dbuf_write(dbuf, (guchar *) ">", 4)) ++ return (FALSE); + } +- else if( *p == '&' ) { +- if( !vips_dbuf_write( dbuf, (guchar *) "&", 5 ) ) +- return( FALSE ); ++ else if (*p == '&') { ++ if (!vips_dbuf_write(dbuf, (guchar *) "&", 5)) ++ return (FALSE); + } +- else { +- if( !vips_dbuf_write( dbuf, (guchar *) p, 1 ) ) +- return( FALSE ); ++ else { ++ if (!vips_dbuf_write(dbuf, (guchar *) p, 1)) ++ return (FALSE); + } + +- return( TRUE ); ++ return (TRUE); + } + + /** +@@ -271,7 +271,7 @@ vips_dbuf_write_amp( VipsDbuf *dbuf, const char *str ) + * write point are reset. + */ + void +-vips_dbuf_reset( VipsDbuf *dbuf ) ++vips_dbuf_reset(VipsDbuf *dbuf) + { + dbuf->write_point = 0; + dbuf->data_size = 0; +@@ -284,11 +284,11 @@ vips_dbuf_reset( VipsDbuf *dbuf ) + * Destroy @dbuf. This frees any allocated memory. + */ + void +-vips_dbuf_destroy( VipsDbuf *dbuf ) ++vips_dbuf_destroy(VipsDbuf *dbuf) + { +- vips_dbuf_reset( dbuf ); ++ vips_dbuf_reset(dbuf); + +- VIPS_FREE( dbuf->data ); ++ VIPS_FREE(dbuf->data); + dbuf->allocated_size = 0; + } + +@@ -298,60 +298,60 @@ vips_dbuf_destroy( VipsDbuf *dbuf ) + * @offset: how to move the write point + * @whence: from start, from end, from current + * +- * Move the write point. @whence can be %SEEK_SET, %SEEK_CUR, %SEEK_END, with +- * the usual meaning. ++ * Move the write point. @whence can be %SEEK_SET, %SEEK_CUR, %SEEK_END, with ++ * the usual meaning. + */ + gboolean +-vips_dbuf_seek( VipsDbuf *dbuf, off_t offset, int whence ) ++vips_dbuf_seek(VipsDbuf *dbuf, off_t offset, int whence) + { + off_t new_write_point; + +- switch( whence ) { ++ switch (whence) { + case SEEK_SET: +- new_write_point = offset; ++ new_write_point = offset; + break; + + case SEEK_END: +- new_write_point = dbuf->data_size + offset; ++ new_write_point = dbuf->data_size + offset; + break; + + case SEEK_CUR: +- new_write_point = dbuf->write_point + offset; ++ new_write_point = dbuf->write_point + offset; + break; + + default: +- g_assert( 0 ); +- new_write_point = dbuf->write_point; ++ g_assert(0); ++ new_write_point = dbuf->write_point; + break; + } + +- if( new_write_point < 0 ) { +- vips_error( "VipsDbuf", "%s", "negative seek" ); +- return( FALSE ); ++ if (new_write_point < 0) { ++ vips_error("VipsDbuf", "%s", "negative seek"); ++ return (FALSE); + } + + /* Possibly need to grow the buffer + */ +- if( !vips_dbuf_minimum_size( dbuf, new_write_point ) ) +- return( FALSE ); +- dbuf->write_point = new_write_point; +- if( dbuf->data_size < dbuf->write_point ) { +- memset( dbuf->data + dbuf->data_size, 0, +- dbuf->write_point - dbuf->data_size ); ++ if (!vips_dbuf_minimum_size(dbuf, new_write_point)) ++ return (FALSE); ++ dbuf->write_point = new_write_point; ++ if (dbuf->data_size < dbuf->write_point) { ++ memset(dbuf->data + dbuf->data_size, 0, ++ dbuf->write_point - dbuf->data_size); + dbuf->data_size = dbuf->write_point; + } + +- return( TRUE ); ++ return (TRUE); + } + + /** + * vips_dbuf_truncate: + * @dbuf: the buffer + * +- * Truncate the data so that it ends at the write point. No memory is freed. ++ * Truncate the data so that it ends at the write point. No memory is freed. + */ + void +-vips_dbuf_truncate( VipsDbuf *dbuf ) ++vips_dbuf_truncate(VipsDbuf *dbuf) + { + dbuf->data_size = dbuf->write_point; + } +@@ -363,9 +363,9 @@ vips_dbuf_truncate( VipsDbuf *dbuf ) + * Returns: the current write point + */ + off_t +-vips_dbuf_tell( VipsDbuf *dbuf ) ++vips_dbuf_tell(VipsDbuf *dbuf) + { +- return( dbuf->write_point ); ++ return (dbuf->write_point); + } + + /** +@@ -375,19 +375,19 @@ vips_dbuf_tell( VipsDbuf *dbuf ) + * Make sure the byte after the last data byte is `\0`. This extra byte is not + * included in the data size and the write point is not moved. + * +- * This makes it safe to treat the dbuf contents as a C string. +- * ++ * This makes it safe to treat the dbuf contents as a C string. ++ * + * Returns: %FALSE on out of memory, %TRUE otherwise. + */ + static gboolean +-vips_dbuf_null_terminate( VipsDbuf *dbuf ) ++vips_dbuf_null_terminate(VipsDbuf *dbuf) + { +- if( !vips_dbuf_minimum_size( dbuf, dbuf->data_size + 1 ) ) +- return( FALSE ); ++ if (!vips_dbuf_minimum_size(dbuf, dbuf->data_size + 1)) ++ return (FALSE); + + dbuf->data[dbuf->data_size] = 0; + +- return( TRUE ); ++ return (TRUE); + } + + /** +@@ -399,26 +399,26 @@ vips_dbuf_null_terminate( VipsDbuf *dbuf ) + * This must be freed with g_free(). + * + * A `\0` is appended, but not included in the character count. This is so the +- * pointer can be safely treated as a C string. ++ * pointer can be safely treated as a C string. + * + * Returns: (transfer full): The pointer held by @dbuf. + */ + unsigned char * +-vips_dbuf_steal( VipsDbuf *dbuf, size_t *size ) ++vips_dbuf_steal(VipsDbuf *dbuf, size_t *size) + { + unsigned char *data; + +- vips_dbuf_null_terminate( dbuf ); ++ vips_dbuf_null_terminate(dbuf); + + data = dbuf->data; + +- if( size ) ++ if (size) + *size = dbuf->data_size; + + dbuf->data = NULL; +- vips_dbuf_destroy( dbuf ); ++ vips_dbuf_destroy(dbuf); + +- return( data ); ++ return (data); + } + + /** +@@ -429,19 +429,17 @@ vips_dbuf_steal( VipsDbuf *dbuf, size_t *size ) + * Return a pointer to @dbuf's internal data. + * + * A `\0` is appended, but not included in the character count. This is so the +- * pointer can be safely treated as a C string. ++ * pointer can be safely treated as a C string. + * + * Returns: (transfer none): The pointer held by @dbuf. + */ + unsigned char * +-vips_dbuf_string( VipsDbuf *dbuf, size_t *size ) ++vips_dbuf_string(VipsDbuf *dbuf, size_t *size) + { +- vips_dbuf_null_terminate( dbuf ); ++ vips_dbuf_null_terminate(dbuf); + +- if( size ) ++ if (size) + *size = dbuf->data_size; + +- return( dbuf->data ); ++ return (dbuf->data); + } +- +- +diff --git a/libvips/iofuncs/error.c b/libvips/iofuncs/error.c +index 97b672c3c3..b9913b7770 100644 +--- a/libvips/iofuncs/error.c ++++ b/libvips/iofuncs/error.c +@@ -1,6 +1,6 @@ +-/* error.c --- error message handling ++/* error.c --- error message handling + * +- * Copyright: N. Dessipris ++ * Copyright: N. Dessipris + * Written on: 18/03/1991 + * Updated on: 9/7/92 KM + * 20/12/2003 JC +@@ -20,28 +20,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -76,7 +76,7 @@ + * @stability: Stable + * @include: vips/vips.h + * +- * VIPS maintains an error buffer (a log of localised text messages), ++ * VIPS maintains an error buffer (a log of localised text messages), + * a set of functions + * for adding messages, and a way to access and clear the buffer. + * +@@ -109,10 +109,10 @@ + * libvips uses g_warning() and g_info() to send warning and information + * messages to the user. You can use the usual glib mechanisms to display or + * divert these messages. For example, info messages are hidden by default, but +- * you can see them with: ++ * you can see them with: + * + * |[ +- * $ G_MESSAGES_DEBUG=VIPS vipsthumbnail k2.jpg ++ * $ G_MESSAGES_DEBUG=VIPS vipsthumbnail k2.jpg + * VIPS-INFO: thumbnailing k2.jpg + * VIPS-INFO: selected loader is VipsForeignLoadJpegFile + * VIPS-INFO: input size is 1450 x 2048 +@@ -132,7 +132,7 @@ + */ + #define VIPS_MAX_ERROR (10240) + static char vips_error_text[VIPS_MAX_ERROR] = ""; +-static VipsBuf vips_error_buf = VIPS_BUF_STATIC( vips_error_text ); ++static VipsBuf vips_error_buf = VIPS_BUF_STATIC(vips_error_text); + static int vips_error_freeze_count = 0; + + /** +@@ -142,30 +142,30 @@ static int vips_error_freeze_count = 0; + * nest freeze/thaw pairs. + */ + void +-vips_error_freeze( void ) ++vips_error_freeze(void) + { +- g_mutex_lock( vips__global_lock ); +- g_assert( vips_error_freeze_count >= 0 ); ++ g_mutex_lock(vips__global_lock); ++ g_assert(vips_error_freeze_count >= 0); + vips_error_freeze_count += 1; +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_unlock(vips__global_lock); + } + + /** + * vips_error_thaw: + * +- * Reenable error logging. ++ * Reenable error logging. + */ + void +-vips_error_thaw( void ) ++vips_error_thaw(void) + { +- g_mutex_lock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); + vips_error_freeze_count -= 1; +- g_assert( vips_error_freeze_count >= 0 ); +- g_mutex_unlock( vips__global_lock ); ++ g_assert(vips_error_freeze_count >= 0); ++ g_mutex_unlock(vips__global_lock); + } + + /** +- * vips_error_buffer: ++ * vips_error_buffer: + * + * Get a pointer to the start of the error buffer as a C string. + * The string is owned by the error system and must not be freed. +@@ -175,35 +175,35 @@ vips_error_thaw( void ) + * Returns: the error buffer as a C string which must not be freed + */ + const char * +-vips_error_buffer( void ) ++vips_error_buffer(void) + { + const char *msg; + +- g_mutex_lock( vips__global_lock ); +- msg = vips_buf_all( &vips_error_buf ); +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); ++ msg = vips_buf_all(&vips_error_buf); ++ g_mutex_unlock(vips__global_lock); + +- return( msg ); ++ return (msg); + } + + /** +- * vips_error_buffer_copy: ++ * vips_error_buffer_copy: + * +- * Return a copy of the vips error buffer, and clear it. ++ * Return a copy of the vips error buffer, and clear it. + * + * Returns: a copy of the libvips error buffer + */ + char * +-vips_error_buffer_copy( void ) ++vips_error_buffer_copy(void) + { + char *msg; + +- g_mutex_lock( vips__global_lock ); +- msg = g_strdup( vips_buf_all( &vips_error_buf ) ); +- vips_buf_rewind( &vips_error_buf ); +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); ++ msg = g_strdup(vips_buf_all(&vips_error_buf)); ++ vips_buf_rewind(&vips_error_buf); ++ g_mutex_unlock(vips__global_lock); + +- return( msg ); ++ return (msg); + } + + /* Some systems do not have va_copy() ... this might work (it does on MSVC, +@@ -212,11 +212,11 @@ vips_error_buffer_copy( void ) + * FIXME ... this should be in configure.in + */ + #ifndef va_copy +-#define va_copy(d,s) ((d) = (s)) ++#define va_copy(d, s) ((d) = (s)) + #endif + + /** +- * vips_verror: ++ * vips_verror: + * @domain: the source of the error + * @fmt: printf()-style format string for the error + * @ap: arguments to the format string +@@ -225,39 +225,39 @@ vips_error_buffer_copy( void ) + * + * See also: vips_error(). + */ +-void +-vips_verror( const char *domain, const char *fmt, va_list ap ) ++void ++vips_verror(const char *domain, const char *fmt, va_list ap) + { + #ifdef VIPS_DEBUG +-{ +- char txt[256]; +- VipsBuf buf = VIPS_BUF_STATIC( txt ); +- va_list ap2; +- +- vips_buf_appendf( &buf, "%s: ", domain ); +- va_copy( ap2, ap ); +- vips_buf_vappendf( &buf, fmt, ap2 ); +- vips_buf_appends( &buf, "\n" ); +- VIPS_DEBUG_MSG( "vips_verror: %s", vips_buf_all( &buf ) ); +-} ++ { ++ char txt[256]; ++ VipsBuf buf = VIPS_BUF_STATIC(txt); ++ va_list ap2; ++ ++ vips_buf_appendf(&buf, "%s: ", domain); ++ va_copy(ap2, ap); ++ vips_buf_vappendf(&buf, fmt, ap2); ++ vips_buf_appends(&buf, "\n"); ++ VIPS_DEBUG_MSG("vips_verror: %s", vips_buf_all(&buf)); ++ } + #endif /*VIPS_DEBUG*/ + +- g_mutex_lock( vips__global_lock ); +- g_assert( vips_error_freeze_count >= 0 ); +- if( !vips_error_freeze_count ) { +- if( domain ) +- vips_buf_appendf( &vips_error_buf, "%s: ", domain ); +- vips_buf_vappendf( &vips_error_buf, fmt, ap ); +- vips_buf_appends( &vips_error_buf, "\n" ); ++ g_mutex_lock(vips__global_lock); ++ g_assert(vips_error_freeze_count >= 0); ++ if (!vips_error_freeze_count) { ++ if (domain) ++ vips_buf_appendf(&vips_error_buf, "%s: ", domain); ++ vips_buf_vappendf(&vips_error_buf, fmt, ap); ++ vips_buf_appends(&vips_error_buf, "\n"); + } +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_unlock(vips__global_lock); + +- if( vips__fatal ) +- vips_error_exit( "vips__fatal" ); ++ if (vips__fatal) ++ vips_error_exit("vips__fatal"); + } + + /** +- * vips_error: ++ * vips_error: + * @domain: the source of the error + * @fmt: printf()-style format string for the error + * @...: arguments to the format string +@@ -266,18 +266,18 @@ vips_verror( const char *domain, const char *fmt, va_list ap ) + * + * See also: vips_error_system(), vips_verror(). + */ +-void +-vips_error( const char *domain, const char *fmt, ... ) +-{ ++void ++vips_error(const char *domain, const char *fmt, ...) ++{ + va_list ap; + +- va_start( ap, fmt ); +- vips_verror( domain, fmt, ap ); +- va_end( ap ); ++ va_start(ap, fmt); ++ vips_verror(domain, fmt, ap); ++ va_end(ap); + } + + /** +- * vips_verror_system: ++ * vips_verror_system: + * @err: the system error code + * @domain: the source of the error + * @fmt: printf()-style format string for the error +@@ -290,39 +290,39 @@ vips_error( const char *domain, const char *fmt, ... ) + * See also: vips_error_system(). + */ + void +-vips_verror_system( int err, const char *domain, const char *fmt, va_list ap ) ++vips_verror_system(int err, const char *domain, const char *fmt, va_list ap) + { +- vips_verror( domain, fmt, ap ); ++ vips_verror(domain, fmt, ap); + + #ifdef G_OS_WIN32 +-{ +- char *buf; +- +- if( FormatMessageA( +- FORMAT_MESSAGE_ALLOCATE_BUFFER | +- FORMAT_MESSAGE_IGNORE_INSERTS | +- FORMAT_MESSAGE_FROM_SYSTEM, +- NULL, +- err, +- MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), +- (LPSTR) &buf, 0, NULL ) ) { +- vips_error( _( "windows error" ), "%s", buf ); +- LocalFree( buf ); ++ { ++ char *buf; ++ ++ if (FormatMessageA( ++ FORMAT_MESSAGE_ALLOCATE_BUFFER | ++ FORMAT_MESSAGE_IGNORE_INSERTS | ++ FORMAT_MESSAGE_FROM_SYSTEM, ++ NULL, ++ err, ++ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), ++ (LPSTR) &buf, 0, NULL)) { ++ vips_error(_("windows error"), "%s", buf); ++ LocalFree(buf); ++ } + } +-} +-#else /*!G_OS_WIN32*/ +-{ +- char *buf; ++#else /*!G_OS_WIN32*/ ++ { ++ char *buf; + +- buf = g_locale_to_utf8( strerror( err ), -1, NULL, NULL, NULL ); +- vips_error( _( "unix error" ), "%s", buf ); +- g_free( buf ); +-} ++ buf = g_locale_to_utf8(strerror(err), -1, NULL, NULL, NULL); ++ vips_error(_("unix error"), "%s", buf); ++ g_free(buf); ++ } + #endif /*G_OS_WIN32*/ + } + + /** +- * vips_error_system: ++ * vips_error_system: + * @err: the system error code + * @domain: the source of the error + * @fmt: printf()-style format string for the error +@@ -335,13 +335,13 @@ vips_verror_system( int err, const char *domain, const char *fmt, va_list ap ) + * See also: vips_verror_system(). + */ + void +-vips_error_system( int err, const char *domain, const char *fmt, ... ) ++vips_error_system(int err, const char *domain, const char *fmt, ...) + { + va_list ap; + +- va_start( ap, fmt ); +- vips_verror_system( err, domain, fmt, ap ); +- va_end( ap ); ++ va_start(ap, fmt); ++ vips_verror_system(err, domain, fmt, ap); ++ va_end(ap); + } + + /** +@@ -356,24 +356,23 @@ vips_error_system( int err, const char *domain, const char *fmt, ... ) + * See also: g_set_error(), vips_g_error(). + */ + void +-vips_error_g( GError **error ) ++vips_error_g(GError **error) + { + static GQuark vips_domain = 0; + +- if( !vips_domain ) +- vips_domain = g_quark_from_string( "libvips" ); ++ if (!vips_domain) ++ vips_domain = g_quark_from_string("libvips"); + + /* glib does not expect a trailing '\n' and vips always has one. + */ +- g_mutex_lock( vips__global_lock ); +- vips_buf_removec( &vips_error_buf, '\n' ); +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); ++ vips_buf_removec(&vips_error_buf, '\n'); ++ g_mutex_unlock(vips__global_lock); + +- g_set_error( error, vips_domain, -1, "%s", vips_error_buffer() ); ++ g_set_error(error, vips_domain, -1, "%s", vips_error_buffer()); + vips_error_clear(); + } + +- + /** + * vips_g_error: + * @error: glib error pointer +@@ -381,42 +380,42 @@ vips_error_g( GError **error ) + * This function adds the %GError to the vips error buffer and clears it. It's + * the opposite of vips_error_g(). + * +- * See also: vips_error_g(). ++ * See also: vips_error_g(). + */ + void +-vips_g_error( GError **error ) ++vips_g_error(GError **error) + { +- if( error && +- *error ) { +- vips_error( "glib", "%s\n", (*error)->message ); +- g_error_free( *error ); ++ if (error && ++ *error) { ++ vips_error("glib", "%s\n", (*error)->message); ++ g_error_free(*error); + *error = NULL; + } + } + + /** +- * vips_error_clear: ++ * vips_error_clear: + * + * Clear and reset the error buffer. This is typically called after presenting + * an error to the user. + * + * See also: vips_error_buffer(). + */ +-void +-vips_error_clear( void ) ++void ++vips_error_clear(void) + { +- g_mutex_lock( vips__global_lock ); +- vips_buf_rewind( &vips_error_buf ); +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); ++ vips_buf_rewind(&vips_error_buf); ++ g_mutex_unlock(vips__global_lock); + } + + /** +- * vips_error_exit: ++ * vips_error_exit: + * @fmt: printf()-style format string for the message + * @...: arguments to the format string + * + * Sends a formatted error message to stderr, then sends the contents of the +- * error buffer, if any, then shuts down vips and terminates the program with ++ * error buffer, if any, then shuts down vips and terminates the program with + * an error code. + * + * @fmt may be %NULL, in which case only the error buffer is printed before +@@ -424,29 +423,29 @@ vips_error_clear( void ) + * + * See also: vips_error(). + */ +-void +-vips_error_exit( const char *fmt, ... ) +-{ +- if( fmt ) { ++void ++vips_error_exit(const char *fmt, ...) ++{ ++ if (fmt) { + va_list ap; + +- fprintf( stderr, "%s: ", vips_get_prgname() ); ++ fprintf(stderr, "%s: ", vips_get_prgname()); + +- va_start( ap, fmt ); +- (void) vfprintf( stderr, fmt, ap ); +- va_end( ap ); ++ va_start(ap, fmt); ++ (void) vfprintf(stderr, fmt, ap); ++ va_end(ap); + +- fprintf( stderr, "\n" ); ++ fprintf(stderr, "\n"); + } + +- fprintf( stderr, "%s", vips_error_buffer() ); ++ fprintf(stderr, "%s", vips_error_buffer()); + + vips_shutdown(); + +- if( vips__fatal ) ++ if (vips__fatal) + abort(); + else +- exit( 1 ); ++ exit(1); + } + + /** +@@ -454,7 +453,7 @@ vips_error_exit( const char *fmt, ... ) + * @domain: the originating domain for the error message + * @im: image to check + * +- * Check that the image is not coded. ++ * Check that the image is not coded. + * If not, set an error message + * and return non-zero. + * +@@ -463,14 +462,14 @@ vips_error_exit( const char *fmt, ... ) + * Returns: 0 on OK, or -1 on error. + */ + int +-vips_check_uncoded( const char *domain, VipsImage *im ) ++vips_check_uncoded(const char *domain, VipsImage *im) + { +- if( im->Coding != VIPS_CODING_NONE ) { +- vips_error( domain, "%s", _( "image must be uncoded" ) ); +- return( -1 ); ++ if (im->Coding != VIPS_CODING_NONE) { ++ vips_error(domain, "%s", _("image must be uncoded")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -487,18 +486,18 @@ vips_check_uncoded( const char *domain, VipsImage *im ) + * Returns: 0 on OK, or -1 on error. + */ + int +-vips_check_coding_noneorlabq( const char *domain, VipsImage *im ) ++vips_check_coding_noneorlabq(const char *domain, VipsImage *im) + { + /* These all have codings that extract/ifthenelse/etc can ignore. + */ +- if( im->Coding != VIPS_CODING_NONE && +- im->Coding != VIPS_CODING_LABQ ) { +- vips_error( domain, +- "%s", _( "image coding must be 'none' or 'labq'" ) ); +- return( -1 ); ++ if (im->Coding != VIPS_CODING_NONE && ++ im->Coding != VIPS_CODING_LABQ) { ++ vips_error(domain, ++ "%s", _("image coding must be 'none' or 'labq'")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -506,7 +505,7 @@ vips_check_coding_noneorlabq( const char *domain, VipsImage *im ) + * @domain: the originating domain for the error message + * @im: image to check + * +- * Check that the image is uncoded, LABQ coded or RAD coded. ++ * Check that the image is uncoded, LABQ coded or RAD coded. + * If not, set an error message + * and return non-zero. + * +@@ -515,18 +514,18 @@ vips_check_coding_noneorlabq( const char *domain, VipsImage *im ) + * Returns: 0 on OK, or -1 on error. + */ + int +-vips_check_coding_known( const char *domain, VipsImage *im ) ++vips_check_coding_known(const char *domain, VipsImage *im) + { + /* These all have codings that extract/ifthenelse/etc can ignore. + */ +- if( im->Coding != VIPS_CODING_NONE && ++ if (im->Coding != VIPS_CODING_NONE && + im->Coding != VIPS_CODING_LABQ && +- im->Coding != VIPS_CODING_RAD ) { +- vips_error( domain, "%s", _( "unknown image coding" ) ); +- return( -1 ); ++ im->Coding != VIPS_CODING_RAD) { ++ vips_error(domain, "%s", _("unknown image coding")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -544,15 +543,15 @@ vips_check_coding_known( const char *domain, VipsImage *im ) + * Returns: 0 on OK, or -1 on error. + */ + int +-vips_check_coding( const char *domain, VipsImage *im, VipsCoding coding ) ++vips_check_coding(const char *domain, VipsImage *im, VipsCoding coding) + { +- if( im->Coding != coding ) { +- vips_error( domain, _( "coding '%s' only" ), +- vips_enum_nick( VIPS_TYPE_CODING, coding ) ); +- return( -1 ); ++ if (im->Coding != coding) { ++ vips_error(domain, _("coding '%s' only"), ++ vips_enum_nick(VIPS_TYPE_CODING, coding)); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -569,14 +568,14 @@ vips_check_coding( const char *domain, VipsImage *im, VipsCoding coding ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_mono( const char *domain, VipsImage *im ) ++vips_check_mono(const char *domain, VipsImage *im) + { +- if( im->Bands != 1 ) { +- vips_error( domain, "%s", _( "image must one band" ) ); +- return( -1 ); ++ if (im->Bands != 1) { ++ vips_error(domain, "%s", _("image must one band")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -594,14 +593,14 @@ vips_check_mono( const char *domain, VipsImage *im ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_bands( const char *domain, VipsImage *im, int bands ) ++vips_check_bands(const char *domain, VipsImage *im, int bands) + { +- if( im->Bands != bands ) { +- vips_error( domain, _( "image must have %d bands" ), bands ); +- return( -1 ); ++ if (im->Bands != bands) { ++ vips_error(domain, _("image must have %d bands"), bands); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -618,15 +617,15 @@ vips_check_bands( const char *domain, VipsImage *im, int bands ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_bands_1or3( const char *domain, VipsImage *im ) ++vips_check_bands_1or3(const char *domain, VipsImage *im) + { +- if( im->Bands != 1 && im->Bands != 3 ) { +- vips_error( domain, "%s", +- _( "image must have one or three bands" ) ); +- return( -1 ); ++ if (im->Bands != 1 && im->Bands != 3) { ++ vips_error(domain, "%s", ++ _("image must have one or three bands")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -635,7 +634,7 @@ vips_check_bands_1or3( const char *domain, VipsImage *im ) + * @im: image to check + * @bands: at least this many bands + * +- * Check that the image has at least @bands bands. ++ * Check that the image has at least @bands bands. + * Otherwise set an error message + * and return non-zero. + * +@@ -644,15 +643,15 @@ vips_check_bands_1or3( const char *domain, VipsImage *im ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_bands_atleast( const char *domain, VipsImage *im, int bands ) ++vips_check_bands_atleast(const char *domain, VipsImage *im, int bands) + { +- if( im->Bands < bands ) { +- vips_error( domain, +- _( "image must have at least %d bands" ), bands ); +- return( -1 ); ++ if (im->Bands < bands) { ++ vips_error(domain, ++ _("image must have at least %d bands"), bands); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -671,17 +670,17 @@ vips_check_bands_atleast( const char *domain, VipsImage *im, int bands ) + * Returns: 0 on OK, or -1 on error. + */ + int +-vips_check_bands_1orn( const char *domain, VipsImage *im1, VipsImage *im2 ) ++vips_check_bands_1orn(const char *domain, VipsImage *im1, VipsImage *im2) + { +- if( im1->Bands != im2->Bands && +- (im1->Bands != 1 && im2->Bands != 1) ) { +- vips_error( domain, "%s", +- _( "images must have the same number of bands, " +- "or one must be single-band" ) ); +- return( -1 ); ++ if (im1->Bands != im2->Bands && ++ (im1->Bands != 1 && im2->Bands != 1)) { ++ vips_error(domain, "%s", ++ _("images must have the same number of bands, " ++ "or one must be single-band")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -700,14 +699,14 @@ vips_check_bands_1orn( const char *domain, VipsImage *im1, VipsImage *im2 ) + * Returns: 0 on OK, or -1 on error. + */ + int +-vips_check_bands_1orn_unary( const char *domain, VipsImage *im, int n ) ++vips_check_bands_1orn_unary(const char *domain, VipsImage *im, int n) + { +- if( im->Bands != 1 && im->Bands != n ) { +- vips_error( domain, _( "image must have 1 or %d bands" ), n ); +- return( -1 ); ++ if (im->Bands != 1 && im->Bands != n) { ++ vips_error(domain, _("image must have 1 or %d bands"), n); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -724,14 +723,14 @@ vips_check_bands_1orn_unary( const char *domain, VipsImage *im, int n ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_noncomplex( const char *domain, VipsImage *im ) ++vips_check_noncomplex(const char *domain, VipsImage *im) + { +- if( vips_band_format_iscomplex( im->BandFmt ) ) { +- vips_error( domain, "%s", _( "image must be non-complex" ) ); +- return( -1 ); ++ if (vips_band_format_iscomplex(im->BandFmt)) { ++ vips_error(domain, "%s", _("image must be non-complex")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -748,14 +747,14 @@ vips_check_noncomplex( const char *domain, VipsImage *im ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_complex( const char *domain, VipsImage *im ) ++vips_check_complex(const char *domain, VipsImage *im) + { +- if( !vips_band_format_iscomplex( im->BandFmt ) ) { +- vips_error( domain, "%s", _( "image must be complex" ) ); +- return( -1 ); ++ if (!vips_band_format_iscomplex(im->BandFmt)) { ++ vips_error(domain, "%s", _("image must be complex")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -764,7 +763,7 @@ vips_check_complex( const char *domain, VipsImage *im ) + * @im: image to check + * + * Check that the image is has two "components", ie. is a one-band complex or +- * a two-band non-complex. ++ * a two-band non-complex. + * Otherwise set an error message + * and return non-zero. + * +@@ -773,16 +772,16 @@ vips_check_complex( const char *domain, VipsImage *im ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_twocomponents( const char *domain, VipsImage *im ) ++vips_check_twocomponents(const char *domain, VipsImage *im) + { +- if( !vips_band_format_iscomplex( im->BandFmt ) && +- im->Bands != 2 ) { +- vips_error( domain, +- "%s", _( "image must be two-band or complex" ) ); +- return( -1 ); ++ if (!vips_band_format_iscomplex(im->BandFmt) && ++ im->Bands != 2) { ++ vips_error(domain, ++ "%s", _("image must be two-band or complex")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -800,16 +799,16 @@ vips_check_twocomponents( const char *domain, VipsImage *im ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_format( const char *domain, VipsImage *im, VipsBandFormat fmt ) ++vips_check_format(const char *domain, VipsImage *im, VipsBandFormat fmt) + { +- if( im->BandFmt != fmt ) { +- vips_error( domain, +- _( "image must be %s" ), +- vips_enum_string( VIPS_TYPE_BAND_FORMAT, fmt ) ); +- return( -1 ); ++ if (im->BandFmt != fmt) { ++ vips_error(domain, ++ _("image must be %s"), ++ vips_enum_string(VIPS_TYPE_BAND_FORMAT, fmt)); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -826,14 +825,14 @@ vips_check_format( const char *domain, VipsImage *im, VipsBandFormat fmt ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_int( const char *domain, VipsImage *im ) ++vips_check_int(const char *domain, VipsImage *im) + { +- if( !vips_band_format_isint( im->BandFmt ) ) { +- vips_error( domain, "%s", _( "image must be integer" ) ); +- return( -1 ); ++ if (!vips_band_format_isint(im->BandFmt)) { ++ vips_error(domain, "%s", _("image must be integer")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -850,15 +849,15 @@ vips_check_int( const char *domain, VipsImage *im ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_uint( const char *domain, VipsImage *im ) ++vips_check_uint(const char *domain, VipsImage *im) + { +- if( !vips_band_format_isuint( im->BandFmt ) ) { +- vips_error( domain, +- "%s", _( "image must be unsigned integer" ) ); +- return( -1 ); ++ if (!vips_band_format_isuint(im->BandFmt)) { ++ vips_error(domain, ++ "%s", _("image must be unsigned integer")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -875,19 +874,19 @@ vips_check_uint( const char *domain, VipsImage *im ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_8or16( const char *domain, VipsImage *im ) ++vips_check_8or16(const char *domain, VipsImage *im) + { +- if( im->BandFmt != VIPS_FORMAT_UCHAR && ++ if (im->BandFmt != VIPS_FORMAT_UCHAR && + im->BandFmt != VIPS_FORMAT_USHORT && + im->BandFmt != VIPS_FORMAT_CHAR && +- im->BandFmt != VIPS_FORMAT_SHORT ) { +- vips_error( domain, "%s", +- _( "image must be 8- or 16-bit integer, " +- "signed or unsigned" ) ); +- return( -1 ); ++ im->BandFmt != VIPS_FORMAT_SHORT) { ++ vips_error(domain, "%s", ++ _("image must be 8- or 16-bit integer, " ++ "signed or unsigned")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -904,16 +903,16 @@ vips_check_8or16( const char *domain, VipsImage *im ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_u8or16( const char *domain, VipsImage *im ) ++vips_check_u8or16(const char *domain, VipsImage *im) + { +- if( im->BandFmt != VIPS_FORMAT_UCHAR && +- im->BandFmt != VIPS_FORMAT_USHORT ) { +- vips_error( domain, "%s", +- _( "image must be 8- or 16-bit unsigned integer" ) ); +- return( -1 ); ++ if (im->BandFmt != VIPS_FORMAT_UCHAR && ++ im->BandFmt != VIPS_FORMAT_USHORT) { ++ vips_error(domain, "%s", ++ _("image must be 8- or 16-bit unsigned integer")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -929,18 +928,18 @@ vips_check_u8or16( const char *domain, VipsImage *im ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_u8or16orf( const char *domain, VipsImage *im ) ++vips_check_u8or16orf(const char *domain, VipsImage *im) + { +- if( im->BandFmt != VIPS_FORMAT_UCHAR && ++ if (im->BandFmt != VIPS_FORMAT_UCHAR && + im->BandFmt != VIPS_FORMAT_USHORT && +- im->BandFmt != VIPS_FORMAT_FLOAT ) { +- vips_error( domain, "%s", +- _( "image must be 8- or 16-bit unsigned integer, " +- "or float" ) ); +- return( -1 ); ++ im->BandFmt != VIPS_FORMAT_FLOAT) { ++ vips_error(domain, "%s", ++ _("image must be 8- or 16-bit unsigned integer, " ++ "or float")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -956,18 +955,18 @@ vips_check_u8or16orf( const char *domain, VipsImage *im ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_uintorf( const char *domain, VipsImage *im ) ++vips_check_uintorf(const char *domain, VipsImage *im) + { +- if( im->BandFmt != VIPS_FORMAT_UCHAR && ++ if (im->BandFmt != VIPS_FORMAT_UCHAR && + im->BandFmt != VIPS_FORMAT_USHORT && + im->BandFmt != VIPS_FORMAT_UINT && +- im->BandFmt != VIPS_FORMAT_FLOAT ) { +- vips_error( domain, "%s", +- _( "image must be unsigned int or float" ) ); +- return( -1 ); ++ im->BandFmt != VIPS_FORMAT_FLOAT) { ++ vips_error(domain, "%s", ++ _("image must be unsigned int or float")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -985,15 +984,15 @@ vips_check_uintorf( const char *domain, VipsImage *im ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_size_same( const char *domain, VipsImage *im1, VipsImage *im2 ) ++vips_check_size_same(const char *domain, VipsImage *im1, VipsImage *im2) + { +- if( im1->Xsize != im2->Xsize || +- im1->Ysize != im2->Ysize ) { +- vips_error( domain, "%s", _( "images must match in size" ) ); +- return( -1 ); ++ if (im1->Xsize != im2->Xsize || ++ im1->Ysize != im2->Ysize) { ++ vips_error(domain, "%s", _("images must match in size")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -1001,7 +1000,7 @@ vips_check_size_same( const char *domain, VipsImage *im1, VipsImage *im2 ) + * @domain: the originating domain for the error message + * @im: image to check + * +- * Check that the image is square and that the sides are odd. ++ * Check that the image is square and that the sides are odd. + * If not, set an error message + * and return non-zero. + * +@@ -1010,16 +1009,16 @@ vips_check_size_same( const char *domain, VipsImage *im1, VipsImage *im2 ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_oddsquare( const char *domain, VipsImage *im ) ++vips_check_oddsquare(const char *domain, VipsImage *im) + { +- if( im->Xsize != im->Ysize || +- im->Xsize % 2 == 0 ) { +- vips_error( domain, +- "%s", _( "images must be odd and square" ) ); +- return( -1 ); ++ if (im->Xsize != im->Ysize || ++ im->Xsize % 2 == 0) { ++ vips_error(domain, ++ "%s", _("images must be odd and square")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -1037,15 +1036,15 @@ vips_check_oddsquare( const char *domain, VipsImage *im ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_bands_same( const char *domain, VipsImage *im1, VipsImage *im2 ) ++vips_check_bands_same(const char *domain, VipsImage *im1, VipsImage *im2) + { +- if( im1->Bands != im2->Bands ) { +- vips_error( domain, "%s", +- _( "images must have the same number of bands" ) ); +- return( -1 ); ++ if (im1->Bands != im2->Bands) { ++ vips_error(domain, "%s", ++ _("images must have the same number of bands")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -1055,7 +1054,7 @@ vips_check_bands_same( const char *domain, VipsImage *im1, VipsImage *im2 ) + * @bandno: band number + * + * @bandno should be a valid band number (ie. 0 to im->Bands - 1), or can be +- * -1, meaning all bands. ++ * -1, meaning all bands. + * If not, set an error message + * and return non-zero. + * +@@ -1064,16 +1063,16 @@ vips_check_bands_same( const char *domain, VipsImage *im1, VipsImage *im2 ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_bandno( const char *domain, VipsImage *im, int bandno ) ++vips_check_bandno(const char *domain, VipsImage *im, int bandno) + { +- if( bandno < -1 || +- bandno > im->Bands - 1 ) { +- vips_error( domain, "bandno must be -1, or less than %d", +- im->Bands ); +- return( -1 ); ++ if (bandno < -1 || ++ bandno > im->Bands - 1) { ++ vips_error(domain, "bandno must be -1, or less than %d", ++ im->Bands); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -1091,15 +1090,15 @@ vips_check_bandno( const char *domain, VipsImage *im, int bandno ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_format_same( const char *domain, VipsImage *im1, VipsImage *im2 ) ++vips_check_format_same(const char *domain, VipsImage *im1, VipsImage *im2) + { +- if( im1->BandFmt != im2->BandFmt ) { +- vips_error( domain, "%s", +- _( "images must have the same band format" ) ); +- return( -1 ); ++ if (im1->BandFmt != im2->BandFmt) { ++ vips_error(domain, "%s", ++ _("images must have the same band format")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -1117,15 +1116,15 @@ vips_check_format_same( const char *domain, VipsImage *im1, VipsImage *im2 ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_coding_same( const char *domain, VipsImage *im1, VipsImage *im2 ) ++vips_check_coding_same(const char *domain, VipsImage *im1, VipsImage *im2) + { +- if( im1->Coding != im2->Coding ) { +- vips_error( domain, "%s", +- _( "images must have the same coding" ) ); +- return( -1 ); ++ if (im1->Coding != im2->Coding) { ++ vips_error(domain, "%s", ++ _("images must have the same coding")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -1134,21 +1133,21 @@ vips_check_coding_same( const char *domain, VipsImage *im1, VipsImage *im2 ) + * @n: number of elements in vector + * @len: number of elements vector should have + * +- * Check that @n == @len. ++ * Check that @n == @len. + * + * See also: vips_error(). + * + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_vector_length( const char *domain, int n, int len ) ++vips_check_vector_length(const char *domain, int n, int len) + { +- if( n != len ) { +- vips_error( domain, _( "vector must have %d elements" ), len ); +- return( -1 ); ++ if (n != len) { ++ vips_error(domain, _("vector must have %d elements"), len); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -1166,35 +1165,35 @@ vips_check_vector_length( const char *domain, int n, int len ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_vector( const char *domain, int n, VipsImage *im ) ++vips_check_vector(const char *domain, int n, VipsImage *im) + { + /* Here it's clearer to list the cases that are OK. + */ +- if( n == im->Bands ) +- return( 0 ); +- if( n == 1 ) +- return( 0 ); +- if( im->Bands == 1 && +- n > 1 ) +- return( 0 ); +- +- if( im->Bands == 1 ) +- vips_error( domain, +- "%s", _( "vector must have 1 element" ) ); ++ if (n == im->Bands) ++ return (0); ++ if (n == 1) ++ return (0); ++ if (im->Bands == 1 && ++ n > 1) ++ return (0); ++ ++ if (im->Bands == 1) ++ vips_error(domain, ++ "%s", _("vector must have 1 element")); + else +- vips_error( domain, +- _( "vector must have 1 or %d elements" ), +- im->Bands ); ++ vips_error(domain, ++ _("vector must have 1 or %d elements"), ++ im->Bands); + +- return( -1 ); ++ return (-1); + } + + /** + * vips_check_hist: + * @domain: the originating domain for the error message +- * @im: image to check ++ * @im: image to check + * +- * Histogram images must have width or height 1, and must not have more than ++ * Histogram images must have width or height 1, and must not have more than + * 65536 elements. Return 0 if the image will pass as a histogram, or -1 and + * set an error message otherwise. + * +@@ -1203,37 +1202,37 @@ vips_check_vector( const char *domain, int n, VipsImage *im ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_hist( const char *domain, VipsImage *im ) ++vips_check_hist(const char *domain, VipsImage *im) + { +- if( im->Xsize != 1 && +- im->Ysize != 1 ) { +- vips_error( domain, "%s", +- _( "histograms must have width or height 1" ) ); +- return( -1 ); ++ if (im->Xsize != 1 && ++ im->Ysize != 1) { ++ vips_error(domain, "%s", ++ _("histograms must have width or height 1")); ++ return (-1); + } +- if( VIPS_IMAGE_N_PELS( im ) > 65536 ) { +- vips_error( domain, "%s", +- _( "histograms must have not have more than " +- "65536 elements" ) ); +- return( -1 ); ++ if (VIPS_IMAGE_N_PELS(im) > 65536) { ++ vips_error(domain, "%s", ++ _("histograms must have not have more than " ++ "65536 elements")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + +-/** +- * vips_check_matrix: ++/** ++ * vips_check_matrix: + * @domain: the originating domain for the error message +- * @im: image to check ++ * @im: image to check + * @out: (out): put image as in-memory doubles here + * + * Matrix images must have width and height less than 100000 and have 1 band. + * +- * Return 0 if the image will pass as a matrix, or -1 and set an error ++ * Return 0 if the image will pass as a matrix, or -1 and set an error + * message otherwise. + * + * @out is set to be @im cast to double and stored in memory. Use +- * VIPS_MATRIX() to address values in @out. ++ * VIPS_MATRIX() to address values in @out. + * + * You must unref @out when you are done with it. + * +@@ -1242,38 +1241,38 @@ vips_check_hist( const char *domain, VipsImage *im ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_matrix( const char *domain, VipsImage *im, VipsImage **out ) ++vips_check_matrix(const char *domain, VipsImage *im, VipsImage **out) + { + VipsImage *t; + + *out = NULL; + +- if( im->Xsize > 100000 || +- im->Ysize > 100000 ) { +- vips_error( domain, "%s", _( "matrix image too large" ) ); +- return( -1 ); ++ if (im->Xsize > 100000 || ++ im->Ysize > 100000) { ++ vips_error(domain, "%s", _("matrix image too large")); ++ return (-1); + } +- if( im->Bands != 1 ) { +- vips_error( domain, +- "%s", _( "matrix image must have one band" ) ); +- return( -1 ); ++ if (im->Bands != 1) { ++ vips_error(domain, ++ "%s", _("matrix image must have one band")); ++ return (-1); + } + +- if( vips_cast( im, &t, VIPS_FORMAT_DOUBLE, NULL ) ) +- return( -1 ); +- if( !(*out = vips_image_copy_memory( t )) ) { +- VIPS_UNREF( t ); +- return( -1 ); ++ if (vips_cast(im, &t, VIPS_FORMAT_DOUBLE, NULL)) ++ return (-1); ++ if (!(*out = vips_image_copy_memory(t))) { ++ VIPS_UNREF(t); ++ return (-1); + } +- VIPS_UNREF( t ); ++ VIPS_UNREF(t); + +- return( 0 ); ++ return (0); + } + + /** + * vips_check_separable: + * @domain: the originating domain for the error message +- * @im: image to check ++ * @im: image to check + * + * Separable matrix images must have width or height 1. + * Return 0 if the image will pass, or -1 and +@@ -1284,17 +1283,17 @@ vips_check_matrix( const char *domain, VipsImage *im, VipsImage **out ) + * Returns: 0 if OK, -1 otherwise. + */ + int +-vips_check_separable( const char *domain, VipsImage *im ) ++vips_check_separable(const char *domain, VipsImage *im) + { +- if( im->Xsize != 1 && +- im->Ysize != 1 ) { +- vips_error( domain, +- "%s", _( "separable matrix images must have " +- "width or height 1" ) ); +- return( -1 ); ++ if (im->Xsize != 1 && ++ im->Ysize != 1) { ++ vips_error(domain, ++ "%s", _("separable matrix images must have " ++ "width or height 1")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -1311,14 +1310,14 @@ vips_check_separable( const char *domain, VipsImage *im ) + * Returns: 0 on OK, or -1 on error. + */ + int +-vips_check_precision_intfloat( const char *domain, VipsPrecision precision ) ++vips_check_precision_intfloat(const char *domain, VipsPrecision precision) + { +- if( precision != VIPS_PRECISION_INTEGER && +- precision != VIPS_PRECISION_FLOAT ) { +- vips_error( domain, +- "%s", _( "precision must be int or float" ) ); +- return( -1 ); ++ if (precision != VIPS_PRECISION_INTEGER && ++ precision != VIPS_PRECISION_FLOAT) { ++ vips_error(domain, ++ "%s", _("precision must be int or float")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/iofuncs/gate.c b/libvips/iofuncs/gate.c +index 79994306f5..8558f9776e 100644 +--- a/libvips/iofuncs/gate.c ++++ b/libvips/iofuncs/gate.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -49,14 +49,14 @@ + + #define VIPS_GATE_SIZE (1000) + +-/* A set of timing records. i is the index of the next slot we fill. ++/* A set of timing records. i is the index of the next slot we fill. + */ + typedef struct _VipsThreadGateBlock { + struct _VipsThreadGateBlock *prev; + + gint64 time[VIPS_GATE_SIZE]; + int i; +-} VipsThreadGateBlock; ++} VipsThreadGateBlock; + + /* What we track for each gate-name. + */ +@@ -64,9 +64,9 @@ typedef struct _VipsThreadGate { + const char *name; + VipsThreadGateBlock *start; + VipsThreadGateBlock *stop; +-} VipsThreadGate; ++} VipsThreadGate; + +-/* One of these in per-thread private storage. ++/* One of these in per-thread private storage. + */ + + typedef struct _VipsThreadProfile { +@@ -76,299 +76,300 @@ typedef struct _VipsThreadProfile { + GThread *thread; + GHashTable *gates; + VipsThreadGate *memory; +-} VipsThreadProfile; ++} VipsThreadProfile; + + gboolean vips__thread_profile = FALSE; + + static GPrivate *vips_thread_profile_key = NULL; + +-static FILE *vips__thread_fp = NULL;; ++static FILE *vips__thread_fp = NULL; ++; + + /** + * vips_profile_set: + * @profile: %TRUE to enable profile recording + * + * If set, vips will record profiling information, and dump it on program +- * exit. These profiles can be analysed with the `vipsprofile` program. ++ * exit. These profiles can be analysed with the `vipsprofile` program. + */ + void +-vips_profile_set( gboolean profile ) ++vips_profile_set(gboolean profile) + { + vips__thread_profile = profile; + } + + static void +-vips_thread_gate_block_save( VipsThreadGateBlock *block, FILE *fp ) ++vips_thread_gate_block_save(VipsThreadGateBlock *block, FILE *fp) + { + int i; + +- for( i = block->i - 1; i >= 0; i-- ) +- fprintf( fp, "%" G_GINT64_FORMAT " ", block->time[i] ); +- fprintf( fp, "\n" ); +- if( block->prev ) +- vips_thread_gate_block_save( block->prev, fp ); ++ for (i = block->i - 1; i >= 0; i--) ++ fprintf(fp, "%" G_GINT64_FORMAT " ", block->time[i]); ++ fprintf(fp, "\n"); ++ if (block->prev) ++ vips_thread_gate_block_save(block->prev, fp); + } + + static void +-vips_thread_profile_save_gate( VipsThreadGate *gate, FILE *fp ) ++vips_thread_profile_save_gate(VipsThreadGate *gate, FILE *fp) + { +- if( gate->start->i || +- gate->start->prev ) { +- fprintf( fp, "gate: %s\n", gate->name ); +- fprintf( fp, "start:\n" ); +- vips_thread_gate_block_save( gate->start, fp ); +- fprintf( fp, "stop:\n" ); +- vips_thread_gate_block_save( gate->stop, fp ); ++ if (gate->start->i || ++ gate->start->prev) { ++ fprintf(fp, "gate: %s\n", gate->name); ++ fprintf(fp, "start:\n"); ++ vips_thread_gate_block_save(gate->start, fp); ++ fprintf(fp, "stop:\n"); ++ vips_thread_gate_block_save(gate->stop, fp); + } + } + + static void +-vips_thread_profile_save_cb( gpointer key, gpointer value, gpointer data ) ++vips_thread_profile_save_cb(gpointer key, gpointer value, gpointer data) + { + VipsThreadGate *gate = (VipsThreadGate *) value; + FILE *fp = (FILE *) data; + +- vips_thread_profile_save_gate( gate, fp ); ++ vips_thread_profile_save_gate(gate, fp); + } + + static void +-vips_thread_profile_save( VipsThreadProfile *profile ) ++vips_thread_profile_save(VipsThreadProfile *profile) + { +- g_mutex_lock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); + +- VIPS_DEBUG_MSG( "vips_thread_profile_save: %s\n", profile->name ); ++ VIPS_DEBUG_MSG("vips_thread_profile_save: %s\n", profile->name); + +- if( !vips__thread_fp ) { +- vips__thread_fp = +- vips__file_open_write( "vips-profile.txt", TRUE ); +- if( !vips__thread_fp ) { +- g_mutex_unlock( vips__global_lock ); +- g_warning( "unable to create profile log" ); ++ if (!vips__thread_fp) { ++ vips__thread_fp = ++ vips__file_open_write("vips-profile.txt", TRUE); ++ if (!vips__thread_fp) { ++ g_mutex_unlock(vips__global_lock); ++ g_warning("unable to create profile log"); + return; + } + +- printf( "recording profile in vips-profile.txt\n" ); ++ printf("recording profile in vips-profile.txt\n"); + } + +- fprintf( vips__thread_fp, "thread: %s (%p)\n", profile->name, profile ); +- g_hash_table_foreach( profile->gates, +- vips_thread_profile_save_cb, vips__thread_fp ); +- vips_thread_profile_save_gate( profile->memory, vips__thread_fp ); ++ fprintf(vips__thread_fp, "thread: %s (%p)\n", profile->name, profile); ++ g_hash_table_foreach(profile->gates, ++ vips_thread_profile_save_cb, vips__thread_fp); ++ vips_thread_profile_save_gate(profile->memory, vips__thread_fp); + +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_unlock(vips__global_lock); + } + + static void +-vips_thread_gate_block_free( VipsThreadGateBlock *block ) ++vips_thread_gate_block_free(VipsThreadGateBlock *block) + { +- VIPS_FREEF( vips_thread_gate_block_free, block->prev ); +- VIPS_FREE( block ); ++ VIPS_FREEF(vips_thread_gate_block_free, block->prev); ++ VIPS_FREE(block); + } + + static void +-vips_thread_gate_free( VipsThreadGate *gate ) ++vips_thread_gate_free(VipsThreadGate *gate) + { +- VIPS_FREEF( vips_thread_gate_block_free, gate->start ); +- VIPS_FREEF( vips_thread_gate_block_free, gate->stop ); +- VIPS_FREE( gate ); ++ VIPS_FREEF(vips_thread_gate_block_free, gate->start); ++ VIPS_FREEF(vips_thread_gate_block_free, gate->stop); ++ VIPS_FREE(gate); + } + + static void +-vips_thread_profile_free( VipsThreadProfile *profile ) ++vips_thread_profile_free(VipsThreadProfile *profile) + { +- VIPS_DEBUG_MSG( "vips_thread_profile_free: %s\n", profile->name ); ++ VIPS_DEBUG_MSG("vips_thread_profile_free: %s\n", profile->name); + +- VIPS_FREEF( g_hash_table_destroy, profile->gates ); +- VIPS_FREEF( vips_thread_gate_free, profile->memory ); +- VIPS_FREE( profile ); ++ VIPS_FREEF(g_hash_table_destroy, profile->gates); ++ VIPS_FREEF(vips_thread_gate_free, profile->memory); ++ VIPS_FREE(profile); + } + + void +-vips__thread_profile_stop( void ) ++vips__thread_profile_stop(void) + { +- if( vips__thread_profile ) +- VIPS_FREEF( fclose, vips__thread_fp ); ++ if (vips__thread_profile) ++ VIPS_FREEF(fclose, vips__thread_fp); + } + + static void +-vips__thread_profile_init_cb( VipsThreadProfile *profile ) ++vips__thread_profile_init_cb(VipsThreadProfile *profile) + { + /* We only come here if vips_thread_shutdown() was not called for this + * thread. Do our best to clean up. + * +- * GPrivate has stopped working, be careful not to touch that. ++ * GPrivate has stopped working, be careful not to touch that. + * + * Don't try to save: we must free all mem before saving and we + * probably haven't done that because vips_thread_shutdown() has not +- * been called. ++ * been called. + */ +- if( vips__thread_profile ) +- g_warning( "discarding unsaved state for thread %p --- " +- "call vips_thread_shutdown() for this thread", +- profile->thread ); ++ if (vips__thread_profile) ++ g_warning("discarding unsaved state for thread %p --- " ++ "call vips_thread_shutdown() for this thread", ++ profile->thread); + +- vips_thread_profile_free( profile ); ++ vips_thread_profile_free(profile); + } + + static void * +-vips__thread_profile_init( void *data ) ++vips__thread_profile_init(void *data) + { +- static GPrivate private = +- G_PRIVATE_INIT( (GDestroyNotify) vips__thread_profile_init_cb ); ++ static GPrivate private = ++ G_PRIVATE_INIT((GDestroyNotify) vips__thread_profile_init_cb); + + vips_thread_profile_key = &private; + +- return( NULL ); ++ return (NULL); + } + + static VipsThreadGate * +-vips_thread_gate_new( const char *gate_name ) ++vips_thread_gate_new(const char *gate_name) + { + VipsThreadGate *gate; + +- gate = g_new( VipsThreadGate, 1 ); +- gate->name = gate_name; +- gate->start = g_new0( VipsThreadGateBlock, 1 ); +- gate->stop = g_new0( VipsThreadGateBlock, 1 ); ++ gate = g_new(VipsThreadGate, 1); ++ gate->name = gate_name; ++ gate->start = g_new0(VipsThreadGateBlock, 1); ++ gate->stop = g_new0(VipsThreadGateBlock, 1); + +- return( gate ); ++ return (gate); + } + + void +-vips__thread_profile_attach( const char *thread_name ) ++vips__thread_profile_attach(const char *thread_name) + { + static GOnce once = G_ONCE_INIT; + + VipsThreadProfile *profile; + +- VIPS_ONCE( &once, vips__thread_profile_init, NULL ); ++ VIPS_ONCE(&once, vips__thread_profile_init, NULL); + +- VIPS_DEBUG_MSG( "vips__thread_profile_attach: %s\n", thread_name ); ++ VIPS_DEBUG_MSG("vips__thread_profile_attach: %s\n", thread_name); + +- profile = g_new( VipsThreadProfile, 1 ); +- profile->name = thread_name; +- profile->gates = g_hash_table_new_full( +- g_direct_hash, g_str_equal, +- NULL, (GDestroyNotify) vips_thread_gate_free ); +- profile->memory = vips_thread_gate_new( "memory" ); +- g_private_replace( vips_thread_profile_key, profile ); ++ profile = g_new(VipsThreadProfile, 1); ++ profile->name = thread_name; ++ profile->gates = g_hash_table_new_full( ++ g_direct_hash, g_str_equal, ++ NULL, (GDestroyNotify) vips_thread_gate_free); ++ profile->memory = vips_thread_gate_new("memory"); ++ g_private_replace(vips_thread_profile_key, profile); + } + + static VipsThreadProfile * +-vips_thread_profile_get( void ) ++vips_thread_profile_get(void) + { +- return( g_private_get( vips_thread_profile_key ) ); ++ return (g_private_get(vips_thread_profile_key)); + } + +-/* This usually happens automatically when a thread shuts down, see ++/* This usually happens automatically when a thread shuts down, see + * vips__thread_profile_init() where we set a GDestroyNotify, but will not +- * happen for the main thread. ++ * happen for the main thread. + * + * Shut down any stats on the main thread with this, see vips_shutdown() + */ + void +-vips__thread_profile_detach( void ) ++vips__thread_profile_detach(void) + { + VipsThreadProfile *profile; + +- VIPS_DEBUG_MSG( "vips__thread_profile_detach:\n" ); ++ VIPS_DEBUG_MSG("vips__thread_profile_detach:\n"); + +- if( (profile = vips_thread_profile_get()) ) { +- if( vips__thread_profile ) +- vips_thread_profile_save( profile ); ++ if ((profile = vips_thread_profile_get())) { ++ if (vips__thread_profile) ++ vips_thread_profile_save(profile); + +- vips_thread_profile_free( profile ); +- g_private_set( vips_thread_profile_key, NULL ); ++ vips_thread_profile_free(profile); ++ g_private_set(vips_thread_profile_key, NULL); + } + } + + static void +-vips_thread_gate_block_add( VipsThreadGateBlock **block ) ++vips_thread_gate_block_add(VipsThreadGateBlock **block) + { + VipsThreadGateBlock *new_block; + +- new_block = g_new0( VipsThreadGateBlock, 1 ); ++ new_block = g_new0(VipsThreadGateBlock, 1); + new_block->prev = *block; + *block = new_block; + } + + void +-vips__thread_gate_start( const char *gate_name ) ++vips__thread_gate_start(const char *gate_name) + { + VipsThreadProfile *profile; + +- VIPS_DEBUG_MSG_RED( "vips__thread_gate_start: %s\n", gate_name ); ++ VIPS_DEBUG_MSG_RED("vips__thread_gate_start: %s\n", gate_name); + +- if( (profile = vips_thread_profile_get()) ) { ++ if ((profile = vips_thread_profile_get())) { + gint64 time = g_get_monotonic_time(); + + VipsThreadGate *gate; + +- if( !(gate = +- g_hash_table_lookup( profile->gates, gate_name )) ) { +- gate = vips_thread_gate_new( gate_name ); +- g_hash_table_insert( profile->gates, +- (char *) gate_name, gate ); ++ if (!(gate = ++ g_hash_table_lookup(profile->gates, gate_name))) { ++ gate = vips_thread_gate_new(gate_name); ++ g_hash_table_insert(profile->gates, ++ (char *) gate_name, gate); + } + +- if( gate->start->i >= VIPS_GATE_SIZE ) +- vips_thread_gate_block_add( &gate->start ); ++ if (gate->start->i >= VIPS_GATE_SIZE) ++ vips_thread_gate_block_add(&gate->start); + + gate->start->time[gate->start->i++] = time; + +- VIPS_DEBUG_MSG_RED( "\t %" G_GINT64_FORMAT "\n", time ); ++ VIPS_DEBUG_MSG_RED("\t %" G_GINT64_FORMAT "\n", time); + } + } + + void +-vips__thread_gate_stop( const char *gate_name ) ++vips__thread_gate_stop(const char *gate_name) + { + VipsThreadProfile *profile; + +- VIPS_DEBUG_MSG_RED( "vips__thread_gate_stop: %s\n", gate_name ); ++ VIPS_DEBUG_MSG_RED("vips__thread_gate_stop: %s\n", gate_name); + +- if( (profile = vips_thread_profile_get()) ) { ++ if ((profile = vips_thread_profile_get())) { + gint64 time = g_get_monotonic_time(); + + VipsThreadGate *gate; + +- if( !(gate = +- g_hash_table_lookup( profile->gates, gate_name )) ) { +- gate = vips_thread_gate_new( gate_name ); +- g_hash_table_insert( profile->gates, +- (char *) gate_name, gate ); ++ if (!(gate = ++ g_hash_table_lookup(profile->gates, gate_name))) { ++ gate = vips_thread_gate_new(gate_name); ++ g_hash_table_insert(profile->gates, ++ (char *) gate_name, gate); + } + +- if( gate->stop->i >= VIPS_GATE_SIZE ) +- vips_thread_gate_block_add( &gate->stop ); ++ if (gate->stop->i >= VIPS_GATE_SIZE) ++ vips_thread_gate_block_add(&gate->stop); + + gate->stop->time[gate->stop->i++] = time; + +- VIPS_DEBUG_MSG_RED( "\t %" G_GINT64_FORMAT "\n", time ); ++ VIPS_DEBUG_MSG_RED("\t %" G_GINT64_FORMAT "\n", time); + } + } + + /* Record a malloc() or free(). Use -ve numbers for free. + */ + void +-vips__thread_malloc_free( gint64 size ) ++vips__thread_malloc_free(gint64 size) + { + VipsThreadProfile *profile; + +- VIPS_DEBUG_MSG_RED( "vips__thread_malloc_free: %zd\n", size ); ++ VIPS_DEBUG_MSG_RED("vips__thread_malloc_free: %zd\n", size); + + #ifdef VIPS_DEBUG +- if( !(profile = vips_thread_profile_get()) ) +- printf( "argh no block to record free() in!\n" ); ++ if (!(profile = vips_thread_profile_get())) ++ printf("argh no block to record free() in!\n"); + #endif /*VIPS_DEBUG*/ + +- if( (profile = vips_thread_profile_get()) ) { ++ if ((profile = vips_thread_profile_get())) { + gint64 time = g_get_monotonic_time(); + VipsThreadGate *gate = profile->memory; + +- if( gate->start->i >= VIPS_GATE_SIZE ) { +- vips_thread_gate_block_add( &gate->start ); +- vips_thread_gate_block_add( &gate->stop ); ++ if (gate->start->i >= VIPS_GATE_SIZE) { ++ vips_thread_gate_block_add(&gate->start); ++ vips_thread_gate_block_add(&gate->stop); + } + + gate->start->time[gate->start->i++] = time; +diff --git a/libvips/iofuncs/generate.c b/libvips/iofuncs/generate.c +index 1de9939924..575dd358cb 100644 +--- a/libvips/iofuncs/generate.c ++++ b/libvips/iofuncs/generate.c +@@ -1,5 +1,5 @@ + /* Manage pipelines of partial images. +- * ++ * + * J.Cupitt, 17/4/93. + * 1/7/93 JC + * - adapted for partial v2 +@@ -57,28 +57,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -115,11 +115,11 @@ + * SECTION: generate + * @short_description: calculate pixels and pixel buffers + * @stability: Stable +- * @see_also: VipsImage, ++ * @see_also: VipsImage, + * VipsRegion + * @include: vips/vips.h + * +- * These functions let you attach generate functions to images ++ * These functions let you attach generate functions to images + * and ask for regions of images to be calculated. + */ + +@@ -129,69 +129,69 @@ + + /* Make an upstream/downstream link. upstream is one of downstream's inputs. + */ +-static void +-vips__link_make( VipsImage *image_up, VipsImage *image_down ) ++static void ++vips__link_make(VipsImage *image_up, VipsImage *image_down) + { +- g_assert( image_up ); +- g_assert( image_down ); ++ g_assert(image_up); ++ g_assert(image_down); + +- image_up->downstream = +- g_slist_prepend( image_up->downstream, image_down ); +- image_down->upstream = +- g_slist_prepend( image_down->upstream, image_up ); ++ image_up->downstream = ++ g_slist_prepend(image_up->downstream, image_down); ++ image_down->upstream = ++ g_slist_prepend(image_down->upstream, image_up); + + /* Propogate the progress indicator. + */ +- if( image_up->progress_signal && +- !image_down->progress_signal ) ++ if (image_up->progress_signal && ++ !image_down->progress_signal) + image_down->progress_signal = image_up->progress_signal; + } + + static void * +-vips__link_break( VipsImage *image_up, VipsImage *image_down, void *b ) ++vips__link_break(VipsImage *image_up, VipsImage *image_down, void *b) + { +- g_assert( image_up ); +- g_assert( image_down ); ++ g_assert(image_up); ++ g_assert(image_down); + +- g_assert( g_slist_find( image_up->downstream, image_down ) ); +- g_assert( g_slist_find( image_down->upstream, image_up ) ); ++ g_assert(g_slist_find(image_up->downstream, image_down)); ++ g_assert(g_slist_find(image_down->upstream, image_up)); + +- image_up->downstream = +- g_slist_remove( image_up->downstream, image_down ); +- image_down->upstream = +- g_slist_remove( image_down->upstream, image_up ); ++ image_up->downstream = ++ g_slist_remove(image_up->downstream, image_down); ++ image_down->upstream = ++ g_slist_remove(image_down->upstream, image_up); + + /* Unlink the progress chain. + */ +- if( image_down->progress_signal && +- image_down->progress_signal == image_up->progress_signal ) ++ if (image_down->progress_signal && ++ image_down->progress_signal == image_up->progress_signal) + image_down->progress_signal = NULL; + +- return( NULL ); ++ return (NULL); + } + + static void * +-vips__link_break_rev( VipsImage *image_down, VipsImage *image_up, void *b ) ++vips__link_break_rev(VipsImage *image_down, VipsImage *image_up, void *b) + { +- return( vips__link_break( image_up, image_down, b ) ); ++ return (vips__link_break(image_up, image_down, b)); + } + + /* A VipsImage is going ... break all links. + */ + void +-vips__link_break_all( VipsImage *image ) ++vips__link_break_all(VipsImage *image) + { +- g_mutex_lock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); + +- vips_slist_map2( image->upstream, +- (VipsSListMap2Fn) vips__link_break, image, NULL ); +- vips_slist_map2( image->downstream, +- (VipsSListMap2Fn) vips__link_break_rev, image, NULL ); ++ vips_slist_map2(image->upstream, ++ (VipsSListMap2Fn) vips__link_break, image, NULL); ++ vips_slist_map2(image->downstream, ++ (VipsSListMap2Fn) vips__link_break_rev, image, NULL); + +- g_assert( !image->upstream ); +- g_assert( !image->downstream ); ++ g_assert(!image->upstream); ++ g_assert(!image->downstream); + +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_unlock(vips__global_lock); + } + + typedef struct _LinkMap { +@@ -203,38 +203,37 @@ typedef struct _LinkMap { + } LinkMap; + + static void * +-vips__link_mapp( VipsImage *image, LinkMap *map, void *b ) ++vips__link_mapp(VipsImage *image, LinkMap *map, void *b) + { + void *res; + + /* Loop? + */ +- if( image->serial == map->serial ) +- return( NULL ); ++ if (image->serial == map->serial) ++ return (NULL); + image->serial = map->serial; + +- if( (res = map->fn( image, map->a, map->b )) ) +- return( res ); ++ if ((res = map->fn(image, map->a, map->b))) ++ return (res); + +- return( vips_slist_map2( map->upstream ? +- image->upstream : image->downstream, +- (VipsSListMap2Fn) vips__link_mapp, map, NULL ) ); ++ return (vips_slist_map2(map->upstream ? image->upstream : image->downstream, ++ (VipsSListMap2Fn) vips__link_mapp, map, NULL)); + } + + static void * +-vips__link_map_cb( VipsImage *image, GSList **images, void *b ) ++vips__link_map_cb(VipsImage *image, GSList **images, void *b) + { +- *images = g_slist_prepend( *images, image ); ++ *images = g_slist_prepend(*images, image); + +- return( NULL ); ++ return (NULL); + } + +-/* Apply a function to an image and all upstream or downstream images, +- * direct and indirect. ++/* Apply a function to an image and all upstream or downstream images, ++ * direct and indirect. + */ + void * +-vips__link_map( VipsImage *image, gboolean upstream, +- VipsSListMap2Fn fn, void *a, void *b ) ++vips__link_map(VipsImage *image, gboolean upstream, ++ VipsSListMap2Fn fn, void *a, void *b) + { + static int serial = 0; + +@@ -246,7 +245,7 @@ vips__link_map( VipsImage *image, gboolean upstream, + images = NULL; + + /* The function might do anything, including removing images +- * or invalidating other images, so we can't trigger them from within ++ * or invalidating other images, so we can't trigger them from within + * the image loop. Instead we collect a list of images, ref them, + * run the functions, and unref. + */ +@@ -260,41 +259,41 @@ vips__link_map( VipsImage *image, gboolean upstream, + * member. There will be intense confusion if two threads try to do + * this at the same time. + */ +- g_mutex_lock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); + + serial += 1; + map.serial = serial; + +- vips__link_mapp( image, &map, NULL ); ++ vips__link_mapp(image, &map, NULL); + +- for( p = images; p; p = p->next ) +- g_object_ref( p->data ); ++ for (p = images; p; p = p->next) ++ g_object_ref(p->data); + +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_unlock(vips__global_lock); + +- result = vips_slist_map2( images, fn, a, b ); ++ result = vips_slist_map2(images, fn, a, b); + +- for( p = images; p; p = p->next ) +- g_object_unref( p->data ); +- g_slist_free( images ); ++ for (p = images; p; p = p->next) ++ g_object_unref(p->data); ++ g_slist_free(images); + +- return( result ); ++ return (result); + } + + /* We have to have this as a separate entry point so we can support the old + * vips7 API. + */ +-void +-vips__demand_hint_array( VipsImage *image, +- VipsDemandStyle hint, VipsImage **in ) ++void ++vips__demand_hint_array(VipsImage *image, ++ VipsDemandStyle hint, VipsImage **in) + { + int i, len, nany; + VipsDemandStyle set_hint; + + /* How many input images are there? And how many are ANY? + */ +- for( i = 0, len = 0, nany = 0; in[i]; i++, len++ ) +- if( in[i]->dhint == VIPS_DEMAND_STYLE_ANY ) ++ for (i = 0, len = 0, nany = 0; in[i]; i++, len++) ++ if (in[i]->dhint == VIPS_DEMAND_STYLE_ANY) + nany++; + + /* Find the most restrictive of all the hints available to us. +@@ -306,32 +305,31 @@ vips__demand_hint_array( VipsImage *image, + * FATSTRIP. + */ + set_hint = hint; +- for( i = 0; i < len; i++ ) +- set_hint = (VipsDemandStyle) VIPS_MIN( +- (int) set_hint, (int) in[i]->dhint ); ++ for (i = 0; i < len; i++) ++ set_hint = (VipsDemandStyle) VIPS_MIN( ++ (int) set_hint, (int) in[i]->dhint); + + image->dhint = set_hint; + + #ifdef DEBUG +- printf( "vips_image_pipeline_array: set dhint for \"%s\" to %s\n", +- image->filename, +- vips_enum_nick( VIPS_TYPE_DEMAND_STYLE, image->dhint ) ); +- printf( "\toperation requested %s\n", +- vips_enum_nick( VIPS_TYPE_DEMAND_STYLE, hint ) ); +- printf( "\tinputs were:\n" ); +- printf( "\t" ); +- for( i = 0; in[i]; i++ ) +- printf( "%s ", vips_enum_nick( VIPS_TYPE_DEMAND_STYLE, +- in[i]->dhint ) ); +- printf( "\n" ); ++ printf("vips_image_pipeline_array: set dhint for \"%s\" to %s\n", ++ image->filename, ++ vips_enum_nick(VIPS_TYPE_DEMAND_STYLE, image->dhint)); ++ printf("\toperation requested %s\n", ++ vips_enum_nick(VIPS_TYPE_DEMAND_STYLE, hint)); ++ printf("\tinputs were:\n"); ++ printf("\t"); ++ for (i = 0; in[i]; i++) ++ printf("%s ", vips_enum_nick(VIPS_TYPE_DEMAND_STYLE, in[i]->dhint)); ++ printf("\n"); + #endif /*DEBUG*/ + + /* im depends on all these ims. + */ +- g_mutex_lock( vips__global_lock ); +- for( i = 0; i < len; i++ ) +- vips__link_make( in[i], image ); +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); ++ for (i = 0; i < len; i++) ++ vips__link_make(in[i], image); ++ g_mutex_unlock(vips__global_lock); + + /* Set a flag on the image to say we remembered to call this thing. + * vips_image_generate() and friends check this. +@@ -340,10 +338,10 @@ vips__demand_hint_array( VipsImage *image, + } + + /** +- * vips_image_pipeline_array: ++ * vips_image_pipeline_array: + * @image: (out): output image + * @hint: demand hint for @image +- * @in: (array zero-terminated=1): %NULL-terminated array of input images ++ * @in: (array zero-terminated=1): %NULL-terminated array of input images + * + * Add an image to a pipeline. @image depends on all of the images in @in, + * @image prefers to supply pixels according to @hint. +@@ -351,11 +349,11 @@ vips__demand_hint_array( VipsImage *image, + * Operations can set demand hints, that is, hints to the VIPS IO system about + * the type of region geometry they work best with. For example, + * operations which transform coordinates will usually work best with +- * %VIPS_DEMAND_STYLE_SMALLTILE, operations which work on local windows of ++ * %VIPS_DEMAND_STYLE_SMALLTILE, operations which work on local windows of + * pixels will like %VIPS_DEMAND_STYLE_FATSTRIP. + * + * Header fields in @image are set from the fields in @in, with lower-numbered +- * images in @in taking priority. ++ * images in @in taking priority. + * For example, if @in[0] and @in[1] both have an item + * called "icc-profile", it's the profile attached to @in[0] that will end up + * on @image. +@@ -365,15 +363,15 @@ vips__demand_hint_array( VipsImage *image, + * pipeline. + * + * VIPS uses the list of input images to build the tree of operations it needs +- * for the cache invalidation system. ++ * for the cache invalidation system. + * + * See also: vips_image_pipelinev(), vips_image_generate(). + * + * Returns: 0 on success, -1 on error. + */ +-int +-vips_image_pipeline_array( VipsImage *image, +- VipsDemandStyle hint, VipsImage **in ) ++int ++vips_image_pipeline_array(VipsImage *image, ++ VipsDemandStyle hint, VipsImage **in) + { + /* This function can be called more than once per output image. For + * example, jpeg header load will call this once on ->out to set the +@@ -383,49 +381,50 @@ vips_image_pipeline_array( VipsImage *image, + * It's only ever called first time with in[0] == NULL and second time + * with a real value for @in. + */ +- vips__demand_hint_array( image, hint, in ); ++ vips__demand_hint_array(image, hint, in); + +- if( in[0] && +- vips__image_copy_fields_array( image, in ) ) +- return( -1 ); ++ if (in[0] && ++ vips__image_copy_fields_array(image, in)) ++ return (-1); + +- if( vips__reorder_set_input( image, in ) ) +- return( -1 ); ++ if (vips__reorder_set_input(image, in)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /** + * vips_image_pipelinev: + * @image: output image of pipeline + * @hint: hint for this image +- * @...: %NULL-terminated list of input images ++ * @...: %NULL-terminated list of input images + * + * Build an array and call vips_image_pipeline_array(). + * + * See also: vips_image_generate(). + */ +-int +-vips_image_pipelinev( VipsImage *image, VipsDemandStyle hint, ... ) ++int ++vips_image_pipelinev(VipsImage *image, VipsDemandStyle hint, ...) + { + va_list ap; + int i; + VipsImage *ar[MAX_IMAGES]; + +- va_start( ap, hint ); +- for( i = 0; i < MAX_IMAGES && +- (ar[i] = va_arg( ap, VipsImage * )); i++ ) ++ va_start(ap, hint); ++ for (i = 0; i < MAX_IMAGES && ++ (ar[i] = va_arg(ap, VipsImage *)); ++ i++) + ; +- va_end( ap ); +- if( i == MAX_IMAGES ) { +- g_warning( "%s", _( "too many images" ) ); ++ va_end(ap); ++ if (i == MAX_IMAGES) { ++ g_warning("%s", _("too many images")); + + /* Make sure we have a sentinel there. + */ + ar[i - 1] = NULL; + } + +- return( vips_image_pipeline_array( image, hint, ar ) ); ++ return (vips_image_pipeline_array(image, hint, ar)); + } + + /** +@@ -439,11 +438,11 @@ vips_image_pipelinev( VipsImage *image, VipsDemandStyle hint, ... ) + * See also: vips_image_generate(). + */ + void * +-vips_start_one( VipsImage *out, void *a, void *b ) ++vips_start_one(VipsImage *out, void *a, void *b) + { + VipsImage *in = (VipsImage *) a; + +- return( vips_region_new( in ) ); ++ return (vips_region_new(in)); + } + + /** +@@ -457,13 +456,13 @@ vips_start_one( VipsImage *out, void *a, void *b ) + * See also: vips_image_generate(). + */ + int +-vips_stop_one( void *seq, void *a, void *b ) ++vips_stop_one(void *seq, void *a, void *b) + { + VipsRegion *reg = (VipsRegion *) seq; + +- g_object_unref( reg ); ++ g_object_unref(reg); + +- return( 0 ); ++ return (0); + } + + /** +@@ -472,25 +471,25 @@ vips_stop_one( void *seq, void *a, void *b ) + * @a: user data + * @b: user data + * +- * Stop function for many images in. @a is a pointer to ++ * Stop function for many images in. @a is a pointer to + * a %NULL-terminated array of input images. + * + * See also: vips_image_generate(). + */ + int +-vips_stop_many( void *seq, void *a, void *b ) ++vips_stop_many(void *seq, void *a, void *b) + { + VipsRegion **ar = (VipsRegion **) seq; + +- if( ar ) { ++ if (ar) { + int i; + +- for( i = 0; ar[i]; i++ ) +- g_object_unref( ar[i] ); +- g_free( (char *) ar ); ++ for (i = 0; ar[i]; i++) ++ g_object_unref(ar[i]); ++ g_free((char *) ar); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -499,13 +498,13 @@ vips_stop_many( void *seq, void *a, void *b ) + * @a: user data + * @b: user data + * +- * Start function for many images in. @a is a pointer to ++ * Start function for many images in. @a is a pointer to + * a %NULL-terminated array of input images. + * + * See also: vips_image_generate(), vips_allocate_input_array() + */ + void * +-vips_start_many( VipsImage *out, void *a, void *b ) ++vips_start_many(VipsImage *out, void *a, void *b) + { + VipsImage **in = (VipsImage **) a; + +@@ -514,24 +513,24 @@ vips_start_many( VipsImage *out, void *a, void *b ) + + /* How many images? + */ +- for( n = 0; in[n]; n++ ) ++ for (n = 0; in[n]; n++) + ; + + /* Alocate space for region array. + */ +- if( !(ar = VIPS_ARRAY( NULL, n + 1, VipsRegion * )) ) +- return( NULL ); ++ if (!(ar = VIPS_ARRAY(NULL, n + 1, VipsRegion *))) ++ return (NULL); + + /* Create a set of regions. + */ +- for( i = 0; i < n; i++ ) +- if( !(ar[i] = vips_region_new( in[i] )) ) { +- vips_stop_many( ar, NULL, NULL ); +- return( NULL ); ++ for (i = 0; i < n; i++) ++ if (!(ar[i] = vips_region_new(in[i]))) { ++ vips_stop_many(ar, NULL, NULL); ++ return (NULL); + } + ar[n] = NULL; + +- return( ar ); ++ return (ar); + } + + /** +@@ -547,7 +546,7 @@ vips_start_many( VipsImage *out, void *a, void *b ) + * Returns: %NULL-terminated array of images. Do not free the result. + */ + VipsImage ** +-vips_allocate_input_array( VipsImage *out, ... ) ++vips_allocate_input_array(VipsImage *out, ...) + { + va_list ap; + VipsImage **ar; +@@ -555,25 +554,25 @@ vips_allocate_input_array( VipsImage *out, ... ) + + /* Count input images. + */ +- va_start( ap, out ); +- for( n = 0; va_arg( ap, VipsImage * ); n++ ) ++ va_start(ap, out); ++ for (n = 0; va_arg(ap, VipsImage *); n++) + ; +- va_end( ap ); ++ va_end(ap); + + /* Allocate array. + */ +- if( !(ar = VIPS_ARRAY( out, n + 1, VipsImage * )) ) +- return( NULL ); ++ if (!(ar = VIPS_ARRAY(out, n + 1, VipsImage *))) ++ return (NULL); + + /* Fill array. + */ +- va_start( ap, out ); +- for( i = 0; i < n; i++ ) +- ar[i] = va_arg( ap, VipsImage * ); +- va_end( ap ); ++ va_start(ap, out); ++ for (i = 0; i < n; i++) ++ ar[i] = va_arg(ap, VipsImage *); ++ va_end(ap); + ar[n] = NULL; + +- return( ar ); ++ return (ar); + } + + /** +@@ -599,7 +598,7 @@ vips_allocate_input_array( VipsImage *out, ... ) + * @stop: set this to stop processing + * + * Fill @out->valid with pixels. @seq contains per-thread state, such as the +- * input regions. Set @stop to %TRUE to stop processing. ++ * input regions. Set @stop to %TRUE to stop processing. + * + * See also: vips_image_generate(), vips_stop_many(). + * +@@ -623,24 +622,24 @@ vips_allocate_input_array( VipsImage *out, ... ) + /* A write function for VIPS images. Just write() the pixel data. + */ + static int +-write_vips( VipsRegion *region, VipsRect *area, void *a ) ++write_vips(VipsRegion *region, VipsRect *area, void *a) + { + size_t nwritten, count; + void *buf; + + count = (size_t) region->bpl * area->height; +- buf = VIPS_REGION_ADDR( region, 0, area->top ); ++ buf = VIPS_REGION_ADDR(region, 0, area->top); + + do { +- nwritten = write( region->im->fd, buf, count ); +- if( nwritten == (size_t) -1 ) +- return( errno ); ++ nwritten = write(region->im->fd, buf, count); ++ if (nwritten == (size_t) -1) ++ return (errno); + + buf = (void *) ((char *) buf + nwritten); + count -= nwritten; +- } while( count > 0 ); ++ } while (count > 0); + +- return( 0 ); ++ return (0); + } + + /** +@@ -654,128 +653,128 @@ write_vips( VipsRegion *region, VipsRect *area, void *a ) + * + * Generates an image. The action depends on the image type. + * +- * For images created with vips_image_new(), vips_image_generate() just ++ * For images created with vips_image_new(), vips_image_generate() just + * attaches the start/generate/stop callbacks and returns. + * +- * For images created with vips_image_new_memory(), memory is allocated for ++ * For images created with vips_image_new_memory(), memory is allocated for + * the whole image and it is entirely generated using vips_sink_memory(). + * +- * For images created with vips_image_new_temp_file() and friends, memory for ++ * For images created with vips_image_new_temp_file() and friends, memory for + * a few scanlines is allocated and + * vips_sink_disc() used to generate the image in small chunks. As each + * chunk is generated, it is written to disc. + * +- * See also: vips_sink(), vips_image_new(), vips_region_prepare(). ++ * See also: vips_sink(), vips_image_new(), vips_region_prepare(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_image_generate( VipsImage *image, ++vips_image_generate(VipsImage *image, + VipsStartFn start_fn, VipsGenerateFn generate_fn, VipsStopFn stop_fn, +- void *a, void *b ) ++ void *a, void *b) + { +- int res; ++ int res; + +- VIPS_DEBUG_MSG( "vips_image_generate: %p\n", image ); ++ VIPS_DEBUG_MSG("vips_image_generate: %p\n", image); + +- g_assert( generate_fn ); +- g_assert( vips_object_sanity( VIPS_OBJECT( image ) ) ); ++ g_assert(generate_fn); ++ g_assert(vips_object_sanity(VIPS_OBJECT(image))); + +- if( !image->hint_set ) { +- vips_error( "vips_image_generate", +- "%s", _( "demand hint not set" ) ); +- return( -1 ); ++ if (!image->hint_set) { ++ vips_error("vips_image_generate", ++ "%s", _("demand hint not set")); ++ return (-1); + } + + /* We don't use this, but make sure it's set in case any old binaries + * are expecting it. + */ +- image->Bbits = vips_format_sizeof( image->BandFmt ) << 3; +- +- /* Look at output type to decide our action. +- */ +- switch( image->dtype ) { +- case VIPS_IMAGE_PARTIAL: +- /* Output to partial image. Just attach functions and return. +- */ +- if( image->generate_fn || +- image->start_fn || +- image->stop_fn ) { +- vips_error( "VipsImage", +- "%s", _( "generate() called twice" ) ); +- return( -1 ); +- } +- +- image->start_fn = start_fn; +- image->generate_fn = generate_fn; +- image->stop_fn = stop_fn; +- image->client1 = a; +- image->client2 = b; +- +- VIPS_DEBUG_MSG( "vips_image_generate: " +- "attaching partial callbacks\n" ); +- +- if( vips_image_written( image ) ) +- return( -1 ); +- +- break; +- +- case VIPS_IMAGE_SETBUF: +- case VIPS_IMAGE_SETBUF_FOREIGN: +- case VIPS_IMAGE_MMAPINRW: +- case VIPS_IMAGE_OPENOUT: +- /* Eval now .. sanity check. +- */ +- if( image->generate_fn || +- image->start_fn || +- image->stop_fn ) { +- vips_error( "VipsImage", +- "%s", _( "generate() called twice" ) ); +- return( -1 ); +- } +- +- /* Attach callbacks. +- */ +- image->start_fn = start_fn; +- image->generate_fn = generate_fn; +- image->stop_fn = stop_fn; +- image->client1 = a; +- image->client2 = b; +- +- if( vips_image_write_prepare( image ) ) +- return( -1 ); +- +- if( image->dtype == VIPS_IMAGE_OPENOUT ) +- res = vips_sink_disc( image, write_vips, NULL ); +- else +- res = vips_sink_memory( image ); +- +- /* Error? +- */ +- if( res ) +- return( -1 ); ++ image->Bbits = vips_format_sizeof(image->BandFmt) << 3; ++ ++ /* Look at output type to decide our action. ++ */ ++ switch (image->dtype) { ++ case VIPS_IMAGE_PARTIAL: ++ /* Output to partial image. Just attach functions and return. ++ */ ++ if (image->generate_fn || ++ image->start_fn || ++ image->stop_fn) { ++ vips_error("VipsImage", ++ "%s", _("generate() called twice")); ++ return (-1); ++ } ++ ++ image->start_fn = start_fn; ++ image->generate_fn = generate_fn; ++ image->stop_fn = stop_fn; ++ image->client1 = a; ++ image->client2 = b; ++ ++ VIPS_DEBUG_MSG("vips_image_generate: " ++ "attaching partial callbacks\n"); ++ ++ if (vips_image_written(image)) ++ return (-1); ++ ++ break; ++ ++ case VIPS_IMAGE_SETBUF: ++ case VIPS_IMAGE_SETBUF_FOREIGN: ++ case VIPS_IMAGE_MMAPINRW: ++ case VIPS_IMAGE_OPENOUT: ++ /* Eval now .. sanity check. ++ */ ++ if (image->generate_fn || ++ image->start_fn || ++ image->stop_fn) { ++ vips_error("VipsImage", ++ "%s", _("generate() called twice")); ++ return (-1); ++ } ++ ++ /* Attach callbacks. ++ */ ++ image->start_fn = start_fn; ++ image->generate_fn = generate_fn; ++ image->stop_fn = stop_fn; ++ image->client1 = a; ++ image->client2 = b; ++ ++ if (vips_image_write_prepare(image)) ++ return (-1); ++ ++ if (image->dtype == VIPS_IMAGE_OPENOUT) ++ res = vips_sink_disc(image, write_vips, NULL); ++ else ++ res = vips_sink_memory(image); ++ ++ /* Error? ++ */ ++ if (res) ++ return (-1); + + /* Must come before we rewind. + */ +- if( vips_image_written( image ) ) +- return( -1 ); ++ if (vips_image_written(image)) ++ return (-1); + + /* We've written to image ... rewind it ready for reading. + */ +- if( vips_image_pio_input( image ) ) +- return( -1 ); +- +- break; +- +- default: +- /* Not a known output style. +- */ +- vips_error( "VipsImage", +- _( "unable to output to a %s image" ), +- vips_enum_nick( VIPS_TYPE_IMAGE_TYPE, +- image->dtype ) ); +- return( -1 ); +- } +- +- return( 0 ); ++ if (vips_image_pio_input(image)) ++ return (-1); ++ ++ break; ++ ++ default: ++ /* Not a known output style. ++ */ ++ vips_error("VipsImage", ++ _("unable to output to a %s image"), ++ vips_enum_nick(VIPS_TYPE_IMAGE_TYPE, ++ image->dtype)); ++ return (-1); ++ } ++ ++ return (0); + } +diff --git a/libvips/iofuncs/ginputsource.c b/libvips/iofuncs/ginputsource.c +index dee229ccb2..9c152d94dd 100644 +--- a/libvips/iofuncs/ginputsource.c ++++ b/libvips/iofuncs/ginputsource.c +@@ -1,32 +1,32 @@ +-/* A GInputStream that links to a VipsSource under the hood. ++/* A GInputStream that links to a VipsSource under the hood. + * + * 10/11/19 kleisauke + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -51,11 +51,10 @@ + + #include + +-static void vips_g_input_stream_seekable_iface_init( GSeekableIface *iface ); ++static void vips_g_input_stream_seekable_iface_init(GSeekableIface *iface); + +-G_DEFINE_TYPE_WITH_CODE( VipsGInputStream, vips_g_input_stream, +- G_TYPE_INPUT_STREAM, G_IMPLEMENT_INTERFACE( G_TYPE_SEEKABLE, +- vips_g_input_stream_seekable_iface_init ) ) ++G_DEFINE_TYPE_WITH_CODE(VipsGInputStream, vips_g_input_stream, ++ G_TYPE_INPUT_STREAM, G_IMPLEMENT_INTERFACE(G_TYPE_SEEKABLE, vips_g_input_stream_seekable_iface_init)) + + enum { + PROP_0, +@@ -63,188 +62,188 @@ enum { + }; + + static void +-vips_g_input_stream_get_property( GObject *object, guint prop_id, +- GValue *value, GParamSpec *pspec ) ++vips_g_input_stream_get_property(GObject *object, guint prop_id, ++ GValue *value, GParamSpec *pspec) + { +- VipsGInputStream *gstream = VIPS_G_INPUT_STREAM( object ); ++ VipsGInputStream *gstream = VIPS_G_INPUT_STREAM(object); + +- switch( prop_id ) { ++ switch (prop_id) { + case PROP_STREAM: +- g_value_set_object( value, gstream->source ); ++ g_value_set_object(value, gstream->source); + break; + + default: +- G_OBJECT_WARN_INVALID_PROPERTY_ID( object, prop_id, pspec ); ++ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); + } + } + + static void +-vips_g_input_stream_set_property( GObject *object, guint prop_id, +- const GValue *value, GParamSpec *pspec ) ++vips_g_input_stream_set_property(GObject *object, guint prop_id, ++ const GValue *value, GParamSpec *pspec) + { +- VipsGInputStream *gstream = VIPS_G_INPUT_STREAM( object ); ++ VipsGInputStream *gstream = VIPS_G_INPUT_STREAM(object); + +- switch( prop_id ) { ++ switch (prop_id) { + case PROP_STREAM: +- gstream->source = g_value_dup_object( value ); ++ gstream->source = g_value_dup_object(value); + break; + + default: +- G_OBJECT_WARN_INVALID_PROPERTY_ID( object, prop_id, pspec ); ++ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); + } + } + + static void +-vips_g_input_stream_finalize( GObject *object ) ++vips_g_input_stream_finalize(GObject *object) + { +- VipsGInputStream *gstream = VIPS_G_INPUT_STREAM( object ); ++ VipsGInputStream *gstream = VIPS_G_INPUT_STREAM(object); + +- VIPS_UNREF( gstream->source ); ++ VIPS_UNREF(gstream->source); + +- G_OBJECT_CLASS( vips_g_input_stream_parent_class )->finalize( object ); ++ G_OBJECT_CLASS(vips_g_input_stream_parent_class)->finalize(object); + } + + static goffset +-vips_g_input_stream_tell( GSeekable *seekable ) ++vips_g_input_stream_tell(GSeekable *seekable) + { +- VipsGInputStream *gstream = VIPS_G_INPUT_STREAM( seekable ); ++ VipsGInputStream *gstream = VIPS_G_INPUT_STREAM(seekable); + + goffset pos; + +- VIPS_DEBUG_MSG( "vips_g_input_stream_tell:\n" ); ++ VIPS_DEBUG_MSG("vips_g_input_stream_tell:\n"); + +- pos = vips_source_seek( gstream->source, 0, SEEK_CUR ); +- if( pos == -1 ) +- return( 0 ); ++ pos = vips_source_seek(gstream->source, 0, SEEK_CUR); ++ if (pos == -1) ++ return (0); + +- return( pos ); ++ return (pos); + } + + static gboolean +-vips_g_input_stream_can_seek( GSeekable *seekable ) ++vips_g_input_stream_can_seek(GSeekable *seekable) + { +- VipsGInputStream *gstream = VIPS_G_INPUT_STREAM( seekable ); ++ VipsGInputStream *gstream = VIPS_G_INPUT_STREAM(seekable); + +- VIPS_DEBUG_MSG( "vips_g_input_stream_can_seek: %d\n", +- !gstream->source->is_pipe ); ++ VIPS_DEBUG_MSG("vips_g_input_stream_can_seek: %d\n", ++ !gstream->source->is_pipe); + +- return( !gstream->source->is_pipe ); ++ return (!gstream->source->is_pipe); + } + + static int +-seek_type_to_lseek( GSeekType type ) ++seek_type_to_lseek(GSeekType type) + { +- switch( type ) { ++ switch (type) { + default: + case G_SEEK_CUR: +- return( SEEK_CUR ); ++ return (SEEK_CUR); + case G_SEEK_SET: +- return( SEEK_SET ); ++ return (SEEK_SET); + case G_SEEK_END: +- return( SEEK_END ); ++ return (SEEK_END); + } + } + + static gboolean +-vips_g_input_stream_seek( GSeekable *seekable, goffset offset, +- GSeekType type, GCancellable *cancellable, GError **error ) ++vips_g_input_stream_seek(GSeekable *seekable, goffset offset, ++ GSeekType type, GCancellable *cancellable, GError **error) + { +- VipsGInputStream *gstream = VIPS_G_INPUT_STREAM( seekable ); ++ VipsGInputStream *gstream = VIPS_G_INPUT_STREAM(seekable); + +- VIPS_DEBUG_MSG( "vips_g_input_stream_seek: offset = %" G_GINT64_FORMAT +- ", type = %d\n", offset, type ); ++ VIPS_DEBUG_MSG("vips_g_input_stream_seek: offset = %" G_GINT64_FORMAT ++ ", type = %d\n", ++ offset, type); + +- if( vips_source_seek( gstream->source, offset, +- seek_type_to_lseek( type ) ) == -1 ) { +- g_set_error( error, G_IO_ERROR, ++ if (vips_source_seek(gstream->source, offset, ++ seek_type_to_lseek(type)) == -1) { ++ g_set_error(error, G_IO_ERROR, + G_IO_ERROR_FAILED, +- _( "Error while seeking: %s" ), +- vips_error_buffer() ); +- return( FALSE ); ++ _("Error while seeking: %s"), ++ vips_error_buffer()); ++ return (FALSE); + } + +- +- return( TRUE ); ++ return (TRUE); + } + + static gboolean +-vips_g_input_stream_can_truncate( GSeekable *seekable ) ++vips_g_input_stream_can_truncate(GSeekable *seekable) + { +- return( FALSE ); ++ return (FALSE); + } + + static gboolean +-vips_g_input_stream_truncate( GSeekable *seekable, goffset offset, +- GCancellable *cancellable, GError **error ) ++vips_g_input_stream_truncate(GSeekable *seekable, goffset offset, ++ GCancellable *cancellable, GError **error) + { +- g_set_error_literal( error, ++ g_set_error_literal(error, + G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, +- _( "Cannot truncate VipsGInputStream" ) ); ++ _("Cannot truncate VipsGInputStream")); + +- return( FALSE ); ++ return (FALSE); + } + + static gssize +-vips_g_input_stream_read( GInputStream *stream, void *buffer, gsize count, +- GCancellable *cancellable, GError **error ) ++vips_g_input_stream_read(GInputStream *stream, void *buffer, gsize count, ++ GCancellable *cancellable, GError **error) + { +- VipsGInputStream *gstream = VIPS_G_INPUT_STREAM( stream ); ++ VipsGInputStream *gstream = VIPS_G_INPUT_STREAM(stream); + + gssize res; + +- VIPS_DEBUG_MSG( "vips_g_input_stream_read: count: %zd\n", count ); ++ VIPS_DEBUG_MSG("vips_g_input_stream_read: count: %zd\n", count); + +- if( g_cancellable_set_error_if_cancelled( cancellable, error ) ) +- return( -1 ); ++ if (g_cancellable_set_error_if_cancelled(cancellable, error)) ++ return (-1); + +- if( (res = vips_source_read( gstream->source, buffer, count )) == -1 ) +- g_set_error( error, G_IO_ERROR, ++ if ((res = vips_source_read(gstream->source, buffer, count)) == -1) ++ g_set_error(error, G_IO_ERROR, + G_IO_ERROR_FAILED, +- _( "Error while reading: %s" ), +- vips_error_buffer() ); ++ _("Error while reading: %s"), ++ vips_error_buffer()); + +- return( res ); ++ return (res); + } + + static gssize +-vips_g_input_stream_skip( GInputStream *stream, gsize count, +- GCancellable *cancellable, GError **error ) ++vips_g_input_stream_skip(GInputStream *stream, gsize count, ++ GCancellable *cancellable, GError **error) + { +- VipsGInputStream *gstream = VIPS_G_INPUT_STREAM( stream ); ++ VipsGInputStream *gstream = VIPS_G_INPUT_STREAM(stream); + + gssize position; + +- VIPS_DEBUG_MSG( "vips_g_input_stream_skip: count: %zd\n", count ); ++ VIPS_DEBUG_MSG("vips_g_input_stream_skip: count: %zd\n", count); + +- if( g_cancellable_set_error_if_cancelled( cancellable, error ) ) +- return( -1 ); ++ if (g_cancellable_set_error_if_cancelled(cancellable, error)) ++ return (-1); + +- position = vips_source_seek( gstream->source, count, SEEK_CUR ); +- if( position == -1 ) { +- g_set_error( error, G_IO_ERROR, ++ position = vips_source_seek(gstream->source, count, SEEK_CUR); ++ if (position == -1) { ++ g_set_error(error, G_IO_ERROR, + G_IO_ERROR_FAILED, +- _( "Error while seeking: %s" ), +- vips_error_buffer() ); +- return( -1 ); ++ _("Error while seeking: %s"), ++ vips_error_buffer()); ++ return (-1); + } + +- return( position ); ++ return (position); + } + + static gboolean +-vips_g_input_stream_close( GInputStream *stream, +- GCancellable *cancellable, GError **error ) ++vips_g_input_stream_close(GInputStream *stream, ++ GCancellable *cancellable, GError **error) + { +- VipsGInputStream *gstream = VIPS_G_INPUT_STREAM( stream ); ++ VipsGInputStream *gstream = VIPS_G_INPUT_STREAM(stream); + +- vips_source_minimise( gstream->source ); ++ vips_source_minimise(gstream->source); + +- return( TRUE ); ++ return (TRUE); + } + + static void +-vips_g_input_stream_seekable_iface_init( GSeekableIface *iface ) ++vips_g_input_stream_seekable_iface_init(GSeekableIface *iface) + { + iface->tell = vips_g_input_stream_tell; + iface->can_seek = vips_g_input_stream_can_seek; +@@ -254,10 +253,10 @@ vips_g_input_stream_seekable_iface_init( GSeekableIface *iface ) + } + + static void +-vips_g_input_stream_class_init( VipsGInputStreamClass *class ) ++vips_g_input_stream_class_init(VipsGInputStreamClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- GInputStreamClass *istream_class = G_INPUT_STREAM_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ GInputStreamClass *istream_class = G_INPUT_STREAM_CLASS(class); + + gobject_class->finalize = vips_g_input_stream_finalize; + gobject_class->get_property = vips_g_input_stream_get_property; +@@ -267,17 +266,15 @@ vips_g_input_stream_class_init( VipsGInputStreamClass *class ) + istream_class->skip = vips_g_input_stream_skip; + istream_class->close_fn = vips_g_input_stream_close; + +- g_object_class_install_property( gobject_class, PROP_STREAM, +- g_param_spec_object( "input", +- _( "Input" ), +- _( "Stream to wrap" ), +- VIPS_TYPE_SOURCE, G_PARAM_CONSTRUCT_ONLY | +- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS ) ); +- ++ g_object_class_install_property(gobject_class, PROP_STREAM, ++ g_param_spec_object("input", ++ _("Input"), ++ _("Stream to wrap"), ++ VIPS_TYPE_SOURCE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + } + + static void +-vips_g_input_stream_init( VipsGInputStream *gstream ) ++vips_g_input_stream_init(VipsGInputStream *gstream) + { + } + +@@ -291,9 +288,9 @@ vips_g_input_stream_init( VipsGInputStream *gstream ) + * Returns: a new #GInputStream + */ + GInputStream * +-vips_g_input_stream_new_from_source( VipsSource *source ) ++vips_g_input_stream_new_from_source(VipsSource *source) + { +- return( g_object_new( VIPS_TYPE_G_INPUT_STREAM, ++ return (g_object_new(VIPS_TYPE_G_INPUT_STREAM, + "input", source, +- NULL ) ); ++ NULL)); + } +diff --git a/libvips/iofuncs/header.c b/libvips/iofuncs/header.c +index 49f46b8ba1..c41278b1e5 100644 +--- a/libvips/iofuncs/header.c ++++ b/libvips/iofuncs/header.c +@@ -42,28 +42,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -100,9 +100,9 @@ + * @include: vips/vips.h + * + * These functions let you get at image header data (including metadata) in a +- * uniform way. ++ * uniform way. + * +- * Use vips_image_get_typeof() to test for the ++ * Use vips_image_get_typeof() to test for the + * existence and #GType of a header field. + * + * You can attach arbitrary metadata to images. Metadata is copied as images +@@ -112,8 +112,8 @@ + * large items of data. This does however mean that metadata items need to be + * immutable. Metadata is handy for things like ICC profiles or EXIF data. + * +- * Various convenience functions (eg. vips_image_set_int()) let you easily +- * attach ++ * Various convenience functions (eg. vips_image_set_int()) let you easily ++ * attach + * simple types like + * numbers, strings and memory blocks to images. Use vips_image_map() to loop + * over an image's fields, including all metadata. +@@ -130,8 +130,8 @@ + * VIPS metadata is based on %GValue. See the docs for that system if you want + * to do fancy stuff such as defining a new metadata type. + * VIPS defines a new %GValue called `vips_save_string`, a variety of string, +- * see vips_value_set_save_string(). +- * If your %GValue can be transformed to `vips_save_string`, it will be ++ * see vips_value_set_save_string(). ++ * If your %GValue can be transformed to `vips_save_string`, it will be + * saved and loaded to and from VIPS files for you. + * + * VIPS provides a couple of base classes which implement +@@ -139,7 +139,7 @@ + * these types, it can be copied between images efficiently. + */ + +-/* Use in various small places where we need a mutex and it's not worth ++/* Use in various small places where we need a mutex and it's not worth + * making a private one. + */ + static GMutex *vips__meta_lock = NULL; +@@ -155,56 +155,56 @@ typedef struct _HeaderField { + /* Built in fields and struct offsets. + */ + static HeaderField vips_header_fields[] = { +- { "width", "gint", G_STRUCT_OFFSET( VipsImage, Xsize ) }, +- { "height", "gint", G_STRUCT_OFFSET( VipsImage, Ysize ) }, +- { "bands", "gint", G_STRUCT_OFFSET( VipsImage, Bands ) }, +- { "format", "VipsBandFormat", G_STRUCT_OFFSET( VipsImage, BandFmt ) }, +- { "coding", "VipsCoding", G_STRUCT_OFFSET( VipsImage, Coding ) }, +- { "interpretation", "VipsInterpretation", +- G_STRUCT_OFFSET( VipsImage, Type ) }, +- { "xoffset", "gint", G_STRUCT_OFFSET( VipsImage, Xoffset ) }, +- { "yoffset", "gint", G_STRUCT_OFFSET( VipsImage, Yoffset ) }, +- { "xres", "gdouble", G_STRUCT_OFFSET( VipsImage, Xres ) }, +- { "yres", "gdouble", G_STRUCT_OFFSET( VipsImage, Yres ) }, +- { "filename", "gchararray", G_STRUCT_OFFSET( VipsImage, filename ) } ++ { "width", "gint", G_STRUCT_OFFSET(VipsImage, Xsize) }, ++ { "height", "gint", G_STRUCT_OFFSET(VipsImage, Ysize) }, ++ { "bands", "gint", G_STRUCT_OFFSET(VipsImage, Bands) }, ++ { "format", "VipsBandFormat", G_STRUCT_OFFSET(VipsImage, BandFmt) }, ++ { "coding", "VipsCoding", G_STRUCT_OFFSET(VipsImage, Coding) }, ++ { "interpretation", "VipsInterpretation", ++ G_STRUCT_OFFSET(VipsImage, Type) }, ++ { "xoffset", "gint", G_STRUCT_OFFSET(VipsImage, Xoffset) }, ++ { "yoffset", "gint", G_STRUCT_OFFSET(VipsImage, Yoffset) }, ++ { "xres", "gdouble", G_STRUCT_OFFSET(VipsImage, Xres) }, ++ { "yres", "gdouble", G_STRUCT_OFFSET(VipsImage, Yres) }, ++ { "filename", "gchararray", G_STRUCT_OFFSET(VipsImage, filename) } + }; + + /* Old names we keep around for back-compat. We never loop over these with + * map, but we do check them when we look up fields by name. + */ + static HeaderField vips_header_fields_old[] = { +- { "Xsize", "gint", G_STRUCT_OFFSET( VipsImage, Xsize ) }, +- { "Ysize", "gint", G_STRUCT_OFFSET( VipsImage, Ysize ) }, +- { "Bands", "gint", G_STRUCT_OFFSET( VipsImage, Bands ) }, +- { "Bbits", "gint", G_STRUCT_OFFSET( VipsImage, Bbits ) }, +- { "BandFmt", "gint", G_STRUCT_OFFSET( VipsImage, BandFmt ) }, +- { "Coding", "gint", G_STRUCT_OFFSET( VipsImage, Coding ) }, +- { "Type", "gint", G_STRUCT_OFFSET( VipsImage, Type ) }, +- { "Xoffset", "gint", G_STRUCT_OFFSET( VipsImage, Xoffset ) }, +- { "Yoffset", "gint", G_STRUCT_OFFSET( VipsImage, Yoffset ) }, +- { "Xres", "gdouble", G_STRUCT_OFFSET( VipsImage, Xres ) }, +- { "Yres", "gdouble", G_STRUCT_OFFSET( VipsImage, Yres ) } ++ { "Xsize", "gint", G_STRUCT_OFFSET(VipsImage, Xsize) }, ++ { "Ysize", "gint", G_STRUCT_OFFSET(VipsImage, Ysize) }, ++ { "Bands", "gint", G_STRUCT_OFFSET(VipsImage, Bands) }, ++ { "Bbits", "gint", G_STRUCT_OFFSET(VipsImage, Bbits) }, ++ { "BandFmt", "gint", G_STRUCT_OFFSET(VipsImage, BandFmt) }, ++ { "Coding", "gint", G_STRUCT_OFFSET(VipsImage, Coding) }, ++ { "Type", "gint", G_STRUCT_OFFSET(VipsImage, Type) }, ++ { "Xoffset", "gint", G_STRUCT_OFFSET(VipsImage, Xoffset) }, ++ { "Yoffset", "gint", G_STRUCT_OFFSET(VipsImage, Yoffset) }, ++ { "Xres", "gdouble", G_STRUCT_OFFSET(VipsImage, Xres) }, ++ { "Yres", "gdouble", G_STRUCT_OFFSET(VipsImage, Yres) } + }; + + /* This is used by (eg.) VIPS_IMAGE_SIZEOF_ELEMENT() to calculate object +- * size via vips_format_sizeof(). ++ * size via vips_format_sizeof(). + * +- * It needs to be guint64 and not size_t since we use this as the basis for +- * image address calcs and they have to be 64-bit, even on 32-bit machines. ++ * It needs to be guint64 and not size_t since we use this as the basis for ++ * image address calcs and they have to be 64-bit, even on 32-bit machines. + * + * Can't be static, we need this to be visible for vips7 compat. + */ + const guint64 vips__image_sizeof_bandformat[] = { +- sizeof( unsigned char ), /* VIPS_FORMAT_UCHAR */ +- sizeof( signed char ), /* VIPS_FORMAT_CHAR */ +- sizeof( unsigned short ), /* VIPS_FORMAT_USHORT */ +- sizeof( unsigned short ), /* VIPS_FORMAT_SHORT */ +- sizeof( unsigned int ), /* VIPS_FORMAT_UINT */ +- sizeof( unsigned int ), /* VIPS_FORMAT_INT */ +- sizeof( float ), /* VIPS_FORMAT_FLOAT */ +- 2 * sizeof( float ), /* VIPS_FORMAT_COMPLEX */ +- sizeof( double ), /* VIPS_FORMAT_DOUBLE */ +- 2 * sizeof( double ) /* VIPS_FORMAT_DPCOMPLEX */ ++ sizeof(unsigned char), /* VIPS_FORMAT_UCHAR */ ++ sizeof(signed char), /* VIPS_FORMAT_CHAR */ ++ sizeof(unsigned short), /* VIPS_FORMAT_USHORT */ ++ sizeof(unsigned short), /* VIPS_FORMAT_SHORT */ ++ sizeof(unsigned int), /* VIPS_FORMAT_UINT */ ++ sizeof(unsigned int), /* VIPS_FORMAT_INT */ ++ sizeof(float), /* VIPS_FORMAT_FLOAT */ ++ 2 * sizeof(float), /* VIPS_FORMAT_COMPLEX */ ++ sizeof(double), /* VIPS_FORMAT_DOUBLE */ ++ 2 * sizeof(double) /* VIPS_FORMAT_DPCOMPLEX */ + }; + + /** +@@ -213,12 +213,12 @@ const guint64 vips__image_sizeof_bandformat[] = { + * + * Returns: number of bytes for a band format. + */ +-guint64 +-vips_format_sizeof( VipsBandFormat format ) ++guint64 ++vips_format_sizeof(VipsBandFormat format) + { +- format = VIPS_CLIP( 0, format, VIPS_FORMAT_DPCOMPLEX ); ++ format = VIPS_CLIP(0, format, VIPS_FORMAT_DPCOMPLEX); + +- return( vips__image_sizeof_bandformat[format] ); ++ return (vips__image_sizeof_bandformat[format]); + } + + /** +@@ -230,97 +230,97 @@ vips_format_sizeof( VipsBandFormat format ) + * + * Returns: number of bytes for a band format. + */ +-guint64 +-vips_format_sizeof_unsafe( VipsBandFormat format ) ++guint64 ++vips_format_sizeof_unsafe(VipsBandFormat format) + { +- g_assert( 0 <= format && format <= VIPS_FORMAT_DPCOMPLEX ); ++ g_assert(0 <= format && format <= VIPS_FORMAT_DPCOMPLEX); + +- return( vips__image_sizeof_bandformat[format] ); ++ return (vips__image_sizeof_bandformat[format]); + } + + #ifdef DEBUG + /* Check that this meta is on the hash table. + */ + static void * +-meta_sanity_on_hash( VipsMeta *meta, VipsImage *im, void *b ) ++meta_sanity_on_hash(VipsMeta *meta, VipsImage *im, void *b) + { + VipsMeta *found; + +- if( meta->im != im ) +- printf( "*** field \"%s\" has incorrect im\n", +- meta->name ); ++ if (meta->im != im) ++ printf("*** field \"%s\" has incorrect im\n", ++ meta->name); + +- if( !(found = g_hash_table_lookup( im->meta, meta->name )) ) +- printf( "*** field \"%s\" is on traverse but not in hash\n", +- meta->name ); ++ if (!(found = g_hash_table_lookup(im->meta, meta->name))) ++ printf("*** field \"%s\" is on traverse but not in hash\n", ++ meta->name); + +- if( found != meta ) +- printf( "*** meta \"%s\" on traverse and hash do not match\n", +- meta->name ); ++ if (found != meta) ++ printf("*** meta \"%s\" on traverse and hash do not match\n", ++ meta->name); + +- return( NULL ); ++ return (NULL); + } + + static void +-meta_sanity_on_traverse( const char *name, VipsMeta *meta, VipsImage *im ) ++meta_sanity_on_traverse(const char *name, VipsMeta *meta, VipsImage *im) + { +- if( meta->name != name ) +- printf( "*** field \"%s\" has incorrect name\n", +- meta->name ); ++ if (meta->name != name) ++ printf("*** field \"%s\" has incorrect name\n", ++ meta->name); + +- if( meta->im != im ) +- printf( "*** field \"%s\" has incorrect im\n", +- meta->name ); ++ if (meta->im != im) ++ printf("*** field \"%s\" has incorrect im\n", ++ meta->name); + +- if( !g_slist_find( im->meta_traverse, meta ) ) +- printf( "*** field \"%s\" is in hash but not on traverse\n", +- meta->name ); ++ if (!g_slist_find(im->meta_traverse, meta)) ++ printf("*** field \"%s\" is in hash but not on traverse\n", ++ meta->name); + } + + static void +-meta_sanity( const VipsImage *im ) ++meta_sanity(const VipsImage *im) + { +- if( im->meta ) +- g_hash_table_foreach( im->meta, +- (GHFunc) meta_sanity_on_traverse, (void *) im ); +- vips_slist_map2( im->meta_traverse, +- (VipsSListMap2Fn) meta_sanity_on_hash, (void *) im, NULL ); ++ if (im->meta) ++ g_hash_table_foreach(im->meta, ++ (GHFunc) meta_sanity_on_traverse, (void *) im); ++ vips_slist_map2(im->meta_traverse, ++ (VipsSListMap2Fn) meta_sanity_on_hash, (void *) im, NULL); + } + #endif /*DEBUG*/ + + static void +-meta_free( VipsMeta *meta ) ++meta_free(VipsMeta *meta) + { + #ifdef DEBUG +-{ +- char *str_value; ++ { ++ char *str_value; + +- str_value = g_strdup_value_contents( &meta->value ); +- printf( "meta_free: name %s, value = %s\n", +- meta->name, str_value ); +- g_free( str_value ); +-} ++ str_value = g_strdup_value_contents(&meta->value); ++ printf("meta_free: name %s, value = %s\n", ++ meta->name, str_value); ++ g_free(str_value); ++ } + #endif /*DEBUG*/ + +- if( meta->im ) +- meta->im->meta_traverse = +- g_slist_remove( meta->im->meta_traverse, meta ); ++ if (meta->im) ++ meta->im->meta_traverse = ++ g_slist_remove(meta->im->meta_traverse, meta); + +- g_value_unset( &meta->value ); +- g_free( meta->name ); +- g_free( meta ); ++ g_value_unset(&meta->value); ++ g_free(meta->name); ++ g_free(meta); + } + + static VipsMeta * +-meta_new( VipsImage *image, const char *name, GValue *value ) ++meta_new(VipsImage *image, const char *name, GValue *value) + { + VipsMeta *meta; + +- meta = g_new( VipsMeta, 1 ); ++ meta = g_new(VipsMeta, 1); + meta->im = image; + meta->name = NULL; +- memset( &meta->value, 0, sizeof( GValue ) ); +- meta->name = g_strdup( name ); ++ memset(&meta->value, 0, sizeof(GValue)); ++ meta->name = g_strdup(name); + + /* Special case: we don't want to have G_STRING on meta. They will be + * copied down pipelines, plus some of our API (like +@@ -329,47 +329,47 @@ meta_new( VipsImage *image, const char *name, GValue *value ) + * + * Turn G_TYPE_STRING into VIPS_TYPE_REF_STRING. + */ +- if( G_VALUE_TYPE( value ) == G_TYPE_STRING ) +- g_value_init( &meta->value, VIPS_TYPE_REF_STRING ); ++ if (G_VALUE_TYPE(value) == G_TYPE_STRING) ++ g_value_init(&meta->value, VIPS_TYPE_REF_STRING); + else +- g_value_init( &meta->value, G_VALUE_TYPE( value ) ); ++ g_value_init(&meta->value, G_VALUE_TYPE(value)); + + /* We don't do any conversions that can fail. + */ +- (void) g_value_transform( value, &meta->value ); ++ (void) g_value_transform(value, &meta->value); + +- image->meta_traverse = g_slist_append( image->meta_traverse, meta ); +- g_hash_table_replace( image->meta, meta->name, meta ); ++ image->meta_traverse = g_slist_append(image->meta_traverse, meta); ++ g_hash_table_replace(image->meta, meta->name, meta); + + #ifdef DEBUG +-{ +- char *str_value; ++ { ++ char *str_value; + +- str_value = g_strdup_value_contents( value ); +- printf( "meta_new: name %s, value = %s\n", name, str_value ); +- g_free( str_value ); +-} ++ str_value = g_strdup_value_contents(value); ++ printf("meta_new: name %s, value = %s\n", name, str_value); ++ g_free(str_value); ++ } + #endif /*DEBUG*/ + +- return( meta ); ++ return (meta); + } + + /* Destroy all the meta on an image. + */ + void +-vips__meta_destroy( VipsImage *image ) ++vips__meta_destroy(VipsImage *image) + { +- VIPS_FREEF( g_hash_table_destroy, image->meta ); +- g_assert( !image->meta_traverse ); ++ VIPS_FREEF(g_hash_table_destroy, image->meta); ++ g_assert(!image->meta_traverse); + } + + static void +-meta_init( VipsImage *im ) ++meta_init(VipsImage *im) + { +- if( !im->meta ) { +- g_assert( !im->meta_traverse ); +- im->meta = g_hash_table_new_full( g_str_hash, g_str_equal, +- NULL, (GDestroyNotify) meta_free ); ++ if (!im->meta) { ++ g_assert(!im->meta_traverse); ++ im->meta = g_hash_table_new_full(g_str_hash, g_str_equal, ++ NULL, (GDestroyNotify) meta_free); + } + } + +@@ -380,9 +380,9 @@ meta_init( VipsImage *im ) + * Returns: the number of pixels across the image. + */ + int +-vips_image_get_width( const VipsImage *image ) ++vips_image_get_width(const VipsImage *image) + { +- return( image->Xsize ); ++ return (image->Xsize); + } + + /** +@@ -392,9 +392,9 @@ vips_image_get_width( const VipsImage *image ) + * Returns: the number of pixels down the image. + */ + int +-vips_image_get_height( const VipsImage *image ) ++vips_image_get_height(const VipsImage *image) + { +- return( image->Ysize ); ++ return (image->Ysize); + } + + /** +@@ -404,9 +404,9 @@ vips_image_get_height( const VipsImage *image ) + * Returns: the number of bands (channels) in the image. + */ + int +-vips_image_get_bands( const VipsImage *image ) ++vips_image_get_bands(const VipsImage *image) + { +- return( image->Bands ); ++ return (image->Bands); + } + + /** +@@ -416,9 +416,9 @@ vips_image_get_bands( const VipsImage *image ) + * Returns: the format of each band element. + */ + VipsBandFormat +-vips_image_get_format( const VipsImage *image ) ++vips_image_get_format(const VipsImage *image) + { +- return( image->BandFmt ); ++ return (image->BandFmt); + } + + /** +@@ -428,37 +428,37 @@ vips_image_get_format( const VipsImage *image ) + * Returns: the maximum numeric value possible for this format. + */ + double +-vips_image_get_format_max( VipsBandFormat format ) ++vips_image_get_format_max(VipsBandFormat format) + { +- switch( format ) { ++ switch (format) { + case VIPS_FORMAT_UCHAR: +- return( UCHAR_MAX ); ++ return (UCHAR_MAX); + + case VIPS_FORMAT_CHAR: +- return( SCHAR_MAX ); ++ return (SCHAR_MAX); + + case VIPS_FORMAT_USHORT: +- return( USHRT_MAX ); ++ return (USHRT_MAX); + + case VIPS_FORMAT_SHORT: +- return( SHRT_MAX ); ++ return (SHRT_MAX); + + case VIPS_FORMAT_UINT: +- return( UINT_MAX ); ++ return (UINT_MAX); + + case VIPS_FORMAT_INT: +- return( INT_MAX ); ++ return (INT_MAX); + + case VIPS_FORMAT_FLOAT: + case VIPS_FORMAT_COMPLEX: +- return( FLT_MAX ); ++ return (FLT_MAX); + + case VIPS_FORMAT_DOUBLE: + case VIPS_FORMAT_DPCOMPLEX: +- return( DBL_MAX ); ++ return (DBL_MAX); + + default: +- return( -1 ); ++ return (-1); + } + } + +@@ -469,71 +469,71 @@ vips_image_get_format_max( VipsBandFormat format ) + * Return the #VipsBandFormat for an image, guessing a sane value if + * the set value looks crazy. + * +- * For example, for a float image tagged as rgb16, we'd return ushort. ++ * For example, for a float image tagged as rgb16, we'd return ushort. + * + * Returns: a sensible #VipsBandFormat for the image. + */ + VipsBandFormat +-vips_image_guess_format( const VipsImage *image ) ++vips_image_guess_format(const VipsImage *image) + { + VipsBandFormat format; + + /* Stop a compiler warning. + */ +- format = VIPS_FORMAT_UCHAR; ++ format = VIPS_FORMAT_UCHAR; + +- switch( image->Type ) { +- case VIPS_INTERPRETATION_B_W: +- case VIPS_INTERPRETATION_HISTOGRAM: +- case VIPS_INTERPRETATION_MULTIBAND: ++ switch (image->Type) { ++ case VIPS_INTERPRETATION_B_W: ++ case VIPS_INTERPRETATION_HISTOGRAM: ++ case VIPS_INTERPRETATION_MULTIBAND: + format = image->BandFmt; + break; + +- case VIPS_INTERPRETATION_FOURIER: +- if( image->BandFmt == VIPS_FORMAT_DOUBLE || +- image->BandFmt == VIPS_FORMAT_DPCOMPLEX ) ++ case VIPS_INTERPRETATION_FOURIER: ++ if (image->BandFmt == VIPS_FORMAT_DOUBLE || ++ image->BandFmt == VIPS_FORMAT_DPCOMPLEX) + format = VIPS_FORMAT_DPCOMPLEX; + else + format = VIPS_FORMAT_COMPLEX; + break; + +- case VIPS_INTERPRETATION_sRGB: +- case VIPS_INTERPRETATION_RGB: ++ case VIPS_INTERPRETATION_sRGB: ++ case VIPS_INTERPRETATION_RGB: + format = VIPS_FORMAT_UCHAR; + break; + +- case VIPS_INTERPRETATION_XYZ: +- case VIPS_INTERPRETATION_LAB: +- case VIPS_INTERPRETATION_CMC: +- case VIPS_INTERPRETATION_LCH: +- case VIPS_INTERPRETATION_HSV: +- case VIPS_INTERPRETATION_scRGB: +- case VIPS_INTERPRETATION_YXY: ++ case VIPS_INTERPRETATION_XYZ: ++ case VIPS_INTERPRETATION_LAB: ++ case VIPS_INTERPRETATION_CMC: ++ case VIPS_INTERPRETATION_LCH: ++ case VIPS_INTERPRETATION_HSV: ++ case VIPS_INTERPRETATION_scRGB: ++ case VIPS_INTERPRETATION_YXY: + format = VIPS_FORMAT_FLOAT; + break; + +- case VIPS_INTERPRETATION_CMYK: +- if( image->BandFmt == VIPS_FORMAT_USHORT ) ++ case VIPS_INTERPRETATION_CMYK: ++ if (image->BandFmt == VIPS_FORMAT_USHORT) + format = VIPS_FORMAT_USHORT; + else + format = VIPS_FORMAT_UCHAR; + break; + +- case VIPS_INTERPRETATION_LABQ: ++ case VIPS_INTERPRETATION_LABQ: + format = VIPS_FORMAT_UCHAR; + break; + +- case VIPS_INTERPRETATION_LABS: ++ case VIPS_INTERPRETATION_LABS: + format = VIPS_FORMAT_SHORT; + break; + +- case VIPS_INTERPRETATION_GREY16: +- case VIPS_INTERPRETATION_RGB16: ++ case VIPS_INTERPRETATION_GREY16: ++ case VIPS_INTERPRETATION_RGB16: + format = VIPS_FORMAT_USHORT; + break; + +- case VIPS_INTERPRETATION_MATRIX: +- if( image->BandFmt == VIPS_FORMAT_DOUBLE ) ++ case VIPS_INTERPRETATION_MATRIX: ++ if (image->BandFmt == VIPS_FORMAT_DOUBLE) + format = VIPS_FORMAT_DOUBLE; + else + format = VIPS_FORMAT_FLOAT; +@@ -541,10 +541,10 @@ vips_image_guess_format( const VipsImage *image ) + + default: + format = VIPS_FORMAT_NOTSET; +- break; ++ break; + } + +- return( format ); ++ return (format); + } + + /** +@@ -554,9 +554,9 @@ vips_image_guess_format( const VipsImage *image ) + * Returns: the image coding + */ + VipsCoding +-vips_image_get_coding( const VipsImage *image ) ++vips_image_get_coding(const VipsImage *image) + { +- return( image->Coding ); ++ return (image->Coding); + } + + /** +@@ -569,87 +569,87 @@ vips_image_get_coding( const VipsImage *image ) + * Returns: the #VipsInterpretation from the image header. + */ + VipsInterpretation +-vips_image_get_interpretation( const VipsImage *image ) ++vips_image_get_interpretation(const VipsImage *image) + { +- return( image->Type ); ++ return (image->Type); + } + + /* Try to guess a sane value for interpretation. + */ + static VipsInterpretation +-vips_image_default_interpretation( const VipsImage *image ) ++vips_image_default_interpretation(const VipsImage *image) + { +- switch( image->Coding ) { ++ switch (image->Coding) { + case VIPS_CODING_LABQ: +- return( VIPS_INTERPRETATION_LABQ ); ++ return (VIPS_INTERPRETATION_LABQ); + case VIPS_CODING_RAD: +- return( VIPS_INTERPRETATION_sRGB ); ++ return (VIPS_INTERPRETATION_sRGB); + default: + break; + } + +- switch( image->BandFmt ) { ++ switch (image->BandFmt) { + case VIPS_FORMAT_UCHAR: + case VIPS_FORMAT_SHORT: + case VIPS_FORMAT_UINT: + case VIPS_FORMAT_INT: +- switch( image->Bands ) { ++ switch (image->Bands) { + case 1: + case 2: +- return( VIPS_INTERPRETATION_B_W ); ++ return (VIPS_INTERPRETATION_B_W); + + case 3: + case 4: +- return( VIPS_INTERPRETATION_sRGB ); ++ return (VIPS_INTERPRETATION_sRGB); + + default: +- return( VIPS_INTERPRETATION_MULTIBAND ); ++ return (VIPS_INTERPRETATION_MULTIBAND); + } + + case VIPS_FORMAT_CHAR: +- switch( image->Bands ) { ++ switch (image->Bands) { + case 1: +- return( VIPS_INTERPRETATION_MATRIX ); ++ return (VIPS_INTERPRETATION_MATRIX); + + default: +- return( VIPS_INTERPRETATION_MULTIBAND ); ++ return (VIPS_INTERPRETATION_MULTIBAND); + } + + case VIPS_FORMAT_USHORT: +- switch( image->Bands ) { ++ switch (image->Bands) { + case 1: + case 2: +- return( VIPS_INTERPRETATION_GREY16 ); ++ return (VIPS_INTERPRETATION_GREY16); + + case 3: + case 4: +- return( VIPS_INTERPRETATION_RGB16 ); ++ return (VIPS_INTERPRETATION_RGB16); + + default: +- return( VIPS_INTERPRETATION_MULTIBAND ); ++ return (VIPS_INTERPRETATION_MULTIBAND); + } + + case VIPS_FORMAT_FLOAT: + case VIPS_FORMAT_DOUBLE: +- switch( image->Bands ) { ++ switch (image->Bands) { + case 1: + case 2: +- return( VIPS_INTERPRETATION_B_W ); ++ return (VIPS_INTERPRETATION_B_W); + + case 3: + case 4: +- return( VIPS_INTERPRETATION_scRGB ); ++ return (VIPS_INTERPRETATION_scRGB); + + default: +- return( VIPS_INTERPRETATION_MULTIBAND ); ++ return (VIPS_INTERPRETATION_MULTIBAND); + } + + case VIPS_FORMAT_COMPLEX: + case VIPS_FORMAT_DPCOMPLEX: +- return( VIPS_INTERPRETATION_FOURIER ); ++ return (VIPS_INTERPRETATION_FOURIER); + + default: +- return( VIPS_INTERPRETATION_MULTIBAND ); ++ return (VIPS_INTERPRETATION_MULTIBAND); + } + } + +@@ -663,7 +663,7 @@ vips_image_default_interpretation( const VipsImage *image ) + * Returns: a sensible #VipsInterpretation for the image. + */ + VipsInterpretation +-vips_image_guess_interpretation( const VipsImage *image ) ++vips_image_guess_interpretation(const VipsImage *image) + { + gboolean sane; + +@@ -671,18 +671,18 @@ vips_image_guess_interpretation( const VipsImage *image ) + + /* Coding overrides interpretation. + */ +- switch( image->Coding ) { ++ switch (image->Coding) { + case VIPS_CODING_ERROR: + sane = FALSE; + break; + + case VIPS_CODING_LABQ: +- if( image->Type != VIPS_INTERPRETATION_LABQ ) ++ if (image->Type != VIPS_INTERPRETATION_LABQ) + sane = FALSE; + break; + + case VIPS_CODING_RAD: +- if( image->Type != VIPS_INTERPRETATION_sRGB ) ++ if (image->Type != VIPS_INTERPRETATION_sRGB) + sane = FALSE; + break; + +@@ -690,85 +690,85 @@ vips_image_guess_interpretation( const VipsImage *image ) + break; + } + +- switch( image->Type ) { ++ switch (image->Type) { + case VIPS_INTERPRETATION_ERROR: + sane = FALSE; + break; + +- case VIPS_INTERPRETATION_MULTIBAND: ++ case VIPS_INTERPRETATION_MULTIBAND: + /* This is a pretty useless generic tag. Always reset it. + */ + sane = FALSE; + break; + +- case VIPS_INTERPRETATION_B_W: ++ case VIPS_INTERPRETATION_B_W: + /* Don't test bands, we allow bands after the first to be + * unused extras, like alpha. + */ + break; + +- case VIPS_INTERPRETATION_HISTOGRAM: +- if( image->Xsize > 1 && image->Ysize > 1 ) ++ case VIPS_INTERPRETATION_HISTOGRAM: ++ if (image->Xsize > 1 && image->Ysize > 1) + sane = FALSE; + break; + +- case VIPS_INTERPRETATION_FOURIER: +- if( !vips_band_format_iscomplex( image->BandFmt ) ) ++ case VIPS_INTERPRETATION_FOURIER: ++ if (!vips_band_format_iscomplex(image->BandFmt)) + sane = FALSE; + break; + +- case VIPS_INTERPRETATION_XYZ: +- case VIPS_INTERPRETATION_LAB: +- case VIPS_INTERPRETATION_RGB: +- case VIPS_INTERPRETATION_CMC: +- case VIPS_INTERPRETATION_LCH: +- case VIPS_INTERPRETATION_sRGB: +- case VIPS_INTERPRETATION_HSV: +- if( image->Bands < 3 ) ++ case VIPS_INTERPRETATION_XYZ: ++ case VIPS_INTERPRETATION_LAB: ++ case VIPS_INTERPRETATION_RGB: ++ case VIPS_INTERPRETATION_CMC: ++ case VIPS_INTERPRETATION_LCH: ++ case VIPS_INTERPRETATION_sRGB: ++ case VIPS_INTERPRETATION_HSV: ++ if (image->Bands < 3) + sane = FALSE; + break; + +- case VIPS_INTERPRETATION_scRGB: +- case VIPS_INTERPRETATION_YXY: ++ case VIPS_INTERPRETATION_scRGB: ++ case VIPS_INTERPRETATION_YXY: + /* Need float values in 0 - 1. + */ +- if( !vips_band_format_isfloat( image->BandFmt ) || +- image->Bands < 3 ) ++ if (!vips_band_format_isfloat(image->BandFmt) || ++ image->Bands < 3) + sane = FALSE; + break; + +- case VIPS_INTERPRETATION_CMYK: +- if( image->Bands < 4 ) ++ case VIPS_INTERPRETATION_CMYK: ++ if (image->Bands < 4) + sane = FALSE; + break; + +- case VIPS_INTERPRETATION_LABQ: +- if( image->Coding != VIPS_CODING_LABQ ) ++ case VIPS_INTERPRETATION_LABQ: ++ if (image->Coding != VIPS_CODING_LABQ) + sane = FALSE; + break; + +- case VIPS_INTERPRETATION_LABS: ++ case VIPS_INTERPRETATION_LABS: + /* Needs to be able to express +/- 32767 + */ +- if( vips_band_format_isuint( image->BandFmt ) || +- vips_band_format_is8bit( image->BandFmt ) || +- image->Bands < 3 ) ++ if (vips_band_format_isuint(image->BandFmt) || ++ vips_band_format_is8bit(image->BandFmt) || ++ image->Bands < 3) + sane = FALSE; + break; + +- case VIPS_INTERPRETATION_RGB16: +- if( vips_band_format_is8bit( image->BandFmt ) || +- image->Bands < 3 ) ++ case VIPS_INTERPRETATION_RGB16: ++ if (vips_band_format_is8bit(image->BandFmt) || ++ image->Bands < 3) + sane = FALSE; + break; + +- case VIPS_INTERPRETATION_GREY16: +- if( vips_band_format_is8bit( image->BandFmt ) ) ++ case VIPS_INTERPRETATION_GREY16: ++ if (vips_band_format_is8bit(image->BandFmt)) + sane = FALSE; + break; + +- case VIPS_INTERPRETATION_MATRIX: +- if( image->Bands != 1 ) ++ case VIPS_INTERPRETATION_MATRIX: ++ if (image->Bands != 1) + sane = FALSE; + break; + +@@ -776,34 +776,34 @@ vips_image_guess_interpretation( const VipsImage *image ) + g_assert_not_reached(); + } + +- if( sane ) +- return( vips_image_get_interpretation( image ) ); ++ if (sane) ++ return (vips_image_get_interpretation(image)); + else +- return( vips_image_default_interpretation( image ) ); ++ return (vips_image_default_interpretation(image)); + } + + /** + * vips_image_get_xres: + * @image: image to get from + * +- * Returns: the horizontal image resolution in pixels per millimeter. ++ * Returns: the horizontal image resolution in pixels per millimeter. + */ + double +-vips_image_get_xres( const VipsImage *image ) ++vips_image_get_xres(const VipsImage *image) + { +- return( image->Xres ); ++ return (image->Xres); + } + + /** + * vips_image_get_yres: + * @image: image to get from + * +- * Returns: the vertical image resolution in pixels per millimeter. ++ * Returns: the vertical image resolution in pixels per millimeter. + */ + double +-vips_image_get_yres( const VipsImage *image ) ++vips_image_get_yres(const VipsImage *image) + { +- return( image->Yres ); ++ return (image->Yres); + } + + /** +@@ -813,9 +813,9 @@ vips_image_get_yres( const VipsImage *image ) + * Returns: the horizontal position of the image origin, in pixels. + */ + int +-vips_image_get_xoffset( const VipsImage *image ) ++vips_image_get_xoffset(const VipsImage *image) + { +- return( image->Xoffset ); ++ return (image->Xoffset); + } + + /** +@@ -825,9 +825,9 @@ vips_image_get_xoffset( const VipsImage *image ) + * Returns: the vertical position of the image origin, in pixels. + */ + int +-vips_image_get_yoffset( const VipsImage *image ) ++vips_image_get_yoffset(const VipsImage *image) + { +- return( image->Yoffset ); ++ return (image->Yoffset); + } + + /** +@@ -838,9 +838,9 @@ vips_image_get_yoffset( const VipsImage *image ) + * is no filename. + */ + const char * +-vips_image_get_filename( const VipsImage *image ) ++vips_image_get_filename(const VipsImage *image) + { +- return( image->filename ); ++ return (image->filename); + } + + /** +@@ -848,56 +848,56 @@ vips_image_get_filename( const VipsImage *image ) + * @image: image to get from + * + * Image modes are things like `"t"`, meaning a memory buffer, and `"p"` +- * meaning a delayed computation. ++ * meaning a delayed computation. + * + * Returns: the image mode. + */ + const char * +-vips_image_get_mode( const VipsImage *image ) ++vips_image_get_mode(const VipsImage *image) + { +- return( image->mode ); ++ return (image->mode); + } + + /** + * vips_image_get_scale: + * @image: image to get from + * +- * Matrix images can have an optional `scale` field for use by integer +- * convolution. ++ * Matrix images can have an optional `scale` field for use by integer ++ * convolution. + * + * Returns: the scale. + */ + double +-vips_image_get_scale( const VipsImage *image ) ++vips_image_get_scale(const VipsImage *image) + { + double scale; + + scale = 1.0; +- if( vips_image_get_typeof( image, "scale" ) ) +- vips_image_get_double( image, "scale", &scale ); ++ if (vips_image_get_typeof(image, "scale")) ++ vips_image_get_double(image, "scale", &scale); + +- return( scale ); ++ return (scale); + } + + /** + * vips_image_get_offset: + * @image: image to get from + * +- * Matrix images can have an optional `offset` field for use by integer +- * convolution. ++ * Matrix images can have an optional `offset` field for use by integer ++ * convolution. + * + * Returns: the offset. + */ + double +-vips_image_get_offset( const VipsImage *image ) ++vips_image_get_offset(const VipsImage *image) + { + double offset; + + offset = 0.0; +- if( vips_image_get_typeof( image, "offset" ) ) +- vips_image_get_double( image, "offset", &offset ); ++ if (vips_image_get_typeof(image, "offset")) ++ vips_image_get_double(image, "offset", &offset); + +- return( offset ); ++ return (offset); + } + + /** +@@ -910,19 +910,19 @@ vips_image_get_offset( const VipsImage *image ) + * Returns: the page height. + */ + int +-vips_image_get_page_height( VipsImage *image ) ++vips_image_get_page_height(VipsImage *image) + { + int page_height; + +- if( vips_image_get_typeof( image, VIPS_META_PAGE_HEIGHT ) && +- !vips_image_get_int( image, VIPS_META_PAGE_HEIGHT, +- &page_height ) && ++ if (vips_image_get_typeof(image, VIPS_META_PAGE_HEIGHT) && ++ !vips_image_get_int(image, VIPS_META_PAGE_HEIGHT, ++ &page_height) && + page_height > 0 && + page_height < image->Ysize && +- image->Ysize % page_height == 0 ) +- return( page_height ); ++ image->Ysize % page_height == 0) ++ return (page_height); + +- return( image->Ysize ); ++ return (image->Ysize); + } + + /** +@@ -938,17 +938,17 @@ vips_image_get_page_height( VipsImage *image ) + * Returns: the number of pages in the image file + */ + int +-vips_image_get_n_pages( VipsImage *image ) ++vips_image_get_n_pages(VipsImage *image) + { + int n_pages; + +- if( vips_image_get_typeof( image, VIPS_META_N_PAGES ) && +- !vips_image_get_int( image, VIPS_META_N_PAGES, &n_pages ) && ++ if (vips_image_get_typeof(image, VIPS_META_N_PAGES) && ++ !vips_image_get_int(image, VIPS_META_N_PAGES, &n_pages) && + n_pages > 1 && +- n_pages < 10000 ) +- return( n_pages ); ++ n_pages < 10000) ++ return (n_pages); + +- return( 1 ); ++ return (1); + } + + /** +@@ -961,18 +961,18 @@ vips_image_get_n_pages( VipsImage *image ) + * Returns: the suggested concurrency for this image + */ + int +-vips_image_get_concurrency( VipsImage *image, int default_concurrency ) ++vips_image_get_concurrency(VipsImage *image, int default_concurrency) + { +- int concurrency; ++ int concurrency; + +- if( vips_image_get_typeof( image, VIPS_META_CONCURRENCY ) && +- !vips_image_get_int( image, +- VIPS_META_CONCURRENCY, &concurrency ) && ++ if (vips_image_get_typeof(image, VIPS_META_CONCURRENCY) && ++ !vips_image_get_int(image, ++ VIPS_META_CONCURRENCY, &concurrency) && + concurrency >= 1 && +- concurrency < 100 ) +- return( concurrency ); ++ concurrency < 100) ++ return (concurrency); + +- return( default_concurrency ); ++ return (default_concurrency); + } + + /** +@@ -985,41 +985,41 @@ vips_image_get_concurrency( VipsImage *image, int default_concurrency ) + * Returns: the number of subifds in the image file + */ + int +-vips_image_get_n_subifds( VipsImage *image ) ++vips_image_get_n_subifds(VipsImage *image) + { + int n_subifds; + +- if( vips_image_get_typeof( image, VIPS_META_N_SUBIFDS ) && +- !vips_image_get_int( image, VIPS_META_N_SUBIFDS, &n_subifds ) && ++ if (vips_image_get_typeof(image, VIPS_META_N_SUBIFDS) && ++ !vips_image_get_int(image, VIPS_META_N_SUBIFDS, &n_subifds) && + n_subifds > 1 && +- n_subifds < 1000 ) +- return( n_subifds ); ++ n_subifds < 1000) ++ return (n_subifds); + +- return( 0 ); ++ return (0); + } + + /** + * vips_image_get_orientation: + * @image: image to get from + * +- * Fetch and sanity-check #VIPS_META_ORIENTATION. Default to 1 (no rotate, ++ * Fetch and sanity-check #VIPS_META_ORIENTATION. Default to 1 (no rotate, + * no flip) if not present or crazy. + * + * Returns: the image orientation. + */ + int +-vips_image_get_orientation( VipsImage *image ) ++vips_image_get_orientation(VipsImage *image) + { + int orientation; + +- if( vips_image_get_typeof( image, VIPS_META_ORIENTATION ) && +- !vips_image_get_int( image, VIPS_META_ORIENTATION, +- &orientation ) && ++ if (vips_image_get_typeof(image, VIPS_META_ORIENTATION) && ++ !vips_image_get_int(image, VIPS_META_ORIENTATION, ++ &orientation) && + orientation > 0 && +- orientation < 9 ) +- return( orientation ); ++ orientation < 9) ++ return (orientation); + +- return( 1 ); ++ return (1); + } + + /** +@@ -1031,12 +1031,12 @@ vips_image_get_orientation( VipsImage *image ) + * Returns: if width/height will swap + */ + gboolean +-vips_image_get_orientation_swap( VipsImage *image ) ++vips_image_get_orientation_swap(VipsImage *image) + { +- int orientation = vips_image_get_orientation( image ); ++ int orientation = vips_image_get_orientation(image); + +- return( orientation >= 5 && +- orientation <= 8 ); ++ return (orientation >= 5 && ++ orientation <= 8); + } + + /** +@@ -1048,19 +1048,19 @@ vips_image_get_orientation_swap( VipsImage *image ) + * pixels are laid out in band-packed rows. + * + * Since this function modifies @image, it is not threadsafe. Only call it on +- * images which you are sure have not been shared with another thread. ++ * images which you are sure have not been shared with another thread. + * + * See also: vips_image_wio_input(), vips_image_copy_memory(). + * + * Returns: (transfer none): a pointer to pixel data, if possible. + */ + const void * +-vips_image_get_data( VipsImage *image ) ++vips_image_get_data(VipsImage *image) + { +- if( vips_image_wio_input( image ) ) +- return( NULL ); ++ if (vips_image_wio_input(image)) ++ return (NULL); + +- return( image->data ); ++ return (image->data); + } + + /** +@@ -1084,78 +1084,78 @@ vips_image_get_data( VipsImage *image ) + * + * See also: vips_image_pipelinev(). + */ +-void +-vips_image_init_fields( VipsImage *image, +- int xsize, int ysize, int bands, +- VipsBandFormat format, VipsCoding coding, +- VipsInterpretation interpretation, +- double xres, double yres ) ++void ++vips_image_init_fields(VipsImage *image, ++ int xsize, int ysize, int bands, ++ VipsBandFormat format, VipsCoding coding, ++ VipsInterpretation interpretation, ++ double xres, double yres) + { +- g_object_set( image, ++ g_object_set(image, + "width", xsize, + "height", ysize, + "bands", bands, + "format", format, +- NULL ); ++ NULL); + + image->Coding = coding; + image->Type = interpretation; +- image->Xres = VIPS_MAX( 0, xres ); +- image->Yres = VIPS_MAX( 0, yres ); ++ image->Xres = VIPS_MAX(0, xres); ++ image->Yres = VIPS_MAX(0, yres); + } + + static void * +-meta_cp_field( VipsMeta *meta, VipsImage *dst, void *b ) ++meta_cp_field(VipsMeta *meta, VipsImage *dst, void *b) + { + #ifdef DEBUG +-{ +- char *str_value; ++ { ++ char *str_value; + +- str_value = g_strdup_value_contents( &meta->value ); +- printf( "vips__meta_cp: copying name %s, value = %s\n", +- meta->name, str_value ); +- g_free( str_value ); +-} ++ str_value = g_strdup_value_contents(&meta->value); ++ printf("vips__meta_cp: copying name %s, value = %s\n", ++ meta->name, str_value); ++ g_free(str_value); ++ } + #endif /*DEBUG*/ + +- (void) meta_new( dst, meta->name, &meta->value ); ++ (void) meta_new(dst, meta->name, &meta->value); + + #ifdef DEBUG +- meta_sanity( dst ); ++ meta_sanity(dst); + #endif /*DEBUG*/ + +- return( NULL ); ++ return (NULL); + } + +-/* Copy meta on to dst. ++/* Copy meta on to dst. + */ + int +-vips__image_meta_copy( VipsImage *dst, const VipsImage *src ) ++vips__image_meta_copy(VipsImage *dst, const VipsImage *src) + { +- if( src->meta ) { ++ if (src->meta) { + /* We lock with vips_image_set() to stop races in highly- + * threaded applications. + */ +- g_mutex_lock( vips__meta_lock ); +- meta_init( dst ); +- vips_slist_map2( src->meta_traverse, +- (VipsSListMap2Fn) meta_cp_field, dst, NULL ); +- g_mutex_unlock( vips__meta_lock ); ++ g_mutex_lock(vips__meta_lock); ++ meta_init(dst); ++ vips_slist_map2(src->meta_traverse, ++ (VipsSListMap2Fn) meta_cp_field, dst, NULL); ++ g_mutex_unlock(vips__meta_lock); + } + +- return( 0 ); ++ return (0); + } + + /* We have to have this as a separate entry point so we can support the old + * vips7 API. + */ +-int +-vips__image_copy_fields_array( VipsImage *out, VipsImage *in[] ) ++int ++vips__image_copy_fields_array(VipsImage *out, VipsImage *in[]) + { + int i; + int ni; + +- g_assert( in[0] ); ++ g_assert(in[0]); + + /* Copy magic too, handy for knowing the original image's byte order. + */ +@@ -1175,7 +1175,7 @@ vips__image_copy_fields_array( VipsImage *out, VipsImage *in[] ) + + /* Count number of images. + */ +- for( ni = 0; in[ni]; ni++ ) ++ for (ni = 0; in[ni]; ni++) + ; + + /* Need to copy last-to-first so that in0 meta will override any +@@ -1183,22 +1183,22 @@ vips__image_copy_fields_array( VipsImage *out, VipsImage *in[] ) + * + * Don't destroy the meta on out. Things like foreign.c like setting + * image properties before calling a subclass loader, and those +- * subclass loaders will sometimes write to an image. ++ * subclass loaders will sometimes write to an image. + */ +- for( i = ni - 1; i >= 0; i-- ) +- if( vips__image_meta_copy( out, in[i] ) ) +- return( -1 ); ++ for (i = ni - 1; i >= 0; i--) ++ if (vips__image_meta_copy(out, in[i])) ++ return (-1); + + /* Merge hists first to last. + */ +- for( i = 0; in[i]; i++ ) +- out->history_list = vips__gslist_gvalue_merge( +- out->history_list, in[i]->history_list ); ++ for (i = 0; in[i]; i++) ++ out->history_list = vips__gslist_gvalue_merge( ++ out->history_list, in[i]->history_list); + +- return( 0 ); ++ return (0); + } + +-/** ++/** + * vips_image_set: + * @image: image to set the metadata on + * @name: the name to give the metadata +@@ -1223,10 +1223,10 @@ vips__image_copy_fields_array( VipsImage *out, VipsImage *in[] ) + * See also: vips_image_get(). + */ + void +-vips_image_set( VipsImage *image, const char *name, GValue *value ) ++vips_image_set(VipsImage *image, const char *name, GValue *value) + { +- g_assert( name ); +- g_assert( value ); ++ g_assert(name); ++ g_assert(value); + + /* We lock between modifying metadata and copying metadata between + * images, see vips__image_meta_copy(). +@@ -1235,53 +1235,52 @@ vips_image_set( VipsImage *image, const char *name, GValue *value ) + * metadata copy on another -- this can lead to crashes in + * highly-threaded applications. + */ +- g_mutex_lock( vips__meta_lock ); +- meta_init( image ); +- (void) meta_new( image, name, value ); +- g_mutex_unlock( vips__meta_lock ); ++ g_mutex_lock(vips__meta_lock); ++ meta_init(image); ++ (void) meta_new(image, name, value); ++ g_mutex_unlock(vips__meta_lock); + +- /* If we're setting an EXIF data block, we need to automatically expand ++ /* If we're setting an EXIF data block, we need to automatically expand + * out all the tags. This will set things like xres/yres too. + * + * We do this here rather than in meta_new() since we don't want to + * trigger on copy_fields. + */ +- if( strcmp( name, VIPS_META_EXIF_NAME ) == 0 ) +- if( vips__exif_parse( image ) ) +- g_warning( "image_set: bad exif data" ); ++ if (strcmp(name, VIPS_META_EXIF_NAME) == 0) ++ if (vips__exif_parse(image)) ++ g_warning("image_set: bad exif data"); + + #ifdef DEBUG +- meta_sanity( image ); ++ meta_sanity(image); + #endif /*DEBUG*/ +- + } + + /* Unforunately gvalue seems to have no way of doing this. Just handle the vips + * built-in types. + */ + static void +-vips_set_value_from_pointer( GValue *value, void *data ) ++vips_set_value_from_pointer(GValue *value, void *data) + { +- GType type = G_VALUE_TYPE( value ); ++ GType type = G_VALUE_TYPE(value); + + /* The fundamental type ... eg. G_TYPE_ENUM for a VIPS_TYPE_KERNEL, + * or G_TYPE_OBJECT for VIPS_TYPE_IMAGE(). + */ +- GType fundamental = G_TYPE_FUNDAMENTAL( type ); +- +- if( fundamental == G_TYPE_INT ) +- g_value_set_int( value, *((int *) data) ); +- else if( fundamental == G_TYPE_DOUBLE ) +- g_value_set_double( value, *((double *) data) ); +- else if( fundamental == G_TYPE_ENUM ) +- g_value_set_enum( value, *((int *) data) ); +- else if( fundamental == G_TYPE_STRING ) +- g_value_set_string( value, *((char **) data) ); ++ GType fundamental = G_TYPE_FUNDAMENTAL(type); ++ ++ if (fundamental == G_TYPE_INT) ++ g_value_set_int(value, *((int *) data)); ++ else if (fundamental == G_TYPE_DOUBLE) ++ g_value_set_double(value, *((double *) data)); ++ else if (fundamental == G_TYPE_ENUM) ++ g_value_set_enum(value, *((int *) data)); ++ else if (fundamental == G_TYPE_STRING) ++ g_value_set_string(value, *((char **) data)); + else +- g_warning( "%s: unimplemented vips_set_value_from_pointer() " +- "type %s", ++ g_warning("%s: unimplemented vips_set_value_from_pointer() " ++ "type %s", + G_STRLOC, +- g_type_name( type ) ); ++ g_type_name(type)); + } + + /** +@@ -1290,11 +1289,11 @@ vips_set_value_from_pointer( GValue *value, void *data ) + * @name: the name to fetch + * @value_copy: (transfer full) (out caller-allocates): the %GValue is copied into this + * +- * Fill @value_copy with a copy of the header field. @value_copy must be zeroed ++ * Fill @value_copy with a copy of the header field. @value_copy must be zeroed + * but uninitialised. + * + * This will return -1 and add a message to the error buffer if the field +- * does not exist. Use vips_image_get_typeof() to test for the ++ * does not exist. Use vips_image_get_typeof() to test for the + * existence of a field first if you are not certain it will be there. + * + * For example, to read a double from an image (though of course you would use +@@ -1308,9 +1307,9 @@ vips_set_value_from_pointer( GValue *value, void *data ) + * return -1; + * + * if (G_VALUE_TYPE (&value) != G_TYPE_DOUBLE) { +- * vips_error( "mydomain", ++ * vips_error( "mydomain", + * _("field \"%s\" is of type %s, not double"), +- * name, ++ * name, + * g_type_name (G_VALUE_TYPE (&value))); + * g_value_unset (&value); + * return -1; +@@ -1325,51 +1324,51 @@ vips_set_value_from_pointer( GValue *value, void *data ) + * Returns: (skip): 0 on success, -1 otherwise. + */ + int +-vips_image_get( const VipsImage *image, const char *name, GValue *value_copy ) ++vips_image_get(const VipsImage *image, const char *name, GValue *value_copy) + { + int i; + VipsMeta *meta; + +- g_assert( name ); +- g_assert( value_copy ); ++ g_assert(name); ++ g_assert(value_copy); + +- for( i = 0; i < VIPS_NUMBER( vips_header_fields ); i++ ) { ++ for (i = 0; i < VIPS_NUMBER(vips_header_fields); i++) { + HeaderField *field = &vips_header_fields[i]; + +- if( strcmp( field->name, name ) == 0 ) { +- GType gtype = g_type_from_name( field->type ); ++ if (strcmp(field->name, name) == 0) { ++ GType gtype = g_type_from_name(field->type); + +- g_value_init( value_copy, gtype ); +- vips_set_value_from_pointer( value_copy, +- G_STRUCT_MEMBER_P( image, field->offset ) ); +- return( 0 ); ++ g_value_init(value_copy, gtype); ++ vips_set_value_from_pointer(value_copy, ++ G_STRUCT_MEMBER_P(image, field->offset)); ++ return (0); + } + } + +- for( i = 0; i < VIPS_NUMBER( vips_header_fields_old ); i++ ) { ++ for (i = 0; i < VIPS_NUMBER(vips_header_fields_old); i++) { + HeaderField *field = &vips_header_fields_old[i]; + +- if( strcmp( field->name, name ) == 0 ) { +- GType gtype = g_type_from_name( field->type ); ++ if (strcmp(field->name, name) == 0) { ++ GType gtype = g_type_from_name(field->type); + +- g_value_init( value_copy, gtype ); +- vips_set_value_from_pointer( value_copy, +- G_STRUCT_MEMBER_P( image, field->offset ) ); +- return( 0 ); ++ g_value_init(value_copy, gtype); ++ vips_set_value_from_pointer(value_copy, ++ G_STRUCT_MEMBER_P(image, field->offset)); ++ return (0); + } + } + +- if( image->meta && +- (meta = g_hash_table_lookup( image->meta, name )) ) { +- g_value_init( value_copy, G_VALUE_TYPE( &meta->value ) ); +- g_value_copy( &meta->value, value_copy ); ++ if (image->meta && ++ (meta = g_hash_table_lookup(image->meta, name))) { ++ g_value_init(value_copy, G_VALUE_TYPE(&meta->value)); ++ g_value_copy(&meta->value, value_copy); + +- return( 0 ); ++ return (0); + } + +- vips_error( "vips_image_get", _( "field \"%s\" not found" ), name ); ++ vips_error("vips_image_get", _("field \"%s\" not found"), name); + +- return( -1 ); ++ return (-1); + } + + /** +@@ -1378,42 +1377,42 @@ vips_image_get( const VipsImage *image, const char *name, GValue *value_copy ) + * @name: the name to search for + * + * Read the %GType for a header field. Returns zero if there is no +- * field of that name. ++ * field of that name. + * + * See also: vips_image_get(). + * + * Returns: the %GType of the field, or zero if there is no + * field of that name. + */ +-GType +-vips_image_get_typeof( const VipsImage *image, const char *name ) ++GType ++vips_image_get_typeof(const VipsImage *image, const char *name) + { + int i; + VipsMeta *meta; + +- g_assert( name ); ++ g_assert(name); + +- for( i = 0; i < VIPS_NUMBER( vips_header_fields ); i++ ) { ++ for (i = 0; i < VIPS_NUMBER(vips_header_fields); i++) { + HeaderField *field = &vips_header_fields[i]; + +- if( strcmp( field->name, name ) == 0 ) +- return( g_type_from_name( field->type ) ); ++ if (strcmp(field->name, name) == 0) ++ return (g_type_from_name(field->type)); + } + +- for( i = 0; i < VIPS_NUMBER( vips_header_fields_old ); i++ ) { ++ for (i = 0; i < VIPS_NUMBER(vips_header_fields_old); i++) { + HeaderField *field = &vips_header_fields_old[i]; + +- if( strcmp( field->name, name ) == 0 ) +- return( g_type_from_name( field->type ) ); ++ if (strcmp(field->name, name) == 0) ++ return (g_type_from_name(field->type)); + } + +- if( image->meta && +- (meta = g_hash_table_lookup( image->meta, name )) ) +- return( G_VALUE_TYPE( &meta->value ) ); ++ if (image->meta && ++ (meta = g_hash_table_lookup(image->meta, name))) ++ return (G_VALUE_TYPE(&meta->value)); + +- VIPS_DEBUG_MSG( "vips_image_get_typeof: unknown field %s\n", name ); ++ VIPS_DEBUG_MSG("vips_image_get_typeof: unknown field %s\n", name); + +- return( 0 ); ++ return (0); + } + + /** +@@ -1429,26 +1428,26 @@ vips_image_get_typeof( const VipsImage *image, const char *name ) + * Returns: %TRUE if an item of metadata of that name was found and removed + */ + gboolean +-vips_image_remove( VipsImage *image, const char *name ) ++vips_image_remove(VipsImage *image, const char *name) + { + gboolean result; + + result = FALSE; + +- if( image->meta ) { +- /* We lock between modifying metadata and copying metadata ++ if (image->meta) { ++ /* We lock between modifying metadata and copying metadata + * between images, see vips__image_meta_copy(). + * +- * This prevents modification of metadata by one thread +- * racing with metadata copy on another -- this can lead to ++ * This prevents modification of metadata by one thread ++ * racing with metadata copy on another -- this can lead to + * crashes in highly-threaded applications. + */ +- g_mutex_lock( vips__meta_lock ); +- result = g_hash_table_remove( image->meta, name ); +- g_mutex_unlock( vips__meta_lock ); ++ g_mutex_lock(vips__meta_lock); ++ result = g_hash_table_remove(image->meta, name); ++ g_mutex_unlock(vips__meta_lock); + } + +- return( result ); ++ return (result); + } + + /* Deprecated header fields we hide from _map. +@@ -1460,17 +1459,17 @@ static const char *vips_image_header_deprecated[] = { + }; + + static void * +-vips_image_map_fn( VipsMeta *meta, VipsImageMapFn fn, void *a ) ++vips_image_map_fn(VipsMeta *meta, VipsImageMapFn fn, void *a) + { + int i; + + /* Hide deprecated fields. + */ +- for( i = 0; i < VIPS_NUMBER( vips_image_header_deprecated ); i++ ) +- if( strcmp( meta->name, vips_image_header_deprecated[i] ) == 0 ) +- return( NULL ); ++ for (i = 0; i < VIPS_NUMBER(vips_image_header_deprecated); i++) ++ if (strcmp(meta->name, vips_image_header_deprecated[i]) == 0) ++ return (NULL); + +- return( fn( meta->im, meta->name, &meta->value, a ) ); ++ return (fn(meta->im, meta->name, &meta->value, a)); + } + + /** +@@ -1479,8 +1478,8 @@ vips_image_map_fn( VipsMeta *meta, VipsImageMapFn fn, void *a ) + * @fn: (scope call): function to call for each header field + * @a: (closure fn): user data for function + * +- * This function calls @fn for every header field, including every item of +- * metadata. ++ * This function calls @fn for every header field, including every item of ++ * metadata. + * + * Like all _map functions, the user function should return %NULL to continue + * iteration, or a non-%NULL pointer to indicate early termination. +@@ -1490,79 +1489,79 @@ vips_image_map_fn( VipsMeta *meta, VipsImageMapFn fn, void *a ) + * Returns: (transfer none): %NULL on success, the failing pointer otherwise. + */ + void * +-vips_image_map( VipsImage *image, VipsImageMapFn fn, void *a ) ++vips_image_map(VipsImage *image, VipsImageMapFn fn, void *a) + { + int i; + GValue value = { 0 }; + void *result; + +- for( i = 0; i < VIPS_NUMBER( vips_header_fields ); i++ ) { ++ for (i = 0; i < VIPS_NUMBER(vips_header_fields); i++) { + HeaderField *field = &vips_header_fields[i]; + +- (void) vips_image_get( image, field->name, &value ); +- result = fn( image, field->name, &value, a ); +- g_value_unset( &value ); ++ (void) vips_image_get(image, field->name, &value); ++ result = fn(image, field->name, &value, a); ++ g_value_unset(&value); + +- if( result ) +- return( result ); ++ if (result) ++ return (result); + } + +- if( image->meta_traverse && +- (result = vips_slist_map2( image->meta_traverse, +- (VipsSListMap2Fn) vips_image_map_fn, fn, a )) ) +- return( result ); ++ if (image->meta_traverse && ++ (result = vips_slist_map2(image->meta_traverse, ++ (VipsSListMap2Fn) vips_image_map_fn, fn, a))) ++ return (result); + +- return( NULL ); ++ return (NULL); + } + + static void * +-count_fields( VipsImage *image, const char *field, GValue *value, void *a ) ++count_fields(VipsImage *image, const char *field, GValue *value, void *a) + { + int *n_fields = (int *) a; + + *n_fields += 1; + +- return( NULL ); ++ return (NULL); + } + + static void * +-add_fields( VipsImage *image, const char *field, GValue *value, void *a ) ++add_fields(VipsImage *image, const char *field, GValue *value, void *a) + { + gchar ***p = (gchar ***) a; + +- **p = g_strdup( field ); ++ **p = g_strdup(field); + *p += 1; + +- return( NULL ); ++ return (NULL); + } + + /** + * vips_image_get_fields: + * @image: image to get fields from + * +- * Get a %NULL-terminated array listing all the metadata field names on @image. ++ * Get a %NULL-terminated array listing all the metadata field names on @image. + * Free the return result with g_strfreev(). + * + * This is handy for language bindings. From C, it's usually more convenient to + * use vips_image_map(). + * + * Returns: (transfer full): metadata fields in image, as a %NULL-terminated +- * array. ++ * array. + */ +-gchar ** +-vips_image_get_fields( VipsImage *image ) ++gchar ** ++vips_image_get_fields(VipsImage *image) + { + int n_fields; + gchar **fields; + gchar **p; + + n_fields = 0; +- (void) vips_image_map( image, count_fields, &n_fields ); +- fields = g_new0( gchar *, n_fields + 1 ); ++ (void) vips_image_map(image, count_fields, &n_fields); ++ fields = g_new0(gchar *, n_fields + 1); + p = fields; +- (void) vips_image_map( image, add_fields, &p ); ++ (void) vips_image_map(image, add_fields, &p); + +- return( fields ); ++ return (fields); + } + + /** +@@ -1578,38 +1577,38 @@ vips_image_get_fields( VipsImage *image ) + * See also: vips_image_get_double(), vips_image_set() + */ + void +-vips_image_set_area( VipsImage *image, const char *name, +- VipsCallbackFn free_fn, void *data ) ++vips_image_set_area(VipsImage *image, const char *name, ++ VipsCallbackFn free_fn, void *data) + { + GValue value = { 0 }; + +- vips_value_set_area( &value, free_fn, data ); +- vips_image_set( image, name, &value ); +- g_value_unset( &value ); ++ vips_value_set_area(&value, free_fn, data); ++ vips_image_set(image, name, &value); ++ g_value_unset(&value); + } + + static int +-meta_get_value( const VipsImage *image, +- const char *name, GType type, GValue *value_copy ) ++meta_get_value(const VipsImage *image, ++ const char *name, GType type, GValue *value_copy) + { +- GValue value = { 0 }; ++ GValue value = { 0 }; + +- if( vips_image_get( image, name, &value ) ) +- return( -1 ); +- g_value_init( value_copy, type ); +- if( !g_value_transform( &value, value_copy ) ) { +- vips_error( "VipsImage", +- _( "field \"%s\" is of type %s, not %s" ), ++ if (vips_image_get(image, name, &value)) ++ return (-1); ++ g_value_init(value_copy, type); ++ if (!g_value_transform(&value, value_copy)) { ++ vips_error("VipsImage", ++ _("field \"%s\" is of type %s, not %s"), + name, +- g_type_name( G_VALUE_TYPE( &value ) ), +- g_type_name( type ) ); +- g_value_unset( &value ); ++ g_type_name(G_VALUE_TYPE(&value)), ++ g_type_name(type)); ++ g_value_unset(&value); + +- return( -1 ); ++ return (-1); + } +- g_value_unset( &value ); ++ g_value_unset(&value); + +- return( 0 ); ++ return (0); + } + + /** +@@ -1628,21 +1627,21 @@ meta_get_value( const VipsImage *image, + * Returns: 0 on success, -1 otherwise. + */ + int +-vips_image_get_area( const VipsImage *image, +- const char *name, const void **data ) ++vips_image_get_area(const VipsImage *image, ++ const char *name, const void **data) + { + GValue value_copy = { 0 }; + +- if( !meta_get_value( image, name, VIPS_TYPE_AREA, &value_copy ) ) { +- *data = vips_value_get_area( &value_copy, NULL ); +- g_value_unset( &value_copy ); +- return( 0 ); ++ if (!meta_get_value(image, name, VIPS_TYPE_AREA, &value_copy)) { ++ *data = vips_value_get_area(&value_copy, NULL); ++ g_value_unset(&value_copy); ++ return (0); + } + +- return( -1 ); ++ return (-1); + } + +-/** ++/** + * vips_image_set_blob: + * @image: image to attach the metadata to + * @name: metadata name +@@ -1651,25 +1650,25 @@ vips_image_get_area( const VipsImage *image, + * memory + * @length: length of memory area + * +- * Attaches @blob as a metadata item on @image under the name @name. A ++ * Attaches @blob as a metadata item on @image under the name @name. A + * convenience + * function over vips_image_set() using a vips_blob. + * + * See also: vips_image_get_blob(), vips_image_set(). + */ + void +-vips_image_set_blob( VipsImage *image, const char *name, +- VipsCallbackFn free_fn, const void *data, size_t size ) ++vips_image_set_blob(VipsImage *image, const char *name, ++ VipsCallbackFn free_fn, const void *data, size_t size) + { + GValue value = { 0 }; + +- g_value_init( &value, VIPS_TYPE_BLOB ); +- vips_value_set_blob( &value, free_fn, data, size ); +- vips_image_set( image, name, &value ); +- g_value_unset( &value ); ++ g_value_init(&value, VIPS_TYPE_BLOB); ++ vips_value_set_blob(&value, free_fn, data, size); ++ vips_image_set(image, name, &value); ++ g_value_unset(&value); + } + +-/** ++/** + * vips_image_set_blob_copy: + * @image: image to attach the metadata to + * @name: metadata name +@@ -1677,38 +1676,38 @@ vips_image_set_blob( VipsImage *image, const char *name, + * @length: length of memory area + * + * Attaches @blob as a metadata item on @image under the name @name, taking +- * a copy of the memory area. A convenience function over ++ * a copy of the memory area. A convenience function over + * vips_image_set_blob(). + * + * See also: vips_image_get_blob(), vips_image_set(). + */ + void +-vips_image_set_blob_copy( VipsImage *image, +- const char *name, const void *data, size_t length ) ++vips_image_set_blob_copy(VipsImage *image, ++ const char *name, const void *data, size_t length) + { + void *data_copy; + + /* Cap at 100mb for sanity. + */ +- if( !data || ++ if (!data || + length == 0 || +- length > 100 * 1024 * 1024 ) ++ length > 100 * 1024 * 1024) + return; + +- /* We add an extra, secret null byte at the end, just in case this blob ++ /* We add an extra, secret null byte at the end, just in case this blob + * is read as a C string. The libtiff reader attaches + * XMP XML as a blob, for example. + */ +- if( !(data_copy = vips_malloc( NULL, length + 1 )) ) ++ if (!(data_copy = vips_malloc(NULL, length + 1))) + return; +- memcpy( data_copy, data, length ); ++ memcpy(data_copy, data, length); + ((unsigned char *) data_copy)[length] = '\0'; + +- vips_image_set_blob( image, +- name, (VipsCallbackFn) vips_area_free_cb, data_copy, length ); ++ vips_image_set_blob(image, ++ name, (VipsCallbackFn) vips_area_free_cb, data_copy, length); + } + +-/** ++/** + * vips_image_get_blob: + * @image: image to get the metadata from + * @name: metadata name +@@ -1717,136 +1716,136 @@ vips_image_set_blob_copy( VipsImage *image, + * + * Gets @blob from @image under the name @name, optionally returns its length in + * @length. A convenience +- * function over vips_image_get(). Use vips_image_get_typeof() to test for the ++ * function over vips_image_get(). Use vips_image_get_typeof() to test for the + * existence + * of a piece of metadata. + * +- * See also: vips_image_get(), vips_image_get_typeof(), vips_blob_get(), ++ * See also: vips_image_get(), vips_image_get_typeof(), vips_blob_get(), + * + * Returns: 0 on success, -1 otherwise. + */ + int +-vips_image_get_blob( const VipsImage *image, const char *name, +- const void **data, size_t *length ) ++vips_image_get_blob(const VipsImage *image, const char *name, ++ const void **data, size_t *length) + { + GValue value_copy = { 0 }; + +- if( !meta_get_value( image, name, VIPS_TYPE_BLOB, &value_copy ) ) { +- *data = vips_value_get_blob( &value_copy, length ); +- g_value_unset( &value_copy ); +- return( 0 ); ++ if (!meta_get_value(image, name, VIPS_TYPE_BLOB, &value_copy)) { ++ *data = vips_value_get_blob(&value_copy, length); ++ g_value_unset(&value_copy); ++ return (0); + } + +- return( -1 ); ++ return (-1); + } + +-/** ++/** + * vips_image_get_int: + * @image: image to get the header field from + * @name: field name + * @out: (out): return field value + * +- * Gets @out from @im under the name @name. ++ * Gets @out from @im under the name @name. + * The value will be transformed into +- * an int, if possible. ++ * an int, if possible. + * + * See also: vips_image_get(), vips_image_get_typeof() + * + * Returns: 0 on success, -1 otherwise. + */ + int +-vips_image_get_int( const VipsImage *image, const char *name, int *out ) ++vips_image_get_int(const VipsImage *image, const char *name, int *out) + { + GValue value = { 0 }; + +- if( meta_get_value( image, name, G_TYPE_INT, &value ) ) +- return( -1 ); +- *out = g_value_get_int( &value ); +- g_value_unset( &value ); ++ if (meta_get_value(image, name, G_TYPE_INT, &value)) ++ return (-1); ++ *out = g_value_get_int(&value); ++ g_value_unset(&value); + +- return( 0 ); ++ return (0); + } + +-/** ++/** + * vips_image_set_int: + * @image: image to attach the metadata to + * @name: metadata name + * @i: metadata value + * +- * Attaches @i as a metadata item on @image under the name @name. A ++ * Attaches @i as a metadata item on @image under the name @name. A + * convenience + * function over vips_image_set(). + * + * See also: vips_image_get_int(), vips_image_set() + */ + void +-vips_image_set_int( VipsImage *image, const char *name, int i ) ++vips_image_set_int(VipsImage *image, const char *name, int i) + { + GValue value = { 0 }; + +- g_value_init( &value, G_TYPE_INT ); +- g_value_set_int( &value, i ); +- vips_image_set( image, name, &value ); +- g_value_unset( &value ); ++ g_value_init(&value, G_TYPE_INT); ++ g_value_set_int(&value, i); ++ vips_image_set(image, name, &value); ++ g_value_unset(&value); + } + +-/** ++/** + * vips_image_get_double: + * @image: image to get the header field from + * @name: field name + * @out: (out): return field value + * +- * Gets @out from @im under the name @name. ++ * Gets @out from @im under the name @name. + * The value will be transformed into +- * a double, if possible. ++ * a double, if possible. + * + * See also: vips_image_get(), vips_image_get_typeof() + * + * Returns: 0 on success, -1 otherwise. + */ + int +-vips_image_get_double( const VipsImage *image, const char *name, double *out ) ++vips_image_get_double(const VipsImage *image, const char *name, double *out) + { + GValue value = { 0 }; + +- if( meta_get_value( image, name, G_TYPE_DOUBLE, &value ) ) +- return( -1 ); +- *out = g_value_get_double( &value ); +- g_value_unset( &value ); ++ if (meta_get_value(image, name, G_TYPE_DOUBLE, &value)) ++ return (-1); ++ *out = g_value_get_double(&value); ++ g_value_unset(&value); + +- return( 0 ); ++ return (0); + } + +-/** ++/** + * vips_image_set_double: + * @image: image to attach the metadata to + * @name: metadata name + * @d: metadata value + * +- * Attaches @d as a metadata item on @image as @name. A ++ * Attaches @d as a metadata item on @image as @name. A + * convenience + * function over vips_image_set(). + * + * See also: vips_image_get_double(), vips_image_set() + */ + void +-vips_image_set_double( VipsImage *image, const char *name, double d ) ++vips_image_set_double(VipsImage *image, const char *name, double d) + { + GValue value = { 0 }; + +- g_value_init( &value, G_TYPE_DOUBLE ); +- g_value_set_double( &value, d ); +- vips_image_set( image, name, &value ); +- g_value_unset( &value ); ++ g_value_init(&value, G_TYPE_DOUBLE); ++ g_value_set_double(&value, d); ++ vips_image_set(image, name, &value); ++ g_value_unset(&value); + } + +-/** ++/** + * vips_image_get_string: + * @image: image to get the header field from + * @name: field name + * @out: (out) (transfer none): return field value + * +- * Gets @out from @im under the name @name. ++ * Gets @out from @im under the name @name. + * The field must be of type + * G_TYPE_STRING, VIPS_TYPE_REF_STRING. + * +@@ -1859,107 +1858,107 @@ vips_image_set_double( VipsImage *image, const char *name, double d ) + * Returns: 0 on success, -1 otherwise. + */ + int +-vips_image_get_string( const VipsImage *image, const char *name, +- const char **out ) ++vips_image_get_string(const VipsImage *image, const char *name, ++ const char **out) + { + GValue value = { 0 }; + +- if( vips_image_get( image, name, &value ) ) +- return( -1 ); ++ if (vips_image_get(image, name, &value)) ++ return (-1); + +- if( G_VALUE_TYPE( &value ) == VIPS_TYPE_REF_STRING ) { ++ if (G_VALUE_TYPE(&value) == VIPS_TYPE_REF_STRING) { + VipsArea *area; + +- area = g_value_get_boxed( &value ); ++ area = g_value_get_boxed(&value); + *out = area->data; + } +- else if( G_VALUE_TYPE( &value ) == G_TYPE_STRING ) { +- *out = g_value_get_string( &value ); ++ else if (G_VALUE_TYPE(&value) == G_TYPE_STRING) { ++ *out = g_value_get_string(&value); + } + else { +- vips_error( "VipsImage", +- _( "field \"%s\" is of type %s, not VipsRefString" ), ++ vips_error("VipsImage", ++ _("field \"%s\" is of type %s, not VipsRefString"), + name, +- g_type_name( G_VALUE_TYPE( &value ) ) ); +- g_value_unset( &value ); ++ g_type_name(G_VALUE_TYPE(&value))); ++ g_value_unset(&value); + +- return( -1 ); ++ return (-1); + } + +- g_value_unset( &value ); ++ g_value_unset(&value); + +- return( 0 ); ++ return (0); + } + +-/** ++/** + * vips_image_set_string: + * @image: image to attach the metadata to + * @name: metadata name + * @str: metadata value + * +- * Attaches @str as a metadata item on @image as @name. ++ * Attaches @str as a metadata item on @image as @name. + * A convenience + * function over vips_image_set() using #VIPS_TYPE_REF_STRING. + * + * See also: vips_image_get_double(), vips_image_set(). + */ + void +-vips_image_set_string( VipsImage *image, const char *name, const char *str ) ++vips_image_set_string(VipsImage *image, const char *name, const char *str) + { + GValue value = { 0 }; + +- g_value_init( &value, VIPS_TYPE_REF_STRING ); +- vips_value_set_ref_string( &value, str ); +- vips_image_set( image, name, &value ); +- g_value_unset( &value ); ++ g_value_init(&value, VIPS_TYPE_REF_STRING); ++ vips_value_set_ref_string(&value, str); ++ vips_image_set(image, name, &value); ++ g_value_unset(&value); + } + +-/** ++/** + * vips_image_get_as_string: + * @image: image to get the header field from + * @name: field name + * @out: (out) (transfer full): return field value as string + * +- * Returns @name from @image in @out. ++ * Returns @name from @image in @out. + * This function will read any field, returning it as a printable string. + * You need to free the string with g_free() when you are done with it. + * +- * This will base64-encode BLOBs, for example. Use vips_buf_appendgv() to +- * make a string that's for humans. ++ * This will base64-encode BLOBs, for example. Use vips_buf_appendgv() to ++ * make a string that's for humans. + * + * See also: vips_image_get(), vips_image_get_typeof(), vips_buf_appendgv(). + * + * Returns: 0 on success, -1 otherwise. + */ + int +-vips_image_get_as_string( const VipsImage *image, +- const char *name, char **out ) ++vips_image_get_as_string(const VipsImage *image, ++ const char *name, char **out) + { + GValue value = { 0 }; + GType type; + +- if( vips_image_get( image, name, &value ) ) +- return( -1 ); ++ if (vips_image_get(image, name, &value)) ++ return (-1); + + /* Display the save form, if there is one. This way we display + * something useful for ICC profiles, xml fields, etc. + */ +- type = G_VALUE_TYPE( &value ); +- if( g_value_type_transformable( type, VIPS_TYPE_SAVE_STRING ) ) { ++ type = G_VALUE_TYPE(&value); ++ if (g_value_type_transformable(type, VIPS_TYPE_SAVE_STRING)) { + GValue save_value = { 0 }; + +- g_value_init( &save_value, VIPS_TYPE_SAVE_STRING ); +- if( !g_value_transform( &value, &save_value ) ) +- return( -1 ); +- *out = g_strdup( vips_value_get_save_string( &save_value ) ); +- g_value_unset( &save_value ); ++ g_value_init(&save_value, VIPS_TYPE_SAVE_STRING); ++ if (!g_value_transform(&value, &save_value)) ++ return (-1); ++ *out = g_strdup(vips_value_get_save_string(&save_value)); ++ g_value_unset(&save_value); + } +- else +- *out = g_strdup_value_contents( &value ); ++ else ++ *out = g_strdup_value_contents(&value); + +- g_value_unset( &value ); ++ g_value_unset(&value); + +- return( 0 ); ++ return (0); + } + + /** +@@ -1967,52 +1966,52 @@ vips_image_get_as_string( const VipsImage *image, + * @image: image to get the header field from + * @name: field name + * +- * Prints field @name to stdout as ASCII. Handy for debugging. ++ * Prints field @name to stdout as ASCII. Handy for debugging. + */ + void +-vips_image_print_field( const VipsImage *image, const char *name ) ++vips_image_print_field(const VipsImage *image, const char *name) + { + char *str; + +- if( vips_image_get_as_string( image, name, &str ) ) { +- printf( "vips_image_print_field: unable to read field\n" ); ++ if (vips_image_get_as_string(image, name, &str)) { ++ printf("vips_image_print_field: unable to read field\n"); + return; + } + +- printf( ".%s: %s\n", name, str ); ++ printf(".%s: %s\n", name, str); + +- g_free( str ); ++ g_free(str); + } + +-/** ++/** + * vips_image_get_image: + * @image: image to get the metadata from + * @name: metadata name + * @out: (out) (transfer full): return metadata value + * +- * Gets @out from @im under the name @name. ++ * Gets @out from @im under the name @name. + * The field must be of type + * #VIPS_TYPE_IMAGE. You must unref @out with g_object_unref(). + * +- * Use vips_image_get_typeof() to test for the ++ * Use vips_image_get_typeof() to test for the + * existence of a piece of metadata. + * + * See also: vips_image_get(), vips_image_set_image() + * + * Returns: 0 on success, -1 otherwise. + */ +-int +-vips_image_get_image( const VipsImage *image, +- const char *name, VipsImage **out ) ++int ++vips_image_get_image(const VipsImage *image, ++ const char *name, VipsImage **out) + { + GValue value = { 0 }; + +- if( meta_get_value( image, name, VIPS_TYPE_IMAGE, &value ) ) +- return( -1 ); +- *out = g_value_dup_object( &value ); +- g_value_unset( &value ); ++ if (meta_get_value(image, name, VIPS_TYPE_IMAGE, &value)) ++ return (-1); ++ *out = g_value_dup_object(&value); ++ g_value_unset(&value); + +- return( 0 ); ++ return (0); + } + + /** +@@ -2021,54 +2020,54 @@ vips_image_get_image( const VipsImage *image, + * @name: metadata name + * @im: metadata value + * +- * Attaches @im as a metadata item on @image as @name. ++ * Attaches @im as a metadata item on @image as @name. + * A convenience function over vips_image_set(). + * + * See also: vips_image_get_image(), vips_image_set(). + */ +-void +-vips_image_set_image( VipsImage *image, const char *name, VipsImage *im ) ++void ++vips_image_set_image(VipsImage *image, const char *name, VipsImage *im) + { + GValue value = { 0 }; + +- g_value_init( &value, VIPS_TYPE_IMAGE ); +- g_value_set_object( &value, im ); +- vips_image_set( image, name, &value ); +- g_value_unset( &value ); ++ g_value_init(&value, VIPS_TYPE_IMAGE); ++ g_value_set_object(&value, im); ++ vips_image_set(image, name, &value); ++ g_value_unset(&value); + } + +-/** ++/** + * vips_image_get_array_int: + * @image: image to get the metadata from + * @name: metadata name + * @out: (out) (array length=n) (transfer none): return pointer to array + * @n: (out) (optional): return the number of elements here, optionally + * +- * Gets @out from @im under the name @name. ++ * Gets @out from @im under the name @name. + * The field must be of type + * #VIPS_TYPE_ARRAY_INT. + * + * Do not free @out. @out is valid as long as @image is valid. + * +- * Use vips_image_get_typeof() to test for the ++ * Use vips_image_get_typeof() to test for the + * existence of a piece of metadata. + * + * See also: vips_image_get(), vips_image_set_image() + * + * Returns: 0 on success, -1 otherwise. + */ +-int +-vips_image_get_array_int( VipsImage *image, const char *name, +- int **out, int *n ) ++int ++vips_image_get_array_int(VipsImage *image, const char *name, ++ int **out, int *n) + { + GValue value = { 0 }; + +- if( meta_get_value( image, name, VIPS_TYPE_ARRAY_INT, &value ) ) +- return( -1 ); +- *out = vips_value_get_array_int( &value, n ); +- g_value_unset( &value ); ++ if (meta_get_value(image, name, VIPS_TYPE_ARRAY_INT, &value)) ++ return (-1); ++ *out = vips_value_get_array_int(&value, n); ++ g_value_unset(&value); + +- return( 0 ); ++ return (0); + } + + /** +@@ -2076,39 +2075,39 @@ vips_image_get_array_int( VipsImage *image, const char *name, + * @image: image to attach the metadata to + * @name: metadata name + * @array: (array length=n) (allow-none): array of ints +- * @n: the number of elements ++ * @n: the number of elements + * +- * Attaches @array as a metadata item on @image as @name. ++ * Attaches @array as a metadata item on @image as @name. + * A convenience function over vips_image_set(). + * + * See also: vips_image_get_image(), vips_image_set(). + */ + void +-vips_image_set_array_int( VipsImage *image, const char *name, +- const int *array, int n ) ++vips_image_set_array_int(VipsImage *image, const char *name, ++ const int *array, int n) + { + GValue value = { 0 }; + +- g_value_init( &value, VIPS_TYPE_ARRAY_INT ); +- vips_value_set_array_int( &value, array, n ); +- vips_image_set( image, name, &value ); +- g_value_unset( &value ); ++ g_value_init(&value, VIPS_TYPE_ARRAY_INT); ++ vips_value_set_array_int(&value, array, n); ++ vips_image_set(image, name, &value); ++ g_value_unset(&value); + } + +-/** ++/** + * vips_image_get_array_double: + * @image: image to get the metadata from + * @name: metadata name + * @out: (out) (array length=n) (transfer none): return pointer to array + * @n: (out) (optional): return the number of elements here, optionally + * +- * Gets @out from @im under the name @name. ++ * Gets @out from @im under the name @name. + * The field must be of type + * #VIPS_TYPE_ARRAY_INT. + * + * Do not free @out. @out is valid as long as @image is valid. + * +- * Use vips_image_get_typeof() to test for the ++ * Use vips_image_get_typeof() to test for the + * existence of a piece of metadata. + * + * See also: vips_image_get(), vips_image_set_image() +@@ -2116,17 +2115,17 @@ vips_image_set_array_int( VipsImage *image, const char *name, + * Returns: 0 on success, -1 otherwise. + */ + int +-vips_image_get_array_double( VipsImage *image, const char *name, +- double **out, int *n ) ++vips_image_get_array_double(VipsImage *image, const char *name, ++ double **out, int *n) + { + GValue value = { 0 }; + +- if( meta_get_value( image, name, VIPS_TYPE_ARRAY_DOUBLE, &value ) ) +- return( -1 ); +- *out = vips_value_get_array_double( &value, n ); +- g_value_unset( &value ); ++ if (meta_get_value(image, name, VIPS_TYPE_ARRAY_DOUBLE, &value)) ++ return (-1); ++ *out = vips_value_get_array_double(&value, n); ++ g_value_unset(&value); + +- return( 0 ); ++ return (0); + } + + /** +@@ -2134,23 +2133,23 @@ vips_image_get_array_double( VipsImage *image, const char *name, + * @image: image to attach the metadata to + * @name: metadata name + * @array: (array length=n) (allow-none): array of doubles +- * @n: the number of elements ++ * @n: the number of elements + * +- * Attaches @array as a metadata item on @image as @name. ++ * Attaches @array as a metadata item on @image as @name. + * A convenience function over vips_image_set(). + * + * See also: vips_image_get_image(), vips_image_set(). + */ + void +-vips_image_set_array_double( VipsImage *image, const char *name, +- const double *array, int n ) ++vips_image_set_array_double(VipsImage *image, const char *name, ++ const double *array, int n) + { + GValue value = { 0 }; + +- g_value_init( &value, VIPS_TYPE_ARRAY_DOUBLE ); +- vips_value_set_array_double( &value, array, n ); +- vips_image_set( image, name, &value ); +- g_value_unset( &value ); ++ g_value_init(&value, VIPS_TYPE_ARRAY_DOUBLE); ++ vips_value_set_array_double(&value, array, n); ++ vips_image_set(image, name, &value); ++ g_value_unset(&value); + } + + /** +@@ -2166,7 +2165,7 @@ vips_image_set_array_double( VipsImage *image, const char *name, + * For example: + * + * |[ +- * vips_image_history_printf (image, "vips invert %s %s", ++ * vips_image_history_printf (image, "vips invert %s %s", + * in->filename, out->filename); + * ]| + * +@@ -2176,41 +2175,41 @@ vips_image_set_array_double( VipsImage *image, const char *name, + * "vips invert /home/john/fred.v /home/john/jim.v # Fri Apr 3 23:30:35 2009\n" + * ]| + * +- * VIPS operations don't add history lines for you because a single action at ++ * VIPS operations don't add history lines for you because a single action at + * the application level might involve many VIPS operations. History must be + * recorded by the application. + * + * Returns: 0 on success, -1 on error. + */ +-int +-vips_image_history_printf( VipsImage *image, const char *fmt, ... ) ++int ++vips_image_history_printf(VipsImage *image, const char *fmt, ...) + { + va_list args; + char str[VIPS_PATH_MAX]; +- VipsBuf buf = VIPS_BUF_STATIC( str ); ++ VipsBuf buf = VIPS_BUF_STATIC(str); + time_t timebuf; + +- va_start( args, fmt ); +- (void) vips_buf_vappendf( &buf, fmt, args ); +- va_end( args ); +- vips_buf_appends( &buf, " # " ); ++ va_start(args, fmt); ++ (void) vips_buf_vappendf(&buf, fmt, args); ++ va_end(args); ++ vips_buf_appends(&buf, " # "); + + /* Add the date. ctime always attaches a '\n', gah. + */ +- time( &timebuf ); +- vips_buf_appends( &buf, ctime( &timebuf ) ); +- vips_buf_removec( &buf, '\n' ); ++ time(&timebuf); ++ vips_buf_appends(&buf, ctime(&timebuf)); ++ vips_buf_removec(&buf, '\n'); + + #ifdef DEBUG +- printf( "vips_image_history_printf: " +- "adding:\n\t%s\nto history on image %p\n", +- vips_buf_all( &buf ), image ); ++ printf("vips_image_history_printf: " ++ "adding:\n\t%s\nto history on image %p\n", ++ vips_buf_all(&buf), image); + #endif /*DEBUG*/ + +- image->history_list = g_slist_append( image->history_list, +- vips__gvalue_ref_string_new( vips_buf_all( &buf ) ) ); ++ image->history_list = g_slist_append(image->history_list, ++ vips__gvalue_ref_string_new(vips_buf_all(&buf))); + +- return( 0 ); ++ return (0); + } + + /** +@@ -2228,25 +2227,25 @@ vips_image_history_printf( VipsImage *image, const char *fmt, ... ) + * + * Returns: 0 on success, -1 on error. + */ +-int +-vips_image_history_args( VipsImage *image, +- const char *name, int argc, char *argv[] ) +-{ ++int ++vips_image_history_args(VipsImage *image, ++ const char *name, int argc, char *argv[]) ++{ + int i; + char txt[1024]; +- VipsBuf buf = VIPS_BUF_STATIC( txt ); ++ VipsBuf buf = VIPS_BUF_STATIC(txt); + +- vips_buf_appends( &buf, name ); ++ vips_buf_appends(&buf, name); + +- for( i = 0; i < argc; i++ ) { +- vips_buf_appends( &buf, " " ); +- vips_buf_appends( &buf, argv[i] ); ++ for (i = 0; i < argc; i++) { ++ vips_buf_appends(&buf, " "); ++ vips_buf_appends(&buf, argv[i]); + } + +- if( vips_image_history_printf( image, "%s", vips_buf_all( &buf ) ) ) +- return( -1 ); ++ if (vips_image_history_printf(image, "%s", vips_buf_all(&buf))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /** +@@ -2258,7 +2257,7 @@ vips_image_history_args( VipsImage *image, + * + * VIPS tracks the history of each image, that is, the sequence of operations + * that generated that image. Applications built on VIPS need to call +- * vips_image_history_printf() for each action they perform, setting the ++ * vips_image_history_printf() for each action they perform, setting the + * command-line equivalent for the action. + * + * See also: vips_image_history_printf(). +@@ -2266,19 +2265,19 @@ vips_image_history_args( VipsImage *image, + * Returns: (transfer none): The history of @image as a C string. Do not free! + */ + const char * +-vips_image_get_history( VipsImage *image ) ++vips_image_get_history(VipsImage *image) + { +- if( !image->Hist ) +- image->Hist = vips__gslist_gvalue_get( image->history_list ); ++ if (!image->Hist) ++ image->Hist = vips__gslist_gvalue_get(image->history_list); + +- return( image->Hist ? image->Hist : "" ); ++ return (image->Hist ? image->Hist : ""); + } + + /* Called during vips_init(). + */ + void +-vips__meta_init( void ) ++vips__meta_init(void) + { +- if( !vips__meta_lock ) ++ if (!vips__meta_lock) + vips__meta_lock = vips_g_mutex_new(); + } +diff --git a/libvips/iofuncs/image.c b/libvips/iofuncs/image.c +index 267b7b616e..4a9b02e1b7 100644 +--- a/libvips/iofuncs/image.c ++++ b/libvips/iofuncs/image.c +@@ -1,5 +1,5 @@ + /* vips image class +- * ++ * + * 4/2/11 + * - hacked up from various places + * 6/6/13 +@@ -24,28 +24,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -74,46 +74,46 @@ + * SECTION: image + * @short_description: the VIPS image class + * @stability: Stable +- * @see_also: header +- * VipsRegion ++ * @see_also: header ++ * VipsRegion + * generate +- * VipsOperation ++ * VipsOperation + * @include: vips/vips.h + * + * The image class and associated types and macros. + * + * Images can be created from formatted files on disc, from C-style arrays on + * disc, from formatted areas of memory, or from C-style arrays in memory. See +- * vips_image_new_from_file() and friends. ++ * vips_image_new_from_file() and friends. + * Creating an image is fast. VIPS reads just enough of + * the image to be able to get the various properties, such as width in + * pixels. It delays reading any pixels until they are really needed. + * +- * Once you have an image, you can get properties from it in the usual way. +- * You can use projection functions, like vips_image_get_width() or +- * g_object_get(), to get %GObject properties. +- * +- * VIPS images are three-dimensional arrays, the dimensions being width, +- * height and bands. Each dimension can be up to 2 ** 31 pixels (or band +- * elements). An image has a format, meaning the machine number type used +- * to represent each value. VIPS supports 10 formats, from 8-bit unsigned +- * integer up to 128-bit double complex, see vips_image_get_format(). +- * +- * In VIPS, images are uninterpreted arrays, meaning that from the point of +- * view of most operations, they are just large collections of numbers. +- * There's no difference between an RGBA (RGB with alpha) image and a CMYK +- * image, for example, they are both just four-band images. It's up to the +- * user of the library to pass the right sort of image to each operation. +- * +- * To take an example, VIPS has vips_Lab2XYZ(), an operation to transform +- * an image from CIE LAB colour space to CIE XYZ space. It assumes the +- * first three bands represent pixels in LAB colour space and returns an +- * image where the first three bands are transformed to XYZ and any +- * remaining bands are just copied. Pass it a RGB image by mistake and ++ * Once you have an image, you can get properties from it in the usual way. ++ * You can use projection functions, like vips_image_get_width() or ++ * g_object_get(), to get %GObject properties. ++ * ++ * VIPS images are three-dimensional arrays, the dimensions being width, ++ * height and bands. Each dimension can be up to 2 ** 31 pixels (or band ++ * elements). An image has a format, meaning the machine number type used ++ * to represent each value. VIPS supports 10 formats, from 8-bit unsigned ++ * integer up to 128-bit double complex, see vips_image_get_format(). ++ * ++ * In VIPS, images are uninterpreted arrays, meaning that from the point of ++ * view of most operations, they are just large collections of numbers. ++ * There's no difference between an RGBA (RGB with alpha) image and a CMYK ++ * image, for example, they are both just four-band images. It's up to the ++ * user of the library to pass the right sort of image to each operation. ++ * ++ * To take an example, VIPS has vips_Lab2XYZ(), an operation to transform ++ * an image from CIE LAB colour space to CIE XYZ space. It assumes the ++ * first three bands represent pixels in LAB colour space and returns an ++ * image where the first three bands are transformed to XYZ and any ++ * remaining bands are just copied. Pass it a RGB image by mistake and + * you'll just get nonsense. + * +- * VIPS has a feature to help (a little) with this: it sets a +- * #VipsInterpretation hint for each image (see ++ * VIPS has a feature to help (a little) with this: it sets a ++ * #VipsInterpretation hint for each image (see + * vips_image_get_interpretation()); a hint which says how pixels should + * be interpreted. For example, vips_Lab2XYZ() will set the + * interpretation of the output image to #VIPS_INTERPRETATION_XYZ. A +@@ -130,13 +130,13 @@ + * You can also write images to other images. Create, for example, a temporary + * disc image with vips_image_new_temp_file(), then write your image to that + * with vips_image_write(). You can create several other types of image and +- * write to them, see vips_image_new_memory(), for example. ++ * write to them, see vips_image_new_memory(), for example. + * + * See operation for an introduction to + * running operations on images, see header for getting and setting image + * metadata. See object for a discussion of +- * the lower levels. ++ * the lower levels. + */ + + /** +@@ -151,53 +151,53 @@ + * The first four bytes of a VIPS file in SPARC byte ordering. + */ + +-/** ++/** + * VipsAccess: + * @VIPS_ACCESS_RANDOM: can read anywhere + * @VIPS_ACCESS_SEQUENTIAL: top-to-bottom reading only, but with a small buffer + * + * The type of access an operation has to supply. See vips_tilecache() +- * and #VipsForeign. ++ * and #VipsForeign. + * +- * @VIPS_ACCESS_RANDOM means requests can come in any order. ++ * @VIPS_ACCESS_RANDOM means requests can come in any order. + * + * @VIPS_ACCESS_SEQUENTIAL means requests will be top-to-bottom, but with some +- * amount of buffering behind the read point for small non-local accesses. ++ * amount of buffering behind the read point for small non-local accesses. + */ + +-/** ++/** + * VipsDemandStyle: + * @VIPS_DEMAND_STYLE_SMALLTILE: demand in small (typically 64x64 pixel) tiles + * @VIPS_DEMAND_STYLE_FATSTRIP: demand in fat (typically 10 pixel high) strips + * @VIPS_DEMAND_STYLE_THINSTRIP: demand in thin (typically 1 pixel high) strips + * @VIPS_DEMAND_STYLE_ANY: demand geometry does not matter + * +- * See vips_image_pipelinev(). Operations can hint to the VIPS image IO +- * system about the kind of demand geometry they prefer. ++ * See vips_image_pipelinev(). Operations can hint to the VIPS image IO ++ * system about the kind of demand geometry they prefer. + * + * These demand styles are given below in order of increasing +- * restrictiveness. When demanding output from a pipeline, ++ * restrictiveness. When demanding output from a pipeline, + * vips_image_generate() +- * will use the most restrictive of the styles requested by the operations ++ * will use the most restrictive of the styles requested by the operations + * in the pipeline. + * +- * #VIPS_DEMAND_STYLE_THINSTRIP --- This operation would like to output strips +- * the width of the image and a few pels high. This is option suitable for ++ * #VIPS_DEMAND_STYLE_THINSTRIP --- This operation would like to output strips ++ * the width of the image and a few pels high. This is option suitable for + * point-to-point operations, such as those in the arithmetic package. + * +- * This option is only efficient for cases where each output pel depends ++ * This option is only efficient for cases where each output pel depends + * upon the pel in the corresponding position in the input image. + * +- * #VIPS_DEMAND_STYLE_FATSTRIP --- This operation would like to output strips +- * the width of the image and as high as possible. This option is suitable +- * for area operations which do not violently transform coordinates, such +- * as vips_conv(). ++ * #VIPS_DEMAND_STYLE_FATSTRIP --- This operation would like to output strips ++ * the width of the image and as high as possible. This option is suitable ++ * for area operations which do not violently transform coordinates, such ++ * as vips_conv(). + * + * #VIPS_DEMAND_STYLE_SMALLTILE --- This is the most general demand format. +- * Output is demanded in small (around 100x100 pel) sections. This style works ++ * Output is demanded in small (around 100x100 pel) sections. This style works + * reasonably efficiently, even for bizzare operations like 45 degree rotate. + * +- * #VIPS_DEMAND_STYLE_ANY --- This image is not being demand-read from a disc ++ * #VIPS_DEMAND_STYLE_ANY --- This image is not being demand-read from a disc + * file (even indirectly) so any demand style is OK. It's used for things like + * vips_black() where the pixels are calculated. + * +@@ -205,12 +205,12 @@ + */ + + /** +- * VipsInterpretation: ++ * VipsInterpretation: + * @VIPS_INTERPRETATION_MULTIBAND: generic many-band image + * @VIPS_INTERPRETATION_B_W: some kind of single-band image + * @VIPS_INTERPRETATION_HISTOGRAM: a 1D image, eg. histogram or lookup table + * @VIPS_INTERPRETATION_FOURIER: image is in fourier space +- * @VIPS_INTERPRETATION_XYZ: the first three bands are CIE XYZ ++ * @VIPS_INTERPRETATION_XYZ: the first three bands are CIE XYZ + * @VIPS_INTERPRETATION_LAB: pixels are in CIE Lab space + * @VIPS_INTERPRETATION_CMYK: the first four bands are in CMYK space + * @VIPS_INTERPRETATION_LABQ: implies #VIPS_CODING_LABQ +@@ -227,18 +227,18 @@ + * @VIPS_INTERPRETATION_MATRIX: a matrix + * + * How the values in an image should be interpreted. For example, a +- * three-band float image of type #VIPS_INTERPRETATION_LAB should have its ++ * three-band float image of type #VIPS_INTERPRETATION_LAB should have its + * pixels interpreted as coordinates in CIE Lab space. + * + * RGB and sRGB are treated in the same way. Use the colourspace functions if + * you want some other behaviour. + * +- * The gaps in numbering are historical and must be maintained. Allocate ++ * The gaps in numbering are historical and must be maintained. Allocate + * new numbers from the end. + */ + + /** +- * VipsBandFormat: ++ * VipsBandFormat: + * @VIPS_FORMAT_NOTSET: invalid setting + * @VIPS_FORMAT_UCHAR: unsigned char format + * @VIPS_FORMAT_CHAR: char format +@@ -251,36 +251,36 @@ + * @VIPS_FORMAT_DOUBLE: double float format + * @VIPS_FORMAT_DPCOMPLEX: double complex (two double) format + * +- * The format used for each band element. ++ * The format used for each band element. + * + * Each corresponds to a native C type for the current machine. For example, + * #VIPS_FORMAT_USHORT is unsigned short. + */ + + /** +- * VipsCoding: ++ * VipsCoding: + * @VIPS_CODING_NONE: pixels are not coded + * @VIPS_CODING_LABQ: pixels encode 3 float CIELAB values as 4 uchar + * @VIPS_CODING_RAD: pixels encode 3 float RGB as 4 uchar (Radiance coding) + * +- * How pixels are coded. ++ * How pixels are coded. + * + * Normally, pixels are uncoded and can be manipulated as you would expect. + * However some file formats code pixels for compression, and sometimes it's + * useful to be able to manipulate images in the coded format. + * +- * The gaps in the numbering are historical and must be maintained. Allocate ++ * The gaps in the numbering are historical and must be maintained. Allocate + * new numbers from the end. + */ + +-/** ++/** + * VipsProgress: +- * @run: Time we have been running +- * @eta: Estimated seconds of computation left ++ * @run: Time we have been running ++ * @eta: Estimated seconds of computation left + * @tpels: Number of pels we expect to calculate + * @npels: Number of pels calculated so far + * @percent: Percent complete +- * @start: Start time ++ * @start: Start time + * + * A structure available to eval callbacks giving information on evaluation + * progress. See #VipsImage::eval. +@@ -335,16 +335,16 @@ + * @X: x coordinate + * @Y: y coordinate + * +- * This macro returns a pointer to a pixel in an image, cast to a #VipsPel *. ++ * This macro returns a pointer to a pixel in an image, cast to a #VipsPel *. + * It only works for + * images which are fully available in memory, so memory buffers and small + * mapped images only. +- * ++ * + * If VIPS_DEBUG is defined, you get a version that checks bounds for you. + * + * See also: vips_image_wio_input(), vips_image_inplace(), VIPS_REGION_ADDR(). + * +- * Returns: The address of pixel (@X,@Y) in @I. ++ * Returns: The address of pixel (@X,@Y) in @I. + */ + + /** +@@ -354,27 +354,27 @@ + * @Y: y coordinate + * + * This macro returns a pointer to a pixel in an image, cast to a double*. The +- * image must have a single band, be #VIPS_FORMAT_DOUBLE and be ++ * image must have a single band, be #VIPS_FORMAT_DOUBLE and be + * fully available in memory, so memory buffers and small + * mapped images only. +- * ++ * + * If VIPS_DEBUG is defined, you get a version that checks bounds and image + * type for you. + * +- * See also: vips_image_wio_input(), vips_image_inplace(), vips_check_matrix(). ++ * See also: vips_image_wio_input(), vips_image_inplace(), vips_check_matrix(). + * + * Returns: The address of pixel (@X,@Y) in @I. + */ + +-/* Our signals. ++/* Our signals. + */ + enum { +- SIG_PREEVAL, +- SIG_EVAL, +- SIG_POSTEVAL, +- SIG_WRITTEN, +- SIG_INVALIDATE, +- SIG_MINIMISE, ++ SIG_PREEVAL, ++ SIG_EVAL, ++ SIG_POSTEVAL, ++ SIG_WRITTEN, ++ SIG_INVALIDATE, ++ SIG_MINIMISE, + SIG_LAST + }; + +@@ -382,7 +382,7 @@ enum { + */ + int vips__progress = 0; + +-/* A string giving the image size (in bytes of uncompressed image) above which ++/* A string giving the image size (in bytes of uncompressed image) above which + * we decompress to disc on open. Can be eg. "12m" for 12 megabytes. + */ + char *vips__disc_threshold = NULL; +@@ -393,7 +393,7 @@ static GMutex *vips__minimise_lock = NULL; + + static guint vips_image_signals[SIG_LAST] = { 0 }; + +-G_DEFINE_TYPE( VipsImage, vips_image, VIPS_TYPE_OBJECT ); ++G_DEFINE_TYPE(VipsImage, vips_image, VIPS_TYPE_OBJECT); + + /** + * vips_progress_set: +@@ -404,42 +404,42 @@ G_DEFINE_TYPE( VipsImage, vips_image, VIPS_TYPE_OBJECT ); + * setting the environment variable VIPS_PROGRESS. + */ + void +-vips_progress_set( gboolean progress ) ++vips_progress_set(gboolean progress) + { + vips__progress = progress; + } + + static void +-vips_image_delete( VipsImage *image ) ++vips_image_delete(VipsImage *image) + { +- if( image->delete_on_close ) { +- g_assert( image->delete_on_close_filename ); ++ if (image->delete_on_close) { ++ g_assert(image->delete_on_close_filename); + +- VIPS_DEBUG_MSG( "vips_image_delete: removing temp %s\n", +- image->delete_on_close_filename ); +- g_unlink( image->delete_on_close_filename ); +- VIPS_FREE( image->delete_on_close_filename ); ++ VIPS_DEBUG_MSG("vips_image_delete: removing temp %s\n", ++ image->delete_on_close_filename); ++ g_unlink(image->delete_on_close_filename); ++ VIPS_FREE(image->delete_on_close_filename); + image->delete_on_close = FALSE; + } + } + + static void +-vips_image_finalize( GObject *gobject ) ++vips_image_finalize(GObject *gobject) + { +- VipsImage *image = VIPS_IMAGE( gobject ); ++ VipsImage *image = VIPS_IMAGE(gobject); + +- VIPS_DEBUG_MSG( "vips_image_finalize: %p\n", gobject ); ++ VIPS_DEBUG_MSG("vips_image_finalize: %p\n", gobject); + + /* Should be no regions defined on the image, since they all hold a + * ref to their host image. + */ +- g_assert( !image->regions ); ++ g_assert(!image->regions); + + /* Therefore there should be no windows. + */ +- g_assert( !image->windows ); ++ g_assert(!image->windows); + +- /* Junk generate functions. ++ /* Junk generate functions. + */ + image->start_fn = NULL; + image->generate_fn = NULL; +@@ -449,20 +449,20 @@ vips_image_finalize( GObject *gobject ) + + /* No more upstream/downstream links. + */ +- vips__link_break_all( image ); ++ vips__link_break_all(image); + +- if( image->time ) { +- VIPS_FREEF( g_timer_destroy, image->time->start ); +- VIPS_FREE( image->time ); ++ if (image->time) { ++ VIPS_FREEF(g_timer_destroy, image->time->start); ++ VIPS_FREE(image->time); + } + + /* Free attached memory. + */ +- if( image->data ) { +- if( image->dtype == VIPS_IMAGE_SETBUF ) { +- VIPS_DEBUG_MSG( "vips_image_finalize: " +- "freeing buffer\n" ); +- vips_tracked_free( image->data ); ++ if (image->data) { ++ if (image->dtype == VIPS_IMAGE_SETBUF) { ++ VIPS_DEBUG_MSG("vips_image_finalize: " ++ "freeing buffer\n"); ++ vips_tracked_free(image->data); + image->dtype = VIPS_IMAGE_NONE; + } + +@@ -471,43 +471,43 @@ vips_image_finalize( GObject *gobject ) + + /* Delete associated files. + */ +- vips_image_delete( image ); ++ vips_image_delete(image); + +- VIPS_FREEF( vips_g_mutex_free, image->sslock ); ++ VIPS_FREEF(vips_g_mutex_free, image->sslock); + +- VIPS_FREE( image->Hist ); +- VIPS_FREEF( vips__gslist_gvalue_free, image->history_list ); +- vips__meta_destroy( image ); ++ VIPS_FREE(image->Hist); ++ VIPS_FREEF(vips__gslist_gvalue_free, image->history_list); ++ vips__meta_destroy(image); + +- G_OBJECT_CLASS( vips_image_parent_class )->finalize( gobject ); ++ G_OBJECT_CLASS(vips_image_parent_class)->finalize(gobject); + } + + static void +-vips_image_dispose( GObject *gobject ) ++vips_image_dispose(GObject *gobject) + { +- VipsImage *image = VIPS_IMAGE( gobject ); ++ VipsImage *image = VIPS_IMAGE(gobject); + +- VIPS_DEBUG_MSG( "vips_image_dispose: %p\n", gobject ); ++ VIPS_DEBUG_MSG("vips_image_dispose: %p\n", gobject); + + #ifdef DEBUG_LEAK +-{ +- VipsImagePixels *pixels = g_object_get_qdata( G_OBJECT( image ), +- vips__image_pixels_quark ); +- +- if( pixels && +- pixels->tpels ) { +- int compute_percent = 100.0 * pixels->npels / pixels->tpels; +- +- if( compute_percent > 100 ) +- printf( "vips_image_dispose: %s %s computed %d%%\n", +- image->filename, +- pixels->nickname, +- compute_percent ); ++ { ++ VipsImagePixels *pixels = g_object_get_qdata(G_OBJECT(image), ++ vips__image_pixels_quark); ++ ++ if (pixels && ++ pixels->tpels) { ++ int compute_percent = 100.0 * pixels->npels / pixels->tpels; ++ ++ if (compute_percent > 100) ++ printf("vips_image_dispose: %s %s computed %d%%\n", ++ image->filename, ++ pixels->nickname, ++ compute_percent); ++ } + } +-} + #endif /*DEBUG_LEAK*/ + +- vips_object_preclose( VIPS_OBJECT( gobject ) ); ++ vips_object_preclose(VIPS_OBJECT(gobject)); + + /* We have to junk the fd in dispose, since we run this for rewind and + * we must close and reopen the file when we switch from write to +@@ -516,12 +516,12 @@ vips_image_dispose( GObject *gobject ) + + /* Any file mapping? + */ +- if( image->baseaddr ) { ++ if (image->baseaddr) { + /* MMAP file. + */ +- VIPS_DEBUG_MSG( "vips_image_dispose: unmapping file\n" ); ++ VIPS_DEBUG_MSG("vips_image_dispose: unmapping file\n"); + +- vips__munmap( image->baseaddr, image->length ); ++ vips__munmap(image->baseaddr, image->length); + image->baseaddr = NULL; + image->length = 0; + +@@ -533,20 +533,20 @@ vips_image_dispose( GObject *gobject ) + + /* Is there a file descriptor? + */ +- if( image->fd != -1 ) { +- VIPS_DEBUG_MSG( "vips_image_dispose: closing output file\n" ); ++ if (image->fd != -1) { ++ VIPS_DEBUG_MSG("vips_image_dispose: closing output file\n"); + +- if( vips_tracked_close( image->fd ) == -1 ) +- vips_error( "VipsImage", +- "%s", _( "unable to close fd" ) ); ++ if (vips_tracked_close(image->fd) == -1) ++ vips_error("VipsImage", ++ "%s", _("unable to close fd")); + image->fd = -1; + } + +- G_OBJECT_CLASS( vips_image_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_image_parent_class)->dispose(gobject); + } + + static VipsObject * +-vips_image_new_from_file_object( const char *string ) ++vips_image_new_from_file_object(const char *string) + { + VipsImage *image; + +@@ -555,182 +555,182 @@ vips_image_new_from_file_object( const char *string ) + /* We mustn't _build() the object here, so we can't just call + * vips_image_new_from_file(). + */ +- image = VIPS_IMAGE( g_object_new( VIPS_TYPE_IMAGE, NULL ) ); +- g_object_set( image, ++ image = VIPS_IMAGE(g_object_new(VIPS_TYPE_IMAGE, NULL)); ++ g_object_set(image, + "filename", string, + "mode", "r", +- NULL ); ++ NULL); + +- return( VIPS_OBJECT( image ) ); ++ return (VIPS_OBJECT(image)); + } + + static void +-vips_image_to_string( VipsObject *object, VipsBuf *buf ) ++vips_image_to_string(VipsObject *object, VipsBuf *buf) + { +- VipsImage *image = VIPS_IMAGE( object ); ++ VipsImage *image = VIPS_IMAGE(object); + +- vips_buf_appends( buf, image->filename ); ++ vips_buf_appends(buf, image->filename); + } + +-static int +-vips_image_write_object( VipsObject *object, const char *string ) ++static int ++vips_image_write_object(VipsObject *object, const char *string) + { +- return( vips_image_write_to_file( VIPS_IMAGE( object ), string, +- NULL ) ); ++ return (vips_image_write_to_file(VIPS_IMAGE(object), string, ++ NULL)); + } + + static void * +-print_field_fn( VipsImage *image, const char *field, GValue *value, void *a ) ++print_field_fn(VipsImage *image, const char *field, GValue *value, void *a) + { + VipsBuf *buf = (VipsBuf *) a; + +- vips_buf_appendf( buf, "%s: ", field ); +- vips_buf_appendgv( buf, value ); +- vips_buf_appendf( buf, "\n" ); ++ vips_buf_appendf(buf, "%s: ", field); ++ vips_buf_appendgv(buf, value); ++ vips_buf_appendf(buf, "\n"); + +- return( NULL ); ++ return (NULL); + } + + static void +-vips_image_dump( VipsObject *object, VipsBuf *buf ) ++vips_image_dump(VipsObject *object, VipsBuf *buf) + { +- VipsImage *image = VIPS_IMAGE( object ); ++ VipsImage *image = VIPS_IMAGE(object); + +- vips_buf_appendf( buf, +- g_dngettext( GETTEXT_PACKAGE, +- "%dx%d %s, %d band, %s", +- "%dx%d %s, %d bands, %s", +- vips_image_get_bands( image ) ), +- vips_image_get_width( image ), +- vips_image_get_height( image ), +- vips_enum_nick( VIPS_TYPE_BAND_FORMAT, +- vips_image_get_format( image ) ), +- vips_image_get_bands( image ), +- vips_enum_nick( VIPS_TYPE_INTERPRETATION, +- vips_image_get_interpretation( image ) ) ); ++ vips_buf_appendf(buf, ++ g_dngettext(GETTEXT_PACKAGE, ++ "%dx%d %s, %d band, %s", ++ "%dx%d %s, %d bands, %s", ++ vips_image_get_bands(image)), ++ vips_image_get_width(image), ++ vips_image_get_height(image), ++ vips_enum_nick(VIPS_TYPE_BAND_FORMAT, ++ vips_image_get_format(image)), ++ vips_image_get_bands(image), ++ vips_enum_nick(VIPS_TYPE_INTERPRETATION, ++ vips_image_get_interpretation(image))); + +- vips_buf_appendf( buf, ", %s", +- vips_enum_nick( VIPS_TYPE_IMAGE_TYPE, image->dtype ) ); ++ vips_buf_appendf(buf, ", %s", ++ vips_enum_nick(VIPS_TYPE_IMAGE_TYPE, image->dtype)); + +- VIPS_OBJECT_CLASS( vips_image_parent_class )->dump( object, buf ); ++ VIPS_OBJECT_CLASS(vips_image_parent_class)->dump(object, buf); + +- vips_buf_appendf( buf, "\n" ); ++ vips_buf_appendf(buf, "\n"); + +- (void) vips_image_map( image, print_field_fn, (void *) buf ); ++ (void) vips_image_map(image, print_field_fn, (void *) buf); + +- vips_buf_appendf( buf, "Hist: %s", vips_image_get_history( image ) ); ++ vips_buf_appendf(buf, "Hist: %s", vips_image_get_history(image)); + } + + static void +-vips_image_summary( VipsObject *object, VipsBuf *buf ) ++vips_image_summary(VipsObject *object, VipsBuf *buf) + { +- VipsImage *image = VIPS_IMAGE( object ); ++ VipsImage *image = VIPS_IMAGE(object); + const char *p; + +- vips_buf_appendf( buf, "%dx%d", +- vips_image_get_width( image ), vips_image_get_height( image ) ); +- if( vips_image_get_coding( image ) == VIPS_CODING_NONE ) { +- vips_buf_appendf( buf, +- g_dngettext( GETTEXT_PACKAGE, +- " %s, %d band, %s", +- " %s, %d bands, %s", +- vips_image_get_bands( image ) ), +- vips_enum_nick( VIPS_TYPE_BAND_FORMAT, +- vips_image_get_format( image ) ), +- vips_image_get_bands( image ), +- vips_enum_nick( VIPS_TYPE_INTERPRETATION, +- vips_image_get_interpretation( image ) ) ); ++ vips_buf_appendf(buf, "%dx%d", ++ vips_image_get_width(image), vips_image_get_height(image)); ++ if (vips_image_get_coding(image) == VIPS_CODING_NONE) { ++ vips_buf_appendf(buf, ++ g_dngettext(GETTEXT_PACKAGE, ++ " %s, %d band, %s", ++ " %s, %d bands, %s", ++ vips_image_get_bands(image)), ++ vips_enum_nick(VIPS_TYPE_BAND_FORMAT, ++ vips_image_get_format(image)), ++ vips_image_get_bands(image), ++ vips_enum_nick(VIPS_TYPE_INTERPRETATION, ++ vips_image_get_interpretation(image))); + } + else { +- vips_buf_appendf( buf, ", %s", +- vips_enum_nick( VIPS_TYPE_CODING, +- vips_image_get_coding( image ) ) ); ++ vips_buf_appendf(buf, ", %s", ++ vips_enum_nick(VIPS_TYPE_CODING, ++ vips_image_get_coding(image))); + } + +- if( vips_image_get_typeof( image, VIPS_META_LOADER ) && +- !vips_image_get_string( image, VIPS_META_LOADER, &p ) ) +- vips_buf_appendf( buf, ", %s", p ); ++ if (vips_image_get_typeof(image, VIPS_META_LOADER) && ++ !vips_image_get_string(image, VIPS_META_LOADER, &p)) ++ vips_buf_appendf(buf, ", %s", p); + +- VIPS_OBJECT_CLASS( vips_image_parent_class )->summary( object, buf ); ++ VIPS_OBJECT_CLASS(vips_image_parent_class)->summary(object, buf); + } + + static void * +-vips_image_sanity_upstream( VipsImage *up, VipsImage *down, void *b ) ++vips_image_sanity_upstream(VipsImage *up, VipsImage *down, void *b) + { +- if( !g_slist_find( up->downstream, down ) || +- !g_slist_find( down->upstream, up ) ) +- return( up ); ++ if (!g_slist_find(up->downstream, down) || ++ !g_slist_find(down->upstream, up)) ++ return (up); + +- return( NULL ); ++ return (NULL); + } + + static void * +-vips_image_sanity_downstream( VipsImage *down, VipsImage *up, void *b ) ++vips_image_sanity_downstream(VipsImage *down, VipsImage *up, void *b) + { +- return( vips_image_sanity_upstream( up, down, b ) ); ++ return (vips_image_sanity_upstream(up, down, b)); + } + + static void +-vips_image_sanity( VipsObject *object, VipsBuf *buf ) ++vips_image_sanity(VipsObject *object, VipsBuf *buf) + { +- VipsImage *image = VIPS_IMAGE( object ); ++ VipsImage *image = VIPS_IMAGE(object); + + /* All 0 means im has been inited but never used. + */ +- if( image->Xsize != 0 || ++ if (image->Xsize != 0 || + image->Ysize != 0 || +- image->Bands != 0 ) { +- if( image->Xsize <= 0 || +- image->Ysize <= 0 || +- image->Bands <= 0 ) +- vips_buf_appends( buf, "bad dimensions\n" ); +- if( image->BandFmt < -1 || ++ image->Bands != 0) { ++ if (image->Xsize <= 0 || ++ image->Ysize <= 0 || ++ image->Bands <= 0) ++ vips_buf_appends(buf, "bad dimensions\n"); ++ if (image->BandFmt < -1 || + image->BandFmt > VIPS_FORMAT_DPCOMPLEX || + (image->Coding != -1 && +- image->Coding != VIPS_CODING_NONE && ++ image->Coding != VIPS_CODING_NONE && + image->Coding != VIPS_CODING_LABQ && + image->Coding != VIPS_CODING_RAD) || + image->Type >= VIPS_INTERPRETATION_LAST || +- image->dtype > VIPS_IMAGE_PARTIAL || +- image->dhint > VIPS_DEMAND_STYLE_ANY ) +- vips_buf_appends( buf, "bad enum\n" ); +- if( image->Xres < 0 || +- image->Yres < 0 ) +- vips_buf_appends( buf, "bad resolution\n" ); ++ image->dtype > VIPS_IMAGE_PARTIAL || ++ image->dhint > VIPS_DEMAND_STYLE_ANY) ++ vips_buf_appends(buf, "bad enum\n"); ++ if (image->Xres < 0 || ++ image->Yres < 0) ++ vips_buf_appends(buf, "bad resolution\n"); + } + + /* Must lock around inter-image links. + */ +- g_mutex_lock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); + +- if( vips_slist_map2( image->upstream, +- (VipsSListMap2Fn) vips_image_sanity_upstream, image, NULL ) ) +- vips_buf_appends( buf, "upstream broken\n" ); +- if( vips_slist_map2( image->downstream, +- (VipsSListMap2Fn) vips_image_sanity_downstream, image, NULL ) ) +- vips_buf_appends( buf, "downstream broken\n" ); ++ if (vips_slist_map2(image->upstream, ++ (VipsSListMap2Fn) vips_image_sanity_upstream, image, NULL)) ++ vips_buf_appends(buf, "upstream broken\n"); ++ if (vips_slist_map2(image->downstream, ++ (VipsSListMap2Fn) vips_image_sanity_downstream, image, NULL)) ++ vips_buf_appends(buf, "downstream broken\n"); + +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_unlock(vips__global_lock); + +- VIPS_OBJECT_CLASS( vips_image_parent_class )->sanity( object, buf ); ++ VIPS_OBJECT_CLASS(vips_image_parent_class)->sanity(object, buf); + } + + static void +-vips_image_rewind( VipsObject *object ) ++vips_image_rewind(VipsObject *object) + { +- VipsImage *image = VIPS_IMAGE( object ); ++ VipsImage *image = VIPS_IMAGE(object); + char *filename; + char *mode; + + /* This triggers a dispose. Copy filename/mode across the dispose. + */ +- filename = g_strdup( vips_image_get_filename( image ) ); +- mode = g_strdup( vips_image_get_mode( image ) ); ++ filename = g_strdup(vips_image_get_filename(image)); ++ mode = g_strdup(vips_image_get_mode(image)); + +- VIPS_OBJECT_CLASS( vips_image_parent_class )->rewind( object ); ++ VIPS_OBJECT_CLASS(vips_image_parent_class)->rewind(object); + +- g_assert( image->filename == NULL ); +- g_assert( image->mode == NULL ); ++ g_assert(image->filename == NULL); ++ g_assert(image->mode == NULL); + + image->filename = filename; + image->mode = mode; +@@ -742,44 +742,44 @@ vips_image_rewind( VipsObject *object ) + /* From "written" callback: save to image->filename using VipsForeign. + */ + static void +-vips_image_save_cb( VipsImage *image, int *result, void *data ) ++vips_image_save_cb(VipsImage *image, int *result, void *data) + { +- if( vips_foreign_save( image, image->filename, NULL ) ) ++ if (vips_foreign_save(image, image->filename, NULL)) + *result = -1; + } + +-/* Progress feedback. ++/* Progress feedback. + */ + + static void +-vips_image_preeval_cb( VipsImage *image, VipsProgress *progress, int *last ) ++vips_image_preeval_cb(VipsImage *image, VipsProgress *progress, int *last) + { +- int tile_width; +- int tile_height; ++ int tile_width; ++ int tile_height; + int n_lines; + + *last = -1; + +- vips_get_tile_size( image, +- &tile_width, &tile_height, &n_lines ); +- printf( _( "%s %s: %d x %d pixels, %d threads, %d x %d tiles, " +- "%d lines in buffer" ), ++ vips_get_tile_size(image, ++ &tile_width, &tile_height, &n_lines); ++ printf(_("%s %s: %d x %d pixels, %d threads, %d x %d tiles, " ++ "%d lines in buffer"), + vips_get_prgname(), image->filename, + image->Xsize, image->Ysize, + vips_concurrency_get(), +- tile_width, tile_height, n_lines ); +- printf( "\n" ); ++ tile_width, tile_height, n_lines); ++ printf("\n"); + } + + static void +-vips_image_eval_cb( VipsImage *image, VipsProgress *progress, int *last ) ++vips_image_eval_cb(VipsImage *image, VipsProgress *progress, int *last) + { +- if( progress->percent != *last ) { +- printf( _( "%s %s: %d%% complete" ), +- vips_get_prgname(), image->filename, +- progress->percent ); +- printf( "\r" ); +- fflush( stdout ); ++ if (progress->percent != *last) { ++ printf(_("%s %s: %d%% complete"), ++ vips_get_prgname(), image->filename, ++ progress->percent); ++ printf("\r"); ++ fflush(stdout); + + *last = progress->percent; + +@@ -790,39 +790,39 @@ vips_image_eval_cb( VipsImage *image, VipsProgress *progress, int *last ) + } + + static void +-vips_image_posteval_cb( VipsImage *image, VipsProgress *progress, void *data ) ++vips_image_posteval_cb(VipsImage *image, VipsProgress *progress, void *data) + { + /* Spaces at end help to erase the %complete message we overwrite. + */ +- printf( _( "%s %s: done in %.3gs \n" ), +- vips_get_prgname(), image->filename, +- g_timer_elapsed( progress->start, NULL ) ); ++ printf(_("%s %s: done in %.3gs \n"), ++ vips_get_prgname(), image->filename, ++ g_timer_elapsed(progress->start, NULL)); + } + + /* Attach progress feedback, if required. + */ + static void +-vips_image_add_progress( VipsImage *image ) ++vips_image_add_progress(VipsImage *image) + { +- if( vips__progress || +- g_getenv( "VIPS_PROGRESS" ) ++ if (vips__progress || ++ g_getenv("VIPS_PROGRESS") + #if ENABLE_DEPRECATED +- || g_getenv( "IM_PROGRESS" ) ++ || g_getenv("IM_PROGRESS") + #endif +- ) { ++ ) { + + /* Keep the %complete we displayed last time here. + */ +- int *last = VIPS_NEW( image, int ); ++ int *last = VIPS_NEW(image, int); + +- g_signal_connect( image, "preeval", +- G_CALLBACK( vips_image_preeval_cb ), last ); +- g_signal_connect( image, "eval", +- G_CALLBACK( vips_image_eval_cb ), last ); +- g_signal_connect( image, "posteval", +- G_CALLBACK( vips_image_posteval_cb ), NULL ); ++ g_signal_connect(image, "preeval", ++ G_CALLBACK(vips_image_preeval_cb), last); ++ g_signal_connect(image, "eval", ++ G_CALLBACK(vips_image_eval_cb), last); ++ g_signal_connect(image, "posteval", ++ G_CALLBACK(vips_image_posteval_cb), NULL); + +- vips_image_set_progress( image, TRUE ); ++ vips_image_set_progress(image, TRUE); + } + } + +@@ -832,171 +832,169 @@ vips_image_add_progress( VipsImage *image ) + */ + + static int +-vips_image_build( VipsObject *object ) ++vips_image_build(VipsObject *object) + { +- VipsImage *image = VIPS_IMAGE( object ); ++ VipsImage *image = VIPS_IMAGE(object); + const char *filename = image->filename; + const char *mode = image->mode; + + guint32 magic; + guint64 sizeof_image; + +- VIPS_DEBUG_MSG( "vips_image_build: %p\n", image ); ++ VIPS_DEBUG_MSG("vips_image_build: %p\n", image); + +- if( VIPS_OBJECT_CLASS( vips_image_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_image_parent_class)->build(object)) ++ return (-1); + + /* Parse the mode string. + */ +- switch( mode[0] ) { +- case 'v': ++ switch (mode[0]) { ++ case 'v': + /* Used by 'r' for native open of vips, see below. Also by + * vips_image_rewind_output(). + */ +- if( vips_image_open_input( image ) ) +- return( -1 ); ++ if (vips_image_open_input(image)) ++ return (-1); + + break; + +- case 'r': +- if( (magic = vips__file_magic( filename )) ) { ++ case 'r': ++ if ((magic = vips__file_magic(filename))) { + /* We may need to byteswap. + */ +- if( GUINT_FROM_BE( magic ) == image->magic ) { ++ if (GUINT_FROM_BE(magic) == image->magic) { + /* Native open. + */ +- if( vips_image_open_input( image ) ) +- return( -1 ); ++ if (vips_image_open_input(image)) ++ return (-1); + } + else { +- VipsImage *t; ++ VipsImage *t; + VipsImage *t2; + + /* Open the image in t, then byteswap to this + * image. + */ +- if( !(t = vips_image_new_mode( filename, +- "v" )) ) +- return( -1 ); ++ if (!(t = vips_image_new_mode(filename, ++ "v"))) ++ return (-1); + +- if( vips_byteswap( t, &t2, NULL ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_byteswap(t, &t2, NULL)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + + image->dtype = VIPS_IMAGE_PARTIAL; +- if( vips_image_write( t2, image ) ) { +- g_object_unref( t2 ); +- return( -1 ); ++ if (vips_image_write(t2, image)) { ++ g_object_unref(t2); ++ return (-1); + } +- g_object_unref( t2 ); ++ g_object_unref(t2); + } + } + else { + VipsImage *t; + +- if( mode[1] == 's' ) { +- if( vips_foreign_load( filename, &t, +- "access", VIPS_ACCESS_SEQUENTIAL, +- NULL ) ) +- return( -1 ); ++ if (mode[1] == 's') { ++ if (vips_foreign_load(filename, &t, ++ "access", VIPS_ACCESS_SEQUENTIAL, ++ NULL)) ++ return (-1); + } + else { +- if( vips_foreign_load( filename, &t, NULL ) ) +- return( -1 ); ++ if (vips_foreign_load(filename, &t, NULL)) ++ return (-1); + } + + image->dtype = VIPS_IMAGE_PARTIAL; +- if( vips_image_write( t, image ) ) { +- g_object_unref( t ); +- return( -1 ); ++ if (vips_image_write(t, image)) { ++ g_object_unref(t); ++ return (-1); + } +- g_object_unref( t ); ++ g_object_unref(t); + } + +- break; ++ break; + +- case 'w': +-{ ++ case 'w': { + const char *file_op; + + /* Make sure the vips saver is there ... strange things will + * happen if this type is renamed or removed. + */ +- g_assert( g_type_from_name( "VipsForeignSaveVips" ) ); ++ g_assert(g_type_from_name("VipsForeignSaveVips")); + +- if( !(file_op = vips_foreign_find_save( filename )) ) +- return( -1 ); ++ if (!(file_op = vips_foreign_find_save(filename))) ++ return (-1); + + /* If this is the vips saver, just save directly ourselves. +- * Otherwise save with VipsForeign when the image has been ++ * Otherwise save with VipsForeign when the image has been + * written to. + */ +- if( vips_isprefix( "VipsForeignSaveVips", file_op ) ) ++ if (vips_isprefix("VipsForeignSaveVips", file_op)) + image->dtype = VIPS_IMAGE_OPENOUT; + else { + image->dtype = VIPS_IMAGE_PARTIAL; +- g_signal_connect( image, "written", +- G_CALLBACK( vips_image_save_cb ), +- NULL ); ++ g_signal_connect(image, "written", ++ G_CALLBACK(vips_image_save_cb), ++ NULL); + } +-} +- break; ++ } break; + +- case 't': ++ case 't': + image->dtype = VIPS_IMAGE_SETBUF; + image->dhint = VIPS_DEMAND_STYLE_ANY; +- break; ++ break; + +- case 'p': ++ case 'p': + image->dtype = VIPS_IMAGE_PARTIAL; +- break; ++ break; + + case 'a': +- if( (image->fd = vips__open_image_read( filename )) == -1 ) +- return( -1 ); ++ if ((image->fd = vips__open_image_read(filename)) == -1) ++ return (-1); + image->dtype = VIPS_IMAGE_OPENIN; + image->dhint = VIPS_DEMAND_STYLE_THINSTRIP; + +- if( image->Bands == 1 ) ++ if (image->Bands == 1) + image->Type = VIPS_INTERPRETATION_B_W; +- else if( image->Bands == 3 ) ++ else if (image->Bands == 3) + image->Type = VIPS_INTERPRETATION_sRGB; +- else ++ else + image->Type = VIPS_INTERPRETATION_MULTIBAND; + +- /* Read the real file length and check against what we think ++ /* Read the real file length and check against what we think + * the size should be. + */ +- if( (image->file_length = vips_file_length( image->fd )) == -1 ) +- return( -1 ); ++ if ((image->file_length = vips_file_length(image->fd)) == -1) ++ return (-1); + + /* Very common, so a special message. + */ +- sizeof_image = VIPS_IMAGE_SIZEOF_IMAGE( image ) + ++ sizeof_image = VIPS_IMAGE_SIZEOF_IMAGE(image) + + image->sizeof_header; +- if( image->file_length < sizeof_image ) { +- vips_error( "VipsImage", +- _( "unable to open \"%s\", file too short" ), +- image->filename ); +- return( -1 ); ++ if (image->file_length < sizeof_image) { ++ vips_error("VipsImage", ++ _("unable to open \"%s\", file too short"), ++ image->filename); ++ return (-1); + } + + /* Just weird. Only print a warning for this, since we should + * still be able to process it without coredumps. + */ +- if( image->file_length > sizeof_image ) +- g_warning( _( "%s is longer than expected" ), +- image->filename ); ++ if (image->file_length > sizeof_image) ++ g_warning(_("%s is longer than expected"), ++ image->filename); + break; + + case 'm': +- if( image->Bands == 1 ) ++ if (image->Bands == 1) + image->Type = VIPS_INTERPRETATION_B_W; +- else if( image->Bands == 3 ) ++ else if (image->Bands == 3) + image->Type = VIPS_INTERPRETATION_sRGB; +- else ++ else + image->Type = VIPS_INTERPRETATION_MULTIBAND; + + image->dtype = VIPS_IMAGE_SETBUF_FOREIGN; +@@ -1005,66 +1003,66 @@ vips_image_build( VipsObject *object ) + break; + + default: +- vips_error( "VipsImage", _( "bad mode \"%s\"" ), mode ); ++ vips_error("VipsImage", _("bad mode \"%s\""), mode); + +- return( -1 ); +- } ++ return (-1); ++ } + +- vips_image_add_progress( image ); ++ vips_image_add_progress(image); + +- return( 0 ); ++ return (0); + } + + static void * +-vips_image_real_invalidate_cb( VipsRegion *reg, void *a, void *b ) ++vips_image_real_invalidate_cb(VipsRegion *reg, void *a, void *b) + { +- vips_region_invalidate( reg ); ++ vips_region_invalidate(reg); + +- return( NULL ); ++ return (NULL); + } + +-static void +-vips_image_real_invalidate( VipsImage *image, void *data ) ++static void ++vips_image_real_invalidate(VipsImage *image, void *data) + { +- VIPS_DEBUG_MSG( "vips_image_real_invalidate: %p\n", image ); ++ VIPS_DEBUG_MSG("vips_image_real_invalidate: %p\n", image); + +- VIPS_GATE_START( "vips_image_real_invalidate: wait" ); ++ VIPS_GATE_START("vips_image_real_invalidate: wait"); + +- g_mutex_lock( image->sslock ); ++ g_mutex_lock(image->sslock); + +- VIPS_GATE_STOP( "vips_image_real_invalidate: wait" ); ++ VIPS_GATE_STOP("vips_image_real_invalidate: wait"); + +- (void) vips_slist_map2( image->regions, +- (VipsSListMap2Fn) vips_image_real_invalidate_cb, NULL, NULL ); ++ (void) vips_slist_map2(image->regions, ++ (VipsSListMap2Fn) vips_image_real_invalidate_cb, NULL, NULL); + +- g_mutex_unlock( image->sslock ); ++ g_mutex_unlock(image->sslock); + } + +-static void +-vips_image_real_minimise( VipsImage *image, void *data ) ++static void ++vips_image_real_minimise(VipsImage *image, void *data) + { +- VIPS_DEBUG_MSG( "vips_image_real_minimise: %p\n", image ); ++ VIPS_DEBUG_MSG("vips_image_real_minimise: %p\n", image); + } + +-static void +-vips_image_real_written( VipsImage *image, int *result, void *data ) ++static void ++vips_image_real_written(VipsImage *image, int *result, void *data) + { +- VIPS_DEBUG_MSG( "vips_image_real_written: %p\n", image ); ++ VIPS_DEBUG_MSG("vips_image_real_written: %p\n", image); + + /* For vips image write, append the xml after the data. + */ +- if( image->dtype == VIPS_IMAGE_OPENOUT && +- vips__writehist( image ) ) ++ if (image->dtype == VIPS_IMAGE_OPENOUT && ++ vips__writehist(image)) + *result = -1; + } + + static void +-vips_image_class_init( VipsImageClass *class ) ++vips_image_class_init(VipsImageClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_image_class_init:\n" ); ++ VIPS_DEBUG_MSG("vips_image_class_init:\n"); + + gobject_class->finalize = vips_image_finalize; + gobject_class->dispose = vips_image_dispose; +@@ -1077,7 +1075,7 @@ vips_image_class_init( VipsImageClass *class ) + vobject_class->output_to_arg = vips_image_write_object; + + vobject_class->nickname = "image"; +- vobject_class->description = _( "image class" ); ++ vobject_class->description = _("image class"); + + vobject_class->dump = vips_image_dump; + vobject_class->summary = vips_image_summary; +@@ -1093,7 +1091,7 @@ vips_image_class_init( VipsImageClass *class ) + */ + + /* It'd be good to have these as set once at construct time, but we +- * can't :-( ++ * can't :-( + * + * For example, a "p" image might be made with vips_image_new() and + * constructed, then passed to vips_copy() of whatever to be written to. +@@ -1103,116 +1101,116 @@ vips_image_class_init( VipsImageClass *class ) + * xoffset and friends on the way through. + */ + +- VIPS_ARG_INT( class, "width", 2, +- _( "Width" ), +- _( "Image width in pixels" ), ++ VIPS_ARG_INT(class, "width", 2, ++ _("Width"), ++ _("Image width in pixels"), + VIPS_ARGUMENT_SET_ALWAYS, +- G_STRUCT_OFFSET( VipsImage, Xsize ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsImage, Xsize), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "height", 3, +- _( "Height" ), +- _( "Image height in pixels" ), ++ VIPS_ARG_INT(class, "height", 3, ++ _("Height"), ++ _("Image height in pixels"), + VIPS_ARGUMENT_SET_ALWAYS, +- G_STRUCT_OFFSET( VipsImage, Ysize ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsImage, Ysize), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "bands", 4, +- _( "Bands" ), +- _( "Number of bands in image" ), ++ VIPS_ARG_INT(class, "bands", 4, ++ _("Bands"), ++ _("Number of bands in image"), + VIPS_ARGUMENT_SET_ALWAYS, +- G_STRUCT_OFFSET( VipsImage, Bands ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsImage, Bands), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_ENUM( class, "format", 5, +- _( "Format" ), +- _( "Pixel format in image" ), ++ VIPS_ARG_ENUM(class, "format", 5, ++ _("Format"), ++ _("Pixel format in image"), + VIPS_ARGUMENT_SET_ALWAYS, +- G_STRUCT_OFFSET( VipsImage, BandFmt ), +- VIPS_TYPE_BAND_FORMAT, VIPS_FORMAT_UCHAR ); ++ G_STRUCT_OFFSET(VipsImage, BandFmt), ++ VIPS_TYPE_BAND_FORMAT, VIPS_FORMAT_UCHAR); + +- VIPS_ARG_ENUM( class, "coding", 6, +- _( "Coding" ), +- _( "Pixel coding" ), ++ VIPS_ARG_ENUM(class, "coding", 6, ++ _("Coding"), ++ _("Pixel coding"), + VIPS_ARGUMENT_SET_ALWAYS, +- G_STRUCT_OFFSET( VipsImage, Coding ), +- VIPS_TYPE_CODING, VIPS_CODING_NONE ); ++ G_STRUCT_OFFSET(VipsImage, Coding), ++ VIPS_TYPE_CODING, VIPS_CODING_NONE); + +- VIPS_ARG_ENUM( class, "interpretation", 7, +- _( "Interpretation" ), +- _( "Pixel interpretation" ), ++ VIPS_ARG_ENUM(class, "interpretation", 7, ++ _("Interpretation"), ++ _("Pixel interpretation"), + VIPS_ARGUMENT_SET_ALWAYS, +- G_STRUCT_OFFSET( VipsImage, Type ), +- VIPS_TYPE_INTERPRETATION, VIPS_INTERPRETATION_MULTIBAND ); ++ G_STRUCT_OFFSET(VipsImage, Type), ++ VIPS_TYPE_INTERPRETATION, VIPS_INTERPRETATION_MULTIBAND); + +- VIPS_ARG_DOUBLE( class, "xres", 8, +- _( "Xres" ), +- _( "Horizontal resolution in pixels/mm" ), ++ VIPS_ARG_DOUBLE(class, "xres", 8, ++ _("Xres"), ++ _("Horizontal resolution in pixels/mm"), + VIPS_ARGUMENT_SET_ALWAYS, +- G_STRUCT_OFFSET( VipsImage, Xres ), +- -0.0, 1000000, 0 ); ++ G_STRUCT_OFFSET(VipsImage, Xres), ++ -0.0, 1000000, 0); + +- VIPS_ARG_DOUBLE( class, "yres", 9, +- _( "Yres" ), +- _( "Vertical resolution in pixels/mm" ), ++ VIPS_ARG_DOUBLE(class, "yres", 9, ++ _("Yres"), ++ _("Vertical resolution in pixels/mm"), + VIPS_ARGUMENT_SET_ALWAYS, +- G_STRUCT_OFFSET( VipsImage, Yres ), +- -0.0, 1000000, 0 ); ++ G_STRUCT_OFFSET(VipsImage, Yres), ++ -0.0, 1000000, 0); + +- VIPS_ARG_INT( class, "xoffset", 10, +- _( "Xoffset" ), +- _( "Horizontal offset of origin" ), ++ VIPS_ARG_INT(class, "xoffset", 10, ++ _("Xoffset"), ++ _("Horizontal offset of origin"), + VIPS_ARGUMENT_SET_ALWAYS, +- G_STRUCT_OFFSET( VipsImage, Xoffset ), +- -VIPS_MAX_COORD, VIPS_MAX_COORD, 0 ); ++ G_STRUCT_OFFSET(VipsImage, Xoffset), ++ -VIPS_MAX_COORD, VIPS_MAX_COORD, 0); + +- VIPS_ARG_INT( class, "yoffset", 11, +- _( "Yoffset" ), +- _( "Vertical offset of origin" ), ++ VIPS_ARG_INT(class, "yoffset", 11, ++ _("Yoffset"), ++ _("Vertical offset of origin"), + VIPS_ARGUMENT_SET_ALWAYS, +- G_STRUCT_OFFSET( VipsImage, Yoffset ), +- -VIPS_MAX_COORD, VIPS_MAX_COORD, 0 ); +- +- VIPS_ARG_STRING( class, "filename", 12, +- _( "Filename" ), +- _( "Image filename" ), +- VIPS_ARGUMENT_SET_ONCE | VIPS_ARGUMENT_CONSTRUCT, +- G_STRUCT_OFFSET( VipsImage, filename ), +- NULL ); +- +- VIPS_ARG_STRING( class, "mode", 13, +- _( "Mode" ), +- _( "Open mode" ), +- VIPS_ARGUMENT_SET_ONCE | VIPS_ARGUMENT_CONSTRUCT, +- G_STRUCT_OFFSET( VipsImage, mode ), +- "p" ); +- +- VIPS_ARG_BOOL( class, "kill", 14, +- _( "Kill" ), +- _( "Block evaluation on this image" ), +- VIPS_ARGUMENT_SET_ALWAYS, +- G_STRUCT_OFFSET( VipsImage, kill ), +- FALSE ); +- +- VIPS_ARG_ENUM( class, "demand", 15, +- _( "Demand style" ), +- _( "Preferred demand style for this image" ), ++ G_STRUCT_OFFSET(VipsImage, Yoffset), ++ -VIPS_MAX_COORD, VIPS_MAX_COORD, 0); ++ ++ VIPS_ARG_STRING(class, "filename", 12, ++ _("Filename"), ++ _("Image filename"), ++ VIPS_ARGUMENT_SET_ONCE | VIPS_ARGUMENT_CONSTRUCT, ++ G_STRUCT_OFFSET(VipsImage, filename), ++ NULL); ++ ++ VIPS_ARG_STRING(class, "mode", 13, ++ _("Mode"), ++ _("Open mode"), ++ VIPS_ARGUMENT_SET_ONCE | VIPS_ARGUMENT_CONSTRUCT, ++ G_STRUCT_OFFSET(VipsImage, mode), ++ "p"); ++ ++ VIPS_ARG_BOOL(class, "kill", 14, ++ _("Kill"), ++ _("Block evaluation on this image"), ++ VIPS_ARGUMENT_SET_ALWAYS, ++ G_STRUCT_OFFSET(VipsImage, kill), ++ FALSE); ++ ++ VIPS_ARG_ENUM(class, "demand", 15, ++ _("Demand style"), ++ _("Preferred demand style for this image"), + VIPS_ARGUMENT_CONSTRUCT, +- G_STRUCT_OFFSET( VipsImage, dhint ), +- VIPS_TYPE_DEMAND_STYLE, VIPS_DEMAND_STYLE_SMALLTILE ); +- +- VIPS_ARG_UINT64( class, "sizeof_header", 16, +- _( "Size of header" ), +- _( "Offset in bytes from start of file" ), +- VIPS_ARGUMENT_SET_ONCE | VIPS_ARGUMENT_CONSTRUCT, +- G_STRUCT_OFFSET( VipsImage, sizeof_header ), +- 0, 1000000000, VIPS_SIZEOF_HEADER ); +- +- VIPS_ARG_POINTER( class, "foreign_buffer", 17, +- _( "Foreign buffer" ), +- _( "Pointer to foreign pixels" ), +- VIPS_ARGUMENT_SET_ONCE | VIPS_ARGUMENT_CONSTRUCT, +- G_STRUCT_OFFSET( VipsImage, data ) ); ++ G_STRUCT_OFFSET(VipsImage, dhint), ++ VIPS_TYPE_DEMAND_STYLE, VIPS_DEMAND_STYLE_SMALLTILE); ++ ++ VIPS_ARG_UINT64(class, "sizeof_header", 16, ++ _("Size of header"), ++ _("Offset in bytes from start of file"), ++ VIPS_ARGUMENT_SET_ONCE | VIPS_ARGUMENT_CONSTRUCT, ++ G_STRUCT_OFFSET(VipsImage, sizeof_header), ++ 0, 1000000000, VIPS_SIZEOF_HEADER); ++ ++ VIPS_ARG_POINTER(class, "foreign_buffer", 17, ++ _("Foreign buffer"), ++ _("Pointer to foreign pixels"), ++ VIPS_ARGUMENT_SET_ONCE | VIPS_ARGUMENT_CONSTRUCT, ++ G_STRUCT_OFFSET(VipsImage, data)); + + /* Create signals. + */ +@@ -1226,16 +1224,16 @@ vips_image_class_init( VipsImageClass *class ) + * starts. It's a good place to set up evaluation feedback. + * + * Use vips_image_set_progress() to turn on progress reporting for an +- * image. ++ * image. + */ +- vips_image_signals[SIG_PREEVAL] = g_signal_new( "preeval", +- G_TYPE_FROM_CLASS( class ), ++ vips_image_signals[SIG_PREEVAL] = g_signal_new("preeval", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_RUN_LAST, +- G_STRUCT_OFFSET( VipsImageClass, preeval ), ++ G_STRUCT_OFFSET(VipsImageClass, preeval), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, +- G_TYPE_POINTER ); ++ G_TYPE_POINTER); + + /** + * VipsImage::eval: +@@ -1243,62 +1241,62 @@ vips_image_class_init( VipsImageClass *class ) + * @progress: (type VipsProgress): #VipsProgress for this image + * + * The ::eval signal is emitted once per work unit (typically a 128 x +- * 128 area of pixels) during image computation. ++ * 128 area of pixels) during image computation. + * + * You can use this signal to update user-interfaces with progress + * feedback. Beware of updating too frequently: you will usually + * need some throttling mechanism. + * + * Use vips_image_set_progress() to turn on progress reporting for an +- * image. ++ * image. + */ +- vips_image_signals[SIG_EVAL] = g_signal_new( "eval", +- G_TYPE_FROM_CLASS( class ), ++ vips_image_signals[SIG_EVAL] = g_signal_new("eval", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_RUN_LAST, +- G_STRUCT_OFFSET( VipsImageClass, eval ), ++ G_STRUCT_OFFSET(VipsImageClass, eval), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, +- G_TYPE_POINTER ); ++ G_TYPE_POINTER); + + /** + * VipsImage::posteval: + * @image: the image that was calculated + * @progress: (type VipsProgress): #VipsProgress for this image + * +- * The ::posteval signal is emitted once at the end of the computation ++ * The ::posteval signal is emitted once at the end of the computation + * of @image. It's a good place to shut down evaluation feedback. + * + * Use vips_image_set_progress() to turn on progress reporting for an +- * image. ++ * image. + */ +- vips_image_signals[SIG_POSTEVAL] = g_signal_new( "posteval", +- G_TYPE_FROM_CLASS( class ), ++ vips_image_signals[SIG_POSTEVAL] = g_signal_new("posteval", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_RUN_LAST, +- G_STRUCT_OFFSET( VipsImageClass, posteval ), ++ G_STRUCT_OFFSET(VipsImageClass, posteval), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, +- G_TYPE_POINTER ); ++ G_TYPE_POINTER); + + /** + * VipsImage::written: + * @image: the image that was calculated + * @result: (out) (type gint): set to non-zero to indicate error + * +- * The ::written signal is emitted just after an image has been ++ * The ::written signal is emitted just after an image has been + * written to. It is + * used by vips to implement things like write to foreign file +- * formats. ++ * formats. + */ +- vips_image_signals[SIG_WRITTEN] = g_signal_new( "written", +- G_TYPE_FROM_CLASS( class ), ++ vips_image_signals[SIG_WRITTEN] = g_signal_new("written", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, +- G_STRUCT_OFFSET( VipsImageClass, written ), ++ G_STRUCT_OFFSET(VipsImageClass, written), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, +- G_TYPE_POINTER ); ++ G_TYPE_POINTER); + + /** + * VipsImage::invalidate: +@@ -1308,37 +1306,37 @@ vips_image_class_init( VipsImageClass *class ) + * upstream data sources has been destructively modified. See + * vips_image_invalidate_all(). + */ +- vips_image_signals[SIG_INVALIDATE] = g_signal_new( "invalidate", +- G_TYPE_FROM_CLASS( class ), ++ vips_image_signals[SIG_INVALIDATE] = g_signal_new("invalidate", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, +- G_STRUCT_OFFSET( VipsImageClass, invalidate ), ++ G_STRUCT_OFFSET(VipsImageClass, invalidate), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, +- G_TYPE_NONE, 0 ); ++ G_TYPE_NONE, 0); + + /** + * VipsImage::minimise: + * @image: the image that is being minimised + * + * The ::minimise signal is emitted when an image has been asked to +- * minimise memory usage. All non-essential caches are dropped. ++ * minimise memory usage. All non-essential caches are dropped. + * See vips_image_minimise_all(). + */ +- vips_image_signals[SIG_MINIMISE] = g_signal_new( "minimise", +- G_TYPE_FROM_CLASS( class ), ++ vips_image_signals[SIG_MINIMISE] = g_signal_new("minimise", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, +- G_STRUCT_OFFSET( VipsImageClass, minimise ), ++ G_STRUCT_OFFSET(VipsImageClass, minimise), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, +- G_TYPE_NONE, 0 ); ++ G_TYPE_NONE, 0); + + vips__minimise_lock = vips_g_mutex_new(); + } + + static void +-vips_image_init( VipsImage *image ) ++vips_image_init(VipsImage *image) + { +- VIPS_DEBUG_MSG( "vips_image_init: %p\n", image ); ++ VIPS_DEBUG_MSG("vips_image_init: %p\n", image); + + /* Default to native order. + */ +@@ -1351,46 +1349,46 @@ vips_image_init( VipsImage *image ) + image->Xres = 1.0; + image->Yres = 1.0; + +- image->fd = -1; /* since 0 is stdout */ ++ image->fd = -1; /* since 0 is stdout */ + image->sslock = vips_g_mutex_new(); + + image->sizeof_header = VIPS_SIZEOF_HEADER; + +- image->mode = g_strdup( "p" ); ++ image->mode = g_strdup("p"); + + #ifdef DEBUG_LEAK +- g_object_set_qdata_full( G_OBJECT( image ), vips__image_pixels_quark, +- g_new0( VipsImagePixels, 1 ), (GDestroyNotify) g_free ); ++ g_object_set_qdata_full(G_OBJECT(image), vips__image_pixels_quark, ++ g_new0(VipsImagePixels, 1), (GDestroyNotify) g_free); + #endif /*DEBUG_LEAK*/ + } + + int +-vips_image_written( VipsImage *image ) ++vips_image_written(VipsImage *image) + { + int result; + +- VIPS_DEBUG_MSG( "vips_image_written: %p\n", image ); ++ VIPS_DEBUG_MSG("vips_image_written: %p\n", image); + + result = 0; +- g_signal_emit( image, vips_image_signals[SIG_WRITTEN], 0, &result ); ++ g_signal_emit(image, vips_image_signals[SIG_WRITTEN], 0, &result); + +- return( result ); ++ return (result); + } + + static void +-vips_image_invalidate( VipsImage *image ) ++vips_image_invalidate(VipsImage *image) + { +- VIPS_DEBUG_MSG( "vips_image_invalidate: %p\n", image ); ++ VIPS_DEBUG_MSG("vips_image_invalidate: %p\n", image); + +- g_signal_emit( image, vips_image_signals[SIG_INVALIDATE], 0 ); ++ g_signal_emit(image, vips_image_signals[SIG_INVALIDATE], 0); + } + + static void * +-vips_image_invalidate_all_cb( VipsImage *image, void *a, void *b ) ++vips_image_invalidate_all_cb(VipsImage *image, void *a, void *b) + { +- vips_image_invalidate( image ); ++ vips_image_invalidate(image); + +- return( NULL ); ++ return (NULL); + } + + /** +@@ -1399,7 +1397,7 @@ vips_image_invalidate_all_cb( VipsImage *image, void *a, void *b ) + * + * Invalidate all pixel caches on @image and any downstream images, that + * is, images which depend on this image. Additionally, all operations which +- * depend upon this image are dropped from the VIPS operation cache. ++ * depend upon this image are dropped from the VIPS operation cache. + * + * You should call this function after + * destructively modifying an image with something like vips_draw_circle(). +@@ -1409,28 +1407,28 @@ vips_image_invalidate_all_cb( VipsImage *image, void *a, void *b ) + * See also: vips_region_invalidate(). + */ + void +-vips_image_invalidate_all( VipsImage *image ) ++vips_image_invalidate_all(VipsImage *image) + { +- VIPS_DEBUG_MSG( "vips_image_invalidate_all: %p\n", image ); ++ VIPS_DEBUG_MSG("vips_image_invalidate_all: %p\n", image); + +- (void) vips__link_map( image, FALSE, +- (VipsSListMap2Fn) vips_image_invalidate_all_cb, NULL, NULL ); ++ (void) vips__link_map(image, FALSE, ++ (VipsSListMap2Fn) vips_image_invalidate_all_cb, NULL, NULL); + } + + static void +-vips_image_minimise( VipsImage *image ) ++vips_image_minimise(VipsImage *image) + { +- VIPS_DEBUG_MSG( "vips_image_minimise: %p\n", image ); ++ VIPS_DEBUG_MSG("vips_image_minimise: %p\n", image); + +- g_signal_emit( image, vips_image_signals[SIG_MINIMISE], 0 ); ++ g_signal_emit(image, vips_image_signals[SIG_MINIMISE], 0); + } + + static void * +-vips_image_minimise_all_cb( VipsImage *image, void *a, void *b ) ++vips_image_minimise_all_cb(VipsImage *image, void *a, void *b) + { +- vips_image_minimise( image ); ++ vips_image_minimise(image); + +- return( NULL ); ++ return (NULL); + } + + /** +@@ -1439,22 +1437,22 @@ vips_image_minimise_all_cb( VipsImage *image, void *a, void *b ) + * + * Minimise memory use on this image and any upstream images, that is, images + * which this image depends upon. This function is called automatically at the +- * end of a computation, but it might be useful to call at other times. ++ * end of a computation, but it might be useful to call at other times. + * + * The #VipsImage::minimise signal is emitted for all minimised images. + */ +-void +-vips_image_minimise_all( VipsImage *image ) ++void ++vips_image_minimise_all(VipsImage *image) + { + /* Minimisation will modify things like sources, so we can't run it + * from many threads. + */ +- g_mutex_lock( vips__minimise_lock ); ++ g_mutex_lock(vips__minimise_lock); + +- (void) vips__link_map( image, TRUE, +- (VipsSListMap2Fn) vips_image_minimise_all_cb, NULL, NULL ); ++ (void) vips__link_map(image, TRUE, ++ (VipsSListMap2Fn) vips_image_minimise_all_cb, NULL, NULL); + +- g_mutex_unlock( vips__minimise_lock ); ++ g_mutex_unlock(vips__minimise_lock); + } + + /** +@@ -1468,144 +1466,144 @@ vips_image_minimise_all( VipsImage *image ) + * Returns: %TRUE if @image is in sequential mode. + */ + gboolean +-vips_image_is_sequential( VipsImage *image ) ++vips_image_is_sequential(VipsImage *image) + { +- return( vips_image_get_typeof( image, VIPS_META_SEQUENTIAL ) ); ++ return (vips_image_get_typeof(image, VIPS_META_SEQUENTIAL)); + } + + /* Attach a new time struct, if necessary, and reset it. + */ + static int +-vips_progress_add( VipsImage *image ) ++vips_progress_add(VipsImage *image) + { + VipsProgress *progress; + +- VIPS_DEBUG_MSG( "vips_progress_add: %p\n", image ); ++ VIPS_DEBUG_MSG("vips_progress_add: %p\n", image); + +- if( !(progress = image->time) ) { +- if( !(image->time = VIPS_NEW( NULL, VipsProgress )) ) +- return( -1 ); ++ if (!(progress = image->time)) { ++ if (!(image->time = VIPS_NEW(NULL, VipsProgress))) ++ return (-1); + progress = image->time; + + progress->im = image; + progress->start = NULL; + } + +- if( !progress->start ) ++ if (!progress->start) + progress->start = g_timer_new(); + +- g_timer_start( progress->start ); ++ g_timer_start(progress->start); + progress->run = 0; + progress->eta = 0; +- progress->tpels = VIPS_IMAGE_N_PELS( image ); ++ progress->tpels = VIPS_IMAGE_N_PELS(image); + progress->npels = 0; + progress->percent = 0; + +- return( 0 ); ++ return (0); + } + + static void +-vips_progress_update( VipsProgress *progress, guint64 processed ) ++vips_progress_update(VipsProgress *progress, guint64 processed) + { + float prop; + +- VIPS_DEBUG_MSG( "vips_progress_update: %p\n", progress ); ++ VIPS_DEBUG_MSG("vips_progress_update: %p\n", progress); + +- g_assert( progress ); ++ g_assert(progress); + +- progress->run = g_timer_elapsed( progress->start, NULL ); ++ progress->run = g_timer_elapsed(progress->start, NULL); + progress->npels = processed; + prop = (float) progress->npels / (float) progress->tpels; + progress->percent = 100 * prop; + + /* Don't estimate eta until we are 10% in. + */ +- if( prop > 0.1 ) ++ if (prop > 0.1) + progress->eta = (1.0 / prop) * progress->run - progress->run; + } + + void +-vips_image_preeval( VipsImage *image ) ++vips_image_preeval(VipsImage *image) + { +- if( image->progress_signal ) { +- VIPS_DEBUG_MSG( "vips_image_preeval: %p\n", image ); ++ if (image->progress_signal) { ++ VIPS_DEBUG_MSG("vips_image_preeval: %p\n", image); + +- g_assert( vips_object_sanity( +- VIPS_OBJECT( image->progress_signal ) ) ); ++ g_assert(vips_object_sanity( ++ VIPS_OBJECT(image->progress_signal))); + +- (void) vips_progress_add( image ); ++ (void) vips_progress_add(image); + + /* For vips7 compat, we also have to make sure ->time on the +- * image that was originally marked with ++ * image that was originally marked with + * vips_image_set_progress() is valid. + */ +- (void) vips_progress_add( image->progress_signal ); ++ (void) vips_progress_add(image->progress_signal); + +- if( !vips_image_get_typeof( image, "hide-progress" ) ) +- g_signal_emit( image->progress_signal, +- vips_image_signals[SIG_PREEVAL], 0, +- image->time ); ++ if (!vips_image_get_typeof(image, "hide-progress")) ++ g_signal_emit(image->progress_signal, ++ vips_image_signals[SIG_PREEVAL], 0, ++ image->time); + } + } + + /* Updated the number of pixels that have been processed. + */ + void +-vips_image_eval( VipsImage *image, guint64 processed ) ++vips_image_eval(VipsImage *image, guint64 processed) + { +- if( image->progress_signal && +- image->time ) { +- VIPS_DEBUG_MSG( "vips_image_eval: %p\n", image ); ++ if (image->progress_signal && ++ image->time) { ++ VIPS_DEBUG_MSG("vips_image_eval: %p\n", image); + +- g_assert( vips_object_sanity( +- VIPS_OBJECT( image->progress_signal ) ) ); ++ g_assert(vips_object_sanity( ++ VIPS_OBJECT(image->progress_signal))); + +- vips_progress_update( image->time, processed ); ++ vips_progress_update(image->time, processed); + + /* For vips7 compat, update the ->time on the signalling image + * too, even though it may have a different width/height to + * the image we are actually generating. + */ +- if( image->progress_signal->time != image->time ) +- vips_progress_update( image->progress_signal->time, +- processed ); ++ if (image->progress_signal->time != image->time) ++ vips_progress_update(image->progress_signal->time, ++ processed); + +- if( !vips_image_get_typeof( image, "hide-progress" ) ) +- g_signal_emit( image->progress_signal, +- vips_image_signals[SIG_EVAL], 0, +- image->time ); ++ if (!vips_image_get_typeof(image, "hide-progress")) ++ g_signal_emit(image->progress_signal, ++ vips_image_signals[SIG_EVAL], 0, ++ image->time); + } + } + + void +-vips_image_posteval( VipsImage *image ) ++vips_image_posteval(VipsImage *image) + { +- if( image->progress_signal && +- image->progress_signal->time ) { ++ if (image->progress_signal && ++ image->progress_signal->time) { + gint64 processed; + +- VIPS_DEBUG_MSG( "vips_image_posteval: %p\n", image ); ++ VIPS_DEBUG_MSG("vips_image_posteval: %p\n", image); + +- g_assert( vips_object_sanity( +- VIPS_OBJECT( image->progress_signal ) ) ); ++ g_assert(vips_object_sanity( ++ VIPS_OBJECT(image->progress_signal))); + + /* Make sure posteval sees a finished progress. + */ + processed = image->time->tpels; +- vips_progress_update( image->time, processed ); ++ vips_progress_update(image->time, processed); + + /* For vips7 compat, update the ->time on the signalling image + * too, even though it may have a different width/height to + * the image we are actually generating. + */ +- if( image->progress_signal->time != image->time ) +- vips_progress_update( image->progress_signal->time, +- processed ); ++ if (image->progress_signal->time != image->time) ++ vips_progress_update(image->progress_signal->time, ++ processed); + +- if( !vips_image_get_typeof( image, "hide-progress" ) ) +- g_signal_emit( image->progress_signal, +- vips_image_signals[SIG_POSTEVAL], 0, +- image->time ); ++ if (!vips_image_get_typeof(image, "hide-progress")) ++ g_signal_emit(image->progress_signal, ++ vips_image_signals[SIG_POSTEVAL], 0, ++ image->time); + } + } + +@@ -1614,21 +1612,21 @@ vips_image_posteval( VipsImage *image ) + * @image: image to signal progress on + * @progress: turn progress reporting on or off + * +- * vips signals evaluation progress via the #VipsImage::preeval, ++ * vips signals evaluation progress via the #VipsImage::preeval, + * #VipsImage::eval and #VipsImage::posteval + * signals. Progress is signalled on the most-downstream image for which + * vips_image_set_progress() was called. + */ + void +-vips_image_set_progress( VipsImage *image, gboolean progress ) ++vips_image_set_progress(VipsImage *image, gboolean progress) + { +- if( progress && +- !image->progress_signal ) { +- VIPS_DEBUG_MSG( "vips_image_set_progress: %p %s\n", +- image, image->filename ); ++ if (progress && ++ !image->progress_signal) { ++ VIPS_DEBUG_MSG("vips_image_set_progress: %p %s\n", ++ image, image->filename); + image->progress_signal = image; + } +- else if( !progress ) ++ else if (!progress) + image->progress_signal = NULL; + } + +@@ -1639,14 +1637,14 @@ vips_image_set_progress( VipsImage *image, gboolean progress ) + * If @image has been killed (see vips_image_set_kill()), set an error message, + * clear the #VipsImage.kill flag and return %TRUE. Otherwise return %FALSE. + * +- * Handy for loops which need to run sets of threads which can fail. ++ * Handy for loops which need to run sets of threads which can fail. + * + * See also: vips_image_set_kill(). + * +- * Returns: %TRUE if @image has been killed. ++ * Returns: %TRUE if @image has been killed. + */ + gboolean +-vips_image_iskilled( VipsImage *image ) ++vips_image_iskilled(VipsImage *image) + { + gboolean kill; + +@@ -1654,19 +1652,19 @@ vips_image_iskilled( VipsImage *image ) + + /* Has kill been set for this image? If yes, abort evaluation. + */ +- if( image->kill ) { +- VIPS_DEBUG_MSG( "vips_image_iskilled: %s (%p) killed\n", +- image->filename, image ); +- vips_error( "VipsImage", +- _( "killed for image \"%s\"" ), image->filename ); ++ if (image->kill) { ++ VIPS_DEBUG_MSG("vips_image_iskilled: %s (%p) killed\n", ++ image->filename, image); ++ vips_error("VipsImage", ++ _("killed for image \"%s\""), image->filename); + + /* We've picked up the kill message, it's now our caller's + * responsibility to pass the message up the chain. + */ +- vips_image_set_kill( image, FALSE ); ++ vips_image_set_kill(image, FALSE); + } + +- return( kill ); ++ return (kill); + } + + /** +@@ -1675,16 +1673,16 @@ vips_image_iskilled( VipsImage *image ) + * @kill: the kill state + * + * Set the #VipsImage.kill flag on an image. Handy for stopping sets of +- * threads. ++ * threads. + * + * See also: vips_image_iskilled(). + */ + void +-vips_image_set_kill( VipsImage *image, gboolean kill ) ++vips_image_set_kill(VipsImage *image, gboolean kill) + { +- if( image->kill != kill ) +- VIPS_DEBUG_MSG( "vips_image_set_kill: %s (%p) %d\n", +- image->filename, image, kill ); ++ if (image->kill != kill) ++ VIPS_DEBUG_MSG("vips_image_set_kill: %s (%p) %d\n", ++ image->filename, image, kill); + + image->kill = kill; + } +@@ -1693,97 +1691,97 @@ vips_image_set_kill( VipsImage *image, gboolean kill ) + * Assuming that "int" might be 64 Bit wide a buffer size of 26 suffices. + */ + static void +-vips_image_temp_name( char *name, int size ) ++vips_image_temp_name(char *name, int size) + { + static int global_serial = 0; + +- int serial = g_atomic_int_add( &global_serial, 1 ); ++ int serial = g_atomic_int_add(&global_serial, 1); + +- vips_snprintf( name, size, "temp-%d", serial ); ++ vips_snprintf(name, size, "temp-%d", serial); + } + + /** + * vips_image_new: (constructor) + * +- * vips_image_new() creates a new, empty #VipsImage. ++ * vips_image_new() creates a new, empty #VipsImage. + * If you write to one of these images, vips will just attach some callbacks, +- * no pixels will be generated. ++ * no pixels will be generated. + * +- * Write pixels to an image with vips_image_generate() or ++ * Write pixels to an image with vips_image_generate() or + * vips_image_write_line(). Write a whole image to another image with +- * vips_image_write(). ++ * vips_image_write(). + * + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_new( void ) ++vips_image_new(void) + { + VipsImage *image; + char filename[26]; + + vips_check_init(); + +- vips_image_temp_name( filename, sizeof( filename ) ); ++ vips_image_temp_name(filename, sizeof(filename)); + +- image = VIPS_IMAGE( g_object_new( VIPS_TYPE_IMAGE, NULL ) ); +- g_object_set( image, ++ image = VIPS_IMAGE(g_object_new(VIPS_TYPE_IMAGE, NULL)); ++ g_object_set(image, + "filename", filename, + "mode", "p", +- NULL ); +- if( vips_object_build( VIPS_OBJECT( image ) ) ) { +- VIPS_UNREF( image ); +- return( NULL ); ++ NULL); ++ if (vips_object_build(VIPS_OBJECT(image))) { ++ VIPS_UNREF(image); ++ return (NULL); + } + +- return( image ); ++ return (image); + } + + VipsImage * +-vips_image_new_mode( const char *filename, const char *mode ) ++vips_image_new_mode(const char *filename, const char *mode) + { + VipsImage *image; + +- g_assert( filename ); +- g_assert( mode ); ++ g_assert(filename); ++ g_assert(mode); + + vips_check_init(); + +- image = VIPS_IMAGE( g_object_new( VIPS_TYPE_IMAGE, NULL ) ); +- g_object_set( image, ++ image = VIPS_IMAGE(g_object_new(VIPS_TYPE_IMAGE, NULL)); ++ g_object_set(image, + "filename", filename, + "mode", mode, +- NULL ); +- if( vips_object_build( VIPS_OBJECT( image ) ) ) { +- VIPS_UNREF( image ); +- return( NULL ); ++ NULL); ++ if (vips_object_build(VIPS_OBJECT(image))) { ++ VIPS_UNREF(image); ++ return (NULL); + } + +- return( image ); ++ return (image); + } + + /** + * vips_image_new_memory: (skip) + * + * vips_image_new_memory() creates a new #VipsImage which, when written to, will +- * create a memory image. ++ * create a memory image. + * + * See also: vips_image_new(). + * + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_new_memory( void ) ++vips_image_new_memory(void) + { + char filename[26]; + +- vips_image_temp_name( filename, sizeof( filename ) ); +- return( vips_image_new_mode( filename, "t" ) ); ++ vips_image_temp_name(filename, sizeof(filename)); ++ return (vips_image_new_mode(filename, "t")); + } + + /** + * vips_image_memory: (constructor) + * +- * A renamed vips_image_new_memory() ... Some gobject binding systems do not ++ * A renamed vips_image_new_memory() ... Some gobject binding systems do not + * like more than one _new() method. + * + * See also: vips_image_new_memory(). +@@ -1791,9 +1789,9 @@ vips_image_new_memory( void ) + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_memory( void ) ++vips_image_memory(void) + { +- return( vips_image_new_memory() ); ++ return (vips_image_new_memory()); + } + + /** +@@ -1801,23 +1799,23 @@ vips_image_memory( void ) + * @vips_filename: a filename including a set of options + * + * Given a vips filename like "fred.jpg[Q=90]", return a new string of +- * just the filename part, "fred.jpg" in this case. ++ * just the filename part, "fred.jpg" in this case. + * +- * Useful for language bindings. ++ * Useful for language bindings. + * + * See also: vips_filename_get_options(). + * + * Returns: transfer full: just the filename component. + */ + char * +-vips_filename_get_filename( const char *vips_filename ) ++vips_filename_get_filename(const char *vips_filename) + { + char filename[VIPS_PATH_MAX]; + char options[VIPS_PATH_MAX]; + +- vips__filename_split8( vips_filename, filename, options ); ++ vips__filename_split8(vips_filename, filename, options); + +- return( g_strdup( filename ) ); ++ return (g_strdup(filename)); + } + + /** +@@ -1825,23 +1823,23 @@ vips_filename_get_filename( const char *vips_filename ) + * @vips_filename: a filename including a set of options + * + * Given a vips filename like "fred.jpg[Q=90]", return a new string of +- * just the options part, "[Q=90]" in this case. ++ * just the options part, "[Q=90]" in this case. + * +- * Useful for language bindings. ++ * Useful for language bindings. + * + * See also: vips_filename_get_filename(). + * + * Returns: transfer full: just the options component. + */ + char * +-vips_filename_get_options( const char *vips_filename ) ++vips_filename_get_options(const char *vips_filename) + { + char filename[VIPS_PATH_MAX]; + char options[VIPS_PATH_MAX]; + +- vips__filename_split8( vips_filename, filename, options ); ++ vips__filename_split8(vips_filename, filename, options); + +- return( g_strdup( options ) ); ++ return (g_strdup(options)); + } + + /** +@@ -1852,41 +1850,41 @@ vips_filename_get_options( const char *vips_filename ) + * Optional arguments: + * + * * @access: hint #VipsAccess mode to loader +- * * @memory: force load via memory ++ * * @memory: force load via memory + * + * vips_image_new_from_file() opens @name for reading. It can load files + * in many image formats, including VIPS, TIFF, PNG, JPEG, FITS, Matlab, +- * OpenEXR, CSV, WebP, Radiance, RAW, PPM and others. ++ * OpenEXR, CSV, WebP, Radiance, RAW, PPM and others. + * + * Load options may be appended to @filename as "[name=value,...]" or given as + * a NULL-terminated list of name-value pairs at the end of the arguments. +- * Options given in the function call override options given in the filename. +- * Many loaders add extra options, see vips_jpegload(), for example. ++ * Options given in the function call override options given in the filename. ++ * Many loaders add extra options, see vips_jpegload(), for example. + * + * vips_image_new_from_file() always returns immediately with the header +- * fields filled in. No pixels are actually read until you first access them. ++ * fields filled in. No pixels are actually read until you first access them. + * +- * @access lets you set a #VipsAccess hint giving the expected access pattern ++ * @access lets you set a #VipsAccess hint giving the expected access pattern + * for this file. + * #VIPS_ACCESS_RANDOM means you can fetch pixels randomly from the image. + * This is the default mode. #VIPS_ACCESS_SEQUENTIAL means you will read the + * whole image exactly once, top-to-bottom. In this mode, vips can avoid + * converting the whole image in one go, for a large memory saving. You are +- * allowed to make small non-local references, so area operations like +- * convolution will work. ++ * allowed to make small non-local references, so area operations like ++ * convolution will work. + * + * In #VIPS_ACCESS_RANDOM mode, small images are decompressed to memory and + * then processed from there. Large images are decompressed to temporary +- * random-access files on disc and then processed from there. ++ * random-access files on disc and then processed from there. + * +- * Set @memory to %TRUE to force loading via memory. The default is to load +- * large random access images via temporary disc files. See +- * vips_image_new_temp_file() for an ++ * Set @memory to %TRUE to force loading via memory. The default is to load ++ * large random access images via temporary disc files. See ++ * vips_image_new_temp_file() for an + * explanation of how VIPS selects a location for the temporary file. + * + * The disc threshold can be set with the "--vips-disc-threshold" + * command-line argument, or the `VIPS_DISC_THRESHOLD` environment variable. +- * The value is a simple integer, but can take a unit postfix of "k", ++ * The value is a simple integer, but can take a unit postfix of "k", + * "m" or "g" to indicate kilobytes, megabytes or gigabytes. + * The default threshold is 100 MB. + * +@@ -1898,27 +1896,27 @@ vips_filename_get_options( const char *vips_filename ) + * NULL); + * ]| + * +- * Will open "fred.tif", reading page 12. ++ * Will open "fred.tif", reading page 12. + * + * |[ + * VipsImage *image = vips_image_new_from_file ("fred.jpg[shrink=2]", + * NULL); + * ]| + * +- * Will open "fred.jpg", downsampling by a factor of two. ++ * Will open "fred.jpg", downsampling by a factor of two. + * +- * Use vips_foreign_find_load() or vips_foreign_is_a() to see what format a +- * file is in and therefore what options are available. If you need more +- * control over the loading process, you can call loaders directly, see +- * vips_jpegload(), for example. ++ * Use vips_foreign_find_load() or vips_foreign_is_a() to see what format a ++ * file is in and therefore what options are available. If you need more ++ * control over the loading process, you can call loaders directly, see ++ * vips_jpegload(), for example. + * +- * See also: vips_foreign_find_load(), vips_foreign_is_a(), ++ * See also: vips_foreign_find_load(), vips_foreign_is_a(), + * vips_image_write_to_file(). + * + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_new_from_file( const char *name, ... ) ++vips_image_new_from_file(const char *name, ...) + { + char filename[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; +@@ -1929,28 +1927,28 @@ vips_image_new_from_file( const char *name, ... ) + + vips_check_init(); + +- vips__filename_split8( name, filename, option_string ); ++ vips__filename_split8(name, filename, option_string); + +- if( !(operation_name = vips_foreign_find_load( filename )) ) +- return( NULL ); ++ if (!(operation_name = vips_foreign_find_load(filename))) ++ return (NULL); + +- va_start( ap, name ); +- result = vips_call_split_option_string( operation_name, +- option_string, ap, filename, &out ); +- va_end( ap ); ++ va_start(ap, name); ++ result = vips_call_split_option_string(operation_name, ++ option_string, ap, filename, &out); ++ va_end(ap); + +- if( result ) +- return( NULL ); ++ if (result) ++ return (NULL); + +- return( out ); ++ return (out); + } + + /** + * vips_image_new_from_file_RW: (constructor) + * @filename: filename to open + * +- * Opens the named file for simultaneous reading and writing. This will only +- * work for VIPS files in a format native to your machine. It is only for ++ * Opens the named file for simultaneous reading and writing. This will only ++ * work for VIPS files in a format native to your machine. It is only for + * paintbox-type applications. + * + * See also: vips_draw_circle(). +@@ -1958,9 +1956,9 @@ vips_image_new_from_file( const char *name, ... ) + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_new_from_file_RW( const char *filename ) ++vips_image_new_from_file_RW(const char *filename) + { +- return( vips_image_new_mode( filename, "rw" ) ); ++ return (vips_image_new_mode(filename, "rw")); + } + + /** +@@ -1974,7 +1972,7 @@ vips_image_new_from_file_RW( const char *filename ) + * This function maps the named file and returns a #VipsImage you can use to + * read it. + * +- * It returns an 8-bit image with @bands bands. If the image is not 8-bit, use ++ * It returns an 8-bit image with @bands bands. If the image is not 8-bit, use + * vips_copy() to transform the descriptor after loading it. + * + * See also: vips_copy(), vips_rawload(), vips_image_new_from_file(). +@@ -1982,28 +1980,28 @@ vips_image_new_from_file_RW( const char *filename ) + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_new_from_file_raw( const char *filename, +- int xsize, int ysize, int bands, guint64 offset ) ++vips_image_new_from_file_raw(const char *filename, ++ int xsize, int ysize, int bands, guint64 offset) + { + VipsImage *image; + + vips_check_init(); + +- image = VIPS_IMAGE( g_object_new( VIPS_TYPE_IMAGE, NULL ) ); +- g_object_set( image, ++ image = VIPS_IMAGE(g_object_new(VIPS_TYPE_IMAGE, NULL)); ++ g_object_set(image, + "filename", filename, + "mode", "a", + "width", xsize, + "height", ysize, + "bands", bands, + "sizeof_header", offset, +- NULL ); +- if( vips_object_build( VIPS_OBJECT( image ) ) ) { +- VIPS_UNREF( image ); +- return( NULL ); ++ NULL); ++ if (vips_object_build(VIPS_OBJECT(image))) { ++ VIPS_UNREF(image); ++ return (NULL); + } + +- return( image ); ++ return (image); + } + + /** +@@ -2027,9 +2025,9 @@ vips_image_new_from_file_raw( const char *filename, + * Because VIPS is "borrowing" @data from the caller, this function is + * extremely dangerous. Unless you are very careful, you will get crashes or + * memory corruption. Use vips_image_new_from_memory_copy() instead if you are +- * at all unsure. ++ * at all unsure. + * +- * Use vips_copy() to set other image properties. ++ * Use vips_copy() to set other image properties. + * + * See also: vips_image_new(), vips_image_write_to_memory(), + * vips_image_new_from_memory_copy(). +@@ -2037,17 +2035,17 @@ vips_image_new_from_file_raw( const char *filename, + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_new_from_memory( const void *data, size_t size, +- int width, int height, int bands, VipsBandFormat format ) ++vips_image_new_from_memory(const void *data, size_t size, ++ int width, int height, int bands, VipsBandFormat format) + { + VipsImage *image; + char filename[26]; + + vips_check_init(); +- vips_image_temp_name( filename, sizeof( filename ) ); ++ vips_image_temp_name(filename, sizeof(filename)); + +- image = VIPS_IMAGE( g_object_new( VIPS_TYPE_IMAGE, NULL ) ); +- g_object_set( image, ++ image = VIPS_IMAGE(g_object_new(VIPS_TYPE_IMAGE, NULL)); ++ g_object_set(image, + "filename", filename, + "mode", "m", + "foreign_buffer", data, +@@ -2055,29 +2053,29 @@ vips_image_new_from_memory( const void *data, size_t size, + "height", height, + "bands", bands, + "format", format, +- NULL ); +- if( vips_object_build( VIPS_OBJECT( image ) ) ) { +- VIPS_UNREF( image ); +- return( NULL ); ++ NULL); ++ if (vips_object_build(VIPS_OBJECT(image))) { ++ VIPS_UNREF(image); ++ return (NULL); + } + +- if( size < VIPS_IMAGE_SIZEOF_IMAGE( image ) ) { +- vips_error( "VipsImage", +- _( "memory area too small --- " +- "should be %" G_GINT64_FORMAT " bytes, " +- "you passed %zd" ), +- VIPS_IMAGE_SIZEOF_IMAGE( image ), size ); +- VIPS_UNREF( image ); +- return( NULL ); ++ if (size < VIPS_IMAGE_SIZEOF_IMAGE(image)) { ++ vips_error("VipsImage", ++ _("memory area too small --- " ++ "should be %" G_GINT64_FORMAT " bytes, " ++ "you passed %zd"), ++ VIPS_IMAGE_SIZEOF_IMAGE(image), size); ++ VIPS_UNREF(image); ++ return (NULL); + } + +- return( image ); ++ return (image); + } + + static void +-vips_image_new_from_memory_copy_cb( VipsImage *image, void *data_copy ) ++vips_image_new_from_memory_copy_cb(VipsImage *image, void *data_copy) + { +- vips_tracked_free( data_copy ); ++ vips_tracked_free(data_copy); + } + + /** +@@ -2089,36 +2087,36 @@ vips_image_new_from_memory_copy_cb( VipsImage *image, void *data_copy ) + * @bands: image bands (or bytes per pixel) + * @format: image format + * +- * Like vips_image_new_from_memory(), but VIPS will make a copy of the memory +- * area. This means more memory use and an extra copy operation, but is much +- * simpler and safer. ++ * Like vips_image_new_from_memory(), but VIPS will make a copy of the memory ++ * area. This means more memory use and an extra copy operation, but is much ++ * simpler and safer. + * + * See also: vips_image_new_from_memory(). + * + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_new_from_memory_copy( const void *data, size_t size, +- int width, int height, int bands, VipsBandFormat format ) ++vips_image_new_from_memory_copy(const void *data, size_t size, ++ int width, int height, int bands, VipsBandFormat format) + { + void *data_copy; + VipsImage *image; + + vips_check_init(); + +- if( !(data_copy = vips_tracked_malloc( size )) ) +- return( NULL ); +- memcpy( data_copy, data, size ); +- if( !(image = vips_image_new_from_memory( data_copy, size, +- width, height, bands, format )) ) { +- vips_tracked_free( data_copy ); +- return( NULL ); ++ if (!(data_copy = vips_tracked_malloc(size))) ++ return (NULL); ++ memcpy(data_copy, data, size); ++ if (!(image = vips_image_new_from_memory(data_copy, size, ++ width, height, bands, format))) { ++ vips_tracked_free(data_copy); ++ return (NULL); + } + +- g_signal_connect( image, "close", +- G_CALLBACK( vips_image_new_from_memory_copy_cb ), data_copy ); ++ g_signal_connect(image, "close", ++ G_CALLBACK(vips_image_new_from_memory_copy_cb), data_copy); + +- return( image ); ++ return (image); + } + + /** +@@ -2128,10 +2126,10 @@ vips_image_new_from_memory_copy( const void *data, size_t size, + * @option_string: set of extra options as a string + * @...: %NULL-terminated list of optional named arguments + * +- * Loads an image from the formatted area of memory @buf, @len using the +- * loader recommended by vips_foreign_find_load_buffer(). ++ * Loads an image from the formatted area of memory @buf, @len using the ++ * loader recommended by vips_foreign_find_load_buffer(). + * To load an unformatted area of memory, use +- * vips_image_new_from_memory(). ++ * vips_image_new_from_memory(). + * + * VIPS does not take + * responsibility for the area of memory, it's up to you to make sure it's +@@ -2139,15 +2137,15 @@ vips_image_new_from_memory_copy( const void *data, size_t size, + * + * Load options may be given in @option_string as "[name=value,...]" or given as + * a NULL-terminated list of name-value pairs at the end of the arguments. +- * Options given in the function call override options given in the filename. ++ * Options given in the function call override options given in the filename. + * + * See also: vips_image_write_to_buffer(). + * + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_new_from_buffer( const void *buf, size_t len, +- const char *option_string, ... ) ++vips_image_new_from_buffer(const void *buf, size_t len, ++ const char *option_string, ...) + { + const char *operation_name; + va_list ap; +@@ -2157,25 +2155,25 @@ vips_image_new_from_buffer( const void *buf, size_t len, + + vips_check_init(); + +- if( !(operation_name = +- vips_foreign_find_load_buffer( buf, len )) ) +- return( NULL ); ++ if (!(operation_name = ++ vips_foreign_find_load_buffer(buf, len))) ++ return (NULL); + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, buf, len ); ++ blob = vips_blob_new(NULL, buf, len); + +- va_start( ap, option_string ); +- result = vips_call_split_option_string( operation_name, +- option_string, ap, blob, &out ); +- va_end( ap ); ++ va_start(ap, option_string); ++ result = vips_call_split_option_string(operation_name, ++ option_string, ap, blob, &out); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- if( result ) +- return( NULL ); ++ if (result) ++ return (NULL); + +- return( out ); ++ return (out); + } + + /** +@@ -2184,23 +2182,23 @@ vips_image_new_from_buffer( const void *buf, size_t len, + * @option_string: set of extra options as a string + * @...: %NULL-terminated list of optional named arguments + * +- * Loads an image from the formatted source @input, +- * loader recommended by vips_foreign_find_load_source(). ++ * Loads an image from the formatted source @input, ++ * loader recommended by vips_foreign_find_load_source(). + * + * Load options may be given in @option_string as "[name=value,...]" or given as + * a NULL-terminated list of name-value pairs at the end of the arguments. +- * Options given in the function call override options given in the string. ++ * Options given in the function call override options given in the string. + * + * See also: vips_image_write_to_target(). + * + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_new_from_source( VipsSource *source, +- const char *option_string, ... ) ++vips_image_new_from_source(VipsSource *source, ++ const char *option_string, ...) + { +- const char *filename = +- vips_connection_filename( VIPS_CONNECTION( source ) ); ++ const char *filename = ++ vips_connection_filename(VIPS_CONNECTION(source)); + + const char *operation_name; + va_list ap; +@@ -2210,60 +2208,60 @@ vips_image_new_from_source( VipsSource *source, + vips_check_init(); + + vips_error_freeze(); +- operation_name = vips_foreign_find_load_source( source ); ++ operation_name = vips_foreign_find_load_source(source); + vips_error_thaw(); + +- if( operation_name ) { +- va_start( ap, option_string ); +- result = vips_call_split_option_string( operation_name, +- option_string, ap, source, &out ); +- va_end( ap ); ++ if (operation_name) { ++ va_start(ap, option_string); ++ result = vips_call_split_option_string(operation_name, ++ option_string, ap, source, &out); ++ va_end(ap); + } +- else if( filename ) { ++ else if (filename) { + /* Try with the old file-based loaders. + */ +- if( !(operation_name = vips_foreign_find_load( filename )) ) +- return( NULL ); ++ if (!(operation_name = vips_foreign_find_load(filename))) ++ return (NULL); + +- va_start( ap, option_string ); +- result = vips_call_split_option_string( operation_name, +- option_string, ap, filename, &out ); +- va_end( ap ); ++ va_start(ap, option_string); ++ result = vips_call_split_option_string(operation_name, ++ option_string, ap, filename, &out); ++ va_end(ap); + } +- else if( vips_source_is_mappable( source ) ) { ++ else if (vips_source_is_mappable(source)) { + /* Try with the old buffer-based loaders. + */ + VipsBlob *blob; + const void *buf; + size_t len; + +- if( !(blob = vips_source_map_blob( source )) ) +- return( NULL ); ++ if (!(blob = vips_source_map_blob(source))) ++ return (NULL); + +- buf = vips_blob_get( blob, &len ); +- if( !(operation_name = +- vips_foreign_find_load_buffer( buf, len )) ) { +- vips_area_unref( VIPS_AREA( blob ) ); +- return( NULL ); ++ buf = vips_blob_get(blob, &len); ++ if (!(operation_name = ++ vips_foreign_find_load_buffer(buf, len))) { ++ vips_area_unref(VIPS_AREA(blob)); ++ return (NULL); + } + +- va_start( ap, option_string ); +- result = vips_call_split_option_string( operation_name, +- option_string, ap, blob, &out ); +- va_end( ap ); ++ va_start(ap, option_string); ++ result = vips_call_split_option_string(operation_name, ++ option_string, ap, blob, &out); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + } + else { +- vips_error( "VipsImage", +- "%s", _( "unable to load source" ) ); ++ vips_error("VipsImage", ++ "%s", _("unable to load source")); + result = -1; + } + +- if( result ) +- return( NULL ); ++ if (result) ++ return (NULL); + +- return( out ); ++ return (out); + } + + /** +@@ -2276,21 +2274,21 @@ vips_image_new_from_source( VipsSource *source, + * + * Use VIPS_IMAGE_ADDR(), or VIPS_MATRIX() to address pixels in the image. + * +- * Use vips_image_set_double() to set "scale" and "offset", if required. ++ * Use vips_image_set_double() to set "scale" and "offset", if required. + * + * See also: vips_image_new_matrixv() +- * ++ * + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_new_matrix( int width, int height ) ++vips_image_new_matrix(int width, int height) + { + VipsImage *image; + + vips_check_init(); + +- image = VIPS_IMAGE( g_object_new( VIPS_TYPE_IMAGE, NULL ) ); +- g_object_set( image, ++ image = VIPS_IMAGE(g_object_new(VIPS_TYPE_IMAGE, NULL)); ++ g_object_set(image, + "filename", "vips_image_new_matrix", + "mode", "t", + "width", width, +@@ -2298,18 +2296,18 @@ vips_image_new_matrix( int width, int height ) + "bands", 1, + "format", VIPS_FORMAT_DOUBLE, + "interpretation", VIPS_INTERPRETATION_MATRIX, +- NULL ); +- if( vips_object_build( VIPS_OBJECT( image ) ) ) { +- VIPS_UNREF( image ); +- return( NULL ); ++ NULL); ++ if (vips_object_build(VIPS_OBJECT(image))) { ++ VIPS_UNREF(image); ++ return (NULL); + } + +- if( vips_image_write_prepare( image ) ) { +- g_object_unref( image ); +- return( NULL ); ++ if (vips_image_write_prepare(image)) { ++ g_object_unref(image); ++ return (NULL); + } + +- return( image ); ++ return (image); + } + + /** +@@ -2320,14 +2318,14 @@ vips_image_new_matrix( int width, int height ) + * + * As vips_image_new_matrix(), but initialise the matrix from the argument + * list. After @height should be @width * @height double constants which are +- * used to set the matrix elements. ++ * used to set the matrix elements. + * + * See also: vips_image_new_matrix() +- * ++ * + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_new_matrixv( int width, int height, ... ) ++vips_image_new_matrixv(int width, int height, ...) + { + va_list ap; + VipsImage *matrix; +@@ -2335,15 +2333,15 @@ vips_image_new_matrixv( int width, int height, ... ) + + vips_check_init(); + +- matrix = vips_image_new_matrix( width, height ); ++ matrix = vips_image_new_matrix(width, height); + +- va_start( ap, height ); +- for( y = 0; y < height; y++ ) +- for( x = 0; x < width; x++ ) +- *VIPS_MATRIX( matrix, x, y ) = va_arg( ap, double ); +- va_end( ap ); ++ va_start(ap, height); ++ for (y = 0; y < height; y++) ++ for (x = 0; x < width; x++) ++ *VIPS_MATRIX(matrix, x, y) = va_arg(ap, double); ++ va_end(ap); + +- return( matrix ); ++ return (matrix); + } + + /** +@@ -2358,30 +2356,30 @@ vips_image_new_matrixv( int width, int height, ... ) + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_new_matrix_from_array( int width, int height, +- const double *array, int size ) ++vips_image_new_matrix_from_array(int width, int height, ++ const double *array, int size) + { + VipsImage *matrix; + int x, y; + int i; + +- if( size != width * height ) { +- vips_error( "VipsImage", +- _( "bad array length --- should be %d, you passed %d" ), +- width * height, size ); +- return( NULL ); ++ if (size != width * height) { ++ vips_error("VipsImage", ++ _("bad array length --- should be %d, you passed %d"), ++ width * height, size); ++ return (NULL); + } + + vips_check_init(); + +- matrix = vips_image_new_matrix( width, height ); ++ matrix = vips_image_new_matrix(width, height); + + i = 0; +- for( y = 0; y < height; y++ ) +- for( x = 0; x < width; x++ ) +- *VIPS_MATRIX( matrix, x, y ) = array[i++]; ++ for (y = 0; y < height; y++) ++ for (x = 0; x < width; x++) ++ *VIPS_MATRIX(matrix, x, y) = array[i++]; + +- return( matrix ); ++ return (matrix); + } + + /** +@@ -2397,11 +2395,11 @@ vips_image_new_matrix_from_array( int width, int height, + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_matrix_from_array( int width, int height, +- const double *array, int size ) ++vips_image_matrix_from_array(int width, int height, ++ const double *array, int size) + { +- return( vips_image_new_matrix_from_array( width, height, +- array, size ) ); ++ return (vips_image_new_matrix_from_array(width, height, ++ array, size)); + } + + /** +@@ -2419,44 +2417,44 @@ vips_image_matrix_from_array( int width, int height, + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_new_from_image( VipsImage *image, const double *c, int n ) ++vips_image_new_from_image(VipsImage *image, const double *c, int n) + { + VipsObject *scope = (VipsObject *) vips_image_new(); +- VipsImage **t = (VipsImage **) vips_object_local_array( scope, 5 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(scope, 5); + + double *ones; + int i; + VipsImage *result; + +- if( !(ones = VIPS_ARRAY( scope, n, double )) ) { +- g_object_unref( scope ); +- return( NULL ); ++ if (!(ones = VIPS_ARRAY(scope, n, double))) { ++ g_object_unref(scope); ++ return (NULL); + } +- for( i = 0; i < n; i++ ) ++ for (i = 0; i < n; i++) + ones[i] = 1.0; + +- if( vips_black( &t[0], 1, 1, NULL ) || +- vips_linear( t[0], &t[1], ones, (double *) c, n, NULL ) || +- vips_cast( t[1], &t[2], image->BandFmt, NULL ) || +- vips_embed( t[2], &t[3], 0, 0, image->Xsize, image->Ysize, +- "extend", VIPS_EXTEND_COPY, NULL ) || +- vips_copy( t[3], &t[4], ++ if (vips_black(&t[0], 1, 1, NULL) || ++ vips_linear(t[0], &t[1], ones, (double *) c, n, NULL) || ++ vips_cast(t[1], &t[2], image->BandFmt, NULL) || ++ vips_embed(t[2], &t[3], 0, 0, image->Xsize, image->Ysize, ++ "extend", VIPS_EXTEND_COPY, NULL) || ++ vips_copy(t[3], &t[4], + "interpretation", image->Type, + "xres", image->Xres, + "yres", image->Yres, + "xoffset", image->Xoffset, + "yoffset", image->Yoffset, +- NULL ) ) { +- g_object_unref( scope ); +- return( NULL ); ++ NULL)) { ++ g_object_unref(scope); ++ return (NULL); + } + + result = t[4]; +- g_object_ref( result ); ++ g_object_ref(result); + +- g_object_unref( scope ); ++ g_object_unref(scope); + +- return( result ); ++ return (result); + } + + /** +@@ -2473,9 +2471,9 @@ vips_image_new_from_image( VipsImage *image, const double *c, int n ) + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_new_from_image1( VipsImage *image, double c ) ++vips_image_new_from_image1(VipsImage *image, double c) + { +- return( vips_image_new_from_image( image, (const double *) &c, 1 ) ); ++ return (vips_image_new_from_image(image, (const double *) &c, 1)); + } + + /** +@@ -2492,15 +2490,15 @@ vips_image_new_from_image1( VipsImage *image, double c ) + * See also: vips_image_new_temp_file(). + */ + void +-vips_image_set_delete_on_close( VipsImage *image, gboolean delete_on_close ) ++vips_image_set_delete_on_close(VipsImage *image, gboolean delete_on_close) + { +- VIPS_DEBUG_MSG( "vips_image_set_delete_on_close: %d %s\n", +- delete_on_close, image->filename ); ++ VIPS_DEBUG_MSG("vips_image_set_delete_on_close: %d %s\n", ++ delete_on_close, image->filename); + + image->delete_on_close = delete_on_close; +- VIPS_FREE( image->delete_on_close_filename ); +- if( delete_on_close ) +- VIPS_SETSTR( image->delete_on_close_filename, image->filename ); ++ VIPS_FREE(image->delete_on_close_filename); ++ if (delete_on_close) ++ VIPS_SETSTR(image->delete_on_close_filename, image->filename); + } + + /** +@@ -2509,17 +2507,17 @@ vips_image_set_delete_on_close( VipsImage *image, gboolean delete_on_close ) + * Return the number of bytes at which we flip between open via memory and + * open via disc. This defaults to 100mb, but can be changed with the + * VIPS_DISC_THRESHOLD environment variable or the --vips-disc-threshold +- * command-line flag. See vips_image_new_from_file(). ++ * command-line flag. See vips_image_new_from_file(). + * + * Returns: disc threshold in bytes. + */ + guint64 +-vips_get_disc_threshold( void ) ++vips_get_disc_threshold(void) + { + static gboolean done = FALSE; + static guint64 threshold; + +- if( !done ) { ++ if (!done) { + const char *env; + + done = TRUE; +@@ -2528,22 +2526,22 @@ vips_get_disc_threshold( void ) + */ + threshold = 100 * 1024 * 1024; + +- if( (env = g_getenv( "VIPS_DISC_THRESHOLD" )) ++ if ((env = g_getenv("VIPS_DISC_THRESHOLD")) + #if ENABLE_DEPRECATED +- || (env = g_getenv( "IM_DISC_THRESHOLD" )) ++ || (env = g_getenv("IM_DISC_THRESHOLD")) + #endif +- ) +- threshold = vips__parse_size( env ); ++ ) ++ threshold = vips__parse_size(env); + +- if( vips__disc_threshold ) +- threshold = vips__parse_size( vips__disc_threshold ); ++ if (vips__disc_threshold) ++ threshold = vips__parse_size(vips__disc_threshold); + + #ifdef DEBUG +- printf( "vips_get_disc_threshold: %zd bytes\n", threshold ); ++ printf("vips_get_disc_threshold: %zd bytes\n", threshold); + #endif /*DEBUG*/ + } + +- return( threshold ); ++ return (threshold); + } + + /** +@@ -2551,62 +2549,62 @@ vips_get_disc_threshold( void ) + * @format: format of file + * + * Make a #VipsImage which, when written to, will create a temporary file on +- * disc. The file will be automatically deleted when the image is destroyed. ++ * disc. The file will be automatically deleted when the image is destroyed. + * @format is something like "%s.v" for a vips file. + * + * The file is created in the temporary directory. This is set with the + * environment variable TMPDIR. If this is not set, then on Unix systems, vips + * will default to /tmp. On Windows, vips uses GetTempPath() to find the +- * temporary directory. ++ * temporary directory. + * + * See also: vips_image_new(). + * + * Returns: the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_new_temp_file( const char *format ) ++vips_image_new_temp_file(const char *format) + { + char *name; + VipsImage *image; + + vips_check_init(); + +- if( !(name = vips__temp_name( format )) ) +- return( NULL ); ++ if (!(name = vips__temp_name(format))) ++ return (NULL); + +- if( !(image = vips_image_new_mode( name, "w" )) ) { +- g_free( name ); +- return( NULL ); ++ if (!(image = vips_image_new_mode(name, "w"))) { ++ g_free(name); ++ return (NULL); + } + +- g_free( name ); ++ g_free(name); + +- vips_image_set_delete_on_close( image, TRUE ); ++ vips_image_set_delete_on_close(image, TRUE); + +- return( image ); ++ return (image); + } + + static int +-vips_image_write_gen( VipsRegion *or, +- void *seq, void *a, void *b, gboolean *stop ) ++vips_image_write_gen(VipsRegion * or, ++ void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + + /* + printf( "vips_image_write_gen: %p " + "left = %d, top = %d, width = %d, height = %d\n", + or->im, +- r->left, r->top, r->width, r->height ); ++ r->left, r->top, r->width, r->height ); + */ + + /* Copy with pointers. + */ +- if( vips_region_prepare( ir, r ) || +- vips_region_region( or, ir, r, r->left, r->top ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, r) || ++ vips_region_region(or, ir, r, r->left, r->top)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /** +@@ -2622,25 +2620,25 @@ vips_image_write_gen( VipsRegion *or, + * Returns: 0 on success, or -1 on error. + */ + int +-vips_image_write( VipsImage *image, VipsImage *out ) ++vips_image_write(VipsImage *image, VipsImage *out) + { + /* image needs to stay alive for this call. It can be unreffed during + * the generate. + */ +- g_object_ref( image ); ++ g_object_ref(image); + +- if( vips_image_pio_input( image ) || +- vips_image_pipelinev( out, +- VIPS_DEMAND_STYLE_THINSTRIP, image, NULL ) ) { +- g_object_unref( image ); +- return( -1 ); ++ if (vips_image_pio_input(image) || ++ vips_image_pipelinev(out, ++ VIPS_DEMAND_STYLE_THINSTRIP, image, NULL)) { ++ g_object_unref(image); ++ return (-1); + } + +- if( vips_image_generate( out, +- vips_start_one, vips_image_write_gen, vips_stop_one, +- image, NULL ) ) { +- g_object_unref( image ); +- return( -1 ); ++ if (vips_image_generate(out, ++ vips_start_one, vips_image_write_gen, vips_stop_one, ++ image, NULL)) { ++ g_object_unref(image); ++ return (-1); + } + + /* If @out is a partial image, we need to unref @image when out is +@@ -2650,16 +2648,16 @@ vips_image_write( VipsImage *image, VipsImage *out ) + * we need to break any links between @image and @out created by + * vips_image_pipelinev(). + */ +- if( vips_image_ispartial( out ) ) { +- vips_object_local( out, image ); ++ if (vips_image_ispartial(out)) { ++ vips_object_local(out, image); + } + else { +- vips__reorder_clear( out ); +- vips__link_break_all( out ); +- g_object_unref( image ); ++ vips__reorder_clear(out); ++ vips__link_break_all(out); ++ g_object_unref(image); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -2669,18 +2667,18 @@ vips_image_write( VipsImage *image, VipsImage *out ) + * @...: %NULL-terminated list of optional named arguments + * + * Writes @in to @name using the saver recommended by +- * vips_foreign_find_save(). ++ * vips_foreign_find_save(). + * + * Save options may be appended to @filename as "[name=value,...]" or given as + * a NULL-terminated list of name-value pairs at the end of the arguments. +- * Options given in the function call override options given in the filename. ++ * Options given in the function call override options given in the filename. + * + * See also: vips_image_new_from_file(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_image_write_to_file( VipsImage *image, const char *name, ... ) ++vips_image_write_to_file(VipsImage *image, const char *name, ...) + { + char filename[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; +@@ -2693,64 +2691,64 @@ vips_image_write_to_file( VipsImage *image, const char *name, ... ) + * + * We need to hide any errors from this first phase. + */ +- vips__filename_split8( name, filename, option_string ); ++ vips__filename_split8(name, filename, option_string); + + vips_error_freeze(); +- operation_name = vips_foreign_find_save_target( filename ); ++ operation_name = vips_foreign_find_save_target(filename); + vips_error_thaw(); + +- if( operation_name ) { ++ if (operation_name) { + VipsTarget *target; + +- if( !(target = vips_target_new_to_file( filename )) ) +- return( -1 ); ++ if (!(target = vips_target_new_to_file(filename))) ++ return (-1); + +- va_start( ap, name ); +- result = vips_call_split_option_string( operation_name, +- option_string, ap, image, target ); +- va_end( ap ); ++ va_start(ap, name); ++ result = vips_call_split_option_string(operation_name, ++ option_string, ap, image, target); ++ va_end(ap); + +- VIPS_UNREF( target ); ++ VIPS_UNREF(target); + } +- else if( (operation_name = vips_foreign_find_save( filename )) ) { +- va_start( ap, name ); +- result = vips_call_split_option_string( operation_name, +- option_string, ap, image, filename ); +- va_end( ap ); ++ else if ((operation_name = vips_foreign_find_save(filename))) { ++ va_start(ap, name); ++ result = vips_call_split_option_string(operation_name, ++ option_string, ap, image, filename); ++ va_end(ap); + } + else +- return( -1 ); ++ return (-1); + +- return( result ); ++ return (result); + } + + /** + * vips_image_write_to_buffer: + * @in: image to write +- * @suffix: format to write ++ * @suffix: format to write + * @buf: (array length=size) (element-type guint8) (transfer full): return buffer start here + * @size: (type gsize): return buffer length here + * @...: %NULL-terminated list of optional named arguments + * +- * Writes @in to a memory buffer in a format specified by @suffix. ++ * Writes @in to a memory buffer in a format specified by @suffix. + * + * Save options may be appended to @suffix as "[name=value,...]" or given as + * a NULL-terminated list of name-value pairs at the end of the arguments. +- * Options given in the function call override options given in the filename. ++ * Options given in the function call override options given in the filename. + * + * Currently only TIFF, JPEG and PNG formats are supported. + * + * You can call the various save operations directly if you wish, see +- * vips_jpegsave_buffer(), for example. ++ * vips_jpegsave_buffer(), for example. + * + * See also: vips_image_write_to_memory(), vips_image_new_from_buffer(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_image_write_to_buffer( VipsImage *in, +- const char *suffix, void **buf, size_t *size, +- ... ) ++vips_image_write_to_buffer(VipsImage *in, ++ const char *suffix, void **buf, size_t *size, ++ ...) + { + char filename[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; +@@ -2759,67 +2757,67 @@ vips_image_write_to_buffer( VipsImage *in, + va_list ap; + int result; + +- vips__filename_split8( suffix, filename, option_string ); ++ vips__filename_split8(suffix, filename, option_string); + + vips_error_freeze(); +- operation_name = vips_foreign_find_save_target( filename ); ++ operation_name = vips_foreign_find_save_target(filename); + vips_error_thaw(); + +- if( operation_name ) { ++ if (operation_name) { + VipsTarget *target; + +- if( !(target = vips_target_new_to_memory()) ) +- return( -1 ); ++ if (!(target = vips_target_new_to_memory())) ++ return (-1); + +- va_start( ap, size ); +- result = vips_call_split_option_string( operation_name, +- option_string, ap, in, target ); +- va_end( ap ); ++ va_start(ap, size); ++ result = vips_call_split_option_string(operation_name, ++ option_string, ap, in, target); ++ va_end(ap); + +- if( result ) { +- VIPS_UNREF( target ); +- return( -1 ); ++ if (result) { ++ VIPS_UNREF(target); ++ return (-1); + } + +- g_object_get( target, "blob", &blob, NULL ); +- VIPS_UNREF( target ); ++ g_object_get(target, "blob", &blob, NULL); ++ VIPS_UNREF(target); + } +- else if( (operation_name = +- vips_foreign_find_save_buffer( filename )) ) { ++ else if ((operation_name = ++ vips_foreign_find_save_buffer(filename))) { + +- va_start( ap, size ); +- result = vips_call_split_option_string( operation_name, +- option_string, ap, in, &blob ); +- va_end( ap ); ++ va_start(ap, size); ++ result = vips_call_split_option_string(operation_name, ++ option_string, ap, in, &blob); ++ va_end(ap); + +- if( result ) +- return( -1 ); ++ if (result) ++ return (-1); + } + else +- return( -1 ); ++ return (-1); + + *buf = NULL; +- if( size ) ++ if (size) + *size = 0; + +- if( blob ) { +- if( buf ) { +- *buf = VIPS_AREA( blob )->data; +- VIPS_AREA( blob )->free_fn = NULL; ++ if (blob) { ++ if (buf) { ++ *buf = VIPS_AREA(blob)->data; ++ VIPS_AREA(blob)->free_fn = NULL; + } +- if( size ) +- *size = VIPS_AREA( blob )->length; ++ if (size) ++ *size = VIPS_AREA(blob)->length; + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + } + +- return( 0 ); ++ return (0); + } + + /** + * vips_image_write_to_target: + * @in: image to write +- * @suffix: format to write ++ * @suffix: format to write + * @target: target to write to + * @...: %NULL-terminated list of optional named arguments + * +@@ -2827,18 +2825,18 @@ vips_image_write_to_buffer( VipsImage *in, + * + * Save options may be appended to @suffix as "[name=value,...]" or given as + * a NULL-terminated list of name-value pairs at the end of the arguments. +- * Options given in the function call override options given in the filename. ++ * Options given in the function call override options given in the filename. + * + * You can call the various save operations directly if you wish, see +- * vips_jpegsave_target(), for example. ++ * vips_jpegsave_target(), for example. + * + * See also: vips_image_write_to_file(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_image_write_to_target( VipsImage *in, +- const char *suffix, VipsTarget *target, ... ) ++vips_image_write_to_target(VipsImage *in, ++ const char *suffix, VipsTarget *target, ...) + { + char filename[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; +@@ -2846,19 +2844,19 @@ vips_image_write_to_target( VipsImage *in, + va_list ap; + int result; + +- vips__filename_split8( suffix, filename, option_string ); +- if( !(operation_name = vips_foreign_find_save_target( filename )) ) +- return( -1 ); ++ vips__filename_split8(suffix, filename, option_string); ++ if (!(operation_name = vips_foreign_find_save_target(filename))) ++ return (-1); + +- va_start( ap, target ); +- result = vips_call_split_option_string( operation_name, option_string, +- ap, in, target ); +- va_end( ap ); ++ va_start(ap, target); ++ result = vips_call_split_option_string(operation_name, option_string, ++ ap, in, target); ++ va_end(ap); + +- if( result ) +- return( -1 ); ++ if (result) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /** +@@ -2866,44 +2864,44 @@ vips_image_write_to_target( VipsImage *in, + * @in: image to write + * @size: return buffer length here + * +- * Writes @in to memory as a simple, unformatted C-style array. ++ * Writes @in to memory as a simple, unformatted C-style array. + * +- * The caller is responsible for freeing this memory with g_free(). ++ * The caller is responsible for freeing this memory with g_free(). + * + * See also: vips_image_write_to_buffer(). + * + * Returns: (array length=size) (element-type guint8) (transfer full): return buffer start here + */ + void * +-vips_image_write_to_memory( VipsImage *in, size_t *size_out ) ++vips_image_write_to_memory(VipsImage *in, size_t *size_out) + { + void *buf; + size_t size; + VipsImage *x; + +- size = VIPS_IMAGE_SIZEOF_IMAGE( in ); +- if( !(buf = g_try_malloc( size )) ) { +- vips_error( "vips_image_write_to_memory", +- _( "out of memory --- size == %dMB" ), +- (int) (size / (1024.0 * 1024.0)) ); +- g_warning( _( "out of memory --- size == %dMB" ), +- (int) (size / (1024.0 * 1024.0)) ); +- return( NULL ); ++ size = VIPS_IMAGE_SIZEOF_IMAGE(in); ++ if (!(buf = g_try_malloc(size))) { ++ vips_error("vips_image_write_to_memory", ++ _("out of memory --- size == %dMB"), ++ (int) (size / (1024.0 * 1024.0))); ++ g_warning(_("out of memory --- size == %dMB"), ++ (int) (size / (1024.0 * 1024.0))); ++ return (NULL); + } + +- x = vips_image_new_from_memory( buf, size, +- in->Xsize, in->Ysize, in->Bands, in->BandFmt ); +- if( vips_image_write( in, x ) ) { +- g_object_unref( x ); +- g_free( buf ); +- return( NULL ); ++ x = vips_image_new_from_memory(buf, size, ++ in->Xsize, in->Ysize, in->Bands, in->BandFmt); ++ if (vips_image_write(in, x)) { ++ g_object_unref(x); ++ g_free(buf); ++ return (NULL); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- if( size_out ) ++ if (size_out) + *size_out = size; + +- return( buf ); ++ return (buf); + } + + /** +@@ -2911,35 +2909,35 @@ vips_image_write_to_memory( VipsImage *in, size_t *size_out ) + * @in: image to decode + * @out: (out): write to this image + * +- * A convenience function to unpack to a format that we can compute with. +- * @out.coding is always #VIPS_CODING_NONE. ++ * A convenience function to unpack to a format that we can compute with. ++ * @out.coding is always #VIPS_CODING_NONE. + * + * This unpacks LABQ to plain LAB. Use vips_LabQ2LabS() for a bit more speed +- * if you need it. ++ * if you need it. + * +- * See also: vips_image_encode(), vips_LabQ2Lab(), vips_rad2float(). ++ * See also: vips_image_encode(), vips_LabQ2Lab(), vips_rad2float(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_image_decode( VipsImage *in, VipsImage **out ) ++vips_image_decode(VipsImage *in, VipsImage **out) + { + /* Keep in sync with vips__vector_to_ink(). + */ +- if( in->Coding == VIPS_CODING_LABQ ) { +- if( vips_LabQ2Lab( in, out, NULL ) ) +- return( -1 ); +- } +- else if( in->Coding == VIPS_CODING_RAD ) { +- if( vips_rad2float( in, out, NULL ) ) +- return( -1 ); ++ if (in->Coding == VIPS_CODING_LABQ) { ++ if (vips_LabQ2Lab(in, out, NULL)) ++ return (-1); ++ } ++ else if (in->Coding == VIPS_CODING_RAD) { ++ if (vips_rad2float(in, out, NULL)) ++ return (-1); + } + else { +- if( vips_copy( in, out, NULL ) ) +- return( -1 ); ++ if (vips_copy(in, out, NULL)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -2954,17 +2952,17 @@ vips_image_decode( VipsImage *in, VipsImage **out ) + * See also: vips_image_decode(). + */ + int +-vips_image_decode_predict( VipsImage *in, +- int *out_bands, VipsBandFormat *out_format ) ++vips_image_decode_predict(VipsImage *in, ++ int *out_bands, VipsBandFormat *out_format) + { + VipsBandFormat format; +- int bands; ++ int bands; + +- if( in->Coding == VIPS_CODING_LABQ ) { ++ if (in->Coding == VIPS_CODING_LABQ) { + bands = 3; + format = VIPS_FORMAT_FLOAT; + } +- else if( in->Coding == VIPS_CODING_RAD ) { ++ else if (in->Coding == VIPS_CODING_RAD) { + bands = 3; + format = VIPS_FORMAT_FLOAT; + } +@@ -2973,12 +2971,12 @@ vips_image_decode_predict( VipsImage *in, + format = in->BandFmt; + } + +- if( out_bands ) ++ if (out_bands) + *out_bands = bands; +- if( out_format ) ++ if (out_format) + *out_format = format; + +- return( 0 ); ++ return (0); + } + + /** +@@ -2995,22 +2993,22 @@ vips_image_decode_predict( VipsImage *in, + * Returns: 0 on success, or -1 on error. + */ + int +-vips_image_encode( VipsImage *in, VipsImage **out, VipsCoding coding ) ++vips_image_encode(VipsImage *in, VipsImage **out, VipsCoding coding) + { +- if( coding == VIPS_CODING_LABQ ) { +- if( vips_Lab2LabQ( in, out, NULL ) ) +- return( -1 ); +- } +- else if( coding == VIPS_CODING_RAD ) { +- if( vips_float2rad( in, out, NULL ) ) +- return( -1 ); ++ if (coding == VIPS_CODING_LABQ) { ++ if (vips_Lab2LabQ(in, out, NULL)) ++ return (-1); ++ } ++ else if (coding == VIPS_CODING_RAD) { ++ if (vips_float2rad(in, out, NULL)) ++ return (-1); + } + else { +- if( vips_copy( in, out, NULL ) ) +- return( -1 ); ++ if (vips_copy(in, out, NULL)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -3019,42 +3017,42 @@ vips_image_encode( VipsImage *in, VipsImage **out, VipsCoding coding ) + * + * Return %TRUE if @image is in most-significant- + * byte first form. This is the byte order used on the SPARC +- * architecture and others. ++ * architecture and others. + */ + gboolean +-vips_image_isMSBfirst( VipsImage *image ) +-{ +- if( image->magic == VIPS_MAGIC_SPARC ) +- return( 1 ); ++vips_image_isMSBfirst(VipsImage *image) ++{ ++ if (image->magic == VIPS_MAGIC_SPARC) ++ return (1); + else +- return( 0 ); ++ return (0); + } + + /** + * vips_image_isfile: + * @image: image to test + * +- * Return %TRUE if @image represents a file on disc in some way. ++ * Return %TRUE if @image represents a file on disc in some way. + */ +-gboolean +-vips_image_isfile( VipsImage *image ) ++gboolean ++vips_image_isfile(VipsImage *image) + { +- switch( image->dtype ) { ++ switch (image->dtype) { + case VIPS_IMAGE_MMAPIN: + case VIPS_IMAGE_MMAPINRW: + case VIPS_IMAGE_OPENOUT: + case VIPS_IMAGE_OPENIN: +- return( 1 ); ++ return (1); + + case VIPS_IMAGE_PARTIAL: + case VIPS_IMAGE_SETBUF: + case VIPS_IMAGE_SETBUF_FOREIGN: + case VIPS_IMAGE_NONE: +- return( 0 ); ++ return (0); + + default: +- g_assert( FALSE ); +- return( 0 ); ++ g_assert(FALSE); ++ return (0); + } + } + +@@ -3064,13 +3062,13 @@ vips_image_isfile( VipsImage *image ) + * + * Return %TRUE if @im represents a partial image (a delayed calculation). + */ +-gboolean +-vips_image_ispartial( VipsImage *image ) ++gboolean ++vips_image_ispartial(VipsImage *image) + { +- if( image->dtype == VIPS_IMAGE_PARTIAL ) +- return( 1 ); ++ if (image->dtype == VIPS_IMAGE_PARTIAL) ++ return (1); + else +- return( 0 ); ++ return (0); + } + + /** +@@ -3078,23 +3076,23 @@ vips_image_ispartial( VipsImage *image ) + * @image: image to check + * + * Look at an image's interpretation and see if it has extra alpha bands. For +- * example, a 4-band #VIPS_INTERPRETATION_sRGB would, but a six-band +- * #VIPS_INTERPRETATION_MULTIBAND would not. ++ * example, a 4-band #VIPS_INTERPRETATION_sRGB would, but a six-band ++ * #VIPS_INTERPRETATION_MULTIBAND would not. + * + * Return %TRUE if @image has an alpha channel. + */ + gboolean +-vips_image_hasalpha( VipsImage *image ) ++vips_image_hasalpha(VipsImage *image) + { + /* The result of hasalpha is used to turn on things like + * premultiplication, so we are rather conservative about when we + * signal this. We don't want to premultiply things that should not be + * premultiplied. + */ +- switch( image->Type ) { ++ switch (image->Type) { + case VIPS_INTERPRETATION_B_W: + case VIPS_INTERPRETATION_GREY16: +- return( image->Bands > 1 ); ++ return (image->Bands > 1); + + case VIPS_INTERPRETATION_RGB: + case VIPS_INTERPRETATION_CMC: +@@ -3107,16 +3105,16 @@ vips_image_hasalpha( VipsImage *image ) + case VIPS_INTERPRETATION_RGB16: + case VIPS_INTERPRETATION_scRGB: + case VIPS_INTERPRETATION_HSV: +- return( image->Bands > 3 ); ++ return (image->Bands > 3); + + case VIPS_INTERPRETATION_CMYK: +- return( image->Bands > 4 ); ++ return (image->Bands > 4); + + default: + /* We can't really infer anything about bands from things like + * HISTOGRAM or FOURIER. + */ +- return( FALSE ); ++ return (FALSE); + } + } + +@@ -3125,7 +3123,7 @@ vips_image_hasalpha( VipsImage *image ) + * @image: image to prepare + * + * Call this after setting header fields (width, height, and so on) to +- * allocate resources ready for writing. ++ * allocate resources ready for writing. + * + * Normally this function is called for you by vips_image_generate() or + * vips_image_write_line(). You will need to call it yourself if you plan to +@@ -3134,54 +3132,55 @@ vips_image_hasalpha( VipsImage *image ) + * Returns: 0 on success, or -1 on error. + */ + int +-vips_image_write_prepare( VipsImage *image ) ++vips_image_write_prepare(VipsImage *image) + { +- g_assert( vips_object_sanity( VIPS_OBJECT( image ) ) ); ++ g_assert(vips_object_sanity(VIPS_OBJECT(image))); + +- if( image->Xsize <= 0 || +- image->Ysize <= 0 || +- image->Bands <= 0 ) { +- vips_error( "VipsImage", "%s", _( "bad dimensions" ) ); +- return( -1 ); ++ if (image->Xsize <= 0 || ++ image->Ysize <= 0 || ++ image->Bands <= 0) { ++ vips_error("VipsImage", "%s", _("bad dimensions")); ++ return (-1); + } + + /* We don't use this, but make sure it's set in case any old programs + * are expecting it. + */ +- image->Bbits = vips_format_sizeof( image->BandFmt ) << 3; +- +- if( image->dtype == VIPS_IMAGE_PARTIAL ) { +- VIPS_DEBUG_MSG( "vips_image_write_prepare: " +- "old-style output for %s\n", image->filename ); ++ image->Bbits = vips_format_sizeof(image->BandFmt) << 3; ++ ++ if (image->dtype == VIPS_IMAGE_PARTIAL) { ++ VIPS_DEBUG_MSG("vips_image_write_prepare: " ++ "old-style output for %s\n", ++ image->filename); + + image->dtype = VIPS_IMAGE_SETBUF; + } + +- switch( image->dtype ) { ++ switch (image->dtype) { + case VIPS_IMAGE_MMAPINRW: + case VIPS_IMAGE_SETBUF_FOREIGN: + break; + + case VIPS_IMAGE_SETBUF: +- if( !image->data && +- !(image->data = vips_tracked_malloc( +- VIPS_IMAGE_SIZEOF_IMAGE( image ))) ) +- return( -1 ); ++ if (!image->data && ++ !(image->data = vips_tracked_malloc( ++ VIPS_IMAGE_SIZEOF_IMAGE(image)))) ++ return (-1); + + break; + + case VIPS_IMAGE_OPENOUT: +- if( vips_image_open_output( image ) ) +- return( -1 ); ++ if (vips_image_open_output(image)) ++ return (-1); + + break; + + default: +- vips_error( "VipsImage", "%s", _( "bad image descriptor" ) ); +- return( -1 ); ++ vips_error("VipsImage", "%s", _("bad image descriptor")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -3199,85 +3198,85 @@ vips_image_write_prepare( VipsImage *image ) + * Returns: 0 on success, or -1 on error. + */ + int +-vips_image_write_line( VipsImage *image, int ypos, VipsPel *linebuffer ) +-{ +- int linesize = VIPS_IMAGE_SIZEOF_LINE( image ); ++vips_image_write_line(VipsImage *image, int ypos, VipsPel *linebuffer) ++{ ++ int linesize = VIPS_IMAGE_SIZEOF_LINE(image); + + /* Is this the start of eval? + */ +- if( ypos == 0 ) { +- if( vips__image_wio_output( image ) ) +- return( -1 ); ++ if (ypos == 0) { ++ if (vips__image_wio_output(image)) ++ return (-1); + +- /* Always clear kill before we start looping. See the ++ /* Always clear kill before we start looping. See the + * call to vips_image_iskilled() below. + */ +- vips_image_set_kill( image, FALSE ); +- vips_image_write_prepare( image ); +- vips_image_preeval( image ); ++ vips_image_set_kill(image, FALSE); ++ vips_image_write_prepare(image); ++ vips_image_preeval(image); + } + + /* Possible cases for output: FILE or SETBUF. + */ +- switch( image->dtype ) { ++ switch (image->dtype) { + case VIPS_IMAGE_SETBUF: + case VIPS_IMAGE_SETBUF_FOREIGN: +- memcpy( VIPS_IMAGE_ADDR( image, 0, ypos ), +- linebuffer, linesize ); ++ memcpy(VIPS_IMAGE_ADDR(image, 0, ypos), ++ linebuffer, linesize); + break; + + case VIPS_IMAGE_OPENOUT: + /* Don't use ypos for this. + */ +- if( vips__write( image->fd, linebuffer, linesize ) ) +- return( -1 ); ++ if (vips__write(image->fd, linebuffer, linesize)) ++ return (-1); + break; + + default: +- vips_error( "VipsImage", +- _( "unable to output to a %s image" ), +- vips_enum_string( VIPS_TYPE_IMAGE_TYPE, +- image->dtype ) ); +- return( -1 ); ++ vips_error("VipsImage", ++ _("unable to output to a %s image"), ++ vips_enum_string(VIPS_TYPE_IMAGE_TYPE, ++ image->dtype)); ++ return (-1); + } + + /* Trigger evaluation callbacks for this image. + */ +- vips_image_eval( image, ypos * image->Xsize ); +- if( vips_image_iskilled( image ) ) +- return( -1 ); ++ vips_image_eval(image, ypos * image->Xsize); ++ if (vips_image_iskilled(image)) ++ return (-1); + + /* Is this the end of eval? + */ +- if( ypos == image->Ysize - 1 ) { +- vips_image_posteval( image ); +- if( vips_image_written( image ) ) +- return( -1 ); ++ if (ypos == image->Ysize - 1) { ++ vips_image_posteval(image); ++ if (vips_image_written(image)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Rewind an output file. VIPS images only. + */ + static int +-vips_image_rewind_output( VipsImage *image ) ++vips_image_rewind_output(VipsImage *image) + { + int fd; + +- g_assert( image->dtype == VIPS_IMAGE_OPENOUT ); ++ g_assert(image->dtype == VIPS_IMAGE_OPENOUT); + + #ifdef DEBUG_IO +- printf( "vips_image_rewind_output: %s\n", image->filename ); +-#endif/*DEBUG_IO*/ ++ printf("vips_image_rewind_output: %s\n", image->filename); ++#endif /*DEBUG_IO*/ + +- /* We want to keep the fd across rewind. ++ /* We want to keep the fd across rewind. + * + * On Windows, we open temp files with _O_TEMPORARY. We mustn't close +- * the file since this will delete it. ++ * the file since this will delete it. + * + * We could open the file again to keep a reference to it alive, but +- * this is also problematic on Windows. ++ * this is also problematic on Windows. + */ + fd = image->fd; + image->fd = -1; +@@ -3285,42 +3284,42 @@ vips_image_rewind_output( VipsImage *image ) + /* Free any resources the image holds and reset to a base + * state. + */ +- vips_object_rewind( VIPS_OBJECT( image ) ); ++ vips_object_rewind(VIPS_OBJECT(image)); + +- /* And reopen ... recurse to get a mmaped image. ++ /* And reopen ... recurse to get a mmaped image. + * + * We use "v" mode to get it opened as a vips image, bypassing the + * file type checks. They will fail on Windows because you can't open + * fds more than once. + */ + image->fd = fd; +- g_object_set( image, ++ g_object_set(image, + "mode", "v", +- NULL ); +- if( vips_object_build( VIPS_OBJECT( image ) ) ) { +- vips_error( "VipsImage", +- _( "auto-rewind for %s failed" ), +- image->filename ); +- return( -1 ); ++ NULL); ++ if (vips_object_build(VIPS_OBJECT(image))) { ++ vips_error("VipsImage", ++ _("auto-rewind for %s failed"), ++ image->filename); ++ return (-1); + } + + /* Now we've finished writing and reopened as read, we can +- * delete-on-close. ++ * delete-on-close. + * +- * On *nix-like systems, this will unlink the file from the ++ * On *nix-like systems, this will unlink the file from the + * filesystem and when we exit, for whatever reason, the file +- * we be reclaimed. ++ * we be reclaimed. + * + * On Windows this will fail because the file is open and you can't +- * delete open files. However, on Windows we set _O_TEMPORARY, so the ++ * delete open files. However, on Windows we set _O_TEMPORARY, so the + * file will be deleted when the fd is finally closed. + */ +- vips_image_delete( image ); ++ vips_image_delete(image); + +- return( 0 ); ++ return (0); + } + +-/** ++/** + * vips_image_copy_memory: + * @image: image to copy to a memory buffer + * +@@ -3336,7 +3335,7 @@ vips_image_rewind_output( VipsImage *image ) + * vips_copy() adds a null "copy" node to a pipeline. Use that + * instead if you want to change metadata and not pixels. + * +- * This operation is thread-safe, unlike vips_image_wio_input(). ++ * This operation is thread-safe, unlike vips_image_wio_input(). + * + * If you are sure that @image is not shared with another thread (perhaps you + * have made it yourself), use vips_image_wio_input() instead. +@@ -3346,11 +3345,11 @@ vips_image_rewind_output( VipsImage *image ) + * Returns: (transfer full): the new #VipsImage, or %NULL on error. + */ + VipsImage * +-vips_image_copy_memory( VipsImage *image ) ++vips_image_copy_memory(VipsImage *image) + { + VipsImage *new; + +- switch( image->dtype ) { ++ switch (image->dtype) { + case VIPS_IMAGE_SETBUF: + case VIPS_IMAGE_SETBUF_FOREIGN: + case VIPS_IMAGE_MMAPIN: +@@ -3358,26 +3357,26 @@ vips_image_copy_memory( VipsImage *image ) + /* Can read from all these, in principle anyway. + */ + new = image; +- g_object_ref( new ); ++ g_object_ref(new); + break; + + case VIPS_IMAGE_OPENOUT: + case VIPS_IMAGE_OPENIN: + case VIPS_IMAGE_PARTIAL: + new = vips_image_new_memory(); +- if( vips_image_write( image, new ) ) { +- g_object_unref( new ); +- return( NULL ); ++ if (vips_image_write(image, new)) { ++ g_object_unref(new); ++ return (NULL); + } + break; + + default: +- vips_error( "vips_image_copy_memory", +- "%s", _( "image not readable" ) ); +- return( NULL ); ++ vips_error("vips_image_copy_memory", ++ "%s", _("image not readable")); ++ return (NULL); + } + +- return( new ); ++ return (new); + } + + /** +@@ -3385,41 +3384,41 @@ vips_image_copy_memory( VipsImage *image ) + * @image: image to transform + * + * Check that an image is readable via the VIPS_IMAGE_ADDR() macro, that is, +- * that the entire image is in memory and all pixels can be read with +- * VIPS_IMAGE_ADDR(). If it +- * isn't, try to transform it so that VIPS_IMAGE_ADDR() can work. ++ * that the entire image is in memory and all pixels can be read with ++ * VIPS_IMAGE_ADDR(). If it ++ * isn't, try to transform it so that VIPS_IMAGE_ADDR() can work. + * + * Since this function modifies @image, it is not thread-safe. Only call it on + * images which you are sure have not been shared with another thread. If the + * image might have been shared, use the less efficient + * vips_image_copy_memory() instead. + * +- * See also: vips_image_copy_memory(), vips_image_pio_input(), ++ * See also: vips_image_copy_memory(), vips_image_pio_input(), + * vips_image_inplace(), VIPS_IMAGE_ADDR(). + * + * Returns: 0 on succeess, or -1 on error. + */ + int +-vips_image_wio_input( VipsImage *image ) +-{ ++vips_image_wio_input(VipsImage *image) ++{ + VipsImage *t1; + +- g_assert( vips_object_sanity( VIPS_OBJECT( image ) ) ); ++ g_assert(vips_object_sanity(VIPS_OBJECT(image))); + + #ifdef DEBUG_IO +- printf( "vips_image_wio_input: wio input for %s\n", +- image->filename ); +-#endif/*DEBUG_IO*/ ++ printf("vips_image_wio_input: wio input for %s\n", ++ image->filename); ++#endif /*DEBUG_IO*/ + +- switch( image->dtype ) { ++ switch (image->dtype) { + case VIPS_IMAGE_SETBUF: + case VIPS_IMAGE_SETBUF_FOREIGN: + /* Should have been written to. + */ +- if( !image->data ) { +- vips_error( "vips_image_wio_input", +- "%s", _( "no image data" ) ); +- return( -1 ); ++ if (!image->data) { ++ vips_error("vips_image_wio_input", ++ "%s", _("no image data")); ++ return (-1); + } + + break; +@@ -3432,17 +3431,17 @@ vips_image_wio_input( VipsImage *image ) + + case VIPS_IMAGE_PARTIAL: + #ifdef DEBUG_IO +- printf( "vips_image_wio_input: " +- "converting partial image to WIO\n" ); +-#endif/*DEBUG_IO*/ ++ printf("vips_image_wio_input: " ++ "converting partial image to WIO\n"); ++#endif /*DEBUG_IO*/ + +- /* Change to VIPS_IMAGE_SETBUF. First, make a memory ++ /* Change to VIPS_IMAGE_SETBUF. First, make a memory + * buffer and copy into that. + */ + t1 = vips_image_new_memory(); +- if( vips_image_write( image, t1 ) ) { +- g_object_unref( t1 ); +- return( -1 ); ++ if (vips_image_write(image, t1)) { ++ g_object_unref(t1); ++ return (-1); + } + + /* Copy new stuff in. We can't unref and free stuff, as this +@@ -3450,15 +3449,15 @@ vips_image_wio_input( VipsImage *image ) + * elsewhere. + */ + image->dtype = VIPS_IMAGE_SETBUF; +- image->data = t1->data; ++ image->data = t1->data; + t1->data = NULL; + + /* Close temp image. + */ +- g_object_unref( t1 ); ++ g_object_unref(t1); + + /* We need to zap any start/gen/stop callbacks. If we don't, +- * calling vips_region_prepare_to() later to read from this ++ * calling vips_region_prepare_to() later to read from this + * image will fail, since it will think it needs to create the + * image, not read from it. + */ +@@ -3471,22 +3470,22 @@ vips_image_wio_input( VipsImage *image ) + /* ... and that may confuse any regions which are trying to + * generate from this image. + */ +- if( image->regions ) +- g_warning( "rewinding image with active regions" ); ++ if (image->regions) ++ g_warning("rewinding image with active regions"); + + break; + + case VIPS_IMAGE_OPENIN: + #ifdef DEBUG_IO +- printf( "vips_image_wio_input: " +- "converting openin image for wio input\n" ); +-#endif/*DEBUG_IO*/ ++ printf("vips_image_wio_input: " ++ "converting openin image for wio input\n"); ++#endif /*DEBUG_IO*/ + + /* just mmap() the whole thing. + */ +- if( vips_mapfile( image ) ) +- return( -1 ); +- image->data = (VipsPel *) image->baseaddr + ++ if (vips_mapfile(image)) ++ return (-1); ++ image->data = (VipsPel *) image->baseaddr + + image->sizeof_header; + image->dtype = VIPS_IMAGE_MMAPIN; + +@@ -3496,37 +3495,37 @@ vips_image_wio_input( VipsImage *image ) + /* Close file down and reopen as input. I guess this will only + * work for vips files? + */ +- if( vips_image_rewind_output( image ) || +- vips_image_wio_input( image ) ) +- return( -1 ); ++ if (vips_image_rewind_output(image) || ++ vips_image_wio_input(image)) ++ return (-1); + + break; + + default: +- vips_error( "vips_image_wio_input", +- "%s", _( "image not readable" ) ); +- return( -1 ); ++ vips_error("vips_image_wio_input", ++ "%s", _("image not readable")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + +-int +-vips__image_wio_output( VipsImage *image ) ++int ++vips__image_wio_output(VipsImage *image) + { + #ifdef DEBUG_IO +- printf( "vips__image_wio_output: WIO output for %s\n", +- image->filename ); +-#endif/*DEBUG_IO*/ ++ printf("vips__image_wio_output: WIO output for %s\n", ++ image->filename); ++#endif /*DEBUG_IO*/ + +- switch( image->dtype ) { ++ switch (image->dtype) { + case VIPS_IMAGE_PARTIAL: + /* Make sure nothing is attached. + */ +- if( image->generate_fn ) { +- vips_error( "vips__image_wio_output", +- "%s", _( "image already written" ) ); +- return( -1 ); ++ if (image->generate_fn) { ++ vips_error("vips__image_wio_output", ++ "%s", _("image already written")); ++ return (-1); + } + + /* Cannot do old-style write to PARTIAL. Turn to SETBUF. +@@ -3538,7 +3537,7 @@ vips__image_wio_output( VipsImage *image ) + case VIPS_IMAGE_SETBUF: + case VIPS_IMAGE_OPENOUT: + case VIPS_IMAGE_SETBUF_FOREIGN: +- /* Can write to this ok. ++ /* Can write to this ok. + * + * We used to check that ->data was null and warn about + * writing twice, but we no longer insist that this is called +@@ -3548,27 +3547,27 @@ vips__image_wio_output( VipsImage *image ) + break; + + default: +- vips_error( "vips__image_wio_output", +- "%s", _( "image not writeable" ) ); +- return( -1 ); ++ vips_error("vips__image_wio_output", ++ "%s", _("image not writeable")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } +- ++ + /** + * vips_image_inplace: + * @image: image to make read-write + * + * Gets @image ready for an in-place operation, such as vips_draw_circle(). +- * After calling this function you can both read and write the image with ++ * After calling this function you can both read and write the image with + * VIPS_IMAGE_ADDR(). + * +- * This method is called for you by the base class of the draw operations, ++ * This method is called for you by the base class of the draw operations, + * there's no need to call it yourself. + * + * Since this function modifies @image, it is not thread-safe. Only call it on +- * images which you are sure have not been shared with another thread. ++ * images which you are sure have not been shared with another thread. + * All in-place operations are inherently not thread-safe, so you need to take + * great care in any case. + * +@@ -3577,16 +3576,16 @@ vips__image_wio_output( VipsImage *image ) + * Returns: 0 on succeess, or -1 on error. + */ + int +-vips_image_inplace( VipsImage *image ) ++vips_image_inplace(VipsImage *image) + { + /* Do an vips_image_wio_input(). This will rewind, generate, etc. + */ +- if( vips_image_wio_input( image ) ) +- return( -1 ); ++ if (vips_image_wio_input(image)) ++ return (-1); + + /* Look at the type. + */ +- switch( image->dtype ) { ++ switch (image->dtype) { + case VIPS_IMAGE_SETBUF: + case VIPS_IMAGE_SETBUF_FOREIGN: + case VIPS_IMAGE_MMAPINRW: +@@ -3597,31 +3596,31 @@ vips_image_inplace( VipsImage *image ) + case VIPS_IMAGE_MMAPIN: + /* Try to remap read-write. + */ +- if( vips_remapfilerw( image ) ) +- return( -1 ); ++ if (vips_remapfilerw(image)) ++ return (-1); + + break; + + default: +- vips_error( "vips_image_inplace", +- "%s", _( "bad file type" ) ); +- return( -1 ); ++ vips_error("vips_image_inplace", ++ "%s", _("bad file type")); ++ return (-1); + } + +- /* This image is about to be changed (probably). Make sure it's not ++ /* This image is about to be changed (probably). Make sure it's not + * in cache. + */ +- vips_image_invalidate_all( image ); ++ vips_image_invalidate_all(image); + +- return( 0 ); ++ return (0); + } + + /** + * vips_image_pio_input: + * @image: image to check + * +- * Check that an image is readable with vips_region_prepare() and friends. +- * If it isn't, try to transform the image so that vips_region_prepare() can ++ * Check that an image is readable with vips_region_prepare() and friends. ++ * If it isn't, try to transform the image so that vips_region_prepare() can + * work. + * + * See also: vips_image_pio_output(), vips_region_prepare(). +@@ -3629,24 +3628,24 @@ vips_image_inplace( VipsImage *image ) + * Returns: 0 on succeess, or -1 on error. + */ + int +-vips_image_pio_input( VipsImage *image ) ++vips_image_pio_input(VipsImage *image) + { +- g_assert( vips_object_sanity( VIPS_OBJECT( image ) ) ); ++ g_assert(vips_object_sanity(VIPS_OBJECT(image))); + + #ifdef DEBUG_IO +- printf( "vips_image_pio_input: enabling partial input for %s\n", +- image->filename ); ++ printf("vips_image_pio_input: enabling partial input for %s\n", ++ image->filename); + #endif /*DEBUG_IO*/ + +- switch( image->dtype ) { ++ switch (image->dtype) { + case VIPS_IMAGE_SETBUF: + case VIPS_IMAGE_SETBUF_FOREIGN: + /* Should have been written to. + */ +- if( !image->data ) { +- vips_error( "vips_image_pio_input", +- "%s", _( "no image data" ) ); +- return( -1 ); ++ if (!image->data) { ++ vips_error("vips_image_pio_input", ++ "%s", _("no image data")); ++ return (-1); + } + + /* Should be no generate functions now. +@@ -3660,10 +3659,10 @@ vips_image_pio_input( VipsImage *image ) + case VIPS_IMAGE_PARTIAL: + /* Should have had generate functions attached. + */ +- if( !image->generate_fn ) { +- vips_error( "vips_image_pio_input", +- "%s", _( "no image data" ) ); +- return( -1 ); ++ if (!image->generate_fn) { ++ vips_error("vips_image_pio_input", ++ "%s", _("no image data")); ++ return (-1); + } + + break; +@@ -3678,18 +3677,18 @@ vips_image_pio_input( VipsImage *image ) + /* Free any resources the image holds and reset to a base + * state. + */ +- if( vips_image_rewind_output( image ) ) +- return( -1 ); ++ if (vips_image_rewind_output(image)) ++ return (-1); + + break; + + default: +- vips_error( "vips_image_pio_input", +- "%s", _( "image not readable" ) ); +- return( -1 ); ++ vips_error("vips_image_pio_input", ++ "%s", _("image not readable")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -3703,29 +3702,29 @@ vips_image_pio_input( VipsImage *image ) + * + * Returns: 0 on succeess, or -1 on error. + */ +-int +-vips_image_pio_output( VipsImage *image ) ++int ++vips_image_pio_output(VipsImage *image) + { + #ifdef DEBUG_IO +- printf( "vips_image_pio_output: enabling partial output for %s\n", +- image->filename ); ++ printf("vips_image_pio_output: enabling partial output for %s\n", ++ image->filename); + #endif /*DEBUG_IO*/ + +- switch( image->dtype ) { ++ switch (image->dtype) { + case VIPS_IMAGE_SETBUF: +- if( image->data ) { +- vips_error( "vips_image_pio_output", +- "%s", _( "image already written" ) ); +- return( -1 ); ++ if (image->data) { ++ vips_error("vips_image_pio_output", ++ "%s", _("image already written")); ++ return (-1); + } + + break; + + case VIPS_IMAGE_PARTIAL: +- if( image->generate_fn ) { +- vips_error( "vips_image_pio_output", +- "%s", _( "image already written" ) ); +- return( -1 ); ++ if (image->generate_fn) { ++ vips_error("vips_image_pio_output", ++ "%s", _("image already written")); ++ return (-1); + } + + break; +@@ -3735,12 +3734,12 @@ vips_image_pio_output( VipsImage *image ) + break; + + default: +- vips_error( "vips_image_pio_output", +- "%s", _( "image not writeable" ) ); +- return( -1 ); ++ vips_error("vips_image_pio_output", ++ "%s", _("image not writeable")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -3750,26 +3749,26 @@ vips_image_pio_output( VipsImage *image ) + * Return %TRUE if @format is one of the integer types. + */ + gboolean +-vips_band_format_isint( VipsBandFormat format ) ++vips_band_format_isint(VipsBandFormat format) + { +- switch( format ) { ++ switch (format) { + case VIPS_FORMAT_UCHAR: + case VIPS_FORMAT_CHAR: + case VIPS_FORMAT_USHORT: + case VIPS_FORMAT_SHORT: + case VIPS_FORMAT_UINT: + case VIPS_FORMAT_INT: +- return( TRUE ); ++ return (TRUE); + + case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DOUBLE: + case VIPS_FORMAT_COMPLEX: +- case VIPS_FORMAT_DPCOMPLEX: +- return( FALSE ); ++ case VIPS_FORMAT_DPCOMPLEX: ++ return (FALSE); + + default: + g_assert_not_reached(); +- return( FALSE ); ++ return (FALSE); + } + } + +@@ -3780,26 +3779,26 @@ vips_band_format_isint( VipsBandFormat format ) + * Return %TRUE if @format is one of the unsigned integer types. + */ + gboolean +-vips_band_format_isuint( VipsBandFormat format ) ++vips_band_format_isuint(VipsBandFormat format) + { +- switch( format ) { ++ switch (format) { + case VIPS_FORMAT_UCHAR: + case VIPS_FORMAT_USHORT: + case VIPS_FORMAT_UINT: +- return( TRUE ); ++ return (TRUE); + + case VIPS_FORMAT_INT: + case VIPS_FORMAT_SHORT: + case VIPS_FORMAT_CHAR: + case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DOUBLE: + case VIPS_FORMAT_COMPLEX: +- case VIPS_FORMAT_DPCOMPLEX: +- return( FALSE ); +- ++ case VIPS_FORMAT_DPCOMPLEX: ++ return (FALSE); ++ + default: + g_assert_not_reached(); +- return( FALSE ); ++ return (FALSE); + } + } + +@@ -3810,12 +3809,12 @@ vips_band_format_isuint( VipsBandFormat format ) + * Return %TRUE if @format is uchar or schar. + */ + gboolean +-vips_band_format_is8bit( VipsBandFormat format ) ++vips_band_format_is8bit(VipsBandFormat format) + { +- switch( format ) { ++ switch (format) { + case VIPS_FORMAT_UCHAR: + case VIPS_FORMAT_CHAR: +- return( TRUE ); ++ return (TRUE); + + case VIPS_FORMAT_USHORT: + case VIPS_FORMAT_SHORT: +@@ -3825,11 +3824,11 @@ vips_band_format_is8bit( VipsBandFormat format ) + case VIPS_FORMAT_DOUBLE: + case VIPS_FORMAT_COMPLEX: + case VIPS_FORMAT_DPCOMPLEX: +- return( FALSE ); ++ return (FALSE); + + default: + g_assert_not_reached(); +- return( FALSE ); ++ return (FALSE); + } + } + +@@ -3840,12 +3839,12 @@ vips_band_format_is8bit( VipsBandFormat format ) + * Return %TRUE if @format is one of the float types. + */ + gboolean +-vips_band_format_isfloat( VipsBandFormat format ) ++vips_band_format_isfloat(VipsBandFormat format) + { +- switch( format ) { ++ switch (format) { + case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_DOUBLE: +- return( TRUE ); ++ case VIPS_FORMAT_DOUBLE: ++ return (TRUE); + + case VIPS_FORMAT_UCHAR: + case VIPS_FORMAT_CHAR: +@@ -3854,12 +3853,12 @@ vips_band_format_isfloat( VipsBandFormat format ) + case VIPS_FORMAT_UINT: + case VIPS_FORMAT_INT: + case VIPS_FORMAT_COMPLEX: +- case VIPS_FORMAT_DPCOMPLEX: +- return( FALSE ); +- ++ case VIPS_FORMAT_DPCOMPLEX: ++ return (FALSE); ++ + default: + g_assert_not_reached(); +- return( FALSE ); ++ return (FALSE); + } + } + +@@ -3870,12 +3869,12 @@ vips_band_format_isfloat( VipsBandFormat format ) + * Return %TRUE if @fmt is one of the complex types. + */ + gboolean +-vips_band_format_iscomplex( VipsBandFormat format ) ++vips_band_format_iscomplex(VipsBandFormat format) + { +- switch( format ) { ++ switch (format) { + case VIPS_FORMAT_COMPLEX: +- case VIPS_FORMAT_DPCOMPLEX: +- return( TRUE ); ++ case VIPS_FORMAT_DPCOMPLEX: ++ return (TRUE); + + case VIPS_FORMAT_UCHAR: + case VIPS_FORMAT_CHAR: +@@ -3884,12 +3883,12 @@ vips_band_format_iscomplex( VipsBandFormat format ) + case VIPS_FORMAT_UINT: + case VIPS_FORMAT_INT: + case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_DOUBLE: +- return( FALSE ); +- ++ case VIPS_FORMAT_DOUBLE: ++ return (FALSE); ++ + default: + g_assert_not_reached(); +- return( FALSE ); ++ return (FALSE); + } + } + +@@ -3902,25 +3901,25 @@ vips_band_format_iscomplex( VipsBandFormat format ) + * is intended to be used with g_signal_connect. + */ + void +-vips_image_free_buffer( VipsImage *image, void *buffer ) ++vips_image_free_buffer(VipsImage *image, void *buffer) + { +- free( buffer ); ++ free(buffer); + } + + /* Handy for debugging: view an image in nip2. + */ + int +-vips__view_image( VipsImage *image ) ++vips__view_image(VipsImage *image) + { +- VipsArrayImage *array; ++ VipsArrayImage *array; + int result; + +- array = vips_array_image_new( &image, 1 ); +- result = vips_system( "nip2 %s", +- "in", array, +- "in-format", "%s.v", +- NULL ); +- vips_area_unref( VIPS_AREA( array ) ); ++ array = vips_array_image_new(&image, 1); ++ result = vips_system("nip2 %s", ++ "in", array, ++ "in-format", "%s.v", ++ NULL); ++ vips_area_unref(VIPS_AREA(array)); + +- return( result ); ++ return (result); + } +diff --git a/libvips/iofuncs/init.c b/libvips/iofuncs/init.c +index 93f0b17ba8..213b3b225b 100644 +--- a/libvips/iofuncs/init.c ++++ b/libvips/iofuncs/init.c +@@ -38,28 +38,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -118,7 +118,7 @@ + */ + int vips__fatal = 0; + +-/* Use in various small places where we need a mutex and it's not worth ++/* Use in various small places where we need a mutex and it's not worth + * making a private one. + */ + GMutex *vips__global_lock = NULL; +@@ -142,7 +142,7 @@ int vips__leak = 0; + #ifdef DEBUG_LEAK + /* Count pixels processed per image here. + */ +-GQuark vips__image_pixels_quark = 0; ++GQuark vips__image_pixels_quark = 0; + #endif /*DEBUG_LEAK*/ + + static gint64 vips_pipe_read_limit = 1024 * 1024 * 1024; +@@ -152,14 +152,14 @@ static gint64 vips_pipe_read_limit = 1024 * 1024 * 1024; + * + * See also: VIPS_INIT(). + * +- * Returns: (transfer none): a pointer to an internal copy of the ++ * Returns: (transfer none): a pointer to an internal copy of the + * argv0 string passed to + * VIPS_INIT(). Do not free this value + */ + const char * +-vips_get_argv0( void ) ++vips_get_argv0(void) + { +- return( vips__argv0 ); ++ return (vips__argv0); + } + + /** +@@ -169,18 +169,18 @@ vips_get_argv0( void ) + * + * See also: VIPS_INIT(). + * +- * Returns: (transfer none): a pointer to an internal copy of the program ++ * Returns: (transfer none): a pointer to an internal copy of the program + * name. Do not free this value + */ + const char * +-vips_get_prgname( void ) ++vips_get_prgname(void) + { + const char *prgname; + +- if( (prgname = g_get_prgname()) ) +- return( prgname ); ++ if ((prgname = g_get_prgname())) ++ return (prgname); + else +- return( vips__prgname ); ++ return (vips__prgname); + } + + /** +@@ -189,26 +189,26 @@ vips_get_prgname( void ) + * + * VIPS_INIT() starts up the world of VIPS. You should call this on + * program startup before using any other VIPS operations. If you do not call +- * VIPS_INIT(), VIPS will call it for you when you use your first VIPS +- * operation, but it may not be able to get hold of @ARGV0 and VIPS may +- * therefore be unable to find its data files. It is much better to call ++ * VIPS_INIT(), VIPS will call it for you when you use your first VIPS ++ * operation, but it may not be able to get hold of @ARGV0 and VIPS may ++ * therefore be unable to find its data files. It is much better to call + * this macro yourself. + * +- * @ARGV0 is used to help discover message catalogues if libvips has been ++ * @ARGV0 is used to help discover message catalogues if libvips has been + * relocated. If you don't need a relocatable package, you can just pass `""` + * and it'll be fine. + * + * Additionally, VIPS_INIT() can be run from any thread, but it must not be +- * called from more than one thread at the same time. This is much easier to ++ * called from more than one thread at the same time. This is much easier to + * guarantee if you call it yourself. + * + * VIPS_INIT() is a macro, since it tries to check ABI compatibility + * between the caller and the library. You can also call vips_init(), the + * non-macro version, if macros are not available to you. + * +- * You may call VIPS_INIT() many times and vips_shutdown() many times, but you ++ * You may call VIPS_INIT() many times and vips_shutdown() many times, but you + * must not call VIPS_INIT() after vips_shutdown(). In other words, you cannot +- * stop and restart vips. ++ * stop and restart vips. + * + * Use the environment variable `VIPS_MIN_STACK_SIZE` to set the minimum stack + * size. For example, `2m` for a minimum of two megabytes of stack. This can +@@ -216,7 +216,7 @@ vips_get_prgname( void ) + * + * VIPS_INIT() does approximately the following: + * +- * + checks that the libvips your program is expecting is ++ * + checks that the libvips your program is expecting is + * binary-compatible with the vips library you're running against + * + * + sets a minimum stack size, see above +@@ -246,7 +246,7 @@ vips_get_prgname( void ) + * } + * ]| + * +- * See also: vips_shutdown(), vips_add_option_entries(), vips_version(), ++ * See also: vips_shutdown(), vips_add_option_entries(), vips_version(), + * vips_guess_prefix(), vips_guess_libdir(). + * + * Returns: 0 on success, -1 otherwise +@@ -257,76 +257,76 @@ vips_get_prgname( void ) + * '.plg' (deprecated) suffix. Error if we had any probs. + */ + static int +-vips_load_plugins( const char *fmt, ... ) ++vips_load_plugins(const char *fmt, ...) + { +- va_list ap; +- char dir_name[VIPS_PATH_MAX]; +- GDir *dir; ++ va_list ap; ++ char dir_name[VIPS_PATH_MAX]; ++ GDir *dir; + const char *name; +- int result; ++ int result; + + /* Silently succeed if we can't do modules. + */ +- if( !g_module_supported() ) +- return( 0 ); ++ if (!g_module_supported()) ++ return (0); + +- va_start( ap, fmt ); +- (void) vips_vsnprintf( dir_name, VIPS_PATH_MAX - 1, fmt, ap ); +- va_end( ap ); ++ va_start(ap, fmt); ++ (void) vips_vsnprintf(dir_name, VIPS_PATH_MAX - 1, fmt, ap); ++ va_end(ap); + +- g_info( "searching \"%s\"", dir_name ); ++ g_info("searching \"%s\"", dir_name); + +- if( !(dir = g_dir_open( dir_name, 0, NULL )) ) ++ if (!(dir = g_dir_open(dir_name, 0, NULL))) + /* Silent success for dir not there. + */ +- return( 0 ); ++ return (0); + +- result = 0; +- while( (name = g_dir_read_name( dir )) ) +- if( vips_ispostfix( name, "." G_MODULE_SUFFIX ) ++ result = 0; ++ while ((name = g_dir_read_name(dir))) ++ if (vips_ispostfix(name, "." G_MODULE_SUFFIX) + #if ENABLE_DEPRECATED +- || vips_ispostfix( name, ".plg" ) ++ || vips_ispostfix(name, ".plg") + #endif +- ) { ++ ) { + char path[VIPS_PATH_MAX]; + GModule *module; + +- vips_snprintf( path, VIPS_PATH_MAX - 1, +- "%s" G_DIR_SEPARATOR_S "%s", dir_name, name ); ++ vips_snprintf(path, VIPS_PATH_MAX - 1, ++ "%s" G_DIR_SEPARATOR_S "%s", dir_name, name); + +- g_info( "loading \"%s\"", path ); ++ g_info("loading \"%s\"", path); + +- module = g_module_open( path, G_MODULE_BIND_LAZY ); +- if( !module ) { +- g_warning( _( "unable to load \"%s\" -- %s" ), +- path, g_module_error() ); ++ module = g_module_open(path, G_MODULE_BIND_LAZY); ++ if (!module) { ++ g_warning(_("unable to load \"%s\" -- %s"), ++ path, g_module_error()); + result = -1; + } + + /* Modules will almost certainly create new types, so + * they can't be unloaded. + */ +- g_module_make_resident( module ); +- } +- g_dir_close( dir ); ++ g_module_make_resident(module); ++ } ++ g_dir_close(dir); + +- return( result ); ++ return (result); + } + #endif /*ENABLE_MODULES*/ + + /* Install this log handler to hide warning messages. + */ + static void +-empty_log_handler( const gchar *log_domain, GLogLevelFlags log_level, +- const gchar *message, gpointer user_data ) +-{ ++empty_log_handler(const gchar *log_domain, GLogLevelFlags log_level, ++ const gchar *message, gpointer user_data) ++{ + } + + /* Attempt to set a minimum stacksize. This can be important on systems with a + * very low default, like musl. + */ + static void +-set_stacksize( guint64 size ) ++set_stacksize(guint64 size) + { + #ifdef HAVE_PTHREAD_DEFAULT_NP + pthread_attr_t attr; +@@ -334,50 +334,50 @@ set_stacksize( guint64 size ) + + /* Don't allow stacks less than 2mb. + */ +- size = VIPS_MAX( size, 2 * 1024 * 1024 ); ++ size = VIPS_MAX(size, 2 * 1024 * 1024); + +- if( pthread_attr_init( &attr ) || +- pthread_attr_getstacksize( &attr, &cur_stack_size ) ) { +- g_warning( "set_stacksize: unable to get stack size" ); ++ if (pthread_attr_init(&attr) || ++ pthread_attr_getstacksize(&attr, &cur_stack_size)) { ++ g_warning("set_stacksize: unable to get stack size"); + return; + } + +- if( cur_stack_size < size ) { +- if( pthread_attr_setstacksize( &attr, size ) || +- pthread_setattr_default_np( &attr ) ) +- g_warning( "set_stacksize: unable to set stack size" ); +- else +- g_info( "set stack size to %" G_GUINT64_FORMAT "k", +- size / (guint64) 1024 ); ++ if (cur_stack_size < size) { ++ if (pthread_attr_setstacksize(&attr, size) || ++ pthread_setattr_default_np(&attr)) ++ g_warning("set_stacksize: unable to set stack size"); ++ else ++ g_info("set stack size to %" G_GUINT64_FORMAT "k", ++ size / (guint64) 1024); + } + #endif /*HAVE_PTHREAD_DEFAULT_NP*/ + } + + static void +-vips_verbose( void ) ++vips_verbose(void) + { + const char *old; + +- old = g_getenv( "G_MESSAGES_DEBUG" ); ++ old = g_getenv("G_MESSAGES_DEBUG"); + +- if( !old ) +- g_setenv( "G_MESSAGES_DEBUG", G_LOG_DOMAIN, TRUE ); +- else if( !g_str_equal( old, "all" ) && +- !g_strrstr( old, G_LOG_DOMAIN ) ) { ++ if (!old) ++ g_setenv("G_MESSAGES_DEBUG", G_LOG_DOMAIN, TRUE); ++ else if (!g_str_equal(old, "all") && ++ !g_strrstr(old, G_LOG_DOMAIN)) { + char *new; + +- new = g_strconcat( old, " ", G_LOG_DOMAIN, NULL ); +- g_setenv( "G_MESSAGES_DEBUG", new, TRUE ); ++ new = g_strconcat(old, " ", G_LOG_DOMAIN, NULL); ++ g_setenv("G_MESSAGES_DEBUG", new, TRUE); + +- g_free( new ); ++ g_free(new); + } + } + + static int +-vips_leak( void ) ++vips_leak(void) + { + char txt[1024]; +- VipsBuf buf = VIPS_BUF_STATIC( txt ); ++ VipsBuf buf = VIPS_BUF_STATIC(txt); + int n_leaks; + + n_leaks = 0; +@@ -388,26 +388,26 @@ vips_leak( void ) + n_leaks += vips_tracked_get_mem(); + n_leaks += vips_tracked_get_files(); + +- if( vips_tracked_get_allocs() || ++ if (vips_tracked_get_allocs() || + vips_tracked_get_mem() || +- vips_tracked_get_files() ) { +- vips_buf_appendf( &buf, "memory: %d allocations, %zd bytes\n", +- vips_tracked_get_allocs(), vips_tracked_get_mem() ); +- vips_buf_appendf( &buf, "files: %d open\n", +- vips_tracked_get_files() ); ++ vips_tracked_get_files()) { ++ vips_buf_appendf(&buf, "memory: %d allocations, %zd bytes\n", ++ vips_tracked_get_allocs(), vips_tracked_get_mem()); ++ vips_buf_appendf(&buf, "files: %d open\n", ++ vips_tracked_get_files()); + } + +- vips_buf_appendf( &buf, "memory: high-water mark " ); +- vips_buf_append_size( &buf, vips_tracked_get_mem_highwater() ); +- vips_buf_appends( &buf, "\n" ); ++ vips_buf_appendf(&buf, "memory: high-water mark "); ++ vips_buf_append_size(&buf, vips_tracked_get_mem_highwater()); ++ vips_buf_appends(&buf, "\n"); + +- if( strlen( vips_error_buffer() ) > 0 ) { +- vips_buf_appendf( &buf, "error buffer: %s", +- vips_error_buffer() ); +- n_leaks += strlen( vips_error_buffer() ); ++ if (strlen(vips_error_buffer()) > 0) { ++ vips_buf_appendf(&buf, "error buffer: %s", ++ vips_error_buffer()); ++ n_leaks += strlen(vips_error_buffer()); + } + +- fprintf( stderr, "%s", vips_buf_all( &buf ) ); ++ fprintf(stderr, "%s", vips_buf_all(&buf)); + + n_leaks += vips__print_renders(); + +@@ -415,34 +415,34 @@ vips_leak( void ) + vips_buffer_dump_all(); + #endif /*DEBUG*/ + +- return( n_leaks ); ++ return (n_leaks); + } + + /** + * vips_init: + * @argv0: name of application + * +- * This function starts up libvips, see VIPS_INIT(). ++ * This function starts up libvips, see VIPS_INIT(). + * + * This function is for bindings which need to start up vips. C programs +- * should use the VIPS_INIT() macro, which does some extra checks. ++ * should use the VIPS_INIT() macro, which does some extra checks. + * +- * See also: VIPS_INIT(). ++ * See also: VIPS_INIT(). + * + * Returns: 0 on success, -1 otherwise + */ + int +-vips_init( const char *argv0 ) ++vips_init(const char *argv0) + { +- extern GType vips_system_get_type( void ); +- extern GType write_thread_state_get_type( void ); +- extern GType sink_memory_thread_state_get_type( void ); +- extern GType render_thread_state_get_type( void ); +- extern GType vips_source_get_type( void ); +- extern GType vips_source_custom_get_type( void ); +- extern GType vips_target_get_type( void ); +- extern GType vips_target_custom_get_type( void ); +- extern GType vips_g_input_stream_get_type( void ); ++ extern GType vips_system_get_type(void); ++ extern GType write_thread_state_get_type(void); ++ extern GType sink_memory_thread_state_get_type(void); ++ extern GType render_thread_state_get_type(void); ++ extern GType vips_source_get_type(void); ++ extern GType vips_source_custom_get_type(void); ++ extern GType vips_target_get_type(void); ++ extern GType vips_target_custom_get_type(void); ++ extern GType vips_g_input_stream_get_type(void); + + static gboolean started = FALSE; + static gboolean done = FALSE; +@@ -458,105 +458,105 @@ vips_init( const char *argv0 ) + * means we're currently initialising. Use this to prevent recursive + * invocation. + */ +- if( done ) ++ if (done) + /* Called more than once, we succeeded, just return OK. + */ +- return( 0 ); +- if( started ) ++ return (0); ++ if (started) + /* Recursive invocation, something has broken horribly. + * Hopefully the first init will handle it. + */ +- return( 0 ); ++ return (0); + started = TRUE; + + /* Try to set a minimum stacksize, default 2mb. We need to do this + * before any threads start. + */ + min_stack_size = 2 * 1024 * 1024; +- if( (vips_min_stack_size = g_getenv( "VIPS_MIN_STACK_SIZE" )) ) +- min_stack_size = vips__parse_size( vips_min_stack_size ); +- (void) set_stacksize( min_stack_size ); ++ if ((vips_min_stack_size = g_getenv("VIPS_MIN_STACK_SIZE"))) ++ min_stack_size = vips__parse_size(vips_min_stack_size); ++ (void) set_stacksize(min_stack_size); + +- if( g_getenv( "VIPS_INFO" ) ++ if (g_getenv("VIPS_INFO") + #if ENABLE_DEPRECATED +- || g_getenv( "IM_INFO" ) ++ || g_getenv("IM_INFO") + #endif + ) + vips_verbose(); +- if( g_getenv( "VIPS_PROFILE" ) ) +- vips_profile_set( TRUE ); +- if( g_getenv( "VIPS_LEAK" ) ) +- vips_leak_set( TRUE ); +- if( g_getenv( "VIPS_TRACE" ) ) +- vips_cache_set_trace( TRUE ); +- if( g_getenv( "VIPS_PIPE_READ_LIMIT" ) ) +- vips_pipe_read_limit = +- g_ascii_strtoll( g_getenv( "VIPS_PIPE_READ_LIMIT" ), +- NULL, 10 ); +- vips_pipe_read_limit_set( vips_pipe_read_limit ); ++ if (g_getenv("VIPS_PROFILE")) ++ vips_profile_set(TRUE); ++ if (g_getenv("VIPS_LEAK")) ++ vips_leak_set(TRUE); ++ if (g_getenv("VIPS_TRACE")) ++ vips_cache_set_trace(TRUE); ++ if (g_getenv("VIPS_PIPE_READ_LIMIT")) ++ vips_pipe_read_limit = ++ g_ascii_strtoll(g_getenv("VIPS_PIPE_READ_LIMIT"), ++ NULL, 10); ++ vips_pipe_read_limit_set(vips_pipe_read_limit); + + #ifdef G_OS_WIN32 + /* Windows has a limit of 512 files open at once for the fopen() family + * of functions, and 2048 for the _open() family. This raises the limit + * of fopen() to the same level as _open(). + * +- * It will not go any higher than this, unfortunately. ++ * It will not go any higher than this, unfortunately. + */ +- (void) _setmaxstdio( 2048 ); ++ (void) _setmaxstdio(2048); + #endif /*G_OS_WIN32*/ + +- vips__thread_init(); ++ vips__thread_init(); + vips__threadpool_init(); + vips__buffer_init(); + vips__meta_init(); + + /* This does an unsynchronised static hash table init on first call -- +- * we have to make sure we do this single-threaded. See: ++ * we have to make sure we do this single-threaded. See: + * https://github.com/openslide/openslide/issues/161 + */ +-#if !GLIB_CHECK_VERSION( 2, 48, 1 ) +- (void) g_get_language_names(); ++#if !GLIB_CHECK_VERSION(2, 48, 1) ++ (void) g_get_language_names(); + #endif + +- if( !vips__global_lock ) ++ if (!vips__global_lock) + vips__global_lock = vips_g_mutex_new(); + +- if( !vips__global_timer ) ++ if (!vips__global_timer) + vips__global_timer = g_timer_new(); + +- VIPS_SETSTR( vips__argv0, argv0 ); +- vips__prgname = g_path_get_basename( argv0 ); ++ VIPS_SETSTR(vips__argv0, argv0); ++ vips__prgname = g_path_get_basename(argv0); + +- vips__thread_profile_attach( "main" ); ++ vips__thread_profile_attach("main"); + + /* We can't do VIPS_GATE_START() until command-line processing + * happens, since vips__thread_profile may not be set yet. Call +- * directly. ++ * directly. + */ +- vips__thread_gate_start( "init: main" ); +- vips__thread_gate_start( "init: startup" ); ++ vips__thread_gate_start("init: main"); ++ vips__thread_gate_start("init: startup"); + +- /* Try to discover our prefix. ++ /* Try to discover our prefix. + */ +- if( (prefix = g_getenv( "VIPSHOME" )) ) +- g_info( "VIPSHOME = %s", prefix ); +- if( !(prefix = vips_guess_prefix( argv0, "VIPSHOME" )) || +- !(libdir = vips_guess_libdir( argv0, "VIPSHOME" )) ) +- return( -1 ); ++ if ((prefix = g_getenv("VIPSHOME"))) ++ g_info("VIPSHOME = %s", prefix); ++ if (!(prefix = vips_guess_prefix(argv0, "VIPSHOME")) || ++ !(libdir = vips_guess_libdir(argv0, "VIPSHOME"))) ++ return (-1); + +- g_info( "VIPS_PREFIX = %s", VIPS_PREFIX ); +- g_info( "VIPS_LIBDIR = %s", VIPS_LIBDIR ); +- g_info( "prefix = %s", prefix ); +- g_info( "libdir = %s", libdir ); ++ g_info("VIPS_PREFIX = %s", VIPS_PREFIX); ++ g_info("VIPS_LIBDIR = %s", VIPS_LIBDIR); ++ g_info("prefix = %s", prefix); ++ g_info("libdir = %s", libdir); + + /* Get i18n .mo files from $VIPSHOME/share/locale/. + */ + #ifdef ENABLE_NLS +- locale = g_build_filename( prefix, "share", "locale", NULL ); +- bindtextdomain( GETTEXT_PACKAGE, locale ); +- g_free( locale ); ++ locale = g_build_filename(prefix, "share", "locale", NULL); ++ bindtextdomain(GETTEXT_PACKAGE, locale); ++ g_free(locale); + #ifdef HAVE_BIND_TEXTDOMAIN_CODESET +- bind_textdomain_codeset( GETTEXT_PACKAGE, "UTF-8" ); ++ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); + #endif /* HAVE_BIND_TEXTDOMAIN_CODESET */ + #endif /* ENABLE_NLS */ + +@@ -565,12 +565,12 @@ vips_init( const char *argv0 ) + (void) vips_image_get_type(); + (void) vips_region_get_type(); + (void) write_thread_state_get_type(); +- (void) sink_memory_thread_state_get_type(); +- (void) render_thread_state_get_type(); +- (void) vips_source_get_type(); +- (void) vips_source_custom_get_type(); +- (void) vips_target_get_type(); +- (void) vips_target_custom_get_type(); ++ (void) sink_memory_thread_state_get_type(); ++ (void) render_thread_state_get_type(); ++ (void) vips_source_get_type(); ++ (void) vips_source_custom_get_type(); ++ (void) vips_target_get_type(); ++ (void) vips_target_custom_get_type(); + vips__meta_init_types(); + vips__interpolate_init(); + +@@ -601,40 +601,40 @@ vips_init( const char *argv0 ) + vips_morphology_operation_init(); + vips_draw_operation_init(); + vips_mosaicing_operation_init(); +- vips_g_input_stream_get_type(); ++ vips_g_input_stream_get_type(); + + #ifdef ENABLE_MODULES + /* Load any vips8 modules from the vips libdir. Keep going, even if +- * some modules fail to load. ++ * some modules fail to load. + * + * Only do this if we have been built as a set of loadable + * modules, or we might try loading an operation into a library that + * already has that operation built in. + */ +- (void) vips_load_plugins( "%s/vips-modules-%d.%d", +- libdir, VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION ); ++ (void) vips_load_plugins("%s/vips-modules-%d.%d", ++ libdir, VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION); + + #if ENABLE_DEPRECATED + /* Load any vips8 plugins from the vips libdir. + */ +- (void) vips_load_plugins( "%s/vips-plugins-%d.%d", +- libdir, VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION ); ++ (void) vips_load_plugins("%s/vips-plugins-%d.%d", ++ libdir, VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION); + +- /* Load up any vips7 plugins in the vips libdir. We don't error on +- * failure, it's too annoying to have VIPS refuse to start because of ++ /* Load up any vips7 plugins in the vips libdir. We don't error on ++ * failure, it's too annoying to have VIPS refuse to start because of + * a broken plugin. + */ +- if( im_load_plugins( "%s/vips-%d.%d", +- libdir, VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION ) ) { +- g_warning( "%s", vips_error_buffer() ); ++ if (im_load_plugins("%s/vips-%d.%d", ++ libdir, VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION)) { ++ g_warning("%s", vips_error_buffer()); + vips_error_clear(); + } + + /* Also load from libdir. This is old and slightly broken behaviour + * :-( kept for back compat convenience. + */ +- if( im_load_plugins( "%s", libdir ) ) { +- g_warning( "%s", vips_error_buffer() ); ++ if (im_load_plugins("%s", libdir)) { ++ g_warning("%s", vips_error_buffer()); + vips_error_clear(); + } + #endif /*ENABLE_DEPRECATED*/ +@@ -651,8 +651,8 @@ vips_init( const char *argv0 ) + #endif /*HAVE_GSF*/ + + #ifdef DEBUG_LEAK +- vips__image_pixels_quark = +- g_quark_from_static_string( "vips-image-pixels" ); ++ vips__image_pixels_quark = ++ g_quark_from_static_string("vips-image-pixels"); + #endif /*DEBUG_LEAK*/ + + /* If VIPS_WARNING is defined, suppress all warning messages from vips. +@@ -660,59 +660,59 @@ vips_init( const char *argv0 ) + * Libraries should not call g_log_set_handler(), it is + * supposed to be for the application layer, but this can be awkward to + * set up if you are using libvips from something like Ruby. Allow this +- * env var hack as a workaround. ++ * env var hack as a workaround. + */ +- if( g_getenv( "VIPS_WARNING" ) ++ if (g_getenv("VIPS_WARNING") + #if ENABLE_DEPRECATED +- || g_getenv( "IM_WARNING" ) ++ || g_getenv("IM_WARNING") + #endif + ) +- g_log_set_handler( G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, +- empty_log_handler, NULL ); ++ g_log_set_handler(G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, ++ empty_log_handler, NULL); + + /* Block any untrusted operations. This must come after plugin load. + */ +- if( g_getenv( "VIPS_BLOCK_UNTRUSTED" ) ) +- vips_block_untrusted_set( TRUE ); ++ if (g_getenv("VIPS_BLOCK_UNTRUSTED")) ++ vips_block_untrusted_set(TRUE); + + done = TRUE; + +- vips__thread_gate_stop( "init: startup" ); ++ vips__thread_gate_stop("init: startup"); + +- return( 0 ); ++ return (0); + } + + /* Call this before vips stuff that uses stuff we need to have inited. + */ + void +-vips_check_init( void ) ++vips_check_init(void) + { + /* Pass in a nonsense name for argv0 ... this init path is only here + * for old programs which are missing an vips_init() call. We need + * i18n set up before we can translate. + */ +- if( vips_init( "vips" ) ) ++ if (vips_init("vips")) + vips_error_clear(); + } + + /** +- * vips_thread_shutdown: ++ * vips_thread_shutdown: + * + * Free any thread-private data and flush any profiling information. + * + * This function needs to be called when a thread that has been using vips + * exits. It is called for you by vips_shutdown() and for any threads created +- * within the #VipsThreadPool. ++ * within the #VipsThreadPool. + * + * You will need to call it from threads created in +- * other ways or there will be memory leaks. If you do not call it, vips ++ * other ways or there will be memory leaks. If you do not call it, vips + * will generate a warning message. + * +- * It may be called many times, and you can continue using vips after +- * calling it. Calling it too often will reduce performance. ++ * It may be called many times, and you can continue using vips after ++ * calling it. Calling it too often will reduce performance. + */ + void +-vips_thread_shutdown( void ) ++vips_thread_shutdown(void) + { + vips__thread_profile_detach(); + vips__buffer_shutdown(); +@@ -722,23 +722,23 @@ vips_thread_shutdown( void ) + * vips_shutdown: + * + * Call this to drop caches, close plugins, terminate background threads, and +- * finalize any internal library testing. ++ * finalize any internal library testing. + * + * vips_shutdown() is optional. If you don't call it, your platform will + * clean up for you. The only negative consequences are that the leak checker + * and the profiler will not work. + * +- * You may call VIPS_INIT() many times and vips_shutdown() many times, but you ++ * You may call VIPS_INIT() many times and vips_shutdown() many times, but you + * must not call VIPS_INIT() after vips_shutdown(). In other words, you cannot +- * stop and restart libvips. ++ * stop and restart libvips. + * + * See also: vips_profile_set(), vips_leak_set(). + */ + void +-vips_shutdown( void ) ++vips_shutdown(void) + { + #ifdef DEBUG +- printf( "vips_shutdown:\n" ); ++ printf("vips_shutdown:\n"); + #endif /*DEBUG*/ + + vips_cache_drop_all(); +@@ -749,13 +749,13 @@ vips_shutdown( void ) + + /* Mustn't run this more than once. Don't use the VIPS_GATE macro, + * since we don't for gate start. +- */ +-{ +- static gboolean done = FALSE; ++ */ ++ { ++ static gboolean done = FALSE; + +- if( !done ) +- vips__thread_gate_stop( "init: main" ); +-} ++ if (!done) ++ vips__thread_gate_stop("init: main"); ++ } + + vips__render_shutdown(); + vips_thread_shutdown(); +@@ -763,27 +763,27 @@ vips_shutdown( void ) + vips__threadpool_shutdown(); + + #ifdef HAVE_GSF +- gsf_shutdown(); ++ gsf_shutdown(); + #endif /*HAVE_GSF*/ + + /* Don't free vips__global_lock -- we want to be able to use + * vips_error_buffer() after vips_shutdown(), since vips_leak() can + * call it. + */ +- VIPS_FREE( vips__argv0 ); +- VIPS_FREE( vips__prgname ); +- VIPS_FREEF( g_timer_destroy, vips__global_timer ); ++ VIPS_FREE(vips__argv0); ++ VIPS_FREE(vips__prgname); ++ VIPS_FREEF(g_timer_destroy, vips__global_timer); + + /* In dev releases, always show leaks. But not more than once, it's + * annoying. + */ + #ifndef DEBUG_LEAK +- if( vips__leak ) ++ if (vips__leak) + #endif /*DEBUG_LEAK*/ + { + static gboolean done = FALSE; + +- if( !done ) { ++ if (!done) { + done = TRUE; + vips_leak(); + } +@@ -791,153 +791,153 @@ vips_shutdown( void ) + } + + static gboolean +-vips_lib_info_cb( const gchar *option_name, const gchar *value, +- gpointer data, GError **error ) ++vips_lib_info_cb(const gchar *option_name, const gchar *value, ++ gpointer data, GError **error) + { + vips_verbose(); + +- return( TRUE ); ++ return (TRUE); + } + + static gboolean +-vips_set_fatal_cb( const gchar *option_name, const gchar *value, +- gpointer data, GError **error ) ++vips_set_fatal_cb(const gchar *option_name, const gchar *value, ++ gpointer data, GError **error) + { +- vips__fatal = 1; ++ vips__fatal = 1; + +- /* Set masks for debugging ... stop on any problem. ++ /* Set masks for debugging ... stop on any problem. + */ + g_log_set_always_fatal( + G_LOG_FLAG_RECURSION | + G_LOG_FLAG_FATAL | + G_LOG_LEVEL_ERROR | + G_LOG_LEVEL_CRITICAL | +- G_LOG_LEVEL_WARNING ); ++ G_LOG_LEVEL_WARNING); + +- return( TRUE ); ++ return (TRUE); + } + + static gboolean +-vips_lib_version_cb( const gchar *option_name, const gchar *value, +- gpointer data, GError **error ) ++vips_lib_version_cb(const gchar *option_name, const gchar *value, ++ gpointer data, GError **error) + { +- printf( "libvips %s\n", VIPS_VERSION_STRING ); ++ printf("libvips %s\n", VIPS_VERSION_STRING); + vips_shutdown(); +- exit( 0 ); ++ exit(0); + } + + static gboolean +-vips_lib_config_cb( const gchar *option_name, const gchar *value, +- gpointer data, GError **error ) ++vips_lib_config_cb(const gchar *option_name, const gchar *value, ++ gpointer data, GError **error) + { +- printf( "%s\n", VIPS_CONFIG ); ++ printf("%s\n", VIPS_CONFIG); + vips_shutdown(); +- exit( 0 ); ++ exit(0); + } + + static gboolean +-vips_cache_max_cb( const gchar *option_name, const gchar *value, +- gpointer data, GError **error ) ++vips_cache_max_cb(const gchar *option_name, const gchar *value, ++ gpointer data, GError **error) + { +- vips_cache_set_max( vips__parse_size( value ) ); ++ vips_cache_set_max(vips__parse_size(value)); + +- return( TRUE ); ++ return (TRUE); + } + + static gboolean +-vips_cache_max_memory_cb( const gchar *option_name, const gchar *value, +- gpointer data, GError **error ) ++vips_cache_max_memory_cb(const gchar *option_name, const gchar *value, ++ gpointer data, GError **error) + { +- vips_cache_set_max_mem( vips__parse_size( value ) ); ++ vips_cache_set_max_mem(vips__parse_size(value)); + +- return( TRUE ); ++ return (TRUE); + } + + static gboolean +-vips_cache_max_files_cb( const gchar *option_name, const gchar *value, +- gpointer data, GError **error ) ++vips_cache_max_files_cb(const gchar *option_name, const gchar *value, ++ gpointer data, GError **error) + { +- vips_cache_set_max_files( vips__parse_size( value ) ); ++ vips_cache_set_max_files(vips__parse_size(value)); + +- return( TRUE ); ++ return (TRUE); + } + + static GOptionEntry option_entries[] = { +- { "vips-info", 0, G_OPTION_FLAG_HIDDEN | G_OPTION_FLAG_NO_ARG, ++ { "vips-info", 0, G_OPTION_FLAG_HIDDEN | G_OPTION_FLAG_NO_ARG, + G_OPTION_ARG_CALLBACK, (gpointer) &vips_lib_info_cb, +- N_( "show informative messages" ), NULL }, +- { "vips-fatal", 0, G_OPTION_FLAG_HIDDEN | G_OPTION_FLAG_NO_ARG, +- G_OPTION_ARG_CALLBACK, (gpointer) &vips_set_fatal_cb, +- N_( "abort on first error or warning" ), NULL }, +- { "vips-concurrency", 0, 0, +- G_OPTION_ARG_INT, &vips__concurrency, +- N_( "evaluate with N concurrent threads" ), "N" }, +- { "vips-tile-width", 0, G_OPTION_FLAG_HIDDEN, +- G_OPTION_ARG_INT, &vips__tile_width, +- N_( "set tile width to N (DEBUG)" ), "N" }, +- { "vips-tile-height", 0, G_OPTION_FLAG_HIDDEN, +- G_OPTION_ARG_INT, &vips__tile_height, +- N_( "set tile height to N (DEBUG)" ), "N" }, +- { "vips-thinstrip-height", 0, G_OPTION_FLAG_HIDDEN, +- G_OPTION_ARG_INT, &vips__thinstrip_height, +- N_( "set thinstrip height to N (DEBUG)" ), "N" }, +- { "vips-fatstrip-height", 0, G_OPTION_FLAG_HIDDEN, +- G_OPTION_ARG_INT, &vips__fatstrip_height, +- N_( "set fatstrip height to N (DEBUG)" ), "N" }, +- { "vips-progress", 0, 0, +- G_OPTION_ARG_NONE, &vips__progress, +- N_( "show progress feedback" ), NULL }, +- { "vips-leak", 0, 0, +- G_OPTION_ARG_NONE, &vips__leak, +- N_( "leak-check on exit" ), NULL }, +- { "vips-profile", 0, 0, +- G_OPTION_ARG_NONE, &vips__thread_profile, +- N_( "profile and dump timing on exit" ), NULL }, +- { "vips-disc-threshold", 0, 0, +- G_OPTION_ARG_STRING, &vips__disc_threshold, +- N_( "images larger than N are decompressed to disc" ), "N" }, +- { "vips-novector", 0, G_OPTION_FLAG_REVERSE, +- G_OPTION_ARG_NONE, &vips__vector_enabled, +- N_( "disable vectorised versions of operations" ), NULL }, +- { "vips-cache-max", 0, 0, ++ N_("show informative messages"), NULL }, ++ { "vips-fatal", 0, G_OPTION_FLAG_HIDDEN | G_OPTION_FLAG_NO_ARG, ++ G_OPTION_ARG_CALLBACK, (gpointer) &vips_set_fatal_cb, ++ N_("abort on first error or warning"), NULL }, ++ { "vips-concurrency", 0, 0, ++ G_OPTION_ARG_INT, &vips__concurrency, ++ N_("evaluate with N concurrent threads"), "N" }, ++ { "vips-tile-width", 0, G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_INT, &vips__tile_width, ++ N_("set tile width to N (DEBUG)"), "N" }, ++ { "vips-tile-height", 0, G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_INT, &vips__tile_height, ++ N_("set tile height to N (DEBUG)"), "N" }, ++ { "vips-thinstrip-height", 0, G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_INT, &vips__thinstrip_height, ++ N_("set thinstrip height to N (DEBUG)"), "N" }, ++ { "vips-fatstrip-height", 0, G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_INT, &vips__fatstrip_height, ++ N_("set fatstrip height to N (DEBUG)"), "N" }, ++ { "vips-progress", 0, 0, ++ G_OPTION_ARG_NONE, &vips__progress, ++ N_("show progress feedback"), NULL }, ++ { "vips-leak", 0, 0, ++ G_OPTION_ARG_NONE, &vips__leak, ++ N_("leak-check on exit"), NULL }, ++ { "vips-profile", 0, 0, ++ G_OPTION_ARG_NONE, &vips__thread_profile, ++ N_("profile and dump timing on exit"), NULL }, ++ { "vips-disc-threshold", 0, 0, ++ G_OPTION_ARG_STRING, &vips__disc_threshold, ++ N_("images larger than N are decompressed to disc"), "N" }, ++ { "vips-novector", 0, G_OPTION_FLAG_REVERSE, ++ G_OPTION_ARG_NONE, &vips__vector_enabled, ++ N_("disable vectorised versions of operations"), NULL }, ++ { "vips-cache-max", 0, 0, + G_OPTION_ARG_CALLBACK, (gpointer) &vips_cache_max_cb, +- N_( "cache at most N operations" ), "N" }, +- { "vips-cache-max-memory", 0, 0, ++ N_("cache at most N operations"), "N" }, ++ { "vips-cache-max-memory", 0, 0, + G_OPTION_ARG_CALLBACK, (gpointer) &vips_cache_max_memory_cb, +- N_( "cache at most N bytes in memory" ), "N" }, +- { "vips-cache-max-files", 0, 0, ++ N_("cache at most N bytes in memory"), "N" }, ++ { "vips-cache-max-files", 0, 0, + G_OPTION_ARG_CALLBACK, (gpointer) &vips_cache_max_files_cb, +- N_( "allow at most N open files" ), "N" }, +- { "vips-cache-trace", 0, 0, +- G_OPTION_ARG_NONE, &vips__cache_trace, +- N_( "trace operation cache" ), NULL }, +- { "vips-cache-dump", 0, 0, +- G_OPTION_ARG_NONE, &vips__cache_dump, +- N_( "dump operation cache on exit" ), NULL }, +- { "vips-version", 0, G_OPTION_FLAG_NO_ARG, +- G_OPTION_ARG_CALLBACK, (gpointer) &vips_lib_version_cb, +- N_( "print libvips version" ), NULL }, +- { "vips-config", 0, G_OPTION_FLAG_NO_ARG, +- G_OPTION_ARG_CALLBACK, (gpointer) &vips_lib_config_cb, +- N_( "print libvips config" ), NULL }, +- { "vips-pipe-read-limit", 0, 0, +- G_OPTION_ARG_INT64, (gpointer) &vips_pipe_read_limit, +- N_( "read at most this many bytes from a pipe" ), NULL }, ++ N_("allow at most N open files"), "N" }, ++ { "vips-cache-trace", 0, 0, ++ G_OPTION_ARG_NONE, &vips__cache_trace, ++ N_("trace operation cache"), NULL }, ++ { "vips-cache-dump", 0, 0, ++ G_OPTION_ARG_NONE, &vips__cache_dump, ++ N_("dump operation cache on exit"), NULL }, ++ { "vips-version", 0, G_OPTION_FLAG_NO_ARG, ++ G_OPTION_ARG_CALLBACK, (gpointer) &vips_lib_version_cb, ++ N_("print libvips version"), NULL }, ++ { "vips-config", 0, G_OPTION_FLAG_NO_ARG, ++ G_OPTION_ARG_CALLBACK, (gpointer) &vips_lib_config_cb, ++ N_("print libvips config"), NULL }, ++ { "vips-pipe-read-limit", 0, 0, ++ G_OPTION_ARG_INT64, (gpointer) &vips_pipe_read_limit, ++ N_("read at most this many bytes from a pipe"), NULL }, + { NULL } + }; + + /** +- * vips_add_option_entries: ++ * vips_add_option_entries: + * @option_group: group to add to + * +- * Add the standard vips %GOptionEntry to a %GOptionGroup. ++ * Add the standard vips %GOptionEntry to a %GOptionGroup. + * +- * See also: g_option_group_new(). ++ * See also: g_option_group_new(). + */ + void +-vips_add_option_entries( GOptionGroup *option_group ) ++vips_add_option_entries(GOptionGroup *option_group) + { +- g_option_group_add_entries( option_group, option_entries ); ++ g_option_group_add_entries(option_group, option_entries); + } + + /* Find the prefix part of a dir ... name is the name of this prog from argv0. +@@ -950,285 +950,285 @@ vips_add_option_entries( GOptionGroup *option_group ) + * all other forms ... return NULL. + */ + static char * +-extract_prefix( const char *dir, const char *name ) ++extract_prefix(const char *dir, const char *name) + { + char edir[VIPS_PATH_MAX]; + static char vname[VIPS_PATH_MAX]; + int i; + +- g_info( "trying for dir = \"%s\", name = \"%s\"", dir, name ); ++ g_info("trying for dir = \"%s\", name = \"%s\"", dir, name); + + /* Is dir relative? Prefix with cwd. + */ +- if( !g_path_is_absolute( dir ) ) { +- char *cwd; ++ if (!g_path_is_absolute(dir)) { ++ char *cwd; + + cwd = g_get_current_dir(); +- vips_snprintf( edir, VIPS_PATH_MAX, +- "%s" G_DIR_SEPARATOR_S "%s", cwd, dir ); +- g_free( cwd ); ++ vips_snprintf(edir, VIPS_PATH_MAX, ++ "%s" G_DIR_SEPARATOR_S "%s", cwd, dir); ++ g_free(cwd); + } + else { +- vips_strncpy( edir, dir, VIPS_PATH_MAX ); ++ vips_strncpy(edir, dir, VIPS_PATH_MAX); + } + + /* Chop off the trailing prog name, plus the trailing + * G_DIR_SEPARATOR_S. + */ +- if( !vips_ispostfix( edir, name ) ) +- return( NULL ); +- vips_strncpy( vname, edir, VIPS_PATH_MAX ); +- vname[strlen( edir ) - strlen( name ) - 1] = '\0'; ++ if (!vips_ispostfix(edir, name)) ++ return (NULL); ++ vips_strncpy(vname, edir, VIPS_PATH_MAX); ++ vname[strlen(edir) - strlen(name) - 1] = '\0'; + + /* Remove any "/./", any trailing "/.", any trailing "/". + */ +- for( i = 0; i < (int) strlen( vname ); i++ ) +- if( vips_isprefix( G_DIR_SEPARATOR_S "." G_DIR_SEPARATOR_S, +- vname + i ) ) +- memmove( vname + i, vname + i + 2, +- strlen( vname + i + 2 ) + 1 ); +- if( vips_ispostfix( vname, G_DIR_SEPARATOR_S "." ) ) +- vname[strlen( vname ) - 2] = '\0'; +- if( vips_ispostfix( vname, G_DIR_SEPARATOR_S ) ) +- vname[strlen( vname ) - 1] = '\0'; +- +- g_info( "canonicalised path = \"%s\"", vname ); ++ for (i = 0; i < (int) strlen(vname); i++) ++ if (vips_isprefix(G_DIR_SEPARATOR_S "." G_DIR_SEPARATOR_S, ++ vname + i)) ++ memmove(vname + i, vname + i + 2, ++ strlen(vname + i + 2) + 1); ++ if (vips_ispostfix(vname, G_DIR_SEPARATOR_S ".")) ++ vname[strlen(vname) - 2] = '\0'; ++ if (vips_ispostfix(vname, G_DIR_SEPARATOR_S)) ++ vname[strlen(vname) - 1] = '\0'; ++ ++ g_info("canonicalised path = \"%s\"", vname); + + /* Ought to be a "/bin" at the end now. + */ +- if( !vips_ispostfix( vname, G_DIR_SEPARATOR_S "bin" ) ) +- return( NULL ); +- vname[strlen( vname ) - strlen( G_DIR_SEPARATOR_S "bin" )] = '\0'; ++ if (!vips_ispostfix(vname, G_DIR_SEPARATOR_S "bin")) ++ return (NULL); ++ vname[strlen(vname) - strlen(G_DIR_SEPARATOR_S "bin")] = '\0'; + +- g_info( "found \"%s\"", vname ); ++ g_info("found \"%s\"", vname); + +- return( vname ); ++ return (vname); + } + + /* Search a path for a file ... we overwrite the PATH string passed in. + */ + static char * +-scan_path( char *path, const char *name ) ++scan_path(char *path, const char *name) + { + char *p, *q; + char *prefix; + +- for( p = path; +- (q = vips_break_token( p, G_SEARCHPATH_SEPARATOR_S )); p = q ) { ++ for (p = path; ++ (q = vips_break_token(p, G_SEARCHPATH_SEPARATOR_S)); p = q) { + char str[VIPS_PATH_MAX]; + + /* Form complete path. + */ +- vips_snprintf( str, VIPS_PATH_MAX, +- "%s" G_DIR_SEPARATOR_S "%s", p, name ); ++ vips_snprintf(str, VIPS_PATH_MAX, ++ "%s" G_DIR_SEPARATOR_S "%s", p, name); + +- g_info( "looking in \"%s\" for \"%s\"", +- p, name ); ++ g_info("looking in \"%s\" for \"%s\"", ++ p, name); + +- if( vips_existsf( "%s", str ) && +- (prefix = extract_prefix( str, name )) ) { +- return( prefix ); ++ if (vips_existsf("%s", str) && ++ (prefix = extract_prefix(str, name))) { ++ return (prefix); + } + } + +- return( NULL ); ++ return (NULL); + } + + /* Look for a file along PATH. If we find it, look for an enclosing prefix. + */ + static char * +-find_file( const char *name ) ++find_file(const char *name) + { +- const char *path = g_getenv( "PATH" ); ++ const char *path = g_getenv("PATH"); + char *prefix; + char full_path[VIPS_PATH_MAX]; + +- if( !path ) +- return( NULL ); ++ if (!path) ++ return (NULL); + +- g_info( "g_getenv( \"PATH\" ) == \"%s\"", path ); ++ g_info("g_getenv( \"PATH\" ) == \"%s\"", path); + + #ifdef G_OS_WIN32 +-{ +- char *dir; ++ { ++ char *dir; + +- /* Windows always searches '.' first, so prepend cwd to path. +- */ +- dir = g_get_current_dir(); +- vips_snprintf( full_path, VIPS_PATH_MAX, +- "%s" G_SEARCHPATH_SEPARATOR_S "%s", dir, path ); +- g_free( dir ); +-} +-#else /*!G_OS_WIN32*/ +- vips_strncpy( full_path, path, VIPS_PATH_MAX ); ++ /* Windows always searches '.' first, so prepend cwd to path. ++ */ ++ dir = g_get_current_dir(); ++ vips_snprintf(full_path, VIPS_PATH_MAX, ++ "%s" G_SEARCHPATH_SEPARATOR_S "%s", dir, path); ++ g_free(dir); ++ } ++#else /*!G_OS_WIN32*/ ++ vips_strncpy(full_path, path, VIPS_PATH_MAX); + #endif /*G_OS_WIN32*/ + +- if( (prefix = scan_path( full_path, name )) ) +- return( prefix ); ++ if ((prefix = scan_path(full_path, name))) ++ return (prefix); + +- return( NULL ); ++ return (NULL); + } + + /* Guess a value for the install PREFIX. + */ + static const char * +-guess_prefix( const char *argv0, const char *name ) ++guess_prefix(const char *argv0, const char *name) + { + char *prefix; + + /* We've already checked for VIPSHOME. If the configure-time + * library prefix looks OK, use the configure-time prefix. + */ +- if( vips_existsf( "%s/vips-modules-%d.%d", +- VIPS_LIBDIR, VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION ) ) { +- g_info( "found %s/vips-modules-%d.%d", +- VIPS_LIBDIR, VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION ); +- g_info( "using configure-time prefix" ); +- return( VIPS_PREFIX ); ++ if (vips_existsf("%s/vips-modules-%d.%d", ++ VIPS_LIBDIR, VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION)) { ++ g_info("found %s/vips-modules-%d.%d", ++ VIPS_LIBDIR, VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION); ++ g_info("using configure-time prefix"); ++ return (VIPS_PREFIX); + } + + /* Try to guess from argv0. + */ +- if( argv0 ) { +- if( g_path_is_absolute( argv0 ) ) { ++ if (argv0) { ++ if (g_path_is_absolute(argv0)) { + /* Must point to our executable. + */ +- if( (prefix = extract_prefix( argv0, name )) ) { +- g_info( "found \"%s\" from argv0", prefix ); +- return( prefix ); +- } ++ if ((prefix = extract_prefix(argv0, name))) { ++ g_info("found \"%s\" from argv0", prefix); ++ return (prefix); ++ } + } + + /* Look along path for name. + */ +- if( (prefix = find_file( name )) ) { +- g_info( "found \"%s\" from PATH", prefix ); +- return( prefix ); ++ if ((prefix = find_file(name))) { ++ g_info("found \"%s\" from PATH", prefix); ++ return (prefix); + } +- } ++ } + +- /* Try to guess from cwd. Only if this is a relative path, though. ++ /* Try to guess from cwd. Only if this is a relative path, though. + */ +- if( argv0 && +- !g_path_is_absolute( argv0 ) ) { ++ if (argv0 && ++ !g_path_is_absolute(argv0)) { + char *dir; + char full_path[VIPS_PATH_MAX]; + char *resolved; + +- dir = g_get_current_dir(); +- vips_snprintf( full_path, VIPS_PATH_MAX, +- "%s" G_DIR_SEPARATOR_S "%s", dir, argv0 ); +- g_free( dir ); ++ dir = g_get_current_dir(); ++ vips_snprintf(full_path, VIPS_PATH_MAX, ++ "%s" G_DIR_SEPARATOR_S "%s", dir, argv0); ++ g_free(dir); + +- if( (resolved = vips_realpath( full_path )) ) { +- prefix = extract_prefix( resolved, name ); +- g_free( resolved ); ++ if ((resolved = vips_realpath(full_path))) { ++ prefix = extract_prefix(resolved, name); ++ g_free(resolved); + +- if( prefix ) { +- g_info( "found \"%s\" from cwd", prefix ); +- return( prefix ); ++ if (prefix) { ++ g_info("found \"%s\" from cwd", prefix); ++ return (prefix); + } + } + } + + /* Fall back to the configure-time prefix. + */ +- return( VIPS_PREFIX ); ++ return (VIPS_PREFIX); + } + +-/** ++/** + * vips_guess_prefix: + * @argv0: program name (typically argv[0]) + * @env_name: save prefix in this environment variable + * +- * vips_guess_prefix() tries to guess the install directory. You should pass +- * in the value of argv[0] (the name your program was run as) as a clue to +- * help it out, plus the name of the environment variable you let the user +- * override your package install area with (eg. "VIPSHOME"). ++ * vips_guess_prefix() tries to guess the install directory. You should pass ++ * in the value of argv[0] (the name your program was run as) as a clue to ++ * help it out, plus the name of the environment variable you let the user ++ * override your package install area with (eg. "VIPSHOME"). + * +- * On success, vips_guess_prefix() returns the prefix it discovered, and as a ++ * On success, vips_guess_prefix() returns the prefix it discovered, and as a + * side effect, sets the environment variable (if it's not set). + * + * Don't free the return string! +- * ++ * + * See also: vips_guess_libdir(). + * + * Returns: (transfer none): the install prefix as a static string, do not free. + */ + const char * +-vips_guess_prefix( const char *argv0, const char *env_name ) ++vips_guess_prefix(const char *argv0, const char *env_name) + { +- const char *prefix; ++ const char *prefix; + + /* Already set? + */ +- if( (prefix = g_getenv( env_name )) ) +- return( prefix ); ++ if ((prefix = g_getenv(env_name))) ++ return (prefix); + + #ifdef G_OS_WIN32 + prefix = vips__windows_prefix(); +-#else /*!G_OS_WIN32*/ +-{ +- char *basename; ++#else /*!G_OS_WIN32*/ ++ { ++ char *basename; + +- basename = g_path_get_basename( argv0 ); +- prefix = guess_prefix( argv0, basename ); +- g_free( basename ); +-} ++ basename = g_path_get_basename(argv0); ++ prefix = guess_prefix(argv0, basename); ++ g_free(basename); ++ } + #endif /*G_OS_WIN32*/ + +- g_setenv( env_name, prefix, TRUE ); ++ g_setenv(env_name, prefix, TRUE); + +- return( prefix ); ++ return (prefix); + } + +-/** ++/** + * vips_guess_libdir: + * @argv0: program name (typically argv[0]) + * @env_name: save prefix in this environment variable + * +- * vips_guess_libdir() tries to guess the install directory (usually the +- * configure libdir, or $prefix/lib). You should pass +- * in the value of argv[0] (the name your program was run as) as a clue to +- * help it out, plus the name of the environment variable you let the user +- * override your package install area with (eg. "VIPSHOME"). ++ * vips_guess_libdir() tries to guess the install directory (usually the ++ * configure libdir, or $prefix/lib). You should pass ++ * in the value of argv[0] (the name your program was run as) as a clue to ++ * help it out, plus the name of the environment variable you let the user ++ * override your package install area with (eg. "VIPSHOME"). + * +- * On success, vips_guess_libdir() returns the libdir it discovered, and as a ++ * On success, vips_guess_libdir() returns the libdir it discovered, and as a + * side effect, sets the prefix environment variable (if it's not set). + * + * Don't free the return string! +- * ++ * + * See also: vips_guess_prefix(). + * + * Returns: (transfer none): the libdir as a static string, do not free. + */ + const char * +-vips_guess_libdir( const char *argv0, const char *env_name ) ++vips_guess_libdir(const char *argv0, const char *env_name) + { +- const char *prefix = vips_guess_prefix( argv0, env_name ); ++ const char *prefix = vips_guess_prefix(argv0, env_name); + static char *libdir = NULL; + + char *suffix; + +- if( libdir ) +- return( libdir ); ++ if (libdir) ++ return (libdir); + + /* Have we been moved since configure? If not, use the configure-time +- * libdir. ++ * libdir. + * + * The lib directory name can be eg. "lib", "lib64" etc. depending on + * the platform, so copy that from the configure-time libdir if we can. + * The configure-time LIBDIR is generated by autotools and always uses + * '/', even on Windows. + */ +- if( strcmp( prefix, VIPS_PREFIX ) == 0 ) ++ if (strcmp(prefix, VIPS_PREFIX) == 0) + libdir = VIPS_LIBDIR; +- else if( (suffix = strrchr( VIPS_LIBDIR, '/' )) ) +- libdir = g_strdup_printf( "%s%s", prefix, suffix ); ++ else if ((suffix = strrchr(VIPS_LIBDIR, '/'))) ++ libdir = g_strdup_printf("%s%s", prefix, suffix); + else +- libdir = g_strdup_printf( "%s/lib", prefix ); ++ libdir = g_strdup_printf("%s/lib", prefix); + +- return( libdir ); ++ return (libdir); + } + + /** +@@ -1240,9 +1240,9 @@ vips_guess_libdir( const char *argv0, const char *env_name ) + * Returns: (transfer none): a static version string + */ + const char * +-vips_version_string( void ) ++vips_version_string(void) + { +- return( VIPS_VERSION_STRING ); ++ return (VIPS_VERSION_STRING); + } + + /** +@@ -1252,36 +1252,36 @@ vips_version_string( void ) + * Get the major, minor or micro library version, with @flag values 0, 1 and + * 2. + * +- * Get the ABI current, revision and age (as used by Meson) with @flag +- * values 3, 4, 5. ++ * Get the ABI current, revision and age (as used by Meson) with @flag ++ * values 3, 4, 5. + * + * Returns: library version number + */ + int +-vips_version( int flag ) ++vips_version(int flag) + { +- switch( flag ) { ++ switch (flag) { + case 0: +- return( VIPS_MAJOR_VERSION ); ++ return (VIPS_MAJOR_VERSION); + + case 1: +- return( VIPS_MINOR_VERSION ); ++ return (VIPS_MINOR_VERSION); + + case 2: +- return( VIPS_MICRO_VERSION ); ++ return (VIPS_MICRO_VERSION); + + case 3: +- return( VIPS_LIBRARY_CURRENT ); ++ return (VIPS_LIBRARY_CURRENT); + + case 4: +- return( VIPS_LIBRARY_REVISION ); ++ return (VIPS_LIBRARY_REVISION); + + case 5: +- return( VIPS_LIBRARY_AGE ); ++ return (VIPS_LIBRARY_AGE); + + default: +- vips_error( "vips_version", "%s", _( "flag not in [0, 5]" ) ); +- return( -1 ); ++ vips_error("vips_version", "%s", _("flag not in [0, 5]")); ++ return (-1); + } + } + +@@ -1292,31 +1292,31 @@ vips_version( int flag ) + * Turn on or off vips leak checking. See also --vips-leak, + * vips_add_option_entries() and the `VIPS_LEAK` environment variable. + * +- * You should call this very early in your program. ++ * You should call this very early in your program. + */ +-void +-vips_leak_set( gboolean leak ) ++void ++vips_leak_set(gboolean leak) + { +- vips__leak = leak; ++ vips__leak = leak; + } + + static void * +-vips_block_untrusted_set_operation( VipsOperationClass *class, gboolean *state ) ++vips_block_untrusted_set_operation(VipsOperationClass *class, gboolean *state) + { +- g_assert( VIPS_IS_OPERATION_CLASS( class ) ); ++ g_assert(VIPS_IS_OPERATION_CLASS(class)); + +- if( class->flags & VIPS_OPERATION_UNTRUSTED ) +- vips_operation_block_set( G_OBJECT_CLASS_NAME( class ), +- *state ); ++ if (class->flags & VIPS_OPERATION_UNTRUSTED) ++ vips_operation_block_set(G_OBJECT_CLASS_NAME(class), ++ *state); + +- return( NULL ); ++ return (NULL); + } + +-/** ++/** + * vips_block_untrusted_set: + * @state: the block state to set + * +- * Set the block state on all untrusted operations. ++ * Set the block state on all untrusted operations. + * + * |[ + * vips_block_untrusted_set( TRUE ); +@@ -1324,15 +1324,15 @@ vips_block_untrusted_set_operation( VipsOperationClass *class, gboolean *state ) + * + * Will block all untrusted operations from running. + * +- * Use `vips -l` at the command-line to see the class hierarchy and which ++ * Use `vips -l` at the command-line to see the class hierarchy and which + * operations are marked as untrusted. + * + * Set the environment variable `VIPS_BLOCK_UNTRUSTED` to block all untrusted + * operations on vips_init(). + */ + void +-vips_block_untrusted_set( gboolean state ) ++vips_block_untrusted_set(gboolean state) + { +- vips_class_map_all( g_type_from_name( "VipsOperation" ), +- (VipsClassMapFn) vips_block_untrusted_set_operation, &state ); ++ vips_class_map_all(g_type_from_name("VipsOperation"), ++ (VipsClassMapFn) vips_block_untrusted_set_operation, &state); + } +diff --git a/libvips/iofuncs/mapfile.c b/libvips/iofuncs/mapfile.c +index eedc138a40..454949ee30 100644 +--- a/libvips/iofuncs/mapfile.c ++++ b/libvips/iofuncs/mapfile.c +@@ -1,5 +1,5 @@ + /* map and unmap files in various ways +- * ++ * + * Copyright: Nicos Dessipris + * Wriiten on: 13/02/1990 + * Updated on: +@@ -26,32 +26,32 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +-/* ++/* + #define DEBUG + */ + +@@ -92,314 +92,315 @@ + /* Does this fd support mmap. Pipes won't, for example. + */ + gboolean +-vips__mmap_supported( int fd ) ++vips__mmap_supported(int fd) + { + void *baseaddr; + size_t length = 4096; + off_t offset = 0; + + #ifdef G_OS_WIN32 +-{ +- HANDLE hFile = (HANDLE) _get_osfhandle( fd ); +- +- DWORD flProtect; +- HANDLE hMMFile; +- +- DWORD dwDesiredAccess; +- ULARGE_INTEGER quad; +- DWORD dwFileOffsetHigh; +- DWORD dwFileOffsetLow; +- +- flProtect = PAGE_READONLY; +- if( !(hMMFile = CreateFileMapping( hFile, +- NULL, flProtect, 0, 0, NULL )) ) +- return( FALSE ); +- +- dwDesiredAccess = FILE_MAP_READ; +- quad.QuadPart = offset; +- dwFileOffsetLow = quad.LowPart; +- dwFileOffsetHigh = quad.HighPart; +- if( !(baseaddr = (char *)MapViewOfFile( hMMFile, dwDesiredAccess, +- dwFileOffsetHigh, dwFileOffsetLow, length )) ) { +- CloseHandle( hMMFile ); +- return( FALSE ); +- } +- CloseHandle( hMMFile ); +- UnmapViewOfFile( baseaddr ); +-} +-#else /*!G_OS_WIN32*/ +-{ +- int prot = PROT_READ; +- int flags = MAP_SHARED; ++ { ++ HANDLE hFile = (HANDLE) _get_osfhandle(fd); + +- baseaddr = mmap( 0, length, prot, flags, fd, (off_t) offset ); +- if( baseaddr == MAP_FAILED ) +- return( FALSE ); +- munmap( baseaddr, length ); +-} ++ DWORD flProtect; ++ HANDLE hMMFile; ++ ++ DWORD dwDesiredAccess; ++ ULARGE_INTEGER quad; ++ DWORD dwFileOffsetHigh; ++ DWORD dwFileOffsetLow; ++ ++ flProtect = PAGE_READONLY; ++ if (!(hMMFile = CreateFileMapping(hFile, ++ NULL, flProtect, 0, 0, NULL))) ++ return (FALSE); ++ ++ dwDesiredAccess = FILE_MAP_READ; ++ quad.QuadPart = offset; ++ dwFileOffsetLow = quad.LowPart; ++ dwFileOffsetHigh = quad.HighPart; ++ if (!(baseaddr = (char *) MapViewOfFile(hMMFile, dwDesiredAccess, ++ dwFileOffsetHigh, dwFileOffsetLow, length))) { ++ CloseHandle(hMMFile); ++ return (FALSE); ++ } ++ CloseHandle(hMMFile); ++ UnmapViewOfFile(baseaddr); ++ } ++#else /*!G_OS_WIN32*/ ++ { ++ int prot = PROT_READ; ++ int flags = MAP_SHARED; ++ ++ baseaddr = mmap(0, length, prot, flags, fd, (off_t) offset); ++ if (baseaddr == MAP_FAILED) ++ return (FALSE); ++ munmap(baseaddr, length); ++ } + #endif /*G_OS_WIN32*/ + +- return( TRUE ); ++ return (TRUE); + } + + void * +-vips__mmap( int fd, int writeable, size_t length, gint64 offset ) ++vips__mmap(int fd, int writeable, size_t length, gint64 offset) + { + void *baseaddr; + + #ifdef DEBUG +- printf( "vips__mmap: length = 0x%zx, offset = 0x%lx\n", +- length, offset ); ++ printf("vips__mmap: length = 0x%zx, offset = 0x%lx\n", ++ length, offset); + #endif /*DEBUG*/ + + #ifdef G_OS_WIN32 +-{ +- HANDLE hFile = (HANDLE) _get_osfhandle( fd ); +- +- DWORD flProtect; +- DWORD dwDesiredAccess; +- +- HANDLE hMMFile; +- +- ULARGE_INTEGER quad; +- DWORD dwFileOffsetHigh; +- DWORD dwFileOffsetLow; +- +- if( writeable ) { +- flProtect = PAGE_READWRITE; +- dwDesiredAccess = FILE_MAP_WRITE; ++ { ++ HANDLE hFile = (HANDLE) _get_osfhandle(fd); ++ ++ DWORD flProtect; ++ DWORD dwDesiredAccess; ++ ++ HANDLE hMMFile; ++ ++ ULARGE_INTEGER quad; ++ DWORD dwFileOffsetHigh; ++ DWORD dwFileOffsetLow; ++ ++ if (writeable) { ++ flProtect = PAGE_READWRITE; ++ dwDesiredAccess = FILE_MAP_WRITE; ++ } ++ else { ++ flProtect = PAGE_READONLY; ++ dwDesiredAccess = FILE_MAP_READ; ++ } ++ ++ quad.QuadPart = offset; ++ dwFileOffsetLow = quad.LowPart; ++ dwFileOffsetHigh = quad.HighPart; ++ ++ if (!(hMMFile = CreateFileMapping(hFile, ++ NULL, flProtect, 0, 0, NULL))) { ++ vips_error_system(GetLastError(), "vips_mapfile", ++ "%s", _("unable to CreateFileMapping")); ++ printf("CreateFileMapping failed: %s\n", vips_error_buffer()); ++ return (NULL); ++ } ++ ++ if (!(baseaddr = (char *) MapViewOfFile(hMMFile, dwDesiredAccess, ++ dwFileOffsetHigh, dwFileOffsetLow, length))) { ++ vips_error_system(GetLastError(), "vips_mapfile", ++ "%s", _("unable to MapViewOfFile")); ++ printf("MapViewOfFile failed: %s\n", vips_error_buffer()); ++ CloseHandle(hMMFile); ++ return (NULL); ++ } ++ ++ /* Can close mapping now ... view stays until UnmapViewOfFile(). ++ ++ FIXME ... is this a performance problem? ++ ++ */ ++ CloseHandle(hMMFile); + } +- else { +- flProtect = PAGE_READONLY; +- dwDesiredAccess = FILE_MAP_READ; +- } +- +- quad.QuadPart = offset; +- dwFileOffsetLow = quad.LowPart; +- dwFileOffsetHigh = quad.HighPart; +- +- if( !(hMMFile = CreateFileMapping( hFile, +- NULL, flProtect, 0, 0, NULL )) ) { +- vips_error_system( GetLastError(), "vips_mapfile", +- "%s", _( "unable to CreateFileMapping" ) ); +- printf( "CreateFileMapping failed: %s\n", vips_error_buffer() ); +- return( NULL ); +- } +- +- if( !(baseaddr = (char *)MapViewOfFile( hMMFile, dwDesiredAccess, +- dwFileOffsetHigh, dwFileOffsetLow, length )) ) { +- vips_error_system( GetLastError(), "vips_mapfile", +- "%s", _( "unable to MapViewOfFile" ) ); +- printf( "MapViewOfFile failed: %s\n", vips_error_buffer() ); +- CloseHandle( hMMFile ); +- return( NULL ); +- } +- +- /* Can close mapping now ... view stays until UnmapViewOfFile(). +- +- FIXME ... is this a performance problem? +- +- */ +- CloseHandle( hMMFile ); +-} + #else /*!G_OS_WIN32*/ +-{ +- int prot; +- int flags; ++ { ++ int prot; ++ int flags; + +- if( writeable ) +- prot = PROT_WRITE; +- else +- prot = PROT_READ; ++ if (writeable) ++ prot = PROT_WRITE; ++ else ++ prot = PROT_READ; + +- flags = MAP_SHARED; ++ flags = MAP_SHARED; + +- /* OS X caches mmapped files very aggressively if this flags is not +- * set. Scanning a large file without this flag will cause every other +- * process to get swapped out and kill performance. +- */ ++ /* OS X caches mmapped files very aggressively if this flags is not ++ * set. Scanning a large file without this flag will cause every other ++ * process to get swapped out and kill performance. ++ */ + #ifdef MAP_NOCACHE +- flags |= MAP_NOCACHE; ++ flags |= MAP_NOCACHE; + #endif /*MAP_NOCACHE*/ + +- /* Casting gint64 to off_t should be safe, even on *nixes without +- * LARGEFILE. +- */ +- +- baseaddr = mmap( 0, length, prot, flags, fd, (off_t) offset ); +- if( baseaddr == MAP_FAILED ) { +- vips_error_system( errno, "vips_mapfile", +- "%s", _( "unable to mmap" ) ); +- g_warning( _( "map failed (%s), " +- "running very low on system resources, " +- "expect a crash soon" ), strerror( errno ) ); +- return( NULL ); ++ /* Casting gint64 to off_t should be safe, even on *nixes without ++ * LARGEFILE. ++ */ ++ ++ baseaddr = mmap(0, length, prot, flags, fd, (off_t) offset); ++ if (baseaddr == MAP_FAILED) { ++ vips_error_system(errno, "vips_mapfile", ++ "%s", _("unable to mmap")); ++ g_warning(_("map failed (%s), " ++ "running very low on system resources, " ++ "expect a crash soon"), ++ strerror(errno)); ++ return (NULL); ++ } + } +-} + #endif /*G_OS_WIN32*/ + +- return( baseaddr ); ++ return (baseaddr); + } + + int +-vips__munmap( const void *start, size_t length ) ++vips__munmap(const void *start, size_t length) + { + #ifdef G_OS_WIN32 +- if( !UnmapViewOfFile( (void *) start ) ) { +- vips_error_system( GetLastError(), "vips_mapfile", +- "%s", _( "unable to UnmapViewOfFile" ) ); +- return( -1 ); ++ if (!UnmapViewOfFile((void *) start)) { ++ vips_error_system(GetLastError(), "vips_mapfile", ++ "%s", _("unable to UnmapViewOfFile")); ++ return (-1); + } +-#else /*!G_OS_WIN32*/ +- if( munmap( (void *) start, length ) < 0 ) { +- vips_error_system( errno, "vips_mapfile", +- "%s", _( "unable to munmap file" ) ); +- return( -1 ); ++#else /*!G_OS_WIN32*/ ++ if (munmap((void *) start, length) < 0) { ++ vips_error_system(errno, "vips_mapfile", ++ "%s", _("unable to munmap file")); ++ return (-1); + } + #endif /*G_OS_WIN32*/ + +- return( 0 ); ++ return (0); + } + + int +-vips_mapfile( VipsImage *im ) ++vips_mapfile(VipsImage *im) + { + struct stat st; + mode_t m; + +- assert( !im->baseaddr ); ++ assert(!im->baseaddr); + + /* Check the size of the file; if it is less than 64 bytes, then flag + * an error, we won't be able to read the vips header without a segv. + */ +- g_assert( im->file_length > 0 ); +- if( im->file_length < 64 ) { +- vips_error( "vips_mapfile", +- "%s", _( "file is less than 64 bytes" ) ); +- return( -1 ); ++ g_assert(im->file_length > 0); ++ if (im->file_length < 64) { ++ vips_error("vips_mapfile", ++ "%s", _("file is less than 64 bytes")); ++ return (-1); + } +- if( fstat( im->fd, &st ) == -1 ) { +- vips_error( "vips_mapfile", +- "%s", _( "unable to get file status" ) ); +- return( -1 ); ++ if (fstat(im->fd, &st) == -1) { ++ vips_error("vips_mapfile", ++ "%s", _("unable to get file status")); ++ return (-1); + } + m = (mode_t) st.st_mode; +- if( !S_ISREG( m ) ) { +- vips_error( "vips_mapfile", +- "%s", _( "not a regular file" ) ); +- return( -1 ); ++ if (!S_ISREG(m)) { ++ vips_error("vips_mapfile", ++ "%s", _("not a regular file")); ++ return (-1); + } + +- if( !(im->baseaddr = vips__mmap( im->fd, 0, im->file_length, 0 )) ) +- return( -1 ); ++ if (!(im->baseaddr = vips__mmap(im->fd, 0, im->file_length, 0))) ++ return (-1); + + im->length = im->file_length; + +- return( 0 ); ++ return (0); + } + + /* As above, but map read/write. + */ + int +-vips_mapfilerw( VipsImage *im ) ++vips_mapfilerw(VipsImage *im) + { + struct stat st; + mode_t m; + +- assert( !im->baseaddr ); ++ assert(!im->baseaddr); + + /* Check the size of the file if it is less than 64 bytes return + * make also sure that it is a regular file + */ +- g_assert( im->file_length > 0 ); +- if( fstat( im->fd, &st ) == -1 ) { +- vips_error( "vips_mapfilerw", +- "%s", _( "unable to get file status" ) ); +- return( -1 ); ++ g_assert(im->file_length > 0); ++ if (fstat(im->fd, &st) == -1) { ++ vips_error("vips_mapfilerw", ++ "%s", _("unable to get file status")); ++ return (-1); + } + m = (mode_t) st.st_mode; +- if( im->file_length < 64 || !S_ISREG( m ) ) { +- vips_error( "vips_mapfile", +- "%s", _( "unable to read data" ) ); +- return( -1 ); ++ if (im->file_length < 64 || !S_ISREG(m)) { ++ vips_error("vips_mapfile", ++ "%s", _("unable to read data")); ++ return (-1); + } + +- if( !(im->baseaddr = vips__mmap( im->fd, 1, im->file_length, 0 )) ) +- return( -1 ); ++ if (!(im->baseaddr = vips__mmap(im->fd, 1, im->file_length, 0))) ++ return (-1); + + im->length = im->file_length; + +- return( 0 ); ++ return (0); + } + +-/* From im_rwcheck() ... image needs to be a completely mapped read-only file, +- * we try to remap it read-write. ++/* From im_rwcheck() ... image needs to be a completely mapped read-only file, ++ * we try to remap it read-write. + */ + int +-vips_remapfilerw( VipsImage *image ) ++vips_remapfilerw(VipsImage *image) + { + void *baseaddr; + + #ifdef DEBUG +- printf( "vips_remapfilerw:\n" ); ++ printf("vips_remapfilerw:\n"); + #endif /*DEBUG*/ + + #ifdef G_OS_WIN32 +-{ +- HANDLE hFile = (HANDLE) _get_osfhandle( image->fd ); +- HANDLE hMMFile; +- +- if( !(hMMFile = CreateFileMapping( hFile, +- NULL, PAGE_READWRITE, 0, 0, NULL )) ) { +- vips_error_system( GetLastError(), "vips_mapfile", +- "%s", _( "unable to CreateFileMapping" ) ); +- return( -1 ); +- } +- +- if( !UnmapViewOfFile( image->baseaddr ) ) { +- vips_error_system( GetLastError(), "vips_mapfile", +- "%s", _( "unable to UnmapViewOfFile" ) ); +- return( -1 ); ++ { ++ HANDLE hFile = (HANDLE) _get_osfhandle(image->fd); ++ HANDLE hMMFile; ++ ++ if (!(hMMFile = CreateFileMapping(hFile, ++ NULL, PAGE_READWRITE, 0, 0, NULL))) { ++ vips_error_system(GetLastError(), "vips_mapfile", ++ "%s", _("unable to CreateFileMapping")); ++ return (-1); ++ } ++ ++ if (!UnmapViewOfFile(image->baseaddr)) { ++ vips_error_system(GetLastError(), "vips_mapfile", ++ "%s", _("unable to UnmapViewOfFile")); ++ return (-1); ++ } ++ if (!(baseaddr = (char *) MapViewOfFileEx(hMMFile, FILE_MAP_WRITE, ++ 0, 0, 0, image->baseaddr))) { ++ vips_error_system(GetLastError(), "vips_mapfile", ++ "%s", _("unable to MapViewOfFile")); ++ CloseHandle(hMMFile); ++ return (-1); ++ } ++ ++ /* Can close mapping now ... view stays until UnmapViewOfFile(). ++ ++ FIXME ... is this a performance problem? ++ ++ */ ++ CloseHandle(hMMFile); + } +- if( !(baseaddr = (char *)MapViewOfFileEx( hMMFile, FILE_MAP_WRITE, +- 0, 0, 0, image->baseaddr )) ) { +- vips_error_system( GetLastError(), "vips_mapfile", +- "%s", _( "unable to MapViewOfFile" ) ); +- CloseHandle( hMMFile ); +- return( -1 ); +- } +- +- /* Can close mapping now ... view stays until UnmapViewOfFile(). +- +- FIXME ... is this a performance problem? +- +- */ +- CloseHandle( hMMFile ); +-} +-#else /*!G_OS_WIN32*/ +-{ +- assert( image->dtype == VIPS_IMAGE_MMAPIN ); +- +- baseaddr = mmap( image->baseaddr, image->length, +- PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, +- image->fd, 0 ); +- if( baseaddr == (void *)-1 ) { +- vips_error( "vips_mapfile", _( "unable to mmap: \"%s\" - %s" ), +- image->filename, strerror( errno ) ); +- return( -1 ); ++#else /*!G_OS_WIN32*/ ++ { ++ assert(image->dtype == VIPS_IMAGE_MMAPIN); ++ ++ baseaddr = mmap(image->baseaddr, image->length, ++ PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, ++ image->fd, 0); ++ if (baseaddr == (void *) -1) { ++ vips_error("vips_mapfile", _("unable to mmap: \"%s\" - %s"), ++ image->filename, strerror(errno)); ++ return (-1); ++ } + } +-} + #endif /*G_OS_WIN32*/ + + image->dtype = VIPS_IMAGE_MMAPINRW; + +- if( baseaddr != image->baseaddr ) { +- vips_error( "vips_mapfile", _( "unable to mmap \"%s\" to same " +- "address" ), image->filename ); ++ if (baseaddr != image->baseaddr) { ++ vips_error("vips_mapfile", _("unable to mmap \"%s\" to same " ++ "address"), ++ image->filename); + image->baseaddr = baseaddr; +- return( -1 ); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } +- +diff --git a/libvips/iofuncs/memory.c b/libvips/iofuncs/memory.c +index 8b46b21671..ea1c09c688 100644 +--- a/libvips/iofuncs/memory.c ++++ b/libvips/iofuncs/memory.c +@@ -16,8 +16,8 @@ + * 20/10/09 + * - gtkdoc comment + * 6/11/09 +- * - im_malloc()/im_free() now call g_try_malloc()/g_free() ... removes +- * confusion over whether to use im_free() or g_free() for things like ++ * - im_malloc()/im_free() now call g_try_malloc()/g_free() ... removes ++ * confusion over whether to use im_free() or g_free() for things like + * im_header_string() + * 21/9/11 + * - rename as vips_tracked_malloc() to emphasise difference from +@@ -26,28 +26,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -87,7 +87,7 @@ + * + * Second, a pair of functions, vips_tracked_malloc() and vips_tracked_free(), + * which are NOT compatible. If you g_free() memory that has been allocated +- * with vips_tracked_malloc() you will see crashes. ++ * with vips_tracked_malloc() you will see crashes. + * + * The tracked functions are + * only suitable for large allocations internal to the library, for example +@@ -105,7 +105,7 @@ + */ + + #ifdef DEBUG +-# warning DEBUG on in libsrc/iofuncs/memory.c ++#warning DEBUG on in libsrc/iofuncs/memory.c + #endif /*DEBUG*/ + + static int vips_tracked_allocs = 0; +@@ -120,9 +120,9 @@ static GMutex *vips_tracked_mutex = NULL; + * @T: type of thing to allocate + * + * Allocate memory for a thing of type @T. The memory is not +- * cleared. +- * +- * This macro cannot fail. See vips_tracked_malloc() if you are ++ * cleared. ++ * ++ * This macro cannot fail. See vips_tracked_malloc() if you are + * allocating large amounts of memory. + * + * See also: vips_malloc(). +@@ -137,9 +137,9 @@ static GMutex *vips_tracked_mutex = NULL; + * @T: type of thing to allocate + * + * Allocate memory for an array of objects of type @T. The memory is not +- * cleared. ++ * cleared. + * +- * This macro cannot fail. See vips_tracked_malloc() if you are ++ * This macro cannot fail. See vips_tracked_malloc() if you are + * allocating large amounts of memory. + * + * See also: vips_malloc(). +@@ -148,9 +148,9 @@ static GMutex *vips_tracked_mutex = NULL; + */ + + static void +-vips_malloc_cb( VipsObject *object, char *buf ) ++vips_malloc_cb(VipsObject *object, char *buf) + { +- g_free( buf ); ++ g_free(buf); + } + + /** +@@ -158,11 +158,11 @@ vips_malloc_cb( VipsObject *object, char *buf ) + * @object: (nullable): allocate memory local to this #VipsObject, or %NULL + * @size: number of bytes to allocate + * +- * g_malloc() local to @object, that is, the memory will be automatically +- * freed for you when the object is closed. If @object is %NULL, you need to ++ * g_malloc() local to @object, that is, the memory will be automatically ++ * freed for you when the object is closed. If @object is %NULL, you need to + * free the memory explicitly with g_free(). + * +- * This function cannot fail. See vips_tracked_malloc() if you are ++ * This function cannot fail. See vips_tracked_malloc() if you are + * allocating large amounts of memory. + * + * See also: vips_tracked_malloc(). +@@ -170,19 +170,19 @@ vips_malloc_cb( VipsObject *object, char *buf ) + * Returns: (transfer full): a pointer to the allocated memory. + */ + void * +-vips_malloc( VipsObject *object, size_t size ) ++vips_malloc(VipsObject *object, size_t size) + { + void *buf; + +- buf = g_malloc0( size ); ++ buf = g_malloc0(size); + +- if( object ) { +- g_signal_connect( object, "postclose", +- G_CALLBACK( vips_malloc_cb ), buf ); ++ if (object) { ++ g_signal_connect(object, "postclose", ++ G_CALLBACK(vips_malloc_cb), buf); + object->local_memory += size; + } + +- return( buf ); ++ return (buf); + } + + /** +@@ -191,29 +191,29 @@ vips_malloc( VipsObject *object, size_t size ) + * @str: string to copy + * + * g_strdup() a string. When @object is freed, the string will be freed for +- * you. If @object is %NULL, you need to ++ * you. If @object is %NULL, you need to + * free the memory yourself with g_free(). + * +- * This function cannot fail. ++ * This function cannot fail. + * + * See also: vips_malloc(). + * + * Returns: (transfer full): a pointer to the allocated memory + */ + char * +-vips_strdup( VipsObject *object, const char *str ) ++vips_strdup(VipsObject *object, const char *str) + { + char *str_dup; + +- str_dup = g_strdup( str ); ++ str_dup = g_strdup(str); + +- if( object ) { +- g_signal_connect( object, "postclose", +- G_CALLBACK( vips_malloc_cb ), str_dup ); +- object->local_memory += strlen( str ); ++ if (object) { ++ g_signal_connect(object, "postclose", ++ G_CALLBACK(vips_malloc_cb), str_dup); ++ object->local_memory += strlen(str); + } + +- return( str_dup ); ++ return (str_dup); + } + + /** +@@ -221,13 +221,13 @@ vips_strdup( VipsObject *object, const char *str ) + * @s: (transfer full): memory to free + * + * Only use it to free +- * memory that was previously allocated with vips_tracked_malloc() with a ++ * memory that was previously allocated with vips_tracked_malloc() with a + * %NULL first argument. + * + * See also: vips_tracked_malloc(). + */ + void +-vips_tracked_free( void *s ) ++vips_tracked_free(void *s) + { + /* Keep the size of the alloc in the previous 16 bytes. Ensures + * alignment rules are kept. +@@ -235,42 +235,42 @@ vips_tracked_free( void *s ) + void *start = (void *) ((char *) s - 16); + size_t size = *((size_t *) start); + +- g_mutex_lock( vips_tracked_mutex ); ++ g_mutex_lock(vips_tracked_mutex); + + #ifdef DEBUG_VERBOSE_MEM +- printf( "vips_tracked_free: %p, %zd bytes\n", s, size ); ++ printf("vips_tracked_free: %p, %zd bytes\n", s, size); + #endif /*DEBUG_VERBOSE_MEM*/ + +- if( vips_tracked_allocs <= 0 ) +- g_warning( "%s", _( "vips_free: too many frees" ) ); +- if( vips_tracked_mem < size ) +- g_warning( "%s", _( "vips_free: too much free" ) ); ++ if (vips_tracked_allocs <= 0) ++ g_warning("%s", _("vips_free: too many frees")); ++ if (vips_tracked_mem < size) ++ g_warning("%s", _("vips_free: too much free")); + + vips_tracked_mem -= size; + vips_tracked_allocs -= 1; + +- g_mutex_unlock( vips_tracked_mutex ); ++ g_mutex_unlock(vips_tracked_mutex); + +- g_free( start ); ++ g_free(start); + +- VIPS_GATE_FREE( size ); ++ VIPS_GATE_FREE(size); + } + + static void * +-vips_tracked_init_mutex( void *data ) ++vips_tracked_init_mutex(void *data) + { +- vips_tracked_mutex = vips_g_mutex_new(); ++ vips_tracked_mutex = vips_g_mutex_new(); + +- return( NULL ); ++ return (NULL); + } + + static void +-vips_tracked_init( void ) ++vips_tracked_init(void) + { + static GOnce vips_tracked_once = G_ONCE_INIT; + +- VIPS_ONCE( &vips_tracked_once, +- vips_tracked_init_mutex, NULL ); ++ VIPS_ONCE(&vips_tracked_once, ++ vips_tracked_init_mutex, NULL); + } + + /** +@@ -278,9 +278,9 @@ vips_tracked_init( void ) + * @size: number of bytes to allocate + * + * Allocate an area of memory that will be tracked by vips_tracked_get_mem() +- * and friends. ++ * and friends. + * +- * If allocation fails, vips_malloc() returns %NULL and ++ * If allocation fails, vips_malloc() returns %NULL and + * sets an error message. + * + * You must only free the memory returned with vips_tracked_free(). +@@ -290,51 +290,51 @@ vips_tracked_init( void ) + * Returns: (transfer full): a pointer to the allocated memory, or %NULL on error. + */ + void * +-vips_tracked_malloc( size_t size ) ++vips_tracked_malloc(size_t size) + { +- void *buf; ++ void *buf; + +- vips_tracked_init(); ++ vips_tracked_init(); + +- /* Need an extra sizeof(size_t) bytes to track ++ /* Need an extra sizeof(size_t) bytes to track + * size of this block. Ask for an extra 16 to make sure we don't break + * alignment rules. + */ + size += 16; + +- if( !(buf = g_try_malloc0( size )) ) { ++ if (!(buf = g_try_malloc0(size))) { + #ifdef DEBUG + g_assert_not_reached(); + #endif /*DEBUG*/ + +- vips_error( "vips_tracked", +- _( "out of memory --- size == %dMB" ), +- (int) (size / (1024.0 * 1024.0)) ); +- g_warning( _( "out of memory --- size == %dMB" ), +- (int) (size / (1024.0 * 1024.0)) ); ++ vips_error("vips_tracked", ++ _("out of memory --- size == %dMB"), ++ (int) (size / (1024.0 * 1024.0))); ++ g_warning(_("out of memory --- size == %dMB"), ++ (int) (size / (1024.0 * 1024.0))); + +- return( NULL ); ++ return (NULL); + } + +- g_mutex_lock( vips_tracked_mutex ); ++ g_mutex_lock(vips_tracked_mutex); + +- *((size_t *)buf) = size; +- buf = (void *) ((char *)buf + 16); ++ *((size_t *) buf) = size; ++ buf = (void *) ((char *) buf + 16); + + vips_tracked_mem += size; +- if( vips_tracked_mem > vips_tracked_mem_highwater ) ++ if (vips_tracked_mem > vips_tracked_mem_highwater) + vips_tracked_mem_highwater = vips_tracked_mem; + vips_tracked_allocs += 1; + + #ifdef DEBUG_VERBOSE_MEM +- printf( "vips_tracked_malloc: %p, %zd bytes\n", buf, size ); ++ printf("vips_tracked_malloc: %p, %zd bytes\n", buf, size); + #endif /*DEBUG_VERBOSE_MEM*/ + +- g_mutex_unlock( vips_tracked_mutex ); ++ g_mutex_unlock(vips_tracked_mutex); + +- VIPS_GATE_MALLOC( size ); ++ VIPS_GATE_MALLOC(size); + +- return( buf ); ++ return (buf); + } + + /** +@@ -357,26 +357,26 @@ vips_tracked_malloc( size_t size ) + * Returns: a file descriptor, or -1 on error. + */ + int +-vips_tracked_open( const char *pathname, int flags, int mode ) ++vips_tracked_open(const char *pathname, int flags, int mode) + { + int fd; + +- if( (fd = vips__open( pathname, flags, mode )) == -1 ) +- return( -1 ); ++ if ((fd = vips__open(pathname, flags, mode)) == -1) ++ return (-1); + +- vips_tracked_init(); ++ vips_tracked_init(); + +- g_mutex_lock( vips_tracked_mutex ); ++ g_mutex_lock(vips_tracked_mutex); + + vips_tracked_files += 1; + #ifdef DEBUG_VERBOSE_FD +- printf( "vips_tracked_open: %s = %d (%d)\n", +- pathname, fd, vips_tracked_files ); ++ printf("vips_tracked_open: %s = %d (%d)\n", ++ pathname, fd, vips_tracked_files); + #endif /*DEBUG_VERBOSE_FD*/ + +- g_mutex_unlock( vips_tracked_mutex ); ++ g_mutex_unlock(vips_tracked_mutex); + +- return( fd ); ++ return (fd); + } + + /** +@@ -395,28 +395,28 @@ vips_tracked_open( const char *pathname, int flags, int mode ) + * Returns: a file descriptor, or -1 on error. + */ + int +-vips_tracked_close( int fd ) ++vips_tracked_close(int fd) + { + int result; + +- g_mutex_lock( vips_tracked_mutex ); ++ g_mutex_lock(vips_tracked_mutex); + + /* libvips uses fd -1 to mean invalid descriptor. + */ +- g_assert( fd != -1 ); +- g_assert( vips_tracked_files > 0 ); ++ g_assert(fd != -1); ++ g_assert(vips_tracked_files > 0); + + vips_tracked_files -= 1; + #ifdef DEBUG_VERBOSE_FD +- printf( "vips_tracked_close: %d (%d)\n", fd, vips_tracked_files ); +- printf( " from thread %p\n", g_thread_self() ); ++ printf("vips_tracked_close: %d (%d)\n", fd, vips_tracked_files); ++ printf(" from thread %p\n", g_thread_self()); + #endif /*DEBUG_VERBOSE_FD*/ + +- g_mutex_unlock( vips_tracked_mutex ); ++ g_mutex_unlock(vips_tracked_mutex); + +- result = close( fd ); ++ result = close(fd); + +- return( result ); ++ return (result); + } + + /** +@@ -429,90 +429,88 @@ vips_tracked_close( int fd ) + * Returns: the number of currently allocated bytes + */ + size_t +-vips_tracked_get_mem( void ) ++vips_tracked_get_mem(void) + { + size_t mem; + +- vips_tracked_init(); ++ vips_tracked_init(); + +- g_mutex_lock( vips_tracked_mutex ); ++ g_mutex_lock(vips_tracked_mutex); + + mem = vips_tracked_mem; + +- g_mutex_unlock( vips_tracked_mutex ); ++ g_mutex_unlock(vips_tracked_mutex); + +- return( mem ); ++ return (mem); + } + + /** + * vips_tracked_get_mem_highwater: + * +- * Returns the largest number of bytes simultaneously allocated via ++ * Returns the largest number of bytes simultaneously allocated via + * vips_tracked_malloc(). Handy for estimating max memory requirements for a + * program. + * + * Returns: the largest number of currently allocated bytes + */ + size_t +-vips_tracked_get_mem_highwater( void ) ++vips_tracked_get_mem_highwater(void) + { + size_t mx; + +- vips_tracked_init(); ++ vips_tracked_init(); + +- g_mutex_lock( vips_tracked_mutex ); ++ g_mutex_lock(vips_tracked_mutex); + + mx = vips_tracked_mem_highwater; + +- g_mutex_unlock( vips_tracked_mutex ); ++ g_mutex_unlock(vips_tracked_mutex); + +- return( mx ); ++ return (mx); + } + + /** + * vips_tracked_get_allocs: + * +- * Returns the number of active allocations. ++ * Returns the number of active allocations. + * + * Returns: the number of active allocations + */ + int +-vips_tracked_get_allocs( void ) ++vips_tracked_get_allocs(void) + { + int n; + +- vips_tracked_init(); ++ vips_tracked_init(); + +- g_mutex_lock( vips_tracked_mutex ); ++ g_mutex_lock(vips_tracked_mutex); + + n = vips_tracked_allocs; + +- g_mutex_unlock( vips_tracked_mutex ); ++ g_mutex_unlock(vips_tracked_mutex); + +- return( n ); ++ return (n); + } + +- + /** + * vips_tracked_get_files: + * +- * Returns the number of open files. ++ * Returns the number of open files. + * + * Returns: the number of open files + */ + int +-vips_tracked_get_files( void ) ++vips_tracked_get_files(void) + { + int n; + +- vips_tracked_init(); ++ vips_tracked_init(); + +- g_mutex_lock( vips_tracked_mutex ); ++ g_mutex_lock(vips_tracked_mutex); + + n = vips_tracked_files; + +- g_mutex_unlock( vips_tracked_mutex ); ++ g_mutex_unlock(vips_tracked_mutex); + +- return( n ); ++ return (n); + } +- +diff --git a/libvips/iofuncs/object.c b/libvips/iofuncs/object.c +index 47bdb3e1b5..808967f151 100644 +--- a/libvips/iofuncs/object.c ++++ b/libvips/iofuncs/object.c +@@ -8,28 +8,28 @@ + + /* + +- Copyright (C) 1991-2003 The National Gallery ++ Copyright (C) 1991-2003 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -69,16 +69,16 @@ + * #VipsObject is the base class for all objects in libvips. It has the + * following major features: + * +- * Functional class creation Vips objects have a very ++ * Functional class creation Vips objects have a very + * regular lifecycle: initialise, build, use, destroy. They behave rather like + * function calls and are free of side-effects. + * +- * Run-time introspection Vips objects can be fully +- * introspected at run-time. There is no need for separate source-code ++ * Run-time introspection Vips objects can be fully ++ * introspected at run-time. There is no need for separate source-code + * analysis. + * + * Command-line interface Any vips object can be run from +- * the command-line with the `vips` driver program. ++ * the command-line with the `vips` driver program. + * + * ## The #VipsObject lifecycle + * +@@ -92,13 +92,13 @@ + * 2. g_object_set(). You loop over the #VipsArgument that the object has + * defined with vips_argument_map(). Arguments have a set of flags attached to + * them for required, optional, input, output, type, and so on. You must set +- * all required arguments. ++ * all required arguments. + * + * 3. vips_object_build(). Call this to construct the object and get it ready + * for use. Building an object happens in four stages, see below. + * +- * 4. g_object_get(). The object has now been built. You can read out any +- * computed values. ++ * 4. g_object_get(). The object has now been built. You can read out any ++ * computed values. + * + * 5. g_object_unref(). When you are done with an object, you can unref it. + * See the section on reference counting for an explanation of the convention +@@ -111,12 +111,12 @@ + * each class does any initial setup and checking, then chains up to its + * superclass. + * +- * 2. The innermost @build method inside #VipsObject itself checks that all +- * input arguments have been set and then returns. ++ * 2. The innermost @build method inside #VipsObject itself checks that all ++ * input arguments have been set and then returns. + * + * 3. All object @build methods now finish executing, from innermost to + * outermost. They know all input arguments have been checked and supplied, so +- * now they set all output arguments. ++ * now they set all output arguments. + * + * 4. vips_object_build() finishes the process by checking that all output + * objects have been set, and then triggering the #VipsObject::postbuild +@@ -124,18 +124,18 @@ + * successfuly. + * + * #VipsOperation has a cache of recent operation objects, see that class for +- * an explanation of vips_cache_operation_build(). ++ * an explanation of vips_cache_operation_build(). + * + * Finally the stages inside close are: + * + * 1. #VipsObject::preclose. This is emitted at the start of +- * the #VipsObject dispose. The object is still functioning. ++ * the #VipsObject dispose. The object is still functioning. + * + * 2. #VipsObject::close. This runs just after all #VipsArgument held by + * the object have been released. + * + * 3. #VipsObject::postclose. This runs right at the end. The object +- * pointer is still valid, but nothing else is. ++ * pointer is still valid, but nothing else is. + * + * ## #VipsArgument + * +@@ -143,7 +143,7 @@ + * %GObject properties. You add a set of macros to your _class_init() which + * describe the arguments, and set the get and set functions to the vips ones. + * +- * See extending for a complete example. ++ * See extending for a complete example. + * + * ## The #VipsObject reference counting convention + * +@@ -156,13 +156,13 @@ + * 2. All output %GObject hold a ref to the object. When a %GObject which is an + * output of a #VipsObject is disposed, it must drop this reference. + * #VipsObject which are outputs of other #VipsObject will do this +- * automatically. ++ * automatically. + * +- * See #VipsOperation for an example of #VipsObject reference counting. ++ * See #VipsOperation for an example of #VipsObject reference counting. + * + */ + +-/** ++/** + * VipsArgumentFlags: + * @VIPS_ARGUMENT_NONE: no flags + * @VIPS_ARGUMENT_REQUIRED: must be set in the constructor +@@ -171,7 +171,7 @@ + * @VIPS_ARGUMENT_SET_ALWAYS: don't do use-before-set checks + * @VIPS_ARGUMENT_INPUT: is an input argument (one we depend on) + * @VIPS_ARGUMENT_OUTPUT: is an output argument (depends on us) +- * @VIPS_ARGUMENT_DEPRECATED: just there for back-compat, hide ++ * @VIPS_ARGUMENT_DEPRECATED: just there for back-compat, hide + * @VIPS_ARGUMENT_MODIFY: the input argument will be modified + * + * Flags we associate with each object argument. +@@ -192,16 +192,16 @@ + * argument if you do. + * + * Input args with @VIPS_ARGUMENT_MODIFY will be modified by the operation. +- * This is used for things like the in-place drawing operations. ++ * This is used for things like the in-place drawing operations. + */ + +-/* Our signals. ++/* Our signals. + */ + enum { +- SIG_POSTBUILD, +- SIG_PRECLOSE, +- SIG_CLOSE, +- SIG_POSTCLOSE, ++ SIG_POSTBUILD, ++ SIG_PRECLOSE, ++ SIG_CLOSE, ++ SIG_POSTCLOSE, + SIG_LAST + }; + +@@ -220,7 +220,7 @@ int _vips__argument_id = 1; + */ + static GHashTable *vips__object_nickname_table = NULL; + +-G_DEFINE_ABSTRACT_TYPE( VipsObject, vips_object, G_TYPE_OBJECT ); ++G_DEFINE_ABSTRACT_TYPE(VipsObject, vips_object, G_TYPE_OBJECT); + + /** + * vips_argument_get_id: (skip) +@@ -229,8 +229,8 @@ G_DEFINE_ABSTRACT_TYPE( VipsObject, vips_object, G_TYPE_OBJECT ); + * + * Returns: a new property id > 0 + */ +-int +-vips_argument_get_id( void ) ++int ++vips_argument_get_id(void) + { + int id; + +@@ -239,140 +239,140 @@ vips_argument_get_id( void ) + */ + id = _vips__argument_id++; + +- return( id ); ++ return (id); + } + + /* Don't call this directly, see vips_object_build(). + */ + static int +-vips_object_postbuild( VipsObject *object ) ++vips_object_postbuild(VipsObject *object) + { + int result; + + #ifdef DEBUG +- printf( "vips_object_postbuild: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_object_postbuild: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- g_signal_emit( object, vips_object_signals[SIG_POSTBUILD], 0, &result ); ++ g_signal_emit(object, vips_object_signals[SIG_POSTBUILD], 0, &result); + +- return( result ); ++ return (result); + } + + void +-vips_object_preclose( VipsObject *object ) ++vips_object_preclose(VipsObject *object) + { +- if( !object->preclose ) { ++ if (!object->preclose) { + object->preclose = TRUE; + + #ifdef DEBUG +- printf( "vips_object_preclose: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_object_preclose: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- g_signal_emit( object, vips_object_signals[SIG_PRECLOSE], 0 ); ++ g_signal_emit(object, vips_object_signals[SIG_PRECLOSE], 0); + } + } + + static void +-vips_object_close( VipsObject *object ) ++vips_object_close(VipsObject *object) + { +- if( !object->close ) { ++ if (!object->close) { + object->close = TRUE; + + #ifdef DEBUG +- printf( "vips_object_close: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_object_close: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- g_signal_emit( object, vips_object_signals[SIG_CLOSE], 0 ); ++ g_signal_emit(object, vips_object_signals[SIG_CLOSE], 0); + } + } + + static void +-vips_object_postclose( VipsObject *object ) ++vips_object_postclose(VipsObject *object) + { +- if( !object->postclose ) { ++ if (!object->postclose) { + object->postclose = TRUE; + + #ifdef DEBUG +- printf( "vips_object_postclose: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_object_postclose: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- g_signal_emit( object, vips_object_signals[SIG_POSTCLOSE], 0 ); ++ g_signal_emit(object, vips_object_signals[SIG_POSTCLOSE], 0); + } + } + + static void * +-vips_object_check_required( VipsObject *object, GParamSpec *pspec, ++vips_object_check_required(VipsObject *object, GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + + int *result = (int *) a; + VipsArgumentFlags *iomask = (VipsArgumentFlags *) b; + +- VIPS_DEBUG_MSG( "vips_object_check_required: %s\n", +- g_param_spec_get_name( pspec ) ); +- VIPS_DEBUG_MSG( "\trequired: %d\n", +- argument_class->flags & VIPS_ARGUMENT_REQUIRED ); +- VIPS_DEBUG_MSG( "\tconstruct: %d\n", +- argument_class->flags & VIPS_ARGUMENT_CONSTRUCT ); +- VIPS_DEBUG_MSG( "\tinput: %d\n", +- argument_class->flags & VIPS_ARGUMENT_INPUT ); +- VIPS_DEBUG_MSG( "\toutput: %d\n", +- argument_class->flags & VIPS_ARGUMENT_OUTPUT ); +- VIPS_DEBUG_MSG( "\tassigned: %d\n", +- argument_instance->assigned ); +- +- if( (argument_class->flags & VIPS_ARGUMENT_REQUIRED) && ++ VIPS_DEBUG_MSG("vips_object_check_required: %s\n", ++ g_param_spec_get_name(pspec)); ++ VIPS_DEBUG_MSG("\trequired: %d\n", ++ argument_class->flags & VIPS_ARGUMENT_REQUIRED); ++ VIPS_DEBUG_MSG("\tconstruct: %d\n", ++ argument_class->flags & VIPS_ARGUMENT_CONSTRUCT); ++ VIPS_DEBUG_MSG("\tinput: %d\n", ++ argument_class->flags & VIPS_ARGUMENT_INPUT); ++ VIPS_DEBUG_MSG("\toutput: %d\n", ++ argument_class->flags & VIPS_ARGUMENT_OUTPUT); ++ VIPS_DEBUG_MSG("\tassigned: %d\n", ++ argument_instance->assigned); ++ ++ if ((argument_class->flags & VIPS_ARGUMENT_REQUIRED) && + (argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) && + !(argument_class->flags & VIPS_ARGUMENT_DEPRECATED) && + (argument_class->flags & *iomask) && +- !argument_instance->assigned ) { +- vips_error( class->nickname, +- _( "parameter %s not set" ), +- g_param_spec_get_name( pspec ) ); ++ !argument_instance->assigned) { ++ vips_error(class->nickname, ++ _("parameter %s not set"), ++ g_param_spec_get_name(pspec)); + *result = -1; + } + +- return( NULL ); ++ return (NULL); + } + + int +-vips_object_build( VipsObject *object ) ++vips_object_build(VipsObject *object) + { +- VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS(object); + + /* Input and output args must both be set. + */ +- VipsArgumentFlags iomask = ++ VipsArgumentFlags iomask = + VIPS_ARGUMENT_INPUT | VIPS_ARGUMENT_OUTPUT; + + int result; + + #ifdef DEBUG +- printf( "vips_object_build: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_object_build: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- if( object_class->build( object ) ) +- return( -1 ); ++ if (object_class->build(object)) ++ return (-1); + + /* Check all required arguments have been supplied, don't stop on 1st + * error. + */ + result = 0; +- (void) vips_argument_map( object, +- vips_object_check_required, &result, &iomask ); ++ (void) vips_argument_map(object, ++ vips_object_check_required, &result, &iomask); + + /* ... more checks go here. + */ +@@ -380,10 +380,10 @@ vips_object_build( VipsObject *object ) + + /* Only postbuild on success. + */ +- if( !result ) +- result = vips_object_postbuild( object ); ++ if (!result) ++ result = vips_object_postbuild(object); + +- return( result ); ++ return (result); + } + + /** +@@ -391,12 +391,12 @@ vips_object_build( VipsObject *object ) + * @klass: class to summarise + * @buf: write summary here + * +- * Generate a human-readable summary for a class. ++ * Generate a human-readable summary for a class. + */ + void +-vips_object_summary_class( VipsObjectClass *klass, VipsBuf *buf ) ++vips_object_summary_class(VipsObjectClass *klass, VipsBuf *buf) + { +- klass->summary_class( klass, buf ); ++ klass->summary_class(klass, buf); + } + + /** +@@ -404,14 +404,14 @@ vips_object_summary_class( VipsObjectClass *klass, VipsBuf *buf ) + * @object: object to summarise + * @buf: write summary here + * +- * Generate a human-readable summary for an object. ++ * Generate a human-readable summary for an object. + */ + void +-vips_object_summary( VipsObject *object, VipsBuf *buf ) ++vips_object_summary(VipsObject *object, VipsBuf *buf) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + +- class->summary( object, buf ); ++ class->summary(object, buf); + } + + /** +@@ -422,73 +422,73 @@ vips_object_summary( VipsObject *object, VipsBuf *buf ) + * Dump everything that vips knows about an object to a string. + */ + void +-vips_object_dump( VipsObject *object, VipsBuf *buf ) ++vips_object_dump(VipsObject *object, VipsBuf *buf) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + +- class->dump( object, buf ); ++ class->dump(object, buf); + } + + void +-vips_object_print_summary_class( VipsObjectClass *klass ) ++vips_object_print_summary_class(VipsObjectClass *klass) + { + char str[2048]; +- VipsBuf buf = VIPS_BUF_STATIC( str ); ++ VipsBuf buf = VIPS_BUF_STATIC(str); + +- vips_object_summary_class( klass, &buf ); +- printf( "%s\n", vips_buf_all( &buf ) ); ++ vips_object_summary_class(klass, &buf); ++ printf("%s\n", vips_buf_all(&buf)); + } + + void +-vips_object_print_summary( VipsObject *object ) ++vips_object_print_summary(VipsObject *object) + { + char str[2048]; +- VipsBuf buf = VIPS_BUF_STATIC( str ); ++ VipsBuf buf = VIPS_BUF_STATIC(str); + +- vips_object_summary( object, &buf ); +- printf( "%s\n", vips_buf_all( &buf ) ); ++ vips_object_summary(object, &buf); ++ printf("%s\n", vips_buf_all(&buf)); + } + + void +-vips_object_print_dump( VipsObject *object ) ++vips_object_print_dump(VipsObject *object) + { + char str[32768]; +- VipsBuf buf = VIPS_BUF_STATIC( str ); ++ VipsBuf buf = VIPS_BUF_STATIC(str); + +- vips_object_dump( object, &buf ); +- printf( "%s\n", vips_buf_all( &buf ) ); ++ vips_object_dump(object, &buf); ++ printf("%s\n", vips_buf_all(&buf)); + } + + void +-vips_object_print_name( VipsObject *object ) ++vips_object_print_name(VipsObject *object) + { +- printf( "%s (%p)", G_OBJECT_TYPE_NAME( object ), object ); ++ printf("%s (%p)", G_OBJECT_TYPE_NAME(object), object); + } + + gboolean +-vips_object_sanity( VipsObject *object ) ++vips_object_sanity(VipsObject *object) + { + VipsObjectClass *class; + char str[1000]; +- VipsBuf buf = VIPS_BUF_STATIC( str ); ++ VipsBuf buf = VIPS_BUF_STATIC(str); + +- if( !object ) { +- printf( "vips_object_sanity: null object\n" ); ++ if (!object) { ++ printf("vips_object_sanity: null object\n"); + +- return( FALSE ); ++ return (FALSE); + } + +- class = VIPS_OBJECT_GET_CLASS( object ); +- class->sanity( object, &buf ); +- if( !vips_buf_is_empty( &buf ) ) { +- printf( "sanity failure: " ); +- vips_object_print_name( object ); +- printf( " %s\n", vips_buf_all( &buf ) ); ++ class = VIPS_OBJECT_GET_CLASS(object); ++ class->sanity(object, &buf); ++ if (!vips_buf_is_empty(&buf)) { ++ printf("sanity failure: "); ++ vips_object_print_name(object); ++ printf(" %s\n", vips_buf_all(&buf)); + +- return( FALSE ); ++ return (FALSE); + } + +- return( TRUE ); ++ return (TRUE); + } + + /* On a rewind, we dispose the old contents of the object and +@@ -498,44 +498,44 @@ vips_object_sanity( VipsObject *object ) + * Override in subclasses if you want to preserve some fields, see image.c. + */ + void +-vips_object_rewind( VipsObject *object ) ++vips_object_rewind(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + +- class->rewind( object ); ++ class->rewind(object); + } + + /* Extra stuff we track for properties to do our argument handling. + */ + + static void +-vips_argument_instance_detach( VipsArgumentInstance *argument_instance ) ++vips_argument_instance_detach(VipsArgumentInstance *argument_instance) + { + VipsObject *object = argument_instance->object; + VipsArgumentClass *argument_class = argument_instance->argument_class; + +- if( argument_instance->close_id ) { ++ if (argument_instance->close_id) { + /* If close_id is set, the argument must be a gobject of some + * sort, so we can fetch it. + */ +- GObject *member = G_STRUCT_MEMBER( GObject *, object, +- argument_class->offset ); ++ GObject *member = G_STRUCT_MEMBER(GObject *, object, ++ argument_class->offset); + +- if( g_signal_handler_is_connected( member, +- argument_instance->close_id ) ) +- g_signal_handler_disconnect( member, +- argument_instance->close_id ); ++ if (g_signal_handler_is_connected(member, ++ argument_instance->close_id)) ++ g_signal_handler_disconnect(member, ++ argument_instance->close_id); + argument_instance->close_id = 0; + } + +- if( argument_instance->invalidate_id ) { +- GObject *member = G_STRUCT_MEMBER( GObject *, object, +- argument_class->offset ); ++ if (argument_instance->invalidate_id) { ++ GObject *member = G_STRUCT_MEMBER(GObject *, object, ++ argument_class->offset); + +- if( g_signal_handler_is_connected( member, +- argument_instance->invalidate_id ) ) +- g_signal_handler_disconnect( member, +- argument_instance->invalidate_id ); ++ if (g_signal_handler_is_connected(member, ++ argument_instance->invalidate_id)) ++ g_signal_handler_disconnect(member, ++ argument_instance->invalidate_id); + argument_instance->invalidate_id = 0; + } + } +@@ -543,34 +543,34 @@ vips_argument_instance_detach( VipsArgumentInstance *argument_instance ) + /* Free a VipsArgumentInstance ... VipsArgumentClass can just be g_free()d. + */ + static void +-vips_argument_instance_free( VipsArgumentInstance *argument_instance ) ++vips_argument_instance_free(VipsArgumentInstance *argument_instance) + { +- vips_argument_instance_detach( argument_instance ); +- g_free( argument_instance ); ++ vips_argument_instance_detach(argument_instance); ++ g_free(argument_instance); + } + + VipsArgument * +-vips__argument_table_lookup( VipsArgumentTable *table, GParamSpec *pspec ) ++vips__argument_table_lookup(VipsArgumentTable *table, GParamSpec *pspec) + { + VipsArgument *argument; + +- g_mutex_lock( vips__global_lock ); +- argument = (VipsArgument *) g_hash_table_lookup( table, pspec ); +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); ++ argument = (VipsArgument *) g_hash_table_lookup(table, pspec); ++ g_mutex_unlock(vips__global_lock); + +- return( argument ); ++ return (argument); + } + + static void +-vips_argument_table_replace( VipsArgumentTable *table, VipsArgument *argument ) ++vips_argument_table_replace(VipsArgumentTable *table, VipsArgument *argument) + { +- g_hash_table_replace( table, argument->pspec, argument ); ++ g_hash_table_replace(table, argument->pspec, argument); + } + + static void +-vips_argument_table_destroy( VipsArgumentTable *table ) ++vips_argument_table_destroy(VipsArgumentTable *table) + { +- g_hash_table_destroy( table ); ++ g_hash_table_destroy(table); + } + + /** +@@ -581,38 +581,40 @@ vips_argument_table_destroy( VipsArgumentTable *table ) + * @b: client data + * + * Loop over the vips_arguments to an object. Stop when @fn returns non-%NULL +- * and return that value. ++ * and return that value. + * + * Returns: %NULL if @fn returns %NULL for all arguments, otherwise the first + * non-%NULL value from @fn. + */ + void * +-vips_argument_map( VipsObject *object, +- VipsArgumentMapFn fn, void *a, void *b ) ++vips_argument_map(VipsObject *object, ++ VipsArgumentMapFn fn, void *a, void *b) + { + /* Make sure we can't go during the loop. This can happen if eg. we + * flush an arg that refs us. + */ +- g_object_ref( object ); ++ g_object_ref(object); + +- VIPS_ARGUMENT_FOR_ALL( object, +- pspec, argument_class, argument_instance ) { ++ VIPS_ARGUMENT_FOR_ALL(object, ++ pspec, argument_class, argument_instance) ++ { + void *result; + + /* argument_instance should not be NULL. + */ +- g_assert( argument_instance ); ++ g_assert(argument_instance); + +- if( (result = fn( object, pspec, +- argument_class, argument_instance, a, b )) ) { +- g_object_unref( object ); +- return( result ); ++ if ((result = fn(object, pspec, ++ argument_class, argument_instance, a, b))) { ++ g_object_unref(object); ++ return (result); + } +- } VIPS_ARGUMENT_FOR_ALL_END ++ } ++ VIPS_ARGUMENT_FOR_ALL_END + +- g_object_unref( object ); ++ g_object_unref(object); + +- return( NULL ); ++ return (NULL); + } + + /** +@@ -621,59 +623,59 @@ vips_argument_map( VipsObject *object, + * And loop over a class. Same as ^^, but with no VipsArgumentInstance. + */ + void * +-vips_argument_class_map( VipsObjectClass *object_class, +- VipsArgumentClassMapFn fn, void *a, void *b ) ++vips_argument_class_map(VipsObjectClass *object_class, ++ VipsArgumentClassMapFn fn, void *a, void *b) + { +- GSList *p; +- +- for( p = object_class->argument_table_traverse; p; p = p->next ) { +- VipsArgumentClass *arg_class = +- (VipsArgumentClass *) p->data; +- VipsArgument *argument = (VipsArgument *) arg_class; +- GParamSpec *pspec = argument->pspec; ++ GSList *p; ++ ++ for (p = object_class->argument_table_traverse; p; p = p->next) { ++ VipsArgumentClass *arg_class = ++ (VipsArgumentClass *) p->data; ++ VipsArgument *argument = (VipsArgument *) arg_class; ++ GParamSpec *pspec = argument->pspec; + + void *result; + +- if( (result = +- fn( object_class, pspec, arg_class, a, b )) ) +- return( result ); ++ if ((result = ++ fn(object_class, pspec, arg_class, a, b))) ++ return (result); + } + +- return( NULL ); ++ return (NULL); + } + + /* Does an vipsargument need an argument to write to? For example, an image + * output needs a filename, a double output just prints. + */ + gboolean +-vips_argument_class_needsstring( VipsArgumentClass *argument_class ) ++vips_argument_class_needsstring(VipsArgumentClass *argument_class) + { + GParamSpec *pspec = ((VipsArgument *) argument_class)->pspec; + + GType otype; + VipsObjectClass *oclass; + +- if( G_IS_PARAM_SPEC_BOOLEAN( pspec ) ) ++ if (G_IS_PARAM_SPEC_BOOLEAN(pspec)) + /* Bools, input or output, don't need args. + */ +- return( FALSE ); ++ return (FALSE); + +- if( argument_class->flags & VIPS_ARGUMENT_INPUT ) ++ if (argument_class->flags & VIPS_ARGUMENT_INPUT) + /* All other inputs need something. + */ +- return( TRUE ); ++ return (TRUE); + + /* Just output objects. + */ + +- if( (otype = G_PARAM_SPEC_VALUE_TYPE( pspec )) && +- g_type_is_a( otype, VIPS_TYPE_OBJECT ) && +- (oclass = g_type_class_ref( otype )) ) ++ if ((otype = G_PARAM_SPEC_VALUE_TYPE(pspec)) && ++ g_type_is_a(otype, VIPS_TYPE_OBJECT) && ++ (oclass = g_type_class_ref(otype))) + /* For now, only vipsobject subclasses can ask for args. + */ +- return( oclass->output_needs_arg ); ++ return (oclass->output_needs_arg); + else +- return( FALSE ); ++ return (FALSE); + } + + /* Create a VipsArgumentInstance for each installed argument property. Ideally +@@ -682,53 +684,55 @@ vips_argument_class_needsstring( VipsArgumentClass *argument_class ) + * vips__argument_get_instance(). + */ + static void +-vips_argument_init( VipsObject *object ) ++vips_argument_init(VipsObject *object) + { +- if( !object->argument_table ) { ++ if (!object->argument_table) { + #ifdef DEBUG +- printf( "vips_argument_init: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_argument_init: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- object->argument_table = g_hash_table_new_full( g_direct_hash, ++ object->argument_table = g_hash_table_new_full(g_direct_hash, + g_direct_equal, NULL, +- (GDestroyNotify) vips_argument_instance_free ); ++ (GDestroyNotify) vips_argument_instance_free); + + /* Make a VipsArgumentInstance for each installed argument + * property. We can't use vips_argument_map() since that does + * some sanity checks that won't pass until all arg instance + * are built. + */ +- VIPS_ARGUMENT_FOR_ALL( object, +- pspec, argument_class, argument_instance ) { ++ VIPS_ARGUMENT_FOR_ALL(object, ++ pspec, argument_class, argument_instance) ++ { + #ifdef DEBUG +- printf( "vips_argument_init: " +- "adding instance argument for %s\n", +- g_param_spec_get_name( pspec ) ); ++ printf("vips_argument_init: " ++ "adding instance argument for %s\n", ++ g_param_spec_get_name(pspec)); + #endif /*DEBUG*/ + +- /* argument_instance should be NULL since we've not ++ /* argument_instance should be NULL since we've not + * set it yet. + */ +- g_assert( argument_instance == NULL ); ++ g_assert(argument_instance == NULL); + +- argument_instance = g_new( VipsArgumentInstance, 1 ); ++ argument_instance = g_new(VipsArgumentInstance, 1); + + ((VipsArgument *) argument_instance)->pspec = pspec; + argument_instance->argument_class = argument_class; + argument_instance->object = object; + /* SET_ALWAYS args default to assigned. + */ +- argument_instance->assigned = +- argument_class->flags & +- VIPS_ARGUMENT_SET_ALWAYS; ++ argument_instance->assigned = ++ argument_class->flags & ++ VIPS_ARGUMENT_SET_ALWAYS; + argument_instance->close_id = 0; + argument_instance->invalidate_id = 0; + +- vips_argument_table_replace( object->argument_table, +- (VipsArgument *) argument_instance ); +- } VIPS_ARGUMENT_FOR_ALL_END ++ vips_argument_table_replace(object->argument_table, ++ (VipsArgument *) argument_instance); ++ } ++ VIPS_ARGUMENT_FOR_ALL_END + } + } + +@@ -738,16 +742,16 @@ vips_argument_init( VipsObject *object ) + * Convenience ... given the VipsArgumentClass, get the VipsArgumentInstance. + */ + VipsArgumentInstance * +-vips__argument_get_instance( VipsArgumentClass *argument_class, +- VipsObject *object ) ++vips__argument_get_instance(VipsArgumentClass *argument_class, ++ VipsObject *object) + { + /* Make sure the instance args are built. + */ +- vips_argument_init( object ); ++ vips_argument_init(object); + +- return( (VipsArgumentInstance *) +- vips__argument_table_lookup( object->argument_table, +- ((VipsArgument *) argument_class)->pspec ) ); ++ return ((VipsArgumentInstance *) ++ vips__argument_table_lookup(object->argument_table, ++ ((VipsArgument *) argument_class)->pspec)); + } + + /** +@@ -763,40 +767,40 @@ vips__argument_get_instance( VipsArgumentClass *argument_class, + * Returns: 0 on success, or -1 on error. + */ + int +-vips_object_get_argument( VipsObject *object, const char *name, ++vips_object_get_argument(VipsObject *object, const char *name, + GParamSpec **pspec, + VipsArgumentClass **argument_class, +- VipsArgumentInstance **argument_instance ) ++ VipsArgumentInstance **argument_instance) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + +- if( !(*pspec = g_object_class_find_property( +- G_OBJECT_CLASS( class ), name )) ) { +- vips_error( class->nickname, +- _( "no property named `%s'" ), name ); +- return( -1 ); ++ if (!(*pspec = g_object_class_find_property( ++ G_OBJECT_CLASS(class), name))) { ++ vips_error(class->nickname, ++ _("no property named `%s'"), name); ++ return (-1); + } + +- if( !(*argument_class = (VipsArgumentClass *) +- vips__argument_table_lookup( class->argument_table, +- *pspec )) ) { +- vips_error( class->nickname, +- _( "no vips argument named `%s'" ), name ); +- return( -1 ); ++ if (!(*argument_class = (VipsArgumentClass *) ++ vips__argument_table_lookup(class->argument_table, ++ *pspec))) { ++ vips_error(class->nickname, ++ _("no vips argument named `%s'"), name); ++ return (-1); + } + +- if( !(*argument_instance = vips__argument_get_instance( +- *argument_class, object )) ) { +- vips_error( class->nickname, +- _( "argument `%s' has no instance" ), name ); +- return( -1 ); ++ if (!(*argument_instance = vips__argument_get_instance( ++ *argument_class, object))) { ++ vips_error(class->nickname, ++ _("argument `%s' has no instance"), name); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +- * vips_object_argument_isset: ++ * vips_object_argument_isset: + * @object: the object to fetch the args from + * @name: arg to fetch + * +@@ -805,21 +809,21 @@ vips_object_get_argument( VipsObject *object, const char *name, + * Returns: %TRUE if the argument has been assigned. + */ + gboolean +-vips_object_argument_isset( VipsObject *object, const char *name ) ++vips_object_argument_isset(VipsObject *object, const char *name) + { + GParamSpec *pspec; + VipsArgumentClass *argument_class; + VipsArgumentInstance *argument_instance; + +- if( vips_object_get_argument( object, name, +- &pspec, &argument_class, &argument_instance ) ) +- return( FALSE ); ++ if (vips_object_get_argument(object, name, ++ &pspec, &argument_class, &argument_instance)) ++ return (FALSE); + +- return( argument_instance->assigned ); ++ return (argument_instance->assigned); + } + + /** +- * vips_object_get_argument_flags: ++ * vips_object_get_argument_flags: + * @object: the object to fetch the args from + * @name: arg to fetch + * +@@ -828,21 +832,21 @@ vips_object_argument_isset( VipsObject *object, const char *name ) + * Returns: The #VipsArgumentFlags for this argument. + */ + VipsArgumentFlags +-vips_object_get_argument_flags( VipsObject *object, const char *name ) ++vips_object_get_argument_flags(VipsObject *object, const char *name) + { + GParamSpec *pspec; + VipsArgumentClass *argument_class; + VipsArgumentInstance *argument_instance; + +- if( vips_object_get_argument( object, name, +- &pspec, &argument_class, &argument_instance ) ) +- return( 0 ); ++ if (vips_object_get_argument(object, name, ++ &pspec, &argument_class, &argument_instance)) ++ return (0); + +- return( argument_class->flags ); ++ return (argument_class->flags); + } + + /** +- * vips_object_get_argument_priority: ++ * vips_object_get_argument_priority: + * @object: the object to fetch the args from + * @name: arg to fetch + * +@@ -851,55 +855,55 @@ vips_object_get_argument_flags( VipsObject *object, const char *name ) + * Returns: The priority of this argument. + */ + int +-vips_object_get_argument_priority( VipsObject *object, const char *name ) ++vips_object_get_argument_priority(VipsObject *object, const char *name) + { + GParamSpec *pspec; + VipsArgumentClass *argument_class; + VipsArgumentInstance *argument_instance; + +- if( vips_object_get_argument( object, name, +- &pspec, &argument_class, &argument_instance ) ) +- return( 0 ); ++ if (vips_object_get_argument(object, name, ++ &pspec, &argument_class, &argument_instance)) ++ return (0); + +- return( argument_class->priority ); ++ return (argument_class->priority); + } + + static void +-vips_object_clear_member( VipsArgumentInstance *argument_instance ) ++vips_object_clear_member(VipsArgumentInstance *argument_instance) + { + VipsObject *object = argument_instance->object; + VipsArgumentClass *argument_class = argument_instance->argument_class; +- GObject **member = &G_STRUCT_MEMBER( GObject *, object, +- argument_class->offset ); ++ GObject **member = &G_STRUCT_MEMBER(GObject *, object, ++ argument_class->offset); + +- vips_argument_instance_detach( argument_instance ); ++ vips_argument_instance_detach(argument_instance); + +- if( *member ) { +- if( argument_class->flags & VIPS_ARGUMENT_INPUT ) { ++ if (*member) { ++ if (argument_class->flags & VIPS_ARGUMENT_INPUT) { + #ifdef DEBUG_REF +- printf( "vips_object_clear_member: vips object: " ); +- vips_object_print_name( object ); +- printf( " no longer refers to gobject %s (%p)\n", +- G_OBJECT_TYPE_NAME( *member ), *member ); +- printf( " count down to %d\n", +- G_OBJECT( *member )->ref_count - 1 ); ++ printf("vips_object_clear_member: vips object: "); ++ vips_object_print_name(object); ++ printf(" no longer refers to gobject %s (%p)\n", ++ G_OBJECT_TYPE_NAME(*member), *member); ++ printf(" count down to %d\n", ++ G_OBJECT(*member)->ref_count - 1); + #endif /*DEBUG_REF*/ + + /* We reffed the object. + */ +- g_object_unref( *member ); ++ g_object_unref(*member); + } +- else if( argument_class->flags & VIPS_ARGUMENT_OUTPUT ) { ++ else if (argument_class->flags & VIPS_ARGUMENT_OUTPUT) { + #ifdef DEBUG_REF +- printf( "vips_object_clear_member: gobject %s (%p)\n", +- G_OBJECT_TYPE_NAME( *member ), *member ); +- printf( " no longer refers to vips object: " ); +- vips_object_print_name( object ); +- printf( " count down to %d\n", +- G_OBJECT( object )->ref_count - 1 ); ++ printf("vips_object_clear_member: gobject %s (%p)\n", ++ G_OBJECT_TYPE_NAME(*member), *member); ++ printf(" no longer refers to vips object: "); ++ vips_object_print_name(object); ++ printf(" count down to %d\n", ++ G_OBJECT(object)->ref_count - 1); + #endif /*DEBUG_REF*/ + +- g_object_unref( object ); ++ g_object_unref(object); + } + + *member = NULL; +@@ -909,165 +913,165 @@ vips_object_clear_member( VipsArgumentInstance *argument_instance ) + /* Free any args which are holding resources. + */ + static void * +-vips_object_dispose_argument( VipsObject *object, GParamSpec *pspec, ++vips_object_dispose_argument(VipsObject *object, GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { +- g_assert( ((VipsArgument *) argument_class)->pspec == pspec ); +- g_assert( ((VipsArgument *) argument_instance)->pspec == pspec ); ++ g_assert(((VipsArgument *) argument_class)->pspec == pspec); ++ g_assert(((VipsArgument *) argument_instance)->pspec == pspec); + +- if( G_IS_PARAM_SPEC_OBJECT( pspec ) || +- G_IS_PARAM_SPEC_BOXED( pspec ) ) { ++ if (G_IS_PARAM_SPEC_OBJECT(pspec) || ++ G_IS_PARAM_SPEC_BOXED(pspec)) { + #ifdef DEBUG +- printf( "vips_object_dispose_argument: " ); +- vips_object_print_name( object ); +- printf( ".%s\n", g_param_spec_get_name( pspec ) ); ++ printf("vips_object_dispose_argument: "); ++ vips_object_print_name(object); ++ printf(".%s\n", g_param_spec_get_name(pspec)); + #endif /*DEBUG*/ + +- g_object_set( object, +- g_param_spec_get_name( pspec ), NULL, +- NULL ); ++ g_object_set(object, ++ g_param_spec_get_name(pspec), NULL, ++ NULL); + } + +- return( NULL ); ++ return (NULL); + } + + /* Free all args on this object which may be holding resources. + * +- * Note that this is not the same as vips_object_unref_outputs(). That ++ * Note that this is not the same as vips_object_unref_outputs(). That + * looks for output objects which may have been created during _build() which +- * hold refs to this object and unrefs them. ++ * hold refs to this object and unrefs them. + * + * This function looks for objects which this object holds refs to and which + * may be holding sub-resources and zaps them. + */ + static void +-vips_argument_dispose_all( VipsObject *object ) ++vips_argument_dispose_all(VipsObject *object) + { + #ifdef DEBUG +- printf( "vips_argument_dispose_all: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_argument_dispose_all: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- vips_argument_map( object, vips_object_dispose_argument, NULL, NULL ); ++ vips_argument_map(object, vips_object_dispose_argument, NULL, NULL); + } + + /* Free any args which are holding memory. + */ + static void * +-vips_object_free_argument( VipsObject *object, GParamSpec *pspec, ++vips_object_free_argument(VipsObject *object, GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { +- g_assert( ((VipsArgument *) argument_class)->pspec == pspec ); +- g_assert( ((VipsArgument *) argument_instance)->pspec == pspec ); ++ g_assert(((VipsArgument *) argument_class)->pspec == pspec); ++ g_assert(((VipsArgument *) argument_instance)->pspec == pspec); + +- if( G_IS_PARAM_SPEC_STRING( pspec ) ) { ++ if (G_IS_PARAM_SPEC_STRING(pspec)) { + #ifdef DEBUG +- printf( "vips_object_free_argument: " ); +- vips_object_print_name( object ); +- printf( ".%s\n", g_param_spec_get_name( pspec ) ); ++ printf("vips_object_free_argument: "); ++ vips_object_print_name(object); ++ printf(".%s\n", g_param_spec_get_name(pspec)); + #endif /*DEBUG*/ + +- g_object_set( object, +- g_param_spec_get_name( pspec ), NULL, +- NULL ); ++ g_object_set(object, ++ g_param_spec_get_name(pspec), NULL, ++ NULL); + } + +- return( NULL ); ++ return (NULL); + } + + /* Free args which hold memory. Things like strings need to be freed right at + * the end in case anyone is still using them. + */ + static void +-vips_argument_free_all( VipsObject *object ) ++vips_argument_free_all(VipsObject *object) + { + #ifdef DEBUG +- printf( "vips_argument_free_all: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_argument_free_all: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- vips_argument_map( object, vips_object_free_argument, NULL, NULL ); ++ vips_argument_map(object, vips_object_free_argument, NULL, NULL); + } + + static void +-vips_object_dispose( GObject *gobject ) ++vips_object_dispose(GObject *gobject) + { +- VipsObject *object = VIPS_OBJECT( gobject ); ++ VipsObject *object = VIPS_OBJECT(gobject); + + #ifdef DEBUG +- printf( "vips_object_dispose: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_object_dispose: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + + /* Our subclasses should have already called this. Run it again, just + * in case. + */ + #ifdef DEBUG +- if( !object->preclose ) +- printf( "vips_object_dispose: pre-close missing!\n" ); ++ if (!object->preclose) ++ printf("vips_object_dispose: pre-close missing!\n"); + #endif /*DEBUG*/ +- vips_object_preclose( object ); ++ vips_object_preclose(object); + +- /* Clear all our arguments: they may be holding resources we should ++ /* Clear all our arguments: they may be holding resources we should + * drop. + */ +- vips_argument_dispose_all( object ); ++ vips_argument_dispose_all(object); + +- vips_object_close( object ); ++ vips_object_close(object); + +- vips_object_postclose( object ); ++ vips_object_postclose(object); + +- vips_argument_free_all( object ); ++ vips_argument_free_all(object); + +- VIPS_FREEF( vips_argument_table_destroy, object->argument_table ); ++ VIPS_FREEF(vips_argument_table_destroy, object->argument_table); + +- G_OBJECT_CLASS( vips_object_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_object_parent_class)->dispose(gobject); + } + + static void +-vips_object_finalize( GObject *gobject ) ++vips_object_finalize(GObject *gobject) + { +- VipsObject *object = VIPS_OBJECT( gobject ); ++ VipsObject *object = VIPS_OBJECT(gobject); + + #ifdef DEBUG +- printf( "vips_object_finalize: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_object_finalize: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + + /* I'd like to have post-close in here, but you can't emit signals + * from finalize, sadly. + */ + +- g_mutex_lock( vips__object_all_lock ); +- g_hash_table_remove( vips__object_all, object ); +- g_mutex_unlock( vips__object_all_lock ); ++ g_mutex_lock(vips__object_all_lock); ++ g_hash_table_remove(vips__object_all, object); ++ g_mutex_unlock(vips__object_all_lock); + +- G_OBJECT_CLASS( vips_object_parent_class )->finalize( gobject ); ++ G_OBJECT_CLASS(vips_object_parent_class)->finalize(gobject); + } + + static void +-vips_object_arg_invalidate( GObject *argument, +- VipsArgumentInstance *argument_instance ) ++vips_object_arg_invalidate(GObject *argument, ++ VipsArgumentInstance *argument_instance) + { + /* Image @argument has signalled "invalidate" ... resignal on our + * operation. + */ +- if( VIPS_IS_OPERATION( argument_instance->object ) ) +- vips_operation_invalidate( +- VIPS_OPERATION( argument_instance->object ) ); ++ if (VIPS_IS_OPERATION(argument_instance->object)) ++ vips_operation_invalidate( ++ VIPS_OPERATION(argument_instance->object)); + } + + static void +-vips_object_arg_close( GObject *argument, +- VipsArgumentInstance *argument_instance ) ++vips_object_arg_close(GObject *argument, ++ VipsArgumentInstance *argument_instance) + { + VipsObject *object = argument_instance->object; + GParamSpec *pspec = ((VipsArgument *) argument_instance)->pspec; +@@ -1075,81 +1079,81 @@ vips_object_arg_close( GObject *argument, + /* Argument had reffed us ... now it's being closed, so we NULL out + * the pointer to unref. + */ +- g_object_set( object, +- g_param_spec_get_name( pspec ), NULL, +- NULL ); ++ g_object_set(object, ++ g_param_spec_get_name(pspec), NULL, ++ NULL); + } + + /* Set a member to an object. Handle the ref counts and signal + * connect/disconnect. + */ + void +-vips__object_set_member( VipsObject *object, GParamSpec *pspec, +- GObject **member, GObject *argument ) ++vips__object_set_member(VipsObject *object, GParamSpec *pspec, ++ GObject **member, GObject *argument) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsArgumentClass *argument_class = (VipsArgumentClass *) +- vips__argument_table_lookup( class->argument_table, pspec ); ++ vips__argument_table_lookup(class->argument_table, pspec); + VipsArgumentInstance *argument_instance = +- vips__argument_get_instance( argument_class, object ); +- GType otype = G_PARAM_SPEC_VALUE_TYPE( pspec ); ++ vips__argument_get_instance(argument_class, object); ++ GType otype = G_PARAM_SPEC_VALUE_TYPE(pspec); + +- g_assert( argument_instance ); ++ g_assert(argument_instance); + +- vips_object_clear_member( argument_instance ); ++ vips_object_clear_member(argument_instance); + +- g_assert( !*member ); ++ g_assert(!*member); + *member = argument; + +- if( *member ) { +- if( argument_class->flags & VIPS_ARGUMENT_INPUT ) { ++ if (*member) { ++ if (argument_class->flags & VIPS_ARGUMENT_INPUT) { + #ifdef DEBUG_REF +- printf( "vips__object_set_member: vips object: " ); +- vips_object_print_name( object ); +- printf( " refers to gobject %s (%p)\n", +- G_OBJECT_TYPE_NAME( *member ), *member ); +- printf( " count up to %d\n", +- G_OBJECT( *member )->ref_count ); ++ printf("vips__object_set_member: vips object: "); ++ vips_object_print_name(object); ++ printf(" refers to gobject %s (%p)\n", ++ G_OBJECT_TYPE_NAME(*member), *member); ++ printf(" count up to %d\n", ++ G_OBJECT(*member)->ref_count); + #endif /*DEBUG_REF*/ + + /* Ref the argument. + */ +- g_object_ref( *member ); ++ g_object_ref(*member); + } +- else if( argument_class->flags & VIPS_ARGUMENT_OUTPUT ) { ++ else if (argument_class->flags & VIPS_ARGUMENT_OUTPUT) { + #ifdef DEBUG_REF +- printf( "vips__object_set_member: gobject %s (%p)\n", +- G_OBJECT_TYPE_NAME( *member ), *member ); +- printf( " refers to vips object: " ); +- vips_object_print_name( object ); +- printf( " count up to %d\n", +- G_OBJECT (object)->ref_count ); ++ printf("vips__object_set_member: gobject %s (%p)\n", ++ G_OBJECT_TYPE_NAME(*member), *member); ++ printf(" refers to vips object: "); ++ vips_object_print_name(object); ++ printf(" count up to %d\n", ++ G_OBJECT(object)->ref_count); + #endif /*DEBUG_REF*/ + + /* The argument reffs us. + */ +- g_object_ref( object ); ++ g_object_ref(object); + } + } + +- if( *member && +- g_type_is_a( otype, VIPS_TYPE_IMAGE ) ) { +- if( argument_class->flags & VIPS_ARGUMENT_INPUT ) { +- g_assert( !argument_instance->invalidate_id ); ++ if (*member && ++ g_type_is_a(otype, VIPS_TYPE_IMAGE)) { ++ if (argument_class->flags & VIPS_ARGUMENT_INPUT) { ++ g_assert(!argument_instance->invalidate_id); + + argument_instance->invalidate_id = +- g_signal_connect( *member, "invalidate", +- G_CALLBACK( +- vips_object_arg_invalidate ), +- argument_instance ); ++ g_signal_connect(*member, "invalidate", ++ G_CALLBACK( ++ vips_object_arg_invalidate), ++ argument_instance); + } +- else if( argument_class->flags & VIPS_ARGUMENT_OUTPUT ) { +- g_assert( !argument_instance->close_id ); ++ else if (argument_class->flags & VIPS_ARGUMENT_OUTPUT) { ++ g_assert(!argument_instance->close_id); + + argument_instance->close_id = +- g_signal_connect( *member, "close", +- G_CALLBACK( vips_object_arg_close ), +- argument_instance ); ++ g_signal_connect(*member, "close", ++ G_CALLBACK(vips_object_arg_close), ++ argument_instance); + } + } + } +@@ -1159,165 +1163,165 @@ vips__object_set_member( VipsObject *object, GParamSpec *pspec, + * are detected in set and get. + */ + gboolean +-vips_value_is_null( GParamSpec *pspec, const GValue *value ) ++vips_value_is_null(GParamSpec *pspec, const GValue *value) + { +- if( G_IS_PARAM_SPEC_STRING( pspec ) && +- !g_value_get_string( value ) ) +- return( TRUE ); +- if( G_IS_PARAM_SPEC_OBJECT( pspec ) && +- !g_value_get_object( value ) ) +- return( TRUE ); +- if( G_IS_PARAM_SPEC_POINTER( pspec ) && +- !g_value_get_pointer( value ) ) +- return( TRUE ); +- if( G_IS_PARAM_SPEC_BOXED( pspec ) && +- !g_value_get_boxed( value ) ) +- return( TRUE ); ++ if (G_IS_PARAM_SPEC_STRING(pspec) && ++ !g_value_get_string(value)) ++ return (TRUE); ++ if (G_IS_PARAM_SPEC_OBJECT(pspec) && ++ !g_value_get_object(value)) ++ return (TRUE); ++ if (G_IS_PARAM_SPEC_POINTER(pspec) && ++ !g_value_get_pointer(value)) ++ return (TRUE); ++ if (G_IS_PARAM_SPEC_BOXED(pspec) && ++ !g_value_get_boxed(value)) ++ return (TRUE); + +- return( FALSE ); ++ return (FALSE); + } + + /* Also used by subclasses, so not static. + */ + void +-vips_object_set_property( GObject *gobject, +- guint property_id, const GValue *value, GParamSpec *pspec ) ++vips_object_set_property(GObject *gobject, ++ guint property_id, const GValue *value, GParamSpec *pspec) + { +- VipsObject *object = VIPS_OBJECT( gobject ); +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( gobject ); ++ VipsObject *object = VIPS_OBJECT(gobject); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(gobject); + VipsArgumentClass *argument_class = (VipsArgumentClass *) +- vips__argument_table_lookup( class->argument_table, pspec ); ++ vips__argument_table_lookup(class->argument_table, pspec); + VipsArgumentInstance *argument_instance = +- vips__argument_get_instance( argument_class, object ); ++ vips__argument_get_instance(argument_class, object); + +- g_assert( argument_instance ); ++ g_assert(argument_instance); + + #ifdef DEBUG +- printf( "vips_object_set_property: " ); +- vips_object_print_name( object ); +- printf( ".%s\n", g_param_spec_get_name( pspec ) ); ++ printf("vips_object_set_property: "); ++ vips_object_print_name(object); ++ printf(".%s\n", g_param_spec_get_name(pspec)); + + /* This can crash horribly with some values, have it as a separate + * chunk so we can easily comment it out. + */ +-{ +- char *str_value; ++ { ++ char *str_value; + +- str_value = g_strdup_value_contents( value ); +- printf( "\t%s\n", str_value ); +- g_free( str_value ); +-} ++ str_value = g_strdup_value_contents(value); ++ printf("\t%s\n", str_value); ++ g_free(str_value); ++ } + #endif /*DEBUG*/ + +- g_assert( ((VipsArgument *) argument_class)->pspec == pspec ); +- g_assert( ((VipsArgument *) argument_instance)->pspec == pspec ); ++ g_assert(((VipsArgument *) argument_class)->pspec == pspec); ++ g_assert(((VipsArgument *) argument_instance)->pspec == pspec); + + /* If this is a construct-only argument, we can only set before we've + * built. + */ +- if( argument_class->flags & VIPS_ARGUMENT_CONSTRUCT && ++ if (argument_class->flags & VIPS_ARGUMENT_CONSTRUCT && + object->constructed && +- !vips_value_is_null( pspec, value ) ) { +- g_warning( "%s: %s can't assign '%s' after construct", ++ !vips_value_is_null(pspec, value)) { ++ g_warning("%s: %s can't assign '%s' after construct", + G_STRLOC, +- G_OBJECT_TYPE_NAME( gobject ), +- g_param_spec_get_name( pspec ) ); ++ G_OBJECT_TYPE_NAME(gobject), ++ g_param_spec_get_name(pspec)); + return; + } + + /* If this is a set-once argument, check we've not set it before. + */ +- if( argument_class->flags & VIPS_ARGUMENT_SET_ONCE && ++ if (argument_class->flags & VIPS_ARGUMENT_SET_ONCE && + argument_instance->assigned && +- !vips_value_is_null( pspec, value ) ) { +- g_warning( "%s: %s can only assign '%s' once", ++ !vips_value_is_null(pspec, value)) { ++ g_warning("%s: %s can only assign '%s' once", + G_STRLOC, +- G_OBJECT_TYPE_NAME( gobject ), +- g_param_spec_get_name( pspec ) ); ++ G_OBJECT_TYPE_NAME(gobject), ++ g_param_spec_get_name(pspec)); + return; + } + + /* We can't use a switch since some param specs don't have fundamental + * types and are hence not compile-time constants, argh. + */ +- if( G_IS_PARAM_SPEC_STRING( pspec ) ) { +- char **member = &G_STRUCT_MEMBER( char *, object, +- argument_class->offset ); ++ if (G_IS_PARAM_SPEC_STRING(pspec)) { ++ char **member = &G_STRUCT_MEMBER(char *, object, ++ argument_class->offset); + +- if( *member ) +- g_free( *member ); +- *member = g_value_dup_string( value ); ++ if (*member) ++ g_free(*member); ++ *member = g_value_dup_string(value); + } +- else if( G_IS_PARAM_SPEC_OBJECT( pspec ) ) { +- GObject **member = &G_STRUCT_MEMBER( GObject *, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_OBJECT(pspec)) { ++ GObject **member = &G_STRUCT_MEMBER(GObject *, object, ++ argument_class->offset); + +- vips__object_set_member( object, pspec, member, +- g_value_get_object( value ) ); ++ vips__object_set_member(object, pspec, member, ++ g_value_get_object(value)); + } +- else if( G_IS_PARAM_SPEC_INT( pspec ) ) { +- int *member = &G_STRUCT_MEMBER( int, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_INT(pspec)) { ++ int *member = &G_STRUCT_MEMBER(int, object, ++ argument_class->offset); + +- *member = g_value_get_int( value ); ++ *member = g_value_get_int(value); + } +- else if( G_IS_PARAM_SPEC_UINT64( pspec ) ) { +- guint64 *member = &G_STRUCT_MEMBER( guint64, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_UINT64(pspec)) { ++ guint64 *member = &G_STRUCT_MEMBER(guint64, object, ++ argument_class->offset); + +- *member = g_value_get_uint64( value ); ++ *member = g_value_get_uint64(value); + } +- else if( G_IS_PARAM_SPEC_BOOLEAN( pspec ) ) { +- gboolean *member = &G_STRUCT_MEMBER( gboolean, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_BOOLEAN(pspec)) { ++ gboolean *member = &G_STRUCT_MEMBER(gboolean, object, ++ argument_class->offset); + +- *member = g_value_get_boolean( value ); ++ *member = g_value_get_boolean(value); + } +- else if( G_IS_PARAM_SPEC_ENUM( pspec ) ) { +- int *member = &G_STRUCT_MEMBER( int, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_ENUM(pspec)) { ++ int *member = &G_STRUCT_MEMBER(int, object, ++ argument_class->offset); + +- *member = g_value_get_enum( value ); ++ *member = g_value_get_enum(value); + } +- else if( G_IS_PARAM_SPEC_FLAGS( pspec ) ) { +- int *member = &G_STRUCT_MEMBER( int, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_FLAGS(pspec)) { ++ int *member = &G_STRUCT_MEMBER(int, object, ++ argument_class->offset); + +- *member = g_value_get_flags( value ); ++ *member = g_value_get_flags(value); + } +- else if( G_IS_PARAM_SPEC_POINTER( pspec ) ) { +- gpointer *member = &G_STRUCT_MEMBER( gpointer, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_POINTER(pspec)) { ++ gpointer *member = &G_STRUCT_MEMBER(gpointer, object, ++ argument_class->offset); + +- *member = g_value_get_pointer( value ); ++ *member = g_value_get_pointer(value); + } +- else if( G_IS_PARAM_SPEC_DOUBLE( pspec ) ) { +- double *member = &G_STRUCT_MEMBER( double, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_DOUBLE(pspec)) { ++ double *member = &G_STRUCT_MEMBER(double, object, ++ argument_class->offset); + +- *member = g_value_get_double( value ); ++ *member = g_value_get_double(value); + } +- else if( G_IS_PARAM_SPEC_BOXED( pspec ) ) { +- gpointer *member = &G_STRUCT_MEMBER( gpointer, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_BOXED(pspec)) { ++ gpointer *member = &G_STRUCT_MEMBER(gpointer, object, ++ argument_class->offset); + +- if( *member ) { +- g_boxed_free( G_PARAM_SPEC_VALUE_TYPE( pspec ), +- *member ); ++ if (*member) { ++ g_boxed_free(G_PARAM_SPEC_VALUE_TYPE(pspec), ++ *member); + *member = NULL; + } + + /* Copy the boxed into our pointer (will use eg. + * vips__object_vector_dup()). + */ +- *member = g_value_dup_boxed( value ); ++ *member = g_value_dup_boxed(value); + } + else { +- g_warning( "%s: %s.%s unimplemented property type %s", ++ g_warning("%s: %s.%s unimplemented property type %s", + G_STRLOC, +- G_OBJECT_TYPE_NAME( gobject ), +- g_param_spec_get_name( pspec ), +- g_type_name( G_PARAM_SPEC_VALUE_TYPE( pspec ) ) ); ++ G_OBJECT_TYPE_NAME(gobject), ++ g_param_spec_get_name(pspec), ++ g_type_name(G_PARAM_SPEC_VALUE_TYPE(pspec))); + } + + /* Note that it's now been set. +@@ -1328,104 +1332,104 @@ vips_object_set_property( GObject *gobject, + /* Also used by subclasses, so not static. + */ + void +-vips_object_get_property( GObject *gobject, +- guint property_id, GValue *value, GParamSpec *pspec ) ++vips_object_get_property(GObject *gobject, ++ guint property_id, GValue *value, GParamSpec *pspec) + { +- VipsObject *object = VIPS_OBJECT( gobject ); +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( gobject ); ++ VipsObject *object = VIPS_OBJECT(gobject); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(gobject); + VipsArgumentClass *argument_class = (VipsArgumentClass *) +- vips__argument_table_lookup( class->argument_table, pspec ); ++ vips__argument_table_lookup(class->argument_table, pspec); + VipsArgumentInstance *argument_instance = +- vips__argument_get_instance( argument_class, object ); ++ vips__argument_get_instance(argument_class, object); + +- g_assert( ((VipsArgument *) argument_class)->pspec == pspec ); ++ g_assert(((VipsArgument *) argument_class)->pspec == pspec); + +- if( !argument_instance->assigned ) { ++ if (!argument_instance->assigned) { + /* Set the value to the default. Things like Ruby + * gobject-introspection will walk objects during GC, and we + * can find ourselves fetching object values between init and + * build. + */ +- g_param_value_set_default( pspec, value ); ++ g_param_value_set_default(pspec, value); + return; + } + +- if( G_IS_PARAM_SPEC_STRING( pspec ) ) { +- char *member = G_STRUCT_MEMBER( char *, object, +- argument_class->offset ); ++ if (G_IS_PARAM_SPEC_STRING(pspec)) { ++ char *member = G_STRUCT_MEMBER(char *, object, ++ argument_class->offset); + +- g_value_set_string( value, member ); ++ g_value_set_string(value, member); + } +- else if( G_IS_PARAM_SPEC_OBJECT( pspec ) ) { +- GObject **member = &G_STRUCT_MEMBER( GObject *, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_OBJECT(pspec)) { ++ GObject **member = &G_STRUCT_MEMBER(GObject *, object, ++ argument_class->offset); + +- g_value_set_object( value, *member ); ++ g_value_set_object(value, *member); + } +- else if( G_IS_PARAM_SPEC_INT( pspec ) ) { +- int *member = &G_STRUCT_MEMBER( int, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_INT(pspec)) { ++ int *member = &G_STRUCT_MEMBER(int, object, ++ argument_class->offset); + +- g_value_set_int( value, *member ); ++ g_value_set_int(value, *member); + } +- else if( G_IS_PARAM_SPEC_UINT64( pspec ) ) { +- guint64 *member = &G_STRUCT_MEMBER( guint64, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_UINT64(pspec)) { ++ guint64 *member = &G_STRUCT_MEMBER(guint64, object, ++ argument_class->offset); + +- g_value_set_uint64( value, *member ); ++ g_value_set_uint64(value, *member); + } +- else if( G_IS_PARAM_SPEC_BOOLEAN( pspec ) ) { +- gboolean *member = &G_STRUCT_MEMBER( gboolean, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_BOOLEAN(pspec)) { ++ gboolean *member = &G_STRUCT_MEMBER(gboolean, object, ++ argument_class->offset); + +- g_value_set_boolean( value, *member ); ++ g_value_set_boolean(value, *member); + } +- else if( G_IS_PARAM_SPEC_ENUM( pspec ) ) { +- int *member = &G_STRUCT_MEMBER( int, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_ENUM(pspec)) { ++ int *member = &G_STRUCT_MEMBER(int, object, ++ argument_class->offset); + +- g_value_set_enum( value, *member ); ++ g_value_set_enum(value, *member); + } +- else if( G_IS_PARAM_SPEC_FLAGS( pspec ) ) { +- int *member = &G_STRUCT_MEMBER( int, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_FLAGS(pspec)) { ++ int *member = &G_STRUCT_MEMBER(int, object, ++ argument_class->offset); + +- g_value_set_flags( value, *member ); ++ g_value_set_flags(value, *member); + } +- else if( G_IS_PARAM_SPEC_POINTER( pspec ) ) { +- gpointer *member = &G_STRUCT_MEMBER( gpointer, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_POINTER(pspec)) { ++ gpointer *member = &G_STRUCT_MEMBER(gpointer, object, ++ argument_class->offset); + +- g_value_set_pointer( value, *member ); ++ g_value_set_pointer(value, *member); + } +- else if( G_IS_PARAM_SPEC_DOUBLE( pspec ) ) { +- double *member = &G_STRUCT_MEMBER( double, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_DOUBLE(pspec)) { ++ double *member = &G_STRUCT_MEMBER(double, object, ++ argument_class->offset); + +- g_value_set_double( value, *member ); ++ g_value_set_double(value, *member); + } +- else if( G_IS_PARAM_SPEC_BOXED( pspec ) ) { +- gpointer *member = &G_STRUCT_MEMBER( gpointer, object, +- argument_class->offset ); ++ else if (G_IS_PARAM_SPEC_BOXED(pspec)) { ++ gpointer *member = &G_STRUCT_MEMBER(gpointer, object, ++ argument_class->offset); + + /* Copy the boxed into our pointer (will use eg. + * vips__object_vector_dup ()). + */ +- g_value_set_boxed( value, *member ); ++ g_value_set_boxed(value, *member); + } + else { +- g_warning( "%s: %s.%s unimplemented property type %s", ++ g_warning("%s: %s.%s unimplemented property type %s", + G_STRLOC, +- G_OBJECT_TYPE_NAME( gobject ), +- g_param_spec_get_name( pspec ), +- g_type_name( G_PARAM_SPEC_VALUE_TYPE( pspec ) ) ); ++ G_OBJECT_TYPE_NAME(gobject), ++ g_param_spec_get_name(pspec), ++ g_type_name(G_PARAM_SPEC_VALUE_TYPE(pspec))); + } + } + + static int +-vips_object_real_build( VipsObject *object ) ++vips_object_real_build(VipsObject *object) + { +- VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS(object); + + /* Only test input args, output ones can be set by our subclasses as + * they build. See vips_object_build() above. +@@ -1435,87 +1439,87 @@ vips_object_real_build( VipsObject *object ) + int result; + + #ifdef DEBUG +- printf( "vips_object_real_build: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_object_real_build: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- g_assert( !object->constructed ); ++ g_assert(!object->constructed); + + /* It'd be nice if this just copied a pointer rather than did a + * strdup(). Set these here rather than in object_init, so that the + * class gets a chance to set them. + */ +- g_object_set( object, ++ g_object_set(object, + "nickname", object_class->nickname, +- "description", object_class->description, NULL ); ++ "description", object_class->description, NULL); + +- /* Check all required input arguments have been supplied, don't stop ++ /* Check all required input arguments have been supplied, don't stop + * on 1st error. + */ + result = 0; +- (void) vips_argument_map( object, +- vips_object_check_required, &result, &iomask ); ++ (void) vips_argument_map(object, ++ vips_object_check_required, &result, &iomask); + +- return( result ); ++ return (result); + } + + static int +-vips_object_real_postbuild( VipsObject *object, void *data ) ++vips_object_real_postbuild(VipsObject *object, void *data) + { + #ifdef DEBUG +- printf( "vips_object_real_postbuild: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_object_real_postbuild: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- g_assert( object->constructed ); ++ g_assert(object->constructed); + +- return( 0 ); ++ return (0); + } + + static void +-vips_object_real_summary_class( VipsObjectClass *class, VipsBuf *buf ) ++vips_object_real_summary_class(VipsObjectClass *class, VipsBuf *buf) + { +- vips_buf_appendf( buf, "%s", G_OBJECT_CLASS_NAME( class ) ); +- if( class->nickname ) +- vips_buf_appendf( buf, " (%s)", class->nickname ); +- if( class->description ) +- vips_buf_appendf( buf, ", %s", class->description ); ++ vips_buf_appendf(buf, "%s", G_OBJECT_CLASS_NAME(class)); ++ if (class->nickname) ++ vips_buf_appendf(buf, " (%s)", class->nickname); ++ if (class->description) ++ vips_buf_appendf(buf, ", %s", class->description); + } + + static void +-vips_object_real_summary( VipsObject *object, VipsBuf *buf ) ++vips_object_real_summary(VipsObject *object, VipsBuf *buf) + { + } + + static void +-vips_object_real_dump( VipsObject *object, VipsBuf *buf ) ++vips_object_real_dump(VipsObject *object, VipsBuf *buf) + { +- vips_buf_appendf( buf, " %s (%p) count=%d", +- G_OBJECT_TYPE_NAME( object ), +- object, +- G_OBJECT( object )->ref_count ); ++ vips_buf_appendf(buf, " %s (%p) count=%d", ++ G_OBJECT_TYPE_NAME(object), ++ object, ++ G_OBJECT(object)->ref_count); + +- if( object->local_memory ) +- vips_buf_appendf( buf, " %zd bytes", object->local_memory ); ++ if (object->local_memory) ++ vips_buf_appendf(buf, " %zd bytes", object->local_memory); + } + + static void +-vips_object_real_sanity( VipsObject *object, VipsBuf *buf ) ++vips_object_real_sanity(VipsObject *object, VipsBuf *buf) + { + } + + static void +-vips_object_real_rewind( VipsObject *object ) ++vips_object_real_rewind(VipsObject *object) + { + #ifdef DEBUG +- printf( "vips_object_real_rewind\n" ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_object_real_rewind\n"); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- g_object_run_dispose( G_OBJECT( object ) ); ++ g_object_run_dispose(G_OBJECT(object)); + + object->constructed = FALSE; + object->preclose = FALSE; +@@ -1524,7 +1528,7 @@ vips_object_real_rewind( VipsObject *object ) + } + + static VipsObject * +-vips_object_real_new_from_string( const char *string ) ++vips_object_real_new_from_string(const char *string) + { + GType type; + +@@ -1532,44 +1536,44 @@ vips_object_real_new_from_string( const char *string ) + + /* The main arg selects the subclass. + */ +- if( !(type = vips_type_find( NULL, string )) ) { +- vips_error( "VipsObject", +- _( "class \"%s\" not found" ), string ); +- return( NULL ); ++ if (!(type = vips_type_find(NULL, string))) { ++ vips_error("VipsObject", ++ _("class \"%s\" not found"), string); ++ return (NULL); + } + +- return( VIPS_OBJECT( g_object_new( type, NULL ) ) ); ++ return (VIPS_OBJECT(g_object_new(type, NULL))); + } + +-static void +-vips_object_real_to_string( VipsObject *object, VipsBuf *buf ) ++static void ++vips_object_real_to_string(VipsObject *object, VipsBuf *buf) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + + /* Just "bicubic" or whatever. + */ +- vips_buf_appends( buf, class->nickname ); ++ vips_buf_appends(buf, class->nickname); + } + + static void +-transform_string_double( const GValue *src_value, GValue *dest_value ) ++transform_string_double(const GValue *src_value, GValue *dest_value) + { +- g_value_set_double( dest_value, +- g_ascii_strtod( g_value_get_string( src_value ), NULL ) ); ++ g_value_set_double(dest_value, ++ g_ascii_strtod(g_value_get_string(src_value), NULL)); + } + + static void +-vips_object_class_init( VipsObjectClass *class ) ++vips_object_class_init(VipsObjectClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + + /* We must have threads set up before we can process. + */ + vips_check_init(); + +- if( !vips__object_all ) { +- vips__object_all = g_hash_table_new( +- g_direct_hash, g_direct_equal ); ++ if (!vips__object_all) { ++ vips__object_all = g_hash_table_new( ++ g_direct_hash, g_direct_equal); + vips__object_all_lock = vips_g_mutex_new(); + } + +@@ -1588,47 +1592,47 @@ vips_object_class_init( VipsObjectClass *class ) + class->new_from_string = vips_object_real_new_from_string; + class->to_string = vips_object_real_to_string; + class->nickname = "object"; +- class->description = _( "base class" ); ++ class->description = _("base class"); + + /* Table of VipsArgumentClass ... we can just g_free() them. + */ + class->argument_table = g_hash_table_new_full( +- g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) g_free ); ++ g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) g_free); + class->argument_table_traverse = NULL; + + /* For setting double arguments from the command-line. + */ +- g_value_register_transform_func( G_TYPE_STRING, G_TYPE_DOUBLE, +- transform_string_double ); ++ g_value_register_transform_func(G_TYPE_STRING, G_TYPE_DOUBLE, ++ transform_string_double); + +- VIPS_ARG_STRING( class, "nickname", 1, +- _( "Nickname" ), +- _( "Class nickname" ), ++ VIPS_ARG_STRING(class, "nickname", 1, ++ _("Nickname"), ++ _("Class nickname"), + VIPS_ARGUMENT_SET_ONCE, +- G_STRUCT_OFFSET( VipsObject, nickname ), +- "" ); ++ G_STRUCT_OFFSET(VipsObject, nickname), ++ ""); + +- VIPS_ARG_STRING( class, "description", 2, +- _( "Description" ), +- _( "Class description" ), ++ VIPS_ARG_STRING(class, "description", 2, ++ _("Description"), ++ _("Class description"), + VIPS_ARGUMENT_SET_ONCE, +- G_STRUCT_OFFSET( VipsObject, description ), +- "" ); ++ G_STRUCT_OFFSET(VipsObject, description), ++ ""); + + /** + * VipsObject::postbuild: + * @object: the object that has been built + * + * The ::postbuild signal is emitted once just after successful object +- * construction. Return non-zero to cause object construction to fail. ++ * construction. Return non-zero to cause object construction to fail. + */ +- vips_object_signals[SIG_POSTBUILD] = g_signal_new( "postbuild", +- G_TYPE_FROM_CLASS( class ), ++ vips_object_signals[SIG_POSTBUILD] = g_signal_new("postbuild", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_RUN_LAST, +- G_STRUCT_OFFSET( VipsObjectClass, postbuild ), ++ G_STRUCT_OFFSET(VipsObjectClass, postbuild), + NULL, NULL, + vips_INT__VOID, +- G_TYPE_INT, 0 ); ++ G_TYPE_INT, 0); + + /** + * VipsObject::preclose: +@@ -1637,114 +1641,113 @@ vips_object_class_init( VipsObjectClass *class ) + * The ::preclose signal is emitted once just before object close + * starts. The oject is still alive. + */ +- vips_object_signals[SIG_PRECLOSE] = g_signal_new( "preclose", +- G_TYPE_FROM_CLASS( class ), ++ vips_object_signals[SIG_PRECLOSE] = g_signal_new("preclose", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_RUN_LAST, +- G_STRUCT_OFFSET( VipsObjectClass, preclose ), ++ G_STRUCT_OFFSET(VipsObjectClass, preclose), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, +- G_TYPE_NONE, 0 ); ++ G_TYPE_NONE, 0); + + /** + * VipsObject::close: + * @object: the object that is closing + * + * The ::close signal is emitted once during object close. The object +- * is dying and may not work. ++ * is dying and may not work. + */ +- vips_object_signals[SIG_CLOSE] = g_signal_new( "close", +- G_TYPE_FROM_CLASS( class ), ++ vips_object_signals[SIG_CLOSE] = g_signal_new("close", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_RUN_LAST, +- G_STRUCT_OFFSET( VipsObjectClass, close ), ++ G_STRUCT_OFFSET(VipsObjectClass, close), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, +- G_TYPE_NONE, 0 ); ++ G_TYPE_NONE, 0); + + /** + * VipsObject::postclose: + * @object: the object that has closed + * +- * The ::postclose signal is emitted once after object close. The +- * object pointer is still valid, but nothing else. ++ * The ::postclose signal is emitted once after object close. The ++ * object pointer is still valid, but nothing else. + */ +- vips_object_signals[SIG_POSTCLOSE] = g_signal_new( "postclose", +- G_TYPE_FROM_CLASS( class ), ++ vips_object_signals[SIG_POSTCLOSE] = g_signal_new("postclose", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_RUN_LAST, +- G_STRUCT_OFFSET( VipsObjectClass, postclose ), ++ G_STRUCT_OFFSET(VipsObjectClass, postclose), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, +- G_TYPE_NONE, 0 ); +- ++ G_TYPE_NONE, 0); + } + + static void +-vips_object_init( VipsObject *object ) ++vips_object_init(VipsObject *object) + { + #ifdef DEBUG +- printf( "vips_object_init: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_object_init: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- g_mutex_lock( vips__object_all_lock ); +- g_hash_table_insert( vips__object_all, object, object ); +- g_mutex_unlock( vips__object_all_lock ); ++ g_mutex_lock(vips__object_all_lock); ++ g_hash_table_insert(vips__object_all, object, object); ++ g_mutex_unlock(vips__object_all_lock); + } + + static void * +-traverse_find_required_priority( void *data, void *a, void *b ) ++traverse_find_required_priority(void *data, void *a, void *b) + { + VipsArgumentClass *argument_class = (VipsArgumentClass *) data; +- int priority = GPOINTER_TO_INT( a ); ++ int priority = GPOINTER_TO_INT(a); + +- if( (argument_class->flags & VIPS_ARGUMENT_REQUIRED) && +- !(argument_class->flags & VIPS_ARGUMENT_DEPRECATED) && +- argument_class->priority == priority ) +- return( argument_class ); +- +- return( NULL ); ++ if ((argument_class->flags & VIPS_ARGUMENT_REQUIRED) && ++ !(argument_class->flags & VIPS_ARGUMENT_DEPRECATED) && ++ argument_class->priority == priority) ++ return (argument_class); ++ ++ return (NULL); + } + + static gint +-traverse_sort( gconstpointer a, gconstpointer b, void *user_data ) ++traverse_sort(gconstpointer a, gconstpointer b, void *user_data) + { + VipsArgumentClass *class1 = (VipsArgumentClass *) a; + VipsArgumentClass *class2 = (VipsArgumentClass *) b; + +- return( class1->priority - class2->priority ); ++ return (class1->priority - class2->priority); + } + + /* Add a vipsargument ... automate some stuff with this. + */ + void +-vips_object_class_install_argument( VipsObjectClass *object_class, +- GParamSpec *pspec, VipsArgumentFlags flags, int priority, guint offset ) ++vips_object_class_install_argument(VipsObjectClass *object_class, ++ GParamSpec *pspec, VipsArgumentFlags flags, int priority, guint offset) + { +- VipsArgumentClass *argument_class = g_new( VipsArgumentClass, 1 ); ++ VipsArgumentClass *argument_class = g_new(VipsArgumentClass, 1); + + GSList *argument_table_traverse; + VipsArgumentClass *ac; + + #ifdef DEBUG +- printf( "vips_object_class_install_argument: %p %s %s\n", ++ printf("vips_object_class_install_argument: %p %s %s\n", + object_class, +- g_type_name( G_TYPE_FROM_CLASS( object_class ) ), +- g_param_spec_get_name( pspec ) ); ++ g_type_name(G_TYPE_FROM_CLASS(object_class)), ++ g_param_spec_get_name(pspec)); + #endif /*DEBUG*/ + + /* object_class->argument* is shared, so we must lock. + */ +- g_mutex_lock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); + + /* Must be a new one. + */ +- g_assert( !g_hash_table_lookup( object_class->argument_table, pspec ) ); ++ g_assert(!g_hash_table_lookup(object_class->argument_table, pspec)); + + /* Mustn't have INPUT and OUTPUT both set. + */ +- g_assert( !( ++ g_assert(!( + (flags & VIPS_ARGUMENT_INPUT) && +- (flags & VIPS_ARGUMENT_OUTPUT)) ); ++ (flags & VIPS_ARGUMENT_OUTPUT))); + + ((VipsArgument *) argument_class)->pspec = pspec; + argument_class->object_class = object_class; +@@ -1752,121 +1755,121 @@ vips_object_class_install_argument( VipsObjectClass *object_class, + argument_class->priority = priority; + argument_class->offset = offset; + +- vips_argument_table_replace( object_class->argument_table, +- (VipsArgument *) argument_class ); ++ vips_argument_table_replace(object_class->argument_table, ++ (VipsArgument *) argument_class); + + /* If this is the first argument for a new subclass, we need to clone + * the traverse list we inherit. + */ +- if( object_class->argument_table_traverse_gtype != +- G_TYPE_FROM_CLASS( object_class ) ) { ++ if (object_class->argument_table_traverse_gtype != ++ G_TYPE_FROM_CLASS(object_class)) { + #ifdef DEBUG +- printf( "vips_object_class_install_argument: " +- "cloning traverse\n" ); ++ printf("vips_object_class_install_argument: " ++ "cloning traverse\n"); + #endif /*DEBUG*/ + +- object_class->argument_table_traverse = +- g_slist_copy( object_class->argument_table_traverse ); +- object_class->argument_table_traverse_gtype = +- G_TYPE_FROM_CLASS( object_class ); ++ object_class->argument_table_traverse = ++ g_slist_copy(object_class->argument_table_traverse); ++ object_class->argument_table_traverse_gtype = ++ G_TYPE_FROM_CLASS(object_class); + } + +- /* We read argument_table_traverse without a lock (eg. see ++ /* We read argument_table_traverse without a lock (eg. see + * vips_argument_map()), so we must be very careful updating it. + */ +- argument_table_traverse = +- g_slist_copy( object_class->argument_table_traverse ); ++ argument_table_traverse = ++ g_slist_copy(object_class->argument_table_traverse); + + /* We keep traverse sorted by priority, so we musn't have duplicate +- * priority values in required args. ++ * priority values in required args. + */ +- if( (flags & VIPS_ARGUMENT_REQUIRED) && +- !(flags & VIPS_ARGUMENT_DEPRECATED) && +- (ac = vips_slist_map2( argument_table_traverse, +- traverse_find_required_priority, +- GINT_TO_POINTER( priority ), NULL )) ) +- g_warning( "vips_object_class_install_argument: " +- "%s.%s, %s.%s duplicate priority", +- g_type_name( G_TYPE_FROM_CLASS( object_class ) ), +- g_param_spec_get_name( pspec ), +- g_type_name( G_TYPE_FROM_CLASS( ac->object_class ) ), +- g_param_spec_get_name( ((VipsArgument *) ac)->pspec ) ); ++ if ((flags & VIPS_ARGUMENT_REQUIRED) && ++ !(flags & VIPS_ARGUMENT_DEPRECATED) && ++ (ac = vips_slist_map2(argument_table_traverse, ++ traverse_find_required_priority, ++ GINT_TO_POINTER(priority), NULL))) ++ g_warning("vips_object_class_install_argument: " ++ "%s.%s, %s.%s duplicate priority", ++ g_type_name(G_TYPE_FROM_CLASS(object_class)), ++ g_param_spec_get_name(pspec), ++ g_type_name(G_TYPE_FROM_CLASS(ac->object_class)), ++ g_param_spec_get_name(((VipsArgument *) ac)->pspec)); + + /* Warn about optional boolean args which default TRUE. These won't + * work from the CLI, since simple GOption switches don't allow + * `=false`. + */ +- if( !(flags & VIPS_ARGUMENT_REQUIRED) && +- !(flags & VIPS_ARGUMENT_DEPRECATED) && +- G_IS_PARAM_SPEC_BOOLEAN( pspec ) && +- G_PARAM_SPEC_BOOLEAN( pspec )->default_value ) +- g_warning( "vips_object_class_install_argument: " +- "default TRUE BOOL arg %s.%s", +- g_type_name( G_TYPE_FROM_CLASS( object_class ) ), +- g_param_spec_get_name( pspec ) ); ++ if (!(flags & VIPS_ARGUMENT_REQUIRED) && ++ !(flags & VIPS_ARGUMENT_DEPRECATED) && ++ G_IS_PARAM_SPEC_BOOLEAN(pspec) && ++ G_PARAM_SPEC_BOOLEAN(pspec)->default_value) ++ g_warning("vips_object_class_install_argument: " ++ "default TRUE BOOL arg %s.%s", ++ g_type_name(G_TYPE_FROM_CLASS(object_class)), ++ g_param_spec_get_name(pspec)); + + argument_table_traverse = g_slist_prepend( +- argument_table_traverse, argument_class ); ++ argument_table_traverse, argument_class); + argument_table_traverse = g_slist_sort( +- argument_table_traverse, (GCompareFunc) traverse_sort ); +- VIPS_SWAP( GSList *, +- argument_table_traverse, +- object_class->argument_table_traverse ); ++ argument_table_traverse, (GCompareFunc) traverse_sort); ++ VIPS_SWAP(GSList *, ++ argument_table_traverse, ++ object_class->argument_table_traverse); + +- g_slist_free( argument_table_traverse ); ++ g_slist_free(argument_table_traverse); + + #ifdef DEBUG +-{ +- GSList *p; +- +- printf( "%d items on traverse %p\n", +- g_slist_length( object_class->argument_table_traverse ), +- &object_class->argument_table_traverse ); +- for( p = object_class->argument_table_traverse; p; p = p->next ) { +- VipsArgumentClass *argument_class = +- (VipsArgumentClass *) p->data; +- +- printf( "\t%p %s\n", +- argument_class, +- g_param_spec_get_name( +- ((VipsArgument *) argument_class)->pspec ) ); ++ { ++ GSList *p; ++ ++ printf("%d items on traverse %p\n", ++ g_slist_length(object_class->argument_table_traverse), ++ &object_class->argument_table_traverse); ++ for (p = object_class->argument_table_traverse; p; p = p->next) { ++ VipsArgumentClass *argument_class = ++ (VipsArgumentClass *) p->data; ++ ++ printf("\t%p %s\n", ++ argument_class, ++ g_param_spec_get_name( ++ ((VipsArgument *) argument_class)->pspec)); ++ } + } +-} + #endif /*DEBUG*/ + +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_unlock(vips__global_lock); + } + + static void +-vips_object_no_value( VipsObject *object, const char *name ) ++vips_object_no_value(VipsObject *object, const char *name) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + + GParamSpec *pspec; + VipsArgumentClass *argument_class; + VipsArgumentInstance *argument_instance; + +- if( vips_object_get_argument( object, name, +- &pspec, &argument_class, &argument_instance ) ) ++ if (vips_object_get_argument(object, name, ++ &pspec, &argument_class, &argument_instance)) + g_assert_not_reached(); + +- if( strcmp( name, g_param_spec_get_name( pspec ) ) == 0 ) +- vips_error( class->nickname, +- _( "no value supplied for argument '%s'" ), name ); ++ if (strcmp(name, g_param_spec_get_name(pspec)) == 0) ++ vips_error(class->nickname, ++ _("no value supplied for argument '%s'"), name); + else +- vips_error( class->nickname, +- _( "no value supplied for argument '%s' ('%s')" ), ++ vips_error(class->nickname, ++ _("no value supplied for argument '%s' ('%s')"), + name, +- g_param_spec_get_name( pspec ) ); ++ g_param_spec_get_name(pspec)); + } + + /* Set a named arg from a string. + */ + int +-vips_object_set_argument_from_string( VipsObject *object, +- const char *name, const char *value ) ++vips_object_set_argument_from_string(VipsObject *object, ++ const char *name, const char *value) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + + GParamSpec *pspec; + VipsArgumentClass *argument_class; +@@ -1876,18 +1879,18 @@ vips_object_set_argument_from_string( VipsObject *object, + + GValue gvalue = { 0 }; + +- VIPS_DEBUG_MSG( "vips_object_set_argument_from_string: %s = %s\n", +- name, value ); ++ VIPS_DEBUG_MSG("vips_object_set_argument_from_string: %s = %s\n", ++ name, value); + +- if( vips_object_get_argument( object, name, +- &pspec, &argument_class, &argument_instance ) ) +- return( -1 ); ++ if (vips_object_get_argument(object, name, ++ &pspec, &argument_class, &argument_instance)) ++ return (-1); + +- otype = G_PARAM_SPEC_VALUE_TYPE( pspec ); ++ otype = G_PARAM_SPEC_VALUE_TYPE(pspec); + +- g_assert( argument_class->flags & VIPS_ARGUMENT_INPUT ); ++ g_assert(argument_class->flags & VIPS_ARGUMENT_INPUT); + +- if( g_type_is_a( otype, VIPS_TYPE_IMAGE ) ) { ++ if (g_type_is_a(otype, VIPS_TYPE_IMAGE)) { + VipsImage *out; + VipsOperationFlags flags; + VipsAccess access; +@@ -1895,73 +1898,73 @@ vips_object_set_argument_from_string( VipsObject *object, + char option_string[VIPS_PATH_MAX]; + + flags = 0; +- if( VIPS_IS_OPERATION( object ) ) +- flags = vips_operation_get_flags( +- VIPS_OPERATION( object ) ); ++ if (VIPS_IS_OPERATION(object)) ++ flags = vips_operation_get_flags( ++ VIPS_OPERATION(object)); + +- if( flags & +- (VIPS_OPERATION_SEQUENTIAL_UNBUFFERED | +- VIPS_OPERATION_SEQUENTIAL) ) ++ if (flags & ++ (VIPS_OPERATION_SEQUENTIAL_UNBUFFERED | ++ VIPS_OPERATION_SEQUENTIAL)) + access = VIPS_ACCESS_SEQUENTIAL; + else +- access = VIPS_ACCESS_RANDOM; ++ access = VIPS_ACCESS_RANDOM; + +- if( !value ) { +- vips_object_no_value( object, name ); +- return( -1 ); ++ if (!value) { ++ vips_object_no_value(object, name); ++ return (-1); + } +- vips__filename_split8( value, filename, option_string ); ++ vips__filename_split8(value, filename, option_string); + +- if( strcmp( "stdin", filename ) == 0 ) { ++ if (strcmp("stdin", filename) == 0) { + VipsSource *source; + +- if( !(source = +- vips_source_new_from_descriptor( 0 )) ) +- return( -1 ); +- if( !(out = vips_image_new_from_source( source, +- option_string, +- "access", access, +- NULL )) ) { +- VIPS_UNREF( source ); +- return( -1 ); ++ if (!(source = ++ vips_source_new_from_descriptor(0))) ++ return (-1); ++ if (!(out = vips_image_new_from_source(source, ++ option_string, ++ "access", access, ++ NULL))) { ++ VIPS_UNREF(source); ++ return (-1); + } +- VIPS_UNREF( source ); ++ VIPS_UNREF(source); + } + else { +- if( !(out = vips_image_new_from_file( value, +- "access", access, +- NULL )) ) +- return( -1 ); ++ if (!(out = vips_image_new_from_file(value, ++ "access", access, ++ NULL))) ++ return (-1); + } + +- g_value_init( &gvalue, VIPS_TYPE_IMAGE ); +- g_value_set_object( &gvalue, out ); ++ g_value_init(&gvalue, VIPS_TYPE_IMAGE); ++ g_value_set_object(&gvalue, out); + + /* Setting gvalue will have upped @out's count again, + * go back to 1 so that gvalue has the only ref. + */ +- g_object_unref( out ); ++ g_object_unref(out); + } +- else if( g_type_is_a( otype, VIPS_TYPE_SOURCE ) ) { ++ else if (g_type_is_a(otype, VIPS_TYPE_SOURCE)) { + VipsSource *source; + +- if( !value ) { +- vips_object_no_value( object, name ); +- return( -1 ); ++ if (!value) { ++ vips_object_no_value(object, name); ++ return (-1); + } + +- if( !(source = vips_source_new_from_options( value )) ) +- return( -1 ); +- +- g_value_init( &gvalue, VIPS_TYPE_SOURCE ); +- g_value_set_object( &gvalue, source ); ++ if (!(source = vips_source_new_from_options(value))) ++ return (-1); ++ ++ g_value_init(&gvalue, VIPS_TYPE_SOURCE); ++ g_value_set_object(&gvalue, source); + + /* Setting gvalue will have upped @out's count again, + * go back to 1 so that gvalue has the only ref. + */ +- g_object_unref( source ); ++ g_object_unref(source); + } +- else if( g_type_is_a( otype, VIPS_TYPE_ARRAY_IMAGE ) ) { ++ else if (g_type_is_a(otype, VIPS_TYPE_ARRAY_IMAGE)) { + /* We have to have a special case for this, we can't just rely + * on transform_g_string_array_image(), since we need to be + * able to set the access hint on the image. +@@ -1970,234 +1973,235 @@ vips_object_set_argument_from_string( VipsObject *object, + VipsOperationFlags flags; + VipsAccess access; + +- if( !value ) { +- vips_object_no_value( object, name ); +- return( -1 ); ++ if (!value) { ++ vips_object_no_value(object, name); ++ return (-1); + } + + flags = 0; +- if( VIPS_IS_OPERATION( object ) ) +- flags = vips_operation_get_flags( +- VIPS_OPERATION( object ) ); ++ if (VIPS_IS_OPERATION(object)) ++ flags = vips_operation_get_flags( ++ VIPS_OPERATION(object)); + +- if( flags & (VIPS_OPERATION_SEQUENTIAL_UNBUFFERED | +- VIPS_OPERATION_SEQUENTIAL) ) ++ if (flags & (VIPS_OPERATION_SEQUENTIAL_UNBUFFERED | VIPS_OPERATION_SEQUENTIAL)) + access = VIPS_ACCESS_SEQUENTIAL; + else +- access = VIPS_ACCESS_RANDOM; ++ access = VIPS_ACCESS_RANDOM; + +- if( !(array_image = +- vips_array_image_new_from_string( value, access )) ) +- return( -1 ); ++ if (!(array_image = ++ vips_array_image_new_from_string(value, access))) ++ return (-1); + +- g_value_init( &gvalue, VIPS_TYPE_ARRAY_IMAGE ); +- g_value_set_boxed( &gvalue, array_image ); ++ g_value_init(&gvalue, VIPS_TYPE_ARRAY_IMAGE); ++ g_value_set_boxed(&gvalue, array_image); + + /* Setting gvalue will have upped @array_image's count again, + * go back to 1 so that gvalue has the only ref. + */ +- vips_area_unref( VIPS_AREA( array_image ) ); ++ vips_area_unref(VIPS_AREA(array_image)); + } +- else if( g_type_is_a( otype, VIPS_TYPE_OBJECT ) && +- (oclass = g_type_class_ref( otype )) ) { ++ else if (g_type_is_a(otype, VIPS_TYPE_OBJECT) && ++ (oclass = g_type_class_ref(otype))) { + VipsObject *new_object; + +- if( !value ) { +- vips_object_no_value( object, name ); +- return( -1 ); ++ if (!value) { ++ vips_object_no_value(object, name); ++ return (-1); + } + +- if( !(new_object = +- vips_object_new_from_string( oclass, value )) ) +- return( -1 ); ++ if (!(new_object = ++ vips_object_new_from_string(oclass, value))) ++ return (-1); + + /* Not necessarily a VipsOperation subclass so we don't use + * the cache. We could have a separate case for this. + */ +- if( vips_object_build( new_object ) ) { +- g_object_unref( new_object ); +- return( -1 ); ++ if (vips_object_build(new_object)) { ++ g_object_unref(new_object); ++ return (-1); + } + +- g_value_init( &gvalue, G_TYPE_OBJECT ); +- g_value_set_object( &gvalue, new_object ); ++ g_value_init(&gvalue, G_TYPE_OBJECT); ++ g_value_set_object(&gvalue, new_object); + + /* The GValue now has a ref, we can drop ours. + */ +- g_object_unref( new_object ); ++ g_object_unref(new_object); + } +- else if( G_IS_PARAM_SPEC_BOOLEAN( pspec ) ) { ++ else if (G_IS_PARAM_SPEC_BOOLEAN(pspec)) { + gboolean b; + + b = TRUE; +- if( value && +- (g_ascii_strcasecmp( value, "false" ) == 0 || +- g_ascii_strcasecmp( value, "no" ) == 0 || +- strcmp( value, "0" ) == 0) ) ++ if (value && ++ (g_ascii_strcasecmp(value, "false") == 0 || ++ g_ascii_strcasecmp(value, "no") == 0 || ++ strcmp(value, "0") == 0)) + b = FALSE; + +- g_value_init( &gvalue, G_TYPE_BOOLEAN ); +- g_value_set_boolean( &gvalue, b ); ++ g_value_init(&gvalue, G_TYPE_BOOLEAN); ++ g_value_set_boolean(&gvalue, b); + } +- else if( G_IS_PARAM_SPEC_INT( pspec ) ) { ++ else if (G_IS_PARAM_SPEC_INT(pspec)) { + int i; + +- if( !value ) { +- vips_object_no_value( object, name ); +- return( -1 ); ++ if (!value) { ++ vips_object_no_value(object, name); ++ return (-1); + } + +- if( sscanf( value, "%d", &i ) != 1 ) { +- vips_error( class->nickname, +- _( "'%s' is not an integer" ), value ); +- return( -1 ); ++ if (sscanf(value, "%d", &i) != 1) { ++ vips_error(class->nickname, ++ _("'%s' is not an integer"), value); ++ return (-1); + } + +- g_value_init( &gvalue, G_TYPE_INT ); +- g_value_set_int( &gvalue, i ); ++ g_value_init(&gvalue, G_TYPE_INT); ++ g_value_set_int(&gvalue, i); + } +- else if( G_IS_PARAM_SPEC_UINT64( pspec ) ) { ++ else if (G_IS_PARAM_SPEC_UINT64(pspec)) { + /* Not allways the same as guint64 :-( argh. + */ + long long l; + +- if( !value ) { +- vips_object_no_value( object, name ); +- return( -1 ); ++ if (!value) { ++ vips_object_no_value(object, name); ++ return (-1); + } + +- if( sscanf( value, "%lld", &l ) != 1 ) { +- vips_error( class->nickname, +- _( "'%s' is not an integer" ), value ); +- return( -1 ); ++ if (sscanf(value, "%lld", &l) != 1) { ++ vips_error(class->nickname, ++ _("'%s' is not an integer"), value); ++ return (-1); + } + +- g_value_init( &gvalue, G_TYPE_UINT64 ); +- g_value_set_uint64( &gvalue, l ); ++ g_value_init(&gvalue, G_TYPE_UINT64); ++ g_value_set_uint64(&gvalue, l); + } +- else if( G_IS_PARAM_SPEC_DOUBLE( pspec ) ) { ++ else if (G_IS_PARAM_SPEC_DOUBLE(pspec)) { + double d; + +- if( !value ) { +- vips_object_no_value( object, name ); +- return( -1 ); ++ if (!value) { ++ vips_object_no_value(object, name); ++ return (-1); + } + +- if( sscanf( value, "%lg", &d ) != 1 ) { +- vips_error( class->nickname, +- _( "'%s' is not a double" ), value ); +- return( -1 ); ++ if (sscanf(value, "%lg", &d) != 1) { ++ vips_error(class->nickname, ++ _("'%s' is not a double"), value); ++ return (-1); + } + +- g_value_init( &gvalue, G_TYPE_DOUBLE ); +- g_value_set_double( &gvalue, d ); ++ g_value_init(&gvalue, G_TYPE_DOUBLE); ++ g_value_set_double(&gvalue, d); + } +- else if( G_IS_PARAM_SPEC_ENUM( pspec ) ) { ++ else if (G_IS_PARAM_SPEC_ENUM(pspec)) { + int i; + +- if( !value ) { +- vips_object_no_value( object, name ); +- return( -1 ); ++ if (!value) { ++ vips_object_no_value(object, name); ++ return (-1); + } + +- if( (i = vips_enum_from_nick( class->nickname, +- otype, value )) < 0 ) +- return( -1 ); ++ if ((i = vips_enum_from_nick(class->nickname, ++ otype, value)) < 0) ++ return (-1); + +- g_value_init( &gvalue, otype ); +- g_value_set_enum( &gvalue, i ); ++ g_value_init(&gvalue, otype); ++ g_value_set_enum(&gvalue, i); + } +- else if( G_IS_PARAM_SPEC_FLAGS( pspec ) ) { +- /* Allow a symbolic name, or an int. ++ else if (G_IS_PARAM_SPEC_FLAGS(pspec)) { ++ /* Allow a symbolic name, or an int. + */ + int i; + +- if( !value ) { +- vips_object_no_value( object, name ); +- return( -1 ); ++ if (!value) { ++ vips_object_no_value(object, name); ++ return (-1); + } + +- if( sscanf( value, "%d", &i ) != 1 && +- (i = vips_flags_from_nick( class->nickname, +- otype, value )) < 0 ) { +- vips_error( class->nickname, +- _( "'%s' is not an integer" ), value ); +- return( -1 ); ++ if (sscanf(value, "%d", &i) != 1 && ++ (i = vips_flags_from_nick(class->nickname, ++ otype, value)) < 0) { ++ vips_error(class->nickname, ++ _("'%s' is not an integer"), value); ++ return (-1); + } + +- g_value_init( &gvalue, otype ); +- g_value_set_flags( &gvalue, i ); ++ g_value_init(&gvalue, otype); ++ g_value_set_flags(&gvalue, i); + } + else { +- if( !value ) { +- vips_object_no_value( object, name ); +- return( -1 ); ++ if (!value) { ++ vips_object_no_value(object, name); ++ return (-1); + } + +- g_value_init( &gvalue, G_TYPE_STRING ); +- g_value_set_string( &gvalue, value ); ++ g_value_init(&gvalue, G_TYPE_STRING); ++ g_value_set_string(&gvalue, value); + } + +- g_object_set_property( G_OBJECT( object ), name, &gvalue ); +- g_value_unset( &gvalue ); ++ g_object_set_property(G_OBJECT(object), name, &gvalue); ++ g_value_unset(&gvalue); + +- return( 0 ); ++ return (0); + } + + /* Does an vipsargument need an argument to write to? For example, an image + * output needs a filename, a double output just prints. + */ + gboolean +-vips_object_argument_needsstring( VipsObject *object, const char *name ) ++vips_object_argument_needsstring(VipsObject *object, const char *name) + { + GParamSpec *pspec; + VipsArgumentClass *argument_class; + VipsArgumentInstance *argument_instance; + + #ifdef DEBUG +- printf( "vips_object_argument_needsstring: %s\n", name ); ++ printf("vips_object_argument_needsstring: %s\n", name); + #endif /*DEBUG*/ + +- if( vips_object_get_argument( object, name, +- &pspec, &argument_class, &argument_instance ) ) +- return( -1 ); ++ if (vips_object_get_argument(object, name, ++ &pspec, &argument_class, &argument_instance)) ++ return (-1); + +- return( vips_argument_class_needsstring( argument_class ) ); ++ return (vips_argument_class_needsstring(argument_class)); + } + + static void +-vips_object_print_arg( VipsObject *object, GParamSpec *pspec, VipsBuf *buf ) ++vips_object_print_arg(VipsObject *object, GParamSpec *pspec, VipsBuf *buf) + { +- GType type = G_PARAM_SPEC_VALUE_TYPE( pspec ); +- const char *name = g_param_spec_get_name( pspec ); +- GValue value = { 0, }; ++ GType type = G_PARAM_SPEC_VALUE_TYPE(pspec); ++ const char *name = g_param_spec_get_name(pspec); ++ GValue value = { ++ 0, ++ }; + char *str_value; + +- g_value_init( &value, type ); +- g_object_get_property( G_OBJECT( object ), name, &value ); +- str_value = g_strdup_value_contents( &value ); +- vips_buf_appends( buf, str_value ); +- g_free( str_value ); +- g_value_unset( &value ); ++ g_value_init(&value, type); ++ g_object_get_property(G_OBJECT(object), name, &value); ++ str_value = g_strdup_value_contents(&value); ++ vips_buf_appends(buf, str_value); ++ g_free(str_value); ++ g_value_unset(&value); + } + +-/* Is a filename a target, ie. it is of the form ".jpg". Any trailing options ++/* Is a filename a target, ie. it is of the form ".jpg". Any trailing options + * have already been stripped. Watch out for cases like "./x.jpg". + */ + static gboolean +-vips_filename_istarget( const char *filename ) ++vips_filename_istarget(const char *filename) + { + const char *p; + +- return( (p = strrchr( filename, '.' )) && p == filename ); ++ return ((p = strrchr(filename, '.')) && p == filename); + } + + /* Write a named arg to the string. If the arg does not need a string (see + * above), arg will be NULL. + */ + int +-vips_object_get_argument_to_string( VipsObject *object, +- const char *name, const char *arg ) ++vips_object_get_argument_to_string(VipsObject *object, ++ const char *name, const char *arg) + { + GParamSpec *pspec; + GType otype; +@@ -2206,97 +2210,97 @@ vips_object_get_argument_to_string( VipsObject *object, + VipsObjectClass *oclass; + + #ifdef DEBUG +- printf( "vips_object_get_argument_to_string: %s -> %s\n", +- name, arg ); ++ printf("vips_object_get_argument_to_string: %s -> %s\n", ++ name, arg); + #endif /*DEBUG*/ + +- if( vips_object_get_argument( object, name, +- &pspec, &argument_class, &argument_instance ) ) +- return( -1 ); ++ if (vips_object_get_argument(object, name, ++ &pspec, &argument_class, &argument_instance)) ++ return (-1); + +- otype = G_PARAM_SPEC_VALUE_TYPE( pspec ); ++ otype = G_PARAM_SPEC_VALUE_TYPE(pspec); + +- g_assert( argument_class->flags & VIPS_ARGUMENT_OUTPUT ); ++ g_assert(argument_class->flags & VIPS_ARGUMENT_OUTPUT); + +- if( g_type_is_a( otype, VIPS_TYPE_IMAGE ) ) { ++ if (g_type_is_a(otype, VIPS_TYPE_IMAGE)) { + VipsImage *in; + char filename[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; + +- vips__filename_split8( arg, filename, option_string ); ++ vips__filename_split8(arg, filename, option_string); + +- if( vips_filename_istarget( filename ) ) { ++ if (vips_filename_istarget(filename)) { + VipsTarget *target; + +- if( !(target = vips_target_new_to_descriptor( 1 )) ) +- return( -1 ); +- g_object_get( object, name, &in, NULL ); +- if( vips_image_write_to_target( in, +- arg, target, NULL ) ) { +- VIPS_UNREF( in ); +- VIPS_UNREF( target ); +- return( -1 ); ++ if (!(target = vips_target_new_to_descriptor(1))) ++ return (-1); ++ g_object_get(object, name, &in, NULL); ++ if (vips_image_write_to_target(in, ++ arg, target, NULL)) { ++ VIPS_UNREF(in); ++ VIPS_UNREF(target); ++ return (-1); + } +- VIPS_UNREF( in ); +- VIPS_UNREF( target ); ++ VIPS_UNREF(in); ++ VIPS_UNREF(target); + } + else { + /* Pull out the image and write it. + */ +- g_object_get( object, name, &in, NULL ); +- if( vips_image_write_to_file( in, arg, NULL ) ) { +- VIPS_UNREF( in ); +- return( -1 ); ++ g_object_get(object, name, &in, NULL); ++ if (vips_image_write_to_file(in, arg, NULL)) { ++ VIPS_UNREF(in); ++ return (-1); + } +- VIPS_UNREF( in ); ++ VIPS_UNREF(in); + } + } +- else if( g_type_is_a( otype, VIPS_TYPE_OBJECT ) && +- (oclass = g_type_class_ref( otype )) && +- oclass->output_to_arg ) { ++ else if (g_type_is_a(otype, VIPS_TYPE_OBJECT) && ++ (oclass = g_type_class_ref(otype)) && ++ oclass->output_to_arg) { + VipsObject *value; + +- g_object_get( object, name, &value, NULL ); +- if( oclass->output_to_arg( value, arg ) ) { +- g_object_unref( value ); +- return( -1 ); ++ g_object_get(object, name, &value, NULL); ++ if (oclass->output_to_arg(value, arg)) { ++ g_object_unref(value); ++ return (-1); + } +- g_object_unref( value ); ++ g_object_unref(value); + } + else { + char str[1000]; +- VipsBuf buf = VIPS_BUF_STATIC( str ); ++ VipsBuf buf = VIPS_BUF_STATIC(str); + +- vips_object_print_arg( object, pspec, &buf ); +- printf( "%s\n", vips_buf_all( &buf ) ); ++ vips_object_print_arg(object, pspec, &buf); ++ printf("%s\n", vips_buf_all(&buf)); + } + +- return( 0 ); ++ return (0); + } + + static void * +-vips_argument_is_required( VipsObject *object, ++vips_argument_is_required(VipsObject *object, + GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { +- if( (argument_class->flags & VIPS_ARGUMENT_REQUIRED) && ++ if ((argument_class->flags & VIPS_ARGUMENT_REQUIRED) && + (argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) && + (argument_class->flags & VIPS_ARGUMENT_INPUT) && +- !argument_instance->assigned ) +- return( pspec ); ++ !argument_instance->assigned) ++ return (pspec); + +- return( NULL ); ++ return (NULL); + } + + /* Find the first unassigned required input arg. + */ + static GParamSpec * +-vips_object_find_required( VipsObject *object ) ++vips_object_find_required(VipsObject *object) + { +- return( (GParamSpec *) vips_argument_map( object, +- vips_argument_is_required, NULL, NULL ) ); ++ return ((GParamSpec *) vips_argument_map(object, ++ vips_argument_is_required, NULL, NULL)); + } + + typedef struct _VipsNameFlagsPair { +@@ -2305,21 +2309,21 @@ typedef struct _VipsNameFlagsPair { + } VipsNameFlagsPair; + + static void * +-vips_object_find_args( VipsObject *object, ++vips_object_find_args(VipsObject *object, + GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { + VipsNameFlagsPair *pair = (VipsNameFlagsPair *) a; + int *i = (int *) b; + +- pair->names[*i] = g_param_spec_get_name( pspec ); ++ pair->names[*i] = g_param_spec_get_name(pspec); + pair->flags[*i] = (int) argument_class->flags; + + *i += 1; + +- return( NULL ); ++ return (NULL); + } + + /** +@@ -2337,33 +2341,33 @@ vips_object_find_args( VipsObject *object, + * Returns: 0 on success, -1 on error + */ + int +-vips_object_get_args( VipsObject *object, +- const char ***names, int **flags, int *n_args ) ++vips_object_get_args(VipsObject *object, ++ const char ***names, int **flags, int *n_args) + { +- VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( object ); +- int n = g_slist_length( object_class->argument_table_traverse ); ++ VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS(object); ++ int n = g_slist_length(object_class->argument_table_traverse); + + VipsNameFlagsPair pair; + int i; + +- pair.names = VIPS_ARRAY( object, n, const char * ); +- pair.flags = VIPS_ARRAY( object, n, int ); +- if( !pair.names || +- !pair.flags ) +- return( -1 ); ++ pair.names = VIPS_ARRAY(object, n, const char *); ++ pair.flags = VIPS_ARRAY(object, n, int); ++ if (!pair.names || ++ !pair.flags) ++ return (-1); + + i = 0; +- (void) vips_argument_map( object, +- vips_object_find_args, &pair, &i ); ++ (void) vips_argument_map(object, ++ vips_object_find_args, &pair, &i); + +- if( names ) ++ if (names) + *names = pair.names; +- if( flags ) ++ if (flags) + *flags = pair.flags; +- if( n_args ) ++ if (n_args) + *n_args = n; + +- return( 0 ); ++ return (0); + } + + /** +@@ -2379,25 +2383,25 @@ vips_object_get_args( VipsObject *object, + * Returns: the new object + */ + VipsObject * +-vips_object_new( GType type, VipsObjectSetArguments set, void *a, void *b ) ++vips_object_new(GType type, VipsObjectSetArguments set, void *a, void *b) + { + VipsObject *object; + + vips_check_init(); + +- object = VIPS_OBJECT( g_object_new( type, NULL ) ); ++ object = VIPS_OBJECT(g_object_new(type, NULL)); + +- if( set && set( object, a, b ) ) { +- g_object_unref( object ); +- return( NULL ); ++ if (set && set(object, a, b)) { ++ g_object_unref(object); ++ return (NULL); + } + +- if( vips_object_build( object ) ) { +- g_object_unref( object ); +- return( NULL ); ++ if (vips_object_build(object)) { ++ g_object_unref(object); ++ return (NULL); + } + +- return( object ); ++ return (object); + } + + /** +@@ -2410,33 +2414,33 @@ vips_object_new( GType type, VipsObjectSetArguments set, void *a, void *b ) + * Returns: 0 on success, -1 on error + */ + int +-vips_object_set_valist( VipsObject *object, va_list ap ) ++vips_object_set_valist(VipsObject *object, va_list ap) + { + char *name; + +- VIPS_DEBUG_MSG( "vips_object_set_valist:\n" ); ++ VIPS_DEBUG_MSG("vips_object_set_valist:\n"); + +- for( name = va_arg( ap, char * ); name; name = va_arg( ap, char * ) ) { ++ for (name = va_arg(ap, char *); name; name = va_arg(ap, char *)) { + GParamSpec *pspec; + VipsArgumentClass *argument_class; + VipsArgumentInstance *argument_instance; + +- VIPS_DEBUG_MSG( "\tname = '%s' (%p)\n", name, name ); ++ VIPS_DEBUG_MSG("\tname = '%s' (%p)\n", name, name); + +- if( vips_object_get_argument( VIPS_OBJECT( object ), name, +- &pspec, &argument_class, &argument_instance ) ) +- return( -1 ); ++ if (vips_object_get_argument(VIPS_OBJECT(object), name, ++ &pspec, &argument_class, &argument_instance)) ++ return (-1); + +- VIPS_ARGUMENT_COLLECT_SET( pspec, argument_class, ap ); ++ VIPS_ARGUMENT_COLLECT_SET(pspec, argument_class, ap); + +- g_object_set_property( G_OBJECT( object ), name, &value ); ++ g_object_set_property(G_OBJECT(object), name, &value); + +- VIPS_ARGUMENT_COLLECT_GET( pspec, argument_class, ap ); ++ VIPS_ARGUMENT_COLLECT_GET(pspec, argument_class, ap); + + VIPS_ARGUMENT_COLLECT_END + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -2456,30 +2460,30 @@ vips_object_set_valist( VipsObject *object, va_list ap ) + * Input arguments are given in-line, output arguments are given as pointers + * to where the output value should be written. + * +- * See also: vips_object_set_valist(), vips_object_set_from_string(). ++ * See also: vips_object_set_valist(), vips_object_set_from_string(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_object_set( VipsObject *object, ... ) ++vips_object_set(VipsObject *object, ...) + { + va_list ap; + int result; + +- va_start( ap, object ); +- result = vips_object_set_valist( object, ap ); +- va_end( ap ); ++ va_start(ap, object); ++ result = vips_object_set_valist(object, ap); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /* Set object args from a string. @p should be the initial left bracket and +- * there should be no tokens after the matching right bracket. @p is modified. ++ * there should be no tokens after the matching right bracket. @p is modified. + */ + static int +-vips_object_set_args( VipsObject *object, const char *p ) ++vips_object_set_args(VipsObject *object, const char *p) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + + VipsToken token; + char string[VIPS_PATH_MAX]; +@@ -2488,86 +2492,86 @@ vips_object_set_args( VipsObject *object, const char *p ) + VipsArgumentClass *argument_class; + VipsArgumentInstance *argument_instance; + +- if( !(p = vips__token_need( p, VIPS_TOKEN_LEFT, +- string, VIPS_PATH_MAX )) ) +- return( -1 ); ++ if (!(p = vips__token_need(p, VIPS_TOKEN_LEFT, ++ string, VIPS_PATH_MAX))) ++ return (-1); + +- if( !(p = vips__token_segment( p, &token, string, VIPS_PATH_MAX )) ) +- return( -1 ); ++ if (!(p = vips__token_segment(p, &token, string, VIPS_PATH_MAX))) ++ return (-1); + +- for(;;) { +- if( token == VIPS_TOKEN_RIGHT ) ++ for (;;) { ++ if (token == VIPS_TOKEN_RIGHT) + break; +- if( token != VIPS_TOKEN_STRING ) { +- vips_error( class->nickname, +- _( "expected string or ), saw %s" ), +- vips_enum_nick( VIPS_TYPE_TOKEN, token ) ); +- return( -1 ); ++ if (token != VIPS_TOKEN_STRING) { ++ vips_error(class->nickname, ++ _("expected string or ), saw %s"), ++ vips_enum_nick(VIPS_TYPE_TOKEN, token)); ++ return (-1); + } + + /* We have to look for a '=', ']' or a ',' to see if string is + * a param name or a value. + */ +- if( !(p = vips__token_segment( p, &token, +- string2, VIPS_PATH_MAX )) ) +- return( -1 ); +- if( token == VIPS_TOKEN_EQUALS ) { +- if( !(p = vips__token_segment_need( p, VIPS_TOKEN_STRING, +- string2, VIPS_PATH_MAX )) ) +- return( -1 ); +- if( vips_object_set_argument_from_string( object, +- string, string2 ) ) +- return( -1 ); +- +- if( !(p = vips__token_must( p, &token, +- string2, VIPS_PATH_MAX )) ) +- return( -1 ); ++ if (!(p = vips__token_segment(p, &token, ++ string2, VIPS_PATH_MAX))) ++ return (-1); ++ if (token == VIPS_TOKEN_EQUALS) { ++ if (!(p = vips__token_segment_need(p, VIPS_TOKEN_STRING, ++ string2, VIPS_PATH_MAX))) ++ return (-1); ++ if (vips_object_set_argument_from_string(object, ++ string, string2)) ++ return (-1); ++ ++ if (!(p = vips__token_must(p, &token, ++ string2, VIPS_PATH_MAX))) ++ return (-1); + } +- else if( g_object_class_find_property( +- G_OBJECT_GET_CLASS( object ), string ) && +- !vips_object_get_argument( object, string, +- &pspec, &argument_class, &argument_instance ) && ++ else if (g_object_class_find_property( ++ G_OBJECT_GET_CLASS(object), string) && ++ !vips_object_get_argument(object, string, ++ &pspec, &argument_class, &argument_instance) && + (argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) && + (argument_class->flags & VIPS_ARGUMENT_INPUT) && +- G_IS_PARAM_SPEC_BOOLEAN( pspec ) ) { ++ G_IS_PARAM_SPEC_BOOLEAN(pspec)) { + /* The string is the name of an optional + * input boolean ... set it! + */ +- if( !argument_instance->assigned ) +- g_object_set( object, string, TRUE, NULL ); ++ if (!argument_instance->assigned) ++ g_object_set(object, string, TRUE, NULL); + } +- else if( (pspec = vips_object_find_required( object )) ) { +- if( vips_object_set_argument_from_string( object, +- g_param_spec_get_name( pspec ), string ) ) +- return( -1 ); ++ else if ((pspec = vips_object_find_required(object))) { ++ if (vips_object_set_argument_from_string(object, ++ g_param_spec_get_name(pspec), string)) ++ return (-1); + } + else { +- vips_error( class->nickname, +- _( "unable to set '%s'" ), string ); +- return( -1 ); ++ vips_error(class->nickname, ++ _("unable to set '%s'"), string); ++ return (-1); + } + +- /* Now must be a , or a ). ++ /* Now must be a , or a ). + */ +- if( token == VIPS_TOKEN_COMMA ) { +- if( !(p = vips__token_must( p, &token, +- string, VIPS_PATH_MAX )) ) +- return( -1 ); ++ if (token == VIPS_TOKEN_COMMA) { ++ if (!(p = vips__token_must(p, &token, ++ string, VIPS_PATH_MAX))) ++ return (-1); + } +- else if( token != VIPS_TOKEN_RIGHT ) { +- vips_error( class->nickname, +- "%s", _( "not , or ) after parameter" ) ); +- return( -1 ); ++ else if (token != VIPS_TOKEN_RIGHT) { ++ vips_error(class->nickname, ++ "%s", _("not , or ) after parameter")); ++ return (-1); + } + } + +- if( (p = vips__token_get( p, &token, string, VIPS_PATH_MAX )) ) { +- vips_error( class->nickname, +- "%s", _( "extra tokens after ')'" ) ); +- return( -1 ); ++ if ((p = vips__token_get(p, &token, string, VIPS_PATH_MAX))) { ++ vips_error(class->nickname, ++ "%s", _("extra tokens after ')'")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -2577,123 +2581,123 @@ vips_object_set_args( VipsObject *object, const char *p ) + * + * Set object arguments from a string. The string can be something like + * "a=12", or "a = 12, b = 13", or "fred". The string can optionally be +- * enclosed in brackets. ++ * enclosed in brackets. + * +- * You'd typically use this between creating the object and building it. ++ * You'd typically use this between creating the object and building it. + * + * See also: vips_object_set(), vips_object_build(), +- * vips_cache_operation_buildp(). ++ * vips_cache_operation_buildp(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_object_set_from_string( VipsObject *object, const char *string ) ++vips_object_set_from_string(VipsObject *object, const char *string) + { + const char *q; + VipsToken token; + char buffer[VIPS_PATH_MAX]; + char str[VIPS_PATH_MAX]; + +- vips_strncpy( buffer, string, VIPS_PATH_MAX ); ++ vips_strncpy(buffer, string, VIPS_PATH_MAX); + + /* Does string start with a bracket? If it doesn't, enclose the whole + * thing in []. + */ +- if( !(q = vips__token_get( buffer, &token, str, VIPS_PATH_MAX )) || +- token != VIPS_TOKEN_LEFT ) +- vips_snprintf( buffer, VIPS_PATH_MAX, "[%s]", string ); ++ if (!(q = vips__token_get(buffer, &token, str, VIPS_PATH_MAX)) || ++ token != VIPS_TOKEN_LEFT) ++ vips_snprintf(buffer, VIPS_PATH_MAX, "[%s]", string); + else +- vips_strncpy( buffer, string, VIPS_PATH_MAX ); ++ vips_strncpy(buffer, string, VIPS_PATH_MAX); + +- return( vips_object_set_args( object, buffer ) ); ++ return (vips_object_set_args(object, buffer)); + } + + VipsObject * +-vips_object_new_from_string( VipsObjectClass *object_class, const char *p ) ++vips_object_new_from_string(VipsObjectClass *object_class, const char *p) + { + const char *q; + char str[VIPS_PATH_MAX]; + VipsObject *object; + +- g_assert( object_class ); +- g_assert( object_class->new_from_string ); ++ g_assert(object_class); ++ g_assert(object_class->new_from_string); + + /* Find the start of the optional args on the end of the string, take + * everything before that as the principal arg for the constructor. + */ +- if( (q = vips__find_rightmost_brackets( p )) ) +- vips_strncpy( str, p, VIPS_MIN( VIPS_PATH_MAX, q - p + 1 ) ); ++ if ((q = vips__find_rightmost_brackets(p))) ++ vips_strncpy(str, p, VIPS_MIN(VIPS_PATH_MAX, q - p + 1)); + else +- vips_strncpy( str, p, VIPS_PATH_MAX ); +- if( !(object = object_class->new_from_string( str )) ) +- return( NULL ); ++ vips_strncpy(str, p, VIPS_PATH_MAX); ++ if (!(object = object_class->new_from_string(str))) ++ return (NULL); + + /* More tokens there? Set any other args. + */ +- if( q && +- vips_object_set_from_string( object, q ) ) { +- g_object_unref( object ); +- return( NULL ); ++ if (q && ++ vips_object_set_from_string(object, q)) { ++ g_object_unref(object); ++ return (NULL); + } + +- return( object ); ++ return (object); + } + + static void * +-vips_object_to_string_required( VipsObject *object, ++vips_object_to_string_required(VipsObject *object, + GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { + VipsBuf *buf = (VipsBuf *) a; + gboolean *first = (gboolean *) b; + +- if( (argument_class->flags & VIPS_ARGUMENT_REQUIRED) ) { +- if( *first ) { +- vips_buf_appends( buf, "(" ); ++ if ((argument_class->flags & VIPS_ARGUMENT_REQUIRED)) { ++ if (*first) { ++ vips_buf_appends(buf, "("); + *first = FALSE; + } + else { +- vips_buf_appends( buf, "," ); ++ vips_buf_appends(buf, ","); + } + +- vips_object_print_arg( object, pspec, buf ); ++ vips_object_print_arg(object, pspec, buf); + } + +- return( NULL ); ++ return (NULL); + } + + static void * +-vips_object_to_string_optional( VipsObject *object, ++vips_object_to_string_optional(VipsObject *object, + GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { + VipsBuf *buf = (VipsBuf *) a; + gboolean *first = (gboolean *) b; + +- if( !(argument_class->flags & VIPS_ARGUMENT_REQUIRED) && +- argument_instance->assigned ) { +- if( *first ) { +- vips_buf_appends( buf, "(" ); ++ if (!(argument_class->flags & VIPS_ARGUMENT_REQUIRED) && ++ argument_instance->assigned) { ++ if (*first) { ++ vips_buf_appends(buf, "("); + *first = FALSE; + } + else { +- vips_buf_appends( buf, "," ); ++ vips_buf_appends(buf, ","); + } + +- vips_buf_appends( buf, g_param_spec_get_name( pspec ) ); +- vips_buf_appends( buf, "=" ); +- vips_object_print_arg( object, pspec, buf ); ++ vips_buf_appends(buf, g_param_spec_get_name(pspec)); ++ vips_buf_appends(buf, "="); ++ vips_object_print_arg(object, pspec, buf); + } + +- return( NULL ); ++ return (NULL); + } + + /** +- * vips_object_to_string: ++ * vips_object_to_string: + * @object: object to stringify + * @buf: write string here + * +@@ -2701,25 +2705,25 @@ vips_object_to_string_optional( VipsObject *object, + * "VipsInterpolateSnohalo1(blur=.333333)". + */ + void +-vips_object_to_string( VipsObject *object, VipsBuf *buf ) ++vips_object_to_string(VipsObject *object, VipsBuf *buf) + { +- VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS(object); + + gboolean first; + +- g_assert( object_class->to_string ); ++ g_assert(object_class->to_string); + + /* Nicknames are not guaranteed to be unique, so use the full type + * name. + */ +- object_class->to_string( object, buf ); ++ object_class->to_string(object, buf); + first = TRUE; +- (void) vips_argument_map( object, +- vips_object_to_string_required, buf, &first ); +- (void) vips_argument_map( object, +- vips_object_to_string_optional, buf, &first ); +- if( !first ) +- vips_buf_appends( buf, ")" ); ++ (void) vips_argument_map(object, ++ vips_object_to_string_required, buf, &first); ++ (void) vips_argument_map(object, ++ vips_object_to_string_optional, buf, &first); ++ if (!first) ++ vips_buf_appends(buf, ")"); + } + + typedef struct { +@@ -2730,11 +2734,11 @@ typedef struct { + } VipsObjectMapArgs; + + static void +-vips_object_map_sub( VipsObject *key, VipsObject *value, +- VipsObjectMapArgs *args ) ++vips_object_map_sub(VipsObject *key, VipsObject *value, ++ VipsObjectMapArgs *args) + { +- if( !args->result ) +- args->result = args->fn( key, args->a, args->b ); ++ if (!args->result) ++ args->result = args->fn(key, args->a, args->b); + } + + /** +@@ -2744,13 +2748,13 @@ vips_object_map_sub( VipsObject *key, VipsObject *value, + * @b: client data + * + * Call a function for all alive objects. +- * Stop when @fn returns non-%NULL and return that value. ++ * Stop when @fn returns non-%NULL and return that value. + * + * Returns: %NULL if @fn returns %NULL for all arguments, otherwise the first + * non-%NULL value from @fn. + */ + void * +-vips_object_map( VipsSListMap2Fn fn, void *a, void *b ) ++vips_object_map(VipsSListMap2Fn fn, void *a, void *b) + { + VipsObjectMapArgs args; + +@@ -2762,14 +2766,14 @@ vips_object_map( VipsSListMap2Fn fn, void *a, void *b ) + /* We must test vips__object_all before we lock because the lock is + * only created when the first object is created. + */ +- if( vips__object_all ) { +- g_mutex_lock( vips__object_all_lock ); +- g_hash_table_foreach( vips__object_all, +- (GHFunc) vips_object_map_sub, &args ); +- g_mutex_unlock( vips__object_all_lock ); ++ if (vips__object_all) { ++ g_mutex_lock(vips__object_all_lock); ++ g_hash_table_foreach(vips__object_all, ++ (GHFunc) vips_object_map_sub, &args); ++ g_mutex_unlock(vips__object_all_lock); + } + +- return( args.result ); ++ return (args.result); + } + + /** +@@ -2780,26 +2784,26 @@ vips_object_map( VipsSListMap2Fn fn, void *a, void *b ) + * @b: client data + * + * Map over a type's children. Stop when @fn returns non-%NULL +- * and return that value. ++ * and return that value. + * + * Returns: %NULL if @fn returns %NULL for all arguments, otherwise the first + * non-%NULL value from @fn. + */ + void * +-vips_type_map( GType base, VipsTypeMap2Fn fn, void *a, void *b ) ++vips_type_map(GType base, VipsTypeMap2Fn fn, void *a, void *b) + { + GType *child; + guint n_children; + unsigned int i; + void *result; + +- child = g_type_children( base, &n_children ); ++ child = g_type_children(base, &n_children); + result = NULL; +- for( i = 0; i < n_children && !result; i++ ) +- result = fn( child[i], a, b ); +- g_free( child ); ++ for (i = 0; i < n_children && !result; i++) ++ result = fn(child[i], a, b); ++ g_free(child); + +- return( result ); ++ return (result); + } + + /** +@@ -2808,91 +2812,91 @@ vips_type_map( GType base, VipsTypeMap2Fn fn, void *a, void *b ) + * @fn: call this function for every type + * @a: client data + * +- * Map over a type's children, direct and indirect. Stop when @fn returns +- * non-%NULL and return that value. ++ * Map over a type's children, direct and indirect. Stop when @fn returns ++ * non-%NULL and return that value. + * + * Returns: %NULL if @fn returns %NULL for all arguments, otherwise the first + * non-%NULL value from @fn. + */ + void * +-vips_type_map_all( GType base, VipsTypeMapFn fn, void *a ) ++vips_type_map_all(GType base, VipsTypeMapFn fn, void *a) + { + void *result; + +- if( !(result = fn( base, a )) ) +- result = vips_type_map( base, +- (VipsTypeMap2Fn) vips_type_map_all, fn, a ); ++ if (!(result = fn(base, a))) ++ result = vips_type_map(base, ++ (VipsTypeMap2Fn) vips_type_map_all, fn, a); + +- return( result ); ++ return (result); + } + + /** +- * vips_class_map_all: (skip) ++ * vips_class_map_all: (skip) + * @type: base type + * @fn: call this function for every type + * @a: client data + * + * Loop over all the subclasses of @type. Non-abstract classes only. +- * Stop when @fn returns +- * non-%NULL and return that value. ++ * Stop when @fn returns ++ * non-%NULL and return that value. + * + * Returns: %NULL if @fn returns %NULL for all arguments, otherwise the first + * non-%NULL value from @fn. + */ + void * +-vips_class_map_all( GType type, VipsClassMapFn fn, void *a ) ++vips_class_map_all(GType type, VipsClassMapFn fn, void *a) + { + void *result; + + /* Avoid abstract classes. Use type_map_all for them. + */ +- if( !G_TYPE_IS_ABSTRACT( type ) ) { ++ if (!G_TYPE_IS_ABSTRACT(type)) { + /* We never unref this ref, but we never unload classes + * anyway, so so what. + */ +- if( (result = fn( +- VIPS_OBJECT_CLASS( g_type_class_ref( type ) ), a )) ) +- return( result ); ++ if ((result = fn( ++ VIPS_OBJECT_CLASS(g_type_class_ref(type)), a))) ++ return (result); + } + +- if( (result = vips_type_map( type, +- (VipsTypeMap2Fn) vips_class_map_all, fn, a )) ) +- return( result ); ++ if ((result = vips_type_map(type, ++ (VipsTypeMap2Fn) vips_class_map_all, fn, a))) ++ return (result); + +- return( NULL ); ++ return (NULL); + } + + /* How deeply nested is a class ... used to indent class lists. + */ + int +-vips_type_depth( GType type ) ++vips_type_depth(GType type) + { + int depth; + + depth = 0; +- while( type != VIPS_TYPE_OBJECT && +- (type = g_type_parent( type )) ) ++ while (type != VIPS_TYPE_OBJECT && ++ (type = g_type_parent(type))) + depth += 1; + +- return( depth ); ++ return (depth); + } + + static void * +-test_name( VipsObjectClass *class, const char *nickname ) ++test_name(VipsObjectClass *class, const char *nickname) + { +- if( g_ascii_strcasecmp( class->nickname, nickname ) == 0 ) +- return( class ); ++ if (g_ascii_strcasecmp(class->nickname, nickname) == 0) ++ return (class); + + /* Check the class name too, why not. + */ +- if( g_ascii_strcasecmp( G_OBJECT_CLASS_NAME( class ), nickname ) == 0 ) +- return( class ); ++ if (g_ascii_strcasecmp(G_OBJECT_CLASS_NAME(class), nickname) == 0) ++ return (class); + +- return( NULL ); ++ return (NULL); + } + + /** +- * vips_class_find: ++ * vips_class_find: + * @basename: name of base class + * @nickname: search for a class with this nickname + * +@@ -2904,19 +2908,19 @@ test_name( VipsObjectClass *class, const char *nickname ) + * Returns: (transfer none): the found class. + */ + const VipsObjectClass * +-vips_class_find( const char *basename, const char *nickname ) ++vips_class_find(const char *basename, const char *nickname) + { + const char *classname = basename ? basename : "VipsObject"; + + VipsObjectClass *class; + GType base; + +- if( !(base = g_type_from_name( classname )) ) +- return( NULL ); +- class = vips_class_map_all( base, +- (VipsClassMapFn) test_name, (void *) nickname ); ++ if (!(base = g_type_from_name(classname))) ++ return (NULL); ++ class = vips_class_map_all(base, ++ (VipsClassMapFn) test_name, (void *) nickname); + +- return( class ); ++ return (class); + } + + /* What we store for each nickname. We can't just store the type with +@@ -2929,46 +2933,46 @@ typedef struct _NicknameGType { + } NicknameGType; + + static void * +-vips_class_add_hash( VipsObjectClass *class, GHashTable *table ) ++vips_class_add_hash(VipsObjectClass *class, GHashTable *table) + { +- GType type = G_OBJECT_CLASS_TYPE( class ); ++ GType type = G_OBJECT_CLASS_TYPE(class); + NicknameGType *hit; + +- hit = (NicknameGType *) +- g_hash_table_lookup( table, (void *) class->nickname ); ++ hit = (NicknameGType *) ++ g_hash_table_lookup(table, (void *) class->nickname); + + /* If this is not a unique name, mark as a duplicate. In this case + * we'll need to fall back to a search. + */ +- if( hit ) ++ if (hit) + hit->duplicate = TRUE; + else { +- hit = g_new( NicknameGType, 1 ); ++ hit = g_new(NicknameGType, 1); + hit->nickname = class->nickname; + hit->type = type; + hit->duplicate = FALSE; +- g_hash_table_insert( table, (void *) hit->nickname, hit ); ++ g_hash_table_insert(table, (void *) hit->nickname, hit); + } + +- return( NULL ); ++ return (NULL); + } + + static void * +-vips_class_build_hash_cb( void *dummy ) ++vips_class_build_hash_cb(void *dummy) + { + GType base; + +- vips__object_nickname_table = +- g_hash_table_new( g_str_hash, g_str_equal ); ++ vips__object_nickname_table = ++ g_hash_table_new(g_str_hash, g_str_equal); + +- base = g_type_from_name( "VipsObject" ); +- g_assert( base ); ++ base = g_type_from_name("VipsObject"); ++ g_assert(base); + +- vips_class_map_all( base, +- (VipsClassMapFn) vips_class_add_hash, +- (void *) vips__object_nickname_table ); ++ vips_class_map_all(base, ++ (VipsClassMapFn) vips_class_add_hash, ++ (void *) vips__object_nickname_table); + +- return( NULL ); ++ return (NULL); + } + + /** +@@ -2976,18 +2980,18 @@ vips_class_build_hash_cb( void *dummy ) + * @basename: name of base class + * @nickname: search for a class with this nickname + * +- * Search below @basename, return the %GType of the class whose name or +- * @nickname matches, or 0 for not found. ++ * Search below @basename, return the %GType of the class whose name or ++ * @nickname matches, or 0 for not found. + * If @basename is NULL, the whole of #VipsObject is searched. + * +- * This function uses a cache, so it should be quick. ++ * This function uses a cache, so it should be quick. + * + * See also: vips_class_find() + * + * Returns: the %GType of the class, or 0 if the class is not found. + */ + GType +-vips_type_find( const char *basename, const char *nickname ) ++vips_type_find(const char *basename, const char *nickname) + { + static GOnce once = G_ONCE_INIT; + +@@ -2997,62 +3001,62 @@ vips_type_find( const char *basename, const char *nickname ) + GType base; + GType type; + +- VIPS_ONCE( &once, vips_class_build_hash_cb, NULL ); ++ VIPS_ONCE(&once, vips_class_build_hash_cb, NULL); + +- hit = (NicknameGType *) +- g_hash_table_lookup( vips__object_nickname_table, +- (void *) nickname ); ++ hit = (NicknameGType *) ++ g_hash_table_lookup(vips__object_nickname_table, ++ (void *) nickname); + + /* We must only search below basename ... check that the cache hit is + * in the right part of the tree. + */ +- if( !(base = g_type_from_name( classname )) ) +- return( 0 ); +- if( hit && ++ if (!(base = g_type_from_name(classname))) ++ return (0); ++ if (hit && + !hit->duplicate && +- g_type_is_a( hit->type, base ) ) ++ g_type_is_a(hit->type, base)) + type = hit->type; + else { + const VipsObjectClass *class; + +- if( !(class = vips_class_find( basename, nickname )) ) +- return( 0 ); ++ if (!(class = vips_class_find(basename, nickname))) ++ return (0); + +- type = G_OBJECT_CLASS_TYPE( class ); ++ type = G_OBJECT_CLASS_TYPE(class); + } + +- return( type ); ++ return (type); + } + + /** + * vips_nickname_find: + * @type: #GType to search for + * +- * Return the VIPS nickname for a %GType. Handy for language bindings. ++ * Return the VIPS nickname for a %GType. Handy for language bindings. + * +- * Returns: (transfer none): the class nickname. ++ * Returns: (transfer none): the class nickname. + */ + const char * +-vips_nickname_find( GType type ) ++vips_nickname_find(GType type) + { + gpointer p; + VipsObjectClass *class; + +- if( type && +- (p = g_type_class_ref( type )) && +- VIPS_IS_OBJECT_CLASS( p ) && +- (class = VIPS_OBJECT_CLASS( p )) ) +- return( class->nickname ); ++ if (type && ++ (p = g_type_class_ref(type)) && ++ VIPS_IS_OBJECT_CLASS(p) && ++ (class = VIPS_OBJECT_CLASS(p))) ++ return (class->nickname); + +- return( NULL ); ++ return (NULL); + } + + /* The vips_object_local() macro uses this as its callback. + */ + void +-vips_object_local_cb( VipsObject *vobject, GObject *gobject ) ++vips_object_local_cb(VipsObject *vobject, GObject *gobject) + { +- VIPS_FREEF( g_object_unref, gobject ); ++ VIPS_FREEF(g_object_unref, gobject); + } + + typedef struct { +@@ -3061,18 +3065,18 @@ typedef struct { + } VipsObjectLocal; + + static void +-vips_object_local_array_cb( VipsObject *parent, VipsObjectLocal *local ) ++vips_object_local_array_cb(VipsObject *parent, VipsObjectLocal *local) + { + int i; + +- for( i = 0; i < local->n; i++ ) +- VIPS_FREEF( g_object_unref, local->array[i] ); ++ for (i = 0; i < local->n; i++) ++ VIPS_FREEF(g_object_unref, local->array[i]); + +- VIPS_FREEF( g_free, local->array ); +- VIPS_FREEF( g_free, local ); ++ VIPS_FREEF(g_free, local->array); ++ VIPS_FREEF(g_free, local); + } + +-/** ++/** + * vips_object_local_array: (skip) + * @parent: objects unref when this object unrefs + * @n: array size +@@ -3082,7 +3086,7 @@ vips_object_local_array_cb( VipsObject *parent, VipsObjectLocal *local ) + * freed. Handy for creating a set of temporary images for a function. + * + * The array is NULL-terminated, ie. contains an extra NULL element at the +- * end. ++ * end. + * + * Example: + * +@@ -3090,7 +3094,7 @@ vips_object_local_array_cb( VipsObject *parent, VipsObjectLocal *local ) + * VipsObject **t; + * + * t = vips_object_local_array( parent, 5 ); +- * if( ++ * if( + * vips_add( a, b, &t[0], NULL ) || + * vips_invert( t[0], &t[1], NULL ) || + * vips_add( t[1], t[0], &t[2], NULL ) || +@@ -3103,77 +3107,77 @@ vips_object_local_array_cb( VipsObject *parent, VipsObjectLocal *local ) + * Returns: an array of NULL pointers of length @n + */ + VipsObject ** +-vips_object_local_array( VipsObject *parent, int n ) ++vips_object_local_array(VipsObject *parent, int n) + { + VipsObjectLocal *local; + +- local = g_new( VipsObjectLocal, 1 ); ++ local = g_new(VipsObjectLocal, 1); + local->n = n; +- /* Make the array 1 too long so we can be sure there's a NULL ++ /* Make the array 1 too long so we can be sure there's a NULL + * terminator. + */ +- local->array = g_new0( VipsObject *, n + 1 ); ++ local->array = g_new0(VipsObject *, n + 1); + +- g_signal_connect( parent, "close", +- G_CALLBACK( vips_object_local_array_cb ), local ); ++ g_signal_connect(parent, "close", ++ G_CALLBACK(vips_object_local_array_cb), local); + +- return( local->array ); ++ return (local->array); + } + +-void +-vips_object_set_static( VipsObject *object, gboolean static_object ) ++void ++vips_object_set_static(VipsObject *object, gboolean static_object) + { + object->static_object = static_object; + } + + static void * +-vips_object_n_static_cb( VipsObject *object, int *n, void *b ) ++vips_object_n_static_cb(VipsObject *object, int *n, void *b) + { +- if( object->static_object ) ++ if (object->static_object) + *n += 1; + +- return( NULL ); ++ return (NULL); + } + + static int +-vips_object_n_static( void ) ++vips_object_n_static(void) + { + int n; + + n = 0; +- vips_object_map( +- (VipsSListMap2Fn) vips_object_n_static_cb, &n, NULL ); ++ vips_object_map( ++ (VipsSListMap2Fn) vips_object_n_static_cb, &n, NULL); + +- return( n ); ++ return (n); + } + + static void * +-vips_object_print_all_cb( VipsObject *object, int *n, void *b ) ++vips_object_print_all_cb(VipsObject *object, int *n, void *b) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + + char str[32768]; +- VipsBuf buf = VIPS_BUF_STATIC( str ); ++ VipsBuf buf = VIPS_BUF_STATIC(str); + +- fprintf( stderr, "%d) %s (%p)", +- *n, G_OBJECT_TYPE_NAME( object ), object ); +- if( object->local_memory ) +- fprintf( stderr, " %zd bytes", object->local_memory ); +- fprintf( stderr, ", count=%d", G_OBJECT( object )->ref_count ); +- fprintf( stderr, "\n" ); ++ fprintf(stderr, "%d) %s (%p)", ++ *n, G_OBJECT_TYPE_NAME(object), object); ++ if (object->local_memory) ++ fprintf(stderr, " %zd bytes", object->local_memory); ++ fprintf(stderr, ", count=%d", G_OBJECT(object)->ref_count); ++ fprintf(stderr, "\n"); + +- vips_object_summary_class( class, &buf ); +- vips_buf_appends( &buf, ", " ); +- vips_object_summary( object, &buf ); +- fprintf( stderr, "%s\n", vips_buf_all( &buf ) ); ++ vips_object_summary_class(class, &buf); ++ vips_buf_appends(&buf, ", "); ++ vips_object_summary(object, &buf); ++ fprintf(stderr, "%s\n", vips_buf_all(&buf)); + + *n += 1; + +- return( NULL ); ++ return (NULL); + } + + int +-vips__object_leak( void ) ++vips__object_leak(void) + { + int n_leaks; + +@@ -3181,72 +3185,72 @@ vips__object_leak( void ) + + /* Don't count static objects. + */ +- if( vips__object_all && +- g_hash_table_size( vips__object_all ) > +- vips_object_n_static() ) { +- fprintf( stderr, "%d objects alive:\n", +- g_hash_table_size( vips__object_all ) ); ++ if (vips__object_all && ++ g_hash_table_size(vips__object_all) > ++ vips_object_n_static()) { ++ fprintf(stderr, "%d objects alive:\n", ++ g_hash_table_size(vips__object_all)); + +- vips_object_map( +- (VipsSListMap2Fn) vips_object_print_all_cb, +- &n_leaks, NULL ); ++ vips_object_map( ++ (VipsSListMap2Fn) vips_object_print_all_cb, ++ &n_leaks, NULL); + } + +- return( n_leaks ); ++ return (n_leaks); + } + + void +-vips_object_print_all( void ) ++vips_object_print_all(void) + { + (void) vips__object_leak(); + (void) vips__type_leak(); + } + + static void * +-vips_object_sanity_all_cb( VipsObject *object, void *a, void *b ) ++vips_object_sanity_all_cb(VipsObject *object, void *a, void *b) + { +- (void) vips_object_sanity( object ); ++ (void) vips_object_sanity(object); + +- return( NULL ); ++ return (NULL); + } + + void +-vips_object_sanity_all( void ) ++vips_object_sanity_all(void) + { +- vips_object_map( +- (VipsSListMap2Fn) vips_object_sanity_all_cb, NULL, NULL ); ++ vips_object_map( ++ (VipsSListMap2Fn) vips_object_sanity_all_cb, NULL, NULL); + } + + static void * +-vips_object_unref_outputs_sub( VipsObject *object, ++vips_object_unref_outputs_sub(VipsObject *object, + GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { +- if( (argument_class->flags & VIPS_ARGUMENT_OUTPUT) && +- G_IS_PARAM_SPEC_OBJECT( pspec ) && +- argument_instance->assigned ) { ++ if ((argument_class->flags & VIPS_ARGUMENT_OUTPUT) && ++ G_IS_PARAM_SPEC_OBJECT(pspec) && ++ argument_instance->assigned) { + GObject *value; + +- g_object_get( object, +- g_param_spec_get_name( pspec ), &value, NULL ); ++ g_object_get(object, ++ g_param_spec_get_name(pspec), &value, NULL); + + /* Doing the get refs the object, so unref the get, then unref + * again since this an an output object of the operation. + */ +- g_object_unref( value ); +- g_object_unref( value ); ++ g_object_unref(value); ++ g_object_unref(value); + } + +- return( NULL ); ++ return (NULL); + } + + /** + * vips_object_unref_outputs: + * @object: object to drop output refs from + * +- * Unref all assigned output objects. Useful for language bindings. ++ * Unref all assigned output objects. Useful for language bindings. + * + * After an object is built, all output args are owned by the caller. If + * something goes wrong before then, we have to unref the outputs that have +@@ -3256,31 +3260,31 @@ vips_object_unref_outputs_sub( VipsObject *object, + * See also: vips_cache_operation_build(). + */ + void +-vips_object_unref_outputs( VipsObject *object ) ++vips_object_unref_outputs(VipsObject *object) + { +- (void) vips_argument_map( object, +- vips_object_unref_outputs_sub, NULL, NULL ); ++ (void) vips_argument_map(object, ++ vips_object_unref_outputs_sub, NULL, NULL); + } + + /** + * vips_object_get_description: + * @object: object to fetch description from + * +- * Fetch the object description. Useful for language bindings. ++ * Fetch the object description. Useful for language bindings. + * + * @object.description is only avaliable after _build(), which can be too + * late. This function fetches from the instance, if possible, but falls back +- * to the class description if we are too early. +- * ++ * to the class description if we are too early. ++ * + * Returns: the object description + */ + const char * +-vips_object_get_description( VipsObject *object ) ++vips_object_get_description(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + +- if( object->description ) +- return( object->description ) ; ++ if (object->description) ++ return (object->description); + else +- return( class->description ) ; ++ return (class->description); + } +diff --git a/libvips/iofuncs/operation.c b/libvips/iofuncs/operation.c +index a8af713a90..dfefd2bb72 100644 +--- a/libvips/iofuncs/operation.c ++++ b/libvips/iofuncs/operation.c +@@ -6,28 +6,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -62,9 +62,9 @@ + * + * #VipsOperation is the base class for all operations in libvips. It builds + * on #VipsObject to provide the introspection and command-line interface to +- * libvips. ++ * libvips. + * +- * It also maintains a cache of recent operations. See below. ++ * It also maintains a cache of recent operations. See below. + * + * vips_call(), vips_call_split() and vips_call_split_option_string() are used + * by vips to implement the C API. They can execute any #VipsOperation, +@@ -75,7 +75,7 @@ + * + * |[ + * int +- * vips_embed( VipsImage *in, VipsImage **out, ++ * vips_embed( VipsImage *in, VipsImage **out, + * int x, int y, int width, int height, ... ) + * { + * va_list ap; +@@ -91,7 +91,7 @@ + * + * Use vips_call_argv() to run any vips operation from a command-line style + * argc/argv array. This is the thing used by the vips main program to +- * implement the vips command-line interface. ++ * implement the vips command-line interface. + * + * ## #VipsOperation and reference counting + * +@@ -100,18 +100,18 @@ + * + * |[ + * VipsImage *im = ...; +- * VipsImage *t1; ++ * VipsImage *t1; + * +- * if (vips_invert (im, &t1, NULL)) ++ * if (vips_invert (im, &t1, NULL)) + * error .. + * ]| + * + * This will invert @im and return a new #VipsImage, @t1. As the caller + * of vips_invert(), you are responsible for @t1 and must unref it when you no + * longer need it. If vips_invert() fails, no @t1 is returned and you don't +- * need to do anything. ++ * need to do anything. + * +- * If you don't need to use @im for another operation, ++ * If you don't need to use @im for another operation, + * you can unref @im immediately after the call. If @im is needed to calculate + * @t1, vips_invert() will add a ref to @im and automatically drop it when @t1 + * is unreffed. +@@ -156,16 +156,16 @@ + * ## The #VipsOperation cache + * + * Because all #VipsObject are immutable, they can be cached. The cache is +- * very simple to use: instead of calling vips_object_build(), call ++ * very simple to use: instead of calling vips_object_build(), call + * vips_cache_operation_build(). This function calculates a hash from the + * operations's input arguments and looks it up in table of all recent + * operations. If there's a hit, the new operation is unreffed, the old + * operation reffed, and the old operation returned in place of the new one. + * +- * The cache size is controlled with vips_cache_set_max() and friends. ++ * The cache size is controlled with vips_cache_set_max() and friends. + */ + +-/** ++/** + * VipsOperationFlags: + * @VIPS_OPERATION_NONE: no flags + * @VIPS_OPERATION_SEQUENTIAL: can work sequentially with a small buffer +@@ -178,7 +178,7 @@ + * + * @VIPS_OPERATION_SEQUENTIAL means that the operation works like vips_conv(): + * it can process images top-to-bottom with only small non-local +- * references. ++ * references. + * + * Every scan-line must be requested, you are not allowed to skip + * ahead, but as a special case, the very first request can be for a region +@@ -191,14 +191,14 @@ + * be read and discarded + * + * @VIPS_OPERATION_NOCACHE means that the operation must not be cached by +- * vips. ++ * vips. + * + * @VIPS_OPERATION_DEPRECATED means this is an old operation kept in vips for + * compatibility only and should be hidden from users. + * +- * @VIPS_OPERATION_UNTRUSTED means the operation depends on external libraries +- * which have not been hardened against attack. It should probably not be used +- * on untrusted input. Use vips_block_untrusted_set() to block all ++ * @VIPS_OPERATION_UNTRUSTED means the operation depends on external libraries ++ * which have not been hardened against attack. It should probably not be used ++ * on untrusted input. Use vips_block_untrusted_set() to block all + * untrusted operations. + * + * @VIPS_OPERATION_BLOCKED means the operation is prevented from executing. Use +@@ -208,39 +208,39 @@ + /* Abstract base class for operations. + */ + +-/* Our signals. ++/* Our signals. + */ + enum { +- SIG_INVALIDATE, ++ SIG_INVALIDATE, + SIG_LAST + }; + + static guint vips_operation_signals[SIG_LAST] = { 0 }; + +-G_DEFINE_ABSTRACT_TYPE( VipsOperation, vips_operation, VIPS_TYPE_OBJECT ); ++G_DEFINE_ABSTRACT_TYPE(VipsOperation, vips_operation, VIPS_TYPE_OBJECT); + + static void +-vips_operation_finalize( GObject *gobject ) ++vips_operation_finalize(GObject *gobject) + { +- VipsOperation *operation = VIPS_OPERATION( gobject ); ++ VipsOperation *operation = VIPS_OPERATION(gobject); + +- VIPS_DEBUG_MSG( "vips_operation_finalize: %p\n", gobject ); ++ VIPS_DEBUG_MSG("vips_operation_finalize: %p\n", gobject); + +- if( operation->pixels ) +- g_info( _( "%d pixels calculated" ), operation->pixels ); ++ if (operation->pixels) ++ g_info(_("%d pixels calculated"), operation->pixels); + +- G_OBJECT_CLASS( vips_operation_parent_class )->finalize( gobject ); ++ G_OBJECT_CLASS(vips_operation_parent_class)->finalize(gobject); + } + + static void +-vips_operation_dispose( GObject *gobject ) ++vips_operation_dispose(GObject *gobject) + { +- VIPS_DEBUG_MSG( "vips_operation_dispose: %p\n", gobject ); ++ VIPS_DEBUG_MSG("vips_operation_dispose: %p\n", gobject); + +- G_OBJECT_CLASS( vips_operation_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_operation_parent_class)->dispose(gobject); + } + +-/* Three basic types of command-line argument. ++/* Three basic types of command-line argument. + * + * INPUTS: things like an input image, there is a filename argument on the + * command-line which is used to construct the operation argument. +@@ -258,165 +258,164 @@ typedef enum { + USAGE_NOARG_OUTPUT, + USAGE_OPTIONS, + USAGE_NONE +-} UsageType; ++} UsageType; + + typedef struct { +- char *message; /* header message on first print */ +- UsageType type; /* Type of arg to select */ +- gboolean oftype; /* Show as "of type" */ +- int n; /* Arg number */ ++ char *message; /* header message on first print */ ++ UsageType type; /* Type of arg to select */ ++ gboolean oftype; /* Show as "of type" */ ++ int n; /* Arg number */ + } VipsOperationClassUsage; + + /* Put an arg into one the categories above. + */ + static UsageType +-vips_operation_class_usage_classify( VipsArgumentClass *argument_class ) ++vips_operation_class_usage_classify(VipsArgumentClass *argument_class) + { +- if( !(argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) || +- (argument_class->flags & VIPS_ARGUMENT_DEPRECATED) ) +- return( USAGE_NONE ); ++ if (!(argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) || ++ (argument_class->flags & VIPS_ARGUMENT_DEPRECATED)) ++ return (USAGE_NONE); + +- if( !(argument_class->flags & VIPS_ARGUMENT_REQUIRED) ) +- return( USAGE_OPTIONS ); ++ if (!(argument_class->flags & VIPS_ARGUMENT_REQUIRED)) ++ return (USAGE_OPTIONS); + +- if( vips_argument_class_needsstring( argument_class ) ) +- return( USAGE_INPUTS ); ++ if (vips_argument_class_needsstring(argument_class)) ++ return (USAGE_INPUTS); + +- if( (argument_class->flags & VIPS_ARGUMENT_OUTPUT) && +- !vips_argument_class_needsstring( argument_class ) ) +- return( USAGE_NOARG_OUTPUT ); ++ if ((argument_class->flags & VIPS_ARGUMENT_OUTPUT) && ++ !vips_argument_class_needsstring(argument_class)) ++ return (USAGE_NOARG_OUTPUT); + +- return( USAGE_NONE ); ++ return (USAGE_NONE); + } + + static void +-vips_operation_pspec_usage( VipsBuf *buf, GParamSpec *pspec ) ++vips_operation_pspec_usage(VipsBuf *buf, GParamSpec *pspec) + { +- GType type = G_PARAM_SPEC_VALUE_TYPE( pspec ); ++ GType type = G_PARAM_SPEC_VALUE_TYPE(pspec); + + /* These are the pspecs that vips uses that have interesting values. + */ +- if( G_IS_PARAM_SPEC_ENUM( pspec ) ) { +- GTypeClass *class = g_type_class_ref( type ); ++ if (G_IS_PARAM_SPEC_ENUM(pspec)) { ++ GTypeClass *class = g_type_class_ref(type); + GParamSpecEnum *pspec_enum = (GParamSpecEnum *) pspec; + + GEnumClass *genum; +- int i; ++ int i; + + /* Should be impossible, no need to warn. + */ +- if( !class ) ++ if (!class) + return; + +- genum = G_ENUM_CLASS( class ); ++ genum = G_ENUM_CLASS(class); + +- vips_buf_appendf( buf, "\t\t\t" ); +- vips_buf_appendf( buf, "%s", _( "default" ) ); +- vips_buf_appendf( buf, ": %s\n", +- vips_enum_nick( type, pspec_enum->default_value ) ); +- vips_buf_appendf( buf, "\t\t\t" ); +- vips_buf_appendf( buf, "%s", _( "allowed" ) ); +- vips_buf_appendf( buf, ": " ); ++ vips_buf_appendf(buf, "\t\t\t"); ++ vips_buf_appendf(buf, "%s", _("default")); ++ vips_buf_appendf(buf, ": %s\n", ++ vips_enum_nick(type, pspec_enum->default_value)); ++ vips_buf_appendf(buf, "\t\t\t"); ++ vips_buf_appendf(buf, "%s", _("allowed")); ++ vips_buf_appendf(buf, ": "); + + /* -1 since we always have a "last" member. + */ +- for( i = 0; i < genum->n_values - 1; i++ ) { +- if( i > 0 ) +- vips_buf_appends( buf, ", " ); +- vips_buf_appends( buf, genum->values[i].value_nick ); ++ for (i = 0; i < genum->n_values - 1; i++) { ++ if (i > 0) ++ vips_buf_appends(buf, ", "); ++ vips_buf_appends(buf, genum->values[i].value_nick); + } + +- vips_buf_appendf( buf, "\n" ); ++ vips_buf_appendf(buf, "\n"); + } +- else if( G_IS_PARAM_SPEC_BOOLEAN( pspec ) ) { ++ else if (G_IS_PARAM_SPEC_BOOLEAN(pspec)) { + GParamSpecBoolean *pspec_boolean = (GParamSpecBoolean *) pspec; + +- vips_buf_appendf( buf, "\t\t\t" ); +- vips_buf_appendf( buf, "%s", _( "default" ) ); +- vips_buf_appendf( buf, ": %s\n", +- pspec_boolean->default_value ? "true" : "false" ); ++ vips_buf_appendf(buf, "\t\t\t"); ++ vips_buf_appendf(buf, "%s", _("default")); ++ vips_buf_appendf(buf, ": %s\n", ++ pspec_boolean->default_value ? "true" : "false"); + } +- else if( G_IS_PARAM_SPEC_DOUBLE( pspec ) ) { ++ else if (G_IS_PARAM_SPEC_DOUBLE(pspec)) { + GParamSpecDouble *pspec_double = (GParamSpecDouble *) pspec; + +- vips_buf_appendf( buf, "\t\t\t" ); +- vips_buf_appendf( buf, "%s", _( "default" ) ); +- vips_buf_appendf( buf, ": %g\n", pspec_double->default_value ); +- vips_buf_appendf( buf, "\t\t\t" ); +- vips_buf_appendf( buf, "%s", _( "min" ) ); +- vips_buf_appendf( buf, ": %g, ", pspec_double->minimum ); +- vips_buf_appendf( buf, "%s", _( "max" ) ); +- vips_buf_appendf( buf, ": %g\n", pspec_double->maximum ); ++ vips_buf_appendf(buf, "\t\t\t"); ++ vips_buf_appendf(buf, "%s", _("default")); ++ vips_buf_appendf(buf, ": %g\n", pspec_double->default_value); ++ vips_buf_appendf(buf, "\t\t\t"); ++ vips_buf_appendf(buf, "%s", _("min")); ++ vips_buf_appendf(buf, ": %g, ", pspec_double->minimum); ++ vips_buf_appendf(buf, "%s", _("max")); ++ vips_buf_appendf(buf, ": %g\n", pspec_double->maximum); + } +- else if( G_IS_PARAM_SPEC_INT( pspec ) ) { ++ else if (G_IS_PARAM_SPEC_INT(pspec)) { + GParamSpecInt *pspec_int = (GParamSpecInt *) pspec; + +- vips_buf_appendf( buf, "\t\t\t" ); +- vips_buf_appendf( buf, "%s", _( "default" ) ); +- vips_buf_appendf( buf, ": %d\n", pspec_int->default_value ); +- vips_buf_appendf( buf, "\t\t\t" ); +- vips_buf_appendf( buf, "%s", _( "min" ) ); +- vips_buf_appendf( buf, ": %d, ", pspec_int->minimum ); +- vips_buf_appendf( buf, "%s", _( "max" ) ); +- vips_buf_appendf( buf, ": %d\n", pspec_int->maximum ); ++ vips_buf_appendf(buf, "\t\t\t"); ++ vips_buf_appendf(buf, "%s", _("default")); ++ vips_buf_appendf(buf, ": %d\n", pspec_int->default_value); ++ vips_buf_appendf(buf, "\t\t\t"); ++ vips_buf_appendf(buf, "%s", _("min")); ++ vips_buf_appendf(buf, ": %d, ", pspec_int->minimum); ++ vips_buf_appendf(buf, "%s", _("max")); ++ vips_buf_appendf(buf, ": %d\n", pspec_int->maximum); + } + } + + static void * +-vips_operation_class_usage_arg( VipsObjectClass *object_class, ++vips_operation_class_usage_arg(VipsObjectClass *object_class, + GParamSpec *pspec, VipsArgumentClass *argument_class, +- VipsBuf *buf, VipsOperationClassUsage *usage ) ++ VipsBuf *buf, VipsOperationClassUsage *usage) + { +- if( usage->type == +- vips_operation_class_usage_classify( argument_class ) ) { +- if( usage->message && +- usage->n == 0 ) +- vips_buf_appendf( buf, "%s\n", usage->message ); +- +- if( usage->oftype ) { +- vips_buf_appendf( buf, " %-12s - %s, %s %s\n", +- g_param_spec_get_name( pspec ), +- g_param_spec_get_blurb( pspec ), +- (argument_class->flags & VIPS_ARGUMENT_INPUT) ? +- _( "input" ) : _( "output" ), +- g_type_name( +- G_PARAM_SPEC_VALUE_TYPE( pspec ) ) ); +- vips_operation_pspec_usage( buf, pspec ); ++ if (usage->type == ++ vips_operation_class_usage_classify(argument_class)) { ++ if (usage->message && ++ usage->n == 0) ++ vips_buf_appendf(buf, "%s\n", usage->message); ++ ++ if (usage->oftype) { ++ vips_buf_appendf(buf, " %-12s - %s, %s %s\n", ++ g_param_spec_get_name(pspec), ++ g_param_spec_get_blurb(pspec), ++ (argument_class->flags & VIPS_ARGUMENT_INPUT) ? _("input") : _("output"), ++ g_type_name( ++ G_PARAM_SPEC_VALUE_TYPE(pspec))); ++ vips_operation_pspec_usage(buf, pspec); + } + else { +- if( usage->n > 0 ) +- vips_buf_appends( buf, " " ); +- vips_buf_appends( buf, +- g_param_spec_get_name( pspec ) ); ++ if (usage->n > 0) ++ vips_buf_appends(buf, " "); ++ vips_buf_appends(buf, ++ g_param_spec_get_name(pspec)); + } + + usage->n += 1; + } + +- return( NULL ); ++ return (NULL); + } + + static void +-vips_operation_usage( VipsOperationClass *class, VipsBuf *buf ) ++vips_operation_usage(VipsOperationClass *class, VipsBuf *buf) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); + + VipsOperationClassUsage usage; + +- vips_buf_appendf( buf, "%s\n", object_class->description ); +- vips_buf_appendf( buf, "usage:\n" ); ++ vips_buf_appendf(buf, "%s\n", object_class->description); ++ vips_buf_appendf(buf, "usage:\n"); + + /* First pass through args: show the required names. + */ +- vips_buf_appendf( buf, " %s ", object_class->nickname ); ++ vips_buf_appendf(buf, " %s ", object_class->nickname); + usage.message = NULL; + usage.type = USAGE_INPUTS; + usage.oftype = FALSE; + usage.n = 0; +- vips_argument_class_map( object_class, +- (VipsArgumentClassMapFn) vips_operation_class_usage_arg, +- buf, &usage ); +- vips_buf_appends( buf, " [--option-name option-value ...]\n" ); ++ vips_argument_class_map(object_class, ++ (VipsArgumentClassMapFn) vips_operation_class_usage_arg, ++ buf, &usage); ++ vips_buf_appends(buf, " [--option-name option-value ...]\n"); + + /* Show required types. + */ +@@ -424,9 +423,9 @@ vips_operation_usage( VipsOperationClass *class, VipsBuf *buf ) + usage.type = USAGE_INPUTS; + usage.oftype = TRUE; + usage.n = 0; +- vips_argument_class_map( object_class, +- (VipsArgumentClassMapFn) vips_operation_class_usage_arg, +- buf, &usage ); ++ vips_argument_class_map(object_class, ++ (VipsArgumentClassMapFn) vips_operation_class_usage_arg, ++ buf, &usage); + + /* Show outputs with no input arg (eg. output maximum value for + * vips_max()). +@@ -435,9 +434,9 @@ vips_operation_usage( VipsOperationClass *class, VipsBuf *buf ) + usage.type = USAGE_NOARG_OUTPUT; + usage.oftype = TRUE; + usage.n = 0; +- vips_argument_class_map( object_class, +- (VipsArgumentClassMapFn) vips_operation_class_usage_arg, +- buf, &usage ); ++ vips_argument_class_map(object_class, ++ (VipsArgumentClassMapFn) vips_operation_class_usage_arg, ++ buf, &usage); + + /* Show optional args. + */ +@@ -445,154 +444,153 @@ vips_operation_usage( VipsOperationClass *class, VipsBuf *buf ) + usage.type = USAGE_OPTIONS; + usage.oftype = TRUE; + usage.n = 0; +- vips_argument_class_map( object_class, +- (VipsArgumentClassMapFn) vips_operation_class_usage_arg, +- buf, &usage ); ++ vips_argument_class_map(object_class, ++ (VipsArgumentClassMapFn) vips_operation_class_usage_arg, ++ buf, &usage); + + /* Show flags. + */ +- if( class->flags ) { ++ if (class->flags) { + GFlagsValue *value; + VipsOperationFlags flags; +- GFlagsClass *flags_class = +- g_type_class_ref( VIPS_TYPE_OPERATION_FLAGS ); +- +- vips_buf_appendf( buf, "operation flags: " ); +- flags = class->flags; +- while( flags && (value = +- g_flags_get_first_value( flags_class, flags )) ) { +- vips_buf_appendf( buf, "%s ", value->value_nick ); ++ GFlagsClass *flags_class = ++ g_type_class_ref(VIPS_TYPE_OPERATION_FLAGS); ++ ++ vips_buf_appendf(buf, "operation flags: "); ++ flags = class->flags; ++ while (flags && (value = g_flags_get_first_value(flags_class, flags))) { ++ vips_buf_appendf(buf, "%s ", value->value_nick); + flags &= ~value->value; + } +- vips_buf_appends( buf, "\n" ); ++ vips_buf_appends(buf, "\n"); + } + } + + static void * +-vips_operation_call_argument( VipsObject *object, GParamSpec *pspec, ++vips_operation_call_argument(VipsObject *object, GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { + VipsArgument *argument = (VipsArgument *) argument_class; + +- printf( " %s: offset = %d ", +- g_param_spec_get_name( argument->pspec ), +- argument_class->offset ); +- if( argument_class->flags & VIPS_ARGUMENT_REQUIRED ) +- printf ("required " ); +- if( argument_class->flags & VIPS_ARGUMENT_CONSTRUCT ) +- printf ("construct " ); +- if( argument_class->flags & VIPS_ARGUMENT_SET_ONCE ) +- printf ("set-once " ); +- if( argument_instance->assigned ) +- printf ("assigned " ); +- printf( "\n" ); +- +- return( NULL ); ++ printf(" %s: offset = %d ", ++ g_param_spec_get_name(argument->pspec), ++ argument_class->offset); ++ if (argument_class->flags & VIPS_ARGUMENT_REQUIRED) ++ printf("required "); ++ if (argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) ++ printf("construct "); ++ if (argument_class->flags & VIPS_ARGUMENT_SET_ONCE) ++ printf("set-once "); ++ if (argument_instance->assigned) ++ printf("assigned "); ++ printf("\n"); ++ ++ return (NULL); + } + + static void +-vips_operation_dump( VipsObject *object, VipsBuf *buf ) ++vips_operation_dump(VipsObject *object, VipsBuf *buf) + { +- VipsOperation *operation = VIPS_OPERATION( object ); +- VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsOperation *operation = VIPS_OPERATION(object); ++ VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS(object); + +- if( operation->found_hash ) +- printf( "hash = %x\n", operation->hash ); +- printf( "%s args:\n", object_class->nickname ); +- vips_argument_map( VIPS_OBJECT( operation ), +- vips_operation_call_argument, NULL, NULL ); ++ if (operation->found_hash) ++ printf("hash = %x\n", operation->hash); ++ printf("%s args:\n", object_class->nickname); ++ vips_argument_map(VIPS_OBJECT(operation), ++ vips_operation_call_argument, NULL, NULL); + +- VIPS_OBJECT_CLASS( vips_operation_parent_class )->dump( object, buf ); ++ VIPS_OBJECT_CLASS(vips_operation_parent_class)->dump(object, buf); + } + + static void * +-vips_operation_vips_operation_print_summary_arg( VipsObject *object, ++vips_operation_vips_operation_print_summary_arg(VipsObject *object, + GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { + VipsBuf *buf = (VipsBuf *) a; + +- /* Just assigned input and output construct args. _summary() is used ++ /* Just assigned input and output construct args. _summary() is used + * for things like cache tracing, so it's useful to show output args. + */ +- if( ((argument_class->flags & VIPS_ARGUMENT_INPUT) || +- (argument_class->flags & VIPS_ARGUMENT_OUTPUT)) && ++ if (((argument_class->flags & VIPS_ARGUMENT_INPUT) || ++ (argument_class->flags & VIPS_ARGUMENT_OUTPUT)) && + (argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) && +- argument_instance->assigned ) { +- const char *name = g_param_spec_get_name( pspec ); +- GType type = G_PARAM_SPEC_VALUE_TYPE( pspec ); ++ argument_instance->assigned) { ++ const char *name = g_param_spec_get_name(pspec); ++ GType type = G_PARAM_SPEC_VALUE_TYPE(pspec); + +- GValue gvalue = { 0, }; ++ GValue gvalue = { ++ 0, ++ }; + char *str; + +- g_value_init( &gvalue, type ); +- g_object_get_property( G_OBJECT( object ), name, &gvalue ); +- str = g_strdup_value_contents( &gvalue ); +- vips_buf_appendf( buf, " %s=%s", name, str ); +- g_free( str ); +- g_value_unset( &gvalue ); ++ g_value_init(&gvalue, type); ++ g_object_get_property(G_OBJECT(object), name, &gvalue); ++ str = g_strdup_value_contents(&gvalue); ++ vips_buf_appendf(buf, " %s=%s", name, str); ++ g_free(str); ++ g_value_unset(&gvalue); + } + +- return( NULL ); ++ return (NULL); + } + + static int +-vips_operation_build( VipsObject *object ) ++vips_operation_build(VipsObject *object) + { +- VipsOperationClass *class = VIPS_OPERATION_GET_CLASS( object ); ++ VipsOperationClass *class = VIPS_OPERATION_GET_CLASS(object); + + #ifdef VIPS_DEBUG +- printf( "vips_operation_build: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_operation_build: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*VIPS_DEBUG*/ + +- if( class->flags & VIPS_OPERATION_BLOCKED ) { +- vips_error( VIPS_OBJECT_CLASS( class )->nickname, +- "%s", _( "operation is blocked" ) ); +- return( -1 ); ++ if (class->flags & VIPS_OPERATION_BLOCKED) { ++ vips_error(VIPS_OBJECT_CLASS(class)->nickname, ++ "%s", _("operation is blocked")); ++ return (-1); + } + +- if( VIPS_OBJECT_CLASS( vips_operation_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_operation_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_operation_summary( VipsObject *object, VipsBuf *buf ) ++vips_operation_summary(VipsObject *object, VipsBuf *buf) + { +- VipsOperation *operation = VIPS_OPERATION( object ); +- VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsOperation *operation = VIPS_OPERATION(object); ++ VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS(object); + +- vips_buf_appendf( buf, "%s", object_class->nickname ); +- vips_argument_map( VIPS_OBJECT( operation ), +- vips_operation_vips_operation_print_summary_arg, buf, NULL ); ++ vips_buf_appendf(buf, "%s", object_class->nickname); ++ vips_argument_map(VIPS_OBJECT(operation), ++ vips_operation_vips_operation_print_summary_arg, buf, NULL); + +- vips_buf_appends( buf, " -" ); ++ vips_buf_appends(buf, " -"); + +- VIPS_OBJECT_CLASS( vips_operation_parent_class )-> +- summary( object, buf ); ++ VIPS_OBJECT_CLASS(vips_operation_parent_class)->summary(object, buf); + } + + static VipsOperationFlags +-vips_operation_real_get_flags( VipsOperation *operation ) ++vips_operation_real_get_flags(VipsOperation *operation) + { +- VipsOperationClass *class = VIPS_OPERATION_GET_CLASS( operation ); ++ VipsOperationClass *class = VIPS_OPERATION_GET_CLASS(operation); + +- return( class->flags ); ++ return (class->flags); + } + + static void +-vips_operation_class_init( VipsOperationClass *class ) ++vips_operation_class_init(VipsOperationClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->finalize = vips_operation_finalize; + gobject_class->dispose = vips_operation_dispose; +@@ -601,22 +599,22 @@ vips_operation_class_init( VipsOperationClass *class ) + vobject_class->summary = vips_operation_summary; + vobject_class->dump = vips_operation_dump; + vobject_class->nickname = "operation"; +- vobject_class->description = _( "operations" ); ++ vobject_class->description = _("operations"); + + class->usage = vips_operation_usage; + class->get_flags = vips_operation_real_get_flags; + +- vips_operation_signals[SIG_INVALIDATE] = g_signal_new( "invalidate", +- G_TYPE_FROM_CLASS( class ), ++ vips_operation_signals[SIG_INVALIDATE] = g_signal_new("invalidate", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_RUN_LAST, +- G_STRUCT_OFFSET( VipsOperationClass, invalidate ), ++ G_STRUCT_OFFSET(VipsOperationClass, invalidate), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, +- G_TYPE_NONE, 0 ); ++ G_TYPE_NONE, 0); + } + + static void +-vips_operation_init( VipsOperation *operation ) ++vips_operation_init(VipsOperation *operation) + { + } + +@@ -629,11 +627,11 @@ vips_operation_init( VipsOperation *operation ) + * Returns: 0 on success, or -1 on error. + */ + VipsOperationFlags +-vips_operation_get_flags( VipsOperation *operation ) ++vips_operation_get_flags(VipsOperation *operation) + { +- VipsOperationClass *class = VIPS_OPERATION_GET_CLASS( operation ); ++ VipsOperationClass *class = VIPS_OPERATION_GET_CLASS(operation); + +- return( class->get_flags( operation ) ); ++ return (class->get_flags(operation)); + } + + /** +@@ -643,24 +641,24 @@ vips_operation_get_flags( VipsOperation *operation ) + * Print a usage message for the operation to stdout. + */ + void +-vips_operation_class_print_usage( VipsOperationClass *operation_class ) ++vips_operation_class_print_usage(VipsOperationClass *operation_class) + { + char str[4096]; +- VipsBuf buf = VIPS_BUF_STATIC( str ); ++ VipsBuf buf = VIPS_BUF_STATIC(str); + +- operation_class->usage( operation_class, &buf ); +- printf( "%s", vips_buf_all( &buf ) ); ++ operation_class->usage(operation_class, &buf); ++ printf("%s", vips_buf_all(&buf)); + } + + void +-vips_operation_invalidate( VipsOperation *operation ) ++vips_operation_invalidate(VipsOperation *operation) + { + #ifdef VIPS_DEBUG +- printf( "vips_operation_invalidate: %p\n", operation ); +- vips_object_print_summary( VIPS_OBJECT( operation ) ); ++ printf("vips_operation_invalidate: %p\n", operation); ++ vips_object_print_summary(VIPS_OBJECT(operation)); + #endif /*VIPS_DEBUG*/ + +- g_signal_emit( operation, vips_operation_signals[SIG_INVALIDATE], 0 ); ++ g_signal_emit(operation, vips_operation_signals[SIG_INVALIDATE], 0); + } + + /** +@@ -668,15 +666,15 @@ vips_operation_invalidate( VipsOperation *operation ) + * @name: nickname of operation to create + * + * Return a new #VipsOperation with the specified nickname. Useful for +- * language bindings. ++ * language bindings. + * +- * You'll need to set any arguments and build the operation before you can use +- * it. See vips_call() for a higher-level way to make new operations. ++ * You'll need to set any arguments and build the operation before you can use ++ * it. See vips_call() for a higher-level way to make new operations. + * +- * Returns: (transfer full): the new operation. ++ * Returns: (transfer full): the new operation. + */ + VipsOperation * +-vips_operation_new( const char *name ) ++vips_operation_new(const char *name) + { + GType type; + VipsObject *object; +@@ -684,23 +682,23 @@ vips_operation_new( const char *name ) + + vips_check_init(); + +- if( !(type = vips_type_find( "VipsOperation", name )) ) { +- vips_error( "VipsOperation", +- _( "class \"%s\" not found" ), name ); +- return( NULL ); ++ if (!(type = vips_type_find("VipsOperation", name))) { ++ vips_error("VipsOperation", ++ _("class \"%s\" not found"), name); ++ return (NULL); + } + +- if( !(object = g_object_new( type, NULL )) ) { +- vips_error( "VipsOperation", +- _( "\"%s\" is not an instantiable class" ), name ); +- return( NULL ); ++ if (!(object = g_object_new(type, NULL))) { ++ vips_error("VipsOperation", ++ _("\"%s\" is not an instantiable class"), name); ++ return (NULL); + } + +- operation = VIPS_OPERATION( object ); ++ operation = VIPS_OPERATION(object); + +- VIPS_DEBUG_MSG( "vips_operation_new: %s (%p)\n", name, operation ); ++ VIPS_DEBUG_MSG("vips_operation_new: %s (%p)\n", name, operation); + +- return( operation ); ++ return (operation); + } + + /* Some systems do not have va_copy() ... this might work (it does on MSVC, +@@ -709,78 +707,81 @@ vips_operation_new( const char *name ) + * FIXME ... this should be in configure.in + */ + #ifndef va_copy +-#define va_copy(d,s) ((d) = (s)) ++#define va_copy(d, s) ((d) = (s)) + #endif + + static int +-vips_operation_set_valist_required( VipsOperation *operation, va_list ap ) ++vips_operation_set_valist_required(VipsOperation *operation, va_list ap) + { +- VIPS_DEBUG_MSG( "vips_operation_set_valist_required:\n" ); ++ VIPS_DEBUG_MSG("vips_operation_set_valist_required:\n"); + +- /* Set required input arguments. Can't use vips_argument_map here +- * :-( because passing va_list by reference is not portable. ++ /* Set required input arguments. Can't use vips_argument_map here ++ * :-( because passing va_list by reference is not portable. + */ +- VIPS_ARGUMENT_FOR_ALL( operation, +- pspec, argument_class, argument_instance ) { ++ VIPS_ARGUMENT_FOR_ALL(operation, ++ pspec, argument_class, argument_instance) ++ { + +- g_assert( argument_instance ); ++ g_assert(argument_instance); + + /* We skip deprecated required args. There will be a new, + * renamed arg in the same place. + */ +- if( (argument_class->flags & VIPS_ARGUMENT_REQUIRED) && +- !(argument_class->flags & VIPS_ARGUMENT_DEPRECATED) ) { +- VIPS_ARGUMENT_COLLECT_SET( pspec, argument_class, ap ); ++ if ((argument_class->flags & VIPS_ARGUMENT_REQUIRED) && ++ !(argument_class->flags & VIPS_ARGUMENT_DEPRECATED)) { ++ VIPS_ARGUMENT_COLLECT_SET(pspec, argument_class, ap); + + #ifdef VIPS_DEBUG + { + char *str; + +- str = g_strdup_value_contents( &value ); +- VIPS_DEBUG_MSG( "\t%s = %s\n", +- g_param_spec_get_name( pspec ), str ); +- g_free( str ); ++ str = g_strdup_value_contents(&value); ++ VIPS_DEBUG_MSG("\t%s = %s\n", ++ g_param_spec_get_name(pspec), str); ++ g_free(str); + } + #endif /*VIPS_DEBUG */ + +- g_object_set_property( G_OBJECT( operation ), +- g_param_spec_get_name( pspec ), &value ); ++ g_object_set_property(G_OBJECT(operation), ++ g_param_spec_get_name(pspec), &value); + +- VIPS_ARGUMENT_COLLECT_GET( pspec, argument_class, ap ); ++ VIPS_ARGUMENT_COLLECT_GET(pspec, argument_class, ap); + + #ifdef VIPS_DEBUG +- printf( "\tskipping arg %p for %s\n", +- arg, g_param_spec_get_name( pspec ) ); ++ printf("\tskipping arg %p for %s\n", ++ arg, g_param_spec_get_name(pspec)); + #endif /*VIPS_DEBUG */ + + VIPS_ARGUMENT_COLLECT_END + } +- } VIPS_ARGUMENT_FOR_ALL_END ++ } ++ VIPS_ARGUMENT_FOR_ALL_END + +- return( 0 ); ++ return (0); + } + + static int +-vips_operation_get_valist_required( VipsOperation *operation, va_list ap ) ++vips_operation_get_valist_required(VipsOperation *operation, va_list ap) + { +- VIPS_DEBUG_MSG( "vips_operation_get_valist_required:\n" ); ++ VIPS_DEBUG_MSG("vips_operation_get_valist_required:\n"); + +- /* Extract output arguments. Can't use vips_argument_map here +- * :-( because passing va_list by reference is not portable. ++ /* Extract output arguments. Can't use vips_argument_map here ++ * :-( because passing va_list by reference is not portable. + */ +- VIPS_ARGUMENT_FOR_ALL( operation, +- pspec, argument_class, argument_instance ) { +- if( (argument_class->flags & VIPS_ARGUMENT_REQUIRED) ) { +- VIPS_ARGUMENT_COLLECT_SET( pspec, argument_class, ap ); ++ VIPS_ARGUMENT_FOR_ALL(operation, ++ pspec, argument_class, argument_instance) ++ { ++ if ((argument_class->flags & VIPS_ARGUMENT_REQUIRED)) { ++ VIPS_ARGUMENT_COLLECT_SET(pspec, argument_class, ap); + +- VIPS_ARGUMENT_COLLECT_GET( pspec, argument_class, ap ); ++ VIPS_ARGUMENT_COLLECT_GET(pspec, argument_class, ap); + +- if( !argument_instance->assigned ) ++ if (!argument_instance->assigned) + continue; + + #ifdef VIPS_DEBUG +- printf( "\twriting %s to %p\n", +- g_param_spec_get_name( pspec ), arg ); ++ printf("\twriting %s to %p\n", ++ g_param_spec_get_name(pspec), arg); + #endif /*VIPS_DEBUG */ + + /* It'd be nice to be able to test for arg being a +@@ -793,102 +794,103 @@ vips_operation_get_valist_required( VipsOperation *operation, va_list ap ) + * to get coredumps. + */ + +- g_object_get( G_OBJECT( operation ), +- g_param_spec_get_name( pspec ), arg, NULL ); ++ g_object_get(G_OBJECT(operation), ++ g_param_spec_get_name(pspec), arg, NULL); + + /* If the pspec is an object, that will up the ref + * count. We want to hand over the ref, so we have to + * knock it down again. + */ +- if( G_IS_PARAM_SPEC_OBJECT( pspec ) ) { ++ if (G_IS_PARAM_SPEC_OBJECT(pspec)) { + GObject *object; + + object = *((GObject **) arg); +- g_object_unref( object ); ++ g_object_unref(object); + } + + VIPS_ARGUMENT_COLLECT_END + } +- } VIPS_ARGUMENT_FOR_ALL_END ++ } ++ VIPS_ARGUMENT_FOR_ALL_END + +- return( 0 ); ++ return (0); + } + + static int +-vips_operation_get_valist_optional( VipsOperation *operation, va_list ap ) ++vips_operation_get_valist_optional(VipsOperation *operation, va_list ap) + { + char *name; + +- VIPS_DEBUG_MSG( "vips_operation_get_valist_optional:\n" ); ++ VIPS_DEBUG_MSG("vips_operation_get_valist_optional:\n"); + +- for( name = va_arg( ap, char * ); name; name = va_arg( ap, char * ) ) { ++ for (name = va_arg(ap, char *); name; name = va_arg(ap, char *)) { + GParamSpec *pspec; + VipsArgumentClass *argument_class; + VipsArgumentInstance *argument_instance; + +- VIPS_DEBUG_MSG( "\tname = '%s' (%p)\n", name, name ); ++ VIPS_DEBUG_MSG("\tname = '%s' (%p)\n", name, name); + +- if( vips_object_get_argument( VIPS_OBJECT( operation ), name, +- &pspec, &argument_class, &argument_instance ) ) +- return( -1 ); ++ if (vips_object_get_argument(VIPS_OBJECT(operation), name, ++ &pspec, &argument_class, &argument_instance)) ++ return (-1); + +- VIPS_ARGUMENT_COLLECT_SET( pspec, argument_class, ap ); ++ VIPS_ARGUMENT_COLLECT_SET(pspec, argument_class, ap); + + /* We must collect input args as we walk the name/value list, + * but we don't do anything with them. + */ + +- VIPS_ARGUMENT_COLLECT_GET( pspec, argument_class, ap ); ++ VIPS_ARGUMENT_COLLECT_GET(pspec, argument_class, ap); + + /* Here's an output arg. + */ + + #ifdef VIPS_DEBUG +- printf( "\twriting %s to %p\n", +- g_param_spec_get_name( pspec ), arg ); ++ printf("\twriting %s to %p\n", ++ g_param_spec_get_name(pspec), arg); + #endif /*VIPS_DEBUG */ + + /* If the dest pointer is NULL, skip the read. + */ +- if( arg ) { +- g_object_get( G_OBJECT( operation ), +- g_param_spec_get_name( pspec ), arg, +- NULL ); ++ if (arg) { ++ g_object_get(G_OBJECT(operation), ++ g_param_spec_get_name(pspec), arg, ++ NULL); + +- /* If the pspec is an object, that will up +- * the ref count. We want to hand over the ++ /* If the pspec is an object, that will up ++ * the ref count. We want to hand over the + * ref, so we have to knock it down again. + */ +- if( G_IS_PARAM_SPEC_OBJECT( pspec ) ) { ++ if (G_IS_PARAM_SPEC_OBJECT(pspec)) { + GObject *object; + + object = *((GObject **) arg); +- g_object_unref( object ); ++ g_object_unref(object); + } + } + + VIPS_ARGUMENT_COLLECT_END + } + +- return( 0 ); ++ return (0); + } + + /** + * vips_call_required_optional: + * @operation: the operation to execute + * @required: %va_list of required arguments +- * @optional: NULL-terminated %va_list of name / value pairs ++ * @optional: NULL-terminated %va_list of name / value pairs + * +- * This is the main entry point for the C and C++ varargs APIs. @operation +- * is executed, supplying @required and @optional arguments. ++ * This is the main entry point for the C and C++ varargs APIs. @operation ++ * is executed, supplying @required and @optional arguments. + * + * Beware, this can change @operation to point at an old, cached one. + * + * Returns: 0 on success, -1 on error + */ + int +-vips_call_required_optional( VipsOperation **operation, +- va_list required, va_list optional ) ++vips_call_required_optional(VipsOperation **operation, ++ va_list required, va_list optional) + { + int result; + va_list a; +@@ -898,75 +900,75 @@ vips_call_required_optional( VipsOperation **operation, + * vips_operation_set_valist_required() etc. will destructively alter + * the passed-in va_list. We make a copy and walk that instead. + */ +- va_copy( a, required ); +- va_copy( b, optional ); +- result = vips_operation_set_valist_required( *operation, a ) || +- vips_object_set_valist( VIPS_OBJECT( *operation ), b ); +- va_end( a ); +- va_end( b ); ++ va_copy(a, required); ++ va_copy(b, optional); ++ result = vips_operation_set_valist_required(*operation, a) || ++ vips_object_set_valist(VIPS_OBJECT(*operation), b); ++ va_end(a); ++ va_end(b); + +- if( result ) +- return( -1 ); ++ if (result) ++ return (-1); + + /* Build from cache. + */ +- if( vips_cache_operation_buildp( operation ) ) +- return( -1 ); ++ if (vips_cache_operation_buildp(operation)) ++ return (-1); + + /* Walk args again, writing output. + */ +- va_copy( a, required ); +- va_copy( b, optional ); +- result = vips_operation_get_valist_required( *operation, required ) || +- vips_operation_get_valist_optional( *operation, optional ); +- va_end( a ); +- va_end( b ); +- +- return( result ); ++ va_copy(a, required); ++ va_copy(b, optional); ++ result = vips_operation_get_valist_required(*operation, required) || ++ vips_operation_get_valist_optional(*operation, optional); ++ va_end(a); ++ va_end(b); ++ ++ return (result); + } + + static int +-vips_call_by_name( const char *operation_name, +- const char *option_string, va_list required, va_list optional ) ++vips_call_by_name(const char *operation_name, ++ const char *option_string, va_list required, va_list optional) + { + VipsOperation *operation; + int result; + +- VIPS_DEBUG_MSG( "vips_call_by_name: starting for %s ...\n", +- operation_name ); ++ VIPS_DEBUG_MSG("vips_call_by_name: starting for %s ...\n", ++ operation_name); + +- if( !(operation = vips_operation_new( operation_name )) ) +- return( -1 ); ++ if (!(operation = vips_operation_new(operation_name))) ++ return (-1); + + /* Set str options before vargs options, so the user can't override + * things we set deliberately. + */ +- if( option_string && +- vips_object_set_from_string( VIPS_OBJECT( operation ), +- option_string ) ) { +- vips_object_unref_outputs( VIPS_OBJECT( operation ) ); +- g_object_unref( operation ); ++ if (option_string && ++ vips_object_set_from_string(VIPS_OBJECT(operation), ++ option_string)) { ++ vips_object_unref_outputs(VIPS_OBJECT(operation)); ++ g_object_unref(operation); + +- return( -1 ); ++ return (-1); + } + +- result = vips_call_required_optional( &operation, required, optional ); ++ result = vips_call_required_optional(&operation, required, optional); + + /* Build failed: junk args and back out. + */ +- if( result ) { +- vips_object_unref_outputs( VIPS_OBJECT( operation ) ); +- g_object_unref( operation ); ++ if (result) { ++ vips_object_unref_outputs(VIPS_OBJECT(operation)); ++ g_object_unref(operation); + +- return( -1 ); ++ return (-1); + } + +- /* The operation we have built should now have been reffed by one of ++ /* The operation we have built should now have been reffed by one of + * its arguments or have finished its work. Either way, we can unref. + */ +- g_object_unref( operation ); ++ g_object_unref(operation); + +- return( result ); ++ return (result); + } + + /** +@@ -976,11 +978,11 @@ vips_call_by_name( const char *operation_name, + * + * vips_call() calls the named operation, passing in required arguments and + * then setting any optional ones from the remainder of the arguments as a set +- * of name/value pairs. ++ * of name/value pairs. + * +- * For example, vips_embed() takes six required arguments, @in, @out, @x, @y, ++ * For example, vips_embed() takes six required arguments, @in, @out, @x, @y, + * @width, @height, and has two optional arguments, @extend and @background. +- * You can run it with vips_call() like this: ++ * You can run it with vips_call() like this: + * + * |[ + * VipsImage *in = ... +@@ -993,110 +995,112 @@ vips_call_by_name( const char *operation_name, + * ]| + * + * Normally of course you'd just use the vips_embed() wrapper function and get +- * type-safety for the required arguments. ++ * type-safety for the required arguments. + * + * See also: vips_call_split(), vips_call_options(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_call( const char *operation_name, ... ) ++vips_call(const char *operation_name, ...) + { + VipsOperation *operation; + int result; + va_list required; + va_list optional; + +- if( !(operation = vips_operation_new( operation_name )) ) +- return( -1 ); ++ if (!(operation = vips_operation_new(operation_name))) ++ return (-1); + +- /* We have to break the va_list into separate required and optional ++ /* We have to break the va_list into separate required and optional + * components. + * + * Note the start, grab the required, then copy and reuse. + */ +- va_start( required, operation_name ); ++ va_start(required, operation_name); + +- va_copy( optional, required ); ++ va_copy(optional, required); + +- VIPS_ARGUMENT_FOR_ALL( operation, +- pspec, argument_class, argument_instance ) { ++ VIPS_ARGUMENT_FOR_ALL(operation, ++ pspec, argument_class, argument_instance) ++ { + +- g_assert( argument_instance ); ++ g_assert(argument_instance); + +- if( (argument_class->flags & VIPS_ARGUMENT_REQUIRED) ) { +- VIPS_ARGUMENT_COLLECT_SET( pspec, argument_class, +- optional ); ++ if ((argument_class->flags & VIPS_ARGUMENT_REQUIRED)) { ++ VIPS_ARGUMENT_COLLECT_SET(pspec, argument_class, ++ optional); + +- VIPS_ARGUMENT_COLLECT_GET( pspec, argument_class, +- optional ); ++ VIPS_ARGUMENT_COLLECT_GET(pspec, argument_class, ++ optional); + + VIPS_ARGUMENT_COLLECT_END + } +- } VIPS_ARGUMENT_FOR_ALL_END ++ } ++ VIPS_ARGUMENT_FOR_ALL_END + + /* We just needed this operation for the arg loop. + */ +- g_object_unref( operation ); ++ g_object_unref(operation); + +- result = vips_call_by_name( operation_name, NULL, required, optional ); ++ result = vips_call_by_name(operation_name, NULL, required, optional); + +- va_end( required ); +- va_end( optional ); ++ va_end(required); ++ va_end(optional); + +- return( result ); ++ return (result); + } + + int +-vips_call_split( const char *operation_name, va_list optional, ... ) ++vips_call_split(const char *operation_name, va_list optional, ...) + { + int result; + va_list required; + +- va_start( required, optional ); +- result = vips_call_by_name( operation_name, NULL, +- required, optional ); +- va_end( required ); ++ va_start(required, optional); ++ result = vips_call_by_name(operation_name, NULL, ++ required, optional); ++ va_end(required); + +- return( result ); ++ return (result); + } + + int +-vips_call_split_option_string( const char *operation_name, +- const char *option_string, va_list optional, ... ) ++vips_call_split_option_string(const char *operation_name, ++ const char *option_string, va_list optional, ...) + { + int result; + va_list required; + +- va_start( required, optional ); +- result = vips_call_by_name( operation_name, option_string, +- required, optional ); +- va_end( required ); ++ va_start(required, optional); ++ result = vips_call_by_name(operation_name, option_string, ++ required, optional); ++ va_end(required); + +- return( result ); ++ return (result); + } + + static void * +-vips_call_find_pspec( VipsObject *object, ++vips_call_find_pspec(VipsObject *object, + GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { + const char *name = (const char *) a; + + /* One char names we assume are "-x" style abbreviations, longer names + * we match the whole string. + */ +- if( !(argument_class->flags & VIPS_ARGUMENT_REQUIRED) && ++ if (!(argument_class->flags & VIPS_ARGUMENT_REQUIRED) && + (argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) && +- !argument_instance->assigned ) +- if( (strlen( name ) == 1 && +- g_param_spec_get_name( pspec )[0] == name[0]) || +- strcmp( g_param_spec_get_name( pspec ), name ) == 0 ) +- return( argument_instance ); ++ !argument_instance->assigned) ++ if ((strlen(name) == 1 && ++ g_param_spec_get_name(pspec)[0] == name[0]) || ++ strcmp(g_param_spec_get_name(pspec), name) == 0) ++ return (argument_instance); + +- return( NULL ); ++ return (NULL); + } + + /* Keep this stuff around for output args. +@@ -1107,8 +1111,8 @@ typedef struct _VipsCallOptionOutput { + } VipsCallOptionOutput; + + static int +-vips_call_option_output( VipsObject *object, +- VipsCallOptionOutput *output ) ++vips_call_option_output(VipsObject *object, ++ VipsCallOptionOutput *output) + { + VipsArgumentInstance *argument_instance = output->argument_instance; + GParamSpec *pspec = ((VipsArgument *) argument_instance)->pspec; +@@ -1116,26 +1120,26 @@ vips_call_option_output( VipsObject *object, + int result; + + /* Don't look at the output arg if _build() hasn't run sucessfully, it +- * probably won't have been set. ++ * probably won't have been set. + */ + result = 0; +- if( object->constructed ) +- result = vips_object_get_argument_to_string( object, +- g_param_spec_get_name( pspec ), output->value ); ++ if (object->constructed) ++ result = vips_object_get_argument_to_string(object, ++ g_param_spec_get_name(pspec), output->value); + +- return( result ); ++ return (result); + } + + static void +-vips_call_option_output_free( VipsObject *object, VipsCallOptionOutput *output ) ++vips_call_option_output_free(VipsObject *object, VipsCallOptionOutput *output) + { +- VIPS_FREE( output->value ); +- g_free( output ); ++ VIPS_FREE(output->value); ++ g_free(output); + } + + static gboolean +-vips_call_options_set( const gchar *option_name, const gchar *value, +- gpointer data, GError **error ) ++vips_call_options_set(const gchar *option_name, const gchar *value, ++ gpointer data, GError **error) + { + VipsOperation *operation = (VipsOperation *) data; + const char *name; +@@ -1143,127 +1147,129 @@ vips_call_options_set( const gchar *option_name, const gchar *value, + VipsArgumentClass *argument_class; + GParamSpec *pspec; + +- VIPS_DEBUG_MSG( "vips_call_options_set: %s = %s\n", +- option_name, value ); ++ VIPS_DEBUG_MSG("vips_call_options_set: %s = %s\n", ++ option_name, value); + + /* Remove any leading "--" from the option name. + */ +- for( name = option_name; *name == '-'; name++ ) ++ for (name = option_name; *name == '-'; name++) + ; + +- if( !(argument_instance = (VipsArgumentInstance *) +- vips_argument_map( +- VIPS_OBJECT( operation ), +- vips_call_find_pspec, (void *) name, NULL )) ) { +- vips_error( VIPS_OBJECT_GET_CLASS( operation )->nickname, +- _( "unknown argument '%s'" ), name ); +- vips_error_g( error ); +- return( FALSE ); ++ if (!(argument_instance = (VipsArgumentInstance *) ++ vips_argument_map( ++ VIPS_OBJECT(operation), ++ vips_call_find_pspec, (void *) name, NULL))) { ++ vips_error(VIPS_OBJECT_GET_CLASS(operation)->nickname, ++ _("unknown argument '%s'"), name); ++ vips_error_g(error); ++ return (FALSE); + } + argument_class = argument_instance->argument_class; + pspec = ((VipsArgument *) argument_instance)->pspec; + +- if( (argument_class->flags & VIPS_ARGUMENT_INPUT) ) { +- if( vips_object_set_argument_from_string( +- VIPS_OBJECT( operation ), +- g_param_spec_get_name( pspec ), value ) ) { +- vips_error_g( error ); +- return( FALSE ); ++ if ((argument_class->flags & VIPS_ARGUMENT_INPUT)) { ++ if (vips_object_set_argument_from_string( ++ VIPS_OBJECT(operation), ++ g_param_spec_get_name(pspec), value)) { ++ vips_error_g(error); ++ return (FALSE); + } + + #ifdef VIPS_DEBUG +-{ +- GType type = G_PARAM_SPEC_VALUE_TYPE( pspec ); +- GValue gvalue = { 0, }; +- char *str; +- +- g_value_init( &gvalue, type ); +- g_object_get_property( G_OBJECT( operation ), +- g_param_spec_get_name( pspec ), &gvalue ); +- str = g_strdup_value_contents( &gvalue ); +- VIPS_DEBUG_MSG( "\tGValue %s = %s\n", +- g_param_spec_get_name( pspec ), str ); +- g_free( str ); +- g_value_unset( &gvalue ); +-} ++ { ++ GType type = G_PARAM_SPEC_VALUE_TYPE(pspec); ++ GValue gvalue = { ++ 0, ++ }; ++ char *str; ++ ++ g_value_init(&gvalue, type); ++ g_object_get_property(G_OBJECT(operation), ++ g_param_spec_get_name(pspec), &gvalue); ++ str = g_strdup_value_contents(&gvalue); ++ VIPS_DEBUG_MSG("\tGValue %s = %s\n", ++ g_param_spec_get_name(pspec), str); ++ g_free(str); ++ g_value_unset(&gvalue); ++ } + #endif /*VIPS_DEBUG*/ + } +- else if( (argument_class->flags & VIPS_ARGUMENT_OUTPUT) ) { ++ else if ((argument_class->flags & VIPS_ARGUMENT_OUTPUT)) { + VipsCallOptionOutput *output; + + /* We can't do output now, we have to attach a callback to do + * the processing after the operation has run. + */ +- output = g_new( VipsCallOptionOutput, 1 ); ++ output = g_new(VipsCallOptionOutput, 1); + output->argument_instance = argument_instance; +- output->value = g_strdup( value ); +- g_signal_connect( operation, "postbuild", +- G_CALLBACK( vips_call_option_output ), +- output ); +- g_signal_connect( operation, "close", +- G_CALLBACK( vips_call_option_output_free ), +- output ); ++ output->value = g_strdup(value); ++ g_signal_connect(operation, "postbuild", ++ G_CALLBACK(vips_call_option_output), ++ output); ++ g_signal_connect(operation, "close", ++ G_CALLBACK(vips_call_option_output_free), ++ output); + } + +- return( TRUE ); ++ return (TRUE); + } + + static void * +-vips_call_options_add( VipsObject *object, ++vips_call_options_add(VipsObject *object, + GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { + GOptionGroup *group = (GOptionGroup *) a; + +- if( !(argument_class->flags & VIPS_ARGUMENT_REQUIRED) && ++ if (!(argument_class->flags & VIPS_ARGUMENT_REQUIRED) && + (argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) && +- !argument_instance->assigned ) { +- const char *name = g_param_spec_get_name( pspec ); +- gboolean needs_string = +- vips_object_argument_needsstring( object, name ); ++ !argument_instance->assigned) { ++ const char *name = g_param_spec_get_name(pspec); ++ gboolean needs_string = ++ vips_object_argument_needsstring(object, name); + GOptionEntry entry[2]; + + entry[0].long_name = name; +- entry[0].description = g_param_spec_get_blurb( pspec ); ++ entry[0].description = g_param_spec_get_blurb(pspec); + + /* Don't set short names for deprecated args. + */ +- if( argument_class->flags & VIPS_ARGUMENT_DEPRECATED ) ++ if (argument_class->flags & VIPS_ARGUMENT_DEPRECATED) + entry[0].short_name = '\0'; + else + entry[0].short_name = name[0]; + + entry[0].flags = 0; +- if( !needs_string ) ++ if (!needs_string) + entry[0].flags |= G_OPTION_FLAG_NO_ARG; +- if( argument_class->flags & VIPS_ARGUMENT_DEPRECATED ) ++ if (argument_class->flags & VIPS_ARGUMENT_DEPRECATED) + entry[0].flags |= G_OPTION_FLAG_HIDDEN; + + entry[0].arg = G_OPTION_ARG_CALLBACK; + entry[0].arg_data = (gpointer) vips_call_options_set; +- if( needs_string ) +- entry[0].arg_description = +- g_type_name( G_PARAM_SPEC_VALUE_TYPE( pspec ) ); ++ if (needs_string) ++ entry[0].arg_description = ++ g_type_name(G_PARAM_SPEC_VALUE_TYPE(pspec)); + else + entry[0].arg_description = NULL; + + entry[1].long_name = NULL; + +- VIPS_DEBUG_MSG( "vips_call_options_add: adding %s\n", name ); ++ VIPS_DEBUG_MSG("vips_call_options_add: adding %s\n", name); + +- g_option_group_add_entries( group, &entry[0] ); ++ g_option_group_add_entries(group, &entry[0]); + } + +- return( NULL ); ++ return (NULL); + } + + void +-vips_call_options( GOptionGroup *group, VipsOperation *operation ) ++vips_call_options(GOptionGroup *group, VipsOperation *operation) + { +- (void) vips_argument_map( VIPS_OBJECT( operation ), +- vips_call_options_add, group, NULL ); ++ (void) vips_argument_map(VIPS_OBJECT(operation), ++ vips_call_options_add, group, NULL); + } + + /* What we track during an argv call. +@@ -1276,89 +1282,89 @@ typedef struct _VipsCall { + } VipsCall; + + static const char * +-vips_call_get_arg( VipsCall *call, int i ) ++vips_call_get_arg(VipsCall *call, int i) + { +- if( i < 0 || +- i >= call->argc ) { +- vips_error( VIPS_OBJECT_GET_CLASS( call->operation )->nickname, +- "%s", _( "too few arguments" ) ); +- return( NULL ); ++ if (i < 0 || ++ i >= call->argc) { ++ vips_error(VIPS_OBJECT_GET_CLASS(call->operation)->nickname, ++ "%s", _("too few arguments")); ++ return (NULL); + } + +- return( call->argv[i] ); ++ return (call->argv[i]); + } + + static void * +-vips_call_argv_input( VipsObject *object, ++vips_call_argv_input(VipsObject *object, + GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { + VipsCall *call = (VipsCall *) a; + + /* Loop over all required construct args. + */ +- if( (argument_class->flags & VIPS_ARGUMENT_REQUIRED) && ++ if ((argument_class->flags & VIPS_ARGUMENT_REQUIRED) && + (argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) && +- !(argument_class->flags & VIPS_ARGUMENT_DEPRECATED) ) { +- const char *name = g_param_spec_get_name( pspec ); ++ !(argument_class->flags & VIPS_ARGUMENT_DEPRECATED)) { ++ const char *name = g_param_spec_get_name(pspec); + +- if( (argument_class->flags & VIPS_ARGUMENT_INPUT) ) { ++ if ((argument_class->flags & VIPS_ARGUMENT_INPUT)) { + const char *arg; + +- if( !(arg = vips_call_get_arg( call, call->i )) || +- vips_object_set_argument_from_string( object, +- name, arg ) ) +- return( pspec ); ++ if (!(arg = vips_call_get_arg(call, call->i)) || ++ vips_object_set_argument_from_string(object, ++ name, arg)) ++ return (pspec); + + call->i += 1; + } +- else if( (argument_class->flags & VIPS_ARGUMENT_OUTPUT) ) { +- if( vips_object_argument_needsstring( object, name ) ) ++ else if ((argument_class->flags & VIPS_ARGUMENT_OUTPUT)) { ++ if (vips_object_argument_needsstring(object, name)) + call->i += 1; + } + } + +- return( NULL ); ++ return (NULL); + } + + static void * +-vips_call_argv_output( VipsObject *object, ++vips_call_argv_output(VipsObject *object, + GParamSpec *pspec, + VipsArgumentClass *argument_class, + VipsArgumentInstance *argument_instance, +- void *a, void *b ) ++ void *a, void *b) + { + VipsCall *call = (VipsCall *) a; + + /* Loop over all required construct args. + */ +- if( (argument_class->flags & VIPS_ARGUMENT_REQUIRED) && ++ if ((argument_class->flags & VIPS_ARGUMENT_REQUIRED) && + (argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) && +- !(argument_class->flags & VIPS_ARGUMENT_DEPRECATED) ) { +- if( (argument_class->flags & VIPS_ARGUMENT_INPUT) ) ++ !(argument_class->flags & VIPS_ARGUMENT_DEPRECATED)) { ++ if ((argument_class->flags & VIPS_ARGUMENT_INPUT)) + call->i += 1; +- else if( (argument_class->flags & VIPS_ARGUMENT_OUTPUT) ) { +- const char *name = g_param_spec_get_name( pspec ); ++ else if ((argument_class->flags & VIPS_ARGUMENT_OUTPUT)) { ++ const char *name = g_param_spec_get_name(pspec); + const char *arg; + + arg = NULL; +- if( vips_object_argument_needsstring( object, name ) ) { +- arg = vips_call_get_arg( call, call->i ); +- if( !arg ) +- return( pspec ); ++ if (vips_object_argument_needsstring(object, name)) { ++ arg = vips_call_get_arg(call, call->i); ++ if (!arg) ++ return (pspec); + + call->i += 1; + } + +- if( vips_object_get_argument_to_string( object, +- name, arg ) ) +- return( pspec ); ++ if (vips_object_get_argument_to_string(object, ++ name, arg)) ++ return (pspec); + } + } + +- return( NULL ); ++ return (NULL); + } + + /* Our main command-line entry point. Optional args should have been set by +@@ -1369,22 +1375,22 @@ vips_call_argv_output( VipsObject *object, + * all code paths. + */ + int +-vips_call_argv( VipsOperation *operation, int argc, char **argv ) ++vips_call_argv(VipsOperation *operation, int argc, char **argv) + { + VipsCall call; + +- g_assert( argc >= 0 ); ++ g_assert(argc >= 0); + + #ifdef VIPS_DEBUG +- printf( "vips_call_argv: " ); +- vips_object_print_name( VIPS_OBJECT( operation ) ); +- printf( "\n" ); +-{ +- int i; +- +- for( i = 0; i < argc; i++ ) +- printf( "%d) %s\n", i, argv[i] ); +-} ++ printf("vips_call_argv: "); ++ vips_object_print_name(VIPS_OBJECT(operation)); ++ printf("\n"); ++ { ++ int i; ++ ++ for (i = 0; i < argc; i++) ++ printf("%d) %s\n", i, argv[i]); ++ } + #endif /*VIPS_DEBUG*/ + + call.operation = operation; +@@ -1392,67 +1398,67 @@ vips_call_argv( VipsOperation *operation, int argc, char **argv ) + call.argv = argv; + + call.i = 0; +- if( vips_argument_map( VIPS_OBJECT( operation ), +- vips_call_argv_input, &call, NULL ) ) +- return( -1 ); ++ if (vips_argument_map(VIPS_OBJECT(operation), ++ vips_call_argv_input, &call, NULL)) ++ return (-1); + + /* Any unused arguments? We must fail. Consider eg. "vips bandjoin a b + * c". This would overwrite b with a and ignore c, potentially + * disastrous. + */ +- if( argc > call.i ) { +- vips_error( VIPS_OBJECT_GET_CLASS( operation )->nickname, +- "%s", _( "too many arguments" ) ); +- return( -1 ); ++ if (argc > call.i) { ++ vips_error(VIPS_OBJECT_GET_CLASS(operation)->nickname, ++ "%s", _("too many arguments")); ++ return (-1); + } + + /* We can't use the operation cache, we need to be able to change the + * operation pointer. The cache probably wouldn't help anyway. + */ +- if( vips_object_build( VIPS_OBJECT( operation ) ) ) +- return( -1 ); ++ if (vips_object_build(VIPS_OBJECT(operation))) ++ return (-1); + + /* We're not using the cache, so we need to print the trace line. + */ +- if( vips__cache_trace ) { +- printf( "vips cache : " ); +- vips_object_print_summary( VIPS_OBJECT( operation ) ); ++ if (vips__cache_trace) { ++ printf("vips cache : "); ++ vips_object_print_summary(VIPS_OBJECT(operation)); + } + + call.i = 0; +- if( vips_argument_map( VIPS_OBJECT( operation ), +- vips_call_argv_output, &call, NULL ) ) +- return( -1 ); ++ if (vips_argument_map(VIPS_OBJECT(operation), ++ vips_call_argv_output, &call, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void * +-vips_operation_block_set_operation( VipsOperationClass *class, gboolean *state ) ++vips_operation_block_set_operation(VipsOperationClass *class, gboolean *state) + { +- g_assert( VIPS_IS_OPERATION_CLASS( class ) ); ++ g_assert(VIPS_IS_OPERATION_CLASS(class)); + + #ifdef VIPS_DEBUG +- if( ((class->flags & VIPS_OPERATION_BLOCKED) != 0) != *state ) +- VIPS_DEBUG_MSG( "vips_operation_block_set_operation: " +- "setting block state on %s = %d\n", +- VIPS_OBJECT_CLASS( class )->nickname, *state ); ++ if (((class->flags & VIPS_OPERATION_BLOCKED) != 0) != *state) ++ VIPS_DEBUG_MSG("vips_operation_block_set_operation: " ++ "setting block state on %s = %d\n", ++ VIPS_OBJECT_CLASS(class)->nickname, *state); + #endif + +- if( *state ) ++ if (*state) + class->flags |= VIPS_OPERATION_BLOCKED; + else + class->flags &= ~VIPS_OPERATION_BLOCKED; + +- return( NULL ); ++ return (NULL); + } + +-/** ++/** + * vips_operation_block_set: +- * @name: set block state at this point and below ++ * @name: set block state at this point and below + * @state: the block state to set + * +- * Set the block state on all operations in the libvips class hierarchy at ++ * Set the block state on all operations in the libvips class hierarchy at + * @name and below. + * + * For example: +@@ -1471,13 +1477,13 @@ vips_operation_block_set_operation( VipsOperationClass *class, gboolean *state ) + * See also: vips_block_untrusted_set(). + */ + void +-vips_operation_block_set( const char *name, gboolean state ) ++vips_operation_block_set(const char *name, gboolean state) + { + GType base; + +- if( (base = g_type_from_name( name )) && +- g_type_is_a( base, VIPS_TYPE_OPERATION ) ) +- vips_class_map_all( base, +- (VipsClassMapFn) vips_operation_block_set_operation, +- &state ); ++ if ((base = g_type_from_name(name)) && ++ g_type_is_a(base, VIPS_TYPE_OPERATION)) ++ vips_class_map_all(base, ++ (VipsClassMapFn) vips_operation_block_set_operation, ++ &state); + } +diff --git a/libvips/iofuncs/rect.c b/libvips/iofuncs/rect.c +index aeeec11999..3a0d80ca7f 100644 +--- a/libvips/iofuncs/rect.c ++++ b/libvips/iofuncs/rect.c +@@ -10,28 +10,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -62,26 +62,26 @@ + * @height: height of rectangle + * + * A #VipsRect is a rectangular area of pixels. This is a struct for +- * performing simple rectangle algebra. ++ * performing simple rectangle algebra. + */ + + /** + * vips_rect_includespoint: +- * @r: rectangle to test ++ * @r: rectangle to test + * @x: position to test for +- * @y: position to test for ++ * @y: position to test for + * + * Does @r contain point (@x, @y)? + * + * Returns: %TRUE if @r contains (@x, @y). + */ + gboolean +-vips_rect_includespoint( const VipsRect *r, int x, int y ) +-{ +- return( r->left <= x && ++vips_rect_includespoint(const VipsRect *r, int x, int y) ++{ ++ return (r->left <= x && + r->top <= y && + r->left + r->width > x && +- r->top + r->height > y ); ++ r->top + r->height > y); + } + + /** +@@ -93,9 +93,9 @@ vips_rect_includespoint( const VipsRect *r, int x, int y ) + * Returns: %TRUE if @r contains no pixels. + */ + gboolean +-vips_rect_isempty( const VipsRect *r ) +-{ +- return( r->width <= 0 || r->height <= 0 ); ++vips_rect_isempty(const VipsRect *r) ++{ ++ return (r->width <= 0 || r->height <= 0); + } + + /** +@@ -103,17 +103,17 @@ vips_rect_isempty( const VipsRect *r ) + * @r1: outer rectangle + * @r2: inner rectangle + * +- * Is @r2 a subset of @r1? ++ * Is @r2 a subset of @r1? + * + * Returns: %TRUE if @r2 is a subset of @r1. + */ + gboolean +-vips_rect_includesrect( const VipsRect *r1, const VipsRect *r2 ) ++vips_rect_includesrect(const VipsRect *r1, const VipsRect *r2) + { +- return( r1->left <= r2->left && ++ return (r1->left <= r2->left && + r1->top <= r2->top && + r1->left + r1->width >= r2->left + r2->width && +- r1->top + r1->height >= r2->top + r2->height ); ++ r1->top + r1->height >= r2->top + r2->height); + } + + /** +@@ -121,15 +121,15 @@ vips_rect_includesrect( const VipsRect *r1, const VipsRect *r2 ) + * @r1: first rectangle + * @r2: second rectangle + * +- * Is @r1 equal to @r2? ++ * Is @r1 equal to @r2? + * + * Returns: %TRUE if @r1 is equal to @r2. + */ + gboolean +-vips_rect_equalsrect( const VipsRect *r1, const VipsRect *r2 ) +-{ +- return( r1->left == r2->left && r1->top == r2->top && +- r1->width == r2->width && r1->height == r2->height ); ++vips_rect_equalsrect(const VipsRect *r1, const VipsRect *r2) ++{ ++ return (r1->left == r2->left && r1->top == r2->top && ++ r1->width == r2->width && r1->height == r2->height); + } + + /** +@@ -142,13 +142,13 @@ vips_rect_equalsrect( const VipsRect *r1, const VipsRect *r2 ) + * Returns: %TRUE if @r2 and @r1 overlap. + */ + gboolean +-vips_rect_overlapsrect( const VipsRect *r1, const VipsRect *r2 ) ++vips_rect_overlapsrect(const VipsRect *r1, const VipsRect *r2) + { + VipsRect intersection; + +- vips_rect_intersectrect( r1, r2, &intersection ); ++ vips_rect_intersectrect(r1, r2, &intersection); + +- return( !vips_rect_isempty( &intersection ) ); ++ return (!vips_rect_isempty(&intersection)); + } + + /** +@@ -159,8 +159,8 @@ vips_rect_overlapsrect( const VipsRect *r1, const VipsRect *r2 ) + * Enlarge @r by @n. +1 means out one pixel. + */ + void +-vips_rect_marginadjust( VipsRect *r, int n ) +-{ ++vips_rect_marginadjust(VipsRect *r, int n) ++{ + r->left -= n; + r->top -= n; + r->width += 2 * n; +@@ -171,19 +171,19 @@ vips_rect_marginadjust( VipsRect *r, int n ) + * vips_rect_intersectrect: + * @r1: input rectangle 1 + * @r2: input rectangle 2 +- * @out: (out): output rectangle ++ * @out: (out): output rectangle + * + * Fill @out with the intersection of @r1 and @r2. @out can equal @r1 or @r2. + */ + void +-vips_rect_intersectrect( const VipsRect *r1, const VipsRect *r2, VipsRect *out ) +-{ +- int left = VIPS_MAX( r1->left, r2->left ); +- int top = VIPS_MAX( r1->top, r2->top ); +- int right = VIPS_MIN( VIPS_RECT_RIGHT( r1 ), VIPS_RECT_RIGHT( r2 ) ); +- int bottom = VIPS_MIN( VIPS_RECT_BOTTOM( r1 ), VIPS_RECT_BOTTOM( r2 ) ); +- int width = VIPS_MAX( 0, right - left ); +- int height = VIPS_MAX( 0, bottom - top ); ++vips_rect_intersectrect(const VipsRect *r1, const VipsRect *r2, VipsRect *out) ++{ ++ int left = VIPS_MAX(r1->left, r2->left); ++ int top = VIPS_MAX(r1->top, r2->top); ++ int right = VIPS_MIN(VIPS_RECT_RIGHT(r1), VIPS_RECT_RIGHT(r2)); ++ int bottom = VIPS_MIN(VIPS_RECT_BOTTOM(r1), VIPS_RECT_BOTTOM(r2)); ++ int width = VIPS_MAX(0, right - left); ++ int height = VIPS_MAX(0, bottom - top); + + out->left = left; + out->top = top; +@@ -195,24 +195,26 @@ vips_rect_intersectrect( const VipsRect *r1, const VipsRect *r2, VipsRect *out ) + * vips_rect_unionrect: + * @r1: input rectangle 1 + * @r2: input rectangle 2 +- * @out: (out): output rectangle ++ * @out: (out): output rectangle + * + * Fill @out with the bounding box of @r1 and @r2. @out can equal @r1 or @r2. + */ + void +-vips_rect_unionrect( const VipsRect *r1, const VipsRect *r2, VipsRect *out ) +-{ +- if( vips_rect_isempty( r1 ) ) ++vips_rect_unionrect(const VipsRect *r1, const VipsRect *r2, VipsRect *out) ++{ ++ if (vips_rect_isempty(r1)) + *out = *r2; +- else if( vips_rect_isempty( r2 ) ) ++ else if (vips_rect_isempty(r2)) + *out = *r1; + else { +- int left = VIPS_MIN( r1->left, r2->left ); +- int top = VIPS_MIN( r1->top, r2->top ); +- int width = VIPS_MAX( VIPS_RECT_RIGHT( r1 ), +- VIPS_RECT_RIGHT( r2 ) ) - left; +- int height = VIPS_MAX( VIPS_RECT_BOTTOM( r1 ), +- VIPS_RECT_BOTTOM( r2 ) )- top; ++ int left = VIPS_MIN(r1->left, r2->left); ++ int top = VIPS_MIN(r1->top, r2->top); ++ int width = VIPS_MAX(VIPS_RECT_RIGHT(r1), ++ VIPS_RECT_RIGHT(r2)) - ++ left; ++ int height = VIPS_MAX(VIPS_RECT_BOTTOM(r1), ++ VIPS_RECT_BOTTOM(r2)) - ++ top; + + out->left = left; + out->top = top; +@@ -230,15 +232,15 @@ vips_rect_unionrect( const VipsRect *r1, const VipsRect *r2, VipsRect *out ) + * Returns: (transfer full): a pointer to copy of @r allocated on the heap. + */ + VipsRect * +-vips_rect_dup( const VipsRect *r ) ++vips_rect_dup(const VipsRect *r) + { + VipsRect *out; + +- if( !(out = VIPS_NEW( NULL, VipsRect )) ) +- return( NULL ); ++ if (!(out = VIPS_NEW(NULL, VipsRect))) ++ return (NULL); + *out = *r; + +- return( out ); ++ return (out); + } + + /** +@@ -249,13 +251,13 @@ vips_rect_dup( const VipsRect *r ) + * rect. + */ + void +-vips_rect_normalise( VipsRect *r ) ++vips_rect_normalise(VipsRect *r) + { +- if( r->width < 0 ) { ++ if (r->width < 0) { + r->left += r->width; + r->width *= -1; + } +- if( r->height < 0 ) { ++ if (r->height < 0) { + r->top += r->height; + r->height *= -1; + } +diff --git a/libvips/iofuncs/region.c b/libvips/iofuncs/region.c +index 98ab2e2696..c90c8b4564 100644 +--- a/libvips/iofuncs/region.c ++++ b/libvips/iofuncs/region.c +@@ -1,5 +1,5 @@ + /* Make and destroy partial image regions. +- * ++ * + * J.Cupitt, 8/4/93. + * 1/7/93 JC + * - adapted for partial v2 +@@ -46,7 +46,7 @@ + * 13/6/18 harukizaemon + * - add VipsRegionShrink parameter to vips_region_shrink() + * 9/6/19 +- * - saner behaviour for vips_region_fetch() if the request is partly ++ * - saner behaviour for vips_region_fetch() if the request is partly + * outside the image + * 22/2/21 f1ac + * - fix int overflow in vips_region_copy(), could cause crashes with +@@ -55,33 +55,33 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + + /* +-#define DEBUG_MOVE ++#define DEBUG_MOVE + #define DEBUG_ENVIRONMENT 1 + #define DEBUG_CREATE + #define DEBUG +@@ -109,7 +109,7 @@ + * SECTION: region + * @short_description: small, rectangular parts of images + * @stability: Stable +- * @see_also: image, ++ * @see_also: image, + * generate + * @include: vips/vips.h + * +@@ -136,7 +136,7 @@ + * @valid: the #VipsRect of pixels that this region represents + * + * A small part of a #VipsImage. @valid holds the left/top/width/height of the +- * area of pixels that are available from the region. ++ * area of pixels that are available from the region. + * + * See also: VIPS_REGION_ADDR(), vips_region_new(), vips_region_prepare(). + */ +@@ -168,9 +168,9 @@ + * @X: x coordinate + * @Y: y coordinate + * +- * This macro returns a pointer to a pixel in a region. The (@X, @Y) ++ * This macro returns a pointer to a pixel in a region. The (@X, @Y) + * coordinates need to be within the #VipsRect (@R->valid). +- * ++ * + * If DEBUG is defined, you get a version that checks bounds for you. + * + * See also: vips_region_prepare(). +@@ -182,11 +182,11 @@ + * VIPS_REGION_ADDR_TOPLEFT: + * @R: a #VipsRegion + * +- * This macro returns a pointer to the top-left pixel in the #VipsRegion, that ++ * This macro returns a pointer to the top-left pixel in the #VipsRegion, that + * is, the pixel at (@R->valid.left, @R->valid.top). + * + * See also: vips_region_prepare(). +- * ++ * + * Returns: The address of the top-left pixel in the region. + */ + +@@ -195,179 +195,179 @@ + enum { + PROP_IMAGE = 1, + PROP_LAST +-}; ++}; + +-G_DEFINE_TYPE( VipsRegion, vips_region, VIPS_TYPE_OBJECT ); ++G_DEFINE_TYPE(VipsRegion, vips_region, VIPS_TYPE_OBJECT); + + #ifdef VIPS_DEBUG + static GSList *vips__regions_all = NULL; + #endif /*VIPS_DEBUG*/ + + static void +-vips_region_finalize( GObject *gobject ) ++vips_region_finalize(GObject *gobject) + { + #ifdef VIPS_DEBUG +- VIPS_DEBUG_MSG( "vips_region_finalize: " ); +- vips_object_print_name( VIPS_OBJECT( gobject ) ); +- VIPS_DEBUG_MSG( "\n" ); ++ VIPS_DEBUG_MSG("vips_region_finalize: "); ++ vips_object_print_name(VIPS_OBJECT(gobject)); ++ VIPS_DEBUG_MSG("\n"); + #endif /*VIPS_DEBUG*/ + + #ifdef VIPS_DEBUG +- g_mutex_lock( vips__global_lock ); +- vips__regions_all = g_slist_remove( vips__regions_all, gobject ); +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); ++ vips__regions_all = g_slist_remove(vips__regions_all, gobject); ++ g_mutex_unlock(vips__global_lock); + #endif /*VIPS_DEBUG*/ + +- G_OBJECT_CLASS( vips_region_parent_class )->finalize( gobject ); ++ G_OBJECT_CLASS(vips_region_parent_class)->finalize(gobject); + } + + /* Call a start function if no sequence is running on this VipsRegion. + */ + int +-vips__region_start( VipsRegion *region ) ++vips__region_start(VipsRegion *region) + { + VipsImage *image = region->im; + +- if( !region->seq && image->start_fn ) { +- VIPS_GATE_START( "vips__region_start: wait" ); ++ if (!region->seq && image->start_fn) { ++ VIPS_GATE_START("vips__region_start: wait"); + +- g_mutex_lock( image->sslock ); ++ g_mutex_lock(image->sslock); + +- VIPS_GATE_STOP( "vips__region_start: wait" ); ++ VIPS_GATE_STOP("vips__region_start: wait"); + +- region->seq = image->start_fn( image, +- image->client1, image->client2 ); ++ region->seq = image->start_fn(image, ++ image->client1, image->client2); + +- g_mutex_unlock( image->sslock ); +- +- if( !region->seq ) { ++ g_mutex_unlock(image->sslock); ++ ++ if (!region->seq) { + #ifdef DEBUG +- printf( "vips__region_start: " +- "start function failed for image %s", +- image->filename ); ++ printf("vips__region_start: " ++ "start function failed for image %s", ++ image->filename); + #endif /*DEBUG*/ + +- return( -1 ); +- } +- } ++ return (-1); ++ } ++ } + +- return( 0 ); ++ return (0); + } + +-/* Call a stop function if a sequence is running in this VipsRegion. ++/* Call a stop function if a sequence is running in this VipsRegion. + */ + void +-vips__region_stop( VipsRegion *region ) ++vips__region_stop(VipsRegion *region) + { + VipsImage *image = region->im; + +- if( region->seq && image->stop_fn ) { ++ if (region->seq && image->stop_fn) { + int result; + +- VIPS_GATE_START( "vips__region_stop: wait" ); ++ VIPS_GATE_START("vips__region_stop: wait"); + +- g_mutex_lock( image->sslock ); ++ g_mutex_lock(image->sslock); + +- VIPS_GATE_STOP( "vips__region_stop: wait" ); ++ VIPS_GATE_STOP("vips__region_stop: wait"); + +- result = image->stop_fn( region->seq, +- image->client1, image->client2 ); ++ result = image->stop_fn(region->seq, ++ image->client1, image->client2); + +- g_mutex_unlock( image->sslock ); ++ g_mutex_unlock(image->sslock); + + /* stop function can return an error, but we have nothing we + * can really do with it, sadly. + */ +- if( result ) +- g_warning( "stop callback failed for image %s", +- image->filename ); +- +- region->seq = NULL; +- } ++ if (result) ++ g_warning("stop callback failed for image %s", ++ image->filename); ++ ++ region->seq = NULL; ++ } + } + + static void +-vips_region_dispose( GObject *gobject ) ++vips_region_dispose(GObject *gobject) + { +- VipsRegion *region = VIPS_REGION( gobject ); ++ VipsRegion *region = VIPS_REGION(gobject); + VipsImage *image = region->im; + + #ifdef VIPS_DEBUG +- VIPS_DEBUG_MSG( "vips_region_dispose: " ); +- vips_object_print_name( VIPS_OBJECT( gobject ) ); +- VIPS_DEBUG_MSG( "\n" ); ++ VIPS_DEBUG_MSG("vips_region_dispose: "); ++ vips_object_print_name(VIPS_OBJECT(gobject)); ++ VIPS_DEBUG_MSG("\n"); + #endif /*VIPS_DEBUG*/ + +- vips_object_preclose( VIPS_OBJECT( gobject ) ); ++ vips_object_preclose(VIPS_OBJECT(gobject)); + +- /* Stop this sequence. +- */ +- vips__region_stop( region ); ++ /* Stop this sequence. ++ */ ++ vips__region_stop(region); + + /* Free any attached memory. + */ +- VIPS_FREEF( vips_window_unref, region->window ); +- VIPS_FREEF( vips_buffer_unref, region->buffer ); ++ VIPS_FREEF(vips_window_unref, region->window); ++ VIPS_FREEF(vips_buffer_unref, region->buffer); + +- /* Detach from image. ++ /* Detach from image. + */ +- VIPS_GATE_START( "vips_region_dispose: wait" ); ++ VIPS_GATE_START("vips_region_dispose: wait"); + +- g_mutex_lock( image->sslock ); ++ g_mutex_lock(image->sslock); + +- VIPS_GATE_STOP( "vips_region_dispose: wait" ); ++ VIPS_GATE_STOP("vips_region_dispose: wait"); + +- image->regions = g_slist_remove( image->regions, region ); ++ image->regions = g_slist_remove(image->regions, region); + +- g_mutex_unlock( image->sslock ); ++ g_mutex_unlock(image->sslock); + + region->im = NULL; + +- g_object_unref( image ); ++ g_object_unref(image); + +- G_OBJECT_CLASS( vips_region_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_region_parent_class)->dispose(gobject); + } + + static void +-vips_region_dump( VipsObject *object, VipsBuf *buf ) ++vips_region_dump(VipsObject *object, VipsBuf *buf) + { +- VipsRegion *region = VIPS_REGION( object ); +- +- vips_buf_appendf( buf, "VipsRegion: %p, ", region ); +- vips_buf_appendf( buf, "im = %p, ", region->im ); +- vips_buf_appendf( buf, "valid.left = %d, ", region->valid.left ); +- vips_buf_appendf( buf, "valid.top = %d, ", region->valid.top ); +- vips_buf_appendf( buf, "valid.width = %d, ", region->valid.width ); +- vips_buf_appendf( buf, "valid.height = %d, ", region->valid.height ); +- vips_buf_appendf( buf, "type = %d, ", region->type ); +- vips_buf_appendf( buf, "data = %p, ", region->data ); +- vips_buf_appendf( buf, "bpl = %d, ", region->bpl ); +- vips_buf_appendf( buf, "seq = %p, ", region->seq ); +- vips_buf_appendf( buf, "thread = %p, ", region->thread ); +- vips_buf_appendf( buf, "window = %p, ", region->window ); +- vips_buf_appendf( buf, "buffer = %p, ", region->buffer ); +- vips_buf_appendf( buf, "invalid = %d", region->invalid ); +- +- VIPS_OBJECT_CLASS( vips_region_parent_class )->dump( object, buf ); ++ VipsRegion *region = VIPS_REGION(object); ++ ++ vips_buf_appendf(buf, "VipsRegion: %p, ", region); ++ vips_buf_appendf(buf, "im = %p, ", region->im); ++ vips_buf_appendf(buf, "valid.left = %d, ", region->valid.left); ++ vips_buf_appendf(buf, "valid.top = %d, ", region->valid.top); ++ vips_buf_appendf(buf, "valid.width = %d, ", region->valid.width); ++ vips_buf_appendf(buf, "valid.height = %d, ", region->valid.height); ++ vips_buf_appendf(buf, "type = %d, ", region->type); ++ vips_buf_appendf(buf, "data = %p, ", region->data); ++ vips_buf_appendf(buf, "bpl = %d, ", region->bpl); ++ vips_buf_appendf(buf, "seq = %p, ", region->seq); ++ vips_buf_appendf(buf, "thread = %p, ", region->thread); ++ vips_buf_appendf(buf, "window = %p, ", region->window); ++ vips_buf_appendf(buf, "buffer = %p, ", region->buffer); ++ vips_buf_appendf(buf, "invalid = %d", region->invalid); ++ ++ VIPS_OBJECT_CLASS(vips_region_parent_class)->dump(object, buf); + } + + static void +-vips_region_summary( VipsObject *object, VipsBuf *buf ) ++vips_region_summary(VipsObject *object, VipsBuf *buf) + { +- VipsRegion *region = VIPS_REGION( object ); ++ VipsRegion *region = VIPS_REGION(object); + +- vips_buf_appendf( buf, "VipsRegion: %p, ", region ); +- vips_buf_appendf( buf, "im = %p, ", region->im ); +- vips_buf_appendf( buf, "left = %d, ", region->valid.left ); +- vips_buf_appendf( buf, "top = %d, ", region->valid.top ); +- vips_buf_appendf( buf, "width = %d, ", region->valid.width ); +- vips_buf_appendf( buf, "height = %d", region->valid.height ); ++ vips_buf_appendf(buf, "VipsRegion: %p, ", region); ++ vips_buf_appendf(buf, "im = %p, ", region->im); ++ vips_buf_appendf(buf, "left = %d, ", region->valid.left); ++ vips_buf_appendf(buf, "top = %d, ", region->valid.top); ++ vips_buf_appendf(buf, "width = %d, ", region->valid.width); ++ vips_buf_appendf(buf, "height = %d", region->valid.height); + +- if( region->buffer && region->buffer->buf ) +- vips_buf_appendf( buf, ", %.3gMB", +- region->buffer->bsize / (1024 * 1024.0) ); ++ if (region->buffer && region->buffer->buf) ++ vips_buf_appendf(buf, ", %.3gMB", ++ region->buffer->bsize / (1024 * 1024.0)); + +- VIPS_OBJECT_CLASS( vips_region_parent_class )->summary( object, buf ); ++ VIPS_OBJECT_CLASS(vips_region_parent_class)->summary(object, buf); + } + + /* If a region is being created in one thread (eg. the main thread) and then +@@ -376,42 +376,42 @@ vips_region_summary( VipsObject *object, VipsBuf *buf ) + * vips__region_no_ownership() before we can call this. + */ + void +-vips__region_take_ownership( VipsRegion *region ) ++vips__region_take_ownership(VipsRegion *region) + { + /* Lock so that there's a memory barrier with the thread doing the + * vips__region_no_ownership() before us. + */ +- VIPS_GATE_START( "vips__region_take_ownership: wait" ); ++ VIPS_GATE_START("vips__region_take_ownership: wait"); + +- g_mutex_lock( region->im->sslock ); ++ g_mutex_lock(region->im->sslock); + +- VIPS_GATE_STOP( "vips__region_take_ownership: wait" ); ++ VIPS_GATE_STOP("vips__region_take_ownership: wait"); + +- if( region->thread != g_thread_self() ) { +- g_assert( region->thread == NULL ); ++ if (region->thread != g_thread_self()) { ++ g_assert(region->thread == NULL); + +- /* We don't want to move shared buffers: the other region +- * using this buffer will still be on the other thread. +- * Not sure if this will ever happen: if it does, we'll ++ /* We don't want to move shared buffers: the other region ++ * using this buffer will still be on the other thread. ++ * Not sure if this will ever happen: if it does, we'll + * need to dup the buffer. + */ +- g_assert( !region->buffer || +- region->buffer->ref_count == 1 ); ++ g_assert(!region->buffer || ++ region->buffer->ref_count == 1); + + region->thread = g_thread_self(); + } + +- g_mutex_unlock( region->im->sslock ); ++ g_mutex_unlock(region->im->sslock); + } + + void +-vips__region_check_ownership( VipsRegion *region ) ++vips__region_check_ownership(VipsRegion *region) + { +- if( region->thread ) { +- g_assert( region->thread == g_thread_self() ); +- if( region->buffer && region->buffer->cache ) +- g_assert( region->thread == +- region->buffer->cache->thread ); ++ if (region->thread) { ++ g_assert(region->thread == g_thread_self()); ++ if (region->buffer && region->buffer->cache) ++ g_assert(region->thread == ++ region->buffer->cache->thread); + } + } + +@@ -419,56 +419,56 @@ vips__region_check_ownership( VipsRegion *region ) + * this thread's buffer cache. + */ + void +-vips__region_no_ownership( VipsRegion *region ) ++vips__region_no_ownership(VipsRegion *region) + { +- VIPS_GATE_START( "vips__region_no_ownership: wait" ); ++ VIPS_GATE_START("vips__region_no_ownership: wait"); + +- g_mutex_lock( region->im->sslock ); ++ g_mutex_lock(region->im->sslock); + +- VIPS_GATE_STOP( "vips__region_no_ownership: wait" ); ++ VIPS_GATE_STOP("vips__region_no_ownership: wait"); + +- vips__region_check_ownership( region ); ++ vips__region_check_ownership(region); + + region->thread = NULL; +- if( region->buffer ) +- vips_buffer_undone( region->buffer ); ++ if (region->buffer) ++ vips_buffer_undone(region->buffer); + +- g_mutex_unlock( region->im->sslock ); ++ g_mutex_unlock(region->im->sslock); + } + + static int +-vips_region_build( VipsObject *object ) ++vips_region_build(VipsObject *object) + { +- VipsRegion *region = VIPS_REGION( object ); ++ VipsRegion *region = VIPS_REGION(object); + VipsImage *image = region->im; + +- VIPS_DEBUG_MSG( "vips_region_build: %p\n", region ); ++ VIPS_DEBUG_MSG("vips_region_build: %p\n", region); + +- if( VIPS_OBJECT_CLASS( vips_region_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_region_parent_class)->build(object)) ++ return (-1); + +- vips__region_take_ownership( region ); ++ vips__region_take_ownership(region); + + /* We're usually inside the ss lock anyway. But be safe ... + */ +- VIPS_GATE_START( "vips_region_build: wait" ); ++ VIPS_GATE_START("vips_region_build: wait"); + +- g_mutex_lock( image->sslock ); ++ g_mutex_lock(image->sslock); + +- VIPS_GATE_STOP( "vips_region_build: wait" ); ++ VIPS_GATE_STOP("vips_region_build: wait"); + +- image->regions = g_slist_prepend( image->regions, region ); ++ image->regions = g_slist_prepend(image->regions, region); + +- g_mutex_unlock( image->sslock ); ++ g_mutex_unlock(image->sslock); + +- return( 0 ); ++ return (0); + } + + static void +-vips_region_class_init( VipsRegionClass *class ) ++vips_region_class_init(VipsRegionClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->finalize = vips_region_finalize; + gobject_class->dispose = vips_region_dispose; +@@ -479,16 +479,16 @@ vips_region_class_init( VipsRegionClass *class ) + } + + static void +-vips_region_init( VipsRegion *region ) ++vips_region_init(VipsRegion *region) + { + region->type = VIPS_REGION_NONE; + + #ifdef VIPS_DEBUG +- g_mutex_lock( vips__global_lock ); +- vips__regions_all = g_slist_prepend( vips__regions_all, region ); +- printf( "vips_region_init: %d regions in vips\n", +- g_slist_length( vips__regions_all ) ); +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); ++ vips__regions_all = g_slist_prepend(vips__regions_all, region); ++ printf("vips_region_init: %d regions in vips\n", ++ g_slist_length(vips__regions_all)); ++ g_mutex_unlock(vips__global_lock); + #endif /*VIPS_DEBUG*/ + } + +@@ -496,34 +496,34 @@ vips_region_init( VipsRegion *region ) + * vips_region_new: (constructor) + * @image: image to create this region on + * +- * Create a region. #VipsRegion s start out empty, you need to call ++ * Create a region. #VipsRegion s start out empty, you need to call + * vips_region_prepare() to fill them with pixels. + * + * See also: vips_region_prepare(). + */ + VipsRegion * +-vips_region_new( VipsImage *image ) ++vips_region_new(VipsImage *image) + { + VipsRegion *region; + + /* Ref quickly, we want to make sure we keep the image around. + * We can't use the property system, we need to be very threaded. + */ +- g_object_ref( image ); +- g_assert( G_OBJECT( image )->ref_count > 1 ); +- g_assert( vips_object_sanity( VIPS_OBJECT( image ) ) ); ++ g_object_ref(image); ++ g_assert(G_OBJECT(image)->ref_count > 1); ++ g_assert(vips_object_sanity(VIPS_OBJECT(image))); + +- region = VIPS_REGION( g_object_new( VIPS_TYPE_REGION, NULL ) ); ++ region = VIPS_REGION(g_object_new(VIPS_TYPE_REGION, NULL)); + region->im = image; + +- if( vips_object_build( VIPS_OBJECT( region ) ) ) { +- VIPS_UNREF( region ); +- return( NULL ); ++ if (vips_object_build(VIPS_OBJECT(region))) { ++ VIPS_UNREF(region); ++ return (NULL); + } + +- g_assert( vips_object_sanity( VIPS_OBJECT( region ) ) ); ++ g_assert(vips_object_sanity(VIPS_OBJECT(region))); + +- return( region ); ++ return (region); + } + + /* Region should be a pixel buffer. On return, check +@@ -537,19 +537,19 @@ vips_region_new( VipsImage *image ) + * @r: #VipsRect of pixels you need to be able to address + * + * The region is transformed so that at least @r pixels are available as a +- * memory buffer that can be written to. ++ * memory buffer that can be written to. + * + * Returns: 0 on success, or -1 for error. + */ + int +-vips_region_buffer( VipsRegion *reg, const VipsRect *r ) ++vips_region_buffer(VipsRegion *reg, const VipsRect *r) + { + VipsImage *im = reg->im; + + VipsRect image; + VipsRect clipped; + +- vips__region_check_ownership( reg ); ++ vips__region_check_ownership(reg); + + /* Clip against image. + */ +@@ -557,47 +557,47 @@ vips_region_buffer( VipsRegion *reg, const VipsRect *r ) + image.left = 0; + image.width = im->Xsize; + image.height = im->Ysize; +- vips_rect_intersectrect( r, &image, &clipped ); ++ vips_rect_intersectrect(r, &image, &clipped); + + /* Test for empty. + */ +- if( vips_rect_isempty( &clipped ) ) { +- vips_error( "VipsRegion", +- "%s", _( "valid clipped to nothing" ) ); +- return( -1 ); ++ if (vips_rect_isempty(&clipped)) { ++ vips_error("VipsRegion", ++ "%s", _("valid clipped to nothing")); ++ return (-1); + } + +- VIPS_FREEF( vips_window_unref, reg->window ); ++ VIPS_FREEF(vips_window_unref, reg->window); + + /* Have we been asked to drop caches? We want to throw everything + * away. + * + * If not, try to reuse the current buffer. + */ +- if( reg->invalid ) { +- VIPS_FREEF( vips_buffer_unref, reg->buffer ); ++ if (reg->invalid) { ++ VIPS_FREEF(vips_buffer_unref, reg->buffer); + reg->invalid = FALSE; + +- if( !(reg->buffer = vips_buffer_new( im, &clipped )) ) +- return( -1 ); ++ if (!(reg->buffer = vips_buffer_new(im, &clipped))) ++ return (-1); + } + else { +- /* We combine buffer unref and new buffer ref in one call ++ /* We combine buffer unref and new buffer ref in one call + * to reduce malloc/free cycling. + */ +- if( !(reg->buffer = +- vips_buffer_unref_ref( reg->buffer, im, &clipped )) ) +- return( -1 ); ++ if (!(reg->buffer = ++ vips_buffer_unref_ref(reg->buffer, im, &clipped))) ++ return (-1); + } + + /* Init new stuff. + */ + reg->valid = reg->buffer->area; +- reg->bpl = VIPS_IMAGE_SIZEOF_PEL( im ) * reg->buffer->area.width; ++ reg->bpl = VIPS_IMAGE_SIZEOF_PEL(im) * reg->buffer->area.width; + reg->type = VIPS_REGION_BUFFER; + reg->data = reg->buffer->buf; + +- return( 0 ); ++ return (0); + } + + /** +@@ -605,14 +605,14 @@ vips_region_buffer( VipsRegion *reg, const VipsRect *r ) + * @reg: region to operate upon + * @r: #VipsRect of pixels you need to be able to address + * +- * The region is transformed so that at least @r pixels are available to be +- * read from the image. The image needs to be a memory buffer or represent a +- * file on disc that has been mapped or can be mapped. ++ * The region is transformed so that at least @r pixels are available to be ++ * read from the image. The image needs to be a memory buffer or represent a ++ * file on disc that has been mapped or can be mapped. + * + * Returns: 0 on success, or -1 for error. + */ + int +-vips_region_image( VipsRegion *reg, const VipsRect *r ) ++vips_region_image(VipsRegion *reg, const VipsRect *r) + { + VipsImage *image = reg->im; + +@@ -621,7 +621,7 @@ vips_region_image( VipsRegion *reg, const VipsRect *r ) + + /* Sanity check. + */ +- vips__region_check_ownership( reg ); ++ vips__region_check_ownership(reg); + + /* Clip against image. + */ +@@ -629,37 +629,37 @@ vips_region_image( VipsRegion *reg, const VipsRect *r ) + all.left = 0; + all.width = image->Xsize; + all.height = image->Ysize; +- vips_rect_intersectrect( r, &all, &clipped ); ++ vips_rect_intersectrect(r, &all, &clipped); + +- if( vips_rect_isempty( &clipped ) ) { +- vips_error( "VipsRegion", +- "%s", _( "valid clipped to nothing" ) ); +- return( -1 ); ++ if (vips_rect_isempty(&clipped)) { ++ vips_error("VipsRegion", ++ "%s", _("valid clipped to nothing")); ++ return (-1); + } + + reg->invalid = FALSE; +- VIPS_FREEF( vips_buffer_unref, reg->buffer ); ++ VIPS_FREEF(vips_buffer_unref, reg->buffer); + +- if( image->data ) { ++ if (image->data) { + /* We have the whole image available ... easy! + */ +- VIPS_FREEF( vips_window_unref, reg->window ); ++ VIPS_FREEF(vips_window_unref, reg->window); + + /* We can't just set valid = whole image, since this may be an + * incompletely calculated memory buffer. Just set valid to r. + */ + reg->valid = clipped; +- reg->bpl = VIPS_IMAGE_SIZEOF_LINE( image ); +- reg->data = VIPS_IMAGE_ADDR( image, clipped.left, clipped.top ); ++ reg->bpl = VIPS_IMAGE_SIZEOF_LINE(image); ++ reg->data = VIPS_IMAGE_ADDR(image, clipped.left, clipped.top); + reg->type = VIPS_REGION_OTHER_IMAGE; + } +- else if( image->dtype == VIPS_IMAGE_OPENIN ) { ++ else if (image->dtype == VIPS_IMAGE_OPENIN) { + /* No complete image data ... but we can use a rolling window. + */ + reg->type = VIPS_REGION_WINDOW; +- if( !(reg->window = vips_window_take( reg->window, image, +- clipped.top, clipped.height )) ) +- return( -1 ); ++ if (!(reg->window = vips_window_take(reg->window, image, ++ clipped.top, clipped.height))) ++ return (-1); + + /* Note the area the window actually represents. + */ +@@ -667,17 +667,17 @@ vips_region_image( VipsRegion *reg, const VipsRect *r ) + reg->valid.top = reg->window->top; + reg->valid.width = image->Xsize; + reg->valid.height = reg->window->height; +- reg->bpl = VIPS_IMAGE_SIZEOF_LINE( image ); ++ reg->bpl = VIPS_IMAGE_SIZEOF_LINE(image); + reg->data = reg->window->data; + } + else { +- VIPS_FREEF( vips_window_unref, reg->window ); ++ VIPS_FREEF(vips_window_unref, reg->window); + +- vips_error( "VipsRegion", "%s", _( "bad image type" ) ); +- return( -1 ); ++ vips_error("VipsRegion", "%s", _("bad image type")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -688,7 +688,7 @@ vips_region_image( VipsRegion *reg, const VipsRect *r ) + * @x: postion of @r in @dest + * @y: postion of @r in @dest + * +- * Make VIPS_REGION_ADDR() on @reg go to @dest instead. ++ * Make VIPS_REGION_ADDR() on @reg go to @dest instead. + * + * @r is the part of @reg which you want to be able to address (this + * effectively becomes the valid field), (@x, @y) is the top LH corner of the +@@ -697,15 +697,15 @@ vips_region_image( VipsRegion *reg, const VipsRect *r ) + * Performs all clipping necessary to ensure that @reg->valid is indeed + * valid. + * +- * If the region we attach to is moved or destroyed, we can be left with +- * dangling pointers! If the region we attach to is on another image, the ++ * If the region we attach to is moved or destroyed, we can be left with ++ * dangling pointers! If the region we attach to is on another image, the + * two images must have the same sizeof( pel ). + * + * Returns: 0 on success, or -1 for error. + */ + int +-vips_region_region( VipsRegion *reg, +- VipsRegion *dest, const VipsRect *r, int x, int y ) ++vips_region_region(VipsRegion *reg, ++ VipsRegion *dest, const VipsRect *r, int x, int y) + { + VipsRect image; + VipsRect wanted; +@@ -715,18 +715,18 @@ vips_region_region( VipsRegion *reg, + + /* Sanity check. + */ +- if( !dest->data ) { +- vips_error( "VipsRegion", +- "%s", _( "no pixel data on attached image" ) ); +- return( -1 ); ++ if (!dest->data) { ++ vips_error("VipsRegion", ++ "%s", _("no pixel data on attached image")); ++ return (-1); + } +- if( VIPS_IMAGE_SIZEOF_PEL( dest->im ) != +- VIPS_IMAGE_SIZEOF_PEL( reg->im ) ) { +- vips_error( "VipsRegion", +- "%s", _( "images do not match in pixel size" ) ); +- return( -1 ); ++ if (VIPS_IMAGE_SIZEOF_PEL(dest->im) != ++ VIPS_IMAGE_SIZEOF_PEL(reg->im)) { ++ vips_error("VipsRegion", ++ "%s", _("images do not match in pixel size")); ++ return (-1); + } +- vips__region_check_ownership( reg ); ++ vips__region_check_ownership(reg); + + /* We can't test + +@@ -742,7 +742,7 @@ vips_region_region( VipsRegion *reg, + image.left = 0; + image.width = reg->im->Xsize; + image.height = reg->im->Ysize; +- vips_rect_intersectrect( r, &image, &clipped ); ++ vips_rect_intersectrect(r, &image, &clipped); + + /* Translate to dest's coordinate space and clip against the available + * pixels. +@@ -754,15 +754,15 @@ vips_region_region( VipsRegion *reg, + + /* Test that dest->valid is large enough. + */ +- if( !vips_rect_includesrect( &dest->valid, &wanted ) ) { +- vips_error( "VipsRegion", +- "%s", _( "dest too small" ) ); +- return( -1 ); ++ if (!vips_rect_includesrect(&dest->valid, &wanted)) { ++ vips_error("VipsRegion", ++ "%s", _("dest too small")); ++ return (-1); + } + + /* Clip against the available pixels. + */ +- vips_rect_intersectrect( &wanted, &dest->valid, &clipped2 ); ++ vips_rect_intersectrect(&wanted, &dest->valid, &clipped2); + + /* Translate back to reg's coordinate space and set as valid. + */ +@@ -773,23 +773,23 @@ vips_region_region( VipsRegion *reg, + + /* Test for empty. + */ +- if( vips_rect_isempty( &final ) ) { +- vips_error( "VipsRegion", +- "%s", _( "valid clipped to nothing" ) ); +- return( -1 ); ++ if (vips_rect_isempty(&final)) { ++ vips_error("VipsRegion", ++ "%s", _("valid clipped to nothing")); ++ return (-1); + } + + /* Init new stuff. + */ +- VIPS_FREEF( vips_buffer_unref, reg->buffer ); +- VIPS_FREEF( vips_window_unref, reg->window ); ++ VIPS_FREEF(vips_buffer_unref, reg->buffer); ++ VIPS_FREEF(vips_window_unref, reg->window); + reg->invalid = FALSE; + reg->valid = final; + reg->bpl = dest->bpl; +- reg->data = VIPS_REGION_ADDR( dest, clipped2.left, clipped2.top ); ++ reg->data = VIPS_REGION_ADDR(dest, clipped2.left, clipped2.top); + reg->type = VIPS_REGION_OTHER_REGION; + +- return( 0 ); ++ return (0); + } + + /** +@@ -797,22 +797,22 @@ vips_region_region( VipsRegion *reg, + * @reg1: region to test + * @reg2: region to test + * +- * Do two regions point to the same piece of image? ie. ++ * Do two regions point to the same piece of image? ie. + * + * |[ + * VIPS_REGION_ADDR( reg1, x, y ) == VIPS_REGION_ADDR( reg2, x, y ) && +- * *VIPS_REGION_ADDR( reg1, x, y ) == ++ * *VIPS_REGION_ADDR( reg1, x, y ) == + * *VIPS_REGION_ADDR( reg2, x, y ) for all x, y, reg1, reg2. + * ]| + * + * Returns: non-zero on equality. + */ + int +-vips_region_equalsregion( VipsRegion *reg1, VipsRegion *reg2 ) ++vips_region_equalsregion(VipsRegion *reg1, VipsRegion *reg2) + { +- return( reg1->im == reg2->im && +- vips_rect_equalsrect( ®1->valid, ®2->valid ) && +- reg1->data == reg2->data ); ++ return (reg1->im == reg2->im && ++ vips_rect_equalsrect(®1->valid, ®2->valid) && ++ reg1->data == reg2->data); + } + + /** +@@ -829,7 +829,7 @@ vips_region_equalsregion( VipsRegion *reg1, VipsRegion *reg2 ) + * Returns: 0 on success, or -1 for error. + */ + int +-vips_region_position( VipsRegion *reg, int x, int y ) ++vips_region_position(VipsRegion *reg, int x, int y) + { + VipsRect req, image, clipped; + +@@ -843,61 +843,62 @@ vips_region_position( VipsRegion *reg, int x, int y ) + req.left = x; + req.width = reg->valid.width; + req.height = reg->valid.height; +- vips_rect_intersectrect( &image, &req, &clipped ); +- if( x < 0 || y < 0 || vips_rect_isempty( &clipped ) ) { +- vips_error( "VipsRegion", "%s", _( "bad position" ) ); +- return( -1 ); ++ vips_rect_intersectrect(&image, &req, &clipped); ++ if (x < 0 || y < 0 || vips_rect_isempty(&clipped)) { ++ vips_error("VipsRegion", "%s", _("bad position")); ++ return (-1); + } + + reg->valid = clipped; + reg->invalid = FALSE; + +- return( 0 ); ++ return (0); + } + + int +-vips_region_fill( VipsRegion *reg, +- const VipsRect *r, VipsRegionFillFn fn, void *a ) ++vips_region_fill(VipsRegion *reg, ++ const VipsRect *r, VipsRegionFillFn fn, void *a) + { +- g_assert( reg->im->dtype == VIPS_IMAGE_PARTIAL ); +- g_assert( reg->im->generate_fn ); ++ g_assert(reg->im->dtype == VIPS_IMAGE_PARTIAL); ++ g_assert(reg->im->generate_fn); + +- /* You'd think we could check reg and see if it already has some of ++ /* You'd think we could check reg and see if it already has some of + * the pixels we need. If it does, we could copy them and only +- * generate the new ones. ++ * generate the new ones. + * + * However, we usually have neighbouring regions on different threads, + * so from the point of view of this thread, we will get no overlaps +- * on successive prepare requests. ++ * on successive prepare requests. + */ + + /* Should have local memory. + */ +- if( vips_region_buffer( reg, r ) ) +- return( -1 ); ++ if (vips_region_buffer(reg, r)) ++ return (-1); + + /* Evaluate into or, if we've not got calculated pixels. + */ +- if( !reg->buffer->done ) { +- if( fn( reg, a ) ) +- return( -1 ); ++ if (!reg->buffer->done) { ++ if (fn(reg, a)) ++ return (-1); + + /* Publish our results. + */ +- if( reg->buffer ) +- vips_buffer_done( reg->buffer ); ++ if (reg->buffer) ++ vips_buffer_done(reg->buffer); + } + +- return( 0 ); ++ return (0); + } + +-#define FILL_LINE( TYPE, Q, N, V ) { \ +- int x; \ +- TYPE *QT = (TYPE *) Q; \ +- \ +- for( x = 0; x < (N); x++ ) \ +- QT[x] = (V); \ +-} ++#define FILL_LINE(TYPE, Q, N, V) \ ++ { \ ++ int x; \ ++ TYPE *QT = (TYPE *) Q; \ ++\ ++ for (x = 0; x < (N); x++) \ ++ QT[x] = (V); \ ++ } + + /** + * vips_region_paint: +@@ -905,13 +906,13 @@ vips_region_fill( VipsRegion *reg, + * @r: area to paint + * @value: value to paint + * +- * Paints @value into @reg covering rectangle @r. +- * @r is clipped against ++ * Paints @value into @reg covering rectangle @r. ++ * @r is clipped against + * @reg->valid. + * +- * For int images, @value is ++ * For int images, @value is + * passed to memset(), so it usually needs to be 0 or 255. For float images, +- * value is cast to a float and copied in to each band element. ++ * value is cast to a float and copied in to each band element. + * + * @r is clipped against + * @reg->valid. +@@ -919,39 +920,39 @@ vips_region_fill( VipsRegion *reg, + * See also: vips_region_black(). + */ + void +-vips_region_paint( VipsRegion *reg, const VipsRect *r, int value ) ++vips_region_paint(VipsRegion *reg, const VipsRect *r, int value) + { + VipsRect clipped; + +- vips_rect_intersectrect( r, ®->valid, &clipped ); +- if( !vips_rect_isempty( &clipped ) ) { +- VipsPel *q = VIPS_REGION_ADDR( reg, clipped.left, clipped.top ); +- size_t ls = VIPS_REGION_LSKIP( reg ); +- size_t wd = clipped.width * VIPS_IMAGE_SIZEOF_PEL( reg->im ); ++ vips_rect_intersectrect(r, ®->valid, &clipped); ++ if (!vips_rect_isempty(&clipped)) { ++ VipsPel *q = VIPS_REGION_ADDR(reg, clipped.left, clipped.top); ++ size_t ls = VIPS_REGION_LSKIP(reg); ++ size_t wd = clipped.width * VIPS_IMAGE_SIZEOF_PEL(reg->im); + int y; + +- if( vips_band_format_isint( reg->im->BandFmt ) ) { +- for( y = 0; y < clipped.height; y++ ) { +- memset( (char *) q, value, wd ); ++ if (vips_band_format_isint(reg->im->BandFmt)) { ++ for (y = 0; y < clipped.height; y++) { ++ memset((char *) q, value, wd); + q += ls; + } + } + else { +- gboolean iscomplex = +- vips_band_format_iscomplex( reg->im->BandFmt ); +- int nele = clipped.width * reg->im->Bands * +- (iscomplex ? 2 : 1); ++ gboolean iscomplex = ++ vips_band_format_iscomplex(reg->im->BandFmt); ++ int nele = clipped.width * reg->im->Bands * ++ (iscomplex ? 2 : 1); + VipsPel *q1; + +- switch( reg->im->BandFmt ) { ++ switch (reg->im->BandFmt) { + case VIPS_FORMAT_FLOAT: + case VIPS_FORMAT_COMPLEX: +- FILL_LINE( float, q, nele, value ); ++ FILL_LINE(float, q, nele, value); + break; + + case VIPS_FORMAT_DOUBLE: + case VIPS_FORMAT_DPCOMPLEX: +- FILL_LINE( double, q, nele, value ); ++ FILL_LINE(double, q, nele, value); + break; + + default: +@@ -960,8 +961,8 @@ vips_region_paint( VipsRegion *reg, const VipsRect *r, int value ) + + q1 = q + ls; + +- for( y = 1; y < clipped.height; y++ ) { +- memcpy( (char *) q1, (char *) q, wd ); ++ for (y = 1; y < clipped.height; y++) { ++ memcpy((char *) q1, (char *) q, wd); + q1 += ls; + } + } +@@ -974,7 +975,7 @@ vips_region_paint( VipsRegion *reg, const VipsRect *r, int value ) + * @r: area to paint + * @ink: value to paint + * +- * Paints @ink into @reg covering rectangle @r. @r is clipped against ++ * Paints @ink into @reg covering rectangle @r. @r is clipped against + * @reg->valid. + * + * @ink should be a byte array of the same size as an image pixel containing +@@ -983,15 +984,15 @@ vips_region_paint( VipsRegion *reg, const VipsRect *r, int value ) + * See also: vips_region_paint(). + */ + void +-vips_region_paint_pel( VipsRegion *reg, const VipsRect *r, const VipsPel *ink ) ++vips_region_paint_pel(VipsRegion *reg, const VipsRect *r, const VipsPel *ink) + { + VipsRect ovl; + +- vips_rect_intersectrect( r, ®->valid, &ovl ); +- if( !vips_rect_isempty( &ovl ) ) { +- int ps = VIPS_IMAGE_SIZEOF_PEL( reg->im ); ++ vips_rect_intersectrect(r, ®->valid, &ovl); ++ if (!vips_rect_isempty(&ovl)) { ++ int ps = VIPS_IMAGE_SIZEOF_PEL(reg->im); + int ws = ovl.width * ps; +- int ls = VIPS_REGION_LSKIP( reg ); ++ int ls = VIPS_REGION_LSKIP(reg); + + VipsPel *to, *q; + int x, y, z; +@@ -999,21 +1000,21 @@ vips_region_paint_pel( VipsRegion *reg, const VipsRect *r, const VipsPel *ink ) + /* We plot the first line pointwise, then memcpy() it for the + * subsequent lines. + */ +- to = VIPS_REGION_ADDR( reg, ovl.left, ovl.top ); ++ to = VIPS_REGION_ADDR(reg, ovl.left, ovl.top); + + q = to; +- for( x = 0; x < ovl.width; x++ ) { ++ for (x = 0; x < ovl.width; x++) { + /* Faster than memcpy() for about n<20. + */ +- for( z = 0; z < ps; z++ ) ++ for (z = 0; z < ps; z++) + q[z] = ink[z]; + + q += ps; + } + + q = to + ls; +- for( y = 1; y < ovl.height; y++ ) { +- memcpy( q, to, ws ); ++ for (y = 1; y < ovl.height; y++) { ++ memcpy(q, to, ws); + q += ls; + } + } +@@ -1028,15 +1029,15 @@ vips_region_paint_pel( VipsRegion *reg, const VipsRect *r, const VipsPel *ink ) + * See also: vips_region_paint(). + */ + void +-vips_region_black( VipsRegion *reg ) ++vips_region_black(VipsRegion *reg) + { +- vips_region_paint( reg, ®->valid, 0 ); ++ vips_region_paint(reg, ®->valid, 0); + } + + /** + * vips_region_copy: +- * @reg: source region +- * @dest: (inout): destination region ++ * @reg: source region ++ * @dest: (inout): destination region + * @r: #VipsRect of pixels you need to copy + * @x: postion of @r in @dest + * @y: postion of @r in @dest +@@ -1048,14 +1049,14 @@ vips_region_black( VipsRegion *reg ) + * See also: vips_region_paint(). + */ + void +-vips_region_copy( VipsRegion *reg, +- VipsRegion *dest, const VipsRect *r, int x, int y ) ++vips_region_copy(VipsRegion *reg, ++ VipsRegion *dest, const VipsRect *r, int x, int y) + { +- size_t len = VIPS_IMAGE_SIZEOF_PEL( reg->im ) * r->width; +- VipsPel *p = VIPS_REGION_ADDR( reg, r->left, r->top ); +- VipsPel *q = VIPS_REGION_ADDR( dest, x, y ); +- size_t plsk = VIPS_REGION_LSKIP( reg ); +- size_t qlsk = VIPS_REGION_LSKIP( dest ); ++ size_t len = VIPS_IMAGE_SIZEOF_PEL(reg->im) * r->width; ++ VipsPel *p = VIPS_REGION_ADDR(reg, r->left, r->top); ++ VipsPel *q = VIPS_REGION_ADDR(dest, x, y); ++ size_t plsk = VIPS_REGION_LSKIP(reg); ++ size_t qlsk = VIPS_REGION_LSKIP(dest); + + int z; + +@@ -1064,7 +1065,7 @@ vips_region_copy( VipsRegion *reg, + */ + VipsRect output; + +- printf( "vips_region_copy: sanity check\n" ); ++ printf("vips_region_copy: sanity check\n"); + + output.left = x; + output.top = y; +@@ -1073,66 +1074,66 @@ vips_region_copy( VipsRegion *reg, + + /* Must be inside dest->valid. + */ +- g_assert( vips_rect_includesrect( &dest->valid, &output ) ); ++ g_assert(vips_rect_includesrect(&dest->valid, &output)); + + /* Check the area we are reading from in reg. + */ +- g_assert( vips_rect_includesrect( ®->valid, r ) ); ++ g_assert(vips_rect_includesrect(®->valid, r)); + + /* VipsPel size must be the same. + */ +- g_assert( VIPS_IMAGE_SIZEOF_PEL( reg->im ) == +- VIPS_IMAGE_SIZEOF_PEL( dest->im ) ); ++ g_assert(VIPS_IMAGE_SIZEOF_PEL(reg->im) == ++ VIPS_IMAGE_SIZEOF_PEL(dest->im)); + #endif /*DEBUG*/ + +- /* Copy the scanlines. ++ /* Copy the scanlines. + * + * Special case: if the two sets of scanlines are end-to-end (this + * happens if we are copying complete regions) we can do a single +- * memcpy() for the whole thing. This is a little faster since we ++ * memcpy() for the whole thing. This is a little faster since we + * won't have to do unaligned copies. + */ +- if( len == plsk && +- len == qlsk ) +- memcpy( q, p, len * r->height ); ++ if (len == plsk && ++ len == qlsk) ++ memcpy(q, p, len * r->height); + else +- for( z = 0; z < r->height; z++ ) { +- memcpy( q, p, len ); ++ for (z = 0; z < r->height; z++) { ++ memcpy(q, p, len); + + p += plsk; + q += qlsk; + } + } + +-/* Generate area @target in @to using pixels in @from. ++/* Generate area @target in @to using pixels in @from. + * + * VIPS_CODING_LABQ only. + */ + static void +-vips_region_shrink_labpack( VipsRegion *from, +- VipsRegion *to, const VipsRect *target ) ++vips_region_shrink_labpack(VipsRegion *from, ++ VipsRegion *to, const VipsRect *target) + { +- int ls = VIPS_REGION_LSKIP( from ); ++ int ls = VIPS_REGION_LSKIP(from); + + int x, y; + +- for( y = 0; y < target->height; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( from, +- target->left * 2, (target->top + y) * 2 ); +- VipsPel *q = VIPS_REGION_ADDR( to, +- target->left, target->top + y ); ++ for (y = 0; y < target->height; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(from, ++ target->left * 2, (target->top + y) * 2); ++ VipsPel *q = VIPS_REGION_ADDR(to, ++ target->left, target->top + y); + + /* Ignore the extra bits for speed. + */ +- for( x = 0; x < target->width; x++ ) { ++ for (x = 0; x < target->width; x++) { + signed char *sp = (signed char *) p; + unsigned char *up = (unsigned char *) p; + +- int l = up[0] + up[4] + ++ int l = up[0] + up[4] + + up[ls] + up[ls + 4]; +- int a = sp[1] + sp[5] + ++ int a = sp[1] + sp[5] + + sp[ls + 1] + sp[ls + 5]; +- int b = sp[2] + sp[6] + ++ int b = sp[2] + sp[6] + + sp[ls + 2] + sp[ls + 6]; + + q[0] = (l + 2) >> 2; +@@ -1146,38 +1147,38 @@ vips_region_shrink_labpack( VipsRegion *from, + } + } + +-#define SHRINK_TYPE_MEAN_INT( TYPE ) \ +- for( x = 0; x < target->width; x++ ) { \ ++#define SHRINK_TYPE_MEAN_INT(TYPE) \ ++ for (x = 0; x < target->width; x++) { \ + TYPE *tp = (TYPE *) p; \ + TYPE *tp1 = (TYPE *) (p + ls); \ + TYPE *tq = (TYPE *) q; \ +- \ +- for( z = 0; z < nb; z++ ) { \ +- int tot = tp[z] + tp[z + nb] + \ ++\ ++ for (z = 0; z < nb; z++) { \ ++ int tot = tp[z] + tp[z + nb] + \ + tp1[z] + tp1[z + nb]; \ +- \ ++\ + tq[z] = (tot + 2) >> 2; \ + } \ +- \ ++\ + /* Move on two pels in input. \ + */ \ + p += ps << 1; \ + q += ps; \ + } + +-#define SHRINK_TYPE_MEAN_FLOAT( TYPE ) \ +- for( x = 0; x < target->width; x++ ) { \ ++#define SHRINK_TYPE_MEAN_FLOAT(TYPE) \ ++ for (x = 0; x < target->width; x++) { \ + TYPE *tp = (TYPE *) p; \ + TYPE *tp1 = (TYPE *) (p + ls); \ + TYPE *tq = (TYPE *) q; \ +- \ +- for( z = 0; z < nb; z++ ) { \ +- double tot = tp[z] + tp[z + nb] + \ ++\ ++ for (z = 0; z < nb; z++) { \ ++ double tot = tp[z] + tp[z + nb] + \ + tp1[z] + tp1[z + nb]; \ +- \ ++\ + tq[z] = tot / 4; \ + } \ +- \ ++\ + /* Move on two pels in input. \ + */ \ + p += ps << 1; \ +@@ -1187,40 +1188,48 @@ vips_region_shrink_labpack( VipsRegion *from, + /* Generate area @target in @to using pixels in @from. Non-complex. + */ + static void +-vips_region_shrink_uncoded_mean( VipsRegion *from, +- VipsRegion *to, const VipsRect *target ) ++vips_region_shrink_uncoded_mean(VipsRegion *from, ++ VipsRegion *to, const VipsRect *target) + { +- int ls = VIPS_REGION_LSKIP( from ); +- int ps = VIPS_IMAGE_SIZEOF_PEL( from->im ); ++ int ls = VIPS_REGION_LSKIP(from); ++ int ps = VIPS_IMAGE_SIZEOF_PEL(from->im); + int nb = from->im->Bands; + + int x, y, z; + +- for( y = 0; y < target->height; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( from, +- target->left * 2, (target->top + y) * 2 ); +- VipsPel *q = VIPS_REGION_ADDR( to, +- target->left, target->top + y ); ++ for (y = 0; y < target->height; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(from, ++ target->left * 2, (target->top + y) * 2); ++ VipsPel *q = VIPS_REGION_ADDR(to, ++ target->left, target->top + y); + + /* Process this line of pels. + */ +- switch( from->im->BandFmt ) { ++ switch (from->im->BandFmt) { + case VIPS_FORMAT_UCHAR: +- SHRINK_TYPE_MEAN_INT( unsigned char ); break; ++ SHRINK_TYPE_MEAN_INT(unsigned char); ++ break; + case VIPS_FORMAT_CHAR: +- SHRINK_TYPE_MEAN_INT( signed char ); break; ++ SHRINK_TYPE_MEAN_INT(signed char); ++ break; + case VIPS_FORMAT_USHORT: +- SHRINK_TYPE_MEAN_INT( unsigned short ); break; ++ SHRINK_TYPE_MEAN_INT(unsigned short); ++ break; + case VIPS_FORMAT_SHORT: +- SHRINK_TYPE_MEAN_INT( signed short ); break; ++ SHRINK_TYPE_MEAN_INT(signed short); ++ break; + case VIPS_FORMAT_UINT: +- SHRINK_TYPE_MEAN_INT( unsigned int ); break; ++ SHRINK_TYPE_MEAN_INT(unsigned int); ++ break; + case VIPS_FORMAT_INT: +- SHRINK_TYPE_MEAN_INT( signed int ); break; ++ SHRINK_TYPE_MEAN_INT(signed int); ++ break; + case VIPS_FORMAT_FLOAT: +- SHRINK_TYPE_MEAN_FLOAT( float ); break; ++ SHRINK_TYPE_MEAN_FLOAT(float); ++ break; + case VIPS_FORMAT_DOUBLE: +- SHRINK_TYPE_MEAN_FLOAT( double ); break; ++ SHRINK_TYPE_MEAN_FLOAT(double); ++ break; + + default: + g_assert_not_reached(); +@@ -1238,27 +1247,27 @@ vips_region_shrink_uncoded_mean( VipsRegion *from, + * NOT stable with respect to the ordered set of input values + * IS stable with respect to the initial arrangement of input values + */ +-#define SHRINK_TYPE_MEDIAN( TYPE ) { \ +- int ls = VIPS_REGION_LSKIP( from ); \ +- \ +- for( x = 0; x < target->width; x++ ) { \ +- TYPE *tp = (TYPE *) p; \ +- TYPE *tp1 = (TYPE *) (p + ls); \ +- TYPE *tq = (TYPE *) q; \ +- \ +- for( z = 0; z < nb; z++ ) { \ +- tq[z] = VIPS_MIN( \ +- VIPS_MAX( tp[z], tp[z + nb] ), \ +- VIPS_MAX( tp1[z], tp1[z + nb] ) \ +- ); \ ++#define SHRINK_TYPE_MEDIAN(TYPE) \ ++ { \ ++ int ls = VIPS_REGION_LSKIP(from); \ ++\ ++ for (x = 0; x < target->width; x++) { \ ++ TYPE *tp = (TYPE *) p; \ ++ TYPE *tp1 = (TYPE *) (p + ls); \ ++ TYPE *tq = (TYPE *) q; \ ++\ ++ for (z = 0; z < nb; z++) { \ ++ tq[z] = VIPS_MIN( \ ++ VIPS_MAX(tp[z], tp[z + nb]), \ ++ VIPS_MAX(tp1[z], tp1[z + nb])); \ ++ } \ ++\ ++ /* Move on two pels in input. \ ++ */ \ ++ p += ps << 1; \ ++ q += ps; \ + } \ +- \ +- /* Move on two pels in input. \ +- */ \ +- p += ps << 1; \ +- q += ps; \ +- } \ +-} ++ } + + /* This method is implemented so as to perform well and to always select an + * output pixel from one of the input pixels. As such we make only the +@@ -1270,245 +1279,264 @@ vips_region_shrink_uncoded_mean( VipsRegion *from, + * NOT stable with respect to the ordered set of input values + * IS stable with respect to the initial arrangement of input values + */ +-#define SHRINK_TYPE_MODE( TYPE ) { \ +- int ls = VIPS_REGION_LSKIP( from ); \ +- \ +- for( x = 0; x < target->width; x++ ) { \ +- TYPE *tp = (TYPE *) p; \ +- TYPE *tp1 = (TYPE *) (p + ls); \ +- TYPE *tq = (TYPE *) q; \ +- \ +- for( z = 0; z < nb; z++ ) { \ +- TYPE v[] = {tp[z], tp[z + nb], tp1[z], tp1[z + nb]}; \ +- int b0 = (v[0] == v[1]) | \ +- (v[0] == v[2]) | \ +- (v[0] == v[3]); \ +- int b1 = (v[1] == v[0]) | \ +- (v[1] == v[2]) | \ +- (v[1] == v[3]); \ +- int index = ((~b0) & 0x1) + (~(b0 ^ b1) & 0x1); \ +- \ +- tq[z] = v[index]; \ ++#define SHRINK_TYPE_MODE(TYPE) \ ++ { \ ++ int ls = VIPS_REGION_LSKIP(from); \ ++\ ++ for (x = 0; x < target->width; x++) { \ ++ TYPE *tp = (TYPE *) p; \ ++ TYPE *tp1 = (TYPE *) (p + ls); \ ++ TYPE *tq = (TYPE *) q; \ ++\ ++ for (z = 0; z < nb; z++) { \ ++ TYPE v[] = { tp[z], tp[z + nb], tp1[z], tp1[z + nb] }; \ ++ int b0 = (v[0] == v[1]) | \ ++ (v[0] == v[2]) | \ ++ (v[0] == v[3]); \ ++ int b1 = (v[1] == v[0]) | \ ++ (v[1] == v[2]) | \ ++ (v[1] == v[3]); \ ++ int index = ((~b0) & 0x1) + (~(b0 ^ b1) & 0x1); \ ++\ ++ tq[z] = v[index]; \ ++ } \ ++\ ++ p += ps << 1; \ ++ q += ps; \ + } \ +- \ +- p += ps << 1; \ +- q += ps; \ +- } \ +-} ++ } + +-#define SHRINK_TYPE_MAX( TYPE ) { \ +- int ls = VIPS_REGION_LSKIP( from ); \ +- \ +- for( x = 0; x < target->width; x++ ) { \ +- TYPE *tp = (TYPE *) p; \ +- TYPE *tp1 = (TYPE *) (p + ls); \ +- TYPE *tq = (TYPE *) q; \ +- \ +- for( z = 0; z < nb; z++ ) { \ +- tq[z] = VIPS_MAX( \ +- VIPS_MAX( tp[z], tp[z + nb] ), \ +- VIPS_MAX( tp1[z], tp1[z + nb] ) \ +- ); \ ++#define SHRINK_TYPE_MAX(TYPE) \ ++ { \ ++ int ls = VIPS_REGION_LSKIP(from); \ ++\ ++ for (x = 0; x < target->width; x++) { \ ++ TYPE *tp = (TYPE *) p; \ ++ TYPE *tp1 = (TYPE *) (p + ls); \ ++ TYPE *tq = (TYPE *) q; \ ++\ ++ for (z = 0; z < nb; z++) { \ ++ tq[z] = VIPS_MAX( \ ++ VIPS_MAX(tp[z], tp[z + nb]), \ ++ VIPS_MAX(tp1[z], tp1[z + nb])); \ ++ } \ ++\ ++ p += ps << 1; \ ++ q += ps; \ + } \ +- \ +- p += ps << 1; \ +- q += ps; \ +- } \ +-} ++ } + +-#define SHRINK_TYPE_MIN( TYPE ) { \ +- int ls = VIPS_REGION_LSKIP( from ); \ +- \ +- for( x = 0; x < target->width; x++ ) { \ +- TYPE *tp = (TYPE *) p; \ +- TYPE *tp1 = (TYPE *) (p + ls); \ +- TYPE *tq = (TYPE *) q; \ +- \ +- for( z = 0; z < nb; z++ ) { \ +- tq[z] = VIPS_MIN( \ +- VIPS_MIN( tp[z], tp[z + nb] ), \ +- VIPS_MIN( tp1[z], tp1[z + nb] ) \ +- ); \ ++#define SHRINK_TYPE_MIN(TYPE) \ ++ { \ ++ int ls = VIPS_REGION_LSKIP(from); \ ++\ ++ for (x = 0; x < target->width; x++) { \ ++ TYPE *tp = (TYPE *) p; \ ++ TYPE *tp1 = (TYPE *) (p + ls); \ ++ TYPE *tq = (TYPE *) q; \ ++\ ++ for (z = 0; z < nb; z++) { \ ++ tq[z] = VIPS_MIN( \ ++ VIPS_MIN(tp[z], tp[z + nb]), \ ++ VIPS_MIN(tp1[z], tp1[z + nb])); \ ++ } \ ++\ ++ p += ps << 1; \ ++ q += ps; \ + } \ +- \ +- p += ps << 1; \ +- q += ps; \ +- } \ +-} ++ } + +-#define SHRINK_TYPE_NEAREST( TYPE ) { \ +- for( x = 0; x < target->width; x++ ) { \ +- TYPE *tp = (TYPE *) p; \ +- TYPE *tq = (TYPE *) q; \ +- \ +- for( z = 0; z < nb; z++ ) \ +- tq[z] = tp[z]; \ +- \ +- p += ps << 1; \ +- q += ps; \ +- } \ +-} ++#define SHRINK_TYPE_NEAREST(TYPE) \ ++ { \ ++ for (x = 0; x < target->width; x++) { \ ++ TYPE *tp = (TYPE *) p; \ ++ TYPE *tq = (TYPE *) q; \ ++\ ++ for (z = 0; z < nb; z++) \ ++ tq[z] = tp[z]; \ ++\ ++ p += ps << 1; \ ++ q += ps; \ ++ } \ ++ } + +-#define VIPS_REGION_SHRINK( OP ) \ +-static void \ +-vips_region_shrink_uncoded_ ## OP( VipsRegion *from, \ +- VipsRegion *to, const VipsRect *target ) \ +-{ \ +- int ps = VIPS_IMAGE_SIZEOF_PEL( from->im ); \ +- int nb = from->im->Bands; \ +- \ +- int x, y, z; \ +- \ +- for( y = 0; y < target->height; y++ ) { \ +- VipsPel *p = VIPS_REGION_ADDR( from, \ +- target->left * 2, (target->top + y) * 2 ); \ +- VipsPel *q = VIPS_REGION_ADDR( to, \ +- target->left, target->top + y ); \ +- \ +- /* Process this line of pels. \ +- */ \ +- switch( from->im->BandFmt ) { \ +- case VIPS_FORMAT_UCHAR: \ +- SHRINK_TYPE_ ## OP( unsigned char ); break; \ +- case VIPS_FORMAT_CHAR: \ +- SHRINK_TYPE_ ## OP( signed char ); break; \ +- case VIPS_FORMAT_USHORT: \ +- SHRINK_TYPE_ ## OP( unsigned short ); break; \ +- case VIPS_FORMAT_SHORT: \ +- SHRINK_TYPE_ ## OP( signed short ); break; \ +- case VIPS_FORMAT_UINT: \ +- SHRINK_TYPE_ ## OP( unsigned int ); break; \ +- case VIPS_FORMAT_INT: \ +- SHRINK_TYPE_ ## OP( signed int ); break; \ +- case VIPS_FORMAT_FLOAT: \ +- SHRINK_TYPE_ ## OP( float ); break; \ +- case VIPS_FORMAT_DOUBLE: \ +- SHRINK_TYPE_ ## OP( double ); break; \ +- \ +- default: \ +- g_assert_not_reached(); \ ++#define VIPS_REGION_SHRINK(OP) \ ++ static void \ ++ vips_region_shrink_uncoded_##OP(VipsRegion *from, \ ++ VipsRegion *to, const VipsRect *target) \ ++ { \ ++ int ps = VIPS_IMAGE_SIZEOF_PEL(from->im); \ ++ int nb = from->im->Bands; \ ++\ ++ int x, y, z; \ ++\ ++ for (y = 0; y < target->height; y++) { \ ++ VipsPel *p = VIPS_REGION_ADDR(from, \ ++ target->left * 2, (target->top + y) * 2); \ ++ VipsPel *q = VIPS_REGION_ADDR(to, \ ++ target->left, target->top + y); \ ++\ ++ /* Process this line of pels. \ ++ */ \ ++ switch (from->im->BandFmt) { \ ++ case VIPS_FORMAT_UCHAR: \ ++ SHRINK_TYPE_##OP(unsigned char); \ ++ break; \ ++ case VIPS_FORMAT_CHAR: \ ++ SHRINK_TYPE_##OP(signed char); \ ++ break; \ ++ case VIPS_FORMAT_USHORT: \ ++ SHRINK_TYPE_##OP(unsigned short); \ ++ break; \ ++ case VIPS_FORMAT_SHORT: \ ++ SHRINK_TYPE_##OP(signed short); \ ++ break; \ ++ case VIPS_FORMAT_UINT: \ ++ SHRINK_TYPE_##OP(unsigned int); \ ++ break; \ ++ case VIPS_FORMAT_INT: \ ++ SHRINK_TYPE_##OP(signed int); \ ++ break; \ ++ case VIPS_FORMAT_FLOAT: \ ++ SHRINK_TYPE_##OP(float); \ ++ break; \ ++ case VIPS_FORMAT_DOUBLE: \ ++ SHRINK_TYPE_##OP(double); \ ++ break; \ ++\ ++ default: \ ++ g_assert_not_reached(); \ ++ } \ + } \ +- } \ +-} ++ } + +-VIPS_REGION_SHRINK( MAX ); +-VIPS_REGION_SHRINK( MIN ); +-VIPS_REGION_SHRINK( MODE ); +-VIPS_REGION_SHRINK( MEDIAN ); +-VIPS_REGION_SHRINK( NEAREST ); ++VIPS_REGION_SHRINK(MAX); ++VIPS_REGION_SHRINK(MIN); ++VIPS_REGION_SHRINK(MODE); ++VIPS_REGION_SHRINK(MEDIAN); ++VIPS_REGION_SHRINK(NEAREST); + + /* Generate area @target in @to using pixels in @from. Non-complex. + */ + static void +-vips_region_shrink_uncoded( VipsRegion *from, +- VipsRegion *to, const VipsRect *target, VipsRegionShrink method ) ++vips_region_shrink_uncoded(VipsRegion *from, ++ VipsRegion *to, const VipsRect *target, VipsRegionShrink method) + { +- switch( method ) { +- case VIPS_REGION_SHRINK_MEAN: +- vips_region_shrink_uncoded_mean( from, to, target ); +- break; ++ switch (method) { ++ case VIPS_REGION_SHRINK_MEAN: ++ vips_region_shrink_uncoded_mean(from, to, target); ++ break; + +- case VIPS_REGION_SHRINK_MEDIAN: +- vips_region_shrink_uncoded_MEDIAN( from, to, target ); +- break; ++ case VIPS_REGION_SHRINK_MEDIAN: ++ vips_region_shrink_uncoded_MEDIAN(from, to, target); ++ break; + +- case VIPS_REGION_SHRINK_MODE: +- vips_region_shrink_uncoded_MODE( from, to, target ); +- break; ++ case VIPS_REGION_SHRINK_MODE: ++ vips_region_shrink_uncoded_MODE(from, to, target); ++ break; + +- case VIPS_REGION_SHRINK_MAX: +- vips_region_shrink_uncoded_MAX( from, to, target ); +- break; ++ case VIPS_REGION_SHRINK_MAX: ++ vips_region_shrink_uncoded_MAX(from, to, target); ++ break; + +- case VIPS_REGION_SHRINK_MIN: +- vips_region_shrink_uncoded_MIN( from, to, target ); +- break; ++ case VIPS_REGION_SHRINK_MIN: ++ vips_region_shrink_uncoded_MIN(from, to, target); ++ break; + +- case VIPS_REGION_SHRINK_NEAREST: +- vips_region_shrink_uncoded_NEAREST( from, to, target ); +- break; ++ case VIPS_REGION_SHRINK_NEAREST: ++ vips_region_shrink_uncoded_NEAREST(from, to, target); ++ break; + +- default: +- g_assert_not_reached(); ++ default: ++ g_assert_not_reached(); + } + } + + /* No point having an int path, this will always be horribly slow. + */ +-#define SHRINK_ALPHA_TYPE( TYPE ) { \ +- TYPE *tp = (TYPE *) p; \ +- TYPE *tp1 = (TYPE *) (p + ls); \ +- TYPE *tq = (TYPE *) q; \ +- \ +- for( x = 0; x < target->width; x++ ) { \ +- /* Make the input alphas. \ +- */ \ +- double a1 = tp[nb - 1]; \ +- double a2 = tp[nb + nb - 1]; \ +- double a3 = tp1[nb - 1]; \ +- double a4 = tp1[nb + nb - 1]; \ +- \ +- /* Output alpha. \ +- */ \ +- double a = (a1 + a2 + a3 + a4) / 4.0; \ +- \ +- if( a == 0 ) { \ +- for( z = 0; z < nb; z++ ) \ +- tq[z] = 0; \ +- } \ +- else { \ +- for( z = 0; z < nb - 1; z++ ) \ +- tq[z] = (a1 * tp[z] + a2 * tp[z + nb] + \ +- a3 * tp1[z] + a4 * tp1[z + nb]) / \ +- (4.0 * a); \ +- tq[z] = a; \ ++#define SHRINK_ALPHA_TYPE(TYPE) \ ++ { \ ++ TYPE *tp = (TYPE *) p; \ ++ TYPE *tp1 = (TYPE *) (p + ls); \ ++ TYPE *tq = (TYPE *) q; \ ++\ ++ for (x = 0; x < target->width; x++) { \ ++ /* Make the input alphas. \ ++ */ \ ++ double a1 = tp[nb - 1]; \ ++ double a2 = tp[nb + nb - 1]; \ ++ double a3 = tp1[nb - 1]; \ ++ double a4 = tp1[nb + nb - 1]; \ ++\ ++ /* Output alpha. \ ++ */ \ ++ double a = (a1 + a2 + a3 + a4) / 4.0; \ ++\ ++ if (a == 0) { \ ++ for (z = 0; z < nb; z++) \ ++ tq[z] = 0; \ ++ } \ ++ else { \ ++ for (z = 0; z < nb - 1; z++) \ ++ tq[z] = (a1 * tp[z] + a2 * tp[z + nb] + \ ++ a3 * tp1[z] + a4 * tp1[z + nb]) / \ ++ (4.0 * a); \ ++ tq[z] = a; \ ++ } \ ++\ ++ /* Move on two pels in input. \ ++ */ \ ++ tp += nb << 1; \ ++ tp1 += nb << 1; \ ++ tq += nb; \ + } \ +- \ +- /* Move on two pels in input. \ +- */ \ +- tp += nb << 1; \ +- tp1 += nb << 1; \ +- tq += nb; \ +- } \ +-} ++ } + + /* Generate area @target in @to using pixels in @from. Non-complex. Use the + * last band as alpha. + */ + static void +-vips_region_shrink_alpha( VipsRegion *from, +- VipsRegion *to, const VipsRect *target ) ++vips_region_shrink_alpha(VipsRegion *from, ++ VipsRegion *to, const VipsRect *target) + { +- int ls = VIPS_REGION_LSKIP( from ); ++ int ls = VIPS_REGION_LSKIP(from); + int nb = from->im->Bands; + + int x, y, z; + +- for( y = 0; y < target->height; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( from, +- target->left * 2, (target->top + y) * 2 ); +- VipsPel *q = VIPS_REGION_ADDR( to, +- target->left, target->top + y ); ++ for (y = 0; y < target->height; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(from, ++ target->left * 2, (target->top + y) * 2); ++ VipsPel *q = VIPS_REGION_ADDR(to, ++ target->left, target->top + y); + + /* Process this line of pels. + */ +- switch( from->im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- SHRINK_ALPHA_TYPE( unsigned char ); break; +- case VIPS_FORMAT_CHAR: +- SHRINK_ALPHA_TYPE( signed char ); break; +- case VIPS_FORMAT_USHORT: +- SHRINK_ALPHA_TYPE( unsigned short ); break; +- case VIPS_FORMAT_SHORT: +- SHRINK_ALPHA_TYPE( signed short ); break; +- case VIPS_FORMAT_UINT: +- SHRINK_ALPHA_TYPE( unsigned int ); break; +- case VIPS_FORMAT_INT: +- SHRINK_ALPHA_TYPE( signed int ); break; +- case VIPS_FORMAT_FLOAT: +- SHRINK_ALPHA_TYPE( float ); break; +- case VIPS_FORMAT_DOUBLE: +- SHRINK_ALPHA_TYPE( double ); break; ++ switch (from->im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ SHRINK_ALPHA_TYPE(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ SHRINK_ALPHA_TYPE(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ SHRINK_ALPHA_TYPE(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ SHRINK_ALPHA_TYPE(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ SHRINK_ALPHA_TYPE(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ SHRINK_ALPHA_TYPE(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ SHRINK_ALPHA_TYPE(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ SHRINK_ALPHA_TYPE(double); ++ break; + + default: + g_assert_not_reached(); +@@ -1527,33 +1555,33 @@ vips_region_shrink_alpha( VipsRegion *from, + * Non-complex uncoded images and LABQ only. Images with alpha (see + * vips_image_hasalpha()) shrink with pixels scaled by alpha to avoid fringing. + * +- * @method selects the method used to do the 2x2 shrink. ++ * @method selects the method used to do the 2x2 shrink. + * + * See also: vips_region_copy(). + */ + int +-vips_region_shrink_method( VipsRegion *from, VipsRegion *to, +- const VipsRect *target, VipsRegionShrink method ) ++vips_region_shrink_method(VipsRegion *from, VipsRegion *to, ++ const VipsRect *target, VipsRegionShrink method) + { + VipsImage *image = from->im; + +- if( vips_check_coding_noneorlabq( "vips_region_shrink_method", image ) ) +- return( -1 ); ++ if (vips_check_coding_noneorlabq("vips_region_shrink_method", image)) ++ return (-1); + +- if( from->im->Coding == VIPS_CODING_NONE ) { +- if( vips_check_noncomplex( "vips_region_shrink_method", +- image ) ) +- return( -1 ); ++ if (from->im->Coding == VIPS_CODING_NONE) { ++ if (vips_check_noncomplex("vips_region_shrink_method", ++ image)) ++ return (-1); + +- if( vips_image_hasalpha( image ) ) +- vips_region_shrink_alpha( from, to, target ); ++ if (vips_image_hasalpha(image)) ++ vips_region_shrink_alpha(from, to, target); + else +- vips_region_shrink_uncoded( from, to, target, method ); ++ vips_region_shrink_uncoded(from, to, target, method); + } + else +- vips_region_shrink_labpack( from, to, target ); ++ vips_region_shrink_labpack(from, to, target); + +- return( 0 ); ++ return (0); + } + + /** +@@ -1571,72 +1599,72 @@ vips_region_shrink_method( VipsRegion *from, VipsRegion *to, + * See also: vips_region_shrink_method(). + */ + int +-vips_region_shrink( VipsRegion *from, VipsRegion *to, const VipsRect *target ) ++vips_region_shrink(VipsRegion *from, VipsRegion *to, const VipsRect *target) + { +- return( vips_region_shrink_method( from, to, target, +- VIPS_REGION_SHRINK_MEAN ) ); ++ return (vips_region_shrink_method(from, to, target, ++ VIPS_REGION_SHRINK_MEAN)); + } + +-/* Generate into a region. ++/* Generate into a region. + */ + static int +-vips_region_generate( VipsRegion *reg, void *a ) ++vips_region_generate(VipsRegion *reg, void *a) + { + VipsImage *im = reg->im; + + gboolean stop; + +- /* Start new sequence, if necessary. +- */ +- if( vips__region_start( reg ) ) +- return( -1 ); ++ /* Start new sequence, if necessary. ++ */ ++ if (vips__region_start(reg)) ++ return (-1); + + /* Ask for evaluation. + */ + stop = FALSE; +- if( im->generate_fn( reg, reg->seq, im->client1, im->client2, &stop ) ) +- return( -1 ); +- if( stop ) { +- vips_error( "vips_region_generate", +- "%s", _( "stop requested" ) ); +- return( -1 ); ++ if (im->generate_fn(reg, reg->seq, im->client1, im->client2, &stop)) ++ return (-1); ++ if (stop) { ++ vips_error("vips_region_generate", ++ "%s", _("stop requested")); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + +-/** ++/** + * vips_region_prepare: + * @reg: region to prepare + * @r: #VipsRect of pixels you need to be able to address + * +- * vips_region_prepare() fills @reg with pixels. After calling, +- * you can address at least the area @r with VIPS_REGION_ADDR() and get ++ * vips_region_prepare() fills @reg with pixels. After calling, ++ * you can address at least the area @r with VIPS_REGION_ADDR() and get + * valid pixels. + * +- * vips_region_prepare() runs in-line, that is, computation is done by +- * the calling thread, no new threads are involved, and computation ++ * vips_region_prepare() runs in-line, that is, computation is done by ++ * the calling thread, no new threads are involved, and computation + * blocks until the pixels are ready. + * +- * Use vips_sink_screen() to calculate an area of pixels in the ++ * Use vips_sink_screen() to calculate an area of pixels in the + * background. + * +- * See also: vips_sink_screen(), ++ * See also: vips_sink_screen(), + * vips_region_prepare_to(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_region_prepare( VipsRegion *reg, const VipsRect *r ) +-{ ++vips_region_prepare(VipsRegion *reg, const VipsRect *r) ++{ + VipsImage *im = reg->im; + + VipsRect save = *r; + +- vips__region_check_ownership( reg ); ++ vips__region_check_ownership(reg); + +- if( vips_image_iskilled( im ) ) +- return( -1 ); ++ if (vips_image_iskilled(im)) ++ return (-1); + + /* We use save for sanity checking valid: we test at the end that the + * pixels we have generated are indeed all the ones that were asked +@@ -1645,26 +1673,26 @@ vips_region_prepare( VipsRegion *reg, const VipsRect *r ) + * However, r may be clipped by the image size, so we need to clip + * save as well to make sure we don't fail the assert due to that. + */ +-{ +- VipsRect image; +- +- image.left = 0; +- image.top = 0; +- image.width = reg->im->Xsize; +- image.height = reg->im->Ysize; +- vips_rect_intersectrect( &save, &image, &save ); +-} ++ { ++ VipsRect image; ++ ++ image.left = 0; ++ image.top = 0; ++ image.width = reg->im->Xsize; ++ image.height = reg->im->Ysize; ++ vips_rect_intersectrect(&save, &image, &save); ++ } + + #ifdef DEBUG +- printf( "vips_region_prepare: " +- "left = %d, top = %d, width = %d, height = %d\n", +- r->left, r->top, r->width, r->height ); ++ printf("vips_region_prepare: " ++ "left = %d, top = %d, width = %d, height = %d\n", ++ r->left, r->top, r->width, r->height); + #endif /*DEBUG*/ + +- switch( im->dtype ) { ++ switch (im->dtype) { + case VIPS_IMAGE_PARTIAL: +- if( vips_region_fill( reg, r, vips_region_generate, NULL ) ) +- return( -1 ); ++ if (vips_region_fill(reg, r, vips_region_generate, NULL)) ++ return (-1); + + break; + +@@ -1675,64 +1703,64 @@ vips_region_prepare( VipsRegion *reg, const VipsRect *r ) + case VIPS_IMAGE_OPENIN: + /* Attach to existing buffer. + */ +- if( vips_region_image( reg, r ) ) +- return( -1 ); ++ if (vips_region_image(reg, r)) ++ return (-1); + + break; + + default: +- vips_error( "vips_region_prepare", +- _( "unable to input from a %s image" ), +- vips_enum_string( VIPS_TYPE_DEMAND_STYLE, im->dtype ) ); +- return( -1 ); ++ vips_error("vips_region_prepare", ++ _("unable to input from a %s image"), ++ vips_enum_string(VIPS_TYPE_DEMAND_STYLE, im->dtype)); ++ return (-1); + } + + /* valid should now include all the pixels that were asked for. + */ +- g_assert( vips_rect_includesrect( ®->valid, &save ) ); ++ g_assert(vips_rect_includesrect(®->valid, &save)); + +- return( 0 ); ++ return (0); + } + + /* We need to make pixels using reg's generate function, and write the result + * to dest. + */ + static int +-vips_region_prepare_to_generate( VipsRegion *reg, +- VipsRegion *dest, const VipsRect *r, int x, int y ) ++vips_region_prepare_to_generate(VipsRegion *reg, ++ VipsRegion *dest, const VipsRect *r, int x, int y) + { + VipsImage *im = reg->im; + VipsPel *p; + +- if( !im->generate_fn ) { +- vips_error( "vips_region_prepare_to", +- "%s", _( "incomplete header" ) ); +- return( -1 ); ++ if (!im->generate_fn) { ++ vips_error("vips_region_prepare_to", ++ "%s", _("incomplete header")); ++ return (-1); + } + +- if( vips_region_region( reg, dest, r, x, y ) ) +- return( -1 ); ++ if (vips_region_region(reg, dest, r, x, y)) ++ return (-1); + + /* Remember where reg is pointing now. + */ +- p = VIPS_REGION_ADDR( reg, reg->valid.left, reg->valid.top ); ++ p = VIPS_REGION_ADDR(reg, reg->valid.left, reg->valid.top); + + /* Run sequence into reg. + */ +- if( vips_region_generate( reg, NULL ) ) +- return( -1 ); ++ if (vips_region_generate(reg, NULL)) ++ return (-1); + + /* The generate function may not have actually made any pixels ... it + * might just have redirected reg to point somewhere else. If it has, + * we need an extra copy operation. + */ +- if( VIPS_REGION_ADDR( reg, reg->valid.left, reg->valid.top ) != p ) +- vips_region_copy( reg, dest, r, x, y ); ++ if (VIPS_REGION_ADDR(reg, reg->valid.left, reg->valid.top) != p) ++ vips_region_copy(reg, dest, r, x, y); + +- return( 0 ); ++ return (0); + } + +-/** ++/** + * vips_region_prepare_to: + * @reg: region to prepare + * @dest: region to write to +@@ -1740,15 +1768,15 @@ vips_region_prepare_to_generate( VipsRegion *reg, + * @x: postion of @r in @dest + * @y: postion of @r in @dest + * +- * Like vips_region_prepare(): fill @reg with the pixels in area @r. ++ * Like vips_region_prepare(): fill @reg with the pixels in area @r. + * +- * Unlike vips_region_prepare(), rather than writing the result to @reg, the +- * pixels are written into @dest at offset @x, @y. ++ * Unlike vips_region_prepare(), rather than writing the result to @reg, the ++ * pixels are written into @dest at offset @x, @y. + * +- * Also unlike vips_region_prepare(), @dest is not set up for writing for ++ * Also unlike vips_region_prepare(), @dest is not set up for writing for + * you with vips_region_buffer(). You can +- * point @dest at anything, and pixels really will be written there. +- * This makes vips_region_prepare_to() useful for making the ends of ++ * point @dest at anything, and pixels really will be written there. ++ * This makes vips_region_prepare_to() useful for making the ends of + * pipelines. + * + * See also: vips_region_prepare(), vips_sink_disc(). +@@ -1756,8 +1784,8 @@ vips_region_prepare_to_generate( VipsRegion *reg, + * Returns: 0 on success, or -1 on error + */ + int +-vips_region_prepare_to( VipsRegion *reg, +- VipsRegion *dest, const VipsRect *r, int x, int y ) ++vips_region_prepare_to(VipsRegion *reg, ++ VipsRegion *dest, const VipsRect *r, int x, int y) + { + VipsImage *im = reg->im; + VipsRect image; +@@ -1766,31 +1794,31 @@ vips_region_prepare_to( VipsRegion *reg, + VipsRect clipped2; + VipsRect final; + +- if( vips_image_iskilled( im ) ) +- return( -1 ); ++ if (vips_image_iskilled(im)) ++ return (-1); + + /* Sanity check. + */ +- if( !dest->data || ++ if (!dest->data || + dest->im->BandFmt != reg->im->BandFmt || +- dest->im->Bands != reg->im->Bands ) { +- vips_error( "vips_region_prepare_to", +- "%s", _( "inappropriate region type" ) ); +- return( -1 ); ++ dest->im->Bands != reg->im->Bands) { ++ vips_error("vips_region_prepare_to", ++ "%s", _("inappropriate region type")); ++ return (-1); + } + +- /* clip r first against the size of reg->im, then again against the +- * memory we have available to write to on dest. Just like ++ /* clip r first against the size of reg->im, then again against the ++ * memory we have available to write to on dest. Just like + * vips_region_region() + */ + image.top = 0; + image.left = 0; + image.width = reg->im->Xsize; + image.height = reg->im->Ysize; +- vips_rect_intersectrect( r, &image, &clipped ); ++ vips_rect_intersectrect(r, &image, &clipped); + +- g_assert( clipped.left == r->left ); +- g_assert( clipped.top == r->top ); ++ g_assert(clipped.left == r->left); ++ g_assert(clipped.top == r->top); + + wanted.left = x + (clipped.left - r->left); + wanted.top = y + (clipped.top - r->top); +@@ -1799,13 +1827,13 @@ vips_region_prepare_to( VipsRegion *reg, + + /* Test that dest->valid is large enough. + */ +- if( !vips_rect_includesrect( &dest->valid, &wanted ) ) { +- vips_error( "vips_region_prepare_to", +- "%s", _( "dest too small" ) ); +- return( -1 ); ++ if (!vips_rect_includesrect(&dest->valid, &wanted)) { ++ vips_error("vips_region_prepare_to", ++ "%s", _("dest too small")); ++ return (-1); + } + +- vips_rect_intersectrect( &wanted, &dest->valid, &clipped2 ); ++ vips_rect_intersectrect(&wanted, &dest->valid, &clipped2); + + /* Translate back to reg's coordinate space and set as valid. + */ +@@ -1817,27 +1845,27 @@ vips_region_prepare_to( VipsRegion *reg, + x = clipped2.left; + y = clipped2.top; + +- if( vips_rect_isempty( &final ) ) { +- vips_error( "vips_region_prepare_to", +- "%s", _( "valid clipped to nothing" ) ); +- return( -1 ); ++ if (vips_rect_isempty(&final)) { ++ vips_error("vips_region_prepare_to", ++ "%s", _("valid clipped to nothing")); ++ return (-1); + } + + #ifdef DEBUG +- printf( "vips_region_prepare_to: " +- "left = %d, top = %d, width = %d, height = %d\n", +- final.left, final.top, final.width, final.height ); ++ printf("vips_region_prepare_to: " ++ "left = %d, top = %d, width = %d, height = %d\n", ++ final.left, final.top, final.width, final.height); + #endif /*DEBUG*/ + + /* Input or output image type? + */ +- switch( im->dtype ) { ++ switch (im->dtype) { + case VIPS_IMAGE_OPENOUT: + case VIPS_IMAGE_PARTIAL: +- /* We are generating with a sequence. ++ /* We are generating with a sequence. + */ +- if( vips_region_prepare_to_generate( reg, dest, &final, x, y ) ) +- return( -1 ); ++ if (vips_region_prepare_to_generate(reg, dest, &final, x, y)) ++ return (-1); + + break; + +@@ -1846,9 +1874,9 @@ vips_region_prepare_to( VipsRegion *reg, + case VIPS_IMAGE_OPENIN: + /* Attach to existing buffer and copy to dest. + */ +- if( vips_region_image( reg, &final ) ) +- return( -1 ); +- vips_region_copy( reg, dest, &final, x, y ); ++ if (vips_region_image(reg, &final)) ++ return (-1); ++ vips_region_copy(reg, dest, &final, x, y); + + break; + +@@ -1857,51 +1885,51 @@ vips_region_prepare_to( VipsRegion *reg, + /* Could be either input or output. If there is a generate + * function, we are outputting. + */ +- if( im->generate_fn ) { +- if( vips_region_prepare_to_generate( reg, +- dest, &final, x, y ) ) +- return( -1 ); ++ if (im->generate_fn) { ++ if (vips_region_prepare_to_generate(reg, ++ dest, &final, x, y)) ++ return (-1); + } + else { +- if( vips_region_image( reg, &final ) ) +- return( -1 ); +- vips_region_copy( reg, dest, &final, x, y ); ++ if (vips_region_image(reg, &final)) ++ return (-1); ++ vips_region_copy(reg, dest, &final, x, y); + } + + break; + + default: +- vips_error( "vips_region_prepare_to", +- _( "unable to input from a %s image" ), +- vips_enum_nick( VIPS_TYPE_DEMAND_STYLE, im->dtype ) ); +- return( -1 ); ++ vips_error("vips_region_prepare_to", ++ _("unable to input from a %s image"), ++ vips_enum_nick(VIPS_TYPE_DEMAND_STYLE, im->dtype)); ++ return (-1); + } + + /* We've written fresh pixels to dest, it's no longer invalid (if it + * was). + * +- * We need this extra thing here because, unlike +- * vips_region_prepare(), we don't vips_region_buffer() dest before ++ * We need this extra thing here because, unlike ++ * vips_region_prepare(), we don't vips_region_buffer() dest before + * writing it. + */ + dest->invalid = FALSE; + +- return( 0 ); ++ return (0); + } + + /* Don't use this, use vips_reorder_prepare_many() instead. + */ + int +-vips_region_prepare_many( VipsRegion **reg, const VipsRect *r ) ++vips_region_prepare_many(VipsRegion **reg, const VipsRect *r) + { +- for( ; *reg; ++reg ) +- if( vips_region_prepare( *reg, r ) ) +- return( -1 ); ++ for (; *reg; ++reg) ++ if (vips_region_prepare(*reg, r)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-/** ++/** + * vips_region_fetch: + * @region: region to fetch pixels from + * @left: area of pixels to fetch +@@ -1918,8 +1946,8 @@ vips_region_prepare_many( VipsRegion **reg, const VipsRect *r ) + * Returns: A copy of the pixel data. + */ + VipsPel * +-vips_region_fetch( VipsRegion *region, +- int left, int top, int width, int height, size_t *len ) ++vips_region_fetch(VipsRegion *region, ++ int left, int top, int width, int height, size_t *len) + { + VipsRect request; + VipsRect image; +@@ -1929,8 +1957,8 @@ vips_region_fetch( VipsRegion *region, + size_t skip; + size_t line; + +- g_assert( width > 0 ); +- g_assert( height > 0 ); ++ g_assert(width > 0); ++ g_assert(height > 0); + + image.left = 0; + image.top = 0; +@@ -1940,29 +1968,29 @@ vips_region_fetch( VipsRegion *region, + request.top = top; + request.width = width; + request.height = height; +- if( !vips_rect_includesrect( &image, &request ) ) +- return( NULL ); +- if( vips_region_prepare( region, &request ) ) +- return( NULL ); ++ if (!vips_rect_includesrect(&image, &request)) ++ return (NULL); ++ if (vips_region_prepare(region, &request)) ++ return (NULL); + +- skip = VIPS_REGION_LSKIP( region ); +- line = VIPS_IMAGE_SIZEOF_PEL( region->im ) * request.width; +- if( !(result = (VipsPel *) vips_malloc( NULL, line * request.height )) ) +- return( NULL ); ++ skip = VIPS_REGION_LSKIP(region); ++ line = VIPS_IMAGE_SIZEOF_PEL(region->im) * request.width; ++ if (!(result = (VipsPel *) vips_malloc(NULL, line * request.height))) ++ return (NULL); + +- p = VIPS_REGION_ADDR( region, request.left, request.top ); ++ p = VIPS_REGION_ADDR(region, request.left, request.top); + q = result; +- for( y = 0; y < request.height; y++ ) { +- memcpy( q, p, line ); ++ for (y = 0; y < request.height; y++) { ++ memcpy(q, p, line); + + p += skip; + q += line; + } + +- if( len ) ++ if (len) + *len = request.height * line; + +- return( result ); ++ return (result); + } + + /** +@@ -1972,10 +2000,10 @@ vips_region_fetch( VipsRegion *region, + * Returns: Width of the pixels held in region. + */ + int +-vips_region_width( VipsRegion *region ) ++vips_region_width(VipsRegion *region) + { +- return( region->valid.width ); +-} ++ return (region->valid.width); ++} + + /** + * vips_region_height: +@@ -1984,12 +2012,12 @@ vips_region_width( VipsRegion *region ) + * Returns: Height of the pixels held in region. + */ + int +-vips_region_height( VipsRegion *region ) ++vips_region_height(VipsRegion *region) + { +- return( region->valid.height ); +-} ++ return (region->valid.height); ++} + +-/** ++/** + * vips_region_invalidate: + * @reg: region to invalidate + * +@@ -1998,61 +2026,61 @@ vips_region_height( VipsRegion *region ) + * recalculated. + * + * This is faster than calling vips_image_invalidate_all(), but obviously only +- * affects a single region. ++ * affects a single region. + * + * See also: vips_image_invalidate_all(), vips_region_prepare(). + */ +-void +-vips_region_invalidate( VipsRegion *reg ) ++void ++vips_region_invalidate(VipsRegion *reg) + { + reg->invalid = TRUE; + } + + #ifdef VIPS_DEBUG + static void * +-vips_region_dump_all_cb( VipsRegion *region, size_t *alive, void *b ) ++vips_region_dump_all_cb(VipsRegion *region, size_t *alive, void *b) + { + char str[2048]; +- VipsBuf buf = VIPS_BUF_STATIC( str ); ++ VipsBuf buf = VIPS_BUF_STATIC(str); + +- vips_object_summary( VIPS_OBJECT( region ), &buf ); +- printf( "%s\n", vips_buf_all( &buf ) ); ++ vips_object_summary(VIPS_OBJECT(region), &buf); ++ printf("%s\n", vips_buf_all(&buf)); + +- if( region->buffer && region->buffer->buf ) ++ if (region->buffer && region->buffer->buf) + *alive += region->buffer->bsize; + +- return( NULL ); ++ return (NULL); + } + + void +-vips_region_dump_all( void ) ++vips_region_dump_all(void) + { + size_t alive; + +- g_mutex_lock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); + alive = 0; +- printf( "%d regions in vips\n", g_slist_length( vips__regions_all ) ); +- vips_slist_map2( vips__regions_all, +- (VipsSListMap2Fn) vips_region_dump_all_cb, &alive, NULL ); +- printf( "%gMB alive\n", alive / (1024 * 1024.0) ); +- g_mutex_unlock( vips__global_lock ); ++ printf("%d regions in vips\n", g_slist_length(vips__regions_all)); ++ vips_slist_map2(vips__regions_all, ++ (VipsSListMap2Fn) vips_region_dump_all_cb, &alive, NULL); ++ printf("%gMB alive\n", alive / (1024 * 1024.0)); ++ g_mutex_unlock(vips__global_lock); + } + #endif /*VIPS_DEBUG*/ + + #ifdef DEBUG_LEAK + void +-vips__region_count_pixels( VipsRegion *region, const char *nickname ) ++vips__region_count_pixels(VipsRegion *region, const char *nickname) + { + VipsImage *image = region->im; +- VipsImagePixels *pixels = g_object_get_qdata( G_OBJECT( image ), +- vips__image_pixels_quark ); +- +- g_mutex_lock( vips__global_lock ); +- if( !pixels->tpels ) +- pixels->tpels = VIPS_IMAGE_N_PELS( image ); +- if( !pixels->nickname ) +- pixels->nickname = nickname; ++ VipsImagePixels *pixels = g_object_get_qdata(G_OBJECT(image), ++ vips__image_pixels_quark); ++ ++ g_mutex_lock(vips__global_lock); ++ if (!pixels->tpels) ++ pixels->tpels = VIPS_IMAGE_N_PELS(image); ++ if (!pixels->nickname) ++ pixels->nickname = nickname; + pixels->npels += region->valid.width * region->valid.height; +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_unlock(vips__global_lock); + } + #endif /*DEBUG_LEAK*/ +diff --git a/libvips/iofuncs/reorder.c b/libvips/iofuncs/reorder.c +index 99cf74005f..4d54b6372e 100644 +--- a/libvips/iofuncs/reorder.c ++++ b/libvips/iofuncs/reorder.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -56,7 +56,7 @@ typedef struct _VipsReorder { + * NULL-terminated. + * + * Score is the priority we give to the inputs as we de-dupe the source +- * arrays. ++ * arrays. + * + * The recomp order is the order we prepare regions in ... just make a + * range then sort by score. +@@ -66,10 +66,10 @@ typedef struct _VipsReorder { + int *score; + int *recomp_order; + +- /* Source images are images with no input images, so file load, ++ /* Source images are images with no input images, so file load, + * vips_black(), etc. NULL-terminated array. + * +- * The cumulative margin is the total margin that has been added to ++ * The cumulative margin is the total margin that has been added to + * each source image up to this point in the pipeline. + */ + int n_sources; +@@ -78,70 +78,69 @@ typedef struct _VipsReorder { + + } VipsReorder; + +-GQuark vips__image_reorder_quark = 0; ++GQuark vips__image_reorder_quark = 0; + + #ifdef DEBUG + static void +-vips_reorder_print( VipsReorder *reorder ) ++vips_reorder_print(VipsReorder *reorder) + { + int i; + +- printf( "vips_reorder_print: " ); +- vips_object_print_name( VIPS_OBJECT( reorder->image ) ); +- printf( "\n" ); +- +- printf( "n_inputs = %d\n", reorder->n_inputs ); +- printf( " n score order\n" ); +- for( i = 0; i < reorder->n_inputs; i++ ) { +- printf( "%2d - %8d, %8d, ", +- i, reorder->score[i], reorder->recomp_order[i] ); +- vips_object_print_name( VIPS_OBJECT( reorder->input[i] ) ); +- printf( "\n" ); ++ printf("vips_reorder_print: "); ++ vips_object_print_name(VIPS_OBJECT(reorder->image)); ++ printf("\n"); ++ ++ printf("n_inputs = %d\n", reorder->n_inputs); ++ printf(" n score order\n"); ++ for (i = 0; i < reorder->n_inputs; i++) { ++ printf("%2d - %8d, %8d, ", ++ i, reorder->score[i], reorder->recomp_order[i]); ++ vips_object_print_name(VIPS_OBJECT(reorder->input[i])); ++ printf("\n"); + } + +- printf( "n_sources = %d\n", reorder->n_sources ); +- printf( " n margin\n" ); +- for( i = 0; i < reorder->n_sources; i++ ) { +- printf( "%2d - %8d, ", +- i, reorder->cumulative_margin[i] ); +- vips_object_print_name( VIPS_OBJECT( reorder->source[i] ) ); +- printf( "\n" ); ++ printf("n_sources = %d\n", reorder->n_sources); ++ printf(" n margin\n"); ++ for (i = 0; i < reorder->n_sources; i++) { ++ printf("%2d - %8d, ", ++ i, reorder->cumulative_margin[i]); ++ vips_object_print_name(VIPS_OBJECT(reorder->source[i])); ++ printf("\n"); + } +- + } + #endif /*DEBUG*/ + + static void +-vips_reorder_free( VipsReorder *reorder ) ++vips_reorder_free(VipsReorder *reorder) + { + /* We free explicitly, rather than using VIPS_ARRAY( image ... ), since + * we need to make sure these pointers are valid to this point in the + * close cycle. + */ +- VIPS_FREE( reorder->input ); +- VIPS_FREE( reorder->score ); +- VIPS_FREE( reorder->recomp_order ); +- VIPS_FREE( reorder->source ); +- VIPS_FREE( reorder->cumulative_margin ); ++ VIPS_FREE(reorder->input); ++ VIPS_FREE(reorder->score); ++ VIPS_FREE(reorder->recomp_order); ++ VIPS_FREE(reorder->source); ++ VIPS_FREE(reorder->cumulative_margin); + } + + static void +-vips_reorder_destroy( VipsReorder *reorder ) ++vips_reorder_destroy(VipsReorder *reorder) + { +- vips_reorder_free( reorder ); +- VIPS_FREE( reorder ); ++ vips_reorder_free(reorder); ++ VIPS_FREE(reorder); + } + + static VipsReorder * +-vips_reorder_get( VipsImage *image ) ++vips_reorder_get(VipsImage *image) + { + VipsReorder *reorder; +- +- if( (reorder = g_object_get_qdata( G_OBJECT( image ), +- vips__image_reorder_quark )) ) +- return( reorder ); + +- reorder = VIPS_NEW( NULL, VipsReorder ); ++ if ((reorder = g_object_get_qdata(G_OBJECT(image), ++ vips__image_reorder_quark))) ++ return (reorder); ++ ++ reorder = VIPS_NEW(NULL, VipsReorder); + reorder->image = image; + reorder->n_inputs = 0; + reorder->input = NULL; +@@ -151,74 +150,74 @@ vips_reorder_get( VipsImage *image ) + reorder->source = NULL; + reorder->cumulative_margin = NULL; + +- g_object_set_qdata_full( G_OBJECT( image ), vips__image_reorder_quark, +- reorder, (GDestroyNotify) vips_reorder_destroy ); ++ g_object_set_qdata_full(G_OBJECT(image), vips__image_reorder_quark, ++ reorder, (GDestroyNotify) vips_reorder_destroy); + +- return( reorder ); ++ return (reorder); + } + + static int +-vips_reorder_compare_score( const void *a, const void *b, void *arg ) ++vips_reorder_compare_score(const void *a, const void *b, void *arg) + { + int i1 = *((int *) a); + int i2 = *((int *) b); + VipsReorder *reorder = (VipsReorder *) arg; + +- return( reorder->score[i2] - reorder->score[i1] ); ++ return (reorder->score[i2] - reorder->score[i1]); + } + + int +-vips__reorder_set_input( VipsImage *image, VipsImage **in ) ++vips__reorder_set_input(VipsImage *image, VipsImage **in) + { +- VipsReorder *reorder = vips_reorder_get( image ); ++ VipsReorder *reorder = vips_reorder_get(image); + + int i; + int total; + + /* We have to support being called more than once on the same image. +- * Two cases: +- * ++ * Two cases: ++ * + * 1. in the first call, no images were set ... we throw away + * everything from the first call and try again. foreign can do this. + * + * 2. warn if the args were different and do nothing. + */ +- if( reorder->source ) { +- if( reorder->n_inputs == 0 ) { ++ if (reorder->source) { ++ if (reorder->n_inputs == 0) { + reorder->n_sources = 0; +- vips_reorder_free( reorder ); ++ vips_reorder_free(reorder); + } + else { +- for( i = 0; in[i]; i++ ) +- if( i >= reorder->n_inputs || +- in[i] != reorder->input[i] ) { ++ for (i = 0; in[i]; i++) ++ if (i >= reorder->n_inputs || ++ in[i] != reorder->input[i]) { + /* Should never happen. + */ +- g_warning( "vips__reorder_set_input: " +- "args differ\n" ); ++ g_warning("vips__reorder_set_input: " ++ "args differ\n"); + break; + } + +- return( 0 ); ++ return (0); + } + } + + /* Make a copy of the input array. + */ +- for( i = 0; in[i]; i++ ) ++ for (i = 0; in[i]; i++) + ; + reorder->n_inputs = i; +- reorder->input = VIPS_ARRAY( NULL, reorder->n_inputs + 1, VipsImage * ); +- reorder->score = VIPS_ARRAY( NULL, reorder->n_inputs, int ); +- reorder->recomp_order = VIPS_ARRAY( NULL, reorder->n_inputs, int ); +- if( !reorder->input ) +- return( -1 ); +- if( reorder->n_inputs && ++ reorder->input = VIPS_ARRAY(NULL, reorder->n_inputs + 1, VipsImage *); ++ reorder->score = VIPS_ARRAY(NULL, reorder->n_inputs, int); ++ reorder->recomp_order = VIPS_ARRAY(NULL, reorder->n_inputs, int); ++ if (!reorder->input) ++ return (-1); ++ if (reorder->n_inputs && + (!reorder->score || +- !reorder->recomp_order) ) +- return( -1 ); ++ !reorder->recomp_order)) ++ return (-1); + +- for( i = 0; i < reorder->n_inputs; i++ ) { ++ for (i = 0; i < reorder->n_inputs; i++) { + reorder->input[i] = in[i]; + reorder->score[i] = 0; + reorder->recomp_order[i] = i; +@@ -229,59 +228,58 @@ vips__reorder_set_input( VipsImage *image, VipsImage **in ) + * to the size of the unique source image array we will need. + */ + total = 0; +- for( i = 0; i < reorder->n_inputs; i++ ) +- total += vips_reorder_get( reorder->input[i] )->n_sources; ++ for (i = 0; i < reorder->n_inputs; i++) ++ total += vips_reorder_get(reorder->input[i])->n_sources; + + /* No source images means this must itself be a source image, so it has + * a source image of itself. + */ +- total = VIPS_MAX( 1, total ); ++ total = VIPS_MAX(1, total); + +- reorder->source = VIPS_ARRAY( NULL, total + 1, VipsImage * ); +- reorder->cumulative_margin = VIPS_ARRAY( NULL, total, int ); +- if( !reorder->source || +- !reorder->cumulative_margin ) +- return( -1 ); ++ reorder->source = VIPS_ARRAY(NULL, total + 1, VipsImage *); ++ reorder->cumulative_margin = VIPS_ARRAY(NULL, total, int); ++ if (!reorder->source || ++ !reorder->cumulative_margin) ++ return (-1); + + /* Copy source images over, removing duplicates. If we find a + * duplicate, we have a reordering opportunity, and we adjust the + * scores of the two images containing the dupe. + */ +- for( i = 0; i < reorder->n_inputs; i++ ) { +- VipsReorder *input = vips_reorder_get( reorder->input[i] ); ++ for (i = 0; i < reorder->n_inputs; i++) { ++ VipsReorder *input = vips_reorder_get(reorder->input[i]); + + int j; + +- for( j = 0; j < input->n_sources; j++ ) { ++ for (j = 0; j < input->n_sources; j++) { + int k; + + /* Search for dupe. + */ +- for( k = 0; k < reorder->n_sources; k++ ) +- if( reorder->source[k] == input->source[j] ) ++ for (k = 0; k < reorder->n_sources; k++) ++ if (reorder->source[k] == input->source[j]) + break; + +- if( k < reorder->n_sources ) { ++ if (k < reorder->n_sources) { + /* Found a dupe. Does this new use of + * input->source[j] have a larger or smaller + * margin? Adjust the score to reflect the + * change, note the new max. + */ +- reorder->score[i] += ++ reorder->score[i] += + input->cumulative_margin[j] - + reorder->cumulative_margin[k]; + + reorder->cumulative_margin[k] = VIPS_MAX( + reorder->cumulative_margin[k], +- input->cumulative_margin[j] ); +- ++ input->cumulative_margin[j]); + } + else { + /* No dupe, just add to the table. + */ +- reorder->source[reorder->n_sources] = ++ reorder->source[reorder->n_sources] = + input->source[j]; +- reorder->cumulative_margin[reorder->n_sources] = ++ reorder->cumulative_margin[reorder->n_sources] = + input->cumulative_margin[j]; + reorder->n_sources += 1; + } +@@ -291,25 +289,25 @@ vips__reorder_set_input( VipsImage *image, VipsImage **in ) + /* Sort recomp_order by score. qsort_r() is a GNU libc thing, don't use + * it. + */ +- if( reorder->n_inputs > 1 ) +- g_qsort_with_data( reorder->recomp_order, +- reorder->n_inputs, +- sizeof( int ), +- vips_reorder_compare_score, reorder ); ++ if (reorder->n_inputs > 1) ++ g_qsort_with_data(reorder->recomp_order, ++ reorder->n_inputs, ++ sizeof(int), ++ vips_reorder_compare_score, reorder); + + /* No sources ... make one, us! + */ +- if( reorder->n_inputs == 0 ) { ++ if (reorder->n_inputs == 0) { + reorder->source[0] = image; + reorder->cumulative_margin[0] = 0; + reorder->n_sources = 1; + } + + #ifdef DEBUG +- vips_reorder_print( reorder ); ++ vips_reorder_print(reorder); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + /** +@@ -322,28 +320,28 @@ vips__reorder_set_input( VipsImage *image, VipsImage **in ) + * @regions, requesting the pixels in @r. + * + * It tries to request the regions in the order which will cause least +- * recomputation. This can give a large speedup, in some cases. ++ * recomputation. This can give a large speedup, in some cases. + * + * See also: vips_region_prepare(), vips_reorder_margin_hint(). + * + * Returns: 0 on success, or -1 on error. + */ + int +-vips_reorder_prepare_many( VipsImage *image, VipsRegion **regions, VipsRect *r ) ++vips_reorder_prepare_many(VipsImage *image, VipsRegion **regions, VipsRect *r) + { +- VipsReorder *reorder = vips_reorder_get( image ); ++ VipsReorder *reorder = vips_reorder_get(image); + + int i; + +- for( i = 0; i < reorder->n_inputs; i++ ) { +- g_assert( regions[i] ); ++ for (i = 0; i < reorder->n_inputs; i++) { ++ g_assert(regions[i]); + +- if( vips_region_prepare( +- regions[reorder->recomp_order[i]], r ) ) +- return( -1 ); ++ if (vips_region_prepare( ++ regions[reorder->recomp_order[i]], r)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -354,7 +352,7 @@ vips_reorder_prepare_many( VipsImage *image, VipsRegion **regions, VipsRect *r ) + * vips_reorder_margin_hint() sets a hint that @image contains a margin, that + * is, that each vips_region_prepare() on @image will request a slightly larger + * region from it's inputs. A good value for @margin is (width * height) for +- * the window the operation uses. ++ * the window the operation uses. + * + * This information is used by vips_image_prepare_many() to attempt to reorder + * computations to minimise recomputation. +@@ -362,27 +360,27 @@ vips_reorder_prepare_many( VipsImage *image, VipsRegion **regions, VipsRect *r ) + * See also: vips_image_prepare_many(). + */ + void +-vips_reorder_margin_hint( VipsImage *image, int margin ) ++vips_reorder_margin_hint(VipsImage *image, int margin) + { +- VipsReorder *reorder = vips_reorder_get( image ); ++ VipsReorder *reorder = vips_reorder_get(image); + + int i; + +- for( i = 0; i < reorder->n_sources; i++ ) ++ for (i = 0; i < reorder->n_sources; i++) + reorder->cumulative_margin[i] += margin; + } + + void +-vips__reorder_clear( VipsImage *image ) ++vips__reorder_clear(VipsImage *image) + { +- g_object_set_qdata( G_OBJECT( image ), +- vips__image_reorder_quark, NULL ); ++ g_object_set_qdata(G_OBJECT(image), ++ vips__image_reorder_quark, NULL); + } + + void +-vips__reorder_init( void ) ++vips__reorder_init(void) + { +- if( !vips__image_reorder_quark ) +- vips__image_reorder_quark = +- g_quark_from_static_string( "vips-image-reorder" ); ++ if (!vips__image_reorder_quark) ++ vips__image_reorder_quark = ++ g_quark_from_static_string("vips-image-reorder"); + } +diff --git a/libvips/iofuncs/sbuf.c b/libvips/iofuncs/sbuf.c +index 6eea995bed..cb5b18ffb8 100644 +--- a/libvips/iofuncs/sbuf.c ++++ b/libvips/iofuncs/sbuf.c +@@ -5,28 +5,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -59,7 +59,7 @@ + * SECTION: sbuf + * @short_description: buffered read from a source + * @stability: Stable +- * @see_also: foreign ++ * @see_also: foreign + * @include: vips/vips.h + * @title: VipsSbuf + * +@@ -67,34 +67,33 @@ + * text-oriented buffered reading. You can fetch lines of text, skip + * whitespace, and so on. + * +- * It is useful for implementing things like CSV readers, for example. ++ * It is useful for implementing things like CSV readers, for example. + */ + +-G_DEFINE_TYPE( VipsSbuf, vips_sbuf, VIPS_TYPE_OBJECT ); ++G_DEFINE_TYPE(VipsSbuf, vips_sbuf, VIPS_TYPE_OBJECT); + + static void +-vips_sbuf_class_init( VipsSbufClass *class ) ++vips_sbuf_class_init(VipsSbufClass *class) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "sbuf"; +- object_class->description = _( "buffered source" ); +- +- VIPS_ARG_OBJECT( class, "input", 1, +- _( "Input" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsSbuf, source ), +- VIPS_TYPE_SOURCE ); +- ++ object_class->description = _("buffered source"); ++ ++ VIPS_ARG_OBJECT(class, "input", 1, ++ _("Input"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsSbuf, source), ++ VIPS_TYPE_SOURCE); + } + + static void +-vips_sbuf_init( VipsSbuf *sbuf ) ++vips_sbuf_init(VipsSbuf *sbuf) + { + sbuf->read_point = 0; + sbuf->chars_in_buffer = 0; +@@ -105,27 +104,27 @@ vips_sbuf_init( VipsSbuf *sbuf ) + * vips_sbuf_new_from_source: + * @source: source to operate on + * +- * Create a VipsSbuf wrapping a source. ++ * Create a VipsSbuf wrapping a source. + * + * Returns: a new #VipsSbuf + */ + VipsSbuf * +-vips_sbuf_new_from_source( VipsSource *source ) ++vips_sbuf_new_from_source(VipsSource *source) + { + VipsSbuf *sbuf; + +- g_assert( source ); ++ g_assert(source); + +- sbuf = VIPS_SBUF( g_object_new( VIPS_TYPE_SBUF, ++ sbuf = VIPS_SBUF(g_object_new(VIPS_TYPE_SBUF, + "input", source, +- NULL ) ); ++ NULL)); + +- if( vips_object_build( VIPS_OBJECT( sbuf ) ) ) { +- VIPS_UNREF( sbuf ); +- return( NULL ); ++ if (vips_object_build(VIPS_OBJECT(sbuf))) { ++ VIPS_UNREF(sbuf); ++ return (NULL); + } + +- return( sbuf ); ++ return (sbuf); + } + + /** +@@ -136,12 +135,12 @@ vips_sbuf_new_from_source( VipsSource *source ) + * before using read or seek on the underlying #VipsSource class. + */ + void +-vips_sbuf_unbuffer( VipsSbuf *sbuf ) ++vips_sbuf_unbuffer(VipsSbuf *sbuf) + { + /* We'd read ahead a little way -- seek backwards by that amount. + */ +- vips_source_seek( sbuf->source, +- sbuf->read_point - sbuf->chars_in_buffer, SEEK_CUR ); ++ vips_source_seek(sbuf->source, ++ sbuf->read_point - sbuf->chars_in_buffer, SEEK_CUR); + sbuf->read_point = 0; + sbuf->chars_in_buffer = 0; + } +@@ -149,59 +148,59 @@ vips_sbuf_unbuffer( VipsSbuf *sbuf ) + /* Returns -1 on error, 0 on EOF, otherwise bytes read. + */ + static gint64 +-vips_sbuf_refill( VipsSbuf *sbuf ) ++vips_sbuf_refill(VipsSbuf *sbuf) + { + gint64 bytes_read; + +- VIPS_DEBUG_MSG( "vips_sbuf_refill:\n" ); ++ VIPS_DEBUG_MSG("vips_sbuf_refill:\n"); + + /* We should not discard any unread bytes. + */ +- g_assert( sbuf->read_point == sbuf->chars_in_buffer ); ++ g_assert(sbuf->read_point == sbuf->chars_in_buffer); + +- bytes_read = vips_source_read( sbuf->source, +- sbuf->input_buffer, VIPS_SBUF_BUFFER_SIZE ); +- if( bytes_read == -1 ) +- return( -1 ); ++ bytes_read = vips_source_read(sbuf->source, ++ sbuf->input_buffer, VIPS_SBUF_BUFFER_SIZE); ++ if (bytes_read == -1) ++ return (-1); + + sbuf->read_point = 0; + sbuf->chars_in_buffer = bytes_read; +- +- /* Always add a null byte so we can use strchr() etc. on lines. This is ++ ++ /* Always add a null byte so we can use strchr() etc. on lines. This is + * safe because input_buffer is VIPS_SBUF_BUFFER_SIZE + 1 bytes. + */ + sbuf->input_buffer[bytes_read] = '\0'; + +- return( bytes_read ); ++ return (bytes_read); + } + + /** + * vips_sbuf_getc: + * @sbuf: source to operate on + * +- * Fetch the next character from the source. ++ * Fetch the next character from the source. + * + * If you can, use the macro VIPS_SBUF_GETC() instead for speed. + * + * Returns: the next char from @sbuf, -1 on read error or EOF. + */ + int +-vips_sbuf_getc( VipsSbuf *sbuf ) ++vips_sbuf_getc(VipsSbuf *sbuf) + { +- if( sbuf->read_point == sbuf->chars_in_buffer && +- vips_sbuf_refill( sbuf ) <= 0 ) +- return( -1 ); ++ if (sbuf->read_point == sbuf->chars_in_buffer && ++ vips_sbuf_refill(sbuf) <= 0) ++ return (-1); + +- g_assert( sbuf->read_point < sbuf->chars_in_buffer ); ++ g_assert(sbuf->read_point < sbuf->chars_in_buffer); + +- return( sbuf->input_buffer[sbuf->read_point++] ); ++ return (sbuf->input_buffer[sbuf->read_point++]); + } + +-/** ++/** + * VIPS_SBUF_GETC: + * @sbuf: source to operate on + * +- * Fetch the next character from the source. ++ * Fetch the next character from the source. + * + * Returns: the next char from @sbuf, -1 on read error or EOF. + */ +@@ -212,15 +211,15 @@ vips_sbuf_getc( VipsSbuf *sbuf ) + * + * The opposite of vips_sbuf_getc(): undo the previous getc. + * +- * unget more than one character is undefined. Unget at the start of the file ++ * unget more than one character is undefined. Unget at the start of the file + * does nothing. + * + * If you can, use the macro VIPS_SBUF_UNGETC() instead for speed. + */ + void +-vips_sbuf_ungetc( VipsSbuf *sbuf ) ++vips_sbuf_ungetc(VipsSbuf *sbuf) + { +- if( sbuf->read_point > 0 ) ++ if (sbuf->read_point > 0) + sbuf->read_point -= 1; + } + +@@ -230,7 +229,7 @@ vips_sbuf_ungetc( VipsSbuf *sbuf ) + * + * The opposite of vips_sbuf_getc(): undo the previous getc. + * +- * unget more than one character is undefined. Unget at the start of the file ++ * unget more than one character is undefined. Unget at the start of the file + * does nothing. + */ + +@@ -244,42 +243,42 @@ vips_sbuf_ungetc( VipsSbuf *sbuf ) + * Returns: 0 on success, -1 on error or EOF. + */ + int +-vips_sbuf_require( VipsSbuf *sbuf, int require ) ++vips_sbuf_require(VipsSbuf *sbuf, int require) + { +- g_assert( require < VIPS_SBUF_BUFFER_SIZE ); +- g_assert( sbuf->chars_in_buffer >= 0 ); +- g_assert( sbuf->chars_in_buffer <= VIPS_SBUF_BUFFER_SIZE ); +- g_assert( sbuf->read_point >= 0 ); +- g_assert( sbuf->read_point <= sbuf->chars_in_buffer ); ++ g_assert(require < VIPS_SBUF_BUFFER_SIZE); ++ g_assert(sbuf->chars_in_buffer >= 0); ++ g_assert(sbuf->chars_in_buffer <= VIPS_SBUF_BUFFER_SIZE); ++ g_assert(sbuf->read_point >= 0); ++ g_assert(sbuf->read_point <= sbuf->chars_in_buffer); + +- VIPS_DEBUG_MSG( "vips_sbuf_require: %d\n", require ); ++ VIPS_DEBUG_MSG("vips_sbuf_require: %d\n", require); + +- if( sbuf->read_point + require > sbuf->chars_in_buffer ) { ++ if (sbuf->read_point + require > sbuf->chars_in_buffer) { + /* Areas can overlap, so we must memmove(). + */ +- memmove( sbuf->input_buffer, ++ memmove(sbuf->input_buffer, + sbuf->input_buffer + sbuf->read_point, +- sbuf->chars_in_buffer - sbuf->read_point ); ++ sbuf->chars_in_buffer - sbuf->read_point); + sbuf->chars_in_buffer -= sbuf->read_point; + sbuf->read_point = 0; + +- while( require > sbuf->chars_in_buffer ) { +- unsigned char *to = sbuf->input_buffer + ++ while (require > sbuf->chars_in_buffer) { ++ unsigned char *to = sbuf->input_buffer + + sbuf->chars_in_buffer; +- int space_available = +- VIPS_SBUF_BUFFER_SIZE - ++ int space_available = ++ VIPS_SBUF_BUFFER_SIZE - + sbuf->chars_in_buffer; + gint64 bytes_read; + +- if( (bytes_read = vips_source_read( sbuf->source, +- to, space_available )) < 0 ) +- return( -1 ); +- if( bytes_read == 0 ) { +- vips_error( +- vips_connection_nick( VIPS_CONNECTION( +- sbuf->source ) ), +- "%s", _( "end of file" ) ); +- return( -1 ); ++ if ((bytes_read = vips_source_read(sbuf->source, ++ to, space_available)) < 0) ++ return (-1); ++ if (bytes_read == 0) { ++ vips_error( ++ vips_connection_nick(VIPS_CONNECTION( ++ sbuf->source)), ++ "%s", _("end of file")); ++ return (-1); + } + + to[bytes_read] = '\0'; +@@ -287,21 +286,21 @@ vips_sbuf_require( VipsSbuf *sbuf, int require ) + } + } + +- return( 0 ); ++ return (0); + } + +-/** ++/** + * VIPS_SBUF_REQUIRE: + * @sbuf: source to operate on + * @require: need this many characters + * +- * Make sure at least @require characters are available for ++ * Make sure at least @require characters are available for + * VIPS_SBUF_PEEK() and VIPS_SBUF_FETCH(). + * + * Returns: 0 on success, -1 on read error or EOF. + */ + +-/** ++/** + * VIPS_SBUF_PEEK: + * @sbuf: source to operate on + * +@@ -311,7 +310,7 @@ vips_sbuf_require( VipsSbuf *sbuf, int require ) + * Returns: a pointer to the next requre characters of input. + */ + +-/** ++/** + * VIPS_SBUF_FETCH: + * @sbuf: source to operate on + * +@@ -325,7 +324,7 @@ vips_sbuf_require( VipsSbuf *sbuf, int require ) + * vips_sbuf_get_line: + * @sbuf: source to operate on + * +- * Fetch the next line of text from @sbuf and return it. The end of ++ * Fetch the next line of text from @sbuf and return it. The end of + * line character (or characters, for DOS files) are removed, and the string + * is terminated with a null (`\0` character). + * +@@ -335,26 +334,26 @@ vips_sbuf_require( VipsSbuf *sbuf, int require ) + * truncated. If you need to be able to read very long lines, use the + * slower vips_sbuf_get_line_copy(). + * +- * The return value is owned by @sbuf and must not be freed. It ++ * The return value is owned by @sbuf and must not be freed. It + * is valid until the next get call to @sbuf. + * + * Returns: the next line of text, or NULL on EOF or read error. + */ + const char * +-vips_sbuf_get_line( VipsSbuf *sbuf ) ++vips_sbuf_get_line(VipsSbuf *sbuf) + { + int write_point; + int space_remaining; + int ch; + +- VIPS_DEBUG_MSG( "vips_sbuf_get_line:\n" ); ++ VIPS_DEBUG_MSG("vips_sbuf_get_line:\n"); + + write_point = 0; + space_remaining = VIPS_SBUF_BUFFER_SIZE; + +- while( (ch = VIPS_SBUF_GETC( sbuf )) != -1 && ++ while ((ch = VIPS_SBUF_GETC(sbuf)) != -1 && + ch != '\n' && +- space_remaining > 0 ) { ++ space_remaining > 0) { + sbuf->line[write_point] = ch; + write_point += 1; + space_remaining -= 1; +@@ -363,39 +362,39 @@ vips_sbuf_get_line( VipsSbuf *sbuf ) + + /* If we hit EOF immediately, return EOF. + */ +- if( ch == -1 && +- write_point == 0 ) +- return( NULL ); ++ if (ch == -1 && ++ write_point == 0) ++ return (NULL); + +- /* If the final char in the buffer is \r, this is probably a DOS file +- * and we should remove that too. ++ /* If the final char in the buffer is \r, this is probably a DOS file ++ * and we should remove that too. + * +- * There's a chance this could incorrectly remove \r in very long ++ * There's a chance this could incorrectly remove \r in very long + * lines, but ignore this. + */ +- if( write_point > 0 && +- sbuf->line[write_point - 1] == '\r' ) +- sbuf->line[write_point - 1] = '\0'; ++ if (write_point > 0 && ++ sbuf->line[write_point - 1] == '\r') ++ sbuf->line[write_point - 1] = '\0'; + /* If we filled the output line without seeing \n, keep going to the + * next \n. + */ +- if( ch != '\n' && +- space_remaining == 0 ) { +- while( (ch = VIPS_SBUF_GETC( sbuf )) != -1 && +- ch != '\n' ) ++ if (ch != '\n' && ++ space_remaining == 0) { ++ while ((ch = VIPS_SBUF_GETC(sbuf)) != -1 && ++ ch != '\n') + ; + } + +- VIPS_DEBUG_MSG( " %s\n", sbuf->line ); ++ VIPS_DEBUG_MSG(" %s\n", sbuf->line); + +- return( (const char *) sbuf->line ); ++ return ((const char *) sbuf->line); + } + + /** + * vips_sbuf_get_line_copy: + * @sbuf: source to operate on + * +- * Fetch the next line of text from @sbuf and return it. The end of ++ * Fetch the next line of text from @sbuf and return it. The end of + * line character (or characters, for DOS files) are removed, and the string + * is terminated with a null (`\0` character). + * +@@ -407,11 +406,11 @@ vips_sbuf_get_line( VipsSbuf *sbuf ) + * Returns: the next line of text, or NULL on EOF or read error. + */ + char * +-vips_sbuf_get_line_copy( VipsSbuf *sbuf ) ++vips_sbuf_get_line_copy(VipsSbuf *sbuf) + { + static const unsigned char null = '\0'; + +- VIPS_DEBUG_MSG( "vips_sbuf_get_line_copy:\n" ); ++ VIPS_DEBUG_MSG("vips_sbuf_get_line_copy:\n"); + + GByteArray *buffer; + int ch; +@@ -419,36 +418,36 @@ vips_sbuf_get_line_copy( VipsSbuf *sbuf ) + + buffer = g_byte_array_new(); + +- while( (ch = VIPS_SBUF_GETC( sbuf )) != -1 && +- ch != '\n' ) { ++ while ((ch = VIPS_SBUF_GETC(sbuf)) != -1 && ++ ch != '\n') { + unsigned char c = ch; + +- g_byte_array_append( buffer, &c, 1 ); ++ g_byte_array_append(buffer, &c, 1); + } + + /* Immediate EOF. + */ +- if( ch == -1 && +- buffer->len == 0 ) { +- VIPS_FREEF( g_byte_array_unref, buffer ); +- return( NULL ); ++ if (ch == -1 && ++ buffer->len == 0) { ++ VIPS_FREEF(g_byte_array_unref, buffer); ++ return (NULL); + } + + /* If the character before the \n was \r, this is probably a DOS file + * and we should remove the \r. + */ +- if( ch == '\n' && ++ if (ch == '\n' && + buffer->len > 0 && +- buffer->data[buffer->len - 1] == '\r' ) +- g_byte_array_set_size( buffer, buffer->len - 1 ); ++ buffer->data[buffer->len - 1] == '\r') ++ g_byte_array_set_size(buffer, buffer->len - 1); + +- g_byte_array_append( buffer, &null, 1 ); ++ g_byte_array_append(buffer, &null, 1); + +- result = (char *) g_byte_array_free( buffer, FALSE ); ++ result = (char *) g_byte_array_free(buffer, FALSE); + +- VIPS_DEBUG_MSG( " %s\n", result ); ++ VIPS_DEBUG_MSG(" %s\n", result); + +- return( result ); ++ return (result); + } + + /** +@@ -456,49 +455,50 @@ vips_sbuf_get_line_copy( VipsSbuf *sbuf ) + * @sbuf: source to operate on + * + * Fetch the next chunk of non-whitespace text from the source, and +- * null-terminate it. ++ * null-terminate it. + * + * After this, the next getc will be the first char of the next block of +- * whitespace (or EOF). ++ * whitespace (or EOF). + * + * If the first getc is whitespace, stop instantly and return the empty + * string. + * + * If the item is longer than some arbitrary (but large) limit, it is +- * truncated. ++ * truncated. + * +- * The return value is owned by @sbuf and must not be freed. It ++ * The return value is owned by @sbuf and must not be freed. It + * is valid until the next get call to @sbuf. + * + * Returns: the next block of non-whitespace, or NULL on EOF or read error. + */ + const char * +-vips_sbuf_get_non_whitespace( VipsSbuf *sbuf ) ++vips_sbuf_get_non_whitespace(VipsSbuf *sbuf) + { + int ch; + int i; + +- for( i = 0; i < VIPS_SBUF_BUFFER_SIZE && +- !isspace( ch = VIPS_SBUF_GETC( sbuf ) ) && +- ch != EOF; i++ ) ++ for (i = 0; i < VIPS_SBUF_BUFFER_SIZE && ++ !isspace(ch = VIPS_SBUF_GETC(sbuf)) && ++ ch != EOF; ++ i++) + sbuf->line[i] = ch; + sbuf->line[i] = '\0'; + + /* If we stopped before seeing any whitespace, skip to the end of the + * block of non-whitespace. + */ +- if( !isspace( ch ) ) +- while( !isspace( ch = VIPS_SBUF_GETC( sbuf ) ) && +- ch != EOF ) ++ if (!isspace(ch)) ++ while (!isspace(ch = VIPS_SBUF_GETC(sbuf)) && ++ ch != EOF) + ; + + /* If we finally stopped on whitespace, step back one so the next get + * will be whitespace (or EOF). + */ +- if( isspace( ch ) ) +- VIPS_SBUF_UNGETC( sbuf ); ++ if (isspace(ch)) ++ VIPS_SBUF_UNGETC(sbuf); + +- return( (const char *) sbuf->line ); ++ return ((const char *) sbuf->line); + } + + /** +@@ -512,26 +512,26 @@ vips_sbuf_get_non_whitespace( VipsSbuf *sbuf ) + * + * Returns: 0 on success, or -1 on EOF. + */ +-int +-vips_sbuf_skip_whitespace( VipsSbuf *sbuf ) ++int ++vips_sbuf_skip_whitespace(VipsSbuf *sbuf) + { + int ch; + + do { +- ch = VIPS_SBUF_GETC( sbuf ); ++ ch = VIPS_SBUF_GETC(sbuf); + + /* # skip comments too. + */ +- if( ch == '#' ) { +- /* Probably EOF. ++ if (ch == '#') { ++ /* Probably EOF. + */ +- if( !vips_sbuf_get_line( sbuf ) ) +- return( -1 ); +- ch = VIPS_SBUF_GETC( sbuf ); ++ if (!vips_sbuf_get_line(sbuf)) ++ return (-1); ++ ch = VIPS_SBUF_GETC(sbuf); + } +- } while( isspace( ch ) ); ++ } while (isspace(ch)); + +- VIPS_SBUF_UNGETC( sbuf ); ++ VIPS_SBUF_UNGETC(sbuf); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/iofuncs/semaphore.c b/libvips/iofuncs/semaphore.c +index d627a420e5..076784cece 100644 +--- a/libvips/iofuncs/semaphore.c ++++ b/libvips/iofuncs/semaphore.c +@@ -1,5 +1,5 @@ + /* Support for thread stuff. +- * ++ * + * JC & KM 9/5/94 + * Modified: + * 28/11/94 JC +@@ -12,32 +12,32 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +-/* ++/* + #define DEBUG_IO + */ + +@@ -55,7 +55,7 @@ + #include + + void +-vips_semaphore_init( VipsSemaphore *s, int v, char *name ) ++vips_semaphore_init(VipsSemaphore *s, int v, char *name) + { + s->v = v; + s->name = name; +@@ -64,83 +64,83 @@ vips_semaphore_init( VipsSemaphore *s, int v, char *name ) + } + + void +-vips_semaphore_destroy( VipsSemaphore *s ) ++vips_semaphore_destroy(VipsSemaphore *s) + { +- VIPS_FREEF( vips_g_mutex_free, s->mutex ); +- VIPS_FREEF( vips_g_cond_free, s->cond ); ++ VIPS_FREEF(vips_g_mutex_free, s->mutex); ++ VIPS_FREEF(vips_g_cond_free, s->cond); + } + +-/* Add n to the semaphore and signal any threads that are blocked waiting ++/* Add n to the semaphore and signal any threads that are blocked waiting + * a change. + */ + int +-vips_semaphore_upn( VipsSemaphore *s, int n ) ++vips_semaphore_upn(VipsSemaphore *s, int n) + { + int value_after_op; + +- g_mutex_lock( s->mutex ); ++ g_mutex_lock(s->mutex); + s->v += n; + value_after_op = s->v; + + /* If we are only incrementing by one, we only need to wake a single + * thread. If we are incrementing by a lot, we must wake all threads. + */ +- if( n == 1 ) +- g_cond_signal( s->cond ); ++ if (n == 1) ++ g_cond_signal(s->cond); + else +- g_cond_broadcast( s->cond ); +- g_mutex_unlock( s->mutex ); ++ g_cond_broadcast(s->cond); ++ g_mutex_unlock(s->mutex); + + #ifdef DEBUG_IO +- printf( "vips_semaphore_upn(\"%s\",%d) = %d\n", +- s->name, n, value_after_op ); +- if( value_after_op > 1 ) +- vips_error( "vips_semaphore_upn", "up over 1!" ); ++ printf("vips_semaphore_upn(\"%s\",%d) = %d\n", ++ s->name, n, value_after_op); ++ if (value_after_op > 1) ++ vips_error("vips_semaphore_upn", "up over 1!"); + #endif /*DEBUG_IO*/ + +- return( value_after_op ); ++ return (value_after_op); + } + + /* Increment the semaphore. + */ + int +-vips_semaphore_up( VipsSemaphore *s ) ++vips_semaphore_up(VipsSemaphore *s) + { +- return( vips_semaphore_upn( s, 1 ) ); ++ return (vips_semaphore_upn(s, 1)); + } + + /* Wait for sem>n, then subtract n. + */ + int +-vips_semaphore_downn( VipsSemaphore *s, int n ) ++vips_semaphore_downn(VipsSemaphore *s, int n) + { + int value_after_op; + +- VIPS_GATE_START( "vips_semaphore_downn: wait" ); ++ VIPS_GATE_START("vips_semaphore_downn: wait"); + +- g_mutex_lock( s->mutex ); ++ g_mutex_lock(s->mutex); + +- while( s->v < n ) +- g_cond_wait( s->cond, s->mutex ); ++ while (s->v < n) ++ g_cond_wait(s->cond, s->mutex); + s->v -= n; + value_after_op = s->v; + +- g_mutex_unlock( s->mutex ); ++ g_mutex_unlock(s->mutex); + + #ifdef DEBUG_IO +- printf( "vips_semaphore_downn(\"%s\",%d): %d\n", +- s->name, n, value_after_op ); ++ printf("vips_semaphore_downn(\"%s\",%d): %d\n", ++ s->name, n, value_after_op); + #endif /*DEBUG_IO*/ + +- VIPS_GATE_STOP( "vips_semaphore_downn: wait" ); ++ VIPS_GATE_STOP("vips_semaphore_downn: wait"); + +- return( value_after_op ); ++ return (value_after_op); + } + + /* Wait for sem > 0, then decrement. + */ + int +-vips_semaphore_down( VipsSemaphore *s ) ++vips_semaphore_down(VipsSemaphore *s) + { +- return( vips_semaphore_downn( s, 1 ) ); ++ return (vips_semaphore_downn(s, 1)); + } +diff --git a/libvips/iofuncs/sink.c b/libvips/iofuncs/sink.c +index dcd2f5a55f..ba4a121be7 100644 +--- a/libvips/iofuncs/sink.c ++++ b/libvips/iofuncs/sink.c +@@ -1,33 +1,33 @@ + /* A sink that's not attached to anything, eg. find image average, +- * ++ * + * 28/3/10 + * - from im_iterate(), reworked for threadpool + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -50,17 +50,17 @@ + + #include "sink.h" + +-/* A part of the image we are scanning. ++/* A part of the image we are scanning. + * + * We can't let any threads fall too far behind as that would mess up seq + * image sources. Keep track of two areas moving down the image, and stall if +- * the previous area still has active threads. ++ * the previous area still has active threads. + */ + typedef struct _SinkArea { + struct _Sink *sink; + +- VipsRect rect; /* Part of image this area covers */ +- VipsSemaphore n_thread; /* Number of threads scanning this area */ ++ VipsRect rect; /* Part of image this area covers */ ++ VipsSemaphore n_thread; /* Number of threads scanning this area */ + } SinkArea; + + /* Per-call state. +@@ -82,7 +82,7 @@ typedef struct _Sink { + void *b; + + /* We are current scanning area, we'll delay starting a new +- * area if old_area (the previous position) hasn't completed. ++ * area if old_area (the previous position) hasn't completed. + */ + SinkArea *area; + SinkArea *old_area; +@@ -96,16 +96,16 @@ typedef struct _SinkThreadState { + + /* Sequence value for this thread. + */ +- void *seq; ++ void *seq; + + /* The region we walk over sink.t copy. We can't use + * parent_object.reg, it's defined on the outer image. + */ + VipsRegion *reg; + +- /* The area we were allocated from. ++ /* The area we were allocated from. + */ +- SinkArea *area; ++ SinkArea *area; + + } SinkThreadState; + +@@ -114,32 +114,32 @@ typedef struct _SinkThreadStateClass { + + } SinkThreadStateClass; + +-G_DEFINE_TYPE( SinkThreadState, sink_thread_state, VIPS_TYPE_THREAD_STATE ); ++G_DEFINE_TYPE(SinkThreadState, sink_thread_state, VIPS_TYPE_THREAD_STATE); + + static void +-sink_area_free( SinkArea *area ) ++sink_area_free(SinkArea *area) + { +- vips_semaphore_destroy( &area->n_thread ); +- g_free( area ); ++ vips_semaphore_destroy(&area->n_thread); ++ g_free(area); + } + + static SinkArea * +-sink_area_new( Sink *sink ) ++sink_area_new(Sink *sink) + { + SinkArea *area; + +- if( !(area = VIPS_NEW( NULL, SinkArea )) ) +- return( NULL ); ++ if (!(area = VIPS_NEW(NULL, SinkArea))) ++ return (NULL); + area->sink = sink; +- vips_semaphore_init( &area->n_thread, 0, "n_thread" ); ++ vips_semaphore_init(&area->n_thread, 0, "n_thread"); + +- return( area ); ++ return (area); + } + + /* Move an area to a position. + */ +-static void +-sink_area_position( SinkArea *area, int top, int height ) ++static void ++sink_area_position(SinkArea *area, int top, int height) + { + Sink *sink = area->sink; + +@@ -155,17 +155,17 @@ sink_area_position( SinkArea *area, int top, int height ) + rect.width = sink->sink_base.im->Xsize; + rect.height = height; + +- vips_rect_intersectrect( &all, &rect, &area->rect ); ++ vips_rect_intersectrect(&all, &rect, &area->rect); + } + + /* Our VipsThreadpoolAllocate function ... move the thread to the next tile + * that needs doing. If we fill the current area, we block until the previous +- * area is finished, then swap areas. ++ * area is finished, then swap areas. + * + * If all tiles are done, we return FALSE to end iteration. + */ + static gboolean +-sink_area_allocate_fn( VipsThreadState *state, void *a, gboolean *stop ) ++sink_area_allocate_fn(VipsThreadState *state, void *a, gboolean *stop) + { + SinkThreadState *sstate = (SinkThreadState *) state; + Sink *sink = (Sink *) a; +@@ -174,38 +174,38 @@ sink_area_allocate_fn( VipsThreadState *state, void *a, gboolean *stop ) + VipsRect image; + VipsRect tile; + +- VIPS_DEBUG_MSG( "sink_area_allocate_fn: %p\n", g_thread_self() ); ++ VIPS_DEBUG_MSG("sink_area_allocate_fn: %p\n", g_thread_self()); + +- /* Is the state x/y OK? New line or maybe new buffer or maybe even ++ /* Is the state x/y OK? New line or maybe new buffer or maybe even + * all done. + */ +- if( sink_base->x >= sink->area->rect.width ) { ++ if (sink_base->x >= sink->area->rect.width) { + sink_base->x = 0; + sink_base->y += sink_base->tile_height; + +- if( sink_base->y >= VIPS_RECT_BOTTOM( &sink->area->rect ) ) { ++ if (sink_base->y >= VIPS_RECT_BOTTOM(&sink->area->rect)) { + /* Block until the previous area is done. + */ +- if( sink->area->rect.top > 0 ) +- vips_semaphore_downn( +- &sink->old_area->n_thread, 0 ); ++ if (sink->area->rect.top > 0) ++ vips_semaphore_downn( ++ &sink->old_area->n_thread, 0); + + /* End of image? + */ +- if( sink_base->y >= sink_base->im->Ysize ) { ++ if (sink_base->y >= sink_base->im->Ysize) { + *stop = TRUE; +- return( 0 ); ++ return (0); + } + + /* Swap buffers. + */ +- VIPS_SWAP( SinkArea *, +- sink->area, sink->old_area ); ++ VIPS_SWAP(SinkArea *, ++ sink->area, sink->old_area); + + /* Position buf at the new y. + */ +- sink_area_position( sink->area, +- sink_base->y, sink_base->n_lines ); ++ sink_area_position(sink->area, ++ sink_base->y, sink_base->n_lines); + } + } + +@@ -219,18 +219,18 @@ sink_area_allocate_fn( VipsThreadState *state, void *a, gboolean *stop ) + tile.top = sink_base->y; + tile.width = sink_base->tile_width; + tile.height = sink_base->tile_height; +- vips_rect_intersectrect( &image, &tile, &state->pos ); ++ vips_rect_intersectrect(&image, &tile, &state->pos); + + /* The thread needs to know which area it's writing to. + */ + sstate->area = sink->area; + +- VIPS_DEBUG_MSG( " %p allocated %d x %d:\n", +- g_thread_self(), state->pos.left, state->pos.top ); ++ VIPS_DEBUG_MSG(" %p allocated %d x %d:\n", ++ g_thread_self(), state->pos.left, state->pos.top); + + /* Add to the number of writers on the area. + */ +- vips_semaphore_upn( &sink->area->n_thread, -1 ); ++ vips_semaphore_upn(&sink->area->n_thread, -1); + + /* Move state on. + */ +@@ -240,149 +240,150 @@ sink_area_allocate_fn( VipsThreadState *state, void *a, gboolean *stop ) + */ + sink_base->processed += state->pos.width * state->pos.height; + +- return( 0 ); ++ return (0); + } + +-/* Call a thread's stop function. ++/* Call a thread's stop function. + */ + static int +-sink_call_stop( Sink *sink, SinkThreadState *state ) ++sink_call_stop(Sink *sink, SinkThreadState *state) + { +- if( state->seq && sink->stop_fn ) { ++ if (state->seq && sink->stop_fn) { + int result; + +- VIPS_DEBUG_MSG( "sink_call_stop: state = %p\n", state ); ++ VIPS_DEBUG_MSG("sink_call_stop: state = %p\n", state); + +- result = sink->stop_fn( state->seq, sink->a, sink->b ); ++ result = sink->stop_fn(state->seq, sink->a, sink->b); + +- if( result ) { ++ if (result) { + SinkBase *sink_base = (SinkBase *) sink; + +- vips_error( "vips_sink", +- _( "stop function failed for image \"%s\"" ), +- sink_base->im->filename ); +- return( -1 ); ++ vips_error("vips_sink", ++ _("stop function failed for image \"%s\""), ++ sink_base->im->filename); ++ return (-1); + } + + state->seq = NULL; + } + +- return( 0 ); ++ return (0); + } + + static void +-sink_thread_state_dispose( GObject *gobject ) ++sink_thread_state_dispose(GObject *gobject) + { + SinkThreadState *state = (SinkThreadState *) gobject; + Sink *sink = (Sink *) ((VipsThreadState *) state)->a; + +- sink_call_stop( sink, state ); +- VIPS_UNREF( state->reg ); ++ sink_call_stop(sink, state); ++ VIPS_UNREF(state->reg); + +- G_OBJECT_CLASS( sink_thread_state_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(sink_thread_state_parent_class)->dispose(gobject); + } + + /* Call the start function for this thread, if necessary. + */ + static int +-sink_call_start( Sink *sink, SinkThreadState *state ) ++sink_call_start(Sink *sink, SinkThreadState *state) + { +- if( !state->seq && sink->start_fn ) { +- VIPS_DEBUG_MSG( "sink_call_start: state = %p\n", state ); ++ if (!state->seq && sink->start_fn) { ++ VIPS_DEBUG_MSG("sink_call_start: state = %p\n", state); + +- state->seq = sink->start_fn( sink->t, sink->a, sink->b ); ++ state->seq = sink->start_fn(sink->t, sink->a, sink->b); + +- if( !state->seq ) { ++ if (!state->seq) { + SinkBase *sink_base = (SinkBase *) sink; + +- vips_error( "vips_sink", +- _( "start function failed for image \"%s\"" ), +- sink_base->im->filename ); +- return( -1 ); ++ vips_error("vips_sink", ++ _("start function failed for image \"%s\""), ++ sink_base->im->filename); ++ return (-1); + } + } + +- return( 0 ); ++ return (0); + } + + static int +-sink_thread_state_build( VipsObject *object ) ++sink_thread_state_build(VipsObject *object) + { + SinkThreadState *state = (SinkThreadState *) object; + Sink *sink = (Sink *) ((VipsThreadState *) state)->a; + +- if( !(state->reg = vips_region_new( sink->t )) || +- sink_call_start( sink, state ) ) +- return( -1 ); ++ if (!(state->reg = vips_region_new(sink->t)) || ++ sink_call_start(sink, state)) ++ return (-1); + +- return( VIPS_OBJECT_CLASS( +- sink_thread_state_parent_class )->build( object ) ); ++ return (VIPS_OBJECT_CLASS( ++ sink_thread_state_parent_class) ++ ->build(object)); + } + + static void +-sink_thread_state_class_init( SinkThreadStateClass *class ) ++sink_thread_state_class_init(SinkThreadStateClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); + + gobject_class->dispose = sink_thread_state_dispose; + + object_class->build = sink_thread_state_build; + object_class->nickname = "sinkthreadstate"; +- object_class->description = _( "per-thread state for sink" ); ++ object_class->description = _("per-thread state for sink"); + } + + static void +-sink_thread_state_init( SinkThreadState *state ) ++sink_thread_state_init(SinkThreadState *state) + { + state->seq = NULL; + state->reg = NULL; + } + + VipsThreadState * +-vips_sink_thread_state_new( VipsImage *im, void *a ) ++vips_sink_thread_state_new(VipsImage *im, void *a) + { +- return( VIPS_THREAD_STATE( vips_object_new( +- sink_thread_state_get_type(), +- vips_thread_state_set, im, a ) ) ); ++ return (VIPS_THREAD_STATE(vips_object_new( ++ sink_thread_state_get_type(), ++ vips_thread_state_set, im, a))); + } + + static void +-sink_free( Sink *sink ) ++sink_free(Sink *sink) + { +- VIPS_FREEF( sink_area_free, sink->area ); +- VIPS_FREEF( sink_area_free, sink->old_area ); +- VIPS_FREEF( g_object_unref, sink->t ); ++ VIPS_FREEF(sink_area_free, sink->area); ++ VIPS_FREEF(sink_area_free, sink->old_area); ++ VIPS_FREEF(g_object_unref, sink->t); + } + + void +-vips_sink_base_init( SinkBase *sink_base, VipsImage *image ) ++vips_sink_base_init(SinkBase *sink_base, VipsImage *image) + { +- /* Always clear kill before we start looping. See the ++ /* Always clear kill before we start looping. See the + * call to vips_image_iskilled() below. + */ +- vips_image_set_kill( image, FALSE ); ++ vips_image_set_kill(image, FALSE); + + sink_base->im = image; + sink_base->x = 0; + sink_base->y = 0; + +- vips_get_tile_size( image, +- &sink_base->tile_width, &sink_base->tile_height, +- &sink_base->n_lines ); ++ vips_get_tile_size(image, ++ &sink_base->tile_width, &sink_base->tile_height, ++ &sink_base->n_lines); + + sink_base->processed = 0; + } + + static int +-sink_init( Sink *sink, +- VipsImage *image, ++sink_init(Sink *sink, ++ VipsImage *image, + VipsStartFn start_fn, VipsGenerateFn generate_fn, VipsStopFn stop_fn, +- void *a, void *b ) ++ void *a, void *b) + { +- g_assert( generate_fn ); ++ g_assert(generate_fn); + +- vips_sink_base_init( &sink->sink_base, image ); ++ vips_sink_base_init(&sink->sink_base, image); + + sink->t = NULL; + sink->start_fn = start_fn; +@@ -394,19 +395,19 @@ sink_init( Sink *sink, + sink->area = NULL; + sink->old_area = NULL; + +- if( !(sink->t = vips_image_new()) || +- !(sink->area = sink_area_new( sink )) || +- !(sink->old_area = sink_area_new( sink )) || +- vips_image_write( sink->sink_base.im, sink->t ) ) { +- sink_free( sink ); +- return( -1 ); ++ if (!(sink->t = vips_image_new()) || ++ !(sink->area = sink_area_new(sink)) || ++ !(sink->old_area = sink_area_new(sink)) || ++ vips_image_write(sink->sink_base.im, sink->t)) { ++ sink_free(sink); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + +-static int +-sink_work( VipsThreadState *state, void *a ) ++static int ++sink_work(VipsThreadState *state, void *a) + { + SinkThreadState *sstate = (SinkThreadState *) state; + Sink *sink = (Sink *) a; +@@ -414,33 +415,33 @@ sink_work( VipsThreadState *state, void *a ) + + int result; + +- result = vips_region_prepare( sstate->reg, &state->pos ); +- if( !result ) +- result = sink->generate_fn( sstate->reg, sstate->seq, +- sink->a, sink->b, &state->stop ); ++ result = vips_region_prepare(sstate->reg, &state->pos); ++ if (!result) ++ result = sink->generate_fn(sstate->reg, sstate->seq, ++ sink->a, sink->b, &state->stop); + + /* Tell the allocator we're done. + */ +- vips_semaphore_upn( &area->n_thread, 1 ); ++ vips_semaphore_upn(&area->n_thread, 1); + +- return( result ); ++ return (result); + } + +-int +-vips_sink_base_progress( void *a ) ++int ++vips_sink_base_progress(void *a) + { + SinkBase *sink_base = (SinkBase *) a; + +- VIPS_DEBUG_MSG( "vips_sink_base_progress:\n" ); ++ VIPS_DEBUG_MSG("vips_sink_base_progress:\n"); + + /* Trigger any eval callbacks on our source image and + * check for errors. + */ +- vips_image_eval( sink_base->im, sink_base->processed ); +- if( vips_image_iskilled( sink_base->im ) ) +- return( -1 ); ++ vips_image_eval(sink_base->im, sink_base->processed); ++ if (vips_image_iskilled(sink_base->im)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /** +@@ -454,12 +455,12 @@ vips_sink_base_progress( void *a ) + * @a: user data + * @b: user data + * +- * Loops over an image. @generate_fn is called for every ++ * Loops over an image. @generate_fn is called for every + * pixel in the image, with + * the @reg argument being a region of calculated pixels. + * +- * Each set of pixels is @tile_width by @tile_height pixels (less at the +- * image edges). This is handy for things like writing a tiled TIFF image, ++ * Each set of pixels is @tile_width by @tile_height pixels (less at the ++ * image edges). This is handy for things like writing a tiled TIFF image, + * where tiles have to be generated with a certain size. + * + * See also: vips_sink(), vips_get_tile_size(). +@@ -467,25 +468,25 @@ vips_sink_base_progress( void *a ) + * Returns: 0 on success, or -1 on error. + */ + int +-vips_sink_tile( VipsImage *im, ++vips_sink_tile(VipsImage *im, + int tile_width, int tile_height, + VipsStartFn start_fn, VipsGenerateFn generate_fn, VipsStopFn stop_fn, +- void *a, void *b ) ++ void *a, void *b) + { + Sink sink; + int result; + +- g_assert( vips_object_sanity( VIPS_OBJECT( im ) ) ); ++ g_assert(vips_object_sanity(VIPS_OBJECT(im))); + + /* We don't use this, but make sure it's set in case any old binaries + * are expecting it. + */ +- im->Bbits = vips_format_sizeof( im->BandFmt ) << 3; +- +- if( sink_init( &sink, im, start_fn, generate_fn, stop_fn, a, b ) ) +- return( -1 ); ++ im->Bbits = vips_format_sizeof(im->BandFmt) << 3; ++ ++ if (sink_init(&sink, im, start_fn, generate_fn, stop_fn, a, b)) ++ return (-1); + +- if( tile_width > 0 ) { ++ if (tile_width > 0) { + sink.sink_base.tile_width = tile_width; + sink.sink_base.tile_height = tile_height; + } +@@ -493,23 +494,23 @@ vips_sink_tile( VipsImage *im, + /* vips_sink_base_progress() signals progress on im, so we have to do + * pre/post on that too. + */ +- vips_image_preeval( im ); ++ vips_image_preeval(im); + +- sink_area_position( sink.area, 0, sink.sink_base.n_lines ); +- result = vips_threadpool_run( im, ++ sink_area_position(sink.area, 0, sink.sink_base.n_lines); ++ result = vips_threadpool_run(im, + vips_sink_thread_state_new, +- sink_area_allocate_fn, +- sink_work, +- vips_sink_base_progress, +- &sink ); ++ sink_area_allocate_fn, ++ sink_work, ++ vips_sink_base_progress, ++ &sink); + +- vips_image_posteval( im ); ++ vips_image_posteval(im); + +- sink_free( &sink ); ++ sink_free(&sink); + +- vips_image_minimise_all( im ); ++ vips_image_minimise_all(im); + +- return( result ); ++ return (result); + } + + /** +@@ -521,7 +522,7 @@ vips_sink_tile( VipsImage *im, + * @a: user data + * @b: user data + * +- * Loops over an image. @generate_fn is called for every pixel in ++ * Loops over an image. @generate_fn is called for every pixel in + * the image, with + * the @reg argument being a region of calculated pixels. vips_sink() is + * used to implement operations like vips_avg() which have no image output. +@@ -534,10 +535,10 @@ vips_sink_tile( VipsImage *im, + * Returns: 0 on success, or -1 on error. + */ + int +-vips_sink( VipsImage *im, ++vips_sink(VipsImage *im, + VipsStartFn start_fn, VipsGenerateFn generate_fn, VipsStopFn stop_fn, +- void *a, void *b ) ++ void *a, void *b) + { +- return( vips_sink_tile( im, -1, -1, +- start_fn, generate_fn, stop_fn, a, b ) ); ++ return (vips_sink_tile(im, -1, -1, ++ start_fn, generate_fn, stop_fn, a, b)); + } +diff --git a/libvips/iofuncs/sink.h b/libvips/iofuncs/sink.h +index 19a35d54ce..be5835aa84 100644 +--- a/libvips/iofuncs/sink.h ++++ b/libvips/iofuncs/sink.h +@@ -1,33 +1,33 @@ + /* A sink that's not attached to anything, eg. find image average, +- * ++ * + * 28/3/10 + * - from im_iterate(), reworked for threadpool + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -65,10 +65,10 @@ typedef struct _SinkBase { + + /* Some function we can share. + */ +-void vips_sink_base_init( SinkBase *sink_base, VipsImage *image ); +-VipsThreadState *vips_sink_thread_state_new( VipsImage *im, void *a ); +-int vips_sink_base_allocate( VipsThreadState *state, void *a, gboolean *stop ); +-int vips_sink_base_progress( void *a ); ++void vips_sink_base_init(SinkBase *sink_base, VipsImage *image); ++VipsThreadState *vips_sink_thread_state_new(VipsImage *im, void *a); ++int vips_sink_base_allocate(VipsThreadState *state, void *a, gboolean *stop); ++int vips_sink_base_progress(void *a); + + #ifdef __cplusplus + } +diff --git a/libvips/iofuncs/sinkdisc.c b/libvips/iofuncs/sinkdisc.c +index cc443d8415..351a67c70b 100644 +--- a/libvips/iofuncs/sinkdisc.c ++++ b/libvips/iofuncs/sinkdisc.c +@@ -1,5 +1,5 @@ +-/* Write an image to a disc file. +- * ++/* Write an image to a disc file. ++ * + * 19/3/10 + * - from im_wbuffer.c + * - move on top of VipsThreadpool, instead of im_threadgroup_t +@@ -13,28 +13,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -70,15 +70,15 @@ + typedef struct _WriteBuffer { + struct _Write *write; + +- VipsRegion *region; /* Pixels */ +- VipsRect area; /* Part of image this region covers */ +- VipsSemaphore go; /* Start bg thread loop */ +- VipsSemaphore nwrite; /* Number of threads writing to region */ +- VipsSemaphore done; /* Bg thread has done write */ +- VipsSemaphore finish; /* Bg thread has finished */ +- int write_errno; /* Save write errors here */ +- gboolean running; /* Whether the bg writer thread is running */ +- gboolean kill; /* Set to ask thread to exit */ ++ VipsRegion *region; /* Pixels */ ++ VipsRect area; /* Part of image this region covers */ ++ VipsSemaphore go; /* Start bg thread loop */ ++ VipsSemaphore nwrite; /* Number of threads writing to region */ ++ VipsSemaphore done; /* Bg thread has done write */ ++ VipsSemaphore finish; /* Bg thread has finished */ ++ int write_errno; /* Save write errors here */ ++ gboolean running; /* Whether the bg writer thread is running */ ++ gboolean kill; /* Set to ask thread to exit */ + } WriteBuffer; + + /* Per-call state. +@@ -94,8 +94,8 @@ typedef struct _Write { + + /* The file format write operation. + */ +- VipsRegionWrite write_fn; +- void *a; ++ VipsRegionWrite write_fn; ++ void *a; + } Write; + + /* Our per-thread state ... we need to also track the buffer that pos is +@@ -104,7 +104,7 @@ typedef struct _Write { + typedef struct _WriteThreadState { + VipsThreadState parent_object; + +- WriteBuffer *buf; ++ WriteBuffer *buf; + } WriteThreadState; + + typedef struct _WriteThreadStateClass { +@@ -112,174 +112,174 @@ typedef struct _WriteThreadStateClass { + + } WriteThreadStateClass; + +-G_DEFINE_TYPE( WriteThreadState, write_thread_state, VIPS_TYPE_THREAD_STATE ); ++G_DEFINE_TYPE(WriteThreadState, write_thread_state, VIPS_TYPE_THREAD_STATE); + + static void +-write_thread_state_class_init( WriteThreadStateClass *class ) ++write_thread_state_class_init(WriteThreadStateClass *class) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); + + object_class->nickname = "writethreadstate"; +- object_class->description = _( "per-thread state for sinkdisc" ); ++ object_class->description = _("per-thread state for sinkdisc"); + } + + static void +-write_thread_state_init( WriteThreadState *state ) ++write_thread_state_init(WriteThreadState *state) + { + state->buf = NULL; + } + + static VipsThreadState * +-write_thread_state_new( VipsImage *im, void *a ) ++write_thread_state_new(VipsImage *im, void *a) + { +- return( VIPS_THREAD_STATE( vips_object_new( +- write_thread_state_get_type(), +- vips_thread_state_set, im, a ) ) ); ++ return (VIPS_THREAD_STATE(vips_object_new( ++ write_thread_state_get_type(), ++ vips_thread_state_set, im, a))); + } + + static void +-wbuffer_free( WriteBuffer *wbuffer ) ++wbuffer_free(WriteBuffer *wbuffer) + { +- /* Is there a thread running this region? Kill it! +- */ +- if( wbuffer->running ) { +- wbuffer->kill = TRUE; +- vips_semaphore_up( &wbuffer->go ); ++ /* Is there a thread running this region? Kill it! ++ */ ++ if (wbuffer->running) { ++ wbuffer->kill = TRUE; ++ vips_semaphore_up(&wbuffer->go); + +- vips_semaphore_down( &wbuffer->finish ); ++ vips_semaphore_down(&wbuffer->finish); + +- VIPS_DEBUG_MSG( "wbuffer_free:\n" ); ++ VIPS_DEBUG_MSG("wbuffer_free:\n"); + + wbuffer->running = FALSE; +- } +- +- VIPS_UNREF( wbuffer->region ); +- vips_semaphore_destroy( &wbuffer->go ); +- vips_semaphore_destroy( &wbuffer->nwrite ); +- vips_semaphore_destroy( &wbuffer->done ); +- vips_semaphore_destroy( &wbuffer->finish ); +- g_free( wbuffer ); ++ } ++ ++ VIPS_UNREF(wbuffer->region); ++ vips_semaphore_destroy(&wbuffer->go); ++ vips_semaphore_destroy(&wbuffer->nwrite); ++ vips_semaphore_destroy(&wbuffer->done); ++ vips_semaphore_destroy(&wbuffer->finish); ++ g_free(wbuffer); + } + + static void +-wbuffer_write( WriteBuffer *wbuffer ) ++wbuffer_write(WriteBuffer *wbuffer) + { + Write *write = wbuffer->write; + +- VIPS_DEBUG_MSG( "wbuffer_write: %d bytes from wbuffer %p\n", +- wbuffer->region->bpl * wbuffer->area.height, wbuffer ); ++ VIPS_DEBUG_MSG("wbuffer_write: %d bytes from wbuffer %p\n", ++ wbuffer->region->bpl * wbuffer->area.height, wbuffer); + +- VIPS_GATE_START( "wbuffer_write: work" ); ++ VIPS_GATE_START("wbuffer_write: work"); + +- wbuffer->write_errno = write->write_fn( wbuffer->region, +- &wbuffer->area, write->a ); ++ wbuffer->write_errno = write->write_fn(wbuffer->region, ++ &wbuffer->area, write->a); + +- VIPS_GATE_STOP( "wbuffer_write: work" ); ++ VIPS_GATE_STOP("wbuffer_write: work"); + } + + /* Run this as a thread to do a BG write. + */ + static void +-wbuffer_write_thread( void *data, void *user_data ) ++wbuffer_write_thread(void *data, void *user_data) + { + WriteBuffer *wbuffer = (WriteBuffer *) data; + +- for(;;) { ++ for (;;) { + /* Wait to be told to write. + */ +- vips_semaphore_down( &wbuffer->go ); ++ vips_semaphore_down(&wbuffer->go); + +- if( wbuffer->kill ) ++ if (wbuffer->kill) + break; + + /* Now block until the last worker finishes on this buffer. + */ +- vips_semaphore_downn( &wbuffer->nwrite, 0 ); ++ vips_semaphore_downn(&wbuffer->nwrite, 0); + +- wbuffer_write( wbuffer ); ++ wbuffer_write(wbuffer); + + /* Signal write complete. + */ +- vips_semaphore_up( &wbuffer->done ); ++ vips_semaphore_up(&wbuffer->done); + } + + /* We are exiting: tell the main thread. + */ +- vips_semaphore_up( &wbuffer->finish ); ++ vips_semaphore_up(&wbuffer->finish); + } + + static WriteBuffer * +-wbuffer_new( Write *write ) ++wbuffer_new(Write *write) + { + WriteBuffer *wbuffer; + +- if( !(wbuffer = VIPS_NEW( NULL, WriteBuffer )) ) +- return( NULL ); ++ if (!(wbuffer = VIPS_NEW(NULL, WriteBuffer))) ++ return (NULL); + wbuffer->write = write; + wbuffer->region = NULL; +- vips_semaphore_init( &wbuffer->go, 0, "go" ); +- vips_semaphore_init( &wbuffer->nwrite, 0, "nwrite" ); +- vips_semaphore_init( &wbuffer->done, 0, "done" ); +- vips_semaphore_init( &wbuffer->finish, 0, "finish" ); ++ vips_semaphore_init(&wbuffer->go, 0, "go"); ++ vips_semaphore_init(&wbuffer->nwrite, 0, "nwrite"); ++ vips_semaphore_init(&wbuffer->done, 0, "done"); ++ vips_semaphore_init(&wbuffer->finish, 0, "finish"); + wbuffer->write_errno = 0; + wbuffer->running = FALSE; + wbuffer->kill = FALSE; + +- if( !(wbuffer->region = vips_region_new( write->sink_base.im )) ) { +- wbuffer_free( wbuffer ); +- return( NULL ); ++ if (!(wbuffer->region = vips_region_new(write->sink_base.im))) { ++ wbuffer_free(wbuffer); ++ return (NULL); + } + + /* The worker threads need to be able to move the buffers around. + */ +- vips__region_no_ownership( wbuffer->region ); ++ vips__region_no_ownership(wbuffer->region); + + /* Make this last (picks up parts of wbuffer on startup). + */ +- if( vips__thread_execute( "wbuffer", wbuffer_write_thread, +- wbuffer ) ) { +- wbuffer_free( wbuffer ); +- return( NULL ); ++ if (vips__thread_execute("wbuffer", wbuffer_write_thread, ++ wbuffer)) { ++ wbuffer_free(wbuffer); ++ return (NULL); + } + + wbuffer->running = TRUE; + +- return( wbuffer ); ++ return (wbuffer); + } + + /* Block until the previous write completes, then write the front buffer. + */ + static int +-wbuffer_flush( Write *write ) ++wbuffer_flush(Write *write) + { +- VIPS_DEBUG_MSG( "wbuffer_flush:\n" ); ++ VIPS_DEBUG_MSG("wbuffer_flush:\n"); + +- /* Block until the other buffer has been written. We have to do this ++ /* Block until the other buffer has been written. We have to do this + * before we can set this buffer writing or we'll lose output ordering. + */ +- if( write->buf->area.top > 0 ) { +- vips_semaphore_down( &write->buf_back->done ); ++ if (write->buf->area.top > 0) { ++ vips_semaphore_down(&write->buf_back->done); + + /* Previous write succeeded? + */ +- if( write->buf_back->write_errno ) { +- vips_error_system( write->buf_back->write_errno, +- "wbuffer_write", "%s", _( "write failed" ) ); +- return( -1 ); ++ if (write->buf_back->write_errno) { ++ vips_error_system(write->buf_back->write_errno, ++ "wbuffer_write", "%s", _("write failed")); ++ return (-1); + } + } + + /* Set the background writer going for this buffer. + */ +- vips_semaphore_up( &write->buf->go ); ++ vips_semaphore_up(&write->buf->go); + +- return( 0 ); ++ return (0); + } + + /* Move a wbuffer to a position. + */ +-static int +-wbuffer_position( WriteBuffer *wbuffer, int top, int height ) ++static int ++wbuffer_position(WriteBuffer *wbuffer, int top, int height) + { + VipsRect image, area; + int result; +@@ -294,22 +294,22 @@ wbuffer_position( WriteBuffer *wbuffer, int top, int height ) + area.width = wbuffer->write->sink_base.im->Xsize; + area.height = height; + +- vips_rect_intersectrect( &area, &image, &wbuffer->area ); ++ vips_rect_intersectrect(&area, &image, &wbuffer->area); + + /* The workers take turns to move the buffers. + */ +- vips__region_take_ownership( wbuffer->region ); ++ vips__region_take_ownership(wbuffer->region); + +- result = vips_region_buffer( wbuffer->region, &wbuffer->area ); ++ result = vips_region_buffer(wbuffer->region, &wbuffer->area); + +- vips__region_no_ownership( wbuffer->region ); ++ vips__region_no_ownership(wbuffer->region); + + /* This should be an exclusive buffer, hopefully. + */ +- if( !result ) +- g_assert( !wbuffer->region->buffer->done ); ++ if (!result) ++ g_assert(!wbuffer->region->buffer->done); + +- return( result ); ++ return (result); + } + + /* Our VipsThreadpoolAllocate function ... move the thread to the next tile +@@ -318,58 +318,58 @@ wbuffer_position( WriteBuffer *wbuffer, int top, int height ) + * iteration. + */ + static gboolean +-wbuffer_allocate_fn( VipsThreadState *state, void *a, gboolean *stop ) ++wbuffer_allocate_fn(VipsThreadState *state, void *a, gboolean *stop) + { +- WriteThreadState *wstate = (WriteThreadState *) state; ++ WriteThreadState *wstate = (WriteThreadState *) state; + Write *write = (Write *) a; + SinkBase *sink_base = (SinkBase *) write; + + VipsRect image; + VipsRect tile; + +- VIPS_DEBUG_MSG( "wbuffer_allocate_fn:\n" ); ++ VIPS_DEBUG_MSG("wbuffer_allocate_fn:\n"); + +- /* Is the state x/y OK? New line or maybe new buffer or maybe even ++ /* Is the state x/y OK? New line or maybe new buffer or maybe even + * all done. + */ +- if( sink_base->x >= write->buf->area.width ) { ++ if (sink_base->x >= write->buf->area.width) { + sink_base->x = 0; + sink_base->y += sink_base->tile_height; + +- if( sink_base->y >= VIPS_RECT_BOTTOM( &write->buf->area ) ) { +- VIPS_DEBUG_MSG( "wbuffer_allocate_fn: " +- "finished top = %d, height = %d\n", +- write->buf->area.top, write->buf->area.height ); ++ if (sink_base->y >= VIPS_RECT_BOTTOM(&write->buf->area)) { ++ VIPS_DEBUG_MSG("wbuffer_allocate_fn: " ++ "finished top = %d, height = %d\n", ++ write->buf->area.top, write->buf->area.height); + +- /* Block until the write of the previous buffer ++ /* Block until the write of the previous buffer + * is done, then set write of this buffer going. + */ +- if( wbuffer_flush( write ) ) { ++ if (wbuffer_flush(write)) { + *stop = TRUE; +- return( -1 ); ++ return (-1); + } + + /* End of image? + */ +- if( sink_base->y >= sink_base->im->Ysize ) { ++ if (sink_base->y >= sink_base->im->Ysize) { + *stop = TRUE; +- return( 0 ); ++ return (0); + } + +- VIPS_DEBUG_MSG( "wbuffer_allocate_fn: " +- "starting top = %d, height = %d\n", +- sink_base->y, sink_base->n_lines ); ++ VIPS_DEBUG_MSG("wbuffer_allocate_fn: " ++ "starting top = %d, height = %d\n", ++ sink_base->y, sink_base->n_lines); + + /* Swap buffers. + */ +- VIPS_SWAP( WriteBuffer *, write->buf, write->buf_back ); ++ VIPS_SWAP(WriteBuffer *, write->buf, write->buf_back); + + /* Position buf at the new y. + */ +- if( wbuffer_position( write->buf, +- sink_base->y, sink_base->n_lines ) ) { ++ if (wbuffer_position(write->buf, ++ sink_base->y, sink_base->n_lines)) { + *stop = TRUE; +- return( -1 ); ++ return (-1); + } + + /* This will be the first tile of a new buffer ... +@@ -389,20 +389,20 @@ wbuffer_allocate_fn( VipsThreadState *state, void *a, gboolean *stop ) + tile.top = sink_base->y; + tile.width = sink_base->tile_width; + tile.height = sink_base->tile_height; +- vips_rect_intersectrect( &image, &tile, &state->pos ); ++ vips_rect_intersectrect(&image, &tile, &state->pos); + + /* The thread needs to know which buffer it's writing to. + */ + wstate->buf = write->buf; + +- VIPS_DEBUG_MSG( " thread %p allocated " +- "left = %d, top = %d, width = %d, height = %d\n", +- g_thread_self(), +- tile.left, tile.top, tile.width, tile.height ); ++ VIPS_DEBUG_MSG(" thread %p allocated " ++ "left = %d, top = %d, width = %d, height = %d\n", ++ g_thread_self(), ++ tile.left, tile.top, tile.width, tile.height); + + /* Add to the number of writers on the buffer. + */ +- vips_semaphore_upn( &write->buf->nwrite, -1 ); ++ vips_semaphore_upn(&write->buf->nwrite, -1); + + /* Move state on. + */ +@@ -412,52 +412,52 @@ wbuffer_allocate_fn( VipsThreadState *state, void *a, gboolean *stop ) + */ + sink_base->processed += state->pos.width * state->pos.height; + +- return( 0 ); ++ return (0); + } + + /* Our VipsThreadpoolWork function ... generate a tile! + */ + static int +-wbuffer_work_fn( VipsThreadState *state, void *a ) ++wbuffer_work_fn(VipsThreadState *state, void *a) + { + WriteThreadState *wstate = (WriteThreadState *) state; + + int result; + +- VIPS_DEBUG_MSG( "wbuffer_work_fn: thread %p, %d x %d\n", +- g_thread_self(), +- state->pos.left, state->pos.top ); ++ VIPS_DEBUG_MSG("wbuffer_work_fn: thread %p, %d x %d\n", ++ g_thread_self(), ++ state->pos.left, state->pos.top); + +- result = vips_region_prepare_to( state->reg, wstate->buf->region, +- &state->pos, state->pos.left, state->pos.top ); ++ result = vips_region_prepare_to(state->reg, wstate->buf->region, ++ &state->pos, state->pos.left, state->pos.top); + +- VIPS_DEBUG_MSG( "wbuffer_work_fn: thread %p result = %d\n", +- g_thread_self(), result ); ++ VIPS_DEBUG_MSG("wbuffer_work_fn: thread %p result = %d\n", ++ g_thread_self(), result); + + /* Tell the bg write thread we've left. + */ +- vips_semaphore_upn( &wstate->buf->nwrite, 1 ); ++ vips_semaphore_upn(&wstate->buf->nwrite, 1); + +- return( result ); ++ return (result); + } + + static void +-write_init( Write *write, +- VipsImage *image, VipsRegionWrite write_fn, void *a ) ++write_init(Write *write, ++ VipsImage *image, VipsRegionWrite write_fn, void *a) + { +- vips_sink_base_init( &write->sink_base, image ); ++ vips_sink_base_init(&write->sink_base, image); + +- write->buf = wbuffer_new( write ); +- write->buf_back = wbuffer_new( write ); ++ write->buf = wbuffer_new(write); ++ write->buf_back = wbuffer_new(write); + write->write_fn = write_fn; + write->a = a; + } + + static void +-write_free( Write *write ) ++write_free(Write *write) + { +- VIPS_FREEF( wbuffer_free, write->buf ); +- VIPS_FREEF( wbuffer_free, write->buf_back ); ++ VIPS_FREEF(wbuffer_free, write->buf); ++ VIPS_FREEF(wbuffer_free, write->buf_back); + } + + /** +@@ -466,7 +466,7 @@ write_free( Write *write ) + * @area: area to write + * @a: client data + * +- * The function should write the pixels in @area from @region. @a is the ++ * The function should write the pixels in @area from @region. @a is the + * value passed into vips_sink_disc(). + * + * See also: vips_sink_disc(). +@@ -487,55 +487,55 @@ write_free( Write *write ) + * thread), it's always given image + * sections in top-to-bottom order, and there are never any gaps. + * +- * This operation is handy for making image sinks which output to things like ++ * This operation is handy for making image sinks which output to things like + * disc files. Things like vips_jpegsave(), for example, use this to write +- * images to files in JPEG format. ++ * images to files in JPEG format. + * + * See also: vips_concurrency_set(). + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_sink_disc( VipsImage *im, VipsRegionWrite write_fn, void *a ) ++vips_sink_disc(VipsImage *im, VipsRegionWrite write_fn, void *a) + { + Write write; + int result; + +- vips_image_preeval( im ); ++ vips_image_preeval(im); + +- write_init( &write, im, write_fn, a ); ++ write_init(&write, im, write_fn, a); + + result = 0; +- if( !write.buf || +- !write.buf_back || +- wbuffer_position( write.buf, 0, write.sink_base.n_lines ) || +- vips_threadpool_run( im, +- write_thread_state_new, +- wbuffer_allocate_fn, +- wbuffer_work_fn, +- vips_sink_base_progress, +- &write ) ) ++ if (!write.buf || ++ !write.buf_back || ++ wbuffer_position(write.buf, 0, write.sink_base.n_lines) || ++ vips_threadpool_run(im, ++ write_thread_state_new, ++ wbuffer_allocate_fn, ++ wbuffer_work_fn, ++ vips_sink_base_progress, ++ &write)) + result = -1; + + /* Just before allocate signalled stop, it set write.buf writing. We +- * need to wait for this write to finish. ++ * need to wait for this write to finish. + * +- * We can't just free the buffers (which will wait for the bg threads +- * to finish), since the bg thread might see the kill before it gets a ++ * We can't just free the buffers (which will wait for the bg threads ++ * to finish), since the bg thread might see the kill before it gets a + * chance to write. + * + * If the pool exited with an error, write.buf might not have been + * started (if the allocate failed), and in any case, we don't care if + * the final write went through or not. + */ +- if( !result ) +- vips_semaphore_down( &write.buf->done ); ++ if (!result) ++ vips_semaphore_down(&write.buf->done); + +- vips_image_posteval( im ); ++ vips_image_posteval(im); + +- write_free( &write ); ++ write_free(&write); + +- vips_image_minimise_all( im ); ++ vips_image_minimise_all(im); + +- return( result ); ++ return (result); + } +diff --git a/libvips/iofuncs/sinkmemory.c b/libvips/iofuncs/sinkmemory.c +index fe5f729feb..797285e6ab 100644 +--- a/libvips/iofuncs/sinkmemory.c ++++ b/libvips/iofuncs/sinkmemory.c +@@ -3,7 +3,7 @@ + * For sequential operations we need to keep requests reasonably ordered: we + * can't let some tiles get very delayed. So we need to stall starting new + * threads if the last thread gets too far behind. +- * ++ * + * 17/2/12 + * - from sinkdisc.c + * 23/2/12 +@@ -12,28 +12,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -57,13 +57,13 @@ + + #include "sink.h" + +-/* A part of the image we are writing. ++/* A part of the image we are writing. + */ + typedef struct _SinkMemoryArea { + struct _SinkMemory *memory; + +- VipsRect rect; /* Part of image this area covers */ +- VipsSemaphore nwrite; /* Number of threads writing to this area */ ++ VipsRect rect; /* Part of image this area covers */ ++ VipsSemaphore nwrite; /* Number of threads writing to this area */ + } SinkMemoryArea; + + /* Per-call state. +@@ -72,7 +72,7 @@ typedef struct _SinkMemory { + SinkBase sink_base; + + /* We are current writing tiles to area, we'll delay starting a new +- * area if old_area (the previous position) hasn't completed. ++ * area if old_area (the previous position) hasn't completed. + */ + SinkMemoryArea *area; + SinkMemoryArea *old_area; +@@ -89,7 +89,7 @@ typedef struct _SinkMemory { + typedef struct _SinkMemoryThreadState { + VipsThreadState parent_object; + +- SinkMemoryArea *area; ++ SinkMemoryArea *area; + } SinkMemoryThreadState; + + typedef struct _SinkMemoryThreadStateClass { +@@ -97,55 +97,55 @@ typedef struct _SinkMemoryThreadStateClass { + + } SinkMemoryThreadStateClass; + +-G_DEFINE_TYPE( SinkMemoryThreadState, +- sink_memory_thread_state, VIPS_TYPE_THREAD_STATE ); ++G_DEFINE_TYPE(SinkMemoryThreadState, ++ sink_memory_thread_state, VIPS_TYPE_THREAD_STATE); + + static void +-sink_memory_thread_state_class_init( SinkMemoryThreadStateClass *class ) ++sink_memory_thread_state_class_init(SinkMemoryThreadStateClass *class) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); + + object_class->nickname = "sinkmemorythreadstate"; +- object_class->description = _( "per-thread state for sinkmemory" ); ++ object_class->description = _("per-thread state for sinkmemory"); + } + + static void +-sink_memory_thread_state_init( SinkMemoryThreadState *state ) ++sink_memory_thread_state_init(SinkMemoryThreadState *state) + { + } + + static VipsThreadState * +-sink_memory_thread_state_new( VipsImage *image, void *a ) ++sink_memory_thread_state_new(VipsImage *image, void *a) + { +- return( VIPS_THREAD_STATE( vips_object_new( +- sink_memory_thread_state_get_type(), +- vips_thread_state_set, image, a ) ) ); ++ return (VIPS_THREAD_STATE(vips_object_new( ++ sink_memory_thread_state_get_type(), ++ vips_thread_state_set, image, a))); + } + + static void +-sink_memory_area_free( SinkMemoryArea *area ) ++sink_memory_area_free(SinkMemoryArea *area) + { +- vips_semaphore_destroy( &area->nwrite ); +- g_free( area ); ++ vips_semaphore_destroy(&area->nwrite); ++ g_free(area); + } + + static SinkMemoryArea * +-sink_memory_area_new( SinkMemory *memory ) ++sink_memory_area_new(SinkMemory *memory) + { + SinkMemoryArea *area; + +- if( !(area = VIPS_NEW( NULL, SinkMemoryArea )) ) +- return( NULL ); ++ if (!(area = VIPS_NEW(NULL, SinkMemoryArea))) ++ return (NULL); + area->memory = memory; +- vips_semaphore_init( &area->nwrite, 0, "nwrite" ); ++ vips_semaphore_init(&area->nwrite, 0, "nwrite"); + +- return( area ); ++ return (area); + } + + /* Move an area to a position. + */ +-static void +-sink_memory_area_position( SinkMemoryArea *area, int top, int height ) ++static void ++sink_memory_area_position(SinkMemoryArea *area, int top, int height) + { + SinkMemory *memory = area->memory; + +@@ -161,17 +161,17 @@ sink_memory_area_position( SinkMemoryArea *area, int top, int height ) + rect.width = memory->sink_base.im->Xsize; + rect.height = height; + +- vips_rect_intersectrect( &all, &rect, &area->rect ); ++ vips_rect_intersectrect(&all, &rect, &area->rect); + } + + /* Our VipsThreadpoolAllocate function ... move the thread to the next tile + * that needs doing. If we fill the current area, we block until the previous +- * area is finished, then swap areas. ++ * area is finished, then swap areas. + * If all tiles are done, we return FALSE to end + * iteration. + */ + static gboolean +-sink_memory_area_allocate_fn( VipsThreadState *state, void *a, gboolean *stop ) ++sink_memory_area_allocate_fn(VipsThreadState *state, void *a, gboolean *stop) + { + SinkMemoryThreadState *smstate = (SinkMemoryThreadState *) state; + SinkMemory *memory = (SinkMemory *) a; +@@ -180,38 +180,38 @@ sink_memory_area_allocate_fn( VipsThreadState *state, void *a, gboolean *stop ) + VipsRect image; + VipsRect tile; + +- VIPS_DEBUG_MSG( "sink_memory_area_allocate_fn: %p\n", g_thread_self() ); ++ VIPS_DEBUG_MSG("sink_memory_area_allocate_fn: %p\n", g_thread_self()); + +- /* Is the state x/y OK? New line or maybe new buffer or maybe even ++ /* Is the state x/y OK? New line or maybe new buffer or maybe even + * all done. + */ +- if( sink_base->x >= memory->area->rect.width ) { ++ if (sink_base->x >= memory->area->rect.width) { + sink_base->x = 0; + sink_base->y += sink_base->tile_height; + +- if( sink_base->y >= VIPS_RECT_BOTTOM( &memory->area->rect ) ) { ++ if (sink_base->y >= VIPS_RECT_BOTTOM(&memory->area->rect)) { + /* Block until the previous area is done. + */ +- if( memory->area->rect.top > 0 ) +- vips_semaphore_downn( +- &memory->old_area->nwrite, 0 ); ++ if (memory->area->rect.top > 0) ++ vips_semaphore_downn( ++ &memory->old_area->nwrite, 0); + + /* End of image? + */ +- if( sink_base->y >= sink_base->im->Ysize ) { ++ if (sink_base->y >= sink_base->im->Ysize) { + *stop = TRUE; +- return( 0 ); ++ return (0); + } + + /* Swap buffers. + */ +- VIPS_SWAP( SinkMemoryArea *, +- memory->area, memory->old_area ); ++ VIPS_SWAP(SinkMemoryArea *, ++ memory->area, memory->old_area); + + /* Position buf at the new y. + */ +- sink_memory_area_position( memory->area, +- sink_base->y, sink_base->n_lines ); ++ sink_memory_area_position(memory->area, ++ sink_base->y, sink_base->n_lines); + } + } + +@@ -225,18 +225,18 @@ sink_memory_area_allocate_fn( VipsThreadState *state, void *a, gboolean *stop ) + tile.top = sink_base->y; + tile.width = sink_base->tile_width; + tile.height = sink_base->tile_height; +- vips_rect_intersectrect( &image, &tile, &state->pos ); ++ vips_rect_intersectrect(&image, &tile, &state->pos); + + /* The thread needs to know which area it's writing to. + */ + smstate->area = memory->area; + +- VIPS_DEBUG_MSG( " %p allocated %d x %d:\n", +- g_thread_self(), state->pos.left, state->pos.top ); ++ VIPS_DEBUG_MSG(" %p allocated %d x %d:\n", ++ g_thread_self(), state->pos.left, state->pos.top); + + /* Add to the number of writers on the area. + */ +- vips_semaphore_upn( &memory->area->nwrite, -1 ); ++ vips_semaphore_upn(&memory->area->nwrite, -1); + + /* Move state on. + */ +@@ -246,13 +246,13 @@ sink_memory_area_allocate_fn( VipsThreadState *state, void *a, gboolean *stop ) + */ + sink_base->processed += state->pos.width * state->pos.height; + +- return( 0 ); ++ return (0); + } + + /* Our VipsThreadpoolWork function ... generate a tile! + */ + static int +-sink_memory_area_work_fn( VipsThreadState *state, void *a ) ++sink_memory_area_work_fn(VipsThreadState *state, void *a) + { + SinkMemory *memory = (SinkMemory *) a; + SinkMemoryThreadState *smstate = (SinkMemoryThreadState *) state; +@@ -260,36 +260,36 @@ sink_memory_area_work_fn( VipsThreadState *state, void *a ) + + int result; + +- VIPS_DEBUG_MSG( "sink_memory_area_work_fn: %p %d x %d\n", +- g_thread_self(), state->pos.left, state->pos.top ); ++ VIPS_DEBUG_MSG("sink_memory_area_work_fn: %p %d x %d\n", ++ g_thread_self(), state->pos.left, state->pos.top); + +- result = vips_region_prepare_to( state->reg, memory->region, +- &state->pos, state->pos.left, state->pos.top ); ++ result = vips_region_prepare_to(state->reg, memory->region, ++ &state->pos, state->pos.left, state->pos.top); + +- VIPS_DEBUG_MSG( "sink_memory_area_work_fn: %p result = %d\n", +- g_thread_self(), result ); ++ VIPS_DEBUG_MSG("sink_memory_area_work_fn: %p result = %d\n", ++ g_thread_self(), result); + + /* Tell the allocator we're done. + */ +- vips_semaphore_upn( &area->nwrite, 1 ); ++ vips_semaphore_upn(&area->nwrite, 1); + +- return( result ); ++ return (result); + } + + static void +-sink_memory_free( SinkMemory *memory ) ++sink_memory_free(SinkMemory *memory) + { +- VIPS_FREEF( sink_memory_area_free, memory->area ); +- VIPS_FREEF( sink_memory_area_free, memory->old_area ); +- VIPS_UNREF( memory->region ); ++ VIPS_FREEF(sink_memory_area_free, memory->area); ++ VIPS_FREEF(sink_memory_area_free, memory->old_area); ++ VIPS_UNREF(memory->region); + } + + static int +-sink_memory_init( SinkMemory *memory, VipsImage *image ) ++sink_memory_init(SinkMemory *memory, VipsImage *image) + { + VipsRect all; + +- vips_sink_base_init( &memory->sink_base, image ); ++ vips_sink_base_init(&memory->sink_base, image); + memory->area = NULL; + memory->old_area = NULL; + +@@ -298,15 +298,15 @@ sink_memory_init( SinkMemory *memory, VipsImage *image ) + all.width = image->Xsize; + all.height = image->Ysize; + +- if( !(memory->region = vips_region_new( image )) || +- vips_region_image( memory->region, &all ) || +- !(memory->area = sink_memory_area_new( memory )) || +- !(memory->old_area = sink_memory_area_new( memory )) ) { +- sink_memory_free( memory ); +- return( -1 ); ++ if (!(memory->region = vips_region_new(image)) || ++ vips_region_image(memory->region, &all) || ++ !(memory->area = sink_memory_area_new(memory)) || ++ !(memory->old_area = sink_memory_area_new(memory))) { ++ sink_memory_free(memory); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -321,33 +321,33 @@ sink_memory_init( SinkMemory *memory, VipsImage *image ) + * Returns: 0 on success, or -1 on error. + */ + int +-vips_sink_memory( VipsImage *image ) ++vips_sink_memory(VipsImage *image) + { + SinkMemory memory; + int result; + +- if( sink_memory_init( &memory, image ) ) +- return( -1 ); ++ if (sink_memory_init(&memory, image)) ++ return (-1); + +- vips_image_preeval( image ); ++ vips_image_preeval(image); + + result = 0; +- sink_memory_area_position( memory.area, 0, memory.sink_base.n_lines ); +- if( vips_threadpool_run( image, +- sink_memory_thread_state_new, +- sink_memory_area_allocate_fn, +- sink_memory_area_work_fn, +- vips_sink_base_progress, +- &memory ) ) ++ sink_memory_area_position(memory.area, 0, memory.sink_base.n_lines); ++ if (vips_threadpool_run(image, ++ sink_memory_thread_state_new, ++ sink_memory_area_allocate_fn, ++ sink_memory_area_work_fn, ++ vips_sink_base_progress, ++ &memory)) + result = -1; + +- vips_image_posteval( image ); ++ vips_image_posteval(image); + +- sink_memory_free( &memory ); ++ sink_memory_free(&memory); + +- vips_image_minimise_all( image ); ++ vips_image_minimise_all(image); + +- VIPS_DEBUG_MSG( "vips_sink_memory: done\n" ); ++ VIPS_DEBUG_MSG("vips_sink_memory: done\n"); + +- return( result ); ++ return (result); + } +diff --git a/libvips/iofuncs/sinkscreen.c b/libvips/iofuncs/sinkscreen.c +index 3728e8d6d0..f7c4805d86 100644 +--- a/libvips/iofuncs/sinkscreen.c ++++ b/libvips/iofuncs/sinkscreen.c +@@ -3,7 +3,7 @@ + * 1/1/10 + * - from im_render.c + * 25/11/10 +- * - in synchronous mode, use a single region for input and save huge ++ * - in synchronous mode, use a single region for input and save huge + * mem use + * 20/1/14 + * - bg render thread quits on shutdown +@@ -14,28 +14,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -77,13 +77,13 @@ + static int render_num_renders = 0; + #endif /*VIPS_DEBUG_AMBER*/ + +-/* A tile in our cache. ++/* A tile in our cache. + */ + typedef struct { + struct _Render *render; + + VipsRect area; /* Place here (unclipped) */ +- VipsRegion *region; /* VipsRegion with the pixels */ ++ VipsRegion *region; /* VipsRegion with the pixels */ + + /* The tile contains calculated pixels. Though the region may have been + * invalidated behind our backs: we have to check that too. +@@ -95,7 +95,7 @@ typedef struct { + */ + gboolean dirty; + +- /* Time of last use, for LRU flush ++ /* Time of last use, for LRU flush + */ + int ticks; + } Tile; +@@ -107,7 +107,7 @@ typedef struct _Render { + * threads. We can't easily use the gobject ref count system since we + * need a lock around operations. + */ +-#if GLIB_CHECK_VERSION( 2, 58, 0 ) ++#if GLIB_CHECK_VERSION(2, 58, 0) + gatomicrefcount ref_count; + #else + int ref_count; +@@ -116,29 +116,29 @@ typedef struct _Render { + + /* Parameters. + */ +- VipsImage *in; /* Image we render */ +- VipsImage *out; /* Write tiles here on demand */ +- VipsImage *mask; /* Set valid pixels here */ +- int tile_width; /* Tile size */ ++ VipsImage *in; /* Image we render */ ++ VipsImage *out; /* Write tiles here on demand */ ++ VipsImage *mask; /* Set valid pixels here */ ++ int tile_width; /* Tile size */ + int tile_height; +- int max_tiles; /* Maximum number of tiles */ +- int priority; /* Larger numbers done sooner */ +- VipsSinkNotify notify; /* Tell caller about paints here */ ++ int max_tiles; /* Maximum number of tiles */ ++ int priority; /* Larger numbers done sooner */ ++ VipsSinkNotify notify; /* Tell caller about paints here */ + void *a; + +- /* Lock here before reading or modifying the tile structure. ++ /* Lock here before reading or modifying the tile structure. + */ +- GMutex *lock; ++ GMutex *lock; + + /* Tile cache. + */ +- GSList *all; /* All our tiles */ +- int ntiles; /* Number of tiles */ +- int ticks; /* Inc. on each access ... used for LRU */ ++ GSList *all; /* All our tiles */ ++ int ntiles; /* Number of tiles */ ++ int ticks; /* Inc. on each access ... used for LRU */ + + /* List of dirty tiles. Most recent at the front. + */ +- GSList *dirty; ++ GSList *dirty; + + /* Hash of tiles with positions. Tiles can be dirty or painted. + */ +@@ -165,10 +165,10 @@ typedef struct _RenderThreadStateClass { + + } RenderThreadStateClass; + +-G_DEFINE_TYPE( RenderThreadState, render_thread_state, VIPS_TYPE_THREAD_STATE ); ++G_DEFINE_TYPE(RenderThreadState, render_thread_state, VIPS_TYPE_THREAD_STATE); + + /* The BG thread which sits waiting to do some calculations, and the semaphore +- * it waits on holding the number of renders with dirty tiles. ++ * it waits on holding the number of renders with dirty tiles. + */ + static GThread *render_thread = NULL; + +@@ -181,147 +181,147 @@ static gboolean render_kill = FALSE; + */ + static GMutex *render_dirty_lock = NULL; + static GSList *render_dirty_all = NULL; +-static VipsSemaphore n_render_dirty_sem; ++static VipsSemaphore n_render_dirty_sem; + + /* Set this to make the bg thread stop and reschedule. + */ + static gboolean render_reschedule = FALSE; + + static void +-render_thread_state_class_init( RenderThreadStateClass *class ) ++render_thread_state_class_init(RenderThreadStateClass *class) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); + + object_class->nickname = "renderthreadstate"; +- object_class->description = _( "per-thread state for render" ); ++ object_class->description = _("per-thread state for render"); + } + + static void +-render_thread_state_init( RenderThreadState *state ) ++render_thread_state_init(RenderThreadState *state) + { + state->tile = NULL; + } + + static VipsThreadState * +-render_thread_state_new( VipsImage *im, void *a ) ++render_thread_state_new(VipsImage *im, void *a) + { +- return( VIPS_THREAD_STATE( vips_object_new( +- render_thread_state_get_type(), +- vips_thread_state_set, im, a ) ) ); ++ return (VIPS_THREAD_STATE(vips_object_new( ++ render_thread_state_get_type(), ++ vips_thread_state_set, im, a))); + } + + static void * +-tile_free( Tile *tile, void *a, void *b ) ++tile_free(Tile *tile, void *a, void *b) + { +- VIPS_DEBUG_MSG_AMBER( "tile_free\n" ); ++ VIPS_DEBUG_MSG_AMBER("tile_free\n"); + +- VIPS_UNREF( tile->region ); +- g_free( tile ); ++ VIPS_UNREF(tile->region); ++ g_free(tile); + +- return( NULL ); ++ return (NULL); + } + + static int +-render_free( Render *render ) ++render_free(Render *render) + { +- VIPS_DEBUG_MSG_AMBER( "render_free: %p\n", render ); ++ VIPS_DEBUG_MSG_AMBER("render_free: %p\n", render); + +-#if GLIB_CHECK_VERSION( 2, 58, 0 ) +- g_assert ( g_atomic_ref_count_compare( &render->ref_count, 0 ) ); ++#if GLIB_CHECK_VERSION(2, 58, 0) ++ g_assert(g_atomic_ref_count_compare(&render->ref_count, 0)); + #else +- g_assert( render->ref_count == 0 ); ++ g_assert(render->ref_count == 0); + #endif + +- g_mutex_lock( render_dirty_lock ); +- if( g_slist_find( render_dirty_all, render ) ) { +- render_dirty_all = g_slist_remove( render_dirty_all, render ); ++ g_mutex_lock(render_dirty_lock); ++ if (g_slist_find(render_dirty_all, render)) { ++ render_dirty_all = g_slist_remove(render_dirty_all, render); + +- /* We don't need to adjust the semaphore: if it's too high, +- * the render thread will just loop and decrement next time ++ /* We don't need to adjust the semaphore: if it's too high, ++ * the render thread will just loop and decrement next time + * render_dirty_all is NULL. + */ + } +- g_mutex_unlock( render_dirty_lock ); ++ g_mutex_unlock(render_dirty_lock); + +-#if !GLIB_CHECK_VERSION( 2, 58, 0 ) +- vips_g_mutex_free( render->ref_count_lock ); ++#if !GLIB_CHECK_VERSION(2, 58, 0) ++ vips_g_mutex_free(render->ref_count_lock); + #endif +- vips_g_mutex_free( render->lock ); ++ vips_g_mutex_free(render->lock); + +- vips_slist_map2( render->all, (VipsSListMap2Fn) tile_free, NULL, NULL ); +- VIPS_FREEF( g_slist_free, render->all ); ++ vips_slist_map2(render->all, (VipsSListMap2Fn) tile_free, NULL, NULL); ++ VIPS_FREEF(g_slist_free, render->all); + render->ntiles = 0; +- VIPS_FREEF( g_slist_free, render->dirty ); +- VIPS_FREEF( g_hash_table_destroy, render->tiles ); ++ VIPS_FREEF(g_slist_free, render->dirty); ++ VIPS_FREEF(g_hash_table_destroy, render->tiles); + +- VIPS_UNREF( render->in ); ++ VIPS_UNREF(render->in); + +- g_free( render ); ++ g_free(render); + + #ifdef VIPS_DEBUG_AMBER + render_num_renders -= 1; + #endif /*VIPS_DEBUG_AMBER*/ + +- return( 0 ); ++ return (0); + } + + /* Ref and unref a Render ... free on last unref. + */ + static int +-render_ref( Render *render ) ++render_ref(Render *render) + { +-#if GLIB_CHECK_VERSION( 2, 58, 0 ) +- g_assert( !g_atomic_ref_count_compare( &render->ref_count, 0 ) ); +- g_atomic_ref_count_inc( &render->ref_count ); ++#if GLIB_CHECK_VERSION(2, 58, 0) ++ g_assert(!g_atomic_ref_count_compare(&render->ref_count, 0)); ++ g_atomic_ref_count_inc(&render->ref_count); + #else +- g_mutex_lock( render->ref_count_lock ); +- g_assert( render->ref_count != 0 ); ++ g_mutex_lock(render->ref_count_lock); ++ g_assert(render->ref_count != 0); + render->ref_count += 1; +- g_mutex_unlock( render->ref_count_lock ); ++ g_mutex_unlock(render->ref_count_lock); + #endif + +- return( 0 ); ++ return (0); + } + + static int +-render_unref( Render *render ) ++render_unref(Render *render) + { + int kill; + +-#if GLIB_CHECK_VERSION( 2, 58, 0 ) +- g_assert( !g_atomic_ref_count_compare( &render->ref_count, 0 ) ); +- kill = g_atomic_ref_count_dec( &render->ref_count ); ++#if GLIB_CHECK_VERSION(2, 58, 0) ++ g_assert(!g_atomic_ref_count_compare(&render->ref_count, 0)); ++ kill = g_atomic_ref_count_dec(&render->ref_count); + #else +- g_mutex_lock( render->ref_count_lock ); +- g_assert( render->ref_count > 0 ); ++ g_mutex_lock(render->ref_count_lock); ++ g_assert(render->ref_count > 0); + render->ref_count -= 1; + kill = render->ref_count == 0; +- g_mutex_unlock( render->ref_count_lock ); ++ g_mutex_unlock(render->ref_count_lock); + #endif + +- if( kill ) +- render_free( render ); ++ if (kill) ++ render_free(render); + +- return( 0 ); ++ return (0); + } + + /* Get the next tile to paint off the dirty list. + */ + static Tile * +-render_tile_dirty_get( Render *render ) ++render_tile_dirty_get(Render *render) + { + Tile *tile; + +- if( !render->dirty ) ++ if (!render->dirty) + tile = NULL; + else { + tile = (Tile *) render->dirty->data; +- g_assert( tile->dirty ); +- render->dirty = g_slist_remove( render->dirty, tile ); ++ g_assert(tile->dirty); ++ render->dirty = g_slist_remove(render->dirty, tile); + tile->dirty = FALSE; + } + +- return( tile ); ++ return (tile); + } + + /* Pick a dirty tile to reuse. We could potentially get the tile that +@@ -329,236 +329,237 @@ render_tile_dirty_get( Render *render ) + * get a crash, just a mis-paint. It should be vanishingly impossible anyway. + */ + static Tile * +-render_tile_dirty_reuse( Render *render ) ++render_tile_dirty_reuse(Render *render) + { + Tile *tile; + +- if( !render->dirty ) ++ if (!render->dirty) + tile = NULL; + else { +- tile = (Tile *) g_slist_last( render->dirty )->data; +- render->dirty = g_slist_remove( render->dirty, tile ); +- g_assert( tile->dirty ); ++ tile = (Tile *) g_slist_last(render->dirty)->data; ++ render->dirty = g_slist_remove(render->dirty, tile); ++ g_assert(tile->dirty); + tile->dirty = FALSE; + +- VIPS_DEBUG_MSG( "render_tile_get_dirty_reuse: " +- "reusing dirty %p\n", tile ); ++ VIPS_DEBUG_MSG("render_tile_get_dirty_reuse: " ++ "reusing dirty %p\n", ++ tile); + } + +- return( tile ); ++ return (tile); + } + + /* Add a tile to the dirty list. + */ + static void +-tile_dirty_set( Tile *tile ) ++tile_dirty_set(Tile *tile) + { + Render *render = tile->render; + +- if( !tile->dirty ) { +- g_assert( !g_slist_find( render->dirty, tile ) ); +- render->dirty = g_slist_prepend( render->dirty, tile ); ++ if (!tile->dirty) { ++ g_assert(!g_slist_find(render->dirty, tile)); ++ render->dirty = g_slist_prepend(render->dirty, tile); + tile->dirty = TRUE; + tile->painted = FALSE; + } + else +- g_assert( g_slist_find( render->dirty, tile ) ); ++ g_assert(g_slist_find(render->dirty, tile)); + } + + /* Bump a tile to the front of the dirty list, if it's there. + */ + static void +-tile_dirty_bump( Tile *tile ) ++tile_dirty_bump(Tile *tile) + { + Render *render = tile->render; + +- if( tile->dirty ) { +- g_assert( g_slist_find( render->dirty, tile ) ); ++ if (tile->dirty) { ++ g_assert(g_slist_find(render->dirty, tile)); + +- render->dirty = g_slist_remove( render->dirty, tile ); +- render->dirty = g_slist_prepend( render->dirty, tile ); ++ render->dirty = g_slist_remove(render->dirty, tile); ++ render->dirty = g_slist_prepend(render->dirty, tile); + } + else +- g_assert( !g_slist_find( render->dirty, tile ) ); ++ g_assert(!g_slist_find(render->dirty, tile)); + } + +-static int +-render_allocate( VipsThreadState *state, void *a, gboolean *stop ) ++static int ++render_allocate(VipsThreadState *state, void *a, gboolean *stop) + { + Render *render = (Render *) a; + RenderThreadState *rstate = (RenderThreadState *) state; + Tile *tile; + +- g_mutex_lock( render->lock ); ++ g_mutex_lock(render->lock); + +- if( render_reschedule || +- !(tile = render_tile_dirty_get( render )) ) { +- VIPS_DEBUG_MSG_GREEN( "render_allocate: stopping\n" ); ++ if (render_reschedule || ++ !(tile = render_tile_dirty_get(render))) { ++ VIPS_DEBUG_MSG_GREEN("render_allocate: stopping\n"); + *stop = TRUE; + rstate->tile = NULL; + } +- else ++ else + rstate->tile = tile; + +- g_mutex_unlock( render->lock ); ++ g_mutex_unlock(render->lock); + +- return( 0 ); ++ return (0); + } + +-static int +-render_work( VipsThreadState *state, void *a ) ++static int ++render_work(VipsThreadState *state, void *a) + { + Render *render = (Render *) a; + RenderThreadState *rstate = (RenderThreadState *) state; + Tile *tile = rstate->tile; + +- g_assert( tile ); ++ g_assert(tile); + +- VIPS_DEBUG_MSG( "calculating tile %p %dx%d\n", +- tile, tile->area.left, tile->area.top ); ++ VIPS_DEBUG_MSG("calculating tile %p %dx%d\n", ++ tile, tile->area.left, tile->area.top); + +- if( vips_region_prepare_to( state->reg, tile->region, +- &tile->area, tile->area.left, tile->area.top ) ) { +- VIPS_DEBUG_MSG_RED( "render_work: " +- "vips_region_prepare_to() failed: %s\n", +- vips_error_buffer() ); +- return( -1 ); ++ if (vips_region_prepare_to(state->reg, tile->region, ++ &tile->area, tile->area.left, tile->area.top)) { ++ VIPS_DEBUG_MSG_RED("render_work: " ++ "vips_region_prepare_to() failed: %s\n", ++ vips_error_buffer()); ++ return (-1); + } + tile->painted = TRUE; + +- if( !render->shutdown && +- render->notify ) +- render->notify( render->out, &tile->area, render->a ); ++ if (!render->shutdown && ++ render->notify) ++ render->notify(render->out, &tile->area, render->a); + +- return( 0 ); ++ return (0); + } + +-static void render_dirty_put( Render *render ); ++static void render_dirty_put(Render *render); + + /* Called from vips_shutdown(). + */ + void +-vips__render_shutdown( void ) ++vips__render_shutdown(void) + { + /* We may come here without having inited. + */ +- if( render_dirty_lock ) { +- g_mutex_lock( render_dirty_lock ); ++ if (render_dirty_lock) { ++ g_mutex_lock(render_dirty_lock); + +- if( render_thread ) { ++ if (render_thread) { + GThread *thread; + + thread = render_thread; + render_reschedule = TRUE; + render_kill = TRUE; + +- g_mutex_unlock( render_dirty_lock ); ++ g_mutex_unlock(render_dirty_lock); + +- vips_semaphore_up( &n_render_dirty_sem ); ++ vips_semaphore_up(&n_render_dirty_sem); + +- (void) vips_g_thread_join( thread ); ++ (void) vips_g_thread_join(thread); + } + else +- g_mutex_unlock( render_dirty_lock ); ++ g_mutex_unlock(render_dirty_lock); + +- VIPS_FREEF( vips_g_mutex_free, render_dirty_lock ); +- vips_semaphore_destroy( &n_render_dirty_sem ); ++ VIPS_FREEF(vips_g_mutex_free, render_dirty_lock); ++ vips_semaphore_destroy(&n_render_dirty_sem); + } + } + +-static int +-render_dirty_sort( Render *a, Render *b, void *user_data ) ++static int ++render_dirty_sort(Render *a, Render *b, void *user_data) + { +- return( b->priority - a->priority ); ++ return (b->priority - a->priority); + } + + /* Add to the jobs list, if it has work to be done. + */ + static void +-render_dirty_put( Render *render ) ++render_dirty_put(Render *render) + { +- g_mutex_lock( render_dirty_lock ); ++ g_mutex_lock(render_dirty_lock); + +- if( render->dirty ) { +- if( !g_slist_find( render_dirty_all, render ) ) { +- render_dirty_all = g_slist_prepend( render_dirty_all, +- render ); +- render_dirty_all = g_slist_sort( render_dirty_all, +- (GCompareFunc) render_dirty_sort ); ++ if (render->dirty) { ++ if (!g_slist_find(render_dirty_all, render)) { ++ render_dirty_all = g_slist_prepend(render_dirty_all, ++ render); ++ render_dirty_all = g_slist_sort(render_dirty_all, ++ (GCompareFunc) render_dirty_sort); + + /* Tell the bg render thread we have one more dirty + * render on there. + */ +- vips_semaphore_up( &n_render_dirty_sem ); ++ vips_semaphore_up(&n_render_dirty_sem); + } + } + +- g_mutex_unlock( render_dirty_lock ); ++ g_mutex_unlock(render_dirty_lock); + } + + static guint +-tile_hash( gconstpointer key ) ++tile_hash(gconstpointer key) + { + VipsRect *rect = (VipsRect *) key; + + int x = rect->left / rect->width; + int y = rect->top / rect->height; + +- return( x << 16 ^ y ); ++ return (x << 16 ^ y); + } + + static gboolean +-tile_equal( gconstpointer a, gconstpointer b ) ++tile_equal(gconstpointer a, gconstpointer b) + { + VipsRect *rect1 = (VipsRect *) a; + VipsRect *rect2 = (VipsRect *) b; + +- return( rect1->left == rect2->left && +- rect1->top == rect2->top ); ++ return (rect1->left == rect2->left && ++ rect1->top == rect2->top); + } + + static void +-render_close_cb( VipsImage *image, Render *render ) ++render_close_cb(VipsImage *image, Render *render) + { +- VIPS_DEBUG_MSG_AMBER( "render_close_cb\n" ); ++ VIPS_DEBUG_MSG_AMBER("render_close_cb\n"); + +- /* The output image or mask are closing. This render will stick +- * around for a while, since threads can still be running, but it ++ /* The output image or mask are closing. This render will stick ++ * around for a while, since threads can still be running, but it + * must no longer reference ->out or ->mask (for example, invalidating + * them). + */ + render->shutdown = TRUE; + +- render_unref( render ); ++ render_unref(render); + +- /* If this render is being worked on, we want to jog the bg thread, ++ /* If this render is being worked on, we want to jog the bg thread, + * make it drop it's ref and think again. + */ +- VIPS_DEBUG_MSG_GREEN( "render_close_cb: reschedule\n" ); ++ VIPS_DEBUG_MSG_GREEN("render_close_cb: reschedule\n"); + render_reschedule = TRUE; + } + + static Render * +-render_new( VipsImage *in, VipsImage *out, VipsImage *mask, +- int tile_width, int tile_height, +- int max_tiles, ++render_new(VipsImage *in, VipsImage *out, VipsImage *mask, ++ int tile_width, int tile_height, ++ int max_tiles, + int priority, +- VipsSinkNotify notify, void *a ) ++ VipsSinkNotify notify, void *a) + { + Render *render; + + /* Don't use auto-free for render, we do our own lifetime management + * with _ref() and _unref(). + */ +- if( !(render = VIPS_NEW( NULL, Render )) ) +- return( NULL ); ++ if (!(render = VIPS_NEW(NULL, Render))) ++ return (NULL); + + /* render must hold a ref to in. This is dropped in render_free(). + */ +- g_object_ref( in ); ++ g_object_ref(in); + +-#if GLIB_CHECK_VERSION( 2, 58, 0 ) +- g_atomic_ref_count_init( &render->ref_count ); ++#if GLIB_CHECK_VERSION(2, 58, 0) ++ g_atomic_ref_count_init(&render->ref_count); + #else + render->ref_count = 1; + render->ref_count_lock = vips_g_mutex_new(); +@@ -580,7 +581,7 @@ render_new( VipsImage *in, VipsImage *out, VipsImage *mask, + render->ntiles = 0; + render->ticks = 0; + +- render->tiles = g_hash_table_new( tile_hash, tile_equal ); ++ render->tiles = g_hash_table_new(tile_hash, tile_equal); + + render->dirty = NULL; + +@@ -588,38 +589,38 @@ render_new( VipsImage *in, VipsImage *out, VipsImage *mask, + + /* Both out and mask must close before we can free the render. + */ +- g_signal_connect( out, "close", +- G_CALLBACK( render_close_cb ), render ); ++ g_signal_connect(out, "close", ++ G_CALLBACK(render_close_cb), render); + +- if( mask ) { +- g_signal_connect( mask, "close", +- G_CALLBACK( render_close_cb ), render ); +- render_ref( render ); ++ if (mask) { ++ g_signal_connect(mask, "close", ++ G_CALLBACK(render_close_cb), render); ++ render_ref(render); + } + +- VIPS_DEBUG_MSG_AMBER( "render_new: %p\n", render ); ++ VIPS_DEBUG_MSG_AMBER("render_new: %p\n", render); + + #ifdef VIPS_DEBUG_AMBER + render_num_renders += 1; + #endif /*VIPS_DEBUG_AMBER*/ + +- return( render ); ++ return (render); + } + + /* Make a Tile. + */ + static Tile * +-tile_new( Render *render ) ++tile_new(Render *render) + { + Tile *tile; + +- VIPS_DEBUG_MSG_AMBER( "tile_new\n" ); ++ VIPS_DEBUG_MSG_AMBER("tile_new\n"); + + /* Don't use auto-free: we need to make sure we free the tile after + * Render. + */ +- if( !(tile = VIPS_NEW( NULL, Tile )) ) +- return( NULL ); ++ if (!(tile = VIPS_NEW(NULL, Tile))) ++ return (NULL); + + tile->render = render; + tile->area.left = 0; +@@ -631,244 +632,245 @@ tile_new( Render *render ) + tile->dirty = FALSE; + tile->ticks = render->ticks; + +- if( !(tile->region = vips_region_new( render->in )) ) { +- (void) tile_free( tile, NULL, NULL ); +- return( NULL ); ++ if (!(tile->region = vips_region_new(render->in))) { ++ (void) tile_free(tile, NULL, NULL); ++ return (NULL); + } + +- render->all = g_slist_prepend( render->all, tile ); ++ render->all = g_slist_prepend(render->all, tile); + render->ntiles += 1; + +- return( tile ); ++ return (tile); + } + + /* Search the cache for a tile by position. + */ + static Tile * +-render_tile_lookup( Render *render, VipsRect *area ) ++render_tile_lookup(Render *render, VipsRect *area) + { +- return( (Tile *) g_hash_table_lookup( render->tiles, area ) ); ++ return ((Tile *) g_hash_table_lookup(render->tiles, area)); + } + + /* Add a new tile to the table. + */ + static void +-render_tile_add( Tile *tile, VipsRect *area ) ++render_tile_add(Tile *tile, VipsRect *area) + { + Render *render = tile->render; + +- g_assert( !render_tile_lookup( render, area ) ); ++ g_assert(!render_tile_lookup(render, area)); + + tile->area = *area; + tile->painted = FALSE; + +- /* Ignore buffer allocate errors, there's not much we could do with ++ /* Ignore buffer allocate errors, there's not much we could do with + * them. + */ +- if( vips_region_buffer( tile->region, &tile->area ) ) +- VIPS_DEBUG_MSG_RED( "render_tile_add: " +- "buffer allocate failed\n" ); ++ if (vips_region_buffer(tile->region, &tile->area)) ++ VIPS_DEBUG_MSG_RED("render_tile_add: " ++ "buffer allocate failed\n"); + +- g_hash_table_insert( render->tiles, &tile->area, tile ); ++ g_hash_table_insert(render->tiles, &tile->area, tile); + } + + /* Move a tile to a new position. + */ + static void +-render_tile_move( Tile *tile, VipsRect *area ) ++render_tile_move(Tile *tile, VipsRect *area) + { + Render *render = tile->render; + +- g_assert( render_tile_lookup( render, &tile->area ) ); ++ g_assert(render_tile_lookup(render, &tile->area)); + +- if( tile->area.left != area->left || +- tile->area.top != area->top ) { +- g_assert( !render_tile_lookup( render, area ) ); ++ if (tile->area.left != area->left || ++ tile->area.top != area->top) { ++ g_assert(!render_tile_lookup(render, area)); + +- g_hash_table_remove( render->tiles, &tile->area ); +- render_tile_add( tile, area ); ++ g_hash_table_remove(render->tiles, &tile->area); ++ render_tile_add(tile, area); + } + } + + /* We've looked at a tile ... bump to end of LRU and front of dirty. + */ + static void +-tile_touch( Tile *tile ) ++tile_touch(Tile *tile) + { + Render *render = tile->render; + + tile->ticks = render->ticks; + render->ticks += 1; +- tile_dirty_bump( tile ); ++ tile_dirty_bump(tile); + } + +-/* Queue a tile for calculation. ++/* Queue a tile for calculation. + */ + static void +-tile_queue( Tile *tile, VipsRegion *reg ) ++tile_queue(Tile *tile, VipsRegion *reg) + { + Render *render = tile->render; + +- VIPS_DEBUG_MSG( "tile_queue: adding tile %p %dx%d to dirty\n", +- tile, tile->area.left, tile->area.top ); ++ VIPS_DEBUG_MSG("tile_queue: adding tile %p %dx%d to dirty\n", ++ tile, tile->area.left, tile->area.top); + + tile->painted = FALSE; +- tile_touch( tile ); ++ tile_touch(tile); + +- if( render->notify ) { +- /* Add to the list of renders with dirty tiles. The bg ++ if (render->notify) { ++ /* Add to the list of renders with dirty tiles. The bg + * thread will pick it up and paint it. It can be already on + * the dirty list. + */ +- tile_dirty_set( tile ); +- render_dirty_put( render ); ++ tile_dirty_set(tile); ++ render_dirty_put(render); + } + else { +- /* no notify ... paint the tile ourselves +- * sychronously. No need to notify the client since they'll ++ /* no notify ... paint the tile ourselves ++ * sychronously. No need to notify the client since they'll + * never see black tiles. + */ +- VIPS_DEBUG_MSG( "tile_queue: " +- "painting tile %p %dx%d synchronously\n", +- tile, tile->area.left, tile->area.top ); ++ VIPS_DEBUG_MSG("tile_queue: " ++ "painting tile %p %dx%d synchronously\n", ++ tile, tile->area.left, tile->area.top); + + /* While we're computing, let other threads use the cache. + * This tile won't get pulled out from under us since it's not + * marked as "painted", and it's not on the dirty list. + */ +- g_mutex_unlock( render->lock ); ++ g_mutex_unlock(render->lock); + +- if( vips_region_prepare_to( reg, tile->region, +- &tile->area, tile->area.left, tile->area.top ) ) +- VIPS_DEBUG_MSG_RED( "tile_queue: prepare failed\n" ); ++ if (vips_region_prepare_to(reg, tile->region, ++ &tile->area, tile->area.left, tile->area.top)) ++ VIPS_DEBUG_MSG_RED("tile_queue: prepare failed\n"); + +- g_mutex_lock( render->lock ); ++ g_mutex_lock(render->lock); + + tile->painted = TRUE; + } + } + +-static void +-tile_test_clean_ticks( VipsRect *key, Tile *value, Tile **best ) ++static void ++tile_test_clean_ticks(VipsRect *key, Tile *value, Tile **best) + { +- if( value->painted ) +- if( !*best || value->ticks < (*best)->ticks ) ++ if (value->painted) ++ if (!*best || value->ticks < (*best)->ticks) + *best = value; + } + + /* Pick a painted tile to reuse. Search for LRU (slow!). + */ + static Tile * +-render_tile_get_painted( Render *render ) ++render_tile_get_painted(Render *render) + { + Tile *tile; + + tile = NULL; +- g_hash_table_foreach( render->tiles, +- (GHFunc) tile_test_clean_ticks, &tile ); ++ g_hash_table_foreach(render->tiles, ++ (GHFunc) tile_test_clean_ticks, &tile); + +- if( tile ) { +- VIPS_DEBUG_MSG( "render_tile_get_painted: " +- "reusing painted %p\n", tile ); ++ if (tile) { ++ VIPS_DEBUG_MSG("render_tile_get_painted: " ++ "reusing painted %p\n", ++ tile); + } + +- return( tile ); ++ return (tile); + } + + /* Ask for an area of calculated pixels. Get from cache, request calculation, + * or if we've no threads or no notify, calculate immediately. + */ + static Tile * +-render_tile_request( Render *render, VipsRegion *reg, VipsRect *area ) ++render_tile_request(Render *render, VipsRegion *reg, VipsRect *area) + { + Tile *tile; + +- VIPS_DEBUG_MSG( "render_tile_request: asking for %dx%d\n", +- area->left, area->top ); ++ VIPS_DEBUG_MSG("render_tile_request: asking for %dx%d\n", ++ area->left, area->top); + +- if( (tile = render_tile_lookup( render, area )) ) { ++ if ((tile = render_tile_lookup(render, area))) { + /* We already have a tile at this position. If it's invalid, + * ask for a repaint. + */ +- if( tile->region->invalid ) +- tile_queue( tile, reg ); ++ if (tile->region->invalid) ++ tile_queue(tile, reg); + else +- tile_touch( tile ); ++ tile_touch(tile); + } +- else if( render->ntiles < render->max_tiles || +- render->max_tiles == -1 ) { +- /* We have fewer tiles than teh max. We can just make a new ++ else if (render->ntiles < render->max_tiles || ++ render->max_tiles == -1) { ++ /* We have fewer tiles than teh max. We can just make a new + * tile. + */ +- if( !(tile = tile_new( render )) ) +- return( NULL ); ++ if (!(tile = tile_new(render))) ++ return (NULL); + +- render_tile_add( tile, area ); ++ render_tile_add(tile, area); + +- tile_queue( tile, reg ); ++ tile_queue(tile, reg); + } + else { +- /* Need to reuse a tile. Try for an old painted tile first, +- * then if that fails, reuse a dirty tile. ++ /* Need to reuse a tile. Try for an old painted tile first, ++ * then if that fails, reuse a dirty tile. + */ +- if( !(tile = render_tile_get_painted( render )) && +- !(tile = render_tile_dirty_reuse( render )) ) { +- VIPS_DEBUG_MSG( "render_tile_request: " +- "no tiles to reuse\n" ); +- return( NULL ); ++ if (!(tile = render_tile_get_painted(render)) && ++ !(tile = render_tile_dirty_reuse(render))) { ++ VIPS_DEBUG_MSG("render_tile_request: " ++ "no tiles to reuse\n"); ++ return (NULL); + } + +- render_tile_move( tile, area ); ++ render_tile_move(tile, area); + +- tile_queue( tile, reg ); ++ tile_queue(tile, reg); + } + +- return( tile ); ++ return (tile); + } + + /* Copy what we can from the tile into the region. + */ + static void +-tile_copy( Tile *tile, VipsRegion *to ) ++tile_copy(Tile *tile, VipsRegion *to) + { + VipsRect ovlap; + + /* Find common pixels. + */ +- vips_rect_intersectrect( &tile->area, &to->valid, &ovlap ); +- g_assert( !vips_rect_isempty( &ovlap ) ); ++ vips_rect_intersectrect(&tile->area, &to->valid, &ovlap); ++ g_assert(!vips_rect_isempty(&ovlap)); + + /* If the tile is painted, copy over the pixels. Otherwise, fill with +- * zero. ++ * zero. + */ +- if( tile->painted && !tile->region->invalid ) { +- int len = VIPS_IMAGE_SIZEOF_PEL( to->im ) * ovlap.width; ++ if (tile->painted && !tile->region->invalid) { ++ int len = VIPS_IMAGE_SIZEOF_PEL(to->im) * ovlap.width; + + int y; + +- VIPS_DEBUG_MSG( "tile_copy: " +- "copying calculated pixels for %p %dx%d\n", +- tile, tile->area.left, tile->area.top ); ++ VIPS_DEBUG_MSG("tile_copy: " ++ "copying calculated pixels for %p %dx%d\n", ++ tile, tile->area.left, tile->area.top); + +- for( y = ovlap.top; y < VIPS_RECT_BOTTOM( &ovlap ); y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( tile->region, +- ovlap.left, y ); +- VipsPel *q = VIPS_REGION_ADDR( to, ovlap.left, y ); ++ for (y = ovlap.top; y < VIPS_RECT_BOTTOM(&ovlap); y++) { ++ VipsPel *p = VIPS_REGION_ADDR(tile->region, ++ ovlap.left, y); ++ VipsPel *q = VIPS_REGION_ADDR(to, ovlap.left, y); + +- memcpy( q, p, len ); ++ memcpy(q, p, len); + } + } + else { +- VIPS_DEBUG_MSG( "tile_copy: zero filling for %p %dx%d\n", +- tile, tile->area.left, tile->area.top ); +- vips_region_paint( to, &ovlap, 0 ); ++ VIPS_DEBUG_MSG("tile_copy: zero filling for %p %dx%d\n", ++ tile, tile->area.left, tile->area.top); ++ vips_region_paint(to, &ovlap, 0); + } + } + + /* Loop over the output region, filling with data from cache. + */ + static int +-image_fill( VipsRegion *out, void *seq, void *a, void *b, gboolean *stop ) ++image_fill(VipsRegion *out, void *seq, void *a, void *b, gboolean *stop) + { + Render *render = (Render *) b; + int tile_width = render->tile_width; +@@ -883,21 +885,21 @@ image_fill( VipsRegion *out, void *seq, void *a, void *b, gboolean *stop ) + int xs = (r->left / tile_width) * tile_width; + int ys = (r->top / tile_height) * tile_height; + +- VIPS_DEBUG_MSG( "image_fill: left = %d, top = %d, " +- "width = %d, height = %d\n", +- r->left, r->top, r->width, r->height ); ++ VIPS_DEBUG_MSG("image_fill: left = %d, top = %d, " ++ "width = %d, height = %d\n", ++ r->left, r->top, r->width, r->height); + +- g_mutex_lock( render->lock ); ++ g_mutex_lock(render->lock); + +- /* ++ /* + +- FIXME ... if r fits inside a single tile, we could skip the ++ FIXME ... if r fits inside a single tile, we could skip the + copy. + + */ + +- for( y = ys; y < VIPS_RECT_BOTTOM( r ); y += tile_height ) +- for( x = xs; x < VIPS_RECT_RIGHT( r ); x += tile_width ) { ++ for (y = ys; y < VIPS_RECT_BOTTOM(r); y += tile_height) ++ for (x = xs; x < VIPS_RECT_RIGHT(r); x += tile_width) { + VipsRect area; + Tile *tile; + +@@ -906,22 +908,22 @@ image_fill( VipsRegion *out, void *seq, void *a, void *b, gboolean *stop ) + area.width = tile_width; + area.height = tile_height; + +- tile = render_tile_request( render, reg, &area ); +- if( tile ) +- tile_copy( tile, out ); ++ tile = render_tile_request(render, reg, &area); ++ if (tile) ++ tile_copy(tile, out); + else +- VIPS_DEBUG_MSG_RED( "image_fill: argh!\n" ); ++ VIPS_DEBUG_MSG_RED("image_fill: argh!\n"); + } + +- g_mutex_unlock( render->lock ); ++ g_mutex_unlock(render->lock); + +- return( 0 ); ++ return (0); + } + + /* The mask image is 255 / 0 for the state of painted for each tile. + */ + static int +-mask_fill( VipsRegion *out, void *seq, void *a, void *b, gboolean *stop ) ++mask_fill(VipsRegion *out, void *seq, void *a, void *b, gboolean *stop) + { + Render *render = (Render *) a; + int tile_width = render->tile_width; +@@ -935,14 +937,14 @@ mask_fill( VipsRegion *out, void *seq, void *a, void *b, gboolean *stop ) + int xs = (r->left / tile_width) * tile_width; + int ys = (r->top / tile_height) * tile_height; + +- VIPS_DEBUG_MSG( "mask_fill: left = %d, top = %d, " +- "width = %d, height = %d\n", +- r->left, r->top, r->width, r->height ); ++ VIPS_DEBUG_MSG("mask_fill: left = %d, top = %d, " ++ "width = %d, height = %d\n", ++ r->left, r->top, r->width, r->height); + +- g_mutex_lock( render->lock ); ++ g_mutex_lock(render->lock); + +- for( y = ys; y < VIPS_RECT_BOTTOM( r ); y += tile_height ) +- for( x = xs; x < VIPS_RECT_RIGHT( r ); x += tile_width ) { ++ for (y = ys; y < VIPS_RECT_BOTTOM(r); y += tile_height) ++ for (x = xs; x < VIPS_RECT_RIGHT(r); x += tile_width) { + VipsRect area; + Tile *tile; + int value; +@@ -952,114 +954,116 @@ mask_fill( VipsRegion *out, void *seq, void *a, void *b, gboolean *stop ) + area.width = tile_width; + area.height = tile_height; + +- tile = render_tile_lookup( render, &area ); ++ tile = render_tile_lookup(render, &area); + value = (tile && +- tile->painted && +- !tile->region->invalid) ? 255 : 0; ++ tile->painted && ++ !tile->region->invalid) ++ ? 255 ++ : 0; + + /* Only mark painted tiles containing valid pixels. + */ +- vips_region_paint( out, &area, value ); ++ vips_region_paint(out, &area, value); + } + +- g_mutex_unlock( render->lock ); ++ g_mutex_unlock(render->lock); + +- return( 0 ); ++ return (0); + } + +-/* Get the first render with dirty tiles. ++/* Get the first render with dirty tiles. + */ + static Render * +-render_dirty_get( void ) ++render_dirty_get(void) + { + Render *render; + + /* Wait for a render with dirty tiles. + */ +- vips_semaphore_down( &n_render_dirty_sem ); ++ vips_semaphore_down(&n_render_dirty_sem); + +- g_mutex_lock( render_dirty_lock ); ++ g_mutex_lock(render_dirty_lock); + +- /* Just take the head of the jobs list ... we sort when we add. ++ /* Just take the head of the jobs list ... we sort when we add. + */ + render = NULL; +- if( render_dirty_all ) { ++ if (render_dirty_all) { + render = (Render *) render_dirty_all->data; + + /* Ref the render to make sure it can't die while we're + * working on it. + */ +- render_ref( render ); ++ render_ref(render); + +- render_dirty_all = g_slist_remove( render_dirty_all, render ); ++ render_dirty_all = g_slist_remove(render_dirty_all, render); + } + +- g_mutex_unlock( render_dirty_lock ); ++ g_mutex_unlock(render_dirty_lock); + +- return( render ); ++ return (render); + } + + /* Loop for the background render manager thread. + */ + static void * +-render_thread_main( void *client ) ++render_thread_main(void *client) + { + Render *render; + +- while( !render_kill ) { +- VIPS_DEBUG_MSG_GREEN( "render_thread_main: " +- "threadpool start\n" ); ++ while (!render_kill) { ++ VIPS_DEBUG_MSG_GREEN("render_thread_main: " ++ "threadpool start\n"); + + render_reschedule = FALSE; + +- if( (render = render_dirty_get()) ) { +- if( vips_threadpool_run( render->in, +- render_thread_state_new, +- render_allocate, +- render_work, +- NULL, +- render ) ) +- VIPS_DEBUG_MSG_RED( "render_thread_main: " +- "threadpool_run failed\n" ); ++ if ((render = render_dirty_get())) { ++ if (vips_threadpool_run(render->in, ++ render_thread_state_new, ++ render_allocate, ++ render_work, ++ NULL, ++ render)) ++ VIPS_DEBUG_MSG_RED("render_thread_main: " ++ "threadpool_run failed\n"); + +- VIPS_DEBUG_MSG_GREEN( "render_thread_main: " +- "threadpool return\n" ); ++ VIPS_DEBUG_MSG_GREEN("render_thread_main: " ++ "threadpool return\n"); + + /* Add back to the jobs list, if we need to. + */ +- render_dirty_put( render ); ++ render_dirty_put(render); + + /* _get() does a ref to make sure we keep the render + * alive during processing ... unref before we loop. + * This can kill off the render. + */ +- render_unref( render ); ++ render_unref(render); + } + } + + /* We are exiting, so render_thread must now be NULL. + */ +- render_thread = NULL; ++ render_thread = NULL; + +- return( NULL ); ++ return (NULL); + } + + static void * +-vips__sink_screen_once( void *data ) ++vips__sink_screen_once(void *data) + { +- g_assert( !render_thread ); +- g_assert( !render_dirty_lock ); ++ g_assert(!render_thread); ++ g_assert(!render_dirty_lock); + + render_dirty_lock = vips_g_mutex_new(); +- vips_semaphore_init( &n_render_dirty_sem, 0, "n_render_dirty" ); ++ vips_semaphore_init(&n_render_dirty_sem, 0, "n_render_dirty"); + + /* Don't use vips__thread_execute() since this thread will only be + * ended by vips_shutdown, and that isn't always called. + */ +- render_thread = vips_g_thread_new( "sink_screen", +- render_thread_main, NULL ); ++ render_thread = vips_g_thread_new("sink_screen", ++ render_thread_main, NULL); + +- return( NULL ); ++ return (NULL); + } + + /** +@@ -1077,28 +1081,28 @@ vips__sink_screen_once( void *data ) + * This operation renders @in in the background, making pixels available on + * @out as they are calculated. The @notify_fn callback is run every time a new + * set of pixels are available. Calculated pixels are kept in a cache with +- * tiles sized @tile_width by @tile_height pixels and with at most @max_tiles ++ * tiles sized @tile_width by @tile_height pixels and with at most @max_tiles + * tiles. + * If @max_tiles is -1, the cache is of unlimited size (up to the maximum image + * size). +- * The @mask image is a one-band uchar image and has 255 for pixels which are ++ * The @mask image is a one-band uchar image and has 255 for pixels which are + * currently in cache and 0 for uncalculated pixels. + * + * Only a single sink is calculated at any one time, though many may be +- * alive. Use @priority to indicate which renders are more important: ++ * alive. Use @priority to indicate which renders are more important: + * zero means normal + * priority, negative numbers are low priority, positive numbers high + * priority. + * +- * Calls to vips_region_prepare() on @out return immediately and hold ++ * Calls to vips_region_prepare() on @out return immediately and hold + * whatever is + * currently in cache for that #VipsRect (check @mask to see which parts of the +- * #VipsRect are valid). Any pixels in the #VipsRect which are not in ++ * #VipsRect are valid). Any pixels in the #VipsRect which are not in + * cache are added + * to a queue, and the @notify_fn callback will trigger when those pixels are + * ready. + * +- * The @notify_fn callback is run from one of the background threads. In the ++ * The @notify_fn callback is run from one of the background threads. In the + * callback + * you need to somehow send a message to the main thread that the pixels are + * ready. In a glib-based application, this is easily done with g_idle_add(). +@@ -1107,39 +1111,39 @@ vips__sink_screen_once( void *data ) + * vips_region_prepare() on @out will always block until the pixels have been + * calculated. + * +- * See also: vips_tilecache(), vips_region_prepare(), ++ * See also: vips_tilecache(), vips_region_prepare(), + * vips_sink_disc(), vips_sink(). + * + * Returns: 0 on sucess, -1 on error. + */ + int +-vips_sink_screen( VipsImage *in, VipsImage *out, VipsImage *mask, +- int tile_width, int tile_height, +- int max_tiles, ++vips_sink_screen(VipsImage *in, VipsImage *out, VipsImage *mask, ++ int tile_width, int tile_height, ++ int max_tiles, + int priority, +- VipsSinkNotify notify_fn, void *a ) ++ VipsSinkNotify notify_fn, void *a) + { + static GOnce once = G_ONCE_INIT; + + Render *render; + +- VIPS_ONCE( &once, vips__sink_screen_once, NULL ); ++ VIPS_ONCE(&once, vips__sink_screen_once, NULL); + +- if( tile_width <= 0 || tile_height <= 0 || +- max_tiles < -1 ) { +- vips_error( "vips_sink_screen", "%s", _( "bad parameters" ) ); +- return( -1 ); ++ if (tile_width <= 0 || tile_height <= 0 || ++ max_tiles < -1) { ++ vips_error("vips_sink_screen", "%s", _("bad parameters")); ++ return (-1); + } + +- if( vips_image_pio_input( in ) || +- vips_image_pipelinev( out, +- VIPS_DEMAND_STYLE_SMALLTILE, in, NULL ) ) +- return( -1 ); ++ if (vips_image_pio_input(in) || ++ vips_image_pipelinev(out, ++ VIPS_DEMAND_STYLE_SMALLTILE, in, NULL)) ++ return (-1); + +- if( mask ) { +- if( vips_image_pipelinev( mask, +- VIPS_DEMAND_STYLE_SMALLTILE, in, NULL ) ) +- return( -1 ); ++ if (mask) { ++ if (vips_image_pipelinev(mask, ++ VIPS_DEMAND_STYLE_SMALLTILE, in, NULL)) ++ return (-1); + + mask->Bands = 1; + mask->BandFmt = VIPS_FORMAT_UCHAR; +@@ -1147,46 +1151,46 @@ vips_sink_screen( VipsImage *in, VipsImage *out, VipsImage *mask, + mask->Coding = VIPS_CODING_NONE; + } + +- if( !(render = render_new( in, out, mask, +- tile_width, tile_height, max_tiles, priority, notify_fn, a )) ) +- return( -1 ); ++ if (!(render = render_new(in, out, mask, ++ tile_width, tile_height, max_tiles, priority, notify_fn, a))) ++ return (-1); + +- VIPS_DEBUG_MSG( "vips_sink_screen: max = %d, %p\n", max_tiles, render ); ++ VIPS_DEBUG_MSG("vips_sink_screen: max = %d, %p\n", max_tiles, render); + +- if( vips_image_generate( out, +- vips_start_one, image_fill, vips_stop_one, in, render ) ) +- return( -1 ); +- if( mask && +- vips_image_generate( mask, +- NULL, mask_fill, NULL, render, NULL ) ) +- return( -1 ); ++ if (vips_image_generate(out, ++ vips_start_one, image_fill, vips_stop_one, in, render)) ++ return (-1); ++ if (mask && ++ vips_image_generate(mask, ++ NULL, mask_fill, NULL, render, NULL)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + int +-vips__print_renders( void ) ++vips__print_renders(void) + { + int n_leaks; + + n_leaks = 0; + + #ifdef VIPS_DEBUG_AMBER +- if( render_num_renders > 0 ) { +- printf( "%d active renders\n", render_num_renders ); ++ if (render_num_renders > 0) { ++ printf("%d active renders\n", render_num_renders); + n_leaks += render_num_renders; + } + #endif /*VIPS_DEBUG_AMBER*/ + +- if( render_dirty_lock ) { +- g_mutex_lock( render_dirty_lock ); ++ if (render_dirty_lock) { ++ g_mutex_lock(render_dirty_lock); + +- n_leaks += g_slist_length( render_dirty_all ); +- if( render_dirty_all ) +- printf( "dirty renders\n" ); ++ n_leaks += g_slist_length(render_dirty_all); ++ if (render_dirty_all) ++ printf("dirty renders\n"); + +- g_mutex_unlock( render_dirty_lock ); ++ g_mutex_unlock(render_dirty_lock); + } + +- return( n_leaks ); ++ return (n_leaks); + } +diff --git a/libvips/iofuncs/source.c b/libvips/iofuncs/source.c +index d9573f4d53..56b4ca7249 100644 +--- a/libvips/iofuncs/source.c ++++ b/libvips/iofuncs/source.c +@@ -1,6 +1,6 @@ +-/* A byte source/sink .. it can be a pipe, file descriptor, memory area, ++/* A byte source/sink .. it can be a pipe, file descriptor, memory area, + * socket, node.js stream, etc. +- * ++ * + * 19/6/14 + * + * 3/2/20 +@@ -18,28 +18,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -79,7 +79,7 @@ + #include + #include + +-#define MODE_READ CLOEXEC (BINARYIZE (O_RDONLY)) ++#define MODE_READ CLOEXEC(BINARYIZE(O_RDONLY)) + + /* -1 on a pipe isn't actually unbounded. Have a limit to prevent + * huge sources accidentally filling memory. +@@ -98,124 +98,124 @@ static gint64 vips__pipe_read_limit = 1024 * 1024 * 1024; + * produce high memory use if the descriptor represents a large object. + * + * Use vips_pipe_read_limit_set() to limit the size of object that +- * will be read in this way. The default is 1GB. ++ * will be read in this way. The default is 1GB. + * + * Set a value of -1 to mean no limit. + * +- * See also: `--vips-pipe-read-limit` and the environment variable ++ * See also: `--vips-pipe-read-limit` and the environment variable + * `VIPS_PIPE_READ_LIMIT`. + */ + void +-vips_pipe_read_limit_set( gint64 limit ) ++vips_pipe_read_limit_set(gint64 limit) + { + vips__pipe_read_limit = limit; + } + +-G_DEFINE_TYPE( VipsSource, vips_source, VIPS_TYPE_CONNECTION ); ++G_DEFINE_TYPE(VipsSource, vips_source, VIPS_TYPE_CONNECTION); + + /* Does this source support seek. You must unminimise before calling this. + */ + static int +-vips_source_test_seek( VipsSource *source ) ++vips_source_test_seek(VipsSource *source) + { +- if( !source->have_tested_seek ) { +- VipsSourceClass *class = VIPS_SOURCE_GET_CLASS( source ); ++ if (!source->have_tested_seek) { ++ VipsSourceClass *class = VIPS_SOURCE_GET_CLASS(source); + + source->have_tested_seek = TRUE; + +- VIPS_DEBUG_MSG( "vips_source_can_seek: testing seek ..\n" ); ++ VIPS_DEBUG_MSG("vips_source_can_seek: testing seek ..\n"); + + /* Can we seek this input? + * + * We need to call the method directly rather than via + * vips_source_seek() etc. or we might trigger seek emulation. + */ +- if( source->data || +- class->seek( source, 0, SEEK_CUR ) != -1 ) { ++ if (source->data || ++ class->seek(source, 0, SEEK_CUR) != -1) { + gint64 length; + +- VIPS_DEBUG_MSG( " seekable source\n" ); ++ VIPS_DEBUG_MSG(" seekable source\n"); + +- /* We should be able to get the length of seekable ++ /* We should be able to get the length of seekable + * objects. + */ +- if( (length = vips_source_length( source )) == -1 ) +- return( -1 ); ++ if ((length = vips_source_length(source)) == -1) ++ return (-1); + + source->length = length; + + /* If we can seek, we won't need to save header bytes. + */ +- VIPS_FREEF( g_byte_array_unref, source->header_bytes ); ++ VIPS_FREEF(g_byte_array_unref, source->header_bytes); + } + else { + /* Not seekable. This must be some kind of pipe. + */ +- VIPS_DEBUG_MSG( " not seekable\n" ); ++ VIPS_DEBUG_MSG(" not seekable\n"); + source->is_pipe = TRUE; + } + } + +- return( 0 ); ++ return (0); + } + +-/* We can't test for seekability or length during _build, since the read and +- * seek signal handlers might not have been connected yet. Instead, we test ++/* We can't test for seekability or length during _build, since the read and ++ * seek signal handlers might not have been connected yet. Instead, we test + * when we first need to know. + */ + static int +-vips_source_test_features( VipsSource *source ) ++vips_source_test_features(VipsSource *source) + { +- if( vips_source_unminimise( source ) || +- vips_source_test_seek( source ) ) +- return( -1 ); ++ if (vips_source_unminimise(source) || ++ vips_source_test_seek(source)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + #ifdef TEST_SANITY + static void +-vips_source_sanity( VipsSource *source ) ++vips_source_sanity(VipsSource *source) + { +- if( source->data ) { ++ if (source->data) { + /* Not a pipe (can map and seek). + */ +- g_assert( !source->is_pipe ); ++ g_assert(!source->is_pipe); + + /* Read position must lie within the buffer. + */ +- g_assert( source->read_position >= 0 ); +- g_assert( source->read_position <= source->length ); ++ g_assert(source->read_position >= 0); ++ g_assert(source->read_position <= source->length); + + /* After we're done with the header, the sniff buffer should + * be gone. + */ +- g_assert( !source->decode || +- !source->sniff ); ++ g_assert(!source->decode || ++ !source->sniff); + + /* Have length. + */ +- g_assert( source->length != -1 ); ++ g_assert(source->length != -1); + } +- else if( source->is_pipe ) { +- if( source->decode ) { ++ else if (source->is_pipe) { ++ if (source->decode) { + /* Reading pixel data. + */ +- g_assert( !source->header_bytes ); +- g_assert( !source->sniff ); ++ g_assert(!source->header_bytes); ++ g_assert(!source->sniff); + } + else { + /* Reading header data. + */ +- g_assert( source->header_bytes ); +- g_assert( source->read_position >= 0 ); +- g_assert( source->read_position <= +- source->header_bytes->len ); ++ g_assert(source->header_bytes); ++ g_assert(source->read_position >= 0); ++ g_assert(source->read_position <= ++ source->header_bytes->len); + } + + /* No length available. + */ +- g_assert( source->length == -1 ); ++ g_assert(source->length == -1); + } + else { + /* Something like a seekable file. +@@ -224,166 +224,164 @@ vips_source_sanity( VipsSource *source ) + /* After we're done with the header, the sniff buffer should + * be gone. + */ +- if( source->decode ) { +- g_assert( !source->sniff ); ++ if (source->decode) { ++ g_assert(!source->sniff); + } + +- /* Once we've tested seek, the read position must lie within ++ /* Once we've tested seek, the read position must lie within + * the file. + */ +- if( source->have_tested_seek ) { +- g_assert( source->length != -1 ); +- g_assert( source->read_position >= 0 ); +- g_assert( source->read_position <= source->length ); ++ if (source->have_tested_seek) { ++ g_assert(source->length != -1); ++ g_assert(source->read_position >= 0); ++ g_assert(source->read_position <= source->length); + } + + /* Supports minimise, so if descriptor is -1, we must have a + * filename we can reopen. + */ +- g_assert( VIPS_CONNECTION( source )->descriptor != -1 || +- (VIPS_CONNECTION( source )->filename && +- VIPS_CONNECTION( source )->descriptor) ); ++ g_assert(VIPS_CONNECTION(source)->descriptor != -1 || ++ (VIPS_CONNECTION(source)->filename && ++ VIPS_CONNECTION(source)->descriptor)); + } + } + #endif /*TEST_SANITY*/ + + #ifdef TEST_SANITY +-#define SANITY( S ) vips_source_sanity( S ) ++#define SANITY(S) vips_source_sanity(S) + #warning "sanity tests on in source.c" + #else /*!TEST_SANITY*/ +-#define SANITY( S ) ++#define SANITY(S) + #endif /*TEST_SANITY*/ + + static void +-vips_source_finalize( GObject *gobject ) ++vips_source_finalize(GObject *gobject) + { +- VipsSource *source = VIPS_SOURCE( gobject ); ++ VipsSource *source = VIPS_SOURCE(gobject); + + #ifdef DEBUG_MINIMISE +- printf( "vips_source_finalize: %p\n", source ); ++ printf("vips_source_finalize: %p\n", source); + #endif /*DEBUG_MINIMISE*/ + +- VIPS_FREEF( g_byte_array_unref, source->header_bytes ); +- VIPS_FREEF( g_byte_array_unref, source->sniff ); +- if( source->mmap_baseaddr ) { +- vips__munmap( source->mmap_baseaddr, source->mmap_length ); ++ VIPS_FREEF(g_byte_array_unref, source->header_bytes); ++ VIPS_FREEF(g_byte_array_unref, source->sniff); ++ if (source->mmap_baseaddr) { ++ vips__munmap(source->mmap_baseaddr, source->mmap_length); + source->mmap_baseaddr = NULL; + } + +- G_OBJECT_CLASS( vips_source_parent_class )->finalize( gobject ); ++ G_OBJECT_CLASS(vips_source_parent_class)->finalize(gobject); + } + + static int +-vips_source_build( VipsObject *object ) ++vips_source_build(VipsObject *object) + { +- VipsConnection *connection = VIPS_CONNECTION( object ); +- VipsSource *source = VIPS_SOURCE( object ); ++ VipsConnection *connection = VIPS_CONNECTION(object); ++ VipsSource *source = VIPS_SOURCE(object); + +- VIPS_DEBUG_MSG( "vips_source_build: %p\n", source ); ++ VIPS_DEBUG_MSG("vips_source_build: %p\n", source); + +- if( VIPS_OBJECT_CLASS( vips_source_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_source_parent_class)->build(object)) ++ return (-1); + +- if( vips_object_argument_isset( object, "filename" ) && +- vips_object_argument_isset( object, "descriptor" ) ) { +- vips_error( vips_connection_nick( connection ), +- "%s", _( "don't set 'filename' and 'descriptor'" ) ); +- return( -1 ); ++ if (vips_object_argument_isset(object, "filename") && ++ vips_object_argument_isset(object, "descriptor")) { ++ vips_error(vips_connection_nick(connection), ++ "%s", _("don't set 'filename' and 'descriptor'")); ++ return (-1); + } + + /* unminimise will open the filename. + */ +- if( vips_object_argument_isset( object, "filename" ) && +- vips_source_unminimise( source ) ) +- return( -1 ); ++ if (vips_object_argument_isset(object, "filename") && ++ vips_source_unminimise(source)) ++ return (-1); + +- if( vips_object_argument_isset( object, "descriptor" ) ) { +- connection->descriptor = dup( connection->descriptor ); ++ if (vips_object_argument_isset(object, "descriptor")) { ++ connection->descriptor = dup(connection->descriptor); + connection->close_descriptor = connection->descriptor; + + #ifdef G_OS_WIN32 + /* Windows will create eg. stdin and stdout in text mode. + * We always read in binary mode. + */ +- _setmode( connection->descriptor, _O_BINARY ); ++ _setmode(connection->descriptor, _O_BINARY); + #endif /*G_OS_WIN32*/ + } + +- if( vips_object_argument_isset( object, "blob" ) ) { ++ if (vips_object_argument_isset(object, "blob")) { + size_t length; + +- if( !(source->data = vips_blob_get( source->blob, &length )) ) +- return( -1 ); ++ if (!(source->data = vips_blob_get(source->blob, &length))) ++ return (-1); + +- source->length = VIPS_MIN( length, G_MAXSSIZE ); ++ source->length = VIPS_MIN(length, G_MAXSSIZE); + } + +- return( 0 ); ++ return (0); + } + + static gint64 +-vips_source_read_real( VipsSource *source, void *data, size_t length ) ++vips_source_read_real(VipsSource *source, void *data, size_t length) + { +- VipsConnection *connection = VIPS_CONNECTION( source ); ++ VipsConnection *connection = VIPS_CONNECTION(source); + + gint64 bytes_read; + +- VIPS_DEBUG_MSG( "vips_source_read_real:\n" ); ++ VIPS_DEBUG_MSG("vips_source_read_real:\n"); + +- do { +- bytes_read = read( connection->descriptor, data, length ); +- } while( bytes_read < 0 && errno == EINTR ); ++ do { ++ bytes_read = read(connection->descriptor, data, length); ++ } while (bytes_read < 0 && errno == EINTR); + +- return( bytes_read ); ++ return (bytes_read); + } + + static gint64 +-vips_source_seek_real( VipsSource *source, gint64 offset, int whence ) ++vips_source_seek_real(VipsSource *source, gint64 offset, int whence) + { +- VipsConnection *connection = VIPS_CONNECTION( source ); ++ VipsConnection *connection = VIPS_CONNECTION(source); + +- VIPS_DEBUG_MSG( "vips_source_seek_real:\n" ); ++ VIPS_DEBUG_MSG("vips_source_seek_real:\n"); + + /* Like _read_real(), we must not set a vips_error. We need to use the + * vips__seek() wrapper so we can seek long files on Windows. + */ +- if( connection->descriptor != -1 ) +- return( vips__seek_no_error( connection->descriptor, +- offset, whence ) ); ++ if (connection->descriptor != -1) ++ return (vips__seek_no_error(connection->descriptor, ++ offset, whence)); + +- return( -1 ); ++ return (-1); + } + + static void +-vips_source_class_init( VipsSourceClass *class ) ++vips_source_class_init(VipsSourceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); + + gobject_class->finalize = vips_source_finalize; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "source"; +- object_class->description = _( "input source" ); ++ object_class->description = _("input source"); + + object_class->build = vips_source_build; + + class->read = vips_source_read_real; + class->seek = vips_source_seek_real; + +- VIPS_ARG_BOXED( class, "blob", 3, +- _( "Blob" ), +- _( "Blob to load from" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSource, blob ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "blob", 3, ++ _("Blob"), ++ _("Blob to load from"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsSource, blob), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_source_init( VipsSource *source ) ++vips_source_init(VipsSource *source) + { + source->length = -1; + source->sniff = g_byte_array_new(); +@@ -394,36 +392,36 @@ vips_source_init( VipsSource *source ) + * vips_source_new_from_descriptor: + * @descriptor: read from this file descriptor + * +- * Create an source attached to a file descriptor. @descriptor is +- * closed with close() when source is finalized. ++ * Create an source attached to a file descriptor. @descriptor is ++ * closed with close() when source is finalized. + * + * Returns: a new source. + */ + VipsSource * +-vips_source_new_from_descriptor( int descriptor ) ++vips_source_new_from_descriptor(int descriptor) + { + VipsSource *source; + +- VIPS_DEBUG_MSG( "vips_source_new_from_descriptor: %d\n", +- descriptor ); ++ VIPS_DEBUG_MSG("vips_source_new_from_descriptor: %d\n", ++ descriptor); + +- source = VIPS_SOURCE( g_object_new( VIPS_TYPE_SOURCE, ++ source = VIPS_SOURCE(g_object_new(VIPS_TYPE_SOURCE, + "descriptor", descriptor, +- NULL ) ); ++ NULL)); + +- if( vips_object_build( VIPS_OBJECT( source ) ) ) { +- VIPS_UNREF( source ); +- return( NULL ); ++ if (vips_object_build(VIPS_OBJECT(source))) { ++ VIPS_UNREF(source); ++ return (NULL); + } + +- SANITY( source ); ++ SANITY(source); + +- return( source ); ++ return (source); + } + + /** + * vips_source_new_from_file: +- * @descriptor: read from this filename ++ * @descriptor: read from this filename + * + * Create an source attached to a file. + * +@@ -438,54 +436,54 @@ vips_source_new_from_descriptor( int descriptor ) + * Returns: a new source. + */ + VipsSource * +-vips_source_new_from_file( const char *filename ) ++vips_source_new_from_file(const char *filename) + { + VipsSource *source; + +- VIPS_DEBUG_MSG( "vips_source_new_from_file: %s\n", +- filename ); ++ VIPS_DEBUG_MSG("vips_source_new_from_file: %s\n", ++ filename); + +- source = VIPS_SOURCE( g_object_new( VIPS_TYPE_SOURCE, ++ source = VIPS_SOURCE(g_object_new(VIPS_TYPE_SOURCE, + "filename", filename, +- NULL ) ); ++ NULL)); + +- if( vips_object_build( VIPS_OBJECT( source ) ) ) { +- VIPS_UNREF( source ); +- return( NULL ); ++ if (vips_object_build(VIPS_OBJECT(source))) { ++ VIPS_UNREF(source); ++ return (NULL); + } + +- SANITY( source ); ++ SANITY(source); + +- return( source ); ++ return (source); + } + + /** + * vips_source_new_from_blob: + * @blob: memory area to load + * +- * Create a source attached to an area of memory. ++ * Create a source attached to an area of memory. + * + * Returns: a new source. + */ + VipsSource * +-vips_source_new_from_blob( VipsBlob *blob ) ++vips_source_new_from_blob(VipsBlob *blob) + { + VipsSource *source; + +- VIPS_DEBUG_MSG( "vips_source_new_from_blob: %p\n", blob ); ++ VIPS_DEBUG_MSG("vips_source_new_from_blob: %p\n", blob); + +- source = VIPS_SOURCE( g_object_new( VIPS_TYPE_SOURCE, ++ source = VIPS_SOURCE(g_object_new(VIPS_TYPE_SOURCE, + "blob", blob, +- NULL ) ); ++ NULL)); + +- if( vips_object_build( VIPS_OBJECT( source ) ) ) { +- VIPS_UNREF( source ); +- return( NULL ); ++ if (vips_object_build(VIPS_OBJECT(source))) { ++ VIPS_UNREF(source); ++ return (NULL); + } + +- SANITY( source ); ++ SANITY(source); + +- return( source ); ++ return (source); + } + + /** +@@ -497,37 +495,37 @@ vips_source_new_from_blob( VipsBlob *blob ) + * Returns: a new source. + */ + VipsSource * +-vips_source_new_from_target( VipsTarget *target ) ++vips_source_new_from_target(VipsTarget *target) + { +- VipsConnection *connection = VIPS_CONNECTION( target ); ++ VipsConnection *connection = VIPS_CONNECTION(target); + + VipsSource *source; + +- VIPS_DEBUG_MSG( "vips_source_new_from_target: %p\n", target ); ++ VIPS_DEBUG_MSG("vips_source_new_from_target: %p\n", target); + + /* Flush output buffer, move memory into the blob, etc. + */ +- if( vips_target_end( target ) ) +- return( NULL ); ++ if (vips_target_end(target)) ++ return (NULL); + +- if( connection->descriptor > 0 ) { +- source = vips_source_new_from_descriptor( +- connection->descriptor ); ++ if (connection->descriptor > 0) { ++ source = vips_source_new_from_descriptor( ++ connection->descriptor); + } +- else if( target->memory ) { ++ else if (target->memory) { + VipsBlob *blob; + +- g_object_get( target, "blob", &blob, NULL ); +- source = vips_source_new_from_blob( blob ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ g_object_get(target, "blob", &blob, NULL); ++ source = vips_source_new_from_blob(blob); ++ vips_area_unref(VIPS_AREA(blob)); + } + else { +- vips_error( vips_connection_nick( connection ), +- "%s", _( "unimplemented target" ) ); +- return( NULL ); ++ vips_error(vips_connection_nick(connection), ++ "%s", _("unimplemented target")); ++ return (NULL); + } + +- return( source ); ++ return (source); + } + + /** +@@ -535,32 +533,33 @@ vips_source_new_from_target( VipsTarget *target ) + * @data: memory area to load + * @length: size of memory area + * +- * Create a source attached to an area of memory. ++ * Create a source attached to an area of memory. + * +- * You must not free @data while the source is active. ++ * You must not free @data while the source is active. + * + * Returns: a new source. + */ + VipsSource * +-vips_source_new_from_memory( const void *data, size_t length ) ++vips_source_new_from_memory(const void *data, size_t length) + { + VipsSource *source; + VipsBlob *blob; + +- VIPS_DEBUG_MSG( "vips_source_new_from_buffer: " +- "%p, length = %zd\n", data, length ); ++ VIPS_DEBUG_MSG("vips_source_new_from_buffer: " ++ "%p, length = %zd\n", ++ data, length); + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, data, length ); ++ blob = vips_blob_new(NULL, data, length); + +- source = vips_source_new_from_blob( blob ); ++ source = vips_source_new_from_blob(blob); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- SANITY( source ); ++ SANITY(source); + +- return( source ); ++ return (source); + } + + /** +@@ -572,23 +571,23 @@ vips_source_new_from_memory( const void *data, size_t length ) + * Returns: a new source. + */ + VipsSource * +-vips_source_new_from_options( const char *options ) ++vips_source_new_from_options(const char *options) + { + VipsSource *source; + +- VIPS_DEBUG_MSG( "vips_source_new_from_options: %s\n", options ); ++ VIPS_DEBUG_MSG("vips_source_new_from_options: %s\n", options); + +- source = VIPS_SOURCE( g_object_new( VIPS_TYPE_SOURCE, NULL ) ); ++ source = VIPS_SOURCE(g_object_new(VIPS_TYPE_SOURCE, NULL)); + +- if( vips_object_set_from_string( VIPS_OBJECT( source ), options ) || +- vips_object_build( VIPS_OBJECT( source ) ) ) { +- VIPS_UNREF( source ); +- return( NULL ); ++ if (vips_object_set_from_string(VIPS_OBJECT(source), options) || ++ vips_object_build(VIPS_OBJECT(source))) { ++ VIPS_UNREF(source); ++ return (NULL); + } + +- SANITY( source ); ++ SANITY(source); + +- return( source ); ++ return (source); + } + + /** +@@ -603,37 +602,37 @@ vips_source_new_from_options( const char *options ) + * image. + */ + void +-vips_source_minimise( VipsSource *source ) ++vips_source_minimise(VipsSource *source) + { +- VipsConnection *connection = VIPS_CONNECTION( source ); ++ VipsConnection *connection = VIPS_CONNECTION(source); + +- SANITY( source ); ++ SANITY(source); + +- (void) vips_source_test_features( source ); ++ (void) vips_source_test_features(source); + +- if( connection->filename && ++ if (connection->filename && + connection->descriptor != -1 && + connection->tracked_descriptor == connection->descriptor && +- !source->is_pipe ) { ++ !source->is_pipe) { + #ifdef DEBUG_MINIMISE +- printf( "vips_source_minimise: %p %s\n", ++ printf("vips_source_minimise: %p %s\n", + source, +- vips_connection_nick( VIPS_CONNECTION( source ) ) ); ++ vips_connection_nick(VIPS_CONNECTION(source))); + #endif /*DEBUG_MINIMISE*/ + +- vips_tracked_close( connection->tracked_descriptor ); ++ vips_tracked_close(connection->tracked_descriptor); + connection->tracked_descriptor = -1; + connection->descriptor = -1; + } + +- SANITY( source ); ++ SANITY(source); + } + + /** + * vips_source_unminimise: + * @source: source to operate on + * +- * Restore the source after minimisation. This is called at the start ++ * Restore the source after minimisation. This is called at the start + * of every source method, so loaders should not usually need this. + * + * See also: vips_source_minimise(). +@@ -641,55 +640,55 @@ vips_source_minimise( VipsSource *source ) + * Returns: 0 on success, or -1 on error. + */ + int +-vips_source_unminimise( VipsSource *source ) ++vips_source_unminimise(VipsSource *source) + { +- VipsConnection *connection = VIPS_CONNECTION( source ); ++ VipsConnection *connection = VIPS_CONNECTION(source); + +- if( connection->descriptor == -1 && ++ if (connection->descriptor == -1 && + connection->tracked_descriptor == -1 && +- connection->filename ) { ++ connection->filename) { + int fd; + + #ifdef DEBUG_MINIMISE +- printf( "vips_source_unminimise: %p %s\n", ++ printf("vips_source_unminimise: %p %s\n", + source, +- vips_connection_nick( VIPS_CONNECTION( source ) ) ); ++ vips_connection_nick(VIPS_CONNECTION(source))); + #endif /*DEBUG_MINIMISE*/ + +- if( (fd = vips_tracked_open( connection->filename, +- MODE_READ, 0 )) == -1 ) { +- vips_error_system( errno, +- vips_connection_nick( connection ), +- "%s", _( "unable to open for read" ) ); +- return( -1 ); ++ if ((fd = vips_tracked_open(connection->filename, ++ MODE_READ, 0)) == -1) { ++ vips_error_system(errno, ++ vips_connection_nick(connection), ++ "%s", _("unable to open for read")); ++ return (-1); + } + + connection->tracked_descriptor = fd; + connection->descriptor = fd; + +- if( vips_source_test_seek( source ) ) +- return( -1 ); ++ if (vips_source_test_seek(source)) ++ return (-1); + + /* It might be a named pipe. + */ +- if( !source->is_pipe ) { +- VIPS_DEBUG_MSG( "vips_source_unminimise: restoring " +- "read position %" G_GINT64_FORMAT "\n", +- source->read_position ); +- if( vips__seek( connection->descriptor, +- source->read_position, SEEK_SET ) == -1 ) +- return( -1 ); ++ if (!source->is_pipe) { ++ VIPS_DEBUG_MSG("vips_source_unminimise: restoring " ++ "read position %" G_GINT64_FORMAT "\n", ++ source->read_position); ++ if (vips__seek(connection->descriptor, ++ source->read_position, SEEK_SET) == -1) ++ return (-1); + } + } + +- return( 0 ); ++ return (0); + } + + /** + * vips_source_decode: + * @source: source to operate on + * +- * Signal the end of header read and the start of the pixel decode phase. ++ * Signal the end of header read and the start of the pixel decode phase. + * After this, you can no longer seek on this source. + * + * Loaders should call this at the end of header read. +@@ -699,45 +698,45 @@ vips_source_unminimise( VipsSource *source ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_source_decode( VipsSource *source ) ++vips_source_decode(VipsSource *source) + { +- VIPS_DEBUG_MSG( "vips_source_decode:\n" ); ++ VIPS_DEBUG_MSG("vips_source_decode:\n"); + +- SANITY( source ); ++ SANITY(source); + +- if( !source->decode ) { ++ if (!source->decode) { + source->decode = TRUE; + +- VIPS_FREEF( g_byte_array_unref, source->sniff ); ++ VIPS_FREEF(g_byte_array_unref, source->sniff); + +- /* Now decode is set, header_bytes will be freed once it's ++ /* Now decode is set, header_bytes will be freed once it's + * exhausted, see vips_source_read(). + */ + } + +- vips_source_minimise( source ); ++ vips_source_minimise(source); + +- SANITY( source ); ++ SANITY(source); + +- return( 0 ); ++ return (0); + } + + #ifdef VIPS_DEBUG + static void +-vips_source_print( VipsSource *source ) ++vips_source_print(VipsSource *source) + { +- printf( "vips_source_print: %p\n", source ); +- printf( " source->read_position = %zd\n", source->read_position ); +- printf( " source->is_pipe = %d\n", source->is_pipe ); +- printf( " source->length = %zd\n", source->length ); +- printf( " source->data = %p\n", source->data ); +- printf( " source->header_bytes = %p\n", source->header_bytes ); +- if( source->header_bytes ) +- printf( " source->header_bytes->len = %d\n", +- source->header_bytes->len ); +- printf( " source->sniff = %p\n", source->sniff ); +- if( source->sniff ) +- printf( " source->sniff->len = %d\n", source->sniff->len ); ++ printf("vips_source_print: %p\n", source); ++ printf(" source->read_position = %zd\n", source->read_position); ++ printf(" source->is_pipe = %d\n", source->is_pipe); ++ printf(" source->length = %zd\n", source->length); ++ printf(" source->data = %p\n", source->data); ++ printf(" source->header_bytes = %p\n", source->header_bytes); ++ if (source->header_bytes) ++ printf(" source->header_bytes->len = %d\n", ++ source->header_bytes->len); ++ printf(" source->sniff = %p\n", source->sniff); ++ if (source->sniff) ++ printf(" source->sniff->len = %d\n", source->sniff->len); + } + #endif /*VIPS_DEBUG*/ + +@@ -748,7 +747,7 @@ vips_source_print( VipsSource *source ) + * @length: length of @buffer in bytes + * + * Read up to @length bytes from @source and store the bytes in @buffer. +- * Return the number of bytes actually read. If all bytes have been read from ++ * Return the number of bytes actually read. If all bytes have been read from + * the file, return 0. + * + * Arguments exactly as read(2). +@@ -756,52 +755,52 @@ vips_source_print( VipsSource *source ) + * Returns: the number of bytes read, 0 on end of file, -1 on error. + */ + gint64 +-vips_source_read( VipsSource *source, void *buffer, size_t length ) ++vips_source_read(VipsSource *source, void *buffer, size_t length) + { +- VipsSourceClass *class = VIPS_SOURCE_GET_CLASS( source ); ++ VipsSourceClass *class = VIPS_SOURCE_GET_CLASS(source); + + gint64 total_read; + +- VIPS_DEBUG_MSG( "vips_source_read:\n" ); ++ VIPS_DEBUG_MSG("vips_source_read:\n"); + +- SANITY( source ); ++ SANITY(source); + +- if( vips_source_unminimise( source ) || +- vips_source_test_features( source ) ) +- return( -1 ); ++ if (vips_source_unminimise(source) || ++ vips_source_test_features(source)) ++ return (-1); + + total_read = 0; + +- if( source->data ) { ++ if (source->data) { + /* The whole thing is in memory somehow. + */ +- gint64 available = VIPS_MIN( length, +- source->length - source->read_position ); ++ gint64 available = VIPS_MIN(length, ++ source->length - source->read_position); + +- VIPS_DEBUG_MSG( " %zd bytes from memory\n", available ); +- memcpy( buffer, +- source->data + source->read_position, available ); ++ VIPS_DEBUG_MSG(" %zd bytes from memory\n", available); ++ memcpy(buffer, ++ source->data + source->read_position, available); + source->read_position += available; + total_read += available; + } + else { +- /* Some kind of filesystem or custom source. ++ /* Some kind of filesystem or custom source. + * +- * Get what we can from header_bytes. We may need to read ++ * Get what we can from header_bytes. We may need to read + * some more after this. + */ +- if( source->header_bytes && +- source->read_position < source->header_bytes->len ) { +- gint64 available = VIPS_MIN( length, +- source->header_bytes->len - +- source->read_position ); +- +- VIPS_DEBUG_MSG( " %zd bytes from cache\n", +- available ); +- memcpy( buffer, +- source->header_bytes->data + +- source->read_position, +- available ); ++ if (source->header_bytes && ++ source->read_position < source->header_bytes->len) { ++ gint64 available = VIPS_MIN(length, ++ source->header_bytes->len - ++ source->read_position); ++ ++ VIPS_DEBUG_MSG(" %zd bytes from cache\n", ++ available); ++ memcpy(buffer, ++ source->header_bytes->data + ++ source->read_position, ++ available); + source->read_position += available; + buffer += available; + length -= available; +@@ -811,51 +810,51 @@ vips_source_read( VipsSource *source, void *buffer, size_t length ) + /* We're in pixel decode mode and we've exhausted the header + * cache. We can safely junk it. + */ +- if( source->decode && ++ if (source->decode && + source->header_bytes && +- source->read_position >= source->header_bytes->len ) +- VIPS_FREEF( g_byte_array_unref, source->header_bytes ); ++ source->read_position >= source->header_bytes->len) ++ VIPS_FREEF(g_byte_array_unref, source->header_bytes); + + /* Any more bytes requested? Call the read() vfunc. + */ +- if( length > 0 ) { ++ if (length > 0) { + gint64 bytes_read; + +- VIPS_DEBUG_MSG( " calling class->read()\n" ); +- bytes_read = class->read( source, buffer, length ); +- VIPS_DEBUG_MSG( " %zd bytes from read()\n", +- bytes_read ); +- if( bytes_read == -1 ) { +- vips_error_system( errno, +- vips_connection_nick( +- VIPS_CONNECTION( source ) ), +- "%s", _( "read error" ) ); +- return( -1 ); ++ VIPS_DEBUG_MSG(" calling class->read()\n"); ++ bytes_read = class->read(source, buffer, length); ++ VIPS_DEBUG_MSG(" %zd bytes from read()\n", ++ bytes_read); ++ if (bytes_read == -1) { ++ vips_error_system(errno, ++ vips_connection_nick( ++ VIPS_CONNECTION(source)), ++ "%s", _("read error")); ++ return (-1); + } + +- /* We need to save bytes if we're in header mode and ++ /* We need to save bytes if we're in header mode and + * we can't seek or map. + */ +- if( source->header_bytes && ++ if (source->header_bytes && + source->is_pipe && + !source->decode && +- bytes_read > 0 ) +- g_byte_array_append( source->header_bytes, +- buffer, bytes_read ); ++ bytes_read > 0) ++ g_byte_array_append(source->header_bytes, ++ buffer, bytes_read); + + source->read_position += bytes_read; + total_read += bytes_read; + } + } + +- VIPS_DEBUG_MSG( " %zd bytes total\n", total_read ); ++ VIPS_DEBUG_MSG(" %zd bytes total\n", total_read); + +- SANITY( source ); ++ SANITY(source); + +- return( total_read ); ++ return (total_read); + } + +-/* Read to a position. ++/* Read to a position. + * + * target == -1 means read to end of source -- useful for forcing a pipe into + * memory, for example. This will always set length to the pipe length. +@@ -866,27 +865,27 @@ vips_source_read( VipsSource *source, void *buffer, size_t length ) + * read_position is left somewhere indeterminate. + */ + static int +-vips_source_pipe_read_to_position( VipsSource *source, gint64 target ) ++vips_source_pipe_read_to_position(VipsSource *source, gint64 target) + { +- const char *nick = vips_connection_nick( VIPS_CONNECTION( source ) ); ++ const char *nick = vips_connection_nick(VIPS_CONNECTION(source)); + + unsigned char buffer[4096]; + + /* This is only useful for pipes (sources where we don't know the + * length). + */ +- g_assert( source->length == -1 ); +- g_assert( source->is_pipe ); ++ g_assert(source->length == -1); ++ g_assert(source->is_pipe); + +- while( target == -1 || +- source->read_position < target ) { ++ while (target == -1 || ++ source->read_position < target) { + gint64 bytes_read; + +- bytes_read = vips_source_read( source, buffer, 4096 ); +- if( bytes_read == -1 ) +- return( -1 ); ++ bytes_read = vips_source_read(source, buffer, 4096); ++ if (bytes_read == -1) ++ return (-1); + +- if( bytes_read == 0 ) { ++ if (bytes_read == 0) { + /* No more bytes available, we must be at EOF. + */ + source->length = source->read_position; +@@ -894,67 +893,67 @@ vips_source_pipe_read_to_position( VipsSource *source, gint64 target ) + /* Have we been buffering the whole thing? We can + * become a memory source. + */ +- if( source->header_bytes ) { ++ if (source->header_bytes) { + source->data = source->header_bytes->data; + source->is_pipe = FALSE; + + /* TODO ... we could close more fds here. + */ +- vips_source_minimise( source ); ++ vips_source_minimise(source); + } + + break; + } + +- if( target == -1 && ++ if (target == -1 && + vips__pipe_read_limit != -1 && +- source->read_position > vips__pipe_read_limit ) { +- vips_error( nick, "%s", _( "pipe too long" ) ); +- return( -1 ); ++ source->read_position > vips__pipe_read_limit) { ++ vips_error(nick, "%s", _("pipe too long")); ++ return (-1); + } + } + +- return( 0 ); ++ return (0); + } + + /* Convert a seekable source that can't be mapped (eg. a custom input with a +- * seek method) into a memory source. ++ * seek method) into a memory source. + */ + static int +-vips_source_read_to_memory( VipsSource *source ) ++vips_source_read_to_memory(VipsSource *source) + { + GByteArray *byte_array; + gint64 read_position; + unsigned char *q; + +- VIPS_DEBUG_MSG( "vips_source_read_to_memory:\n" ); ++ VIPS_DEBUG_MSG("vips_source_read_to_memory:\n"); + +- g_assert( !source->is_pipe ); +- g_assert( !source->blob ); +- g_assert( !source->header_bytes ); +- g_assert( source->length >= 0 ); ++ g_assert(!source->is_pipe); ++ g_assert(!source->blob); ++ g_assert(!source->header_bytes); ++ g_assert(source->length >= 0); + +- if( vips_source_rewind( source ) ) +- return( -1 ); ++ if (vips_source_rewind(source)) ++ return (-1); + + /* We know the length, so we can size the buffer correctly and read + * directly to it. + */ + byte_array = g_byte_array_new(); +- g_byte_array_set_size( byte_array, source->length ); ++ g_byte_array_set_size(byte_array, source->length); + + read_position = 0; + q = byte_array->data; +- while( read_position < source->length ) { ++ while (read_position < source->length) { + gint64 bytes_read; + +- bytes_read = vips_source_read( source, q, +- VIPS_MAX( 4096, source->length - read_position ) ); +- if( bytes_read == -1 ) { +- VIPS_FREEF( g_byte_array_unref, byte_array ); +- return( -1 ); ++ bytes_read = vips_source_read(source, q, ++ VIPS_MAX(4096, source->length - read_position)); ++ if (bytes_read == -1) { ++ VIPS_FREEF(g_byte_array_unref, byte_array); ++ return (-1); + } +- if( bytes_read == 0 ) ++ if (bytes_read == 0) + break; + + read_position += bytes_read; +@@ -970,31 +969,31 @@ vips_source_read_to_memory( VipsSource *source ) + source->is_pipe = FALSE; + source->header_bytes = byte_array; + +- vips_source_minimise( source ); ++ vips_source_minimise(source); + +- return( 0 ); ++ return (0); + } + + static int +-vips_source_descriptor_to_memory( VipsSource *source ) ++vips_source_descriptor_to_memory(VipsSource *source) + { +- VipsConnection *connection = VIPS_CONNECTION( source ); ++ VipsConnection *connection = VIPS_CONNECTION(source); + +- VIPS_DEBUG_MSG( "vips_source_descriptor_to_memory:\n" ); ++ VIPS_DEBUG_MSG("vips_source_descriptor_to_memory:\n"); + +- g_assert( !source->blob ); +- g_assert( !source->mmap_baseaddr ); ++ g_assert(!source->blob); ++ g_assert(!source->mmap_baseaddr); + +- if( !(source->mmap_baseaddr = vips__mmap( connection->descriptor, +- FALSE, source->length, 0 )) ) +- return( -1 ); ++ if (!(source->mmap_baseaddr = vips__mmap(connection->descriptor, ++ FALSE, source->length, 0))) ++ return (-1); + + /* And it's now a memory source. + */ + source->data = source->mmap_baseaddr; + source->mmap_length = source->length; + +- return( 0 ); ++ return (0); + } + + /** +@@ -1007,20 +1006,20 @@ vips_source_descriptor_to_memory( VipsSource *source ) + * + * Returns: %TRUE if the source can be efficiently mapped into memory. + */ +-gboolean +-vips_source_is_mappable( VipsSource *source ) ++gboolean ++vips_source_is_mappable(VipsSource *source) + { +- if( vips_source_unminimise( source ) || +- vips_source_test_features( source ) ) +- return( -1 ); ++ if (vips_source_unminimise(source) || ++ vips_source_test_features(source)) ++ return (-1); + + /* Already a memory object, or there's a filename we can map, or + * there's a seekable descriptor. + */ +- return( source->data || +- VIPS_CONNECTION( source )->filename || +- (!source->is_pipe && +- VIPS_CONNECTION( source )->descriptor != -1) ); ++ return (source->data || ++ VIPS_CONNECTION(source)->filename || ++ (!source->is_pipe && ++ VIPS_CONNECTION(source)->descriptor != -1)); + } + + /** +@@ -1036,17 +1035,17 @@ vips_source_is_mappable( VipsSource *source ) + * + * Returns: %TRUE if the source is a simple file. + */ +-gboolean +-vips_source_is_file( VipsSource *source ) ++gboolean ++vips_source_is_file(VipsSource *source) + { +- if( vips_source_unminimise( source ) || +- vips_source_test_features( source ) ) +- return( -1 ); ++ if (vips_source_unminimise(source) || ++ vips_source_test_features(source)) ++ return (-1); + + /* There's a filename, and it supports seek. + */ +- return( VIPS_CONNECTION( source )->filename && +- !source->is_pipe ); ++ return (VIPS_CONNECTION(source)->filename && ++ !source->is_pipe); + } + + /** +@@ -1057,7 +1056,7 @@ vips_source_is_file( VipsSource *source ) + * Map the source entirely into memory and return a pointer to the + * start. If @length_out is non-NULL, the source size is written to it. + * +- * This operation can take a long time. Use vips_source_is_mappable() to ++ * This operation can take a long time. Use vips_source_is_mappable() to + * check if a source can be mapped efficiently. + * + * The pointer is valid for as long as @source is alive. +@@ -1065,53 +1064,53 @@ vips_source_is_file( VipsSource *source ) + * Returns: a pointer to the start of the file contents, or NULL on error. + */ + const void * +-vips_source_map( VipsSource *source, size_t *length_out ) ++vips_source_map(VipsSource *source, size_t *length_out) + { +- VIPS_DEBUG_MSG( "vips_source_map:\n" ); ++ VIPS_DEBUG_MSG("vips_source_map:\n"); + +- SANITY( source ); ++ SANITY(source); + +- if( vips_source_unminimise( source ) || +- vips_source_test_features( source ) ) +- return( NULL ); ++ if (vips_source_unminimise(source) || ++ vips_source_test_features(source)) ++ return (NULL); + + /* Try to map the file into memory, if possible. Some filesystems have + * mmap disabled, so we don't give up if this fails. + */ +- if( !source->data && +- vips_source_is_mappable( source ) ) +- (void) vips_source_descriptor_to_memory( source ); ++ if (!source->data && ++ vips_source_is_mappable(source)) ++ (void) vips_source_descriptor_to_memory(source); + + /* If it's not a pipe, we can rewind, get the length, and read the + * whole thing. + */ +- if( !source->data && ++ if (!source->data && + !source->is_pipe && +- vips_source_read_to_memory( source ) ) +- return( NULL ); ++ vips_source_read_to_memory(source)) ++ return (NULL); + + /* We don't know the length and must read and assemble in chunks. + */ +- if( !source->data && +- vips_source_pipe_read_to_position( source, -1 ) ) +- return( NULL ); ++ if (!source->data && ++ vips_source_pipe_read_to_position(source, -1)) ++ return (NULL); + +- if( length_out ) ++ if (length_out) + *length_out = source->length; + +- SANITY( source ); ++ SANITY(source); + +- return( source->data ); ++ return (source->data); + } + + static int +-vips_source_map_cb( void *a, VipsArea *area ) ++vips_source_map_cb(void *a, VipsArea *area) + { +- GObject *gobject = G_OBJECT( area->client ); ++ GObject *gobject = G_OBJECT(area->client); + +- VIPS_UNREF( gobject ); ++ VIPS_UNREF(gobject); + +- return( 0 ); ++ return (0); + } + + /** +@@ -1124,23 +1123,23 @@ vips_source_map_cb( void *a, VipsArea *area ) + * Returns: a new #VipsBlob containing the data, or NULL on error. + */ + VipsBlob * +-vips_source_map_blob( VipsSource *source ) ++vips_source_map_blob(VipsSource *source) + { + const void *buf; + size_t len; + VipsBlob *blob; + +- if( !(buf = vips_source_map( source, &len )) || +- !(blob = vips_blob_new( (VipsCallbackFn) vips_source_map_cb, +- buf, len )) ) +- return( NULL ); ++ if (!(buf = vips_source_map(source, &len)) || ++ !(blob = vips_blob_new((VipsCallbackFn) vips_source_map_cb, ++ buf, len))) ++ return (NULL); + + /* The source must stay alive until the blob is done. + */ +- g_object_ref( source ); +- VIPS_AREA( blob )->client = source; ++ g_object_ref(source); ++ VIPS_AREA(blob)->client = source; + +- return( blob ); ++ return (blob); + } + + /** +@@ -1155,22 +1154,23 @@ vips_source_map_blob( VipsSource *source ) + * Returns: the new file position, or -1 on error. + */ + gint64 +-vips_source_seek( VipsSource *source, gint64 offset, int whence ) ++vips_source_seek(VipsSource *source, gint64 offset, int whence) + { +- const char *nick = vips_connection_nick( VIPS_CONNECTION( source ) ); +- VipsSourceClass *class = VIPS_SOURCE_GET_CLASS( source ); ++ const char *nick = vips_connection_nick(VIPS_CONNECTION(source)); ++ VipsSourceClass *class = VIPS_SOURCE_GET_CLASS(source); + + gint64 new_pos; + +- VIPS_DEBUG_MSG( "vips_source_seek: offset = %" G_GINT64_FORMAT +- ", whence = %d\n", offset, whence ); ++ VIPS_DEBUG_MSG("vips_source_seek: offset = %" G_GINT64_FORMAT ++ ", whence = %d\n", ++ offset, whence); + +- if( vips_source_unminimise( source ) || +- vips_source_test_features( source ) ) +- return( -1 ); ++ if (vips_source_unminimise(source) || ++ vips_source_test_features(source)) ++ return (-1); + +- if( source->data ) { +- switch( whence ) { ++ if (source->data) { ++ switch (whence) { + case SEEK_SET: + new_pos = offset; + break; +@@ -1184,12 +1184,12 @@ vips_source_seek( VipsSource *source, gint64 offset, int whence ) + break; + + default: +- vips_error( nick, "%s", _( "bad 'whence'" ) ); +- return( -1 ); ++ vips_error(nick, "%s", _("bad 'whence'")); ++ return (-1); + } + } +- else if( source->is_pipe ) { +- switch( whence ) { ++ else if (source->is_pipe) { ++ switch (whence) { + case SEEK_SET: + new_pos = offset; + break; +@@ -1202,51 +1202,51 @@ vips_source_seek( VipsSource *source, gint64 offset, int whence ) + /* We have to read the whole source into memory to get + * the length. + */ +- if( vips_source_pipe_read_to_position( source, -1 ) ) +- return( -1 ); ++ if (vips_source_pipe_read_to_position(source, -1)) ++ return (-1); + + new_pos = source->length + offset; + break; + + default: +- vips_error( nick, "%s", _( "bad 'whence'" ) ); +- return( -1 ); ++ vips_error(nick, "%s", _("bad 'whence'")); ++ return (-1); + } + } + else { +- if( (new_pos = class->seek( source, offset, whence )) == -1 ) +- return( -1 ); ++ if ((new_pos = class->seek(source, offset, whence)) == -1) ++ return (-1); + } + + /* For pipes, we have to fake seek by reading to that point. This + * might hit EOF and turn the pipe into a memory source. + */ +- if( source->is_pipe && +- vips_source_pipe_read_to_position( source, new_pos ) ) +- return( -1 ); ++ if (source->is_pipe && ++ vips_source_pipe_read_to_position(source, new_pos)) ++ return (-1); + + /* Don't allow out of range seeks. + */ +- if( new_pos < 0 || +- (source->length != -1 && +- new_pos > source->length) ) { +- vips_error( nick, +- _( "bad seek to %" G_GINT64_FORMAT ), new_pos ); +- return( -1 ); ++ if (new_pos < 0 || ++ (source->length != -1 && ++ new_pos > source->length)) { ++ vips_error(nick, ++ _("bad seek to %" G_GINT64_FORMAT), new_pos); ++ return (-1); + } + + source->read_position = new_pos; + +- VIPS_DEBUG_MSG( " new_pos = %" G_GINT64_FORMAT "\n", new_pos ); ++ VIPS_DEBUG_MSG(" new_pos = %" G_GINT64_FORMAT "\n", new_pos); + +- return( new_pos ); ++ return (new_pos); + } + + /** + * vips_source_rewind: + * @source: source to operate on + * +- * Rewind the source to the start. ++ * Rewind the source to the start. + * + * You can't always do this after the pixel decode phase starts -- for + * example, pipe-like sources can't be rewound. +@@ -1254,25 +1254,25 @@ vips_source_seek( VipsSource *source, gint64 offset, int whence ) + * Returns: 0 on success, or -1 on error. + */ + int +-vips_source_rewind( VipsSource *source ) ++vips_source_rewind(VipsSource *source) + { +- VIPS_DEBUG_MSG( "vips_source_rewind:\n" ); ++ VIPS_DEBUG_MSG("vips_source_rewind:\n"); + +- SANITY( source ); ++ SANITY(source); + +- if( vips_source_test_features( source ) || +- vips_source_seek( source, 0, SEEK_SET ) != 0 ) +- return( -1 ); ++ if (vips_source_test_features(source) || ++ vips_source_seek(source, 0, SEEK_SET) != 0) ++ return (-1); + + /* Back into sniff + header decode state. + */ + source->decode = FALSE; +- if( !source->sniff ) ++ if (!source->sniff) + source->sniff = g_byte_array_new(); + +- SANITY( source ); ++ SANITY(source); + +- return( 0 ); ++ return (0); + } + + /** +@@ -1280,84 +1280,84 @@ vips_source_rewind( VipsSource *source ) + * @source: source to operate on + * + * Return the length in bytes of the source. Unseekable sources, for +- * example pipes, will have to be read entirely into memory before the length ++ * example pipes, will have to be read entirely into memory before the length + * can be found, so this operation can take a long time. + * + * Returns: number of bytes in source, or -1 on error. + */ + gint64 +-vips_source_length( VipsSource *source ) ++vips_source_length(VipsSource *source) + { + gint64 length; + gint64 read_position; + +- VIPS_DEBUG_MSG( "vips_source_length:\n" ); ++ VIPS_DEBUG_MSG("vips_source_length:\n"); + +- if( vips_source_test_features( source ) ) +- return( -1 ); ++ if (vips_source_test_features(source)) ++ return (-1); + +- read_position = vips_source_seek( source, 0, SEEK_CUR ); +- length = vips_source_seek( source, 0, SEEK_END ); +- vips_source_seek( source, read_position, SEEK_SET ); ++ read_position = vips_source_seek(source, 0, SEEK_CUR); ++ length = vips_source_seek(source, 0, SEEK_END); ++ vips_source_seek(source, read_position, SEEK_SET); + +- return( length ); ++ return (length); + } + + /** +- * vips_source_sniff_at_most: ++ * vips_source_sniff_at_most: + * @source: peek this source + * @data: return a pointer to the bytes read here + * @length: max number of bytes to read + * +- * Attempt to sniff at most @length bytes from the start of the source. A +- * pointer to the bytes is returned in @data. The number of bytes actually ++ * Attempt to sniff at most @length bytes from the start of the source. A ++ * pointer to the bytes is returned in @data. The number of bytes actually + * read is returned -- it may be less than @length if the file is shorter than + * @length. A negative number indicates a read error. + * + * Returns: number of bytes read, or -1 on error. + */ + gint64 +-vips_source_sniff_at_most( VipsSource *source, +- unsigned char **data, size_t length ) ++vips_source_sniff_at_most(VipsSource *source, ++ unsigned char **data, size_t length) + { + unsigned char *q; + gint64 read_position; + +- VIPS_DEBUG_MSG( "vips_source_sniff_at_most: %zd bytes\n", length ); ++ VIPS_DEBUG_MSG("vips_source_sniff_at_most: %zd bytes\n", length); + +- SANITY( source ); ++ SANITY(source); + +- if( vips_source_test_features( source ) || +- vips_source_rewind( source ) ) +- return( -1 ); ++ if (vips_source_test_features(source) || ++ vips_source_rewind(source)) ++ return (-1); + +- g_byte_array_set_size( source->sniff, length ); ++ g_byte_array_set_size(source->sniff, length); + +- read_position = 0; ++ read_position = 0; + q = source->sniff->data; +- while( read_position < length ) { ++ while (read_position < length) { + gint64 bytes_read; + +- bytes_read = vips_source_read( source, q, +- length - read_position ); +- if( bytes_read == -1 ) +- return( -1 ); +- if( bytes_read == 0 ) ++ bytes_read = vips_source_read(source, q, ++ length - read_position); ++ if (bytes_read == -1) ++ return (-1); ++ if (bytes_read == 0) + break; + + read_position += bytes_read; + q += bytes_read; + } + +- SANITY( source ); ++ SANITY(source); + + *data = source->sniff->data; + +- return( read_position ); ++ return (read_position); + } + + /** +- * vips_source_sniff: ++ * vips_source_sniff: + * @source: sniff this source + * @length: number of bytes to sniff + * +@@ -1367,19 +1367,19 @@ vips_source_sniff_at_most( VipsSource *source, + * Returns: a pointer to the bytes at the start of the file, or NULL on error. + */ + unsigned char * +-vips_source_sniff( VipsSource *source, size_t length ) ++vips_source_sniff(VipsSource *source, size_t length) + { + unsigned char *data; + gint64 bytes_read; + +- if( vips_source_test_features( source ) ) +- return( NULL ); ++ if (vips_source_test_features(source)) ++ return (NULL); + +- bytes_read = vips_source_sniff_at_most( source, &data, length ); +- if( bytes_read == -1 ) +- return( NULL ); +- if( bytes_read < length ) +- return( NULL ); ++ bytes_read = vips_source_sniff_at_most(source, &data, length); ++ if (bytes_read == -1) ++ return (NULL); ++ if (bytes_read < length) ++ return (NULL); + +- return( data ); ++ return (data); + } +diff --git a/libvips/iofuncs/sourcecustom.c b/libvips/iofuncs/sourcecustom.c +index 937033724a..3345388f0f 100644 +--- a/libvips/iofuncs/sourcecustom.c ++++ b/libvips/iofuncs/sourcecustom.c +@@ -1,33 +1,33 @@ + /* A Source subclass with signals you can easily hook up to other input + * sources. +- * ++ * + * J.Cupitt, 21/11/19 + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -57,108 +57,108 @@ + + #include "vipsmarshal.h" + +-G_DEFINE_TYPE( VipsSourceCustom, vips_source_custom, VIPS_TYPE_SOURCE ); ++G_DEFINE_TYPE(VipsSourceCustom, vips_source_custom, VIPS_TYPE_SOURCE); + +-/* Our signals. ++/* Our signals. + */ + enum { +- SIG_SEEK, +- SIG_READ, ++ SIG_SEEK, ++ SIG_READ, + SIG_LAST + }; + + static guint vips_source_custom_signals[SIG_LAST] = { 0 }; + + static gint64 +-vips_source_custom_read_real( VipsSource *source, +- void *buffer, size_t length ) ++vips_source_custom_read_real(VipsSource *source, ++ void *buffer, size_t length) + { + gint64 bytes_read; + +- VIPS_DEBUG_MSG( "vips_source_custom_read_real:\n" ); ++ VIPS_DEBUG_MSG("vips_source_custom_read_real:\n"); + + /* Return this value (error) if there's no attached handler. + */ + bytes_read = 0; + +- g_signal_emit( source, vips_source_custom_signals[SIG_READ], 0, +- buffer, (gint64) length, &bytes_read ); ++ g_signal_emit(source, vips_source_custom_signals[SIG_READ], 0, ++ buffer, (gint64) length, &bytes_read); + +- VIPS_DEBUG_MSG( " vips_source_custom_read_real, seen %zd bytes\n", +- bytes_read ); ++ VIPS_DEBUG_MSG(" vips_source_custom_read_real, seen %zd bytes\n", ++ bytes_read); + +- return( bytes_read ); ++ return (bytes_read); + } + + static gint64 +-vips_source_custom_seek_real( VipsSource *source, +- gint64 offset, int whence ) ++vips_source_custom_seek_real(VipsSource *source, ++ gint64 offset, int whence) + { + GValue args[3] = { { 0 } }; + GValue result = { 0 }; + gint64 new_position; + +- VIPS_DEBUG_MSG( "vips_source_custom_seek_real:\n" ); ++ VIPS_DEBUG_MSG("vips_source_custom_seek_real:\n"); + + /* Set the signal args. + */ +- g_value_init( &args[0], G_TYPE_OBJECT ); +- g_value_set_object( &args[0], source ); +- g_value_init( &args[1], G_TYPE_INT64 ); +- g_value_set_int64( &args[1], offset ); +- g_value_init( &args[2], G_TYPE_INT ); +- g_value_set_int( &args[2], whence ); ++ g_value_init(&args[0], G_TYPE_OBJECT); ++ g_value_set_object(&args[0], source); ++ g_value_init(&args[1], G_TYPE_INT64); ++ g_value_set_int64(&args[1], offset); ++ g_value_init(&args[2], G_TYPE_INT); ++ g_value_set_int(&args[2], whence); + + /* Set the default value if no handlers are attached. + */ +- g_value_init( &result, G_TYPE_INT64 ); +- g_value_set_int64( &result, -1 ); ++ g_value_init(&result, G_TYPE_INT64); ++ g_value_set_int64(&result, -1); + +- /* We need to use this signal interface since we want a default value ++ /* We need to use this signal interface since we want a default value + * if no handlers are attached. + */ +- g_signal_emitv( (const GValue *) &args, +- vips_source_custom_signals[SIG_SEEK], 0, &result ); ++ g_signal_emitv((const GValue *) &args, ++ vips_source_custom_signals[SIG_SEEK], 0, &result); + +- new_position = g_value_get_int64( &result ); ++ new_position = g_value_get_int64(&result); + +- g_value_unset( &args[0] ); +- g_value_unset( &args[1] ); +- g_value_unset( &args[2] ); +- g_value_unset( &result ); ++ g_value_unset(&args[0]); ++ g_value_unset(&args[1]); ++ g_value_unset(&args[2]); ++ g_value_unset(&result); + +- VIPS_DEBUG_MSG( " vips_source_custom_seek_real, seen new pos %zd\n", +- new_position ); ++ VIPS_DEBUG_MSG(" vips_source_custom_seek_real, seen new pos %zd\n", ++ new_position); + +- return( new_position ); ++ return (new_position); + } + + static gint64 +-vips_source_custom_read_signal_real( VipsSourceCustom *source_custom, +- void *data, gint64 length ) ++vips_source_custom_read_signal_real(VipsSourceCustom *source_custom, ++ void *data, gint64 length) + { +- VIPS_DEBUG_MSG( "vips_source_custom_read_signal_real:\n" ); ++ VIPS_DEBUG_MSG("vips_source_custom_read_signal_real:\n"); + +- return( 0 ); ++ return (0); + } + + static gint64 +-vips_source_custom_seek_signal_real( VipsSourceCustom *source_custom, +- gint64 offset, int whence ) ++vips_source_custom_seek_signal_real(VipsSourceCustom *source_custom, ++ gint64 offset, int whence) + { +- VIPS_DEBUG_MSG( "vips_source_custom_seek_signal_real:\n" ); ++ VIPS_DEBUG_MSG("vips_source_custom_seek_signal_real:\n"); + +- return( -1 ); ++ return (-1); + } + + static void +-vips_source_custom_class_init( VipsSourceCustomClass *class ) ++vips_source_custom_class_init(VipsSourceCustomClass *class) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); +- VipsSourceClass *source_class = VIPS_SOURCE_CLASS( class ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); ++ VipsSourceClass *source_class = VIPS_SOURCE_CLASS(class); + + object_class->nickname = "source_custom"; +- object_class->description = _( "Custom source" ); ++ object_class->description = _("Custom source"); + + source_class->read = vips_source_custom_read_real; + source_class->seek = vips_source_custom_seek_real; +@@ -176,14 +176,14 @@ vips_source_custom_class_init( VipsSourceCustomClass *class ) + * + * Returns: the number of bytes read. Return 0 for EOF. + */ +- vips_source_custom_signals[SIG_READ] = g_signal_new( "read", +- G_TYPE_FROM_CLASS( class ), ++ vips_source_custom_signals[SIG_READ] = g_signal_new("read", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_ACTION, +- G_STRUCT_OFFSET( VipsSourceCustomClass, read ), ++ G_STRUCT_OFFSET(VipsSourceCustomClass, read), + NULL, NULL, + vips_INT64__POINTER_INT64, + G_TYPE_INT64, 2, +- G_TYPE_POINTER, G_TYPE_INT64 ); ++ G_TYPE_POINTER, G_TYPE_INT64); + + /** + * VipsSourceCustom::seek: +@@ -198,19 +198,18 @@ vips_source_custom_class_init( VipsSourceCustomClass *class ) + * + * Returns: the new seek position. + */ +- vips_source_custom_signals[SIG_SEEK] = g_signal_new( "seek", +- G_TYPE_FROM_CLASS( class ), ++ vips_source_custom_signals[SIG_SEEK] = g_signal_new("seek", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_ACTION, +- G_STRUCT_OFFSET( VipsSourceCustomClass, seek ), ++ G_STRUCT_OFFSET(VipsSourceCustomClass, seek), + NULL, NULL, + vips_INT64__INT64_INT, + G_TYPE_INT64, 2, +- G_TYPE_INT64, G_TYPE_INT ); +- ++ G_TYPE_INT64, G_TYPE_INT); + } + + static void +-vips_source_custom_init( VipsSourceCustom *source_custom ) ++vips_source_custom_init(VipsSourceCustom *source_custom) + { + } + +@@ -222,19 +221,19 @@ vips_source_custom_init( VipsSourceCustom *source_custom ) + * Returns: a new #VipsSourceCustom + */ + VipsSourceCustom * +-vips_source_custom_new( void ) ++vips_source_custom_new(void) + { + VipsSourceCustom *source_custom; + +- VIPS_DEBUG_MSG( "vips_source_custom_new:\n" ); ++ VIPS_DEBUG_MSG("vips_source_custom_new:\n"); + + source_custom = VIPS_SOURCE_CUSTOM( +- g_object_new( VIPS_TYPE_SOURCE_CUSTOM, NULL ) ); ++ g_object_new(VIPS_TYPE_SOURCE_CUSTOM, NULL)); + +- if( vips_object_build( VIPS_OBJECT( source_custom ) ) ) { +- VIPS_UNREF( source_custom ); +- return( NULL ); ++ if (vips_object_build(VIPS_OBJECT(source_custom))) { ++ VIPS_UNREF(source_custom); ++ return (NULL); + } + +- return( source_custom ); ++ return (source_custom); + } +diff --git a/libvips/iofuncs/sourceginput.c b/libvips/iofuncs/sourceginput.c +index d5fb6e7f76..f53f8dfde0 100644 +--- a/libvips/iofuncs/sourceginput.c ++++ b/libvips/iofuncs/sourceginput.c +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -54,15 +54,15 @@ + + #include "vipsmarshal.h" + +-G_DEFINE_TYPE( VipsSourceGInputStream, vips_source_g_input_stream, +- VIPS_TYPE_SOURCE ); ++G_DEFINE_TYPE(VipsSourceGInputStream, vips_source_g_input_stream, ++ VIPS_TYPE_SOURCE); + + /* TODO: + * - some more docs + */ + + /* This will only be useful for memory and pipe-style streams. It's not +- * possible to get filename or filenos from GInputStream objects. ++ * possible to get filename or filenos from GInputStream objects. + * Without those two bits of information, important VipsSource features like + * mmap and openslide load will not work. + * +@@ -71,169 +71,168 @@ G_DEFINE_TYPE( VipsSourceGInputStream, vips_source_g_input_stream, + */ + + static int +-vips_source_g_input_stream_build( VipsObject *object ) ++vips_source_g_input_stream_build(VipsObject *object) + { +- VipsSource *source = VIPS_SOURCE( object ); +- VipsSourceGInputStream *source_ginput = +- VIPS_SOURCE_G_INPUT_STREAM( source ); ++ VipsSource *source = VIPS_SOURCE(object); ++ VipsSourceGInputStream *source_ginput = ++ VIPS_SOURCE_G_INPUT_STREAM(source); + GError *error = NULL; + +- VIPS_DEBUG_MSG( "vips_source_g_input_stream_build: %p\n", source ); ++ VIPS_DEBUG_MSG("vips_source_g_input_stream_build: %p\n", source); + +- if( VIPS_OBJECT_CLASS( vips_source_g_input_stream_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_source_g_input_stream_parent_class)->build(object)) ++ return (-1); + +- if( G_IS_FILE_INPUT_STREAM( source_ginput->stream ) ) { ++ if (G_IS_FILE_INPUT_STREAM(source_ginput->stream)) { + const char *name; + + /* It's unclear if this will ever produce useful output. + */ +- if( !(source_ginput->info = g_file_input_stream_query_info( +- G_FILE_INPUT_STREAM( source_ginput->stream ), +- G_FILE_ATTRIBUTE_STANDARD_NAME, +- NULL, &error )) ) { +- vips_g_error( &error ); +- return( -1 ); ++ if (!(source_ginput->info = g_file_input_stream_query_info( ++ G_FILE_INPUT_STREAM(source_ginput->stream), ++ G_FILE_ATTRIBUTE_STANDARD_NAME, ++ NULL, &error))) { ++ vips_g_error(&error); ++ return (-1); + } + + #ifdef VIPS_DEBUG +-{ +- char **attributes; +- int i; +- +- /* Swap G_FILE_ATTRIBUTE_STANDARD_NAME above for "*" to get a +- * list of all available attributes. +- */ +- attributes = g_file_info_list_attributes( +- source_ginput->info, NULL ); +- printf( "stream attributes:\n" ); +- for( i = 0; attributes[i]; i++ ) { +- char *name = attributes[i]; +- char *value; +- +- value = g_file_info_get_attribute_as_string( +- source_ginput->info, name ); +- printf( "\t%s = %s\n", name, value ); +- g_free( value ); ++ { ++ char **attributes; ++ int i; ++ ++ /* Swap G_FILE_ATTRIBUTE_STANDARD_NAME above for "*" to get a ++ * list of all available attributes. ++ */ ++ attributes = g_file_info_list_attributes( ++ source_ginput->info, NULL); ++ printf("stream attributes:\n"); ++ for (i = 0; attributes[i]; i++) { ++ char *name = attributes[i]; ++ char *value; ++ ++ value = g_file_info_get_attribute_as_string( ++ source_ginput->info, name); ++ printf("\t%s = %s\n", name, value); ++ g_free(value); ++ } ++ g_strfreev(attributes); + } +- g_strfreev( attributes ); +-} + #endif /*VIPS_DEBUG*/ + +- if( (name = g_file_info_get_name( source_ginput->info )) ) +- g_object_set( object, ++ if ((name = g_file_info_get_name(source_ginput->info))) ++ g_object_set(object, + "filename", name, +- NULL ); +- } ++ NULL); ++ } + +- if( G_IS_SEEKABLE( source_ginput->stream ) && +- g_seekable_can_seek( G_SEEKABLE( source_ginput->stream ) ) ) +- source_ginput->seekable = G_SEEKABLE( source_ginput->stream ); ++ if (G_IS_SEEKABLE(source_ginput->stream) && ++ g_seekable_can_seek(G_SEEKABLE(source_ginput->stream))) ++ source_ginput->seekable = G_SEEKABLE(source_ginput->stream); + +- return( 0 ); ++ return (0); + } + + static gint64 +-vips_source_g_input_stream_read( VipsSource *source, +- void *buffer, size_t length ) ++vips_source_g_input_stream_read(VipsSource *source, ++ void *buffer, size_t length) + { +- VipsSourceGInputStream *source_ginput = +- VIPS_SOURCE_G_INPUT_STREAM( source ); ++ VipsSourceGInputStream *source_ginput = ++ VIPS_SOURCE_G_INPUT_STREAM(source); + GError *error = NULL; + + gint64 bytes_read; + +- VIPS_DEBUG_MSG( "vips_source_g_input_stream_read: %zd bytes\n", +- length ); ++ VIPS_DEBUG_MSG("vips_source_g_input_stream_read: %zd bytes\n", ++ length); + + /* Do we need to loop on this call? The docs are unclear. + */ +- if( (bytes_read = g_input_stream_read( source_ginput->stream, +- buffer, length, NULL, &error )) < 0 ) { +- VIPS_DEBUG_MSG( " %s\n", error->message ); +- vips_g_error( &error ); +- return( -1 ); ++ if ((bytes_read = g_input_stream_read(source_ginput->stream, ++ buffer, length, NULL, &error)) < 0) { ++ VIPS_DEBUG_MSG(" %s\n", error->message); ++ vips_g_error(&error); ++ return (-1); + } + +- VIPS_DEBUG_MSG( " (returned %zd bytes)\n", bytes_read ); ++ VIPS_DEBUG_MSG(" (returned %zd bytes)\n", bytes_read); + +- return( bytes_read ); ++ return (bytes_read); + } + + static GSeekType +-lseek_to_seek_type( int whence ) ++lseek_to_seek_type(int whence) + { +- switch( whence ) { ++ switch (whence) { + default: + case SEEK_CUR: +- return( G_SEEK_CUR ); ++ return (G_SEEK_CUR); + case SEEK_SET: +- return( G_SEEK_SET ); ++ return (G_SEEK_SET); + case SEEK_END: +- return( G_SEEK_END ); ++ return (G_SEEK_END); + } + } + + static gint64 +-vips_source_g_input_stream_seek( VipsSource *source, gint64 offset, int whence ) ++vips_source_g_input_stream_seek(VipsSource *source, gint64 offset, int whence) + { +- VipsSourceGInputStream *source_ginput = +- VIPS_SOURCE_G_INPUT_STREAM( source ); +- GSeekType type = lseek_to_seek_type( whence ); ++ VipsSourceGInputStream *source_ginput = ++ VIPS_SOURCE_G_INPUT_STREAM(source); ++ GSeekType type = lseek_to_seek_type(whence); + GError *error = NULL; + + gint64 new_position; + +- VIPS_DEBUG_MSG( "vips_source_g_input_stream_seek: " +- "offset = %zd, whence = %d\n", offset, whence ); ++ VIPS_DEBUG_MSG("vips_source_g_input_stream_seek: " ++ "offset = %zd, whence = %d\n", ++ offset, whence); + +- if( source_ginput->seekable ) { +- if( !g_seekable_seek( source_ginput->seekable, +- offset, type, NULL, &error ) ) { +- vips_g_error( &error ); +- return( -1 ); ++ if (source_ginput->seekable) { ++ if (!g_seekable_seek(source_ginput->seekable, ++ offset, type, NULL, &error)) { ++ vips_g_error(&error); ++ return (-1); + } + +- new_position = g_seekable_tell( source_ginput->seekable ); ++ new_position = g_seekable_tell(source_ginput->seekable); + } + else + new_position = -1; + +- VIPS_DEBUG_MSG( " (new position = %zd)\n", new_position ); ++ VIPS_DEBUG_MSG(" (new position = %zd)\n", new_position); + +- return( new_position ); ++ return (new_position); + } + + static void +-vips_source_g_input_stream_class_init( VipsSourceGInputStreamClass *class ) ++vips_source_g_input_stream_class_init(VipsSourceGInputStreamClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); +- VipsSourceClass *source_class = VIPS_SOURCE_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); ++ VipsSourceClass *source_class = VIPS_SOURCE_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "source_g_input_stream"; +- object_class->description = _( "GInputStream source" ); ++ object_class->description = _("GInputStream source"); + + object_class->build = vips_source_g_input_stream_build; + + source_class->read = vips_source_g_input_stream_read; + source_class->seek = vips_source_g_input_stream_seek; + +- VIPS_ARG_OBJECT( class, "stream", 3, +- _( "Stream" ), +- _( "GInputStream to read from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsSourceGInputStream, stream ), +- G_TYPE_INPUT_STREAM ); +- ++ VIPS_ARG_OBJECT(class, "stream", 3, ++ _("Stream"), ++ _("GInputStream to read from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsSourceGInputStream, stream), ++ G_TYPE_INPUT_STREAM); + } + + static void +-vips_source_g_input_stream_init( VipsSourceGInputStream *source ) ++vips_source_g_input_stream_init(VipsSourceGInputStream *source) + { + } + +@@ -246,21 +245,21 @@ vips_source_g_input_stream_init( VipsSourceGInputStream *source ) + * Returns: the new source. + */ + VipsSourceGInputStream * +-vips_source_g_input_stream_new( GInputStream *stream ) ++vips_source_g_input_stream_new(GInputStream *stream) + { + VipsSourceGInputStream *source; + +- VIPS_DEBUG_MSG( "vips_source_g_input_stream_new:\n" ); ++ VIPS_DEBUG_MSG("vips_source_g_input_stream_new:\n"); + +- source = VIPS_SOURCE_G_INPUT_STREAM( +- g_object_new( VIPS_TYPE_SOURCE_G_INPUT_STREAM, ++ source = VIPS_SOURCE_G_INPUT_STREAM( ++ g_object_new(VIPS_TYPE_SOURCE_G_INPUT_STREAM, + "stream", stream, +- NULL ) ); ++ NULL)); + +- if( vips_object_build( VIPS_OBJECT( source ) ) ) { +- VIPS_UNREF( source ); +- return( NULL ); ++ if (vips_object_build(VIPS_OBJECT(source))) { ++ VIPS_UNREF(source); ++ return (NULL); + } + +- return( source ); ++ return (source); + } +diff --git a/libvips/iofuncs/system.c b/libvips/iofuncs/system.c +index a923cc2d2c..2290952ee5 100644 +--- a/libvips/iofuncs/system.c ++++ b/libvips/iofuncs/system.c +@@ -26,28 +26,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -97,32 +97,32 @@ typedef struct _VipsSystem { + + typedef VipsOperationClass VipsSystemClass; + +-G_DEFINE_TYPE( VipsSystem, vips_system, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsSystem, vips_system, VIPS_TYPE_OPERATION); + + static void +-vips_system_dispose( GObject *gobject ) ++vips_system_dispose(GObject *gobject) + { + VipsSystem *system = (VipsSystem *) gobject; + +- if( system->in_name ) { ++ if (system->in_name) { + int i; + +- for( i = 0; i < VIPS_AREA( system->in )->n; i++ ) { +- g_unlink( system->in_name[i] ); +- VIPS_FREE( system->in_name[i] ); ++ for (i = 0; i < VIPS_AREA(system->in)->n; i++) { ++ g_unlink(system->in_name[i]); ++ VIPS_FREE(system->in_name[i]); + } + } + +- VIPS_FREE( system->out_name ); +- VIPS_FREE( system->out_name_options ); ++ VIPS_FREE(system->out_name); ++ VIPS_FREE(system->out_name_options); + +- G_OBJECT_CLASS( vips_system_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_system_parent_class)->dispose(gobject); + } + + static int +-vips_system_build( VipsObject *object ) ++vips_system_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsSystem *system = (VipsSystem *) object; + + int i; +@@ -135,189 +135,187 @@ vips_system_build( VipsObject *object ) + int result; + GError *error = NULL; + +- if( VIPS_OBJECT_CLASS( vips_system_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_system_parent_class)->build(object)) ++ return (-1); + + /* Write the input images to files. We must always make copies of the +- * files, even if this image is a disc file already, in case the ++ * files, even if this image is a disc file already, in case the + * command needs a different format. + */ +- if( system->in ) { +- char *in_format = system->in_format ? +- system->in_format : "%s.tif"; ++ if (system->in) { ++ char *in_format = system->in_format ? system->in_format : "%s.tif"; + int n; +- VipsImage **in = vips_array_image_get( system->in, &n ); +- +- if( !(system->in_name = VIPS_ARRAY( object, n, char * )) ) +- return( -1 ); +- memset( system->in_name, 0, n * sizeof( char * ) ); +- for( i = 0; i < n; i++ ) { +- if( !(system->in_name[i] = +- vips__temp_name( in_format )) ) +- return( -1 ); +- if( vips_image_write_to_file( in[i], +- system->in_name[i], NULL ) ) +- return( -1 ); ++ VipsImage **in = vips_array_image_get(system->in, &n); ++ ++ if (!(system->in_name = VIPS_ARRAY(object, n, char *))) ++ return (-1); ++ memset(system->in_name, 0, n * sizeof(char *)); ++ for (i = 0; i < n; i++) { ++ if (!(system->in_name[i] = ++ vips__temp_name(in_format))) ++ return (-1); ++ if (vips_image_write_to_file(in[i], ++ system->in_name[i], NULL)) ++ return (-1); + } + } + + /* Make the output filename. + */ +- if( system->out_format ) { ++ if (system->out_format) { + char filename[VIPS_PATH_MAX]; + char option_string[VIPS_PATH_MAX]; + +- vips__filename_split8( system->out_format, +- filename, option_string ); +- if( !(system->out_name = vips__temp_name( filename )) ) +- return( -1 ); +- system->out_name_options = +- g_strconcat( system->out_name, option_string, NULL ); ++ vips__filename_split8(system->out_format, ++ filename, option_string); ++ if (!(system->out_name = vips__temp_name(filename))) ++ return (-1); ++ system->out_name_options = ++ g_strconcat(system->out_name, option_string, NULL); + } + +- vips_strncpy( cmd, system->cmd_format, VIPS_PATH_MAX ); +- if( system->in ) +- for( i = 0; i < VIPS_AREA( system->in )->n; i++ ) +- if( vips__substitute( cmd, VIPS_PATH_MAX, +- system->in_name[i] ) ) { +- vips_error( class->nickname, "%s", +- _( "unable to substitute " +- "input filename" ) ); +- return( -1 ); ++ vips_strncpy(cmd, system->cmd_format, VIPS_PATH_MAX); ++ if (system->in) ++ for (i = 0; i < VIPS_AREA(system->in)->n; i++) ++ if (vips__substitute(cmd, VIPS_PATH_MAX, ++ system->in_name[i])) { ++ vips_error(class->nickname, "%s", ++ _("unable to substitute " ++ "input filename")); ++ return (-1); + } +- if( system->out_name && +- vips__substitute( cmd, VIPS_PATH_MAX, system->out_name ) ) { +- vips_error( class->nickname, "%s", +- _( "unable to substitute output filename" ) ); +- return( -1 ); ++ if (system->out_name && ++ vips__substitute(cmd, VIPS_PATH_MAX, system->out_name)) { ++ vips_error(class->nickname, "%s", ++ _("unable to substitute output filename")); ++ return (-1); + } + + /* Swap all "%%" in the string for a single "%". We need this for + * compatibility with older printf-based vips_system()s which + * needed a double %%. + */ +- for( p = cmd; *p; p++ ) +- if( p[0] == '%' && +- p[1] == '%' ) +- memmove( p, p + 1, strlen( p ) ); +- +- if( !g_spawn_command_line_sync( cmd, +- &std_output, &std_error, &result, &error ) || +- result ) { +- if( error ) { +- vips_error( class->nickname, "%s", error->message ); +- g_error_free( error ); ++ for (p = cmd; *p; p++) ++ if (p[0] == '%' && ++ p[1] == '%') ++ memmove(p, p + 1, strlen(p)); ++ ++ if (!g_spawn_command_line_sync(cmd, ++ &std_output, &std_error, &result, &error) || ++ result) { ++ if (error) { ++ vips_error(class->nickname, "%s", error->message); ++ g_error_free(error); + } +- if( std_error ) { +- vips__chomp( std_error ); +- if( strcmp( std_error, "" ) != 0 ) +- vips_error( class->nickname, +- "error output: %s", std_error ); +- VIPS_FREE( std_error ); ++ if (std_error) { ++ vips__chomp(std_error); ++ if (strcmp(std_error, "") != 0) ++ vips_error(class->nickname, ++ "error output: %s", std_error); ++ VIPS_FREE(std_error); + } +- if( std_output ) { +- vips__chomp( std_output ); +- if( strcmp( std_output, "" ) != 0 ) +- vips_error( class->nickname, +- "output: %s", std_output ); +- VIPS_FREE( std_output ); ++ if (std_output) { ++ vips__chomp(std_output); ++ if (strcmp(std_output, "") != 0) ++ vips_error(class->nickname, ++ "output: %s", std_output); ++ VIPS_FREE(std_output); + } +- vips_error_system( result, class->nickname, +- _( "command \"%s\" failed" ), cmd ); ++ vips_error_system(result, class->nickname, ++ _("command \"%s\" failed"), cmd); + +- return( -1 ); ++ return (-1); + } + +- if( std_error ) { +- vips__chomp( std_error ); +- if( strcmp( std_error, "" ) != 0 ) +- g_warning( _( "stderr output: %s" ), std_error ); ++ if (std_error) { ++ vips__chomp(std_error); ++ if (strcmp(std_error, "") != 0) ++ g_warning(_("stderr output: %s"), std_error); + } +- if( std_output ) { +- vips__chomp( std_output ); +- g_object_set( system, "log", std_output, NULL ); ++ if (std_output) { ++ vips__chomp(std_output); ++ g_object_set(system, "log", std_output, NULL); + } + +- VIPS_FREE( std_output ); +- VIPS_FREE( std_error ); ++ VIPS_FREE(std_output); ++ VIPS_FREE(std_error); + +- if( system->out_name_options ) { +- VipsImage *out; ++ if (system->out_name_options) { ++ VipsImage *out; + +- if( !(out = vips_image_new_from_file( system->out_name_options, +- NULL )) ) +- return( -1 ); +- vips_image_set_delete_on_close( out, TRUE ); +- g_object_set( system, "out", out, NULL ); ++ if (!(out = vips_image_new_from_file(system->out_name_options, ++ NULL))) ++ return (-1); ++ vips_image_set_delete_on_close(out, TRUE); ++ g_object_set(system, "out", out, NULL); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_system_class_init( VipsSystemClass *class ) ++vips_system_class_init(VipsSystemClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->dispose = vips_system_dispose; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "system"; +- vobject_class->description = _( "run an external command" ); ++ vobject_class->description = _("run an external command"); + vobject_class->build = vips_system_build; + +- /* Commands can have side-effects, so don't cache them. ++ /* Commands can have side-effects, so don't cache them. + */ + operation_class->flags |= VIPS_OPERATION_NOCACHE; + +- VIPS_ARG_BOXED( class, "in", 0, +- _( "Input" ), +- _( "Array of input images" ), ++ VIPS_ARG_BOXED(class, "in", 0, ++ _("Input"), ++ _("Array of input images"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSystem, in ), +- VIPS_TYPE_ARRAY_IMAGE ); +- +- VIPS_ARG_IMAGE( class, "out", 1, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsSystem, out ) ); +- +- VIPS_ARG_STRING( class, "cmd_format", 2, +- _( "Command" ), +- _( "Command to run" ), ++ G_STRUCT_OFFSET(VipsSystem, in), ++ VIPS_TYPE_ARRAY_IMAGE); ++ ++ VIPS_ARG_IMAGE(class, "out", 1, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_OPTIONAL_OUTPUT, ++ G_STRUCT_OFFSET(VipsSystem, out)); ++ ++ VIPS_ARG_STRING(class, "cmd_format", 2, ++ _("Command"), ++ _("Command to run"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsSystem, cmd_format ), +- NULL ); ++ G_STRUCT_OFFSET(VipsSystem, cmd_format), ++ NULL); + +- VIPS_ARG_STRING( class, "in_format", 2, +- _( "Input format" ), +- _( "Format for input filename" ), ++ VIPS_ARG_STRING(class, "in_format", 2, ++ _("Input format"), ++ _("Format for input filename"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSystem, in_format ), +- NULL ); ++ G_STRUCT_OFFSET(VipsSystem, in_format), ++ NULL); + +- VIPS_ARG_STRING( class, "out_format", 2, +- _( "Output format" ), +- _( "Format for output filename" ), ++ VIPS_ARG_STRING(class, "out_format", 2, ++ _("Output format"), ++ _("Format for output filename"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSystem, out_format ), +- NULL ); ++ G_STRUCT_OFFSET(VipsSystem, out_format), ++ NULL); + +- VIPS_ARG_STRING( class, "log", 2, +- _( "Log" ), +- _( "Command log" ), ++ VIPS_ARG_STRING(class, "log", 2, ++ _("Log"), ++ _("Command log"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsSystem, log ), +- NULL ); +- ++ G_STRUCT_OFFSET(VipsSystem, log), ++ NULL); + } + + static void +-vips_system_init( VipsSystem *system ) ++vips_system_init(VipsSystem *system) + { + } + +@@ -334,32 +332,32 @@ vips_system_init( VipsSystem *system ) + * * @out_format: write output filename like this + * * @log: stdout of command is returned here + * +- * vips_system() runs a command, optionally passing a set of images in and +- * optionally getting an image back. The command's stdout is returned in @log. ++ * vips_system() runs a command, optionally passing a set of images in and ++ * optionally getting an image back. The command's stdout is returned in @log. + * + * First, if @in is set, the array of images are written to files. See +- * vips_image_new_temp_file() to see how temporary files are created. ++ * vips_image_new_temp_file() to see how temporary files are created. + * If @in_format is + * something like %s.png, the file will be written in PNG format. By +- * default, @in_format is %s.tif. ++ * default, @in_format is %s.tif. + * + * If @out_format is set, an output filename is formed in the same way. Any +- * trailing [options] are stripped from @out_format. ++ * trailing [options] are stripped from @out_format. + * +- * The command string to run is made by substituting the first set of %s +- * in @cmd_format for the names of the input files, if @in is set, and then +- * the next %s for the output filename, if @out_format is set. +- * You can put a number between the % and the s to change the order ++ * The command string to run is made by substituting the first set of %s ++ * in @cmd_format for the names of the input files, if @in is set, and then ++ * the next %s for the output filename, if @out_format is set. ++ * You can put a number between the % and the s to change the order + * in which the substitution occurs. + * +- * The command is executed with popen() and the output captured in @log. ++ * The command is executed with popen() and the output captured in @log. + * + * After the command finishes, if @out_format is set, the output image is + * opened and returned in @out. You can append [options] to @out_format to +- * control how this open happens. ++ * control how this open happens. + * Closing @out image will automatically delete the output file. + * +- * Finally the input images are deleted. ++ * Finally the input images are deleted. + * + * For example, this call will run the ImageMagick convert program on an + * image, using JPEG files to pass images into and out of the convert command. +@@ -370,26 +368,26 @@ vips_system_init( VipsSystem *system ) + * char *log; + * + * if (vips_system ("convert %s -swirl 45 %s", +- * "in", in, +- * "out", &out, +- * "in_format", "%s.jpg", +- * "out_format", "%s.jpg", ++ * "in", in, ++ * "out", &out, ++ * "in_format", "%s.jpg", ++ * "out_format", "%s.jpg", + * "log", &log, + * NULL)) + * error ... + * ]| + * +- * Returns: 0 on success, -1 on failure. ++ * Returns: 0 on success, -1 on failure. + */ + int +-vips_system( const char *cmd_format, ... ) ++vips_system(const char *cmd_format, ...) + { + va_list ap; + int result; + +- va_start( ap, cmd_format ); +- result = vips_call_split( "system", ap, cmd_format ); +- va_end( ap ); ++ va_start(ap, cmd_format); ++ result = vips_call_split("system", ap, cmd_format); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/iofuncs/target.c b/libvips/iofuncs/target.c +index 2cc1f2fe60..56a964b5b8 100644 +--- a/libvips/iofuncs/target.c ++++ b/libvips/iofuncs/target.c +@@ -1,6 +1,6 @@ +-/* A byte source/sink .. it can be a pipe, file descriptor, memory area, ++/* A byte source/sink .. it can be a pipe, file descriptor, memory area, + * socket, node.js stream, etc. +- * ++ * + * J.Cupitt, 19/6/14 + * + * 26/11/20 +@@ -10,28 +10,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -67,127 +67,127 @@ + /* libtiff needs to be able to seek and read back output files, unfortunately, + * so we must open read-write. + */ +-#define MODE_READWRITE CLOEXEC (BINARYIZE (O_RDWR | O_CREAT | O_TRUNC)) ++#define MODE_READWRITE CLOEXEC(BINARYIZE(O_RDWR | O_CREAT | O_TRUNC)) + +-G_DEFINE_TYPE( VipsTarget, vips_target, VIPS_TYPE_CONNECTION ); ++G_DEFINE_TYPE(VipsTarget, vips_target, VIPS_TYPE_CONNECTION); + + static void +-vips_target_finalize( GObject *gobject ) ++vips_target_finalize(GObject *gobject) + { +- VipsTarget *target = VIPS_TARGET( gobject ); ++ VipsTarget *target = VIPS_TARGET(gobject); + +- VIPS_DEBUG_MSG( "vips_target_finalize:\n" ); ++ VIPS_DEBUG_MSG("vips_target_finalize:\n"); + +- if( target->memory_buffer ) { +- g_string_free( target->memory_buffer, TRUE ); ++ if (target->memory_buffer) { ++ g_string_free(target->memory_buffer, TRUE); + target->memory_buffer = NULL; + } + +- if( target->blob ) { +- vips_area_unref( VIPS_AREA( target->blob ) ); ++ if (target->blob) { ++ vips_area_unref(VIPS_AREA(target->blob)); + target->blob = NULL; + } + +- if( target->delete_on_close && +- target->delete_on_close_filename ) +- g_unlink( target->delete_on_close_filename ); ++ if (target->delete_on_close && ++ target->delete_on_close_filename) ++ g_unlink(target->delete_on_close_filename); + +- VIPS_FREE( target->delete_on_close_filename ); ++ VIPS_FREE(target->delete_on_close_filename); + +- G_OBJECT_CLASS( vips_target_parent_class )->finalize( gobject ); ++ G_OBJECT_CLASS(vips_target_parent_class)->finalize(gobject); + } + + static int +-vips_target_build( VipsObject *object ) ++vips_target_build(VipsObject *object) + { +- VipsConnection *connection = VIPS_CONNECTION( object ); +- VipsTarget *target = VIPS_TARGET( object ); ++ VipsConnection *connection = VIPS_CONNECTION(object); ++ VipsTarget *target = VIPS_TARGET(object); + +- VIPS_DEBUG_MSG( "vips_target_build: %p\n", connection ); ++ VIPS_DEBUG_MSG("vips_target_build: %p\n", connection); + +- if( VIPS_OBJECT_CLASS( vips_target_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_target_parent_class)->build(object)) ++ return (-1); + +- if( vips_object_argument_isset( object, "filename" ) && +- vips_object_argument_isset( object, "descriptor" ) ) { +- vips_error( vips_connection_nick( connection ), +- "%s", _( "don't set 'filename' and 'descriptor'" ) ); +- return( -1 ); ++ if (vips_object_argument_isset(object, "filename") && ++ vips_object_argument_isset(object, "descriptor")) { ++ vips_error(vips_connection_nick(connection), ++ "%s", _("don't set 'filename' and 'descriptor'")); ++ return (-1); + } + +- if( connection->filename ) { ++ if (connection->filename) { + const char *filename = connection->filename; + + int fd; + + /* 0644 is rw user, r group and other. + */ +- if( (fd = vips_tracked_open( filename, +- MODE_READWRITE, 0644 )) == -1 ) { +- vips_error_system( errno, +- vips_connection_nick( connection ), +- "%s", _( "unable to open for write" ) ); +- return( -1 ); ++ if ((fd = vips_tracked_open(filename, ++ MODE_READWRITE, 0644)) == -1) { ++ vips_error_system(errno, ++ vips_connection_nick(connection), ++ "%s", _("unable to open for write")); ++ return (-1); + } + + connection->tracked_descriptor = fd; + connection->descriptor = fd; + } +- else if( vips_object_argument_isset( object, "descriptor" ) ) { +- connection->descriptor = dup( connection->descriptor ); ++ else if (vips_object_argument_isset(object, "descriptor")) { ++ connection->descriptor = dup(connection->descriptor); + connection->close_descriptor = connection->descriptor; + + #ifdef G_OS_WIN32 + /* Windows will create eg. stdin and stdout in text mode. + * We always write in binary mode. + */ +- _setmode( connection->descriptor, _O_BINARY ); ++ _setmode(connection->descriptor, _O_BINARY); + #endif /*G_OS_WIN32*/ + } +- else if( target->memory ) +- target->memory_buffer = +- g_string_sized_new( VIPS_TARGET_BUFFER_SIZE ); ++ else if (target->memory) ++ target->memory_buffer = ++ g_string_sized_new(VIPS_TARGET_BUFFER_SIZE); + +- return( 0 ); ++ return (0); + } + +-static gint64 +-vips_target_write_real( VipsTarget *target, const void *data, size_t length ) ++static gint64 ++vips_target_write_real(VipsTarget *target, const void *data, size_t length) + { +- VipsConnection *connection = VIPS_CONNECTION( target ); ++ VipsConnection *connection = VIPS_CONNECTION(target); + + gint64 result; + +- VIPS_DEBUG_MSG( "vips_target_write_real: %zd bytes\n", length ); ++ VIPS_DEBUG_MSG("vips_target_write_real: %zd bytes\n", length); + +- if( target->memory_buffer ) { +- VIPS_DEBUG_MSG( "vips_target_write_real: to position %zd\n", +- target->position ); ++ if (target->memory_buffer) { ++ VIPS_DEBUG_MSG("vips_target_write_real: to position %zd\n", ++ target->position); + +- g_string_overwrite_len( target->memory_buffer, target->position, +- data, length ); ++ g_string_overwrite_len(target->memory_buffer, target->position, ++ data, length); + target->position += length; + result = length; + } + else +- result = write( connection->descriptor, data, length ); ++ result = write(connection->descriptor, data, length); + +- return( result ); ++ return (result); + } + +-static off_t +-vips_target_seek_real( VipsTarget *target, off_t offset, int whence ) ++static off_t ++vips_target_seek_real(VipsTarget *target, off_t offset, int whence) + { +- VipsConnection *connection = VIPS_CONNECTION( target ); +- const char *nick = vips_connection_nick( connection ); ++ VipsConnection *connection = VIPS_CONNECTION(target); ++ const char *nick = vips_connection_nick(connection); + + off_t new_position; + +- VIPS_DEBUG_MSG( "vips_target_seek_real: offset = %ld, whence = %d\n", +- offset, whence ); ++ VIPS_DEBUG_MSG("vips_target_seek_real: offset = %ld, whence = %d\n", ++ offset, whence); + +- if( target->memory_buffer ) { +- switch( whence ) { ++ if (target->memory_buffer) { ++ switch (whence) { + case SEEK_SET: + new_position = offset; + break; +@@ -201,80 +201,80 @@ vips_target_seek_real( VipsTarget *target, off_t offset, int whence ) + break; + + default: +- vips_error( nick, "%s", _( "bad 'whence'" ) ); +- return( -1 ); ++ vips_error(nick, "%s", _("bad 'whence'")); ++ return (-1); + } + +- if( new_position > target->memory_buffer->len ) +- g_string_set_size( target->memory_buffer, +- new_position ); ++ if (new_position > target->memory_buffer->len) ++ g_string_set_size(target->memory_buffer, ++ new_position); + + target->position = new_position; + } + else +- new_position = lseek( connection->descriptor, offset, whence ); ++ new_position = lseek(connection->descriptor, offset, whence); + +- return( new_position ); ++ return (new_position); + } + +-static gint64 +-vips_target_read_real( VipsTarget *target, void *data, size_t length ) ++static gint64 ++vips_target_read_real(VipsTarget *target, void *data, size_t length) + { + gint64 bytes_read; + +- VIPS_DEBUG_MSG( "vips_target_read_real: %zd bytes\n", length ); ++ VIPS_DEBUG_MSG("vips_target_read_real: %zd bytes\n", length); + +- if( target->memory_buffer ) { +- bytes_read = VIPS_MIN( length, +- target->memory_buffer->len - target->position ); ++ if (target->memory_buffer) { ++ bytes_read = VIPS_MIN(length, ++ target->memory_buffer->len - target->position); + +- VIPS_DEBUG_MSG( " %zd bytes from memory\n", bytes_read ); +- memcpy( data, +- target->memory_buffer->str + +- target->position, +- bytes_read ); ++ VIPS_DEBUG_MSG(" %zd bytes from memory\n", bytes_read); ++ memcpy(data, ++ target->memory_buffer->str + ++ target->position, ++ bytes_read); + target->position += bytes_read; + } + else { +- VipsConnection *connection = VIPS_CONNECTION( target ); ++ VipsConnection *connection = VIPS_CONNECTION(target); + int fd = connection->descriptor; + +- do { +- bytes_read = read( fd, data, length ); +- } while( bytes_read < 0 && errno == EINTR ); ++ do { ++ bytes_read = read(fd, data, length); ++ } while (bytes_read < 0 && errno == EINTR); + } + +- VIPS_DEBUG_MSG( " read %zd bytes\n", bytes_read ); ++ VIPS_DEBUG_MSG(" read %zd bytes\n", bytes_read); + +- return( bytes_read ); ++ return (bytes_read); + } + + static int +-vips_target_end_real( VipsTarget *target ) ++vips_target_end_real(VipsTarget *target) + { +- VIPS_DEBUG_MSG( "vips_target_finish_real:\n" ); ++ VIPS_DEBUG_MSG("vips_target_finish_real:\n"); + +- return( 0 ); ++ return (0); + } + + static void +-vips_target_finish_real( VipsTarget *target ) ++vips_target_finish_real(VipsTarget *target) + { +- VIPS_DEBUG_MSG( "vips_target_finish_real:\n" ); ++ VIPS_DEBUG_MSG("vips_target_finish_real:\n"); + } + + static void +-vips_target_class_init( VipsTargetClass *class ) ++vips_target_class_init(VipsTargetClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); + + gobject_class->finalize = vips_target_finalize; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "target"; +- object_class->description = _( "Target" ); ++ object_class->description = _("Target"); + + object_class->build = vips_target_build; + +@@ -284,29 +284,28 @@ vips_target_class_init( VipsTargetClass *class ) + class->end = vips_target_end_real; + class->finish = vips_target_finish_real; + +- VIPS_ARG_BOOL( class, "memory", 3, +- _( "Memory" ), +- _( "File descriptor should output to memory" ), ++ VIPS_ARG_BOOL(class, "memory", 3, ++ _("Memory"), ++ _("File descriptor should output to memory"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsTarget, memory ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsTarget, memory), ++ FALSE); + + /* SET_ALWAYS means that blob is set by C and the obj system is not + * involved in creation or destruction. It can be read at any time. + */ +- VIPS_ARG_BOXED( class, "blob", 4, +- _( "Blob" ), +- _( "Blob to save to" ), +- VIPS_ARGUMENT_SET_ALWAYS, +- G_STRUCT_OFFSET( VipsTarget, blob ), +- VIPS_TYPE_BLOB ); +- ++ VIPS_ARG_BOXED(class, "blob", 4, ++ _("Blob"), ++ _("Blob to save to"), ++ VIPS_ARGUMENT_SET_ALWAYS, ++ G_STRUCT_OFFSET(VipsTarget, blob), ++ VIPS_TYPE_BLOB); + } + + static void +-vips_target_init( VipsTarget *target ) ++vips_target_init(VipsTarget *target) + { +- target->blob = vips_blob_new( NULL, NULL, 0 ); ++ target->blob = vips_blob_new(NULL, NULL, 0); + target->write_point = 0; + } + +@@ -322,51 +321,51 @@ vips_target_init( VipsTarget *target ) + * Returns: a new target. + */ + VipsTarget * +-vips_target_new_to_descriptor( int descriptor ) ++vips_target_new_to_descriptor(int descriptor) + { + VipsTarget *target; + +- VIPS_DEBUG_MSG( "vips_target_new_to_descriptor: %d\n", +- descriptor ); ++ VIPS_DEBUG_MSG("vips_target_new_to_descriptor: %d\n", ++ descriptor); + +- target = VIPS_TARGET( g_object_new( VIPS_TYPE_TARGET, ++ target = VIPS_TARGET(g_object_new(VIPS_TYPE_TARGET, + "descriptor", descriptor, +- NULL ) ); ++ NULL)); + +- if( vips_object_build( VIPS_OBJECT( target ) ) ) { +- VIPS_UNREF( target ); +- return( NULL ); ++ if (vips_object_build(VIPS_OBJECT(target))) { ++ VIPS_UNREF(target); ++ return (NULL); + } + +- return( target ); ++ return (target); + } + + /** + * vips_target_new_to_file: +- * @filename: write to this file ++ * @filename: write to this file + * + * Create a target attached to a file. + * + * Returns: a new target. + */ + VipsTarget * +-vips_target_new_to_file( const char *filename ) ++vips_target_new_to_file(const char *filename) + { + VipsTarget *target; + +- VIPS_DEBUG_MSG( "vips_target_new_to_file: %s\n", +- filename ); ++ VIPS_DEBUG_MSG("vips_target_new_to_file: %s\n", ++ filename); + +- target = VIPS_TARGET( g_object_new( VIPS_TYPE_TARGET, ++ target = VIPS_TARGET(g_object_new(VIPS_TYPE_TARGET, + "filename", filename, +- NULL ) ); ++ NULL)); + +- if( vips_object_build( VIPS_OBJECT( target ) ) ) { +- VIPS_UNREF( target ); +- return( NULL ); ++ if (vips_object_build(VIPS_OBJECT(target))) { ++ VIPS_UNREF(target); ++ return (NULL); + } + +- return( target ); ++ return (target); + } + + /** +@@ -380,22 +379,22 @@ vips_target_new_to_file( const char *filename ) + * Returns: a new #VipsConnection + */ + VipsTarget * +-vips_target_new_to_memory( void ) ++vips_target_new_to_memory(void) + { + VipsTarget *target; + +- VIPS_DEBUG_MSG( "vips_target_new_to_memory:\n" ); ++ VIPS_DEBUG_MSG("vips_target_new_to_memory:\n"); + +- target = VIPS_TARGET( g_object_new( VIPS_TYPE_TARGET, ++ target = VIPS_TARGET(g_object_new(VIPS_TYPE_TARGET, + "memory", TRUE, +- NULL ) ); ++ NULL)); + +- if( vips_object_build( VIPS_OBJECT( target ) ) ) { +- VIPS_UNREF( target ); +- return( NULL ); ++ if (vips_object_build(VIPS_OBJECT(target))) { ++ VIPS_UNREF(target); ++ return (NULL); + } + +- return( target ); ++ return (target); + } + + /** +@@ -410,88 +409,88 @@ vips_target_new_to_memory( void ) + * Returns: a new target. + */ + VipsTarget * +-vips_target_new_temp( VipsTarget *based_on ) ++vips_target_new_temp(VipsTarget *based_on) + { + VipsTarget *target; + +- VIPS_DEBUG_MSG( "vips_target_new_temp: %p\n", based_on ); ++ VIPS_DEBUG_MSG("vips_target_new_temp: %p\n", based_on); + +- if( vips_connection_filename( VIPS_CONNECTION( based_on ) ) ) { ++ if (vips_connection_filename(VIPS_CONNECTION(based_on))) { + int descriptor; + char *filename; + +- if( !(filename = vips__temp_name( "%s.target" )) ) +- return( NULL ); +- if( (descriptor = +- vips__open_image_write( filename, TRUE )) < 0 ) { +- g_free( filename ); +- return( NULL ); ++ if (!(filename = vips__temp_name("%s.target"))) ++ return (NULL); ++ if ((descriptor = ++ vips__open_image_write(filename, TRUE)) < 0) { ++ g_free(filename); ++ return (NULL); + } +- if( !(target = vips_target_new_to_descriptor( descriptor )) ) { +- g_free( filename ); +- vips_tracked_close( descriptor ); +- return( NULL ); ++ if (!(target = vips_target_new_to_descriptor(descriptor))) { ++ g_free(filename); ++ vips_tracked_close(descriptor); ++ return (NULL); + } +- vips_tracked_close( descriptor ); ++ vips_tracked_close(descriptor); + target->delete_on_close = TRUE; + target->delete_on_close_filename = filename; + } + else + target = vips_target_new_to_memory(); + +- return( target ); ++ return (target); + } + + static int +-vips_target_write_unbuffered( VipsTarget *target, +- const void *data, size_t length ) ++vips_target_write_unbuffered(VipsTarget *target, ++ const void *data, size_t length) + { +- VipsTargetClass *class = VIPS_TARGET_GET_CLASS( target ); ++ VipsTargetClass *class = VIPS_TARGET_GET_CLASS(target); + +- VIPS_DEBUG_MSG( "vips_target_write_unbuffered:\n" ); ++ VIPS_DEBUG_MSG("vips_target_write_unbuffered:\n"); + +- if( target->ended ) +- return( 0 ); ++ if (target->ended) ++ return (0); + +- while( length > 0 ) { ++ while (length > 0) { + gint64 bytes_written; + +- bytes_written = class->write( target, data, length ); ++ bytes_written = class->write(target, data, length); + +- /* n == 0 isn't strictly an error, but we treat it as ++ /* n == 0 isn't strictly an error, but we treat it as + * one to make sure we don't get stuck in this loop. + */ +- if( bytes_written <= 0 ) { +- vips_error_system( errno, +- vips_connection_nick( +- VIPS_CONNECTION( target ) ), +- "%s", _( "write error" ) ); +- return( -1 ); ++ if (bytes_written <= 0) { ++ vips_error_system(errno, ++ vips_connection_nick( ++ VIPS_CONNECTION(target)), ++ "%s", _("write error")); ++ return (-1); + } + + length -= bytes_written; + data += bytes_written; + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_target_flush( VipsTarget *target ) ++vips_target_flush(VipsTarget *target) + { +- g_assert( target->write_point >= 0 ); +- g_assert( target->write_point <= VIPS_TARGET_BUFFER_SIZE ); ++ g_assert(target->write_point >= 0); ++ g_assert(target->write_point <= VIPS_TARGET_BUFFER_SIZE); + +- VIPS_DEBUG_MSG( "vips_target_flush:\n" ); ++ VIPS_DEBUG_MSG("vips_target_flush:\n"); + +- if( target->write_point > 0 ) { +- if( vips_target_write_unbuffered( target, +- target->output_buffer, target->write_point ) ) +- return( -1 ); ++ if (target->write_point > 0) { ++ if (vips_target_write_unbuffered(target, ++ target->output_buffer, target->write_point)) ++ return (-1); + target->write_point = 0; + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -500,32 +499,32 @@ vips_target_flush( VipsTarget *target ) + * @buffer: bytes to write + * @length: length of @buffer in bytes + * +- * Write @length bytes from @buffer to the output. ++ * Write @length bytes from @buffer to the output. + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_target_write( VipsTarget *target, const void *buffer, size_t length ) ++vips_target_write(VipsTarget *target, const void *buffer, size_t length) + { +- VIPS_DEBUG_MSG( "vips_target_write: %zd bytes\n", length ); ++ VIPS_DEBUG_MSG("vips_target_write: %zd bytes\n", length); + +- if( length > VIPS_TARGET_BUFFER_SIZE - target->write_point && +- vips_target_flush( target ) ) +- return( -1 ); ++ if (length > VIPS_TARGET_BUFFER_SIZE - target->write_point && ++ vips_target_flush(target)) ++ return (-1); + +- if( length > VIPS_TARGET_BUFFER_SIZE - target->write_point ) { ++ if (length > VIPS_TARGET_BUFFER_SIZE - target->write_point) { + /* Still too large? Do an unbuffered write. + */ +- if( vips_target_write_unbuffered( target, buffer, length ) ) +- return( -1 ); ++ if (vips_target_write_unbuffered(target, buffer, length)) ++ return (-1); + } + else { +- memcpy( target->output_buffer + target->write_point, +- buffer, length ); ++ memcpy(target->output_buffer + target->write_point, ++ buffer, length); + target->write_point += length; + } + +- return( 0 ); ++ return (0); + } + + /** +@@ -535,7 +534,7 @@ vips_target_write( VipsTarget *target, const void *buffer, size_t length ) + * @length: length of @buffer in bytes + * + * Read up to @length bytes from @target and store the bytes in @buffer. +- * Return the number of bytes actually read. If all bytes have been read from ++ * Return the number of bytes actually read. If all bytes have been read from + * the file, return 0. + * + * Arguments exactly as read(2). +@@ -546,16 +545,16 @@ vips_target_write( VipsTarget *target, const void *buffer, size_t length ) + * Returns: the number of bytes read, 0 on end of file, -1 on error. + */ + gint64 +-vips_target_read( VipsTarget *target, void *buffer, size_t length ) ++vips_target_read(VipsTarget *target, void *buffer, size_t length) + { +- VipsTargetClass *class = VIPS_TARGET_GET_CLASS( target ); ++ VipsTargetClass *class = VIPS_TARGET_GET_CLASS(target); + +- VIPS_DEBUG_MSG( "vips_target_read: %zd bytes\n", length ); ++ VIPS_DEBUG_MSG("vips_target_read: %zd bytes\n", length); + +- if( vips_target_flush( target ) ) +- return( -1 ); ++ if (vips_target_flush(target)) ++ return (-1); + +- return( class->read( target, buffer, length ) ); ++ return (class->read(target, buffer, length)); + } + + /** +@@ -566,30 +565,30 @@ vips_target_read( VipsTarget *target, void *buffer, size_t length ) + * + * Seek the target. This behaves exactly as lseek(2). + * +- * Seeking a target sounds weird, but libtiff needs this. This method will ++ * Seeking a target sounds weird, but libtiff needs this. This method will + * fail for targets like pipes. + * + * Returns: the new seek position, -1 on error. + */ + off_t +-vips_target_seek( VipsTarget *target, off_t position, int whence ) ++vips_target_seek(VipsTarget *target, off_t position, int whence) + { +- VipsTargetClass *class = VIPS_TARGET_GET_CLASS( target ); ++ VipsTargetClass *class = VIPS_TARGET_GET_CLASS(target); + + off_t new_position; + +- VIPS_DEBUG_MSG( "vips_target_seek: pos = %ld, whence = %d\n", +- position, whence ); ++ VIPS_DEBUG_MSG("vips_target_seek: pos = %ld, whence = %d\n", ++ position, whence); + +- if( vips_target_flush( target ) ) +- return( -1 ); ++ if (vips_target_flush(target)) ++ return (-1); + +- new_position = class->seek( target, position, whence ); ++ new_position = class->seek(target, position, whence); + +- VIPS_DEBUG_MSG( "vips_target_seek: new_position = %ld\n", +- new_position ); ++ VIPS_DEBUG_MSG("vips_target_seek: new_position = %ld\n", ++ new_position); + +- return( new_position ); ++ return (new_position); + } + + /** +@@ -599,45 +598,45 @@ vips_target_seek( VipsTarget *target, off_t position, int whence ) + * @length: length of @buffer in bytes + * + * Call this at the end of write to make the target do any cleaning up. You +- * can call it many times. ++ * can call it many times. + * + * After a target has been finished, further writes will do nothing. + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_target_end( VipsTarget *target ) ++vips_target_end(VipsTarget *target) + { +- VipsTargetClass *class = VIPS_TARGET_GET_CLASS( target ); ++ VipsTargetClass *class = VIPS_TARGET_GET_CLASS(target); + +- VIPS_DEBUG_MSG( "vips_target_end:\n" ); ++ VIPS_DEBUG_MSG("vips_target_end:\n"); + +- if( target->ended ) +- return( 0 ); ++ if (target->ended) ++ return (0); + +- if( vips_target_flush( target ) ) +- return( -1 ); ++ if (vips_target_flush(target)) ++ return (-1); + + /* Move the target buffer into the blob so it can be read out. + */ +- if( target->memory_buffer ) { ++ if (target->memory_buffer) { + const char *data; + size_t length; + + length = target->memory_buffer->len; +- data = g_string_free( target->memory_buffer, FALSE ); ++ data = g_string_free(target->memory_buffer, FALSE); + target->memory_buffer = NULL; +- vips_blob_set( target->blob, +- (VipsCallbackFn) vips_area_free_cb, data, length ); ++ vips_blob_set(target->blob, ++ (VipsCallbackFn) vips_area_free_cb, data, length); + } + else { +- if( class->end( target ) ) +- return( -1 ); ++ if (class->end(target)) ++ return (-1); + } + + target->ended = TRUE; + +- return( 0 ); ++ return (0); + } + + /** +@@ -649,13 +648,13 @@ vips_target_end( VipsTarget *target ) + * Deprecated in favour of vips_target_end(). + */ + void +-vips_target_finish( VipsTarget *target ) ++vips_target_finish(VipsTarget *target) + { +- (void) vips_target_end( target ); ++ (void) vips_target_end(target); + } + + /** +- * vips_target_steal: ++ * vips_target_steal: + * @target: target to operate on + * @length: return number of bytes of data + * +@@ -664,44 +663,44 @@ vips_target_finish( VipsTarget *target ) + * + * You must free the returned pointer with g_free(). + * +- * The data is NOT automatically null-terminated. vips_target_putc() a '\0' ++ * The data is NOT automatically null-terminated. vips_target_putc() a '\0' + * before calling this to get a null-terminated string. + * +- * Returns: (array length=length) (element-type guint8) (transfer full): the ++ * Returns: (array length=length) (element-type guint8) (transfer full): the + * data + */ + unsigned char * +-vips_target_steal( VipsTarget *target, size_t *length ) ++vips_target_steal(VipsTarget *target, size_t *length) + { + const char *data; + +- (void) vips_target_flush( target ); ++ (void) vips_target_flush(target); + +- if( !target->memory_buffer || +- target->ended ) { +- if( length ) ++ if (!target->memory_buffer || ++ target->ended) { ++ if (length) + *length = target->memory_buffer->len; + +- return( NULL ); ++ return (NULL); + } + +- if( length ) ++ if (length) + *length = target->memory_buffer->len; +- data = g_string_free( target->memory_buffer, FALSE ); ++ data = g_string_free(target->memory_buffer, FALSE); + target->memory_buffer = NULL; + + /* We must have a valid byte array or end will fail. + */ +- target->memory_buffer = g_string_sized_new( 0 ); ++ target->memory_buffer = g_string_sized_new(0); + +- if( vips_target_end( target ) ) +- return( NULL ); ++ if (vips_target_end(target)) ++ return (NULL); + +- return( (unsigned char *) data ); ++ return ((unsigned char *) data); + } + + /** +- * vips_target_steal_text: ++ * vips_target_steal_text: + * @target: target to operate on + * + * As vips_target_steal_text(), but return a null-terminated string. +@@ -709,11 +708,11 @@ vips_target_steal( VipsTarget *target, size_t *length ) + * Returns: (transfer full): target contents as a null-terminated string. + */ + char * +-vips_target_steal_text( VipsTarget *target ) ++vips_target_steal_text(VipsTarget *target) + { +- vips_target_putc( target, '\0' ); ++ vips_target_putc(target, '\0'); + +- return( (char *) vips_target_steal( target, NULL ) ); ++ return ((char *) vips_target_steal(target, NULL)); + } + + /** +@@ -727,17 +726,17 @@ vips_target_steal_text( VipsTarget *target ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_target_putc( VipsTarget *target, int ch ) ++vips_target_putc(VipsTarget *target, int ch) + { +- VIPS_DEBUG_MSG( "vips_target_putc: %d\n", ch ); ++ VIPS_DEBUG_MSG("vips_target_putc: %d\n", ch); + +- if( target->write_point >= VIPS_TARGET_BUFFER_SIZE && +- vips_target_flush( target ) ) +- return( -1 ); ++ if (target->write_point >= VIPS_TARGET_BUFFER_SIZE && ++ vips_target_flush(target)) ++ return (-1); + + target->output_buffer[target->write_point++] = ch; + +- return( 0 ); ++ return (0); + } + + /** +@@ -746,14 +745,14 @@ vips_target_putc( VipsTarget *target, int ch ) + * @str: string to write + * + * Write a null-terminated string to @target. +- * ++ * + * Returns: 0 on success, and -1 on error. + */ + int +-vips_target_writes( VipsTarget *target, const char *str ) ++vips_target_writes(VipsTarget *target, const char *str) + { +- return( vips_target_write( target, +- (unsigned char *) str, strlen( str ) ) ); ++ return (vips_target_write(target, ++ (unsigned char *) str, strlen(str))); + } + + /** +@@ -762,30 +761,30 @@ vips_target_writes( VipsTarget *target, const char *str ) + * @fmt: printf()-style format string + * @...: arguments to format string + * +- * Format the string and write to @target. +- * ++ * Format the string and write to @target. ++ * + * Returns: 0 on success, and -1 on error. + */ + int +-vips_target_writef( VipsTarget *target, const char *fmt, ... ) ++vips_target_writef(VipsTarget *target, const char *fmt, ...) + { + va_list ap; + char *line; + int result; + +- va_start( ap, fmt ); +- line = g_strdup_vprintf( fmt, ap ); +- va_end( ap ); ++ va_start(ap, fmt); ++ line = g_strdup_vprintf(fmt, ap); ++ va_end(ap); + +- result = vips_target_writes( target, line ); ++ result = vips_target_writes(target, line); + +- g_free( line ); ++ g_free(line); + +- return( result ); ++ return (result); + } + + /** +- * vips_target_write_amp: ++ * vips_target_write_amp: + * @target: target to operate on + * @str: string to write + * +@@ -794,51 +793,50 @@ vips_target_writef( VipsTarget *target, const char *fmt, ... ) + * + * XML rules: + * +- * - We must escape &<> ++ * - We must escape &<> + * - Don't escape \n, \t, \r +- * - Do escape the other ASCII codes. ++ * - Do escape the other ASCII codes. + * + * Returns: 0 on success, -1 on error. + */ + int +-vips_target_write_amp( VipsTarget *target, const char *str ) ++vips_target_write_amp(VipsTarget *target, const char *str) + { + const char *p; + +- for( p = str; *p; p++ ) +- if( *p < 32 && ++ for (p = str; *p; p++) ++ if (*p < 32 && + *p != '\n' && + *p != '\t' && +- *p != '\r' ) { ++ *p != '\r') { + /* You'd think we could output "%x;", but xml + * 1.0 parsers barf on that. xml 1.1 allows this, but +- * there are almost no parsers. ++ * there are almost no parsers. + * +- * U+2400 onwards are unicode glyphs for the ASCII ++ * U+2400 onwards are unicode glyphs for the ASCII + * control characters, so we can use them -- thanks + * electroly. + */ +- if( vips_target_writef( target, +- "&#x%04x;", 0x2400 + *p ) ) +- return( -1 ); ++ if (vips_target_writef(target, ++ "&#x%04x;", 0x2400 + *p)) ++ return (-1); + } +- else if( *p == '<' ) { +- if( vips_target_writes( target, "<" ) ) +- return( -1 ); ++ else if (*p == '<') { ++ if (vips_target_writes(target, "<")) ++ return (-1); + } +- else if( *p == '>' ) { +- if( vips_target_writes( target, ">" ) ) +- return( -1 ); ++ else if (*p == '>') { ++ if (vips_target_writes(target, ">")) ++ return (-1); + } +- else if( *p == '&' ) { +- if( vips_target_writes( target, "&" ) ) +- return( -1 ); ++ else if (*p == '&') { ++ if (vips_target_writes(target, "&")) ++ return (-1); + } +- else { +- if( VIPS_TARGET_PUTC( target, *p ) ) +- return( -1 ); ++ else { ++ if (VIPS_TARGET_PUTC(target, *p)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } +- +diff --git a/libvips/iofuncs/targetcustom.c b/libvips/iofuncs/targetcustom.c +index 603422d5c4..f933b6cd83 100644 +--- a/libvips/iofuncs/targetcustom.c ++++ b/libvips/iofuncs/targetcustom.c +@@ -1,33 +1,33 @@ + /* A Target subclass with signals you can easily hook up to other output + * sources. +- * ++ * + * J.Cupitt, 21/11/19 + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -57,177 +57,177 @@ + + #include "vipsmarshal.h" + +-G_DEFINE_TYPE( VipsTargetCustom, vips_target_custom, VIPS_TYPE_TARGET ); ++G_DEFINE_TYPE(VipsTargetCustom, vips_target_custom, VIPS_TYPE_TARGET); + +-/* Our signals. ++/* Our signals. + */ + enum { +- SIG_WRITE, +- SIG_READ, +- SIG_SEEK, +- SIG_END, +- SIG_FINISH, ++ SIG_WRITE, ++ SIG_READ, ++ SIG_SEEK, ++ SIG_END, ++ SIG_FINISH, + SIG_LAST + }; + + static guint vips_target_custom_signals[SIG_LAST] = { 0 }; + + static gint64 +-vips_target_custom_write_real( VipsTarget *target, +- const void *data, size_t length ) ++vips_target_custom_write_real(VipsTarget *target, ++ const void *data, size_t length) + { + gint64 bytes_written; + +- VIPS_DEBUG_MSG( "vips_target_custom_write_real:\n" ); ++ VIPS_DEBUG_MSG("vips_target_custom_write_real:\n"); + + /* Return value if no attached handler. + */ + bytes_written = 0; + +- g_signal_emit( target, vips_target_custom_signals[SIG_WRITE], 0, +- data, (gint64) length, &bytes_written ); ++ g_signal_emit(target, vips_target_custom_signals[SIG_WRITE], 0, ++ data, (gint64) length, &bytes_written); + +- VIPS_DEBUG_MSG( " %zd\n", bytes_written ); ++ VIPS_DEBUG_MSG(" %zd\n", bytes_written); + +- return( bytes_written ); ++ return (bytes_written); + } + + static gint64 +-vips_target_custom_read_real( VipsTarget *target, void *buffer, size_t length ) ++vips_target_custom_read_real(VipsTarget *target, void *buffer, size_t length) + { + gint64 bytes_read; + +- VIPS_DEBUG_MSG( "vips_target_custom_read_real:\n" ); ++ VIPS_DEBUG_MSG("vips_target_custom_read_real:\n"); + + /* Return this value (error) if there's no attached handler. + */ + bytes_read = 0; + +- g_signal_emit( target, vips_target_custom_signals[SIG_READ], 0, +- buffer, (gint64) length, &bytes_read ); ++ g_signal_emit(target, vips_target_custom_signals[SIG_READ], 0, ++ buffer, (gint64) length, &bytes_read); + +- VIPS_DEBUG_MSG( " vips_target_custom_read_real, seen %zd bytes\n", +- bytes_read ); ++ VIPS_DEBUG_MSG(" vips_target_custom_read_real, seen %zd bytes\n", ++ bytes_read); + +- return( bytes_read ); ++ return (bytes_read); + } + + static gint64 +-vips_target_custom_seek_real( VipsTarget *target, gint64 offset, int whence ) ++vips_target_custom_seek_real(VipsTarget *target, gint64 offset, int whence) + { + GValue args[3] = { { 0 } }; + GValue result = { 0 }; + gint64 new_position; + +- VIPS_DEBUG_MSG( "vips_target_custom_seek_real:\n" ); ++ VIPS_DEBUG_MSG("vips_target_custom_seek_real:\n"); + + /* Set the signal args. + */ +- g_value_init( &args[0], G_TYPE_OBJECT ); +- g_value_set_object( &args[0], target ); +- g_value_init( &args[1], G_TYPE_INT64 ); +- g_value_set_int64( &args[1], offset ); +- g_value_init( &args[2], G_TYPE_INT ); +- g_value_set_int( &args[2], whence ); ++ g_value_init(&args[0], G_TYPE_OBJECT); ++ g_value_set_object(&args[0], target); ++ g_value_init(&args[1], G_TYPE_INT64); ++ g_value_set_int64(&args[1], offset); ++ g_value_init(&args[2], G_TYPE_INT); ++ g_value_set_int(&args[2], whence); + + /* Set the default value if no handlers are attached. + */ +- g_value_init( &result, G_TYPE_INT64 ); +- g_value_set_int64( &result, -1 ); ++ g_value_init(&result, G_TYPE_INT64); ++ g_value_set_int64(&result, -1); + +- /* We need to use this signal interface since we want a default value ++ /* We need to use this signal interface since we want a default value + * if no handlers are attached. + */ +- g_signal_emitv( (const GValue *) &args, +- vips_target_custom_signals[SIG_SEEK], 0, &result ); ++ g_signal_emitv((const GValue *) &args, ++ vips_target_custom_signals[SIG_SEEK], 0, &result); + +- new_position = g_value_get_int64( &result ); ++ new_position = g_value_get_int64(&result); + +- g_value_unset( &args[0] ); +- g_value_unset( &args[1] ); +- g_value_unset( &args[2] ); +- g_value_unset( &result ); ++ g_value_unset(&args[0]); ++ g_value_unset(&args[1]); ++ g_value_unset(&args[2]); ++ g_value_unset(&result); + +- VIPS_DEBUG_MSG( " vips_target_custom_seek_real, seen new pos %zd\n", +- new_position ); ++ VIPS_DEBUG_MSG(" vips_target_custom_seek_real, seen new pos %zd\n", ++ new_position); + +- return( new_position ); ++ return (new_position); + } + + static int +-vips_target_custom_end_real( VipsTarget *target ) ++vips_target_custom_end_real(VipsTarget *target) + { + int result; + +- VIPS_DEBUG_MSG( "vips_target_custom_end_real:\n" ); ++ VIPS_DEBUG_MSG("vips_target_custom_end_real:\n"); + + /* Return value if no attached handler. + */ + result = 0; + +- g_signal_emit( target, vips_target_custom_signals[SIG_END], 0, +- &result ); ++ g_signal_emit(target, vips_target_custom_signals[SIG_END], 0, ++ &result); + +- return( result ); ++ return (result); + } + + static void +-vips_target_custom_finish_real( VipsTarget *target ) ++vips_target_custom_finish_real(VipsTarget *target) + { +- VIPS_DEBUG_MSG( "vips_target_custom_finish_real:\n" ); ++ VIPS_DEBUG_MSG("vips_target_custom_finish_real:\n"); + +- g_signal_emit( target, vips_target_custom_signals[SIG_FINISH], 0 ); ++ g_signal_emit(target, vips_target_custom_signals[SIG_FINISH], 0); + } + + static gint64 +-vips_target_custom_write_signal_real( VipsTargetCustom *target_custom, +- const void *data, gint64 length ) ++vips_target_custom_write_signal_real(VipsTargetCustom *target_custom, ++ const void *data, gint64 length) + { +- VIPS_DEBUG_MSG( "vips_target_custom_write_signal_real:\n" ); ++ VIPS_DEBUG_MSG("vips_target_custom_write_signal_real:\n"); + +- return( 0 ); ++ return (0); + } + + static gint64 +-vips_target_custom_read_signal_real( VipsTargetCustom *target_custom, +- void *data, gint64 length ) ++vips_target_custom_read_signal_real(VipsTargetCustom *target_custom, ++ void *data, gint64 length) + { +- VIPS_DEBUG_MSG( "vips_target_custom_read_signal_real:\n" ); ++ VIPS_DEBUG_MSG("vips_target_custom_read_signal_real:\n"); + +- return( 0 ); ++ return (0); + } + + static gint64 +-vips_target_custom_seek_signal_real( VipsTargetCustom *target_custom, +- gint64 offset, int whence ) ++vips_target_custom_seek_signal_real(VipsTargetCustom *target_custom, ++ gint64 offset, int whence) + { +- VIPS_DEBUG_MSG( "vips_target_custom_seek_signal_real:\n" ); ++ VIPS_DEBUG_MSG("vips_target_custom_seek_signal_real:\n"); + +- return( -1 ); ++ return (-1); + } + + static int +-vips_target_custom_end_signal_real( VipsTargetCustom *target_custom ) ++vips_target_custom_end_signal_real(VipsTargetCustom *target_custom) + { +- VIPS_DEBUG_MSG( "vips_target_custom_end_signal_real:\n" ); ++ VIPS_DEBUG_MSG("vips_target_custom_end_signal_real:\n"); + +- return( 0 ); ++ return (0); + } + + static void +-vips_target_custom_finish_signal_real( VipsTargetCustom *target_custom ) ++vips_target_custom_finish_signal_real(VipsTargetCustom *target_custom) + { +- VIPS_DEBUG_MSG( "vips_target_custom_finish_signal_real:\n" ); ++ VIPS_DEBUG_MSG("vips_target_custom_finish_signal_real:\n"); + } + + static void +-vips_target_custom_class_init( VipsTargetCustomClass *class ) ++vips_target_custom_class_init(VipsTargetCustomClass *class) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); +- VipsTargetClass *target_class = VIPS_TARGET_CLASS( class ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); ++ VipsTargetClass *target_class = VIPS_TARGET_CLASS(class); + + object_class->nickname = "target_custom"; +- object_class->description = _( "Custom target" ); ++ object_class->description = _("Custom target"); + + target_class->write = vips_target_custom_write_real; + target_class->read = vips_target_custom_read_real; +@@ -247,18 +247,18 @@ vips_target_custom_class_init( VipsTargetCustomClass *class ) + * @data: %pointer, bytes to write + * @length: %gint64, number of bytes + * +- * This signal is emitted to write bytes to the target. ++ * This signal is emitted to write bytes to the target. + * + * Returns: the number of bytes written. + */ +- vips_target_custom_signals[SIG_WRITE] = g_signal_new( "write", +- G_TYPE_FROM_CLASS( class ), ++ vips_target_custom_signals[SIG_WRITE] = g_signal_new("write", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_ACTION, +- G_STRUCT_OFFSET( VipsTargetCustomClass, write ), ++ G_STRUCT_OFFSET(VipsTargetCustomClass, write), + NULL, NULL, + vips_INT64__POINTER_INT64, + G_TYPE_INT64, 2, +- G_TYPE_POINTER, G_TYPE_INT64 ); ++ G_TYPE_POINTER, G_TYPE_INT64); + + /** + * VipsTargetCustom::read: +@@ -272,14 +272,14 @@ vips_target_custom_class_init( VipsTargetCustomClass *class ) + * + * Returns: the number of bytes read. Return 0 for EOF. + */ +- vips_target_custom_signals[SIG_READ] = g_signal_new( "read", +- G_TYPE_FROM_CLASS( class ), ++ vips_target_custom_signals[SIG_READ] = g_signal_new("read", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_ACTION, +- G_STRUCT_OFFSET( VipsTargetCustomClass, read ), ++ G_STRUCT_OFFSET(VipsTargetCustomClass, read), + NULL, NULL, + vips_INT64__POINTER_INT64, + G_TYPE_INT64, 2, +- G_TYPE_POINTER, G_TYPE_INT64 ); ++ G_TYPE_POINTER, G_TYPE_INT64); + + /** + * VipsTargetCustom::seek: +@@ -294,14 +294,14 @@ vips_target_custom_class_init( VipsTargetCustomClass *class ) + * + * Returns: the new seek position. + */ +- vips_target_custom_signals[SIG_SEEK] = g_signal_new( "seek", +- G_TYPE_FROM_CLASS( class ), ++ vips_target_custom_signals[SIG_SEEK] = g_signal_new("seek", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_ACTION, +- G_STRUCT_OFFSET( VipsTargetCustomClass, seek ), ++ G_STRUCT_OFFSET(VipsTargetCustomClass, seek), + NULL, NULL, + vips_INT64__INT64_INT, + G_TYPE_INT64, 2, +- G_TYPE_INT64, G_TYPE_INT ); ++ G_TYPE_INT64, G_TYPE_INT); + + /** + * VipsTargetCustom::end: +@@ -312,13 +312,13 @@ vips_target_custom_class_init( VipsTargetCustomClass *class ) + * + * Returns: 0 on success, -1 on error. + */ +- vips_target_custom_signals[SIG_END] = g_signal_new( "end", +- G_TYPE_FROM_CLASS( class ), ++ vips_target_custom_signals[SIG_END] = g_signal_new("end", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_ACTION, +- G_STRUCT_OFFSET( VipsTargetCustomClass, end ), ++ G_STRUCT_OFFSET(VipsTargetCustomClass, end), + NULL, NULL, + vips_INT__VOID, +- G_TYPE_INT, 0 ); ++ G_TYPE_INT, 0); + + /** + * VipsTargetCustom::finish: +@@ -326,18 +326,17 @@ vips_target_custom_class_init( VipsTargetCustomClass *class ) + * + * Deprecated for VipsTargetCustom::end. + */ +- vips_target_custom_signals[SIG_FINISH] = g_signal_new( "finish", +- G_TYPE_FROM_CLASS( class ), ++ vips_target_custom_signals[SIG_FINISH] = g_signal_new("finish", ++ G_TYPE_FROM_CLASS(class), + G_SIGNAL_ACTION, +- G_STRUCT_OFFSET( VipsTargetCustomClass, finish ), ++ G_STRUCT_OFFSET(VipsTargetCustomClass, finish), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, +- G_TYPE_NONE, 0 ); +- ++ G_TYPE_NONE, 0); + } + + static void +-vips_target_custom_init( VipsTargetCustom *target_custom ) ++vips_target_custom_init(VipsTargetCustom *target_custom) + { + } + +@@ -349,19 +348,19 @@ vips_target_custom_init( VipsTargetCustom *target_custom ) + * Returns: a new #VipsTargetCustom + */ + VipsTargetCustom * +-vips_target_custom_new( void ) ++vips_target_custom_new(void) + { + VipsTargetCustom *target_custom; + +- VIPS_DEBUG_MSG( "vips_target_custom_new:\n" ); ++ VIPS_DEBUG_MSG("vips_target_custom_new:\n"); + +- target_custom = VIPS_TARGET_CUSTOM( +- g_object_new( VIPS_TYPE_TARGET_CUSTOM, NULL ) ); ++ target_custom = VIPS_TARGET_CUSTOM( ++ g_object_new(VIPS_TYPE_TARGET_CUSTOM, NULL)); + +- if( vips_object_build( VIPS_OBJECT( target_custom ) ) ) { +- VIPS_UNREF( target_custom ); +- return( NULL ); ++ if (vips_object_build(VIPS_OBJECT(target_custom))) { ++ VIPS_UNREF(target_custom); ++ return (NULL); + } + +- return( target_custom ); ++ return (target_custom); + } +diff --git a/libvips/iofuncs/thread.c b/libvips/iofuncs/thread.c +index ae75f6b2a6..b9e20d904a 100644 +--- a/libvips/iofuncs/thread.c ++++ b/libvips/iofuncs/thread.c +@@ -1,33 +1,33 @@ + /* Basic functions to support threading. +- * ++ * + * 29/9/22 + * - from threadpool.c + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -82,128 +82,128 @@ static GPrivate *is_vips_thread_key = NULL; + * termination. + */ + gboolean +-vips_thread_isvips( void ) ++vips_thread_isvips(void) + { +- return( g_private_get( is_vips_thread_key ) != NULL ); ++ return (g_private_get(is_vips_thread_key) != NULL); + } + + /* Glib 2.32 revised the thread API. We need some compat functions. + */ + + GMutex * +-vips_g_mutex_new( void ) ++vips_g_mutex_new(void) + { + GMutex *mutex; + +- mutex = g_new( GMutex, 1 ); +- g_mutex_init( mutex ); ++ mutex = g_new(GMutex, 1); ++ g_mutex_init(mutex); + +- return( mutex ); ++ return (mutex); + } + + void +-vips_g_mutex_free( GMutex *mutex ) ++vips_g_mutex_free(GMutex *mutex) + { +- g_mutex_clear( mutex ); +- g_free( mutex ); ++ g_mutex_clear(mutex); ++ g_free(mutex); + } + + GCond * +-vips_g_cond_new( void ) ++vips_g_cond_new(void) + { + GCond *cond; + +- cond = g_new( GCond, 1 ); +- g_cond_init( cond ); ++ cond = g_new(GCond, 1); ++ g_cond_init(cond); + +- return( cond ); ++ return (cond); + } + + void +-vips_g_cond_free( GCond *cond ) ++vips_g_cond_free(GCond *cond) + { +- g_cond_clear( cond ); +- g_free( cond ); ++ g_cond_clear(cond); ++ g_free(cond); + } + + typedef struct { +- const char *domain; +- GThreadFunc func; ++ const char *domain; ++ GThreadFunc func; + gpointer data; +-} VipsThreadInfo; ++} VipsThreadInfo; + + static void * +-vips_thread_run( gpointer data ) ++vips_thread_run(gpointer data) + { + VipsThreadInfo *info = (VipsThreadInfo *) data; + + void *result; + +- /* Set this to something (anything) to tag this thread as a vips ++ /* Set this to something (anything) to tag this thread as a vips + * worker. No need to call g_private_replace as there is no + * GDestroyNotify handler associated with a worker. + */ +- g_private_set( is_vips_thread_key, info ); ++ g_private_set(is_vips_thread_key, info); + +- result = info->func( info->data ); ++ result = info->func(info->data); + +- g_free( info ); ++ g_free(info); + + vips_thread_shutdown(); + +- return( result ); ++ return (result); + } + + GThread * +-vips_g_thread_new( const char *domain, GThreadFunc func, gpointer data ) ++vips_g_thread_new(const char *domain, GThreadFunc func, gpointer data) + { + GThread *thread; +- VipsThreadInfo *info; ++ VipsThreadInfo *info; + GError *error = NULL; + +- info = g_new( VipsThreadInfo, 1 ); ++ info = g_new(VipsThreadInfo, 1); + info->domain = domain; + info->func = func; + info->data = data; + +- thread = g_thread_try_new( domain, vips_thread_run, info, &error ); ++ thread = g_thread_try_new(domain, vips_thread_run, info, &error); + +- VIPS_DEBUG_MSG_RED( "vips_g_thread_new: g_thread_create( %s ) = %p\n", +- domain, thread ); ++ VIPS_DEBUG_MSG_RED("vips_g_thread_new: g_thread_create( %s ) = %p\n", ++ domain, thread); + +- if( !thread ) { +- if( error ) +- vips_g_error( &error ); ++ if (!thread) { ++ if (error) ++ vips_g_error(&error); + else +- vips_error( domain, +- "%s", _( "unable to create thread" ) ); ++ vips_error(domain, ++ "%s", _("unable to create thread")); + } + +- return( thread ); ++ return (thread); + } + + void * +-vips_g_thread_join( GThread *thread ) ++vips_g_thread_join(GThread *thread) + { + void *result; + +- result = g_thread_join( thread ); ++ result = g_thread_join(thread); + +- VIPS_DEBUG_MSG_RED( "vips_g_thread_join: g_thread_join( %p )\n", +- thread ); ++ VIPS_DEBUG_MSG_RED("vips_g_thread_join: g_thread_join( %p )\n", ++ thread); + +- return( result ); ++ return (result); + } + + static int +-get_num_processors( void ) ++get_num_processors(void) + { +-#if GLIB_CHECK_VERSION( 2, 48, 1 ) ++#if GLIB_CHECK_VERSION(2, 48, 1) + /* We could use g_get_num_processors when GLib >= 2.48.1, see: + * https://gitlab.gnome.org/GNOME/glib/commit/999711abc82ea3a698d05977f9f91c0b73957f7f + * https://gitlab.gnome.org/GNOME/glib/commit/2149b29468bb99af3c29d5de61f75aad735082dc + */ +- return( g_get_num_processors() ); ++ return (g_get_num_processors()); + #else + int nproc; + +@@ -212,26 +212,26 @@ get_num_processors( void ) + #ifdef G_OS_UNIX + + #if defined(HAVE_UNISTD_H) && defined(_SC_NPROCESSORS_ONLN) +-{ +- /* POSIX style. +- */ +- int x; ++ { ++ /* POSIX style. ++ */ ++ int x; + +- x = sysconf( _SC_NPROCESSORS_ONLN ); +- if( x > 0 ) +- nproc = x; +-} ++ x = sysconf(_SC_NPROCESSORS_ONLN); ++ if (x > 0) ++ nproc = x; ++ } + #elif defined HW_NCPU +-{ +- /* BSD style. +- */ +- int x; +- size_t len = sizeof(x); ++ { ++ /* BSD style. ++ */ ++ int x; ++ size_t len = sizeof(x); + +- sysctl( (int[2]) {CTL_HW, HW_NCPU}, 2, &x, &len, NULL, 0 ); +- if( x > 0 ) +- nproc = x; +-} ++ sysctl((int[2]){ CTL_HW, HW_NCPU }, 2, &x, &len, NULL, 0); ++ if (x > 0) ++ nproc = x; ++ } + #endif + + /* libgomp has some very complex code on Linux to count the number of +@@ -242,35 +242,35 @@ get_num_processors( void ) + #endif /*G_OS_UNIX*/ + + #ifdef G_OS_WIN32 +-{ +- /* Count the CPUs currently available to this process. +- */ +- SYSTEM_INFO sysinfo; +- DWORD_PTR process_cpus; +- DWORD_PTR system_cpus; +- +- /* This *never* fails, use it as fallback +- */ +- GetNativeSystemInfo( &sysinfo ); +- nproc = (int) sysinfo.dwNumberOfProcessors; +- +- if( GetProcessAffinityMask( GetCurrentProcess(), +- &process_cpus, &system_cpus ) ) { +- unsigned int af_count; +- +- for( af_count = 0; process_cpus != 0; process_cpus >>= 1 ) +- if( process_cpus & 1 ) +- af_count++; ++ { ++ /* Count the CPUs currently available to this process. ++ */ ++ SYSTEM_INFO sysinfo; ++ DWORD_PTR process_cpus; ++ DWORD_PTR system_cpus; + +- /* Prefer affinity-based result, if available ++ /* This *never* fails, use it as fallback + */ +- if( af_count > 0 ) +- nproc = af_count; ++ GetNativeSystemInfo(&sysinfo); ++ nproc = (int) sysinfo.dwNumberOfProcessors; ++ ++ if (GetProcessAffinityMask(GetCurrentProcess(), ++ &process_cpus, &system_cpus)) { ++ unsigned int af_count; ++ ++ for (af_count = 0; process_cpus != 0; process_cpus >>= 1) ++ if (process_cpus & 1) ++ af_count++; ++ ++ /* Prefer affinity-based result, if available ++ */ ++ if (af_count > 0) ++ nproc = af_count; ++ } + } +-} + #endif /*G_OS_WIN32*/ + +- return( nproc ); ++ return (nproc); + #endif /*!GLIB_CHECK_VERSION( 2, 48, 1 )*/ + } + +@@ -278,7 +278,7 @@ get_num_processors( void ) + * or if that is not set, the number of threads available on the host machine. + */ + static int +-vips__concurrency_get_default( void ) ++vips__concurrency_get_default(void) + { + const char *str; + int nthr; +@@ -286,25 +286,26 @@ vips__concurrency_get_default( void ) + + /* Tell the threads system how much concurrency we expect. + */ +- if( vips__concurrency > 0 ) ++ if (vips__concurrency > 0) + nthr = vips__concurrency; +- else if( ((str = g_getenv( "VIPS_CONCURRENCY" )) ++ else if (((str = g_getenv("VIPS_CONCURRENCY")) + #if ENABLE_DEPRECATED +- || (str = g_getenv( "IM_CONCURRENCY" )) ++ || (str = g_getenv("IM_CONCURRENCY")) + #endif +- ) && (x = atoi( str )) > 0 ) ++ ) && ++ (x = atoi(str)) > 0) + nthr = x; +- else ++ else + nthr = get_num_processors(); + +- if( nthr < 1 || +- nthr > MAX_THREADS ) { +- nthr = VIPS_CLIP( 1, nthr, MAX_THREADS ); ++ if (nthr < 1 || ++ nthr > MAX_THREADS) { ++ nthr = VIPS_CLIP(1, nthr, MAX_THREADS); + +- g_warning( _( "threads clipped to %d" ), nthr ); ++ g_warning(_("threads clipped to %d"), nthr); + } + +- return( nthr ); ++ return (nthr); + } + + /** +@@ -312,25 +313,25 @@ vips__concurrency_get_default( void ) + * @concurrency: number of threads to run + * + * Sets the number of worker threads that vips should use when running a +- * #VipsThreadPool. ++ * #VipsThreadPool. + * +- * The special value 0 means "default". In this case, the number of threads +- * is set by the environment variable VIPS_CONCURRENCY, or if that is not ++ * The special value 0 means "default". In this case, the number of threads ++ * is set by the environment variable VIPS_CONCURRENCY, or if that is not + * set, the number of threads available on the host machine. + * + * See also: vips_concurrency_get(). + */ + void +-vips_concurrency_set( int concurrency ) ++vips_concurrency_set(int concurrency) + { + /* Tell the threads system how much concurrency we expect. + */ +- if( concurrency < 1 ) ++ if (concurrency < 1) + concurrency = vips__concurrency_get_default(); +- else if( concurrency > MAX_THREADS ) { ++ else if (concurrency > MAX_THREADS) { + concurrency = MAX_THREADS; + +- g_warning( _( "threads clipped to %d" ), MAX_THREADS ); ++ g_warning(_("threads clipped to %d"), MAX_THREADS); + } + + vips__concurrency = concurrency; +@@ -340,7 +341,7 @@ vips_concurrency_set( int concurrency ) + * vips_concurrency_get: + * + * Returns the number of worker threads that vips should use when running a +- * #VipsThreadPool. ++ * #VipsThreadPool. + * + * vips gets this values from these sources in turn: + * +@@ -352,7 +353,7 @@ vips_concurrency_set( int concurrency ) + * was used, vips uses the value of the environment variable VIPS_CONCURRENCY, + * + * If VIPS_CONCURRENCY has not been set, vips finds the number of hardware +- * threads that the host machine can run in parallel and uses that value. ++ * threads that the host machine can run in parallel and uses that value. + * + * The final value is clipped to the range 1 - 1024. + * +@@ -361,29 +362,29 @@ vips_concurrency_set( int concurrency ) + * Returns: number of worker threads to use. + */ + int +-vips_concurrency_get( void ) ++vips_concurrency_get(void) + { +- return( vips__concurrency ); ++ return (vips__concurrency); + } + + /** + * vips_get_tile_size: (method) + * @im: image to guess for +- * @tile_width: (out): return selected tile width +- * @tile_height: (out): return selected tile height ++ * @tile_width: (out): return selected tile width ++ * @tile_height: (out): return selected tile height + * @n_lines: (out): return buffer height in scanlines + * + * Pick a tile size and a buffer height for this image and the current +- * value of vips_concurrency_get(). The buffer height ++ * value of vips_concurrency_get(). The buffer height + * will always be a multiple of tile_height. + * + * The buffer height is the height of each buffer we fill in sink disc. Since + * we have two buffers, the largest range of input locality is twice the output +- * buffer size, plus whatever margin we add for things like convolution. ++ * buffer size, plus whatever margin we add for things like convolution. + */ + void +-vips_get_tile_size( VipsImage *im, +- int *tile_width, int *tile_height, int *n_lines ) ++vips_get_tile_size(VipsImage *im, ++ int *tile_width, int *tile_height, int *n_lines) + { + const int nthr = vips_concurrency_get(); + const int typical_image_width = 1000; +@@ -395,7 +396,7 @@ vips_get_tile_size( VipsImage *im, + + /* Pick a render geometry. + */ +- switch( im->dhint ) { ++ switch (im->dhint) { + case VIPS_DEMAND_STYLE_SMALLTILE: + *tile_width = vips__tile_width; + *tile_height = vips__tile_height; +@@ -412,8 +413,7 @@ vips_get_tile_size( VipsImage *im, + /* Only enable thinstrip height for very wide images -- the + * overheads are too high to be worthwhile otherwise. + */ +- *tile_height = im->Xsize > 10000 ? +- vips__thinstrip_height : vips__fatstrip_height; ++ *tile_height = im->Xsize > 10000 ? vips__thinstrip_height : vips__fatstrip_height; + break; + + default: +@@ -430,30 +430,30 @@ vips_get_tile_size( VipsImage *im, + * Pick the maximum buffer size we might possibly need, then round up + * to a multiple of tileheight. + */ +- *n_lines = vips__tile_height * +- VIPS_ROUND_UP( vips__tile_width * nthr, +- typical_image_width ) / ++ *n_lines = vips__tile_height * ++ VIPS_ROUND_UP(vips__tile_width * nthr, ++ typical_image_width) / + typical_image_width; +- *n_lines = VIPS_MAX( *n_lines, vips__fatstrip_height * nthr ); +- *n_lines = VIPS_MAX( *n_lines, vips__thinstrip_height * nthr ); +- *n_lines = VIPS_ROUND_UP( *n_lines, *tile_height ); ++ *n_lines = VIPS_MAX(*n_lines, vips__fatstrip_height * nthr); ++ *n_lines = VIPS_MAX(*n_lines, vips__thinstrip_height * nthr); ++ *n_lines = VIPS_ROUND_UP(*n_lines, *tile_height); + + /* We make this assumption in several places. + */ +- g_assert( *n_lines % *tile_height == 0 ); ++ g_assert(*n_lines % *tile_height == 0); + +- VIPS_DEBUG_MSG( "vips_get_tile_size: %d by %d patches, " +- "groups of %d scanlines\n", +- *tile_width, *tile_height, *n_lines ); ++ VIPS_DEBUG_MSG("vips_get_tile_size: %d by %d patches, " ++ "groups of %d scanlines\n", ++ *tile_width, *tile_height, *n_lines); + } + + void +-vips__thread_init( void ) ++vips__thread_init(void) + { +- static GPrivate private = { 0 }; ++ static GPrivate private = { 0 }; + + is_vips_thread_key = &private; + +- if( vips__concurrency == 0 ) ++ if (vips__concurrency == 0) + vips__concurrency = vips__concurrency_get_default(); + } +diff --git a/libvips/iofuncs/threadpool.c b/libvips/iofuncs/threadpool.c +index 8e392faf63..73771f09b7 100644 +--- a/libvips/iofuncs/threadpool.c ++++ b/libvips/iofuncs/threadpool.c +@@ -1,5 +1,5 @@ + /* Support for thread pools ... like threadgroups, but lighter. +- * ++ * + * 18/3/10 + * - from threadgroup.c + * - distributed work allocation idea from Christian Blenia, thank you +@@ -22,37 +22,37 @@ + * - add ->stall + * - don't depend on image width when setting n_lines + * 27/2/19 jtorresfabra +- * - free threadpool earlier ++ * - free threadpool earlier + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +-/* ++/* + #define VIPS_DEBUG + #define VIPS_DEBUG_RED + */ +@@ -80,7 +80,7 @@ + + /** + * SECTION: threadpool +- * @short_description: pools of worker threads ++ * @short_description: pools of worker threads + * @stability: Stable + * @see_also: generate + * @include: vips/vips.h +@@ -112,33 +112,31 @@ static GPrivate *worker_key = NULL; + /* Start up threadpools. This is called during vips_init. + */ + void +-vips__threadpool_init( void ) ++vips__threadpool_init(void) + { +- static GPrivate private = { 0 }; ++ static GPrivate private = { 0 }; + + /* 3 is the useful minimum, and huge values can crash the machine. + */ +- const char *max_threads_env = g_getenv( "VIPS_MAX_THREADS" ); +- int max_threads = max_threads_env ? +- VIPS_CLIP( 3, atoi( max_threads_env ), MAX_THREADS ) : +- 0; ++ const char *max_threads_env = g_getenv("VIPS_MAX_THREADS"); ++ int max_threads = max_threads_env ? VIPS_CLIP(3, atoi(max_threads_env), MAX_THREADS) : 0; + + worker_key = &private; + +- if( g_getenv( "VIPS_STALL" ) ) ++ if (g_getenv("VIPS_STALL")) + vips__stall = TRUE; + + /* max_threads > 0 will create a set of threads on startup. This is + * necessary for wasm, but may break on systems that try to fork() + * after init. + */ +- vips__threadset = vips_threadset_new( max_threads ); ++ vips__threadset = vips_threadset_new(max_threads); + } + + void +-vips__threadpool_shutdown( void ) ++vips__threadpool_shutdown(void) + { +- VIPS_FREEF( vips_threadset_free, vips__threadset ); ++ VIPS_FREEF(vips_threadset_free, vips__threadset); + } + + /** +@@ -153,54 +151,55 @@ vips__threadpool_shutdown( void ) + * Returns: 0 on success, -1 on error. + */ + int +-vips__thread_execute( const char *domain, GFunc func, gpointer data ) ++vips__thread_execute(const char *domain, GFunc func, gpointer data) + { +- return( vips_threadset_run( vips__threadset, domain, func, data ) ); ++ return (vips_threadset_run(vips__threadset, domain, func, data)); + } + +-G_DEFINE_TYPE( VipsThreadState, vips_thread_state, VIPS_TYPE_OBJECT ); ++G_DEFINE_TYPE(VipsThreadState, vips_thread_state, VIPS_TYPE_OBJECT); + + static void +-vips_thread_state_dispose( GObject *gobject ) ++vips_thread_state_dispose(GObject *gobject) + { + VipsThreadState *state = (VipsThreadState *) gobject; + +- VIPS_DEBUG_MSG( "vips_thread_state_dispose:\n" ); ++ VIPS_DEBUG_MSG("vips_thread_state_dispose:\n"); + +- VIPS_UNREF( state->reg ); ++ VIPS_UNREF(state->reg); + +- G_OBJECT_CLASS( vips_thread_state_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_thread_state_parent_class)->dispose(gobject); + } + + static int +-vips_thread_state_build( VipsObject *object ) ++vips_thread_state_build(VipsObject *object) + { + VipsThreadState *state = (VipsThreadState *) object; + +- if( !(state->reg = vips_region_new( state->im )) ) +- return( -1 ); ++ if (!(state->reg = vips_region_new(state->im))) ++ return (-1); + +- return( VIPS_OBJECT_CLASS( +- vips_thread_state_parent_class )->build( object ) ); ++ return (VIPS_OBJECT_CLASS( ++ vips_thread_state_parent_class) ++ ->build(object)); + } + + static void +-vips_thread_state_class_init( VipsThreadStateClass *class ) ++vips_thread_state_class_init(VipsThreadStateClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); + + gobject_class->dispose = vips_thread_state_dispose; + + object_class->build = vips_thread_state_build; + object_class->nickname = "threadstate"; +- object_class->description = _( "per-thread state for vipsthreadpool" ); ++ object_class->description = _("per-thread state for vipsthreadpool"); + } + + static void +-vips_thread_state_init( VipsThreadState *state ) ++vips_thread_state_init(VipsThreadState *state) + { +- VIPS_DEBUG_MSG( "vips_thread_state_init:\n" ); ++ VIPS_DEBUG_MSG("vips_thread_state_init:\n"); + + state->reg = NULL; + state->stop = FALSE; +@@ -208,26 +207,26 @@ vips_thread_state_init( VipsThreadState *state ) + } + + void * +-vips_thread_state_set( VipsObject *object, void *a, void *b ) ++vips_thread_state_set(VipsObject *object, void *a, void *b) + { + VipsThreadState *state = (VipsThreadState *) object; + VipsImage *im = (VipsImage *) a; + +- VIPS_DEBUG_MSG( "vips_thread_state_set: image %p\n", im ); ++ VIPS_DEBUG_MSG("vips_thread_state_set: image %p\n", im); + + state->im = im; + state->a = b; + +- return( NULL ); ++ return (NULL); + } + + VipsThreadState * +-vips_thread_state_new( VipsImage *im, void *a ) ++vips_thread_state_new(VipsImage *im, void *a) + { +- VIPS_DEBUG_MSG( "vips_thread_state_new: image %p\n", im ); ++ VIPS_DEBUG_MSG("vips_thread_state_new: image %p\n", im); + +- return( VIPS_THREAD_STATE( vips_object_new( +- VIPS_TYPE_THREAD_STATE, vips_thread_state_set, im, a ) ) ); ++ return (VIPS_THREAD_STATE(vips_object_new( ++ VIPS_TYPE_THREAD_STATE, vips_thread_state_set, im, a))); + } + + /* What we track for each thread in the pool. +@@ -246,19 +245,19 @@ typedef struct _VipsWorker { + */ + typedef struct _VipsThreadpool { + /*< private >*/ +- VipsImage *im; /* Image we are calculating */ ++ VipsImage *im; /* Image we are calculating */ + +- /* Start a thread, do a unit of work (runs in parallel) and allocate +- * a unit of work (serial). Plus the mutex we use to serialize work ++ /* Start a thread, do a unit of work (runs in parallel) and allocate ++ * a unit of work (serial). Plus the mutex we use to serialize work + * allocation. + */ +- VipsThreadStartFn start; ++ VipsThreadStartFn start; + VipsThreadpoolAllocateFn allocate; + VipsThreadpoolWorkFn work; + GMutex *allocate_lock; +- void *a; /* User argument to start / allocate / etc. */ ++ void *a; /* User argument to start / allocate / etc. */ + +- int max_workers; /* Max number of workers in pool */ ++ int max_workers; /* Max number of workers in pool */ + + /* The number of workers in the pool (as a negative number, so + * -4 means 4 workers are running). +@@ -276,7 +275,7 @@ typedef struct _VipsThreadpool { + + /* Set this to abort evaluation early with an error. + */ +- gboolean error; ++ gboolean error; + + /* Ask threads to exit, either set by allocate, or on free. + */ +@@ -289,20 +288,20 @@ typedef struct _VipsThreadpool { + } VipsThreadpool; + + static int +-vips_worker_allocate( VipsWorker *worker ) ++vips_worker_allocate(VipsWorker *worker) + { + VipsThreadpool *pool = worker->pool; + +- g_assert( !pool->stop ); ++ g_assert(!pool->stop); + +- if( !worker->state && +- !(worker->state = pool->start( pool->im, pool->a )) ) +- return( -1 ); ++ if (!worker->state && ++ !(worker->state = pool->start(pool->im, pool->a))) ++ return (-1); + +- if( pool->allocate( worker->state, pool->a, &pool->stop ) ) +- return( -1 ); ++ if (pool->allocate(worker->state, pool->a, &pool->stop)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Run this once per main loop. Get some work (single-threaded), then do it +@@ -312,72 +311,73 @@ vips_worker_allocate( VipsWorker *worker ) + * loaders a change to seek to the correct spot, see vips_sequential(). + */ + static void +-vips_worker_work_unit( VipsWorker *worker ) ++vips_worker_work_unit(VipsWorker *worker) + { + VipsThreadpool *pool = worker->pool; + +- VIPS_GATE_START( "vips_worker_work_unit: wait" ); ++ VIPS_GATE_START("vips_worker_work_unit: wait"); + +- vips__worker_lock( pool->allocate_lock ); ++ vips__worker_lock(pool->allocate_lock); + +- VIPS_GATE_STOP( "vips_worker_work_unit: wait" ); ++ VIPS_GATE_STOP("vips_worker_work_unit: wait"); + + /* Has another worker signaled stop while we've been waiting? + */ +- if( pool->stop ) { ++ if (pool->stop) { + worker->stop = TRUE; +- g_mutex_unlock( pool->allocate_lock ); ++ g_mutex_unlock(pool->allocate_lock); + return; + } + + /* Has a thread been asked to exit? Volunteer if yes. + */ +- if( g_atomic_int_add( &pool->exit, -1 ) > 0 ) { ++ if (g_atomic_int_add(&pool->exit, -1) > 0) { + /* A thread had been asked to exit, and we've grabbed the + * flag. + */ + worker->stop = TRUE; +- g_mutex_unlock( pool->allocate_lock ); ++ g_mutex_unlock(pool->allocate_lock); + return; + } + else { +- /* No one had been asked to exit and we've mistakenly taken ++ /* No one had been asked to exit and we've mistakenly taken + * the exit count below zero. Put it back up again. + */ +- g_atomic_int_add( &pool->exit, 1 ); ++ g_atomic_int_add(&pool->exit, 1); + } + +- if( vips_worker_allocate( worker ) ) { ++ if (vips_worker_allocate(worker)) { + pool->error = TRUE; + worker->stop = TRUE; +- g_mutex_unlock( pool->allocate_lock ); ++ g_mutex_unlock(pool->allocate_lock); + return; + } + + /* Have we just signalled stop? + */ +- if( pool->stop ) { ++ if (pool->stop) { + worker->stop = TRUE; +- g_mutex_unlock( pool->allocate_lock ); ++ g_mutex_unlock(pool->allocate_lock); + return; + } + +- g_mutex_unlock( pool->allocate_lock ); ++ g_mutex_unlock(pool->allocate_lock); + +- if( worker->state->stall && +- vips__stall ) { ++ if (worker->state->stall && ++ vips__stall) { + /* Sleep for 0.5s. Handy for stressing the seq system. Stall +- * is set by allocate funcs in various places. ++ * is set by allocate funcs in various places. + */ +- g_usleep( 500000 ); ++ g_usleep(500000); + worker->state->stall = FALSE; +- printf( "vips_worker_work_unit: stall done, " +- "releasing y = %d ...\n", worker->state->y ); ++ printf("vips_worker_work_unit: stall done, " ++ "releasing y = %d ...\n", ++ worker->state->y); + } + + /* Process a work unit. + */ +- if( pool->work( worker->state, pool->a ) ) { ++ if (pool->work(worker->state, pool->a)) { + worker->stop = TRUE; + pool->error = TRUE; + } +@@ -386,109 +386,109 @@ vips_worker_work_unit( VipsWorker *worker ) + /* What runs as a thread ... loop, waiting to be told to do stuff. + */ + static void +-vips_thread_main_loop( void *a, void *b ) ++vips_thread_main_loop(void *a, void *b) + { + VipsWorker *worker = (VipsWorker *) a; + VipsThreadpool *pool = worker->pool; + +- g_assert( pool == worker->pool ); ++ g_assert(pool == worker->pool); + +- VIPS_GATE_START( "vips_thread_main_loop: thread" ); ++ VIPS_GATE_START("vips_thread_main_loop: thread"); + +- g_private_set( worker_key, worker ); ++ g_private_set(worker_key, worker); + + /* Process work units! Always tick, even if we are stopping, so the +- * main thread will wake up for exit. ++ * main thread will wake up for exit. + */ +- while( !pool->stop && +- !worker->stop && +- !pool->error ) { +- VIPS_GATE_START( "vips_worker_work_unit: u" ); +- vips_worker_work_unit( worker ); +- VIPS_GATE_STOP( "vips_thread_work_unit: u" ); +- vips_semaphore_up( &pool->tick ); +- } ++ while (!pool->stop && ++ !worker->stop && ++ !pool->error) { ++ VIPS_GATE_START("vips_worker_work_unit: u"); ++ vips_worker_work_unit(worker); ++ VIPS_GATE_STOP("vips_thread_work_unit: u"); ++ vips_semaphore_up(&pool->tick); ++ } + +- VIPS_GATE_STOP( "vips_thread_main_loop: thread" ); ++ VIPS_GATE_STOP("vips_thread_main_loop: thread"); + + /* unreffing the worker state will trigger stop in the threadstate, so + * we need to single-thread. + */ +- g_mutex_lock( pool->allocate_lock ); ++ g_mutex_lock(pool->allocate_lock); + +- VIPS_FREEF( g_object_unref, worker->state ); ++ VIPS_FREEF(g_object_unref, worker->state); + +- g_mutex_unlock( pool->allocate_lock ); ++ g_mutex_unlock(pool->allocate_lock); + +- VIPS_FREE( worker ); +- g_private_set( worker_key, NULL ); ++ VIPS_FREE(worker); ++ g_private_set(worker_key, NULL); + + /* We are done: tell the main thread. + */ +- vips_semaphore_upn( &pool->n_workers, 1 ); ++ vips_semaphore_upn(&pool->n_workers, 1); + } + + /* Attach another thread to a threadpool. + */ + static int +-vips_worker_new( VipsThreadpool *pool ) ++vips_worker_new(VipsThreadpool *pool) + { + VipsWorker *worker; + +- if( !(worker = VIPS_NEW( NULL, VipsWorker )) ) +- return( -1 ); ++ if (!(worker = VIPS_NEW(NULL, VipsWorker))) ++ return (-1); + worker->pool = pool; + worker->state = NULL; + + /* We can't build the state here, it has to be done by the worker +- * itself the first time that allocate runs so that any regions are ++ * itself the first time that allocate runs so that any regions are + * owned by the correct thread. + */ + +- if( vips__thread_execute( "worker", +- vips_thread_main_loop, worker ) ) { +- g_free( worker ); +- return( -1 ); ++ if (vips__thread_execute("worker", ++ vips_thread_main_loop, worker)) { ++ g_free(worker); ++ return (-1); + } + + /* One more worker in the pool. + */ +- vips_semaphore_upn( &pool->n_workers, -1 ); ++ vips_semaphore_upn(&pool->n_workers, -1); + +- return( 0 ); ++ return (0); + } + + void +-vips__worker_lock( GMutex *mutex ) ++vips__worker_lock(GMutex *mutex) + { +- VipsWorker *worker = (VipsWorker *) g_private_get( worker_key ); ++ VipsWorker *worker = (VipsWorker *) g_private_get(worker_key); + +- if( worker ) +- g_atomic_int_add( &worker->pool->n_waiting, 1 ); +- g_mutex_lock( mutex ); +- if( worker ) +- g_atomic_int_add( &worker->pool->n_waiting, -1 ); ++ if (worker) ++ g_atomic_int_add(&worker->pool->n_waiting, 1); ++ g_mutex_lock(mutex); ++ if (worker) ++ g_atomic_int_add(&worker->pool->n_waiting, -1); + } + + static void +-vips_threadpool_free( VipsThreadpool *pool ) ++vips_threadpool_free(VipsThreadpool *pool) + { +- VIPS_DEBUG_MSG( "vips_threadpool_free: \"%s\" (%p)\n", +- pool->im->filename, pool ); ++ VIPS_DEBUG_MSG("vips_threadpool_free: \"%s\" (%p)\n", ++ pool->im->filename, pool); + + /* Wait for them all to exit. + */ + pool->stop = TRUE; +- vips_semaphore_downn( &pool->n_workers, 0 ); ++ vips_semaphore_downn(&pool->n_workers, 0); + +- VIPS_FREEF( vips_g_mutex_free, pool->allocate_lock ); +- vips_semaphore_destroy( &pool->n_workers ); +- vips_semaphore_destroy( &pool->tick ); +- VIPS_FREE( pool ); ++ VIPS_FREEF(vips_g_mutex_free, pool->allocate_lock); ++ vips_semaphore_destroy(&pool->n_workers); ++ vips_semaphore_destroy(&pool->tick); ++ VIPS_FREE(pool); + } + + static VipsThreadpool * +-vips_threadpool_new( VipsImage *im ) ++vips_threadpool_new(VipsImage *im) + { + VipsThreadpool *pool; + int tile_width; +@@ -498,40 +498,40 @@ vips_threadpool_new( VipsImage *im ) + + /* Allocate and init new thread block. + */ +- if( !(pool = VIPS_NEW( NULL, VipsThreadpool )) ) +- return( NULL ); ++ if (!(pool = VIPS_NEW(NULL, VipsThreadpool))) ++ return (NULL); + pool->im = im; + pool->allocate = NULL; + pool->work = NULL; + pool->allocate_lock = vips_g_mutex_new(); + pool->max_workers = vips_concurrency_get(); +- vips_semaphore_init( &pool->n_workers, 0, "n_workers" ); +- vips_semaphore_init( &pool->tick, 0, "tick" ); ++ vips_semaphore_init(&pool->n_workers, 0, "n_workers"); ++ vips_semaphore_init(&pool->tick, 0, "tick"); + pool->error = FALSE; + pool->stop = FALSE; + pool->exit = 0; + +- /* If this is a tiny image, we won't need all max_workers threads. ++ /* If this is a tiny image, we won't need all max_workers threads. + * Guess how + * many tiles we might need to cover the image and use that to limit + * the number of threads we create. + */ +- vips_get_tile_size( im, &tile_width, &tile_height, &n_lines ); +- n_tiles = (1 + (gint64) im->Xsize / tile_width) * ++ vips_get_tile_size(im, &tile_width, &tile_height, &n_lines); ++ n_tiles = (1 + (gint64) im->Xsize / tile_width) * + (1 + (gint64) im->Ysize / tile_height); +- n_tiles = VIPS_CLIP( 1, n_tiles, 1024 ); +- pool->max_workers = VIPS_MIN( pool->max_workers, n_tiles ); ++ n_tiles = VIPS_CLIP(1, n_tiles, 1024); ++ pool->max_workers = VIPS_MIN(pool->max_workers, n_tiles); + +- /* VIPS_META_CONCURRENCY on the image can optionally override ++ /* VIPS_META_CONCURRENCY on the image can optionally override + * concurrency. + */ +- pool->max_workers = vips_image_get_concurrency( im, pool->max_workers ); ++ pool->max_workers = vips_image_get_concurrency(im, pool->max_workers); + +- VIPS_DEBUG_MSG( "vips_threadpool_new: " +- "\"%s\" (%p), with %d threads\n", +- im->filename, pool, pool->max_workers ); ++ VIPS_DEBUG_MSG("vips_threadpool_new: " ++ "\"%s\" (%p), with %d threads\n", ++ im->filename, pool, pool->max_workers); + +- return( pool ); ++ return (pool); + } + + /** +@@ -562,9 +562,9 @@ vips_threadpool_new( VipsImage *im ) + * + * This function is called to allocate a new work unit for the thread. It is + * always single-threaded, so it can modify per-pool state (such as a +- * counter). ++ * counter). + * +- * @a, @b, @c are the values supplied to the call to ++ * @a, @b, @c are the values supplied to the call to + * vips_threadpool_run(). + * + * It should set @stop to %TRUE to indicate that no work could be allocated +@@ -586,7 +586,7 @@ vips_threadpool_new( VipsImage *im ) + * at once, so it should not write to the per-pool state. It can write to + * per-thread state. + * +- * @a, @b, @c are the values supplied to the call to ++ * @a, @b, @c are the values supplied to the call to + * vips_threadpool_run(). + * + * See also: vips_threadpool_run(). +@@ -625,11 +625,11 @@ vips_threadpool_new( VipsImage *im ) + * progress feedback. @progress may be %NULL. + * + * The object returned by @start must be an instance of a subclass of +- * #VipsThreadState. Use this to communicate between @allocate and @work. ++ * #VipsThreadState. Use this to communicate between @allocate and @work. + * +- * @allocate and @start are always single-threaded (so they can write to the +- * per-pool state), whereas @work can be executed concurrently. @progress is +- * always called by ++ * @allocate and @start are always single-threaded (so they can write to the ++ * per-pool state), whereas @work can be executed concurrently. @progress is ++ * always called by + * the main thread (ie. the thread which called vips_threadpool_run()). + * + * See also: vips_concurrency_set(). +@@ -637,20 +637,20 @@ vips_threadpool_new( VipsImage *im ) + * Returns: 0 on success, or -1 on error. + */ + int +-vips_threadpool_run( VipsImage *im, +- VipsThreadStartFn start, +- VipsThreadpoolAllocateFn allocate, ++vips_threadpool_run(VipsImage *im, ++ VipsThreadStartFn start, ++ VipsThreadpoolAllocateFn allocate, + VipsThreadpoolWorkFn work, +- VipsThreadpoolProgressFn progress, +- void *a ) ++ VipsThreadpoolProgressFn progress, ++ void *a) + { +- VipsThreadpool *pool; ++ VipsThreadpool *pool; + int result; + int n_waiting; + int n_working; + +- if( !(pool = vips_threadpool_new( im )) ) +- return( -1 ); ++ if (!(pool = vips_threadpool_new(im))) ++ return (-1); + + pool->start = start; + pool->allocate = allocate; +@@ -660,48 +660,48 @@ vips_threadpool_run( VipsImage *im, + /* Start with half of the max number of threads, then let it drift up + * and down with load. + */ +- for( n_working = 0; n_working < 1 + pool->max_workers / 2; n_working++ ) +- if( vips_worker_new( pool ) ) { +- vips_threadpool_free( pool ); +- return( -1 ); ++ for (n_working = 0; n_working < 1 + pool->max_workers / 2; n_working++) ++ if (vips_worker_new(pool)) { ++ vips_threadpool_free(pool); ++ return (-1); + } + +- for(;;) { ++ for (;;) { + /* Wait for a tick from a worker. + */ +- vips_semaphore_down( &pool->tick ); ++ vips_semaphore_down(&pool->tick); + +- VIPS_DEBUG_MSG( "vips_threadpool_run: tick\n" ); ++ VIPS_DEBUG_MSG("vips_threadpool_run: tick\n"); + +- if( pool->stop || +- pool->error ) ++ if (pool->stop || ++ pool->error) + break; + +- if( progress && +- progress( pool->a ) ) ++ if (progress && ++ progress(pool->a)) + pool->error = TRUE; + +- if( pool->stop || +- pool->error ) ++ if (pool->stop || ++ pool->error) + break; + +- n_waiting = g_atomic_int_get( &pool->n_waiting ); +- VIPS_DEBUG_MSG( "n_waiting = %d\n", n_waiting ); +- VIPS_DEBUG_MSG( "n_working = %d\n", n_working ); +- VIPS_DEBUG_MSG( "exit = %d\n", pool->exit ); ++ n_waiting = g_atomic_int_get(&pool->n_waiting); ++ VIPS_DEBUG_MSG("n_waiting = %d\n", n_waiting); ++ VIPS_DEBUG_MSG("n_working = %d\n", n_working); ++ VIPS_DEBUG_MSG("exit = %d\n", pool->exit); + +- if( n_waiting > 3 && +- n_working > 1 ) { +- VIPS_DEBUG_MSG( "shrinking thread pool\n" ); +- g_atomic_int_add( &pool->exit, 1 ); ++ if (n_waiting > 3 && ++ n_working > 1) { ++ VIPS_DEBUG_MSG("shrinking thread pool\n"); ++ g_atomic_int_add(&pool->exit, 1); + n_working -= 1; + } +- else if( n_waiting < 2 && +- n_working < pool->max_workers ) { +- VIPS_DEBUG_MSG( "expanding thread pool\n" ); +- if( vips_worker_new( pool ) ) { +- vips_threadpool_free( pool ); +- return( -1 ); ++ else if (n_waiting < 2 && ++ n_working < pool->max_workers) { ++ VIPS_DEBUG_MSG("expanding thread pool\n"); ++ if (vips_worker_new(pool)) { ++ vips_threadpool_free(pool); ++ return (-1); + } + n_working += 1; + } +@@ -717,9 +717,9 @@ vips_threadpool_run( VipsImage *im, + */ + result = pool->error ? -1 : 0; + +- vips_threadpool_free( pool ); ++ vips_threadpool_free(pool); + +- vips_image_minimise_all( im ); ++ vips_image_minimise_all(im); + +- return( result ); ++ return (result); + } +diff --git a/libvips/iofuncs/threadset.c b/libvips/iofuncs/threadset.c +index 4e9cb10ce2..6059a7e767 100644 +--- a/libvips/iofuncs/threadset.c ++++ b/libvips/iofuncs/threadset.c +@@ -1,4 +1,4 @@ +-/* A set of threads. ++/* A set of threads. + * + * Creating and destroying threads can be expensive on some platforms, so we + * try to only create once, then reuse. +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -60,7 +60,7 @@ typedef struct _VipsThreadsetMember { + /* The task the thread should run next. + */ + const char *domain; +- GFunc func; ++ GFunc func; + void *data; + void *user_data; + +@@ -84,7 +84,7 @@ struct _VipsThreadset { + */ + GSList *free; + +- /* The current number of threads, the highwater mark, and ++ /* The current number of threads, the highwater mark, and + * the max we allow before blocking thread creation. + */ + int n_threads; +@@ -95,27 +95,27 @@ struct _VipsThreadset { + /* The thread work function. + */ + static void * +-vips_threadset_work( void *pointer ) ++vips_threadset_work(void *pointer) + { + VipsThreadsetMember *member = (VipsThreadsetMember *) pointer; + VipsThreadset *set = member->set; + +- for(;;) { ++ for (;;) { + /* Wait to be given work. + */ +- vips_semaphore_down( &member->idle ); +- if( member->kill || +- !member->func ) ++ vips_semaphore_down(&member->idle); ++ if (member->kill || ++ !member->func) + break; + + /* If we're profiling, attach a prof struct to this thread. + */ +- if( vips__thread_profile ) +- vips__thread_profile_attach( member->domain ); ++ if (vips__thread_profile) ++ vips__thread_profile_attach(member->domain); + + /* Execute the task. + */ +- member->func( member->data, member->user_data ); ++ member->func(member->data, member->user_data); + + /* Free any thread-private resources -- they will not be + * useful for the next task to use this thread. +@@ -129,60 +129,61 @@ vips_threadset_work( void *pointer ) + + /* We are free ... back on the free list! + */ +- g_mutex_lock( set->lock ); +- set->free = g_slist_prepend( set->free, member ); +- g_mutex_unlock( set->lock ); ++ g_mutex_lock(set->lock); ++ set->free = g_slist_prepend(set->free, member); ++ g_mutex_unlock(set->lock); + } + +- /* Kill has been requested. We leave this thread on the members ++ /* Kill has been requested. We leave this thread on the members + * list so it can be found and joined. + */ + +- return( NULL ); ++ return (NULL); + } + + /* Create a new idle member for the set. + */ + static VipsThreadsetMember * +-vips_threadset_add( VipsThreadset *set ) ++vips_threadset_add(VipsThreadset *set) + { + VipsThreadsetMember *member; + +- if( set->max_threads && +- set->n_threads >= set->max_threads ) { +- vips_error( "VipsThreadset", +- "%s", _( "threadset is exhausted" ) ); +- return( NULL ); ++ if (set->max_threads && ++ set->n_threads >= set->max_threads) { ++ vips_error("VipsThreadset", ++ "%s", _("threadset is exhausted")); ++ return (NULL); + } + +- member = g_new0( VipsThreadsetMember, 1 ); ++ member = g_new0(VipsThreadsetMember, 1); + member->set = set; + +- vips_semaphore_init( &member->idle, 0, "idle" ); ++ vips_semaphore_init(&member->idle, 0, "idle"); + +- if( !(member->thread = vips_g_thread_new( "libvips worker", +- vips_threadset_work, member )) ) { +- vips_semaphore_destroy( &member->idle ); +- VIPS_FREE( member ); ++ if (!(member->thread = vips_g_thread_new("libvips worker", ++ vips_threadset_work, member))) { ++ vips_semaphore_destroy(&member->idle); ++ VIPS_FREE(member); + +- return( NULL ); ++ return (NULL); + } + +- g_mutex_lock( set->lock ); +- set->members = g_slist_prepend( set->members, member ); ++ g_mutex_lock(set->lock); ++ set->members = g_slist_prepend(set->members, member); + set->n_threads += 1; +- set->n_threads_highwater = +- VIPS_MAX( set->n_threads_highwater, set->n_threads );; +- g_mutex_unlock( set->lock ); ++ set->n_threads_highwater = ++ VIPS_MAX(set->n_threads_highwater, set->n_threads); ++ ; ++ g_mutex_unlock(set->lock); + +- return( member ); ++ return (member); + } + +-/** ++/** + * vips_threadset_new: + * @max_threads: maxium number of system threads + * +- * Create a new threadset. ++ * Create a new threadset. + * + * If @max_threads is 0, new threads will be created when necessary by + * vips_threadset_run(), with no limit on the number of threads. +@@ -194,31 +195,31 @@ vips_threadset_add( VipsThreadset *set ) + * Returns: the new threadset. + */ + VipsThreadset * +-vips_threadset_new( int max_threads ) ++vips_threadset_new(int max_threads) + { + VipsThreadset *set; + +- set = g_new0( VipsThreadset, 1 ); ++ set = g_new0(VipsThreadset, 1); + set->lock = vips_g_mutex_new(); + set->max_threads = max_threads; + +- if( set->max_threads > 0 ) +- for( int i = 0; i < set->max_threads; i++ ) { ++ if (set->max_threads > 0) ++ for (int i = 0; i < set->max_threads; i++) { + VipsThreadsetMember *member; + +- if( !(member = vips_threadset_add( set )) ) { +- vips_threadset_free( set ); +- return( NULL ); ++ if (!(member = vips_threadset_add(set))) { ++ vips_threadset_free(set); ++ return (NULL); + } + +- set->free = g_slist_prepend( set->free, member ); ++ set->free = g_slist_prepend(set->free, member); + } + +- return( set ); ++ return (set); + } + + /** +- * vips_threadset_run: ++ * vips_threadset_run: + * @set: the threadset to run the task in + * @domain: the name of the task (useful for debugging) + * @func: the task to execute +@@ -232,8 +233,8 @@ vips_threadset_new( int max_threads ) + * Returns: 0 on success, or -1 on error. + */ + int +-vips_threadset_run( VipsThreadset *set, +- const char *domain, GFunc func, gpointer data ) ++vips_threadset_run(VipsThreadset *set, ++ const char *domain, GFunc func, gpointer data) + { + VipsThreadsetMember *member; + +@@ -241,22 +242,22 @@ vips_threadset_run( VipsThreadset *set, + + /* Try to get an idle thread. + */ +- g_mutex_lock( set->lock ); +- if( set->free ) { ++ g_mutex_lock(set->lock); ++ if (set->free) { + member = (VipsThreadsetMember *) set->free->data; +- set->free = g_slist_remove( set->free, member ); ++ set->free = g_slist_remove(set->free, member); + } +- g_mutex_unlock( set->lock ); ++ g_mutex_unlock(set->lock); + + /* None? Make a new idle but not free member. + */ +- if( !member ) +- member = vips_threadset_add( set ); ++ if (!member) ++ member = vips_threadset_add(set); + + /* Still nothing? Thread create has failed. + */ +- if( !member ) +- return( -1 ); ++ if (!member) ++ return (-1); + + /* Allocate the task and set it going. + */ +@@ -264,33 +265,33 @@ vips_threadset_run( VipsThreadset *set, + member->func = func; + member->data = data; + member->user_data = NULL; +- vips_semaphore_up( &member->idle ); ++ vips_semaphore_up(&member->idle); + +- return( 0 ); ++ return (0); + } + + /* Kill a member. + */ + static void +-vips_threadset_kill_member( VipsThreadsetMember *member ) ++vips_threadset_kill_member(VipsThreadsetMember *member) + { + VipsThreadset *set = member->set; + + member->kill = TRUE; +- vips_semaphore_up( &member->idle ); +- g_thread_join( member->thread ); ++ vips_semaphore_up(&member->idle); ++ g_thread_join(member->thread); + +- vips_semaphore_destroy( &member->idle ); ++ vips_semaphore_destroy(&member->idle); + +- g_mutex_lock( set->lock ); +- set->free = g_slist_remove( set->free, member ); ++ g_mutex_lock(set->lock); ++ set->free = g_slist_remove(set->free, member); + set->n_threads -= 1; +- g_mutex_unlock( set->lock ); ++ g_mutex_unlock(set->lock); + +- VIPS_FREE( member ); ++ VIPS_FREE(member); + } + +-/** ++/** + * vips_threadset_free: + * @set: the threadset to free + * +@@ -298,33 +299,33 @@ vips_threadset_kill_member( VipsThreadsetMember *member ) + * finished. + */ + void +-vips_threadset_free( VipsThreadset *set ) ++vips_threadset_free(VipsThreadset *set) + { +- VIPS_DEBUG_MSG( "vips_threadset_free: %p\n", set ); ++ VIPS_DEBUG_MSG("vips_threadset_free: %p\n", set); + + /* Try to get and finish a thread. + */ +- for(;;) { ++ for (;;) { + VipsThreadsetMember *member; + + member = NULL; +- g_mutex_lock( set->lock ); +- if( set->members ) { ++ g_mutex_lock(set->lock); ++ if (set->members) { + member = (VipsThreadsetMember *) set->members->data; +- set->members = g_slist_remove( set->members, member ); ++ set->members = g_slist_remove(set->members, member); + } +- g_mutex_unlock( set->lock ); ++ g_mutex_unlock(set->lock); + +- if( !member ) ++ if (!member) + break; + +- vips_threadset_kill_member( member ); ++ vips_threadset_kill_member(member); + } + +- if( vips__leak ) +- printf( "vips_threadset_free: peak of %d threads\n", +- set->n_threads_highwater ); ++ if (vips__leak) ++ printf("vips_threadset_free: peak of %d threads\n", ++ set->n_threads_highwater); + +- VIPS_FREEF( vips_g_mutex_free, set->lock ); +- VIPS_FREE( set ); ++ VIPS_FREEF(vips_g_mutex_free, set->lock); ++ VIPS_FREE(set); + } +diff --git a/libvips/iofuncs/type.c b/libvips/iofuncs/type.c +index affc25de96..79ffef7a9a 100644 +--- a/libvips/iofuncs/type.c ++++ b/libvips/iofuncs/type.c +@@ -1,4 +1,4 @@ +-/* array type ++/* array type + * + * Unlike GArray, this has fixed length, tracks a GType for elements, and has + * a per-element free function. +@@ -13,28 +13,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -63,7 +63,7 @@ + * @stability: Stable + * @include: vips/vips.h + * +- * A few simple typedefs used by VIPS. ++ * A few simple typedefs used by VIPS. + */ + + /** +@@ -73,7 +73,7 @@ + * @see_also: header + * @include: vips/vips.h + * +- * A selection of %GType defintions used by VIPS. ++ * A selection of %GType defintions used by VIPS. + */ + + /* A very simple boxed type for testing. Just an int. +@@ -96,95 +96,95 @@ + * Returns: (transfer full): a new #VipsThing. + */ + VipsThing * +-vips_thing_new( int i ) ++vips_thing_new(int i) + { + VipsThing *thing; + +- thing = g_new( VipsThing, 1 ); ++ thing = g_new(VipsThing, 1); + thing->i = i; + +- printf( "vips_thing_new: %d %p\n", i, thing ); ++ printf("vips_thing_new: %d %p\n", i, thing); + +- return( thing ); ++ return (thing); + } + + static VipsThing * +-vips_thing_copy( VipsThing *thing ) ++vips_thing_copy(VipsThing *thing) + { + VipsThing *thing2; + +- thing2 = vips_thing_new( thing->i ); ++ thing2 = vips_thing_new(thing->i); + +- printf( "vips_thing_copy: %d %p = %p\n", thing->i, thing2, thing ); ++ printf("vips_thing_copy: %d %p = %p\n", thing->i, thing2, thing); + +- return( thing2 ); ++ return (thing2); + } + + static void +-vips_thing_free( VipsThing *thing ) ++vips_thing_free(VipsThing *thing) + { +- printf( "vips_thing_free: %d %p\n", thing->i, thing ); ++ printf("vips_thing_free: %d %p\n", thing->i, thing); + +- g_free( thing ); ++ g_free(thing); + } + + /* +- * glib-2.26+ only +- ++ * glib-2.26+ only ++ + G_DEFINE_BOXED_TYPE( VipsThing, vips_thing, +- (GBoxedCopyFunc) vips_thing_copy, ++ (GBoxedCopyFunc) vips_thing_copy, + (GBoxedFreeFunc) vips_thing_free ); + + */ + + GType +-vips_thing_get_type( void ) ++vips_thing_get_type(void) + { + static GType type = 0; + +- if( !type ) { +- type = g_boxed_type_register_static( "VipsThing", +- (GBoxedCopyFunc) vips_thing_copy, +- (GBoxedFreeFunc) vips_thing_free ); ++ if (!type) { ++ type = g_boxed_type_register_static("VipsThing", ++ (GBoxedCopyFunc) vips_thing_copy, ++ (GBoxedFreeFunc) vips_thing_free); + } + +- return( type ); ++ return (type); + } + + static GSList *vips_area_all = NULL; + + VipsArea * +-vips_area_copy( VipsArea *area ) ++vips_area_copy(VipsArea *area) + { +- g_mutex_lock( area->lock ); ++ g_mutex_lock(area->lock); + +- g_assert( area->count > 0 ); ++ g_assert(area->count > 0); + + area->count += 1; + + #ifdef DEBUG +- printf( "vips_area_copy: %p count = %d\n", area, area->count ); ++ printf("vips_area_copy: %p count = %d\n", area, area->count); + #endif /*DEBUG*/ + +- g_mutex_unlock( area->lock ); ++ g_mutex_unlock(area->lock); + +- return( area ); ++ return (area); + } + + int +-vips_area_free_cb( void *mem, VipsArea *area ) ++vips_area_free_cb(void *mem, VipsArea *area) + { +- g_free( mem ); ++ g_free(mem); + +- return( 0 ); ++ return (0); + } + + static void +-vips_area_free( VipsArea *area ) ++vips_area_free(VipsArea *area) + { +- if( area->free_fn && +- area->data ) { +- area->free_fn( area->data, area ); ++ if (area->free_fn && ++ area->data) { ++ area->free_fn(area->data, area); + area->free_fn = NULL; + } + +@@ -192,48 +192,48 @@ vips_area_free( VipsArea *area ) + } + + void +-vips_area_unref( VipsArea *area ) ++vips_area_unref(VipsArea *area) + { +- g_mutex_lock( area->lock ); ++ g_mutex_lock(area->lock); + +- g_assert( area->count > 0 ); ++ g_assert(area->count > 0); + + area->count -= 1; + + #ifdef DEBUG +- printf( "vips_area_unref: %p count = %d\n", area, area->count ); ++ printf("vips_area_unref: %p count = %d\n", area, area->count); + #endif /*DEBUG*/ + +- if( vips__leak ) { +- g_mutex_lock( vips__global_lock ); +- g_assert( g_slist_find( vips_area_all, area ) ); +- g_mutex_unlock( vips__global_lock ); ++ if (vips__leak) { ++ g_mutex_lock(vips__global_lock); ++ g_assert(g_slist_find(vips_area_all, area)); ++ g_mutex_unlock(vips__global_lock); + } + +- if( area->count == 0 ) { +- vips_area_free( area ); ++ if (area->count == 0) { ++ vips_area_free(area); + +- g_mutex_unlock( area->lock ); ++ g_mutex_unlock(area->lock); + +- VIPS_FREEF( vips_g_mutex_free, area->lock ); ++ VIPS_FREEF(vips_g_mutex_free, area->lock); + +- g_free( area ); ++ g_free(area); + +- if( vips__leak ) { +- g_mutex_lock( vips__global_lock ); +- vips_area_all = g_slist_remove( vips_area_all, area ); +- g_mutex_unlock( vips__global_lock ); ++ if (vips__leak) { ++ g_mutex_lock(vips__global_lock); ++ vips_area_all = g_slist_remove(vips_area_all, area); ++ g_mutex_unlock(vips__global_lock); + } + + #ifdef DEBUG +- g_mutex_lock( vips__global_lock ); +- printf( "vips_area_unref: free .. total = %d\n", +- g_slist_length( vips_area_all ) ); +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); ++ printf("vips_area_unref: free .. total = %d\n", ++ g_slist_length(vips_area_all)); ++ g_mutex_unlock(vips__global_lock); + #endif /*DEBUG*/ + } + else +- g_mutex_unlock( area->lock ); ++ g_mutex_unlock(area->lock); + } + + /** +@@ -246,7 +246,7 @@ vips_area_unref( VipsArea *area ) + * + * This type is used for things like passing an array of double or an array of + * #VipsObject pointers to operations, and for reference-counted immutable +- * strings. ++ * strings. + * + * Inital count == 1, so _unref() after attaching somewhere. + * +@@ -255,11 +255,11 @@ vips_area_unref( VipsArea *area ) + * Returns: (transfer full): the new #VipsArea. + */ + VipsArea * +-vips_area_new( VipsCallbackFn free_fn, void *data ) ++vips_area_new(VipsCallbackFn free_fn, void *data) + { + VipsArea *area; + +- area = g_new( VipsArea, 1 ); ++ area = g_new(VipsArea, 1); + area->count = 1; + area->lock = vips_g_mutex_new(); + area->length = 0; +@@ -268,46 +268,46 @@ vips_area_new( VipsCallbackFn free_fn, void *data ) + area->type = 0; + area->sizeof_type = 0; + +- if( vips__leak ) { +- g_mutex_lock( vips__global_lock ); +- vips_area_all = g_slist_prepend( vips_area_all, area ); +- g_mutex_unlock( vips__global_lock ); ++ if (vips__leak) { ++ g_mutex_lock(vips__global_lock); ++ vips_area_all = g_slist_prepend(vips_area_all, area); ++ g_mutex_unlock(vips__global_lock); + } + + #ifdef DEBUG +- g_mutex_lock( vips__global_lock ); +- printf( "vips_area_new: %p count = %d (%d in total)\n", +- area, area->count, +- g_slist_length( vips_area_all ) ); +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); ++ printf("vips_area_new: %p count = %d (%d in total)\n", ++ area, area->count, ++ g_slist_length(vips_area_all)); ++ g_mutex_unlock(vips__global_lock); + #endif /*DEBUG*/ + +- return( area ); ++ return (area); + } + + int +-vips__type_leak( void ) ++vips__type_leak(void) + { + int n_leaks; + + n_leaks = 0; + +- if( vips_area_all ) { +- GSList *p; ++ if (vips_area_all) { ++ GSList *p; + +- fprintf( stderr, "%d VipsArea alive\n", +- g_slist_length( vips_area_all ) ); +- for( p = vips_area_all; p; p = p->next ) { +- VipsArea *area = VIPS_AREA( p->data ); ++ fprintf(stderr, "%d VipsArea alive\n", ++ g_slist_length(vips_area_all)); ++ for (p = vips_area_all; p; p = p->next) { ++ VipsArea *area = VIPS_AREA(p->data); + +- fprintf( stderr, "\t%p count = %d, bytes = %zd\n", +- area, area->count, area->length ); ++ fprintf(stderr, "\t%p count = %d, bytes = %zd\n", ++ area, area->count, area->length); + + n_leaks += 1; + } + } + +- return( n_leaks ); ++ return (n_leaks); + } + + /** +@@ -324,33 +324,33 @@ vips__type_leak( void ) + * Returns: (transfer full): the new #VipsArea. + */ + VipsArea * +-vips_area_new_array( GType type, size_t sizeof_type, int n ) ++vips_area_new_array(GType type, size_t sizeof_type, int n) + { + VipsArea *area; + void *array; + +- array = g_malloc( n * sizeof_type ); +- area = vips_area_new( (VipsCallbackFn) vips_area_free_cb, array ); ++ array = g_malloc(n * sizeof_type); ++ area = vips_area_new((VipsCallbackFn) vips_area_free_cb, array); + area->n = n; + area->length = n * sizeof_type; + area->type = type; + area->sizeof_type = sizeof_type; + +- return( area ); ++ return (area); + } + + static int +-vips_area_free_array_object( GObject **array, VipsArea *area ) ++vips_area_free_array_object(GObject **array, VipsArea *area) + { + int i; + +- for( i = 0; i < area->n; i++ ) +- VIPS_FREEF( g_object_unref, array[i] ); +- VIPS_FREE( array ); ++ for (i = 0; i < area->n; i++) ++ VIPS_FREEF(g_object_unref, array[i]); ++ VIPS_FREE(array); + + area->n = 0; + +- return( 0 ); ++ return (0); + } + + /** +@@ -361,27 +361,27 @@ vips_area_free_array_object( GObject **array, VipsArea *area ) + * the area is freed, each %GObject will be unreffed. + * + * Add an extra NULL element at the end, handy for eg. +- * vips_image_pipeline_array() etc. ++ * vips_image_pipeline_array() etc. + * + * See also: vips_area_unref(). + * + * Returns: (transfer full): the new #VipsArea. + */ + VipsArea * +-vips_area_new_array_object( int n ) ++vips_area_new_array_object(int n) + { + GObject **array; + VipsArea *area; + +- array = g_new0( GObject *, n + 1 ); +- area = vips_area_new( (VipsCallbackFn) vips_area_free_array_object, +- array ); ++ array = g_new0(GObject *, n + 1); ++ area = vips_area_new((VipsCallbackFn) vips_area_free_array_object, ++ array); + area->n = n; +- area->length = n * sizeof( GObject * ); ++ area->length = n * sizeof(GObject *); + area->type = G_TYPE_OBJECT; +- area->sizeof_type = sizeof( GObject * ); ++ area->sizeof_type = sizeof(GObject *); + +- return( area ); ++ return (area); + } + + /** +@@ -392,115 +392,115 @@ vips_area_new_array_object( int n ) + * @type: (out) (optional): optionally return element type here + * @sizeof_type: (out) (optional): optionally return sizeof() element type here + * +- * Return the data pointer plus optionally the length in bytes of an area, ++ * Return the data pointer plus optionally the length in bytes of an area, + * the number of elements, the %GType of each element and the sizeof() each + * element. + * + * Returns: (transfer none): The pointer held by @area. + */ + void * +-vips_area_get_data( VipsArea *area, +- size_t *length, int *n, GType *type, size_t *sizeof_type ) ++vips_area_get_data(VipsArea *area, ++ size_t *length, int *n, GType *type, size_t *sizeof_type) + { +- if( !area ) +- return( NULL ); ++ if (!area) ++ return (NULL); + +- if( length ) ++ if (length) + *length = area->length; +- if( n ) ++ if (n) + *n = area->n; +- if( type ) ++ if (type) + *type = area->type; +- if( sizeof_type ) ++ if (sizeof_type) + *sizeof_type = area->sizeof_type; + +- return( area->data ); ++ return (area->data); + } + + /* Transform an area to a G_TYPE_STRING. + */ + static void +-transform_area_g_string( const GValue *src_value, GValue *dest_value ) ++transform_area_g_string(const GValue *src_value, GValue *dest_value) + { + VipsArea *area; + char buf[256]; + +- area = g_value_get_boxed( src_value ); +- vips_snprintf( buf, 256, "VIPS_TYPE_AREA, count = %d, data = %p", +- area->count, area->data ); +- g_value_set_string( dest_value, buf ); ++ area = g_value_get_boxed(src_value); ++ vips_snprintf(buf, 256, "VIPS_TYPE_AREA, count = %d, data = %p", ++ area->count, area->data); ++ g_value_set_string(dest_value, buf); + } + + GType +-vips_area_get_type( void ) ++vips_area_get_type(void) + { + static GType type = 0; + +- if( !type ) { +- type = g_boxed_type_register_static( "VipsArea", +- (GBoxedCopyFunc) vips_area_copy, +- (GBoxedFreeFunc) vips_area_unref ); +- g_value_register_transform_func( type, G_TYPE_STRING, +- transform_area_g_string ); ++ if (!type) { ++ type = g_boxed_type_register_static("VipsArea", ++ (GBoxedCopyFunc) vips_area_copy, ++ (GBoxedFreeFunc) vips_area_unref); ++ g_value_register_transform_func(type, G_TYPE_STRING, ++ transform_area_g_string); + } + +- return( type ); ++ return (type); + } + + /* Transform funcs for builtin types to SAVE_STRING. + */ + static void +-transform_int_save_string( const GValue *src_value, GValue *dest_value ) ++transform_int_save_string(const GValue *src_value, GValue *dest_value) + { +- vips_value_set_save_stringf( dest_value, +- "%d", g_value_get_int( src_value ) ); ++ vips_value_set_save_stringf(dest_value, ++ "%d", g_value_get_int(src_value)); + } + + static void +-transform_save_string_int( const GValue *src_value, GValue *dest_value ) ++transform_save_string_int(const GValue *src_value, GValue *dest_value) + { +- g_value_set_int( dest_value, +- atoi( vips_value_get_save_string( src_value ) ) ); ++ g_value_set_int(dest_value, ++ atoi(vips_value_get_save_string(src_value))); + } + + static void +-transform_double_save_string( const GValue *src_value, GValue *dest_value ) ++transform_double_save_string(const GValue *src_value, GValue *dest_value) + { + char buf[G_ASCII_DTOSTR_BUF_SIZE]; + + /* Need to be locale independent. + */ +- g_ascii_dtostr( buf, G_ASCII_DTOSTR_BUF_SIZE, +- g_value_get_double( src_value ) ); +- vips_value_set_save_string( dest_value, buf ); ++ g_ascii_dtostr(buf, G_ASCII_DTOSTR_BUF_SIZE, ++ g_value_get_double(src_value)); ++ vips_value_set_save_string(dest_value, buf); + } + + static void +-transform_save_string_double( const GValue *src_value, GValue *dest_value ) ++transform_save_string_double(const GValue *src_value, GValue *dest_value) + { +- g_value_set_double( dest_value, +- g_ascii_strtod( vips_value_get_save_string( src_value ), +- NULL ) ); ++ g_value_set_double(dest_value, ++ g_ascii_strtod(vips_value_get_save_string(src_value), ++ NULL)); + } + + static void +-transform_float_save_string( const GValue *src_value, GValue *dest_value ) ++transform_float_save_string(const GValue *src_value, GValue *dest_value) + { + char buf[G_ASCII_DTOSTR_BUF_SIZE]; + + /* Need to be locale independent. + */ +- g_ascii_dtostr( buf, G_ASCII_DTOSTR_BUF_SIZE, +- g_value_get_float( src_value ) ); +- vips_value_set_save_string( dest_value, buf ); ++ g_ascii_dtostr(buf, G_ASCII_DTOSTR_BUF_SIZE, ++ g_value_get_float(src_value)); ++ vips_value_set_save_string(dest_value, buf); + } + + static void +-transform_save_string_float( const GValue *src_value, GValue *dest_value ) ++transform_save_string_float(const GValue *src_value, GValue *dest_value) + { +- g_value_set_float( dest_value, +- g_ascii_strtod( vips_value_get_save_string( src_value ), +- NULL ) ); ++ g_value_set_float(dest_value, ++ g_ascii_strtod(vips_value_get_save_string(src_value), ++ NULL)); + } + + /* Save meta fields to the header. We have a new string type for header fields +@@ -508,57 +508,57 @@ transform_save_string_float( const GValue *src_value, GValue *dest_value ) + * this string type. + */ + GType +-vips_save_string_get_type( void ) ++vips_save_string_get_type(void) + { + static GType type = 0; + +- if( !type ) { +- type = g_boxed_type_register_static( "VipsSaveString", +- (GBoxedCopyFunc) g_strdup, +- (GBoxedFreeFunc) g_free ); ++ if (!type) { ++ type = g_boxed_type_register_static("VipsSaveString", ++ (GBoxedCopyFunc) g_strdup, ++ (GBoxedFreeFunc) g_free); + } + +- return( type ); ++ return (type); + } + + /* Transform a refstring to a G_TYPE_STRING and back. + */ + static void +-transform_ref_string_g_string( const GValue *src_value, GValue *dest_value ) ++transform_ref_string_g_string(const GValue *src_value, GValue *dest_value) + { +- g_value_set_string( dest_value, +- vips_value_get_ref_string( src_value, NULL ) ); ++ g_value_set_string(dest_value, ++ vips_value_get_ref_string(src_value, NULL)); + } + + static void +-transform_g_string_ref_string( const GValue *src_value, GValue *dest_value ) ++transform_g_string_ref_string(const GValue *src_value, GValue *dest_value) + { +- vips_value_set_ref_string( dest_value, +- g_value_get_string( src_value ) ); ++ vips_value_set_ref_string(dest_value, ++ g_value_get_string(src_value)); + } + + /* To a save string. + */ + static void +-transform_ref_string_save_string( const GValue *src_value, GValue *dest_value ) ++transform_ref_string_save_string(const GValue *src_value, GValue *dest_value) + { +- vips_value_set_save_stringf( dest_value, +- "%s", vips_value_get_ref_string( src_value, NULL ) ); ++ vips_value_set_save_stringf(dest_value, ++ "%s", vips_value_get_ref_string(src_value, NULL)); + } + + static void +-transform_save_string_ref_string( const GValue *src_value, GValue *dest_value ) ++transform_save_string_ref_string(const GValue *src_value, GValue *dest_value) + { +- vips_value_set_ref_string( dest_value, +- vips_value_get_save_string( src_value ) ); ++ vips_value_set_ref_string(dest_value, ++ vips_value_get_save_string(src_value)); + } + + /** +- * vips_ref_string_new: ++ * vips_ref_string_new: + * @str: (transfer none): string to store + * + * Create a new refstring. These are reference-counted immutable strings, used +- * to store string data in vips image metadata. ++ * to store string data in vips image metadata. + * + * Strings must be valid utf-8; use blob for binary data. + * +@@ -567,20 +567,20 @@ transform_save_string_ref_string( const GValue *src_value, GValue *dest_value ) + * Returns: (transfer full) (nullable): the new #VipsRefString, or NULL on error. + */ + VipsRefString * +-vips_ref_string_new( const char *str ) ++vips_ref_string_new(const char *str) + { + VipsArea *area; + +- if( !g_utf8_validate( str, -1, NULL ) ) ++ if (!g_utf8_validate(str, -1, NULL)) + str = ""; + +- area = vips_area_new( (VipsCallbackFn) vips_area_free_cb, g_strdup( str ) ); ++ area = vips_area_new((VipsCallbackFn) vips_area_free_cb, g_strdup(str)); + + /* Handy place to cache this. + */ +- area->length = strlen( str ); ++ area->length = strlen(str); + +- return( (VipsRefString *) area ); ++ return ((VipsRefString *) area); + } + + /** +@@ -589,44 +589,44 @@ vips_ref_string_new( const char *str ) + * @length: (out) (optional): return length here, optionally + * + * Get a pointer to the private string inside a refstr. Handy for language +- * bindings. ++ * bindings. + * + * See also: vips_value_get_ref_string(). + * +- * Returns: (transfer none): The C string held by @refstr. ++ * Returns: (transfer none): The C string held by @refstr. + */ + const char * +-vips_ref_string_get( VipsRefString *refstr, size_t *length ) ++vips_ref_string_get(VipsRefString *refstr, size_t *length) + { +- VipsArea *area = VIPS_AREA( refstr ); ++ VipsArea *area = VIPS_AREA(refstr); + +- return( vips_area_get_data( area, length, NULL, NULL, NULL ) ); ++ return (vips_area_get_data(area, length, NULL, NULL, NULL)); + } + + GType +-vips_ref_string_get_type( void ) ++vips_ref_string_get_type(void) + { + static GType type = 0; + +- if( !type ) { +- type = g_boxed_type_register_static( "VipsRefString", +- (GBoxedCopyFunc) vips_area_copy, +- (GBoxedFreeFunc) vips_area_unref ); +- g_value_register_transform_func( type, G_TYPE_STRING, +- transform_ref_string_g_string ); +- g_value_register_transform_func( G_TYPE_STRING, type, +- transform_g_string_ref_string ); +- g_value_register_transform_func( type, VIPS_TYPE_SAVE_STRING, +- transform_ref_string_save_string ); +- g_value_register_transform_func( VIPS_TYPE_SAVE_STRING, type, +- transform_save_string_ref_string ); ++ if (!type) { ++ type = g_boxed_type_register_static("VipsRefString", ++ (GBoxedCopyFunc) vips_area_copy, ++ (GBoxedFreeFunc) vips_area_unref); ++ g_value_register_transform_func(type, G_TYPE_STRING, ++ transform_ref_string_g_string); ++ g_value_register_transform_func(G_TYPE_STRING, type, ++ transform_g_string_ref_string); ++ g_value_register_transform_func(type, VIPS_TYPE_SAVE_STRING, ++ transform_ref_string_save_string); ++ g_value_register_transform_func(VIPS_TYPE_SAVE_STRING, type, ++ transform_save_string_ref_string); + } + +- return( type ); ++ return (type); + } + + /** +- * vips_blob_new: ++ * vips_blob_new: + * @free_fn: (scope async) (allow-none): @data will be freed with this function + * @data: (array length=length) (element-type guint8) (transfer full): data to store + * @length: number of bytes in @data +@@ -637,65 +637,65 @@ vips_ref_string_get_type( void ) + * + * An area of mem with a free func and a length (some sort of binary object, + * like an ICC profile). +- * ++ * + * See also: vips_area_unref(). + * + * Returns: (transfer full): the new #VipsBlob. + */ + VipsBlob * +-vips_blob_new( VipsCallbackFn free_fn, const void *data, size_t length ) ++vips_blob_new(VipsCallbackFn free_fn, const void *data, size_t length) + { + VipsArea *area; + +- area = vips_area_new( free_fn, (void *) data ); ++ area = vips_area_new(free_fn, (void *) data); + area->length = length; + +- return( (VipsBlob *) area ); ++ return ((VipsBlob *) area); + } + + /** +- * vips_blob_copy: ++ * vips_blob_copy: + * @data: (array length=length) (element-type guint8) (transfer none): data to store + * @length: number of bytes in @data + * + * Like vips_blob_new(), but take a copy of the data. Useful for bindings +- * which struggle with callbacks. ++ * which struggle with callbacks. + * + * See also: vips_blob_new(). + * + * Returns: (transfer full): the new #VipsBlob. + */ + VipsBlob * +-vips_blob_copy( const void *data, size_t length ) ++vips_blob_copy(const void *data, size_t length) + { +- void *data_copy; ++ void *data_copy; + VipsArea *area; + +- data_copy = g_malloc( length ); +- memcpy( data_copy, data, length ); +- area = vips_area_new( (VipsCallbackFn) vips_area_free_cb, data_copy ); ++ data_copy = g_malloc(length); ++ memcpy(data_copy, data, length); ++ area = vips_area_new((VipsCallbackFn) vips_area_free_cb, data_copy); + area->length = length; + +- return( (VipsBlob *) area ); ++ return ((VipsBlob *) area); + } + + /** +- * vips_blob_get: ++ * vips_blob_get: + * @blob: #VipsBlob to fetch from + * @length: return number of bytes of data + * +- * Get the data from a #VipsBlob. +- * ++ * Get the data from a #VipsBlob. ++ * + * See also: vips_blob_new(). + * +- * Returns: (array length=length) (element-type guint8) (transfer none): the ++ * Returns: (array length=length) (element-type guint8) (transfer none): the + * data + */ + const void * +-vips_blob_get( VipsBlob *blob, size_t *length ) ++vips_blob_get(VipsBlob *blob, size_t *length) + { +- return( vips_area_get_data( VIPS_AREA( blob ), +- length, NULL, NULL, NULL ) ); ++ return (vips_area_get_data(VIPS_AREA(blob), ++ length, NULL, NULL, NULL)); + } + + /** +@@ -713,94 +713,94 @@ vips_blob_get( VipsBlob *blob, size_t *length ) + * See also: vips_blob_new(). + */ + void +-vips_blob_set( VipsBlob *blob, +- VipsCallbackFn free_fn, const void *data, size_t length ) ++vips_blob_set(VipsBlob *blob, ++ VipsCallbackFn free_fn, const void *data, size_t length) + { +- VipsArea *area = VIPS_AREA( blob ); ++ VipsArea *area = VIPS_AREA(blob); + +- g_mutex_lock( area->lock ); ++ g_mutex_lock(area->lock); + +- vips_area_free( area ); ++ vips_area_free(area); + + area->free_fn = free_fn; + area->length = length; + area->data = (void *) data; + +- g_mutex_unlock( area->lock ); ++ g_mutex_unlock(area->lock); + } + + /* Transform a blob to a G_TYPE_STRING. + */ + static void +-transform_blob_g_string( const GValue *src_value, GValue *dest_value ) ++transform_blob_g_string(const GValue *src_value, GValue *dest_value) + { + void *blob; + size_t length; + char buf[256]; + +- blob = vips_value_get_blob( src_value, &length ); +- vips_snprintf( buf, 256, "VIPS_TYPE_BLOB, data = %p, length = %zd", +- blob, length ); +- g_value_set_string( dest_value, buf ); +-} ++ blob = vips_value_get_blob(src_value, &length); ++ vips_snprintf(buf, 256, "VIPS_TYPE_BLOB, data = %p, length = %zd", ++ blob, length); ++ g_value_set_string(dest_value, buf); ++} + + /* Transform a blob to a save string and back. + */ + static void +-transform_blob_save_string( const GValue *src_value, GValue *dest_value ) ++transform_blob_save_string(const GValue *src_value, GValue *dest_value) + { + void *blob; + size_t length; + char *b64; + +- blob = vips_value_get_blob( src_value, &length ); +- if( (b64 = g_base64_encode( blob, length )) ) { +- vips_value_set_save_string( dest_value, b64 ); +- g_free( b64 ); ++ blob = vips_value_get_blob(src_value, &length); ++ if ((b64 = g_base64_encode(blob, length))) { ++ vips_value_set_save_string(dest_value, b64); ++ g_free(b64); + } + else + /* No error return from transform, but we should set it to + * something. + */ +- vips_value_set_save_string( dest_value, "" ); ++ vips_value_set_save_string(dest_value, ""); + } + + static void +-transform_save_string_blob( const GValue *src_value, GValue *dest_value ) ++transform_save_string_blob(const GValue *src_value, GValue *dest_value) + { + const char *b64; + void *blob; + size_t length; + +- b64 = vips_value_get_save_string( src_value ); +- if( (blob = g_base64_decode( b64, &length )) ) +- vips_value_set_blob( dest_value, +- (VipsCallbackFn) vips_area_free_cb, blob, length ); ++ b64 = vips_value_get_save_string(src_value); ++ if ((blob = g_base64_decode(b64, &length))) ++ vips_value_set_blob(dest_value, ++ (VipsCallbackFn) vips_area_free_cb, blob, length); + else + /* No error return from transform, but we should set it to + * something. + */ +- vips_value_set_blob( dest_value, NULL, NULL, 0 ); ++ vips_value_set_blob(dest_value, NULL, NULL, 0); + } + + GType +-vips_blob_get_type( void ) ++vips_blob_get_type(void) + { + static GType type = 0; + +- if( !type ) { +- type = g_boxed_type_register_static( "VipsBlob", +- (GBoxedCopyFunc) vips_area_copy, +- (GBoxedFreeFunc) vips_area_unref ); +- g_value_register_transform_func( type, G_TYPE_STRING, +- transform_blob_g_string ); +- g_value_register_transform_func( type, VIPS_TYPE_SAVE_STRING, +- transform_blob_save_string ); +- g_value_register_transform_func( VIPS_TYPE_SAVE_STRING, type, +- transform_save_string_blob ); ++ if (!type) { ++ type = g_boxed_type_register_static("VipsBlob", ++ (GBoxedCopyFunc) vips_area_copy, ++ (GBoxedFreeFunc) vips_area_unref); ++ g_value_register_transform_func(type, G_TYPE_STRING, ++ transform_blob_g_string); ++ g_value_register_transform_func(type, VIPS_TYPE_SAVE_STRING, ++ transform_blob_save_string); ++ g_value_register_transform_func(VIPS_TYPE_SAVE_STRING, type, ++ transform_save_string_blob); + } + +- return( type ); ++ return (type); + } + + /** +@@ -816,16 +816,16 @@ vips_blob_get_type( void ) + * Returns: (transfer full): A new #VipsArrayInt. + */ + VipsArrayInt * +-vips_array_int_new( const int *array, int n ) ++vips_array_int_new(const int *array, int n) + { + VipsArea *area; + int *array_copy; + +- area = vips_area_new_array( G_TYPE_INT, sizeof( int ), n ); +- array_copy = vips_area_get_data( area, NULL, NULL, NULL, NULL ); +- memcpy( array_copy, array, n * sizeof( int ) ); ++ area = vips_area_new_array(G_TYPE_INT, sizeof(int), n); ++ array_copy = vips_area_get_data(area, NULL, NULL, NULL, NULL); ++ memcpy(array_copy, array, n * sizeof(int)); + +- return( (VipsArrayInt *) area ); ++ return ((VipsArrayInt *) area); + } + + /** +@@ -841,22 +841,22 @@ vips_array_int_new( const int *array, int n ) + * Returns: (transfer full): A new #VipsArrayInt. + */ + VipsArrayInt * +-vips_array_int_newv( int n, ... ) ++vips_array_int_newv(int n, ...) + { + va_list ap; + VipsArea *area; + int *array; + int i; + +- area = vips_area_new_array( G_TYPE_INT, sizeof( int ), n ); +- array = vips_area_get_data( area, NULL, NULL, NULL, NULL ); ++ area = vips_area_new_array(G_TYPE_INT, sizeof(int), n); ++ array = vips_area_get_data(area, NULL, NULL, NULL, NULL); + +- va_start( ap, n ); +- for( i = 0; i < n; i++ ) +- array[i] = va_arg( ap, int ); +- va_end( ap ); ++ va_start(ap, n); ++ for (i = 0; i < n; i++) ++ array[i] = va_arg(ap, int); ++ va_end(ap); + +- return( (VipsArrayInt *) area ); ++ return ((VipsArrayInt *) area); + } + + /** +@@ -864,63 +864,63 @@ vips_array_int_newv( int n, ... ) + * @array: the #VipsArrayInt to fetch from + * @n: length of array + * +- * Fetch an int array from a #VipsArrayInt. Useful for language bindings. ++ * Fetch an int array from a #VipsArrayInt. Useful for language bindings. + * + * Returns: (array length=n) (transfer none): array of int + */ + int * +-vips_array_int_get( VipsArrayInt *array, int *n ) ++vips_array_int_get(VipsArrayInt *array, int *n) + { +- VipsArea *area = VIPS_AREA( array ); ++ VipsArea *area = VIPS_AREA(array); + +- g_assert( area->type == G_TYPE_INT ); ++ g_assert(area->type == G_TYPE_INT); + +- if( n ) ++ if (n) + *n = area->n; + +- return( (int *) VIPS_ARRAY_ADDR( array, 0 ) ); ++ return ((int *) VIPS_ARRAY_ADDR(array, 0)); + } + + static void +-transform_array_int_g_string( const GValue *src_value, GValue *dest_value ) ++transform_array_int_g_string(const GValue *src_value, GValue *dest_value) + { + int n; + int *array; + + char txt[1024]; +- VipsBuf buf = VIPS_BUF_STATIC( txt ); ++ VipsBuf buf = VIPS_BUF_STATIC(txt); + int i; + +- if( (array = vips_value_get_array_int( src_value, &n )) ) +- for( i = 0; i < n; i++ ) +- /* Use space as a separator since ',' may be a ++ if ((array = vips_value_get_array_int(src_value, &n))) ++ for (i = 0; i < n; i++) ++ /* Use space as a separator since ',' may be a + * decimal point in this locale. + */ +- vips_buf_appendf( &buf, "%d ", array[i] ); ++ vips_buf_appendf(&buf, "%d ", array[i]); + +- g_value_set_string( dest_value, vips_buf_all( &buf ) ); ++ g_value_set_string(dest_value, vips_buf_all(&buf)); + } + + static void +-transform_array_int_save_string( const GValue *src_value, GValue *dest_value ) ++transform_array_int_save_string(const GValue *src_value, GValue *dest_value) + { + GValue intermediate = { 0 }; + +- g_value_init( &intermediate, G_TYPE_STRING ); ++ g_value_init(&intermediate, G_TYPE_STRING); + +- transform_array_int_g_string( src_value, &intermediate ); ++ transform_array_int_g_string(src_value, &intermediate); + +- vips_value_set_save_string( dest_value, +- g_value_get_string( &intermediate ) ); ++ vips_value_set_save_string(dest_value, ++ g_value_get_string(&intermediate)); + +- g_value_unset( &intermediate ); ++ g_value_unset(&intermediate); + } + + /* It'd be great to be able to write a generic string->array function, but + * it doesn't seem possible. + */ + static void +-transform_g_string_array_int( const GValue *src_value, GValue *dest_value ) ++transform_g_string_array_int(const GValue *src_value, GValue *dest_value) + { + char *str; + int n; +@@ -928,122 +928,122 @@ transform_g_string_array_int( const GValue *src_value, GValue *dest_value ) + int i; + int *array; + +- /* Walk the string to get the number of elements. ++ /* Walk the string to get the number of elements. + * We need a copy of the string, since we insert \0 during + * scan. + * + * We can't allow ',' as a separator, since some locales use it as a + * decimal point. + */ +- str = g_value_dup_string( src_value ); ++ str = g_value_dup_string(src_value); + + n = 0; +- for( p = str; (q = vips_break_token( p, "\t; " )); p = q ) ++ for (p = str; (q = vips_break_token(p, "\t; ")); p = q) + n += 1; + +- g_free( str ); ++ g_free(str); + +- vips_value_set_array_int( dest_value, NULL, n ); +- array = vips_value_get_array_int( dest_value, NULL ); ++ vips_value_set_array_int(dest_value, NULL, n); ++ array = vips_value_get_array_int(dest_value, NULL); + +- str = g_value_dup_string( src_value ); ++ str = g_value_dup_string(src_value); + + i = 0; +- for( p = str; (q = vips_break_token( p, "\t; " )); p = q ) { +- if( sscanf( p, "%d", &array[i] ) != 1 ) { ++ for (p = str; (q = vips_break_token(p, "\t; ")); p = q) { ++ if (sscanf(p, "%d", &array[i]) != 1) { + /* Set array to length zero to indicate an error. + */ +- vips_error( "vipstype", +- _( "unable to convert \"%s\" to int" ), p ); +- vips_value_set_array( dest_value, +- 0, G_TYPE_INT, sizeof( int ) ); +- g_free( str ); ++ vips_error("vipstype", ++ _("unable to convert \"%s\" to int"), p); ++ vips_value_set_array(dest_value, ++ 0, G_TYPE_INT, sizeof(int)); ++ g_free(str); + return; + } + + i += 1; + } + +- g_free( str ); ++ g_free(str); + } + + static void +-transform_save_string_array_int( const GValue *src_value, GValue *dest_value ) ++transform_save_string_array_int(const GValue *src_value, GValue *dest_value) + { + GValue intermediate = { 0 }; + +- g_value_init( &intermediate, G_TYPE_STRING ); ++ g_value_init(&intermediate, G_TYPE_STRING); + +- g_value_set_string( &intermediate, +- vips_value_get_save_string( src_value ) ); ++ g_value_set_string(&intermediate, ++ vips_value_get_save_string(src_value)); + +- transform_g_string_array_int( &intermediate, dest_value ); ++ transform_g_string_array_int(&intermediate, dest_value); + +- g_value_unset( &intermediate ); ++ g_value_unset(&intermediate); + } + + /* We need a arrayint, we have an int, make a one-element array. + */ + static void +-transform_int_array_int( const GValue *src_value, GValue *dest_value ) ++transform_int_array_int(const GValue *src_value, GValue *dest_value) + { + int *array; + +- vips_value_set_array_int( dest_value, NULL, 1 ); +- array = vips_value_get_array_int( dest_value, NULL ); +- array[0] = g_value_get_int( src_value ); ++ vips_value_set_array_int(dest_value, NULL, 1); ++ array = vips_value_get_array_int(dest_value, NULL); ++ array[0] = g_value_get_int(src_value); + } + + static void +-transform_double_array_int( const GValue *src_value, GValue *dest_value ) ++transform_double_array_int(const GValue *src_value, GValue *dest_value) + { + int *array; + +- vips_value_set_array_int( dest_value, NULL, 1 ); +- array = vips_value_get_array_int( dest_value, NULL ); +- array[0] = g_value_get_double( src_value ); ++ vips_value_set_array_int(dest_value, NULL, 1); ++ array = vips_value_get_array_int(dest_value, NULL); ++ array[0] = g_value_get_double(src_value); + } + + static void +-transform_array_double_array_int( const GValue *src_value, GValue *dest_value ) ++transform_array_double_array_int(const GValue *src_value, GValue *dest_value) + { + int n; +- double *array_double = vips_value_get_array_double( src_value, &n ); ++ double *array_double = vips_value_get_array_double(src_value, &n); + int *array_int; + int i; + +- vips_value_set_array_int( dest_value, NULL, n ); +- array_int = vips_value_get_array_int( dest_value, NULL ); +- for( i = 0; i < n; i++ ) ++ vips_value_set_array_int(dest_value, NULL, n); ++ array_int = vips_value_get_array_int(dest_value, NULL); ++ for (i = 0; i < n; i++) + array_int[i] = array_double[i]; + } + + GType +-vips_array_int_get_type( void ) ++vips_array_int_get_type(void) + { + static GType type = 0; + +- if( !type ) { +- type = g_boxed_type_register_static( "VipsArrayInt", +- (GBoxedCopyFunc) vips_area_copy, +- (GBoxedFreeFunc) vips_area_unref ); +- g_value_register_transform_func( type, G_TYPE_STRING, +- transform_array_int_g_string ); +- g_value_register_transform_func( G_TYPE_STRING, type, +- transform_g_string_array_int ); +- g_value_register_transform_func( G_TYPE_INT, type, +- transform_int_array_int ); +- g_value_register_transform_func( G_TYPE_DOUBLE, type, +- transform_double_array_int ); +- g_value_register_transform_func( VIPS_TYPE_ARRAY_DOUBLE, type, +- transform_array_double_array_int ); +- g_value_register_transform_func( type, VIPS_TYPE_SAVE_STRING, +- transform_array_int_save_string ); +- g_value_register_transform_func( VIPS_TYPE_SAVE_STRING, type, +- transform_save_string_array_int ); ++ if (!type) { ++ type = g_boxed_type_register_static("VipsArrayInt", ++ (GBoxedCopyFunc) vips_area_copy, ++ (GBoxedFreeFunc) vips_area_unref); ++ g_value_register_transform_func(type, G_TYPE_STRING, ++ transform_array_int_g_string); ++ g_value_register_transform_func(G_TYPE_STRING, type, ++ transform_g_string_array_int); ++ g_value_register_transform_func(G_TYPE_INT, type, ++ transform_int_array_int); ++ g_value_register_transform_func(G_TYPE_DOUBLE, type, ++ transform_double_array_int); ++ g_value_register_transform_func(VIPS_TYPE_ARRAY_DOUBLE, type, ++ transform_array_double_array_int); ++ g_value_register_transform_func(type, VIPS_TYPE_SAVE_STRING, ++ transform_array_int_save_string); ++ g_value_register_transform_func(VIPS_TYPE_SAVE_STRING, type, ++ transform_save_string_array_int); + } + +- return( type ); ++ return (type); + } + + /** +@@ -1059,16 +1059,16 @@ vips_array_int_get_type( void ) + * Returns: (transfer full): A new #VipsArrayDouble. + */ + VipsArrayDouble * +-vips_array_double_new( const double *array, int n ) ++vips_array_double_new(const double *array, int n) + { + VipsArea *area; + double *array_copy; + +- area = vips_area_new_array( G_TYPE_DOUBLE, sizeof( double ), n ); +- array_copy = vips_area_get_data( area, NULL, NULL, NULL, NULL ); +- memcpy( array_copy, array, n * sizeof( double ) ); ++ area = vips_area_new_array(G_TYPE_DOUBLE, sizeof(double), n); ++ array_copy = vips_area_get_data(area, NULL, NULL, NULL, NULL); ++ memcpy(array_copy, array, n * sizeof(double)); + +- return( (VipsArrayDouble *) area ); ++ return ((VipsArrayDouble *) area); + } + + /** +@@ -1084,22 +1084,22 @@ vips_array_double_new( const double *array, int n ) + * Returns: (transfer full): A new #VipsArrayDouble. + */ + VipsArrayDouble * +-vips_array_double_newv( int n, ... ) ++vips_array_double_newv(int n, ...) + { + va_list ap; + VipsArea *area; + double *array; + int i; + +- area = vips_area_new_array( G_TYPE_DOUBLE, sizeof( double ), n ); +- array = vips_area_get_data( area, NULL, NULL, NULL, NULL ); ++ area = vips_area_new_array(G_TYPE_DOUBLE, sizeof(double), n); ++ array = vips_area_get_data(area, NULL, NULL, NULL, NULL); + +- va_start( ap, n ); +- for( i = 0; i < n; i++ ) +- array[i] = va_arg( ap, double ); +- va_end( ap ); ++ va_start(ap, n); ++ for (i = 0; i < n; i++) ++ array[i] = va_arg(ap, double); ++ va_end(ap); + +- return( (VipsArrayDouble *) area ); ++ return ((VipsArrayDouble *) area); + } + + /** +@@ -1107,48 +1107,48 @@ vips_array_double_newv( int n, ... ) + * @array: the #VipsArrayDouble to fetch from + * @n: length of array + * +- * Fetch a double array from a #VipsArrayDouble. Useful for language bindings. ++ * Fetch a double array from a #VipsArrayDouble. Useful for language bindings. + * + * Returns: (array length=n) (transfer none): array of double + */ + double * +-vips_array_double_get( VipsArrayDouble *array, int *n ) ++vips_array_double_get(VipsArrayDouble *array, int *n) + { +- VipsArea *area = VIPS_AREA( array ); ++ VipsArea *area = VIPS_AREA(array); + +- g_assert( area->type == G_TYPE_DOUBLE ); ++ g_assert(area->type == G_TYPE_DOUBLE); + +- if( n ) ++ if (n) + *n = area->n; + +- return( VIPS_ARRAY_ADDR( array, 0 ) ); ++ return (VIPS_ARRAY_ADDR(array, 0)); + } + + static void +-transform_array_double_g_string( const GValue *src_value, GValue *dest_value ) ++transform_array_double_g_string(const GValue *src_value, GValue *dest_value) + { + int n; + double *array; + + char txt[1024]; +- VipsBuf buf = VIPS_BUF_STATIC( txt ); ++ VipsBuf buf = VIPS_BUF_STATIC(txt); + int i; + +- if( (array = vips_value_get_array_double( src_value, &n )) ) +- for( i = 0; i < n; i++ ) +- /* Use space as a separator since ',' may be a decimal ++ if ((array = vips_value_get_array_double(src_value, &n))) ++ for (i = 0; i < n; i++) ++ /* Use space as a separator since ',' may be a decimal + * point in this locale. + */ +- vips_buf_appendf( &buf, "%g ", array[i] ); ++ vips_buf_appendf(&buf, "%g ", array[i]); + +- g_value_set_string( dest_value, vips_buf_all( &buf ) ); ++ g_value_set_string(dest_value, vips_buf_all(&buf)); + } + + /* It'd be great to be able to write a generic string->array function, but + * it doesn't seem possible. + */ + static void +-transform_g_string_array_double( const GValue *src_value, GValue *dest_value ) ++transform_g_string_array_double(const GValue *src_value, GValue *dest_value) + { + char *str; + int n; +@@ -1156,111 +1156,111 @@ transform_g_string_array_double( const GValue *src_value, GValue *dest_value ) + int i; + double *array; + +- /* Walk the string to get the number of elements. ++ /* Walk the string to get the number of elements. + * We need a copy of the string, since we insert \0 during scan. + * + * We can't allow ',' as a separator since some locales use it as a + * decimal point. + */ +- str = g_value_dup_string( src_value ); ++ str = g_value_dup_string(src_value); + + n = 0; +- for( p = str; (q = vips_break_token( p, "\t; " )); p = q ) ++ for (p = str; (q = vips_break_token(p, "\t; ")); p = q) + n += 1; + +- g_free( str ); ++ g_free(str); + +- vips_value_set_array_double( dest_value, NULL, n ); +- array = vips_value_get_array_double( dest_value, NULL ); ++ vips_value_set_array_double(dest_value, NULL, n); ++ array = vips_value_get_array_double(dest_value, NULL); + +- str = g_value_dup_string( src_value ); ++ str = g_value_dup_string(src_value); + + i = 0; +- for( p = str; (q = vips_break_token( p, "\t; " )); p = q ) { +- if( sscanf( p, "%lf", &array[i] ) != 1 ) { ++ for (p = str; (q = vips_break_token(p, "\t; ")); p = q) { ++ if (sscanf(p, "%lf", &array[i]) != 1) { + /* Set array to length zero to indicate an error. + */ +- vips_error( "vipstype", +- _( "unable to convert \"%s\" to float" ), p ); +- vips_value_set_array_double( dest_value, NULL, 0 ); +- g_free( str ); ++ vips_error("vipstype", ++ _("unable to convert \"%s\" to float"), p); ++ vips_value_set_array_double(dest_value, NULL, 0); ++ g_free(str); + return; + } + + i += 1; + } + +- g_free( str ); ++ g_free(str); + } + + /* We need a arraydouble, we have a double, make a one-element array. + */ + static void +-transform_double_array_double( const GValue *src_value, GValue *dest_value ) ++transform_double_array_double(const GValue *src_value, GValue *dest_value) + { + double *array; + +- vips_value_set_array_double( dest_value, NULL, 1 ); +- array = vips_value_get_array_double( dest_value, NULL ); +- array[0] = g_value_get_double( src_value ); ++ vips_value_set_array_double(dest_value, NULL, 1); ++ array = vips_value_get_array_double(dest_value, NULL); ++ array[0] = g_value_get_double(src_value); + } + + static void +-transform_int_array_double( const GValue *src_value, GValue *dest_value ) ++transform_int_array_double(const GValue *src_value, GValue *dest_value) + { + double *array; + +- vips_value_set_array_double( dest_value, NULL, 1 ); +- array = vips_value_get_array_double( dest_value, NULL ); +- array[0] = g_value_get_int( src_value ); ++ vips_value_set_array_double(dest_value, NULL, 1); ++ array = vips_value_get_array_double(dest_value, NULL); ++ array[0] = g_value_get_int(src_value); + } + + static void +-transform_array_int_array_double( const GValue *src_value, GValue *dest_value ) ++transform_array_int_array_double(const GValue *src_value, GValue *dest_value) + { + int n; +- int *array_int = vips_value_get_array_int( src_value, &n ); ++ int *array_int = vips_value_get_array_int(src_value, &n); + double *array_double; + int i; + +- vips_value_set_array_double( dest_value, NULL, n ); +- array_double = vips_value_get_array_double( dest_value, NULL ); +- for( i = 0; i < n; i++ ) ++ vips_value_set_array_double(dest_value, NULL, n); ++ array_double = vips_value_get_array_double(dest_value, NULL); ++ for (i = 0; i < n; i++) + array_double[i] = array_int[i]; + } + +-/* You can set enums from ints, but not doubles. Add a double converter too. ++/* You can set enums from ints, but not doubles. Add a double converter too. + */ + static void +-transform_double_enum( const GValue *src_value, GValue *dest_value ) ++transform_double_enum(const GValue *src_value, GValue *dest_value) + { +- g_value_set_enum( dest_value, g_value_get_double( src_value ) ); ++ g_value_set_enum(dest_value, g_value_get_double(src_value)); + } + + GType +-vips_array_double_get_type( void ) ++vips_array_double_get_type(void) + { + static GType type = 0; + +- if( !type ) { +- type = g_boxed_type_register_static( "VipsArrayDouble", +- (GBoxedCopyFunc) vips_area_copy, +- (GBoxedFreeFunc) vips_area_unref ); +- g_value_register_transform_func( type, G_TYPE_STRING, +- transform_array_double_g_string ); +- g_value_register_transform_func( G_TYPE_STRING, type, +- transform_g_string_array_double ); +- g_value_register_transform_func( G_TYPE_DOUBLE, type, +- transform_double_array_double ); +- g_value_register_transform_func( G_TYPE_INT, type, +- transform_int_array_double ); +- g_value_register_transform_func( VIPS_TYPE_ARRAY_INT, type, +- transform_array_int_array_double ); +- g_value_register_transform_func( G_TYPE_DOUBLE, G_TYPE_ENUM, +- transform_double_enum ); ++ if (!type) { ++ type = g_boxed_type_register_static("VipsArrayDouble", ++ (GBoxedCopyFunc) vips_area_copy, ++ (GBoxedFreeFunc) vips_area_unref); ++ g_value_register_transform_func(type, G_TYPE_STRING, ++ transform_array_double_g_string); ++ g_value_register_transform_func(G_TYPE_STRING, type, ++ transform_g_string_array_double); ++ g_value_register_transform_func(G_TYPE_DOUBLE, type, ++ transform_double_array_double); ++ g_value_register_transform_func(G_TYPE_INT, type, ++ transform_int_array_double); ++ g_value_register_transform_func(VIPS_TYPE_ARRAY_INT, type, ++ transform_array_int_array_double); ++ g_value_register_transform_func(G_TYPE_DOUBLE, G_TYPE_ENUM, ++ transform_double_enum); + } + +- return( type ); ++ return (type); + } + + /** +@@ -1269,36 +1269,36 @@ vips_array_double_get_type( void ) + * @n: number of images + * + * Allocate a new array of images and copy @array into it. Free with +- * vips_area_unref(). ++ * vips_area_unref(). + * +- * The images will all be reffed by this function. They ++ * The images will all be reffed by this function. They + * will be automatically unreffed for you by + * vips_area_unref(). + * + * Add an extra NULL element at the end, handy for eg. +- * vips_image_pipeline_array() etc. ++ * vips_image_pipeline_array() etc. + * + * See also: #VipsArea. + * + * Returns: (transfer full): A new #VipsArrayImage. + */ + VipsArrayImage * +-vips_array_image_new( VipsImage **array, int n ) ++vips_array_image_new(VipsImage **array, int n) + { + VipsArea *area; + VipsImage **array_copy; + int i; + +- area = vips_area_new_array_object( n ); ++ area = vips_area_new_array_object(n); + area->type = VIPS_TYPE_IMAGE; + +- array_copy = vips_area_get_data( area, NULL, NULL, NULL, NULL ); +- for( i = 0; i < n; i++ ) { +- array_copy[i] = (VipsImage *) array[i]; +- g_object_ref( array_copy[i] ); ++ array_copy = vips_area_get_data(area, NULL, NULL, NULL, NULL); ++ for (i = 0; i < n; i++) { ++ array_copy[i] = (VipsImage *) array[i]; ++ g_object_ref(array_copy[i]); + } + +- return( (VipsArrayImage *) area ); ++ return ((VipsArrayImage *) area); + } + + /** +@@ -1307,43 +1307,43 @@ vips_array_image_new( VipsImage **array, int n ) + * @...: list of #VipsImage arguments + * + * Allocate a new array of @n #VipsImage and copy @... into it. Free with +- * vips_area_unref(). ++ * vips_area_unref(). + * +- * The images will all be reffed by this function. They ++ * The images will all be reffed by this function. They + * will be automatically unreffed for you by + * vips_area_unref(). + * + * Add an extra NULL element at the end, handy for eg. +- * vips_image_pipeline_array() etc. ++ * vips_image_pipeline_array() etc. + * + * See also: vips_array_image_new() + * + * Returns: (transfer full): A new #VipsArrayImage. + */ + VipsArrayImage * +-vips_array_image_newv( int n, ... ) ++vips_array_image_newv(int n, ...) + { + va_list ap; + VipsArea *area; + VipsImage **array; + int i; + +- area = vips_area_new_array_object( n ); ++ area = vips_area_new_array_object(n); + area->type = VIPS_TYPE_IMAGE; + +- array = vips_area_get_data( area, NULL, NULL, NULL, NULL ); +- va_start( ap, n ); +- for( i = 0; i < n; i++ ) { +- array[i] = va_arg( ap, VipsImage * ); +- g_object_ref( array[i] ); ++ array = vips_area_get_data(area, NULL, NULL, NULL, NULL); ++ va_start(ap, n); ++ for (i = 0; i < n; i++) { ++ array[i] = va_arg(ap, VipsImage *); ++ g_object_ref(array[i]); + } +- va_end( ap ); ++ va_end(ap); + +- return( (VipsArrayImage *) area ); ++ return ((VipsArrayImage *) area); + } + + VipsArrayImage * +-vips_array_image_new_from_string( const char *string, VipsAccess access ) ++vips_array_image_new_from_string(const char *string, VipsAccess access) + { + char *str; + int n; +@@ -1355,43 +1355,43 @@ vips_array_image_new_from_string( const char *string, VipsAccess access ) + /* We need a copy of the string, since we insert \0 during + * scan. + */ +- str = g_strdup( string ); ++ str = g_strdup(string); + + n = 0; +- for( p = str; (q = vips_break_token( p, " \n\t\r" )); p = q ) ++ for (p = str; (q = vips_break_token(p, " \n\t\r")); p = q) + n += 1; + +- g_free( str ); ++ g_free(str); + +- area = vips_area_new_array_object( n ); ++ area = vips_area_new_array_object(n); + area->type = VIPS_TYPE_IMAGE; + +- array = vips_area_get_data( area, NULL, NULL, NULL, NULL ); ++ array = vips_area_get_data(area, NULL, NULL, NULL, NULL); + +- str = g_strdup( string ); ++ str = g_strdup(string); + + i = 0; +- for( p = str; (q = vips_break_token( p, " \n\t\r" )); p = q ) { +- if( !(array[i] = vips_image_new_from_file( p, +- "access", access, +- NULL )) ) { +- vips_area_unref( area ); +- g_free( str ); +- return( NULL ); ++ for (p = str; (q = vips_break_token(p, " \n\t\r")); p = q) { ++ if (!(array[i] = vips_image_new_from_file(p, ++ "access", access, ++ NULL))) { ++ vips_area_unref(area); ++ g_free(str); ++ return (NULL); + } + + i += 1; + } + +- g_free( str ); ++ g_free(str); + +- return( (VipsArrayImage *) area ); ++ return ((VipsArrayImage *) area); + } + + /** + * vips_array_image_empty: (constructor) + * +- * Make an empty image array. ++ * Make an empty image array. + * Handy with vips_array_image_add() for bindings + * which can't handle object array arguments. + * +@@ -1400,9 +1400,9 @@ vips_array_image_new_from_string( const char *string, VipsAccess access ) + * Returns: (transfer full): A new #VipsArrayImage. + */ + VipsArrayImage * +-vips_array_image_empty( void ) ++vips_array_image_empty(void) + { +- return( vips_array_image_new( NULL, 0 ) ); ++ return (vips_array_image_new(NULL, 0)); + } + + /** +@@ -1410,7 +1410,7 @@ vips_array_image_empty( void ) + * @array: (transfer none): append to this + * @image: add this + * +- * Make a new #VipsArrayImage, one larger than @array, with @image appended ++ * Make a new #VipsArrayImage, one larger than @array, with @image appended + * to the end. + * Handy with vips_array_image_empty() for bindings + * which can't handle object array arguments. +@@ -1420,9 +1420,9 @@ vips_array_image_empty( void ) + * Returns: (transfer full): A new #VipsArrayImage. + */ + VipsArrayImage * +-vips_array_image_append( VipsArrayImage *array, VipsImage *image ) ++vips_array_image_append(VipsArrayImage *array, VipsImage *image) + { +- VipsArea *old_area = VIPS_AREA( array ); ++ VipsArea *old_area = VIPS_AREA(array); + int n = old_area->n; + + VipsArea *new_area; +@@ -1430,19 +1430,19 @@ vips_array_image_append( VipsArrayImage *array, VipsImage *image ) + VipsImage **new_vector; + int i; + +- new_area = vips_area_new_array_object( n + 1 ); ++ new_area = vips_area_new_array_object(n + 1); + new_area->type = VIPS_TYPE_IMAGE; + +- old_vector = vips_area_get_data( old_area, NULL, NULL, NULL, NULL ); +- new_vector = vips_area_get_data( new_area, NULL, NULL, NULL, NULL ); +- for( i = 0; i < n; i++ ) { +- new_vector[i] = (VipsImage *) old_vector[i]; +- g_object_ref( new_vector[i] ); ++ old_vector = vips_area_get_data(old_area, NULL, NULL, NULL, NULL); ++ new_vector = vips_area_get_data(new_area, NULL, NULL, NULL, NULL); ++ for (i = 0; i < n; i++) { ++ new_vector[i] = (VipsImage *) old_vector[i]; ++ g_object_ref(new_vector[i]); + } + new_vector[i] = image; +- g_object_ref( new_vector[i] ); ++ g_object_ref(new_vector[i]); + +- return( (VipsArrayImage *) new_area ); ++ return ((VipsArrayImage *) new_area); + } + + /** +@@ -1450,62 +1450,62 @@ vips_array_image_append( VipsArrayImage *array, VipsImage *image ) + * @array: the #VipsArrayImage to fetch from + * @n: length of array + * +- * Fetch an image array from a #VipsArrayImage. Useful for language bindings. ++ * Fetch an image array from a #VipsArrayImage. Useful for language bindings. + * + * Returns: (array length=n) (transfer none): array of #VipsImage + */ + VipsImage ** +-vips_array_image_get( VipsArrayImage *array, int *n ) ++vips_array_image_get(VipsArrayImage *array, int *n) + { +- VipsArea *area = VIPS_AREA( array ); ++ VipsArea *area = VIPS_AREA(array); + +- g_assert( area->type == VIPS_TYPE_IMAGE ); ++ g_assert(area->type == VIPS_TYPE_IMAGE); + +- if( n ) ++ if (n) + *n = area->n; + +- return( (VipsImage **) VIPS_ARRAY_ADDR( array, 0 ) ); ++ return ((VipsImage **) VIPS_ARRAY_ADDR(array, 0)); + } + + static void +-transform_g_string_array_image( const GValue *src_value, GValue *dest_value ) ++transform_g_string_array_image(const GValue *src_value, GValue *dest_value) + { + char *str; +- VipsArrayImage *array_image; ++ VipsArrayImage *array_image; + +- str = g_value_dup_string( src_value ); ++ str = g_value_dup_string(src_value); + + /* We can't get access here, just assume nothing. See the special case + * in vips_object_new_from_string() for how we usually get this right. + */ +- if( !(array_image = vips_array_image_new_from_string( str, 0 )) ) { ++ if (!(array_image = vips_array_image_new_from_string(str, 0))) { + /* Set the dest to length zero to indicate error. + */ +- vips_value_set_array_image( dest_value, 0 ); +- g_free( str ); ++ vips_value_set_array_image(dest_value, 0); ++ g_free(str); + return; + } + +- g_free( str ); ++ g_free(str); + +- g_value_set_boxed( dest_value, array_image ); +- vips_area_unref( VIPS_AREA( array_image ) ); ++ g_value_set_boxed(dest_value, array_image); ++ vips_area_unref(VIPS_AREA(array_image)); + } + + GType +-vips_array_image_get_type( void ) ++vips_array_image_get_type(void) + { + static GType type = 0; + +- if( !type ) { +- type = g_boxed_type_register_static( "VipsArrayImage", +- (GBoxedCopyFunc) vips_area_copy, +- (GBoxedFreeFunc) vips_area_unref ); +- g_value_register_transform_func( G_TYPE_STRING, type, +- transform_g_string_array_image ); ++ if (!type) { ++ type = g_boxed_type_register_static("VipsArrayImage", ++ (GBoxedCopyFunc) vips_area_copy, ++ (GBoxedFreeFunc) vips_area_unref); ++ g_value_register_transform_func(G_TYPE_STRING, type, ++ transform_g_string_array_image); + } + +- return( type ); ++ return (type); + } + + /** +@@ -1517,14 +1517,14 @@ vips_array_image_get_type( void ) + * Set value to be a ref-counted area of memory with a free function. + */ + void +-vips_value_set_area( GValue *value, VipsCallbackFn free_fn, void *data ) ++vips_value_set_area(GValue *value, VipsCallbackFn free_fn, void *data) + { + VipsArea *area; + +- area = vips_area_new( free_fn, data ); +- g_value_init( value, VIPS_TYPE_AREA ); +- g_value_set_boxed( value, area ); +- vips_area_unref( area ); ++ area = vips_area_new(free_fn, data); ++ g_value_init(value, VIPS_TYPE_AREA); ++ g_value_set_boxed(value, area); ++ vips_area_unref(area); + } + + /** +@@ -1534,33 +1534,33 @@ vips_value_set_area( GValue *value, VipsCallbackFn free_fn, void *data ) + * + * Get the pointer from an area. Don't touch count (area is static). + * +- * Returns: (transfer none): The pointer held by @value. ++ * Returns: (transfer none): The pointer held by @value. + */ + void * +-vips_value_get_area( const GValue *value, size_t *length ) ++vips_value_get_area(const GValue *value, size_t *length) + { + VipsArea *area; + +- area = g_value_get_boxed( value ); ++ area = g_value_get_boxed(value); + +- return( vips_area_get_data( area, length, NULL, NULL, NULL ) ); ++ return (vips_area_get_data(area, length, NULL, NULL, NULL)); + } + +-/** ++/** + * vips_value_get_save_string: + * @value: GValue to get from + * + * Get the C string held internally by the GValue. + * +- * Returns: (transfer none): The C string held by @value. ++ * Returns: (transfer none): The C string held by @value. + */ + const char * +-vips_value_get_save_string( const GValue *value ) ++vips_value_get_save_string(const GValue *value) + { +- return( (char *) g_value_get_boxed( value ) ); ++ return ((char *) g_value_get_boxed(value)); + } + +-/** ++/** + * vips_value_set_save_string: + * @value: (out): GValue to set + * @str: C string to copy into the GValue +@@ -1570,17 +1570,17 @@ vips_value_get_save_string( const GValue *value ) + * @str should be a valid utf-8 string. + */ + void +-vips_value_set_save_string( GValue *value, const char *str ) ++vips_value_set_save_string(GValue *value, const char *str) + { +- g_assert( G_VALUE_TYPE( value ) == VIPS_TYPE_SAVE_STRING ); ++ g_assert(G_VALUE_TYPE(value) == VIPS_TYPE_SAVE_STRING); + +- if( !g_utf8_validate( str, -1, NULL ) ) ++ if (!g_utf8_validate(str, -1, NULL)) + str = ""; + +- g_value_set_boxed( value, str ); ++ g_value_set_boxed(value, str); + } + +-/** ++/** + * vips_value_set_save_stringf: + * @value: (out): GValue to set + * @fmt: printf()-style format string +@@ -1589,41 +1589,41 @@ vips_value_set_save_string( GValue *value, const char *str ) + * Generates a string and copies it into @value. + */ + void +-vips_value_set_save_stringf( GValue *value, const char *fmt, ... ) ++vips_value_set_save_stringf(GValue *value, const char *fmt, ...) + { + va_list ap; + char *str; + +- g_assert( G_VALUE_TYPE( value ) == VIPS_TYPE_SAVE_STRING ); ++ g_assert(G_VALUE_TYPE(value) == VIPS_TYPE_SAVE_STRING); + +- va_start( ap, fmt ); +- str = g_strdup_vprintf( fmt, ap ); +- va_end( ap ); +- vips_value_set_save_string( value, str ); +- g_free( str ); ++ va_start(ap, fmt); ++ str = g_strdup_vprintf(fmt, ap); ++ va_end(ap); ++ vips_value_set_save_string(value, str); ++ g_free(str); + } + +-/** ++/** + * vips_value_get_ref_string: + * @value: %GValue to get from + * @length: (out) (optional): return length here, optionally + * + * Get the C string held internally by the %GValue. + * +- * Returns: (transfer none): The C string held by @value. ++ * Returns: (transfer none): The C string held by @value. + */ + const char * +-vips_value_get_ref_string( const GValue *value, size_t *length ) ++vips_value_get_ref_string(const GValue *value, size_t *length) + { +- return( vips_value_get_area( value, length ) ); ++ return (vips_value_get_area(value, length)); + } + +-/** ++/** + * vips_value_set_ref_string: + * @value: (out): %GValue to set + * @str: C string to copy into the GValue + * +- * Copies the C string @str into @value. ++ * Copies the C string @str into @value. + * + * vips_ref_string are immutable C strings that are copied between images by + * copying reference-counted pointers, making them much more efficient than +@@ -1632,18 +1632,18 @@ vips_value_get_ref_string( const GValue *value, size_t *length ) + * @str should be a valid utf-8 string. + */ + void +-vips_value_set_ref_string( GValue *value, const char *str ) ++vips_value_set_ref_string(GValue *value, const char *str) + { + VipsRefString *ref_str; + +- g_assert( G_VALUE_TYPE( value ) == VIPS_TYPE_REF_STRING ); ++ g_assert(G_VALUE_TYPE(value) == VIPS_TYPE_REF_STRING); + +- ref_str = vips_ref_string_new( str ); +- g_value_set_boxed( value, ref_str ); +- vips_area_unref( VIPS_AREA( ref_str ) ); ++ ref_str = vips_ref_string_new(str); ++ g_value_set_boxed(value, ref_str); ++ vips_area_unref(VIPS_AREA(ref_str)); + } + +-/** ++/** + * vips_value_set_blob: + * @value: (out): GValue to set + * @free_fn: (scope async) (nullable): free function for @data +@@ -1662,46 +1662,46 @@ vips_value_set_ref_string( GValue *value, const char *str ) + * See also: vips_value_get_blob() + */ + void +-vips_value_set_blob( GValue *value, +- VipsCallbackFn free_fn, const void *data, size_t length ) ++vips_value_set_blob(GValue *value, ++ VipsCallbackFn free_fn, const void *data, size_t length) + { + VipsBlob *blob; + +- g_assert( G_VALUE_TYPE( value ) == VIPS_TYPE_BLOB ); ++ g_assert(G_VALUE_TYPE(value) == VIPS_TYPE_BLOB); + +- blob = vips_blob_new( free_fn, data, length ); +- g_value_set_boxed( value, blob ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ blob = vips_blob_new(free_fn, data, length); ++ g_value_set_boxed(value, blob); ++ vips_area_unref(VIPS_AREA(blob)); + } + +-/** ++/** + * vips_value_set_blob_free: + * @value: GValue to set + * @data: (transfer full) (array length=length) (element-type guint8) : pointer to area of + * memory + * @length: length of memory area + * +- * Just like vips_value_set_blob(), but when ++ * Just like vips_value_set_blob(), but when + * @value is freed, @data will be +- * freed with g_free(). ++ * freed with g_free(). + * + * This can be easier to call for language bindings. + * + * See also: vips_value_set_blob() + */ + void +-vips_value_set_blob_free( GValue *value, void *data, size_t length ) ++vips_value_set_blob_free(GValue *value, void *data, size_t length) + { + VipsBlob *blob; + +- g_assert( G_VALUE_TYPE( value ) == VIPS_TYPE_BLOB ); ++ g_assert(G_VALUE_TYPE(value) == VIPS_TYPE_BLOB); + +- blob = vips_blob_new( (VipsCallbackFn) vips_area_free_cb, data, length ); +- g_value_set_boxed( value, blob ); +- vips_area_unref( VIPS_AREA( blob ) ); ++ blob = vips_blob_new((VipsCallbackFn) vips_area_free_cb, data, length); ++ g_value_set_boxed(value, blob); ++ vips_area_unref(VIPS_AREA(blob)); + } + +-/** ++/** + * vips_value_get_blob: + * @value: GValue to set + * @length: (out) (optional): optionally return length of memory area +@@ -1718,34 +1718,34 @@ vips_value_set_blob_free( GValue *value, void *data, size_t length ) + * by @value. + */ + void * +-vips_value_get_blob( const GValue *value, size_t *length ) ++vips_value_get_blob(const GValue *value, size_t *length) + { +- return( vips_value_get_area( value, length ) ); ++ return (vips_value_get_area(value, length)); + } + + /** +- * vips_value_set_array: ++ * vips_value_set_array: + * @value: (out): %GValue to set +- * @n: number of elements +- * @type: the type of each element +- * @sizeof_type: the sizeof each element ++ * @n: number of elements ++ * @type: the type of each element ++ * @sizeof_type: the sizeof each element + * +- * Set @value to be an array of things. ++ * Set @value to be an array of things. + * +- * This allocates memory but does not ++ * This allocates memory but does not + * initialise the contents: get the pointer and write instead. + */ + void +-vips_value_set_array( GValue *value, int n, GType type, size_t sizeof_type ) ++vips_value_set_array(GValue *value, int n, GType type, size_t sizeof_type) + { + VipsArea *area; + +- area = vips_area_new_array( type, sizeof_type, n ); +- g_value_set_boxed( value, area ); +- vips_area_unref( area ); ++ area = vips_area_new_array(type, sizeof_type, n); ++ g_value_set_boxed(value, area); ++ vips_area_unref(area); + } + +-/** ++/** + * vips_value_get_array: + * @value: %GValue to get from + * @n: (out) (optional): return the number of elements here, optionally +@@ -1761,8 +1761,8 @@ vips_value_set_array( GValue *value, int n, GType type, size_t sizeof_type ) + * Returns: (transfer none): The array address. + */ + void * +-vips_value_get_array( const GValue *value, +- int *n, GType *type, size_t *sizeof_type ) ++vips_value_get_array(const GValue *value, ++ int *n, GType *type, size_t *sizeof_type) + { + VipsArea *area; + +@@ -1770,19 +1770,19 @@ vips_value_get_array( const GValue *value, + * vips_*_get_type(). + */ + +- if( !(area = g_value_get_boxed( value )) ) +- return( NULL ); +- if( n ) ++ if (!(area = g_value_get_boxed(value))) ++ return (NULL); ++ if (n) + *n = area->n; +- if( type ) ++ if (type) + *type = area->type; +- if( sizeof_type ) ++ if (sizeof_type) + *sizeof_type = area->sizeof_type; + +- return( area->data ); ++ return (area->data); + } + +-/** ++/** + * vips_value_get_array_int: + * @value: %GValue to get from + * @n: (out) (optional): return the number of elements here, optionally +@@ -1795,35 +1795,35 @@ vips_value_get_array( const GValue *value, + * Returns: (transfer none) (array length=n): The array address. + */ + int * +-vips_value_get_array_int( const GValue *value, int *n ) ++vips_value_get_array_int(const GValue *value, int *n) + { +- return( vips_value_get_array( value, n, NULL, NULL ) ); ++ return (vips_value_get_array(value, n, NULL, NULL)); + } + +-/** ++/** + * vips_value_set_array_int: + * @value: %GValue to get from + * @array: (array length=n) (allow-none): array of ints +- * @n: the number of elements ++ * @n: the number of elements + * +- * Set @value to hold a copy of @array. Pass in the array length in @n. ++ * Set @value to hold a copy of @array. Pass in the array length in @n. + * + * See also: vips_array_int_get(). + */ + void +-vips_value_set_array_int( GValue *value, const int *array, int n ) ++vips_value_set_array_int(GValue *value, const int *array, int n) + { +- vips_value_set_array( value, n, G_TYPE_INT, sizeof( int ) ); ++ vips_value_set_array(value, n, G_TYPE_INT, sizeof(int)); + +- if( array ) { ++ if (array) { + int *array_copy; + +- array_copy = vips_value_get_array_int( value, NULL ); +- memcpy( array_copy, array, n * sizeof( int ) ); ++ array_copy = vips_value_get_array_int(value, NULL); ++ memcpy(array_copy, array, n * sizeof(int)); + } + } + +-/** ++/** + * vips_value_get_array_double: + * @value: %GValue to get from + * @n: (out) (optional): return the number of elements here, optionally +@@ -1836,35 +1836,35 @@ vips_value_set_array_int( GValue *value, const int *array, int n ) + * Returns: (transfer none) (array length=n): The array address. + */ + double * +-vips_value_get_array_double( const GValue *value, int *n ) ++vips_value_get_array_double(const GValue *value, int *n) + { +- return( vips_value_get_array( value, n, NULL, NULL ) ); ++ return (vips_value_get_array(value, n, NULL, NULL)); + } + +-/** ++/** + * vips_value_set_array_double: + * @value: %GValue to get from + * @array: (array length=n) (allow-none): array of doubles +- * @n: the number of elements ++ * @n: the number of elements + * +- * Set @value to hold a copy of @array. Pass in the array length in @n. ++ * Set @value to hold a copy of @array. Pass in the array length in @n. + * + * See also: vips_array_double_get(). + */ + void +-vips_value_set_array_double( GValue *value, const double *array, int n ) ++vips_value_set_array_double(GValue *value, const double *array, int n) + { +- vips_value_set_array( value, n, G_TYPE_DOUBLE, sizeof( double ) ); ++ vips_value_set_array(value, n, G_TYPE_DOUBLE, sizeof(double)); + +- if( array ) { ++ if (array) { + double *array_copy; + +- array_copy = vips_value_get_array_double( value, NULL ); +- memcpy( array_copy, array, n * sizeof( double ) ); ++ array_copy = vips_value_get_array_double(value, NULL); ++ memcpy(array_copy, array, n * sizeof(double)); + } + } + +-/** ++/** + * vips_value_get_array_image: + * @value: %GValue to get from + * @n: (out) (optional): return the number of elements here, optionally +@@ -1877,32 +1877,32 @@ vips_value_set_array_double( GValue *value, const double *array, int n ) + * Returns: (transfer none) (array length=n): The array address. + */ + VipsImage ** +-vips_value_get_array_image( const GValue *value, int *n ) ++vips_value_get_array_image(const GValue *value, int *n) + { +- return( vips_value_get_array( value, n, NULL, NULL ) ); ++ return (vips_value_get_array(value, n, NULL, NULL)); + } + +-/** ++/** + * vips_value_set_array_image: + * @value: %GValue to get from +- * @n: the number of elements ++ * @n: the number of elements + * +- * Set @value to hold an array of images. Pass in the array length in @n. ++ * Set @value to hold an array of images. Pass in the array length in @n. + * + * See also: vips_array_image_get(). + */ + void +-vips_value_set_array_image( GValue *value, int n ) ++vips_value_set_array_image(GValue *value, int n) + { + VipsArea *area; + +- area = vips_area_new_array_object( n ); ++ area = vips_area_new_array_object(n); + area->type = VIPS_TYPE_IMAGE; +- g_value_set_boxed( value, area ); +- vips_area_unref( area ); ++ g_value_set_boxed(value, area); ++ vips_area_unref(area); + } + +-/** ++/** + * vips_value_get_array_object: (skip) + * @value: %GValue to get from + * @n: (out) (optional): return the number of elements here, optionally +@@ -1915,34 +1915,34 @@ vips_value_set_array_image( GValue *value, int n ) + * Returns: (transfer none) (array length=n): The array address. + */ + GObject ** +-vips_value_get_array_object( const GValue *value, int *n ) ++vips_value_get_array_object(const GValue *value, int *n) + { +- return( vips_value_get_array( value, n, NULL, NULL ) ); ++ return (vips_value_get_array(value, n, NULL, NULL)); + } + +-/** ++/** + * vips_value_set_array_object: + * @value: (out): %GValue to set +- * @n: the number of elements ++ * @n: the number of elements + * +- * Set @value to hold an array of %GObject. Pass in the array length in @n. ++ * Set @value to hold an array of %GObject. Pass in the array length in @n. + * + * See also: vips_value_get_array_object(). + */ + void +-vips_value_set_array_object( GValue *value, int n ) ++vips_value_set_array_object(GValue *value, int n) + { + VipsArea *area; + +- area = vips_area_new_array_object( n ); +- g_value_set_boxed( value, area ); +- vips_area_unref( area ); ++ area = vips_area_new_array_object(n); ++ g_value_set_boxed(value, area); ++ vips_area_unref(area); + } + + /* Make the types we need for basic functioning. Called from vips_init(). + */ + void +-vips__meta_init_types( void ) ++vips__meta_init_types(void) + { + (void) vips_thing_get_type(); + (void) vips_save_string_get_type(); +@@ -1953,20 +1953,20 @@ vips__meta_init_types( void ) + (void) vips_array_double_get_type(); + (void) vips_array_image_get_type(); + +- /* Register transform functions to go from built-in saveable types to +- * a save string. Transform functions for our own types are set +- * during type creation. ++ /* Register transform functions to go from built-in saveable types to ++ * a save string. Transform functions for our own types are set ++ * during type creation. + */ +- g_value_register_transform_func( G_TYPE_INT, VIPS_TYPE_SAVE_STRING, +- transform_int_save_string ); +- g_value_register_transform_func( VIPS_TYPE_SAVE_STRING, G_TYPE_INT, +- transform_save_string_int ); +- g_value_register_transform_func( G_TYPE_DOUBLE, VIPS_TYPE_SAVE_STRING, +- transform_double_save_string ); +- g_value_register_transform_func( VIPS_TYPE_SAVE_STRING, G_TYPE_DOUBLE, +- transform_save_string_double ); +- g_value_register_transform_func( G_TYPE_FLOAT, VIPS_TYPE_SAVE_STRING, +- transform_float_save_string ); +- g_value_register_transform_func( VIPS_TYPE_SAVE_STRING, G_TYPE_FLOAT, +- transform_save_string_float ); ++ g_value_register_transform_func(G_TYPE_INT, VIPS_TYPE_SAVE_STRING, ++ transform_int_save_string); ++ g_value_register_transform_func(VIPS_TYPE_SAVE_STRING, G_TYPE_INT, ++ transform_save_string_int); ++ g_value_register_transform_func(G_TYPE_DOUBLE, VIPS_TYPE_SAVE_STRING, ++ transform_double_save_string); ++ g_value_register_transform_func(VIPS_TYPE_SAVE_STRING, G_TYPE_DOUBLE, ++ transform_save_string_double); ++ g_value_register_transform_func(G_TYPE_FLOAT, VIPS_TYPE_SAVE_STRING, ++ transform_float_save_string); ++ g_value_register_transform_func(VIPS_TYPE_SAVE_STRING, G_TYPE_FLOAT, ++ transform_save_string_float); + } +diff --git a/libvips/iofuncs/util.c b/libvips/iofuncs/util.c +index 2f9598315a..adb78356a4 100644 +--- a/libvips/iofuncs/util.c ++++ b/libvips/iofuncs/util.c +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2003 The National Gallery ++ Copyright (C) 1991-2003 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -66,103 +66,103 @@ + */ + #define MAX_BUF (100000) + +-#define MODE_READ CLOEXEC (BINARYIZE (O_RDONLY)) ++#define MODE_READ CLOEXEC(BINARYIZE(O_RDONLY)) + + /* Test two lists for eqality. + */ + gboolean +-vips_slist_equal( GSList *l1, GSList *l2 ) ++vips_slist_equal(GSList *l1, GSList *l2) + { +- while( l1 && l2 ) { +- if( l1->data != l2->data ) +- return( FALSE ); ++ while (l1 && l2) { ++ if (l1->data != l2->data) ++ return (FALSE); + + l1 = l1->next; + l2 = l2->next; + } + +- if( l1 || l2 ) +- return( FALSE ); +- +- return( TRUE ); ++ if (l1 || l2) ++ return (FALSE); ++ ++ return (TRUE); + } + + /* Map over an slist. _copy() the list in case the callback changes it. + */ + void * +-vips_slist_map2( GSList *list, VipsSListMap2Fn fn, void *a, void *b ) ++vips_slist_map2(GSList *list, VipsSListMap2Fn fn, void *a, void *b) + { + GSList *copy; + GSList *i; + void *result; + +- copy = g_slist_copy( list ); ++ copy = g_slist_copy(list); + result = NULL; +- for( i = copy; i && !(result = fn( i->data, a, b )); i = i->next ) ++ for (i = copy; i && !(result = fn(i->data, a, b)); i = i->next) + ; +- g_slist_free( copy ); ++ g_slist_free(copy); + +- return( result ); ++ return (result); + } + + /* Map backwards. We _reverse() rather than recurse and unwind to save stack. + */ + void * +-vips_slist_map2_rev( GSList *list, VipsSListMap2Fn fn, void *a, void *b ) ++vips_slist_map2_rev(GSList *list, VipsSListMap2Fn fn, void *a, void *b) + { + GSList *copy; + GSList *i; + void *result; + +- copy = g_slist_copy( list ); +- copy = g_slist_reverse( copy ); ++ copy = g_slist_copy(list); ++ copy = g_slist_reverse(copy); + result = NULL; +- for( i = copy; i && !(result = fn( i->data, a, b )); i = i->next ) ++ for (i = copy; i && !(result = fn(i->data, a, b)); i = i->next) + ; +- g_slist_free( copy ); ++ g_slist_free(copy); + +- return( result ); ++ return (result); + } + + void * +-vips_slist_map4( GSList *list, +- VipsSListMap4Fn fn, void *a, void *b, void *c, void *d ) ++vips_slist_map4(GSList *list, ++ VipsSListMap4Fn fn, void *a, void *b, void *c, void *d) + { + GSList *copy; + GSList *i; + void *result; + +- copy = g_slist_copy( list ); ++ copy = g_slist_copy(list); + result = NULL; +- for( i = copy; +- i && !(result = fn( i->data, a, b, c, d )); i = i->next ) ++ for (i = copy; ++ i && !(result = fn(i->data, a, b, c, d)); i = i->next) + ; +- g_slist_free( copy ); ++ g_slist_free(copy); + +- return( result ); ++ return (result); + } + + void * +-vips_slist_fold2( GSList *list, void *start, +- VipsSListFold2Fn fn, void *a, void *b ) ++vips_slist_fold2(GSList *list, void *start, ++ VipsSListFold2Fn fn, void *a, void *b) + { +- void *c; +- GSList *this, *next; ++ void *c; ++ GSList *this, *next; + +- for( c = start, this = list; this; this = next ) { +- next = this->next; ++ for (c = start, this = list; this; this = next) { ++ next = this->next; + +- if( !(c = fn( this->data, c, a, b )) ) +- return( NULL ); +- } ++ if (!(c = fn(this->data, c, a, b))) ++ return (NULL); ++ } + +- return( c ); ++ return (c); + } + + /* Remove all occurences of an item from a list. + */ + GSList * +-vips_slist_filter( GSList *list, VipsSListMap2Fn fn, void *a, void *b ) ++vips_slist_filter(GSList *list, VipsSListMap2Fn fn, void *a, void *b) + { + GSList *tmp; + GSList *prev; +@@ -170,17 +170,17 @@ vips_slist_filter( GSList *list, VipsSListMap2Fn fn, void *a, void *b ) + prev = NULL; + tmp = list; + +- while( tmp ) { +- if( fn( tmp->data, a, b ) ) { ++ while (tmp) { ++ if (fn(tmp->data, a, b)) { + GSList *next = tmp->next; + +- if( prev ) ++ if (prev) + prev->next = next; +- if( list == tmp ) ++ if (list == tmp) + list = next; + + tmp->next = NULL; +- g_slist_free( tmp ); ++ g_slist_free(tmp); + tmp = next; + } + else { +@@ -189,31 +189,31 @@ vips_slist_filter( GSList *list, VipsSListMap2Fn fn, void *a, void *b ) + } + } + +- return( list ); ++ return (list); + } + + static void +-vips_slist_free_all_cb( void * thing, void * dummy ) ++vips_slist_free_all_cb(void *thing, void *dummy) + { +- g_free( thing ); ++ g_free(thing); + } + + /* Free a g_slist of things which need g_free()ing. + */ + void +-vips_slist_free_all( GSList *list ) ++vips_slist_free_all(GSList *list) + { +- g_slist_foreach( list, vips_slist_free_all_cb, NULL ); +- g_slist_free( list ); ++ g_slist_foreach(list, vips_slist_free_all_cb, NULL); ++ g_slist_free(list); + } + + void * +-vips_map_equal( void *a, void *b ) ++vips_map_equal(void *a, void *b) + { +- if( a == b ) +- return( a ); ++ if (a == b) ++ return (a); + +- return( NULL ); ++ return (NULL); + } + + typedef struct { +@@ -224,15 +224,15 @@ typedef struct { + } Pair; + + static gboolean +-vips_hash_table_predicate( const char *key, void *value, Pair *pair ) ++vips_hash_table_predicate(const char *key, void *value, Pair *pair) + { +- return( (pair->result = pair->fn( value, pair->a, pair->b )) != NULL ); ++ return ((pair->result = pair->fn(value, pair->a, pair->b)) != NULL); + } + + /* Like slist map, but for a hash table. + */ + void * +-vips_hash_table_map( GHashTable *hash, VipsSListMap2Fn fn, void *a, void *b ) ++vips_hash_table_map(GHashTable *hash, VipsSListMap2Fn fn, void *a, void *b) + { + Pair pair; + +@@ -241,9 +241,9 @@ vips_hash_table_map( GHashTable *hash, VipsSListMap2Fn fn, void *a, void *b ) + pair.fn = fn; + pair.result = NULL; + +- g_hash_table_find( hash, (GHRFunc) vips_hash_table_predicate, &pair ); ++ g_hash_table_find(hash, (GHRFunc) vips_hash_table_predicate, &pair); + +- return( pair.result ); ++ return (pair.result); + } + + /* Like strncpy(), but always NULL-terminate, and don't pad with NULLs. +@@ -251,83 +251,83 @@ vips_hash_table_map( GHashTable *hash, VipsSListMap2Fn fn, void *a, void *b ) + * final byte of @dest is set to '\0'. + */ + char * +-vips_strncpy( char *dest, const char *src, int n ) ++vips_strncpy(char *dest, const char *src, int n) + { +- int i; ++ int i; + +- g_assert( n > 0 ); ++ g_assert(n > 0); + +- for( i = 0; i < n - 1; i++ ) +- if( !(dest[i] = src[i]) ) +- break; +- dest[i] = '\0'; ++ for (i = 0; i < n - 1; i++) ++ if (!(dest[i] = src[i])) ++ break; ++ dest[i] = '\0'; + +- return( dest ); ++ return (dest); + } + + /* Find the rightmost occurrence of needle in haystack. + */ + char * +-vips_strrstr( const char *haystack, const char *needle ) ++vips_strrstr(const char *haystack, const char *needle) + { +- int haystack_len = strlen( haystack ); +- int needle_len = strlen( needle ); ++ int haystack_len = strlen(haystack); ++ int needle_len = strlen(needle); + int i; + +- for( i = haystack_len - needle_len; i >= 0; i-- ) +- if( strncmp( needle, haystack + i, needle_len ) == 0 ) +- return( (char *) haystack + i ); +- +- return( NULL ); ++ for (i = haystack_len - needle_len; i >= 0; i--) ++ if (strncmp(needle, haystack + i, needle_len) == 0) ++ return ((char *) haystack + i); ++ ++ return (NULL); + } + +-/* Test for string b ends string a. ++/* Test for string b ends string a. + */ + gboolean +-vips_ispostfix( const char *a, const char *b ) +-{ +- int m = strlen( a ); +- int n = strlen( b ); ++vips_ispostfix(const char *a, const char *b) ++{ ++ int m = strlen(a); ++ int n = strlen(b); + +- if( n > m ) +- return( FALSE ); ++ if (n > m) ++ return (FALSE); + +- return( strcmp( a + m - n, b ) == 0 ); ++ return (strcmp(a + m - n, b) == 0); + } + +-/* Case-insensitive test for string b ends string a. ASCII strings only. ++/* Case-insensitive test for string b ends string a. ASCII strings only. + */ + gboolean +-vips_iscasepostfix( const char *a, const char *b ) +-{ +- int m = strlen( a ); +- int n = strlen( b ); ++vips_iscasepostfix(const char *a, const char *b) ++{ ++ int m = strlen(a); ++ int n = strlen(b); + +- if( n > m ) +- return( FALSE ); ++ if (n > m) ++ return (FALSE); + +- return( g_ascii_strcasecmp( a + m - n, b ) == 0 ); ++ return (g_ascii_strcasecmp(a + m - n, b) == 0); + } + + /* Test for string a starts string b. a is a known-good string, b may be +- * random data. ++ * random data. + */ + gboolean +-vips_isprefix( const char *a, const char *b ) ++vips_isprefix(const char *a, const char *b) + { + int i; + +- for( i = 0; a[i] && b[i]; i++ ) +- if( a[i] != b[i] ) +- return( FALSE ); ++ for (i = 0; a[i] && b[i]; i++) ++ if (a[i] != b[i]) ++ return (FALSE); + + /* If there's stuff left in a but b has finished, we must have a + * mismatch. + */ +- if( a[i] && !b[i] ) +- return( FALSE ); ++ if (a[i] && !b[i]) ++ return (FALSE); + +- return( TRUE ); ++ return (TRUE); + } + + /* Exactly like strcspn(), but allow \ as an escape character. +@@ -336,25 +336,25 @@ vips_isprefix( const char *a, const char *b ) + * strspne( "hello\\ world", " " ) == 12 + */ + static size_t +-strcspne( const char *s, const char *reject ) ++strcspne(const char *s, const char *reject) + { + size_t skip; + + /* If \ is one of the reject chars, no need for any looping. + */ +- if( strchr( reject, '\\' ) ) +- return( strcspn( s, reject ) ); ++ if (strchr(reject, '\\')) ++ return (strcspn(s, reject)); + + skip = 0; +- for(;;) { +- skip += strcspn( s + skip, reject ); ++ for (;;) { ++ skip += strcspn(s + skip, reject); + + /* s[skip] is at the start of the string, or the end, or on a + * break character. + */ +- if( skip == 0 || ++ if (skip == 0 || + !s[skip] || +- s[skip - 1] != '\\' ) ++ s[skip - 1] != '\\') + break; + + /* So skip points at break char and we have a '\' in the char +@@ -363,7 +363,7 @@ strcspne( const char *s, const char *reject ) + skip += 1; + } + +- return( skip ); ++ return (skip); + } + + /* Like strtok(). Give a string and a list of break characters. Then: +@@ -375,7 +375,7 @@ strcspne( const char *s, const char *reject ) + * + * The idea is that this can be used in loops as the iterator. Example: + * +- * char *p = " 1 2 3 "; // mutable ++ * char *p = " 1 2 3 "; // mutable + * char *q; + * int i; + * int v[...]; +@@ -404,63 +404,63 @@ strcspne( const char *s, const char *reject ) + * a space. The \ characters are squashed out. + */ + char * +-vips_break_token( char *str, const char *brk ) ++vips_break_token(char *str, const char *brk) + { +- char *p; +- char *q; ++ char *p; ++ char *q; + +- /* Is the string empty? If yes, return NULL immediately. +- */ +- if( !str || +- !*str ) +- return( NULL ); ++ /* Is the string empty? If yes, return NULL immediately. ++ */ ++ if (!str || ++ !*str) ++ return (NULL); + +- /* Skip initial break characters. +- */ +- p = str + strspn( str, brk ); ++ /* Skip initial break characters. ++ */ ++ p = str + strspn(str, brk); + + /* No item? + */ +- if( !*p ) +- return( NULL ); ++ if (!*p) ++ return (NULL); + +- /* We have a token ... search for the first break character after the ++ /* We have a token ... search for the first break character after the + * token. strcspne() allows '\' to escape breaks, see above. +- */ +- p += strcspne( p, brk ); +- +- /* Is there string left? +- */ +- if( *p ) { +- /* Write in an end-of-string mark and return the start of the +- * next token. +- */ +- *p++ = '\0'; +- p += strspn( p, brk ); +- } ++ */ ++ p += strcspne(p, brk); ++ ++ /* Is there string left? ++ */ ++ if (*p) { ++ /* Write in an end-of-string mark and return the start of the ++ * next token. ++ */ ++ *p++ = '\0'; ++ p += strspn(p, brk); ++ } + + /* There may be escaped break characters in str. Loop, squashing them + * out. + */ +- for( q = strchr( str, '\\' ); q && *q; q = strchr( q, '\\' ) ) { +- memmove( q, q + 1, strlen( q ) ); ++ for (q = strchr(str, '\\'); q && *q; q = strchr(q, '\\')) { ++ memmove(q, q + 1, strlen(q)); + + /* If there's \\, we don't want to squash out the second \. + */ + q += 1; + } + +- return( p ); ++ return (p); + } + + /* Wrapper over (v)snprintf() ... missing on old systems. + */ + int +-vips_vsnprintf( char *str, size_t size, const char *format, va_list ap ) ++vips_vsnprintf(char *str, size_t size, const char *format, va_list ap) + { + #ifdef HAVE_VSNPRINTF +- return( vsnprintf( str, size, format, ap ) ); +-#else /*HAVE_VSNPRINTF*/ ++ return (vsnprintf(str, size, format, ap)); ++#else /*HAVE_VSNPRINTF*/ + /* Bleurg! + */ + int n; +@@ -469,40 +469,40 @@ vips_vsnprintf( char *str, size_t size, const char *format, va_list ap ) + /* We can't return an error code, we may already have trashed the + * stack. We must stop immediately. + */ +- if( size > MAX_BUF ) +- vips_error_exit( "panic: buffer overflow " +- "(request to write %lu bytes to buffer of %d bytes)", +- (unsigned long) size, MAX_BUF ); +- n = vsprintf( buf, format, ap ); +- if( n > MAX_BUF ) +- vips_error_exit( "panic: buffer overflow " +- "(%d bytes written to buffer of %d bytes)", +- n, MAX_BUF ); +- +- vips_strncpy( str, buf, size ); +- +- return( n ); ++ if (size > MAX_BUF) ++ vips_error_exit("panic: buffer overflow " ++ "(request to write %lu bytes to buffer of %d bytes)", ++ (unsigned long) size, MAX_BUF); ++ n = vsprintf(buf, format, ap); ++ if (n > MAX_BUF) ++ vips_error_exit("panic: buffer overflow " ++ "(%d bytes written to buffer of %d bytes)", ++ n, MAX_BUF); ++ ++ vips_strncpy(str, buf, size); ++ ++ return (n); + #endif /*HAVE_VSNPRINTF*/ + } + + int +-vips_snprintf( char *str, size_t size, const char *format, ... ) ++vips_snprintf(char *str, size_t size, const char *format, ...) + { + va_list ap; + int n; + +- va_start( ap, format ); +- n = vips_vsnprintf( str, size, format, ap ); +- va_end( ap ); ++ va_start(ap, format); ++ n = vips_vsnprintf(str, size, format, ap); ++ va_end(ap); + +- return( n ); ++ return (n); + } + + /* Does a filename have one of a set of suffixes. Ignore case and any trailing + * options. + */ + int +-vips_filename_suffix_match( const char *path, const char *suffixes[] ) ++vips_filename_suffix_match(const char *path, const char *suffixes[]) + { + char *basename; + char *q; +@@ -511,76 +511,76 @@ vips_filename_suffix_match( const char *path, const char *suffixes[] ) + + /* Drop any directory components. + */ +- basename = g_path_get_basename( path ); ++ basename = g_path_get_basename(path); + + /* Zap any trailing [] options. + */ +- if( (q = (char *) vips__find_rightmost_brackets( basename )) ) ++ if ((q = (char *) vips__find_rightmost_brackets(basename))) + *q = '\0'; + + result = 0; +- for( p = suffixes; *p; p++ ) +- if( vips_iscasepostfix( basename, *p ) ) { ++ for (p = suffixes; *p; p++) ++ if (vips_iscasepostfix(basename, *p)) { + result = 1; + break; + } + +- g_free( basename ); ++ g_free(basename); + +- return( result ); ++ return (result); + } + + /* Get file length ... 64-bitally. -1 for error. + */ + gint64 +-vips_file_length( int fd ) ++vips_file_length(int fd) + { + #ifdef G_OS_WIN32 + struct _stati64 st; + +- if( _fstati64( fd, &st ) == -1 ) { +-#else /*!G_OS_WIN32*/ ++ if (_fstati64(fd, &st) == -1) { ++#else /*!G_OS_WIN32*/ + struct stat st; + +- if( fstat( fd, &st ) == -1 ) { ++ if (fstat(fd, &st) == -1) { + #endif /*G_OS_WIN32*/ +- vips_error_system( errno, "vips_file_length", +- "%s", _( "unable to get file stats" ) ); +- return( -1 ); ++ vips_error_system(errno, "vips_file_length", ++ "%s", _("unable to get file stats")); ++ return (-1); + } + +- return( st.st_size ); ++ return (st.st_size); + } + + /* Wrap write() up + */ + int +-vips__write( int fd, const void *buf, size_t count ) ++vips__write(int fd, const void *buf, size_t count) + { + do { +- size_t nwritten = write( fd, buf, count ); ++ size_t nwritten = write(fd, buf, count); + +- if( nwritten == (size_t) -1 ) { +- vips_error_system( errno, "vips__write", +- "%s", _( "write failed" ) ); +- return( -1 ); ++ if (nwritten == (size_t) -1) { ++ vips_error_system(errno, "vips__write", ++ "%s", _("write failed")); ++ return (-1); + } + + buf = (void *) ((char *) buf + nwritten); + count -= nwritten; +- } while( count > 0 ); ++ } while (count > 0); + +- return( 0 ); ++ return (0); + } + + #ifdef G_OS_WIN32 +-/* Set the create date on a file. On Windows, the create date may be copied +- * over from an existing file of the same name, unless you reset it. ++/* Set the create date on a file. On Windows, the create date may be copied ++ * over from an existing file of the same name, unless you reset it. + * + * See https://blogs.msdn.microsoft.com/oldnewthing/20050715-14/?p=34923 + */ + void +-vips__set_create_time( int fd ) ++vips__set_create_time(int fd) + { + HANDLE handle; + SYSTEMTIME st; +@@ -589,80 +589,80 @@ vips__set_create_time( int fd ) + /* Create time cannot be set on invalid or stream + * (stdin, stdout, stderr) file descriptors. + */ +- if( fd < 3 ) ++ if (fd < 3) + return; + +- if( (handle = (HANDLE) _get_osfhandle( fd )) == INVALID_HANDLE_VALUE ) ++ if ((handle = (HANDLE) _get_osfhandle(fd)) == INVALID_HANDLE_VALUE) + return; +- GetSystemTime( &st ); +- SystemTimeToFileTime( &st, &ft ); +- SetFileTime( handle, &ft, &ft, &ft ); ++ GetSystemTime(&st); ++ SystemTimeToFileTime(&st, &ft); ++ SetFileTime(handle, &ft, &ft, &ft); + } + #endif /*G_OS_WIN32*/ + + /* open() with a utf8 filename, setting errno. + */ + int +-vips__open( const char *filename, int flags, int mode ) ++vips__open(const char *filename, int flags, int mode) + { + int fd; + + /* Various bad things happen if you accidentally open a directory as a + * file. + */ +- if( g_file_test( filename, G_FILE_TEST_IS_DIR ) ) { ++ if (g_file_test(filename, G_FILE_TEST_IS_DIR)) { + errno = EISDIR; +- return( -1 ); ++ return (-1); + } + +- fd = g_open( filename, flags, mode ); ++ fd = g_open(filename, flags, mode); + + #ifdef G_OS_WIN32 +- if( fd != -1 && +- (mode & O_CREAT) ) +- vips__set_create_time( fd ); ++ if (fd != -1 && ++ (mode & O_CREAT)) ++ vips__set_create_time(fd); + #endif /*G_OS_WIN32*/ + +- return( fd ); ++ return (fd); + } + +-int +-vips__open_read( const char *filename ) ++int ++vips__open_read(const char *filename) + { +- return( vips__open( filename, MODE_READ, 0 ) ); ++ return (vips__open(filename, MODE_READ, 0)); + } + + /* fopen() with utf8 filename and mode, setting errno. + */ + FILE * +-vips__fopen( const char *filename, const char *mode ) ++vips__fopen(const char *filename, const char *mode) + { + FILE *fp; + +- fp = g_fopen( filename, mode ); ++ fp = g_fopen(filename, mode); + + #ifdef G_OS_WIN32 +- if( fp && +- mode[0] == 'w' ) +- vips__set_create_time( _fileno( fp ) ); ++ if (fp && ++ mode[0] == 'w') ++ vips__set_create_time(_fileno(fp)); + #endif /*G_OS_WIN32*/ + +- return( fp ); ++ return (fp); + } + + /* Does a filename contain a directory separator? + */ +-static gboolean +-filename_hasdir( const char *filename ) ++static gboolean ++filename_hasdir(const char *filename) + { + char *dirname; + gboolean hasdir; + +- dirname = g_path_get_dirname( filename ); +- hasdir = (strcmp( dirname, "." ) != 0); +- g_free( dirname ); ++ dirname = g_path_get_dirname(filename); ++ hasdir = (strcmp(dirname, ".") != 0); ++ g_free(dirname); + +- return( hasdir ); ++ return (hasdir); + } + + /* Open a file. We take an optional fallback dir as well and will try opening +@@ -673,86 +673,86 @@ filename_hasdir( const char *filename ) + * directory separator, we try looking in the fallback dir. + */ + FILE * +-vips__file_open_read( const char *filename, const char *fallback_dir, +- gboolean text_mode ) ++vips__file_open_read(const char *filename, const char *fallback_dir, ++ gboolean text_mode) + { + char *mode; + FILE *fp; + + #if defined(G_PLATFORM_WIN32) || defined(G_WITH_CYGWIN) +- if( text_mode ) ++ if (text_mode) + mode = "rN"; + else + mode = "rbN"; +-#else /*!defined(G_PLATFORM_WIN32) && !defined(G_WITH_CYGWIN)*/ ++#else /*!defined(G_PLATFORM_WIN32) && !defined(G_WITH_CYGWIN)*/ + mode = "re"; + #endif /*defined(G_PLATFORM_WIN32) || defined(G_WITH_CYGWIN)*/ + +- if( (fp = vips__fopen( filename, mode )) ) +- return( fp ); ++ if ((fp = vips__fopen(filename, mode))) ++ return (fp); + +- if( fallback_dir && +- !filename_hasdir( filename ) ) { ++ if (fallback_dir && ++ !filename_hasdir(filename)) { + char *path; + +- path = g_build_filename( fallback_dir, filename, NULL ); +- fp = vips__fopen( path, mode ); +- g_free( path ); ++ path = g_build_filename(fallback_dir, filename, NULL); ++ fp = vips__fopen(path, mode); ++ g_free(path); + +- if( fp ) +- return( fp ); ++ if (fp) ++ return (fp); + } + +- vips_error_system( errno, "vips__file_open_read", +- _( "unable to open file \"%s\" for reading" ), filename ); ++ vips_error_system(errno, "vips__file_open_read", ++ _("unable to open file \"%s\" for reading"), filename); + +- return( NULL ); ++ return (NULL); + } + + FILE * +-vips__file_open_write( const char *filename, gboolean text_mode ) ++vips__file_open_write(const char *filename, gboolean text_mode) + { + char *mode; + FILE *fp; + + #if defined(G_PLATFORM_WIN32) || defined(G_WITH_CYGWIN) +- if( text_mode ) ++ if (text_mode) + mode = "wN"; + else + mode = "wbN"; +-#else /*!defined(G_PLATFORM_WIN32) && !defined(G_WITH_CYGWIN)*/ ++#else /*!defined(G_PLATFORM_WIN32) && !defined(G_WITH_CYGWIN)*/ + mode = "we"; + #endif /*defined(G_PLATFORM_WIN32) || defined(G_WITH_CYGWIN)*/ + +- if( !(fp = vips__fopen( filename, mode )) ) { +- vips_error_system( errno, "vips__file_open_write", +- _( "unable to open file \"%s\" for writing" ), +- filename ); +- return( NULL ); ++ if (!(fp = vips__fopen(filename, mode))) { ++ vips_error_system(errno, "vips__file_open_write", ++ _("unable to open file \"%s\" for writing"), ++ filename); ++ return (NULL); + } + +- return( fp ); ++ return (fp); + } + + /* Load up a file as a string. + */ + char * +-vips__file_read( FILE *fp, const char *filename, size_t *length_out ) ++vips__file_read(FILE *fp, const char *filename, size_t *length_out) + { +- gint64 len; ++ gint64 len; + size_t read; +- char *str; ++ char *str; + +- len = vips_file_length( fileno( fp ) ); +- if( len > 1024 * 1024 * 1024 ) { ++ len = vips_file_length(fileno(fp)); ++ if (len > 1024 * 1024 * 1024) { + /* Over a gb? Seems crazy! + */ +- vips_error( "vips__file_read", +- _( "\"%s\" too long" ), filename ); +- return( NULL ); +- } ++ vips_error("vips__file_read", ++ _("\"%s\" too long"), filename); ++ return (NULL); ++ } + +- if( len == -1 ) { ++ if (len == -1) { + int size; + + /* Can't get length: read in chunks and realloc() to end of +@@ -767,100 +767,100 @@ vips__file_read( FILE *fp, const char *filename, size_t *length_out ) + /* Again, a 1gb sanity limit. + */ + size += 1024; +- if( size > 1024 * 1024 * 1024 || +- !(str2 = realloc( str, size )) ) { +- free( str ); +- vips_error( "vips__file_read", +- "%s", _( "out of memory" ) ); +- return( NULL ); ++ if (size > 1024 * 1024 * 1024 || ++ !(str2 = realloc(str, size))) { ++ free(str); ++ vips_error("vips__file_read", ++ "%s", _("out of memory")); ++ return (NULL); + } + str = str2; + + /* -1 to allow space for an extra NULL we add later. + */ +- read = fread( str + len, sizeof( char ), +- (size - len - 1) / sizeof( char ), +- fp ); ++ read = fread(str + len, sizeof(char), ++ (size - len - 1) / sizeof(char), ++ fp); + len += read; +- } while( !feof( fp ) ); ++ } while (!feof(fp)); + + #ifdef DEBUG +- printf( "read %ld bytes from unseekable stream\n", len ); ++ printf("read %ld bytes from unseekable stream\n", len); + #endif /*DEBUG*/ + } + else { +- /* Allocate memory and fill. ++ /* Allocate memory and fill. + */ +- if( !(str = vips_malloc( NULL, len + 1 )) ) +- return( NULL ); +- rewind( fp ); +- read = fread( str, sizeof( char ), (size_t) len, fp ); +- if( read != (size_t) len ) { +- g_free( str ); +- vips_error( "vips__file_read", +- _( "error reading from file \"%s\"" ), +- filename ); +- return( NULL ); ++ if (!(str = vips_malloc(NULL, len + 1))) ++ return (NULL); ++ rewind(fp); ++ read = fread(str, sizeof(char), (size_t) len, fp); ++ if (read != (size_t) len) { ++ g_free(str); ++ vips_error("vips__file_read", ++ _("error reading from file \"%s\""), ++ filename); ++ return (NULL); + } + } + + str[len] = '\0'; + +- if( length_out ) ++ if (length_out) + *length_out = len; + +- return( str ); ++ return (str); + } + + /* Load from a filename as a string. Used for things like reading in ICC + * profiles, ie. binary objects. + */ + char * +-vips__file_read_name( const char *filename, const char *fallback_dir, +- size_t *length_out ) ++vips__file_read_name(const char *filename, const char *fallback_dir, ++ size_t *length_out) + { + FILE *fp; + char *buffer; + +- if( !(fp = vips__file_open_read( filename, fallback_dir, FALSE )) ) +- return( NULL ); +- if( !(buffer = vips__file_read( fp, filename, length_out )) ) { +- fclose( fp ); +- return( NULL ); ++ if (!(fp = vips__file_open_read(filename, fallback_dir, FALSE))) ++ return (NULL); ++ if (!(buffer = vips__file_read(fp, filename, length_out))) { ++ fclose(fp); ++ return (NULL); + } +- fclose( fp ); ++ fclose(fp); + +- return( buffer ); ++ return (buffer); + } + + /* Like fwrite(), but returns non-zero on error and sets error message. + */ + int +-vips__file_write( void *data, size_t size, size_t nmemb, FILE *stream ) ++vips__file_write(void *data, size_t size, size_t nmemb, FILE *stream) + { + size_t n; + +- if( !data ) +- return( 0 ); ++ if (!data) ++ return (0); + +- if( (n = fwrite( data, size, nmemb, stream )) != nmemb ) { +- vips_error_system( errno, "vips__file_write", +- _( "write error (%zd out of %zd blocks written)" ), +- n, nmemb ); +- return( -1 ); ++ if ((n = fwrite(data, size, nmemb, stream)) != nmemb) { ++ vips_error_system(errno, "vips__file_write", ++ _("write error (%zd out of %zd blocks written)"), ++ n, nmemb); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + +-/* Read a few bytes from the start of a file. This is used for sniffing file +- * types, so we must read binary. ++/* Read a few bytes from the start of a file. This is used for sniffing file ++ * types, so we must read binary. + * + * Return the number of bytes actually read (the file might be shorter than + * len), or -1 for error. + */ + gint64 +-vips__get_bytes( const char *filename, unsigned char buf[], gint64 len ) ++vips__get_bytes(const char *filename, unsigned char buf[], gint64 len) + { + int fd; + gint64 bytes_read; +@@ -869,153 +869,153 @@ vips__get_bytes( const char *filename, unsigned char buf[], gint64 len ) + * so no hasty messages. And the file might be truncated, so no error + * on read either. + */ +- if( (fd = vips__open_read( filename )) == -1 ) +- return( 0 ); +- bytes_read = read( fd, buf, len ); +- close( fd ); ++ if ((fd = vips__open_read(filename)) == -1) ++ return (0); ++ bytes_read = read(fd, buf, len); ++ close(fd); + +- return( bytes_read ); ++ return (bytes_read); + } + + /* We try to support stupid DOS files too. These have \r\n (13, 10) as line +- * separators. Strategy: an fgetc() that swaps \r\n for \n. ++ * separators. Strategy: an fgetc() that swaps \r\n for \n. + * + * On Windows, stdio will automatically swap \r\n for \n, but on Linux we have +- * to do this by hand. ++ * to do this by hand. + */ + int +-vips__fgetc( FILE *fp ) ++vips__fgetc(FILE *fp) + { + int ch; + +- ch = fgetc( fp ); +- if( ch == '\r' ) { +- ch = fgetc( fp ); +- if( ch != '\n' ) { +- ungetc( ch, fp ); ++ ch = fgetc(fp); ++ if (ch == '\r') { ++ ch = fgetc(fp); ++ if (ch != '\n') { ++ ungetc(ch, fp); + ch = '\r'; + } + } + +- return( ch ); ++ return (ch); + } + + /* Alloc/free a GValue. + */ + static GValue * +-vips__gvalue_new( GType type ) ++vips__gvalue_new(GType type) + { + GValue *value; + +- value = g_new0( GValue, 1 ); +- g_value_init( value, type ); ++ value = g_new0(GValue, 1); ++ g_value_init(value, type); + +- return( value ); ++ return (value); + } + + static GValue * +-vips__gvalue_copy( GValue *value ) ++vips__gvalue_copy(GValue *value) + { + GValue *value_copy; + +- value_copy = vips__gvalue_new( G_VALUE_TYPE( value ) ); +- g_value_copy( value, value_copy ); ++ value_copy = vips__gvalue_new(G_VALUE_TYPE(value)); ++ g_value_copy(value, value_copy); + +- return( value_copy ); ++ return (value_copy); + } + + static void +-vips__gvalue_free( GValue *value, void *user_data ) ++vips__gvalue_free(GValue *value, void *user_data) + { +- g_value_unset( value ); +- g_free( value ); ++ g_value_unset(value); ++ g_free(value); + } + + GValue * +-vips__gvalue_ref_string_new( const char *text ) ++vips__gvalue_ref_string_new(const char *text) + { + GValue *value; + +- value = vips__gvalue_new( VIPS_TYPE_REF_STRING ); +- vips_value_set_ref_string( value, text ); ++ value = vips__gvalue_new(VIPS_TYPE_REF_STRING); ++ vips_value_set_ref_string(value, text); + +- return( value ); ++ return (value); + } + + /* Free a GSList of GValue. + */ + void +-vips__gslist_gvalue_free( GSList *list ) ++vips__gslist_gvalue_free(GSList *list) + { +- g_slist_foreach( list, (GFunc) vips__gvalue_free, NULL ); +- g_slist_free( list ); ++ g_slist_foreach(list, (GFunc) vips__gvalue_free, NULL); ++ g_slist_free(list); + } + + /* Copy a GSList of GValue. + */ + GSList * +-vips__gslist_gvalue_copy( const GSList *list ) ++vips__gslist_gvalue_copy(const GSList *list) + { + GSList *copy; + const GSList *p; + + copy = NULL; + +- for( p = list; p; p = p->next ) +- copy = g_slist_prepend( copy, +- vips__gvalue_copy( (GValue *) p->data ) ); ++ for (p = list; p; p = p->next) ++ copy = g_slist_prepend(copy, ++ vips__gvalue_copy((GValue *) p->data)); + +- copy = g_slist_reverse( copy ); ++ copy = g_slist_reverse(copy); + +- return( copy ); ++ return (copy); + } + +-/* Merge two GSList of GValue ... append to a all elements in b which are not +- * in a. Return the new value of a. Works for any vips refcounted type ++/* Merge two GSList of GValue ... append to a all elements in b which are not ++ * in a. Return the new value of a. Works for any vips refcounted type + * (string, blob, etc.). + */ + GSList * +-vips__gslist_gvalue_merge( GSList *a, const GSList *b ) ++vips__gslist_gvalue_merge(GSList *a, const GSList *b) + { + const GSList *i, *j; + GSList *tail; + + tail = NULL; + +- for( i = b; i; i = i->next ) { ++ for (i = b; i; i = i->next) { + GValue *value = (GValue *) i->data; + +- g_assert( G_VALUE_TYPE( value ) == VIPS_TYPE_REF_STRING ); ++ g_assert(G_VALUE_TYPE(value) == VIPS_TYPE_REF_STRING); + +- for( j = a; j; j = j->next ) { ++ for (j = a; j; j = j->next) { + GValue *value2 = (GValue *) j->data; + +- g_assert( G_VALUE_TYPE( value2 ) == +- VIPS_TYPE_REF_STRING ); ++ g_assert(G_VALUE_TYPE(value2) == ++ VIPS_TYPE_REF_STRING); + +- /* Just do a pointer compare ... good enough 99.9% of ++ /* Just do a pointer compare ... good enough 99.9% of + * the time. + */ +- if( vips_value_get_ref_string( value, NULL ) == +- vips_value_get_ref_string( value2, NULL ) ) ++ if (vips_value_get_ref_string(value, NULL) == ++ vips_value_get_ref_string(value2, NULL)) + break; + } + +- if( !j ) +- tail = g_slist_prepend( tail, +- vips__gvalue_copy( value ) ); ++ if (!j) ++ tail = g_slist_prepend(tail, ++ vips__gvalue_copy(value)); + } + +- a = g_slist_concat( a, g_slist_reverse( tail ) ); ++ a = g_slist_concat(a, g_slist_reverse(tail)); + +- return( a ); ++ return (a); + } + + /* Make a char * from GSList of GValue. Each GValue should be a ref_string. + * free the result. Empty list -> "", not NULL. Join strings with '\n'. + */ + char * +-vips__gslist_gvalue_get( const GSList *list ) ++vips__gslist_gvalue_get(const GSList *list) + { + const GSList *p; + size_t length; +@@ -1025,78 +1025,78 @@ vips__gslist_gvalue_get( const GSList *list ) + /* Need to estimate length first. + */ + length = 0; +- for( p = list; p; p = p->next ) { ++ for (p = list; p; p = p->next) { + GValue *value = (GValue *) p->data; + size_t l2; + +- g_assert( G_VALUE_TYPE( value ) == VIPS_TYPE_REF_STRING ); ++ g_assert(G_VALUE_TYPE(value) == VIPS_TYPE_REF_STRING); + + /* +1 for the newline we will add for each item. + */ +- (void) vips_value_get_ref_string( value, &l2 ); ++ (void) vips_value_get_ref_string(value, &l2); + length += l2 + 1; + } + +- if( length == 0 ) +- return( NULL ); ++ if (length == 0) ++ return (NULL); + + /* More than 10MB of history? Madness! + */ +- g_assert( length < 10 * 1024 * 1024 ); ++ g_assert(length < 10 * 1024 * 1024); + + /* +1 for '\0'. + */ +- if( !(all = vips_malloc( NULL, length + 1 )) ) +- return( NULL ); ++ if (!(all = vips_malloc(NULL, length + 1))) ++ return (NULL); + + q = all; +- for( p = list; p; p = p->next ) { ++ for (p = list; p; p = p->next) { + GValue *value = (GValue *) p->data; + size_t l2; + +- strcpy( q, vips_value_get_ref_string( value, &l2 ) ); ++ strcpy(q, vips_value_get_ref_string(value, &l2)); + q += l2; +- strcpy( q, "\n" ); ++ strcpy(q, "\n"); + q += 1; + } + +- g_assert( (size_t) (q - all) == length ); ++ g_assert((size_t) (q - all) == length); + +- return( all ); ++ return (all); + } + + gint64 +-vips__seek_no_error( int fd, gint64 pos, int whence ) ++vips__seek_no_error(int fd, gint64 pos, int whence) + { + gint64 new_pos; + + #ifdef G_OS_WIN32 +- new_pos = _lseeki64( fd, pos, whence ); +-#else /*!G_OS_WIN32*/ +- /* On error, eg. opening a directory and seeking to the end, lseek() ++ new_pos = _lseeki64(fd, pos, whence); ++#else /*!G_OS_WIN32*/ ++ /* On error, eg. opening a directory and seeking to the end, lseek() + * on linux seems to return 9223372036854775807 ((1 << 63) - 1) +- * rather than (off_t) -1 for reasons I don't understand. ++ * rather than (off_t) -1 for reasons I don't understand. + */ +- new_pos = lseek( fd, pos, whence ); ++ new_pos = lseek(fd, pos, whence); + #endif /*G_OS_WIN32*/ + +- return( new_pos ); ++ return (new_pos); + } + + /* Need our own seek(), since lseek() on win32 can't do long files. + */ + gint64 +-vips__seek( int fd, gint64 pos, int whence ) ++vips__seek(int fd, gint64 pos, int whence) + { + gint64 new_pos; + +- if( (new_pos = vips__seek_no_error( fd, pos, whence )) == -1 ) { +- vips_error_system( errno, "vips__seek", +- "%s", _( "unable to seek" ) ); +- return( -1 ); ++ if ((new_pos = vips__seek_no_error(fd, pos, whence)) == -1) { ++ vips_error_system(errno, "vips__seek", ++ "%s", _("unable to seek")); ++ return (-1); + } + +- return( new_pos ); ++ return (new_pos); + } + + /* Need our own ftruncate(), since ftruncate() on win32 can't do long files. +@@ -1107,155 +1107,155 @@ vips__seek( int fd, gint64 pos, int whence ) + + */ + int +-vips__ftruncate( int fd, gint64 pos ) ++vips__ftruncate(int fd, gint64 pos) + { + #ifdef G_OS_WIN32 +-{ +- HANDLE hFile = (HANDLE) _get_osfhandle( fd ); +- +- if( vips__seek( fd, pos, SEEK_SET ) == -1 ) +- return( -1 ); +- if( !SetEndOfFile( hFile ) ) { +- vips_error_system( GetLastError(), "vips__ftruncate", +- "%s", _( "unable to truncate" ) ); +- return( -1 ); ++ { ++ HANDLE hFile = (HANDLE) _get_osfhandle(fd); ++ ++ if (vips__seek(fd, pos, SEEK_SET) == -1) ++ return (-1); ++ if (!SetEndOfFile(hFile)) { ++ vips_error_system(GetLastError(), "vips__ftruncate", ++ "%s", _("unable to truncate")); ++ return (-1); ++ } + } +-} +-#else /*!G_OS_WIN32*/ +- if( ftruncate( fd, pos ) ) { +- vips_error_system( errno, "vips__ftruncate", +- "%s", _( "unable to truncate" ) ); +- return( -1 ); ++#else /*!G_OS_WIN32*/ ++ if (ftruncate(fd, pos)) { ++ vips_error_system(errno, "vips__ftruncate", ++ "%s", _("unable to truncate")); ++ return (-1); + } + #endif /*G_OS_WIN32*/ + +- return( 0 ); ++ return (0); + } + + /* TRUE if file exists. True for directories as well. + */ + gboolean +-vips_existsf( const char *name, ... ) ++vips_existsf(const char *name, ...) + { +- va_list ap; +- char *path; +- gboolean result; ++ va_list ap; ++ char *path; ++ gboolean result; + +- va_start( ap, name ); +- path = g_strdup_vprintf( name, ap ); +- va_end( ap ); ++ va_start(ap, name); ++ path = g_strdup_vprintf(name, ap); ++ va_end(ap); + +- result = g_file_test( path, G_FILE_TEST_EXISTS ); ++ result = g_file_test(path, G_FILE_TEST_EXISTS); + +- g_free( path ); ++ g_free(path); + +- return( result ); ++ return (result); + } + + /* TRUE if file exists and is a directory. + */ + gboolean +-vips_isdirf( const char *name, ... ) ++vips_isdirf(const char *name, ...) + { +- va_list ap; +- char *path; +- gboolean result; ++ va_list ap; ++ char *path; ++ gboolean result; + +- va_start( ap, name ); +- path = g_strdup_vprintf( name, ap ); +- va_end( ap ); ++ va_start(ap, name); ++ path = g_strdup_vprintf(name, ap); ++ va_end(ap); + +- result = g_file_test( path, G_FILE_TEST_IS_DIR ); ++ result = g_file_test(path, G_FILE_TEST_IS_DIR); + +- g_free( path ); ++ g_free(path); + +- return( result ); ++ return (result); + } + + /* Make a directory. + */ + int +-vips_mkdirf( const char *name, ... ) ++vips_mkdirf(const char *name, ...) + { +- va_list ap; +- char *path; +- +- va_start( ap, name ); +- path = g_strdup_vprintf( name, ap ); +- va_end( ap ); +- +- if( g_mkdir( path, 0755 ) ) { +- vips_error( "mkdirf", +- _( "unable to create directory \"%s\", %s" ), +- path, strerror( errno ) ); +- g_free( path ); +- return( -1 ); ++ va_list ap; ++ char *path; ++ ++ va_start(ap, name); ++ path = g_strdup_vprintf(name, ap); ++ va_end(ap); ++ ++ if (g_mkdir(path, 0755)) { ++ vips_error("mkdirf", ++ _("unable to create directory \"%s\", %s"), ++ path, strerror(errno)); ++ g_free(path); ++ return (-1); + } +- g_free( path ); ++ g_free(path); + +- return( 0 ); ++ return (0); + } + + /* Remove a directory. + */ + int +-vips_rmdirf( const char *name, ... ) ++vips_rmdirf(const char *name, ...) + { +- va_list ap; +- char *path; +- +- va_start( ap, name ); +- path = g_strdup_vprintf( name, ap ); +- va_end( ap ); +- +- if( g_rmdir( path ) ) { +- vips_error( "rmdir", +- _( "unable to remove directory \"%s\", %s" ), +- path, strerror( errno ) ); +- g_free( path ); +- return( -1 ); ++ va_list ap; ++ char *path; ++ ++ va_start(ap, name); ++ path = g_strdup_vprintf(name, ap); ++ va_end(ap); ++ ++ if (g_rmdir(path)) { ++ vips_error("rmdir", ++ _("unable to remove directory \"%s\", %s"), ++ path, strerror(errno)); ++ g_free(path); ++ return (-1); + } +- g_free( path ); ++ g_free(path); + +- return( 0 ); ++ return (0); + } + +-/* Rename a file. ++/* Rename a file. + */ + int +-vips_rename( const char *old_name, const char *new_name ) ++vips_rename(const char *old_name, const char *new_name) + { +- if( g_rename( old_name, new_name ) ) { +- vips_error( "rename", +- _( "unable to rename file \"%s\" as \"%s\", %s" ), +- old_name, new_name, strerror( errno ) ); +- return( -1 ); ++ if (g_rename(old_name, new_name)) { ++ vips_error("rename", ++ _("unable to rename file \"%s\" as \"%s\", %s"), ++ old_name, new_name, strerror(errno)); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Chop off any trailing whitespace. + */ + void +-vips__chomp( char *str ) ++vips__chomp(char *str) + { + char *p; + +- for( p = str + strlen( str ); p > str && isspace( p[-1] ); p-- ) ++ for (p = str + strlen(str); p > str && isspace(p[-1]); p--) + p[-1] = '\0'; + } + +-/* Break a command-line argument into tokens separated by whitespace. ++/* Break a command-line argument into tokens separated by whitespace. + * +- * Strings can't be adjacent, so "hello world" (without quotes) is a single ++ * Strings can't be adjacent, so "hello world" (without quotes) is a single + * string. Strings are written (with \" escaped) into @string. If the string +- * is larger than @size, it is silently null-terminated and truncated. ++ * is larger than @size, it is silently null-terminated and truncated. + * + * Return NULL for end of tokens. + */ + const char * +-vips__token_get( const char *p, VipsToken *token, char *string, int size ) ++vips__token_get(const char *p, VipsToken *token, char *string, int size) + { + const char *q; + int ch; +@@ -1264,16 +1264,16 @@ vips__token_get( const char *p, VipsToken *token, char *string, int size ) + + /* Parse this token with p. + */ +- if( !p ) +- return( NULL ); ++ if (!p) ++ return (NULL); + + /* Skip initial whitespace. + */ +- p += strspn( p, " \t\n\r" ); +- if( !p[0] ) +- return( NULL ); ++ p += strspn(p, " \t\n\r"); ++ if (!p[0]) ++ return (NULL); + +- switch( (ch = p[0]) ) { ++ switch ((ch = p[0])) { + case '[': + *token = VIPS_TOKEN_LEFT; + p += 1; +@@ -1305,27 +1305,27 @@ vips__token_get( const char *p, VipsToken *token, char *string, int size ) + /* Number of characters until the next quote + * character or end of string. + */ +- if( (q = strchr( p + 1, ch )) ) ++ if ((q = strchr(p + 1, ch))) + n = q - p + 1; + else +- n = strlen( p + 1 ); ++ n = strlen(p + 1); + + /* How much can we copy to the buffer? + */ +- i = VIPS_MIN( n, size ); +- vips_strncpy( string, p + 1, i ); ++ i = VIPS_MIN(n, size); ++ vips_strncpy(string, p + 1, i); + + /* We might have stopped at an escaped quote. If the +- * string was not truncated, swap the preceding ++ * string was not truncated, swap the preceding + * backslash for a quote. + */ +- if( p[n + 1] == ch && p[n] == '\\' && i == n ) ++ if (p[n + 1] == ch && p[n] == '\\' && i == n) + string[i - 1] = ch; + + string += i; + size -= i; + p += n + 1; +- } while( p[0] && p[-1] == '\\' ); ++ } while (p[0] && p[-1] == '\\'); + + p += 1; + +@@ -1337,18 +1337,18 @@ vips__token_get( const char *p, VipsToken *token, char *string, int size ) + * so the next break must be brackets, equals, comma. + */ + *token = VIPS_TOKEN_STRING; +- q = p + strcspn( p, "[]=," ); ++ q = p + strcspn(p, "[]=,"); + +- i = VIPS_MIN( q - p, size ); +- vips_strncpy( string, p, i + 1 ); ++ i = VIPS_MIN(q - p, size); ++ vips_strncpy(string, p, i + 1); + p = q; + + /* We remove leading whitespace, so we trim trailing + * whitespace from unquoted strings too. Only if the string + * hasn't been truncated. + */ +- if( i != size ) +- while( i > 0 && isspace( string[i - 1] ) ) { ++ if (i != size) ++ while (i > 0 && isspace(string[i - 1])) { + string[i - 1] = '\0'; + i--; + } +@@ -1356,42 +1356,42 @@ vips__token_get( const char *p, VipsToken *token, char *string, int size ) + break; + } + +- return( p ); ++ return (p); + } + + /* We expect a token. + */ + const char * +-vips__token_must( const char *p, VipsToken *token, +- char *string, int size ) ++vips__token_must(const char *p, VipsToken *token, ++ char *string, int size) + { +- if( !(p = vips__token_get( p, token, string, size )) ) { +- vips_error( "get_token", +- "%s", _( "unexpected end of string" ) ); +- return( NULL ); ++ if (!(p = vips__token_get(p, token, string, size))) { ++ vips_error("get_token", ++ "%s", _("unexpected end of string")); ++ return (NULL); + } + +- return( p ); ++ return (p); + } + + /* We expect a certain token. + */ + const char * +-vips__token_need( const char *p, VipsToken need_token, +- char *string, int size ) ++vips__token_need(const char *p, VipsToken need_token, ++ char *string, int size) + { + VipsToken token; + +- if( !(p = vips__token_must( p, &token, string, size )) ) +- return( NULL ); +- if( token != need_token ) { +- vips_error( "get_token", _( "expected %s, saw %s" ), +- vips_enum_nick( VIPS_TYPE_TOKEN, need_token ), +- vips_enum_nick( VIPS_TYPE_TOKEN, token ) ); +- return( NULL ); ++ if (!(p = vips__token_must(p, &token, string, size))) ++ return (NULL); ++ if (token != need_token) { ++ vips_error("get_token", _("expected %s, saw %s"), ++ vips_enum_nick(VIPS_TYPE_TOKEN, need_token), ++ vips_enum_nick(VIPS_TYPE_TOKEN, token)); ++ return (NULL); + } + +- return( p ); ++ return (p); + } + + /* Fetch a token. If it's a string token terminated by a '[', fetch up to the +@@ -1400,30 +1400,30 @@ vips__token_need( const char *p, VipsToken need_token, + * Return NULL for end of tokens. + */ + const char * +-vips__token_segment( const char *p, VipsToken *token, +- char *string, int size ) ++vips__token_segment(const char *p, VipsToken *token, ++ char *string, int size) + { + const char *q; + +- if( !(q = vips__token_must( p, token, string, size )) ) +- return( NULL ); ++ if (!(q = vips__token_must(p, token, string, size))) ++ return (NULL); + +- /* If we stopped on [, read up to the matching ]. ++ /* If we stopped on [, read up to the matching ]. + */ +- if( *token == VIPS_TOKEN_STRING && +- q[0] == '[' ) { ++ if (*token == VIPS_TOKEN_STRING && ++ q[0] == '[') { + VipsToken sub_token; + char sub_string[VIPS_PATH_MAX]; + int depth; +- int i; ++ int i; + + depth = 0; + do { +- if( !(q = vips__token_must( q, &sub_token, +- sub_string, VIPS_PATH_MAX )) ) +- return( NULL ); ++ if (!(q = vips__token_must(q, &sub_token, ++ sub_string, VIPS_PATH_MAX))) ++ return (NULL); + +- switch( sub_token ) { ++ switch (sub_token) { + case VIPS_TOKEN_LEFT: + depth += 1; + break; +@@ -1435,33 +1435,33 @@ vips__token_segment( const char *p, VipsToken *token, + default: + break; + } +- } while( !(sub_token == VIPS_TOKEN_RIGHT && depth == 0) ); ++ } while (!(sub_token == VIPS_TOKEN_RIGHT && depth == 0)); + +- i = VIPS_MIN( q - p, size ); +- vips_strncpy( string, p, i + 1 ); ++ i = VIPS_MIN(q - p, size); ++ vips_strncpy(string, p, i + 1); + } + +- return( q ); ++ return (q); + } + + /* We expect a certain segment. + */ + const char * +-vips__token_segment_need( const char *p, VipsToken need_token, +- char *string, int size ) ++vips__token_segment_need(const char *p, VipsToken need_token, ++ char *string, int size) + { + VipsToken token; + +- if( !(p = vips__token_segment( p, &token, string, size )) ) +- return( NULL ); +- if( token != need_token ) { +- vips_error( "get_token", _( "expected %s, saw %s" ), +- vips_enum_nick( VIPS_TYPE_TOKEN, need_token ), +- vips_enum_nick( VIPS_TYPE_TOKEN, token ) ); +- return( NULL ); ++ if (!(p = vips__token_segment(p, &token, string, size))) ++ return (NULL); ++ if (token != need_token) { ++ vips_error("get_token", _("expected %s, saw %s"), ++ vips_enum_nick(VIPS_TYPE_TOKEN, need_token), ++ vips_enum_nick(VIPS_TYPE_TOKEN, token)); ++ return (NULL); + } + +- return( p ); ++ return (p); + } + + /* Maximum number of tokens we allow in a filename. Surely this will be +@@ -1477,15 +1477,15 @@ vips__token_segment_need( const char *p, VipsToken need_token, + * + * we need to be able to find the fred=12 at the end. + * +- * We lex the whole string noting the position of each token, then, if the ++ * We lex the whole string noting the position of each token, then, if the + * final token is a right-bracket, search left for the matching left-bracket. + * + * This can get confused if the lefts are hidden inside another token :-( But +- * a fixing that would require us to write a separate right-to-left lexer, ++ * a fixing that would require us to write a separate right-to-left lexer, + * argh. + */ + const char * +-vips__find_rightmost_brackets( const char *p ) ++vips__find_rightmost_brackets(const char *p) + { + const char *start[MAX_TOKENS + 1]; + VipsToken tokens[MAX_TOKENS]; +@@ -1494,61 +1494,61 @@ vips__find_rightmost_brackets( const char *p ) + int nest; + + start[0] = p; +- for( n = 0; +- n < MAX_TOKENS && +- (p = vips__token_get( start[n], &tokens[n], +- str, VIPS_PATH_MAX )); +- n++, start[n] = p ) ++ for (n = 0; ++ n < MAX_TOKENS && ++ (p = vips__token_get(start[n], &tokens[n], ++ str, VIPS_PATH_MAX)); ++ n++, start[n] = p) + ; + + /* Too many tokens? + */ +- if( n >= MAX_TOKENS ) +- return( NULL ); ++ if (n >= MAX_TOKENS) ++ return (NULL); + + /* No rightmost close bracket? + */ +- if( n == 0 || +- tokens[n - 1] != VIPS_TOKEN_RIGHT ) +- return( NULL ); ++ if (n == 0 || ++ tokens[n - 1] != VIPS_TOKEN_RIGHT) ++ return (NULL); + + nest = 0; +- for( i = n - 1; i >= 0; i-- ) { +- if( tokens[i] == VIPS_TOKEN_RIGHT ) ++ for (i = n - 1; i >= 0; i--) { ++ if (tokens[i] == VIPS_TOKEN_RIGHT) + nest += 1; +- else if( tokens[i] == VIPS_TOKEN_LEFT ) ++ else if (tokens[i] == VIPS_TOKEN_LEFT) + nest -= 1; + +- if( nest == 0 ) ++ if (nest == 0) + break; + } + + /* No matching left bracket? + */ +- if( nest != 0 ) +- return( NULL ); ++ if (nest != 0) ++ return (NULL); + + /* This should be the matching left. + */ +- return( start[i] ); ++ return (start[i]); + } + + /* Split a vips8-style filename + options. + * +- * filename and option_string must be VIPS_PATH_MAX in length. ++ * filename and option_string must be VIPS_PATH_MAX in length. + */ + void +-vips__filename_split8( const char *name, char *filename, char *option_string ) ++vips__filename_split8(const char *name, char *filename, char *option_string) + { + char *p; + +- vips_strncpy( filename, name, VIPS_PATH_MAX ); +- if( (p = (char *) vips__find_rightmost_brackets( filename )) ) { +- vips_strncpy( option_string, p, VIPS_PATH_MAX ); ++ vips_strncpy(filename, name, VIPS_PATH_MAX); ++ if ((p = (char *) vips__find_rightmost_brackets(filename))) { ++ vips_strncpy(option_string, p, VIPS_PATH_MAX); + *p = '\0'; + } + else +- vips_strncpy( option_string, "", VIPS_PATH_MAX ); ++ vips_strncpy(option_string, "", VIPS_PATH_MAX); + } + + /* True if an int is a power of two ... 1, 2, 4, 8, 16, 32, etc. Do with just +@@ -1558,73 +1558,73 @@ vips__filename_split8( const char *name, char *filename, char *option_string ) + * bit 1 as the lsb). + */ + int +-vips_ispoweroftwo( int p ) ++vips_ispoweroftwo(int p) + { + int i, n; + + /* Count set bits. Could use a LUT, I guess. + */ +- for( i = 0, n = 0; p; i++, p >>= 1 ) +- if( p & 1 ) ++ for (i = 0, n = 0; p; i++, p >>= 1) ++ if (p & 1) + n++; + + /* Should be just one set bit. + */ +- if( n == 1 ) ++ if (n == 1) + /* Return position of bit. + */ +- return( i ); ++ return (i); + else +- return( 0 ); ++ return (0); + } + + /* Test this processor for endianness. True for SPARC order. + */ + int +-vips_amiMSBfirst( void ) ++vips_amiMSBfirst(void) + { + #if G_BYTE_ORDER == G_BIG_ENDIAN +- return( 1 ); ++ return (1); + #elif G_BYTE_ORDER == G_LITTLE_ENDIAN +- return( 0 ); ++ return (0); + #else + #error "Byte order not recognised" + #endif + } + +-/* Return the tmp dir. On Windows, GetTempPath() will also check the values of ++/* Return the tmp dir. On Windows, GetTempPath() will also check the values of + * TMP, TEMP and USERPROFILE. + */ + static const char * +-vips__temp_dir( void ) ++vips__temp_dir(void) + { + const char *tmpd; + +- if( !(tmpd = g_getenv( "TMPDIR" )) ) { ++ if (!(tmpd = g_getenv("TMPDIR"))) { + #ifdef G_OS_WIN32 + static gboolean done = FALSE; + static char buf[256]; + +- if( !done ) { +- if( !GetTempPath( 256, buf ) ) +- strcpy( buf, "C:\\temp" ); ++ if (!done) { ++ if (!GetTempPath(256, buf)) ++ strcpy(buf, "C:\\temp"); + } + tmpd = buf; +-#else /*!G_OS_WIN32*/ ++#else /*!G_OS_WIN32*/ + tmpd = "/tmp"; + #endif /*!G_OS_WIN32*/ + } + +- return( tmpd ); ++ return (tmpd); + } + +-/* Make a temporary file name. The format parameter is something like "%s.jpg" ++/* Make a temporary file name. The format parameter is something like "%s.jpg" + * and will be expanded to something like "/tmp/vips-12-34587.jpg". + * +- * You need to free the result. ++ * You need to free the result. + */ + char * +-vips__temp_name( const char *format ) ++vips__temp_name(const char *format) + { + static int global_serial = 0; + +@@ -1632,62 +1632,62 @@ vips__temp_name( const char *format ) + char file2[FILENAME_MAX]; + char *name; + +- int serial = g_atomic_int_add( &global_serial, 1 ); ++ int serial = g_atomic_int_add(&global_serial, 1); + +- vips_snprintf( file, FILENAME_MAX, "vips-%d-%u", +- serial, g_random_int() ); +- vips_snprintf( file2, FILENAME_MAX, format, file ); +- name = g_build_filename( vips__temp_dir(), file2, NULL ); ++ vips_snprintf(file, FILENAME_MAX, "vips-%d-%u", ++ serial, g_random_int()); ++ vips_snprintf(file2, FILENAME_MAX, format, file); ++ name = g_build_filename(vips__temp_dir(), file2, NULL); + + /* We could use something like g_mkstemp() to guarantee uniqueness +- * across processes, but the extra FS calls can be difficult for ++ * across processes, but the extra FS calls can be difficult for + * selinux. + * + * g_random_int() should be safe enough -- it's seeded from time(), so +- * it ought not to collide often -- and on linux at least we never ++ * it ought not to collide often -- and on linux at least we never + * actually use these filenames in the filesystem anyway. + */ + +- return( name ); ++ return (name); + } + +-/* Strip off any of a set of old suffixes (eg. [".v", ".jpg"]), add a single +- * new suffix (eg. ".tif"). ++/* Strip off any of a set of old suffixes (eg. [".v", ".jpg"]), add a single ++ * new suffix (eg. ".tif"). + */ + void +-vips__change_suffix( const char *name, char *out, int mx, +- const char *new, const char **olds, int nolds ) ++vips__change_suffix(const char *name, char *out, int mx, ++ const char *new, const char **olds, int nolds) + { +- char *p; +- int i; ++ char *p; ++ int i; + int len; + +- /* Copy start string. +- */ +- vips_strncpy( out, name, mx ); +- +- /* Drop all matching suffixes. +- */ +- while( (p = strrchr( out, '.' )) ) { +- /* Found suffix - test against list of alternatives. Ignore +- * case. +- */ +- for( i = 0; i < nolds; i++ ) +- if( g_ascii_strcasecmp( p, olds[i] ) == 0 ) { +- *p = '\0'; +- break; +- } +- +- /* Found match? If not, break from loop. +- */ +- if( *p ) +- break; +- } +- +- /* Add new suffix. +- */ +- len = strlen( out ); +- vips_strncpy( out + len, new, mx - len ); ++ /* Copy start string. ++ */ ++ vips_strncpy(out, name, mx); ++ ++ /* Drop all matching suffixes. ++ */ ++ while ((p = strrchr(out, '.'))) { ++ /* Found suffix - test against list of alternatives. Ignore ++ * case. ++ */ ++ for (i = 0; i < nolds; i++) ++ if (g_ascii_strcasecmp(p, olds[i]) == 0) { ++ *p = '\0'; ++ break; ++ } ++ ++ /* Found match? If not, break from loop. ++ */ ++ if (*p) ++ break; ++ } ++ ++ /* Add new suffix. ++ */ ++ len = strlen(out); ++ vips_strncpy(out + len, new, mx - len); + } + + typedef struct { +@@ -1696,7 +1696,7 @@ typedef struct { + } Unit; + + guint64 +-vips__parse_size( const char *size_string ) ++vips__parse_size(const char *size_string) + { + static Unit units[] = { + { 'k', 1024 }, +@@ -1711,130 +1711,130 @@ vips__parse_size( const char *size_string ) + + /* An easy way to alloc a buffer large enough. + */ +- unit = g_strdup( size_string ); +- n = sscanf( size_string, "%d %s", &i, unit ); ++ unit = g_strdup(size_string); ++ n = sscanf(size_string, "%d %s", &i, unit); + size = i; +- if( n > 1 ) { ++ if (n > 1) { + int j; + +- for( j = 0; j < VIPS_NUMBER( units ); j++ ) +- if( tolower( unit[0] ) == units[j].unit ) { ++ for (j = 0; j < VIPS_NUMBER(units); j++) ++ if (tolower(unit[0]) == units[j].unit) { + size *= units[j].multiplier; + break; + } + } +- g_free( unit ); ++ g_free(unit); + +- VIPS_DEBUG_MSG( "parse_size: parsed \"%s\" as %" G_GUINT64_FORMAT "\n", +- size_string, size ); ++ VIPS_DEBUG_MSG("parse_size: parsed \"%s\" as %" G_GUINT64_FORMAT "\n", ++ size_string, size); + +- return( size ); ++ return (size); + } + + /* Look up the const char * for an enum value. + */ + const char * +-vips_enum_string( GType enm, int v ) ++vips_enum_string(GType enm, int v) + { + GEnumValue *value; + +- if( !(value = g_enum_get_value( g_type_class_ref( enm ), v )) ) +- return( "(null)" ); ++ if (!(value = g_enum_get_value(g_type_class_ref(enm), v))) ++ return ("(null)"); + +- return( value->value_name ); ++ return (value->value_name); + } + + const char * +-vips_enum_nick( GType enm, int v ) ++vips_enum_nick(GType enm, int v) + { + GEnumValue *value; + +- if( !(value = g_enum_get_value( g_type_class_ref( enm ), v )) ) +- return( "(null)" ); ++ if (!(value = g_enum_get_value(g_type_class_ref(enm), v))) ++ return ("(null)"); + +- return( value->value_nick ); ++ return (value->value_nick); + } + + int +-vips_enum_from_nick( const char *domain, GType type, const char *nick ) ++vips_enum_from_nick(const char *domain, GType type, const char *nick) + { + GTypeClass *class; + GEnumClass *genum; + GEnumValue *enum_value; + int i; + char str[1000]; +- VipsBuf buf = VIPS_BUF_STATIC( str ); ++ VipsBuf buf = VIPS_BUF_STATIC(str); + +- if( !(class = g_type_class_ref( type )) ) { +- vips_error( domain, "%s", _( "no such enum type" ) ); +- return( -1 ); ++ if (!(class = g_type_class_ref(type))) { ++ vips_error(domain, "%s", _("no such enum type")); ++ return (-1); + } +- genum = G_ENUM_CLASS( class ); ++ genum = G_ENUM_CLASS(class); + +- if( (enum_value = g_enum_get_value_by_name( genum, nick )) ) +- return( enum_value->value ); +- if( (enum_value = g_enum_get_value_by_nick( genum, nick )) ) +- return( enum_value->value ); ++ if ((enum_value = g_enum_get_value_by_name(genum, nick))) ++ return (enum_value->value); ++ if ((enum_value = g_enum_get_value_by_nick(genum, nick))) ++ return (enum_value->value); + + /* -1 since we always have a "last" member. + */ +- for( i = 0; i < genum->n_values - 1; i++ ) { +- if( i > 0 ) +- vips_buf_appends( &buf, ", " ); +- vips_buf_appends( &buf, genum->values[i].value_nick ); ++ for (i = 0; i < genum->n_values - 1; i++) { ++ if (i > 0) ++ vips_buf_appends(&buf, ", "); ++ vips_buf_appends(&buf, genum->values[i].value_nick); + } + +- vips_error( domain, _( "enum '%s' has no member '%s', " +- "should be one of: %s" ), +- g_type_name( type ), nick, vips_buf_all( &buf ) ); ++ vips_error(domain, _("enum '%s' has no member '%s', " ++ "should be one of: %s"), ++ g_type_name(type), nick, vips_buf_all(&buf)); + +- return( -1 ); ++ return (-1); + } + + int +-vips_flags_from_nick( const char *domain, GType type, const char *nick ) ++vips_flags_from_nick(const char *domain, GType type, const char *nick) + { + GTypeClass *class; + GFlagsClass *gflags; + GFlagsValue *flags_value; + int i; + char str[1000]; +- VipsBuf buf = VIPS_BUF_STATIC( str ); ++ VipsBuf buf = VIPS_BUF_STATIC(str); + +- if( !(class = g_type_class_ref( type )) ) { +- vips_error( domain, "%s", _( "no such flag type" ) ); +- return( -1 ); ++ if (!(class = g_type_class_ref(type))) { ++ vips_error(domain, "%s", _("no such flag type")); ++ return (-1); + } +- gflags = G_FLAGS_CLASS( class ); ++ gflags = G_FLAGS_CLASS(class); + +- if( (flags_value = g_flags_get_value_by_name( gflags, nick )) ) +- return( flags_value->value ); +- if( (flags_value = g_flags_get_value_by_nick( gflags, nick )) ) +- return( flags_value->value ); ++ if ((flags_value = g_flags_get_value_by_name(gflags, nick))) ++ return (flags_value->value); ++ if ((flags_value = g_flags_get_value_by_nick(gflags, nick))) ++ return (flags_value->value); + +- for( i = 0; i < gflags->n_values; i++ ) { +- if( i > 0 ) +- vips_buf_appends( &buf, ", " ); +- vips_buf_appends( &buf, gflags->values[i].value_nick ); ++ for (i = 0; i < gflags->n_values; i++) { ++ if (i > 0) ++ vips_buf_appends(&buf, ", "); ++ vips_buf_appends(&buf, gflags->values[i].value_nick); + } + +- vips_error( domain, _( "flags '%s' has no member '%s', " +- "should be one of: %s" ), +- g_type_name( type ), nick, vips_buf_all( &buf ) ); ++ vips_error(domain, _("flags '%s' has no member '%s', " ++ "should be one of: %s"), ++ g_type_name(type), nick, vips_buf_all(&buf)); + +- return( -1 ); ++ return (-1); + } + +-/* Scan @buf for the first "%ns" (eg. "%12s") and substitute the ++/* Scan @buf for the first "%ns" (eg. "%12s") and substitute the + * lowest-numbered one for @sub. @buf is @len bytes in size. + * + * If there are no %ns, use the first %s. + */ + int +-vips__substitute( char *buf, size_t len, char *sub ) ++vips__substitute(char *buf, size_t len, char *sub) + { +- size_t buflen = strlen( buf ); +- size_t sublen = strlen( sub ); ++ size_t buflen = strlen(buf); ++ size_t sublen = strlen(sub); + + int lowest_n; + char *sub_start; +@@ -1842,23 +1842,23 @@ vips__substitute( char *buf, size_t len, char *sub ) + char *sub_end; + size_t before_len, marker_len, after_len, final_len; + +- g_assert( buflen < len ); ++ g_assert(buflen < len); + + lowest_n = -1; + sub_start = NULL; + sub_end = NULL; +- for( p = buf; (p = strchr( p, '%' )); p++ ) +- if( isdigit( p[1] ) ) { ++ for (p = buf; (p = strchr(p, '%')); p++) ++ if (isdigit(p[1])) { + char *q; + +- for( q = p + 1; isdigit( *q ); q++ ) ++ for (q = p + 1; isdigit(*q); q++) + ; +- if( q[0] == 's' ) { ++ if (q[0] == 's') { + int n; + +- n = atoi( p + 1 ); +- if( lowest_n == -1 || +- n < lowest_n ) { ++ n = atoi(p + 1); ++ if (lowest_n == -1 || ++ n < lowest_n) { + lowest_n = n; + sub_start = p; + sub_end = q + 1; +@@ -1866,35 +1866,35 @@ vips__substitute( char *buf, size_t len, char *sub ) + } + } + +- if( !sub_start ) +- for( p = buf; (p = strchr( p, '%' )); p++ ) +- if( p[1] == 's' ) { ++ if (!sub_start) ++ for (p = buf; (p = strchr(p, '%')); p++) ++ if (p[1] == 's') { + sub_start = p; + sub_end = p + 2; + break; + } + +- if( !sub_start ) +- return( -1 ); ++ if (!sub_start) ++ return (-1); + + before_len = sub_start - buf; + marker_len = sub_end - sub_start; + after_len = buflen - (before_len + marker_len); + final_len = before_len + sublen + after_len + 1; +- if( final_len > len ) +- return( -1 ); ++ if (final_len > len) ++ return (-1); + +- memmove( buf + before_len + sublen, buf + before_len + marker_len, +- after_len + 1 ); +- memmove( buf + before_len, sub, sublen ); ++ memmove(buf + before_len + sublen, buf + before_len + marker_len, ++ after_len + 1); ++ memmove(buf + before_len, sub, sublen); + +- return( 0 ); ++ return (0); + } + + /* Absoluteize a path. Free the result with g_free(). + */ + char * +-vips_realpath( const char *path ) ++vips_realpath(const char *path) + { + char *real; + +@@ -1902,174 +1902,174 @@ vips_realpath( const char *path ) + * linux systems with grsec, since it works by opening /proc/self/fd. + */ + +- if( !g_path_is_absolute( path ) ) { ++ if (!g_path_is_absolute(path)) { + char *cwd; + + cwd = g_get_current_dir(); +- real = g_build_filename( cwd, path, NULL ); +- g_free( cwd ); ++ real = g_build_filename(cwd, path, NULL); ++ g_free(cwd); + } + else +- real = g_strdup( path ); ++ real = g_strdup(path); + +- return( real ); ++ return (real); + } + + /* A very simple random number generator. See: + * http://isthe.com/chongo/tech/comp/fnv/#FNV-source + */ +-guint32 +-vips__random_add( guint32 hash, int value ) ++guint32 ++vips__random_add(guint32 hash, int value) + { +-#define FNV_ADD( HASH, VALUE8 ) (((HASH) ^ (VALUE8)) * 16777619u) ++#define FNV_ADD(HASH, VALUE8) (((HASH) ^ (VALUE8)) * 16777619u) + +- hash = FNV_ADD( hash, value & 0xff ); +- hash = FNV_ADD( hash, (value >> 8) & 0xff ); +- hash = FNV_ADD( hash, (value >> 16) & 0xff ); +- hash = FNV_ADD( hash, (value >> 24) & 0xff ); ++ hash = FNV_ADD(hash, value & 0xff); ++ hash = FNV_ADD(hash, (value >> 8) & 0xff); ++ hash = FNV_ADD(hash, (value >> 16) & 0xff); ++ hash = FNV_ADD(hash, (value >> 24) & 0xff); + +- return( hash ); ++ return (hash); + } + + guint32 +-vips__random( guint32 seed ) ++vips__random(guint32 seed) + { + guint32 hash; + + hash = 2166136261u; +- hash = vips__random_add( hash, seed ); ++ hash = vips__random_add(hash, seed); + +- return( hash ); ++ return (hash); + } + + static void * +-vips_icc_dir_once( void *null ) ++vips_icc_dir_once(void *null) + { + #ifdef G_OS_WIN32 + /* From glib get_windows_directory_root() + */ + wchar_t wwindowsdir[MAX_PATH]; + +- if( GetWindowsDirectoryW( wwindowsdir, G_N_ELEMENTS( wwindowsdir ) ) ) { ++ if (GetWindowsDirectoryW(wwindowsdir, G_N_ELEMENTS(wwindowsdir))) { + /* Usually X:\Windows, but in terminal server environments + * might be an UNC path, AFAIK. + */ + char *windowsdir; + +- if( (windowsdir = g_utf16_to_utf8( wwindowsdir, +- -1, NULL, NULL, NULL)) ) { ++ if ((windowsdir = g_utf16_to_utf8(wwindowsdir, ++ -1, NULL, NULL, NULL))) { + gchar *full_path; + +- full_path = g_build_filename( windowsdir, +- "system32", "spool", "drivers", "color", NULL ); +- g_free( windowsdir ); ++ full_path = g_build_filename(windowsdir, ++ "system32", "spool", "drivers", "color", NULL); ++ g_free(windowsdir); + +- return( (void *) full_path ); ++ return ((void *) full_path); + } + } + #endif /*G_OS_WIN32*/ + +- return( (void *) VIPS_ICC_DIR ); ++ return ((void *) VIPS_ICC_DIR); + } + + const char * +-vips__icc_dir( void ) ++vips__icc_dir(void) + { + static GOnce once = G_ONCE_INIT; + +- return( (const char *) g_once( &once, +- vips_icc_dir_once, NULL ) ); ++ return ((const char *) g_once(&once, ++ vips_icc_dir_once, NULL)); + } + + #ifdef G_OS_WIN32 + static HMODULE vips__dll = NULL; + #ifdef DLL_EXPORT + BOOL WINAPI +-DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) ++DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) + { +- if( fdwReason == DLL_PROCESS_ATTACH ) ++ if (fdwReason == DLL_PROCESS_ATTACH) + vips__dll = hinstDLL; + +- return( TRUE ); ++ return (TRUE); + } + #endif + #endif /*G_OS_WIN32*/ + + static void * +-vips__windows_prefix_once( void *null ) ++vips__windows_prefix_once(void *null) + { + char *prefix; + + #ifdef G_OS_WIN32 +- prefix = g_win32_get_package_installation_directory_of_module( +- vips__dll ); +-#else /*!G_OS_WIN32*/ +- prefix = (char *) g_getenv( "VIPSHOME" ); ++ prefix = g_win32_get_package_installation_directory_of_module( ++ vips__dll); ++#else /*!G_OS_WIN32*/ ++ prefix = (char *) g_getenv("VIPSHOME"); + #endif /*G_OS_WIN32*/ + +- return( (void *) prefix ); ++ return ((void *) prefix); + } + + const char * +-vips__windows_prefix( void ) ++vips__windows_prefix(void) + { + static GOnce once = G_ONCE_INIT; + +- return( (const char *) g_once( &once, +- vips__windows_prefix_once, NULL ) ); ++ return ((const char *) g_once(&once, ++ vips__windows_prefix_once, NULL)); + } + + char * +-vips__get_iso8601( void ) ++vips__get_iso8601(void) + { + char *date; + +-#if GLIB_CHECK_VERSION( 2, 62, 0 ) +-{ +- GDateTime *now; ++#if GLIB_CHECK_VERSION(2, 62, 0) ++ { ++ GDateTime *now; + +- now = g_date_time_new_now_local(); +- date = g_date_time_format_iso8601( now ); +- g_date_time_unref( now ); +-} +-#else /*!GLIB_CHECK_VERSION( 2, 62, 0 )*/ +-{ +- GTimeVal now; ++ now = g_date_time_new_now_local(); ++ date = g_date_time_format_iso8601(now); ++ g_date_time_unref(now); ++ } ++#else /*!GLIB_CHECK_VERSION( 2, 62, 0 )*/ ++ { ++ GTimeVal now; + +- g_get_current_time( &now ); +- date = g_time_val_to_iso8601( &now ); +-} ++ g_get_current_time(&now); ++ date = g_time_val_to_iso8601(&now); ++ } + #endif /*GLIB_CHECK_VERSION( 2, 62, 0 )*/ + +- return( date ); ++ return (date); + } + + /* Convert a string to a double in the ASCII locale (ie. decimal point is + * "."). + */ + int +-vips_strtod( const char *str, double *out ) ++vips_strtod(const char *str, double *out) + { + const char *p; + + *out = 0; + +- /* The str we fetched must contain at least 1 digit. This +- * helps stop us trying to convert "MATLAB" (for example) to ++ /* The str we fetched must contain at least 1 digit. This ++ * helps stop us trying to convert "MATLAB" (for example) to + * a number and getting zero. + */ +- for( p = str; *p; p++ ) +- if( isdigit( *p ) ) ++ for (p = str; *p; p++) ++ if (isdigit(*p)) + break; +- if( !*p ) +- return( -1 ); ++ if (!*p) ++ return (-1); + + /* This will fail for out of range numbers, like 1e343434, but + * is quite happy with eg. "banana". + */ +- *out = g_ascii_strtod( str, NULL ); +- if( errno ) +- return( -1 ); ++ *out = g_ascii_strtod(str, NULL); ++ if (errno) ++ return (-1); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/iofuncs/vector.c b/libvips/iofuncs/vector.c +index 00d7222c00..60fd3cd25c 100644 +--- a/libvips/iofuncs/vector.c ++++ b/libvips/iofuncs/vector.c +@@ -6,34 +6,34 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +-/* ++/* + +- TODO ++ TODO + + - would setting params by index rather than name be any quicker? + +@@ -70,23 +70,23 @@ + gboolean vips__vector_enabled = TRUE; + + static void +-vips_vector_error( VipsVector *vector ) ++vips_vector_error(VipsVector *vector) + { + #ifdef HAVE_ORC + #ifdef HAVE_ORC_PROGRAM_GET_ERROR +- if( vector->program ) +- g_warning( "orc error: %s", +- orc_program_get_error( vector->program ) ); ++ if (vector->program) ++ g_warning("orc error: %s", ++ orc_program_get_error(vector->program)); + #endif /*HAVE_ORC_PROGRAM_GET_ERROR*/ + #endif /*HAVE_ORC*/ + } + +-void +-vips_vector_init( void ) ++void ++vips_vector_init(void) + { + #ifdef HAVE_ORC + #ifdef DEBUG_TRACE +- printf( "orc_init();\n" ); ++ printf("orc_init();\n"); + #endif /*DEBUG_TRACE*/ + orc_init(); + +@@ -94,17 +94,17 @@ vips_vector_init( void ) + /* You can also do ORC_DEBUG=99 at the command-line. + */ + #ifdef DEBUG_TRACE +- printf( "orc_debug_set_level( 99 );\n" ); ++ printf("orc_debug_set_level( 99 );\n"); + #endif /*DEBUG_TRACE*/ +- orc_debug_set_level( 99 ); ++ orc_debug_set_level(99); + #endif /*DEBUG_ORC*/ + + /* Look for the environment variable VIPS_NOVECTOR and use that to turn + * off as well. + */ +- if( g_getenv( "VIPS_NOVECTOR" ) ++ if (g_getenv("VIPS_NOVECTOR") + #if ENABLE_DEPRECATED +- || g_getenv( "IM_NOVECTOR" ) ++ || g_getenv("IM_NOVECTOR") + #endif + ) + vips__vector_enabled = FALSE; +@@ -112,28 +112,28 @@ vips_vector_init( void ) + #endif /*HAVE_ORC*/ + } + +-gboolean +-vips_vector_isenabled( void ) ++gboolean ++vips_vector_isenabled(void) + { + #ifdef HAVE_ORC +- return( vips__vector_enabled ); +-#else /*!HAVE_ORC*/ +- return( FALSE ); ++ return (vips__vector_enabled); ++#else /*!HAVE_ORC*/ ++ return (FALSE); + #endif /*HAVE_ORC*/ + } + +-void +-vips_vector_set_enabled( gboolean enabled ) ++void ++vips_vector_set_enabled(gboolean enabled) + { + vips__vector_enabled = enabled; + } + + void +-vips_vector_free( VipsVector *vector ) ++vips_vector_free(VipsVector *vector) + { + #ifdef HAVE_ORC + /* orc-0.4.19 will crash if you free programs. Update your orc, or +- * comment out this line. ++ * comment out this line. + * + * See https://bugzilla.gnome.org/show_bug.cgi?id=731227 + * +@@ -141,27 +141,27 @@ vips_vector_free( VipsVector *vector ) + * free automatically. + */ + #ifdef DEBUG_TRACE +- printf( "orc_program_free( %s );\n", vector->unique_name ); +- printf( "%s = NULL;\n", vector->unique_name ); ++ printf("orc_program_free( %s );\n", vector->unique_name); ++ printf("%s = NULL;\n", vector->unique_name); + #endif /*DEBUG_TRACE*/ +- VIPS_FREEF( orc_program_free, vector->program ); ++ VIPS_FREEF(orc_program_free, vector->program); + #endif /*HAVE_ORC*/ +- VIPS_FREE( vector->unique_name ); +- VIPS_FREE( vector ); ++ VIPS_FREE(vector->unique_name); ++ VIPS_FREE(vector); + } + + VipsVector * +-vips_vector_new( const char *name, int dsize ) ++vips_vector_new(const char *name, int dsize) + { + static int vector_number = 0; + + VipsVector *vector; + int i; + +- if( !(vector = VIPS_NEW( NULL, VipsVector )) ) +- return( NULL ); ++ if (!(vector = VIPS_NEW(NULL, VipsVector))) ++ return (NULL); + vector->name = name; +- vector->unique_name = g_strdup_printf( "p[%d]", vector_number++ ); ++ vector->unique_name = g_strdup_printf("p[%d]", vector_number++); + vector->n_temp = 0; + vector->n_scanline = 0; + vector->n_source = 0; +@@ -170,7 +170,7 @@ vips_vector_new( const char *name, int dsize ) + vector->n_parameter = 0; + vector->n_instruction = 0; + +- for( i = 0; i < VIPS_VECTOR_SOURCE_MAX; i++ ) { ++ for (i = 0; i < VIPS_VECTOR_SOURCE_MAX; i++) { + vector->s[i] = -1; + vector->sl[i] = -1; + } +@@ -182,7 +182,7 @@ vips_vector_new( const char *name, int dsize ) + #ifdef HAVE_ORC + vector->program = orc_program_new(); + #ifdef DEBUG_TRACE +- printf( "%s = orc_program_new();\n", vector->unique_name ); ++ printf("%s = orc_program_new();\n", vector->unique_name); + #endif /*DEBUG_TRACE*/ + #endif /*HAVE_ORC*/ + +@@ -191,106 +191,106 @@ vips_vector_new( const char *name, int dsize ) + * + * Don't check error return. orc uses 0 to mean error, but the first + * var you create will have id 0 :-( The first var is unlikely to fail +- * anyway. ++ * anyway. + */ +- vector->d1 = vips_vector_destination( vector, "d1", dsize ); ++ vector->d1 = vips_vector_destination(vector, "d1", dsize); + +- return( vector ); ++ return (vector); + } + +-void +-vips_vector_asm2( VipsVector *vector, +- const char *op, const char *a, const char *b ) ++void ++vips_vector_asm2(VipsVector *vector, ++ const char *op, const char *a, const char *b) + { + vector->n_instruction += 1; + + #ifdef DEBUG +- printf( " %s %s %s\n", op, a, b ); ++ printf(" %s %s %s\n", op, a, b); + #endif /*DEBUG*/ + + #ifdef HAVE_ORC + #ifdef DEBUG_TRACE +- printf( "orc_program_append_ds_str( %s, \"%s\", \"%s\", \"%s\" );\n", +- vector->unique_name, op, a, b ); ++ printf("orc_program_append_ds_str( %s, \"%s\", \"%s\", \"%s\" );\n", ++ vector->unique_name, op, a, b); + #endif /*DEBUG_TRACE*/ +- orc_program_append_ds_str( vector->program, op, a, b ); ++ orc_program_append_ds_str(vector->program, op, a, b); + #endif /*HAVE_ORC*/ + } + +-void +-vips_vector_asm3( VipsVector *vector, +- const char *op, const char *a, const char *b, const char *c ) ++void ++vips_vector_asm3(VipsVector *vector, ++ const char *op, const char *a, const char *b, const char *c) + { + vector->n_instruction += 1; + + #ifdef DEBUG +- printf( " %s %s %s %s\n", op, a, b, c ); ++ printf(" %s %s %s %s\n", op, a, b, c); + #endif /*DEBUG*/ + + #ifdef HAVE_ORC + #ifdef DEBUG_TRACE +- printf( "orc_program_append_str( %s, \"%s\", " +- "\"%s\", \"%s\", \"%s\" );\n", +- vector->unique_name, op, a, b, c ); ++ printf("orc_program_append_str( %s, \"%s\", " ++ "\"%s\", \"%s\", \"%s\" );\n", ++ vector->unique_name, op, a, b, c); + #endif /*DEBUG_TRACE*/ +- orc_program_append_str( vector->program, op, a, b, c ); ++ orc_program_append_str(vector->program, op, a, b, c); + #endif /*HAVE_ORC*/ + } + + void +-vips_vector_constant( VipsVector *vector, char *name, int value, int size ) ++vips_vector_constant(VipsVector *vector, char *name, int value, int size) + { + #ifdef HAVE_ORC + char *sname; + +- if( size == 1 ) ++ if (size == 1) + sname = "b"; +- else if( size == 2 ) ++ else if (size == 2) + sname = "w"; +- else if( size == 4 ) ++ else if (size == 4) + sname = "l"; + else { +- printf( "vips_vector_constant: bad constant size\n" ); ++ printf("vips_vector_constant: bad constant size\n"); + + /* Not really correct, heh. + */ + sname = "x"; + } + +- if( value > 0 ) +- vips_snprintf( name, 256, "c%d%s", value, sname ); ++ if (value > 0) ++ vips_snprintf(name, 256, "c%d%s", value, sname); + else +- vips_snprintf( name, 256, "cm%d%s", -value, sname ); ++ vips_snprintf(name, 256, "cm%d%s", -value, sname); + +- if( orc_program_find_var_by_name( vector->program, name ) == -1 ) { ++ if (orc_program_find_var_by_name(vector->program, name) == -1) { + #ifdef DEBUG_TRACE +- printf( "orc_program_add_constant( %s, %d, %d, \"%s\" );\n", +- vector->unique_name, size, value, name ); ++ printf("orc_program_add_constant( %s, %d, %d, \"%s\" );\n", ++ vector->unique_name, size, value, name); + #endif /*DEBUG_TRACE*/ +- if( !orc_program_add_constant( vector->program, +- size, value, name ) ) +- vips_vector_error( vector ); ++ if (!orc_program_add_constant(vector->program, ++ size, value, name)) ++ vips_vector_error(vector); + vector->n_constant += 1; + } + #endif /*HAVE_ORC*/ + } + + void +-vips_vector_source_scanline( VipsVector *vector, +- char *name, int line, int size ) ++vips_vector_source_scanline(VipsVector *vector, ++ char *name, int line, int size) + { + #ifdef HAVE_ORC +- vips_snprintf( name, 256, "sl%d", line ); ++ vips_snprintf(name, 256, "sl%d", line); + +- if( orc_program_find_var_by_name( vector->program, name ) == -1 ) { ++ if (orc_program_find_var_by_name(vector->program, name) == -1) { + int var; + +- if( !(var = orc_program_add_source( vector->program, +- size, name )) ) +- vips_vector_error( vector ); ++ if (!(var = orc_program_add_source(vector->program, ++ size, name))) ++ vips_vector_error(vector); + #ifdef DEBUG_TRACE +- printf( "orc_program_add_source( %s, %d, \"%s\" );\n", +- vector->unique_name, size, name ); ++ printf("orc_program_add_source( %s, %d, \"%s\" );\n", ++ vector->unique_name, size, name); + #endif /*DEBUG_TRACE*/ + vector->sl[vector->n_scanline] = var; + vector->line[vector->n_scanline] = line; +@@ -300,92 +300,92 @@ vips_vector_source_scanline( VipsVector *vector, + } + + int +-vips_vector_source_name( VipsVector *vector, const char *name, int size ) ++vips_vector_source_name(VipsVector *vector, const char *name, int size) + { + int var; + + #ifdef HAVE_ORC +- g_assert( orc_program_find_var_by_name( vector->program, name ) == -1 ); ++ g_assert(orc_program_find_var_by_name(vector->program, name) == -1); + +- if( !(var = orc_program_add_source( vector->program, size, name )) ) +- vips_vector_error( vector ); ++ if (!(var = orc_program_add_source(vector->program, size, name))) ++ vips_vector_error(vector); + vector->s[vector->n_source] = var; + #ifdef DEBUG_TRACE +- printf( "orc_program_add_source( %s, %d, \"%s\" );\n", +- vector->unique_name, size, name ); ++ printf("orc_program_add_source( %s, %d, \"%s\" );\n", ++ vector->unique_name, size, name); + #endif /*DEBUG_TRACE*/ + vector->n_source += 1; +-#else /*!HAVE_ORC*/ ++#else /*!HAVE_ORC*/ + var = -1; + #endif /*HAVE_ORC*/ + +- return( var ); ++ return (var); + } + + void +-vips_vector_temporary( VipsVector *vector, const char *name, int size ) ++vips_vector_temporary(VipsVector *vector, const char *name, int size) + { + #ifdef HAVE_ORC +- g_assert( orc_program_find_var_by_name( vector->program, name ) == -1 ); ++ g_assert(orc_program_find_var_by_name(vector->program, name) == -1); + +- if( !orc_program_add_temporary( vector->program, size, name ) ) +- vips_vector_error( vector ); ++ if (!orc_program_add_temporary(vector->program, size, name)) ++ vips_vector_error(vector); + + #ifdef DEBUG_TRACE +- printf( "orc_program_add_temporary( %s, %d, \"%s\" );\n", +- vector->unique_name, size, name ); ++ printf("orc_program_add_temporary( %s, %d, \"%s\" );\n", ++ vector->unique_name, size, name); + #endif /*DEBUG_TRACE*/ + vector->n_temp += 1; + #endif /*HAVE_ORC*/ + } + + int +-vips_vector_parameter( VipsVector *vector, const char *name, int size ) ++vips_vector_parameter(VipsVector *vector, const char *name, int size) + { + int var; + + #ifdef HAVE_ORC +- g_assert( orc_program_find_var_by_name( vector->program, name ) == -1 ); ++ g_assert(orc_program_find_var_by_name(vector->program, name) == -1); + +- var = orc_program_add_parameter( vector->program, size, name ); +- if( !var ) +- vips_vector_error( vector ); ++ var = orc_program_add_parameter(vector->program, size, name); ++ if (!var) ++ vips_vector_error(vector); + + #ifdef DEBUG_TRACE +- printf( "orc_program_add_parameter( %s, %d, \"%s\" );\n", +- vector->unique_name, size, name ); ++ printf("orc_program_add_parameter( %s, %d, \"%s\" );\n", ++ vector->unique_name, size, name); + #endif /*DEBUG_TRACE*/ + vector->n_parameter += 1; +-#else /*!HAVE_ORC*/ ++#else /*!HAVE_ORC*/ + var = -1; + #endif /*HAVE_ORC*/ + +- return ( var ); ++ return (var); + } + + int +-vips_vector_destination( VipsVector *vector, const char *name, int size ) ++vips_vector_destination(VipsVector *vector, const char *name, int size) + { + int var; + + #ifdef HAVE_ORC +- g_assert( orc_program_find_var_by_name( vector->program, name ) == -1 ); ++ g_assert(orc_program_find_var_by_name(vector->program, name) == -1); + +- var = orc_program_add_destination( vector->program, size, name ); ++ var = orc_program_add_destination(vector->program, size, name); + #ifdef DEBUG_TRACE +- printf( "orc_program_add_destination( %d, \"%s\" );\n", +- size, name ); ++ printf("orc_program_add_destination( %d, \"%s\" );\n", ++ size, name); + #endif /*DEBUG_TRACE*/ + vector->n_destination += 1; +-#else /*!HAVE_ORC*/ ++#else /*!HAVE_ORC*/ + var = -1; + #endif /*HAVE_ORC*/ + +- return( var ); ++ return (var); + } + + gboolean +-vips_vector_full( VipsVector *vector ) ++vips_vector_full(VipsVector *vector) + { + /* Many orcs don't have ORC_MAX_CONST_VARS etc., stick to our own + * constants for now. +@@ -394,151 +394,151 @@ vips_vector_full( VipsVector *vector ) + /* We can need a max of 2 constants plus one source per + * coefficient, so stop if we're sure we don't have enough. + */ +- if( vector->n_constant + 2 > 8 /*ORC_MAX_CONST_VARS*/ ) +- return( TRUE ); ++ if (vector->n_constant + 2 > 8 /*ORC_MAX_CONST_VARS*/) ++ return (TRUE); + + /* You can have 8 source, and d1 counts as one of them, so +1 + * there. + */ +- if( vector->n_source + vector->n_scanline + 1 > 7 /*ORC_MAX_SRC_VARS - 1*/ ) +- return( TRUE ); ++ if (vector->n_source + vector->n_scanline + 1 > 7 /*ORC_MAX_SRC_VARS - 1*/) ++ return (TRUE); + +- /* Need to leave some space, so 1 spare. ++ /* Need to leave some space, so 1 spare. + */ +- if( vector->n_parameter > 7 /*ORC_MAX_PARAM_VARS - 1*/ ) +- return( TRUE ); ++ if (vector->n_parameter > 7 /*ORC_MAX_PARAM_VARS - 1*/) ++ return (TRUE); + +- /* After signalling full, some operations will add up to 4 more ++ /* After signalling full, some operations will add up to 4 more + * instructions as they finish up. Leave a margin. + */ +- if( vector->n_instruction + 10 > 50 /*ORC_N_INSNS / 2*/ ) +- return( TRUE ); ++ if (vector->n_instruction + 10 > 50 /*ORC_N_INSNS / 2*/) ++ return (TRUE); + +- return( FALSE ); ++ return (FALSE); + } + + gboolean +-vips_vector_compile( VipsVector *vector ) ++vips_vector_compile(VipsVector *vector) + { + #ifdef HAVE_ORC + OrcCompileResult result; + + /* Some orcs seem to be unstable with many compilers active at once. + */ +- g_mutex_lock( vips__global_lock ); +- result = orc_program_compile( vector->program ); +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); ++ result = orc_program_compile(vector->program); ++ g_mutex_unlock(vips__global_lock); + + #ifdef DEBUG_TRACE +- printf( "orc_program_compile( %s );\n", vector->unique_name ); ++ printf("orc_program_compile( %s );\n", vector->unique_name); + #endif /*DEBUG_TRACE*/ +- if( !ORC_COMPILE_RESULT_IS_SUCCESSFUL( result ) ) { ++ if (!ORC_COMPILE_RESULT_IS_SUCCESSFUL(result)) { + #ifdef DEBUG +- printf( "*** error compiling %s\n", vector->name ); ++ printf("*** error compiling %s\n", vector->name); + #endif /*DEBUG*/ + +- return( FALSE ); ++ return (FALSE); + } + + vector->compiled = TRUE; + #endif /*HAVE_ORC*/ + +- return( TRUE ); ++ return (TRUE); + } + + void +-vips_vector_print( VipsVector *vector ) ++vips_vector_print(VipsVector *vector) + { + int i; + +- printf( "%s: ", vector->name ); +- if( vector->compiled ) +- printf( "successfully compiled\n" ); ++ printf("%s: ", vector->name); ++ if (vector->compiled) ++ printf("successfully compiled\n"); + else +- printf( "not compiled\n" ); +- printf( " n_scanline = %d\n", vector->n_scanline ); +- for( i = 0; i < vector->n_scanline; i++ ) +- printf( " var %d = line %d\n", +- vector->sl[i], vector->line[i] ); +- printf( " n_source = %d\n", vector->n_source ); +- for( i = 0; i < vector->n_source; i++ ) +- printf( " var %d\n", vector->s[i] ); +- printf( " n_parameter = %d\n", vector->n_parameter ); +- printf( " n_destination = %d\n", vector->n_destination ); +- printf( " n_constant = %d\n", vector->n_constant ); +- printf( " n_temp = %d\n", vector->n_temp ); +- printf( " n_instruction = %d\n", vector->n_instruction ); ++ printf("not compiled\n"); ++ printf(" n_scanline = %d\n", vector->n_scanline); ++ for (i = 0; i < vector->n_scanline; i++) ++ printf(" var %d = line %d\n", ++ vector->sl[i], vector->line[i]); ++ printf(" n_source = %d\n", vector->n_source); ++ for (i = 0; i < vector->n_source; i++) ++ printf(" var %d\n", vector->s[i]); ++ printf(" n_parameter = %d\n", vector->n_parameter); ++ printf(" n_destination = %d\n", vector->n_destination); ++ printf(" n_constant = %d\n", vector->n_constant); ++ printf(" n_temp = %d\n", vector->n_temp); ++ printf(" n_instruction = %d\n", vector->n_instruction); + } + + void +-vips_executor_set_program( VipsExecutor *executor, VipsVector *vector, int n ) ++vips_executor_set_program(VipsExecutor *executor, VipsVector *vector, int n) + { + #ifdef HAVE_ORC + executor->vector = vector; + +- orc_executor_set_program( &executor->executor, vector->program ); +- orc_executor_set_n( &executor->executor, n ); ++ orc_executor_set_program(&executor->executor, vector->program); ++ orc_executor_set_n(&executor->executor, n); + #endif /*HAVE_ORC*/ + } + + void +-vips_executor_set_array( VipsExecutor *executor, int var, void *value ) ++vips_executor_set_array(VipsExecutor *executor, int var, void *value) + { + #ifdef HAVE_ORC +- if( var != -1 ) +- orc_executor_set_array( &executor->executor, var, value ); ++ if (var != -1) ++ orc_executor_set_array(&executor->executor, var, value); + #endif /*HAVE_ORC*/ + } + + void +-vips_executor_set_parameter( VipsExecutor *executor, int var, int value ) ++vips_executor_set_parameter(VipsExecutor *executor, int var, int value) + { + #ifdef HAVE_ORC +- if( var != -1 ) +- orc_executor_set_param( &executor->executor, var, value ); ++ if (var != -1) ++ orc_executor_set_param(&executor->executor, var, value); + #endif /*HAVE_ORC*/ + } + + void +-vips_executor_set_scanline( VipsExecutor *executor, +- VipsRegion *ir, int x, int y ) ++vips_executor_set_scanline(VipsExecutor *executor, ++ VipsRegion *ir, int x, int y) + { + VipsVector *vector = executor->vector; +- VipsPel *base = VIPS_REGION_ADDR( ir, x, y ); +- int lsk = VIPS_REGION_LSKIP( ir ); ++ VipsPel *base = VIPS_REGION_ADDR(ir, x, y); ++ int lsk = VIPS_REGION_LSKIP(ir); + + int i; + +- for( i = 0; i < vector->n_scanline; i++ ) +- vips_executor_set_array( executor, +- vector->sl[i], base + vector->line[i] * lsk ); ++ for (i = 0; i < vector->n_scanline; i++) ++ vips_executor_set_array(executor, ++ vector->sl[i], base + vector->line[i] * lsk); + } + + void +-vips_executor_set_destination( VipsExecutor *executor, void *value ) ++vips_executor_set_destination(VipsExecutor *executor, void *value) + { + VipsVector *vector = executor->vector; + +- vips_executor_set_array( executor, vector->d1, value ); ++ vips_executor_set_array(executor, vector->d1, value); + } + + void +-vips_executor_run( VipsExecutor *executor ) ++vips_executor_run(VipsExecutor *executor) + { + #ifdef HAVE_ORC +- orc_executor_run( &executor->executor ); ++ orc_executor_run(&executor->executor); + #endif /*HAVE_ORC*/ + } + +-/* Make a fixed-point version of a matrix. Each +- * out[i] = rint(in[i] * adj_scale), where adj_scale is selected so that ++/* Make a fixed-point version of a matrix. Each ++ * out[i] = rint(in[i] * adj_scale), where adj_scale is selected so that + * sum(out) = sum(in) * scale. + * + * Because of the vagaries of rint(), we can't just calc this, we have to + * iterate and converge on the best value for adj_scale. + */ + void +-vips_vector_to_fixed_point( double *in, int *out, int n, int scale ) ++vips_vector_to_fixed_point(double *in, int *out, int n, int scale) + { + double fsum; + int i; +@@ -549,9 +549,9 @@ vips_vector_to_fixed_point( double *in, int *out, int n, int scale ) + double guess; + + fsum = 0.0; +- for( i = 0; i < n; i++ ) ++ for (i = 0; i < n; i++) + fsum += in[i]; +- target = VIPS_RINT( fsum * scale ); ++ target = VIPS_RINT(fsum * scale); + + /* As we rint() each scale element, we can get up to 0.5 error. + * Therefore, by the end of the mask, we can be off by up to n/2. Our +@@ -564,25 +564,25 @@ vips_vector_to_fixed_point( double *in, int *out, int n, int scale ) + do { + guess = (high + low) / 2.0; + +- for( i = 0; i < n; i++ ) +- out[i] = VIPS_RINT( in[i] * guess ); ++ for (i = 0; i < n; i++) ++ out[i] = VIPS_RINT(in[i] * guess); + + sum = 0; +- for( i = 0; i < n; i++ ) ++ for (i = 0; i < n; i++) + sum += out[i]; + +- if( sum == target ) ++ if (sum == target) + break; +- if( sum < target ) ++ if (sum < target) + low = guess; +- if( sum > target ) ++ if (sum > target) + high = guess; + +- /* This will typically produce about 5 iterations. +- */ +- } while( high - low > 0.01 ); ++ /* This will typically produce about 5 iterations. ++ */ ++ } while (high - low > 0.01); + +- if( sum != target ) { ++ if (sum != target) { + /* Spread the error out thinly over the whole array. For + * example, consider the matrix: + * +@@ -592,7 +592,7 @@ vips_vector_to_fixed_point( double *in, int *out, int n, int scale ) + * 1 1 1 + * + * being converted with scale = 64 (convi does this). We want +- * to generate a mix of 7s and 8s. ++ * to generate a mix of 7s and 8s. + */ + int each_error = (target - sum) / n; + int extra_error = (target - sum) % n; +@@ -601,12 +601,12 @@ vips_vector_to_fixed_point( double *in, int *out, int n, int scale ) + * first abs(extra_error) elements. + */ + int direction = extra_error > 0 ? 1 : -1; +- int n_elements = VIPS_ABS( extra_error ); ++ int n_elements = VIPS_ABS(extra_error); + +- for( i = 0; i < n; i++ ) ++ for (i = 0; i < n; i++) + out[i] += each_error; + +- for( i = 0; i < n_elements; i++ ) ++ for (i = 0; i < n_elements; i++) + out[i] += direction; + } + } +diff --git a/libvips/iofuncs/vips.c b/libvips/iofuncs/vips.c +index 86d37b6e03..ff2b0f10eb 100644 +--- a/libvips/iofuncs/vips.c ++++ b/libvips/iofuncs/vips.c +@@ -1,5 +1,5 @@ + /* Read and write a vips file. +- * ++ * + * 22/5/08 + * - from im_open.c, im_openin.c, im_desc_hd.c, im_readhist.c, + * im_openout.c +@@ -13,7 +13,7 @@ + * - only wholly map input files on im_incheck() ... this reduces VM use, + * especially with large numbers of small files + * 14/2/11 +- * - renamed to vips.c from im_open_vips.c, some stuff chopped out for ++ * - renamed to vips.c from im_open_vips.c, some stuff chopped out for + * image.c ... this file now just does read / write to disc + * 28/3/11 + * - moved to vips_ namespace +@@ -31,28 +31,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -110,7 +110,7 @@ + * @see_also: VipsOperation + * @include: vips/vips.h + * +- * Start VIPS up, shut VIPS down, get version information, relocation. ++ * Start VIPS up, shut VIPS down, get version information, relocation. + * + * VIPS is a relocatable package, meaning you can move the directory tree you + * compiled it to at runtime and it will still be able to find all data files. +@@ -120,53 +120,53 @@ + + /* Open mode for image write. + * +- * We use O_RDWR not O_WRONLY since after writing we may want to rewind the ++ * We use O_RDWR not O_WRONLY since after writing we may want to rewind the + * image and read from it. + */ +-#define MODE_WRITE CLOEXEC (BINARYIZE (O_RDWR | O_CREAT | O_TRUNC)) ++#define MODE_WRITE CLOEXEC(BINARYIZE(O_RDWR | O_CREAT | O_TRUNC)) + + /* Mode for read/write. This is if we might later want to mmaprw () the file. + */ +-#define MODE_READWRITE CLOEXEC (BINARYIZE (O_RDWR)) ++#define MODE_READWRITE CLOEXEC(BINARYIZE(O_RDWR)) + + /* Mode for read only. This is the fallback if READWRITE fails. + */ +-#define MODE_READONLY CLOEXEC (BINARYIZE (O_RDONLY)) ++#define MODE_READONLY CLOEXEC(BINARYIZE(O_RDONLY)) + + /* Our XML namespace. + */ +-#define NAMESPACE_URI "http://www.vips.ecs.soton.ac.uk/" ++#define NAMESPACE_URI "http://www.vips.ecs.soton.ac.uk/" + +-/* Open for read for image files. ++/* Open for read for image files. + */ + int +-vips__open_image_read( const char *filename ) ++vips__open_image_read(const char *filename) + { + int fd; + +- /* Try to open read-write, so that calls to vips_image_inplace() will +- * work. When we later mmap this file, we set read-only, so there ++ /* Try to open read-write, so that calls to vips_image_inplace() will ++ * work. When we later mmap this file, we set read-only, so there + * is little danger of scrubbing over files we own. + */ +- fd = vips_tracked_open( filename, MODE_READWRITE, 0 ); +- if( fd == -1 ) ++ fd = vips_tracked_open(filename, MODE_READWRITE, 0); ++ if (fd == -1) + /* Open read-write failed. Fall back to open read-only. + */ +- fd = vips_tracked_open( filename, MODE_READONLY, 0 ); +- +- if( fd == -1 ) { +- vips_error_system( errno, "VipsImage", +- _( "unable to open \"%s\"" ), filename ); +- return( -1 ); ++ fd = vips_tracked_open(filename, MODE_READONLY, 0); ++ ++ if (fd == -1) { ++ vips_error_system(errno, "VipsImage", ++ _("unable to open \"%s\""), filename); ++ return (-1); + } + +- return( fd ); ++ return (fd); + } + +-/* Open for write for image files. ++/* Open for write for image files. + */ + int +-vips__open_image_write( const char *filename, gboolean temp ) ++vips__open_image_write(const char *filename, gboolean temp) + { + int flags; + int fd; +@@ -174,8 +174,8 @@ vips__open_image_write( const char *filename, gboolean temp ) + fd = -1; + + #ifndef O_TMPFILE +- if( temp ) +- g_info( "vips__open_image_write: O_TMPFILE not available" ); ++ if (temp) ++ g_info("vips__open_image_write: O_TMPFILE not available"); + #endif /*!O_TMPFILE*/ + + #ifdef O_TMPFILE +@@ -184,18 +184,18 @@ vips__open_image_write( const char *filename, gboolean temp ) + * + * This can fail since not all filesystems support it. In this case, + * we open as a regular file and rely on the delete-on-close +- * mechanism, see vips_image_delete(). ++ * mechanism, see vips_image_delete(). + */ +- if( temp ) { ++ if (temp) { + char *dirname; + +- g_info( "vips__open_image_write: opening with O_TMPFILE" ); +- dirname = g_path_get_dirname( filename ); +- fd = vips_tracked_open( dirname, O_TMPFILE | O_RDWR , 0644 ); +- g_free( dirname ); ++ g_info("vips__open_image_write: opening with O_TMPFILE"); ++ dirname = g_path_get_dirname(filename); ++ fd = vips_tracked_open(dirname, O_TMPFILE | O_RDWR, 0644); ++ g_free(dirname); + +- if( fd < 0 ) +- g_info( "vips__open_image_write: O_TMPFILE failed!" ); ++ if (fd < 0) ++ g_info("vips__open_image_write: O_TMPFILE failed!"); + } + #endif /*O_TMPFILE*/ + +@@ -203,27 +203,27 @@ vips__open_image_write( const char *filename, gboolean temp ) + + #ifdef _O_TEMPORARY + /* On Windows, setting _O_TEMPORARY will delete the file automatically +- * on process exit, even if the processes crashes. ++ * on process exit, even if the processes crashes. + */ +- if( temp ) { +- g_info( "vips__open_image_write: setting _O_TEMPORARY" ); ++ if (temp) { ++ g_info("vips__open_image_write: setting _O_TEMPORARY"); + flags |= _O_TEMPORARY; + } + #endif /*_O_TEMPORARY*/ + +- if( fd < 0 ) { +- g_info( "vips__open_image_write: simple open" ); +- fd = vips_tracked_open( filename, flags, 0644 ); ++ if (fd < 0) { ++ g_info("vips__open_image_write: simple open"); ++ fd = vips_tracked_open(filename, flags, 0644); + } + +- if( fd < 0 ) { +- g_info( "vips__open_image_write: failed!" ); +- vips_error_system( errno, "VipsImage", +- _( "unable to write to \"%s\"" ), filename ); +- return( -1 ); ++ if (fd < 0) { ++ g_info("vips__open_image_write: failed!"); ++ vips_error_system(errno, "VipsImage", ++ _("unable to write to \"%s\""), filename); ++ return (-1); + } + +- return( fd ); ++ return (fd); + } + + /* Predict the size of the header plus pixel data. Don't use off_t, +@@ -231,15 +231,15 @@ vips__open_image_write( const char *filename, gboolean temp ) + * want to always be 64 bit. + */ + static gint64 +-image_pixel_length( VipsImage *image ) ++image_pixel_length(VipsImage *image) + { + gint64 psize; + +- switch( image->Coding ) { ++ switch (image->Coding) { + case VIPS_CODING_LABQ: + case VIPS_CODING_RAD: + case VIPS_CODING_NONE: +- psize = VIPS_IMAGE_SIZEOF_IMAGE( image ); ++ psize = VIPS_IMAGE_SIZEOF_IMAGE(image); + break; + + default: +@@ -247,46 +247,46 @@ image_pixel_length( VipsImage *image ) + break; + } + +- return( psize + image->sizeof_header ); ++ return (psize + image->sizeof_header); + } + + /* Copy 2 and 4 bytes, optionally swapping byte order. + */ + void +-vips__copy_4byte( int swap, unsigned char *to, unsigned char *from ) ++vips__copy_4byte(int swap, unsigned char *to, unsigned char *from) + { + guint32 *in = (guint32 *) from; + guint32 *out = (guint32 *) to; + +- if( swap ) +- *out = GUINT32_SWAP_LE_BE( *in ); ++ if (swap) ++ *out = GUINT32_SWAP_LE_BE(*in); + else + *out = *in; + } + + void +-vips__copy_2byte( gboolean swap, unsigned char *to, unsigned char *from ) ++vips__copy_2byte(gboolean swap, unsigned char *to, unsigned char *from) + { + guint16 *in = (guint16 *) from; + guint16 *out = (guint16 *) to; + +- if( swap ) +- *out = GUINT16_SWAP_LE_BE( *in ); ++ if (swap) ++ *out = GUINT16_SWAP_LE_BE(*in); + else + *out = *in; + } + + guint32 +-vips__file_magic( const char *filename ) ++vips__file_magic(const char *filename) + { + guint32 magic; + +- if( vips__get_bytes( filename, (unsigned char *) &magic, 4 ) == 4 && +- (magic == VIPS_MAGIC_INTEL || +- magic == VIPS_MAGIC_SPARC) ) +- return( magic ); ++ if (vips__get_bytes(filename, (unsigned char *) &magic, 4) == 4 && ++ (magic == VIPS_MAGIC_INTEL || ++ magic == VIPS_MAGIC_SPARC)) ++ return (magic); + +- return( 0 ); ++ return (0); + } + + /* offset, read, write functions. +@@ -294,125 +294,125 @@ vips__file_magic( const char *filename ) + typedef struct _FieldIO { + glong offset; + int size; +- void (*copy)( gboolean swap, unsigned char *to, unsigned char *from ); ++ void (*copy)(gboolean swap, unsigned char *to, unsigned char *from); + } FieldIO; + + static FieldIO fields[] = { +- { G_STRUCT_OFFSET( VipsImage, Xsize ), 4, vips__copy_4byte }, +- { G_STRUCT_OFFSET( VipsImage, Ysize ), 4, vips__copy_4byte }, +- { G_STRUCT_OFFSET( VipsImage, Bands ), 4, vips__copy_4byte }, +- { G_STRUCT_OFFSET( VipsImage, Bbits ), 4, vips__copy_4byte }, +- { G_STRUCT_OFFSET( VipsImage, BandFmt ), 4, vips__copy_4byte }, +- { G_STRUCT_OFFSET( VipsImage, Coding ), 4, vips__copy_4byte }, +- { G_STRUCT_OFFSET( VipsImage, Type ), 4, vips__copy_4byte }, +- { G_STRUCT_OFFSET( VipsImage, Xres_float ), 4, vips__copy_4byte }, +- { G_STRUCT_OFFSET( VipsImage, Yres_float ), 4, vips__copy_4byte }, +- { G_STRUCT_OFFSET( VipsImage, Length ), 4, vips__copy_4byte }, +- { G_STRUCT_OFFSET( VipsImage, Compression ), 2, vips__copy_2byte }, +- { G_STRUCT_OFFSET( VipsImage, Level ), 2, vips__copy_2byte }, +- { G_STRUCT_OFFSET( VipsImage, Xoffset ), 4, vips__copy_4byte }, +- { G_STRUCT_OFFSET( VipsImage, Yoffset ), 4, vips__copy_4byte } ++ { G_STRUCT_OFFSET(VipsImage, Xsize), 4, vips__copy_4byte }, ++ { G_STRUCT_OFFSET(VipsImage, Ysize), 4, vips__copy_4byte }, ++ { G_STRUCT_OFFSET(VipsImage, Bands), 4, vips__copy_4byte }, ++ { G_STRUCT_OFFSET(VipsImage, Bbits), 4, vips__copy_4byte }, ++ { G_STRUCT_OFFSET(VipsImage, BandFmt), 4, vips__copy_4byte }, ++ { G_STRUCT_OFFSET(VipsImage, Coding), 4, vips__copy_4byte }, ++ { G_STRUCT_OFFSET(VipsImage, Type), 4, vips__copy_4byte }, ++ { G_STRUCT_OFFSET(VipsImage, Xres_float), 4, vips__copy_4byte }, ++ { G_STRUCT_OFFSET(VipsImage, Yres_float), 4, vips__copy_4byte }, ++ { G_STRUCT_OFFSET(VipsImage, Length), 4, vips__copy_4byte }, ++ { G_STRUCT_OFFSET(VipsImage, Compression), 2, vips__copy_2byte }, ++ { G_STRUCT_OFFSET(VipsImage, Level), 2, vips__copy_2byte }, ++ { G_STRUCT_OFFSET(VipsImage, Xoffset), 4, vips__copy_4byte }, ++ { G_STRUCT_OFFSET(VipsImage, Yoffset), 4, vips__copy_4byte } + }; + + int +-vips__read_header_bytes( VipsImage *im, unsigned char *from ) ++vips__read_header_bytes(VipsImage *im, unsigned char *from) + { + gboolean swap; + int i; + GEnumValue *value; + + #ifdef SHOW_HEADER +- printf( "vips__read_header_bytes: file bytes:\n" ); +- for( i = 0; i < im->sizeof_header; i++ ) +- printf( "%2d - 0x%02x\n", i, from[i] ); ++ printf("vips__read_header_bytes: file bytes:\n"); ++ for (i = 0; i < im->sizeof_header; i++) ++ printf("%2d - 0x%02x\n", i, from[i]); + #endif /*SHOW_HEADER*/ + + /* The magic number is always written MSB first, we may need to swap. + */ +- vips__copy_4byte( !vips_amiMSBfirst(), +- (unsigned char *) &im->magic, from ); ++ vips__copy_4byte(!vips_amiMSBfirst(), ++ (unsigned char *) &im->magic, from); + from += 4; +- if( im->magic != VIPS_MAGIC_INTEL && +- im->magic != VIPS_MAGIC_SPARC ) { +- vips_error( "VipsImage", +- _( "\"%s\" is not a VIPS image" ), im->filename ); +- return( -1 ); ++ if (im->magic != VIPS_MAGIC_INTEL && ++ im->magic != VIPS_MAGIC_SPARC) { ++ vips_error("VipsImage", ++ _("\"%s\" is not a VIPS image"), im->filename); ++ return (-1); + } + +- /* We need to swap for other fields if the file byte order is ++ /* We need to swap for other fields if the file byte order is + * different from ours. + */ +- swap = vips_amiMSBfirst() != vips_image_isMSBfirst( im ); ++ swap = vips_amiMSBfirst() != vips_image_isMSBfirst(im); + +- for( i = 0; i < VIPS_NUMBER( fields ); i++ ) { +- fields[i].copy( swap, +- &G_STRUCT_MEMBER( unsigned char, im, fields[i].offset ), +- from ); ++ for (i = 0; i < VIPS_NUMBER(fields); i++) { ++ fields[i].copy(swap, ++ &G_STRUCT_MEMBER(unsigned char, im, fields[i].offset), ++ from); + from += fields[i].size; + } + + /* Set this ourselves ... bbits is deprecated in the file format. + */ +- im->Bbits = vips_format_sizeof( im->BandFmt ) << 3; ++ im->Bbits = vips_format_sizeof(im->BandFmt) << 3; + + /* We read xres/yres as floats to a staging area, then copy to double + * in the main fields. + */ +- im->Xres = VIPS_MAX( 0, im->Xres_float ); +- im->Yres = VIPS_MAX( 0, im->Yres_float ); ++ im->Xres = VIPS_MAX(0, im->Xres_float); ++ im->Yres = VIPS_MAX(0, im->Yres_float); + + /* Some protection against malicious files. We also check predicted +- * (based on these values) against real file length, see below. ++ * (based on these values) against real file length, see below. + */ +- im->Xsize = VIPS_CLIP( 1, im->Xsize, VIPS_MAX_COORD ); +- im->Ysize = VIPS_CLIP( 1, im->Ysize, VIPS_MAX_COORD ); +- im->Bands = VIPS_CLIP( 1, im->Bands, VIPS_MAX_COORD ); +- im->BandFmt = VIPS_CLIP( 0, im->BandFmt, VIPS_FORMAT_LAST - 1 ); ++ im->Xsize = VIPS_CLIP(1, im->Xsize, VIPS_MAX_COORD); ++ im->Ysize = VIPS_CLIP(1, im->Ysize, VIPS_MAX_COORD); ++ im->Bands = VIPS_CLIP(1, im->Bands, VIPS_MAX_COORD); ++ im->BandFmt = VIPS_CLIP(0, im->BandFmt, VIPS_FORMAT_LAST - 1); + + /* Coding and Type have missing values, so we look up in the enum. + */ +- value = g_enum_get_value( g_type_class_ref( VIPS_TYPE_INTERPRETATION ), +- im->Type ); +- if( !value || +- strcmp( value->value_nick, "last" ) == 0 ) ++ value = g_enum_get_value(g_type_class_ref(VIPS_TYPE_INTERPRETATION), ++ im->Type); ++ if (!value || ++ strcmp(value->value_nick, "last") == 0) + im->Type = VIPS_INTERPRETATION_ERROR; +- value = g_enum_get_value( g_type_class_ref( VIPS_TYPE_CODING ), +- im->Coding ); +- if( !value || +- strcmp( value->value_nick, "last" ) == 0 ) ++ value = g_enum_get_value(g_type_class_ref(VIPS_TYPE_CODING), ++ im->Coding); ++ if (!value || ++ strcmp(value->value_nick, "last") == 0) + im->Coding = VIPS_CODING_ERROR; + +- /* Offset, Res, etc. don't affect vips file layout, just ++ /* Offset, Res, etc. don't affect vips file layout, just + * pixel interpretation, don't clip them. + */ + + /* Coding values imply Bands and BandFmt settings --- make sure they + * are sane. + */ +- switch( im->Coding ) { ++ switch (im->Coding) { + case VIPS_CODING_ERROR: +- vips_error( "VipsImage", +- "%s", _( "unknown coding" ) ); +- return( -1 ); ++ vips_error("VipsImage", ++ "%s", _("unknown coding")); ++ return (-1); + + case VIPS_CODING_NONE: + break; + + case VIPS_CODING_LABQ: +- if( im->Bands != 4 || +- im->BandFmt != VIPS_FORMAT_UCHAR ) { +- vips_error( "VipsImage", +- "%s", _( "malformed LABQ image" ) ); +- return( -1 ); ++ if (im->Bands != 4 || ++ im->BandFmt != VIPS_FORMAT_UCHAR) { ++ vips_error("VipsImage", ++ "%s", _("malformed LABQ image")); ++ return (-1); + } + break; + + case VIPS_CODING_RAD: +- if( im->Bands != 4 || +- im->BandFmt != VIPS_FORMAT_UCHAR ) { +- vips_error( "VipsImage", +- "%s", _( "malformed RAD image" ) ); +- return( -1 ); ++ if (im->Bands != 4 || ++ im->BandFmt != VIPS_FORMAT_UCHAR) { ++ vips_error("VipsImage", ++ "%s", _("malformed RAD image")); ++ return (-1); + } + break; + +@@ -421,124 +421,124 @@ vips__read_header_bytes( VipsImage *im, unsigned char *from ) + break; + } + +- return( 0 ); ++ return (0); + } + + int +-vips__write_header_bytes( VipsImage *im, unsigned char *to ) ++vips__write_header_bytes(VipsImage *im, unsigned char *to) + { + /* Swap if the byte order we are asked to write the header in is + * different from ours. + */ +- gboolean swap = vips_amiMSBfirst() != vips_image_isMSBfirst( im ); ++ gboolean swap = vips_amiMSBfirst() != vips_image_isMSBfirst(im); + + int i; + unsigned char *q; + + /* We set xres/yres as floats in a staging area, then copy those +- * smaller values to the file. ++ * smaller values to the file. + */ + im->Xres_float = im->Xres; + im->Yres_float = im->Yres; + + /* Always write the magic number MSB first. + */ +- vips__copy_4byte( !vips_amiMSBfirst(), +- to, (unsigned char *) &im->magic ); ++ vips__copy_4byte(!vips_amiMSBfirst(), ++ to, (unsigned char *) &im->magic); + q = to + 4; + +- for( i = 0; i < VIPS_NUMBER( fields ); i++ ) { +- fields[i].copy( swap, +- q, +- &G_STRUCT_MEMBER( unsigned char, im, +- fields[i].offset ) ); ++ for (i = 0; i < VIPS_NUMBER(fields); i++) { ++ fields[i].copy(swap, ++ q, ++ &G_STRUCT_MEMBER(unsigned char, im, ++ fields[i].offset)); + q += fields[i].size; + } + + /* Pad spares with zeros. + */ +- while( q - to < im->sizeof_header ) ++ while (q - to < im->sizeof_header) + *q++ = 0; + + #ifdef SHOW_HEADER +- printf( "vips__write_header_bytes: file bytes:\n" ); +- for( i = 0; i < im->sizeof_header; i++ ) +- printf( "%2d - 0x%02x\n", i, to[i] ); ++ printf("vips__write_header_bytes: file bytes:\n"); ++ for (i = 0; i < im->sizeof_header; i++) ++ printf("%2d - 0x%02x\n", i, to[i]); + #endif /*SHOW_HEADER*/ + +- return( 0 ); ++ return (0); + } + + /* Read a chunk of an fd into memory. Add a '\0' at the end. + */ + static char * +-read_chunk( int fd, gint64 offset, size_t length ) ++read_chunk(int fd, gint64 offset, size_t length) + { + char *buf; + +- if( vips__seek( fd, offset, SEEK_SET ) == -1 ) +- return( NULL ); +- if( !(buf = vips_malloc( NULL, length + 1 )) ) +- return( NULL ); +- if( read( fd, buf, length ) != (ssize_t) length ) { +- g_free( buf ); +- vips_error( "VipsImage", "%s", _( "unable to read history" ) ); +- return( NULL ); ++ if (vips__seek(fd, offset, SEEK_SET) == -1) ++ return (NULL); ++ if (!(buf = vips_malloc(NULL, length + 1))) ++ return (NULL); ++ if (read(fd, buf, length) != (ssize_t) length) { ++ g_free(buf); ++ vips_error("VipsImage", "%s", _("unable to read history")); ++ return (NULL); + } + buf[length] = '\0'; + +- return( buf ); ++ return (buf); + } + + /* Does it look like an image has an extension block? + */ + int +-vips__has_extension_block( VipsImage *im ) ++vips__has_extension_block(VipsImage *im) + { + gint64 psize; + +- psize = image_pixel_length( im ); +- g_assert( im->file_length > 0 ); ++ psize = image_pixel_length(im); ++ g_assert(im->file_length > 0); + +- return( im->file_length - psize > 0 ); ++ return (im->file_length - psize > 0); + } + + /* Read everything after the pixels into memory. + */ + void * +-vips__read_extension_block( VipsImage *im, int *size ) ++vips__read_extension_block(VipsImage *im, int *size) + { + gint64 psize; + void *buf; + +- psize = image_pixel_length( im ); +- g_assert( im->file_length > 0 ); +- if( im->file_length - psize > 100 * 1024 * 1024 ) { +- vips_error( "VipsImage", +- "%s", _( "more than 100 megabytes of XML? " +- "sufferin' succotash!" ) ); +- return( NULL ); ++ psize = image_pixel_length(im); ++ g_assert(im->file_length > 0); ++ if (im->file_length - psize > 100 * 1024 * 1024) { ++ vips_error("VipsImage", ++ "%s", _("more than 100 megabytes of XML? " ++ "sufferin' succotash!")); ++ return (NULL); + } +- if( im->file_length - psize == 0 ) +- return( NULL ); +- if( !(buf = read_chunk( im->fd, psize, im->file_length - psize )) ) +- return( NULL ); +- if( size ) ++ if (im->file_length - psize == 0) ++ return (NULL); ++ if (!(buf = read_chunk(im->fd, psize, im->file_length - psize))) ++ return (NULL); ++ if (size) + *size = im->file_length - psize; + + #ifdef DEBUG +- printf( "vips__read_extension_block: read %d bytes from %s\n", +- (int) (im->file_length - psize), im->filename ); +- printf( "data: \"%s\"\n", (char *) buf ); ++ printf("vips__read_extension_block: read %d bytes from %s\n", ++ (int) (im->file_length - psize), im->filename); ++ printf("data: \"%s\"\n", (char *) buf); + #endif /*DEBUG*/ + +- return( buf ); ++ return (buf); + } + + static int +-parser_read_fd( XML_Parser parser, int fd ) ++parser_read_fd(XML_Parser parser, int fd) + { +- const int chunk_size = 1024; ++ const int chunk_size = 1024; + + gint64 bytes_read; + gint64 len; +@@ -548,32 +548,32 @@ parser_read_fd( XML_Parser parser, int fd ) + do { + void *buf; + +- if( !(buf = XML_GetBuffer( parser, chunk_size )) ) { +- vips_error( "VipsImage", +- "%s", _( "unable to allocate read buffer" ) ); +- return( -1 ); ++ if (!(buf = XML_GetBuffer(parser, chunk_size))) { ++ vips_error("VipsImage", ++ "%s", _("unable to allocate read buffer")); ++ return (-1); + } +- len = read( fd, buf, chunk_size ); +- if( len == -1 ) { +- vips_error( "VipsImage", +- "%s", _( "read error while fetching XML" ) ); +- return( -1 ); ++ len = read(fd, buf, chunk_size); ++ if (len == -1) { ++ vips_error("VipsImage", ++ "%s", _("read error while fetching XML")); ++ return (-1); + } + + /* Allow missing XML block. + */ +- if( bytes_read == 0 && +- len == 0 ) ++ if (bytes_read == 0 && ++ len == 0) + break; + bytes_read += len; + +- if( !XML_ParseBuffer( parser, len, len == 0 ) ) { +- vips_error( "VipsImage", "%s", _( "XML parse error" ) ); +- return( -1 ); ++ if (!XML_ParseBuffer(parser, len, len == 0)) { ++ vips_error("VipsImage", "%s", _("XML parse error")); ++ return (-1); + } +- } while( len > 0 ); ++ } while (len > 0); + +- return( 0 ); ++ return (0); + } + + #define MAX_PARSE_ATTR (256) +@@ -598,42 +598,42 @@ typedef struct _VipsExpatParse { + + /* Accumulate data here. + */ +- VipsDbuf dbuf; ++ VipsDbuf dbuf; + } VipsExpatParse; + + static void +-parser_element_start_handler( void *user_data, +- const XML_Char *name, const XML_Char **atts ) ++parser_element_start_handler(void *user_data, ++ const XML_Char *name, const XML_Char **atts) + { + VipsExpatParse *vep = (VipsExpatParse *) user_data; + const XML_Char **p; + + #ifdef DEBUG +- printf( "parser_element_start: %s\n", name ); +- for( p = atts; *p; p += 2 ) +- printf( "%s = %s\n", p[0], p[1] ); ++ printf("parser_element_start: %s\n", name); ++ for (p = atts; *p; p += 2) ++ printf("%s = %s\n", p[0], p[1]); + #endif /*DEBUG*/ + +- if( strcmp( name, "field" ) == 0 ) { +- for( p = atts; *p; p += 2 ) { +- if( strcmp( p[0], "name" ) == 0 ) +- vips_strncpy( vep->name, p[1], MAX_PARSE_ATTR ); +- if( strcmp( p[0], "type" ) == 0 ) +- vips_strncpy( vep->type, p[1], MAX_PARSE_ATTR ); ++ if (strcmp(name, "field") == 0) { ++ for (p = atts; *p; p += 2) { ++ if (strcmp(p[0], "name") == 0) ++ vips_strncpy(vep->name, p[1], MAX_PARSE_ATTR); ++ if (strcmp(p[0], "type") == 0) ++ vips_strncpy(vep->type, p[1], MAX_PARSE_ATTR); + } + +- vips_dbuf_reset( &vep->dbuf ); +- } +- else if( strcmp( name, "header" ) == 0 ) ++ vips_dbuf_reset(&vep->dbuf); ++ } ++ else if (strcmp(name, "header") == 0) + vep->header = TRUE; +- else if( strcmp( name, "meta" ) == 0 ) ++ else if (strcmp(name, "meta") == 0) + vep->header = FALSE; +- else if( strcmp( name, "root" ) == 0 ) { +- for( p = atts; *p; p += 2 ) +- if( strcmp( p[0], "xmlns" ) == 0 && +- !vips_isprefix( NAMESPACE_URI "vips", p[1] ) ) { +- vips_error( "VipsImage", "%s", +- _( "incorrect namespace in XML" ) ); ++ else if (strcmp(name, "root") == 0) { ++ for (p = atts; *p; p += 2) ++ if (strcmp(p[0], "xmlns") == 0 && ++ !vips_isprefix(NAMESPACE_URI "vips", p[1])) { ++ vips_error("VipsImage", "%s", ++ _("incorrect namespace in XML")); + vep->error = TRUE; + } + } +@@ -642,227 +642,227 @@ parser_element_start_handler( void *user_data, + /* Chop history into lines, add each one as a refstring. + */ + static void +-set_history( VipsImage *im, char *history ) ++set_history(VipsImage *im, char *history) + { + GSList *history_list; + char *p, *q; + + /* There can be history there already if we're rewinding. + */ +- VIPS_FREEF( vips__gslist_gvalue_free, im->history_list ); ++ VIPS_FREEF(vips__gslist_gvalue_free, im->history_list); + + history_list = NULL; + +- for( p = history; *p; p = q ) { +- if( (q = strchr( p, '\n' )) ) { ++ for (p = history; *p; p = q) { ++ if ((q = strchr(p, '\n'))) { + *q = '\0'; + q += 1; + } +- else +- q = p + strlen( p ); ++ else ++ q = p + strlen(p); + +- history_list = g_slist_prepend( history_list, +- vips__gvalue_ref_string_new( p ) ); ++ history_list = g_slist_prepend(history_list, ++ vips__gvalue_ref_string_new(p)); + } + +- im->history_list = g_slist_reverse( history_list ); ++ im->history_list = g_slist_reverse(history_list); + } + + static int +-set_meta( VipsImage *image, GType gtype, const char *name, const char *data ) ++set_meta(VipsImage *image, GType gtype, const char *name, const char *data) + { + GValue save_value = { 0 }; + GValue value = { 0 }; + +- g_value_init( &save_value, VIPS_TYPE_SAVE_STRING ); +- vips_value_set_save_string( &save_value, data ); ++ g_value_init(&save_value, VIPS_TYPE_SAVE_STRING); ++ vips_value_set_save_string(&save_value, data); + +- g_value_init( &value, gtype ); +- if( !g_value_transform( &save_value, &value ) ) { +- g_value_unset( &save_value ); +- vips_error( "VipsImage", "%s", +- _( "error transforming from save format" ) ); +- return( -1 ); ++ g_value_init(&value, gtype); ++ if (!g_value_transform(&save_value, &value)) { ++ g_value_unset(&save_value); ++ vips_error("VipsImage", "%s", ++ _("error transforming from save format")); ++ return (-1); + } + +- vips_image_set( image, name, &value ); +- g_value_unset( &save_value ); +- g_value_unset( &value ); ++ vips_image_set(image, name, &value); ++ g_value_unset(&save_value); ++ g_value_unset(&value); + +- return( 0 ); ++ return (0); + } + + static void +-parser_element_end_handler( void *user_data, const XML_Char *name ) ++parser_element_end_handler(void *user_data, const XML_Char *name) + { + VipsExpatParse *vep = (VipsExpatParse *) user_data; + + #ifdef DEBUG +- printf( "parser_element_end_handler: %s\n", name ); ++ printf("parser_element_end_handler: %s\n", name); + #endif /*DEBUG*/ + +- if( strcmp( name, "field" ) == 0 ) { +- if( vep->header ) { +- if( strcmp( name, "Hist" ) == 0 ) +- set_history( vep->image, +- (char *) vips_dbuf_string( &vep->dbuf, +- NULL ) ); ++ if (strcmp(name, "field") == 0) { ++ if (vep->header) { ++ if (strcmp(name, "Hist") == 0) ++ set_history(vep->image, ++ (char *) vips_dbuf_string(&vep->dbuf, ++ NULL)); + } + else { +- GType gtype = g_type_from_name( vep->type ); ++ GType gtype = g_type_from_name(vep->type); + + /* Can we convert from VIPS_SAVE_STRING to type? + */ +- if( gtype && +- g_value_type_transformable( +- VIPS_TYPE_SAVE_STRING, gtype ) && +- set_meta( vep->image, +- gtype, vep->name, +- (char *) vips_dbuf_string( &vep->dbuf, +- NULL ) ) ) ++ if (gtype && ++ g_value_type_transformable( ++ VIPS_TYPE_SAVE_STRING, gtype) && ++ set_meta(vep->image, ++ gtype, vep->name, ++ (char *) vips_dbuf_string(&vep->dbuf, ++ NULL))) + vep->error = TRUE; + } + } + } + + static void +-parser_data_handler( void *user_data, const XML_Char *data, int len ) ++parser_data_handler(void *user_data, const XML_Char *data, int len) + { + VipsExpatParse *vep = (VipsExpatParse *) user_data; + + #ifdef DEBUG +- printf( "parser_data_handler: %d bytes\n", len ); ++ printf("parser_data_handler: %d bytes\n", len); + #endif /*DEBUG*/ + +- vips_dbuf_write( &vep->dbuf, (unsigned char *) data, len ); ++ vips_dbuf_write(&vep->dbuf, (unsigned char *) data, len); + } + + /* Called at the end of vips open ... get any XML after the pixel data + * and read it in. + */ +-static int +-readhist( VipsImage *im ) ++static int ++readhist(VipsImage *im) + { + XML_Parser parser; + VipsExpatParse vep; + +- if( vips__seek( im->fd, image_pixel_length( im ), SEEK_SET ) == -1 ) +- return( -1 ); ++ if (vips__seek(im->fd, image_pixel_length(im), SEEK_SET) == -1) ++ return (-1); + +- parser = XML_ParserCreate( "UTF-8" ); ++ parser = XML_ParserCreate("UTF-8"); + + vep.image = im; +- vips_dbuf_init( &vep.dbuf ); ++ vips_dbuf_init(&vep.dbuf); + vep.error = FALSE; +- XML_SetUserData( parser, &vep ); ++ XML_SetUserData(parser, &vep); + +- XML_SetElementHandler( parser, +- parser_element_start_handler, parser_element_end_handler ); +- XML_SetCharacterDataHandler( parser, parser_data_handler ); ++ XML_SetElementHandler(parser, ++ parser_element_start_handler, parser_element_end_handler); ++ XML_SetCharacterDataHandler(parser, parser_data_handler); + +- if( parser_read_fd( parser, im->fd ) || +- vep.error ) { +- vips_dbuf_destroy( &vep.dbuf ); +- XML_ParserFree( parser ); +- return( -1 ); ++ if (parser_read_fd(parser, im->fd) || ++ vep.error) { ++ vips_dbuf_destroy(&vep.dbuf); ++ XML_ParserFree(parser); ++ return (-1); + } + +- vips_dbuf_destroy( &vep.dbuf ); +- XML_ParserFree( parser ); ++ vips_dbuf_destroy(&vep.dbuf); ++ XML_ParserFree(parser); + +- return( 0 ); ++ return (0); + } + + int +-vips__write_extension_block( VipsImage *im, void *buf, int size ) ++vips__write_extension_block(VipsImage *im, void *buf, int size) + { + gint64 length; + gint64 psize; + +- psize = image_pixel_length( im ); +- if( (length = vips_file_length( im->fd )) == -1 ) +- return( -1 ); +- if( length < psize ) { +- vips_error( "VipsImage", "%s", _( "file has been truncated" ) ); +- return( -1 ); ++ psize = image_pixel_length(im); ++ if ((length = vips_file_length(im->fd)) == -1) ++ return (-1); ++ if (length < psize) { ++ vips_error("VipsImage", "%s", _("file has been truncated")); ++ return (-1); + } + +- if( vips__ftruncate( im->fd, psize ) || +- vips__seek( im->fd, psize, SEEK_SET ) == -1 ) +- return( -1 ); +- if( vips__write( im->fd, buf, size ) ) +- return( -1 ); ++ if (vips__ftruncate(im->fd, psize) || ++ vips__seek(im->fd, psize, SEEK_SET) == -1) ++ return (-1); ++ if (vips__write(im->fd, buf, size)) ++ return (-1); + + #ifdef DEBUG +- printf( "vips__write_extension_block: written %d bytes of XML to %s\n", +- size, im->filename ); ++ printf("vips__write_extension_block: written %d bytes of XML to %s\n", ++ size, im->filename); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + /* Append a string to a buffer, but escape " as \". + */ + static void +-target_write_quotes( VipsTarget *target, const char *str ) ++target_write_quotes(VipsTarget *target, const char *str) + { + const char *p; + size_t len; + +- for( p = str; *p; p += len ) { +- len = strcspn( p, "\"" ); ++ for (p = str; *p; p += len) { ++ len = strcspn(p, "\""); + +- vips_target_write( target, (unsigned char *) p, len ); +- if( p[len] == '"' ) +- vips_target_writes( target, "\\" ); ++ vips_target_write(target, (unsigned char *) p, len); ++ if (p[len] == '"') ++ vips_target_writes(target, "\\"); + } + } + + static void * +-build_xml_meta( VipsMeta *meta, VipsTarget *target, void *b ) ++build_xml_meta(VipsMeta *meta, VipsTarget *target, void *b) + { +- GType type = G_VALUE_TYPE( &meta->value ); ++ GType type = G_VALUE_TYPE(&meta->value); + + const char *str; + +- /* If we can transform to VIPS_TYPE_SAVE_STRING and back, we can save +- * and restore. ++ /* If we can transform to VIPS_TYPE_SAVE_STRING and back, we can save ++ * and restore. + */ +- if( g_value_type_transformable( type, VIPS_TYPE_SAVE_STRING ) && +- g_value_type_transformable( VIPS_TYPE_SAVE_STRING, type ) ) { ++ if (g_value_type_transformable(type, VIPS_TYPE_SAVE_STRING) && ++ g_value_type_transformable(VIPS_TYPE_SAVE_STRING, type)) { + GValue save_value = { 0 }; + +- g_value_init( &save_value, VIPS_TYPE_SAVE_STRING ); +- if( !g_value_transform( &meta->value, &save_value ) ) { +- vips_error( "VipsImage", "%s", +- _( "error transforming to save format" ) ); +- return( meta ); ++ g_value_init(&save_value, VIPS_TYPE_SAVE_STRING); ++ if (!g_value_transform(&meta->value, &save_value)) { ++ vips_error("VipsImage", "%s", ++ _("error transforming to save format")); ++ return (meta); + } + + /* We need to validate the str to make sure we'll be able to +- * read it back. ++ * read it back. + */ +- str = vips_value_get_save_string( &save_value ); +- if( g_utf8_validate( str, -1, NULL ) ) { +- vips_target_writef( target, +- " name ); +- vips_target_writes( target, "\">" ); +- vips_target_write_amp( target, str ); +- vips_target_writes( target, "\n" ); ++ str = vips_value_get_save_string(&save_value); ++ if (g_utf8_validate(str, -1, NULL)) { ++ vips_target_writef(target, ++ " name); ++ vips_target_writes(target, "\">"); ++ vips_target_write_amp(target, str); ++ vips_target_writes(target, "\n"); + } + +- g_value_unset( &save_value ); ++ g_value_unset(&save_value); + } + +- return( NULL ); ++ return (NULL); + } + + /* Make the xml we append to vips images after the pixel data. + */ + static char * +-build_xml( VipsImage *image ) ++build_xml(VipsImage *image) + { + VipsTarget *target; + const char *str; +@@ -870,85 +870,85 @@ build_xml( VipsImage *image ) + + target = vips_target_new_to_memory(); + +- vips_target_writef( target, "\n" ); +- vips_target_writef( target, "\n", +- NAMESPACE_URI, +- VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION, VIPS_MICRO_VERSION ); +- vips_target_writef( target, "
\n" ); +- +- str = vips_image_get_history( image ); +- if( g_utf8_validate( str, -1, NULL ) ) { +- vips_target_writef( target, +- " ", +- g_type_name( VIPS_TYPE_REF_STRING ) ); +- vips_target_write_amp( target, str ); +- vips_target_writef( target, "\n" ); ++ vips_target_writef(target, "\n"); ++ vips_target_writef(target, "\n", ++ NAMESPACE_URI, ++ VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION, VIPS_MICRO_VERSION); ++ vips_target_writef(target, "
\n"); ++ ++ str = vips_image_get_history(image); ++ if (g_utf8_validate(str, -1, NULL)) { ++ vips_target_writef(target, ++ " ", ++ g_type_name(VIPS_TYPE_REF_STRING)); ++ vips_target_write_amp(target, str); ++ vips_target_writef(target, "\n"); + } + +- vips_target_writef( target, "
\n" ); +- vips_target_writef( target, " \n" ); ++ vips_target_writef(target, "
\n"); ++ vips_target_writef(target, " \n"); + +- if( vips_slist_map2( image->meta_traverse, +- (VipsSListMap2Fn) build_xml_meta, target, NULL ) ) { +- VIPS_UNREF( target ); +- return( NULL ); ++ if (vips_slist_map2(image->meta_traverse, ++ (VipsSListMap2Fn) build_xml_meta, target, NULL)) { ++ VIPS_UNREF(target); ++ return (NULL); + } + +- vips_target_writef( target, " \n" ); +- vips_target_writef( target, "
\n" ); ++ vips_target_writef(target, " \n"); ++ vips_target_writef(target, "\n"); + +- result = vips_target_steal_text( target ); ++ result = vips_target_steal_text(target); + +- VIPS_UNREF( target ); ++ VIPS_UNREF(target); + +- return( result ); ++ return (result); + } + + static void * +-vips__xml_properties_meta( VipsImage *image, +- const char *field, GValue *value, void *a ) ++vips__xml_properties_meta(VipsImage *image, ++ const char *field, GValue *value, void *a) + { + VipsTarget *target = (VipsTarget *) a; +- GType type = G_VALUE_TYPE( value ); ++ GType type = G_VALUE_TYPE(value); + + const char *str; + +- /* If we can transform to VIPS_TYPE_SAVE_STRING and back, we can save +- * and restore. ++ /* If we can transform to VIPS_TYPE_SAVE_STRING and back, we can save ++ * and restore. + */ +- if( g_value_type_transformable( type, VIPS_TYPE_SAVE_STRING ) && +- g_value_type_transformable( VIPS_TYPE_SAVE_STRING, type ) ) { ++ if (g_value_type_transformable(type, VIPS_TYPE_SAVE_STRING) && ++ g_value_type_transformable(VIPS_TYPE_SAVE_STRING, type)) { + GValue save_value = { 0 }; + +- g_value_init( &save_value, VIPS_TYPE_SAVE_STRING ); +- if( !g_value_transform( value, &save_value ) ) { +- vips_error( "VipsImage", "%s", +- _( "error transforming to save format" ) ); +- return( target ); ++ g_value_init(&save_value, VIPS_TYPE_SAVE_STRING); ++ if (!g_value_transform(value, &save_value)) { ++ vips_error("VipsImage", "%s", ++ _("error transforming to save format")); ++ return (target); + } +- str = vips_value_get_save_string( &save_value ); +- +- vips_target_writef( target, " \n" ); +- vips_target_writef( target, " " ); +- vips_target_write_amp( target, field ); +- vips_target_writef( target, "\n" ); +- vips_target_writef( target, " ", +- g_type_name( type ) ); +- vips_target_write_amp( target, str ); +- vips_target_writef( target, "\n" ); +- vips_target_writef( target, " \n" ); +- +- g_value_unset( &save_value ); ++ str = vips_value_get_save_string(&save_value); ++ ++ vips_target_writef(target, " \n"); ++ vips_target_writef(target, " "); ++ vips_target_write_amp(target, field); ++ vips_target_writef(target, "\n"); ++ vips_target_writef(target, " ", ++ g_type_name(type)); ++ vips_target_write_amp(target, str); ++ vips_target_writef(target, "\n"); ++ vips_target_writef(target, " \n"); ++ ++ g_value_unset(&save_value); + } + +- return( NULL ); ++ return (NULL); + } + + /* Make the xml we write to vips-properties in dzsave, or to TIFF. A simple + * dump of all vips metadata. Free with g_free(). + */ + char * +-vips__xml_properties( VipsImage *image ) ++vips__xml_properties(VipsImage *image) + { + VipsTarget *target; + char *date; +@@ -957,62 +957,62 @@ vips__xml_properties( VipsImage *image ) + date = vips__get_iso8601(); + + target = vips_target_new_to_memory(); +- vips_target_writef( target, "\n" ); +- vips_target_writef( target, "\n", +- NAMESPACE_URI, +- date, +- VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION, VIPS_MICRO_VERSION ); +- vips_target_writef( target, " \n" ); +- +- g_free( date ); +- +- if( vips_image_map( image, vips__xml_properties_meta, target ) ) { +- VIPS_UNREF( target ); +- return( NULL ); ++ vips_target_writef(target, "\n"); ++ vips_target_writef(target, "\n", ++ NAMESPACE_URI, ++ date, ++ VIPS_MAJOR_VERSION, VIPS_MINOR_VERSION, VIPS_MICRO_VERSION); ++ vips_target_writef(target, " \n"); ++ ++ g_free(date); ++ ++ if (vips_image_map(image, vips__xml_properties_meta, target)) { ++ VIPS_UNREF(target); ++ return (NULL); + } + +- vips_target_writef( target, " \n" ); +- vips_target_writef( target, "\n" ); ++ vips_target_writef(target, " \n"); ++ vips_target_writef(target, "\n"); + +- result = vips_target_steal_text( target ); ++ result = vips_target_steal_text(target); + +- VIPS_UNREF( target ); ++ VIPS_UNREF(target); + +- return( result ); ++ return (result); + } + + /* Append XML to output fd. + */ +-int +-vips__writehist( VipsImage *image ) ++int ++vips__writehist(VipsImage *image) + { + char *xml; + +- assert( image->dtype == VIPS_IMAGE_OPENOUT ); +- assert( image->fd != -1 ); ++ assert(image->dtype == VIPS_IMAGE_OPENOUT); ++ assert(image->fd != -1); + +- if( !(xml = build_xml( image )) ) +- return( -1 ); ++ if (!(xml = build_xml(image))) ++ return (-1); + +- if( vips__write_extension_block( image, xml, strlen( xml ) ) ) { +- g_free( xml ); +- return( -1 ); +- } ++ if (vips__write_extension_block(image, xml, strlen(xml))) { ++ g_free(xml); ++ return (-1); ++ } + + #ifdef DEBUG +- printf( "vips__writehist: saved XML is: \"%s\"\n", xml ); ++ printf("vips__writehist: saved XML is: \"%s\"\n", xml); + #endif /*DEBUG*/ + +- g_free( xml ); ++ g_free(xml); + +- return( 0 ); ++ return (0); + } + + /* Open the filename, read the header, some sanity checking. + */ + int +-vips_image_open_input( VipsImage *image ) ++vips_image_open_input(VipsImage *image) + { + /* We don't use im->sizeof_header here, but we know we're reading a + * VIPS image anyway. +@@ -1026,33 +1026,33 @@ vips_image_open_input( VipsImage *image ) + + /* We may have an fd already, see vips_image_rewind_output(). + */ +- if( image->fd == -1 ) { +- image->fd = vips__open_image_read( image->filename ); +- if( image->fd == -1 ) +- return( -1 ); ++ if (image->fd == -1) { ++ image->fd = vips__open_image_read(image->filename); ++ if (image->fd == -1) ++ return (-1); + } + +- vips__seek( image->fd, 0, SEEK_SET ); +- if( read( image->fd, header, VIPS_SIZEOF_HEADER ) != +- VIPS_SIZEOF_HEADER || +- vips__read_header_bytes( image, header ) ) { +- vips_error_system( errno, "VipsImage", +- _( "unable to read header for \"%s\"" ), +- image->filename ); +- return( -1 ); ++ vips__seek(image->fd, 0, SEEK_SET); ++ if (read(image->fd, header, VIPS_SIZEOF_HEADER) != ++ VIPS_SIZEOF_HEADER || ++ vips__read_header_bytes(image, header)) { ++ vips_error_system(errno, "VipsImage", ++ _("unable to read header for \"%s\""), ++ image->filename); ++ return (-1); + } + + /* Predict and check the file size. Only issue a warning, we want to be + * able to read all the header fields we can, even if the actual data +- * isn't there. ++ * isn't there. + */ +- psize = image_pixel_length( image ); +- if( (rsize = vips_file_length( image->fd )) == -1 ) +- return( -1 ); ++ psize = image_pixel_length(image); ++ if ((rsize = vips_file_length(image->fd)) == -1) ++ return (-1); + image->file_length = rsize; +- if( psize > rsize ) +- g_warning( _( "unable to read data for \"%s\", %s" ), +- image->filename, _( "file has been truncated" ) ); ++ if (psize > rsize) ++ g_warning(_("unable to read data for \"%s\", %s"), ++ image->filename, _("file has been truncated")); + + /* Set demand style. This suits a disc file we read sequentially. + */ +@@ -1062,38 +1062,37 @@ vips_image_open_input( VipsImage *image ) + * fails (due to eg. corrupted XML) because it's probably mostly + * harmless. + */ +- if( readhist( image ) ) { +- g_warning( _( "error reading vips image metadata: %s" ), +- vips_error_buffer() ); ++ if (readhist(image)) { ++ g_warning(_("error reading vips image metadata: %s"), ++ vips_error_buffer()); + vips_error_clear(); + } + +- return( 0 ); ++ return (0); + } + +-int +-vips_image_open_output( VipsImage *image ) ++int ++vips_image_open_output(VipsImage *image) + { +- if( image->fd == -1 ) { +- /* Don't use im->sizeof_header here, but we know we're ++ if (image->fd == -1) { ++ /* Don't use im->sizeof_header here, but we know we're + * writing a VIPS image anyway. + */ + unsigned char header[VIPS_SIZEOF_HEADER]; + +- if( (image->fd = vips__open_image_write( image->filename, +- image->delete_on_close )) < 0 ) +- return( -1 ); ++ if ((image->fd = vips__open_image_write(image->filename, ++ image->delete_on_close)) < 0) ++ return (-1); + + /* We always write in native mode, so we must overwrite the + * magic we read from the file originally. + */ +- image->magic = vips_amiMSBfirst() ? +- VIPS_MAGIC_SPARC : VIPS_MAGIC_INTEL; ++ image->magic = vips_amiMSBfirst() ? VIPS_MAGIC_SPARC : VIPS_MAGIC_INTEL; + +- if( vips__write_header_bytes( image, header ) || +- vips__write( image->fd, header, VIPS_SIZEOF_HEADER ) ) +- return( -1 ); ++ if (vips__write_header_bytes(image, header) || ++ vips__write(image->fd, header, VIPS_SIZEOF_HEADER)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/iofuncs/window.c b/libvips/iofuncs/window.c +index f33c707b28..fae987c0cf 100644 +--- a/libvips/iofuncs/window.c ++++ b/libvips/iofuncs/window.c +@@ -1,5 +1,5 @@ + /* Manage sets of mmap buffers on an image. +- * ++ * + * 30/10/06 + * - from region.c + * 19/3/09 +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -84,19 +84,19 @@ static int max_mmap_usage = 0; + #endif /*DEBUG_TOTAL*/ + + static int +-vips_window_unmap( VipsWindow *window ) ++vips_window_unmap(VipsWindow *window) + { + /* unmap the old window + */ +- if( window->baseaddr ) { +- if( vips__munmap( window->baseaddr, window->length ) ) +- return( -1 ); ++ if (window->baseaddr) { ++ if (vips__munmap(window->baseaddr, window->length)) ++ return (-1); + + #ifdef DEBUG_TOTAL +- g_mutex_lock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); + total_mmap_usage -= window->length; +- g_assert( total_mmap_usage >= 0 ); +- g_mutex_unlock( vips__global_lock ); ++ g_assert(total_mmap_usage >= 0); ++ g_mutex_unlock(vips__global_lock); + #endif /*DEBUG_TOTAL*/ + + window->data = NULL; +@@ -104,113 +104,113 @@ vips_window_unmap( VipsWindow *window ) + window->length = 0; + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_window_free( VipsWindow *window ) ++vips_window_free(VipsWindow *window) + { + VipsImage *im = window->im; + +- g_assert( window->ref_count == 0 ); ++ g_assert(window->ref_count == 0); + + #ifdef DEBUG +- printf( "** vips_window_free: window top = %d, height = %d (%p)\n", +- window->top, window->height, window ); +- printf( "vips_window_unref: %d windows left\n", +- g_slist_length( im->windows ) ); ++ printf("** vips_window_free: window top = %d, height = %d (%p)\n", ++ window->top, window->height, window); ++ printf("vips_window_unref: %d windows left\n", ++ g_slist_length(im->windows)); + #endif /*DEBUG*/ + +- g_assert( g_slist_find( im->windows, window ) ); +- im->windows = g_slist_remove( im->windows, window ); ++ g_assert(g_slist_find(im->windows, window)); ++ im->windows = g_slist_remove(im->windows, window); + +- if( vips_window_unmap( window ) ) +- return( -1 ); ++ if (vips_window_unmap(window)) ++ return (-1); + + window->im = NULL; + +- g_free( window ); ++ g_free(window); + +- return( 0 ); ++ return (0); + } + + int +-vips_window_unref( VipsWindow *window ) ++vips_window_unref(VipsWindow *window) + { + VipsImage *im = window->im; + +- g_mutex_lock( im->sslock ); ++ g_mutex_lock(im->sslock); + + #ifdef DEBUG +- printf( "vips_window_unref: window top = %d, height = %d, count = %d\n", +- window->top, window->height, window->ref_count ); ++ printf("vips_window_unref: window top = %d, height = %d, count = %d\n", ++ window->top, window->height, window->ref_count); + #endif /*DEBUG*/ + +- g_assert( window->ref_count > 0 ); ++ g_assert(window->ref_count > 0); + + window->ref_count -= 1; + +- if( window->ref_count == 0 ) { +- if( vips_window_free( window ) ) { +- g_mutex_unlock( im->sslock ); +- return( -1 ); ++ if (window->ref_count == 0) { ++ if (vips_window_free(window)) { ++ g_mutex_unlock(im->sslock); ++ return (-1); + } + } + +- g_mutex_unlock( im->sslock ); ++ g_mutex_unlock(im->sslock); + +- return( 0 ); ++ return (0); + } + + #ifdef DEBUG_TOTAL + static void +-trace_mmap_usage( void ) ++trace_mmap_usage(void) + { +- g_mutex_lock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); + { + static int last_total = 0; + int total = total_mmap_usage / (1024 * 1024); + int max = max_mmap_usage / (1024 * 1024); + +- if( total != last_total ) { +- printf( "vips_window_set: current mmap " +- "usage of ~%dMB (high water mark %dMB)\n", +- total, max ); ++ if (total != last_total) { ++ printf("vips_window_set: current mmap " ++ "usage of ~%dMB (high water mark %dMB)\n", ++ total, max); + last_total = total; + } + } +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_unlock(vips__global_lock); + } + #endif /*DEBUG_TOTAL*/ + + static int +-vips_getpagesize( void ) ++vips_getpagesize(void) + { + static int pagesize = 0; + +- if( !pagesize ) { ++ if (!pagesize) { + #ifdef G_OS_WIN32 + SYSTEM_INFO si; + +- GetSystemInfo( &si ); ++ GetSystemInfo(&si); + + pagesize = si.dwAllocationGranularity; +-#else /*!G_OS_WIN32*/ ++#else /*!G_OS_WIN32*/ + pagesize = sysconf(_SC_PAGESIZE); + #endif /*G_OS_WIN32*/ + + #ifdef DEBUG_TOTAL +- printf( "vips_getpagesize: 0x%x\n", pagesize ); ++ printf("vips_getpagesize: 0x%x\n", pagesize); + #endif /*DEBUG_TOTAL*/ + } + +- return( pagesize ); ++ return (pagesize); + } + + /* Map a window into a file. + */ + static int +-vips_window_set( VipsWindow *window, int top, int height ) ++vips_window_set(VipsWindow *window, int top, int height) + { + int pagesize = vips_getpagesize(); + +@@ -218,11 +218,11 @@ vips_window_set( VipsWindow *window, int top, int height ) + gint64 start, end, pagestart; + size_t length, pagelength; + +- /* Calculate start and length for our window. ++ /* Calculate start and length for our window. + */ +- start = window->im->sizeof_header + +- VIPS_IMAGE_SIZEOF_LINE( window->im ) * top; +- length = VIPS_IMAGE_SIZEOF_LINE( window->im ) * height; ++ start = window->im->sizeof_header + ++ VIPS_IMAGE_SIZEOF_LINE(window->im) * top; ++ length = VIPS_IMAGE_SIZEOF_LINE(window->im) * height; + + pagestart = start - start % pagesize; + end = start + length; +@@ -230,19 +230,19 @@ vips_window_set( VipsWindow *window, int top, int height ) + + /* Make sure we have enough file. + */ +- if( end > window->im->file_length ) { +- vips_error( "vips_window_set", +- _( "unable to read data for \"%s\", %s" ), +- window->im->filename, _( "file has been truncated" ) ); +- return( -1 ); ++ if (end > window->im->file_length) { ++ vips_error("vips_window_set", ++ _("unable to read data for \"%s\", %s"), ++ window->im->filename, _("file has been truncated")); ++ return (-1); + } + +- if( vips_window_unmap( window ) ) +- return( -1 ); ++ if (vips_window_unmap(window)) ++ return (-1); + +- if( !(baseaddr = vips__mmap( window->im->fd, +- 0, pagelength, pagestart )) ) +- return( -1 ); ++ if (!(baseaddr = vips__mmap(window->im->fd, ++ 0, pagelength, pagestart))) ++ return (-1); + + window->baseaddr = baseaddr; + window->length = pagelength; +@@ -256,26 +256,26 @@ vips_window_set( VipsWindow *window, int top, int height ) + vips__read_test &= window->data[0]; + + #ifdef DEBUG_TOTAL +- g_mutex_lock( vips__global_lock ); ++ g_mutex_lock(vips__global_lock); + total_mmap_usage += window->length; +- if( total_mmap_usage > max_mmap_usage ) ++ if (total_mmap_usage > max_mmap_usage) + max_mmap_usage = total_mmap_usage; +- g_mutex_unlock( vips__global_lock ); ++ g_mutex_unlock(vips__global_lock); + trace_mmap_usage(); + #endif /*DEBUG_TOTAL*/ + +- return( 0 ); ++ return (0); + } + + /* Make a new window. + */ + static VipsWindow * +-vips_window_new( VipsImage *im, int top, int height ) ++vips_window_new(VipsImage *im, int top, int height) + { + VipsWindow *window; + +- if( !(window = VIPS_NEW( NULL, VipsWindow )) ) +- return( NULL ); ++ if (!(window = VIPS_NEW(NULL, VipsWindow))) ++ return (NULL); + + window->ref_count = 0; + window->im = im; +@@ -284,20 +284,20 @@ vips_window_new( VipsImage *im, int top, int height ) + window->data = NULL; + window->baseaddr = NULL; + window->length = 0; +- im->windows = g_slist_prepend( im->windows, window ); ++ im->windows = g_slist_prepend(im->windows, window); + +- if( vips_window_set( window, top, height ) ) { +- vips_window_free( window ); +- return( NULL ); ++ if (vips_window_set(window, top, height)) { ++ vips_window_free(window); ++ return (NULL); + } + window->ref_count = 1; + + #ifdef DEBUG +- printf( "** vips_window_new: window top = %d, height = %d (%p)\n", +- window->top, window->height, window ); ++ printf("** vips_window_new: window top = %d, height = %d (%p)\n", ++ window->top, window->height, window); + #endif /*DEBUG*/ + +- return( window ); ++ return (window); + } + + /* A request for an area of pixels. +@@ -308,115 +308,115 @@ typedef struct { + } request_t; + + static void * +-vips_window_fits( VipsWindow *window, request_t *req, void *b ) ++vips_window_fits(VipsWindow *window, request_t *req, void *b) + { +- if( window->top <= req->top && +- window->top + window->height >= req->top + req->height ) +- return( window ); ++ if (window->top <= req->top && ++ window->top + window->height >= req->top + req->height) ++ return (window); + +- return( NULL ); ++ return (NULL); + } + + /* Find an existing window that fits within top/height and return a ref. + */ + static VipsWindow * +-vips_window_find( VipsImage *im, int top, int height ) ++vips_window_find(VipsImage *im, int top, int height) + { + request_t req; + VipsWindow *window; + + req.top = top; + req.height = height; +- window = vips_slist_map2( im->windows, +- (VipsSListMap2Fn) vips_window_fits, &req, NULL ); ++ window = vips_slist_map2(im->windows, ++ (VipsSListMap2Fn) vips_window_fits, &req, NULL); + +- if( window ) { ++ if (window) { + window->ref_count += 1; + + #ifdef DEBUG +- printf( "vips_window_find: ref window top = %d, height = %d, " +- "count = %d\n", +- top, height, window->ref_count ); ++ printf("vips_window_find: ref window top = %d, height = %d, " ++ "count = %d\n", ++ top, height, window->ref_count); + #endif /*DEBUG*/ + } + +- return( window ); ++ return (window); + } + +-/* Update a window to make it enclose top/height. ++/* Update a window to make it enclose top/height. + */ + VipsWindow * +-vips_window_take( VipsWindow *window, VipsImage *im, int top, int height ) ++vips_window_take(VipsWindow *window, VipsImage *im, int top, int height) + { + int margin; + + /* We have a window and it has the pixels we need. + */ +- if( window && ++ if (window && + window->top <= top && +- window->top + window->height >= top + height ) +- return( window ); ++ window->top + window->height >= top + height) ++ return (window); + +- g_mutex_lock( im->sslock ); ++ g_mutex_lock(im->sslock); + + /* We have a window and we are the only ref to it ... scroll. + */ +- if( window && +- window->ref_count == 1 ) { +- if( vips_window_set( window, top, height ) ) { +- g_mutex_unlock( im->sslock ); +- vips_window_unref( window ); ++ if (window && ++ window->ref_count == 1) { ++ if (vips_window_set(window, top, height)) { ++ g_mutex_unlock(im->sslock); ++ vips_window_unref(window); + +- return( NULL ); ++ return (NULL); + } + +- g_mutex_unlock( im->sslock ); ++ g_mutex_unlock(im->sslock); + +- return( window ); ++ return (window); + } + + /* There's more than one ref to the window. We can just decrement. + * Don't call _unref, since we've inside the lock. + */ +- if( window ) ++ if (window) + window->ref_count -= 1; + + /* Is there an existing window we can reuse? + */ +- if( (window = vips_window_find( im, top, height )) ) { +- g_mutex_unlock( im->sslock ); ++ if ((window = vips_window_find(im, top, height))) { ++ g_mutex_unlock(im->sslock); + +- return( window ); ++ return (window); + } + +- /* We have to make a new window. Make it a bit bigger than strictly ++ /* We have to make a new window. Make it a bit bigger than strictly + * necessary. + */ +- margin = VIPS_MIN( vips__window_margin_pixels, +- vips__window_margin_bytes / VIPS_IMAGE_SIZEOF_LINE( im ) ); ++ margin = VIPS_MIN(vips__window_margin_pixels, ++ vips__window_margin_bytes / VIPS_IMAGE_SIZEOF_LINE(im)); + top -= margin; + height += margin * 2; +- top = VIPS_CLIP( 0, top, im->Ysize - 1 ); +- height = VIPS_CLIP( 0, height, im->Ysize - top ); ++ top = VIPS_CLIP(0, top, im->Ysize - 1); ++ height = VIPS_CLIP(0, height, im->Ysize - top); + +- if( !(window = vips_window_new( im, top, height )) ) { +- g_mutex_unlock( im->sslock ); +- return( NULL ); ++ if (!(window = vips_window_new(im, top, height))) { ++ g_mutex_unlock(im->sslock); ++ return (NULL); + } + +- g_mutex_unlock( im->sslock ); ++ g_mutex_unlock(im->sslock); + +- return( window ); ++ return (window); + } + + void +-vips_window_print( VipsWindow *window ) ++vips_window_print(VipsWindow *window) + { +- printf( "VipsWindow: %p ref_count = %d, ", window, window->ref_count ); +- printf( "im = %p, ", window->im ); +- printf( "top = %d, ", window->top ); +- printf( "height = %d, ", window->height ); +- printf( "data = %p, ", window->data ); +- printf( "baseaddr = %p, ", window->baseaddr ); +- printf( "length = %zd\n", window->length ); ++ printf("VipsWindow: %p ref_count = %d, ", window, window->ref_count); ++ printf("im = %p, ", window->im); ++ printf("top = %d, ", window->top); ++ printf("height = %d, ", window->height); ++ printf("data = %p, ", window->data); ++ printf("baseaddr = %p, ", window->baseaddr); ++ printf("length = %zd\n", window->length); + } +diff --git a/libvips/module/heif.c b/libvips/module/heif.c +index d9ae01061b..6c75378a06 100644 +--- a/libvips/module/heif.c ++++ b/libvips/module/heif.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -52,34 +52,34 @@ + /* This is called on module load. + */ + G_MODULE_EXPORT const gchar * +-g_module_check_init( GModule *module ) ++g_module_check_init(GModule *module) + { + #ifdef DEBUG +- printf( "vips_heif: module init\n" ); ++ printf("vips_heif: module init\n"); + #endif /*DEBUG*/ + +- extern GType vips_foreign_load_heif_file_get_type( void ); +- extern GType vips_foreign_load_heif_buffer_get_type( void ); +- extern GType vips_foreign_load_heif_source_get_type( void ); +- extern GType vips_foreign_save_heif_file_get_type( void ); +- extern GType vips_foreign_save_heif_buffer_get_type( void ); +- extern GType vips_foreign_save_heif_target_get_type( void ); +- extern GType vips_foreign_save_avif_target_get_type( void ); ++ extern GType vips_foreign_load_heif_file_get_type(void); ++ extern GType vips_foreign_load_heif_buffer_get_type(void); ++ extern GType vips_foreign_load_heif_source_get_type(void); ++ extern GType vips_foreign_save_heif_file_get_type(void); ++ extern GType vips_foreign_save_heif_buffer_get_type(void); ++ extern GType vips_foreign_save_heif_target_get_type(void); ++ extern GType vips_foreign_save_avif_target_get_type(void); + + #ifdef HAVE_HEIF_DECODER +- vips_foreign_load_heif_file_get_type(); +- vips_foreign_load_heif_buffer_get_type(); +- vips_foreign_load_heif_source_get_type(); ++ vips_foreign_load_heif_file_get_type(); ++ vips_foreign_load_heif_buffer_get_type(); ++ vips_foreign_load_heif_source_get_type(); + #endif /*HAVE_HEIF_DECODER*/ + + #ifdef HAVE_HEIF_ENCODER +- vips_foreign_save_heif_file_get_type(); +- vips_foreign_save_heif_buffer_get_type(); +- vips_foreign_save_heif_target_get_type(); +- vips_foreign_save_avif_target_get_type(); ++ vips_foreign_save_heif_file_get_type(); ++ vips_foreign_save_heif_buffer_get_type(); ++ vips_foreign_save_heif_target_get_type(); ++ vips_foreign_save_avif_target_get_type(); + #endif /*HAVE_HEIF_ENCODER*/ + +- return( NULL ); ++ return (NULL); + } + + #endif /*(defined(HAVE_HEIF_DECODER) || defined(HAVE_HEIF_ENCODER)) && defined(HEIF_MODULE)*/ +diff --git a/libvips/module/jxl.c b/libvips/module/jxl.c +index 74d6b45730..546e5bbda3 100644 +--- a/libvips/module/jxl.c ++++ b/libvips/module/jxl.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -52,27 +52,27 @@ + /* This is called on module load. + */ + G_MODULE_EXPORT const gchar * +-g_module_check_init( GModule *module ) ++g_module_check_init(GModule *module) + { + #ifdef DEBUG +- printf( "vips_jxl: module init\n" ); ++ printf("vips_jxl: module init\n"); + #endif /*DEBUG*/ + +- extern GType vips_foreign_load_jxl_file_get_type( void ); +- extern GType vips_foreign_load_jxl_buffer_get_type( void ); +- extern GType vips_foreign_load_jxl_source_get_type( void ); +- extern GType vips_foreign_save_jxl_file_get_type( void ); +- extern GType vips_foreign_save_jxl_buffer_get_type( void ); +- extern GType vips_foreign_save_jxl_target_get_type( void ); +- +- vips_foreign_load_jxl_file_get_type(); +- vips_foreign_load_jxl_buffer_get_type(); +- vips_foreign_load_jxl_source_get_type(); +- vips_foreign_save_jxl_file_get_type(); +- vips_foreign_save_jxl_buffer_get_type(); +- vips_foreign_save_jxl_target_get_type(); +- +- return( NULL ); ++ extern GType vips_foreign_load_jxl_file_get_type(void); ++ extern GType vips_foreign_load_jxl_buffer_get_type(void); ++ extern GType vips_foreign_load_jxl_source_get_type(void); ++ extern GType vips_foreign_save_jxl_file_get_type(void); ++ extern GType vips_foreign_save_jxl_buffer_get_type(void); ++ extern GType vips_foreign_save_jxl_target_get_type(void); ++ ++ vips_foreign_load_jxl_file_get_type(); ++ vips_foreign_load_jxl_buffer_get_type(); ++ vips_foreign_load_jxl_source_get_type(); ++ vips_foreign_save_jxl_file_get_type(); ++ vips_foreign_save_jxl_buffer_get_type(); ++ vips_foreign_save_jxl_target_get_type(); ++ ++ return (NULL); + } + + #endif /*defined(HAVE_LIBJXL) && defined(LIBJXL_MODULE)*/ +diff --git a/libvips/module/magick.c b/libvips/module/magick.c +index c7fd7e4838..7cbe5d17ce 100644 +--- a/libvips/module/magick.c ++++ b/libvips/module/magick.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -47,25 +47,25 @@ + #include + #include + +-#if (defined(HAVE_MAGICK6) || defined (HAVE_MAGICK7)) && defined(MAGICK_MODULE) ++#if (defined(HAVE_MAGICK6) || defined(HAVE_MAGICK7)) && defined(MAGICK_MODULE) + + /* This is called on module load. + */ + G_MODULE_EXPORT const gchar * +-g_module_check_init( GModule *module ) ++g_module_check_init(GModule *module) + { + #ifdef DEBUG +- printf( "vips_magick: module init\n" ); ++ printf("vips_magick: module init\n"); + #endif /*DEBUG*/ + +- extern GType vips_foreign_load_magick_file_get_type( void ); +- extern GType vips_foreign_load_magick_buffer_get_type( void ); +- extern GType vips_foreign_load_magick7_file_get_type( void ); +- extern GType vips_foreign_load_magick7_buffer_get_type( void ); +- extern GType vips_foreign_save_magick_file_get_type( void ); +- extern GType vips_foreign_save_magick_bmp_file_get_type( void ); +- extern GType vips_foreign_save_magick_buffer_get_type( void ); +- extern GType vips_foreign_save_magick_bmp_buffer_get_type( void ); ++ extern GType vips_foreign_load_magick_file_get_type(void); ++ extern GType vips_foreign_load_magick_buffer_get_type(void); ++ extern GType vips_foreign_load_magick7_file_get_type(void); ++ extern GType vips_foreign_load_magick7_buffer_get_type(void); ++ extern GType vips_foreign_save_magick_file_get_type(void); ++ extern GType vips_foreign_save_magick_bmp_file_get_type(void); ++ extern GType vips_foreign_save_magick_buffer_get_type(void); ++ extern GType vips_foreign_save_magick_bmp_buffer_get_type(void); + + #ifdef ENABLE_MAGICKLOAD + #ifdef HAVE_MAGICK6 +@@ -86,7 +86,7 @@ g_module_check_init( GModule *module ) + vips_foreign_save_magick_bmp_buffer_get_type(); + #endif /*ENABLE_MAGICKSAVE*/ + +- return( NULL ); ++ return (NULL); + } + + #endif /*(defined(HAVE_MAGICK6) || defined (HAVE_MAGICK7)) && defined(MAGICK_MODULE)*/ +diff --git a/libvips/module/openslide.c b/libvips/module/openslide.c +index 0321c1cdfa..cff765d772 100644 +--- a/libvips/module/openslide.c ++++ b/libvips/module/openslide.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -52,19 +52,19 @@ + /* This is called on module load. + */ + G_MODULE_EXPORT const gchar * +-g_module_check_init( GModule *module ) ++g_module_check_init(GModule *module) + { + #ifdef DEBUG +- printf( "vips_openslide: module init\n" ); ++ printf("vips_openslide: module init\n"); + #endif /*DEBUG*/ + +- extern GType vips_foreign_load_openslide_file_get_type( void ); +- extern GType vips_foreign_load_openslide_source_get_type( void ); ++ extern GType vips_foreign_load_openslide_file_get_type(void); ++ extern GType vips_foreign_load_openslide_source_get_type(void); + + vips_foreign_load_openslide_file_get_type(); + vips_foreign_load_openslide_source_get_type(); + +- return( NULL ); ++ return (NULL); + } + + #endif /*defined(HAVE_OPENSLIDE) && defined(OPENSLIDE_MODULE)*/ +diff --git a/libvips/module/poppler.c b/libvips/module/poppler.c +index d794bc3928..b79e05e8e5 100644 +--- a/libvips/module/poppler.c ++++ b/libvips/module/poppler.c +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -52,21 +52,21 @@ + /* This is called on module load. + */ + G_MODULE_EXPORT const gchar * +-g_module_check_init( GModule *module ) ++g_module_check_init(GModule *module) + { + #ifdef DEBUG +- printf( "vips_poppler: module init\n" ); ++ printf("vips_poppler: module init\n"); + #endif /*DEBUG*/ + +- extern GType vips_foreign_load_pdf_file_get_type( void ); +- extern GType vips_foreign_load_pdf_buffer_get_type( void ); +- extern GType vips_foreign_load_pdf_source_get_type( void ); ++ extern GType vips_foreign_load_pdf_file_get_type(void); ++ extern GType vips_foreign_load_pdf_buffer_get_type(void); ++ extern GType vips_foreign_load_pdf_source_get_type(void); + +- vips_foreign_load_pdf_file_get_type(); +- vips_foreign_load_pdf_buffer_get_type(); +- vips_foreign_load_pdf_source_get_type(); ++ vips_foreign_load_pdf_file_get_type(); ++ vips_foreign_load_pdf_buffer_get_type(); ++ vips_foreign_load_pdf_source_get_type(); + +- return( NULL ); ++ return (NULL); + } + + #endif /*defined(HAVE_POPPLER) && defined(POPPLER_MODULE)*/ +diff --git a/libvips/morphology/countlines.c b/libvips/morphology/countlines.c +index 2e1f59fb5a..fd85fca20f 100644 +--- a/libvips/morphology/countlines.c ++++ b/libvips/morphology/countlines.c +@@ -1,10 +1,10 @@ +-/* count lines ++/* count lines + * + * Copyright: 1990, N. Dessipris. + * + * Author: Nicos Dessipris + * Written on: 02/05/1990 +- * Modified on : ++ * Modified on : + * + * 19/9/95 JC + * - tidied up +@@ -16,28 +16,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -69,90 +69,89 @@ typedef struct _VipsCountlines { + + typedef VipsMorphologyClass VipsCountlinesClass; + +-G_DEFINE_TYPE( VipsCountlines, vips_countlines, VIPS_TYPE_MORPHOLOGY ); ++G_DEFINE_TYPE(VipsCountlines, vips_countlines, VIPS_TYPE_MORPHOLOGY); + + static int +-vips_countlines_build( VipsObject *object ) ++vips_countlines_build(VipsObject *object) + { +- VipsMorphology *morphology = VIPS_MORPHOLOGY( object ); ++ VipsMorphology *morphology = VIPS_MORPHOLOGY(object); + VipsCountlines *countlines = (VipsCountlines *) object; + VipsImage *in = morphology->in; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 7 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 7); + + double nolines; + +- if( VIPS_OBJECT_CLASS( vips_countlines_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_countlines_parent_class)->build(object)) ++ return (-1); + + /* Compiler warnings. + */ + nolines = 1; + +- switch( countlines->direction ) { ++ switch (countlines->direction) { + case VIPS_DIRECTION_HORIZONTAL: +- if( !(t[0] = vips_image_new_matrixv( 1, 2, -1.0, 1.0 )) || +- vips_moreeq_const1( in, &t[1], 128, NULL ) || +- vips_conv( t[1], &t[2], t[0], ++ if (!(t[0] = vips_image_new_matrixv(1, 2, -1.0, 1.0)) || ++ vips_moreeq_const1(in, &t[1], 128, NULL) || ++ vips_conv(t[1], &t[2], t[0], + "precision", VIPS_PRECISION_INTEGER, +- NULL ) || +- vips_project( t[2], &t[3], &t[4], NULL ) || +- vips_avg( t[3], &nolines, NULL ) ) +- return( -1 ); ++ NULL) || ++ vips_project(t[2], &t[3], &t[4], NULL) || ++ vips_avg(t[3], &nolines, NULL)) ++ return (-1); + break; + + case VIPS_DIRECTION_VERTICAL: +- if( !(t[0] = vips_image_new_matrixv( 2, 1, -1.0, 1.0 )) || +- vips_moreeq_const1( in, &t[1], 128, NULL ) || +- vips_conv( t[1], &t[2], t[0], ++ if (!(t[0] = vips_image_new_matrixv(2, 1, -1.0, 1.0)) || ++ vips_moreeq_const1(in, &t[1], 128, NULL) || ++ vips_conv(t[1], &t[2], t[0], + "precision", VIPS_PRECISION_INTEGER, +- NULL ) || +- vips_project( t[2], &t[3], &t[4], NULL ) || +- vips_avg( t[4], &nolines, NULL ) ) +- return( -1 ); ++ NULL) || ++ vips_project(t[2], &t[3], &t[4], NULL) || ++ vips_avg(t[4], &nolines, NULL)) ++ return (-1); + break; + + default: + g_assert_not_reached(); + } + +- g_object_set( object, "nolines", nolines / 255.0, NULL ); ++ g_object_set(object, "nolines", nolines / 255.0, NULL); + +- return( 0 ); ++ return (0); + } + + static void +-vips_countlines_class_init( VipsCountlinesClass *class ) ++vips_countlines_class_init(VipsCountlinesClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_countlines_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_countlines_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "countlines"; +- vobject_class->description = _( "count lines in an image" ); ++ vobject_class->description = _("count lines in an image"); + vobject_class->build = vips_countlines_build; + +- VIPS_ARG_DOUBLE( class, "nolines", 2, +- _( "Nolines" ), +- _( "Number of lines" ), ++ VIPS_ARG_DOUBLE(class, "nolines", 2, ++ _("Nolines"), ++ _("Number of lines"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsCountlines, nolines ), +- 0, 10000000, 0.0 ); ++ G_STRUCT_OFFSET(VipsCountlines, nolines), ++ 0, 10000000, 0.0); + +- VIPS_ARG_ENUM( class, "direction", 3, +- _( "Direction" ), +- _( "Countlines left-right or up-down" ), ++ VIPS_ARG_ENUM(class, "direction", 3, ++ _("Direction"), ++ _("Countlines left-right or up-down"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsCountlines, direction ), +- VIPS_TYPE_DIRECTION, VIPS_DIRECTION_HORIZONTAL ); +- ++ G_STRUCT_OFFSET(VipsCountlines, direction), ++ VIPS_TYPE_DIRECTION, VIPS_DIRECTION_HORIZONTAL); + } + + static void +-vips_countlines_init( VipsCountlines *countlines ) ++vips_countlines_init(VipsCountlines *countlines) + { + } + +@@ -175,15 +174,15 @@ vips_countlines_init( VipsCountlines *countlines ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_countlines( VipsImage *in, double *nolines, +- VipsDirection direction, ... ) ++vips_countlines(VipsImage *in, double *nolines, ++ VipsDirection direction, ...) + { + va_list ap; + int result; + +- va_start( ap, direction ); +- result = vips_call_split( "countlines", ap, in, nolines, direction ); +- va_end( ap ); ++ va_start(ap, direction); ++ result = vips_call_split("countlines", ap, in, nolines, direction); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/morphology/labelregions.c b/libvips/morphology/labelregions.c +index 8b30ada65f..2f73760e1a 100644 +--- a/libvips/morphology/labelregions.c ++++ b/libvips/morphology/labelregions.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -49,50 +49,49 @@ typedef struct _VipsLabelregions { + VipsMorphology parent_instance; + + VipsImage *mask; +- int segments; ++ int segments; + } VipsLabelregions; + + typedef VipsMorphologyClass VipsLabelregionsClass; + +-G_DEFINE_TYPE( VipsLabelregions, vips_labelregions, VIPS_TYPE_MORPHOLOGY ); ++G_DEFINE_TYPE(VipsLabelregions, vips_labelregions, VIPS_TYPE_MORPHOLOGY); + + static int +-vips_labelregions_build( VipsObject *object ) ++vips_labelregions_build(VipsObject *object) + { +- VipsMorphology *morphology = VIPS_MORPHOLOGY( object ); ++ VipsMorphology *morphology = VIPS_MORPHOLOGY(object); + VipsImage *in = morphology->in; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + VipsImage *mask; + + int segments; + int *m; + int x, y; + +- if( VIPS_OBJECT_CLASS( vips_labelregions_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_labelregions_parent_class)->build(object)) ++ return (-1); + + /* Create the zero mask image in memory. + */ + mask = vips_image_new_memory(); +- g_object_set( object, ++ g_object_set(object, + "mask", mask, +- NULL ); +- if( vips_black( &t[0], in->Xsize, in->Ysize, NULL ) || +- vips_cast( t[0], &t[1], VIPS_FORMAT_INT, NULL ) || +- vips_image_write( t[1], mask ) ) +- return( -1 ); ++ NULL); ++ if (vips_black(&t[0], in->Xsize, in->Ysize, NULL) || ++ vips_cast(t[0], &t[1], VIPS_FORMAT_INT, NULL) || ++ vips_image_write(t[1], mask)) ++ return (-1); + + segments = 1; + m = (int *) mask->data; +- for( y = 0; y < mask->Ysize; y++ ) { +- for( x = 0; x < mask->Xsize; x++ ) { +- if( !m[x] ) { ++ for (y = 0; y < mask->Ysize; y++) { ++ for (x = 0; x < mask->Xsize; x++) { ++ if (!m[x]) { + /* Use a direct path for speed. + */ +- if( vips__draw_flood_direct( mask, in, +- segments, x, y ) ) +- return( -1 ); ++ if (vips__draw_flood_direct(mask, in, ++ segments, x, y)) ++ return (-1); + + segments += 1; + } +@@ -101,43 +100,42 @@ vips_labelregions_build( VipsObject *object ) + m += mask->Xsize; + } + +- g_object_set( object, ++ g_object_set(object, + "segments", segments, +- NULL ); ++ NULL); + +- return( 0 ); ++ return (0); + } + + static void +-vips_labelregions_class_init( VipsLabelregionsClass *class ) ++vips_labelregions_class_init(VipsLabelregionsClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "labelregions"; +- vobject_class->description = _( "label regions in an image" ); ++ vobject_class->description = _("label regions in an image"); + vobject_class->build = vips_labelregions_build; + +- VIPS_ARG_IMAGE( class, "mask", 2, +- _( "Mask" ), +- _( "Mask of region labels" ), ++ VIPS_ARG_IMAGE(class, "mask", 2, ++ _("Mask"), ++ _("Mask of region labels"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsLabelregions, mask ) ); ++ G_STRUCT_OFFSET(VipsLabelregions, mask)); + +- VIPS_ARG_INT( class, "segments", 3, +- _( "Segments" ), +- _( "Number of discrete contiguous regions" ), ++ VIPS_ARG_INT(class, "segments", 3, ++ _("Segments"), ++ _("Number of discrete contiguous regions"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsLabelregions, segments ), +- 0, 1000000000, 0 ); +- ++ G_STRUCT_OFFSET(VipsLabelregions, segments), ++ 0, 1000000000, 0); + } + + static void +-vips_labelregions_init( VipsLabelregions *labelregions ) ++vips_labelregions_init(VipsLabelregions *labelregions) + { + } + +@@ -171,14 +169,14 @@ vips_labelregions_init( VipsLabelregions *labelregions ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_labelregions( VipsImage *in, VipsImage **mask, ... ) ++vips_labelregions(VipsImage *in, VipsImage **mask, ...) + { + va_list ap; + int result; + +- va_start( ap, mask ); +- result = vips_call_split( "labelregions", ap, in, mask ); +- va_end( ap ); ++ va_start(ap, mask); ++ result = vips_call_split("labelregions", ap, in, mask); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/morphology/morph.c b/libvips/morphology/morph.c +index 14ca4ed95f..ddf9d2aa16 100644 +--- a/libvips/morphology/morph.c ++++ b/libvips/morphology/morph.c +@@ -4,7 +4,7 @@ + * - rewritten + * 6/7/99 JC + * - small tidies +- * 7/4/04 ++ * 7/4/04 + * - now uses im_embed() with edge stretching on the input, not + * the output + * - sets Xoffset / Yoffset +@@ -15,13 +15,13 @@ + * - start again from the Orc'd im_conv + * 29/10/10 + * - use VipsVector +- * - do erode as well ++ * - do erode as well + * 7/11/10 + * - gtk-doc + * - do (!=0) to make uchar, if we're not given uchar + * 28/6/13 + * - oops, fix !=0 code +- * 23/10/13 ++ * 23/10/13 + * - from vips_conv() + * 25/2/20 kleisauke + * - rewritten as a class +@@ -30,28 +30,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -77,25 +77,25 @@ + */ + #define MAX_PASS (10) + +-/* A pass with a vector. ++/* A pass with a vector. + */ + typedef struct { +- int first; /* The index of the first mask coff we use */ +- int last; /* The index of the last mask coff we use */ ++ int first; /* The index of the first mask coff we use */ ++ int last; /* The index of the last mask coff we use */ + +- int r; /* Set previous result in this var */ ++ int r; /* Set previous result in this var */ + +- /* The code we generate for this section of this mask. ++ /* The code we generate for this section of this mask. + */ + VipsVector *vector; + } Pass; + +-/** ++/** + * VipsOperationMorphology: + * @VIPS_OPERATION_MORPHOLOGY_ERODE: true if all set + * @VIPS_OPERATION_MORPHOLOGY_DILATE: true if one set + * +- * More like hit-miss, really. ++ * More like hit-miss, really. + * + * See also: vips_morph(). + */ +@@ -111,34 +111,34 @@ typedef struct { + */ + VipsImage *M; + +- int n_point; /* w * h for our matrix */ ++ int n_point; /* w * h for our matrix */ + +- int *coeff; /* Mask coefficients */ ++ int *coeff; /* Mask coefficients */ + + /* The passes we generate for this mask. + */ +- int n_pass; ++ int n_pass; + Pass pass[MAX_PASS]; + } VipsMorph; + + typedef VipsMorphologyClass VipsMorphClass; + +-G_DEFINE_TYPE( VipsMorph, vips_morph, VIPS_TYPE_MORPHOLOGY ); ++G_DEFINE_TYPE(VipsMorph, vips_morph, VIPS_TYPE_MORPHOLOGY); + + /* Our sequence value. + */ + typedef struct { + VipsMorph *morph; +- VipsRegion *ir; /* Input region */ ++ VipsRegion *ir; /* Input region */ + +- int *soff; /* Offsets we check for set */ +- int ss; /* ... and number we check for set */ +- int *coff; /* Offsets we check for clear */ +- int cs; /* ... and number we check for clear */ ++ int *soff; /* Offsets we check for set */ ++ int ss; /* ... and number we check for set */ ++ int *coff; /* Offsets we check for clear */ ++ int cs; /* ... and number we check for clear */ + +- int last_bpl; /* Avoid recalcing offsets, if we can */ ++ int last_bpl; /* Avoid recalcing offsets, if we can */ + +- /* In vector mode we need a pair of intermediate buffers to keep the ++ /* In vector mode we need a pair of intermediate buffers to keep the + * results of each pass in. + */ + void *t1; +@@ -146,57 +146,57 @@ typedef struct { + } VipsMorphSequence; + + static void +-vips_morph_compile_free( VipsMorph *morph ) ++vips_morph_compile_free(VipsMorph *morph) + { + int i; + +- for( i = 0; i < morph->n_pass; i++ ) +- VIPS_FREEF( vips_vector_free, morph->pass[i].vector ); ++ for (i = 0; i < morph->n_pass; i++) ++ VIPS_FREEF(vips_vector_free, morph->pass[i].vector); + morph->n_pass = 0; + } + + static void +-vips_morph_dispose( GObject *gobject ) ++vips_morph_dispose(GObject *gobject) + { + VipsMorph *morph = (VipsMorph *) gobject; + + #ifdef DEBUG +- printf( "vips_morph_dispose: " ); +- vips_object_print_name( VIPS_OBJECT( gobject ) ); +- printf( "\n" ); ++ printf("vips_morph_dispose: "); ++ vips_object_print_name(VIPS_OBJECT(gobject)); ++ printf("\n"); + #endif /*DEBUG*/ + +- vips_morph_compile_free( morph ); ++ vips_morph_compile_free(morph); + +- G_OBJECT_CLASS( vips_morph_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_morph_parent_class)->dispose(gobject); + } + + /* Free a sequence value. + */ + static int +-vips_morph_stop( void *vseq, void *a, void *b ) ++vips_morph_stop(void *vseq, void *a, void *b) + { + VipsMorphSequence *seq = (VipsMorphSequence *) vseq; + +- VIPS_UNREF( seq->ir ); +- VIPS_FREE( seq->t1 ); +- VIPS_FREE( seq->t2 ); ++ VIPS_UNREF(seq->ir); ++ VIPS_FREE(seq->t1); ++ VIPS_FREE(seq->t2); + +- return( 0 ); ++ return (0); + } + + /* Morph start function. + */ + static void * +-vips_morph_start( VipsImage *out, void *a, void *b ) ++vips_morph_start(VipsImage *out, void *a, void *b) + { + VipsImage *in = (VipsImage *) a; + VipsMorph *morph = (VipsMorph *) b; + + VipsMorphSequence *seq; + +- if( !(seq = VIPS_NEW( out, VipsMorphSequence )) ) +- return( NULL ); ++ if (!(seq = VIPS_NEW(out, VipsMorphSequence))) ++ return (NULL); + + /* Init! + */ +@@ -210,52 +210,52 @@ vips_morph_start( VipsImage *out, void *a, void *b ) + seq->t1 = NULL; + seq->t2 = NULL; + +- seq->ir = vips_region_new( in ); ++ seq->ir = vips_region_new(in); + + /* C mode. + */ +- seq->soff = VIPS_ARRAY( out, morph->n_point, int ); +- seq->coff = VIPS_ARRAY( out, morph->n_point, int ); ++ seq->soff = VIPS_ARRAY(out, morph->n_point, int); ++ seq->coff = VIPS_ARRAY(out, morph->n_point, int); + +- if( !seq->soff || +- !seq->coff ) { +- vips_morph_stop( seq, in, morph ); +- return( NULL ); ++ if (!seq->soff || ++ !seq->coff) { ++ vips_morph_stop(seq, in, morph); ++ return (NULL); + } + + /* Vector mode. + */ +- if( morph->n_pass ) { +- seq->t1 = VIPS_ARRAY( NULL, +- VIPS_IMAGE_N_ELEMENTS( in ), VipsPel ); +- seq->t2 = VIPS_ARRAY( NULL, +- VIPS_IMAGE_N_ELEMENTS( in ), VipsPel ); +- +- if( !seq->t1 || +- !seq->t2 ) { +- vips_morph_stop( seq, in, morph ); +- return( NULL ); ++ if (morph->n_pass) { ++ seq->t1 = VIPS_ARRAY(NULL, ++ VIPS_IMAGE_N_ELEMENTS(in), VipsPel); ++ seq->t2 = VIPS_ARRAY(NULL, ++ VIPS_IMAGE_N_ELEMENTS(in), VipsPel); ++ ++ if (!seq->t1 || ++ !seq->t2) { ++ vips_morph_stop(seq, in, morph); ++ return (NULL); + } + } + +- return( seq ); ++ return (seq); + } + +-#define TEMP( N, S ) vips_vector_temporary( v, N, S ) +-#define SCANLINE( N, P, S ) vips_vector_source_scanline( v, N, P, S ) +-#define CONST( N, V, S ) vips_vector_constant( v, N, V, S ) +-#define ASM2( OP, A, B ) vips_vector_asm2( v, OP, A, B ) +-#define ASM3( OP, A, B, C ) vips_vector_asm3( v, OP, A, B, C ) ++#define TEMP(N, S) vips_vector_temporary(v, N, S) ++#define SCANLINE(N, P, S) vips_vector_source_scanline(v, N, P, S) ++#define CONST(N, V, S) vips_vector_constant(v, N, V, S) ++#define ASM2(OP, A, B) vips_vector_asm2(v, OP, A, B) ++#define ASM3(OP, A, B, C) vips_vector_asm3(v, OP, A, B, C) + + /* Generate code for a section of the mask. first is the index we start +- * at, we set last to the index of the last one we use before we run ++ * at, we set last to the index of the last one we use before we run + * out of intermediates / constants / parameters / sources or mask + * coefficients. + * + * 0 for success, -1 on error. + */ + static int +-vips_morph_compile_section( VipsMorph *morph, Pass *pass, gboolean first_pass ) ++vips_morph_compile_section(VipsMorph *morph, Pass *pass, gboolean first_pass) + { + VipsMorphology *morphology = (VipsMorphology *) morph; + VipsImage *M = morph->M; +@@ -267,122 +267,122 @@ vips_morph_compile_section( VipsMorph *morph, Pass *pass, gboolean first_pass ) + char one[256]; + int i; + +- pass->vector = v = vips_vector_new( "morph", 1 ); ++ pass->vector = v = vips_vector_new("morph", 1); + + /* The value we fetch from the image, the accumulated sum. + */ +- TEMP( "value", 1 ); +- TEMP( "sum", 1 ); ++ TEMP("value", 1); ++ TEMP("sum", 1); + +- CONST( zero, 0, 1 ); +- CONST( one, 255, 1 ); ++ CONST(zero, 0, 1); ++ CONST(one, 255, 1); + + /* Init the sum. If this is the first pass, it's a constant. If this +- * is a later pass, we have to init the sum from the result +- * of the previous pass. ++ * is a later pass, we have to init the sum from the result ++ * of the previous pass. + */ +- if( first_pass ) { +- if( morph->morph == VIPS_OPERATION_MORPHOLOGY_DILATE ) +- ASM2( "copyb", "sum", zero ); ++ if (first_pass) { ++ if (morph->morph == VIPS_OPERATION_MORPHOLOGY_DILATE) ++ ASM2("copyb", "sum", zero); + else +- ASM2( "copyb", "sum", one ); ++ ASM2("copyb", "sum", one); + } + else { +- /* "r" is the result of the previous pass. ++ /* "r" is the result of the previous pass. + */ +- pass->r = vips_vector_source_name( v, "r", 1 ); +- ASM2( "loadb", "sum", "r" ); ++ pass->r = vips_vector_source_name(v, "r", 1); ++ ASM2("loadb", "sum", "r"); + } + +- for( i = pass->first; i < morph->n_point; i++ ) { ++ for (i = pass->first; i < morph->n_point; i++) { + int x = i % M->Xsize; + int y = i / M->Xsize; + + /* Exclude don't-care elements. + */ +- if( morph->coeff[i] == 128 ) ++ if (morph->coeff[i] == 128) + continue; + + /* The source. sl0 is the first scanline in the mask. + */ +- SCANLINE( source, y, 1 ); ++ SCANLINE(source, y, 1); + + /* The offset, only for non-first-columns though. + */ +- if( x > 0 ) { +- CONST( offset, morphology->in->Bands * x, 1 ); +- ASM3( "loadoffb", "value", source, offset ); ++ if (x > 0) { ++ CONST(offset, morphology->in->Bands * x, 1); ++ ASM3("loadoffb", "value", source, offset); + } + else +- ASM2( "loadb", "value", source ); ++ ASM2("loadb", "value", source); + + /* Join to our sum. If the mask element is zero, we have to + * add an extra negate. + */ +- if( morph->morph == VIPS_OPERATION_MORPHOLOGY_DILATE ) { +- if( !morph->coeff[i] ) +- ASM3( "xorb", "value", "value", one ); +- ASM3( "orb", "sum", "sum", "value" ); ++ if (morph->morph == VIPS_OPERATION_MORPHOLOGY_DILATE) { ++ if (!morph->coeff[i]) ++ ASM3("xorb", "value", "value", one); ++ ASM3("orb", "sum", "sum", "value"); + } + else { +- if( !morph->coeff[i] ) { ++ if (!morph->coeff[i]) { + /* You'd think we could use andnb, but it + * fails on some machines with some orc +- * versions :( ++ * versions :( + */ +- ASM3( "xorb", "value", "value", one ); +- ASM3( "andb", "sum", "sum", "value" ); ++ ASM3("xorb", "value", "value", one); ++ ASM3("andb", "sum", "sum", "value"); + } + else +- ASM3( "andb", "sum", "sum", "value" ); ++ ASM3("andb", "sum", "sum", "value"); + } + +- if( vips_vector_full( v ) ) ++ if (vips_vector_full(v)) + break; + } + + pass->last = i; + +- ASM2( "copyb", "d1", "sum" ); ++ ASM2("copyb", "d1", "sum"); + +- if( !vips_vector_compile( v ) ) +- return( -1 ); ++ if (!vips_vector_compile(v)) ++ return (-1); + + #ifdef DEBUG +- printf( "done matrix coeffs %d to %d\n", pass->first, pass->last ); +- vips_vector_print( v ); ++ printf("done matrix coeffs %d to %d\n", pass->first, pass->last); ++ vips_vector_print(v); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + /* Generate a set of passes. + */ + static int +-vips_morph_compile( VipsMorph *morph ) ++vips_morph_compile(VipsMorph *morph) + { + int i; + Pass *pass; + + #ifdef DEBUG +- printf( "vips_morph_compile: generating vector code\n" ); ++ printf("vips_morph_compile: generating vector code\n"); + #endif /*DEBUG*/ + + /* Generate passes until we've used up the whole mask. + */ +- for( i = 0;;) { +- /* Skip any don't-care coefficients at the start of the mask ++ for (i = 0;;) { ++ /* Skip any don't-care coefficients at the start of the mask + * region. + */ +- for( ; i < morph->n_point && morph->coeff[i] == 128; i++ ) ++ for (; i < morph->n_point && morph->coeff[i] == 128; i++) + ; +- if( i == morph->n_point ) ++ if (i == morph->n_point) + break; + + /* Allocate space for another pass. + */ +- if( morph->n_pass == MAX_PASS ) +- return( -1 ); ++ if (morph->n_pass == MAX_PASS) ++ return (-1); + pass = &morph->pass[morph->n_pass]; + morph->n_pass += 1; + +@@ -390,22 +390,22 @@ vips_morph_compile( VipsMorph *morph ) + pass->last = i; + pass->r = -1; + +- if( vips_morph_compile_section( morph, pass, morph->n_pass == 1 ) ) +- return( -1 ); ++ if (vips_morph_compile_section(morph, pass, morph->n_pass == 1)) ++ return (-1); + i = pass->last + 1; + +- if( i >= morph->n_point ) ++ if (i >= morph->n_point) + break; + } + +- return( 0 ); ++ return (0); + } + + /* Dilate! + */ + static int +-vips_dilate_gen( VipsRegion *or, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_dilate_gen(VipsRegion * or, ++ void *vseq, void *a, void *b, gboolean *stop) + { + VipsMorphSequence *seq = (VipsMorphSequence *) vseq; + VipsMorph *morph = (VipsMorph *) b; +@@ -415,11 +415,11 @@ vips_dilate_gen( VipsRegion *or, + int *soff = seq->soff; + int *coff = seq->coff; + +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; + int to = r->top; +- int bo = VIPS_RECT_BOTTOM( r ); +- int sz = VIPS_REGION_N_ELEMENTS( or ); ++ int bo = VIPS_RECT_BOTTOM(r); ++ int sz = VIPS_REGION_N_ELEMENTS(or); + + VipsRect s; + int x, y; +@@ -432,30 +432,30 @@ vips_dilate_gen( VipsRegion *or, + s = *r; + s.width += M->Xsize - 1; + s.height += M->Ysize - 1; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + + #ifdef DEBUG_VERBOSE +- printf( "vips_dilate_gen: preparing %dx%d@%dx%d pixels\n", +- s.width, s.height, s.left, s.top ); ++ printf("vips_dilate_gen: preparing %dx%d@%dx%d pixels\n", ++ s.width, s.height, s.left, s.top); + #endif /*DEBUG_VERBOSE*/ + + /* Scan mask, building offsets we check when processing. Only do this + * if the bpl has changed since the previous vips_region_prepare(). + */ +- if( seq->last_bpl != VIPS_REGION_LSKIP( ir ) ) { +- seq->last_bpl = VIPS_REGION_LSKIP( ir ); ++ if (seq->last_bpl != VIPS_REGION_LSKIP(ir)) { ++ seq->last_bpl = VIPS_REGION_LSKIP(ir); + + seq->ss = 0; + seq->cs = 0; +- for( t = morph->coeff, y = 0; y < M->Ysize; y++ ) +- for( x = 0; x < M->Xsize; x++, t++ ) +- switch( *t ) { ++ for (t = morph->coeff, y = 0; y < M->Ysize; y++) ++ for (x = 0; x < M->Xsize; x++, t++) ++ switch (*t) { + case 255: + soff[seq->ss++] = +- VIPS_REGION_ADDR( ir, +- x + le, y + to ) - +- VIPS_REGION_ADDR( ir, le, to ); ++ VIPS_REGION_ADDR(ir, ++ x + le, y + to) - ++ VIPS_REGION_ADDR(ir, le, to); + break; + + case 128: +@@ -463,9 +463,9 @@ vips_dilate_gen( VipsRegion *or, + + case 0: + coff[seq->cs++] = +- VIPS_REGION_ADDR( ir, +- x + le, y + to ) - +- VIPS_REGION_ADDR( ir, le, to ); ++ VIPS_REGION_ADDR(ir, ++ x + le, y + to) - ++ VIPS_REGION_ADDR(ir, le, to); + break; + + default: +@@ -475,19 +475,19 @@ vips_dilate_gen( VipsRegion *or, + + /* Dilate! + */ +- for( y = to; y < bo; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( ir, le, y ); +- VipsPel *q = VIPS_REGION_ADDR( or, le, y ); ++ for (y = to; y < bo; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(ir, le, y); ++ VipsPel *q = VIPS_REGION_ADDR(or, le, y); + + /* Loop along line. + */ +- for( x = 0; x < sz; x++, q++, p++ ) { ++ for (x = 0; x < sz; x++, q++, p++) { + /* Search for a hit on the set list. + */ + result = 0; +- for( i = 0; i < seq->ss; i++ ) +- if( p[soff[i]] ) { +- /* Found a match! ++ for (i = 0; i < seq->ss; i++) ++ if (p[soff[i]]) { ++ /* Found a match! + */ + result = 255; + break; +@@ -496,10 +496,10 @@ vips_dilate_gen( VipsRegion *or, + /* No set pixels ... search for a hit in the clear + * pixels. + */ +- if( !result ) +- for( i = 0; i < seq->cs; i++ ) +- if( !p[coff[i]] ) { +- /* Found a match! ++ if (!result) ++ for (i = 0; i < seq->cs; i++) ++ if (!p[coff[i]]) { ++ /* Found a match! + */ + result = 255; + break; +@@ -508,15 +508,15 @@ vips_dilate_gen( VipsRegion *or, + *q = result; + } + } +- +- return( 0 ); ++ ++ return (0); + } + + /* Erode! + */ + static int +-vips_erode_gen( VipsRegion *or, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_erode_gen(VipsRegion * or, ++ void *vseq, void *a, void *b, gboolean *stop) + { + VipsMorphSequence *seq = (VipsMorphSequence *) vseq; + VipsMorph *morph = (VipsMorph *) b; +@@ -526,11 +526,11 @@ vips_erode_gen( VipsRegion *or, + int *soff = seq->soff; + int *coff = seq->coff; + +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + int le = r->left; + int to = r->top; +- int bo = VIPS_RECT_BOTTOM( r ); +- int sz = VIPS_REGION_N_ELEMENTS( or ); ++ int bo = VIPS_RECT_BOTTOM(r); ++ int sz = VIPS_REGION_N_ELEMENTS(or); + + VipsRect s; + int x, y; +@@ -543,30 +543,30 @@ vips_erode_gen( VipsRegion *or, + s = *r; + s.width += M->Xsize - 1; + s.height += M->Ysize - 1; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + + #ifdef DEBUG_VERBOSE +- printf( "vips_erode_gen: preparing %dx%d@%dx%d pixels\n", +- s.width, s.height, s.left, s.top ); ++ printf("vips_erode_gen: preparing %dx%d@%dx%d pixels\n", ++ s.width, s.height, s.left, s.top); + #endif /*DEBUG_VERBOSE*/ + + /* Scan mask, building offsets we check when processing. Only do this + * if the bpl has changed since the previous vips_region_prepare(). + */ +- if( seq->last_bpl != VIPS_REGION_LSKIP( ir ) ) { +- seq->last_bpl = VIPS_REGION_LSKIP( ir ); ++ if (seq->last_bpl != VIPS_REGION_LSKIP(ir)) { ++ seq->last_bpl = VIPS_REGION_LSKIP(ir); + + seq->ss = 0; + seq->cs = 0; +- for( t = morph->coeff, y = 0; y < M->Ysize; y++ ) +- for( x = 0; x < M->Xsize; x++, t++ ) +- switch( *t ) { ++ for (t = morph->coeff, y = 0; y < M->Ysize; y++) ++ for (x = 0; x < M->Xsize; x++, t++) ++ switch (*t) { + case 255: + soff[seq->ss++] = +- VIPS_REGION_ADDR( ir, +- x + le, y + to ) - +- VIPS_REGION_ADDR( ir, le, to ); ++ VIPS_REGION_ADDR(ir, ++ x + le, y + to) - ++ VIPS_REGION_ADDR(ir, le, to); + break; + + case 128: +@@ -574,9 +574,9 @@ vips_erode_gen( VipsRegion *or, + + case 0: + coff[seq->cs++] = +- VIPS_REGION_ADDR( ir, +- x + le, y + to ) - +- VIPS_REGION_ADDR( ir, le, to ); ++ VIPS_REGION_ADDR(ir, ++ x + le, y + to) - ++ VIPS_REGION_ADDR(ir, le, to); + break; + + default: +@@ -586,19 +586,19 @@ vips_erode_gen( VipsRegion *or, + + /* Erode! + */ +- for( y = to; y < bo; y++ ) { +- VipsPel *p = VIPS_REGION_ADDR( ir, le, y ); +- VipsPel *q = VIPS_REGION_ADDR( or, le, y ); ++ for (y = to; y < bo; y++) { ++ VipsPel *p = VIPS_REGION_ADDR(ir, le, y); ++ VipsPel *q = VIPS_REGION_ADDR(or, le, y); + + /* Loop along line. + */ +- for( x = 0; x < sz; x++, q++, p++ ) { ++ for (x = 0; x < sz; x++, q++, p++) { + /* Check all set pixels are set. + */ + result = 255; +- for( i = 0; i < seq->ss; i++ ) +- if( !p[soff[i]] ) { +- /* Found a mismatch! ++ for (i = 0; i < seq->ss; i++) ++ if (!p[soff[i]]) { ++ /* Found a mismatch! + */ + result = 0; + break; +@@ -606,9 +606,9 @@ vips_erode_gen( VipsRegion *or, + + /* Check all clear pixels are clear. + */ +- if( result ) +- for( i = 0; i < seq->cs; i++ ) +- if( p[coff[i]] ) { ++ if (result) ++ for (i = 0; i < seq->cs; i++) ++ if (p[coff[i]]) { + result = 0; + break; + } +@@ -616,22 +616,22 @@ vips_erode_gen( VipsRegion *or, + *q = result; + } + } +- +- return( 0 ); ++ ++ return (0); + } + + /* The vector codepath. + */ + static int +-vips_morph_gen_vector( VipsRegion *or, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_morph_gen_vector(VipsRegion * or, ++ void *vseq, void *a, void *b, gboolean *stop) + { + VipsMorphSequence *seq = (VipsMorphSequence *) vseq; + VipsMorph *morph = (VipsMorph *) b; + VipsImage *M = morph->M; + VipsRegion *ir = seq->ir; +- VipsRect *r = &or->valid; +- int sz = VIPS_REGION_N_ELEMENTS( or ); ++ VipsRect *r = & or->valid; ++ int sz = VIPS_REGION_N_ELEMENTS(or); + + VipsRect s; + int y, j; +@@ -643,57 +643,57 @@ vips_morph_gen_vector( VipsRegion *or, + s = *r; + s.width += M->Xsize - 1; + s.height += M->Ysize - 1; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + + #ifdef DEBUG_VERBOSE +- printf( "vips_morph_gen_vector: preparing %dx%d@%dx%d pixels\n", +- s.width, s.height, s.left, s.top ); ++ printf("vips_morph_gen_vector: preparing %dx%d@%dx%d pixels\n", ++ s.width, s.height, s.left, s.top); + #endif /*DEBUG_VERBOSE*/ + +- for( j = 0; j < morph->n_pass; j++ ) +- vips_executor_set_program( &executor[j], +- morph->pass[j].vector, sz ); ++ for (j = 0; j < morph->n_pass; j++) ++ vips_executor_set_program(&executor[j], ++ morph->pass[j].vector, sz); + +- VIPS_GATE_START( "vips_morph_gen_vector: work" ); ++ VIPS_GATE_START("vips_morph_gen_vector: work"); + +- for( y = 0; y < r->height; y++ ) { +- for( j = 0; j < morph->n_pass; j++ ) { ++ for (y = 0; y < r->height; y++) { ++ for (j = 0; j < morph->n_pass; j++) { + void *d; + + /* The last pass goes to the output image, + * intermediate passes go to t2. + */ +- if( j == morph->n_pass - 1 ) +- d = VIPS_REGION_ADDR( or, r->left, r->top + y ); +- else ++ if (j == morph->n_pass - 1) ++ d = VIPS_REGION_ADDR(or, r->left, r->top + y); ++ else + d = seq->t2; + +- vips_executor_set_scanline( &executor[j], +- ir, r->left, r->top + y ); +- vips_executor_set_array( &executor[j], +- morph->pass[j].r, seq->t1 ); +- vips_executor_set_destination( &executor[j], d ); +- vips_executor_run( &executor[j] ); ++ vips_executor_set_scanline(&executor[j], ++ ir, r->left, r->top + y); ++ vips_executor_set_array(&executor[j], ++ morph->pass[j].r, seq->t1); ++ vips_executor_set_destination(&executor[j], d); ++ vips_executor_run(&executor[j]); + +- VIPS_SWAP( void *, seq->t1, seq->t2 ); ++ VIPS_SWAP(void *, seq->t1, seq->t2); + } + } + +- VIPS_GATE_STOP( "vips_morph_gen_vector: work" ); ++ VIPS_GATE_STOP("vips_morph_gen_vector: work"); + +- VIPS_COUNT_PIXELS( or, "vips_morph_gen_vector" ); ++ VIPS_COUNT_PIXELS(or, "vips_morph_gen_vector"); + +- return( 0 ); ++ return (0); + } + + static int +-vips_morph_build( VipsObject *object ) ++vips_morph_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsMorphology *morphology = (VipsMorphology *) object; + VipsMorph *morph = (VipsMorph *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 5 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 5); + + VipsImage *in; + VipsImage *M; +@@ -701,55 +701,55 @@ vips_morph_build( VipsObject *object ) + double *coeff; + int i; + +- if( VIPS_OBJECT_CLASS( vips_morph_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_morph_parent_class)->build(object)) ++ return (-1); + + in = morphology->in; + + /* Unpack for processing. + */ +- if( vips_image_decode( in, &t[0] ) ) +- return( -1 ); ++ if (vips_image_decode(in, &t[0])) ++ return (-1); + in = t[0]; + +- if( vips_check_matrix( class->nickname, morph->mask, &t[1] ) ) +- return( -1 ); ++ if (vips_check_matrix(class->nickname, morph->mask, &t[1])) ++ return (-1); + morph->M = M = t[1]; + morph->n_point = M->Xsize * M->Ysize; + +- if( vips_embed( in, &t[2], +- M->Xsize / 2, M->Ysize / 2, +- in->Xsize + M->Xsize - 1, in->Ysize + M->Ysize - 1, +- "extend", VIPS_EXTEND_COPY, +- NULL ) ) +- return( -1 ); +- in = t[2]; ++ if (vips_embed(in, &t[2], ++ M->Xsize / 2, M->Ysize / 2, ++ in->Xsize + M->Xsize - 1, in->Ysize + M->Ysize - 1, ++ "extend", VIPS_EXTEND_COPY, ++ NULL)) ++ return (-1); ++ in = t[2]; + + /* Make sure we are uchar. + */ +- if( vips_cast( in, &t[3], VIPS_FORMAT_UCHAR, NULL ) ) +- return( -1 ); ++ if (vips_cast(in, &t[3], VIPS_FORMAT_UCHAR, NULL)) ++ return (-1); + in = t[3]; + + /* Make an int version of our mask. + */ +- if( vips__image_intize( M, &t[4] ) ) +- return( -1 ); ++ if (vips__image_intize(M, &t[4])) ++ return (-1); + M = t[4]; + +- coeff = VIPS_MATRIX( M, 0, 0 ); +- if( !(morph->coeff = VIPS_ARRAY( object, morph->n_point, int )) ) +- return( -1 ); ++ coeff = VIPS_MATRIX(M, 0, 0); ++ if (!(morph->coeff = VIPS_ARRAY(object, morph->n_point, int))) ++ return (-1); + +- for( i = 0; i < morph->n_point; i++ ) { +- if( coeff[i] != 0 && ++ for (i = 0; i < morph->n_point; i++) { ++ if (coeff[i] != 0 && + coeff[i] != 128 && +- coeff[i] != 255 ) { +- vips_error( class->nickname, +- _( "bad mask element (%f " +- "should be 0, 128 or 255)" ), +- coeff[i] ); +- return( -1 ); ++ coeff[i] != 255) { ++ vips_error(class->nickname, ++ _("bad mask element (%f " ++ "should be 0, 128 or 255)"), ++ coeff[i]); ++ return (-1); + } + morph->coeff[i] = coeff[i]; + } +@@ -757,23 +757,24 @@ vips_morph_build( VipsObject *object ) + /* Default to the C path. + */ + generate = morph->morph == VIPS_OPERATION_MORPHOLOGY_DILATE +- ? vips_dilate_gen : vips_erode_gen; ++ ? vips_dilate_gen ++ : vips_erode_gen; + + /* Generate code for this mask / image, if possible. + */ +- if( vips_vector_isenabled() ) { +- if( !vips_morph_compile( morph ) ) { ++ if (vips_vector_isenabled()) { ++ if (!vips_morph_compile(morph)) { + generate = vips_morph_gen_vector; +- g_info( "morph: using vector path" ); ++ g_info("morph: using vector path"); + } + else +- vips_morph_compile_free( morph ); ++ vips_morph_compile_free(morph); + } + +- g_object_set( morph, "out", vips_image_new(), NULL ); +- if( vips_image_pipelinev( morph->out, +- VIPS_DEMAND_STYLE_SMALLTILE, in, NULL ) ) +- return( -1 ); ++ g_object_set(morph, "out", vips_image_new(), NULL); ++ if (vips_image_pipelinev(morph->out, ++ VIPS_DEMAND_STYLE_SMALLTILE, in, NULL)) ++ return (-1); + + /* Prepare output. Consider a 7x7 mask and a 7x7 image --- the output + * would be 1x1. +@@ -781,22 +782,22 @@ vips_morph_build( VipsObject *object ) + morph->out->Xsize -= M->Xsize - 1; + morph->out->Ysize -= M->Ysize - 1; + +- if( vips_image_generate( morph->out, +- vips_morph_start, generate, vips_morph_stop, in, morph ) ) +- return( -1 ); ++ if (vips_image_generate(morph->out, ++ vips_morph_start, generate, vips_morph_stop, in, morph)) ++ return (-1); + + morph->out->Xoffset = -M->Xsize / 2; + morph->out->Yoffset = -M->Ysize / 2; + +- vips_reorder_margin_hint( morph->out, morph->n_point ); ++ vips_reorder_margin_hint(morph->out, morph->n_point); + +- return( 0 ); ++ return (0); + } + + static void +-vips_morph_class_init( VipsMorphClass *class ) ++vips_morph_class_init(VipsMorphClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; +@@ -805,33 +806,32 @@ vips_morph_class_init( VipsMorphClass *class ) + gobject_class->dispose = vips_morph_dispose; + + object_class->nickname = "morph"; +- object_class->description = _( "morphology operation" ); ++ object_class->description = _("morphology operation"); + object_class->build = vips_morph_build; + +- VIPS_ARG_IMAGE( class, "out", 10, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsMorph, out ) ); +- +- VIPS_ARG_IMAGE( class, "mask", 20, +- _( "Mask" ), +- _( "Input matrix image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMorph, mask ) ); +- +- VIPS_ARG_ENUM( class, "morph", 103, +- _( "Morphology" ), +- _( "Morphological operation to perform" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMorph, morph ), +- VIPS_TYPE_OPERATION_MORPHOLOGY, +- VIPS_OPERATION_MORPHOLOGY_ERODE ); +- ++ VIPS_ARG_IMAGE(class, "out", 10, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsMorph, out)); ++ ++ VIPS_ARG_IMAGE(class, "mask", 20, ++ _("Mask"), ++ _("Input matrix image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsMorph, mask)); ++ ++ VIPS_ARG_ENUM(class, "morph", 103, ++ _("Morphology"), ++ _("Morphological operation to perform"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsMorph, morph), ++ VIPS_TYPE_OPERATION_MORPHOLOGY, ++ VIPS_OPERATION_MORPHOLOGY_ERODE); + } + + static void +-vips_morph_init( VipsMorph *morph ) ++vips_morph_init(VipsMorph *morph) + { + morph->morph = VIPS_OPERATION_MORPHOLOGY_ERODE; + morph->coeff = NULL; +@@ -846,7 +846,7 @@ vips_morph_init( VipsMorph *morph ) + * @...: %NULL-terminated list of optional named arguments + * + * Performs a morphological operation on @in using @mask as a +- * structuring element. ++ * structuring element. + * + * The image should have 0 (black) for no object and 255 + * (non-zero) for an object. Note that this is the reverse of the usual +@@ -855,22 +855,22 @@ vips_morph_init( VipsMorph *morph ) + * size as the input image: edge pxels are made by expanding the input image + * as necessary. + * +- * Mask coefficients can be either 0 (for object) or 255 (for background) ++ * Mask coefficients can be either 0 (for object) or 255 (for background) + * or 128 (for do not care). The origin of the mask is at location +- * (m.xsize / 2, m.ysize / 2), integer division. All algorithms have been +- * based on the book "Fundamentals of Digital Image Processing" by A. Jain, +- * pp 384-388, Prentice-Hall, 1989. ++ * (m.xsize / 2, m.ysize / 2), integer division. All algorithms have been ++ * based on the book "Fundamentals of Digital Image Processing" by A. Jain, ++ * pp 384-388, Prentice-Hall, 1989. + * +- * For #VIPS_OPERATION_MORPHOLOGY_ERODE, ++ * For #VIPS_OPERATION_MORPHOLOGY_ERODE, + * the whole mask must match for the output pixel to be + * set, that is, the result is the logical AND of the selected input pixels. + * +- * For #VIPS_OPERATION_MORPHOLOGY_DILATE, +- * the output pixel is set if any part of the mask ++ * For #VIPS_OPERATION_MORPHOLOGY_DILATE, ++ * the output pixel is set if any part of the mask + * matches, that is, the result is the logical OR of the selected input pixels. + * +- * See the boolean operations vips_andimage(), vips_orimage() and +- * vips_eorimage() ++ * See the boolean operations vips_andimage(), vips_orimage() and ++ * vips_eorimage() + * for analogues of the usual set difference and set union operations. + * + * Operations are performed using the processor's vector unit, +@@ -878,16 +878,16 @@ vips_morph_init( VipsMorph *morph ) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_morph( VipsImage *in, VipsImage **out, VipsImage *mask, +- VipsOperationMorphology morph, ... ) ++int ++vips_morph(VipsImage *in, VipsImage **out, VipsImage *mask, ++ VipsOperationMorphology morph, ...) + { + va_list ap; + int result; + +- va_start( ap, morph ); +- result = vips_call_split( "morph", ap, in, out, mask, morph ); +- va_end( ap ); ++ va_start(ap, morph); ++ result = vips_call_split("morph", ap, in, out, mask, morph); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/morphology/morphology.c b/libvips/morphology/morphology.c +index 08912ff9ea..b7f2d5f948 100644 +--- a/libvips/morphology/morphology.c ++++ b/libvips/morphology/morphology.c +@@ -6,28 +6,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -49,9 +49,9 @@ + + #include "pmorphology.h" + +-/** ++/** + * SECTION: morphology +- * @short_description: morphological operators, rank filters and related image ++ * @short_description: morphological operators, rank filters and related image + * analysis + * @see_also: arithmetic + * @stability: Stable +@@ -68,10 +68,10 @@ + * (vips_rot45(), for example) and apply them repeatedly, you + * can achieve very complicated effects: you can thin, prune, fill, open edges, + * close gaps, and many others. For example, see `Fundamentals of Digital +- * Image Processing' by A. Jain, pp 384-388, Prentice-Hall, 1989 for more ++ * Image Processing' by A. Jain, pp 384-388, Prentice-Hall, 1989 for more + * ideas. + * +- * Beware that VIPS reverses the usual image processing convention, by ++ * Beware that VIPS reverses the usual image processing convention, by + * assuming white objects (non-zero pixels) on a black background (zero + * pixels). + * +@@ -80,12 +80,12 @@ + * mask must have odd length sides --- the origin of the mask is taken to be + * the centre value. For example, the mask: + * +- * VipsImage *mask = vips_image_new_matrixv( 3, 3, ++ * VipsImage *mask = vips_image_new_matrixv( 3, 3, + * 128.0, 255.0, 128.0, + * 255.0, 255.0, 255.0, + * 128.0, 255.0, 128.0 ); + * +- * applied to an image with vips_morph() #VIPS_OPERATION_MORPHOLOGY_DILATE will ++ * applied to an image with vips_morph() #VIPS_OPERATION_MORPHOLOGY_DILATE will + * do a 4-connected dilation. + * + * Dilate sets pixels in the output if any part of the mask matches, whereas +@@ -99,34 +99,33 @@ + * create square, circular and ring masks of specific sizes. + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsMorphology, vips_morphology, +- VIPS_TYPE_OPERATION ); ++G_DEFINE_ABSTRACT_TYPE(VipsMorphology, vips_morphology, ++ VIPS_TYPE_OPERATION); + + static void +-vips_morphology_class_init( VipsMorphologyClass *class ) ++vips_morphology_class_init(VipsMorphologyClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "morphology"; +- vobject_class->description = _( "morphological operations" ); ++ vobject_class->description = _("morphological operations"); + + /* Inputs set by subclassess. + */ + +- VIPS_ARG_IMAGE( class, "in", 0, +- _( "Input" ), +- _( "Input image argument" ), ++ VIPS_ARG_IMAGE(class, "in", 0, ++ _("Input"), ++ _("Input image argument"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMorphology, in ) ); +- ++ G_STRUCT_OFFSET(VipsMorphology, in)); + } + + static void +-vips_morphology_init( VipsMorphology *morphology ) ++vips_morphology_init(VipsMorphology *morphology) + { + } + +@@ -134,17 +133,17 @@ vips_morphology_init( VipsMorphology *morphology ) + * instead? + */ + void +-vips_morphology_operation_init( void ) ++vips_morphology_operation_init(void) + { +- extern GType vips_morph_get_type( void ); +- extern GType vips_rank_get_type( void ); +- extern GType vips_countlines_get_type( void ); +- extern GType vips_labelregions_get_type( void ); +- extern GType vips_fill_nearest_get_type( void ); +- +- vips_morph_get_type(); +- vips_rank_get_type(); +- vips_countlines_get_type(); +- vips_labelregions_get_type(); +- vips_fill_nearest_get_type(); ++ extern GType vips_morph_get_type(void); ++ extern GType vips_rank_get_type(void); ++ extern GType vips_countlines_get_type(void); ++ extern GType vips_labelregions_get_type(void); ++ extern GType vips_fill_nearest_get_type(void); ++ ++ vips_morph_get_type(); ++ vips_rank_get_type(); ++ vips_countlines_get_type(); ++ vips_labelregions_get_type(); ++ vips_fill_nearest_get_type(); + } +diff --git a/libvips/morphology/nearest.c b/libvips/morphology/nearest.c +index c8d7fee772..b1a4b2c6f7 100644 +--- a/libvips/morphology/nearest.c ++++ b/libvips/morphology/nearest.c +@@ -1,33 +1,33 @@ + /* nearest.c + * + * 31/10/17 +- * - from labelregion ++ * - from labelregion + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -78,27 +78,27 @@ typedef struct _VipsFillNearest { + + typedef VipsMorphologyClass VipsFillNearestClass; + +-G_DEFINE_TYPE( VipsFillNearest, vips_fill_nearest, VIPS_TYPE_MORPHOLOGY ); ++G_DEFINE_TYPE(VipsFillNearest, vips_fill_nearest, VIPS_TYPE_MORPHOLOGY); + + static void +-vips_fill_nearest_finalize( GObject *gobject ) ++vips_fill_nearest_finalize(GObject *gobject) + { + VipsFillNearest *nearest = (VipsFillNearest *) gobject; + + #ifdef DEBUG +- printf( "vips_fill_nearest_finalize: " ); +- vips_object_print_name( VIPS_OBJECT( gobject ) ); +- printf( "\n" ); ++ printf("vips_fill_nearest_finalize: "); ++ vips_object_print_name(VIPS_OBJECT(gobject)); ++ printf("\n"); + #endif /*DEBUG*/ + +- VIPS_FREEF( g_array_unref, nearest->seeds ); ++ VIPS_FREEF(g_array_unref, nearest->seeds); + +- G_OBJECT_CLASS( vips_fill_nearest_parent_class )->finalize( gobject ); ++ G_OBJECT_CLASS(vips_fill_nearest_parent_class)->finalize(gobject); + } + + struct _Circle; +-typedef void (*VipsFillNearestPixel)( struct _Circle *circle, +- int x, int y, int octant ); ++typedef void (*VipsFillNearestPixel)(struct _Circle *circle, ++ int x, int y, int octant); + + typedef struct _Circle { + VipsFillNearest *nearest; +@@ -107,84 +107,84 @@ typedef struct _Circle { + VipsFillNearestPixel nearest_pixel; + } Circle; + +-static void +-vips_fill_nearest_pixel( Circle *circle, int x, int y, int octant ) ++static void ++vips_fill_nearest_pixel(Circle *circle, int x, int y, int octant) + { + float *p; + float radius; + int dx, dy; + +- if( (circle->seed->octant_mask & (1 << octant)) == 0 ) ++ if ((circle->seed->octant_mask & (1 << octant)) == 0) + return; + + /* We need to do this as float, or we'll have dithering along edges. + */ +- p = (float *) VIPS_IMAGE_ADDR( circle->nearest->distance, x, y ); ++ p = (float *) VIPS_IMAGE_ADDR(circle->nearest->distance, x, y); + dx = x - circle->seed->x; + dy = y - circle->seed->y; +- radius = sqrt( dx * dx + dy * dy ); ++ radius = sqrt(dx * dx + dy * dy); + +- if( p[0] == 0 || +- p[0] > radius ) { +- VipsMorphology *morphology = VIPS_MORPHOLOGY( circle->nearest ); ++ if (p[0] == 0 || ++ p[0] > radius) { ++ VipsMorphology *morphology = VIPS_MORPHOLOGY(circle->nearest); + VipsImage *in = morphology->in; +- int ps = VIPS_IMAGE_SIZEOF_PEL( in ); +- VipsPel *pi = VIPS_IMAGE_ADDR( in, +- circle->seed->x, circle->seed->y ); +- VipsPel *qi = VIPS_IMAGE_ADDR( circle->nearest->out, +- x, y ); ++ int ps = VIPS_IMAGE_SIZEOF_PEL(in); ++ VipsPel *pi = VIPS_IMAGE_ADDR(in, ++ circle->seed->x, circle->seed->y); ++ VipsPel *qi = VIPS_IMAGE_ADDR(circle->nearest->out, ++ x, y); + + int i; + + p[0] = radius; + circle->octant_mask |= 1 << octant; + +- for( i = 0; i < ps; i++ ) ++ for (i = 0; i < ps; i++) + qi[i] = pi[i]; + } + } + +-static void +-vips_fill_nearest_pixel_clip( Circle *circle, int x, int y, int octant ) ++static void ++vips_fill_nearest_pixel_clip(Circle *circle, int x, int y, int octant) + { +- if( (circle->seed->octant_mask & (1 << octant)) == 0 ) ++ if ((circle->seed->octant_mask & (1 << octant)) == 0) + return; + +- if( x >= 0 && ++ if (x >= 0 && + x < circle->nearest->width && + y >= 0 && +- y < circle->nearest->height ) +- vips_fill_nearest_pixel( circle, x, y, octant ); ++ y < circle->nearest->height) ++ vips_fill_nearest_pixel(circle, x, y, octant); + } + + static void +-vips_fill_nearest_scanline( VipsImage *image, +- int y, int x1, int x2, int quadrant, void *client ) ++vips_fill_nearest_scanline(VipsImage *image, ++ int y, int x1, int x2, int quadrant, void *client) + { + Circle *circle = (Circle *) client; + +- circle->nearest_pixel( circle, x1, y, quadrant ); +- circle->nearest_pixel( circle, x2, y, quadrant + 4 ); ++ circle->nearest_pixel(circle, x1, y, quadrant); ++ circle->nearest_pixel(circle, x2, y, quadrant + 4); + +- /* We have to do one point back as well, or we'll leave gaps at ++ /* We have to do one point back as well, or we'll leave gaps at + * around 45 degrees. + */ +- if( quadrant == 0 ) { +- circle->nearest_pixel( circle, x1, y - 1, quadrant ); +- circle->nearest_pixel( circle, x2, y - 1, quadrant + 4 ); ++ if (quadrant == 0) { ++ circle->nearest_pixel(circle, x1, y - 1, quadrant); ++ circle->nearest_pixel(circle, x2, y - 1, quadrant + 4); + } +- else if( quadrant == 1 ) { +- circle->nearest_pixel( circle, x1, y + 1, quadrant ); +- circle->nearest_pixel( circle, x2, y + 1, quadrant + 4 ); ++ else if (quadrant == 1) { ++ circle->nearest_pixel(circle, x1, y + 1, quadrant); ++ circle->nearest_pixel(circle, x2, y + 1, quadrant + 4); + } + else { +- circle->nearest_pixel( circle, x1 + 1, y, quadrant ); +- circle->nearest_pixel( circle, x2 - 1, y, quadrant + 4 ); ++ circle->nearest_pixel(circle, x1 + 1, y, quadrant); ++ circle->nearest_pixel(circle, x2 - 1, y, quadrant + 4); + } + } + + static void +-vips_fill_nearest_grow_seed( VipsFillNearest *nearest, Seed *seed ) ++vips_fill_nearest_grow_seed(VipsFillNearest *nearest, Seed *seed) + { + Circle circle; + +@@ -192,63 +192,62 @@ vips_fill_nearest_grow_seed( VipsFillNearest *nearest, Seed *seed ) + circle.seed = seed; + circle.octant_mask = 0; + +- if( seed->x - seed->r >= 0 && ++ if (seed->x - seed->r >= 0 && + seed->x + seed->r < nearest->width && + seed->y - seed->r >= 0 && +- seed->y + seed->r < nearest->height ) ++ seed->y + seed->r < nearest->height) + circle.nearest_pixel = vips_fill_nearest_pixel; + else + circle.nearest_pixel = vips_fill_nearest_pixel_clip; + +- vips__draw_circle_direct( nearest->distance, +- seed->x, seed->y, seed->r, +- vips_fill_nearest_scanline, &circle ); ++ vips__draw_circle_direct(nearest->distance, ++ seed->x, seed->y, seed->r, ++ vips_fill_nearest_scanline, &circle); + +- /* Update the action_mask for this seed. Next time, we can skip any +- * octants where we failed to act this time. ++ /* Update the action_mask for this seed. Next time, we can skip any ++ * octants where we failed to act this time. + */ +- seed->octant_mask = circle.octant_mask; ++ seed->octant_mask = circle.octant_mask; + + seed->r += 1; + } + + static int +-vips_fill_nearest_build( VipsObject *object ) ++vips_fill_nearest_build(VipsObject *object) + { +- VipsMorphology *morphology = VIPS_MORPHOLOGY( object ); ++ VipsMorphology *morphology = VIPS_MORPHOLOGY(object); + VipsFillNearest *nearest = (VipsFillNearest *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 2); + + int ps; + int x, y, i; + +- if( VIPS_OBJECT_CLASS( vips_fill_nearest_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_fill_nearest_parent_class)->build(object)) ++ return (-1); + +- if( vips_image_wio_input( morphology->in ) ) +- return( -1 ); ++ if (vips_image_wio_input(morphology->in)) ++ return (-1); + nearest->width = morphology->in->Xsize; + nearest->height = morphology->in->Ysize; + +- ps = VIPS_IMAGE_SIZEOF_PEL( morphology->in ); +- nearest->seeds = g_array_new( FALSE, FALSE, sizeof( Seed ) ); +- for( y = 0; y < nearest->height; y++ ) { ++ ps = VIPS_IMAGE_SIZEOF_PEL(morphology->in); ++ nearest->seeds = g_array_new(FALSE, FALSE, sizeof(Seed)); ++ for (y = 0; y < nearest->height; y++) { + VipsPel *p; + +- p = VIPS_IMAGE_ADDR( morphology->in, 0, y ); +- for( x = 0; x < nearest->width; x++ ) { +- for( i = 0; i < ps; i++ ) +- if( p[i] ) ++ p = VIPS_IMAGE_ADDR(morphology->in, 0, y); ++ for (x = 0; x < nearest->width; x++) { ++ for (i = 0; i < ps; i++) ++ if (p[i]) + break; + +- if( i != ps ) { ++ if (i != ps) { + Seed *seed; + +- g_array_set_size( nearest->seeds, +- nearest->seeds->len + 1 ); +- seed = &g_array_index( nearest->seeds, +- Seed, nearest->seeds->len - 1 ); ++ g_array_set_size(nearest->seeds, ++ nearest->seeds->len + 1); ++ seed = &g_array_index(nearest->seeds, ++ Seed, nearest->seeds->len - 1); + seed->x = x; + seed->y = y; + seed->r = 1; +@@ -261,74 +260,73 @@ vips_fill_nearest_build( VipsObject *object ) + + /* Create the output and distance images in memory. + */ +- g_object_set( object, "distance", vips_image_new_memory(), NULL ); +- if( vips_black( &t[1], nearest->width, nearest->height, NULL ) || +- vips_cast( t[1], &t[2], VIPS_FORMAT_FLOAT, NULL ) || +- vips_image_write( t[2], nearest->distance ) ) +- return( -1 ); ++ g_object_set(object, "distance", vips_image_new_memory(), NULL); ++ if (vips_black(&t[1], nearest->width, nearest->height, NULL) || ++ vips_cast(t[1], &t[2], VIPS_FORMAT_FLOAT, NULL) || ++ vips_image_write(t[2], nearest->distance)) ++ return (-1); + +- g_object_set( object, "out", vips_image_new_memory(), NULL ); +- if( vips_image_write( morphology->in, nearest->out ) ) +- return( -1 ); ++ g_object_set(object, "out", vips_image_new_memory(), NULL); ++ if (vips_image_write(morphology->in, nearest->out)) ++ return (-1); + +- while( nearest->seeds->len > 0 ) { ++ while (nearest->seeds->len > 0) { + #ifdef DEBUG +- printf( "looping for %d seeds ...\n", nearest->seeds->len ); ++ printf("looping for %d seeds ...\n", nearest->seeds->len); + #endif /*DEBUG*/ + + /* Grow all seeds by one pixel. + */ +- for( i = 0; i < nearest->seeds->len; i++ ) +- vips_fill_nearest_grow_seed( nearest, +- &g_array_index( nearest->seeds, Seed, i ) ); ++ for (i = 0; i < nearest->seeds->len; i++) ++ vips_fill_nearest_grow_seed(nearest, ++ &g_array_index(nearest->seeds, Seed, i)); + + /* Remove dead seeds. + */ +- i = 0; +- while( i < nearest->seeds->len ) { +- Seed *seed = &g_array_index( nearest->seeds, Seed, i ); ++ i = 0; ++ while (i < nearest->seeds->len) { ++ Seed *seed = &g_array_index(nearest->seeds, Seed, i); + +- if( seed->octant_mask == 0 ) +- g_array_remove_index_fast( nearest->seeds, i ); ++ if (seed->octant_mask == 0) ++ g_array_remove_index_fast(nearest->seeds, i); + else + i += 1; + } + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_fill_nearest_class_init( VipsFillNearestClass *class ) ++vips_fill_nearest_class_init(VipsFillNearestClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->finalize = vips_fill_nearest_finalize; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "fill_nearest"; +- vobject_class->description = +- _( "fill image zeros with nearest non-zero pixel" ); ++ vobject_class->description = ++ _("fill image zeros with nearest non-zero pixel"); + vobject_class->build = vips_fill_nearest_build; + +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Out" ), +- _( "Value of nearest non-zero pixel" ), ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Out"), ++ _("Value of nearest non-zero pixel"), + VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsFillNearest, out ) ); ++ G_STRUCT_OFFSET(VipsFillNearest, out)); + +- VIPS_ARG_IMAGE( class, "distance", 3, +- _( "Distance" ), +- _( "Distance to nearest non-zero pixel" ), ++ VIPS_ARG_IMAGE(class, "distance", 3, ++ _("Distance"), ++ _("Distance to nearest non-zero pixel"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsFillNearest, distance ) ); +- ++ G_STRUCT_OFFSET(VipsFillNearest, distance)); + } + + static void +-vips_fill_nearest_init( VipsFillNearest *nearest ) ++vips_fill_nearest_init(VipsFillNearest *nearest) + { + } + +@@ -343,7 +341,7 @@ vips_fill_nearest_init( VipsFillNearest *nearest ) + * * @distance: output image of distance to nearest non-zero pixel + * + * Fill outwards from every non-zero pixel in @in, setting pixels in @distance +- * and @value. ++ * and @value. + * + * At the position of zero pixels in @in, @distance contains the distance to + * the nearest non-zero pixel in @in, and @value contains the value of that +@@ -357,14 +355,14 @@ vips_fill_nearest_init( VipsFillNearest *nearest ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_fill_nearest( VipsImage *in, VipsImage **out, ... ) ++vips_fill_nearest(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "fill_nearest", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("fill_nearest", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/morphology/pmorphology.h b/libvips/morphology/pmorphology.h +index 51b4d7c0cd..b627a89dac 100644 +--- a/libvips/morphology/pmorphology.h ++++ b/libvips/morphology/pmorphology.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -38,19 +38,19 @@ extern "C" { + #include + + #define VIPS_TYPE_MORPHOLOGY (vips_morphology_get_type()) +-#define VIPS_MORPHOLOGY( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_MORPHOLOGY, VipsMorphology )) +-#define VIPS_MORPHOLOGY_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_MORPHOLOGY(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_MORPHOLOGY, VipsMorphology)) ++#define VIPS_MORPHOLOGY_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_MORPHOLOGY, VipsMorphologyClass)) ++#define VIPS_IS_MORPHOLOGY(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_MORPHOLOGY)) ++#define VIPS_IS_MORPHOLOGY_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_MORPHOLOGY)) ++#define VIPS_MORPHOLOGY_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_MORPHOLOGY, VipsMorphologyClass)) +-#define VIPS_IS_MORPHOLOGY( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_MORPHOLOGY )) +-#define VIPS_IS_MORPHOLOGY_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_MORPHOLOGY )) +-#define VIPS_MORPHOLOGY_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_MORPHOLOGY, VipsMorphologyClass )) + + typedef struct _VipsMorphology VipsMorphology; + +@@ -58,7 +58,6 @@ struct _VipsMorphology { + VipsOperation parent_instance; + + VipsImage *in; +- + }; + + typedef struct _VipsMorphologyClass { +@@ -66,12 +65,10 @@ typedef struct _VipsMorphologyClass { + + } VipsMorphologyClass; + +-GType vips_morphology_get_type( void ); ++GType vips_morphology_get_type(void); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_PMORPHOLOGY_H*/ +- +- +diff --git a/libvips/morphology/rank.c b/libvips/morphology/rank.c +index f1e4ee0558..21ee1d4508 100644 +--- a/libvips/morphology/rank.c ++++ b/libvips/morphology/rank.c +@@ -2,18 +2,18 @@ + * + * Author: JC + * Written on: 19/8/96 +- * Modified on: ++ * Modified on: + * JC 20/8/96 + * - now uses insert-sort rather than bubble-sort + * - now works for any non-complex type +- * JC 22/6/01 ++ * JC 22/6/01 + * - oops, sanity check on n wrong + * JC 28/8/03 + * - cleanups + * - better selection algorithm ... same speed for 3x3, about 3x faster + * for 5x5, faster still for larger windows + * - index from zero for consistency with other parts of vips +- * 7/4/04 ++ * 7/4/04 + * - now uses im_embed() with edge stretching on the input, not + * the output + * - sets Xoffset / Yoffset +@@ -32,28 +32,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -81,7 +81,7 @@ typedef struct _VipsRank { + int height; + int index; + +- int n; ++ int n; + + gboolean hist_path; + +@@ -89,7 +89,7 @@ typedef struct _VipsRank { + + typedef VipsMorphologyClass VipsRankClass; + +-G_DEFINE_TYPE( VipsRank, vips_rank, VIPS_TYPE_MORPHOLOGY ); ++G_DEFINE_TYPE(VipsRank, vips_rank, VIPS_TYPE_MORPHOLOGY); + + /* Sequence value: just the array we sort in. + */ +@@ -106,98 +106,98 @@ typedef struct { + } VipsRankSequence; + + static int +-vips_rank_stop( void *vseq, void *a, void *b ) ++vips_rank_stop(void *vseq, void *a, void *b) + { + VipsRankSequence *seq = (VipsRankSequence *) vseq; + VipsImage *in = (VipsImage *) a; + +- VIPS_UNREF( seq->ir ); +- VIPS_FREE( seq->sort ); ++ VIPS_UNREF(seq->ir); ++ VIPS_FREE(seq->sort); + +- if( seq->hist && +- in ) { ++ if (seq->hist && ++ in) { + int i; + +- for( i = 0; i < in->Bands; i++ ) +- VIPS_FREE( seq->hist[i] ); ++ for (i = 0; i < in->Bands; i++) ++ VIPS_FREE(seq->hist[i]); + } +- VIPS_FREE( seq->hist ); ++ VIPS_FREE(seq->hist); + +- return( 0 ); ++ return (0); + } + + static void * +-vips_rank_start( VipsImage *out, void *a, void *b ) ++vips_rank_start(VipsImage *out, void *a, void *b) + { + VipsImage *in = (VipsImage *) a; + VipsRank *rank = (VipsRank *) b; + VipsRankSequence *seq; + +- if( !(seq = VIPS_NEW( out, VipsRankSequence )) ) +- return( NULL ); ++ if (!(seq = VIPS_NEW(out, VipsRankSequence))) ++ return (NULL); + seq->ir = NULL; + seq->sort = NULL; + seq->hist = NULL; + +- seq->ir = vips_region_new( in ); +- if( !(seq->sort = VIPS_ARRAY( NULL, +- VIPS_IMAGE_SIZEOF_ELEMENT( in ) * rank->n, VipsPel )) ) { +- vips_rank_stop( seq, in, rank ); +- return( NULL ); ++ seq->ir = vips_region_new(in); ++ if (!(seq->sort = VIPS_ARRAY(NULL, ++ VIPS_IMAGE_SIZEOF_ELEMENT(in) * rank->n, VipsPel))) { ++ vips_rank_stop(seq, in, rank); ++ return (NULL); + } + +- if( rank->hist_path ) { ++ if (rank->hist_path) { + int i; + +- if( !(seq->hist = +- VIPS_ARRAY( NULL, in->Bands, unsigned int * )) ) { +- vips_rank_stop( seq, in, rank ); +- return( NULL ); ++ if (!(seq->hist = ++ VIPS_ARRAY(NULL, in->Bands, unsigned int *))) { ++ vips_rank_stop(seq, in, rank); ++ return (NULL); + } + +- for( i = 0; i < in->Bands; i++ ) +- if( !(seq->hist[i] = +- VIPS_ARRAY( NULL, 256, unsigned int )) ) { +- vips_rank_stop( seq, in, rank ); +- return( NULL ); ++ for (i = 0; i < in->Bands; i++) ++ if (!(seq->hist[i] = ++ VIPS_ARRAY(NULL, 256, unsigned int))) { ++ vips_rank_stop(seq, in, rank); ++ return (NULL); + } + } + +- return( (void *) seq ); ++ return ((void *) seq); + } + + /* Histogram path for large uchar ranks. + */ + static void +-vips_rank_generate_uchar( VipsRegion *or, +- VipsRankSequence *seq, VipsRank *rank, int y ) ++vips_rank_generate_uchar(VipsRegion * or, ++ VipsRankSequence *seq, VipsRank *rank, int y) + { + VipsImage *in = seq->ir->im; +- VipsRect *r = &or->valid; +- const int bands = in->Bands; ++ VipsRect *r = & or->valid; ++ const int bands = in->Bands; + const int last = bands * (rank->width - 1); + + /* Get input and output pointers for this line. + */ +- VipsPel * restrict p = +- VIPS_REGION_ADDR( seq->ir, r->left, r->top + y ); +- VipsPel * restrict q = +- VIPS_REGION_ADDR( or, r->left, r->top + y ); ++ VipsPel *restrict p = ++ VIPS_REGION_ADDR(seq->ir, r->left, r->top + y); ++ VipsPel *restrict q = ++ VIPS_REGION_ADDR(or, r->left, r->top + y); + +- VipsPel * restrict p1; ++ VipsPel *restrict p1; + int lsk; + int x, i, j, b; + +- lsk = VIPS_REGION_LSKIP( seq->ir ); ++ lsk = VIPS_REGION_LSKIP(seq->ir); + + /* Find histogram for the first output pixel. + */ +- for( b = 0; b < bands; b++ ) +- memset( seq->hist[b], 0, 256 * sizeof( unsigned int ) ); ++ for (b = 0; b < bands; b++) ++ memset(seq->hist[b], 0, 256 * sizeof(unsigned int)); + p1 = p; +- for( j = 0; j < rank->height; j++ ) { +- for( i = 0, x = 0; x < rank->width; x++ ) +- for( b = 0; b < bands; b++, i++ ) ++ for (j = 0; j < rank->height; j++) { ++ for (i = 0, x = 0; x < rank->width; x++) ++ for (b = 0; b < bands; b++, i++) + seq->hist[b][p1[i]] += 1; + + p1 += lsk; +@@ -205,30 +205,30 @@ vips_rank_generate_uchar( VipsRegion *or, + + /* Loop for output pels. + */ +- for( x = 0; x < r->width; x++ ) { +- for( b = 0; b < bands; b++ ) { ++ for (x = 0; x < r->width; x++) { ++ for (b = 0; b < bands; b++) { + /* Calculate cumulative histogram -- the value is the + * index at which we pass the rank. + */ +- unsigned int * restrict hist = seq->hist[b]; ++ unsigned int *restrict hist = seq->hist[b]; + + int sum; + int i; + + sum = 0; +- for( i = 0; i < 256; i++ ) { ++ for (i = 0; i < 256; i++) { + sum += hist[i]; +- if( sum > rank->index ) ++ if (sum > rank->index) + break; + } + q[b] = i; + +- /* Adapt histogram --- remove the pels from +- * the left hand column, add in pels for a ++ /* Adapt histogram --- remove the pels from ++ * the left hand column, add in pels for a + * new right-hand column. + */ + p1 = p + b; +- for( j = 0; j < rank->height; j++ ) { ++ for (j = 0; j < rank->height; j++) { + hist[p1[0]] -= 1; + hist[p1[last]] += 1; + +@@ -243,177 +243,196 @@ vips_rank_generate_uchar( VipsRegion *or, + + /* Inner loop for select-sorting TYPE. + */ +-#define LOOP_SELECT( TYPE ) { \ +- TYPE *q = (TYPE *) VIPS_REGION_ADDR( or, r->left, r->top + y ); \ +- TYPE *p = (TYPE *) VIPS_REGION_ADDR( ir, r->left, r->top + y ); \ +- TYPE *sort = (TYPE *) seq->sort; \ +- TYPE a; \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- TYPE *d = p + x; \ +- \ +- /* Copy window into sort[]. +- */ \ +- for( k = 0, j = 0; j < rank->height; j++ ) { \ +- for( i = 0; i < eaw; i += bands, k++ ) \ +- sort[k] = d[i]; \ +- d += ls; \ +- } \ +- \ +- /* Rearrange sort[] to make the index-th element the index-th +- * smallest, adapted from Numerical Recipes in C. +- */ \ +- lower = 0; /* Range we know the result lies in */ \ +- upper = rank->n - 1; \ +- for(;;) { \ +- if( upper - lower < 2 ) { \ +- /* 1 or 2 elements left. +- */ \ +- if( upper - lower == 1 && \ +- sort[lower] > sort[upper] ) \ +- VIPS_SWAP( TYPE, \ +- sort[lower], sort[upper] ); \ +- break; \ ++#define LOOP_SELECT(TYPE) \ ++ { \ ++ TYPE *q = (TYPE *) VIPS_REGION_ADDR(or, r->left, r->top + y); \ ++ TYPE *p = (TYPE *) VIPS_REGION_ADDR(ir, r->left, r->top + y); \ ++ TYPE *sort = (TYPE *) seq->sort; \ ++ TYPE a; \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ TYPE *d = p + x; \ ++\ ++ /* Copy window into sort[]. \ ++ */ \ ++ for (k = 0, j = 0; j < rank->height; j++) { \ ++ for (i = 0; i < eaw; i += bands, k++) \ ++ sort[k] = d[i]; \ ++ d += ls; \ + } \ +- else { \ +- /* Pick mid-point of remaining elements. +- */ \ +- mid = (lower + upper) >> 1; \ +- \ +- /* Sort lower/mid/upper elements, hold +- * midpoint in sort[lower + 1] for +- * partitioning. +- */ \ +- VIPS_SWAP( TYPE, sort[lower + 1], sort[mid] ); \ +- if( sort[lower] > sort[upper] ) \ +- VIPS_SWAP( TYPE, \ +- sort[lower], sort[upper] ); \ +- if( sort[lower + 1] > sort[upper] ) \ +- VIPS_SWAP( TYPE, \ +- sort[lower + 1], sort[upper] );\ +- if( sort[lower] > sort[lower + 1] ) \ +- VIPS_SWAP( TYPE, \ +- sort[lower], sort[lower + 1] );\ +- \ +- i = lower + 1; \ +- j = upper; \ +- a = sort[lower + 1]; \ +- \ +- for(;;) { \ +- /* Search for out of order elements. ++\ ++ /* Rearrange sort[] to make the index-th element the index-th \ ++ * smallest, adapted from Numerical Recipes in C. \ ++ */ \ ++ lower = 0; /* Range we know the result lies in */ \ ++ upper = rank->n - 1; \ ++ for (;;) { \ ++ if (upper - lower < 2) { \ ++ /* 1 or 2 elements left. \ ++ */ \ ++ if (upper - lower == 1 && \ ++ sort[lower] > sort[upper]) \ ++ VIPS_SWAP(TYPE, \ ++ sort[lower], sort[upper]); \ ++ break; \ ++ } \ ++ else { \ ++ /* Pick mid-point of remaining elements. \ ++ */ \ ++ mid = (lower + upper) >> 1; \ ++\ ++ /* Sort lower/mid/upper elements, hold \ ++ * midpoint in sort[lower + 1] for \ ++ * partitioning. \ + */ \ +- do \ +- i++; \ +- while( sort[i] < a ); \ +- do \ +- j--; \ +- while( sort[j] > a ); \ +- if( j < i ) \ +- break; \ +- VIPS_SWAP( TYPE, sort[i], sort[j] ); \ ++ VIPS_SWAP(TYPE, sort[lower + 1], sort[mid]); \ ++ if (sort[lower] > sort[upper]) \ ++ VIPS_SWAP(TYPE, \ ++ sort[lower], sort[upper]); \ ++ if (sort[lower + 1] > sort[upper]) \ ++ VIPS_SWAP(TYPE, \ ++ sort[lower + 1], sort[upper]); \ ++ if (sort[lower] > sort[lower + 1]) \ ++ VIPS_SWAP(TYPE, \ ++ sort[lower], sort[lower + 1]); \ ++\ ++ i = lower + 1; \ ++ j = upper; \ ++ a = sort[lower + 1]; \ ++\ ++ for (;;) { \ ++ /* Search for out of order elements. \ ++ */ \ ++ do \ ++ i++; \ ++ while (sort[i] < a); \ ++ do \ ++ j--; \ ++ while (sort[j] > a); \ ++ if (j < i) \ ++ break; \ ++ VIPS_SWAP(TYPE, sort[i], sort[j]); \ ++ } \ ++\ ++ /* Replace mid element. \ ++ */ \ ++ sort[lower + 1] = sort[j]; \ ++ sort[j] = a; \ ++\ ++ /* Move to partition with the kth element. \ ++ */ \ ++ if (j >= rank->index) \ ++ upper = j - 1; \ ++ if (j <= rank->index) \ ++ lower = i; \ + } \ +- \ +- /* Replace mid element. +- */ \ +- sort[lower + 1] = sort[j]; \ +- sort[j] = a; \ +- \ +- /* Move to partition with the kth element. +- */ \ +- if( j >= rank->index ) \ +- upper = j - 1; \ +- if( j <= rank->index ) \ +- lower = i; \ + } \ ++\ ++ q[x] = sort[rank->index]; \ + } \ +- \ +- q[x] = sort[rank->index]; \ +- } \ +-} ++ } + + /* Loop for find max of window. + */ +-#define LOOP_MAX( TYPE ) { \ +- TYPE *q = (TYPE *) VIPS_REGION_ADDR( or, r->left, r->top + y ); \ +- TYPE *p = (TYPE *) VIPS_REGION_ADDR( ir, r->left, r->top + y ); \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- TYPE *d = &p[x]; \ +- TYPE max; \ +- \ +- max = *d; \ +- for( j = 0; j < rank->height; j++ ) { \ +- TYPE *e = d; \ +- \ +- for( i = 0; i < rank->width; i++ ) { \ +- if( *e > max ) \ +- max = *e; \ +- \ +- e += bands; \ ++#define LOOP_MAX(TYPE) \ ++ { \ ++ TYPE *q = (TYPE *) VIPS_REGION_ADDR(or, r->left, r->top + y); \ ++ TYPE *p = (TYPE *) VIPS_REGION_ADDR(ir, r->left, r->top + y); \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ TYPE *d = &p[x]; \ ++ TYPE max; \ ++\ ++ max = *d; \ ++ for (j = 0; j < rank->height; j++) { \ ++ TYPE *e = d; \ ++\ ++ for (i = 0; i < rank->width; i++) { \ ++ if (*e > max) \ ++ max = *e; \ ++\ ++ e += bands; \ ++ } \ ++\ ++ d += ls; \ + } \ +- \ +- d += ls; \ ++\ ++ q[x] = max; \ + } \ +- \ +- q[x] = max; \ +- } \ +-} ++ } + + /* Loop for find min of window. + */ +-#define LOOP_MIN( TYPE ) { \ +- TYPE *q = (TYPE *) VIPS_REGION_ADDR( or, r->left, r->top + y ); \ +- TYPE *p = (TYPE *) VIPS_REGION_ADDR( ir, r->left, r->top + y ); \ +- \ +- for( x = 0; x < sz; x++ ) { \ +- TYPE *d = &p[x]; \ +- TYPE min; \ +- \ +- min = *d; \ +- for( j = 0; j < rank->height; j++ ) { \ +- TYPE *e = d; \ +- \ +- for( i = 0; i < rank->width; i++ ) { \ +- if( *e < min ) \ +- min = *e; \ +- \ +- e += bands; \ ++#define LOOP_MIN(TYPE) \ ++ { \ ++ TYPE *q = (TYPE *) VIPS_REGION_ADDR(or, r->left, r->top + y); \ ++ TYPE *p = (TYPE *) VIPS_REGION_ADDR(ir, r->left, r->top + y); \ ++\ ++ for (x = 0; x < sz; x++) { \ ++ TYPE *d = &p[x]; \ ++ TYPE min; \ ++\ ++ min = *d; \ ++ for (j = 0; j < rank->height; j++) { \ ++ TYPE *e = d; \ ++\ ++ for (i = 0; i < rank->width; i++) { \ ++ if (*e < min) \ ++ min = *e; \ ++\ ++ e += bands; \ ++ } \ ++\ ++ d += ls; \ + } \ +- \ +- d += ls; \ ++\ ++ q[x] = min; \ + } \ +- \ +- q[x] = min; \ +- } \ +-} ++ } + +-#define SWITCH( OPERATION ) \ +- switch( rank->out->BandFmt ) { \ +- case VIPS_FORMAT_UCHAR: OPERATION( unsigned char ); break; \ +- case VIPS_FORMAT_CHAR: OPERATION( signed char ); break; \ +- case VIPS_FORMAT_USHORT: OPERATION( unsigned short ); break; \ +- case VIPS_FORMAT_SHORT: OPERATION( signed short ); break; \ +- case VIPS_FORMAT_UINT: OPERATION( unsigned int ); break; \ +- case VIPS_FORMAT_INT: OPERATION( signed int ); break; \ +- case VIPS_FORMAT_FLOAT: OPERATION( float ); break; \ +- case VIPS_FORMAT_DOUBLE: OPERATION( double ); break; \ +- \ ++#define SWITCH(OPERATION) \ ++ switch (rank->out->BandFmt) { \ ++ case VIPS_FORMAT_UCHAR: \ ++ OPERATION(unsigned char); \ ++ break; \ ++ case VIPS_FORMAT_CHAR: \ ++ OPERATION(signed char); \ ++ break; \ ++ case VIPS_FORMAT_USHORT: \ ++ OPERATION(unsigned short); \ ++ break; \ ++ case VIPS_FORMAT_SHORT: \ ++ OPERATION(signed short); \ ++ break; \ ++ case VIPS_FORMAT_UINT: \ ++ OPERATION(unsigned int); \ ++ break; \ ++ case VIPS_FORMAT_INT: \ ++ OPERATION(signed int); \ ++ break; \ ++ case VIPS_FORMAT_FLOAT: \ ++ OPERATION(float); \ ++ break; \ ++ case VIPS_FORMAT_DOUBLE: \ ++ OPERATION(double); \ ++ break; \ ++\ + default: \ + g_assert_not_reached(); \ +- } ++ } + + static int +-vips_rank_generate( VipsRegion *or, +- void *vseq, void *a, void *b, gboolean *stop ) ++vips_rank_generate(VipsRegion * or, ++ void *vseq, void *a, void *b, gboolean *stop) + { +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsRankSequence *seq = (VipsRankSequence *) vseq; + VipsRegion *ir = seq->ir; + VipsImage *in = (VipsImage *) a; + VipsRank *rank = (VipsRank *) b; + int bands = in->Bands; +- int eaw = rank->width * bands; /* elements across window */ +- int sz = VIPS_REGION_N_ELEMENTS( or ); ++ int eaw = rank->width * bands; /* elements across window */ ++ int sz = VIPS_REGION_N_ELEMENTS(or); + + VipsRect s; + int ls; +@@ -428,149 +447,149 @@ vips_rank_generate( VipsRegion *or, + s = *r; + s.width += rank->width - 1; + s.height += rank->height - 1; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); +- ls = VIPS_REGION_LSKIP( ir ) / VIPS_IMAGE_SIZEOF_ELEMENT( in ); +- +- for( y = 0; y < r->height; y++ ) { +- if( rank->hist_path ) +- vips_rank_generate_uchar( or, seq, rank, y ); +- else if( rank->index == 0 ) +- SWITCH( LOOP_MIN ) +- else if( rank->index == rank->n - 1 ) +- SWITCH( LOOP_MAX ) +- else +- SWITCH( LOOP_SELECT ) } +- +- return( 0 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); ++ ls = VIPS_REGION_LSKIP(ir) / VIPS_IMAGE_SIZEOF_ELEMENT(in); ++ ++ for (y = 0; y < r->height; y++) { ++ if (rank->hist_path) ++ vips_rank_generate_uchar(or, seq, rank, y); ++ else if (rank->index == 0) ++ SWITCH(LOOP_MIN) ++ else if (rank->index == rank->n - 1) ++ SWITCH(LOOP_MAX) ++ else ++ SWITCH(LOOP_SELECT) ++ } ++ ++ return (0); + } + + static int +-vips_rank_build( VipsObject *object ) ++vips_rank_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsMorphology *morphology = VIPS_MORPHOLOGY( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsMorphology *morphology = VIPS_MORPHOLOGY(object); + VipsRank *rank = (VipsRank *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 3 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 3); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_rank_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_rank_parent_class)->build(object)) ++ return (-1); + +- in = morphology->in; ++ in = morphology->in; + +- if( vips_image_decode( in, &t[0] ) ) +- return( -1 ); ++ if (vips_image_decode(in, &t[0])) ++ return (-1); + in = t[0]; + +- if( vips_check_noncomplex( class->nickname, in ) ) +- return( -1 ); +- if( rank->width > in->Xsize || +- rank->height > in->Ysize ) { +- vips_error( class->nickname, "%s", _( "window too large" ) ); +- return( -1 ); ++ if (vips_check_noncomplex(class->nickname, in)) ++ return (-1); ++ if (rank->width > in->Xsize || ++ rank->height > in->Ysize) { ++ vips_error(class->nickname, "%s", _("window too large")); ++ return (-1); + } + rank->n = rank->width * rank->height; +- if( rank->index < 0 || rank->index > rank->n - 1 ) { +- vips_error( class->nickname, "%s", _( "index out of range" ) ); +- return( -1 ); ++ if (rank->index < 0 || rank->index > rank->n - 1) { ++ vips_error(class->nickname, "%s", _("index out of range")); ++ return (-1); + } + + /* Enable the hist path if it'll probably help. + */ +- if( in->BandFmt == VIPS_FORMAT_UCHAR ) { +- /* The hist path is always faster for windows larger than about ++ if (in->BandFmt == VIPS_FORMAT_UCHAR) { ++ /* The hist path is always faster for windows larger than about + * 10x10, and faster for >3x3 on the non-max/min case. + */ +- if( rank->n > 90 ) ++ if (rank->n > 90) + rank->hist_path = TRUE; +- else if( rank->n > 10 && ++ else if (rank->n > 10 && + rank->index != 0 && +- rank->index != rank->n - 1 ) ++ rank->index != rank->n - 1) + rank->hist_path = TRUE; + } + +- /* Expand the input. ++ /* Expand the input. + */ +- if( vips_embed( in, &t[1], +- rank->width / 2, rank->height / 2, +- in->Xsize + rank->width - 1, in->Ysize + rank->height - 1, +- "extend", VIPS_EXTEND_COPY, +- NULL ) ) +- return( -1 ); ++ if (vips_embed(in, &t[1], ++ rank->width / 2, rank->height / 2, ++ in->Xsize + rank->width - 1, in->Ysize + rank->height - 1, ++ "extend", VIPS_EXTEND_COPY, ++ NULL)) ++ return (-1); + in = t[1]; + +- g_object_set( object, "out", vips_image_new(), NULL ); ++ g_object_set(object, "out", vips_image_new(), NULL); + + /* Set demand hints. FATSTRIP is good for us, as THINSTRIP will cause + * too many recalculations on overlaps. + */ +- if( vips_image_pipelinev( rank->out, +- VIPS_DEMAND_STYLE_FATSTRIP, in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(rank->out, ++ VIPS_DEMAND_STYLE_FATSTRIP, in, NULL)) ++ return (-1); + rank->out->Xsize -= rank->width - 1; + rank->out->Ysize -= rank->height - 1; + +- if( vips_image_generate( rank->out, +- vips_rank_start, +- vips_rank_generate, +- vips_rank_stop, +- in, rank ) ) +- return( -1 ); ++ if (vips_image_generate(rank->out, ++ vips_rank_start, ++ vips_rank_generate, ++ vips_rank_stop, ++ in, rank)) ++ return (-1); + + rank->out->Xoffset = 0; + rank->out->Yoffset = 0; + +- vips_reorder_margin_hint( rank->out, rank->width * rank->height ); ++ vips_reorder_margin_hint(rank->out, rank->width * rank->height); + +- return( 0 ); ++ return (0); + } + + static void +-vips_rank_class_init( VipsRankClass *class ) ++vips_rank_class_init(VipsRankClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "rank"; +- object_class->description = _( "rank filter" ); ++ object_class->description = _("rank filter"); + object_class->build = vips_rank_build; + +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsRank, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsRank, out)); + +- VIPS_ARG_INT( class, "width", 4, +- _( "Width" ), +- _( "Window width in pixels" ), ++ VIPS_ARG_INT(class, "width", 4, ++ _("Width"), ++ _("Window width in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsRank, width ), +- 1, 100000, 11 ); ++ G_STRUCT_OFFSET(VipsRank, width), ++ 1, 100000, 11); + +- VIPS_ARG_INT( class, "height", 5, +- _( "Height" ), +- _( "Window height in pixels" ), ++ VIPS_ARG_INT(class, "height", 5, ++ _("Height"), ++ _("Window height in pixels"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsRank, height ), +- 1, 100000, 11 ); ++ G_STRUCT_OFFSET(VipsRank, height), ++ 1, 100000, 11); + +- VIPS_ARG_INT( class, "index", 6, +- _( "Index" ), +- _( "Select pixel at index" ), ++ VIPS_ARG_INT(class, "index", 6, ++ _("Index"), ++ _("Select pixel at index"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsRank, index ), +- 0, 100000000, 50 ); +- ++ G_STRUCT_OFFSET(VipsRank, index), ++ 0, 100000000, 50); + } + + static void +-vips_rank_init( VipsRank *rank ) ++vips_rank_init(VipsRank *rank) + { + rank->width = 11; + rank->height = 11; +@@ -587,38 +606,38 @@ vips_rank_init( VipsRank *rank ) + * @...: %NULL-terminated list of optional named arguments + * + * vips_rank() does rank filtering on an image. A window of size @width by +- * @height is passed over the image. At each position, the pixels inside the +- * window are sorted into ascending order and the pixel at position @index is ++ * @height is passed over the image. At each position, the pixels inside the ++ * window are sorted into ascending order and the pixel at position @index is + * output. @index numbers from 0. + * +- * It works for any non-complex image type, with any number of bands. +- * The input is expanded by copying edge pixels before performing the +- * operation so that the output image has the same size as the input. ++ * It works for any non-complex image type, with any number of bands. ++ * The input is expanded by copying edge pixels before performing the ++ * operation so that the output image has the same size as the input. + * Edge pixels in the output image are therefore only approximate. + * + * For a median filter with mask size m (3 for 3x3, 5 for 5x5, etc.) use + * + * vips_rank( in, out, m, m, m * m / 2 ); + * +- * The special cases n == 0 and n == m * m - 1 are useful dilate and ++ * The special cases n == 0 and n == m * m - 1 are useful dilate and + * expand operators. + * + * See also: vips_conv(), vips_median(), vips_spcor(). + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_rank( VipsImage *in, VipsImage **out, +- int width, int height, int index, ... ) ++int ++vips_rank(VipsImage *in, VipsImage **out, ++ int width, int height, int index, ...) + { + va_list ap; + int result; + +- va_start( ap, index ); +- result = vips_call_split( "rank", ap, in, out, width, height, index ); +- va_end( ap ); ++ va_start(ap, index); ++ result = vips_call_split("rank", ap, in, out, width, height, index); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + /** +@@ -637,15 +656,15 @@ vips_rank( VipsImage *in, VipsImage **out, + * Returns: 0 on success, -1 on error + */ + int +-vips_median( VipsImage *in, VipsImage **out, int size, ... ) ++vips_median(VipsImage *in, VipsImage **out, int size, ...) + { + va_list ap; + int result; + +- va_start( ap, size ); +- result = vips_call_split( "rank", ap, in, out, +- size, size, (size * size) / 2 ); +- va_end( ap ); ++ va_start(ap, size); ++ result = vips_call_split("rank", ap, in, out, ++ size, size, (size * size) / 2); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/mosaicing/chkpair.c b/libvips/mosaicing/chkpair.c +index eca9db5876..71abba5e52 100644 +--- a/libvips/mosaicing/chkpair.c ++++ b/libvips/mosaicing/chkpair.c +@@ -1,4 +1,4 @@ +-/* find image overlaps ++/* find image overlaps + * + * Copyright: 1990, N. Dessipris. + * +@@ -21,28 +21,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -67,12 +67,12 @@ + * @xsec: position in secondary image + * @ysec: position in secondary image + * @hwindowsize: half window size +- * @hsearchsize: half search size ++ * @hsearchsize: half search size + * @correlation: return detected correlation + * @x: return found position + * @y: return found position + * +- * This operation finds the position of @sec within @ref. ++ * This operation finds the position of @sec within @ref. + * + * The area around + * (@xsec, @ysec) is searched for the best match to the area around (@xref, +@@ -84,25 +84,25 @@ + * very large --- the function extracts and generates just the + * parts needed. Correlation is done with vips_spcor(); the position of + * the maximum is found with vips_max(). +- * ++ * + * See also: vips_match(), vips__lrmosaic(). + * + * Returns: 0 on success, -1 on error + */ +-int +-vips__correl( VipsImage *ref, VipsImage *sec, ++int ++vips__correl(VipsImage *ref, VipsImage *sec, + int xref, int yref, int xsec, int ysec, + int hwindowsize, int hsearchsize, +- double *correlation, int *x, int *y ) ++ double *correlation, int *x, int *y) + { + VipsImage *surface = vips_image_new(); + VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( surface ), 5 ); ++ vips_object_local_array(VIPS_OBJECT(surface), 5); + + VipsRect refr, secr; + VipsRect winr, srhr; + VipsRect wincr, srhcr; +- ++ + /* Find position of window and search area, and clip against image + * size. + */ +@@ -114,7 +114,7 @@ vips__correl( VipsImage *ref, VipsImage *sec, + winr.top = yref - hwindowsize; + winr.width = hwindowsize * 2 + 1; + winr.height = hwindowsize * 2 + 1; +- vips_rect_intersectrect( &refr, &winr, &wincr ); ++ vips_rect_intersectrect(&refr, &winr, &wincr); + + secr.left = 0; + secr.top = 0; +@@ -124,18 +124,18 @@ vips__correl( VipsImage *ref, VipsImage *sec, + srhr.top = ysec - hsearchsize; + srhr.width = hsearchsize * 2 + 1; + srhr.height = hsearchsize * 2 + 1; +- vips_rect_intersectrect( &secr, &srhr, &srhcr ); ++ vips_rect_intersectrect(&secr, &srhr, &srhcr); + + /* Extract window and search area. + */ +- if( vips_extract_area( ref, &t[0], +- wincr.left, wincr.top, wincr.width, wincr.height, +- NULL ) || +- vips_extract_area( sec, &t[1], +- srhcr.left, srhcr.top, srhcr.width, srhcr.height, +- NULL ) ) { +- g_object_unref( surface ); +- return( -1 ); ++ if (vips_extract_area(ref, &t[0], ++ wincr.left, wincr.top, wincr.width, wincr.height, ++ NULL) || ++ vips_extract_area(sec, &t[1], ++ srhcr.left, srhcr.top, srhcr.width, srhcr.height, ++ NULL)) { ++ g_object_unref(surface); ++ return (-1); + } + ref = t[0]; + sec = t[1]; +@@ -143,46 +143,46 @@ vips__correl( VipsImage *ref, VipsImage *sec, + /* Make sure we have just one band. From vips_*mosaic() we will, but + * from vips_match() etc. we may not. + */ +- if( ref->Bands != 1 ) { +- if( vips_extract_band( ref, &t[2], 0, NULL ) ) { +- g_object_unref( surface ); +- return( -1 ); ++ if (ref->Bands != 1) { ++ if (vips_extract_band(ref, &t[2], 0, NULL)) { ++ g_object_unref(surface); ++ return (-1); + } + ref = t[2]; + } +- if( sec->Bands != 1 ) { +- if( vips_extract_band( sec, &t[3], 0, NULL ) ) { +- g_object_unref( surface ); +- return( -1 ); ++ if (sec->Bands != 1) { ++ if (vips_extract_band(sec, &t[3], 0, NULL)) { ++ g_object_unref(surface); ++ return (-1); + } + sec = t[3]; + } + + /* Search! + */ +- if( vips_spcor( sec, ref, &t[4], NULL ) ) { +- g_object_unref( surface ); +- return( -1 ); ++ if (vips_spcor(sec, ref, &t[4], NULL)) { ++ g_object_unref(surface); ++ return (-1); + } + + /* Find maximum of correlation surface. + */ +- if( vips_max( t[4], correlation, "x", x, "y", y, NULL ) ) { +- g_object_unref( surface ); +- return( -1 ); ++ if (vips_max(t[4], correlation, "x", x, "y", y, NULL)) { ++ g_object_unref(surface); ++ return (-1); + } +- g_object_unref( surface ); ++ g_object_unref(surface); + + /* Translate back to position within sec. + */ + *x += srhcr.left; + *y += srhcr.top; + +- return( 0 ); ++ return (0); + } + +-int +-vips__chkpair( VipsImage *ref, VipsImage *sec, TiePoints *points ) ++int ++vips__chkpair(VipsImage *ref, VipsImage *sec, TiePoints *points) + { + int i; + int x, y; +@@ -193,27 +193,27 @@ vips__chkpair( VipsImage *ref, VipsImage *sec, TiePoints *points ) + + /* Check images. + */ +- if( vips_image_wio_input( ref ) || vips_image_wio_input( sec ) ) +- return( -1 ); +- if( ref->Bands != sec->Bands || ref->BandFmt != sec->BandFmt || +- ref->Coding != sec->Coding ) { +- vips_error( "vips_chkpair", "%s", _( "inputs incompatible" ) ); +- return( -1 ); ++ if (vips_image_wio_input(ref) || vips_image_wio_input(sec)) ++ return (-1); ++ if (ref->Bands != sec->Bands || ref->BandFmt != sec->BandFmt || ++ ref->Coding != sec->Coding) { ++ vips_error("vips_chkpair", "%s", _("inputs incompatible")); ++ return (-1); + } +- if( ref->Bands != 1 || ref->BandFmt != VIPS_FORMAT_UCHAR ) { +- vips_error( "vips_chkpair", "%s", _( "help!" ) ); +- return( -1 ); ++ if (ref->Bands != 1 || ref->BandFmt != VIPS_FORMAT_UCHAR) { ++ vips_error("vips_chkpair", "%s", _("help!")); ++ return (-1); + } + +- for( i = 0; i < points->nopoints; i++ ) { ++ for (i = 0; i < points->nopoints; i++) { + /* Find correlation point. + */ +- if( vips__correl( ref, sec, +- points->x_reference[i], points->y_reference[i], +- points->x_reference[i], points->y_reference[i], +- hcor, harea, +- &correlation, &x, &y ) ) +- return( -1 ); ++ if (vips__correl(ref, sec, ++ points->x_reference[i], points->y_reference[i], ++ points->x_reference[i], points->y_reference[i], ++ hcor, harea, ++ &correlation, &x, &y)) ++ return (-1); + + /* And note in x_secondary. + */ +@@ -223,11 +223,11 @@ vips__chkpair( VipsImage *ref, VipsImage *sec, TiePoints *points ) + + /* Note each dx, dy too. + */ +- points->dx[i] = ++ points->dx[i] = + points->x_secondary[i] - points->x_reference[i]; +- points->dy[i] = ++ points->dy[i] = + points->y_secondary[i] - points->y_reference[i]; + } + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/mosaicing/global_balance.c b/libvips/mosaicing/global_balance.c +index 86a9050866..e5d916b843 100644 +--- a/libvips/mosaicing/global_balance.c ++++ b/libvips/mosaicing/global_balance.c +@@ -1,7 +1,7 @@ + /* Parse ".desc" files from mosaiced images to generate (x,y) offsets for + * every sub-image. Find all overlap stats and solve balancing with LMS. + * Regenerate mosaic, with balancing fixed. +- * ++ * + * 1/12/93 JC + * - first version, unfinished! + * 6/9/95 JC +@@ -64,28 +64,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -134,104 +134,103 @@ + + */ + static int +-break_items( char *line, char **out ) ++break_items(char *line, char **out) + { + int i; + char *p; + +- for( i = 0; i < MAX_ITEMS; i++ ) { ++ for (i = 0; i < MAX_ITEMS; i++) { + /* Skip to first '<'. + */ +- if( !(p = strchr( line, '<' )) ) ++ if (!(p = strchr(line, '<'))) + break; + + out[i] = line = p + 1; + +- if( !(p = strchr( line, '>' )) ) { +- vips_error( "break_files", "%s", _( "no matching '>'" ) ); +- return( -1 ); ++ if (!(p = strchr(line, '>'))) { ++ vips_error("break_files", "%s", _("no matching '>'")); ++ return (-1); + } + + *p = '\0'; + line = p + 1; + } + +- if( i == MAX_ITEMS ) { +- vips_error( "break_files", "%s", _( "too many items" ) ); +- return( -1 ); ++ if (i == MAX_ITEMS) { ++ vips_error("break_files", "%s", _("too many items")); ++ return (-1); + } + +- return( i ); ++ return (i); + } + + /* Try to open a file. If full path fails, try the current directory. + */ + VipsImage * +-vips__global_open_image( SymbolTable *st, char *name ) ++vips__global_open_image(SymbolTable *st, char *name) + { + char *basename; + VipsImage *image; + +- if( !(image = vips_image_new_from_file( name, NULL ))) { ++ if (!(image = vips_image_new_from_file(name, NULL))) { + /* TODO(kleisauke): Is this behavior the same as im_skip_dir? + * i.e. could we open a filename which came +- * from a win32 (`\\`) on a *nix machine? ++ * from a win32 (`\\`) on a *nix machine? + */ +- basename = g_path_get_basename( name ); ++ basename = g_path_get_basename(name); + +- if( !(image = vips_image_new_from_file( basename, NULL ))) { +- g_free( basename ); +- return( NULL ); ++ if (!(image = vips_image_new_from_file(basename, NULL))) { ++ g_free(basename); ++ return (NULL); + } + +- g_free( basename ); ++ g_free(basename); + } + +- vips_object_local( st->im, image ); ++ vips_object_local(st->im, image); + +- return( image ); ++ return (image); + } + + static void +-junk_node( VipsImage *image, JoinNode *node ) ++junk_node(VipsImage *image, JoinNode *node) + { +- VIPS_FREEF( g_slist_free, node->overlaps ); ++ VIPS_FREEF(g_slist_free, node->overlaps); + } + + /* Hash from a filename to an index into symbol_table. + */ + static int +-hash( char *n ) ++hash(char *n) + { + int i; + int r = 0; +- int l = strlen( n ); ++ int l = strlen(n); + +- for( i = 0; i < l; i++ ) ++ for (i = 0; i < l; i++) + r = ((r + n[i]) * 43) & 0xffffff; + +- return( r % SYM_TAB_SIZE ); ++ return (r % SYM_TAB_SIZE); + } + + /* Make a leaf for a file. + */ + static JoinNode * +-build_node( SymbolTable *st, char *name ) ++build_node(SymbolTable *st, char *name) + { +- JoinNode *node = VIPS_NEW( st->im, JoinNode ); +- int n = hash( name ); ++ JoinNode *node = VIPS_NEW(st->im, JoinNode); ++ int n = hash(name); + + /* Fill fields. + */ +- if( !node || !(node->name = +- vips_strdup( VIPS_OBJECT( st->im ), name )) ) +- return( NULL ); ++ if (!node || !(node->name = vips_strdup(VIPS_OBJECT(st->im), name))) ++ return (NULL); + + node->type = JOIN_LEAF; + node->dirty = 0; + node->mwidth = -2; + node->st = st; +- vips__transform_init( &node->cumtrn ); ++ vips__transform_init(&node->cumtrn); + node->trnim = NULL; + node->arg1 = NULL; + node->arg2 = NULL; +@@ -239,12 +238,12 @@ build_node( SymbolTable *st, char *name ) + node->im = NULL; + node->index = 0; + +- g_signal_connect( st->im, "close", +- G_CALLBACK( junk_node ), node ); ++ g_signal_connect(st->im, "close", ++ G_CALLBACK(junk_node), node); + + /* Try to open. + */ +- if( (node->im = vips__global_open_image( st, name )) ) { ++ if ((node->im = vips__global_open_image(st, name))) { + /* There is a file there - set width and height. + */ + node->cumtrn.oarea.width = node->im->Xsize; +@@ -256,61 +255,62 @@ build_node( SymbolTable *st, char *name ) + vips_error_clear(); + } + +- st->table[n] = g_slist_prepend( st->table[n], node ); ++ st->table[n] = g_slist_prepend(st->table[n], node); + +- return( node ); ++ return (node); + } + + /* Make a new overlap struct. + */ + static OverlapInfo * +-build_overlap( JoinNode *node, JoinNode *other, VipsRect *overlap ) ++build_overlap(JoinNode *node, JoinNode *other, VipsRect *overlap) + { +- OverlapInfo *lap = VIPS_NEW( node->st->im, OverlapInfo ); ++ OverlapInfo *lap = VIPS_NEW(node->st->im, OverlapInfo); + +- if( !lap ) +- return( NULL ); ++ if (!lap) ++ return (NULL); + + lap->node = node; + lap->other = other; + lap->overlap = *overlap; + lap->nstats = NULL; + lap->ostats = NULL; +- node->overlaps = g_slist_prepend( node->overlaps, lap ); ++ node->overlaps = g_slist_prepend(node->overlaps, lap); + node->st->novl++; + +- return( lap ); ++ return (lap); + } + + static void +-overlap_destroy( OverlapInfo *lap ) ++overlap_destroy(OverlapInfo *lap) + { + JoinNode *node = lap->node; + +- node->overlaps = g_slist_remove( node->overlaps, lap ); +- g_assert( node->st->novl > 0 ); ++ node->overlaps = g_slist_remove(node->overlaps, lap); ++ g_assert(node->st->novl > 0); + node->st->novl--; + } + + static void +-junk_table( VipsImage *image, SymbolTable *st ) { ++junk_table(VipsImage *image, SymbolTable *st) ++{ + int i; + +- for( i = 0; i < st->sz; i++ ) +- VIPS_FREEF( g_slist_free, st->table[i] ); ++ for (i = 0; i < st->sz; i++) ++ VIPS_FREEF(g_slist_free, st->table[i]); + } + + /* Build a new symbol table. + */ + SymbolTable * +-vips__build_symtab( VipsImage *out, int sz ) ++vips__build_symtab(VipsImage *out, int sz) + { +- SymbolTable *st = VIPS_NEW( out, SymbolTable ); ++ SymbolTable *st = VIPS_NEW(out, SymbolTable); + int i; + +- if( !st || +- !(st->table = VIPS_ARRAY( out, sz, GSList * )) ) +- return( NULL ); ++ if (!st || ++ !(st->table = VIPS_ARRAY(out, sz, GSList *))) ++ return (NULL); + st->sz = sz; + st->im = out; + st->novl = 0; +@@ -320,106 +320,106 @@ vips__build_symtab( VipsImage *out, int sz ) + st->leaf = NULL; + st->fac = NULL; + +- g_signal_connect( out, "close", +- G_CALLBACK( junk_table ), st ); ++ g_signal_connect(out, "close", ++ G_CALLBACK(junk_table), st); + +- for( i = 0; i < sz; i++ ) ++ for (i = 0; i < sz; i++) + st->table[i] = NULL; + +- return( st ); ++ return (st); + } + + /* Does this node have this file name? + */ + static JoinNode * +-test_name( JoinNode *node, char *name, void *b ) ++test_name(JoinNode *node, char *name, void *b) + { +- if( strcmp( node->name, name ) == 0 ) +- return( node ); ++ if (strcmp(node->name, name) == 0) ++ return (node); + else +- return( NULL ); ++ return (NULL); + } + + /* Look up a filename in the symbol_table. + */ + static JoinNode * +-find_node( SymbolTable *st, char *name ) ++find_node(SymbolTable *st, char *name) + { +- return( vips_slist_map2( st->table[hash( name )], +- (VipsSListMap2Fn) test_name, name, NULL ) ); ++ return (vips_slist_map2(st->table[hash(name)], ++ (VipsSListMap2Fn) test_name, name, NULL)); + } + + /* Given a name: return either the existing node for that name, or a new node + * we have made. + */ + static JoinNode * +-add_node( SymbolTable *st, char *name ) ++add_node(SymbolTable *st, char *name) + { + JoinNode *node; + +- if( !(node = find_node( st, name )) && +- !(node = build_node( st, name )) ) +- return( NULL ); ++ if (!(node = find_node(st, name)) && ++ !(node = build_node(st, name))) ++ return (NULL); + +- return( node ); ++ return (node); + } + +-/* Map a user function over the whole of the symbol table. ++/* Map a user function over the whole of the symbol table. + */ + void * +-vips__map_table( SymbolTable *st, VipsSListMap2Fn fn, void *a, void *b ) ++vips__map_table(SymbolTable *st, VipsSListMap2Fn fn, void *a, void *b) + { + int i; + void *r; +- +- for( i = 0; i < st->sz; i++ ) +- if( (r = vips_slist_map2( st->table[i], fn, a, b )) ) +- return( r ); +- +- return( NULL ); ++ ++ for (i = 0; i < st->sz; i++) ++ if ((r = vips_slist_map2(st->table[i], fn, a, b))) ++ return (r); ++ ++ return (NULL); + } + + /* Set the dirty field on a join. + */ + static void * +-set_dirty( JoinNode *node, int state, void *b ) +-{ ++set_dirty(JoinNode *node, int state, void *b) ++{ + node->dirty = state; + +- return( NULL ); ++ return (NULL); + } + + /* Clean the whole table. + */ + static void +-clean_table( SymbolTable *st ) ++clean_table(SymbolTable *st) + { +- (void) vips__map_table( st, +- (VipsSListMap2Fn) set_dirty, (void *) 0, NULL ); ++ (void) vips__map_table(st, ++ (VipsSListMap2Fn) set_dirty, (void *) 0, NULL); + } + +-/* Do geometry calculations on a node, assuming geo is up to date for any ++/* Do geometry calculations on a node, assuming geo is up to date for any + * children. + */ + static void +-calc_geometry( JoinNode *node ) ++calc_geometry(JoinNode *node) + { + VipsRect um; + +- switch( node->type ) { ++ switch (node->type) { + case JOIN_LR: + case JOIN_TB: + case JOIN_LRROTSCALE: + case JOIN_TBROTSCALE: + /* Join two areas. + */ +- vips_rect_unionrect( &node->arg1->cumtrn.oarea, +- &node->arg2->cumtrn.oarea, &um ); ++ vips_rect_unionrect(&node->arg1->cumtrn.oarea, ++ &node->arg2->cumtrn.oarea, &um); + node->cumtrn.iarea.left = 0; + node->cumtrn.iarea.top = 0; + node->cumtrn.iarea.width = um.width; + node->cumtrn.iarea.height = um.height; +- vips__transform_set_area( &node->cumtrn ); ++ vips__transform_set_area(&node->cumtrn); + break; + + case JOIN_CP: +@@ -431,70 +431,70 @@ calc_geometry( JoinNode *node ) + case JOIN_LEAF: + /* Just use leaf dimensions, if there are any. + */ +- if( node->im ) { ++ if (node->im) { + node->cumtrn.iarea.left = 0; + node->cumtrn.iarea.top = 0; + node->cumtrn.iarea.width = node->im->Xsize; + node->cumtrn.iarea.height = node->im->Ysize; +- vips__transform_set_area( &node->cumtrn ); ++ vips__transform_set_area(&node->cumtrn); + } + break; + + default: +- vips_error_exit( "internal error #98356" ); ++ vips_error_exit("internal error #98356"); + /*NOTREACHED*/ + } + } + + /* Propagate a transform down a tree. If dirty is set, we've been here before, + * so there is a doubling up of this node. If this is a leaf, then we have the +- * same leaf twice (which, in fact, we can cope with); if this is a node, we ++ * same leaf twice (which, in fact, we can cope with); if this is a node, we + * have circularity. + */ + static int +-propagate_transform( JoinNode *node, VipsTransformation *trn ) ++propagate_transform(JoinNode *node, VipsTransformation *trn) + { +- if( !node ) +- return( 0 ); ++ if (!node) ++ return (0); + +- if( node->dirty && node->arg1 && node->arg2 ) { +- vips_error( "vips_global_balance", +- "%s", _( "circularity detected" ) ); +- return( -1 ); ++ if (node->dirty && node->arg1 && node->arg2) { ++ vips_error("vips_global_balance", ++ "%s", _("circularity detected")); ++ return (-1); + } + node->dirty = 1; + + /* Transform our children. + */ +- if( propagate_transform( node->arg1, trn ) || +- propagate_transform( node->arg2, trn ) ) +- return( -1 ); ++ if (propagate_transform(node->arg1, trn) || ++ propagate_transform(node->arg2, trn)) ++ return (-1); + + /* Transform us, and recalculate our position and size. + */ +- vips__transform_add( &node->cumtrn, trn, &node->cumtrn ); +- calc_geometry( node ); ++ vips__transform_add(&node->cumtrn, trn, &node->cumtrn); ++ calc_geometry(node); + +- return( 0 ); ++ return (0); + } + + /* Ah ha! A leaf is actually made up of two smaller files with an lr or a tb +- * merge. Turn a leaf node into a join node. Propagate the transform down ++ * merge. Turn a leaf node into a join node. Propagate the transform down + * arg2's side of the tree. + */ + static int +-make_join( SymbolTable *st, JoinType type, +- JoinNode *arg1, JoinNode *arg2, JoinNode *out, +- double a, double b, double dx, double dy, int mwidth ) ++make_join(SymbolTable *st, JoinType type, ++ JoinNode *arg1, JoinNode *arg2, JoinNode *out, ++ double a, double b, double dx, double dy, int mwidth) + { + VipsTransformation trn; + + /* Check output is ok. + */ +- if( out->type != JOIN_LEAF ) { +- vips_error( "vips_global_balance", +- _( "image \"%s\" used twice as output" ), out->name ); +- return( -1 ); ++ if (out->type != JOIN_LEAF) { ++ vips_error("vips_global_balance", ++ _("image \"%s\" used twice as output"), out->name); ++ return (-1); + } + + /* Fill fields. +@@ -519,13 +519,13 @@ make_join( SymbolTable *st, JoinType type, + /* Clean the table and propagate the transform down the RHS of the + * graph. + */ +- clean_table( st ); +- if( propagate_transform( arg2, &out->thistrn ) ) +- return( -1 ); ++ clean_table(st); ++ if (propagate_transform(arg2, &out->thistrn)) ++ return (-1); + + /* Find the position and size of our output. + */ +- calc_geometry( out ); ++ calc_geometry(out); + + /* Now normalise the result, so that out is at (0,0) again. + */ +@@ -537,24 +537,24 @@ make_join( SymbolTable *st, JoinType type, + trn.idy = 0; + trn.odx = -out->cumtrn.oarea.left; + trn.ody = -out->cumtrn.oarea.top; +- clean_table( st ); +- if( propagate_transform( out, &trn ) ) +- return( -1 ); ++ clean_table(st); ++ if (propagate_transform(out, &trn)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Make a copy node. + */ + static int +-make_copy( SymbolTable *st, JoinNode *before, JoinNode *after ) ++make_copy(SymbolTable *st, JoinNode *before, JoinNode *after) + { + /* Check output is ok. + */ +- if( after->type != JOIN_LEAF ) { +- vips_error( "vips_global_balance", +- _( "image \"%s\" used twice as output" ), after->name ); +- return( -1 ); ++ if (after->type != JOIN_LEAF) { ++ vips_error("vips_global_balance", ++ _("image \"%s\" used twice as output"), after->name); ++ return (-1); + } + + /* Fill fields. +@@ -565,28 +565,28 @@ make_copy( SymbolTable *st, JoinNode *before, JoinNode *after ) + + /* Copy over the position and size from the before to the after. + */ +- calc_geometry( after ); ++ calc_geometry(after); + +- return( 0 ); ++ return (0); + } + + /* Process a single .desc line. + */ + static int +-process_line( SymbolTable *st, const char *text ) ++process_line(SymbolTable *st, const char *text) + { + char line[1024]; + + #ifdef DEBUG +- printf( "read: %s\n", text ); ++ printf("read: %s\n", text); + #endif /*DEBUG*/ + + /* We destroy line during the parse. + */ +- vips_strncpy( line, text, 1024 ); ++ vips_strncpy(line, text, 1024); + +- if( vips_isprefix( "#LRJOIN ", line ) || +- vips_isprefix( "#TBJOIN ", line ) ) { ++ if (vips_isprefix("#LRJOIN ", line) || ++ vips_isprefix("#TBJOIN ", line)) { + /* Yes: magic join command. Break into tokens. Format is eg. + + #LRJOIN [] +@@ -598,35 +598,35 @@ process_line( SymbolTable *st, const char *text ) + JoinNode *arg1, *arg2, *join; + int dx, dy, mwidth; + +- if( (nitems = break_items( line, item )) < 0 ) +- return( -1 ); +- if( nitems != 5 && nitems != 6 ) { +- vips_error( "global_balance", +- "%s", _( "bad number of args in join line" ) ); +- return( -1 ); ++ if ((nitems = break_items(line, item)) < 0) ++ return (-1); ++ if (nitems != 5 && nitems != 6) { ++ vips_error("global_balance", ++ "%s", _("bad number of args in join line")); ++ return (-1); + } + +- if( !(arg1 = add_node( st, item[0] )) || +- !(arg2 = add_node( st, item[1] )) || +- !(join = add_node( st, item[2] )) ) +- return( -1 ); +- dx = atoi( item[3] ); +- dy = atoi( item[4] ); +- if( nitems == 6 ) +- mwidth = atoi( item[5] ); ++ if (!(arg1 = add_node(st, item[0])) || ++ !(arg2 = add_node(st, item[1])) || ++ !(join = add_node(st, item[2]))) ++ return (-1); ++ dx = atoi(item[3]); ++ dy = atoi(item[4]); ++ if (nitems == 6) ++ mwidth = atoi(item[5]); + else + mwidth = -1; +- if( vips_isprefix( "#LRJOIN ", line ) ) ++ if (vips_isprefix("#LRJOIN ", line)) + type = JOIN_LR; + else + type = JOIN_TB; + +- if( make_join( st, type, arg1, arg2, +- join, 1.0, 0.0, dx, dy, mwidth ) ) +- return( -1 ); ++ if (make_join(st, type, arg1, arg2, ++ join, 1.0, 0.0, dx, dy, mwidth)) ++ return (-1); + } +- else if( vips_isprefix( "#LRROTSCALE ", line ) || +- vips_isprefix( "#TBROTSCALE ", line ) ) { ++ else if (vips_isprefix("#LRROTSCALE ", line) || ++ vips_isprefix("#TBROTSCALE ", line)) { + /* Rot + scale. Format is eg. + + #LRROTSCALE \ +@@ -640,172 +640,172 @@ process_line( SymbolTable *st, const char *text ) + double a, b, dx, dy; + int mwidth; + +- if( (nitems = break_items( line, item )) < 0 ) +- return( -1 ); +- if( nitems != 7 && nitems != 8 ) { +- vips_error( "global_balance", +- "%s", _( "bad number of args in join1 line" ) ); +- return( -1 ); ++ if ((nitems = break_items(line, item)) < 0) ++ return (-1); ++ if (nitems != 7 && nitems != 8) { ++ vips_error("global_balance", ++ "%s", _("bad number of args in join1 line")); ++ return (-1); + } + +- if( !(arg1 = add_node( st, item[0] )) || +- !(arg2 = add_node( st, item[1] )) || +- !(join = add_node( st, item[2] )) ) +- return( -1 ); +- a = g_ascii_strtod( item[3], NULL ); +- b = g_ascii_strtod( item[4], NULL ); +- dx = g_ascii_strtod( item[5], NULL ); +- dy = g_ascii_strtod( item[6], NULL ); +- if( nitems == 8 ) +- mwidth = atoi( item[7] ); ++ if (!(arg1 = add_node(st, item[0])) || ++ !(arg2 = add_node(st, item[1])) || ++ !(join = add_node(st, item[2]))) ++ return (-1); ++ a = g_ascii_strtod(item[3], NULL); ++ b = g_ascii_strtod(item[4], NULL); ++ dx = g_ascii_strtod(item[5], NULL); ++ dy = g_ascii_strtod(item[6], NULL); ++ if (nitems == 8) ++ mwidth = atoi(item[7]); + else + mwidth = -1; +- if( vips_isprefix( "#LRROTSCALE ", line ) ) ++ if (vips_isprefix("#LRROTSCALE ", line)) + type = JOIN_LRROTSCALE; + else + type = JOIN_TBROTSCALE; + +- if( make_join( st, type, arg1, arg2, +- join, a, b, dx, dy, mwidth ) ) +- return( -1 ); ++ if (make_join(st, type, arg1, arg2, ++ join, a, b, dx, dy, mwidth)) ++ return (-1); + } +- else if( vips_isprefix( "copy ", line ) ) { ++ else if (vips_isprefix("copy ", line)) { + /* vips_copy() call ... make a JOIN_CP node. + */ + char *item[MAX_ITEMS]; + int nitems; + JoinNode *before, *after; + +- if( (nitems = break_items( line, item )) < 0 ) +- return( -1 ); +- if( nitems != 2 ) { +- vips_error( "global_balance", +- "%s", _( "bad number of args in copy line" ) ); +- return( -1 ); ++ if ((nitems = break_items(line, item)) < 0) ++ return (-1); ++ if (nitems != 2) { ++ vips_error("global_balance", ++ "%s", _("bad number of args in copy line")); ++ return (-1); + } + +- if( !(before = add_node( st, item[0] )) || +- !(after = add_node( st, item[1] )) || +- make_copy( st, before, after ) ) +- return( -1 ); ++ if (!(before = add_node(st, item[0])) || ++ !(after = add_node(st, item[1])) || ++ make_copy(st, before, after)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Set the dirty flag on any nodes we reference. + */ + static void * +-set_referenced( JoinNode *node, void *a, void *b ) ++set_referenced(JoinNode *node, void *a, void *b) + { +- if( node->arg1 ) ++ if (node->arg1) + node->arg1->dirty = 1; +- if( node->arg2 ) ++ if (node->arg2) + node->arg2->dirty = 1; +- +- return( NULL ); ++ ++ return (NULL); + } + + /* Is this a root node? Should be clean. + */ + static void * +-is_root( JoinNode *node, void *a, void *b ) ++is_root(JoinNode *node, void *a, void *b) + { +- if( !node->dirty ) +- return( (void *) node ); ++ if (!node->dirty) ++ return ((void *) node); + else +- return( NULL ); ++ return (NULL); + } + + /* Scan the symbol table, looking for a node which no node references. + */ + static JoinNode * +-find_root( SymbolTable *st ) ++find_root(SymbolTable *st) + { + JoinNode *root; + + /* Clean the table, then scan it, setting all pointed-to nodes dirty. + */ +- clean_table( st ); +- vips__map_table( st, (VipsSListMap2Fn) set_referenced, NULL, NULL ); ++ clean_table(st); ++ vips__map_table(st, (VipsSListMap2Fn) set_referenced, NULL, NULL); + + /* Look for the first clean symbol. + */ +- root = (JoinNode *) vips__map_table( st, +- (VipsSListMap2Fn) is_root, NULL, NULL ); ++ root = (JoinNode *) vips__map_table(st, ++ (VipsSListMap2Fn) is_root, NULL, NULL); + + /* No root? Hot dang! + */ +- if( !root ) { +- vips_error( "vips_global_balance", +- "%s", _( "mosaic root not found in desc file\n" +- "is this really a mosaiced image?" ) ); +- return( NULL ); ++ if (!root) { ++ vips_error("vips_global_balance", ++ "%s", _("mosaic root not found in desc file\n" ++ "is this really a mosaiced image?")); ++ return (NULL); + } + + /* Now dirty that - then if there are any more clean symbols, we have + * more than one root. + */ + root->dirty = 1; +- if( vips__map_table( st, (VipsSListMap2Fn) is_root, NULL, NULL ) ) { +- vips_error( "vips_global_balance", +- "%s", _( "more than one root" ) ); +- return( NULL ); ++ if (vips__map_table(st, (VipsSListMap2Fn) is_root, NULL, NULL)) { ++ vips_error("vips_global_balance", ++ "%s", _("more than one root")); ++ return (NULL); + } + +- return( root ); ++ return (root); + } + + /* Walk history_list and parse each line. + */ + int +-vips__parse_desc( SymbolTable *st, VipsImage *in ) ++vips__parse_desc(SymbolTable *st, VipsImage *in) + { + GSList *p; + +- for( p = in->history_list; p; p = p->next ) { ++ for (p = in->history_list; p; p = p->next) { + GValue *value = (GValue *) p->data; + +- g_assert( G_VALUE_TYPE( value ) == VIPS_TYPE_REF_STRING ); ++ g_assert(G_VALUE_TYPE(value) == VIPS_TYPE_REF_STRING); + +- if( process_line( st, vips_value_get_ref_string( value, NULL ) ) ) +- return( -1 ); ++ if (process_line(st, vips_value_get_ref_string(value, NULL))) ++ return (-1); + } + + /* Find root. + */ +- if( !(st->root = find_root( st )) ) +- return( -1 ); ++ if (!(st->root = find_root(st))) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Count and index all leaf images. + */ + static void * +-count_leaves( JoinNode *node, void *a, void *b ) ++count_leaves(JoinNode *node, void *a, void *b) + { +- if( node->type == JOIN_LEAF ) { ++ if (node->type == JOIN_LEAF) { + node->index = node->st->nim; + node->st->nim++; + } + +- return( NULL ); ++ return (NULL); + } + + #ifdef DEBUG + /* Print a JoinNode. + */ + static void +-print_node( JoinNode *node ) ++print_node(JoinNode *node) + { +- char *basename = g_path_get_basename( node->name ); +- printf( "%s, position %dx%d, size %dx%d, index %d\n", ++ char *basename = g_path_get_basename(node->name); ++ printf("%s, position %dx%d, size %dx%d, index %d\n", + basename, + node->cumtrn.oarea.left, node->cumtrn.oarea.top, + node->cumtrn.oarea.width, node->cumtrn.oarea.height, +- node->index ); +- g_free( basename ); ++ node->index); ++ g_free(basename); + } + #endif /*DEBUG*/ + +@@ -813,59 +813,65 @@ print_node( JoinNode *node ) + /* Print a leaf. + */ + static void * +-print_leaf( JoinNode *node, void *a, void *b ) ++print_leaf(JoinNode *node, void *a, void *b) + { +- if( node->type == JOIN_LEAF ) +- print_node( node ); ++ if (node->type == JOIN_LEAF) ++ print_node(node); + +- return( NULL ); ++ return (NULL); + } + #endif /*DEBUG*/ + + /* Count all join nodes. + */ + static void * +-count_joins( JoinNode *node, void *a, void *b ) ++count_joins(JoinNode *node, void *a, void *b) + { +- if( node->type == JOIN_TB || ++ if (node->type == JOIN_TB || + node->type == JOIN_LR || + node->type == JOIN_LRROTSCALE || +- node->type == JOIN_TBROTSCALE ) ++ node->type == JOIN_TBROTSCALE) + node->st->njoin++; + +- return( NULL ); ++ return (NULL); + } + + #ifdef DEBUG + /* Print a few spaces. + */ + static void +-spc( int n ) ++spc(int n) + { + int i; + +- for( i = 0; i < n; i++ ) +- printf( " " ); ++ for (i = 0; i < n; i++) ++ printf(" "); + } + #endif /*DEBUG*/ + + #ifdef DEBUG + static char * +-JoinType2char( JoinType type ) ++JoinType2char(JoinType type) + { +- switch( type ) { +- case JOIN_LR: return( "JOIN_LR" ); +- case JOIN_TB: return( "JOIN_TB" ); +- case JOIN_LRROTSCALE: return( "JOIN_LRROTSCALE" ); +- case JOIN_TBROTSCALE: return( "JOIN_TBROTSCALE" ); +- case JOIN_CP: return( "JOIN_CP" ); +- case JOIN_LEAF: return( "JOIN_LEAF" ); ++ switch (type) { ++ case JOIN_LR: ++ return ("JOIN_LR"); ++ case JOIN_TB: ++ return ("JOIN_TB"); ++ case JOIN_LRROTSCALE: ++ return ("JOIN_LRROTSCALE"); ++ case JOIN_TBROTSCALE: ++ return ("JOIN_TBROTSCALE"); ++ case JOIN_CP: ++ return ("JOIN_CP"); ++ case JOIN_LEAF: ++ return ("JOIN_LEAF"); + + default: +- vips_error_exit( "internal error #9275" ); ++ vips_error_exit("internal error #9275"); + /*NOTEACHED*/ + +- return( NULL ); ++ return (NULL); + } + } + #endif /*DEBUG*/ +@@ -874,44 +880,44 @@ JoinType2char( JoinType type ) + /* Print a join node. + */ + static void * +-print_joins( JoinNode *node, int indent ) ++print_joins(JoinNode *node, int indent) + { +- char *basename = g_path_get_basename( node->name ); ++ char *basename = g_path_get_basename(node->name); + +- switch( node->type ) { ++ switch (node->type) { + case JOIN_TB: + case JOIN_LR: + case JOIN_TBROTSCALE: + case JOIN_LRROTSCALE: +- spc( indent ); +- printf( "%s to make %s, size %dx%d, pos. %dx%d, of:\n", +- JoinType2char( node->type ), ++ spc(indent); ++ printf("%s to make %s, size %dx%d, pos. %dx%d, of:\n", ++ JoinType2char(node->type), + basename, + node->cumtrn.oarea.width, node->cumtrn.oarea.height, +- node->cumtrn.oarea.left, node->cumtrn.oarea.top ); +- spc( indent ); +- printf( "reference:\n" ); +- print_joins( node->arg1, indent + 2 ); +- spc( indent ); +- printf( "secondary:\n" ); +- print_joins( node->arg2, indent + 2 ); ++ node->cumtrn.oarea.left, node->cumtrn.oarea.top); ++ spc(indent); ++ printf("reference:\n"); ++ print_joins(node->arg1, indent + 2); ++ spc(indent); ++ printf("secondary:\n"); ++ print_joins(node->arg2, indent + 2); + break; + + case JOIN_CP: +- spc( indent ); +- printf( "copy to make %s of:\n", basename ); +- print_joins( node->arg1, indent + 2 ); ++ spc(indent); ++ printf("copy to make %s of:\n", basename); ++ print_joins(node->arg1, indent + 2); + break; + + case JOIN_LEAF: +- spc( indent ); +- printf( "input image %s\n", basename ); ++ spc(indent); ++ printf("input image %s\n", basename); + break; + } + +- g_free( basename ); ++ g_free(basename); + +- return( NULL ); ++ return (NULL); + } + #endif /*DEBUG*/ + +@@ -919,21 +925,21 @@ print_joins( JoinNode *node, int indent ) + /* Print an overlap. + */ + static void * +-print_overlap( OverlapInfo *lap, void *a, void *b ) ++print_overlap(OverlapInfo *lap, void *a, void *b) + { +- char *basename_node = g_path_get_basename( lap->node->name ); +- char *basename_other = g_path_get_basename( lap->other->name ); +- +- printf( "-> %s overlaps with %s; (this, other) = (%.4G, %.4G)\n", ++ char *basename_node = g_path_get_basename(lap->node->name); ++ char *basename_other = g_path_get_basename(lap->other->name); ++ ++ printf("-> %s overlaps with %s; (this, other) = (%.4G, %.4G)\n", + basename_node, + basename_other, +- *VIPS_MATRIX( lap->nstats, 4, 0 ), +- *VIPS_MATRIX( lap->ostats, 4, 0 ) ); ++ *VIPS_MATRIX(lap->nstats, 4, 0), ++ *VIPS_MATRIX(lap->ostats, 4, 0)); + +- g_free( basename_node ); +- g_free( basename_other ); +- +- return( NULL ); ++ g_free(basename_node); ++ g_free(basename_other); ++ ++ return (NULL); + } + #endif /*DEBUG*/ + +@@ -941,19 +947,19 @@ print_overlap( OverlapInfo *lap, void *a, void *b ) + /* Print the overlaps on a leaf. + */ + static void * +-print_overlaps( JoinNode *node, void *a, void *b ) ++print_overlaps(JoinNode *node, void *a, void *b) + { + char *basename; +- +- if( node->type == JOIN_LEAF && g_slist_length( node->overlaps ) > 0 ) { +- basename = g_path_get_basename( node->name ); +- printf( "overlap of %s with:\n", basename ); +- g_free( basename ); +- vips_slist_map2( node->overlaps, +- (VipsSListMap2Fn) print_overlap, NULL, NULL ); ++ ++ if (node->type == JOIN_LEAF && g_slist_length(node->overlaps) > 0) { ++ basename = g_path_get_basename(node->name); ++ printf("overlap of %s with:\n", basename); ++ g_free(basename); ++ vips_slist_map2(node->overlaps, ++ (VipsSListMap2Fn) print_overlap, NULL, NULL); + } + +- return( NULL ); ++ return (NULL); + } + #endif /*DEBUG*/ + +@@ -961,27 +967,27 @@ print_overlaps( JoinNode *node, void *a, void *b ) + /* Print and accumulate the error on an overlap. + */ + static void * +-print_overlap_error( OverlapInfo *lap, double *fac, double *total ) ++print_overlap_error(OverlapInfo *lap, double *fac, double *total) + { +- char *basename_other = g_path_get_basename( lap->other->name ); +- double na = *VIPS_MATRIX( lap->nstats, 4, 0 ); +- double oa = *VIPS_MATRIX( lap->ostats, 4, 0 ); ++ char *basename_other = g_path_get_basename(lap->other->name); ++ double na = *VIPS_MATRIX(lap->nstats, 4, 0); ++ double oa = *VIPS_MATRIX(lap->ostats, 4, 0); + double err; + +- if( fac ) { ++ if (fac) { + na *= fac[lap->node->index]; + oa *= fac[lap->other->index]; + } + + err = na - oa; + +- printf( "-> file %s, error = %g\n", +- basename_other, err ); ++ printf("-> file %s, error = %g\n", ++ basename_other, err); + *total += err * err; +- +- g_free( basename_other ); + +- return( NULL ); ++ g_free(basename_other); ++ ++ return (NULL); + } + #endif /*DEBUG*/ + +@@ -989,127 +995,127 @@ print_overlap_error( OverlapInfo *lap, double *fac, double *total ) + /* Print and accumulate the overlap errors on a leaf. + */ + static void * +-print_overlap_errors( JoinNode *node, double *fac, double *total ) ++print_overlap_errors(JoinNode *node, double *fac, double *total) + { + char *basename; +- +- if( node->type == JOIN_LEAF && g_slist_length( node->overlaps ) > 0 ) { +- basename = g_path_get_basename( node->name ); +- printf( "overlap of %s (index %d) with:\n", basename, +- node->index ); +- g_free( basename ); +- vips_slist_map2( node->overlaps, +- (VipsSListMap2Fn) print_overlap_error, fac, total ); ++ ++ if (node->type == JOIN_LEAF && g_slist_length(node->overlaps) > 0) { ++ basename = g_path_get_basename(node->name); ++ printf("overlap of %s (index %d) with:\n", basename, ++ node->index); ++ g_free(basename); ++ vips_slist_map2(node->overlaps, ++ (VipsSListMap2Fn) print_overlap_error, fac, total); + } + +- return( NULL ); ++ return (NULL); + } + #endif /*DEBUG*/ + + /* Extract a rect. + */ + static int +-extract_rect( VipsImage *in, VipsImage **out, VipsRect *r ) ++extract_rect(VipsImage *in, VipsImage **out, VipsRect *r) + { +- return( vips_extract_area( in, out, +- r->left, r->top, r->width, r->height, NULL ) ); ++ return (vips_extract_area(in, out, ++ r->left, r->top, r->width, r->height, NULL)); + } + + /* Two images overlap in an area ... make a mask the size of the area, which + * has 255 for every pixel where both images are non-zero. + */ + static int +-make_overlap_mask( VipsImage *mem, +- VipsImage *ref, VipsImage *sec, VipsImage **mask, +- VipsRect *rarea, VipsRect *sarea ) ++make_overlap_mask(VipsImage *mem, ++ VipsImage *ref, VipsImage *sec, VipsImage **mask, ++ VipsRect *rarea, VipsRect *sarea) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( mem ), 6 ); +- +- if( extract_rect( ref, &t[0], rarea ) || +- extract_rect( sec, &t[1], sarea ) || +- vips_extract_band( t[0], &t[2], 0, NULL ) || +- vips_extract_band( t[1], &t[3], 0, NULL ) || +- vips_notequal_const1( t[2], &t[4], 0.0, NULL ) || +- vips_notequal_const1( t[3], &t[5], 0.0, NULL ) || +- vips_andimage( t[4], t[5], mask, NULL ) ) +- return( -1 ); +- +- return( 0 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(mem), 6); ++ ++ if (extract_rect(ref, &t[0], rarea) || ++ extract_rect(sec, &t[1], sarea) || ++ vips_extract_band(t[0], &t[2], 0, NULL) || ++ vips_extract_band(t[1], &t[3], 0, NULL) || ++ vips_notequal_const1(t[2], &t[4], 0.0, NULL) || ++ vips_notequal_const1(t[3], &t[5], 0.0, NULL) || ++ vips_andimage(t[4], t[5], mask, NULL)) ++ return (-1); ++ ++ return (0); + } + + /* Find the number of non-zero pixels in a mask image. + */ + static int +-count_nonzero( VipsImage *in, gint64 *count ) ++count_nonzero(VipsImage *in, gint64 *count) + { + double avg; + +- if( vips_avg( in, &avg, NULL ) ) +- return( -1 ); +- *count = (avg * VIPS_IMAGE_N_PELS( in )) / 255.0; ++ if (vips_avg(in, &avg, NULL)) ++ return (-1); ++ *count = (avg * VIPS_IMAGE_N_PELS(in)) / 255.0; + +- return( 0 ); ++ return (0); + } + + /* Find stats on an area of an IMAGE ... consider only pixels for which the + * mask is true. + */ + static VipsImage * +-find_image_stats( VipsImage *mem, +- VipsImage *in, VipsImage *mask, VipsRect *area ) ++find_image_stats(VipsImage *mem, ++ VipsImage *in, VipsImage *mask, VipsRect *area) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( mem ), 5 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(mem), 5); + + gint64 count; + + /* Extract area, build black image, mask out pixels we want. + */ +- if( extract_rect( in, &t[0], area ) || +- vips_black( &t[1], t[0]->Xsize, t[0]->Ysize, +- "bands", t[0]->Bands, +- NULL ) || +- vips_cast( t[1], &t[2], t[0]->BandFmt, NULL ) || +- vips_ifthenelse( mask, t[0], t[2], &t[3], NULL ) ) +- return( NULL ); ++ if (extract_rect(in, &t[0], area) || ++ vips_black(&t[1], t[0]->Xsize, t[0]->Ysize, ++ "bands", t[0]->Bands, ++ NULL) || ++ vips_cast(t[1], &t[2], t[0]->BandFmt, NULL) || ++ vips_ifthenelse(mask, t[0], t[2], &t[3], NULL)) ++ return (NULL); + + /* Get stats from masked image. + */ +- if( vips_stats( t[3], &t[4], NULL ) ) +- return( NULL ); ++ if (vips_stats(t[3], &t[4], NULL)) ++ return (NULL); + + /* Number of non-zero pixels in mask. + */ +- if( count_nonzero( mask, &count ) ) +- return( NULL ); ++ if (count_nonzero(mask, &count)) ++ return (NULL); + + /* And scale masked average to match. + */ +- *VIPS_MATRIX( t[4], 4, 0 ) *= +- (double) count / VIPS_IMAGE_N_PELS( mask ); ++ *VIPS_MATRIX(t[4], 4, 0) *= ++ (double) count / VIPS_IMAGE_N_PELS(mask); + + /* Yuk! Zap the deviation column with the pixel count. Used later to + * determine if this is likely to be a significant overlap. + */ +- *VIPS_MATRIX( t[4], 5, 0 ) = count; ++ *VIPS_MATRIX(t[4], 5, 0) = count; + + #ifdef DEBUG +- if( count == 0 ) +- g_warning( "global_balance %s", _( "empty overlap!" ) ); ++ if (count == 0) ++ g_warning("global_balance %s", _("empty overlap!")); + #endif /*DEBUG*/ + +- return( t[4] ); ++ return (t[4]); + } + + /* Find the stats for an overlap struct. + */ + static int +-find_overlap_stats( OverlapInfo *lap ) ++find_overlap_stats(OverlapInfo *lap) + { + VipsImage *mem = lap->node->st->im; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( mem ), 1 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(mem), 1); + + VipsRect rarea, sarea; + +@@ -1129,93 +1135,93 @@ find_overlap_stats( OverlapInfo *lap ) + + /* Make a mask for the overlap. + */ +- if( make_overlap_mask( mem, +- lap->node->trnim, lap->other->trnim, &t[0], &rarea, &sarea ) ) +- return( -1 ); ++ if (make_overlap_mask(mem, ++ lap->node->trnim, lap->other->trnim, &t[0], &rarea, &sarea)) ++ return (-1); + + /* Find stats for that area. + */ +- if( !(lap->nstats = find_image_stats( mem, +- lap->node->trnim, t[0], &rarea )) ) +- return( -1 ); +- if( !(lap->ostats = find_image_stats( mem, +- lap->other->trnim, t[0], &sarea )) ) +- return( -1 ); +- +- return( 0 ); ++ if (!(lap->nstats = find_image_stats(mem, ++ lap->node->trnim, t[0], &rarea))) ++ return (-1); ++ if (!(lap->ostats = find_image_stats(mem, ++ lap->other->trnim, t[0], &sarea))) ++ return (-1); ++ ++ return (0); + } + + /* Sub-fn. of below. + */ + static void * +-overlap_eq( OverlapInfo *this, JoinNode *node, void *b ) ++overlap_eq(OverlapInfo *this, JoinNode *node, void *b) + { +- if( this->other == node ) +- return( this ); ++ if (this->other == node) ++ return (this); + else +- return( NULL ); ++ return (NULL); + } + + /* Is this an overlapping leaf? If yes, add to overlap list. + */ + static void * +-test_overlap( JoinNode *other, JoinNode *node, void *b ) ++test_overlap(JoinNode *other, JoinNode *node, void *b) + { + VipsRect overlap; + OverlapInfo *lap; + + /* Is other a suitable leaf to overlap with node? + */ +- if( other->type != JOIN_LEAF || node == other ) +- return( NULL ); ++ if (other->type != JOIN_LEAF || node == other) ++ return (NULL); + + /* Is there an overlap? + */ +- vips_rect_intersectrect( &node->cumtrn.oarea, &other->cumtrn.oarea, +- &overlap ); +- if( vips_rect_isempty( &overlap ) ) +- return( NULL ); ++ vips_rect_intersectrect(&node->cumtrn.oarea, &other->cumtrn.oarea, ++ &overlap); ++ if (vips_rect_isempty(&overlap)) ++ return (NULL); + + /* Is this a trivial overlap? Ignore it if it is. + */ +- if( overlap.width * overlap.height < TRIVIAL ) ++ if (overlap.width * overlap.height < TRIVIAL) + /* Too few pixels. + */ +- return( NULL ); ++ return (NULL); + +- /* Have we already added this overlap the other way around? ie. is ++ /* Have we already added this overlap the other way around? ie. is + * node on other's overlap list? + */ +- if( vips_slist_map2( other->overlaps, +- (VipsSListMap2Fn) overlap_eq, node, NULL ) ) +- return( NULL ); ++ if (vips_slist_map2(other->overlaps, ++ (VipsSListMap2Fn) overlap_eq, node, NULL)) ++ return (NULL); + + /* A new overlap - add to overlap list. + */ +- if( !(lap = build_overlap( node, other, &overlap )) ) +- return( node ); ++ if (!(lap = build_overlap(node, other, &overlap))) ++ return (node); + +- /* Calculate overlap statistics. Open stuff relative to this, and ++ /* Calculate overlap statistics. Open stuff relative to this, and + * free quickly. + */ +- if( find_overlap_stats( lap ) ) +- return( node ); ++ if (find_overlap_stats(lap)) ++ return (node); + + /* If the pixel count either masked overlap is trivial, ignore this + * overlap. + */ +- if( *VIPS_MATRIX( lap->nstats, 5, 0 ) < TRIVIAL || +- *VIPS_MATRIX( lap->ostats, 5, 0 ) < TRIVIAL ) { ++ if (*VIPS_MATRIX(lap->nstats, 5, 0) < TRIVIAL || ++ *VIPS_MATRIX(lap->ostats, 5, 0) < TRIVIAL) { + #ifdef DEBUG +- printf( "trivial overlap ... junking\n" ); +- printf( "nstats count = %g, ostats count = %g\n", +- *VIPS_MATRIX( lap->nstats, 5, 0 ), *VIPS_MATRIX( lap->ostats, 5, 0 ) ); +- print_overlap( lap, NULL, NULL ); ++ printf("trivial overlap ... junking\n"); ++ printf("nstats count = %g, ostats count = %g\n", ++ *VIPS_MATRIX(lap->nstats, 5, 0), *VIPS_MATRIX(lap->ostats, 5, 0)); ++ print_overlap(lap, NULL, NULL); + #endif /*DEBUG*/ +- overlap_destroy( lap ); ++ overlap_destroy(lap); + } + +- return( NULL ); ++ return (NULL); + } + + /* If this is a leaf, look at all other joins for a leaf that overlaps. Aside: +@@ -1223,87 +1229,87 @@ test_overlap( JoinNode *other, JoinNode *node, void *b ) + * not. + */ + static void * +-find_overlaps( JoinNode *node, SymbolTable *st, void *b ) ++find_overlaps(JoinNode *node, SymbolTable *st, void *b) + { +- if( node->type == JOIN_LEAF ) { ++ if (node->type == JOIN_LEAF) { + /* Check for image. + */ +- if( !node->im ) { +- vips_error( "vips_global_balance", +- _( "unable to open \"%s\"" ), node->name ); +- return( node ); ++ if (!node->im) { ++ vips_error("vips_global_balance", ++ _("unable to open \"%s\""), node->name); ++ return (node); + } +- if( !node->trnim ) +- vips_error_exit( "global_balance: sanity failure #9834" ); ++ if (!node->trnim) ++ vips_error_exit("global_balance: sanity failure #9834"); + +- return( vips__map_table( st, +- (VipsSListMap2Fn) test_overlap, node, NULL ) ); ++ return (vips__map_table(st, ++ (VipsSListMap2Fn) test_overlap, node, NULL)); + } +- +- return( NULL ); ++ ++ return (NULL); + } + + /* Bundle of variables for matrix creation. + */ + typedef struct { +- SymbolTable *st; /* Main table */ +- JoinNode *leaf; /* Leaf to be 1.000 */ +- VipsImage *K; /* LHS */ +- VipsImage *M; /* RHS */ +- int row; /* Current row */ ++ SymbolTable *st; /* Main table */ ++ JoinNode *leaf; /* Leaf to be 1.000 */ ++ VipsImage *K; /* LHS */ ++ VipsImage *M; /* RHS */ ++ int row; /* Current row */ + } MatrixBundle; + + /* Add a new row for the nominated overlap to the matrices. + */ + static void * +-add_nominated( OverlapInfo *ovl, MatrixBundle *bun, double *gamma ) ++add_nominated(OverlapInfo *ovl, MatrixBundle *bun, double *gamma) + { +- double ns = pow( *VIPS_MATRIX( ovl->nstats, 4, 0 ), 1.0 / (*gamma) ); +- double os = pow( *VIPS_MATRIX( ovl->ostats, 4, 0 ), 1.0 / (*gamma) ); ++ double ns = pow(*VIPS_MATRIX(ovl->nstats, 4, 0), 1.0 / (*gamma)); ++ double os = pow(*VIPS_MATRIX(ovl->ostats, 4, 0), 1.0 / (*gamma)); + +- *VIPS_MATRIX( bun->K, 0, bun->row ) = ns; +- *VIPS_MATRIX( bun->M, ovl->other->index - 1, bun->row ) = os; ++ *VIPS_MATRIX(bun->K, 0, bun->row) = ns; ++ *VIPS_MATRIX(bun->M, ovl->other->index - 1, bun->row) = os; + + bun->row++; + +- return( NULL ); ++ return (NULL); + } + + /* Add a new row for an ordinary overlap to the matrices. + */ + static void * +-add_other( OverlapInfo *ovl, MatrixBundle *bun, double *gamma ) ++add_other(OverlapInfo *ovl, MatrixBundle *bun, double *gamma) + { +- double ns = -pow( *VIPS_MATRIX( ovl->nstats, 4, 0 ), 1.0 / (*gamma) ); +- double os = pow( *VIPS_MATRIX( ovl->ostats, 4, 0 ), 1.0 / (*gamma) ); ++ double ns = -pow(*VIPS_MATRIX(ovl->nstats, 4, 0), 1.0 / (*gamma)); ++ double os = pow(*VIPS_MATRIX(ovl->ostats, 4, 0), 1.0 / (*gamma)); + +- *VIPS_MATRIX( bun->M, ovl->node->index - 1, bun->row ) = ns; +- *VIPS_MATRIX( bun->M, ovl->other->index - 1, bun->row ) = os; ++ *VIPS_MATRIX(bun->M, ovl->node->index - 1, bun->row) = ns; ++ *VIPS_MATRIX(bun->M, ovl->other->index - 1, bun->row) = os; + + bun->row++; + +- return( NULL ); ++ return (NULL); + } + + /* Add stuff for node to matrix. + */ + static void * +-add_row( JoinNode *node, MatrixBundle *bun, double *gamma ) ++add_row(JoinNode *node, MatrixBundle *bun, double *gamma) + { +- if( node == bun->leaf ) +- vips_slist_map2( node->overlaps, +- (VipsSListMap2Fn) add_nominated, bun, gamma ); ++ if (node == bun->leaf) ++ vips_slist_map2(node->overlaps, ++ (VipsSListMap2Fn) add_nominated, bun, gamma); + else +- vips_slist_map2( node->overlaps, +- (VipsSListMap2Fn) add_other, bun, gamma ); +- +- return( NULL ); ++ vips_slist_map2(node->overlaps, ++ (VipsSListMap2Fn) add_other, bun, gamma); ++ ++ return (NULL); + } + + /* Fill K and M. leaf is image selected to have factor of 1.000. + */ + static void +-fill_matrices( SymbolTable *st, double gamma, VipsImage *K, VipsImage *M ) ++fill_matrices(SymbolTable *st, double gamma, VipsImage *K, VipsImage *M) + { + MatrixBundle bun; + +@@ -1315,69 +1321,67 @@ fill_matrices( SymbolTable *st, double gamma, VipsImage *K, VipsImage *M ) + + /* Build matrices. + */ +- vips__map_table( st, (VipsSListMap2Fn) add_row, &bun, &gamma ); ++ vips__map_table(st, (VipsSListMap2Fn) add_row, &bun, &gamma); + } + + /* Used to select the leaf whose coefficient we set to 1. + */ + static void * +-choose_leaf( JoinNode *node, void *a, void *b ) ++choose_leaf(JoinNode *node, void *a, void *b) + { +- if( node->type == JOIN_LEAF ) +- return( node ); +- +- return( NULL ); ++ if (node->type == JOIN_LEAF) ++ return (node); ++ ++ return (NULL); + } + + /* Make an image from a node. + */ + static VipsImage * +-make_mos_image( SymbolTable *st, JoinNode *node, transform_fn tfn, void *a ) ++make_mos_image(SymbolTable *st, JoinNode *node, transform_fn tfn, void *a) + { + VipsImage *im1, *im2, *out; + +- switch( node->type ) { ++ switch (node->type) { + case JOIN_LR: + case JOIN_TB: +- if( !(im1 = make_mos_image( st, node->arg1, tfn, a )) || +- !(im2 = make_mos_image( st, node->arg2, tfn, a )) ) +- return( NULL ); +- +- if( vips_merge( im1, im2, &out, +- node->type == JOIN_LR ? +- VIPS_DIRECTION_HORIZONTAL : +- VIPS_DIRECTION_VERTICAL, +- -node->dx, -node->dy, +- "mblend", node->mwidth, +- NULL ) ) +- return( NULL ); +- vips_object_local( st->im, out ); +- vips_image_set_string( out, "mosaic-name", node->name ); ++ if (!(im1 = make_mos_image(st, node->arg1, tfn, a)) || ++ !(im2 = make_mos_image(st, node->arg2, tfn, a))) ++ return (NULL); ++ ++ if (vips_merge(im1, im2, &out, ++ node->type == JOIN_LR ? VIPS_DIRECTION_HORIZONTAL : VIPS_DIRECTION_VERTICAL, ++ -node->dx, -node->dy, ++ "mblend", node->mwidth, ++ NULL)) ++ return (NULL); ++ vips_object_local(st->im, out); ++ vips_image_set_string(out, "mosaic-name", node->name); + + break; + + case JOIN_LRROTSCALE: + case JOIN_TBROTSCALE: +- if( !(im1 = make_mos_image( st, node->arg1, tfn, a )) || +- !(im2 = make_mos_image( st, node->arg2, tfn, a )) ) +- return( NULL ); ++ if (!(im1 = make_mos_image(st, node->arg1, tfn, a)) || ++ !(im2 = make_mos_image(st, node->arg2, tfn, a))) ++ return (NULL); + + out = vips_image_new(); +- vips_object_local( st->im, out ); ++ vips_object_local(st->im, out); + +- vips_image_set_string( out, "mosaic-name", node->name ); ++ vips_image_set_string(out, "mosaic-name", node->name); + +- if( node->type == JOIN_LRROTSCALE ) { +- if( vips__lrmerge1( im1, im2, out, +- node->a, node->b, node->dx, node->dy, +- node->mwidth ) ) +- return( NULL ); ++ if (node->type == JOIN_LRROTSCALE) { ++ if (vips__lrmerge1(im1, im2, out, ++ node->a, node->b, node->dx, node->dy, ++ node->mwidth)) ++ return (NULL); + } + else { +- if( vips__tbmerge1( im1, im2, out, +- node->a, node->b, node->dx, node->dy, +- node->mwidth ) ) +- return( NULL ); ++ if (vips__tbmerge1(im1, im2, out, ++ node->a, node->b, node->dx, node->dy, ++ node->mwidth)) ++ return (NULL); + } + + break; +@@ -1385,76 +1389,74 @@ make_mos_image( SymbolTable *st, JoinNode *node, transform_fn tfn, void *a ) + case JOIN_LEAF: + /* Trivial case! + */ +- if( !(out = tfn( node, a )) ) +- return( NULL ); ++ if (!(out = tfn(node, a))) ++ return (NULL); + + break; + + case JOIN_CP: + /* Very trivial case. + */ +- out = make_mos_image( st, node->arg1, tfn, a ); ++ out = make_mos_image(st, node->arg1, tfn, a); + + break; + + default: +- vips_error_exit( "internal error #982369824375987" ); ++ vips_error_exit("internal error #982369824375987"); + /*NOTEACHED*/ +- return( NULL ); ++ return (NULL); + } + +- return( out ); ++ return (out); + } + +-/* Re-build mosaic. ++/* Re-build mosaic. + */ + int +-vips__build_mosaic( SymbolTable *st, VipsImage *out, transform_fn tfn, void *a ) ++vips__build_mosaic(SymbolTable *st, VipsImage *out, transform_fn tfn, void *a) + { + JoinNode *root = st->root; + VipsImage *im1, *im2; + VipsImage *x; + +- switch( root->type ) { ++ switch (root->type) { + case JOIN_LR: + case JOIN_TB: +- if( !(im1 = make_mos_image( st, root->arg1, tfn, a )) || +- !(im2 = make_mos_image( st, root->arg2, tfn, a )) ) +- return( -1 ); +- +- if( vips_merge( im1, im2, &x, +- root->type == JOIN_LR ? +- VIPS_DIRECTION_HORIZONTAL : +- VIPS_DIRECTION_VERTICAL, +- -root->dx, -root->dy, +- "mblend", root->mwidth, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (!(im1 = make_mos_image(st, root->arg1, tfn, a)) || ++ !(im2 = make_mos_image(st, root->arg2, tfn, a))) ++ return (-1); ++ ++ if (vips_merge(im1, im2, &x, ++ root->type == JOIN_LR ? VIPS_DIRECTION_HORIZONTAL : VIPS_DIRECTION_VERTICAL, ++ -root->dx, -root->dy, ++ "mblend", root->mwidth, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + + break; + + case JOIN_LRROTSCALE: + case JOIN_TBROTSCALE: +- if( !(im1 = make_mos_image( st, root->arg1, tfn, a )) || +- !(im2 = make_mos_image( st, root->arg2, tfn, a )) ) +- return( -1 ); +- +- if( root->type == JOIN_LRROTSCALE ) { +- if( vips__lrmerge1( im1, im2, out, +- root->a, root->b, root->dx, root->dy, +- root->mwidth ) ) +- return( -1 ); ++ if (!(im1 = make_mos_image(st, root->arg1, tfn, a)) || ++ !(im2 = make_mos_image(st, root->arg2, tfn, a))) ++ return (-1); ++ ++ if (root->type == JOIN_LRROTSCALE) { ++ if (vips__lrmerge1(im1, im2, out, ++ root->a, root->b, root->dx, root->dy, ++ root->mwidth)) ++ return (-1); + } + else { +- if( vips__tbmerge1( im1, im2, out, +- root->a, root->b, root->dx, root->dy, +- root->mwidth ) ) +- return( -1 ); ++ if (vips__tbmerge1(im1, im2, out, ++ root->a, root->b, root->dx, root->dy, ++ root->mwidth)) ++ return (-1); + } + + break; +@@ -1462,50 +1464,50 @@ vips__build_mosaic( SymbolTable *st, VipsImage *out, transform_fn tfn, void *a ) + case JOIN_LEAF: + /* Trivial case! Just one file in our mosaic. + */ +- if( !(im1 = tfn( root, a )) || +- vips_image_write( im1, out ) ) +- return( -1 ); ++ if (!(im1 = tfn(root, a)) || ++ vips_image_write(im1, out)) ++ return (-1); + + break; + + case JOIN_CP: + /* Very trivial case. + */ +- if( !(im1 = make_mos_image( st, root->arg1, tfn, a )) || +- vips_image_write( im1, out ) ) +- return( -1 ); ++ if (!(im1 = make_mos_image(st, root->arg1, tfn, a)) || ++ vips_image_write(im1, out)) ++ return (-1); + + break; + + default: +- vips_error_exit( "internal error #982369824375987" ); ++ vips_error_exit("internal error #982369824375987"); + /*NOTEACHED*/ + } + +- return( 0 ); ++ return (0); + } + + static int +-vips__matrixtranspose( VipsImage *in, VipsImage **out ) ++vips__matrixtranspose(VipsImage *in, VipsImage **out) + { + int yc, xc; + + /* Allocate output matrix. + */ +- if( !(*out = vips_image_new_matrix( in->Ysize, in->Xsize )) ) +- return( -1 ); ++ if (!(*out = vips_image_new_matrix(in->Ysize, in->Xsize))) ++ return (-1); + + /* Transpose. + */ +- for( yc = 0; yc < (*out)->Ysize; ++yc ) +- for( xc = 0; xc < (*out)->Xsize; ++xc ) +- *VIPS_MATRIX( *out, xc, yc ) = *VIPS_MATRIX( in, yc, xc ); ++ for (yc = 0; yc < (*out)->Ysize; ++yc) ++ for (xc = 0; xc < (*out)->Xsize; ++xc) ++ *VIPS_MATRIX(*out, xc, yc) = *VIPS_MATRIX(in, yc, xc); + +- return( 0 ); ++ return (0); + } + + static int +-vips__matrixmultiply( VipsImage *in1, VipsImage *in2, VipsImage **out ) ++vips__matrixmultiply(VipsImage *in1, VipsImage *in2, VipsImage **out) + { + int xc, yc, col; + double sum; +@@ -1514,31 +1516,31 @@ vips__matrixmultiply( VipsImage *in1, VipsImage *in2, VipsImage **out ) + + /* Check matrix sizes. + */ +- if( in1->Xsize != in2->Ysize ) { +- vips_error( "vips__matrixmultiply", "%s", _( "bad sizes" ) ); +- return( -1 ); ++ if (in1->Xsize != in2->Ysize) { ++ vips_error("vips__matrixmultiply", "%s", _("bad sizes")); ++ return (-1); + } + + /* Allocate output matrix. + */ +- if( !(*out = vips_image_new_matrix( in2->Xsize, in1->Ysize )) ) +- return( -1 ); ++ if (!(*out = vips_image_new_matrix(in2->Xsize, in1->Ysize))) ++ return (-1); + + /* Multiply. + */ +- mat = VIPS_MATRIX( *out, 0, 0 ); +- s1 = VIPS_MATRIX( in1, 0, 0 ); ++ mat = VIPS_MATRIX(*out, 0, 0); ++ s1 = VIPS_MATRIX(in1, 0, 0); + +- for( yc = 0; yc < in1->Ysize; yc++ ) { +- s2 = VIPS_MATRIX( in2, 0, 0 ); ++ for (yc = 0; yc < in1->Ysize; yc++) { ++ s2 = VIPS_MATRIX(in2, 0, 0); + +- for( col = 0; col < in2->Xsize; col++ ) { ++ for (col = 0; col < in2->Xsize; col++) { + /* Get ready to sweep a row. + */ + a = s1; + b = s2; + +- for( sum = 0.0, xc = 0; xc < in1->Xsize; xc++ ) { ++ for (sum = 0.0, xc = 0; xc < in1->Xsize; xc++) { + sum += *a++ * *b; + b += in2->Xsize; + } +@@ -1550,16 +1552,16 @@ vips__matrixmultiply( VipsImage *in1, VipsImage *in2, VipsImage **out ) + s1 += in1->Xsize; + } + +- return( 0 ); ++ return (0); + } + + /* Find correction factors. + */ + static int +-find_factors( SymbolTable *st, double gamma ) ++find_factors(SymbolTable *st, double gamma) + { +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( st->im ), 7 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(st->im), 7); + + double total; + double avg; +@@ -1567,294 +1569,294 @@ find_factors( SymbolTable *st, double gamma ) + + /* Make output matrices. + */ +- if( !(t[0] = vips_image_new_matrix( 1, st->novl )) || +- !(t[1] = vips_image_new_matrix( st->nim - 1, st->novl )) ) +- return( -1 ); ++ if (!(t[0] = vips_image_new_matrix(1, st->novl)) || ++ !(t[1] = vips_image_new_matrix(st->nim - 1, st->novl))) ++ return (-1); + +- fill_matrices( st, gamma, t[0], t[1] ); ++ fill_matrices(st, gamma, t[0], t[1]); + + #ifdef DEBUG +- vips_image_write_to_file( t[0], "K.mat", NULL ); +- vips_image_write_to_file( t[1], "M.mat", NULL ); ++ vips_image_write_to_file(t[0], "K.mat", NULL); ++ vips_image_write_to_file(t[1], "M.mat", NULL); + #endif /*DEBUG*/ + + /* Calculate LMS. + */ +- if( vips__matrixtranspose( t[1], &t[2] ) || +- vips__matrixmultiply( t[2], t[1], &t[3] ) || +- vips_matrixinvert( t[3], &t[4], NULL ) || +- vips__matrixmultiply( t[4], t[2], &t[5] ) || +- vips__matrixmultiply( t[5], t[0], &t[6] ) ) +- return( -1 ); ++ if (vips__matrixtranspose(t[1], &t[2]) || ++ vips__matrixmultiply(t[2], t[1], &t[3]) || ++ vips_matrixinvert(t[3], &t[4], NULL) || ++ vips__matrixmultiply(t[4], t[2], &t[5]) || ++ vips__matrixmultiply(t[5], t[0], &t[6])) ++ return (-1); + + /* Make array of correction factors. + */ +- if( !(st->fac = VIPS_ARRAY( st->im, st->nim, double )) ) +- return( -1 ); +- for( i = 0; i < t[6]->Ysize; i++ ) +- st->fac[i + 1] = *VIPS_MATRIX( t[6], 0, i ); ++ if (!(st->fac = VIPS_ARRAY(st->im, st->nim, double))) ++ return (-1); ++ for (i = 0; i < t[6]->Ysize; i++) ++ st->fac[i + 1] = *VIPS_MATRIX(t[6], 0, i); + st->fac[0] = 1.0; + + /* Find average balance factor, normalise to that average. + */ + total = 0.0; +- for( i = 0; i < st->nim; i++ ) ++ for (i = 0; i < st->nim; i++) + total += st->fac[i]; + avg = total / st->nim; +- for( i = 0; i < st->nim; i++ ) ++ for (i = 0; i < st->nim; i++) + st->fac[i] /= avg; + + #ifdef DEBUG + /* Diagnostics! + */ +- printf( "debugging output for vips_global_balance():\n" ); +- for( i = 0; i < st->nim; i++ ) +- printf( "balance factor %d = %g\n", i, st->fac[i] ); ++ printf("debugging output for vips_global_balance():\n"); ++ for (i = 0; i < st->nim; i++) ++ printf("balance factor %d = %g\n", i, st->fac[i]); + total = 0.0; +- printf( "Overlap errors:\n" ); +- vips__map_table( st, +- (VipsSListMap2Fn) print_overlap_errors, NULL, &total ); +- printf( "RMS error = %g\n", sqrt( total / st->novl ) ); ++ printf("Overlap errors:\n"); ++ vips__map_table(st, ++ (VipsSListMap2Fn) print_overlap_errors, NULL, &total); ++ printf("RMS error = %g\n", sqrt(total / st->novl)); + + total = 0.0; +- printf( "Overlap errors after adjustment:\n" ); +- vips__map_table( st, +- (VipsSListMap2Fn) print_overlap_errors, st->fac, &total ); +- printf( "RMS error = %g\n", sqrt( total / st->novl ) ); ++ printf("Overlap errors after adjustment:\n"); ++ vips__map_table(st, ++ (VipsSListMap2Fn) print_overlap_errors, st->fac, &total); ++ printf("RMS error = %g\n", sqrt(total / st->novl)); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + /* TODO(kleisauke): Copied from im__affinei */ + /* Shared with vips_mosaic1(), so not static. */ + int +-vips__affinei( VipsImage *in, VipsImage *out, VipsTransformation *trn ) ++vips__affinei(VipsImage *in, VipsImage *out, VipsTransformation *trn) + { + VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 2 ); ++ vips_object_local_array(VIPS_OBJECT(out), 2); + VipsArrayInt *oarea; + gboolean repack; + +- oarea = vips_array_int_newv( 4, ++ oarea = vips_array_int_newv(4, + trn->oarea.left, trn->oarea.top, +- trn->oarea.width, trn->oarea.height ); ++ trn->oarea.width, trn->oarea.height); + + /* vips7 affine would repack labq and im_benchmark() depends upon + * this. + */ + repack = in->Coding == VIPS_CODING_LABQ; + +- if( vips_affine( in, &t[0], +- trn->a, trn->b, trn->c, trn->d, +- "oarea", oarea, +- "odx", trn->odx, +- "ody", trn->ody, +- NULL ) ) { +- vips_area_unref( VIPS_AREA( oarea ) ); +- return( -1 ); ++ if (vips_affine(in, &t[0], ++ trn->a, trn->b, trn->c, trn->d, ++ "oarea", oarea, ++ "odx", trn->odx, ++ "ody", trn->ody, ++ NULL)) { ++ vips_area_unref(VIPS_AREA(oarea)); ++ return (-1); + } +- vips_area_unref( VIPS_AREA( oarea ) ); ++ vips_area_unref(VIPS_AREA(oarea)); + in = t[0]; + +- if( repack ) { +- if (vips_colourspace( in, &t[1], +- VIPS_INTERPRETATION_LABQ, NULL ) ) +- return ( -1 ); ++ if (repack) { ++ if (vips_colourspace(in, &t[1], ++ VIPS_INTERPRETATION_LABQ, NULL)) ++ return (-1); + in = t[1]; + } + +- if( vips_image_write( in, out ) ) +- return( -1 ); ++ if (vips_image_write(in, out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Look for all leaves, make sure we have a transformed version of each. + */ + static void * +-generate_trn_leaves( JoinNode *node, SymbolTable *st, void *b ) ++generate_trn_leaves(JoinNode *node, SymbolTable *st, void *b) + { +- if( node->type == JOIN_LEAF ) { ++ if (node->type == JOIN_LEAF) { + /* Check for image. + */ +- if( !node->im ) { +- vips_error( "vips_global_balance", +- _( "unable to open \"%s\"" ), node->name ); +- return( node ); ++ if (!node->im) { ++ vips_error("vips_global_balance", ++ _("unable to open \"%s\""), node->name); ++ return (node); + } +- if( node->trnim ) +- vips_error_exit( "global_balance: sanity failure #765" ); ++ if (node->trnim) ++ vips_error_exit("global_balance: sanity failure #765"); + + /* Special case: if this is an untransformed leaf (there will + * always be at least one), then skip the affine. + */ +- if( vips__transform_isidentity( &node->cumtrn ) ) ++ if (vips__transform_isidentity(&node->cumtrn)) + node->trnim = node->im; + else { + node->trnim = vips_image_new(); +- vips_object_local( node->st->im, node->trnim ); ++ vips_object_local(node->st->im, node->trnim); + +- if ( vips__affinei( node->im, node->trnim, &node->cumtrn ) ) +- return( node ); ++ if (vips__affinei(node->im, node->trnim, &node->cumtrn)) ++ return (node); + } + } + +- return( NULL ); ++ return (NULL); + } + + /* Analyse mosaic. + */ + static int +-analyse_mosaic( SymbolTable *st, VipsImage *in ) ++analyse_mosaic(SymbolTable *st, VipsImage *in) + { + /* Parse Hist on in. + */ +- if( vips__parse_desc( st, in ) ) +- return( -1 ); ++ if (vips__parse_desc(st, in)) ++ return (-1); + +- /* Print parsed data. +- */ ++ /* Print parsed data. ++ */ + #ifdef DEBUG +- printf( "Input files:\n" ); +- vips__map_table( st, (VipsSListMap2Fn) print_leaf, NULL, NULL ); +- printf( "\nOutput file:\n" ); +- print_node( st->root ); +- printf( "\nJoin commands:\n" ); +- print_joins( st->root, 0 ); ++ printf("Input files:\n"); ++ vips__map_table(st, (VipsSListMap2Fn) print_leaf, NULL, NULL); ++ printf("\nOutput file:\n"); ++ print_node(st->root); ++ printf("\nJoin commands:\n"); ++ print_joins(st->root, 0); + #endif /*DEBUG*/ + + /* Generate transformed leaves. + */ +- if( vips__map_table( st, +- (VipsSListMap2Fn) generate_trn_leaves, st, NULL ) ) +- return( -1 ); ++ if (vips__map_table(st, ++ (VipsSListMap2Fn) generate_trn_leaves, st, NULL)) ++ return (-1); + + /* Find overlaps. + */ +- if( vips__map_table( st, (VipsSListMap2Fn) find_overlaps, st, NULL ) ) +- return( -1 ); ++ if (vips__map_table(st, (VipsSListMap2Fn) find_overlaps, st, NULL)) ++ return (-1); + +- /* Scan table, counting and indexing input images and joins. ++ /* Scan table, counting and indexing input images and joins. + */ +- vips__map_table( st, (VipsSListMap2Fn) count_leaves, NULL, NULL ); +- vips__map_table( st, (VipsSListMap2Fn) count_joins, NULL, NULL ); ++ vips__map_table(st, (VipsSListMap2Fn) count_leaves, NULL, NULL); ++ vips__map_table(st, (VipsSListMap2Fn) count_joins, NULL, NULL); + + /* Select leaf to be 1.000. + * This must be index == 0, unless you change stuff above! + */ +- st->leaf = vips__map_table( st, +- (VipsSListMap2Fn) choose_leaf, NULL, NULL ); ++ st->leaf = vips__map_table(st, ++ (VipsSListMap2Fn) choose_leaf, NULL, NULL); + + /* And print overlaps. + */ + #ifdef DEBUG +- printf( "\nLeaf to be 1.000:\n" ); +- print_node( st->leaf ); +- printf( "\nOverlaps:\n" ); +- vips__map_table( st, (VipsSListMap2Fn) print_overlaps, NULL, NULL ); +- printf( "\n%d input files, %d unique overlaps, %d joins\n", +- st->nim, st->novl, st->njoin ); ++ printf("\nLeaf to be 1.000:\n"); ++ print_node(st->leaf); ++ printf("\nOverlaps:\n"); ++ vips__map_table(st, (VipsSListMap2Fn) print_overlaps, NULL, NULL); ++ printf("\n%d input files, %d unique overlaps, %d joins\n", ++ st->nim, st->novl, st->njoin); + #endif /*DEBUG*/ + +- return( 0 ); ++ return (0); + } + + /* Scale im by fac --- if it's uchar/ushort, use a lut. If we can use a lut, + * transform in linear space. If we can't, don't bother for efficiency. + */ + static VipsImage * +-transform( JoinNode *node, double *gamma ) ++transform(JoinNode *node, double *gamma) + { + SymbolTable *st = node->st; + VipsImage *in = node->im; + double fac = st->fac[node->index]; + VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( st->im ), 8 ); ++ vips_object_local_array(VIPS_OBJECT(st->im), 8); + + VipsImage *out; + +- if( fac == 1.0 ) { ++ if (fac == 1.0) { + /* Easy! + */ + out = in; + } +- /* TODO(kleisauke): Could we call vips_gamma instead? ++ /* TODO(kleisauke): Could we call vips_gamma instead? + */ +- else if( in->BandFmt == VIPS_FORMAT_UCHAR || +- in->BandFmt == VIPS_FORMAT_USHORT ) { +- if( vips_identity( &t[0], ++ else if (in->BandFmt == VIPS_FORMAT_UCHAR || ++ in->BandFmt == VIPS_FORMAT_USHORT) { ++ if (vips_identity(&t[0], + "bands", 1, + "ushort", in->BandFmt == VIPS_FORMAT_USHORT, + //"size", 65535, +- NULL ) || +- vips_pow_const1( t[0], &t[1], +- 1.0 / (*gamma), NULL ) || +- vips_linear1( t[1], &t[2], fac, 0.0, NULL ) || +- vips_pow_const1( t[2], &t[3], *gamma, NULL ) || +- vips_cast( t[3], &t[4], in->BandFmt, NULL ) || +- vips_maplut( in, &t[5], t[4], NULL ) ) +- return( NULL ); ++ NULL) || ++ vips_pow_const1(t[0], &t[1], ++ 1.0 / (*gamma), NULL) || ++ vips_linear1(t[1], &t[2], fac, 0.0, NULL) || ++ vips_pow_const1(t[2], &t[3], *gamma, NULL) || ++ vips_cast(t[3], &t[4], in->BandFmt, NULL) || ++ vips_maplut(in, &t[5], t[4], NULL)) ++ return (NULL); + out = t[5]; + } + else { + /* Just vips_linear1 it. + */ +- if( vips_linear1( in, &t[6], fac, 0.0, NULL ) || +- vips_cast( t[6], &t[7], in->BandFmt, NULL ) ) +- return( NULL ); ++ if (vips_linear1(in, &t[6], fac, 0.0, NULL) || ++ vips_cast(t[6], &t[7], in->BandFmt, NULL)) ++ return (NULL); + out = t[7]; + } + +- vips_image_set_string( out, "mosaic-name", node->name ); ++ vips_image_set_string(out, "mosaic-name", node->name); + +- return( out ); ++ return (out); + } + + /* As above, but output as float, not matched to input. + */ + static VipsImage * +-transformf( JoinNode *node, double *gamma ) ++transformf(JoinNode *node, double *gamma) + { + SymbolTable *st = node->st; + VipsImage *in = node->im; + double fac = node->st->fac[node->index]; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( st->im ), 6 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(st->im), 6); + + VipsImage *out; + +- if( fac == 1.0 ) { ++ if (fac == 1.0) { + /* Easy! + */ + out = in; + } +- else if( in->BandFmt == VIPS_FORMAT_UCHAR || +- in->BandFmt == VIPS_FORMAT_USHORT ) { +- if( vips_identity( &t[0], ++ else if (in->BandFmt == VIPS_FORMAT_UCHAR || ++ in->BandFmt == VIPS_FORMAT_USHORT) { ++ if (vips_identity(&t[0], + "bands", 1, + "ushort", in->BandFmt == VIPS_FORMAT_USHORT, + //"size", 65535, +- NULL ) || +- vips_pow_const1( t[0], &t[1], +- 1.0 / (*gamma), NULL ) || +- vips_linear1( t[1], &t[2], fac, 0.0, NULL ) || +- vips_pow_const1( t[2], &t[3], *gamma, NULL ) || +- vips_maplut( in, &t[4], t[3], NULL ) ) +- return( NULL ); ++ NULL) || ++ vips_pow_const1(t[0], &t[1], ++ 1.0 / (*gamma), NULL) || ++ vips_linear1(t[1], &t[2], fac, 0.0, NULL) || ++ vips_pow_const1(t[2], &t[3], *gamma, NULL) || ++ vips_maplut(in, &t[4], t[3], NULL)) ++ return (NULL); + out = t[4]; + } + else { + /* Just vips_linear1 it. + */ +- if( vips_linear1( in, &t[5], fac, 0.0, NULL ) ) +- return( NULL ); ++ if (vips_linear1(in, &t[5], fac, 0.0, NULL)) ++ return (NULL); + out = t[5]; + } + +- vips_image_set_string( out, "mosaic-name", node->name ); ++ vips_image_set_string(out, "mosaic-name", node->name); + +- return( out ); ++ return (out); + } + + typedef struct { +@@ -1870,79 +1872,76 @@ typedef struct { + + typedef VipsOperationClass VipsGlobalbalanceClass; + +-G_DEFINE_TYPE( VipsGlobalbalance, vips_globalbalance, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsGlobalbalance, vips_globalbalance, VIPS_TYPE_OPERATION); + + static int +-vips_globalbalance_build( VipsObject *object ) ++vips_globalbalance_build(VipsObject *object) + { + VipsGlobalbalance *globalbalance = (VipsGlobalbalance *) object; + + SymbolTable *st; + transform_fn trn; + +- g_object_set( globalbalance, "out", vips_image_new(), NULL ); ++ g_object_set(globalbalance, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_globalbalance_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_globalbalance_parent_class)->build(object)) ++ return (-1); + +- if( !(st = vips__build_symtab( globalbalance->out, SYM_TAB_SIZE )) || +- analyse_mosaic( st, globalbalance->in ) || +- find_factors( st, globalbalance->gamma ) ) +- return( -1 ); ++ if (!(st = vips__build_symtab(globalbalance->out, SYM_TAB_SIZE)) || ++ analyse_mosaic(st, globalbalance->in) || ++ find_factors(st, globalbalance->gamma)) ++ return (-1); + +- trn = globalbalance->int_output ? +- (transform_fn) transform : (transform_fn) transformf; +- if( vips__build_mosaic( st, globalbalance->out, +- trn, &globalbalance->gamma ) ) +- return( -1 ); ++ trn = globalbalance->int_output ? (transform_fn) transform : (transform_fn) transformf; ++ if (vips__build_mosaic(st, globalbalance->out, ++ trn, &globalbalance->gamma)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_globalbalance_class_init( VipsGlobalbalanceClass *class ) ++vips_globalbalance_class_init(VipsGlobalbalanceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "globalbalance"; +- object_class->description = _( "global balance an image mosaic" ); ++ object_class->description = _("global balance an image mosaic"); + object_class->build = vips_globalbalance_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsGlobalbalance, in ) ); +- +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsGlobalbalance, out ) ); +- +- VIPS_ARG_DOUBLE( class, "gamma", 5, +- _( "Gamma" ), +- _( "Image gamma" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsGlobalbalance, in)); ++ ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsGlobalbalance, out)); ++ ++ VIPS_ARG_DOUBLE(class, "gamma", 5, ++ _("Gamma"), ++ _("Image gamma"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsGlobalbalance, gamma ), +- 0.00001, 10, 1.6 ); ++ G_STRUCT_OFFSET(VipsGlobalbalance, gamma), ++ 0.00001, 10, 1.6); + +- VIPS_ARG_BOOL( class, "int_output", 7, +- _( "Int output" ), +- _( "Integer output" ), ++ VIPS_ARG_BOOL(class, "int_output", 7, ++ _("Int output"), ++ _("Integer output"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsGlobalbalance, int_output ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsGlobalbalance, int_output), ++ FALSE); + } + + static void +-vips_globalbalance_init( VipsGlobalbalance *globalbalance ) ++vips_globalbalance_init(VipsGlobalbalance *globalbalance) + { + globalbalance->gamma = 1.6; + } +@@ -1952,13 +1951,13 @@ vips_globalbalance_init( VipsGlobalbalance *globalbalance ) + * @in: mosaic to rebuild + * @out: (out): output image + * @...: %NULL-terminated list of optional named arguments +- * ++ * + * Optional arguments: + * + * * @gamma: gamma of source images + * * @int_output: %TRUE for integer image output + * +- * vips_globalbalance() can be used to remove contrast differences in ++ * vips_globalbalance() can be used to remove contrast differences in + * an assembled mosaic. + * + * It reads the History field attached to @in and builds a list of the source +@@ -1972,10 +1971,10 @@ vips_globalbalance_init( VipsGlobalbalance *globalbalance ) + * gamma-correct the source images before calculating the factors. A value of + * 1.0 will stop this. + * +- * Each of the source images is transformed with the appropriate correction +- * factor, then the mosaic is reassembled. @out is #VIPS_FORMAT_FLOAT, but ++ * Each of the source images is transformed with the appropriate correction ++ * factor, then the mosaic is reassembled. @out is #VIPS_FORMAT_FLOAT, but + * if @int_output is set, the output image is the same format as the input +- * images. ++ * images. + * + * There are some conditions that must be met before this operation can work: + * the source images must all be present under the filenames recorded in the +@@ -1986,15 +1985,15 @@ vips_globalbalance_init( VipsGlobalbalance *globalbalance ) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_globalbalance( VipsImage *in, VipsImage **out, ... ) ++int ++vips_globalbalance(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "globalbalance", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("globalbalance", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/mosaicing/global_balance.h b/libvips/mosaicing/global_balance.h +index 8436015a30..08e12d2155 100644 +--- a/libvips/mosaicing/global_balance.h ++++ b/libvips/mosaicing/global_balance.h +@@ -6,28 +6,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -42,43 +42,43 @@ typedef struct _SymbolTable SymbolTable; + + /* Type of a transform function. + */ +-typedef VipsImage *(*transform_fn)( JoinNode *, void * ); ++typedef VipsImage *(*transform_fn)(JoinNode *, void *); + + /* Join type. + */ + enum _JoinType { +- JOIN_LR, /* vips__lrmerge join */ +- JOIN_TB, /* vips__tbmerge join */ +- JOIN_LRROTSCALE, /* 1st oder lrmerge */ +- JOIN_TBROTSCALE, /* 1st oder tbmerge */ +- JOIN_CP, /* vips_copy operation */ +- JOIN_LEAF /* Base file */ ++ JOIN_LR, /* vips__lrmerge join */ ++ JOIN_TB, /* vips__tbmerge join */ ++ JOIN_LRROTSCALE, /* 1st oder lrmerge */ ++ JOIN_TBROTSCALE, /* 1st oder tbmerge */ ++ JOIN_CP, /* vips_copy operation */ ++ JOIN_LEAF /* Base file */ + }; + + /* An overlap struct. Attach a list of these to each leaf, one for each of + * the other leaves we touch. + */ + struct _OverlapInfo { +- JoinNode *node; /* The base node - we are on this list */ +- JoinNode *other; /* Node we overlap with */ +- VipsRect overlap; /* The overlap area */ +- VipsImage *nstats; /* Node's stats for overlap area */ +- VipsImage *ostats; /* Other's stats for overlap area */ ++ JoinNode *node; /* The base node - we are on this list */ ++ JoinNode *other; /* Node we overlap with */ ++ VipsRect overlap; /* The overlap area */ ++ VipsImage *nstats; /* Node's stats for overlap area */ ++ VipsImage *ostats; /* Other's stats for overlap area */ + }; + + /* Struct for a join node. + */ + struct _JoinNode { +- char *name; /* This file name */ +- JoinType type; /* What kind of join */ +- SymbolTable *st; /* Symbol table we are on */ +- int dirty; /* Used for circularity detection */ ++ char *name; /* This file name */ ++ JoinType type; /* What kind of join */ ++ SymbolTable *st; /* Symbol table we are on */ ++ int dirty; /* Used for circularity detection */ + + /* Params from join line in .desc file. + */ + double a, b; + double dx, dy; +- int mwidth; ++ int mwidth; + + /* Cumulative transform for this node. What our parents do to us. + * cumtrn.area is position and size of us, thistrn.area is pos and +@@ -88,16 +88,16 @@ struct _JoinNode { + + /* X-tras for LR/TB. thistrn is what we do to arg2. + */ +- JoinNode *arg1; /* Left or up thing to join */ +- JoinNode *arg2; /* Right or down thing to join */ +- VipsTransformation thistrn; /* Transformation for arg2 */ ++ JoinNode *arg1; /* Left or up thing to join */ ++ JoinNode *arg2; /* Right or down thing to join */ ++ VipsTransformation thistrn; /* Transformation for arg2 */ + + /* Special for leaves: all the join_nodes we overlap with, the + * VipsImage for that file, and the index. + */ + GSList *overlaps; + VipsImage *im; +- VipsImage *trnim; /* Transformed image .. used in 2nd pass */ ++ VipsImage *trnim; /* Transformed image .. used in 2nd pass */ + int index; + }; + +@@ -106,22 +106,22 @@ struct _JoinNode { + * which hash to that offset. + */ + struct _SymbolTable { +- GSList **table; /* Ptr to base of hash table */ ++ GSList **table; /* Ptr to base of hash table */ + int sz; /* Size of hash table */ +- VipsImage *im; /* Malloc relative to this */ ++ VipsImage *im; /* Malloc relative to this */ + +- int novl; /* Number of unique overlaps */ +- int nim; /* Number of leaf images */ +- int njoin; /* Number of join nodes */ ++ int novl; /* Number of unique overlaps */ ++ int nim; /* Number of leaf images */ ++ int njoin; /* Number of join nodes */ + +- JoinNode *root; /* Root of join tree */ +- JoinNode *leaf; /* Leaf nominated to be 1.000 */ +- double *fac; /* Correction factors */ ++ JoinNode *root; /* Root of join tree */ ++ JoinNode *leaf; /* Leaf nominated to be 1.000 */ ++ double *fac; /* Correction factors */ + }; + +-VipsImage *vips__global_open_image( SymbolTable *st, char *name ); +-SymbolTable *vips__build_symtab( VipsImage *out, int sz ); +-int vips__parse_desc( SymbolTable *st, VipsImage *in ); +-void *vips__map_table( SymbolTable *st, VipsSListMap2Fn fn, void *a, void *b ); +-int vips__build_mosaic( SymbolTable *st, +- VipsImage *out, transform_fn tfn, void *a ); ++VipsImage *vips__global_open_image(SymbolTable *st, char *name); ++SymbolTable *vips__build_symtab(VipsImage *out, int sz); ++int vips__parse_desc(SymbolTable *st, VipsImage *in); ++void *vips__map_table(SymbolTable *st, VipsSListMap2Fn fn, void *a, void *b); ++int vips__build_mosaic(SymbolTable *st, ++ VipsImage *out, transform_fn tfn, void *a); +diff --git a/libvips/mosaicing/im_avgdxdy.c b/libvips/mosaicing/im_avgdxdy.c +index 1b980e31e8..a9161d956e 100644 +--- a/libvips/mosaicing/im_avgdxdy.c ++++ b/libvips/mosaicing/im_avgdxdy.c +@@ -6,7 +6,7 @@ + * @(#) int vips__avgdxdy( points, dx, dy ) + * @(#) TiePoints *points; + * @(#) int *dx, *dy; +- * @(#) ++ * @(#) + * @(#) Returns 0 on success and -1 on error. + * + * Copyright: 1990, N. Dessipris. +@@ -18,28 +18,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -55,28 +55,28 @@ + + #include "pmosaicing.h" + +-int +-vips__avgdxdy( TiePoints *points, int *dx, int *dy ) ++int ++vips__avgdxdy(TiePoints *points, int *dx, int *dy) + { + int sumdx, sumdy; + int i; + +- if( points->nopoints == 0 ) { +- vips_error( "vips__avgdxdy", "%s", _( "no points to average" ) ); +- return( -1 ); ++ if (points->nopoints == 0) { ++ vips_error("vips__avgdxdy", "%s", _("no points to average")); ++ return (-1); + } + + /* Lots of points. + */ + sumdx = 0; + sumdy = 0; +- for( i = 0; i < points->nopoints; i++ ) { ++ for (i = 0; i < points->nopoints; i++) { + sumdx += points->x_secondary[i] - points->x_reference[i]; + sumdy += points->y_secondary[i] - points->y_reference[i]; + } + +- *dx = VIPS_RINT( (double) sumdx / (double) points->nopoints ); +- *dy = VIPS_RINT( (double) sumdy / (double) points->nopoints ); ++ *dx = VIPS_RINT((double) sumdx / (double) points->nopoints); ++ *dy = VIPS_RINT((double) sumdy / (double) points->nopoints); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/mosaicing/im_clinear.c b/libvips/mosaicing/im_clinear.c +index c8a725b426..f191e16168 100644 +--- a/libvips/mosaicing/im_clinear.c ++++ b/libvips/mosaicing/im_clinear.c +@@ -9,7 +9,7 @@ + * @(#) + * @(#) int vips_clinear( points ) + * @(#) TiePoints *points; +- * @(#) ++ * @(#) + * @(#) Returns 0 on sucess and -1 on error. + * + * Copyright: 1990, N. Dessipris. +@@ -25,28 +25,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -63,8 +63,8 @@ + + #include "pmosaicing.h" + +-int +-vips__clinear( TiePoints *points ) ++int ++vips__clinear(TiePoints *points) + { + VipsImage *mat, *matinv; + double *g; +@@ -87,14 +87,14 @@ vips__clinear( TiePoints *points ) + dev = &points->deviation[0]; + elms = points->nopoints; + +- if( !(mat = vips_image_new_matrix( 4, 4 )) ) +- return( -1 ); +- if( !(g = VIPS_ARRAY( NULL, 4, double )) ) { +- g_object_unref( mat ); +- return( -1 ); ++ if (!(mat = vips_image_new_matrix(4, 4))) ++ return (-1); ++ if (!(g = VIPS_ARRAY(NULL, 4, double))) { ++ g_object_unref(mat); ++ return (-1); + } + +- for( i = 0; i < points->nopoints; i++ ) { ++ for (i = 0; i < points->nopoints; i++) { + sx1 += xref[i]; + sx1x1 += xref[i] * xref[i]; + sy1 += yref[i]; +@@ -107,64 +107,66 @@ vips__clinear( TiePoints *points ) + sy2 += ysec[i]; + } + +- *VIPS_MATRIX( mat, 0, 0 ) = sx1x1 + sy1y1; +- *VIPS_MATRIX( mat, 1, 0 ) = 0; +- *VIPS_MATRIX( mat, 2, 0 ) = sx1; +- *VIPS_MATRIX( mat, 3, 0 ) = sy1; ++ *VIPS_MATRIX(mat, 0, 0) = sx1x1 + sy1y1; ++ *VIPS_MATRIX(mat, 1, 0) = 0; ++ *VIPS_MATRIX(mat, 2, 0) = sx1; ++ *VIPS_MATRIX(mat, 3, 0) = sy1; + +- *VIPS_MATRIX( mat, 0, 1 ) = 0; +- *VIPS_MATRIX( mat, 1, 1 ) = sx1x1 + sy1y1; +- *VIPS_MATRIX( mat, 2, 1 ) = -sy1; +- *VIPS_MATRIX( mat, 3, 1 ) = sx1; ++ *VIPS_MATRIX(mat, 0, 1) = 0; ++ *VIPS_MATRIX(mat, 1, 1) = sx1x1 + sy1y1; ++ *VIPS_MATRIX(mat, 2, 1) = -sy1; ++ *VIPS_MATRIX(mat, 3, 1) = sx1; + +- *VIPS_MATRIX( mat, 0, 2 ) = sx1; +- *VIPS_MATRIX( mat, 1, 2 ) = -sy1; +- *VIPS_MATRIX( mat, 2, 2 ) = (double) elms; +- *VIPS_MATRIX( mat, 3, 2 ) = 0.0; ++ *VIPS_MATRIX(mat, 0, 2) = sx1; ++ *VIPS_MATRIX(mat, 1, 2) = -sy1; ++ *VIPS_MATRIX(mat, 2, 2) = (double) elms; ++ *VIPS_MATRIX(mat, 3, 2) = 0.0; + +- *VIPS_MATRIX( mat, 0, 3 ) = sy1; +- *VIPS_MATRIX( mat, 1, 3 ) = sx1; +- *VIPS_MATRIX( mat, 2, 3 ) = 0.0; +- *VIPS_MATRIX( mat, 3, 3 ) = (double) elms; ++ *VIPS_MATRIX(mat, 0, 3) = sy1; ++ *VIPS_MATRIX(mat, 1, 3) = sx1; ++ *VIPS_MATRIX(mat, 2, 3) = 0.0; ++ *VIPS_MATRIX(mat, 3, 3) = (double) elms; + + g[0] = sx2x1 + sy2y1; + g[1] = -sx2y1 + sy2x1; + g[2] = sx2; + g[3] = sy2; + +- if( vips_matrixinvert( mat, &matinv, NULL ) ) { +- g_object_unref( mat ); +- g_free( g ); +- vips_error( "vips_clinear", "%s", _( "vips_invmat failed" ) ); +- return( -1 ); ++ if (vips_matrixinvert(mat, &matinv, NULL)) { ++ g_object_unref(mat); ++ g_free(g); ++ vips_error("vips_clinear", "%s", _("vips_invmat failed")); ++ return (-1); + } + +- scale = 0.0; angle = 0.0; +- xdelta = 0.0; ydelta = 0.0; ++ scale = 0.0; ++ angle = 0.0; ++ xdelta = 0.0; ++ ydelta = 0.0; + +- for( j = 0; j < 4; j++ ) { +- scale += *VIPS_MATRIX( matinv, j, 0 ) * g[j]; +- angle += *VIPS_MATRIX( matinv, j, 1 ) * g[j]; +- xdelta += *VIPS_MATRIX( matinv, j, 2 ) * g[j]; +- ydelta += *VIPS_MATRIX( matinv, j, 3 ) * g[j]; ++ for (j = 0; j < 4; j++) { ++ scale += *VIPS_MATRIX(matinv, j, 0) * g[j]; ++ angle += *VIPS_MATRIX(matinv, j, 1) * g[j]; ++ xdelta += *VIPS_MATRIX(matinv, j, 2) * g[j]; ++ ydelta += *VIPS_MATRIX(matinv, j, 3) * g[j]; + } + +- g_object_unref( mat ); +- g_object_unref( matinv ); +- g_free( g ); ++ g_object_unref(mat); ++ g_object_unref(matinv); ++ g_free(g); + + /* find the deviation of each point for the estimated variables + * if it greater than 1 then the solution is not good enough +- * but this is handled by the main program ++ * but this is handled by the main program + */ +- for( i = 0; i < points->nopoints; i++ ) { +- dx[i] = xsec[i] - ++ for (i = 0; i < points->nopoints; i++) { ++ dx[i] = xsec[i] - + ((scale * xref[i]) - (angle * yref[i]) + xdelta); + +- dy[i] = ysec[i] - ++ dy[i] = ysec[i] - + ((angle * xref[i]) + (scale * yref[i]) + ydelta); + +- value = sqrt( dx[i] * dx[i] + dy[i] * dy[i] ); ++ value = sqrt(dx[i] * dx[i] + dy[i] * dy[i]); + dev[i] = value; + } + +@@ -173,5 +175,5 @@ vips__clinear( TiePoints *points ) + points->l_deltax = xdelta; + points->l_deltay = ydelta; + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/mosaicing/im_improve.c b/libvips/mosaicing/im_improve.c +index 768a7e6fdd..8dddadec01 100644 +--- a/libvips/mosaicing/im_improve.c ++++ b/libvips/mosaicing/im_improve.c +@@ -1,15 +1,15 @@ +-/* @(#) Function which improves the selection of tiepoints carried out by ++/* @(#) Function which improves the selection of tiepoints carried out by + * @(#) vips_clinear() until no points have deviation greater than 1 pixel + * @(#) No reference or secondary images are involved + * @(#) Function vips__improve assumes that vips_clinear has been applied on points + * @(#) No images are involved in this function and the result is + * @(#) returned in outpoints which is declared as a pointer in the +- * @(#) calling routine. Space for outpoints should be allocated in the calling ++ * @(#) calling routine. Space for outpoints should be allocated in the calling + * @(#) routine + * @(#) + * @(#) int vips__improve( inpoints, outpoints ) + * @(#) TiePoints *inpoints, *outpoints; +- * @(#) ++ * @(#) + * @(#) Returns 0 on success and -1 on error. + * + * Copyright: 1990, N. Dessipris. +@@ -21,28 +21,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -60,7 +60,7 @@ + #include "pmosaicing.h" + + static void +-copypoints( TiePoints *pnew, TiePoints *pold ) ++copypoints(TiePoints *pnew, TiePoints *pold) + { + int i; + +@@ -73,7 +73,7 @@ copypoints( TiePoints *pnew, TiePoints *pold ) + pnew->halfcorsize = pold->halfcorsize; + pnew->halfareasize = pold->halfareasize; + +- for( i = 0; i < pold->nopoints; i++ ) { ++ for (i = 0; i < pold->nopoints; i++) { + pnew->x_reference[i] = pold->x_reference[i]; + pnew->y_reference[i] = pold->y_reference[i]; + pnew->x_secondary[i] = pold->x_secondary[i]; +@@ -94,32 +94,32 @@ copypoints( TiePoints *pnew, TiePoints *pold ) + /* exclude all points with deviation greater or equal to 1.0 pixel + */ + static int +-copydevpoints( TiePoints *pnew, TiePoints *pold ) ++copydevpoints(TiePoints *pnew, TiePoints *pold) + { + int i; + int j; +- double thresh_dev,max_dev, min_dev; ++ double thresh_dev, max_dev, min_dev; + double *corr; + + min_dev = 9999.0; + max_dev = 0.0; + corr = &pold->correlation[0]; + +- for( i = 0; i < pold->nopoints; i++ ) +- if( corr[i] > 0.01 ) { +- if( pold->deviation[i] / corr[i] < min_dev ) +- min_dev = pold->deviation[i]/corr[i] ; +- if( pold->deviation[i] / corr[i] > max_dev ) +- max_dev = pold->deviation[i]/corr[i]; ++ for (i = 0; i < pold->nopoints; i++) ++ if (corr[i] > 0.01) { ++ if (pold->deviation[i] / corr[i] < min_dev) ++ min_dev = pold->deviation[i] / corr[i]; ++ if (pold->deviation[i] / corr[i] > max_dev) ++ max_dev = pold->deviation[i] / corr[i]; + } + + thresh_dev = min_dev + (max_dev - min_dev) * 0.3; +- if( thresh_dev <= 1.0 ) ++ if (thresh_dev <= 1.0) + thresh_dev = 1.0; + +- for( i = 0, j = 0; i < pold->nopoints; i++ ) +- if( pold->correlation[i] > 0.01 ) +- if( pold->deviation[i] / corr[i] <= thresh_dev ) { ++ for (i = 0, j = 0; i < pold->nopoints; i++) ++ if (pold->correlation[i] > 0.01) ++ if (pold->deviation[i] / corr[i] <= thresh_dev) { + pnew->x_reference[j] = pold->x_reference[i]; + pnew->y_reference[j] = pold->y_reference[i]; + pnew->x_secondary[j] = pold->x_secondary[i]; +@@ -133,7 +133,7 @@ copydevpoints( TiePoints *pnew, TiePoints *pold ) + } + pnew->nopoints = j; + +- for( i = j; i < VIPS_MAXPOINTS; i++ ) { ++ for (i = j; i < VIPS_MAXPOINTS; i++) { + pnew->x_reference[i] = 0; + pnew->y_reference[i] = 0; + pnew->x_secondary[i] = 0; +@@ -147,14 +147,14 @@ copydevpoints( TiePoints *pnew, TiePoints *pold ) + + /* Return non-zero if we changed something. + */ +- if( j != pold->nopoints ) +- return( -1 ); ++ if (j != pold->nopoints) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-int +-vips__improve( TiePoints *inpoints, TiePoints *outpoints ) ++int ++vips__improve(TiePoints *inpoints, TiePoints *outpoints) + { + TiePoints points1, points2; + TiePoints *p = &points1; +@@ -163,26 +163,26 @@ vips__improve( TiePoints *inpoints, TiePoints *outpoints ) + /* p has the current state - make a new state, q, with only those + * points which have a small deviation. + */ +- for( copypoints( p, inpoints ); +- copypoints( q, p ), copydevpoints( q, p ); ) { ++ for (copypoints(p, inpoints); ++ copypoints(q, p), copydevpoints(q, p);) { + /* If there are only a few left, jump out. + */ +- if( q->nopoints < 2 ) ++ if (q->nopoints < 2) + break; + + /* Fit the model to the new set of points. + */ +- if( vips__clinear( q ) ) +- return( -1 ); ++ if (vips__clinear(q)) ++ return (-1); + + /* And loop. + */ +- VIPS_SWAP( void *, p, q ); ++ VIPS_SWAP(void *, p, q); + } + + /* q has the output - copy to outpoints. + */ +- copypoints( outpoints, q ); ++ copypoints(outpoints, q); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/mosaicing/im_initialize.c b/libvips/mosaicing/im_initialize.c +index a72f3a9c6a..93f8f8c238 100644 +--- a/libvips/mosaicing/im_initialize.c ++++ b/libvips/mosaicing/im_initialize.c +@@ -1,27 +1,27 @@ + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -37,10 +37,10 @@ + + #include "pmosaicing.h" + +-int +-vips__initialize( TiePoints *points ) ++int ++vips__initialize(TiePoints *points) + { +- if( vips__clinear( points ) ) { ++ if (vips__clinear(points)) { + /* vips_clinear failed! Set some sensible fallback values. + */ + int i, j; +@@ -59,38 +59,38 @@ vips__initialize( TiePoints *points ) + int npt = points->nopoints; + + max_cor = 0.0; +- for( i = 0; i < npt; i++ ) +- if( corr[i] > max_cor ) ++ for (i = 0; i < npt; i++) ++ if (corr[i] > max_cor) + max_cor = corr[i]; + + max_cor = max_cor - 0.04; + xdelta = 0.0; + ydelta = 0.0; + j = 0; +- for( i = 0; i < npt; i++ ) +- if( corr[i] >= max_cor ) { ++ for (i = 0; i < npt; i++) ++ if (corr[i] >= max_cor) { + xdelta += xsec[i] - xref[i]; + ydelta += ysec[i] - yref[i]; + ++j; + } + +- if( j == 0 ) { +- vips_error( "vips_initialize", "no tie points" ); +- return( -1 ); ++ if (j == 0) { ++ vips_error("vips_initialize", "no tie points"); ++ return (-1); + } + + xdelta = xdelta / j; + ydelta = ydelta / j; +- for( i = 0; i < npt; i++ ) { ++ for (i = 0; i < npt; i++) { + dx[i] = (xsec[i] - xref[i]) - xdelta; + dy[i] = (ysec[i] - yref[i]) - ydelta; + } + +- for( i = 0; i < npt; i++ ) { ++ for (i = 0; i < npt; i++) { + a1 = dx[i]; + a2 = dy[i]; +- points->deviation[i] = sqrt( a1 * a1 + a2 * a2 ); +- } ++ points->deviation[i] = sqrt(a1 * a1 + a2 * a2); ++ } + + points->l_scale = 1.0; + points->l_angle = 0.0; +@@ -98,5 +98,5 @@ vips__initialize( TiePoints *points ) + points->l_deltay = ydelta; + } + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/mosaicing/im_lrcalcon.c b/libvips/mosaicing/im_lrcalcon.c +index 29f6715a43..cf5683a06f 100644 +--- a/libvips/mosaicing/im_lrcalcon.c ++++ b/libvips/mosaicing/im_lrcalcon.c +@@ -24,9 +24,9 @@ + * @(#) VipsImage *ref, *sec; + * @(#) int bandno; + * @(#) TiePoints *points; see mosaic.h +- * @(#) ++ * @(#) + * @(#) Returns 0 on sucess and -1 on error. +- * @(#) ++ * @(#) + * + * Copyright: 1990, N. Dessipris. + * +@@ -44,7 +44,7 @@ + * 26/9/97 JC + * - now skips all-black windows, instead of any-black windows + * 11/4/01 JC +- * - ooops, < 0 should have been <= 0 ++ * - ooops, < 0 should have been <= 0 + * 10/3/03 JC + * - better error message for overlap too small + * 18/6/20 kleisauke +@@ -53,28 +53,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -102,7 +102,7 @@ typedef struct { + * One-band uchar only. + */ + static int +-all_black( VipsImage *im, int xpos, int ypos, int winsize ) ++all_black(VipsImage *im, int xpos, int ypos, int winsize) + { + const int hwinsize = (winsize - 1) / 2; + const int left = xpos - hwinsize; +@@ -114,26 +114,26 @@ all_black( VipsImage *im, int xpos, int ypos, int winsize ) + + /* Loop over image. + */ +- line = im->data + top*ls + left; +- for( y = 0; y < winsize; y++ ) { +- for( x = 0; x < winsize; x++ ) +- if( line[x] ) ++ line = im->data + top * ls + left; ++ for (y = 0; y < winsize; y++) { ++ for (x = 0; x < winsize; x++) ++ if (line[x]) + /* Not all black. + */ +- return( 0 ); ++ return (0); + + line += ls; + } + +- return( -1 ); ++ return (-1); + } + + /* Calculate a value for 'contrast' within a window + * of (odd) size winsize*winsize centered at location (xpos, ypos). +- * One band uchar only, ++ * One band uchar only, + */ +-static int +-calculate_contrast( VipsImage *im, int xpos, int ypos, int winsize ) ++static int ++calculate_contrast(VipsImage *im, int xpos, int ypos, int winsize) + { + const int hwinsize = (winsize - 1) / 2; + const int left = xpos - hwinsize; +@@ -144,44 +144,44 @@ calculate_contrast( VipsImage *im, int xpos, int ypos, int winsize ) + VipsPel *line, *p; + int total; + +- line = im->data + top*ls + left; +- for( total = 0, y = 0; y < winsize - 1; y++ ) { ++ line = im->data + top * ls + left; ++ for (total = 0, y = 0; y < winsize - 1; y++) { + p = line; + +- for( x = 0; x < winsize - 1; x++ ) { ++ for (x = 0; x < winsize - 1; x++) { + const int lrd = (int) p[0] - p[1]; + const int tbd = (int) p[0] - p[ls]; + +- total += abs( lrd ) + abs( tbd ); ++ total += abs(lrd) + abs(tbd); + p += 1; + } + + line += ls; + } + +- return( total ); ++ return (total); + } + + /* Compare two PosConts for qsort. + */ + static int +-pos_compare( const void *vl, const void *vr ) ++pos_compare(const void *vl, const void *vr) + { + PosCont *l = (PosCont *) vl; + PosCont *r = (PosCont *) vr; + +- return( r->cont - l->cont ); ++ return (r->cont - l->cont); + } + +-/* Search an area for the n best contrast areas. ++/* Search an area for the n best contrast areas. + */ +-int +-vips__find_best_contrast( VipsImage *im, ++int ++vips__find_best_contrast(VipsImage *im, + int xpos, int ypos, int xsize, int ysize, +- int xarray[], int yarray[], int cont[], +- int nbest, int hcorsize ) ++ int xarray[], int yarray[], int cont[], ++ int nbest, int hcorsize) + { +- /* Geometry: we test squares of size windowsize, overlapping by ++ /* Geometry: we test squares of size windowsize, overlapping by + * hcorsize. + */ + const int windowsize = 2 * hcorsize + 1; +@@ -201,36 +201,36 @@ vips__find_best_contrast( VipsImage *im, + + int x, y, i; + +- if( nacross <= 0 || ndown <= 0 ) { +- vips_error( "vips__lrcalcon", "%s", +- _( "overlap too small for your search size" ) ); +- return( -1 ); ++ if (nacross <= 0 || ndown <= 0) { ++ vips_error("vips__lrcalcon", "%s", ++ _("overlap too small for your search size")); ++ return (-1); + } + + /* Malloc space for 3 int arrays, to keep the int coordinates and +- * the contrast. ++ * the contrast. + */ +- if( !(pc = VIPS_ARRAY( NULL, nacross * ndown, PosCont )) ) +- return( -1 ); ++ if (!(pc = VIPS_ARRAY(NULL, nacross * ndown, PosCont))) ++ return (-1); + + /* Find contrast for each area. + */ +- for( i = 0, y = 0; y < ndown; y++ ) +- for( x = 0; x < nacross; x++ ) { ++ for (i = 0, y = 0; y < ndown; y++) ++ for (x = 0; x < nacross; x++) { + const int left = xpos + x * hcorsize; + const int top = ypos + y * hcorsize; + + /* Skip this position if it is all black. + */ +- if( all_black( im, left, top, windowsize ) ) ++ if (all_black(im, left, top, windowsize)) + continue; + + /* Find contrast and note. + */ + pc[i].x = left; + pc[i].y = top; +- pc[i].cont = calculate_contrast( im, +- left, top, windowsize ); ++ pc[i].cont = calculate_contrast(im, ++ left, top, windowsize); + i++; + } + +@@ -240,32 +240,32 @@ vips__find_best_contrast( VipsImage *im, + + /* Found enough tie-points? + */ +- if( elms < nbest ) { +- vips_error( "vips_mosaic", +- _( "found %d tie-points, need at least %d" ), +- elms, nbest ); +- g_free( pc ); +- return( -1 ); ++ if (elms < nbest) { ++ vips_error("vips_mosaic", ++ _("found %d tie-points, need at least %d"), ++ elms, nbest); ++ g_free(pc); ++ return (-1); + } + + /* Sort areas by contrast. + */ +- qsort( pc, elms, sizeof( PosCont ), pos_compare ); ++ qsort(pc, elms, sizeof(PosCont), pos_compare); + + /* Copy the n best into our parent. + */ +- for( i = 0; i < nbest; i++ ) { ++ for (i = 0; i < nbest; i++) { + xarray[i] = pc[i].x; + yarray[i] = pc[i].y; + cont[i] = pc[i].cont; + } +- g_free( pc ); ++ g_free(pc); + +- return( 0 ); ++ return (0); + } + +-int +-vips__lrcalcon( VipsImage *ref, TiePoints *points ) ++int ++vips__lrcalcon(VipsImage *ref, TiePoints *points) + { + /* Geometry: border we must leave around each area. + */ +@@ -284,11 +284,11 @@ vips__lrcalcon( VipsImage *ref, TiePoints *points ) + + /* Make sure we can read image. + */ +- if( vips_image_wio_input( ref ) ) +- return( -1 ); +- if( ref->Bands != 1 || ref->BandFmt != VIPS_FORMAT_UCHAR ) { +- vips_error( "vips__lrcalcon", "%s", _( "not 1-band uchar image" ) ); +- return( -1 ); ++ if (vips_image_wio_input(ref)) ++ return (-1); ++ if (ref->Bands != 1 || ref->BandFmt != VIPS_FORMAT_UCHAR) { ++ vips_error("vips__lrcalcon", "%s", _("not 1-band uchar image")); ++ return (-1); + } + + /* Define bits to search for high-contrast areas. Need to be able to +@@ -298,21 +298,21 @@ vips__lrcalcon( VipsImage *ref, TiePoints *points ) + area.width = ref->Xsize; + area.left = 0; + area.top = 0; +- vips_rect_marginadjust( &area, -border ); ++ vips_rect_marginadjust(&area, -border); + area.width--; + area.height--; + + /* Loop over areas, finding points. + */ +- for( i = 0; area.top < ref->Ysize; area.top += aheight, i++ ) +- if( vips__find_best_contrast( ref, +- area.left, area.top, area.width, area.height, +- points->x_reference + i*len, +- points->y_reference + i*len, +- points->contrast + i*len, +- len, +- points->halfcorsize ) ) +- return( -1 ); +- +- return( 0 ); ++ for (i = 0; area.top < ref->Ysize; area.top += aheight, i++) ++ if (vips__find_best_contrast(ref, ++ area.left, area.top, area.width, area.height, ++ points->x_reference + i * len, ++ points->y_reference + i * len, ++ points->contrast + i * len, ++ len, ++ points->halfcorsize)) ++ return (-1); ++ ++ return (0); + } +diff --git a/libvips/mosaicing/im_tbcalcon.c b/libvips/mosaicing/im_tbcalcon.c +index 0f4738684e..836f46ccc1 100644 +--- a/libvips/mosaicing/im_tbcalcon.c ++++ b/libvips/mosaicing/im_tbcalcon.c +@@ -14,14 +14,14 @@ + * @(#) Input image should are either memory mapped or in a buffer. + * @(#) To make the calculation faster set FACTOR to 1, 2 or 3 + * @(#) Calculations are based on bandno only. +- * @(#) The function uses functions vips__find_best_contrast() ++ * @(#) The function uses functions vips__find_best_contrast() + * @(#) which is in vips_lrcalcon() + * @(#) + * @(#) int vips_tbcalcon( ref, sec, bandno, points ) + * @(#) VipsImage *ref, *sec; + * @(#) int bandno; + * @(#) TiePoints *points; see mosaic.h +- * @(#) ++ * @(#) + * @(#) Returns 0 on success and -1 on error. + * + * Copyright: 1990, N. Dessipris. +@@ -41,28 +41,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -79,8 +79,8 @@ + + #include "pmosaicing.h" + +-int +-vips__tbcalcon( VipsImage *ref, TiePoints *points ) ++int ++vips__tbcalcon(VipsImage *ref, TiePoints *points) + { + /* Geometry: border we must leave around each area. + */ +@@ -99,11 +99,11 @@ vips__tbcalcon( VipsImage *ref, TiePoints *points ) + + /* Make sure we can read image. + */ +- if( vips_image_wio_input( ref ) ) +- return( -1 ); +- if( ref->Bands != 1 || ref->BandFmt != VIPS_FORMAT_UCHAR ) { +- vips_error( "vips__tbcalcon", "%s", _( "help!" ) ); +- return( -1 ); ++ if (vips_image_wio_input(ref)) ++ return (-1); ++ if (ref->Bands != 1 || ref->BandFmt != VIPS_FORMAT_UCHAR) { ++ vips_error("vips__tbcalcon", "%s", _("help!")); ++ return (-1); + } + + /* Define bits to search for high-contrast areas. +@@ -112,25 +112,25 @@ vips__tbcalcon( VipsImage *ref, TiePoints *points ) + area.height = ref->Ysize; + area.left = 0; + area.top = 0; +- vips_rect_marginadjust( &area, -border ); ++ vips_rect_marginadjust(&area, -border); + area.width--; + area.height--; +- if( area.width < 0 || area.height < 0 ) { +- vips_error( "vips__tbcalcon", "%s", _( "overlap too small" ) ); +- return( -1 ); ++ if (area.width < 0 || area.height < 0) { ++ vips_error("vips__tbcalcon", "%s", _("overlap too small")); ++ return (-1); + } + + /* Loop over areas, finding points. + */ +- for( i = 0; area.left < ref->Xsize; area.left += awidth, i++ ) +- if( vips__find_best_contrast( ref, +- area.left, area.top, area.width, area.height, +- points->x_reference + i * len, +- points->y_reference + i * len, +- points->contrast + i * len, +- len, +- points->halfcorsize ) ) +- return( -1 ); +- +- return( 0 ); ++ for (i = 0; area.left < ref->Xsize; area.left += awidth, i++) ++ if (vips__find_best_contrast(ref, ++ area.left, area.top, area.width, area.height, ++ points->x_reference + i * len, ++ points->y_reference + i * len, ++ points->contrast + i * len, ++ len, ++ points->halfcorsize)) ++ return (-1); ++ ++ return (0); + } +diff --git a/libvips/mosaicing/lrmerge.c b/libvips/mosaicing/lrmerge.c +index 9f9c420b1e..42ced64c31 100644 +--- a/libvips/mosaicing/lrmerge.c ++++ b/libvips/mosaicing/lrmerge.c +@@ -1,6 +1,6 @@ +-/* Merge two images left-right. ++/* Merge two images left-right. + * +- * Copyright: 1990, 1991 N. Dessipris ++ * Copyright: 1990, 1991 N. Dessipris + * Author: N. Dessipris + * Written on: 20/09/1990 + * Updated on: 17/04/1991 +@@ -89,28 +89,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -143,142 +143,184 @@ double *vips__coef2 = NULL; + int *vips__icoef1 = NULL; + int *vips__icoef2 = NULL; + +-/* Create a lut for the merging area. Always BLEND_SIZE entries, we ++/* Create a lut for the merging area. Always BLEND_SIZE entries, we + * scale later when we index it. + */ + int +-vips__make_blend_luts( void ) ++vips__make_blend_luts(void) + { + int x; + + /* Already done? + */ +- if( vips__coef1 && vips__coef2 ) +- return( 0 ); ++ if (vips__coef1 && vips__coef2) ++ return (0); + + /* Allocate and fill. + */ +- vips__coef1 = VIPS_ARRAY( NULL, BLEND_SIZE, double ); +- vips__coef2 = VIPS_ARRAY( NULL, BLEND_SIZE, double ); +- vips__icoef1 = VIPS_ARRAY( NULL, BLEND_SIZE, int ); +- vips__icoef2 = VIPS_ARRAY( NULL, BLEND_SIZE, int ); +- if( !vips__coef1 || !vips__coef2 || !vips__icoef1 || !vips__icoef2 ) +- return( -1 ); +- +- for( x = 0; x < BLEND_SIZE; x++ ) { ++ vips__coef1 = VIPS_ARRAY(NULL, BLEND_SIZE, double); ++ vips__coef2 = VIPS_ARRAY(NULL, BLEND_SIZE, double); ++ vips__icoef1 = VIPS_ARRAY(NULL, BLEND_SIZE, int); ++ vips__icoef2 = VIPS_ARRAY(NULL, BLEND_SIZE, int); ++ if (!vips__coef1 || !vips__coef2 || !vips__icoef1 || !vips__icoef2) ++ return (-1); ++ ++ for (x = 0; x < BLEND_SIZE; x++) { + double a = VIPS_PI * x / (BLEND_SIZE - 1.0); + +- vips__coef1[x] = (cos( a ) + 1.0) / 2.0; ++ vips__coef1[x] = (cos(a) + 1.0) / 2.0; + vips__coef2[x] = 1.0 - vips__coef1[x]; + vips__icoef1[x] = vips__coef1[x] * BLEND_SCALE; + vips__icoef2[x] = vips__coef2[x] * BLEND_SCALE; + } + +- return( 0 ); ++ return (0); + } + + /* Return the position of the first non-zero pel from the left. + */ + static int +-find_first( VipsRegion *ir, int *pos, int x, int y, int w ) ++find_first(VipsRegion *ir, int *pos, int x, int y, int w) + { +- VipsPel *pr = VIPS_REGION_ADDR( ir, x, y ); ++ VipsPel *pr = VIPS_REGION_ADDR(ir, x, y); + VipsImage *im = ir->im; + int ne = w * im->Bands; + int i; + + /* Double the number of bands in a complex. + */ +- if( vips_band_format_iscomplex( im->BandFmt ) ) ++ if (vips_band_format_iscomplex(im->BandFmt)) + ne *= 2; + + /* Search for the first non-zero band element from the left edge of the image. + */ +-#define lsearch( TYPE ) { \ +- TYPE *p = (TYPE *) pr; \ +- \ +- for( i = 0; i < ne; i++ ) \ +- if( p[i] )\ +- break;\ +-} ++#define lsearch(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) pr; \ ++\ ++ for (i = 0; i < ne; i++) \ ++ if (p[i]) \ ++ break; \ ++ } + +- switch( im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: lsearch( unsigned char ); break; +- case VIPS_FORMAT_CHAR: lsearch( signed char ); break; +- case VIPS_FORMAT_USHORT: lsearch( unsigned short ); break; +- case VIPS_FORMAT_SHORT: lsearch( signed short ); break; +- case VIPS_FORMAT_UINT: lsearch( unsigned int ); break; +- case VIPS_FORMAT_INT: lsearch( signed int ); break; +- case VIPS_FORMAT_FLOAT: lsearch( float ); break; +- case VIPS_FORMAT_DOUBLE: lsearch( double ); break; +- case VIPS_FORMAT_COMPLEX: lsearch( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: lsearch( double ); break; ++ switch (im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ lsearch(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ lsearch(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ lsearch(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ lsearch(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ lsearch(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ lsearch(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ lsearch(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ lsearch(double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ lsearch(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ lsearch(double); ++ break; + + default: +- g_assert_not_reached(); +- return( -1 ); ++ g_assert_not_reached(); ++ return (-1); + } + + /* i is first non-zero band element, we want first non-zero pixel. + */ + *pos = x + i / im->Bands; + +- return( 0 ); ++ return (0); + } + + /* Return the position of the first non-zero pel from the right. + */ + static int +-find_last( VipsRegion *ir, int *pos, int x, int y, int w ) ++find_last(VipsRegion *ir, int *pos, int x, int y, int w) + { +- VipsPel *pr = VIPS_REGION_ADDR( ir, x, y ); ++ VipsPel *pr = VIPS_REGION_ADDR(ir, x, y); + VipsImage *im = ir->im; + int ne = w * im->Bands; + int i; + + /* Double the number of bands in a complex. + */ +- if( vips_band_format_iscomplex( im->BandFmt ) ) ++ if (vips_band_format_iscomplex(im->BandFmt)) + ne *= 2; + + /* Search for the first non-zero band element from the right. + */ +-#define rsearch( TYPE ) { \ +- TYPE *p = (TYPE *) pr; \ +- \ +- for( i = ne - 1; i >= 0; i-- )\ +- if( p[i] )\ +- break;\ +-} ++#define rsearch(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) pr; \ ++\ ++ for (i = ne - 1; i >= 0; i--) \ ++ if (p[i]) \ ++ break; \ ++ } + +- switch( im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: rsearch( unsigned char ); break; +- case VIPS_FORMAT_CHAR: rsearch( signed char ); break; +- case VIPS_FORMAT_USHORT: rsearch( unsigned short ); break; +- case VIPS_FORMAT_SHORT: rsearch( signed short ); break; +- case VIPS_FORMAT_UINT: rsearch( unsigned int ); break; +- case VIPS_FORMAT_INT: rsearch( signed int ); break; +- case VIPS_FORMAT_FLOAT: rsearch( float ); break; +- case VIPS_FORMAT_DOUBLE: rsearch( double ); break; +- case VIPS_FORMAT_COMPLEX: rsearch( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: rsearch( double ); break; ++ switch (im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ rsearch(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ rsearch(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ rsearch(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ rsearch(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ rsearch(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ rsearch(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ rsearch(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ rsearch(double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ rsearch(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ rsearch(double); ++ break; + + default: +- vips_error( "lrmerge", "%s", _( "internal error" ) ); +- return( -1 ); ++ vips_error("lrmerge", "%s", _("internal error")); ++ return (-1); + } + + /* i is first non-zero band element, we want first non-zero pixel. + */ + *pos = x + i / im->Bands; + +- return( 0 ); ++ return (0); + } + + /* Make sure we have first/last for this area. + */ + static int +-make_firstlast( MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) ++make_firstlast(MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg) + { + VipsRegion *rir = inf->rir; + VipsRegion *sir = inf->sir; +@@ -290,25 +332,25 @@ make_firstlast( MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) + * threads. In fact it's harmless if we do get two writers, but we may + * avoid duplicating work. + */ +- g_mutex_lock( ovlap->fl_lock ); ++ g_mutex_lock(ovlap->fl_lock); + + /* Do we already have first/last for this area? Bail out if we do. + */ + missing = 0; +- for( y = oreg->top; y < VIPS_RECT_BOTTOM( oreg ); y++ ) { ++ for (y = oreg->top; y < VIPS_RECT_BOTTOM(oreg); y++) { + const int j = y - ovlap->overlap.top; + const int first = ovlap->first[j]; + +- if( first < 0 ) { ++ if (first < 0) { + missing = 1; + break; + } + } +- if( !missing ) { ++ if (!missing) { + /* No work to do! + */ +- g_mutex_unlock( ovlap->fl_lock ); +- return( 0 ); ++ g_mutex_unlock(ovlap->fl_lock); ++ return (0); + } + + /* Entire width of overlap in ref for scan-lines we want. +@@ -330,40 +372,40 @@ make_firstlast( MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) + sr.top -= ovlap->sarea.top; + + #ifdef DEBUG +- printf( "lrmerge: making first/last for areas:\n" ); +- printf( "ref: left = %d, top = %d, width = %d, height = %d\n", +- rr.left, rr.top, rr.width, rr.height ); +- printf( "sec: left = %d, top = %d, width = %d, height = %d\n", +- sr.left, sr.top, sr.width, sr.height ); ++ printf("lrmerge: making first/last for areas:\n"); ++ printf("ref: left = %d, top = %d, width = %d, height = %d\n", ++ rr.left, rr.top, rr.width, rr.height); ++ printf("sec: left = %d, top = %d, width = %d, height = %d\n", ++ sr.left, sr.top, sr.width, sr.height); + #endif + + /* Make pixels. + */ +- if( vips_region_prepare( rir, &rr ) || +- vips_region_prepare( sir, &sr ) ) { +- g_mutex_unlock( ovlap->fl_lock ); +- return( -1 ); ++ if (vips_region_prepare(rir, &rr) || ++ vips_region_prepare(sir, &sr)) { ++ g_mutex_unlock(ovlap->fl_lock); ++ return (-1); + } + + /* Make first/last cache. + */ +- for( y = oreg->top, yr = rr.top, ys = sr.top; +- y < VIPS_RECT_BOTTOM( oreg ); y++, yr++, ys++ ) { ++ for (y = oreg->top, yr = rr.top, ys = sr.top; ++ y < VIPS_RECT_BOTTOM(oreg); y++, yr++, ys++) { + const int j = y - ovlap->overlap.top; + int *first = &ovlap->first[j]; + int *last = &ovlap->last[j]; + + /* Done this line already? + */ +- if( *first < 0 ) { ++ if (*first < 0) { + /* Search for start/end of overlap on this scan-line. + */ +- if( find_first( sir, first, +- sr.left, ys, sr.width ) || +- find_last( rir, last, +- rr.left, yr, rr.width ) ) { +- g_mutex_unlock( ovlap->fl_lock ); +- return( -1 ); ++ if (find_first(sir, first, ++ sr.left, ys, sr.width) || ++ find_last(rir, last, ++ rr.left, yr, rr.width)) { ++ g_mutex_unlock(ovlap->fl_lock); ++ return (-1); + } + + /* Translate to output space. +@@ -373,8 +415,8 @@ make_firstlast( MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) + + /* Clip to maximum blend width, if necessary. + */ +- if( ovlap->mwidth >= 0 && +- *last - *first > ovlap->mwidth ) { ++ if (ovlap->mwidth >= 0 && ++ *last - *first > ovlap->mwidth) { + int shrinkby = (*last - *first) - ovlap->mwidth; + + *first += shrinkby / 2; +@@ -383,161 +425,162 @@ make_firstlast( MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) + } + } + +- g_mutex_unlock( ovlap->fl_lock ); ++ g_mutex_unlock(ovlap->fl_lock); + +- return( 0 ); ++ return (0); + } + + /* Test pixel == 0. + */ +-#define TEST_ZERO( TYPE, T, RESULT ) { \ +- TYPE *tt = (T); \ +- int ii; \ +- \ +- for( ii = 0; ii < cb; ii++ ) \ +- if( tt[i + ii] ) \ +- break; \ +- if( ii == cb ) \ +- (RESULT) = 1; \ +-} ++#define TEST_ZERO(TYPE, T, RESULT) \ ++ { \ ++ TYPE *tt = (T); \ ++ int ii; \ ++\ ++ for (ii = 0; ii < cb; ii++) \ ++ if (tt[i + ii]) \ ++ break; \ ++ if (ii == cb) \ ++ (RESULT) = 1; \ ++ } + + /* Blend two integer images. + */ +-#define iblend( TYPE, B, IN1, IN2, OUT ) { \ +- TYPE *tr = (TYPE *) (IN1); \ +- TYPE *ts = (TYPE *) (IN2); \ +- TYPE *tq = (TYPE *) (OUT); \ +- const int cb = (B); \ +- const int left = VIPS_CLIP( 0, first - oreg->left, oreg->width ); \ +- const int right = VIPS_CLIP( left, last - oreg->left, oreg->width ); \ +- int ref_zero; \ +- int sec_zero; \ +- int x, b; \ +- int i; \ +- \ +- /* Left of the blend area. \ +- */ \ +- for( i = 0, x = 0; x < left; x++ ) { \ +- ref_zero = 0; \ +- TEST_ZERO( TYPE, tr, ref_zero ); \ +- if( !ref_zero ) \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = tr[i]; \ +- else \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = ts[i]; \ +- } \ +- \ +- /* In blend area. \ +- */ \ +- for( x = left; x < right; x++ ) { \ +- ref_zero = 0; \ +- sec_zero = 0; \ +- TEST_ZERO( TYPE, tr, ref_zero ); \ +- TEST_ZERO( TYPE, ts, sec_zero ); \ +- \ +- if( !ref_zero && !sec_zero ) { \ +- int inx = ((x + oreg->left - first) << \ +- BLEND_SHIFT) / bwidth; \ +- int c1 = vips__icoef1[inx]; \ +- int c2 = vips__icoef2[inx]; \ +- \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = c1 * tr[i] / BLEND_SCALE + \ +- c2 * ts[i] / BLEND_SCALE; \ ++#define iblend(TYPE, B, IN1, IN2, OUT) \ ++ { \ ++ TYPE *tr = (TYPE *) (IN1); \ ++ TYPE *ts = (TYPE *) (IN2); \ ++ TYPE *tq = (TYPE *) (OUT); \ ++ const int cb = (B); \ ++ const int left = VIPS_CLIP(0, first - oreg->left, oreg->width); \ ++ const int right = VIPS_CLIP(left, last - oreg->left, oreg->width); \ ++ int ref_zero; \ ++ int sec_zero; \ ++ int x, b; \ ++ int i; \ ++\ ++ /* Left of the blend area. \ ++ */ \ ++ for (i = 0, x = 0; x < left; x++) { \ ++ ref_zero = 0; \ ++ TEST_ZERO(TYPE, tr, ref_zero); \ ++ if (!ref_zero) \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = tr[i]; \ ++ else \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = ts[i]; \ + } \ +- else if( !ref_zero ) \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = tr[i]; \ +- else \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = ts[i]; \ +- } \ +- \ +- /* Right of blend. +- */ \ +- for( x = right; x < oreg->width; x++ ) { \ +- sec_zero = 0; \ +- TEST_ZERO( TYPE, ts, sec_zero ); \ +- if( !sec_zero ) \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = ts[i]; \ +- else \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = tr[i]; \ +- } \ +-} ++\ ++ /* In blend area. \ ++ */ \ ++ for (x = left; x < right; x++) { \ ++ ref_zero = 0; \ ++ sec_zero = 0; \ ++ TEST_ZERO(TYPE, tr, ref_zero); \ ++ TEST_ZERO(TYPE, ts, sec_zero); \ ++\ ++ if (!ref_zero && !sec_zero) { \ ++ int inx = ((x + oreg->left - first) << BLEND_SHIFT) / bwidth; \ ++ int c1 = vips__icoef1[inx]; \ ++ int c2 = vips__icoef2[inx]; \ ++\ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = c1 * tr[i] / BLEND_SCALE + \ ++ c2 * ts[i] / BLEND_SCALE; \ ++ } \ ++ else if (!ref_zero) \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = tr[i]; \ ++ else \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = ts[i]; \ ++ } \ ++\ ++ /* Right of blend. \ ++ */ \ ++ for (x = right; x < oreg->width; x++) { \ ++ sec_zero = 0; \ ++ TEST_ZERO(TYPE, ts, sec_zero); \ ++ if (!sec_zero) \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = ts[i]; \ ++ else \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = tr[i]; \ ++ } \ ++ } + + /* Blend two float images. + */ +-#define fblend( TYPE, B, IN1, IN2, OUT ) { \ +- TYPE *tr = (TYPE *) (IN1); \ +- TYPE *ts = (TYPE *) (IN2); \ +- TYPE *tq = (TYPE *) (OUT); \ +- const int cb = (B); \ +- const int left = VIPS_CLIP( 0, first - oreg->left, oreg->width ); \ +- const int right = VIPS_CLIP( left, last - oreg->left, oreg->width ); \ +- int ref_zero; \ +- int sec_zero; \ +- int x, b; \ +- int i; \ +- \ +- /* Left of the blend area. \ +- */ \ +- for( i = 0, x = 0; x < left; x++ ) { \ +- ref_zero = 0; \ +- TEST_ZERO( TYPE, tr, ref_zero ); \ +- if( !ref_zero ) \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = tr[i]; \ +- else \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = ts[i]; \ +- } \ +- \ +- /* In blend area. \ +- */ \ +- for( x = left; x < right; x++ ) { \ +- ref_zero = 0; \ +- sec_zero = 0; \ +- TEST_ZERO( TYPE, tr, ref_zero ); \ +- TEST_ZERO( TYPE, ts, sec_zero ); \ +- \ +- if( !ref_zero && !sec_zero ) { \ +- int inx = ((x + oreg->left - first) << \ +- BLEND_SHIFT) / bwidth; \ +- double c1 = vips__coef1[inx]; \ +- double c2 = vips__coef2[inx]; \ +- \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = c1 * tr[i] + c2 * ts[i]; \ ++#define fblend(TYPE, B, IN1, IN2, OUT) \ ++ { \ ++ TYPE *tr = (TYPE *) (IN1); \ ++ TYPE *ts = (TYPE *) (IN2); \ ++ TYPE *tq = (TYPE *) (OUT); \ ++ const int cb = (B); \ ++ const int left = VIPS_CLIP(0, first - oreg->left, oreg->width); \ ++ const int right = VIPS_CLIP(left, last - oreg->left, oreg->width); \ ++ int ref_zero; \ ++ int sec_zero; \ ++ int x, b; \ ++ int i; \ ++\ ++ /* Left of the blend area. \ ++ */ \ ++ for (i = 0, x = 0; x < left; x++) { \ ++ ref_zero = 0; \ ++ TEST_ZERO(TYPE, tr, ref_zero); \ ++ if (!ref_zero) \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = tr[i]; \ ++ else \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = ts[i]; \ + } \ +- else if( !ref_zero ) \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = tr[i]; \ +- else \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = ts[i]; \ +- } \ +- \ +- /* Right of blend. +- */ \ +- for( x = right; x < oreg->width; x++ ) { \ +- sec_zero = 0; \ +- TEST_ZERO( TYPE, ts, sec_zero ); \ +- if( !sec_zero ) \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = ts[i]; \ +- else \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = tr[i]; \ +- } \ +-} ++\ ++ /* In blend area. \ ++ */ \ ++ for (x = left; x < right; x++) { \ ++ ref_zero = 0; \ ++ sec_zero = 0; \ ++ TEST_ZERO(TYPE, tr, ref_zero); \ ++ TEST_ZERO(TYPE, ts, sec_zero); \ ++\ ++ if (!ref_zero && !sec_zero) { \ ++ int inx = ((x + oreg->left - first) << BLEND_SHIFT) / bwidth; \ ++ double c1 = vips__coef1[inx]; \ ++ double c2 = vips__coef2[inx]; \ ++\ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = c1 * tr[i] + c2 * ts[i]; \ ++ } \ ++ else if (!ref_zero) \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = tr[i]; \ ++ else \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = ts[i]; \ ++ } \ ++\ ++ /* Right of blend. \ ++ */ \ ++ for (x = right; x < oreg->width; x++) { \ ++ sec_zero = 0; \ ++ TEST_ZERO(TYPE, ts, sec_zero); \ ++ if (!sec_zero) \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = ts[i]; \ ++ else \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = tr[i]; \ ++ } \ ++ } + + /* Left-right blend function for non-labpack images. + */ + static int +-lr_blend( VipsRegion *or, MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) ++lr_blend(VipsRegion * or, MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg) + { + VipsRegion *rir = inf->rir; + VipsRegion *sir = inf->sir; +@@ -548,8 +591,8 @@ lr_blend( VipsRegion *or, MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) + + /* Make sure we have a complete first/last set for this area. + */ +- if( make_firstlast( inf, ovlap, oreg ) ) +- return( -1 ); ++ if (make_firstlast(inf, ovlap, oreg)) ++ return (-1); + + /* Part of rr which we will output. + */ +@@ -565,59 +608,69 @@ lr_blend( VipsRegion *or, MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) + + /* Make pixels. + */ +- if( vips_region_prepare( rir, &prr ) || +- vips_region_prepare( sir, &psr ) ) +- return( -1 ); ++ if (vips_region_prepare(rir, &prr) || ++ vips_region_prepare(sir, &psr)) ++ return (-1); + + /* Loop down overlap area. + */ +- for( y = oreg->top, yr = prr.top, ys = psr.top; +- y < VIPS_RECT_BOTTOM( oreg ); y++, yr++, ys++ ) { +- VipsPel *pr = VIPS_REGION_ADDR( rir, prr.left, yr ); +- VipsPel *ps = VIPS_REGION_ADDR( sir, psr.left, ys ); +- VipsPel *q = VIPS_REGION_ADDR( or, oreg->left, y ); ++ for (y = oreg->top, yr = prr.top, ys = psr.top; ++ y < VIPS_RECT_BOTTOM(oreg); y++, yr++, ys++) { ++ VipsPel *pr = VIPS_REGION_ADDR(rir, prr.left, yr); ++ VipsPel *ps = VIPS_REGION_ADDR(sir, psr.left, ys); ++ VipsPel *q = VIPS_REGION_ADDR(or, oreg->left, y); + + const int j = y - ovlap->overlap.top; + const int first = ovlap->first[j]; + const int last = ovlap->last[j]; + const int bwidth = last - first; + +- switch( im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- iblend( unsigned char, im->Bands, pr, ps, q ); break; +- case VIPS_FORMAT_CHAR: +- iblend( signed char, im->Bands, pr, ps, q ); break; +- case VIPS_FORMAT_USHORT: +- iblend( unsigned short, im->Bands, pr, ps, q ); break; +- case VIPS_FORMAT_SHORT: +- iblend( signed short, im->Bands, pr, ps, q ); break; +- case VIPS_FORMAT_UINT: +- iblend( unsigned int, im->Bands, pr, ps, q ); break; +- case VIPS_FORMAT_INT: +- iblend( signed int, im->Bands, pr, ps, q ); break; +- case VIPS_FORMAT_FLOAT: +- fblend( float, im->Bands, pr, ps, q ); break; +- case VIPS_FORMAT_DOUBLE: +- fblend( double, im->Bands, pr, ps, q ); break; ++ switch (im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ iblend(unsigned char, im->Bands, pr, ps, q); ++ break; ++ case VIPS_FORMAT_CHAR: ++ iblend(signed char, im->Bands, pr, ps, q); ++ break; ++ case VIPS_FORMAT_USHORT: ++ iblend(unsigned short, im->Bands, pr, ps, q); ++ break; ++ case VIPS_FORMAT_SHORT: ++ iblend(signed short, im->Bands, pr, ps, q); ++ break; ++ case VIPS_FORMAT_UINT: ++ iblend(unsigned int, im->Bands, pr, ps, q); ++ break; ++ case VIPS_FORMAT_INT: ++ iblend(signed int, im->Bands, pr, ps, q); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ fblend(float, im->Bands, pr, ps, q); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ fblend(double, im->Bands, pr, ps, q); ++ break; + case VIPS_FORMAT_COMPLEX: +- fblend( float, im->Bands * 2, pr, ps, q ); break; ++ fblend(float, im->Bands * 2, pr, ps, q); ++ break; + case VIPS_FORMAT_DPCOMPLEX: +- fblend( double, im->Bands * 2, pr, ps, q ); break; ++ fblend(double, im->Bands * 2, pr, ps, q); ++ break; + + default: + g_assert_not_reached(); +- return( -1 ); ++ return (-1); + } + } + +- return( 0 ); ++ return (0); + } + + /* Left-right blend function for VIPS_CODING_LABQ images. + */ + static int +-lr_blend_labpack( VipsRegion *or, MergeInfo *inf, Overlapping *ovlap, +- VipsRect *oreg ) ++lr_blend_labpack(VipsRegion * or, MergeInfo *inf, Overlapping *ovlap, ++ VipsRect *oreg) + { + VipsRegion *rir = inf->rir; + VipsRegion *sir = inf->sir; +@@ -627,8 +680,8 @@ lr_blend_labpack( VipsRegion *or, MergeInfo *inf, Overlapping *ovlap, + /* Make sure we have a complete first/last set for this area. This + * will just look at the top 8 bits of L, not all 10, but should be OK. + */ +- if( make_firstlast( inf, ovlap, oreg ) ) +- return( -1 ); ++ if (make_firstlast(inf, ovlap, oreg)) ++ return (-1); + + /* Part of rr which we will output. + */ +@@ -644,17 +697,17 @@ lr_blend_labpack( VipsRegion *or, MergeInfo *inf, Overlapping *ovlap, + + /* Make pixels. + */ +- if( vips_region_prepare( rir, &prr ) || +- vips_region_prepare( sir, &psr ) ) +- return( -1 ); ++ if (vips_region_prepare(rir, &prr) || ++ vips_region_prepare(sir, &psr)) ++ return (-1); + + /* Loop down overlap area. + */ +- for( y = oreg->top, yr = prr.top, ys = psr.top; +- y < VIPS_RECT_BOTTOM( oreg ); y++, yr++, ys++ ) { +- VipsPel *pr = VIPS_REGION_ADDR( rir, prr.left, yr ); +- VipsPel *ps = VIPS_REGION_ADDR( sir, psr.left, ys ); +- VipsPel *q = VIPS_REGION_ADDR( or, oreg->left, y ); ++ for (y = oreg->top, yr = prr.top, ys = psr.top; ++ y < VIPS_RECT_BOTTOM(oreg); y++, yr++, ys++) { ++ VipsPel *pr = VIPS_REGION_ADDR(rir, prr.left, yr); ++ VipsPel *ps = VIPS_REGION_ADDR(sir, psr.left, ys); ++ VipsPel *q = VIPS_REGION_ADDR(or, oreg->left, y); + + const int j = y - ovlap->overlap.top; + const int first = ovlap->first[j]; +@@ -667,74 +720,74 @@ lr_blend_labpack( VipsRegion *or, MergeInfo *inf, Overlapping *ovlap, + + /* Unpack two bits we want. + */ +- vips__LabQ2Lab_vec( r, pr, oreg->width ); +- vips__LabQ2Lab_vec( s, ps, oreg->width ); ++ vips__LabQ2Lab_vec(r, pr, oreg->width); ++ vips__LabQ2Lab_vec(s, ps, oreg->width); + + /* Blend as floats. + */ +- fblend( float, 3, r, s, fq ); ++ fblend(float, 3, r, s, fq); + + /* Re-pack to output buffer. + */ +- vips__Lab2LabQ_vec( q, inf->merge, oreg->width ); ++ vips__Lab2LabQ_vec(q, inf->merge, oreg->width); + } + +- return( 0 ); ++ return (0); + } + + static void +-lock_free( VipsImage *image, GMutex *lock ) ++lock_free(VipsImage *image, GMutex *lock) + { +- VIPS_FREEF( vips_g_mutex_free, lock ); ++ VIPS_FREEF(vips_g_mutex_free, lock); + } + + /* Build basic per-call state and do some geometry calculations. Shared with + * tbmerge, so not static. + */ + Overlapping * +-vips__build_mergestate( const char *domain, +- VipsImage *ref, VipsImage *sec, VipsImage *out, +- int dx, int dy, int mwidth ) ++vips__build_mergestate(const char *domain, ++ VipsImage *ref, VipsImage *sec, VipsImage *out, ++ int dx, int dy, int mwidth) + { + VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 4 ); ++ vips_object_local_array(VIPS_OBJECT(out), 4); + + VipsImage **arry; +- Overlapping *ovlap; ++ Overlapping *ovlap; + int x; + + /* TODO(kleisauke): Copied from vips_insert, perhaps we + * need a separate function for this? + * (just like im__insert_base) + */ +- if( vips_image_pio_input( ref ) || +- vips_image_pio_input( sec ) || +- vips_check_bands_1orn( domain, ref, sec ) || +- vips_check_coding_known( domain, ref ) || +- vips_check_coding_same( domain, ref, sec ) ) +- return( NULL ); ++ if (vips_image_pio_input(ref) || ++ vips_image_pio_input(sec) || ++ vips_check_bands_1orn(domain, ref, sec) || ++ vips_check_coding_known(domain, ref) || ++ vips_check_coding_same(domain, ref, sec)) ++ return (NULL); + + /* Cast our input images up to a common format and bands. + */ +- if( vips__formatalike( ref, sec, &t[0], &t[1] ) || +- vips__bandalike( domain, t[0], t[1], &t[2], &t[3] ) ) +- return( NULL ); +- +- if( !(arry = vips_allocate_input_array( out, +- t[2], t[3], NULL )) ) +- return( NULL ); +- +- if( vips_image_pipeline_array( out, +- VIPS_DEMAND_STYLE_SMALLTILE, arry ) ) +- return( NULL ); +- +- if( mwidth < -1 ) { +- vips_error( domain, "%s", _( "mwidth must be -1 or >= 0" ) ); +- return( NULL ); ++ if (vips__formatalike(ref, sec, &t[0], &t[1]) || ++ vips__bandalike(domain, t[0], t[1], &t[2], &t[3])) ++ return (NULL); ++ ++ if (!(arry = vips_allocate_input_array(out, ++ t[2], t[3], NULL))) ++ return (NULL); ++ ++ if (vips_image_pipeline_array(out, ++ VIPS_DEMAND_STYLE_SMALLTILE, arry)) ++ return (NULL); ++ ++ if (mwidth < -1) { ++ vips_error(domain, "%s", _("mwidth must be -1 or >= 0")); ++ return (NULL); + } + +- if( !(ovlap = VIPS_NEW( out, Overlapping )) ) +- return( NULL ); ++ if (!(ovlap = VIPS_NEW(out, Overlapping))) ++ return (NULL); + + ovlap->ref = arry[0]; + ovlap->sec = arry[1]; +@@ -745,29 +798,29 @@ vips__build_mergestate( const char *domain, + + /* Area occupied by ref image. Place at (0,0) to start with. + */ +- ovlap->rarea.left = 0; +- ovlap->rarea.top = 0; +- ovlap->rarea.width = ovlap->ref->Xsize; +- ovlap->rarea.height = ovlap->ref->Ysize; ++ ovlap->rarea.left = 0; ++ ovlap->rarea.top = 0; ++ ovlap->rarea.width = ovlap->ref->Xsize; ++ ovlap->rarea.height = ovlap->ref->Ysize; + +- /* Area occupied by sec image. ++ /* Area occupied by sec image. + */ +- ovlap->sarea.left = -dx; +- ovlap->sarea.top = -dy; +- ovlap->sarea.width = ovlap->sec->Xsize; +- ovlap->sarea.height = ovlap->sec->Ysize; ++ ovlap->sarea.left = -dx; ++ ovlap->sarea.top = -dy; ++ ovlap->sarea.width = ovlap->sec->Xsize; ++ ovlap->sarea.height = ovlap->sec->Ysize; + +- /* Compute overlap. ++ /* Compute overlap. + */ +- vips_rect_intersectrect( &ovlap->rarea, &ovlap->sarea, &ovlap->overlap ); +- if( vips_rect_isempty( &ovlap->overlap ) ) { +- vips_error( domain, "%s", _( "no overlap" ) ); +- return( NULL ); ++ vips_rect_intersectrect(&ovlap->rarea, &ovlap->sarea, &ovlap->overlap); ++ if (vips_rect_isempty(&ovlap->overlap)) { ++ vips_error(domain, "%s", _("no overlap")); ++ return (NULL); + } + + /* Find position and size of output image. + */ +- vips_rect_unionrect( &ovlap->rarea, &ovlap->sarea, &ovlap->oarea ); ++ vips_rect_unionrect(&ovlap->rarea, &ovlap->sarea, &ovlap->oarea); + + /* Now: translate everything, so that the output image, not the left + * image, is at (0,0). +@@ -784,44 +837,44 @@ vips__build_mergestate( const char *domain, + /* Make sure blend luts are built. + */ + vips__make_blend_luts(); +- ++ + /* Size of first/last cache. Could be either of these ... just pick + * the larger. + */ +- ovlap->flsize = VIPS_MAX( ovlap->overlap.width, ovlap->overlap.height ); ++ ovlap->flsize = VIPS_MAX(ovlap->overlap.width, ovlap->overlap.height); + + /* Build first/last cache. + */ +- ovlap->first = VIPS_ARRAY( out, ovlap->flsize, int ); +- ovlap->last = VIPS_ARRAY( out, ovlap->flsize, int ); +- if( !ovlap->first || !ovlap->last ) +- return( NULL ); +- for( x = 0; x < ovlap->flsize; x++ ) ++ ovlap->first = VIPS_ARRAY(out, ovlap->flsize, int); ++ ovlap->last = VIPS_ARRAY(out, ovlap->flsize, int); ++ if (!ovlap->first || !ovlap->last) ++ return (NULL); ++ for (x = 0; x < ovlap->flsize; x++) + ovlap->first[x] = -1; + + ovlap->fl_lock = vips_g_mutex_new(); + +- g_signal_connect( out, "close", +- G_CALLBACK( lock_free ), ovlap->fl_lock ); ++ g_signal_connect(out, "close", ++ G_CALLBACK(lock_free), ovlap->fl_lock); + +- return( ovlap ); ++ return (ovlap); + } + + /* Build per-call state. + */ + static Overlapping * +-build_lrstate( VipsImage *ref, VipsImage *sec, VipsImage *out, +- int dx, int dy, int mwidth ) ++build_lrstate(VipsImage *ref, VipsImage *sec, VipsImage *out, ++ int dx, int dy, int mwidth) + { +- Overlapping *ovlap; ++ Overlapping *ovlap; + +- if( !(ovlap = vips__build_mergestate( "lrmerge", +- ref, sec, out, dx, dy, mwidth )) ) +- return( NULL ); ++ if (!(ovlap = vips__build_mergestate("lrmerge", ++ ref, sec, out, dx, dy, mwidth))) ++ return (NULL); + + /* Select blender. + */ +- switch( ovlap->ref->Coding ) { ++ switch (ovlap->ref->Coding) { + case VIPS_CODING_LABQ: + ovlap->blend = lr_blend_labpack; + break; +@@ -831,8 +884,8 @@ build_lrstate( VipsImage *ref, VipsImage *sec, VipsImage *out, + break; + + default: +- vips_error( "lrmerge", "%s", _( "unknown coding type" ) ); +- return( NULL ); ++ vips_error("lrmerge", "%s", _("unknown coding type")); ++ return (NULL); + } + + /* Find the parts of output which come just from ref and just from sec. +@@ -846,28 +899,28 @@ build_lrstate( VipsImage *ref, VipsImage *sec, VipsImage *out, + /* Is there too much overlap? ie. right edge of ref image is greater + * than right edge of sec image, or left > left. + */ +- if( VIPS_RECT_RIGHT( &ovlap->rarea ) > +- VIPS_RECT_RIGHT( &ovlap->sarea ) || +- ovlap->rarea.left > ovlap->sarea.left ) { +- vips_error( "lrmerge", "%s", _( "too much overlap" ) ); +- return( NULL ); ++ if (VIPS_RECT_RIGHT(&ovlap->rarea) > ++ VIPS_RECT_RIGHT(&ovlap->sarea) || ++ ovlap->rarea.left > ovlap->sarea.left) { ++ vips_error("lrmerge", "%s", _("too much overlap")); ++ return (NULL); + } + + /* Max number of pixels we may have to blend over. + */ + ovlap->blsize = ovlap->overlap.width; + +- return( ovlap ); ++ return (ovlap); + } + +-/* The area being demanded can be filled using only pels from either the ref +- * or the sec images. Attach output to the appropriate part of the input image. ++/* The area being demanded can be filled using only pels from either the ref ++ * or the sec images. Attach output to the appropriate part of the input image. + * area is the position that ir->im occupies in the output image. + * + * Shared with tbmerge, so not static. + */ + int +-vips__attach_input( VipsRegion *or, VipsRegion *ir, VipsRect *area ) ++vips__attach_input(VipsRegion * or, VipsRegion *ir, VipsRect *area) + { + VipsRect r = or->valid; + +@@ -878,26 +931,26 @@ vips__attach_input( VipsRegion *or, VipsRegion *ir, VipsRect *area ) + + /* Demand input. + */ +- if( vips_region_prepare( ir, &r ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &r)) ++ return (-1); + + /* Attach or to ir. + */ +- if( vips_region_region( or, ir, &or->valid, r.left, r.top ) ) +- return( -1 ); ++ if (vips_region_region(or, ir, & or->valid, r.left, r.top)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-/* The area being demanded requires pixels from the ref and sec images. As +- * above, but just do a sub-area of the output, and make sure we copy rather ++/* The area being demanded requires pixels from the ref and sec images. As ++ * above, but just do a sub-area of the output, and make sure we copy rather + * than just pointer-fiddling. reg is the sub-area of or->valid we should do. + * + * Shared with tbmerge, so not static. + */ + int +-vips__copy_input( VipsRegion *or, VipsRegion *ir, +- VipsRect *area, VipsRect *reg ) ++vips__copy_input(VipsRegion * or, VipsRegion *ir, ++ VipsRect *area, VipsRect *reg) + { + VipsRect r = *reg; + +@@ -908,64 +961,64 @@ vips__copy_input( VipsRegion *or, VipsRegion *ir, + + /* Paint this area of ir into or. + */ +- if( vips_region_prepare_to( ir, or, &r, reg->left, reg->top ) ) +- return( -1 ); ++ if (vips_region_prepare_to(ir, or, &r, reg->left, reg->top)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Generate function for merge. This is shared between lrmerge and + * tbmerge. + */ + int +-vips__merge_gen( VipsRegion *or, void *seq, void *a, void *b, +- gboolean *stop ) ++vips__merge_gen(VipsRegion * or, void *seq, void *a, void *b, ++ gboolean *stop) + { + MergeInfo *inf = (MergeInfo *) seq; + Overlapping *ovlap = (Overlapping *) a; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsRect rreg, sreg, oreg; + +- /* Find intersection with overlap, ref and sec parts. ++ /* Find intersection with overlap, ref and sec parts. + */ +- vips_rect_intersectrect( r, &ovlap->rpart, &rreg ); +- vips_rect_intersectrect( r, &ovlap->spart, &sreg ); ++ vips_rect_intersectrect(r, &ovlap->rpart, &rreg); ++ vips_rect_intersectrect(r, &ovlap->spart, &sreg); + +- /* Do easy cases first: can we satisfy this demand with pixels just ++ /* Do easy cases first: can we satisfy this demand with pixels just + * from ref, or just from sec. + */ +- if( vips_rect_equalsrect( r, &rreg ) ) { +- if( vips__attach_input( or, inf->rir, &ovlap->rarea ) ) +- return( -1 ); ++ if (vips_rect_equalsrect(r, &rreg)) { ++ if (vips__attach_input(or, inf->rir, &ovlap->rarea)) ++ return (-1); + } +- else if( vips_rect_equalsrect( r, &sreg ) ) { +- if( vips__attach_input( or, inf->sir, &ovlap->sarea ) ) +- return( -1 ); ++ else if (vips_rect_equalsrect(r, &sreg)) { ++ if (vips__attach_input(or, inf->sir, &ovlap->sarea)) ++ return (-1); + } + else { +- /* Difficult case - do in three stages: black out whole area, +- * copy in parts of ref and sec we touch, write blend area. +- * This could be sped up somewhat ... we will usually black +- * out far too much, and write to the blend area three times. ++ /* Difficult case - do in three stages: black out whole area, ++ * copy in parts of ref and sec we touch, write blend area. ++ * This could be sped up somewhat ... we will usually black ++ * out far too much, and write to the blend area three times. + * Upgrade in the future! + */ + + /* Need intersections with whole of left & right, and overlap + * too. + */ +- vips_rect_intersectrect( r, &ovlap->rarea, &rreg ); +- vips_rect_intersectrect( r, &ovlap->sarea, &sreg ); +- vips_rect_intersectrect( r, &ovlap->overlap, &oreg ); +- +- vips_region_black( or ); +- if( !vips_rect_isempty( &rreg ) ) +- if( vips__copy_input( or, +- inf->rir, &ovlap->rarea, &rreg ) ) +- return( -1 ); +- if( !vips_rect_isempty( &sreg ) ) +- if( vips__copy_input( or, +- inf->sir, &ovlap->sarea, &sreg ) ) +- return( -1 ); ++ vips_rect_intersectrect(r, &ovlap->rarea, &rreg); ++ vips_rect_intersectrect(r, &ovlap->sarea, &sreg); ++ vips_rect_intersectrect(r, &ovlap->overlap, &oreg); ++ ++ vips_region_black(or); ++ if (!vips_rect_isempty(&rreg)) ++ if (vips__copy_input(or, ++ inf->rir, &ovlap->rarea, &rreg)) ++ return (-1); ++ if (!vips_rect_isempty(&sreg)) ++ if (vips__copy_input(or, ++ inf->sir, &ovlap->sarea, &sreg)) ++ return (-1); + + /* Nasty: inf->rir and inf->sir now point to the same bit of + * memory (part of or), and we've written twice. We need to +@@ -977,42 +1030,42 @@ vips__merge_gen( VipsRegion *or, void *seq, void *a, void *b, + + /* Now blat in the blended area. + */ +- if( !vips_rect_isempty( &oreg ) ) +- if( ovlap->blend( or, inf, ovlap, &oreg ) ) +- return( -1 ); ++ if (!vips_rect_isempty(&oreg)) ++ if (ovlap->blend(or, inf, ovlap, &oreg)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + /* Stop function. Shared with tbmerge. Free explicitly to reduce mem + * requirements quickly for large mosaics. + */ + int +-vips__stop_merge( void *seq, void *a, void *b ) ++vips__stop_merge(void *seq, void *a, void *b) + { + MergeInfo *inf = (MergeInfo *) seq; + +- VIPS_UNREF( inf->rir ); +- VIPS_UNREF( inf->sir ); +- VIPS_FREE( inf->from1 ); +- VIPS_FREE( inf->from2 ); +- VIPS_FREE( inf->merge ); +- g_free( inf ); ++ VIPS_UNREF(inf->rir); ++ VIPS_UNREF(inf->sir); ++ VIPS_FREE(inf->from1); ++ VIPS_FREE(inf->from2); ++ VIPS_FREE(inf->merge); ++ g_free(inf); + +- return( 0 ); ++ return (0); + } + + /* Start function. Shared with tbmerge. + */ + void * +-vips__start_merge( VipsImage *out, void *a, void *b ) ++vips__start_merge(VipsImage *out, void *a, void *b) + { + Overlapping *ovlap = (Overlapping *) a; + MergeInfo *inf; + +- if( !(inf = VIPS_NEW( NULL, MergeInfo )) ) +- return( NULL ); ++ if (!(inf = VIPS_NEW(NULL, MergeInfo))) ++ return (NULL); + + inf->rir = NULL; + inf->sir = NULL; +@@ -1020,119 +1073,118 @@ vips__start_merge( VipsImage *out, void *a, void *b ) + inf->from2 = NULL; + inf->merge = NULL; + +- /* If this is going to be a VIPS_CODING_LABQ, we need VIPS_CODING_LABQ ++ /* If this is going to be a VIPS_CODING_LABQ, we need VIPS_CODING_LABQ + * blend buffers. + */ +- if( out->Coding == VIPS_CODING_LABQ ) { +- inf->from1 = VIPS_ARRAY( NULL, ovlap->blsize * 3, float ); +- inf->from2 = VIPS_ARRAY( NULL, ovlap->blsize * 3, float ); +- inf->merge = VIPS_ARRAY( NULL, ovlap->blsize * 3, float ); +- if( !inf->from1 || !inf->from2 || !inf->merge ) { +- vips__stop_merge( inf, NULL, NULL ); +- return( NULL ); ++ if (out->Coding == VIPS_CODING_LABQ) { ++ inf->from1 = VIPS_ARRAY(NULL, ovlap->blsize * 3, float); ++ inf->from2 = VIPS_ARRAY(NULL, ovlap->blsize * 3, float); ++ inf->merge = VIPS_ARRAY(NULL, ovlap->blsize * 3, float); ++ if (!inf->from1 || !inf->from2 || !inf->merge) { ++ vips__stop_merge(inf, NULL, NULL); ++ return (NULL); + } + } + +- inf->rir = vips_region_new( ovlap->ref ); +- inf->sir = vips_region_new( ovlap->sec ); ++ inf->rir = vips_region_new(ovlap->ref); ++ inf->sir = vips_region_new(ovlap->sec); + +- if( !inf->rir || !inf->sir ) { +- vips__stop_merge( inf, NULL, NULL ); +- return( NULL ); ++ if (!inf->rir || !inf->sir) { ++ vips__stop_merge(inf, NULL, NULL); ++ return (NULL); + } + +- return( inf ); ++ return (inf); + } + + int +-vips__lrmerge( VipsImage *ref, VipsImage *sec, VipsImage *out, +- int dx, int dy, int mwidth ) ++vips__lrmerge(VipsImage *ref, VipsImage *sec, VipsImage *out, ++ int dx, int dy, int mwidth) + { + Overlapping *ovlap; + + #ifdef DEBUG +- printf( "lrmerge %s %s %s %d %d %d\n", +- ref->filename, sec->filename, out->filename, +- dx, dy, mwidth ); +- printf( "ref is %d x %d pixels\n", ref->Xsize, ref->Ysize ); +- printf( "sec is %d x %d pixels\n", sec->Xsize, sec->Ysize ); ++ printf("lrmerge %s %s %s %d %d %d\n", ++ ref->filename, sec->filename, out->filename, ++ dx, dy, mwidth); ++ printf("ref is %d x %d pixels\n", ref->Xsize, ref->Ysize); ++ printf("sec is %d x %d pixels\n", sec->Xsize, sec->Ysize); + #endif + +- if( dx > 0 || dx < 1 - ref->Xsize ) { ++ if (dx > 0 || dx < 1 - ref->Xsize) { + VipsImage *x; + + #ifdef DEBUG +- printf( "lrmerge: no overlap, using insert\n" ); ++ printf("lrmerge: no overlap, using insert\n"); + #endif + + /* No overlap, use insert instead. + */ +- if( vips_insert( ref, sec, &x, -dx, -dy, +- "expand", TRUE, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_insert(ref, sec, &x, -dx, -dy, ++ "expand", TRUE, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + + out->Xoffset = -dx; + out->Yoffset = -dy; + +- return( 0 ); ++ return (0); + } + +- if( !(ovlap = build_lrstate( ref, sec, out, dx, dy, mwidth )) ) +- return( -1 ); ++ if (!(ovlap = build_lrstate(ref, sec, out, dx, dy, mwidth))) ++ return (-1); + +- if( vips_image_pipelinev( out, +- VIPS_DEMAND_STYLE_THINSTRIP, ovlap->ref, ovlap->sec, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(out, ++ VIPS_DEMAND_STYLE_THINSTRIP, ovlap->ref, ovlap->sec, NULL)) ++ return (-1); + + out->Xsize = ovlap->oarea.width; + out->Ysize = ovlap->oarea.height; + out->Xoffset = -dx; + out->Yoffset = -dy; + +- if( vips_image_generate( out, +- vips__start_merge, vips__merge_gen, vips__stop_merge, +- ovlap, NULL ) ) +- return( -1 ); ++ if (vips_image_generate(out, ++ vips__start_merge, vips__merge_gen, vips__stop_merge, ++ ovlap, NULL)) ++ return (-1); + +- return ( 0 ); ++ return (0); + } + + const char * +-vips__get_mosaic_name( VipsImage *image ) ++vips__get_mosaic_name(VipsImage *image) + { + const char *name; + +- if( vips_image_get_typeof( image, "mosaic-name" ) ) { +- if( vips_image_get_string( image, "mosaic-name", &name ) ) +- return( NULL ); ++ if (vips_image_get_typeof(image, "mosaic-name")) { ++ if (vips_image_get_string(image, "mosaic-name", &name)) ++ return (NULL); + } +- else ++ else + name = image->filename; + +- return( name ); ++ return (name); + } + + void +-vips__add_mosaic_name( VipsImage *image ) ++vips__add_mosaic_name(VipsImage *image) + { + static int global_serial = 0; + + /* TODO(kleisauke): Could we call vips_image_temp_name instead? + */ +- int serial = g_atomic_int_add( &global_serial, 1 ); ++ int serial = g_atomic_int_add(&global_serial, 1); + + char name[256]; + + /* We must override any inherited name, so don't test for doesn't + * exist before setting. + */ +- vips_snprintf( name, 256, "mosaic-temp-%d", serial ); +- vips_image_set_string( image, "mosaic-name", name ); ++ vips_snprintf(name, 256, "mosaic-temp-%d", serial); ++ vips_image_set_string(image, "mosaic-name", name); + } +- +diff --git a/libvips/mosaicing/lrmosaic.c b/libvips/mosaicing/lrmosaic.c +index abec4acf98..8349e03ef3 100644 +--- a/libvips/mosaicing/lrmosaic.c ++++ b/libvips/mosaicing/lrmosaic.c +@@ -31,28 +31,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -75,14 +75,14 @@ + + #ifdef DEBUG + static void +-vips__print_mdebug( TiePoints *points ) ++vips__print_mdebug(TiePoints *points) + { + int i; + double adx = 0.0; + double ady = 0.0; + double acor = 0.0; + +- for( i = 0; i < points->nopoints; i++ ) { ++ for (i = 0; i < points->nopoints; i++) { + adx += points->dx[i]; + ady += points->dy[i]; + acor += points->correlation[i]; +@@ -91,23 +91,23 @@ vips__print_mdebug( TiePoints *points ) + ady = ady / (double) points->nopoints; + acor = acor / (double) points->nopoints; + +- printf( "points: %d\n", points->nopoints ); +- printf( "average dx, dy: %g %g\n", adx, ady ); +- printf( "average correlation: %g\n", acor ); +- printf( "deltax, deltay: %g %g\n", points->l_deltax, points->l_deltay ); ++ printf("points: %d\n", points->nopoints); ++ printf("average dx, dy: %g %g\n", adx, ady); ++ printf("average correlation: %g\n", acor); ++ printf("deltax, deltay: %g %g\n", points->l_deltax, points->l_deltay); + } + #endif /*DEBUG*/ + +-int +-vips__find_lroverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, +- int bandno_in, +- int xref, int yref, int xsec, int ysec, ++int ++vips__find_lroverlap(VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, ++ int bandno_in, ++ int xref, int yref, int xsec, int ysec, + int halfcorrelation, int halfarea, + int *dx0, int *dy0, +- double *scale1, double *angle1, double *dx1, double *dy1 ) ++ double *scale1, double *angle1, double *dx1, double *dy1) + { + VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 6 ); ++ vips_object_local_array(VIPS_OBJECT(out), 6); + + VipsRect left, right, overlap; + TiePoints points, *p_points; +@@ -117,10 +117,10 @@ vips__find_lroverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, + + /* Test cor and area. + */ +- if( halfcorrelation < 0 || halfarea < 0 || +- halfarea < halfcorrelation ) { +- vips_error( "vips__lrmosaic", "%s", _( "bad area parameters" ) ); +- return( -1 ); ++ if (halfcorrelation < 0 || halfarea < 0 || ++ halfarea < halfcorrelation) { ++ vips_error("vips__lrmosaic", "%s", _("bad area parameters")); ++ return (-1); + } + + /* Set positions of left and right. +@@ -136,43 +136,43 @@ vips__find_lroverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, + + /* Find overlap. + */ +- vips_rect_intersectrect( &left, &right, &overlap ); +- if( overlap.width < 2 * halfarea + 1 || +- overlap.height < 2 * halfarea + 1 ) { +- vips_error( "vips__lrmosaic", +- "%s", _( "overlap too small for search" ) ); +- return( -1 ); ++ vips_rect_intersectrect(&left, &right, &overlap); ++ if (overlap.width < 2 * halfarea + 1 || ++ overlap.height < 2 * halfarea + 1) { ++ vips_error("vips__lrmosaic", ++ "%s", _("overlap too small for search")); ++ return (-1); + } + + /* Extract overlaps as 8-bit, 1 band. + */ +- if( vips_extract_area( ref_in, &t[0], +- overlap.left, overlap.top, +- overlap.width, overlap.height, NULL ) || +- vips_extract_area( sec_in, &t[1], +- overlap.left - right.left, overlap.top - right.top, +- overlap.width, overlap.height, NULL ) ) +- return( -1 ); +- if( ref_in->Coding == VIPS_CODING_LABQ ) { +- if( vips_LabQ2sRGB( t[0], &t[2], NULL ) || +- vips_LabQ2sRGB( t[1], &t[3], NULL ) || +- vips_extract_band( t[2], &t[4], 1, NULL ) || +- vips_extract_band( t[3], &t[5], 1, NULL ) ) +- return( -1 ); ++ if (vips_extract_area(ref_in, &t[0], ++ overlap.left, overlap.top, ++ overlap.width, overlap.height, NULL) || ++ vips_extract_area(sec_in, &t[1], ++ overlap.left - right.left, overlap.top - right.top, ++ overlap.width, overlap.height, NULL)) ++ return (-1); ++ if (ref_in->Coding == VIPS_CODING_LABQ) { ++ if (vips_LabQ2sRGB(t[0], &t[2], NULL) || ++ vips_LabQ2sRGB(t[1], &t[3], NULL) || ++ vips_extract_band(t[2], &t[4], 1, NULL) || ++ vips_extract_band(t[3], &t[5], 1, NULL)) ++ return (-1); + } +- else if( ref_in->Coding == VIPS_CODING_NONE ) { +- if( vips_extract_band( t[0], &t[2], bandno_in, NULL ) || +- vips_extract_band( t[1], &t[3], bandno_in, NULL ) || +- vips_scale( t[2], &t[4], NULL ) || +- vips_scale( t[3], &t[5], NULL ) ) +- return( -1 ); ++ else if (ref_in->Coding == VIPS_CODING_NONE) { ++ if (vips_extract_band(t[0], &t[2], bandno_in, NULL) || ++ vips_extract_band(t[1], &t[3], bandno_in, NULL) || ++ vips_scale(t[2], &t[4], NULL) || ++ vips_scale(t[3], &t[5], NULL)) ++ return (-1); + } + else { +- vips_error( "vips__lrmosaic", "%s", _( "unknown Coding type" ) ); +- return( -1 ); ++ vips_error("vips__lrmosaic", "%s", _("unknown Coding type")); ++ return (-1); + } + +- /* Initialise and fill TiePoints ++ /* Initialise and fill TiePoints + */ + p_points = &points; + p_newpoints = &newpoints; +@@ -181,12 +181,12 @@ vips__find_lroverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, + p_points->nopoints = VIPS_MAXPOINTS; + p_points->deltax = 0; + p_points->deltay = 0; +- p_points->halfcorsize = halfcorrelation; ++ p_points->halfcorsize = halfcorrelation; + p_points->halfareasize = halfarea; + +- /* Initialise the structure ++ /* Initialise the structure + */ +- for( i = 0; i < VIPS_MAXPOINTS; i++ ) { ++ for (i = 0; i < VIPS_MAXPOINTS; i++) { + p_points->x_reference[i] = 0; + p_points->y_reference[i] = 0; + p_points->x_secondary[i] = 0; +@@ -198,33 +198,33 @@ vips__find_lroverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, + p_points->deviation[i] = 0.0; + } + +- /* Search ref for possible tie-points. Sets: p_points->contrast, ++ /* Search ref for possible tie-points. Sets: p_points->contrast, + * p_points->x,y_reference. +- */ +- if( vips__lrcalcon( t[4], p_points ) ) +- return( -1 ); ++ */ ++ if (vips__lrcalcon(t[4], p_points)) ++ return (-1); + + /* For each candidate point, correlate against corresponding part of + * sec. Sets x,y_secondary and fills correlation and dx, dy. +- */ +- if( vips__chkpair( t[4], t[5], p_points ) ) +- return( -1 ); ++ */ ++ if (vips__chkpair(t[4], t[5], p_points)) ++ return (-1); + + /* First call to vips_clinear(). + */ +- if( vips__initialize( p_points ) ) +- return( -1 ); ++ if (vips__initialize(p_points)) ++ return (-1); + +- /* Improve the selection of tiepoints until all abs(deviations) are ++ /* Improve the selection of tiepoints until all abs(deviations) are + * < 1.0 by deleting all wrong points. +- */ +- if( vips__improve( p_points, p_newpoints ) ) +- return( -1 ); ++ */ ++ if (vips__improve(p_points, p_newpoints)) ++ return (-1); + + /* Average remaining offsets. + */ +- if( vips__avgdxdy( p_newpoints, &dx, &dy ) ) +- return( -1 ); ++ if (vips__avgdxdy(p_newpoints, &dx, &dy)) ++ return (-1); + + /* Offset with overlap position. + */ +@@ -238,15 +238,15 @@ vips__find_lroverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, + *dx1 = newpoints.l_deltax; + *dy1 = newpoints.l_deltay; + +- return( 0 ); ++ return (0); + } + +-int +-vips__lrmosaic( VipsImage *ref, VipsImage *sec, VipsImage *out, +- int bandno, +- int xref, int yref, int xsec, int ysec, ++int ++vips__lrmosaic(VipsImage *ref, VipsImage *sec, VipsImage *out, ++ int bandno, ++ int xref, int yref, int xsec, int ysec, + int hwindowsize, int hsearchsize, +- int mwidth ) ++ int mwidth) + { + int dx0, dy0; + double scale1, angle1, dx1, dy1; +@@ -257,28 +257,28 @@ vips__lrmosaic( VipsImage *ref, VipsImage *sec, VipsImage *out, + * memory used by the analysis phase is freed as soon as possible. + */ + dummy = vips_image_new(); +- if( vips__find_lroverlap( ref, sec, dummy, +- bandno, +- xref, yref, xsec, ysec, +- hwindowsize, hsearchsize, +- &dx0, &dy0, +- &scale1, &angle1, &dx1, &dy1 ) ) { +- g_object_unref( dummy ); +- return( -1 ); ++ if (vips__find_lroverlap(ref, sec, dummy, ++ bandno, ++ xref, yref, xsec, ysec, ++ hwindowsize, hsearchsize, ++ &dx0, &dy0, ++ &scale1, &angle1, &dx1, &dy1)) { ++ g_object_unref(dummy); ++ return (-1); + } +- g_object_unref( dummy ); ++ g_object_unref(dummy); + + /* Merge left right. + */ +- if( vips_merge( ref, sec, &x, VIPS_DIRECTION_HORIZONTAL, dx0, dy0, +- "mblend", mwidth, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_merge(ref, sec, &x, VIPS_DIRECTION_HORIZONTAL, dx0, dy0, ++ "mblend", mwidth, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } +diff --git a/libvips/mosaicing/match.c b/libvips/mosaicing/match.c +index 8bc6538f28..5544e2f640 100644 +--- a/libvips/mosaicing/match.c ++++ b/libvips/mosaicing/match.c +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -44,42 +44,42 @@ + /* Given a pair of points, return scale, angle, dx, dy to resample the 2nd + * image with. + */ +-int +-vips__coeff( int xr1, int yr1, int xs1, int ys1, +- int xr2, int yr2, int xs2, int ys2, +- double *a, double *b, double *dx, double *dy ) ++int ++vips__coeff(int xr1, int yr1, int xs1, int ys1, ++ int xr2, int yr2, int xs2, int ys2, ++ double *a, double *b, double *dx, double *dy) + { +- VipsImage **t = VIPS_ARRAY( NULL, 2, VipsImage * ); +- +- if( !(t[0] = vips_image_new_matrixv( 4, 4, +- (double)xs1, (double)-ys1, 1.0, 0.0, +- (double)ys1, (double)xs1, 0.0, 1.0, +- (double)xs2, (double)-ys2, 1.0, 0.0, +- (double)ys2, (double)xs2, 0.0, 1.0 )) ) { +- g_free( t ); +- return( -1 ); ++ VipsImage **t = VIPS_ARRAY(NULL, 2, VipsImage *); ++ ++ if (!(t[0] = vips_image_new_matrixv(4, 4, ++ (double) xs1, (double) -ys1, 1.0, 0.0, ++ (double) ys1, (double) xs1, 0.0, 1.0, ++ (double) xs2, (double) -ys2, 1.0, 0.0, ++ (double) ys2, (double) xs2, 0.0, 1.0))) { ++ g_free(t); ++ return (-1); + } + +- if( vips_matrixinvert( t[0], &t[1], NULL ) ) { +- g_object_unref( t[0] ); +- g_free( t ); +- return( -1 ); ++ if (vips_matrixinvert(t[0], &t[1], NULL)) { ++ g_object_unref(t[0]); ++ g_free(t); ++ return (-1); + } + +- *a = *VIPS_MATRIX( t[1], 0, 0 ) * xr1 + *VIPS_MATRIX( t[1], 1, 0 ) * yr1 + +- *VIPS_MATRIX( t[1], 2, 0 ) * xr2 + *VIPS_MATRIX( t[1], 3, 0 ) * yr2; +- *b = *VIPS_MATRIX( t[1], 0, 1 ) * xr1 + *VIPS_MATRIX( t[1], 1, 1 ) * yr1 + +- *VIPS_MATRIX( t[1], 2, 1 ) * xr2 + *VIPS_MATRIX( t[1], 3, 1 ) * yr2; +- *dx = *VIPS_MATRIX( t[1], 0, 2 ) * xr1 + *VIPS_MATRIX( t[1], 1, 2 ) * yr1 + +- *VIPS_MATRIX( t[1], 2, 2 ) * xr2 + *VIPS_MATRIX( t[1], 3, 2 ) * yr2; +- *dy = *VIPS_MATRIX( t[1], 0, 3 ) * xr1 + *VIPS_MATRIX( t[1], 1, 3 ) * yr1 + +- *VIPS_MATRIX( t[1], 2, 3 ) * xr2 + *VIPS_MATRIX( t[1], 3, 3 ) * yr2; ++ *a = *VIPS_MATRIX(t[1], 0, 0) * xr1 + *VIPS_MATRIX(t[1], 1, 0) * yr1 + ++ *VIPS_MATRIX(t[1], 2, 0) * xr2 + *VIPS_MATRIX(t[1], 3, 0) * yr2; ++ *b = *VIPS_MATRIX(t[1], 0, 1) * xr1 + *VIPS_MATRIX(t[1], 1, 1) * yr1 + ++ *VIPS_MATRIX(t[1], 2, 1) * xr2 + *VIPS_MATRIX(t[1], 3, 1) * yr2; ++ *dx = *VIPS_MATRIX(t[1], 0, 2) * xr1 + *VIPS_MATRIX(t[1], 1, 2) * yr1 + ++ *VIPS_MATRIX(t[1], 2, 2) * xr2 + *VIPS_MATRIX(t[1], 3, 2) * yr2; ++ *dy = *VIPS_MATRIX(t[1], 0, 3) * xr1 + *VIPS_MATRIX(t[1], 1, 3) * yr1 + ++ *VIPS_MATRIX(t[1], 2, 3) * xr2 + *VIPS_MATRIX(t[1], 3, 3) * yr2; + +- g_object_unref( t[0] ); +- g_object_unref( t[1] ); +- g_free( t ); ++ g_object_unref(t[0]); ++ g_object_unref(t[1]); ++ g_free(t); + +- return( 0 ); ++ return (0); + } + + typedef struct { +@@ -105,10 +105,10 @@ typedef struct { + + typedef VipsOperationClass VipsMatchClass; + +-G_DEFINE_TYPE( VipsMatch, vips_match, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsMatch, vips_match, VIPS_TYPE_OPERATION); + + static int +-vips_match_build( VipsObject *object ) ++vips_match_build(VipsObject *object) + { + VipsMatch *match = (VipsMatch *) object; + +@@ -116,31 +116,31 @@ vips_match_build( VipsObject *object ) + VipsArrayInt *oarea; + VipsImage *x; + +- g_object_set( match, "out", vips_image_new(), NULL ); ++ g_object_set(match, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_match_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_match_parent_class)->build(object)) ++ return (-1); + +- if( !match->interpolate ) +- match->interpolate = vips_interpolate_new( "bilinear" ); ++ if (!match->interpolate) ++ match->interpolate = vips_interpolate_new("bilinear"); + +- if( match->search ) { ++ if (match->search) { + int xs, ys; + double cor; + +- if( vips__correl( match->ref, match->sec, +- match->xr1, match->yr1, match->xs1, match->ys1, +- match->hwindow, match->harea, +- &cor, &xs, &ys ) ) +- return( -1 ); ++ if (vips__correl(match->ref, match->sec, ++ match->xr1, match->yr1, match->xs1, match->ys1, ++ match->hwindow, match->harea, ++ &cor, &xs, &ys)) ++ return (-1); + match->xs1 = xs; + match->ys1 = ys; + +- if( vips__correl( match->ref, match->sec, +- match->xr2, match->yr2, match->xs2, match->ys2, +- match->hwindow, match->harea, +- &cor, &xs, &ys ) ) +- return( -1 ); ++ if (vips__correl(match->ref, match->sec, ++ match->xr2, match->yr2, match->xs2, match->ys2, ++ match->hwindow, match->harea, ++ &cor, &xs, &ys)) ++ return (-1); + + match->xs2 = xs; + match->ys2 = ys; +@@ -148,155 +148,154 @@ vips_match_build( VipsObject *object ) + + /* Solve to get scale + rot + disp to obtain match. + */ +- if( vips__coeff( match->xr1, match->yr1, match->xs1, match->ys1, +- match->xr2, match->yr2, match->xs2, match->ys2, +- &a, &b, &dx, &dy ) ) +- return( -1 ); ++ if (vips__coeff(match->xr1, match->yr1, match->xs1, match->ys1, ++ match->xr2, match->yr2, match->xs2, match->ys2, ++ &a, &b, &dx, &dy)) ++ return (-1); + + /* Output area of ref image. + */ +- oarea = vips_array_int_newv( 4, +- 0, 0, match->ref->Xsize, match->ref->Ysize ); +- +- if( vips_affine( match->sec, &x, +- a, -b, b, a, +- "interpolate", match->interpolate, +- "odx", dx, +- "ody", dy, +- "oarea", oarea, +- NULL ) ) { +- vips_area_unref( VIPS_AREA( oarea ) ); +- return( -1 ); ++ oarea = vips_array_int_newv(4, ++ 0, 0, match->ref->Xsize, match->ref->Ysize); ++ ++ if (vips_affine(match->sec, &x, ++ a, -b, b, a, ++ "interpolate", match->interpolate, ++ "odx", dx, ++ "ody", dy, ++ "oarea", oarea, ++ NULL)) { ++ vips_area_unref(VIPS_AREA(oarea)); ++ return (-1); + } +- vips_area_unref( VIPS_AREA( oarea ) ); ++ vips_area_unref(VIPS_AREA(oarea)); + +- if( vips_image_write( x, match->out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_image_write(x, match->out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + static void +-vips_match_class_init( VipsMatchClass *class ) ++vips_match_class_init(VipsMatchClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "match"; +- object_class->description = _( "first-order match of two images" ); ++ object_class->description = _("first-order match of two images"); + object_class->build = vips_match_build; + +- VIPS_ARG_IMAGE( class, "ref", 1, +- _( "Reference" ), +- _( "Reference image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMatch, ref ) ); +- +- VIPS_ARG_IMAGE( class, "sec", 2, +- _( "Secondary" ), +- _( "Secondary image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMatch, sec ) ); +- +- VIPS_ARG_IMAGE( class, "out", 3, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsMatch, out ) ); +- +- VIPS_ARG_INT( class, "xr1", 5, +- _( "xr1" ), +- _( "Position of first reference tie-point" ), ++ VIPS_ARG_IMAGE(class, "ref", 1, ++ _("Reference"), ++ _("Reference image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsMatch, ref)); ++ ++ VIPS_ARG_IMAGE(class, "sec", 2, ++ _("Secondary"), ++ _("Secondary image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMatch, xr1 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMatch, sec)); ++ ++ VIPS_ARG_IMAGE(class, "out", 3, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsMatch, out)); + +- VIPS_ARG_INT( class, "yr1", 6, +- _( "yr1" ), +- _( "Position of first reference tie-point" ), ++ VIPS_ARG_INT(class, "xr1", 5, ++ _("xr1"), ++ _("Position of first reference tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMatch, yr1 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMatch, xr1), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "xs1", 7, +- _( "xs1" ), +- _( "Position of first secondary tie-point" ), ++ VIPS_ARG_INT(class, "yr1", 6, ++ _("yr1"), ++ _("Position of first reference tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMatch, xs1 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMatch, yr1), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "ys1", 8, +- _( "ys1" ), +- _( "Position of first secondary tie-point" ), ++ VIPS_ARG_INT(class, "xs1", 7, ++ _("xs1"), ++ _("Position of first secondary tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMatch, ys1 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMatch, xs1), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "xr2", 9, +- _( "xr2" ), +- _( "Position of second reference tie-point" ), ++ VIPS_ARG_INT(class, "ys1", 8, ++ _("ys1"), ++ _("Position of first secondary tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMatch, xr2 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMatch, ys1), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "yr2", 10, +- _( "yr2" ), +- _( "Position of second reference tie-point" ), ++ VIPS_ARG_INT(class, "xr2", 9, ++ _("xr2"), ++ _("Position of second reference tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMatch, yr2 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMatch, xr2), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "xs2", 11, +- _( "xs2" ), +- _( "Position of second secondary tie-point" ), ++ VIPS_ARG_INT(class, "yr2", 10, ++ _("yr2"), ++ _("Position of second reference tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMatch, xs2 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMatch, yr2), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "ys2", 12, +- _( "ys2" ), +- _( "Position of second secondary tie-point" ), ++ VIPS_ARG_INT(class, "xs2", 11, ++ _("xs2"), ++ _("Position of second secondary tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMatch, ys2 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMatch, xs2), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "hwindow", 13, +- _( "hwindow" ), +- _( "Half window size" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMatch, hwindow ), +- 0, 1000000000, 1 ); ++ VIPS_ARG_INT(class, "ys2", 12, ++ _("ys2"), ++ _("Position of second secondary tie-point"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsMatch, ys2), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "harea", 14, +- _( "harea" ), +- _( "Half area size" ), ++ VIPS_ARG_INT(class, "hwindow", 13, ++ _("hwindow"), ++ _("Half window size"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMatch, harea ), +- 0, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMatch, hwindow), ++ 0, 1000000000, 1); + +- VIPS_ARG_BOOL( class, "search", 15, +- _( "Search" ), +- _( "Search to improve tie-points" ), ++ VIPS_ARG_INT(class, "harea", 14, ++ _("harea"), ++ _("Half area size"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMatch, search ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsMatch, harea), ++ 0, 1000000000, 1); + +- VIPS_ARG_INTERPOLATE( class, "interpolate", 16, +- _( "Interpolate" ), +- _( "Interpolate pixels with this" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMatch, interpolate ) ); ++ VIPS_ARG_BOOL(class, "search", 15, ++ _("Search"), ++ _("Search to improve tie-points"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsMatch, search), ++ FALSE); + ++ VIPS_ARG_INTERPOLATE(class, "interpolate", 16, ++ _("Interpolate"), ++ _("Interpolate pixels with this"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsMatch, interpolate)); + } + + static void +-vips_match_init( VipsMatch *match ) ++vips_match_init(VipsMatch *match) + { + match->hwindow = 5; + match->harea = 15; +@@ -317,36 +316,36 @@ vips_match_init( VipsMatch *match ) + * @xs2: second secondary tie-point + * @ys2: second secondary tie-point + * @...: %NULL-terminated list of optional named arguments +- * ++ * + * Optional arguments: + * + * * @search: search to improve tie-points + * * @hwindow: half window size +- * * @harea: half search size ++ * * @harea: half search size + * * @interpolate: interpolate pixels with this + * + * Scale, rotate and translate @sec so that the tie-points line up. + * +- * If @search is %TRUE, before performing the transformation, the tie-points ++ * If @search is %TRUE, before performing the transformation, the tie-points + * are improved by searching an area of @sec of size @harea for a +- * match of size @hwindow to @ref. ++ * match of size @hwindow to @ref. + * + * This function will only work well for small rotates and scales. + * + * Returns: 0 on success, -1 on error + */ + int +-vips_match( VipsImage *ref, VipsImage *sec, VipsImage **out, +- int xr1, int yr1, int xs1, int ys1, +- int xr2, int yr2, int xs2, int ys2, ... ) ++vips_match(VipsImage *ref, VipsImage *sec, VipsImage **out, ++ int xr1, int yr1, int xs1, int ys1, ++ int xr2, int yr2, int xs2, int ys2, ...) + { + va_list ap; + int result; + +- va_start( ap, ys2 ); +- result = vips_call_split( "match", ap, ref, sec, out, +- xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2 ); +- va_end( ap ); ++ va_start(ap, ys2); ++ result = vips_call_split("match", ap, ref, sec, out, ++ xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/mosaicing/matrixinvert.c b/libvips/mosaicing/matrixinvert.c +index 7e3cc1618c..997365fbe3 100644 +--- a/libvips/mosaicing/matrixinvert.c ++++ b/libvips/mosaicing/matrixinvert.c +@@ -1,33 +1,33 @@ + /* solve and invert matrices +- * ++ * + * 19/4/20 kleisauke + * - from im_matinv + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -66,26 +66,26 @@ typedef struct _VipsMatrixinvert { + + typedef VipsOperationClass VipsMatrixinvertClass; + +-G_DEFINE_TYPE( VipsMatrixinvert, vips_matrixinvert, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsMatrixinvert, vips_matrixinvert, VIPS_TYPE_OPERATION); + + static void +-vips_matrixinvert_dispose( GObject *gobject ) ++vips_matrixinvert_dispose(GObject *gobject) + { + VipsMatrixinvert *matrix = (VipsMatrixinvert *) gobject; + +- VIPS_UNREF( matrix->mat ); +- VIPS_UNREF( matrix->lu ); ++ VIPS_UNREF(matrix->mat); ++ VIPS_UNREF(matrix->lu); + +- G_OBJECT_CLASS( vips_matrixinvert_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_matrixinvert_parent_class)->dispose(gobject); + } + +-/* DBL_MIN is smallest *normalized* double precision float ++/* DBL_MIN is smallest *normalized* double precision float + */ + #define TOO_SMALL (2.0 * DBL_MIN) + + /* Save a bit of typing. + */ +-#define ME( m, i, j ) (*VIPS_MATRIX( (m), (i), (j) )) ++#define ME(m, i, j) (*VIPS_MATRIX((m), (i), (j))) + + /** + * lu_decomp: +@@ -96,64 +96,64 @@ vips_matrixinvert_dispose( GObject *gobject ) + * + * It calculates the PLU decomposition, storing the upper and diagonal parts + * of U, together with the lower parts of L, as an NxN matrix in the first +- * N rows of the new matrix. The diagonal parts of L are all set to unity +- * and are not stored. ++ * N rows of the new matrix. The diagonal parts of L are all set to unity ++ * and are not stored. + * +- * The final row of the new #VipsImage has only integer entries, which ++ * The final row of the new #VipsImage has only integer entries, which + * represent the row-wise permutations made by the permutation matrix P. + * + * The scale and offset members of the input #VipsImage are ignored. + * + * See: + * +- * PRESS, W. et al, 1992. Numerical Recipies in C; The Art of Scientific ++ * PRESS, W. et al, 1992. Numerical Recipies in C; The Art of Scientific + * Computing, 2nd ed. Cambridge: Cambridge University Press, pp. 43-50. + * + * Returns: the decomposed matrix on success, or NULL on error. + */ + static VipsImage * +-lu_decomp( VipsImage *mat ) ++lu_decomp(VipsImage *mat) + { + int i, j, k; + double *row_scale; + VipsImage *lu; +- +- if ( !(row_scale = VIPS_ARRAY( NULL, mat->Xsize, double )) ) { +- return( NULL ); ++ ++ if (!(row_scale = VIPS_ARRAY(NULL, mat->Xsize, double))) { ++ return (NULL); + } + +- if( !(lu = vips_image_new_matrix( mat->Xsize, mat->Xsize + 1 )) ) { +- g_free( row_scale ); +- return( NULL ); ++ if (!(lu = vips_image_new_matrix(mat->Xsize, mat->Xsize + 1))) { ++ g_free(row_scale); ++ return (NULL); + } + + /* copy all coefficients and then perform decomposition in-place */ +- memcpy( VIPS_MATRIX( lu, 0, 0), VIPS_MATRIX( mat, 0, 0), +- mat->Xsize * mat->Xsize * sizeof( double ) ); ++ memcpy(VIPS_MATRIX(lu, 0, 0), VIPS_MATRIX(mat, 0, 0), ++ mat->Xsize * mat->Xsize * sizeof(double)); + +- for( i = 0; i < mat->Xsize; ++i ) { ++ for (i = 0; i < mat->Xsize; ++i) { + row_scale[i] = 0.0; + +- for( j = 0; j < mat->Xsize; ++j ) { +- double abs_val = fabs( ME( lu, i, j ) ); ++ for (j = 0; j < mat->Xsize; ++j) { ++ double abs_val = fabs(ME(lu, i, j)); + + /* find largest in each ROW */ +- if( abs_val > row_scale[i] ) ++ if (abs_val > row_scale[i]) + row_scale[i] = abs_val; + } + +- if( !row_scale[i] ) { +- vips_error( "matrixinvert", "singular matrix" ); +- g_object_unref( lu ); +- g_free( row_scale ); +- return( NULL ); ++ if (!row_scale[i]) { ++ vips_error("matrixinvert", "singular matrix"); ++ g_object_unref(lu); ++ g_free(row_scale); ++ return (NULL); + } + + /* fill array with scaling factors for each ROW */ + row_scale[i] = 1.0 / row_scale[i]; + } + +- for( j = 0; j < mat->Xsize; ++j ) { /* loop over COLs */ ++ for (j = 0; j < mat->Xsize; ++j) { /* loop over COLs */ + double max = -1.0; + int i_of_max; + +@@ -161,41 +161,41 @@ lu_decomp( VipsImage *mat ) + i_of_max = 0; + + /* loop over ROWS in upper-half, except diagonal */ +- for( i = 0; i < j; ++i ) +- for( k = 0; k < i; ++k ) +- ME( lu, i, j ) -= ME( lu, i, k ) * ME( lu, k, j ); ++ for (i = 0; i < j; ++i) ++ for (k = 0; k < i; ++k) ++ ME(lu, i, j) -= ME(lu, i, k) * ME(lu, k, j); + + /* loop over ROWS in diagonal and lower-half */ +- for( i = j; i < mat->Xsize; ++i ) { ++ for (i = j; i < mat->Xsize; ++i) { + double abs_val; + +- for( k = 0; k < j; ++k ) +- ME( lu, i, j ) -= ME( lu, i, k ) * ME( lu, k, j ); ++ for (k = 0; k < j; ++k) ++ ME(lu, i, j) -= ME(lu, i, k) * ME(lu, k, j); + + /* find largest element in each COLUMN scaled so that */ + /* largest in each ROW is 1.0 */ +- abs_val = row_scale[i] * fabs( ME( lu, i, j ) ); ++ abs_val = row_scale[i] * fabs(ME(lu, i, j)); + +- if( abs_val > max ) { ++ if (abs_val > max) { + max = abs_val; + i_of_max = i; + } + } + +- if( fabs( ME( lu, i_of_max, j ) ) < TOO_SMALL ) { ++ if (fabs(ME(lu, i_of_max, j)) < TOO_SMALL) { + /* divisor is near zero */ +- vips_error( "matrixinvert", "singular or near-singular matrix" ); +- g_object_unref( lu ); +- g_free( row_scale ); +- return( NULL ); ++ vips_error("matrixinvert", "singular or near-singular matrix"); ++ g_object_unref(lu); ++ g_free(row_scale); ++ return (NULL); + } + +- if( i_of_max != j ) { ++ if (i_of_max != j) { + /* swap ROWS */ +- for( k = 0; k < mat->Xsize; ++k ) { +- double temp = ME( lu, j, k ); +- ME( lu, j, k ) = ME( lu, i_of_max, k ); +- ME( lu, i_of_max, k ) = temp; ++ for (k = 0; k < mat->Xsize; ++k) { ++ double temp = ME(lu, j, k); ++ ME(lu, j, k) = ME(lu, i_of_max, k); ++ ME(lu, i_of_max, k) = temp; + } + + row_scale[i_of_max] = row_scale[j]; +@@ -203,15 +203,15 @@ lu_decomp( VipsImage *mat ) + } + + /* record permutation */ +- ME( lu, j, mat->Xsize ) = i_of_max; ++ ME(lu, j, mat->Xsize) = i_of_max; + + /* divide by best (largest scaled) pivot found */ +- for( i = j + 1; i < mat->Xsize; ++i ) +- ME( lu, i, j ) /= ME( lu, j, j ); ++ for (i = j + 1; i < mat->Xsize; ++i) ++ ME(lu, i, j) /= ME(lu, j, j); + } +- g_free( row_scale ); ++ g_free(row_scale); + +- return( lu ); ++ return (lu); + } + + /** +@@ -225,7 +225,7 @@ lu_decomp( VipsImage *mat ) + * + * See: + * +- * PRESS, W. et al, 1992. Numerical Recipies in C; The Art of Scientific ++ * PRESS, W. et al, 1992. Numerical Recipies in C; The Art of Scientific + * Computing, 2nd ed. Cambridge: Cambridge University Press, pp. 43-50. + * + * See also: vips__matrixtranspose(), vips__matrixmultiply(). +@@ -233,235 +233,215 @@ lu_decomp( VipsImage *mat ) + * Returns: 0 on success, -1 on error + */ + static int +-lu_solve( VipsImage *lu, double *vec ) ++lu_solve(VipsImage *lu, double *vec) + { + int i, j; + +- if( lu->Xsize + 1 != lu->Ysize ) { +- vips_error( "matrixinvert", "not an LU decomposed matrix" ); +- return( -1 ); ++ if (lu->Xsize + 1 != lu->Ysize) { ++ vips_error("matrixinvert", "not an LU decomposed matrix"); ++ return (-1); + } + +- for( i = 0; i < lu->Xsize; ++i ) { +- int i_perm = ME( lu, i, lu->Xsize ); ++ for (i = 0; i < lu->Xsize; ++i) { ++ int i_perm = ME(lu, i, lu->Xsize); + +- if( i_perm != i ) { ++ if (i_perm != i) { + double temp = vec[i]; + vec[i] = vec[i_perm]; + vec[i_perm] = temp; + } +- for( j = 0; j < i; ++j ) +- vec[i] -= ME( lu, i, j ) * vec[j]; ++ for (j = 0; j < i; ++j) ++ vec[i] -= ME(lu, i, j) * vec[j]; + } + +- for( i = lu->Xsize - 1; i >= 0; --i ) { ++ for (i = lu->Xsize - 1; i >= 0; --i) { + +- for( j = i + 1; j < lu->Xsize; ++j ) +- vec[i] -= ME( lu, i, j ) * vec[j]; ++ for (j = i + 1; j < lu->Xsize; ++j) ++ vec[i] -= ME(lu, i, j) * vec[j]; + +- vec[i] /= ME( lu, i, i ); ++ vec[i] /= ME(lu, i, i); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_matrixinvert_solve( VipsMatrixinvert *matrix ) ++vips_matrixinvert_solve(VipsMatrixinvert *matrix) + { + VipsImage *out = matrix->out; + + int i, j; + double *vec; + +- if( !(matrix->lu = lu_decomp( matrix->mat ) ) ) +- return( -1 ); ++ if (!(matrix->lu = lu_decomp(matrix->mat))) ++ return (-1); + +- if( !(vec = VIPS_ARRAY( matrix, matrix->lu->Xsize, double )) ) +- return( -1 ); ++ if (!(vec = VIPS_ARRAY(matrix, matrix->lu->Xsize, double))) ++ return (-1); + +- for( j = 0; j < matrix->lu->Xsize; ++j ) { +- for( i = 0; i < matrix->lu->Xsize; ++i ) ++ for (j = 0; j < matrix->lu->Xsize; ++j) { ++ for (i = 0; i < matrix->lu->Xsize; ++i) + vec[i] = 0.0; + + vec[j] = 1.0; + +- if( lu_solve( matrix->lu, vec ) ) +- return( -1 ); ++ if (lu_solve(matrix->lu, vec)) ++ return (-1); + +- for( i = 0; i < matrix->lu->Xsize; ++i ) +- ME( out, i, j ) = vec[i]; ++ for (i = 0; i < matrix->lu->Xsize; ++i) ++ ME(out, i, j) = vec[i]; + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_matrixinvert_direct( VipsMatrixinvert *matrix ) ++vips_matrixinvert_direct(VipsMatrixinvert *matrix) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( matrix ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(matrix); + VipsImage *in = matrix->mat; + VipsImage *out = matrix->out; + +- switch( matrix->mat->Xsize ) { +- case 1: +-{ +- double det = ME( in, 0, 0 ); ++ switch (matrix->mat->Xsize) { ++ case 1: { ++ double det = ME(in, 0, 0); + +- if( fabs( det ) < TOO_SMALL ) { ++ if (fabs(det) < TOO_SMALL) { + /* divisor is near zero */ +- vips_error( class->nickname, +- "%s", _( "singular or near-singular matrix" ) ); +- return( -1 ); ++ vips_error(class->nickname, ++ "%s", _("singular or near-singular matrix")); ++ return (-1); + } + +- ME( out, 0, 0 ) = 1.0 / det; +-} +- break; ++ ME(out, 0, 0) = 1.0 / det; ++ } break; + +- case 2: +-{ +- double det = ME( in, 0, 0 ) * ME( in, 1, 1 ) - +- ME( in, 0, 1 ) * ME( in, 1, 0 ); ++ case 2: { ++ double det = ME(in, 0, 0) * ME(in, 1, 1) - ++ ME(in, 0, 1) * ME(in, 1, 0); + + double tmp; + +- if( fabs( det ) < TOO_SMALL ) { ++ if (fabs(det) < TOO_SMALL) { + /* divisor is near zero */ +- vips_error( class->nickname, +- "%s", _( "singular or near-singular matrix" ) ); +- return( -1 ); ++ vips_error(class->nickname, ++ "%s", _("singular or near-singular matrix")); ++ return (-1); + } + + tmp = 1.0 / det; +- ME( out, 0, 0 ) = tmp * ME( in, 1, 1 ); +- ME( out, 0, 1 ) = -tmp * ME( in, 0, 1 ); +- ME( out, 1, 0 ) = -tmp * ME( in, 1, 0 ); +- ME( out, 1, 1 ) = tmp * ME( in, 0, 0 ); +-} +- break; ++ ME(out, 0, 0) = tmp * ME(in, 1, 1); ++ ME(out, 0, 1) = -tmp * ME(in, 0, 1); ++ ME(out, 1, 0) = -tmp * ME(in, 1, 0); ++ ME(out, 1, 1) = tmp * ME(in, 0, 0); ++ } break; + +- case 3: +-{ ++ case 3: { + double det; + double tmp; + +- det = ME( in, 0, 0 ) * ( ME( in, 1, 1 ) * +- ME( in, 2, 2 ) - ME( in, 1, 2 ) * ME( in, 2, 1 ) ); +- det -= ME( in, 0, 1 ) * ( ME( in, 1, 0 ) * +- ME( in, 2, 2 ) - ME( in, 1, 2 ) * ME( in, 2, 0) ); +- det += ME( in, 0, 2) * ( ME( in, 1, 0 ) * +- ME( in, 2, 1 ) - ME( in, 1, 1 ) * ME( in, 2, 0 ) ); ++ det = ME(in, 0, 0) * (ME(in, 1, 1) * ME(in, 2, 2) - ME(in, 1, 2) * ME(in, 2, 1)); ++ det -= ME(in, 0, 1) * (ME(in, 1, 0) * ME(in, 2, 2) - ME(in, 1, 2) * ME(in, 2, 0)); ++ det += ME(in, 0, 2) * (ME(in, 1, 0) * ME(in, 2, 1) - ME(in, 1, 1) * ME(in, 2, 0)); + +- if( fabs( det ) < TOO_SMALL ) { ++ if (fabs(det) < TOO_SMALL) { + /* divisor is near zero */ +- vips_error( class->nickname, +- "%s", _( "singular or near-singular matrix" ) ); +- return( -1 ); ++ vips_error(class->nickname, ++ "%s", _("singular or near-singular matrix")); ++ return (-1); + } + + tmp = 1.0 / det; + +- ME( out, 0, 0 ) = tmp * ( ME( in, 1, 1 ) * ME( in, 2, 2 ) - +- ME( in, 1, 2 ) * ME( in, 2, 1 ) ); +- ME( out, 1, 0 ) = tmp * ( ME( in, 1, 2 ) * ME( in, 2, 0 ) - +- ME( in, 1, 0 ) * ME( in, 2, 2 ) ); +- ME( out, 2, 0 ) = tmp * ( ME( in, 1, 0 ) * ME( in, 2, 1 ) - +- ME( in, 1, 1 ) * ME( in, 2, 0 ) ); +- +- ME( out, 0, 1 ) = tmp * ( ME( in, 0, 2 ) * ME( in, 2, 1 ) - +- ME( in, 0, 1 ) * ME( in, 2, 2 ) ); +- ME( out, 1, 1 ) = tmp * ( ME( in, 0, 0 ) * ME( in, 2, 2 ) - +- ME( in, 0, 2 ) * ME( in, 2, 0 ) ); +- ME( out, 2, 1 ) = tmp * ( ME( in, 0, 1 ) * ME( in, 2, 0 ) - +- ME( in, 0, 0 ) * ME( in, 2, 1 ) ); +- +- ME( out, 0, 2 ) = tmp * ( ME( in, 0, 1 ) * ME( in, 1, 2 ) - +- ME( in, 0, 2 ) * ME( in, 1, 1 ) ); +- ME( out, 1, 2 ) = tmp * ( ME( in, 0, 2 ) * ME( in, 1, 0 ) - +- ME( in, 0, 0 ) * ME( in, 1, 2 ) ); +- ME( out, 2, 2 ) = tmp * ( ME( in, 0, 0 ) * ME( in, 1, 1 ) - +- ME( in, 0, 1 ) * ME( in, 1, 0 ) ); +-} +- break; ++ ME(out, 0, 0) = tmp * (ME(in, 1, 1) * ME(in, 2, 2) - ME(in, 1, 2) * ME(in, 2, 1)); ++ ME(out, 1, 0) = tmp * (ME(in, 1, 2) * ME(in, 2, 0) - ME(in, 1, 0) * ME(in, 2, 2)); ++ ME(out, 2, 0) = tmp * (ME(in, 1, 0) * ME(in, 2, 1) - ME(in, 1, 1) * ME(in, 2, 0)); ++ ++ ME(out, 0, 1) = tmp * (ME(in, 0, 2) * ME(in, 2, 1) - ME(in, 0, 1) * ME(in, 2, 2)); ++ ME(out, 1, 1) = tmp * (ME(in, 0, 0) * ME(in, 2, 2) - ME(in, 0, 2) * ME(in, 2, 0)); ++ ME(out, 2, 1) = tmp * (ME(in, 0, 1) * ME(in, 2, 0) - ME(in, 0, 0) * ME(in, 2, 1)); ++ ++ ME(out, 0, 2) = tmp * (ME(in, 0, 1) * ME(in, 1, 2) - ME(in, 0, 2) * ME(in, 1, 1)); ++ ME(out, 1, 2) = tmp * (ME(in, 0, 2) * ME(in, 1, 0) - ME(in, 0, 0) * ME(in, 1, 2)); ++ ME(out, 2, 2) = tmp * (ME(in, 0, 0) * ME(in, 1, 1) - ME(in, 0, 1) * ME(in, 1, 0)); ++ } break; + + /* TODO(kleisauke): + * We sometimes use 4x4 matrices, could we also make a + * direct version for those? For e.g.: + * https://stackoverflow.com/a/1148405/10952119 */ + default: +- g_assert( 0 ); +- return( -1 ); ++ g_assert(0); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_matrixinvert_build( VipsObject *object ) ++vips_matrixinvert_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); + VipsMatrixinvert *matrix = (VipsMatrixinvert *) object; + +- if( VIPS_OBJECT_CLASS( vips_matrixinvert_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_matrixinvert_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_matrix( class->nickname, matrix->in, &matrix->mat ) ) +- return( -1 ); ++ if (vips_check_matrix(class->nickname, matrix->in, &matrix->mat)) ++ return (-1); + +- if( matrix->mat->Xsize != matrix->mat->Ysize ) { +- vips_error( class->nickname, "%s", _( "non-square matrix" ) ); +- return( -1 ); ++ if (matrix->mat->Xsize != matrix->mat->Ysize) { ++ vips_error(class->nickname, "%s", _("non-square matrix")); ++ return (-1); + } + +- g_object_set( matrix, +- "out", vips_image_new_matrix( matrix->mat->Xsize, +- matrix->mat->Ysize ), +- NULL ); ++ g_object_set(matrix, ++ "out", vips_image_new_matrix(matrix->mat->Xsize, matrix->mat->Ysize), ++ NULL); + +- /* Direct path for < 4x4 matrices ++ /* Direct path for < 4x4 matrices + */ +- if( matrix->mat->Xsize >= 4 ) { +- if( vips_matrixinvert_solve( matrix ) ) +- return( -1 ); ++ if (matrix->mat->Xsize >= 4) { ++ if (vips_matrixinvert_solve(matrix)) ++ return (-1); + } + else { +- if( vips_matrixinvert_direct( matrix ) ) +- return( -1 ); ++ if (vips_matrixinvert_direct(matrix)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_matrixinvert_class_init( VipsMatrixinvertClass *class ) ++vips_matrixinvert_class_init(VipsMatrixinvertClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->dispose = vips_matrixinvert_dispose; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "matrixinvert"; +- vobject_class->description = _( "invert an matrix" ); ++ vobject_class->description = _("invert an matrix"); + vobject_class->build = vips_matrixinvert_build; + +- VIPS_ARG_IMAGE( class, "in", 0, +- _( "Input" ), +- _( "An square matrix" ), ++ VIPS_ARG_IMAGE(class, "in", 0, ++ _("Input"), ++ _("An square matrix"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMatrixinvert, in ) ); ++ G_STRUCT_OFFSET(VipsMatrixinvert, in)); + +- VIPS_ARG_IMAGE( class, "out", 1, +- _( "Output" ), +- _( "Output matrix" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsMatrixinvert, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 1, ++ _("Output"), ++ _("Output matrix"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsMatrixinvert, out)); + } + + static void +-vips_matrixinvert_init( VipsMatrixinvert *matrix ) ++vips_matrixinvert_init(VipsMatrixinvert *matrix) + { + } + +@@ -479,14 +459,14 @@ vips_matrixinvert_init( VipsMatrixinvert *matrix ) + * Returns: 0 on success, -1 on error + */ + int +-vips_matrixinvert( VipsImage *m, VipsImage **out, ... ) ++vips_matrixinvert(VipsImage *m, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "matrixinvert", ap, m, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("matrixinvert", ap, m, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/mosaicing/merge.c b/libvips/mosaicing/merge.c +index 277d299279..4ee38a10aa 100644 +--- a/libvips/mosaicing/merge.c ++++ b/libvips/mosaicing/merge.c +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -58,115 +58,113 @@ typedef struct { + + typedef VipsOperationClass VipsMergeClass; + +-G_DEFINE_TYPE( VipsMerge, vips_merge, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsMerge, vips_merge, VIPS_TYPE_OPERATION); + + static int +-vips_merge_build( VipsObject *object ) ++vips_merge_build(VipsObject *object) + { + VipsMerge *merge = (VipsMerge *) object; + +- g_object_set( merge, "out", vips_image_new(), NULL ); ++ g_object_set(merge, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_merge_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_merge_parent_class)->build(object)) ++ return (-1); + +- switch( merge->direction ) { ++ switch (merge->direction) { + case VIPS_DIRECTION_HORIZONTAL: +- if( vips__lrmerge( merge->ref, merge->sec, merge->out, +- merge->dx, merge->dy, merge->mblend ) ) +- return( -1 ); ++ if (vips__lrmerge(merge->ref, merge->sec, merge->out, ++ merge->dx, merge->dy, merge->mblend)) ++ return (-1); + break; + + case VIPS_DIRECTION_VERTICAL: +- if( vips__tbmerge( merge->ref, merge->sec, merge->out, +- merge->dx, merge->dy, merge->mblend ) ) +- return( -1 ); ++ if (vips__tbmerge(merge->ref, merge->sec, merge->out, ++ merge->dx, merge->dy, merge->mblend)) ++ return (-1); + break; + + default: + g_assert_not_reached(); + } + +- vips__add_mosaic_name( merge->out ); +- if( vips_image_history_printf( merge->out, +- "#%s <%s> <%s> <%s> <%d> <%d> <%d>", +- merge->direction == VIPS_DIRECTION_HORIZONTAL ? +- "LRJOIN" : "TBJOIN", +- vips__get_mosaic_name( merge->ref ), +- vips__get_mosaic_name( merge->sec ), +- vips__get_mosaic_name( merge->out ), +- -merge->dx, -merge->dy, merge->mblend ) ) +- return( -1 ); +- +- return( 0 ); ++ vips__add_mosaic_name(merge->out); ++ if (vips_image_history_printf(merge->out, ++ "#%s <%s> <%s> <%s> <%d> <%d> <%d>", ++ merge->direction == VIPS_DIRECTION_HORIZONTAL ? "LRJOIN" : "TBJOIN", ++ vips__get_mosaic_name(merge->ref), ++ vips__get_mosaic_name(merge->sec), ++ vips__get_mosaic_name(merge->out), ++ -merge->dx, -merge->dy, merge->mblend)) ++ return (-1); ++ ++ return (0); + } + + static void +-vips_merge_class_init( VipsMergeClass *class ) ++vips_merge_class_init(VipsMergeClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "merge"; +- object_class->description = _( "merge two images" ); ++ object_class->description = _("merge two images"); + object_class->build = vips_merge_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_IMAGE( class, "ref", 1, +- _( "Reference" ), +- _( "Reference image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMerge, ref ) ); +- +- VIPS_ARG_IMAGE( class, "sec", 2, +- _( "Secondary" ), +- _( "Secondary image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMerge, sec ) ); +- +- VIPS_ARG_IMAGE( class, "out", 3, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsMerge, out ) ); +- +- VIPS_ARG_ENUM( class, "direction", 4, +- _( "Direction" ), +- _( "Horizontal or vertical merge" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMerge, direction ), +- VIPS_TYPE_DIRECTION, VIPS_DIRECTION_HORIZONTAL ); +- +- VIPS_ARG_INT( class, "dx", 5, +- _( "dx" ), +- _( "Horizontal displacement from sec to ref" ), ++ VIPS_ARG_IMAGE(class, "ref", 1, ++ _("Reference"), ++ _("Reference image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMerge, dx ), +- -100000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMerge, ref)); + +- VIPS_ARG_INT( class, "dy", 6, +- _( "dy" ), +- _( "Vertical displacement from sec to ref" ), ++ VIPS_ARG_IMAGE(class, "sec", 2, ++ _("Secondary"), ++ _("Secondary image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMerge, dy ), +- -100000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMerge, sec)); + +- VIPS_ARG_INT( class, "mblend", 7, +- _( "Max blend" ), +- _( "Maximum blend size" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMerge, mblend ), +- 0, 10000, 10 ); ++ VIPS_ARG_IMAGE(class, "out", 3, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsMerge, out)); ++ ++ VIPS_ARG_ENUM(class, "direction", 4, ++ _("Direction"), ++ _("Horizontal or vertical merge"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsMerge, direction), ++ VIPS_TYPE_DIRECTION, VIPS_DIRECTION_HORIZONTAL); + ++ VIPS_ARG_INT(class, "dx", 5, ++ _("dx"), ++ _("Horizontal displacement from sec to ref"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsMerge, dx), ++ -100000000, 1000000000, 1); ++ ++ VIPS_ARG_INT(class, "dy", 6, ++ _("dy"), ++ _("Vertical displacement from sec to ref"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsMerge, dy), ++ -100000000, 1000000000, 1); ++ ++ VIPS_ARG_INT(class, "mblend", 7, ++ _("Max blend"), ++ _("Maximum blend size"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsMerge, mblend), ++ 0, 10000, 10); + } + + static void +-vips_merge_init( VipsMerge *merge ) ++vips_merge_init(VipsMerge *merge) + { + merge->mblend = 10; + } +@@ -180,30 +178,30 @@ vips_merge_init( VipsMerge *merge ) + * @dx: displacement of ref from sec + * @dy: displacement of ref from sec + * @...: %NULL-terminated list of optional named arguments +- * ++ * + * Optional arguments: + * +- * * @mblend: %gint, maximum blend size ++ * * @mblend: %gint, maximum blend size + * + * This operation joins two images left-right (with @ref on the left) or + * up-down (with @ref above) with a smooth seam. + * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +- * The two input images are cast up to the smallest common type (see table +- * Smallest common format in ++ * The two input images are cast up to the smallest common type (see table ++ * Smallest common format in + * arithmetic). + * + * @dx and @dy give the displacement of @sec relative to @ref, in other words, + * the vector to get from the origin of @sec to the origin of @ref, in other +- * words, @dx will generally be a negative number. ++ * words, @dx will generally be a negative number. + * + * @mblend limits the maximum width of the +- * blend area. A value of "-1" means "unlimited". The two images are blended +- * with a raised cosine. ++ * blend area. A value of "-1" means "unlimited". The two images are blended ++ * with a raised cosine. + * + * Pixels with all bands equal to zero are "transparent", that + * is, zero pixels in the overlap area do not contribute to the merge. +@@ -213,17 +211,17 @@ vips_merge_init( VipsMerge *merge ) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_merge( VipsImage *ref, VipsImage *sec, VipsImage **out, +- VipsDirection direction, int dx, int dy, ... ) ++int ++vips_merge(VipsImage *ref, VipsImage *sec, VipsImage **out, ++ VipsDirection direction, int dx, int dy, ...) + { + va_list ap; + int result; + +- va_start( ap, dy ); +- result = vips_call_split( "merge", ap, +- ref, sec, out, direction, dx, dy ); +- va_end( ap ); ++ va_start(ap, dy); ++ result = vips_call_split("merge", ap, ++ ref, sec, out, direction, dx, dy); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/mosaicing/mosaic.c b/libvips/mosaicing/mosaic.c +index c07f80b41e..bbb353182d 100644 +--- a/libvips/mosaicing/mosaic.c ++++ b/libvips/mosaicing/mosaic.c +@@ -10,28 +10,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -72,10 +72,10 @@ typedef struct { + + typedef VipsOperationClass VipsMosaicClass; + +-G_DEFINE_TYPE( VipsMosaic, vips_mosaic, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsMosaic, vips_mosaic, VIPS_TYPE_OPERATION); + + static int +-vips_mosaic_build( VipsObject *object ) ++vips_mosaic_build(VipsObject *object) + { + VipsMosaic *mosaic = (VipsMosaic *) object; + +@@ -87,43 +87,43 @@ vips_mosaic_build( VipsObject *object ) + double dx1; + double dy1; + +- g_object_set( mosaic, "out", vips_image_new(), NULL ); ++ g_object_set(mosaic, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_mosaic_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_mosaic_parent_class)->build(object)) ++ return (-1); + +- /* A placeholder used to ensure that memory used by the analysis ++ /* A placeholder used to ensure that memory used by the analysis + * phase is freed as soon as possible. + */ +- x = vips_image_new(); ++ x = vips_image_new(); + +- switch( mosaic->direction ) { ++ switch (mosaic->direction) { + case VIPS_DIRECTION_HORIZONTAL: +- if( vips__find_lroverlap( mosaic->ref, mosaic->sec, x, +- mosaic->bandno, +- mosaic->xref, mosaic->yref, mosaic->xsec, mosaic->ysec, +- mosaic->hwindow, mosaic->harea, +- &dx0, &dy0, +- &scale1, &angle1, +- &dx1, &dy1 ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips__find_lroverlap(mosaic->ref, mosaic->sec, x, ++ mosaic->bandno, ++ mosaic->xref, mosaic->yref, mosaic->xsec, mosaic->ysec, ++ mosaic->hwindow, mosaic->harea, ++ &dx0, &dy0, ++ &scale1, &angle1, ++ &dx1, &dy1)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + break; + + case VIPS_DIRECTION_VERTICAL: +- if( vips__find_tboverlap( mosaic->ref, mosaic->sec, x, +- mosaic->bandno, +- mosaic->xref, mosaic->yref, mosaic->xsec, mosaic->ysec, +- mosaic->hwindow, mosaic->harea, +- &dx0, &dy0, +- &scale1, &angle1, +- &dx1, &dy1 ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips__find_tboverlap(mosaic->ref, mosaic->sec, x, ++ mosaic->bandno, ++ mosaic->xref, mosaic->yref, mosaic->xsec, mosaic->ysec, ++ mosaic->hwindow, mosaic->harea, ++ &dx0, &dy0, ++ &scale1, &angle1, ++ &dx1, &dy1)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + break; + + default: +@@ -139,169 +139,168 @@ vips_mosaic_build( VipsObject *object ) + dy1 = 0; + } + +- g_object_set( mosaic, +- "dx0", dx0, ++ g_object_set(mosaic, ++ "dx0", dx0, + "dy0", dy0, +- "scale1", scale1, +- "angle1", angle1, +- "dx1", dx1, ++ "scale1", scale1, ++ "angle1", angle1, ++ "dx1", dx1, + "dy1", dy1, +- NULL ); +- +- if( vips_merge( mosaic->ref, mosaic->sec, &x, +- mosaic->direction, mosaic->dx0, mosaic->dy0, +- "mblend", mosaic->mblend, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, mosaic->out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ NULL); ++ ++ if (vips_merge(mosaic->ref, mosaic->sec, &x, ++ mosaic->direction, mosaic->dx0, mosaic->dy0, ++ "mblend", mosaic->mblend, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, mosaic->out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } + + static void +-vips_mosaic_class_init( VipsMosaicClass *class ) ++vips_mosaic_class_init(VipsMosaicClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "mosaic"; +- object_class->description = _( "mosaic two images" ); ++ object_class->description = _("mosaic two images"); + object_class->build = vips_mosaic_build; + +- VIPS_ARG_IMAGE( class, "ref", 1, +- _( "Reference" ), +- _( "Reference image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic, ref ) ); +- +- VIPS_ARG_IMAGE( class, "sec", 2, +- _( "Secondary" ), +- _( "Secondary image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic, sec ) ); +- +- VIPS_ARG_IMAGE( class, "out", 3, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsMosaic, out ) ); +- +- VIPS_ARG_ENUM( class, "direction", 4, +- _( "Direction" ), +- _( "Horizontal or vertical mosaic" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic, direction ), +- VIPS_TYPE_DIRECTION, VIPS_DIRECTION_HORIZONTAL ); +- +- VIPS_ARG_INT( class, "xref", 5, +- _( "xref" ), +- _( "Position of reference tie-point" ), ++ VIPS_ARG_IMAGE(class, "ref", 1, ++ _("Reference"), ++ _("Reference image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsMosaic, ref)); ++ ++ VIPS_ARG_IMAGE(class, "sec", 2, ++ _("Secondary"), ++ _("Secondary image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsMosaic, sec)); ++ ++ VIPS_ARG_IMAGE(class, "out", 3, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsMosaic, out)); ++ ++ VIPS_ARG_ENUM(class, "direction", 4, ++ _("Direction"), ++ _("Horizontal or vertical mosaic"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsMosaic, direction), ++ VIPS_TYPE_DIRECTION, VIPS_DIRECTION_HORIZONTAL); ++ ++ VIPS_ARG_INT(class, "xref", 5, ++ _("xref"), ++ _("Position of reference tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic, xref ), +- 0, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMosaic, xref), ++ 0, 1000000000, 1); + +- VIPS_ARG_INT( class, "yref", 6, +- _( "yref" ), +- _( "Position of reference tie-point" ), ++ VIPS_ARG_INT(class, "yref", 6, ++ _("yref"), ++ _("Position of reference tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic, yref ), +- 0, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMosaic, yref), ++ 0, 1000000000, 1); + +- VIPS_ARG_INT( class, "xsec", 7, +- _( "xsec" ), +- _( "Position of secondary tie-point" ), ++ VIPS_ARG_INT(class, "xsec", 7, ++ _("xsec"), ++ _("Position of secondary tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic, xsec ), +- 0, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMosaic, xsec), ++ 0, 1000000000, 1); + +- VIPS_ARG_INT( class, "ysec", 8, +- _( "ysec" ), +- _( "Position of secondary tie-point" ), ++ VIPS_ARG_INT(class, "ysec", 8, ++ _("ysec"), ++ _("Position of secondary tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic, ysec ), +- 0, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMosaic, ysec), ++ 0, 1000000000, 1); + +- VIPS_ARG_INT( class, "hwindow", 9, +- _( "hwindow" ), +- _( "Half window size" ), ++ VIPS_ARG_INT(class, "hwindow", 9, ++ _("hwindow"), ++ _("Half window size"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMosaic, hwindow ), +- 0, 1000000000, 5 ); ++ G_STRUCT_OFFSET(VipsMosaic, hwindow), ++ 0, 1000000000, 5); + +- VIPS_ARG_INT( class, "harea", 10, +- _( "harea" ), +- _( "Half area size" ), ++ VIPS_ARG_INT(class, "harea", 10, ++ _("harea"), ++ _("Half area size"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMosaic, harea ), +- 0, 1000000000, 15 ); ++ G_STRUCT_OFFSET(VipsMosaic, harea), ++ 0, 1000000000, 15); + +- VIPS_ARG_INT( class, "mblend", 11, +- _( "Max blend" ), +- _( "Maximum blend size" ), ++ VIPS_ARG_INT(class, "mblend", 11, ++ _("Max blend"), ++ _("Maximum blend size"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMosaic, mblend ), +- 0, 10000, 10 ); ++ G_STRUCT_OFFSET(VipsMosaic, mblend), ++ 0, 10000, 10); + +- VIPS_ARG_INT( class, "bandno", 12, +- _( "Search band" ), +- _( "Band to search for features on" ), ++ VIPS_ARG_INT(class, "bandno", 12, ++ _("Search band"), ++ _("Band to search for features on"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMosaic, bandno ), +- 0, 10000, 0 ); ++ G_STRUCT_OFFSET(VipsMosaic, bandno), ++ 0, 10000, 0); + +- VIPS_ARG_INT( class, "dx0", 13, +- _( "Integer offset" ), +- _( "Detected integer offset" ), ++ VIPS_ARG_INT(class, "dx0", 13, ++ _("Integer offset"), ++ _("Detected integer offset"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMosaic, dx0 ), +- -10000000, 10000000, 0 ); ++ G_STRUCT_OFFSET(VipsMosaic, dx0), ++ -10000000, 10000000, 0); + +- VIPS_ARG_INT( class, "dy0", 14, +- _( "Integer offset" ), +- _( "Detected integer offset" ), ++ VIPS_ARG_INT(class, "dy0", 14, ++ _("Integer offset"), ++ _("Detected integer offset"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMosaic, dy0 ), +- -10000000, 10000000, 0 ); ++ G_STRUCT_OFFSET(VipsMosaic, dy0), ++ -10000000, 10000000, 0); + +- VIPS_ARG_DOUBLE( class, "scale1", 15, +- _( "Scale" ), +- _( "Detected scale" ), ++ VIPS_ARG_DOUBLE(class, "scale1", 15, ++ _("Scale"), ++ _("Detected scale"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMosaic, scale1 ), +- -10000000.0, 10000000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsMosaic, scale1), ++ -10000000.0, 10000000.0, 1.0); + +- VIPS_ARG_DOUBLE( class, "angle1", 16, +- _( "Angle" ), +- _( "Detected rotation" ), ++ VIPS_ARG_DOUBLE(class, "angle1", 16, ++ _("Angle"), ++ _("Detected rotation"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMosaic, angle1 ), +- -10000000.0, 10000000.0, 0.0 ); ++ G_STRUCT_OFFSET(VipsMosaic, angle1), ++ -10000000.0, 10000000.0, 0.0); + +- VIPS_ARG_DOUBLE( class, "dx1", 17, +- _( "First-order displacement" ), +- _( "Detected first-order displacement" ), ++ VIPS_ARG_DOUBLE(class, "dx1", 17, ++ _("First-order displacement"), ++ _("Detected first-order displacement"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMosaic, dx1 ), +- -10000000.0, 10000000.0, 0.0 ); ++ G_STRUCT_OFFSET(VipsMosaic, dx1), ++ -10000000.0, 10000000.0, 0.0); + +- VIPS_ARG_DOUBLE( class, "dy1", 17, +- _( "First-order displacement" ), +- _( "Detected first-order displacement" ), ++ VIPS_ARG_DOUBLE(class, "dy1", 17, ++ _("First-order displacement"), ++ _("Detected first-order displacement"), + VIPS_ARGUMENT_OPTIONAL_OUTPUT, +- G_STRUCT_OFFSET( VipsMosaic, dy1 ), +- -10000000.0, 10000000.0, 0.0 ); +- ++ G_STRUCT_OFFSET(VipsMosaic, dy1), ++ -10000000.0, 10000000.0, 0.0); + } + + static void +-vips_mosaic_init( VipsMosaic *mosaic ) ++vips_mosaic_init(VipsMosaic *mosaic) + { + mosaic->mblend = 10; + mosaic->hwindow = 5; +@@ -320,12 +319,12 @@ vips_mosaic_init( VipsMosaic *mosaic ) + * @xsec: position in secondary image + * @ysec: position in secondary image + * @...: %NULL-terminated list of optional named arguments +- * ++ * + * Optional arguments: + * + * * @bandno: %gint, band to search for features + * * @hwindow: %gint, half window size +- * * @harea: %gint, half search size ++ * * @harea: %gint, half search size + * * @mblend: %gint, maximum blend size + * * @dx0: %gint, output, detected displacement + * * @dy0: %gint, output, detected displacement +@@ -337,18 +336,18 @@ vips_mosaic_init( VipsMosaic *mosaic ) + * This operation joins two images left-right (with @ref on the left) or + * top-bottom (with @ref above) given an approximate overlap. + * +- * @sec is positioned so that the pixel (@xsec, @ysec) in @sec lies on top of ++ * @sec is positioned so that the pixel (@xsec, @ysec) in @sec lies on top of + * the pixel (@xref, @yref) in @ref. The overlap area is divided into three +- * sections, 20 high-contrast points in band @bandno of image @ref are found +- * in each, and a window of pixels of size @hwindow around each high-contrast +- * point is searched for in @sec over an area of @harea. ++ * sections, 20 high-contrast points in band @bandno of image @ref are found ++ * in each, and a window of pixels of size @hwindow around each high-contrast ++ * point is searched for in @sec over an area of @harea. + * + * A linear model is fitted to the 60 tie-points, points a long way from the + * fit are discarded, and the model refitted until either too few points +- * remain or the model reaches good agreement. ++ * remain or the model reaches good agreement. + * + * The detected displacement is used with vips_merge() to join the two images +- * together. ++ * together. + * + * You can read out the detected transform with @dx0, @dy0, @scale1, @angle1, + * @dx1, @dy1. +@@ -357,17 +356,17 @@ vips_mosaic_init( VipsMosaic *mosaic ) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_mosaic( VipsImage *ref, VipsImage *sec, VipsImage **out, +- VipsDirection direction, int xref, int yref, int xsec, int ysec, ... ) ++int ++vips_mosaic(VipsImage *ref, VipsImage *sec, VipsImage **out, ++ VipsDirection direction, int xref, int yref, int xsec, int ysec, ...) + { + va_list ap; + int result; + +- va_start( ap, ysec ); +- result = vips_call_split( "mosaic", ap, ref, sec, out, +- direction, xref, yref, xsec, ysec ); +- va_end( ap ); ++ va_start(ap, ysec); ++ result = vips_call_split("mosaic", ap, ref, sec, out, ++ direction, xref, yref, xsec, ysec); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/mosaicing/mosaic1.c b/libvips/mosaicing/mosaic1.c +index 48905ff524..20f37f9df2 100644 +--- a/libvips/mosaicing/mosaic1.c ++++ b/libvips/mosaicing/mosaic1.c +@@ -21,28 +21,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -69,11 +69,11 @@ + #define OLD + */ + +-/* Like vips_similarity(), but return the transform we generated. ++/* Like vips_similarity(), but return the transform we generated. + */ +-static int +-apply_similarity( VipsTransformation *trn, VipsImage *in, VipsImage *out, +- double a, double b, double dx, double dy ) ++static int ++apply_similarity(VipsTransformation *trn, VipsImage *in, VipsImage *out, ++ double a, double b, double dx, double dy) + { + trn->iarea.left = 0; + trn->iarea.top = 0; +@@ -87,30 +87,30 @@ apply_similarity( VipsTransformation *trn, VipsImage *in, VipsImage *out, + trn->idy = 0; + trn->odx = dx; + trn->ody = dy; +- vips__transform_set_area( trn ); +- if( vips__transform_calc_inverse( trn ) ) +- return( -1 ); ++ vips__transform_set_area(trn); ++ if (vips__transform_calc_inverse(trn)) ++ return (-1); + +- if( vips__affinei( in, out, trn ) ) +- return( -1 ); ++ if (vips__affinei(in, out, trn)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* A join function ... either left-right or top-bottom rotscalemerge. + */ +-typedef int (*joinfn)( VipsImage *, VipsImage *, VipsImage *, +- double, double, double, double, int ); ++typedef int (*joinfn)(VipsImage *, VipsImage *, VipsImage *, ++ double, double, double, double, int); + + /* similarity+lrmerge. + */ + int +-vips__lrmerge1( VipsImage *ref, VipsImage *sec, VipsImage *out, +- double a, double b, double dx, double dy, int mwidth ) ++vips__lrmerge1(VipsImage *ref, VipsImage *sec, VipsImage *out, ++ double a, double b, double dx, double dy, int mwidth) + { + VipsTransformation trn; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 1 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(out), 1); + VipsBuf buf; + char text[1024]; + +@@ -118,47 +118,47 @@ vips__lrmerge1( VipsImage *ref, VipsImage *sec, VipsImage *out, + + /* Scale, rotate and displace sec. + */ +- if( apply_similarity( &trn, sec, t[0], a, b, dx, dy ) ) +- return( -1 ); ++ if (apply_similarity(&trn, sec, t[0], a, b, dx, dy)) ++ return (-1); + + /* And join to ref. + */ +- if( vips__lrmerge( ref, t[0], out, +- -trn.oarea.left, -trn.oarea.top, mwidth ) ) +- return( -1 ); ++ if (vips__lrmerge(ref, t[0], out, ++ -trn.oarea.left, -trn.oarea.top, mwidth)) ++ return (-1); + + /* Note parameters in history file ... for global balance to pick up + * later. + */ +- vips__add_mosaic_name( out ); +- vips_buf_init_static( &buf, text, 1024 ); +- vips_buf_appendf( &buf, "#LRROTSCALE <%s> <%s> <%s> <", +- vips__get_mosaic_name( ref ), +- vips__get_mosaic_name( sec ), +- vips__get_mosaic_name( out ) ); +- vips_buf_appendg( &buf, a ); +- vips_buf_appendf( &buf, "> <" ); +- vips_buf_appendg( &buf, b ); +- vips_buf_appendf( &buf, "> <" ); +- vips_buf_appendg( &buf, dx ); +- vips_buf_appendf( &buf, "> <" ); +- vips_buf_appendg( &buf, dy ); +- vips_buf_appendf( &buf, "> <%d>", mwidth ); +- if( vips_image_history_printf( out, "%s", vips_buf_all( &buf ) ) ) +- return( -1 ); +- +- return( 0 ); ++ vips__add_mosaic_name(out); ++ vips_buf_init_static(&buf, text, 1024); ++ vips_buf_appendf(&buf, "#LRROTSCALE <%s> <%s> <%s> <", ++ vips__get_mosaic_name(ref), ++ vips__get_mosaic_name(sec), ++ vips__get_mosaic_name(out)); ++ vips_buf_appendg(&buf, a); ++ vips_buf_appendf(&buf, "> <"); ++ vips_buf_appendg(&buf, b); ++ vips_buf_appendf(&buf, "> <"); ++ vips_buf_appendg(&buf, dx); ++ vips_buf_appendf(&buf, "> <"); ++ vips_buf_appendg(&buf, dy); ++ vips_buf_appendf(&buf, "> <%d>", mwidth); ++ if (vips_image_history_printf(out, "%s", vips_buf_all(&buf))) ++ return (-1); ++ ++ return (0); + } + + /* similarity+tbmerge. + */ + int +-vips__tbmerge1( VipsImage *ref, VipsImage *sec, VipsImage *out, +- double a, double b, double dx, double dy, int mwidth ) ++vips__tbmerge1(VipsImage *ref, VipsImage *sec, VipsImage *out, ++ double a, double b, double dx, double dy, int mwidth) + { + VipsTransformation trn; + VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 1 ); ++ vips_object_local_array(VIPS_OBJECT(out), 1); + VipsBuf buf; + char text[1024]; + +@@ -166,71 +166,71 @@ vips__tbmerge1( VipsImage *ref, VipsImage *sec, VipsImage *out, + + /* Scale, rotate and displace sec. + */ +- if( apply_similarity( &trn, sec, t[0], a, b, dx, dy ) ) +- return( -1 ); ++ if (apply_similarity(&trn, sec, t[0], a, b, dx, dy)) ++ return (-1); + + /* And join to ref. + */ +- if( vips__tbmerge( ref, t[0], out, +- -trn.oarea.left, -trn.oarea.top, mwidth ) ) +- return( -1 ); ++ if (vips__tbmerge(ref, t[0], out, ++ -trn.oarea.left, -trn.oarea.top, mwidth)) ++ return (-1); + + /* Note parameters in history file ... for global balance to pick up + * later. + */ +- vips__add_mosaic_name( out ); +- vips_buf_init_static( &buf, text, 1024 ); +- vips_buf_appendf( &buf, "#TBROTSCALE <%s> <%s> <%s> <", +- vips__get_mosaic_name( ref ), +- vips__get_mosaic_name( sec ), +- vips__get_mosaic_name( out ) ); +- vips_buf_appendg( &buf, a ); +- vips_buf_appendf( &buf, "> <" ); +- vips_buf_appendg( &buf, b ); +- vips_buf_appendf( &buf, "> <" ); +- vips_buf_appendg( &buf, dx ); +- vips_buf_appendf( &buf, "> <" ); +- vips_buf_appendg( &buf, dy ); +- vips_buf_appendf( &buf, "> <%d>", mwidth ); +- if( vips_image_history_printf( out, "%s", vips_buf_all( &buf ) ) ) +- return( -1 ); +- +- return( 0 ); ++ vips__add_mosaic_name(out); ++ vips_buf_init_static(&buf, text, 1024); ++ vips_buf_appendf(&buf, "#TBROTSCALE <%s> <%s> <%s> <", ++ vips__get_mosaic_name(ref), ++ vips__get_mosaic_name(sec), ++ vips__get_mosaic_name(out)); ++ vips_buf_appendg(&buf, a); ++ vips_buf_appendf(&buf, "> <"); ++ vips_buf_appendg(&buf, b); ++ vips_buf_appendf(&buf, "> <"); ++ vips_buf_appendg(&buf, dx); ++ vips_buf_appendf(&buf, "> <"); ++ vips_buf_appendg(&buf, dy); ++ vips_buf_appendf(&buf, "> <%d>", mwidth); ++ if (vips_image_history_printf(out, "%s", vips_buf_all(&buf))) ++ return (-1); ++ ++ return (0); + } + + /* Join two images, using a pair of tie-points as parameters. + */ + static int +-rotjoin( VipsImage *ref, VipsImage *sec, VipsImage *out, joinfn jfn, +- int xr1, int yr1, int xs1, int ys1, ++rotjoin(VipsImage *ref, VipsImage *sec, VipsImage *out, joinfn jfn, ++ int xr1, int yr1, int xs1, int ys1, + int xr2, int yr2, int xs2, int ys2, +- int mwidth ) +-{ ++ int mwidth) ++{ + double a, b, dx, dy; + + /* Solve to get scale + rot + disp. + */ +- if( vips__coeff( xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, +- &a, &b, &dx, &dy ) ) +- return( -1 ); ++ if (vips__coeff(xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, ++ &a, &b, &dx, &dy)) ++ return (-1); + + /* Scale, rotate and displace sec. + */ +- if( jfn( ref, sec, out, a, b, dx, dy, mwidth ) ) +- return( -1 ); ++ if (jfn(ref, sec, out, a, b, dx, dy, mwidth)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + /* Like rotjoin, but do a search to refine the tie-points. + */ + static int +-rotjoin_search( VipsImage *ref, VipsImage *sec, VipsImage *out, joinfn jfn, +- int xr1, int yr1, int xs1, int ys1, ++rotjoin_search(VipsImage *ref, VipsImage *sec, VipsImage *out, joinfn jfn, ++ int xr1, int yr1, int xs1, int ys1, + int xr2, int yr2, int xs2, int ys2, + int halfcorrelation, int halfarea, +- int mwidth ) +-{ ++ int mwidth) ++{ + VipsTransformation trn; + double cor1, cor2; + double a, b, dx, dy; +@@ -244,61 +244,61 @@ rotjoin_search( VipsImage *ref, VipsImage *sec, VipsImage *out, joinfn jfn, + /* Temps. + */ + VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 3 ); ++ vips_object_local_array(VIPS_OBJECT(out), 3); + + /* Unpack LABQ to LABS for correlation. + */ +- if( ref->Coding == VIPS_CODING_LABQ ) { +- if( vips_LabQ2LabS( ref, &t[0], NULL ) ) +- return( -1 ); ++ if (ref->Coding == VIPS_CODING_LABQ) { ++ if (vips_LabQ2LabS(ref, &t[0], NULL)) ++ return (-1); + } + else { + t[0] = ref; +- g_object_ref( t[0] ); ++ g_object_ref(t[0]); + } +- if( sec->Coding == VIPS_CODING_LABQ ) { +- if( vips_LabQ2LabS( sec, &t[1], NULL ) ) +- return( -1 ); ++ if (sec->Coding == VIPS_CODING_LABQ) { ++ if (vips_LabQ2LabS(sec, &t[1], NULL)) ++ return (-1); + } + else { + t[1] = sec; +- g_object_ref( t[1] ); ++ g_object_ref(t[1]); + } + + t[2] = vips_image_new(); + + /* Solve to get scale + rot + disp. + */ +- if( vips__coeff( xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, +- &a, &b, &dx, &dy ) || +- apply_similarity( &trn, t[1], t[2], a, b, dx, dy ) ) +- return( -1 ); ++ if (vips__coeff(xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, ++ &a, &b, &dx, &dy) || ++ apply_similarity(&trn, t[1], t[2], a, b, dx, dy)) ++ return (-1); + + /* Map points on sec to rotated image. + */ +- vips__transform_forward_point( &trn, xs1, ys1, &xs3, &ys3 ); +- vips__transform_forward_point( &trn, xs2, ys2, &xs4, &ys4 ); ++ vips__transform_forward_point(&trn, xs1, ys1, &xs3, &ys3); ++ vips__transform_forward_point(&trn, xs2, ys2, &xs4, &ys4); + + /* Refine tie-points on rotated image. Remember the clip +- * vips__transform_set_area() has set, and move the sec tie-points ++ * vips__transform_set_area() has set, and move the sec tie-points + * accordingly. + */ +- if( vips__correl( t[0], t[2], xr1, yr1, +- xs3 - trn.oarea.left, ys3 - trn.oarea.top, +- halfcorrelation, halfarea, &cor1, &xs5, &ys5 ) ) +- return( -1 ); +- if( vips__correl( t[0], t[2], xr2, yr2, +- xs4 - trn.oarea.left, ys4 - trn.oarea.top, +- halfcorrelation, halfarea, &cor2, &xs6, &ys6 ) ) +- return( -1 ); ++ if (vips__correl(t[0], t[2], xr1, yr1, ++ xs3 - trn.oarea.left, ys3 - trn.oarea.top, ++ halfcorrelation, halfarea, &cor1, &xs5, &ys5)) ++ return (-1); ++ if (vips__correl(t[0], t[2], xr2, yr2, ++ xs4 - trn.oarea.left, ys4 - trn.oarea.top, ++ halfcorrelation, halfarea, &cor2, &xs6, &ys6)) ++ return (-1); + + #ifdef DEBUG +- printf( "rotjoin_search: nudged pair 1 from %d, %d to %d, %d\n", ++ printf("rotjoin_search: nudged pair 1 from %d, %d to %d, %d\n", + xs3 - trn.oarea.left, ys3 - trn.oarea.top, +- xs5, ys5 ); +- printf( "rotjoin_search: nudged pair 2 from %d, %d to %d, %d\n", ++ xs5, ys5); ++ printf("rotjoin_search: nudged pair 2 from %d, %d to %d, %d\n", + xs4 - trn.oarea.left, ys4 - trn.oarea.top, +- xs6, ys6 ); ++ xs6, ys6); + #endif /*DEBUG*/ + + /* Put the sec tie-points back into output space. +@@ -310,21 +310,21 @@ rotjoin_search( VipsImage *ref, VipsImage *sec, VipsImage *out, joinfn jfn, + + /* ... and now back to input space again. + */ +- vips__transform_invert_point( &trn, xs5, ys5, &xs7, &ys7 ); +- vips__transform_invert_point( &trn, xs6, ys6, &xs8, &ys8 ); ++ vips__transform_invert_point(&trn, xs5, ys5, &xs7, &ys7); ++ vips__transform_invert_point(&trn, xs6, ys6, &xs8, &ys8); + + /* Recalc the transform using the refined points. + */ +- if( vips__coeff( xr1, yr1, xs7, ys7, xr2, yr2, xs8, ys8, +- &a, &b, &dx, &dy ) ) +- return( -1 ); ++ if (vips__coeff(xr1, yr1, xs7, ys7, xr2, yr2, xs8, ys8, ++ &a, &b, &dx, &dy)) ++ return (-1); + + /* Scale and rotate final. + */ +- if( jfn( ref, sec, out, a, b, dx, dy, mwidth ) ) +- return( -1 ); ++ if (jfn(ref, sec, out, a, b, dx, dy, mwidth)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + #ifdef OLD +@@ -332,13 +332,13 @@ rotjoin_search( VipsImage *ref, VipsImage *sec, VipsImage *out, joinfn jfn, + * Look at vips__find_lroverlap() for problem? + */ + static int +-old_lrmosaic1( VipsImage *ref, VipsImage *sec, VipsImage *out, ++old_lrmosaic1(VipsImage *ref, VipsImage *sec, VipsImage *out, + int bandno, +- int xr1, int yr1, int xs1, int ys1, ++ int xr1, int yr1, int xs1, int ys1, + int xr2, int yr2, int xs2, int ys2, + int halfcorrelation, int halfarea, +- int mwidth ) +-{ ++ int mwidth) ++{ + VipsTransformation trn1, trn2; + int dx0, dy0; + double a, b, dx, dy; +@@ -350,32 +350,32 @@ old_lrmosaic1( VipsImage *ref, VipsImage *sec, VipsImage *out, + /* Temps. + */ + VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 2 ); ++ vips_object_local_array(VIPS_OBJECT(out), 2); + VipsImage *dummy; + + t[0] = vips_image_new(); + + /* Solve to get scale + rot + disp. + */ +- if( vips__coeff( xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, +- &a, &b, &dx, &dy ) || +- apply_similarity( &trn1, sec, t[0], a, b, dx, dy ) ) +- return( -1 ); ++ if (vips__coeff(xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2, ++ &a, &b, &dx, &dy) || ++ apply_similarity(&trn1, sec, t[0], a, b, dx, dy)) ++ return (-1); + + /* Correct tie-points. dummy is just a placeholder used to ensure that + * memory used by the analysis phase is freed as soon as possible. + */ + dummy = vips_image_new(); +- if( vips__find_lroverlap( ref, t[0], dummy, +- bandno, +- -trn1.area.left, -trn1.area.top, 0, 0, +- halfcorrelation, halfarea, +- &dx0, &dy0, +- &a1, &b1, &dx1, &dy1 ) ) { +- g_object_unref( dummy ); +- return( -1 ); ++ if (vips__find_lroverlap(ref, t[0], dummy, ++ bandno, ++ -trn1.area.left, -trn1.area.top, 0, 0, ++ halfcorrelation, halfarea, ++ &dx0, &dy0, ++ &a1, &b1, &dx1, &dy1)) { ++ g_object_unref(dummy); ++ return (-1); + } +- g_object_unref( dummy ); ++ g_object_unref(dummy); + + /* Now combine the two transformations to get a corrected transform. + */ +@@ -384,32 +384,32 @@ old_lrmosaic1( VipsImage *ref, VipsImage *sec, VipsImage *out, + dxf = a1 * dx - b1 * dy + dx1; + dyf = b1 * dx + a1 * dy + dy1; + +- printf( "transform was: a = %g, b = %g, dx = %g, dy = %g\n", +- a, b, dx, dy ); +- printf( "correction: a = %g, b = %g, dx = %g, dy = %g\n", +- a1, b1, dx1, dy1 ); +- printf( "final: a = %g, b = %g, dx = %g, dy = %g\n", +- af, bf, dxf, dyf ); ++ printf("transform was: a = %g, b = %g, dx = %g, dy = %g\n", ++ a, b, dx, dy); ++ printf("correction: a = %g, b = %g, dx = %g, dy = %g\n", ++ a1, b1, dx1, dy1); ++ printf("final: a = %g, b = %g, dx = %g, dy = %g\n", ++ af, bf, dxf, dyf); + + t[1] = vips_image_new(); + + /* Scale and rotate final. + */ +- if( apply_similarity( &trn2, sec, t[1], af, bf, dxf, dyf ) ) +- return( -1 ); ++ if (apply_similarity(&trn2, sec, t[1], af, bf, dxf, dyf)) ++ return (-1); + +- printf( "disp: trn1 left = %d, top = %d\n", +- trn1.area.left, trn1.area.top ); +- printf( "disp: trn2 left = %d, top = %d\n", +- trn2.area.left, trn2.area.top ); ++ printf("disp: trn1 left = %d, top = %d\n", ++ trn1.area.left, trn1.area.top); ++ printf("disp: trn2 left = %d, top = %d\n", ++ trn2.area.left, trn2.area.top); + + /* And join to ref. + */ +- if( vips_merge( ref, t[1], out, VIPS_DIRECTION_HORIZONTAL, +- -trn2.area.left, -trn2.area.top, mwidth ) ) +- return( -1 ); ++ if (vips_merge(ref, t[1], out, VIPS_DIRECTION_HORIZONTAL, ++ -trn2.area.left, -trn2.area.top, mwidth)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + #endif /*OLD*/ + +@@ -439,186 +439,184 @@ typedef struct { + + typedef VipsOperationClass VipsMosaic1Class; + +-G_DEFINE_TYPE( VipsMosaic1, vips_mosaic1, VIPS_TYPE_OPERATION ); ++G_DEFINE_TYPE(VipsMosaic1, vips_mosaic1, VIPS_TYPE_OPERATION); + + static int +-vips_mosaic1_build( VipsObject *object ) ++vips_mosaic1_build(VipsObject *object) + { + VipsMosaic1 *mosaic1 = (VipsMosaic1 *) object; + + joinfn jfn; + +- g_object_set( mosaic1, "out", vips_image_new(), NULL ); ++ g_object_set(mosaic1, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_mosaic1_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_mosaic1_parent_class)->build(object)) ++ return (-1); + +- if( !mosaic1->interpolate ) +- mosaic1->interpolate = vips_interpolate_new( "bilinear" ); ++ if (!mosaic1->interpolate) ++ mosaic1->interpolate = vips_interpolate_new("bilinear"); + +- jfn = mosaic1->direction == VIPS_DIRECTION_HORIZONTAL ? +- vips__lrmerge1 : vips__tbmerge1; ++ jfn = mosaic1->direction == VIPS_DIRECTION_HORIZONTAL ? vips__lrmerge1 : vips__tbmerge1; + +- if( mosaic1->search ) { +- if( rotjoin_search( mosaic1->ref, mosaic1->sec, mosaic1->out, +- jfn, +- mosaic1->xr1, mosaic1->yr1, mosaic1->xs1, mosaic1->ys1, +- mosaic1->xr2, mosaic1->yr2, mosaic1->xs2, mosaic1->ys2, +- mosaic1->hwindow, mosaic1->harea, +- mosaic1->mblend ) ) +- return( -1 ); ++ if (mosaic1->search) { ++ if (rotjoin_search(mosaic1->ref, mosaic1->sec, mosaic1->out, ++ jfn, ++ mosaic1->xr1, mosaic1->yr1, mosaic1->xs1, mosaic1->ys1, ++ mosaic1->xr2, mosaic1->yr2, mosaic1->xs2, mosaic1->ys2, ++ mosaic1->hwindow, mosaic1->harea, ++ mosaic1->mblend)) ++ return (-1); + } + else { +- if( rotjoin( mosaic1->ref, mosaic1->sec, mosaic1->out, +- jfn, +- mosaic1->xr1, mosaic1->yr1, mosaic1->xs1, mosaic1->ys1, +- mosaic1->xr2, mosaic1->yr2, mosaic1->xs2, mosaic1->ys2, +- mosaic1->mblend ) ) +- return( -1 ); ++ if (rotjoin(mosaic1->ref, mosaic1->sec, mosaic1->out, ++ jfn, ++ mosaic1->xr1, mosaic1->yr1, mosaic1->xs1, mosaic1->ys1, ++ mosaic1->xr2, mosaic1->yr2, mosaic1->xs2, mosaic1->ys2, ++ mosaic1->mblend)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_mosaic1_class_init( VipsMosaic1Class *class ) ++vips_mosaic1_class_init(VipsMosaic1Class *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "mosaic1"; +- object_class->description = _( "first-order mosaic of two images" ); ++ object_class->description = _("first-order mosaic of two images"); + object_class->build = vips_mosaic1_build; + +- VIPS_ARG_IMAGE( class, "ref", 1, +- _( "Reference" ), +- _( "Reference image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, ref ) ); +- +- VIPS_ARG_IMAGE( class, "sec", 2, +- _( "Secondary" ), +- _( "Secondary image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, sec ) ); +- +- VIPS_ARG_IMAGE( class, "out", 3, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsMosaic1, out ) ); +- +- VIPS_ARG_ENUM( class, "direction", 4, +- _( "Direction" ), +- _( "Horizontal or vertical mosaic" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, direction ), +- VIPS_TYPE_DIRECTION, VIPS_DIRECTION_HORIZONTAL ); +- +- VIPS_ARG_INT( class, "xr1", 5, +- _( "xr1" ), +- _( "Position of first reference tie-point" ), ++ VIPS_ARG_IMAGE(class, "ref", 1, ++ _("Reference"), ++ _("Reference image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsMosaic1, ref)); ++ ++ VIPS_ARG_IMAGE(class, "sec", 2, ++ _("Secondary"), ++ _("Secondary image"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsMosaic1, sec)); ++ ++ VIPS_ARG_IMAGE(class, "out", 3, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsMosaic1, out)); ++ ++ VIPS_ARG_ENUM(class, "direction", 4, ++ _("Direction"), ++ _("Horizontal or vertical mosaic"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsMosaic1, direction), ++ VIPS_TYPE_DIRECTION, VIPS_DIRECTION_HORIZONTAL); ++ ++ VIPS_ARG_INT(class, "xr1", 5, ++ _("xr1"), ++ _("Position of first reference tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, xr1 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMosaic1, xr1), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "yr1", 6, +- _( "yr1" ), +- _( "Position of first reference tie-point" ), ++ VIPS_ARG_INT(class, "yr1", 6, ++ _("yr1"), ++ _("Position of first reference tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, yr1 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMosaic1, yr1), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "xs1", 7, +- _( "xs1" ), +- _( "Position of first secondary tie-point" ), ++ VIPS_ARG_INT(class, "xs1", 7, ++ _("xs1"), ++ _("Position of first secondary tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, xs1 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMosaic1, xs1), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "ys1", 8, +- _( "ys1" ), +- _( "Position of first secondary tie-point" ), ++ VIPS_ARG_INT(class, "ys1", 8, ++ _("ys1"), ++ _("Position of first secondary tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, ys1 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMosaic1, ys1), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "xr2", 9, +- _( "xr2" ), +- _( "Position of second reference tie-point" ), ++ VIPS_ARG_INT(class, "xr2", 9, ++ _("xr2"), ++ _("Position of second reference tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, xr2 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMosaic1, xr2), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "yr2", 10, +- _( "yr2" ), +- _( "Position of second reference tie-point" ), ++ VIPS_ARG_INT(class, "yr2", 10, ++ _("yr2"), ++ _("Position of second reference tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, yr2 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMosaic1, yr2), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "xs2", 11, +- _( "xs2" ), +- _( "Position of second secondary tie-point" ), ++ VIPS_ARG_INT(class, "xs2", 11, ++ _("xs2"), ++ _("Position of second secondary tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, xs2 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMosaic1, xs2), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "ys2", 12, +- _( "ys2" ), +- _( "Position of second secondary tie-point" ), ++ VIPS_ARG_INT(class, "ys2", 12, ++ _("ys2"), ++ _("Position of second secondary tie-point"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, ys2 ), +- -1000000000, 1000000000, 1 ); ++ G_STRUCT_OFFSET(VipsMosaic1, ys2), ++ -1000000000, 1000000000, 1); + +- VIPS_ARG_INT( class, "hwindow", 13, +- _( "hwindow" ), +- _( "Half window size" ), ++ VIPS_ARG_INT(class, "hwindow", 13, ++ _("hwindow"), ++ _("Half window size"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, hwindow ), +- 0, 1000000000, 5 ); ++ G_STRUCT_OFFSET(VipsMosaic1, hwindow), ++ 0, 1000000000, 5); + +- VIPS_ARG_INT( class, "harea", 14, +- _( "harea" ), +- _( "Half area size" ), ++ VIPS_ARG_INT(class, "harea", 14, ++ _("harea"), ++ _("Half area size"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, harea ), +- 0, 1000000000, 15 ); ++ G_STRUCT_OFFSET(VipsMosaic1, harea), ++ 0, 1000000000, 15); + +- VIPS_ARG_BOOL( class, "search", 15, +- _( "Search" ), +- _( "Search to improve tie-points" ), ++ VIPS_ARG_BOOL(class, "search", 15, ++ _("Search"), ++ _("Search to improve tie-points"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, search ), +- FALSE ); +- +- VIPS_ARG_INTERPOLATE( class, "interpolate", 16, +- _( "Interpolate" ), +- _( "Interpolate pixels with this" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, interpolate ) ); +- +- VIPS_ARG_INT( class, "mblend", 17, +- _( "Max blend" ), +- _( "Maximum blend size" ), ++ G_STRUCT_OFFSET(VipsMosaic1, search), ++ FALSE); ++ ++ VIPS_ARG_INTERPOLATE(class, "interpolate", 16, ++ _("Interpolate"), ++ _("Interpolate pixels with this"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMosaic1, mblend ), +- 0, 10000, 10 ); ++ G_STRUCT_OFFSET(VipsMosaic1, interpolate)); + +- VIPS_ARG_INT( class, "bandno", 18, +- _( "Search band" ), +- _( "Band to search for features on" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsMosaic1, bandno ), +- 0, 10000, 0 ); ++ VIPS_ARG_INT(class, "mblend", 17, ++ _("Max blend"), ++ _("Maximum blend size"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsMosaic1, mblend), ++ 0, 10000, 10); + ++ VIPS_ARG_INT(class, "bandno", 18, ++ _("Search band"), ++ _("Band to search for features on"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, ++ G_STRUCT_OFFSET(VipsMosaic1, bandno), ++ 0, 10000, 0); + } + + static void +-vips_mosaic1_init( VipsMosaic1 *mosaic1 ) ++vips_mosaic1_init(VipsMosaic1 *mosaic1) + { + mosaic1->hwindow = 5; + mosaic1->harea = 15; +@@ -640,39 +638,39 @@ vips_mosaic1_init( VipsMosaic1 *mosaic1 ) + * @xs2: second secondary tie-point + * @ys2: second secondary tie-point + * @...: %NULL-terminated list of optional named arguments +- * ++ * + * Optional arguments: + * + * * @search: search to improve tie-points + * * @hwindow: half window size +- * * @harea: half search size ++ * * @harea: half search size + * * @interpolate: interpolate pixels with this +- * * @mblend: maximum blend size ++ * * @mblend: maximum blend size + * +- * This operation joins two images top-bottom (with @sec on the right) ++ * This operation joins two images top-bottom (with @sec on the right) + * or left-right (with @sec at the bottom) + * given an approximate pair of tie-points. @sec is scaled and rotated as + * necessary before the join. + * +- * If @search is %TRUE, before performing the transformation, the tie-points ++ * If @search is %TRUE, before performing the transformation, the tie-points + * are improved by searching an area of @sec of size @harea for a +- * object of size @hwindow in @ref. ++ * object of size @hwindow in @ref. + * + * @mblend limits the maximum size of the +- * blend area. A value of "-1" means "unlimited". The two images are blended +- * with a raised cosine. ++ * blend area. A value of "-1" means "unlimited". The two images are blended ++ * with a raised cosine. + * + * Pixels with all bands equal to zero are "transparent", that + * is, zero pixels in the overlap area do not contribute to the merge. + * This makes it possible to join non-rectangular images. + * +- * If the number of bands differs, one of the images +- * must have one band. In this case, an n-band image is formed from the ++ * If the number of bands differs, one of the images ++ * must have one band. In this case, an n-band image is formed from the + * one-band image by joining n copies of the one-band image together, and then + * the two n-band images are operated upon. + * +- * The two input images are cast up to the smallest common type (see table +- * Smallest common format in ++ * The two input images are cast up to the smallest common type (see table ++ * Smallest common format in + * arithmetic). + * + * See also: vips_merge(), vips_insert(), vips_globalbalance(). +@@ -680,18 +678,18 @@ vips_mosaic1_init( VipsMosaic1 *mosaic1 ) + * Returns: 0 on success, -1 on error + */ + int +-vips_mosaic1( VipsImage *ref, VipsImage *sec, VipsImage **out, +- VipsDirection direction, +- int xr1, int yr1, int xs1, int ys1, +- int xr2, int yr2, int xs2, int ys2, ... ) ++vips_mosaic1(VipsImage *ref, VipsImage *sec, VipsImage **out, ++ VipsDirection direction, ++ int xr1, int yr1, int xs1, int ys1, ++ int xr2, int yr2, int xs2, int ys2, ...) + { + va_list ap; + int result; + +- va_start( ap, ys2 ); +- result = vips_call_split( "mosaic1", ap, ref, sec, out, direction, +- xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2 ); +- va_end( ap ); ++ va_start(ap, ys2); ++ result = vips_call_split("mosaic1", ap, ref, sec, out, direction, ++ xr1, yr1, xs1, ys1, xr2, yr2, xs2, ys2); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/mosaicing/mosaicing.c b/libvips/mosaicing/mosaicing.c +index 361d157782..cc738b4208 100644 +--- a/libvips/mosaicing/mosaicing.c ++++ b/libvips/mosaicing/mosaicing.c +@@ -4,28 +4,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -45,7 +45,7 @@ + #include + #include + +-/** ++/** + * SECTION: mosaicing + * @short_description: build image mosaics + * @stability: Stable +@@ -63,16 +63,16 @@ + * left-right or up-down with a smooth seam. + * + * Next, vips_mosaic() uses +- * search functions plus the two low-level merge operations to join two images +- * given just an approximate overlap as a start point. ++ * search functions plus the two low-level merge operations to join two images ++ * given just an approximate overlap as a start point. + * + * vips_mosaic1() is a first-order +- * analogue of the basic mosaic functions: it takes two approximate ++ * analogue of the basic mosaic functions: it takes two approximate + * tie-points and uses + * them to rotate and scale the right-hand or bottom image before starting to + * join. + * +- * Finally, vips_globalbalance() can be used to remove contrast differences in ++ * Finally, vips_globalbalance() can be used to remove contrast differences in + * a mosaic + * which has been assembled with these functions. It takes the mosaic apart, + * measures image contrast differences along the seams, finds a set of +@@ -89,19 +89,19 @@ + * instead? + */ + void +-vips_mosaicing_operation_init( void ) ++vips_mosaicing_operation_init(void) + { +- extern GType vips_merge_get_type( void ); +- extern GType vips_mosaic_get_type( void ); +- extern GType vips_mosaic1_get_type( void ); +- extern GType vips_match_get_type( void ); +- extern GType vips_globalbalance_get_type( void ); +- extern GType vips_matrixinvert_get_type( void ); +- +- vips_merge_get_type(); +- vips_mosaic_get_type(); +- vips_mosaic1_get_type(); ++ extern GType vips_merge_get_type(void); ++ extern GType vips_mosaic_get_type(void); ++ extern GType vips_mosaic1_get_type(void); ++ extern GType vips_match_get_type(void); ++ extern GType vips_globalbalance_get_type(void); ++ extern GType vips_matrixinvert_get_type(void); ++ ++ vips_merge_get_type(); ++ vips_mosaic_get_type(); ++ vips_mosaic1_get_type(); + vips_matrixinvert_get_type(); +- vips_match_get_type(); +- vips_globalbalance_get_type(); ++ vips_match_get_type(); ++ vips_globalbalance_get_type(); + } +diff --git a/libvips/mosaicing/pmosaicing.h b/libvips/mosaicing/pmosaicing.h +index 965fbdbfdd..8b52c4a76a 100644 +--- a/libvips/mosaicing/pmosaicing.h ++++ b/libvips/mosaicing/pmosaicing.h +@@ -1,8 +1,8 @@ +-/* Local definitions used by the mosaicing program ++/* Local definitions used by the mosaicing program + * If VIPS_MAXPOINTS change please ensure that it is still a multiple of + * AREAS or else AREAS must change as well. Initial setup is for + * VIPS_MAXPOINTS = 60, AREAS = 3. +- * ++ * + * Copyright: 1990, 1991 N. Dessipris + * Author: Nicos Dessipris + * Written on: 07/11/1989 +@@ -11,28 +11,28 @@ + + /* + +- Copyright (C) 1991-2003 The National Gallery ++ Copyright (C) 1991-2003 The National Gallery + +- This program is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -42,7 +42,7 @@ + /* Number of entries in blend table. As a power of two as well, for >>ing. + */ + #define BLEND_SHIFT (10) +-#define BLEND_SIZE (1<st; + VipsImage *im = node->im; +@@ -85,113 +85,111 @@ remosaic_fn( JoinNode *node, VipsRemosaic *remosaic ) + char filename[FILENAME_MAX]; + char *p; + +- if( !im ) { +- vips_error( "vips_remosaic", _( "file \"%s\" not found" ), +- node->name ); +- return( NULL ); ++ if (!im) { ++ vips_error("vips_remosaic", _("file \"%s\" not found"), ++ node->name); ++ return (NULL); + } + + /* Remove substring remosaic->old_str from in->filename, replace with + * remosaic->new_str. + */ +- vips_strncpy( filename, im->filename, FILENAME_MAX ); +- if( (p = vips_strrstr( filename, remosaic->old_str )) ) { ++ vips_strncpy(filename, im->filename, FILENAME_MAX); ++ if ((p = vips_strrstr(filename, remosaic->old_str))) { + int offset = p - &filename[0]; + +- vips_strncpy( p, remosaic->new_str, FILENAME_MAX - offset ); +- vips_strncpy( p + remosaic->new_len, +- im->filename + offset + remosaic->old_len, +- FILENAME_MAX - offset - remosaic->new_len ); ++ vips_strncpy(p, remosaic->new_str, FILENAME_MAX - offset); ++ vips_strncpy(p + remosaic->new_len, ++ im->filename + offset + remosaic->old_len, ++ FILENAME_MAX - offset - remosaic->new_len); + } + + #ifdef DEBUG +- printf( "vips_remosaic: filename \"%s\" -> \"%s\"\n", +- im->filename, filename ); ++ printf("vips_remosaic: filename \"%s\" -> \"%s\"\n", ++ im->filename, filename); + #endif /*DEBUG*/ + +- if( !(out = vips__global_open_image( st, filename )) ) +- return( NULL ); ++ if (!(out = vips__global_open_image(st, filename))) ++ return (NULL); + +- if( out->Xsize != im->Xsize || out->Ysize != im->Ysize ) { +- vips_error( "vips_remosaic", +- _( "substitute image \"%s\" is not " +- "the same size as \"%s\"" ), +- filename, im->filename ); +- return( NULL ); ++ if (out->Xsize != im->Xsize || out->Ysize != im->Ysize) { ++ vips_error("vips_remosaic", ++ _("substitute image \"%s\" is not " ++ "the same size as \"%s\""), ++ filename, im->filename); ++ return (NULL); + } + +- return( out ); ++ return (out); + } + + static int +-vips_remosaic_build( VipsObject *object ) ++vips_remosaic_build(VipsObject *object) + { + VipsRemosaic *remosaic = (VipsRemosaic *) object; + + SymbolTable *st; + +- g_object_set( remosaic, "out", vips_image_new(), NULL ); ++ g_object_set(remosaic, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_remosaic_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_remosaic_parent_class)->build(object)) ++ return (-1); + +- if( !(st = vips__build_symtab( remosaic->out, SYM_TAB_SIZE )) || +- vips__parse_desc( st, remosaic->in ) ) +- return( -1 ); ++ if (!(st = vips__build_symtab(remosaic->out, SYM_TAB_SIZE)) || ++ vips__parse_desc(st, remosaic->in)) ++ return (-1); + +- remosaic->old_len = strlen( remosaic->old_str ); +- remosaic->new_len = strlen( remosaic->new_str ); +- if( vips__build_mosaic( st, remosaic->out, +- (transform_fn) remosaic_fn, remosaic ) ) +- return( -1 ); ++ remosaic->old_len = strlen(remosaic->old_str); ++ remosaic->new_len = strlen(remosaic->new_str); ++ if (vips__build_mosaic(st, remosaic->out, ++ (transform_fn) remosaic_fn, remosaic)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_remosaic_class_init( VipsRemosaicClass *class ) ++vips_remosaic_class_init(VipsRemosaicClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + VipsObjectClass *object_class = (VipsObjectClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "remosaic"; +- object_class->description = _( "rebuild an mosaiced image" ); ++ object_class->description = _("rebuild an mosaiced image"); + object_class->build = vips_remosaic_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsRemosaic, in ) ); +- +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsRemosaic, out ) ); +- +- VIPS_ARG_STRING( class, "old_str", 5, +- _( "old_str" ), +- _( "Search for this string" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsRemosaic, old_str ), +- "" ); ++ G_STRUCT_OFFSET(VipsRemosaic, in)); + +- VIPS_ARG_STRING( class, "new_str", 6, +- _( "new_str" ), +- _( "And swap for this string" ), ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsRemosaic, out)); ++ ++ VIPS_ARG_STRING(class, "old_str", 5, ++ _("old_str"), ++ _("Search for this string"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsRemosaic, new_str ), +- "" ); ++ G_STRUCT_OFFSET(VipsRemosaic, old_str), ++ ""); + ++ VIPS_ARG_STRING(class, "new_str", 6, ++ _("new_str"), ++ _("And swap for this string"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsRemosaic, new_str), ++ ""); + } + + static void +-vips_remosaic_init( VipsRemosaic *remosaic ) ++vips_remosaic_init(VipsRemosaic *remosaic) + { + } + +@@ -218,16 +216,16 @@ vips_remosaic_init( VipsRemosaic *remosaic ) + * + * Returns: 0 on success, -1 on error + */ +-int +-vips_remosaic( VipsImage *in, VipsImage **out, +- const char *old_str, const char *new_str, ... ) ++int ++vips_remosaic(VipsImage *in, VipsImage **out, ++ const char *old_str, const char *new_str, ...) + { + va_list ap; + int result; + +- va_start( ap, new_str ); +- result = vips_call_split( "remosaic", ap, in, out, old_str, new_str ); +- va_end( ap ); ++ va_start(ap, new_str); ++ result = vips_call_split("remosaic", ap, in, out, old_str, new_str); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/mosaicing/tbmerge.c b/libvips/mosaicing/tbmerge.c +index 160a1bcd06..f89971b88b 100644 +--- a/libvips/mosaicing/tbmerge.c ++++ b/libvips/mosaicing/tbmerge.c +@@ -1,16 +1,16 @@ +-/* Merge two images top-bottom. dx, dy is the offset needed to get from sec +- * (secondary image) to ref (reference image). ++/* Merge two images top-bottom. dx, dy is the offset needed to get from sec ++ * (secondary image) to ref (reference image). + * + * Usage: + * +- * int ++ * int + * vips_tbmerge( ref, sec, out, dx, dy ) + * VipsImage *ref, *sec, *out; + * int dx, dy; +- * ++ * + * Returns 0 on success and -1 on error + * +- * Copyright: 1990, 1991 N. Dessipris ++ * Copyright: 1990, 1991 N. Dessipris + * Author: N. Dessipris + * Written on: 20/09/1990 + * Updated on: 17/04/1991 +@@ -77,28 +77,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -121,115 +121,157 @@ + /* Return the position of the first non-zero pel from the top. + */ + static int +-find_top( VipsRegion *ir, int *pos, int x, int y, int h ) ++find_top(VipsRegion *ir, int *pos, int x, int y, int h) + { +- VipsPel *pr = VIPS_REGION_ADDR( ir, x, y ); ++ VipsPel *pr = VIPS_REGION_ADDR(ir, x, y); + VipsImage *im = ir->im; +- int ls = VIPS_REGION_LSKIP( ir ) / VIPS_IMAGE_SIZEOF_ELEMENT( im ); ++ int ls = VIPS_REGION_LSKIP(ir) / VIPS_IMAGE_SIZEOF_ELEMENT(im); + int b = im->Bands; + int i, j; + + /* Double the number of bands in a complex. + */ +- if( vips_band_format_iscomplex( im->BandFmt ) ) ++ if (vips_band_format_iscomplex(im->BandFmt)) + b *= 2; + + /* Search for the first non-zero band element from the top edge of the image. + */ +-#define tsearch( TYPE ) { \ +- TYPE *p = (TYPE *) pr; \ +- \ +- for( i = 0; i < h; i++ ) { \ +- for( j = 0; j < b; j++ ) \ +- if( p[j] ) \ ++#define tsearch(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) pr; \ ++\ ++ for (i = 0; i < h; i++) { \ ++ for (j = 0; j < b; j++) \ ++ if (p[j]) \ ++ break; \ ++ if (j < b) \ + break; \ +- if( j < b ) \ +- break; \ +- \ +- p += ls; \ +- } \ +-} ++\ ++ p += ls; \ ++ } \ ++ } + +- switch( im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: tsearch( unsigned char ); break; +- case VIPS_FORMAT_CHAR: tsearch( signed char ); break; +- case VIPS_FORMAT_USHORT: tsearch( unsigned short ); break; +- case VIPS_FORMAT_SHORT: tsearch( signed short ); break; +- case VIPS_FORMAT_UINT: tsearch( unsigned int ); break; +- case VIPS_FORMAT_INT: tsearch( signed int ); break; +- case VIPS_FORMAT_FLOAT: tsearch( float ); break; +- case VIPS_FORMAT_DOUBLE: tsearch( double ); break; +- case VIPS_FORMAT_COMPLEX: tsearch( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: tsearch( double ); break; ++ switch (im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ tsearch(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ tsearch(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ tsearch(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ tsearch(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ tsearch(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ tsearch(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ tsearch(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ tsearch(double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ tsearch(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ tsearch(double); ++ break; + + default: +- vips_error( "vips_tbmerge", "%s", _( "internal error" ) ); +- return( -1 ); ++ vips_error("vips_tbmerge", "%s", _("internal error")); ++ return (-1); + } + + *pos = y + i; + +- return( 0 ); ++ return (0); + } + + /* Return the position of the first non-zero pel from the bottom. + */ + static int +-find_bot( VipsRegion *ir, int *pos, int x, int y, int h ) ++find_bot(VipsRegion *ir, int *pos, int x, int y, int h) + { +- VipsPel *pr = VIPS_REGION_ADDR( ir, x, y ); ++ VipsPel *pr = VIPS_REGION_ADDR(ir, x, y); + VipsImage *im = ir->im; +- int ls = VIPS_REGION_LSKIP( ir ) / VIPS_IMAGE_SIZEOF_ELEMENT( ir->im ); ++ int ls = VIPS_REGION_LSKIP(ir) / VIPS_IMAGE_SIZEOF_ELEMENT(ir->im); + int b = im->Bands; + int i, j; + + /* Double the number of bands in a complex. + */ +- if( vips_band_format_iscomplex( im->BandFmt ) ) ++ if (vips_band_format_iscomplex(im->BandFmt)) + b *= 2; + + /* Search for the first non-zero band element from the top edge of the image. + */ +-#define rsearch( TYPE ) { \ +- TYPE *p = (TYPE *) pr + (h - 1) * ls; \ +- \ +- for( i = h - 1; i >= 0; i-- ) { \ +- for( j = 0; j < b; j++ ) \ +- if( p[j] ) \ ++#define rsearch(TYPE) \ ++ { \ ++ TYPE *p = (TYPE *) pr + (h - 1) * ls; \ ++\ ++ for (i = h - 1; i >= 0; i--) { \ ++ for (j = 0; j < b; j++) \ ++ if (p[j]) \ ++ break; \ ++ if (j < b) \ + break; \ +- if( j < b ) \ +- break; \ +- \ +- p -= ls; \ +- } \ +-} ++\ ++ p -= ls; \ ++ } \ ++ } + +- switch( im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: rsearch( unsigned char ); break; +- case VIPS_FORMAT_CHAR: rsearch( signed char ); break; +- case VIPS_FORMAT_USHORT: rsearch( unsigned short ); break; +- case VIPS_FORMAT_SHORT: rsearch( signed short ); break; +- case VIPS_FORMAT_UINT: rsearch( unsigned int ); break; +- case VIPS_FORMAT_INT: rsearch( signed int ); break; +- case VIPS_FORMAT_FLOAT: rsearch( float ); break; +- case VIPS_FORMAT_DOUBLE: rsearch( double ); break; +- case VIPS_FORMAT_COMPLEX: rsearch( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: rsearch( double ); break; ++ switch (im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ rsearch(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ rsearch(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ rsearch(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ rsearch(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ rsearch(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ rsearch(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ rsearch(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ rsearch(double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ rsearch(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ rsearch(double); ++ break; + + default: +- vips_error( "vips_tbmerge", "%s", _( "internal error" ) ); +- return( -1 ); ++ vips_error("vips_tbmerge", "%s", _("internal error")); ++ return (-1); + } + + *pos = y + i; + +- return( 0 ); ++ return (0); + } + + /* Make first/last for oreg. + */ + static int +-make_firstlast( MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) ++make_firstlast(MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg) + { + VipsRegion *rir = inf->rir; + VipsRegion *sir = inf->sir; +@@ -241,25 +283,25 @@ make_firstlast( MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) + * threads. In fact it's harmless if we do get two writers, but we may + * avoid duplicating work. + */ +- g_mutex_lock( ovlap->fl_lock ); ++ g_mutex_lock(ovlap->fl_lock); + + /* Do we already have first/last for this area? Bail out if we do. + */ + missing = 0; +- for( x = oreg->left; x < VIPS_RECT_RIGHT( oreg ); x++ ) { ++ for (x = oreg->left; x < VIPS_RECT_RIGHT(oreg); x++) { + const int j = x - ovlap->overlap.left; + const int first = ovlap->first[j]; + +- if( first < 0 ) { ++ if (first < 0) { + missing = 1; + break; + } + } +- if( !missing ) { ++ if (!missing) { + /* No work to do! + */ +- g_mutex_unlock( ovlap->fl_lock ); +- return( 0 ); ++ g_mutex_unlock(ovlap->fl_lock); ++ return (0); + } + + /* Entire height of overlap in ref for oreg ... we know oreg is inside +@@ -283,30 +325,30 @@ make_firstlast( MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) + + /* Make pixels. + */ +- if( vips_region_prepare( rir, &rr ) || +- vips_region_prepare( sir, &sr ) ) { +- g_mutex_unlock( ovlap->fl_lock ); +- return( -1 ); ++ if (vips_region_prepare(rir, &rr) || ++ vips_region_prepare(sir, &sr)) { ++ g_mutex_unlock(ovlap->fl_lock); ++ return (-1); + } + + /* Make first/last cache. + */ +- for( x = 0; x < oreg->width; x++ ) { ++ for (x = 0; x < oreg->width; x++) { + const int j = (x + oreg->left) - ovlap->overlap.left; + int *first = &ovlap->first[j]; + int *last = &ovlap->last[j]; + + /* Done this line already? + */ +- if( *first < 0 ) { ++ if (*first < 0) { + /* Search for top/bottom of overlap on this scan-line. + */ +- if( find_top( sir, first, +- x + sr.left, sr.top, sr.height ) || +- find_bot( rir, last, +- x + rr.left, rr.top, rr.height ) ) { +- g_mutex_unlock( ovlap->fl_lock ); +- return( -1 ); ++ if (find_top(sir, first, ++ x + sr.left, sr.top, sr.height) || ++ find_bot(rir, last, ++ x + rr.left, rr.top, rr.height)) { ++ g_mutex_unlock(ovlap->fl_lock); ++ return (-1); + } + + /* Translate to output space. +@@ -316,8 +358,8 @@ make_firstlast( MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) + + /* Clip to maximum blend width, if necessary. + */ +- if( ovlap->mwidth >= 0 && +- *last - *first > ovlap->mwidth ) { ++ if (ovlap->mwidth >= 0 && ++ *last - *first > ovlap->mwidth) { + int shrinkby = (*last - *first) - ovlap->mwidth; + + *first += shrinkby / 2; +@@ -326,149 +368,150 @@ make_firstlast( MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) + } + } + +- g_mutex_unlock( ovlap->fl_lock ); ++ g_mutex_unlock(ovlap->fl_lock); + +- return( 0 ); ++ return (0); + } + + /* Test pixel == 0. + */ +-#define TEST_ZERO( TYPE, T, RESULT ) { \ +- TYPE *tt = (T); \ +- int ii; \ +- \ +- for( ii = 0; ii < cb; ii++ ) \ +- if( tt[i + ii] ) \ +- break; \ +- if( ii == cb ) \ +- (RESULT) = 1; \ +-} ++#define TEST_ZERO(TYPE, T, RESULT) \ ++ { \ ++ TYPE *tt = (T); \ ++ int ii; \ ++\ ++ for (ii = 0; ii < cb; ii++) \ ++ if (tt[i + ii]) \ ++ break; \ ++ if (ii == cb) \ ++ (RESULT) = 1; \ ++ } + + /* Blend two integer images ... one scan-line. + */ +-#define iblend( TYPE, B, IN1, IN2, OUT ) { \ +- TYPE *tr = (TYPE *) (IN1); \ +- TYPE *ts = (TYPE *) (IN2); \ +- TYPE *tq = (TYPE *) (OUT); \ +- const int cb = (B); \ +- int ref_zero; \ +- int sec_zero; \ +- int x, b; \ +- int i; \ +- \ +- for( i = 0, x = 0; x < oreg->width; x++ ) { \ +- ref_zero = 0; \ +- sec_zero = 0; \ +- TEST_ZERO( TYPE, tr, ref_zero ); \ +- TEST_ZERO( TYPE, ts, sec_zero ); \ +- \ +- /* Above the bottom image? \ +- */ \ +- if( y < first[x] ) { \ +- if( !ref_zero ) \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = tr[i]; \ +- else \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = ts[i]; \ +- } \ +- /* To the right? \ +- */ \ +- else if( y >= last[x] ) { \ +- if( !sec_zero ) \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = ts[i]; \ +- else \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = tr[i]; \ +- } \ +- /* In blend area. \ +- */ \ +- else { \ +- if( !ref_zero && !sec_zero ) { \ +- const int bheight = last[x] - first[x]; \ +- const int inx = ((y - first[x]) << \ +- BLEND_SHIFT) / bheight; \ +- int c1 = vips__icoef1[inx]; \ +- int c2 = vips__icoef2[inx]; \ +- \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = c1 * tr[i] / BLEND_SCALE + \ +- c2 * ts[i] / BLEND_SCALE; \ ++#define iblend(TYPE, B, IN1, IN2, OUT) \ ++ { \ ++ TYPE *tr = (TYPE *) (IN1); \ ++ TYPE *ts = (TYPE *) (IN2); \ ++ TYPE *tq = (TYPE *) (OUT); \ ++ const int cb = (B); \ ++ int ref_zero; \ ++ int sec_zero; \ ++ int x, b; \ ++ int i; \ ++\ ++ for (i = 0, x = 0; x < oreg->width; x++) { \ ++ ref_zero = 0; \ ++ sec_zero = 0; \ ++ TEST_ZERO(TYPE, tr, ref_zero); \ ++ TEST_ZERO(TYPE, ts, sec_zero); \ ++\ ++ /* Above the bottom image? \ ++ */ \ ++ if (y < first[x]) { \ ++ if (!ref_zero) \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = tr[i]; \ ++ else \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = ts[i]; \ + } \ +- else if( !ref_zero ) \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = tr[i]; \ +- else \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = ts[i]; \ +- } \ +- } \ +-} ++ /* To the right? \ ++ */ \ ++ else if (y >= last[x]) { \ ++ if (!sec_zero) \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = ts[i]; \ ++ else \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = tr[i]; \ ++ } \ ++ /* In blend area. \ ++ */ \ ++ else { \ ++ if (!ref_zero && !sec_zero) { \ ++ const int bheight = last[x] - first[x]; \ ++ const int inx = ((y - first[x]) << BLEND_SHIFT) / bheight; \ ++ int c1 = vips__icoef1[inx]; \ ++ int c2 = vips__icoef2[inx]; \ ++\ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = c1 * tr[i] / BLEND_SCALE + \ ++ c2 * ts[i] / BLEND_SCALE; \ ++ } \ ++ else if (!ref_zero) \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = tr[i]; \ ++ else \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = ts[i]; \ ++ } \ ++ } \ ++ } + + /* Blend two float images. + */ +-#define fblend( TYPE, B, IN1, IN2, OUT ) { \ +- TYPE *tr = (TYPE *) (IN1); \ +- TYPE *ts = (TYPE *) (IN2); \ +- TYPE *tq = (TYPE *) (OUT); \ +- int ref_zero; \ +- int sec_zero; \ +- const int cb = (B); \ +- int x, b; \ +- int i; \ +- \ +- for( i = 0, x = 0; x < oreg->width; x++ ) { \ +- ref_zero = 0; \ +- sec_zero = 0; \ +- TEST_ZERO( TYPE, tr, ref_zero ); \ +- TEST_ZERO( TYPE, ts, sec_zero ); \ +- \ +- /* Above the bottom image? \ +- */ \ +- if( y < first[x] ) \ +- if( !ref_zero ) \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = tr[i]; \ +- else \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = tr[i]; \ +- /* To the right? \ +- */ \ +- else if( y >= last[x] ) \ +- if( !sec_zero ) \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = ts[i]; \ +- else \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = tr[i]; \ +- /* In blend area. \ +- */ \ +- else { \ +- if( !ref_zero && !sec_zero ) { \ +- const int bheight = last[x] - first[x]; \ +- const int inx = ((y - first[x]) << \ +- BLEND_SHIFT) / bheight; \ +- double c1 = vips__coef1[inx]; \ +- double c2 = vips__coef2[inx]; \ +- \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = c1 * tr[i] + c2 * ts[i]; \ ++#define fblend(TYPE, B, IN1, IN2, OUT) \ ++ { \ ++ TYPE *tr = (TYPE *) (IN1); \ ++ TYPE *ts = (TYPE *) (IN2); \ ++ TYPE *tq = (TYPE *) (OUT); \ ++ int ref_zero; \ ++ int sec_zero; \ ++ const int cb = (B); \ ++ int x, b; \ ++ int i; \ ++\ ++ for (i = 0, x = 0; x < oreg->width; x++) { \ ++ ref_zero = 0; \ ++ sec_zero = 0; \ ++ TEST_ZERO(TYPE, tr, ref_zero); \ ++ TEST_ZERO(TYPE, ts, sec_zero); \ ++\ ++ /* Above the bottom image? \ ++ */ \ ++ if (y < first[x]) \ ++ if (!ref_zero) \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = tr[i]; \ ++ else \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = tr[i]; \ ++ /* To the right? \ ++ */ \ ++ else if (y >= last[x]) \ ++ if (!sec_zero) \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = ts[i]; \ ++ else \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = tr[i]; \ ++ /* In blend area. \ ++ */ \ ++ else { \ ++ if (!ref_zero && !sec_zero) { \ ++ const int bheight = last[x] - first[x]; \ ++ const int inx = ((y - first[x]) << BLEND_SHIFT) / bheight; \ ++ double c1 = vips__coef1[inx]; \ ++ double c2 = vips__coef2[inx]; \ ++\ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = c1 * tr[i] + c2 * ts[i]; \ ++ } \ ++ else if (!ref_zero) \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = tr[i]; \ ++ else \ ++ for (b = 0; b < cb; b++, i++) \ ++ tq[i] = ts[i]; \ + } \ +- else if( !ref_zero ) \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = tr[i]; \ +- else \ +- for( b = 0; b < cb; b++, i++ ) \ +- tq[i] = ts[i]; \ +- } \ +- } \ +-} ++ } \ ++ } + + /* Top-bottom blend function for non-labpack images. + */ + static int +-tb_blend( VipsRegion *or, MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) ++tb_blend(VipsRegion * or, MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg) + { + VipsRegion *rir = inf->rir; + VipsRegion *sir = inf->sir; +@@ -479,8 +522,8 @@ tb_blend( VipsRegion *or, MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) + + /* Make sure we have a complete first/last set for this area. + */ +- if( make_firstlast( inf, ovlap, oreg ) ) +- return( -1 ); ++ if (make_firstlast(inf, ovlap, oreg)) ++ return (-1); + + /* Part of rr which we will output. + */ +@@ -496,57 +539,67 @@ tb_blend( VipsRegion *or, MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) + + /* Make pixels. + */ +- if( vips_region_prepare( rir, &prr ) || +- vips_region_prepare( sir, &psr ) ) +- return( -1 ); ++ if (vips_region_prepare(rir, &prr) || ++ vips_region_prepare(sir, &psr)) ++ return (-1); + + /* Loop down overlap area. + */ +- for( y = oreg->top, yr = prr.top, ys = psr.top; +- y < VIPS_RECT_BOTTOM( oreg ); y++, yr++, ys++ ) { +- VipsPel *pr = VIPS_REGION_ADDR( rir, prr.left, yr ); +- VipsPel *ps = VIPS_REGION_ADDR( sir, psr.left, ys ); +- VipsPel *q = VIPS_REGION_ADDR( or, oreg->left, y ); ++ for (y = oreg->top, yr = prr.top, ys = psr.top; ++ y < VIPS_RECT_BOTTOM(oreg); y++, yr++, ys++) { ++ VipsPel *pr = VIPS_REGION_ADDR(rir, prr.left, yr); ++ VipsPel *ps = VIPS_REGION_ADDR(sir, psr.left, ys); ++ VipsPel *q = VIPS_REGION_ADDR(or, oreg->left, y); + + const int j = oreg->left - ovlap->overlap.left; + const int *first = ovlap->first + j; + const int *last = ovlap->last + j; + +- switch( im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- iblend( unsigned char, im->Bands, pr, ps, q ); break; +- case VIPS_FORMAT_CHAR: +- iblend( signed char, im->Bands, pr, ps, q ); break; +- case VIPS_FORMAT_USHORT: +- iblend( unsigned short, im->Bands, pr, ps, q ); break; +- case VIPS_FORMAT_SHORT: +- iblend( signed short, im->Bands, pr, ps, q ); break; +- case VIPS_FORMAT_UINT: +- iblend( unsigned int, im->Bands, pr, ps, q ); break; +- case VIPS_FORMAT_INT: +- iblend( signed int, im->Bands, pr, ps, q ); break; +- case VIPS_FORMAT_FLOAT: +- fblend( float, im->Bands, pr, ps, q ); break; +- case VIPS_FORMAT_DOUBLE: +- fblend( double, im->Bands, pr, ps, q ); break; ++ switch (im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ iblend(unsigned char, im->Bands, pr, ps, q); ++ break; ++ case VIPS_FORMAT_CHAR: ++ iblend(signed char, im->Bands, pr, ps, q); ++ break; ++ case VIPS_FORMAT_USHORT: ++ iblend(unsigned short, im->Bands, pr, ps, q); ++ break; ++ case VIPS_FORMAT_SHORT: ++ iblend(signed short, im->Bands, pr, ps, q); ++ break; ++ case VIPS_FORMAT_UINT: ++ iblend(unsigned int, im->Bands, pr, ps, q); ++ break; ++ case VIPS_FORMAT_INT: ++ iblend(signed int, im->Bands, pr, ps, q); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ fblend(float, im->Bands, pr, ps, q); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ fblend(double, im->Bands, pr, ps, q); ++ break; + case VIPS_FORMAT_COMPLEX: +- fblend( float, im->Bands * 2, pr, ps, q ); break; ++ fblend(float, im->Bands * 2, pr, ps, q); ++ break; + case VIPS_FORMAT_DPCOMPLEX: +- fblend( double, im->Bands * 2, pr, ps, q ); break; ++ fblend(double, im->Bands * 2, pr, ps, q); ++ break; + + default: +- vips_error( "vips_tbmerge", "%s", _( "internal error" ) ); +- return( -1 ); ++ vips_error("vips_tbmerge", "%s", _("internal error")); ++ return (-1); + } + } + +- return( 0 ); ++ return (0); + } + + /* Top-bottom blend function for VIPS_CODING_LABQ images. + */ + static int +-tb_blend_labpack( VipsRegion *or, MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg ) ++tb_blend_labpack(VipsRegion * or, MergeInfo *inf, Overlapping *ovlap, VipsRect *oreg) + { + VipsRegion *rir = inf->rir; + VipsRegion *sir = inf->sir; +@@ -556,8 +609,8 @@ tb_blend_labpack( VipsRegion *or, MergeInfo *inf, Overlapping *ovlap, VipsRect * + /* Make sure we have a complete first/last set for this area. This + * will just look at the top 8 bits of L, not all 10, but should be OK. + */ +- if( make_firstlast( inf, ovlap, oreg ) ) +- return( -1 ); ++ if (make_firstlast(inf, ovlap, oreg)) ++ return (-1); + + /* Part of rr which we will output. + */ +@@ -573,17 +626,17 @@ tb_blend_labpack( VipsRegion *or, MergeInfo *inf, Overlapping *ovlap, VipsRect * + + /* Make pixels. + */ +- if( vips_region_prepare( rir, &prr ) || +- vips_region_prepare( sir, &psr ) ) +- return( -1 ); ++ if (vips_region_prepare(rir, &prr) || ++ vips_region_prepare(sir, &psr)) ++ return (-1); + + /* Loop down overlap area. + */ +- for( y = oreg->top, yr = prr.top, ys = psr.top; +- y < VIPS_RECT_BOTTOM( oreg ); y++, yr++, ys++ ) { +- VipsPel *pr = VIPS_REGION_ADDR( rir, prr.left, yr ); +- VipsPel *ps = VIPS_REGION_ADDR( sir, psr.left, ys ); +- VipsPel *q = VIPS_REGION_ADDR( or, oreg->left, y ); ++ for (y = oreg->top, yr = prr.top, ys = psr.top; ++ y < VIPS_RECT_BOTTOM(oreg); y++, yr++, ys++) { ++ VipsPel *pr = VIPS_REGION_ADDR(rir, prr.left, yr); ++ VipsPel *ps = VIPS_REGION_ADDR(sir, psr.left, ys); ++ VipsPel *q = VIPS_REGION_ADDR(or, oreg->left, y); + + const int j = oreg->left - ovlap->overlap.left; + const int *first = ovlap->first + j; +@@ -595,35 +648,35 @@ tb_blend_labpack( VipsRegion *or, MergeInfo *inf, Overlapping *ovlap, VipsRect * + + /* Unpack two bits we want. + */ +- vips__LabQ2Lab_vec( r, pr, oreg->width ); +- vips__LabQ2Lab_vec( s, ps, oreg->width ); ++ vips__LabQ2Lab_vec(r, pr, oreg->width); ++ vips__LabQ2Lab_vec(s, ps, oreg->width); + + /* Blend as floats. + */ +- fblend( float, 3, r, s, fq ); ++ fblend(float, 3, r, s, fq); + + /* Re-pack to output buffer. + */ +- vips__Lab2LabQ_vec( q, inf->merge, oreg->width ); ++ vips__Lab2LabQ_vec(q, inf->merge, oreg->width); + } + +- return( 0 ); ++ return (0); + } + + /* Build per-call state. + */ + static Overlapping * +-build_tbstate( VipsImage *ref, VipsImage *sec, VipsImage *out, int dx, int dy, int mwidth ) ++build_tbstate(VipsImage *ref, VipsImage *sec, VipsImage *out, int dx, int dy, int mwidth) + { +- Overlapping *ovlap; ++ Overlapping *ovlap; + +- if( !(ovlap = vips__build_mergestate( "vips_tbmerge", +- ref, sec, out, dx, dy, mwidth )) ) +- return( NULL ); ++ if (!(ovlap = vips__build_mergestate("vips_tbmerge", ++ ref, sec, out, dx, dy, mwidth))) ++ return (NULL); + + /* Select blender. + */ +- switch( ovlap->ref->Coding ) { ++ switch (ovlap->ref->Coding) { + case VIPS_CODING_LABQ: + ovlap->blend = tb_blend_labpack; + break; +@@ -633,8 +686,8 @@ build_tbstate( VipsImage *ref, VipsImage *sec, VipsImage *out, int dx, int dy, i + break; + + default: +- vips_error( "vips_tbmerge", "%s", _( "unknown coding type" ) ); +- return( NULL ); ++ vips_error("vips_tbmerge", "%s", _("unknown coding type")); ++ return (NULL); + } + + /* Find the parts of output which come just from ref and just from sec. +@@ -649,66 +702,65 @@ build_tbstate( VipsImage *ref, VipsImage *sec, VipsImage *out, int dx, int dy, i + * than bottom edge of sec image, or top edge of ref > top edge of + * sec. + */ +- if( VIPS_RECT_BOTTOM( &ovlap->rarea ) > VIPS_RECT_BOTTOM( &ovlap->sarea ) || +- ovlap->rarea.top > ovlap->sarea.top ) { +- vips_error( "vips_tbmerge", "%s", _( "too much overlap" ) ); +- return( NULL ); ++ if (VIPS_RECT_BOTTOM(&ovlap->rarea) > VIPS_RECT_BOTTOM(&ovlap->sarea) || ++ ovlap->rarea.top > ovlap->sarea.top) { ++ vips_error("vips_tbmerge", "%s", _("too much overlap")); ++ return (NULL); + } + + /* Max number of pixels we may have to blend together. + */ + ovlap->blsize = ovlap->overlap.width; + +- return( ovlap ); ++ return (ovlap); + } + + int +-vips__tbmerge( VipsImage *ref, VipsImage *sec, VipsImage *out, +- int dx, int dy, int mwidth ) +-{ ++vips__tbmerge(VipsImage *ref, VipsImage *sec, VipsImage *out, ++ int dx, int dy, int mwidth) ++{ + Overlapping *ovlap; + +- if( dy > 0 || dy < 1 - ref->Ysize ) { ++ if (dy > 0 || dy < 1 - ref->Ysize) { + VipsImage *x; + + #ifdef DEBUG +- printf( "vips__tbmerge: no overlap, using insert\n" ); ++ printf("vips__tbmerge: no overlap, using insert\n"); + #endif + + /* No overlap, use insert instead. + */ +- if( vips_insert( ref, sec, &x, -dx, -dy, +- "expand", TRUE, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_insert(ref, sec, &x, -dx, -dy, ++ "expand", TRUE, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + + out->Xoffset = -dx; + out->Yoffset = -dy; + +- return( 0 ); ++ return (0); + } + +- if( !(ovlap = build_tbstate( ref, sec, out, dx, dy, mwidth )) ) +- return( -1 ); ++ if (!(ovlap = build_tbstate(ref, sec, out, dx, dy, mwidth))) ++ return (-1); + +- if( vips_image_pipelinev( out, +- VIPS_DEMAND_STYLE_THINSTRIP, ovlap->ref, ovlap->sec, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(out, ++ VIPS_DEMAND_STYLE_THINSTRIP, ovlap->ref, ovlap->sec, NULL)) ++ return (-1); + + out->Xsize = ovlap->oarea.width; + out->Ysize = ovlap->oarea.height; + out->Xoffset = -dx; + out->Yoffset = -dy; + +- if( vips_image_generate( out, +- vips__start_merge, vips__merge_gen, vips__stop_merge, ovlap, NULL ) ) +- return( -1 ); ++ if (vips_image_generate(out, ++ vips__start_merge, vips__merge_gen, vips__stop_merge, ovlap, NULL)) ++ return (-1); + +- return ( 0 ); ++ return (0); + } +- +diff --git a/libvips/mosaicing/tbmosaic.c b/libvips/mosaicing/tbmosaic.c +index 62322ad5e3..3283074285 100644 +--- a/libvips/mosaicing/tbmosaic.c ++++ b/libvips/mosaicing/tbmosaic.c +@@ -31,28 +31,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -69,29 +69,29 @@ + + #include "pmosaicing.h" + +-int +-vips__find_tboverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, +- int bandno_in, +- int xref, int yref, int xsec, int ysec, ++int ++vips__find_tboverlap(VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, ++ int bandno_in, ++ int xref, int yref, int xsec, int ysec, + int halfcorrelation, int halfarea, + int *dx0, int *dy0, +- double *scale1, double *angle1, double *dx1, double *dy1 ) ++ double *scale1, double *angle1, double *dx1, double *dy1) + { + VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( out ), 6 ); ++ vips_object_local_array(VIPS_OBJECT(out), 6); + + VipsRect top, bottom, overlap; +- TiePoints points, *p_points; /* defined in mosaic.h */ ++ TiePoints points, *p_points; /* defined in mosaic.h */ + TiePoints newpoints, *p_newpoints; + int i; + int dx, dy; + + /* Test cor and area. + */ +- if( halfcorrelation < 0 || halfarea < 0 || +- halfarea < halfcorrelation ) { +- vips_error( "vips__tbmosaic", "%s", _( "bad area parameters" ) ); +- return( -1 ); ++ if (halfcorrelation < 0 || halfarea < 0 || ++ halfarea < halfcorrelation) { ++ vips_error("vips__tbmosaic", "%s", _("bad area parameters")); ++ return (-1); + } + + /* Set positions of top and bottom. +@@ -107,43 +107,43 @@ vips__find_tboverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, + + /* Find overlap. + */ +- vips_rect_intersectrect( &top, &bottom, &overlap ); +- if( overlap.width < 2 * halfarea + 1 || +- overlap.height < 2 * halfarea + 1 ) { +- vips_error( "vips__tbmosaic", "%s", +- _( "overlap too small for search" ) ); +- return( -1 ); ++ vips_rect_intersectrect(&top, &bottom, &overlap); ++ if (overlap.width < 2 * halfarea + 1 || ++ overlap.height < 2 * halfarea + 1) { ++ vips_error("vips__tbmosaic", "%s", ++ _("overlap too small for search")); ++ return (-1); + } + + /* Extract overlaps as 8-bit, 1 band. + */ +- if( vips_extract_area( ref_in, &t[0], +- overlap.left, overlap.top, +- overlap.width, overlap.height, NULL ) || +- vips_extract_area( sec_in, &t[1], +- overlap.left - bottom.left, overlap.top - bottom.top, +- overlap.width, overlap.height, NULL ) ) +- return( -1 ); +- if( ref_in->Coding == VIPS_CODING_LABQ ) { +- if( vips_LabQ2sRGB( t[0], &t[2], NULL ) || +- vips_LabQ2sRGB( t[1], &t[3], NULL ) || +- vips_extract_band( t[2], &t[4], 1, NULL ) || +- vips_extract_band( t[3], &t[5], 1, NULL ) ) +- return( -1 ); ++ if (vips_extract_area(ref_in, &t[0], ++ overlap.left, overlap.top, ++ overlap.width, overlap.height, NULL) || ++ vips_extract_area(sec_in, &t[1], ++ overlap.left - bottom.left, overlap.top - bottom.top, ++ overlap.width, overlap.height, NULL)) ++ return (-1); ++ if (ref_in->Coding == VIPS_CODING_LABQ) { ++ if (vips_LabQ2sRGB(t[0], &t[2], NULL) || ++ vips_LabQ2sRGB(t[1], &t[3], NULL) || ++ vips_extract_band(t[2], &t[4], 1, NULL) || ++ vips_extract_band(t[3], &t[5], 1, NULL)) ++ return (-1); + } +- else if( ref_in->Coding == VIPS_CODING_NONE ) { +- if( vips_extract_band( t[0], &t[2], bandno_in, NULL ) || +- vips_extract_band( t[1], &t[3], bandno_in, NULL ) || +- vips_scale( t[2], &t[4], NULL ) || +- vips_scale( t[3], &t[5], NULL ) ) +- return( -1 ); ++ else if (ref_in->Coding == VIPS_CODING_NONE) { ++ if (vips_extract_band(t[0], &t[2], bandno_in, NULL) || ++ vips_extract_band(t[1], &t[3], bandno_in, NULL) || ++ vips_scale(t[2], &t[4], NULL) || ++ vips_scale(t[3], &t[5], NULL)) ++ return (-1); + } + else { +- vips_error( "vips__tbmosaic", "%s", _( "unknown Coding type" ) ); +- return( -1 ); ++ vips_error("vips__tbmosaic", "%s", _("unknown Coding type")); ++ return (-1); + } + +- /* Initialise and fill TiePoints ++ /* Initialise and fill TiePoints + */ + p_points = &points; + p_newpoints = &newpoints; +@@ -152,12 +152,12 @@ vips__find_tboverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, + p_points->nopoints = VIPS_MAXPOINTS; + p_points->deltax = 0; + p_points->deltay = 0; +- p_points->halfcorsize = halfcorrelation; ++ p_points->halfcorsize = halfcorrelation; + p_points->halfareasize = halfarea; + +- /* Initialise the structure ++ /* Initialise the structure + */ +- for( i = 0; i < VIPS_MAXPOINTS; i++ ) { ++ for (i = 0; i < VIPS_MAXPOINTS; i++) { + p_points->x_reference[i] = 0; + p_points->y_reference[i] = 0; + p_points->x_secondary[i] = 0; +@@ -169,33 +169,33 @@ vips__find_tboverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, + p_points->deviation[i] = 0.0; + } + +- /* Search ref for possible tie-points. Sets: p_points->contrast, ++ /* Search ref for possible tie-points. Sets: p_points->contrast, + * p_points->x,y_reference. +- */ +- if( vips__tbcalcon( t[4], p_points ) ) +- return( -1 ); ++ */ ++ if (vips__tbcalcon(t[4], p_points)) ++ return (-1); + + /* For each candidate point, correlate against corresponding part of + * sec. Sets x,y_secondary and fills correlation and dx, dy. +- */ +- if( vips__chkpair( t[4], t[5], p_points ) ) +- return( -1 ); ++ */ ++ if (vips__chkpair(t[4], t[5], p_points)) ++ return (-1); + + /* First call to vips_clinear(). + */ +- if( vips__initialize( p_points ) ) +- return( -1 ); ++ if (vips__initialize(p_points)) ++ return (-1); + +- /* Improve the selection of tiepoints until all abs(deviations) are ++ /* Improve the selection of tiepoints until all abs(deviations) are + * < 1.0 by deleting all wrong points. +- */ +- if( vips__improve( p_points, p_newpoints ) ) +- return( -1 ); ++ */ ++ if (vips__improve(p_points, p_newpoints)) ++ return (-1); + + /* Average remaining offsets. + */ +- if( vips__avgdxdy( p_newpoints, &dx, &dy ) ) +- return( -1 ); ++ if (vips__avgdxdy(p_newpoints, &dx, &dy)) ++ return (-1); + + /* Offset with overlap position. + */ +@@ -209,15 +209,15 @@ vips__find_tboverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out, + *dx1 = newpoints.l_deltax; + *dy1 = newpoints.l_deltay; + +- return( 0 ); ++ return (0); + } + +-int +-vips__tbmosaic( VipsImage *ref, VipsImage *sec, VipsImage *out, ++int ++vips__tbmosaic(VipsImage *ref, VipsImage *sec, VipsImage *out, + int bandno, +- int xref, int yref, int xsec, int ysec, ++ int xref, int yref, int xsec, int ysec, + int hwindowsize, int hsearchsize, +- int mwidth ) ++ int mwidth) + { + int dx0, dy0; + double scale1, angle1, dx1, dy1; +@@ -228,29 +228,28 @@ vips__tbmosaic( VipsImage *ref, VipsImage *sec, VipsImage *out, + * memory used by the analysis phase is freed as soon as possible. + */ + dummy = vips_image_new(); +- if( vips__find_tboverlap( ref, sec, dummy, +- bandno, +- xref, yref, xsec, ysec, +- hwindowsize, hsearchsize, +- &dx0, &dy0, +- &scale1, &angle1, &dx1, &dy1 ) ) { +- g_object_unref( dummy ); +- return( -1 ); ++ if (vips__find_tboverlap(ref, sec, dummy, ++ bandno, ++ xref, yref, xsec, ysec, ++ hwindowsize, hsearchsize, ++ &dx0, &dy0, ++ &scale1, &angle1, &dx1, &dy1)) { ++ g_object_unref(dummy); ++ return (-1); + } +- g_object_unref( dummy ); ++ g_object_unref(dummy); + + /* Merge top-bottom. + */ +- if( vips_merge( ref, sec, &x, VIPS_DIRECTION_VERTICAL, dx0, dy0, +- "mblend", mwidth, +- NULL ) ) +- return( -1 ); +- if( vips_image_write( x, out ) ) { +- g_object_unref( x ); +- return( -1 ); ++ if (vips_merge(ref, sec, &x, VIPS_DIRECTION_VERTICAL, dx0, dy0, ++ "mblend", mwidth, ++ NULL)) ++ return (-1); ++ if (vips_image_write(x, out)) { ++ g_object_unref(x); ++ return (-1); + } +- g_object_unref( x ); ++ g_object_unref(x); + +- return( 0 ); ++ return (0); + } +- +diff --git a/libvips/resample/affine.c b/libvips/resample/affine.c +index 7e739cdb3e..65ab1d8180 100644 +--- a/libvips/resample/affine.c ++++ b/libvips/resample/affine.c +@@ -45,11 +45,11 @@ + * - pre-calculate interpolation matricies + * - integer interpolation for int8/16 types, double for + * int32/float/double +- * - faster transformation ++ * - faster transformation + * 15/8/02 JC + * - records Xoffset/Yoffset + * 14/4/04 +- * - rounding, clipping and transforming revised, now pixel-perfect (or ++ * - rounding, clipping and transforming revised, now pixel-perfect (or + * better than gimp, anyway) + * 22/6/05 + * - all revised again, simpler and more reliable now +@@ -87,35 +87,35 @@ + * - add "extend" param + * - add "background" parameter + * - better clipping means we have no jaggies on edges +- * - premultiply alpha ++ * - premultiply alpha + * 18/5/20 + * - add "premultiplied" flag + */ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -176,75 +176,75 @@ typedef struct _VipsAffine { + + typedef VipsResampleClass VipsAffineClass; + +-G_DEFINE_TYPE( VipsAffine, vips_affine, VIPS_TYPE_RESAMPLE ); ++G_DEFINE_TYPE(VipsAffine, vips_affine, VIPS_TYPE_RESAMPLE); + + /* We have five (!!) coordinate systems. Working forward through them, these + * are: + * +- * 1. The original input image. iarea is defined on this image. ++ * 1. The original input image. iarea is defined on this image. + * + * 2. This is embedded in a larger image to provide borders for the +- * interpolator. window_offset and window_size control the embedding. ++ * interpolator. window_offset and window_size control the embedding. + * These are the coordinates we pass to VIPS_REGION_ADDR()/ + * vips_region_prepare() and the interpolator. + * +- * The borders are sized by the interpolator's window_size property and offset ++ * The borders are sized by the interpolator's window_size property and offset + * by the interpolator's window_offset property. For example, +- * for bilinear (window_size 2, window_offset 0) we add a single line +- * of extra pixels along the bottom and right (window_size - 1). For +- * bicubic (window_size 4, window_offset 1) we add a single line top and left ++ * for bilinear (window_size 2, window_offset 0) we add a single line ++ * of extra pixels along the bottom and right (window_size - 1). For ++ * bicubic (window_size 4, window_offset 1) we add a single line top and left + * (window_offset), and two lines bottom and right (window_size - 1 - + * window_offset). + * + * 3. We need point (0, 0) in (1) to be at (0, 0) for the transformation. So + * shift everything up and left to make the displaced input image. This is the +- * space that the transformation maps from, and can have negative pixels ++ * space that the transformation maps from, and can have negative pixels + * (up and left of the image, for interpolation). iarea works here too. + * + * 4. Output transform space. This is the where the transform maps to. Pixels + * can be negative, since a rotated image can go up and left of the origin. + * + * 5. Output image space. This is the wh of the xywh passed to vips_affine() +- * below. These are the coordinates we pass to VIPS_REGION_ADDR() for the ++ * below. These are the coordinates we pass to VIPS_REGION_ADDR() for the + * output image, and that affinei_gen() is asked for. + */ + + static int +-vips_affine_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop ) ++vips_affine_gen(VipsRegion * or, void *seq, void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) seq; + const VipsAffine *affine = (VipsAffine *) b; + const VipsImage *in = (VipsImage *) a; +- const int window_size = +- vips_interpolate_get_window_size( affine->interpolate ); +- const int window_offset = +- vips_interpolate_get_window_offset( affine->interpolate ); +- const VipsInterpolateMethod interpolate = +- vips_interpolate_get_method( affine->interpolate ); ++ const int window_size = ++ vips_interpolate_get_window_size(affine->interpolate); ++ const int window_offset = ++ vips_interpolate_get_window_offset(affine->interpolate); ++ const VipsInterpolateMethod interpolate = ++ vips_interpolate_get_method(affine->interpolate); + + /* Area we generate in the output image. + */ +- const VipsRect *r = &or->valid; ++ const VipsRect *r = & or->valid; + const int le = r->left; +- const int ri = VIPS_RECT_RIGHT( r ); ++ const int ri = VIPS_RECT_RIGHT(r); + const int to = r->top; +- const int bo = VIPS_RECT_BOTTOM( r ); ++ const int bo = VIPS_RECT_BOTTOM(r); + + const VipsRect *iarea = &affine->trn.iarea; + const VipsRect *oarea = &affine->trn.oarea; + +- int ps = VIPS_IMAGE_SIZEOF_PEL( in ); ++ int ps = VIPS_IMAGE_SIZEOF_PEL(in); + int x, y, z; +- ++ + VipsRect image, want, need, clipped; + + #ifdef DEBUG_VERBOSE +- printf( "vips_affine_gen: " +- "generating left=%d, top=%d, width=%d, height=%d\n", ++ printf("vips_affine_gen: " ++ "generating left=%d, top=%d, width=%d, height=%d\n", + r->left, + r->top, + r->width, +- r->height ); ++ r->height); + #endif /*DEBUG_VERBOSE*/ + + /* We are generating this chunk of the transformed image. This takes +@@ -254,18 +254,18 @@ vips_affine_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop ) + want.left += oarea->left; + want.top += oarea->top; + +- /* Find the area of the input image we need. This takes us to space 3. ++ /* Find the area of the input image we need. This takes us to space 3. + */ +- vips__transform_invert_rect( &affine->trn, &want, &need ); ++ vips__transform_invert_rect(&affine->trn, &want, &need); + + /* That does round-to-nearest, because it has to stop rounding errors + * growing images unexpectedly. We need round-down, so we must + * add half a pixel along the left and top. But we are int :( so add 1 +- * pixel. ++ * pixel. + * + * Add an extra line along the right and bottom as well, for rounding. + */ +- vips_rect_marginadjust( &need, 1 ); ++ vips_rect_marginadjust(&need, 1); + + /* We need to fetch a larger area for the interpolator. + */ +@@ -275,7 +275,7 @@ vips_affine_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop ) + need.height += window_size - 1; + + /* Now go to space 2, the expanded input image. This is the one we +- * read pixels from. ++ * read pixels from. + */ + need.left += window_offset; + need.top += window_offset; +@@ -286,31 +286,31 @@ vips_affine_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop ) + image.top = 0; + image.width = in->Xsize; + image.height = in->Ysize; +- vips_rect_intersectrect( &need, &image, &clipped ); ++ vips_rect_intersectrect(&need, &image, &clipped); + + #ifdef DEBUG_VERBOSE +- printf( "vips_affine_gen: " +- "preparing left=%d, top=%d, width=%d, height=%d\n", ++ printf("vips_affine_gen: " ++ "preparing left=%d, top=%d, width=%d, height=%d\n", + clipped.left, + clipped.top, + clipped.width, +- clipped.height ); ++ clipped.height); + #endif /*DEBUG_VERBOSE*/ + +- if( vips_rect_isempty( &clipped ) ) { +- vips_region_paint_pel( or, r, affine->ink ); +- return( 0 ); ++ if (vips_rect_isempty(&clipped)) { ++ vips_region_paint_pel(or, r, affine->ink); ++ return (0); + } +- if( vips_region_prepare( ir, &clipped ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &clipped)) ++ return (-1); + +- VIPS_GATE_START( "vips_affine_gen: work" ); ++ VIPS_GATE_START("vips_affine_gen: work"); + + /* Resample! x/y loop over pixels in the output image (5). + */ +- for( y = to; y < bo; y++ ) { ++ for (y = to; y < bo; y++) { + /* Input clipping rectangle. We offset this so we can clip in +- * space 2. ++ * space 2. + */ + const int ile = iarea->left + window_offset; + const int ito = iarea->top + window_offset; +@@ -338,48 +338,48 @@ vips_affine_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop ) + ix = affine->trn.ia * ox + affine->trn.ib * oy; + iy = affine->trn.ic * ox + affine->trn.id * oy; + +- /* And the input offset in (3). ++ /* And the input offset in (3). + */ + ix -= affine->trn.idx; + iy -= affine->trn.idy; + +- /* Finally to 2. ++ /* Finally to 2. + */ + ix += window_offset; + iy += window_offset; + +- q = VIPS_REGION_ADDR( or, le, y ); ++ q = VIPS_REGION_ADDR(or, le, y); + +- for( x = le; x < ri; x++ ) { +- int fx, fy; ++ for (x = le; x < ri; x++) { ++ int fx, fy; + +- fx = VIPS_FLOOR( ix ); +- fy = VIPS_FLOOR( iy ); ++ fx = VIPS_FLOOR(ix); ++ fy = VIPS_FLOOR(iy); + + /* Clip against iarea. + */ +- if( fx >= ile && ++ if (fx >= ile && + fx <= iri && + fy >= ito && +- fy <= ibo ) { ++ fy <= ibo) { + /* Verify that we can read the whole stencil. + * With DEBUG on this will range-check. + */ +- g_assert( VIPS_REGION_ADDR( ir, ++ g_assert(VIPS_REGION_ADDR(ir, + (int) ix - window_offset, +- (int) iy - window_offset ) ); +- g_assert( VIPS_REGION_ADDR( ir, +- (int) ix - window_offset + ++ (int) iy - window_offset)); ++ g_assert(VIPS_REGION_ADDR(ir, ++ (int) ix - window_offset + + window_size - 1, +- (int) iy - window_offset + +- window_size - 1 ) ); ++ (int) iy - window_offset + ++ window_size - 1)); + +- interpolate( affine->interpolate, q, ir, ix, iy ); ++ interpolate(affine->interpolate, q, ir, ix, iy); + } + else { + /* Out of range: paint the background. + */ +- for( z = 0; z < ps; z++ ) ++ for (z = 0; z < ps; z++) + q[z] = affine->ink[z]; + } + +@@ -389,23 +389,23 @@ vips_affine_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop ) + } + } + +- VIPS_GATE_STOP( "vips_affine_gen: work" ); ++ VIPS_GATE_STOP("vips_affine_gen: work"); + +- VIPS_COUNT_PIXELS( or, "vips_affine_gen" ); ++ VIPS_COUNT_PIXELS(or, "vips_affine_gen"); + +- return( 0 ); ++ return (0); + } + + static int +-vips_affine_build( VipsObject *object ) ++vips_affine_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsResample *resample = VIPS_RESAMPLE( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsResample *resample = VIPS_RESAMPLE(object); + VipsAffine *affine = (VipsAffine *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 7 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 7); + + VipsImage *in; +- VipsDemandStyle hint; ++ VipsDemandStyle hint; + int window_size; + int window_offset; + double edge; +@@ -415,32 +415,32 @@ vips_affine_build( VipsObject *object ) + gboolean have_premultiplied; + VipsBandFormat unpremultiplied_format; + +- if( VIPS_OBJECT_CLASS( vips_affine_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_affine_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_coding_known( class->nickname, resample->in ) ) +- return( -1 ); +- if( vips_check_vector_length( class->nickname, +- affine->matrix->n, 4 ) ) +- return( -1 ); +- if( vips_object_argument_isset( object, "oarea" ) && +- vips_check_vector_length( class->nickname, +- affine->oarea->n, 4 ) ) +- return( -1 ); ++ if (vips_check_coding_known(class->nickname, resample->in)) ++ return (-1); ++ if (vips_check_vector_length(class->nickname, ++ affine->matrix->n, 4)) ++ return (-1); ++ if (vips_object_argument_isset(object, "oarea") && ++ vips_check_vector_length(class->nickname, ++ affine->oarea->n, 4)) ++ return (-1); + +- /* Can be set explicitly to NULL to mean default setting. ++ /* Can be set explicitly to NULL to mean default setting. + */ +- if( !affine->interpolate ) +- affine->interpolate = vips_interpolate_new( "bilinear" ); ++ if (!affine->interpolate) ++ affine->interpolate = vips_interpolate_new("bilinear"); + + in = resample->in; + + /* Set up transform. + */ + +- window_size = vips_interpolate_get_window_size( affine->interpolate ); +- window_offset = +- vips_interpolate_get_window_offset( affine->interpolate ); ++ window_size = vips_interpolate_get_window_size(affine->interpolate); ++ window_offset = ++ vips_interpolate_get_window_offset(affine->interpolate); + + affine->trn.iarea.left = 0; + affine->trn.iarea.top = 0; +@@ -455,72 +455,72 @@ vips_affine_build( VipsObject *object ) + affine->trn.odx = 0; + affine->trn.ody = 0; + +- if( vips__transform_calc_inverse( &affine->trn ) ) +- return( -1 ); ++ if (vips__transform_calc_inverse(&affine->trn)) ++ return (-1); + + /* Set the default value for oarea. + */ +- vips__transform_set_area( &affine->trn ); ++ vips__transform_set_area(&affine->trn); + +- if( vips_object_argument_isset( object, "oarea" ) ) { ++ if (vips_object_argument_isset(object, "oarea")) { + affine->trn.oarea.left = ((int *) affine->oarea->data)[0]; + affine->trn.oarea.top = ((int *) affine->oarea->data)[1]; + affine->trn.oarea.width = ((int *) affine->oarea->data)[2]; + affine->trn.oarea.height = ((int *) affine->oarea->data)[3]; + } + +- if( vips_object_argument_isset( object, "odx" ) ) ++ if (vips_object_argument_isset(object, "odx")) + affine->trn.odx = affine->odx; +- if( vips_object_argument_isset( object, "ody" ) ) ++ if (vips_object_argument_isset(object, "ody")) + affine->trn.ody = affine->ody; + +- if( vips_object_argument_isset( object, "idx" ) ) ++ if (vips_object_argument_isset(object, "idx")) + affine->trn.idx = affine->idx; +- if( vips_object_argument_isset( object, "idy" ) ) ++ if (vips_object_argument_isset(object, "idy")) + affine->trn.idy = affine->idy; + + #ifdef DEBUG +- printf( "vips_affine_build: copy on identity transform disabled\n" ); +-#else /*!DEBUG*/ +- if( vips__transform_isidentity( &affine->trn ) && ++ printf("vips_affine_build: copy on identity transform disabled\n"); ++#else /*!DEBUG*/ ++ if (vips__transform_isidentity(&affine->trn) && + affine->trn.oarea.left == 0 && + affine->trn.oarea.top == 0 && + affine->trn.oarea.width == in->Xsize && +- affine->trn.oarea.height == in->Ysize ) +- return( vips_image_write( in, resample->out ) ); ++ affine->trn.oarea.height == in->Ysize) ++ return (vips_image_write(in, resample->out)); + #endif /*!DEBUG*/ + + /* Check for coordinate overflow ... we want to be able to hold the + * output space inside INT_MAX / TRANSFORM_SCALE. + */ + edge = (int) (INT_MAX / VIPS_TRANSFORM_SCALE); +- if( affine->trn.oarea.left < -edge || ++ if (affine->trn.oarea.left < -edge || + affine->trn.oarea.top < -edge || +- VIPS_RECT_RIGHT( &affine->trn.oarea ) > edge || +- VIPS_RECT_BOTTOM( &affine->trn.oarea ) > edge ) { +- vips_error( class->nickname, +- "%s", _( "output coordinates out of range" ) ); +- return( -1 ); ++ VIPS_RECT_RIGHT(&affine->trn.oarea) > edge || ++ VIPS_RECT_BOTTOM(&affine->trn.oarea) > edge) { ++ vips_error(class->nickname, ++ "%s", _("output coordinates out of range")); ++ return (-1); + } + +- if( vips_image_decode( in, &t[0] ) ) +- return( -1 ); ++ if (vips_image_decode(in, &t[0])) ++ return (-1); + in = t[0]; + + /* Add new pixels around the input so we can interpolate at the edges. + * + * We add the interpolate stencil, plus one extra pixel on all the +- * edges. This means when we clip in generate (above) we can be sure ++ * edges. This means when we clip in generate (above) we can be sure + * we clip outside the real pixels and don't get jaggies on edges. + */ +- if( vips_embed( in, &t[2], +- window_offset + 1, window_offset + 1, +- in->Xsize + window_size - 1 + 2, +- in->Ysize + window_size - 1 + 2, +- "extend", affine->extend, +- "background", affine->background, +- NULL ) ) +- return( -1 ); ++ if (vips_embed(in, &t[2], ++ window_offset + 1, window_offset + 1, ++ in->Xsize + window_size - 1 + 2, ++ in->Ysize + window_size - 1 + 2, ++ "extend", affine->extend, ++ "background", affine->background, ++ NULL)) ++ return (-1); + in = t[2]; + + /* We've added a one-pixel border to the input: displace the transform +@@ -529,15 +529,15 @@ vips_affine_build( VipsObject *object ) + affine->trn.idx -= 1; + affine->trn.idy -= 1; + +- /* If there's an alpha and we've not premultiplied, we have to +- * premultiply before resampling. See ++ /* If there's an alpha and we've not premultiplied, we have to ++ * premultiply before resampling. See + * https://github.com/libvips/libvips/issues/291 + */ + have_premultiplied = FALSE; +- if( vips_image_hasalpha( in ) && +- !affine->premultiplied ) { +- if( vips_premultiply( in, &t[3], NULL ) ) +- return( -1 ); ++ if (vips_image_hasalpha(in) && ++ !affine->premultiplied) { ++ if (vips_premultiply(in, &t[3], NULL)) ++ return (-1); + have_premultiplied = TRUE; + + /* vips_premultiply() makes a float image. When we +@@ -550,45 +550,45 @@ vips_affine_build( VipsObject *object ) + + /* Convert the background to the image's format. + */ +- if( !(affine->ink = vips__vector_to_ink( class->nickname, +- in, +- VIPS_AREA( affine->background )->data, NULL, +- VIPS_AREA( affine->background )->n )) ) +- return( -1 ); ++ if (!(affine->ink = vips__vector_to_ink(class->nickname, ++ in, ++ VIPS_AREA(affine->background)->data, NULL, ++ VIPS_AREA(affine->background)->n))) ++ return (-1); + +- /* Normally SMALLTILE ... except if this is strictly a size ++ /* Normally SMALLTILE ... except if this is strictly a size + * up/down affine. + */ +- if( affine->trn.b == 0.0 && +- affine->trn.c == 0.0 ) +- hint = VIPS_DEMAND_STYLE_FATSTRIP; +- else ++ if (affine->trn.b == 0.0 && ++ affine->trn.c == 0.0) ++ hint = VIPS_DEMAND_STYLE_FATSTRIP; ++ else + hint = VIPS_DEMAND_STYLE_SMALLTILE; + + t[4] = vips_image_new(); +- if( vips_image_pipelinev( t[4], hint, in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(t[4], hint, in, NULL)) ++ return (-1); + + t[4]->Xsize = affine->trn.oarea.width; + t[4]->Ysize = affine->trn.oarea.height; + + #ifdef DEBUG +- printf( "vips_affine_build: transform: " ); +- vips__transform_print( &affine->trn ); +- printf( " window_offset = %d, window_size = %d\n", +- window_offset, window_size ); +- printf( " input image width = %d, height = %d\n", +- in->Xsize, in->Ysize ); +- printf( " output image width = %d, height = %d\n", +- t[4]->Xsize, t[4]->Ysize ); ++ printf("vips_affine_build: transform: "); ++ vips__transform_print(&affine->trn); ++ printf(" window_offset = %d, window_size = %d\n", ++ window_offset, window_size); ++ printf(" input image width = %d, height = %d\n", ++ in->Xsize, in->Ysize); ++ printf(" output image width = %d, height = %d\n", ++ t[4]->Xsize, t[4]->Ysize); + #endif /*DEBUG*/ + + /* Generate! + */ +- if( vips_image_generate( t[4], +- vips_start_one, vips_affine_gen, vips_stop_one, +- in, affine ) ) +- return( -1 ); ++ if (vips_image_generate(t[4], ++ vips_start_one, vips_affine_gen, vips_stop_one, ++ in, affine)) ++ return (-1); + + /* Finally: can now set Xoffset/Yoffset. + */ +@@ -597,110 +597,109 @@ vips_affine_build( VipsObject *object ) + + in = t[4]; + +- if( have_premultiplied ) { +- if( vips_unpremultiply( in, &t[5], NULL ) || +- vips_cast( t[5], &t[6], unpremultiplied_format, NULL ) ) +- return( -1 ); ++ if (have_premultiplied) { ++ if (vips_unpremultiply(in, &t[5], NULL) || ++ vips_cast(t[5], &t[6], unpremultiplied_format, NULL)) ++ return (-1); + in = t[6]; + } + +- if( vips_image_write( in, resample->out ) ) +- return( -1 ); ++ if (vips_image_write(in, resample->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_affine_class_init( VipsAffineClass *class ) ++vips_affine_class_init(VipsAffineClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_affine_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_affine_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "affine"; +- vobject_class->description = _( "affine transform of an image" ); ++ vobject_class->description = _("affine transform of an image"); + vobject_class->build = vips_affine_build; + +- VIPS_ARG_BOXED( class, "matrix", 110, +- _( "Matrix" ), +- _( "Transformation matrix" ), ++ VIPS_ARG_BOXED(class, "matrix", 110, ++ _("Matrix"), ++ _("Transformation matrix"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsAffine, matrix ), +- VIPS_TYPE_ARRAY_DOUBLE ); +- +- VIPS_ARG_INTERPOLATE( class, "interpolate", 2, +- _( "Interpolate" ), +- _( "Interpolate pixels with this" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsAffine, interpolate ) ); +- +- VIPS_ARG_BOXED( class, "oarea", 111, +- _( "Output rect" ), +- _( "Area of output to generate" ), ++ G_STRUCT_OFFSET(VipsAffine, matrix), ++ VIPS_TYPE_ARRAY_DOUBLE); ++ ++ VIPS_ARG_INTERPOLATE(class, "interpolate", 2, ++ _("Interpolate"), ++ _("Interpolate pixels with this"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsAffine, oarea ), +- VIPS_TYPE_ARRAY_INT ); ++ G_STRUCT_OFFSET(VipsAffine, interpolate)); + +- VIPS_ARG_DOUBLE( class, "odx", 112, +- _( "Output offset" ), +- _( "Horizontal output displacement" ), ++ VIPS_ARG_BOXED(class, "oarea", 111, ++ _("Output rect"), ++ _("Area of output to generate"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsAffine, odx ), +- -10000000, 10000000, 0 ); ++ G_STRUCT_OFFSET(VipsAffine, oarea), ++ VIPS_TYPE_ARRAY_INT); + +- VIPS_ARG_DOUBLE( class, "ody", 113, +- _( "Output offset" ), +- _( "Vertical output displacement" ), ++ VIPS_ARG_DOUBLE(class, "odx", 112, ++ _("Output offset"), ++ _("Horizontal output displacement"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsAffine, ody ), +- -10000000, 10000000, 0 ); ++ G_STRUCT_OFFSET(VipsAffine, odx), ++ -10000000, 10000000, 0); + +- VIPS_ARG_DOUBLE( class, "idx", 114, +- _( "Input offset" ), +- _( "Horizontal input displacement" ), ++ VIPS_ARG_DOUBLE(class, "ody", 113, ++ _("Output offset"), ++ _("Vertical output displacement"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsAffine, idx ), +- -10000000, 10000000, 0 ); ++ G_STRUCT_OFFSET(VipsAffine, ody), ++ -10000000, 10000000, 0); + +- VIPS_ARG_DOUBLE( class, "idy", 115, +- _( "Input offset" ), +- _( "Vertical input displacement" ), ++ VIPS_ARG_DOUBLE(class, "idx", 114, ++ _("Input offset"), ++ _("Horizontal input displacement"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsAffine, idy ), +- -10000000, 10000000, 0 ); ++ G_STRUCT_OFFSET(VipsAffine, idx), ++ -10000000, 10000000, 0); + +- VIPS_ARG_ENUM( class, "extend", 117, +- _( "Extend" ), +- _( "How to generate the extra pixels" ), ++ VIPS_ARG_DOUBLE(class, "idy", 115, ++ _("Input offset"), ++ _("Vertical input displacement"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsAffine, extend ), +- VIPS_TYPE_EXTEND, VIPS_EXTEND_BACKGROUND ); ++ G_STRUCT_OFFSET(VipsAffine, idy), ++ -10000000, 10000000, 0); + +- VIPS_ARG_BOXED( class, "background", 116, +- _( "Background" ), +- _( "Background value" ), ++ VIPS_ARG_ENUM(class, "extend", 117, ++ _("Extend"), ++ _("How to generate the extra pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsAffine, background ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsAffine, extend), ++ VIPS_TYPE_EXTEND, VIPS_EXTEND_BACKGROUND); + +- VIPS_ARG_BOOL( class, "premultiplied", 117, +- _( "Premultiplied" ), +- _( "Images have premultiplied alpha" ), ++ VIPS_ARG_BOXED(class, "background", 116, ++ _("Background"), ++ _("Background value"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsAffine, premultiplied ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsAffine, background), ++ VIPS_TYPE_ARRAY_DOUBLE); + ++ VIPS_ARG_BOOL(class, "premultiplied", 117, ++ _("Premultiplied"), ++ _("Images have premultiplied alpha"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsAffine, premultiplied), ++ FALSE); + } + + static void +-vips_affine_init( VipsAffine *affine ) ++vips_affine_init(VipsAffine *affine) + { + affine->extend = VIPS_EXTEND_BACKGROUND; +- affine->background = vips_array_double_newv( 1, 0.0 ); ++ affine->background = vips_array_double_newv(1, 0.0); + } + + /** +@@ -721,8 +720,8 @@ vips_affine_init( VipsAffine *affine ) + * * @idy: %gdouble, input vertical offset + * * @odx: %gdouble, output horizontal offset + * * @ody: %gdouble, output vertical offset +- * * @extend: #VipsExtend how to generate new pixels +- * * @background: #VipsArrayDouble colour for new pixels ++ * * @extend: #VipsExtend how to generate new pixels ++ * * @background: #VipsArrayDouble colour for new pixels + * * @premultiplied: %gboolean, images are already premultiplied + * + * This operator performs an affine transform on an image using @interpolate. +@@ -732,52 +731,52 @@ vips_affine_init( VipsAffine *affine ) + * |[ + * X = @a * (x + @idx) + @b * (y + @idy) + @odx + * Y = @c * (x + @idx) + @d * (y + @idy) + @doy +- * +- * where: +- * x and y are the coordinates in input image. ++ * ++ * where: ++ * x and y are the coordinates in input image. + * X and Y are the coordinates in output image. + * (0,0) is the upper left corner. + * ]| + * + * The section of the output space defined by @oarea is written to +- * @out. @oarea is a four-element int array of left, top, width, height. +- * By default @oarea is just large enough to cover the whole of the ++ * @out. @oarea is a four-element int array of left, top, width, height. ++ * By default @oarea is just large enough to cover the whole of the + * transformed input image. + * +- * By default, new pixels are filled with @background. This defaults to +- * zero (black). You can set other extend types with @extend. #VIPS_EXTEND_COPY ++ * By default, new pixels are filled with @background. This defaults to ++ * zero (black). You can set other extend types with @extend. #VIPS_EXTEND_COPY + * is better for image upsizing. + * +- * @interpolate defaults to bilinear. ++ * @interpolate defaults to bilinear. + * + * @idx, @idy, @odx, @ody default to zero. + * + * Image are normally treated as unpremultiplied, so this operation can be used + * directly on PNG images. If your images have been through vips_premultiply(), +- * set @premultiplied. ++ * set @premultiplied. + * + * This operation does not change xres or yres. The image resolution needs to +- * be updated by the application. ++ * be updated by the application. + * + * See also: vips_shrink(), vips_resize(), #VipsInterpolate. + * + * Returns: 0 on success, -1 on error + */ + int +-vips_affine( VipsImage *in, VipsImage **out, +- double a, double b, double c, double d, ... ) ++vips_affine(VipsImage *in, VipsImage **out, ++ double a, double b, double c, double d, ...) + { + va_list ap; + VipsArea *matrix; + int result; + +- matrix = VIPS_AREA( vips_array_double_newv( 4, a, b, c, d ) ); ++ matrix = VIPS_AREA(vips_array_double_newv(4, a, b, c, d)); + +- va_start( ap, d ); +- result = vips_call_split( "affine", ap, in, out, matrix ); +- va_end( ap ); ++ va_start(ap, d); ++ result = vips_call_split("affine", ap, in, out, matrix); ++ va_end(ap); + +- vips_area_unref( matrix ); ++ vips_area_unref(matrix); + +- return( result ); ++ return (result); + } +diff --git a/libvips/resample/bicubic.cpp b/libvips/resample/bicubic.cpp +index ca6e37e659..76dda33257 100644 +--- a/libvips/resample/bicubic.cpp ++++ b/libvips/resample/bicubic.cpp +@@ -8,28 +8,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -56,19 +56,19 @@ + + #define VIPS_TYPE_INTERPOLATE_BICUBIC \ + (vips_interpolate_bicubic_get_type()) +-#define VIPS_INTERPOLATE_BICUBIC( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_INTERPOLATE_BICUBIC, VipsInterpolateBicubic )) +-#define VIPS_INTERPOLATE_BICUBIC_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_INTERPOLATE_BICUBIC, VipsInterpolateBicubicClass)) +-#define VIPS_IS_INTERPOLATE_BICUBIC( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_INTERPOLATE_BICUBIC )) +-#define VIPS_IS_INTERPOLATE_BICUBIC_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_INTERPOLATE_BICUBIC )) +-#define VIPS_INTERPOLATE_BICUBIC_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_INTERPOLATE_BICUBIC, VipsInterpolateBicubicClass )) ++#define VIPS_INTERPOLATE_BICUBIC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_INTERPOLATE_BICUBIC, VipsInterpolateBicubic)) ++#define VIPS_INTERPOLATE_BICUBIC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_INTERPOLATE_BICUBIC, VipsInterpolateBicubicClass)) ++#define VIPS_IS_INTERPOLATE_BICUBIC(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_INTERPOLATE_BICUBIC)) ++#define VIPS_IS_INTERPOLATE_BICUBIC_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_INTERPOLATE_BICUBIC)) ++#define VIPS_INTERPOLATE_BICUBIC_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_INTERPOLATE_BICUBIC, VipsInterpolateBicubicClass)) + + typedef VipsInterpolate VipsInterpolateBicubic; + +@@ -89,8 +89,8 @@ static double vips_bicubic_matrixf[VIPS_TRANSFORM_SCALE + 1][4]; + /* We need C linkage for this. + */ + extern "C" { +-G_DEFINE_TYPE( VipsInterpolateBicubic, vips_interpolate_bicubic, +- VIPS_TYPE_INTERPOLATE ); ++G_DEFINE_TYPE(VipsInterpolateBicubic, vips_interpolate_bicubic, ++ VIPS_TYPE_INTERPOLATE); + } + + /* Pointers to write to / read from, number of bands, +@@ -104,33 +104,32 @@ G_DEFINE_TYPE( VipsInterpolateBicubic, vips_interpolate_bicubic, + */ + + template +-static void inline +-bicubic_unsigned_int_tab( void *pout, const VipsPel *pin, ++static void inline bicubic_unsigned_int_tab(void *pout, const VipsPel *pin, + const int bands, const int lskip, +- const int *cx, const int *cy ) ++ const int *cx, const int *cy) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + + const int b1 = bands; + const int b2 = b1 + b1; + const int b3 = b1 + b2; + +- const int l1 = lskip / sizeof( T ); ++ const int l1 = lskip / sizeof(T); + const int l2 = l1 + l1; + const int l3 = l1 + l2; + +- const int l1_plus_b1 = l1 + b1; +- const int l1_plus_b2 = l1 + b2; +- const int l1_plus_b3 = l1 + b3; +- const int l2_plus_b1 = l2 + b1; +- const int l2_plus_b2 = l2 + b2; +- const int l2_plus_b3 = l2 + b3; +- const int l3_plus_b1 = l3 + b1; +- const int l3_plus_b2 = l3 + b2; +- const int l3_plus_b3 = l3 + b3; +- +- for( int z = 0; z < bands; z++ ) { ++ const int l1_plus_b1 = l1 + b1; ++ const int l1_plus_b2 = l1 + b2; ++ const int l1_plus_b3 = l1 + b3; ++ const int l2_plus_b1 = l2 + b1; ++ const int l2_plus_b2 = l2 + b2; ++ const int l2_plus_b3 = l2 + b3; ++ const int l3_plus_b1 = l3 + b1; ++ const int l3_plus_b2 = l3 + b2; ++ const int l3_plus_b3 = l3 + b3; ++ ++ for (int z = 0; z < bands; z++) { + const T uno_one = in[0]; + const T uno_two = in[b1]; + const T uno_thr = in[b2]; +@@ -156,9 +155,9 @@ bicubic_unsigned_int_tab( void *pout, const VipsPel *pin, + dos_one, dos_two, dos_thr, dos_fou, + tre_one, tre_two, tre_thr, tre_fou, + qua_one, qua_two, qua_thr, qua_fou, +- cx, cy ); ++ cx, cy); + +- bicubic = VIPS_CLIP( 0, bicubic, max_value ); ++ bicubic = VIPS_CLIP(0, bicubic, max_value); + + out[z] = bicubic; + +@@ -167,33 +166,32 @@ bicubic_unsigned_int_tab( void *pout, const VipsPel *pin, + } + + template +-static void inline +-bicubic_signed_int_tab( void *pout, const VipsPel *pin, ++static void inline bicubic_signed_int_tab(void *pout, const VipsPel *pin, + const int bands, const int lskip, +- const int *cx, const int *cy ) ++ const int *cx, const int *cy) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + + const int b1 = bands; + const int b2 = b1 + b1; + const int b3 = b1 + b2; + +- const int l1 = lskip / sizeof( T ); ++ const int l1 = lskip / sizeof(T); + const int l2 = l1 + l1; + const int l3 = l1 + l2; + +- const int l1_plus_b1 = l1 + b1; +- const int l1_plus_b2 = l1 + b2; +- const int l1_plus_b3 = l1 + b3; +- const int l2_plus_b1 = l2 + b1; +- const int l2_plus_b2 = l2 + b2; +- const int l2_plus_b3 = l2 + b3; +- const int l3_plus_b1 = l3 + b1; +- const int l3_plus_b2 = l3 + b2; +- const int l3_plus_b3 = l3 + b3; +- +- for( int z = 0; z < bands; z++ ) { ++ const int l1_plus_b1 = l1 + b1; ++ const int l1_plus_b2 = l1 + b2; ++ const int l1_plus_b3 = l1 + b3; ++ const int l2_plus_b1 = l2 + b1; ++ const int l2_plus_b2 = l2 + b2; ++ const int l2_plus_b3 = l2 + b3; ++ const int l3_plus_b1 = l3 + b1; ++ const int l3_plus_b2 = l3 + b2; ++ const int l3_plus_b3 = l3 + b3; ++ ++ for (int z = 0; z < bands; z++) { + const T uno_one = in[0]; + const T uno_two = in[b1]; + const T uno_thr = in[b2]; +@@ -219,9 +217,9 @@ bicubic_signed_int_tab( void *pout, const VipsPel *pin, + dos_one, dos_two, dos_thr, dos_fou, + tre_one, tre_two, tre_thr, tre_fou, + qua_one, qua_two, qua_thr, qua_fou, +- cx, cy ); ++ cx, cy); + +- bicubic = VIPS_CLIP( min_value, bicubic, max_value ); ++ bicubic = VIPS_CLIP(min_value, bicubic, max_value); + + out[z] = bicubic; + +@@ -232,33 +230,32 @@ bicubic_signed_int_tab( void *pout, const VipsPel *pin, + /* Floating-point version. + */ + template +-static void inline +-bicubic_float_tab( void *pout, const VipsPel *pin, ++static void inline bicubic_float_tab(void *pout, const VipsPel *pin, + const int bands, const int lskip, +- const double *cx, const double *cy ) ++ const double *cx, const double *cy) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + + const int b1 = bands; + const int b2 = b1 + b1; + const int b3 = b1 + b2; + +- const int l1 = lskip / sizeof( T ); ++ const int l1 = lskip / sizeof(T); + const int l2 = l1 + l1; + const int l3 = l1 + l2; + +- const int l1_plus_b1 = l1 + b1; +- const int l1_plus_b2 = l1 + b2; +- const int l1_plus_b3 = l1 + b3; +- const int l2_plus_b1 = l2 + b1; +- const int l2_plus_b2 = l2 + b2; +- const int l2_plus_b3 = l2 + b3; +- const int l3_plus_b1 = l3 + b1; +- const int l3_plus_b2 = l3 + b2; +- const int l3_plus_b3 = l3 + b3; +- +- for( int z = 0; z < bands; z++ ) { ++ const int l1_plus_b1 = l1 + b1; ++ const int l1_plus_b2 = l1 + b2; ++ const int l1_plus_b3 = l1 + b3; ++ const int l2_plus_b1 = l2 + b1; ++ const int l2_plus_b2 = l2 + b2; ++ const int l2_plus_b3 = l2 + b3; ++ const int l3_plus_b1 = l3 + b1; ++ const int l3_plus_b2 = l3 + b2; ++ const int l3_plus_b3 = l3 + b3; ++ ++ for (int z = 0; z < bands; z++) { + const T uno_one = in[0]; + const T uno_two = in[b1]; + const T uno_thr = in[b2]; +@@ -284,7 +281,7 @@ bicubic_float_tab( void *pout, const VipsPel *pin, + dos_one, dos_two, dos_thr, dos_fou, + tre_one, tre_two, tre_thr, tre_fou, + qua_one, qua_two, qua_thr, qua_fou, +- cx, cy ); ++ cx, cy); + + out[z] = bicubic; + +@@ -296,33 +293,32 @@ bicubic_float_tab( void *pout, const VipsPel *pin, + */ + + template +-static void inline +-bicubic_unsigned_int32_tab( void *pout, const VipsPel *pin, ++static void inline bicubic_unsigned_int32_tab(void *pout, const VipsPel *pin, + const int bands, const int lskip, +- const double *cx, const double *cy ) ++ const double *cx, const double *cy) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + + const int b1 = bands; + const int b2 = b1 + b1; + const int b3 = b1 + b2; + +- const int l1 = lskip / sizeof( T ); ++ const int l1 = lskip / sizeof(T); + const int l2 = l1 + l1; + const int l3 = l1 + l2; + +- const int l1_plus_b1 = l1 + b1; +- const int l1_plus_b2 = l1 + b2; +- const int l1_plus_b3 = l1 + b3; +- const int l2_plus_b1 = l2 + b1; +- const int l2_plus_b2 = l2 + b2; +- const int l2_plus_b3 = l2 + b3; +- const int l3_plus_b1 = l3 + b1; +- const int l3_plus_b2 = l3 + b2; +- const int l3_plus_b3 = l3 + b3; +- +- for( int z = 0; z < bands; z++ ) { ++ const int l1_plus_b1 = l1 + b1; ++ const int l1_plus_b2 = l1 + b2; ++ const int l1_plus_b3 = l1 + b3; ++ const int l2_plus_b1 = l2 + b1; ++ const int l2_plus_b2 = l2 + b2; ++ const int l2_plus_b3 = l2 + b3; ++ const int l3_plus_b1 = l3 + b1; ++ const int l3_plus_b2 = l3 + b2; ++ const int l3_plus_b3 = l3 + b3; ++ ++ for (int z = 0; z < bands; z++) { + const T uno_one = in[0]; + const T uno_two = in[b1]; + const T uno_thr = in[b2]; +@@ -348,9 +344,9 @@ bicubic_unsigned_int32_tab( void *pout, const VipsPel *pin, + dos_one, dos_two, dos_thr, dos_fou, + tre_one, tre_two, tre_thr, tre_fou, + qua_one, qua_two, qua_thr, qua_fou, +- cx, cy ); ++ cx, cy); + +- bicubic = VIPS_CLIP( 0, bicubic, max_value ); ++ bicubic = VIPS_CLIP(0, bicubic, max_value); + + out[z] = bicubic; + +@@ -359,33 +355,32 @@ bicubic_unsigned_int32_tab( void *pout, const VipsPel *pin, + } + + template +-static void inline +-bicubic_signed_int32_tab( void *pout, const VipsPel *pin, ++static void inline bicubic_signed_int32_tab(void *pout, const VipsPel *pin, + const int bands, const int lskip, +- const double *cx, const double *cy ) ++ const double *cx, const double *cy) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + + const int b1 = bands; + const int b2 = b1 + b1; + const int b3 = b1 + b2; + +- const int l1 = lskip / sizeof( T ); ++ const int l1 = lskip / sizeof(T); + const int l2 = l1 + l1; + const int l3 = l1 + l2; + +- const int l1_plus_b1 = l1 + b1; +- const int l1_plus_b2 = l1 + b2; +- const int l1_plus_b3 = l1 + b3; +- const int l2_plus_b1 = l2 + b1; +- const int l2_plus_b2 = l2 + b2; +- const int l2_plus_b3 = l2 + b3; +- const int l3_plus_b1 = l3 + b1; +- const int l3_plus_b2 = l3 + b2; +- const int l3_plus_b3 = l3 + b3; +- +- for( int z = 0; z < bands; z++ ) { ++ const int l1_plus_b1 = l1 + b1; ++ const int l1_plus_b2 = l1 + b2; ++ const int l1_plus_b3 = l1 + b3; ++ const int l2_plus_b1 = l2 + b1; ++ const int l2_plus_b2 = l2 + b2; ++ const int l2_plus_b3 = l2 + b3; ++ const int l3_plus_b1 = l3 + b1; ++ const int l3_plus_b2 = l3 + b2; ++ const int l3_plus_b3 = l3 + b3; ++ ++ for (int z = 0; z < bands; z++) { + const T uno_one = in[0]; + const T uno_two = in[b1]; + const T uno_thr = in[b2]; +@@ -411,9 +406,9 @@ bicubic_signed_int32_tab( void *pout, const VipsPel *pin, + dos_one, dos_two, dos_thr, dos_fou, + tre_one, tre_two, tre_thr, tre_fou, + qua_one, qua_two, qua_thr, qua_fou, +- cx, cy ); ++ cx, cy); + +- bicubic = VIPS_CLIP( min_value, bicubic, max_value ); ++ bicubic = VIPS_CLIP(min_value, bicubic, max_value); + + out[z] = bicubic; + +@@ -424,39 +419,38 @@ bicubic_signed_int32_tab( void *pout, const VipsPel *pin, + /* Ultra-high-quality version for double images. + */ + template +-static void inline +-bicubic_notab( void *pout, const VipsPel *pin, ++static void inline bicubic_notab(void *pout, const VipsPel *pin, + const int bands, const int lskip, +- double x, double y ) ++ double x, double y) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + + const int b1 = bands; + const int b2 = b1 + b1; + const int b3 = b1 + b2; + +- const int l1 = lskip / sizeof( T ); ++ const int l1 = lskip / sizeof(T); + const int l2 = l1 + l1; + const int l3 = l1 + l2; + +- const int l1_plus_b1 = l1 + b1; +- const int l1_plus_b2 = l1 + b2; +- const int l1_plus_b3 = l1 + b3; +- const int l2_plus_b1 = l2 + b1; +- const int l2_plus_b2 = l2 + b2; +- const int l2_plus_b3 = l2 + b3; +- const int l3_plus_b1 = l3 + b1; +- const int l3_plus_b2 = l3 + b2; +- const int l3_plus_b3 = l3 + b3; ++ const int l1_plus_b1 = l1 + b1; ++ const int l1_plus_b2 = l1 + b2; ++ const int l1_plus_b3 = l1 + b3; ++ const int l2_plus_b1 = l2 + b1; ++ const int l2_plus_b2 = l2 + b2; ++ const int l2_plus_b3 = l2 + b3; ++ const int l3_plus_b1 = l3 + b1; ++ const int l3_plus_b2 = l3 + b2; ++ const int l3_plus_b3 = l3 + b3; + + double cx[4]; + double cy[4]; + +- calculate_coefficients_catmull( cx, x ); +- calculate_coefficients_catmull( cy, y ); ++ calculate_coefficients_catmull(cx, x); ++ calculate_coefficients_catmull(cy, y); + +- for( int z = 0; z < bands; z++ ) { ++ for (int z = 0; z < bands; z++) { + const T uno_one = in[0]; + const T uno_two = in[b1]; + const T uno_thr = in[b2]; +@@ -482,7 +476,7 @@ bicubic_notab( void *pout, const VipsPel *pin, + dos_one, dos_two, dos_thr, dos_fou, + tre_one, tre_two, tre_thr, tre_fou, + qua_one, qua_two, qua_thr, qua_fou, +- cx, cy ); ++ cx, cy); + + out[z] = bicubic; + +@@ -491,12 +485,12 @@ bicubic_notab( void *pout, const VipsPel *pin, + } + + static void +-vips_interpolate_bicubic_interpolate( VipsInterpolate *interpolate, +- void *out, VipsRegion *in, double x, double y ) ++vips_interpolate_bicubic_interpolate(VipsInterpolate *interpolate, ++ void *out, VipsRegion *in, double x, double y) + { +- /* Find the mask index. We round-to-nearest, so we need to generate +- * indexes in 0 to VIPS_TRANSFORM_SCALE, 2^n + 1 values. We multiply +- * by 2 more than we need to, add one, mask, then shift down again to ++ /* Find the mask index. We round-to-nearest, so we need to generate ++ * indexes in 0 to VIPS_TRANSFORM_SCALE, 2^n + 1 values. We multiply ++ * by 2 more than we need to, add one, mask, then shift down again to + * get the extra range. + */ + const int sx = x * VIPS_TRANSFORM_SCALE * 2; +@@ -508,14 +502,14 @@ vips_interpolate_bicubic_interpolate( VipsInterpolate *interpolate, + const int tx = (six + 1) >> 1; + const int ty = (siy + 1) >> 1; + +- /* We know x/y are always positive, so we can just (int) them. ++ /* We know x/y are always positive, so we can just (int) them. + */ + const int ix = (int) x; + const int iy = (int) y; + + /* Back and up one to get the top-left of the 4x4. + */ +- const VipsPel *p = VIPS_REGION_ADDR( in, ix - 1, iy - 1 ); ++ const VipsPel *p = VIPS_REGION_ADDR(in, ix - 1, iy - 1); + + /* Look up the tables we need. + */ +@@ -527,96 +521,96 @@ vips_interpolate_bicubic_interpolate( VipsInterpolate *interpolate, + /* Pel size and line size. + */ + const int bands = in->im->Bands; +- const int lskip = VIPS_REGION_LSKIP( in ); ++ const int lskip = VIPS_REGION_LSKIP(in); + + /* Confirm that absolute_x and absolute_y are >= 1, because of + * window_offset. + */ +- g_assert( x >= 1.0 ); +- g_assert( y >= 1.0 ); ++ g_assert(x >= 1.0); ++ g_assert(y >= 1.0); + +- g_assert( ix - 1 >= in->valid.left ); +- g_assert( iy - 1 >= in->valid.top ); +- g_assert( ix + 2 < VIPS_RECT_RIGHT( &in->valid ) ); +- g_assert( iy + 2 < VIPS_RECT_BOTTOM( &in->valid ) ); ++ g_assert(ix - 1 >= in->valid.left); ++ g_assert(iy - 1 >= in->valid.top); ++ g_assert(ix + 2 < VIPS_RECT_RIGHT(&in->valid)); ++ g_assert(iy + 2 < VIPS_RECT_BOTTOM(&in->valid)); + + #ifdef DEBUG +- printf( "vips_interpolate_bicubic_interpolate: %g %g\n", x, y ); +- printf( "\tleft=%d, top=%d, width=%d, height=%d\n", +- ix - 1, iy - 1, 4, 4 ); +- printf( "\tmaskx=%d, masky=%d\n", tx, ty ); ++ printf("vips_interpolate_bicubic_interpolate: %g %g\n", x, y); ++ printf("\tleft=%d, top=%d, width=%d, height=%d\n", ++ ix - 1, iy - 1, 4, 4); ++ printf("\tmaskx=%d, masky=%d\n", tx, ty); + #endif /*DEBUG*/ + +- switch( in->im->BandFmt ) { ++ switch (in->im->BandFmt) { + case VIPS_FORMAT_UCHAR: + bicubic_unsigned_int_tab( + out, p, bands, lskip, +- cxi, cyi ); ++ cxi, cyi); + +- /* ++ /* + +- Handy for benchmarking ++ Handy for benchmarking + +- bicubic_float_tab( +- out, p, bands, lskip, +- cxf, cyf ); ++ bicubic_float_tab( ++ out, p, bands, lskip, ++ cxf, cyf ); + +- bicubic_notab( +- out, p, bands, lskip, +- x - ix, y - iy ); ++ bicubic_notab( ++ out, p, bands, lskip, ++ x - ix, y - iy ); + +- */ ++ */ + + break; + + case VIPS_FORMAT_CHAR: + bicubic_signed_int_tab( + out, p, bands, lskip, +- cxi, cyi ); ++ cxi, cyi); + break; + + case VIPS_FORMAT_USHORT: + bicubic_unsigned_int32_tab( + out, p, bands, lskip, +- cxf, cyf ); ++ cxf, cyf); + break; + + case VIPS_FORMAT_SHORT: + bicubic_signed_int32_tab( + out, p, bands, lskip, +- cxf, cyf ); ++ cxf, cyf); + break; + + case VIPS_FORMAT_UINT: +- bicubic_unsigned_int32_tab( ++ bicubic_unsigned_int32_tab( + out, p, bands, lskip, +- cxf, cyf ); ++ cxf, cyf); + break; + + case VIPS_FORMAT_INT: +- bicubic_signed_int32_tab( ++ bicubic_signed_int32_tab( + out, p, bands, lskip, +- cxf, cyf ); ++ cxf, cyf); + break; + + case VIPS_FORMAT_FLOAT: +- bicubic_float_tab( out, p, bands, lskip, +- cxf, cyf ); ++ bicubic_float_tab(out, p, bands, lskip, ++ cxf, cyf); + break; + + case VIPS_FORMAT_DOUBLE: +- bicubic_notab( out, p, bands, lskip, +- x - ix, y - iy ); ++ bicubic_notab(out, p, bands, lskip, ++ x - ix, y - iy); + break; + + case VIPS_FORMAT_COMPLEX: +- bicubic_float_tab( out, p, bands * 2, lskip, +- cxf, cyf ); ++ bicubic_float_tab(out, p, bands * 2, lskip, ++ cxf, cyf); + break; + + case VIPS_FORMAT_DPCOMPLEX: +- bicubic_notab( out, p, bands * 2, lskip, +- x - ix, y - iy ); ++ bicubic_notab(out, p, bands * 2, lskip, ++ x - ix, y - iy); + break; + + default: +@@ -625,38 +619,36 @@ vips_interpolate_bicubic_interpolate( VipsInterpolate *interpolate, + } + + static void +-vips_interpolate_bicubic_class_init( VipsInterpolateBicubicClass *iclass ) ++vips_interpolate_bicubic_class_init(VipsInterpolateBicubicClass *iclass) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( iclass ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(iclass); + VipsInterpolateClass *interpolate_class = +- VIPS_INTERPOLATE_CLASS( iclass ); ++ VIPS_INTERPOLATE_CLASS(iclass); + + object_class->nickname = "bicubic"; +- object_class->description = _( "bicubic interpolation (Catmull-Rom)" ); ++ object_class->description = _("bicubic interpolation (Catmull-Rom)"); + + interpolate_class->interpolate = vips_interpolate_bicubic_interpolate; + interpolate_class->window_size = 4; + + /* Build the tables of pre-computed coefficients. + */ +- for( int x = 0; x < VIPS_TRANSFORM_SCALE + 1; x++ ) { +- calculate_coefficients_catmull( vips_bicubic_matrixf[x], +- (float) x / VIPS_TRANSFORM_SCALE ); ++ for (int x = 0; x < VIPS_TRANSFORM_SCALE + 1; x++) { ++ calculate_coefficients_catmull(vips_bicubic_matrixf[x], ++ (float) x / VIPS_TRANSFORM_SCALE); + +- for( int i = 0; i < 4; i++ ) ++ for (int i = 0; i < 4; i++) + vips_bicubic_matrixi[x][i] = +- vips_bicubic_matrixf[x][i] * ++ vips_bicubic_matrixf[x][i] * + VIPS_INTERPOLATE_SCALE; + } + } + + static void +-vips_interpolate_bicubic_init( VipsInterpolateBicubic *bicubic ) ++vips_interpolate_bicubic_init(VipsInterpolateBicubic *bicubic) + { + #ifdef DEBUG +- printf( "vips_interpolate_bicubic_init: " ); +- vips_object_print_dump( VIPS_OBJECT( bicubic ) ); ++ printf("vips_interpolate_bicubic_init: "); ++ vips_object_print_dump(VIPS_OBJECT(bicubic)); + #endif /*DEBUG*/ +- + } +- +diff --git a/libvips/resample/interpolate.c b/libvips/resample/interpolate.c +index 138d2bf2aa..41692bd611 100644 +--- a/libvips/resample/interpolate.c ++++ b/libvips/resample/interpolate.c +@@ -22,28 +22,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -72,7 +72,7 @@ + * A number of image interpolators. + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsInterpolate, vips_interpolate, VIPS_TYPE_OBJECT ); ++G_DEFINE_ABSTRACT_TYPE(VipsInterpolate, vips_interpolate, VIPS_TYPE_OBJECT); + + /** + * VipsInterpolateMethod: +@@ -99,7 +99,7 @@ G_DEFINE_ABSTRACT_TYPE( VipsInterpolate, vips_interpolate, VIPS_TYPE_OBJECT ); + * @get_window_offset: return the window offset for this method + * @window_offset: or just set this for a constant window offset + * +- * The abstract base class for the various VIPS interpolation functions. ++ * The abstract base class for the various VIPS interpolation functions. + * Use "vips --list classes" to see all the interpolators available. + * + * An interpolator consists of a function to perform the interpolation, plus +@@ -108,7 +108,7 @@ G_DEFINE_ABSTRACT_TYPE( VipsInterpolate, vips_interpolate, VIPS_TYPE_OBJECT ); + * + * @window_size is the size of the window that the interpolator needs. For + * example, a bicubic interpolator needs to see a window of 4x4 pixels to be +- * able to interpolate a value. ++ * able to interpolate a value. + * + * You can either have a function in @get_window_size which returns the window + * that a specific interpolator needs, or you can leave @get_window_size %NULL +@@ -123,58 +123,58 @@ G_DEFINE_ABSTRACT_TYPE( VipsInterpolate, vips_interpolate, VIPS_TYPE_OBJECT ); + * + * You also need to set @nickname and @description in #VipsObject. + * +- * See also: #VipsInterpolateMethod, #VipsObject, ++ * See also: #VipsInterpolateMethod, #VipsObject, + * vips_interpolate_bilinear_static(). + */ + + #ifdef DEBUG + static void +-vips_interpolate_finalize( GObject *gobject ) ++vips_interpolate_finalize(GObject *gobject) + { +- printf( "vips_interpolate_finalize: " ); +- vips_object_print_name( VIPS_OBJECT( gobject ) ); ++ printf("vips_interpolate_finalize: "); ++ vips_object_print_name(VIPS_OBJECT(gobject)); + +- G_OBJECT_CLASS( vips_interpolate_parent_class )->finalize( gobject ); ++ G_OBJECT_CLASS(vips_interpolate_parent_class)->finalize(gobject); + } + #endif /*DEBUG*/ + + static int +-vips_interpolate_real_get_window_size( VipsInterpolate *interpolate ) ++vips_interpolate_real_get_window_size(VipsInterpolate *interpolate) + { +- VipsInterpolateClass *class = VIPS_INTERPOLATE_GET_CLASS( interpolate ); ++ VipsInterpolateClass *class = VIPS_INTERPOLATE_GET_CLASS(interpolate); + +- g_assert( class->window_size != -1 ); ++ g_assert(class->window_size != -1); + +- return( class->window_size ); ++ return (class->window_size); + } + + static int +-vips_interpolate_real_get_window_offset( VipsInterpolate *interpolate ) ++vips_interpolate_real_get_window_offset(VipsInterpolate *interpolate) + { +- VipsInterpolateClass *class = VIPS_INTERPOLATE_GET_CLASS( interpolate ); ++ VipsInterpolateClass *class = VIPS_INTERPOLATE_GET_CLASS(interpolate); + +- /* Default to half window size - 1. For example, bicubic is a 4x4 ++ /* Default to half window size - 1. For example, bicubic is a 4x4 + * stencil and needs an offset of 1. +- */ +- if( class->window_offset != -1 ) +- return( class->window_offset ); ++ */ ++ if (class->window_offset != -1) ++ return (class->window_offset); + else { +- int window_size = +- vips_interpolate_get_window_size( interpolate ); ++ int window_size = ++ vips_interpolate_get_window_size(interpolate); + + /* Don't go -ve, of course, for window_size 1. + */ +- return( VIPS_MAX( 0, window_size / 2 - 1 ) ); ++ return (VIPS_MAX(0, window_size / 2 - 1)); + } + } + + static void +-vips_interpolate_class_init( VipsInterpolateClass *class ) ++vips_interpolate_class_init(VipsInterpolateClass *class) + { +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + #ifdef DEBUG +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); + #endif /*DEBUG*/ + + #ifdef DEBUG +@@ -182,7 +182,7 @@ vips_interpolate_class_init( VipsInterpolateClass *class ) + #endif /*DEBUG*/ + + vobject_class->nickname = "interpolate"; +- vobject_class->description = _( "VIPS interpolators" ); ++ vobject_class->description = _("VIPS interpolators"); + + class->interpolate = NULL; + class->get_window_size = vips_interpolate_real_get_window_size; +@@ -192,15 +192,15 @@ vips_interpolate_class_init( VipsInterpolateClass *class ) + } + + static void +-vips_interpolate_init( VipsInterpolate *interpolate ) ++vips_interpolate_init(VipsInterpolate *interpolate) + { + #ifdef DEBUG +- printf( "vips_interpolate_init: " ); +- vips_object_print_name( VIPS_OBJECT( interpolate ) ); ++ printf("vips_interpolate_init: "); ++ vips_object_print_name(VIPS_OBJECT(interpolate)); + #endif /*DEBUG*/ + } + +-/** ++/** + * vips_interpolate: (skip) + * @interpolate: interpolator to use + * @out: write result here +@@ -215,17 +215,17 @@ vips_interpolate_init( VipsInterpolate *interpolate ) + * You need to set @in and @out up correctly. + */ + void +-vips_interpolate( VipsInterpolate *interpolate, +- void *out, VipsRegion *in, double x, double y ) ++vips_interpolate(VipsInterpolate *interpolate, ++ void *out, VipsRegion *in, double x, double y) + { +- VipsInterpolateClass *class = VIPS_INTERPOLATE_GET_CLASS( interpolate ); ++ VipsInterpolateClass *class = VIPS_INTERPOLATE_GET_CLASS(interpolate); + +- g_assert( class->interpolate ); ++ g_assert(class->interpolate); + +- class->interpolate( interpolate, out, in, x, y ); ++ class->interpolate(interpolate, out, in, x, y); + } + +-/** ++/** + * vips_interpolate_get_method: (skip) + * @interpolate: interpolator to use + * +@@ -235,49 +235,49 @@ vips_interpolate( VipsInterpolate *interpolate, + * Returns: a pointer to the interpolation function + */ + VipsInterpolateMethod +-vips_interpolate_get_method( VipsInterpolate *interpolate ) ++vips_interpolate_get_method(VipsInterpolate *interpolate) + { +- VipsInterpolateClass *class = VIPS_INTERPOLATE_GET_CLASS( interpolate ); ++ VipsInterpolateClass *class = VIPS_INTERPOLATE_GET_CLASS(interpolate); + +- g_assert( class->interpolate ); ++ g_assert(class->interpolate); + +- return( class->interpolate ); ++ return (class->interpolate); + } + +-/** ++/** + * vips_interpolate_get_window_size: + * @interpolate: interpolator to use + * +- * Look up an interpolators desired window size. ++ * Look up an interpolators desired window size. + * + * Returns: the interpolators required window size + */ + int +-vips_interpolate_get_window_size( VipsInterpolate *interpolate ) ++vips_interpolate_get_window_size(VipsInterpolate *interpolate) + { +- VipsInterpolateClass *class = VIPS_INTERPOLATE_GET_CLASS( interpolate ); ++ VipsInterpolateClass *class = VIPS_INTERPOLATE_GET_CLASS(interpolate); + +- g_assert( class->get_window_size ); ++ g_assert(class->get_window_size); + +- return( class->get_window_size( interpolate ) ); ++ return (class->get_window_size(interpolate)); + } + +-/** ++/** + * vips_interpolate_get_window_offset: + * @interpolate: interpolator to use + * +- * Look up an interpolators desired window offset. ++ * Look up an interpolators desired window offset. + * + * Returns: the interpolators required window offset + */ + int +-vips_interpolate_get_window_offset( VipsInterpolate *interpolate ) ++vips_interpolate_get_window_offset(VipsInterpolate *interpolate) + { +- VipsInterpolateClass *class = VIPS_INTERPOLATE_GET_CLASS( interpolate ); ++ VipsInterpolateClass *class = VIPS_INTERPOLATE_GET_CLASS(interpolate); + +- g_assert( class->get_window_offset ); ++ g_assert(class->get_window_offset); + +- return( class->get_window_offset( interpolate ) ); ++ return (class->get_window_offset(interpolate)); + } + + /** +@@ -290,7 +290,7 @@ vips_interpolate_get_window_offset( VipsInterpolate *interpolate ) + /** + * VIPS_TRANSFORM_SCALE: + * +- * #VIPS_TRANSFORM_SHIFT as a multiplicative constant. ++ * #VIPS_TRANSFORM_SHIFT as a multiplicative constant. + */ + + /** +@@ -303,306 +303,331 @@ vips_interpolate_get_window_offset( VipsInterpolate *interpolate ) + /** + * VIPS_INTERPOLATE_SCALE: + * +- * #VIPS_INTERPOLATE_SHIFT as a multiplicative constant. ++ * #VIPS_INTERPOLATE_SHIFT as a multiplicative constant. + */ + + /* VipsInterpolateNearest class + */ + + #define VIPS_TYPE_INTERPOLATE_NEAREST (vips_interpolate_nearest_get_type()) +-#define VIPS_INTERPOLATE_NEAREST( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_INTERPOLATE_NEAREST, VipsInterpolateNearest )) +-#define VIPS_INTERPOLATE_NEAREST_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_INTERPOLATE_NEAREST, VipsInterpolateNearestClass)) +-#define VIPS_IS_INTERPOLATE_NEAREST( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_INTERPOLATE_NEAREST )) +-#define VIPS_IS_INTERPOLATE_NEAREST_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_INTERPOLATE_NEAREST )) +-#define VIPS_INTERPOLATE_NEAREST_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_INTERPOLATE_NEAREST, VipsInterpolateNearestClass )) ++#define VIPS_INTERPOLATE_NEAREST(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_INTERPOLATE_NEAREST, VipsInterpolateNearest)) ++#define VIPS_INTERPOLATE_NEAREST_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_INTERPOLATE_NEAREST, VipsInterpolateNearestClass)) ++#define VIPS_IS_INTERPOLATE_NEAREST(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_INTERPOLATE_NEAREST)) ++#define VIPS_IS_INTERPOLATE_NEAREST_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_INTERPOLATE_NEAREST)) ++#define VIPS_INTERPOLATE_NEAREST_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_INTERPOLATE_NEAREST, VipsInterpolateNearestClass)) + + /* No new members. + */ + typedef VipsInterpolate VipsInterpolateNearest; + typedef VipsInterpolateClass VipsInterpolateNearestClass; + +-G_DEFINE_TYPE( VipsInterpolateNearest, vips_interpolate_nearest, +- VIPS_TYPE_INTERPOLATE ); ++G_DEFINE_TYPE(VipsInterpolateNearest, vips_interpolate_nearest, ++ VIPS_TYPE_INTERPOLATE); + + static void +-vips_interpolate_nearest_interpolate( VipsInterpolate *interpolate, +- void *out, VipsRegion *in, double x, double y ) ++vips_interpolate_nearest_interpolate(VipsInterpolate *interpolate, ++ void *out, VipsRegion *in, double x, double y) + { +- const int ps = VIPS_IMAGE_SIZEOF_PEL( in->im ); ++ const int ps = VIPS_IMAGE_SIZEOF_PEL(in->im); + + const int xi = (int) x; + const int yi = (int) y; + +- const VipsPel * restrict p = VIPS_REGION_ADDR( in, xi, yi ); +- VipsPel * restrict q = (VipsPel *) out; ++ const VipsPel *restrict p = VIPS_REGION_ADDR(in, xi, yi); ++ VipsPel *restrict q = (VipsPel *) out; + + int z; + +- for( z = 0; z < ps; z++ ) ++ for (z = 0; z < ps; z++) + q[z] = p[z]; + } + + static void +-vips_interpolate_nearest_class_init( VipsInterpolateNearestClass *class ) ++vips_interpolate_nearest_class_init(VipsInterpolateNearestClass *class) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); + VipsInterpolateClass *interpolate_class = +- VIPS_INTERPOLATE_CLASS( class ); ++ VIPS_INTERPOLATE_CLASS(class); + + object_class->nickname = "nearest"; +- object_class->description = _( "nearest-neighbour interpolation" ); ++ object_class->description = _("nearest-neighbour interpolation"); + + interpolate_class->interpolate = vips_interpolate_nearest_interpolate; + interpolate_class->window_size = 1; + } + + static void +-vips_interpolate_nearest_init( VipsInterpolateNearest *nearest ) ++vips_interpolate_nearest_init(VipsInterpolateNearest *nearest) + { + #ifdef DEBUG +- printf( "vips_interpolate_nearest_init: " ); +- vips_object_print_name( VIPS_OBJECT( nearest ) ); ++ printf("vips_interpolate_nearest_init: "); ++ vips_object_print_name(VIPS_OBJECT(nearest)); + #endif /*DEBUG*/ + } + + static VipsInterpolate * +-vips_interpolate_nearest_new( void ) ++vips_interpolate_nearest_new(void) + { +- return( VIPS_INTERPOLATE( vips_object_new( +- VIPS_TYPE_INTERPOLATE_NEAREST, NULL, NULL, NULL ) ) ); ++ return (VIPS_INTERPOLATE(vips_object_new( ++ VIPS_TYPE_INTERPOLATE_NEAREST, NULL, NULL, NULL))); + } + + /** + * vips_interpolate_nearest_static: + * +- * A convenience function that returns a nearest-neighbour interpolator you ++ * A convenience function that returns a nearest-neighbour interpolator you + * don't need to free. + * + * Returns: (transfer none): a nearest-neighbour interpolator + */ + VipsInterpolate * +-vips_interpolate_nearest_static( void ) ++vips_interpolate_nearest_static(void) + { + static VipsInterpolate *interpolate = NULL; + +- if( !interpolate ) { ++ if (!interpolate) { + interpolate = vips_interpolate_nearest_new(); +- vips_object_set_static( VIPS_OBJECT( interpolate ), TRUE ); ++ vips_object_set_static(VIPS_OBJECT(interpolate), TRUE); + } + +- return( interpolate ); ++ return (interpolate); + } + + /* VipsInterpolateBilinear class + */ + + #define VIPS_TYPE_INTERPOLATE_BILINEAR (vips_interpolate_bilinear_get_type()) +-#define VIPS_INTERPOLATE_BILINEAR( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_INTERPOLATE_BILINEAR, VipsInterpolateBilinear )) +-#define VIPS_INTERPOLATE_BILINEAR_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_INTERPOLATE_BILINEAR, VipsInterpolateBilinearClass)) +-#define VIPS_IS_INTERPOLATE_BILINEAR( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_INTERPOLATE_BILINEAR )) +-#define VIPS_IS_INTERPOLATE_BILINEAR_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_INTERPOLATE_BILINEAR )) +-#define VIPS_INTERPOLATE_BILINEAR_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_INTERPOLATE_BILINEAR, VipsInterpolateBilinearClass )) ++#define VIPS_INTERPOLATE_BILINEAR(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_INTERPOLATE_BILINEAR, VipsInterpolateBilinear)) ++#define VIPS_INTERPOLATE_BILINEAR_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_INTERPOLATE_BILINEAR, VipsInterpolateBilinearClass)) ++#define VIPS_IS_INTERPOLATE_BILINEAR(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_INTERPOLATE_BILINEAR)) ++#define VIPS_IS_INTERPOLATE_BILINEAR_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_INTERPOLATE_BILINEAR)) ++#define VIPS_INTERPOLATE_BILINEAR_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_INTERPOLATE_BILINEAR, VipsInterpolateBilinearClass)) + + typedef VipsInterpolate VipsInterpolateBilinear; + typedef VipsInterpolateClass VipsInterpolateBilinearClass; + +-G_DEFINE_TYPE( VipsInterpolateBilinear, vips_interpolate_bilinear, +- VIPS_TYPE_INTERPOLATE ); ++G_DEFINE_TYPE(VipsInterpolateBilinear, vips_interpolate_bilinear, ++ VIPS_TYPE_INTERPOLATE); + + /* in this class, name vars in the 2x2 grid as eg. + * p1 p2 + * p3 p4 + */ + +-#define BILINEAR_INT_INNER { \ +- tq[z] = (c1 * tp1[z] + c2 * tp2[z] + \ +- c3 * tp3[z] + c4 * tp4[z] + \ +- (1 << VIPS_INTERPOLATE_SHIFT) / 2) >> VIPS_INTERPOLATE_SHIFT; \ +- z += 1; \ +-} ++#define BILINEAR_INT_INNER \ ++ { \ ++ tq[z] = (c1 * tp1[z] + c2 * tp2[z] + \ ++ c3 * tp3[z] + c4 * tp4[z] + \ ++ (1 << VIPS_INTERPOLATE_SHIFT) / 2) >> \ ++ VIPS_INTERPOLATE_SHIFT; \ ++ z += 1; \ ++ } + + /* Fixed-point arithmetic, no tables. + */ +-#define BILINEAR_INT( TYPE ) { \ +- TYPE * restrict tq = (TYPE *) out; \ +- \ +- int X = (x - ix) * VIPS_INTERPOLATE_SCALE; \ +- int Y = (y - iy) * VIPS_INTERPOLATE_SCALE; \ +- \ +- int Yd = VIPS_INTERPOLATE_SCALE - Y; \ +- \ +- int c4 = (Y * X) >> VIPS_INTERPOLATE_SHIFT; \ +- int c2 = (Yd * X) >> VIPS_INTERPOLATE_SHIFT; \ +- int c3 = Y - c4; \ +- int c1 = Yd - c2; \ +- \ +- const TYPE * restrict tp1 = (TYPE *) p1; \ +- const TYPE * restrict tp2 = (TYPE *) p2; \ +- const TYPE * restrict tp3 = (TYPE *) p3; \ +- const TYPE * restrict tp4 = (TYPE *) p4; \ +- \ +- z = 0; \ +- VIPS_UNROLL( b, BILINEAR_INT_INNER ); \ +-} ++#define BILINEAR_INT(TYPE) \ ++ { \ ++ TYPE *restrict tq = (TYPE *) out; \ ++\ ++ int X = (x - ix) * VIPS_INTERPOLATE_SCALE; \ ++ int Y = (y - iy) * VIPS_INTERPOLATE_SCALE; \ ++\ ++ int Yd = VIPS_INTERPOLATE_SCALE - Y; \ ++\ ++ int c4 = (Y * X) >> VIPS_INTERPOLATE_SHIFT; \ ++ int c2 = (Yd * X) >> VIPS_INTERPOLATE_SHIFT; \ ++ int c3 = Y - c4; \ ++ int c1 = Yd - c2; \ ++\ ++ const TYPE *restrict tp1 = (TYPE *) p1; \ ++ const TYPE *restrict tp2 = (TYPE *) p2; \ ++ const TYPE *restrict tp3 = (TYPE *) p3; \ ++ const TYPE *restrict tp4 = (TYPE *) p4; \ ++\ ++ z = 0; \ ++ VIPS_UNROLL(b, BILINEAR_INT_INNER); \ ++ } + +-#define BILINEAR_FLOAT_INNER { \ +- tq[z] = c1 * tp1[z] + c2 * tp2[z] + \ +- c3 * tp3[z] + c4 * tp4[z]; \ +- z += 1; \ +-} ++#define BILINEAR_FLOAT_INNER \ ++ { \ ++ tq[z] = c1 * tp1[z] + c2 * tp2[z] + \ ++ c3 * tp3[z] + c4 * tp4[z]; \ ++ z += 1; \ ++ } + +-/* Interpolate a pel ... int16, int32 and float types, no tables, float ++/* Interpolate a pel ... int16, int32 and float types, no tables, float + * arithmetic. Use double not float for coefficient calculation or we can + * get small over/undershoots. + */ +-#define BILINEAR_FLOAT( TYPE ) { \ +- TYPE * restrict tq = (TYPE *) out; \ +- \ +- double X = x - ix; \ +- double Y = y - iy; \ +- \ +- double Yd = 1.0f - Y; \ +- \ +- double c4 = Y * X; \ +- double c2 = Yd * X; \ +- double c3 = Y - c4; \ +- double c1 = Yd - c2; \ +- \ +- const TYPE * restrict tp1 = (TYPE *) p1; \ +- const TYPE * restrict tp2 = (TYPE *) p2; \ +- const TYPE * restrict tp3 = (TYPE *) p3; \ +- const TYPE * restrict tp4 = (TYPE *) p4; \ +- \ +- z = 0; \ +- VIPS_UNROLL( b, BILINEAR_FLOAT_INNER ); \ +-} ++#define BILINEAR_FLOAT(TYPE) \ ++ { \ ++ TYPE *restrict tq = (TYPE *) out; \ ++\ ++ double X = x - ix; \ ++ double Y = y - iy; \ ++\ ++ double Yd = 1.0f - Y; \ ++\ ++ double c4 = Y * X; \ ++ double c2 = Yd * X; \ ++ double c3 = Y - c4; \ ++ double c1 = Yd - c2; \ ++\ ++ const TYPE *restrict tp1 = (TYPE *) p1; \ ++ const TYPE *restrict tp2 = (TYPE *) p2; \ ++ const TYPE *restrict tp3 = (TYPE *) p3; \ ++ const TYPE *restrict tp4 = (TYPE *) p4; \ ++\ ++ z = 0; \ ++ VIPS_UNROLL(b, BILINEAR_FLOAT_INNER); \ ++ } + + /* The fixed-point path is fine for uchar pixels, but it'll be inaccurate for +- * shorts and larger. ++ * shorts and larger. + */ +-#define SWITCH_INTERPOLATE( FMT, INT, FLOAT ) { \ +- switch( (FMT) ) { \ +- case VIPS_FORMAT_UCHAR: INT( unsigned char ); break; \ +- case VIPS_FORMAT_CHAR: INT( char ); break; \ +- case VIPS_FORMAT_USHORT:INT( unsigned short ); break; \ +- case VIPS_FORMAT_SHORT: INT( short ); break; \ +- case VIPS_FORMAT_UINT: FLOAT( unsigned int ); break; \ +- case VIPS_FORMAT_INT: FLOAT( int ); break; \ +- case VIPS_FORMAT_FLOAT: FLOAT( float ); break; \ +- case VIPS_FORMAT_DOUBLE:FLOAT( double ); break; \ +- case VIPS_FORMAT_COMPLEX: FLOAT( float ); break; \ +- case VIPS_FORMAT_DPCOMPLEX:FLOAT( double ); break; \ +- default: \ +- g_assert( FALSE ); \ +- } \ +-} ++#define SWITCH_INTERPOLATE(FMT, INT, FLOAT) \ ++ { \ ++ switch ((FMT)) { \ ++ case VIPS_FORMAT_UCHAR: \ ++ INT(unsigned char); \ ++ break; \ ++ case VIPS_FORMAT_CHAR: \ ++ INT(char); \ ++ break; \ ++ case VIPS_FORMAT_USHORT: \ ++ INT(unsigned short); \ ++ break; \ ++ case VIPS_FORMAT_SHORT: \ ++ INT(short); \ ++ break; \ ++ case VIPS_FORMAT_UINT: \ ++ FLOAT(unsigned int); \ ++ break; \ ++ case VIPS_FORMAT_INT: \ ++ FLOAT(int); \ ++ break; \ ++ case VIPS_FORMAT_FLOAT: \ ++ FLOAT(float); \ ++ break; \ ++ case VIPS_FORMAT_DOUBLE: \ ++ FLOAT(double); \ ++ break; \ ++ case VIPS_FORMAT_COMPLEX: \ ++ FLOAT(float); \ ++ break; \ ++ case VIPS_FORMAT_DPCOMPLEX: \ ++ FLOAT(double); \ ++ break; \ ++ default: \ ++ g_assert(FALSE); \ ++ } \ ++ } + + static void +-vips_interpolate_bilinear_interpolate( VipsInterpolate *interpolate, +- void *out, VipsRegion *in, double x, double y ) ++vips_interpolate_bilinear_interpolate(VipsInterpolate *interpolate, ++ void *out, VipsRegion *in, double x, double y) + { + /* Pel size and line size. + */ +- const int ps = VIPS_IMAGE_SIZEOF_PEL( in->im ); +- const int ls = VIPS_REGION_LSKIP( in ); ++ const int ps = VIPS_IMAGE_SIZEOF_PEL(in->im); ++ const int ls = VIPS_REGION_LSKIP(in); + const int b = in->im->Bands * +- (vips_band_format_iscomplex( in->im->BandFmt ) ? 2 : 1); ++ (vips_band_format_iscomplex(in->im->BandFmt) ? 2 : 1); + + const int ix = (int) x; + const int iy = (int) y; + +- const VipsPel * restrict p1 = VIPS_REGION_ADDR( in, ix, iy ); +- const VipsPel * restrict p2 = p1 + ps; +- const VipsPel * restrict p3 = p1 + ls; +- const VipsPel * restrict p4 = p3 + ps; ++ const VipsPel *restrict p1 = VIPS_REGION_ADDR(in, ix, iy); ++ const VipsPel *restrict p2 = p1 + ps; ++ const VipsPel *restrict p3 = p1 + ls; ++ const VipsPel *restrict p4 = p3 + ps; + + int z; + +- g_assert( (int) x >= in->valid.left ); +- g_assert( (int) y >= in->valid.top ); +- g_assert( (int) x + 1 < VIPS_RECT_RIGHT( &in->valid ) ); +- g_assert( (int) y + 1 < VIPS_RECT_BOTTOM( &in->valid ) ); ++ g_assert((int) x >= in->valid.left); ++ g_assert((int) y >= in->valid.top); ++ g_assert((int) x + 1 < VIPS_RECT_RIGHT(&in->valid)); ++ g_assert((int) y + 1 < VIPS_RECT_BOTTOM(&in->valid)); + +- SWITCH_INTERPOLATE( in->im->BandFmt, BILINEAR_INT, BILINEAR_FLOAT ); ++ SWITCH_INTERPOLATE(in->im->BandFmt, BILINEAR_INT, BILINEAR_FLOAT); + } + + static void +-vips_interpolate_bilinear_class_init( VipsInterpolateBilinearClass *class ) ++vips_interpolate_bilinear_class_init(VipsInterpolateBilinearClass *class) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( class ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(class); + VipsInterpolateClass *interpolate_class = + (VipsInterpolateClass *) class; + + object_class->nickname = "bilinear"; +- object_class->description = _( "bilinear interpolation" ); ++ object_class->description = _("bilinear interpolation"); + + interpolate_class->interpolate = vips_interpolate_bilinear_interpolate; + interpolate_class->window_size = 2; + } + + static void +-vips_interpolate_bilinear_init( VipsInterpolateBilinear *bilinear ) ++vips_interpolate_bilinear_init(VipsInterpolateBilinear *bilinear) + { + #ifdef DEBUG +- printf( "vips_interpolate_bilinear_init: " ); +- vips_object_print_name( VIPS_OBJECT( bilinear ) ); ++ printf("vips_interpolate_bilinear_init: "); ++ vips_object_print_name(VIPS_OBJECT(bilinear)); + #endif /*DEBUG*/ +- + } + + VipsInterpolate * +-vips_interpolate_bilinear_new( void ) ++vips_interpolate_bilinear_new(void) + { +- return( VIPS_INTERPOLATE( vips_object_new( +- VIPS_TYPE_INTERPOLATE_BILINEAR, NULL, NULL, NULL ) ) ); ++ return (VIPS_INTERPOLATE(vips_object_new( ++ VIPS_TYPE_INTERPOLATE_BILINEAR, NULL, NULL, NULL))); + } + + /** + * vips_interpolate_bilinear_static: + * +- * A convenience function that returns a bilinear interpolator you ++ * A convenience function that returns a bilinear interpolator you + * don't need to free. + * + * Returns: (transfer none): a bilinear interpolator + */ + VipsInterpolate * +-vips_interpolate_bilinear_static( void ) ++vips_interpolate_bilinear_static(void) + { + static VipsInterpolate *interpolate = NULL; + +- if( !interpolate ) { ++ if (!interpolate) { + interpolate = vips_interpolate_bilinear_new(); +- vips_object_set_static( VIPS_OBJECT( interpolate ), TRUE ); ++ vips_object_set_static(VIPS_OBJECT(interpolate), TRUE); + } + +- return( interpolate ); ++ return (interpolate); + } + + /* Called on startup: register the base vips interpolators. + */ + void +-vips__interpolate_init( void ) ++vips__interpolate_init(void) + { +- extern GType vips_interpolate_bicubic_get_type( void ); +- extern GType vips_interpolate_lbb_get_type( void ); +- extern GType vips_interpolate_nohalo_get_type( void ); +- extern GType vips_interpolate_vsqbs_get_type( void ); ++ extern GType vips_interpolate_bicubic_get_type(void); ++ extern GType vips_interpolate_lbb_get_type(void); ++ extern GType vips_interpolate_nohalo_get_type(void); ++ extern GType vips_interpolate_vsqbs_get_type(void); + + vips_interpolate_nearest_get_type(); + vips_interpolate_bilinear_get_type(); +@@ -625,15 +650,15 @@ vips__interpolate_init( void ) + * Returns: an interpolator, or %NULL on error. + */ + VipsInterpolate * +-vips_interpolate_new( const char *nickname ) ++vips_interpolate_new(const char *nickname) + { + GType type; + +- if( !(type = vips_type_find( "VipsInterpolate", nickname )) ) { +- vips_error( "VipsInterpolate", +- _( "class \"%s\" not found" ), nickname ); +- return( NULL ); ++ if (!(type = vips_type_find("VipsInterpolate", nickname))) { ++ vips_error("VipsInterpolate", ++ _("class \"%s\" not found"), nickname); ++ return (NULL); + } + +- return( VIPS_INTERPOLATE( vips_object_new( type, NULL, NULL, NULL ) ) ); ++ return (VIPS_INTERPOLATE(vips_object_new(type, NULL, NULL, NULL))); + } +diff --git a/libvips/resample/lbb.cpp b/libvips/resample/lbb.cpp +index 9e26efbe72..21f1f3b47c 100644 +--- a/libvips/resample/lbb.cpp ++++ b/libvips/resample/lbb.cpp +@@ -9,28 +9,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify it +- under the terms of the GNU Lesser General Public License as +- published by the Free Software Foundation; either version 2 of the +- License, or (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify it ++ under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2 of the ++ License, or (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -167,19 +167,19 @@ + + #define VIPS_TYPE_INTERPOLATE_LBB \ + (vips_interpolate_lbb_get_type()) +-#define VIPS_INTERPOLATE_LBB( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_INTERPOLATE_LBB, VipsInterpolateLbb )) +-#define VIPS_INTERPOLATE_LBB_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_INTERPOLATE_LBB, VipsInterpolateLbbClass)) +-#define VIPS_IS_INTERPOLATE_LBB( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_INTERPOLATE_LBB )) +-#define VIPS_IS_INTERPOLATE_LBB_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_INTERPOLATE_LBB )) +-#define VIPS_INTERPOLATE_LBB_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_INTERPOLATE_LBB, VipsInterpolateLbbClass )) ++#define VIPS_INTERPOLATE_LBB(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_INTERPOLATE_LBB, VipsInterpolateLbb)) ++#define VIPS_INTERPOLATE_LBB_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_INTERPOLATE_LBB, VipsInterpolateLbbClass)) ++#define VIPS_IS_INTERPOLATE_LBB(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_INTERPOLATE_LBB)) ++#define VIPS_IS_INTERPOLATE_LBB_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_INTERPOLATE_LBB)) ++#define VIPS_INTERPOLATE_LBB_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_INTERPOLATE_LBB, VipsInterpolateLbbClass)) + + typedef struct _VipsInterpolateLbb { + VipsInterpolate parent_object; +@@ -194,383 +194,391 @@ typedef struct _VipsInterpolateLbbClass { + /* + * Absolute value and sign macros: + */ +-#define LBB_ABS(x) ( ((x)>=0.) ? (x) : -(x) ) +-#define LBB_SIGN(x) ( ((x)>=0.) ? 1.0 : -1.0 ) ++#define LBB_ABS(x) (((x) >= 0.) ? (x) : -(x)) ++#define LBB_SIGN(x) (((x) >= 0.) ? 1.0 : -1.0) + /* + * MIN and MAX macros set up so that I can put the likely winner in + * the first argument (forward branch likely blah blah blah): + */ +-#define LBB_MIN(x,y) ( ((x)<=(y)) ? (x) : (y) ) +-#define LBB_MAX(x,y) ( ((x)>=(y)) ? (x) : (y) ) ++#define LBB_MIN(x, y) (((x) <= (y)) ? (x) : (y)) ++#define LBB_MAX(x, y) (((x) >= (y)) ? (x) : (y)) + + static inline double +-lbbicubic( const double c00, +- const double c10, +- const double c01, +- const double c11, +- const double c00dx, +- const double c10dx, +- const double c01dx, +- const double c11dx, +- const double c00dy, +- const double c10dy, +- const double c01dy, +- const double c11dy, +- const double c00dxdy, +- const double c10dxdy, +- const double c01dxdy, +- const double c11dxdy, +- const double uno_one, +- const double uno_two, +- const double uno_thr, +- const double uno_fou, +- const double dos_one, +- const double dos_two, +- const double dos_thr, +- const double dos_fou, +- const double tre_one, +- const double tre_two, +- const double tre_thr, +- const double tre_fou, +- const double qua_one, +- const double qua_two, +- const double qua_thr, +- const double qua_fou ) ++lbbicubic(const double c00, ++ const double c10, ++ const double c01, ++ const double c11, ++ const double c00dx, ++ const double c10dx, ++ const double c01dx, ++ const double c11dx, ++ const double c00dy, ++ const double c10dy, ++ const double c01dy, ++ const double c11dy, ++ const double c00dxdy, ++ const double c10dxdy, ++ const double c01dxdy, ++ const double c11dxdy, ++ const double uno_one, ++ const double uno_two, ++ const double uno_thr, ++ const double uno_fou, ++ const double dos_one, ++ const double dos_two, ++ const double dos_thr, ++ const double dos_fou, ++ const double tre_one, ++ const double tre_two, ++ const double tre_thr, ++ const double tre_fou, ++ const double qua_one, ++ const double qua_two, ++ const double qua_thr, ++ const double qua_fou) + { +- /* +- * STENCIL (FOOTPRINT) OF INPUT VALUES: +- * +- * The stencil of LBB is the same as for any standard Hermite +- * bicubic (e.g., Catmull-Rom): +- * +- * (ix-1,iy-1) (ix,iy-1) (ix+1,iy-1) (ix+2,iy-1) +- * = uno_one = uno_two = uno_thr = uno_fou +- * +- * (ix-1,iy) (ix,iy) (ix+1,iy) (ix+2,iy) +- * = dos_one = dos_two = dos_thr = dos_fou +- * X +- * (ix-1,iy+1) (ix,iy+1) (ix+1,iy+1) (ix+2,iy+1) +- * = tre_one = tre_two = tre_thr = tre_fou +- * +- * (ix-1,iy+2) (ix,iy+2) (ix+1,iy+2) (ix+2,iy+2) +- * = qua_one = qua_two = qua_thr = qua_fou +- * +- * where ix is the (pseudo-)floor of the requested left-to-right +- * location ("X"), and iy is the floor of the requested up-to-down +- * location. +- */ +- +-#if defined (__LBB_CHEAP_H__) +- /* +- * Computation of the four min and four max over 3x3 input data +- * sub-crosses of the 4x4 input stencil, performed with only 22 +- * comparisons and 28 "? :". If you can figure out how to do this +- * more efficiently, let us know. +- * +- * This is the cheaper (but arguably less desirable in terms of +- * quality) version of the computation. +- */ +- const double m1 = (dos_two <= dos_thr) ? dos_two : dos_thr ; +- const double M1 = (dos_two <= dos_thr) ? dos_thr : dos_two ; +- const double m2 = (tre_two <= tre_thr) ? tre_two : tre_thr ; +- const double M2 = (tre_two <= tre_thr) ? tre_thr : tre_two ; +- const double m3 = (uno_two <= dos_one) ? uno_two : dos_one ; +- const double M3 = (uno_two <= dos_one) ? dos_one : uno_two ; +- const double m4 = (uno_thr <= dos_fou) ? uno_thr : dos_fou ; +- const double M4 = (uno_thr <= dos_fou) ? dos_fou : uno_thr ; +- const double m5 = (tre_one <= qua_two) ? tre_one : qua_two ; +- const double M5 = (tre_one <= qua_two) ? qua_two : tre_one ; +- const double m6 = (tre_fou <= qua_thr) ? tre_fou : qua_thr ; +- const double M6 = (tre_fou <= qua_thr) ? qua_thr : tre_fou ; +- const double m7 = LBB_MIN( m1, tre_two ); +- const double M7 = LBB_MAX( M1, tre_two ); +- const double m8 = LBB_MIN( m1, tre_thr ); +- const double M8 = LBB_MAX( M1, tre_thr ); +- const double m9 = LBB_MIN( m2, dos_two ); +- const double M9 = LBB_MAX( M2, dos_two ); +- const double m10 = LBB_MIN( m2, dos_thr ); +- const double M10 = LBB_MAX( M2, dos_thr ); +- const double min00 = LBB_MIN( m7, m3 ); +- const double max00 = LBB_MAX( M7, M3 ); +- const double min10 = LBB_MIN( m8, m4 ); +- const double max10 = LBB_MAX( M8, M4 ); +- const double min01 = LBB_MIN( m9, m5 ); +- const double max01 = LBB_MAX( M9, M5 ); +- const double min11 = LBB_MIN( m10, m6 ); +- const double max11 = LBB_MAX( M10, M6 ); ++ /* ++ * STENCIL (FOOTPRINT) OF INPUT VALUES: ++ * ++ * The stencil of LBB is the same as for any standard Hermite ++ * bicubic (e.g., Catmull-Rom): ++ * ++ * (ix-1,iy-1) (ix,iy-1) (ix+1,iy-1) (ix+2,iy-1) ++ * = uno_one = uno_two = uno_thr = uno_fou ++ * ++ * (ix-1,iy) (ix,iy) (ix+1,iy) (ix+2,iy) ++ * = dos_one = dos_two = dos_thr = dos_fou ++ * X ++ * (ix-1,iy+1) (ix,iy+1) (ix+1,iy+1) (ix+2,iy+1) ++ * = tre_one = tre_two = tre_thr = tre_fou ++ * ++ * (ix-1,iy+2) (ix,iy+2) (ix+1,iy+2) (ix+2,iy+2) ++ * = qua_one = qua_two = qua_thr = qua_fou ++ * ++ * where ix is the (pseudo-)floor of the requested left-to-right ++ * location ("X"), and iy is the floor of the requested up-to-down ++ * location. ++ */ ++ ++#if defined(__LBB_CHEAP_H__) ++ /* ++ * Computation of the four min and four max over 3x3 input data ++ * sub-crosses of the 4x4 input stencil, performed with only 22 ++ * comparisons and 28 "? :". If you can figure out how to do this ++ * more efficiently, let us know. ++ * ++ * This is the cheaper (but arguably less desirable in terms of ++ * quality) version of the computation. ++ */ ++ const double m1 = (dos_two <= dos_thr) ? dos_two : dos_thr; ++ const double M1 = (dos_two <= dos_thr) ? dos_thr : dos_two; ++ const double m2 = (tre_two <= tre_thr) ? tre_two : tre_thr; ++ const double M2 = (tre_two <= tre_thr) ? tre_thr : tre_two; ++ const double m3 = (uno_two <= dos_one) ? uno_two : dos_one; ++ const double M3 = (uno_two <= dos_one) ? dos_one : uno_two; ++ const double m4 = (uno_thr <= dos_fou) ? uno_thr : dos_fou; ++ const double M4 = (uno_thr <= dos_fou) ? dos_fou : uno_thr; ++ const double m5 = (tre_one <= qua_two) ? tre_one : qua_two; ++ const double M5 = (tre_one <= qua_two) ? qua_two : tre_one; ++ const double m6 = (tre_fou <= qua_thr) ? tre_fou : qua_thr; ++ const double M6 = (tre_fou <= qua_thr) ? qua_thr : tre_fou; ++ const double m7 = LBB_MIN(m1, tre_two); ++ const double M7 = LBB_MAX(M1, tre_two); ++ const double m8 = LBB_MIN(m1, tre_thr); ++ const double M8 = LBB_MAX(M1, tre_thr); ++ const double m9 = LBB_MIN(m2, dos_two); ++ const double M9 = LBB_MAX(M2, dos_two); ++ const double m10 = LBB_MIN(m2, dos_thr); ++ const double M10 = LBB_MAX(M2, dos_thr); ++ const double min00 = LBB_MIN(m7, m3); ++ const double max00 = LBB_MAX(M7, M3); ++ const double min10 = LBB_MIN(m8, m4); ++ const double max10 = LBB_MAX(M8, M4); ++ const double min01 = LBB_MIN(m9, m5); ++ const double max01 = LBB_MAX(M9, M5); ++ const double min11 = LBB_MIN(m10, m6); ++ const double max11 = LBB_MAX(M10, M6); + #else +- /* +- * Computation of the four min and four max over 3x3 input data +- * sub-blocks of the 4x4 input stencil, performed with only 28 +- * comparisons and 34 "? :". If you can figure how to do this more +- * efficiently, let us know. +- */ +- const double m1 = (dos_two <= dos_thr) ? dos_two : dos_thr ; +- const double M1 = (dos_two <= dos_thr) ? dos_thr : dos_two ; +- const double m2 = (tre_two <= tre_thr) ? tre_two : tre_thr ; +- const double M2 = (tre_two <= tre_thr) ? tre_thr : tre_two ; +- const double m6 = (dos_one <= tre_one) ? dos_one : tre_one ; +- const double M6 = (dos_one <= tre_one) ? tre_one : dos_one ; +- const double m7 = (dos_fou <= tre_fou) ? dos_fou : tre_fou ; +- const double M7 = (dos_fou <= tre_fou) ? tre_fou : dos_fou ; +- const double m3 = (uno_two <= uno_thr) ? uno_two : uno_thr ; +- const double M3 = (uno_two <= uno_thr) ? uno_thr : uno_two ; +- const double m4 = (qua_two <= qua_thr) ? qua_two : qua_thr ; +- const double M4 = (qua_two <= qua_thr) ? qua_thr : qua_two ; +- const double m5 = LBB_MIN( m1, m2 ); +- const double M5 = LBB_MAX( M1, M2 ); +- const double m10 = LBB_MIN( m6, uno_one ); +- const double M10 = LBB_MAX( M6, uno_one ); +- const double m11 = LBB_MIN( m6, qua_one ); +- const double M11 = LBB_MAX( M6, qua_one ); +- const double m12 = LBB_MIN( m7, uno_fou ); +- const double M12 = LBB_MAX( M7, uno_fou ); +- const double m13 = LBB_MIN( m7, qua_fou ); +- const double M13 = LBB_MAX( M7, qua_fou ); +- const double m8 = LBB_MIN( m5, m3 ); +- const double M8 = LBB_MAX( M5, M3 ); +- const double m9 = LBB_MIN( m5, m4 ); +- const double M9 = LBB_MAX( M5, M4 ); +- const double min00 = LBB_MIN( m8, m10 ); +- const double max00 = LBB_MAX( M8, M10 ); +- const double min10 = LBB_MIN( m8, m12 ); +- const double max10 = LBB_MAX( M8, M12 ); +- const double min01 = LBB_MIN( m9, m11 ); +- const double max01 = LBB_MAX( M9, M11 ); +- const double min11 = LBB_MIN( m9, m13 ); +- const double max11 = LBB_MAX( M9, M13 ); ++ /* ++ * Computation of the four min and four max over 3x3 input data ++ * sub-blocks of the 4x4 input stencil, performed with only 28 ++ * comparisons and 34 "? :". If you can figure how to do this more ++ * efficiently, let us know. ++ */ ++ const double m1 = (dos_two <= dos_thr) ? dos_two : dos_thr; ++ const double M1 = (dos_two <= dos_thr) ? dos_thr : dos_two; ++ const double m2 = (tre_two <= tre_thr) ? tre_two : tre_thr; ++ const double M2 = (tre_two <= tre_thr) ? tre_thr : tre_two; ++ const double m6 = (dos_one <= tre_one) ? dos_one : tre_one; ++ const double M6 = (dos_one <= tre_one) ? tre_one : dos_one; ++ const double m7 = (dos_fou <= tre_fou) ? dos_fou : tre_fou; ++ const double M7 = (dos_fou <= tre_fou) ? tre_fou : dos_fou; ++ const double m3 = (uno_two <= uno_thr) ? uno_two : uno_thr; ++ const double M3 = (uno_two <= uno_thr) ? uno_thr : uno_two; ++ const double m4 = (qua_two <= qua_thr) ? qua_two : qua_thr; ++ const double M4 = (qua_two <= qua_thr) ? qua_thr : qua_two; ++ const double m5 = LBB_MIN(m1, m2); ++ const double M5 = LBB_MAX(M1, M2); ++ const double m10 = LBB_MIN(m6, uno_one); ++ const double M10 = LBB_MAX(M6, uno_one); ++ const double m11 = LBB_MIN(m6, qua_one); ++ const double M11 = LBB_MAX(M6, qua_one); ++ const double m12 = LBB_MIN(m7, uno_fou); ++ const double M12 = LBB_MAX(M7, uno_fou); ++ const double m13 = LBB_MIN(m7, qua_fou); ++ const double M13 = LBB_MAX(M7, qua_fou); ++ const double m8 = LBB_MIN(m5, m3); ++ const double M8 = LBB_MAX(M5, M3); ++ const double m9 = LBB_MIN(m5, m4); ++ const double M9 = LBB_MAX(M5, M4); ++ const double min00 = LBB_MIN(m8, m10); ++ const double max00 = LBB_MAX(M8, M10); ++ const double min10 = LBB_MIN(m8, m12); ++ const double max10 = LBB_MAX(M8, M12); ++ const double min01 = LBB_MIN(m9, m11); ++ const double max01 = LBB_MAX(M9, M11); ++ const double min11 = LBB_MIN(m9, m13); ++ const double max11 = LBB_MAX(M9, M13); + #endif + +- /* +- * The remainder of the "per channel" computation involves the +- * computation of: +- * +- * --8 conditional moves, +- * +- * --8 signs (in which the sign of zero is unimportant), +- * +- * --12 minima of two values, +- * +- * --8 maxima of two values, +- * +- * --8 absolute values, +- * +- * for a grand total of 29 minima, 25 maxima, 8 conditional moves, 8 +- * signs, and 8 absolute values. If everything is done with +- * conditional moves, "only" 28+8+8+12+8+8=72 flags are involved +- * (because initial min and max can be computed with one flag). +- * +- * The "per channel" part of the computation also involves 107 +- * arithmetic operations (54 *, 21 +, 42 -). +- */ +- +- /* +- * Distances to the local min and max: +- */ +- const double u00 = dos_two - min00; +- const double v00 = max00 - dos_two; +- const double u10 = dos_thr - min10; +- const double v10 = max10 - dos_thr; +- const double u01 = tre_two - min01; +- const double v01 = max01 - tre_two; +- const double u11 = tre_thr - min11; +- const double v11 = max11 - tre_thr; +- +- /* +- * Initial values of the derivatives computed with centered +- * differences. Factors of 1/2 are left out because they are folded +- * in later: +- */ +- const double dble_dzdx00i = dos_thr - dos_one; +- const double dble_dzdy11i = qua_thr - dos_thr; +- const double dble_dzdx10i = dos_fou - dos_two; +- const double dble_dzdy01i = qua_two - dos_two; +- const double dble_dzdx01i = tre_thr - tre_one; +- const double dble_dzdy10i = tre_thr - uno_thr; +- const double dble_dzdx11i = tre_fou - tre_two; +- const double dble_dzdy00i = tre_two - uno_two; +- +- /* +- * Signs of the derivatives. The upcoming clamping does not change +- * them (except if the clamping sends a negative derivative to 0, in +- * which case the sign does not matter anyway). +- */ +- const double sign_dzdx00 = LBB_SIGN( dble_dzdx00i ); +- const double sign_dzdx10 = LBB_SIGN( dble_dzdx10i ); +- const double sign_dzdx01 = LBB_SIGN( dble_dzdx01i ); +- const double sign_dzdx11 = LBB_SIGN( dble_dzdx11i ); +- +- const double sign_dzdy00 = LBB_SIGN( dble_dzdy00i ); +- const double sign_dzdy10 = LBB_SIGN( dble_dzdy10i ); +- const double sign_dzdy01 = LBB_SIGN( dble_dzdy01i ); +- const double sign_dzdy11 = LBB_SIGN( dble_dzdy11i ); +- +- /* +- * Initial values of the cross-derivatives. Factors of 1/4 are left +- * out because folded in later: +- */ +- const double quad_d2zdxdy00i = uno_one - uno_thr + dble_dzdx01i; +- const double quad_d2zdxdy10i = uno_two - uno_fou + dble_dzdx11i; +- const double quad_d2zdxdy01i = qua_thr - qua_one - dble_dzdx00i; +- const double quad_d2zdxdy11i = qua_fou - qua_two - dble_dzdx10i; +- +- /* +- * Slope limiters. The key multiplier is 3 but we fold a factor of +- * 2, hence 6: +- */ +- const double dble_slopelimit_00 = 6.0 * LBB_MIN( u00, v00 ); +- const double dble_slopelimit_10 = 6.0 * LBB_MIN( u10, v10 ); +- const double dble_slopelimit_01 = 6.0 * LBB_MIN( u01, v01 ); +- const double dble_slopelimit_11 = 6.0 * LBB_MIN( u11, v11 ); +- +- /* +- * Clamped first derivatives: +- */ +- const double dble_dzdx00 = +- ( sign_dzdx00 * dble_dzdx00i <= dble_slopelimit_00 ) +- ? dble_dzdx00i : sign_dzdx00 * dble_slopelimit_00; +- const double dble_dzdy00 = +- ( sign_dzdy00 * dble_dzdy00i <= dble_slopelimit_00 ) +- ? dble_dzdy00i : sign_dzdy00 * dble_slopelimit_00; +- const double dble_dzdx10 = +- ( sign_dzdx10 * dble_dzdx10i <= dble_slopelimit_10 ) +- ? dble_dzdx10i : sign_dzdx10 * dble_slopelimit_10; +- const double dble_dzdy10 = +- ( sign_dzdy10 * dble_dzdy10i <= dble_slopelimit_10 ) +- ? dble_dzdy10i : sign_dzdy10 * dble_slopelimit_10; +- const double dble_dzdx01 = +- ( sign_dzdx01 * dble_dzdx01i <= dble_slopelimit_01 ) +- ? dble_dzdx01i : sign_dzdx01 * dble_slopelimit_01; +- const double dble_dzdy01 = +- ( sign_dzdy01 * dble_dzdy01i <= dble_slopelimit_01 ) +- ? dble_dzdy01i : sign_dzdy01 * dble_slopelimit_01; +- const double dble_dzdx11 = +- ( sign_dzdx11 * dble_dzdx11i <= dble_slopelimit_11 ) +- ? dble_dzdx11i : sign_dzdx11 * dble_slopelimit_11; +- const double dble_dzdy11 = +- ( sign_dzdy11 * dble_dzdy11i <= dble_slopelimit_11 ) +- ? dble_dzdy11i : sign_dzdy11 * dble_slopelimit_11; +- +- /* +- * Sums and differences of first derivatives: +- */ +- const double twelve_sum00 = 6.0 * ( dble_dzdx00 + dble_dzdy00 ); +- const double twelve_dif00 = 6.0 * ( dble_dzdx00 - dble_dzdy00 ); +- const double twelve_sum10 = 6.0 * ( dble_dzdx10 + dble_dzdy10 ); +- const double twelve_dif10 = 6.0 * ( dble_dzdx10 - dble_dzdy10 ); +- const double twelve_sum01 = 6.0 * ( dble_dzdx01 + dble_dzdy01 ); +- const double twelve_dif01 = 6.0 * ( dble_dzdx01 - dble_dzdy01 ); +- const double twelve_sum11 = 6.0 * ( dble_dzdx11 + dble_dzdy11 ); +- const double twelve_dif11 = 6.0 * ( dble_dzdx11 - dble_dzdy11 ); +- +- /* +- * Absolute values of the sums: +- */ +- const double twelve_abs_sum00 = LBB_ABS( twelve_sum00 ); +- const double twelve_abs_sum10 = LBB_ABS( twelve_sum10 ); +- const double twelve_abs_sum01 = LBB_ABS( twelve_sum01 ); +- const double twelve_abs_sum11 = LBB_ABS( twelve_sum11 ); +- +- /* +- * Scaled distances to the min: +- */ +- const double u00_times_36 = 36.0 * u00; +- const double u10_times_36 = 36.0 * u10; +- const double u01_times_36 = 36.0 * u01; +- const double u11_times_36 = 36.0 * u11; +- +- /* +- * First cross-derivative limiter: +- */ +- const double first_limit00 = twelve_abs_sum00 - u00_times_36; +- const double first_limit10 = twelve_abs_sum10 - u10_times_36; +- const double first_limit01 = twelve_abs_sum01 - u01_times_36; +- const double first_limit11 = twelve_abs_sum11 - u11_times_36; +- +- const double quad_d2zdxdy00ii = LBB_MAX( quad_d2zdxdy00i, first_limit00 ); +- const double quad_d2zdxdy10ii = LBB_MAX( quad_d2zdxdy10i, first_limit10 ); +- const double quad_d2zdxdy01ii = LBB_MAX( quad_d2zdxdy01i, first_limit01 ); +- const double quad_d2zdxdy11ii = LBB_MAX( quad_d2zdxdy11i, first_limit11 ); +- +- /* +- * Scaled distances to the max: +- */ +- const double v00_times_36 = 36.0 * v00; +- const double v10_times_36 = 36.0 * v10; +- const double v01_times_36 = 36.0 * v01; +- const double v11_times_36 = 36.0 * v11; +- +- /* +- * Second cross-derivative limiter: +- */ +- const double second_limit00 = v00_times_36 - twelve_abs_sum00; +- const double second_limit10 = v10_times_36 - twelve_abs_sum10; +- const double second_limit01 = v01_times_36 - twelve_abs_sum01; +- const double second_limit11 = v11_times_36 - twelve_abs_sum11; +- +- const double quad_d2zdxdy00iii = LBB_MIN( quad_d2zdxdy00ii, second_limit00 ); +- const double quad_d2zdxdy10iii = LBB_MIN( quad_d2zdxdy10ii, second_limit10 ); +- const double quad_d2zdxdy01iii = LBB_MIN( quad_d2zdxdy01ii, second_limit01 ); +- const double quad_d2zdxdy11iii = LBB_MIN( quad_d2zdxdy11ii, second_limit11 ); +- +- /* +- * Absolute values of the differences: +- */ +- const double twelve_abs_dif00 = LBB_ABS( twelve_dif00 ); +- const double twelve_abs_dif10 = LBB_ABS( twelve_dif10 ); +- const double twelve_abs_dif01 = LBB_ABS( twelve_dif01 ); +- const double twelve_abs_dif11 = LBB_ABS( twelve_dif11 ); +- +- /* +- * Third cross-derivative limiter: +- */ +- const double third_limit00 = twelve_abs_dif00 - v00_times_36; +- const double third_limit10 = twelve_abs_dif10 - v10_times_36; +- const double third_limit01 = twelve_abs_dif01 - v01_times_36; +- const double third_limit11 = twelve_abs_dif11 - v11_times_36; +- +- const double quad_d2zdxdy00iiii = LBB_MAX( quad_d2zdxdy00iii, third_limit00); +- const double quad_d2zdxdy10iiii = LBB_MAX( quad_d2zdxdy10iii, third_limit10); +- const double quad_d2zdxdy01iiii = LBB_MAX( quad_d2zdxdy01iii, third_limit01); +- const double quad_d2zdxdy11iiii = LBB_MAX( quad_d2zdxdy11iii, third_limit11); +- +- /* +- * Fourth cross-derivative limiter: +- */ +- const double fourth_limit00 = u00_times_36 - twelve_abs_dif00; +- const double fourth_limit10 = u10_times_36 - twelve_abs_dif10; +- const double fourth_limit01 = u01_times_36 - twelve_abs_dif01; +- const double fourth_limit11 = u11_times_36 - twelve_abs_dif11; +- +- const double quad_d2zdxdy00 = LBB_MIN( quad_d2zdxdy00iiii, fourth_limit00); +- const double quad_d2zdxdy10 = LBB_MIN( quad_d2zdxdy10iiii, fourth_limit10); +- const double quad_d2zdxdy01 = LBB_MIN( quad_d2zdxdy01iiii, fourth_limit01); +- const double quad_d2zdxdy11 = LBB_MIN( quad_d2zdxdy11iiii, fourth_limit11); +- +- /* +- * Part of the result which does not need derivatives: +- */ +- const double newval1 = c00 * dos_two + c10 * dos_thr + +- c01 * tre_two + c11 * tre_thr; +- +- /* +- * Twice the part of the result which only needs first derivatives. +- */ +- const double newval2 = c00dx * dble_dzdx00 + c10dx * dble_dzdx10 + +- c01dx * dble_dzdx01 + c11dx * dble_dzdx11 + +- c00dy * dble_dzdy00 + c10dy * dble_dzdy10 + +- c01dy * dble_dzdy01 + c11dy * dble_dzdy11; +- +- /* +- * Four times the part of the result which only uses cross +- * derivatives: +- */ +- const double newval3 = c00dxdy * quad_d2zdxdy00 + c10dxdy * quad_d2zdxdy10 + +- c01dxdy * quad_d2zdxdy01 + c11dxdy * quad_d2zdxdy11; +- +- const double newval = newval1 + .5 * newval2 + .25 * newval3; +- +- return newval; ++ /* ++ * The remainder of the "per channel" computation involves the ++ * computation of: ++ * ++ * --8 conditional moves, ++ * ++ * --8 signs (in which the sign of zero is unimportant), ++ * ++ * --12 minima of two values, ++ * ++ * --8 maxima of two values, ++ * ++ * --8 absolute values, ++ * ++ * for a grand total of 29 minima, 25 maxima, 8 conditional moves, 8 ++ * signs, and 8 absolute values. If everything is done with ++ * conditional moves, "only" 28+8+8+12+8+8=72 flags are involved ++ * (because initial min and max can be computed with one flag). ++ * ++ * The "per channel" part of the computation also involves 107 ++ * arithmetic operations (54 *, 21 +, 42 -). ++ */ ++ ++ /* ++ * Distances to the local min and max: ++ */ ++ const double u00 = dos_two - min00; ++ const double v00 = max00 - dos_two; ++ const double u10 = dos_thr - min10; ++ const double v10 = max10 - dos_thr; ++ const double u01 = tre_two - min01; ++ const double v01 = max01 - tre_two; ++ const double u11 = tre_thr - min11; ++ const double v11 = max11 - tre_thr; ++ ++ /* ++ * Initial values of the derivatives computed with centered ++ * differences. Factors of 1/2 are left out because they are folded ++ * in later: ++ */ ++ const double dble_dzdx00i = dos_thr - dos_one; ++ const double dble_dzdy11i = qua_thr - dos_thr; ++ const double dble_dzdx10i = dos_fou - dos_two; ++ const double dble_dzdy01i = qua_two - dos_two; ++ const double dble_dzdx01i = tre_thr - tre_one; ++ const double dble_dzdy10i = tre_thr - uno_thr; ++ const double dble_dzdx11i = tre_fou - tre_two; ++ const double dble_dzdy00i = tre_two - uno_two; ++ ++ /* ++ * Signs of the derivatives. The upcoming clamping does not change ++ * them (except if the clamping sends a negative derivative to 0, in ++ * which case the sign does not matter anyway). ++ */ ++ const double sign_dzdx00 = LBB_SIGN(dble_dzdx00i); ++ const double sign_dzdx10 = LBB_SIGN(dble_dzdx10i); ++ const double sign_dzdx01 = LBB_SIGN(dble_dzdx01i); ++ const double sign_dzdx11 = LBB_SIGN(dble_dzdx11i); ++ ++ const double sign_dzdy00 = LBB_SIGN(dble_dzdy00i); ++ const double sign_dzdy10 = LBB_SIGN(dble_dzdy10i); ++ const double sign_dzdy01 = LBB_SIGN(dble_dzdy01i); ++ const double sign_dzdy11 = LBB_SIGN(dble_dzdy11i); ++ ++ /* ++ * Initial values of the cross-derivatives. Factors of 1/4 are left ++ * out because folded in later: ++ */ ++ const double quad_d2zdxdy00i = uno_one - uno_thr + dble_dzdx01i; ++ const double quad_d2zdxdy10i = uno_two - uno_fou + dble_dzdx11i; ++ const double quad_d2zdxdy01i = qua_thr - qua_one - dble_dzdx00i; ++ const double quad_d2zdxdy11i = qua_fou - qua_two - dble_dzdx10i; ++ ++ /* ++ * Slope limiters. The key multiplier is 3 but we fold a factor of ++ * 2, hence 6: ++ */ ++ const double dble_slopelimit_00 = 6.0 * LBB_MIN(u00, v00); ++ const double dble_slopelimit_10 = 6.0 * LBB_MIN(u10, v10); ++ const double dble_slopelimit_01 = 6.0 * LBB_MIN(u01, v01); ++ const double dble_slopelimit_11 = 6.0 * LBB_MIN(u11, v11); ++ ++ /* ++ * Clamped first derivatives: ++ */ ++ const double dble_dzdx00 = ++ (sign_dzdx00 * dble_dzdx00i <= dble_slopelimit_00) ++ ? dble_dzdx00i ++ : sign_dzdx00 * dble_slopelimit_00; ++ const double dble_dzdy00 = ++ (sign_dzdy00 * dble_dzdy00i <= dble_slopelimit_00) ++ ? dble_dzdy00i ++ : sign_dzdy00 * dble_slopelimit_00; ++ const double dble_dzdx10 = ++ (sign_dzdx10 * dble_dzdx10i <= dble_slopelimit_10) ++ ? dble_dzdx10i ++ : sign_dzdx10 * dble_slopelimit_10; ++ const double dble_dzdy10 = ++ (sign_dzdy10 * dble_dzdy10i <= dble_slopelimit_10) ++ ? dble_dzdy10i ++ : sign_dzdy10 * dble_slopelimit_10; ++ const double dble_dzdx01 = ++ (sign_dzdx01 * dble_dzdx01i <= dble_slopelimit_01) ++ ? dble_dzdx01i ++ : sign_dzdx01 * dble_slopelimit_01; ++ const double dble_dzdy01 = ++ (sign_dzdy01 * dble_dzdy01i <= dble_slopelimit_01) ++ ? dble_dzdy01i ++ : sign_dzdy01 * dble_slopelimit_01; ++ const double dble_dzdx11 = ++ (sign_dzdx11 * dble_dzdx11i <= dble_slopelimit_11) ++ ? dble_dzdx11i ++ : sign_dzdx11 * dble_slopelimit_11; ++ const double dble_dzdy11 = ++ (sign_dzdy11 * dble_dzdy11i <= dble_slopelimit_11) ++ ? dble_dzdy11i ++ : sign_dzdy11 * dble_slopelimit_11; ++ ++ /* ++ * Sums and differences of first derivatives: ++ */ ++ const double twelve_sum00 = 6.0 * (dble_dzdx00 + dble_dzdy00); ++ const double twelve_dif00 = 6.0 * (dble_dzdx00 - dble_dzdy00); ++ const double twelve_sum10 = 6.0 * (dble_dzdx10 + dble_dzdy10); ++ const double twelve_dif10 = 6.0 * (dble_dzdx10 - dble_dzdy10); ++ const double twelve_sum01 = 6.0 * (dble_dzdx01 + dble_dzdy01); ++ const double twelve_dif01 = 6.0 * (dble_dzdx01 - dble_dzdy01); ++ const double twelve_sum11 = 6.0 * (dble_dzdx11 + dble_dzdy11); ++ const double twelve_dif11 = 6.0 * (dble_dzdx11 - dble_dzdy11); ++ ++ /* ++ * Absolute values of the sums: ++ */ ++ const double twelve_abs_sum00 = LBB_ABS(twelve_sum00); ++ const double twelve_abs_sum10 = LBB_ABS(twelve_sum10); ++ const double twelve_abs_sum01 = LBB_ABS(twelve_sum01); ++ const double twelve_abs_sum11 = LBB_ABS(twelve_sum11); ++ ++ /* ++ * Scaled distances to the min: ++ */ ++ const double u00_times_36 = 36.0 * u00; ++ const double u10_times_36 = 36.0 * u10; ++ const double u01_times_36 = 36.0 * u01; ++ const double u11_times_36 = 36.0 * u11; ++ ++ /* ++ * First cross-derivative limiter: ++ */ ++ const double first_limit00 = twelve_abs_sum00 - u00_times_36; ++ const double first_limit10 = twelve_abs_sum10 - u10_times_36; ++ const double first_limit01 = twelve_abs_sum01 - u01_times_36; ++ const double first_limit11 = twelve_abs_sum11 - u11_times_36; ++ ++ const double quad_d2zdxdy00ii = LBB_MAX(quad_d2zdxdy00i, first_limit00); ++ const double quad_d2zdxdy10ii = LBB_MAX(quad_d2zdxdy10i, first_limit10); ++ const double quad_d2zdxdy01ii = LBB_MAX(quad_d2zdxdy01i, first_limit01); ++ const double quad_d2zdxdy11ii = LBB_MAX(quad_d2zdxdy11i, first_limit11); ++ ++ /* ++ * Scaled distances to the max: ++ */ ++ const double v00_times_36 = 36.0 * v00; ++ const double v10_times_36 = 36.0 * v10; ++ const double v01_times_36 = 36.0 * v01; ++ const double v11_times_36 = 36.0 * v11; ++ ++ /* ++ * Second cross-derivative limiter: ++ */ ++ const double second_limit00 = v00_times_36 - twelve_abs_sum00; ++ const double second_limit10 = v10_times_36 - twelve_abs_sum10; ++ const double second_limit01 = v01_times_36 - twelve_abs_sum01; ++ const double second_limit11 = v11_times_36 - twelve_abs_sum11; ++ ++ const double quad_d2zdxdy00iii = LBB_MIN(quad_d2zdxdy00ii, second_limit00); ++ const double quad_d2zdxdy10iii = LBB_MIN(quad_d2zdxdy10ii, second_limit10); ++ const double quad_d2zdxdy01iii = LBB_MIN(quad_d2zdxdy01ii, second_limit01); ++ const double quad_d2zdxdy11iii = LBB_MIN(quad_d2zdxdy11ii, second_limit11); ++ ++ /* ++ * Absolute values of the differences: ++ */ ++ const double twelve_abs_dif00 = LBB_ABS(twelve_dif00); ++ const double twelve_abs_dif10 = LBB_ABS(twelve_dif10); ++ const double twelve_abs_dif01 = LBB_ABS(twelve_dif01); ++ const double twelve_abs_dif11 = LBB_ABS(twelve_dif11); ++ ++ /* ++ * Third cross-derivative limiter: ++ */ ++ const double third_limit00 = twelve_abs_dif00 - v00_times_36; ++ const double third_limit10 = twelve_abs_dif10 - v10_times_36; ++ const double third_limit01 = twelve_abs_dif01 - v01_times_36; ++ const double third_limit11 = twelve_abs_dif11 - v11_times_36; ++ ++ const double quad_d2zdxdy00iiii = LBB_MAX(quad_d2zdxdy00iii, third_limit00); ++ const double quad_d2zdxdy10iiii = LBB_MAX(quad_d2zdxdy10iii, third_limit10); ++ const double quad_d2zdxdy01iiii = LBB_MAX(quad_d2zdxdy01iii, third_limit01); ++ const double quad_d2zdxdy11iiii = LBB_MAX(quad_d2zdxdy11iii, third_limit11); ++ ++ /* ++ * Fourth cross-derivative limiter: ++ */ ++ const double fourth_limit00 = u00_times_36 - twelve_abs_dif00; ++ const double fourth_limit10 = u10_times_36 - twelve_abs_dif10; ++ const double fourth_limit01 = u01_times_36 - twelve_abs_dif01; ++ const double fourth_limit11 = u11_times_36 - twelve_abs_dif11; ++ ++ const double quad_d2zdxdy00 = LBB_MIN(quad_d2zdxdy00iiii, fourth_limit00); ++ const double quad_d2zdxdy10 = LBB_MIN(quad_d2zdxdy10iiii, fourth_limit10); ++ const double quad_d2zdxdy01 = LBB_MIN(quad_d2zdxdy01iiii, fourth_limit01); ++ const double quad_d2zdxdy11 = LBB_MIN(quad_d2zdxdy11iiii, fourth_limit11); ++ ++ /* ++ * Part of the result which does not need derivatives: ++ */ ++ const double newval1 = c00 * dos_two + c10 * dos_thr + ++ c01 * tre_two + c11 * tre_thr; ++ ++ /* ++ * Twice the part of the result which only needs first derivatives. ++ */ ++ const double newval2 = c00dx * dble_dzdx00 + c10dx * dble_dzdx10 + ++ c01dx * dble_dzdx01 + c11dx * dble_dzdx11 + ++ c00dy * dble_dzdy00 + c10dy * dble_dzdy10 + ++ c01dy * dble_dzdy01 + c11dy * dble_dzdy11; ++ ++ /* ++ * Four times the part of the result which only uses cross ++ * derivatives: ++ */ ++ const double newval3 = c00dxdy * quad_d2zdxdy00 + c10dxdy * quad_d2zdxdy10 + ++ c01dxdy * quad_d2zdxdy01 + c11dxdy * quad_d2zdxdy11; ++ ++ const double newval = newval1 + .5 * newval2 + .25 * newval3; ++ ++ return newval; + } + + /* +@@ -579,296 +587,294 @@ lbbicubic( const double c00, + * It would be nice to do this with templates but we can't figure out + * how to do it cleanly. Suggestions welcome! + */ +-#define LBB_CONVERSION( conversion ) \ +- template static void inline \ +- lbb_ ## conversion( void* restrict pout, \ +- const VipsPel* restrict pin, \ +- const int bands, \ +- const int lskip, \ +- const double relative_x, \ +- const double relative_y ) \ +- { \ +- T* restrict out = (T *) pout; \ +- \ +- const T* restrict in = (T *) pin; \ +- \ +- const int one_shift = -bands; \ +- const int thr_shift = bands; \ +- const int fou_shift = 2*bands; \ +- \ +- const int uno_two_shift = -lskip; \ +- \ +- const int tre_two_shift = lskip; \ +- const int qua_two_shift = 2*lskip; \ +- \ +- const int uno_one_shift = uno_two_shift + one_shift; \ +- const int dos_one_shift = one_shift; \ +- const int tre_one_shift = tre_two_shift + one_shift; \ +- const int qua_one_shift = qua_two_shift + one_shift; \ +- \ +- const int uno_thr_shift = uno_two_shift + thr_shift; \ +- const int dos_thr_shift = thr_shift; \ +- const int tre_thr_shift = tre_two_shift + thr_shift; \ +- const int qua_thr_shift = qua_two_shift + thr_shift; \ +- \ +- const int uno_fou_shift = uno_two_shift + fou_shift; \ +- const int dos_fou_shift = fou_shift; \ +- const int tre_fou_shift = tre_two_shift + fou_shift; \ +- const int qua_fou_shift = qua_two_shift + fou_shift; \ +- \ +- const double xp1over2 = relative_x; \ +- const double xm1over2 = xp1over2 - 1.0; \ +- const double onepx = 0.5 + xp1over2; \ +- const double onemx = 1.5 - xp1over2; \ +- const double xp1over2sq = xp1over2 * xp1over2; \ +- \ +- const double yp1over2 = relative_y; \ +- const double ym1over2 = yp1over2 - 1.0; \ +- const double onepy = 0.5 + yp1over2; \ +- const double onemy = 1.5 - yp1over2; \ +- const double yp1over2sq = yp1over2 * yp1over2; \ +- \ +- const double xm1over2sq = xm1over2 * xm1over2; \ +- const double ym1over2sq = ym1over2 * ym1over2; \ +- \ +- const double twice1px = onepx + onepx; \ +- const double twice1py = onepy + onepy; \ +- const double twice1mx = onemx + onemx; \ +- const double twice1my = onemy + onemy; \ +- \ +- const double xm1over2sq_times_ym1over2sq = xm1over2sq * ym1over2sq; \ +- const double xp1over2sq_times_ym1over2sq = xp1over2sq * ym1over2sq; \ +- const double xp1over2sq_times_yp1over2sq = xp1over2sq * yp1over2sq; \ +- const double xm1over2sq_times_yp1over2sq = xm1over2sq * yp1over2sq; \ +- \ +- const double four_times_1px_times_1py = twice1px * twice1py; \ +- const double four_times_1mx_times_1py = twice1mx * twice1py; \ +- const double twice_xp1over2_times_1py = xp1over2 * twice1py; \ +- const double twice_xm1over2_times_1py = xm1over2 * twice1py; \ +- \ +- const double twice_xm1over2_times_1my = xm1over2 * twice1my; \ +- const double twice_xp1over2_times_1my = xp1over2 * twice1my; \ +- const double four_times_1mx_times_1my = twice1mx * twice1my; \ +- const double four_times_1px_times_1my = twice1px * twice1my; \ +- \ +- const double twice_1px_times_ym1over2 = twice1px * ym1over2; \ +- const double twice_1mx_times_ym1over2 = twice1mx * ym1over2; \ +- const double xp1over2_times_ym1over2 = xp1over2 * ym1over2; \ +- const double xm1over2_times_ym1over2 = xm1over2 * ym1over2; \ +- \ +- const double xm1over2_times_yp1over2 = xm1over2 * yp1over2; \ +- const double xp1over2_times_yp1over2 = xp1over2 * yp1over2; \ +- const double twice_1mx_times_yp1over2 = twice1mx * yp1over2; \ +- const double twice_1px_times_yp1over2 = twice1px * yp1over2; \ +- \ +- const double c00 = \ +- four_times_1px_times_1py * xm1over2sq_times_ym1over2sq; \ +- const double c00dx = \ +- twice_xp1over2_times_1py * xm1over2sq_times_ym1over2sq; \ +- const double c00dy = \ +- twice_1px_times_yp1over2 * xm1over2sq_times_ym1over2sq; \ +- const double c00dxdy = \ +- xp1over2_times_yp1over2 * xm1over2sq_times_ym1over2sq; \ +- \ +- const double c10 = \ +- four_times_1mx_times_1py * xp1over2sq_times_ym1over2sq; \ +- const double c10dx = \ +- twice_xm1over2_times_1py * xp1over2sq_times_ym1over2sq; \ +- const double c10dy = \ +- twice_1mx_times_yp1over2 * xp1over2sq_times_ym1over2sq; \ +- const double c10dxdy = \ +- xm1over2_times_yp1over2 * xp1over2sq_times_ym1over2sq; \ +- \ +- const double c01 = \ +- four_times_1px_times_1my * xm1over2sq_times_yp1over2sq; \ +- const double c01dx = \ +- twice_xp1over2_times_1my * xm1over2sq_times_yp1over2sq; \ +- const double c01dy = \ +- twice_1px_times_ym1over2 * xm1over2sq_times_yp1over2sq; \ +- const double c01dxdy = \ +- xp1over2_times_ym1over2 * xm1over2sq_times_yp1over2sq; \ +- \ +- const double c11 = \ +- four_times_1mx_times_1my * xp1over2sq_times_yp1over2sq; \ +- const double c11dx = \ +- twice_xm1over2_times_1my * xp1over2sq_times_yp1over2sq; \ +- const double c11dy = \ +- twice_1mx_times_ym1over2 * xp1over2sq_times_yp1over2sq; \ +- const double c11dxdy = \ +- xm1over2_times_ym1over2 * xp1over2sq_times_yp1over2sq; \ +- \ +- int band = bands; \ +- \ +- do \ +- { \ +- const double double_result = \ +- lbbicubic( c00, \ +- c10, \ +- c01, \ +- c11, \ +- c00dx, \ +- c10dx, \ +- c01dx, \ +- c11dx, \ +- c00dy, \ +- c10dy, \ +- c01dy, \ +- c11dy, \ +- c00dxdy, \ +- c10dxdy, \ +- c01dxdy, \ +- c11dxdy, \ +- in[ uno_one_shift ], \ +- in[ uno_two_shift ], \ +- in[ uno_thr_shift ], \ +- in[ uno_fou_shift ], \ +- in[ dos_one_shift ], \ +- in[ 0 ], \ +- in[ dos_thr_shift ], \ +- in[ dos_fou_shift ], \ +- in[ tre_one_shift ], \ +- in[ tre_two_shift ], \ +- in[ tre_thr_shift ], \ +- in[ tre_fou_shift ], \ +- in[ qua_one_shift ], \ +- in[ qua_two_shift ], \ +- in[ qua_thr_shift ], \ +- in[ qua_fou_shift ] ); \ +- \ +- const T result = to_ ## conversion( double_result ); \ +- in++; \ +- *out++ = result; \ +- } while (--band); \ +- } +- +-LBB_CONVERSION( fptypes ) +-LBB_CONVERSION( withsign ) +-LBB_CONVERSION( nosign ) +- +-#define CALL( T, conversion ) \ +- lbb_ ## conversion( out, \ +- p, \ +- bands, \ +- lskip, \ +- relative_x, \ +- relative_y ); ++#define LBB_CONVERSION(conversion) \ ++ template \ ++ static void inline lbb_##conversion(void *restrict pout, \ ++ const VipsPel *restrict pin, \ ++ const int bands, \ ++ const int lskip, \ ++ const double relative_x, \ ++ const double relative_y) \ ++ { \ ++ T *restrict out = (T *) pout; \ ++\ ++ const T *restrict in = (T *) pin; \ ++\ ++ const int one_shift = -bands; \ ++ const int thr_shift = bands; \ ++ const int fou_shift = 2 * bands; \ ++\ ++ const int uno_two_shift = -lskip; \ ++\ ++ const int tre_two_shift = lskip; \ ++ const int qua_two_shift = 2 * lskip; \ ++\ ++ const int uno_one_shift = uno_two_shift + one_shift; \ ++ const int dos_one_shift = one_shift; \ ++ const int tre_one_shift = tre_two_shift + one_shift; \ ++ const int qua_one_shift = qua_two_shift + one_shift; \ ++\ ++ const int uno_thr_shift = uno_two_shift + thr_shift; \ ++ const int dos_thr_shift = thr_shift; \ ++ const int tre_thr_shift = tre_two_shift + thr_shift; \ ++ const int qua_thr_shift = qua_two_shift + thr_shift; \ ++\ ++ const int uno_fou_shift = uno_two_shift + fou_shift; \ ++ const int dos_fou_shift = fou_shift; \ ++ const int tre_fou_shift = tre_two_shift + fou_shift; \ ++ const int qua_fou_shift = qua_two_shift + fou_shift; \ ++\ ++ const double xp1over2 = relative_x; \ ++ const double xm1over2 = xp1over2 - 1.0; \ ++ const double onepx = 0.5 + xp1over2; \ ++ const double onemx = 1.5 - xp1over2; \ ++ const double xp1over2sq = xp1over2 * xp1over2; \ ++\ ++ const double yp1over2 = relative_y; \ ++ const double ym1over2 = yp1over2 - 1.0; \ ++ const double onepy = 0.5 + yp1over2; \ ++ const double onemy = 1.5 - yp1over2; \ ++ const double yp1over2sq = yp1over2 * yp1over2; \ ++\ ++ const double xm1over2sq = xm1over2 * xm1over2; \ ++ const double ym1over2sq = ym1over2 * ym1over2; \ ++\ ++ const double twice1px = onepx + onepx; \ ++ const double twice1py = onepy + onepy; \ ++ const double twice1mx = onemx + onemx; \ ++ const double twice1my = onemy + onemy; \ ++\ ++ const double xm1over2sq_times_ym1over2sq = xm1over2sq * ym1over2sq; \ ++ const double xp1over2sq_times_ym1over2sq = xp1over2sq * ym1over2sq; \ ++ const double xp1over2sq_times_yp1over2sq = xp1over2sq * yp1over2sq; \ ++ const double xm1over2sq_times_yp1over2sq = xm1over2sq * yp1over2sq; \ ++\ ++ const double four_times_1px_times_1py = twice1px * twice1py; \ ++ const double four_times_1mx_times_1py = twice1mx * twice1py; \ ++ const double twice_xp1over2_times_1py = xp1over2 * twice1py; \ ++ const double twice_xm1over2_times_1py = xm1over2 * twice1py; \ ++\ ++ const double twice_xm1over2_times_1my = xm1over2 * twice1my; \ ++ const double twice_xp1over2_times_1my = xp1over2 * twice1my; \ ++ const double four_times_1mx_times_1my = twice1mx * twice1my; \ ++ const double four_times_1px_times_1my = twice1px * twice1my; \ ++\ ++ const double twice_1px_times_ym1over2 = twice1px * ym1over2; \ ++ const double twice_1mx_times_ym1over2 = twice1mx * ym1over2; \ ++ const double xp1over2_times_ym1over2 = xp1over2 * ym1over2; \ ++ const double xm1over2_times_ym1over2 = xm1over2 * ym1over2; \ ++\ ++ const double xm1over2_times_yp1over2 = xm1over2 * yp1over2; \ ++ const double xp1over2_times_yp1over2 = xp1over2 * yp1over2; \ ++ const double twice_1mx_times_yp1over2 = twice1mx * yp1over2; \ ++ const double twice_1px_times_yp1over2 = twice1px * yp1over2; \ ++\ ++ const double c00 = \ ++ four_times_1px_times_1py * xm1over2sq_times_ym1over2sq; \ ++ const double c00dx = \ ++ twice_xp1over2_times_1py * xm1over2sq_times_ym1over2sq; \ ++ const double c00dy = \ ++ twice_1px_times_yp1over2 * xm1over2sq_times_ym1over2sq; \ ++ const double c00dxdy = \ ++ xp1over2_times_yp1over2 * xm1over2sq_times_ym1over2sq; \ ++\ ++ const double c10 = \ ++ four_times_1mx_times_1py * xp1over2sq_times_ym1over2sq; \ ++ const double c10dx = \ ++ twice_xm1over2_times_1py * xp1over2sq_times_ym1over2sq; \ ++ const double c10dy = \ ++ twice_1mx_times_yp1over2 * xp1over2sq_times_ym1over2sq; \ ++ const double c10dxdy = \ ++ xm1over2_times_yp1over2 * xp1over2sq_times_ym1over2sq; \ ++\ ++ const double c01 = \ ++ four_times_1px_times_1my * xm1over2sq_times_yp1over2sq; \ ++ const double c01dx = \ ++ twice_xp1over2_times_1my * xm1over2sq_times_yp1over2sq; \ ++ const double c01dy = \ ++ twice_1px_times_ym1over2 * xm1over2sq_times_yp1over2sq; \ ++ const double c01dxdy = \ ++ xp1over2_times_ym1over2 * xm1over2sq_times_yp1over2sq; \ ++\ ++ const double c11 = \ ++ four_times_1mx_times_1my * xp1over2sq_times_yp1over2sq; \ ++ const double c11dx = \ ++ twice_xm1over2_times_1my * xp1over2sq_times_yp1over2sq; \ ++ const double c11dy = \ ++ twice_1mx_times_ym1over2 * xp1over2sq_times_yp1over2sq; \ ++ const double c11dxdy = \ ++ xm1over2_times_ym1over2 * xp1over2sq_times_yp1over2sq; \ ++\ ++ int band = bands; \ ++\ ++ do { \ ++ const double double_result = \ ++ lbbicubic(c00, \ ++ c10, \ ++ c01, \ ++ c11, \ ++ c00dx, \ ++ c10dx, \ ++ c01dx, \ ++ c11dx, \ ++ c00dy, \ ++ c10dy, \ ++ c01dy, \ ++ c11dy, \ ++ c00dxdy, \ ++ c10dxdy, \ ++ c01dxdy, \ ++ c11dxdy, \ ++ in[uno_one_shift], \ ++ in[uno_two_shift], \ ++ in[uno_thr_shift], \ ++ in[uno_fou_shift], \ ++ in[dos_one_shift], \ ++ in[0], \ ++ in[dos_thr_shift], \ ++ in[dos_fou_shift], \ ++ in[tre_one_shift], \ ++ in[tre_two_shift], \ ++ in[tre_thr_shift], \ ++ in[tre_fou_shift], \ ++ in[qua_one_shift], \ ++ in[qua_two_shift], \ ++ in[qua_thr_shift], \ ++ in[qua_fou_shift]); \ ++\ ++ const T result = to_##conversion(double_result); \ ++ in++; \ ++ *out++ = result; \ ++ } while (--band); \ ++ } ++ ++LBB_CONVERSION(fptypes) ++LBB_CONVERSION(withsign) ++LBB_CONVERSION(nosign) ++ ++#define CALL(T, conversion) \ ++ lbb_##conversion(out, \ ++ p, \ ++ bands, \ ++ lskip, \ ++ relative_x, \ ++ relative_y); + + /* + * We need C linkage: + */ + extern "C" { +-G_DEFINE_TYPE( VipsInterpolateLbb, vips_interpolate_lbb, +- VIPS_TYPE_INTERPOLATE ); ++G_DEFINE_TYPE(VipsInterpolateLbb, vips_interpolate_lbb, ++ VIPS_TYPE_INTERPOLATE); + } + + static void +-vips_interpolate_lbb_interpolate( VipsInterpolate* restrict interpolate, +- void* restrict out, +- VipsRegion* restrict in, +- double absolute_x, +- double absolute_y ) ++vips_interpolate_lbb_interpolate(VipsInterpolate *restrict interpolate, ++ void *restrict out, ++ VipsRegion *restrict in, ++ double absolute_x, ++ double absolute_y) + { +- /* absolute_x and absolute_y are always >= 1.0 (see double-check assert +- * below), so we don't need floor(). +- * +- * It's 1 not 0 since have a window_offset of 1. +- */ +- const int ix = (int) absolute_x; +- const int iy = (int) absolute_y; +- +- /* +- * Move the pointer to (the first band of) the top/left pixel of the +- * 2x2 group of pixel centers which contains the sampling location +- * in its convex hull: +- */ +- const VipsPel* restrict p = VIPS_REGION_ADDR( in, ix, iy ); +- +- const double relative_x = absolute_x - ix; +- const double relative_y = absolute_y - iy; +- +- /* +- * VIPS versions of Nicolas's pixel addressing values. +- */ +- const int lskip = VIPS_REGION_LSKIP( in ) / +- VIPS_IMAGE_SIZEOF_ELEMENT( in->im ); +- /* +- * Double the bands for complex images to account for the real and +- * imaginary parts being computed independently: +- */ +- const int actual_bands = in->im->Bands; +- const int bands = +- vips_band_format_iscomplex( in->im->BandFmt ) ? +- 2 * actual_bands : actual_bands; +- +- g_assert( ix - 1 >= in->valid.left ); +- g_assert( iy - 1 >= in->valid.top ); +- g_assert( ix + 2 < VIPS_RECT_RIGHT( &in->valid ) ); +- g_assert( iy + 2 < VIPS_RECT_BOTTOM( &in->valid ) ); +- +- /* Confirm that absolute_x and absolute_y are >= 1, see above. +- */ +- g_assert( absolute_x >= 1.0 ); +- g_assert( absolute_y >= 1.0 ); +- +- switch( in->im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- CALL( unsigned char, nosign ); +- break; +- +- case VIPS_FORMAT_CHAR: +- CALL( signed char, withsign ); +- break; +- +- case VIPS_FORMAT_USHORT: +- CALL( unsigned short, nosign ); +- break; +- +- case VIPS_FORMAT_SHORT: +- CALL( signed short, withsign ); +- break; +- +- case VIPS_FORMAT_UINT: +- CALL( unsigned int, nosign ); +- break; +- +- case VIPS_FORMAT_INT: +- CALL( signed int, withsign ); +- break; +- +- /* +- * Complex images are handled by doubling of bands. +- */ +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- CALL( float, fptypes ); +- break; +- +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- CALL( double, fptypes ); +- break; +- +- default: +- g_assert( 0 ); +- break; +- } ++ /* absolute_x and absolute_y are always >= 1.0 (see double-check assert ++ * below), so we don't need floor(). ++ * ++ * It's 1 not 0 since have a window_offset of 1. ++ */ ++ const int ix = (int) absolute_x; ++ const int iy = (int) absolute_y; ++ ++ /* ++ * Move the pointer to (the first band of) the top/left pixel of the ++ * 2x2 group of pixel centers which contains the sampling location ++ * in its convex hull: ++ */ ++ const VipsPel *restrict p = VIPS_REGION_ADDR(in, ix, iy); ++ ++ const double relative_x = absolute_x - ix; ++ const double relative_y = absolute_y - iy; ++ ++ /* ++ * VIPS versions of Nicolas's pixel addressing values. ++ */ ++ const int lskip = VIPS_REGION_LSKIP(in) / ++ VIPS_IMAGE_SIZEOF_ELEMENT(in->im); ++ /* ++ * Double the bands for complex images to account for the real and ++ * imaginary parts being computed independently: ++ */ ++ const int actual_bands = in->im->Bands; ++ const int bands = ++ vips_band_format_iscomplex(in->im->BandFmt) ? 2 * actual_bands : actual_bands; ++ ++ g_assert(ix - 1 >= in->valid.left); ++ g_assert(iy - 1 >= in->valid.top); ++ g_assert(ix + 2 < VIPS_RECT_RIGHT(&in->valid)); ++ g_assert(iy + 2 < VIPS_RECT_BOTTOM(&in->valid)); ++ ++ /* Confirm that absolute_x and absolute_y are >= 1, see above. ++ */ ++ g_assert(absolute_x >= 1.0); ++ g_assert(absolute_y >= 1.0); ++ ++ switch (in->im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ CALL(unsigned char, nosign); ++ break; ++ ++ case VIPS_FORMAT_CHAR: ++ CALL(signed char, withsign); ++ break; ++ ++ case VIPS_FORMAT_USHORT: ++ CALL(unsigned short, nosign); ++ break; ++ ++ case VIPS_FORMAT_SHORT: ++ CALL(signed short, withsign); ++ break; ++ ++ case VIPS_FORMAT_UINT: ++ CALL(unsigned int, nosign); ++ break; ++ ++ case VIPS_FORMAT_INT: ++ CALL(signed int, withsign); ++ break; ++ ++ /* ++ * Complex images are handled by doubling of bands. ++ */ ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ CALL(float, fptypes); ++ break; ++ ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ CALL(double, fptypes); ++ break; ++ ++ default: ++ g_assert(0); ++ break; ++ } + } + + static void +-vips_interpolate_lbb_class_init( VipsInterpolateLbbClass *klass ) ++vips_interpolate_lbb_class_init(VipsInterpolateLbbClass *klass) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( klass ); +- VipsInterpolateClass *interpolate_class = +- VIPS_INTERPOLATE_CLASS( klass ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(klass); ++ VipsInterpolateClass *interpolate_class = ++ VIPS_INTERPOLATE_CLASS(klass); + +- object_class->nickname = "lbb"; +- object_class->description = _( "reduced halo bicubic" ); ++ object_class->nickname = "lbb"; ++ object_class->description = _("reduced halo bicubic"); + +- interpolate_class->interpolate = vips_interpolate_lbb_interpolate; +- interpolate_class->window_size = 4; ++ interpolate_class->interpolate = vips_interpolate_lbb_interpolate; ++ interpolate_class->window_size = 4; + } + + static void +-vips_interpolate_lbb_init( VipsInterpolateLbb *lbb ) ++vips_interpolate_lbb_init(VipsInterpolateLbb *lbb) + { + } +diff --git a/libvips/resample/mapim.c b/libvips/resample/mapim.c +index 0498fb924d..15243e65d8 100644 +--- a/libvips/resample/mapim.c ++++ b/libvips/resample/mapim.c +@@ -16,28 +16,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -94,55 +94,56 @@ typedef struct _VipsMapim { + + typedef VipsResampleClass VipsMapimClass; + +-G_DEFINE_TYPE( VipsMapim, vips_mapim, VIPS_TYPE_RESAMPLE ); ++G_DEFINE_TYPE(VipsMapim, vips_mapim, VIPS_TYPE_RESAMPLE); + +-/* Minmax of a line of pixels. ++/* Minmax of a line of pixels. + */ +-#define MINMAX( TYPE ) { \ +- TYPE * restrict p1 = (TYPE *) p; \ +- \ +- TYPE t_max_x = max_x; \ +- TYPE t_min_x = min_x; \ +- TYPE t_max_y = max_y; \ +- TYPE t_min_y = min_y; \ +- \ +- for( x = 0; x < r->width; x++ ) { \ +- TYPE px = p1[0]; \ +- TYPE py = p1[1]; \ +- \ +- if( first ) { \ +- t_min_x = px; \ +- t_max_x = px; \ +- t_min_y = py; \ +- t_max_y = py; \ +- \ +- first = FALSE; \ +- } \ +- else { \ +- if( px > t_max_x ) \ +- t_max_x = px; \ +- else if( px < t_min_x ) \ ++#define MINMAX(TYPE) \ ++ { \ ++ TYPE *restrict p1 = (TYPE *) p; \ ++\ ++ TYPE t_max_x = max_x; \ ++ TYPE t_min_x = min_x; \ ++ TYPE t_max_y = max_y; \ ++ TYPE t_min_y = min_y; \ ++\ ++ for (x = 0; x < r->width; x++) { \ ++ TYPE px = p1[0]; \ ++ TYPE py = p1[1]; \ ++\ ++ if (first) { \ + t_min_x = px; \ +- \ +- if( py > t_max_y ) \ +- t_max_y = py; \ +- else if( py < t_min_y ) \ ++ t_max_x = px; \ + t_min_y = py; \ ++ t_max_y = py; \ ++\ ++ first = FALSE; \ ++ } \ ++ else { \ ++ if (px > t_max_x) \ ++ t_max_x = px; \ ++ else if (px < t_min_x) \ ++ t_min_x = px; \ ++\ ++ if (py > t_max_y) \ ++ t_max_y = py; \ ++ else if (py < t_min_y) \ ++ t_min_y = py; \ ++ } \ ++\ ++ p1 += 2; \ + } \ +- \ +- p1 += 2; \ +- } \ +- \ +- min_x = t_min_x; \ +- max_x = t_max_x; \ +- min_y = t_min_y; \ +- max_y = t_max_y; \ +-} ++\ ++ min_x = t_min_x; \ ++ max_x = t_max_x; \ ++ min_y = t_min_y; \ ++ max_y = t_max_y; \ ++ } + + /* Scan a region and find min/max in the two axes. + */ + static void +-vips_mapim_region_minmax( VipsRegion *region, VipsRect *r, VipsRect *bounds ) ++vips_mapim_region_minmax(VipsRegion *region, VipsRect *r, VipsRect *bounds) + { + double min_x; + double max_x; +@@ -156,43 +157,43 @@ vips_mapim_region_minmax( VipsRegion *region, VipsRect *r, VipsRect *bounds ) + min_y = 0.0; + max_y = 0.0; + first = TRUE; +- for( y = 0; y < r->height; y++ ) { +- VipsPel * restrict p = +- VIPS_REGION_ADDR( region, r->left, r->top + y ); +- +- switch( region->im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- MINMAX( unsigned char ); +- break; +- +- case VIPS_FORMAT_CHAR: +- MINMAX( signed char ); +- break; +- +- case VIPS_FORMAT_USHORT: +- MINMAX( unsigned short ); +- break; +- +- case VIPS_FORMAT_SHORT: +- MINMAX( signed short ); +- break; +- +- case VIPS_FORMAT_UINT: +- MINMAX( unsigned int ); +- break; +- +- case VIPS_FORMAT_INT: +- MINMAX( signed int ); +- break; +- +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- MINMAX( float ); +- break; +- +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- MINMAX( double ); ++ for (y = 0; y < r->height; y++) { ++ VipsPel *restrict p = ++ VIPS_REGION_ADDR(region, r->left, r->top + y); ++ ++ switch (region->im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ MINMAX(unsigned char); ++ break; ++ ++ case VIPS_FORMAT_CHAR: ++ MINMAX(signed char); ++ break; ++ ++ case VIPS_FORMAT_USHORT: ++ MINMAX(unsigned short); ++ break; ++ ++ case VIPS_FORMAT_SHORT: ++ MINMAX(signed short); ++ break; ++ ++ case VIPS_FORMAT_UINT: ++ MINMAX(unsigned int); ++ break; ++ ++ case VIPS_FORMAT_INT: ++ MINMAX(signed int); ++ break; ++ ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ MINMAX(float); ++ break; ++ ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ MINMAX(double); + break; + + default: +@@ -203,18 +204,18 @@ vips_mapim_region_minmax( VipsRegion *region, VipsRect *r, VipsRect *bounds ) + /* bounds is the bounding box -- we must round left/top down and round + * bottom/right up. + */ +- min_x = floor( min_x ); +- min_y = floor( min_y ); +- max_x = ceil( max_x ); +- max_y = ceil( max_y ); ++ min_x = floor(min_x); ++ min_y = floor(min_y); ++ max_x = ceil(max_x); ++ max_y = ceil(max_y); + + /* bounds uses ints, so we must clip the range down from double. + * Coordinates can be negative for the antialias edges. + */ +- min_x = VIPS_CLIP( -1, min_x, VIPS_MAX_COORD ); +- min_y = VIPS_CLIP( -1, min_y, VIPS_MAX_COORD ); +- max_x = VIPS_CLIP( -1, max_x, VIPS_MAX_COORD ); +- max_y = VIPS_CLIP( -1, max_y, VIPS_MAX_COORD ); ++ min_x = VIPS_CLIP(-1, min_x, VIPS_MAX_COORD); ++ min_y = VIPS_CLIP(-1, min_y, VIPS_MAX_COORD); ++ max_x = VIPS_CLIP(-1, max_x, VIPS_MAX_COORD); ++ max_y = VIPS_CLIP(-1, max_y, VIPS_MAX_COORD); + + bounds->left = min_x; + bounds->top = min_y; +@@ -224,123 +225,126 @@ vips_mapim_region_minmax( VipsRegion *region, VipsRect *r, VipsRect *bounds ) + + /* Unsigned int types. + */ +-#define ULOOKUP( TYPE ) { \ +- TYPE * restrict p1 = (TYPE *) p; \ +- \ +- for( x = 0; x < r->width; x++ ) { \ +- TYPE px = p1[0]; \ +- TYPE py = p1[1]; \ +- \ +- if( px >= clip_width || \ +- py >= clip_height ) { \ +- for( z = 0; z < ps; z++ ) \ +- q[z] = mapim->ink[z]; \ ++#define ULOOKUP(TYPE) \ ++ { \ ++ TYPE *restrict p1 = (TYPE *) p; \ ++\ ++ for (x = 0; x < r->width; x++) { \ ++ TYPE px = p1[0]; \ ++ TYPE py = p1[1]; \ ++\ ++ if (px >= clip_width || \ ++ py >= clip_height) { \ ++ for (z = 0; z < ps; z++) \ ++ q[z] = mapim->ink[z]; \ ++ } \ ++ else \ ++ interpolate(mapim->interpolate, q, ir[0], \ ++ px + window_offset + 1, \ ++ py + window_offset + 1); \ ++\ ++ p1 += 2; \ ++ q += ps; \ + } \ +- else \ +- interpolate( mapim->interpolate, q, ir[0], \ +- px + window_offset + 1, \ +- py + window_offset + 1 ); \ +- \ +- p1 += 2; \ +- q += ps; \ +- } \ +-} ++ } + + /* Signed int types. We allow -1 for x/y to get edge antialiasing. + */ +-#define LOOKUP( TYPE ) { \ +- TYPE * restrict p1 = (TYPE *) p; \ +- \ +- for( x = 0; x < r->width; x++ ) { \ +- TYPE px = p1[0]; \ +- TYPE py = p1[1]; \ +- \ +- if( px < -1 || \ +- px >= clip_width || \ +- py < -1 || \ +- py >= clip_height ) { \ +- for( z = 0; z < ps; z++ ) \ +- q[z] = mapim->ink[z]; \ ++#define LOOKUP(TYPE) \ ++ { \ ++ TYPE *restrict p1 = (TYPE *) p; \ ++\ ++ for (x = 0; x < r->width; x++) { \ ++ TYPE px = p1[0]; \ ++ TYPE py = p1[1]; \ ++\ ++ if (px < -1 || \ ++ px >= clip_width || \ ++ py < -1 || \ ++ py >= clip_height) { \ ++ for (z = 0; z < ps; z++) \ ++ q[z] = mapim->ink[z]; \ ++ } \ ++ else \ ++ interpolate(mapim->interpolate, q, ir[0], \ ++ px + window_offset + 1, \ ++ py + window_offset + 1); \ ++\ ++ p1 += 2; \ ++ q += ps; \ + } \ +- else \ +- interpolate( mapim->interpolate, q, ir[0], \ +- px + window_offset + 1, \ +- py + window_offset + 1 ); \ +- \ +- p1 += 2; \ +- q += ps; \ +- } \ +-} ++ } + + /* Float types. We allow -1 for x/y to get edge antialiasing. + */ +-#define FLOOKUP( TYPE ) { \ +- TYPE * restrict p1 = (TYPE *) p; \ +- \ +- for( x = 0; x < r->width; x++ ) { \ +- TYPE px = p1[0]; \ +- TYPE py = p1[1]; \ +- \ +- if( VIPS_ISNAN( px ) || \ +- VIPS_ISNAN( py ) || \ +- px < -1 || \ +- px >= clip_width || \ +- py < -1 || \ +- py >= clip_height ) { \ +- for( z = 0; z < ps; z++ ) \ +- q[z] = mapim->ink[z]; \ ++#define FLOOKUP(TYPE) \ ++ { \ ++ TYPE *restrict p1 = (TYPE *) p; \ ++\ ++ for (x = 0; x < r->width; x++) { \ ++ TYPE px = p1[0]; \ ++ TYPE py = p1[1]; \ ++\ ++ if (VIPS_ISNAN(px) || \ ++ VIPS_ISNAN(py) || \ ++ px < -1 || \ ++ px >= clip_width || \ ++ py < -1 || \ ++ py >= clip_height) { \ ++ for (z = 0; z < ps; z++) \ ++ q[z] = mapim->ink[z]; \ ++ } \ ++ else \ ++ interpolate(mapim->interpolate, q, ir[0], \ ++ px + window_offset + 1, \ ++ py + window_offset + 1); \ ++\ ++ p1 += 2; \ ++ q += ps; \ + } \ +- else \ +- interpolate( mapim->interpolate, q, ir[0], \ +- px + window_offset + 1, \ +- py + window_offset + 1 ); \ +- \ +- p1 += 2; \ +- q += ps; \ +- } \ +-} ++ } + + static int +-vips_mapim_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop ) ++vips_mapim_gen(VipsRegion * or, void *seq, void *a, void *b, gboolean *stop) + { +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + VipsRegion **ir = (VipsRegion **) seq; + const VipsImage **in_array = (const VipsImage **) a; +- const VipsMapim *mapim = (VipsMapim *) b; ++ const VipsMapim *mapim = (VipsMapim *) b; + const VipsImage *in = in_array[0]; +- const int window_size = +- vips_interpolate_get_window_size( mapim->interpolate ); +- const int window_offset = +- vips_interpolate_get_window_offset( mapim->interpolate ); +- const VipsInterpolateMethod interpolate = +- vips_interpolate_get_method( mapim->interpolate ); +- const int ps = VIPS_IMAGE_SIZEOF_PEL( in ); ++ const int window_size = ++ vips_interpolate_get_window_size(mapim->interpolate); ++ const int window_offset = ++ vips_interpolate_get_window_offset(mapim->interpolate); ++ const VipsInterpolateMethod interpolate = ++ vips_interpolate_get_method(mapim->interpolate); ++ const int ps = VIPS_IMAGE_SIZEOF_PEL(in); + const int clip_width = in->Xsize - window_size; + const int clip_height = in->Ysize - window_size; + + VipsRect bounds, need, image, clipped; + int x, y, z; +- ++ + #ifdef DEBUG_VERBOSE +- printf( "vips_mapim_gen: " +- "generating left=%d, top=%d, width=%d, height=%d\n", ++ printf("vips_mapim_gen: " ++ "generating left=%d, top=%d, width=%d, height=%d\n", + r->left, + r->top, + r->width, +- r->height ); ++ r->height); + #endif /*DEBUG_VERBOSE*/ + + /* Fetch the chunk of the index image we need, and find the max/min in + * x and y. + */ +- if( vips_region_prepare( ir[1], r ) ) +- return( -1 ); ++ if (vips_region_prepare(ir[1], r)) ++ return (-1); + +- VIPS_GATE_START( "vips_mapim_gen: work" ); ++ VIPS_GATE_START("vips_mapim_gen: work"); + +- vips_mapim_region_minmax( ir[1], r, &bounds ); ++ vips_mapim_region_minmax(ir[1], r, &bounds); + +- VIPS_GATE_STOP( "vips_mapim_gen: work" ); ++ VIPS_GATE_STOP("vips_mapim_gen: work"); + + /* Enlarge by the stencil size. + */ +@@ -358,71 +362,79 @@ vips_mapim_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop ) + image.top = 0; + image.width = in->Xsize; + image.height = in->Ysize; +- vips_rect_intersectrect( &need, &image, &clipped ); ++ vips_rect_intersectrect(&need, &image, &clipped); + + #ifdef DEBUG_VERBOSE +- printf( "vips_mapim_gen: " +- "preparing left=%d, top=%d, width=%d, height=%d\n", ++ printf("vips_mapim_gen: " ++ "preparing left=%d, top=%d, width=%d, height=%d\n", + clipped.left, + clipped.top, + clipped.width, +- clipped.height ); ++ clipped.height); + #endif /*DEBUG_VERBOSE*/ + +- if( vips_rect_isempty( &clipped ) ) { +- vips_region_paint_pel( or, r, mapim->ink ); +- return( 0 ); ++ if (vips_rect_isempty(&clipped)) { ++ vips_region_paint_pel(or, r, mapim->ink); ++ return (0); + } +- if( vips_region_prepare( ir[0], &clipped ) ) +- return( -1 ); ++ if (vips_region_prepare(ir[0], &clipped)) ++ return (-1); + +- VIPS_GATE_START( "vips_mapim_gen: work" ); ++ VIPS_GATE_START("vips_mapim_gen: work"); + + /* Resample! x/y loop over pixels in the output (and index) images. + */ +- for( y = 0; y < r->height; y++ ) { +- VipsPel * restrict p = +- VIPS_REGION_ADDR( ir[1], r->left, y + r->top ); +- VipsPel * restrict q = +- VIPS_REGION_ADDR( or, r->left, y + r->top ); +- +- switch( ir[1]->im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- ULOOKUP( unsigned char ); break; +- case VIPS_FORMAT_CHAR: +- LOOKUP( signed char ); break; +- case VIPS_FORMAT_USHORT: +- ULOOKUP( unsigned short ); break; +- case VIPS_FORMAT_SHORT: +- LOOKUP( signed short ); break; +- case VIPS_FORMAT_UINT: +- ULOOKUP( unsigned int ); break; +- case VIPS_FORMAT_INT: +- LOOKUP( signed int ); break; +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- FLOOKUP( float ); break; +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- FLOOKUP( double ); break; ++ for (y = 0; y < r->height; y++) { ++ VipsPel *restrict p = ++ VIPS_REGION_ADDR(ir[1], r->left, y + r->top); ++ VipsPel *restrict q = ++ VIPS_REGION_ADDR(or, r->left, y + r->top); ++ ++ switch (ir[1]->im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ ULOOKUP(unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ LOOKUP(signed char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ ULOOKUP(unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ LOOKUP(signed short); ++ break; ++ case VIPS_FORMAT_UINT: ++ ULOOKUP(unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ LOOKUP(signed int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ FLOOKUP(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ FLOOKUP(double); ++ break; + + default: + g_assert_not_reached(); + } + } + +- VIPS_GATE_STOP( "vips_mapim_gen: work" ); ++ VIPS_GATE_STOP("vips_mapim_gen: work"); + +- return( 0 ); ++ return (0); + } + + static int +-vips_mapim_build( VipsObject *object ) ++vips_mapim_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsResample *resample = VIPS_RESAMPLE( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsResample *resample = VIPS_RESAMPLE(object); + VipsMapim *mapim = (VipsMapim *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 6 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 6); + + VipsImage *in; + int window_size; +@@ -433,49 +445,49 @@ vips_mapim_build( VipsObject *object ) + gboolean have_premultiplied; + VipsBandFormat unpremultiplied_format; + +- if( VIPS_OBJECT_CLASS( vips_mapim_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_mapim_parent_class)->build(object)) ++ return (-1); + +- if( vips_check_coding_known( class->nickname, resample->in ) || +- vips_check_twocomponents( class->nickname, mapim->index ) ) +- return( -1 ); ++ if (vips_check_coding_known(class->nickname, resample->in) || ++ vips_check_twocomponents(class->nickname, mapim->index)) ++ return (-1); + + in = resample->in; + +- if( vips_image_decode( in, &t[0] ) ) +- return( -1 ); ++ if (vips_image_decode(in, &t[0])) ++ return (-1); + in = t[0]; + +- window_size = vips_interpolate_get_window_size( mapim->interpolate ); +- window_offset = +- vips_interpolate_get_window_offset( mapim->interpolate ); ++ window_size = vips_interpolate_get_window_size(mapim->interpolate); ++ window_offset = ++ vips_interpolate_get_window_offset(mapim->interpolate); + + /* Add new pixels around the input so we can interpolate at the edges. + * + * We add the interpolate stencil, plus one extra pixel on all the +- * edges. This means when we clip in generate (above) we can be sure ++ * edges. This means when we clip in generate (above) we can be sure + * we clip outside the real pixels and don't get jaggies on edges. + * + * We allow for the +1 in the adjustment to window_offset in generate. + */ +- if( vips_embed( in, &t[1], +- window_offset + 1, window_offset + 1, +- in->Xsize + window_size - 1 + 2, +- in->Ysize + window_size - 1 + 2, +- "extend", mapim->extend, +- "background", mapim->background, +- NULL ) ) +- return( -1 ); ++ if (vips_embed(in, &t[1], ++ window_offset + 1, window_offset + 1, ++ in->Xsize + window_size - 1 + 2, ++ in->Ysize + window_size - 1 + 2, ++ "extend", mapim->extend, ++ "background", mapim->background, ++ NULL)) ++ return (-1); + in = t[1]; + +- /* If there's an alpha and we've not premultiplied, we have to +- * premultiply before resampling. ++ /* If there's an alpha and we've not premultiplied, we have to ++ * premultiply before resampling. + */ + have_premultiplied = FALSE; +- if( vips_image_hasalpha( in ) && +- !mapim->premultiplied ) { +- if( vips_premultiply( in, &t[2], NULL ) ) +- return( -1 ); ++ if (vips_image_hasalpha(in) && ++ !mapim->premultiplied) { ++ if (vips_premultiply(in, &t[2], NULL)) ++ return (-1); + have_premultiplied = TRUE; + + /* vips_premultiply() makes a float image. When we +@@ -488,16 +500,16 @@ vips_mapim_build( VipsObject *object ) + + /* Convert the background to the image's format. + */ +- if( !(mapim->ink = vips__vector_to_ink( class->nickname, +- in, +- VIPS_AREA( mapim->background )->data, NULL, +- VIPS_AREA( mapim->background )->n )) ) +- return( -1 ); ++ if (!(mapim->ink = vips__vector_to_ink(class->nickname, ++ in, ++ VIPS_AREA(mapim->background)->data, NULL, ++ VIPS_AREA(mapim->background)->n))) ++ return (-1); + + t[3] = vips_image_new(); +- if( vips_image_pipelinev( t[3], VIPS_DEMAND_STYLE_SMALLTILE, +- in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(t[3], VIPS_DEMAND_STYLE_SMALLTILE, ++ in, NULL)) ++ return (-1); + + t[3]->Xsize = mapim->index->Xsize; + t[3]->Ysize = mapim->index->Ysize; +@@ -505,82 +517,81 @@ vips_mapim_build( VipsObject *object ) + mapim->in_array[0] = in; + mapim->in_array[1] = mapim->index; + mapim->in_array[2] = NULL; +- if( vips_image_generate( t[3], +- vips_start_many, vips_mapim_gen, vips_stop_many, +- mapim->in_array, mapim ) ) +- return( -1 ); ++ if (vips_image_generate(t[3], ++ vips_start_many, vips_mapim_gen, vips_stop_many, ++ mapim->in_array, mapim)) ++ return (-1); + + in = t[3]; + +- if( have_premultiplied ) { +- if( vips_unpremultiply( in, &t[4], NULL ) || +- vips_cast( t[4], &t[5], unpremultiplied_format, NULL ) ) +- return( -1 ); ++ if (have_premultiplied) { ++ if (vips_unpremultiply(in, &t[4], NULL) || ++ vips_cast(t[4], &t[5], unpremultiplied_format, NULL)) ++ return (-1); + in = t[5]; + } + +- if( vips_image_write( in, resample->out ) ) +- return( -1 ); ++ if (vips_image_write(in, resample->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_mapim_class_init( VipsMapimClass *class ) ++vips_mapim_class_init(VipsMapimClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_mapim_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_mapim_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "mapim"; +- vobject_class->description = _( "resample with a map image" ); ++ vobject_class->description = _("resample with a map image"); + vobject_class->build = vips_mapim_build; + +- VIPS_ARG_IMAGE( class, "index", 3, +- _( "Index" ), +- _( "Index pixels with this" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsMapim, index ) ); +- +- VIPS_ARG_INTERPOLATE( class, "interpolate", 4, +- _( "Interpolate" ), +- _( "Interpolate pixels with this" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMapim, interpolate ) ); +- +- VIPS_ARG_ENUM( class, "extend", 117, +- _( "Extend" ), +- _( "How to generate the extra pixels" ), ++ VIPS_ARG_IMAGE(class, "index", 3, ++ _("Index"), ++ _("Index pixels with this"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsMapim, index)); ++ ++ VIPS_ARG_INTERPOLATE(class, "interpolate", 4, ++ _("Interpolate"), ++ _("Interpolate pixels with this"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMapim, extend ), +- VIPS_TYPE_EXTEND, VIPS_EXTEND_BACKGROUND ); ++ G_STRUCT_OFFSET(VipsMapim, interpolate)); + +- VIPS_ARG_BOXED( class, "background", 116, +- _( "Background" ), +- _( "Background value" ), ++ VIPS_ARG_ENUM(class, "extend", 117, ++ _("Extend"), ++ _("How to generate the extra pixels"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMapim, background ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsMapim, extend), ++ VIPS_TYPE_EXTEND, VIPS_EXTEND_BACKGROUND); + +- VIPS_ARG_BOOL( class, "premultiplied", 117, +- _( "Premultiplied" ), +- _( "Images have premultiplied alpha" ), ++ VIPS_ARG_BOXED(class, "background", 116, ++ _("Background"), ++ _("Background value"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsMapim, premultiplied ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsMapim, background), ++ VIPS_TYPE_ARRAY_DOUBLE); + ++ VIPS_ARG_BOOL(class, "premultiplied", 117, ++ _("Premultiplied"), ++ _("Images have premultiplied alpha"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsMapim, premultiplied), ++ FALSE); + } + + static void +-vips_mapim_init( VipsMapim *mapim ) ++vips_mapim_init(VipsMapim *mapim) + { +- mapim->interpolate = vips_interpolate_new( "bilinear" ); ++ mapim->interpolate = vips_interpolate_new("bilinear"); + mapim->extend = VIPS_EXTEND_BACKGROUND; +- mapim->background = vips_array_double_newv( 1, 0.0 ); ++ mapim->background = vips_array_double_newv(1, 0.0); + } + + /** +@@ -593,8 +604,8 @@ vips_mapim_init( VipsMapim *mapim ) + * Optional arguments: + * + * * @interpolate: interpolate pixels with this +- * * @extend: #VipsExtend how to generate new pixels +- * * @background: #VipsArrayDouble colour for new pixels ++ * * @extend: #VipsExtend how to generate new pixels ++ * * @background: #VipsArrayDouble colour for new pixels + * * @premultiplied: %gboolean, images are already premultiplied + * + * This operator resamples @in using @index to look up pixels. @out is +@@ -606,41 +617,41 @@ vips_mapim_init( VipsMapim *mapim ) + * ]| + * + * If @index has one band, that band must be complex. Otherwise, @index must +- * have two bands of any format. ++ * have two bands of any format. + * +- * Coordinates in @index are in pixels, with (0, 0) being the top-left corner ++ * Coordinates in @index are in pixels, with (0, 0) being the top-left corner + * of @in, and with y increasing down the image. Use vips_xyz() to build index +- * images. ++ * images. + * +- * @interpolate defaults to bilinear. ++ * @interpolate defaults to bilinear. + * +- * By default, new pixels are filled with @background. This defaults to +- * zero (black). You can set other extend types with @extend. #VIPS_EXTEND_COPY ++ * By default, new pixels are filled with @background. This defaults to ++ * zero (black). You can set other extend types with @extend. #VIPS_EXTEND_COPY + * is better for image upsizing. + * + * Image are normally treated as unpremultiplied, so this operation can be used + * directly on PNG images. If your images have been through vips_premultiply(), +- * set @premultiplied. ++ * set @premultiplied. + * + * This operation does not change xres or yres. The image resolution needs to +- * be updated by the application. ++ * be updated by the application. + * +- * See vips_maplut() for a 1D equivalent of this operation. ++ * See vips_maplut() for a 1D equivalent of this operation. + * +- * See also: vips_xyz(), vips_affine(), vips_resize(), ++ * See also: vips_xyz(), vips_affine(), vips_resize(), + * vips_maplut(), #VipsInterpolate. + * + * Returns: 0 on success, -1 on error + */ + int +-vips_mapim( VipsImage *in, VipsImage **out, VipsImage *index, ... ) ++vips_mapim(VipsImage *in, VipsImage **out, VipsImage *index, ...) + { + va_list ap; + int result; + +- va_start( ap, index ); +- result = vips_call_split( "mapim", ap, in, out, index ); +- va_end( ap ); ++ va_start(ap, index); ++ result = vips_call_split("mapim", ap, in, out, index); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/resample/nohalo.cpp b/libvips/resample/nohalo.cpp +index 4fa1c96676..1e86c76f4e 100644 +--- a/libvips/resample/nohalo.cpp ++++ b/libvips/resample/nohalo.cpp +@@ -17,28 +17,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify it +- under the terms of the GNU Lesser General Public License as +- published by the Free Software Foundation; either version 2 of the +- License, or (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify it ++ under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2 of the ++ License, or (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -249,19 +249,19 @@ + + #define VIPS_TYPE_INTERPOLATE_NOHALO \ + (vips_interpolate_nohalo_get_type()) +-#define VIPS_INTERPOLATE_NOHALO( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_INTERPOLATE_NOHALO, VipsInterpolateNohalo )) +-#define VIPS_INTERPOLATE_NOHALO_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_INTERPOLATE_NOHALO, VipsInterpolateNohaloClass)) +-#define VIPS_IS_INTERPOLATE_NOHALO( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_INTERPOLATE_NOHALO )) +-#define VIPS_IS_INTERPOLATE_NOHALO_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_INTERPOLATE_NOHALO )) +-#define VIPS_INTERPOLATE_NOHALO_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_INTERPOLATE_NOHALO, VipsInterpolateNohaloClass )) ++#define VIPS_INTERPOLATE_NOHALO(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_INTERPOLATE_NOHALO, VipsInterpolateNohalo)) ++#define VIPS_INTERPOLATE_NOHALO_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_INTERPOLATE_NOHALO, VipsInterpolateNohaloClass)) ++#define VIPS_IS_INTERPOLATE_NOHALO(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_INTERPOLATE_NOHALO)) ++#define VIPS_IS_INTERPOLATE_NOHALO_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_INTERPOLATE_NOHALO)) ++#define VIPS_INTERPOLATE_NOHALO_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_INTERPOLATE_NOHALO, VipsInterpolateNohaloClass)) + + typedef struct _VipsInterpolateNohalo { + VipsInterpolate parent_object; +@@ -306,382 +306,364 @@ typedef struct _VipsInterpolateNohaloClass { + * speed tests performed on a recent multicore Intel chip, especially + * when enlarging a sharp image by a large factor, hence the choice. + */ +-#define NOHALO_MINMOD(a,b,a_times_a,a_times_b) \ +- ( ( (a_times_b)>=0. ) ? ( (a_times_a)<=(a_times_b) ? (a) : (b) ) : 0. ) ++#define NOHALO_MINMOD(a, b, a_times_a, a_times_b) \ ++ (((a_times_b) >= 0.) ? ((a_times_a) <= (a_times_b) ? (a) : (b)) : 0.) + + /* + * Absolute value and sign macros: + */ +-#define NOHALO_ABS(x) ( ((x)>=0.) ? (x) : -(x) ) +-#define NOHALO_SIGN(x) ( ((x)>=0.) ? 1. : -1. ) ++#define NOHALO_ABS(x) (((x) >= 0.) ? (x) : -(x)) ++#define NOHALO_SIGN(x) (((x) >= 0.) ? 1. : -1.) + + /* + * MIN and MAX macros set up so that I can put the likely winner in + * the first argument (forward branch likely blah blah blah): + */ +-#define NOHALO_MIN(x,y) ( ((x)<=(y)) ? (x) : (y) ) +-#define NOHALO_MAX(x,y) ( ((x)>=(y)) ? (x) : (y) ) +- +- +-static void inline +-nohalo_subdivision (const double uno_two, +- const double uno_thr, +- const double uno_fou, +- const double dos_one, +- const double dos_two, +- const double dos_thr, +- const double dos_fou, +- const double dos_fiv, +- const double tre_one, +- const double tre_two, +- const double tre_thr, +- const double tre_fou, +- const double tre_fiv, +- const double qua_one, +- const double qua_two, +- const double qua_thr, +- const double qua_fou, +- const double qua_fiv, +- const double cin_two, +- const double cin_thr, +- const double cin_fou, +- double* restrict uno_one_1, +- double* restrict uno_two_1, +- double* restrict uno_thr_1, +- double* restrict uno_fou_1, +- double* restrict dos_one_1, +- double* restrict dos_two_1, +- double* restrict dos_thr_1, +- double* restrict dos_fou_1, +- double* restrict tre_one_1, +- double* restrict tre_two_1, +- double* restrict tre_thr_1, +- double* restrict tre_fou_1, +- double* restrict qua_one_1, +- double* restrict qua_two_1, +- double* restrict qua_thr_1, +- double* restrict qua_fou_1) ++#define NOHALO_MIN(x, y) (((x) <= (y)) ? (x) : (y)) ++#define NOHALO_MAX(x, y) (((x) >= (y)) ? (x) : (y)) ++ ++static void inline nohalo_subdivision(const double uno_two, ++ const double uno_thr, ++ const double uno_fou, ++ const double dos_one, ++ const double dos_two, ++ const double dos_thr, ++ const double dos_fou, ++ const double dos_fiv, ++ const double tre_one, ++ const double tre_two, ++ const double tre_thr, ++ const double tre_fou, ++ const double tre_fiv, ++ const double qua_one, ++ const double qua_two, ++ const double qua_thr, ++ const double qua_fou, ++ const double qua_fiv, ++ const double cin_two, ++ const double cin_thr, ++ const double cin_fou, ++ double *restrict uno_one_1, ++ double *restrict uno_two_1, ++ double *restrict uno_thr_1, ++ double *restrict uno_fou_1, ++ double *restrict dos_one_1, ++ double *restrict dos_two_1, ++ double *restrict dos_thr_1, ++ double *restrict dos_fou_1, ++ double *restrict tre_one_1, ++ double *restrict tre_two_1, ++ double *restrict tre_thr_1, ++ double *restrict tre_fou_1, ++ double *restrict qua_one_1, ++ double *restrict qua_two_1, ++ double *restrict qua_thr_1, ++ double *restrict qua_fou_1) + { +- /* +- * nohalo_subdivision calculates the missing twelve double density +- * pixel values, and also returns the "already known" four, so that +- * the sixteen values which make up the stencil of LBB are +- * available. +- */ +- /* +- * THE STENCIL OF INPUT VALUES: +- * +- * Pointer arithmetic is used to implicitly reflect the input +- * stencil about tre_thr---assumed closer to the sampling location +- * than other pixels (ties are OK)---in such a way that after +- * reflection the sampling point is to the bottom right of tre_thr. +- * +- * The following code and picture assumes that the stencil reflexion +- * has already been performed. +- * +- * (ix-1,iy-2) (ix,iy-2) (ix+1,iy-2) +- * =uno_two = uno_thr = uno_fou +- * +- * +- * +- * (ix-2,iy-1) (ix-1,iy-1) (ix,iy-1) (ix+1,iy-1) (ix+2,iy-1) +- * = dos_one = dos_two = dos_thr = dos_fou = dos_fiv +- * +- * +- * +- * (ix-2,iy) (ix-1,iy) (ix,iy) (ix+1,iy) (ix+2,iy) +- * = tre_one = tre_two = tre_thr = tre_fou = tre_fiv +- * X +- * +- * +- * (ix-2,iy+1) (ix-1,iy+1) (ix,iy+1) (ix+1,iy+1) (ix+2,iy+1) +- * = qua_one = qua_two = qua_thr = qua_fou = qua_fiv +- * +- * +- * +- * (ix-1,iy+2) (ix,iy+2) (ix+1,iy+2) +- * = cin_two = cin_thr = cin_fou +- * +- * +- * The above input pixel values are the ones needed in order to make +- * available the following values, needed by LBB: +- * +- * uno_one_1 = uno_two_1 = uno_thr_1 = uno_fou_1 = +- * (ix-1/2,iy-1/2) (ix,iy-1/2) (ix+1/2,iy-1/2) (ix+1,iy-1/2) +- * +- * +- * +- * +- * dos_one_1 = dos_two_1 = dos_thr_1 = dos_fou_1 = +- * (ix-1/2,iy) (ix,iy) (ix+1/2,iy) (ix+1,iy) +- * +- * X +- * +- * +- * tre_one_1 = tre_two_1 = tre_thr_1 = tre_fou_1 = +- * (ix-1/2,iy+1/2) (ix,iy+1/2) (ix+1/2,iy+1/2) (ix+1,iy+1/2) +- * +- * +- * +- * +- * qua_one_1 = qua_two_1 = qua_thr_1 = qua_fou_1 = +- * (ix-1/2,iy+1) (ix,iy+1) (ix+1/2,iy+1) (ix+1,iy+1) +- * +- */ +- +- /* +- * Computation of the nonlinear slopes: If two consecutive pixel +- * value differences have the same sign, the smallest one (in +- * absolute value) is taken to be the corresponding slope; if the +- * two consecutive pixel value differences don't have the same sign, +- * the corresponding slope is set to 0. +- * +- * In other words: Apply minmod to consecutive differences. +- */ +- /* +- * Two vertical simple differences: +- */ +- const double d_unodos_two = dos_two - uno_two; +- const double d_dostre_two = tre_two - dos_two; +- const double d_trequa_two = qua_two - tre_two; +- const double d_quacin_two = cin_two - qua_two; +- /* +- * Thr(ee) vertical differences: +- */ +- const double d_unodos_thr = dos_thr - uno_thr; +- const double d_dostre_thr = tre_thr - dos_thr; +- const double d_trequa_thr = qua_thr - tre_thr; +- const double d_quacin_thr = cin_thr - qua_thr; +- /* +- * Fou(r) vertical differences: +- */ +- const double d_unodos_fou = dos_fou - uno_fou; +- const double d_dostre_fou = tre_fou - dos_fou; +- const double d_trequa_fou = qua_fou - tre_fou; +- const double d_quacin_fou = cin_fou - qua_fou; +- /* +- * Dos horizontal differences: +- */ +- const double d_dos_onetwo = dos_two - dos_one; +- const double d_dos_twothr = dos_thr - dos_two; +- const double d_dos_thrfou = dos_fou - dos_thr; +- const double d_dos_foufiv = dos_fiv - dos_fou; +- /* +- * Tre(s) horizontal differences: +- */ +- const double d_tre_onetwo = tre_two - tre_one; +- const double d_tre_twothr = tre_thr - tre_two; +- const double d_tre_thrfou = tre_fou - tre_thr; +- const double d_tre_foufiv = tre_fiv - tre_fou; +- /* +- * Qua(ttro) horizontal differences: +- */ +- const double d_qua_onetwo = qua_two - qua_one; +- const double d_qua_twothr = qua_thr - qua_two; +- const double d_qua_thrfou = qua_fou - qua_thr; +- const double d_qua_foufiv = qua_fiv - qua_fou; +- +- /* +- * Recyclable vertical products and squares: +- */ +- const double d_unodos_times_dostre_two = d_unodos_two * d_dostre_two; +- const double d_dostre_two_sq = d_dostre_two * d_dostre_two; +- const double d_dostre_times_trequa_two = d_dostre_two * d_trequa_two; +- const double d_trequa_times_quacin_two = d_quacin_two * d_trequa_two; +- const double d_quacin_two_sq = d_quacin_two * d_quacin_two; +- +- const double d_unodos_times_dostre_thr = d_unodos_thr * d_dostre_thr; +- const double d_dostre_thr_sq = d_dostre_thr * d_dostre_thr; +- const double d_dostre_times_trequa_thr = d_trequa_thr * d_dostre_thr; +- const double d_trequa_times_quacin_thr = d_trequa_thr * d_quacin_thr; +- const double d_quacin_thr_sq = d_quacin_thr * d_quacin_thr; +- +- const double d_unodos_times_dostre_fou = d_unodos_fou * d_dostre_fou; +- const double d_dostre_fou_sq = d_dostre_fou * d_dostre_fou; +- const double d_dostre_times_trequa_fou = d_trequa_fou * d_dostre_fou; +- const double d_trequa_times_quacin_fou = d_trequa_fou * d_quacin_fou; +- const double d_quacin_fou_sq = d_quacin_fou * d_quacin_fou; +- /* +- * Recyclable horizontal products and squares: +- */ +- const double d_dos_onetwo_times_twothr = d_dos_onetwo * d_dos_twothr; +- const double d_dos_twothr_sq = d_dos_twothr * d_dos_twothr; +- const double d_dos_twothr_times_thrfou = d_dos_twothr * d_dos_thrfou; +- const double d_dos_thrfou_times_foufiv = d_dos_thrfou * d_dos_foufiv; +- const double d_dos_foufiv_sq = d_dos_foufiv * d_dos_foufiv; +- +- const double d_tre_onetwo_times_twothr = d_tre_onetwo * d_tre_twothr; +- const double d_tre_twothr_sq = d_tre_twothr * d_tre_twothr; +- const double d_tre_twothr_times_thrfou = d_tre_thrfou * d_tre_twothr; +- const double d_tre_thrfou_times_foufiv = d_tre_thrfou * d_tre_foufiv; +- const double d_tre_foufiv_sq = d_tre_foufiv * d_tre_foufiv; +- +- const double d_qua_onetwo_times_twothr = d_qua_onetwo * d_qua_twothr; +- const double d_qua_twothr_sq = d_qua_twothr * d_qua_twothr; +- const double d_qua_twothr_times_thrfou = d_qua_thrfou * d_qua_twothr; +- const double d_qua_thrfou_times_foufiv = d_qua_thrfou * d_qua_foufiv; +- const double d_qua_foufiv_sq = d_qua_foufiv * d_qua_foufiv; +- +- /* +- * Minmod slopes and first level pixel values: +- */ +- const double dos_thr_y = NOHALO_MINMOD( d_dostre_thr, d_unodos_thr, +- d_dostre_thr_sq, +- d_unodos_times_dostre_thr ); +- const double tre_thr_y = NOHALO_MINMOD( d_dostre_thr, d_trequa_thr, +- d_dostre_thr_sq, +- d_dostre_times_trequa_thr ); +- +- const double newval_uno_two = +- .5 * ( dos_thr + tre_thr ) +- + +- .25 * ( dos_thr_y - tre_thr_y ); +- +- const double qua_thr_y = NOHALO_MINMOD( d_quacin_thr, d_trequa_thr, +- d_quacin_thr_sq, +- d_trequa_times_quacin_thr ); +- +- const double newval_tre_two = +- .5 * ( tre_thr + qua_thr ) +- + +- .25 * ( tre_thr_y - qua_thr_y ); +- +- const double tre_fou_y = NOHALO_MINMOD( d_dostre_fou, d_trequa_fou, +- d_dostre_fou_sq, +- d_dostre_times_trequa_fou ); +- const double qua_fou_y = NOHALO_MINMOD( d_quacin_fou, d_trequa_fou, +- d_quacin_fou_sq, +- d_trequa_times_quacin_fou ); +- +- const double newval_tre_fou = +- .5 * ( tre_fou + qua_fou ) +- + +- .25 * ( tre_fou_y - qua_fou_y ); +- +- const double dos_fou_y = NOHALO_MINMOD( d_dostre_fou, d_unodos_fou, +- d_dostre_fou_sq, +- d_unodos_times_dostre_fou ); +- +- const double newval_uno_fou = +- .5 * ( dos_fou + tre_fou ) +- + +- .25 * (dos_fou_y - tre_fou_y ); +- +- const double tre_two_x = NOHALO_MINMOD( d_tre_twothr, d_tre_onetwo, +- d_tre_twothr_sq, +- d_tre_onetwo_times_twothr ); +- const double tre_thr_x = NOHALO_MINMOD( d_tre_twothr, d_tre_thrfou, +- d_tre_twothr_sq, +- d_tre_twothr_times_thrfou ); +- +- const double newval_dos_one = +- .5 * ( tre_two + tre_thr ) +- + +- .25 * ( tre_two_x - tre_thr_x ); +- +- const double tre_fou_x = NOHALO_MINMOD( d_tre_foufiv, d_tre_thrfou, +- d_tre_foufiv_sq, +- d_tre_thrfou_times_foufiv ); +- +- const double tre_thr_x_minus_tre_fou_x = +- tre_thr_x - tre_fou_x; +- +- const double newval_dos_thr = +- .5 * ( tre_thr + tre_fou ) +- + +- .25 * tre_thr_x_minus_tre_fou_x; +- +- const double qua_thr_x = NOHALO_MINMOD( d_qua_twothr, d_qua_thrfou, +- d_qua_twothr_sq, +- d_qua_twothr_times_thrfou ); +- const double qua_fou_x = NOHALO_MINMOD( d_qua_foufiv, d_qua_thrfou, +- d_qua_foufiv_sq, +- d_qua_thrfou_times_foufiv ); +- +- const double qua_thr_x_minus_qua_fou_x = +- qua_thr_x - qua_fou_x; +- +- const double newval_qua_thr = +- .5 * ( qua_thr + qua_fou ) +- + +- .25 * qua_thr_x_minus_qua_fou_x; +- +- const double qua_two_x = NOHALO_MINMOD( d_qua_twothr, d_qua_onetwo, +- d_qua_twothr_sq, +- d_qua_onetwo_times_twothr ); +- +- const double newval_qua_one = +- .5 * ( qua_two + qua_thr ) +- + +- .25 * ( qua_two_x - qua_thr_x ); +- +- const double newval_tre_thr = +- .125 * ( tre_thr_x_minus_tre_fou_x + qua_thr_x_minus_qua_fou_x ) +- + +- .5 * ( newval_tre_two + newval_tre_fou ); +- +- const double dos_thr_x = NOHALO_MINMOD( d_dos_twothr, d_dos_thrfou, +- d_dos_twothr_sq, +- d_dos_twothr_times_thrfou ); +- const double dos_fou_x = NOHALO_MINMOD( d_dos_foufiv, d_dos_thrfou, +- d_dos_foufiv_sq, +- d_dos_thrfou_times_foufiv ); +- +- const double newval_uno_thr = +- .25 * ( dos_fou - tre_thr ) +- + +- .125 * ( dos_fou_y - tre_fou_y + dos_thr_x - dos_fou_x ) +- + +- .5 * ( newval_uno_two + newval_dos_thr ); +- +- const double tre_two_y = NOHALO_MINMOD( d_dostre_two, d_trequa_two, +- d_dostre_two_sq, +- d_dostre_times_trequa_two ); +- const double qua_two_y = NOHALO_MINMOD( d_quacin_two, d_trequa_two, +- d_quacin_two_sq, +- d_trequa_times_quacin_two ); +- +- const double newval_tre_one = +- .25 * ( qua_two - tre_thr ) +- + +- .125 * ( qua_two_x - qua_thr_x + tre_two_y - qua_two_y ) +- + +- .5 * ( newval_dos_one + newval_tre_two ); +- +- const double dos_two_x = NOHALO_MINMOD( d_dos_twothr, d_dos_onetwo, +- d_dos_twothr_sq, +- d_dos_onetwo_times_twothr ); +- +- const double dos_two_y = NOHALO_MINMOD( d_dostre_two, d_unodos_two, +- d_dostre_two_sq, +- d_unodos_times_dostre_two ); +- +- const double newval_uno_one = +- .25 * ( dos_two + dos_thr + tre_two + tre_thr ) +- + +- .125 * ( dos_two_x - dos_thr_x + tre_two_x - tre_thr_x +- + +- dos_two_y + dos_thr_y - tre_two_y - tre_thr_y ); +- +- /* +- * Return the sixteen LBB stencil values: +- */ +- *uno_one_1 = newval_uno_one; +- *uno_two_1 = newval_uno_two; +- *uno_thr_1 = newval_uno_thr; +- *uno_fou_1 = newval_uno_fou; +- *dos_one_1 = newval_dos_one; +- *dos_two_1 = tre_thr; +- *dos_thr_1 = newval_dos_thr; +- *dos_fou_1 = tre_fou; +- *tre_one_1 = newval_tre_one; +- *tre_two_1 = newval_tre_two; +- *tre_thr_1 = newval_tre_thr; +- *tre_fou_1 = newval_tre_fou; +- *qua_one_1 = newval_qua_one; +- *qua_two_1 = qua_thr; +- *qua_thr_1 = newval_qua_thr; +- *qua_fou_1 = qua_fou; ++ /* ++ * nohalo_subdivision calculates the missing twelve double density ++ * pixel values, and also returns the "already known" four, so that ++ * the sixteen values which make up the stencil of LBB are ++ * available. ++ */ ++ /* ++ * THE STENCIL OF INPUT VALUES: ++ * ++ * Pointer arithmetic is used to implicitly reflect the input ++ * stencil about tre_thr---assumed closer to the sampling location ++ * than other pixels (ties are OK)---in such a way that after ++ * reflection the sampling point is to the bottom right of tre_thr. ++ * ++ * The following code and picture assumes that the stencil reflexion ++ * has already been performed. ++ * ++ * (ix-1,iy-2) (ix,iy-2) (ix+1,iy-2) ++ * =uno_two = uno_thr = uno_fou ++ * ++ * ++ * ++ * (ix-2,iy-1) (ix-1,iy-1) (ix,iy-1) (ix+1,iy-1) (ix+2,iy-1) ++ * = dos_one = dos_two = dos_thr = dos_fou = dos_fiv ++ * ++ * ++ * ++ * (ix-2,iy) (ix-1,iy) (ix,iy) (ix+1,iy) (ix+2,iy) ++ * = tre_one = tre_two = tre_thr = tre_fou = tre_fiv ++ * X ++ * ++ * ++ * (ix-2,iy+1) (ix-1,iy+1) (ix,iy+1) (ix+1,iy+1) (ix+2,iy+1) ++ * = qua_one = qua_two = qua_thr = qua_fou = qua_fiv ++ * ++ * ++ * ++ * (ix-1,iy+2) (ix,iy+2) (ix+1,iy+2) ++ * = cin_two = cin_thr = cin_fou ++ * ++ * ++ * The above input pixel values are the ones needed in order to make ++ * available the following values, needed by LBB: ++ * ++ * uno_one_1 = uno_two_1 = uno_thr_1 = uno_fou_1 = ++ * (ix-1/2,iy-1/2) (ix,iy-1/2) (ix+1/2,iy-1/2) (ix+1,iy-1/2) ++ * ++ * ++ * ++ * ++ * dos_one_1 = dos_two_1 = dos_thr_1 = dos_fou_1 = ++ * (ix-1/2,iy) (ix,iy) (ix+1/2,iy) (ix+1,iy) ++ * ++ * X ++ * ++ * ++ * tre_one_1 = tre_two_1 = tre_thr_1 = tre_fou_1 = ++ * (ix-1/2,iy+1/2) (ix,iy+1/2) (ix+1/2,iy+1/2) (ix+1,iy+1/2) ++ * ++ * ++ * ++ * ++ * qua_one_1 = qua_two_1 = qua_thr_1 = qua_fou_1 = ++ * (ix-1/2,iy+1) (ix,iy+1) (ix+1/2,iy+1) (ix+1,iy+1) ++ * ++ */ ++ ++ /* ++ * Computation of the nonlinear slopes: If two consecutive pixel ++ * value differences have the same sign, the smallest one (in ++ * absolute value) is taken to be the corresponding slope; if the ++ * two consecutive pixel value differences don't have the same sign, ++ * the corresponding slope is set to 0. ++ * ++ * In other words: Apply minmod to consecutive differences. ++ */ ++ /* ++ * Two vertical simple differences: ++ */ ++ const double d_unodos_two = dos_two - uno_two; ++ const double d_dostre_two = tre_two - dos_two; ++ const double d_trequa_two = qua_two - tre_two; ++ const double d_quacin_two = cin_two - qua_two; ++ /* ++ * Thr(ee) vertical differences: ++ */ ++ const double d_unodos_thr = dos_thr - uno_thr; ++ const double d_dostre_thr = tre_thr - dos_thr; ++ const double d_trequa_thr = qua_thr - tre_thr; ++ const double d_quacin_thr = cin_thr - qua_thr; ++ /* ++ * Fou(r) vertical differences: ++ */ ++ const double d_unodos_fou = dos_fou - uno_fou; ++ const double d_dostre_fou = tre_fou - dos_fou; ++ const double d_trequa_fou = qua_fou - tre_fou; ++ const double d_quacin_fou = cin_fou - qua_fou; ++ /* ++ * Dos horizontal differences: ++ */ ++ const double d_dos_onetwo = dos_two - dos_one; ++ const double d_dos_twothr = dos_thr - dos_two; ++ const double d_dos_thrfou = dos_fou - dos_thr; ++ const double d_dos_foufiv = dos_fiv - dos_fou; ++ /* ++ * Tre(s) horizontal differences: ++ */ ++ const double d_tre_onetwo = tre_two - tre_one; ++ const double d_tre_twothr = tre_thr - tre_two; ++ const double d_tre_thrfou = tre_fou - tre_thr; ++ const double d_tre_foufiv = tre_fiv - tre_fou; ++ /* ++ * Qua(ttro) horizontal differences: ++ */ ++ const double d_qua_onetwo = qua_two - qua_one; ++ const double d_qua_twothr = qua_thr - qua_two; ++ const double d_qua_thrfou = qua_fou - qua_thr; ++ const double d_qua_foufiv = qua_fiv - qua_fou; ++ ++ /* ++ * Recyclable vertical products and squares: ++ */ ++ const double d_unodos_times_dostre_two = d_unodos_two * d_dostre_two; ++ const double d_dostre_two_sq = d_dostre_two * d_dostre_two; ++ const double d_dostre_times_trequa_two = d_dostre_two * d_trequa_two; ++ const double d_trequa_times_quacin_two = d_quacin_two * d_trequa_two; ++ const double d_quacin_two_sq = d_quacin_two * d_quacin_two; ++ ++ const double d_unodos_times_dostre_thr = d_unodos_thr * d_dostre_thr; ++ const double d_dostre_thr_sq = d_dostre_thr * d_dostre_thr; ++ const double d_dostre_times_trequa_thr = d_trequa_thr * d_dostre_thr; ++ const double d_trequa_times_quacin_thr = d_trequa_thr * d_quacin_thr; ++ const double d_quacin_thr_sq = d_quacin_thr * d_quacin_thr; ++ ++ const double d_unodos_times_dostre_fou = d_unodos_fou * d_dostre_fou; ++ const double d_dostre_fou_sq = d_dostre_fou * d_dostre_fou; ++ const double d_dostre_times_trequa_fou = d_trequa_fou * d_dostre_fou; ++ const double d_trequa_times_quacin_fou = d_trequa_fou * d_quacin_fou; ++ const double d_quacin_fou_sq = d_quacin_fou * d_quacin_fou; ++ /* ++ * Recyclable horizontal products and squares: ++ */ ++ const double d_dos_onetwo_times_twothr = d_dos_onetwo * d_dos_twothr; ++ const double d_dos_twothr_sq = d_dos_twothr * d_dos_twothr; ++ const double d_dos_twothr_times_thrfou = d_dos_twothr * d_dos_thrfou; ++ const double d_dos_thrfou_times_foufiv = d_dos_thrfou * d_dos_foufiv; ++ const double d_dos_foufiv_sq = d_dos_foufiv * d_dos_foufiv; ++ ++ const double d_tre_onetwo_times_twothr = d_tre_onetwo * d_tre_twothr; ++ const double d_tre_twothr_sq = d_tre_twothr * d_tre_twothr; ++ const double d_tre_twothr_times_thrfou = d_tre_thrfou * d_tre_twothr; ++ const double d_tre_thrfou_times_foufiv = d_tre_thrfou * d_tre_foufiv; ++ const double d_tre_foufiv_sq = d_tre_foufiv * d_tre_foufiv; ++ ++ const double d_qua_onetwo_times_twothr = d_qua_onetwo * d_qua_twothr; ++ const double d_qua_twothr_sq = d_qua_twothr * d_qua_twothr; ++ const double d_qua_twothr_times_thrfou = d_qua_thrfou * d_qua_twothr; ++ const double d_qua_thrfou_times_foufiv = d_qua_thrfou * d_qua_foufiv; ++ const double d_qua_foufiv_sq = d_qua_foufiv * d_qua_foufiv; ++ ++ /* ++ * Minmod slopes and first level pixel values: ++ */ ++ const double dos_thr_y = NOHALO_MINMOD(d_dostre_thr, d_unodos_thr, ++ d_dostre_thr_sq, ++ d_unodos_times_dostre_thr); ++ const double tre_thr_y = NOHALO_MINMOD(d_dostre_thr, d_trequa_thr, ++ d_dostre_thr_sq, ++ d_dostre_times_trequa_thr); ++ ++ const double newval_uno_two = ++ .5 * (dos_thr + tre_thr) + ++ .25 * (dos_thr_y - tre_thr_y); ++ ++ const double qua_thr_y = NOHALO_MINMOD(d_quacin_thr, d_trequa_thr, ++ d_quacin_thr_sq, ++ d_trequa_times_quacin_thr); ++ ++ const double newval_tre_two = ++ .5 * (tre_thr + qua_thr) + ++ .25 * (tre_thr_y - qua_thr_y); ++ ++ const double tre_fou_y = NOHALO_MINMOD(d_dostre_fou, d_trequa_fou, ++ d_dostre_fou_sq, ++ d_dostre_times_trequa_fou); ++ const double qua_fou_y = NOHALO_MINMOD(d_quacin_fou, d_trequa_fou, ++ d_quacin_fou_sq, ++ d_trequa_times_quacin_fou); ++ ++ const double newval_tre_fou = ++ .5 * (tre_fou + qua_fou) + ++ .25 * (tre_fou_y - qua_fou_y); ++ ++ const double dos_fou_y = NOHALO_MINMOD(d_dostre_fou, d_unodos_fou, ++ d_dostre_fou_sq, ++ d_unodos_times_dostre_fou); ++ ++ const double newval_uno_fou = ++ .5 * (dos_fou + tre_fou) + ++ .25 * (dos_fou_y - tre_fou_y); ++ ++ const double tre_two_x = NOHALO_MINMOD(d_tre_twothr, d_tre_onetwo, ++ d_tre_twothr_sq, ++ d_tre_onetwo_times_twothr); ++ const double tre_thr_x = NOHALO_MINMOD(d_tre_twothr, d_tre_thrfou, ++ d_tre_twothr_sq, ++ d_tre_twothr_times_thrfou); ++ ++ const double newval_dos_one = ++ .5 * (tre_two + tre_thr) + ++ .25 * (tre_two_x - tre_thr_x); ++ ++ const double tre_fou_x = NOHALO_MINMOD(d_tre_foufiv, d_tre_thrfou, ++ d_tre_foufiv_sq, ++ d_tre_thrfou_times_foufiv); ++ ++ const double tre_thr_x_minus_tre_fou_x = ++ tre_thr_x - tre_fou_x; ++ ++ const double newval_dos_thr = ++ .5 * (tre_thr + tre_fou) + ++ .25 * tre_thr_x_minus_tre_fou_x; ++ ++ const double qua_thr_x = NOHALO_MINMOD(d_qua_twothr, d_qua_thrfou, ++ d_qua_twothr_sq, ++ d_qua_twothr_times_thrfou); ++ const double qua_fou_x = NOHALO_MINMOD(d_qua_foufiv, d_qua_thrfou, ++ d_qua_foufiv_sq, ++ d_qua_thrfou_times_foufiv); ++ ++ const double qua_thr_x_minus_qua_fou_x = ++ qua_thr_x - qua_fou_x; ++ ++ const double newval_qua_thr = ++ .5 * (qua_thr + qua_fou) + ++ .25 * qua_thr_x_minus_qua_fou_x; ++ ++ const double qua_two_x = NOHALO_MINMOD(d_qua_twothr, d_qua_onetwo, ++ d_qua_twothr_sq, ++ d_qua_onetwo_times_twothr); ++ ++ const double newval_qua_one = ++ .5 * (qua_two + qua_thr) + ++ .25 * (qua_two_x - qua_thr_x); ++ ++ const double newval_tre_thr = ++ .125 * (tre_thr_x_minus_tre_fou_x + qua_thr_x_minus_qua_fou_x) + ++ .5 * (newval_tre_two + newval_tre_fou); ++ ++ const double dos_thr_x = NOHALO_MINMOD(d_dos_twothr, d_dos_thrfou, ++ d_dos_twothr_sq, ++ d_dos_twothr_times_thrfou); ++ const double dos_fou_x = NOHALO_MINMOD(d_dos_foufiv, d_dos_thrfou, ++ d_dos_foufiv_sq, ++ d_dos_thrfou_times_foufiv); ++ ++ const double newval_uno_thr = ++ .25 * (dos_fou - tre_thr) + ++ .125 * (dos_fou_y - tre_fou_y + dos_thr_x - dos_fou_x) + ++ .5 * (newval_uno_two + newval_dos_thr); ++ ++ const double tre_two_y = NOHALO_MINMOD(d_dostre_two, d_trequa_two, ++ d_dostre_two_sq, ++ d_dostre_times_trequa_two); ++ const double qua_two_y = NOHALO_MINMOD(d_quacin_two, d_trequa_two, ++ d_quacin_two_sq, ++ d_trequa_times_quacin_two); ++ ++ const double newval_tre_one = ++ .25 * (qua_two - tre_thr) + ++ .125 * (qua_two_x - qua_thr_x + tre_two_y - qua_two_y) + ++ .5 * (newval_dos_one + newval_tre_two); ++ ++ const double dos_two_x = NOHALO_MINMOD(d_dos_twothr, d_dos_onetwo, ++ d_dos_twothr_sq, ++ d_dos_onetwo_times_twothr); ++ ++ const double dos_two_y = NOHALO_MINMOD(d_dostre_two, d_unodos_two, ++ d_dostre_two_sq, ++ d_unodos_times_dostre_two); ++ ++ const double newval_uno_one = ++ .25 * (dos_two + dos_thr + tre_two + tre_thr) + ++ .125 * (dos_two_x - dos_thr_x + tre_two_x - tre_thr_x + dos_two_y + dos_thr_y - tre_two_y - tre_thr_y); ++ ++ /* ++ * Return the sixteen LBB stencil values: ++ */ ++ *uno_one_1 = newval_uno_one; ++ *uno_two_1 = newval_uno_two; ++ *uno_thr_1 = newval_uno_thr; ++ *uno_fou_1 = newval_uno_fou; ++ *dos_one_1 = newval_dos_one; ++ *dos_two_1 = tre_thr; ++ *dos_thr_1 = newval_dos_thr; ++ *dos_fou_1 = tre_fou; ++ *tre_one_1 = newval_tre_one; ++ *tre_two_1 = newval_tre_two; ++ *tre_thr_1 = newval_tre_thr; ++ *tre_fou_1 = newval_tre_fou; ++ *qua_one_1 = newval_qua_one; ++ *qua_two_1 = qua_thr; ++ *qua_thr_1 = newval_qua_thr; ++ *qua_fou_1 = qua_fou; + } + + /* +@@ -760,463 +742,458 @@ nohalo_subdivision (const double uno_two, + */ + + static inline double +-lbbicubic( const double c00, +- const double c10, +- const double c01, +- const double c11, +- const double c00dx, +- const double c10dx, +- const double c01dx, +- const double c11dx, +- const double c00dy, +- const double c10dy, +- const double c01dy, +- const double c11dy, +- const double c00dxdy, +- const double c10dxdy, +- const double c01dxdy, +- const double c11dxdy, +- const double uno_one, +- const double uno_two, +- const double uno_thr, +- const double uno_fou, +- const double dos_one, +- const double dos_two, +- const double dos_thr, +- const double dos_fou, +- const double tre_one, +- const double tre_two, +- const double tre_thr, +- const double tre_fou, +- const double qua_one, +- const double qua_two, +- const double qua_thr, +- const double qua_fou ) ++lbbicubic(const double c00, ++ const double c10, ++ const double c01, ++ const double c11, ++ const double c00dx, ++ const double c10dx, ++ const double c01dx, ++ const double c11dx, ++ const double c00dy, ++ const double c10dy, ++ const double c01dy, ++ const double c11dy, ++ const double c00dxdy, ++ const double c10dxdy, ++ const double c01dxdy, ++ const double c11dxdy, ++ const double uno_one, ++ const double uno_two, ++ const double uno_thr, ++ const double uno_fou, ++ const double dos_one, ++ const double dos_two, ++ const double dos_thr, ++ const double dos_fou, ++ const double tre_one, ++ const double tre_two, ++ const double tre_thr, ++ const double tre_fou, ++ const double qua_one, ++ const double qua_two, ++ const double qua_thr, ++ const double qua_fou) + { +- /* +- * STENCIL (FOOTPRINT) OF INPUT VALUES: +- * +- * The stencil of LBB is the same as for any standard Hermite +- * bicubic (e.g., Catmull-Rom): +- * +- * (ix-1,iy-1) (ix,iy-1) (ix+1,iy-1) (ix+2,iy-1) +- * = uno_one = uno_two = uno_thr = uno_fou +- * +- * (ix-1,iy) (ix,iy) (ix+1,iy) (ix+2,iy) +- * = dos_one = dos_two = dos_thr = dos_fou +- * X +- * (ix-1,iy+1) (ix,iy+1) (ix+1,iy+1) (ix+2,iy+1) +- * = tre_one = tre_two = tre_thr = tre_fou +- * +- * (ix-1,iy+2) (ix,iy+2) (ix+1,iy+2) (ix+2,iy+2) +- * = qua_one = qua_two = qua_thr = qua_fou +- * +- * where ix is the (pseudo-)floor of the requested left-to-right +- * location ("X"), and iy is the floor of the requested up-to-down +- * location. +- */ +- +-#if defined (__NOHALO_CHEAP_H__) +- /* +- * Computation of the four min and four max over 3x3 input data +- * sub-crosses of the 4x4 input stencil. +- * +- * We exploit the fact that the data comes from the (co-monotone) +- * method Nohalo so that it is known ahead of time that +- * +- * dos_thr is between dos_two and dos_fou +- * +- * tre_two is between dos_two and qua_two +- * +- * tre_fou is between dos_fou and qua_fou +- * +- * qua_thr is between qua_two and qua_fou +- * +- * tre_thr is in the convex hull of dos_two, dos_fou, qua_two and qua_fou +- * +- * to minimize the number of flags and conditional moves. +- * +- * (The "between" are not strict: "a between b and c" means +- * +- * "min(b,c) <= a <= max(b,c)".) +- * +- * We have, however, succeeded in eliminating one flag computation +- * (one comparison) and one use of an intermediate result. See the +- * two commented out lines below. +- * +- * Overall, only 20 comparisons and 28 "? :" are needed (to compute +- * 4 mins and 4 maxes). If you can figure how to do this more +- * efficiently, let us know. +- */ +- const double m1 = (uno_two <= tre_two) ? uno_two : tre_two ; +- const double M1 = (uno_two <= tre_two) ? tre_two : uno_two ; +- const double m2 = (dos_thr <= qua_thr) ? dos_thr : qua_thr ; +- const double M2 = (dos_thr <= qua_thr) ? qua_thr : dos_thr ; +- const double m3 = (dos_two <= dos_fou) ? dos_two : dos_fou ; +- const double M3 = (dos_two <= dos_fou) ? dos_fou : dos_two ; +- const double m4 = (uno_thr <= tre_thr) ? uno_thr : tre_thr ; +- const double M4 = (uno_thr <= tre_thr) ? tre_thr : uno_thr ; +- const double m5 = (dos_two <= qua_two) ? dos_two : qua_two ; +- const double M5 = (dos_two <= qua_two) ? qua_two : dos_two ; +- const double m6 = (tre_one <= tre_thr) ? tre_one : tre_thr ; +- const double M6 = (tre_one <= tre_thr) ? tre_thr : tre_one ; +- const double m7 = (dos_one <= dos_thr) ? dos_one : dos_thr ; +- const double M7 = (dos_one <= dos_thr) ? dos_thr : dos_one ; +- const double m8 = (tre_two <= tre_fou) ? tre_two : tre_fou ; +- const double M8 = (tre_two <= tre_fou) ? tre_fou : tre_two ; +- const double m9 = NOHALO_MIN( m1, dos_two ); +- const double M9 = NOHALO_MAX( M1, dos_two ); +- const double m10 = NOHALO_MIN( m2, tre_thr ); +- const double M10 = NOHALO_MAX( M2, tre_thr ); +- const double min10 = NOHALO_MIN( m3, m4 ); +- const double max10 = NOHALO_MAX( M3, M4 ); +- const double min01 = NOHALO_MIN( m5, m6 ); +- const double max01 = NOHALO_MAX( M5, M6 ); +- const double min00 = NOHALO_MIN( m9, m7 ); +- const double max00 = NOHALO_MAX( M9, M7 ); +- const double min11 = NOHALO_MIN( m10, m8 ); +- const double max11 = NOHALO_MAX( M10, M8 ); ++ /* ++ * STENCIL (FOOTPRINT) OF INPUT VALUES: ++ * ++ * The stencil of LBB is the same as for any standard Hermite ++ * bicubic (e.g., Catmull-Rom): ++ * ++ * (ix-1,iy-1) (ix,iy-1) (ix+1,iy-1) (ix+2,iy-1) ++ * = uno_one = uno_two = uno_thr = uno_fou ++ * ++ * (ix-1,iy) (ix,iy) (ix+1,iy) (ix+2,iy) ++ * = dos_one = dos_two = dos_thr = dos_fou ++ * X ++ * (ix-1,iy+1) (ix,iy+1) (ix+1,iy+1) (ix+2,iy+1) ++ * = tre_one = tre_two = tre_thr = tre_fou ++ * ++ * (ix-1,iy+2) (ix,iy+2) (ix+1,iy+2) (ix+2,iy+2) ++ * = qua_one = qua_two = qua_thr = qua_fou ++ * ++ * where ix is the (pseudo-)floor of the requested left-to-right ++ * location ("X"), and iy is the floor of the requested up-to-down ++ * location. ++ */ ++ ++#if defined(__NOHALO_CHEAP_H__) ++ /* ++ * Computation of the four min and four max over 3x3 input data ++ * sub-crosses of the 4x4 input stencil. ++ * ++ * We exploit the fact that the data comes from the (co-monotone) ++ * method Nohalo so that it is known ahead of time that ++ * ++ * dos_thr is between dos_two and dos_fou ++ * ++ * tre_two is between dos_two and qua_two ++ * ++ * tre_fou is between dos_fou and qua_fou ++ * ++ * qua_thr is between qua_two and qua_fou ++ * ++ * tre_thr is in the convex hull of dos_two, dos_fou, qua_two and qua_fou ++ * ++ * to minimize the number of flags and conditional moves. ++ * ++ * (The "between" are not strict: "a between b and c" means ++ * ++ * "min(b,c) <= a <= max(b,c)".) ++ * ++ * We have, however, succeeded in eliminating one flag computation ++ * (one comparison) and one use of an intermediate result. See the ++ * two commented out lines below. ++ * ++ * Overall, only 20 comparisons and 28 "? :" are needed (to compute ++ * 4 mins and 4 maxes). If you can figure how to do this more ++ * efficiently, let us know. ++ */ ++ const double m1 = (uno_two <= tre_two) ? uno_two : tre_two; ++ const double M1 = (uno_two <= tre_two) ? tre_two : uno_two; ++ const double m2 = (dos_thr <= qua_thr) ? dos_thr : qua_thr; ++ const double M2 = (dos_thr <= qua_thr) ? qua_thr : dos_thr; ++ const double m3 = (dos_two <= dos_fou) ? dos_two : dos_fou; ++ const double M3 = (dos_two <= dos_fou) ? dos_fou : dos_two; ++ const double m4 = (uno_thr <= tre_thr) ? uno_thr : tre_thr; ++ const double M4 = (uno_thr <= tre_thr) ? tre_thr : uno_thr; ++ const double m5 = (dos_two <= qua_two) ? dos_two : qua_two; ++ const double M5 = (dos_two <= qua_two) ? qua_two : dos_two; ++ const double m6 = (tre_one <= tre_thr) ? tre_one : tre_thr; ++ const double M6 = (tre_one <= tre_thr) ? tre_thr : tre_one; ++ const double m7 = (dos_one <= dos_thr) ? dos_one : dos_thr; ++ const double M7 = (dos_one <= dos_thr) ? dos_thr : dos_one; ++ const double m8 = (tre_two <= tre_fou) ? tre_two : tre_fou; ++ const double M8 = (tre_two <= tre_fou) ? tre_fou : tre_two; ++ const double m9 = NOHALO_MIN(m1, dos_two); ++ const double M9 = NOHALO_MAX(M1, dos_two); ++ const double m10 = NOHALO_MIN(m2, tre_thr); ++ const double M10 = NOHALO_MAX(M2, tre_thr); ++ const double min10 = NOHALO_MIN(m3, m4); ++ const double max10 = NOHALO_MAX(M3, M4); ++ const double min01 = NOHALO_MIN(m5, m6); ++ const double max01 = NOHALO_MAX(M5, M6); ++ const double min00 = NOHALO_MIN(m9, m7); ++ const double max00 = NOHALO_MAX(M9, M7); ++ const double min11 = NOHALO_MIN(m10, m8); ++ const double max11 = NOHALO_MAX(M10, M8); + #else +- /* +- * Computation of the four min and four max over 3x3 input data +- * sub-blocks of the 4x4 input stencil. +- * +- * Surprisingly, we have not succeeded in reducing the number of "? +- * :" needed by using the fact that the data comes from the +- * (co-monotone) method Nohalo so that it is known ahead of time +- * that +- * +- * dos_thr is between dos_two and dos_fou +- * +- * tre_two is between dos_two and qua_two +- * +- * tre_fou is between dos_fou and qua_fou +- * +- * qua_thr is between qua_two and qua_fou +- * +- * tre_thr is in the convex hull of dos_two, dos_fou, qua_two and qua_fou +- * +- * to minimize the number of flags and conditional moves. +- * +- * (The "between" are not strict: "a between b and c" means +- * +- * "min(b,c) <= a <= max(b,c)".) +- * +- * We have, however, succeeded in eliminating one flag computation +- * (one comparison) and one use of an intermediate result. See the +- * two commented out lines below. +- * +- * Overall, only 27 comparisons are needed (to compute 4 mins and 4 +- * maxes!). Without the simplification, 28 comparisons would be +- * used. Either way, the number of "? :" used is 34. If you can +- * figure how to do this more efficiently, let us know. +- */ +- const double m1 = (dos_two <= dos_thr) ? dos_two : dos_thr ; +- const double M1 = (dos_two <= dos_thr) ? dos_thr : dos_two ; +- const double m2 = (tre_two <= tre_thr) ? tre_two : tre_thr ; +- const double M2 = (tre_two <= tre_thr) ? tre_thr : tre_two ; +- const double m4 = (qua_two <= qua_thr) ? qua_two : qua_thr ; +- const double M4 = (qua_two <= qua_thr) ? qua_thr : qua_two ; +- const double m3 = (uno_two <= uno_thr) ? uno_two : uno_thr ; +- const double M3 = (uno_two <= uno_thr) ? uno_thr : uno_two ; +- const double m5 = NOHALO_MIN( m1, m2 ); +- const double M5 = NOHALO_MAX( M1, M2 ); +- const double m6 = (dos_one <= tre_one) ? dos_one : tre_one ; +- const double M6 = (dos_one <= tre_one) ? tre_one : dos_one ; +- const double m7 = (dos_fou <= tre_fou) ? dos_fou : tre_fou ; +- const double M7 = (dos_fou <= tre_fou) ? tre_fou : dos_fou ; +- const double m13 = (dos_fou <= qua_fou) ? dos_fou : qua_fou ; +- const double M13 = (dos_fou <= qua_fou) ? qua_fou : dos_fou ; +- /* +- * Because the data comes from Nohalo subdivision, the following two +- * lines can be replaced by the above, simpler, two lines without +- * changing the results. +- * +- * const double m13 = NOHALO_MIN( m7, qua_fou ); +- * const double M13 = NOHALO_MAX( M7, qua_fou ); +- * +- * This also allows reodering the comparisons to put space between +- * the computation of a result and its use. +- */ +- const double m9 = NOHALO_MIN( m5, m4 ); +- const double M9 = NOHALO_MAX( M5, M4 ); +- const double m11 = NOHALO_MIN( m6, qua_one ); +- const double M11 = NOHALO_MAX( M6, qua_one ); +- const double m10 = NOHALO_MIN( m6, uno_one ); +- const double M10 = NOHALO_MAX( M6, uno_one ); +- const double m8 = NOHALO_MIN( m5, m3 ); +- const double M8 = NOHALO_MAX( M5, M3 ); +- const double m12 = NOHALO_MIN( m7, uno_fou ); +- const double M12 = NOHALO_MAX( M7, uno_fou ); +- const double min11 = NOHALO_MIN( m9, m13 ); +- const double max11 = NOHALO_MAX( M9, M13 ); +- const double min01 = NOHALO_MIN( m9, m11 ); +- const double max01 = NOHALO_MAX( M9, M11 ); +- const double min00 = NOHALO_MIN( m8, m10 ); +- const double max00 = NOHALO_MAX( M8, M10 ); +- const double min10 = NOHALO_MIN( m8, m12 ); +- const double max10 = NOHALO_MAX( M8, M12 ); ++ /* ++ * Computation of the four min and four max over 3x3 input data ++ * sub-blocks of the 4x4 input stencil. ++ * ++ * Surprisingly, we have not succeeded in reducing the number of "? ++ * :" needed by using the fact that the data comes from the ++ * (co-monotone) method Nohalo so that it is known ahead of time ++ * that ++ * ++ * dos_thr is between dos_two and dos_fou ++ * ++ * tre_two is between dos_two and qua_two ++ * ++ * tre_fou is between dos_fou and qua_fou ++ * ++ * qua_thr is between qua_two and qua_fou ++ * ++ * tre_thr is in the convex hull of dos_two, dos_fou, qua_two and qua_fou ++ * ++ * to minimize the number of flags and conditional moves. ++ * ++ * (The "between" are not strict: "a between b and c" means ++ * ++ * "min(b,c) <= a <= max(b,c)".) ++ * ++ * We have, however, succeeded in eliminating one flag computation ++ * (one comparison) and one use of an intermediate result. See the ++ * two commented out lines below. ++ * ++ * Overall, only 27 comparisons are needed (to compute 4 mins and 4 ++ * maxes!). Without the simplification, 28 comparisons would be ++ * used. Either way, the number of "? :" used is 34. If you can ++ * figure how to do this more efficiently, let us know. ++ */ ++ const double m1 = (dos_two <= dos_thr) ? dos_two : dos_thr; ++ const double M1 = (dos_two <= dos_thr) ? dos_thr : dos_two; ++ const double m2 = (tre_two <= tre_thr) ? tre_two : tre_thr; ++ const double M2 = (tre_two <= tre_thr) ? tre_thr : tre_two; ++ const double m4 = (qua_two <= qua_thr) ? qua_two : qua_thr; ++ const double M4 = (qua_two <= qua_thr) ? qua_thr : qua_two; ++ const double m3 = (uno_two <= uno_thr) ? uno_two : uno_thr; ++ const double M3 = (uno_two <= uno_thr) ? uno_thr : uno_two; ++ const double m5 = NOHALO_MIN(m1, m2); ++ const double M5 = NOHALO_MAX(M1, M2); ++ const double m6 = (dos_one <= tre_one) ? dos_one : tre_one; ++ const double M6 = (dos_one <= tre_one) ? tre_one : dos_one; ++ const double m7 = (dos_fou <= tre_fou) ? dos_fou : tre_fou; ++ const double M7 = (dos_fou <= tre_fou) ? tre_fou : dos_fou; ++ const double m13 = (dos_fou <= qua_fou) ? dos_fou : qua_fou; ++ const double M13 = (dos_fou <= qua_fou) ? qua_fou : dos_fou; ++ /* ++ * Because the data comes from Nohalo subdivision, the following two ++ * lines can be replaced by the above, simpler, two lines without ++ * changing the results. ++ * ++ * const double m13 = NOHALO_MIN( m7, qua_fou ); ++ * const double M13 = NOHALO_MAX( M7, qua_fou ); ++ * ++ * This also allows reodering the comparisons to put space between ++ * the computation of a result and its use. ++ */ ++ const double m9 = NOHALO_MIN(m5, m4); ++ const double M9 = NOHALO_MAX(M5, M4); ++ const double m11 = NOHALO_MIN(m6, qua_one); ++ const double M11 = NOHALO_MAX(M6, qua_one); ++ const double m10 = NOHALO_MIN(m6, uno_one); ++ const double M10 = NOHALO_MAX(M6, uno_one); ++ const double m8 = NOHALO_MIN(m5, m3); ++ const double M8 = NOHALO_MAX(M5, M3); ++ const double m12 = NOHALO_MIN(m7, uno_fou); ++ const double M12 = NOHALO_MAX(M7, uno_fou); ++ const double min11 = NOHALO_MIN(m9, m13); ++ const double max11 = NOHALO_MAX(M9, M13); ++ const double min01 = NOHALO_MIN(m9, m11); ++ const double max01 = NOHALO_MAX(M9, M11); ++ const double min00 = NOHALO_MIN(m8, m10); ++ const double max00 = NOHALO_MAX(M8, M10); ++ const double min10 = NOHALO_MIN(m8, m12); ++ const double max10 = NOHALO_MAX(M8, M12); + #endif + +- /* +- * The remainder of the "per channel" computation involves the +- * computation of: +- * +- * --8 conditional moves, +- * +- * --8 signs (in which the sign of zero is unimportant), +- * +- * --12 minima of two values, +- * +- * --8 maxima of two values, +- * +- * --8 absolute values, +- * +- * for a grand total of 29 minima, 25 maxima, 8 conditional moves, 8 +- * signs, and 8 absolute values. If everything is done with +- * conditional moves, "only" 28+8+8+12+8+8=72 flags are involved +- * (because initial min and max can be computed with one flag). +- * +- * The "per channel" part of the computation also involves 107 +- * arithmetic operations (54 *, 21 +, 42 -). +- */ +- +- /* +- * Distances to the local min and max: +- */ +- const double u11 = tre_thr - min11; +- const double v11 = max11 - tre_thr; +- const double u01 = tre_two - min01; +- const double v01 = max01 - tre_two; +- const double u00 = dos_two - min00; +- const double v00 = max00 - dos_two; +- const double u10 = dos_thr - min10; +- const double v10 = max10 - dos_thr; +- +- /* +- * Initial values of the derivatives computed with centered +- * differences. Factors of 1/2 are left out because they are folded +- * in later: +- */ +- const double dble_dzdx00i = dos_thr - dos_one; +- const double dble_dzdy11i = qua_thr - dos_thr; +- const double dble_dzdx10i = dos_fou - dos_two; +- const double dble_dzdy01i = qua_two - dos_two; +- const double dble_dzdx01i = tre_thr - tre_one; +- const double dble_dzdy10i = tre_thr - uno_thr; +- const double dble_dzdx11i = tre_fou - tre_two; +- const double dble_dzdy00i = tre_two - uno_two; +- +- /* +- * Signs of the derivatives. The upcoming clamping does not change +- * them (except if the clamping sends a negative derivative to 0, in +- * which case the sign does not matter anyway). +- */ +- const double sign_dzdx00 = NOHALO_SIGN( dble_dzdx00i ); +- const double sign_dzdx10 = NOHALO_SIGN( dble_dzdx10i ); +- const double sign_dzdx01 = NOHALO_SIGN( dble_dzdx01i ); +- const double sign_dzdx11 = NOHALO_SIGN( dble_dzdx11i ); +- +- const double sign_dzdy00 = NOHALO_SIGN( dble_dzdy00i ); +- const double sign_dzdy10 = NOHALO_SIGN( dble_dzdy10i ); +- const double sign_dzdy01 = NOHALO_SIGN( dble_dzdy01i ); +- const double sign_dzdy11 = NOHALO_SIGN( dble_dzdy11i ); +- +- /* +- * Initial values of the cross-derivatives. Factors of 1/4 are left +- * out because folded in later: +- */ +- const double quad_d2zdxdy00i = uno_one - uno_thr + dble_dzdx01i; +- const double quad_d2zdxdy10i = uno_two - uno_fou + dble_dzdx11i; +- const double quad_d2zdxdy01i = qua_thr - qua_one - dble_dzdx00i; +- const double quad_d2zdxdy11i = qua_fou - qua_two - dble_dzdx10i; +- +- /* +- * Slope limiters. The key multiplier is 3 but we fold a factor of +- * 2, hence 6: +- */ +- const double dble_slopelimit_00 = 6.0 * NOHALO_MIN( u00, v00 ); +- const double dble_slopelimit_10 = 6.0 * NOHALO_MIN( u10, v10 ); +- const double dble_slopelimit_01 = 6.0 * NOHALO_MIN( u01, v01 ); +- const double dble_slopelimit_11 = 6.0 * NOHALO_MIN( u11, v11 ); +- +- /* +- * Clamped first derivatives: +- */ +- const double dble_dzdx00 = +- ( sign_dzdx00 * dble_dzdx00i <= dble_slopelimit_00 ) +- ? dble_dzdx00i : sign_dzdx00 * dble_slopelimit_00; +- const double dble_dzdy00 = +- ( sign_dzdy00 * dble_dzdy00i <= dble_slopelimit_00 ) +- ? dble_dzdy00i : sign_dzdy00 * dble_slopelimit_00; +- const double dble_dzdx10 = +- ( sign_dzdx10 * dble_dzdx10i <= dble_slopelimit_10 ) +- ? dble_dzdx10i : sign_dzdx10 * dble_slopelimit_10; +- const double dble_dzdy10 = +- ( sign_dzdy10 * dble_dzdy10i <= dble_slopelimit_10 ) +- ? dble_dzdy10i : sign_dzdy10 * dble_slopelimit_10; +- const double dble_dzdx01 = +- ( sign_dzdx01 * dble_dzdx01i <= dble_slopelimit_01 ) +- ? dble_dzdx01i : sign_dzdx01 * dble_slopelimit_01; +- const double dble_dzdy01 = +- ( sign_dzdy01 * dble_dzdy01i <= dble_slopelimit_01 ) +- ? dble_dzdy01i : sign_dzdy01 * dble_slopelimit_01; +- const double dble_dzdx11 = +- ( sign_dzdx11 * dble_dzdx11i <= dble_slopelimit_11 ) +- ? dble_dzdx11i : sign_dzdx11 * dble_slopelimit_11; +- const double dble_dzdy11 = +- ( sign_dzdy11 * dble_dzdy11i <= dble_slopelimit_11 ) +- ? dble_dzdy11i : sign_dzdy11 * dble_slopelimit_11; +- +- /* +- * Sums and differences of first derivatives: +- */ +- const double twelve_sum00 = 6.0 * ( dble_dzdx00 + dble_dzdy00 ); +- const double twelve_dif00 = 6.0 * ( dble_dzdx00 - dble_dzdy00 ); +- const double twelve_sum10 = 6.0 * ( dble_dzdx10 + dble_dzdy10 ); +- const double twelve_dif10 = 6.0 * ( dble_dzdx10 - dble_dzdy10 ); +- const double twelve_sum01 = 6.0 * ( dble_dzdx01 + dble_dzdy01 ); +- const double twelve_dif01 = 6.0 * ( dble_dzdx01 - dble_dzdy01 ); +- const double twelve_sum11 = 6.0 * ( dble_dzdx11 + dble_dzdy11 ); +- const double twelve_dif11 = 6.0 * ( dble_dzdx11 - dble_dzdy11 ); +- +- /* +- * Absolute values of the sums: +- */ +- const double twelve_abs_sum00 = NOHALO_ABS( twelve_sum00 ); +- const double twelve_abs_sum10 = NOHALO_ABS( twelve_sum10 ); +- const double twelve_abs_sum01 = NOHALO_ABS( twelve_sum01 ); +- const double twelve_abs_sum11 = NOHALO_ABS( twelve_sum11 ); +- +- /* +- * Scaled distances to the min: +- */ +- const double u00_times_36 = 36.0 * u00; +- const double u10_times_36 = 36.0 * u10; +- const double u01_times_36 = 36.0 * u01; +- const double u11_times_36 = 36.0 * u11; +- +- /* +- * First cross-derivative limiter: +- */ +- const double first_limit00 = twelve_abs_sum00 - u00_times_36; +- const double first_limit10 = twelve_abs_sum10 - u10_times_36; +- const double first_limit01 = twelve_abs_sum01 - u01_times_36; +- const double first_limit11 = twelve_abs_sum11 - u11_times_36; +- +- const double quad_d2zdxdy00ii = NOHALO_MAX( quad_d2zdxdy00i, first_limit00 ); +- const double quad_d2zdxdy10ii = NOHALO_MAX( quad_d2zdxdy10i, first_limit10 ); +- const double quad_d2zdxdy01ii = NOHALO_MAX( quad_d2zdxdy01i, first_limit01 ); +- const double quad_d2zdxdy11ii = NOHALO_MAX( quad_d2zdxdy11i, first_limit11 ); +- +- /* +- * Scaled distances to the max: +- */ +- const double v00_times_36 = 36.0 * v00; +- const double v10_times_36 = 36.0 * v10; +- const double v01_times_36 = 36.0 * v01; +- const double v11_times_36 = 36.0 * v11; +- +- /* +- * Second cross-derivative limiter: +- */ +- const double second_limit00 = v00_times_36 - twelve_abs_sum00; +- const double second_limit10 = v10_times_36 - twelve_abs_sum10; +- const double second_limit01 = v01_times_36 - twelve_abs_sum01; +- const double second_limit11 = v11_times_36 - twelve_abs_sum11; +- +- const double quad_d2zdxdy00iii = +- NOHALO_MIN( quad_d2zdxdy00ii, second_limit00 ); +- const double quad_d2zdxdy10iii = +- NOHALO_MIN( quad_d2zdxdy10ii, second_limit10 ); +- const double quad_d2zdxdy01iii = +- NOHALO_MIN( quad_d2zdxdy01ii, second_limit01 ); +- const double quad_d2zdxdy11iii = +- NOHALO_MIN( quad_d2zdxdy11ii, second_limit11 ); +- +- /* +- * Absolute values of the differences: +- */ +- const double twelve_abs_dif00 = NOHALO_ABS( twelve_dif00 ); +- const double twelve_abs_dif10 = NOHALO_ABS( twelve_dif10 ); +- const double twelve_abs_dif01 = NOHALO_ABS( twelve_dif01 ); +- const double twelve_abs_dif11 = NOHALO_ABS( twelve_dif11 ); +- +- /* +- * Third cross-derivative limiter: +- */ +- const double third_limit00 = twelve_abs_dif00 - v00_times_36; +- const double third_limit10 = twelve_abs_dif10 - v10_times_36; +- const double third_limit01 = twelve_abs_dif01 - v01_times_36; +- const double third_limit11 = twelve_abs_dif11 - v11_times_36; +- +- const double quad_d2zdxdy00iiii = +- NOHALO_MAX( quad_d2zdxdy00iii, third_limit00); +- const double quad_d2zdxdy10iiii = +- NOHALO_MAX( quad_d2zdxdy10iii, third_limit10); +- const double quad_d2zdxdy01iiii = +- NOHALO_MAX( quad_d2zdxdy01iii, third_limit01); +- const double quad_d2zdxdy11iiii = +- NOHALO_MAX( quad_d2zdxdy11iii, third_limit11); +- +- /* +- * Fourth cross-derivative limiter: +- */ +- const double fourth_limit00 = u00_times_36 - twelve_abs_dif00; +- const double fourth_limit10 = u10_times_36 - twelve_abs_dif10; +- const double fourth_limit01 = u01_times_36 - twelve_abs_dif01; +- const double fourth_limit11 = u11_times_36 - twelve_abs_dif11; +- +- const double quad_d2zdxdy00 = NOHALO_MIN( quad_d2zdxdy00iiii, fourth_limit00); +- const double quad_d2zdxdy10 = NOHALO_MIN( quad_d2zdxdy10iiii, fourth_limit10); +- const double quad_d2zdxdy01 = NOHALO_MIN( quad_d2zdxdy01iiii, fourth_limit01); +- const double quad_d2zdxdy11 = NOHALO_MIN( quad_d2zdxdy11iiii, fourth_limit11); +- +- /* +- * Part of the result which does not need derivatives: +- */ +- const double newval1 = c00 * dos_two +- + +- c10 * dos_thr +- + +- c01 * tre_two +- + +- c11 * tre_thr; +- +- /* +- * Twice the part of the result which only needs first derivatives. +- */ +- const double newval2 = c00dx * dble_dzdx00 +- + +- c10dx * dble_dzdx10 +- + +- c01dx * dble_dzdx01 +- + +- c11dx * dble_dzdx11 +- + +- c00dy * dble_dzdy00 +- + +- c10dy * dble_dzdy10 +- + +- c01dy * dble_dzdy01 +- + +- c11dy * dble_dzdy11; +- +- /* +- * Four times the part of the result which only uses cross +- * derivatives: +- */ +- const double newval3 = c00dxdy * quad_d2zdxdy00 +- + +- c10dxdy * quad_d2zdxdy10 +- + +- c01dxdy * quad_d2zdxdy01 +- + +- c11dxdy * quad_d2zdxdy11; +- +- const double newval = newval1 + .5 * newval2 + .25 * newval3; +- +- return newval; ++ /* ++ * The remainder of the "per channel" computation involves the ++ * computation of: ++ * ++ * --8 conditional moves, ++ * ++ * --8 signs (in which the sign of zero is unimportant), ++ * ++ * --12 minima of two values, ++ * ++ * --8 maxima of two values, ++ * ++ * --8 absolute values, ++ * ++ * for a grand total of 29 minima, 25 maxima, 8 conditional moves, 8 ++ * signs, and 8 absolute values. If everything is done with ++ * conditional moves, "only" 28+8+8+12+8+8=72 flags are involved ++ * (because initial min and max can be computed with one flag). ++ * ++ * The "per channel" part of the computation also involves 107 ++ * arithmetic operations (54 *, 21 +, 42 -). ++ */ ++ ++ /* ++ * Distances to the local min and max: ++ */ ++ const double u11 = tre_thr - min11; ++ const double v11 = max11 - tre_thr; ++ const double u01 = tre_two - min01; ++ const double v01 = max01 - tre_two; ++ const double u00 = dos_two - min00; ++ const double v00 = max00 - dos_two; ++ const double u10 = dos_thr - min10; ++ const double v10 = max10 - dos_thr; ++ ++ /* ++ * Initial values of the derivatives computed with centered ++ * differences. Factors of 1/2 are left out because they are folded ++ * in later: ++ */ ++ const double dble_dzdx00i = dos_thr - dos_one; ++ const double dble_dzdy11i = qua_thr - dos_thr; ++ const double dble_dzdx10i = dos_fou - dos_two; ++ const double dble_dzdy01i = qua_two - dos_two; ++ const double dble_dzdx01i = tre_thr - tre_one; ++ const double dble_dzdy10i = tre_thr - uno_thr; ++ const double dble_dzdx11i = tre_fou - tre_two; ++ const double dble_dzdy00i = tre_two - uno_two; ++ ++ /* ++ * Signs of the derivatives. The upcoming clamping does not change ++ * them (except if the clamping sends a negative derivative to 0, in ++ * which case the sign does not matter anyway). ++ */ ++ const double sign_dzdx00 = NOHALO_SIGN(dble_dzdx00i); ++ const double sign_dzdx10 = NOHALO_SIGN(dble_dzdx10i); ++ const double sign_dzdx01 = NOHALO_SIGN(dble_dzdx01i); ++ const double sign_dzdx11 = NOHALO_SIGN(dble_dzdx11i); ++ ++ const double sign_dzdy00 = NOHALO_SIGN(dble_dzdy00i); ++ const double sign_dzdy10 = NOHALO_SIGN(dble_dzdy10i); ++ const double sign_dzdy01 = NOHALO_SIGN(dble_dzdy01i); ++ const double sign_dzdy11 = NOHALO_SIGN(dble_dzdy11i); ++ ++ /* ++ * Initial values of the cross-derivatives. Factors of 1/4 are left ++ * out because folded in later: ++ */ ++ const double quad_d2zdxdy00i = uno_one - uno_thr + dble_dzdx01i; ++ const double quad_d2zdxdy10i = uno_two - uno_fou + dble_dzdx11i; ++ const double quad_d2zdxdy01i = qua_thr - qua_one - dble_dzdx00i; ++ const double quad_d2zdxdy11i = qua_fou - qua_two - dble_dzdx10i; ++ ++ /* ++ * Slope limiters. The key multiplier is 3 but we fold a factor of ++ * 2, hence 6: ++ */ ++ const double dble_slopelimit_00 = 6.0 * NOHALO_MIN(u00, v00); ++ const double dble_slopelimit_10 = 6.0 * NOHALO_MIN(u10, v10); ++ const double dble_slopelimit_01 = 6.0 * NOHALO_MIN(u01, v01); ++ const double dble_slopelimit_11 = 6.0 * NOHALO_MIN(u11, v11); ++ ++ /* ++ * Clamped first derivatives: ++ */ ++ const double dble_dzdx00 = ++ (sign_dzdx00 * dble_dzdx00i <= dble_slopelimit_00) ++ ? dble_dzdx00i ++ : sign_dzdx00 * dble_slopelimit_00; ++ const double dble_dzdy00 = ++ (sign_dzdy00 * dble_dzdy00i <= dble_slopelimit_00) ++ ? dble_dzdy00i ++ : sign_dzdy00 * dble_slopelimit_00; ++ const double dble_dzdx10 = ++ (sign_dzdx10 * dble_dzdx10i <= dble_slopelimit_10) ++ ? dble_dzdx10i ++ : sign_dzdx10 * dble_slopelimit_10; ++ const double dble_dzdy10 = ++ (sign_dzdy10 * dble_dzdy10i <= dble_slopelimit_10) ++ ? dble_dzdy10i ++ : sign_dzdy10 * dble_slopelimit_10; ++ const double dble_dzdx01 = ++ (sign_dzdx01 * dble_dzdx01i <= dble_slopelimit_01) ++ ? dble_dzdx01i ++ : sign_dzdx01 * dble_slopelimit_01; ++ const double dble_dzdy01 = ++ (sign_dzdy01 * dble_dzdy01i <= dble_slopelimit_01) ++ ? dble_dzdy01i ++ : sign_dzdy01 * dble_slopelimit_01; ++ const double dble_dzdx11 = ++ (sign_dzdx11 * dble_dzdx11i <= dble_slopelimit_11) ++ ? dble_dzdx11i ++ : sign_dzdx11 * dble_slopelimit_11; ++ const double dble_dzdy11 = ++ (sign_dzdy11 * dble_dzdy11i <= dble_slopelimit_11) ++ ? dble_dzdy11i ++ : sign_dzdy11 * dble_slopelimit_11; ++ ++ /* ++ * Sums and differences of first derivatives: ++ */ ++ const double twelve_sum00 = 6.0 * (dble_dzdx00 + dble_dzdy00); ++ const double twelve_dif00 = 6.0 * (dble_dzdx00 - dble_dzdy00); ++ const double twelve_sum10 = 6.0 * (dble_dzdx10 + dble_dzdy10); ++ const double twelve_dif10 = 6.0 * (dble_dzdx10 - dble_dzdy10); ++ const double twelve_sum01 = 6.0 * (dble_dzdx01 + dble_dzdy01); ++ const double twelve_dif01 = 6.0 * (dble_dzdx01 - dble_dzdy01); ++ const double twelve_sum11 = 6.0 * (dble_dzdx11 + dble_dzdy11); ++ const double twelve_dif11 = 6.0 * (dble_dzdx11 - dble_dzdy11); ++ ++ /* ++ * Absolute values of the sums: ++ */ ++ const double twelve_abs_sum00 = NOHALO_ABS(twelve_sum00); ++ const double twelve_abs_sum10 = NOHALO_ABS(twelve_sum10); ++ const double twelve_abs_sum01 = NOHALO_ABS(twelve_sum01); ++ const double twelve_abs_sum11 = NOHALO_ABS(twelve_sum11); ++ ++ /* ++ * Scaled distances to the min: ++ */ ++ const double u00_times_36 = 36.0 * u00; ++ const double u10_times_36 = 36.0 * u10; ++ const double u01_times_36 = 36.0 * u01; ++ const double u11_times_36 = 36.0 * u11; ++ ++ /* ++ * First cross-derivative limiter: ++ */ ++ const double first_limit00 = twelve_abs_sum00 - u00_times_36; ++ const double first_limit10 = twelve_abs_sum10 - u10_times_36; ++ const double first_limit01 = twelve_abs_sum01 - u01_times_36; ++ const double first_limit11 = twelve_abs_sum11 - u11_times_36; ++ ++ const double quad_d2zdxdy00ii = NOHALO_MAX(quad_d2zdxdy00i, first_limit00); ++ const double quad_d2zdxdy10ii = NOHALO_MAX(quad_d2zdxdy10i, first_limit10); ++ const double quad_d2zdxdy01ii = NOHALO_MAX(quad_d2zdxdy01i, first_limit01); ++ const double quad_d2zdxdy11ii = NOHALO_MAX(quad_d2zdxdy11i, first_limit11); ++ ++ /* ++ * Scaled distances to the max: ++ */ ++ const double v00_times_36 = 36.0 * v00; ++ const double v10_times_36 = 36.0 * v10; ++ const double v01_times_36 = 36.0 * v01; ++ const double v11_times_36 = 36.0 * v11; ++ ++ /* ++ * Second cross-derivative limiter: ++ */ ++ const double second_limit00 = v00_times_36 - twelve_abs_sum00; ++ const double second_limit10 = v10_times_36 - twelve_abs_sum10; ++ const double second_limit01 = v01_times_36 - twelve_abs_sum01; ++ const double second_limit11 = v11_times_36 - twelve_abs_sum11; ++ ++ const double quad_d2zdxdy00iii = ++ NOHALO_MIN(quad_d2zdxdy00ii, second_limit00); ++ const double quad_d2zdxdy10iii = ++ NOHALO_MIN(quad_d2zdxdy10ii, second_limit10); ++ const double quad_d2zdxdy01iii = ++ NOHALO_MIN(quad_d2zdxdy01ii, second_limit01); ++ const double quad_d2zdxdy11iii = ++ NOHALO_MIN(quad_d2zdxdy11ii, second_limit11); ++ ++ /* ++ * Absolute values of the differences: ++ */ ++ const double twelve_abs_dif00 = NOHALO_ABS(twelve_dif00); ++ const double twelve_abs_dif10 = NOHALO_ABS(twelve_dif10); ++ const double twelve_abs_dif01 = NOHALO_ABS(twelve_dif01); ++ const double twelve_abs_dif11 = NOHALO_ABS(twelve_dif11); ++ ++ /* ++ * Third cross-derivative limiter: ++ */ ++ const double third_limit00 = twelve_abs_dif00 - v00_times_36; ++ const double third_limit10 = twelve_abs_dif10 - v10_times_36; ++ const double third_limit01 = twelve_abs_dif01 - v01_times_36; ++ const double third_limit11 = twelve_abs_dif11 - v11_times_36; ++ ++ const double quad_d2zdxdy00iiii = ++ NOHALO_MAX(quad_d2zdxdy00iii, third_limit00); ++ const double quad_d2zdxdy10iiii = ++ NOHALO_MAX(quad_d2zdxdy10iii, third_limit10); ++ const double quad_d2zdxdy01iiii = ++ NOHALO_MAX(quad_d2zdxdy01iii, third_limit01); ++ const double quad_d2zdxdy11iiii = ++ NOHALO_MAX(quad_d2zdxdy11iii, third_limit11); ++ ++ /* ++ * Fourth cross-derivative limiter: ++ */ ++ const double fourth_limit00 = u00_times_36 - twelve_abs_dif00; ++ const double fourth_limit10 = u10_times_36 - twelve_abs_dif10; ++ const double fourth_limit01 = u01_times_36 - twelve_abs_dif01; ++ const double fourth_limit11 = u11_times_36 - twelve_abs_dif11; ++ ++ const double quad_d2zdxdy00 = NOHALO_MIN(quad_d2zdxdy00iiii, fourth_limit00); ++ const double quad_d2zdxdy10 = NOHALO_MIN(quad_d2zdxdy10iiii, fourth_limit10); ++ const double quad_d2zdxdy01 = NOHALO_MIN(quad_d2zdxdy01iiii, fourth_limit01); ++ const double quad_d2zdxdy11 = NOHALO_MIN(quad_d2zdxdy11iiii, fourth_limit11); ++ ++ /* ++ * Part of the result which does not need derivatives: ++ */ ++ const double newval1 = c00 * dos_two + ++ c10 * dos_thr + ++ c01 * tre_two + ++ c11 * tre_thr; ++ ++ /* ++ * Twice the part of the result which only needs first derivatives. ++ */ ++ const double newval2 = c00dx * dble_dzdx00 + ++ c10dx * dble_dzdx10 + ++ c01dx * dble_dzdx01 + ++ c11dx * dble_dzdx11 + ++ c00dy * dble_dzdy00 + ++ c10dy * dble_dzdy10 + ++ c01dy * dble_dzdy01 + ++ c11dy * dble_dzdy11; ++ ++ /* ++ * Four times the part of the result which only uses cross ++ * derivatives: ++ */ ++ const double newval3 = c00dxdy * quad_d2zdxdy00 + ++ c10dxdy * quad_d2zdxdy10 + ++ c01dxdy * quad_d2zdxdy01 + ++ c11dxdy * quad_d2zdxdy11; ++ ++ const double newval = newval1 + .5 * newval2 + .25 * newval3; ++ ++ return newval; + } + + /* +@@ -1226,371 +1203,358 @@ lbbicubic( const double c00, + * this would allow code comments!---but we can't figure a clean way + * to do it. + */ +-#define NOHALO_CONVERSION( conversion ) \ +- template static void inline \ +- nohalo_ ## conversion( void* restrict pout, \ +- const void* restrict pin, \ +- const int bands, \ +- const int lskip, \ +- const double x_0, \ +- const double y_0 ) \ +- { \ +- T* restrict out = (T *) pout; \ +- \ +- const T* restrict in = (T *) pin; \ +- \ +- \ +- const int sign_of_x_0 = 2 * ( x_0 >= 0. ) - 1; \ +- const int sign_of_y_0 = 2 * ( y_0 >= 0. ) - 1; \ +- \ +- \ +- const int shift_forw_1_pix = sign_of_x_0 * bands; \ +- const int shift_forw_1_row = sign_of_y_0 * lskip; \ +- \ +- const int shift_back_1_pix = -shift_forw_1_pix; \ +- const int shift_back_1_row = -shift_forw_1_row; \ +- \ +- const int shift_back_2_pix = 2 * shift_back_1_pix; \ +- const int shift_back_2_row = 2 * shift_back_1_row; \ +- const int shift_forw_2_pix = 2 * shift_forw_1_pix; \ +- const int shift_forw_2_row = 2 * shift_forw_1_row; \ +- \ +- \ +- const int uno_two_shift = shift_back_1_pix + shift_back_2_row; \ +- const int uno_thr_shift = shift_back_2_row; \ +- const int uno_fou_shift = shift_forw_1_pix + shift_back_2_row; \ +- \ +- const int dos_one_shift = shift_back_2_pix + shift_back_1_row; \ +- const int dos_two_shift = shift_back_1_pix + shift_back_1_row; \ +- const int dos_thr_shift = shift_back_1_row; \ +- const int dos_fou_shift = shift_forw_1_pix + shift_back_1_row; \ +- const int dos_fiv_shift = shift_forw_2_pix + shift_back_1_row; \ +- \ +- const int tre_one_shift = shift_back_2_pix; \ +- const int tre_two_shift = shift_back_1_pix; \ +- const int tre_thr_shift = 0; \ +- const int tre_fou_shift = shift_forw_1_pix; \ +- const int tre_fiv_shift = shift_forw_2_pix; \ +- \ +- const int qua_one_shift = shift_back_2_pix + shift_forw_1_row; \ +- const int qua_two_shift = shift_back_1_pix + shift_forw_1_row; \ +- const int qua_thr_shift = shift_forw_1_row; \ +- const int qua_fou_shift = shift_forw_1_pix + shift_forw_1_row; \ +- const int qua_fiv_shift = shift_forw_2_pix + shift_forw_1_row; \ +- \ +- const int cin_two_shift = shift_back_1_pix + shift_forw_2_row; \ +- const int cin_thr_shift = shift_forw_2_row; \ +- const int cin_fou_shift = shift_forw_1_pix + shift_forw_2_row; \ +- \ +- \ +- const double xp1over2 = ( 2 * sign_of_x_0 ) * x_0; \ +- const double xm1over2 = xp1over2 - 1.0; \ +- const double onepx = 0.5 + xp1over2; \ +- const double onemx = 1.5 - xp1over2; \ +- const double xp1over2sq = xp1over2 * xp1over2; \ +- \ +- const double yp1over2 = ( 2 * sign_of_y_0 ) * y_0; \ +- const double ym1over2 = yp1over2 - 1.0; \ +- const double onepy = 0.5 + yp1over2; \ +- const double onemy = 1.5 - yp1over2; \ +- const double yp1over2sq = yp1over2 * yp1over2; \ +- \ +- const double xm1over2sq = xm1over2 * xm1over2; \ +- const double ym1over2sq = ym1over2 * ym1over2; \ +- \ +- const double twice1px = onepx + onepx; \ +- const double twice1py = onepy + onepy; \ +- const double twice1mx = onemx + onemx; \ +- const double twice1my = onemy + onemy; \ +- \ +- const double xm1over2sq_times_ym1over2sq = xm1over2sq * ym1over2sq; \ +- const double xp1over2sq_times_ym1over2sq = xp1over2sq * ym1over2sq; \ +- const double xp1over2sq_times_yp1over2sq = xp1over2sq * yp1over2sq; \ +- const double xm1over2sq_times_yp1over2sq = xm1over2sq * yp1over2sq; \ +- \ +- const double four_times_1px_times_1py = twice1px * twice1py; \ +- const double four_times_1mx_times_1py = twice1mx * twice1py; \ +- const double twice_xp1over2_times_1py = xp1over2 * twice1py; \ +- const double twice_xm1over2_times_1py = xm1over2 * twice1py; \ +- \ +- const double twice_xm1over2_times_1my = xm1over2 * twice1my; \ +- const double twice_xp1over2_times_1my = xp1over2 * twice1my; \ +- const double four_times_1mx_times_1my = twice1mx * twice1my; \ +- const double four_times_1px_times_1my = twice1px * twice1my; \ +- \ +- const double twice_1px_times_ym1over2 = twice1px * ym1over2; \ +- const double twice_1mx_times_ym1over2 = twice1mx * ym1over2; \ +- const double xp1over2_times_ym1over2 = xp1over2 * ym1over2; \ +- const double xm1over2_times_ym1over2 = xm1over2 * ym1over2; \ +- \ +- const double xm1over2_times_yp1over2 = xm1over2 * yp1over2; \ +- const double xp1over2_times_yp1over2 = xp1over2 * yp1over2; \ +- const double twice_1mx_times_yp1over2 = twice1mx * yp1over2; \ +- const double twice_1px_times_yp1over2 = twice1px * yp1over2; \ +- \ +- \ +- const double c00 = \ +- four_times_1px_times_1py * xm1over2sq_times_ym1over2sq; \ +- const double c00dx = \ +- twice_xp1over2_times_1py * xm1over2sq_times_ym1over2sq; \ +- const double c00dy = \ +- twice_1px_times_yp1over2 * xm1over2sq_times_ym1over2sq; \ +- const double c00dxdy = \ +- xp1over2_times_yp1over2 * xm1over2sq_times_ym1over2sq; \ +- \ +- const double c10 = \ +- four_times_1mx_times_1py * xp1over2sq_times_ym1over2sq; \ +- const double c10dx = \ +- twice_xm1over2_times_1py * xp1over2sq_times_ym1over2sq; \ +- const double c10dy = \ +- twice_1mx_times_yp1over2 * xp1over2sq_times_ym1over2sq; \ +- const double c10dxdy = \ +- xm1over2_times_yp1over2 * xp1over2sq_times_ym1over2sq; \ +- \ +- const double c01 = \ +- four_times_1px_times_1my * xm1over2sq_times_yp1over2sq; \ +- const double c01dx = \ +- twice_xp1over2_times_1my * xm1over2sq_times_yp1over2sq; \ +- const double c01dy = \ +- twice_1px_times_ym1over2 * xm1over2sq_times_yp1over2sq; \ +- const double c01dxdy = \ +- xp1over2_times_ym1over2 * xm1over2sq_times_yp1over2sq; \ +- \ +- const double c11 = \ +- four_times_1mx_times_1my * xp1over2sq_times_yp1over2sq; \ +- const double c11dx = \ +- twice_xm1over2_times_1my * xp1over2sq_times_yp1over2sq; \ +- const double c11dy = \ +- twice_1mx_times_ym1over2 * xp1over2sq_times_yp1over2sq; \ +- const double c11dxdy = \ +- xm1over2_times_ym1over2 * xp1over2sq_times_yp1over2sq; \ +- \ +- \ +- int band = bands; \ +- \ +- \ +- do \ +- { \ +- double uno_one, uno_two, uno_thr, uno_fou; \ +- double dos_one, dos_two, dos_thr, dos_fou; \ +- double tre_one, tre_two, tre_thr, tre_fou; \ +- double qua_one, qua_two, qua_thr, qua_fou; \ +- \ +- nohalo_subdivision( in[ uno_two_shift ], \ +- in[ uno_thr_shift ], \ +- in[ uno_fou_shift ], \ +- in[ dos_one_shift ], \ +- in[ dos_two_shift ], \ +- in[ dos_thr_shift ], \ +- in[ dos_fou_shift ], \ +- in[ dos_fiv_shift ], \ +- in[ tre_one_shift ], \ +- in[ tre_two_shift ], \ +- in[ tre_thr_shift ], \ +- in[ tre_fou_shift ], \ +- in[ tre_fiv_shift ], \ +- in[ qua_one_shift ], \ +- in[ qua_two_shift ], \ +- in[ qua_thr_shift ], \ +- in[ qua_fou_shift ], \ +- in[ qua_fiv_shift ], \ +- in[ cin_two_shift ], \ +- in[ cin_thr_shift ], \ +- in[ cin_fou_shift ], \ +- &uno_one, \ +- &uno_two, \ +- &uno_thr, \ +- &uno_fou, \ +- &dos_one, \ +- &dos_two, \ +- &dos_thr, \ +- &dos_fou, \ +- &tre_one, \ +- &tre_two, \ +- &tre_thr, \ +- &tre_fou, \ +- &qua_one, \ +- &qua_two, \ +- &qua_thr, \ +- &qua_fou ); \ +- \ +- const double double_result = \ +- lbbicubic( c00, \ +- c10, \ +- c01, \ +- c11, \ +- c00dx, \ +- c10dx, \ +- c01dx, \ +- c11dx, \ +- c00dy, \ +- c10dy, \ +- c01dy, \ +- c11dy, \ +- c00dxdy, \ +- c10dxdy, \ +- c01dxdy, \ +- c11dxdy, \ +- uno_one, \ +- uno_two, \ +- uno_thr, \ +- uno_fou, \ +- dos_one, \ +- dos_two, \ +- dos_thr, \ +- dos_fou, \ +- tre_one, \ +- tre_two, \ +- tre_thr, \ +- tre_fou, \ +- qua_one, \ +- qua_two, \ +- qua_thr, \ +- qua_fou ); \ +- \ +- { \ +- const T result = to_ ## conversion( double_result ); \ +- in++; \ +- *out++ = result; \ +- } \ +- \ +- } while (--band); \ +- } +- +- +-NOHALO_CONVERSION( fptypes ) +-NOHALO_CONVERSION( withsign ) +-NOHALO_CONVERSION( nosign ) +- +- +-#define CALL( T, conversion ) \ +- nohalo_ ## conversion( out, \ +- p, \ +- bands, \ +- lskip, \ +- relative_x, \ +- relative_y ); +- ++#define NOHALO_CONVERSION(conversion) \ ++ template \ ++ static void inline nohalo_##conversion(void *restrict pout, \ ++ const void *restrict pin, \ ++ const int bands, \ ++ const int lskip, \ ++ const double x_0, \ ++ const double y_0) \ ++ { \ ++ T *restrict out = (T *) pout; \ ++\ ++ const T *restrict in = (T *) pin; \ ++\ ++ const int sign_of_x_0 = 2 * (x_0 >= 0.) - 1; \ ++ const int sign_of_y_0 = 2 * (y_0 >= 0.) - 1; \ ++\ ++ const int shift_forw_1_pix = sign_of_x_0 * bands; \ ++ const int shift_forw_1_row = sign_of_y_0 * lskip; \ ++\ ++ const int shift_back_1_pix = -shift_forw_1_pix; \ ++ const int shift_back_1_row = -shift_forw_1_row; \ ++\ ++ const int shift_back_2_pix = 2 * shift_back_1_pix; \ ++ const int shift_back_2_row = 2 * shift_back_1_row; \ ++ const int shift_forw_2_pix = 2 * shift_forw_1_pix; \ ++ const int shift_forw_2_row = 2 * shift_forw_1_row; \ ++\ ++ const int uno_two_shift = shift_back_1_pix + shift_back_2_row; \ ++ const int uno_thr_shift = shift_back_2_row; \ ++ const int uno_fou_shift = shift_forw_1_pix + shift_back_2_row; \ ++\ ++ const int dos_one_shift = shift_back_2_pix + shift_back_1_row; \ ++ const int dos_two_shift = shift_back_1_pix + shift_back_1_row; \ ++ const int dos_thr_shift = shift_back_1_row; \ ++ const int dos_fou_shift = shift_forw_1_pix + shift_back_1_row; \ ++ const int dos_fiv_shift = shift_forw_2_pix + shift_back_1_row; \ ++\ ++ const int tre_one_shift = shift_back_2_pix; \ ++ const int tre_two_shift = shift_back_1_pix; \ ++ const int tre_thr_shift = 0; \ ++ const int tre_fou_shift = shift_forw_1_pix; \ ++ const int tre_fiv_shift = shift_forw_2_pix; \ ++\ ++ const int qua_one_shift = shift_back_2_pix + shift_forw_1_row; \ ++ const int qua_two_shift = shift_back_1_pix + shift_forw_1_row; \ ++ const int qua_thr_shift = shift_forw_1_row; \ ++ const int qua_fou_shift = shift_forw_1_pix + shift_forw_1_row; \ ++ const int qua_fiv_shift = shift_forw_2_pix + shift_forw_1_row; \ ++\ ++ const int cin_two_shift = shift_back_1_pix + shift_forw_2_row; \ ++ const int cin_thr_shift = shift_forw_2_row; \ ++ const int cin_fou_shift = shift_forw_1_pix + shift_forw_2_row; \ ++\ ++ const double xp1over2 = (2 * sign_of_x_0) * x_0; \ ++ const double xm1over2 = xp1over2 - 1.0; \ ++ const double onepx = 0.5 + xp1over2; \ ++ const double onemx = 1.5 - xp1over2; \ ++ const double xp1over2sq = xp1over2 * xp1over2; \ ++\ ++ const double yp1over2 = (2 * sign_of_y_0) * y_0; \ ++ const double ym1over2 = yp1over2 - 1.0; \ ++ const double onepy = 0.5 + yp1over2; \ ++ const double onemy = 1.5 - yp1over2; \ ++ const double yp1over2sq = yp1over2 * yp1over2; \ ++\ ++ const double xm1over2sq = xm1over2 * xm1over2; \ ++ const double ym1over2sq = ym1over2 * ym1over2; \ ++\ ++ const double twice1px = onepx + onepx; \ ++ const double twice1py = onepy + onepy; \ ++ const double twice1mx = onemx + onemx; \ ++ const double twice1my = onemy + onemy; \ ++\ ++ const double xm1over2sq_times_ym1over2sq = xm1over2sq * ym1over2sq; \ ++ const double xp1over2sq_times_ym1over2sq = xp1over2sq * ym1over2sq; \ ++ const double xp1over2sq_times_yp1over2sq = xp1over2sq * yp1over2sq; \ ++ const double xm1over2sq_times_yp1over2sq = xm1over2sq * yp1over2sq; \ ++\ ++ const double four_times_1px_times_1py = twice1px * twice1py; \ ++ const double four_times_1mx_times_1py = twice1mx * twice1py; \ ++ const double twice_xp1over2_times_1py = xp1over2 * twice1py; \ ++ const double twice_xm1over2_times_1py = xm1over2 * twice1py; \ ++\ ++ const double twice_xm1over2_times_1my = xm1over2 * twice1my; \ ++ const double twice_xp1over2_times_1my = xp1over2 * twice1my; \ ++ const double four_times_1mx_times_1my = twice1mx * twice1my; \ ++ const double four_times_1px_times_1my = twice1px * twice1my; \ ++\ ++ const double twice_1px_times_ym1over2 = twice1px * ym1over2; \ ++ const double twice_1mx_times_ym1over2 = twice1mx * ym1over2; \ ++ const double xp1over2_times_ym1over2 = xp1over2 * ym1over2; \ ++ const double xm1over2_times_ym1over2 = xm1over2 * ym1over2; \ ++\ ++ const double xm1over2_times_yp1over2 = xm1over2 * yp1over2; \ ++ const double xp1over2_times_yp1over2 = xp1over2 * yp1over2; \ ++ const double twice_1mx_times_yp1over2 = twice1mx * yp1over2; \ ++ const double twice_1px_times_yp1over2 = twice1px * yp1over2; \ ++\ ++ const double c00 = \ ++ four_times_1px_times_1py * xm1over2sq_times_ym1over2sq; \ ++ const double c00dx = \ ++ twice_xp1over2_times_1py * xm1over2sq_times_ym1over2sq; \ ++ const double c00dy = \ ++ twice_1px_times_yp1over2 * xm1over2sq_times_ym1over2sq; \ ++ const double c00dxdy = \ ++ xp1over2_times_yp1over2 * xm1over2sq_times_ym1over2sq; \ ++\ ++ const double c10 = \ ++ four_times_1mx_times_1py * xp1over2sq_times_ym1over2sq; \ ++ const double c10dx = \ ++ twice_xm1over2_times_1py * xp1over2sq_times_ym1over2sq; \ ++ const double c10dy = \ ++ twice_1mx_times_yp1over2 * xp1over2sq_times_ym1over2sq; \ ++ const double c10dxdy = \ ++ xm1over2_times_yp1over2 * xp1over2sq_times_ym1over2sq; \ ++\ ++ const double c01 = \ ++ four_times_1px_times_1my * xm1over2sq_times_yp1over2sq; \ ++ const double c01dx = \ ++ twice_xp1over2_times_1my * xm1over2sq_times_yp1over2sq; \ ++ const double c01dy = \ ++ twice_1px_times_ym1over2 * xm1over2sq_times_yp1over2sq; \ ++ const double c01dxdy = \ ++ xp1over2_times_ym1over2 * xm1over2sq_times_yp1over2sq; \ ++\ ++ const double c11 = \ ++ four_times_1mx_times_1my * xp1over2sq_times_yp1over2sq; \ ++ const double c11dx = \ ++ twice_xm1over2_times_1my * xp1over2sq_times_yp1over2sq; \ ++ const double c11dy = \ ++ twice_1mx_times_ym1over2 * xp1over2sq_times_yp1over2sq; \ ++ const double c11dxdy = \ ++ xm1over2_times_ym1over2 * xp1over2sq_times_yp1over2sq; \ ++\ ++ int band = bands; \ ++\ ++ do { \ ++ double uno_one, uno_two, uno_thr, uno_fou; \ ++ double dos_one, dos_two, dos_thr, dos_fou; \ ++ double tre_one, tre_two, tre_thr, tre_fou; \ ++ double qua_one, qua_two, qua_thr, qua_fou; \ ++\ ++ nohalo_subdivision(in[uno_two_shift], \ ++ in[uno_thr_shift], \ ++ in[uno_fou_shift], \ ++ in[dos_one_shift], \ ++ in[dos_two_shift], \ ++ in[dos_thr_shift], \ ++ in[dos_fou_shift], \ ++ in[dos_fiv_shift], \ ++ in[tre_one_shift], \ ++ in[tre_two_shift], \ ++ in[tre_thr_shift], \ ++ in[tre_fou_shift], \ ++ in[tre_fiv_shift], \ ++ in[qua_one_shift], \ ++ in[qua_two_shift], \ ++ in[qua_thr_shift], \ ++ in[qua_fou_shift], \ ++ in[qua_fiv_shift], \ ++ in[cin_two_shift], \ ++ in[cin_thr_shift], \ ++ in[cin_fou_shift], \ ++ &uno_one, \ ++ &uno_two, \ ++ &uno_thr, \ ++ &uno_fou, \ ++ &dos_one, \ ++ &dos_two, \ ++ &dos_thr, \ ++ &dos_fou, \ ++ &tre_one, \ ++ &tre_two, \ ++ &tre_thr, \ ++ &tre_fou, \ ++ &qua_one, \ ++ &qua_two, \ ++ &qua_thr, \ ++ &qua_fou); \ ++\ ++ const double double_result = \ ++ lbbicubic(c00, \ ++ c10, \ ++ c01, \ ++ c11, \ ++ c00dx, \ ++ c10dx, \ ++ c01dx, \ ++ c11dx, \ ++ c00dy, \ ++ c10dy, \ ++ c01dy, \ ++ c11dy, \ ++ c00dxdy, \ ++ c10dxdy, \ ++ c01dxdy, \ ++ c11dxdy, \ ++ uno_one, \ ++ uno_two, \ ++ uno_thr, \ ++ uno_fou, \ ++ dos_one, \ ++ dos_two, \ ++ dos_thr, \ ++ dos_fou, \ ++ tre_one, \ ++ tre_two, \ ++ tre_thr, \ ++ tre_fou, \ ++ qua_one, \ ++ qua_two, \ ++ qua_thr, \ ++ qua_fou); \ ++\ ++ { \ ++ const T result = to_##conversion(double_result); \ ++ in++; \ ++ *out++ = result; \ ++ } \ ++\ ++ } while (--band); \ ++ } ++ ++NOHALO_CONVERSION(fptypes) ++NOHALO_CONVERSION(withsign) ++NOHALO_CONVERSION(nosign) ++ ++#define CALL(T, conversion) \ ++ nohalo_##conversion(out, \ ++ p, \ ++ bands, \ ++ lskip, \ ++ relative_x, \ ++ relative_y); + + /* + * We need C linkage: + */ + extern "C" { +-G_DEFINE_TYPE( VipsInterpolateNohalo, vips_interpolate_nohalo, +- VIPS_TYPE_INTERPOLATE ); ++G_DEFINE_TYPE(VipsInterpolateNohalo, vips_interpolate_nohalo, ++ VIPS_TYPE_INTERPOLATE); + } + +- + static void +-vips_interpolate_nohalo_interpolate( VipsInterpolate* restrict interpolate, +- void* restrict out, +- VipsRegion* restrict in, +- double absolute_x, +- double absolute_y ) ++vips_interpolate_nohalo_interpolate(VipsInterpolate *restrict interpolate, ++ void *restrict out, ++ VipsRegion *restrict in, ++ double absolute_x, ++ double absolute_y) + { +- /* absolute_x and absolute_y are always >= 2.0 (see double-check assert +- * below), so we don't need floor(). +- * +- * It's 2 not 0 since we ask for a window_offset of 2 at the bottom. +- */ +- const int ix = (int) (absolute_x + 0.5); +- const int iy = (int) (absolute_y + 0.5); +- +- /* +- * Move the pointer to (the first band of) the top/left pixel of the +- * 2x2 group of pixel centers which contains the sampling location +- * in its convex hull: +- */ +- const VipsPel* restrict p = VIPS_REGION_ADDR( in, ix, iy ); +- +- const double relative_x = absolute_x - ix; +- const double relative_y = absolute_y - iy; +- +- /* +- * VIPS versions of Nicolas's pixel addressing values. +- */ +- const int lskip = VIPS_REGION_LSKIP( in ) / +- VIPS_IMAGE_SIZEOF_ELEMENT( in->im ); +- +- /* +- * Double the bands for complex images to account for the real and +- * imaginary parts being computed independently: +- */ +- const int actual_bands = in->im->Bands; +- const int bands = +- vips_band_format_iscomplex( in->im->BandFmt ) ? +- 2 * actual_bands : actual_bands; +- +- g_assert( ix - 2 >= in->valid.left ); +- g_assert( iy - 2 >= in->valid.top ); +- g_assert( ix + 2 <= VIPS_RECT_RIGHT( &in->valid ) ); +- g_assert( iy + 2 <= VIPS_RECT_BOTTOM( &in->valid ) ); +- +- /* Confirm that absolute_x and absolute_y are >= 2, see above. +- */ +- g_assert( absolute_x >= 2.0 ); +- g_assert( absolute_y >= 2.0 ); +- +- switch( in->im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- CALL( unsigned char, nosign ); +- break; +- +- case VIPS_FORMAT_CHAR: +- CALL( signed char, withsign ); +- break; +- +- case VIPS_FORMAT_USHORT: +- CALL( unsigned short, nosign ); +- break; +- +- case VIPS_FORMAT_SHORT: +- CALL( signed short, withsign ); +- break; +- +- case VIPS_FORMAT_UINT: +- CALL( unsigned int, nosign ); +- break; +- +- case VIPS_FORMAT_INT: +- CALL( signed int, withsign ); +- break; +- +- /* +- * Complex images are handled by doubling of bands. +- */ +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- CALL( float, fptypes ); +- break; +- +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- CALL( double, fptypes ); +- break; +- +- default: +- g_assert( 0 ); +- break; +- } ++ /* absolute_x and absolute_y are always >= 2.0 (see double-check assert ++ * below), so we don't need floor(). ++ * ++ * It's 2 not 0 since we ask for a window_offset of 2 at the bottom. ++ */ ++ const int ix = (int) (absolute_x + 0.5); ++ const int iy = (int) (absolute_y + 0.5); ++ ++ /* ++ * Move the pointer to (the first band of) the top/left pixel of the ++ * 2x2 group of pixel centers which contains the sampling location ++ * in its convex hull: ++ */ ++ const VipsPel *restrict p = VIPS_REGION_ADDR(in, ix, iy); ++ ++ const double relative_x = absolute_x - ix; ++ const double relative_y = absolute_y - iy; ++ ++ /* ++ * VIPS versions of Nicolas's pixel addressing values. ++ */ ++ const int lskip = VIPS_REGION_LSKIP(in) / ++ VIPS_IMAGE_SIZEOF_ELEMENT(in->im); ++ ++ /* ++ * Double the bands for complex images to account for the real and ++ * imaginary parts being computed independently: ++ */ ++ const int actual_bands = in->im->Bands; ++ const int bands = ++ vips_band_format_iscomplex(in->im->BandFmt) ? 2 * actual_bands : actual_bands; ++ ++ g_assert(ix - 2 >= in->valid.left); ++ g_assert(iy - 2 >= in->valid.top); ++ g_assert(ix + 2 <= VIPS_RECT_RIGHT(&in->valid)); ++ g_assert(iy + 2 <= VIPS_RECT_BOTTOM(&in->valid)); ++ ++ /* Confirm that absolute_x and absolute_y are >= 2, see above. ++ */ ++ g_assert(absolute_x >= 2.0); ++ g_assert(absolute_y >= 2.0); ++ ++ switch (in->im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ CALL(unsigned char, nosign); ++ break; ++ ++ case VIPS_FORMAT_CHAR: ++ CALL(signed char, withsign); ++ break; ++ ++ case VIPS_FORMAT_USHORT: ++ CALL(unsigned short, nosign); ++ break; ++ ++ case VIPS_FORMAT_SHORT: ++ CALL(signed short, withsign); ++ break; ++ ++ case VIPS_FORMAT_UINT: ++ CALL(unsigned int, nosign); ++ break; ++ ++ case VIPS_FORMAT_INT: ++ CALL(signed int, withsign); ++ break; ++ ++ /* ++ * Complex images are handled by doubling of bands. ++ */ ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ CALL(float, fptypes); ++ break; ++ ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ CALL(double, fptypes); ++ break; ++ ++ default: ++ g_assert(0); ++ break; ++ } + } + + static void +-vips_interpolate_nohalo_class_init( VipsInterpolateNohaloClass *klass ) ++vips_interpolate_nohalo_class_init(VipsInterpolateNohaloClass *klass) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( klass ); +- VipsInterpolateClass *interpolate_class = VIPS_INTERPOLATE_CLASS( klass ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(klass); ++ VipsInterpolateClass *interpolate_class = VIPS_INTERPOLATE_CLASS(klass); + +- object_class->nickname = "nohalo"; +- object_class->description = +- _( "edge sharpening resampler with halo reduction" ); ++ object_class->nickname = "nohalo"; ++ object_class->description = ++ _("edge sharpening resampler with halo reduction"); + +- interpolate_class->interpolate = vips_interpolate_nohalo_interpolate; +- interpolate_class->window_size = 6; +- interpolate_class->window_offset = 2; ++ interpolate_class->interpolate = vips_interpolate_nohalo_interpolate; ++ interpolate_class->window_size = 6; ++ interpolate_class->window_offset = 2; + } + + static void +-vips_interpolate_nohalo_init( VipsInterpolateNohalo *nohalo ) ++vips_interpolate_nohalo_init(VipsInterpolateNohalo *nohalo) + { + } +diff --git a/libvips/resample/presample.h b/libvips/resample/presample.h +index 0dc98734c6..cb5856a4b4 100644 +--- a/libvips/resample/presample.h ++++ b/libvips/resample/presample.h +@@ -3,28 +3,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -36,19 +36,19 @@ extern "C" { + #endif /*__cplusplus*/ + + #define VIPS_TYPE_RESAMPLE (vips_resample_get_type()) +-#define VIPS_RESAMPLE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_RESAMPLE, VipsResample )) +-#define VIPS_RESAMPLE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_RESAMPLE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_RESAMPLE, VipsResample)) ++#define VIPS_RESAMPLE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_RESAMPLE, VipsResampleClass)) ++#define VIPS_IS_RESAMPLE(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_RESAMPLE)) ++#define VIPS_IS_RESAMPLE_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_RESAMPLE)) ++#define VIPS_RESAMPLE_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_RESAMPLE, VipsResampleClass)) +-#define VIPS_IS_RESAMPLE( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_RESAMPLE )) +-#define VIPS_IS_RESAMPLE_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_RESAMPLE )) +-#define VIPS_RESAMPLE_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_RESAMPLE, VipsResampleClass )) + + typedef struct _VipsResample { + VipsOperation parent_instance; +@@ -63,20 +63,18 @@ typedef struct _VipsResampleClass { + + } VipsResampleClass; + +-GType vips_resample_get_type( void ); ++GType vips_resample_get_type(void); + + /* The max size of the vector we use. + */ + #define MAX_POINT (2000) + +-int vips_reduce_get_points( VipsKernel kernel, double shrink ); +-void vips_reduce_make_mask( double *c, +- VipsKernel kernel, double shrink, double x ); ++int vips_reduce_get_points(VipsKernel kernel, double shrink); ++void vips_reduce_make_mask(double *c, ++ VipsKernel kernel, double shrink, double x); + + #ifdef __cplusplus + } + #endif /*__cplusplus*/ + + #endif /*VIPS_PRESAMPLE_H*/ +- +- +diff --git a/libvips/resample/quadratic.c b/libvips/resample/quadratic.c +index 5a58c7d406..4d3fc8b032 100644 +--- a/libvips/resample/quadratic.c ++++ b/libvips/resample/quadratic.c +@@ -10,28 +10,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -64,10 +64,10 @@ x = x' + a : order 0 image shift only + + d x' y' : order 2 + bilinear transf. + + e x' x' + f y' y' : order 3 + quadratic transf. + +-y = y' + g +- + h y' + i x' +- + j y' x' +- + k y' y' + l x' x' ++y = y' + g ++ + h y' + i x' ++ + j y' x' ++ + k y' y' + l x' x' + + input matrix: + +@@ -102,52 +102,52 @@ typedef struct _VipsQuadratic { + + typedef VipsResampleClass VipsQuadraticClass; + +-G_DEFINE_TYPE( VipsQuadratic, vips_quadratic, VIPS_TYPE_RESAMPLE ); ++G_DEFINE_TYPE(VipsQuadratic, vips_quadratic, VIPS_TYPE_RESAMPLE); + + static void +-vips_quadratic_dispose( GObject *gobject ) ++vips_quadratic_dispose(GObject *gobject) + { + VipsQuadratic *quadratic = (VipsQuadratic *) gobject; + +- VIPS_UNREF( quadratic->mat ); ++ VIPS_UNREF(quadratic->mat); + +- G_OBJECT_CLASS( vips_quadratic_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_quadratic_parent_class)->dispose(gobject); + } + + static int +-vips_quadratic_gen( VipsRegion *or, void *vseq, +- void *a, void *b, gboolean *stop ) ++vips_quadratic_gen(VipsRegion * or, void *vseq, ++ void *a, void *b, gboolean *stop) + { + VipsRegion *ir = (VipsRegion *) vseq; + VipsQuadratic *quadratic = (VipsQuadratic *) b; +- VipsResample *resample = VIPS_RESAMPLE( quadratic ); +- VipsInterpolateMethod interpolate_fn = +- vips_interpolate_get_method( quadratic->interpolate ); ++ VipsResample *resample = VIPS_RESAMPLE(quadratic); ++ VipsInterpolateMethod interpolate_fn = ++ vips_interpolate_get_method(quadratic->interpolate); + + /* @in is the enlarged image (borders on, after vips_embed()). Use +- * @resample->in for the original, not-expanded image. ++ * @resample->in for the original, not-expanded image. + */ + const VipsImage *in = (VipsImage *) a; + +- const int ps = VIPS_IMAGE_SIZEOF_PEL( in ); ++ const int ps = VIPS_IMAGE_SIZEOF_PEL(in); + +- double *vec = VIPS_MATRIX( quadratic->mat, 0, 0 ); ++ double *vec = VIPS_MATRIX(quadratic->mat, 0, 0); + + int clip_width = resample->in->Xsize; + int clip_height = resample->in->Ysize; + + int xlow = or->valid.left; + int ylow = or->valid.top; +- int xhigh = VIPS_RECT_RIGHT( &or->valid ); +- int yhigh = VIPS_RECT_BOTTOM( &or->valid ); ++ int xhigh = VIPS_RECT_RIGHT(& or->valid); ++ int yhigh = VIPS_RECT_BOTTOM(& or->valid); + + VipsPel *q; + +- int xo, yo; /* output coordinates, dstimage */ ++ int xo, yo; /* output coordinates, dstimage */ + int z; +- double fxi, fyi; /* input coordinates */ +- double dx, dy; /* xo derivative of input coord. */ +- double ddx, ddy; /* 2nd xo derivative of input coord. */ ++ double fxi, fyi; /* input coordinates */ ++ double dx, dy; /* xo derivative of input coord. */ ++ double ddx, ddy; /* 2nd xo derivative of input coord. */ + + VipsRect image; + +@@ -155,10 +155,10 @@ vips_quadratic_gen( VipsRegion *or, void *vseq, + image.top = 0; + image.width = in->Xsize; + image.height = in->Ysize; +- if( vips_region_image( ir, &image ) ) +- return( -1 ); ++ if (vips_region_image(ir, &image)) ++ return (-1); + +- for( yo = ylow; yo < yhigh; yo++ ) { ++ for (yo = ylow; yo < yhigh; yo++) { + fxi = 0.0; + fyi = 0.0; + dx = 0.0; +@@ -166,8 +166,8 @@ vips_quadratic_gen( VipsRegion *or, void *vseq, + ddx = 0.0; + ddy = 0.0; + +- switch( quadratic->order ) { +- case 3: ++ switch (quadratic->order) { ++ case 3: + fxi += vec[10] * yo * yo + vec[8] * xlow * xlow; + fyi += vec[11] * yo * yo + vec[9] * xlow * xlow; + dx += vec[8]; +@@ -175,70 +175,70 @@ vips_quadratic_gen( VipsRegion *or, void *vseq, + dy += vec[9]; + ddy += vec[9] * 2.0; + +- case 2: ++ case 2: + fxi += vec[6] * xlow * yo; + fyi += vec[7] * xlow * yo; + dx += vec[6] * yo; + dy += vec[7] * yo; + +- case 1: ++ case 1: + fxi += vec[4] * yo + vec[2] * xlow; + fyi += vec[5] * yo + vec[3] * xlow; + dx += vec[2]; + dy += vec[3]; + +- case 0: ++ case 0: + fxi += vec[0]; +- fyi += vec[1]; ++ fyi += vec[1]; + break; + + default: +- g_assert_not_reached(); ++ g_assert_not_reached(); + } + +- printf( "dx = %g, dy = %g\n", dx, dy ); ++ printf("dx = %g, dy = %g\n", dx, dy); + +- q = VIPS_REGION_ADDR( or, xlow, yo ); ++ q = VIPS_REGION_ADDR(or, xlow, yo); + +- for( xo = xlow; xo < xhigh; xo++ ) { +- int xi, yi; ++ for (xo = xlow; xo < xhigh; xo++) { ++ int xi, yi; + + xi = fxi; + yi = fyi; + +- /* Clipping! ++ /* Clipping! + */ +- if( xi < 0 || +- yi < 0 || +- xi >= clip_width || +- yi >= clip_height ) { +- for( z = 0; z < ps; z++ ) ++ if (xi < 0 || ++ yi < 0 || ++ xi >= clip_width || ++ yi >= clip_height) { ++ for (z = 0; z < ps; z++) + q[z] = 0; + } +- else +- interpolate_fn( quadratic->interpolate, +- q, ir, fxi, fyi ); ++ else ++ interpolate_fn(quadratic->interpolate, ++ q, ir, fxi, fyi); + + q += ps; + + fxi += dx; + fyi += dy; + +- if( quadratic->order > 2 ) { ++ if (quadratic->order > 2) { + dx += ddx; + dy += ddy; + } + } + } + +- return( 0 ); ++ return (0); + } + + static int +-vips_quadratic_build( VipsObject *object ) ++vips_quadratic_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsResample *resample = VIPS_RESAMPLE( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsResample *resample = VIPS_RESAMPLE(object); + VipsQuadratic *quadratic = (VipsQuadratic *) object; + + int window_size; +@@ -246,117 +246,117 @@ vips_quadratic_build( VipsObject *object ) + VipsImage *in; + VipsImage *t; + +- if( VIPS_OBJECT_CLASS( vips_quadratic_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_quadratic_parent_class)->build(object)) ++ return (-1); + + /* We have the whole of the input in memory, so we can generate any + * output. + */ +- if( vips_image_pipelinev( resample->out, +- VIPS_DEMAND_STYLE_ANY, resample->in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(resample->out, ++ VIPS_DEMAND_STYLE_ANY, resample->in, NULL)) ++ return (-1); + + in = resample->in; + +- if( vips_check_uncoded( class->nickname, in ) || +- vips_check_noncomplex( class->nickname, in ) || +- vips_check_matrix( class->nickname, +- quadratic->coeff, &quadratic->mat ) ) +- return( -1 ); +- +- if( quadratic->mat->Xsize != 2 ) { +- vips_error( class->nickname, +- "%s", _( "coefficient matrix must have width 2" ) ); +- return( -1 ); +- } +- switch( quadratic->mat->Ysize ) { +- case 1: +- quadratic->order = 0; ++ if (vips_check_uncoded(class->nickname, in) || ++ vips_check_noncomplex(class->nickname, in) || ++ vips_check_matrix(class->nickname, ++ quadratic->coeff, &quadratic->mat)) ++ return (-1); ++ ++ if (quadratic->mat->Xsize != 2) { ++ vips_error(class->nickname, ++ "%s", _("coefficient matrix must have width 2")); ++ return (-1); ++ } ++ switch (quadratic->mat->Ysize) { ++ case 1: ++ quadratic->order = 0; + break; + +- case 3: +- quadratic->order = 1; ++ case 3: ++ quadratic->order = 1; + break; + +- case 4: +- quadratic->order = 2; ++ case 4: ++ quadratic->order = 2; + break; + +- case 6: +- quadratic->order = 3; ++ case 6: ++ quadratic->order = 3; + break; + + default: +- vips_error( class->nickname, +- "%s", _( "coefficient matrix must have height " +- "1, 3, 4 or 6" ) ); +- return( -1 ); +- } ++ vips_error(class->nickname, ++ "%s", _("coefficient matrix must have height " ++ "1, 3, 4 or 6")); ++ return (-1); ++ } + +- if( !quadratic->interpolate ) +- quadratic->interpolate = vips_interpolate_new( "bilinear" ); ++ if (!quadratic->interpolate) ++ quadratic->interpolate = vips_interpolate_new("bilinear"); + +- window_size = vips_interpolate_get_window_size( quadratic->interpolate ); +- window_offset = vips_interpolate_get_window_offset( quadratic->interpolate ); ++ window_size = vips_interpolate_get_window_size(quadratic->interpolate); ++ window_offset = vips_interpolate_get_window_offset(quadratic->interpolate); + +- /* Enlarge the input image. ++ /* Enlarge the input image. + */ +- if( vips_embed( in, &t, +- window_offset, window_offset, +- in->Xsize + window_size, in->Ysize + window_size, +- "extend", VIPS_EXTEND_COPY, +- NULL ) ) +- return( -1 ); +- vips_object_local( object, t ); ++ if (vips_embed(in, &t, ++ window_offset, window_offset, ++ in->Xsize + window_size, in->Ysize + window_size, ++ "extend", VIPS_EXTEND_COPY, ++ NULL)) ++ return (-1); ++ vips_object_local(object, t); + in = t; + +- /* We need random access to our input. +- */ +- if( !(t = vips_image_copy_memory( in )) ) +- return( -1 ); +- vips_object_local( object, t ); ++ /* We need random access to our input. ++ */ ++ if (!(t = vips_image_copy_memory(in))) ++ return (-1); ++ vips_object_local(object, t); + in = t; + +- if( vips_image_generate( resample->out, +- vips_start_one, vips_quadratic_gen, vips_stop_one, +- in, quadratic ) ) +- return( -1 ); ++ if (vips_image_generate(resample->out, ++ vips_start_one, vips_quadratic_gen, vips_stop_one, ++ in, quadratic)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_quadratic_class_init( VipsQuadraticClass *class ) ++vips_quadratic_class_init(VipsQuadraticClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_quadratic_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_quadratic_class_init\n"); + + gobject_class->dispose = vips_quadratic_dispose; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "quadratic"; +- vobject_class->description = +- _( "resample an image with a quadratic transform" ); ++ vobject_class->description = ++ _("resample an image with a quadratic transform"); + vobject_class->build = vips_quadratic_build; + +- VIPS_ARG_IMAGE( class, "coeff", 8, +- _( "Coeff" ), +- _( "Coefficient matrix" ), ++ VIPS_ARG_IMAGE(class, "coeff", 8, ++ _("Coeff"), ++ _("Coefficient matrix"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsQuadratic, coeff ) ); ++ G_STRUCT_OFFSET(VipsQuadratic, coeff)); + +- VIPS_ARG_INTERPOLATE( class, "interpolate", 9, +- _( "Interpolate" ), +- _( "Interpolate values with this" ), ++ VIPS_ARG_INTERPOLATE(class, "interpolate", 9, ++ _("Interpolate"), ++ _("Interpolate values with this"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsQuadratic, interpolate ) ); ++ G_STRUCT_OFFSET(VipsQuadratic, interpolate)); + } + + static void +-vips_quadratic_init( VipsQuadratic *quadratic ) ++vips_quadratic_init(VipsQuadratic *quadratic) + { + } + +@@ -371,21 +371,21 @@ vips_quadratic_init( VipsQuadratic *quadratic ) + * + * * @interpolate: use this interpolator (default bilinear) + * +- * This operation is unfinished and unusable, sorry. ++ * This operation is unfinished and unusable, sorry. + * + * See also: vips_affine(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_quadratic( VipsImage *in, VipsImage **out, VipsImage *coeff, ... ) ++vips_quadratic(VipsImage *in, VipsImage **out, VipsImage *coeff, ...) + { + va_list ap; + int result; + +- va_start( ap, coeff ); +- result = vips_call_split( "quadratic", ap, in, out, coeff ); +- va_end( ap ); ++ va_start(ap, coeff); ++ result = vips_call_split("quadratic", ap, in, out, coeff); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/resample/reduce.c b/libvips/resample/reduce.c +index 531898ed5d..b5ee82a076 100644 +--- a/libvips/resample/reduce.c ++++ b/libvips/resample/reduce.c +@@ -1,9 +1,9 @@ + /* 2D reduce ... call reduceh and reducev + * + * 27/1/16 +- * - from shrink.c ++ * - from shrink.c + * 15/8/16 +- * - rename xshrink -> hshrink for greater consistency ++ * - rename xshrink -> hshrink for greater consistency + * 9/9/16 + * - add @centre option + * 6/6/20 kleisauke +@@ -14,28 +14,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -59,15 +59,15 @@ + #include "presample.h" + + /** +- * VipsKernel: ++ * VipsKernel: + * @VIPS_KERNEL_NEAREST: The nearest pixel to the point. +- * @VIPS_KERNEL_LINEAR: Convolve with a triangle filter. +- * @VIPS_KERNEL_CUBIC: Convolve with a cubic filter. ++ * @VIPS_KERNEL_LINEAR: Convolve with a triangle filter. ++ * @VIPS_KERNEL_CUBIC: Convolve with a cubic filter. + * @VIPS_KERNEL_MITCHELL: Convolve with a Mitchell kernel. + * @VIPS_KERNEL_LANCZOS2: Convolve with a two-lobe Lanczos kernel. + * @VIPS_KERNEL_LANCZOS3: Convolve with a three-lobe Lanczos kernel. + * +- * The resampling kernels vips supports. See vips_reduce(), for example. ++ * The resampling kernels vips supports. See vips_reduce(), for example. + */ + + /* gtk-doc does not see comments in C++ files, so we have these docs here. +@@ -94,10 +94,10 @@ + * The default value is 0.0 (no optimization). + * + * This is a very low-level operation: see vips_resize() for a more +- * convenient way to resize images. ++ * convenient way to resize images. + * + * This operation does not change xres or yres. The image resolution needs to +- * be updated by the application. ++ * be updated by the application. + * + * See also: vips_shrink(), vips_resize(), vips_affine(). + * +@@ -125,10 +125,10 @@ + * The default value is 0.0 (no optimization). + * + * This is a very low-level operation: see vips_resize() for a more +- * convenient way to resize images. ++ * convenient way to resize images. + * + * This operation does not change xres or yres. The image resolution needs to +- * be updated by the application. ++ * be updated by the application. + * + * See also: vips_shrink(), vips_resize(), vips_affine(). + * +@@ -138,9 +138,9 @@ + typedef struct _VipsReduce { + VipsResample parent_instance; + +- double hshrink; /* Shrink factors */ ++ double hshrink; /* Shrink factors */ + double vshrink; +- double gap; /* Reduce gap */ ++ double gap; /* Reduce gap */ + + /* The thing we use to make the kernel. + */ +@@ -154,108 +154,107 @@ typedef struct _VipsReduce { + + typedef VipsResampleClass VipsReduceClass; + +-G_DEFINE_TYPE( VipsReduce, vips_reduce, VIPS_TYPE_RESAMPLE ); ++G_DEFINE_TYPE(VipsReduce, vips_reduce, VIPS_TYPE_RESAMPLE); + + static int +-vips_reduce_build( VipsObject *object ) ++vips_reduce_build(VipsObject *object) + { +- VipsResample *resample = VIPS_RESAMPLE( object ); ++ VipsResample *resample = VIPS_RESAMPLE(object); + VipsReduce *reduce = (VipsReduce *) object; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( object, 2 ); +- +- if( VIPS_OBJECT_CLASS( vips_reduce_parent_class )->build( object ) ) +- return( -1 ); +- +- if( vips_reducev( resample->in, &t[0], reduce->vshrink, +- "kernel", reduce->kernel, +- "gap", reduce->gap, +- NULL ) || +- vips_reduceh( t[0], &t[1], reduce->hshrink, +- "kernel", reduce->kernel, ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(object, 2); ++ ++ if (VIPS_OBJECT_CLASS(vips_reduce_parent_class)->build(object)) ++ return (-1); ++ ++ if (vips_reducev(resample->in, &t[0], reduce->vshrink, ++ "kernel", reduce->kernel, + "gap", reduce->gap, +- NULL ) || +- vips_image_write( t[1], resample->out ) ) +- return( -1 ); ++ NULL) || ++ vips_reduceh(t[0], &t[1], reduce->hshrink, ++ "kernel", reduce->kernel, ++ "gap", reduce->gap, ++ NULL) || ++ vips_image_write(t[1], resample->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_reduce_class_init( VipsReduceClass *class ) ++vips_reduce_class_init(VipsReduceClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_reduce_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_reduce_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "reduce"; +- vobject_class->description = _( "reduce an image" ); ++ vobject_class->description = _("reduce an image"); + vobject_class->build = vips_reduce_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_DOUBLE( class, "hshrink", 8, +- _( "Hshrink" ), +- _( "Horizontal shrink factor" ), ++ VIPS_ARG_DOUBLE(class, "hshrink", 8, ++ _("Hshrink"), ++ _("Horizontal shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsReduce, hshrink ), +- 1.0, 1000000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsReduce, hshrink), ++ 1.0, 1000000.0, 1.0); + +- VIPS_ARG_DOUBLE( class, "vshrink", 9, +- _( "Vshrink" ), +- _( "Vertical shrink factor" ), ++ VIPS_ARG_DOUBLE(class, "vshrink", 9, ++ _("Vshrink"), ++ _("Vertical shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsReduce, vshrink ), +- 1.0, 1000000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsReduce, vshrink), ++ 1.0, 1000000.0, 1.0); + +- VIPS_ARG_ENUM( class, "kernel", 3, +- _( "Kernel" ), +- _( "Resampling kernel" ), ++ VIPS_ARG_ENUM(class, "kernel", 3, ++ _("Kernel"), ++ _("Resampling kernel"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsReduce, kernel ), +- VIPS_TYPE_KERNEL, VIPS_KERNEL_LANCZOS3 ); ++ G_STRUCT_OFFSET(VipsReduce, kernel), ++ VIPS_TYPE_KERNEL, VIPS_KERNEL_LANCZOS3); + +- VIPS_ARG_DOUBLE( class, "gap", 4, +- _( "Gap" ), +- _( "Reducing gap" ), ++ VIPS_ARG_DOUBLE(class, "gap", 4, ++ _("Gap"), ++ _("Reducing gap"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsReduce, gap ), +- 0.0, 1000000.0, 0.0 ); ++ G_STRUCT_OFFSET(VipsReduce, gap), ++ 0.0, 1000000.0, 0.0); + +- /* The old names .. now use h and v everywhere. ++ /* The old names .. now use h and v everywhere. + */ +- VIPS_ARG_DOUBLE( class, "xshrink", 8, +- _( "Xshrink" ), +- _( "Horizontal shrink factor" ), ++ VIPS_ARG_DOUBLE(class, "xshrink", 8, ++ _("Xshrink"), ++ _("Horizontal shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsReduce, hshrink ), +- 1.0, 1000000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsReduce, hshrink), ++ 1.0, 1000000.0, 1.0); + +- VIPS_ARG_DOUBLE( class, "yshrink", 9, +- _( "Yshrink" ), +- _( "Vertical shrink factor" ), ++ VIPS_ARG_DOUBLE(class, "yshrink", 9, ++ _("Yshrink"), ++ _("Vertical shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsReduce, vshrink ), +- 1.0, 1000000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsReduce, vshrink), ++ 1.0, 1000000.0, 1.0); + + /* We used to let people pick centre or corner, but it's automatic now. + */ +- VIPS_ARG_BOOL( class, "centre", 7, +- _( "Centre" ), +- _( "Use centre sampling convention" ), ++ VIPS_ARG_BOOL(class, "centre", 7, ++ _("Centre"), ++ _("Use centre sampling convention"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsReduce, centre ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsReduce, centre), ++ FALSE); + } + + static void +-vips_reduce_init( VipsReduce *reduce ) ++vips_reduce_init(VipsReduce *reduce) + { + reduce->gap = 0.0; + reduce->kernel = VIPS_KERNEL_LANCZOS3; +@@ -274,7 +273,7 @@ vips_reduce_init( VipsReduce *reduce ) + * * @kernel: #VipsKernel to use to interpolate (default: lanczos3) + * * @gap: reducing gap to use (default: 0.0) + * +- * Reduce @in by a pair of factors with a pair of 1D kernels. This ++ * Reduce @in by a pair of factors with a pair of 1D kernels. This + * will not work well for shrink factors greater than three. + * + * Set @gap to speed up reducing by having vips_shrink() to shrink +@@ -283,25 +282,25 @@ vips_reduce_init( VipsReduce *reduce ) + * The default value is 0.0 (no optimization). + * + * This is a very low-level operation: see vips_resize() for a more +- * convenient way to resize images. ++ * convenient way to resize images. + * + * This operation does not change xres or yres. The image resolution needs to +- * be updated by the application. ++ * be updated by the application. + * + * See also: vips_shrink(), vips_resize(), vips_affine(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_reduce( VipsImage *in, VipsImage **out, +- double hshrink, double vshrink, ... ) ++vips_reduce(VipsImage *in, VipsImage **out, ++ double hshrink, double vshrink, ...) + { + va_list ap; + int result; + +- va_start( ap, vshrink ); +- result = vips_call_split( "reduce", ap, in, out, hshrink, vshrink ); +- va_end( ap ); ++ va_start(ap, vshrink); ++ result = vips_call_split("reduce", ap, in, out, hshrink, vshrink); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/resample/reduceh.cpp b/libvips/resample/reduceh.cpp +index dca40161a6..08992b6a66 100644 +--- a/libvips/resample/reduceh.cpp ++++ b/libvips/resample/reduceh.cpp +@@ -17,28 +17,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -65,8 +65,8 @@ + typedef struct _VipsReduceh { + VipsResample parent_instance; + +- double hshrink; /* Reduce factor */ +- double gap; /* Reduce gap */ ++ double hshrink; /* Reduce factor */ ++ double gap; /* Reduce gap */ + + /* The thing we use to make the kernel. + */ +@@ -98,70 +98,70 @@ typedef VipsResampleClass VipsReducehClass; + /* We need C linkage for this. + */ + extern "C" { +-G_DEFINE_TYPE( VipsReduceh, vips_reduceh, VIPS_TYPE_RESAMPLE ); ++G_DEFINE_TYPE(VipsReduceh, vips_reduceh, VIPS_TYPE_RESAMPLE); + } + +-/* Get n points. @shrink is the shrink factor, so 2 for a 50% reduction. ++/* Get n points. @shrink is the shrink factor, so 2 for a 50% reduction. + */ + int +-vips_reduce_get_points( VipsKernel kernel, double shrink ) ++vips_reduce_get_points(VipsKernel kernel, double shrink) + { +- switch( kernel ) { ++ switch (kernel) { + case VIPS_KERNEL_NEAREST: +- return( 1 ); ++ return (1); + + case VIPS_KERNEL_LINEAR: +- return( 2 * rint( shrink ) + 1 ); ++ return (2 * rint(shrink) + 1); + + case VIPS_KERNEL_CUBIC: + case VIPS_KERNEL_MITCHELL: +- return( 2 * rint( 2 * shrink ) + 1 ); ++ return (2 * rint(2 * shrink) + 1); + + case VIPS_KERNEL_LANCZOS2: + /* Needs to be in sync with calculate_coefficients_lanczos(). + */ +- return( 2 * rint( 2 * shrink ) + 1 ); ++ return (2 * rint(2 * shrink) + 1); + + case VIPS_KERNEL_LANCZOS3: +- return( 2 * rint( 3 * shrink ) + 1 ); ++ return (2 * rint(3 * shrink) + 1); + + default: + g_assert_not_reached(); +- return( 0 ); ++ return (0); + } + } + +-/* Calculate a mask element. ++/* Calculate a mask element. + */ + void +-vips_reduce_make_mask( double *c, VipsKernel kernel, double shrink, double x ) ++vips_reduce_make_mask(double *c, VipsKernel kernel, double shrink, double x) + { +- switch( kernel ) { ++ switch (kernel) { + case VIPS_KERNEL_NEAREST: + c[0] = 1.0; + break; + + case VIPS_KERNEL_LINEAR: +- calculate_coefficients_triangle( c, shrink, x ); ++ calculate_coefficients_triangle(c, shrink, x); + break; + + case VIPS_KERNEL_CUBIC: + /* Catmull-Rom. + */ +- calculate_coefficients_cubic( c, shrink, x, 0.0, 0.5 ); ++ calculate_coefficients_cubic(c, shrink, x, 0.0, 0.5); + break; + + case VIPS_KERNEL_MITCHELL: +- calculate_coefficients_cubic( c, shrink, x, +- 1.0 / 3.0, 1.0 / 3.0 ); ++ calculate_coefficients_cubic(c, shrink, x, ++ 1.0 / 3.0, 1.0 / 3.0); + break; + + case VIPS_KERNEL_LANCZOS2: +- calculate_coefficients_lanczos( c, 2, shrink, x ); ++ calculate_coefficients_lanczos(c, 2, shrink, x); + break; + + case VIPS_KERNEL_LANCZOS3: +- calculate_coefficients_lanczos( c, 3, shrink, x ); ++ calculate_coefficients_lanczos(c, 3, shrink, x); + break; + + default: +@@ -171,42 +171,40 @@ vips_reduce_make_mask( double *c, VipsKernel kernel, double shrink, double x ) + } + + template +-static void inline +-reduceh_unsigned_int_tab( VipsReduceh *reduceh, ++static void inline reduceh_unsigned_int_tab(VipsReduceh *reduceh, + VipsPel *pout, const VipsPel *pin, +- const int bands, const int * restrict cx ) ++ const int bands, const int *restrict cx) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + const int n = reduceh->n_point; + +- for( int z = 0; z < bands; z++ ) { ++ for (int z = 0; z < bands; z++) { + int sum; +- +- sum = reduce_sum( in + z, bands, cx, n ); +- sum = unsigned_fixed_round( sum ); +- sum = VIPS_CLIP( 0, sum, max_value ); ++ ++ sum = reduce_sum(in + z, bands, cx, n); ++ sum = unsigned_fixed_round(sum); ++ sum = VIPS_CLIP(0, sum, max_value); + + out[z] = sum; + } + } + + template +-static void inline +-reduceh_signed_int_tab( VipsReduceh *reduceh, ++static void inline reduceh_signed_int_tab(VipsReduceh *reduceh, + VipsPel *pout, const VipsPel *pin, +- const int bands, const int * restrict cx ) ++ const int bands, const int *restrict cx) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + const int n = reduceh->n_point; + +- for( int z = 0; z < bands; z++ ) { ++ for (int z = 0; z < bands; z++) { + int sum; + +- sum = reduce_sum( in + z, bands, cx, n ); +- sum = signed_fixed_round( sum ); +- sum = VIPS_CLIP( min_value, sum, max_value ); ++ sum = reduce_sum(in + z, bands, cx, n); ++ sum = signed_fixed_round(sum); ++ sum = VIPS_CLIP(min_value, sum, max_value); + + out[z] = sum; + } +@@ -215,55 +213,52 @@ reduceh_signed_int_tab( VipsReduceh *reduceh, + /* Floating-point version. + */ + template +-static void inline +-reduceh_float_tab( VipsReduceh *reduceh, ++static void inline reduceh_float_tab(VipsReduceh *reduceh, + VipsPel *pout, const VipsPel *pin, +- const int bands, const double *cx ) ++ const int bands, const double *cx) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + const int n = reduceh->n_point; + +- for( int z = 0; z < bands; z++ ) +- out[z] = reduce_sum( in + z, bands, cx, n ); ++ for (int z = 0; z < bands; z++) ++ out[z] = reduce_sum(in + z, bands, cx, n); + } + + /* 32-bit int output needs a double intermediate. + */ + + template +-static void inline +-reduceh_unsigned_int32_tab( VipsReduceh *reduceh, ++static void inline reduceh_unsigned_int32_tab(VipsReduceh *reduceh, + VipsPel *pout, const VipsPel *pin, +- const int bands, const double * restrict cx ) ++ const int bands, const double *restrict cx) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + const int n = reduceh->n_point; + +- for( int z = 0; z < bands; z++ ) { ++ for (int z = 0; z < bands; z++) { + double sum; + +- sum = reduce_sum( in + z, bands, cx, n ); +- out[z] = VIPS_CLIP( 0, sum, max_value ); ++ sum = reduce_sum(in + z, bands, cx, n); ++ out[z] = VIPS_CLIP(0, sum, max_value); + } + } + + template +-static void inline +-reduceh_signed_int32_tab( VipsReduceh *reduceh, ++static void inline reduceh_signed_int32_tab(VipsReduceh *reduceh, + VipsPel *pout, const VipsPel *pin, +- const int bands, const double * restrict cx ) ++ const int bands, const double *restrict cx) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + const int n = reduceh->n_point; + +- for( int z = 0; z < bands; z++ ) { ++ for (int z = 0; z < bands; z++) { + double sum; + +- sum = reduce_sum( in + z, bands, cx, n ); +- sum = VIPS_CLIP( min_value, sum, max_value ); ++ sum = reduce_sum(in + z, bands, cx, n); ++ sum = VIPS_CLIP(min_value, sum, max_value); + out[z] = sum; + } + } +@@ -271,24 +266,23 @@ reduceh_signed_int32_tab( VipsReduceh *reduceh, + /* Ultra-high-quality version for double images. + */ + template +-static void inline +-reduceh_notab( VipsReduceh *reduceh, ++static void inline reduceh_notab(VipsReduceh *reduceh, + VipsPel *pout, const VipsPel *pin, +- const int bands, double x ) ++ const int bands, double x) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + const int n = reduceh->n_point; + + double cx[MAX_POINT]; + +- vips_reduce_make_mask( cx, reduceh->kernel, reduceh->hshrink, x ); ++ vips_reduce_make_mask(cx, reduceh->kernel, reduceh->hshrink, x); + +- for( int z = 0; z < bands; z++ ) { ++ for (int z = 0; z < bands; z++) { + double sum; +- sum = reduce_sum( in + z, bands, cx, n ); ++ sum = reduce_sum(in + z, bands, cx, n); + +- out[z] = VIPS_ROUND_UINT( sum ); ++ out[z] = VIPS_ROUND_UINT(sum); + } + } + +@@ -297,60 +291,60 @@ reduceh_notab( VipsReduceh *reduceh, + */ + + static int +-vips_reduceh_gen( VipsRegion *out_region, void *seq, +- void *a, void *b, gboolean *stop ) ++vips_reduceh_gen(VipsRegion *out_region, void *seq, ++ void *a, void *b, gboolean *stop) + { + VipsImage *in = (VipsImage *) a; + VipsReduceh *reduceh = (VipsReduceh *) b; +- const int ps = VIPS_IMAGE_SIZEOF_PEL( in ); ++ const int ps = VIPS_IMAGE_SIZEOF_PEL(in); + VipsRegion *ir = (VipsRegion *) seq; + VipsRect *r = &out_region->valid; + + /* Double bands for complex. + */ +- const int bands = in->Bands * +- (vips_band_format_iscomplex( in->BandFmt ) ? 2 : 1); ++ const int bands = in->Bands * ++ (vips_band_format_iscomplex(in->BandFmt) ? 2 : 1); + + VipsRect s; + + #ifdef DEBUG +- printf( "vips_reduceh_gen: generating %d x %d at %d x %d\n", +- r->width, r->height, r->left, r->top ); ++ printf("vips_reduceh_gen: generating %d x %d at %d x %d\n", ++ r->width, r->height, r->left, r->top); + #endif /*DEBUG*/ + + s.left = r->left * reduceh->hshrink - reduceh->hoffset; + s.top = r->top; + s.width = r->width * reduceh->hshrink + reduceh->n_point; + s.height = r->height; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + +- VIPS_GATE_START( "vips_reduceh_gen: work" ); ++ VIPS_GATE_START("vips_reduceh_gen: work"); + +- for( int y = 0; y < r->height; y++ ) { ++ for (int y = 0; y < r->height; y++) { + VipsPel *p0; + VipsPel *q; + + double X; + +- q = VIPS_REGION_ADDR( out_region, r->left, r->top + y ); ++ q = VIPS_REGION_ADDR(out_region, r->left, r->top + y); + +- X = (r->left + 0.5) * reduceh->hshrink - 0.5 - ++ X = (r->left + 0.5) * reduceh->hshrink - 0.5 - + reduceh->hoffset; + +- /* We want p0 to be the start (ie. x == 0) of the input ++ /* We want p0 to be the start (ie. x == 0) of the input + * scanline we are reading from. We can then calculate the p we + * need for each pixel with a single mul and avoid calling ADDR +- * for each pixel. ++ * for each pixel. + * + * We can't get p0 directly with ADDR since it could be outside + * valid, so get the leftmost pixel in valid and subtract a + * bit. + */ +- p0 = VIPS_REGION_ADDR( ir, ir->valid.left, r->top + y ) - ++ p0 = VIPS_REGION_ADDR(ir, ir->valid.left, r->top + y) - + ir->valid.left * ps; + +- for( int x = 0; x < r->width; x++ ) { ++ for (int x = 0; x < r->width; x++) { + const int ix = (int) X; + VipsPel *p = p0 + ix * ps; + const int sx = X * VIPS_TRANSFORM_SCALE * 2; +@@ -359,59 +353,53 @@ vips_reduceh_gen( VipsRegion *out_region, void *seq, + const int *cxi = reduceh->matrixi[tx]; + const double *cxf = reduceh->matrixf[tx]; + +- switch( in->BandFmt ) { ++ switch (in->BandFmt) { + case VIPS_FORMAT_UCHAR: +- reduceh_unsigned_int_tab +- ( ++ reduceh_unsigned_int_tab( + reduceh, +- q, p, bands, cxi ); ++ q, p, bands, cxi); + break; + + case VIPS_FORMAT_CHAR: +- reduceh_signed_int_tab +- ( ++ reduceh_signed_int_tab( + reduceh, +- q, p, bands, cxi ); ++ q, p, bands, cxi); + break; + + case VIPS_FORMAT_USHORT: +- reduceh_unsigned_int_tab +- ( ++ reduceh_unsigned_int_tab( + reduceh, +- q, p, bands, cxi ); ++ q, p, bands, cxi); + break; + + case VIPS_FORMAT_SHORT: +- reduceh_signed_int_tab +- ( ++ reduceh_signed_int_tab( + reduceh, +- q, p, bands, cxi ); ++ q, p, bands, cxi); + break; + + case VIPS_FORMAT_UINT: +- reduceh_unsigned_int32_tab +- ( ++ reduceh_unsigned_int32_tab( + reduceh, +- q, p, bands, cxf ); ++ q, p, bands, cxf); + break; + + case VIPS_FORMAT_INT: +- reduceh_signed_int32_tab +- ( ++ reduceh_signed_int32_tab( + reduceh, +- q, p, bands, cxf ); ++ q, p, bands, cxf); + break; + + case VIPS_FORMAT_FLOAT: + case VIPS_FORMAT_COMPLEX: +- reduceh_float_tab( reduceh, +- q, p, bands, cxf ); ++ reduceh_float_tab(reduceh, ++ q, p, bands, cxf); + break; + + case VIPS_FORMAT_DOUBLE: + case VIPS_FORMAT_DPCOMPLEX: +- reduceh_notab( reduceh, +- q, p, bands, X - ix ); ++ reduceh_notab(reduceh, ++ q, p, bands, X - ix); + break; + + default: +@@ -424,68 +412,67 @@ vips_reduceh_gen( VipsRegion *out_region, void *seq, + } + } + +- VIPS_GATE_STOP( "vips_reduceh_gen: work" ); ++ VIPS_GATE_STOP("vips_reduceh_gen: work"); + +- VIPS_COUNT_PIXELS( out_region, "vips_reduceh_gen" ); ++ VIPS_COUNT_PIXELS(out_region, "vips_reduceh_gen"); + +- return( 0 ); ++ return (0); + } + + static int +-vips_reduceh_build( VipsObject *object ) ++vips_reduceh_build(VipsObject *object) + { +- VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( object ); +- VipsResample *resample = VIPS_RESAMPLE( object ); ++ VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS(object); ++ VipsResample *resample = VIPS_RESAMPLE(object); + VipsReduceh *reduceh = (VipsReduceh *) object; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( object, 3 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(object, 3); + + VipsImage *in; + int width; + int int_hshrink; + double extra_pixels; + +- if( VIPS_OBJECT_CLASS( vips_reduceh_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_reduceh_parent_class)->build(object)) ++ return (-1); + +- in = resample->in; ++ in = resample->in; + +- if( reduceh->hshrink < 1.0 ) { +- vips_error( object_class->nickname, +- "%s", _( "reduce factor should be >= 1.0" ) ); +- return( -1 ); ++ if (reduceh->hshrink < 1.0) { ++ vips_error(object_class->nickname, ++ "%s", _("reduce factor should be >= 1.0")); ++ return (-1); + } + + /* Output size. We need to always round to nearest, so round(), not + * rint(). + */ + width = VIPS_ROUND_UINT( +- (double) in->Xsize / reduceh->hshrink ); ++ (double) in->Xsize / reduceh->hshrink); + + /* How many pixels we are inventing in the input, -ve for + * discarding. + */ + extra_pixels = width * reduceh->hshrink - in->Xsize; + +- if( reduceh->gap > 0.0 && +- reduceh->kernel != VIPS_KERNEL_NEAREST ) { +- if( reduceh->gap < 1.0 ) { +- vips_error( object_class->nickname, +- "%s", _( "reduce gap should be >= 1.0" ) ); +- return( -1 ); ++ if (reduceh->gap > 0.0 && ++ reduceh->kernel != VIPS_KERNEL_NEAREST) { ++ if (reduceh->gap < 1.0) { ++ vips_error(object_class->nickname, ++ "%s", _("reduce gap should be >= 1.0")); ++ return (-1); + } + + /* The int part of our reduce. + */ +- int_hshrink = VIPS_MAX( 1, VIPS_FLOOR( +- (double) in->Xsize / width / reduceh->gap ) ); +- +- if( int_hshrink > 1 ) { +- g_info( "shrinkh by %d", int_hshrink ); +- if( vips_shrinkh( in, &t[0], int_hshrink, +- "ceil", TRUE, +- NULL ) ) +- return( -1 ); ++ int_hshrink = VIPS_MAX(1, VIPS_FLOOR((double) in->Xsize / width / reduceh->gap)); ++ ++ if (int_hshrink > 1) { ++ g_info("shrinkh by %d", int_hshrink); ++ if (vips_shrinkh(in, &t[0], int_hshrink, ++ "ceil", TRUE, ++ NULL)) ++ return (-1); + in = t[0]; + + reduceh->hshrink /= int_hshrink; +@@ -493,161 +480,160 @@ vips_reduceh_build( VipsObject *object ) + } + } + +- if( reduceh->hshrink == 1.0 ) +- return( vips_image_write( in, resample->out ) ); ++ if (reduceh->hshrink == 1.0) ++ return (vips_image_write(in, resample->out)); + +- reduceh->n_point = +- vips_reduce_get_points( reduceh->kernel, reduceh->hshrink ); +- g_info( "reduceh: %d point mask", reduceh->n_point ); +- if( reduceh->n_point > MAX_POINT ) { +- vips_error( object_class->nickname, +- "%s", _( "reduce factor too large" ) ); +- return( -1 ); ++ reduceh->n_point = ++ vips_reduce_get_points(reduceh->kernel, reduceh->hshrink); ++ g_info("reduceh: %d point mask", reduceh->n_point); ++ if (reduceh->n_point > MAX_POINT) { ++ vips_error(object_class->nickname, ++ "%s", _("reduce factor too large")); ++ return (-1); + } + + /* If we are rounding down, we are not using some input + * pixels. We need to move the origin *inside* the input image + * by half that distance so that we discard pixels equally +- * from left and right. ++ * from left and right. + */ + reduceh->hoffset = (1 + extra_pixels) / 2.0 - 1; + + /* Build the tables of pre-computed coefficients. + */ +- for( int x = 0; x < VIPS_TRANSFORM_SCALE + 1; x++ ) { +- reduceh->matrixf[x] = +- VIPS_ARRAY( object, reduceh->n_point, double ); +- reduceh->matrixi[x] = +- VIPS_ARRAY( object, reduceh->n_point, int ); +- if( !reduceh->matrixf[x] || +- !reduceh->matrixi[x] ) +- return( -1 ); +- +- vips_reduce_make_mask( reduceh->matrixf[x], +- reduceh->kernel, reduceh->hshrink, +- (float) x / VIPS_TRANSFORM_SCALE ); +- +- for( int i = 0; i < reduceh->n_point; i++ ) +- reduceh->matrixi[x][i] = reduceh->matrixf[x][i] * ++ for (int x = 0; x < VIPS_TRANSFORM_SCALE + 1; x++) { ++ reduceh->matrixf[x] = ++ VIPS_ARRAY(object, reduceh->n_point, double); ++ reduceh->matrixi[x] = ++ VIPS_ARRAY(object, reduceh->n_point, int); ++ if (!reduceh->matrixf[x] || ++ !reduceh->matrixi[x]) ++ return (-1); ++ ++ vips_reduce_make_mask(reduceh->matrixf[x], ++ reduceh->kernel, reduceh->hshrink, ++ (float) x / VIPS_TRANSFORM_SCALE); ++ ++ for (int i = 0; i < reduceh->n_point; i++) ++ reduceh->matrixi[x][i] = reduceh->matrixf[x][i] * + VIPS_INTERPOLATE_SCALE; + + #ifdef DEBUG +- printf( "vips_reduceh_build: mask %d\n ", x ); +- for( int i = 0; i < reduceh->n_point; i++ ) +- printf( "%d ", reduceh->matrixi[x][i] ); +- printf( "\n" ); ++ printf("vips_reduceh_build: mask %d\n ", x); ++ for (int i = 0; i < reduceh->n_point; i++) ++ printf("%d ", reduceh->matrixi[x][i]); ++ printf("\n"); + #endif /*DEBUG*/ + } + + /* Unpack for processing. + */ +- if( vips_image_decode( in, &t[1] ) ) +- return( -1 ); ++ if (vips_image_decode(in, &t[1])) ++ return (-1); + in = t[1]; + + /* Add new pixels around the input so we can interpolate at the edges. + */ +- if( vips_embed( in, &t[2], +- VIPS_CEIL( reduceh->n_point / 2.0 ) - 1, 0, +- in->Xsize + reduceh->n_point, in->Ysize, +- "extend", VIPS_EXTEND_COPY, +- (void *) NULL ) ) +- return( -1 ); ++ if (vips_embed(in, &t[2], ++ VIPS_CEIL(reduceh->n_point / 2.0) - 1, 0, ++ in->Xsize + reduceh->n_point, in->Ysize, ++ "extend", VIPS_EXTEND_COPY, ++ (void *) NULL)) ++ return (-1); + in = t[2]; + +- if( vips_image_pipelinev( resample->out, +- VIPS_DEMAND_STYLE_THINSTRIP, in, (void *) NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(resample->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, in, (void *) NULL)) ++ return (-1); + + /* Don't change xres/yres, leave that to the application layer. For + * example, vipsthumbnail knows the true reduce factor (including the + * fractional part), we just see the integer part here. + */ + resample->out->Xsize = width; +- if( resample->out->Xsize <= 0 ) { +- vips_error( object_class->nickname, +- "%s", _( "image has shrunk to nothing" ) ); +- return( -1 ); ++ if (resample->out->Xsize <= 0) { ++ vips_error(object_class->nickname, ++ "%s", _("image has shrunk to nothing")); ++ return (-1); + } + + #ifdef DEBUG +- printf( "vips_reduceh_build: reducing %d x %d image to %d x %d\n", +- in->Xsize, in->Ysize, +- resample->out->Xsize, resample->out->Ysize ); ++ printf("vips_reduceh_build: reducing %d x %d image to %d x %d\n", ++ in->Xsize, in->Ysize, ++ resample->out->Xsize, resample->out->Ysize); + #endif /*DEBUG*/ + +- if( vips_image_generate( resample->out, +- vips_start_one, vips_reduceh_gen, vips_stop_one, +- in, reduceh ) ) +- return( -1 ); ++ if (vips_image_generate(resample->out, ++ vips_start_one, vips_reduceh_gen, vips_stop_one, ++ in, reduceh)) ++ return (-1); + +- vips_reorder_margin_hint( resample->out, reduceh->n_point ); ++ vips_reorder_margin_hint(resample->out, reduceh->n_point); + +- return( 0 ); ++ return (0); + } + + static void +-vips_reduceh_class_init( VipsReducehClass *reduceh_class ) ++vips_reduceh_class_init(VipsReducehClass *reduceh_class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( reduceh_class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( reduceh_class ); +- VipsOperationClass *operation_class = +- VIPS_OPERATION_CLASS( reduceh_class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(reduceh_class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(reduceh_class); ++ VipsOperationClass *operation_class = ++ VIPS_OPERATION_CLASS(reduceh_class); + +- VIPS_DEBUG_MSG( "vips_reduceh_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_reduceh_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "reduceh"; +- vobject_class->description = _( "shrink an image horizontally" ); ++ vobject_class->description = _("shrink an image horizontally"); + vobject_class->build = vips_reduceh_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_DOUBLE( reduceh_class, "hshrink", 3, +- _( "Hshrink" ), +- _( "Horizontal shrink factor" ), ++ VIPS_ARG_DOUBLE(reduceh_class, "hshrink", 3, ++ _("Hshrink"), ++ _("Horizontal shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsReduceh, hshrink ), +- 1.0, 1000000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsReduceh, hshrink), ++ 1.0, 1000000.0, 1.0); + +- VIPS_ARG_ENUM( reduceh_class, "kernel", 4, +- _( "Kernel" ), +- _( "Resampling kernel" ), ++ VIPS_ARG_ENUM(reduceh_class, "kernel", 4, ++ _("Kernel"), ++ _("Resampling kernel"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsReduceh, kernel ), +- VIPS_TYPE_KERNEL, VIPS_KERNEL_LANCZOS3 ); ++ G_STRUCT_OFFSET(VipsReduceh, kernel), ++ VIPS_TYPE_KERNEL, VIPS_KERNEL_LANCZOS3); + +- VIPS_ARG_DOUBLE( reduceh_class, "gap", 5, +- _( "Gap" ), +- _( "Reducing gap" ), ++ VIPS_ARG_DOUBLE(reduceh_class, "gap", 5, ++ _("Gap"), ++ _("Reducing gap"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsReduceh, gap ), +- 0.0, 1000000.0, 0.0 ); ++ G_STRUCT_OFFSET(VipsReduceh, gap), ++ 0.0, 1000000.0, 0.0); + + /* Old name. + */ +- VIPS_ARG_DOUBLE( reduceh_class, "xshrink", 3, +- _( "Xshrink" ), +- _( "Horizontal shrink factor" ), ++ VIPS_ARG_DOUBLE(reduceh_class, "xshrink", 3, ++ _("Xshrink"), ++ _("Horizontal shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsReduceh, hshrink ), +- 1.0, 1000000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsReduceh, hshrink), ++ 1.0, 1000000.0, 1.0); + + /* We used to let people pick centre or corner, but it's automatic now. + */ +- VIPS_ARG_BOOL( reduceh_class, "centre", 7, +- _( "Centre" ), +- _( "Use centre sampling convention" ), ++ VIPS_ARG_BOOL(reduceh_class, "centre", 7, ++ _("Centre"), ++ _("Use centre sampling convention"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsReduceh, centre ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsReduceh, centre), ++ FALSE); + } + + static void +-vips_reduceh_init( VipsReduceh *reduceh ) ++vips_reduceh_init(VipsReduceh *reduceh) + { + reduceh->gap = 0.0; + reduceh->kernel = VIPS_KERNEL_LANCZOS3; +@@ -657,14 +643,14 @@ vips_reduceh_init( VipsReduceh *reduceh ) + */ + + int +-vips_reduceh( VipsImage *in, VipsImage **out, double hshrink, ... ) ++vips_reduceh(VipsImage *in, VipsImage **out, double hshrink, ...) + { + va_list ap; + int result; + +- va_start( ap, hshrink ); +- result = vips_call_split( "reduceh", ap, in, out, hshrink ); +- va_end( ap ); ++ va_start(ap, hshrink); ++ result = vips_call_split("reduceh", ap, in, out, hshrink); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/resample/reducev.cpp b/libvips/resample/reducev.cpp +index 4055932860..f4a750e444 100644 +--- a/libvips/resample/reducev.cpp ++++ b/libvips/resample/reducev.cpp +@@ -27,28 +27,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -80,31 +80,31 @@ + */ + #define MAX_PASS (10) + +-/* The number of params we pass for coeffs. Orc limits this rather. ++/* The number of params we pass for coeffs. Orc limits this rather. + */ + #define MAX_PARAM (8) + +-/* A pass with a vector. ++/* A pass with a vector. + */ + typedef struct { +- int first; /* The index of the first mask coff we use */ +- int last; /* The index of the last mask coff we use */ ++ int first; /* The index of the first mask coff we use */ ++ int last; /* The index of the last mask coff we use */ + +- int r; /* Set previous result in this var */ +- int d2; /* Write new temp result here */ ++ int r; /* Set previous result in this var */ ++ int d2; /* Write new temp result here */ + +- int p[MAX_PARAM]; /* Mask coeffs passed in these */ ++ int p[MAX_PARAM]; /* Mask coeffs passed in these */ + int n_param; + +- /* The code we generate for this section of this mask. ++ /* The code we generate for this section of this mask. + */ +- VipsVector *vector; ++ VipsVector *vector; + } Pass; + + typedef struct _VipsReducev { + VipsResample parent_instance; + +- double vshrink; /* Reduce factor */ ++ double vshrink; /* Reduce factor */ + double gap; /* Reduce gap */ + + /* The thing we use to make the kernel. +@@ -132,7 +132,7 @@ typedef struct _VipsReducev { + + /* The passes we generate for this mask. + */ +- int n_pass; ++ int n_pass; + Pass pass[MAX_PASS]; + + /* Deprecated. +@@ -146,160 +146,160 @@ typedef VipsResampleClass VipsReducevClass; + /* We need C linkage for this. + */ + extern "C" { +-G_DEFINE_TYPE( VipsReducev, vips_reducev, VIPS_TYPE_RESAMPLE ); ++G_DEFINE_TYPE(VipsReducev, vips_reducev, VIPS_TYPE_RESAMPLE); + } + + static void +-vips_reducev_finalize( GObject *gobject ) ++vips_reducev_finalize(GObject *gobject) + { +- VipsReducev *reducev = (VipsReducev *) gobject; ++ VipsReducev *reducev = (VipsReducev *) gobject; + +- for( int i = 0; i < reducev->n_pass; i++ ) +- VIPS_FREEF( vips_vector_free, reducev->pass[i].vector ); ++ for (int i = 0; i < reducev->n_pass; i++) ++ VIPS_FREEF(vips_vector_free, reducev->pass[i].vector); + reducev->n_pass = 0; +- for( int i = 0; i < VIPS_TRANSFORM_SCALE + 1; i++ ) { +- VIPS_FREE( reducev->matrixf[i] ); +- VIPS_FREE( reducev->matrixi[i] ); +- VIPS_FREE( reducev->matrixo[i] ); ++ for (int i = 0; i < VIPS_TRANSFORM_SCALE + 1; i++) { ++ VIPS_FREE(reducev->matrixf[i]); ++ VIPS_FREE(reducev->matrixi[i]); ++ VIPS_FREE(reducev->matrixo[i]); + } + +- G_OBJECT_CLASS( vips_reducev_parent_class )->finalize( gobject ); ++ G_OBJECT_CLASS(vips_reducev_parent_class)->finalize(gobject); + } + +-#define TEMP( N, S ) vips_vector_temporary( v, (char *) N, S ) +-#define PARAM( N, S ) vips_vector_parameter( v, (char *) N, S ) +-#define SCANLINE( N, P, S ) vips_vector_source_scanline( v, (char *) N, P, S ) +-#define CONST( N, V, S ) vips_vector_constant( v, (char *) N, V, S ) +-#define ASM2( OP, A, B ) vips_vector_asm2( v, (char *) OP, A, B ) +-#define ASM3( OP, A, B, C ) vips_vector_asm3( v, (char *) OP, A, B, C ) ++#define TEMP(N, S) vips_vector_temporary(v, (char *) N, S) ++#define PARAM(N, S) vips_vector_parameter(v, (char *) N, S) ++#define SCANLINE(N, P, S) vips_vector_source_scanline(v, (char *) N, P, S) ++#define CONST(N, V, S) vips_vector_constant(v, (char *) N, V, S) ++#define ASM2(OP, A, B) vips_vector_asm2(v, (char *) OP, A, B) ++#define ASM3(OP, A, B, C) vips_vector_asm3(v, (char *) OP, A, B, C) + + /* Generate code for a section of the mask. first is the index we start +- * at, we set last to the index of the last one we use before we run ++ * at, we set last to the index of the last one we use before we run + * out of intermediates / constants / parameters / sources or mask + * coefficients. + * + * 0 for success, -1 on error. + */ + static int +-vips_reducev_compile_section( VipsReducev *reducev, Pass *pass, gboolean first ) ++vips_reducev_compile_section(VipsReducev *reducev, Pass *pass, gboolean first) + { + VipsVector *v; + int i; + + #ifdef DEBUG_COMPILE +- printf( "starting pass %d\n", pass->first ); ++ printf("starting pass %d\n", pass->first); + #endif /*DEBUG_COMPILE*/ + +- pass->vector = v = vips_vector_new( "reducev", 1 ); ++ pass->vector = v = vips_vector_new("reducev", 1); + + /* We have two destinations: the final output image (8-bit) and the + * intermediate buffer if this is not the final pass (16-bit). + */ +- pass->d2 = vips_vector_destination( v, "d2", 2 ); ++ pass->d2 = vips_vector_destination(v, "d2", 2); + + /* "r" is the array of sums from the previous pass (if any). + */ +- pass->r = vips_vector_source_name( v, "r", 2 ); ++ pass->r = vips_vector_source_name(v, "r", 2); + + /* The value we fetch from the image, the accumulated sum. + */ +- TEMP( "value", 2 ); +- TEMP( "sum", 2 ); ++ TEMP("value", 2); ++ TEMP("sum", 2); + + /* Init the sum. If this is the first pass, it's a constant. If this +- * is a later pass, we have to init the sum from the result +- * of the previous pass. ++ * is a later pass, we have to init the sum from the result ++ * of the previous pass. + */ +- if( first ) { ++ if (first) { + char c32[256]; + +- CONST( c32, 32, 2 ); +- ASM2( "loadpw", "sum", c32 ); ++ CONST(c32, 32, 2); ++ ASM2("loadpw", "sum", c32); + } +- else +- ASM2( "loadw", "sum", "r" ); ++ else ++ ASM2("loadw", "sum", "r"); + +- for( i = pass->first; i < reducev->n_point; i++ ) { ++ for (i = pass->first; i < reducev->n_point; i++) { + char source[256]; + char coeff[256]; + +- SCANLINE( source, i, 1 ); ++ SCANLINE(source, i, 1); + + /* This mask coefficient. + */ +- vips_snprintf( coeff, 256, "p%d", i ); +- pass->p[pass->n_param] = PARAM( coeff, 2 ); ++ vips_snprintf(coeff, 256, "p%d", i); ++ pass->p[pass->n_param] = PARAM(coeff, 2); + pass->n_param += 1; +- if( pass->n_param >= MAX_PARAM ) +- return( -1 ); ++ if (pass->n_param >= MAX_PARAM) ++ return (-1); + + /* Mask coefficients are 2.6 bits fixed point. We need to hold + * about -0.5 to 1.0, so -2 to +1.999 is as close as we can +- * get. ++ * get. + * + * We need a signed multiply, so the image pixel needs to + * become a signed 16-bit value. We know only the bottom 8 bits + * of the image and coefficient are interesting, so we can take +- * the bottom bits of a 16x16->32 multiply. ++ * the bottom bits of a 16x16->32 multiply. + * + * We accumulate the signed 16-bit result in sum. Saturated + * add. + */ +- ASM2( "convubw", "value", source ); +- ASM3( "mullw", "value", "value", coeff ); +- ASM3( "addssw", "sum", "sum", "value" ); ++ ASM2("convubw", "value", source); ++ ASM3("mullw", "value", "value", coeff); ++ ASM3("addssw", "sum", "sum", "value"); + + /* We've used this coeff. + */ + pass->last = i; + +- if( vips_vector_full( v ) ) ++ if (vips_vector_full(v)) + break; + + /* orc 0.4.24 and earlier hate more than about five lines at +- * once :( ++ * once :( + */ +- if( i - pass->first > 3 ) ++ if (i - pass->first > 3) + break; + } + + /* If this is the end of the mask, we write the 8-bit result to the +- * image, otherwise write the 16-bit intermediate to our temp buffer. ++ * image, otherwise write the 16-bit intermediate to our temp buffer. + */ +- if( pass->last >= reducev->n_point - 1 ) { ++ if (pass->last >= reducev->n_point - 1) { + char c6[256]; + +- CONST( c6, 6, 2 ); +- ASM3( "shrsw", "sum", "sum", c6 ); ++ CONST(c6, 6, 2); ++ ASM3("shrsw", "sum", "sum", c6); + +- ASM2( "convsuswb", "d1", "sum" ); ++ ASM2("convsuswb", "d1", "sum"); + } +- else +- ASM2( "copyw", "d2", "sum" ); ++ else ++ ASM2("copyw", "d2", "sum"); + +- if( !vips_vector_compile( v ) ) +- return( -1 ); ++ if (!vips_vector_compile(v)) ++ return (-1); + + #ifdef DEBUG_COMPILE +- printf( "done coeffs %d to %d\n", pass->first, pass->last ); +- vips_vector_print( v ); ++ printf("done coeffs %d to %d\n", pass->first, pass->last); ++ vips_vector_print(v); + #endif /*DEBUG_COMPILE*/ + +- return( 0 ); ++ return (0); + } + + static int +-vips_reducev_compile( VipsReducev *reducev ) ++vips_reducev_compile(VipsReducev *reducev) + { + Pass *pass; + + /* Generate passes until we've used up the whole mask. + */ +- for( int i = 0;; ) { ++ for (int i = 0;;) { + /* Allocate space for another pass. + */ +- if( reducev->n_pass == MAX_PASS ) +- return( -1 ); ++ if (reducev->n_pass == MAX_PASS) ++ return (-1); + pass = &reducev->pass[reducev->n_pass]; + reducev->n_pass += 1; + +@@ -308,25 +308,25 @@ vips_reducev_compile( VipsReducev *reducev ) + pass->d2 = -1; + pass->n_param = 0; + +- if( vips_reducev_compile_section( reducev, +- pass, reducev->n_pass == 1 ) ) +- return( -1 ); ++ if (vips_reducev_compile_section(reducev, ++ pass, reducev->n_pass == 1)) ++ return (-1); + i = pass->last + 1; + +- if( i >= reducev->n_point ) ++ if (i >= reducev->n_point) + break; + } + +- return( 0 ); ++ return (0); + } + + /* Our sequence value. + */ + typedef struct { + VipsReducev *reducev; +- VipsRegion *ir; /* Input region */ ++ VipsRegion *ir; /* Input region */ + +- /* In vector mode we need a pair of intermediate buffers to keep the ++ /* In vector mode we need a pair of intermediate buffers to keep the + * results of each pass in. + */ + signed short *t1; +@@ -334,28 +334,28 @@ typedef struct { + } Sequence; + + static int +-vips_reducev_stop( void *vseq, void *a, void *b ) ++vips_reducev_stop(void *vseq, void *a, void *b) + { + Sequence *seq = (Sequence *) vseq; + +- VIPS_UNREF( seq->ir ); +- VIPS_FREE( seq->t1 ); +- VIPS_FREE( seq->t2 ); ++ VIPS_UNREF(seq->ir); ++ VIPS_FREE(seq->t1); ++ VIPS_FREE(seq->t2); + +- return( 0 ); ++ return (0); + } + + static void * +-vips_reducev_start( VipsImage *out, void *a, void *b ) ++vips_reducev_start(VipsImage *out, void *a, void *b) + { + VipsImage *in = (VipsImage *) a; + VipsReducev *reducev = (VipsReducev *) b; +- int sz = VIPS_IMAGE_N_ELEMENTS( in ); ++ int sz = VIPS_IMAGE_N_ELEMENTS(in); + + Sequence *seq; + +- if( !(seq = VIPS_NEW( out, Sequence )) ) +- return( NULL ); ++ if (!(seq = VIPS_NEW(out, Sequence))) ++ return (NULL); + + /* Init! + */ +@@ -366,61 +366,59 @@ vips_reducev_start( VipsImage *out, void *a, void *b ) + + /* Attach region and arrays. + */ +- seq->ir = vips_region_new( in ); +- seq->t1 = VIPS_ARRAY( NULL, sz, signed short ); +- seq->t2 = VIPS_ARRAY( NULL, sz, signed short ); +- if( !seq->ir || +- !seq->t1 || +- !seq->t2 ) { +- vips_reducev_stop( seq, NULL, NULL ); +- return( NULL ); ++ seq->ir = vips_region_new(in); ++ seq->t1 = VIPS_ARRAY(NULL, sz, signed short); ++ seq->t2 = VIPS_ARRAY(NULL, sz, signed short); ++ if (!seq->ir || ++ !seq->t1 || ++ !seq->t2) { ++ vips_reducev_stop(seq, NULL, NULL); ++ return (NULL); + } + +- return( seq ); ++ return (seq); + } + + /* You'd think this would vectorise, but gcc hates mixed types in nested loops + * :-( + */ + template +-static void inline +-reducev_unsigned_int_tab( VipsReducev *reducev, ++static void inline reducev_unsigned_int_tab(VipsReducev *reducev, + VipsPel *pout, const VipsPel *pin, +- const int ne, const int lskip, const int * restrict cy ) ++ const int ne, const int lskip, const int *restrict cy) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + const int n = reducev->n_point; +- const int l1 = lskip / sizeof( T ); ++ const int l1 = lskip / sizeof(T); + +- for( int z = 0; z < ne; z++ ) { ++ for (int z = 0; z < ne; z++) { + int sum; + +- sum = reduce_sum( in + z, l1, cy, n ); +- sum = unsigned_fixed_round( sum ); +- sum = VIPS_CLIP( 0, sum, max_value ); ++ sum = reduce_sum(in + z, l1, cy, n); ++ sum = unsigned_fixed_round(sum); ++ sum = VIPS_CLIP(0, sum, max_value); + + out[z] = sum; + } + } + + template +-static void inline +-reducev_signed_int_tab( VipsReducev *reducev, ++static void inline reducev_signed_int_tab(VipsReducev *reducev, + VipsPel *pout, const VipsPel *pin, +- const int ne, const int lskip, const int * restrict cy ) ++ const int ne, const int lskip, const int *restrict cy) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + const int n = reducev->n_point; +- const int l1 = lskip / sizeof( T ); ++ const int l1 = lskip / sizeof(T); + +- for( int z = 0; z < ne; z++ ) { ++ for (int z = 0; z < ne; z++) { + int sum; + +- sum = reduce_sum( in + z, l1, cy, n ); +- sum = signed_fixed_round( sum ); +- sum = VIPS_CLIP( min_value, sum, max_value ); ++ sum = reduce_sum(in + z, l1, cy, n); ++ sum = signed_fixed_round(sum); ++ sum = VIPS_CLIP(min_value, sum, max_value); + + out[z] = sum; + } +@@ -429,89 +427,85 @@ reducev_signed_int_tab( VipsReducev *reducev, + /* Floating-point version. + */ + template +-static void inline +-reducev_float_tab( VipsReducev *reducev, ++static void inline reducev_float_tab(VipsReducev *reducev, + VipsPel *pout, const VipsPel *pin, +- const int ne, const int lskip, const double * restrict cy ) ++ const int ne, const int lskip, const double *restrict cy) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + const int n = reducev->n_point; +- const int l1 = lskip / sizeof( T ); ++ const int l1 = lskip / sizeof(T); + +- for( int z = 0; z < ne; z++ ) +- out[z] = reduce_sum( in + z, l1, cy, n ); ++ for (int z = 0; z < ne; z++) ++ out[z] = reduce_sum(in + z, l1, cy, n); + } + + /* 32-bit int output needs a double intermediate. + */ + + template +-static void inline +-reducev_unsigned_int32_tab( VipsReducev *reducev, ++static void inline reducev_unsigned_int32_tab(VipsReducev *reducev, + VipsPel *pout, const VipsPel *pin, +- const int ne, const int lskip, const double * restrict cy ) ++ const int ne, const int lskip, const double *restrict cy) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + const int n = reducev->n_point; +- const int l1 = lskip / sizeof( T ); ++ const int l1 = lskip / sizeof(T); + +- for( int z = 0; z < ne; z++ ) { ++ for (int z = 0; z < ne; z++) { + double sum; + +- sum = reduce_sum( in + z, l1, cy, n ); +- out[z] = VIPS_CLIP( 0, sum, max_value ); ++ sum = reduce_sum(in + z, l1, cy, n); ++ out[z] = VIPS_CLIP(0, sum, max_value); + } + } + + template +-static void inline +-reducev_signed_int32_tab( VipsReducev *reducev, ++static void inline reducev_signed_int32_tab(VipsReducev *reducev, + VipsPel *pout, const VipsPel *pin, +- const int ne, const int lskip, const double * restrict cy ) ++ const int ne, const int lskip, const double *restrict cy) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + const int n = reducev->n_point; +- const int l1 = lskip / sizeof( T ); ++ const int l1 = lskip / sizeof(T); + +- for( int z = 0; z < ne; z++ ) { ++ for (int z = 0; z < ne; z++) { + double sum; + +- sum = reduce_sum( in + z, l1, cy, n ); +- out[z] = VIPS_CLIP( min_value, sum, max_value ); ++ sum = reduce_sum(in + z, l1, cy, n); ++ out[z] = VIPS_CLIP(min_value, sum, max_value); + } + } + + /* Ultra-high-quality version for double images. + */ + template +-static void inline +-reducev_notab( VipsReducev *reducev, ++static void inline reducev_notab(VipsReducev *reducev, + VipsPel *pout, const VipsPel *pin, +- const int ne, const int lskip, double y ) ++ const int ne, const int lskip, double y) + { +- T* restrict out = (T *) pout; +- const T* restrict in = (T *) pin; ++ T *restrict out = (T *) pout; ++ const T *restrict in = (T *) pin; + const int n = reducev->n_point; +- const int l1 = lskip / sizeof( T ); ++ const int l1 = lskip / sizeof(T); + + double cy[MAX_POINT]; + +- vips_reduce_make_mask( cy, reducev->kernel, reducev->vshrink, y ); ++ vips_reduce_make_mask(cy, reducev->kernel, reducev->vshrink, y); + +- for( int z = 0; z < ne; z++ ) { ++ for (int z = 0; z < ne; z++) { + double sum; +- sum = reduce_sum( in + z, l1, cy, n ); ++ sum = reduce_sum(in + z, l1, cy, n); + +- out[z] = VIPS_ROUND_UINT( sum ); ++ out[z] = VIPS_ROUND_UINT(sum); + } + } + + static int +-vips_reducev_gen( VipsRegion *out_region, void *vseq, +- void *a, void *b, gboolean *stop ) ++vips_reducev_gen(VipsRegion *out_region, void *vseq, ++ void *a, void *b, gboolean *stop) + { + VipsImage *in = (VipsImage *) a; + VipsReducev *reducev = (VipsReducev *) b; +@@ -521,94 +515,88 @@ vips_reducev_gen( VipsRegion *out_region, void *vseq, + + /* Double bands for complex. + */ +- const int bands = in->Bands * +- (vips_band_format_iscomplex( in->BandFmt ) ? 2 : 1); ++ const int bands = in->Bands * ++ (vips_band_format_iscomplex(in->BandFmt) ? 2 : 1); + int ne = r->width * bands; + + VipsRect s; + + #ifdef DEBUG +- printf( "vips_reducev_gen: generating %d x %d at %d x %d\n", +- r->width, r->height, r->left, r->top ); ++ printf("vips_reducev_gen: generating %d x %d at %d x %d\n", ++ r->width, r->height, r->left, r->top); + #endif /*DEBUG*/ + + s.left = r->left; + s.top = r->top * reducev->vshrink - reducev->voffset; + s.width = r->width; + s.height = r->height * reducev->vshrink + reducev->n_point; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + +- VIPS_GATE_START( "vips_reducev_gen: work" ); ++ VIPS_GATE_START("vips_reducev_gen: work"); + +- double Y = (r->top + 0.5) * reducev->vshrink - 0.5 - ++ double Y = (r->top + 0.5) * reducev->vshrink - 0.5 - + reducev->voffset; + +- for( int y = 0; y < r->height; y++ ) { +- VipsPel *q = +- VIPS_REGION_ADDR( out_region, r->left, r->top + y ); ++ for (int y = 0; y < r->height; y++) { ++ VipsPel *q = ++ VIPS_REGION_ADDR(out_region, r->left, r->top + y); + const int py = (int) Y; +- VipsPel *p = VIPS_REGION_ADDR( ir, r->left, py ); ++ VipsPel *p = VIPS_REGION_ADDR(ir, r->left, py); + const int sy = Y * VIPS_TRANSFORM_SCALE * 2; + const int siy = sy & (VIPS_TRANSFORM_SCALE * 2 - 1); + const int ty = (siy + 1) >> 1; + const int *cyi = reducev->matrixi[ty]; + const double *cyf = reducev->matrixf[ty]; +- const int lskip = VIPS_REGION_LSKIP( ir ); ++ const int lskip = VIPS_REGION_LSKIP(ir); + +- switch( in->BandFmt ) { ++ switch (in->BandFmt) { + case VIPS_FORMAT_UCHAR: +- reducev_unsigned_int_tab +- ( ++ reducev_unsigned_int_tab( + reducev, +- q, p, ne, lskip, cyi ); ++ q, p, ne, lskip, cyi); + break; + + case VIPS_FORMAT_CHAR: +- reducev_signed_int_tab +- ( ++ reducev_signed_int_tab( + reducev, +- q, p, ne, lskip, cyi ); ++ q, p, ne, lskip, cyi); + break; + + case VIPS_FORMAT_USHORT: +- reducev_unsigned_int_tab +- ( ++ reducev_unsigned_int_tab( + reducev, +- q, p, ne, lskip, cyi ); ++ q, p, ne, lskip, cyi); + break; + + case VIPS_FORMAT_SHORT: +- reducev_signed_int_tab +- ( ++ reducev_signed_int_tab( + reducev, +- q, p, ne, lskip, cyi ); ++ q, p, ne, lskip, cyi); + break; + + case VIPS_FORMAT_UINT: +- reducev_unsigned_int32_tab +- ( ++ reducev_unsigned_int32_tab( + reducev, +- q, p, ne, lskip, cyf ); ++ q, p, ne, lskip, cyf); + break; + + case VIPS_FORMAT_INT: +- reducev_signed_int32_tab +- ( ++ reducev_signed_int32_tab( + reducev, +- q, p, ne, lskip, cyf ); ++ q, p, ne, lskip, cyf); + break; + + case VIPS_FORMAT_FLOAT: + case VIPS_FORMAT_COMPLEX: +- reducev_float_tab( reducev, +- q, p, ne, lskip, cyf ); ++ reducev_float_tab(reducev, ++ q, p, ne, lskip, cyf); + break; + + case VIPS_FORMAT_DPCOMPLEX: + case VIPS_FORMAT_DOUBLE: +- reducev_notab( reducev, +- q, p, ne, lskip, Y - py ); ++ reducev_notab(reducev, ++ q, p, ne, lskip, Y - py); + break; + + default: +@@ -619,18 +607,18 @@ vips_reducev_gen( VipsRegion *out_region, void *vseq, + Y += reducev->vshrink; + } + +- VIPS_GATE_STOP( "vips_reducev_gen: work" ); ++ VIPS_GATE_STOP("vips_reducev_gen: work"); + +- VIPS_COUNT_PIXELS( out_region, "vips_reducev_gen" ); ++ VIPS_COUNT_PIXELS(out_region, "vips_reducev_gen"); + +- return( 0 ); ++ return (0); + } + + /* Process uchar images with a vector path. + */ + static int +-vips_reducev_vector_gen( VipsRegion *out_region, void *vseq, +- void *a, void *b, gboolean *stop ) ++vips_reducev_vector_gen(VipsRegion *out_region, void *vseq, ++ void *a, void *b, gboolean *stop) + { + VipsImage *in = (VipsImage *) a; + VipsReducev *reducev = (VipsReducev *) b; +@@ -643,34 +631,34 @@ vips_reducev_vector_gen( VipsRegion *out_region, void *vseq, + VipsRect s; + + #ifdef DEBUG_PIXELS +- printf( "vips_reducev_vector_gen: generating %d x %d at %d x %d\n", +- r->width, r->height, r->left, r->top ); ++ printf("vips_reducev_vector_gen: generating %d x %d at %d x %d\n", ++ r->width, r->height, r->left, r->top); + #endif /*DEBUG_PIXELS*/ + + s.left = r->left; + s.top = r->top * reducev->vshrink - reducev->voffset; + s.width = r->width; + s.height = r->height * reducev->vshrink + reducev->n_point; +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + + #ifdef DEBUG_PIXELS +- printf( "vips_reducev_vector_gen: preparing %d x %d at %d x %d\n", +- s.width, s.height, s.left, s.top ); ++ printf("vips_reducev_vector_gen: preparing %d x %d at %d x %d\n", ++ s.width, s.height, s.left, s.top); + #endif /*DEBUG_PIXELS*/ + +- for( int i = 0; i < reducev->n_pass; i++ ) +- vips_executor_set_program( &executor[i], +- reducev->pass[i].vector, ne ); ++ for (int i = 0; i < reducev->n_pass; i++) ++ vips_executor_set_program(&executor[i], ++ reducev->pass[i].vector, ne); + +- VIPS_GATE_START( "vips_reducev_vector_gen: work" ); ++ VIPS_GATE_START("vips_reducev_vector_gen: work"); + +- double Y = (r->top + 0.5) * reducev->vshrink - 0.5 - ++ double Y = (r->top + 0.5) * reducev->vshrink - 0.5 - + reducev->voffset; + +- for( int y = 0; y < r->height; y++ ) { +- VipsPel *q = +- VIPS_REGION_ADDR( out_region, r->left, r->top + y ); ++ for (int y = 0; y < r->height; y++) { ++ VipsPel *q = ++ VIPS_REGION_ADDR(out_region, r->left, r->top + y); + const int py = (int) Y; + const int sy = Y * VIPS_TRANSFORM_SCALE * 2; + const int siy = sy & (VIPS_TRANSFORM_SCALE * 2 - 1); +@@ -678,170 +666,169 @@ vips_reducev_vector_gen( VipsRegion *out_region, void *vseq, + const int *cyo = reducev->matrixo[ty]; + + #ifdef DEBUG_PIXELS +- printf( "starting row %d\n", y + r->top ); +- printf( "coefficients:\n" ); +- for( int i = 0; i < reducev->n_point; i++ ) +- printf( "\t%d - %d\n", i, cyo[i] ); +- printf( "first column of pixel values:\n" ); +- for( int i = 0; i < reducev->n_point; i++ ) +- printf( "\t%d - %d\n", i, +- *VIPS_REGION_ADDR( ir, r->left, py ) ); ++ printf("starting row %d\n", y + r->top); ++ printf("coefficients:\n"); ++ for (int i = 0; i < reducev->n_point; i++) ++ printf("\t%d - %d\n", i, cyo[i]); ++ printf("first column of pixel values:\n"); ++ for (int i = 0; i < reducev->n_point; i++) ++ printf("\t%d - %d\n", i, ++ *VIPS_REGION_ADDR(ir, r->left, py)); + #endif /*DEBUG_PIXELS*/ + + /* We run our n passes to generate this scanline. + */ +- for( int i = 0; i < reducev->n_pass; i++ ) { +- Pass *pass = &reducev->pass[i]; +- +- vips_executor_set_scanline( &executor[i], +- ir, r->left, py ); +- vips_executor_set_array( &executor[i], +- pass->r, seq->t1 ); +- vips_executor_set_array( &executor[i], +- pass->d2, seq->t2 ); +- for( int j = 0; j < pass->n_param; j++ ) +- vips_executor_set_parameter( &executor[i], +- pass->p[j], cyo[j + pass->first] ); +- vips_executor_set_destination( &executor[i], q ); +- vips_executor_run( &executor[i] ); +- +- VIPS_SWAP( signed short *, seq->t1, seq->t2 ); ++ for (int i = 0; i < reducev->n_pass; i++) { ++ Pass *pass = &reducev->pass[i]; ++ ++ vips_executor_set_scanline(&executor[i], ++ ir, r->left, py); ++ vips_executor_set_array(&executor[i], ++ pass->r, seq->t1); ++ vips_executor_set_array(&executor[i], ++ pass->d2, seq->t2); ++ for (int j = 0; j < pass->n_param; j++) ++ vips_executor_set_parameter(&executor[i], ++ pass->p[j], cyo[j + pass->first]); ++ vips_executor_set_destination(&executor[i], q); ++ vips_executor_run(&executor[i]); ++ ++ VIPS_SWAP(signed short *, seq->t1, seq->t2); + } + + #ifdef DEBUG_PIXELS +- printf( "pixel result:\n" ); +- printf( "\t%d\n", *q ); ++ printf("pixel result:\n"); ++ printf("\t%d\n", *q); + #endif /*DEBUG_PIXELS*/ + + Y += reducev->vshrink; + } + +- VIPS_GATE_STOP( "vips_reducev_vector_gen: work" ); ++ VIPS_GATE_STOP("vips_reducev_vector_gen: work"); + +- VIPS_COUNT_PIXELS( out_region, "vips_reducev_vector_gen" ); ++ VIPS_COUNT_PIXELS(out_region, "vips_reducev_vector_gen"); + +- return( 0 ); ++ return (0); + } + + static int +-vips_reducev_raw( VipsReducev *reducev, VipsImage *in, int height, +- VipsImage **out ) ++vips_reducev_raw(VipsReducev *reducev, VipsImage *in, int height, ++ VipsImage **out) + { +- VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( reducev ); ++ VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS(reducev); + + VipsGenerateFn generate; + + /* We need an 2.6 version if we will use the vector path. + */ +- if( in->BandFmt == VIPS_FORMAT_UCHAR && +- vips_vector_isenabled() ) +- for( int y = 0; y < VIPS_TRANSFORM_SCALE + 1; y++ ) { +- reducev->matrixo[y] = +- VIPS_ARRAY( NULL, reducev->n_point, int ); +- if( !reducev->matrixo[y] ) +- return( -1 ); +- +- vips_vector_to_fixed_point( +- reducev->matrixf[y], reducev->matrixo[y], +- reducev->n_point, 64 ); ++ if (in->BandFmt == VIPS_FORMAT_UCHAR && ++ vips_vector_isenabled()) ++ for (int y = 0; y < VIPS_TRANSFORM_SCALE + 1; y++) { ++ reducev->matrixo[y] = ++ VIPS_ARRAY(NULL, reducev->n_point, int); ++ if (!reducev->matrixo[y]) ++ return (-1); ++ ++ vips_vector_to_fixed_point( ++ reducev->matrixf[y], reducev->matrixo[y], ++ reducev->n_point, 64); + } + + /* Try to build a vector version, if we can. + */ + generate = vips_reducev_gen; +- if( in->BandFmt == VIPS_FORMAT_UCHAR && ++ if (in->BandFmt == VIPS_FORMAT_UCHAR && + vips_vector_isenabled() && +- !vips_reducev_compile( reducev ) ) { +- g_info( "reducev: using vector path" ); ++ !vips_reducev_compile(reducev)) { ++ g_info("reducev: using vector path"); + generate = vips_reducev_vector_gen; + } + + *out = vips_image_new(); +- if( vips_image_pipelinev( *out, +- VIPS_DEMAND_STYLE_THINSTRIP, in, (void *) NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(*out, ++ VIPS_DEMAND_STYLE_THINSTRIP, in, (void *) NULL)) ++ return (-1); + + /* Don't change xres/yres, leave that to the application layer. For + * example, vipsthumbnail knows the true reduce factor (including the + * fractional part), we just see the integer part here. + */ + (*out)->Ysize = height; +- if( (*out)->Ysize <= 0 ) { +- vips_error( object_class->nickname, +- "%s", _( "image has shrunk to nothing" ) ); +- return( -1 ); ++ if ((*out)->Ysize <= 0) { ++ vips_error(object_class->nickname, ++ "%s", _("image has shrunk to nothing")); ++ return (-1); + } + + #ifdef DEBUG +- printf( "vips_reducev_build: reducing %d x %d image to %d x %d\n", +- in->Xsize, in->Ysize, +- (*out)->Xsize, (*out)->Ysize ); ++ printf("vips_reducev_build: reducing %d x %d image to %d x %d\n", ++ in->Xsize, in->Ysize, ++ (*out)->Xsize, (*out)->Ysize); + #endif /*DEBUG*/ + +- if( vips_image_generate( *out, +- vips_reducev_start, generate, vips_reducev_stop, +- in, reducev ) ) +- return( -1 ); ++ if (vips_image_generate(*out, ++ vips_reducev_start, generate, vips_reducev_stop, ++ in, reducev)) ++ return (-1); + +- vips_reorder_margin_hint( *out, reducev->n_point ); ++ vips_reorder_margin_hint(*out, reducev->n_point); + +- return( 0 ); ++ return (0); + } + + static int +-vips_reducev_build( VipsObject *object ) ++vips_reducev_build(VipsObject *object) + { +- VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( object ); +- VipsResample *resample = VIPS_RESAMPLE( object ); ++ VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS(object); ++ VipsResample *resample = VIPS_RESAMPLE(object); + VipsReducev *reducev = (VipsReducev *) object; +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 5 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 5); + + VipsImage *in; + int height; + int int_vshrink; + double extra_pixels; + +- if( VIPS_OBJECT_CLASS( vips_reducev_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_reducev_parent_class)->build(object)) ++ return (-1); + +- in = resample->in; ++ in = resample->in; + +- if( reducev->vshrink < 1.0 ) { +- vips_error( object_class->nickname, +- "%s", _( "reduce factor should be >= 1.0" ) ); +- return( -1 ); ++ if (reducev->vshrink < 1.0) { ++ vips_error(object_class->nickname, ++ "%s", _("reduce factor should be >= 1.0")); ++ return (-1); + } + + /* Output size. We need to always round to nearest, so round(), not + * rint(). + */ +- height = VIPS_ROUND_UINT( +- (double) in->Ysize / reducev->vshrink ); ++ height = VIPS_ROUND_UINT( ++ (double) in->Ysize / reducev->vshrink); + + /* How many pixels we are inventing in the input, -ve for + * discarding. + */ + extra_pixels = height * reducev->vshrink - in->Ysize; + +- if( reducev->gap > 0.0 && +- reducev->kernel != VIPS_KERNEL_NEAREST ) { +- if( reducev->gap < 1.0 ) { +- vips_error( object_class->nickname, +- "%s", _( "reduce gap should be >= 1.0" ) ); +- return( -1 ); ++ if (reducev->gap > 0.0 && ++ reducev->kernel != VIPS_KERNEL_NEAREST) { ++ if (reducev->gap < 1.0) { ++ vips_error(object_class->nickname, ++ "%s", _("reduce gap should be >= 1.0")); ++ return (-1); + } + + /* The int part of our reduce. + */ +- int_vshrink = VIPS_MAX( 1, VIPS_FLOOR( +- (double) in->Ysize / height / reducev->gap ) ); +- +- if( int_vshrink > 1 ) { +- g_info( "shrinkv by %d", int_vshrink ); +- if( vips_shrinkv( in, &t[0], int_vshrink, +- "ceil", TRUE, +- NULL ) ) +- return( -1 ); ++ int_vshrink = VIPS_MAX(1, VIPS_FLOOR((double) in->Ysize / height / reducev->gap)); ++ ++ if (int_vshrink > 1) { ++ g_info("shrinkv by %d", int_vshrink); ++ if (vips_shrinkv(in, &t[0], int_vshrink, ++ "ceil", TRUE, ++ NULL)) ++ return (-1); + in = t[0]; + + reducev->vshrink /= int_vshrink; +@@ -849,70 +836,70 @@ vips_reducev_build( VipsObject *object ) + } + } + +- if( reducev->vshrink == 1.0 ) +- return( vips_image_write( in, resample->out ) ); ++ if (reducev->vshrink == 1.0) ++ return (vips_image_write(in, resample->out)); + +- reducev->n_point = +- vips_reduce_get_points( reducev->kernel, reducev->vshrink ); +- g_info( "reducev: %d point mask", reducev->n_point ); +- if( reducev->n_point > MAX_POINT ) { +- vips_error( object_class->nickname, +- "%s", _( "reduce factor too large" ) ); +- return( -1 ); ++ reducev->n_point = ++ vips_reduce_get_points(reducev->kernel, reducev->vshrink); ++ g_info("reducev: %d point mask", reducev->n_point); ++ if (reducev->n_point > MAX_POINT) { ++ vips_error(object_class->nickname, ++ "%s", _("reduce factor too large")); ++ return (-1); + } + + /* If we are rounding down, we are not using some input + * pixels. We need to move the origin *inside* the input image + * by half that distance so that we discard pixels equally +- * from left and right. ++ * from left and right. + */ + reducev->voffset = (1 + extra_pixels) / 2.0 - 1; + + /* Build the tables of pre-computed coefficients. + */ +- for( int y = 0; y < VIPS_TRANSFORM_SCALE + 1; y++ ) { +- reducev->matrixf[y] = +- VIPS_ARRAY( NULL, reducev->n_point, double ); +- reducev->matrixi[y] = +- VIPS_ARRAY( NULL, reducev->n_point, int ); +- if( !reducev->matrixf[y] || +- !reducev->matrixi[y] ) +- return( -1 ); +- +- vips_reduce_make_mask( reducev->matrixf[y], +- reducev->kernel, reducev->vshrink, +- (float) y / VIPS_TRANSFORM_SCALE ); +- +- for( int i = 0; i < reducev->n_point; i++ ) ++ for (int y = 0; y < VIPS_TRANSFORM_SCALE + 1; y++) { ++ reducev->matrixf[y] = ++ VIPS_ARRAY(NULL, reducev->n_point, double); ++ reducev->matrixi[y] = ++ VIPS_ARRAY(NULL, reducev->n_point, int); ++ if (!reducev->matrixf[y] || ++ !reducev->matrixi[y]) ++ return (-1); ++ ++ vips_reduce_make_mask(reducev->matrixf[y], ++ reducev->kernel, reducev->vshrink, ++ (float) y / VIPS_TRANSFORM_SCALE); ++ ++ for (int i = 0; i < reducev->n_point; i++) + reducev->matrixi[y][i] = reducev->matrixf[y][i] * + VIPS_INTERPOLATE_SCALE; + + #ifdef DEBUG +- printf( "vips_reducev_build: mask %d\n ", y ); +- for( int i = 0; i < reducev->n_point; i++ ) +- printf( "%d ", reducev->matrixi[y][i] ); +- printf( "\n" ); ++ printf("vips_reducev_build: mask %d\n ", y); ++ for (int i = 0; i < reducev->n_point; i++) ++ printf("%d ", reducev->matrixi[y][i]); ++ printf("\n"); + #endif /*DEBUG*/ + } + + /* Unpack for processing. + */ +- if( vips_image_decode( in, &t[1] ) ) +- return( -1 ); ++ if (vips_image_decode(in, &t[1])) ++ return (-1); + in = t[1]; + + /* Add new pixels around the input so we can interpolate at the edges. + */ +- if( vips_embed( in, &t[2], +- 0, VIPS_CEIL( reducev->n_point / 2.0 ) - 1, +- in->Xsize, in->Ysize + reducev->n_point, +- "extend", VIPS_EXTEND_COPY, +- (void *) NULL ) ) +- return( -1 ); ++ if (vips_embed(in, &t[2], ++ 0, VIPS_CEIL(reducev->n_point / 2.0) - 1, ++ in->Xsize, in->Ysize + reducev->n_point, ++ "extend", VIPS_EXTEND_COPY, ++ (void *) NULL)) ++ return (-1); + in = t[2]; + +- if( vips_reducev_raw( reducev, in, height, &t[3] ) ) +- return( -1 ); ++ if (vips_reducev_raw(reducev, in, height, &t[3])) ++ return (-1); + in = t[3]; + + /* Large reducev will throw off sequential mode. Suppose thread1 is +@@ -923,88 +910,87 @@ vips_reducev_build( VipsObject *object ) + * + * To fix this, put another seq on the output of reducev. Now we'll + * always have the previous XX lines of the shrunk image, and we won't +- * fetch out of order. ++ * fetch out of order. + */ +- if( vips_image_get_typeof( in, VIPS_META_SEQUENTIAL ) ) { +- g_info( "reducev sequential line cache" ); +- +- if( vips_sequential( in, &t[4], +- "tile_height", 10, +- // "trace", TRUE, +- (void *) NULL ) ) +- return( -1 ); ++ if (vips_image_get_typeof(in, VIPS_META_SEQUENTIAL)) { ++ g_info("reducev sequential line cache"); ++ ++ if (vips_sequential(in, &t[4], ++ "tile_height", 10, ++ // "trace", TRUE, ++ (void *) NULL)) ++ return (-1); + in = t[4]; + } + +- if( vips_image_write( in, resample->out ) ) +- return( -1 ); ++ if (vips_image_write(in, resample->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_reducev_class_init( VipsReducevClass *reducev_class ) ++vips_reducev_class_init(VipsReducevClass *reducev_class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( reducev_class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( reducev_class ); +- VipsOperationClass *operation_class = +- VIPS_OPERATION_CLASS( reducev_class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(reducev_class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(reducev_class); ++ VipsOperationClass *operation_class = ++ VIPS_OPERATION_CLASS(reducev_class); + +- VIPS_DEBUG_MSG( "vips_reducev_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_reducev_class_init\n"); + + gobject_class->finalize = vips_reducev_finalize; + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "reducev"; +- vobject_class->description = _( "shrink an image vertically" ); ++ vobject_class->description = _("shrink an image vertically"); + vobject_class->build = vips_reducev_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_DOUBLE( reducev_class, "vshrink", 3, +- _( "Vshrink" ), +- _( "Vertical shrink factor" ), ++ VIPS_ARG_DOUBLE(reducev_class, "vshrink", 3, ++ _("Vshrink"), ++ _("Vertical shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsReducev, vshrink ), +- 1.0, 1000000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsReducev, vshrink), ++ 1.0, 1000000.0, 1.0); + +- VIPS_ARG_ENUM( reducev_class, "kernel", 4, +- _( "Kernel" ), +- _( "Resampling kernel" ), ++ VIPS_ARG_ENUM(reducev_class, "kernel", 4, ++ _("Kernel"), ++ _("Resampling kernel"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsReducev, kernel ), +- VIPS_TYPE_KERNEL, VIPS_KERNEL_LANCZOS3 ); ++ G_STRUCT_OFFSET(VipsReducev, kernel), ++ VIPS_TYPE_KERNEL, VIPS_KERNEL_LANCZOS3); + +- VIPS_ARG_DOUBLE( reducev_class, "gap", 5, +- _( "Gap" ), +- _( "Reducing gap" ), ++ VIPS_ARG_DOUBLE(reducev_class, "gap", 5, ++ _("Gap"), ++ _("Reducing gap"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsReducev, gap ), +- 0.0, 1000000.0, 0.0 ); ++ G_STRUCT_OFFSET(VipsReducev, gap), ++ 0.0, 1000000.0, 0.0); + + /* Old name. + */ +- VIPS_ARG_DOUBLE( reducev_class, "yshrink", 3, +- _( "Yshrink" ), +- _( "Vertical shrink factor" ), ++ VIPS_ARG_DOUBLE(reducev_class, "yshrink", 3, ++ _("Yshrink"), ++ _("Vertical shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsReducev, vshrink ), +- 1.0, 1000000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsReducev, vshrink), ++ 1.0, 1000000.0, 1.0); + + /* We used to let people pick centre or corner, but it's automatic now. + */ +- VIPS_ARG_BOOL( reducev_class, "centre", 7, +- _( "Centre" ), +- _( "Use centre sampling convention" ), ++ VIPS_ARG_BOOL(reducev_class, "centre", 7, ++ _("Centre"), ++ _("Use centre sampling convention"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsReducev, centre ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsReducev, centre), ++ FALSE); + } + + static void +-vips_reducev_init( VipsReducev *reducev ) ++vips_reducev_init(VipsReducev *reducev) + { + reducev->gap = 0.0; + reducev->kernel = VIPS_KERNEL_LANCZOS3; +@@ -1014,14 +1000,14 @@ vips_reducev_init( VipsReducev *reducev ) + */ + + int +-vips_reducev( VipsImage *in, VipsImage **out, double vshrink, ... ) ++vips_reducev(VipsImage *in, VipsImage **out, double vshrink, ...) + { + va_list ap; + int result; + +- va_start( ap, vshrink ); +- result = vips_call_split( "reducev", ap, in, out, vshrink ); +- va_end( ap ); ++ va_start(ap, vshrink); ++ result = vips_call_split("reducev", ap, in, out, vshrink); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/resample/resample.c b/libvips/resample/resample.c +index 4b2c1d5f9f..f19d9e779a 100644 +--- a/libvips/resample/resample.c ++++ b/libvips/resample/resample.c +@@ -9,28 +9,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -61,7 +61,7 @@ + * These operations build on each other in a set of layers. + * + * First, vips_affine() applies an affine transform to an image. This is any +- * sort of 2D transform which preserves straight lines; so any combination of ++ * sort of 2D transform which preserves straight lines; so any combination of + * stretch, sheer, rotate and translate. You supply an interpolator for it to + * use to generate pixels, see vips_interpolate_new(). It will not produce + * good results for very large shrinks: you'll see aliasing. +@@ -72,9 +72,9 @@ + * + * vips_shrink() is a fast block shrinker. It can quickly reduce images by + * large integer factors. It will give poor results for small size reductions: +- * again, you'll see aliasing. ++ * again, you'll see aliasing. + * +- * Next, vips_resize() specialises in the common task of image reduce and ++ * Next, vips_resize() specialises in the common task of image reduce and + * enlarge. It strings together combinations of vips_shrink(), vips_reduce(), + * vips_affine() and others to implement a general, high-quality image + * resizer. +@@ -82,14 +82,14 @@ + * Finally, vips_thumbnail() combines load and resize in one operation, and adds + * colour management and correct handling of alpha transparency. Because load + * and resize happen together, it can exploit tricks like JPEG and TIFF +- * shrink-on-load, giving a (potentially) huge speedup. vips_thumbnail_image() ++ * shrink-on-load, giving a (potentially) huge speedup. vips_thumbnail_image() + * is only there for emergencies, don't use it unless you really have to. + * +- * As a separate thing, `vips_mapim() can apply arbitrary 2D image transforms ++ * As a separate thing, `vips_mapim() can apply arbitrary 2D image transforms + * to an image. + */ + +-/** ++/** + * VipsSize: + * @VIPS_SIZE_BOTH: size both up and down + * @VIPS_SIZE_UP: only upsize +@@ -102,56 +102,55 @@ + * See also: vips_thumbnail(). + */ + +-G_DEFINE_ABSTRACT_TYPE( VipsResample, vips_resample, VIPS_TYPE_OPERATION ); ++G_DEFINE_ABSTRACT_TYPE(VipsResample, vips_resample, VIPS_TYPE_OPERATION); + + static int +-vips_resample_build( VipsObject *object ) ++vips_resample_build(VipsObject *object) + { +- VipsResample *resample = VIPS_RESAMPLE( object ); ++ VipsResample *resample = VIPS_RESAMPLE(object); + + #ifdef DEBUG +- printf( "vips_resample_build: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_resample_build: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- g_object_set( resample, "out", vips_image_new(), NULL ); ++ g_object_set(resample, "out", vips_image_new(), NULL); + +- if( VIPS_OBJECT_CLASS( vips_resample_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_resample_parent_class)->build(object)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_resample_class_init( VipsResampleClass *class ) ++vips_resample_class_init(VipsResampleClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "resample"; +- vobject_class->description = _( "resample operations" ); ++ vobject_class->description = _("resample operations"); + vobject_class->build = vips_resample_build; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image argument" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image argument"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsResample, in ) ); +- +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsResample, out ) ); ++ G_STRUCT_OFFSET(VipsResample, in)); + ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsResample, out)); + } + + static void +-vips_resample_init( VipsResample *resample ) ++vips_resample_init(VipsResample *resample) + { + } + +@@ -159,40 +158,39 @@ vips_resample_init( VipsResample *resample ) + * instead? + */ + void +-vips_resample_operation_init( void ) ++vips_resample_operation_init(void) + { +- extern GType vips_thumbnail_file_get_type( void ); +- extern GType vips_thumbnail_buffer_get_type( void ); +- extern GType vips_thumbnail_image_get_type( void ); +- extern GType vips_thumbnail_source_get_type( void ); +- extern GType vips_mapim_get_type( void ); +- extern GType vips_shrink_get_type( void ); +- extern GType vips_shrinkh_get_type( void ); +- extern GType vips_shrinkv_get_type( void ); +- extern GType vips_reduce_get_type( void ); +- extern GType vips_reduceh_get_type( void ); +- extern GType vips_reducev_get_type( void ); +- extern GType vips_quadratic_get_type( void ); +- extern GType vips_affine_get_type( void ); +- extern GType vips_similarity_get_type( void ); +- extern GType vips_rotate_get_type( void ); +- extern GType vips_resize_get_type( void ); +- +- vips_thumbnail_file_get_type(); +- vips_thumbnail_buffer_get_type(); +- vips_thumbnail_image_get_type(); +- vips_thumbnail_source_get_type(); +- vips_mapim_get_type(); +- vips_shrink_get_type(); +- vips_shrinkh_get_type(); +- vips_shrinkv_get_type(); +- vips_reduceh_get_type(); +- vips_reducev_get_type(); +- vips_reduce_get_type(); +- vips_quadratic_get_type(); +- vips_affine_get_type(); +- vips_similarity_get_type(); +- vips_rotate_get_type(); +- vips_resize_get_type(); ++ extern GType vips_thumbnail_file_get_type(void); ++ extern GType vips_thumbnail_buffer_get_type(void); ++ extern GType vips_thumbnail_image_get_type(void); ++ extern GType vips_thumbnail_source_get_type(void); ++ extern GType vips_mapim_get_type(void); ++ extern GType vips_shrink_get_type(void); ++ extern GType vips_shrinkh_get_type(void); ++ extern GType vips_shrinkv_get_type(void); ++ extern GType vips_reduce_get_type(void); ++ extern GType vips_reduceh_get_type(void); ++ extern GType vips_reducev_get_type(void); ++ extern GType vips_quadratic_get_type(void); ++ extern GType vips_affine_get_type(void); ++ extern GType vips_similarity_get_type(void); ++ extern GType vips_rotate_get_type(void); ++ extern GType vips_resize_get_type(void); ++ ++ vips_thumbnail_file_get_type(); ++ vips_thumbnail_buffer_get_type(); ++ vips_thumbnail_image_get_type(); ++ vips_thumbnail_source_get_type(); ++ vips_mapim_get_type(); ++ vips_shrink_get_type(); ++ vips_shrinkh_get_type(); ++ vips_shrinkv_get_type(); ++ vips_reduceh_get_type(); ++ vips_reducev_get_type(); ++ vips_reduce_get_type(); ++ vips_quadratic_get_type(); ++ vips_affine_get_type(); ++ vips_similarity_get_type(); ++ vips_rotate_get_type(); ++ vips_resize_get_type(); + } +- +diff --git a/libvips/resample/resize.c b/libvips/resample/resize.c +index ec54b6823e..e1b9ab6d65 100644 +--- a/libvips/resample/resize.c ++++ b/libvips/resample/resize.c +@@ -22,7 +22,7 @@ + * - more accurate resizing + * 9/9/16 + * - add @centre option +- * 6/3/17 ++ * 6/3/17 + * - moved the cache to shrinkv + * 15/10/17 + * - make LINEAR and CUBIC adaptive +@@ -30,7 +30,7 @@ + * - deprecate --centre ... it's now always on, thanks tback + * 3/12/18 [edwjusti] + * - disable the centre sampling offset for nearest upscale, since the +- * affine nearest interpolator is always centre ++ * affine nearest interpolator is always centre + * 7/7/19 [lovell] + * - don't let either axis drop below 1px + * 12/7/20 +@@ -41,28 +41,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -108,36 +108,36 @@ typedef struct _VipsResize { + + typedef VipsResampleClass VipsResizeClass; + +-G_DEFINE_TYPE( VipsResize, vips_resize, VIPS_TYPE_RESAMPLE ); ++G_DEFINE_TYPE(VipsResize, vips_resize, VIPS_TYPE_RESAMPLE); + + /* Suggest a VipsInterpolate which corresponds to a VipsKernel. We use + * this to pick a thing for affine(). + */ + static const char * +-vips_resize_interpolate( VipsKernel kernel ) ++vips_resize_interpolate(VipsKernel kernel) + { +- switch( kernel ) { ++ switch (kernel) { + case VIPS_KERNEL_NEAREST: +- return( "nearest" ); ++ return ("nearest"); + + case VIPS_KERNEL_LINEAR: +- return( "bilinear" ); ++ return ("bilinear"); + + /* Use cubic for everything else. There are other interpolators, like + * nohalo, but they don't really correspond well to any kernel. + */ + default: +- return( "bicubic" ); ++ return ("bicubic"); + } + } + + static int +-vips_resize_build( VipsObject *object ) ++vips_resize_build(VipsObject *object) + { +- VipsResample *resample = VIPS_RESAMPLE( object ); ++ VipsResample *resample = VIPS_RESAMPLE(object); + VipsResize *resize = (VipsResize *) object; + +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 5 ); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 5); + + VipsImage *in; + double hscale; +@@ -145,57 +145,57 @@ vips_resize_build( VipsObject *object ) + int int_hshrink; + int int_vshrink; + +- if( VIPS_OBJECT_CLASS( vips_resize_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_resize_parent_class)->build(object)) ++ return (-1); + + in = resample->in; + + /* Updated below when we do the int part of our shrink. + */ + hscale = resize->scale; +- if( vips_object_argument_isset( object, "vscale" ) ) ++ if (vips_object_argument_isset(object, "vscale")) + vscale = resize->vscale; + else + vscale = resize->scale; + + /* Unpack for processing. + */ +- if( vips_image_decode( in, &t[0] ) ) +- return( -1 ); ++ if (vips_image_decode(in, &t[0])) ++ return (-1); + in = t[0]; + +- if( resize->kernel == VIPS_KERNEL_NEAREST ) { ++ if (resize->kernel == VIPS_KERNEL_NEAREST) { + int target_width; + int target_height; + + /* The int part of our scale. + */ +- if( resize->gap < 1.0 ) { +- int_hshrink = VIPS_FLOOR( 1.0 / hscale ); +- int_vshrink = VIPS_FLOOR( 1.0 / vscale ); ++ if (resize->gap < 1.0) { ++ int_hshrink = VIPS_FLOOR(1.0 / hscale); ++ int_vshrink = VIPS_FLOOR(1.0 / vscale); + } + else { +- target_width = VIPS_ROUND_UINT( in->Xsize * hscale ); +- target_height = VIPS_ROUND_UINT( in->Ysize * vscale ); +- +- int_hshrink = VIPS_FLOOR( +- (double) in->Xsize / target_width / +- resize->gap ); +- int_vshrink = VIPS_FLOOR( +- (double) in->Ysize / target_height / +- resize->gap ); ++ target_width = VIPS_ROUND_UINT(in->Xsize * hscale); ++ target_height = VIPS_ROUND_UINT(in->Ysize * vscale); ++ ++ int_hshrink = VIPS_FLOOR( ++ (double) in->Xsize / target_width / ++ resize->gap); ++ int_vshrink = VIPS_FLOOR( ++ (double) in->Ysize / target_height / ++ resize->gap); + } + +- int_hshrink = VIPS_MAX( 1, int_hshrink ); +- int_vshrink = VIPS_MAX( 1, int_vshrink ); ++ int_hshrink = VIPS_MAX(1, int_hshrink); ++ int_vshrink = VIPS_MAX(1, int_vshrink); + +- if( int_vshrink > 1 || +- int_hshrink > 1 ) { +- g_info( "subsample by %d, %d", +- int_hshrink, int_vshrink ); +- if( vips_subsample( in, &t[1], +- int_hshrink, int_vshrink, NULL ) ) +- return( -1 ); ++ if (int_vshrink > 1 || ++ int_hshrink > 1) { ++ g_info("subsample by %d, %d", ++ int_hshrink, int_vshrink); ++ if (vips_subsample(in, &t[1], ++ int_hshrink, int_vshrink, NULL)) ++ return (-1); + in = t[1]; + + hscale *= int_hshrink; +@@ -205,192 +205,190 @@ vips_resize_build( VipsObject *object ) + + /* Don't let either axis drop below 1 px. + */ +- hscale = VIPS_MAX( hscale, 1.0 / in->Xsize ); +- vscale = VIPS_MAX( vscale, 1.0 / in->Ysize ); ++ hscale = VIPS_MAX(hscale, 1.0 / in->Xsize); ++ vscale = VIPS_MAX(vscale, 1.0 / in->Ysize); + + /* Any residual downsizing. + */ +- if( vscale < 1.0 ) { +- g_info( "residual reducev by %g", vscale ); +- if( vips_reducev( in, &t[2], 1.0 / vscale, +- "kernel", resize->kernel, +- "gap", resize->gap, +- NULL ) ) +- return( -1 ); ++ if (vscale < 1.0) { ++ g_info("residual reducev by %g", vscale); ++ if (vips_reducev(in, &t[2], 1.0 / vscale, ++ "kernel", resize->kernel, ++ "gap", resize->gap, ++ NULL)) ++ return (-1); + in = t[2]; + } + +- if( hscale < 1.0 ) { +- g_info( "residual reduceh by %g", hscale ); +- if( vips_reduceh( in, &t[3], 1.0 / hscale, +- "kernel", resize->kernel, +- "gap", resize->gap, +- NULL ) ) +- return( -1 ); ++ if (hscale < 1.0) { ++ g_info("residual reduceh by %g", hscale); ++ if (vips_reduceh(in, &t[3], 1.0 / hscale, ++ "kernel", resize->kernel, ++ "gap", resize->gap, ++ NULL)) ++ return (-1); + in = t[3]; + } + + /* Any upsizing. + */ +- if( hscale > 1.0 || +- vscale > 1.0 ) { +- const char *nickname = +- vips_resize_interpolate( resize->kernel ); ++ if (hscale > 1.0 || ++ vscale > 1.0) { ++ const char *nickname = ++ vips_resize_interpolate(resize->kernel); + + /* Input displacement. For centre sampling, shift by 0.5 down + * and right. Except if this is nearest, which is always + * centre. + */ +- const double id = +- resize->kernel == VIPS_KERNEL_NEAREST ? +- 0.0 : 0.5; ++ const double id = ++ resize->kernel == VIPS_KERNEL_NEAREST ? 0.0 : 0.5; + + VipsInterpolate *interpolate; + +- if( !(interpolate = vips_interpolate_new( nickname )) ) +- return( -1 ); +- vips_object_local( object, interpolate ); ++ if (!(interpolate = vips_interpolate_new(nickname))) ++ return (-1); ++ vips_object_local(object, interpolate); + +- if( resize->kernel == VIPS_KERNEL_NEAREST && +- hscale == VIPS_FLOOR( hscale ) && +- vscale == VIPS_FLOOR( vscale ) ) { ++ if (resize->kernel == VIPS_KERNEL_NEAREST && ++ hscale == VIPS_FLOOR(hscale) && ++ vscale == VIPS_FLOOR(vscale)) { + /* Fast, integral nearest neighbour enlargement + */ +- if( vips_zoom( in, &t[4], VIPS_FLOOR( hscale ), +- VIPS_FLOOR( vscale ), NULL ) ) +- return( -1 ); ++ if (vips_zoom(in, &t[4], VIPS_FLOOR(hscale), ++ VIPS_FLOOR(vscale), NULL)) ++ return (-1); + in = t[4]; + } +- else if( hscale > 1.0 && +- vscale > 1.0 ) { +- g_info( "residual scale %g x %g", hscale, vscale ); +- if( vips_affine( in, &t[4], +- hscale, 0.0, 0.0, vscale, +- "interpolate", interpolate, +- "idx", id, +- "idy", id, +- "extend", VIPS_EXTEND_COPY, +- "premultiplied", TRUE, +- NULL ) ) +- return( -1 ); ++ else if (hscale > 1.0 && ++ vscale > 1.0) { ++ g_info("residual scale %g x %g", hscale, vscale); ++ if (vips_affine(in, &t[4], ++ hscale, 0.0, 0.0, vscale, ++ "interpolate", interpolate, ++ "idx", id, ++ "idy", id, ++ "extend", VIPS_EXTEND_COPY, ++ "premultiplied", TRUE, ++ NULL)) ++ return (-1); + in = t[4]; + } +- else if( hscale > 1.0 ) { +- g_info( "residual scale %g", hscale ); +- if( vips_affine( in, &t[4], hscale, 0.0, 0.0, 1.0, +- "interpolate", interpolate, +- "idx", id, +- "idy", id, +- "extend", VIPS_EXTEND_COPY, +- "premultiplied", TRUE, +- NULL ) ) +- return( -1 ); ++ else if (hscale > 1.0) { ++ g_info("residual scale %g", hscale); ++ if (vips_affine(in, &t[4], hscale, 0.0, 0.0, 1.0, ++ "interpolate", interpolate, ++ "idx", id, ++ "idy", id, ++ "extend", VIPS_EXTEND_COPY, ++ "premultiplied", TRUE, ++ NULL)) ++ return (-1); + in = t[4]; + } +- else { +- g_info( "residual scale %g", vscale ); +- if( vips_affine( in, &t[4], 1.0, 0.0, 0.0, vscale, +- "interpolate", interpolate, +- "idx", id, +- "idy", id, +- "extend", VIPS_EXTEND_COPY, +- "premultiplied", TRUE, +- NULL ) ) +- return( -1 ); ++ else { ++ g_info("residual scale %g", vscale); ++ if (vips_affine(in, &t[4], 1.0, 0.0, 0.0, vscale, ++ "interpolate", interpolate, ++ "idx", id, ++ "idy", id, ++ "extend", VIPS_EXTEND_COPY, ++ "premultiplied", TRUE, ++ NULL)) ++ return (-1); + in = t[4]; + } + } + +- if( vips_image_write( in, resample->out ) ) +- return( -1 ); ++ if (vips_image_write(in, resample->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_resize_class_init( VipsResizeClass *class ) ++vips_resize_class_init(VipsResizeClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_resize_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_resize_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "resize"; +- vobject_class->description = _( "resize an image" ); ++ vobject_class->description = _("resize an image"); + vobject_class->build = vips_resize_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_DOUBLE( class, "scale", 113, +- _( "Scale factor" ), +- _( "Scale image by this factor" ), ++ VIPS_ARG_DOUBLE(class, "scale", 113, ++ _("Scale factor"), ++ _("Scale image by this factor"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsResize, scale ), +- 0.0, 10000000.0, 0.0 ); ++ G_STRUCT_OFFSET(VipsResize, scale), ++ 0.0, 10000000.0, 0.0); + +- VIPS_ARG_DOUBLE( class, "vscale", 113, +- _( "Vertical scale factor" ), +- _( "Vertical scale image by this factor" ), ++ VIPS_ARG_DOUBLE(class, "vscale", 113, ++ _("Vertical scale factor"), ++ _("Vertical scale image by this factor"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsResize, vscale ), +- 0.0, 10000000.0, 0.0 ); ++ G_STRUCT_OFFSET(VipsResize, vscale), ++ 0.0, 10000000.0, 0.0); + +- VIPS_ARG_ENUM( class, "kernel", 3, +- _( "Kernel" ), +- _( "Resampling kernel" ), ++ VIPS_ARG_ENUM(class, "kernel", 3, ++ _("Kernel"), ++ _("Resampling kernel"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsResize, kernel ), +- VIPS_TYPE_KERNEL, VIPS_KERNEL_LANCZOS3 ); ++ G_STRUCT_OFFSET(VipsResize, kernel), ++ VIPS_TYPE_KERNEL, VIPS_KERNEL_LANCZOS3); + +- VIPS_ARG_DOUBLE( class, "gap", 4, +- _( "Gap" ), +- _( "Reducing gap" ), ++ VIPS_ARG_DOUBLE(class, "gap", 4, ++ _("Gap"), ++ _("Reducing gap"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsResize, gap ), +- 0.0, 1000000.0, 2.0 ); ++ G_STRUCT_OFFSET(VipsResize, gap), ++ 0.0, 1000000.0, 2.0); + + /* We used to let people set the input offset so you could pick centre +- * or corner interpolation, but it's not clear this was useful. ++ * or corner interpolation, but it's not clear this was useful. + */ +- VIPS_ARG_DOUBLE( class, "idx", 115, +- _( "Input offset" ), +- _( "Horizontal input displacement" ), ++ VIPS_ARG_DOUBLE(class, "idx", 115, ++ _("Input offset"), ++ _("Horizontal input displacement"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsResize, idx ), +- -10000000.0, 10000000.0, 0.0 ); ++ G_STRUCT_OFFSET(VipsResize, idx), ++ -10000000.0, 10000000.0, 0.0); + +- VIPS_ARG_DOUBLE( class, "idy", 116, +- _( "Input offset" ), +- _( "Vertical input displacement" ), ++ VIPS_ARG_DOUBLE(class, "idy", 116, ++ _("Input offset"), ++ _("Vertical input displacement"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsResize, idy ), +- -10000000.0, 10000000.0, 0.0 ); ++ G_STRUCT_OFFSET(VipsResize, idy), ++ -10000000.0, 10000000.0, 0.0); + + /* It's a kernel now we use vips_reduce() not vips_affine(). + */ +- VIPS_ARG_INTERPOLATE( class, "interpolate", 2, +- _( "Interpolate" ), +- _( "Interpolate pixels with this" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsResize, interpolate ) ); ++ VIPS_ARG_INTERPOLATE(class, "interpolate", 2, ++ _("Interpolate"), ++ _("Interpolate pixels with this"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, ++ G_STRUCT_OFFSET(VipsResize, interpolate)); + + /* We used to let people pick centre or corner, but it's automatic now. + */ +- VIPS_ARG_BOOL( class, "centre", 7, +- _( "Centre" ), +- _( "Use centre sampling convention" ), ++ VIPS_ARG_BOOL(class, "centre", 7, ++ _("Centre"), ++ _("Use centre sampling convention"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsResize, centre ), +- FALSE ); +- ++ G_STRUCT_OFFSET(VipsResize, centre), ++ FALSE); + } + + static void +-vips_resize_init( VipsResize *resize ) ++vips_resize_init(VipsResize *resize) + { + resize->gap = 2.0; + resize->kernel = VIPS_KERNEL_LANCZOS3; +@@ -406,10 +404,10 @@ vips_resize_init( VipsResize *resize ) + * Optional arguments: + * + * * @vscale: %gdouble vertical scale factor +- * * @kernel: #VipsKernel to reduce with ++ * * @kernel: #VipsKernel to reduce with + * * @gap: reducing gap to use (default: 2.0) + * +- * Resize an image. ++ * Resize an image. + * + * Set @gap to speed up downsizing by having vips_shrink() to shrink + * with a box filter first. The bigger @gap, the closer the result +@@ -418,7 +416,7 @@ vips_resize_init( VipsResize *resize ) + * while still being faster in many cases). + * + * vips_resize() normally uses #VIPS_KERNEL_LANCZOS3 for the final reduce, you +- * can change this with @kernel. Downsizing is done with centre convention. ++ * can change this with @kernel. Downsizing is done with centre convention. + * + * When upsizing (@scale > 1), the operation uses vips_affine() with + * a #VipsInterpolate selected depending on @kernel. It will use +@@ -434,7 +432,7 @@ vips_resize_init( VipsResize *resize ) + * fractional pixel sizes. + * + * This operation does not change xres or yres. The image resolution needs to +- * be updated by the application. ++ * be updated by the application. + * + * This operation does not premultiply alpha. If your image has an alpha + * channel, you should use vips_premultiply() on it first. +@@ -444,15 +442,15 @@ vips_resize_init( VipsResize *resize ) + * Returns: 0 on success, -1 on error + */ + int +-vips_resize( VipsImage *in, VipsImage **out, +- double scale, ... ) ++vips_resize(VipsImage *in, VipsImage **out, ++ double scale, ...) + { + va_list ap; + int result; + +- va_start( ap, scale ); +- result = vips_call_split( "resize", ap, in, out, scale ); +- va_end( ap ); ++ va_start(ap, scale); ++ result = vips_call_split("resize", ap, in, out, scale); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/resample/shrink.c b/libvips/resample/shrink.c +index 5dabe197b2..cd894905df 100644 +--- a/libvips/resample/shrink.c ++++ b/libvips/resample/shrink.c +@@ -6,7 +6,7 @@ + * - now handles complex + * 15/8/16 + * - more accurate resize +- * - rename xshrink -> hshrink for greater consistency ++ * - rename xshrink -> hshrink for greater consistency + * 9/2/17 + * - use reduce, not affine, for any residual shrink + * - expand cache hint +@@ -16,28 +16,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -63,74 +63,74 @@ + typedef struct _VipsShrink { + VipsResample parent_instance; + +- double hshrink; /* Shrink factors */ ++ double hshrink; /* Shrink factors */ + double vshrink; +- gboolean ceil; /* Round operation */ ++ gboolean ceil; /* Round operation */ + + } VipsShrink; + + typedef VipsResampleClass VipsShrinkClass; + +-G_DEFINE_TYPE( VipsShrink, vips_shrink, VIPS_TYPE_RESAMPLE ); ++G_DEFINE_TYPE(VipsShrink, vips_shrink, VIPS_TYPE_RESAMPLE); + + static int +-vips_shrink_build( VipsObject *object ) ++vips_shrink_build(VipsObject *object) + { +- VipsResample *resample = VIPS_RESAMPLE( object ); ++ VipsResample *resample = VIPS_RESAMPLE(object); + VipsShrink *shrink = (VipsShrink *) object; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(object, 2); + + int hshrink_int; + int vshrink_int; + +- if( VIPS_OBJECT_CLASS( vips_shrink_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_shrink_parent_class)->build(object)) ++ return (-1); + + hshrink_int = (int) shrink->hshrink; + vshrink_int = (int) shrink->vshrink; + +- if( hshrink_int != shrink->hshrink || +- vshrink_int != shrink->vshrink ) { ++ if (hshrink_int != shrink->hshrink || ++ vshrink_int != shrink->vshrink) { + /* Shrink by int factors, reduce to final size. + */ +- if( vips_reducev( resample->in, &t[0], shrink->vshrink, ++ if (vips_reducev(resample->in, &t[0], shrink->vshrink, + "gap", 1.0, +- NULL ) || +- vips_reduceh( t[0], &t[1], shrink->hshrink, ++ NULL) || ++ vips_reduceh(t[0], &t[1], shrink->hshrink, + "gap", 1.0, +- NULL ) || +- vips_image_write( t[1], resample->out ) ) +- return( -1 ); ++ NULL) || ++ vips_image_write(t[1], resample->out)) ++ return (-1); + } + else { +- if( vips_shrinkv( resample->in, &t[0], shrink->vshrink, +- "ceil", shrink->ceil, +- NULL ) || +- vips_shrinkh( t[0], &t[1], shrink->hshrink, +- "ceil", shrink->ceil, +- NULL ) || +- vips_image_write( t[1], resample->out ) ) +- return( -1 ); ++ if (vips_shrinkv(resample->in, &t[0], shrink->vshrink, ++ "ceil", shrink->ceil, ++ NULL) || ++ vips_shrinkh(t[0], &t[1], shrink->hshrink, ++ "ceil", shrink->ceil, ++ NULL) || ++ vips_image_write(t[1], resample->out)) ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + static void +-vips_shrink_class_init( VipsShrinkClass *class ) ++vips_shrink_class_init(VipsShrinkClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_shrink_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_shrink_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "shrink"; +- vobject_class->description = _( "shrink an image" ); ++ vobject_class->description = _("shrink an image"); + vobject_class->build = vips_shrink_build; + + /* You'd think UNBUFFERED would work, but we will use reduce for non-int +@@ -138,47 +138,46 @@ vips_shrink_class_init( VipsShrinkClass *class ) + */ + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_DOUBLE( class, "vshrink", 9, +- _( "Vshrink" ), +- _( "Vertical shrink factor" ), ++ VIPS_ARG_DOUBLE(class, "vshrink", 9, ++ _("Vshrink"), ++ _("Vertical shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsShrink, vshrink ), +- 1.0, 1000000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsShrink, vshrink), ++ 1.0, 1000000.0, 1.0); + +- VIPS_ARG_DOUBLE( class, "hshrink", 8, +- _( "Hshrink" ), +- _( "Horizontal shrink factor" ), ++ VIPS_ARG_DOUBLE(class, "hshrink", 8, ++ _("Hshrink"), ++ _("Horizontal shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsShrink, hshrink ), +- 1.0, 1000000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsShrink, hshrink), ++ 1.0, 1000000.0, 1.0); + +- VIPS_ARG_BOOL( class, "ceil", 10, +- _( "Ceil" ), +- _( "Round-up output dimensions" ), ++ VIPS_ARG_BOOL(class, "ceil", 10, ++ _("Ceil"), ++ _("Round-up output dimensions"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsShrink, ceil ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsShrink, ceil), ++ FALSE); + +- /* The old names .. now use h and v everywhere. ++ /* The old names .. now use h and v everywhere. + */ +- VIPS_ARG_DOUBLE( class, "xshrink", 8, +- _( "Xshrink" ), +- _( "Horizontal shrink factor" ), ++ VIPS_ARG_DOUBLE(class, "xshrink", 8, ++ _("Xshrink"), ++ _("Horizontal shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsShrink, hshrink ), +- 1.0, 1000000.0, 1.0 ); ++ G_STRUCT_OFFSET(VipsShrink, hshrink), ++ 1.0, 1000000.0, 1.0); + +- VIPS_ARG_DOUBLE( class, "yshrink", 9, +- _( "Yshrink" ), +- _( "Vertical shrink factor" ), ++ VIPS_ARG_DOUBLE(class, "yshrink", 9, ++ _("Yshrink"), ++ _("Vertical shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsShrink, vshrink ), +- 1.0, 1000000.0, 1.0 ); +- ++ G_STRUCT_OFFSET(VipsShrink, vshrink), ++ 1.0, 1000000.0, 1.0); + } + + static void +-vips_shrink_init( VipsShrink *shrink ) ++vips_shrink_init(VipsShrink *shrink) + { + } + +@@ -197,28 +196,28 @@ vips_shrink_init( VipsShrink *shrink ) + * Shrink @in by a pair of factors with a simple box filter. For non-integer + * factors, vips_shrink() will first shrink by the integer part with a box + * filter, then use vips_reduce() to shrink by the +- * remaining fractional part. ++ * remaining fractional part. + * + * This is a very low-level operation: see vips_resize() for a more +- * convenient way to resize images. ++ * convenient way to resize images. + * + * This operation does not change xres or yres. The image resolution needs to +- * be updated by the application. ++ * be updated by the application. + * + * See also: vips_resize(), vips_reduce(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_shrink( VipsImage *in, VipsImage **out, +- double hshrink, double vshrink, ... ) ++vips_shrink(VipsImage *in, VipsImage **out, ++ double hshrink, double vshrink, ...) + { + va_list ap; + int result; + +- va_start( ap, vshrink ); +- result = vips_call_split( "shrink", ap, in, out, hshrink, vshrink ); +- va_end( ap ); ++ va_start(ap, vshrink); ++ result = vips_call_split("shrink", ap, in, out, hshrink, vshrink); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/resample/shrinkh.c b/libvips/resample/shrinkh.c +index f4a665c3d6..04dc89df70 100644 +--- a/libvips/resample/shrinkh.c ++++ b/libvips/resample/shrinkh.c +@@ -5,7 +5,7 @@ + * 22/1/16 + * - reorganise loops, 30% faster, vectorisable + * 15/8/16 +- * - rename xshrink -> hshrink for greater consistency ++ * - rename xshrink -> hshrink for greater consistency + * 6/8/19 + * - use a double sum buffer for int32 types + * 22/4/22 kleisauke +@@ -14,28 +14,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -61,150 +61,164 @@ + typedef struct _VipsShrinkh { + VipsResample parent_instance; + +- int hshrink; /* Shrink factor */ +- gboolean ceil; /* Round operation */ ++ int hshrink; /* Shrink factor */ ++ gboolean ceil; /* Round operation */ + + } VipsShrinkh; + + typedef VipsResampleClass VipsShrinkhClass; + +-G_DEFINE_TYPE( VipsShrinkh, vips_shrinkh, VIPS_TYPE_RESAMPLE ); ++G_DEFINE_TYPE(VipsShrinkh, vips_shrinkh, VIPS_TYPE_RESAMPLE); + +-#define INNER( BANDS ) \ ++#define INNER(BANDS) \ + sum += p[x1]; \ +- x1 += BANDS; ++ x1 += BANDS; + +-/* Integer shrink. ++/* Integer shrink. + */ +-#define ISHRINK( ACC_TYPE, TYPE, BANDS ) { \ +- TYPE * restrict p = (TYPE *) in; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < width; x++ ) { \ +- for( b = 0; b < BANDS; b++ ) { \ +- ACC_TYPE sum; \ +- \ +- sum = 0; \ +- x1 = b; \ +- VIPS_UNROLL( shrink->hshrink, INNER( BANDS ) ); \ +- q[b] = (sum + shrink->hshrink / 2) / \ +- shrink->hshrink; \ ++#define ISHRINK(ACC_TYPE, TYPE, BANDS) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < width; x++) { \ ++ for (b = 0; b < BANDS; b++) { \ ++ ACC_TYPE sum; \ ++\ ++ sum = 0; \ ++ x1 = b; \ ++ VIPS_UNROLL(shrink->hshrink, INNER(BANDS)); \ ++ q[b] = (sum + shrink->hshrink / 2) / \ ++ shrink->hshrink; \ ++ } \ ++ p += ne; \ ++ q += BANDS; \ + } \ +- p += ne; \ +- q += BANDS; \ +- } \ +-} ++ } + +-/* Float shrink. ++/* Float shrink. + */ +-#define FSHRINK( TYPE ) { \ +- TYPE * restrict p = (TYPE *) in; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < width; x++ ) { \ +- for( b = 0; b < bands; b++ ) { \ +- double sum; \ +- \ +- sum = 0.0; \ +- x1 = b; \ +- VIPS_UNROLL( shrink->hshrink, INNER( bands ) ); \ +- q[b] = sum / shrink->hshrink; \ ++#define FSHRINK(TYPE) \ ++ { \ ++ TYPE *restrict p = (TYPE *) in; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < width; x++) { \ ++ for (b = 0; b < bands; b++) { \ ++ double sum; \ ++\ ++ sum = 0.0; \ ++ x1 = b; \ ++ VIPS_UNROLL(shrink->hshrink, INNER(bands)); \ ++ q[b] = sum / shrink->hshrink; \ ++ } \ ++ p += ne; \ ++ q += bands; \ + } \ +- p += ne; \ +- q += bands; \ +- } \ +-} ++ } + + /* Generate an area of @or. @ir is large enough. + */ + static void +-vips_shrinkh_gen2( VipsShrinkh *shrink, VipsRegion *or, VipsRegion *ir, +- int left, int top, int width ) ++vips_shrinkh_gen2(VipsShrinkh *shrink, VipsRegion * or, VipsRegion *ir, ++ int left, int top, int width) + { +- VipsResample *resample = VIPS_RESAMPLE( shrink ); +- const int bands = resample->in->Bands * +- (vips_band_format_iscomplex( resample->in->BandFmt ) ? +- 2 : 1); +- const int ne = shrink->hshrink * bands; +- VipsPel *out = VIPS_REGION_ADDR( or, left, top ); +- VipsPel *in = VIPS_REGION_ADDR( ir, left * shrink->hshrink, top ); ++ VipsResample *resample = VIPS_RESAMPLE(shrink); ++ const int bands = resample->in->Bands * ++ (vips_band_format_iscomplex(resample->in->BandFmt) ? 2 : 1); ++ const int ne = shrink->hshrink * bands; ++ VipsPel *out = VIPS_REGION_ADDR(or, left, top); ++ VipsPel *in = VIPS_REGION_ADDR(ir, left * shrink->hshrink, top); + + int x; + int x1, b; + +- switch( resample->in->BandFmt ) { +- case VIPS_FORMAT_UCHAR: ++ switch (resample->in->BandFmt) { ++ case VIPS_FORMAT_UCHAR: + /* Generate a special path for 1, 3 and 4 band uchar data. The + * compiler will be able to vectorise these. + * + * Vectorisation doesn't help much for 16, 32-bit or float + * data, don't bother with them. + */ +- switch( bands ) { ++ switch (bands) { + case 1: +- ISHRINK( int, unsigned char, 1 ); break; ++ ISHRINK(int, unsigned char, 1); ++ break; + case 3: +- ISHRINK( int, unsigned char, 3 ); break; ++ ISHRINK(int, unsigned char, 3); ++ break; + case 4: +- ISHRINK( int, unsigned char, 4 ); break; ++ ISHRINK(int, unsigned char, 4); ++ break; + default: +- ISHRINK( int, unsigned char, bands ); break; ++ ISHRINK(int, unsigned char, bands); ++ break; + } + break; + +- case VIPS_FORMAT_CHAR: +- ISHRINK( int, char, bands ); break; +- case VIPS_FORMAT_USHORT: +- ISHRINK( int, unsigned short, bands ); break; +- case VIPS_FORMAT_SHORT: +- ISHRINK( int, short, bands ); break; +- case VIPS_FORMAT_UINT: +- ISHRINK( double, unsigned int, bands ); break; +- case VIPS_FORMAT_INT: +- ISHRINK( double, int, bands ); break; +- case VIPS_FORMAT_FLOAT: +- FSHRINK( float ); break; +- case VIPS_FORMAT_DOUBLE: +- FSHRINK( double ); break; +- case VIPS_FORMAT_COMPLEX: +- FSHRINK( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: +- FSHRINK( double ); break; ++ case VIPS_FORMAT_CHAR: ++ ISHRINK(int, char, bands); ++ break; ++ case VIPS_FORMAT_USHORT: ++ ISHRINK(int, unsigned short, bands); ++ break; ++ case VIPS_FORMAT_SHORT: ++ ISHRINK(int, short, bands); ++ break; ++ case VIPS_FORMAT_UINT: ++ ISHRINK(double, unsigned int, bands); ++ break; ++ case VIPS_FORMAT_INT: ++ ISHRINK(double, int, bands); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ FSHRINK(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ FSHRINK(double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ FSHRINK(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ FSHRINK(double); ++ break; + + default: +- g_assert_not_reached(); ++ g_assert_not_reached(); + } + } + + static int +-vips_shrinkh_gen( VipsRegion *or, void *seq, +- void *a, void *b, gboolean *stop ) ++vips_shrinkh_gen(VipsRegion * or, void *seq, ++ void *a, void *b, gboolean *stop) + { + VipsShrinkh *shrink = (VipsShrinkh *) b; + VipsRegion *ir = (VipsRegion *) seq; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + + int y; + + /* How do we chunk up the image? We don't want to prepare the whole of +- * the input region corresponding to *r since it could be huge. ++ * the input region corresponding to *r since it could be huge. + * +- * Request input a line at a time. ++ * Request input a line at a time. + * + * We don't chunk horizontally. We want "vips shrink x.jpg b.jpg 100 + * 100" to run sequentially. If we chunk horizontally, we will fetch + * 100x100 lines from the top of the image, then 100x100 100 lines + * down, etc. for each thread, then when they've finished, fetch + * 100x100, 100 pixels across from the top of the image. This will +- * break sequentiality. ++ * break sequentiality. + */ + + #ifdef DEBUG +- printf( "vips_shrinkh_gen: generating %d x %d at %d x %d\n", +- r->width, r->height, r->left, r->top ); ++ printf("vips_shrinkh_gen: generating %d x %d at %d x %d\n", ++ r->width, r->height, r->left, r->top); + #endif /*DEBUG*/ + +- for( y = 0; y < r->height; y ++ ) { ++ for (y = 0; y < r->height; y++) { + VipsRect s; + + s.left = r->left * shrink->hshrink; +@@ -212,63 +226,63 @@ vips_shrinkh_gen( VipsRegion *or, void *seq, + s.width = r->width * shrink->hshrink; + s.height = 1; + #ifdef DEBUG +- printf( "shrinkh_gen: requesting line %d\n", s.top ); ++ printf("shrinkh_gen: requesting line %d\n", s.top); + #endif /*DEBUG*/ +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + +- VIPS_GATE_START( "vips_shrinkh_gen: work" ); ++ VIPS_GATE_START("vips_shrinkh_gen: work"); + +- vips_shrinkh_gen2( shrink, or, ir, +- r->left, r->top + y, r->width ); ++ vips_shrinkh_gen2(shrink, or, ir, ++ r->left, r->top + y, r->width); + +- VIPS_GATE_STOP( "vips_shrinkh_gen: work" ); ++ VIPS_GATE_STOP("vips_shrinkh_gen: work"); + } + +- VIPS_COUNT_PIXELS( or, "vips_shrinkh_gen" ); ++ VIPS_COUNT_PIXELS(or, "vips_shrinkh_gen"); + +- return( 0 ); ++ return (0); + } + + static int +-vips_shrinkh_build( VipsObject *object ) ++vips_shrinkh_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsResample *resample = VIPS_RESAMPLE( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsResample *resample = VIPS_RESAMPLE(object); + VipsShrinkh *shrink = (VipsShrinkh *) object; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( object, 2 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(object, 2); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_shrinkh_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_shrinkh_parent_class)->build(object)) ++ return (-1); + +- in = resample->in; ++ in = resample->in; + +- if( shrink->hshrink < 1 ) { +- vips_error( class->nickname, +- "%s", _( "shrink factors should be >= 1" ) ); +- return( -1 ); ++ if (shrink->hshrink < 1) { ++ vips_error(class->nickname, ++ "%s", _("shrink factors should be >= 1")); ++ return (-1); + } + +- if( shrink->hshrink == 1 ) +- return( vips_image_write( in, resample->out ) ); ++ if (shrink->hshrink == 1) ++ return (vips_image_write(in, resample->out)); + + /* We need new pixels at the right so that we don't have small chunks + * to average down the right edge. + */ +- if( vips_embed( in, &t[1], +- 0, 0, +- in->Xsize + shrink->hshrink, in->Ysize, +- "extend", VIPS_EXTEND_COPY, +- NULL ) ) +- return( -1 ); ++ if (vips_embed(in, &t[1], ++ 0, 0, ++ in->Xsize + shrink->hshrink, in->Ysize, ++ "extend", VIPS_EXTEND_COPY, ++ NULL)) ++ return (-1); + in = t[1]; + +- if( vips_image_pipelinev( resample->out, +- VIPS_DEMAND_STYLE_THINSTRIP, in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(resample->out, ++ VIPS_DEMAND_STYLE_THINSTRIP, in, NULL)) ++ return (-1); + + /* Size output. + * +@@ -276,75 +290,71 @@ vips_shrinkh_build( VipsObject *object ) + * example, vipsthumbnail knows the true shrink factor (including the + * fractional part), we just see the integer part here. + */ +- resample->out->Xsize = shrink->ceil ? +- VIPS_CEIL( (double) resample->in->Xsize / shrink->hshrink ) : +- VIPS_ROUND_UINT( +- (double) resample->in->Xsize / shrink->hshrink ); +- if( resample->out->Xsize <= 0 ) { +- vips_error( class->nickname, +- "%s", _( "image has shrunk to nothing" ) ); +- return( -1 ); ++ resample->out->Xsize = shrink->ceil ? VIPS_CEIL((double) resample->in->Xsize / shrink->hshrink) : VIPS_ROUND_UINT((double) resample->in->Xsize / shrink->hshrink); ++ if (resample->out->Xsize <= 0) { ++ vips_error(class->nickname, ++ "%s", _("image has shrunk to nothing")); ++ return (-1); + } + + #ifdef DEBUG +- printf( "vips_shrinkh_build: shrinking %d x %d image to %d x %d\n", +- in->Xsize, in->Ysize, +- resample->out->Xsize, resample->out->Ysize ); ++ printf("vips_shrinkh_build: shrinking %d x %d image to %d x %d\n", ++ in->Xsize, in->Ysize, ++ resample->out->Xsize, resample->out->Ysize); + #endif /*DEBUG*/ + +- if( vips_image_generate( resample->out, +- vips_start_one, vips_shrinkh_gen, vips_stop_one, +- in, shrink ) ) +- return( -1 ); ++ if (vips_image_generate(resample->out, ++ vips_start_one, vips_shrinkh_gen, vips_stop_one, ++ in, shrink)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_shrinkh_class_init( VipsShrinkhClass *class ) ++vips_shrinkh_class_init(VipsShrinkhClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_shrinkh_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_shrinkh_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "shrinkh"; +- vobject_class->description = _( "shrink an image horizontally" ); ++ vobject_class->description = _("shrink an image horizontally"); + vobject_class->build = vips_shrinkh_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_INT( class, "hshrink", 8, +- _( "Hshrink" ), +- _( "Horizontal shrink factor" ), ++ VIPS_ARG_INT(class, "hshrink", 8, ++ _("Hshrink"), ++ _("Horizontal shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsShrinkh, hshrink ), +- 1, 1000000, 1 ); ++ G_STRUCT_OFFSET(VipsShrinkh, hshrink), ++ 1, 1000000, 1); + +- VIPS_ARG_BOOL( class, "ceil", 10, +- _( "Ceil" ), +- _( "Round-up output dimensions" ), ++ VIPS_ARG_BOOL(class, "ceil", 10, ++ _("Ceil"), ++ _("Round-up output dimensions"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsShrinkh, ceil ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsShrinkh, ceil), ++ FALSE); + +- /* The old name .. now use h and v everywhere. ++ /* The old name .. now use h and v everywhere. + */ +- VIPS_ARG_INT( class, "xshrink", 8, +- _( "Xshrink" ), +- _( "Horizontal shrink factor" ), ++ VIPS_ARG_INT(class, "xshrink", 8, ++ _("Xshrink"), ++ _("Horizontal shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsShrinkh, hshrink ), +- 1, 1000000, 1 ); +- ++ G_STRUCT_OFFSET(VipsShrinkh, hshrink), ++ 1, 1000000, 1); + } + + static void +-vips_shrinkh_init( VipsShrinkh *shrink ) ++vips_shrinkh_init(VipsShrinkh *shrink) + { + } + +@@ -360,27 +370,27 @@ vips_shrinkh_init( VipsShrinkh *shrink ) + * * @ceil: round-up output dimensions + * + * Shrink @in horizontally by an integer factor. Each pixel in the output is +- * the average of the corresponding line of @hshrink pixels in the input. ++ * the average of the corresponding line of @hshrink pixels in the input. + * + * This is a very low-level operation: see vips_resize() for a more +- * convenient way to resize images. ++ * convenient way to resize images. + * + * This operation does not change xres or yres. The image resolution needs to +- * be updated by the application. ++ * be updated by the application. + * + * See also: vips_shrinkv(), vips_shrink(), vips_resize(), vips_affine(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_shrinkh( VipsImage *in, VipsImage **out, int hshrink, ... ) ++vips_shrinkh(VipsImage *in, VipsImage **out, int hshrink, ...) + { + va_list ap; + int result; + +- va_start( ap, hshrink ); +- result = vips_call_split( "shrinkh", ap, in, out, hshrink ); +- va_end( ap ); ++ va_start(ap, hshrink); ++ result = vips_call_split("shrinkh", ap, in, out, hshrink); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/resample/shrinkv.c b/libvips/resample/shrinkv.c +index 9c01540de6..3d4f21359d 100644 +--- a/libvips/resample/shrinkv.c ++++ b/libvips/resample/shrinkv.c +@@ -4,8 +4,8 @@ + * + * Authors: Nicos Dessipris and Kirk Martinez + * Written on: 29/04/1991 +- * Modified on: 2/11/92, 22/2/93 Kirk Martinez - Xres Yres & cleanup +- incredibly inefficient for box filters as LUTs are used instead of + ++ * Modified on: 2/11/92, 22/2/93 Kirk Martinez - Xres Yres & cleanup ++ incredibly inefficient for box filters as LUTs are used instead of + + Needs converting to a smoother filter: eg Gaussian! KM + * 15/7/93 JC + * - rewritten for partial v2 +@@ -42,7 +42,7 @@ + * - don't chunk horizontally, fixes seq problems with large shrink + * factors + * 15/8/16 +- * - rename yshrink -> vshrink for greater consistency ++ * - rename yshrink -> vshrink for greater consistency + * 7/3/17 + * - add a seq line cache + * 6/8/19 +@@ -53,28 +53,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -101,15 +101,15 @@ + typedef struct _VipsShrinkv { + VipsResample parent_instance; + +- int vshrink; /* Shrink factor */ ++ int vshrink; /* Shrink factor */ + size_t sizeof_line_buffer; +- gboolean ceil; /* Round operation */ ++ gboolean ceil; /* Round operation */ + + } VipsShrinkv; + + typedef VipsResampleClass VipsShrinkvClass; + +-G_DEFINE_TYPE( VipsShrinkv, vips_shrinkv, VIPS_TYPE_RESAMPLE ); ++G_DEFINE_TYPE(VipsShrinkv, vips_shrinkv, VIPS_TYPE_RESAMPLE); + + /* Our per-sequence parameter struct. Somewhere to sum band elements. + */ +@@ -122,176 +122,197 @@ typedef struct { + /* Free a sequence value. + */ + static int +-vips_shrinkv_stop( void *vseq, void *a, void *b ) ++vips_shrinkv_stop(void *vseq, void *a, void *b) + { + VipsShrinkvSequence *seq = (VipsShrinkvSequence *) vseq; + +- VIPS_FREEF( g_object_unref, seq->ir ); +- VIPS_FREE( seq->sum ); +- VIPS_FREE( seq ); ++ VIPS_FREEF(g_object_unref, seq->ir); ++ VIPS_FREE(seq->sum); ++ VIPS_FREE(seq); + +- return( 0 ); ++ return (0); + } + + /* Make a sequence value. + */ + static void * +-vips_shrinkv_start( VipsImage *out, void *a, void *b ) ++vips_shrinkv_start(VipsImage *out, void *a, void *b) + { + VipsImage *in = (VipsImage *) a; + VipsShrinkv *shrink = (VipsShrinkv *) b; + VipsShrinkvSequence *seq; + +- if( !(seq = VIPS_NEW( NULL, VipsShrinkvSequence )) ) +- return( NULL ); ++ if (!(seq = VIPS_NEW(NULL, VipsShrinkvSequence))) ++ return (NULL); + +- seq->ir = vips_region_new( in ); ++ seq->ir = vips_region_new(in); + +- /* Big enough for the largest intermediate .. a whole scanline. ++ /* Big enough for the largest intermediate .. a whole scanline. + */ +- seq->sum = VIPS_ARRAY( NULL, shrink->sizeof_line_buffer, VipsPel ); ++ seq->sum = VIPS_ARRAY(NULL, shrink->sizeof_line_buffer, VipsPel); + +- return( (void *) seq ); ++ return ((void *) seq); + } + +-#define ADD( ACC_TYPE, TYPE ) { \ +- ACC_TYPE * restrict sum = (ACC_TYPE *) seq->sum; \ +- TYPE * restrict p = (TYPE *) in; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- sum[x] += p[x]; \ +-} ++#define ADD(ACC_TYPE, TYPE) \ ++ { \ ++ ACC_TYPE *restrict sum = (ACC_TYPE *) seq->sum; \ ++ TYPE *restrict p = (TYPE *) in; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ sum[x] += p[x]; \ ++ } + +-/* Add a line of pixels to sum. ++/* Add a line of pixels to sum. + */ + static void +-vips_shrinkv_add_line( VipsShrinkv *shrink, VipsShrinkvSequence *seq, +- VipsRegion *ir, int left, int top, int width ) ++vips_shrinkv_add_line(VipsShrinkv *shrink, VipsShrinkvSequence *seq, ++ VipsRegion *ir, int left, int top, int width) + { +- VipsResample *resample = VIPS_RESAMPLE( shrink ); +- const int bands = resample->in->Bands * +- (vips_band_format_iscomplex( resample->in->BandFmt ) ? +- 2 : 1); +- const int sz = bands * width; ++ VipsResample *resample = VIPS_RESAMPLE(shrink); ++ const int bands = resample->in->Bands * ++ (vips_band_format_iscomplex(resample->in->BandFmt) ? 2 : 1); ++ const int sz = bands * width; + + int x; + +- VipsPel *in = VIPS_REGION_ADDR( ir, left, top ); +- switch( resample->in->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- ADD( int, unsigned char ); break; +- case VIPS_FORMAT_CHAR: +- ADD( int, char ); break; +- case VIPS_FORMAT_USHORT: +- ADD( int, unsigned short ); break; +- case VIPS_FORMAT_SHORT: +- ADD( int, short ); break; +- case VIPS_FORMAT_UINT: +- ADD( double, unsigned int ); break; +- case VIPS_FORMAT_INT: +- ADD( double, int ); break; +- case VIPS_FORMAT_FLOAT: +- ADD( double, float ); break; +- case VIPS_FORMAT_DOUBLE: +- ADD( double, double ); break; +- case VIPS_FORMAT_COMPLEX: +- ADD( double, float ); break; +- case VIPS_FORMAT_DPCOMPLEX: +- ADD( double, double ); break; ++ VipsPel *in = VIPS_REGION_ADDR(ir, left, top); ++ switch (resample->in->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ ADD(int, unsigned char); ++ break; ++ case VIPS_FORMAT_CHAR: ++ ADD(int, char); ++ break; ++ case VIPS_FORMAT_USHORT: ++ ADD(int, unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ ADD(int, short); ++ break; ++ case VIPS_FORMAT_UINT: ++ ADD(double, unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ ADD(double, int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ ADD(double, float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ ADD(double, double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ ADD(double, float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ ADD(double, double); ++ break; + + default: +- g_assert_not_reached(); ++ g_assert_not_reached(); + } + } + +-/* Integer average. ++/* Integer average. + */ +-#define IAVG( ACC_TYPE, TYPE ) { \ +- ACC_TYPE * restrict sum = (ACC_TYPE *) seq->sum; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = (sum[x] + shrink->vshrink / 2) / shrink->vshrink; \ +-} +- +-/* Float average. ++#define IAVG(ACC_TYPE, TYPE) \ ++ { \ ++ ACC_TYPE *restrict sum = (ACC_TYPE *) seq->sum; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = (sum[x] + shrink->vshrink / 2) / shrink->vshrink; \ ++ } ++ ++/* Float average. + */ +-#define FAVG( TYPE ) { \ +- double * restrict sum = (double *) seq->sum; \ +- TYPE * restrict q = (TYPE *) out; \ +- \ +- for( x = 0; x < sz; x++ ) \ +- q[x] = sum[x] / shrink->vshrink; \ +-} +- +-/* Average the line of sums to out. ++#define FAVG(TYPE) \ ++ { \ ++ double *restrict sum = (double *) seq->sum; \ ++ TYPE *restrict q = (TYPE *) out; \ ++\ ++ for (x = 0; x < sz; x++) \ ++ q[x] = sum[x] / shrink->vshrink; \ ++ } ++ ++/* Average the line of sums to out. + */ + static void +-vips_shrinkv_write_line( VipsShrinkv *shrink, VipsShrinkvSequence *seq, +- VipsRegion *or, int left, int top, int width ) ++vips_shrinkv_write_line(VipsShrinkv *shrink, VipsShrinkvSequence *seq, ++ VipsRegion * or, int left, int top, int width) + { +- VipsResample *resample = VIPS_RESAMPLE( shrink ); +- const int bands = resample->in->Bands * +- (vips_band_format_iscomplex( resample->in->BandFmt ) ? +- 2 : 1); +- const int sz = bands * width; ++ VipsResample *resample = VIPS_RESAMPLE(shrink); ++ const int bands = resample->in->Bands * ++ (vips_band_format_iscomplex(resample->in->BandFmt) ? 2 : 1); ++ const int sz = bands * width; + + int x; + +- VipsPel *out = VIPS_REGION_ADDR( or, left, top ); +- switch( resample->in->BandFmt ) { ++ VipsPel *out = VIPS_REGION_ADDR(or, left, top); ++ switch (resample->in->BandFmt) { + case VIPS_FORMAT_UCHAR: +- IAVG( int, unsigned char ); break; ++ IAVG(int, unsigned char); ++ break; + case VIPS_FORMAT_CHAR: +- IAVG( int, char ); break; ++ IAVG(int, char); ++ break; + case VIPS_FORMAT_USHORT: +- IAVG( int, unsigned short ); break; +- case VIPS_FORMAT_SHORT: +- IAVG( int, short ); break; +- case VIPS_FORMAT_UINT: +- IAVG( double, unsigned int ); break; +- case VIPS_FORMAT_INT: +- IAVG( double, int ); break; +- case VIPS_FORMAT_FLOAT: +- FAVG( float ); break; +- case VIPS_FORMAT_DOUBLE: +- FAVG( double ); break; +- case VIPS_FORMAT_COMPLEX: +- FAVG( float ); break; +- case VIPS_FORMAT_DPCOMPLEX: +- FAVG( double ); break; ++ IAVG(int, unsigned short); ++ break; ++ case VIPS_FORMAT_SHORT: ++ IAVG(int, short); ++ break; ++ case VIPS_FORMAT_UINT: ++ IAVG(double, unsigned int); ++ break; ++ case VIPS_FORMAT_INT: ++ IAVG(double, int); ++ break; ++ case VIPS_FORMAT_FLOAT: ++ FAVG(float); ++ break; ++ case VIPS_FORMAT_DOUBLE: ++ FAVG(double); ++ break; ++ case VIPS_FORMAT_COMPLEX: ++ FAVG(float); ++ break; ++ case VIPS_FORMAT_DPCOMPLEX: ++ FAVG(double); ++ break; + + default: +- g_assert_not_reached(); ++ g_assert_not_reached(); + } + } + + static int +-vips_shrinkv_gen( VipsRegion *or, void *vseq, +- void *a, void *b, gboolean *stop ) ++vips_shrinkv_gen(VipsRegion * or, void *vseq, ++ void *a, void *b, gboolean *stop) + { + VipsShrinkvSequence *seq = (VipsShrinkvSequence *) vseq; + VipsShrinkv *shrink = (VipsShrinkv *) b; + VipsRegion *ir = seq->ir; +- VipsRect *r = &or->valid; ++ VipsRect *r = & or->valid; + + int y, y1; + + /* How do we chunk up the image? We don't want to prepare the whole of +- * the input region corresponding to *r since it could be huge. ++ * the input region corresponding to *r since it could be huge. + * +- * Request input a line at a time, average to a line buffer. ++ * Request input a line at a time, average to a line buffer. + */ + + #ifdef DEBUG +- printf( "vips_shrinkv_gen: generating %d x %d at %d x %d\n", +- r->width, r->height, r->left, r->top ); ++ printf("vips_shrinkv_gen: generating %d x %d at %d x %d\n", ++ r->width, r->height, r->left, r->top); + #endif /*DEBUG*/ + +- for( y = 0; y < r->height; y++ ) { +- memset( seq->sum, 0, shrink->sizeof_line_buffer ); ++ for (y = 0; y < r->height; y++) { ++ memset(seq->sum, 0, shrink->sizeof_line_buffer); + +- for( y1 = 0; y1 < shrink->vshrink; y1++ ) { ++ for (y1 = 0; y1 < shrink->vshrink; y1++) { + VipsRect s; + + s.left = r->left; +@@ -299,81 +320,81 @@ vips_shrinkv_gen( VipsRegion *or, void *vseq, + s.width = r->width; + s.height = 1; + #ifdef DEBUG +- printf( "shrink_gen: requesting line %d\n", s.top ); ++ printf("shrink_gen: requesting line %d\n", s.top); + #endif /*DEBUG*/ +- if( vips_region_prepare( ir, &s ) ) +- return( -1 ); ++ if (vips_region_prepare(ir, &s)) ++ return (-1); + +- VIPS_GATE_START( "vips_shrinkv_gen: work" ); ++ VIPS_GATE_START("vips_shrinkv_gen: work"); + +- vips_shrinkv_add_line( shrink, seq, ir, +- s.left, s.top, s.width ); ++ vips_shrinkv_add_line(shrink, seq, ir, ++ s.left, s.top, s.width); + +- VIPS_GATE_STOP( "vips_shrinkv_gen: work" ); ++ VIPS_GATE_STOP("vips_shrinkv_gen: work"); + } + +- VIPS_GATE_START( "vips_shrinkv_gen: work" ); ++ VIPS_GATE_START("vips_shrinkv_gen: work"); + +- vips_shrinkv_write_line( shrink, seq, or, +- r->left, r->top + y, r->width ); ++ vips_shrinkv_write_line(shrink, seq, or, ++ r->left, r->top + y, r->width); + +- VIPS_GATE_STOP( "vips_shrinkv_gen: work" ); ++ VIPS_GATE_STOP("vips_shrinkv_gen: work"); + } + +- VIPS_COUNT_PIXELS( or, "vips_shrinkv_gen" ); ++ VIPS_COUNT_PIXELS(or, "vips_shrinkv_gen"); + +- return( 0 ); ++ return (0); + } + + static int +-vips_shrinkv_build( VipsObject *object ) ++vips_shrinkv_build(VipsObject *object) + { +- VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object ); +- VipsResample *resample = VIPS_RESAMPLE( object ); ++ VipsObjectClass *class = VIPS_OBJECT_GET_CLASS(object); ++ VipsResample *resample = VIPS_RESAMPLE(object); + VipsShrinkv *shrink = (VipsShrinkv *) object; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( object, 4 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(object, 4); + + VipsImage *in; + +- if( VIPS_OBJECT_CLASS( vips_shrinkv_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_shrinkv_parent_class)->build(object)) ++ return (-1); + +- in = resample->in; ++ in = resample->in; + +- if( shrink->vshrink < 1 ) { +- vips_error( class->nickname, +- "%s", _( "shrink factors should be >= 1" ) ); +- return( -1 ); ++ if (shrink->vshrink < 1) { ++ vips_error(class->nickname, ++ "%s", _("shrink factors should be >= 1")); ++ return (-1); + } + +- if( shrink->vshrink == 1 ) +- return( vips_image_write( in, resample->out ) ); ++ if (shrink->vshrink == 1) ++ return (vips_image_write(in, resample->out)); + + /* Make the height a multiple of the shrink factor so we don't need to + * average half pixels. + */ +- if( vips_embed( in, &t[1], +- 0, 0, +- in->Xsize, VIPS_ROUND_UP( in->Ysize, shrink->vshrink ), +- "extend", VIPS_EXTEND_COPY, +- NULL ) ) +- return( -1 ); ++ if (vips_embed(in, &t[1], ++ 0, 0, ++ in->Xsize, VIPS_ROUND_UP(in->Ysize, shrink->vshrink), ++ "extend", VIPS_EXTEND_COPY, ++ NULL)) ++ return (-1); + in = t[1]; + + /* We have to keep a line buffer as we sum columns. + */ +- shrink->sizeof_line_buffer = +- in->Xsize * in->Bands * +- vips_format_sizeof( VIPS_FORMAT_DPCOMPLEX ); ++ shrink->sizeof_line_buffer = ++ in->Xsize * in->Bands * ++ vips_format_sizeof(VIPS_FORMAT_DPCOMPLEX); + + /* SMALLTILE or we'll need huge input areas for our output. In seq +- * mode, the linecache above will keep us sequential. ++ * mode, the linecache above will keep us sequential. + */ + t[2] = vips_image_new(); +- if( vips_image_pipelinev( t[2], +- VIPS_DEMAND_STYLE_SMALLTILE, in, NULL ) ) +- return( -1 ); ++ if (vips_image_pipelinev(t[2], ++ VIPS_DEMAND_STYLE_SMALLTILE, in, NULL)) ++ return (-1); + + /* Size output. + * +@@ -381,26 +402,23 @@ vips_shrinkv_build( VipsObject *object ) + * example, vipsthumbnail knows the true shrink factor (including the + * fractional part), we just see the integer part here. + */ +- t[2]->Ysize = shrink->ceil ? +- VIPS_CEIL( (double) resample->in->Ysize / shrink->vshrink ) : +- VIPS_ROUND_UINT( +- (double) resample->in->Ysize / shrink->vshrink ); +- if( t[2]->Ysize <= 0 ) { +- vips_error( class->nickname, +- "%s", _( "image has shrunk to nothing" ) ); +- return( -1 ); ++ t[2]->Ysize = shrink->ceil ? VIPS_CEIL((double) resample->in->Ysize / shrink->vshrink) : VIPS_ROUND_UINT((double) resample->in->Ysize / shrink->vshrink); ++ if (t[2]->Ysize <= 0) { ++ vips_error(class->nickname, ++ "%s", _("image has shrunk to nothing")); ++ return (-1); + } + + #ifdef DEBUG +- printf( "vips_shrinkv_build: shrinking %d x %d image to %d x %d\n", +- in->Xsize, in->Ysize, +- t[2]->Xsize, t[2]->Ysize ); ++ printf("vips_shrinkv_build: shrinking %d x %d image to %d x %d\n", ++ in->Xsize, in->Ysize, ++ t[2]->Xsize, t[2]->Ysize); + #endif /*DEBUG*/ + +- if( vips_image_generate( t[2], +- vips_shrinkv_start, vips_shrinkv_gen, vips_shrinkv_stop, +- in, shrink ) ) +- return( -1 ); ++ if (vips_image_generate(t[2], ++ vips_shrinkv_start, vips_shrinkv_gen, vips_shrinkv_stop, ++ in, shrink)) ++ return (-1); + + in = t[2]; + +@@ -412,69 +430,68 @@ vips_shrinkv_build( VipsObject *object ) + * + * To fix this, put another seq on the output of vshrink. Now we'll + * always have the previous XX lines of the shrunk image, and we won't +- * fetch out of order. ++ * fetch out of order. + */ +- if( vips_image_is_sequential( in ) ) { +- g_info( "shrinkv sequential line cache" ); ++ if (vips_image_is_sequential(in)) { ++ g_info("shrinkv sequential line cache"); + +- if( vips_sequential( in, &t[3], +- "tile_height", 10, +- NULL ) ) +- return( -1 ); ++ if (vips_sequential(in, &t[3], ++ "tile_height", 10, ++ NULL)) ++ return (-1); + in = t[3]; + } + +- if( vips_image_write( in, resample->out ) ) +- return( -1 ); ++ if (vips_image_write(in, resample->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_shrinkv_class_init( VipsShrinkvClass *class ) ++vips_shrinkv_class_init(VipsShrinkvClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + +- VIPS_DEBUG_MSG( "vips_shrinkv_class_init\n" ); ++ VIPS_DEBUG_MSG("vips_shrinkv_class_init\n"); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "shrinkv"; +- vobject_class->description = _( "shrink an image vertically" ); ++ vobject_class->description = _("shrink an image vertically"); + vobject_class->build = vips_shrinkv_build; + + operation_class->flags = VIPS_OPERATION_SEQUENTIAL; + +- VIPS_ARG_INT( class, "vshrink", 9, +- _( "Vshrink" ), +- _( "Vertical shrink factor" ), ++ VIPS_ARG_INT(class, "vshrink", 9, ++ _("Vshrink"), ++ _("Vertical shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsShrinkv, vshrink ), +- 1, 1000000, 1 ); ++ G_STRUCT_OFFSET(VipsShrinkv, vshrink), ++ 1, 1000000, 1); + +- VIPS_ARG_BOOL( class, "ceil", 10, +- _( "Ceil" ), +- _( "Round-up output dimensions" ), ++ VIPS_ARG_BOOL(class, "ceil", 10, ++ _("Ceil"), ++ _("Round-up output dimensions"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsShrinkv, ceil ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsShrinkv, ceil), ++ FALSE); + +- /* The old name .. now use h and v everywhere. ++ /* The old name .. now use h and v everywhere. + */ +- VIPS_ARG_INT( class, "yshrink", 8, +- _( "Yshrink" ), +- _( "Vertical shrink factor" ), ++ VIPS_ARG_INT(class, "yshrink", 8, ++ _("Yshrink"), ++ _("Vertical shrink factor"), + VIPS_ARGUMENT_REQUIRED_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsShrinkv, vshrink ), +- 1, 1000000, 1 ); +- ++ G_STRUCT_OFFSET(VipsShrinkv, vshrink), ++ 1, 1000000, 1); + } + + static void +-vips_shrinkv_init( VipsShrinkv *shrink ) ++vips_shrinkv_init(VipsShrinkv *shrink) + { + } + +@@ -490,27 +507,27 @@ vips_shrinkv_init( VipsShrinkv *shrink ) + * * @ceil: round-up output dimensions + * + * Shrink @in vertically by an integer factor. Each pixel in the output is +- * the average of the corresponding column of @vshrink pixels in the input. ++ * the average of the corresponding column of @vshrink pixels in the input. + * + * This is a very low-level operation: see vips_resize() for a more +- * convenient way to resize images. ++ * convenient way to resize images. + * + * This operation does not change xres or yres. The image resolution needs to +- * be updated by the application. ++ * be updated by the application. + * + * See also: vips_shrinkh(), vips_shrink(), vips_resize(), vips_affine(). + * + * Returns: 0 on success, -1 on error + */ + int +-vips_shrinkv( VipsImage *in, VipsImage **out, int vshrink, ... ) ++vips_shrinkv(VipsImage *in, VipsImage **out, int vshrink, ...) + { + va_list ap; + int result; + +- va_start( ap, vshrink ); +- result = vips_call_split( "shrinkv", ap, in, out, vshrink ); +- va_end( ap ); ++ va_start(ap, vshrink); ++ result = vips_call_split("shrinkv", ap, in, out, vshrink); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/resample/similarity.c b/libvips/resample/similarity.c +index 9a44b76c02..885404d6d3 100644 +--- a/libvips/resample/similarity.c ++++ b/libvips/resample/similarity.c +@@ -19,28 +19,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -76,146 +76,143 @@ typedef struct _VipsSimilarityBase { + + typedef VipsResampleClass VipsSimilarityBaseClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsSimilarityBase, vips_similarity_base, +- VIPS_TYPE_RESAMPLE ); ++G_DEFINE_ABSTRACT_TYPE(VipsSimilarityBase, vips_similarity_base, ++ VIPS_TYPE_RESAMPLE); + + static int +-vips_similarity_base_build( VipsObject *object ) ++vips_similarity_base_build(VipsObject *object) + { +- VipsResample *resample = VIPS_RESAMPLE( object ); ++ VipsResample *resample = VIPS_RESAMPLE(object); + VipsSimilarityBase *base = (VipsSimilarityBase *) object; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( object, 4 ); +- double a = base->scale * cos( VIPS_RAD( base->angle ) ); +- double b = base->scale * -sin( VIPS_RAD( base->angle ) ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(object, 4); ++ double a = base->scale * cos(VIPS_RAD(base->angle)); ++ double b = base->scale * -sin(VIPS_RAD(base->angle)); + double c = -b; + double d = a; + +- if( VIPS_OBJECT_CLASS( vips_similarity_base_parent_class )-> +- build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_similarity_base_parent_class)->build(object)) ++ return (-1); + +- if( vips_affine( resample->in, &t[0], a, b, c, d, +- "interpolate", base->interpolate, +- "odx", base->odx, +- "ody", base->ody, +- "idx", base->idx, +- "idy", base->idy, +- "background", base->background, +- NULL ) ) +- return( -1 ); ++ if (vips_affine(resample->in, &t[0], a, b, c, d, ++ "interpolate", base->interpolate, ++ "odx", base->odx, ++ "ody", base->ody, ++ "idx", base->idx, ++ "idy", base->idy, ++ "background", base->background, ++ NULL)) ++ return (-1); + +- if( vips_image_write( t[0], resample->out ) ) +- return( -1 ); ++ if (vips_image_write(t[0], resample->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_similarity_base_class_init( VipsSimilarityBaseClass *class ) ++vips_similarity_base_class_init(VipsSimilarityBaseClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "similarity_base"; +- vobject_class->description = _( "base similarity transform" ); ++ vobject_class->description = _("base similarity transform"); + vobject_class->build = vips_similarity_base_build; + +- VIPS_ARG_INTERPOLATE( class, "interpolate", 5, +- _( "Interpolate" ), +- _( "Interpolate pixels with this" ), +- VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSimilarityBase, interpolate ) ); +- +- VIPS_ARG_BOXED( class, "background", 6, +- _( "Background" ), +- _( "Background value" ), ++ VIPS_ARG_INTERPOLATE(class, "interpolate", 5, ++ _("Interpolate"), ++ _("Interpolate pixels with this"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSimilarityBase, background ), +- VIPS_TYPE_ARRAY_DOUBLE ); ++ G_STRUCT_OFFSET(VipsSimilarityBase, interpolate)); + +- VIPS_ARG_DOUBLE( class, "odx", 112, +- _( "Output offset" ), +- _( "Horizontal output displacement" ), ++ VIPS_ARG_BOXED(class, "background", 6, ++ _("Background"), ++ _("Background value"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSimilarityBase, odx ), +- -10000000, 10000000, 0 ); ++ G_STRUCT_OFFSET(VipsSimilarityBase, background), ++ VIPS_TYPE_ARRAY_DOUBLE); + +- VIPS_ARG_DOUBLE( class, "ody", 113, +- _( "Output offset" ), +- _( "Vertical output displacement" ), ++ VIPS_ARG_DOUBLE(class, "odx", 112, ++ _("Output offset"), ++ _("Horizontal output displacement"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSimilarityBase, ody ), +- -10000000, 10000000, 0 ); ++ G_STRUCT_OFFSET(VipsSimilarityBase, odx), ++ -10000000, 10000000, 0); + +- VIPS_ARG_DOUBLE( class, "idx", 114, +- _( "Input offset" ), +- _( "Horizontal input displacement" ), ++ VIPS_ARG_DOUBLE(class, "ody", 113, ++ _("Output offset"), ++ _("Vertical output displacement"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSimilarityBase, idx ), +- -10000000, 10000000, 0 ); ++ G_STRUCT_OFFSET(VipsSimilarityBase, ody), ++ -10000000, 10000000, 0); + +- VIPS_ARG_DOUBLE( class, "idy", 115, +- _( "Input offset" ), +- _( "Vertical input displacement" ), ++ VIPS_ARG_DOUBLE(class, "idx", 114, ++ _("Input offset"), ++ _("Horizontal input displacement"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSimilarityBase, idy ), +- -10000000, 10000000, 0 ); ++ G_STRUCT_OFFSET(VipsSimilarityBase, idx), ++ -10000000, 10000000, 0); + ++ VIPS_ARG_DOUBLE(class, "idy", 115, ++ _("Input offset"), ++ _("Vertical input displacement"), ++ VIPS_ARGUMENT_OPTIONAL_INPUT, ++ G_STRUCT_OFFSET(VipsSimilarityBase, idy), ++ -10000000, 10000000, 0); + } + + static void +-vips_similarity_base_init( VipsSimilarityBase *base ) ++vips_similarity_base_init(VipsSimilarityBase *base) + { +- base->scale = 1; +- base->angle = 0; +- base->interpolate = NULL; +- base->odx = 0; +- base->ody = 0; +- base->idx = 0; +- base->idy = 0; +- base->background = vips_array_double_newv( 1, 0.0 ); ++ base->scale = 1; ++ base->angle = 0; ++ base->interpolate = NULL; ++ base->odx = 0; ++ base->ody = 0; ++ base->idx = 0; ++ base->idy = 0; ++ base->background = vips_array_double_newv(1, 0.0); + } + + typedef VipsSimilarityBase VipsSimilarity; + typedef VipsSimilarityBaseClass VipsSimilarityClass; + +-G_DEFINE_TYPE( VipsSimilarity, vips_similarity, +- vips_similarity_base_get_type() ); ++G_DEFINE_TYPE(VipsSimilarity, vips_similarity, ++ vips_similarity_base_get_type()); + + static void +-vips_similarity_class_init( VipsSimilarityClass *class ) ++vips_similarity_class_init(VipsSimilarityClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "similarity"; +- vobject_class->description = _( "similarity transform of an image" ); ++ vobject_class->description = _("similarity transform of an image"); + +- VIPS_ARG_DOUBLE( class, "scale", 3, +- _( "Scale" ), +- _( "Scale by this factor" ), ++ VIPS_ARG_DOUBLE(class, "scale", 3, ++ _("Scale"), ++ _("Scale by this factor"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSimilarity, scale ), +- 0, 10000000, 1 ); ++ G_STRUCT_OFFSET(VipsSimilarity, scale), ++ 0, 10000000, 1); + +- VIPS_ARG_DOUBLE( class, "angle", 4, +- _( "Angle" ), +- _( "Rotate anticlockwise by this many degrees" ), ++ VIPS_ARG_DOUBLE(class, "angle", 4, ++ _("Angle"), ++ _("Rotate anticlockwise by this many degrees"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsSimilarity, angle ), +- -10000000, 10000000, 0 ); +- ++ G_STRUCT_OFFSET(VipsSimilarity, angle), ++ -10000000, 10000000, 0); + } + + static void +-vips_similarity_init( VipsSimilarity *similarity ) ++vips_similarity_init(VipsSimilarity *similarity) + { + } + +@@ -230,7 +227,7 @@ vips_similarity_init( VipsSimilarity *similarity ) + * * @scale: %gdouble, scale by this factor + * * @angle: %gdouble, rotate by this many degrees clockwise + * * @interpolate: #VipsInterpolate, interpolate pixels with this +- * * @background: #VipsArrayDouble colour for new pixels ++ * * @background: #VipsArrayDouble colour for new pixels + * * @idx: %gdouble, input horizontal offset + * * @idy: %gdouble, input vertical offset + * * @odx: %gdouble, output horizontal offset +@@ -239,54 +236,53 @@ vips_similarity_init( VipsSimilarity *similarity ) + * + * This operator calls vips_affine() for you, calculating the matrix for the + * affine transform from @scale and @angle. Other parameters are passed on to +- * vips_affine() unaltered. ++ * vips_affine() unaltered. + * + * See also: vips_affine(), #VipsInterpolate. + * + * Returns: 0 on success, -1 on error + */ + int +-vips_similarity( VipsImage *in, VipsImage **out, ... ) ++vips_similarity(VipsImage *in, VipsImage **out, ...) + { + va_list ap; + int result; + +- va_start( ap, out ); +- result = vips_call_split( "similarity", ap, in, out ); +- va_end( ap ); ++ va_start(ap, out); ++ result = vips_call_split("similarity", ap, in, out); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + typedef VipsSimilarityBase VipsRotate; + typedef VipsSimilarityBaseClass VipsRotateClass; + +-G_DEFINE_TYPE( VipsRotate, vips_rotate, vips_similarity_base_get_type() ); ++G_DEFINE_TYPE(VipsRotate, vips_rotate, vips_similarity_base_get_type()); + + static void +-vips_rotate_class_init( VipsRotateClass *class ) ++vips_rotate_class_init(VipsRotateClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "rotate"; +- vobject_class->description = +- _( "rotate an image by a number of degrees" ); ++ vobject_class->description = ++ _("rotate an image by a number of degrees"); + +- VIPS_ARG_DOUBLE( class, "angle", 4, +- _( "Angle" ), +- _( "Rotate anticlockwise by this many degrees" ), ++ VIPS_ARG_DOUBLE(class, "angle", 4, ++ _("Angle"), ++ _("Rotate anticlockwise by this many degrees"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsSimilarity, angle ), +- -10000000, 10000000, 0 ); +- ++ G_STRUCT_OFFSET(VipsSimilarity, angle), ++ -10000000, 10000000, 0); + } + + static void +-vips_rotate_init( VipsRotate *rotate ) ++vips_rotate_init(VipsRotate *rotate) + { + } + +@@ -300,7 +296,7 @@ vips_rotate_init( VipsRotate *rotate ) + * Optional arguments: + * + * * @interpolate: #VipsInterpolate, interpolate pixels with this +- * * @background: #VipsArrayDouble colour for new pixels ++ * * @background: #VipsArrayDouble colour for new pixels + * * @idx: %gdouble, input horizontal offset + * * @idy: %gdouble, input vertical offset + * * @odx: %gdouble, output horizontal offset +@@ -309,21 +305,21 @@ vips_rotate_init( VipsRotate *rotate ) + * + * This operator calls vips_affine() for you, calculating the matrix for the + * affine transform from @scale and @angle. Other parameters are passed on to +- * vips_affine() unaltered. ++ * vips_affine() unaltered. + * + * See also: vips_affine(), #VipsInterpolate. + * + * Returns: 0 on success, -1 on error + */ + int +-vips_rotate( VipsImage *in, VipsImage **out, double angle, ... ) ++vips_rotate(VipsImage *in, VipsImage **out, double angle, ...) + { + va_list ap; + int result; + +- va_start( ap, angle ); +- result = vips_call_split( "rotate", ap, in, out, angle ); +- va_end( ap ); ++ va_start(ap, angle); ++ result = vips_call_split("rotate", ap, in, out, angle); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/resample/templates.h b/libvips/resample/templates.h +index d60144ba1e..585b5fb742 100644 +--- a/libvips/resample/templates.h ++++ b/libvips/resample/templates.h +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -32,30 +32,30 @@ + * Various casts which assume that the data is already in range. (That + * is, they are to be used with monotone samplers.) + */ +-template static T inline +-to_fptypes( const double val ) ++template ++static T inline to_fptypes(const double val) + { + const T newval = val; + +- return( newval ); ++ return (newval); + } + +-template static T inline +-to_withsign( const double val ) ++template ++static T inline to_withsign(const double val) + { +- const int sign_of_val = 2 * ( val >= 0. ) - 1; ++ const int sign_of_val = 2 * (val >= 0.) - 1; + const int rounded_abs_val = .5 + sign_of_val * val; + const T newval = sign_of_val * rounded_abs_val; + +- return( newval ); ++ return (newval); + } + +-template static T inline +-to_nosign( const double val ) ++template ++static T inline to_nosign(const double val) + { + const T newval = .5 + val; + +- return( newval ); ++ return (newval); + } + + /* +@@ -69,8 +69,8 @@ to_nosign( const double val ) + * inputs are weights, the last four are the corresponding pixel + * values: + */ +-template static T inline +-bilinear_fptypes( ++template ++static T inline bilinear_fptypes( + const double w_times_z, + const double x_times_z, + const double w_times_y, +@@ -78,7 +78,7 @@ bilinear_fptypes( + const double tre_thr, + const double tre_thrfou, + const double trequa_thr, +- const double trequa_thrfou ) ++ const double trequa_thrfou) + { + const T newval = + w_times_z * tre_thr + +@@ -86,14 +86,14 @@ bilinear_fptypes( + w_times_y * trequa_thr + + x_times_y * trequa_thrfou; + +- return( newval ); ++ return (newval); + } + + /* + * Bilinear interpolation for signed integer types: + */ +-template static T inline +-bilinear_withsign( ++template ++static T inline bilinear_withsign( + const double w_times_z, + const double x_times_z, + const double w_times_y, +@@ -101,7 +101,7 @@ bilinear_withsign( + const double tre_thr, + const double tre_thrfou, + const double trequa_thr, +- const double trequa_thrfou ) ++ const double trequa_thrfou) + { + const double val = + w_times_z * tre_thr + +@@ -109,20 +109,20 @@ bilinear_withsign( + w_times_y * trequa_thr + + x_times_y * trequa_thrfou; + +- const int sign_of_val = 2 * ( val >= 0. ) - 1; ++ const int sign_of_val = 2 * (val >= 0.) - 1; + + const int rounded_abs_val = .5 + sign_of_val * val; + + const T newval = sign_of_val * rounded_abs_val; + +- return( newval ); ++ return (newval); + } + + /* + * Bilinear Interpolation for unsigned integer types: + */ +-template static T inline +-bilinear_nosign( ++template ++static T inline bilinear_nosign( + const double w_times_z, + const double x_times_z, + const double w_times_y, +@@ -130,7 +130,7 @@ bilinear_nosign( + const double tre_thr, + const double tre_thrfou, + const double trequa_thr, +- const double trequa_thrfou ) ++ const double trequa_thrfou) + { + const T newval = + w_times_z * tre_thr + +@@ -139,171 +139,168 @@ bilinear_nosign( + x_times_y * trequa_thrfou + + 0.5; + +- return( newval ); ++ return (newval); + } + + /* + * Bicubic (Catmull-Rom) interpolation templates: + */ + +-static int inline +-unsigned_fixed_round( int v ) ++static int inline unsigned_fixed_round(int v) + { + const int round_by = VIPS_INTERPOLATE_SCALE >> 1; + +- return( (v + round_by) >> VIPS_INTERPOLATE_SHIFT ); ++ return ((v + round_by) >> VIPS_INTERPOLATE_SHIFT); + } + + /* Fixed-point integer bicubic, used for 8-bit types. + */ +-template static int inline +-bicubic_unsigned_int( ++template ++static int inline bicubic_unsigned_int( + const T uno_one, const T uno_two, const T uno_thr, const T uno_fou, + const T dos_one, const T dos_two, const T dos_thr, const T dos_fou, + const T tre_one, const T tre_two, const T tre_thr, const T tre_fou, + const T qua_one, const T qua_two, const T qua_thr, const T qua_fou, +- const int* restrict cx, const int* restrict cy ) ++ const int *restrict cx, const int *restrict cy) + { + const int c0 = cx[0]; + const int c1 = cx[1]; + const int c2 = cx[2]; + const int c3 = cx[3]; + +- const int r0 = unsigned_fixed_round( ++ const int r0 = unsigned_fixed_round( + c0 * uno_one + + c1 * uno_two + + c2 * uno_thr + +- c3 * uno_fou ); +- const int r1 = unsigned_fixed_round( ++ c3 * uno_fou); ++ const int r1 = unsigned_fixed_round( + c0 * dos_one + + c1 * dos_two + + c2 * dos_thr + +- c3 * dos_fou ); +- const int r2 = unsigned_fixed_round( ++ c3 * dos_fou); ++ const int r2 = unsigned_fixed_round( + c0 * tre_one + + c1 * tre_two + + c2 * tre_thr + +- c3 * tre_fou ); +- const int r3 = unsigned_fixed_round( ++ c3 * tre_fou); ++ const int r3 = unsigned_fixed_round( + c0 * qua_one + + c1 * qua_two + + c2 * qua_thr + +- c3 * qua_fou ); ++ c3 * qua_fou); + +- return( unsigned_fixed_round( ++ return (unsigned_fixed_round( + cy[0] * r0 + + cy[1] * r1 + + cy[2] * r2 + +- cy[3] * r3 ) ); ++ cy[3] * r3)); + } + +-static int inline +-signed_fixed_round( int v ) ++static int inline signed_fixed_round(int v) + { + const int sign_of_v = 2 * (v > 0) - 1; + const int round_by = sign_of_v * (VIPS_INTERPOLATE_SCALE >> 1); + +- return( (v + round_by) >> VIPS_INTERPOLATE_SHIFT ); ++ return ((v + round_by) >> VIPS_INTERPOLATE_SHIFT); + } + + /* Fixed-point integer bicubic, used for 8-bit types. + */ +-template static int inline +-bicubic_signed_int( ++template ++static int inline bicubic_signed_int( + const T uno_one, const T uno_two, const T uno_thr, const T uno_fou, + const T dos_one, const T dos_two, const T dos_thr, const T dos_fou, + const T tre_one, const T tre_two, const T tre_thr, const T tre_fou, + const T qua_one, const T qua_two, const T qua_thr, const T qua_fou, +- const int* restrict cx, const int* restrict cy ) ++ const int *restrict cx, const int *restrict cy) + { + const int c0 = cx[0]; + const int c1 = cx[1]; + const int c2 = cx[2]; + const int c3 = cx[3]; + +- const int r0 = signed_fixed_round( ++ const int r0 = signed_fixed_round( + c0 * uno_one + + c1 * uno_two + + c2 * uno_thr + +- c3 * uno_fou ); +- const int r1 = signed_fixed_round( ++ c3 * uno_fou); ++ const int r1 = signed_fixed_round( + c0 * dos_one + + c1 * dos_two + + c2 * dos_thr + +- c3 * dos_fou ); +- const int r2 = signed_fixed_round( ++ c3 * dos_fou); ++ const int r2 = signed_fixed_round( + c0 * tre_one + + c1 * tre_two + + c2 * tre_thr + +- c3 * tre_fou ); +- const int r3 = signed_fixed_round( ++ c3 * tre_fou); ++ const int r3 = signed_fixed_round( + c0 * qua_one + + c1 * qua_two + + c2 * qua_thr + +- c3 * qua_fou ); ++ c3 * qua_fou); + +- return( signed_fixed_round( ++ return (signed_fixed_round( + cy[0] * r0 + + cy[1] * r1 + + cy[2] * r2 + +- cy[3] * r3 ) ); ++ cy[3] * r3)); + } + +-template static T inline +-cubic_float( ++template ++static T inline cubic_float( + const T one, const T two, const T thr, const T fou, +- const double* restrict cx ) ++ const double *restrict cx) + { +- return( cx[0] * one + +- cx[1] * two + +- cx[2] * thr + +- cx[3] * fou ); ++ return (cx[0] * one + ++ cx[1] * two + ++ cx[2] * thr + ++ cx[3] * fou); + } + + /* Floating-point bicubic, used for int/float/double types. + */ +-template static T inline +-bicubic_float( ++template ++static T inline bicubic_float( + const T uno_one, const T uno_two, const T uno_thr, const T uno_fou, + const T dos_one, const T dos_two, const T dos_thr, const T dos_fou, + const T tre_one, const T tre_two, const T tre_thr, const T tre_fou, + const T qua_one, const T qua_two, const T qua_thr, const T qua_fou, +- const double* restrict cx, const double* restrict cy ) ++ const double *restrict cx, const double *restrict cy) + { +- const double r0 = cubic_float( +- uno_one, uno_two, uno_thr, uno_fou, cx ); +- const double r1 = cubic_float( +- dos_one, dos_two, dos_thr, dos_fou, cx ); +- const double r2 = cubic_float( +- tre_one, tre_two, tre_thr, tre_fou, cx ); +- const double r3 = cubic_float( +- qua_one, qua_two, qua_thr, qua_fou, cx ); +- +- return( cubic_float( r0, r1, r2, r3, cy ) ); ++ const double r0 = cubic_float( ++ uno_one, uno_two, uno_thr, uno_fou, cx); ++ const double r1 = cubic_float( ++ dos_one, dos_two, dos_thr, dos_fou, cx); ++ const double r2 = cubic_float( ++ tre_one, tre_two, tre_thr, tre_fou, cx); ++ const double r3 = cubic_float( ++ qua_one, qua_two, qua_thr, qua_fou, cx); ++ ++ return (cubic_float(r0, r1, r2, r3, cy)); + } + + /* Given an offset in [0,1] (we can have x == 1 when building tables), + * calculate c0, c1, c2, c3, the catmull-rom coefficients. This is called + * from the interpolator as well as from the table builder. + */ +-static void inline +-calculate_coefficients_catmull( double c[4], const double x ) ++static void inline calculate_coefficients_catmull(double c[4], const double x) + { + /* Nicolas believes that the following is an hitherto unknown + * hyper-efficient method of computing Catmull-Rom coefficients. It + * only uses 4* & 1+ & 5- for a total of only 10 flops to compute + * four coefficients. + */ +- const double cr1 = 1. - x; +- const double cr2 = -.5 * x; +- const double cr3 = cr1 * cr2; ++ const double cr1 = 1. - x; ++ const double cr2 = -.5 * x; ++ const double cr3 = cr1 * cr2; + const double cone = cr1 * cr3; + const double cfou = x * cr3; +- const double cr4 = cfou - cone; ++ const double cr4 = cfou - cone; + const double ctwo = cr1 - cone + cr4; + const double cthr = x - cfou - cr4; + +- g_assert( x >= 0. && x <= 1. ); ++ g_assert(x >= 0. && x <= 1.); + + c[0] = cone; + c[3] = cfou; +@@ -315,82 +312,82 @@ calculate_coefficients_catmull( double c[4], const double x ) + * calculate c0 .. c(@shrink + 1), the triangle coefficients. This is called + * from the interpolator as well as from the table builder. + */ +-static void inline +-calculate_coefficients_triangle( double *c, +- const double shrink, const double x ) ++static void inline calculate_coefficients_triangle(double *c, ++ const double shrink, const double x) + { + /* Needs to be in sync with vips_reduce_get_points(). + */ +- const int n_points = 2 * rint( shrink ) + 1; ++ const int n_points = 2 * rint(shrink) + 1; + const double half = x + n_points / 2.0 - 1; + + int i; +- double sum; ++ double sum; + + sum = 0; +- for( i = 0; i < n_points; i++ ) { ++ for (i = 0; i < n_points; i++) { + const double xp = (i - half) / shrink; + + double l; + +- l = 1.0 - VIPS_FABS( xp ); +- l = VIPS_MAX( 0.0, l ); ++ l = 1.0 - VIPS_FABS(xp); ++ l = VIPS_MAX(0.0, l); + + c[i] = l; + sum += l; + } + +- for( i = 0; i < n_points; i++ ) ++ for (i = 0; i < n_points; i++) + c[i] /= sum; + } + + /* Generate a cubic filter. See: + * +- * Mitchell and Netravali, Reconstruction Filters in Computer Graphics ++ * Mitchell and Netravali, Reconstruction Filters in Computer Graphics + * Computer Graphics, Volume 22, Number 4, August 1988. + * + * B = 1, C = 0 - cubic B-spline + * B = 1/3, C = 1/3 - Mitchell + * B = 0, C = 1/2 - Catmull-Rom spline + */ +-static void inline +-calculate_coefficients_cubic( double *c, +- const double shrink, const double x, double B, double C ) ++static void inline calculate_coefficients_cubic(double *c, ++ const double shrink, const double x, double B, double C) + { + /* Needs to be in sync with vips_reduce_get_points(). + */ +- const int n_points = 2 * rint( 2 * shrink ) + 1; ++ const int n_points = 2 * rint(2 * shrink) + 1; + const double half = x + n_points / 2.0 - 1; + + int i; +- double sum; ++ double sum; + + sum = 0; +- for( i = 0; i < n_points; i++ ) { ++ for (i = 0; i < n_points; i++) { + const double xp = (i - half) / shrink; +- const double axp = VIPS_FABS( xp ); ++ const double axp = VIPS_FABS(xp); + const double axp2 = axp * axp; + const double axp3 = axp2 * axp; + + double l; + +- if( axp <= 1 ) ++ if (axp <= 1) + l = ((12 - 9 * B - 6 * C) * axp3 + +- (-18 + 12 * B + 6 * C) * axp2 + +- (6 - 2 * B)) / 6; +- else if( axp <= 2 ) ++ (-18 + 12 * B + 6 * C) * axp2 + ++ (6 - 2 * B)) / ++ 6; ++ else if (axp <= 2) + l = ((-B - 6 * C) * axp3 + +- (6 * B + 30 * C) * axp2 + +- (-12 * B - 48 * C) * axp + +- (8 * B + 24 * C)) / 6; +- else ++ (6 * B + 30 * C) * axp2 + ++ (-12 * B - 48 * C) * axp + ++ (8 * B + 24 * C)) / ++ 6; ++ else + l = 0.0; + + c[i] = l; + sum += l; + } + +- for( i = 0; i < n_points; i++ ) ++ for (i = 0; i < n_points; i++) + c[i] /= sum; + } + +@@ -400,59 +397,58 @@ calculate_coefficients_cubic( double *c, + * + * @a is the number of lobes, so usually 2 or 3. @shrink is the reduction + * factor, so 1 for interpolation, 2 for a x2 reduction, etc. We need more +- * points for large decimations to avoid aliasing. ++ * points for large decimations to avoid aliasing. + */ +-static void inline +-calculate_coefficients_lanczos( double *c, +- const int a, const double shrink, const double x ) ++static void inline calculate_coefficients_lanczos(double *c, ++ const int a, const double shrink, const double x) + { + /* Needs to be in sync with vips_reduce_get_points(). + */ +- const int n_points = 2 * rint( a * shrink ) + 1; ++ const int n_points = 2 * rint(a * shrink) + 1; + const double half = x + n_points / 2.0 - 1; + + int i; +- double sum; ++ double sum; + + sum = 0; +- for( i = 0; i < n_points; i++ ) { ++ for (i = 0; i < n_points; i++) { + const double xp = (i - half) / shrink; + + double l; + +- if( xp == 0.0 ) ++ if (xp == 0.0) + l = 1.0; +- else if( xp < -a ) ++ else if (xp < -a) + l = 0.0; +- else if( xp > a ) ++ else if (xp > a) + l = 0.0; + else +- l = (double) a * sin( VIPS_PI * xp ) * +- sin( VIPS_PI * xp / (double) a ) / ++ l = (double) a * sin(VIPS_PI * xp) * ++ sin(VIPS_PI * xp / (double) a) / + (VIPS_PI * VIPS_PI * xp * xp); + + c[i] = l; + sum += l; + } + +- for( i = 0; i < n_points; i++ ) ++ for (i = 0; i < n_points; i++) + c[i] /= sum; + } + +-/* Our inner loop for resampling with a convolution. Operate on elements of ++/* Our inner loop for resampling with a convolution. Operate on elements of + * type T, gather results in an intermediate of type IT. + */ + template + static IT +-reduce_sum( const T * restrict in, int stride, const IT * restrict c, int n ) ++reduce_sum(const T *restrict in, int stride, const IT *restrict c, int n) + { + IT sum; + +- sum = 0; +- for( int i = 0; i < n; i++ ) { ++ sum = 0; ++ for (int i = 0; i < n; i++) { + sum += c[i] * in[0]; + in += stride; + } + +- return( sum ); ++ return (sum); + } +diff --git a/libvips/resample/thumbnail.c b/libvips/resample/thumbnail.c +index a029395735..43dd73ada9 100644 +--- a/libvips/resample/thumbnail.c ++++ b/libvips/resample/thumbnail.c +@@ -15,7 +15,7 @@ + * - deprecate auto_rotate, add no_rotate + * - implement shrink-on-load for openslide images + * 16/11/18 +- * - implement shrink-on-load for tiff pyramid ++ * - implement shrink-on-load for tiff pyramid + * 3/2/19 kleisauke + * - add option_string param to thumbnail_buffer + * 23/4/19 +@@ -41,28 +41,28 @@ + + /* + +- Copyright (C) 1991-2005 The National Gallery ++ Copyright (C) 1991-2005 The National Gallery + +- This library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. + +- This library is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this library; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -83,18 +83,18 @@ + #include + + #define VIPS_TYPE_THUMBNAIL (vips_thumbnail_get_type()) +-#define VIPS_THUMBNAIL( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), VIPS_TYPE_THUMBNAIL, VipsThumbnail )) +-#define VIPS_THUMBNAIL_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ ++#define VIPS_THUMBNAIL(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), VIPS_TYPE_THUMBNAIL, VipsThumbnail)) ++#define VIPS_THUMBNAIL_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_THUMBNAIL, VipsThumbnailClass)) ++#define VIPS_IS_THUMBNAIL(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_THUMBNAIL)) ++#define VIPS_IS_THUMBNAIL_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_THUMBNAIL)) ++#define VIPS_THUMBNAIL_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ + VIPS_TYPE_THUMBNAIL, VipsThumbnailClass)) +-#define VIPS_IS_THUMBNAIL( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_THUMBNAIL )) +-#define VIPS_IS_THUMBNAIL_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_THUMBNAIL )) +-#define VIPS_THUMBNAIL_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_THUMBNAIL, VipsThumbnailClass )) + + /* Should be plenty. + */ +@@ -120,15 +120,15 @@ typedef struct _VipsThumbnail { + /* Bits of info we read from the input image when we get the header of + * the original. + */ +- const char *loader; /* Eg. "VipsForeignLoadJpeg*" */ ++ const char *loader; /* Eg. "VipsForeignLoadJpeg*" */ + int input_width; + int input_height; + int page_height; +- int orientation; /* From vips_image_get_orientation() */ +- gboolean swap; /* If we must swap width / height */ +- int n_pages; /* Pages in file */ +- int n_loaded_pages; /* Pages we've loaded from file */ +- int n_subifds; /* Number of subifds */ ++ int orientation; /* From vips_image_get_orientation() */ ++ gboolean swap; /* If we must swap width / height */ ++ int n_pages; /* Pages in file */ ++ int n_loaded_pages; /* Pages we've loaded from file */ ++ int n_subifds; /* Number of subifds */ + + /* For pyramidal formats, we need to read out the size of each level. + */ +@@ -156,147 +156,147 @@ typedef struct _VipsThumbnailClass { + + /* Fill out the info section of VipsThumbnail from the input object. + */ +- int (*get_info)( VipsThumbnail *thumbnail ); ++ int (*get_info)(VipsThumbnail *thumbnail); + +- /* Open with some kind of shrink or scale factor. Exactly what we pass ++ /* Open with some kind of shrink or scale factor. Exactly what we pass + * and to what param depends on the loader. It'll be an integer shrink + * factor for vips_jpegload(), a double scale factor for vips_svgload(). + * + * See VipsThumbnail::loader + */ +- VipsImage *(*open)( VipsThumbnail *thumbnail, double factor ); ++ VipsImage *(*open)(VipsThumbnail *thumbnail, double factor); + + } VipsThumbnailClass; + +-G_DEFINE_ABSTRACT_TYPE( VipsThumbnail, vips_thumbnail, VIPS_TYPE_OPERATION ); ++G_DEFINE_ABSTRACT_TYPE(VipsThumbnail, vips_thumbnail, VIPS_TYPE_OPERATION); + + static void +-vips_thumbnail_dispose( GObject *gobject ) ++vips_thumbnail_dispose(GObject *gobject) + { + #ifdef DEBUG +- printf( "vips_thumbnail_dispose: " ); +- vips_object_print_name( VIPS_OBJECT( gobject ) ); +- printf( "\n" ); ++ printf("vips_thumbnail_dispose: "); ++ vips_object_print_name(VIPS_OBJECT(gobject)); ++ printf("\n"); + #endif /*DEBUG*/ + +- G_OBJECT_CLASS( vips_thumbnail_parent_class )->dispose( gobject ); ++ G_OBJECT_CLASS(vips_thumbnail_parent_class)->dispose(gobject); + } + + static void +-vips_thumbnail_finalize( GObject *gobject ) ++vips_thumbnail_finalize(GObject *gobject) + { + #ifdef DEBUG +- printf( "vips_thumbnail_finalize: " ); +- vips_object_print_name( VIPS_OBJECT( gobject ) ); +- printf( "\n" ); ++ printf("vips_thumbnail_finalize: "); ++ vips_object_print_name(VIPS_OBJECT(gobject)); ++ printf("\n"); + #endif /*DEBUG*/ + +- G_OBJECT_CLASS( vips_thumbnail_parent_class )->finalize( gobject ); ++ G_OBJECT_CLASS(vips_thumbnail_parent_class)->finalize(gobject); + } + + /* Fetch an int openslide field from metadata. These are all represented as + * strings. Return the default value if there's any problem. + */ + static int +-get_int( VipsImage *image, const char *field, int default_value ) ++get_int(VipsImage *image, const char *field, int default_value) + { + const char *str; + +- if( vips_image_get_typeof( image, field ) && +- !vips_image_get_string( image, field, &str ) ) +- return( atoi( str ) ); ++ if (vips_image_get_typeof(image, field) && ++ !vips_image_get_string(image, field, &str)) ++ return (atoi(str)); + +- return( default_value ); ++ return (default_value); + } + + static void +-vips_thumbnail_read_header( VipsThumbnail *thumbnail, VipsImage *image ) ++vips_thumbnail_read_header(VipsThumbnail *thumbnail, VipsImage *image) + { + thumbnail->input_width = image->Xsize; + thumbnail->input_height = image->Ysize; +- thumbnail->orientation = vips_image_get_orientation( image ); +- thumbnail->swap = vips_image_get_orientation_swap( image ); +- thumbnail->page_height = vips_image_get_page_height( image ); +- thumbnail->n_pages = vips_image_get_n_pages( image ); +- thumbnail->n_subifds = vips_image_get_n_subifds( image ); ++ thumbnail->orientation = vips_image_get_orientation(image); ++ thumbnail->swap = vips_image_get_orientation_swap(image); ++ thumbnail->page_height = vips_image_get_page_height(image); ++ thumbnail->n_pages = vips_image_get_n_pages(image); ++ thumbnail->n_subifds = vips_image_get_n_subifds(image); + +- /* VIPS_META_N_PAGES is the number of pages in the document, ++ /* VIPS_META_N_PAGES is the number of pages in the document, + * not the number we've read out into this image. We calculate +- * ourselves from page_height. ++ * ourselves from page_height. + * + * vips_image_get_page_height() has verified that Ysize is a simple + * multiple of page_height. + */ +- thumbnail->n_loaded_pages = ++ thumbnail->n_loaded_pages = + thumbnail->input_height / thumbnail->page_height; + + /* For openslide, read out the level structure too. + */ +- if( vips_isprefix( "VipsForeignLoadOpenslide", thumbnail->loader ) ) { ++ if (vips_isprefix("VipsForeignLoadOpenslide", thumbnail->loader)) { + int level_count; + int level; + +- level_count = get_int( image, "openslide.level-count", 1 ); +- level_count = VIPS_CLIP( 1, level_count, MAX_LEVELS ); ++ level_count = get_int(image, "openslide.level-count", 1); ++ level_count = VIPS_CLIP(1, level_count, MAX_LEVELS); + thumbnail->level_count = level_count; + +- for( level = 0; level < level_count; level++ ) { ++ for (level = 0; level < level_count; level++) { + char name[256]; + +- vips_snprintf( name, 256, +- "openslide.level[%d].width", level ); ++ vips_snprintf(name, 256, ++ "openslide.level[%d].width", level); + thumbnail->level_width[level] = +- get_int( image, name, 0 ); +- vips_snprintf( name, 256, +- "openslide.level[%d].height", level ); ++ get_int(image, name, 0); ++ vips_snprintf(name, 256, ++ "openslide.level[%d].height", level); + thumbnail->level_height[level] = +- get_int( image, name, 0 ); ++ get_int(image, name, 0); + } + } + } + + /* Detect a pyramid made of pages following a roughly /2 shrink. + * +- * This may not be a pyr tiff, so no error if we can't find the layers. ++ * This may not be a pyr tiff, so no error if we can't find the layers. + */ + static void +-vips_thumbnail_get_pyramid_page( VipsThumbnail *thumbnail ) ++vips_thumbnail_get_pyramid_page(VipsThumbnail *thumbnail) + { +- VipsThumbnailClass *class = VIPS_THUMBNAIL_GET_CLASS( thumbnail ); ++ VipsThumbnailClass *class = VIPS_THUMBNAIL_GET_CLASS(thumbnail); + int i; + + #ifdef DEBUG +- printf( "vips_thumbnail_get_pyramid_page:\n" ); ++ printf("vips_thumbnail_get_pyramid_page:\n"); + #endif /*DEBUG*/ + + /* Single-page docs can't be pyramids. + */ +- if( thumbnail->n_pages < 2 ) ++ if (thumbnail->n_pages < 2) + return; + +- for( i = 0; i < thumbnail->n_pages; i++ ) { ++ for (i = 0; i < thumbnail->n_pages; i++) { + VipsImage *page; + int level_width; + int level_height; + int expected_level_width; + int expected_level_height; + +- if( !(page = class->open( thumbnail, i )) ) ++ if (!(page = class->open(thumbnail, i))) + return; + level_width = page->Xsize; + level_height = page->Ysize; +- VIPS_UNREF( page ); ++ VIPS_UNREF(page); + + expected_level_width = thumbnail->input_width / (1 << i); + expected_level_height = thumbnail->input_height / (1 << i); + + /* This won't be exact due to rounding etc. + */ +- if( abs( level_width - expected_level_width ) > 5 || +- level_width < 2 ) ++ if (abs(level_width - expected_level_width) > 5 || ++ level_width < 2) + return; +- if( abs( level_height - expected_level_height ) > 5 || +- level_height < 2 ) ++ if (abs(level_height - expected_level_height) > 5 || ++ level_height < 2) + return; + + thumbnail->level_width[i] = level_width; +@@ -306,39 +306,39 @@ vips_thumbnail_get_pyramid_page( VipsThumbnail *thumbnail ) + /* Now set level_count. This signals that we've found a pyramid. + */ + #ifdef DEBUG +- printf( "vips_thumbnail_get_pyramid_page: " +- "%d layer pyramid detected\n", +- thumbnail->n_pages ); ++ printf("vips_thumbnail_get_pyramid_page: " ++ "%d layer pyramid detected\n", ++ thumbnail->n_pages); + #endif /*DEBUG*/ + thumbnail->level_count = thumbnail->n_pages; + } + + /* Detect a TIFF pyramid made of subifds following a roughly /2 shrink. + * +- * This may not be a pyr tiff, so no error if we can't find the layers. ++ * This may not be a pyr tiff, so no error if we can't find the layers. + */ + static void +-vips_thumbnail_get_tiff_pyramid_subifd( VipsThumbnail *thumbnail ) ++vips_thumbnail_get_tiff_pyramid_subifd(VipsThumbnail *thumbnail) + { +- VipsThumbnailClass *class = VIPS_THUMBNAIL_GET_CLASS( thumbnail ); ++ VipsThumbnailClass *class = VIPS_THUMBNAIL_GET_CLASS(thumbnail); + int i; + + #ifdef DEBUG +- printf( "vips_thumbnail_get_tiff_pyramid_subifd:\n" ); ++ printf("vips_thumbnail_get_tiff_pyramid_subifd:\n"); + #endif /*DEBUG*/ + +- for( i = 0; i < thumbnail->n_subifds; i++ ) { ++ for (i = 0; i < thumbnail->n_subifds; i++) { + VipsImage *page; + int level_width; + int level_height; + int expected_level_width; + int expected_level_height; + +- if( !(page = class->open( thumbnail, i )) ) ++ if (!(page = class->open(thumbnail, i))) + return; + level_width = page->Xsize; + level_height = page->Ysize; +- VIPS_UNREF( page ); ++ VIPS_UNREF(page); + + /* The main image is size 1, subifd 0 is half that. + */ +@@ -347,11 +347,11 @@ vips_thumbnail_get_tiff_pyramid_subifd( VipsThumbnail *thumbnail ) + + /* This won't be exact due to rounding etc. + */ +- if( abs( level_width - expected_level_width ) > 5 || +- level_width < 2 ) ++ if (abs(level_width - expected_level_width) > 5 || ++ level_width < 2) + return; +- if( abs( level_height - expected_level_height ) > 5 || +- level_height < 2 ) ++ if (abs(level_height - expected_level_height) > 5 || ++ level_height < 2) + return; + + thumbnail->level_width[i] = level_width; +@@ -361,58 +361,56 @@ vips_thumbnail_get_tiff_pyramid_subifd( VipsThumbnail *thumbnail ) + /* Now set level_count. This signals that we've found a pyramid. + */ + #ifdef DEBUG +- printf( "vips_thumbnail_get_tiff_pyramid_subifd: " +- "%d layer pyramid detected\n", +- thumbnail->n_subifds ); ++ printf("vips_thumbnail_get_tiff_pyramid_subifd: " ++ "%d layer pyramid detected\n", ++ thumbnail->n_subifds); + #endif /*DEBUG*/ + thumbnail->level_count = thumbnail->n_subifds; + } + + static int +-vips_thumbnail_get_heif_thumb_info( VipsThumbnail *thumbnail ) ++vips_thumbnail_get_heif_thumb_info(VipsThumbnail *thumbnail) + { +- VipsThumbnailClass *class = VIPS_THUMBNAIL_GET_CLASS( thumbnail ); ++ VipsThumbnailClass *class = VIPS_THUMBNAIL_GET_CLASS(thumbnail); + + VipsImage *thumb; + +- if( !(thumb = class->open( thumbnail, 1 )) ) +- return( -1 ); ++ if (!(thumb = class->open(thumbnail, 1))) ++ return (-1); + +- if( thumb->Xsize < thumbnail->input_width ) { ++ if (thumb->Xsize < thumbnail->input_width) { + thumbnail->heif_thumbnail_width = thumb->Xsize; + thumbnail->heif_thumbnail_height = thumb->Ysize; + } + +- VIPS_UNREF( thumb ); ++ VIPS_UNREF(thumb); + +- return( 0 ); ++ return (0); + } + + /* Calculate the shrink factor, taking into account auto-rotate, the fit mode, + * and so on. + * + * The hshrink/vshrink are the amount to shrink the input image axes by in +- * order for the output axes (ie. after rotation) to match the required ++ * order for the output axes (ie. after rotation) to match the required + * thumbnail->width, thumbnail->height and fit mode. + */ + static void +-vips_thumbnail_calculate_shrink( VipsThumbnail *thumbnail, +- int input_width, int input_height, double *hshrink, double *vshrink ) ++vips_thumbnail_calculate_shrink(VipsThumbnail *thumbnail, ++ int input_width, int input_height, double *hshrink, double *vshrink) + { +- /* If we will be rotating, swap the target width and height. ++ /* If we will be rotating, swap the target width and height. + */ +- gboolean rotate = ++ gboolean rotate = + thumbnail->swap && + thumbnail->auto_rotate; +- int target_width = rotate ? +- thumbnail->height : thumbnail->width; +- int target_height = rotate ? +- thumbnail->width : thumbnail->height; ++ int target_width = rotate ? thumbnail->height : thumbnail->width; ++ int target_height = rotate ? thumbnail->width : thumbnail->height; + + VipsDirection direction; + + /* Calculate the horizontal and vertical shrink we'd need to fit the +- * image to the bounding box, and pick the biggest. ++ * image to the bounding box, and pick the biggest. + * + * In crop mode, we aim to fill the bounding box, so we must use the + * smaller axis. +@@ -420,162 +418,162 @@ vips_thumbnail_calculate_shrink( VipsThumbnail *thumbnail, + *hshrink = (double) input_width / target_width; + *vshrink = (double) input_height / target_height; + +- if( thumbnail->crop != VIPS_INTERESTING_NONE ) { +- if( *hshrink < *vshrink ) ++ if (thumbnail->crop != VIPS_INTERESTING_NONE) { ++ if (*hshrink < *vshrink) + direction = VIPS_DIRECTION_HORIZONTAL; + else + direction = VIPS_DIRECTION_VERTICAL; + } + else { +- if( *hshrink < *vshrink ) ++ if (*hshrink < *vshrink) + direction = VIPS_DIRECTION_VERTICAL; + else + direction = VIPS_DIRECTION_HORIZONTAL; + } + +- if( thumbnail->size != VIPS_SIZE_FORCE ) { +- if( direction == VIPS_DIRECTION_HORIZONTAL ) ++ if (thumbnail->size != VIPS_SIZE_FORCE) { ++ if (direction == VIPS_DIRECTION_HORIZONTAL) + *vshrink = *hshrink; + else + *hshrink = *vshrink; + } + +- if( thumbnail->size == VIPS_SIZE_UP ) { +- *hshrink = VIPS_MIN( 1, *hshrink ); +- *vshrink = VIPS_MIN( 1, *vshrink ); ++ if (thumbnail->size == VIPS_SIZE_UP) { ++ *hshrink = VIPS_MIN(1, *hshrink); ++ *vshrink = VIPS_MIN(1, *vshrink); + } +- else if( thumbnail->size == VIPS_SIZE_DOWN ) { +- *hshrink = VIPS_MAX( 1, *hshrink ); +- *vshrink = VIPS_MAX( 1, *vshrink ); ++ else if (thumbnail->size == VIPS_SIZE_DOWN) { ++ *hshrink = VIPS_MAX(1, *hshrink); ++ *vshrink = VIPS_MAX(1, *vshrink); + } + + /* We don't want to shrink so much that we send an axis to 0. + */ +- *hshrink = VIPS_MIN( *hshrink, input_width ); +- *vshrink = VIPS_MIN( *vshrink, input_height ); ++ *hshrink = VIPS_MIN(*hshrink, input_width); ++ *vshrink = VIPS_MIN(*vshrink, input_height); + } + + /* Just the common part of the shrink: the bit by which both axes must be + * shrunk. + */ + static double +-vips_thumbnail_calculate_common_shrink( VipsThumbnail *thumbnail, +- int width, int height ) ++vips_thumbnail_calculate_common_shrink(VipsThumbnail *thumbnail, ++ int width, int height) + { + double hshrink; + double vshrink; + double shrink; + +- vips_thumbnail_calculate_shrink( thumbnail, width, height, +- &hshrink, &vshrink ); ++ vips_thumbnail_calculate_shrink(thumbnail, width, height, ++ &hshrink, &vshrink); + +- shrink = VIPS_MIN( hshrink, vshrink ); ++ shrink = VIPS_MIN(hshrink, vshrink); + +- return( shrink ); ++ return (shrink); + } + + /* Find the best jpeg preload shrink. + */ + static int +-vips_thumbnail_find_jpegshrink( VipsThumbnail *thumbnail, +- int width, int height ) ++vips_thumbnail_find_jpegshrink(VipsThumbnail *thumbnail, ++ int width, int height) + { +- double shrink = vips_thumbnail_calculate_common_shrink( thumbnail, +- width, height ); ++ double shrink = vips_thumbnail_calculate_common_shrink(thumbnail, ++ width, height); + + /* We can't use pre-shrunk images in linear mode. libjpeg shrinks in Y + * (of YCbCR), not linear space. + */ +- if( thumbnail->linear ) +- return( 1 ); ++ if (thumbnail->linear) ++ return (1); + + /* Shrink-on-load is a simple block shrink and will add quite a bit of + * extra sharpness to the image. We want to block shrink to a +- * bit above our target, then vips_shrink() / vips_reduce() to the +- * final size. ++ * bit above our target, then vips_shrink() / vips_reduce() to the ++ * final size. + * + * Leave at least a factor of two for the final resize step. + */ +- if( shrink >= 16 ) +- return( 8 ); +- else if( shrink >= 8 ) +- return( 4 ); +- else if( shrink >= 4 ) +- return( 2 ); +- else +- return( 1 ); ++ if (shrink >= 16) ++ return (8); ++ else if (shrink >= 8) ++ return (4); ++ else if (shrink >= 4) ++ return (2); ++ else ++ return (1); + } + + /* Find the best pyramid (openslide, tiff, etc.) level. + */ + static int +-vips_thumbnail_find_pyrlevel( VipsThumbnail *thumbnail, +- int width, int height ) ++vips_thumbnail_find_pyrlevel(VipsThumbnail *thumbnail, ++ int width, int height) + { + int level; + +- g_assert( thumbnail->level_count > 0 ); +- g_assert( thumbnail->level_count <= MAX_LEVELS ); ++ g_assert(thumbnail->level_count > 0); ++ g_assert(thumbnail->level_count <= MAX_LEVELS); + +- for( level = thumbnail->level_count - 1; level >= 0; level-- ) +- if( vips_thumbnail_calculate_common_shrink( thumbnail, +- thumbnail->level_width[level], +- thumbnail->level_height[level] ) >= 1.0 ) +- return( level ); ++ for (level = thumbnail->level_count - 1; level >= 0; level--) ++ if (vips_thumbnail_calculate_common_shrink(thumbnail, ++ thumbnail->level_width[level], ++ thumbnail->level_height[level]) >= 1.0) ++ return (level); + +- return( 0 ); ++ return (0); + } + +-/* Open the image, returning the best version for thumbnailing. ++/* Open the image, returning the best version for thumbnailing. + * +- * For example, libjpeg supports fast shrink-on-read, so if we have a JPEG, ++ * For example, libjpeg supports fast shrink-on-read, so if we have a JPEG, + * we can ask VIPS to load a lower resolution version. + */ + static VipsImage * +-vips_thumbnail_open( VipsThumbnail *thumbnail ) ++vips_thumbnail_open(VipsThumbnail *thumbnail) + { +- VipsThumbnailClass *class = VIPS_THUMBNAIL_GET_CLASS( thumbnail ); ++ VipsThumbnailClass *class = VIPS_THUMBNAIL_GET_CLASS(thumbnail); + + VipsImage *im; + double factor; + +- if( class->get_info( thumbnail ) ) +- return( NULL ); +- g_info( "selected loader is %s", thumbnail->loader ); +- g_info( "input size is %d x %d", +- thumbnail->input_width, thumbnail->input_height ); ++ if (class->get_info(thumbnail)) ++ return (NULL); ++ g_info("selected loader is %s", thumbnail->loader); ++ g_info("input size is %d x %d", ++ thumbnail->input_width, thumbnail->input_height); + + /* For tiff, scan the image and try to spot page-based and ifd-based +- * pyramids. ++ * pyramids. + */ +- if( vips_isprefix( "VipsForeignLoadTiff", thumbnail->loader ) ) { ++ if (vips_isprefix("VipsForeignLoadTiff", thumbnail->loader)) { + /* Test for a subifd pyr first, since we can do that from just + * one page. + */ + thumbnail->subifd_pyramid = TRUE; +- vips_thumbnail_get_tiff_pyramid_subifd( thumbnail ); ++ vips_thumbnail_get_tiff_pyramid_subifd(thumbnail); + +- if( thumbnail->level_count == 0 ) { ++ if (thumbnail->level_count == 0) { + thumbnail->subifd_pyramid = FALSE; + thumbnail->page_pyramid = TRUE; + +- vips_thumbnail_get_pyramid_page( thumbnail ); ++ vips_thumbnail_get_pyramid_page(thumbnail); + +- if( thumbnail->level_count == 0 ) ++ if (thumbnail->level_count == 0) + thumbnail->page_pyramid = FALSE; + } + } + + /* jp2k uses page-based pyramids. + */ +- if( vips_isprefix( "VipsForeignLoadJp2k", thumbnail->loader ) ) { +- if( thumbnail->level_count == 0 ) { ++ if (vips_isprefix("VipsForeignLoadJp2k", thumbnail->loader)) { ++ if (thumbnail->level_count == 0) { + thumbnail->subifd_pyramid = FALSE; + thumbnail->page_pyramid = TRUE; + +- vips_thumbnail_get_pyramid_page( thumbnail ); ++ vips_thumbnail_get_pyramid_page(thumbnail); + +- if( thumbnail->level_count == 0 ) ++ if (thumbnail->level_count == 0) + thumbnail->page_pyramid = FALSE; + } + } +@@ -583,8 +581,8 @@ vips_thumbnail_open( VipsThumbnail *thumbnail ) + /* For heif, we need to fetch the thumbnail size, in case we can use + * that as the source. + */ +- if( vips_isprefix( "VipsForeignLoadHeif", thumbnail->loader ) ) +- vips_thumbnail_get_heif_thumb_info( thumbnail ); ++ if (vips_isprefix("VipsForeignLoadHeif", thumbnail->loader)) ++ vips_thumbnail_get_heif_thumb_info(thumbnail); + + /* We read the openslide level structure in + * vips_thumbnail_read_header(). +@@ -592,65 +590,65 @@ vips_thumbnail_open( VipsThumbnail *thumbnail ) + + factor = 1.0; + +- if( vips_isprefix( "VipsForeignLoadJpeg", thumbnail->loader ) ) +- factor = vips_thumbnail_find_jpegshrink( thumbnail, +- thumbnail->input_width, thumbnail->input_height ); +- else if( vips_isprefix( "VipsForeignLoadTiff", thumbnail->loader ) || +- vips_isprefix( "VipsForeignLoadJp2k", thumbnail->loader ) || +- vips_isprefix( "VipsForeignLoadOpenslide", +- thumbnail->loader ) ) { +- if( thumbnail->level_count > 0 ) +- factor = vips_thumbnail_find_pyrlevel( thumbnail, +- thumbnail->input_width, +- thumbnail->input_height ); ++ if (vips_isprefix("VipsForeignLoadJpeg", thumbnail->loader)) ++ factor = vips_thumbnail_find_jpegshrink(thumbnail, ++ thumbnail->input_width, thumbnail->input_height); ++ else if (vips_isprefix("VipsForeignLoadTiff", thumbnail->loader) || ++ vips_isprefix("VipsForeignLoadJp2k", thumbnail->loader) || ++ vips_isprefix("VipsForeignLoadOpenslide", ++ thumbnail->loader)) { ++ if (thumbnail->level_count > 0) ++ factor = vips_thumbnail_find_pyrlevel(thumbnail, ++ thumbnail->input_width, ++ thumbnail->input_height); + } +- else if( vips_isprefix( "VipsForeignLoadWebp", thumbnail->loader ) ) { +- factor = vips_thumbnail_calculate_common_shrink( thumbnail, +- thumbnail->input_width, +- thumbnail->page_height ); ++ else if (vips_isprefix("VipsForeignLoadWebp", thumbnail->loader)) { ++ factor = vips_thumbnail_calculate_common_shrink(thumbnail, ++ thumbnail->input_width, ++ thumbnail->page_height); + + /* Avoid upsizing via libwebp. + */ +- factor = VIPS_MAX( 1.0, factor ); ++ factor = VIPS_MAX(1.0, factor); + } +- else if( vips_isprefix( "VipsForeignLoadPdf", thumbnail->loader ) || +- vips_isprefix( "VipsForeignLoadSvg", thumbnail->loader ) ) +- factor = vips_thumbnail_calculate_common_shrink( thumbnail, +- thumbnail->input_width, +- thumbnail->page_height ); +- else if( vips_isprefix( "VipsForeignLoadHeif", thumbnail->loader ) ) { ++ else if (vips_isprefix("VipsForeignLoadPdf", thumbnail->loader) || ++ vips_isprefix("VipsForeignLoadSvg", thumbnail->loader)) ++ factor = vips_thumbnail_calculate_common_shrink(thumbnail, ++ thumbnail->input_width, ++ thumbnail->page_height); ++ else if (vips_isprefix("VipsForeignLoadHeif", thumbnail->loader)) { + /* 'factor' is a gboolean which enables thumbnail load instead + * of image load. + * + * Use the thumbnail if, by using it, we could get a factor > +- * 1.0, ie. we would not need to expand the thumbnail. ++ * 1.0, ie. we would not need to expand the thumbnail. + * + * Don't use >= since factor can be clipped to 1.0 under some + * resizing modes. + */ +- double shrink_factor = vips_thumbnail_calculate_common_shrink( +- thumbnail, +- thumbnail->heif_thumbnail_width, +- thumbnail->heif_thumbnail_height ); ++ double shrink_factor = vips_thumbnail_calculate_common_shrink( ++ thumbnail, ++ thumbnail->heif_thumbnail_width, ++ thumbnail->heif_thumbnail_height); + + factor = shrink_factor > 1.0 ? 1 : 0; + } + +- g_info( "loading with factor %g pre-shrink", factor ); ++ g_info("loading with factor %g pre-shrink", factor); + +- if( !(im = class->open( thumbnail, factor )) ) +- return( NULL ); ++ if (!(im = class->open(thumbnail, factor))) ++ return (NULL); + +- g_info( "pre-shrunk size is %d x %d", im->Xsize, im->Ysize ); ++ g_info("pre-shrunk size is %d x %d", im->Xsize, im->Ysize); + +- return( im ); ++ return (im); + } + + static int +-vips_thumbnail_build( VipsObject *object ) ++vips_thumbnail_build(VipsObject *object) + { +- VipsThumbnail *thumbnail = VIPS_THUMBNAIL( object ); +- VipsImage **t = (VipsImage **) vips_object_local_array( object, 15 ); ++ VipsThumbnail *thumbnail = VIPS_THUMBNAIL(object); ++ VipsImage **t = (VipsImage **) vips_object_local_array(object, 15); + + VipsImage *in; + int preshrunk_page_height; +@@ -667,13 +665,13 @@ vips_thumbnail_build( VipsObject *object ) + VipsBandFormat unpremultiplied_format; + + #ifdef DEBUG +- printf( "vips_thumbnail_build: " ); +- vips_object_print_name( object ); +- printf( "\n" ); ++ printf("vips_thumbnail_build: "); ++ vips_object_print_name(object); ++ printf("\n"); + #endif /*DEBUG*/ + +- if( VIPS_OBJECT_CLASS( vips_thumbnail_parent_class )->build( object ) ) +- return( -1 ); ++ if (VIPS_OBJECT_CLASS(vips_thumbnail_parent_class)->build(object)) ++ return (-1); + + /* We have to support both no_rotate and auto_rotate optional args, + * with no_rotate being the new and not-deprecated one. +@@ -681,59 +679,59 @@ vips_thumbnail_build( VipsObject *object ) + * If the new no_rotate flag has been set, that value overrides + * auto_rotate. + */ +- if( vips_object_argument_isset( object, "no_rotate" ) ) ++ if (vips_object_argument_isset(object, "no_rotate")) + thumbnail->auto_rotate = !thumbnail->no_rotate; + +- if( !vips_object_argument_isset( object, "height" ) ) ++ if (!vips_object_argument_isset(object, "height")) + thumbnail->height = thumbnail->width; + + /* Open and do any pre-shrinking. + */ +- if( !(t[0] = vips_thumbnail_open( thumbnail )) ) +- return( -1 ); ++ if (!(t[0] = vips_thumbnail_open(thumbnail))) ++ return (-1); + in = t[0]; + + /* After pre-shrink, but before the main shrink stage. + */ +- preshrunk_page_height = vips_image_get_page_height( in ); ++ preshrunk_page_height = vips_image_get_page_height(in); + + /* RAD needs special unpacking. + */ +- if( in->Coding == VIPS_CODING_RAD ) { +- g_info( "unpacking Rad to float" ); ++ if (in->Coding == VIPS_CODING_RAD) { ++ g_info("unpacking Rad to float"); + + /* rad is scrgb. + */ +- if( vips_rad2float( in, &t[12], NULL ) ) +- return( -1 ); ++ if (vips_rad2float(in, &t[12], NULL)) ++ return (-1); + in = t[12]; + } + +- /* In linear mode, we need to transform to a linear space before +- * vips_resize(). ++ /* In linear mode, we need to transform to a linear space before ++ * vips_resize(). + */ + have_imported = FALSE; +- if( thumbnail->linear ) { +- /* If we are doing colour management (there's an import ++ if (thumbnail->linear) { ++ /* If we are doing colour management (there's an import + * profile), then we can use XYZ PCS as the resize space. + */ +- if( in->Coding == VIPS_CODING_NONE && ++ if (in->Coding == VIPS_CODING_NONE && + (in->BandFmt == VIPS_FORMAT_UCHAR || +- in->BandFmt == VIPS_FORMAT_USHORT) && +- (vips_image_get_typeof( in, VIPS_META_ICC_NAME ) || +- thumbnail->import_profile) ) { +- g_info( "importing to XYZ PCS" ); +- if( thumbnail->import_profile ) +- g_info( "fallback input profile %s", +- thumbnail->import_profile ); +- +- if( vips_icc_import( in, &t[1], +- "input_profile", thumbnail->import_profile, +- "embedded", TRUE, +- "intent", thumbnail->intent, +- "pcs", VIPS_PCS_XYZ, +- NULL ) ) +- return( -1 ); ++ in->BandFmt == VIPS_FORMAT_USHORT) && ++ (vips_image_get_typeof(in, VIPS_META_ICC_NAME) || ++ thumbnail->import_profile)) { ++ g_info("importing to XYZ PCS"); ++ if (thumbnail->import_profile) ++ g_info("fallback input profile %s", ++ thumbnail->import_profile); ++ ++ if (vips_icc_import(in, &t[1], ++ "input_profile", thumbnail->import_profile, ++ "embedded", TRUE, ++ "intent", thumbnail->intent, ++ "pcs", VIPS_PCS_XYZ, ++ NULL)) ++ return (-1); + in = t[1]; + + have_imported = TRUE; +@@ -743,17 +741,17 @@ vips_thumbnail_build( VipsObject *object ) + */ + VipsInterpretation interpretation; + +- if( in->Bands < 3 ) +- interpretation = VIPS_INTERPRETATION_GREY16; +- else +- interpretation = VIPS_INTERPRETATION_scRGB; +- +- g_info( "converting to processing space %s", +- vips_enum_nick( VIPS_TYPE_INTERPRETATION, +- interpretation ) ); +- if( vips_colourspace( in, &t[2], interpretation, +- NULL ) ) +- return( -1 ); ++ if (in->Bands < 3) ++ interpretation = VIPS_INTERPRETATION_GREY16; ++ else ++ interpretation = VIPS_INTERPRETATION_scRGB; ++ ++ g_info("converting to processing space %s", ++ vips_enum_nick(VIPS_TYPE_INTERPRETATION, ++ interpretation)); ++ if (vips_colourspace(in, &t[2], interpretation, ++ NULL)) ++ return (-1); + in = t[2]; + } + } +@@ -763,32 +761,32 @@ vips_thumbnail_build( VipsObject *object ) + */ + VipsInterpretation interpretation; + +- if( in->Bands < 3 ) +- interpretation = VIPS_INTERPRETATION_B_W; +- else +- interpretation = VIPS_INTERPRETATION_sRGB; +- +- g_info( "converting to processing space %s", +- vips_enum_nick( VIPS_TYPE_INTERPRETATION, +- interpretation ) ); +- if( vips_colourspace( in, &t[2], interpretation, +- NULL ) ) +- return( -1 ); ++ if (in->Bands < 3) ++ interpretation = VIPS_INTERPRETATION_B_W; ++ else ++ interpretation = VIPS_INTERPRETATION_sRGB; ++ ++ g_info("converting to processing space %s", ++ vips_enum_nick(VIPS_TYPE_INTERPRETATION, ++ interpretation)); ++ if (vips_colourspace(in, &t[2], interpretation, ++ NULL)) ++ return (-1); + in = t[2]; + } + + /* Shrink to preshrunk_page_height, so we work for multi-page images. + */ +- vips_thumbnail_calculate_shrink( thumbnail, +- in->Xsize, preshrunk_page_height, &hshrink, &vshrink ); ++ vips_thumbnail_calculate_shrink(thumbnail, ++ in->Xsize, preshrunk_page_height, &hshrink, &vshrink); + + /* In toilet-roll mode, we must adjust vshrink so that we exactly hit + * page_height or we'll have pixels straddling page boundaries. + */ +- if( in->Ysize > preshrunk_page_height ) { +- int target_page_height = VIPS_RINT( +- preshrunk_page_height / vshrink ); +- int target_image_height = target_page_height * ++ if (in->Ysize > preshrunk_page_height) { ++ int target_page_height = VIPS_RINT( ++ preshrunk_page_height / vshrink); ++ int target_image_height = target_page_height * + thumbnail->n_loaded_pages; + + vshrink = (double) in->Ysize / target_image_height; +@@ -803,91 +801,91 @@ vips_thumbnail_build( VipsObject *object ) + /* If there's an alpha, we have to premultiply before shrinking. See + * https://github.com/libvips/libvips/issues/291 + */ +- if( vips_image_hasalpha( in ) && +- hshrink != 1.0 && +- vshrink != 1.0 ) { +- g_info( "premultiplying alpha" ); ++ if (vips_image_hasalpha(in) && ++ hshrink != 1.0 && ++ vshrink != 1.0) { ++ g_info("premultiplying alpha"); + unpremultiplied_format = in->BandFmt; + +- if( vips_premultiply( in, &t[3], NULL ) ) +- return( -1 ); ++ if (vips_premultiply(in, &t[3], NULL)) ++ return (-1); + in = t[3]; + } + +- if( vips_resize( in, &t[4], 1.0 / hshrink, +- "vscale", 1.0 / vshrink, +- NULL ) ) +- return( -1 ); ++ if (vips_resize(in, &t[4], 1.0 / hshrink, ++ "vscale", 1.0 / vshrink, ++ NULL)) ++ return (-1); + in = t[4]; + +- if( unpremultiplied_format != VIPS_FORMAT_NOTSET ) { +- g_info( "unpremultiplying alpha" ); +- if( vips_unpremultiply( in, &t[5], NULL ) || +- vips_cast( t[5], &t[6], unpremultiplied_format, NULL ) ) +- return( -1 ); ++ if (unpremultiplied_format != VIPS_FORMAT_NOTSET) { ++ g_info("unpremultiplying alpha"); ++ if (vips_unpremultiply(in, &t[5], NULL) || ++ vips_cast(t[5], &t[6], unpremultiplied_format, NULL)) ++ return (-1); + in = t[6]; + } + + /* Only set page-height if we have more than one page, or this could + * accidentally turn into an animated image later. + */ +- if( thumbnail->n_loaded_pages > 1 ) { +- int output_page_height = +- VIPS_RINT( preshrunk_page_height / vshrink ); ++ if (thumbnail->n_loaded_pages > 1) { ++ int output_page_height = ++ VIPS_RINT(preshrunk_page_height / vshrink); + +- if( vips_copy( in, &t[13], NULL ) ) +- return( -1 ); ++ if (vips_copy(in, &t[13], NULL)) ++ return (-1); + in = t[13]; + +- vips_image_set_int( in, +- VIPS_META_PAGE_HEIGHT, output_page_height ); ++ vips_image_set_int(in, ++ VIPS_META_PAGE_HEIGHT, output_page_height); + } + + /* Colour management. + */ +- if( have_imported ) { ++ if (have_imported) { + /* We are in PCS. Export with the output profile, if any (this + * will export with the embedded input profile if there's no + * export profile). + */ +- g_info( "exporting to device space with a profile" ); +- if( vips_icc_export( in, &t[7], +- "output_profile", thumbnail->export_profile, +- "intent", thumbnail->intent, +- NULL ) ) +- return( -1 ); ++ g_info("exporting to device space with a profile"); ++ if (vips_icc_export(in, &t[7], ++ "output_profile", thumbnail->export_profile, ++ "intent", thumbnail->intent, ++ NULL)) ++ return (-1); + in = t[7]; + } +- else if( thumbnail->export_profile ) { ++ else if (thumbnail->export_profile) { + /* If there's some kind of import profile, we can transform to + * the output. Otherwise, we are in one of the resize space + * (sRGB, scRGB, B_W, GREY16, etc.) and need to go to PCS, + * then export. + */ +- if( thumbnail->import_profile || +- vips_image_get_typeof( in, VIPS_META_ICC_NAME ) ) { +- g_info( "transforming with supplied profiles" ); +- if( vips_icc_transform( in, &t[7], +- thumbnail->export_profile, +- "input_profile", thumbnail->import_profile, +- "intent", thumbnail->intent, +- "embedded", TRUE, +- NULL ) ) +- return( -1 ); ++ if (thumbnail->import_profile || ++ vips_image_get_typeof(in, VIPS_META_ICC_NAME)) { ++ g_info("transforming with supplied profiles"); ++ if (vips_icc_transform(in, &t[7], ++ thumbnail->export_profile, ++ "input_profile", thumbnail->import_profile, ++ "intent", thumbnail->intent, ++ "embedded", TRUE, ++ NULL)) ++ return (-1); + + in = t[7]; + } + else { +- g_info( "exporting with %s", +- thumbnail->export_profile ); +- if( vips_colourspace( in, &t[7], +- VIPS_INTERPRETATION_XYZ, NULL ) || +- vips_icc_export( t[7], &t[10], +- "output_profile", +- thumbnail->export_profile, ++ g_info("exporting with %s", ++ thumbnail->export_profile); ++ if (vips_colourspace(in, &t[7], ++ VIPS_INTERPRETATION_XYZ, NULL) || ++ vips_icc_export(t[7], &t[10], ++ "output_profile", ++ thumbnail->export_profile, + "intent", thumbnail->intent, +- NULL ) ) +- return( -1 ); ++ NULL)) ++ return (-1); + in = t[10]; + } + } +@@ -897,70 +895,70 @@ vips_thumbnail_build( VipsObject *object ) + */ + VipsInterpretation interpretation; + +- if( in->Bands < 3 ) +- interpretation = VIPS_INTERPRETATION_B_W; +- else +- interpretation = VIPS_INTERPRETATION_sRGB; +- +- g_info( "converting to output space %s", +- vips_enum_nick( VIPS_TYPE_INTERPRETATION, +- interpretation ) ); +- if( vips_colourspace( in, &t[7], interpretation, +- NULL ) ) +- return( -1 ); ++ if (in->Bands < 3) ++ interpretation = VIPS_INTERPRETATION_B_W; ++ else ++ interpretation = VIPS_INTERPRETATION_sRGB; ++ ++ g_info("converting to output space %s", ++ vips_enum_nick(VIPS_TYPE_INTERPRETATION, ++ interpretation)); ++ if (vips_colourspace(in, &t[7], interpretation, ++ NULL)) ++ return (-1); + in = t[7]; + } + +- if( thumbnail->auto_rotate && +- thumbnail->orientation != 1 ) { +- g_info( "rotating by EXIF orientation %d", +- thumbnail->orientation ); ++ if (thumbnail->auto_rotate && ++ thumbnail->orientation != 1) { ++ g_info("rotating by EXIF orientation %d", ++ thumbnail->orientation); + /* Need to copy to memory, we have to stay seq. + */ +- if( !(t[9] = vips_image_copy_memory( in )) || +- vips_autorot( t[9], &t[14], NULL ) ) +- return( -1 ); ++ if (!(t[9] = vips_image_copy_memory(in)) || ++ vips_autorot(t[9], &t[14], NULL)) ++ return (-1); + in = t[14]; + } + + /* Crop after rotate so we don't need to rotate the crop box. + */ +- if( thumbnail->crop != VIPS_INTERESTING_NONE ) { ++ if (thumbnail->crop != VIPS_INTERESTING_NONE) { + /* The image can be smaller than the target. Adjust the + * arguments to vips_smartcrop(). + */ +- int crop_width = VIPS_MIN( thumbnail->width, in->Xsize ); +- int crop_height = VIPS_MIN( thumbnail->height, in->Ysize ); ++ int crop_width = VIPS_MIN(thumbnail->width, in->Xsize); ++ int crop_height = VIPS_MIN(thumbnail->height, in->Ysize); + +- g_info( "cropping to %dx%d", crop_width, crop_height ); ++ g_info("cropping to %dx%d", crop_width, crop_height); + + /* Need to copy to memory, we have to stay seq. + * + * FIXME ... could skip the copy if we've rotated. + */ +- if( !(t[8] = vips_image_copy_memory( in )) || +- vips_smartcrop( t[8], &t[11], +- crop_width, crop_height, ++ if (!(t[8] = vips_image_copy_memory(in)) || ++ vips_smartcrop(t[8], &t[11], ++ crop_width, crop_height, + "interesting", thumbnail->crop, +- NULL ) ) +- return( -1 ); ++ NULL)) ++ return (-1); + in = t[11]; + } + +- g_object_set( thumbnail, "out", vips_image_new(), NULL ); ++ g_object_set(thumbnail, "out", vips_image_new(), NULL); + +- if( vips_image_write( in, thumbnail->out ) ) +- return( -1 ); ++ if (vips_image_write(in, thumbnail->out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + + static void +-vips_thumbnail_class_init( VipsThumbnailClass *class ) ++vips_thumbnail_class_init(VipsThumbnailClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(class); + + gobject_class->dispose = vips_thumbnail_dispose; + gobject_class->finalize = vips_thumbnail_finalize; +@@ -968,107 +966,106 @@ vips_thumbnail_class_init( VipsThumbnailClass *class ) + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "thumbnail_base"; +- vobject_class->description = _( "thumbnail generation" ); ++ vobject_class->description = _("thumbnail generation"); + vobject_class->build = vips_thumbnail_build; + +- /* We mustn't cache these calls, since we open the file or buffer in ++ /* We mustn't cache these calls, since we open the file or buffer in + * sequential mode. + */ + operation_class->flags |= VIPS_OPERATION_NOCACHE; + +- VIPS_ARG_IMAGE( class, "out", 2, +- _( "Output" ), +- _( "Output image" ), +- VIPS_ARGUMENT_REQUIRED_OUTPUT, +- G_STRUCT_OFFSET( VipsThumbnail, out ) ); ++ VIPS_ARG_IMAGE(class, "out", 2, ++ _("Output"), ++ _("Output image"), ++ VIPS_ARGUMENT_REQUIRED_OUTPUT, ++ G_STRUCT_OFFSET(VipsThumbnail, out)); + +- VIPS_ARG_INT( class, "width", 3, +- _( "Target width" ), +- _( "Size to this width" ), ++ VIPS_ARG_INT(class, "width", 3, ++ _("Target width"), ++ _("Size to this width"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsThumbnail, width ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsThumbnail, width), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_INT( class, "height", 113, +- _( "Target height" ), +- _( "Size to this height" ), ++ VIPS_ARG_INT(class, "height", 113, ++ _("Target height"), ++ _("Size to this height"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsThumbnail, height ), +- 1, VIPS_MAX_COORD, 1 ); ++ G_STRUCT_OFFSET(VipsThumbnail, height), ++ 1, VIPS_MAX_COORD, 1); + +- VIPS_ARG_ENUM( class, "size", 114, +- _( "Size" ), +- _( "Only upsize, only downsize, or both" ), ++ VIPS_ARG_ENUM(class, "size", 114, ++ _("Size"), ++ _("Only upsize, only downsize, or both"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsThumbnail, size ), +- VIPS_TYPE_SIZE, VIPS_SIZE_BOTH ); ++ G_STRUCT_OFFSET(VipsThumbnail, size), ++ VIPS_TYPE_SIZE, VIPS_SIZE_BOTH); + +- VIPS_ARG_BOOL( class, "no_rotate", 115, +- _( "No rotate" ), +- _( "Don't use orientation tags to rotate image upright" ), ++ VIPS_ARG_BOOL(class, "no_rotate", 115, ++ _("No rotate"), ++ _("Don't use orientation tags to rotate image upright"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsThumbnail, no_rotate ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsThumbnail, no_rotate), ++ FALSE); + +- VIPS_ARG_ENUM( class, "crop", 116, +- _( "Crop" ), +- _( "Reduce to fill target rectangle, then crop" ), ++ VIPS_ARG_ENUM(class, "crop", 116, ++ _("Crop"), ++ _("Reduce to fill target rectangle, then crop"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsThumbnail, crop ), +- VIPS_TYPE_INTERESTING, VIPS_INTERESTING_NONE ); ++ G_STRUCT_OFFSET(VipsThumbnail, crop), ++ VIPS_TYPE_INTERESTING, VIPS_INTERESTING_NONE); + +- VIPS_ARG_BOOL( class, "linear", 117, +- _( "Linear" ), +- _( "Reduce in linear light" ), ++ VIPS_ARG_BOOL(class, "linear", 117, ++ _("Linear"), ++ _("Reduce in linear light"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsThumbnail, linear ), +- FALSE ); ++ G_STRUCT_OFFSET(VipsThumbnail, linear), ++ FALSE); + +- VIPS_ARG_STRING( class, "import_profile", 118, +- _( "Import profile" ), +- _( "Fallback import profile" ), ++ VIPS_ARG_STRING(class, "import_profile", 118, ++ _("Import profile"), ++ _("Fallback import profile"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsThumbnail, import_profile ), +- NULL ); ++ G_STRUCT_OFFSET(VipsThumbnail, import_profile), ++ NULL); + +- VIPS_ARG_STRING( class, "export_profile", 119, +- _( "Export profile" ), +- _( "Fallback export profile" ), ++ VIPS_ARG_STRING(class, "export_profile", 119, ++ _("Export profile"), ++ _("Fallback export profile"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsThumbnail, export_profile ), +- NULL ); ++ G_STRUCT_OFFSET(VipsThumbnail, export_profile), ++ NULL); + +- VIPS_ARG_ENUM( class, "intent", 120, +- _( "Intent" ), +- _( "Rendering intent" ), ++ VIPS_ARG_ENUM(class, "intent", 120, ++ _("Intent"), ++ _("Rendering intent"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsThumbnail, intent ), +- VIPS_TYPE_INTENT, VIPS_INTENT_RELATIVE ); ++ G_STRUCT_OFFSET(VipsThumbnail, intent), ++ VIPS_TYPE_INTENT, VIPS_INTENT_RELATIVE); + +- VIPS_ARG_ENUM( class, "fail_on", 121, +- _( "Fail on" ), +- _( "Error level to fail on" ), ++ VIPS_ARG_ENUM(class, "fail_on", 121, ++ _("Fail on"), ++ _("Error level to fail on"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsThumbnail, fail_on ), +- VIPS_TYPE_FAIL_ON, VIPS_FAIL_ON_NONE ); ++ G_STRUCT_OFFSET(VipsThumbnail, fail_on), ++ VIPS_TYPE_FAIL_ON, VIPS_FAIL_ON_NONE); + +- /* BOOL args which default TRUE arguments don't work with the ++ /* BOOL args which default TRUE arguments don't work with the + * command-line -- GOption does not allow --auto-rotate=false. + * + * This is now replaced (though still functional) with "no-rotate", + * see above. + */ +- VIPS_ARG_BOOL( class, "auto_rotate", 121, +- _( "Auto rotate" ), +- _( "Use orientation tags to rotate image upright" ), ++ VIPS_ARG_BOOL(class, "auto_rotate", 121, ++ _("Auto rotate"), ++ _("Use orientation tags to rotate image upright"), + VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED, +- G_STRUCT_OFFSET( VipsThumbnail, auto_rotate ), +- TRUE ); +- ++ G_STRUCT_OFFSET(VipsThumbnail, auto_rotate), ++ TRUE); + } + + static void +-vips_thumbnail_init( VipsThumbnail *thumbnail ) ++vips_thumbnail_init(VipsThumbnail *thumbnail) + { + thumbnail->width = 1; + thumbnail->height = 1; +@@ -1080,145 +1077,144 @@ vips_thumbnail_init( VipsThumbnail *thumbnail ) + typedef struct _VipsThumbnailFile { + VipsThumbnail parent_object; + +- char *filename; ++ char *filename; + } VipsThumbnailFile; + + typedef VipsThumbnailClass VipsThumbnailFileClass; + +-G_DEFINE_TYPE( VipsThumbnailFile, vips_thumbnail_file, +- vips_thumbnail_get_type() ); ++G_DEFINE_TYPE(VipsThumbnailFile, vips_thumbnail_file, ++ vips_thumbnail_get_type()); + + /* Get the info from a file. + */ + static int +-vips_thumbnail_file_get_info( VipsThumbnail *thumbnail ) ++vips_thumbnail_file_get_info(VipsThumbnail *thumbnail) + { + VipsThumbnailFile *file = (VipsThumbnailFile *) thumbnail; + + VipsImage *image; + +- g_info( "thumbnailing %s", file->filename ); ++ g_info("thumbnailing %s", file->filename); + +- if( !(thumbnail->loader = vips_foreign_find_load( file->filename )) || +- !(image = vips_image_new_from_file( file->filename, NULL )) ) +- return( -1 ); ++ if (!(thumbnail->loader = vips_foreign_find_load(file->filename)) || ++ !(image = vips_image_new_from_file(file->filename, NULL))) ++ return (-1); + +- vips_thumbnail_read_header( thumbnail, image ); ++ vips_thumbnail_read_header(thumbnail, image); + +- g_object_unref( image ); ++ g_object_unref(image); + +- return( 0 ); ++ return (0); + } + +-/* Open an image, pre-shrinking as appropriate. ++/* Open an image, pre-shrinking as appropriate. + */ + static VipsImage * +-vips_thumbnail_file_open( VipsThumbnail *thumbnail, double factor ) ++vips_thumbnail_file_open(VipsThumbnail *thumbnail, double factor) + { + VipsThumbnailFile *file = (VipsThumbnailFile *) thumbnail; + +- if( vips_isprefix( "VipsForeignLoadJpeg", thumbnail->loader ) ) { +- return( vips_image_new_from_file( file->filename, ++ if (vips_isprefix("VipsForeignLoadJpeg", thumbnail->loader)) { ++ return (vips_image_new_from_file(file->filename, + "access", VIPS_ACCESS_SEQUENTIAL, + "fail_on", thumbnail->fail_on, + "shrink", (int) factor, +- NULL ) ); ++ NULL)); + } +- else if( vips_isprefix( "VipsForeignLoadOpenslide", +- thumbnail->loader ) ) { +- return( vips_image_new_from_file( file->filename, ++ else if (vips_isprefix("VipsForeignLoadOpenslide", ++ thumbnail->loader)) { ++ return (vips_image_new_from_file(file->filename, + "access", VIPS_ACCESS_SEQUENTIAL, + "fail_on", thumbnail->fail_on, + "level", (int) factor, +- NULL ) ); ++ NULL)); + } +- else if( vips_isprefix( "VipsForeignLoadPdf", thumbnail->loader ) || +- vips_isprefix( "VipsForeignLoadSvg", thumbnail->loader ) || +- vips_isprefix( "VipsForeignLoadWebp", thumbnail->loader ) ) { +- return( vips_image_new_from_file( file->filename, ++ else if (vips_isprefix("VipsForeignLoadPdf", thumbnail->loader) || ++ vips_isprefix("VipsForeignLoadSvg", thumbnail->loader) || ++ vips_isprefix("VipsForeignLoadWebp", thumbnail->loader)) { ++ return (vips_image_new_from_file(file->filename, + "access", VIPS_ACCESS_SEQUENTIAL, + "fail_on", thumbnail->fail_on, + "scale", 1.0 / factor, +- NULL ) ); ++ NULL)); + } +- else if( vips_isprefix( "VipsForeignLoadJp2k", thumbnail->loader ) ) { ++ else if (vips_isprefix("VipsForeignLoadJp2k", thumbnail->loader)) { + /* jp2k optionally uses page-based pyramids. + */ +- if( thumbnail->page_pyramid ) +- return( vips_image_new_from_file( file->filename, ++ if (thumbnail->page_pyramid) ++ return (vips_image_new_from_file(file->filename, + "access", VIPS_ACCESS_SEQUENTIAL, + "fail_on", thumbnail->fail_on, + "page", (int) factor, +- NULL ) ); ++ NULL)); + else +- return( vips_image_new_from_file( file->filename, ++ return (vips_image_new_from_file(file->filename, + "access", VIPS_ACCESS_SEQUENTIAL, +- NULL ) ); ++ NULL)); + } +- else if( vips_isprefix( "VipsForeignLoadTiff", thumbnail->loader ) ) { ++ else if (vips_isprefix("VipsForeignLoadTiff", thumbnail->loader)) { + /* We support three modes: subifd pyramids, page-based + * pyramids, and simple multi-page TIFFs (no pyramid). + */ +- if( thumbnail->subifd_pyramid ) +- return( vips_image_new_from_file( file->filename, ++ if (thumbnail->subifd_pyramid) ++ return (vips_image_new_from_file(file->filename, + "access", VIPS_ACCESS_SEQUENTIAL, + "fail_on", thumbnail->fail_on, + "subifd", (int) factor, +- NULL ) ); +- else if( thumbnail->page_pyramid ) +- return( vips_image_new_from_file( file->filename, ++ NULL)); ++ else if (thumbnail->page_pyramid) ++ return (vips_image_new_from_file(file->filename, + "access", VIPS_ACCESS_SEQUENTIAL, + "fail_on", thumbnail->fail_on, + "page", (int) factor, +- NULL ) ); ++ NULL)); + else +- return( vips_image_new_from_file( file->filename, ++ return (vips_image_new_from_file(file->filename, + "access", VIPS_ACCESS_SEQUENTIAL, + "fail_on", thumbnail->fail_on, +- NULL ) ); ++ NULL)); + } +- else if( vips_isprefix( "VipsForeignLoadHeif", thumbnail->loader ) ) { +- return( vips_image_new_from_file( file->filename, ++ else if (vips_isprefix("VipsForeignLoadHeif", thumbnail->loader)) { ++ return (vips_image_new_from_file(file->filename, + "access", VIPS_ACCESS_SEQUENTIAL, + "fail_on", thumbnail->fail_on, + "thumbnail", (int) factor, +- NULL ) ); ++ NULL)); + } + else { +- return( vips_image_new_from_file( file->filename, ++ return (vips_image_new_from_file(file->filename, + "access", VIPS_ACCESS_SEQUENTIAL, + "fail_on", thumbnail->fail_on, +- NULL ) ); ++ NULL)); + } + } + + static void +-vips_thumbnail_file_class_init( VipsThumbnailClass *class ) ++vips_thumbnail_file_class_init(VipsThumbnailClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsThumbnailClass *thumbnail_class = VIPS_THUMBNAIL_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsThumbnailClass *thumbnail_class = VIPS_THUMBNAIL_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "thumbnail"; +- vobject_class->description = _( "generate thumbnail from file" ); ++ vobject_class->description = _("generate thumbnail from file"); + + thumbnail_class->get_info = vips_thumbnail_file_get_info; + thumbnail_class->open = vips_thumbnail_file_open; + +- VIPS_ARG_STRING( class, "filename", 1, +- _( "Filename" ), +- _( "Filename to read from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsThumbnailFile, filename ), +- NULL ); +- ++ VIPS_ARG_STRING(class, "filename", 1, ++ _("Filename"), ++ _("Filename to read from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsThumbnailFile, filename), ++ NULL); + } + + static void +-vips_thumbnail_file_init( VipsThumbnailFile *file ) ++vips_thumbnail_file_init(VipsThumbnailFile *file) + { + } + +@@ -1245,12 +1241,12 @@ vips_thumbnail_file_init( VipsThumbnailFile *file ) + * shrink-on-load features available in the file import library, using a block + * shrink, and using a lanczos3 shrink. At least the final 200% is done with + * lanczos3. The output should be high quality, and the operation should be +- * quick. ++ * quick. + * +- * See vips_thumbnail_buffer() to thumbnail from a memory source. ++ * See vips_thumbnail_buffer() to thumbnail from a memory source. + * + * The output image will fit within a square of size @width x @width. You can +- * specify a separate height with the @height option. ++ * specify a separate height with the @height option. + * + * If you set @crop, then the output image will fill the whole of the @width x + * @height rectangle, with any excess cropped away. See vips_smartcrop() for +@@ -1259,26 +1255,26 @@ vips_thumbnail_file_init( VipsThumbnailFile *file ) + * Normally the operation will upsize or downsize as required to fit the image + * inside or outside the target size. If @size is set + * to #VIPS_SIZE_UP, the operation will only upsize and will just +- * copy if asked to downsize. ++ * copy if asked to downsize. + * If @size is set + * to #VIPS_SIZE_DOWN, the operation will only downsize and will just +- * copy if asked to upsize. ++ * copy if asked to upsize. + * If @size is #VIPS_SIZE_FORCE, the image aspect ratio will be broken and the +- * image will be forced to fit the target. ++ * image will be forced to fit the target. + * + * Normally any orientation tags on the input image (such as EXIF tags) are + * interpreted to rotate the image upright. If you set @no_rotate to %TRUE, + * these tags will not be interpreted. + * +- * Shrinking is normally done in sRGB colourspace. Set @linear to shrink in ++ * Shrinking is normally done in sRGB colourspace. Set @linear to shrink in + * linear light colourspace instead. This can give better results, but can + * also be far slower, since tricks like JPEG shrink-on-load cannot be used in + * linear space. + * +- * If you set @export_profile to the filename of an ICC profile, the image +- * will be transformed to the target colourspace before writing to the +- * output. You can also give an @import_profile which will be used if the +- * input image has no ICC profile, or if the profile embedded in the ++ * If you set @export_profile to the filename of an ICC profile, the image ++ * will be transformed to the target colourspace before writing to the ++ * output. You can also give an @import_profile which will be used if the ++ * input image has no ICC profile, or if the profile embedded in the + * input image is broken. + * + * Use @intent to set the rendering intent for any ICC transform. The default +@@ -1292,16 +1288,16 @@ vips_thumbnail_file_init( VipsThumbnailFile *file ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_thumbnail( const char *filename, VipsImage **out, int width, ... ) ++vips_thumbnail(const char *filename, VipsImage **out, int width, ...) + { + va_list ap; + int result; + +- va_start( ap, width ); +- result = vips_call_split( "thumbnail", ap, filename, out, width ); +- va_end( ap ); ++ va_start(ap, width); ++ result = vips_call_split("thumbnail", ap, filename, out, width); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + typedef struct _VipsThumbnailBuffer { +@@ -1313,160 +1309,160 @@ typedef struct _VipsThumbnailBuffer { + + typedef VipsThumbnailClass VipsThumbnailBufferClass; + +-G_DEFINE_TYPE( VipsThumbnailBuffer, vips_thumbnail_buffer, +- vips_thumbnail_get_type() ); ++G_DEFINE_TYPE(VipsThumbnailBuffer, vips_thumbnail_buffer, ++ vips_thumbnail_get_type()); + + /* Get the info from a buffer. + */ + static int +-vips_thumbnail_buffer_get_info( VipsThumbnail *thumbnail ) ++vips_thumbnail_buffer_get_info(VipsThumbnail *thumbnail) + { + VipsThumbnailBuffer *buffer = (VipsThumbnailBuffer *) thumbnail; + + VipsImage *image; + +- g_info( "thumbnailing %zd bytes of data", buffer->buf->length ); ++ g_info("thumbnailing %zd bytes of data", buffer->buf->length); + +- if( !(thumbnail->loader = vips_foreign_find_load_buffer( +- buffer->buf->data, buffer->buf->length )) || +- !(image = vips_image_new_from_buffer( +- buffer->buf->data, buffer->buf->length, +- buffer->option_string, NULL )) ) +- return( -1 ); ++ if (!(thumbnail->loader = vips_foreign_find_load_buffer( ++ buffer->buf->data, buffer->buf->length)) || ++ !(image = vips_image_new_from_buffer( ++ buffer->buf->data, buffer->buf->length, ++ buffer->option_string, NULL))) ++ return (-1); + +- vips_thumbnail_read_header( thumbnail, image ); ++ vips_thumbnail_read_header(thumbnail, image); + +- g_object_unref( image ); ++ g_object_unref(image); + +- return( 0 ); ++ return (0); + } + +-/* Open an image, scaling as appropriate. ++/* Open an image, scaling as appropriate. + */ + static VipsImage * +-vips_thumbnail_buffer_open( VipsThumbnail *thumbnail, double factor ) ++vips_thumbnail_buffer_open(VipsThumbnail *thumbnail, double factor) + { + VipsThumbnailBuffer *buffer = (VipsThumbnailBuffer *) thumbnail; + +- if( vips_isprefix( "VipsForeignLoadJpeg", thumbnail->loader ) ) { +- return( vips_image_new_from_buffer( +- buffer->buf->data, buffer->buf->length, ++ if (vips_isprefix("VipsForeignLoadJpeg", thumbnail->loader)) { ++ return (vips_image_new_from_buffer( ++ buffer->buf->data, buffer->buf->length, + buffer->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, + "shrink", (int) factor, +- NULL ) ); ++ NULL)); + } +- else if( vips_isprefix( "VipsForeignLoadOpenslide", +- thumbnail->loader ) ) { +- return( vips_image_new_from_buffer( +- buffer->buf->data, buffer->buf->length, ++ else if (vips_isprefix("VipsForeignLoadOpenslide", ++ thumbnail->loader)) { ++ return (vips_image_new_from_buffer( ++ buffer->buf->data, buffer->buf->length, + buffer->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, + "level", (int) factor, +- NULL ) ); ++ NULL)); + } +- else if( vips_isprefix( "VipsForeignLoadPdf", thumbnail->loader ) || +- vips_isprefix( "VipsForeignLoadSvg", thumbnail->loader ) || +- vips_isprefix( "VipsForeignLoadWebp", thumbnail->loader ) ) { +- return( vips_image_new_from_buffer( +- buffer->buf->data, buffer->buf->length, ++ else if (vips_isprefix("VipsForeignLoadPdf", thumbnail->loader) || ++ vips_isprefix("VipsForeignLoadSvg", thumbnail->loader) || ++ vips_isprefix("VipsForeignLoadWebp", thumbnail->loader)) { ++ return (vips_image_new_from_buffer( ++ buffer->buf->data, buffer->buf->length, + buffer->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, + "scale", 1.0 / factor, +- NULL ) ); ++ NULL)); + } +- else if( vips_isprefix( "VipsForeignLoadJp2k", thumbnail->loader ) ) { ++ else if (vips_isprefix("VipsForeignLoadJp2k", thumbnail->loader)) { + /* Optional page-based pyramids. + */ +- if( thumbnail->page_pyramid ) +- return( vips_image_new_from_buffer( +- buffer->buf->data, buffer->buf->length, ++ if (thumbnail->page_pyramid) ++ return (vips_image_new_from_buffer( ++ buffer->buf->data, buffer->buf->length, + buffer->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, + "page", (int) factor, +- NULL ) ); ++ NULL)); + else +- return( vips_image_new_from_buffer( +- buffer->buf->data, buffer->buf->length, ++ return (vips_image_new_from_buffer( ++ buffer->buf->data, buffer->buf->length, + buffer->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, +- NULL ) ); ++ NULL)); + } +- else if( vips_isprefix( "VipsForeignLoadTiff", thumbnail->loader ) ) { ++ else if (vips_isprefix("VipsForeignLoadTiff", thumbnail->loader)) { + /* We support three modes: subifd pyramids, page-based + * pyramids, and simple multi-page TIFFs (no pyramid). + */ +- if( thumbnail->subifd_pyramid ) +- return( vips_image_new_from_buffer( +- buffer->buf->data, buffer->buf->length, ++ if (thumbnail->subifd_pyramid) ++ return (vips_image_new_from_buffer( ++ buffer->buf->data, buffer->buf->length, + buffer->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, + "subifd", (int) factor, +- NULL ) ); +- else if( thumbnail->page_pyramid ) +- return( vips_image_new_from_buffer( +- buffer->buf->data, buffer->buf->length, ++ NULL)); ++ else if (thumbnail->page_pyramid) ++ return (vips_image_new_from_buffer( ++ buffer->buf->data, buffer->buf->length, + buffer->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, + "page", (int) factor, +- NULL ) ); ++ NULL)); + else +- return( vips_image_new_from_buffer( +- buffer->buf->data, buffer->buf->length, ++ return (vips_image_new_from_buffer( ++ buffer->buf->data, buffer->buf->length, + buffer->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, +- NULL ) ); ++ NULL)); + } +- else if( vips_isprefix( "VipsForeignLoadHeif", thumbnail->loader ) ) { +- return( vips_image_new_from_buffer( +- buffer->buf->data, buffer->buf->length, ++ else if (vips_isprefix("VipsForeignLoadHeif", thumbnail->loader)) { ++ return (vips_image_new_from_buffer( ++ buffer->buf->data, buffer->buf->length, + buffer->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, + "thumbnail", (int) factor, +- NULL ) ); ++ NULL)); + } + else { +- return( vips_image_new_from_buffer( +- buffer->buf->data, buffer->buf->length, ++ return (vips_image_new_from_buffer( ++ buffer->buf->data, buffer->buf->length, + buffer->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, +- NULL ) ); ++ NULL)); + } + } + + static void +-vips_thumbnail_buffer_class_init( VipsThumbnailClass *class ) ++vips_thumbnail_buffer_class_init(VipsThumbnailClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsThumbnailClass *thumbnail_class = VIPS_THUMBNAIL_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsThumbnailClass *thumbnail_class = VIPS_THUMBNAIL_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "thumbnail_buffer"; +- vobject_class->description = _( "generate thumbnail from buffer" ); ++ vobject_class->description = _("generate thumbnail from buffer"); + + thumbnail_class->get_info = vips_thumbnail_buffer_get_info; + thumbnail_class->open = vips_thumbnail_buffer_open; + +- VIPS_ARG_BOXED( class, "buffer", 1, +- _( "Buffer" ), +- _( "Buffer to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsThumbnailBuffer, buf ), +- VIPS_TYPE_BLOB ); ++ VIPS_ARG_BOXED(class, "buffer", 1, ++ _("Buffer"), ++ _("Buffer to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsThumbnailBuffer, buf), ++ VIPS_TYPE_BLOB); + +- VIPS_ARG_STRING( class, "option_string", 20, +- _( "Extra options" ), +- _( "Options that are passed on to the underlying loader" ), ++ VIPS_ARG_STRING(class, "option_string", 20, ++ _("Extra options"), ++ _("Options that are passed on to the underlying loader"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsThumbnailBuffer, option_string ), +- "" ); ++ G_STRUCT_OFFSET(VipsThumbnailBuffer, option_string), ++ ""); + } + + static void +-vips_thumbnail_buffer_init( VipsThumbnailBuffer *buffer ) ++vips_thumbnail_buffer_init(VipsThumbnailBuffer *buffer) + { + } + +@@ -1500,7 +1496,7 @@ vips_thumbnail_buffer_init( VipsThumbnailBuffer *buffer ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_thumbnail_buffer( void *buf, size_t len, VipsImage **out, int width, ... ) ++vips_thumbnail_buffer(void *buf, size_t len, VipsImage **out, int width, ...) + { + va_list ap; + VipsBlob *blob; +@@ -1508,15 +1504,15 @@ vips_thumbnail_buffer( void *buf, size_t len, VipsImage **out, int width, ... ) + + /* We don't take a copy of the data or free it. + */ +- blob = vips_blob_new( NULL, buf, len ); ++ blob = vips_blob_new(NULL, buf, len); + +- va_start( ap, width ); +- result = vips_call_split( "thumbnail_buffer", ap, blob, out, width ); +- va_end( ap ); ++ va_start(ap, width); ++ result = vips_call_split("thumbnail_buffer", ap, blob, out, width); ++ va_end(ap); + +- vips_area_unref( VIPS_AREA( blob ) ); ++ vips_area_unref(VIPS_AREA(blob)); + +- return( result ); ++ return (result); + } + + typedef struct _VipsThumbnailSource { +@@ -1528,160 +1524,159 @@ typedef struct _VipsThumbnailSource { + + typedef VipsThumbnailClass VipsThumbnailSourceClass; + +-G_DEFINE_TYPE( VipsThumbnailSource, vips_thumbnail_source, +- vips_thumbnail_get_type() ); ++G_DEFINE_TYPE(VipsThumbnailSource, vips_thumbnail_source, ++ vips_thumbnail_get_type()); + + /* Get the info from a source. + */ + static int +-vips_thumbnail_source_get_info( VipsThumbnail *thumbnail ) ++vips_thumbnail_source_get_info(VipsThumbnail *thumbnail) + { + VipsThumbnailSource *source = (VipsThumbnailSource *) thumbnail; + + VipsImage *image; + +- g_info( "thumbnailing source" ); ++ g_info("thumbnailing source"); + +- if( !(thumbnail->loader = vips_foreign_find_load_source( +- source->source )) || +- !(image = vips_image_new_from_source( source->source, +- source->option_string, NULL )) ) +- return( -1 ); ++ if (!(thumbnail->loader = vips_foreign_find_load_source( ++ source->source)) || ++ !(image = vips_image_new_from_source(source->source, ++ source->option_string, NULL))) ++ return (-1); + +- vips_thumbnail_read_header( thumbnail, image ); ++ vips_thumbnail_read_header(thumbnail, image); + +- g_object_unref( image ); ++ g_object_unref(image); + +- return( 0 ); ++ return (0); + } + +-/* Open an image, scaling as appropriate. ++/* Open an image, scaling as appropriate. + */ + static VipsImage * +-vips_thumbnail_source_open( VipsThumbnail *thumbnail, double factor ) ++vips_thumbnail_source_open(VipsThumbnail *thumbnail, double factor) + { + VipsThumbnailSource *source = (VipsThumbnailSource *) thumbnail; + +- if( vips_isprefix( "VipsForeignLoadJpeg", thumbnail->loader ) ) { +- return( vips_image_new_from_source( +- source->source, ++ if (vips_isprefix("VipsForeignLoadJpeg", thumbnail->loader)) { ++ return (vips_image_new_from_source( ++ source->source, + source->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, + "shrink", (int) factor, +- NULL ) ); ++ NULL)); + } +- else if( vips_isprefix( "VipsForeignLoadOpenslide", +- thumbnail->loader ) ) { +- return( vips_image_new_from_source( +- source->source, ++ else if (vips_isprefix("VipsForeignLoadOpenslide", ++ thumbnail->loader)) { ++ return (vips_image_new_from_source( ++ source->source, + source->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, + "level", (int) factor, +- NULL ) ); ++ NULL)); + } +- else if( vips_isprefix( "VipsForeignLoadPdf", thumbnail->loader ) || +- vips_isprefix( "VipsForeignLoadSvg", thumbnail->loader ) || +- vips_isprefix( "VipsForeignLoadWebp", thumbnail->loader ) ) { +- return( vips_image_new_from_source( +- source->source, ++ else if (vips_isprefix("VipsForeignLoadPdf", thumbnail->loader) || ++ vips_isprefix("VipsForeignLoadSvg", thumbnail->loader) || ++ vips_isprefix("VipsForeignLoadWebp", thumbnail->loader)) { ++ return (vips_image_new_from_source( ++ source->source, + source->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, + "scale", 1.0 / factor, +- NULL ) ); ++ NULL)); + } +- else if( vips_isprefix( "VipsForeignLoadJp2k", thumbnail->loader ) ) { ++ else if (vips_isprefix("VipsForeignLoadJp2k", thumbnail->loader)) { + /* Optional page-based pyramids. + */ +- if( thumbnail->page_pyramid ) +- return( vips_image_new_from_source( +- source->source, ++ if (thumbnail->page_pyramid) ++ return (vips_image_new_from_source( ++ source->source, + source->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, + "page", (int) factor, +- NULL ) ); ++ NULL)); + else +- return( vips_image_new_from_source( +- source->source, ++ return (vips_image_new_from_source( ++ source->source, + source->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, +- NULL ) ); ++ NULL)); + } +- else if( vips_isprefix( "VipsForeignLoadTiff", thumbnail->loader ) ) { ++ else if (vips_isprefix("VipsForeignLoadTiff", thumbnail->loader)) { + /* We support three modes: subifd pyramids, page-based + * pyramids, and simple multi-page TIFFs (no pyramid). + */ +- if( thumbnail->subifd_pyramid ) +- return( vips_image_new_from_source( +- source->source, ++ if (thumbnail->subifd_pyramid) ++ return (vips_image_new_from_source( ++ source->source, + source->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, + "subifd", (int) factor, +- NULL ) ); +- else if( thumbnail->page_pyramid ) +- return( vips_image_new_from_source( +- source->source, ++ NULL)); ++ else if (thumbnail->page_pyramid) ++ return (vips_image_new_from_source( ++ source->source, + source->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, + "page", (int) factor, +- NULL ) ); ++ NULL)); + else +- return( vips_image_new_from_source( +- source->source, ++ return (vips_image_new_from_source( ++ source->source, + source->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, +- NULL ) ); ++ NULL)); + } +- else if( vips_isprefix( "VipsForeignLoadHeif", thumbnail->loader ) ) { +- return( vips_image_new_from_source( +- source->source, ++ else if (vips_isprefix("VipsForeignLoadHeif", thumbnail->loader)) { ++ return (vips_image_new_from_source( ++ source->source, + source->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, + "thumbnail", (int) factor, +- NULL ) ); ++ NULL)); + } + else { +- return( vips_image_new_from_source( +- source->source, ++ return (vips_image_new_from_source( ++ source->source, + source->option_string, + "access", VIPS_ACCESS_SEQUENTIAL, +- NULL ) ); ++ NULL)); + } + } + + static void +-vips_thumbnail_source_class_init( VipsThumbnailClass *class ) ++vips_thumbnail_source_class_init(VipsThumbnailClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsThumbnailClass *thumbnail_class = VIPS_THUMBNAIL_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsThumbnailClass *thumbnail_class = VIPS_THUMBNAIL_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "thumbnail_source"; +- vobject_class->description = _( "generate thumbnail from source" ); ++ vobject_class->description = _("generate thumbnail from source"); + + thumbnail_class->get_info = vips_thumbnail_source_get_info; + thumbnail_class->open = vips_thumbnail_source_open; + +- VIPS_ARG_OBJECT( class, "source", 1, +- _( "Source" ), +- _( "Source to load from" ), +- VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsThumbnailSource, source ), +- VIPS_TYPE_SOURCE ); ++ VIPS_ARG_OBJECT(class, "source", 1, ++ _("Source"), ++ _("Source to load from"), ++ VIPS_ARGUMENT_REQUIRED_INPUT, ++ G_STRUCT_OFFSET(VipsThumbnailSource, source), ++ VIPS_TYPE_SOURCE); + +- VIPS_ARG_STRING( class, "option_string", 20, +- _( "Extra options" ), +- _( "Options that are passed on to the underlying loader" ), ++ VIPS_ARG_STRING(class, "option_string", 20, ++ _("Extra options"), ++ _("Options that are passed on to the underlying loader"), + VIPS_ARGUMENT_OPTIONAL_INPUT, +- G_STRUCT_OFFSET( VipsThumbnailSource, option_string ), +- "" ); +- ++ G_STRUCT_OFFSET(VipsThumbnailSource, option_string), ++ ""); + } + + static void +-vips_thumbnail_source_init( VipsThumbnailSource *source ) ++vips_thumbnail_source_init(VipsThumbnailSource *source) + { + } + +@@ -1714,16 +1709,16 @@ vips_thumbnail_source_init( VipsThumbnailSource *source ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_thumbnail_source( VipsSource *source, VipsImage **out, int width, ... ) ++vips_thumbnail_source(VipsSource *source, VipsImage **out, int width, ...) + { + va_list ap; + int result; + +- va_start( ap, width ); +- result = vips_call_split( "thumbnail_source", ap, source, out, width ); +- va_end( ap ); ++ va_start(ap, width); ++ result = vips_call_split("thumbnail_source", ap, source, out, width); ++ va_end(ap); + +- return( result ); ++ return (result); + } + + typedef struct _VipsThumbnailImage { +@@ -1734,13 +1729,13 @@ typedef struct _VipsThumbnailImage { + + typedef VipsThumbnailClass VipsThumbnailImageClass; + +-G_DEFINE_TYPE( VipsThumbnailImage, vips_thumbnail_image, +- vips_thumbnail_get_type() ); ++G_DEFINE_TYPE(VipsThumbnailImage, vips_thumbnail_image, ++ vips_thumbnail_get_type()); + + /* Get the info from a image. + */ + static int +-vips_thumbnail_image_get_info( VipsThumbnail *thumbnail ) ++vips_thumbnail_image_get_info(VipsThumbnail *thumbnail) + { + VipsThumbnailImage *image = (VipsThumbnailImage *) thumbnail; + +@@ -1748,57 +1743,56 @@ vips_thumbnail_image_get_info( VipsThumbnail *thumbnail ) + */ + thumbnail->loader = "image source"; + +- vips_thumbnail_read_header( thumbnail, image->in ); ++ vips_thumbnail_read_header(thumbnail, image->in); + +- return( 0 ); ++ return (0); + } + + /* Open an image. We can't pre-shrink with an image source, sadly. + */ + static VipsImage * +-vips_thumbnail_image_open( VipsThumbnail *thumbnail, double factor ) ++vips_thumbnail_image_open(VipsThumbnail *thumbnail, double factor) + { + VipsThumbnailImage *image = (VipsThumbnailImage *) thumbnail; +- VipsImage **t = (VipsImage **) +- vips_object_local_array( VIPS_OBJECT( thumbnail ), 1 ); ++ VipsImage **t = (VipsImage **) ++ vips_object_local_array(VIPS_OBJECT(thumbnail), 1); + + /* We want thumbnail to run in sequential mode on this image, or we + * may get horrible cache thrashing. + */ +- if( vips_sequential( image->in, &t[0], "tile-height", 16, NULL ) ) +- return( NULL ); ++ if (vips_sequential(image->in, &t[0], "tile-height", 16, NULL)) ++ return (NULL); + +- g_object_ref( t[0] ); ++ g_object_ref(t[0]); + +- return( t[0] ); ++ return (t[0]); + } + + static void +-vips_thumbnail_image_class_init( VipsThumbnailClass *class ) ++vips_thumbnail_image_class_init(VipsThumbnailClass *class) + { +- GObjectClass *gobject_class = G_OBJECT_CLASS( class ); +- VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); +- VipsThumbnailClass *thumbnail_class = VIPS_THUMBNAIL_CLASS( class ); ++ GObjectClass *gobject_class = G_OBJECT_CLASS(class); ++ VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS(class); ++ VipsThumbnailClass *thumbnail_class = VIPS_THUMBNAIL_CLASS(class); + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + vobject_class->nickname = "thumbnail_image"; +- vobject_class->description = _( "generate thumbnail from image" ); ++ vobject_class->description = _("generate thumbnail from image"); + + thumbnail_class->get_info = vips_thumbnail_image_get_info; + thumbnail_class->open = vips_thumbnail_image_open; + +- VIPS_ARG_IMAGE( class, "in", 1, +- _( "Input" ), +- _( "Input image argument" ), ++ VIPS_ARG_IMAGE(class, "in", 1, ++ _("Input"), ++ _("Input image argument"), + VIPS_ARGUMENT_REQUIRED_INPUT, +- G_STRUCT_OFFSET( VipsThumbnailImage, in ) ); +- ++ G_STRUCT_OFFSET(VipsThumbnailImage, in)); + } + + static void +-vips_thumbnail_image_init( VipsThumbnailImage *image ) ++vips_thumbnail_image_init(VipsThumbnailImage *image) + { + } + +@@ -1821,7 +1815,7 @@ vips_thumbnail_image_init( VipsThumbnailImage *image ) + * * @intent: #VipsIntent, rendering intent + * * @fail_on: #VipsFailOn, load error types to fail on + * +- * Exactly as vips_thumbnail(), but read from an existing image. ++ * Exactly as vips_thumbnail(), but read from an existing image. + * + * This operation + * is not able to exploit shrink-on-load features of image load libraries, so +@@ -1833,14 +1827,14 @@ vips_thumbnail_image_init( VipsThumbnailImage *image ) + * Returns: 0 on success, -1 on error. + */ + int +-vips_thumbnail_image( VipsImage *in, VipsImage **out, int width, ... ) ++vips_thumbnail_image(VipsImage *in, VipsImage **out, int width, ...) + { + va_list ap; + int result; + +- va_start( ap, width ); +- result = vips_call_split( "thumbnail_image", ap, in, out, width ); +- va_end( ap ); ++ va_start(ap, width); ++ result = vips_call_split("thumbnail_image", ap, in, out, width); ++ va_end(ap); + +- return( result ); ++ return (result); + } +diff --git a/libvips/resample/transform.c b/libvips/resample/transform.c +index a0c63762d7..71a24f9f32 100644 +--- a/libvips/resample/transform.c ++++ b/libvips/resample/transform.c +@@ -3,28 +3,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -43,22 +43,22 @@ + #include + #include + +-/* DBL_MIN is smallest *normalized* double precision float ++/* DBL_MIN is smallest *normalized* double precision float + */ + #define TOO_SMALL (2.0 * DBL_MIN) + + /* Calculate the inverse transformation. + */ + int +-vips__transform_calc_inverse( VipsTransformation *trn ) ++vips__transform_calc_inverse(VipsTransformation *trn) + { + double det = trn->a * trn->d - trn->b * trn->c; + +- if( fabs( det ) < TOO_SMALL ) { ++ if (fabs(det) < TOO_SMALL) { + /* divisor is near zero */ +- vips_error( "vips__transform_calc_inverse", +- "%s", _( "singular or near-singular matrix" ) ); +- return( -1 ); ++ vips_error("vips__transform_calc_inverse", ++ "%s", _("singular or near-singular matrix")); ++ return (-1); + } + + double tmp = 1.0 / det; +@@ -68,13 +68,13 @@ vips__transform_calc_inverse( VipsTransformation *trn ) + trn->ic = -tmp * trn->c; + trn->id = tmp * trn->a; + +- return( 0 ); ++ return (0); + } + + /* Init a VipsTransform. + */ + void +-vips__transform_init( VipsTransformation *trn ) ++vips__transform_init(VipsTransformation *trn) + { + trn->oarea.left = 0; + trn->oarea.top = 0; +@@ -84,7 +84,7 @@ vips__transform_init( VipsTransformation *trn ) + trn->iarea.top = 0; + trn->iarea.width = -1; + trn->iarea.height = -1; +- trn->a = 1.0; /* Identity transform */ ++ trn->a = 1.0; /* Identity transform */ + trn->b = 0.0; + trn->c = 0.0; + trn->d = 1.0; +@@ -93,28 +93,28 @@ vips__transform_init( VipsTransformation *trn ) + trn->odx = 0.0; + trn->ody = 0.0; + +- (void) vips__transform_calc_inverse( trn ); ++ (void) vips__transform_calc_inverse(trn); + } + + /* Test for transform is identity function. + */ + int +-vips__transform_isidentity( const VipsTransformation *trn ) ++vips__transform_isidentity(const VipsTransformation *trn) + { +- if( trn->a == 1.0 && trn->b == 0.0 && +- trn->c == 0.0 && trn->d == 1.0 && ++ if (trn->a == 1.0 && trn->b == 0.0 && ++ trn->c == 0.0 && trn->d == 1.0 && + trn->idx == 0.0 && trn->idy == 0.0 && +- trn->odx == 0.0 && trn->ody == 0.0 ) +- return( 1 ); ++ trn->odx == 0.0 && trn->ody == 0.0) ++ return (1); + else +- return( 0 ); ++ return (0); + } + + /* Combine two transformations. out can be one of the ins. + */ + int +-vips__transform_add( const VipsTransformation *in1, +- const VipsTransformation *in2, VipsTransformation *out ) ++vips__transform_add(const VipsTransformation *in1, ++ const VipsTransformation *in2, VipsTransformation *out) + { + out->a = in1->a * in2->a + in1->c * in2->b; + out->b = in1->b * in2->a + in1->d * in2->b; +@@ -126,38 +126,38 @@ vips__transform_add( const VipsTransformation *in1, + out->odx = in1->odx * in2->a + in1->ody * in2->b + in2->odx; + out->ody = in1->odx * in2->c + in1->ody * in2->d + in2->ody; + +- if( vips__transform_calc_inverse( out ) ) +- return( -1 ); ++ if (vips__transform_calc_inverse(out)) ++ return (-1); + +- return( 0 ); ++ return (0); + } + +-void +-vips__transform_print( const VipsTransformation *trn ) ++void ++vips__transform_print(const VipsTransformation *trn) + { +- printf( "vips__transform_print:\n" ); +- printf( " iarea: left=%d, top=%d, width=%d, height=%d\n", ++ printf("vips__transform_print:\n"); ++ printf(" iarea: left=%d, top=%d, width=%d, height=%d\n", + trn->iarea.left, + trn->iarea.top, + trn->iarea.width, +- trn->iarea.height ); +- printf( " oarea: left=%d, top=%d, width=%d, height=%d\n", ++ trn->iarea.height); ++ printf(" oarea: left=%d, top=%d, width=%d, height=%d\n", + trn->oarea.left, + trn->oarea.top, + trn->oarea.width, +- trn->oarea.height ); +- printf( " mat: a=%g, b=%g, c=%g, d=%g\n", +- trn->a, trn->b, trn->c, trn->d ); +- printf( " off: odx=%g, ody=%g, idx=%g, idy=%g\n", +- trn->odx, trn->ody, trn->idx, trn->idy ); ++ trn->oarea.height); ++ printf(" mat: a=%g, b=%g, c=%g, d=%g\n", ++ trn->a, trn->b, trn->c, trn->d); ++ printf(" off: odx=%g, ody=%g, idx=%g, idy=%g\n", ++ trn->odx, trn->ody, trn->idx, trn->idy); + } + +-/* Map a pixel coordinate through the transform. ++/* Map a pixel coordinate through the transform. + */ + void +-vips__transform_forward_point( const VipsTransformation *trn, +- double x, double y, /* In input space */ +- double *ox, double *oy )/* In output space */ ++vips__transform_forward_point(const VipsTransformation *trn, ++ double x, double y, /* In input space */ ++ double *ox, double *oy) /* In output space */ + { + x += trn->idx; + y += trn->idy; +@@ -166,12 +166,12 @@ vips__transform_forward_point( const VipsTransformation *trn, + *oy = trn->c * x + trn->d * y + trn->ody; + } + +-/* Map a pixel coordinate through the inverse transform. ++/* Map a pixel coordinate through the inverse transform. + */ + void +-vips__transform_invert_point( const VipsTransformation *trn, +- double x, double y, /* In output space */ +- double *ox, double *oy )/* In input space */ ++vips__transform_invert_point(const VipsTransformation *trn, ++ double x, double y, /* In output space */ ++ double *ox, double *oy) /* In input space */ + { + x -= trn->odx; + y -= trn->ody; +@@ -180,17 +180,17 @@ vips__transform_invert_point( const VipsTransformation *trn, + *oy = trn->ic * x + trn->id * y - trn->idy; + } + +-typedef void (*transform_fn)( const VipsTransformation *, +- const double, const double, double*, double* ); ++typedef void (*transform_fn)(const VipsTransformation *, ++ const double, const double, double *, double *); + + /* Transform a rect using a point transformer. + */ + static void +-transform_rect( const VipsTransformation *trn, transform_fn transform, +- const VipsRect *in, /* In input space */ +- VipsRect *out ) /* In output space */ ++transform_rect(const VipsTransformation *trn, transform_fn transform, ++ const VipsRect *in, /* In input space */ ++ VipsRect *out) /* In output space */ + { +- double x1, y1; /* Map corners */ ++ double x1, y1; /* Map corners */ + double x2, y2; + double x3, y3; + double x4, y4; +@@ -198,55 +198,55 @@ transform_rect( const VipsTransformation *trn, transform_fn transform, + + /* Map input VipsRect. + */ +- transform( trn, in->left, in->top, +- &x1, &y1 ); +- transform( trn, in->left, VIPS_RECT_BOTTOM( in ), +- &x3, &y3 ); +- transform( trn, VIPS_RECT_RIGHT( in ), in->top, +- &x2, &y2 ); +- transform( trn, VIPS_RECT_RIGHT( in ), VIPS_RECT_BOTTOM( in ), +- &x4, &y4 ); ++ transform(trn, in->left, in->top, ++ &x1, &y1); ++ transform(trn, in->left, VIPS_RECT_BOTTOM(in), ++ &x3, &y3); ++ transform(trn, VIPS_RECT_RIGHT(in), in->top, ++ &x2, &y2); ++ transform(trn, VIPS_RECT_RIGHT(in), VIPS_RECT_BOTTOM(in), ++ &x4, &y4); + + /* Find bounding box for these four corners. Round-to-nearest to try + * to stop rounding errors growing images. + */ +- left = VIPS_MIN( x1, VIPS_MIN( x2, VIPS_MIN( x3, x4 ) ) ); +- right = VIPS_MAX( x1, VIPS_MAX( x2, VIPS_MAX( x3, x4 ) ) ); +- top = VIPS_MIN( y1, VIPS_MIN( y2, VIPS_MIN( y3, y4 ) ) ); +- bottom = VIPS_MAX( y1, VIPS_MAX( y2, VIPS_MAX( y3, y4 ) ) ); +- +- out->left = VIPS_ROUND_INT( left ); +- out->top = VIPS_ROUND_INT( top ); +- out->width = VIPS_ROUND_INT( right - left ); +- out->height = VIPS_ROUND_INT( bottom - top ); ++ left = VIPS_MIN(x1, VIPS_MIN(x2, VIPS_MIN(x3, x4))); ++ right = VIPS_MAX(x1, VIPS_MAX(x2, VIPS_MAX(x3, x4))); ++ top = VIPS_MIN(y1, VIPS_MIN(y2, VIPS_MIN(y3, y4))); ++ bottom = VIPS_MAX(y1, VIPS_MAX(y2, VIPS_MAX(y3, y4))); ++ ++ out->left = VIPS_ROUND_INT(left); ++ out->top = VIPS_ROUND_INT(top); ++ out->width = VIPS_ROUND_INT(right - left); ++ out->height = VIPS_ROUND_INT(bottom - top); + } + + /* Given an area in the input image, calculate the bounding box for those + * pixels in the output image. + */ + void +-vips__transform_forward_rect( const VipsTransformation *trn, +- const VipsRect *in, /* In input space */ +- VipsRect *out ) /* In output space */ ++vips__transform_forward_rect(const VipsTransformation *trn, ++ const VipsRect *in, /* In input space */ ++ VipsRect *out) /* In output space */ + { +- transform_rect( trn, vips__transform_forward_point, in, out ); ++ transform_rect(trn, vips__transform_forward_point, in, out); + } + +-/* Given an area in the output image, calculate the bounding box for the ++/* Given an area in the output image, calculate the bounding box for the + * corresponding pixels in the input image. + */ + void +-vips__transform_invert_rect( const VipsTransformation *trn, +- const VipsRect *in, /* In output space */ +- VipsRect *out ) /* In input space */ ++vips__transform_invert_rect(const VipsTransformation *trn, ++ const VipsRect *in, /* In output space */ ++ VipsRect *out) /* In input space */ + { +- transform_rect( trn, vips__transform_invert_point, in, out ); ++ transform_rect(trn, vips__transform_invert_point, in, out); + } + + /* Set output area of trn so that it just holds all of our input pels. + */ + void +-vips__transform_set_area( VipsTransformation *trn ) ++vips__transform_set_area(VipsTransformation *trn) + { +- vips__transform_forward_rect( trn, &trn->iarea, &trn->oarea ); ++ vips__transform_forward_rect(trn, &trn->iarea, &trn->oarea); + } +diff --git a/libvips/resample/vsqbs.cpp b/libvips/resample/vsqbs.cpp +index 01133d0702..bb14890dfb 100644 +--- a/libvips/resample/vsqbs.cpp ++++ b/libvips/resample/vsqbs.cpp +@@ -7,28 +7,28 @@ + + /* + +- This file is part of VIPS. ++ This file is part of VIPS. + +- VIPS is free software; you can redistribute it and/or modify it +- under the terms of the GNU Lesser General Public License as +- published by the Free Software Foundation; either version 2 of the +- License, or (at your option) any later version. ++ VIPS is free software; you can redistribute it and/or modify it ++ under the terms of the GNU Lesser General Public License as ++ published by the Free Software Foundation; either version 2 of the ++ License, or (at your option) any later version. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- Lesser General Public License for more details. ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. + +- You should have received a copy of the GNU Lesser General Public +- License along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ You should have received a copy of the GNU Lesser General Public ++ License along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -94,19 +94,19 @@ + + #define VIPS_TYPE_INTERPOLATE_VSQBS \ + (vips_interpolate_vsqbs_get_type()) +-#define VIPS_INTERPOLATE_VSQBS( obj ) \ +- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \ +- VIPS_TYPE_INTERPOLATE_VSQBS, VipsInterpolateVsqbs )) +-#define VIPS_INTERPOLATE_VSQBS_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_CAST( (klass), \ +- VIPS_TYPE_INTERPOLATE_VSQBS, VipsInterpolateVsqbsClass)) +-#define VIPS_IS_INTERPOLATE_VSQBS( obj ) \ +- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_INTERPOLATE_VSQBS )) +-#define VIPS_IS_INTERPOLATE_VSQBS_CLASS( klass ) \ +- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_INTERPOLATE_VSQBS )) +-#define VIPS_INTERPOLATE_VSQBS_GET_CLASS( obj ) \ +- (G_TYPE_INSTANCE_GET_CLASS( (obj), \ +- VIPS_TYPE_INTERPOLATE_VSQBS, VipsInterpolateVsqbsClass )) ++#define VIPS_INTERPOLATE_VSQBS(obj) \ ++ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ ++ VIPS_TYPE_INTERPOLATE_VSQBS, VipsInterpolateVsqbs)) ++#define VIPS_INTERPOLATE_VSQBS_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_CAST((klass), \ ++ VIPS_TYPE_INTERPOLATE_VSQBS, VipsInterpolateVsqbsClass)) ++#define VIPS_IS_INTERPOLATE_VSQBS(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_INTERPOLATE_VSQBS)) ++#define VIPS_IS_INTERPOLATE_VSQBS_CLASS(klass) \ ++ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_INTERPOLATE_VSQBS)) ++#define VIPS_INTERPOLATE_VSQBS_GET_CLASS(obj) \ ++ (G_TYPE_INSTANCE_GET_CLASS((obj), \ ++ VIPS_TYPE_INTERPOLATE_VSQBS, VipsInterpolateVsqbsClass)) + + typedef struct _VipsInterpolateVsqbs { + VipsInterpolate parent_object; +@@ -176,240 +176,215 @@ typedef struct _VipsInterpolateVsqbsClass { + * templates somehow---for one thing this would allow code + * comments---but we can't figure a clean way to do it.) + */ +-#define VSQBS_CONVERSION( conversion ) \ +- template static void inline \ +- vsqbs_ ## conversion( void* restrict pout, \ +- const VipsPel* restrict pin, \ +- const int bands, \ +- const int lskip, \ +- const double x_0, \ +- const double y_0 ) \ +- { \ +- T* restrict out = (T *) pout; \ +- \ +- const T* restrict in = (T *) pin; \ +- \ +- const int sign_of_x_0 = 2 * ( x_0 >= 0. ) - 1; \ +- const int sign_of_y_0 = 2 * ( y_0 >= 0. ) - 1; \ +- \ +- const int shift_forw_1_pix = sign_of_x_0 * bands; \ +- const int shift_forw_1_row = sign_of_y_0 * lskip; \ +- \ +- const int shift_back_1_pix = -shift_forw_1_pix; \ +- const int shift_back_1_row = -shift_forw_1_row; \ +- \ +- const int uno_two_shift = shift_back_1_row; \ +- const int uno_thr_shift = shift_forw_1_pix + shift_back_1_row; \ +- \ +- const int dos_one_shift = shift_back_1_pix; \ +- const int dos_two_shift = 0; \ +- const int dos_thr_shift = shift_forw_1_pix; \ +- \ +- const int tre_one_shift = shift_back_1_pix + shift_forw_1_row; \ +- const int tre_two_shift = shift_forw_1_row; \ +- const int tre_thr_shift = shift_forw_1_pix + shift_forw_1_row; \ +- \ +- \ +- const double twice_abs_x_0 = ( 2 * sign_of_x_0 ) * x_0; \ +- const double twice_abs_y_0 = ( 2 * sign_of_y_0 ) * y_0; \ +- const double x = twice_abs_x_0 + -0.5; \ +- const double y = twice_abs_y_0 + -0.5; \ +- const double cent = 0.75 - x * x; \ +- const double mid = 0.75 - y * y; \ +- const double left = -0.5 * ( x + cent ) + 0.5; \ +- const double top = -0.5 * ( y + mid ) + 0.5; \ +- const double left_p_cent = left + cent; \ +- const double top_p_mid = top + mid; \ +- const double cent_p_rite = 1.0 - left; \ +- const double mid_p_bot = 1.0 - top; \ +- const double rite = 1.0 - left_p_cent; \ +- const double bot = 1.0 - top_p_mid; \ +- \ +- const double four_c_uno_two = left_p_cent * top; \ +- const double four_c_dos_one = left * top_p_mid; \ +- const double four_c_dos_two = left_p_cent + top_p_mid; \ +- const double four_c_dos_thr = cent_p_rite * top_p_mid + rite; \ +- const double four_c_tre_two = mid_p_bot * left_p_cent + bot; \ +- const double four_c_tre_thr = mid_p_bot * rite + cent_p_rite * bot; \ +- const double four_c_uno_thr = top - four_c_uno_two; \ +- const double four_c_tre_one = left - four_c_dos_one; \ +- \ +- \ +- int band = bands; \ +- \ +- do \ +- { \ +- const double double_result = \ +- ( \ +- ( \ +- ( \ +- four_c_uno_two * in[uno_two_shift] \ +- + \ +- four_c_dos_one * in[dos_one_shift] \ +- ) \ +- + \ +- ( \ +- four_c_dos_two * in[dos_two_shift] \ +- + \ +- four_c_dos_thr * in[dos_thr_shift] \ +- ) \ +- ) \ +- + \ +- ( \ +- ( \ +- four_c_tre_two * in[tre_two_shift] \ +- + \ +- four_c_tre_thr * in[tre_thr_shift] \ +- ) \ +- + \ +- ( \ +- four_c_uno_thr * in[uno_thr_shift] \ +- + \ +- four_c_tre_one * in[tre_one_shift] \ +- ) \ +- ) \ +- ) * 0.25; \ +- \ +- const T result = to_ ## conversion( double_result ); \ +- in++; \ +- *out++ = result; \ +- \ +- } while (--band); \ +- } +- +- +-VSQBS_CONVERSION( fptypes ) +-VSQBS_CONVERSION( withsign ) +-VSQBS_CONVERSION( nosign ) +- +- +-#define CALL( T, conversion ) \ +- vsqbs_ ## conversion( out, \ +- p, \ +- bands, \ +- lskip, \ +- relative_x, \ +- relative_y ); +- ++#define VSQBS_CONVERSION(conversion) \ ++ template \ ++ static void inline vsqbs_##conversion(void *restrict pout, \ ++ const VipsPel *restrict pin, \ ++ const int bands, \ ++ const int lskip, \ ++ const double x_0, \ ++ const double y_0) \ ++ { \ ++ T *restrict out = (T *) pout; \ ++\ ++ const T *restrict in = (T *) pin; \ ++\ ++ const int sign_of_x_0 = 2 * (x_0 >= 0.) - 1; \ ++ const int sign_of_y_0 = 2 * (y_0 >= 0.) - 1; \ ++\ ++ const int shift_forw_1_pix = sign_of_x_0 * bands; \ ++ const int shift_forw_1_row = sign_of_y_0 * lskip; \ ++\ ++ const int shift_back_1_pix = -shift_forw_1_pix; \ ++ const int shift_back_1_row = -shift_forw_1_row; \ ++\ ++ const int uno_two_shift = shift_back_1_row; \ ++ const int uno_thr_shift = shift_forw_1_pix + shift_back_1_row; \ ++\ ++ const int dos_one_shift = shift_back_1_pix; \ ++ const int dos_two_shift = 0; \ ++ const int dos_thr_shift = shift_forw_1_pix; \ ++\ ++ const int tre_one_shift = shift_back_1_pix + shift_forw_1_row; \ ++ const int tre_two_shift = shift_forw_1_row; \ ++ const int tre_thr_shift = shift_forw_1_pix + shift_forw_1_row; \ ++\ ++ const double twice_abs_x_0 = (2 * sign_of_x_0) * x_0; \ ++ const double twice_abs_y_0 = (2 * sign_of_y_0) * y_0; \ ++ const double x = twice_abs_x_0 + -0.5; \ ++ const double y = twice_abs_y_0 + -0.5; \ ++ const double cent = 0.75 - x * x; \ ++ const double mid = 0.75 - y * y; \ ++ const double left = -0.5 * (x + cent) + 0.5; \ ++ const double top = -0.5 * (y + mid) + 0.5; \ ++ const double left_p_cent = left + cent; \ ++ const double top_p_mid = top + mid; \ ++ const double cent_p_rite = 1.0 - left; \ ++ const double mid_p_bot = 1.0 - top; \ ++ const double rite = 1.0 - left_p_cent; \ ++ const double bot = 1.0 - top_p_mid; \ ++\ ++ const double four_c_uno_two = left_p_cent * top; \ ++ const double four_c_dos_one = left * top_p_mid; \ ++ const double four_c_dos_two = left_p_cent + top_p_mid; \ ++ const double four_c_dos_thr = cent_p_rite * top_p_mid + rite; \ ++ const double four_c_tre_two = mid_p_bot * left_p_cent + bot; \ ++ const double four_c_tre_thr = mid_p_bot * rite + cent_p_rite * bot; \ ++ const double four_c_uno_thr = top - four_c_uno_two; \ ++ const double four_c_tre_one = left - four_c_dos_one; \ ++\ ++ int band = bands; \ ++\ ++ do { \ ++ const double double_result = \ ++ (( \ ++ ( \ ++ four_c_uno_two * in[uno_two_shift] + \ ++ four_c_dos_one * in[dos_one_shift]) + \ ++ (four_c_dos_two * in[dos_two_shift] + \ ++ four_c_dos_thr * in[dos_thr_shift])) + \ ++ (( \ ++ four_c_tre_two * in[tre_two_shift] + \ ++ four_c_tre_thr * in[tre_thr_shift]) + \ ++ (four_c_uno_thr * in[uno_thr_shift] + \ ++ four_c_tre_one * in[tre_one_shift]))) * \ ++ 0.25; \ ++\ ++ const T result = to_##conversion(double_result); \ ++ in++; \ ++ *out++ = result; \ ++\ ++ } while (--band); \ ++ } ++ ++VSQBS_CONVERSION(fptypes) ++VSQBS_CONVERSION(withsign) ++VSQBS_CONVERSION(nosign) ++ ++#define CALL(T, conversion) \ ++ vsqbs_##conversion(out, \ ++ p, \ ++ bands, \ ++ lskip, \ ++ relative_x, \ ++ relative_y); + + /* + * We need C linkage: + */ + extern "C" { +- G_DEFINE_TYPE( VipsInterpolateVsqbs, vips_interpolate_vsqbs, +- VIPS_TYPE_INTERPOLATE ); ++G_DEFINE_TYPE(VipsInterpolateVsqbs, vips_interpolate_vsqbs, ++ VIPS_TYPE_INTERPOLATE); + } + +- + static void +-vips_interpolate_vsqbs_interpolate( VipsInterpolate* restrict interpolate, +- void* restrict out, +- VipsRegion* restrict in, +- double absolute_x, +- double absolute_y ) ++vips_interpolate_vsqbs_interpolate(VipsInterpolate *restrict interpolate, ++ void *restrict out, ++ VipsRegion *restrict in, ++ double absolute_x, ++ double absolute_y) + { +- /* absolute_x and absolute_y are always >= 1.0 (see double-check assert +- * below), so we don't need floor(). +- * +- * It's 1 not 0 since we ask for a window_offset of 1 at the bottom. +- */ +- const int ix = (int) (absolute_x + 0.5); +- const int iy = (int) (absolute_y + 0.5); +- +- /* +- * Move the pointer to (the first band of) the top/left pixel of the +- * 2x2 group of pixel centers which contains the sampling location +- * in its convex hull: +- */ +- const VipsPel* restrict p = VIPS_REGION_ADDR( in, ix, iy ); +- +- const double relative_x = absolute_x - ix; +- const double relative_y = absolute_y - iy; +- +- /* +- * VIPS versions of Nicolas's pixel addressing values. +- */ +- const int lskip = VIPS_REGION_LSKIP( in ) / +- VIPS_IMAGE_SIZEOF_ELEMENT( in->im ); +- +- /* +- * Double the bands for complex images to account for the real and +- * imaginary parts being computed independently: +- */ +- const int actual_bands = in->im->Bands; +- const int bands = +- vips_band_format_iscomplex( in->im->BandFmt ) ? +- 2 * actual_bands : actual_bands; +- +- g_assert( ix - 1 >= in->valid.left ); +- g_assert( iy - 1 >= in->valid.top ); +- g_assert( ix + 1 <= VIPS_RECT_RIGHT( &in->valid ) ); +- g_assert( iy + 1 <= VIPS_RECT_BOTTOM( &in->valid ) ); +- +- /* Confirm that absolute_x and absolute_y are >= 1, see above. +- */ +- g_assert( absolute_x >= 1.0 ); +- g_assert( absolute_y >= 1.0 ); +- +- switch( in->im->BandFmt ) { +- case VIPS_FORMAT_UCHAR: +- CALL( unsigned char, nosign ); +- break; +- +- case VIPS_FORMAT_CHAR: +- CALL( signed char, withsign ); +- break; +- +- case VIPS_FORMAT_USHORT: +- CALL( unsigned short, nosign ); +- break; +- +- case VIPS_FORMAT_SHORT: +- CALL( signed short, withsign ); +- break; +- +- case VIPS_FORMAT_UINT: +- CALL( unsigned int, nosign ); +- break; +- +- case VIPS_FORMAT_INT: +- CALL( signed int, withsign ); +- break; +- +- /* +- * Complex images are handled by doubling bands: +- */ +- case VIPS_FORMAT_FLOAT: +- case VIPS_FORMAT_COMPLEX: +- CALL( float, fptypes ); +- break; +- +- case VIPS_FORMAT_DOUBLE: +- case VIPS_FORMAT_DPCOMPLEX: +- CALL( double, fptypes ); +- break; +- +- default: +- g_assert( 0 ); +- break; +- } ++ /* absolute_x and absolute_y are always >= 1.0 (see double-check assert ++ * below), so we don't need floor(). ++ * ++ * It's 1 not 0 since we ask for a window_offset of 1 at the bottom. ++ */ ++ const int ix = (int) (absolute_x + 0.5); ++ const int iy = (int) (absolute_y + 0.5); ++ ++ /* ++ * Move the pointer to (the first band of) the top/left pixel of the ++ * 2x2 group of pixel centers which contains the sampling location ++ * in its convex hull: ++ */ ++ const VipsPel *restrict p = VIPS_REGION_ADDR(in, ix, iy); ++ ++ const double relative_x = absolute_x - ix; ++ const double relative_y = absolute_y - iy; ++ ++ /* ++ * VIPS versions of Nicolas's pixel addressing values. ++ */ ++ const int lskip = VIPS_REGION_LSKIP(in) / ++ VIPS_IMAGE_SIZEOF_ELEMENT(in->im); ++ ++ /* ++ * Double the bands for complex images to account for the real and ++ * imaginary parts being computed independently: ++ */ ++ const int actual_bands = in->im->Bands; ++ const int bands = ++ vips_band_format_iscomplex(in->im->BandFmt) ? 2 * actual_bands : actual_bands; ++ ++ g_assert(ix - 1 >= in->valid.left); ++ g_assert(iy - 1 >= in->valid.top); ++ g_assert(ix + 1 <= VIPS_RECT_RIGHT(&in->valid)); ++ g_assert(iy + 1 <= VIPS_RECT_BOTTOM(&in->valid)); ++ ++ /* Confirm that absolute_x and absolute_y are >= 1, see above. ++ */ ++ g_assert(absolute_x >= 1.0); ++ g_assert(absolute_y >= 1.0); ++ ++ switch (in->im->BandFmt) { ++ case VIPS_FORMAT_UCHAR: ++ CALL(unsigned char, nosign); ++ break; ++ ++ case VIPS_FORMAT_CHAR: ++ CALL(signed char, withsign); ++ break; ++ ++ case VIPS_FORMAT_USHORT: ++ CALL(unsigned short, nosign); ++ break; ++ ++ case VIPS_FORMAT_SHORT: ++ CALL(signed short, withsign); ++ break; ++ ++ case VIPS_FORMAT_UINT: ++ CALL(unsigned int, nosign); ++ break; ++ ++ case VIPS_FORMAT_INT: ++ CALL(signed int, withsign); ++ break; ++ ++ /* ++ * Complex images are handled by doubling bands: ++ */ ++ case VIPS_FORMAT_FLOAT: ++ case VIPS_FORMAT_COMPLEX: ++ CALL(float, fptypes); ++ break; ++ ++ case VIPS_FORMAT_DOUBLE: ++ case VIPS_FORMAT_DPCOMPLEX: ++ CALL(double, fptypes); ++ break; ++ ++ default: ++ g_assert(0); ++ break; ++ } + } + + static void +-vips_interpolate_vsqbs_class_init( VipsInterpolateVsqbsClass *klass ) ++vips_interpolate_vsqbs_class_init(VipsInterpolateVsqbsClass *klass) + { +- VipsObjectClass *object_class = VIPS_OBJECT_CLASS( klass ); +- VipsInterpolateClass *interpolate_class = VIPS_INTERPOLATE_CLASS( klass ); ++ VipsObjectClass *object_class = VIPS_OBJECT_CLASS(klass); ++ VipsInterpolateClass *interpolate_class = VIPS_INTERPOLATE_CLASS(klass); + +- object_class->nickname = "vsqbs"; +- object_class->description = _( "B-Splines with antialiasing smoothing" ); ++ object_class->nickname = "vsqbs"; ++ object_class->description = _("B-Splines with antialiasing smoothing"); + +- interpolate_class->interpolate = vips_interpolate_vsqbs_interpolate; +- interpolate_class->window_size = 4; +- interpolate_class->window_offset = 1; ++ interpolate_class->interpolate = vips_interpolate_vsqbs_interpolate; ++ interpolate_class->window_size = 4; ++ interpolate_class->window_offset = 1; + } + + static void +-vips_interpolate_vsqbs_init( VipsInterpolateVsqbs *vsqbs ) ++vips_interpolate_vsqbs_init(VipsInterpolateVsqbs *vsqbs) + { + } +diff --git a/test/test_connections.c b/test/test_connections.c +index d59571c504..da4af854f2 100644 +--- a/test/test_connections.c ++++ b/test/test_connections.c +@@ -9,38 +9,38 @@ + #include + + typedef struct _MyInput { +- const char *filename; +- unsigned char *contents; ++ const char *filename; ++ unsigned char *contents; + size_t length; + size_t read_position; + } MyInput; + + typedef struct _MyOutput { +- const char *filename; ++ const char *filename; + int fd; + } MyOutput; + + static gint64 +-read_cb( VipsSourceCustom *source_custom, +- void *buffer, gint64 length, MyInput *my_input ) ++read_cb(VipsSourceCustom *source_custom, ++ void *buffer, gint64 length, MyInput *my_input) + { +- gint64 bytes_read = VIPS_MIN( length, +- my_input->length - my_input->read_position ); ++ gint64 bytes_read = VIPS_MIN(length, ++ my_input->length - my_input->read_position); + + /* + printf( "read_cb: buffer = 0x%p, length = %zd\n", buffer, length ); + */ + +- memcpy( buffer, +- my_input->contents + my_input->read_position, bytes_read ); ++ memcpy(buffer, ++ my_input->contents + my_input->read_position, bytes_read); + my_input->read_position += bytes_read; + +- return( bytes_read ); ++ return (bytes_read); + } + + static gint64 +-seek_cb( VipsSourceCustom *source_custom, +- gint64 offset, int whence, MyInput *my_input ) ++seek_cb(VipsSourceCustom *source_custom, ++ gint64 offset, int whence, MyInput *my_input) + { + gint64 new_pos; + +@@ -48,7 +48,7 @@ seek_cb( VipsSourceCustom *source_custom, + printf( "seek_cb: offset = %zd, whence = %d\n", offset, whence ); + */ + +- switch( whence ) { ++ switch (whence) { + case SEEK_SET: + new_pos = offset; + break; +@@ -62,18 +62,18 @@ seek_cb( VipsSourceCustom *source_custom, + break; + + default: +- vips_error( "demo", "%s", "bad 'whence'" ); +- return( -1 ); ++ vips_error("demo", "%s", "bad 'whence'"); ++ return (-1); + } + +- my_input->read_position = VIPS_CLIP( 0, new_pos, my_input->length ); ++ my_input->read_position = VIPS_CLIP(0, new_pos, my_input->length); + +- return( my_input->read_position ); ++ return (my_input->read_position); + } + + static gint64 +-write_cb( VipsTargetCustom *target_custom, +- const void *data, gint64 length, MyOutput *my_output ) ++write_cb(VipsTargetCustom *target_custom, ++ const void *data, gint64 length, MyOutput *my_output) + { + gint64 bytes_written; + +@@ -81,24 +81,24 @@ write_cb( VipsTargetCustom *target_custom, + printf( "write_cb: data = 0x%p, length = %zd\n", data, length ); + */ + +- bytes_written = write( my_output->fd, data, length ); ++ bytes_written = write(my_output->fd, data, length); + +- return( bytes_written ); ++ return (bytes_written); + } + + static void +-finish_cb( VipsTargetCustom *target_custom, MyOutput *my_output ) ++finish_cb(VipsTargetCustom *target_custom, MyOutput *my_output) + { + /* + printf( "finish_cb:\n" ); + */ + +- close( my_output->fd ); ++ close(my_output->fd); + my_output->fd = -1; + } + + int +-main( int argc, char **argv ) ++main(int argc, char **argv) + { + MyInput my_input; + MyOutput my_output; +@@ -106,54 +106,54 @@ main( int argc, char **argv ) + VipsTargetCustom *target_custom; + VipsImage *image; + +- if( VIPS_INIT( argv[0] ) ) +- return( -1 ); ++ if (VIPS_INIT(argv[0])) ++ return (-1); + +- if( argc != 3 ) +- vips_error_exit( "usage: %s in-file out-file.png", argv[0] ); ++ if (argc != 3) ++ vips_error_exit("usage: %s in-file out-file.png", argv[0]); + + my_input.filename = argv[1]; + my_input.contents = NULL; + my_input.length = 0; + my_input.read_position = 0; + +- if( !g_file_get_contents( my_input.filename, +- (char **) &my_input.contents, &my_input.length, NULL ) ) +- vips_error_exit( "unable to load from %s", my_input.filename ); ++ if (!g_file_get_contents(my_input.filename, ++ (char **) &my_input.contents, &my_input.length, NULL)) ++ vips_error_exit("unable to load from %s", my_input.filename); + + source_custom = vips_source_custom_new(); +- g_signal_connect( source_custom, "seek", +- G_CALLBACK( seek_cb ), &my_input ); +- g_signal_connect( source_custom, "read", +- G_CALLBACK( read_cb ), &my_input ); ++ g_signal_connect(source_custom, "seek", ++ G_CALLBACK(seek_cb), &my_input); ++ g_signal_connect(source_custom, "read", ++ G_CALLBACK(read_cb), &my_input); + +- if( !(image = vips_image_new_from_source( +- VIPS_SOURCE( source_custom ), "", +- "access", VIPS_ACCESS_SEQUENTIAL, +- NULL )) ) +- vips_error_exit( NULL ); ++ if (!(image = vips_image_new_from_source( ++ VIPS_SOURCE(source_custom), "", ++ "access", VIPS_ACCESS_SEQUENTIAL, ++ NULL))) ++ vips_error_exit(NULL); + + my_output.filename = argv[2]; + my_output.fd = -1; + +- if( (my_output.fd = vips__open( my_output.filename, +- O_WRONLY | O_CREAT | O_TRUNC, 0644 )) == -1 ) +- vips_error_exit( "unable to save to %s", my_output.filename ); ++ if ((my_output.fd = vips__open(my_output.filename, ++ O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1) ++ vips_error_exit("unable to save to %s", my_output.filename); + + target_custom = vips_target_custom_new(); +- g_signal_connect( target_custom, "write", +- G_CALLBACK( write_cb ), &my_output ); +- g_signal_connect( target_custom, "finish", +- G_CALLBACK( finish_cb ), &my_output ); ++ g_signal_connect(target_custom, "write", ++ G_CALLBACK(write_cb), &my_output); ++ g_signal_connect(target_custom, "finish", ++ G_CALLBACK(finish_cb), &my_output); + +- if( vips_image_write_to_target( image, ".png", +- VIPS_TARGET( target_custom ), NULL ) ) +- vips_error_exit( NULL ); ++ if (vips_image_write_to_target(image, ".png", ++ VIPS_TARGET(target_custom), NULL)) ++ vips_error_exit(NULL); + +- VIPS_UNREF( image ); +- VIPS_UNREF( source_custom ); +- VIPS_UNREF( target_custom ); +- g_free( my_input.contents ); ++ VIPS_UNREF(image); ++ VIPS_UNREF(source_custom); ++ VIPS_UNREF(target_custom); ++ g_free(my_input.contents); + +- return( 0 ); ++ return (0); + } +diff --git a/test/test_descriptors.c b/test/test_descriptors.c +index cc989b621d..8a72752eb3 100644 +--- a/test/test_descriptors.c ++++ b/test/test_descriptors.c +@@ -12,24 +12,24 @@ + /* Count the number of files in a directory, -1 for directory not found etc. + */ + static int +-count_files( const char *dirname ) ++count_files(const char *dirname) + { + GDir *dir; + int n; + +- if( !(dir = g_dir_open( dirname, 0, NULL )) ) +- return( -1 ); ++ if (!(dir = g_dir_open(dirname, 0, NULL))) ++ return (-1); + +- for( n = 0; g_dir_read_name( dir ); n++ ) ++ for (n = 0; g_dir_read_name(dir); n++) + ; + +- g_dir_close( dir ); ++ g_dir_close(dir); + +- return( n ); ++ return (n); + } + + int +-main( int argc, char **argv ) ++main(int argc, char **argv) + { + VipsSource *source; + VipsImage *image, *x; +@@ -37,18 +37,18 @@ main( int argc, char **argv ) + int n_files; + double average; + +- if( VIPS_INIT( argv[0] ) ) +- vips_error_exit( "unable to start" ); ++ if (VIPS_INIT(argv[0])) ++ vips_error_exit("unable to start"); + +- if( argc != 2 ) +- vips_error_exit( "usage: %s test-image", argv[0] ); ++ if (argc != 2) ++ vips_error_exit("usage: %s test-image", argv[0]); + +- vips_snprintf( fd_dir, 256, "/proc/%d/fd", getpid() ); +- n_files = count_files( fd_dir ); +- if( n_files == -1 ) ++ vips_snprintf(fd_dir, 256, "/proc/%d/fd", getpid()); ++ n_files = count_files(fd_dir); ++ if (n_files == -1) + /* Probably not linux, silent success. + */ +- return( 0 ); ++ return (0); + + /* This is usually 4. stdout / stdin / stderr plus one more made for + * us by glib, I think, doing what I don't know. +@@ -56,52 +56,52 @@ main( int argc, char **argv ) + + /* Opening an image should read the header, then close the fd. + */ +- printf( "** rand open ..\n" ); +- if( !(source = vips_source_new_from_file( argv[1] )) ) +- vips_error_exit( NULL ); +- if( !(image = vips_image_new_from_source( source, "", +- "access", VIPS_ACCESS_RANDOM, +- NULL )) ) +- vips_error_exit( NULL ); +- if( count_files( fd_dir ) != n_files ) +- vips_error_exit( "%s: fd not closed after header read", +- argv[1] ); ++ printf("** rand open ..\n"); ++ if (!(source = vips_source_new_from_file(argv[1]))) ++ vips_error_exit(NULL); ++ if (!(image = vips_image_new_from_source(source, "", ++ "access", VIPS_ACCESS_RANDOM, ++ NULL))) ++ vips_error_exit(NULL); ++ if (count_files(fd_dir) != n_files) ++ vips_error_exit("%s: fd not closed after header read", ++ argv[1]); + + /* We should be able to read a chunk near the top, then have the fd + * closed again. + */ +- printf( "** crop1, avg ..\n" ); +- if( vips_crop( image, &x, 0, 0, image->Xsize, 10, NULL ) || +- vips_avg( x, &average, NULL ) ) +- vips_error_exit( NULL ); +- g_object_unref( x ); +- if( count_files( fd_dir ) != n_files ) +- vips_error_exit( "%s: fd not closed after first read", +- argv[1] ); ++ printf("** crop1, avg ..\n"); ++ if (vips_crop(image, &x, 0, 0, image->Xsize, 10, NULL) || ++ vips_avg(x, &average, NULL)) ++ vips_error_exit(NULL); ++ g_object_unref(x); ++ if (count_files(fd_dir) != n_files) ++ vips_error_exit("%s: fd not closed after first read", ++ argv[1]); + + /* We should be able to read again, a little further down, and have + * the input restarted and closed again. + */ +- printf( "** crop2, avg ..\n" ); +- if( vips_crop( image, &x, 0, 20, image->Xsize, 10, NULL ) || +- vips_avg( x, &average, NULL ) ) +- vips_error_exit( NULL ); +- g_object_unref( x ); +- if( count_files( fd_dir ) != n_files ) +- vips_error_exit( "%s: fd not closed after second read", +- argv[1] ); ++ printf("** crop2, avg ..\n"); ++ if (vips_crop(image, &x, 0, 20, image->Xsize, 10, NULL) || ++ vips_avg(x, &average, NULL)) ++ vips_error_exit(NULL); ++ g_object_unref(x); ++ if (count_files(fd_dir) != n_files) ++ vips_error_exit("%s: fd not closed after second read", ++ argv[1]); + + /* Clean up, and we should still just have three open. + */ +- printf( "** unref ..\n" ); +- g_object_unref( image ); +- g_object_unref( source ); +- printf( "** shutdown ..\n" ); ++ printf("** unref ..\n"); ++ g_object_unref(image); ++ g_object_unref(source); ++ printf("** shutdown ..\n"); + vips_shutdown(); + +- if( count_files( fd_dir ) != n_files ) +- vips_error_exit( "%s: fd not closed after shutdown", +- argv[1] ); ++ if (count_files(fd_dir) != n_files) ++ vips_error_exit("%s: fd not closed after shutdown", ++ argv[1]); + +- return( 0 ); ++ return (0); + } +diff --git a/tools/vips.c b/tools/vips.c +index 62fadcb942..677cc1f72d 100644 +--- a/tools/vips.c ++++ b/tools/vips.c +@@ -51,28 +51,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -108,427 +108,427 @@ static char *main_option_plugin = NULL; + static gboolean main_option_version; + + static void * +-list_class( GType type, void *user_data ) ++list_class(GType type, void *user_data) + { +- VipsObjectClass *class = VIPS_OBJECT_CLASS( g_type_class_ref( type ) ); +- int depth = vips_type_depth( type ); ++ VipsObjectClass *class = VIPS_OBJECT_CLASS(g_type_class_ref(type)); ++ int depth = vips_type_depth(type); + + int i; + +- if( class->deprecated ) +- return( NULL ); +- if( VIPS_IS_OPERATION_CLASS( class ) && +- (VIPS_OPERATION_CLASS( class )->flags & +- VIPS_OPERATION_DEPRECATED) ) +- return( NULL ); ++ if (class->deprecated) ++ return (NULL); ++ if (VIPS_IS_OPERATION_CLASS(class) && ++ (VIPS_OPERATION_CLASS(class)->flags & ++ VIPS_OPERATION_DEPRECATED)) ++ return (NULL); + +- for( i = 0; i < depth * 2; i++ ) +- printf( " " ); +- vips_object_print_summary_class( +- VIPS_OBJECT_CLASS( g_type_class_ref( type ) ) ); ++ for (i = 0; i < depth * 2; i++) ++ printf(" "); ++ vips_object_print_summary_class( ++ VIPS_OBJECT_CLASS(g_type_class_ref(type))); + +- return( NULL ); ++ return (NULL); + } + + static void * +-test_nickname( GType type, void *data ) ++test_nickname(GType type, void *data) + { + const char *nickname = (const char *) data; + + VipsObjectClass *class; + +- if( (class = VIPS_OBJECT_CLASS( g_type_class_ref( type ) )) && +- strcmp( class->nickname, nickname ) == 0 ) +- return( class ); ++ if ((class = VIPS_OBJECT_CLASS(g_type_class_ref(type))) && ++ strcmp(class->nickname, nickname) == 0) ++ return (class); + +- return( NULL ); ++ return (NULL); + } + + static gboolean +-parse_main_option_list( const gchar *option_name, const gchar *value, +- gpointer data, GError **error ) ++parse_main_option_list(const gchar *option_name, const gchar *value, ++ gpointer data, GError **error) + { + VipsObjectClass *class; + +- if( value && +- (class = (VipsObjectClass *) vips_type_map_all( +- g_type_from_name( "VipsObject" ), +- test_nickname, (void *) value )) ) { +- vips_type_map_all( G_TYPE_FROM_CLASS( class ), +- list_class, NULL ); ++ if (value && ++ (class = (VipsObjectClass *) vips_type_map_all( ++ g_type_from_name("VipsObject"), ++ test_nickname, (void *) value))) { ++ vips_type_map_all(G_TYPE_FROM_CLASS(class), ++ list_class, NULL); + } +- else if( value ) { +- vips_error( g_get_prgname(), +- _( "'%s' is not the name of a vips class" ), value ); +- vips_error_g( error ); ++ else if (value) { ++ vips_error(g_get_prgname(), ++ _("'%s' is not the name of a vips class"), value); ++ vips_error_g(error); + +- return( FALSE ); ++ return (FALSE); + } + else { +- vips_type_map_all( g_type_from_name( "VipsOperation" ), +- list_class, NULL ); ++ vips_type_map_all(g_type_from_name("VipsOperation"), ++ list_class, NULL); + } + +- exit( 0 ); ++ exit(0); + } + + static void * +-list_operation( GType type, void *user_data ) ++list_operation(GType type, void *user_data) + { +- VipsObjectClass *class = VIPS_OBJECT_CLASS( g_type_class_ref( type ) ); ++ VipsObjectClass *class = VIPS_OBJECT_CLASS(g_type_class_ref(type)); + +- if( G_TYPE_IS_ABSTRACT( type ) ) +- return( NULL ); +- if( class->deprecated ) +- return( NULL ); +- if( VIPS_OPERATION_CLASS( class )->flags & VIPS_OPERATION_DEPRECATED ) +- return( NULL ); ++ if (G_TYPE_IS_ABSTRACT(type)) ++ return (NULL); ++ if (class->deprecated) ++ return (NULL); ++ if (VIPS_OPERATION_CLASS(class)->flags & VIPS_OPERATION_DEPRECATED) ++ return (NULL); + +- printf( "%s\n", class->nickname ); ++ printf("%s\n", class->nickname); + +- return( NULL ); ++ return (NULL); + } + + static void * +-list_operation_arg( VipsObjectClass *object_class, ++list_operation_arg(VipsObjectClass *object_class, + GParamSpec *pspec, VipsArgumentClass *argument_class, +- void *_data1, void *_data2 ) ++ void *_data1, void *_data2) + { +- GType type = G_PARAM_SPEC_VALUE_TYPE( pspec ); ++ GType type = G_PARAM_SPEC_VALUE_TYPE(pspec); + +- if( !(argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) || +- (argument_class->flags & VIPS_ARGUMENT_DEPRECATED) ) +- return( NULL ); ++ if (!(argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) || ++ (argument_class->flags & VIPS_ARGUMENT_DEPRECATED)) ++ return (NULL); + + /* We don't try to complete options, though maybe we should. + */ +- if( !(argument_class->flags & VIPS_ARGUMENT_REQUIRED) ) +- return( NULL ); ++ if (!(argument_class->flags & VIPS_ARGUMENT_REQUIRED)) ++ return (NULL); + + /* These are the pspecs that vips uses that have interesting values. + */ +- if( G_IS_PARAM_SPEC_ENUM( pspec ) ) { +- GTypeClass *class = g_type_class_ref( type ); ++ if (G_IS_PARAM_SPEC_ENUM(pspec)) { ++ GTypeClass *class = g_type_class_ref(type); + + GEnumClass *genum; +- int i; ++ int i; + + /* Should be impossible, no need to warn. + */ +- if( !class ) +- return( NULL ); ++ if (!class) ++ return (NULL); + +- genum = G_ENUM_CLASS( class ); ++ genum = G_ENUM_CLASS(class); + +- printf( "word:" ); ++ printf("word:"); + + /* -1 since we always have a "last" member. + */ +- for( i = 0; i < genum->n_values - 1; i++ ) { +- if( i > 0 ) +- printf( "|" ); +- printf( "%s", genum->values[i].value_nick ); ++ for (i = 0; i < genum->n_values - 1; i++) { ++ if (i > 0) ++ printf("|"); ++ printf("%s", genum->values[i].value_nick); + } + +- printf( "\n" ); ++ printf("\n"); + } +- else if( G_IS_PARAM_SPEC_BOOLEAN( pspec ) ) +- printf( "word:true|false\n" ); +- else if( G_IS_PARAM_SPEC_DOUBLE( pspec ) ) { ++ else if (G_IS_PARAM_SPEC_BOOLEAN(pspec)) ++ printf("word:true|false\n"); ++ else if (G_IS_PARAM_SPEC_DOUBLE(pspec)) { + GParamSpecDouble *pspec_double = (GParamSpecDouble *) pspec; + +- printf( "word:%g\n", pspec_double->default_value ); ++ printf("word:%g\n", pspec_double->default_value); + } +- else if( G_IS_PARAM_SPEC_INT( pspec ) ) { ++ else if (G_IS_PARAM_SPEC_INT(pspec)) { + GParamSpecInt *pspec_int = (GParamSpecInt *) pspec; + +- printf( "word:%d\n", pspec_int->default_value ); ++ printf("word:%d\n", pspec_int->default_value); + } +- else if( G_IS_PARAM_SPEC_OBJECT( pspec ) ) ++ else if (G_IS_PARAM_SPEC_OBJECT(pspec)) + /* Eg. an image input or output. + */ +- printf( "file\n" ); ++ printf("file\n"); + else + /* We can offer no useful suggestion for eg. array_int etc. + */ +- printf( "none\n" ); ++ printf("none\n"); + +- return( NULL ); ++ return (NULL); + } + + static gboolean +-parse_main_option_completion( const gchar *option_name, const gchar *value, +- gpointer data, GError **error ) ++parse_main_option_completion(const gchar *option_name, const gchar *value, ++ gpointer data, GError **error) + { + VipsObjectClass *class; + +- if( value && +- (class = (VipsObjectClass *) vips_type_map_all( +- g_type_from_name( "VipsOperation" ), +- test_nickname, (void *) value )) ) +- vips_argument_class_map( class, +- (VipsArgumentClassMapFn) list_operation_arg, +- NULL, NULL ); +- else if( value ) { +- vips_error( g_get_prgname(), +- _( "'%s' is not the name of a vips operation" ), +- value ); +- vips_error_g( error ); +- +- return( FALSE ); ++ if (value && ++ (class = (VipsObjectClass *) vips_type_map_all( ++ g_type_from_name("VipsOperation"), ++ test_nickname, (void *) value))) ++ vips_argument_class_map(class, ++ (VipsArgumentClassMapFn) list_operation_arg, ++ NULL, NULL); ++ else if (value) { ++ vips_error(g_get_prgname(), ++ _("'%s' is not the name of a vips operation"), ++ value); ++ vips_error_g(error); ++ ++ return (FALSE); + } + else { +- vips_type_map_all( g_type_from_name( "VipsOperation" ), +- list_operation, NULL ); ++ vips_type_map_all(g_type_from_name("VipsOperation"), ++ list_operation, NULL); + } + +- exit( 0 ); ++ exit(0); + } + + static GOptionEntry main_option[] = { +- { "list", 'l', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, +- (GOptionArgFunc) parse_main_option_list, +- N_( "list objects" ), +- N_( "BASE-NAME" ) }, +- { "plugin", 'p', 0, G_OPTION_ARG_FILENAME, &main_option_plugin, +- N_( "load PLUGIN" ), +- N_( "PLUGIN" ) }, +- { "version", 'v', 0, G_OPTION_ARG_NONE, &main_option_version, +- N_( "print version" ), NULL }, +- { "completion", 'c', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, +- (GOptionArgFunc) parse_main_option_completion, +- N_( "print completions" ), +- N_( "BASE-NAME" ) }, ++ { "list", 'l', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, ++ (GOptionArgFunc) parse_main_option_list, ++ N_("list objects"), ++ N_("BASE-NAME") }, ++ { "plugin", 'p', 0, G_OPTION_ARG_FILENAME, &main_option_plugin, ++ N_("load PLUGIN"), ++ N_("PLUGIN") }, ++ { "version", 'v', 0, G_OPTION_ARG_NONE, &main_option_version, ++ N_("print version"), NULL }, ++ { "completion", 'c', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, ++ (GOptionArgFunc) parse_main_option_completion, ++ N_("print completions"), ++ N_("BASE-NAME") }, + { NULL } + }; + + #if ENABLE_DEPRECATED +-typedef void *(*map_name_fn)( im_function * ); ++typedef void *(*map_name_fn)(im_function *); + + /* Loop over a package. + */ + static void * +-map_package( im_package *pack, map_name_fn fn ) ++map_package(im_package *pack, map_name_fn fn) + { + int i; + void *result; + +- for( i = 0; i < pack->nfuncs; i++ ) +- if( (result = fn( pack->table[i] )) ) +- return( result ); ++ for (i = 0; i < pack->nfuncs; i++) ++ if ((result = fn(pack->table[i]))) ++ return (result); + +- return( NULL ); ++ return (NULL); + } + + /* Apply a function to a vips operation, or map over a package of operations. + */ + static void * +-map_name( const char *name, map_name_fn fn ) ++map_name(const char *name, map_name_fn fn) + { + im_package *pack; + im_function *func; + +- if( !name || strcmp( name, "all" ) == 0 ) ++ if (!name || strcmp(name, "all") == 0) + /* Do all packages. + */ +- im_map_packages( (VSListMap2Fn) map_package, fn ); +- else if( (pack = im_find_package( name )) ) ++ im_map_packages((VSListMap2Fn) map_package, fn); ++ else if ((pack = im_find_package(name))) + /* Do one package. + */ +- map_package( pack, fn ); +- else if( (func = im_find_function( name )) ) ++ map_package(pack, fn); ++ else if ((func = im_find_function(name))) + /* Do a single function. + */ +- fn( func ); ++ fn(func); + else { +- vips_error( "map_name", +- _( "no package or function \"%s\"" ), name ); +- return( fn ); ++ vips_error("map_name", ++ _("no package or function \"%s\""), name); ++ return (fn); + } + +- return( NULL ); ++ return (NULL); + } + + static void * +-list_package( im_package *pack ) ++list_package(im_package *pack) + { +- printf( "%-20s - %d operations\n", pack->name, pack->nfuncs ); +- +- return( NULL ); ++ printf("%-20s - %d operations\n", pack->name, pack->nfuncs); ++ ++ return (NULL); + } + + static void * +-list_function( im_function *func ) ++list_function(im_function *func) + { +- printf( "%-20s - %s\n", func->name, _( func->desc ) ); +- +- return( NULL ); ++ printf("%-20s - %s\n", func->name, _(func->desc)); ++ ++ return (NULL); + } + #endif + + static int +-print_list( int argc, char **argv ) ++print_list(int argc, char **argv) + { + #if ENABLE_DEPRECATED +- if( !argv[0] || strcmp( argv[0], "packages" ) == 0 ) +- im_map_packages( (VSListMap2Fn) list_package, NULL ); +- else if( strcmp( argv[0], "classes" ) == 0 ) ++ if (!argv[0] || strcmp(argv[0], "packages") == 0) ++ im_map_packages((VSListMap2Fn) list_package, NULL); ++ else if (strcmp(argv[0], "classes") == 0) + #else +- if( !argv[0] || strcmp( argv[0], "classes" ) == 0 ) ++ if (!argv[0] || strcmp(argv[0], "classes") == 0) + #endif +- vips_type_map_all( g_type_from_name( "VipsObject" ), +- list_class, NULL ); +- else if( g_type_from_name( argv[0] ) && +- g_type_is_a( g_type_from_name( argv[0] ), VIPS_TYPE_OBJECT ) ) { +- vips_type_map_all( g_type_from_name( argv[0] ), +- list_class, NULL ); ++ vips_type_map_all(g_type_from_name("VipsObject"), ++ list_class, NULL); ++ else if (g_type_from_name(argv[0]) && ++ g_type_is_a(g_type_from_name(argv[0]), VIPS_TYPE_OBJECT)) { ++ vips_type_map_all(g_type_from_name(argv[0]), ++ list_class, NULL); + } + else { + #if ENABLE_DEPRECATED +- if( map_name( argv[0], list_function ) ) +- vips_error_exit( "unknown package \"%s\"", argv[0] ); ++ if (map_name(argv[0], list_function)) ++ vips_error_exit("unknown package \"%s\"", argv[0]); + #else +- vips_error_exit( "unknown operation \"%s\"", argv[0] ); ++ vips_error_exit("unknown operation \"%s\"", argv[0]); + #endif + } + +- return( 0 ); ++ return (0); + } + + #if ENABLE_DEPRECATED + /* Print "ln -s" lines for this package. + */ + static void * +-print_links_package( im_package *pack ) ++print_links_package(im_package *pack) + { + int i; + +- for( i = 0; i < pack->nfuncs; i++ ) +- printf( "rm -f %s" IM_EXEEXT "; " +- "ln -s vips" IM_EXEEXT " %s" IM_EXEEXT "\n", +- pack->table[i]->name, pack->table[i]->name ); ++ for (i = 0; i < pack->nfuncs; i++) ++ printf("rm -f %s" IM_EXEEXT "; " ++ "ln -s vips" IM_EXEEXT " %s" IM_EXEEXT "\n", ++ pack->table[i]->name, pack->table[i]->name); + +- return( NULL ); ++ return (NULL); + } + + /* Print "ln -s" lines for this package. + */ + static int +-print_links( int argc, char **argv ) ++print_links(int argc, char **argv) + { +- im_map_packages( (VSListMap2Fn) print_links_package, NULL ); ++ im_map_packages((VSListMap2Fn) print_links_package, NULL); + +- return( 0 ); ++ return (0); + } + + /* Does a function have any printing output? + */ + static int +-has_print( im_function *fn ) ++has_print(im_function *fn) + { + int i; + +- for( i = 0; i < fn->argc; i++ ) +- if( fn->argv[i].print ) +- return( -1 ); ++ for (i = 0; i < fn->argc; i++) ++ if (fn->argv[i].print) ++ return (-1); + +- return( 0 ); ++ return (0); + } + #endif + + static int +-isvips( const char *name ) ++isvips(const char *name) + { + /* If we're running uninstalled we get the lt- prefix. + */ +- if( vips_isprefix( "lt-", name ) ) ++ if (vips_isprefix("lt-", name)) + name += 3; + +- return( vips_isprefix( "vips", name ) ); ++ return (vips_isprefix("vips", name)); + } + + #if ENABLE_DEPRECATED + /* Print a usage string from an im_function descriptor. + */ + static void +-usage( im_function *fn ) ++usage(im_function *fn) + { + int i; +- im_package *pack = im_package_of_function( fn->name ); ++ im_package *pack = im_package_of_function(fn->name); + + /* Don't print the prgname if we're being run as a symlink. + */ +- fprintf( stderr, "usage: " ); +- if( isvips( g_get_prgname() ) ) +- fprintf( stderr, "%s ", g_get_prgname() ); +- fprintf( stderr, "%s ", fn->name ); ++ fprintf(stderr, "usage: "); ++ if (isvips(g_get_prgname())) ++ fprintf(stderr, "%s ", g_get_prgname()); ++ fprintf(stderr, "%s ", fn->name); + + /* Print args requiring command-line input. + */ +- for( i = 0; i < fn->argc; i++ ) +- if( fn->argv[i].desc->flags & IM_TYPE_ARG ) +- fprintf( stderr, "%s ", fn->argv[i].name ); ++ for (i = 0; i < fn->argc; i++) ++ if (fn->argv[i].desc->flags & IM_TYPE_ARG) ++ fprintf(stderr, "%s ", fn->argv[i].name); + + /* Print types of command line args. + */ +- fprintf( stderr, "\nwhere:\n" ); +- for( i = 0; i < fn->argc; i++ ) +- if( fn->argv[i].desc->flags & IM_TYPE_ARG ) +- fprintf( stderr, "\t%s is of type \"%s\"\n", +- fn->argv[i].name, fn->argv[i].desc->type ); ++ fprintf(stderr, "\nwhere:\n"); ++ for (i = 0; i < fn->argc; i++) ++ if (fn->argv[i].desc->flags & IM_TYPE_ARG) ++ fprintf(stderr, "\t%s is of type \"%s\"\n", ++ fn->argv[i].name, fn->argv[i].desc->type); + + /* Print output print args. + */ +- if( has_print( fn ) ) { +- fprintf( stderr, "prints:\n" ); +- for( i = 0; i < fn->argc; i++ ) +- if( fn->argv[i].print ) +- fprintf( stderr, "\t%s of type \"%s\"\n", +- fn->argv[i].name, +- fn->argv[i].desc->type ); ++ if (has_print(fn)) { ++ fprintf(stderr, "prints:\n"); ++ for (i = 0; i < fn->argc; i++) ++ if (fn->argv[i].print) ++ fprintf(stderr, "\t%s of type \"%s\"\n", ++ fn->argv[i].name, ++ fn->argv[i].desc->type); + } + + /* Print description of this function, and package it comes from. + */ +- fprintf( stderr, "%s", _( fn->desc ) ); +- if( pack ) +- fprintf( stderr, ", from package \"%s\"", pack->name ); +- fprintf( stderr, "\n" ); ++ fprintf(stderr, "%s", _(fn->desc)); ++ if (pack) ++ fprintf(stderr, ", from package \"%s\"", pack->name); ++ fprintf(stderr, "\n"); + + /* Print any flags this function has. + */ +- fprintf( stderr, "flags: " ); +- if( fn->flags & IM_FN_PIO ) +- fprintf( stderr, "(PIO function) " ); ++ fprintf(stderr, "flags: "); ++ if (fn->flags & IM_FN_PIO) ++ fprintf(stderr, "(PIO function) "); + else +- fprintf( stderr, "(WIO function) " ); +- if( fn->flags & IM_FN_TRANSFORM ) +- fprintf( stderr, "(coordinate transformer) " ); ++ fprintf(stderr, "(WIO function) "); ++ if (fn->flags & IM_FN_TRANSFORM) ++ fprintf(stderr, "(coordinate transformer) "); + else +- fprintf( stderr, "(no coordinate transformation) " ); +- if( fn->flags & IM_FN_PTOP ) +- fprintf( stderr, "(point-to-point operation) " ); ++ fprintf(stderr, "(no coordinate transformation) "); ++ if (fn->flags & IM_FN_PTOP) ++ fprintf(stderr, "(point-to-point operation) "); + else +- fprintf( stderr, "(area operation) " ); +- if( fn->flags & IM_FN_NOCACHE ) +- fprintf( stderr, "(nocache operation) " ); ++ fprintf(stderr, "(area operation) "); ++ if (fn->flags & IM_FN_NOCACHE) ++ fprintf(stderr, "(nocache operation) "); + else +- fprintf( stderr, "(result can be cached) " ); ++ fprintf(stderr, "(result can be cached) "); + +- fprintf( stderr, "\n" ); ++ fprintf(stderr, "\n"); + } + #endif + + static int +-print_help( int argc, char **argv ) ++print_help(int argc, char **argv) + { +- return( 0 ); ++ return (0); + } + + /* All our built-in actions. + */ + +-typedef int (*Action)( int argc, char **argv ); ++typedef int (*Action)(int argc, char **argv); + + typedef struct _ActionEntry { + char *name; +@@ -543,55 +543,55 @@ static GOptionEntry empty_options[] = { + + static ActionEntry actions[] = { + #if ENABLE_DEPRECATED +- { "list", N_( "list classes|packages|all|package-name|operation-name" ), ++ { "list", N_("list classes|packages|all|package-name|operation-name"), + #else +- { "list", N_( "list classes|all|operation-name" ), ++ { "list", N_("list classes|all|operation-name"), + #endif + &empty_options[0], print_list }, + #if ENABLE_DEPRECATED +- { "links", N_( "generate links for vips/bin" ), ++ { "links", N_("generate links for vips/bin"), + &empty_options[0], print_links }, + #endif +- { "help", N_( "list possible actions" ), ++ { "help", N_("list possible actions"), + &empty_options[0], print_help }, + }; + + static void +-parse_options( GOptionContext *context, int *argc, char **argv ) ++parse_options(GOptionContext *context, int *argc, char **argv) + { + char txt[1024]; +- VipsBuf buf = VIPS_BUF_STATIC( txt ); ++ VipsBuf buf = VIPS_BUF_STATIC(txt); + GError *error = NULL; + int i, j; + + #ifdef DEBUG +- printf( "parse_options:\n" ); +- for( i = 0; i < *argc; i++ ) +- printf( "%d) %s\n", i, argv[i] ); ++ printf("parse_options:\n"); ++ for (i = 0; i < *argc; i++) ++ printf("%d) %s\n", i, argv[i]); + #endif /*DEBUG*/ + +- vips_buf_appendf( &buf, "%7s - %s\n", +- "OPER", _( "execute vips operation OPER" ) ); +- g_option_context_set_summary( context, vips_buf_all( &buf ) ); ++ vips_buf_appendf(&buf, "%7s - %s\n", ++ "OPER", _("execute vips operation OPER")); ++ g_option_context_set_summary(context, vips_buf_all(&buf)); + + #ifdef G_OS_WIN32 +- if( !g_option_context_parse_strv( context, &argv, &error ) ) +-#else /*!G_OS_WIN32*/ +- if( !g_option_context_parse( context, argc, &argv, &error ) ) ++ if (!g_option_context_parse_strv(context, &argv, &error)) ++#else /*!G_OS_WIN32*/ ++ if (!g_option_context_parse(context, argc, &argv, &error)) + #endif /*G_OS_WIN32*/ + { +- if( error ) { +- fprintf( stderr, "%s\n", error->message ); +- g_error_free( error ); ++ if (error) { ++ fprintf(stderr, "%s\n", error->message); ++ g_error_free(error); + } + +- vips_error_exit( NULL ); ++ vips_error_exit(NULL); + } + + /* On Windows, argc will not have been updated by + * g_option_context_parse_strv(). + */ +- for( *argc = 0; argv[*argc]; (*argc)++ ) ++ for (*argc = 0; argv[*argc]; (*argc)++) + ; + + /* Remove any "--" argument. If one of our arguments is a negative +@@ -599,9 +599,9 @@ parse_options( GOptionContext *context, int *argc, char **argv ) + * GOption parsing. But "--" is still passed down to us and we need to + * ignore it. + */ +- for( i = 1; i < *argc; i++ ) +- if( strcmp( argv[i], "--" ) == 0 ) { +- for( j = i; j < *argc; j++ ) ++ for (i = 1; i < *argc; i++) ++ if (strcmp(argv[i], "--") == 0) { ++ for (j = i; j < *argc; j++) + argv[j] = argv[j + 1]; + + *argc -= 1; +@@ -609,22 +609,22 @@ parse_options( GOptionContext *context, int *argc, char **argv ) + } + + static GOptionGroup * +-add_operation_group( GOptionContext *context, VipsOperation *user_data ) ++add_operation_group(GOptionContext *context, VipsOperation *user_data) + { + GOptionGroup *group; + +- group = g_option_group_new( "operation", +- _( "Operation" ), _( "Operation help" ), user_data, NULL ); +- g_option_group_set_translation_domain( group, GETTEXT_PACKAGE ); +- g_option_context_add_group( context, group ); ++ group = g_option_group_new("operation", ++ _("Operation"), _("Operation help"), user_data, NULL); ++ g_option_group_set_translation_domain(group, GETTEXT_PACKAGE); ++ g_option_context_add_group(context, group); + +- return( group ); ++ return (group); + } + +-/* VIPS universal main program. ++/* VIPS universal main program. + */ + int +-main( int argc, char **argv ) ++main(int argc, char **argv) + { + char *action; + GOptionContext *context; +@@ -639,21 +639,21 @@ main( int argc, char **argv ) + + GError *error = NULL; + +- if( VIPS_INIT( argv[0] ) ) +- vips_error_exit( NULL ); ++ if (VIPS_INIT(argv[0])) ++ vips_error_exit(NULL); + + #ifdef ENABLE_NLS +- textdomain( GETTEXT_PACKAGE ); ++ textdomain(GETTEXT_PACKAGE); + #endif /* ENABLE_NLS */ +- setlocale( LC_ALL, "" ); ++ setlocale(LC_ALL, ""); + +-{ +- char *basename; ++ { ++ char *basename; + +- basename = g_path_get_basename( argv[0] ); +- g_set_prgname( basename ); +- g_free( basename ); +-} ++ basename = g_path_get_basename(argv[0]); ++ g_set_prgname(basename); ++ g_free(basename); ++ } + + /* On Windows, argv is ascii-only .. use this to get a utf-8 version of + * the args. +@@ -663,100 +663,100 @@ main( int argc, char **argv ) + #endif /*G_OS_WIN32*/ + + #ifdef DEBUG_FATAL +- /* Set masks for debugging ... stop on any problem. ++ /* Set masks for debugging ... stop on any problem. + */ + g_log_set_always_fatal( + G_LOG_FLAG_RECURSION | + G_LOG_FLAG_FATAL | + G_LOG_LEVEL_ERROR | + G_LOG_LEVEL_CRITICAL | +- G_LOG_LEVEL_WARNING ); ++ G_LOG_LEVEL_WARNING); + #endif /*!DEBUG_FATAL*/ + +- context = g_option_context_new( _( "[ACTION] [OPTIONS] [PARAMETERS] - " +- "VIPS driver program" ) ); ++ context = g_option_context_new(_("[ACTION] [OPTIONS] [PARAMETERS] - " ++ "VIPS driver program")); + + /* Add and parse the outermost options: the ones this program uses. + * For example, we need + * to be able to spot that in the case of "--plugin ./poop.plg" we + * must remove two args. + */ +- main_group = g_option_group_new( NULL, NULL, NULL, NULL, NULL ); +- g_option_group_add_entries( main_group, main_option ); +- vips_add_option_entries( main_group ); +- g_option_group_set_translation_domain( main_group, GETTEXT_PACKAGE ); +- g_option_context_set_main_group( context, main_group ); ++ main_group = g_option_group_new(NULL, NULL, NULL, NULL, NULL); ++ g_option_group_add_entries(main_group, main_option); ++ vips_add_option_entries(main_group); ++ g_option_group_set_translation_domain(main_group, GETTEXT_PACKAGE); ++ g_option_context_set_main_group(context, main_group); + + /* We add more options later, for example as options to vips8 + * operations. Ignore any unknown options in this first parse. + */ +- g_option_context_set_ignore_unknown_options( context, TRUE ); ++ g_option_context_set_ignore_unknown_options(context, TRUE); + + /* "vips" with no arguments does "vips --help". + */ +- if( argc == 1 ) { ++ if (argc == 1) { + char *help; + +- help = g_option_context_get_help( context, TRUE, NULL ); +- printf( "%s", help ); +- g_free( help ); ++ help = g_option_context_get_help(context, TRUE, NULL); ++ printf("%s", help); ++ g_free(help); + +- exit( 0 ); ++ exit(0); + } + + /* Also disable help output: we want to be able to display full help + * in a second pass after all options have been created. + */ +- g_option_context_set_help_enabled( context, FALSE ); ++ g_option_context_set_help_enabled(context, FALSE); + + #ifdef G_OS_WIN32 +- if( !g_option_context_parse_strv( context, &argv, &error ) ) +-#else /*!G_OS_WIN32*/ +- if( !g_option_context_parse( context, &argc, &argv, &error ) ) ++ if (!g_option_context_parse_strv(context, &argv, &error)) ++#else /*!G_OS_WIN32*/ ++ if (!g_option_context_parse(context, &argc, &argv, &error)) + #endif /*G_OS_WIN32*/ + { +- if( error ) { +- fprintf( stderr, "%s\n", error->message ); +- g_error_free( error ); ++ if (error) { ++ fprintf(stderr, "%s\n", error->message); ++ g_error_free(error); + } + +- vips_error_exit( NULL ); ++ vips_error_exit(NULL); + } + + /* On Windows, argc will not have been updated by + * g_option_context_parse_strv(). + */ +- for( argc = 0; argv[argc]; argc++ ) ++ for (argc = 0; argv[argc]; argc++) + ; + +- if( main_option_plugin ) { ++ if (main_option_plugin) { + #if ENABLE_MODULES + #if ENABLE_DEPRECATED +- if( !im_load_plugin( main_option_plugin ) ) +- vips_error_exit( NULL ); +-#else /*!ENABLE_DEPRECATED*/ ++ if (!im_load_plugin(main_option_plugin)) ++ vips_error_exit(NULL); ++#else /*!ENABLE_DEPRECATED*/ + GModule *module; + +- module = g_module_open( main_option_plugin, G_MODULE_BIND_LAZY ); +- if( !module ) { +- vips_error_exit( _( "unable to load \"%s\" -- %s" ), +- main_option_plugin, g_module_error() ); ++ module = g_module_open(main_option_plugin, G_MODULE_BIND_LAZY); ++ if (!module) { ++ vips_error_exit(_("unable to load \"%s\" -- %s"), ++ main_option_plugin, g_module_error()); + } + #endif /*ENABLE_DEPRECATED*/ +-#else /*!ENABLE_MODULES*/ +- g_warning( "%s", _( "plugin load disabled: " +- "libvips built without modules support" ) ); ++#else /*!ENABLE_MODULES*/ ++ g_warning("%s", _("plugin load disabled: " ++ "libvips built without modules support")); + #endif /*ENABLE_MODULES*/ + } + +- if( main_option_version ) +- printf( "vips-%s\n", vips_version_string() ); ++ if (main_option_version) ++ printf("vips-%s\n", vips_version_string()); + + /* Reenable help and unknown option detection ready for the second + * option parse. + */ +- g_option_context_set_ignore_unknown_options( context, FALSE ); +- g_option_context_set_help_enabled( context, TRUE ); ++ g_option_context_set_ignore_unknown_options(context, FALSE); ++ g_option_context_set_help_enabled(context, TRUE); + + /* Try to find our action. + */ +@@ -765,21 +765,21 @@ main( int argc, char **argv ) + + /* Should we try to run the thing we are named as? + */ +- if( !isvips( g_get_prgname() ) ) ++ if (!isvips(g_get_prgname())) + action = argv[0]; + +- if( !action ) { +- /* Look for the first non-option argument, if any, and make ++ if (!action) { ++ /* Look for the first non-option argument, if any, and make + * that our action. The parse above will have removed most of +- * them, but --help (for example) could still remain. ++ * them, but --help (for example) could still remain. + */ +- for( i = 1; i < argc; i++ ) +- if( argv[i][0] != '-' ) { ++ for (i = 1; i < argc; i++) ++ if (argv[i][0] != '-') { + action = argv[i]; + + /* Remove the action from argv. + */ +- for( j = i; j < argc; j++ ) ++ for (j = i; j < argc; j++) + argv[j] = argv[j + 1]; + argc -= 1; + +@@ -789,16 +789,16 @@ main( int argc, char **argv ) + + /* Could be one of our built-in actions. + */ +- if( action ) +- for( i = 0; i < VIPS_NUMBER( actions ); i++ ) +- if( strcmp( action, actions[i].name ) == 0 ) { +- group = add_operation_group( context, NULL ); +- g_option_group_add_entries( group, +- actions[i].group ); +- parse_options( context, &argc, argv ); ++ if (action) ++ for (i = 0; i < VIPS_NUMBER(actions); i++) ++ if (strcmp(action, actions[i].name) == 0) { ++ group = add_operation_group(context, NULL); ++ g_option_group_add_entries(group, ++ actions[i].group); ++ parse_options(context, &argc, argv); + +- if( actions[i].action( argc - 1, argv + 1 ) ) +- vips_error_exit( "%s", action ); ++ if (actions[i].action(argc - 1, argv + 1)) ++ vips_error_exit("%s", action); + + handled = TRUE; + break; +@@ -809,14 +809,14 @@ main( int argc, char **argv ) + * since we don't want to use the vips7 compat wrappers in vips8 + * unless we have to. They don't support all args types. + */ +- if( action && +- !handled && +- (fn = im_find_function( action )) ) { +- if( im_run_command( action, argc - 1, argv + 1 ) ) { +- if( argc == 1 ) +- usage( fn ); ++ if (action && ++ !handled && ++ (fn = im_find_function(action))) { ++ if (im_run_command(action, argc - 1, argv + 1)) { ++ if (argc == 1) ++ usage(fn); + else +- vips_error_exit( NULL ); ++ vips_error_exit(NULL); + } + + handled = TRUE; +@@ -824,29 +824,29 @@ main( int argc, char **argv ) + + /* im_find_function() set an error msg. + */ +- if( action && +- !handled ) ++ if (action && ++ !handled) + vips_error_clear(); + #endif + + /* Could be a vips8 VipsOperation. + */ +- if( action && +- !handled && +- (operation = vips_operation_new( action )) ) { +- group = add_operation_group( context, operation ); +- vips_call_options( group, operation ); +- parse_options( context, &argc, argv ); +- +- if( vips_call_argv( operation, argc - 1, argv + 1 ) ) { +- if( argc == 1 ) +- vips_operation_class_print_usage( +- VIPS_OPERATION_GET_CLASS( operation ) ); +- +- vips_object_unref_outputs( VIPS_OBJECT( operation ) ); +- g_object_unref( operation ); +- +- if( argc == 1 ) ++ if (action && ++ !handled && ++ (operation = vips_operation_new(action))) { ++ group = add_operation_group(context, operation); ++ vips_call_options(group, operation); ++ parse_options(context, &argc, argv); ++ ++ if (vips_call_argv(operation, argc - 1, argv + 1)) { ++ if (argc == 1) ++ vips_operation_class_print_usage( ++ VIPS_OPERATION_GET_CLASS(operation)); ++ ++ vips_object_unref_outputs(VIPS_OBJECT(operation)); ++ g_object_unref(operation); ++ ++ if (argc == 1) + /* We don't exit with an error for something + * like "vips fitsload" failing, we use it to + * decide if an optional component has been +@@ -855,41 +855,41 @@ main( int argc, char **argv ) + * the operation and we'll error with "unknown + * action" below. + */ +- exit( 0 ); ++ exit(0); + else +- vips_error_exit( NULL ); ++ vips_error_exit(NULL); + } + +- vips_object_unref_outputs( VIPS_OBJECT( operation ) ); +- g_object_unref( operation ); ++ vips_object_unref_outputs(VIPS_OBJECT(operation)); ++ g_object_unref(operation); + + handled = TRUE; + } + + /* vips_operation_new() sets an error msg for unknown operation. + */ +- if( action && +- !handled ) ++ if (action && ++ !handled) + vips_error_clear(); + +- if( action && +- !handled ) { +- vips_error_exit( _( "unknown action \"%s\"" ), action ); ++ if (action && ++ !handled) { ++ vips_error_exit(_("unknown action \"%s\""), action); + } + + /* Still not handled? We may not have called parse_options(), so + * --help args may not have been processed. + */ +- if( !handled ) +- parse_options( context, &argc, argv ); ++ if (!handled) ++ parse_options(context, &argc, argv); + +- g_option_context_free( context ); ++ g_option_context_free(context); + + #ifdef G_OS_WIN32 +- g_strfreev( argv ); ++ g_strfreev(argv); + #endif /*G_OS_WIN32*/ + + vips_shutdown(); + +- return( 0 ); ++ return (0); + } +diff --git a/tools/vipsedit.c b/tools/vipsedit.c +index 218d8e0f26..4aaf5b357d 100644 +--- a/tools/vipsedit.c ++++ b/tools/vipsedit.c +@@ -22,28 +22,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. +- +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This file is part of VIPS. ++ ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -84,53 +84,53 @@ static gboolean setext = FALSE; + static gboolean version = FALSE; + + static GOptionEntry entries[] = { +- { "endian", 'n', 0, G_OPTION_ARG_STRING, &endian, +- N_( "tag file as big or little-endian" ), NULL }, +- { "width", 'w', 0, G_OPTION_ARG_STRING, &xsize, +- N_( "set width to N pixels" ), "N" }, +- { "height", 'h', 0, G_OPTION_ARG_STRING, &ysize, +- N_( "set height to N pixels" ), "N" }, +- { "bands", 'b', 0, G_OPTION_ARG_STRING, &bands, +- N_( "set Bands to N" ), "N" }, +- { "format", 'f', 0, G_OPTION_ARG_STRING, &format, +- N_( "set BandFmt to F (eg. uchar, float)" ), "F" }, +- { "interpretation", 'i', 0, G_OPTION_ARG_STRING, &interpretation, +- N_( "set interpretation to I (eg. xyz)" ), "I" }, +- { "coding", 'c', 0, G_OPTION_ARG_STRING, &coding, +- N_( "set Coding to C (eg. labq)" ), "C" }, +- { "xres", 'X', 0, G_OPTION_ARG_STRING, &xres, +- N_( "set Xres to R pixels/mm" ), "R" }, +- { "yres", 'Y', 0, G_OPTION_ARG_STRING, &yres, +- N_( "set Yres to R pixels/mm" ), "R" }, +- { "xoffset", 'u', 0, G_OPTION_ARG_STRING, &xoffset, +- N_( "set Xoffset to N pixels" ), "N" }, +- { "yoffset", 'v', 0, G_OPTION_ARG_STRING, &yoffset, +- N_( "set Yoffset to N pixels" ), "N" }, +- { "setext", 'e', 0, G_OPTION_ARG_NONE, &setext, +- N_( "replace extension block with stdin" ), NULL }, +- { "xsize", 'x', 0, G_OPTION_ARG_STRING, &xsize, +- N_( "set Xsize to N (deprecated, use width)" ), "N" }, +- { "ysize", 'y', 0, G_OPTION_ARG_STRING, &ysize, +- N_( "set Ysize to N (deprecated, use height)" ), "N" }, +- { "type", 't', 0, G_OPTION_ARG_STRING, &interpretation, +- N_( "set Type to T (deprecated, use interpretation)" ), "T" }, +- { "version", 'v', 0, G_OPTION_ARG_NONE, &version, +- N_( "print version" ), NULL }, ++ { "endian", 'n', 0, G_OPTION_ARG_STRING, &endian, ++ N_("tag file as big or little-endian"), NULL }, ++ { "width", 'w', 0, G_OPTION_ARG_STRING, &xsize, ++ N_("set width to N pixels"), "N" }, ++ { "height", 'h', 0, G_OPTION_ARG_STRING, &ysize, ++ N_("set height to N pixels"), "N" }, ++ { "bands", 'b', 0, G_OPTION_ARG_STRING, &bands, ++ N_("set Bands to N"), "N" }, ++ { "format", 'f', 0, G_OPTION_ARG_STRING, &format, ++ N_("set BandFmt to F (eg. uchar, float)"), "F" }, ++ { "interpretation", 'i', 0, G_OPTION_ARG_STRING, &interpretation, ++ N_("set interpretation to I (eg. xyz)"), "I" }, ++ { "coding", 'c', 0, G_OPTION_ARG_STRING, &coding, ++ N_("set Coding to C (eg. labq)"), "C" }, ++ { "xres", 'X', 0, G_OPTION_ARG_STRING, &xres, ++ N_("set Xres to R pixels/mm"), "R" }, ++ { "yres", 'Y', 0, G_OPTION_ARG_STRING, &yres, ++ N_("set Yres to R pixels/mm"), "R" }, ++ { "xoffset", 'u', 0, G_OPTION_ARG_STRING, &xoffset, ++ N_("set Xoffset to N pixels"), "N" }, ++ { "yoffset", 'v', 0, G_OPTION_ARG_STRING, &yoffset, ++ N_("set Yoffset to N pixels"), "N" }, ++ { "setext", 'e', 0, G_OPTION_ARG_NONE, &setext, ++ N_("replace extension block with stdin"), NULL }, ++ { "xsize", 'x', 0, G_OPTION_ARG_STRING, &xsize, ++ N_("set Xsize to N (deprecated, use width)"), "N" }, ++ { "ysize", 'y', 0, G_OPTION_ARG_STRING, &ysize, ++ N_("set Ysize to N (deprecated, use height)"), "N" }, ++ { "type", 't', 0, G_OPTION_ARG_STRING, &interpretation, ++ N_("set Type to T (deprecated, use interpretation)"), "T" }, ++ { "version", 'v', 0, G_OPTION_ARG_NONE, &version, ++ N_("print version"), NULL }, + { NULL } + }; + + static void +-parse_pint( char *arg, int *out ) ++parse_pint(char *arg, int *out) + { + /* Might as well set an upper limit. + */ +- *out = atoi( arg ); +- if( *out <= 0 || *out > 1000000 ) +- vips_error_exit( _( "'%s' is not a positive integer" ), arg ); ++ *out = atoi(arg); ++ if (*out <= 0 || *out > 1000000) ++ vips_error_exit(_("'%s' is not a positive integer"), arg); + } + + int +-main( int argc, char **argv ) ++main(int argc, char **argv) + { + GOptionContext *context; + GOptionGroup *main_group; +@@ -138,21 +138,21 @@ main( int argc, char **argv ) + VipsImage *im; + unsigned char header[VIPS_SIZEOF_HEADER]; + +- if( VIPS_INIT( argv[0] ) ) +- vips_error_exit( "%s", _( "unable to start VIPS" ) ); ++ if (VIPS_INIT(argv[0])) ++ vips_error_exit("%s", _("unable to start VIPS")); + + #ifdef ENABLE_NLS +- textdomain( GETTEXT_PACKAGE ); ++ textdomain(GETTEXT_PACKAGE); + #endif /* ENABLE_NLS */ +- setlocale( LC_ALL, "" ); ++ setlocale(LC_ALL, ""); + +-{ +- char *basename; ++ { ++ char *basename; + +- basename = g_path_get_basename( argv[0] ); +- g_set_prgname( basename ); +- g_free( basename ); +-} ++ basename = g_path_get_basename(argv[0]); ++ g_set_prgname(basename); ++ g_free(basename); ++ } + + /* On Windows, argv is ascii-only .. use this to get a utf-8 version of + * the args. +@@ -161,142 +161,142 @@ main( int argc, char **argv ) + argv = g_win32_get_command_line(); + #endif /*G_OS_WIN32*/ + +- context = g_option_context_new( +- _( "vipsedit - edit vips file header" ) ); +- main_group = g_option_group_new( NULL, NULL, NULL, NULL, NULL ); +- g_option_group_add_entries( main_group, entries ); +- vips_add_option_entries( main_group ); +- g_option_group_set_translation_domain( main_group, GETTEXT_PACKAGE ); +- g_option_context_set_main_group( context, main_group ); ++ context = g_option_context_new( ++ _("vipsedit - edit vips file header")); ++ main_group = g_option_group_new(NULL, NULL, NULL, NULL, NULL); ++ g_option_group_add_entries(main_group, entries); ++ vips_add_option_entries(main_group); ++ g_option_group_set_translation_domain(main_group, GETTEXT_PACKAGE); ++ g_option_context_set_main_group(context, main_group); + + #ifdef G_OS_WIN32 +- if( !g_option_context_parse_strv( context, &argv, &error ) ) +-#else /*!G_OS_WIN32*/ +- if( !g_option_context_parse( context, &argc, &argv, &error ) ) ++ if (!g_option_context_parse_strv(context, &argv, &error)) ++#else /*!G_OS_WIN32*/ ++ if (!g_option_context_parse(context, &argc, &argv, &error)) + #endif /*G_OS_WIN32*/ + { +- vips_g_error( &error ); ++ vips_g_error(&error); + +- exit( -1 ); ++ exit(-1); + } + + /* On Windows, argc will not have been updated by + * g_option_context_parse_strv(). + */ +- for( argc = 0; argv[argc]; argc++ ) ++ for (argc = 0; argv[argc]; argc++) + ; + +- if( version ) +- printf( "vips-%s\n", vips_version_string() ); ++ if (version) ++ printf("vips-%s\n", vips_version_string()); + +- if( argc != 2 ) { +- fprintf( stderr, _( "usage: %s [OPTION...] vips-file\n" ), +- g_get_prgname() ); ++ if (argc != 2) { ++ fprintf(stderr, _("usage: %s [OPTION...] vips-file\n"), ++ g_get_prgname()); + +- exit( -1 ); ++ exit(-1); + } + +- if( !(im = vips_image_new_from_file( argv[1], NULL )) ) +- vips_error_exit( _( "could not open image %s" ), argv[1] ); ++ if (!(im = vips_image_new_from_file(argv[1], NULL))) ++ vips_error_exit(_("could not open image %s"), argv[1]); + +- vips__seek( im->fd, 0, SEEK_SET ); +- if( read( im->fd, header, VIPS_SIZEOF_HEADER ) != +- VIPS_SIZEOF_HEADER || +- vips__read_header_bytes( im, header ) ) +- vips_error_exit( _( "could not read VIPS header for %s" ), +- im->filename ); ++ vips__seek(im->fd, 0, SEEK_SET); ++ if (read(im->fd, header, VIPS_SIZEOF_HEADER) != ++ VIPS_SIZEOF_HEADER || ++ vips__read_header_bytes(im, header)) ++ vips_error_exit(_("could not read VIPS header for %s"), ++ im->filename); + +- if( endian ) { +- if( strcmp( endian, "little" ) == 0 ) ++ if (endian) { ++ if (strcmp(endian, "little") == 0) + im->magic = VIPS_MAGIC_INTEL; +- else if( strcmp( endian, "big" ) == 0 ) ++ else if (strcmp(endian, "big") == 0) + im->magic = VIPS_MAGIC_SPARC; + else +- vips_error_exit( _( "bad endian-ness %s, " +- "should be 'big' or 'little'" ), endian ); ++ vips_error_exit(_("bad endian-ness %s, " ++ "should be 'big' or 'little'"), ++ endian); + } +- if( xsize ) +- parse_pint( xsize, &im->Xsize ); +- if( ysize ) +- parse_pint( ysize, &im->Ysize ); +- if( bands ) +- parse_pint( bands, &im->Bands ); +- if( format ) { ++ if (xsize) ++ parse_pint(xsize, &im->Xsize); ++ if (ysize) ++ parse_pint(ysize, &im->Ysize); ++ if (bands) ++ parse_pint(bands, &im->Bands); ++ if (format) { + int f; + +- if( (f = vips_enum_from_nick( argv[0], +- VIPS_TYPE_BAND_FORMAT, format )) < 0 ) +- vips_error_exit( _( "bad format %s" ), format ); ++ if ((f = vips_enum_from_nick(argv[0], ++ VIPS_TYPE_BAND_FORMAT, format)) < 0) ++ vips_error_exit(_("bad format %s"), format); + + im->BandFmt = f; + +- /* We don't use this, but make sure it's set in case any ++ /* We don't use this, but make sure it's set in case any + * old binaries are expecting it. + */ +- im->Bbits = vips_format_sizeof( f ) << 3; ++ im->Bbits = vips_format_sizeof(f) << 3; + } +- if( interpretation ) { ++ if (interpretation) { + int i; + +- if( (i = vips_enum_from_nick( argv[0], +- VIPS_TYPE_INTERPRETATION, interpretation )) < 0 ) +- vips_error_exit( _( "bad interpretation %s" ), +- interpretation ); ++ if ((i = vips_enum_from_nick(argv[0], ++ VIPS_TYPE_INTERPRETATION, interpretation)) < 0) ++ vips_error_exit(_("bad interpretation %s"), ++ interpretation); + + im->Type = i; + } +- if( coding ) { ++ if (coding) { + int c; + +- if( (c = vips_enum_from_nick( argv[0], +- VIPS_TYPE_CODING, coding )) < 0 ) +- vips_error_exit( _( "bad coding %s" ), coding ); ++ if ((c = vips_enum_from_nick(argv[0], ++ VIPS_TYPE_CODING, coding)) < 0) ++ vips_error_exit(_("bad coding %s"), coding); + + im->Coding = c; + } +- if( xres ) +- im->Xres = atof( xres ); +- if( yres ) +- im->Yres = atof( yres ); +- if( xoffset ) +- im->Xoffset = atoi( xoffset ); +- if( yoffset ) +- im->Yoffset = atoi( yoffset ); +- +- if( vips__seek( im->fd, 0, SEEK_SET ) == (off_t) -1 ) +- vips_error_exit( _( "could not seek on %s" ), im->filename ); +- if( vips__write_header_bytes( im, header ) || +- vips__write( im->fd, header, VIPS_SIZEOF_HEADER ) ) +- vips_error_exit( _( "could not write to %s" ), im->filename ); +- +- if( setext ) { ++ if (xres) ++ im->Xres = atof(xres); ++ if (yres) ++ im->Yres = atof(yres); ++ if (xoffset) ++ im->Xoffset = atoi(xoffset); ++ if (yoffset) ++ im->Yoffset = atoi(yoffset); ++ ++ if (vips__seek(im->fd, 0, SEEK_SET) == (off_t) -1) ++ vips_error_exit(_("could not seek on %s"), im->filename); ++ if (vips__write_header_bytes(im, header) || ++ vips__write(im->fd, header, VIPS_SIZEOF_HEADER)) ++ vips_error_exit(_("could not write to %s"), im->filename); ++ ++ if (setext) { + char *xml; + size_t size; + +- if( !(xml = vips__file_read( stdin, "stdin", &size )) ) +- vips_error_exit( "%s", _( "could not get ext data" ) ); ++ if (!(xml = vips__file_read(stdin, "stdin", &size))) ++ vips_error_exit("%s", _("could not get ext data")); + +- /* Strip trailing whitespace ... we can get stray \n at the ++ /* Strip trailing whitespace ... we can get stray \n at the + * end, eg. "echo | vipsedit --setext fred.v". + */ +- while( size > 0 && isspace( xml[size - 1] ) ) ++ while (size > 0 && isspace(xml[size - 1])) + size -= 1; + +- if( vips__write_extension_block( im, xml, size ) ) +- vips_error_exit( "%s", _( "could not set extension" ) ); +- g_free( xml ); ++ if (vips__write_extension_block(im, xml, size)) ++ vips_error_exit("%s", _("could not set extension")); ++ g_free(xml); + } + +- g_object_unref( im ); ++ g_object_unref(im); + +- g_option_context_free( context ); ++ g_option_context_free(context); + + #ifdef G_OS_WIN32 +- g_strfreev( argv ); ++ g_strfreev(argv); + #endif /*G_OS_WIN32*/ + + vips_shutdown(); + +- return( 0 ); ++ return (0); + } +- +diff --git a/tools/vipsheader.c b/tools/vipsheader.c +index c03a84220b..9dad4ad584 100644 +--- a/tools/vipsheader.c ++++ b/tools/vipsheader.c +@@ -1,6 +1,6 @@ + /* @(#) Command; reads the header of a Vasari picture file. + * @(#) Usage: header vasari_file +- * @(#) ++ * @(#) + * + * Copyright: Birkbeck College, History of Art Dept, London, VASARI project. + * +@@ -23,7 +23,7 @@ + * - back to plain im_open() now that's lazy enough for us + * 9/9/05 + * - display meta fields in save format, if possible +- * 20/9/05 ++ * 20/9/05 + * - new field name "getext" reads extension block + * 24/8/06 + * - use GOption, loop over args +@@ -44,28 +44,28 @@ + + /* + +- This file is part of VIPS. +- +- VIPS is free software; you can redistribute it and/or modify +- it under the terms of the GNU Lesser General Public License as published by +- the Free Software Foundation; either version 2 of the License, or +- (at your option) any later version. ++ This file is part of VIPS. + +- This program is distributed in the hope that it will be useful, +- but WITHOUT ANY WARRANTY; without even the implied warranty of +- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- GNU Lesser General Public License for more details. ++ VIPS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU Lesser General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. + +- You should have received a copy of the GNU Lesser General Public License +- along with this program; if not, write to the Free Software +- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +- 02110-1301 USA ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ 02110-1301 USA + + */ + + /* + +- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk ++ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk + + */ + +@@ -87,87 +87,87 @@ static gboolean main_option_all = FALSE; + static gboolean version = FALSE; + + static GOptionEntry main_option[] = { +- { "all", 'a', 0, G_OPTION_ARG_NONE, &main_option_all, +- N_( "show all fields" ), NULL }, +- { "field", 'f', 0, G_OPTION_ARG_STRING, &main_option_field, +- N_( "print value of FIELD (\"getext\" reads extension block, " +- "\"Hist\" reads image history)" ), ++ { "all", 'a', 0, G_OPTION_ARG_NONE, &main_option_all, ++ N_("show all fields"), NULL }, ++ { "field", 'f', 0, G_OPTION_ARG_STRING, &main_option_field, ++ N_("print value of FIELD (\"getext\" reads extension block, " ++ "\"Hist\" reads image history)"), + "FIELD" }, +- { "version", 'v', 0, G_OPTION_ARG_NONE, &version, +- N_( "print version" ), NULL }, ++ { "version", 'v', 0, G_OPTION_ARG_NONE, &version, ++ N_("print version"), NULL }, + { NULL } + }; + + /* A non-fatal error. Print the vips error buffer and continue. + */ + static void +-print_error( void ) ++print_error(void) + { +- fprintf( stderr, "%s: %s", g_get_prgname(), vips_error_buffer() ); ++ fprintf(stderr, "%s: %s", g_get_prgname(), vips_error_buffer()); + vips_error_clear(); + } + + static void * +-print_field_fn( VipsImage *image, const char *field, GValue *value, void *a ) ++print_field_fn(VipsImage *image, const char *field, GValue *value, void *a) + { + gboolean *many = (gboolean *) a; + char str[256]; +- VipsBuf buf = VIPS_BUF_STATIC( str ); ++ VipsBuf buf = VIPS_BUF_STATIC(str); + +- if( *many && +- image->filename ) +- printf( "%s: ", image->filename ); ++ if (*many && ++ image->filename) ++ printf("%s: ", image->filename); + +- printf( "%s: ", field ); ++ printf("%s: ", field); + +- vips_buf_appendgv( &buf, value ); +- printf( "%s\n", vips_buf_all( &buf ) ); ++ vips_buf_appendgv(&buf, value); ++ printf("%s\n", vips_buf_all(&buf)); + +- return( NULL ); ++ return (NULL); + } + + /* Print header, or parts of header. + */ + static int +-print_header( VipsImage *image, gboolean many ) ++print_header(VipsImage *image, gboolean many) + { +- if( !main_option_field ) { +- if( image->filename ) +- printf( "%s: ", image->filename ); ++ if (!main_option_field) { ++ if (image->filename) ++ printf("%s: ", image->filename); + +- vips_object_print_summary( VIPS_OBJECT( image ) ); ++ vips_object_print_summary(VIPS_OBJECT(image)); + +- if( main_option_all ) +- (void) vips_image_map( image, print_field_fn, &many ); ++ if (main_option_all) ++ (void) vips_image_map(image, print_field_fn, &many); + } +- else if( strcmp( main_option_field, "getext" ) == 0 ) { +- if( vips__has_extension_block( image ) ) { ++ else if (strcmp(main_option_field, "getext") == 0) { ++ if (vips__has_extension_block(image)) { + void *buf; + int size; + +- if( !(buf = +- vips__read_extension_block( image, &size )) ) +- return( -1 ); +- printf( "%s", (char *) buf ); +- g_free( buf ); ++ if (!(buf = ++ vips__read_extension_block(image, &size))) ++ return (-1); ++ printf("%s", (char *) buf); ++ g_free(buf); + } + } +- else if( strcmp( main_option_field, "Hist" ) == 0 ) +- printf( "%s", vips_image_get_history( image ) ); ++ else if (strcmp(main_option_field, "Hist") == 0) ++ printf("%s", vips_image_get_history(image)); + else { + char *str; + +- if( vips_image_get_as_string( image, main_option_field, &str ) ) +- return( -1 ); +- printf( "%s\n", str ); +- g_free( str ); ++ if (vips_image_get_as_string(image, main_option_field, &str)) ++ return (-1); ++ printf("%s\n", str); ++ g_free(str); + } + +- return( 0 ); ++ return (0); + } + + int +-main( int argc, char *argv[] ) ++main(int argc, char *argv[]) + { + GOptionContext *context; + GOptionGroup *main_group; +@@ -175,21 +175,21 @@ main( int argc, char *argv[] ) + int i; + int result; + +- if( VIPS_INIT( argv[0] ) ) +- vips_error_exit( "unable to start VIPS" ); ++ if (VIPS_INIT(argv[0])) ++ vips_error_exit("unable to start VIPS"); + + #ifdef ENABLE_NLS +- textdomain( GETTEXT_PACKAGE ); ++ textdomain(GETTEXT_PACKAGE); + #endif /* ENABLE_NLS */ +- setlocale( LC_ALL, "" ); ++ setlocale(LC_ALL, ""); + +-{ +- char *basename; ++ { ++ char *basename; + +- basename = g_path_get_basename( argv[0] ); +- g_set_prgname( basename ); +- g_free( basename ); +-} ++ basename = g_path_get_basename(argv[0]); ++ g_set_prgname(basename); ++ g_free(basename); ++ } + + /* On Windows, argv is ascii-only .. use this to get a utf-8 version of + * the args. +@@ -198,77 +198,77 @@ main( int argc, char *argv[] ) + argv = g_win32_get_command_line(); + #endif /*G_OS_WIN32*/ + +- context = g_option_context_new( _( "- print image header" ) ); +- main_group = g_option_group_new( NULL, NULL, NULL, NULL, NULL ); +- g_option_group_add_entries( main_group, main_option ); +- vips_add_option_entries( main_group ); +- g_option_group_set_translation_domain( main_group, GETTEXT_PACKAGE ); +- g_option_context_set_main_group( context, main_group ); ++ context = g_option_context_new(_("- print image header")); ++ main_group = g_option_group_new(NULL, NULL, NULL, NULL, NULL); ++ g_option_group_add_entries(main_group, main_option); ++ vips_add_option_entries(main_group); ++ g_option_group_set_translation_domain(main_group, GETTEXT_PACKAGE); ++ g_option_context_set_main_group(context, main_group); + + #ifdef G_OS_WIN32 +- if( !g_option_context_parse_strv( context, &argv, &error ) ) +-#else /*!G_OS_WIN32*/ +- if( !g_option_context_parse( context, &argc, &argv, &error ) ) ++ if (!g_option_context_parse_strv(context, &argv, &error)) ++#else /*!G_OS_WIN32*/ ++ if (!g_option_context_parse(context, &argc, &argv, &error)) + #endif /*G_OS_WIN32*/ + { +- if( error ) { +- fprintf( stderr, "%s\n", error->message ); +- g_error_free( error ); ++ if (error) { ++ fprintf(stderr, "%s\n", error->message); ++ g_error_free(error); + } + +- vips_error_exit( "try \"%s --help\"", g_get_prgname() ); ++ vips_error_exit("try \"%s --help\"", g_get_prgname()); + } + +- g_option_context_free( context ); ++ g_option_context_free(context); + +- if( version ) +- printf( "vips-%s\n", vips_version_string() ); ++ if (version) ++ printf("vips-%s\n", vips_version_string()); + + result = 0; + +- for( i = 1; argv[i]; i++ ) { ++ for (i = 1; argv[i]; i++) { + VipsImage *image; + char filename[VIPS_PATH_MAX]; +- char option_string[VIPS_PATH_MAX]; ++ char option_string[VIPS_PATH_MAX]; + +- vips__filename_split8( argv[i], filename, option_string ); +- if( strcmp( filename, "stdin" ) == 0 ) { ++ vips__filename_split8(argv[i], filename, option_string); ++ if (strcmp(filename, "stdin") == 0) { + VipsSource *source; + +- if( !(source = vips_source_new_from_descriptor( 0 )) ) +- return( -1 ); +- if( !(image = vips_image_new_from_source( source, +- option_string, NULL )) ) { +- VIPS_UNREF( source ); +- return( -1 ); +- } +- VIPS_UNREF( source ); ++ if (!(source = vips_source_new_from_descriptor(0))) ++ return (-1); ++ if (!(image = vips_image_new_from_source(source, ++ option_string, NULL))) { ++ VIPS_UNREF(source); ++ return (-1); ++ } ++ VIPS_UNREF(source); + } + else { +- if( !(image = +- vips_image_new_from_file( argv[i], NULL )) ) { ++ if (!(image = ++ vips_image_new_from_file(argv[i], NULL))) { + print_error(); + result = 1; + } + } + +- if( image && +- print_header( image, argv[2] != NULL ) ) { ++ if (image && ++ print_header(image, argv[2] != NULL)) { + print_error(); + result = 1; + } + +- if( image ) +- g_object_unref( image ); ++ if (image) ++ g_object_unref(image); + } + + /* We don't free this on error exit, sadly. + */ + #ifdef G_OS_WIN32 +- g_strfreev( argv ); ++ g_strfreev(argv); + #endif /*G_OS_WIN32*/ + + vips_shutdown(); + +- return( result ); ++ return (result); + } +diff --git a/tools/vipsthumbnail.c b/tools/vipsthumbnail.c +index 5a5edf9c05..5768341b59 100644 +--- a/tools/vipsthumbnail.c ++++ b/tools/vipsthumbnail.c +@@ -95,7 +95,7 @@ + * 30/8/17 + * - add --intent + * 23/10/17 +- * - --size Nx didn't work, argh ... thanks jrochkind ++ * - --size Nx didn't work, argh ... thanks jrochkind + * 3/2/20 + * - add --no-rotate + * - add --import-profile / --export-profile names +@@ -151,132 +151,132 @@ static char *interpolator = NULL; + static gboolean rotate_image = FALSE; + + static GOptionEntry options[] = { +- { "size", 's', 0, +- G_OPTION_ARG_STRING, &thumbnail_size, +- N_( "shrink to SIZE or to WIDTHxHEIGHT" ), +- N_( "SIZE" ) }, +- { "output", 'o', 0, +- G_OPTION_ARG_STRING, &output_format, +- N_( "output to FORMAT" ), +- N_( "FORMAT" ) }, +- { "export-profile", 'e', 0, +- G_OPTION_ARG_FILENAME, &export_profile, +- N_( "export with PROFILE" ), +- N_( "PROFILE" ) }, +- { "import-profile", 'i', 0, +- G_OPTION_ARG_FILENAME, &import_profile, +- N_( "import untagged images with PROFILE" ), +- N_( "PROFILE" ) }, +- { "linear", 'a', 0, +- G_OPTION_ARG_NONE, &linear_processing, +- N_( "process in linear space" ), NULL }, +- { "smartcrop", 'm', 0, +- G_OPTION_ARG_STRING, &smartcrop_image, +- N_( "shrink and crop to fill SIZE using STRATEGY" ), +- N_( "STRATEGY" ) }, +- { "intent", 'n', 0, +- G_OPTION_ARG_STRING, &thumbnail_intent, +- N_( "ICC transform with INTENT" ), +- N_( "INTENT" ) }, +- { "delete", 'd', G_OPTION_FLAG_HIDDEN, +- G_OPTION_ARG_NONE, &delete_profile, +- N_( "(deprecated, does nothing)" ), NULL }, +- { "no-rotate", 0, 0, +- G_OPTION_ARG_NONE, &no_rotate_image, +- N_( "don't auto-rotate" ), NULL }, +- { "version", 'v', 0, G_OPTION_ARG_NONE, &version, +- N_( "print version" ), NULL }, +- +- { "format", 'f', G_OPTION_FLAG_HIDDEN, +- G_OPTION_ARG_STRING, &output_format, +- N_( "set output format string to FORMAT" ), +- N_( "FORMAT" ) }, +- { "eprofile", 0, G_OPTION_FLAG_HIDDEN, +- G_OPTION_ARG_FILENAME, &export_profile, +- N_( "export with PROFILE" ), +- N_( "PROFILE" ) }, +- { "iprofile", 0, G_OPTION_FLAG_HIDDEN, +- G_OPTION_ARG_FILENAME, &import_profile, +- N_( "import untagged images with PROFILE" ), +- N_( "PROFILE" ) }, +- { "rotate", 't', G_OPTION_FLAG_HIDDEN, +- G_OPTION_ARG_NONE, &rotate_image, +- N_( "(deprecated, does nothing)" ), NULL }, +- { "crop", 'c', G_OPTION_FLAG_HIDDEN, +- G_OPTION_ARG_NONE, &crop_image, +- N_( "(deprecated, crop exactly to SIZE)" ), NULL }, +- { "verbose", 'v', G_OPTION_FLAG_HIDDEN, +- G_OPTION_ARG_NONE, &verbose, +- N_( "(deprecated, does nothing)" ), NULL }, +- { "nodelete", 'l', G_OPTION_FLAG_HIDDEN, +- G_OPTION_ARG_NONE, &nodelete_profile, +- N_( "(deprecated, does nothing)" ), NULL }, +- { "nosharpen", 'n', G_OPTION_FLAG_HIDDEN, +- G_OPTION_ARG_NONE, &nosharpen, +- N_( "(deprecated, does nothing)" ), NULL }, +- { "interpolator", 'p', G_OPTION_FLAG_HIDDEN, +- G_OPTION_ARG_STRING, &interpolator, +- N_( "(deprecated, does nothing)" ), NULL }, +- { "sharpen", 'r', G_OPTION_FLAG_HIDDEN, +- G_OPTION_ARG_STRING, &convolution_mask, +- N_( "(deprecated, does nothing)" ), NULL }, ++ { "size", 's', 0, ++ G_OPTION_ARG_STRING, &thumbnail_size, ++ N_("shrink to SIZE or to WIDTHxHEIGHT"), ++ N_("SIZE") }, ++ { "output", 'o', 0, ++ G_OPTION_ARG_STRING, &output_format, ++ N_("output to FORMAT"), ++ N_("FORMAT") }, ++ { "export-profile", 'e', 0, ++ G_OPTION_ARG_FILENAME, &export_profile, ++ N_("export with PROFILE"), ++ N_("PROFILE") }, ++ { "import-profile", 'i', 0, ++ G_OPTION_ARG_FILENAME, &import_profile, ++ N_("import untagged images with PROFILE"), ++ N_("PROFILE") }, ++ { "linear", 'a', 0, ++ G_OPTION_ARG_NONE, &linear_processing, ++ N_("process in linear space"), NULL }, ++ { "smartcrop", 'm', 0, ++ G_OPTION_ARG_STRING, &smartcrop_image, ++ N_("shrink and crop to fill SIZE using STRATEGY"), ++ N_("STRATEGY") }, ++ { "intent", 'n', 0, ++ G_OPTION_ARG_STRING, &thumbnail_intent, ++ N_("ICC transform with INTENT"), ++ N_("INTENT") }, ++ { "delete", 'd', G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_NONE, &delete_profile, ++ N_("(deprecated, does nothing)"), NULL }, ++ { "no-rotate", 0, 0, ++ G_OPTION_ARG_NONE, &no_rotate_image, ++ N_("don't auto-rotate"), NULL }, ++ { "version", 'v', 0, G_OPTION_ARG_NONE, &version, ++ N_("print version"), NULL }, ++ ++ { "format", 'f', G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_STRING, &output_format, ++ N_("set output format string to FORMAT"), ++ N_("FORMAT") }, ++ { "eprofile", 0, G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_FILENAME, &export_profile, ++ N_("export with PROFILE"), ++ N_("PROFILE") }, ++ { "iprofile", 0, G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_FILENAME, &import_profile, ++ N_("import untagged images with PROFILE"), ++ N_("PROFILE") }, ++ { "rotate", 't', G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_NONE, &rotate_image, ++ N_("(deprecated, does nothing)"), NULL }, ++ { "crop", 'c', G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_NONE, &crop_image, ++ N_("(deprecated, crop exactly to SIZE)"), NULL }, ++ { "verbose", 'v', G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_NONE, &verbose, ++ N_("(deprecated, does nothing)"), NULL }, ++ { "nodelete", 'l', G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_NONE, &nodelete_profile, ++ N_("(deprecated, does nothing)"), NULL }, ++ { "nosharpen", 'n', G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_NONE, &nosharpen, ++ N_("(deprecated, does nothing)"), NULL }, ++ { "interpolator", 'p', G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_STRING, &interpolator, ++ N_("(deprecated, does nothing)"), NULL }, ++ { "sharpen", 'r', G_OPTION_FLAG_HIDDEN, ++ G_OPTION_ARG_STRING, &convolution_mask, ++ N_("(deprecated, does nothing)"), NULL }, + { NULL } + }; + + /* Given (eg.) "/poop/somefile.png", write @im to the thumbnail name, + * (eg.) "/poop/tn_somefile.jpg". + * +- * If ++ * If + */ + static int +-thumbnail_write_file( VipsObject *process, VipsImage *im, const char *filename ) ++thumbnail_write_file(VipsObject *process, VipsImage *im, const char *filename) + { + char *file; + char *p; + char buf[FILENAME_MAX]; + char *output_name; + +- file = g_path_get_basename( filename ); ++ file = g_path_get_basename(filename); + + /* Remove the suffix from the file portion. + */ +- if( (p = strrchr( file, '.' )) ) ++ if ((p = strrchr(file, '.'))) + *p = '\0'; + +- /* Don't use vips_snprintf(), we only want to optionally substitute a ++ /* Don't use vips_snprintf(), we only want to optionally substitute a + * single %s. + */ +- vips_strncpy( buf, output_format, FILENAME_MAX ); +- vips__substitute( buf, FILENAME_MAX, file ); ++ vips_strncpy(buf, output_format, FILENAME_MAX); ++ vips__substitute(buf, FILENAME_MAX, file); + + /* output_format can be an absolute path, in which case we discard the + * path from the incoming file. + */ +- if( g_path_is_absolute( output_format ) ) +- output_name = g_strdup( buf ); ++ if (g_path_is_absolute(output_format)) ++ output_name = g_strdup(buf); + else { + char *dir; + +- dir = g_path_get_dirname( filename ); +- output_name = g_build_filename( dir, buf, NULL ); +- g_free( dir ); ++ dir = g_path_get_dirname(filename); ++ output_name = g_build_filename(dir, buf, NULL); ++ g_free(dir); + } + +- g_info( "thumbnailing %s as %s", filename, output_name ); ++ g_info("thumbnailing %s as %s", filename, output_name); + +- g_free( file ); ++ g_free(file); + +- if( vips_image_write_to_file( im, output_name, NULL ) ) { +- g_free( output_name ); +- return( -1 ); ++ if (vips_image_write_to_file(im, output_name, NULL)) { ++ g_free(output_name); ++ return (-1); + } +- g_free( output_name ); ++ g_free(output_name); + +- return( 0 ); ++ return (0); + } + + static int +-thumbnail_process( VipsObject *process, const char *name ) ++thumbnail_process(VipsObject *process, const char *name) + { + VipsInteresting interesting; + VipsImage *image; +@@ -285,102 +285,102 @@ thumbnail_process( VipsObject *process, const char *name ) + char option_string[VIPS_PATH_MAX]; + + interesting = VIPS_INTERESTING_NONE; +- if( crop_image ) ++ if (crop_image) + interesting = VIPS_INTERESTING_CENTRE; +- if( smartcrop_image ) { ++ if (smartcrop_image) { + int n; + +- if( (n = vips_enum_from_nick( "vipsthumbnail", +- VIPS_TYPE_INTERESTING, smartcrop_image )) < 0 ) +- return( -1 ); ++ if ((n = vips_enum_from_nick("vipsthumbnail", ++ VIPS_TYPE_INTERESTING, smartcrop_image)) < 0) ++ return (-1); + interesting = n; + } + + intent = VIPS_INTENT_RELATIVE; +- if( thumbnail_intent ) { ++ if (thumbnail_intent) { + int n; + +- if( (n = vips_enum_from_nick( "vipsthumbnail", +- VIPS_TYPE_INTENT, thumbnail_intent )) < 0 ) +- return( -1 ); ++ if ((n = vips_enum_from_nick("vipsthumbnail", ++ VIPS_TYPE_INTENT, thumbnail_intent)) < 0) ++ return (-1); + intent = n; + } + +- vips__filename_split8( name, filename, option_string ); +- if( strcmp( filename, "stdin" ) == 0 ) { ++ vips__filename_split8(name, filename, option_string); ++ if (strcmp(filename, "stdin") == 0) { + VipsSource *source; + +- if( !(source = +- vips_source_new_from_descriptor( 0 )) ) +- return( -1 ); +- +- if( vips_thumbnail_source( source, &image, thumbnail_width, +- "option-string", option_string, +- "height", thumbnail_height, +- "size", size_restriction, +- "no-rotate", no_rotate_image, +- "crop", interesting, +- "linear", linear_processing, +- "import-profile", import_profile, +- "export-profile", export_profile, +- "intent", intent, +- NULL ) ) { +- VIPS_UNREF( source ); +- return( -1 ); ++ if (!(source = ++ vips_source_new_from_descriptor(0))) ++ return (-1); ++ ++ if (vips_thumbnail_source(source, &image, thumbnail_width, ++ "option-string", option_string, ++ "height", thumbnail_height, ++ "size", size_restriction, ++ "no-rotate", no_rotate_image, ++ "crop", interesting, ++ "linear", linear_processing, ++ "import-profile", import_profile, ++ "export-profile", export_profile, ++ "intent", intent, ++ NULL)) { ++ VIPS_UNREF(source); ++ return (-1); + } +- VIPS_UNREF( source ); ++ VIPS_UNREF(source); + } + else { +- if( vips_thumbnail( name, &image, thumbnail_width, +- "height", thumbnail_height, +- "size", size_restriction, +- "no-rotate", no_rotate_image, +- "crop", interesting, +- "linear", linear_processing, +- "import-profile", import_profile, +- "export-profile", export_profile, +- "intent", intent, +- NULL ) ) +- return( -1 ); ++ if (vips_thumbnail(name, &image, thumbnail_width, ++ "height", thumbnail_height, ++ "size", size_restriction, ++ "no-rotate", no_rotate_image, ++ "crop", interesting, ++ "linear", linear_processing, ++ "import-profile", import_profile, ++ "export-profile", export_profile, ++ "intent", intent, ++ NULL)) ++ return (-1); + } + + /* If the output format is something like ".jpg", we write to stdout +- * instead. ++ * instead. + * + * (but allow "./%s.jpg" as a output format) + */ +- if( vips_isprefix( ".", output_format ) && +- !vips_isprefix( "./", output_format ) ) { ++ if (vips_isprefix(".", output_format) && ++ !vips_isprefix("./", output_format)) { + VipsTarget *target; + +- if( !(target = vips_target_new_to_descriptor( 1 )) ) +- return( -1 ); ++ if (!(target = vips_target_new_to_descriptor(1))) ++ return (-1); + +- if( vips_image_write_to_target( image, +- output_format, target, NULL ) ) { +- VIPS_UNREF( image ); +- VIPS_UNREF( target ); +- return( -1 ); ++ if (vips_image_write_to_target(image, ++ output_format, target, NULL)) { ++ VIPS_UNREF(image); ++ VIPS_UNREF(target); ++ return (-1); + } + +- VIPS_UNREF( target ); ++ VIPS_UNREF(target); + } + else { +- if( thumbnail_write_file( process, image, name ) ) { +- VIPS_UNREF( image ); +- return( -1 ); ++ if (thumbnail_write_file(process, image, name)) { ++ VIPS_UNREF(image); ++ return (-1); + } + } + +- VIPS_UNREF( image ); ++ VIPS_UNREF(image); + +- return( 0 ); ++ return (0); + } + + /* Parse a geometry string and set thumbnail_width and thumbnail_height. + */ + static int +-thumbnail_parse_geometry( const char *geometry ) ++thumbnail_parse_geometry(const char *geometry) + { + /* Geometry strings have a regex like: + * +@@ -392,7 +392,7 @@ thumbnail_parse_geometry( const char *geometry ) + const char *p; + gboolean had_x; + +- /* w or h missing means replace with a huuuge value to prevent ++ /* w or h missing means replace with a huuuge value to prevent + * reduction or enlargement in that axis. + */ + thumbnail_width = VIPS_MAX_COORD; +@@ -400,90 +400,90 @@ thumbnail_parse_geometry( const char *geometry ) + + p = geometry; + +- /* Get the width. ++ /* Get the width. + */ +- while( isspace( *p ) ) ++ while (isspace(*p)) + p++; +- if( isdigit ( *p ) ) { +- thumbnail_width = atoi( p ); ++ if (isdigit(*p)) { ++ thumbnail_width = atoi(p); + +- while( isdigit( *p ) ) ++ while (isdigit(*p)) + p++; + } + +- /* Get the optional 'x'. ++ /* Get the optional 'x'. + */ +- while( isspace( *p ) ) ++ while (isspace(*p)) + p++; + had_x = FALSE; +- if( *p == 'x' ) { ++ if (*p == 'x') { + p += 1; + had_x = TRUE; + } +- while( isspace( *p ) ) ++ while (isspace(*p)) + p++; + +- /* Get the height. ++ /* Get the height. + */ +- if( isdigit( *p ) ) { +- thumbnail_height = atoi( p ); ++ if (isdigit(*p)) { ++ thumbnail_height = atoi(p); + +- while( isdigit( *p ) ) ++ while (isdigit(*p)) + p++; + } + + /* Get the final <>! + */ +- while( isspace( *p ) ) ++ while (isspace(*p)) + p++; +- if( *p == '<' ) ++ if (*p == '<') + size_restriction = VIPS_SIZE_UP; +- else if( *p == '>' ) ++ else if (*p == '>') + size_restriction = VIPS_SIZE_DOWN; +- else if( *p == '!' ) ++ else if (*p == '!') + size_restriction = VIPS_SIZE_FORCE; +- else if( *p != '\0' || +- (thumbnail_width == VIPS_MAX_COORD && +- thumbnail_height == VIPS_MAX_COORD) ) { +- vips_error( "thumbnail", "%s", _( "bad geometry spec" ) ); +- return( -1 ); ++ else if (*p != '\0' || ++ (thumbnail_width == VIPS_MAX_COORD && ++ thumbnail_height == VIPS_MAX_COORD)) { ++ vips_error("thumbnail", "%s", _("bad geometry spec")); ++ return (-1); + } + + /* If there was no 'x' we have just width. vipsthumbnail history means + * this is a square bounding box. + */ +- if( !had_x ) ++ if (!had_x) + thumbnail_height = thumbnail_width; + + /* If force is set and one of width or height isn't set, copy from the + * one that is. + */ +- if( size_restriction == VIPS_SIZE_FORCE ) { +- if( thumbnail_width == VIPS_MAX_COORD ) ++ if (size_restriction == VIPS_SIZE_FORCE) { ++ if (thumbnail_width == VIPS_MAX_COORD) + thumbnail_width = thumbnail_height; +- if( thumbnail_height == VIPS_MAX_COORD ) ++ if (thumbnail_height == VIPS_MAX_COORD) + thumbnail_height = thumbnail_width; + } + +- /* If --crop is set or force is set, both width and height must be ++ /* If --crop is set or force is set, both width and height must be + * specified, since we'll need a complete bounding box to fill. + */ +- if( crop_image || +- smartcrop_image || +- size_restriction == VIPS_SIZE_FORCE ) +- if( thumbnail_width == VIPS_MAX_COORD || +- thumbnail_height == VIPS_MAX_COORD ) { +- vips_error( "thumbnail", ++ if (crop_image || ++ smartcrop_image || ++ size_restriction == VIPS_SIZE_FORCE) ++ if (thumbnail_width == VIPS_MAX_COORD || ++ thumbnail_height == VIPS_MAX_COORD) { ++ vips_error("thumbnail", + "both width and height must be given if " +- "crop is enabled" ); +- return( -1 ); ++ "crop is enabled"); ++ return (-1); + } + +- return( 0 ); ++ return (0); + } + + int +-main( int argc, char **argv ) ++main(int argc, char **argv) + { + GOptionContext *context; + GOptionGroup *main_group; +@@ -491,21 +491,21 @@ main( int argc, char **argv ) + int i; + int result; + +- if( VIPS_INIT( argv[0] ) ) +- vips_error_exit( "unable to start VIPS" ); ++ if (VIPS_INIT(argv[0])) ++ vips_error_exit("unable to start VIPS"); + + #ifdef ENABLE_NLS +- textdomain( GETTEXT_PACKAGE ); ++ textdomain(GETTEXT_PACKAGE); + #endif /* ENABLE_NLS */ +- setlocale( LC_ALL, "" ); ++ setlocale(LC_ALL, ""); + +-{ +- char *basename; ++ { ++ char *basename; + +- basename = g_path_get_basename( argv[0] ); +- g_set_prgname( basename ); +- g_free( basename ); +-} ++ basename = g_path_get_basename(argv[0]); ++ g_set_prgname(basename); ++ g_free(basename); ++ } + + /* On Windows, argv is ascii-only .. use this to get a utf-8 version of + * the args. +@@ -514,55 +514,55 @@ main( int argc, char **argv ) + argv = g_win32_get_command_line(); + #endif /*G_OS_WIN32*/ + +- context = g_option_context_new( _( "- thumbnail generator" ) ); ++ context = g_option_context_new(_("- thumbnail generator")); + +- main_group = g_option_group_new( NULL, NULL, NULL, NULL, NULL ); +- g_option_group_add_entries( main_group, options ); +- vips_add_option_entries( main_group ); +- g_option_group_set_translation_domain( main_group, GETTEXT_PACKAGE ); +- g_option_context_set_main_group( context, main_group ); ++ main_group = g_option_group_new(NULL, NULL, NULL, NULL, NULL); ++ g_option_group_add_entries(main_group, options); ++ vips_add_option_entries(main_group); ++ g_option_group_set_translation_domain(main_group, GETTEXT_PACKAGE); ++ g_option_context_set_main_group(context, main_group); + + #ifdef G_OS_WIN32 +- if( !g_option_context_parse_strv( context, &argv, &error ) ) +-#else /*!G_OS_WIN32*/ +- if( !g_option_context_parse( context, &argc, &argv, &error ) ) ++ if (!g_option_context_parse_strv(context, &argv, &error)) ++#else /*!G_OS_WIN32*/ ++ if (!g_option_context_parse(context, &argc, &argv, &error)) + #endif /*G_OS_WIN32*/ + { +- if( error ) { +- fprintf( stderr, "%s\n", error->message ); +- g_error_free( error ); ++ if (error) { ++ fprintf(stderr, "%s\n", error->message); ++ g_error_free(error); + } + +- vips_error_exit( "try \"%s --help\"", g_get_prgname() ); ++ vips_error_exit("try \"%s --help\"", g_get_prgname()); + } + +- g_option_context_free( context ); ++ g_option_context_free(context); + +- if( version ) +- printf( "vips-%s\n", vips_version_string() ); ++ if (version) ++ printf("vips-%s\n", vips_version_string()); + +- if( thumbnail_size && +- thumbnail_parse_geometry( thumbnail_size ) ) +- vips_error_exit( NULL ); ++ if (thumbnail_size && ++ thumbnail_parse_geometry(thumbnail_size)) ++ vips_error_exit(NULL); + + #ifndef HAVE_EXIF +- if( rotate_image ) +- g_warning( "%s", +- _( "auto-rotate disabled: " +- "libvips built without exif support" ) ); ++ if (rotate_image) ++ g_warning("%s", ++ _("auto-rotate disabled: " ++ "libvips built without exif support")); + #endif /*!HAVE_EXIF*/ + + result = 0; + +- for( i = 1; argv[i]; i++ ) { ++ for (i = 1; argv[i]; i++) { + /* Hang resources for processing this thumbnail off @process. + */ +- VipsObject *process = VIPS_OBJECT( vips_image_new() ); ++ VipsObject *process = VIPS_OBJECT(vips_image_new()); + +- if( thumbnail_process( process, argv[i] ) ) { +- fprintf( stderr, "%s: unable to thumbnail %s\n", +- argv[0], argv[i] ); +- fprintf( stderr, "%s", vips_error_buffer() ); ++ if (thumbnail_process(process, argv[i])) { ++ fprintf(stderr, "%s: unable to thumbnail %s\n", ++ argv[0], argv[i]); ++ fprintf(stderr, "%s", vips_error_buffer()); + vips_error_clear(); + + /* We had a conversion failure: return an error code +@@ -571,16 +571,16 @@ main( int argc, char **argv ) + result = -1; + } + +- g_object_unref( process ); ++ g_object_unref(process); + } + + /* We don't free this on error exit, sadly. + */ + #ifdef G_OS_WIN32 +- g_strfreev( argv ); ++ g_strfreev(argv); + #endif /*G_OS_WIN32*/ + + vips_shutdown(); + +- return( result ); ++ return (result); + } diff --git a/tests/capture_tools_output/shenxianpeng/test-repo/.clang-format b/tests/capture_tools_output/shenxianpeng/test-repo/.clang-format new file mode 100644 index 0000000..1dd236c --- /dev/null +++ b/tests/capture_tools_output/shenxianpeng/test-repo/.clang-format @@ -0,0 +1,3 @@ +--- +Language: Cpp +BasedOnStyle: WebKit diff --git a/tests/capture_tools_output/shenxianpeng/test-repo/.clang-tidy b/tests/capture_tools_output/shenxianpeng/test-repo/.clang-tidy new file mode 100644 index 0000000..36fb3ab --- /dev/null +++ b/tests/capture_tools_output/shenxianpeng/test-repo/.clang-tidy @@ -0,0 +1,185 @@ +--- +Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,performance-*,bugprone-*,clang-analyzer-*,mpi-*,misc-*,readability-*' +WarningsAsErrors: '' +HeaderFilterRegex: '' +AnalyzeTemporaryDtors: false +FormatStyle: 'file' +CheckOptions: + - key: bugprone-argument-comment.CommentBoolLiterals + value: '0' + - key: bugprone-argument-comment.CommentCharacterLiterals + value: '0' + - key: bugprone-argument-comment.CommentFloatLiterals + value: '0' + - key: bugprone-argument-comment.CommentIntegerLiterals + value: '0' + - key: bugprone-argument-comment.CommentNullPtrs + value: '0' + - key: bugprone-argument-comment.CommentStringLiterals + value: '0' + - key: bugprone-argument-comment.CommentUserDefinedLiterals + value: '0' + - key: bugprone-argument-comment.IgnoreSingleArgument + value: '0' + - key: bugprone-argument-comment.StrictMode + value: '0' + - key: bugprone-assert-side-effect.AssertMacros + value: assert + - key: bugprone-assert-side-effect.CheckFunctionCalls + value: '0' + - key: bugprone-dangling-handle.HandleClasses + value: 'std::basic_string_view;std::experimental::basic_string_view' + - key: bugprone-dynamic-static-initializers.HeaderFileExtensions + value: ',h,hh,hpp,hxx' + - key: bugprone-exception-escape.FunctionsThatShouldNotThrow + value: '' + - key: bugprone-exception-escape.IgnoredExceptions + value: '' + - key: bugprone-misplaced-widening-cast.CheckImplicitCasts + value: '0' + - key: bugprone-not-null-terminated-result.WantToUseSafeFunctions + value: '1' + - key: bugprone-signed-char-misuse.CharTypdefsToIgnore + value: '' + - key: bugprone-sizeof-expression.WarnOnSizeOfCompareToConstant + value: '1' + - key: bugprone-sizeof-expression.WarnOnSizeOfConstant + value: '1' + - key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression + value: '0' + - key: bugprone-sizeof-expression.WarnOnSizeOfThis + value: '1' + - key: bugprone-string-constructor.LargeLengthThreshold + value: '8388608' + - key: bugprone-string-constructor.WarnOnLargeLength + value: '1' + - key: bugprone-suspicious-enum-usage.StrictMode + value: '0' + - key: bugprone-suspicious-missing-comma.MaxConcatenatedTokens + value: '5' + - key: bugprone-suspicious-missing-comma.RatioThreshold + value: '0.200000' + - key: bugprone-suspicious-missing-comma.SizeThreshold + value: '5' + - key: bugprone-suspicious-string-compare.StringCompareLikeFunctions + value: '' + - key: bugprone-suspicious-string-compare.WarnOnImplicitComparison + value: '1' + - key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison + value: '0' + - key: bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit + value: '16' + - key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField + value: '1' + - key: bugprone-unused-return-value.CheckedFunctions + value: '::std::async;::std::launder;::std::remove;::std::remove_if;::std::unique;::std::unique_ptr::release;::std::basic_string::empty;::std::vector::empty' + - key: cert-dcl16-c.NewSuffixes + value: 'L;LL;LU;LLU' + - key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField + value: '0' + - key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors + value: '1' + - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic + value: '1' + - key: google-readability-braces-around-statements.ShortStatementLines + value: '1' + - key: google-readability-function-size.StatementThreshold + value: '800' + - key: google-readability-namespace-comments.ShortNamespaceLines + value: '10' + - key: google-readability-namespace-comments.SpacesBeforeComments + value: '2' + - key: misc-definitions-in-headers.HeaderFileExtensions + value: ',h,hh,hpp,hxx' + - key: misc-definitions-in-headers.UseHeaderFileExtension + value: '1' + - key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries + value: '1' + - key: misc-unused-parameters.StrictMode + value: '0' + - key: modernize-loop-convert.MaxCopySize + value: '16' + - key: modernize-loop-convert.MinConfidence + value: reasonable + - key: modernize-loop-convert.NamingStyle + value: CamelCase + - key: modernize-pass-by-value.IncludeStyle + value: llvm + - key: modernize-replace-auto-ptr.IncludeStyle + value: llvm + - key: modernize-use-nullptr.NullMacros + value: 'NULL' + - key: performance-faster-string-find.StringLikeClasses + value: 'std::basic_string' + - key: performance-for-range-copy.AllowedTypes + value: '' + - key: performance-for-range-copy.WarnOnAllAutoCopies + value: '0' + - key: performance-inefficient-string-concatenation.StrictMode + value: '0' + - key: performance-inefficient-vector-operation.EnableProto + value: '0' + - key: performance-inefficient-vector-operation.VectorLikeClasses + value: '::std::vector' + - key: performance-move-const-arg.CheckTriviallyCopyableMove + value: '1' + - key: performance-move-constructor-init.IncludeStyle + value: llvm + - key: performance-no-automatic-move.AllowedTypes + value: '' + - key: performance-type-promotion-in-math-fn.IncludeStyle + value: llvm + - key: performance-unnecessary-copy-initialization.AllowedTypes + value: '' + - key: performance-unnecessary-value-param.AllowedTypes + value: '' + - key: performance-unnecessary-value-param.IncludeStyle + value: llvm + - key: readability-braces-around-statements.ShortStatementLines + value: '0' + - key: readability-else-after-return.WarnOnUnfixable + value: '1' + - key: readability-function-size.BranchThreshold + value: '4294967295' + - key: readability-function-size.LineThreshold + value: '4294967295' + - key: readability-function-size.NestingThreshold + value: '4294967295' + - key: readability-function-size.ParameterThreshold + value: '4294967295' + - key: readability-function-size.StatementThreshold + value: '800' + - key: readability-function-size.VariableThreshold + value: '4294967295' + - key: readability-identifier-naming.IgnoreFailedSplit + value: '0' + - key: readability-implicit-bool-conversion.AllowIntegerConditions + value: '0' + - key: readability-implicit-bool-conversion.AllowPointerConditions + value: '0' + - key: readability-inconsistent-declaration-parameter-name.IgnoreMacros + value: '1' + - key: readability-inconsistent-declaration-parameter-name.Strict + value: '0' + - key: readability-magic-numbers.IgnoredFloatingPointValues + value: '1.0;100.0;' + - key: readability-magic-numbers.IgnoredIntegerValues + value: '1;2;3;4;' + - key: readability-redundant-member-init.IgnoreBaseInCopyConstructors + value: '0' + - key: readability-redundant-smartptr-get.IgnoreMacros + value: '1' + - key: readability-redundant-string-init.StringNames + value: '::std::basic_string' + - key: readability-simplify-boolean-expr.ChainedConditionalAssignment + value: '0' + - key: readability-simplify-boolean-expr.ChainedConditionalReturn + value: '0' + - key: readability-simplify-subscript-expr.Types + value: '::std::basic_string;::std::basic_string_view;::std::vector;::std::array' + - key: readability-static-accessed-through-instance.NameSpecifierNestingThreshold + value: '3' + - key: readability-uppercase-literal-suffix.IgnoreMacros + value: '1' + - key: readability-uppercase-literal-suffix.NewSuffixes + value: '' diff --git a/tests/capture_tools_output/shenxianpeng/test-repo/662ad4cf90084063ea9c089b8de4aff0b8959d0e.diff b/tests/capture_tools_output/shenxianpeng/test-repo/662ad4cf90084063ea9c089b8de4aff0b8959d0e.diff new file mode 100644 index 0000000..a0eae42 --- /dev/null +++ b/tests/capture_tools_output/shenxianpeng/test-repo/662ad4cf90084063ea9c089b8de4aff0b8959d0e.diff @@ -0,0 +1,5409 @@ +diff --git a/p_enemy.c b/p_enemy.c +new file mode 100644 +index 0000000..7bbd003 +--- /dev/null ++++ b/p_enemy.c +@@ -0,0 +1,5403 @@ ++// ++// Copyright(C) 1993-1996 Id Software, Inc. ++// Copyright(C) 1993-2008 Raven Software ++// Copyright(C) 2005-2014 Simon Howard ++// ++// This program is free software; you can redistribute it and/or ++// modify it under the terms of the GNU General Public License ++// as published by the Free Software Foundation; either version 2 ++// of the License, or (at your option) any later version. ++// ++// This program is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++// ++ ++ ++#include "h2def.h" ++#include "m_random.h" ++#include "i_system.h" ++#include "i_swap.h" ++#include "p_local.h" ++#include "s_sound.h" ++ ++// Macros ++// Types ++// Private Data ++// External Data ++ ++ ++//---------------------------------------------------------------------------- ++// ++// PROC P_RecursiveSound ++// ++//---------------------------------------------------------------------------- ++ ++mobj_t *soundtarget; ++ ++void P_RecursiveSound(sector_t * sec, int soundblocks) ++{ ++ int i; ++ line_t *check; ++ sector_t *other; ++ ++ // Wake up all monsters in this sector ++ if (sec->validcount == validcount ++ && sec->soundtraversed <= soundblocks + 1) ++ { // Already flooded ++ return; ++ } ++ sec->validcount = validcount; ++ sec->soundtraversed = soundblocks + 1; ++ sec->soundtarget = soundtarget; ++ for (i = 0; i < sec->linecount; i++) ++ { ++ check = sec->lines[i]; ++ if (!(check->flags & ML_TWOSIDED)) ++ { ++ continue; ++ } ++ P_LineOpening(check); ++ if (openrange <= 0) ++ { // Closed door ++ continue; ++ } ++ if (sides[check->sidenum[0]].sector == sec) ++ { ++ other = sides[check->sidenum[1]].sector; ++ } ++ else ++ { ++ other = sides[check->sidenum[0]].sector; ++ } ++ if (check->flags & ML_SOUNDBLOCK) ++ { ++ if (!soundblocks) ++ { ++ P_RecursiveSound(other, 1); ++ } ++ } ++ else ++ { ++ P_RecursiveSound(other, soundblocks); ++ } ++ } ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC P_NoiseAlert ++// ++// If a monster yells at a player, it will alert other monsters to the ++// player. ++// ++//---------------------------------------------------------------------------- ++ ++void P_NoiseAlert(mobj_t * target, mobj_t * emmiter) ++{ ++ soundtarget = target; ++ validcount++; ++ P_RecursiveSound(emmiter->subsector->sector, 0); ++} ++ ++//---------------------------------------------------------------------------- ++// ++// FUNC P_CheckMeleeRange ++// ++//---------------------------------------------------------------------------- ++ ++boolean P_CheckMeleeRange(mobj_t * actor) ++{ ++ mobj_t *mo; ++ fixed_t dist; ++ ++ if (!actor->target) ++ { ++ return (false); ++ } ++ mo = actor->target; ++ dist = P_AproxDistance(mo->x - actor->x, mo->y - actor->y); ++ if (dist >= MELEERANGE) ++ { ++ return (false); ++ } ++ if (!P_CheckSight(actor, mo)) ++ { ++ return (false); ++ } ++ if (mo->z > actor->z + actor->height) ++ { // Target is higher than the attacker ++ return (false); ++ } ++ else if (actor->z > mo->z + mo->height) ++ { // Attacker is higher ++ return (false); ++ } ++ return (true); ++} ++ ++//---------------------------------------------------------------------------- ++// ++// FUNC P_CheckMeleeRange2 ++// ++//---------------------------------------------------------------------------- ++ ++boolean P_CheckMeleeRange2(mobj_t * actor) ++{ ++ mobj_t *mo; ++ fixed_t dist; ++ ++ if (!actor->target) ++ { ++ return (false); ++ } ++ mo = actor->target; ++ dist = P_AproxDistance(mo->x - actor->x, mo->y - actor->y); ++ if (dist >= MELEERANGE * 2 || dist < MELEERANGE) ++ { ++ return (false); ++ } ++ if (!P_CheckSight(actor, mo)) ++ { ++ return (false); ++ } ++ if (mo->z > actor->z + actor->height) ++ { // Target is higher than the attacker ++ return (false); ++ } ++ else if (actor->z > mo->z + mo->height) ++ { // Attacker is higher ++ return (false); ++ } ++ return (true); ++} ++ ++//---------------------------------------------------------------------------- ++// ++// FUNC P_CheckMissileRange ++// ++//---------------------------------------------------------------------------- ++ ++boolean P_CheckMissileRange(mobj_t * actor) ++{ ++ fixed_t dist; ++ ++ if (!P_CheckSight(actor, actor->target)) ++ { ++ return (false); ++ } ++ if (actor->flags & MF_JUSTHIT) ++ { // The target just hit the enemy, so fight back! ++ actor->flags &= ~MF_JUSTHIT; ++ return (true); ++ } ++ if (actor->reactiontime) ++ { // Don't attack yet ++ return (false); ++ } ++ dist = (P_AproxDistance(actor->x - actor->target->x, ++ actor->y - actor->target->y) >> FRACBITS) - 64; ++ if (!actor->info->meleestate) ++ { // No melee attack, so fire more frequently ++ dist -= 128; ++ } ++ if (dist > 200) ++ { ++ dist = 200; ++ } ++ if (P_Random() < dist) ++ { ++ return (false); ++ } ++ return (true); ++} ++ ++/* ++================ ++= ++= P_Move ++= ++= Move in the current direction ++= returns false if the move is blocked ++================ ++*/ ++ ++fixed_t xspeed[8] = ++ { FRACUNIT, 47000, 0, -47000, -FRACUNIT, -47000, 0, 47000 }; ++fixed_t yspeed[8] = ++ { 0, 47000, FRACUNIT, 47000, 0, -47000, -FRACUNIT, -47000 }; ++ ++ ++boolean P_Move(mobj_t * actor) ++{ ++ fixed_t tryx, tryy; ++ line_t *ld; ++ boolean good; ++ ++ if (actor->flags2 & MF2_BLASTED) ++ return (true); ++ if (actor->movedir == DI_NODIR) ++ { ++ return (false); ++ } ++ tryx = actor->x + actor->info->speed * xspeed[actor->movedir]; ++ tryy = actor->y + actor->info->speed * yspeed[actor->movedir]; ++ if (!P_TryMove(actor, tryx, tryy)) ++ { // open any specials ++ if (actor->flags & MF_FLOAT && floatok) ++ { // must adjust height ++ if (actor->z < tmfloorz) ++ { ++ actor->z += FLOATSPEED; ++ } ++ else ++ { ++ actor->z -= FLOATSPEED; ++ } ++ actor->flags |= MF_INFLOAT; ++ return (true); ++ } ++ if (!numspechit) ++ { ++ return false; ++ } ++ actor->movedir = DI_NODIR; ++ good = false; ++ while (numspechit--) ++ { ++ ld = spechit[numspechit]; ++ // if the special isn't a door that can be opened, return false ++ if (P_ActivateLine(ld, actor, 0, SPAC_USE)) ++ { ++ good = true; ++ } ++/* Old version before use/cross/impact specials were combined ++ if(P_UseSpecialLine(actor, ld)) ++ { ++ good = true; ++ } ++*/ ++ } ++ return (good); ++ } ++ else ++ { ++ actor->flags &= ~MF_INFLOAT; ++ } ++ if (!(actor->flags & MF_FLOAT)) ++ { ++ if (actor->z > actor->floorz) ++ { ++ P_HitFloor(actor); ++ } ++ actor->z = actor->floorz; ++ } ++ return (true); ++} ++ ++//---------------------------------------------------------------------------- ++// ++// FUNC P_TryWalk ++// ++// Attempts to move actor in its current (ob->moveangle) direction. ++// If blocked by either a wall or an actor returns FALSE. ++// If move is either clear of block only by a door, returns TRUE and sets. ++// If a door is in the way, an OpenDoor call is made to start it opening. ++// ++//---------------------------------------------------------------------------- ++ ++boolean P_TryWalk(mobj_t * actor) ++{ ++ if (!P_Move(actor)) ++ { ++ return (false); ++ } ++ actor->movecount = P_Random() & 15; ++ return (true); ++} ++ ++/* ++================ ++= ++= P_NewChaseDir ++= ++================ ++*/ ++ ++dirtype_t opposite[] = ++ { DI_WEST, DI_SOUTHWEST, DI_SOUTH, DI_SOUTHEAST, DI_EAST, DI_NORTHEAST, ++ DI_NORTH, DI_NORTHWEST, DI_NODIR ++}; ++ ++dirtype_t diags[] = ++ { DI_NORTHWEST, DI_NORTHEAST, DI_SOUTHWEST, DI_SOUTHEAST }; ++ ++void P_NewChaseDir(mobj_t * actor) ++{ ++ fixed_t deltax, deltay; ++ dirtype_t d[3]; ++ dirtype_t tdir, olddir, turnaround; ++ ++ if (!actor->target) ++ I_Error("P_NewChaseDir: called with no target"); ++ ++ olddir = actor->movedir; ++ turnaround = opposite[olddir]; ++ ++ deltax = actor->target->x - actor->x; ++ deltay = actor->target->y - actor->y; ++ if (deltax > 10 * FRACUNIT) ++ d[1] = DI_EAST; ++ else if (deltax < -10 * FRACUNIT) ++ d[1] = DI_WEST; ++ else ++ d[1] = DI_NODIR; ++ if (deltay < -10 * FRACUNIT) ++ d[2] = DI_SOUTH; ++ else if (deltay > 10 * FRACUNIT) ++ d[2] = DI_NORTH; ++ else ++ d[2] = DI_NODIR; ++ ++// try direct route ++ if (d[1] != DI_NODIR && d[2] != DI_NODIR) ++ { ++ actor->movedir = diags[((deltay < 0) << 1) + (deltax > 0)]; ++ if (actor->movedir != turnaround && P_TryWalk(actor)) ++ return; ++ } ++ ++// try other directions ++ if (P_Random() > 200 || abs(deltay) > abs(deltax)) ++ { ++ tdir = d[1]; ++ d[1] = d[2]; ++ d[2] = tdir; ++ } ++ ++ if (d[1] == turnaround) ++ d[1] = DI_NODIR; ++ if (d[2] == turnaround) ++ d[2] = DI_NODIR; ++ ++ if (d[1] != DI_NODIR) ++ { ++ actor->movedir = d[1]; ++ if (P_TryWalk(actor)) ++ return; /*either moved forward or attacked */ ++ } ++ ++ if (d[2] != DI_NODIR) ++ { ++ actor->movedir = d[2]; ++ if (P_TryWalk(actor)) ++ return; ++ } ++ ++/* there is no direct path to the player, so pick another direction */ ++ ++ if (olddir != DI_NODIR) ++ { ++ actor->movedir = olddir; ++ if (P_TryWalk(actor)) ++ return; ++ } ++ ++ if (P_Random() & 1) /*randomly determine direction of search */ ++ { ++ for (tdir = DI_EAST; tdir <= DI_SOUTHEAST; tdir++) ++ { ++ if (tdir != turnaround) ++ { ++ actor->movedir = tdir; ++ if (P_TryWalk(actor)) ++ return; ++ } ++ } ++ } ++ else ++ { ++ tdir = DI_SOUTHEAST; ++ ++ for (;;) ++ { ++ if (tdir != turnaround) ++ { ++ actor->movedir = tdir; ++ if (P_TryWalk(actor)) ++ return; ++ } ++ ++ if (tdir == DI_EAST) ++ { ++ break; ++ } ++ ++ --tdir; ++ } ++ } ++ ++ if (turnaround != DI_NODIR) ++ { ++ actor->movedir = turnaround; ++ if (P_TryWalk(actor)) ++ return; ++ } ++ ++ actor->movedir = DI_NODIR; // can't move ++} ++ ++//--------------------------------------------------------------------------- ++// ++// FUNC P_LookForMonsters ++// ++//--------------------------------------------------------------------------- ++ ++#define MONS_LOOK_RANGE (16*64*FRACUNIT) ++#define MONS_LOOK_LIMIT 64 ++ ++boolean P_LookForMonsters(mobj_t * actor) ++{ ++ int count; ++ mobj_t *mo; ++ thinker_t *think; ++ ++ if (!P_CheckSight(players[0].mo, actor)) ++ { // Player can't see monster ++ return (false); ++ } ++ count = 0; ++ for (think = thinkercap.next; think != &thinkercap; think = think->next) ++ { ++ if (think->function != P_MobjThinker) ++ { // Not a mobj thinker ++ continue; ++ } ++ mo = (mobj_t *) think; ++ if (!(mo->flags & MF_COUNTKILL) || (mo == actor) || (mo->health <= 0)) ++ { // Not a valid monster ++ continue; ++ } ++ if (P_AproxDistance(actor->x - mo->x, actor->y - mo->y) ++ > MONS_LOOK_RANGE) ++ { // Out of range ++ continue; ++ } ++ if (P_Random() < 16) ++ { // Skip ++ continue; ++ } ++ if (count++ > MONS_LOOK_LIMIT) ++ { // Stop searching ++ return (false); ++ } ++ if (!P_CheckSight(actor, mo)) ++ { // Out of sight ++ continue; ++ } ++ if (actor->type == MT_MINOTAUR) ++ { ++ if ((mo->type == MT_MINOTAUR) && ++ (mo->target != actor->special1.p->mo)) ++ { ++ continue; ++ } ++ } ++ // Found a target monster ++ actor->target = mo; ++ return (true); ++ } ++ return (false); ++} ++ ++/* ++================ ++= ++= P_LookForPlayers ++= ++= If allaround is false, only look 180 degrees in front ++= returns true if a player is targeted ++================ ++*/ ++ ++boolean P_LookForPlayers(mobj_t * actor, boolean allaround) ++{ ++ int c; ++ int stop; ++ player_t *player; ++ angle_t an; ++ fixed_t dist; ++ ++ if (!netgame && players[0].health <= 0) ++ { // Single player game and player is dead, look for monsters ++ return (P_LookForMonsters(actor)); ++ } ++ c = 0; ++ ++ // NOTE: This behavior has been changed from the Vanilla behavior, where ++ // an infinite loop can occur if players 0-3 all quit the game. Although ++ // technically this is not what Vanilla does, fixing this is highly ++ // desirable, and having the game simply lock up is not acceptable. ++ // stop = (actor->lastlook - 1) & 3; ++ // for (;; actor->lastlook = (actor->lastlook + 1) & 3) ++ ++ stop = (actor->lastlook + maxplayers - 1) % maxplayers; ++ for (;; actor->lastlook = (actor->lastlook + 1) % maxplayers) ++ { ++ if (!playeringame[actor->lastlook]) ++ continue; ++ ++ if (c++ == 2 || actor->lastlook == stop) ++ return false; // done looking ++ ++ player = &players[actor->lastlook]; ++ if (player->health <= 0) ++ continue; // dead ++ if (!P_CheckSight(actor, player->mo)) ++ continue; // out of sight ++ ++ if (!allaround) ++ { ++ an = R_PointToAngle2(actor->x, actor->y, ++ player->mo->x, player->mo->y) - actor->angle; ++ if (an > ANG90 && an < ANG270) ++ { ++ dist = P_AproxDistance(player->mo->x - actor->x, ++ player->mo->y - actor->y); ++ // if real close, react anyway ++ if (dist > MELEERANGE) ++ continue; // behind back ++ } ++ } ++ if (player->mo->flags & MF_SHADOW) ++ { // Player is invisible ++ if ((P_AproxDistance(player->mo->x - actor->x, ++ player->mo->y - actor->y) > 2 * MELEERANGE) ++ && P_AproxDistance(player->mo->momx, player->mo->momy) ++ < 5 * FRACUNIT) ++ { // Player is sneaking - can't detect ++ return (false); ++ } ++ if (P_Random() < 225) ++ { // Player isn't sneaking, but still didn't detect ++ return (false); ++ } ++ } ++ if (actor->type == MT_MINOTAUR) ++ { ++ if (actor->special1.p == player) ++ { ++ continue; // Don't target master ++ } ++ } ++ ++ actor->target = player->mo; ++ return (true); ++ } ++ return (false); ++} ++ ++/* ++=============================================================================== ++ ACTION ROUTINES ++=============================================================================== ++*/ ++ ++/* ++============== ++= ++= A_Look ++= ++= Stay in state until a player is sighted ++= ++============== ++*/ ++ ++void A_Look(mobj_t * actor) ++{ ++ mobj_t *targ; ++ ++ actor->threshold = 0; // any shot will wake up ++ targ = actor->subsector->sector->soundtarget; ++ if (targ && (targ->flags & MF_SHOOTABLE)) ++ { ++ actor->target = targ; ++ if (actor->flags & MF_AMBUSH) ++ { ++ if (P_CheckSight(actor, actor->target)) ++ goto seeyou; ++ } ++ else ++ goto seeyou; ++ } ++ ++ ++ if (!P_LookForPlayers(actor, false)) ++ return; ++ ++// go into chase state ++ seeyou: ++ if (actor->info->seesound) ++ { ++ int sound; ++ ++ sound = actor->info->seesound; ++ if (actor->flags2 & MF2_BOSS) ++ { // Full volume ++ S_StartSound(NULL, sound); ++ } ++ else ++ { ++ S_StartSound(actor, sound); ++ } ++ } ++ P_SetMobjState(actor, actor->info->seestate); ++} ++ ++ ++/* ++============== ++= ++= A_Chase ++= ++= Actor has a melee attack, so it tries to close as fast as possible ++= ++============== ++*/ ++ ++void A_Chase(mobj_t * actor) ++{ ++ int delta; ++ ++ if (actor->reactiontime) ++ { ++ actor->reactiontime--; ++ } ++ ++ // Modify target threshold ++ if (actor->threshold) ++ { ++ actor->threshold--; ++ } ++ ++ if (gameskill == sk_nightmare) ++ { // Monsters move faster in nightmare mode ++ actor->tics -= actor->tics / 2; ++ if (actor->tics < 3) ++ { ++ actor->tics = 3; ++ } ++ } ++ ++// ++// turn towards movement direction if not there yet ++// ++ if (actor->movedir < 8) ++ { ++ actor->angle &= (7 << 29); ++ delta = actor->angle - (actor->movedir << 29); ++ if (delta > 0) ++ { ++ actor->angle -= ANG90 / 2; ++ } ++ else if (delta < 0) ++ { ++ actor->angle += ANG90 / 2; ++ } ++ } ++ ++ if (!actor->target || !(actor->target->flags & MF_SHOOTABLE)) ++ { // look for a new target ++ if (P_LookForPlayers(actor, true)) ++ { // got a new target ++ return; ++ } ++ P_SetMobjState(actor, actor->info->spawnstate); ++ return; ++ } ++ ++// ++// don't attack twice in a row ++// ++ if (actor->flags & MF_JUSTATTACKED) ++ { ++ actor->flags &= ~MF_JUSTATTACKED; ++ if (gameskill != sk_nightmare) ++ P_NewChaseDir(actor); ++ return; ++ } ++ ++// ++// check for melee attack ++// ++ if (actor->info->meleestate && P_CheckMeleeRange(actor)) ++ { ++ if (actor->info->attacksound) ++ { ++ S_StartSound(actor, actor->info->attacksound); ++ } ++ P_SetMobjState(actor, actor->info->meleestate); ++ return; ++ } ++ ++// ++// check for missile attack ++// ++ if (actor->info->missilestate) ++ { ++ if (gameskill < sk_nightmare && actor->movecount) ++ goto nomissile; ++ if (!P_CheckMissileRange(actor)) ++ goto nomissile; ++ P_SetMobjState(actor, actor->info->missilestate); ++ actor->flags |= MF_JUSTATTACKED; ++ return; ++ } ++ nomissile: ++ ++// ++// possibly choose another target ++// ++ if (netgame && !actor->threshold && !P_CheckSight(actor, actor->target)) ++ { ++ if (P_LookForPlayers(actor, true)) ++ return; // got a new target ++ } ++ ++// ++// chase towards player ++// ++ if (--actor->movecount < 0 || !P_Move(actor)) ++ { ++ P_NewChaseDir(actor); ++ } ++ ++// ++// make active sound ++// ++ if (actor->info->activesound && P_Random() < 3) ++ { ++ if (actor->type == MT_BISHOP && P_Random() < 128) ++ { ++ S_StartSound(actor, actor->info->seesound); ++ } ++ else if (actor->type == MT_PIG) ++ { ++ S_StartSound(actor, SFX_PIG_ACTIVE1 + (P_Random() & 1)); ++ } ++ else if (actor->flags2 & MF2_BOSS) ++ { ++ S_StartSound(NULL, actor->info->activesound); ++ } ++ else ++ { ++ S_StartSound(actor, actor->info->activesound); ++ } ++ } ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_FaceTarget ++// ++//---------------------------------------------------------------------------- ++ ++void A_FaceTarget(mobj_t * actor) ++{ ++ if (!actor->target) ++ { ++ return; ++ } ++ actor->flags &= ~MF_AMBUSH; ++ actor->angle = R_PointToAngle2(actor->x, actor->y, actor->target->x, ++ actor->target->y); ++ if (actor->target->flags & MF_SHADOW) ++ { // Target is a ghost ++ actor->angle += P_SubRandom() << 21; ++ } ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_Pain ++// ++//---------------------------------------------------------------------------- ++ ++void A_Pain(mobj_t * actor) ++{ ++ if (actor->info->painsound) ++ { ++ S_StartSound(actor, actor->info->painsound); ++ } ++} ++ ++//============================================================================ ++// ++// A_SetInvulnerable ++// ++//============================================================================ ++ ++void A_SetInvulnerable(mobj_t * actor) ++{ ++ actor->flags2 |= MF2_INVULNERABLE; ++} ++ ++//============================================================================ ++// ++// A_UnSetInvulnerable ++// ++//============================================================================ ++ ++void A_UnSetInvulnerable(mobj_t * actor) ++{ ++ actor->flags2 &= ~MF2_INVULNERABLE; ++} ++ ++//============================================================================ ++// ++// A_SetReflective ++// ++//============================================================================ ++ ++void A_SetReflective(mobj_t * actor) ++{ ++ actor->flags2 |= MF2_REFLECTIVE; ++ ++ if ((actor->type == MT_CENTAUR) || (actor->type == MT_CENTAURLEADER)) ++ { ++ A_SetInvulnerable(actor); ++ } ++} ++ ++//============================================================================ ++// ++// A_UnSetReflective ++// ++//============================================================================ ++ ++void A_UnSetReflective(mobj_t * actor) ++{ ++ actor->flags2 &= ~MF2_REFLECTIVE; ++ ++ if ((actor->type == MT_CENTAUR) || (actor->type == MT_CENTAURLEADER)) ++ { ++ A_UnSetInvulnerable(actor); ++ } ++} ++ ++ ++//---------------------------------------------------------------------------- ++// ++// FUNC P_UpdateMorphedMonster ++// ++// Returns true if the pig morphs. ++// ++//---------------------------------------------------------------------------- ++ ++boolean P_UpdateMorphedMonster(mobj_t * actor, int tics) ++{ ++ mobj_t *fog; ++ fixed_t x; ++ fixed_t y; ++ fixed_t z; ++ mobjtype_t moType; ++ mobj_t *mo; ++ mobj_t oldMonster; ++ ++ actor->special1.i -= tics; ++ if (actor->special1.i > 0) ++ { ++ return (false); ++ } ++ moType = actor->special2.i; ++ switch (moType) ++ { ++ case MT_WRAITHB: // These must remain morphed ++ case MT_SERPENT: ++ case MT_SERPENTLEADER: ++ case MT_MINOTAUR: ++ return (false); ++ default: ++ break; ++ } ++ x = actor->x; ++ y = actor->y; ++ z = actor->z; ++ oldMonster = *actor; // Save pig vars ++ ++ P_RemoveMobjFromTIDList(actor); ++ P_SetMobjState(actor, S_FREETARGMOBJ); ++ mo = P_SpawnMobj(x, y, z, moType); ++ ++ if (P_TestMobjLocation(mo) == false) ++ { // Didn't fit ++ P_RemoveMobj(mo); ++ mo = P_SpawnMobj(x, y, z, oldMonster.type); ++ mo->angle = oldMonster.angle; ++ mo->flags = oldMonster.flags; ++ mo->health = oldMonster.health; ++ mo->target = oldMonster.target; ++ mo->special = oldMonster.special; ++ mo->special1.i = 5 * 35; // Next try in 5 seconds ++ mo->special2.i = moType; ++ mo->tid = oldMonster.tid; ++ memcpy(mo->args, oldMonster.args, 5); ++ P_InsertMobjIntoTIDList(mo, oldMonster.tid); ++ return (false); ++ } ++ mo->angle = oldMonster.angle; ++ mo->target = oldMonster.target; ++ mo->tid = oldMonster.tid; ++ mo->special = oldMonster.special; ++ memcpy(mo->args, oldMonster.args, 5); ++ P_InsertMobjIntoTIDList(mo, oldMonster.tid); ++ fog = P_SpawnMobj(x, y, z + TELEFOGHEIGHT, MT_TFOG); ++ S_StartSound(fog, SFX_TELEPORT); ++ return (true); ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_PigLook ++// ++//---------------------------------------------------------------------------- ++ ++void A_PigLook(mobj_t * actor) ++{ ++ if (P_UpdateMorphedMonster(actor, 10)) ++ { ++ return; ++ } ++ A_Look(actor); ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_PigChase ++// ++//---------------------------------------------------------------------------- ++ ++void A_PigChase(mobj_t * actor) ++{ ++ if (P_UpdateMorphedMonster(actor, 3)) ++ { ++ return; ++ } ++ A_Chase(actor); ++} ++ ++//============================================================================ ++// ++// A_PigAttack ++// ++//============================================================================ ++ ++void A_PigAttack(mobj_t * actor) ++{ ++ if (P_UpdateMorphedMonster(actor, 18)) ++ { ++ return; ++ } ++ if (!actor->target) ++ { ++ return; ++ } ++ if (P_CheckMeleeRange(actor)) ++ { ++ P_DamageMobj(actor->target, actor, actor, 2 + (P_Random() & 1)); ++ S_StartSound(actor, SFX_PIG_ATTACK); ++ } ++} ++ ++//============================================================================ ++// ++// A_PigPain ++// ++//============================================================================ ++ ++void A_PigPain(mobj_t * actor) ++{ ++ A_Pain(actor); ++ if (actor->z <= actor->floorz) ++ { ++ actor->momz = 3.5 * FRACUNIT; ++ } ++} ++ ++ ++ ++void FaceMovementDirection(mobj_t * actor) ++{ ++ switch (actor->movedir) ++ { ++ case DI_EAST: ++ actor->angle = 0 << 24; ++ break; ++ case DI_NORTHEAST: ++ actor->angle = 32 << 24; ++ break; ++ case DI_NORTH: ++ actor->angle = 64 << 24; ++ break; ++ case DI_NORTHWEST: ++ actor->angle = 96 << 24; ++ break; ++ case DI_WEST: ++ actor->angle = 128 << 24; ++ break; ++ case DI_SOUTHWEST: ++ actor->angle = 160 << 24; ++ break; ++ case DI_SOUTH: ++ actor->angle = 192 << 24; ++ break; ++ case DI_SOUTHEAST: ++ actor->angle = 224 << 24; ++ break; ++ } ++} ++ ++ ++//---------------------------------------------------------------------------- ++// ++// Minotaur variables ++// ++// special1 pointer to player that spawned it (mobj_t) ++// special2 internal to minotaur AI ++// args[0] args[0]-args[3] together make up minotaur start time ++// args[1] | ++// args[2] | ++// args[3] V ++// args[4] charge duration countdown ++//---------------------------------------------------------------------------- ++ ++void A_MinotaurFade0(mobj_t * actor) ++{ ++ actor->flags &= ~MF_ALTSHADOW; ++ actor->flags |= MF_SHADOW; ++} ++ ++void A_MinotaurFade1(mobj_t * actor) ++{ ++ // Second level of transparency ++ actor->flags &= ~MF_SHADOW; ++ actor->flags |= MF_ALTSHADOW; ++} ++ ++void A_MinotaurFade2(mobj_t * actor) ++{ ++ // Make fully visible ++ actor->flags &= ~MF_SHADOW; ++ actor->flags &= ~MF_ALTSHADOW; ++} ++ ++ ++//---------------------------------------------------------------------------- ++// ++// A_MinotaurRoam - ++// ++// ++//---------------------------------------------------------------------------- ++ ++ ++// Check the age of the minotaur and stomp it after MAULATORTICS of time ++// have passed. Returns false if killed. ++static boolean CheckMinotaurAge(mobj_t *mo) ++{ ++ unsigned int starttime; ++ ++ // The start time is stored in the mobj_t structure, but it is stored ++ // in little endian format. For Vanilla savegame compatibility we must ++ // swap it to the native endianness. ++ memcpy(&starttime, mo->args, sizeof(unsigned int)); ++ ++ if (leveltime - LONG(starttime) >= MAULATORTICS) ++ { ++ P_DamageMobj(mo, NULL, NULL, 10000); ++ return false; ++ } ++ ++ return true; ++} ++ ++void A_MinotaurRoam(mobj_t * actor) ++{ ++ actor->flags &= ~MF_SHADOW; // In case pain caused him to ++ actor->flags &= ~MF_ALTSHADOW; // skip his fade in. ++ ++ if (!CheckMinotaurAge(actor)) ++ { ++ return; ++ } ++ ++ if (P_Random() < 30) ++ A_MinotaurLook(actor); // adjust to closest target ++ ++ if (P_Random() < 6) ++ { ++ //Choose new direction ++ actor->movedir = P_Random() % 8; ++ FaceMovementDirection(actor); ++ } ++ if (!P_Move(actor)) ++ { ++ // Turn ++ if (P_Random() & 1) ++ actor->movedir = (actor->movedir + 1) % 8; ++ else ++ actor->movedir = (actor->movedir + 7) % 8; ++ FaceMovementDirection(actor); ++ } ++} ++ ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_MinotaurLook ++// ++// Look for enemy of player ++//---------------------------------------------------------------------------- ++#define MINOTAUR_LOOK_DIST (16*54*FRACUNIT) ++ ++void A_MinotaurLook(mobj_t * actor) ++{ ++ mobj_t *mo = NULL; ++ player_t *player; ++ thinker_t *think; ++ fixed_t dist; ++ int i; ++ mobj_t *master = actor->special1.m; ++ ++ actor->target = NULL; ++ if (deathmatch) // Quick search for players ++ { ++ for (i = 0; i < maxplayers; i++) ++ { ++ if (!playeringame[i]) ++ continue; ++ player = &players[i]; ++ mo = player->mo; ++ if (mo == master) ++ continue; ++ if (mo->health <= 0) ++ continue; ++ dist = P_AproxDistance(actor->x - mo->x, actor->y - mo->y); ++ if (dist > MINOTAUR_LOOK_DIST) ++ continue; ++ actor->target = mo; ++ break; ++ } ++ } ++ ++ if (!actor->target) // Near player monster search ++ { ++ if (master && (master->health > 0) && (master->player)) ++ mo = P_RoughMonsterSearch(master, 20); ++ else ++ mo = P_RoughMonsterSearch(actor, 20); ++ actor->target = mo; ++ } ++ ++ if (!actor->target) // Normal monster search ++ { ++ for (think = thinkercap.next; think != &thinkercap; ++ think = think->next) ++ { ++ if (think->function != P_MobjThinker) ++ continue; ++ mo = (mobj_t *) think; ++ if (!(mo->flags & MF_COUNTKILL)) ++ continue; ++ if (mo->health <= 0) ++ continue; ++ if (!(mo->flags & MF_SHOOTABLE)) ++ continue; ++ dist = P_AproxDistance(actor->x - mo->x, actor->y - mo->y); ++ if (dist > MINOTAUR_LOOK_DIST) ++ continue; ++ if ((mo == master) || (mo == actor)) ++ continue; ++ if ((mo->type == MT_MINOTAUR) && ++ (mo->special1.m == actor->special1.m)) ++ continue; ++ actor->target = mo; ++ break; // Found mobj to attack ++ } ++ } ++ ++ if (actor->target) ++ { ++ P_SetMobjStateNF(actor, S_MNTR_WALK1); ++ } ++ else ++ { ++ P_SetMobjStateNF(actor, S_MNTR_ROAM1); ++ } ++} ++ ++ ++ ++ ++void A_MinotaurChase(mobj_t * actor) ++{ ++ actor->flags &= ~MF_SHADOW; // In case pain caused him to ++ actor->flags &= ~MF_ALTSHADOW; // skip his fade in. ++ ++ if (!CheckMinotaurAge(actor)) ++ { ++ return; ++ } ++ ++ if (P_Random() < 30) ++ A_MinotaurLook(actor); // adjust to closest target ++ ++ if (!actor->target || (actor->target->health <= 0) || ++ !(actor->target->flags & MF_SHOOTABLE)) ++ { // look for a new target ++ P_SetMobjState(actor, S_MNTR_LOOK1); ++ return; ++ } ++ ++ FaceMovementDirection(actor); ++ actor->reactiontime = 0; ++ ++ // Melee attack ++ if (actor->info->meleestate && P_CheckMeleeRange(actor)) ++ { ++ if (actor->info->attacksound) ++ { ++ S_StartSound(actor, actor->info->attacksound); ++ } ++ P_SetMobjState(actor, actor->info->meleestate); ++ return; ++ } ++ ++ // Missile attack ++ if (actor->info->missilestate && P_CheckMissileRange(actor)) ++ { ++ P_SetMobjState(actor, actor->info->missilestate); ++ return; ++ } ++ ++ // chase towards target ++ if (!P_Move(actor)) ++ { ++ P_NewChaseDir(actor); ++ } ++ ++ // Active sound ++ if (actor->info->activesound && P_Random() < 6) ++ { ++ S_StartSound(actor, actor->info->activesound); ++ } ++ ++} ++ ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_MinotaurAtk1 ++// ++// Melee attack. ++// ++//---------------------------------------------------------------------------- ++ ++void A_MinotaurAtk1(mobj_t * actor) ++{ ++ if (!actor->target) ++ return; ++ ++ S_StartSound(actor, SFX_MAULATOR_HAMMER_SWING); ++ if (P_CheckMeleeRange(actor)) ++ { ++ P_DamageMobj(actor->target, actor, actor, HITDICE(4)); ++ } ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_MinotaurDecide ++// ++// Choose a missile attack. ++// ++//---------------------------------------------------------------------------- ++ ++#define MNTR_CHARGE_SPEED (23*FRACUNIT) ++ ++void A_MinotaurDecide(mobj_t * actor) ++{ ++ angle_t angle; ++ mobj_t *target = actor->target; ++ int dist; ++ ++ if (!target) ++ return; ++ dist = P_AproxDistance(actor->x - target->x, actor->y - target->y); ++ ++ if (target->z + target->height > actor->z ++ && target->z + target->height < actor->z + actor->height ++ && dist < 16 * 64 * FRACUNIT ++ && dist > 1 * 64 * FRACUNIT && P_Random() < 230) ++ { // Charge attack ++ // Don't call the state function right away ++ P_SetMobjStateNF(actor, S_MNTR_ATK4_1); ++ actor->flags |= MF_SKULLFLY; ++ A_FaceTarget(actor); ++ angle = actor->angle >> ANGLETOFINESHIFT; ++ actor->momx = FixedMul(MNTR_CHARGE_SPEED, finecosine[angle]); ++ actor->momy = FixedMul(MNTR_CHARGE_SPEED, finesine[angle]); ++ actor->args[4] = 35 / 2; // Charge duration ++ } ++ else if (target->z == target->floorz ++ && dist < 9 * 64 * FRACUNIT && P_Random() < 100) ++ { // Floor fire attack ++ P_SetMobjState(actor, S_MNTR_ATK3_1); ++ actor->special2.i = 0; ++ } ++ else ++ { // Swing attack ++ A_FaceTarget(actor); ++ // Don't need to call P_SetMobjState because the current state ++ // falls through to the swing attack ++ } ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_MinotaurCharge ++// ++//---------------------------------------------------------------------------- ++ ++void A_MinotaurCharge(mobj_t * actor) ++{ ++ mobj_t *puff; ++ ++ if (!actor->target) ++ return; ++ ++ if (actor->args[4] > 0) ++ { ++ puff = P_SpawnMobj(actor->x, actor->y, actor->z, MT_PUNCHPUFF); ++ puff->momz = 2 * FRACUNIT; ++ actor->args[4]--; ++ } ++ else ++ { ++ actor->flags &= ~MF_SKULLFLY; ++ P_SetMobjState(actor, actor->info->seestate); ++ } ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_MinotaurAtk2 ++// ++// Swing attack. ++// ++//---------------------------------------------------------------------------- ++ ++void A_MinotaurAtk2(mobj_t * actor) ++{ ++ mobj_t *mo; ++ angle_t angle; ++ fixed_t momz; ++ ++ if (!actor->target) ++ return; ++ ++ S_StartSound(actor, SFX_MAULATOR_HAMMER_SWING); ++ if (P_CheckMeleeRange(actor)) ++ { ++ P_DamageMobj(actor->target, actor, actor, HITDICE(3)); ++ return; ++ } ++ mo = P_SpawnMissile(actor, actor->target, MT_MNTRFX1); ++ if (mo) ++ { ++ //S_StartSound(mo, sfx_minat2); ++ momz = mo->momz; ++ angle = mo->angle; ++ P_SpawnMissileAngle(actor, MT_MNTRFX1, angle - (ANG45 / 8), momz); ++ P_SpawnMissileAngle(actor, MT_MNTRFX1, angle + (ANG45 / 8), momz); ++ P_SpawnMissileAngle(actor, MT_MNTRFX1, angle - (ANG45 / 16), momz); ++ P_SpawnMissileAngle(actor, MT_MNTRFX1, angle + (ANG45 / 16), momz); ++ } ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_MinotaurAtk3 ++// ++// Floor fire attack. ++// ++//---------------------------------------------------------------------------- ++ ++void A_MinotaurAtk3(mobj_t * actor) ++{ ++ mobj_t *mo; ++ player_t *player; ++ ++ if (!actor->target) ++ { ++ return; ++ } ++ if (P_CheckMeleeRange(actor)) ++ { ++ P_DamageMobj(actor->target, actor, actor, HITDICE(3)); ++ if ((player = actor->target->player) != NULL) ++ { // Squish the player ++ player->deltaviewheight = -16 * FRACUNIT; ++ } ++ } ++ else ++ { ++ mo = P_SpawnMissile(actor, actor->target, MT_MNTRFX2); ++ if (mo != NULL) ++ { ++ S_StartSound(mo, SFX_MAULATOR_HAMMER_HIT); ++ } ++ } ++ if (P_Random() < 192 && actor->special2.i == 0) ++ { ++ P_SetMobjState(actor, S_MNTR_ATK3_4); ++ actor->special2.i = 1; ++ } ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_MntrFloorFire ++// ++//---------------------------------------------------------------------------- ++ ++void A_MntrFloorFire(mobj_t * actor) ++{ ++ mobj_t *mo; ++ int r1, r2; ++ ++ r1 = P_SubRandom(); ++ r2 = P_SubRandom(); ++ ++ actor->z = actor->floorz; ++ mo = P_SpawnMobj(actor->x + (r2 << 10), ++ actor->y + (r1 << 10), ONFLOORZ, ++ MT_MNTRFX3); ++ mo->target = actor->target; ++ mo->momx = 1; // Force block checking ++ P_CheckMissileSpawn(mo); ++} ++ ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_Scream ++// ++//---------------------------------------------------------------------------- ++ ++void A_Scream(mobj_t * actor) ++{ ++ int sound; ++ ++ S_StopSound(actor); ++ if (actor->player) ++ { ++ if (actor->player->morphTics) ++ { ++ S_StartSound(actor, actor->info->deathsound); ++ } ++ else ++ { ++ // Handle the different player death screams ++ if (actor->momz <= -39 * FRACUNIT) ++ { // Falling splat ++ sound = SFX_PLAYER_FALLING_SPLAT; ++ } ++ else if (actor->health > -50) ++ { // Normal death sound ++ switch (actor->player->class) ++ { ++ case PCLASS_FIGHTER: ++ sound = SFX_PLAYER_FIGHTER_NORMAL_DEATH; ++ break; ++ case PCLASS_CLERIC: ++ sound = SFX_PLAYER_CLERIC_NORMAL_DEATH; ++ break; ++ case PCLASS_MAGE: ++ sound = SFX_PLAYER_MAGE_NORMAL_DEATH; ++ break; ++ default: ++ sound = SFX_NONE; ++ break; ++ } ++ } ++ else if (actor->health > -100) ++ { // Crazy death sound ++ switch (actor->player->class) ++ { ++ case PCLASS_FIGHTER: ++ sound = SFX_PLAYER_FIGHTER_CRAZY_DEATH; ++ break; ++ case PCLASS_CLERIC: ++ sound = SFX_PLAYER_CLERIC_CRAZY_DEATH; ++ break; ++ case PCLASS_MAGE: ++ sound = SFX_PLAYER_MAGE_CRAZY_DEATH; ++ break; ++ default: ++ sound = SFX_NONE; ++ break; ++ } ++ } ++ else ++ { // Extreme death sound ++ switch (actor->player->class) ++ { ++ case PCLASS_FIGHTER: ++ sound = SFX_PLAYER_FIGHTER_EXTREME1_DEATH; ++ break; ++ case PCLASS_CLERIC: ++ sound = SFX_PLAYER_CLERIC_EXTREME1_DEATH; ++ break; ++ case PCLASS_MAGE: ++ sound = SFX_PLAYER_MAGE_EXTREME1_DEATH; ++ break; ++ default: ++ sound = SFX_NONE; ++ break; ++ } ++ sound += P_Random() % 3; // Three different extreme deaths ++ } ++ S_StartSound(actor, sound); ++ } ++ } ++ else ++ { ++ S_StartSound(actor, actor->info->deathsound); ++ } ++} ++ ++//--------------------------------------------------------------------------- ++// ++// PROC P_DropItem ++// ++//--------------------------------------------------------------------------- ++ ++/* ++void P_DropItem(mobj_t *source, mobjtype_t type, int special, int chance) ++{ ++ mobj_t *mo; ++ if(P_Random() > chance) ++ { ++ return; ++ } ++ mo = P_SpawnMobj(source->x, source->y, ++ source->z+(source->height>>1), type); ++ mo->momx = P_SubRandom()<<8; ++ mo->momy = P_SubRandom()<<8; ++ mo->momz = FRACUNIT*5+(P_Random()<<10); ++ mo->flags2 |= MF2_DROPPED; ++ mo->health = special; ++} ++*/ ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_NoBlocking ++// ++//---------------------------------------------------------------------------- ++ ++void A_NoBlocking(mobj_t * actor) ++{ ++ actor->flags &= ~MF_SOLID; ++ ++ // Check for monsters dropping things ++/* switch(actor->type) ++ { ++ // Add the monster dropped items here ++ case MT_MUMMYLEADERGHOST: ++ P_DropItem(actor, MT_AMGWNDWIMPY, 3, 84); ++ break; ++ default: ++ break; ++ } ++*/ ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_Explode ++// ++// Handles a bunch of exploding things. ++// ++//---------------------------------------------------------------------------- ++ ++void A_Explode(mobj_t * actor) ++{ ++ int damage; ++ int distance; ++ boolean damageSelf; ++ ++ damage = 128; ++ distance = 128; ++ damageSelf = true; ++ switch (actor->type) ++ { ++ case MT_FIREBOMB: // Time Bombs ++ actor->z += 32 * FRACUNIT; ++ actor->flags &= ~MF_SHADOW; ++ break; ++ case MT_MNTRFX2: // Minotaur floor fire ++ damage = 24; ++ break; ++ case MT_BISHOP: // Bishop radius death ++ damage = 25 + (P_Random() & 15); ++ break; ++ case MT_HAMMER_MISSILE: // Fighter Hammer ++ damage = 128; ++ damageSelf = false; ++ break; ++ case MT_FSWORD_MISSILE: // Fighter Runesword ++ damage = 64; ++ damageSelf = false; ++ break; ++ case MT_CIRCLEFLAME: // Cleric Flame secondary flames ++ damage = 20; ++ damageSelf = false; ++ break; ++ case MT_SORCBALL1: // Sorcerer balls ++ case MT_SORCBALL2: ++ case MT_SORCBALL3: ++ distance = 255; ++ damage = 255; ++ actor->args[0] = 1; // don't play bounce ++ break; ++ case MT_SORCFX1: // Sorcerer spell 1 ++ damage = 30; ++ break; ++ case MT_SORCFX4: // Sorcerer spell 4 ++ damage = 20; ++ break; ++ case MT_TREEDESTRUCTIBLE: ++ damage = 10; ++ break; ++ case MT_DRAGON_FX2: ++ damage = 80; ++ damageSelf = false; ++ break; ++ case MT_MSTAFF_FX: ++ damage = 64; ++ distance = 192; ++ damageSelf = false; ++ break; ++ case MT_MSTAFF_FX2: ++ damage = 80; ++ distance = 192; ++ damageSelf = false; ++ break; ++ case MT_POISONCLOUD: ++ damage = 4; ++ distance = 40; ++ break; ++ case MT_ZXMAS_TREE: ++ case MT_ZSHRUB2: ++ damage = 30; ++ distance = 64; ++ break; ++ default: ++ break; ++ } ++ P_RadiusAttack(actor, actor->target, damage, distance, damageSelf); ++ if (actor->z <= actor->floorz + (distance << FRACBITS) ++ && actor->type != MT_POISONCLOUD) ++ { ++ P_HitFloor(actor); ++ } ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC P_Massacre ++// ++// Kills all monsters. ++// ++//---------------------------------------------------------------------------- ++ ++int P_Massacre(void) ++{ ++ int count; ++ mobj_t *mo; ++ thinker_t *think; ++ ++ count = 0; ++ for (think = thinkercap.next; think != &thinkercap; think = think->next) ++ { ++ if (think->function != P_MobjThinker) ++ { // Not a mobj thinker ++ continue; ++ } ++ mo = (mobj_t *) think; ++ if ((mo->flags & MF_COUNTKILL) && (mo->health > 0)) ++ { ++ mo->flags2 &= ~(MF2_NONSHOOTABLE + MF2_INVULNERABLE); ++ mo->flags |= MF_SHOOTABLE; ++ P_DamageMobj(mo, NULL, NULL, 10000); ++ count++; ++ } ++ } ++ return count; ++} ++ ++ ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_SkullPop ++// ++//---------------------------------------------------------------------------- ++ ++void A_SkullPop(mobj_t * actor) ++{ ++ mobj_t *mo; ++ player_t *player; ++ ++ if (!actor->player) ++ { ++ return; ++ } ++ actor->flags &= ~MF_SOLID; ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z + 48 * FRACUNIT, ++ MT_BLOODYSKULL); ++ //mo->target = actor; ++ mo->momx = P_SubRandom() << 9; ++ mo->momy = P_SubRandom() << 9; ++ mo->momz = FRACUNIT * 2 + (P_Random() << 6); ++ // Attach player mobj to bloody skull ++ player = actor->player; ++ actor->player = NULL; ++ actor->special1.i = player->class; ++ mo->player = player; ++ mo->health = actor->health; ++ mo->angle = actor->angle; ++ player->mo = mo; ++ player->lookdir = 0; ++ player->damagecount = 32; ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_CheckSkullFloor ++// ++//---------------------------------------------------------------------------- ++ ++void A_CheckSkullFloor(mobj_t * actor) ++{ ++ if (actor->z <= actor->floorz) ++ { ++ P_SetMobjState(actor, S_BLOODYSKULLX1); ++ S_StartSound(actor, SFX_DRIP); ++ } ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_CheckSkullDone ++// ++//---------------------------------------------------------------------------- ++ ++void A_CheckSkullDone(mobj_t * actor) ++{ ++ if (actor->special2.i == 666) ++ { ++ P_SetMobjState(actor, S_BLOODYSKULLX2); ++ } ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_CheckBurnGone ++// ++//---------------------------------------------------------------------------- ++ ++void A_CheckBurnGone(mobj_t * actor) ++{ ++ if (actor->special2.i == 666) ++ { ++ P_SetMobjState(actor, S_PLAY_FDTH20); ++ } ++} ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_FreeTargMobj ++// ++//---------------------------------------------------------------------------- ++ ++void A_FreeTargMobj(mobj_t * mo) ++{ ++ mo->momx = mo->momy = mo->momz = 0; ++ mo->z = mo->ceilingz + 4 * FRACUNIT; ++ mo->flags &= ++ ~(MF_SHOOTABLE | MF_FLOAT | MF_SKULLFLY | MF_SOLID | MF_COUNTKILL); ++ mo->flags |= MF_CORPSE | MF_DROPOFF | MF_NOGRAVITY; ++ mo->flags2 &= ~(MF2_PASSMOBJ | MF2_LOGRAV); ++ mo->flags2 |= MF2_DONTDRAW; ++ mo->player = NULL; ++ mo->health = -1000; // Don't resurrect ++} ++ ++ ++//---------------------------------------------------------------------------- ++// ++// CorpseQueue Routines ++// ++//---------------------------------------------------------------------------- ++ ++// Corpse queue for monsters - this should be saved out ++#define CORPSEQUEUESIZE 64 ++mobj_t *corpseQueue[CORPSEQUEUESIZE]; ++int corpseQueueSlot; ++ ++// throw another corpse on the queue ++void A_QueueCorpse(mobj_t * actor) ++{ ++ mobj_t *corpse; ++ ++ if (corpseQueueSlot >= CORPSEQUEUESIZE) ++ { // Too many corpses - remove an old one ++ corpse = corpseQueue[corpseQueueSlot % CORPSEQUEUESIZE]; ++ if (corpse) ++ P_RemoveMobj(corpse); ++ } ++ corpseQueue[corpseQueueSlot % CORPSEQUEUESIZE] = actor; ++ corpseQueueSlot++; ++} ++ ++// Remove a mobj from the queue (for resurrection) ++void A_DeQueueCorpse(mobj_t * actor) ++{ ++ int slot; ++ ++ for (slot = 0; slot < CORPSEQUEUESIZE; slot++) ++ { ++ if (corpseQueue[slot] == actor) ++ { ++ corpseQueue[slot] = NULL; ++ break; ++ } ++ } ++} ++ ++void P_InitCreatureCorpseQueue(boolean corpseScan) ++{ ++ thinker_t *think; ++ mobj_t *mo; ++ ++ // Initialize queue ++ corpseQueueSlot = 0; ++ memset(corpseQueue, 0, sizeof(mobj_t *) * CORPSEQUEUESIZE); ++ ++ if (!corpseScan) ++ return; ++ ++ // Search mobj list for corpses and place them in this queue ++ for (think = thinkercap.next; think != &thinkercap; think = think->next) ++ { ++ if (think->function != P_MobjThinker) ++ continue; ++ mo = (mobj_t *) think; ++ if (!(mo->flags & MF_CORPSE)) ++ continue; // Must be a corpse ++ if (mo->flags & MF_ICECORPSE) ++ continue; // Not ice corpses ++ // Only corpses that call A_QueueCorpse from death routine ++ switch (mo->type) ++ { ++ case MT_CENTAUR: ++ case MT_CENTAURLEADER: ++ case MT_DEMON: ++ case MT_DEMON2: ++ case MT_WRAITH: ++ case MT_WRAITHB: ++ case MT_BISHOP: ++ case MT_ETTIN: ++ case MT_PIG: ++ case MT_CENTAUR_SHIELD: ++ case MT_CENTAUR_SWORD: ++ case MT_DEMONCHUNK1: ++ case MT_DEMONCHUNK2: ++ case MT_DEMONCHUNK3: ++ case MT_DEMONCHUNK4: ++ case MT_DEMONCHUNK5: ++ case MT_DEMON2CHUNK1: ++ case MT_DEMON2CHUNK2: ++ case MT_DEMON2CHUNK3: ++ case MT_DEMON2CHUNK4: ++ case MT_DEMON2CHUNK5: ++ case MT_FIREDEMON_SPLOTCH1: ++ case MT_FIREDEMON_SPLOTCH2: ++ A_QueueCorpse(mo); // Add corpse to queue ++ break; ++ default: ++ break; ++ } ++ } ++} ++ ++ ++//---------------------------------------------------------------------------- ++// ++// PROC A_AddPlayerCorpse ++// ++//---------------------------------------------------------------------------- ++ ++#define BODYQUESIZE 32 ++mobj_t *bodyque[BODYQUESIZE]; ++int bodyqueslot; ++ ++void A_AddPlayerCorpse(mobj_t * actor) ++{ ++ if (bodyqueslot >= BODYQUESIZE) ++ { // Too many player corpses - remove an old one ++ P_RemoveMobj(bodyque[bodyqueslot % BODYQUESIZE]); ++ } ++ bodyque[bodyqueslot % BODYQUESIZE] = actor; ++ bodyqueslot++; ++} ++ ++//============================================================================ ++// ++// A_SerpentUnHide ++// ++//============================================================================ ++ ++void A_SerpentUnHide(mobj_t * actor) ++{ ++ actor->flags2 &= ~MF2_DONTDRAW; ++ actor->floorclip = 24 * FRACUNIT; ++} ++ ++//============================================================================ ++// ++// A_SerpentHide ++// ++//============================================================================ ++ ++void A_SerpentHide(mobj_t * actor) ++{ ++ actor->flags2 |= MF2_DONTDRAW; ++ actor->floorclip = 0; ++} ++ ++//============================================================================ ++// ++// A_SerpentChase ++// ++//============================================================================ ++ ++void A_SerpentChase(mobj_t * actor) ++{ ++ int delta; ++ int oldX, oldY, oldFloor; ++ ++ if (actor->reactiontime) ++ { ++ actor->reactiontime--; ++ } ++ ++ // Modify target threshold ++ if (actor->threshold) ++ { ++ actor->threshold--; ++ } ++ ++ if (gameskill == sk_nightmare) ++ { // Monsters move faster in nightmare mode ++ actor->tics -= actor->tics / 2; ++ if (actor->tics < 3) ++ { ++ actor->tics = 3; ++ } ++ } ++ ++// ++// turn towards movement direction if not there yet ++// ++ if (actor->movedir < 8) ++ { ++ actor->angle &= (7 << 29); ++ delta = actor->angle - (actor->movedir << 29); ++ if (delta > 0) ++ { ++ actor->angle -= ANG90 / 2; ++ } ++ else if (delta < 0) ++ { ++ actor->angle += ANG90 / 2; ++ } ++ } ++ ++ if (!actor->target || !(actor->target->flags & MF_SHOOTABLE)) ++ { // look for a new target ++ if (P_LookForPlayers(actor, true)) ++ { // got a new target ++ return; ++ } ++ P_SetMobjState(actor, actor->info->spawnstate); ++ return; ++ } ++ ++// ++// don't attack twice in a row ++// ++ if (actor->flags & MF_JUSTATTACKED) ++ { ++ actor->flags &= ~MF_JUSTATTACKED; ++ if (gameskill != sk_nightmare) ++ P_NewChaseDir(actor); ++ return; ++ } ++ ++// ++// check for melee attack ++// ++ if (actor->info->meleestate && P_CheckMeleeRange(actor)) ++ { ++ if (actor->info->attacksound) ++ { ++ S_StartSound(actor, actor->info->attacksound); ++ } ++ P_SetMobjState(actor, actor->info->meleestate); ++ return; ++ } ++ ++// ++// possibly choose another target ++// ++ if (netgame && !actor->threshold && !P_CheckSight(actor, actor->target)) ++ { ++ if (P_LookForPlayers(actor, true)) ++ return; // got a new target ++ } ++ ++// ++// chase towards player ++// ++ oldX = actor->x; ++ oldY = actor->y; ++ oldFloor = actor->subsector->sector->floorpic; ++ if (--actor->movecount < 0 || !P_Move(actor)) ++ { ++ P_NewChaseDir(actor); ++ } ++ if (actor->subsector->sector->floorpic != oldFloor) ++ { ++ P_TryMove(actor, oldX, oldY); ++ P_NewChaseDir(actor); ++ } ++ ++// ++// make active sound ++// ++ if (actor->info->activesound && P_Random() < 3) ++ { ++ S_StartSound(actor, actor->info->activesound); ++ } ++} ++ ++//============================================================================ ++// ++// A_SerpentRaiseHump ++// ++// Raises the hump above the surface by raising the floorclip level ++//============================================================================ ++ ++void A_SerpentRaiseHump(mobj_t * actor) ++{ ++ actor->floorclip -= 4 * FRACUNIT; ++} ++ ++//============================================================================ ++// ++// A_SerpentLowerHump ++// ++//============================================================================ ++ ++void A_SerpentLowerHump(mobj_t * actor) ++{ ++ actor->floorclip += 4 * FRACUNIT; ++} ++ ++//============================================================================ ++// ++// A_SerpentHumpDecide ++// ++// Decided whether to hump up, or if the mobj is a serpent leader, ++// to missile attack ++//============================================================================ ++ ++void A_SerpentHumpDecide(mobj_t * actor) ++{ ++ if (actor->type == MT_SERPENTLEADER) ++ { ++ if (P_Random() > 30) ++ { ++ return; ++ } ++ else if (P_Random() < 40) ++ { // Missile attack ++ P_SetMobjState(actor, S_SERPENT_SURFACE1); ++ return; ++ } ++ } ++ else if (P_Random() > 3) ++ { ++ return; ++ } ++ if (!P_CheckMeleeRange(actor)) ++ { // The hump shouldn't occur when within melee range ++ if (actor->type == MT_SERPENTLEADER && P_Random() < 128) ++ { ++ P_SetMobjState(actor, S_SERPENT_SURFACE1); ++ } ++ else ++ { ++ P_SetMobjState(actor, S_SERPENT_HUMP1); ++ S_StartSound(actor, SFX_SERPENT_ACTIVE); ++ } ++ } ++} ++ ++//============================================================================ ++// ++// A_SerpentBirthScream ++// ++//============================================================================ ++ ++void A_SerpentBirthScream(mobj_t * actor) ++{ ++ S_StartSound(actor, SFX_SERPENT_BIRTH); ++} ++ ++//============================================================================ ++// ++// A_SerpentDiveSound ++// ++//============================================================================ ++ ++void A_SerpentDiveSound(mobj_t * actor) ++{ ++ S_StartSound(actor, SFX_SERPENT_ACTIVE); ++} ++ ++//============================================================================ ++// ++// A_SerpentWalk ++// ++// Similar to A_Chase, only has a hardcoded entering of meleestate ++//============================================================================ ++ ++void A_SerpentWalk(mobj_t * actor) ++{ ++ int delta; ++ ++ if (actor->reactiontime) ++ { ++ actor->reactiontime--; ++ } ++ ++ // Modify target threshold ++ if (actor->threshold) ++ { ++ actor->threshold--; ++ } ++ ++ if (gameskill == sk_nightmare) ++ { // Monsters move faster in nightmare mode ++ actor->tics -= actor->tics / 2; ++ if (actor->tics < 3) ++ { ++ actor->tics = 3; ++ } ++ } ++ ++// ++// turn towards movement direction if not there yet ++// ++ if (actor->movedir < 8) ++ { ++ actor->angle &= (7 << 29); ++ delta = actor->angle - (actor->movedir << 29); ++ if (delta > 0) ++ { ++ actor->angle -= ANG90 / 2; ++ } ++ else if (delta < 0) ++ { ++ actor->angle += ANG90 / 2; ++ } ++ } ++ ++ if (!actor->target || !(actor->target->flags & MF_SHOOTABLE)) ++ { // look for a new target ++ if (P_LookForPlayers(actor, true)) ++ { // got a new target ++ return; ++ } ++ P_SetMobjState(actor, actor->info->spawnstate); ++ return; ++ } ++ ++// ++// don't attack twice in a row ++// ++ if (actor->flags & MF_JUSTATTACKED) ++ { ++ actor->flags &= ~MF_JUSTATTACKED; ++ if (gameskill != sk_nightmare) ++ P_NewChaseDir(actor); ++ return; ++ } ++ ++// ++// check for melee attack ++// ++ if (actor->info->meleestate && P_CheckMeleeRange(actor)) ++ { ++ if (actor->info->attacksound) ++ { ++ S_StartSound(actor, actor->info->attacksound); ++ } ++ P_SetMobjState(actor, S_SERPENT_ATK1); ++ return; ++ } ++// ++// possibly choose another target ++// ++ if (netgame && !actor->threshold && !P_CheckSight(actor, actor->target)) ++ { ++ if (P_LookForPlayers(actor, true)) ++ return; // got a new target ++ } ++ ++// ++// chase towards player ++// ++ if (--actor->movecount < 0 || !P_Move(actor)) ++ { ++ P_NewChaseDir(actor); ++ } ++} ++ ++//============================================================================ ++// ++// A_SerpentCheckForAttack ++// ++//============================================================================ ++ ++void A_SerpentCheckForAttack(mobj_t * actor) ++{ ++ if (!actor->target) ++ { ++ return; ++ } ++ if (actor->type == MT_SERPENTLEADER) ++ { ++ if (!P_CheckMeleeRange(actor)) ++ { ++ P_SetMobjState(actor, S_SERPENT_ATK1); ++ return; ++ } ++ } ++ if (P_CheckMeleeRange2(actor)) ++ { ++ P_SetMobjState(actor, S_SERPENT_WALK1); ++ } ++ else if (P_CheckMeleeRange(actor)) ++ { ++ if (P_Random() < 32) ++ { ++ P_SetMobjState(actor, S_SERPENT_WALK1); ++ } ++ else ++ { ++ P_SetMobjState(actor, S_SERPENT_ATK1); ++ } ++ } ++} ++ ++//============================================================================ ++// ++// A_SerpentChooseAttack ++// ++//============================================================================ ++ ++void A_SerpentChooseAttack(mobj_t * actor) ++{ ++ if (!actor->target || P_CheckMeleeRange(actor)) ++ { ++ return; ++ } ++ if (actor->type == MT_SERPENTLEADER) ++ { ++ P_SetMobjState(actor, S_SERPENT_MISSILE1); ++ } ++} ++ ++//============================================================================ ++// ++// A_SerpentMeleeAttack ++// ++//============================================================================ ++ ++void A_SerpentMeleeAttack(mobj_t * actor) ++{ ++ if (!actor->target) ++ { ++ return; ++ } ++ if (P_CheckMeleeRange(actor)) ++ { ++ P_DamageMobj(actor->target, actor, actor, HITDICE(5)); ++ S_StartSound(actor, SFX_SERPENT_MELEEHIT); ++ } ++ if (P_Random() < 96) ++ { ++ A_SerpentCheckForAttack(actor); ++ } ++} ++ ++//============================================================================ ++// ++// A_SerpentMissileAttack ++// ++//============================================================================ ++ ++void A_SerpentMissileAttack(mobj_t * actor) ++{ ++ if (!actor->target) ++ { ++ return; ++ } ++ ++ P_SpawnMissile(actor, actor->target, MT_SERPENTFX); ++} ++ ++//============================================================================ ++// ++// A_SerpentHeadPop ++// ++//============================================================================ ++ ++void A_SerpentHeadPop(mobj_t * actor) ++{ ++ P_SpawnMobj(actor->x, actor->y, actor->z + 45 * FRACUNIT, ++ MT_SERPENT_HEAD); ++} ++ ++//============================================================================ ++// ++// A_SerpentSpawnGibs ++// ++//============================================================================ ++ ++void A_SerpentSpawnGibs(mobj_t * actor) ++{ ++ mobj_t *mo; ++ int r1, r2; ++ ++ r1 = P_Random(); ++ r2 = P_Random(); ++ mo = P_SpawnMobj(actor->x + ((r2 - 128) << 12), ++ actor->y + ((r1 - 128) << 12), ++ actor->floorz + FRACUNIT, MT_SERPENT_GIB1); ++ if (mo) ++ { ++ mo->momx = (P_Random() - 128) << 6; ++ mo->momy = (P_Random() - 128) << 6; ++ mo->floorclip = 6 * FRACUNIT; ++ } ++ r1 = P_Random(); ++ r2 = P_Random(); ++ mo = P_SpawnMobj(actor->x + ((r2 - 128) << 12), ++ actor->y + ((r1 - 128) << 12), ++ actor->floorz + FRACUNIT, MT_SERPENT_GIB2); ++ if (mo) ++ { ++ mo->momx = (P_Random() - 128) << 6; ++ mo->momy = (P_Random() - 128) << 6; ++ mo->floorclip = 6 * FRACUNIT; ++ } ++ r1 = P_Random(); ++ r2 = P_Random(); ++ mo = P_SpawnMobj(actor->x + ((r2 - 128) << 12), ++ actor->y + ((r1 - 128) << 12), ++ actor->floorz + FRACUNIT, MT_SERPENT_GIB3); ++ if (mo) ++ { ++ mo->momx = (P_Random() - 128) << 6; ++ mo->momy = (P_Random() - 128) << 6; ++ mo->floorclip = 6 * FRACUNIT; ++ } ++} ++ ++//============================================================================ ++// ++// A_FloatGib ++// ++//============================================================================ ++ ++void A_FloatGib(mobj_t * actor) ++{ ++ actor->floorclip -= FRACUNIT; ++} ++ ++//============================================================================ ++// ++// A_SinkGib ++// ++//============================================================================ ++ ++void A_SinkGib(mobj_t * actor) ++{ ++ actor->floorclip += FRACUNIT; ++} ++ ++//============================================================================ ++// ++// A_DelayGib ++// ++//============================================================================ ++ ++void A_DelayGib(mobj_t * actor) ++{ ++ actor->tics -= P_Random() >> 2; ++} ++ ++//============================================================================ ++// ++// A_SerpentHeadCheck ++// ++//============================================================================ ++ ++void A_SerpentHeadCheck(mobj_t * actor) ++{ ++ if (actor->z <= actor->floorz) ++ { ++ if (P_GetThingFloorType(actor) >= FLOOR_LIQUID) ++ { ++ P_HitFloor(actor); ++ P_SetMobjState(actor, S_NULL); ++ } ++ else ++ { ++ P_SetMobjState(actor, S_SERPENT_HEAD_X1); ++ } ++ } ++} ++ ++//============================================================================ ++// ++// A_CentaurAttack ++// ++//============================================================================ ++ ++void A_CentaurAttack(mobj_t * actor) ++{ ++ if (!actor->target) ++ { ++ return; ++ } ++ if (P_CheckMeleeRange(actor)) ++ { ++ P_DamageMobj(actor->target, actor, actor, P_Random() % 7 + 3); ++ } ++} ++ ++//============================================================================ ++// ++// A_CentaurAttack2 ++// ++//============================================================================ ++ ++void A_CentaurAttack2(mobj_t * actor) ++{ ++ if (!actor->target) ++ { ++ return; ++ } ++ P_SpawnMissile(actor, actor->target, MT_CENTAUR_FX); ++ S_StartSound(actor, SFX_CENTAURLEADER_ATTACK); ++} ++ ++//============================================================================ ++// ++// A_CentaurDropStuff ++// ++// Spawn shield/sword sprites when the centaur pulps //============================================================================ ++ ++void A_CentaurDropStuff(mobj_t * actor) ++{ ++ mobj_t *mo; ++ angle_t angle; ++ ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z + 45 * FRACUNIT, ++ MT_CENTAUR_SHIELD); ++ if (mo) ++ { ++ angle = actor->angle + ANG90; ++ mo->momz = FRACUNIT * 8 + (P_Random() << 10); ++ mo->momx = FixedMul(((P_Random() - 128) << 11) + FRACUNIT, ++ finecosine[angle >> ANGLETOFINESHIFT]); ++ mo->momy = FixedMul(((P_Random() - 128) << 11) + FRACUNIT, ++ finesine[angle >> ANGLETOFINESHIFT]); ++ mo->target = actor; ++ } ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z + 45 * FRACUNIT, ++ MT_CENTAUR_SWORD); ++ if (mo) ++ { ++ angle = actor->angle - ANG90; ++ mo->momz = FRACUNIT * 8 + (P_Random() << 10); ++ mo->momx = FixedMul(((P_Random() - 128) << 11) + FRACUNIT, ++ finecosine[angle >> ANGLETOFINESHIFT]); ++ mo->momy = FixedMul(((P_Random() - 128) << 11) + FRACUNIT, ++ finesine[angle >> ANGLETOFINESHIFT]); ++ mo->target = actor; ++ } ++} ++ ++//============================================================================ ++// ++// A_CentaurDefend ++// ++//============================================================================ ++ ++void A_CentaurDefend(mobj_t * actor) ++{ ++ A_FaceTarget(actor); ++ if (P_CheckMeleeRange(actor) && P_Random() < 32) ++ { ++ A_UnSetInvulnerable(actor); ++ P_SetMobjState(actor, actor->info->meleestate); ++ } ++} ++ ++//============================================================================ ++// ++// A_BishopAttack ++// ++//============================================================================ ++ ++void A_BishopAttack(mobj_t * actor) ++{ ++ if (!actor->target) ++ { ++ return; ++ } ++ S_StartSound(actor, actor->info->attacksound); ++ if (P_CheckMeleeRange(actor)) ++ { ++ P_DamageMobj(actor->target, actor, actor, HITDICE(4)); ++ return; ++ } ++ actor->special1.i = (P_Random() & 3) + 5; ++} ++ ++//============================================================================ ++// ++// A_BishopAttack2 ++// ++// Spawns one of a string of bishop missiles ++//============================================================================ ++ ++void A_BishopAttack2(mobj_t * actor) ++{ ++ mobj_t *mo; ++ ++ if (!actor->target || !actor->special1.i) ++ { ++ actor->special1.i = 0; ++ P_SetMobjState(actor, S_BISHOP_WALK1); ++ return; ++ } ++ mo = P_SpawnMissile(actor, actor->target, MT_BISH_FX); ++ if (mo) ++ { ++ mo->special1.m = actor->target; ++ mo->special2.i = 16; // High word == x/y, Low word == z ++ } ++ actor->special1.i--; ++} ++ ++//============================================================================ ++// ++// A_BishopMissileWeave ++// ++//============================================================================ ++ ++void A_BishopMissileWeave(mobj_t * actor) ++{ ++ fixed_t newX, newY; ++ int weaveXY, weaveZ; ++ int angle; ++ ++ weaveXY = actor->special2.i >> 16; ++ weaveZ = actor->special2.i & 0xFFFF; ++ angle = (actor->angle + ANG90) >> ANGLETOFINESHIFT; ++ newX = actor->x - FixedMul(finecosine[angle], ++ FloatBobOffsets[weaveXY] << 1); ++ newY = actor->y - FixedMul(finesine[angle], ++ FloatBobOffsets[weaveXY] << 1); ++ weaveXY = (weaveXY + 2) & 63; ++ newX += FixedMul(finecosine[angle], FloatBobOffsets[weaveXY] << 1); ++ newY += FixedMul(finesine[angle], FloatBobOffsets[weaveXY] << 1); ++ P_TryMove(actor, newX, newY); ++ actor->z -= FloatBobOffsets[weaveZ]; ++ weaveZ = (weaveZ + 2) & 63; ++ actor->z += FloatBobOffsets[weaveZ]; ++ actor->special2.i = weaveZ + (weaveXY << 16); ++} ++ ++//============================================================================ ++// ++// A_BishopMissileSeek ++// ++//============================================================================ ++ ++void A_BishopMissileSeek(mobj_t * actor) ++{ ++ P_SeekerMissile(actor, ANG1 * 2, ANG1 * 3); ++} ++ ++//============================================================================ ++// ++// A_BishopDecide ++// ++//============================================================================ ++ ++void A_BishopDecide(mobj_t * actor) ++{ ++ if (P_Random() < 220) ++ { ++ return; ++ } ++ else ++ { ++ P_SetMobjState(actor, S_BISHOP_BLUR1); ++ } ++} ++ ++//============================================================================ ++// ++// A_BishopDoBlur ++// ++//============================================================================ ++ ++void A_BishopDoBlur(mobj_t * actor) ++{ ++ actor->special1.i = (P_Random() & 3) + 3; // Random number of blurs ++ if (P_Random() < 120) ++ { ++ P_ThrustMobj(actor, actor->angle + ANG90, 11 * FRACUNIT); ++ } ++ else if (P_Random() > 125) ++ { ++ P_ThrustMobj(actor, actor->angle - ANG90, 11 * FRACUNIT); ++ } ++ else ++ { // Thrust forward ++ P_ThrustMobj(actor, actor->angle, 11 * FRACUNIT); ++ } ++ S_StartSound(actor, SFX_BISHOP_BLUR); ++} ++ ++//============================================================================ ++// ++// A_BishopSpawnBlur ++// ++//============================================================================ ++ ++void A_BishopSpawnBlur(mobj_t * actor) ++{ ++ mobj_t *mo; ++ ++ if (!--actor->special1.i) ++ { ++ actor->momx = 0; ++ actor->momy = 0; ++ if (P_Random() > 96) ++ { ++ P_SetMobjState(actor, S_BISHOP_WALK1); ++ } ++ else ++ { ++ P_SetMobjState(actor, S_BISHOP_ATK1); ++ } ++ } ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_BISHOPBLUR); ++ if (mo) ++ { ++ mo->angle = actor->angle; ++ } ++} ++ ++//============================================================================ ++// ++// A_BishopChase ++// ++//============================================================================ ++ ++void A_BishopChase(mobj_t * actor) ++{ ++ actor->z -= FloatBobOffsets[actor->special2.i] >> 1; ++ actor->special2.i = (actor->special2.i + 4) & 63; ++ actor->z += FloatBobOffsets[actor->special2.i] >> 1; ++} ++ ++//============================================================================ ++// ++// A_BishopPuff ++// ++//============================================================================ ++ ++void A_BishopPuff(mobj_t * actor) ++{ ++ mobj_t *mo; ++ ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z + 40 * FRACUNIT, ++ MT_BISHOP_PUFF); ++ if (mo) ++ { ++ mo->momz = FRACUNIT / 2; ++ } ++} ++ ++//============================================================================ ++// ++// A_BishopPainBlur ++// ++//============================================================================ ++ ++void A_BishopPainBlur(mobj_t * actor) ++{ ++ mobj_t *mo; ++ int r1,r2,r3; ++ ++ if (P_Random() < 64) ++ { ++ P_SetMobjState(actor, S_BISHOP_BLUR1); ++ return; ++ } ++ ++ r1 = P_SubRandom(); ++ r2 = P_SubRandom(); ++ r3 = P_SubRandom(); ++ ++ mo = P_SpawnMobj(actor->x + (r3 << 12), actor->y ++ + (r2 << 12), ++ actor->z + (r1 << 11), ++ MT_BISHOPPAINBLUR); ++ if (mo) ++ { ++ mo->angle = actor->angle; ++ } ++} ++ ++//============================================================================ ++// ++// DragonSeek ++// ++//============================================================================ ++ ++static void DragonSeek(mobj_t * actor, angle_t thresh, angle_t turnMax) ++{ ++ int dir; ++ int dist; ++ angle_t delta; ++ angle_t angle; ++ mobj_t *target; ++ int search; ++ int i; ++ int bestArg; ++ angle_t bestAngle; ++ angle_t angleToSpot, angleToTarget; ++ mobj_t *mo; ++ ++ target = actor->special1.m; ++ if (target == NULL) ++ { ++ return; ++ } ++ dir = P_FaceMobj(actor, target, &delta); ++ if (delta > thresh) ++ { ++ delta >>= 1; ++ if (delta > turnMax) ++ { ++ delta = turnMax; ++ } ++ } ++ if (dir) ++ { // Turn clockwise ++ actor->angle += delta; ++ } ++ else ++ { // Turn counter clockwise ++ actor->angle -= delta; ++ } ++ angle = actor->angle >> ANGLETOFINESHIFT; ++ actor->momx = FixedMul(actor->info->speed, finecosine[angle]); ++ actor->momy = FixedMul(actor->info->speed, finesine[angle]); ++ if (actor->z + actor->height < target->z ++ || target->z + target->height < actor->z) ++ { ++ dist = P_AproxDistance(target->x - actor->x, target->y - actor->y); ++ dist = dist / actor->info->speed; ++ if (dist < 1) ++ { ++ dist = 1; ++ } ++ actor->momz = (target->z - actor->z) / dist; ++ } ++ else ++ { ++ dist = P_AproxDistance(target->x - actor->x, target->y - actor->y); ++ dist = dist / actor->info->speed; ++ } ++ if (target->flags & MF_SHOOTABLE && P_Random() < 64) ++ { // attack the destination mobj if it's attackable ++ mobj_t *oldTarget; ++ ++ if (abs((int) actor->angle - (int) R_PointToAngle2(actor->x, actor->y, ++ target->x, ++ target->y)) < ANG45 / 2) ++ { ++ oldTarget = actor->target; ++ actor->target = target; ++ if (P_CheckMeleeRange(actor)) ++ { ++ P_DamageMobj(actor->target, actor, actor, HITDICE(10)); ++ S_StartSound(actor, SFX_DRAGON_ATTACK); ++ } ++ else if (P_Random() < 128 && P_CheckMissileRange(actor)) ++ { ++ P_SpawnMissile(actor, target, MT_DRAGON_FX); ++ S_StartSound(actor, SFX_DRAGON_ATTACK); ++ } ++ actor->target = oldTarget; ++ } ++ } ++ if (dist < 4) ++ { // Hit the target thing ++ if (actor->target && P_Random() < 200) ++ { ++ bestArg = -1; ++ bestAngle = ANG_MAX; ++ angleToTarget = R_PointToAngle2(actor->x, actor->y, ++ actor->target->x, ++ actor->target->y); ++ for (i = 0; i < 5; i++) ++ { ++ if (!target->args[i]) ++ { ++ continue; ++ } ++ search = -1; ++ mo = P_FindMobjFromTID(target->args[i], &search); ++ angleToSpot = R_PointToAngle2(actor->x, actor->y, ++ mo->x, mo->y); ++ if (abs((int) angleToSpot - (int) angleToTarget) < bestAngle) ++ { ++ bestAngle = abs((int) angleToSpot - (int) angleToTarget); ++ bestArg = i; ++ } ++ } ++ if (bestArg != -1) ++ { ++ search = -1; ++ actor->special1.m = ++ P_FindMobjFromTID(target->args[bestArg], &search); ++ } ++ } ++ else ++ { ++ do ++ { ++ i = (P_Random() >> 2) % 5; ++ } ++ while (!target->args[i]); ++ search = -1; ++ actor->special1.m = ++ P_FindMobjFromTID(target->args[i], &search); ++ } ++ } ++} ++ ++//============================================================================ ++// ++// A_DragonInitFlight ++// ++//============================================================================ ++ ++void A_DragonInitFlight(mobj_t * actor) ++{ ++ int search; ++ ++ search = -1; ++ do ++ { // find the first tid identical to the dragon's tid ++ actor->special1.m = P_FindMobjFromTID(actor->tid, &search); ++ if (search == -1) ++ { ++ P_SetMobjState(actor, actor->info->spawnstate); ++ return; ++ } ++ } ++ while (actor->special1.m == actor); ++ P_RemoveMobjFromTIDList(actor); ++} ++ ++//============================================================================ ++// ++// A_DragonFlight ++// ++//============================================================================ ++ ++void A_DragonFlight(mobj_t * actor) ++{ ++ angle_t angle; ++ ++ DragonSeek(actor, 4 * ANG1, 8 * ANG1); ++ if (actor->target) ++ { ++ if (!(actor->target->flags & MF_SHOOTABLE)) ++ { // target died ++ actor->target = NULL; ++ return; ++ } ++ angle = R_PointToAngle2(actor->x, actor->y, actor->target->x, ++ actor->target->y); ++ if (abs((int) actor->angle - (int) angle) < ANG45 / 2 ++ && P_CheckMeleeRange(actor)) ++ { ++ P_DamageMobj(actor->target, actor, actor, HITDICE(8)); ++ S_StartSound(actor, SFX_DRAGON_ATTACK); ++ } ++ else if (abs((int) actor->angle - (int) angle) <= ANG1 * 20) ++ { ++ P_SetMobjState(actor, actor->info->missilestate); ++ S_StartSound(actor, SFX_DRAGON_ATTACK); ++ } ++ } ++ else ++ { ++ P_LookForPlayers(actor, true); ++ } ++} ++ ++//============================================================================ ++// ++// A_DragonFlap ++// ++//============================================================================ ++ ++void A_DragonFlap(mobj_t * actor) ++{ ++ A_DragonFlight(actor); ++ if (P_Random() < 240) ++ { ++ S_StartSound(actor, SFX_DRAGON_WINGFLAP); ++ } ++ else ++ { ++ S_StartSound(actor, actor->info->activesound); ++ } ++} ++ ++//============================================================================ ++// ++// A_DragonAttack ++// ++//============================================================================ ++ ++void A_DragonAttack(mobj_t * actor) ++{ ++ P_SpawnMissile(actor, actor->target, MT_DRAGON_FX); ++} ++ ++//============================================================================ ++// ++// A_DragonFX2 ++// ++//============================================================================ ++ ++void A_DragonFX2(mobj_t * actor) ++{ ++ mobj_t *mo; ++ int i; ++ int r1,r2,r3; ++ int delay; ++ ++ delay = 16 + (P_Random() >> 3); ++ for (i = 1 + (P_Random() & 3); i; i--) ++ { ++ r1 = P_Random(); ++ r2 = P_Random(); ++ r3 = P_Random(); ++ mo = P_SpawnMobj(actor->x + ((r3 - 128) << 14), ++ actor->y + ((r2 - 128) << 14), ++ actor->z + ((r1 - 128) << 12), ++ MT_DRAGON_FX2); ++ if (mo) ++ { ++ mo->tics = delay + (P_Random() & 3) * i * 2; ++ mo->target = actor->target; ++ } ++ } ++} ++ ++//============================================================================ ++// ++// A_DragonPain ++// ++//============================================================================ ++ ++void A_DragonPain(mobj_t * actor) ++{ ++ A_Pain(actor); ++ if (!actor->special1.i) ++ { // no destination spot yet ++ P_SetMobjState(actor, S_DRAGON_INIT); ++ } ++} ++ ++//============================================================================ ++// ++// A_DragonCheckCrash ++// ++//============================================================================ ++ ++void A_DragonCheckCrash(mobj_t * actor) ++{ ++ if (actor->z <= actor->floorz) ++ { ++ P_SetMobjState(actor, S_DRAGON_CRASH1); ++ } ++} ++ ++//============================================================================ ++// Demon AI ++//============================================================================ ++ ++// ++// A_DemonAttack1 (melee) ++// ++void A_DemonAttack1(mobj_t * actor) ++{ ++ if (P_CheckMeleeRange(actor)) ++ { ++ P_DamageMobj(actor->target, actor, actor, HITDICE(2)); ++ } ++} ++ ++ ++// ++// A_DemonAttack2 (missile) ++// ++void A_DemonAttack2(mobj_t * actor) ++{ ++ mobj_t *mo; ++ int fireBall; ++ ++ if (actor->type == MT_DEMON) ++ { ++ fireBall = MT_DEMONFX1; ++ } ++ else ++ { ++ fireBall = MT_DEMON2FX1; ++ } ++ mo = P_SpawnMissile(actor, actor->target, fireBall); ++ if (mo) ++ { ++ mo->z += 30 * FRACUNIT; ++ S_StartSound(actor, SFX_DEMON_MISSILE_FIRE); ++ } ++} ++ ++// ++// A_DemonDeath ++// ++ ++void A_DemonDeath(mobj_t * actor) ++{ ++ mobj_t *mo; ++ angle_t angle; ++ ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z + 45 * FRACUNIT, ++ MT_DEMONCHUNK1); ++ if (mo) ++ { ++ angle = actor->angle + ANG90; ++ mo->momz = 8 * FRACUNIT; ++ mo->momx = FixedMul((P_Random() << 10) + FRACUNIT, ++ finecosine[angle >> ANGLETOFINESHIFT]); ++ mo->momy = FixedMul((P_Random() << 10) + FRACUNIT, ++ finesine[angle >> ANGLETOFINESHIFT]); ++ mo->target = actor; ++ } ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z + 45 * FRACUNIT, ++ MT_DEMONCHUNK2); ++ if (mo) ++ { ++ angle = actor->angle - ANG90; ++ mo->momz = 8 * FRACUNIT; ++ mo->momx = FixedMul((P_Random() << 10) + FRACUNIT, ++ finecosine[angle >> ANGLETOFINESHIFT]); ++ mo->momy = FixedMul((P_Random() << 10) + FRACUNIT, ++ finesine[angle >> ANGLETOFINESHIFT]); ++ mo->target = actor; ++ } ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z + 45 * FRACUNIT, ++ MT_DEMONCHUNK3); ++ if (mo) ++ { ++ angle = actor->angle - ANG90; ++ mo->momz = 8 * FRACUNIT; ++ mo->momx = FixedMul((P_Random() << 10) + FRACUNIT, ++ finecosine[angle >> ANGLETOFINESHIFT]); ++ mo->momy = FixedMul((P_Random() << 10) + FRACUNIT, ++ finesine[angle >> ANGLETOFINESHIFT]); ++ mo->target = actor; ++ } ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z + 45 * FRACUNIT, ++ MT_DEMONCHUNK4); ++ if (mo) ++ { ++ angle = actor->angle - ANG90; ++ mo->momz = 8 * FRACUNIT; ++ mo->momx = FixedMul((P_Random() << 10) + FRACUNIT, ++ finecosine[angle >> ANGLETOFINESHIFT]); ++ mo->momy = FixedMul((P_Random() << 10) + FRACUNIT, ++ finesine[angle >> ANGLETOFINESHIFT]); ++ mo->target = actor; ++ } ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z + 45 * FRACUNIT, ++ MT_DEMONCHUNK5); ++ if (mo) ++ { ++ angle = actor->angle - ANG90; ++ mo->momz = 8 * FRACUNIT; ++ mo->momx = FixedMul((P_Random() << 10) + FRACUNIT, ++ finecosine[angle >> ANGLETOFINESHIFT]); ++ mo->momy = FixedMul((P_Random() << 10) + FRACUNIT, ++ finesine[angle >> ANGLETOFINESHIFT]); ++ mo->target = actor; ++ } ++} ++ ++//=========================================================================== ++// ++// A_Demon2Death ++// ++//=========================================================================== ++ ++void A_Demon2Death(mobj_t * actor) ++{ ++ mobj_t *mo; ++ angle_t angle; ++ ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z + 45 * FRACUNIT, ++ MT_DEMON2CHUNK1); ++ if (mo) ++ { ++ angle = actor->angle + ANG90; ++ mo->momz = 8 * FRACUNIT; ++ mo->momx = FixedMul((P_Random() << 10) + FRACUNIT, ++ finecosine[angle >> ANGLETOFINESHIFT]); ++ mo->momy = FixedMul((P_Random() << 10) + FRACUNIT, ++ finesine[angle >> ANGLETOFINESHIFT]); ++ mo->target = actor; ++ } ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z + 45 * FRACUNIT, ++ MT_DEMON2CHUNK2); ++ if (mo) ++ { ++ angle = actor->angle - ANG90; ++ mo->momz = 8 * FRACUNIT; ++ mo->momx = FixedMul((P_Random() << 10) + FRACUNIT, ++ finecosine[angle >> ANGLETOFINESHIFT]); ++ mo->momy = FixedMul((P_Random() << 10) + FRACUNIT, ++ finesine[angle >> ANGLETOFINESHIFT]); ++ mo->target = actor; ++ } ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z + 45 * FRACUNIT, ++ MT_DEMON2CHUNK3); ++ if (mo) ++ { ++ angle = actor->angle - ANG90; ++ mo->momz = 8 * FRACUNIT; ++ mo->momx = FixedMul((P_Random() << 10) + FRACUNIT, ++ finecosine[angle >> ANGLETOFINESHIFT]); ++ mo->momy = FixedMul((P_Random() << 10) + FRACUNIT, ++ finesine[angle >> ANGLETOFINESHIFT]); ++ mo->target = actor; ++ } ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z + 45 * FRACUNIT, ++ MT_DEMON2CHUNK4); ++ if (mo) ++ { ++ angle = actor->angle - ANG90; ++ mo->momz = 8 * FRACUNIT; ++ mo->momx = FixedMul((P_Random() << 10) + FRACUNIT, ++ finecosine[angle >> ANGLETOFINESHIFT]); ++ mo->momy = FixedMul((P_Random() << 10) + FRACUNIT, ++ finesine[angle >> ANGLETOFINESHIFT]); ++ mo->target = actor; ++ } ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z + 45 * FRACUNIT, ++ MT_DEMON2CHUNK5); ++ if (mo) ++ { ++ angle = actor->angle - ANG90; ++ mo->momz = 8 * FRACUNIT; ++ mo->momx = FixedMul((P_Random() << 10) + FRACUNIT, ++ finecosine[angle >> ANGLETOFINESHIFT]); ++ mo->momy = FixedMul((P_Random() << 10) + FRACUNIT, ++ finesine[angle >> ANGLETOFINESHIFT]); ++ mo->target = actor; ++ } ++} ++ ++ ++ ++// ++// A_SinkMobj ++// Sink a mobj incrementally into the floor ++// ++ ++boolean A_SinkMobj(mobj_t * actor) ++{ ++ if (actor->floorclip < actor->info->height) ++ { ++ switch (actor->type) ++ { ++ case MT_THRUSTFLOOR_DOWN: ++ case MT_THRUSTFLOOR_UP: ++ actor->floorclip += 6 * FRACUNIT; ++ break; ++ default: ++ actor->floorclip += FRACUNIT; ++ break; ++ } ++ return false; ++ } ++ return true; ++} ++ ++// ++// A_RaiseMobj ++// Raise a mobj incrementally from the floor to ++// ++ ++boolean A_RaiseMobj(mobj_t * actor) ++{ ++ int done = true; ++ ++ // Raise a mobj from the ground ++ if (actor->floorclip > 0) ++ { ++ switch (actor->type) ++ { ++ case MT_WRAITHB: ++ actor->floorclip -= 2 * FRACUNIT; ++ break; ++ case MT_THRUSTFLOOR_DOWN: ++ case MT_THRUSTFLOOR_UP: ++ actor->floorclip -= actor->special2.i * FRACUNIT; ++ break; ++ default: ++ actor->floorclip -= 2 * FRACUNIT; ++ break; ++ } ++ if (actor->floorclip <= 0) ++ { ++ actor->floorclip = 0; ++ done = true; ++ } ++ else ++ { ++ done = false; ++ } ++ } ++ return done; // Reached target height ++} ++ ++ ++//============================================================================ ++// Wraith Variables ++// ++// special1 Internal index into floatbob ++// special2 ++//============================================================================ ++ ++// ++// A_WraithInit ++// ++ ++void A_WraithInit(mobj_t * actor) ++{ ++ actor->z += 48 << FRACBITS; ++ actor->special1.i = 0; // index into floatbob ++} ++ ++void A_WraithRaiseInit(mobj_t * actor) ++{ ++ actor->flags2 &= ~MF2_DONTDRAW; ++ actor->flags2 &= ~MF2_NONSHOOTABLE; ++ actor->flags |= MF_SHOOTABLE | MF_SOLID; ++ actor->floorclip = actor->info->height; ++} ++ ++void A_WraithRaise(mobj_t * actor) ++{ ++ if (A_RaiseMobj(actor)) ++ { ++ // Reached it's target height ++ P_SetMobjState(actor, S_WRAITH_CHASE1); ++ } ++ ++ P_SpawnDirt(actor, actor->radius); ++} ++ ++ ++void A_WraithMelee(mobj_t * actor) ++{ ++ int amount; ++ ++ // Steal health from target and give to player ++ if (P_CheckMeleeRange(actor) && (P_Random() < 220)) ++ { ++ amount = HITDICE(2); ++ P_DamageMobj(actor->target, actor, actor, amount); ++ actor->health += amount; ++ } ++} ++ ++void A_WraithMissile(mobj_t * actor) ++{ ++ mobj_t *mo; ++ ++ mo = P_SpawnMissile(actor, actor->target, MT_WRAITHFX1); ++ if (mo) ++ { ++ S_StartSound(actor, SFX_WRAITH_MISSILE_FIRE); ++ } ++} ++ ++ ++// ++// A_WraithFX2 - spawns sparkle tail of missile ++// ++ ++void A_WraithFX2(mobj_t * actor) ++{ ++ mobj_t *mo; ++ angle_t angle; ++ int i; ++ ++ for (i = 0; i < 2; i++) ++ { ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_WRAITHFX2); ++ if (mo) ++ { ++ if (P_Random() < 128) ++ { ++ angle = actor->angle + (P_Random() << 22); ++ } ++ else ++ { ++ angle = actor->angle - (P_Random() << 22); ++ } ++ mo->momz = 0; ++ mo->momx = FixedMul((P_Random() << 7) + FRACUNIT, ++ finecosine[angle >> ANGLETOFINESHIFT]); ++ mo->momy = FixedMul((P_Random() << 7) + FRACUNIT, ++ finesine[angle >> ANGLETOFINESHIFT]); ++ mo->target = actor; ++ mo->floorclip = 10 * FRACUNIT; ++ } ++ } ++} ++ ++ ++// Spawn an FX3 around the actor during attacks ++void A_WraithFX3(mobj_t * actor) ++{ ++ mobj_t *mo; ++ int numdropped = P_Random() % 15; ++ int i; ++ ++ for (i = 0; i < numdropped; i++) ++ { ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_WRAITHFX3); ++ if (mo) ++ { ++ mo->x += (P_Random() - 128) << 11; ++ mo->y += (P_Random() - 128) << 11; ++ mo->z += (P_Random() << 10); ++ mo->target = actor; ++ } ++ } ++} ++ ++// Spawn an FX4 during movement ++void A_WraithFX4(mobj_t * actor) ++{ ++ mobj_t *mo; ++ int chance = P_Random(); ++ int spawn4, spawn5; ++ ++ if (chance < 10) ++ { ++ spawn4 = true; ++ spawn5 = false; ++ } ++ else if (chance < 20) ++ { ++ spawn4 = false; ++ spawn5 = true; ++ } ++ else if (chance < 25) ++ { ++ spawn4 = true; ++ spawn5 = true; ++ } ++ else ++ { ++ spawn4 = false; ++ spawn5 = false; ++ } ++ ++ if (spawn4) ++ { ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_WRAITHFX4); ++ if (mo) ++ { ++ mo->x += (P_Random() - 128) << 12; ++ mo->y += (P_Random() - 128) << 12; ++ mo->z += (P_Random() << 10); ++ mo->target = actor; ++ } ++ } ++ if (spawn5) ++ { ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_WRAITHFX5); ++ if (mo) ++ { ++ mo->x += (P_Random() - 128) << 11; ++ mo->y += (P_Random() - 128) << 11; ++ mo->z += (P_Random() << 10); ++ mo->target = actor; ++ } ++ } ++} ++ ++ ++void A_WraithLook(mobj_t * actor) ++{ ++// A_WraithFX4(actor); // too expensive ++ A_Look(actor); ++} ++ ++ ++void A_WraithChase(mobj_t * actor) ++{ ++ int weaveindex = actor->special1.i; ++ actor->z += FloatBobOffsets[weaveindex]; ++ actor->special1.i = (weaveindex + 2) & 63; ++// if (actor->floorclip > 0) ++// { ++// P_SetMobjState(actor, S_WRAITH_RAISE2); ++// return; ++// } ++ A_Chase(actor); ++ A_WraithFX4(actor); ++} ++ ++ ++ ++//============================================================================ ++// Ettin AI ++//============================================================================ ++ ++void A_EttinAttack(mobj_t * actor) ++{ ++ if (P_CheckMeleeRange(actor)) ++ { ++ P_DamageMobj(actor->target, actor, actor, HITDICE(2)); ++ } ++} ++ ++ ++void A_DropMace(mobj_t * actor) ++{ ++ mobj_t *mo; ++ ++ mo = P_SpawnMobj(actor->x, actor->y, ++ actor->z + (actor->height >> 1), MT_ETTIN_MACE); ++ if (mo) ++ { ++ mo->momx = (P_Random() - 128) << 11; ++ mo->momy = (P_Random() - 128) << 11; ++ mo->momz = FRACUNIT * 10 + (P_Random() << 10); ++ mo->target = actor; ++ } ++} ++ ++ ++//============================================================================ ++// Fire Demon AI ++// ++// special1 index into floatbob ++// special2 whether strafing or not ++//============================================================================ ++ ++void A_FiredSpawnRock(mobj_t * actor) ++{ ++ mobj_t *mo; ++ int x, y, z; ++ int rtype = 0; ++ ++ switch (P_Random() % 5) ++ { ++ case 0: ++ rtype = MT_FIREDEMON_FX1; ++ break; ++ case 1: ++ rtype = MT_FIREDEMON_FX2; ++ break; ++ case 2: ++ rtype = MT_FIREDEMON_FX3; ++ break; ++ case 3: ++ rtype = MT_FIREDEMON_FX4; ++ break; ++ case 4: ++ rtype = MT_FIREDEMON_FX5; ++ break; ++ } ++ ++ x = actor->x + ((P_Random() - 128) << 12); ++ y = actor->y + ((P_Random() - 128) << 12); ++ z = actor->z + ((P_Random()) << 11); ++ mo = P_SpawnMobj(x, y, z, rtype); ++ if (mo) ++ { ++ mo->target = actor; ++ mo->momx = (P_Random() - 128) << 10; ++ mo->momy = (P_Random() - 128) << 10; ++ mo->momz = (P_Random() << 10); ++ mo->special1.i = 2; // Number bounces ++ } ++ ++ // Initialize fire demon ++ actor->special2.i = 0; ++ actor->flags &= ~MF_JUSTATTACKED; ++} ++ ++void A_FiredRocks(mobj_t * actor) ++{ ++ A_FiredSpawnRock(actor); ++ A_FiredSpawnRock(actor); ++ A_FiredSpawnRock(actor); ++ A_FiredSpawnRock(actor); ++ A_FiredSpawnRock(actor); ++} ++ ++void A_FiredAttack(mobj_t * actor) ++{ ++ mobj_t *mo; ++ mo = P_SpawnMissile(actor, actor->target, MT_FIREDEMON_FX6); ++ if (mo) ++ S_StartSound(actor, SFX_FIRED_ATTACK); ++} ++ ++void A_SmBounce(mobj_t * actor) ++{ ++ // give some more momentum (x,y,&z) ++ actor->z = actor->floorz + FRACUNIT; ++ actor->momz = (2 * FRACUNIT) + (P_Random() << 10); ++ actor->momx = P_Random() % 3 << FRACBITS; ++ actor->momy = P_Random() % 3 << FRACBITS; ++} ++ ++ ++#define FIREDEMON_ATTACK_RANGE 64*8*FRACUNIT ++ ++void A_FiredChase(mobj_t * actor) ++{ ++ int weaveindex = actor->special1.i; ++ mobj_t *target = actor->target; ++ angle_t ang; ++ fixed_t dist; ++ ++ if (actor->reactiontime) ++ actor->reactiontime--; ++ if (actor->threshold) ++ actor->threshold--; ++ ++ // Float up and down ++ actor->z += FloatBobOffsets[weaveindex]; ++ actor->special1.i = (weaveindex + 2) & 63; ++ ++ // Insure it stays above certain height ++ if (actor->z < actor->floorz + (64 * FRACUNIT)) ++ { ++ actor->z += 2 * FRACUNIT; ++ } ++ ++ if (!actor->target || !(actor->target->flags & MF_SHOOTABLE)) ++ { // Invalid target ++ P_LookForPlayers(actor, true); ++ return; ++ } ++ ++ // Strafe ++ if (actor->special2.i > 0) ++ { ++ actor->special2.i--; ++ } ++ else ++ { ++ actor->special2.i = 0; ++ actor->momx = actor->momy = 0; ++ dist = P_AproxDistance(actor->x - target->x, actor->y - target->y); ++ if (dist < FIREDEMON_ATTACK_RANGE) ++ { ++ if (P_Random() < 30) ++ { ++ ang = ++ R_PointToAngle2(actor->x, actor->y, target->x, target->y); ++ if (P_Random() < 128) ++ ang += ANG90; ++ else ++ ang -= ANG90; ++ ang >>= ANGLETOFINESHIFT; ++ actor->momx = FixedMul(8 * FRACUNIT, finecosine[ang]); ++ actor->momy = FixedMul(8 * FRACUNIT, finesine[ang]); ++ actor->special2.i = 3; // strafe time ++ } ++ } ++ } ++ ++ FaceMovementDirection(actor); ++ ++ // Normal movement ++ if (!actor->special2.i) ++ { ++ if (--actor->movecount < 0 || !P_Move(actor)) ++ { ++ P_NewChaseDir(actor); ++ } ++ } ++ ++ // Do missile attack ++ if (!(actor->flags & MF_JUSTATTACKED)) ++ { ++ if (P_CheckMissileRange(actor) && (P_Random() < 20)) ++ { ++ P_SetMobjState(actor, actor->info->missilestate); ++ actor->flags |= MF_JUSTATTACKED; ++ return; ++ } ++ } ++ else ++ { ++ actor->flags &= ~MF_JUSTATTACKED; ++ } ++ ++ // make active sound ++ if (actor->info->activesound && P_Random() < 3) ++ { ++ S_StartSound(actor, actor->info->activesound); ++ } ++} ++ ++void A_FiredSplotch(mobj_t * actor) ++{ ++ mobj_t *mo; ++ ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_FIREDEMON_SPLOTCH1); ++ if (mo) ++ { ++ mo->momx = (P_Random() - 128) << 11; ++ mo->momy = (P_Random() - 128) << 11; ++ mo->momz = FRACUNIT * 3 + (P_Random() << 10); ++ } ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_FIREDEMON_SPLOTCH2); ++ if (mo) ++ { ++ mo->momx = (P_Random() - 128) << 11; ++ mo->momy = (P_Random() - 128) << 11; ++ mo->momz = FRACUNIT * 3 + (P_Random() << 10); ++ } ++} ++ ++ ++//============================================================================ ++// ++// A_IceGuyLook ++// ++//============================================================================ ++ ++void A_IceGuyLook(mobj_t * actor) ++{ ++ fixed_t dist; ++ fixed_t an; ++ ++ A_Look(actor); ++ if (P_Random() < 64) ++ { ++ dist = ((P_Random() - 128) * actor->radius) >> 7; ++ an = (actor->angle + ANG90) >> ANGLETOFINESHIFT; ++ ++ P_SpawnMobj(actor->x + FixedMul(dist, finecosine[an]), ++ actor->y + FixedMul(dist, finesine[an]), ++ actor->z + 60 * FRACUNIT, ++ MT_ICEGUY_WISP1 + (P_Random() & 1)); ++ } ++} ++ ++//============================================================================ ++// ++// A_IceGuyChase ++// ++//============================================================================ ++ ++void A_IceGuyChase(mobj_t * actor) ++{ ++ fixed_t dist; ++ fixed_t an; ++ mobj_t *mo; ++ ++ A_Chase(actor); ++ if (P_Random() < 128) ++ { ++ dist = ((P_Random() - 128) * actor->radius) >> 7; ++ an = (actor->angle + ANG90) >> ANGLETOFINESHIFT; ++ ++ mo = P_SpawnMobj(actor->x + FixedMul(dist, finecosine[an]), ++ actor->y + FixedMul(dist, finesine[an]), ++ actor->z + 60 * FRACUNIT, ++ MT_ICEGUY_WISP1 + (P_Random() & 1)); ++ if (mo) ++ { ++ mo->momx = actor->momx; ++ mo->momy = actor->momy; ++ mo->momz = actor->momz; ++ mo->target = actor; ++ } ++ } ++} ++ ++//============================================================================ ++// ++// A_IceGuyAttack ++// ++//============================================================================ ++ ++void A_IceGuyAttack(mobj_t * actor) ++{ ++ fixed_t an; ++ ++ if (!actor->target) ++ { ++ return; ++ } ++ an = (actor->angle + ANG90) >> ANGLETOFINESHIFT; ++ P_SpawnMissileXYZ(actor->x + FixedMul(actor->radius >> 1, ++ finecosine[an]), ++ actor->y + FixedMul(actor->radius >> 1, finesine[an]), ++ actor->z + 40 * FRACUNIT, actor, actor->target, ++ MT_ICEGUY_FX); ++ an = (actor->angle - ANG90) >> ANGLETOFINESHIFT; ++ P_SpawnMissileXYZ(actor->x + FixedMul(actor->radius >> 1, ++ finecosine[an]), ++ actor->y + FixedMul(actor->radius >> 1, finesine[an]), ++ actor->z + 40 * FRACUNIT, actor, actor->target, ++ MT_ICEGUY_FX); ++ S_StartSound(actor, actor->info->attacksound); ++} ++ ++//============================================================================ ++// ++// A_IceGuyMissilePuff ++// ++//============================================================================ ++ ++void A_IceGuyMissilePuff(mobj_t * actor) ++{ ++ P_SpawnMobj(actor->x, actor->y, actor->z + 2 * FRACUNIT, MT_ICEFX_PUFF); ++} ++ ++//============================================================================ ++// ++// A_IceGuyDie ++// ++//============================================================================ ++ ++void A_IceGuyDie(mobj_t * actor) ++{ ++ actor->momx = 0; ++ actor->momy = 0; ++ actor->momz = 0; ++ actor->height <<= 2; ++ A_FreezeDeathChunks(actor); ++} ++ ++//============================================================================ ++// ++// A_IceGuyMissileExplode ++// ++//============================================================================ ++ ++void A_IceGuyMissileExplode(mobj_t * actor) ++{ ++ mobj_t *mo; ++ unsigned int i; ++ ++ for (i = 0; i < 8; i++) ++ { ++ mo = P_SpawnMissileAngle(actor, MT_ICEGUY_FX2, i * ANG45, ++ -0.3 * FRACUNIT); ++ if (mo) ++ { ++ mo->target = actor->target; ++ } ++ } ++} ++ ++ ++ ++ ++ ++ ++ ++ ++ ++//============================================================================ ++// ++// Sorcerer stuff ++// ++// Sorcerer Variables ++// special1 Angle of ball 1 (all others relative to that) ++// special2 which ball to stop at in stop mode (MT_???) ++// args[0] Denfense time ++// args[1] Number of full rotations since stopping mode ++// args[2] Target orbit speed for acceleration/deceleration ++// args[3] Movement mode (see SORC_ macros) ++// args[4] Current ball orbit speed ++// Sorcerer Ball Variables ++// special1 Previous angle of ball (for woosh) ++// special2 Countdown of rapid fire (FX4) ++// args[0] If set, don't play the bounce sound when bouncing ++//============================================================================ ++ ++#define SORCBALL_INITIAL_SPEED 7 ++#define SORCBALL_TERMINAL_SPEED 25 ++#define SORCBALL_SPEED_ROTATIONS 5 ++#define SORC_DEFENSE_TIME 255 ++#define SORC_DEFENSE_HEIGHT 45 ++#define BOUNCE_TIME_UNIT (35/2) ++#define SORCFX4_RAPIDFIRE_TIME (6*3) // 3 seconds ++#define SORCFX4_SPREAD_ANGLE 20 ++ ++#define SORC_DECELERATE 0 ++#define SORC_ACCELERATE 1 ++#define SORC_STOPPING 2 ++#define SORC_FIRESPELL 3 ++#define SORC_STOPPED 4 ++#define SORC_NORMAL 5 ++#define SORC_FIRING_SPELL 6 ++ ++#define BALL1_ANGLEOFFSET 0 ++#define BALL2_ANGLEOFFSET (ANG_MAX/3) ++#define BALL3_ANGLEOFFSET ((ANG_MAX/3)*2) ++ ++ ++// Spawn spinning balls above head - actor is sorcerer ++void A_SorcSpinBalls(mobj_t * actor) ++{ ++ mobj_t *mo; ++ fixed_t z; ++ ++ A_SlowBalls(actor); ++ actor->args[0] = 0; // Currently no defense ++ actor->args[3] = SORC_NORMAL; ++ actor->args[4] = SORCBALL_INITIAL_SPEED; // Initial orbit speed ++ actor->special1.i = ANG1; ++ z = actor->z - actor->floorclip + actor->info->height; ++ ++ mo = P_SpawnMobj(actor->x, actor->y, z, MT_SORCBALL1); ++ if (mo) ++ { ++ mo->target = actor; ++ mo->special2.i = SORCFX4_RAPIDFIRE_TIME; ++ } ++ mo = P_SpawnMobj(actor->x, actor->y, z, MT_SORCBALL2); ++ if (mo) ++ mo->target = actor; ++ mo = P_SpawnMobj(actor->x, actor->y, z, MT_SORCBALL3); ++ if (mo) ++ mo->target = actor; ++} ++ ++ ++// ++// A_SorcBallOrbit() ========================================== ++// ++ ++void A_SorcBallOrbit(mobj_t * actor) ++{ ++ int x, y; ++ angle_t angle, baseangle; ++ int mode = actor->target->args[3]; ++ mobj_t *parent = (mobj_t *) actor->target; ++ int dist = parent->radius - (actor->radius << 1); ++ angle_t prevangle = actor->special1.i; ++ ++ if (actor->target->health <= 0) ++ P_SetMobjState(actor, actor->info->painstate); ++ ++ baseangle = (angle_t) parent->special1.i; ++ switch (actor->type) ++ { ++ case MT_SORCBALL1: ++ angle = baseangle + BALL1_ANGLEOFFSET; ++ break; ++ case MT_SORCBALL2: ++ angle = baseangle + BALL2_ANGLEOFFSET; ++ break; ++ case MT_SORCBALL3: ++ angle = baseangle + BALL3_ANGLEOFFSET; ++ break; ++ default: ++ I_Error("corrupted sorcerer"); ++ return; ++ } ++ actor->angle = angle; ++ angle >>= ANGLETOFINESHIFT; ++ ++ switch (mode) ++ { ++ case SORC_NORMAL: // Balls rotating normally ++ A_SorcUpdateBallAngle(actor); ++ break; ++ case SORC_DECELERATE: // Balls decelerating ++ A_DecelBalls(actor); ++ A_SorcUpdateBallAngle(actor); ++ break; ++ case SORC_ACCELERATE: // Balls accelerating ++ A_AccelBalls(actor); ++ A_SorcUpdateBallAngle(actor); ++ break; ++ case SORC_STOPPING: // Balls stopping ++ if ((parent->special2.i == actor->type) && ++ (parent->args[1] > SORCBALL_SPEED_ROTATIONS) && ++ (abs((int) angle - (int) (parent->angle >> ANGLETOFINESHIFT)) < ++ (30 << 5))) ++ { ++ // Can stop now ++ actor->target->args[3] = SORC_FIRESPELL; ++ actor->target->args[4] = 0; ++ // Set angle so ball angle == sorcerer angle ++ switch (actor->type) ++ { ++ case MT_SORCBALL1: ++ parent->special1.i = (int) (parent->angle - ++ BALL1_ANGLEOFFSET); ++ break; ++ case MT_SORCBALL2: ++ parent->special1.i = (int) (parent->angle - ++ BALL2_ANGLEOFFSET); ++ break; ++ case MT_SORCBALL3: ++ parent->special1.i = (int) (parent->angle - ++ BALL3_ANGLEOFFSET); ++ break; ++ default: ++ break; ++ } ++ } ++ else ++ { ++ A_SorcUpdateBallAngle(actor); ++ } ++ break; ++ case SORC_FIRESPELL: // Casting spell ++ if (parent->special2.i == actor->type) ++ { ++ // Put sorcerer into special throw spell anim ++ if (parent->health > 0) ++ P_SetMobjStateNF(parent, S_SORC_ATTACK1); ++ ++ if (actor->type == MT_SORCBALL1 && P_Random() < 200) ++ { ++ S_StartSound(NULL, SFX_SORCERER_SPELLCAST); ++ actor->special2.i = SORCFX4_RAPIDFIRE_TIME; ++ actor->args[4] = 128; ++ parent->args[3] = SORC_FIRING_SPELL; ++ } ++ else ++ { ++ A_CastSorcererSpell(actor); ++ parent->args[3] = SORC_STOPPED; ++ } ++ } ++ break; ++ case SORC_FIRING_SPELL: ++ if (parent->special2.i == actor->type) ++ { ++ if (actor->special2.i-- <= 0) ++ { ++ // Done rapid firing ++ parent->args[3] = SORC_STOPPED; ++ // Back to orbit balls ++ if (parent->health > 0) ++ P_SetMobjStateNF(parent, S_SORC_ATTACK4); ++ } ++ else ++ { ++ // Do rapid fire spell ++ A_SorcOffense2(actor); ++ } ++ } ++ break; ++ case SORC_STOPPED: // Balls stopped ++ default: ++ break; ++ } ++ ++ if ((angle < prevangle) && (parent->args[4] == SORCBALL_TERMINAL_SPEED)) ++ { ++ parent->args[1]++; // Bump rotation counter ++ // Completed full rotation - make woosh sound ++ S_StartSound(actor, SFX_SORCERER_BALLWOOSH); ++ } ++ actor->special1.i = angle; // Set previous angle ++ x = parent->x + FixedMul(dist, finecosine[angle]); ++ y = parent->y + FixedMul(dist, finesine[angle]); ++ actor->x = x; ++ actor->y = y; ++ actor->z = parent->z - parent->floorclip + parent->info->height; ++} ++ ++ ++// ++// Set balls to speed mode - actor is sorcerer ++// ++void A_SpeedBalls(mobj_t * actor) ++{ ++ actor->args[3] = SORC_ACCELERATE; // speed mode ++ actor->args[2] = SORCBALL_TERMINAL_SPEED; // target speed ++} ++ ++ ++// ++// Set balls to slow mode - actor is sorcerer ++// ++void A_SlowBalls(mobj_t * actor) ++{ ++ actor->args[3] = SORC_DECELERATE; // slow mode ++ actor->args[2] = SORCBALL_INITIAL_SPEED; // target speed ++} ++ ++ ++// ++// Instant stop when rotation gets to ball in special2 ++// actor is sorcerer ++// ++void A_StopBalls(mobj_t * actor) ++{ ++ int chance = P_Random(); ++ actor->args[3] = SORC_STOPPING; // stopping mode ++ actor->args[1] = 0; // Reset rotation counter ++ ++ if ((actor->args[0] <= 0) && (chance < 200)) ++ { ++ actor->special2.i = MT_SORCBALL2; // Blue ++ } ++ else if ((actor->health < (actor->info->spawnhealth >> 1)) && ++ (chance < 200)) ++ { ++ actor->special2.i = MT_SORCBALL3; // Green ++ } ++ else ++ { ++ actor->special2.i = MT_SORCBALL1; // Yellow ++ } ++ ++ ++} ++ ++ ++// ++// Increase ball orbit speed - actor is ball ++// ++void A_AccelBalls(mobj_t * actor) ++{ ++ mobj_t *sorc = actor->target; ++ ++ if (sorc->args[4] < sorc->args[2]) ++ { ++ sorc->args[4]++; ++ } ++ else ++ { ++ sorc->args[3] = SORC_NORMAL; ++ if (sorc->args[4] >= SORCBALL_TERMINAL_SPEED) ++ { ++ // Reached terminal velocity - stop balls ++ A_StopBalls(sorc); ++ } ++ } ++} ++ ++ ++// Decrease ball orbit speed - actor is ball ++void A_DecelBalls(mobj_t * actor) ++{ ++ mobj_t *sorc = actor->target; ++ ++ if (sorc->args[4] > sorc->args[2]) ++ { ++ sorc->args[4]--; ++ } ++ else ++ { ++ sorc->args[3] = SORC_NORMAL; ++ } ++} ++ ++ ++// Update angle if first ball - actor is ball ++void A_SorcUpdateBallAngle(mobj_t * actor) ++{ ++ if (actor->type == MT_SORCBALL1) ++ { ++ actor->target->special1.i += ANG1 * actor->target->args[4]; ++ } ++} ++ ++ ++// actor is ball ++void A_CastSorcererSpell(mobj_t * actor) ++{ ++ mobj_t *mo; ++ int spell = actor->type; ++ angle_t ang1, ang2; ++ fixed_t z; ++ mobj_t *parent = actor->target; ++ ++ S_StartSound(NULL, SFX_SORCERER_SPELLCAST); ++ ++ // Put sorcerer into throw spell animation ++ if (parent->health > 0) ++ P_SetMobjStateNF(parent, S_SORC_ATTACK4); ++ ++ switch (spell) ++ { ++ case MT_SORCBALL1: // Offensive ++ A_SorcOffense1(actor); ++ break; ++ case MT_SORCBALL2: // Defensive ++ z = parent->z - parent->floorclip + ++ SORC_DEFENSE_HEIGHT * FRACUNIT; ++ mo = P_SpawnMobj(actor->x, actor->y, z, MT_SORCFX2); ++ parent->flags2 |= MF2_REFLECTIVE | MF2_INVULNERABLE; ++ parent->args[0] = SORC_DEFENSE_TIME; ++ if (mo) ++ mo->target = parent; ++ break; ++ case MT_SORCBALL3: // Reinforcements ++ ang1 = actor->angle - ANG45; ++ ang2 = actor->angle + ANG45; ++ if (actor->health < (actor->info->spawnhealth / 3)) ++ { // Spawn 2 at a time ++ mo = P_SpawnMissileAngle(parent, MT_SORCFX3, ang1, ++ 4 * FRACUNIT); ++ if (mo) ++ mo->target = parent; ++ mo = P_SpawnMissileAngle(parent, MT_SORCFX3, ang2, ++ 4 * FRACUNIT); ++ if (mo) ++ mo->target = parent; ++ } ++ else ++ { ++ if (P_Random() < 128) ++ ang1 = ang2; ++ mo = P_SpawnMissileAngle(parent, MT_SORCFX3, ang1, ++ 4 * FRACUNIT); ++ if (mo) ++ mo->target = parent; ++ } ++ break; ++ default: ++ break; ++ } ++} ++ ++/* ++void A_SpawnReinforcements(mobj_t *actor) ++{ ++ mobj_t *parent = actor->target; ++ mobj_t *mo; ++ angle_t ang; ++ ang = ANG1 * P_Random(); ++ mo = P_SpawnMissileAngle(actor, MT_SORCFX3, ang, 5*FRACUNIT); ++ if (mo) mo->target = parent; ++} ++*/ ++ ++// actor is ball ++void A_SorcOffense1(mobj_t * actor) ++{ ++ mobj_t *mo; ++ angle_t ang1, ang2; ++ mobj_t *parent = (mobj_t *) actor->target; ++ ++ ang1 = actor->angle + ANG1 * 70; ++ ang2 = actor->angle - ANG1 * 70; ++ mo = P_SpawnMissileAngle(parent, MT_SORCFX1, ang1, 0); ++ if (mo) ++ { ++ mo->target = parent; ++ mo->special1.m = parent->target; ++ mo->args[4] = BOUNCE_TIME_UNIT; ++ mo->args[3] = 15; // Bounce time in seconds ++ } ++ mo = P_SpawnMissileAngle(parent, MT_SORCFX1, ang2, 0); ++ if (mo) ++ { ++ mo->target = parent; ++ mo->special1.m = parent->target; ++ mo->args[4] = BOUNCE_TIME_UNIT; ++ mo->args[3] = 15; // Bounce time in seconds ++ } ++} ++ ++ ++// Actor is ball ++void A_SorcOffense2(mobj_t * actor) ++{ ++ angle_t ang1; ++ mobj_t *mo; ++ int delta, index; ++ mobj_t *parent = actor->target; ++ mobj_t *dest = parent->target; ++ int dist; ++ ++ index = actor->args[4] << 5; ++ actor->args[4] += 15; ++ delta = (finesine[index]) * SORCFX4_SPREAD_ANGLE; ++ delta = (delta >> FRACBITS) * ANG1; ++ ang1 = actor->angle + delta; ++ mo = P_SpawnMissileAngle(parent, MT_SORCFX4, ang1, 0); ++ if (mo) ++ { ++ mo->special2.i = 35 * 5 / 2; // 5 seconds ++ dist = P_AproxDistance(dest->x - mo->x, dest->y - mo->y); ++ dist = dist / mo->info->speed; ++ if (dist < 1) ++ dist = 1; ++ mo->momz = (dest->z - mo->z) / dist; ++ } ++} ++ ++ ++// Resume ball spinning ++void A_SorcBossAttack(mobj_t * actor) ++{ ++ actor->args[3] = SORC_ACCELERATE; ++ actor->args[2] = SORCBALL_INITIAL_SPEED; ++} ++ ++ ++// spell cast magic fizzle ++void A_SpawnFizzle(mobj_t * actor) ++{ ++ fixed_t x, y, z; ++ fixed_t dist = 5 * FRACUNIT; ++ angle_t angle = actor->angle >> ANGLETOFINESHIFT; ++ fixed_t speed = actor->info->speed; ++ angle_t rangle; ++ mobj_t *mo; ++ int ix; ++ ++ x = actor->x + FixedMul(dist, finecosine[angle]); ++ y = actor->y + FixedMul(dist, finesine[angle]); ++ z = actor->z - actor->floorclip + (actor->height >> 1); ++ for (ix = 0; ix < 5; ix++) ++ { ++ mo = P_SpawnMobj(x, y, z, MT_SORCSPARK1); ++ if (mo) ++ { ++ rangle = angle + ((P_Random() % 5) << 1); ++ mo->momx = FixedMul(P_Random() % speed, finecosine[rangle]); ++ mo->momy = FixedMul(P_Random() % speed, finesine[rangle]); ++ mo->momz = FRACUNIT * 2; ++ } ++ } ++} ++ ++ ++//============================================================================ ++// Yellow spell - offense ++//============================================================================ ++ ++void A_SorcFX1Seek(mobj_t * actor) ++{ ++ A_BounceCheck(actor); ++ P_SeekerMissile(actor, ANG1 * 2, ANG1 * 6); ++} ++ ++ ++//============================================================================ ++// Blue spell - defense ++//============================================================================ ++// ++// FX2 Variables ++// special1 current angle ++// special2 ++// args[0] 0 = CW, 1 = CCW ++// args[1] ++//============================================================================ ++ ++// Split ball in two ++void A_SorcFX2Split(mobj_t * actor) ++{ ++ mobj_t *mo; ++ ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_SORCFX2); ++ if (mo) ++ { ++ mo->target = actor->target; ++ mo->args[0] = 0; // CW ++ mo->special1.i = actor->angle; // Set angle ++ P_SetMobjStateNF(mo, S_SORCFX2_ORBIT1); ++ } ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_SORCFX2); ++ if (mo) ++ { ++ mo->target = actor->target; ++ mo->args[0] = 1; // CCW ++ mo->special1.i = actor->angle; // Set angle ++ P_SetMobjStateNF(mo, S_SORCFX2_ORBIT1); ++ } ++ P_SetMobjStateNF(actor, S_NULL); ++} ++ ++ ++// Orbit FX2 about sorcerer ++void A_SorcFX2Orbit(mobj_t * actor) ++{ ++ angle_t angle; ++ fixed_t x, y, z; ++ mobj_t *parent = actor->target; ++ fixed_t dist = parent->info->radius; ++ ++ if ((parent->health <= 0) || // Sorcerer is dead ++ (!parent->args[0])) // Time expired ++ { ++ P_SetMobjStateNF(actor, actor->info->deathstate); ++ parent->args[0] = 0; ++ parent->flags2 &= ~MF2_REFLECTIVE; ++ parent->flags2 &= ~MF2_INVULNERABLE; ++ } ++ ++ if (actor->args[0] && (parent->args[0]-- <= 0)) // Time expired ++ { ++ P_SetMobjStateNF(actor, actor->info->deathstate); ++ parent->args[0] = 0; ++ parent->flags2 &= ~MF2_REFLECTIVE; ++ } ++ ++ // Move to new position based on angle ++ if (actor->args[0]) // Counter clock-wise ++ { ++ actor->special1.i += ANG1 * 10; ++ angle = ((angle_t) actor->special1.i) >> ANGLETOFINESHIFT; ++ x = parent->x + FixedMul(dist, finecosine[angle]); ++ y = parent->y + FixedMul(dist, finesine[angle]); ++ z = parent->z - parent->floorclip + SORC_DEFENSE_HEIGHT * FRACUNIT; ++ z += FixedMul(15 * FRACUNIT, finecosine[angle]); ++ // Spawn trailer ++ P_SpawnMobj(x, y, z, MT_SORCFX2_T1); ++ } ++ else // Clock wise ++ { ++ actor->special1.i -= ANG1 * 10; ++ angle = ((angle_t) actor->special1.i) >> ANGLETOFINESHIFT; ++ x = parent->x + FixedMul(dist, finecosine[angle]); ++ y = parent->y + FixedMul(dist, finesine[angle]); ++ z = parent->z - parent->floorclip + SORC_DEFENSE_HEIGHT * FRACUNIT; ++ z += FixedMul(20 * FRACUNIT, finesine[angle]); ++ // Spawn trailer ++ P_SpawnMobj(x, y, z, MT_SORCFX2_T1); ++ } ++ ++ actor->x = x; ++ actor->y = y; ++ actor->z = z; ++} ++ ++ ++ ++//============================================================================ ++// Green spell - spawn bishops ++//============================================================================ ++ ++void A_SpawnBishop(mobj_t * actor) ++{ ++ mobj_t *mo; ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_BISHOP); ++ if (mo) ++ { ++ if (!P_TestMobjLocation(mo)) ++ { ++ P_SetMobjState(mo, S_NULL); ++ } ++ } ++ P_SetMobjState(actor, S_NULL); ++} ++ ++/* ++void A_SmokePuffEntry(mobj_t *actor) ++{ ++ P_SpawnMobj(actor->x, actor->y, actor->z, MT_MNTRSMOKE); ++} ++*/ ++ ++void A_SmokePuffExit(mobj_t * actor) ++{ ++ P_SpawnMobj(actor->x, actor->y, actor->z, MT_MNTRSMOKEEXIT); ++} ++ ++void A_SorcererBishopEntry(mobj_t * actor) ++{ ++ P_SpawnMobj(actor->x, actor->y, actor->z, MT_SORCFX3_EXPLOSION); ++ S_StartSound(actor, actor->info->seesound); ++} ++ ++ ++//============================================================================ ++// FX4 - rapid fire balls ++//============================================================================ ++ ++void A_SorcFX4Check(mobj_t * actor) ++{ ++ if (actor->special2.i-- <= 0) ++ { ++ P_SetMobjStateNF(actor, actor->info->deathstate); ++ } ++} ++ ++//============================================================================ ++// Ball death - spawn stuff ++//============================================================================ ++ ++void A_SorcBallPop(mobj_t * actor) ++{ ++ S_StartSound(NULL, SFX_SORCERER_BALLPOP); ++ actor->flags &= ~MF_NOGRAVITY; ++ actor->flags2 |= MF2_LOGRAV; ++ actor->momx = ((P_Random() % 10) - 5) << FRACBITS; ++ actor->momy = ((P_Random() % 10) - 5) << FRACBITS; ++ actor->momz = (2 + (P_Random() % 3)) << FRACBITS; ++ actor->special2.i = 4 * FRACUNIT; // Initial bounce factor ++ actor->args[4] = BOUNCE_TIME_UNIT; // Bounce time unit ++ actor->args[3] = 5; // Bounce time in seconds ++} ++ ++ ++ ++void A_BounceCheck(mobj_t * actor) ++{ ++ if (actor->args[4]-- <= 0) ++ { ++ if (actor->args[3]-- <= 0) ++ { ++ P_SetMobjState(actor, actor->info->deathstate); ++ switch (actor->type) ++ { ++ case MT_SORCBALL1: ++ case MT_SORCBALL2: ++ case MT_SORCBALL3: ++ S_StartSound(NULL, SFX_SORCERER_BIGBALLEXPLODE); ++ break; ++ case MT_SORCFX1: ++ S_StartSound(NULL, SFX_SORCERER_HEADSCREAM); ++ break; ++ default: ++ break; ++ } ++ } ++ else ++ { ++ actor->args[4] = BOUNCE_TIME_UNIT; ++ } ++ } ++} ++ ++ ++ ++ ++//============================================================================ ++// Class Bosses ++//============================================================================ ++#define CLASS_BOSS_STRAFE_RANGE 64*10*FRACUNIT ++ ++void A_FastChase(mobj_t * actor) ++{ ++ int delta; ++ fixed_t dist; ++ angle_t ang; ++ mobj_t *target; ++ ++ if (actor->reactiontime) ++ { ++ actor->reactiontime--; ++ } ++ ++ // Modify target threshold ++ if (actor->threshold) ++ { ++ actor->threshold--; ++ } ++ ++ if (gameskill == sk_nightmare) ++ { // Monsters move faster in nightmare mode ++ actor->tics -= actor->tics / 2; ++ if (actor->tics < 3) ++ { ++ actor->tics = 3; ++ } ++ } ++ ++// ++// turn towards movement direction if not there yet ++// ++ if (actor->movedir < 8) ++ { ++ actor->angle &= (7 << 29); ++ delta = actor->angle - (actor->movedir << 29); ++ if (delta > 0) ++ { ++ actor->angle -= ANG90 / 2; ++ } ++ else if (delta < 0) ++ { ++ actor->angle += ANG90 / 2; ++ } ++ } ++ ++ if (!actor->target || !(actor->target->flags & MF_SHOOTABLE)) ++ { // look for a new target ++ if (P_LookForPlayers(actor, true)) ++ { // got a new target ++ return; ++ } ++ P_SetMobjState(actor, actor->info->spawnstate); ++ return; ++ } ++ ++// ++// don't attack twice in a row ++// ++ if (actor->flags & MF_JUSTATTACKED) ++ { ++ actor->flags &= ~MF_JUSTATTACKED; ++ if (gameskill != sk_nightmare) ++ P_NewChaseDir(actor); ++ return; ++ } ++ ++ // Strafe ++ if (actor->special2.i > 0) ++ { ++ actor->special2.i--; ++ } ++ else ++ { ++ target = actor->target; ++ actor->special2.i = 0; ++ actor->momx = actor->momy = 0; ++ dist = P_AproxDistance(actor->x - target->x, actor->y - target->y); ++ if (dist < CLASS_BOSS_STRAFE_RANGE) ++ { ++ if (P_Random() < 100) ++ { ++ ang = R_PointToAngle2(actor->x, actor->y, ++ target->x, target->y); ++ if (P_Random() < 128) ++ ang += ANG90; ++ else ++ ang -= ANG90; ++ ang >>= ANGLETOFINESHIFT; ++ actor->momx = FixedMul(13 * FRACUNIT, finecosine[ang]); ++ actor->momy = FixedMul(13 * FRACUNIT, finesine[ang]); ++ actor->special2.i = 3; // strafe time ++ } ++ } ++ } ++ ++// ++// check for missile attack ++// ++ if (actor->info->missilestate) ++ { ++ if (gameskill < sk_nightmare && actor->movecount) ++ goto nomissile; ++ if (!P_CheckMissileRange(actor)) ++ goto nomissile; ++ P_SetMobjState(actor, actor->info->missilestate); ++ actor->flags |= MF_JUSTATTACKED; ++ return; ++ } ++ nomissile: ++ ++// ++// possibly choose another target ++// ++ if (netgame && !actor->threshold && !P_CheckSight(actor, actor->target)) ++ { ++ if (P_LookForPlayers(actor, true)) ++ return; // got a new target ++ } ++ ++// ++// chase towards player ++// ++ if (!actor->special2.i) ++ { ++ if (--actor->movecount < 0 || !P_Move(actor)) ++ { ++ P_NewChaseDir(actor); ++ } ++ } ++} ++ ++ ++void A_FighterAttack(mobj_t * actor) ++{ ++ if (!actor->target) ++ return; ++ A_FSwordAttack2(actor); ++} ++ ++ ++void A_ClericAttack(mobj_t * actor) ++{ ++ if (!actor->target) ++ return; ++ A_CHolyAttack3(actor); ++} ++ ++ ++ ++void A_MageAttack(mobj_t * actor) ++{ ++ if (!actor->target) ++ return; ++ A_MStaffAttack2(actor); ++} ++ ++void A_ClassBossHealth(mobj_t * actor) ++{ ++ if (netgame && !deathmatch) // co-op only ++ { ++ if (!actor->special1.i) ++ { ++ actor->health *= 5; ++ actor->special1.i = true; // has been initialized ++ } ++ } ++} ++ ++ ++//=========================================================================== ++// ++// A_CheckFloor - Checks if an object hit the floor ++// ++//=========================================================================== ++ ++void A_CheckFloor(mobj_t * actor) ++{ ++ if (actor->z <= actor->floorz) ++ { ++ actor->z = actor->floorz; ++ actor->flags2 &= ~MF2_LOGRAV; ++ P_SetMobjState(actor, actor->info->deathstate); ++ } ++} ++ ++//============================================================================ ++// ++// A_FreezeDeath ++// ++//============================================================================ ++ ++void A_FreezeDeath(mobj_t * actor) ++{ ++ int r = P_Random(); ++ actor->tics = 75 + r + P_Random(); ++ actor->flags |= MF_SOLID | MF_SHOOTABLE | MF_NOBLOOD; ++ actor->flags2 |= MF2_PUSHABLE | MF2_TELESTOMP | MF2_PASSMOBJ | MF2_SLIDE; ++ actor->height <<= 2; ++ S_StartSound(actor, SFX_FREEZE_DEATH); ++ ++ if (actor->player) ++ { ++ actor->player->damagecount = 0; ++ actor->player->poisoncount = 0; ++ actor->player->bonuscount = 0; ++ if (actor->player == &players[consoleplayer]) ++ { ++ SB_PaletteFlash(false); ++ } ++ } ++ else if (actor->flags & MF_COUNTKILL && actor->special) ++ { ++ // Initiate monster death actions. ++ P_ExecuteLineSpecial(actor->special, actor->args, NULL, 0, actor); ++ } ++} ++ ++//============================================================================ ++// ++// A_IceSetTics ++// ++//============================================================================ ++ ++void A_IceSetTics(mobj_t * actor) ++{ ++ int floor; ++ ++ actor->tics = 70 + (P_Random() & 63); ++ floor = P_GetThingFloorType(actor); ++ if (floor == FLOOR_LAVA) ++ { ++ actor->tics >>= 2; ++ } ++ else if (floor == FLOOR_ICE) ++ { ++ actor->tics <<= 1; ++ } ++} ++ ++//============================================================================ ++// ++// A_IceCheckHeadDone ++// ++//============================================================================ ++ ++void A_IceCheckHeadDone(mobj_t * actor) ++{ ++ if (actor->special2.i == 666) ++ { ++ P_SetMobjState(actor, S_ICECHUNK_HEAD2); ++ } ++} ++ ++//============================================================================ ++// ++// A_FreezeDeathChunks ++// ++//============================================================================ ++ ++void A_FreezeDeathChunks(mobj_t * actor) ++{ ++ int i; ++ int r1,r2,r3; ++ mobj_t *mo; ++ ++ if (actor->momx || actor->momy || actor->momz) ++ { ++ actor->tics = 105; ++ return; ++ } ++ S_StartSound(actor, SFX_FREEZE_SHATTER); ++ ++ for (i = 12 + (P_Random() & 15); i >= 0; i--) ++ { ++ r1 = P_Random(); ++ r2 = P_Random(); ++ r3 = P_Random(); ++ mo = P_SpawnMobj(actor->x + ++ (((r3 - 128) * actor->radius) >> 7), ++ actor->y + ++ (((r2 - 128) * actor->radius) >> 7), ++ actor->z + (r1 * actor->height / 255), ++ MT_ICECHUNK); ++ P_SetMobjState(mo, mo->info->spawnstate + (P_Random() % 3)); ++ mo->momz = FixedDiv(mo->z - actor->z, actor->height) << 2; ++ mo->momx = P_SubRandom() << (FRACBITS - 7); ++ mo->momy = P_SubRandom() << (FRACBITS - 7); ++ A_IceSetTics(mo); // set a random tic wait ++ } ++ for (i = 12 + (P_Random() & 15); i >= 0; i--) ++ { ++ r1 = P_Random(); ++ r2 = P_Random(); ++ r3 = P_Random(); ++ mo = P_SpawnMobj(actor->x + ++ (((r3 - 128) * actor->radius) >> 7), ++ actor->y + ++ (((r2 - 128) * actor->radius) >> 7), ++ actor->z + (r1 * actor->height / 255), ++ MT_ICECHUNK); ++ P_SetMobjState(mo, mo->info->spawnstate + (P_Random() % 3)); ++ mo->momz = FixedDiv(mo->z - actor->z, actor->height) << 2; ++ mo->momx = P_SubRandom() << (FRACBITS - 7); ++ mo->momy = P_SubRandom() << (FRACBITS - 7); ++ A_IceSetTics(mo); // set a random tic wait ++ } ++ if (actor->player) ++ { // attach the player's view to a chunk of ice ++ mo = P_SpawnMobj(actor->x, actor->y, actor->z + VIEWHEIGHT, ++ MT_ICECHUNK); ++ P_SetMobjState(mo, S_ICECHUNK_HEAD); ++ mo->momz = FixedDiv(mo->z - actor->z, actor->height) << 2; ++ mo->momx = P_SubRandom() << (FRACBITS - 7); ++ mo->momy = P_SubRandom() << (FRACBITS - 7); ++ mo->flags2 |= MF2_ICEDAMAGE; // used to force blue palette ++ mo->flags2 &= ~MF2_FLOORCLIP; ++ mo->player = actor->player; ++ actor->player = NULL; ++ mo->health = actor->health; ++ mo->angle = actor->angle; ++ mo->player->mo = mo; ++ mo->player->lookdir = 0; ++ } ++ P_RemoveMobjFromTIDList(actor); ++ P_SetMobjState(actor, S_FREETARGMOBJ); ++ actor->flags2 |= MF2_DONTDRAW; ++} ++ ++//=========================================================================== ++// Korax Variables ++// special1 last teleport destination ++// special2 set if "below half" script not yet run ++// ++// Korax Scripts (reserved) ++// 249 Tell scripts that we are below half health ++// 250-254 Control scripts ++// 255 Death script ++// ++// Korax TIDs (reserved) ++// 245 Reserved for Korax himself ++// 248 Initial teleport destination ++// 249 Teleport destination ++// 250-254 For use in respective control scripts ++// 255 For use in death script (spawn spots) ++//=========================================================================== ++#define KORAX_SPIRIT_LIFETIME (5*(35/5)) // 5 seconds ++#define KORAX_COMMAND_HEIGHT (120*FRACUNIT) ++#define KORAX_COMMAND_OFFSET (27*FRACUNIT) ++ ++void KoraxFire1(mobj_t * actor, int type); ++void KoraxFire2(mobj_t * actor, int type); ++void KoraxFire3(mobj_t * actor, int type); ++void KoraxFire4(mobj_t * actor, int type); ++void KoraxFire5(mobj_t * actor, int type); ++void KoraxFire6(mobj_t * actor, int type); ++void KSpiritInit(mobj_t * spirit, mobj_t * korax); ++ ++#define KORAX_TID (245) ++#define KORAX_FIRST_TELEPORT_TID (248) ++#define KORAX_TELEPORT_TID (249) ++ ++void A_KoraxChase(mobj_t * actor) ++{ ++ mobj_t *spot; ++ int lastfound; ++ byte args[3] = {0, 0, 0}; ++ ++ if ((!actor->special2.i) && ++ (actor->health <= (actor->info->spawnhealth / 2))) ++ { ++ lastfound = 0; ++ spot = P_FindMobjFromTID(KORAX_FIRST_TELEPORT_TID, &lastfound); ++ if (spot) ++ { ++ P_Teleport(actor, spot->x, spot->y, spot->angle, true); ++ } ++ ++ CheckACSPresent(249); ++ P_StartACS(249, 0, args, actor, NULL, 0); ++ actor->special2.i = 1; // Don't run again ++ ++ return; ++ } ++ ++ if (!actor->target) ++ return; ++ if (P_Random() < 30) ++ { ++ P_SetMobjState(actor, actor->info->missilestate); ++ } ++ else if (P_Random() < 30) ++ { ++ S_StartSound(NULL, SFX_KORAX_ACTIVE); ++ } ++ ++ // Teleport away ++ if (actor->health < (actor->info->spawnhealth >> 1)) ++ { ++ if (P_Random() < 10) ++ { ++ lastfound = actor->special1.i; ++ spot = P_FindMobjFromTID(KORAX_TELEPORT_TID, &lastfound); ++ actor->special1.i = lastfound; ++ if (spot) ++ { ++ P_Teleport(actor, spot->x, spot->y, spot->angle, true); ++ } ++ } ++ } ++} ++ ++void A_KoraxStep(mobj_t * actor) ++{ ++ A_Chase(actor); ++} ++ ++void A_KoraxStep2(mobj_t * actor) ++{ ++ S_StartSound(NULL, SFX_KORAX_STEP); ++ A_Chase(actor); ++} ++ ++void A_KoraxBonePop(mobj_t * actor) ++{ ++ mobj_t *mo; ++ byte args[5]; ++ ++ args[0] = args[1] = args[2] = args[3] = args[4] = 0; ++ ++ // Spawn 6 spirits equalangularly ++ mo = P_SpawnMissileAngle(actor, MT_KORAX_SPIRIT1, ANG60 * 0, ++ 5 * FRACUNIT); ++ if (mo) ++ KSpiritInit(mo, actor); ++ mo = P_SpawnMissileAngle(actor, MT_KORAX_SPIRIT2, ANG60 * 1, ++ 5 * FRACUNIT); ++ if (mo) ++ KSpiritInit(mo, actor); ++ mo = P_SpawnMissileAngle(actor, MT_KORAX_SPIRIT3, ANG60 * 2, ++ 5 * FRACUNIT); ++ if (mo) ++ KSpiritInit(mo, actor); ++ mo = P_SpawnMissileAngle(actor, MT_KORAX_SPIRIT4, ANG60 * 3, ++ 5 * FRACUNIT); ++ if (mo) ++ KSpiritInit(mo, actor); ++ mo = P_SpawnMissileAngle(actor, MT_KORAX_SPIRIT5, ANG60 * 4, ++ 5 * FRACUNIT); ++ if (mo) ++ KSpiritInit(mo, actor); ++ mo = P_SpawnMissileAngle(actor, MT_KORAX_SPIRIT6, ANG60 * 5, ++ 5 * FRACUNIT); ++ if (mo) ++ KSpiritInit(mo, actor); ++ ++ CheckACSPresent(255); ++ P_StartACS(255, 0, args, actor, NULL, 0); // Death script ++} ++ ++void KSpiritInit(mobj_t * spirit, mobj_t * korax) ++{ ++ int i; ++ mobj_t *tail, *next; ++ ++ spirit->health = KORAX_SPIRIT_LIFETIME; ++ ++ spirit->special1.m = korax; // Swarm around korax ++ spirit->special2.i = 32 + (P_Random() & 7); // Float bob index ++ spirit->args[0] = 10; // initial turn value ++ spirit->args[1] = 0; // initial look angle ++ ++ // Spawn a tail for spirit ++ tail = P_SpawnMobj(spirit->x, spirit->y, spirit->z, MT_HOLY_TAIL); ++ tail->special2.m = spirit; // parent ++ for (i = 1; i < 3; i++) ++ { ++ next = P_SpawnMobj(spirit->x, spirit->y, spirit->z, MT_HOLY_TAIL); ++ P_SetMobjState(next, next->info->spawnstate + 1); ++ tail->special1.m = next; ++ tail = next; ++ } ++ tail->special1.m = NULL; // last tail bit ++} ++ ++void A_KoraxDecide(mobj_t * actor) ++{ ++ if (P_Random() < 220) ++ { ++ P_SetMobjState(actor, S_KORAX_MISSILE1); ++ } ++ else ++ { ++ P_SetMobjState(actor, S_KORAX_COMMAND1); ++ } ++} ++ ++void A_KoraxMissile(mobj_t * actor) ++{ ++ int type = P_Random() % 6; ++ int sound = 0; ++ ++ S_StartSound(actor, SFX_KORAX_ATTACK); ++ ++ switch (type) ++ { ++ case 0: ++ type = MT_WRAITHFX1; ++ sound = SFX_WRAITH_MISSILE_FIRE; ++ break; ++ case 1: ++ type = MT_DEMONFX1; ++ sound = SFX_DEMON_MISSILE_FIRE; ++ break; ++ case 2: ++ type = MT_DEMON2FX1; ++ sound = SFX_DEMON_MISSILE_FIRE; ++ break; ++ case 3: ++ type = MT_FIREDEMON_FX6; ++ sound = SFX_FIRED_ATTACK; ++ break; ++ case 4: ++ type = MT_CENTAUR_FX; ++ sound = SFX_CENTAURLEADER_ATTACK; ++ break; ++ case 5: ++ type = MT_SERPENTFX; ++ sound = SFX_CENTAURLEADER_ATTACK; ++ break; ++ } ++ ++ // Fire all 6 missiles at once ++ S_StartSound(NULL, sound); ++ KoraxFire1(actor, type); ++ KoraxFire2(actor, type); ++ KoraxFire3(actor, type); ++ KoraxFire4(actor, type); ++ KoraxFire5(actor, type); ++ KoraxFire6(actor, type); ++} ++ ++ ++// Call action code scripts (250-254) ++void A_KoraxCommand(mobj_t * actor) ++{ ++ byte args[5]; ++ fixed_t x, y, z; ++ angle_t ang; ++ int numcommands; ++ ++ S_StartSound(actor, SFX_KORAX_COMMAND); ++ ++ // Shoot stream of lightning to ceiling ++ ang = (actor->angle - ANG90) >> ANGLETOFINESHIFT; ++ x = actor->x + FixedMul(KORAX_COMMAND_OFFSET, finecosine[ang]); ++ y = actor->y + FixedMul(KORAX_COMMAND_OFFSET, finesine[ang]); ++ z = actor->z + KORAX_COMMAND_HEIGHT; ++ P_SpawnMobj(x, y, z, MT_KORAX_BOLT); ++ ++ args[0] = args[1] = args[2] = args[3] = args[4] = 0; ++ ++ if (actor->health <= (actor->info->spawnhealth >> 1)) ++ { ++ numcommands = 5; ++ } ++ else ++ { ++ numcommands = 4; ++ } ++ ++ switch (P_Random() % numcommands) ++ { ++ case 0: ++ CheckACSPresent(250); ++ P_StartACS(250, 0, args, actor, NULL, 0); ++ break; ++ case 1: ++ CheckACSPresent(251); ++ P_StartACS(251, 0, args, actor, NULL, 0); ++ break; ++ case 2: ++ CheckACSPresent(252); ++ P_StartACS(252, 0, args, actor, NULL, 0); ++ break; ++ case 3: ++ CheckACSPresent(253); ++ P_StartACS(253, 0, args, actor, NULL, 0); ++ break; ++ case 4: ++ CheckACSPresent(254); ++ P_StartACS(254, 0, args, actor, NULL, 0); ++ break; ++ } ++} ++ ++ ++#define KORAX_DELTAANGLE (85*ANG1) ++#define KORAX_ARM_EXTENSION_SHORT (40*FRACUNIT) ++#define KORAX_ARM_EXTENSION_LONG (55*FRACUNIT) ++ ++#define KORAX_ARM1_HEIGHT (108*FRACUNIT) ++#define KORAX_ARM2_HEIGHT (82*FRACUNIT) ++#define KORAX_ARM3_HEIGHT (54*FRACUNIT) ++#define KORAX_ARM4_HEIGHT (104*FRACUNIT) ++#define KORAX_ARM5_HEIGHT (86*FRACUNIT) ++#define KORAX_ARM6_HEIGHT (53*FRACUNIT) ++ ++ ++// Arm projectiles ++// arm positions numbered: ++// 1 top left ++// 2 middle left ++// 3 lower left ++// 4 top right ++// 5 middle right ++// 6 lower right ++ ++ ++// Arm 1 projectile ++void KoraxFire1(mobj_t * actor, int type) ++{ ++ angle_t ang; ++ fixed_t x, y, z; ++ ++ ang = (actor->angle - KORAX_DELTAANGLE) >> ANGLETOFINESHIFT; ++ x = actor->x + FixedMul(KORAX_ARM_EXTENSION_SHORT, finecosine[ang]); ++ y = actor->y + FixedMul(KORAX_ARM_EXTENSION_SHORT, finesine[ang]); ++ z = actor->z - actor->floorclip + KORAX_ARM1_HEIGHT; ++ P_SpawnKoraxMissile(x, y, z, actor, actor->target, type); ++} ++ ++ ++// Arm 2 projectile ++void KoraxFire2(mobj_t * actor, int type) ++{ ++ angle_t ang; ++ fixed_t x, y, z; ++ ++ ang = (actor->angle - KORAX_DELTAANGLE) >> ANGLETOFINESHIFT; ++ x = actor->x + FixedMul(KORAX_ARM_EXTENSION_LONG, finecosine[ang]); ++ y = actor->y + FixedMul(KORAX_ARM_EXTENSION_LONG, finesine[ang]); ++ z = actor->z - actor->floorclip + KORAX_ARM2_HEIGHT; ++ P_SpawnKoraxMissile(x, y, z, actor, actor->target, type); ++} ++ ++// Arm 3 projectile ++void KoraxFire3(mobj_t * actor, int type) ++{ ++ angle_t ang; ++ fixed_t x, y, z; ++ ++ ang = (actor->angle - KORAX_DELTAANGLE) >> ANGLETOFINESHIFT; ++ x = actor->x + FixedMul(KORAX_ARM_EXTENSION_LONG, finecosine[ang]); ++ y = actor->y + FixedMul(KORAX_ARM_EXTENSION_LONG, finesine[ang]); ++ z = actor->z - actor->floorclip + KORAX_ARM3_HEIGHT; ++ P_SpawnKoraxMissile(x, y, z, actor, actor->target, type); ++} ++ ++// Arm 4 projectile ++void KoraxFire4(mobj_t * actor, int type) ++{ ++ angle_t ang; ++ fixed_t x, y, z; ++ ++ ang = (actor->angle + KORAX_DELTAANGLE) >> ANGLETOFINESHIFT; ++ x = actor->x + FixedMul(KORAX_ARM_EXTENSION_SHORT, finecosine[ang]); ++ y = actor->y + FixedMul(KORAX_ARM_EXTENSION_SHORT, finesine[ang]); ++ z = actor->z - actor->floorclip + KORAX_ARM4_HEIGHT; ++ P_SpawnKoraxMissile(x, y, z, actor, actor->target, type); ++} ++ ++// Arm 5 projectile ++void KoraxFire5(mobj_t * actor, int type) ++{ ++ angle_t ang; ++ fixed_t x, y, z; ++ ++ ang = (actor->angle + KORAX_DELTAANGLE) >> ANGLETOFINESHIFT; ++ x = actor->x + FixedMul(KORAX_ARM_EXTENSION_LONG, finecosine[ang]); ++ y = actor->y + FixedMul(KORAX_ARM_EXTENSION_LONG, finesine[ang]); ++ z = actor->z - actor->floorclip + KORAX_ARM5_HEIGHT; ++ P_SpawnKoraxMissile(x, y, z, actor, actor->target, type); ++} ++ ++// Arm 6 projectile ++void KoraxFire6(mobj_t * actor, int type) ++{ ++ angle_t ang; ++ fixed_t x, y, z; ++ ++ ang = (actor->angle + KORAX_DELTAANGLE) >> ANGLETOFINESHIFT; ++ x = actor->x + FixedMul(KORAX_ARM_EXTENSION_LONG, finecosine[ang]); ++ y = actor->y + FixedMul(KORAX_ARM_EXTENSION_LONG, finesine[ang]); ++ z = actor->z - actor->floorclip + KORAX_ARM6_HEIGHT; ++ P_SpawnKoraxMissile(x, y, z, actor, actor->target, type); ++} ++ ++ ++void A_KSpiritWeave(mobj_t * actor) ++{ ++ fixed_t newX, newY; ++ int weaveXY, weaveZ; ++ int angle; ++ ++ weaveXY = actor->special2.i >> 16; ++ weaveZ = actor->special2.i & 0xFFFF; ++ angle = (actor->angle + ANG90) >> ANGLETOFINESHIFT; ++ newX = actor->x - FixedMul(finecosine[angle], ++ FloatBobOffsets[weaveXY] << 2); ++ newY = actor->y - FixedMul(finesine[angle], ++ FloatBobOffsets[weaveXY] << 2); ++ weaveXY = (weaveXY + (P_Random() % 5)) & 63; ++ newX += FixedMul(finecosine[angle], FloatBobOffsets[weaveXY] << 2); ++ newY += FixedMul(finesine[angle], FloatBobOffsets[weaveXY] << 2); ++ P_TryMove(actor, newX, newY); ++ actor->z -= FloatBobOffsets[weaveZ] << 1; ++ weaveZ = (weaveZ + (P_Random() % 5)) & 63; ++ actor->z += FloatBobOffsets[weaveZ] << 1; ++ actor->special2.i = weaveZ + (weaveXY << 16); ++} ++ ++void A_KSpiritSeeker(mobj_t * actor, angle_t thresh, angle_t turnMax) ++{ ++ int dir; ++ int dist; ++ angle_t delta; ++ angle_t angle; ++ mobj_t *target; ++ fixed_t newZ; ++ fixed_t deltaZ; ++ ++ target = actor->special1.m; ++ if (target == NULL) ++ { ++ return; ++ } ++ dir = P_FaceMobj(actor, target, &delta); ++ if (delta > thresh) ++ { ++ delta >>= 1; ++ if (delta > turnMax) ++ { ++ delta = turnMax; ++ } ++ } ++ if (dir) ++ { // Turn clockwise ++ actor->angle += delta; ++ } ++ else ++ { // Turn counter clockwise ++ actor->angle -= delta; ++ } ++ angle = actor->angle >> ANGLETOFINESHIFT; ++ actor->momx = FixedMul(actor->info->speed, finecosine[angle]); ++ actor->momy = FixedMul(actor->info->speed, finesine[angle]); ++ ++ if (!(leveltime & 15) ++ || actor->z > target->z + (target->info->height) ++ || actor->z + actor->height < target->z) ++ { ++ newZ = target->z + ((P_Random() * target->info->height) >> 8); ++ deltaZ = newZ - actor->z; ++ if (abs(deltaZ) > 15 * FRACUNIT) ++ { ++ if (deltaZ > 0) ++ { ++ deltaZ = 15 * FRACUNIT; ++ } ++ else ++ { ++ deltaZ = -15 * FRACUNIT; ++ } ++ } ++ dist = P_AproxDistance(target->x - actor->x, target->y - actor->y); ++ dist = dist / actor->info->speed; ++ if (dist < 1) ++ { ++ dist = 1; ++ } ++ actor->momz = deltaZ / dist; ++ } ++ return; ++} ++ ++ ++void A_KSpiritRoam(mobj_t * actor) ++{ ++ if (actor->health-- <= 0) ++ { ++ S_StartSound(actor, SFX_SPIRIT_DIE); ++ P_SetMobjState(actor, S_KSPIRIT_DEATH1); ++ } ++ else ++ { ++ if (actor->special1.m) ++ { ++ A_KSpiritSeeker(actor, actor->args[0] * ANG1, ++ actor->args[0] * ANG1 * 2); ++ } ++ A_KSpiritWeave(actor); ++ if (P_Random() < 50) ++ { ++ S_StartSound(NULL, SFX_SPIRIT_ACTIVE); ++ } ++ } ++} ++ ++void A_KBolt(mobj_t * actor) ++{ ++ // Countdown lifetime ++ if (actor->special1.i-- <= 0) ++ { ++ P_SetMobjState(actor, S_NULL); ++ } ++} ++ ++ ++#define KORAX_BOLT_HEIGHT 48*FRACUNIT ++#define KORAX_BOLT_LIFETIME 3 ++ ++void A_KBoltRaise(mobj_t * actor) ++{ ++ mobj_t *mo; ++ fixed_t z; ++ ++ // Spawn a child upward ++ z = actor->z + KORAX_BOLT_HEIGHT; ++ ++ if ((z + KORAX_BOLT_HEIGHT) < actor->ceilingz) ++ { ++ mo = P_SpawnMobj(actor->x, actor->y, z, MT_KORAX_BOLT); ++ if (mo) ++ { ++ mo->special1.i = KORAX_BOLT_LIFETIME; ++ } ++ } ++ else ++ { ++ // Maybe cap it off here ++ } ++} diff --git a/tests/capture_tools_output/shenxianpeng/test-repo/expected-result_662ad4-0.json b/tests/capture_tools_output/shenxianpeng/test-repo/expected-result_662ad4-0.json new file mode 100644 index 0000000..18aa957 --- /dev/null +++ b/tests/capture_tools_output/shenxianpeng/test-repo/expected-result_662ad4-0.json @@ -0,0 +1,19 @@ +[ + { + "filename": "p_enemy.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5404 + ] + ], + "lines_added": [ + [ + 1, + 5404 + ] + ] + } + } +] diff --git a/tests/capture_tools_output/shenxianpeng/test-repo/expected-result_662ad4-1.json b/tests/capture_tools_output/shenxianpeng/test-repo/expected-result_662ad4-1.json new file mode 100644 index 0000000..18aa957 --- /dev/null +++ b/tests/capture_tools_output/shenxianpeng/test-repo/expected-result_662ad4-1.json @@ -0,0 +1,19 @@ +[ + { + "filename": "p_enemy.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5404 + ] + ], + "lines_added": [ + [ + 1, + 5404 + ] + ] + } + } +] diff --git a/tests/capture_tools_output/shenxianpeng/test-repo/expected-result_662ad4-2.json b/tests/capture_tools_output/shenxianpeng/test-repo/expected-result_662ad4-2.json new file mode 100644 index 0000000..18aa957 --- /dev/null +++ b/tests/capture_tools_output/shenxianpeng/test-repo/expected-result_662ad4-2.json @@ -0,0 +1,19 @@ +[ + { + "filename": "p_enemy.c", + "line_filter": { + "diff_chunks": [ + [ + 1, + 5404 + ] + ], + "lines_added": [ + [ + 1, + 5404 + ] + ] + } + } +] diff --git a/tests/demo/.clang-format b/tests/demo/.clang-format new file mode 100644 index 0000000..1dd236c --- /dev/null +++ b/tests/demo/.clang-format @@ -0,0 +1,3 @@ +--- +Language: Cpp +BasedOnStyle: WebKit diff --git a/tests/demo/.clang-tidy b/tests/demo/.clang-tidy new file mode 100644 index 0000000..d3865ad --- /dev/null +++ b/tests/demo/.clang-tidy @@ -0,0 +1,186 @@ +--- +Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,performance-*,bugprone-*,clang-analyzer-*,mpi-*,misc-*,readability-*' +WarningsAsErrors: '' +HeaderFilterRegex: '' +AnalyzeTemporaryDtors: false +FormatStyle: 'file' +CheckOptions: + - key: bugprone-argument-comment.CommentBoolLiterals + value: '0' + - key: bugprone-argument-comment.CommentCharacterLiterals + value: '0' + - key: bugprone-argument-comment.CommentFloatLiterals + value: '0' + - key: bugprone-argument-comment.CommentIntegerLiterals + value: '0' + - key: bugprone-argument-comment.CommentNullPtrs + value: '0' + - key: bugprone-argument-comment.CommentStringLiterals + value: '0' + - key: bugprone-argument-comment.CommentUserDefinedLiterals + value: '0' + - key: bugprone-argument-comment.IgnoreSingleArgument + value: '0' + - key: bugprone-argument-comment.StrictMode + value: '0' + - key: bugprone-assert-side-effect.AssertMacros + value: assert + - key: bugprone-assert-side-effect.CheckFunctionCalls + value: '0' + - key: bugprone-dangling-handle.HandleClasses + value: 'std::basic_string_view;std::experimental::basic_string_view' + - key: bugprone-dynamic-static-initializers.HeaderFileExtensions + value: ',h,hh,hpp,hxx' + - key: bugprone-exception-escape.FunctionsThatShouldNotThrow + value: '' + - key: bugprone-exception-escape.IgnoredExceptions + value: '' + - key: bugprone-misplaced-widening-cast.CheckImplicitCasts + value: '0' + - key: bugprone-not-null-terminated-result.WantToUseSafeFunctions + value: '1' + - key: bugprone-signed-char-misuse.CharTypdefsToIgnore + value: '' + - key: bugprone-sizeof-expression.WarnOnSizeOfCompareToConstant + value: '1' + - key: bugprone-sizeof-expression.WarnOnSizeOfConstant + value: '1' + - key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression + value: '0' + - key: bugprone-sizeof-expression.WarnOnSizeOfThis + value: '1' + - key: bugprone-string-constructor.LargeLengthThreshold + value: '8388608' + - key: bugprone-string-constructor.WarnOnLargeLength + value: '1' + - key: bugprone-suspicious-enum-usage.StrictMode + value: '0' + - key: bugprone-suspicious-missing-comma.MaxConcatenatedTokens + value: '5' + - key: bugprone-suspicious-missing-comma.RatioThreshold + value: '0.200000' + - key: bugprone-suspicious-missing-comma.SizeThreshold + value: '5' + - key: bugprone-suspicious-string-compare.StringCompareLikeFunctions + value: '' + - key: bugprone-suspicious-string-compare.WarnOnImplicitComparison + value: '1' + - key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison + value: '0' + - key: bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit + value: '16' + - key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField + value: '1' + - key: bugprone-unused-return-value.CheckedFunctions + value: '::std::async;::std::launder;::std::remove;::std::remove_if;::std::unique;::std::unique_ptr::release;::std::basic_string::empty;::std::vector::empty' + - key: cert-dcl16-c.NewSuffixes + value: 'L;LL;LU;LLU' + - key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField + value: '0' + - key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors + value: '1' + - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic + value: '1' + - key: google-readability-braces-around-statements.ShortStatementLines + value: '1' + - key: google-readability-function-size.StatementThreshold + value: '800' + - key: google-readability-namespace-comments.ShortNamespaceLines + value: '10' + - key: google-readability-namespace-comments.SpacesBeforeComments + value: '2' + - key: misc-definitions-in-headers.HeaderFileExtensions + value: ',h,hh,hpp,hxx' + - key: misc-definitions-in-headers.UseHeaderFileExtension + value: '1' + - key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries + value: '1' + - key: misc-unused-parameters.StrictMode + value: '0' + - key: modernize-loop-convert.MaxCopySize + value: '16' + - key: modernize-loop-convert.MinConfidence + value: reasonable + - key: modernize-loop-convert.NamingStyle + value: CamelCase + - key: modernize-pass-by-value.IncludeStyle + value: llvm + - key: modernize-replace-auto-ptr.IncludeStyle + value: llvm + - key: modernize-use-nullptr.NullMacros + value: 'NULL' + - key: performance-faster-string-find.StringLikeClasses + value: 'std::basic_string' + - key: performance-for-range-copy.AllowedTypes + value: '' + - key: performance-for-range-copy.WarnOnAllAutoCopies + value: '0' + - key: performance-inefficient-string-concatenation.StrictMode + value: '0' + - key: performance-inefficient-vector-operation.EnableProto + value: '0' + - key: performance-inefficient-vector-operation.VectorLikeClasses + value: '::std::vector' + - key: performance-move-const-arg.CheckTriviallyCopyableMove + value: '1' + - key: performance-move-constructor-init.IncludeStyle + value: llvm + - key: performance-no-automatic-move.AllowedTypes + value: '' + - key: performance-type-promotion-in-math-fn.IncludeStyle + value: llvm + - key: performance-unnecessary-copy-initialization.AllowedTypes + value: '' + - key: performance-unnecessary-value-param.AllowedTypes + value: '' + - key: performance-unnecessary-value-param.IncludeStyle + value: llvm + - key: readability-braces-around-statements.ShortStatementLines + value: '0' + - key: readability-else-after-return.WarnOnUnfixable + value: '1' + - key: readability-function-size.BranchThreshold + value: '4294967295' + - key: readability-function-size.LineThreshold + value: '4294967295' + - key: readability-function-size.NestingThreshold + value: '4294967295' + - key: readability-function-size.ParameterThreshold + value: '4294967295' + - key: readability-function-size.StatementThreshold + value: '800' + - key: readability-function-size.VariableThreshold + value: '4294967295' + - key: readability-identifier-naming.IgnoreFailedSplit + value: '0' + - key: readability-implicit-bool-conversion.AllowIntegerConditions + value: '0' + - key: readability-implicit-bool-conversion.AllowPointerConditions + value: '0' + - key: readability-inconsistent-declaration-parameter-name.IgnoreMacros + value: '1' + - key: readability-inconsistent-declaration-parameter-name.Strict + value: '0' + - key: readability-magic-numbers.IgnoredFloatingPointValues + value: '1.0;100.0;' + - key: readability-magic-numbers.IgnoredIntegerValues + value: '1;2;3;4;' + - key: readability-redundant-member-init.IgnoreBaseInCopyConstructors + value: '0' + - key: readability-redundant-smartptr-get.IgnoreMacros + value: '1' + - key: readability-redundant-string-init.StringNames + value: '::std::basic_string' + - key: readability-simplify-boolean-expr.ChainedConditionalAssignment + value: '0' + - key: readability-simplify-boolean-expr.ChainedConditionalReturn + value: '0' + - key: readability-simplify-subscript-expr.Types + value: '::std::basic_string;::std::basic_string_view;::std::vector;::std::array' + - key: readability-static-accessed-through-instance.NameSpecifierNestingThreshold + value: '3' + - key: readability-uppercase-literal-suffix.IgnoreMacros + value: '1' + - key: readability-uppercase-literal-suffix.NewSuffixes + value: '' +... diff --git a/tests/demo/compile_flags.txt b/tests/demo/compile_flags.txt new file mode 100644 index 0000000..03e4446 --- /dev/null +++ b/tests/demo/compile_flags.txt @@ -0,0 +1,2 @@ +-Wall +-Werror diff --git a/tests/demo/demo.cpp b/tests/demo/demo.cpp new file mode 100644 index 0000000..1bf553e --- /dev/null +++ b/tests/demo/demo.cpp @@ -0,0 +1,18 @@ +/** This is a very ugly test code (doomed to fail linting) */ +#include "demo.hpp" +#include + + + + +int main(){ + + for (;;) break; + + + printf("Hello world!\n"); + + + + + return 0;} diff --git a/tests/demo/demo.hpp b/tests/demo/demo.hpp new file mode 100644 index 0000000..f93d012 --- /dev/null +++ b/tests/demo/demo.hpp @@ -0,0 +1,36 @@ +#pragma once + + + +class Dummy { + char* useless; + int numb; + Dummy() :numb(0), useless("\0"){} + + public: + void *not_useful(char *str){useless = str;} +}; + + + + + + + + + + + + + + + + + + +struct LongDiff +{ + + long diff; + +}; diff --git a/tests/demo/some source.cpp b/tests/demo/some source.cpp new file mode 100644 index 0000000..0ae13fb --- /dev/null +++ b/tests/demo/some source.cpp @@ -0,0 +1 @@ +#include diff --git a/tests/ignored_paths/.gitmodules b/tests/ignored_paths/.gitmodules new file mode 100644 index 0000000..3696a31 --- /dev/null +++ b/tests/ignored_paths/.gitmodules @@ -0,0 +1,12 @@ +[submodule "RF24"] + path = RF24 + url = https://github.com/nRF24/RF24.git +[submodule "RF24Network"] + path = RF24Network + url = https://github.com/nRF24/RF24Network.git +[submodule "RF24Mesh"] + path = RF24Mesh + url = https://github.com/nRF24/RF24Mesh.git +[submodule "pybind11"] + path = pybind11 + url = https://github.com/pybind/pybind11.git